From: support Date: Thu, 23 Jun 2022 16:31:40 +0000 (+0000) Subject: Built motion from commit a2cf73f7.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22https:/fonts.googleapis.com/icon?a=commitdiff_plain;h=08185170b922bc335330c3d6a8120d15ea8fa512;p=motion2.git Built motion from commit a2cf73f7.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index fc919dc..1b74cf4 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-23T07:12:49.513Z", + "time": "2022-06-23T16:23:22.290Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 737ee97..a92f66a 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-23T07:12:49.513Z", + "time": "2022-06-23T16:23:22.290Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/agent.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/agent.proto new file mode 100644 index 0000000..2e54b9e --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/agent.proto @@ -0,0 +1,342 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add +// [Intents][google.cloud.dialogflow.v2.Intents], +// [Contexts][google.cloud.dialogflow.v2.Contexts], [Entity +// Types][google.cloud.dialogflow.v2.EntityTypes], +// [Webhooks][google.cloud.dialogflow.v2.WebhookRequest], and so on to manage +// the flow of a conversation and match user input to predefined intents and +// actions. +// +// You can create an agent using both Dialogflow Standard Edition and +// Dialogflow Enterprise Edition. For details, see +// [Dialogflow Editions](/dialogflow-enterprise/docs/editions). +// +// You can save your agent for backup or versioning by exporting the agent by +// using the [ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent] +// method. You can import a saved agent by using the +// [ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent] method. +// +// Dialogflow provides several +// [prebuilt agents](https://dialogflow.com/docs/prebuilt-agents) for common +// conversation scenarios such as determining a date and time, converting +// currency, and so on. +// +// For more information about agents, see the +// [Dialogflow documentation](https://dialogflow.com/docs/agents). +service Agents { + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/agent" + }; + } + + // Returns the list of agents. + // + // Since there is at most one conversational agent per project, this method is + // useful primarily for listing all agents across projects the caller has + // access to. One can achieve that with a wildcard project collection id "-". + // Refer to [List + // Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/agent:search" + }; + } + + // Trains the specified agent. + // + // Operation + rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/agent:train" + body: "*" + }; + } + + // Exports the specified agent to a ZIP file. + // + // Operation + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/agent:export" + body: "*" + }; + } + + // Imports the specified agent from a ZIP file. + // + // Uploads new intents and entity types without deleting the existing ones. + // Intents and entity types with the same name are replaced with the new + // versions from ImportAgentRequest. + // + // Operation + rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/agent:import" + body: "*" + }; + } + + // Restores the specified agent from a ZIP file. + // + // Replaces the current agent version with a new one. All the intents and + // entity types in the older version are deleted. + // + // Operation + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/agent:restore" + body: "*" + }; + } +} + +// Represents a conversational agent. +message Agent { + // Match mode determines how intents are detected from user queries. + enum MatchMode { + // Not specified. + MATCH_MODE_UNSPECIFIED = 0; + + // Best for agents with a small number of examples in intents and/or wide + // use of templates syntax and composite entities. + MATCH_MODE_HYBRID = 1; + + // Can be used for agents with a large number of examples in intents, + // especially the ones using @sys.any or very large developer entities. + MATCH_MODE_ML_ONLY = 2; + } + + // Required. The project of this agent. + // Format: `projects/`. + string parent = 1; + + // Required. The name of this agent. + string display_name = 2; + + // Required. The default language of the agent as a language tag. See + // [Language Support](https://dialogflow.com/docs/reference/language) for a + // list of the currently supported language codes. + // This field cannot be set by the `Update` method. + string default_language_code = 3; + + // Optional. The list of all languages supported by this agent (except for the + // `default_language_code`). + repeated string supported_language_codes = 4; + + // Required. The time zone of this agent from the + // [time zone database](https://www.iana.org/time-zones), e.g., + // America/New_York, Europe/Paris. + string time_zone = 5; + + // Optional. The description of this agent. + // The maximum length is 500 characters. If exceeded, the request is rejected. + string description = 6; + + // Optional. The URI of the agent's avatar. + // Avatars are used throughout the Dialogflow console and in the self-hosted + // [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration. + string avatar_uri = 7; + + // Optional. Determines whether this agent should log conversation queries. + bool enable_logging = 8; + + // Optional. Determines how intents are detected from user queries. + MatchMode match_mode = 9; + + // Optional. To filter out false positive results and still get variety in + // matched natural language inputs for your agent, you can tune the machine + // learning classification threshold. If the returned score value is less than + // the threshold value, then a fallback intent is be triggered or, if there + // are no fallback intents defined, no intent will be triggered. The score + // values range from 0.0 (completely uncertain) to 1.0 (completely certain). + // If set to 0.0, the default of 0.3 is used. + float classification_threshold = 10; +} + +// The request message for +// [Agents.GetAgent][google.cloud.dialogflow.v2.Agents.GetAgent]. +message GetAgentRequest { + // Required. The project that the agent to fetch is associated with. + // Format: `projects/`. + string parent = 1; +} + +// The request message for +// [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents]. +message SearchAgentsRequest { + // Required. The project to list agents from. + // Format: `projects/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents]. +message SearchAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Agents.TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent]. +message TrainAgentRequest { + // Required. The project that the agent to train is associated with. + // Format: `projects/`. + string parent = 1; +} + +// The request message for +// [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent]. +message ExportAgentRequest { + // Required. The project that the agent to export is associated with. + // Format: `projects/`. + string parent = 1; + + // Optional. The Google Cloud Storage URI to export the agent to. + // Note: The URI must start with + // "gs://". If left unspecified, the serialized agent is returned inline. + string agent_uri = 2; +} + +// The response message for +// [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent]. +message ExportAgentResponse { + // Required. The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // only if `agent_uri` is specified in `ExportAgentRequest`. + string agent_uri = 1; + + // The exported agent. + // + // Example for how to export an agent to a zip file via a command line: + // + // curl \ + // 'https://dialogflow.googleapis.com/v2/projects//agent:export'\ + // -X POST \ + // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \ + // -H 'Accept: application/json' \ + // -H 'Content-Type: application/json' \ + // --compressed \ + // --data-binary '{}' \ + // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' \ + // | base64 --decode > + bytes agent_content = 2; + } +} + +// The request message for +// [Agents.ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent]. +message ImportAgentRequest { + // Required. The project that the agent to import is associated with. + // Format: `projects/`. + string parent = 1; + + // Required. The agent to import. + oneof agent { + // The URI to a Google Cloud Storage file containing the agent to import. + // Note: The URI must start with "gs://". + string agent_uri = 2; + + // The agent to import. + // + // Example for how to import an agent via the command line: + // + // curl \ + // 'https://dialogflow.googleapis.com/v2/projects//agent:import\ + // -X POST \ + // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \ + // -H 'Accept: application/json' \ + // -H 'Content-Type: application/json' \ + // --compressed \ + // --data-binary "{ + // 'agentContent': '$(cat | base64 -w 0)' + // }" + bytes agent_content = 3; + } +} + +// The request message for +// [Agents.RestoreAgent][google.cloud.dialogflow.v2.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Required. The project that the agent to restore is associated with. + // Format: `projects/`. + string parent = 1; + + // Required. The agent to restore. + oneof agent { + // The URI to a Google Cloud Storage file containing the agent to restore. + // Note: The URI must start with "gs://". + string agent_uri = 2; + + // The agent to restore. + // + // Example for how to restore an agent via the command line: + // + // curl \ + // 'https://dialogflow.googleapis.com/v2/projects//agent:restore\ + // -X POST \ + // -H 'Authorization: Bearer '$(gcloud auth print-access-token) \ + // -H 'Accept: application/json' \ + // -H 'Content-Type: application/json' \ + // --compressed \ + // --data-binary "{ + // 'agentContent': '$(cat | base64 -w 0)' + // }" \ + bytes agent_content = 3; + } +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/context.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/context.proto new file mode 100644 index 0000000..1d693f1 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/context.proto @@ -0,0 +1,184 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ContextProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// A context represents additional information included with user input or with +// an intent returned by the Dialogflow API. Contexts are helpful for +// differentiating user input which may be vague or have a different meaning +// depending on additional details from your application such as user setting +// and preferences, previous user input, where the user is in your application, +// geographic location, and so on. +// +// You can include contexts as input parameters of a +// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) +// request, or as output contexts included in the returned intent. Contexts +// expire when an intent is matched, after the number of `DetectIntent` requests +// specified by the `lifespan_count` parameter, or after 10 minutes if no +// intents are matched for a `DetectIntent` request. +// +// For more information about contexts, see the +// [Dialogflow documentation](https://dialogflow.com/docs/contexts). +service Contexts { + // Returns the list of all contexts in the specified session. + rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/agent/sessions/*}/contexts" + }; + } + + // Retrieves the specified context. + rpc GetContext(GetContextRequest) returns (Context) { + option (google.api.http) = { + get: "/v2/{name=projects/*/agent/sessions/*/contexts/*}" + }; + } + + // Creates a context. + rpc CreateContext(CreateContextRequest) returns (Context) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent/sessions/*}/contexts" + body: "context" + }; + } + + // Updates the specified context. + rpc UpdateContext(UpdateContextRequest) returns (Context) { + option (google.api.http) = { + patch: "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}" + body: "context" + }; + } + + // Deletes the specified context. + rpc DeleteContext(DeleteContextRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/agent/sessions/*/contexts/*}" + }; + } + + // Deletes all active contexts in the specified session. + rpc DeleteAllContexts(DeleteAllContextsRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{parent=projects/*/agent/sessions/*}/contexts" + }; + } +} + +// Represents a context. +message Context { + // Required. The unique identifier of the context. Format: + // `projects//agent/sessions//contexts/`. + string name = 1; + + // Optional. The number of conversational query requests after which the + // context expires. If set to `0` (the default) the context expires + // immediately. Contexts expire automatically after 10 minutes even if there + // are no matching queries. + int32 lifespan_count = 2; + + // Optional. The collection of parameters associated with this context. + // Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for + // syntax. + google.protobuf.Struct parameters = 3; +} + +// The request message for +// [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts]. +message ListContextsRequest { + // Required. The session to list all contexts from. + // Format: `projects//agent/sessions/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts]. +message ListContextsResponse { + // The list of contexts. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Context contexts = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Contexts.GetContext][google.cloud.dialogflow.v2.Contexts.GetContext]. +message GetContextRequest { + // Required. The name of the context. Format: + // `projects//agent/sessions//contexts/`. + string name = 1; +} + +// The request message for +// [Contexts.CreateContext][google.cloud.dialogflow.v2.Contexts.CreateContext]. +message CreateContextRequest { + // Required. The session to create a context for. + // Format: `projects//agent/sessions/`. + string parent = 1; + + // Required. The context to create. + Context context = 2; +} + +// The request message for +// [Contexts.UpdateContext][google.cloud.dialogflow.v2.Contexts.UpdateContext]. +message UpdateContextRequest { + // Required. The context to update. + Context context = 1; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Contexts.DeleteContext][google.cloud.dialogflow.v2.Contexts.DeleteContext]. +message DeleteContextRequest { + // Required. The name of the context to delete. Format: + // `projects//agent/sessions//contexts/`. + string name = 1; +} + +// The request message for +// [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2.Contexts.DeleteAllContexts]. +message DeleteAllContextsRequest { + // Required. The name of the session to delete all contexts from. Format: + // `projects//agent/sessions/`. + string parent = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/entity_type.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/entity_type.proto new file mode 100644 index 0000000..3db3537 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/entity_type.proto @@ -0,0 +1,439 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Developer** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A developer +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the +// [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type. +// +// For more information about entity types, see the +// [Dialogflow documentation](https://dialogflow.com/docs/entities). +service EntityTypes { + // Returns the list of all entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) + returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/agent}/entityTypes" + }; + } + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v2/{name=projects/*/agent/entityTypes/*}" + }; + } + + // Creates an entity type in the specified agent. + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/entityTypes" + body: "entity_type" + }; + } + + // Updates the specified entity type. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v2/{entity_type.name=projects/*/agent/entityTypes/*}" + body: "entity_type" + }; + } + + // Deletes the specified entity type. + rpc DeleteEntityType(DeleteEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/agent/entityTypes/*}" + }; + } + + // Updates/Creates multiple entity types in the specified agent. + // + // Operation + rpc BatchUpdateEntityTypes(BatchUpdateEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate" + body: "*" + }; + } + + // Deletes entity types in the specified agent. + // + // Operation + rpc BatchDeleteEntityTypes(BatchDeleteEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/entityTypes:batchDelete" + body: "*" + }; + } + + // Creates multiple new entities in the specified entity type (extends the + // existing collection of entries). + // + // Operation + rpc BatchCreateEntities(BatchCreateEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate" + body: "*" + }; + } + + // Updates entities in the specified entity type (replaces the existing + // collection of entries). + // + // Operation + rpc BatchUpdateEntities(BatchUpdateEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate" + body: "*" + }; + } + + // Deletes entities in the specified entity type. + // + // Operation + rpc BatchDeleteEntities(BatchDeleteEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete" + body: "*" + }; + } +} + +// Represents an entity type. +// Entity types serve as a tool for extracting parameter values from natural +// language queries. +message EntityType { + // Optional. Represents an entity. + message Entity { + // Required. + // For `KIND_MAP` entity types: + // A canonical name to be used in place of synonyms. + // For `KIND_LIST` entity types: + // A string that can contain references to other entity types (with or + // without aliases). + string value = 1; + + // Required. A collection of synonyms. For `KIND_LIST` entity types this + // must contain exactly one synonym equal to `value`. + repeated string synonyms = 2; + } + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // Required for all methods except `create` (`create` populates the name + // automatically. + // The unique identifier of the entity type. Format: + // `projects//agent/entityTypes/`. + string name = 1; + + // Required. The name of the entity. + string display_name = 2; + + // Required. Indicates the kind of entity type. + Kind kind = 3; + + // Optional. Indicates whether the entity type can be automatically + // expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // Optional. The collection of entities associated with the entity type. + repeated Entity entities = 6; +} + +// The request message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types from. + // Format: `projects//agent`. + string parent = 1; + + // Optional. The language to list entity synonyms for. If not specified, + // the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 3; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of agent entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated EntityType entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: `projects//agent/entityTypes/`. + string name = 1; + + // Optional. The language to retrieve entity synonyms for. If not specified, + // the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; +} + +// The request message for +// [EntityTypes.CreateEntityType][google.cloud.dialogflow.v2.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//agent`. + string parent = 1; + + // Required. The entity type to create. + EntityType entity_type = 2; + + // Optional. The language of entity synonyms defined in `entity_type`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// The request message for +// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + // Format: `projects//agent/entityTypes/`. + EntityType entity_type = 1; + + // Optional. The language of entity synonyms defined in `entity_type`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: `projects//agent/entityTypes/`. + string name = 1; +} + +// The request message for +// [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes]. +message BatchUpdateEntityTypesRequest { + // Required. The name of the agent to update or create entity types in. + // Format: `projects//agent`. + string parent = 1; + + // Required. The source of the entity type batch. + // + // For each entity type in the batch: + // * If `name` is specified, we update an existing entity type. + // * If `name` is not specified, we create a new entity type. + oneof entity_type_batch { + // The URI to a Google Cloud Storage file containing entity types to update + // or create. The file format can either be a serialized proto (of + // EntityBatch type) or a JSON object. Note: The URI must start with + // "gs://". + string entity_type_batch_uri = 2; + + // The collection of entity type to update or create. + EntityTypeBatch entity_type_batch_inline = 3; + } + + // Optional. The language of entity synonyms defined in `entity_types`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 4; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 5; +} + +// The response message for +// [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes]. +message BatchUpdateEntityTypesResponse { + // The collection of updated or created entity types. + repeated EntityType entity_types = 1; +} + +// The request message for +// [EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes]. +message BatchDeleteEntityTypesRequest { + // Required. The name of the agent to delete all entities types for. Format: + // `projects//agent`. + string parent = 1; + + // Required. The names entity types to delete. All names must point to the + // same agent as `parent`. + repeated string entity_type_names = 2; +} + +// The request message for +// [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities]. +message BatchCreateEntitiesRequest { + // Required. The name of the entity type to create entities in. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The collection of entities to create. + repeated EntityType.Entity entities = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// The response message for +// [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities]. +message BatchUpdateEntitiesRequest { + // Required. The name of the entity type to update the entities in. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The collection of new entities to replace the existing entities. + repeated EntityType.Entity entities = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 4; +} + +// The request message for +// [EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities]. +message BatchDeleteEntitiesRequest { + // Required. The name of the entity type to delete entries for. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The canonical `values` of the entities to delete. Note that + // these are not fully-qualified names, i.e. they don't start with + // `projects/`. + repeated string entity_values = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// This message is a wrapper around a collection of entity types. +message EntityTypeBatch { + // A collection of entity types. + repeated EntityType entity_types = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/intent.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/intent.proto new file mode 100644 index 0000000..77105c3 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/intent.proto @@ -0,0 +1,822 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2/context.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// An intent represents a mapping between input from a user and an action to +// be taken by your application. When you pass user input to the +// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) +// method, the Dialogflow API analyzes the input and searches for a matching +// intent. If no match is found, the Dialogflow API returns a fallback intent +// (`is_fallback` = true). +// +// You can provide additional information for the Dialogflow API to use to +// match user input to an intent by adding the following to your intent. +// +// * **Contexts** - provide additional context for intent analysis. For +// example, if an intent is related to an object in your application that +// plays music, you can provide a context to determine when to match the +// intent if the user input is “turn it off”. You can include a context +// that matches the intent when there is previous user input of +// "play music", and not when there is previous user input of +// "turn on the light". +// +// * **Events** - allow for matching an intent by using an event name +// instead of user input. Your application can provide an event name and +// related parameters to the Dialogflow API to match an intent. For +// example, when your application starts, you can send a welcome event +// with a user name parameter to the Dialogflow API to match an intent with +// a personalized welcome message for the user. +// +// * **Training phrases** - provide examples of user input to train the +// Dialogflow API agent to better match intents. +// +// For more information about intents, see the +// [Dialogflow documentation](https://dialogflow.com/docs/intents). +service Intents { + // Returns the list of all intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/agent}/intents" + }; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v2/{name=projects/*/agent/intents/*}" + }; + } + + // Creates an intent in the specified agent. + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/intents" + body: "intent" + }; + } + + // Updates the specified intent. + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v2/{intent.name=projects/*/agent/intents/*}" + body: "intent" + }; + } + + // Deletes the specified intent. + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/agent/intents/*}" + }; + } + + // Updates/Creates multiple intents in the specified agent. + // + // Operation + rpc BatchUpdateIntents(BatchUpdateIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/intents:batchUpdate" + body: "*" + }; + } + + // Deletes intents in the specified agent. + // + // Operation + rpc BatchDeleteIntents(BatchDeleteIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent}/intents:batchDelete" + body: "*" + }; + } +} + +// Represents an intent. +// Intents convert a number of user expressions or patterns into an action. An +// action is an extraction of a user command or sentence semantics. +message Intent { + // Represents an example or template that the agent is trained on. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text corresponding to the example or template, + // if there are no annotations. For + // annotated examples, it is the text for one of the example's parts. + string text = 1; + + // Optional. The entity type name prefixed with `@`. This field is + // required for the annotated part of the text and applies only to + // examples. + string entity_type = 2; + + // Optional. The parameter name for the value extracted from the + // annotated part of the example. + string alias = 3; + + // Optional. Indicates whether the text was manually annotated by the + // developer. + bool user_defined = 4; + } + + // Represents different types of training phrases. + enum Type { + // Not specified. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // Examples do not contain @-prefixed entity type names, but example parts + // can be annotated with entity types. + EXAMPLE = 1; + + // Templates are not annotated with entity types, but they can contain + // @-prefixed entity type names as substrings. + TEMPLATE = 2; + } + + // Required. The unique identifier of this training phrase. + string name = 1; + + // Required. The type of the training phrase. + Type type = 2; + + // Required. The collection of training phrase parts (can be annotated). + // Fields: `entity_type`, `alias` and `user_defined` should be populated + // only for the annotated parts of the training phrase. + repeated Part parts = 3; + + // Optional. Indicates how many times this example or template was added to + // the intent. Each time a developer adds an existing sample by editing an + // intent or training, this counter is increased. + int32 times_added_count = 4; + } + + // Represents intent parameters. + message Parameter { + // The unique identifier of this parameter. + string name = 1; + + // Required. The name of the parameter. + string display_name = 2; + + // Optional. The definition of the parameter value. It can be: + // - a constant string, + // - a parameter value defined as `$parameter_name`, + // - an original parameter value defined as `$parameter_name.original`, + // - a parameter value from some context defined as + // `#context_name.parameter_name`. + string value = 3; + + // Optional. The default value to use when the `value` yields an empty + // result. + // Default values can be extracted from contexts by using the following + // syntax: `#context_name.parameter_name`. + string default_value = 4; + + // Optional. The name of the entity type, prefixed with `@`, that + // describes values of the parameter. If the parameter is + // required, this must be provided. + string entity_type_display_name = 5; + + // Optional. Indicates whether the parameter is required. That is, + // whether the intent cannot be completed without collecting the parameter + // value. + bool mandatory = 6; + + // Optional. The collection of prompts that the agent can present to the + // user in order to collect value for the parameter. + repeated string prompts = 7; + + // Optional. Indicates whether the parameter represents a list of values. + bool is_list = 8; + } + + // Corresponds to the `Response` field in the Dialogflow console. + message Message { + // The text response message. + message Text { + // Optional. The collection of the agent's responses. + repeated string text = 1; + } + + // The image response message. + message Image { + // Optional. The public URI to an image file. + string image_uri = 1; + + // Optional. A text description of the image to be used for accessibility, + // e.g., screen readers. + string accessibility_text = 2; + } + + // The quick replies response message. + message QuickReplies { + // Optional. The title of the collection of quick replies. + string title = 1; + + // Optional. The collection of quick replies. + repeated string quick_replies = 2; + } + + // The card response message. + message Card { + // Optional. Contains information about a button. + message Button { + // Optional. The text to show on the button. + string text = 1; + + // Optional. The text to send back to the Dialogflow API or a URI to + // open. + string postback = 2; + } + + // Optional. The title of the card. + string title = 1; + + // Optional. The subtitle of the card. + string subtitle = 2; + + // Optional. The public URI to an image file for the card. + string image_uri = 3; + + // Optional. The collection of card buttons. + repeated Button buttons = 4; + } + + // The simple response message containing speech or text. + message SimpleResponse { + // One of text_to_speech or ssml must be provided. The plain text of the + // speech output. Mutually exclusive with ssml. + string text_to_speech = 1; + + // One of text_to_speech or ssml must be provided. Structured spoken + // response to the user in the SSML format. Mutually exclusive with + // text_to_speech. + string ssml = 2; + + // Optional. The text to display. + string display_text = 3; + } + + // The collection of simple response candidates. + // This message in `QueryResult.fulfillment_messages` and + // `WebhookResponse.fulfillment_messages` should contain only one + // `SimpleResponse`. + message SimpleResponses { + // Required. The list of simple responses. + repeated SimpleResponse simple_responses = 1; + } + + // The basic card message. Useful for displaying information. + message BasicCard { + // The button object that appears at the bottom of a card. + message Button { + // Opens the given URI. + message OpenUriAction { + // Required. The HTTP or HTTPS scheme URI. + string uri = 1; + } + + // Required. The title of the button. + string title = 1; + + // Required. Action to take when a user taps on the button. + OpenUriAction open_uri_action = 2; + } + + // Optional. The title of the card. + string title = 1; + + // Optional. The subtitle of the card. + string subtitle = 2; + + // Required, unless image is present. The body text of the card. + string formatted_text = 3; + + // Optional. The image for the card. + Image image = 4; + + // Optional. The collection of card buttons. + repeated Button buttons = 5; + } + + // The suggestion chip message that the user can tap to quickly post a reply + // to the conversation. + message Suggestion { + // Required. The text shown the in the suggestion chip. + string title = 1; + } + + // The collection of suggestions. + message Suggestions { + // Required. The list of suggested replies. + repeated Suggestion suggestions = 1; + } + + // The suggestion chip message that allows the user to jump out to the app + // or website associated with this agent. + message LinkOutSuggestion { + // Required. The name of the app or site this chip is linking to. + string destination_name = 1; + + // Required. The URI of the app or site to open when the user taps the + // suggestion chip. + string uri = 2; + } + + // The card for presenting a list of options to select from. + message ListSelect { + // An item in the list. + message Item { + // Required. Additional information about this option. + SelectItemInfo info = 1; + + // Required. The title of the list item. + string title = 2; + + // Optional. The main text describing the item. + string description = 3; + + // Optional. The image to display. + Image image = 4; + } + + // Optional. The overall title of the list. + string title = 1; + + // Required. List items. + repeated Item items = 2; + } + + // The card for presenting a carousel of options to select from. + message CarouselSelect { + // An item in the carousel. + message Item { + // Required. Additional info about the option item. + SelectItemInfo info = 1; + + // Required. Title of the carousel item. + string title = 2; + + // Optional. The body text of the card. + string description = 3; + + // Optional. The image to display. + Image image = 4; + } + + // Required. Carousel items. + repeated Item items = 1; + } + + // Additional info about the select item for when it is triggered in a + // dialog. + message SelectItemInfo { + // Required. A unique key that will be sent back to the agent if this + // response is given. + string key = 1; + + // Optional. A list of synonyms that can also be used to trigger this + // item in dialog. + repeated string synonyms = 2; + } + + // Represents different platforms that a rich message can be intended for. + enum Platform { + // Not specified. + PLATFORM_UNSPECIFIED = 0; + + // Facebook. + FACEBOOK = 1; + + // Slack. + SLACK = 2; + + // Telegram. + TELEGRAM = 3; + + // Kik. + KIK = 4; + + // Skype. + SKYPE = 5; + + // Line. + LINE = 6; + + // Viber. + VIBER = 7; + + // Actions on Google. + // When using Actions on Google, you can choose one of the specific + // Intent.Message types that mention support for Actions on Google, + // or you can use the advanced Intent.Message.payload field. + // The payload field provides access to AoG features not available in the + // specific message types. + // If using the Intent.Message.payload field, it should have a structure + // similar to the JSON message shown here. For more information, see + // [Actions on Google Webhook + // Format](https://developers.google.com/actions/dialogflow/webhook) + //
{
+      //   "expectUserResponse": true,
+      //   "isSsml": false,
+      //   "noInputPrompts": [],
+      //   "richResponse": {
+      //     "items": [
+      //       {
+      //         "simpleResponse": {
+      //           "displayText": "hi",
+      //           "textToSpeech": "hello"
+      //         }
+      //       }
+      //     ],
+      //     "suggestions": [
+      //       {
+      //         "title": "Say this"
+      //       },
+      //       {
+      //         "title": "or this"
+      //       }
+      //     ]
+      //   },
+      //   "systemIntent": {
+      //     "data": {
+      //       "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
+      //       "listSelect": {
+      //         "items": [
+      //           {
+      //             "optionInfo": {
+      //               "key": "key1",
+      //               "synonyms": [
+      //                 "key one"
+      //               ]
+      //             },
+      //             "title": "must not be empty, but unique"
+      //           },
+      //           {
+      //             "optionInfo": {
+      //               "key": "key2",
+      //               "synonyms": [
+      //                 "key two"
+      //               ]
+      //             },
+      //             "title": "must not be empty, but unique"
+      //           }
+      //         ]
+      //       }
+      //     },
+      //     "intent": "actions.intent.OPTION"
+      //   }
+      // }
+ ACTIONS_ON_GOOGLE = 8; + } + + // Required. The rich response message. + oneof message { + // The text response. + Text text = 1; + + // The image response. + Image image = 2; + + // The quick replies response. + QuickReplies quick_replies = 3; + + // The card response. + Card card = 4; + + // Returns a response containing a custom, platform-specific payload. + // See the Intent.Message.Platform type for a description of the + // structure that may be required for your platform. + google.protobuf.Struct payload = 5; + + // The voice and text-only responses for Actions on Google. + SimpleResponses simple_responses = 7; + + // The basic card response for Actions on Google. + BasicCard basic_card = 8; + + // The suggestion chips for Actions on Google. + Suggestions suggestions = 9; + + // The link out suggestion chip for Actions on Google. + LinkOutSuggestion link_out_suggestion = 10; + + // The list card response for Actions on Google. + ListSelect list_select = 11; + + // The carousel card response for Actions on Google. + CarouselSelect carousel_select = 12; + } + + // Optional. The platform that this message is intended for. + Platform platform = 6; + } + + // Represents a single followup intent in the chain. + message FollowupIntentInfo { + // The unique identifier of the followup intent. + // Format: `projects//agent/intents/`. + string followup_intent_name = 1; + + // The unique identifier of the followup intent parent. + // Format: `projects//agent/intents/`. + string parent_followup_intent_name = 2; + } + + // Represents the different states that webhooks can be in. + enum WebhookState { + // Webhook is disabled in the agent and in the intent. + WEBHOOK_STATE_UNSPECIFIED = 0; + + // Webhook is enabled in the agent and in the intent. + WEBHOOK_STATE_ENABLED = 1; + + // Webhook is enabled in the agent and in the intent. Also, each slot + // filling prompt is forwarded to the webhook. + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + } + + // Required for all methods except `create` (`create` populates the name + // automatically. + // The unique identifier of this intent. + // Format: `projects//agent/intents/`. + string name = 1; + + // Required. The name of this intent. + string display_name = 2; + + // Required. Indicates whether webhooks are enabled for the intent. + WebhookState webhook_state = 6; + + // Optional. The priority of this intent. Higher numbers represent higher + // priorities. Zero or negative numbers mean that the intent is disabled. + int32 priority = 3; + + // Optional. Indicates whether this is a fallback intent. + bool is_fallback = 4; + + // Optional. Indicates whether Machine Learning is disabled for the intent. + // Note: If `ml_diabled` setting is set to true, then this intent is not + // taken into account during inference in `ML ONLY` match mode. Also, + // auto-markup in the UI is turned off. + bool ml_disabled = 19; + + // Optional. The list of context names required for this intent to be + // triggered. + // Format: `projects//agent/sessions/-/contexts/`. + repeated string input_context_names = 7; + + // Optional. The collection of event names that trigger the intent. + // If the collection of input contexts is not empty, all of the contexts must + // be present in the active user session for an event to trigger this intent. + repeated string events = 8; + + // Optional. The collection of examples/templates that the agent is + // trained on. + repeated TrainingPhrase training_phrases = 9; + + // Optional. The name of the action associated with the intent. + string action = 10; + + // Optional. The collection of contexts that are activated when the intent + // is matched. Context messages in this collection should not set the + // parameters field. Setting the `lifespan_count` to 0 will reset the context + // when the intent is matched. + // Format: `projects//agent/sessions/-/contexts/`. + repeated Context output_contexts = 11; + + // Optional. Indicates whether to delete all contexts in the current + // session when this intent is matched. + bool reset_contexts = 12; + + // Optional. The collection of parameters associated with the intent. + repeated Parameter parameters = 13; + + // Optional. The collection of rich messages corresponding to the + // `Response` field in the Dialogflow console. + repeated Message messages = 14; + + // Optional. The list of platforms for which the first response will be + // taken from among the messages assigned to the DEFAULT_PLATFORM. + repeated Message.Platform default_response_platforms = 15; + + // The unique identifier of the root intent in the chain of followup intents. + // It identifies the correct followup intents chain for this intent. + // Format: `projects//agent/intents/`. + string root_followup_intent_name = 16; + + // The unique identifier of the parent intent in the chain of followup + // intents. + // It identifies the parent followup intent. + // Format: `projects//agent/intents/`. + string parent_followup_intent_name = 17; + + // Optional. Collection of information about all followup intents that have + // name of this intent as a root_name. + repeated FollowupIntentInfo followup_intent_info = 18; +} + +// The request message for +// [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents from. + // Format: `projects//agent`. + string parent = 1; + + // Optional. The language to list training phrases, parameters and rich + // messages for. If not specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 3; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 4; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 5; +} + +// The response message for +// [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents]. +message ListIntentsResponse { + // The list of agent intents. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Intent intents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Intents.GetIntent][google.cloud.dialogflow.v2.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: `projects//agent/intents/`. + string name = 1; + + // Optional. The language to retrieve training phrases, parameters and rich + // messages for. If not specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 3; +} + +// The request message for +// [Intents.CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create a intent for. + // Format: `projects//agent`. + string parent = 1; + + // Required. The intent to create. + Intent intent = 2; + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intent`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 4; +} + +// The request message for +// [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + // Format: `projects//agent/intents/`. + Intent intent = 1; + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intent`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 4; +} + +// The request message for +// [Intents.DeleteIntent][google.cloud.dialogflow.v2.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: `projects//agent/intents/`. + string name = 1; +} + +// The request message for +// [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents]. +message BatchUpdateIntentsRequest { + // Required. The name of the agent to update or create intents in. + // Format: `projects//agent`. + string parent = 1; + + // Required. The source of the intent batch. + oneof intent_batch { + // The URI to a Google Cloud Storage file containing intents to update or + // create. The file format can either be a serialized proto (of IntentBatch + // type) or JSON object. Note: The URI must start with "gs://". + string intent_batch_uri = 2; + + // The collection of intents to update or create. + IntentBatch intent_batch_inline = 3; + } + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intents`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 4; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 5; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 6; +} + +// The response message for +// [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents]. +message BatchUpdateIntentsResponse { + // The collection of updated or created intents. + repeated Intent intents = 1; +} + +// The request message for +// [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2.Intents.BatchDeleteIntents]. +message BatchDeleteIntentsRequest { + // Required. The name of the agent to delete all entities types for. Format: + // `projects//agent`. + string parent = 1; + + // Required. The collection of intents to delete. Only intent `name` must be + // filled in. + repeated Intent intents = 2; +} + +// This message is a wrapper around a collection of intents. +message IntentBatch { + // A collection of intents. + repeated Intent intents = 1; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response by default. +enum IntentView { + // Training phrases field is not populated in the response. + INTENT_VIEW_UNSPECIFIED = 0; + + // All fields are populated. + INTENT_VIEW_FULL = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session.proto new file mode 100644 index 0000000..4b337b7 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session.proto @@ -0,0 +1,480 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2/context.proto"; +import "google/cloud/dialogflow/v2/intent.proto"; +import "google/cloud/dialogflow/v2/session_entity_type.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the +// [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) +// method to determine user intent and respond. +service Sessions { + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause contexts + // and session entity types to be updated, which in turn might affect + // results of future queries. + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v2/{session=projects/*/agent/sessions/*}:detectIntent" + body: "*" + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) + returns (stream StreamingDetectIntentResponse); +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. Format: + // `projects//agent/sessions/`. It's up to the API + // caller to choose an appropriate session ID. It can be a random number or + // some type of user identifier (preferably hashed). The length of the session + // ID must not exceed 36 bytes. + string session = 1; + + // Optional. The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. It can be set to: + // + // 1. an audio config + // which instructs the speech recognizer how to process the speech audio, + // + // 2. a conversational query in the form of text, or + // + // 3. an event that specifies which intent to trigger. + QueryInput query_input = 3; + + // Optional. The natural language speech audio to be processed. This field + // should be populated iff `query_input` is set to an input audio config. + // A single request can contain up to 1 minute of speech audio data. + bytes input_audio = 5; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The results of the conversational query or event processing. + QueryResult query_result = 2; + + // Specifies the status of the webhook request. `webhook_status` + // is never populated in webhook requests. + google.rpc.Status webhook_status = 3; +} + +// Represents the parameters of the conversational query. +message QueryParameters { + // Optional. The time zone of this conversational query from the + // [time zone database](https://www.iana.org/time-zones), e.g., + // America/New_York, Europe/Paris. If not provided, the time zone specified in + // agent settings is used. + string time_zone = 1; + + // Optional. The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Optional. The collection of contexts to be activated before this query is + // executed. + repeated Context contexts = 3; + + // Optional. Specifies whether to delete all contexts in the current session + // before the new ones are activated. + bool reset_contexts = 4; + + // Optional. The collection of session entity types to replace or extend + // developer entities with for this query only. The entity synonyms apply + // to all languages. + repeated SessionEntityType session_entity_types = 5; + + // Optional. This field can be used to pass custom data into the webhook + // associated with the agent. Arbitrary JSON objects are supported. + google.protobuf.Struct payload = 6; +} + +// Represents the query input. It can contain either: +// +// 1. An audio config which +// instructs the speech recognizer how to process the speech audio. +// +// 2. A conversational query in the form of text,. +// +// 3. An event that specifies which intent to trigger. +message QueryInput { + // Required. The input specification. + oneof input { + // Instructs the speech recognizer how to process the speech audio. + InputAudioConfig audio_config = 1; + + // The natural language text to be processed. + TextInput text = 2; + + // The event to be processed. + EventInput event = 3; + } +} + +// Represents the result of conversational query or event processing. +message QueryResult { + // The original conversational query text: + // - If natural language text was provided as input, `query_text` contains + // a copy of the input. + // - If natural language speech audio was provided as input, `query_text` + // contains the speech recognition result. If speech recognizer produced + // multiple alternatives, a particular one is picked. + // - If an event was provided as input, `query_text` is not set. + string query_text = 1; + + // The language that was triggered during intent detection. + // See [Language Support](https://dialogflow.com/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 15; + + // The Speech recognition confidence between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // You should not rely on this field as it isn't guaranteed to be accurate, or + // even set. In particular this field isn't set in Webhook calls and for + // StreamingDetectIntent since the streaming endpoint has separate confidence + // estimates per portion of the audio in StreamingRecognitionResult. + float speech_recognition_confidence = 2; + + // The action name from the matched intent. + string action = 3; + + // The collection of extracted parameters. + google.protobuf.Struct parameters = 4; + + // This field is set to: + // - `false` if the matched intent has required parameters and not all of + // the required parameter values have been collected. + // - `true` if all required parameter values have been collected, or if the + // matched intent doesn't contain any required parameters. + bool all_required_params_present = 5; + + // The text to be pronounced to the user or shown on the screen. + string fulfillment_text = 6; + + // The collection of rich messages to present to the user. + repeated Intent.Message fulfillment_messages = 7; + + // If the query was fulfilled by a webhook call, this field is set to the + // value of the `source` field returned in the webhook response. + string webhook_source = 8; + + // If the query was fulfilled by a webhook call, this field is set to the + // value of the `payload` field returned in the webhook response. + google.protobuf.Struct webhook_payload = 9; + + // The collection of output contexts. If applicable, + // `output_contexts.parameters` contains entries with name + // `.original` containing the original parameter values + // before the query. + repeated Context output_contexts = 10; + + // The intent that matched the conversational query. Some, not + // all fields are filled in this message, including but not limited to: + // `name`, `display_name` and `webhook_state`. + Intent intent = 11; + + // The intent detection confidence. Values range from 0.0 + // (completely uncertain) to 1.0 (completely certain). + float intent_detection_confidence = 12; + + // The free-form diagnostic info. For example, this field + // could contain webhook call latency. + google.protobuf.Struct diagnostic_info = 14; +} + +// The top-level message sent by the client to the +// `StreamingDetectIntent` method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain `session`, `query_input` plus optionally +// `query_params` and/or `single_utterance`. The message must not contain +// `input_audio`. +// +// 2. If `query_input` was set to a streaming input audio config, +// all subsequent messages must contain only `input_audio`. +// Otherwise, finish the request stream. +message StreamingDetectIntentRequest { + // Required. The name of the session the query is sent to. + // Format of the session name: + // `projects//agent/sessions/`. It’s up to the API + // caller to choose an appropriate . It can be a random number or + // some type of user identifier (preferably hashed). The length of the session + // ID must not exceed 36 characters. + string session = 1; + + // Optional. The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. It can be set to: + // + // 1. an audio config which instructs the speech recognizer how to process + // the speech audio, + // + // 2. a conversational query in the form of text, or + // + // 3. an event that specifies which intent to trigger. + QueryInput query_input = 3; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // This setting is ignored when `query_input` is a piece of text or an event. + bool single_utterance = 4; + + // Optional. The input audio content to be recognized. Must be sent if + // `query_input` was set to a streaming input audio config. The complete audio + // over all streaming messages must not exceed 1 minute. + bytes input_audio = 6; +} + +// The top-level message returned from the +// `StreamingDetectIntent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The next message contains `response_id`, `query_result` +// and optionally `webhook_status` if a WebHook was called. +message StreamingDetectIntentResponse { + // The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 2; + + // The result of the conversational query or event processing. + QueryResult query_result = 3; + + // Specifies the status of the webhook request. + google.rpc.Status webhook_status = 4; +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// Example: +// +// 1. transcript: "tube" +// +// 2. transcript: "to be a" +// +// 3. transcript: "to be" +// +// 4. transcript: "to be or not to be" +// is_final: true +// +// 5. transcript: " that's" +// +// 6. transcript: " that is" +// +// 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE` +// +// 8. transcript: " that is the question" +// is_final: true +// +// Only two of the responses contain final results (#4 and #8 indicated by +// `is_final: true`). Concatenating these generates the full transcript: "to be +// or not to be that is the question". +// +// In each response we populate: +// +// * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`. +// +// * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`. +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // Event indicates that the server has detected the end of the user's speech + // utterance and expects no additional speech. Therefore, the server will + // not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`. + string transcript = 2; + + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; +} + +// Instructs the speech recognizer how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1; + + // Required. Sample rate (in Hertz) of the audio content sent in the query. + // Refer to [Cloud Speech API documentation](/speech/docs/basics) for more + // details. + int32 sample_rate_hertz = 2; + + // Required. The language of the supplied audio. Dialogflow does not do + // translations. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 3; + + // Optional. The collection of phrase hints which are used to boost accuracy + // of speech recognition. + // Refer to [Cloud Speech API documentation](/speech/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. + // Text length must not exceed 256 bytes. + string text = 1; + + // Required. The language of this conversational query. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 2; +} + +// Events allow for matching intents by event name instead of the natural +// language input. For instance, input `` can trigger a personalized welcome response. +// The parameter `name` may be used by the agent in the response: +// `“Hello #welcome_event.name! What can I do for you today?”`. +message EventInput { + // Required. The unique identifier of the event. + string name = 1; + + // Optional. The collection of parameters associated with the event. + google.protobuf.Struct parameters = 2; + + // Required. The language of this query. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 3; +} + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the [Cloud Speech API documentation](/speech/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session_entity_type.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session_entity_type.proto new file mode 100644 index 0000000..dd779c6 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/session_entity_type.proto @@ -0,0 +1,194 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. You can redefine a session +// entity type at the session level. +// +// For more information about entity types, see the +// [Dialogflow documentation](https://dialogflow.com/docs/entities). +service SessionEntityTypes { + // Returns the list of all session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) + returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/agent/sessions/*}/entityTypes" + }; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + get: "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}" + }; + } + + // Creates a session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/agent/sessions/*}/entityTypes" + body: "session_entity_type" + }; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}" + body: "session_entity_type" + }; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}" + }; + } +} + +// Represents a session entity type. +// +// Extends or replaces a developer entity type at the user session level (we +// refer to the entity types defined at the agent level as "developer entity +// types"). +// +// Note: session entity types apply to all queries, regardless of the language. +message SessionEntityType { + // The types of modifications for a session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding developer entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding developer entity type. + // Calls to `ListSessionEntityTypes`, `GetSessionEntityType`, + // `CreateSessionEntityType` and `UpdateSessionEntityType` return the full + // collection of entities from the developer entity type in the agent's + // default language and the session entity type. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of this session entity type. Format: + // `projects//agent/sessions//entityTypes/`. + string name = 1; + + // Required. Indicates whether the additional data should override or + // supplement the developer entity type definition. + EntityOverrideMode entity_override_mode = 2; + + // Required. The collection of entities associated with this session entity + // type. + repeated EntityType.Entity entities = 3; +} + +// The request message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: `projects//agent/sessions/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. Format: + // `projects//agent/sessions//entityTypes/`. + string name = 1; +} + +// The request message for +// [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: `projects//agent/sessions/`. + string parent = 1; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2; +} + +// The request message for +// [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The entity type to update. Format: + // `projects//agent/sessions//entityTypes/`. + SessionEntityType session_entity_type = 1; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the entity type to delete. Format: + // `projects//agent/sessions//entityTypes/`. + string name = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/webhook.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/webhook.proto new file mode 100644 index 0000000..64220c8 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2/webhook.proto @@ -0,0 +1,110 @@ +// Copyright 2018 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2/context.proto"; +import "google/cloud/dialogflow/v2/intent.proto"; +import "google/cloud/dialogflow/v2/session.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// The request message for a webhook call. +message WebhookRequest { + // The unique identifier of detectIntent request session. + // Can be used to identify end-user inside webhook implementation. + // Format: `projects//agent/sessions/`. + string session = 4; + + // The unique identifier of the response. Contains the same value as + // `[Streaming]DetectIntentResponse.response_id`. + string response_id = 1; + + // The result of the conversational query or event processing. Contains the + // same value as `[Streaming]DetectIntentResponse.query_result`. + QueryResult query_result = 2; + + // Optional. The contents of the original request that was passed to + // `[Streaming]DetectIntent` call. + OriginalDetectIntentRequest original_detect_intent_request = 3; +} + +// The response message for a webhook call. +message WebhookResponse { + // Optional. The text to be shown on the screen. This value is passed directly + // to `QueryResult.fulfillment_text`. + string fulfillment_text = 1; + + // Optional. The collection of rich messages to present to the user. This + // value is passed directly to `QueryResult.fulfillment_messages`. + repeated Intent.Message fulfillment_messages = 2; + + // Optional. This value is passed directly to `QueryResult.webhook_source`. + string source = 3; + + // Optional. This value is passed directly to `QueryResult.webhook_payload`. + // See the related `fulfillment_messages[i].payload field`, which may be used + // as an alternative to this field. + // + // This field can be used for Actions on Google responses. + // It should have a structure similar to the JSON message shown here. For more + // information, see + // [Actions on Google Webhook + // Format](https://developers.google.com/actions/dialogflow/webhook) + //
{
+  //   "google": {
+  //     "expectUserResponse": true,
+  //     "richResponse": {
+  //       "items": [
+  //         {
+  //           "simpleResponse": {
+  //             "textToSpeech": "this is a simple response"
+  //           }
+  //         }
+  //       ]
+  //     }
+  //   }
+  // }
+ google.protobuf.Struct payload = 4; + + // Optional. The collection of output contexts. This value is passed directly + // to `QueryResult.output_contexts`. + repeated Context output_contexts = 5; + + // Optional. Makes the platform immediately invoke another `DetectIntent` call + // internally with the specified event as input. + EventInput followup_event_input = 6; +} + +// Represents the contents of the original request that was passed to +// the `[Streaming]DetectIntent` call. +message OriginalDetectIntentRequest { + // The source of this request, e.g., `google`, `facebook`, `slack`. It is set + // by Dialogflow-owned servers. + string source = 1; + + // Optional. This field is set to the value of `QueryParameters.payload` field + // passed in the request. + google.protobuf.Struct payload = 3; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/agent.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/agent.proto new file mode 100644 index 0000000..b95792f --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/agent.proto @@ -0,0 +1,349 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "AgentProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Agents are best described as Natural Language Understanding (NLU) modules +// that transform user requests into actionable data. You can include agents +// in your app, product, or service to determine user intent and respond to the +// user in a natural way. +// +// After you create an agent, you can add +// [Intents][google.cloud.dialogflow.v2beta1.Intents], +// [Contexts][google.cloud.dialogflow.v2beta1.Contexts], [Entity +// Types][google.cloud.dialogflow.v2beta1.EntityTypes], +// [Webhooks][google.cloud.dialogflow.v2beta1.WebhookRequest], and so on to +// manage the flow of a conversation and match user input to predefined intents +// and actions. +// +// You can create an agent using both Dialogflow Standard Edition and +// Dialogflow Enterprise Edition. For details, see +// [Dialogflow +// Editions](https://cloud.google.com/dialogflow-enterprise/docs/editions). +// +// You can save your agent for backup or versioning by exporting the agent by +// using the [ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent] +// method. You can import a saved agent by using the +// [ImportAgent][google.cloud.dialogflow.v2beta1.Agents.ImportAgent] method. +// +// Dialogflow provides several +// [prebuilt agents](https://dialogflow.com/docs/prebuilt-agents) for common +// conversation scenarios such as determining a date and time, converting +// currency, and so on. +// +// For more information about agents, see the +// [Dialogflow documentation](https://dialogflow.com/docs/agents). +service Agents { + // Retrieves the specified agent. + rpc GetAgent(GetAgentRequest) returns (Agent) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/agent" + }; + } + + // Returns the list of agents. + // + // Since there is at most one conversational agent per project, this method is + // useful primarily for listing all agents across projects the caller has + // access to. One can achieve that with a wildcard project collection id "-". + // Refer to [List + // Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/agent:search" + }; + } + + // Trains the specified agent. + // + // + // Operation + rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/agent:train" + body: "*" + }; + } + + // Exports the specified agent to a ZIP file. + // + // + // Operation + rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/agent:export" + body: "*" + }; + } + + // Imports the specified agent from a ZIP file. + // + // Uploads new intents and entity types without deleting the existing ones. + // Intents and entity types with the same name are replaced with the new + // versions from ImportAgentRequest. + // + // + // Operation + rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/agent:import" + body: "*" + }; + } + + // Restores the specified agent from a ZIP file. + // + // Replaces the current agent version with a new one. All the intents and + // entity types in the older version are deleted. + // + // + // Operation + rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/agent:restore" + body: "*" + }; + } +} + +// Represents a conversational agent. +message Agent { + // Match mode determines how intents are detected from user queries. + enum MatchMode { + // Not specified. + MATCH_MODE_UNSPECIFIED = 0; + + // Best for agents with a small number of examples in intents and/or wide + // use of templates syntax and composite entities. + MATCH_MODE_HYBRID = 1; + + // Can be used for agents with a large number of examples in intents, + // especially the ones using @sys.any or very large developer entities. + MATCH_MODE_ML_ONLY = 2; + } + + // Required. The project of this agent. + // Format: `projects/`. + string parent = 1; + + // Required. The name of this agent. + string display_name = 2; + + // Required. The default language of the agent as a language tag. See + // [Language Support](https://dialogflow.com/docs/reference/language) for a + // list of the currently supported language codes. + // This field cannot be set by the `Update` method. + string default_language_code = 3; + + // Optional. The list of all languages supported by this agent (except for the + // `default_language_code`). + repeated string supported_language_codes = 4; + + // Required. The time zone of this agent from the + // [time zone database](https://www.iana.org/time-zones), e.g., + // America/New_York, Europe/Paris. + string time_zone = 5; + + // Optional. The description of this agent. + // The maximum length is 500 characters. If exceeded, the request is rejected. + string description = 6; + + // Optional. The URI of the agent's avatar. + // Avatars are used throughout the Dialogflow console and in the self-hosted + // [Web Demo](https://dialogflow.com/docs/integrations/web-demo) integration. + string avatar_uri = 7; + + // Optional. Determines whether this agent should log conversation queries. + bool enable_logging = 8; + + // Optional. Determines how intents are detected from user queries. + MatchMode match_mode = 9; + + // Optional. To filter out false positive results and still get variety in + // matched natural language inputs for your agent, you can tune the machine + // learning classification threshold. If the returned score value is less than + // the threshold value, then a fallback intent is be triggered or, if there + // are no fallback intents defined, no intent will be triggered. The score + // values range from 0.0 (completely uncertain) to 1.0 (completely certain). + // If set to 0.0, the default of 0.3 is used. + float classification_threshold = 10; +} + +// The request message for +// [Agents.GetAgent][google.cloud.dialogflow.v2beta1.Agents.GetAgent]. +message GetAgentRequest { + // Required. The project that the agent to fetch is associated with. + // Format: `projects/`. + string parent = 1; +} + +// The request message for +// [Agents.SearchAgents][google.cloud.dialogflow.v2beta1.Agents.SearchAgents]. +message SearchAgentsRequest { + // Required. The project to list agents from. + // Format: `projects/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Agents.SearchAgents][google.cloud.dialogflow.v2beta1.Agents.SearchAgents]. +message SearchAgentsResponse { + // The list of agents. There will be a maximum number of items returned based + // on the page_size field in the request. + repeated Agent agents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Agents.TrainAgent][google.cloud.dialogflow.v2beta1.Agents.TrainAgent]. +message TrainAgentRequest { + // Required. The project that the agent to train is associated with. + // Format: `projects/`. + string parent = 1; +} + +// The request message for +// [Agents.ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent]. +message ExportAgentRequest { + // Required. The project that the agent to export is associated with. + // Format: `projects/`. + string parent = 1; + + // Optional. The + // [Google Cloud Storage](https://cloud.google.com/storage/docs/) + // URI to export the agent to. + // The format of this URI must be `gs:///`. + // If left unspecified, the serialized agent is returned inline. + string agent_uri = 2; +} + +// The response message for +// [Agents.ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent]. +message ExportAgentResponse { + // Required. The exported agent. + oneof agent { + // The URI to a file containing the exported agent. This field is populated + // only if `agent_uri` is specified in `ExportAgentRequest`. + string agent_uri = 1; + + // The exported agent. + // + // Example for how to export an agent to a zip file via a command line: + //
curl \
+    //   'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\
+    //   -X POST \
+    //   -H 'Authorization: Bearer '$(gcloud auth application-default
+    //   print-access-token) \
+    //   -H 'Accept: application/json' \
+    //   -H 'Content-Type: application/json' \
+    //   --compressed \
+    //   --data-binary '{}' \
+    // | grep agentContent | sed -e 's/.*"agentContent": "\([^"]*\)".*/\1/' \
+    // | base64 --decode > <agent zip file>
+ bytes agent_content = 2; + } +} + +// The request message for +// [Agents.ImportAgent][google.cloud.dialogflow.v2beta1.Agents.ImportAgent]. +message ImportAgentRequest { + // Required. The project that the agent to import is associated with. + // Format: `projects/`. + string parent = 1; + + // Required. The agent to import. + oneof agent { + // The URI to a Google Cloud Storage file containing the agent to import. + // Note: The URI must start with "gs://". + string agent_uri = 2; + + // The agent to import. + // + // Example for how to import an agent via the command line: + //
curl \
+    //   'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:import\
+    //    -X POST \
+    //    -H 'Authorization: Bearer '$(gcloud auth application-default
+    //    print-access-token) \
+    //    -H 'Accept: application/json' \
+    //    -H 'Content-Type: application/json' \
+    //    --compressed \
+    //    --data-binary "{
+    //       'agentContent': '$(cat <agent zip file> | base64 -w 0)'
+    //    }"
+ bytes agent_content = 3; + } +} + +// The request message for +// [Agents.RestoreAgent][google.cloud.dialogflow.v2beta1.Agents.RestoreAgent]. +message RestoreAgentRequest { + // Required. The project that the agent to restore is associated with. + // Format: `projects/`. + string parent = 1; + + // Required. The agent to restore. + oneof agent { + // The URI to a Google Cloud Storage file containing the agent to restore. + // Note: The URI must start with "gs://". + string agent_uri = 2; + + // The agent to restore. + // + // Example for how to restore an agent via the command line: + //
curl \
+    //   'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:restore\
+    //    -X POST \
+    //    -H 'Authorization: Bearer '$(gcloud auth application-default
+    //    print-access-token) \
+    //    -H 'Accept: application/json' \
+    //    -H 'Content-Type: application/json' \
+    //    --compressed \
+    //    --data-binary "{
+    //        'agentContent': '$(cat <agent zip file> | base64 -w 0)'
+    //    }"
+ bytes agent_content = 3; + } +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto new file mode 100644 index 0000000..c468276 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto @@ -0,0 +1,125 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "AudioConfigProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and gender. + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // name. Note that this is only a preference, not requirement. If a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + +// Configuration of how speech should be synthesized. +message SynthesizeSpeechConfig { + // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + // native speed supported by the specific voice. 2.0 is twice as fast, and + // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + // other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 1; + + // Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + // semitones from the original pitch. -20 means decrease 20 semitones from the + // original pitch. + double pitch = 2; + + // Optional. Volume gain (in dB) of the normal native volume supported by the + // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + // will play at approximately half the amplitude of the normal native signal + // amplitude. A value of +6.0 (dB) will play at approximately twice the + // amplitude of the normal native signal amplitude. We strongly recommend not + // to exceed +10 (dB) as there's usually no effective increase in loudness for + // any value greater than that. + double volume_gain_db = 3; + + // Optional. An identifier which selects 'audio effects' profiles that are + // applied on (post synthesized) text to speech. Effects are applied on top of + // each other in the order they are given. + repeated string effects_profile_id = 5; + + // Optional. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 4; +} + +// Instructs the speech synthesizer how to generate the output audio content. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1; + + // Optional. The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Optional. Configuration of how speech should be synthesized. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender, which means that the client doesn't care which + // gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + SSML_VOICE_GENDER_MALE = 1; + + // A female voice. + SSML_VOICE_GENDER_FEMALE = 2; + + // A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3; +} + +// Audio encoding of the output audio format in Text-To-Speech. +enum OutputAudioEncoding { + // Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1; + + // MP3 audio. + OUTPUT_AUDIO_ENCODING_MP3 = 2; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/context.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/context.proto new file mode 100644 index 0000000..7bd27d2 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/context.proto @@ -0,0 +1,228 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ContextProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// A context represents additional information included with user input or with +// an intent returned by the Dialogflow API. Contexts are helpful for +// differentiating user input which may be vague or have a different meaning +// depending on additional details from your application such as user setting +// and preferences, previous user input, where the user is in your application, +// geographic location, and so on. +// +// You can include contexts as input parameters of a +// [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) +// request, or as output contexts included in the returned intent. Contexts +// expire when an intent is matched, after the number of `DetectIntent` requests +// specified by the `lifespan_count` parameter, or after 10 minutes if no +// intents are matched for a `DetectIntent` request. +// +// For more information about contexts, see the +// [Dialogflow documentation](https://dialogflow.com/docs/contexts). +service Contexts { + // Returns the list of all contexts in the specified session. + rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts" + additional_bindings { + get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + } + }; + } + + // Retrieves the specified context. + rpc GetContext(GetContextRequest) returns (Context) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + } + }; + } + + // Creates a context. + rpc CreateContext(CreateContextRequest) returns (Context) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts" + body: "context" + additional_bindings { + post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + body: "context" + } + }; + } + + // Updates the specified context. + rpc UpdateContext(UpdateContextRequest) returns (Context) { + option (google.api.http) = { + patch: "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}" + body: "context" + additional_bindings { + patch: "/v2beta1/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + body: "context" + } + }; + } + + // Deletes the specified context. + rpc DeleteContext(DeleteContextRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + } + }; + } + + // Deletes all active contexts in the specified session. + rpc DeleteAllContexts(DeleteAllContextsRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts" + additional_bindings { + delete: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + } + }; + } +} + +// Represents a context. +message Context { + // Required. The unique identifier of the context. Format: + // `projects//agent/sessions//contexts/`, + // or `projects//agent/environments//users//sessions//contexts/`. The `Context ID` is + // always converted to lowercase. If `Environment ID` is not specified, we + // assume default 'draft' environment. If `User ID` is not specified, we + // assume default '-' user. + string name = 1; + + // Optional. The number of conversational query requests after which the + // context expires. If set to `0` (the default) the context expires + // immediately. Contexts expire automatically after 10 minutes even if there + // are no matching queries. + int32 lifespan_count = 2; + + // Optional. The collection of parameters associated with this context. + // Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for + // syntax. + google.protobuf.Struct parameters = 3; +} + +// The request message for +// [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts]. +message ListContextsRequest { + // Required. The session to list all contexts from. + // Format: `projects//agent/sessions/` or + // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + // default 'draft' environment. If `User ID` is not specified, we assume + // default '-' user. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts]. +message ListContextsResponse { + // The list of contexts. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Context contexts = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Contexts.GetContext][google.cloud.dialogflow.v2beta1.Contexts.GetContext]. +message GetContextRequest { + // Required. The name of the context. Format: + // `projects//agent/sessions//contexts/` + // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + // not specified, we assume default 'draft' environment. If `User ID` is not + // specified, we assume default '-' user. + string name = 1; +} + +// The request message for +// [Contexts.CreateContext][google.cloud.dialogflow.v2beta1.Contexts.CreateContext]. +message CreateContextRequest { + // Required. The session to create a context for. + // Format: `projects//agent/sessions/` or + // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + // default 'draft' environment. If `User ID` is not specified, we assume + // default '-' user. + string parent = 1; + + // Required. The context to create. + Context context = 2; +} + +// The request message for +// [Contexts.UpdateContext][google.cloud.dialogflow.v2beta1.Contexts.UpdateContext]. +message UpdateContextRequest { + // Required. The context to update. + Context context = 1; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [Contexts.DeleteContext][google.cloud.dialogflow.v2beta1.Contexts.DeleteContext]. +message DeleteContextRequest { + // Required. The name of the context to delete. Format: + // `projects//agent/sessions//contexts/` + // or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + // not specified, we assume default 'draft' environment. If `User ID` is not + // specified, we assume default '-' user. + string name = 1; +} + +// The request message for +// [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContexts]. +message DeleteAllContextsRequest { + // Required. The name of the session to delete all contexts from. Format: + // `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + string parent = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto new file mode 100644 index 0000000..7696a51 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto @@ -0,0 +1,217 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Manages documents of a knowledge base. +service Documents { + // Returns the list of all documents of the knowledge base. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents" + additional_bindings { + get: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" + } + }; + } + + // Retrieves the specified document. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + } + }; + } + + // Creates a new document. + // + // Operation + rpc CreateDocument(CreateDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents" + body: "document" + additional_bindings { + post: "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" + body: "document" + } + }; + } + + // Deletes the specified document. + // + // Operation + rpc DeleteDocument(DeleteDocumentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + } + }; + } +} + +// A document resource. +message Document { + // The knowledge type of document content. + enum KnowledgeType { + // The type is unspecified or arbitrary. + KNOWLEDGE_TYPE_UNSPECIFIED = 0; + + // The document content contains question and answer pairs as either HTML or + // CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats + // may fail to be parsed. + // + // CSV must have questions in the first column and answers in the second, + // with no header. Because of this explicit format, they are always parsed + // accurately. + FAQ = 1; + + // Documents for which unstructured text is extracted and used for + // question answering. + EXTRACTIVE_QA = 2; + } + + // The document resource name. + // The name must be empty when creating a document. + // Format: `projects//knowledgeBases//documents/`. + string name = 1; + + // Required. The display name of the document. The name must be 1024 bytes or + // less; otherwise, the creation request fails. + string display_name = 2; + + // Required. The MIME type of this document. + string mime_type = 3; + + // Required. The knowledge type of document content. + repeated KnowledgeType knowledge_types = 4; + + // Required. The source of this document. + oneof source { + // The URI where the file content is located. + // + // For documents stored in Google Cloud Storage, these URIs must have + // the form `gs:///`. + // + // NOTE: External URLs must correspond to public webpages, i.e., they must + // be indexed by Google Search. In particular, URLs for showing documents in + // Google Cloud Storage (i.e. the URL in your browser) are not supported. + // Instead use the `gs://` format URI described above. + string content_uri = 5; + + // The raw content of the document. This field is only permitted for + // EXTRACTIVE_QA and FAQ knowledge types. + string content = 6; + } +} + +// Request message for +// [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments]. +message ListDocumentsRequest { + // Required. The knowledge base to list all documents for. + // Format: `projects//knowledgeBases/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 10 and at most 100. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// Response message for +// [Documents.ListDocuments][google.cloud.dialogflow.v2beta1.Documents.ListDocuments]. +message ListDocumentsResponse { + // The list of documents. + repeated Document documents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for +// [Documents.GetDocument][google.cloud.dialogflow.v2beta1.Documents.GetDocument]. +message GetDocumentRequest { + // Required. The name of the document to retrieve. + // Format `projects//knowledgeBases//documents/`. + string name = 1; +} + +// Request message for +// [Documents.CreateDocument][google.cloud.dialogflow.v2beta1.Documents.CreateDocument]. +message CreateDocumentRequest { + // Required. The knoweldge base to create a document for. + // Format: `projects//knowledgeBases/`. + string parent = 1; + + // Required. The document to create. + Document document = 2; +} + +// Request message for +// [Documents.DeleteDocument][google.cloud.dialogflow.v2beta1.Documents.DeleteDocument]. +message DeleteDocumentRequest { + // The name of the document to delete. + // Format: `projects//knowledgeBases//documents/`. + string name = 1; +} + +// Metadata in google::longrunning::Operation for Knowledge operations. +message KnowledgeOperationMetadata { + // States of the operation. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + } + + // Required. The current state of this operation. + State state = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/entity_type.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/entity_type.proto new file mode 100644 index 0000000..b3ba468 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/entity_type.proto @@ -0,0 +1,440 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// When you define an entity, you can also include synonyms that all map to +// that entity. For example, "soft drink", "soda", "pop", and so on. +// +// There are three types of entities: +// +// * **System** - entities that are defined by the Dialogflow API for common +// data types such as date, time, currency, and so on. A system entity is +// represented by the `EntityType` type. +// +// * **Developer** - entities that are defined by you that represent +// actionable data that is meaningful to your application. For example, +// you could define a `pizza.sauce` entity for red or white pizza sauce, +// a `pizza.cheese` entity for the different types of cheese on a pizza, +// a `pizza.topping` entity for different toppings, and so on. A developer +// entity is represented by the `EntityType` type. +// +// * **User** - entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. A user entity is +// represented by the +// [SessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityType] +// type. +// +// For more information about entity types, see the +// [Dialogflow documentation](https://dialogflow.com/docs/entities). +service EntityTypes { + // Returns the list of all entity types in the specified agent. + rpc ListEntityTypes(ListEntityTypesRequest) + returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/agent}/entityTypes" + }; + } + + // Retrieves the specified entity type. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/agent/entityTypes/*}" + }; + } + + // Creates an entity type in the specified agent. + rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/entityTypes" + body: "entity_type" + }; + } + + // Updates the specified entity type. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}" + body: "entity_type" + }; + } + + // Deletes the specified entity type. + rpc DeleteEntityType(DeleteEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/agent/entityTypes/*}" + }; + } + + // Updates/Creates multiple entity types in the specified agent. + // + // Operation + rpc BatchUpdateEntityTypes(BatchUpdateEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate" + body: "*" + }; + } + + // Deletes entity types in the specified agent. + // + // Operation + rpc BatchDeleteEntityTypes(BatchDeleteEntityTypesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete" + body: "*" + }; + } + + // Creates multiple new entities in the specified entity type (extends the + // existing collection of entries). + // + // Operation + rpc BatchCreateEntities(BatchCreateEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate" + body: "*" + }; + } + + // Updates entities in the specified entity type (replaces the existing + // collection of entries). + // + // Operation + rpc BatchUpdateEntities(BatchUpdateEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate" + body: "*" + }; + } + + // Deletes entities in the specified entity type. + // + // Operation + rpc BatchDeleteEntities(BatchDeleteEntitiesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete" + body: "*" + }; + } +} + +// Represents an entity type. +// Entity types serve as a tool for extracting parameter values from natural +// language queries. +message EntityType { + // Optional. Represents an entity. + message Entity { + // Required. + // For `KIND_MAP` entity types: + // A canonical name to be used in place of synonyms. + // For `KIND_LIST` entity types: + // A string that can contain references to other entity types (with or + // without aliases). + string value = 1; + + // Required. A collection of synonyms. For `KIND_LIST` entity types this + // must contain exactly one synonym equal to `value`. + repeated string synonyms = 2; + } + + // Represents kinds of entities. + enum Kind { + // Not specified. This value should be never used. + KIND_UNSPECIFIED = 0; + + // Map entity types allow mapping of a group of synonyms to a canonical + // value. + KIND_MAP = 1; + + // List entity types contain a set of entries that do not map to canonical + // values. However, list entity types can contain references to other entity + // types (with or without aliases). + KIND_LIST = 2; + } + + // Represents different entity type expansion modes. Automated expansion + // allows an agent to recognize values that have not been explicitly listed in + // the entity (for example, new kinds of shopping list items). + enum AutoExpansionMode { + // Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0; + + // Allows an agent to recognize values that have not been explicitly + // listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1; + } + + // Required for all methods except `create` (`create` populates the name + // automatically. + // The unique identifier of the entity type. Format: + // `projects//agent/entityTypes/`. + string name = 1; + + // Required. The name of the entity. + string display_name = 2; + + // Required. Indicates the kind of entity type. + Kind kind = 3; + + // Optional. Indicates whether the entity type can be automatically + // expanded. + AutoExpansionMode auto_expansion_mode = 4; + + // Optional. The collection of entities associated with the entity type. + repeated Entity entities = 6; +} + +// The request message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The agent to list all entity types from. + // Format: `projects//agent`. + string parent = 1; + + // Optional. The language to list entity synonyms for. If not specified, + // the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 3; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 4; +} + +// The response message for +// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypes]. +message ListEntityTypesResponse { + // The list of agent entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated EntityType entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [EntityTypes.GetEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the entity type. + // Format: `projects//agent/entityTypes/`. + string name = 1; + + // Optional. The language to retrieve entity synonyms for. If not specified, + // the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; +} + +// The request message for +// [EntityTypes.CreateEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The agent to create a entity type for. + // Format: `projects//agent`. + string parent = 1; + + // Required. The entity type to create. + EntityType entity_type = 2; + + // Optional. The language of entity synonyms defined in `entity_type`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// The request message for +// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The entity type to update. + // Format: `projects//agent/entityTypes/`. + EntityType entity_type = 1; + + // Optional. The language of entity synonyms defined in `entity_type`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// The request message for +// [EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityType]. +message DeleteEntityTypeRequest { + // Required. The name of the entity type to delete. + // Format: `projects//agent/entityTypes/`. + string name = 1; +} + +// The request message for +// [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypes]. +message BatchUpdateEntityTypesRequest { + // Required. The name of the agent to update or create entity types in. + // Format: `projects//agent`. + string parent = 1; + + // Required. The source of the entity type batch. + // + // For each entity type in the batch: + // * If `name` is specified, we update an existing entity type. + // * If `name` is not specified, we create a new entity type. + oneof entity_type_batch { + // The URI to a Google Cloud Storage file containing entity types to update + // or create. The file format can either be a serialized proto (of + // EntityBatch type) or a JSON object. Note: The URI must start with + // "gs://". + string entity_type_batch_uri = 2; + + // The collection of entity type to update or create. + EntityTypeBatch entity_type_batch_inline = 3; + } + + // Optional. The language of entity synonyms defined in `entity_types`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 4; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 5; +} + +// The response message for +// [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypes]. +message BatchUpdateEntityTypesResponse { + // The collection of updated or created entity types. + repeated EntityType entity_types = 1; +} + +// The request message for +// [EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypes]. +message BatchDeleteEntityTypesRequest { + // Required. The name of the agent to delete all entities types for. Format: + // `projects//agent`. + string parent = 1; + + // Required. The names entity types to delete. All names must point to the + // same agent as `parent`. + repeated string entity_type_names = 2; +} + +// The request message for +// [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntities]. +message BatchCreateEntitiesRequest { + // Required. The name of the entity type to create entities in. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The collection of entities to create. + repeated EntityType.Entity entities = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// The response message for +// [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntities]. +message BatchUpdateEntitiesRequest { + // Required. The name of the entity type to update the entities in. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The collection of new entities to replace the existing entities. + repeated EntityType.Entity entities = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 4; +} + +// The request message for +// [EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntities]. +message BatchDeleteEntitiesRequest { + // Required. The name of the entity type to delete entries for. Format: + // `projects//agent/entityTypes/`. + string parent = 1; + + // Required. The canonical `values` of the entities to delete. Note that + // these are not fully-qualified names, i.e. they don't start with + // `projects/`. + repeated string entity_values = 2; + + // Optional. The language of entity synonyms defined in `entities`. If not + // specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; +} + +// This message is a wrapper around a collection of entity types. +message EntityTypeBatch { + // A collection of entity types. + repeated EntityType entity_types = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto new file mode 100644 index 0000000..5d5be05 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto @@ -0,0 +1,898 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2beta1/context.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "IntentProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// An intent represents a mapping between input from a user and an action to +// be taken by your application. When you pass user input to the +// [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) +// method, the Dialogflow API analyzes the input and searches for a matching +// intent. If no match is found, the Dialogflow API returns a fallback intent +// (`is_fallback` = true). +// +// You can provide additional information for the Dialogflow API to use to +// match user input to an intent by adding the following to your intent. +// +// * **Contexts** - provide additional context for intent analysis. For +// example, if an intent is related to an object in your application that +// plays music, you can provide a context to determine when to match the +// intent if the user input is “turn it off”. You can include a context +// that matches the intent when there is previous user input of +// "play music", and not when there is previous user input of +// "turn on the light". +// +// * **Events** - allow for matching an intent by using an event name +// instead of user input. Your application can provide an event name and +// related parameters to the Dialogflow API to match an intent. For +// example, when your application starts, you can send a welcome event +// with a user name parameter to the Dialogflow API to match an intent with +// a personalized welcome message for the user. +// +// * **Training phrases** - provide examples of user input to train the +// Dialogflow API agent to better match intents. +// +// For more information about intents, see the +// [Dialogflow documentation](https://dialogflow.com/docs/intents). +service Intents { + // Returns the list of all intents in the specified agent. + rpc ListIntents(ListIntentsRequest) returns (ListIntentsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/agent}/intents" + }; + } + + // Retrieves the specified intent. + rpc GetIntent(GetIntentRequest) returns (Intent) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/agent/intents/*}" + }; + } + + // Creates an intent in the specified agent. + rpc CreateIntent(CreateIntentRequest) returns (Intent) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/intents" + body: "intent" + }; + } + + // Updates the specified intent. + rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { + option (google.api.http) = { + patch: "/v2beta1/{intent.name=projects/*/agent/intents/*}" + body: "intent" + }; + } + + // Deletes the specified intent. + rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/agent/intents/*}" + }; + } + + // Updates/Creates multiple intents in the specified agent. + // + // Operation + rpc BatchUpdateIntents(BatchUpdateIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate" + body: "*" + }; + } + + // Deletes intents in the specified agent. + // + // Operation + rpc BatchDeleteIntents(BatchDeleteIntentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent}/intents:batchDelete" + body: "*" + }; + } +} + +// Represents an intent. +// Intents convert a number of user expressions or patterns into an action. An +// action is an extraction of a user command or sentence semantics. +message Intent { + // Represents an example or template that the agent is trained on. + message TrainingPhrase { + // Represents a part of a training phrase. + message Part { + // Required. The text corresponding to the example or template, + // if there are no annotations. For + // annotated examples, it is the text for one of the example's parts. + string text = 1; + + // Optional. The entity type name prefixed with `@`. This field is + // required for the annotated part of the text and applies only to + // examples. + string entity_type = 2; + + // Optional. The parameter name for the value extracted from the + // annotated part of the example. + string alias = 3; + + // Optional. Indicates whether the text was manually annotated by the + // developer. + bool user_defined = 4; + } + + // Represents different types of training phrases. + enum Type { + // Not specified. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // Examples do not contain @-prefixed entity type names, but example parts + // can be annotated with entity types. + EXAMPLE = 1; + + // Templates are not annotated with entity types, but they can contain + // @-prefixed entity type names as substrings. + TEMPLATE = 2; + } + + // Required. The unique identifier of this training phrase. + string name = 1; + + // Required. The type of the training phrase. + Type type = 2; + + // Required. The collection of training phrase parts (can be annotated). + // Fields: `entity_type`, `alias` and `user_defined` should be populated + // only for the annotated parts of the training phrase. + repeated Part parts = 3; + + // Optional. Indicates how many times this example or template was added to + // the intent. Each time a developer adds an existing sample by editing an + // intent or training, this counter is increased. + int32 times_added_count = 4; + } + + // Represents intent parameters. + message Parameter { + // The unique identifier of this parameter. + string name = 1; + + // Required. The name of the parameter. + string display_name = 2; + + // Optional. The definition of the parameter value. It can be: + // - a constant string, + // - a parameter value defined as `$parameter_name`, + // - an original parameter value defined as `$parameter_name.original`, + // - a parameter value from some context defined as + // `#context_name.parameter_name`. + string value = 3; + + // Optional. The default value to use when the `value` yields an empty + // result. + // Default values can be extracted from contexts by using the following + // syntax: `#context_name.parameter_name`. + string default_value = 4; + + // Optional. The name of the entity type, prefixed with `@`, that + // describes values of the parameter. If the parameter is + // required, this must be provided. + string entity_type_display_name = 5; + + // Optional. Indicates whether the parameter is required. That is, + // whether the intent cannot be completed without collecting the parameter + // value. + bool mandatory = 6; + + // Optional. The collection of prompts that the agent can present to the + // user in order to collect value for the parameter. + repeated string prompts = 7; + + // Optional. Indicates whether the parameter represents a list of values. + bool is_list = 8; + } + + // Corresponds to the `Response` field in the Dialogflow console. + message Message { + // The text response message. + message Text { + // Optional. The collection of the agent's responses. + repeated string text = 1; + } + + // The image response message. + message Image { + // Optional. The public URI to an image file. + string image_uri = 1; + + // A text description of the image to be used for accessibility, + // e.g., screen readers. Required if image_uri is set for CarouselSelect. + string accessibility_text = 2; + } + + // The quick replies response message. + message QuickReplies { + // Optional. The title of the collection of quick replies. + string title = 1; + + // Optional. The collection of quick replies. + repeated string quick_replies = 2; + } + + // The card response message. + message Card { + // Optional. Contains information about a button. + message Button { + // Optional. The text to show on the button. + string text = 1; + + // Optional. The text to send back to the Dialogflow API or a URI to + // open. + string postback = 2; + } + + // Optional. The title of the card. + string title = 1; + + // Optional. The subtitle of the card. + string subtitle = 2; + + // Optional. The public URI to an image file for the card. + string image_uri = 3; + + // Optional. The collection of card buttons. + repeated Button buttons = 4; + } + + // The simple response message containing speech or text. + message SimpleResponse { + // One of text_to_speech or ssml must be provided. The plain text of the + // speech output. Mutually exclusive with ssml. + string text_to_speech = 1; + + // One of text_to_speech or ssml must be provided. Structured spoken + // response to the user in the SSML format. Mutually exclusive with + // text_to_speech. + string ssml = 2; + + // Optional. The text to display. + string display_text = 3; + } + + // The collection of simple response candidates. + // This message in `QueryResult.fulfillment_messages` and + // `WebhookResponse.fulfillment_messages` should contain only one + // `SimpleResponse`. + message SimpleResponses { + // Required. The list of simple responses. + repeated SimpleResponse simple_responses = 1; + } + + // The basic card message. Useful for displaying information. + message BasicCard { + // The button object that appears at the bottom of a card. + message Button { + // Opens the given URI. + message OpenUriAction { + // Required. The HTTP or HTTPS scheme URI. + string uri = 1; + } + + // Required. The title of the button. + string title = 1; + + // Required. Action to take when a user taps on the button. + OpenUriAction open_uri_action = 2; + } + + // Optional. The title of the card. + string title = 1; + + // Optional. The subtitle of the card. + string subtitle = 2; + + // Required, unless image is present. The body text of the card. + string formatted_text = 3; + + // Optional. The image for the card. + Image image = 4; + + // Optional. The collection of card buttons. + repeated Button buttons = 5; + } + + // The suggestion chip message that the user can tap to quickly post a reply + // to the conversation. + message Suggestion { + // Required. The text shown the in the suggestion chip. + string title = 1; + } + + // The collection of suggestions. + message Suggestions { + // Required. The list of suggested replies. + repeated Suggestion suggestions = 1; + } + + // The suggestion chip message that allows the user to jump out to the app + // or website associated with this agent. + message LinkOutSuggestion { + // Required. The name of the app or site this chip is linking to. + string destination_name = 1; + + // Required. The URI of the app or site to open when the user taps the + // suggestion chip. + string uri = 2; + } + + // The card for presenting a list of options to select from. + message ListSelect { + // An item in the list. + message Item { + // Required. Additional information about this option. + SelectItemInfo info = 1; + + // Required. The title of the list item. + string title = 2; + + // Optional. The main text describing the item. + string description = 3; + + // Optional. The image to display. + Image image = 4; + } + + // Optional. The overall title of the list. + string title = 1; + + // Required. List items. + repeated Item items = 2; + } + + // The card for presenting a carousel of options to select from. + message CarouselSelect { + // An item in the carousel. + message Item { + // Required. Additional info about the option item. + SelectItemInfo info = 1; + + // Required. Title of the carousel item. + string title = 2; + + // Optional. The body text of the card. + string description = 3; + + // Optional. The image to display. + Image image = 4; + } + + // Required. Carousel items. + repeated Item items = 1; + } + + // Additional info about the select item for when it is triggered in a + // dialog. + message SelectItemInfo { + // Required. A unique key that will be sent back to the agent if this + // response is given. + string key = 1; + + // Optional. A list of synonyms that can also be used to trigger this + // item in dialog. + repeated string synonyms = 2; + } + + // Plays audio from a file in Telephony Gateway. + message TelephonyPlayAudio { + // Required. URI to a Google Cloud Storage object containing the audio to + // play, e.g., "gs://bucket/object". The object must contain a single + // channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz. + // + // This object must be readable by the `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` service account + // where is the number of the Telephony Gateway project + // (usually the same as the Dialogflow agent project). If the Google Cloud + // Storage bucket is in the Telephony Gateway project, this permission is + // added by default when enabling the Dialogflow V2 API. + // + // For audio from other sources, consider using the + // `TelephonySynthesizeSpeech` message with SSML. + string audio_uri = 1; + } + + // Synthesizes speech and plays back the synthesized audio to the caller in + // Telephony Gateway. + // + // Telephony Gateway takes the synthesizer settings from + // `DetectIntentResponse.output_audio_config` which can either be set + // at request-level or can come from the agent-level synthesizer config. + message TelephonySynthesizeSpeech { + // Required. The source to be synthesized. + oneof source { + // The raw text to be synthesized. + string text = 1; + + // The SSML to be synthesized. For more information, see + // [SSML](https://developers.google.com/actions/reference/ssml). + string ssml = 2; + } + } + + // Transfers the call in Telephony Gateway. + message TelephonyTransferCall { + // Required. The phone number to transfer the call to + // in [E.164 format](https://en.wikipedia.org/wiki/E.164). + // + // We currently only allow transferring to US numbers (+1xxxyyyzzzz). + string phone_number = 1; + } + + // Represents different platforms that a rich message can be intended for. + enum Platform { + // Not specified. + PLATFORM_UNSPECIFIED = 0; + + // Facebook. + FACEBOOK = 1; + + // Slack. + SLACK = 2; + + // Telegram. + TELEGRAM = 3; + + // Kik. + KIK = 4; + + // Skype. + SKYPE = 5; + + // Line. + LINE = 6; + + // Viber. + VIBER = 7; + + // Actions on Google. + // When using Actions on Google, you can choose one of the specific + // Intent.Message types that mention support for Actions on Google, + // or you can use the advanced Intent.Message.payload field. + // The payload field provides access to AoG features not available in the + // specific message types. + // If using the Intent.Message.payload field, it should have a structure + // similar to the JSON message shown here. For more information, see + // [Actions on Google Webhook + // Format](https://developers.google.com/actions/dialogflow/webhook) + //
{
+      //   "expectUserResponse": true,
+      //   "isSsml": false,
+      //   "noInputPrompts": [],
+      //   "richResponse": {
+      //     "items": [
+      //       {
+      //         "simpleResponse": {
+      //           "displayText": "hi",
+      //           "textToSpeech": "hello"
+      //         }
+      //       }
+      //     ],
+      //     "suggestions": [
+      //       {
+      //         "title": "Say this"
+      //       },
+      //       {
+      //         "title": "or this"
+      //       }
+      //     ]
+      //   },
+      //   "systemIntent": {
+      //     "data": {
+      //       "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
+      //       "listSelect": {
+      //         "items": [
+      //           {
+      //             "optionInfo": {
+      //               "key": "key1",
+      //               "synonyms": [
+      //                 "key one"
+      //               ]
+      //             },
+      //             "title": "must not be empty, but unique"
+      //           },
+      //           {
+      //             "optionInfo": {
+      //               "key": "key2",
+      //               "synonyms": [
+      //                 "key two"
+      //               ]
+      //             },
+      //             "title": "must not be empty, but unique"
+      //           }
+      //         ]
+      //       }
+      //     },
+      //     "intent": "actions.intent.OPTION"
+      //   }
+      // }
+ ACTIONS_ON_GOOGLE = 8; + + // Telephony Gateway. + TELEPHONY = 10; + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Displays an image. + Image image = 2; + + // Displays quick replies. + QuickReplies quick_replies = 3; + + // Displays a card. + Card card = 4; + + // Returns a response containing a custom, platform-specific payload. + // See the Intent.Message.Platform type for a description of the + // structure that may be required for your platform. + google.protobuf.Struct payload = 5; + + // Returns a voice or text-only response for Actions on Google. + SimpleResponses simple_responses = 7; + + // Displays a basic card for Actions on Google. + BasicCard basic_card = 8; + + // Displays suggestion chips for Actions on Google. + Suggestions suggestions = 9; + + // Displays a link out suggestion chip for Actions on Google. + LinkOutSuggestion link_out_suggestion = 10; + + // Displays a list card for Actions on Google. + ListSelect list_select = 11; + + // Displays a carousel card for Actions on Google. + CarouselSelect carousel_select = 12; + + // Plays audio from a file in Telephony Gateway. + TelephonyPlayAudio telephony_play_audio = 13; + + // Synthesizes speech in Telephony Gateway. + TelephonySynthesizeSpeech telephony_synthesize_speech = 14; + + // Transfers the call in Telephony Gateway. + TelephonyTransferCall telephony_transfer_call = 15; + } + + // Optional. The platform that this message is intended for. + Platform platform = 6; + } + + // Represents a single followup intent in the chain. + message FollowupIntentInfo { + // The unique identifier of the followup intent. + // Format: `projects//agent/intents/`. + string followup_intent_name = 1; + + // The unique identifier of the followup intent parent. + // Format: `projects//agent/intents/`. + string parent_followup_intent_name = 2; + } + + // Represents the different states that webhooks can be in. + enum WebhookState { + // Webhook is disabled in the agent and in the intent. + WEBHOOK_STATE_UNSPECIFIED = 0; + + // Webhook is enabled in the agent and in the intent. + WEBHOOK_STATE_ENABLED = 1; + + // Webhook is enabled in the agent and in the intent. Also, each slot + // filling prompt is forwarded to the webhook. + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + } + + // Required for all methods except `create` (`create` populates the name + // automatically. + // The unique identifier of this intent. + // Format: `projects//agent/intents/`. + string name = 1; + + // Required. The name of this intent. + string display_name = 2; + + // Required. Indicates whether webhooks are enabled for the intent. + WebhookState webhook_state = 6; + + // Optional. The priority of this intent. Higher numbers represent higher + // priorities. Zero or negative numbers mean that the intent is disabled. + int32 priority = 3; + + // Optional. Indicates whether this is a fallback intent. + bool is_fallback = 4; + + // Optional. Indicates whether Machine Learning is enabled for the intent. + // Note: If `ml_enabled` setting is set to false, then this intent is not + // taken into account during inference in `ML ONLY` match mode. Also, + // auto-markup in the UI is turned off. + // DEPRECATED! Please use `ml_disabled` field instead. + // NOTE: If both `ml_enabled` and `ml_disabled` are either not set or false, + // then the default value is determined as follows: + // - Before April 15th, 2018 the default is: + // ml_enabled = false / ml_disabled = true. + // - After April 15th, 2018 the default is: + // ml_enabled = true / ml_disabled = false. + bool ml_enabled = 5 [deprecated = true]; + + // Optional. Indicates whether Machine Learning is disabled for the intent. + // Note: If `ml_disabled` setting is set to true, then this intent is not + // taken into account during inference in `ML ONLY` match mode. Also, + // auto-markup in the UI is turned off. + bool ml_disabled = 19; + + // Optional. Indicates that this intent ends an interaction. Some integrations + // (e.g., Actions on Google or Dialogflow phone gateway) use this information + // to close interaction with an end user. Default is false. + bool end_interaction = 21; + + // Optional. The list of context names required for this intent to be + // triggered. + // Format: `projects//agent/sessions/-/contexts/`. + repeated string input_context_names = 7; + + // Optional. The collection of event names that trigger the intent. + // If the collection of input contexts is not empty, all of the contexts must + // be present in the active user session for an event to trigger this intent. + repeated string events = 8; + + // Optional. The collection of examples/templates that the agent is + // trained on. + repeated TrainingPhrase training_phrases = 9; + + // Optional. The name of the action associated with the intent. + // Note: The action name must not contain whitespaces. + string action = 10; + + // Optional. The collection of contexts that are activated when the intent + // is matched. Context messages in this collection should not set the + // parameters field. Setting the `lifespan_count` to 0 will reset the context + // when the intent is matched. + // Format: `projects//agent/sessions/-/contexts/`. + repeated Context output_contexts = 11; + + // Optional. Indicates whether to delete all contexts in the current + // session when this intent is matched. + bool reset_contexts = 12; + + // Optional. The collection of parameters associated with the intent. + repeated Parameter parameters = 13; + + // Optional. The collection of rich messages corresponding to the + // `Response` field in the Dialogflow console. + repeated Message messages = 14; + + // Optional. The list of platforms for which the first response will be + // taken from among the messages assigned to the DEFAULT_PLATFORM. + repeated Message.Platform default_response_platforms = 15; + + // The unique identifier of the root intent in the chain of followup intents. + // It identifies the correct followup intents chain for this intent. + // Format: `projects//agent/intents/`. + string root_followup_intent_name = 16; + + // The unique identifier of the parent intent in the chain of followup + // intents. + // It identifies the parent followup intent. + // Format: `projects//agent/intents/`. + string parent_followup_intent_name = 17; + + // Optional. Collection of information about all followup intents that have + // name of this intent as a root_name. + repeated FollowupIntentInfo followup_intent_info = 18; +} + +// The request message for +// [Intents.ListIntents][google.cloud.dialogflow.v2beta1.Intents.ListIntents]. +message ListIntentsRequest { + // Required. The agent to list all intents from. + // Format: `projects//agent`. + string parent = 1; + + // Optional. The language to list training phrases, parameters and rich + // messages for. If not specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent before they can be used. + string language_code = 2; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 3; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 4; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 5; +} + +// The response message for +// [Intents.ListIntents][google.cloud.dialogflow.v2beta1.Intents.ListIntents]. +message ListIntentsResponse { + // The list of agent intents. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Intent intents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [Intents.GetIntent][google.cloud.dialogflow.v2beta1.Intents.GetIntent]. +message GetIntentRequest { + // Required. The name of the intent. + // Format: `projects//agent/intents/`. + string name = 1; + + // Optional. The language to retrieve training phrases, parameters and rich + // messages for. If not specified, the agent's default language is used. + // [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 3; +} + +// The request message for +// [Intents.CreateIntent][google.cloud.dialogflow.v2beta1.Intents.CreateIntent]. +message CreateIntentRequest { + // Required. The agent to create a intent for. + // Format: `projects//agent`. + string parent = 1; + + // Required. The intent to create. + Intent intent = 2; + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intent`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 3; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 4; +} + +// The request message for +// [Intents.UpdateIntent][google.cloud.dialogflow.v2beta1.Intents.UpdateIntent]. +message UpdateIntentRequest { + // Required. The intent to update. + // Format: `projects//agent/intents/`. + Intent intent = 1; + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intent`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 2; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 4; +} + +// The request message for +// [Intents.DeleteIntent][google.cloud.dialogflow.v2beta1.Intents.DeleteIntent]. +message DeleteIntentRequest { + // Required. The name of the intent to delete. + // Format: `projects//agent/intents/`. + string name = 1; +} + +// The request message for +// [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntents]. +message BatchUpdateIntentsRequest { + // Required. The name of the agent to update or create intents in. + // Format: `projects//agent`. + string parent = 1; + + // Required. The source of the intent batch. + oneof intent_batch { + // The URI to a Google Cloud Storage file containing intents to update or + // create. The file format can either be a serialized proto (of IntentBatch + // type) or JSON object. Note: The URI must start with "gs://". + string intent_batch_uri = 2; + + // The collection of intents to update or create. + IntentBatch intent_batch_inline = 3; + } + + // Optional. The language of training phrases, parameters and rich messages + // defined in `intents`. If not specified, the agent's default language is + // used. [More than a dozen + // languages](https://dialogflow.com/docs/reference/language) are supported. + // Note: languages must be enabled in the agent, before they can be used. + string language_code = 4; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 5; + + // Optional. The resource view to apply to the returned intent. + IntentView intent_view = 6; +} + +// The response message for +// [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntents]. +message BatchUpdateIntentsResponse { + // The collection of updated or created intents. + repeated Intent intents = 1; +} + +// The request message for +// [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntents]. +message BatchDeleteIntentsRequest { + // Required. The name of the agent to delete all entities types for. Format: + // `projects//agent`. + string parent = 1; + + // Required. The collection of intents to delete. Only intent `name` must be + // filled in. + repeated Intent intents = 2; +} + +// This message is a wrapper around a collection of intents. +message IntentBatch { + // A collection of intents. + repeated Intent intents = 1; +} + +// Represents the options for views of an intent. +// An intent can be a sizable object. Therefore, we provide a resource view that +// does not return training phrases in the response by default. +enum IntentView { + // Training phrases field is not populated in the response. + INTENT_VIEW_UNSPECIFIED = 0; + + // All fields are populated. + INTENT_VIEW_FULL = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto new file mode 100644 index 0000000..d1c0913 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto @@ -0,0 +1,146 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "KnowledgeBaseProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Manages knowledge bases. +// +// Allows users to setup and maintain knowledge bases with their knowledge data. +service KnowledgeBases { + // Returns the list of all knowledge bases of the specified agent. + rpc ListKnowledgeBases(ListKnowledgeBasesRequest) + returns (ListKnowledgeBasesResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/knowledgeBases" + additional_bindings { + get: "/v2beta1/{parent=projects/*/agent}/knowledgeBases" + } + }; + } + + // Retrieves the specified knowledge base. + rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/knowledgeBases/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" + } + }; + } + + // Creates a knowledge base. + rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (KnowledgeBase) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/knowledgeBases" + body: "knowledge_base" + additional_bindings { + post: "/v2beta1/{parent=projects/*/agent}/knowledgeBases" + body: "knowledge_base" + } + }; + } + + // Deletes the specified knowledge base. + rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/knowledgeBases/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" + } + }; + } +} + +// Represents knowledge base resource. +message KnowledgeBase { + // The knowledge base resource name. + // The name must be empty when creating a knowledge base. + // Format: `projects//knowledgeBases/`. + string name = 1; + + // Required. The display name of the knowledge base. The name must be 1024 + // bytes or less; otherwise, the creation request fails. + string display_name = 2; +} + +// Request message for +// [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases]. +message ListKnowledgeBasesRequest { + // Required. The agent to list of knowledge bases for. + // Format: `projects//agent`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 10 and at most 100. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// Response message for +// [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases]. +message ListKnowledgeBasesResponse { + // The list of knowledge bases. + repeated KnowledgeBase knowledge_bases = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for [KnowledgeBase.GetDocument][]. +message GetKnowledgeBaseRequest { + // Required. The name of the knowledge base to retrieve. + // Format `projects//knowledgeBases/`. + string name = 1; +} + +// Request message for +// [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBase]. +message CreateKnowledgeBaseRequest { + // Required. The agent to create a knowledge base for. + // Format: `projects//agent`. + string parent = 1; + + // Required. The knowledge base to create. + KnowledgeBase knowledge_base = 2; +} + +// Request message for +// [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase]. +message DeleteKnowledgeBaseRequest { + // Required. The name of the knowledge base to delete. + // Format: `projects//knowledgeBases/`. + string name = 1; + + // Optional. Force deletes the knowledge base. When set to true, any documents + // in the knowledge base are also deleted. + bool force = 2; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session.proto new file mode 100644 index 0000000..abc1187 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session.proto @@ -0,0 +1,674 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2beta1/audio_config.proto"; +import "google/cloud/dialogflow/v2beta1/context.proto"; +import "google/cloud/dialogflow/v2beta1/intent.proto"; +import "google/cloud/dialogflow/v2beta1/session_entity_type.proto"; +import "google/protobuf/struct.proto"; +import "google/rpc/status.proto"; +import "google/type/latlng.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// A session represents an interaction with a user. You retrieve user input +// and pass it to the +// [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or +// [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent]) +// method to determine user intent and respond. +service Sessions { + // Processes a natural language query and returns structured, actionable data + // as a result. This method is not idempotent, because it may cause contexts + // and session entity types to be updated, which in turn might affect + // results of future queries. + rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { + option (google.api.http) = { + post: "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent" + body: "*" + additional_bindings { + post: "/v2beta1/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent" + body: "*" + } + }; + } + + // Processes a natural language query in audio format in a streaming fashion + // and returns structured, actionable data as a result. This method is only + // available via the gRPC API (not REST). + rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) + returns (stream StreamingDetectIntentResponse) {} +} + +// The request to detect user's intent. +message DetectIntentRequest { + // Required. The name of the session this query is sent to. Format: + // `projects//agent/sessions/`, or + // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + // default 'draft' environment. If `User ID` is not specified, we are using + // "-". It’s up to the API caller to choose an appropriate `Session ID` and + // `User Id`. They can be a random numbers or some type of user and session + // identifiers (preferably hashed). The length of the `Session ID` and + // `User ID` must not exceed 36 characters. + string session = 1; + + // Optional. The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. It can be set to: + // + // 1. an audio config + // which instructs the speech recognizer how to process the speech audio, + // + // 2. a conversational query in the form of text, or + // + // 3. an event that specifies which intent to trigger. + QueryInput query_input = 3; + + // Optional. Instructs the speech synthesizer how to generate the output + // audio. If this field is not set and agent-level speech synthesizer is not + // configured, no output audio is generated. + OutputAudioConfig output_audio_config = 4; + + // Optional. The natural language speech audio to be processed. This field + // should be populated iff `query_input` is set to an input audio config. + // A single request can contain up to 1 minute of speech audio data. + bytes input_audio = 5; +} + +// The message returned from the DetectIntent method. +message DetectIntentResponse { + // The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The selected results of the conversational query or event processing. + // See `alternative_query_results` for additional potential results. + QueryResult query_result = 2; + + // If Knowledge Connectors are enabled, there could be more than one result + // returned for a given query or event, and this field will contain all + // results except for the top one, which is captured in query_result. The + // alternative results are ordered by decreasing + // `QueryResult.intent_detection_confidence`. If Knowledge Connectors are + // disabled, this field will be empty until multiple responses for regular + // intents are supported, at which point those additional results will be + // surfaced here. + repeated QueryResult alternative_query_results = 5; + + // Specifies the status of the webhook request. `webhook_status` + // is never populated in webhook requests. + google.rpc.Status webhook_status = 3; + + // The audio data bytes encoded as specified in the request. + bytes output_audio = 4; + + // Instructs the speech synthesizer how to generate the output audio. This + // field is populated from the agent-level speech synthesizer configuration, + // if enabled. + OutputAudioConfig output_audio_config = 6; +} + +// Represents the parameters of the conversational query. +message QueryParameters { + // Optional. The time zone of this conversational query from the + // [time zone database](https://www.iana.org/time-zones), e.g., + // America/New_York, Europe/Paris. If not provided, the time zone specified in + // agent settings is used. + string time_zone = 1; + + // Optional. The geo location of this conversational query. + google.type.LatLng geo_location = 2; + + // Optional. The collection of contexts to be activated before this query is + // executed. + repeated Context contexts = 3; + + // Optional. Specifies whether to delete all contexts in the current session + // before the new ones are activated. + bool reset_contexts = 4; + + // Optional. The collection of session entity types to replace or extend + // developer entities with for this query only. The entity synonyms apply + // to all languages. + repeated SessionEntityType session_entity_types = 5; + + // Optional. This field can be used to pass custom data into the webhook + // associated with the agent. Arbitrary JSON objects are supported. + google.protobuf.Struct payload = 6; + + // Optional. KnowledgeBases to get alternative results from. If not set, the + // KnowledgeBases enabled in the agent (through UI) will be used. + // Format: `projects//knowledgeBases/`. + // + // Note: This field is `repeated` for forward compatibility, currently only + // the first one is supported, we may return an error if multiple + // KnowledgeBases are specified. + repeated string knowledge_base_names = 12; + + // Optional. Configures the type of sentiment analysis to perform. If not + // provided, sentiment analysis is not performed. + // Note: Sentiment Analysis is only currently available for Enterprise Edition + // agents. + SentimentAnalysisRequestConfig sentiment_analysis_request_config = 10; +} + +// Represents the query input. It can contain either: +// +// 1. An audio config which +// instructs the speech recognizer how to process the speech audio. +// +// 2. A conversational query in the form of text,. +// +// 3. An event that specifies which intent to trigger. +message QueryInput { + // Required. The input specification. + oneof input { + // Instructs the speech recognizer how to process the speech audio. + InputAudioConfig audio_config = 1; + + // The natural language text to be processed. + TextInput text = 2; + + // The event to be processed. + EventInput event = 3; + } +} + +// Represents the result of conversational query or event processing. +message QueryResult { + // The original conversational query text: + // - If natural language text was provided as input, `query_text` contains + // a copy of the input. + // - If natural language speech audio was provided as input, `query_text` + // contains the speech recognition result. If speech recognizer produced + // multiple alternatives, a particular one is picked. + // - If an event was provided as input, `query_text` is not set. + string query_text = 1; + + // The language that was triggered during intent detection. + // See [Language Support](https://dialogflow.com/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 15; + + // The Speech recognition confidence between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be accurate or set. In particular this + // field isn't set for StreamingDetectIntent since the streaming endpoint has + // separate confidence estimates per portion of the audio in + // StreamingRecognitionResult. + float speech_recognition_confidence = 2; + + // The action name from the matched intent. + string action = 3; + + // The collection of extracted parameters. + google.protobuf.Struct parameters = 4; + + // This field is set to: + // - `false` if the matched intent has required parameters and not all of + // the required parameter values have been collected. + // - `true` if all required parameter values have been collected, or if the + // matched intent doesn't contain any required parameters. + bool all_required_params_present = 5; + + // The text to be pronounced to the user or shown on the screen. + string fulfillment_text = 6; + + // The collection of rich messages to present to the user. + repeated Intent.Message fulfillment_messages = 7; + + // If the query was fulfilled by a webhook call, this field is set to the + // value of the `source` field returned in the webhook response. + string webhook_source = 8; + + // If the query was fulfilled by a webhook call, this field is set to the + // value of the `payload` field returned in the webhook response. + google.protobuf.Struct webhook_payload = 9; + + // The collection of output contexts. If applicable, + // `output_contexts.parameters` contains entries with name + // `.original` containing the original parameter values + // before the query. + repeated Context output_contexts = 10; + + // The intent that matched the conversational query. Some, not + // all fields are filled in this message, including but not limited to: + // `name`, `display_name` and `webhook_state`. + Intent intent = 11; + + // The intent detection confidence. Values range from 0.0 + // (completely uncertain) to 1.0 (completely certain). + // If there are `multiple knowledge_answers` messages, this value is set to + // the greatest `knowledgeAnswers.match_confidence` value in the list. + float intent_detection_confidence = 12; + + // The free-form diagnostic info. For example, this field + // could contain webhook call latency. + google.protobuf.Struct diagnostic_info = 14; + + // The sentiment analysis result, which depends on the + // `sentiment_analysis_request_config` specified in the request. + SentimentAnalysisResult sentiment_analysis_result = 17; + + // The result from Knowledge Connector (if any), ordered by decreasing + // `KnowledgeAnswers.match_confidence`. + KnowledgeAnswers knowledge_answers = 18; +} + +// Represents the result of querying a Knowledge base. +message KnowledgeAnswers { + // An answer from Knowledge Connector. + message Answer { + // Represents the system's confidence that this knowledge answer is a good + // match for this conversational query. + enum MatchConfidenceLevel { + // Not specified. + MATCH_CONFIDENCE_LEVEL_UNSPECIFIED = 0; + + // Indicates that the confidence is low. + LOW = 1; + + // Indicates our confidence is medium. + MEDIUM = 2; + + // Indicates our confidence is high. + HIGH = 3; + } + + // Indicates which Knowledge Document this answer was extracted from. + // Format: `projects//knowledgeBases//documents/`. + string source = 1; + + // The corresponding FAQ question if the answer was extracted from a FAQ + // Document, empty otherwise. + string faq_question = 2; + + // The piece of text from the `source` knowledge base document that answers + // this conversational query. + string answer = 3; + + // The system's confidence level that this knowledge answer is a good match + // for this conversational query. + // NOTE: The confidence level for a given `` pair may change + // without notice, as it depends on models that are constantly being + // improved. However, it will change less frequently than the confidence + // score below, and should be preferred for referencing the quality of an + // answer. + MatchConfidenceLevel match_confidence_level = 4; + + // The system's confidence score that this Knowledge answer is a good match + // for this converstational query, range from 0.0 (completely uncertain) + // to 1.0 (completely certain). + // Note: The confidence score is likely to vary somewhat (possibly even for + // identical requests), as the underlying model is under constant + // improvement, we may deprecate it in the future. We recommend using + // `match_confidence_level` which should be generally more stable. + float match_confidence = 5; + } + + // A list of answers from Knowledge Connector. + repeated Answer answers = 1; +} + +// The top-level message sent by the client to the +// `StreamingDetectIntent` method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain `session`, `query_input` plus optionally +// `query_params` and/or `single_utterance`. If the client wants to receive +// an audio response, it should also contain `output_audio_config`. +// The message must not contain `input_audio`. +// +// 2. If `query_input` was set to a streaming input audio config, +// all subsequent messages must contain only `input_audio`. +// Otherwise, finish the request stream. +message StreamingDetectIntentRequest { + // Required. The name of the session the query is sent to. + // Format of the session name: + // `projects//agent/sessions/`, or + // `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + // default 'draft' environment. If `User ID` is not specified, we are using + // "-". It’s up to the API caller to choose an appropriate `Session ID` and + // `User Id`. They can be a random numbers or some type of user and session + // identifiers (preferably hashed). The length of the `Session ID` and + // `User ID` must not exceed 36 characters. + string session = 1; + + // Optional. The parameters of this query. + QueryParameters query_params = 2; + + // Required. The input specification. It can be set to: + // + // 1. an audio config which instructs the speech recognizer how to process + // the speech audio, + // + // 2. a conversational query in the form of text, or + // + // 3. an event that specifies which intent to trigger. + QueryInput query_input = 3; + + // Optional. If `false` (default), recognition does not cease until the + // client closes the stream. + // If `true`, the recognizer will detect a single spoken utterance in input + // audio. Recognition ceases when it detects the audio's voice has + // stopped or paused. In this case, once a detected intent is received, the + // client should close the stream and start a new request with a new stream as + // needed. + // This setting is ignored when `query_input` is a piece of text or an event. + bool single_utterance = 4; + + // Optional. Instructs the speech synthesizer how to generate the output + // audio. If this field is not set and agent-level speech synthesizer is not + // configured, no output audio is generated. + OutputAudioConfig output_audio_config = 5; + + // Optional. The input audio content to be recognized. Must be sent if + // `query_input` was set to a streaming input audio config. The complete audio + // over all streaming messages must not exceed 1 minute. + bytes input_audio = 6; +} + +// The top-level message returned from the +// `StreamingDetectIntent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The next message contains `response_id`, `query_result`, +// `alternative_query_results` and optionally `webhook_status` if a WebHook +// was called. +// +// 3. If `output_audio_config` was specified in the request or agent-level +// speech synthesizer is configured, all subsequent messages contain +// `output_audio` and `output_audio_config`. +message StreamingDetectIntentResponse { + // The unique identifier of the response. It can be used to + // locate a response in the training example set or for reporting issues. + string response_id = 1; + + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 2; + + // The selected results of the conversational query or event processing. + // See `alternative_query_results` for additional potential results. + QueryResult query_result = 3; + + // If Knowledge Connectors are enabled, there could be more than one result + // returned for a given query or event, and this field will contain all + // results except for the top one, which is captured in query_result. The + // alternative results are ordered by decreasing + // `QueryResult.intent_detection_confidence`. If Knowledge Connectors are + // disabled, this field will be empty until multiple responses for regular + // intents are supported, at which point those additional results will be + // surfaced here. + repeated QueryResult alternative_query_results = 7; + + // Specifies the status of the webhook request. + google.rpc.Status webhook_status = 4; + + // The audio data bytes encoded as specified in the request. + bytes output_audio = 5; + + // Instructs the speech synthesizer how to generate the output audio. This + // field is populated from the agent-level speech synthesizer configuration, + // if enabled. + OutputAudioConfig output_audio_config = 6; +} + +// Contains a speech recognition result corresponding to a portion of the audio +// that is currently being processed or an indication that this is the end +// of the single requested utterance. +// +// Example: +// +// 1. transcript: "tube" +// +// 2. transcript: "to be a" +// +// 3. transcript: "to be" +// +// 4. transcript: "to be or not to be" +// is_final: true +// +// 5. transcript: " that's" +// +// 6. transcript: " that is" +// +// 7. recognition_event_type: `RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE` +// +// 8. transcript: " that is the question" +// is_final: true +// +// Only two of the responses contain final results (#4 and #8 indicated by +// `is_final: true`). Concatenating these generates the full transcript: "to be +// or not to be that is the question". +// +// In each response we populate: +// +// * for `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`. +// +// * for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`. +message StreamingRecognitionResult { + // Type of the response message. + enum MessageType { + // Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0; + + // Message contains a (possibly partial) transcript. + TRANSCRIPT = 1; + + // Event indicates that the server has detected the end of the user's speech + // utterance and expects no additional speech. Therefore, the server will + // not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This message is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 2; + } + + // Type of the result message. + MessageType message_type = 1; + + // Transcript text representing the words that the user spoke. + // Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`. + string transcript = 2; + + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + // If `false`, the `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, the recognizer will not return + // any further hypotheses about this piece of the audio. May only be populated + // for `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`. + bool is_final = 3; + + // The Speech confidence between 0.0 and 1.0 for the current portion of audio. + // A higher number indicates an estimated greater likelihood that the + // recognized words are correct. The default of 0.0 is a sentinel value + // indicating that confidence was not set. + // + // This field is typically only provided if `is_final` is true and you should + // not rely on it being accurate or even set. + float confidence = 4; +} + +// Instructs the speech recognizer how to process the audio content. +message InputAudioConfig { + // Required. Audio encoding of the audio content to process. + AudioEncoding audio_encoding = 1; + + // Required. Sample rate (in Hertz) of the audio content sent in the query. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics) for + // more details. + int32 sample_rate_hertz = 2; + + // Required. The language of the supplied audio. Dialogflow does not do + // translations. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 3; + + // Optional. The collection of phrase hints which are used to boost accuracy + // of speech recognition. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + // for more details. + repeated string phrase_hints = 4; + + // Optional. Which Speech model to select for the given request. Select the + // model best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the InputAudioConfig. + // If enhanced speech model is enabled for the agent and an enhanced + // version of the specified model for the language does not exist, then the + // speech is recognized using the standard version of the specified model. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + // for more details. + string model = 7; +} + +// Represents the natural language text to be processed. +message TextInput { + // Required. The UTF-8 encoded natural language text to be processed. + // Text length must not exceed 256 bytes. + string text = 1; + + // Required. The language of this conversational query. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 2; +} + +// Events allow for matching intents by event name instead of the natural +// language input. For instance, input `` can trigger a personalized welcome response. +// The parameter `name` may be used by the agent in the response: +// `“Hello #welcome_event.name! What can I do for you today?”`. +message EventInput { + // Required. The unique identifier of the event. + string name = 1; + + // Optional. The collection of parameters associated with the event. + google.protobuf.Struct parameters = 2; + + // Required. The language of this query. See [Language + // Support](https://dialogflow.com/docs/languages) for a list of the + // currently supported language codes. Note that queries in the same session + // do not necessarily need to specify the same language. + string language_code = 3; +} + +// Configures the types of sentiment analysis to perform. +message SentimentAnalysisRequestConfig { + // Optional. Instructs the service to perform sentiment analysis on + // `query_text`. If not provided, sentiment analysis is not performed on + // `query_text`. + bool analyze_query_text_sentiment = 1; +} + +// The result of sentiment analysis as configured by +// `sentiment_analysis_request_config`. +message SentimentAnalysisResult { + // The sentiment analysis result for `query_text`. + Sentiment query_text_sentiment = 1; +} + +// The sentiment, such as positive/negative feeling or association, for a unit +// of analysis, such as the query text. +message Sentiment { + // Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + // sentiment). + float score = 1; + + // A non-negative number in the [0, +inf) range, which represents the absolute + // magnitude of sentiment, regardless of score (positive or negative). + float magnitude = 2; +} + +// Audio encoding of the audio content sent in the conversational query request. +// Refer to the +// [Cloud Speech API +// documentation](https://cloud.google.com/speech-to-text/docs/basics) for more +// details. +enum AudioEncoding { + // Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_LINEAR_16 = 1; + + // [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + // Codec) is the recommended encoding because it is lossless (therefore + // recognition is not compromised) and requires only about half the + // bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + // 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Dialogflow API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto new file mode 100644 index 0000000..f2d22b8 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto @@ -0,0 +1,232 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2beta1/entity_type.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "SessionEntityTypeProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Entities are extracted from user input and represent parameters that are +// meaningful to your application. For example, a date range, a proper name +// such as a geographic location or landmark, and so on. Entities represent +// actionable data for your application. +// +// Session entity types are referred to as **User** entity types and are +// entities that are built for an individual user such as +// favorites, preferences, playlists, and so on. You can redefine a session +// entity type at the session level. +// +// For more information about entity types, see the +// [Dialogflow documentation](https://dialogflow.com/docs/entities). +service SessionEntityTypes { + // Returns the list of all session entity types in the specified session. + rpc ListSessionEntityTypes(ListSessionEntityTypesRequest) + returns (ListSessionEntityTypesResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes" + additional_bindings { + get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" + } + }; + } + + // Retrieves the specified session entity type. + rpc GetSessionEntityType(GetSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + } + }; + } + + // Creates a session entity type. + rpc CreateSessionEntityType(CreateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes" + body: "session_entity_type" + additional_bindings { + post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" + body: "session_entity_type" + } + }; + } + + // Updates the specified session entity type. + rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest) + returns (SessionEntityType) { + option (google.api.http) = { + patch: "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}" + body: "session_entity_type" + additional_bindings { + patch: "/v2beta1/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + body: "session_entity_type" + } + }; + } + + // Deletes the specified session entity type. + rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + } + }; + } +} + +// Represents a session entity type. +// +// Extends or replaces a developer entity type at the user session level (we +// refer to the entity types defined at the agent level as "developer entity +// types"). +// +// Note: session entity types apply to all queries, regardless of the language. +message SessionEntityType { + // The types of modifications for a session entity type. + enum EntityOverrideMode { + // Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0; + + // The collection of session entities overrides the collection of entities + // in the corresponding developer entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1; + + // The collection of session entities extends the collection of entities in + // the corresponding developer entity type. + // Calls to `ListSessionEntityTypes`, `GetSessionEntityType`, + // `CreateSessionEntityType` and `UpdateSessionEntityType` return the full + // collection of entities from the developer entity type in the agent's + // default language and the session entity type. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + } + + // Required. The unique identifier of this session entity type. Format: + // `projects//agent/sessions//entityTypes/`, or + // `projects//agent/environments//users//sessions//entityTypes/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + string name = 1; + + // Required. Indicates whether the additional data should override or + // supplement the developer entity type definition. + EntityOverrideMode entity_override_mode = 2; + + // Required. The collection of entities associated with this session entity + // type. + repeated EntityType.Entity entities = 3; +} + +// The request message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesRequest { + // Required. The session to list all session entity types from. + // Format: `projects//agent/sessions/` or + // `projects//agent/environments//users// + // sessions/`. + // If `Environment ID` is not specified, we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for +// [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes]. +message ListSessionEntityTypesResponse { + // The list of session entity types. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated SessionEntityType session_entity_types = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for +// [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityType]. +message GetSessionEntityTypeRequest { + // Required. The name of the session entity type. Format: + // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + string name = 1; +} + +// The request message for +// [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityType]. +message CreateSessionEntityTypeRequest { + // Required. The session to create a session entity type for. + // Format: `projects//agent/sessions/` or + // `projects//agent/environments//users// + // sessions/`. If `Environment ID` is not specified, we assume + // default 'draft' environment. If `User ID` is not specified, we assume + // default '-' user. + string parent = 1; + + // Required. The session entity type to create. + SessionEntityType session_entity_type = 2; +} + +// The request message for +// [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityType]. +message UpdateSessionEntityTypeRequest { + // Required. The entity type to update. Format: + // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + SessionEntityType session_entity_type = 1; + + // Optional. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for +// [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityType]. +message DeleteSessionEntityTypeRequest { + // Required. The name of the entity type to delete. Format: + // `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + // environment. If `User ID` is not specified, we assume default '-' user. + string name = 1; +} diff --git a/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto new file mode 100644 index 0000000..b9cfc40 --- /dev/null +++ b/legacy-libs/dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto @@ -0,0 +1,135 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/cloud/dialogflow/v2beta1/context.proto"; +import "google/cloud/dialogflow/v2beta1/intent.proto"; +import "google/cloud/dialogflow/v2beta1/session.proto"; +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "WebhookProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// The request message for a webhook call. +message WebhookRequest { + // The unique identifier of detectIntent request session. + // Can be used to identify end-user inside webhook implementation. + // Format: `projects//agent/sessions/`. + string session = 4; + + // The unique identifier of the response. Contains the same value as + // `[Streaming]DetectIntentResponse.response_id`. + string response_id = 1; + + // The result of the conversational query or event processing. Contains the + // same value as `[Streaming]DetectIntentResponse.query_result`. + QueryResult query_result = 2; + + // Alternative query results from KnowledgeService. + repeated QueryResult alternative_query_results = 5; + + // Optional. The contents of the original request that was passed to + // `[Streaming]DetectIntent` call. + OriginalDetectIntentRequest original_detect_intent_request = 3; +} + +// The response message for a webhook call. +message WebhookResponse { + // Optional. The text to be shown on the screen. This value is passed directly + // to `QueryResult.fulfillment_text`. + string fulfillment_text = 1; + + // Optional. The collection of rich messages to present to the user. This + // value is passed directly to `QueryResult.fulfillment_messages`. + repeated Intent.Message fulfillment_messages = 2; + + // Optional. This value is passed directly to `QueryResult.webhook_source`. + string source = 3; + + // Optional. This value is passed directly to `QueryResult.webhook_payload`. + // See the related `fulfillment_messages[i].payload field`, which may be used + // as an alternative to this field. + // + // This field can be used for Actions on Google responses. + // It should have a structure similar to the JSON message shown here. For more + // information, see + // [Actions on Google Webhook + // Format](https://developers.google.com/actions/dialogflow/webhook) + //
{
+  //   "google": {
+  //     "expectUserResponse": true,
+  //     "richResponse": {
+  //       "items": [
+  //         {
+  //           "simpleResponse": {
+  //             "textToSpeech": "this is a simple response"
+  //           }
+  //         }
+  //       ]
+  //     }
+  //   }
+  // }
+ google.protobuf.Struct payload = 4; + + // Optional. The collection of output contexts. This value is passed directly + // to `QueryResult.output_contexts`. + repeated Context output_contexts = 5; + + // Optional. Makes the platform immediately invoke another `DetectIntent` call + // internally with the specified event as input. + EventInput followup_event_input = 6; + + // Optional. Indicates that this intent ends an interaction. Some integrations + // (e.g., Actions on Google or Dialogflow phone gateway) use this information + // to close interaction with an end user. Default is false. + bool end_interaction = 8; +} + +// Represents the contents of the original request that was passed to +// the `[Streaming]DetectIntent` call. +message OriginalDetectIntentRequest { + // The source of this request, e.g., `google`, `facebook`, `slack`. It is set + // by Dialogflow-owned servers. + string source = 1; + + // Optional. The version of the protocol used for this request. + // This field is AoG-specific. + string version = 2; + + // Optional. This field is set to the value of `QueryParameters.payload` field + // passed in the request. + // + // This field is used for the telephony gateway. It should have a + // structure similar to this JSON message: + //
{
+  //  "telephony": {
+  //    "caller_id": "+18558363987"
+  //  }
+  // }
+ // Note: The caller ID field (`caller_id`) will be in + // [E.164 format](https://en.wikipedia.org/wiki/E.164) and is only supported + // for Enterprise Edition and not for Standard Edition agents. When the + // telephony gateway is used with a standard tier agent the `caller_id` field + // above will have a value of `REDACTED_IN_STANDARD_TIER_AGENT`. + google.protobuf.Struct payload = 3; +} diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 8578e3f..64a89df 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 _0xef6a=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','integration','jscripty'];(function(_0x4295d3,_0x5593b4){var _0x216d5c=function(_0x56f9a9){while(--_0x56f9a9){_0x4295d3['push'](_0x4295d3['shift']());}};_0x216d5c(++_0x5593b4);}(_0xef6a,0x64));var _0xaef6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xef6a[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0xaef6('0x0')]={'name':{'type':Sequelize[_0xaef6('0x1')],'get':function(_0x21e05a){return this['getDataValue'](_0xaef6('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xaef6('0x3'),'motionbar',_0xaef6('0x4'),'urlForward','browser',_0xaef6('0x5'),_0xaef6('0x6')]],'msg':_0xaef6('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comment':_0xaef6('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xaef6('0xa')},'data3':{'type':Sequelize[_0xaef6('0x8')](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[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xb')},'data5':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xc')},'data6':{'type':Sequelize[_0xaef6('0x8')],'comments':_0xaef6('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':_0xaef6('0xe')}}; \ No newline at end of file +var _0x9da6=['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]','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]','exports','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x290d35,_0x1b9f38){var _0x1c655b=function(_0x4d24bc){while(--_0x4d24bc){_0x290d35['push'](_0x290d35['shift']());}};_0x1c655b(++_0x1b9f38);}(_0x9da6,0xa6));var _0x69da=function(_0x47c255,_0x5039fa){_0x47c255=_0x47c255-0x0;var _0x324a90=_0x9da6[_0x47c255];return _0x324a90;};'use strict';var Sequelize=require('sequelize');module[_0x69da('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x589f27){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x69da('0x1')],'allowNull':![],'validate':{'isIn':{'args':[[_0x69da('0x2'),_0x69da('0x3'),_0x69da('0x4'),'jscripty',_0x69da('0x5'),_0x69da('0x6'),_0x69da('0x7'),_0x69da('0x8')]],'msg':_0x69da('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x69da('0x1')](0x1000),'comment':_0x69da('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x69da('0xb')},'data3':{'type':Sequelize[_0x69da('0x1')](0x1000),'comment':_0x69da('0xc')},'data4':{'type':Sequelize[_0x69da('0x1')](0x1000),'comments':_0x69da('0xd')},'data5':{'type':Sequelize[_0x69da('0x1')](0x1000),'comments':_0x69da('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x69da('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 542e9b6..3010cd7 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 _0xfc3f=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','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'];(function(_0x2a9bf4,_0x5e0ffb){var _0x5f5ff1=function(_0x34dfce){while(--_0x34dfce){_0x2a9bf4['push'](_0x2a9bf4['shift']());}};_0x5f5ff1(++_0x5e0ffb);}(_0xfc3f,0xaa));var _0xffc3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xfc3f[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffc3('0x0'));var zipdir=require(_0xffc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xffc3('0x2'));var BPromise=require(_0xffc3('0x3'));var Mustache=require('mustache');var util=require(_0xffc3('0x4'));var path=require(_0xffc3('0x5'));var sox=require(_0xffc3('0x6'));var csv=require(_0xffc3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffc3('0x8'));var _=require(_0xffc3('0x9'));var squel=require('squel');var crypto=require(_0xffc3('0xa'));var jsforce=require(_0xffc3('0xb'));var deskjs=require(_0xffc3('0xc'));var toCsv=require(_0xffc3('0x7'));var querystring=require(_0xffc3('0xd'));var Papa=require('papaparse');var Redis=require(_0xffc3('0xe'));var authService=require(_0xffc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffc3('0x10'));var hardwareService=require(_0xffc3('0x11'));var logger=require(_0xffc3('0x12'))(_0xffc3('0x13'));var utils=require(_0xffc3('0x14'));var config=require(_0xffc3('0x15'));var licenseUtil=require(_0xffc3('0x16'));var db=require(_0xffc3('0x17'))['db'];function respondWithStatusCode(_0x211948,_0x10cf5b){_0x10cf5b=_0x10cf5b||0xcc;return function(_0x5175bf){if(_0x5175bf){return _0x211948[_0xffc3('0x18')](_0x10cf5b);}return _0x211948['status'](_0x10cf5b)[_0xffc3('0x19')]();};}function respondWithResult(_0x1b37b8,_0x99aceb){_0x99aceb=_0x99aceb||0xc8;return function(_0x5d7759){if(_0x5d7759){return _0x1b37b8[_0xffc3('0x1a')](_0x99aceb)[_0xffc3('0x1b')](_0x5d7759);}};}function respondWithFilteredResult(_0x2aaa30,_0x5817fc){return function(_0x266699){if(_0x266699){var _0x8542e0=typeof _0x5817fc[_0xffc3('0x1c')]==='undefined'&&typeof _0x5817fc[_0xffc3('0x1d')]===_0xffc3('0x1e');var _0x5b8f6d=_0x266699[_0xffc3('0x1f')];var _0x4c0e79=_0x8542e0?0x0:_0x5817fc[_0xffc3('0x1c')];var _0xa971b9=_0x8542e0?_0x266699['count']:_0x5817fc['offset']+_0x5817fc[_0xffc3('0x1d')];var _0x297151;if(_0xa971b9>=_0x5b8f6d){_0xa971b9=_0x5b8f6d;_0x297151=0xc8;}else{_0x297151=0xce;}_0x2aaa30[_0xffc3('0x1a')](_0x297151);return _0x2aaa30[_0xffc3('0x20')](_0xffc3('0x21'),_0x4c0e79+'-'+_0xa971b9+'/'+_0x5b8f6d)[_0xffc3('0x1b')](_0x266699);}return null;};}function patchUpdates(_0x1f1118){return function(_0x50bdd1){try{jsonpatch[_0xffc3('0x22')](_0x50bdd1,_0x1f1118,!![]);}catch(_0x1bd164){return BPromise[_0xffc3('0x23')](_0x1bd164);}return _0x50bdd1[_0xffc3('0x24')]();};}function saveUpdates(_0x2f6700,_0x3faf64){return function(_0x1ac310){if(_0x1ac310){return _0x1ac310[_0xffc3('0x25')](_0x2f6700)[_0xffc3('0x26')](function(_0x32085a){return _0x32085a;});}return null;};}function removeEntity(_0x2bcfec,_0x40dc18){return function(_0x3d63bf){if(_0x3d63bf){return _0x3d63bf[_0xffc3('0x27')]()[_0xffc3('0x26')](function(){_0x2bcfec[_0xffc3('0x1a')](0xcc)[_0xffc3('0x19')]();});}};}function handleEntityNotFound(_0x1b4aa7,_0xc9d7d5){return function(_0x57cdbb){if(!_0x57cdbb){_0x1b4aa7['sendStatus'](0x194);}return _0x57cdbb;};}function handleError(_0x475fc0,_0x1c3e93){_0x1c3e93=_0x1c3e93||0x1f4;return function(_0x4dd22e){logger[_0xffc3('0x28')](_0x4dd22e[_0xffc3('0x29')]);if(_0x4dd22e[_0xffc3('0x2a')]){delete _0x4dd22e[_0xffc3('0x2a')];}_0x475fc0['status'](_0x1c3e93)[_0xffc3('0x2b')](_0x4dd22e);};}exports[_0xffc3('0x25')]=function(_0x526530,_0xc8216d){if(_0x526530[_0xffc3('0x2c')]['id']){delete _0x526530[_0xffc3('0x2c')]['id'];}return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x526530[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xc8216d,null))['then'](saveUpdates(_0x526530[_0xffc3('0x2c')],null))['then'](respondWithResult(_0xc8216d,null))[_0xffc3('0x30')](handleError(_0xc8216d,null));};exports[_0xffc3('0x27')]=function(_0x64daad,_0xdc7631){return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x64daad[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xdc7631,null))['then'](removeEntity(_0xdc7631,null))['catch'](handleError(_0xdc7631,null));}; \ No newline at end of file +var _0x10fb=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','error','stack','name','send','body','find','params','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x6af163,_0x4542a5){var _0xf44ff=function(_0x1ed7c3){while(--_0x1ed7c3){_0x6af163['push'](_0x6af163['shift']());}};_0xf44ff(++_0x4542a5);}(_0x10fb,0x19a));var _0xb10f=function(_0x588901,_0x17249f){_0x588901=_0x588901-0x0;var _0x39c89c=_0x10fb[_0x588901];return _0x39c89c;};'use strict';var emlformat=require(_0xb10f('0x0'));var rimraf=require(_0xb10f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb10f('0x2'));var rp=require('request-promise');var moment=require(_0xb10f('0x3'));var BPromise=require(_0xb10f('0x4'));var Mustache=require(_0xb10f('0x5'));var util=require(_0xb10f('0x6'));var path=require(_0xb10f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb10f('0x8'));var fs=require('fs');var fs_extra=require(_0xb10f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb10f('0xa'));var jsforce=require(_0xb10f('0xb'));var deskjs=require(_0xb10f('0xc'));var toCsv=require(_0xb10f('0xd'));var querystring=require(_0xb10f('0xe'));var Papa=require(_0xb10f('0xf'));var Redis=require(_0xb10f('0x10'));var authService=require(_0xb10f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb10f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb10f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb10f('0x14'));var db=require(_0xb10f('0x15'))['db'];function respondWithStatusCode(_0x184ad9,_0x12b238){_0x12b238=_0x12b238||0xcc;return function(_0x21fb4a){if(_0x21fb4a){return _0x184ad9['sendStatus'](_0x12b238);}return _0x184ad9[_0xb10f('0x16')](_0x12b238)[_0xb10f('0x17')]();};}function respondWithResult(_0x52479c,_0x9223b){_0x9223b=_0x9223b||0xc8;return function(_0x595b77){if(_0x595b77){return _0x52479c[_0xb10f('0x16')](_0x9223b)[_0xb10f('0x18')](_0x595b77);}};}function respondWithFilteredResult(_0x31e0e5,_0x5f3479){return function(_0x1c7b0e){if(_0x1c7b0e){var _0x56fa7a=typeof _0x5f3479['offset']===_0xb10f('0x19')&&typeof _0x5f3479[_0xb10f('0x1a')]==='undefined';var _0x692448=_0x1c7b0e[_0xb10f('0x1b')];var _0x39accc=_0x56fa7a?0x0:_0x5f3479[_0xb10f('0x1c')];var _0x32c1e2=_0x56fa7a?_0x1c7b0e[_0xb10f('0x1b')]:_0x5f3479[_0xb10f('0x1c')]+_0x5f3479[_0xb10f('0x1a')];var _0x25a7a8;if(_0x32c1e2>=_0x692448){_0x32c1e2=_0x692448;_0x25a7a8=0xc8;}else{_0x25a7a8=0xce;}_0x31e0e5[_0xb10f('0x16')](_0x25a7a8);return _0x31e0e5['set'](_0xb10f('0x1d'),_0x39accc+'-'+_0x32c1e2+'/'+_0x692448)['json'](_0x1c7b0e);}return null;};}function patchUpdates(_0x1ccc06){return function(_0x8fca4e){try{jsonpatch[_0xb10f('0x1e')](_0x8fca4e,_0x1ccc06,!![]);}catch(_0x4a99cb){return BPromise['reject'](_0x4a99cb);}return _0x8fca4e['save']();};}function saveUpdates(_0x441952,_0xb72689){return function(_0x4065af){if(_0x4065af){return _0x4065af[_0xb10f('0x1f')](_0x441952)[_0xb10f('0x20')](function(_0x31367d){return _0x31367d;});}return null;};}function removeEntity(_0x277d91,_0x5bf7f4){return function(_0x1916c2){if(_0x1916c2){return _0x1916c2[_0xb10f('0x21')]()[_0xb10f('0x20')](function(){_0x277d91[_0xb10f('0x16')](0xcc)[_0xb10f('0x17')]();});}};}function handleEntityNotFound(_0x29012c,_0x5d7c9b){return function(_0x1cc574){if(!_0x1cc574){_0x29012c['sendStatus'](0x194);}return _0x1cc574;};}function handleError(_0xb898cc,_0x191364){_0x191364=_0x191364||0x1f4;return function(_0x2b537c){logger[_0xb10f('0x22')](_0x2b537c[_0xb10f('0x23')]);if(_0x2b537c['name']){delete _0x2b537c[_0xb10f('0x24')];}_0xb898cc[_0xb10f('0x16')](_0x191364)[_0xb10f('0x25')](_0x2b537c);};}exports[_0xb10f('0x1f')]=function(_0x592052,_0x4bacee){if(_0x592052['body']['id']){delete _0x592052[_0xb10f('0x26')]['id'];}return db['Action'][_0xb10f('0x27')]({'where':{'id':_0x592052[_0xb10f('0x28')]['id']}})['then'](handleEntityNotFound(_0x4bacee,null))[_0xb10f('0x20')](saveUpdates(_0x592052[_0xb10f('0x26')],null))[_0xb10f('0x20')](respondWithResult(_0x4bacee,null))[_0xb10f('0x29')](handleError(_0x4bacee,null));};exports[_0xb10f('0x21')]=function(_0x5c857c,_0x2e4710){return db['Action'][_0xb10f('0x27')]({'where':{'id':_0x5c857c['params']['id']}})[_0xb10f('0x20')](handleEntityNotFound(_0x2e4710,null))[_0xb10f('0x20')](removeEntity(_0x2e4710,null))[_0xb10f('0x29')](handleError(_0x2e4710,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 26f065b..8cd9a7f 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 _0x602a=['rimraf','./action.attributes','exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x39da38,_0x102e56){var _0x56e396=function(_0x5bd3be){while(--_0x5bd3be){_0x39da38['push'](_0x39da38['shift']());}};_0x56e396(++_0x102e56);}(_0x602a,0x1de));var _0xa602=function(_0x31f31e,_0x3dd397){_0x31f31e=_0x31f31e-0x0;var _0x464402=_0x602a[_0x31f31e];return _0x464402;};'use strict';var _=require(_0xa602('0x0'));var util=require('util');var logger=require(_0xa602('0x1'))(_0xa602('0x2'));var moment=require(_0xa602('0x3'));var BPromise=require(_0xa602('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa602('0x5'));var rimraf=require(_0xa602('0x6'));var config=require('../../config/environment');var attributes=require(_0xa602('0x7'));module[_0xa602('0x8')]=function(_0x5c79a1,_0x2a9d2f){return _0x5c79a1['define'](_0xa602('0x9'),attributes,{'tableName':_0xa602('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e1=['./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x399265,_0x5c31d9){var _0x42360e=function(_0x407272){while(--_0x407272){_0x399265['push'](_0x399265['shift']());}};_0x42360e(++_0x5c31d9);}(_0x49e1,0x93));var _0x149e=function(_0x7962d5,_0x18b354){_0x7962d5=_0x7962d5-0x0;var _0x1780ca=_0x49e1[_0x7962d5];return _0x1780ca;};'use strict';var _=require(_0x149e('0x0'));var util=require(_0x149e('0x1'));var logger=require(_0x149e('0x2'))(_0x149e('0x3'));var moment=require(_0x149e('0x4'));var BPromise=require(_0x149e('0x5'));var rp=require(_0x149e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x149e('0x7'));var config=require(_0x149e('0x8'));var attributes=require(_0x149e('0x9'));module[_0x149e('0xa')]=function(_0x341111,_0x3f131f){return _0x341111['define'](_0x149e('0xb'),attributes,{'tableName':_0x149e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 4865b4f..4fb7b11 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x814b,0x1a2));var _0xb814=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x814b[_0x4b9dc9];return _0x57b302;};'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')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa6be72,_0x370209){var _0x3664cd=function(_0x53d0e8){while(--_0x53d0e8){_0xa6be72['push'](_0xa6be72['shift']());}};_0x3664cd(++_0x370209);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x54fc1f,_0x1703c2){_0x54fc1f=_0x54fc1f-0x0;var _0x53f699=_0x7fbe[_0x54fc1f];return _0x53f699;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 59f88c7..19497ae 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 _0x32a2=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','exports'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x32a2,0x1c7));var _0x232a=function(_0x42addc,_0x1cd559){_0x42addc=_0x42addc-0x0;var _0x3ef1d1=_0x32a2[_0x42addc];return _0x3ef1d1;};'use strict';var multer=require(_0x232a('0x0'));var util=require(_0x232a('0x1'));var path=require(_0x232a('0x2'));var timeout=require(_0x232a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x232a('0x4'));var auth=require(_0x232a('0x5'));var interaction=require(_0x232a('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x232a('0x7')](_0x232a('0x8'),auth['isAuthenticated'](),controller[_0x232a('0x9')]);router[_0x232a('0xa')](_0x232a('0x8'),auth[_0x232a('0xb')](),controller['destroy']);module[_0x232a('0xc')]=router; \ No newline at end of file +var _0x1c17=['exports','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','/:id','destroy'];(function(_0x5950b8,_0x25067c){var _0x12a573=function(_0x4fb15c){while(--_0x4fb15c){_0x5950b8['push'](_0x5950b8['shift']());}};_0x12a573(++_0x25067c);}(_0x1c17,0xac));var _0x71c1=function(_0x2ab2c2,_0x21d6a7){_0x2ab2c2=_0x2ab2c2-0x0;var _0x5bf59a=_0x1c17[_0x2ab2c2];return _0x5bf59a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x71c1('0x0'));var router=express[_0x71c1('0x1')]();var fs_extra=require(_0x71c1('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x71c1('0x3'));var config=require(_0x71c1('0x4'));var controller=require(_0x71c1('0x5'));router['put'](_0x71c1('0x6'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x71c1('0x7')]);module[_0x71c1('0x8')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 66be60a..04839c2 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x9bc97d,_0x47eb1c){var _0x69d9=function(_0x52174c){while(--_0x52174c){_0x9bc97d['push'](_0x9bc97d['shift']());}};_0x69d9(++_0x47eb1c);}(_0xeff8,0x186));var _0x8eff=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xeff8[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0xae24=['sequelize','STRING'];(function(_0x32453a,_0x242540){var _0x5ca7f0=function(_0xbfea28){while(--_0xbfea28){_0x32453a['push'](_0x32453a['shift']());}};_0x5ca7f0(++_0x242540);}(_0xae24,0x182));var _0x4ae2=function(_0x479ceb,_0x25b683){_0x479ceb=_0x479ceb-0x0;var _0x15efcf=_0xae24[_0x479ceb];return _0x15efcf;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 17539ca..6c3df2a 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 _0x63cf=['Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','field','AnalyticMetric','findAll','metric','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','rows','catch','params','includeAll','create','body','user','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','length','operator','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','replace','function','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63cf,0xc9));var _0xf63c=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x63cf[_0x17bb31];return _0x505c71;};'use strict';var emlformat=require(_0xf63c('0x0'));var rimraf=require(_0xf63c('0x1'));var zipdir=require(_0xf63c('0x2'));var jsonpatch=require(_0xf63c('0x3'));var rp=require(_0xf63c('0x4'));var moment=require(_0xf63c('0x5'));var BPromise=require(_0xf63c('0x6'));var Mustache=require('mustache');var util=require(_0xf63c('0x7'));var path=require('path');var sox=require(_0xf63c('0x8'));var csv=require(_0xf63c('0x9'));var ejs=require(_0xf63c('0xa'));var fs=require('fs');var fs_extra=require(_0xf63c('0xb'));var _=require(_0xf63c('0xc'));var squel=require('squel');var crypto=require(_0xf63c('0xd'));var jsforce=require(_0xf63c('0xe'));var deskjs=require(_0xf63c('0xf'));var toCsv=require(_0xf63c('0x9'));var querystring=require(_0xf63c('0x10'));var Papa=require(_0xf63c('0x11'));var Redis=require(_0xf63c('0x12'));var authService=require(_0xf63c('0x13'));var qs=require(_0xf63c('0x14'));var as=require(_0xf63c('0x15'));var hardwareService=require(_0xf63c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf63c('0x17'));var config=require(_0xf63c('0x18'));var licenseUtil=require(_0xf63c('0x19'));var db=require(_0xf63c('0x1a'))['db'];var dbH=require(_0xf63c('0x1a'))[_0xf63c('0x1b')];function respondWithStatusCode(_0x1dddf3,_0x41ac1e){_0x41ac1e=_0x41ac1e||0xcc;return function(_0x2bff98){if(_0x2bff98){return _0x1dddf3[_0xf63c('0x1c')](_0x41ac1e);}return _0x1dddf3[_0xf63c('0x1d')](_0x41ac1e)[_0xf63c('0x1e')]();};}function respondWithResult(_0x43219a,_0x5378c2){_0x5378c2=_0x5378c2||0xc8;return function(_0xb98e6d){if(_0xb98e6d){return _0x43219a[_0xf63c('0x1d')](_0x5378c2)[_0xf63c('0x1f')](_0xb98e6d);}};}function respondWithFilteredResult(_0x5cd8c1,_0x4e408a){return function(_0x449881){if(_0x449881){var _0xdfa8e3=typeof _0x4e408a[_0xf63c('0x20')]==='undefined'&&typeof _0x4e408a[_0xf63c('0x21')]==='undefined';var _0x86ef2c=_0x449881[_0xf63c('0x22')];var _0x80febe=_0xdfa8e3?0x0:_0x4e408a['offset'];var _0x4567cb=_0xdfa8e3?_0x449881[_0xf63c('0x22')]:_0x4e408a[_0xf63c('0x20')]+_0x4e408a['limit'];var _0x56665e;if(_0x4567cb>=_0x86ef2c){_0x4567cb=_0x86ef2c;_0x56665e=0xc8;}else{_0x56665e=0xce;}_0x5cd8c1[_0xf63c('0x1d')](_0x56665e);return _0x5cd8c1[_0xf63c('0x23')](_0xf63c('0x24'),_0x80febe+'-'+_0x4567cb+'/'+_0x86ef2c)[_0xf63c('0x1f')](_0x449881);}return null;};}function patchUpdates(_0x5e7e0e){return function(_0x5359d1){try{jsonpatch[_0xf63c('0x25')](_0x5359d1,_0x5e7e0e,!![]);}catch(_0x287842){return BPromise[_0xf63c('0x26')](_0x287842);}return _0x5359d1[_0xf63c('0x27')]();};}function saveUpdates(_0x41297f,_0x2945ad){return function(_0x68692d){if(_0x68692d){return _0x68692d[_0xf63c('0x28')](_0x41297f)[_0xf63c('0x29')](function(_0x4221ff){return _0x4221ff;});}return null;};}function removeEntity(_0x3a5bc7,_0x27b8ce){return function(_0x58bbfc){if(_0x58bbfc){return _0x58bbfc[_0xf63c('0x2a')]()[_0xf63c('0x29')](function(){var _0x53e03c=_0x58bbfc['get']({'plain':!![]});var _0x47cb49=_0xf63c('0x2b');return db[_0xf63c('0x2c')][_0xf63c('0x2a')]({'where':{'type':_0x47cb49,'resourceId':_0x53e03c['id']}})[_0xf63c('0x29')](function(){return _0x58bbfc;});})[_0xf63c('0x29')](function(){_0x3a5bc7['status'](0xcc)[_0xf63c('0x1e')]();});}};}function handleEntityNotFound(_0x8468d3,_0x4d2521){return function(_0x1e84b6){if(!_0x1e84b6){_0x8468d3[_0xf63c('0x1c')](0x194);}return _0x1e84b6;};}function handleError(_0x43cbd7,_0xbba601){_0xbba601=_0xbba601||0x1f4;return function(_0x4447cc){logger[_0xf63c('0x2d')](_0x4447cc[_0xf63c('0x2e')]);if(_0x4447cc[_0xf63c('0x2f')]){delete _0x4447cc[_0xf63c('0x2f')];}_0x43cbd7[_0xf63c('0x1d')](_0xbba601)['send'](_0x4447cc);};}exports[_0xf63c('0x30')]=function(_0x5623af,_0x56a667){var _0xffc4a4={},_0x335168={},_0xc592b9={'count':0x0,'rows':[]};var _0x3d6536=_[_0xf63c('0x31')](db[_0xf63c('0x32')][_0xf63c('0x33')],function(_0x1aaaf4){return{'name':_0x1aaaf4['fieldName'],'type':_0x1aaaf4['type']['key']};});_0x335168[_0xf63c('0x34')]=_['map'](_0x3d6536,_0xf63c('0x2f'));_0x335168[_0xf63c('0x35')]=_[_0xf63c('0x36')](_0x5623af['query']);_0x335168[_0xf63c('0x37')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],_0x335168[_0xf63c('0x35')]);_0xffc4a4[_0xf63c('0x39')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],qs[_0xf63c('0x3a')](_0x5623af[_0xf63c('0x35')][_0xf63c('0x3a')]));_0xffc4a4[_0xf63c('0x39')]=_0xffc4a4[_0xf63c('0x39')]['length']?_0xffc4a4[_0xf63c('0x39')]:_0x335168[_0xf63c('0x34')];if(!_0x5623af[_0xf63c('0x35')][_0xf63c('0x3b')](_0xf63c('0x3c'))){_0xffc4a4[_0xf63c('0x21')]=qs[_0xf63c('0x21')](_0x5623af[_0xf63c('0x35')]['limit']);_0xffc4a4['offset']=qs['offset'](_0x5623af[_0xf63c('0x35')][_0xf63c('0x20')]);}_0xffc4a4[_0xf63c('0x3d')]=qs[_0xf63c('0x3e')](_0x5623af['query'][_0xf63c('0x3e')]);_0xffc4a4[_0xf63c('0x3f')]=qs[_0xf63c('0x37')](_['pick'](_0x5623af['query'],_0x335168[_0xf63c('0x37')]),_0x3d6536);if(_0x5623af[_0xf63c('0x35')]['filter']){_0xffc4a4[_0xf63c('0x3f')]=_[_0xf63c('0x40')](_0xffc4a4[_0xf63c('0x3f')],{'$or':_[_0xf63c('0x31')](_0x3d6536,function(_0xcd5a3d){if(_0xcd5a3d[_0xf63c('0x41')]!==_0xf63c('0x42')){var _0x33b14b={};_0x33b14b[_0xcd5a3d['name']]={'$like':'%'+_0x5623af[_0xf63c('0x35')][_0xf63c('0x43')]+'%'};return _0x33b14b;}})});}_0xffc4a4=_['merge']({},_0xffc4a4,_0x5623af[_0xf63c('0x44')]);var _0x5c69b2={'where':_0xffc4a4[_0xf63c('0x3f')]};return db[_0xf63c('0x32')][_0xf63c('0x22')](_0x5c69b2)[_0xf63c('0x29')](function(_0x6d949c){_0xc592b9[_0xf63c('0x22')]=_0x6d949c;if(_0x5623af[_0xf63c('0x35')]['includeAll']){_0xffc4a4[_0xf63c('0x45')]=[{'all':!![]}];}return db[_0xf63c('0x32')]['findAll'](_0xffc4a4);})['then'](function(_0x149501){_0xc592b9[_0xf63c('0x46')]=_0x149501;return _0xc592b9;})[_0xf63c('0x29')](respondWithFilteredResult(_0x56a667,_0xffc4a4))[_0xf63c('0x47')](handleError(_0x56a667,null));};exports['show']=function(_0xbf6703,_0x4653c5){var _0x2d4936={'raw':![],'where':{'id':_0xbf6703[_0xf63c('0x48')]['id']}},_0x111a30={};_0x111a30[_0xf63c('0x34')]=_[_0xf63c('0x36')](db[_0xf63c('0x32')][_0xf63c('0x33')]);_0x111a30['query']=_[_0xf63c('0x36')](_0xbf6703[_0xf63c('0x35')]);_0x111a30[_0xf63c('0x37')]=_['intersection'](_0x111a30['model'],_0x111a30[_0xf63c('0x35')]);_0x2d4936['attributes']=_[_0xf63c('0x38')](_0x111a30[_0xf63c('0x34')],qs['fields'](_0xbf6703[_0xf63c('0x35')][_0xf63c('0x3a')]));_0x2d4936[_0xf63c('0x39')]=_0x2d4936['attributes']['length']?_0x2d4936[_0xf63c('0x39')]:_0x111a30[_0xf63c('0x34')];if(_0xbf6703[_0xf63c('0x35')][_0xf63c('0x49')]){_0x2d4936[_0xf63c('0x45')]=[{'all':!![]}];}_0x2d4936=_[_0xf63c('0x40')]({},_0x2d4936,_0xbf6703[_0xf63c('0x44')]);return db[_0xf63c('0x32')]['find'](_0x2d4936)[_0xf63c('0x29')](handleEntityNotFound(_0x4653c5,null))['then'](respondWithResult(_0x4653c5,null))[_0xf63c('0x47')](handleError(_0x4653c5,null));};exports[_0xf63c('0x4a')]=function(_0x5ed078,_0x52e1b4){return db[_0xf63c('0x32')]['create'](_0x5ed078[_0xf63c('0x4b')],{})[_0xf63c('0x29')](function(_0x2c4802){var _0x104187=_0x5ed078[_0xf63c('0x4c')]['get']({'plain':!![]});if(!_0x104187)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104187['role']===_0xf63c('0x4c')){var _0x1481bb=_0x2c4802['get']({'plain':!![]});var _0x1359be=_0xf63c('0x4d');return db[_0xf63c('0x4e')][_0xf63c('0x4f')]({'where':{'name':_0x1359be,'userProfileId':_0x104187['userProfileId']},'raw':!![]})['then'](function(_0x4e5da7){if(_0x4e5da7&&_0x4e5da7[_0xf63c('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1481bb['name'],'resourceId':_0x1481bb['id'],'type':'CustomReports','sectionId':_0x4e5da7['id']},{})['then'](function(){return _0x2c4802;});}else{return _0x2c4802;}})[_0xf63c('0x47')](function(_0x393c6b){logger[_0xf63c('0x2d')](_0xf63c('0x51'),_0x393c6b);throw _0x393c6b;});}return _0x2c4802;})[_0xf63c('0x29')](respondWithResult(_0x52e1b4,0xc9))[_0xf63c('0x47')](handleError(_0x52e1b4,null));};exports['update']=function(_0x509dde,_0x9fe23a){if(_0x509dde[_0xf63c('0x4b')]['id']){delete _0x509dde[_0xf63c('0x4b')]['id'];}return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x509dde['params']['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x9fe23a,null))['then'](saveUpdates(_0x509dde[_0xf63c('0x4b')],null))['then'](respondWithResult(_0x9fe23a,null))[_0xf63c('0x47')](handleError(_0x9fe23a,null));};exports['destroy']=function(_0x7891fd,_0x3aac58){return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x7891fd[_0xf63c('0x48')]['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x3aac58,null))['then'](removeEntity(_0x3aac58,null))[_0xf63c('0x47')](handleError(_0x3aac58,null));};exports['preview']=function(_0xe773f5,_0x55613a){var _0x40bc99=0xa;var _0x1952f6=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x180e25={'SUM':_0xf63c('0x56'),'COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x4ea56d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x414285=function(_0x1e78d4){return!_[_0xf63c('0x63')](['IS\x20NULL',_0xf63c('0x64'),_0xf63c('0x65'),'IS\x20NOT\x20EMPTY'],_0x1e78d4);};var _0x18a2e0=function(_0x437065){if(!_0x437065||!_0x437065['rules'][_0xf63c('0x66')]){return'';}for(var _0x4f06b3='(',_0x2184c2=0x0;_0x2184c2<_0x437065['rules'][_0xf63c('0x66')];_0x2184c2+=0x1){_0x2184c2>0x0&&(_0x4f06b3+='\x20'+_0x437065[_0xf63c('0x67')]+'\x20');_0x4f06b3+=_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]?_0x18a2e0(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]):_0x437065['rules'][_0x2184c2]['field']+'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')]+(_0x414285(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')])?'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6b')]:'');}return _0x4f06b3+')';};var _0x8a0be3={'where':{'id':_0xe773f5[_0xf63c('0x48')]['id']}},_0x571f05,_0xabc96f,_0x3fad82,_0x52b847,_0x4b4cd4;_0x8a0be3=_[_0xf63c('0x40')]({},_0x8a0be3,_0xe773f5[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x8a0be3)[_0xf63c('0x29')](function(_0x35f4f0){if(_0x35f4f0){_0x571f05=_0x35f4f0;return _0x35f4f0[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x1e42bf){if(_0x1e42bf){if(!_0x1e42bf['length']){throw new db[(_0xf63c('0x6d'))][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xabc96f=_0x1e42bf;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x29011c){if(_0x29011c){_0x3fad82=_[_0xf63c('0x70')](_0x29011c,'id');var _0x43cb1e;var _0x282d2d=squel[_0xf63c('0x71')]();_0x282d2d[_0xf63c('0x72')](_0x571f05[_0xf63c('0x73')]);for(var _0x5cd4f2=0x0;_0x5cd4f2<_0xabc96f['length'];_0x5cd4f2+=0x1){_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x74')]?_0x3fad82[_0xabc96f[_0x5cd4f2]['MetricId']]['metric']:_0xabc96f[_0x5cd4f2]['field'];_0x43cb1e=_0xabc96f[_0x5cd4f2]['function']?_[_0xf63c('0x75')](_0x180e25[_0xabc96f[_0x5cd4f2][_0xf63c('0x76')]],'%s',_0x43cb1e):_0x43cb1e;_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x4ea56d[_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]],'%s',_0x43cb1e):_0x43cb1e;if(_0xabc96f[_0x5cd4f2]['groupBy']){_0x282d2d[_0xf63c('0x69')](_0x43cb1e);}_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]&&_0x282d2d['order'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]==='DESC'?![]:!![]);_0x282d2d['field'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x79')]||_0x43cb1e);}if(_0x571f05[_0xf63c('0x7a')]){_0x571f05[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x7a')]);for(var _0x349e91=0x0;_0x349e91<_0x571f05[_0xf63c('0x7a')]['length'];_0x349e91+=0x1){if(_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']&&_[_0xf63c('0x63')](_0x1952f6,_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x41')])&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7c')]&&_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')]&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7e')]){_0x282d2d[_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']](_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x571f05[_0xf63c('0x73')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7c')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7e')]));}}}if(_0x571f05[_0xf63c('0x80')]){_0x571f05[_0xf63c('0x80')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x80')]);_0x282d2d[_0xf63c('0x3f')](_0x18a2e0(_0x571f05[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x4b4cd4=_0x282d2d[_0xf63c('0x81')]();_0x282d2d['limit'](_0x40bc99);_0x282d2d[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x282d2d[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x282d2d[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](respondWithResult(_0x55613a,null))[_0xf63c('0x47')](handleError(_0x55613a,null));};function runReport(_0x290ae,_0x269ca1,_0x10a7ab){var _0x249350=_0x269ca1[_0xf63c('0x2f')];var _0x676e7=0xa;var _0x5145b7=['join','left_join',_0xf63c('0x54'),'cross_join'];var _0x4e670e={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x180791={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':'DATE(%s)','HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2b669f=function(_0x4dde3e){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),'IS\x20NOT\x20NULL',_0xf63c('0x65'),_0xf63c('0x8a')],_0x4dde3e);};var _0x44aa57=function(_0x417567){if(!_0x417567||!_0x417567[_0xf63c('0x68')][_0xf63c('0x66')]){return'';}for(var _0x4161ea='(',_0x1485ac=0x0;_0x1485ac<_0x417567[_0xf63c('0x68')][_0xf63c('0x66')];_0x1485ac+=0x1){_0x1485ac>0x0&&(_0x4161ea+='\x20'+_0x417567[_0xf63c('0x67')]+'\x20');_0x4161ea+=_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x69')]?_0x44aa57(_0x417567[_0xf63c('0x68')][_0x1485ac]['group']):_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x8b')]+'\x20'+_0x417567['rules'][_0x1485ac]['condition']+(_0x2b669f(_0x417567[_0xf63c('0x68')][_0x1485ac]['condition'])?'\x20'+_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x6b')]:'');}return _0x4161ea+')';};var _0x5f3cc9={'where':{'id':_0x290ae['id']}},_0x23f342,_0xd610bd,_0x3b6a07,_0x216233,_0x433b50;_0x5f3cc9=_[_0xf63c('0x40')]({},_0x5f3cc9,_0x10a7ab);return db[_0xf63c('0x32')]['find'](_0x5f3cc9)['then'](function(_0xa00856){if(_0xa00856){_0x23f342=_0xa00856;return _0xa00856['getFields']();}return null;})[_0xf63c('0x29')](function(_0x117527){if(_0x117527){if(!_0x117527[_0xf63c('0x66')]){throw new db['Sequelize'][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xd610bd=_0x117527;return db[_0xf63c('0x8c')][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x67185b){if(_0x67185b){_0x3b6a07=_[_0xf63c('0x70')](_0x67185b,'id');var _0x183f57;var _0x37bab4=squel[_0xf63c('0x71')]();_0x37bab4['from'](_0x23f342[_0xf63c('0x73')]);for(var _0x3e8d30=0x0;_0x3e8d30<_0xd610bd[_0xf63c('0x66')];_0x3e8d30+=0x1){_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x74')]?_0x3b6a07[_0xd610bd[_0x3e8d30][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0xd610bd[_0x3e8d30][_0xf63c('0x8b')];_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x4e670e[_0xd610bd[_0x3e8d30][_0xf63c('0x76')]],'%s',_0x183f57):_0x183f57;_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x180791[_0xd610bd[_0x3e8d30][_0xf63c('0x77')]],'%s',_0x183f57):_0x183f57;if(_0xd610bd[_0x3e8d30][_0xf63c('0x8f')]){_0x37bab4[_0xf63c('0x69')](_0x183f57);}_0xd610bd[_0x3e8d30][_0xf63c('0x78')]&&_0x37bab4[_0xf63c('0x3d')](_0x183f57,_0xd610bd[_0x3e8d30]['orderBy']==='DESC'?![]:!![]);_0x37bab4[_0xf63c('0x8b')](_0x183f57,_0xd610bd[_0x3e8d30]['alias']||_0x183f57);}if(_0x23f342[_0xf63c('0x7a')]){_0x23f342['joins']=JSON['parse'](_0x23f342['joins']);for(var _0xc99432=0x0;_0xc99432<_0x23f342['joins'][_0xf63c('0x66')];_0xc99432+=0x1){if(_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x5145b7,_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')])&&_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7c')]&&_0x23f342['joins'][_0xc99432]['foreignTable']&&_0x23f342['joins'][_0xc99432]['foreignKey']){_0x37bab4[_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]](_0x23f342['joins'][_0xc99432][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x23f342[_0xf63c('0x73')],_0x23f342['joins'][_0xc99432][_0xf63c('0x7c')],_0x23f342[_0xf63c('0x7a')][_0xc99432]['foreignTable'],_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7e')]));}}}if(_0x23f342[_0xf63c('0x80')]){_0x23f342['conditions']=JSON[_0xf63c('0x7b')](_0x23f342['conditions']);_0x37bab4[_0xf63c('0x3f')](_0x44aa57(_0x23f342[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x433b50=_0x37bab4[_0xf63c('0x81')]();_0x37bab4[_0xf63c('0x21')](_0x676e7);_0x37bab4['offset'](0x0);return;}})[_0xf63c('0x29')](function(){if(_0x269ca1[_0xf63c('0x90')]===_0xf63c('0x91')){return null;}var _0x4ed29a=_['merge'](_0x269ca1,{'name':_0x269ca1[_0xf63c('0x92')]||_0x269ca1['name']||_0x23f342[_0xf63c('0x2f')],'basename':_0x249350,'savename':util['format'](_0xf63c('0x93'),_0x269ca1[_0xf63c('0x2f')]||_0x23f342[_0xf63c('0x2f')],require(_0xf63c('0x94'))[_0xf63c('0x95')](0x4),_0x269ca1[_0xf63c('0x90')]||_0xf63c('0x96')),'reportId':_0x23f342['id'],'reportType':_0xf63c('0x97')});return db[_0xf63c('0x98')][_0xf63c('0x4a')](_0x4ed29a,{'raw':!![]});})[_0xf63c('0x29')](function(_0x2e760d){if(_0x23f342[_0xf63c('0x73')]===_0xf63c('0x99')){_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+_0xf63c('0x9a'),_0x269ca1['startDate'],_0x269ca1[_0xf63c('0x9b')]);}else{_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x269ca1[_0xf63c('0x9c')],_0x269ca1['endDate']);}if(_0x2e760d){logger[_0xf63c('0x9d')]('Run\x20Query:',_0x433b50[_0xf63c('0x84')]());require(_0xf63c('0x9e'))[_0xf63c('0x9f')](path[_0xf63c('0x52')](__dirname,_0xf63c('0xa0'),_0x2e760d['output']),[_0x2e760d['id'],_0x433b50[_0xf63c('0x84')](),path['join'](__dirname,_0xf63c('0xa1'),_0x2e760d['savename']),_0x249350]);return _0x2e760d;}else{var _0x1edbdf=squel[_0xf63c('0x71')]();_0x1edbdf[_0xf63c('0x72')]('('+_0x433b50[_0xf63c('0x84')]()+')','countTable');_0x1edbdf[_0xf63c('0x8b')](_0xf63c('0xa2'),_0xf63c('0x22'));_0x433b50['limit'](_0x269ca1[_0xf63c('0x21')]||_0x676e7);_0x433b50[_0xf63c('0x20')](_0x269ca1['offset']||0x0);return dbH['sequelize']['query'](_0x1edbdf[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')][_0xf63c('0x87')]})['then'](function(_0xb086fc){if(!_0xb086fc[_0xf63c('0x66')]){_0x216233=0x0;}else{_0x216233=_0xb086fc[0x0][_0xf63c('0x22')]||0x0;}return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x433b50[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')]['SELECT']});})[_0xf63c('0x29')](function(_0x13ead8){return{'rows':_0x13ead8||[],'count':_0x216233};});}});}exports[_0xf63c('0xa3')]=function(_0x57c446,_0x310076){return runReport(_0x57c446[_0xf63c('0x48')],_0x57c446[_0xf63c('0x35')],_0x57c446[_0xf63c('0x44')])[_0xf63c('0x29')](respondWithResult(_0x310076,null))[_0xf63c('0x47')](handleError(_0x310076,null));};exports[_0xf63c('0xa4')]=runReport;exports[_0xf63c('0x35')]=function(_0x164512,_0x4592be){var _0x2683dc=0xa;var _0x351536=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x288c37={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x32a8a9={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x5d9c69=function(_0x1bb4d7){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),_0xf63c('0x64'),_0xf63c('0x65'),_0xf63c('0x8a')],_0x1bb4d7);};var _0x4ae6d5=function(_0x40b952){if(!_0x40b952||!_0x40b952['rules'][_0xf63c('0x66')]){return'';}for(var _0x48b3bb='(',_0x5613d6=0x0;_0x5613d6<_0x40b952[_0xf63c('0x68')][_0xf63c('0x66')];_0x5613d6+=0x1){_0x5613d6>0x0&&(_0x48b3bb+='\x20'+_0x40b952[_0xf63c('0x67')]+'\x20');_0x48b3bb+=_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x69')]?_0x4ae6d5(_0x40b952[_0xf63c('0x68')][_0x5613d6]['group']):_0x40b952['rules'][_0x5613d6][_0xf63c('0x8b')]+'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6a')]+(_0x5d9c69(_0x40b952['rules'][_0x5613d6][_0xf63c('0x6a')])?'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6b')]:'');}return _0x48b3bb+')';};var _0x55d46d={'where':{'id':_0x164512['params']['id']}},_0x4bc093,_0x18e87c,_0xb7efc2,_0x3698bc,_0x4bf262;_0x55d46d=_[_0xf63c('0x40')]({},_0x55d46d,_0x164512[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x55d46d)[_0xf63c('0x29')](function(_0x4fd18a){if(_0x4fd18a){_0x4bc093=_0x4fd18a;return _0x4fd18a[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x131d8a){if(_0x131d8a){if(!_0x131d8a[_0xf63c('0x66')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18e87c=_0x131d8a;return db['AnalyticMetric'][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x47ea38){if(_0x47ea38){_0xb7efc2=_['keyBy'](_0x47ea38,'id');var _0x5c9654;var _0x139e92=squel['select']();_0x139e92[_0xf63c('0x72')](_0x4bc093[_0xf63c('0x73')]);for(var _0x54db63=0x0;_0x54db63<_0x18e87c['length'];_0x54db63+=0x1){_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x74')]?_0xb7efc2[_0x18e87c[_0x54db63][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0x18e87c[_0x54db63][_0xf63c('0x8b')];_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x288c37[_0x18e87c[_0x54db63][_0xf63c('0x76')]],'%s',_0x5c9654):_0x5c9654;_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x32a8a9[_0x18e87c[_0x54db63][_0xf63c('0x77')]],'%s',_0x5c9654):_0x5c9654;if(_0x18e87c[_0x54db63][_0xf63c('0x8f')]){_0x139e92[_0xf63c('0x69')](_0x5c9654);}_0x18e87c[_0x54db63]['orderBy']&&_0x139e92[_0xf63c('0x3d')](_0x5c9654,_0x18e87c[_0x54db63]['orderBy']===_0xf63c('0xa5')?![]:!![]);_0x139e92['field'](_0x5c9654,_0x18e87c[_0x54db63][_0xf63c('0x79')]||_0x5c9654);}if(_0x4bc093[_0xf63c('0x7a')]){_0x4bc093[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x4bc093[_0xf63c('0x7a')]);for(var _0x5f3ea2=0x0;_0x5f3ea2<_0x4bc093['joins'][_0xf63c('0x66')];_0x5f3ea2+=0x1){if(_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x351536,_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x41')])&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7c')]&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')]&&_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7e')]){_0x139e92[_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2]['type']](_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4bc093[_0xf63c('0x73')],_0x4bc093['joins'][_0x5f3ea2]['parentKey'],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7e')]));}}}if(_0x4bc093[_0xf63c('0x80')]){_0x4bc093['conditions']=JSON[_0xf63c('0x7b')](_0x4bc093['conditions']);_0x139e92[_0xf63c('0x3f')](_0x4ae6d5(_0x4bc093['conditions'][_0xf63c('0x69')]));}_0x4bf262=_0x139e92[_0xf63c('0x81')]();_0x139e92[_0xf63c('0x21')](_0x2683dc);_0x139e92[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x139e92[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x139e92[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](function(){return{'sql':_0x4bf262[_0xf63c('0x84')]()};})[_0xf63c('0x29')](respondWithResult(_0x4592be,null))[_0xf63c('0x47')](handleError(_0x4592be,null));}; \ No newline at end of file +var _0x3181=['rawAttributes','length','includeAll','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','group','orderBy','DESC','alias','joins','parentKey','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','debug','toString','QueryTypes','SELECT','right_join','COUNT(%s)','GROUP_CONCAT(%s)','IS\x20NULL','IS\x20NOT\x20NULL','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','foreignTable','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','sequelize','run','runReport','SEC_TO_TIME(%s)','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','AnalyticCustomReport','include','findAll','rows','catch','show','params'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x3181,0x64));var _0x1318=function(_0x11fbaa,_0x52dc16){_0x11fbaa=_0x11fbaa-0x0;var _0x1831fd=_0x3181[_0x11fbaa];return _0x1831fd;};'use strict';var emlformat=require(_0x1318('0x0'));var rimraf=require(_0x1318('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1318('0x2'));var rp=require(_0x1318('0x3'));var moment=require('moment');var BPromise=require(_0x1318('0x4'));var Mustache=require('mustache');var util=require(_0x1318('0x5'));var path=require(_0x1318('0x6'));var sox=require(_0x1318('0x7'));var csv=require(_0x1318('0x8'));var ejs=require(_0x1318('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1318('0xa'));var crypto=require('crypto');var jsforce=require(_0x1318('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1318('0x8'));var querystring=require(_0x1318('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1318('0xd'));var qs=require(_0x1318('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1318('0xf'));var logger=require(_0x1318('0x10'))(_0x1318('0x11'));var utils=require('../../config/utils');var config=require(_0x1318('0x12'));var licenseUtil=require(_0x1318('0x13'));var db=require(_0x1318('0x14'))['db'];var dbH=require(_0x1318('0x14'))[_0x1318('0x15')];function respondWithStatusCode(_0x4b6b99,_0x1d92e5){_0x1d92e5=_0x1d92e5||0xcc;return function(_0x3e0e5f){if(_0x3e0e5f){return _0x4b6b99[_0x1318('0x16')](_0x1d92e5);}return _0x4b6b99[_0x1318('0x17')](_0x1d92e5)[_0x1318('0x18')]();};}function respondWithResult(_0x16c840,_0x14fe00){_0x14fe00=_0x14fe00||0xc8;return function(_0x3927d5){if(_0x3927d5){return _0x16c840[_0x1318('0x17')](_0x14fe00)[_0x1318('0x19')](_0x3927d5);}};}function respondWithFilteredResult(_0xd053e3,_0x2a0a99){return function(_0x48a688){if(_0x48a688){var _0x2ac4bd=typeof _0x2a0a99[_0x1318('0x1a')]===_0x1318('0x1b')&&typeof _0x2a0a99[_0x1318('0x1c')]===_0x1318('0x1b');var _0x30bcd1=_0x48a688[_0x1318('0x1d')];var _0x2fb6ba=_0x2ac4bd?0x0:_0x2a0a99[_0x1318('0x1a')];var _0x5ae025=_0x2ac4bd?_0x48a688[_0x1318('0x1d')]:_0x2a0a99['offset']+_0x2a0a99[_0x1318('0x1c')];var _0x2ed16c;if(_0x5ae025>=_0x30bcd1){_0x5ae025=_0x30bcd1;_0x2ed16c=0xc8;}else{_0x2ed16c=0xce;}_0xd053e3[_0x1318('0x17')](_0x2ed16c);return _0xd053e3['set'](_0x1318('0x1e'),_0x2fb6ba+'-'+_0x5ae025+'/'+_0x30bcd1)[_0x1318('0x19')](_0x48a688);}return null;};}function patchUpdates(_0x5e792c){return function(_0x398274){try{jsonpatch[_0x1318('0x1f')](_0x398274,_0x5e792c,!![]);}catch(_0x293340){return BPromise[_0x1318('0x20')](_0x293340);}return _0x398274[_0x1318('0x21')]();};}function saveUpdates(_0x4db0af,_0x8e026b){return function(_0x1f25af){if(_0x1f25af){return _0x1f25af['update'](_0x4db0af)[_0x1318('0x22')](function(_0x58e66b){return _0x58e66b;});}return null;};}function removeEntity(_0x5eb8bf,_0x5b54c7){return function(_0x20a117){if(_0x20a117){return _0x20a117[_0x1318('0x23')]()['then'](function(){var _0x25583c=_0x20a117[_0x1318('0x24')]({'plain':!![]});var _0x10c62d=_0x1318('0x25');return db[_0x1318('0x26')]['destroy']({'where':{'type':_0x10c62d,'resourceId':_0x25583c['id']}})[_0x1318('0x22')](function(){return _0x20a117;});})[_0x1318('0x22')](function(){_0x5eb8bf[_0x1318('0x17')](0xcc)[_0x1318('0x18')]();});}};}function handleEntityNotFound(_0x23761a,_0x4bcf35){return function(_0x21c432){if(!_0x21c432){_0x23761a[_0x1318('0x16')](0x194);}return _0x21c432;};}function handleError(_0x3135e0,_0x70ad7b){_0x70ad7b=_0x70ad7b||0x1f4;return function(_0x2c912a){logger[_0x1318('0x27')](_0x2c912a[_0x1318('0x28')]);if(_0x2c912a['name']){delete _0x2c912a[_0x1318('0x29')];}_0x3135e0[_0x1318('0x17')](_0x70ad7b)[_0x1318('0x2a')](_0x2c912a);};}exports[_0x1318('0x2b')]=function(_0x402ce1,_0x3ed2e4){var _0x4db1d3={},_0x20f2c8={},_0x43abc9={'count':0x0,'rows':[]};var _0x56e635=_[_0x1318('0x2c')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5c1797){return{'name':_0x5c1797[_0x1318('0x2d')],'type':_0x5c1797['type'][_0x1318('0x2e')]};});_0x20f2c8[_0x1318('0x2f')]=_[_0x1318('0x2c')](_0x56e635,_0x1318('0x29'));_0x20f2c8[_0x1318('0x30')]=_[_0x1318('0x31')](_0x402ce1[_0x1318('0x30')]);_0x20f2c8['filters']=_[_0x1318('0x32')](_0x20f2c8[_0x1318('0x2f')],_0x20f2c8[_0x1318('0x30')]);_0x4db1d3['attributes']=_['intersection'](_0x20f2c8['model'],qs[_0x1318('0x33')](_0x402ce1[_0x1318('0x30')][_0x1318('0x33')]));_0x4db1d3[_0x1318('0x34')]=_0x4db1d3[_0x1318('0x34')]['length']?_0x4db1d3[_0x1318('0x34')]:_0x20f2c8[_0x1318('0x2f')];if(!_0x402ce1[_0x1318('0x30')][_0x1318('0x35')](_0x1318('0x36'))){_0x4db1d3[_0x1318('0x1c')]=qs[_0x1318('0x1c')](_0x402ce1[_0x1318('0x30')]['limit']);_0x4db1d3[_0x1318('0x1a')]=qs[_0x1318('0x1a')](_0x402ce1[_0x1318('0x30')][_0x1318('0x1a')]);}_0x4db1d3[_0x1318('0x37')]=qs[_0x1318('0x38')](_0x402ce1[_0x1318('0x30')]['sort']);_0x4db1d3['where']=qs[_0x1318('0x39')](_[_0x1318('0x3a')](_0x402ce1[_0x1318('0x30')],_0x20f2c8['filters']),_0x56e635);if(_0x402ce1['query'][_0x1318('0x3b')]){_0x4db1d3['where']=_[_0x1318('0x3c')](_0x4db1d3[_0x1318('0x3d')],{'$or':_[_0x1318('0x2c')](_0x56e635,function(_0x55215c){if(_0x55215c[_0x1318('0x3e')]!==_0x1318('0x3f')){var _0x2ed542={};_0x2ed542[_0x55215c[_0x1318('0x29')]]={'$like':'%'+_0x402ce1[_0x1318('0x30')]['filter']+'%'};return _0x2ed542;}})});}_0x4db1d3=_[_0x1318('0x3c')]({},_0x4db1d3,_0x402ce1['options']);var _0x3bb63c={'where':_0x4db1d3[_0x1318('0x3d')]};return db[_0x1318('0x40')][_0x1318('0x1d')](_0x3bb63c)[_0x1318('0x22')](function(_0x2ab586){_0x43abc9[_0x1318('0x1d')]=_0x2ab586;if(_0x402ce1[_0x1318('0x30')]['includeAll']){_0x4db1d3[_0x1318('0x41')]=[{'all':!![]}];}return db[_0x1318('0x40')][_0x1318('0x42')](_0x4db1d3);})['then'](function(_0xa38b5f){_0x43abc9[_0x1318('0x43')]=_0xa38b5f;return _0x43abc9;})[_0x1318('0x22')](respondWithFilteredResult(_0x3ed2e4,_0x4db1d3))[_0x1318('0x44')](handleError(_0x3ed2e4,null));};exports[_0x1318('0x45')]=function(_0x1ed02c,_0x1c8c18){var _0x44a0d5={'raw':![],'where':{'id':_0x1ed02c[_0x1318('0x46')]['id']}},_0x1c9be2={};_0x1c9be2[_0x1318('0x2f')]=_['keys'](db[_0x1318('0x40')][_0x1318('0x47')]);_0x1c9be2[_0x1318('0x30')]=_['keys'](_0x1ed02c[_0x1318('0x30')]);_0x1c9be2[_0x1318('0x39')]=_['intersection'](_0x1c9be2[_0x1318('0x2f')],_0x1c9be2[_0x1318('0x30')]);_0x44a0d5[_0x1318('0x34')]=_['intersection'](_0x1c9be2[_0x1318('0x2f')],qs['fields'](_0x1ed02c['query'][_0x1318('0x33')]));_0x44a0d5['attributes']=_0x44a0d5[_0x1318('0x34')][_0x1318('0x48')]?_0x44a0d5[_0x1318('0x34')]:_0x1c9be2[_0x1318('0x2f')];if(_0x1ed02c[_0x1318('0x30')][_0x1318('0x49')]){_0x44a0d5[_0x1318('0x41')]=[{'all':!![]}];}_0x44a0d5=_[_0x1318('0x3c')]({},_0x44a0d5,_0x1ed02c[_0x1318('0x4a')]);return db[_0x1318('0x40')]['find'](_0x44a0d5)[_0x1318('0x22')](handleEntityNotFound(_0x1c8c18,null))[_0x1318('0x22')](respondWithResult(_0x1c8c18,null))['catch'](handleError(_0x1c8c18,null));};exports['create']=function(_0x55ad30,_0x71303e){return db[_0x1318('0x40')]['create'](_0x55ad30[_0x1318('0x4b')],{})[_0x1318('0x22')](function(_0x29f4bc){var _0x1bc777=_0x55ad30[_0x1318('0x4c')]['get']({'plain':!![]});if(!_0x1bc777)throw new Error(_0x1318('0x4d'));if(_0x1bc777[_0x1318('0x4e')]===_0x1318('0x4c')){var _0x2386b3=_0x29f4bc[_0x1318('0x24')]({'plain':!![]});var _0x219bd0=_0x1318('0x4f');return db[_0x1318('0x50')][_0x1318('0x51')]({'where':{'name':_0x219bd0,'userProfileId':_0x1bc777[_0x1318('0x52')]},'raw':!![]})[_0x1318('0x22')](function(_0x333676){if(_0x333676&&_0x333676[_0x1318('0x53')]===0x0){return db[_0x1318('0x26')][_0x1318('0x54')]({'name':_0x2386b3[_0x1318('0x29')],'resourceId':_0x2386b3['id'],'type':_0x1318('0x25'),'sectionId':_0x333676['id']},{})[_0x1318('0x22')](function(){return _0x29f4bc;});}else{return _0x29f4bc;}})[_0x1318('0x44')](function(_0x1573dc){logger['error'](_0x1318('0x55'),_0x1573dc);throw _0x1573dc;});}return _0x29f4bc;})[_0x1318('0x22')](respondWithResult(_0x71303e,0xc9))['catch'](handleError(_0x71303e,null));};exports[_0x1318('0x56')]=function(_0x449a94,_0x293014){if(_0x449a94[_0x1318('0x4b')]['id']){delete _0x449a94[_0x1318('0x4b')]['id'];}return db[_0x1318('0x40')][_0x1318('0x51')]({'where':{'id':_0x449a94[_0x1318('0x46')]['id']}})[_0x1318('0x22')](handleEntityNotFound(_0x293014,null))[_0x1318('0x22')](saveUpdates(_0x449a94['body'],null))['then'](respondWithResult(_0x293014,null))['catch'](handleError(_0x293014,null));};exports['destroy']=function(_0x4f92f8,_0xd5843b){return db[_0x1318('0x40')][_0x1318('0x51')]({'where':{'id':_0x4f92f8[_0x1318('0x46')]['id']}})[_0x1318('0x22')](handleEntityNotFound(_0xd5843b,null))[_0x1318('0x22')](removeEntity(_0xd5843b,null))[_0x1318('0x44')](handleError(_0xd5843b,null));};exports[_0x1318('0x57')]=function(_0x34e673,_0xe6cf7c){var _0x484cf5=0xa;var _0x20e4c6=[_0x1318('0x58'),_0x1318('0x59'),'right_join',_0x1318('0x5a')];var _0x4b44aa={'SUM':_0x1318('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1318('0x5c'),'MAX':_0x1318('0x5d'),'MIN':_0x1318('0x5e'),'AVG':_0x1318('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1318('0x60'),'GROUP_CONCAT DESC':_0x1318('0x61')};var _0x116001={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1318('0x62'),'HOUR':_0x1318('0x63'),'ROUND':_0x1318('0x64'),'UNIX_TIMESTAMP':_0x1318('0x65')};var _0x21bd16=function(_0x5abb1b){return!_[_0x1318('0x66')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1318('0x67'),_0x1318('0x68')],_0x5abb1b);};var _0x1d3bcc=function(_0x21563f){if(!_0x21563f||!_0x21563f[_0x1318('0x69')][_0x1318('0x48')]){return'';}for(var _0x3ba1e7='(',_0x4175ce=0x0;_0x4175ce<_0x21563f[_0x1318('0x69')]['length'];_0x4175ce+=0x1){_0x4175ce>0x0&&(_0x3ba1e7+='\x20'+_0x21563f[_0x1318('0x6a')]+'\x20');_0x3ba1e7+=_0x21563f[_0x1318('0x69')][_0x4175ce]['group']?_0x1d3bcc(_0x21563f[_0x1318('0x69')][_0x4175ce]['group']):_0x21563f[_0x1318('0x69')][_0x4175ce][_0x1318('0x6b')]+'\x20'+_0x21563f[_0x1318('0x69')][_0x4175ce]['condition']+(_0x21bd16(_0x21563f[_0x1318('0x69')][_0x4175ce][_0x1318('0x6c')])?'\x20'+_0x21563f[_0x1318('0x69')][_0x4175ce][_0x1318('0x6d')]:'');}return _0x3ba1e7+')';};var _0x2912c9={'where':{'id':_0x34e673[_0x1318('0x46')]['id']}},_0x5833dc,_0x34ee0a,_0x5f1d37,_0x22126d,_0x37e2b3;_0x2912c9=_['merge']({},_0x2912c9,_0x34e673[_0x1318('0x4a')]);return db[_0x1318('0x40')]['find'](_0x2912c9)[_0x1318('0x22')](function(_0x5654d7){if(_0x5654d7){_0x5833dc=_0x5654d7;return _0x5654d7[_0x1318('0x6e')]();}return null;})[_0x1318('0x22')](function(_0x3fd490){if(_0x3fd490){if(!_0x3fd490[_0x1318('0x48')]){throw new db['Sequelize'][(_0x1318('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34ee0a=_0x3fd490;return db[_0x1318('0x70')][_0x1318('0x42')]({'raw':!![]});}return null;})[_0x1318('0x22')](function(_0x1e7cd3){if(_0x1e7cd3){_0x5f1d37=_[_0x1318('0x71')](_0x1e7cd3,'id');var _0x54a7d6;var _0x4c76e4=squel[_0x1318('0x72')]();_0x4c76e4[_0x1318('0x73')](_0x5833dc[_0x1318('0x74')]);for(var _0x5db1dd=0x0;_0x5db1dd<_0x34ee0a['length'];_0x5db1dd+=0x1){_0x54a7d6=_0x34ee0a[_0x5db1dd]['MetricId']?_0x5f1d37[_0x34ee0a[_0x5db1dd][_0x1318('0x75')]][_0x1318('0x76')]:_0x34ee0a[_0x5db1dd]['field'];_0x54a7d6=_0x34ee0a[_0x5db1dd][_0x1318('0x77')]?_[_0x1318('0x78')](_0x4b44aa[_0x34ee0a[_0x5db1dd][_0x1318('0x77')]],'%s',_0x54a7d6):_0x54a7d6;_0x54a7d6=_0x34ee0a[_0x5db1dd][_0x1318('0x79')]?_[_0x1318('0x78')](_0x116001[_0x34ee0a[_0x5db1dd]['format']],'%s',_0x54a7d6):_0x54a7d6;if(_0x34ee0a[_0x5db1dd]['groupBy']){_0x4c76e4[_0x1318('0x7a')](_0x54a7d6);}_0x34ee0a[_0x5db1dd][_0x1318('0x7b')]&&_0x4c76e4[_0x1318('0x37')](_0x54a7d6,_0x34ee0a[_0x5db1dd][_0x1318('0x7b')]===_0x1318('0x7c')?![]:!![]);_0x4c76e4['field'](_0x54a7d6,_0x34ee0a[_0x5db1dd][_0x1318('0x7d')]||_0x54a7d6);}if(_0x5833dc[_0x1318('0x7e')]){_0x5833dc[_0x1318('0x7e')]=JSON['parse'](_0x5833dc[_0x1318('0x7e')]);for(var _0x4c1311=0x0;_0x4c1311<_0x5833dc[_0x1318('0x7e')]['length'];_0x4c1311+=0x1){if(_0x5833dc['joins'][_0x4c1311][_0x1318('0x3e')]&&_['includes'](_0x20e4c6,_0x5833dc[_0x1318('0x7e')][_0x4c1311]['type'])&&_0x5833dc[_0x1318('0x7e')][_0x4c1311][_0x1318('0x7f')]&&_0x5833dc[_0x1318('0x7e')][_0x4c1311]['foreignTable']&&_0x5833dc[_0x1318('0x7e')][_0x4c1311]['foreignKey']){_0x4c76e4[_0x5833dc[_0x1318('0x7e')][_0x4c1311]['type']](_0x5833dc['joins'][_0x4c1311]['foreignTable'],null,util['format'](_0x1318('0x80'),_0x5833dc[_0x1318('0x74')],_0x5833dc[_0x1318('0x7e')][_0x4c1311][_0x1318('0x7f')],_0x5833dc[_0x1318('0x7e')][_0x4c1311]['foreignTable'],_0x5833dc[_0x1318('0x7e')][_0x4c1311][_0x1318('0x81')]));}}}if(_0x5833dc[_0x1318('0x82')]){_0x5833dc[_0x1318('0x82')]=JSON[_0x1318('0x83')](_0x5833dc[_0x1318('0x82')]);_0x4c76e4['where'](_0x1d3bcc(_0x5833dc['conditions'][_0x1318('0x7a')]));}_0x37e2b3=_0x4c76e4['clone']();_0x4c76e4['limit'](_0x484cf5);_0x4c76e4[_0x1318('0x1a')](0x0);logger[_0x1318('0x84')]('Limited\x20Query:',_0x4c76e4['toString']());return dbH['sequelize']['query'](_0x4c76e4[_0x1318('0x85')](),{'type':dbH['sequelize'][_0x1318('0x86')][_0x1318('0x87')]});}})[_0x1318('0x22')](respondWithResult(_0xe6cf7c,null))[_0x1318('0x44')](handleError(_0xe6cf7c,null));};function runReport(_0x472b4a,_0x3511f0,_0x4d8746){var _0x453c7d=_0x3511f0[_0x1318('0x29')];var _0x749da=0xa;var _0x5d18a0=[_0x1318('0x58'),_0x1318('0x59'),_0x1318('0x88'),'cross_join'];var _0x2c32e9={'SUM':_0x1318('0x5b'),'COUNT':_0x1318('0x89'),'COUNT DISTINCT':_0x1318('0x5c'),'MAX':'MAX(%s)','MIN':_0x1318('0x5e'),'AVG':_0x1318('0x5f'),'GROUP_CONCAT':_0x1318('0x8a'),'GROUP_CONCAT ASC':_0x1318('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ba42d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1318('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x1318('0x64'),'UNIX_TIMESTAMP':_0x1318('0x65')};var _0x4f7100=function(_0x1f40f0){return!_['includes']([_0x1318('0x8b'),_0x1318('0x8c'),_0x1318('0x67'),_0x1318('0x68')],_0x1f40f0);};var _0x45c367=function(_0x359fa6){if(!_0x359fa6||!_0x359fa6['rules'][_0x1318('0x48')]){return'';}for(var _0x40bd9b='(',_0x48e98=0x0;_0x48e98<_0x359fa6[_0x1318('0x69')][_0x1318('0x48')];_0x48e98+=0x1){_0x48e98>0x0&&(_0x40bd9b+='\x20'+_0x359fa6[_0x1318('0x6a')]+'\x20');_0x40bd9b+=_0x359fa6[_0x1318('0x69')][_0x48e98][_0x1318('0x7a')]?_0x45c367(_0x359fa6[_0x1318('0x69')][_0x48e98]['group']):_0x359fa6[_0x1318('0x69')][_0x48e98][_0x1318('0x6b')]+'\x20'+_0x359fa6[_0x1318('0x69')][_0x48e98][_0x1318('0x6c')]+(_0x4f7100(_0x359fa6[_0x1318('0x69')][_0x48e98][_0x1318('0x6c')])?'\x20'+_0x359fa6[_0x1318('0x69')][_0x48e98][_0x1318('0x6d')]:'');}return _0x40bd9b+')';};var _0x23ce55={'where':{'id':_0x472b4a['id']}},_0x24d69e,_0x4ac09b,_0x4e1474,_0x39d8b6,_0x39d279;_0x23ce55=_[_0x1318('0x3c')]({},_0x23ce55,_0x4d8746);return db[_0x1318('0x40')][_0x1318('0x51')](_0x23ce55)[_0x1318('0x22')](function(_0x34c032){if(_0x34c032){_0x24d69e=_0x34c032;return _0x34c032[_0x1318('0x6e')]();}return null;})[_0x1318('0x22')](function(_0x1fa454){if(_0x1fa454){if(!_0x1fa454[_0x1318('0x48')]){throw new db[(_0x1318('0x8d'))][(_0x1318('0x6f'))](_0x1318('0x8e'),0x193);}_0x4ac09b=_0x1fa454;return db[_0x1318('0x70')][_0x1318('0x42')]({'raw':!![]});}return null;})[_0x1318('0x22')](function(_0xa5fa02){if(_0xa5fa02){_0x4e1474=_[_0x1318('0x71')](_0xa5fa02,'id');var _0x308da7;var _0x4a255f=squel['select']();_0x4a255f[_0x1318('0x73')](_0x24d69e[_0x1318('0x74')]);for(var _0x3d2969=0x0;_0x3d2969<_0x4ac09b[_0x1318('0x48')];_0x3d2969+=0x1){_0x308da7=_0x4ac09b[_0x3d2969][_0x1318('0x75')]?_0x4e1474[_0x4ac09b[_0x3d2969][_0x1318('0x75')]][_0x1318('0x76')]:_0x4ac09b[_0x3d2969][_0x1318('0x6b')];_0x308da7=_0x4ac09b[_0x3d2969][_0x1318('0x77')]?_[_0x1318('0x78')](_0x2c32e9[_0x4ac09b[_0x3d2969]['function']],'%s',_0x308da7):_0x308da7;_0x308da7=_0x4ac09b[_0x3d2969]['format']?_[_0x1318('0x78')](_0x4ba42d[_0x4ac09b[_0x3d2969][_0x1318('0x79')]],'%s',_0x308da7):_0x308da7;if(_0x4ac09b[_0x3d2969][_0x1318('0x8f')]){_0x4a255f[_0x1318('0x7a')](_0x308da7);}_0x4ac09b[_0x3d2969]['orderBy']&&_0x4a255f[_0x1318('0x37')](_0x308da7,_0x4ac09b[_0x3d2969][_0x1318('0x7b')]===_0x1318('0x7c')?![]:!![]);_0x4a255f[_0x1318('0x6b')](_0x308da7,_0x4ac09b[_0x3d2969][_0x1318('0x7d')]||_0x308da7);}if(_0x24d69e[_0x1318('0x7e')]){_0x24d69e['joins']=JSON[_0x1318('0x83')](_0x24d69e['joins']);for(var _0x1c16df=0x0;_0x1c16df<_0x24d69e[_0x1318('0x7e')][_0x1318('0x48')];_0x1c16df+=0x1){if(_0x24d69e[_0x1318('0x7e')][_0x1c16df]['type']&&_['includes'](_0x5d18a0,_0x24d69e['joins'][_0x1c16df]['type'])&&_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x7f')]&&_0x24d69e['joins'][_0x1c16df][_0x1318('0x90')]&&_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x81')]){_0x4a255f[_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x3e')]](_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x90')],null,util[_0x1318('0x79')](_0x1318('0x80'),_0x24d69e[_0x1318('0x74')],_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x7f')],_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x90')],_0x24d69e[_0x1318('0x7e')][_0x1c16df][_0x1318('0x81')]));}}}if(_0x24d69e[_0x1318('0x82')]){_0x24d69e[_0x1318('0x82')]=JSON[_0x1318('0x83')](_0x24d69e['conditions']);_0x4a255f[_0x1318('0x3d')](_0x45c367(_0x24d69e[_0x1318('0x82')][_0x1318('0x7a')]));}_0x39d279=_0x4a255f[_0x1318('0x91')]();_0x4a255f[_0x1318('0x1c')](_0x749da);_0x4a255f[_0x1318('0x1a')](0x0);return;}})[_0x1318('0x22')](function(){if(_0x3511f0[_0x1318('0x92')]===_0x1318('0x93')){return null;}var _0x1552cd=_[_0x1318('0x3c')](_0x3511f0,{'name':_0x3511f0[_0x1318('0x94')]||_0x3511f0[_0x1318('0x29')]||_0x24d69e[_0x1318('0x29')],'basename':_0x453c7d,'savename':util[_0x1318('0x79')](_0x1318('0x95'),_0x3511f0[_0x1318('0x29')]||_0x24d69e[_0x1318('0x29')],require(_0x1318('0x96'))[_0x1318('0x97')](0x4),_0x3511f0['output']||_0x1318('0x98')),'reportId':_0x24d69e['id'],'reportType':_0x1318('0x99')});return db['AnalyticExtractedReport'][_0x1318('0x54')](_0x1552cd,{'raw':!![]});})[_0x1318('0x22')](function(_0x530cf1){if(_0x24d69e[_0x1318('0x74')]===_0x1318('0x9a')){_0x39d279['where'](_0x24d69e[_0x1318('0x74')]+_0x1318('0x9b'),_0x3511f0['startDate'],_0x3511f0[_0x1318('0x9c')]);}else{_0x39d279[_0x1318('0x3d')](_0x24d69e['table']+_0x1318('0x9d'),_0x3511f0[_0x1318('0x9e')],_0x3511f0[_0x1318('0x9c')]);}if(_0x530cf1){logger[_0x1318('0x9f')](_0x1318('0xa0'),_0x39d279['toString']());require(_0x1318('0xa1'))[_0x1318('0xa2')](path[_0x1318('0x58')](__dirname,_0x1318('0xa3'),_0x530cf1[_0x1318('0x92')]),[_0x530cf1['id'],_0x39d279[_0x1318('0x85')](),path[_0x1318('0x58')](__dirname,_0x1318('0xa4'),_0x530cf1[_0x1318('0xa5')]),_0x453c7d]);return _0x530cf1;}else{var _0x3a3fb5=squel[_0x1318('0x72')]();_0x3a3fb5[_0x1318('0x73')]('('+_0x39d279[_0x1318('0x85')]()+')','countTable');_0x3a3fb5[_0x1318('0x6b')](_0x1318('0xa6'),_0x1318('0x1d'));_0x39d279[_0x1318('0x1c')](_0x3511f0[_0x1318('0x1c')]||_0x749da);_0x39d279['offset'](_0x3511f0[_0x1318('0x1a')]||0x0);return dbH[_0x1318('0xa7')][_0x1318('0x30')](_0x3a3fb5[_0x1318('0x85')](),{'type':dbH[_0x1318('0xa7')][_0x1318('0x86')]['SELECT']})[_0x1318('0x22')](function(_0x3e88cd){if(!_0x3e88cd['length']){_0x39d8b6=0x0;}else{_0x39d8b6=_0x3e88cd[0x0][_0x1318('0x1d')]||0x0;}return dbH[_0x1318('0xa7')]['query'](_0x39d279['toString'](),{'type':dbH[_0x1318('0xa7')][_0x1318('0x86')]['SELECT']});})['then'](function(_0x2a8629){return{'rows':_0x2a8629||[],'count':_0x39d8b6};});}});}exports[_0x1318('0xa8')]=function(_0x1f65c1,_0x54fa5a){return runReport(_0x1f65c1[_0x1318('0x46')],_0x1f65c1[_0x1318('0x30')],_0x1f65c1[_0x1318('0x4a')])['then'](respondWithResult(_0x54fa5a,null))[_0x1318('0x44')](handleError(_0x54fa5a,null));};exports[_0x1318('0xa9')]=runReport;exports[_0x1318('0x30')]=function(_0x3273db,_0x43ed60){var _0x5a9674=0xa;var _0x160cce=[_0x1318('0x58'),'left_join',_0x1318('0x88'),_0x1318('0x5a')];var _0x3a215f={'SUM':_0x1318('0x5b'),'COUNT':_0x1318('0x89'),'COUNT DISTINCT':_0x1318('0x5c'),'MAX':_0x1318('0x5d'),'MIN':_0x1318('0x5e'),'AVG':_0x1318('0x5f'),'GROUP_CONCAT':_0x1318('0x8a'),'GROUP_CONCAT ASC':_0x1318('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x40f971={'SEC_TO_TIME':_0x1318('0xaa'),'DATE':'DATE(%s)','HOUR':_0x1318('0x63'),'ROUND':_0x1318('0x64'),'UNIX_TIMESTAMP':_0x1318('0x65')};var _0x10b645=function(_0x306daa){return!_['includes'](['IS\x20NULL',_0x1318('0x8c'),_0x1318('0x67'),_0x1318('0x68')],_0x306daa);};var _0x4c1863=function(_0x5d1812){if(!_0x5d1812||!_0x5d1812[_0x1318('0x69')][_0x1318('0x48')]){return'';}for(var _0x536b90='(',_0x37aeae=0x0;_0x37aeae<_0x5d1812[_0x1318('0x69')][_0x1318('0x48')];_0x37aeae+=0x1){_0x37aeae>0x0&&(_0x536b90+='\x20'+_0x5d1812['operator']+'\x20');_0x536b90+=_0x5d1812['rules'][_0x37aeae][_0x1318('0x7a')]?_0x4c1863(_0x5d1812[_0x1318('0x69')][_0x37aeae]['group']):_0x5d1812['rules'][_0x37aeae][_0x1318('0x6b')]+'\x20'+_0x5d1812[_0x1318('0x69')][_0x37aeae]['condition']+(_0x10b645(_0x5d1812[_0x1318('0x69')][_0x37aeae][_0x1318('0x6c')])?'\x20'+_0x5d1812[_0x1318('0x69')][_0x37aeae][_0x1318('0x6d')]:'');}return _0x536b90+')';};var _0x2d91b5={'where':{'id':_0x3273db['params']['id']}},_0x3045d2,_0x3273a3,_0x3947ca,_0x27083f,_0x346ada;_0x2d91b5=_[_0x1318('0x3c')]({},_0x2d91b5,_0x3273db[_0x1318('0x4a')]);return db[_0x1318('0x40')][_0x1318('0x51')](_0x2d91b5)['then'](function(_0x17c901){if(_0x17c901){_0x3045d2=_0x17c901;return _0x17c901[_0x1318('0x6e')]();}return null;})[_0x1318('0x22')](function(_0x31369a){if(_0x31369a){if(!_0x31369a['length']){throw new db['Sequelize'][(_0x1318('0x6f'))](_0x1318('0x8e'),0x193);}_0x3273a3=_0x31369a;return db['AnalyticMetric'][_0x1318('0x42')]({'raw':!![]});}return null;})[_0x1318('0x22')](function(_0x14c814){if(_0x14c814){_0x3947ca=_[_0x1318('0x71')](_0x14c814,'id');var _0x26b505;var _0x59df1d=squel['select']();_0x59df1d[_0x1318('0x73')](_0x3045d2['table']);for(var _0x40ef69=0x0;_0x40ef69<_0x3273a3[_0x1318('0x48')];_0x40ef69+=0x1){_0x26b505=_0x3273a3[_0x40ef69][_0x1318('0x75')]?_0x3947ca[_0x3273a3[_0x40ef69][_0x1318('0x75')]][_0x1318('0x76')]:_0x3273a3[_0x40ef69]['field'];_0x26b505=_0x3273a3[_0x40ef69][_0x1318('0x77')]?_[_0x1318('0x78')](_0x3a215f[_0x3273a3[_0x40ef69][_0x1318('0x77')]],'%s',_0x26b505):_0x26b505;_0x26b505=_0x3273a3[_0x40ef69][_0x1318('0x79')]?_[_0x1318('0x78')](_0x40f971[_0x3273a3[_0x40ef69][_0x1318('0x79')]],'%s',_0x26b505):_0x26b505;if(_0x3273a3[_0x40ef69][_0x1318('0x8f')]){_0x59df1d[_0x1318('0x7a')](_0x26b505);}_0x3273a3[_0x40ef69][_0x1318('0x7b')]&&_0x59df1d[_0x1318('0x37')](_0x26b505,_0x3273a3[_0x40ef69][_0x1318('0x7b')]===_0x1318('0x7c')?![]:!![]);_0x59df1d[_0x1318('0x6b')](_0x26b505,_0x3273a3[_0x40ef69][_0x1318('0x7d')]||_0x26b505);}if(_0x3045d2['joins']){_0x3045d2[_0x1318('0x7e')]=JSON[_0x1318('0x83')](_0x3045d2[_0x1318('0x7e')]);for(var _0x1142c0=0x0;_0x1142c0<_0x3045d2['joins']['length'];_0x1142c0+=0x1){if(_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x3e')]&&_[_0x1318('0x66')](_0x160cce,_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x3e')])&&_0x3045d2[_0x1318('0x7e')][_0x1142c0]['parentKey']&&_0x3045d2['joins'][_0x1142c0]['foreignTable']&&_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x81')]){_0x59df1d[_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x3e')]](_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x90')],null,util[_0x1318('0x79')]('%s.%s\x20=\x20%s.%s',_0x3045d2['table'],_0x3045d2['joins'][_0x1142c0][_0x1318('0x7f')],_0x3045d2['joins'][_0x1142c0][_0x1318('0x90')],_0x3045d2[_0x1318('0x7e')][_0x1142c0][_0x1318('0x81')]));}}}if(_0x3045d2[_0x1318('0x82')]){_0x3045d2[_0x1318('0x82')]=JSON[_0x1318('0x83')](_0x3045d2[_0x1318('0x82')]);_0x59df1d['where'](_0x4c1863(_0x3045d2[_0x1318('0x82')]['group']));}_0x346ada=_0x59df1d[_0x1318('0x91')]();_0x59df1d['limit'](_0x5a9674);_0x59df1d[_0x1318('0x1a')](0x0);logger[_0x1318('0x84')]('Limited\x20Query:',_0x59df1d[_0x1318('0x85')]());return dbH['sequelize'][_0x1318('0x30')](_0x59df1d['toString'](),{'type':dbH[_0x1318('0xa7')]['QueryTypes'][_0x1318('0x87')]});}})[_0x1318('0x22')](function(){return{'sql':_0x346ada['toString']()};})[_0x1318('0x22')](respondWithResult(_0x43ed60,null))['catch'](handleError(_0x43ed60,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b423774..61ed666 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 _0x0226=['moment','bluebird','request-promise','path','rimraf','define','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0x0226,0x1ca));var _0x6022=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x0226[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x6022('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6022('0x1'));var moment=require(_0x6022('0x2'));var BPromise=require(_0x6022('0x3'));var rp=require(_0x6022('0x4'));var fs=require('fs');var path=require(_0x6022('0x5'));var rimraf=require(_0x6022('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1d8d1d,_0x95bcaf){return _0x1d8d1d[_0x6022('0x7')](_0x6022('0x8'),attributes,{'tableName':_0x6022('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd80=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2803ab,_0x1c33f2){var _0x3d6e8e=function(_0x8a86f1){while(--_0x8a86f1){_0x2803ab['push'](_0x2803ab['shift']());}};_0x3d6e8e(++_0x1c33f2);}(_0xbd80,0xa3));var _0x0bd8=function(_0x5c56f7,_0x47f7d9){_0x5c56f7=_0x5c56f7-0x0;var _0x3c1fbe=_0xbd80[_0x5c56f7];return _0x3c1fbe;};'use strict';var _=require(_0x0bd8('0x0'));var util=require('util');var logger=require(_0x0bd8('0x1'))(_0x0bd8('0x2'));var moment=require('moment');var BPromise=require(_0x0bd8('0x3'));var rp=require(_0x0bd8('0x4'));var fs=require('fs');var path=require(_0x0bd8('0x5'));var rimraf=require(_0x0bd8('0x6'));var config=require(_0x0bd8('0x7'));var attributes=require(_0x0bd8('0x8'));module[_0x0bd8('0x9')]=function(_0x41a7d5,_0x4053df){return _0x41a7d5[_0x0bd8('0xa')](_0x0bd8('0xb'),attributes,{'tableName':_0x0bd8('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 0c2e2d9..825c9ca 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 _0x43e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x247f3f,_0x5f298e){var _0x1381e6=function(_0x1e8355){while(--_0x1e8355){_0x247f3f['push'](_0x247f3f['shift']());}};_0x1381e6(++_0x5f298e);}(_0x43e2,0x14c));var _0x243e=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x43e2[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x243e('0x0'));var util=require(_0x243e('0x1'));var moment=require(_0x243e('0x2'));var BPromise=require('bluebird');var rs=require(_0x243e('0x3'));var fs=require('fs');var Redis=require(_0x243e('0x4'));var db=require(_0x243e('0x5'))['db'];var utils=require(_0x243e('0x6'));var logger=require(_0x243e('0x7'))(_0x243e('0x8'));var config=require('../../config/environment');var jayson=require(_0x243e('0x9'));var client=jayson[_0x243e('0xa')][_0x243e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228eed,_0x56fbe7,_0x4a38ed){return new BPromise(function(_0xc34a53,_0xd6f0a7){return client[_0x243e('0xc')](_0x228eed,_0x4a38ed)[_0x243e('0xd')](function(_0x417003){logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,'request\x20sent');logger['debug'](_0x243e('0x10'),_0x56fbe7,_0x243e('0x11'),JSON[_0x243e('0x12')](_0x417003));if(_0x417003['error']){if(_0x417003[_0x243e('0x13')][_0x243e('0x14')]===0x1f4){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xd6f0a7(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xc34a53(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}else{logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,_0x243e('0x11'));_0xc34a53(_0x417003[_0x243e('0x16')]['message']);}})[_0x243e('0x17')](function(_0x5179d8){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x5179d8);_0xd6f0a7(_0x5179d8);});});} \ No newline at end of file +var _0x6678=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch'];(function(_0x542560,_0x491653){var _0x4b6f20=function(_0x2a08ba){while(--_0x2a08ba){_0x542560['push'](_0x542560['shift']());}};_0x4b6f20(++_0x491653);}(_0x6678,0x159));var _0x8667=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x6678[_0x10d0f0];return _0x93e308;};'use strict';var _=require(_0x8667('0x0'));var util=require('util');var moment=require(_0x8667('0x1'));var BPromise=require(_0x8667('0x2'));var rs=require(_0x8667('0x3'));var fs=require('fs');var Redis=require(_0x8667('0x4'));var db=require(_0x8667('0x5'))['db'];var utils=require(_0x8667('0x6'));var logger=require(_0x8667('0x7'))('rpc');var config=require(_0x8667('0x8'));var jayson=require(_0x8667('0x9'));var client=jayson['client'][_0x8667('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaf141a,_0x969c9c,_0x24c405){return new BPromise(function(_0x195e20,_0x406f2d){return client[_0x8667('0xb')](_0xaf141a,_0x24c405)[_0x8667('0xc')](function(_0x686764){logger[_0x8667('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x969c9c,_0x8667('0xe'));logger['debug'](_0x8667('0xf'),_0x969c9c,'request\x20sent',JSON[_0x8667('0x10')](_0x686764));if(_0x686764[_0x8667('0x11')]){if(_0x686764[_0x8667('0x11')][_0x8667('0x12')]===0x1f4){logger[_0x8667('0x11')](_0x8667('0x13'),_0x969c9c,_0x686764['error'][_0x8667('0x14')]);return _0x406f2d(_0x686764[_0x8667('0x11')][_0x8667('0x14')]);}logger[_0x8667('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x969c9c,_0x686764[_0x8667('0x11')][_0x8667('0x14')]);return _0x195e20(_0x686764[_0x8667('0x11')]['message']);}else{logger[_0x8667('0xd')](_0x8667('0x13'),_0x969c9c,'request\x20sent');_0x195e20(_0x686764[_0x8667('0x15')][_0x8667('0x14')]);}})[_0x8667('0x16')](function(_0x55a885){logger[_0x8667('0x11')](_0x8667('0x13'),_0x969c9c,_0x55a885);_0x406f2d(_0x55a885);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 51e373e..2c038c2 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 _0x6d63=['./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x59e903,_0x303626){var _0x21e3f6=function(_0x4c304d){while(--_0x4c304d){_0x59e903['push'](_0x59e903['shift']());}};_0x21e3f6(++_0x303626);}(_0x6d63,0x89));var _0x36d6=function(_0x4759c3,_0x24f58a){_0x4759c3=_0x4759c3-0x0;var _0xac8def=_0x6d63[_0x4759c3];return _0xac8def;};'use strict';var multer=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var path=require(_0x36d6('0x2'));var timeout=require(_0x36d6('0x3'));var express=require('express');var router=express[_0x36d6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36d6('0x5'));var config=require(_0x36d6('0x6'));var controller=require(_0x36d6('0x7'));router[_0x36d6('0x8')]('/',auth[_0x36d6('0x9')](),controller['index']);router['get']('/:id',auth[_0x36d6('0x9')](),controller[_0x36d6('0xa')]);router['get'](_0x36d6('0xb'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xc')]);router['get'](_0x36d6('0xd'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xe')]);router[_0x36d6('0x8')](_0x36d6('0xf'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x10')]);router[_0x36d6('0x11')]('/',auth[_0x36d6('0x9')](),controller['create']);router[_0x36d6('0x12')](_0x36d6('0x13'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x14')]);router[_0x36d6('0x15')](_0x36d6('0x13'),auth['isAuthenticated'](),controller[_0x36d6('0x16')]);module[_0x36d6('0x17')]=router; \ No newline at end of file +var _0x153c=['isAuthenticated','show','preview','/:id/run','run','/:id/query','query','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get'];(function(_0x6f65d,_0x3221ba){var _0x3c7554=function(_0x4be102){while(--_0x4be102){_0x6f65d['push'](_0x6f65d['shift']());}};_0x3c7554(++_0x3221ba);}(_0x153c,0x9e));var _0xc153=function(_0x55eea1,_0x55fa52){_0x55eea1=_0x55eea1-0x0;var _0x229c87=_0x153c[_0x55eea1];return _0x229c87;};'use strict';var multer=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var path=require('path');var timeout=require(_0xc153('0x2'));var express=require(_0xc153('0x3'));var router=express[_0xc153('0x4')]();var fs_extra=require(_0xc153('0x5'));var auth=require(_0xc153('0x6'));var interaction=require(_0xc153('0x7'));var config=require('../../config/environment');var controller=require(_0xc153('0x8'));router[_0xc153('0x9')]('/',auth[_0xc153('0xa')](),controller['index']);router[_0xc153('0x9')]('/:id',auth[_0xc153('0xa')](),controller[_0xc153('0xb')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0xc153('0xc')]);router[_0xc153('0x9')](_0xc153('0xd'),auth[_0xc153('0xa')](),controller[_0xc153('0xe')]);router[_0xc153('0x9')](_0xc153('0xf'),auth[_0xc153('0xa')](),controller[_0xc153('0x10')]);router['post']('/',auth[_0xc153('0xa')](),controller['create']);router[_0xc153('0x11')](_0xc153('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xc153('0x13')](_0xc153('0x12'),auth[_0xc153('0xa')](),controller[_0xc153('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 9f42aa7..e0d3d70 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4ea754,_0x1659ec){_0x4ea754=_0x4ea754-0x0;var _0x26a3cd=_0xb4c7[_0x4ea754];return _0x26a3cd;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}}; \ No newline at end of file +var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0xf494,0x1c6));var _0x4f49=function(_0x279643,_0xa4e19b){_0x279643=_0x279643-0x0;var _0x292d3d=_0xf494[_0x279643];return _0x292d3d;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 6e8bf0c..263a39d 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 _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(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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 +var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','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','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x331945,_0x4ac379){var _0x114e81=function(_0x306bb6){while(--_0x306bb6){_0x331945['push'](_0x331945['shift']());}};_0x114e81(++_0x4ac379);}(_0x1cb9,0x14e));var _0x91cb=function(_0x7cf4cd,_0x574595){_0x7cf4cd=_0x7cf4cd-0x0;var _0x1dd8a2=_0x1cb9[_0x7cf4cd];return _0x1dd8a2;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 323c327..0f1de08 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 _0xae18=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3c44fd,_0x4eb40d){var _0x1d49bb=function(_0x44adc5){while(--_0x44adc5){_0x3c44fd['push'](_0x3c44fd['shift']());}};_0x1d49bb(++_0x4eb40d);}(_0xae18,0x165));var _0x8ae1=function(_0x4fda72,_0x3aa0d3){_0x4fda72=_0x4fda72-0x0;var _0x1cc54a=_0xae18[_0x4fda72];return _0x1cc54a;};'use strict';var _=require('lodash');var util=require(_0x8ae1('0x0'));var logger=require(_0x8ae1('0x1'))(_0x8ae1('0x2'));var moment=require(_0x8ae1('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ae1('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ae1('0x6'));module[_0x8ae1('0x7')]=function(_0x1976f1,_0x1ea765){return _0x1976f1[_0x8ae1('0x8')](_0x8ae1('0x9'),attributes,{'tableName':_0x8ae1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f0d=['util','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x47457c,_0x3c7325){var _0x294fab=function(_0x22f5c3){while(--_0x22f5c3){_0x47457c['push'](_0x47457c['shift']());}};_0x294fab(++_0x3c7325);}(_0x1f0d,0x10d));var _0xd1f0=function(_0x24320d,_0x3086ee){_0x24320d=_0x24320d-0x0;var _0x361c0e=_0x1f0d[_0x24320d];return _0x361c0e;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd1f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1f0('0x3'));var rimraf=require('rimraf');var config=require(_0xd1f0('0x4'));var attributes=require(_0xd1f0('0x5'));module[_0xd1f0('0x6')]=function(_0x4a43cd,_0x595102){return _0x4a43cd[_0xd1f0('0x7')](_0xd1f0('0x8'),attributes,{'tableName':_0xd1f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 18175ba..ef5a4aa 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 _0xdb04=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ad901,_0x852d9e){var _0x3c0249=function(_0x319eda){while(--_0x319eda){_0x1ad901['push'](_0x1ad901['shift']());}};_0x3c0249(++_0x852d9e);}(_0xdb04,0x1cf));var _0x4db0=function(_0x5238b4,_0x3df4d6){_0x5238b4=_0x5238b4-0x0;var _0x317074=_0xdb04[_0x5238b4];return _0x317074;};'use strict';var _=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var moment=require(_0x4db0('0x2'));var BPromise=require(_0x4db0('0x3'));var rs=require(_0x4db0('0x4'));var fs=require('fs');var Redis=require(_0x4db0('0x5'));var db=require(_0x4db0('0x6'))['db'];var utils=require(_0x4db0('0x7'));var logger=require(_0x4db0('0x8'))(_0x4db0('0x9'));var config=require(_0x4db0('0xa'));var jayson=require(_0x4db0('0xb'));var client=jayson[_0x4db0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36fe26,_0x5b593a,_0x3302f9){return new BPromise(function(_0x595542,_0x380e9b){return client[_0x4db0('0xd')](_0x36fe26,_0x3302f9)['then'](function(_0x175135){logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));logger[_0x4db0('0x11')](_0x4db0('0x12'),_0x5b593a,_0x4db0('0x10'),JSON[_0x4db0('0x13')](_0x175135));if(_0x175135[_0x4db0('0x14')]){if(_0x175135[_0x4db0('0x14')][_0x4db0('0x15')]===0x1f4){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')]['message']);return _0x380e9b(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);return _0x595542(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}else{logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));_0x595542(_0x175135['result'][_0x4db0('0x16')]);}})['catch'](function(_0xaec10a){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0xaec10a);_0x380e9b(_0xaec10a);});});} \ No newline at end of file +var _0x79ec=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x79ec,0xc4));var _0xc79e=function(_0x45964b,_0xe849e5){_0x45964b=_0x45964b-0x0;var _0x4dc863=_0x79ec[_0x45964b];return _0x4dc863;};'use strict';var _=require('lodash');var util=require(_0xc79e('0x0'));var moment=require('moment');var BPromise=require(_0xc79e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc79e('0x2'));var db=require(_0xc79e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc79e('0x4'))('rpc');var config=require(_0xc79e('0x5'));var jayson=require(_0xc79e('0x6'));var client=jayson['client'][_0xc79e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x306a18,_0x5e8cb9,_0x208df0){return new BPromise(function(_0x2bf959,_0x4ce7c6){return client[_0xc79e('0x8')](_0x306a18,_0x208df0)[_0xc79e('0x9')](function(_0x3d2b2c){logger[_0xc79e('0xa')](_0xc79e('0xb'),_0x5e8cb9,'request\x20sent');logger[_0xc79e('0xc')](_0xc79e('0xd'),_0x5e8cb9,_0xc79e('0xe'),JSON['stringify'](_0x3d2b2c));if(_0x3d2b2c[_0xc79e('0xf')]){if(_0x3d2b2c[_0xc79e('0xf')]['code']===0x1f4){logger['error'](_0xc79e('0xb'),_0x5e8cb9,_0x3d2b2c['error'][_0xc79e('0x10')]);return _0x4ce7c6(_0x3d2b2c[_0xc79e('0xf')][_0xc79e('0x10')]);}logger[_0xc79e('0xf')](_0xc79e('0xb'),_0x5e8cb9,_0x3d2b2c[_0xc79e('0xf')][_0xc79e('0x10')]);return _0x2bf959(_0x3d2b2c[_0xc79e('0xf')][_0xc79e('0x10')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e8cb9,'request\x20sent');_0x2bf959(_0x3d2b2c[_0xc79e('0x11')][_0xc79e('0x10')]);}})[_0xc79e('0x12')](function(_0x419268){logger[_0xc79e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5e8cb9,_0x419268);_0x4ce7c6(_0x419268);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 67cbefb..73d590b 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 _0x18ec=['post','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','/:id/query','query'];(function(_0x2df2b5,_0x50fe36){var _0x4755a0=function(_0x164939){while(--_0x164939){_0x2df2b5['push'](_0x2df2b5['shift']());}};_0x4755a0(++_0x50fe36);}(_0x18ec,0xf7));var _0xc18e=function(_0x512600,_0x44c3b4){_0x512600=_0x512600-0x0;var _0x317eb5=_0x18ec[_0x512600];return _0x317eb5;};'use strict';var multer=require('multer');var util=require(_0xc18e('0x0'));var path=require('path');var timeout=require(_0xc18e('0x1'));var express=require(_0xc18e('0x2'));var router=express[_0xc18e('0x3')]();var fs_extra=require(_0xc18e('0x4'));var auth=require(_0xc18e('0x5'));var interaction=require(_0xc18e('0x6'));var config=require(_0xc18e('0x7'));var controller=require(_0xc18e('0x8'));router[_0xc18e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc18e('0xa')]);router[_0xc18e('0x9')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller['show']);router[_0xc18e('0x9')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xc18e('0x9')](_0xc18e('0xd'),auth[_0xc18e('0xc')](),controller[_0xc18e('0xe')]);router['get'](_0xc18e('0xf'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x10')]);router[_0xc18e('0x11')]('/',auth[_0xc18e('0xc')](),controller[_0xc18e('0x12')]);router[_0xc18e('0x13')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x14')]);router[_0xc18e('0x15')]('/:id',auth[_0xc18e('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfb67=['./analyticDefaultReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x186964,_0x42b190){var _0x4e66d8=function(_0x23f48a){while(--_0x23f48a){_0x186964['push'](_0x186964['shift']());}};_0x4e66d8(++_0x42b190);}(_0xfb67,0xdd));var _0x7fb6=function(_0x5abd7b,_0x33cca5){_0x5abd7b=_0x5abd7b-0x0;var _0x52424e=_0xfb67[_0x5abd7b];return _0x52424e;};'use strict';var multer=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var path=require(_0x7fb6('0x2'));var timeout=require(_0x7fb6('0x3'));var express=require(_0x7fb6('0x4'));var router=express[_0x7fb6('0x5')]();var fs_extra=require(_0x7fb6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var controller=require(_0x7fb6('0x9'));router[_0x7fb6('0xa')]('/',auth[_0x7fb6('0xb')](),controller['index']);router[_0x7fb6('0xa')](_0x7fb6('0xc'),auth[_0x7fb6('0xb')](),controller['show']);router[_0x7fb6('0xa')](_0x7fb6('0xd'),auth['isAuthenticated'](),controller[_0x7fb6('0xe')]);router[_0x7fb6('0xa')](_0x7fb6('0xf'),auth['isAuthenticated'](),controller[_0x7fb6('0x10')]);router['get'](_0x7fb6('0x11'),auth[_0x7fb6('0xb')](),controller[_0x7fb6('0x12')]);router[_0x7fb6('0x13')]('/',auth['isAuthenticated'](),controller[_0x7fb6('0x14')]);router[_0x7fb6('0x15')](_0x7fb6('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7fb6('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 224b834..804333f 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 _0x77fe=['manual','INTEGER','sequelize','moment','exports','csv','pdf','STRING','DATE','scheduled'];(function(_0x5392af,_0x45123c){var _0xc025c5=function(_0x4d0dab){while(--_0x4d0dab){_0x5392af['push'](_0x5392af['shift']());}};_0xc025c5(++_0x45123c);}(_0x77fe,0x110));var _0xe77f=function(_0x1c3e2f,_0x14f882){_0x1c3e2f=_0x1c3e2f-0x0;var _0x36e8a7=_0x77fe[_0x1c3e2f];return _0x36e8a7;};'use strict';var Sequelize=require(_0xe77f('0x0'));var moment=require(_0xe77f('0x1'));module[_0xe77f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe77f('0x3'),_0xe77f('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xe77f('0x3')},'savename':{'type':Sequelize[_0xe77f('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe77f('0x6')]},'endDate':{'type':Sequelize[_0xe77f('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xe77f('0x7')),'allowNull':![],'defaultValue':_0xe77f('0x8')},'reportId':{'type':Sequelize[_0xe77f('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe77f('0x5')]}}; \ No newline at end of file +var _0x135a=['moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','sequelize'];(function(_0x26b3a6,_0x37121d){var _0x4b28a6=function(_0x33d688){while(--_0x33d688){_0x26b3a6['push'](_0x26b3a6['shift']());}};_0x4b28a6(++_0x37121d);}(_0x135a,0x1d3));var _0xa135=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x135a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xa135('0x0'));var moment=require(_0xa135('0x1'));module['exports']={'name':{'type':Sequelize[_0xa135('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa135('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xa135('0x3')](_0xa135('0x4'),_0xa135('0x5'),_0xa135('0x6')),'allowNull':![],'defaultValue':_0xa135('0x4')},'savename':{'type':Sequelize[_0xa135('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa135('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa135('0x8')},'type':{'type':Sequelize[_0xa135('0x3')](_0xa135('0x9'),_0xa135('0xa')),'allowNull':![],'defaultValue':_0xa135('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xa135('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 85b3972..069db15 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 _0xdaec=['request-promise','bluebird','path','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x50381c,_0x39beef){var _0x1bc982=function(_0x51be44){while(--_0x51be44){_0x50381c['push'](_0x50381c['shift']());}};_0x1bc982(++_0x39beef);}(_0xdaec,0xc3));var _0xcdae=function(_0x85e755,_0x4e8e31){_0x85e755=_0x85e755-0x0;var _0x473efc=_0xdaec[_0x85e755];return _0x473efc;};'use strict';var emlformat=require(_0xcdae('0x0'));var rimraf=require(_0xcdae('0x1'));var zipdir=require(_0xcdae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdae('0x3'));var moment=require('moment');var BPromise=require(_0xcdae('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcdae('0x5'));var sox=require('sox');var csv=require(_0xcdae('0x6'));var ejs=require(_0xcdae('0x7'));var fs=require('fs');var fs_extra=require(_0xcdae('0x8'));var _=require(_0xcdae('0x9'));var squel=require(_0xcdae('0xa'));var crypto=require(_0xcdae('0xb'));var jsforce=require(_0xcdae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcdae('0x6'));var querystring=require(_0xcdae('0xd'));var Papa=require(_0xcdae('0xe'));var Redis=require(_0xcdae('0xf'));var authService=require(_0xcdae('0x10'));var qs=require(_0xcdae('0x11'));var as=require(_0xcdae('0x12'));var hardwareService=require(_0xcdae('0x13'));var logger=require(_0xcdae('0x14'))(_0xcdae('0x15'));var utils=require(_0xcdae('0x16'));var config=require(_0xcdae('0x17'));var licenseUtil=require(_0xcdae('0x18'));var db=require(_0xcdae('0x19'))['db'];function respondWithStatusCode(_0x326f11,_0xe36c0){_0xe36c0=_0xe36c0||0xcc;return function(_0x48c899){if(_0x48c899){return _0x326f11[_0xcdae('0x1a')](_0xe36c0);}return _0x326f11[_0xcdae('0x1b')](_0xe36c0)[_0xcdae('0x1c')]();};}function respondWithResult(_0x27191d,_0x388115){_0x388115=_0x388115||0xc8;return function(_0x4063ff){if(_0x4063ff){return _0x27191d[_0xcdae('0x1b')](_0x388115)[_0xcdae('0x1d')](_0x4063ff);}};}function respondWithFilteredResult(_0x40dc86,_0x9bf796){return function(_0x56712c){if(_0x56712c){var _0x153df9=typeof _0x9bf796[_0xcdae('0x1e')]===_0xcdae('0x1f')&&typeof _0x9bf796[_0xcdae('0x20')]===_0xcdae('0x1f');var _0x351ed4=_0x56712c['count'];var _0x333120=_0x153df9?0x0:_0x9bf796[_0xcdae('0x1e')];var _0x118558=_0x153df9?_0x56712c[_0xcdae('0x21')]:_0x9bf796[_0xcdae('0x1e')]+_0x9bf796[_0xcdae('0x20')];var _0x4c759f;if(_0x118558>=_0x351ed4){_0x118558=_0x351ed4;_0x4c759f=0xc8;}else{_0x4c759f=0xce;}_0x40dc86[_0xcdae('0x1b')](_0x4c759f);return _0x40dc86[_0xcdae('0x22')](_0xcdae('0x23'),_0x333120+'-'+_0x118558+'/'+_0x351ed4)[_0xcdae('0x1d')](_0x56712c);}return null;};}function patchUpdates(_0x2c2399){return function(_0x38c587){try{jsonpatch['apply'](_0x38c587,_0x2c2399,!![]);}catch(_0x3743df){return BPromise['reject'](_0x3743df);}return _0x38c587[_0xcdae('0x24')]();};}function saveUpdates(_0x590f18,_0x8c35b2){return function(_0x5726da){if(_0x5726da){return _0x5726da[_0xcdae('0x25')](_0x590f18)[_0xcdae('0x26')](function(_0x5c7e19){return _0x5c7e19;});}return null;};}function removeEntity(_0x2860e8,_0x36591d){return function(_0x2aeffc){if(_0x2aeffc){return _0x2aeffc[_0xcdae('0x27')]()[_0xcdae('0x26')](function(){var _0x249302=_0x2aeffc[_0xcdae('0x28')]({'plain':!![]});var _0x287a1c=_0xcdae('0x29');return db['UserProfileResource'][_0xcdae('0x27')]({'where':{'type':_0x287a1c,'resourceId':_0x249302['id']}})[_0xcdae('0x26')](function(){return _0x2aeffc;});})[_0xcdae('0x26')](function(){_0x2860e8[_0xcdae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20103c,_0x39eda3){return function(_0x489df9){if(!_0x489df9){_0x20103c[_0xcdae('0x1a')](0x194);}return _0x489df9;};}function handleError(_0x837466,_0x46514b){_0x46514b=_0x46514b||0x1f4;return function(_0x1d7a94){logger['error'](_0x1d7a94[_0xcdae('0x2a')]);if(_0x1d7a94['name']){delete _0x1d7a94[_0xcdae('0x2b')];}_0x837466[_0xcdae('0x1b')](_0x46514b)[_0xcdae('0x2c')](_0x1d7a94);};}exports[_0xcdae('0x2d')]=function(_0x455923,_0x1e325a){var _0x1e6026={},_0x29701f={},_0x250236={'count':0x0,'rows':[]};var _0x4e0057=_[_0xcdae('0x2e')](db[_0xcdae('0x2f')]['rawAttributes'],function(_0x9b8833){return{'name':_0x9b8833[_0xcdae('0x30')],'type':_0x9b8833[_0xcdae('0x31')][_0xcdae('0x32')]};});_0x29701f[_0xcdae('0x33')]=_['map'](_0x4e0057,_0xcdae('0x2b'));_0x29701f[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x455923[_0xcdae('0x34')]);_0x29701f[_0xcdae('0x36')]=_['intersection'](_0x29701f[_0xcdae('0x33')],_0x29701f['query']);_0x1e6026[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x29701f['model'],qs[_0xcdae('0x39')](_0x455923['query'][_0xcdae('0x39')]));_0x1e6026[_0xcdae('0x37')]=_0x1e6026[_0xcdae('0x37')]['length']?_0x1e6026[_0xcdae('0x37')]:_0x29701f[_0xcdae('0x33')];if(!_0x455923[_0xcdae('0x34')]['hasOwnProperty'](_0xcdae('0x3a'))){_0x1e6026[_0xcdae('0x20')]=qs['limit'](_0x455923[_0xcdae('0x34')][_0xcdae('0x20')]);_0x1e6026[_0xcdae('0x1e')]=qs[_0xcdae('0x1e')](_0x455923[_0xcdae('0x34')][_0xcdae('0x1e')]);}_0x1e6026[_0xcdae('0x3b')]=qs[_0xcdae('0x3c')](_0x455923[_0xcdae('0x34')][_0xcdae('0x3c')]);_0x1e6026[_0xcdae('0x3d')]=qs['filters'](_[_0xcdae('0x3e')](_0x455923['query'],_0x29701f[_0xcdae('0x36')]),_0x4e0057);if(_0x455923['query']['filter']){_0x1e6026[_0xcdae('0x3d')]=_['merge'](_0x1e6026[_0xcdae('0x3d')],{'$or':_['map'](_0x4e0057,function(_0x4982c8){if(_0x4982c8[_0xcdae('0x31')]!=='VIRTUAL'){var _0x5292f8={};_0x5292f8[_0x4982c8[_0xcdae('0x2b')]]={'$like':'%'+_0x455923[_0xcdae('0x34')]['filter']+'%'};return _0x5292f8;}})});}_0x1e6026=_[_0xcdae('0x3f')]({},_0x1e6026,_0x455923[_0xcdae('0x40')]);var _0x3a327c={'where':_0x1e6026[_0xcdae('0x3d')]};return db[_0xcdae('0x2f')]['count'](_0x3a327c)[_0xcdae('0x26')](function(_0x298753){_0x250236['count']=_0x298753;if(_0x455923[_0xcdae('0x34')][_0xcdae('0x41')]){_0x1e6026[_0xcdae('0x42')]=[{'all':!![]}];}return db[_0xcdae('0x2f')][_0xcdae('0x43')](_0x1e6026);})[_0xcdae('0x26')](function(_0x36b2ac){_0x250236[_0xcdae('0x44')]=_0x36b2ac;return _0x250236;})[_0xcdae('0x26')](respondWithFilteredResult(_0x1e325a,_0x1e6026))[_0xcdae('0x45')](handleError(_0x1e325a,null));};exports['show']=function(_0x5f0e43,_0x5f2642){var _0x22665c={'raw':!![],'where':{'id':_0x5f0e43[_0xcdae('0x46')]['id']}},_0x2b0a91={};_0x2b0a91[_0xcdae('0x33')]=_[_0xcdae('0x35')](db['AnalyticExtractedReport'][_0xcdae('0x47')]);_0x2b0a91[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x5f0e43[_0xcdae('0x34')]);_0x2b0a91[_0xcdae('0x36')]=_['intersection'](_0x2b0a91[_0xcdae('0x33')],_0x2b0a91['query']);_0x22665c[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x2b0a91[_0xcdae('0x33')],qs[_0xcdae('0x39')](_0x5f0e43[_0xcdae('0x34')]['fields']));_0x22665c['attributes']=_0x22665c[_0xcdae('0x37')][_0xcdae('0x48')]?_0x22665c[_0xcdae('0x37')]:_0x2b0a91[_0xcdae('0x33')];if(_0x5f0e43[_0xcdae('0x34')][_0xcdae('0x41')]){_0x22665c['include']=[{'all':!![]}];}_0x22665c=_[_0xcdae('0x3f')]({},_0x22665c,_0x5f0e43[_0xcdae('0x40')]);return db[_0xcdae('0x2f')]['find'](_0x22665c)[_0xcdae('0x26')](handleEntityNotFound(_0x5f2642,null))[_0xcdae('0x26')](respondWithResult(_0x5f2642,null))[_0xcdae('0x45')](handleError(_0x5f2642,null));};exports['create']=function(_0x4ec14a,_0x122048){return db[_0xcdae('0x2f')]['create'](_0x4ec14a[_0xcdae('0x49')],{})[_0xcdae('0x26')](function(_0x41e60e){var _0x2196f2=_0x4ec14a['user'][_0xcdae('0x28')]({'plain':!![]});if(!_0x2196f2)throw new Error(_0xcdae('0x4a'));if(_0x2196f2[_0xcdae('0x4b')]===_0xcdae('0x4c')){var _0x901576=_0x41e60e[_0xcdae('0x28')]({'plain':!![]});var _0x2fd00a='ExtractedReports';return db[_0xcdae('0x4d')]['find']({'where':{'name':_0x2fd00a,'userProfileId':_0x2196f2[_0xcdae('0x4e')]},'raw':!![]})[_0xcdae('0x26')](function(_0x5360a4){if(_0x5360a4&&_0x5360a4[_0xcdae('0x4f')]===0x0){return db[_0xcdae('0x50')][_0xcdae('0x51')]({'name':_0x901576['name'],'resourceId':_0x901576['id'],'type':_0x5360a4[_0xcdae('0x2b')],'sectionId':_0x5360a4['id']},{})[_0xcdae('0x26')](function(){return _0x41e60e;});}else{return _0x41e60e;}})[_0xcdae('0x45')](function(_0x441366){logger[_0xcdae('0x52')](_0xcdae('0x53'),_0x441366);throw _0x441366;});}return _0x41e60e;})[_0xcdae('0x26')](respondWithResult(_0x122048,0xc9))['catch'](handleError(_0x122048,null));};exports[_0xcdae('0x25')]=function(_0x142d02,_0x50532c){if(_0x142d02[_0xcdae('0x49')]['id']){delete _0x142d02['body']['id'];}return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x142d02[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x50532c,null))['then'](saveUpdates(_0x142d02[_0xcdae('0x49')],null))[_0xcdae('0x26')](respondWithResult(_0x50532c,null))[_0xcdae('0x45')](handleError(_0x50532c,null));};exports['destroy']=function(_0x56f390,_0x595067){return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x56f390[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x595067,null))[_0xcdae('0x26')](removeEntity(_0x595067,null))[_0xcdae('0x45')](handleError(_0x595067,null));};exports['download']=function(_0x17b875,_0x1817f2,_0x350cb7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x17b875[_0xcdae('0x46')]['id']},'attributes':[_0xcdae('0x2b'),_0xcdae('0x55'),'savename','output'],'raw':!![]})[_0xcdae('0x26')](handleEntityNotFound(_0x1817f2,null))[_0xcdae('0x26')](function(_0x4fd10a){if(_0x4fd10a){if(!fs[_0xcdae('0x56')](path['join'](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a[_0xcdae('0x59')]))){throw new db[(_0xcdae('0x5a'))][(_0xcdae('0x5b'))](_0xcdae('0x5c'));}if(_0x17b875[_0xcdae('0x34')][_0xcdae('0x5d')]){return _0x1817f2[_0xcdae('0x1a')](0xc8);}return _0x1817f2[_0xcdae('0x5e')](path[_0xcdae('0x5f')](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a['savename']),util[_0xcdae('0x60')](_0xcdae('0x61'),_0x4fd10a[_0xcdae('0x55')]||_0x4fd10a[_0xcdae('0x2b')],_0x4fd10a['output'][_0xcdae('0x62')]()));}})[_0xcdae('0x45')](handleError(_0x1817f2,null));}; \ No newline at end of file +var _0xb6c3=['then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','length','include','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','body','download','savename','output','existsSync','join','root','server/files/reports','exists','format','%s.%s','basename','toLowerCase','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','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/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','update'];(function(_0x17b542,_0x4fabe7){var _0x1792b4=function(_0xdef90f){while(--_0xdef90f){_0x17b542['push'](_0x17b542['shift']());}};_0x1792b4(++_0x4fabe7);}(_0xb6c3,0xf4));var _0x3b6c=function(_0x9fcff7,_0x435935){_0x9fcff7=_0x9fcff7-0x0;var _0x1e12a9=_0xb6c3[_0x9fcff7];return _0x1e12a9;};'use strict';var emlformat=require(_0x3b6c('0x0'));var rimraf=require(_0x3b6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3b6c('0x2'));var moment=require(_0x3b6c('0x3'));var BPromise=require(_0x3b6c('0x4'));var Mustache=require(_0x3b6c('0x5'));var util=require('util');var path=require(_0x3b6c('0x6'));var sox=require(_0x3b6c('0x7'));var csv=require('to-csv');var ejs=require(_0x3b6c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b6c('0x9'));var squel=require(_0x3b6c('0xa'));var crypto=require(_0x3b6c('0xb'));var jsforce=require(_0x3b6c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3b6c('0xd'));var querystring=require(_0x3b6c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b6c('0xf'));var authService=require(_0x3b6c('0x10'));var qs=require(_0x3b6c('0x11'));var as=require(_0x3b6c('0x12'));var hardwareService=require(_0x3b6c('0x13'));var logger=require(_0x3b6c('0x14'))(_0x3b6c('0x15'));var utils=require(_0x3b6c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3b6c('0x17'));var db=require(_0x3b6c('0x18'))['db'];function respondWithStatusCode(_0x42234c,_0x2eefc7){_0x2eefc7=_0x2eefc7||0xcc;return function(_0xbdc9e){if(_0xbdc9e){return _0x42234c['sendStatus'](_0x2eefc7);}return _0x42234c[_0x3b6c('0x19')](_0x2eefc7)['end']();};}function respondWithResult(_0x33ec32,_0x1b019d){_0x1b019d=_0x1b019d||0xc8;return function(_0x129dc0){if(_0x129dc0){return _0x33ec32[_0x3b6c('0x19')](_0x1b019d)[_0x3b6c('0x1a')](_0x129dc0);}};}function respondWithFilteredResult(_0x4d95c3,_0x55b8ca){return function(_0x3535d4){if(_0x3535d4){var _0x1567c4=typeof _0x55b8ca['offset']===_0x3b6c('0x1b')&&typeof _0x55b8ca[_0x3b6c('0x1c')]==='undefined';var _0x4cd799=_0x3535d4[_0x3b6c('0x1d')];var _0x5f0edf=_0x1567c4?0x0:_0x55b8ca[_0x3b6c('0x1e')];var _0x25be7f=_0x1567c4?_0x3535d4[_0x3b6c('0x1d')]:_0x55b8ca[_0x3b6c('0x1e')]+_0x55b8ca[_0x3b6c('0x1c')];var _0x296fba;if(_0x25be7f>=_0x4cd799){_0x25be7f=_0x4cd799;_0x296fba=0xc8;}else{_0x296fba=0xce;}_0x4d95c3[_0x3b6c('0x19')](_0x296fba);return _0x4d95c3[_0x3b6c('0x1f')](_0x3b6c('0x20'),_0x5f0edf+'-'+_0x25be7f+'/'+_0x4cd799)[_0x3b6c('0x1a')](_0x3535d4);}return null;};}function patchUpdates(_0x140c32){return function(_0x44c375){try{jsonpatch[_0x3b6c('0x21')](_0x44c375,_0x140c32,!![]);}catch(_0x2cc81c){return BPromise['reject'](_0x2cc81c);}return _0x44c375['save']();};}function saveUpdates(_0x43f116,_0x557bdb){return function(_0x249c35){if(_0x249c35){return _0x249c35[_0x3b6c('0x22')](_0x43f116)[_0x3b6c('0x23')](function(_0x1b0291){return _0x1b0291;});}return null;};}function removeEntity(_0x54023d,_0x44729f){return function(_0x14d1fd){if(_0x14d1fd){return _0x14d1fd[_0x3b6c('0x24')]()[_0x3b6c('0x23')](function(){var _0x10bcd1=_0x14d1fd[_0x3b6c('0x25')]({'plain':!![]});var _0x4e31ba=_0x3b6c('0x26');return db[_0x3b6c('0x27')]['destroy']({'where':{'type':_0x4e31ba,'resourceId':_0x10bcd1['id']}})[_0x3b6c('0x23')](function(){return _0x14d1fd;});})[_0x3b6c('0x23')](function(){_0x54023d[_0x3b6c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f75f1,_0x458148){return function(_0x1e6b34){if(!_0x1e6b34){_0x1f75f1[_0x3b6c('0x28')](0x194);}return _0x1e6b34;};}function handleError(_0x18191a,_0x35d363){_0x35d363=_0x35d363||0x1f4;return function(_0x3fe436){logger[_0x3b6c('0x29')](_0x3fe436['stack']);if(_0x3fe436[_0x3b6c('0x2a')]){delete _0x3fe436[_0x3b6c('0x2a')];}_0x18191a[_0x3b6c('0x19')](_0x35d363)[_0x3b6c('0x2b')](_0x3fe436);};}exports[_0x3b6c('0x2c')]=function(_0x31885c,_0x36227e){var _0x3d8149={},_0xde1e55={},_0x5778de={'count':0x0,'rows':[]};var _0x37cdf8=_[_0x3b6c('0x2d')](db[_0x3b6c('0x2e')][_0x3b6c('0x2f')],function(_0x3e9b77){return{'name':_0x3e9b77['fieldName'],'type':_0x3e9b77[_0x3b6c('0x30')]['key']};});_0xde1e55[_0x3b6c('0x31')]=_[_0x3b6c('0x2d')](_0x37cdf8,'name');_0xde1e55[_0x3b6c('0x32')]=_[_0x3b6c('0x33')](_0x31885c[_0x3b6c('0x32')]);_0xde1e55[_0x3b6c('0x34')]=_[_0x3b6c('0x35')](_0xde1e55['model'],_0xde1e55['query']);_0x3d8149[_0x3b6c('0x36')]=_[_0x3b6c('0x35')](_0xde1e55[_0x3b6c('0x31')],qs[_0x3b6c('0x37')](_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x37')]));_0x3d8149[_0x3b6c('0x36')]=_0x3d8149[_0x3b6c('0x36')]['length']?_0x3d8149[_0x3b6c('0x36')]:_0xde1e55['model'];if(!_0x31885c['query']['hasOwnProperty'](_0x3b6c('0x38'))){_0x3d8149['limit']=qs[_0x3b6c('0x1c')](_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x1c')]);_0x3d8149[_0x3b6c('0x1e')]=qs[_0x3b6c('0x1e')](_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x1e')]);}_0x3d8149[_0x3b6c('0x39')]=qs[_0x3b6c('0x3a')](_0x31885c['query']['sort']);_0x3d8149[_0x3b6c('0x3b')]=qs[_0x3b6c('0x34')](_[_0x3b6c('0x3c')](_0x31885c[_0x3b6c('0x32')],_0xde1e55[_0x3b6c('0x34')]),_0x37cdf8);if(_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x3d')]){_0x3d8149[_0x3b6c('0x3b')]=_[_0x3b6c('0x3e')](_0x3d8149[_0x3b6c('0x3b')],{'$or':_['map'](_0x37cdf8,function(_0x2c1c67){if(_0x2c1c67[_0x3b6c('0x30')]!==_0x3b6c('0x3f')){var _0x5a539e={};_0x5a539e[_0x2c1c67[_0x3b6c('0x2a')]]={'$like':'%'+_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x3d')]+'%'};return _0x5a539e;}})});}_0x3d8149=_[_0x3b6c('0x3e')]({},_0x3d8149,_0x31885c['options']);var _0x2d196b={'where':_0x3d8149[_0x3b6c('0x3b')]};return db[_0x3b6c('0x2e')][_0x3b6c('0x1d')](_0x2d196b)[_0x3b6c('0x23')](function(_0x4758e7){_0x5778de[_0x3b6c('0x1d')]=_0x4758e7;if(_0x31885c[_0x3b6c('0x32')][_0x3b6c('0x40')]){_0x3d8149['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x3d8149);})[_0x3b6c('0x23')](function(_0xe3cf33){_0x5778de[_0x3b6c('0x41')]=_0xe3cf33;return _0x5778de;})[_0x3b6c('0x23')](respondWithFilteredResult(_0x36227e,_0x3d8149))[_0x3b6c('0x42')](handleError(_0x36227e,null));};exports[_0x3b6c('0x43')]=function(_0x3dde9a,_0x562919){var _0x15da74={'raw':!![],'where':{'id':_0x3dde9a[_0x3b6c('0x44')]['id']}},_0x365eae={};_0x365eae[_0x3b6c('0x31')]=_[_0x3b6c('0x33')](db[_0x3b6c('0x2e')][_0x3b6c('0x2f')]);_0x365eae['query']=_[_0x3b6c('0x33')](_0x3dde9a['query']);_0x365eae[_0x3b6c('0x34')]=_['intersection'](_0x365eae[_0x3b6c('0x31')],_0x365eae[_0x3b6c('0x32')]);_0x15da74['attributes']=_[_0x3b6c('0x35')](_0x365eae['model'],qs[_0x3b6c('0x37')](_0x3dde9a['query']['fields']));_0x15da74[_0x3b6c('0x36')]=_0x15da74[_0x3b6c('0x36')][_0x3b6c('0x45')]?_0x15da74[_0x3b6c('0x36')]:_0x365eae[_0x3b6c('0x31')];if(_0x3dde9a[_0x3b6c('0x32')]['includeAll']){_0x15da74[_0x3b6c('0x46')]=[{'all':!![]}];}_0x15da74=_[_0x3b6c('0x3e')]({},_0x15da74,_0x3dde9a[_0x3b6c('0x47')]);return db['AnalyticExtractedReport'][_0x3b6c('0x48')](_0x15da74)[_0x3b6c('0x23')](handleEntityNotFound(_0x562919,null))['then'](respondWithResult(_0x562919,null))['catch'](handleError(_0x562919,null));};exports['create']=function(_0x50f290,_0x431b85){return db['AnalyticExtractedReport']['create'](_0x50f290['body'],{})[_0x3b6c('0x23')](function(_0x5e7dde){var _0x1dae43=_0x50f290[_0x3b6c('0x49')][_0x3b6c('0x25')]({'plain':!![]});if(!_0x1dae43)throw new Error(_0x3b6c('0x4a'));if(_0x1dae43[_0x3b6c('0x4b')]===_0x3b6c('0x49')){var _0x3766e7=_0x5e7dde[_0x3b6c('0x25')]({'plain':!![]});var _0x5fd50d=_0x3b6c('0x26');return db[_0x3b6c('0x4c')][_0x3b6c('0x48')]({'where':{'name':_0x5fd50d,'userProfileId':_0x1dae43[_0x3b6c('0x4d')]},'raw':!![]})[_0x3b6c('0x23')](function(_0x516352){if(_0x516352&&_0x516352[_0x3b6c('0x4e')]===0x0){return db[_0x3b6c('0x27')][_0x3b6c('0x4f')]({'name':_0x3766e7[_0x3b6c('0x2a')],'resourceId':_0x3766e7['id'],'type':_0x516352['name'],'sectionId':_0x516352['id']},{})[_0x3b6c('0x23')](function(){return _0x5e7dde;});}else{return _0x5e7dde;}})[_0x3b6c('0x42')](function(_0xca1ad0){logger[_0x3b6c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xca1ad0);throw _0xca1ad0;});}return _0x5e7dde;})[_0x3b6c('0x23')](respondWithResult(_0x431b85,0xc9))[_0x3b6c('0x42')](handleError(_0x431b85,null));};exports[_0x3b6c('0x22')]=function(_0x3910e0,_0x35525c){if(_0x3910e0[_0x3b6c('0x50')]['id']){delete _0x3910e0[_0x3b6c('0x50')]['id'];}return db[_0x3b6c('0x2e')][_0x3b6c('0x48')]({'where':{'id':_0x3910e0[_0x3b6c('0x44')]['id']}})[_0x3b6c('0x23')](handleEntityNotFound(_0x35525c,null))[_0x3b6c('0x23')](saveUpdates(_0x3910e0['body'],null))['then'](respondWithResult(_0x35525c,null))['catch'](handleError(_0x35525c,null));};exports['destroy']=function(_0x5596c3,_0x24b3b5){return db['AnalyticExtractedReport'][_0x3b6c('0x48')]({'where':{'id':_0x5596c3[_0x3b6c('0x44')]['id']}})[_0x3b6c('0x23')](handleEntityNotFound(_0x24b3b5,null))[_0x3b6c('0x23')](removeEntity(_0x24b3b5,null))[_0x3b6c('0x42')](handleError(_0x24b3b5,null));};exports[_0x3b6c('0x51')]=function(_0x2cc08d,_0xe30337,_0x58bc91){return db[_0x3b6c('0x2e')][_0x3b6c('0x48')]({'where':{'id':_0x2cc08d[_0x3b6c('0x44')]['id']},'attributes':[_0x3b6c('0x2a'),'basename',_0x3b6c('0x52'),_0x3b6c('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0xe30337,null))['then'](function(_0x304204){if(_0x304204){if(!fs[_0x3b6c('0x54')](path[_0x3b6c('0x55')](config[_0x3b6c('0x56')],_0x3b6c('0x57'),_0x304204['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x2cc08d[_0x3b6c('0x32')][_0x3b6c('0x58')]){return _0xe30337[_0x3b6c('0x28')](0xc8);}return _0xe30337['download'](path['join'](config[_0x3b6c('0x56')],_0x3b6c('0x57'),_0x304204[_0x3b6c('0x52')]),util[_0x3b6c('0x59')](_0x3b6c('0x5a'),_0x304204[_0x3b6c('0x5b')]||_0x304204[_0x3b6c('0x2a')],_0x304204['output'][_0x3b6c('0x5c')]()));}})[_0x3b6c('0x42')](handleError(_0xe30337,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6d8f93c..d079aaf 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 _0xf314=['./analyticExtractedReport.attributes','define','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x86932b,_0xa8fa5c){var _0x12dcaf=function(_0xd378d3){while(--_0xd378d3){_0x86932b['push'](_0x86932b['shift']());}};_0x12dcaf(++_0xa8fa5c);}(_0xf314,0x92));var _0x4f31=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf314[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x4f31('0x0'));var util=require(_0x4f31('0x1'));var logger=require(_0x4f31('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f31('0x3'));var rp=require(_0x4f31('0x4'));var fs=require('fs');var path=require(_0x4f31('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f31('0x6'));module['exports']=function(_0x3ae6f2,_0x532879){return _0x3ae6f2[_0x4f31('0x7')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7e2=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x567946,_0x387c8d){var _0x5bae51=function(_0x6b4357){while(--_0x6b4357){_0x567946['push'](_0x567946['shift']());}};_0x5bae51(++_0x387c8d);}(_0xc7e2,0x185));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2c7e('0x0'));var logger=require(_0x2c7e('0x1'))(_0x2c7e('0x2'));var moment=require('moment');var BPromise=require(_0x2c7e('0x3'));var rp=require(_0x2c7e('0x4'));var fs=require('fs');var path=require(_0x2c7e('0x5'));var rimraf=require(_0x2c7e('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x2c7e('0x7')]=function(_0x40f44e,_0x2f53db){return _0x40f44e[_0x2c7e('0x8')](_0x2c7e('0x9'),attributes,{'tableName':_0x2c7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 15b0280..5da5c83 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 _0x0444=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1142fb,_0x59acf3){var _0x590d0f=function(_0x56b8e8){while(--_0x56b8e8){_0x1142fb['push'](_0x1142fb['shift']());}};_0x590d0f(++_0x59acf3);}(_0x0444,0xbd));var _0x4044=function(_0x3cc2ee,_0x3ab210){_0x3cc2ee=_0x3cc2ee-0x0;var _0x3262c6=_0x0444[_0x3cc2ee];return _0x3262c6;};'use strict';var _=require(_0x4044('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4044('0x1'));var rs=require(_0x4044('0x2'));var fs=require('fs');var Redis=require(_0x4044('0x3'));var db=require(_0x4044('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4044('0x5'))(_0x4044('0x6'));var config=require(_0x4044('0x7'));var jayson=require(_0x4044('0x8'));var client=jayson[_0x4044('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31c11f,_0x590b6f,_0x3e9f69){return new BPromise(function(_0x15704a,_0x363a5d){return client[_0x4044('0xa')](_0x31c11f,_0x3e9f69)[_0x4044('0xb')](function(_0x2880e2){logger[_0x4044('0xc')](_0x4044('0xd'),_0x590b6f,_0x4044('0xe'));logger[_0x4044('0xf')](_0x4044('0x10'),_0x590b6f,_0x4044('0xe'),JSON[_0x4044('0x11')](_0x2880e2));if(_0x2880e2[_0x4044('0x12')]){if(_0x2880e2[_0x4044('0x12')][_0x4044('0x13')]===0x1f4){logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2['error']['message']);return _0x363a5d(_0x2880e2['error'][_0x4044('0x14')]);}logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2[_0x4044('0x12')][_0x4044('0x14')]);return _0x15704a(_0x2880e2['error'][_0x4044('0x14')]);}else{logger['info'](_0x4044('0xd'),_0x590b6f,'request\x20sent');_0x15704a(_0x2880e2[_0x4044('0x15')][_0x4044('0x14')]);}})[_0x4044('0x16')](function(_0x2b7824){logger[_0x4044('0x12')](_0x4044('0xd'),_0x590b6f,_0x2b7824);_0x363a5d(_0x2b7824);});});} \ No newline at end of file +var _0xe7fd=['error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe7fd,0x148));var _0xde7f=function(_0xe07e75,_0x11cf89){_0xe07e75=_0xe07e75-0x0;var _0x52dbe0=_0xe7fd[_0xe07e75];return _0x52dbe0;};'use strict';var _=require('lodash');var util=require(_0xde7f('0x0'));var moment=require(_0xde7f('0x1'));var BPromise=require('bluebird');var rs=require(_0xde7f('0x2'));var fs=require('fs');var Redis=require(_0xde7f('0x3'));var db=require(_0xde7f('0x4'))['db'];var utils=require(_0xde7f('0x5'));var logger=require(_0xde7f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35961d,_0xee9e53,_0x5a1c90){return new BPromise(function(_0x4c390b,_0xf08ff1){return client[_0xde7f('0x7')](_0x35961d,_0x5a1c90)[_0xde7f('0x8')](function(_0x876cca){logger[_0xde7f('0x9')](_0xde7f('0xa'),_0xee9e53,_0xde7f('0xb'));logger[_0xde7f('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xee9e53,_0xde7f('0xb'),JSON[_0xde7f('0xd')](_0x876cca));if(_0x876cca[_0xde7f('0xe')]){if(_0x876cca[_0xde7f('0xe')][_0xde7f('0xf')]===0x1f4){logger[_0xde7f('0xe')](_0xde7f('0xa'),_0xee9e53,_0x876cca[_0xde7f('0xe')]['message']);return _0xf08ff1(_0x876cca[_0xde7f('0xe')][_0xde7f('0x10')]);}logger[_0xde7f('0xe')](_0xde7f('0xa'),_0xee9e53,_0x876cca['error'][_0xde7f('0x10')]);return _0x4c390b(_0x876cca[_0xde7f('0xe')][_0xde7f('0x10')]);}else{logger['info'](_0xde7f('0xa'),_0xee9e53,'request\x20sent');_0x4c390b(_0x876cca[_0xde7f('0x11')][_0xde7f('0x10')]);}})[_0xde7f('0x12')](function(_0x2730e8){logger[_0xde7f('0xe')](_0xde7f('0xa'),_0xee9e53,_0x2730e8);_0xf08ff1(_0x2730e8);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 54d3237..046d425 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 _0xd267=['/:id','show','/:id/download','download','create','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd267,0x1b8));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7d26('0x0'));var path=require('path');var timeout=require(_0x7d26('0x1'));var express=require('express');var router=express[_0x7d26('0x2')]();var fs_extra=require(_0x7d26('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d26('0x4'));var config=require(_0x7d26('0x5'));var controller=require(_0x7d26('0x6'));router[_0x7d26('0x7')]('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0x9')]);router[_0x7d26('0x7')](_0x7d26('0xa'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xb')]);router['get'](_0x7d26('0xc'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xd')]);router['post']('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0xe')]);router['put']('/:id',auth[_0x7d26('0x8')](),controller[_0x7d26('0xf')]);router[_0x7d26('0x10')]('/:id',auth[_0x7d26('0x8')](),controller['destroy']);module[_0x7d26('0x11')]=router; \ No newline at end of file +var _0x7a7c=['download','put','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0x7a7c,0x136));var _0xc7a7=function(_0x51f54f,_0x3dff31){_0x51f54f=_0x51f54f-0x0;var _0x58bacb=_0x7a7c[_0x51f54f];return _0x58bacb;};'use strict';var multer=require(_0xc7a7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7a7('0x1'));var router=express[_0xc7a7('0x2')]();var fs_extra=require(_0xc7a7('0x3'));var auth=require(_0xc7a7('0x4'));var interaction=require(_0xc7a7('0x5'));var config=require(_0xc7a7('0x6'));var controller=require(_0xc7a7('0x7'));router[_0xc7a7('0x8')]('/',auth[_0xc7a7('0x9')](),controller[_0xc7a7('0xa')]);router['get'](_0xc7a7('0xb'),auth[_0xc7a7('0x9')](),controller[_0xc7a7('0xc')]);router[_0xc7a7('0x8')](_0xc7a7('0xd'),auth[_0xc7a7('0x9')](),controller[_0xc7a7('0xe')]);router['post']('/',auth[_0xc7a7('0x9')](),controller['create']);router[_0xc7a7('0xf')](_0xc7a7('0xb'),auth[_0xc7a7('0x9')](),controller['update']);router[_0xc7a7('0x10')](_0xc7a7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc7a7('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index a395375..74af1fd 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 _0x3292=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x45f859,_0x3cbda5){var _0x2410e7=function(_0x3fc569){while(--_0x3fc569){_0x45f859['push'](_0x45f859['shift']());}};_0x2410e7(++_0x3cbda5);}(_0x3292,0xcf));var _0x2329=function(_0x2c1684,_0x3d7540){_0x2c1684=_0x2c1684-0x0;var _0x5cd07a=_0x3292[_0x2c1684];return _0x5cd07a;};'use strict';var Sequelize=require(_0x2329('0x0'));module[_0x2329('0x1')]={'field':{'type':Sequelize[_0x2329('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2329('0x3')]},'groupBy':{'type':Sequelize[_0x2329('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2329('0x3')]},'custom':{'type':Sequelize[_0x2329('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x83a6=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3845c2,_0x5d2b3a){var _0x1c0773=function(_0x136d08){while(--_0x136d08){_0x3845c2['push'](_0x3845c2['shift']());}};_0x1c0773(++_0x5d2b3a);}(_0x83a6,0xc8));var _0x683a=function(_0x16b3b2,_0x2cfc43){_0x16b3b2=_0x16b3b2-0x0;var _0x306791=_0x83a6[_0x16b3b2];return _0x306791;};'use strict';var Sequelize=require(_0x683a('0x0'));module[_0x683a('0x1')]={'field':{'type':Sequelize[_0x683a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x683a('0x3')]},'format':{'type':Sequelize[_0x683a('0x3')]},'groupBy':{'type':Sequelize[_0x683a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x683a('0x3')]},'custom':{'type':Sequelize[_0x683a('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 f430cb5..0232c9a 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 _0x9ac0=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1c5285,_0x4c7a94){var _0x5a93ab=function(_0x35f6cf){while(--_0x35f6cf){_0x1c5285['push'](_0x1c5285['shift']());}};_0x5a93ab(++_0x4c7a94);}(_0x9ac0,0x179));var _0x09ac=function(_0x561a58,_0x22f033){_0x561a58=_0x561a58-0x0;var _0x583036=_0x9ac0[_0x561a58];return _0x583036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ac('0x0'));var zipdir=require(_0x09ac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ac('0x3'));var util=require(_0x09ac('0x4'));var path=require(_0x09ac('0x5'));var sox=require(_0x09ac('0x6'));var csv=require('to-csv');var ejs=require(_0x09ac('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09ac('0x8'));var squel=require(_0x09ac('0x9'));var crypto=require(_0x09ac('0xa'));var jsforce=require(_0x09ac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x09ac('0xc'));var querystring=require(_0x09ac('0xd'));var Papa=require(_0x09ac('0xe'));var Redis=require(_0x09ac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09ac('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ac('0x11'))(_0x09ac('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x09ac('0x13'));var db=require(_0x09ac('0x14'))['db'];function respondWithStatusCode(_0x224e6f,_0x2b08e7){_0x2b08e7=_0x2b08e7||0xcc;return function(_0x3f82d5){if(_0x3f82d5){return _0x224e6f[_0x09ac('0x15')](_0x2b08e7);}return _0x224e6f[_0x09ac('0x16')](_0x2b08e7)[_0x09ac('0x17')]();};}function respondWithResult(_0x442880,_0x32fcbb){_0x32fcbb=_0x32fcbb||0xc8;return function(_0x54acad){if(_0x54acad){return _0x442880['status'](_0x32fcbb)[_0x09ac('0x18')](_0x54acad);}};}function respondWithFilteredResult(_0x19d7be,_0x3b376b){return function(_0x1634c8){if(_0x1634c8){var _0x175adf=typeof _0x3b376b[_0x09ac('0x19')]===_0x09ac('0x1a')&&typeof _0x3b376b['limit']==='undefined';var _0x2daa95=_0x1634c8[_0x09ac('0x1b')];var _0x1eb278=_0x175adf?0x0:_0x3b376b[_0x09ac('0x19')];var _0xb41e74=_0x175adf?_0x1634c8[_0x09ac('0x1b')]:_0x3b376b[_0x09ac('0x19')]+_0x3b376b[_0x09ac('0x1c')];var _0x13a6ee;if(_0xb41e74>=_0x2daa95){_0xb41e74=_0x2daa95;_0x13a6ee=0xc8;}else{_0x13a6ee=0xce;}_0x19d7be[_0x09ac('0x16')](_0x13a6ee);return _0x19d7be[_0x09ac('0x1d')](_0x09ac('0x1e'),_0x1eb278+'-'+_0xb41e74+'/'+_0x2daa95)['json'](_0x1634c8);}return null;};}function patchUpdates(_0xcdde03){return function(_0xfa17cf){try{jsonpatch[_0x09ac('0x1f')](_0xfa17cf,_0xcdde03,!![]);}catch(_0x2fa440){return BPromise[_0x09ac('0x20')](_0x2fa440);}return _0xfa17cf[_0x09ac('0x21')]();};}function saveUpdates(_0x191246,_0x22dd26){return function(_0x1848d3){if(_0x1848d3){return _0x1848d3[_0x09ac('0x22')](_0x191246)[_0x09ac('0x23')](function(_0x19bdc8){return _0x19bdc8;});}return null;};}function removeEntity(_0x1e10f9,_0x11711d){return function(_0x39dc22){if(_0x39dc22){return _0x39dc22[_0x09ac('0x24')]()['then'](function(){_0x1e10f9[_0x09ac('0x16')](0xcc)[_0x09ac('0x17')]();});}};}function handleEntityNotFound(_0x2912ae,_0xb1529e){return function(_0x1cfe43){if(!_0x1cfe43){_0x2912ae[_0x09ac('0x15')](0x194);}return _0x1cfe43;};}function handleError(_0x1a815b,_0x4008c7){_0x4008c7=_0x4008c7||0x1f4;return function(_0x414dc0){logger[_0x09ac('0x25')](_0x414dc0[_0x09ac('0x26')]);if(_0x414dc0['name']){delete _0x414dc0[_0x09ac('0x27')];}_0x1a815b['status'](_0x4008c7)[_0x09ac('0x28')](_0x414dc0);};}exports[_0x09ac('0x29')]=function(_0x571b00,_0x429dcd){var _0x325e2d={},_0x36efe0={},_0x41ca09={'count':0x0,'rows':[]};var _0x525015=_['map'](db[_0x09ac('0x2a')][_0x09ac('0x2b')],function(_0xb475cb){return{'name':_0xb475cb['fieldName'],'type':_0xb475cb[_0x09ac('0x2c')][_0x09ac('0x2d')]};});_0x36efe0[_0x09ac('0x2e')]=_[_0x09ac('0x2f')](_0x525015,_0x09ac('0x27'));_0x36efe0[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x571b00[_0x09ac('0x30')]);_0x36efe0[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],_0x36efe0[_0x09ac('0x30')]);_0x325e2d[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x35')]));_0x325e2d[_0x09ac('0x34')]=_0x325e2d[_0x09ac('0x34')][_0x09ac('0x36')]?_0x325e2d[_0x09ac('0x34')]:_0x36efe0[_0x09ac('0x2e')];if(!_0x571b00[_0x09ac('0x30')]['hasOwnProperty'](_0x09ac('0x37'))){_0x325e2d[_0x09ac('0x1c')]=qs[_0x09ac('0x1c')](_0x571b00[_0x09ac('0x30')]['limit']);_0x325e2d[_0x09ac('0x19')]=qs[_0x09ac('0x19')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x19')]);}_0x325e2d[_0x09ac('0x38')]=qs[_0x09ac('0x39')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x39')]);_0x325e2d[_0x09ac('0x3a')]=qs['filters'](_[_0x09ac('0x3b')](_0x571b00['query'],_0x36efe0[_0x09ac('0x32')]),_0x525015);if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]){_0x325e2d[_0x09ac('0x3a')]=_[_0x09ac('0x3d')](_0x325e2d[_0x09ac('0x3a')],{'$or':_[_0x09ac('0x2f')](_0x525015,function(_0x53097c){if(_0x53097c['type']!==_0x09ac('0x3e')){var _0x3f28c3={};_0x3f28c3[_0x53097c[_0x09ac('0x27')]]={'$like':'%'+_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]+'%'};return _0x3f28c3;}})});}_0x325e2d=_[_0x09ac('0x3d')]({},_0x325e2d,_0x571b00[_0x09ac('0x3f')]);var _0x14f58d={'where':_0x325e2d[_0x09ac('0x3a')]};return db[_0x09ac('0x2a')][_0x09ac('0x1b')](_0x14f58d)[_0x09ac('0x23')](function(_0x224c6e){_0x41ca09['count']=_0x224c6e;if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x40')]){_0x325e2d[_0x09ac('0x41')]=[{'all':!![]}];}return db[_0x09ac('0x2a')]['findAll'](_0x325e2d);})['then'](function(_0x54dcb7){_0x41ca09[_0x09ac('0x42')]=_0x54dcb7;return _0x41ca09;})[_0x09ac('0x23')](respondWithFilteredResult(_0x429dcd,_0x325e2d))[_0x09ac('0x43')](handleError(_0x429dcd,null));};exports['show']=function(_0x76ff6f,_0x474413){var _0x59653f={'raw':![],'where':{'id':_0x76ff6f[_0x09ac('0x44')]['id']}},_0x1f6a9e={};_0x1f6a9e[_0x09ac('0x2e')]=_[_0x09ac('0x31')](db[_0x09ac('0x2a')][_0x09ac('0x2b')]);_0x1f6a9e[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x76ff6f[_0x09ac('0x30')]);_0x1f6a9e[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],_0x1f6a9e[_0x09ac('0x30')]);_0x59653f[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x76ff6f[_0x09ac('0x30')][_0x09ac('0x35')]));_0x59653f[_0x09ac('0x34')]=_0x59653f[_0x09ac('0x34')]['length']?_0x59653f['attributes']:_0x1f6a9e[_0x09ac('0x2e')];if(_0x76ff6f['query'][_0x09ac('0x40')]){_0x59653f[_0x09ac('0x41')]=[{'all':!![]}];}_0x59653f=_[_0x09ac('0x3d')]({},_0x59653f,_0x76ff6f[_0x09ac('0x3f')]);return db[_0x09ac('0x2a')]['find'](_0x59653f)[_0x09ac('0x23')](handleEntityNotFound(_0x474413,null))[_0x09ac('0x23')](respondWithResult(_0x474413,null))['catch'](handleError(_0x474413,null));};exports[_0x09ac('0x45')]=function(_0x4e285f,_0x5d0dbd){return db[_0x09ac('0x2a')]['create'](_0x4e285f[_0x09ac('0x46')],{})[_0x09ac('0x23')](respondWithResult(_0x5d0dbd,0xc9))[_0x09ac('0x43')](handleError(_0x5d0dbd,null));};exports['bulkCreate']=function(_0x53e83f,_0x381231){return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x53e83f[_0x09ac('0x46')],{'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0x381231,0xc9))[_0x09ac('0x43')](handleError(_0x381231,null));};exports[_0x09ac('0x22')]=function(_0x1da763,_0x47c596){if(_0x1da763['body']['id']){delete _0x1da763[_0x09ac('0x46')]['id'];}return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x1da763[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x47c596,null))['then'](saveUpdates(_0x1da763[_0x09ac('0x46')],null))[_0x09ac('0x23')](respondWithResult(_0x47c596,null))[_0x09ac('0x43')](handleError(_0x47c596,null));};exports[_0x09ac('0x24')]=function(_0x2377a6,_0x4a65b0){return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x2377a6[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x4a65b0,null))[_0x09ac('0x23')](removeEntity(_0x4a65b0,null))[_0x09ac('0x43')](handleError(_0x4a65b0,null));};exports[_0x09ac('0x49')]=function(_0x458069,_0xbf308a){return db['AnalyticFieldReport'][_0x09ac('0x24')]({'where':{'id':_0x458069[_0x09ac('0x30')][_0x09ac('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0xbf308a,0xcc))[_0x09ac('0x43')](handleError(_0xbf308a,null));};exports[_0x09ac('0x4b')]=function(_0x4a02c1,_0x2e6991,_0x118bc4){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a02c1[_0x09ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e6991,null))['then'](function(_0x1b4973){if(_0x1b4973){return db[_0x09ac('0x4c')][_0x09ac('0x4d')](function(_0x4b2194){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']},'transaction':_0x4b2194})[_0x09ac('0x23')](function(_0x17b62d){var _0x36c97f=_[_0x09ac('0x2f')](_0x4a02c1['body'],function(_0x1f0e52){delete _0x1f0e52['id'];_0x1f0e52[_0x09ac('0x4e')]=_0x4a02c1[_0x09ac('0x44')]['id'];return _0x1f0e52;});return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x36c97f,{'transaction':_0x4b2194});});})[_0x09ac('0x23')](function(){return db['AnalyticFieldReport'][_0x09ac('0x4f')]({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']}});});}})['then'](respondWithResult(_0x2e6991,null))[_0x09ac('0x43')](handleError(_0x2e6991,null));}; \ No newline at end of file +var _0x6c42=['api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','find','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5da8f2,_0x4e3180){var _0x788625=function(_0x4ccc2e){while(--_0x4ccc2e){_0x5da8f2['push'](_0x5da8f2['shift']());}};_0x788625(++_0x4e3180);}(_0x6c42,0xd0));var _0x26c4=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x6c42[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26c4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26c4('0x1'));var rp=require('request-promise');var moment=require(_0x26c4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x26c4('0x3'));var util=require('util');var path=require(_0x26c4('0x4'));var sox=require('sox');var csv=require(_0x26c4('0x5'));var ejs=require(_0x26c4('0x6'));var fs=require('fs');var fs_extra=require(_0x26c4('0x7'));var _=require(_0x26c4('0x8'));var squel=require(_0x26c4('0x9'));var crypto=require(_0x26c4('0xa'));var jsforce=require(_0x26c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x26c4('0x5'));var querystring=require('querystring');var Papa=require(_0x26c4('0xc'));var Redis=require(_0x26c4('0xd'));var authService=require(_0x26c4('0xe'));var qs=require(_0x26c4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26c4('0x10'));var logger=require('../../config/logger')(_0x26c4('0x11'));var utils=require(_0x26c4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x26c4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20af35,_0x5347cc){_0x5347cc=_0x5347cc||0xcc;return function(_0x30bfa1){if(_0x30bfa1){return _0x20af35[_0x26c4('0x14')](_0x5347cc);}return _0x20af35['status'](_0x5347cc)[_0x26c4('0x15')]();};}function respondWithResult(_0x516d82,_0x1c9c56){_0x1c9c56=_0x1c9c56||0xc8;return function(_0x180c1a){if(_0x180c1a){return _0x516d82[_0x26c4('0x16')](_0x1c9c56)[_0x26c4('0x17')](_0x180c1a);}};}function respondWithFilteredResult(_0x24dca8,_0x30e278){return function(_0x7cb640){if(_0x7cb640){var _0x204897=typeof _0x30e278[_0x26c4('0x18')]===_0x26c4('0x19')&&typeof _0x30e278[_0x26c4('0x1a')]===_0x26c4('0x19');var _0x4b2d2d=_0x7cb640[_0x26c4('0x1b')];var _0x4b48b5=_0x204897?0x0:_0x30e278[_0x26c4('0x18')];var _0x1da559=_0x204897?_0x7cb640['count']:_0x30e278[_0x26c4('0x18')]+_0x30e278['limit'];var _0x3976ae;if(_0x1da559>=_0x4b2d2d){_0x1da559=_0x4b2d2d;_0x3976ae=0xc8;}else{_0x3976ae=0xce;}_0x24dca8[_0x26c4('0x16')](_0x3976ae);return _0x24dca8[_0x26c4('0x1c')](_0x26c4('0x1d'),_0x4b48b5+'-'+_0x1da559+'/'+_0x4b2d2d)[_0x26c4('0x17')](_0x7cb640);}return null;};}function patchUpdates(_0x5cc58e){return function(_0x4a1d2b){try{jsonpatch[_0x26c4('0x1e')](_0x4a1d2b,_0x5cc58e,!![]);}catch(_0xccf601){return BPromise[_0x26c4('0x1f')](_0xccf601);}return _0x4a1d2b[_0x26c4('0x20')]();};}function saveUpdates(_0x3b032e,_0x81beaa){return function(_0x226650){if(_0x226650){return _0x226650[_0x26c4('0x21')](_0x3b032e)[_0x26c4('0x22')](function(_0x51d306){return _0x51d306;});}return null;};}function removeEntity(_0x548ddd,_0x31a6c1){return function(_0x85a319){if(_0x85a319){return _0x85a319[_0x26c4('0x23')]()['then'](function(){_0x548ddd['status'](0xcc)[_0x26c4('0x15')]();});}};}function handleEntityNotFound(_0x106aef,_0x2ce1d6){return function(_0x35c754){if(!_0x35c754){_0x106aef[_0x26c4('0x14')](0x194);}return _0x35c754;};}function handleError(_0x2fd09b,_0x41643e){_0x41643e=_0x41643e||0x1f4;return function(_0x42ee4b){logger['error'](_0x42ee4b['stack']);if(_0x42ee4b[_0x26c4('0x24')]){delete _0x42ee4b['name'];}_0x2fd09b[_0x26c4('0x16')](_0x41643e)[_0x26c4('0x25')](_0x42ee4b);};}exports[_0x26c4('0x26')]=function(_0x1ff981,_0x4dd0bb){var _0x27b6c0={},_0x491f15={},_0x109965={'count':0x0,'rows':[]};var _0x4eb6aa=_[_0x26c4('0x27')](db['AnalyticFieldReport'][_0x26c4('0x28')],function(_0x1ec460){return{'name':_0x1ec460['fieldName'],'type':_0x1ec460['type']['key']};});_0x491f15['model']=_[_0x26c4('0x27')](_0x4eb6aa,_0x26c4('0x24'));_0x491f15['query']=_[_0x26c4('0x29')](_0x1ff981[_0x26c4('0x2a')]);_0x491f15[_0x26c4('0x2b')]=_[_0x26c4('0x2c')](_0x491f15[_0x26c4('0x2d')],_0x491f15['query']);_0x27b6c0['attributes']=_[_0x26c4('0x2c')](_0x491f15[_0x26c4('0x2d')],qs[_0x26c4('0x2e')](_0x1ff981[_0x26c4('0x2a')][_0x26c4('0x2e')]));_0x27b6c0[_0x26c4('0x2f')]=_0x27b6c0['attributes'][_0x26c4('0x30')]?_0x27b6c0['attributes']:_0x491f15[_0x26c4('0x2d')];if(!_0x1ff981[_0x26c4('0x2a')][_0x26c4('0x31')](_0x26c4('0x32'))){_0x27b6c0['limit']=qs[_0x26c4('0x1a')](_0x1ff981[_0x26c4('0x2a')][_0x26c4('0x1a')]);_0x27b6c0['offset']=qs['offset'](_0x1ff981[_0x26c4('0x2a')]['offset']);}_0x27b6c0[_0x26c4('0x33')]=qs[_0x26c4('0x34')](_0x1ff981['query']['sort']);_0x27b6c0[_0x26c4('0x35')]=qs[_0x26c4('0x2b')](_['pick'](_0x1ff981['query'],_0x491f15[_0x26c4('0x2b')]),_0x4eb6aa);if(_0x1ff981[_0x26c4('0x2a')][_0x26c4('0x36')]){_0x27b6c0[_0x26c4('0x35')]=_[_0x26c4('0x37')](_0x27b6c0[_0x26c4('0x35')],{'$or':_[_0x26c4('0x27')](_0x4eb6aa,function(_0x177d8d){if(_0x177d8d['type']!==_0x26c4('0x38')){var _0x397248={};_0x397248[_0x177d8d['name']]={'$like':'%'+_0x1ff981[_0x26c4('0x2a')]['filter']+'%'};return _0x397248;}})});}_0x27b6c0=_[_0x26c4('0x37')]({},_0x27b6c0,_0x1ff981[_0x26c4('0x39')]);var _0x47e11f={'where':_0x27b6c0[_0x26c4('0x35')]};return db['AnalyticFieldReport'][_0x26c4('0x1b')](_0x47e11f)[_0x26c4('0x22')](function(_0x39c2e9){_0x109965[_0x26c4('0x1b')]=_0x39c2e9;if(_0x1ff981[_0x26c4('0x2a')][_0x26c4('0x3a')]){_0x27b6c0['include']=[{'all':!![]}];}return db[_0x26c4('0x3b')][_0x26c4('0x3c')](_0x27b6c0);})[_0x26c4('0x22')](function(_0x42b7ba){_0x109965[_0x26c4('0x3d')]=_0x42b7ba;return _0x109965;})[_0x26c4('0x22')](respondWithFilteredResult(_0x4dd0bb,_0x27b6c0))[_0x26c4('0x3e')](handleError(_0x4dd0bb,null));};exports[_0x26c4('0x3f')]=function(_0x23b925,_0xb77ca9){var _0x470ac7={'raw':![],'where':{'id':_0x23b925['params']['id']}},_0x23c0d8={};_0x23c0d8['model']=_['keys'](db['AnalyticFieldReport'][_0x26c4('0x28')]);_0x23c0d8[_0x26c4('0x2a')]=_[_0x26c4('0x29')](_0x23b925[_0x26c4('0x2a')]);_0x23c0d8['filters']=_[_0x26c4('0x2c')](_0x23c0d8['model'],_0x23c0d8['query']);_0x470ac7[_0x26c4('0x2f')]=_[_0x26c4('0x2c')](_0x23c0d8[_0x26c4('0x2d')],qs[_0x26c4('0x2e')](_0x23b925[_0x26c4('0x2a')][_0x26c4('0x2e')]));_0x470ac7[_0x26c4('0x2f')]=_0x470ac7[_0x26c4('0x2f')]['length']?_0x470ac7[_0x26c4('0x2f')]:_0x23c0d8[_0x26c4('0x2d')];if(_0x23b925[_0x26c4('0x2a')][_0x26c4('0x3a')]){_0x470ac7['include']=[{'all':!![]}];}_0x470ac7=_[_0x26c4('0x37')]({},_0x470ac7,_0x23b925['options']);return db[_0x26c4('0x3b')][_0x26c4('0x40')](_0x470ac7)['then'](handleEntityNotFound(_0xb77ca9,null))[_0x26c4('0x22')](respondWithResult(_0xb77ca9,null))[_0x26c4('0x3e')](handleError(_0xb77ca9,null));};exports[_0x26c4('0x41')]=function(_0x2d4981,_0x20daba){return db['AnalyticFieldReport'][_0x26c4('0x41')](_0x2d4981[_0x26c4('0x42')],{})[_0x26c4('0x22')](respondWithResult(_0x20daba,0xc9))[_0x26c4('0x3e')](handleError(_0x20daba,null));};exports[_0x26c4('0x43')]=function(_0x2701e2,_0x5a0dad){return db[_0x26c4('0x3b')][_0x26c4('0x43')](_0x2701e2[_0x26c4('0x42')],{'raw':![],'individualHooks':!![]})[_0x26c4('0x22')](respondWithResult(_0x5a0dad,0xc9))[_0x26c4('0x3e')](handleError(_0x5a0dad,null));};exports[_0x26c4('0x21')]=function(_0x28ceb2,_0xca0888){if(_0x28ceb2[_0x26c4('0x42')]['id']){delete _0x28ceb2[_0x26c4('0x42')]['id'];}return db[_0x26c4('0x3b')]['find']({'where':{'id':_0x28ceb2[_0x26c4('0x44')]['id']}})[_0x26c4('0x22')](handleEntityNotFound(_0xca0888,null))[_0x26c4('0x22')](saveUpdates(_0x28ceb2['body'],null))[_0x26c4('0x22')](respondWithResult(_0xca0888,null))[_0x26c4('0x3e')](handleError(_0xca0888,null));};exports[_0x26c4('0x23')]=function(_0x4927fb,_0x1f5976){return db[_0x26c4('0x3b')]['find']({'where':{'id':_0x4927fb[_0x26c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5976,null))[_0x26c4('0x22')](removeEntity(_0x1f5976,null))[_0x26c4('0x3e')](handleError(_0x1f5976,null));};exports[_0x26c4('0x45')]=function(_0x3c9efb,_0x183459){return db['AnalyticFieldReport'][_0x26c4('0x23')]({'where':{'id':_0x3c9efb[_0x26c4('0x2a')][_0x26c4('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x26c4('0x22')](respondWithResult(_0x183459,0xcc))[_0x26c4('0x3e')](handleError(_0x183459,null));};exports['addFields']=function(_0x31ea30,_0x54df94,_0x28e6f6){return db[_0x26c4('0x47')][_0x26c4('0x48')]({'where':{'id':_0x31ea30[_0x26c4('0x44')]['id']}})[_0x26c4('0x22')](handleEntityNotFound(_0x54df94,null))[_0x26c4('0x22')](function(_0x5de481){if(_0x5de481){return db[_0x26c4('0x49')]['transaction'](function(_0x528e27){return db['AnalyticFieldReport'][_0x26c4('0x23')]({'where':{'CustomReportId':_0x31ea30[_0x26c4('0x44')]['id']},'transaction':_0x528e27})[_0x26c4('0x22')](function(_0xc62043){var _0x4e405d=_[_0x26c4('0x27')](_0x31ea30[_0x26c4('0x42')],function(_0x383056){delete _0x383056['id'];_0x383056[_0x26c4('0x4a')]=_0x31ea30[_0x26c4('0x44')]['id'];return _0x383056;});return db[_0x26c4('0x3b')][_0x26c4('0x43')](_0x4e405d,{'transaction':_0x528e27});});})[_0x26c4('0x22')](function(){return db['AnalyticFieldReport'][_0x26c4('0x3c')]({'where':{'CustomReportId':_0x31ea30['params']['id']}});});}})['then'](respondWithResult(_0x54df94,null))[_0x26c4('0x3e')](handleError(_0x54df94,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fd92556..4eb51fa 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 _0x6d8d=['api','moment','bluebird','path','../../config/environment','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x1efc3a,_0x1ca4ce){var _0x176fb1=function(_0x467fe6){while(--_0x467fe6){_0x1efc3a['push'](_0x1efc3a['shift']());}};_0x176fb1(++_0x1ca4ce);}(_0x6d8d,0x9f));var _0xd6d8=function(_0x18b5e2,_0x230b5f){_0x18b5e2=_0x18b5e2-0x0;var _0x257006=_0x6d8d[_0x18b5e2];return _0x257006;};'use strict';var _=require(_0xd6d8('0x0'));var util=require(_0xd6d8('0x1'));var logger=require(_0xd6d8('0x2'))(_0xd6d8('0x3'));var moment=require(_0xd6d8('0x4'));var BPromise=require(_0xd6d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6d8('0x6'));var rimraf=require('rimraf');var config=require(_0xd6d8('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x11a0e4,_0x5a1752){return _0x11a0e4['define'](_0xd6d8('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3405=['moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','analytics_report_fields','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3405,0x1b7));var _0x5340=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x3405[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x5340('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5340('0x1'));var BPromise=require(_0x5340('0x2'));var rp=require(_0x5340('0x3'));var fs=require('fs');var path=require(_0x5340('0x4'));var rimraf=require('rimraf');var config=require(_0x5340('0x5'));var attributes=require(_0x5340('0x6'));module['exports']=function(_0x59d585,_0x25d1ef){return _0x59d585['define']('AnalyticFieldReport',attributes,{'tableName':_0x5340('0x7'),'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 985ff88..2c87d2e 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 _0x2250=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2250,0x164));var _0x0225=function(_0x46dab8,_0x4ef8ed){_0x46dab8=_0x46dab8-0x0;var _0x3d1e3a=_0x2250[_0x46dab8];return _0x3d1e3a;};'use strict';var _=require(_0x0225('0x0'));var util=require('util');var moment=require(_0x0225('0x1'));var BPromise=require(_0x0225('0x2'));var rs=require(_0x0225('0x3'));var fs=require('fs');var Redis=require(_0x0225('0x4'));var db=require(_0x0225('0x5'))['db'];var utils=require(_0x0225('0x6'));var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0225('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b2636,_0x66dc2c,_0x5b8b46){return new BPromise(function(_0x3b4d8d,_0x32f80d){return client[_0x0225('0xb')](_0x7b2636,_0x5b8b46)[_0x0225('0xc')](function(_0x90bda2){logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,'request\x20sent');logger[_0x0225('0xf')](_0x0225('0x10'),_0x66dc2c,_0x0225('0x11'),JSON[_0x0225('0x12')](_0x90bda2));if(_0x90bda2[_0x0225('0x13')]){if(_0x90bda2[_0x0225('0x13')][_0x0225('0x14')]===0x1f4){logger[_0x0225('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x32f80d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}logger['error'](_0x0225('0xe'),_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x3b4d8d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,_0x0225('0x11'));_0x3b4d8d(_0x90bda2[_0x0225('0x16')][_0x0225('0x15')]);}})[_0x0225('0x17')](function(_0x3b1a54){logger[_0x0225('0x13')](_0x0225('0xe'),_0x66dc2c,_0x3b1a54);_0x32f80d(_0x3b1a54);});});} \ No newline at end of file +var _0xfab7=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x4d6298,_0x502f6b){var _0x57ccf0=function(_0x3cef94){while(--_0x3cef94){_0x4d6298['push'](_0x4d6298['shift']());}};_0x57ccf0(++_0x502f6b);}(_0xfab7,0x193));var _0x7fab=function(_0x3a1d75,_0x54e3e1){_0x3a1d75=_0x3a1d75-0x0;var _0x48abb8=_0xfab7[_0x3a1d75];return _0x48abb8;};'use strict';var _=require('lodash');var util=require(_0x7fab('0x0'));var moment=require(_0x7fab('0x1'));var BPromise=require(_0x7fab('0x2'));var rs=require(_0x7fab('0x3'));var fs=require('fs');var Redis=require(_0x7fab('0x4'));var db=require(_0x7fab('0x5'))['db'];var utils=require(_0x7fab('0x6'));var logger=require('../../config/logger')(_0x7fab('0x7'));var config=require(_0x7fab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x234ddf,_0x283ecd,_0x4464fc){return new BPromise(function(_0x91f69d,_0x2d2ae1){return client[_0x7fab('0xa')](_0x234ddf,_0x4464fc)[_0x7fab('0xb')](function(_0x2b7f38){logger[_0x7fab('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x283ecd,_0x7fab('0xd'));logger[_0x7fab('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x283ecd,_0x7fab('0xd'),JSON[_0x7fab('0xf')](_0x2b7f38));if(_0x2b7f38[_0x7fab('0x10')]){if(_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x11')]===0x1f4){logger[_0x7fab('0x10')](_0x7fab('0x12'),_0x283ecd,_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);return _0x2d2ae1(_0x2b7f38['error']['message']);}logger['error'](_0x7fab('0x12'),_0x283ecd,_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);return _0x91f69d(_0x2b7f38[_0x7fab('0x10')][_0x7fab('0x13')]);}else{logger['info'](_0x7fab('0x12'),_0x283ecd,_0x7fab('0xd'));_0x91f69d(_0x2b7f38['result'][_0x7fab('0x13')]);}})[_0x7fab('0x14')](function(_0x5227c0){logger[_0x7fab('0x10')](_0x7fab('0x12'),_0x283ecd,_0x5227c0);_0x2d2ae1(_0x5227c0);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1519dd6..2e300b3 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(_0x3283db,_0x41b09d){var _0x10c62f=function(_0x574c9f){while(--_0x574c9f){_0x3283db['push'](_0x3283db['shift']());}};_0x10c62f(++_0x41b09d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x20bf44,_0x159acc){var _0x4543b1=function(_0x1fe631){while(--_0x1fe631){_0x20bf44['push'](_0x20bf44['shift']());}};_0x4543b1(++_0x159acc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 31a3659..d384a3f 100644 --- a/server/api/analyticMetric/analyticMetric.attributes.js +++ b/server/api/analyticMetric/analyticMetric.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ba2=['exports','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ba2,0x13f));var _0x28ba=function(_0x34288e,_0x23b339){_0x34288e=_0x34288e-0x0;var _0x21f500=_0x8ba2[_0x34288e];return _0x21f500;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'name':{'type':Sequelize[_0x28ba('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x28ba('0x2')]},'metric':{'type':Sequelize[_0x28ba('0x3')]},'description':{'type':Sequelize[_0x28ba('0x2')]}}; \ No newline at end of file +var _0x9434=['sequelize','exports','STRING','name','TEXT'];(function(_0x53724f,_0x127ee4){var _0x4b280c=function(_0x552b18){while(--_0x552b18){_0x53724f['push'](_0x53724f['shift']());}};_0x4b280c(++_0x127ee4);}(_0x9434,0x168));var _0x4943=function(_0xed89bd,_0x524322){_0xed89bd=_0xed89bd-0x0;var _0x9632b6=_0x9434[_0xed89bd];return _0x9632b6;};'use strict';var Sequelize=require(_0x4943('0x0'));module[_0x4943('0x1')]={'name':{'type':Sequelize[_0x4943('0x2')],'allowNull':![],'unique':_0x4943('0x3')},'table':{'type':Sequelize[_0x4943('0x2')]},'metric':{'type':Sequelize[_0x4943('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a25bbf4..f9211b0 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x55b14c,_0x56803e){var _0x48e104=function(_0xe98e28){while(--_0xe98e28){_0x55b14c['push'](_0x55b14c['shift']());}};_0x48e104(++_0x56803e);}(_0x425d,0x1e0));var _0xd425=function(_0x491001,_0x2e13ee){_0x491001=_0x491001-0x0;var _0x2971ef=_0x425d[_0x491001];return _0x2971ef;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file +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(_0x4a0b86,_0x484fa8){var _0x37ee69=function(_0x262e2f){while(--_0x262e2f){_0x4a0b86['push'](_0x4a0b86['shift']());}};_0x37ee69(++_0x484fa8);}(_0x3e74,0x175));var _0x43e7=function(_0x24069b,_0x3b48a5){_0x24069b=_0x24069b-0x0;var _0x358cf1=_0x3e74[_0x24069b];return _0x358cf1;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0c1c4a6..0baa656 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 _0x4819=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0x886924,_0x1f6adf){var _0x1ba368=function(_0x45eff4){while(--_0x45eff4){_0x886924['push'](_0x886924['shift']());}};_0x1ba368(++_0x1f6adf);}(_0x4819,0xcd));var _0x9481=function(_0x4ad6e4,_0x103161){_0x4ad6e4=_0x4ad6e4-0x0;var _0x11e62a=_0x4819[_0x4ad6e4];return _0x11e62a;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd05=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','moment','bluebird','request-promise','path'];(function(_0x4782eb,_0x1dafc9){var _0x9f1353=function(_0x1b74b4){while(--_0x1b74b4){_0x4782eb['push'](_0x4782eb['shift']());}};_0x9f1353(++_0x1dafc9);}(_0xcd05,0x163));var _0x5cd0=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0xcd05[_0xa4c85];return _0x172c1f;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5cd0('0x1'));var BPromise=require(_0x5cd0('0x2'));var rp=require(_0x5cd0('0x3'));var fs=require('fs');var path=require(_0x5cd0('0x4'));var rimraf=require('rimraf');var config=require(_0x5cd0('0x5'));var attributes=require(_0x5cd0('0x6'));module['exports']=function(_0x47c141,_0x4eea17){return _0x47c141[_0x5cd0('0x7')](_0x5cd0('0x8'),attributes,{'tableName':_0x5cd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 5b62bc3..a43c456 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 _0xcfd9=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3e9c2c,_0x2d5157){var _0x1ad468=function(_0x344b06){while(--_0x344b06){_0x3e9c2c['push'](_0x3e9c2c['shift']());}};_0x1ad468(++_0x2d5157);}(_0xcfd9,0xea));var _0x9cfd=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0xcfd9[_0x4ec520];return _0xed49d7;};'use strict';var _=require(_0x9cfd('0x0'));var util=require(_0x9cfd('0x1'));var moment=require('moment');var BPromise=require(_0x9cfd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cfd('0x3'));var db=require(_0x9cfd('0x4'))['db'];var utils=require(_0x9cfd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9cfd('0x6'));var jayson=require(_0x9cfd('0x7'));var client=jayson['client'][_0x9cfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x146937,_0x569f90,_0x2f9386){return new BPromise(function(_0x287d8b,_0x440fc8){return client[_0x9cfd('0x9')](_0x146937,_0x2f9386)[_0x9cfd('0xa')](function(_0x5dcb66){logger[_0x9cfd('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));logger[_0x9cfd('0xd')](_0x9cfd('0xe'),_0x569f90,_0x9cfd('0xc'),JSON['stringify'](_0x5dcb66));if(_0x5dcb66[_0x9cfd('0xf')]){if(_0x5dcb66['error'][_0x9cfd('0x10')]===0x1f4){logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66['error']['message']);return _0x440fc8(_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);}logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);return _0x287d8b(_0x5dcb66['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));_0x287d8b(_0x5dcb66[_0x9cfd('0x13')]['message']);}})[_0x9cfd('0x14')](function(_0x28b8dd){logger[_0x9cfd('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x28b8dd);_0x440fc8(_0x28b8dd);});});} \ No newline at end of file +var _0xf2b0=['../../config/environment','jayson/promise','client','http','then','debug','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x242575,_0x57a331){var _0x2ff352=function(_0x2bb24b){while(--_0x2bb24b){_0x242575['push'](_0x242575['shift']());}};_0x2ff352(++_0x57a331);}(_0xf2b0,0x1b1));var _0x0f2b=function(_0x48ef06,_0x3ce392){_0x48ef06=_0x48ef06-0x0;var _0x1e783b=_0xf2b0[_0x48ef06];return _0x1e783b;};'use strict';var _=require(_0x0f2b('0x0'));var util=require(_0x0f2b('0x1'));var moment=require('moment');var BPromise=require(_0x0f2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f2b('0x3'));var db=require(_0x0f2b('0x4'))['db'];var utils=require(_0x0f2b('0x5'));var logger=require(_0x0f2b('0x6'))(_0x0f2b('0x7'));var config=require(_0x0f2b('0x8'));var jayson=require(_0x0f2b('0x9'));var client=jayson[_0x0f2b('0xa')][_0x0f2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43fb70,_0x5acb85,_0x1e6399){return new BPromise(function(_0x46d267,_0x348fc7){return client['request'](_0x43fb70,_0x1e6399)[_0x0f2b('0xc')](function(_0x36def9){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5acb85,'request\x20sent');logger[_0x0f2b('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5acb85,_0x0f2b('0xe'),JSON[_0x0f2b('0xf')](_0x36def9));if(_0x36def9[_0x0f2b('0x10')]){if(_0x36def9[_0x0f2b('0x10')][_0x0f2b('0x11')]===0x1f4){logger[_0x0f2b('0x10')](_0x0f2b('0x12'),_0x5acb85,_0x36def9[_0x0f2b('0x10')]['message']);return _0x348fc7(_0x36def9[_0x0f2b('0x10')][_0x0f2b('0x13')]);}logger[_0x0f2b('0x10')](_0x0f2b('0x12'),_0x5acb85,_0x36def9[_0x0f2b('0x10')]['message']);return _0x46d267(_0x36def9['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5acb85,_0x0f2b('0xe'));_0x46d267(_0x36def9['result'][_0x0f2b('0x13')]);}})[_0x0f2b('0x14')](function(_0x1abf88){logger[_0x0f2b('0x10')](_0x0f2b('0x12'),_0x5acb85,_0x1abf88);_0x348fc7(_0x1abf88);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0b8e958..0ffe981 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 _0x5b7f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x12c90c,_0x29c6d7){_0x12c90c=_0x12c90c-0x0;var _0x14f0f5=_0x5b7f[_0x12c90c];return _0x14f0f5;};'use strict';var multer=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var path=require(_0xf5b7('0x2'));var timeout=require(_0xf5b7('0x3'));var express=require(_0xf5b7('0x4'));var router=express[_0xf5b7('0x5')]();var fs_extra=require(_0xf5b7('0x6'));var auth=require(_0xf5b7('0x7'));var interaction=require(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var controller=require(_0xf5b7('0xa'));router[_0xf5b7('0xb')]('/',auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xd')]);router[_0xf5b7('0xb')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf5b7('0x10')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x11')]);router[_0xf5b7('0x12')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x13')]);module[_0xf5b7('0x14')]=router; \ No newline at end of file +var _0xce1a=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','put','update','exports','multer','express','Router','fs-extra'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xce1a,0xbf));var _0xace1=function(_0x1b7aa2,_0x570bf6){_0x1b7aa2=_0x1b7aa2-0x0;var _0x5ad2c8=_0xce1a[_0x1b7aa2];return _0x5ad2c8;};'use strict';var multer=require(_0xace1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xace1('0x1'));var router=express[_0xace1('0x2')]();var fs_extra=require(_0xace1('0x3'));var auth=require(_0xace1('0x4'));var interaction=require(_0xace1('0x5'));var config=require('../../config/environment');var controller=require(_0xace1('0x6'));router['get']('/',auth[_0xace1('0x7')](),controller['index']);router[_0xace1('0x8')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['show']);router['post']('/',auth[_0xace1('0x7')](),controller['create']);router[_0xace1('0xa')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller[_0xace1('0xb')]);router['delete'](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['destroy']);module[_0xace1('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ab72a91..a8c1693 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 _0x42e5=['TEXT'];(function(_0x5a750a,_0x30d794){var _0x21335d=function(_0x4241c1){while(--_0x4241c1){_0x5a750a['push'](_0x5a750a['shift']());}};_0x21335d(++_0x30d794);}(_0x42e5,0x113));var _0x542e=function(_0x206487,_0x28eec1){_0x206487=_0x206487-0x0;var _0x2714c7=_0x42e5[_0x206487];return _0x2714c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x542e('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9de5=['exports','sequelize'];(function(_0x1d4712,_0x4156e6){var _0x5ef8ec=function(_0x421374){while(--_0x421374){_0x1d4712['push'](_0x1d4712['shift']());}};_0x5ef8ec(++_0x4156e6);}(_0x9de5,0x169));var _0x59de=function(_0x21ab2c,_0x7cf04a){_0x21ab2c=_0x21ab2c-0x0;var _0x25ad1f=_0x9de5[_0x21ab2c];return _0x25ad1f;};'use strict';var Sequelize=require(_0x59de('0x0'));module[_0x59de('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 37edadd..6b2c371 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 _0xeaac=['update','then','destroy','end','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','find','create','body','params','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','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0xeaac,0x1ed));var _0xceaa=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xeaac[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0xceaa('0x0'));var rimraf=require(_0xceaa('0x1'));var zipdir=require(_0xceaa('0x2'));var jsonpatch=require(_0xceaa('0x3'));var rp=require(_0xceaa('0x4'));var moment=require(_0xceaa('0x5'));var BPromise=require(_0xceaa('0x6'));var Mustache=require(_0xceaa('0x7'));var util=require(_0xceaa('0x8'));var path=require(_0xceaa('0x9'));var sox=require(_0xceaa('0xa'));var csv=require(_0xceaa('0xb'));var ejs=require(_0xceaa('0xc'));var fs=require('fs');var fs_extra=require(_0xceaa('0xd'));var _=require(_0xceaa('0xe'));var squel=require(_0xceaa('0xf'));var crypto=require(_0xceaa('0x10'));var jsforce=require(_0xceaa('0x11'));var deskjs=require(_0xceaa('0x12'));var toCsv=require(_0xceaa('0xb'));var querystring=require(_0xceaa('0x13'));var Papa=require('papaparse');var Redis=require(_0xceaa('0x14'));var authService=require(_0xceaa('0x15'));var qs=require(_0xceaa('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceaa('0x17'));var logger=require(_0xceaa('0x18'))(_0xceaa('0x19'));var utils=require(_0xceaa('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xceaa('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6d904,_0x58077a){_0x58077a=_0x58077a||0xcc;return function(_0x4be3b9){if(_0x4be3b9){return _0xe6d904[_0xceaa('0x1c')](_0x58077a);}return _0xe6d904[_0xceaa('0x1d')](_0x58077a)['end']();};}function respondWithResult(_0x284377,_0x5ecd7b){_0x5ecd7b=_0x5ecd7b||0xc8;return function(_0x3d524e){if(_0x3d524e){return _0x284377[_0xceaa('0x1d')](_0x5ecd7b)['json'](_0x3d524e);}};}function respondWithFilteredResult(_0x4131ce,_0x1204d6){return function(_0x303cf5){if(_0x303cf5){var _0xa2d1de=typeof _0x1204d6[_0xceaa('0x1e')]==='undefined'&&typeof _0x1204d6[_0xceaa('0x1f')]===_0xceaa('0x20');var _0x5868fe=_0x303cf5[_0xceaa('0x21')];var _0x5af760=_0xa2d1de?0x0:_0x1204d6[_0xceaa('0x1e')];var _0x243e84=_0xa2d1de?_0x303cf5['count']:_0x1204d6['offset']+_0x1204d6[_0xceaa('0x1f')];var _0x3ec336;if(_0x243e84>=_0x5868fe){_0x243e84=_0x5868fe;_0x3ec336=0xc8;}else{_0x3ec336=0xce;}_0x4131ce[_0xceaa('0x1d')](_0x3ec336);return _0x4131ce[_0xceaa('0x22')](_0xceaa('0x23'),_0x5af760+'-'+_0x243e84+'/'+_0x5868fe)['json'](_0x303cf5);}return null;};}function patchUpdates(_0x25a5ad){return function(_0x48247d){try{jsonpatch[_0xceaa('0x24')](_0x48247d,_0x25a5ad,!![]);}catch(_0x6705bf){return BPromise[_0xceaa('0x25')](_0x6705bf);}return _0x48247d[_0xceaa('0x26')]();};}function saveUpdates(_0x8c407,_0xc53c3d){return function(_0x17d429){if(_0x17d429){return _0x17d429[_0xceaa('0x27')](_0x8c407)[_0xceaa('0x28')](function(_0x1c7524){return _0x1c7524;});}return null;};}function removeEntity(_0x2ab129,_0x24342e){return function(_0x59429a){if(_0x59429a){return _0x59429a[_0xceaa('0x29')]()[_0xceaa('0x28')](function(){_0x2ab129['status'](0xcc)[_0xceaa('0x2a')]();});}};}function handleEntityNotFound(_0x1fe4c3,_0x4f6428){return function(_0x3640ee){if(!_0x3640ee){_0x1fe4c3['sendStatus'](0x194);}return _0x3640ee;};}function handleError(_0x2e3f5d,_0x3f081f){_0x3f081f=_0x3f081f||0x1f4;return function(_0x8653c1){logger[_0xceaa('0x2b')](_0x8653c1['stack']);if(_0x8653c1[_0xceaa('0x2c')]){delete _0x8653c1[_0xceaa('0x2c')];}_0x2e3f5d[_0xceaa('0x1d')](_0x3f081f)['send'](_0x8653c1);};}exports[_0xceaa('0x2d')]=function(_0x19a3a3,_0x461ac9){var _0x5081cf={},_0x517fb5={},_0x5d34c4={'count':0x0,'rows':[]};var _0x10f133=_[_0xceaa('0x2e')](db[_0xceaa('0x2f')][_0xceaa('0x30')],function(_0x1cddee){return{'name':_0x1cddee[_0xceaa('0x31')],'type':_0x1cddee[_0xceaa('0x32')][_0xceaa('0x33')]};});_0x517fb5[_0xceaa('0x34')]=_['map'](_0x10f133,'name');_0x517fb5['query']=_[_0xceaa('0x35')](_0x19a3a3[_0xceaa('0x36')]);_0x517fb5[_0xceaa('0x37')]=_[_0xceaa('0x38')](_0x517fb5[_0xceaa('0x34')],_0x517fb5[_0xceaa('0x36')]);_0x5081cf[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x517fb5['model'],qs[_0xceaa('0x3a')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x5081cf[_0xceaa('0x39')]=_0x5081cf[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x5081cf[_0xceaa('0x39')]:_0x517fb5['model'];if(!_0x19a3a3[_0xceaa('0x36')]['hasOwnProperty'](_0xceaa('0x3c'))){_0x5081cf[_0xceaa('0x1f')]=qs[_0xceaa('0x1f')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1f')]);_0x5081cf[_0xceaa('0x1e')]=qs[_0xceaa('0x1e')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1e')]);}_0x5081cf[_0xceaa('0x3d')]=qs['sort'](_0x19a3a3['query'][_0xceaa('0x3e')]);_0x5081cf[_0xceaa('0x3f')]=qs[_0xceaa('0x37')](_[_0xceaa('0x40')](_0x19a3a3[_0xceaa('0x36')],_0x517fb5[_0xceaa('0x37')]),_0x10f133);if(_0x19a3a3['query'][_0xceaa('0x41')]){_0x5081cf[_0xceaa('0x3f')]=_['merge'](_0x5081cf[_0xceaa('0x3f')],{'$or':_[_0xceaa('0x2e')](_0x10f133,function(_0x34764f){if(_0x34764f[_0xceaa('0x32')]!=='VIRTUAL'){var _0x18c4e8={};_0x18c4e8[_0x34764f[_0xceaa('0x2c')]]={'$like':'%'+_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x41')]+'%'};return _0x18c4e8;}})});}_0x5081cf=_[_0xceaa('0x42')]({},_0x5081cf,_0x19a3a3[_0xceaa('0x43')]);var _0x4b1ea6={'where':_0x5081cf[_0xceaa('0x3f')]};return db[_0xceaa('0x2f')][_0xceaa('0x21')](_0x4b1ea6)[_0xceaa('0x28')](function(_0x4ebc3e){_0x5d34c4['count']=_0x4ebc3e;if(_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x44')]){_0x5081cf[_0xceaa('0x45')]=[{'all':!![]}];}return db[_0xceaa('0x2f')]['findAll'](_0x5081cf);})[_0xceaa('0x28')](function(_0xaf4604){_0x5d34c4['rows']=_0xaf4604;return _0x5d34c4;})['then'](respondWithFilteredResult(_0x461ac9,_0x5081cf))[_0xceaa('0x46')](handleError(_0x461ac9,null));};exports[_0xceaa('0x47')]=function(_0x329d6f,_0x34837f){var _0x42c2bb={'raw':!![],'where':{'id':_0x329d6f['params']['id']}},_0x3ca437={};_0x3ca437[_0xceaa('0x34')]=_[_0xceaa('0x35')](db[_0xceaa('0x2f')][_0xceaa('0x30')]);_0x3ca437[_0xceaa('0x36')]=_['keys'](_0x329d6f[_0xceaa('0x36')]);_0x3ca437['filters']=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],_0x3ca437[_0xceaa('0x36')]);_0x42c2bb[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],qs['fields'](_0x329d6f[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x42c2bb[_0xceaa('0x39')]=_0x42c2bb[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x42c2bb[_0xceaa('0x39')]:_0x3ca437[_0xceaa('0x34')];if(_0x329d6f[_0xceaa('0x36')][_0xceaa('0x44')]){_0x42c2bb[_0xceaa('0x45')]=[{'all':!![]}];}_0x42c2bb=_[_0xceaa('0x42')]({},_0x42c2bb,_0x329d6f[_0xceaa('0x43')]);return db[_0xceaa('0x2f')][_0xceaa('0x48')](_0x42c2bb)[_0xceaa('0x28')](handleEntityNotFound(_0x34837f,null))['then'](respondWithResult(_0x34837f,null))[_0xceaa('0x46')](handleError(_0x34837f,null));};exports[_0xceaa('0x49')]=function(_0x3beb82,_0x45a588){return db[_0xceaa('0x2f')][_0xceaa('0x49')](_0x3beb82[_0xceaa('0x4a')],{})['then'](respondWithResult(_0x45a588,0xc9))[_0xceaa('0x46')](handleError(_0x45a588,null));};exports[_0xceaa('0x27')]=function(_0xc84f9f,_0x222e91){if(_0xc84f9f[_0xceaa('0x4a')]['id']){delete _0xc84f9f[_0xceaa('0x4a')]['id'];}return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0xc84f9f[_0xceaa('0x4b')]['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x222e91,null))['then'](saveUpdates(_0xc84f9f[_0xceaa('0x4a')],null))[_0xceaa('0x28')](respondWithResult(_0x222e91,null))['catch'](handleError(_0x222e91,null));};exports[_0xceaa('0x29')]=function(_0x2466b6,_0x144374){return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0x2466b6['params']['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x144374,null))[_0xceaa('0x28')](removeEntity(_0x144374,null))[_0xceaa('0x46')](handleError(_0x144374,null));}; \ No newline at end of file +var _0x117b=['intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','then','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters'];(function(_0xd6e343,_0x41a619){var _0x5c0e4a=function(_0x2a8e6a){while(--_0x2a8e6a){_0xd6e343['push'](_0xd6e343['shift']());}};_0x5c0e4a(++_0x41a619);}(_0x117b,0x1e8));var _0xb117=function(_0x53288a,_0x4182de){_0x53288a=_0x53288a-0x0;var _0x17a80d=_0x117b[_0x53288a];return _0x17a80d;};'use strict';var emlformat=require(_0xb117('0x0'));var rimraf=require(_0xb117('0x1'));var zipdir=require(_0xb117('0x2'));var jsonpatch=require(_0xb117('0x3'));var rp=require(_0xb117('0x4'));var moment=require(_0xb117('0x5'));var BPromise=require(_0xb117('0x6'));var Mustache=require(_0xb117('0x7'));var util=require(_0xb117('0x8'));var path=require('path');var sox=require(_0xb117('0x9'));var csv=require(_0xb117('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb117('0xb'));var _=require(_0xb117('0xc'));var squel=require(_0xb117('0xd'));var crypto=require(_0xb117('0xe'));var jsforce=require(_0xb117('0xf'));var deskjs=require(_0xb117('0x10'));var toCsv=require(_0xb117('0xa'));var querystring=require('querystring');var Papa=require(_0xb117('0x11'));var Redis=require('ioredis');var authService=require(_0xb117('0x12'));var qs=require(_0xb117('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb117('0x14'));var logger=require('../../config/logger')(_0xb117('0x15'));var utils=require(_0xb117('0x16'));var config=require(_0xb117('0x17'));var licenseUtil=require(_0xb117('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18126b,_0x1811e9){_0x1811e9=_0x1811e9||0xcc;return function(_0x4239af){if(_0x4239af){return _0x18126b[_0xb117('0x19')](_0x1811e9);}return _0x18126b[_0xb117('0x1a')](_0x1811e9)[_0xb117('0x1b')]();};}function respondWithResult(_0x224b7b,_0x2c0e39){_0x2c0e39=_0x2c0e39||0xc8;return function(_0x3c6ba5){if(_0x3c6ba5){return _0x224b7b['status'](_0x2c0e39)[_0xb117('0x1c')](_0x3c6ba5);}};}function respondWithFilteredResult(_0x50ddb7,_0x3bff3b){return function(_0x298cf3){if(_0x298cf3){var _0xf255d2=typeof _0x3bff3b['offset']===_0xb117('0x1d')&&typeof _0x3bff3b[_0xb117('0x1e')]===_0xb117('0x1d');var _0x9dfc93=_0x298cf3[_0xb117('0x1f')];var _0x359ce7=_0xf255d2?0x0:_0x3bff3b[_0xb117('0x20')];var _0x408bbc=_0xf255d2?_0x298cf3[_0xb117('0x1f')]:_0x3bff3b[_0xb117('0x20')]+_0x3bff3b[_0xb117('0x1e')];var _0x265306;if(_0x408bbc>=_0x9dfc93){_0x408bbc=_0x9dfc93;_0x265306=0xc8;}else{_0x265306=0xce;}_0x50ddb7[_0xb117('0x1a')](_0x265306);return _0x50ddb7[_0xb117('0x21')](_0xb117('0x22'),_0x359ce7+'-'+_0x408bbc+'/'+_0x9dfc93)[_0xb117('0x1c')](_0x298cf3);}return null;};}function patchUpdates(_0x714de1){return function(_0x51f668){try{jsonpatch['apply'](_0x51f668,_0x714de1,!![]);}catch(_0x3eb6f6){return BPromise['reject'](_0x3eb6f6);}return _0x51f668[_0xb117('0x23')]();};}function saveUpdates(_0x57cb5b,_0x5c960f){return function(_0x50d9dd){if(_0x50d9dd){return _0x50d9dd[_0xb117('0x24')](_0x57cb5b)['then'](function(_0x1f0d23){return _0x1f0d23;});}return null;};}function removeEntity(_0x11be36,_0x3949b4){return function(_0x1b19ca){if(_0x1b19ca){return _0x1b19ca[_0xb117('0x25')]()['then'](function(){_0x11be36['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x652e0,_0x304756){return function(_0x10297a){if(!_0x10297a){_0x652e0[_0xb117('0x19')](0x194);}return _0x10297a;};}function handleError(_0xb10c0b,_0x35fe03){_0x35fe03=_0x35fe03||0x1f4;return function(_0x48dc1e){logger[_0xb117('0x26')](_0x48dc1e[_0xb117('0x27')]);if(_0x48dc1e[_0xb117('0x28')]){delete _0x48dc1e[_0xb117('0x28')];}_0xb10c0b[_0xb117('0x1a')](_0x35fe03)[_0xb117('0x29')](_0x48dc1e);};}exports[_0xb117('0x2a')]=function(_0x1a9340,_0x954e54){var _0x32ab93={},_0x4c0535={},_0x454933={'count':0x0,'rows':[]};var _0x2eb1fe=_['map'](db['AnalyticTreeReport'][_0xb117('0x2b')],function(_0xe047c4){return{'name':_0xe047c4[_0xb117('0x2c')],'type':_0xe047c4[_0xb117('0x2d')][_0xb117('0x2e')]};});_0x4c0535[_0xb117('0x2f')]=_[_0xb117('0x30')](_0x2eb1fe,_0xb117('0x28'));_0x4c0535['query']=_[_0xb117('0x31')](_0x1a9340['query']);_0x4c0535[_0xb117('0x32')]=_[_0xb117('0x33')](_0x4c0535['model'],_0x4c0535['query']);_0x32ab93[_0xb117('0x34')]=_[_0xb117('0x33')](_0x4c0535[_0xb117('0x2f')],qs[_0xb117('0x35')](_0x1a9340[_0xb117('0x36')][_0xb117('0x35')]));_0x32ab93['attributes']=_0x32ab93[_0xb117('0x34')]['length']?_0x32ab93['attributes']:_0x4c0535[_0xb117('0x2f')];if(!_0x1a9340[_0xb117('0x36')][_0xb117('0x37')](_0xb117('0x38'))){_0x32ab93[_0xb117('0x1e')]=qs[_0xb117('0x1e')](_0x1a9340[_0xb117('0x36')]['limit']);_0x32ab93[_0xb117('0x20')]=qs[_0xb117('0x20')](_0x1a9340[_0xb117('0x36')][_0xb117('0x20')]);}_0x32ab93[_0xb117('0x39')]=qs[_0xb117('0x3a')](_0x1a9340[_0xb117('0x36')][_0xb117('0x3a')]);_0x32ab93[_0xb117('0x3b')]=qs[_0xb117('0x32')](_[_0xb117('0x3c')](_0x1a9340[_0xb117('0x36')],_0x4c0535[_0xb117('0x32')]),_0x2eb1fe);if(_0x1a9340[_0xb117('0x36')][_0xb117('0x3d')]){_0x32ab93['where']=_[_0xb117('0x3e')](_0x32ab93[_0xb117('0x3b')],{'$or':_[_0xb117('0x30')](_0x2eb1fe,function(_0x4b9c06){if(_0x4b9c06[_0xb117('0x2d')]!==_0xb117('0x3f')){var _0x2bc23e={};_0x2bc23e[_0x4b9c06[_0xb117('0x28')]]={'$like':'%'+_0x1a9340[_0xb117('0x36')][_0xb117('0x3d')]+'%'};return _0x2bc23e;}})});}_0x32ab93=_['merge']({},_0x32ab93,_0x1a9340[_0xb117('0x40')]);var _0x40c662={'where':_0x32ab93[_0xb117('0x3b')]};return db[_0xb117('0x41')][_0xb117('0x1f')](_0x40c662)['then'](function(_0x4d546d){_0x454933[_0xb117('0x1f')]=_0x4d546d;if(_0x1a9340[_0xb117('0x36')][_0xb117('0x42')]){_0x32ab93[_0xb117('0x43')]=[{'all':!![]}];}return db[_0xb117('0x41')][_0xb117('0x44')](_0x32ab93);})[_0xb117('0x45')](function(_0x4d0cf6){_0x454933[_0xb117('0x46')]=_0x4d0cf6;return _0x454933;})[_0xb117('0x45')](respondWithFilteredResult(_0x954e54,_0x32ab93))['catch'](handleError(_0x954e54,null));};exports[_0xb117('0x47')]=function(_0x461558,_0xef69c0){var _0x2ee515={'raw':!![],'where':{'id':_0x461558[_0xb117('0x48')]['id']}},_0x81586a={};_0x81586a[_0xb117('0x2f')]=_[_0xb117('0x31')](db['AnalyticTreeReport'][_0xb117('0x2b')]);_0x81586a[_0xb117('0x36')]=_['keys'](_0x461558[_0xb117('0x36')]);_0x81586a[_0xb117('0x32')]=_['intersection'](_0x81586a['model'],_0x81586a[_0xb117('0x36')]);_0x2ee515[_0xb117('0x34')]=_['intersection'](_0x81586a[_0xb117('0x2f')],qs[_0xb117('0x35')](_0x461558[_0xb117('0x36')][_0xb117('0x35')]));_0x2ee515['attributes']=_0x2ee515[_0xb117('0x34')]['length']?_0x2ee515[_0xb117('0x34')]:_0x81586a[_0xb117('0x2f')];if(_0x461558[_0xb117('0x36')][_0xb117('0x42')]){_0x2ee515[_0xb117('0x43')]=[{'all':!![]}];}_0x2ee515=_[_0xb117('0x3e')]({},_0x2ee515,_0x461558[_0xb117('0x40')]);return db['AnalyticTreeReport'][_0xb117('0x49')](_0x2ee515)['then'](handleEntityNotFound(_0xef69c0,null))[_0xb117('0x45')](respondWithResult(_0xef69c0,null))['catch'](handleError(_0xef69c0,null));};exports[_0xb117('0x4a')]=function(_0x117746,_0x2c85ff){return db[_0xb117('0x41')][_0xb117('0x4a')](_0x117746[_0xb117('0x4b')],{})[_0xb117('0x45')](respondWithResult(_0x2c85ff,0xc9))[_0xb117('0x4c')](handleError(_0x2c85ff,null));};exports[_0xb117('0x24')]=function(_0x235965,_0x34bdbd){if(_0x235965[_0xb117('0x4b')]['id']){delete _0x235965['body']['id'];}return db[_0xb117('0x41')][_0xb117('0x49')]({'where':{'id':_0x235965[_0xb117('0x48')]['id']}})['then'](handleEntityNotFound(_0x34bdbd,null))[_0xb117('0x45')](saveUpdates(_0x235965[_0xb117('0x4b')],null))['then'](respondWithResult(_0x34bdbd,null))[_0xb117('0x4c')](handleError(_0x34bdbd,null));};exports[_0xb117('0x25')]=function(_0x5cdad9,_0x2293b){return db[_0xb117('0x41')][_0xb117('0x49')]({'where':{'id':_0x5cdad9[_0xb117('0x48')]['id']}})['then'](handleEntityNotFound(_0x2293b,null))['then'](removeEntity(_0x2293b,null))[_0xb117('0x4c')](handleError(_0x2293b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fc362c2..c931458 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 _0xbdba=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','AnalyticTreeReport'];(function(_0x442250,_0x7e4a9c){var _0x1ffde5=function(_0x1575aa){while(--_0x1575aa){_0x442250['push'](_0x442250['shift']());}};_0x1ffde5(++_0x7e4a9c);}(_0xbdba,0x161));var _0xabdb=function(_0x29daac,_0x3067e2){_0x29daac=_0x29daac-0x0;var _0x1f337f=_0xbdba[_0x29daac];return _0x1f337f;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var moment=require(_0xabdb('0x3'));var BPromise=require(_0xabdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabdb('0x5'));var rimraf=require(_0xabdb('0x6'));var config=require(_0xabdb('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5e933b,_0x167854){return _0x5e933b[_0xabdb('0x8')](_0xabdb('0x9'),attributes,{'tableName':_0xabdb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x768b=['define','lodash','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x228fdd,_0x1856fe){var _0x36ab64=function(_0x53b004){while(--_0x53b004){_0x228fdd['push'](_0x228fdd['shift']());}};_0x36ab64(++_0x1856fe);}(_0x768b,0x1b3));var _0xb768=function(_0x5bf28e,_0x41af9d){_0x5bf28e=_0x5bf28e-0x0;var _0x4317d3=_0x768b[_0x5bf28e];return _0x4317d3;};'use strict';var _=require(_0xb768('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb768('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb768('0x2'));var config=require(_0xb768('0x3'));var attributes=require(_0xb768('0x4'));module[_0xb768('0x5')]=function(_0x49ef4e,_0x48c706){return _0x49ef4e[_0xb768('0x6')]('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 dec5804..c07d399 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x35ffef,_0x416f48){_0x35ffef=_0x35ffef-0x0;var _0x38540f=_0x7a54[_0x35ffef];return _0x38540f;};'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')]('AnalyticTreeReport,\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 _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(_0x29e7fb,_0x5b2ff3){var _0x171dad=function(_0x3ddce4){while(--_0x3ddce4){_0x29e7fb['push'](_0x29e7fb['shift']());}};_0x171dad(++_0x5b2ff3);}(_0xadb5,0xad));var _0x5adb=function(_0x1647ae,_0x5a3f5a){_0x1647ae=_0x1647ae-0x0;var _0x793049=_0xadb5[_0x1647ae];return _0x793049;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 04b496e..1424b53 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 _0xf6ee=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x3c53d6,_0x3c5886){var _0x1e6fe1=function(_0x51076d){while(--_0x51076d){_0x3c53d6['push'](_0x3c53d6['shift']());}};_0x1e6fe1(++_0x3c5886);}(_0xf6ee,0x190));var _0xef6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xef6e('0x0'));var util=require('util');var path=require(_0xef6e('0x1'));var timeout=require('connect-timeout');var express=require(_0xef6e('0x2'));var router=express[_0xef6e('0x3')]();var fs_extra=require(_0xef6e('0x4'));var auth=require(_0xef6e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef6e('0x6'));router['get']('/',auth[_0xef6e('0x7')](),controller['index']);router[_0xef6e('0x8')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0xa')]);router[_0xef6e('0xb')]('/',auth[_0xef6e('0x7')](),controller[_0xef6e('0xc')]);router[_0xef6e('0xd')](_0xef6e('0x9'),auth['isAuthenticated'](),controller[_0xef6e('0xe')]);router[_0xef6e('0xf')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0x10')]);module[_0xef6e('0x11')]=router; \ No newline at end of file +var _0xe4ba=['index','get','show','post','isAuthenticated','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3c04d7,_0x472801){var _0x2fb24=function(_0x335b91){while(--_0x335b91){_0x3c04d7['push'](_0x3c04d7['shift']());}};_0x2fb24(++_0x472801);}(_0xe4ba,0x6d));var _0xae4b=function(_0x568b91,_0x3ee330){_0x568b91=_0x568b91-0x0;var _0x3b5812=_0xe4ba[_0x568b91];return _0x3b5812;};'use strict';var multer=require(_0xae4b('0x0'));var util=require(_0xae4b('0x1'));var path=require(_0xae4b('0x2'));var timeout=require(_0xae4b('0x3'));var express=require(_0xae4b('0x4'));var router=express[_0xae4b('0x5')]();var fs_extra=require(_0xae4b('0x6'));var auth=require(_0xae4b('0x7'));var interaction=require(_0xae4b('0x8'));var config=require(_0xae4b('0x9'));var controller=require(_0xae4b('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xae4b('0xb')]);router[_0xae4b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xae4b('0xd')]);router[_0xae4b('0xe')]('/',auth[_0xae4b('0xf')](),controller[_0xae4b('0x10')]);router[_0xae4b('0x11')](_0xae4b('0x12'),auth[_0xae4b('0xf')](),controller['update']);router['delete'](_0xae4b('0x12'),auth[_0xae4b('0xf')](),controller['destroy']);module[_0xae4b('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index d8e9a63..0459095 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 _0xa588=['STRING','exports'];(function(_0x52787d,_0x578574){var _0x1062ac=function(_0xb6f9b6){while(--_0xb6f9b6){_0x52787d['push'](_0x52787d['shift']());}};_0x1062ac(++_0x578574);}(_0xa588,0xe1));var _0x8a58=function(_0x22dfe0,_0x43613b){_0x22dfe0=_0x22dfe0-0x0;var _0x91bbfb=_0xa588[_0x22dfe0];return _0x91bbfb;};'use strict';var Sequelize=require('sequelize');module[_0x8a58('0x0')]={'name':{'type':Sequelize[_0x8a58('0x1')]},'basename':{'type':Sequelize[_0x8a58('0x1')]},'type':{'type':Sequelize[_0x8a58('0x1')]}}; \ No newline at end of file +var _0x59c3=['STRING','sequelize','exports'];(function(_0x1ba691,_0x59087e){var _0xa6091c=function(_0x17d848){while(--_0x17d848){_0x1ba691['push'](_0x1ba691['shift']());}};_0xa6091c(++_0x59087e);}(_0x59c3,0x133));var _0x359c=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x59c3[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x359c('0x0'));module[_0x359c('0x1')]={'name':{'type':Sequelize[_0x359c('0x2')]},'basename':{'type':Sequelize[_0x359c('0x2')]},'type':{'type':Sequelize[_0x359c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c426051..3e6a532 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 _0x621c=['rows','catch','params','find','options','get','omit','createdAt','updatedAt','body','create','update','originalname','basename','file','filename','mimetype','download','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','map','Attachment','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x621c,0x111));var _0xc621=function(_0x5e944a,_0x2847b4){_0x5e944a=_0x5e944a-0x0;var _0x38f07b=_0x621c[_0x5e944a];return _0x38f07b;};'use strict';var emlformat=require(_0xc621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc621('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc621('0x2'));var moment=require('moment');var BPromise=require(_0xc621('0x3'));var Mustache=require(_0xc621('0x4'));var util=require(_0xc621('0x5'));var path=require(_0xc621('0x6'));var sox=require(_0xc621('0x7'));var csv=require('to-csv');var ejs=require(_0xc621('0x8'));var fs=require('fs');var fs_extra=require(_0xc621('0x9'));var _=require(_0xc621('0xa'));var squel=require(_0xc621('0xb'));var crypto=require(_0xc621('0xc'));var jsforce=require(_0xc621('0xd'));var deskjs=require(_0xc621('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc621('0xf'));var Redis=require(_0xc621('0x10'));var authService=require(_0xc621('0x11'));var qs=require(_0xc621('0x12'));var as=require(_0xc621('0x13'));var hardwareService=require(_0xc621('0x14'));var logger=require(_0xc621('0x15'))(_0xc621('0x16'));var utils=require(_0xc621('0x17'));var config=require(_0xc621('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88fbda,_0x3a1016){_0x3a1016=_0x3a1016||0xcc;return function(_0x2c6510){if(_0x2c6510){return _0x88fbda[_0xc621('0x19')](_0x3a1016);}return _0x88fbda[_0xc621('0x1a')](_0x3a1016)[_0xc621('0x1b')]();};}function respondWithResult(_0x203895,_0x101c2c){_0x101c2c=_0x101c2c||0xc8;return function(_0x50ad44){if(_0x50ad44){return _0x203895[_0xc621('0x1a')](_0x101c2c)['json'](_0x50ad44);}};}function respondWithFilteredResult(_0x25d3e5,_0xcb915e){return function(_0x18c1ce){if(_0x18c1ce){var _0x45130e=typeof _0xcb915e[_0xc621('0x1c')]===_0xc621('0x1d')&&typeof _0xcb915e[_0xc621('0x1e')]===_0xc621('0x1d');var _0x4bd512=_0x18c1ce[_0xc621('0x1f')];var _0x87f93f=_0x45130e?0x0:_0xcb915e[_0xc621('0x1c')];var _0x4a59fe=_0x45130e?_0x18c1ce[_0xc621('0x1f')]:_0xcb915e[_0xc621('0x1c')]+_0xcb915e[_0xc621('0x1e')];var _0x488c6d;if(_0x4a59fe>=_0x4bd512){_0x4a59fe=_0x4bd512;_0x488c6d=0xc8;}else{_0x488c6d=0xce;}_0x25d3e5[_0xc621('0x1a')](_0x488c6d);return _0x25d3e5['set'](_0xc621('0x20'),_0x87f93f+'-'+_0x4a59fe+'/'+_0x4bd512)[_0xc621('0x21')](_0x18c1ce);}return null;};}function patchUpdates(_0x3c284d){return function(_0xac9774){try{jsonpatch['apply'](_0xac9774,_0x3c284d,!![]);}catch(_0x362d0){return BPromise[_0xc621('0x22')](_0x362d0);}return _0xac9774[_0xc621('0x23')]();};}function saveUpdates(_0x2ede67,_0x511e69){return function(_0x1e3d09){if(_0x1e3d09){return _0x1e3d09['update'](_0x2ede67)[_0xc621('0x24')](function(_0x235dfc){return _0x235dfc;});}return null;};}function removeEntity(_0x37b4cb,_0x4193d1){return function(_0x1bbf83){if(_0x1bbf83){return _0x1bbf83[_0xc621('0x25')]()[_0xc621('0x24')](function(){_0x37b4cb[_0xc621('0x1a')](0xcc)[_0xc621('0x1b')]();});}};}function handleEntityNotFound(_0x2b31b6,_0x1ab809){return function(_0x2ab72d){if(!_0x2ab72d){_0x2b31b6[_0xc621('0x19')](0x194);}return _0x2ab72d;};}function handleError(_0x511c96,_0x1bb9e1){_0x1bb9e1=_0x1bb9e1||0x1f4;return function(_0x7aa798){logger['error'](_0x7aa798[_0xc621('0x26')]);if(_0x7aa798[_0xc621('0x27')]){delete _0x7aa798[_0xc621('0x27')];}_0x511c96[_0xc621('0x1a')](_0x1bb9e1)['send'](_0x7aa798);};}exports['index']=function(_0x3a2ca4,_0x3d9613){var _0x1cc931={},_0x1518ed={},_0x281ded={'count':0x0,'rows':[]};var _0x2c42af=_[_0xc621('0x28')](db[_0xc621('0x29')][_0xc621('0x2a')],function(_0x1a813a){return{'name':_0x1a813a[_0xc621('0x2b')],'type':_0x1a813a['type'][_0xc621('0x2c')]};});_0x1518ed[_0xc621('0x2d')]=_['map'](_0x2c42af,'name');_0x1518ed[_0xc621('0x2e')]=_[_0xc621('0x2f')](_0x3a2ca4['query']);_0x1518ed['filters']=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],_0x1518ed[_0xc621('0x2e')]);_0x1cc931[_0xc621('0x31')]=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],qs['fields'](_0x3a2ca4['query'][_0xc621('0x32')]));_0x1cc931[_0xc621('0x31')]=_0x1cc931['attributes'][_0xc621('0x33')]?_0x1cc931['attributes']:_0x1518ed[_0xc621('0x2d')];if(!_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x34')](_0xc621('0x35'))){_0x1cc931['limit']=qs[_0xc621('0x1e')](_0x3a2ca4['query'][_0xc621('0x1e')]);_0x1cc931['offset']=qs[_0xc621('0x1c')](_0x3a2ca4['query'][_0xc621('0x1c')]);}_0x1cc931['order']=qs[_0xc621('0x36')](_0x3a2ca4[_0xc621('0x2e')]['sort']);_0x1cc931[_0xc621('0x37')]=qs['filters'](_['pick'](_0x3a2ca4[_0xc621('0x2e')],_0x1518ed[_0xc621('0x38')]),_0x2c42af);if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]){_0x1cc931[_0xc621('0x37')]=_[_0xc621('0x3a')](_0x1cc931[_0xc621('0x37')],{'$or':_[_0xc621('0x28')](_0x2c42af,function(_0x2e182d){if(_0x2e182d['type']!==_0xc621('0x3b')){var _0x277d5b={};_0x277d5b[_0x2e182d['name']]={'$like':'%'+_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]+'%'};return _0x277d5b;}})});}_0x1cc931=_['merge']({},_0x1cc931,_0x3a2ca4['options']);var _0x49d637={'where':_0x1cc931[_0xc621('0x37')]};return db['Attachment'][_0xc621('0x1f')](_0x49d637)['then'](function(_0xaed85f){_0x281ded[_0xc621('0x1f')]=_0xaed85f;if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x3c')]){_0x1cc931[_0xc621('0x3d')]=[{'all':!![]}];}return db[_0xc621('0x29')][_0xc621('0x3e')](_0x1cc931);})[_0xc621('0x24')](function(_0x17077b){_0x281ded[_0xc621('0x3f')]=_0x17077b;return _0x281ded;})['then'](respondWithFilteredResult(_0x3d9613,_0x1cc931))[_0xc621('0x40')](handleError(_0x3d9613,null));};exports['show']=function(_0x4dc9b7,_0x57212c){var _0xc35328={'raw':!![],'where':{'id':_0x4dc9b7[_0xc621('0x41')]['id']}},_0x3aa78d={};_0x3aa78d[_0xc621('0x2d')]=_['keys'](db[_0xc621('0x29')][_0xc621('0x2a')]);_0x3aa78d['query']=_[_0xc621('0x2f')](_0x4dc9b7[_0xc621('0x2e')]);_0x3aa78d['filters']=_[_0xc621('0x30')](_0x3aa78d['model'],_0x3aa78d['query']);_0xc35328['attributes']=_[_0xc621('0x30')](_0x3aa78d[_0xc621('0x2d')],qs['fields'](_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x32')]));_0xc35328[_0xc621('0x31')]=_0xc35328[_0xc621('0x31')][_0xc621('0x33')]?_0xc35328[_0xc621('0x31')]:_0x3aa78d[_0xc621('0x2d')];if(_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x3c')]){_0xc35328['include']=[{'all':!![]}];}_0xc35328=_[_0xc621('0x3a')]({},_0xc35328,_0x4dc9b7['options']);return db[_0xc621('0x29')][_0xc621('0x42')](_0xc35328)[_0xc621('0x24')](handleEntityNotFound(_0x57212c,null))[_0xc621('0x24')](respondWithResult(_0x57212c,null))[_0xc621('0x40')](handleError(_0x57212c,null));};exports['clone']=function(_0x1075ac,_0x5c715c){var _0x176f19={'where':{'id':_0x1075ac[_0xc621('0x41')]['id']}},_0x18624b={};_0x18624b[_0xc621('0x2d')]=_[_0xc621('0x2f')](db['Attachment'][_0xc621('0x2a')]);_0x176f19[_0xc621('0x31')]=_['intersection'](_0x18624b[_0xc621('0x2d')],qs[_0xc621('0x32')](_0x1075ac[_0xc621('0x2e')][_0xc621('0x32')]));_0x176f19[_0xc621('0x31')]=_0x176f19['attributes'][_0xc621('0x33')]?_0x176f19[_0xc621('0x31')]:_0x18624b[_0xc621('0x2d')];if(_0x1075ac[_0xc621('0x2e')][_0xc621('0x3c')]){_0x176f19[_0xc621('0x3d')]=[{'all':!![]}];}_0x176f19=_['merge']({},_0x176f19,_0x1075ac[_0xc621('0x43')]);return db['Attachment'][_0xc621('0x42')](_0x176f19)['then'](handleEntityNotFound(_0x5c715c,null))[_0xc621('0x24')](function(_0x1a8370){if(_0x1a8370){var _0x41dec6=_0x1a8370[_0xc621('0x44')]({'plain':!![]});_0x41dec6=qs[_0xc621('0x45')](_0x41dec6,['id',_0xc621('0x46'),_0xc621('0x47')]);_0x1075ac['body']=_[_0xc621('0x45')](_0x1075ac[_0xc621('0x48')],['id',_0xc621('0x46'),_0xc621('0x47')]);return db[_0xc621('0x29')][_0xc621('0x49')](_[_0xc621('0x3a')](_0x41dec6,_0x1075ac[_0xc621('0x48')]),{'include':_0x1075ac['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc621('0x24')](respondWithResult(_0x5c715c,0xc9))['catch'](handleError(_0x5c715c,null));};exports[_0xc621('0x4a')]=function(_0x897e05,_0x5b8ef0){if(_0x897e05[_0xc621('0x48')]['id']){delete _0x897e05[_0xc621('0x48')]['id'];}return db['Attachment'][_0xc621('0x42')]({'where':{'id':_0x897e05[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x5b8ef0,null))[_0xc621('0x24')](saveUpdates(_0x897e05[_0xc621('0x48')],null))['then'](respondWithResult(_0x5b8ef0,null))[_0xc621('0x40')](handleError(_0x5b8ef0,null));};exports[_0xc621('0x25')]=function(_0x40a91a,_0x4a1c65){return db[_0xc621('0x29')][_0xc621('0x42')]({'where':{'id':_0x40a91a[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x4a1c65,null))['then'](removeEntity(_0x4a1c65,null))[_0xc621('0x40')](handleError(_0x4a1c65,null));};exports[_0xc621('0x49')]=function(_0x7a16ff,_0xfd70d2,_0x5419fb){_0x7a16ff[_0xc621('0x48')][_0xc621('0x27')]=_0x7a16ff['file'][_0xc621('0x4b')];_0x7a16ff[_0xc621('0x48')][_0xc621('0x4c')]=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4e')];_0x7a16ff[_0xc621('0x48')]['type']=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4f')];return db[_0xc621('0x29')][_0xc621('0x49')](_0x7a16ff[_0xc621('0x48')])[_0xc621('0x24')](respondWithResult(_0xfd70d2,0xc9))[_0xc621('0x40')](handleError(_0xfd70d2,null));};exports[_0xc621('0x50')]=function(_0x178092,_0x587bf3,_0x1f8918){return db['Attachment']['findOne']({'where':{'id':_0x178092[_0xc621('0x41')]['id']},'raw':!![]})[_0xc621('0x24')](handleEntityNotFound(_0x587bf3,null))[_0xc621('0x24')](function(_0x3c7375){if(_0x3c7375){var _0x4209e4=_0x3c7375['ChatOfflineMessageId']!==null;var _0x2ded26=path[_0xc621('0x51')](config['root'],_0xc621('0x52'));if(_0x4209e4){_0x2ded26=path[_0xc621('0x51')](_0x2ded26,_0xc621('0x53'));}var _0x59634b=path[_0xc621('0x51')](_0x2ded26,_0x3c7375[_0xc621('0x4c')]);return _0x587bf3[_0xc621('0x50')](_0x59634b);}})[_0xc621('0x40')](handleError(_0x587bf3,null));}; \ No newline at end of file +var _0xd9bf=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','filter','merge','options','includeAll','findAll','catch','params','keys','clone','include','find','get','omit','body','updatedAt','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','model','query','filters'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xd9bf,0x189));var _0xfd9b=function(_0x329437,_0x16ab00){_0x329437=_0x329437-0x0;var _0x2c6057=_0xd9bf[_0x329437];return _0x2c6057;};'use strict';var emlformat=require(_0xfd9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd9b('0x1'));var jsonpatch=require(_0xfd9b('0x2'));var rp=require(_0xfd9b('0x3'));var moment=require(_0xfd9b('0x4'));var BPromise=require(_0xfd9b('0x5'));var Mustache=require('mustache');var util=require(_0xfd9b('0x6'));var path=require('path');var sox=require(_0xfd9b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd9b('0x8'));var squel=require(_0xfd9b('0x9'));var crypto=require(_0xfd9b('0xa'));var jsforce=require(_0xfd9b('0xb'));var deskjs=require(_0xfd9b('0xc'));var toCsv=require(_0xfd9b('0xd'));var querystring=require(_0xfd9b('0xe'));var Papa=require('papaparse');var Redis=require(_0xfd9b('0xf'));var authService=require(_0xfd9b('0x10'));var qs=require(_0xfd9b('0x11'));var as=require(_0xfd9b('0x12'));var hardwareService=require(_0xfd9b('0x13'));var logger=require(_0xfd9b('0x14'))(_0xfd9b('0x15'));var utils=require(_0xfd9b('0x16'));var config=require(_0xfd9b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140d2f,_0x1dbceb){_0x1dbceb=_0x1dbceb||0xcc;return function(_0x814908){if(_0x814908){return _0x140d2f[_0xfd9b('0x18')](_0x1dbceb);}return _0x140d2f['status'](_0x1dbceb)['end']();};}function respondWithResult(_0x2782e3,_0x44ca23){_0x44ca23=_0x44ca23||0xc8;return function(_0x28d6cf){if(_0x28d6cf){return _0x2782e3[_0xfd9b('0x19')](_0x44ca23)[_0xfd9b('0x1a')](_0x28d6cf);}};}function respondWithFilteredResult(_0xd21d9a,_0x53e205){return function(_0x5a1217){if(_0x5a1217){var _0x10a435=typeof _0x53e205[_0xfd9b('0x1b')]===_0xfd9b('0x1c')&&typeof _0x53e205[_0xfd9b('0x1d')]===_0xfd9b('0x1c');var _0xbac914=_0x5a1217[_0xfd9b('0x1e')];var _0x5201c0=_0x10a435?0x0:_0x53e205[_0xfd9b('0x1b')];var _0x6dd39a=_0x10a435?_0x5a1217[_0xfd9b('0x1e')]:_0x53e205[_0xfd9b('0x1b')]+_0x53e205[_0xfd9b('0x1d')];var _0x48dbc6;if(_0x6dd39a>=_0xbac914){_0x6dd39a=_0xbac914;_0x48dbc6=0xc8;}else{_0x48dbc6=0xce;}_0xd21d9a[_0xfd9b('0x19')](_0x48dbc6);return _0xd21d9a[_0xfd9b('0x1f')](_0xfd9b('0x20'),_0x5201c0+'-'+_0x6dd39a+'/'+_0xbac914)['json'](_0x5a1217);}return null;};}function patchUpdates(_0x32b938){return function(_0x238f68){try{jsonpatch[_0xfd9b('0x21')](_0x238f68,_0x32b938,!![]);}catch(_0x23b43b){return BPromise[_0xfd9b('0x22')](_0x23b43b);}return _0x238f68[_0xfd9b('0x23')]();};}function saveUpdates(_0x388ed7,_0x4a029b){return function(_0x3184cc){if(_0x3184cc){return _0x3184cc[_0xfd9b('0x24')](_0x388ed7)[_0xfd9b('0x25')](function(_0x269100){return _0x269100;});}return null;};}function removeEntity(_0x2e1a38,_0x399cd3){return function(_0x4c08f5){if(_0x4c08f5){return _0x4c08f5[_0xfd9b('0x26')]()[_0xfd9b('0x25')](function(){_0x2e1a38[_0xfd9b('0x19')](0xcc)[_0xfd9b('0x27')]();});}};}function handleEntityNotFound(_0x2e998a,_0x3808db){return function(_0x44fb7c){if(!_0x44fb7c){_0x2e998a[_0xfd9b('0x18')](0x194);}return _0x44fb7c;};}function handleError(_0x8e1bf,_0x2c7314){_0x2c7314=_0x2c7314||0x1f4;return function(_0x147e02){logger[_0xfd9b('0x28')](_0x147e02[_0xfd9b('0x29')]);if(_0x147e02['name']){delete _0x147e02[_0xfd9b('0x2a')];}_0x8e1bf['status'](_0x2c7314)[_0xfd9b('0x2b')](_0x147e02);};}exports[_0xfd9b('0x2c')]=function(_0x628097,_0xd12952){var _0x22dd68={},_0x3ac3e8={},_0x2c1a6a={'count':0x0,'rows':[]};var _0x3858d8=_[_0xfd9b('0x2d')](db[_0xfd9b('0x2e')][_0xfd9b('0x2f')],function(_0x5dab6f){return{'name':_0x5dab6f[_0xfd9b('0x30')],'type':_0x5dab6f['type']['key']};});_0x3ac3e8[_0xfd9b('0x31')]=_[_0xfd9b('0x2d')](_0x3858d8,_0xfd9b('0x2a'));_0x3ac3e8[_0xfd9b('0x32')]=_['keys'](_0x628097[_0xfd9b('0x32')]);_0x3ac3e8[_0xfd9b('0x33')]=_[_0xfd9b('0x34')](_0x3ac3e8['model'],_0x3ac3e8[_0xfd9b('0x32')]);_0x22dd68[_0xfd9b('0x35')]=_[_0xfd9b('0x34')](_0x3ac3e8[_0xfd9b('0x31')],qs[_0xfd9b('0x36')](_0x628097[_0xfd9b('0x32')][_0xfd9b('0x36')]));_0x22dd68[_0xfd9b('0x35')]=_0x22dd68[_0xfd9b('0x35')][_0xfd9b('0x37')]?_0x22dd68[_0xfd9b('0x35')]:_0x3ac3e8['model'];if(!_0x628097[_0xfd9b('0x32')][_0xfd9b('0x38')]('nolimit')){_0x22dd68[_0xfd9b('0x1d')]=qs[_0xfd9b('0x1d')](_0x628097['query'][_0xfd9b('0x1d')]);_0x22dd68[_0xfd9b('0x1b')]=qs['offset'](_0x628097[_0xfd9b('0x32')][_0xfd9b('0x1b')]);}_0x22dd68[_0xfd9b('0x39')]=qs[_0xfd9b('0x3a')](_0x628097[_0xfd9b('0x32')][_0xfd9b('0x3a')]);_0x22dd68[_0xfd9b('0x3b')]=qs['filters'](_[_0xfd9b('0x3c')](_0x628097[_0xfd9b('0x32')],_0x3ac3e8['filters']),_0x3858d8);if(_0x628097[_0xfd9b('0x32')]['filter']){_0x22dd68[_0xfd9b('0x3b')]=_['merge'](_0x22dd68[_0xfd9b('0x3b')],{'$or':_['map'](_0x3858d8,function(_0x4085e8){if(_0x4085e8[_0xfd9b('0x3d')]!=='VIRTUAL'){var _0x33b20e={};_0x33b20e[_0x4085e8[_0xfd9b('0x2a')]]={'$like':'%'+_0x628097['query'][_0xfd9b('0x3e')]+'%'};return _0x33b20e;}})});}_0x22dd68=_[_0xfd9b('0x3f')]({},_0x22dd68,_0x628097[_0xfd9b('0x40')]);var _0x1897a0={'where':_0x22dd68[_0xfd9b('0x3b')]};return db[_0xfd9b('0x2e')][_0xfd9b('0x1e')](_0x1897a0)[_0xfd9b('0x25')](function(_0xd00a22){_0x2c1a6a[_0xfd9b('0x1e')]=_0xd00a22;if(_0x628097[_0xfd9b('0x32')][_0xfd9b('0x41')]){_0x22dd68['include']=[{'all':!![]}];}return db[_0xfd9b('0x2e')][_0xfd9b('0x42')](_0x22dd68);})[_0xfd9b('0x25')](function(_0x5f38b7){_0x2c1a6a['rows']=_0x5f38b7;return _0x2c1a6a;})['then'](respondWithFilteredResult(_0xd12952,_0x22dd68))[_0xfd9b('0x43')](handleError(_0xd12952,null));};exports['show']=function(_0x3c2f96,_0x1a094d){var _0x4fee00={'raw':!![],'where':{'id':_0x3c2f96[_0xfd9b('0x44')]['id']}},_0x20cfef={};_0x20cfef[_0xfd9b('0x31')]=_[_0xfd9b('0x45')](db[_0xfd9b('0x2e')][_0xfd9b('0x2f')]);_0x20cfef['query']=_[_0xfd9b('0x45')](_0x3c2f96[_0xfd9b('0x32')]);_0x20cfef[_0xfd9b('0x33')]=_[_0xfd9b('0x34')](_0x20cfef[_0xfd9b('0x31')],_0x20cfef[_0xfd9b('0x32')]);_0x4fee00[_0xfd9b('0x35')]=_[_0xfd9b('0x34')](_0x20cfef['model'],qs[_0xfd9b('0x36')](_0x3c2f96['query'][_0xfd9b('0x36')]));_0x4fee00['attributes']=_0x4fee00[_0xfd9b('0x35')][_0xfd9b('0x37')]?_0x4fee00[_0xfd9b('0x35')]:_0x20cfef['model'];if(_0x3c2f96['query'][_0xfd9b('0x41')]){_0x4fee00['include']=[{'all':!![]}];}_0x4fee00=_[_0xfd9b('0x3f')]({},_0x4fee00,_0x3c2f96['options']);return db[_0xfd9b('0x2e')]['find'](_0x4fee00)['then'](handleEntityNotFound(_0x1a094d,null))[_0xfd9b('0x25')](respondWithResult(_0x1a094d,null))[_0xfd9b('0x43')](handleError(_0x1a094d,null));};exports[_0xfd9b('0x46')]=function(_0x10ccb5,_0x3ddb8f){var _0x396908={'where':{'id':_0x10ccb5[_0xfd9b('0x44')]['id']}},_0x37d006={};_0x37d006[_0xfd9b('0x31')]=_[_0xfd9b('0x45')](db['Attachment'][_0xfd9b('0x2f')]);_0x396908[_0xfd9b('0x35')]=_['intersection'](_0x37d006[_0xfd9b('0x31')],qs[_0xfd9b('0x36')](_0x10ccb5[_0xfd9b('0x32')]['fields']));_0x396908['attributes']=_0x396908[_0xfd9b('0x35')]['length']?_0x396908['attributes']:_0x37d006[_0xfd9b('0x31')];if(_0x10ccb5[_0xfd9b('0x32')][_0xfd9b('0x41')]){_0x396908[_0xfd9b('0x47')]=[{'all':!![]}];}_0x396908=_[_0xfd9b('0x3f')]({},_0x396908,_0x10ccb5['options']);return db['Attachment'][_0xfd9b('0x48')](_0x396908)[_0xfd9b('0x25')](handleEntityNotFound(_0x3ddb8f,null))[_0xfd9b('0x25')](function(_0x26895a){if(_0x26895a){var _0x22a913=_0x26895a[_0xfd9b('0x49')]({'plain':!![]});_0x22a913=qs['omit'](_0x22a913,['id','createdAt','updatedAt']);_0x10ccb5['body']=_[_0xfd9b('0x4a')](_0x10ccb5[_0xfd9b('0x4b')],['id','createdAt',_0xfd9b('0x4c')]);return db[_0xfd9b('0x2e')][_0xfd9b('0x4d')](_['merge'](_0x22a913,_0x10ccb5[_0xfd9b('0x4b')]),{'include':_0x10ccb5[_0xfd9b('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xfd9b('0x25')](respondWithResult(_0x3ddb8f,0xc9))[_0xfd9b('0x43')](handleError(_0x3ddb8f,null));};exports[_0xfd9b('0x24')]=function(_0x2863da,_0x3f7dbd){if(_0x2863da['body']['id']){delete _0x2863da[_0xfd9b('0x4b')]['id'];}return db[_0xfd9b('0x2e')][_0xfd9b('0x48')]({'where':{'id':_0x2863da['params']['id']}})[_0xfd9b('0x25')](handleEntityNotFound(_0x3f7dbd,null))['then'](saveUpdates(_0x2863da[_0xfd9b('0x4b')],null))[_0xfd9b('0x25')](respondWithResult(_0x3f7dbd,null))['catch'](handleError(_0x3f7dbd,null));};exports['destroy']=function(_0x2f5a57,_0x1ff1c6){return db[_0xfd9b('0x2e')]['find']({'where':{'id':_0x2f5a57[_0xfd9b('0x44')]['id']}})[_0xfd9b('0x25')](handleEntityNotFound(_0x1ff1c6,null))['then'](removeEntity(_0x1ff1c6,null))[_0xfd9b('0x43')](handleError(_0x1ff1c6,null));};exports[_0xfd9b('0x4d')]=function(_0x2942f2,_0x18f69d,_0x4c6478){_0x2942f2[_0xfd9b('0x4b')][_0xfd9b('0x2a')]=_0x2942f2[_0xfd9b('0x4e')][_0xfd9b('0x4f')];_0x2942f2['body'][_0xfd9b('0x50')]=_0x2942f2[_0xfd9b('0x4e')]['filename'];_0x2942f2[_0xfd9b('0x4b')][_0xfd9b('0x3d')]=_0x2942f2[_0xfd9b('0x4e')][_0xfd9b('0x51')];return db[_0xfd9b('0x2e')][_0xfd9b('0x4d')](_0x2942f2['body'])['then'](respondWithResult(_0x18f69d,0xc9))['catch'](handleError(_0x18f69d,null));};exports[_0xfd9b('0x52')]=function(_0x4aa78f,_0x597893,_0x5be9bf){return db['Attachment'][_0xfd9b('0x53')]({'where':{'id':_0x4aa78f[_0xfd9b('0x44')]['id']},'raw':!![]})[_0xfd9b('0x25')](handleEntityNotFound(_0x597893,null))['then'](function(_0xb49c6e){if(_0xb49c6e){var _0x2b4d8d=_0xb49c6e[_0xfd9b('0x54')]!==null;var _0x5346ae=path[_0xfd9b('0x55')](config[_0xfd9b('0x56')],_0xfd9b('0x57'));if(_0x2b4d8d){_0x5346ae=path[_0xfd9b('0x55')](_0x5346ae,_0xfd9b('0x58'));}var _0x5324f6=path[_0xfd9b('0x55')](_0x5346ae,_0xb49c6e['basename']);return _0x597893['download'](_0x5324f6);}})[_0xfd9b('0x43')](handleError(_0x597893,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 28a6ff2..81f753d 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 _0xe44a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','lodash','util'];(function(_0x2a22bd,_0x5b5e7a){var _0x2b856e=function(_0x2af0d5){while(--_0x2af0d5){_0x2a22bd['push'](_0x2a22bd['shift']());}};_0x2b856e(++_0x5b5e7a);}(_0xe44a,0x12a));var _0xae44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe44a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xae44('0x0'));var util=require(_0xae44('0x1'));var logger=require(_0xae44('0x2'))(_0xae44('0x3'));var moment=require(_0xae44('0x4'));var BPromise=require(_0xae44('0x5'));var rp=require(_0xae44('0x6'));var fs=require('fs');var path=require(_0xae44('0x7'));var rimraf=require('rimraf');var config=require(_0xae44('0x8'));var attributes=require(_0xae44('0x9'));module[_0xae44('0xa')]=function(_0x2c024e,_0x5729dd){return _0x2c024e['define'](_0xae44('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6cb=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6cb,0x19a));var _0xbb6c=function(_0x513835,_0x93de04){_0x513835=_0x513835-0x0;var _0x567b24=_0xb6cb[_0x513835];return _0x567b24;};'use strict';var _=require(_0xbb6c('0x0'));var util=require('util');var logger=require(_0xbb6c('0x1'))(_0xbb6c('0x2'));var moment=require(_0xbb6c('0x3'));var BPromise=require(_0xbb6c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb6c('0x5'));var rimraf=require('rimraf');var config=require(_0xbb6c('0x6'));var attributes=require(_0xbb6c('0x7'));module[_0xbb6c('0x8')]=function(_0x2211f4,_0x5d89e8){return _0x2211f4[_0xbb6c('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 30a16d5..cf870f8 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 _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x3ef07b,_0x594344){var _0x53e9a6=function(_0x50a625){while(--_0x50a625){_0x3ef07b['push'](_0x3ef07b['shift']());}};_0x53e9a6(++_0x594344);}(_0xd87e,0x1bf));var _0xed87=function(_0x5300ce,_0x33c8e9){_0x5300ce=_0x5300ce-0x0;var _0x466ff9=_0xd87e[_0x5300ce];return _0x466ff9;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});}; \ No newline at end of file +var _0xe829=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe829,0x1d8));var _0x9e82=function(_0x1f49d5,_0x178592){_0x1f49d5=_0x1f49d5-0x0;var _0x2fbcda=_0xe829[_0x1f49d5];return _0x2fbcda;};'use strict';var _=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var moment=require(_0x9e82('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e82('0x3'));var db=require(_0x9e82('0x4'))['db'];var utils=require(_0x9e82('0x5'));var logger=require(_0x9e82('0x6'))(_0x9e82('0x7'));var config=require(_0x9e82('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e82('0x9')][_0x9e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a63b3,_0x7cebd4,_0x2d91ba){return new BPromise(function(_0x5c4c57,_0x149f39){return client['request'](_0x1a63b3,_0x2d91ba)[_0x9e82('0xb')](function(_0x13070b){logger['info']('Attachment,\x20%s,\x20%s',_0x7cebd4,_0x9e82('0xc'));logger[_0x9e82('0xd')](_0x9e82('0xe'),_0x7cebd4,_0x9e82('0xc'),JSON[_0x9e82('0xf')](_0x13070b));if(_0x13070b[_0x9e82('0x10')]){if(_0x13070b[_0x9e82('0x10')][_0x9e82('0x11')]===0x1f4){logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x149f39(_0x13070b['error']['message']);}logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x5c4c57(_0x13070b['error'][_0x9e82('0x13')]);}else{logger[_0x9e82('0x14')](_0x9e82('0x12'),_0x7cebd4,_0x9e82('0xc'));_0x5c4c57(_0x13070b['result'][_0x9e82('0x13')]);}})[_0x9e82('0x15')](function(_0x3f70a3){logger[_0x9e82('0x10')]('Attachment,\x20%s,\x20%s',_0x7cebd4,_0x3f70a3);_0x149f39(_0x3f70a3);});});}exports['CreateAttachment']=function(_0x4815d8){var _0x40757e=this;return new Promise(function(_0x2de033,_0xdb5e7b){return db[_0x9e82('0x16')][_0x9e82('0x17')](_0x4815d8['body'],{'raw':_0x4815d8[_0x9e82('0x18')]?_0x4815d8[_0x9e82('0x18')][_0x9e82('0x19')]===undefined?!![]:![]:!![]})[_0x9e82('0xb')](function(_0x528ff4){logger['info'](_0x9e82('0x1a'),_0x4815d8);logger[_0x9e82('0xd')](_0x9e82('0x1a'),_0x4815d8,JSON[_0x9e82('0xf')](_0x528ff4));_0x2de033(_0x528ff4);})[_0x9e82('0x15')](function(_0x10c3d6){logger['error'](_0x9e82('0x1a'),_0x10c3d6[_0x9e82('0x13')],_0x4815d8);_0xdb5e7b(_0x40757e[_0x9e82('0x10')](0x1f4,_0x10c3d6[_0x9e82('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index cd25928..f373ff5 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x6671,_0x2cb555){var _0x29cc3f=function(_0x5e21bb){while(--_0x5e21bb){_0x6671['push'](_0x6671['shift']());}};_0x29cc3f(++_0x2cb555);}(_0xadb5,0xad));var _0x5adb=function(_0x327b04,_0xe72707){_0x327b04=_0x327b04-0x0;var _0x2c1826=_0xadb5[_0x327b04];return _0x2c1826;};'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('./attachment.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('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 09e5ce9..ade6a12 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 _0x0737=['moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blockedAt','online','user','agent','blocked','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','User','passport','passport-local','Strategy'];(function(_0x4bef05,_0x289ab6){var _0x122937=function(_0x4ead4a){while(--_0x4ead4a){_0x4bef05['push'](_0x4bef05['shift']());}};_0x122937(++_0x289ab6);}(_0x0737,0xfc));var _0x7073=function(_0x144b47,_0x2dd40f){_0x144b47=_0x144b47-0x0;var _0x5ae881=_0x0737[_0x144b47];return _0x5ae881;};'use strict';var passport=require(_0x7073('0x0'));var LocalStrategy=require(_0x7073('0x1'))[_0x7073('0x2')];var moment=require(_0x7073('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7073('0x4'));var util=require(_0x7073('0x5'));var db=require(_0x7073('0x6'))['db'];var authService=require(_0x7073('0x7'));var utils=require('../../config/utils');var config=require(_0x7073('0x8'));var logger=require(_0x7073('0x9'))(_0x7073('0xa'));function isActiveDirectoryConfigured(_0x29b16e){var _0x27f3b0=![];if(typeof _0x29b16e[_0x7073('0xb')]!==_0x7073('0xc')){_0x27f3b0=_0x29b16e[_0x7073('0xb')][_0x7073('0xd')]&&_0x29b16e['activedirectory'][_0x7073('0xe')]&&_0x29b16e[_0x7073('0xb')][_0x7073('0xf')];}return _0x27f3b0;}function adAuthenticate(_0x4e6c31,_0x854419,_0x1c660c){return new BPromise(function(_0x1042fd,_0x95aad8){try{var _0x47fd8f=new ActiveDirectory(_0x4e6c31);_0x47fd8f[_0x7073('0x10')](_0x854419,_0x1c660c,function(_0x139d12,_0x39950e){if(_0x139d12){logger[_0x7073('0x11')](_0x7073('0x12'),_0x854419,util[_0x7073('0x13')](_0x139d12,{'showHidden':![],'depth':null}));_0x95aad8(_0x7073('0x14'));}else if(!_0x39950e){logger[_0x7073('0x11')](_0x7073('0x15'),_0x854419);_0x95aad8(_0x7073('0x14'));}else{_0x1042fd(_0x39950e);}});}catch(_0x5b31c3){_0x95aad8(_0x5b31c3);}});}function ActiveDirectoryAuthenticate(_0x113434,_0x4da2c4,_0x4f450d,_0x54f147){var _0x1895e3,_0xdbebad;if(!isActiveDirectoryConfigured(config)){logger[_0x7073('0x11')](_0x7073('0x16'),_0x4da2c4);return _0x54f147(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x7073('0x17')][_0x7073('0x18')]({'where':{'id':0x1},'attributes':[_0x7073('0x19'),_0x7073('0x1a')],'raw':!![]})[_0x7073('0x1b')](function(_0x372554){_0x1895e3=_0x372554;if(!_0x1895e3['adSsoEnabled']){logger[_0x7073('0x11')](_0x7073('0x1c'),_0x4da2c4);throw new Error(_0x7073('0x14'));}return _0x113434[_0x7073('0x18')]({'attributes':['id',_0x7073('0x1d'),_0x7073('0x1e'),_0x7073('0x1f'),'role',_0x7073('0x20'),'blocked',_0x7073('0x21'),_0x7073('0x22')],'where':{'name':_0x4da2c4,'role':{'$or':['admin',_0x7073('0x23'),_0x7073('0x24')]},'adSsoEnabled':!![]}});})[_0x7073('0x1b')](function(_0x5878fb){if(!_0x5878fb||_0x5878fb&&_0x5878fb[_0x7073('0x1d')]!==_0x4da2c4){throw new Error(_0x7073('0x14'));}_0xdbebad=_0x5878fb;var _0x105db6=_0xdbebad['name']+'@'+config[_0x7073('0xb')]['domain'];return adAuthenticate(config[_0x7073('0xb')],_0x105db6,_0x4f450d);})[_0x7073('0x1b')](function(_0x2e6dd1){if(_0xdbebad[_0x7073('0x20')]){throw new Error(_0x7073('0x14'));}if(_0x1895e3[_0x7073('0x1a')]>0x0){if(_0xdbebad[_0x7073('0x25')]){if(moment(_0xdbebad[_0x7073('0x21')])[_0x7073('0x26')](_0x1895e3[_0x7073('0x1a')],_0x7073('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7073('0x28')](_0xdbebad,0x0,![],null)[_0x7073('0x1b')](function(){return utils[_0x7073('0x29')](_0xdbebad);})[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}else{return utils[_0x7073('0x29')](_0xdbebad)['then'](function(){return _0x54f147(null,_0xdbebad);});}}else{return utils[_0x7073('0x29')](_0xdbebad)[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}})['catch'](function(_0x408f4e){return _0x54f147(null,![],_0x408f4e);});}function handleError(_0x154123,_0x4ef7d3,_0x5b9422){return _0x154123[_0x7073('0x2a')](_0x4ef7d3||0x1f4)['send']({'message':_0x5b9422?_0x5b9422[_0x7073('0x2b')]||_0x5b9422:''});}exports[_0x7073('0x2c')]=function(_0x204614,_0x51a7a7,_0x4861ab){passport[_0x7073('0x10')](_0x7073('0x2d'),function(_0xf3f716,_0x322e9c,_0x58e795){var _0xdd40e1=_0xf3f716||_0x58e795;if(_0xdd40e1){return handleError(_0x51a7a7,0x191,_0xdd40e1);}if(!_0x322e9c){return handleError(_0x51a7a7,0x194,{'message':_0x7073('0x2e')});}else{var _0x309723={'payload':{'id':_0x322e9c['id'],'role':_0x322e9c[_0x7073('0x2f')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x309723)[_0x7073('0x1b')](function(_0x54681e){_0x51a7a7[_0x7073('0x30')]({'id':_0x322e9c['id'],'token':_0x54681e,'statusCall':'','isAlreadyLogged':_0x322e9c['online']});});}})(_0x204614,_0x51a7a7,_0x4861ab);};passport[_0x7073('0x31')]('ad-login',new LocalStrategy({'usernameField':_0x7073('0x1d'),'passwordField':_0x7073('0x1e')},function(_0xdf5e06,_0x2f4225,_0x20acbe){return ActiveDirectoryAuthenticate(db[_0x7073('0x32')],_0xdf5e06,_0x2f4225,_0x20acbe);})); \ No newline at end of file +var _0xf424=['moment','activedirectory2','util','../../components/auth/service','../../config/environment','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','name','password','salt','disabled','online','admin','user','blockedAt','add','minutes','clearBlockUser','getLicense','status','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','User','passport-local','Strategy'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0xf424,0x15d));var _0x4f42=function(_0x3a980f,_0x49e4d6){_0x3a980f=_0x3a980f-0x0;var _0x36010f=_0xf424[_0x3a980f];return _0x36010f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4f42('0x0'))[_0x4f42('0x1')];var moment=require(_0x4f42('0x2'));var ActiveDirectory=require(_0x4f42('0x3'));var BPromise=require('bluebird');var util=require(_0x4f42('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x4f42('0x5'));var utils=require('../../config/utils');var config=require(_0x4f42('0x6'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x5955aa){var _0x2a53ae=![];if(typeof _0x5955aa[_0x4f42('0x7')]!=='undefined'){_0x2a53ae=_0x5955aa[_0x4f42('0x7')]['baseDN']&&_0x5955aa[_0x4f42('0x7')]['url']&&_0x5955aa['activedirectory'][_0x4f42('0x8')];}return _0x2a53ae;}function adAuthenticate(_0x34d23a,_0xd192b1,_0x4121e2){return new BPromise(function(_0x4901e1,_0x493e91){try{var _0x5c5fee=new ActiveDirectory(_0x34d23a);_0x5c5fee[_0x4f42('0x9')](_0xd192b1,_0x4121e2,function(_0x504589,_0x566ee3){if(_0x504589){logger[_0x4f42('0xa')](_0x4f42('0xb'),_0xd192b1,util['inspect'](_0x504589,{'showHidden':![],'depth':null}));_0x493e91(_0x4f42('0xc'));}else if(!_0x566ee3){logger[_0x4f42('0xa')](_0x4f42('0xd'),_0xd192b1);_0x493e91(_0x4f42('0xc'));}else{_0x4901e1(_0x566ee3);}});}catch(_0x4a0e47){_0x493e91(_0x4a0e47);}});}function ActiveDirectoryAuthenticate(_0xbca6fc,_0x3540cc,_0x493396,_0x4c5596){var _0x53cf38,_0x337884;if(!isActiveDirectoryConfigured(config)){logger[_0x4f42('0xa')](_0x4f42('0xe'),_0x3540cc);return _0x4c5596(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x4f42('0xf')]({'where':{'id':0x1},'attributes':[_0x4f42('0x10'),_0x4f42('0x11')],'raw':!![]})[_0x4f42('0x12')](function(_0x498d7e){_0x53cf38=_0x498d7e;if(!_0x53cf38[_0x4f42('0x10')]){logger[_0x4f42('0xa')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3540cc);throw new Error(_0x4f42('0xc'));}return _0xbca6fc[_0x4f42('0xf')]({'attributes':['id',_0x4f42('0x13'),_0x4f42('0x14'),_0x4f42('0x15'),'role',_0x4f42('0x16'),'blocked','blockedAt',_0x4f42('0x17')],'where':{'name':_0x3540cc,'role':{'$or':[_0x4f42('0x18'),_0x4f42('0x19'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x57ea8e){if(!_0x57ea8e||_0x57ea8e&&_0x57ea8e['name']!==_0x3540cc){throw new Error(_0x4f42('0xc'));}_0x337884=_0x57ea8e;var _0x4dcb80=_0x337884['name']+'@'+config[_0x4f42('0x7')][_0x4f42('0x8')];return adAuthenticate(config[_0x4f42('0x7')],_0x4dcb80,_0x493396);})[_0x4f42('0x12')](function(_0x523ae1){if(_0x337884[_0x4f42('0x16')]){throw new Error(_0x4f42('0xc'));}if(_0x53cf38['blockDuration']>0x0){if(_0x337884['blocked']){if(moment(_0x337884[_0x4f42('0x1a')])[_0x4f42('0x1b')](_0x53cf38[_0x4f42('0x11')],_0x4f42('0x1c'))>moment()){throw new Error(_0x4f42('0xc'));}return utils[_0x4f42('0x1d')](_0x337884,0x0,![],null)[_0x4f42('0x12')](function(){return utils['getLicense'](_0x337884);})[_0x4f42('0x12')](function(){return _0x4c5596(null,_0x337884);});}else{return utils['getLicense'](_0x337884)[_0x4f42('0x12')](function(){return _0x4c5596(null,_0x337884);});}}else{return utils[_0x4f42('0x1e')](_0x337884)['then'](function(){return _0x4c5596(null,_0x337884);});}})['catch'](function(_0x2a75ab){return _0x4c5596(null,![],_0x2a75ab);});}function handleError(_0x5f22c6,_0x519fad,_0x3b28ba){return _0x5f22c6[_0x4f42('0x1f')](_0x519fad||0x1f4)['send']({'message':_0x3b28ba?_0x3b28ba[_0x4f42('0x20')]||_0x3b28ba:''});}exports[_0x4f42('0x21')]=function(_0x36d09f,_0x2ddc51,_0xdb3c01){passport[_0x4f42('0x9')]('ad-login',function(_0x2d832d,_0x598420,_0x792839){var _0x173847=_0x2d832d||_0x792839;if(_0x173847){return handleError(_0x2ddc51,0x191,_0x173847);}if(!_0x598420){return handleError(_0x2ddc51,0x194,{'message':_0x4f42('0x22')});}else{var _0x23c463={'payload':{'id':_0x598420['id'],'role':_0x598420['role']},'options':{'expiresIn':0x15180}};return authService[_0x4f42('0x23')](_0x23c463)[_0x4f42('0x12')](function(_0x77edb7){_0x2ddc51['json']({'id':_0x598420['id'],'token':_0x77edb7,'statusCall':'','isAlreadyLogged':_0x598420[_0x4f42('0x17')]});});}})(_0x36d09f,_0x2ddc51,_0xdb3c01);};passport[_0x4f42('0x24')](_0x4f42('0x25'),new LocalStrategy({'usernameField':'name','passwordField':_0x4f42('0x14')},function(_0x284d55,_0x4e0884,_0x5ca6a0){return ActiveDirectoryAuthenticate(db[_0x4f42('0x26')],_0x284d55,_0x4e0884,_0x5ca6a0);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 67b93c6..0d86cc5 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 _0xe011=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x565b7b,_0x2e6420){var _0x580aaf=function(_0x366850){while(--_0x366850){_0x565b7b['push'](_0x565b7b['shift']());}};_0x580aaf(++_0x2e6420);}(_0xe011,0xb5));var _0x1e01=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xe011[_0x562faa];return _0xc70f59;};'use strict';var express=require('express');var router=express[_0x1e01('0x0')]();var controller=require(_0x1e01('0x1'));router[_0x1e01('0x2')]('/',controller[_0x1e01('0x3')]);module[_0x1e01('0x4')]=router; \ No newline at end of file +var _0x10be=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x146994,_0x26e478){var _0xcf1fb=function(_0x239977){while(--_0x239977){_0x146994['push'](_0x146994['shift']());}};_0xcf1fb(++_0x26e478);}(_0x10be,0x155));var _0xe10b=function(_0x3482ca,_0x84bd61){_0x3482ca=_0x3482ca-0x0;var _0x4956ac=_0x10be[_0x3482ca];return _0x4956ac;};'use strict';var express=require(_0xe10b('0x0'));var router=express[_0xe10b('0x1')]();var controller=require(_0xe10b('0x2'));router[_0xe10b('0x3')]('/',controller[_0xe10b('0x4')]);module[_0xe10b('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2d33c3f..9e7d398 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 _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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x42a65e,_0x316a8b){_0x42a65e=_0x42a65e-0x0;var _0x4a4670=_0x7a54[_0x42a65e];return _0x4a4670;};'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 +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(_0x154f66,_0x116f85){var _0x3f947a=function(_0x1f671e){while(--_0x1f671e){_0x154f66['push'](_0x154f66['shift']());}};_0x3f947a(++_0x116f85);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f6b0ec6..28140b9 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 _0x900a=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x4a6cb7,_0x48a3d5){var _0x3cc689=function(_0x1b96dc){while(--_0x1b96dc){_0x4a6cb7['push'](_0x4a6cb7['shift']());}};_0x3cc689(++_0x48a3d5);}(_0x900a,0xe7));var _0xa900=function(_0xefe512,_0x50ab6f){_0xefe512=_0xefe512-0x0;var _0x405fa8=_0x900a[_0xefe512];return _0x405fa8;};'use strict';var express=require(_0xa900('0x0'));var passport=require(_0xa900('0x1'));var router=express[_0xa900('0x2')]();var controller=require(_0xa900('0x3'));var userController=require(_0xa900('0x4'));var authService=require(_0xa900('0x5'));router[_0xa900('0x6')]('/',controller['login']);router['get'](_0xa900('0x7'),controller[_0xa900('0x8')],authService[_0xa900('0x9')],userController[_0xa900('0xa')],authService[_0xa900('0xb')]);module[_0xa900('0xc')]=router; \ No newline at end of file +var _0xa179=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa179,0x191));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x9a17('0x0'));var passport=require(_0x9a17('0x1'));var router=express[_0x9a17('0x2')]();var controller=require(_0x9a17('0x3'));var userController=require(_0x9a17('0x4'));var authService=require(_0x9a17('0x5'));router[_0x9a17('0x6')]('/',controller[_0x9a17('0x7')]);router[_0x9a17('0x6')]('/callback',controller[_0x9a17('0x8')],authService[_0x9a17('0x9')],userController[_0x9a17('0x7')],authService[_0x9a17('0xa')]);module[_0x9a17('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e476260..21d2db7 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 _0x3be7=['send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','util','passport','Strategy','jayson/promise','randomstring','moment','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','role','disabled','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','add','clearBlockUser','minutes','catch','getLicense','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status'];(function(_0x4cf372,_0x369d12){var _0xf08bf9=function(_0x1617fc){while(--_0x1617fc){_0x4cf372['push'](_0x4cf372['shift']());}};_0xf08bf9(++_0x369d12);}(_0x3be7,0x19c));var _0x73be=function(_0x482b80,_0x31b684){_0x482b80=_0x482b80-0x0;var _0x1608a0=_0x3be7[_0x482b80];return _0x1608a0;};'use strict';var util=require(_0x73be('0x0'));var passport=require(_0x73be('0x1'));var LocalStrategy=require('passport-local')[_0x73be('0x2')];var jayson=require(_0x73be('0x3'));var _=require('lodash');var rs=require(_0x73be('0x4'));var moment=require(_0x73be('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x73be('0x6'));var client=jayson[_0x73be('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x2eeb42,_0x3f635e,_0x52322a,_0x253441){var _0x157aeb,_0x5c6100;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x73be('0xa')],'raw':!![]})[_0x73be('0xb')](function(_0x331516){_0x157aeb=_0x331516;return _0x2eeb42[_0x73be('0x9')]({'attributes':['id','name',_0x73be('0xc'),_0x73be('0xd'),_0x73be('0xe'),_0x73be('0xf'),'blocked',_0x73be('0x10'),'loginAttempts'],'where':{'name':_0x3f635e,'role':{'$or':[_0x73be('0x11'),_0x73be('0x12'),_0x73be('0x13')]}}});})[_0x73be('0xb')](function(_0x447dd6){if(!_0x447dd6||_0x447dd6&&_0x447dd6[_0x73be('0x14')]!==_0x3f635e){throw new Error(_0x73be('0x15'));}else{_0x5c6100=_0x447dd6;return _0x5c6100;}})[_0x73be('0xb')](function(){_0x5c6100['authenticate'](_0x52322a,function(_0x18610d,_0x5619b1){var _0x1b87c5=_0x5c6100['loginAttempts']+0x1;if(_0x18610d){return _0x253441(_0x18610d);}else if(!_0x5619b1){if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])[_0x73be('0x18')](_0x157aeb[_0x73be('0xa')],'minutes')>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x1b87c5>=_0x157aeb[_0x73be('0x16')]){return utils[_0x73be('0x19')](_0x5c6100,0x0,!![],moment())['then'](function(){return _0x253441(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x73be('0x19')](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])['add'](_0x157aeb['blockDuration'],_0x73be('0x1a'))>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{return utils[_0x73be('0x19')](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);})[_0x73be('0x1b')](function(_0x1bc730){return _0x253441(null,![],_0x1bc730);});}}else{if(_0x5c6100['blocked']){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils[_0x73be('0x1c')](_0x5c6100)[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}}});})['catch'](function(_0x351974){return _0x253441(null,![],_0x351974);});}function sendServiceMail(_0xbe58b9){return db['MailAccount'][_0x73be('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x73be('0x14'),_0x73be('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x73be('0x1f'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x73be('0xb')](function(_0x5e54aa){if(!_0x5e54aa){throw new Error(_0x73be('0x20'));}var _0x45e736=_0x5e54aa[_0x73be('0x21')]();var _0x34d578={'account':_0x45e736,'message':_[_0x73be('0x22')]({'from':util[_0x73be('0x23')](_0x73be('0x24'),_0x5e54aa[_0x73be('0x14')],_0x5e54aa[_0x73be('0x1e')]||_0x5e54aa[_0x73be('0x1f')][_0x73be('0x12')])},_0xbe58b9)};return client[_0x73be('0x25')](_0x73be('0x26'),_0x34d578);})[_0x73be('0xb')](function(_0x75c6b2){if(_0x75c6b2[_0x73be('0x27')]){throw new Error(util['format'](_0x73be('0x28'),_0x75c6b2[_0x73be('0x27')][_0x73be('0x29')]||JSON[_0x73be('0x2a')](_0x75c6b2[_0x73be('0x27')])));}return!![];});}function handleError(_0x11b1ba,_0x45c0f0,_0x28c922){return _0x11b1ba[_0x73be('0x2b')](_0x45c0f0||0x1f4)[_0x73be('0x2c')]({'message':_0x28c922?_0x28c922[_0x73be('0x29')]||_0x28c922:''});}exports[_0x73be('0x2d')]=function(_0xcae45c,_0x3b2f13,_0x2660e4){passport[_0x73be('0x2e')]('local-login',function(_0x39a03a,_0x114551,_0x23de8c){var _0x4b12e4=_0x39a03a||_0x23de8c;if(_0x4b12e4){return handleError(_0x3b2f13,0x191,_0x4b12e4);}if(!_0x114551){return handleError(_0x3b2f13,0x194,{'message':_0x73be('0x2f')});}else{var _0xf1d856={'payload':{'id':_0x114551['id'],'role':_0x114551[_0x73be('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x73be('0x30')](_0xf1d856)[_0x73be('0xb')](function(_0x396d3d){_0x3b2f13[_0x73be('0x31')]({'id':_0x114551['id'],'token':_0x396d3d,'statusCall':'','isAlreadyLogged':_0x114551['online']});});}})(_0xcae45c,_0x3b2f13,_0x2660e4);};exports['forgot']=function(_0x337ed5,_0x1ad96f){if(!_0x337ed5[_0x73be('0x32')]['email']){return handleError(_0x1ad96f,0x1f4,{'message':_0x73be('0x33')});}var _0x346381=rs[_0x73be('0x34')]();_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')]=_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')][_0x73be('0x35')]()[_0x73be('0x36')]();var _0x164287;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':[_0x73be('0x16'),'blockDuration'],'raw':!![]})[_0x73be('0xb')](function(_0xe76a47){_0x164287=_0xe76a47;return db[_0x73be('0x37')][_0x73be('0x1d')]({'where':{'email':_0x337ed5[_0x73be('0x32')]['email']}});})['then'](function(_0x4ceb0b){if(!_0x4ceb0b){throw new Error(_0x73be('0x38'));}if(_0x4ceb0b[_0x73be('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4ceb0b[_0x73be('0x17')]){if(moment(_0x4ceb0b[_0x73be('0x10')])[_0x73be('0x18')](_0x164287['blockDuration'],_0x73be('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4ceb0b[_0x73be('0x17')]=![];_0x4ceb0b[_0x73be('0x10')]=null;}}_0x4ceb0b[_0x73be('0x39')]=_0x346381;_0x4ceb0b['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x4ceb0b[_0x73be('0x3a')]();})[_0x73be('0xb')](function(){return sendServiceMail({'to':_0x337ed5[_0x73be('0x32')]['email'],'subject':_0x73be('0x3b'),'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'+'https://'+_0x337ed5['headers'][_0x73be('0x3c')]+_0x73be('0x3d')+_0x346381+'\x0a\x0a'+_0x73be('0x3e')});})[_0x73be('0xb')](function(){_0x1ad96f[_0x73be('0x2b')](0xc8)['send']({'message':_0x73be('0x3f')});})['catch'](function(_0x41c0aa){return handleError(_0x1ad96f,0x1f4,_0x41c0aa);});};exports[_0x73be('0x40')]=function(_0x4be0bd,_0x19452d){return db[_0x73be('0x37')]['find']({'where':{'resetPasswordToken':_0x4be0bd[_0x73be('0x41')][_0x73be('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x73be('0xb')](function(_0x3c9188){if(!_0x3c9188){throw new Error(_0x73be('0x43'));}return db[_0x73be('0x8')]['findOne']({'attributes':['id',_0x73be('0x44'),_0x73be('0x45'),'passwordHistoryLimit']})[_0x73be('0xb')](function(_0x4bc574){if(_0x4bc574[_0x73be('0x44')])authService[_0x73be('0x46')](_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')]);if(!_0x4bc574[_0x73be('0x45')]||!_0x3c9188[_0x73be('0x47')])return _0x3c9188;authService[_0x73be('0x48')](_0x4be0bd['body'][_0x73be('0xc')],_0x3c9188['previousPasswords'],_0x4bc574[_0x73be('0x49')]);return _0x3c9188;})[_0x73be('0xb')](function(){_0x3c9188[_0x73be('0xc')]=_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')];_0x3c9188[_0x73be('0x39')]=null;_0x3c9188[_0x73be('0x4a')]=null;return _0x3c9188['save']();});})[_0x73be('0xb')](function(){_0x19452d[_0x73be('0x2b')](0xc8)[_0x73be('0x2c')]({'message':_0x73be('0x4b')});})[_0x73be('0x1b')](function(_0xc7fca6){return handleError(_0x19452d,0x1f4,_0xc7fca6);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x73be('0x14'),'passwordField':'password'},function(_0x54e245,_0x1b3584,_0xcb2c42){return localAuthenticate(db[_0x73be('0x37')],_0x54e245,_0x1b3584,_0xcb2c42);})); \ No newline at end of file +var _0x76e4=['json','online','forgot','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','blockedAt','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','util','passport','passport-local','jayson/promise','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','blockDuration','name','password','salt','role','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','minutes','clearBlockUser','disabled','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x14c9f3,_0x303a11){var _0x347b6c=function(_0x4ecf47){while(--_0x4ecf47){_0x14c9f3['push'](_0x14c9f3['shift']());}};_0x347b6c(++_0x303a11);}(_0x76e4,0x117));var _0x476e=function(_0x4c807e,_0x12e32a){_0x4c807e=_0x4c807e-0x0;var _0x56e739=_0x76e4[_0x4c807e];return _0x56e739;};'use strict';var util=require(_0x476e('0x0'));var passport=require(_0x476e('0x1'));var LocalStrategy=require(_0x476e('0x2'))['Strategy'];var jayson=require(_0x476e('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x476e('0x4'));var db=require(_0x476e('0x5'))['db'];var authService=require(_0x476e('0x6'));var utils=require('../../config/utils');var client=jayson[_0x476e('0x7')][_0x476e('0x8')]({'port':0x232b});function localAuthenticate(_0x344cb3,_0x4b4dfe,_0x214d31,_0x3e166a){var _0x1263d,_0x182648;return db[_0x476e('0x9')][_0x476e('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x476e('0xb')],'raw':!![]})['then'](function(_0x41c1f0){_0x1263d=_0x41c1f0;return _0x344cb3[_0x476e('0xa')]({'attributes':['id',_0x476e('0xc'),_0x476e('0xd'),_0x476e('0xe'),_0x476e('0xf'),'disabled',_0x476e('0x10'),'blockedAt',_0x476e('0x11')],'where':{'name':_0x4b4dfe,'role':{'$or':[_0x476e('0x12'),_0x476e('0x13'),_0x476e('0x14')]}}});})[_0x476e('0x15')](function(_0x50f03d){if(!_0x50f03d||_0x50f03d&&_0x50f03d[_0x476e('0xc')]!==_0x4b4dfe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x182648=_0x50f03d;return _0x182648;}})[_0x476e('0x15')](function(){_0x182648['authenticate'](_0x214d31,function(_0x3b1a55,_0x427fc1){var _0x45dc92=_0x182648[_0x476e('0x11')]+0x1;if(_0x3b1a55){return _0x3e166a(_0x3b1a55);}else if(!_0x427fc1){if(_0x182648['disabled']){return _0x3e166a(null,![],{'message':_0x476e('0x16')});}else if(_0x1263d[_0x476e('0x17')]>0x0){if(_0x182648[_0x476e('0x10')]){if(_0x1263d[_0x476e('0xb')]>0x0){if(moment(_0x182648['blockedAt'])['add'](_0x1263d[_0x476e('0xb')],_0x476e('0x18'))>moment()){return _0x3e166a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x182648,_0x45dc92,![],null)[_0x476e('0x15')](function(){return _0x3e166a(null,![],{'message':_0x476e('0x16')});});}}else{return _0x3e166a(null,![],{'message':_0x476e('0x16')});}}else{if(_0x45dc92>=_0x1263d[_0x476e('0x17')]){return utils[_0x476e('0x19')](_0x182648,0x0,!![],moment())[_0x476e('0x15')](function(){return _0x3e166a(null,![],{'message':_0x476e('0x16')});});}else{return utils[_0x476e('0x19')](_0x182648,_0x45dc92,![],null)[_0x476e('0x15')](function(){return _0x3e166a(null,![],{'message':_0x476e('0x16')});});}}}else{return _0x3e166a(null,![],{'message':_0x476e('0x16')});}}else{if(_0x182648[_0x476e('0x1a')]){return _0x3e166a(null,![],{'message':_0x476e('0x16')});}else if(_0x1263d[_0x476e('0x17')]>0x0){if(_0x182648[_0x476e('0x10')]){if(_0x1263d[_0x476e('0xb')]>0x0){if(moment(_0x182648['blockedAt'])[_0x476e('0x1b')](_0x1263d[_0x476e('0xb')],_0x476e('0x18'))>moment()){return _0x3e166a(null,![],{'message':_0x476e('0x16')});}else{return utils[_0x476e('0x19')](_0x182648,0x0,![],null)[_0x476e('0x15')](function(){return utils[_0x476e('0x1c')](_0x182648);})[_0x476e('0x15')](function(){return _0x3e166a(null,_0x182648);});}}else{return _0x3e166a(null,![],{'message':_0x476e('0x16')});}}else{return utils[_0x476e('0x19')](_0x182648,0x0,![],null)[_0x476e('0x15')](function(){return utils[_0x476e('0x1c')](_0x182648);})['then'](function(){return _0x3e166a(null,_0x182648);})['catch'](function(_0x554056){return _0x3e166a(null,![],_0x554056);});}}else{if(_0x182648[_0x476e('0x10')]){return _0x3e166a(null,![],{'message':_0x476e('0x16')});}else{return utils[_0x476e('0x1c')](_0x182648)['then'](function(){return _0x3e166a(null,_0x182648);});}}}});})[_0x476e('0x1d')](function(_0x578dd9){return _0x3e166a(null,![],_0x578dd9);});}function sendServiceMail(_0x568d6a){return db['MailAccount'][_0x476e('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x476e('0xc'),_0x476e('0x1f')],'include':[{'model':db[_0x476e('0x20')],'as':_0x476e('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x476e('0x22')}]}]})[_0x476e('0x15')](function(_0x5d9e5e){if(!_0x5d9e5e){throw new Error(_0x476e('0x23'));}var _0x262e39=_0x5d9e5e[_0x476e('0x24')]();var _0x3c686f={'account':_0x262e39,'message':_[_0x476e('0x25')]({'from':util[_0x476e('0x26')]('\x22%s\x22\x20<%s>',_0x5d9e5e[_0x476e('0xc')],_0x5d9e5e[_0x476e('0x1f')]||_0x5d9e5e[_0x476e('0x21')][_0x476e('0x13')])},_0x568d6a)};return client[_0x476e('0x27')]('SendMail',_0x3c686f);})['then'](function(_0x1c2cd8){if(_0x1c2cd8['error']){throw new Error(util[_0x476e('0x26')](_0x476e('0x28'),_0x1c2cd8[_0x476e('0x29')][_0x476e('0x2a')]||JSON['stringify'](_0x1c2cd8[_0x476e('0x29')])));}return!![];});}function handleError(_0xba18b9,_0x705ebd,_0x16c315){return _0xba18b9[_0x476e('0x2b')](_0x705ebd||0x1f4)['send']({'message':_0x16c315?_0x16c315[_0x476e('0x2a')]||_0x16c315:''});}exports[_0x476e('0x2c')]=function(_0xefb290,_0x15d8f4,_0x27b727){passport[_0x476e('0x2d')](_0x476e('0x2e'),function(_0x35d394,_0x48140e,_0x3d496a){var _0x418332=_0x35d394||_0x3d496a;if(_0x418332){return handleError(_0x15d8f4,0x191,_0x418332);}if(!_0x48140e){return handleError(_0x15d8f4,0x194,{'message':_0x476e('0x2f')});}else{var _0x55aeb8={'payload':{'id':_0x48140e['id'],'role':_0x48140e[_0x476e('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x476e('0x30')](_0x55aeb8)[_0x476e('0x15')](function(_0x2a2c6d){_0x15d8f4[_0x476e('0x31')]({'id':_0x48140e['id'],'token':_0x2a2c6d,'statusCall':'','isAlreadyLogged':_0x48140e[_0x476e('0x32')]});});}})(_0xefb290,_0x15d8f4,_0x27b727);};exports[_0x476e('0x33')]=function(_0x45a7ac,_0x2e6fc0){if(!_0x45a7ac[_0x476e('0x34')][_0x476e('0x1f')]){return handleError(_0x2e6fc0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x52cabb=rs[_0x476e('0x35')]();_0x45a7ac[_0x476e('0x34')]['email']=_0x45a7ac[_0x476e('0x34')][_0x476e('0x1f')][_0x476e('0x36')]()[_0x476e('0x37')]();var _0x13faf5;return db[_0x476e('0x9')][_0x476e('0xa')]({'where':{'id':0x1},'attributes':[_0x476e('0x17'),_0x476e('0xb')],'raw':!![]})[_0x476e('0x15')](function(_0x343d31){_0x13faf5=_0x343d31;return db[_0x476e('0x38')][_0x476e('0x1e')]({'where':{'email':_0x45a7ac[_0x476e('0x34')][_0x476e('0x1f')]}});})[_0x476e('0x15')](function(_0x1582d0){if(!_0x1582d0){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1582d0['disabled']){throw new Error(_0x476e('0x39'));}if(_0x1582d0[_0x476e('0x10')]){if(moment(_0x1582d0['blockedAt'])['add'](_0x13faf5[_0x476e('0xb')],'minutes')>moment()){throw new Error(_0x476e('0x3a'));}else{_0x1582d0[_0x476e('0x10')]=![];_0x1582d0[_0x476e('0x3b')]=null;}}_0x1582d0[_0x476e('0x3c')]=_0x52cabb;_0x1582d0[_0x476e('0x3d')]=Date[_0x476e('0x3e')]()+0x36ee80;return _0x1582d0[_0x476e('0x3f')]();})[_0x476e('0x15')](function(){return sendServiceMail({'to':_0x45a7ac[_0x476e('0x34')][_0x476e('0x1f')],'subject':_0x476e('0x40'),'text':_0x476e('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x476e('0x42')+_0x45a7ac[_0x476e('0x43')]['host']+_0x476e('0x44')+_0x52cabb+'\x0a\x0a'+_0x476e('0x45')});})[_0x476e('0x15')](function(){_0x2e6fc0['status'](0xc8)[_0x476e('0x46')]({'message':_0x476e('0x47')});})['catch'](function(_0x26c28d){return handleError(_0x2e6fc0,0x1f4,_0x26c28d);});};exports[_0x476e('0x48')]=function(_0x51b4ec,_0x5e8144){return db[_0x476e('0x38')][_0x476e('0x1e')]({'where':{'resetPasswordToken':_0x51b4ec[_0x476e('0x49')][_0x476e('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x476e('0x3e')]()}}})[_0x476e('0x15')](function(_0x3f6f20){if(!_0x3f6f20){throw new Error(_0x476e('0x4b'));}return db[_0x476e('0x9')][_0x476e('0xa')]({'attributes':['id',_0x476e('0x4c'),_0x476e('0x4d'),'passwordHistoryLimit']})['then'](function(_0x24d6e4){if(_0x24d6e4['securePassword'])authService[_0x476e('0x4e')](_0x51b4ec[_0x476e('0x34')][_0x476e('0xd')]);if(!_0x24d6e4[_0x476e('0x4d')]||!_0x3f6f20[_0x476e('0x4f')])return _0x3f6f20;authService[_0x476e('0x50')](_0x51b4ec['body'][_0x476e('0xd')],_0x3f6f20[_0x476e('0x4f')],_0x24d6e4[_0x476e('0x51')]);return _0x3f6f20;})[_0x476e('0x15')](function(){_0x3f6f20[_0x476e('0xd')]=_0x51b4ec[_0x476e('0x34')][_0x476e('0xd')];_0x3f6f20['resetPasswordToken']=null;_0x3f6f20[_0x476e('0x3d')]=null;return _0x3f6f20[_0x476e('0x3f')]();});})[_0x476e('0x15')](function(){_0x5e8144[_0x476e('0x2b')](0xc8)[_0x476e('0x46')]({'message':'Password\x20reset!'});})[_0x476e('0x1d')](function(_0x4bcbd0){return handleError(_0x5e8144,0x1f4,_0x4bcbd0);});};passport['use'](_0x476e('0x2e'),new LocalStrategy({'usernameField':_0x476e('0xc'),'passwordField':_0x476e('0xd')},function(_0x5aef85,_0x333153,_0x2989a5){return localAuthenticate(db['User'],_0x5aef85,_0x333153,_0x2989a5);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 808b36f..4d59a7c 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 _0xcb97=['login','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcb97,0x197));var _0x7cb9=function(_0xd4964d,_0x214ea0){_0xd4964d=_0xd4964d-0x0;var _0x4aa6c1=_0xcb97[_0xd4964d];return _0x4aa6c1;};'use strict';var express=require(_0x7cb9('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x7cb9('0x1')]);router[_0x7cb9('0x2')](_0x7cb9('0x3'),controller[_0x7cb9('0x4')]);router[_0x7cb9('0x2')](_0x7cb9('0x5'),controller[_0x7cb9('0x6')]);module[_0x7cb9('0x7')]=router; \ No newline at end of file +var _0xdbf5=['exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0xdbf5,0xf1));var _0x5dbf=function(_0x38d161,_0x53f9e7){_0x38d161=_0x38d161-0x0;var _0x54ca68=_0xdbf5[_0x38d161];return _0x54ca68;};'use strict';var express=require(_0x5dbf('0x0'));var router=express[_0x5dbf('0x1')]();var controller=require(_0x5dbf('0x2'));router[_0x5dbf('0x3')]('/',controller['login']);router[_0x5dbf('0x3')](_0x5dbf('0x4'),controller[_0x5dbf('0x5')]);router[_0x5dbf('0x3')](_0x5dbf('0x6'),controller['reset']);module[_0x5dbf('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 cf530c6..bc83dc1 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 _0x75c9=['exports','STRING','INTEGER','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x75c9,0x173));var _0x975c=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x75c9[_0x46401e];return _0x447cba;};'use strict';var Sequelize=require(_0x975c('0x0'));module[_0x975c('0x1')]={'name':{'type':Sequelize[_0x975c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x975c('0x2')]},'description':{'type':Sequelize[_0x975c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x975c('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe87c=['STRING','sequelize'];(function(_0x1b81b9,_0x15d051){var _0x48d256=function(_0x4a2f91){while(--_0x4a2f91){_0x1b81b9['push'](_0x1b81b9['shift']());}};_0x48d256(++_0x15d051);}(_0xe87c,0x1c9));var _0xce87=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xe87c[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0xce87('0x0'));module['exports']={'name':{'type':Sequelize[_0xce87('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xce87('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 85c9a3d..2b7fcc5 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 _0x53af=['body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create'];(function(_0x5b7221,_0xcd1f7d){var _0x5b479=function(_0x2c1431){while(--_0x2c1431){_0x5b7221['push'](_0x5b7221['shift']());}};_0x5b479(++_0xcd1f7d);}(_0x53af,0x1f0));var _0xf53a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53af[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xf53a('0x0'));var rimraf=require(_0xf53a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf53a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf53a('0x3'));var Mustache=require(_0xf53a('0x4'));var util=require(_0xf53a('0x5'));var path=require('path');var sox=require(_0xf53a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf53a('0x7'));var squel=require(_0xf53a('0x8'));var crypto=require(_0xf53a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf53a('0xa'));var toCsv=require(_0xf53a('0xb'));var querystring=require(_0xf53a('0xc'));var Papa=require('papaparse');var Redis=require(_0xf53a('0xd'));var authService=require(_0xf53a('0xe'));var qs=require(_0xf53a('0xf'));var as=require(_0xf53a('0x10'));var hardwareService=require(_0xf53a('0x11'));var logger=require(_0xf53a('0x12'))(_0xf53a('0x13'));var utils=require('../../config/utils');var config=require(_0xf53a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf53a('0x15'))['db'];function respondWithStatusCode(_0x4ff6f5,_0x30ceee){_0x30ceee=_0x30ceee||0xcc;return function(_0x2a5cad){if(_0x2a5cad){return _0x4ff6f5[_0xf53a('0x16')](_0x30ceee);}return _0x4ff6f5[_0xf53a('0x17')](_0x30ceee)[_0xf53a('0x18')]();};}function respondWithResult(_0x196d99,_0x16509d){_0x16509d=_0x16509d||0xc8;return function(_0x5c1d39){if(_0x5c1d39){return _0x196d99[_0xf53a('0x17')](_0x16509d)['json'](_0x5c1d39);}};}function respondWithFilteredResult(_0x32b96f,_0x2bc686){return function(_0x3e8891){if(_0x3e8891){var _0x34eb60=typeof _0x2bc686[_0xf53a('0x19')]==='undefined'&&typeof _0x2bc686[_0xf53a('0x1a')]===_0xf53a('0x1b');var _0x53e4a0=_0x3e8891[_0xf53a('0x1c')];var _0x411e27=_0x34eb60?0x0:_0x2bc686[_0xf53a('0x19')];var _0x97fc81=_0x34eb60?_0x3e8891['count']:_0x2bc686[_0xf53a('0x19')]+_0x2bc686['limit'];var _0x4ea05e;if(_0x97fc81>=_0x53e4a0){_0x97fc81=_0x53e4a0;_0x4ea05e=0xc8;}else{_0x4ea05e=0xce;}_0x32b96f[_0xf53a('0x17')](_0x4ea05e);return _0x32b96f[_0xf53a('0x1d')]('Content-Range',_0x411e27+'-'+_0x97fc81+'/'+_0x53e4a0)[_0xf53a('0x1e')](_0x3e8891);}return null;};}function patchUpdates(_0x31855a){return function(_0x687cb0){try{jsonpatch[_0xf53a('0x1f')](_0x687cb0,_0x31855a,!![]);}catch(_0x3e1967){return BPromise[_0xf53a('0x20')](_0x3e1967);}return _0x687cb0[_0xf53a('0x21')]();};}function saveUpdates(_0x3efd26,_0x4e2857){return function(_0x67252d){if(_0x67252d){return _0x67252d[_0xf53a('0x22')](_0x3efd26)[_0xf53a('0x23')](function(_0x81d012){return _0x81d012;});}return null;};}function removeEntity(_0x36c502,_0x2c4150){return function(_0xffad46){if(_0xffad46){return _0xffad46[_0xf53a('0x24')]()[_0xf53a('0x23')](function(){_0x36c502[_0xf53a('0x17')](0xcc)[_0xf53a('0x18')]();});}};}function handleEntityNotFound(_0x288611,_0x4226f7){return function(_0x33d4b9){if(!_0x33d4b9){_0x288611[_0xf53a('0x16')](0x194);}return _0x33d4b9;};}function handleError(_0x29157f,_0xdd70f7){_0xdd70f7=_0xdd70f7||0x1f4;return function(_0x12b96b){logger[_0xf53a('0x25')](_0x12b96b['stack']);if(_0x12b96b[_0xf53a('0x26')]){delete _0x12b96b[_0xf53a('0x26')];}_0x29157f[_0xf53a('0x17')](_0xdd70f7)[_0xf53a('0x27')](_0x12b96b);};}exports[_0xf53a('0x28')]=function(_0x33b4fe,_0x2da669){var _0x4f248c={},_0x4a7d72={},_0x13ff86={'count':0x0,'rows':[]};var _0x29b2ec=_[_0xf53a('0x29')](db[_0xf53a('0x2a')][_0xf53a('0x2b')],function(_0x3d2ea6){return{'name':_0x3d2ea6['fieldName'],'type':_0x3d2ea6[_0xf53a('0x2c')][_0xf53a('0x2d')]};});_0x4a7d72[_0xf53a('0x2e')]=_[_0xf53a('0x29')](_0x29b2ec,_0xf53a('0x26'));_0x4a7d72[_0xf53a('0x2f')]=_['keys'](_0x33b4fe[_0xf53a('0x2f')]);_0x4a7d72[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x4a7d72[_0xf53a('0x2e')],_0x4a7d72[_0xf53a('0x2f')]);_0x4f248c[_0xf53a('0x32')]=_['intersection'](_0x4a7d72[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x33b4fe['query'][_0xf53a('0x33')]));_0x4f248c[_0xf53a('0x32')]=_0x4f248c[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4f248c['attributes']:_0x4a7d72['model'];if(!_0x33b4fe['query'][_0xf53a('0x35')](_0xf53a('0x36'))){_0x4f248c[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4f248c['offset']=qs[_0xf53a('0x19')](_0x33b4fe['query']['offset']);}_0x4f248c[_0xf53a('0x37')]=qs[_0xf53a('0x38')](_0x33b4fe[_0xf53a('0x2f')]['sort']);_0x4f248c[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x33b4fe[_0xf53a('0x2f')],_0x4a7d72['filters']),_0x29b2ec);if(_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4f248c['where']=_[_0xf53a('0x3b')](_0x4f248c[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x29b2ec,function(_0x48701a){if(_0x48701a[_0xf53a('0x2c')]!==_0xf53a('0x3c')){var _0x3cd474={};_0x3cd474[_0x48701a[_0xf53a('0x26')]]={'$like':'%'+_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x3cd474;}})});}_0x4f248c=_[_0xf53a('0x3b')]({},_0x4f248c,_0x33b4fe[_0xf53a('0x3d')]);var _0x5e82f5={'where':_0x4f248c['where']};return db[_0xf53a('0x2a')][_0xf53a('0x1c')](_0x5e82f5)[_0xf53a('0x23')](function(_0x6583ee){_0x13ff86[_0xf53a('0x1c')]=_0x6583ee;if(_0x33b4fe['query'][_0xf53a('0x3e')]){_0x4f248c[_0xf53a('0x3f')]=[{'all':!![]}];}return db[_0xf53a('0x2a')][_0xf53a('0x40')](_0x4f248c);})[_0xf53a('0x23')](function(_0x1b0f7c){_0x13ff86[_0xf53a('0x41')]=_0x1b0f7c;return _0x13ff86;})['then'](respondWithFilteredResult(_0x2da669,_0x4f248c))['catch'](handleError(_0x2da669,null));};exports['show']=function(_0x421f43,_0x2095d1){var _0x3f04be={'raw':![],'where':{'id':_0x421f43[_0xf53a('0x42')]['id']}},_0x49a3c3={};_0x49a3c3[_0xf53a('0x2e')]=_[_0xf53a('0x43')](db[_0xf53a('0x2a')][_0xf53a('0x2b')]);_0x49a3c3[_0xf53a('0x2f')]=_['keys'](_0x421f43[_0xf53a('0x2f')]);_0x49a3c3[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],_0x49a3c3[_0xf53a('0x2f')]);_0x3f04be[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x421f43[_0xf53a('0x2f')]['fields']));_0x3f04be[_0xf53a('0x32')]=_0x3f04be['attributes'][_0xf53a('0x34')]?_0x3f04be[_0xf53a('0x32')]:_0x49a3c3[_0xf53a('0x2e')];if(_0x421f43[_0xf53a('0x2f')][_0xf53a('0x3e')]){_0x3f04be[_0xf53a('0x3f')]=[{'all':!![]}];}_0x3f04be=_[_0xf53a('0x3b')]({},_0x3f04be,_0x421f43['options']);return db['Automation'][_0xf53a('0x44')](_0x3f04be)['then'](handleEntityNotFound(_0x2095d1,null))[_0xf53a('0x23')](respondWithResult(_0x2095d1,null))[_0xf53a('0x45')](handleError(_0x2095d1,null));};exports[_0xf53a('0x46')]=function(_0x18f720,_0x35d716){return db[_0xf53a('0x2a')][_0xf53a('0x46')](_0x18f720[_0xf53a('0x47')],{})['then'](respondWithResult(_0x35d716,0xc9))[_0xf53a('0x45')](handleError(_0x35d716,null));};exports[_0xf53a('0x22')]=function(_0x55a214,_0xcfc2cb){if(_0x55a214[_0xf53a('0x47')]['id']){delete _0x55a214['body']['id'];}return db[_0xf53a('0x2a')][_0xf53a('0x44')]({'where':{'id':_0x55a214[_0xf53a('0x42')]['id']}})['then'](handleEntityNotFound(_0xcfc2cb,null))[_0xf53a('0x23')](saveUpdates(_0x55a214[_0xf53a('0x47')],null))[_0xf53a('0x23')](respondWithResult(_0xcfc2cb,null))[_0xf53a('0x45')](handleError(_0xcfc2cb,null));};exports[_0xf53a('0x24')]=function(_0x5bf337,_0x3ea286){return db['Automation'][_0xf53a('0x44')]({'where':{'id':_0x5bf337[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x3ea286,null))[_0xf53a('0x23')](removeEntity(_0x3ea286,null))[_0xf53a('0x45')](handleError(_0x3ea286,null));};exports[_0xf53a('0x48')]=function(_0x1774d5,_0x2d1298,_0x70bb63){return db[_0xf53a('0x49')][_0xf53a('0x44')]({'where':{'id':_0x1774d5[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x2d1298,null))[_0xf53a('0x23')](function(_0x524291){if(_0x524291){return _0x524291[_0xf53a('0x48')](_0x1774d5[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x1774d5[_0xf53a('0x47')],[_0xf53a('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x2d1298,null))[_0xf53a('0x45')](handleError(_0x2d1298,null));};exports[_0xf53a('0x4c')]=function(_0x47ee04,_0x200ab5,_0x3bbcee){var _0x138034={};var _0x38aee8={};var _0x3b1436;var _0xdb87a0;return db[_0xf53a('0x2a')]['findOne']({'where':{'id':_0x47ee04[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x200ab5,null))[_0xf53a('0x23')](function(_0x122d82){if(_0x122d82){_0x3b1436=_0x122d82;_0x38aee8['model']=_[_0xf53a('0x43')](db[_0xf53a('0x49')]['rawAttributes']);_0x38aee8[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x47ee04[_0xf53a('0x2f')]);_0x38aee8[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],_0x38aee8[_0xf53a('0x2f')]);_0x138034[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x138034['attributes']=_0x138034[_0xf53a('0x32')][_0xf53a('0x34')]?_0x138034[_0xf53a('0x32')]:_0x38aee8[_0xf53a('0x2e')];_0x138034[_0xf53a('0x37')]=qs['sort'](_0x47ee04[_0xf53a('0x2f')]['sort']);_0x138034[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x47ee04[_0xf53a('0x2f')],_0x38aee8[_0xf53a('0x30')]));if(_0x47ee04[_0xf53a('0x2f')]['filter']){_0x138034[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x138034[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x138034[_0xf53a('0x32')],function(_0x1aa3f8){var _0x1fba7c={};_0x1fba7c[_0x1aa3f8]={'$like':'%'+_0x47ee04[_0xf53a('0x2f')]['filter']+'%'};return _0x1fba7c;})});}_0x138034=_[_0xf53a('0x3b')]({},_0x138034,_0x47ee04[_0xf53a('0x3d')]);return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})['then'](function(_0x3ff77d){if(_0x3ff77d){_0xdb87a0=_0x3ff77d[_0xf53a('0x34')];if(!_0x47ee04[_0xf53a('0x2f')]['hasOwnProperty'](_0xf53a('0x36'))){_0x138034[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x47ee04['query'][_0xf53a('0x1a')]);_0x138034['offset']=qs['offset'](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})[_0xf53a('0x23')](function(_0x137f32){if(_0x137f32){return _0x137f32?{'count':_0xdb87a0,'rows':_0x137f32}:null;}})[_0xf53a('0x23')](respondWithResult(_0x200ab5,null))[_0xf53a('0x45')](handleError(_0x200ab5,null));};exports[_0xf53a('0x4d')]=function(_0x11630c,_0x388f05,_0x3f0d31){return db[_0xf53a('0x4e')][_0xf53a('0x44')]({'where':{'id':_0x11630c[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x388f05,null))['then'](function(_0x4777b4){if(_0x4777b4){return _0x4777b4[_0xf53a('0x4d')](_0x11630c[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x11630c['body'],[_0xf53a('0x4a'),'id'])||{});}})[_0xf53a('0x23')](respondWithResult(_0x388f05,null))['catch'](handleError(_0x388f05,null));};exports[_0xf53a('0x4f')]=function(_0x220828,_0x533a69,_0x2cd02d){var _0x4e3e73={};var _0xb0e7a9={};var _0x2e9284;var _0x3d9971;return db[_0xf53a('0x2a')][_0xf53a('0x50')]({'where':{'id':_0x220828[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x533a69,null))[_0xf53a('0x23')](function(_0x5238f6){if(_0x5238f6){_0x2e9284=_0x5238f6;_0xb0e7a9[_0xf53a('0x2e')]=_['keys'](db[_0xf53a('0x4e')]['rawAttributes']);_0xb0e7a9[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x220828[_0xf53a('0x2f')]);_0xb0e7a9[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0xb0e7a9[_0xf53a('0x2e')],_0xb0e7a9[_0xf53a('0x2f')]);_0x4e3e73[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0xb0e7a9['model'],qs[_0xf53a('0x33')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x4e3e73[_0xf53a('0x32')]=_0x4e3e73[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4e3e73[_0xf53a('0x32')]:_0xb0e7a9[_0xf53a('0x2e')];_0x4e3e73['order']=qs[_0xf53a('0x38')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x38')]);_0x4e3e73[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x220828[_0xf53a('0x2f')],_0xb0e7a9[_0xf53a('0x30')]));if(_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4e3e73[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x4e3e73['where'],{'$or':_[_0xf53a('0x29')](_0x4e3e73[_0xf53a('0x32')],function(_0x4d5a8c){var _0x698dd1={};_0x698dd1[_0x4d5a8c]={'$like':'%'+_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x698dd1;})});}_0x4e3e73=_[_0xf53a('0x3b')]({},_0x4e3e73,_0x220828[_0xf53a('0x3d')]);return _0x2e9284['getActions'](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x2c8e7b){if(_0x2c8e7b){_0x3d9971=_0x2c8e7b[_0xf53a('0x34')];if(!_0x220828[_0xf53a('0x2f')][_0xf53a('0x35')]('nolimit')){_0x4e3e73[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4e3e73['offset']=qs['offset'](_0x220828[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x2e9284[_0xf53a('0x4f')](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x9e0940){if(_0x9e0940){return _0x9e0940?{'count':_0x3d9971,'rows':_0x9e0940}:null;}})[_0xf53a('0x23')](respondWithResult(_0x533a69,null))[_0xf53a('0x45')](handleError(_0x533a69,null));}; \ No newline at end of file +var _0x59ed=['merge','filter','options','includeAll','findAll','rows','catch','show','params','find','create','update','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','stack','send','map','Automation','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x59ed,0xbc));var _0xd59e=function(_0x1b591b,_0x6d2e2b){_0x1b591b=_0x1b591b-0x0;var _0x3c24f0=_0x59ed[_0x1b591b];return _0x3c24f0;};'use strict';var emlformat=require(_0xd59e('0x0'));var rimraf=require(_0xd59e('0x1'));var zipdir=require(_0xd59e('0x2'));var jsonpatch=require(_0xd59e('0x3'));var rp=require('request-promise');var moment=require(_0xd59e('0x4'));var BPromise=require(_0xd59e('0x5'));var Mustache=require(_0xd59e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd59e('0x7'));var ejs=require(_0xd59e('0x8'));var fs=require('fs');var fs_extra=require(_0xd59e('0x9'));var _=require('lodash');var squel=require(_0xd59e('0xa'));var crypto=require(_0xd59e('0xb'));var jsforce=require(_0xd59e('0xc'));var deskjs=require(_0xd59e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd59e('0xe'));var Papa=require(_0xd59e('0xf'));var Redis=require('ioredis');var authService=require(_0xd59e('0x10'));var qs=require(_0xd59e('0x11'));var as=require(_0xd59e('0x12'));var hardwareService=require(_0xd59e('0x13'));var logger=require(_0xd59e('0x14'))(_0xd59e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd59e('0x16'));var db=require(_0xd59e('0x17'))['db'];function respondWithStatusCode(_0x254657,_0x309b7b){_0x309b7b=_0x309b7b||0xcc;return function(_0x597c98){if(_0x597c98){return _0x254657[_0xd59e('0x18')](_0x309b7b);}return _0x254657[_0xd59e('0x19')](_0x309b7b)[_0xd59e('0x1a')]();};}function respondWithResult(_0x31ef84,_0x51edc3){_0x51edc3=_0x51edc3||0xc8;return function(_0xd45b28){if(_0xd45b28){return _0x31ef84[_0xd59e('0x19')](_0x51edc3)['json'](_0xd45b28);}};}function respondWithFilteredResult(_0x2dff32,_0x145868){return function(_0x5b37fc){if(_0x5b37fc){var _0x1e82d0=typeof _0x145868[_0xd59e('0x1b')]===_0xd59e('0x1c')&&typeof _0x145868[_0xd59e('0x1d')]==='undefined';var _0x28e39e=_0x5b37fc[_0xd59e('0x1e')];var _0x1399ca=_0x1e82d0?0x0:_0x145868[_0xd59e('0x1b')];var _0x52bb37=_0x1e82d0?_0x5b37fc[_0xd59e('0x1e')]:_0x145868[_0xd59e('0x1b')]+_0x145868[_0xd59e('0x1d')];var _0x28bcc5;if(_0x52bb37>=_0x28e39e){_0x52bb37=_0x28e39e;_0x28bcc5=0xc8;}else{_0x28bcc5=0xce;}_0x2dff32['status'](_0x28bcc5);return _0x2dff32[_0xd59e('0x1f')](_0xd59e('0x20'),_0x1399ca+'-'+_0x52bb37+'/'+_0x28e39e)[_0xd59e('0x21')](_0x5b37fc);}return null;};}function patchUpdates(_0x19a71b){return function(_0x114b98){try{jsonpatch[_0xd59e('0x22')](_0x114b98,_0x19a71b,!![]);}catch(_0x4f9d73){return BPromise['reject'](_0x4f9d73);}return _0x114b98[_0xd59e('0x23')]();};}function saveUpdates(_0x44117b,_0xabfd8a){return function(_0x35d804){if(_0x35d804){return _0x35d804['update'](_0x44117b)['then'](function(_0x4eb9f4){return _0x4eb9f4;});}return null;};}function removeEntity(_0x4c6d27,_0x320c30){return function(_0x49a6c4){if(_0x49a6c4){return _0x49a6c4[_0xd59e('0x24')]()[_0xd59e('0x25')](function(){_0x4c6d27[_0xd59e('0x19')](0xcc)[_0xd59e('0x1a')]();});}};}function handleEntityNotFound(_0x4b7f70,_0x2301a3){return function(_0x45111){if(!_0x45111){_0x4b7f70[_0xd59e('0x18')](0x194);}return _0x45111;};}function handleError(_0x3db024,_0x4456d8){_0x4456d8=_0x4456d8||0x1f4;return function(_0x401307){logger['error'](_0x401307[_0xd59e('0x26')]);if(_0x401307['name']){delete _0x401307['name'];}_0x3db024[_0xd59e('0x19')](_0x4456d8)[_0xd59e('0x27')](_0x401307);};}exports['index']=function(_0x4e6333,_0x21466c){var _0x54f6ce={},_0x4b50c7={},_0x3e31c8={'count':0x0,'rows':[]};var _0x2635dc=_[_0xd59e('0x28')](db[_0xd59e('0x29')][_0xd59e('0x2a')],function(_0x20bf9f){return{'name':_0x20bf9f[_0xd59e('0x2b')],'type':_0x20bf9f[_0xd59e('0x2c')][_0xd59e('0x2d')]};});_0x4b50c7[_0xd59e('0x2e')]=_[_0xd59e('0x28')](_0x2635dc,_0xd59e('0x2f'));_0x4b50c7[_0xd59e('0x30')]=_[_0xd59e('0x31')](_0x4e6333[_0xd59e('0x30')]);_0x4b50c7[_0xd59e('0x32')]=_[_0xd59e('0x33')](_0x4b50c7[_0xd59e('0x2e')],_0x4b50c7[_0xd59e('0x30')]);_0x54f6ce[_0xd59e('0x34')]=_[_0xd59e('0x33')](_0x4b50c7[_0xd59e('0x2e')],qs[_0xd59e('0x35')](_0x4e6333[_0xd59e('0x30')][_0xd59e('0x35')]));_0x54f6ce[_0xd59e('0x34')]=_0x54f6ce[_0xd59e('0x34')][_0xd59e('0x36')]?_0x54f6ce[_0xd59e('0x34')]:_0x4b50c7[_0xd59e('0x2e')];if(!_0x4e6333['query'][_0xd59e('0x37')](_0xd59e('0x38'))){_0x54f6ce[_0xd59e('0x1d')]=qs[_0xd59e('0x1d')](_0x4e6333[_0xd59e('0x30')][_0xd59e('0x1d')]);_0x54f6ce[_0xd59e('0x1b')]=qs[_0xd59e('0x1b')](_0x4e6333['query'][_0xd59e('0x1b')]);}_0x54f6ce[_0xd59e('0x39')]=qs[_0xd59e('0x3a')](_0x4e6333[_0xd59e('0x30')]['sort']);_0x54f6ce[_0xd59e('0x3b')]=qs[_0xd59e('0x32')](_[_0xd59e('0x3c')](_0x4e6333[_0xd59e('0x30')],_0x4b50c7['filters']),_0x2635dc);if(_0x4e6333[_0xd59e('0x30')]['filter']){_0x54f6ce[_0xd59e('0x3b')]=_[_0xd59e('0x3d')](_0x54f6ce['where'],{'$or':_[_0xd59e('0x28')](_0x2635dc,function(_0xf8cb7b){if(_0xf8cb7b[_0xd59e('0x2c')]!=='VIRTUAL'){var _0x1bc990={};_0x1bc990[_0xf8cb7b['name']]={'$like':'%'+_0x4e6333['query'][_0xd59e('0x3e')]+'%'};return _0x1bc990;}})});}_0x54f6ce=_[_0xd59e('0x3d')]({},_0x54f6ce,_0x4e6333[_0xd59e('0x3f')]);var _0x1cea87={'where':_0x54f6ce[_0xd59e('0x3b')]};return db[_0xd59e('0x29')]['count'](_0x1cea87)['then'](function(_0x4a0e73){_0x3e31c8['count']=_0x4a0e73;if(_0x4e6333[_0xd59e('0x30')][_0xd59e('0x40')]){_0x54f6ce['include']=[{'all':!![]}];}return db[_0xd59e('0x29')][_0xd59e('0x41')](_0x54f6ce);})['then'](function(_0x5583a1){_0x3e31c8[_0xd59e('0x42')]=_0x5583a1;return _0x3e31c8;})[_0xd59e('0x25')](respondWithFilteredResult(_0x21466c,_0x54f6ce))[_0xd59e('0x43')](handleError(_0x21466c,null));};exports[_0xd59e('0x44')]=function(_0x32fa5e,_0xf73545){var _0x521f14={'raw':![],'where':{'id':_0x32fa5e[_0xd59e('0x45')]['id']}},_0x1b36bb={};_0x1b36bb[_0xd59e('0x2e')]=_[_0xd59e('0x31')](db[_0xd59e('0x29')]['rawAttributes']);_0x1b36bb['query']=_['keys'](_0x32fa5e[_0xd59e('0x30')]);_0x1b36bb[_0xd59e('0x32')]=_[_0xd59e('0x33')](_0x1b36bb[_0xd59e('0x2e')],_0x1b36bb[_0xd59e('0x30')]);_0x521f14[_0xd59e('0x34')]=_[_0xd59e('0x33')](_0x1b36bb[_0xd59e('0x2e')],qs[_0xd59e('0x35')](_0x32fa5e['query'][_0xd59e('0x35')]));_0x521f14[_0xd59e('0x34')]=_0x521f14[_0xd59e('0x34')][_0xd59e('0x36')]?_0x521f14[_0xd59e('0x34')]:_0x1b36bb[_0xd59e('0x2e')];if(_0x32fa5e['query'][_0xd59e('0x40')]){_0x521f14['include']=[{'all':!![]}];}_0x521f14=_['merge']({},_0x521f14,_0x32fa5e[_0xd59e('0x3f')]);return db[_0xd59e('0x29')][_0xd59e('0x46')](_0x521f14)[_0xd59e('0x25')](handleEntityNotFound(_0xf73545,null))[_0xd59e('0x25')](respondWithResult(_0xf73545,null))[_0xd59e('0x43')](handleError(_0xf73545,null));};exports['create']=function(_0x19a92b,_0x5358fd){return db[_0xd59e('0x29')][_0xd59e('0x47')](_0x19a92b['body'],{})[_0xd59e('0x25')](respondWithResult(_0x5358fd,0xc9))[_0xd59e('0x43')](handleError(_0x5358fd,null));};exports[_0xd59e('0x48')]=function(_0x5f454c,_0x3dccd6){if(_0x5f454c[_0xd59e('0x49')]['id']){delete _0x5f454c[_0xd59e('0x49')]['id'];}return db[_0xd59e('0x29')][_0xd59e('0x46')]({'where':{'id':_0x5f454c[_0xd59e('0x45')]['id']}})[_0xd59e('0x25')](handleEntityNotFound(_0x3dccd6,null))[_0xd59e('0x25')](saveUpdates(_0x5f454c[_0xd59e('0x49')],null))[_0xd59e('0x25')](respondWithResult(_0x3dccd6,null))['catch'](handleError(_0x3dccd6,null));};exports[_0xd59e('0x24')]=function(_0x3bf925,_0x53df1e){return db['Automation'][_0xd59e('0x46')]({'where':{'id':_0x3bf925['params']['id']}})['then'](handleEntityNotFound(_0x53df1e,null))[_0xd59e('0x25')](removeEntity(_0x53df1e,null))[_0xd59e('0x43')](handleError(_0x53df1e,null));};exports[_0xd59e('0x4a')]=function(_0x19a048,_0x46866a,_0x1d1321){return db[_0xd59e('0x4b')][_0xd59e('0x46')]({'where':{'id':_0x19a048['params']['id']}})[_0xd59e('0x25')](handleEntityNotFound(_0x46866a,null))[_0xd59e('0x25')](function(_0x241f5a){if(_0x241f5a){return _0x241f5a[_0xd59e('0x4a')](_0x19a048[_0xd59e('0x49')][_0xd59e('0x4c')],_[_0xd59e('0x4d')](_0x19a048[_0xd59e('0x49')],[_0xd59e('0x4c'),'id'])||{});}})[_0xd59e('0x25')](respondWithResult(_0x46866a,null))[_0xd59e('0x43')](handleError(_0x46866a,null));};exports[_0xd59e('0x4e')]=function(_0x2fab32,_0x3bab65,_0x92c425){var _0xa03912={};var _0x1d6961={};var _0x181ab5;var _0x47edf0;return db[_0xd59e('0x29')][_0xd59e('0x4f')]({'where':{'id':_0x2fab32[_0xd59e('0x45')]['id']}})[_0xd59e('0x25')](handleEntityNotFound(_0x3bab65,null))[_0xd59e('0x25')](function(_0x1ff224){if(_0x1ff224){_0x181ab5=_0x1ff224;_0x1d6961[_0xd59e('0x2e')]=_[_0xd59e('0x31')](db[_0xd59e('0x4b')][_0xd59e('0x2a')]);_0x1d6961['query']=_[_0xd59e('0x31')](_0x2fab32['query']);_0x1d6961[_0xd59e('0x32')]=_['intersection'](_0x1d6961[_0xd59e('0x2e')],_0x1d6961[_0xd59e('0x30')]);_0xa03912[_0xd59e('0x34')]=_[_0xd59e('0x33')](_0x1d6961[_0xd59e('0x2e')],qs[_0xd59e('0x35')](_0x2fab32['query']['fields']));_0xa03912[_0xd59e('0x34')]=_0xa03912[_0xd59e('0x34')][_0xd59e('0x36')]?_0xa03912[_0xd59e('0x34')]:_0x1d6961[_0xd59e('0x2e')];_0xa03912[_0xd59e('0x39')]=qs[_0xd59e('0x3a')](_0x2fab32['query']['sort']);_0xa03912[_0xd59e('0x3b')]=qs[_0xd59e('0x32')](_[_0xd59e('0x3c')](_0x2fab32['query'],_0x1d6961['filters']));if(_0x2fab32[_0xd59e('0x30')][_0xd59e('0x3e')]){_0xa03912[_0xd59e('0x3b')]=_[_0xd59e('0x3d')](_0xa03912[_0xd59e('0x3b')],{'$or':_[_0xd59e('0x28')](_0xa03912[_0xd59e('0x34')],function(_0x4066be){var _0x161b2d={};_0x161b2d[_0x4066be]={'$like':'%'+_0x2fab32[_0xd59e('0x30')][_0xd59e('0x3e')]+'%'};return _0x161b2d;})});}_0xa03912=_[_0xd59e('0x3d')]({},_0xa03912,_0x2fab32[_0xd59e('0x3f')]);return _0x181ab5[_0xd59e('0x4e')](_0xa03912);}})[_0xd59e('0x25')](function(_0x355bbe){if(_0x355bbe){_0x47edf0=_0x355bbe[_0xd59e('0x36')];if(!_0x2fab32[_0xd59e('0x30')][_0xd59e('0x37')](_0xd59e('0x38'))){_0xa03912['limit']=qs[_0xd59e('0x1d')](_0x2fab32[_0xd59e('0x30')][_0xd59e('0x1d')]);_0xa03912[_0xd59e('0x1b')]=qs[_0xd59e('0x1b')](_0x2fab32[_0xd59e('0x30')][_0xd59e('0x1b')]);}return _0x181ab5[_0xd59e('0x4e')](_0xa03912);}})['then'](function(_0x152009){if(_0x152009){return _0x152009?{'count':_0x47edf0,'rows':_0x152009}:null;}})['then'](respondWithResult(_0x3bab65,null))[_0xd59e('0x43')](handleError(_0x3bab65,null));};exports[_0xd59e('0x50')]=function(_0x4b8264,_0x4d0d54,_0x9de6f){return db[_0xd59e('0x51')][_0xd59e('0x46')]({'where':{'id':_0x4b8264[_0xd59e('0x45')]['id']}})[_0xd59e('0x25')](handleEntityNotFound(_0x4d0d54,null))[_0xd59e('0x25')](function(_0x669211){if(_0x669211){return _0x669211['addActions'](_0x4b8264[_0xd59e('0x49')][_0xd59e('0x4c')],_[_0xd59e('0x4d')](_0x4b8264[_0xd59e('0x49')],[_0xd59e('0x4c'),'id'])||{});}})[_0xd59e('0x25')](respondWithResult(_0x4d0d54,null))[_0xd59e('0x43')](handleError(_0x4d0d54,null));};exports[_0xd59e('0x52')]=function(_0x16b5d4,_0x38f4db,_0xf8bbfd){var _0x23c5e4={};var _0x2f568d={};var _0x13f3e5;var _0xbabdcd;return db[_0xd59e('0x29')]['findOne']({'where':{'id':_0x16b5d4['params']['id']}})[_0xd59e('0x25')](handleEntityNotFound(_0x38f4db,null))[_0xd59e('0x25')](function(_0x457cb8){if(_0x457cb8){_0x13f3e5=_0x457cb8;_0x2f568d[_0xd59e('0x2e')]=_[_0xd59e('0x31')](db[_0xd59e('0x51')]['rawAttributes']);_0x2f568d[_0xd59e('0x30')]=_[_0xd59e('0x31')](_0x16b5d4['query']);_0x2f568d[_0xd59e('0x32')]=_[_0xd59e('0x33')](_0x2f568d[_0xd59e('0x2e')],_0x2f568d['query']);_0x23c5e4[_0xd59e('0x34')]=_[_0xd59e('0x33')](_0x2f568d['model'],qs[_0xd59e('0x35')](_0x16b5d4[_0xd59e('0x30')][_0xd59e('0x35')]));_0x23c5e4['attributes']=_0x23c5e4[_0xd59e('0x34')][_0xd59e('0x36')]?_0x23c5e4['attributes']:_0x2f568d[_0xd59e('0x2e')];_0x23c5e4[_0xd59e('0x39')]=qs[_0xd59e('0x3a')](_0x16b5d4[_0xd59e('0x30')][_0xd59e('0x3a')]);_0x23c5e4[_0xd59e('0x3b')]=qs[_0xd59e('0x32')](_[_0xd59e('0x3c')](_0x16b5d4['query'],_0x2f568d[_0xd59e('0x32')]));if(_0x16b5d4[_0xd59e('0x30')][_0xd59e('0x3e')]){_0x23c5e4[_0xd59e('0x3b')]=_[_0xd59e('0x3d')](_0x23c5e4[_0xd59e('0x3b')],{'$or':_['map'](_0x23c5e4[_0xd59e('0x34')],function(_0x1803fd){var _0x5491cb={};_0x5491cb[_0x1803fd]={'$like':'%'+_0x16b5d4[_0xd59e('0x30')]['filter']+'%'};return _0x5491cb;})});}_0x23c5e4=_[_0xd59e('0x3d')]({},_0x23c5e4,_0x16b5d4[_0xd59e('0x3f')]);return _0x13f3e5[_0xd59e('0x52')](_0x23c5e4);}})[_0xd59e('0x25')](function(_0x41a21a){if(_0x41a21a){_0xbabdcd=_0x41a21a[_0xd59e('0x36')];if(!_0x16b5d4[_0xd59e('0x30')][_0xd59e('0x37')](_0xd59e('0x38'))){_0x23c5e4['limit']=qs['limit'](_0x16b5d4['query'][_0xd59e('0x1d')]);_0x23c5e4[_0xd59e('0x1b')]=qs[_0xd59e('0x1b')](_0x16b5d4[_0xd59e('0x30')][_0xd59e('0x1b')]);}return _0x13f3e5[_0xd59e('0x52')](_0x23c5e4);}})['then'](function(_0x2a6785){if(_0x2a6785){return _0x2a6785?{'count':_0xbabdcd,'rows':_0x2a6785}:null;}})[_0xd59e('0x25')](respondWithResult(_0x38f4db,null))['catch'](handleError(_0x38f4db,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a06d5d0..68df583 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 _0xd85c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util'];(function(_0x387335,_0x1dbb1a){var _0x18bb1c=function(_0x2fdc5a){while(--_0x2fdc5a){_0x387335['push'](_0x387335['shift']());}};_0x18bb1c(++_0x1dbb1a);}(_0xd85c,0xfa));var _0xcd85=function(_0x2969f0,_0x11b411){_0x2969f0=_0x2969f0-0x0;var _0x2ca8c0=_0xd85c[_0x2969f0];return _0x2ca8c0;};'use strict';var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var logger=require(_0xcd85('0x2'))('api');var moment=require(_0xcd85('0x3'));var BPromise=require(_0xcd85('0x4'));var rp=require(_0xcd85('0x5'));var fs=require('fs');var path=require(_0xcd85('0x6'));var rimraf=require(_0xcd85('0x7'));var config=require(_0xcd85('0x8'));var attributes=require(_0xcd85('0x9'));module['exports']=function(_0x5057b5,_0x180a61){return _0x5057b5['define'](_0xcd85('0xa'),attributes,{'tableName':_0xcd85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e8=['lodash','util','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x4dab41,_0x3a0c5c){var _0xe31cde=function(_0x3f223d){while(--_0x3f223d){_0x4dab41['push'](_0x4dab41['shift']());}};_0xe31cde(++_0x3a0c5c);}(_0x49e8,0x105));var _0x849e=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x49e8[_0x16539a];return _0x200796;};'use strict';var _=require(_0x849e('0x0'));var util=require(_0x849e('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('path');var rimraf=require(_0x849e('0x2'));var config=require(_0x849e('0x3'));var attributes=require(_0x849e('0x4'));module[_0x849e('0x5')]=function(_0x4a823a,_0x2df9f3){return _0x4a823a[_0x849e('0x6')](_0x849e('0x7'),attributes,{'tableName':_0x849e('0x8'),'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 b46ca96..9646313 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 _0x9512=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x35e6f5,_0x3c1270){var _0x5a60b0=function(_0x3a52c3){while(--_0x3a52c3){_0x35e6f5['push'](_0x35e6f5['shift']());}};_0x5a60b0(++_0x3c1270);}(_0x9512,0x75));var _0x2951=function(_0x5998c7,_0x514254){_0x5998c7=_0x5998c7-0x0;var _0x321421=_0x9512[_0x5998c7];return _0x321421;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b50d9,_0x59d947,_0x2c2c11){return new BPromise(function(_0x2c5ad6,_0x3e1a01){return client[_0x2951('0xd')](_0x1b50d9,_0x2c2c11)[_0x2951('0xe')](function(_0x113b97){logger['info'](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));logger[_0x2951('0x11')](_0x2951('0x12'),_0x59d947,'request\x20sent',JSON[_0x2951('0x13')](_0x113b97));if(_0x113b97[_0x2951('0x14')]){if(_0x113b97[_0x2951('0x14')][_0x2951('0x15')]===0x1f4){logger[_0x2951('0x14')]('Automation,\x20%s,\x20%s',_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x3e1a01(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x2c5ad6(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}else{logger[_0x2951('0x17')](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));_0x2c5ad6(_0x113b97['result'][_0x2951('0x16')]);}})[_0x2951('0x18')](function(_0x18e89d){logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x18e89d);_0x3e1a01(_0x18e89d);});});} \ No newline at end of file +var _0x30fc=['Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x417a08,_0x13f6a5){var _0x245b2e=function(_0x30675f){while(--_0x30675f){_0x417a08['push'](_0x417a08['shift']());}};_0x245b2e(++_0x13f6a5);}(_0x30fc,0x64));var _0xc30f=function(_0x4c6e4a,_0x263ab8){_0x4c6e4a=_0x4c6e4a-0x0;var _0x3d69f4=_0x30fc[_0x4c6e4a];return _0x3d69f4;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var moment=require('moment');var BPromise=require(_0xc30f('0x2'));var rs=require(_0xc30f('0x3'));var fs=require('fs');var Redis=require(_0xc30f('0x4'));var db=require(_0xc30f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc30f('0x6'))(_0xc30f('0x7'));var config=require(_0xc30f('0x8'));var jayson=require(_0xc30f('0x9'));var client=jayson[_0xc30f('0xa')][_0xc30f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54c174,_0x23528c,_0x325a64){return new BPromise(function(_0x33a769,_0x3d2167){return client[_0xc30f('0xc')](_0x54c174,_0x325a64)[_0xc30f('0xd')](function(_0x436059){logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,'request\x20sent');logger[_0xc30f('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x23528c,_0xc30f('0x11'),JSON[_0xc30f('0x12')](_0x436059));if(_0x436059[_0xc30f('0x13')]){if(_0x436059[_0xc30f('0x13')][_0xc30f('0x14')]===0x1f4){logger[_0xc30f('0x13')]('Automation,\x20%s,\x20%s',_0x23528c,_0x436059['error'][_0xc30f('0x15')]);return _0x3d2167(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}logger[_0xc30f('0x13')]('Automation,\x20%s,\x20%s',_0x23528c,_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);return _0x33a769(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}else{logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,_0xc30f('0x11'));_0x33a769(_0x436059['result']['message']);}})[_0xc30f('0x16')](function(_0x1b02c5){logger[_0xc30f('0x13')](_0xc30f('0xf'),_0x23528c,_0x1b02c5);_0x3d2167(_0x1b02c5);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d994f05..8475518 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 _0x25b4=['index','get','/:id','getConditions','/:id/actions','create','post','addConditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x25b4,0x1ab));var _0x425b=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x25b4[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require(_0x425b('0x0'));var util=require('util');var path=require(_0x425b('0x1'));var timeout=require(_0x425b('0x2'));var express=require(_0x425b('0x3'));var router=express[_0x425b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x425b('0x5'));var interaction=require(_0x425b('0x6'));var config=require(_0x425b('0x7'));var controller=require(_0x425b('0x8'));router['get']('/',auth[_0x425b('0x9')](),controller[_0x425b('0xa')]);router[_0x425b('0xb')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller['show']);router[_0x425b('0xb')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0xd')]);router[_0x425b('0xb')](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x425b('0xf')]);router[_0x425b('0x10')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0x11')]);router['post'](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['addActions']);router[_0x425b('0x12')]('/:id',auth[_0x425b('0x9')](),controller[_0x425b('0x13')]);router[_0x425b('0x14')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller[_0x425b('0x15')]);module[_0x425b('0x16')]=router; \ No newline at end of file +var _0x8137=['index','/:id','show','/:id/actions','post','/:id/conditions','addConditions','put','update','delete','destroy','multer','Router','fs-extra','get','isAuthenticated'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x8137,0x16b));var _0x7813=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x8137[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x7813('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7813('0x1')]();var fs_extra=require(_0x7813('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x7813('0x3')]('/',auth[_0x7813('0x4')](),controller[_0x7813('0x5')]);router[_0x7813('0x3')](_0x7813('0x6'),auth[_0x7813('0x4')](),controller[_0x7813('0x7')]);router[_0x7813('0x3')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x7813('0x3')](_0x7813('0x8'),auth[_0x7813('0x4')](),controller['getActions']);router[_0x7813('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7813('0xa'),auth['isAuthenticated'](),controller[_0x7813('0xb')]);router[_0x7813('0x9')](_0x7813('0x8'),auth[_0x7813('0x4')](),controller['addActions']);router[_0x7813('0xc')](_0x7813('0x6'),auth[_0x7813('0x4')](),controller[_0x7813('0xd')]);router[_0x7813('0xe')](_0x7813('0x6'),auth[_0x7813('0x4')](),controller[_0x7813('0xf')]);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 5f8b65b..5aab8ef 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 _0xbaf4=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\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)','sequelize','ivr','STRING','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x447125,_0x140166){var _0x5e21ff=function(_0x3ecfaa){while(--_0x3ecfaa){_0x447125['push'](_0x447125['shift']());}};_0x5e21ff(++_0x140166);}(_0xbaf4,0x13f));var _0x4baf=function(_0x363a62,_0x423698){_0x363a62=_0x363a62-0x0;var _0xadc72=_0xbaf4[_0x363a62];return _0xadc72;};'use strict';var Sequelize=require(_0x4baf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4baf('0x1')},'description':{'type':Sequelize[_0x4baf('0x2')]},'active':{'type':Sequelize[_0x4baf('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x4baf('0x4')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4baf('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4baf('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x8')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'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':_0x4baf('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0x4baf('0xc')](_0x4baf('0xd'),_0x4baf('0xe'),_0x4baf('0xf')),'defaultValue':_0x4baf('0xd')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4baf('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4baf('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4baf('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4baf('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4baf('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4baf('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4baf('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x4baf('0x17')),'defaultValue':_0x4baf('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x19')},'dialCutDigit':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x21')}}; \ No newline at end of file +var _0x7913=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x207532,_0x44ad95){var _0x24eb07=function(_0x1bcca0){while(--_0x1bcca0){_0x207532['push'](_0x207532['shift']());}};_0x24eb07(++_0x44ad95);}(_0x7913,0xe8));var _0x3791=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7913[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3791('0x0'));module[_0x3791('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3791('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x3791('0x3')},'description':{'type':Sequelize[_0x3791('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3791('0x5')},'limitCalls':{'type':Sequelize[_0x3791('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3791('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3791('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3791('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3791('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3791('0xd')},'dialTimezone':{'type':Sequelize[_0x3791('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3791('0x4')],'defaultValue':_0x3791('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x3791('0xf')](_0x3791('0x10'),_0x3791('0x11'),_0x3791('0x12')),'defaultValue':_0x3791('0x10')},'dialAMDActive':{'type':Sequelize[_0x3791('0x13')],'defaultValue':0x0,'comment':_0x3791('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3791('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x3791('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3791('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3791('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3791('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x3791('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3791('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3791('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3791('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3791('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3791('0x6')](0x9)[_0x3791('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3791('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3791('0xf')](_0x3791('0x1e'),_0x3791('0x1f')),'defaultValue':_0x3791('0x1e')},'dialPrefix':{'type':Sequelize[_0x3791('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3791('0x20')},'dialCutDigit':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3791('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x3791('0x6')](0x3)[_0x3791('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x27')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3791('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3791('0x6')](0x5)[_0x3791('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3791('0x2a')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index b184cfd..13a3621 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 _0xefd7=['h.id','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','fields','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','order','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL'];(function(_0x40e60f,_0x5365e1){var _0x35511f=function(_0x41df2d){while(--_0x41df2d){_0x40e60f['push'](_0x40e60f['shift']());}};_0x35511f(++_0x5365e1);}(_0xefd7,0x99));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7efd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efd('0x1'));var jsonpatch=require(_0x7efd('0x2'));var rp=require(_0x7efd('0x3'));var moment=require('moment');var BPromise=require(_0x7efd('0x4'));var Mustache=require(_0x7efd('0x5'));var util=require(_0x7efd('0x6'));var path=require(_0x7efd('0x7'));var sox=require('sox');var csv=require(_0x7efd('0x8'));var ejs=require(_0x7efd('0x9'));var fs=require('fs');var fs_extra=require(_0x7efd('0xa'));var _=require(_0x7efd('0xb'));var squel=require(_0x7efd('0xc'));var crypto=require(_0x7efd('0xd'));var jsforce=require(_0x7efd('0xe'));var deskjs=require(_0x7efd('0xf'));var toCsv=require(_0x7efd('0x8'));var querystring=require('querystring');var Papa=require(_0x7efd('0x10'));var Redis=require(_0x7efd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efd('0x12'));var as=require(_0x7efd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7efd('0x14'))(_0x7efd('0x15'));var utils=require('../../config/utils');var config=require(_0x7efd('0x16'));var licenseUtil=require(_0x7efd('0x17'));var db=require(_0x7efd('0x18'))['db'];function respondWithStatusCode(_0x57269e,_0x5e017c){_0x5e017c=_0x5e017c||0xcc;return function(_0x424da9){if(_0x424da9){return _0x57269e[_0x7efd('0x19')](_0x5e017c);}return _0x57269e[_0x7efd('0x1a')](_0x5e017c)['end']();};}function respondWithResult(_0x17c1f4,_0x37e9f2){_0x37e9f2=_0x37e9f2||0xc8;return function(_0x237323){if(_0x237323){return _0x17c1f4['status'](_0x37e9f2)[_0x7efd('0x1b')](_0x237323);}};}function respondWithFilteredResult(_0x143cb2,_0x5280a2){return function(_0x196674){if(_0x196674){var _0x5affe3=typeof _0x5280a2[_0x7efd('0x1c')]===_0x7efd('0x1d')&&typeof _0x5280a2[_0x7efd('0x1e')]==='undefined';var _0x2a91e1=_0x196674[_0x7efd('0x1f')];var _0x3c0dc2=_0x5affe3?0x0:_0x5280a2[_0x7efd('0x1c')];var _0x47f98a=_0x5affe3?_0x196674['count']:_0x5280a2[_0x7efd('0x1c')]+_0x5280a2['limit'];var _0x58c994;if(_0x47f98a>=_0x2a91e1){_0x47f98a=_0x2a91e1;_0x58c994=0xc8;}else{_0x58c994=0xce;}_0x143cb2[_0x7efd('0x1a')](_0x58c994);return _0x143cb2[_0x7efd('0x20')](_0x7efd('0x21'),_0x3c0dc2+'-'+_0x47f98a+'/'+_0x2a91e1)[_0x7efd('0x1b')](_0x196674);}return null;};}function patchUpdates(_0x5db31e){return function(_0x4330dc){try{jsonpatch[_0x7efd('0x22')](_0x4330dc,_0x5db31e,!![]);}catch(_0x307568){return BPromise['reject'](_0x307568);}return _0x4330dc[_0x7efd('0x23')]();};}function saveUpdates(_0x45cc61,_0xbdd9f8){return function(_0x230714){if(_0x230714){return _0x230714[_0x7efd('0x24')](_0x45cc61)['then'](function(_0xd04f56){return _0xd04f56;});}return null;};}function removeEntity(_0x1dc48c,_0x127c86){return function(_0x35bdb6){if(_0x35bdb6){return _0x35bdb6[_0x7efd('0x25')]()[_0x7efd('0x26')](function(){var _0x3e3b74=_0x35bdb6[_0x7efd('0x27')]({'plain':!![]});var _0x4e604a=_0x7efd('0x28');return db[_0x7efd('0x29')][_0x7efd('0x25')]({'where':{'type':_0x4e604a,'resourceId':_0x3e3b74['id']}})['then'](function(){return _0x35bdb6;});})[_0x7efd('0x26')](function(){_0x1dc48c[_0x7efd('0x1a')](0xcc)[_0x7efd('0x2a')]();});}};}function handleEntityNotFound(_0x500b6e,_0x433588){return function(_0x563b1f){if(!_0x563b1f){_0x500b6e[_0x7efd('0x19')](0x194);}return _0x563b1f;};}function handleError(_0x81309e,_0x319feb){_0x319feb=_0x319feb||0x1f4;return function(_0x4d3c68){logger[_0x7efd('0x2b')](_0x4d3c68['stack']);if(_0x4d3c68['name']){delete _0x4d3c68[_0x7efd('0x2c')];}_0x81309e[_0x7efd('0x1a')](_0x319feb)[_0x7efd('0x2d')](_0x4d3c68);};}exports[_0x7efd('0x2e')]=function(_0x332967,_0x26cbee){var _0x38fa07={},_0x2fa66e={},_0x123c11={'count':0x0,'rows':[]};var _0x43aa5b=_['map'](db[_0x7efd('0x2f')][_0x7efd('0x30')],function(_0x13b057){return{'name':_0x13b057['fieldName'],'type':_0x13b057['type']['key']};});_0x2fa66e[_0x7efd('0x31')]=_['map'](_0x43aa5b,_0x7efd('0x2c'));_0x2fa66e[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332967[_0x7efd('0x32')]);_0x2fa66e[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x2fa66e['model'],_0x2fa66e[_0x7efd('0x32')]);_0x38fa07['attributes']=_[_0x7efd('0x35')](_0x2fa66e[_0x7efd('0x31')],qs['fields'](_0x332967['query']['fields']));_0x38fa07['attributes']=_0x38fa07[_0x7efd('0x36')]['length']?_0x38fa07['attributes']:_0x2fa66e[_0x7efd('0x31')];if(!_0x332967[_0x7efd('0x32')][_0x7efd('0x37')]('nolimit')){_0x38fa07[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x38fa07[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x38fa07['order']=qs[_0x7efd('0x38')](_0x332967[_0x7efd('0x32')]['sort']);_0x38fa07[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x332967[_0x7efd('0x32')],_0x2fa66e['filters']),_0x43aa5b);if(_0x332967['query'][_0x7efd('0x3b')]){_0x38fa07[_0x7efd('0x39')]=_['merge'](_0x38fa07[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x43aa5b,function(_0x13481c){if(_0x13481c['type']!=='VIRTUAL'){var _0x57aa0b={};_0x57aa0b[_0x13481c[_0x7efd('0x2c')]]={'$like':'%'+_0x332967[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x57aa0b;}})});}_0x38fa07=_[_0x7efd('0x3d')]({},_0x38fa07,_0x332967['options']);var _0x53a63b={'where':_0x38fa07['where']};return db[_0x7efd('0x2f')][_0x7efd('0x1f')](_0x53a63b)['then'](function(_0x2ba456){_0x123c11['count']=_0x2ba456;if(_0x332967[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x38fa07[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x2f')][_0x7efd('0x40')](_0x38fa07);})[_0x7efd('0x26')](function(_0x34597a){_0x123c11[_0x7efd('0x41')]=_0x34597a;return _0x123c11;})[_0x7efd('0x26')](respondWithFilteredResult(_0x26cbee,_0x38fa07))['catch'](handleError(_0x26cbee,null));};exports['show']=function(_0x1fdd69,_0x13a533){var _0x5a47ac={'raw':![],'where':{'id':_0x1fdd69['params']['id']}},_0x47e86e={};_0x47e86e['model']=_[_0x7efd('0x33')](db['Campaign']['rawAttributes']);_0x47e86e['query']=_[_0x7efd('0x33')](_0x1fdd69['query']);_0x47e86e['filters']=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],_0x47e86e['query']);_0x5a47ac[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x1fdd69[_0x7efd('0x32')][_0x7efd('0x42')]));_0x5a47ac['attributes']=_0x5a47ac['attributes'][_0x7efd('0x43')]?_0x5a47ac[_0x7efd('0x36')]:_0x47e86e[_0x7efd('0x31')];if(_0x1fdd69['query'][_0x7efd('0x3e')]){_0x5a47ac[_0x7efd('0x3f')]=[{'all':!![]}];}_0x5a47ac=_[_0x7efd('0x3d')]({},_0x5a47ac,_0x1fdd69['options']);return db[_0x7efd('0x2f')][_0x7efd('0x44')](_0x5a47ac)[_0x7efd('0x26')](handleEntityNotFound(_0x13a533,null))[_0x7efd('0x26')](respondWithResult(_0x13a533,null))[_0x7efd('0x45')](handleError(_0x13a533,null));};exports[_0x7efd('0x46')]=function(_0x5b41dc,_0x320b6d){return db[_0x7efd('0x2f')][_0x7efd('0x46')](_0x5b41dc[_0x7efd('0x47')],{})[_0x7efd('0x26')](function(_0x306a44){var _0x2c1d24=_0x5b41dc[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x2c1d24)throw new Error(_0x7efd('0x49'));if(_0x2c1d24[_0x7efd('0x4a')]==='user'){var _0x42d37a=_0x306a44[_0x7efd('0x27')]({'plain':!![]});var _0x30706b=_0x7efd('0x28');return db[_0x7efd('0x4b')][_0x7efd('0x44')]({'where':{'name':_0x30706b,'userProfileId':_0x2c1d24['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x25099e){if(_0x25099e&&_0x25099e[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x42d37a[_0x7efd('0x2c')],'resourceId':_0x42d37a['id'],'type':_0x25099e[_0x7efd('0x2c')],'sectionId':_0x25099e['id']},{})[_0x7efd('0x26')](function(){return _0x306a44;});}else{return _0x306a44;}})[_0x7efd('0x45')](function(_0x40773a){logger[_0x7efd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773a);throw _0x40773a;});}return _0x306a44;})[_0x7efd('0x26')](respondWithResult(_0x320b6d,0xc9))['catch'](handleError(_0x320b6d,null));};exports[_0x7efd('0x4d')]=function(_0x53e3f9,_0x4b8e29){var _0x48e111={'where':{'id':_0x53e3f9['params']['id']}},_0x4d01b9={};_0x4d01b9['model']=_['keys'](db['Campaign'][_0x7efd('0x30')]);_0x48e111[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x4d01b9[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x53e3f9[_0x7efd('0x32')][_0x7efd('0x42')]));_0x48e111[_0x7efd('0x36')]=_0x48e111[_0x7efd('0x36')][_0x7efd('0x43')]?_0x48e111['attributes']:_0x4d01b9[_0x7efd('0x31')];if(_0x53e3f9[_0x7efd('0x32')]['includeAll']){_0x48e111['include']=[{'all':!![]}];}_0x48e111=_[_0x7efd('0x3d')]({},_0x48e111,_0x53e3f9[_0x7efd('0x4e')]);return db['Campaign']['find'](_0x48e111)['then'](handleEntityNotFound(_0x4b8e29,null))[_0x7efd('0x26')](function(_0x548aa1){if(_0x548aa1){var _0x4a31c7=_0x548aa1['get']({'plain':!![]});_0x4a31c7=qs[_0x7efd('0x4f')](_0x4a31c7,['id',_0x7efd('0x50'),_0x7efd('0x51')]);_0x53e3f9[_0x7efd('0x47')]=_[_0x7efd('0x4f')](_0x53e3f9[_0x7efd('0x47')],['id',_0x7efd('0x50'),_0x7efd('0x51')]);return db[_0x7efd('0x2f')]['create'](_['merge'](_0x4a31c7,_0x53e3f9['body']),{'include':_0x53e3f9['query'][_0x7efd('0x3e')]?[{'all':!![]}]:undefined})[_0x7efd('0x26')](function(_0x39961c){var _0x54ba4d=_0x53e3f9[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x54ba4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54ba4d[_0x7efd('0x4a')]==='user'){var _0x222b9e=_0x39961c[_0x7efd('0x27')]({'plain':!![]});var _0x5c126f=_0x7efd('0x28');return db['UserProfileSection'][_0x7efd('0x44')]({'where':{'name':_0x5c126f,'userProfileId':_0x54ba4d['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x241709){if(_0x241709&&_0x241709[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x222b9e[_0x7efd('0x2c')],'resourceId':_0x222b9e['id'],'type':_0x241709['name'],'sectionId':_0x241709['id']},{})[_0x7efd('0x26')](function(){return _0x39961c;});}else{return _0x39961c;}})['catch'](function(_0x32e001){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e001);throw _0x32e001;});}return _0x39961c;});}})[_0x7efd('0x26')](respondWithResult(_0x4b8e29,0xc9))[_0x7efd('0x45')](handleError(_0x4b8e29,null));};exports[_0x7efd('0x24')]=function(_0x162721,_0xc0fb5c){if(_0x162721['body']['id']){delete _0x162721[_0x7efd('0x47')]['id'];}return db['Campaign']['find']({'where':{'id':_0x162721[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xc0fb5c,null))[_0x7efd('0x26')](saveUpdates(_0x162721[_0x7efd('0x47')],null))['then'](respondWithResult(_0xc0fb5c,null))[_0x7efd('0x45')](handleError(_0xc0fb5c,null));};exports[_0x7efd('0x25')]=function(_0x260888,_0x16737c){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x260888[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x16737c,null))[_0x7efd('0x26')](removeEntity(_0x16737c,null))[_0x7efd('0x45')](handleError(_0x16737c,null));};exports[_0x7efd('0x53')]=function(_0x802460,_0x1a9232,_0x3fdbbc){var _0x5636dd={'raw':!![],'where':{}};var _0x58a6c2={};var _0x1175b2={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x802460[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1a9232,null))[_0x7efd('0x26')](function(_0x513de5){if(_0x513de5){_0x58a6c2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x55')]['rawAttributes']);_0x58a6c2[_0x7efd('0x32')]=_['keys'](_0x802460[_0x7efd('0x32')]);_0x58a6c2['filters']=_[_0x7efd('0x35')](_0x58a6c2[_0x7efd('0x31')],_0x58a6c2['query']);_0x5636dd[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x58a6c2['model'],qs['fields'](_0x802460['query'][_0x7efd('0x42')]));_0x5636dd['attributes']=_0x5636dd[_0x7efd('0x36')][_0x7efd('0x43')]?_0x5636dd['attributes']:_0x58a6c2[_0x7efd('0x31')];if(!_0x802460[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x5636dd[_0x7efd('0x1e')]=qs['limit'](_0x802460[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x5636dd[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x802460['query']['offset']);}_0x5636dd['order']=qs[_0x7efd('0x38')](_0x802460[_0x7efd('0x32')][_0x7efd('0x38')]);_0x5636dd['where']=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x802460['query'],_0x58a6c2[_0x7efd('0x34')]));_0x5636dd['where']['CampaignId']=_0x513de5['id'];if(_0x802460[_0x7efd('0x32')]['filter']){_0x5636dd['where']=_[_0x7efd('0x3d')](_0x5636dd['where'],{'$or':_[_0x7efd('0x3c')](_0x5636dd[_0x7efd('0x36')],function(_0x1831d6){var _0x32d013={};_0x32d013[_0x1831d6]={'$like':'%'+_0x802460[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x32d013;})});}_0x5636dd=_[_0x7efd('0x3d')]({},_0x5636dd,_0x802460[_0x7efd('0x4e')]);return db[_0x7efd('0x55')][_0x7efd('0x1f')]({'where':_0x5636dd[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x1281f7){_0x1175b2[_0x7efd('0x1f')]=_0x1281f7;if(_0x802460[_0x7efd('0x32')]['includeAll']){_0x5636dd[_0x7efd('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x7efd('0x40')](_0x5636dd);})[_0x7efd('0x26')](function(_0x338df0){_0x1175b2[_0x7efd('0x41')]=_0x338df0;return _0x1175b2;});}})['then'](respondWithFilteredResult(_0x1a9232,_0x5636dd))[_0x7efd('0x45')](handleError(_0x1a9232,null));};exports[_0x7efd('0x57')]=function(_0x332383,_0xd864b,_0x3e7efb){var _0x1a541f={'raw':!![],'where':{}};var _0x5833a2={};var _0x46bf7f={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x332383[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xd864b,null))['then'](function(_0x453fef){if(_0x453fef){_0x5833a2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x58')][_0x7efd('0x30')]);_0x5833a2[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332383[_0x7efd('0x32')]);_0x5833a2[_0x7efd('0x34')]=_['intersection'](_0x5833a2[_0x7efd('0x31')],_0x5833a2['query']);_0x1a541f[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x5833a2['model'],qs[_0x7efd('0x42')](_0x332383['query'][_0x7efd('0x42')]));_0x1a541f['attributes']=_0x1a541f[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1a541f[_0x7efd('0x36')]:_0x5833a2[_0x7efd('0x31')];if(!_0x332383[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x1a541f[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x1a541f[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1a541f[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x332383[_0x7efd('0x32')]['sort']);_0x1a541f[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_['pick'](_0x332383['query'],_0x5833a2[_0x7efd('0x34')]));_0x1a541f[_0x7efd('0x39')][_0x7efd('0x5a')]=_0x453fef['id'];if(_0x332383['query'][_0x7efd('0x3b')]){_0x1a541f[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1a541f[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1a541f[_0x7efd('0x36')],function(_0x424d8d){var _0x5d5028={};_0x5d5028[_0x424d8d]={'$like':'%'+_0x332383[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x5d5028;})});}_0x1a541f=_[_0x7efd('0x3d')]({},_0x1a541f,_0x332383[_0x7efd('0x4e')]);return db['CmHopperHistory'][_0x7efd('0x1f')]({'where':_0x1a541f['where']})[_0x7efd('0x26')](function(_0xbecabd){_0x46bf7f[_0x7efd('0x1f')]=_0xbecabd;if(_0x332383['query'][_0x7efd('0x3e')]){_0x1a541f[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x58')][_0x7efd('0x40')](_0x1a541f);})[_0x7efd('0x26')](function(_0x4c31aa){_0x46bf7f['rows']=_0x4c31aa;return _0x46bf7f;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0xd864b,_0x1a541f))[_0x7efd('0x45')](handleError(_0xd864b,null));};exports['getHopperFinals']=function(_0x13e891,_0x5a24e9,_0x221ba2){var _0x1601a6={'raw':!![],'where':{}};var _0x1a4444={};var _0x38c128={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x13e891['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x5a24e9,null))[_0x7efd('0x26')](function(_0x4dd443){if(_0x4dd443){_0x1a4444['model']=_[_0x7efd('0x33')](db['CmHopperFinal'][_0x7efd('0x30')]);_0x1a4444[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x13e891[_0x7efd('0x32')]);_0x1a4444[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x1a4444['model'],_0x1a4444['query']);_0x1601a6[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x1a4444[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x13e891['query'][_0x7efd('0x42')]));_0x1601a6[_0x7efd('0x36')]=_0x1601a6[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1601a6['attributes']:_0x1a4444[_0x7efd('0x31')];if(!_0x13e891[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x1601a6[_0x7efd('0x1e')]=qs['limit'](_0x13e891['query'][_0x7efd('0x1e')]);_0x1601a6[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x13e891[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1601a6[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x13e891[_0x7efd('0x32')]['sort']);_0x1601a6[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x13e891[_0x7efd('0x32')],_0x1a4444[_0x7efd('0x34')]));_0x1601a6[_0x7efd('0x39')]['CampaignId']=_0x4dd443['id'];if(_0x13e891['query'][_0x7efd('0x3b')]){_0x1601a6[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1601a6[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1601a6[_0x7efd('0x36')],function(_0x576fcc){var _0x38e9a9={};_0x38e9a9[_0x576fcc]={'$like':'%'+_0x13e891[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x38e9a9;})});}_0x1601a6=_['merge']({},_0x1601a6,_0x13e891[_0x7efd('0x4e')]);return db[_0x7efd('0x5b')][_0x7efd('0x1f')]({'where':_0x1601a6[_0x7efd('0x39')]})['then'](function(_0x5ed761){_0x38c128[_0x7efd('0x1f')]=_0x5ed761;if(_0x13e891[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x1601a6[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5b')]['findAll'](_0x1601a6);})[_0x7efd('0x26')](function(_0x4be134){_0x38c128['rows']=_0x4be134;return _0x38c128;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0x5a24e9,_0x1601a6))[_0x7efd('0x45')](handleError(_0x5a24e9,null));};exports[_0x7efd('0x5c')]=function(_0x467cb0,_0xe2d0b8,_0x27e0cc){var _0x2177e3={'raw':!![],'where':{}};var _0x4b08f3={};var _0xb9c016={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')]['findOne']({'where':{'id':_0x467cb0['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xe2d0b8,null))['then'](function(_0x5e2dae){if(_0x5e2dae){_0x4b08f3[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x5d')][_0x7efd('0x30')]);_0x4b08f3[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x467cb0['query']);_0x4b08f3[_0x7efd('0x34')]=_['intersection'](_0x4b08f3[_0x7efd('0x31')],_0x4b08f3[_0x7efd('0x32')]);_0x2177e3['attributes']=_['intersection'](_0x4b08f3['model'],qs['fields'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x42')]));_0x2177e3['attributes']=_0x2177e3[_0x7efd('0x36')][_0x7efd('0x43')]?_0x2177e3[_0x7efd('0x36')]:_0x4b08f3['model'];if(!_0x467cb0[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x2177e3['limit']=qs[_0x7efd('0x1e')](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x2177e3[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x467cb0['query'][_0x7efd('0x1c')]);}_0x2177e3[_0x7efd('0x59')]=qs['sort'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x38')]);_0x2177e3[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x467cb0['query'],_0x4b08f3[_0x7efd('0x34')]));_0x2177e3[_0x7efd('0x39')]['CampaignId']=_0x5e2dae['id'];if(_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]){_0x2177e3[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x2177e3[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x2177e3['attributes'],function(_0x291a87){var _0x107e20={};_0x107e20[_0x291a87]={'$like':'%'+_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x107e20;})});}_0x2177e3=_[_0x7efd('0x3d')]({},_0x2177e3,_0x467cb0[_0x7efd('0x4e')]);return db[_0x7efd('0x5d')][_0x7efd('0x1f')]({'where':_0x2177e3[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x9c4e51){_0xb9c016['count']=_0x9c4e51;if(_0x467cb0[_0x7efd('0x32')]['includeAll']){_0x2177e3[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5d')][_0x7efd('0x40')](_0x2177e3);})['then'](function(_0xa1bcdd){_0xb9c016[_0x7efd('0x41')]=_0xa1bcdd;return _0xb9c016;});}})['then'](respondWithFilteredResult(_0xe2d0b8,_0x2177e3))['catch'](handleError(_0xe2d0b8,null));};exports[_0x7efd('0x5e')]=function(_0x331fa8,_0x1060fa,_0x162380){var _0x26b442={};var _0x201066={};var _0xe4db11;var _0x18f5bb;return db['Campaign']['findOne']({'where':{'id':_0x331fa8['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1060fa,null))['then'](function(_0x21575c){if(_0x21575c){_0xe4db11=_0x21575c;_0x201066[_0x7efd('0x31')]=_[_0x7efd('0x33')](db['CmList']['rawAttributes']);_0x201066[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x331fa8['query']);_0x201066[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],_0x201066[_0x7efd('0x32')]);_0x26b442[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],qs['fields'](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x42')]));_0x26b442['attributes']=_0x26b442[_0x7efd('0x36')][_0x7efd('0x43')]?_0x26b442['attributes']:_0x201066['model'];_0x26b442['order']=qs[_0x7efd('0x38')](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x38')]);_0x26b442[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x331fa8[_0x7efd('0x32')],_0x201066[_0x7efd('0x34')]));if(_0x331fa8[_0x7efd('0x32')]['filter']){_0x26b442['where']=_[_0x7efd('0x3d')](_0x26b442['where'],{'$or':_['map'](_0x26b442[_0x7efd('0x36')],function(_0x4d241c){var _0x262fcf={};_0x262fcf[_0x4d241c]={'$like':'%'+_0x331fa8['query'][_0x7efd('0x3b')]+'%'};return _0x262fcf;})});}_0x26b442=_[_0x7efd('0x3d')]({},_0x26b442,_0x331fa8['options']);return _0xe4db11['getLists'](_0x26b442);}})[_0x7efd('0x26')](function(_0x20d025){if(_0x20d025){_0x18f5bb=_0x20d025[_0x7efd('0x43')];if(!_0x331fa8[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x26b442['limit']=qs[_0x7efd('0x1e')](_0x331fa8['query'][_0x7efd('0x1e')]);_0x26b442['offset']=qs['offset'](_0x331fa8['query'][_0x7efd('0x1c')]);}return _0xe4db11[_0x7efd('0x5e')](_0x26b442);}})[_0x7efd('0x26')](function(_0x14b042){if(_0x14b042){return _0x14b042?{'count':_0x18f5bb,'rows':_0x14b042}:null;}})[_0x7efd('0x26')](respondWithResult(_0x1060fa,null))[_0x7efd('0x45')](handleError(_0x1060fa,null));};exports[_0x7efd('0x5f')]=function(_0x528253,_0x5bc084,_0x5d4d96){var _0x358a22,_0x5be137;var _0x1bd50b=[];var _0x2bd409=moment()[_0x7efd('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x528253['params']['id']}})['then'](handleEntityNotFound(_0x5bc084,null))[_0x7efd('0x26')](function(_0x4ac3e6){if(_0x4ac3e6){_0x5be137=_0x4ac3e6;return _0x4ac3e6[_0x7efd('0x5f')](_0x528253[_0x7efd('0x47')][_0x7efd('0x61')],_['omit'](_0x528253[_0x7efd('0x47')],[_0x7efd('0x61'),'id'])||{});}return null;})[_0x7efd('0x62')](function(_0x1dc4a){var _0x44dfa9;var _0x47da43;_0x358a22=_0x1dc4a||[];var _0x3bfd24=[];if(_0x1dc4a){for(var _0x13e605=0x0;_0x13e605<_0x1dc4a['length'];_0x13e605+=0x1){var _0x4799fb=_0x1dc4a[_0x13e605][_0x7efd('0x27')]({'plain':!![]});_0x5be137[_0x7efd('0x63')]=_0x528253[_0x7efd('0x47')][_0x7efd('0x63')]?_0x528253['body'][_0x7efd('0x63')]:_0x5be137[_0x7efd('0x63')];switch(_0x5be137[_0x7efd('0x63')]){case'always':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),_0x7efd('0x6a'),_0x7efd('0x5a'),'createdAt',_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),'phone')[_0x7efd('0x6c')](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))['field'](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))['field']('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x7efd('0x72'),_0x4799fb['CmListId'][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')](_0x7efd('0x74'),squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x7efd('0x70')]('cm_hopper_final')[_0x7efd('0x39')]('CampaignId\x20=\x20?',_0x528253['params']['id'][_0x7efd('0x6f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()['field'](_0x7efd('0x75'))[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')]())))['toString']();break;case'onlyIfOpen':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('phone','phone')['field'](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),'ListId')[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))['where'](_0x7efd('0x72'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(phone,\x27\x27)')[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id']['toString']())))['toString']();break;default:_0x44dfa9=squel[_0x7efd('0x64')]()['into'](_0x7efd('0x76'))[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),'createdAt','updatedAt'],squel['select']()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))[_0x7efd('0x6c')](_0x7efd('0x6d'),_0x7efd('0x68'))[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253['params']['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')[_0x7efd('0x39')]('ListId\x20=\x20?',_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())['where'](_0x7efd('0x73')))[_0x7efd('0x6f')]();}_0x47da43=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper_additional_phones')[_0x7efd('0x66')](['cmHopperId','scheduledAt','phone','OrderBy',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x79'),'id')[_0x7efd('0x6c')]('NOW()','scheduledAt')[_0x7efd('0x6c')]('ci.item',_0x7efd('0x67'))[_0x7efd('0x6c')]('ci.OrderBY',_0x7efd('0x7a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x7b'),'ci')[_0x7efd('0x7c')](_0x7efd('0x76'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x7efd('0x39')](_0x7efd('0x7d'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x7e'),_0x528253[_0x7efd('0x52')]['id']['toString']())[_0x7efd('0x39')]('h.createdAt\x20=\x20?',_0x2bd409))['toString']();_0x3bfd24['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x44dfa9));_0x1bd50b[_0x7efd('0x80')](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x47da43));}return BPromise[_0x7efd('0x81')](_0x3bfd24);}})[_0x7efd('0x26')](function(){return BPromise[_0x7efd('0x81')](_0x1bd50b);})['then'](function(){return _0x358a22;})[_0x7efd('0x26')](respondWithResult(_0x5bc084,null))[_0x7efd('0x45')](handleError(_0x5bc084,null));};exports[_0x7efd('0x82')]=function(_0x183027,_0x15eb12,_0x21a185){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x183027[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x15eb12,null))[_0x7efd('0x26')](function(_0x5e9881){if(_0x5e9881){return _0x5e9881[_0x7efd('0x82')](_0x183027['query'][_0x7efd('0x61')]);}})['then'](function(_0x24c5a2){if(_0x24c5a2){return db[_0x7efd('0x55')][_0x7efd('0x25')]({'where':{'ListId':_0x183027['query'][_0x7efd('0x61')],'CampaignId':_0x183027['params']['id']}})[_0x7efd('0x26')](function(){return _0x24c5a2;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x15eb12,null))[_0x7efd('0x45')](handleError(_0x15eb12,null));};exports[_0x7efd('0x83')]=function(_0xd20f4f,_0x116536,_0xf7fd10){var _0x21ae04={};var _0x3ef568={};var _0x5c766d;var _0x1048d9;return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0xd20f4f[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x116536,null))[_0x7efd('0x26')](function(_0xb469b0){if(_0xb469b0){_0x5c766d=_0xb469b0;_0x3ef568[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x84')]['rawAttributes']);_0x3ef568[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0xd20f4f[_0x7efd('0x32')]);_0x3ef568[_0x7efd('0x34')]=_['intersection'](_0x3ef568['model'],_0x3ef568['query']);_0x21ae04[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x3ef568['model'],qs[_0x7efd('0x42')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x42')]));_0x21ae04[_0x7efd('0x36')]=_0x21ae04[_0x7efd('0x36')]['length']?_0x21ae04['attributes']:_0x3ef568[_0x7efd('0x31')];_0x21ae04['order']=qs[_0x7efd('0x38')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x38')]);_0x21ae04[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0xd20f4f['query'],_0x3ef568[_0x7efd('0x34')]));if(_0xd20f4f['query']['filter']){_0x21ae04['where']=_[_0x7efd('0x3d')](_0x21ae04[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x21ae04[_0x7efd('0x36')],function(_0x2ba999){var _0x382d49={};_0x382d49[_0x2ba999]={'$like':'%'+_0xd20f4f['query'][_0x7efd('0x3b')]+'%'};return _0x382d49;})});}_0x21ae04=_['merge']({},_0x21ae04,_0xd20f4f['options']);return _0x5c766d[_0x7efd('0x83')](_0x21ae04);}})[_0x7efd('0x26')](function(_0x1f8ee9){if(_0x1f8ee9){_0x1048d9=_0x1f8ee9[_0x7efd('0x43')];if(!_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x21ae04[_0x7efd('0x1e')]=qs['limit'](_0xd20f4f['query']['limit']);_0x21ae04[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x1c')]);}return _0x5c766d['getBlackLists'](_0x21ae04);}})[_0x7efd('0x26')](function(_0x12f58c){if(_0x12f58c){return _0x12f58c?{'count':_0x1048d9,'rows':_0x12f58c}:null;}})[_0x7efd('0x26')](respondWithResult(_0x116536,null))[_0x7efd('0x45')](handleError(_0x116536,null));};exports[_0x7efd('0x85')]=function(_0x46f959,_0x2c3ddd,_0x557e9f){var _0x34857f,_0x5f1309;var _0x106203=[];var _0x17a6db=moment()[_0x7efd('0x60')](_0x7efd('0x86'));return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x46f959[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x2c3ddd,null))[_0x7efd('0x26')](function(_0x44ce02){if(_0x44ce02){_0x5f1309=_0x44ce02;return _0x44ce02[_0x7efd('0x85')](_0x46f959[_0x7efd('0x47')][_0x7efd('0x61')],_[_0x7efd('0x4f')](_0x46f959[_0x7efd('0x47')],['ids','id'])||{});}return null;})[_0x7efd('0x62')](function(_0x47b494){var _0x4887db;var _0x4282d7;_0x34857f=_0x47b494||[];var _0x52d5f9=[];if(_0x47b494){for(var _0x2621d7=0x0;_0x2621d7<_0x47b494[_0x7efd('0x43')];_0x2621d7+=0x1){var _0x5b464f=_0x47b494[_0x2621d7][_0x7efd('0x27')]({'plain':!![]});_0x4887db=squel[_0x7efd('0x64')]()[_0x7efd('0x65')](_0x7efd('0x87'))[_0x7efd('0x66')](['phone',_0x7efd('0x69'),_0x7efd('0x6a'),'CampaignId',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))['field']('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x5b464f[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x46f959[_0x7efd('0x52')]['id']['toString'](),'CampaignId')[_0x7efd('0x6c')](_0x7efd('0x6d'),'createdAt')[_0x7efd('0x6c')]('NOW()',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))[_0x7efd('0x39')](_0x7efd('0x72'),_0x5b464f[_0x7efd('0x6e')]['toString']())[_0x7efd('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x7efd('0x6f')]();_0x52d5f9['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x4887db));}return BPromise[_0x7efd('0x81')](_0x52d5f9);}})[_0x7efd('0x26')](function(){return _0x34857f;})[_0x7efd('0x26')](respondWithResult(_0x2c3ddd,null))[_0x7efd('0x45')](handleError(_0x2c3ddd,null));};exports['removeBlackLists']=function(_0x120408,_0x4bbdb5,_0x2b8b52){return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x120408[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x4bbdb5,null))[_0x7efd('0x26')](function(_0x4188ed){if(_0x4188ed){return _0x4188ed[_0x7efd('0x88')](_0x120408[_0x7efd('0x32')][_0x7efd('0x61')]);}})[_0x7efd('0x26')](function(_0x427263){if(_0x427263){return db['CmHopperBlack'][_0x7efd('0x25')]({'where':{'ListId':_0x120408[_0x7efd('0x32')][_0x7efd('0x61')],'CampaignId':_0x120408[_0x7efd('0x52')]['id']}})['then'](function(){return _0x427263;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x4bbdb5,null))['catch'](handleError(_0x4bbdb5,null));}; \ No newline at end of file +var _0x9d3d=['removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','get','sendStatus','error','name','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','merge','omit','updatedAt','createdAt','UserProfileSection','find','UserProfileResource','getHoppers','findOne','CmHopper','findAll','rows','getHopperHistories','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all'];(function(_0x51b5c4,_0x17a3a8){var _0x5d1ad1=function(_0x29347d){while(--_0x29347d){_0x51b5c4['push'](_0x51b5c4['shift']());}};_0x5d1ad1(++_0x17a3a8);}(_0x9d3d,0x96));var _0xd9d3=function(_0x11bd03,_0x47f79e){_0x11bd03=_0x11bd03-0x0;var _0x490615=_0x9d3d[_0x11bd03];return _0x490615;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9d3('0x0'));var zipdir=require(_0xd9d3('0x1'));var jsonpatch=require(_0xd9d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd9d3('0x3'));var Mustache=require(_0xd9d3('0x4'));var util=require(_0xd9d3('0x5'));var path=require(_0xd9d3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd9d3('0x7'));var fs=require('fs');var fs_extra=require(_0xd9d3('0x8'));var _=require(_0xd9d3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd9d3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd9d3('0xb'));var querystring=require(_0xd9d3('0xc'));var Papa=require(_0xd9d3('0xd'));var Redis=require(_0xd9d3('0xe'));var authService=require(_0xd9d3('0xf'));var qs=require(_0xd9d3('0x10'));var as=require(_0xd9d3('0x11'));var hardwareService=require(_0xd9d3('0x12'));var logger=require('../../config/logger')(_0xd9d3('0x13'));var utils=require(_0xd9d3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd9d3('0x15'));var db=require(_0xd9d3('0x16'))['db'];function respondWithStatusCode(_0x3624d0,_0x1448e3){_0x1448e3=_0x1448e3||0xcc;return function(_0x3a7bf4){if(_0x3a7bf4){return _0x3624d0['sendStatus'](_0x1448e3);}return _0x3624d0[_0xd9d3('0x17')](_0x1448e3)[_0xd9d3('0x18')]();};}function respondWithResult(_0x59d448,_0x1823d0){_0x1823d0=_0x1823d0||0xc8;return function(_0x36500a){if(_0x36500a){return _0x59d448[_0xd9d3('0x17')](_0x1823d0)[_0xd9d3('0x19')](_0x36500a);}};}function respondWithFilteredResult(_0x566e19,_0x57c410){return function(_0x1272b3){if(_0x1272b3){var _0x1c3007=typeof _0x57c410['offset']==='undefined'&&typeof _0x57c410[_0xd9d3('0x1a')]===_0xd9d3('0x1b');var _0xffd5d0=_0x1272b3[_0xd9d3('0x1c')];var _0x3569b2=_0x1c3007?0x0:_0x57c410[_0xd9d3('0x1d')];var _0x8c5d5c=_0x1c3007?_0x1272b3['count']:_0x57c410[_0xd9d3('0x1d')]+_0x57c410['limit'];var _0x2425f7;if(_0x8c5d5c>=_0xffd5d0){_0x8c5d5c=_0xffd5d0;_0x2425f7=0xc8;}else{_0x2425f7=0xce;}_0x566e19[_0xd9d3('0x17')](_0x2425f7);return _0x566e19['set'](_0xd9d3('0x1e'),_0x3569b2+'-'+_0x8c5d5c+'/'+_0xffd5d0)[_0xd9d3('0x19')](_0x1272b3);}return null;};}function patchUpdates(_0x4ea46d){return function(_0x5b9091){try{jsonpatch[_0xd9d3('0x1f')](_0x5b9091,_0x4ea46d,!![]);}catch(_0x2d0b81){return BPromise[_0xd9d3('0x20')](_0x2d0b81);}return _0x5b9091[_0xd9d3('0x21')]();};}function saveUpdates(_0x5d1299,_0x3ecf5b){return function(_0x4473f5){if(_0x4473f5){return _0x4473f5[_0xd9d3('0x22')](_0x5d1299)['then'](function(_0x568e4d){return _0x568e4d;});}return null;};}function removeEntity(_0x588629,_0x30d0be){return function(_0x1673dc){if(_0x1673dc){return _0x1673dc[_0xd9d3('0x23')]()[_0xd9d3('0x24')](function(){var _0x2639bc=_0x1673dc[_0xd9d3('0x25')]({'plain':!![]});var _0x218fec='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x218fec,'resourceId':_0x2639bc['id']}})['then'](function(){return _0x1673dc;});})[_0xd9d3('0x24')](function(){_0x588629[_0xd9d3('0x17')](0xcc)[_0xd9d3('0x18')]();});}};}function handleEntityNotFound(_0x334956,_0x159f20){return function(_0x5356c9){if(!_0x5356c9){_0x334956[_0xd9d3('0x26')](0x194);}return _0x5356c9;};}function handleError(_0xaf8c,_0x2f3699){_0x2f3699=_0x2f3699||0x1f4;return function(_0x5ef35a){logger[_0xd9d3('0x27')](_0x5ef35a['stack']);if(_0x5ef35a[_0xd9d3('0x28')]){delete _0x5ef35a[_0xd9d3('0x28')];}_0xaf8c[_0xd9d3('0x17')](_0x2f3699)['send'](_0x5ef35a);};}exports['index']=function(_0x4f3b3e,_0x3f8dc4){var _0x4fee87={},_0x3021f9={},_0x10c3b5={'count':0x0,'rows':[]};var _0x267083=_[_0xd9d3('0x29')](db[_0xd9d3('0x2a')][_0xd9d3('0x2b')],function(_0x2eeac3){return{'name':_0x2eeac3[_0xd9d3('0x2c')],'type':_0x2eeac3[_0xd9d3('0x2d')][_0xd9d3('0x2e')]};});_0x3021f9[_0xd9d3('0x2f')]=_[_0xd9d3('0x29')](_0x267083,_0xd9d3('0x28'));_0x3021f9[_0xd9d3('0x30')]=_['keys'](_0x4f3b3e[_0xd9d3('0x30')]);_0x3021f9[_0xd9d3('0x31')]=_['intersection'](_0x3021f9[_0xd9d3('0x2f')],_0x3021f9[_0xd9d3('0x30')]);_0x4fee87[_0xd9d3('0x32')]=_[_0xd9d3('0x33')](_0x3021f9[_0xd9d3('0x2f')],qs['fields'](_0x4f3b3e['query'][_0xd9d3('0x34')]));_0x4fee87[_0xd9d3('0x32')]=_0x4fee87['attributes'][_0xd9d3('0x35')]?_0x4fee87[_0xd9d3('0x32')]:_0x3021f9[_0xd9d3('0x2f')];if(!_0x4f3b3e[_0xd9d3('0x30')][_0xd9d3('0x36')](_0xd9d3('0x37'))){_0x4fee87[_0xd9d3('0x1a')]=qs[_0xd9d3('0x1a')](_0x4f3b3e['query']['limit']);_0x4fee87[_0xd9d3('0x1d')]=qs['offset'](_0x4f3b3e['query']['offset']);}_0x4fee87[_0xd9d3('0x38')]=qs[_0xd9d3('0x39')](_0x4f3b3e[_0xd9d3('0x30')]['sort']);_0x4fee87[_0xd9d3('0x3a')]=qs['filters'](_[_0xd9d3('0x3b')](_0x4f3b3e[_0xd9d3('0x30')],_0x3021f9[_0xd9d3('0x31')]),_0x267083);if(_0x4f3b3e[_0xd9d3('0x30')][_0xd9d3('0x3c')]){_0x4fee87[_0xd9d3('0x3a')]=_['merge'](_0x4fee87[_0xd9d3('0x3a')],{'$or':_[_0xd9d3('0x29')](_0x267083,function(_0x570c61){if(_0x570c61['type']!==_0xd9d3('0x3d')){var _0x241286={};_0x241286[_0x570c61[_0xd9d3('0x28')]]={'$like':'%'+_0x4f3b3e[_0xd9d3('0x30')][_0xd9d3('0x3c')]+'%'};return _0x241286;}})});}_0x4fee87=_['merge']({},_0x4fee87,_0x4f3b3e[_0xd9d3('0x3e')]);var _0x24b184={'where':_0x4fee87['where']};return db[_0xd9d3('0x2a')]['count'](_0x24b184)[_0xd9d3('0x24')](function(_0x55d980){_0x10c3b5[_0xd9d3('0x1c')]=_0x55d980;if(_0x4f3b3e[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x4fee87[_0xd9d3('0x40')]=[{'all':!![]}];}return db[_0xd9d3('0x2a')]['findAll'](_0x4fee87);})[_0xd9d3('0x24')](function(_0x98c778){_0x10c3b5['rows']=_0x98c778;return _0x10c3b5;})[_0xd9d3('0x24')](respondWithFilteredResult(_0x3f8dc4,_0x4fee87))[_0xd9d3('0x41')](handleError(_0x3f8dc4,null));};exports['show']=function(_0x64ce3e,_0x5aee7d){var _0x304404={'raw':![],'where':{'id':_0x64ce3e[_0xd9d3('0x42')]['id']}},_0x279e95={};_0x279e95[_0xd9d3('0x2f')]=_['keys'](db[_0xd9d3('0x2a')][_0xd9d3('0x2b')]);_0x279e95[_0xd9d3('0x30')]=_['keys'](_0x64ce3e[_0xd9d3('0x30')]);_0x279e95['filters']=_[_0xd9d3('0x33')](_0x279e95[_0xd9d3('0x2f')],_0x279e95['query']);_0x304404[_0xd9d3('0x32')]=_[_0xd9d3('0x33')](_0x279e95['model'],qs['fields'](_0x64ce3e[_0xd9d3('0x30')][_0xd9d3('0x34')]));_0x304404[_0xd9d3('0x32')]=_0x304404[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0x304404[_0xd9d3('0x32')]:_0x279e95[_0xd9d3('0x2f')];if(_0x64ce3e[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x304404[_0xd9d3('0x40')]=[{'all':!![]}];}_0x304404=_['merge']({},_0x304404,_0x64ce3e[_0xd9d3('0x3e')]);return db['Campaign']['find'](_0x304404)[_0xd9d3('0x24')](handleEntityNotFound(_0x5aee7d,null))['then'](respondWithResult(_0x5aee7d,null))[_0xd9d3('0x41')](handleError(_0x5aee7d,null));};exports[_0xd9d3('0x43')]=function(_0x3b8fed,_0x4a0cd5){return db[_0xd9d3('0x2a')]['create'](_0x3b8fed[_0xd9d3('0x44')],{})[_0xd9d3('0x24')](function(_0x532c24){var _0x47f2e6=_0x3b8fed[_0xd9d3('0x45')][_0xd9d3('0x25')]({'plain':!![]});if(!_0x47f2e6)throw new Error(_0xd9d3('0x46'));if(_0x47f2e6[_0xd9d3('0x47')]===_0xd9d3('0x45')){var _0xc9ac74=_0x532c24[_0xd9d3('0x25')]({'plain':!![]});var _0x213ad=_0xd9d3('0x48');return db['UserProfileSection']['find']({'where':{'name':_0x213ad,'userProfileId':_0x47f2e6[_0xd9d3('0x49')]},'raw':!![]})['then'](function(_0x2a7bfd){if(_0x2a7bfd&&_0x2a7bfd[_0xd9d3('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0xc9ac74[_0xd9d3('0x28')],'resourceId':_0xc9ac74['id'],'type':_0x2a7bfd['name'],'sectionId':_0x2a7bfd['id']},{})['then'](function(){return _0x532c24;});}else{return _0x532c24;}})['catch'](function(_0x597eab){logger[_0xd9d3('0x27')](_0xd9d3('0x4b'),_0x597eab);throw _0x597eab;});}return _0x532c24;})['then'](respondWithResult(_0x4a0cd5,0xc9))[_0xd9d3('0x41')](handleError(_0x4a0cd5,null));};exports[_0xd9d3('0x4c')]=function(_0x56b1f3,_0x5127e0){var _0x50855a={'where':{'id':_0x56b1f3[_0xd9d3('0x42')]['id']}},_0x290be3={};_0x290be3[_0xd9d3('0x2f')]=_[_0xd9d3('0x4d')](db[_0xd9d3('0x2a')][_0xd9d3('0x2b')]);_0x50855a['attributes']=_['intersection'](_0x290be3[_0xd9d3('0x2f')],qs[_0xd9d3('0x34')](_0x56b1f3[_0xd9d3('0x30')][_0xd9d3('0x34')]));_0x50855a[_0xd9d3('0x32')]=_0x50855a[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0x50855a['attributes']:_0x290be3['model'];if(_0x56b1f3[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x50855a[_0xd9d3('0x40')]=[{'all':!![]}];}_0x50855a=_[_0xd9d3('0x4e')]({},_0x50855a,_0x56b1f3[_0xd9d3('0x3e')]);return db[_0xd9d3('0x2a')]['find'](_0x50855a)[_0xd9d3('0x24')](handleEntityNotFound(_0x5127e0,null))[_0xd9d3('0x24')](function(_0xe765ae){if(_0xe765ae){var _0x288cdc=_0xe765ae[_0xd9d3('0x25')]({'plain':!![]});_0x288cdc=qs[_0xd9d3('0x4f')](_0x288cdc,['id','createdAt',_0xd9d3('0x50')]);_0x56b1f3['body']=_[_0xd9d3('0x4f')](_0x56b1f3['body'],['id',_0xd9d3('0x51'),'updatedAt']);return db[_0xd9d3('0x2a')][_0xd9d3('0x43')](_[_0xd9d3('0x4e')](_0x288cdc,_0x56b1f3[_0xd9d3('0x44')]),{'include':_0x56b1f3[_0xd9d3('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0xd9d3('0x24')](function(_0x258c80){var _0x569494=_0x56b1f3['user'][_0xd9d3('0x25')]({'plain':!![]});if(!_0x569494)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x569494[_0xd9d3('0x47')]==='user'){var _0x479eba=_0x258c80['get']({'plain':!![]});var _0x3f9219='IvrCampaigns';return db[_0xd9d3('0x52')][_0xd9d3('0x53')]({'where':{'name':_0x3f9219,'userProfileId':_0x569494['userProfileId']},'raw':!![]})[_0xd9d3('0x24')](function(_0x2f5bad){if(_0x2f5bad&&_0x2f5bad[_0xd9d3('0x4a')]===0x0){return db[_0xd9d3('0x54')][_0xd9d3('0x43')]({'name':_0x479eba[_0xd9d3('0x28')],'resourceId':_0x479eba['id'],'type':_0x2f5bad[_0xd9d3('0x28')],'sectionId':_0x2f5bad['id']},{})[_0xd9d3('0x24')](function(){return _0x258c80;});}else{return _0x258c80;}})[_0xd9d3('0x41')](function(_0x29d394){logger[_0xd9d3('0x27')](_0xd9d3('0x4b'),_0x29d394);throw _0x29d394;});}return _0x258c80;});}})[_0xd9d3('0x24')](respondWithResult(_0x5127e0,0xc9))[_0xd9d3('0x41')](handleError(_0x5127e0,null));};exports[_0xd9d3('0x22')]=function(_0x530b26,_0x12292a){if(_0x530b26['body']['id']){delete _0x530b26[_0xd9d3('0x44')]['id'];}return db[_0xd9d3('0x2a')][_0xd9d3('0x53')]({'where':{'id':_0x530b26['params']['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x12292a,null))[_0xd9d3('0x24')](saveUpdates(_0x530b26[_0xd9d3('0x44')],null))[_0xd9d3('0x24')](respondWithResult(_0x12292a,null))[_0xd9d3('0x41')](handleError(_0x12292a,null));};exports['destroy']=function(_0x10cdae,_0x57cc4b){return db['Campaign'][_0xd9d3('0x53')]({'where':{'id':_0x10cdae[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x57cc4b,null))[_0xd9d3('0x24')](removeEntity(_0x57cc4b,null))[_0xd9d3('0x41')](handleError(_0x57cc4b,null));};exports[_0xd9d3('0x55')]=function(_0x4d168a,_0x4ba3aa,_0x480b1f){var _0x43737c={'raw':!![],'where':{}};var _0x22fd8f={};var _0x364982={'count':0x0,'rows':[]};return db['Campaign'][_0xd9d3('0x56')]({'where':{'id':_0x4d168a['params']['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x4ba3aa,null))[_0xd9d3('0x24')](function(_0x438172){if(_0x438172){_0x22fd8f[_0xd9d3('0x2f')]=_['keys'](db[_0xd9d3('0x57')]['rawAttributes']);_0x22fd8f[_0xd9d3('0x30')]=_[_0xd9d3('0x4d')](_0x4d168a['query']);_0x22fd8f[_0xd9d3('0x31')]=_[_0xd9d3('0x33')](_0x22fd8f['model'],_0x22fd8f[_0xd9d3('0x30')]);_0x43737c['attributes']=_[_0xd9d3('0x33')](_0x22fd8f[_0xd9d3('0x2f')],qs[_0xd9d3('0x34')](_0x4d168a[_0xd9d3('0x30')]['fields']));_0x43737c[_0xd9d3('0x32')]=_0x43737c[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0x43737c[_0xd9d3('0x32')]:_0x22fd8f[_0xd9d3('0x2f')];if(!_0x4d168a[_0xd9d3('0x30')]['hasOwnProperty']('nolimit')){_0x43737c['limit']=qs[_0xd9d3('0x1a')](_0x4d168a[_0xd9d3('0x30')][_0xd9d3('0x1a')]);_0x43737c[_0xd9d3('0x1d')]=qs[_0xd9d3('0x1d')](_0x4d168a[_0xd9d3('0x30')][_0xd9d3('0x1d')]);}_0x43737c[_0xd9d3('0x38')]=qs[_0xd9d3('0x39')](_0x4d168a[_0xd9d3('0x30')]['sort']);_0x43737c[_0xd9d3('0x3a')]=qs[_0xd9d3('0x31')](_[_0xd9d3('0x3b')](_0x4d168a[_0xd9d3('0x30')],_0x22fd8f[_0xd9d3('0x31')]));_0x43737c[_0xd9d3('0x3a')]['CampaignId']=_0x438172['id'];if(_0x4d168a[_0xd9d3('0x30')][_0xd9d3('0x3c')]){_0x43737c[_0xd9d3('0x3a')]=_['merge'](_0x43737c[_0xd9d3('0x3a')],{'$or':_['map'](_0x43737c[_0xd9d3('0x32')],function(_0x167c87){var _0x2dd3e5={};_0x2dd3e5[_0x167c87]={'$like':'%'+_0x4d168a[_0xd9d3('0x30')][_0xd9d3('0x3c')]+'%'};return _0x2dd3e5;})});}_0x43737c=_[_0xd9d3('0x4e')]({},_0x43737c,_0x4d168a['options']);return db[_0xd9d3('0x57')][_0xd9d3('0x1c')]({'where':_0x43737c['where']})[_0xd9d3('0x24')](function(_0x2142b9){_0x364982['count']=_0x2142b9;if(_0x4d168a[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x43737c[_0xd9d3('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0xd9d3('0x58')](_0x43737c);})[_0xd9d3('0x24')](function(_0x4a8a13){_0x364982[_0xd9d3('0x59')]=_0x4a8a13;return _0x364982;});}})['then'](respondWithFilteredResult(_0x4ba3aa,_0x43737c))[_0xd9d3('0x41')](handleError(_0x4ba3aa,null));};exports[_0xd9d3('0x5a')]=function(_0x23d4f4,_0x42191e,_0x4495c0){var _0x4abb87={'raw':!![],'where':{}};var _0x2b98cb={};var _0x383b38={'count':0x0,'rows':[]};return db[_0xd9d3('0x2a')]['findOne']({'where':{'id':_0x23d4f4[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x42191e,null))[_0xd9d3('0x24')](function(_0x51d03e){if(_0x51d03e){_0x2b98cb[_0xd9d3('0x2f')]=_[_0xd9d3('0x4d')](db['CmHopperHistory'][_0xd9d3('0x2b')]);_0x2b98cb[_0xd9d3('0x30')]=_[_0xd9d3('0x4d')](_0x23d4f4[_0xd9d3('0x30')]);_0x2b98cb[_0xd9d3('0x31')]=_[_0xd9d3('0x33')](_0x2b98cb['model'],_0x2b98cb['query']);_0x4abb87[_0xd9d3('0x32')]=_[_0xd9d3('0x33')](_0x2b98cb[_0xd9d3('0x2f')],qs['fields'](_0x23d4f4['query'][_0xd9d3('0x34')]));_0x4abb87['attributes']=_0x4abb87[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0x4abb87['attributes']:_0x2b98cb[_0xd9d3('0x2f')];if(!_0x23d4f4['query'][_0xd9d3('0x36')]('nolimit')){_0x4abb87[_0xd9d3('0x1a')]=qs['limit'](_0x23d4f4[_0xd9d3('0x30')]['limit']);_0x4abb87[_0xd9d3('0x1d')]=qs[_0xd9d3('0x1d')](_0x23d4f4[_0xd9d3('0x30')][_0xd9d3('0x1d')]);}_0x4abb87[_0xd9d3('0x38')]=qs['sort'](_0x23d4f4[_0xd9d3('0x30')][_0xd9d3('0x39')]);_0x4abb87[_0xd9d3('0x3a')]=qs[_0xd9d3('0x31')](_['pick'](_0x23d4f4[_0xd9d3('0x30')],_0x2b98cb[_0xd9d3('0x31')]));_0x4abb87['where'][_0xd9d3('0x5b')]=_0x51d03e['id'];if(_0x23d4f4[_0xd9d3('0x30')][_0xd9d3('0x3c')]){_0x4abb87[_0xd9d3('0x3a')]=_[_0xd9d3('0x4e')](_0x4abb87[_0xd9d3('0x3a')],{'$or':_['map'](_0x4abb87[_0xd9d3('0x32')],function(_0x5ee305){var _0x53d21c={};_0x53d21c[_0x5ee305]={'$like':'%'+_0x23d4f4[_0xd9d3('0x30')][_0xd9d3('0x3c')]+'%'};return _0x53d21c;})});}_0x4abb87=_[_0xd9d3('0x4e')]({},_0x4abb87,_0x23d4f4['options']);return db[_0xd9d3('0x5c')][_0xd9d3('0x1c')]({'where':_0x4abb87['where']})['then'](function(_0x573e57){_0x383b38[_0xd9d3('0x1c')]=_0x573e57;if(_0x23d4f4[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x4abb87[_0xd9d3('0x40')]=[{'all':!![]}];}return db[_0xd9d3('0x5c')][_0xd9d3('0x58')](_0x4abb87);})[_0xd9d3('0x24')](function(_0x4264a0){_0x383b38[_0xd9d3('0x59')]=_0x4264a0;return _0x383b38;});}})[_0xd9d3('0x24')](respondWithFilteredResult(_0x42191e,_0x4abb87))['catch'](handleError(_0x42191e,null));};exports['getHopperFinals']=function(_0x1d1353,_0x28c6b6,_0x5872d2){var _0x5c5b9a={'raw':!![],'where':{}};var _0x4c3a80={};var _0x1f3492={'count':0x0,'rows':[]};return db[_0xd9d3('0x2a')][_0xd9d3('0x56')]({'where':{'id':_0x1d1353['params']['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x28c6b6,null))[_0xd9d3('0x24')](function(_0xe4cba1){if(_0xe4cba1){_0x4c3a80['model']=_[_0xd9d3('0x4d')](db[_0xd9d3('0x5d')][_0xd9d3('0x2b')]);_0x4c3a80['query']=_[_0xd9d3('0x4d')](_0x1d1353[_0xd9d3('0x30')]);_0x4c3a80['filters']=_['intersection'](_0x4c3a80[_0xd9d3('0x2f')],_0x4c3a80[_0xd9d3('0x30')]);_0x5c5b9a[_0xd9d3('0x32')]=_[_0xd9d3('0x33')](_0x4c3a80[_0xd9d3('0x2f')],qs[_0xd9d3('0x34')](_0x1d1353['query'][_0xd9d3('0x34')]));_0x5c5b9a['attributes']=_0x5c5b9a[_0xd9d3('0x32')]['length']?_0x5c5b9a[_0xd9d3('0x32')]:_0x4c3a80[_0xd9d3('0x2f')];if(!_0x1d1353[_0xd9d3('0x30')][_0xd9d3('0x36')](_0xd9d3('0x37'))){_0x5c5b9a[_0xd9d3('0x1a')]=qs[_0xd9d3('0x1a')](_0x1d1353['query']['limit']);_0x5c5b9a['offset']=qs['offset'](_0x1d1353[_0xd9d3('0x30')][_0xd9d3('0x1d')]);}_0x5c5b9a[_0xd9d3('0x38')]=qs['sort'](_0x1d1353['query'][_0xd9d3('0x39')]);_0x5c5b9a['where']=qs[_0xd9d3('0x31')](_[_0xd9d3('0x3b')](_0x1d1353[_0xd9d3('0x30')],_0x4c3a80[_0xd9d3('0x31')]));_0x5c5b9a[_0xd9d3('0x3a')][_0xd9d3('0x5b')]=_0xe4cba1['id'];if(_0x1d1353['query'][_0xd9d3('0x3c')]){_0x5c5b9a[_0xd9d3('0x3a')]=_['merge'](_0x5c5b9a['where'],{'$or':_['map'](_0x5c5b9a[_0xd9d3('0x32')],function(_0x36e097){var _0x10f456={};_0x10f456[_0x36e097]={'$like':'%'+_0x1d1353[_0xd9d3('0x30')]['filter']+'%'};return _0x10f456;})});}_0x5c5b9a=_['merge']({},_0x5c5b9a,_0x1d1353[_0xd9d3('0x3e')]);return db[_0xd9d3('0x5d')][_0xd9d3('0x1c')]({'where':_0x5c5b9a['where']})[_0xd9d3('0x24')](function(_0x1f25d0){_0x1f3492[_0xd9d3('0x1c')]=_0x1f25d0;if(_0x1d1353['query']['includeAll']){_0x5c5b9a[_0xd9d3('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd9d3('0x58')](_0x5c5b9a);})[_0xd9d3('0x24')](function(_0x164cbd){_0x1f3492['rows']=_0x164cbd;return _0x1f3492;});}})[_0xd9d3('0x24')](respondWithFilteredResult(_0x28c6b6,_0x5c5b9a))[_0xd9d3('0x41')](handleError(_0x28c6b6,null));};exports[_0xd9d3('0x5e')]=function(_0x310854,_0x58e679,_0x372ae6){var _0x3c6450={'raw':!![],'where':{}};var _0x48718a={};var _0x2760ec={'count':0x0,'rows':[]};return db[_0xd9d3('0x2a')]['findOne']({'where':{'id':_0x310854['params']['id']}})['then'](handleEntityNotFound(_0x58e679,null))[_0xd9d3('0x24')](function(_0x1f6e37){if(_0x1f6e37){_0x48718a[_0xd9d3('0x2f')]=_['keys'](db['CmHopperBlack'][_0xd9d3('0x2b')]);_0x48718a[_0xd9d3('0x30')]=_[_0xd9d3('0x4d')](_0x310854[_0xd9d3('0x30')]);_0x48718a[_0xd9d3('0x31')]=_[_0xd9d3('0x33')](_0x48718a[_0xd9d3('0x2f')],_0x48718a['query']);_0x3c6450[_0xd9d3('0x32')]=_[_0xd9d3('0x33')](_0x48718a[_0xd9d3('0x2f')],qs[_0xd9d3('0x34')](_0x310854[_0xd9d3('0x30')][_0xd9d3('0x34')]));_0x3c6450['attributes']=_0x3c6450['attributes'][_0xd9d3('0x35')]?_0x3c6450[_0xd9d3('0x32')]:_0x48718a[_0xd9d3('0x2f')];if(!_0x310854[_0xd9d3('0x30')]['hasOwnProperty']('nolimit')){_0x3c6450[_0xd9d3('0x1a')]=qs[_0xd9d3('0x1a')](_0x310854[_0xd9d3('0x30')][_0xd9d3('0x1a')]);_0x3c6450['offset']=qs[_0xd9d3('0x1d')](_0x310854[_0xd9d3('0x30')][_0xd9d3('0x1d')]);}_0x3c6450[_0xd9d3('0x38')]=qs[_0xd9d3('0x39')](_0x310854[_0xd9d3('0x30')][_0xd9d3('0x39')]);_0x3c6450[_0xd9d3('0x3a')]=qs[_0xd9d3('0x31')](_[_0xd9d3('0x3b')](_0x310854['query'],_0x48718a['filters']));_0x3c6450[_0xd9d3('0x3a')][_0xd9d3('0x5b')]=_0x1f6e37['id'];if(_0x310854['query'][_0xd9d3('0x3c')]){_0x3c6450[_0xd9d3('0x3a')]=_['merge'](_0x3c6450[_0xd9d3('0x3a')],{'$or':_[_0xd9d3('0x29')](_0x3c6450['attributes'],function(_0x5ddbce){var _0x40d4e9={};_0x40d4e9[_0x5ddbce]={'$like':'%'+_0x310854['query'][_0xd9d3('0x3c')]+'%'};return _0x40d4e9;})});}_0x3c6450=_[_0xd9d3('0x4e')]({},_0x3c6450,_0x310854['options']);return db['CmHopperBlack'][_0xd9d3('0x1c')]({'where':_0x3c6450[_0xd9d3('0x3a')]})[_0xd9d3('0x24')](function(_0x5344c2){_0x2760ec[_0xd9d3('0x1c')]=_0x5344c2;if(_0x310854[_0xd9d3('0x30')][_0xd9d3('0x3f')]){_0x3c6450['include']=[{'all':!![]}];}return db[_0xd9d3('0x5f')][_0xd9d3('0x58')](_0x3c6450);})['then'](function(_0x59e265){_0x2760ec[_0xd9d3('0x59')]=_0x59e265;return _0x2760ec;});}})[_0xd9d3('0x24')](respondWithFilteredResult(_0x58e679,_0x3c6450))['catch'](handleError(_0x58e679,null));};exports[_0xd9d3('0x60')]=function(_0x3cb9a1,_0x28eb3e,_0x51a979){var _0xf99a02={};var _0x4b8238={};var _0x4b8e8d;var _0x10f603;return db[_0xd9d3('0x2a')]['findOne']({'where':{'id':_0x3cb9a1[_0xd9d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x28eb3e,null))[_0xd9d3('0x24')](function(_0x8f4fbe){if(_0x8f4fbe){_0x4b8e8d=_0x8f4fbe;_0x4b8238[_0xd9d3('0x2f')]=_[_0xd9d3('0x4d')](db[_0xd9d3('0x61')][_0xd9d3('0x2b')]);_0x4b8238[_0xd9d3('0x30')]=_[_0xd9d3('0x4d')](_0x3cb9a1[_0xd9d3('0x30')]);_0x4b8238['filters']=_[_0xd9d3('0x33')](_0x4b8238[_0xd9d3('0x2f')],_0x4b8238[_0xd9d3('0x30')]);_0xf99a02['attributes']=_[_0xd9d3('0x33')](_0x4b8238['model'],qs['fields'](_0x3cb9a1[_0xd9d3('0x30')][_0xd9d3('0x34')]));_0xf99a02[_0xd9d3('0x32')]=_0xf99a02[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0xf99a02['attributes']:_0x4b8238[_0xd9d3('0x2f')];_0xf99a02[_0xd9d3('0x38')]=qs[_0xd9d3('0x39')](_0x3cb9a1[_0xd9d3('0x30')][_0xd9d3('0x39')]);_0xf99a02[_0xd9d3('0x3a')]=qs[_0xd9d3('0x31')](_[_0xd9d3('0x3b')](_0x3cb9a1[_0xd9d3('0x30')],_0x4b8238['filters']));if(_0x3cb9a1[_0xd9d3('0x30')]['filter']){_0xf99a02[_0xd9d3('0x3a')]=_[_0xd9d3('0x4e')](_0xf99a02[_0xd9d3('0x3a')],{'$or':_[_0xd9d3('0x29')](_0xf99a02[_0xd9d3('0x32')],function(_0x3b7328){var _0x38b4a9={};_0x38b4a9[_0x3b7328]={'$like':'%'+_0x3cb9a1[_0xd9d3('0x30')][_0xd9d3('0x3c')]+'%'};return _0x38b4a9;})});}_0xf99a02=_[_0xd9d3('0x4e')]({},_0xf99a02,_0x3cb9a1[_0xd9d3('0x3e')]);return _0x4b8e8d[_0xd9d3('0x60')](_0xf99a02);}})['then'](function(_0x42bd53){if(_0x42bd53){_0x10f603=_0x42bd53[_0xd9d3('0x35')];if(!_0x3cb9a1[_0xd9d3('0x30')][_0xd9d3('0x36')](_0xd9d3('0x37'))){_0xf99a02[_0xd9d3('0x1a')]=qs[_0xd9d3('0x1a')](_0x3cb9a1['query'][_0xd9d3('0x1a')]);_0xf99a02[_0xd9d3('0x1d')]=qs[_0xd9d3('0x1d')](_0x3cb9a1[_0xd9d3('0x30')]['offset']);}return _0x4b8e8d[_0xd9d3('0x60')](_0xf99a02);}})[_0xd9d3('0x24')](function(_0x12b666){if(_0x12b666){return _0x12b666?{'count':_0x10f603,'rows':_0x12b666}:null;}})['then'](respondWithResult(_0x28eb3e,null))['catch'](handleError(_0x28eb3e,null));};exports[_0xd9d3('0x62')]=function(_0x53062c,_0x5d4422,_0x54f894){var _0x2e37ae,_0x5a84c8;var _0x2f6eba=[];var _0x570077=moment()[_0xd9d3('0x63')](_0xd9d3('0x64'));return db[_0xd9d3('0x2a')][_0xd9d3('0x53')]({'where':{'id':_0x53062c[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x5d4422,null))['then'](function(_0x331d5b){if(_0x331d5b){_0x5a84c8=_0x331d5b;return _0x331d5b[_0xd9d3('0x62')](_0x53062c[_0xd9d3('0x44')][_0xd9d3('0x65')],_['omit'](_0x53062c['body'],['ids','id'])||{});}return null;})[_0xd9d3('0x66')](function(_0x45026c){var _0x2117a3;var _0x5d5875;_0x2e37ae=_0x45026c||[];var _0x22d13d=[];if(_0x45026c){for(var _0x5a147c=0x0;_0x5a147c<_0x45026c[_0xd9d3('0x35')];_0x5a147c+=0x1){var _0x4fa98b=_0x45026c[_0x5a147c][_0xd9d3('0x25')]({'plain':!![]});_0x5a84c8[_0xd9d3('0x67')]=_0x53062c[_0xd9d3('0x44')][_0xd9d3('0x67')]?_0x53062c[_0xd9d3('0x44')]['dialCheckDuplicateType']:_0x5a84c8[_0xd9d3('0x67')];switch(_0x5a84c8[_0xd9d3('0x67')]){case _0xd9d3('0x68'):_0x2117a3=squel[_0xd9d3('0x69')]()['into'](_0xd9d3('0x6a'))[_0xd9d3('0x6b')]([_0xd9d3('0x6c'),_0xd9d3('0x6d'),_0xd9d3('0x6e'),_0xd9d3('0x6f'),_0xd9d3('0x5b'),'createdAt',_0xd9d3('0x50')],squel['select']()[_0xd9d3('0x70')](_0xd9d3('0x6c'),_0xd9d3('0x6c'))[_0xd9d3('0x70')](_0xd9d3('0x71'),_0xd9d3('0x6d'))[_0xd9d3('0x70')]('id',_0xd9d3('0x6e'))[_0xd9d3('0x70')](_0x4fa98b[_0xd9d3('0x72')]['toString'](),'ListId')[_0xd9d3('0x70')](_0x53062c[_0xd9d3('0x42')]['id']['toString'](),_0xd9d3('0x5b'))['field']('\x27'+_0x570077+'\x27',_0xd9d3('0x51'))[_0xd9d3('0x70')]('\x27'+_0x570077+'\x27',_0xd9d3('0x50'))[_0xd9d3('0x73')](_0xd9d3('0x74'))[_0xd9d3('0x3a')](_0xd9d3('0x75'))['where'](_0xd9d3('0x76'),_0x4fa98b[_0xd9d3('0x72')][_0xd9d3('0x77')]())[_0xd9d3('0x3a')](_0xd9d3('0x78'))[_0xd9d3('0x3a')](_0xd9d3('0x79'),squel[_0xd9d3('0x7a')]()['field'](_0xd9d3('0x7b'))[_0xd9d3('0x73')](_0xd9d3('0x7c'))[_0xd9d3('0x3a')](_0xd9d3('0x7d'),_0x53062c[_0xd9d3('0x42')]['id']['toString']()))[_0xd9d3('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xd9d3('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0xd9d3('0x6a'))[_0xd9d3('0x3a')](_0xd9d3('0x7d'),_0x53062c['params']['id'][_0xd9d3('0x77')]())))[_0xd9d3('0x77')]();break;case'onlyIfOpen':_0x2117a3=squel['insert']()[_0xd9d3('0x7e')](_0xd9d3('0x6a'))[_0xd9d3('0x6b')]([_0xd9d3('0x6c'),'scheduledAt',_0xd9d3('0x6e'),_0xd9d3('0x6f'),_0xd9d3('0x5b'),_0xd9d3('0x51'),_0xd9d3('0x50')],squel[_0xd9d3('0x7a')]()[_0xd9d3('0x70')](_0xd9d3('0x6c'),_0xd9d3('0x6c'))[_0xd9d3('0x70')](_0xd9d3('0x71'),_0xd9d3('0x6d'))[_0xd9d3('0x70')]('id',_0xd9d3('0x6e'))[_0xd9d3('0x70')](_0x4fa98b['CmListId'][_0xd9d3('0x77')](),_0xd9d3('0x6f'))[_0xd9d3('0x70')](_0x53062c[_0xd9d3('0x42')]['id']['toString'](),_0xd9d3('0x5b'))[_0xd9d3('0x70')]('\x27'+_0x570077+'\x27','createdAt')['field']('\x27'+_0x570077+'\x27',_0xd9d3('0x50'))[_0xd9d3('0x73')](_0xd9d3('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0xd9d3('0x3a')](_0xd9d3('0x76'),_0x4fa98b[_0xd9d3('0x72')][_0xd9d3('0x77')]())[_0xd9d3('0x3a')](_0xd9d3('0x78'))[_0xd9d3('0x3a')](_0xd9d3('0x79'),squel[_0xd9d3('0x7a')]()[_0xd9d3('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0xd9d3('0x6a'))[_0xd9d3('0x3a')](_0xd9d3('0x7d'),_0x53062c[_0xd9d3('0x42')]['id']['toString']())))['toString']();break;default:_0x2117a3=squel['insert']()[_0xd9d3('0x7e')](_0xd9d3('0x6a'))['fromQuery']([_0xd9d3('0x6c'),_0xd9d3('0x6d'),_0xd9d3('0x6e'),'ListId','CampaignId',_0xd9d3('0x51'),_0xd9d3('0x50')],squel[_0xd9d3('0x7a')]()[_0xd9d3('0x70')]('phone',_0xd9d3('0x6c'))[_0xd9d3('0x70')](_0xd9d3('0x71'),'scheduledAt')['field']('id',_0xd9d3('0x6e'))[_0xd9d3('0x70')](_0x4fa98b[_0xd9d3('0x72')]['toString'](),_0xd9d3('0x6f'))[_0xd9d3('0x70')](_0x53062c[_0xd9d3('0x42')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x570077+'\x27','createdAt')[_0xd9d3('0x70')]('\x27'+_0x570077+'\x27',_0xd9d3('0x50'))[_0xd9d3('0x73')]('cm_contacts')[_0xd9d3('0x3a')](_0xd9d3('0x75'))[_0xd9d3('0x3a')]('ListId\x20=\x20?',_0x4fa98b[_0xd9d3('0x72')][_0xd9d3('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xd9d3('0x77')]();}_0x5d5875=squel['insert']()['into'](_0xd9d3('0x7f'))[_0xd9d3('0x6b')]([_0xd9d3('0x80'),_0xd9d3('0x6d'),'phone',_0xd9d3('0x81'),'createdAt',_0xd9d3('0x50')],squel[_0xd9d3('0x7a')]()['field'](_0xd9d3('0x82'),'id')['field'](_0xd9d3('0x71'),_0xd9d3('0x6d'))['field'](_0xd9d3('0x83'),_0xd9d3('0x6c'))[_0xd9d3('0x70')]('ci.OrderBY','OrderBy')[_0xd9d3('0x70')]('\x27'+_0x570077+'\x27','createdAt')['field']('\x27'+_0x570077+'\x27',_0xd9d3('0x50'))[_0xd9d3('0x73')](_0xd9d3('0x84'),'ci')[_0xd9d3('0x85')]('cm_hopper','h',_0xd9d3('0x86'))[_0xd9d3('0x3a')](_0xd9d3('0x87'),_0x4fa98b[_0xd9d3('0x72')][_0xd9d3('0x77')]())[_0xd9d3('0x3a')]('h.CampaignId=?',_0x53062c[_0xd9d3('0x42')]['id'][_0xd9d3('0x77')]())[_0xd9d3('0x3a')](_0xd9d3('0x88'),_0x570077))['toString']();_0x22d13d[_0xd9d3('0x89')](db[_0xd9d3('0x8a')][_0xd9d3('0x30')](_0x2117a3));_0x2f6eba[_0xd9d3('0x89')](db[_0xd9d3('0x8a')][_0xd9d3('0x30')](_0x5d5875));}return BPromise[_0xd9d3('0x8b')](_0x22d13d);}})[_0xd9d3('0x24')](function(){return BPromise[_0xd9d3('0x8b')](_0x2f6eba);})[_0xd9d3('0x24')](function(){return _0x2e37ae;})[_0xd9d3('0x24')](respondWithResult(_0x5d4422,null))[_0xd9d3('0x41')](handleError(_0x5d4422,null));};exports[_0xd9d3('0x8c')]=function(_0x35d81e,_0xd0037a,_0x426882){return db[_0xd9d3('0x2a')][_0xd9d3('0x53')]({'where':{'id':_0x35d81e[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0xd0037a,null))['then'](function(_0x940f05){if(_0x940f05){return _0x940f05['removeLists'](_0x35d81e[_0xd9d3('0x30')][_0xd9d3('0x65')]);}})['then'](function(_0x5b0fff){if(_0x5b0fff){return db['CmHopper'][_0xd9d3('0x23')]({'where':{'ListId':_0x35d81e[_0xd9d3('0x30')][_0xd9d3('0x65')],'CampaignId':_0x35d81e[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](function(){return _0x5b0fff;});}})[_0xd9d3('0x24')](respondWithStatusCode(_0xd0037a,null))[_0xd9d3('0x41')](handleError(_0xd0037a,null));};exports['getBlackLists']=function(_0x104c8f,_0x1e6bca,_0x1dd828){var _0x5579d1={};var _0x1c5c2c={};var _0xa6079a;var _0xaaa4f9;return db[_0xd9d3('0x2a')][_0xd9d3('0x56')]({'where':{'id':_0x104c8f[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x1e6bca,null))[_0xd9d3('0x24')](function(_0x31aec7){if(_0x31aec7){_0xa6079a=_0x31aec7;_0x1c5c2c[_0xd9d3('0x2f')]=_[_0xd9d3('0x4d')](db[_0xd9d3('0x61')][_0xd9d3('0x2b')]);_0x1c5c2c[_0xd9d3('0x30')]=_['keys'](_0x104c8f[_0xd9d3('0x30')]);_0x1c5c2c[_0xd9d3('0x31')]=_['intersection'](_0x1c5c2c[_0xd9d3('0x2f')],_0x1c5c2c[_0xd9d3('0x30')]);_0x5579d1['attributes']=_[_0xd9d3('0x33')](_0x1c5c2c['model'],qs[_0xd9d3('0x34')](_0x104c8f['query'][_0xd9d3('0x34')]));_0x5579d1[_0xd9d3('0x32')]=_0x5579d1[_0xd9d3('0x32')][_0xd9d3('0x35')]?_0x5579d1[_0xd9d3('0x32')]:_0x1c5c2c['model'];_0x5579d1[_0xd9d3('0x38')]=qs['sort'](_0x104c8f['query'][_0xd9d3('0x39')]);_0x5579d1[_0xd9d3('0x3a')]=qs[_0xd9d3('0x31')](_[_0xd9d3('0x3b')](_0x104c8f[_0xd9d3('0x30')],_0x1c5c2c[_0xd9d3('0x31')]));if(_0x104c8f[_0xd9d3('0x30')][_0xd9d3('0x3c')]){_0x5579d1[_0xd9d3('0x3a')]=_['merge'](_0x5579d1[_0xd9d3('0x3a')],{'$or':_['map'](_0x5579d1[_0xd9d3('0x32')],function(_0x4ac0c2){var _0x488779={};_0x488779[_0x4ac0c2]={'$like':'%'+_0x104c8f[_0xd9d3('0x30')]['filter']+'%'};return _0x488779;})});}_0x5579d1=_[_0xd9d3('0x4e')]({},_0x5579d1,_0x104c8f[_0xd9d3('0x3e')]);return _0xa6079a[_0xd9d3('0x8d')](_0x5579d1);}})[_0xd9d3('0x24')](function(_0x4694d9){if(_0x4694d9){_0xaaa4f9=_0x4694d9[_0xd9d3('0x35')];if(!_0x104c8f['query'][_0xd9d3('0x36')](_0xd9d3('0x37'))){_0x5579d1[_0xd9d3('0x1a')]=qs[_0xd9d3('0x1a')](_0x104c8f[_0xd9d3('0x30')][_0xd9d3('0x1a')]);_0x5579d1[_0xd9d3('0x1d')]=qs[_0xd9d3('0x1d')](_0x104c8f[_0xd9d3('0x30')][_0xd9d3('0x1d')]);}return _0xa6079a[_0xd9d3('0x8d')](_0x5579d1);}})['then'](function(_0x1b5c02){if(_0x1b5c02){return _0x1b5c02?{'count':_0xaaa4f9,'rows':_0x1b5c02}:null;}})[_0xd9d3('0x24')](respondWithResult(_0x1e6bca,null))[_0xd9d3('0x41')](handleError(_0x1e6bca,null));};exports[_0xd9d3('0x8e')]=function(_0x361ab3,_0x4b799a,_0x2f0482){var _0x16b4b2,_0x68774f;var _0x414dec=[];var _0x33eb89=moment()[_0xd9d3('0x63')](_0xd9d3('0x64'));return db['Campaign'][_0xd9d3('0x53')]({'where':{'id':_0x361ab3[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](handleEntityNotFound(_0x4b799a,null))['then'](function(_0x52e9f7){if(_0x52e9f7){_0x68774f=_0x52e9f7;return _0x52e9f7[_0xd9d3('0x8e')](_0x361ab3[_0xd9d3('0x44')][_0xd9d3('0x65')],_[_0xd9d3('0x4f')](_0x361ab3[_0xd9d3('0x44')],[_0xd9d3('0x65'),'id'])||{});}return null;})[_0xd9d3('0x66')](function(_0x9a22e){var _0x2845a1;var _0x1dd761;_0x16b4b2=_0x9a22e||[];var _0x44370f=[];if(_0x9a22e){for(var _0x27c236=0x0;_0x27c236<_0x9a22e[_0xd9d3('0x35')];_0x27c236+=0x1){var _0x5adf60=_0x9a22e[_0x27c236][_0xd9d3('0x25')]({'plain':!![]});_0x2845a1=squel[_0xd9d3('0x69')]()['into'](_0xd9d3('0x8f'))[_0xd9d3('0x6b')]([_0xd9d3('0x6c'),_0xd9d3('0x6e'),_0xd9d3('0x6f'),_0xd9d3('0x5b'),_0xd9d3('0x51'),_0xd9d3('0x50')],squel[_0xd9d3('0x7a')]()['field'](_0xd9d3('0x6c'),_0xd9d3('0x6c'))[_0xd9d3('0x70')]('id','ContactId')[_0xd9d3('0x70')](_0x5adf60[_0xd9d3('0x72')][_0xd9d3('0x77')](),_0xd9d3('0x6f'))[_0xd9d3('0x70')](_0x361ab3[_0xd9d3('0x42')]['id'][_0xd9d3('0x77')](),_0xd9d3('0x5b'))[_0xd9d3('0x70')](_0xd9d3('0x71'),_0xd9d3('0x51'))[_0xd9d3('0x70')](_0xd9d3('0x71'),'updatedAt')[_0xd9d3('0x73')]('cm_contacts')['where'](_0xd9d3('0x75'))[_0xd9d3('0x3a')](_0xd9d3('0x76'),_0x5adf60[_0xd9d3('0x72')][_0xd9d3('0x77')]())[_0xd9d3('0x3a')](_0xd9d3('0x78')))[_0xd9d3('0x77')]();_0x44370f['push'](db[_0xd9d3('0x8a')][_0xd9d3('0x30')](_0x2845a1));}return BPromise['all'](_0x44370f);}})[_0xd9d3('0x24')](function(){return _0x16b4b2;})[_0xd9d3('0x24')](respondWithResult(_0x4b799a,null))['catch'](handleError(_0x4b799a,null));};exports[_0xd9d3('0x90')]=function(_0x5ee6f9,_0x23e3be,_0x52ac0e){return db['Campaign']['find']({'where':{'id':_0x5ee6f9[_0xd9d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x23e3be,null))[_0xd9d3('0x24')](function(_0x44b9ac){if(_0x44b9ac){return _0x44b9ac[_0xd9d3('0x90')](_0x5ee6f9[_0xd9d3('0x30')][_0xd9d3('0x65')]);}})['then'](function(_0xac9477){if(_0xac9477){return db[_0xd9d3('0x5f')][_0xd9d3('0x23')]({'where':{'ListId':_0x5ee6f9[_0xd9d3('0x30')][_0xd9d3('0x65')],'CampaignId':_0x5ee6f9[_0xd9d3('0x42')]['id']}})[_0xd9d3('0x24')](function(){return _0xac9477;});}})[_0xd9d3('0x24')](respondWithStatusCode(_0x23e3be,null))[_0xd9d3('0x41')](handleError(_0x23e3be,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 92c85f6..0dfb8b3 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(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x7a54,0x106));var _0x47a5=function(_0x46a0ef,_0x30e507){_0x46a0ef=_0x46a0ef-0x0;var _0xb91d5a=_0x7a54[_0x46a0ef];return _0xb91d5a;};'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(_0x360ec,_0x585d47){var _0xf03953=function(_0xf081db){while(--_0xf081db){_0x360ec['push'](_0x360ec['shift']());}};_0xf03953(++_0x585d47);}(_0x7a54,0x106));var _0x47a5=function(_0x243051,_0x9e8bdf){_0x243051=_0x243051-0x0;var _0x49178a=_0x7a54[_0x243051];return _0x49178a;};'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 08ffe06..b5eff9d 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 _0x6737=['stringify','error','code','message','info','result','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x6737,0xe2));var _0x7673=function(_0x275aab,_0x50582a){_0x275aab=_0x275aab-0x0;var _0x1e9eed=_0x6737[_0x275aab];return _0x1e9eed;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('Campaign,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});}exports[_0x7673('0x14')]=function(_0x17699a){var _0x58a821=this;return new Promise(function(_0x33ff7d,_0x44704d){return db[_0x7673('0x15')]['findAll']({'raw':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x19')]||null:null,'limit':_0x17699a[_0x7673('0x16')]?_0x17699a['options']['limit']||null:null,'include':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x17699a[_0x7673('0x16')]['include'],function(_0x2009e1){return{'model':db[_0x2009e1[_0x7673('0x1c')]],'as':_0x2009e1['as'],'attributes':_0x2009e1[_0x7673('0x19')],'include':_0x2009e1[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x2009e1[_0x7673('0x1a')],function(_0x538280){return{'model':db[_0x538280[_0x7673('0x1c')]],'as':_0x538280['as'],'attributes':_0x538280[_0x7673('0x19')],'include':_0x538280[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x538280['include'],function(_0x5e2cd7){return{'model':db[_0x5e2cd7[_0x7673('0x1c')]],'as':_0x5e2cd7['as'],'attributes':_0x5e2cd7[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x9d9eab){logger[_0x7673('0x12')](_0x7673('0x14'),_0x17699a);logger[_0x7673('0xd')]('GetCampaign',_0x17699a,JSON['stringify'](_0x9d9eab));_0x33ff7d(_0x9d9eab);})[_0x7673('0x1d')](function(_0x2d4c0a){logger[_0x7673('0xf')](_0x7673('0x14'),_0x2d4c0a[_0x7673('0x11')],_0x17699a);_0x44704d(_0x58a821[_0x7673('0xf')](0x1f4,_0x2d4c0a[_0x7673('0x11')]));});});}; \ No newline at end of file +var _0x2121=['request\x20sent','stringify','error','message','GetCampaign','Campaign','options','raw','where','limit','include','map','model','attributes','debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x2121,0x1b4));var _0x1212=function(_0x39dae1,_0x168688){_0x39dae1=_0x39dae1-0x0;var _0x3f4c46=_0x2121[_0x39dae1];return _0x3f4c46;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}exports[_0x1212('0x12')]=function(_0x3cf284){var _0x3face0=this;return new Promise(function(_0xb0dc88,_0x22eefb){return db[_0x1212('0x13')]['findAll']({'raw':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x16')]||null:null,'attributes':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')]['attributes']||null:null,'limit':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x17')]||null:null,'include':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x18')]?_[_0x1212('0x19')](_0x3cf284[_0x1212('0x14')]['include'],function(_0x58ab5b){return{'model':db[_0x58ab5b['model']],'as':_0x58ab5b['as'],'attributes':_0x58ab5b['attributes'],'include':_0x58ab5b['include']?_[_0x1212('0x19')](_0x58ab5b[_0x1212('0x18')],function(_0x4c32a7){return{'model':db[_0x4c32a7[_0x1212('0x1a')]],'as':_0x4c32a7['as'],'attributes':_0x4c32a7[_0x1212('0x1b')],'include':_0x4c32a7['include']?_[_0x1212('0x19')](_0x4c32a7[_0x1212('0x18')],function(_0x4630b4){return{'model':db[_0x4630b4[_0x1212('0x1a')]],'as':_0x4630b4['as'],'attributes':_0x4630b4[_0x1212('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1212('0xb')](function(_0x2750b0){logger[_0x1212('0xc')]('GetCampaign',_0x3cf284);logger[_0x1212('0x1c')](_0x1212('0x12'),_0x3cf284,JSON[_0x1212('0xf')](_0x2750b0));_0xb0dc88(_0x2750b0);})[_0x1212('0x1d')](function(_0x17d0f6){logger[_0x1212('0x10')](_0x1212('0x12'),_0x17d0f6[_0x1212('0x11')],_0x3cf284);_0x22eefb(_0x3face0[_0x1212('0x10')](0x1f4,_0x17d0f6[_0x1212('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 084fa12..8ccee1b 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 _0x3870=['update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','/:id'];(function(_0x31344b,_0x12d6d0){var _0x15012d=function(_0x5e82b5){while(--_0x5e82b5){_0x31344b['push'](_0x31344b['shift']());}};_0x15012d(++_0x12d6d0);}(_0x3870,0x15b));var _0x0387=function(_0x4ce6fa,_0x26a348){_0x4ce6fa=_0x4ce6fa-0x0;var _0xcd00be=_0x3870[_0x4ce6fa];return _0xcd00be;};'use strict';var multer=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var path=require(_0x0387('0x2'));var timeout=require(_0x0387('0x3'));var express=require(_0x0387('0x4'));var router=express[_0x0387('0x5')]();var fs_extra=require(_0x0387('0x6'));var auth=require(_0x0387('0x7'));var interaction=require(_0x0387('0x8'));var config=require(_0x0387('0x9'));var controller=require(_0x0387('0xa'));router[_0x0387('0xb')]('/',auth[_0x0387('0xc')](),controller[_0x0387('0xd')]);router['get']('/:id',auth[_0x0387('0xc')](),controller[_0x0387('0xe')]);router['get'](_0x0387('0xf'),auth[_0x0387('0xc')](),controller[_0x0387('0x10')]);router[_0x0387('0xb')](_0x0387('0x11'),auth['isAuthenticated'](),controller[_0x0387('0x12')]);router[_0x0387('0xb')]('/:id/hopper_finals',auth[_0x0387('0xc')](),controller[_0x0387('0x13')]);router['get'](_0x0387('0x14'),auth['isAuthenticated'](),controller[_0x0387('0x15')]);router[_0x0387('0xb')]('/:id/lists',auth[_0x0387('0xc')](),controller[_0x0387('0x16')]);router[_0x0387('0xb')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x18')]);router[_0x0387('0x19')]('/',auth[_0x0387('0xc')](),controller['create']);router['post'](_0x0387('0x1a'),auth['isAuthenticated'](),controller[_0x0387('0x1b')]);router[_0x0387('0x19')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x1d')]);router[_0x0387('0x19')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x1e')]);router[_0x0387('0x1f')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller[_0x0387('0x21')]);router[_0x0387('0x22')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller['destroy']);router[_0x0387('0x22')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x23')]);router[_0x0387('0x22')]('/:id/blacklists',auth[_0x0387('0xc')](),controller[_0x0387('0x24')]);module[_0x0387('0x25')]=router; \ No newline at end of file +var _0x85d3=['index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated'];(function(_0x83865f,_0x207fd3){var _0x4162c2=function(_0x58e29){while(--_0x58e29){_0x83865f['push'](_0x83865f['shift']());}};_0x4162c2(++_0x207fd3);}(_0x85d3,0x141));var _0x385d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x85d3[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x385d('0x0'));var util=require(_0x385d('0x1'));var path=require(_0x385d('0x2'));var timeout=require(_0x385d('0x3'));var express=require(_0x385d('0x4'));var router=express[_0x385d('0x5')]();var fs_extra=require(_0x385d('0x6'));var auth=require(_0x385d('0x7'));var interaction=require(_0x385d('0x8'));var config=require('../../config/environment');var controller=require(_0x385d('0x9'));router[_0x385d('0xa')]('/',auth[_0x385d('0xb')](),controller[_0x385d('0xc')]);router[_0x385d('0xa')](_0x385d('0xd'),auth[_0x385d('0xb')](),controller[_0x385d('0xe')]);router[_0x385d('0xa')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x385d('0xf')]);router[_0x385d('0xa')](_0x385d('0x10'),auth['isAuthenticated'](),controller[_0x385d('0x11')]);router[_0x385d('0xa')](_0x385d('0x12'),auth[_0x385d('0xb')](),controller[_0x385d('0x13')]);router[_0x385d('0xa')](_0x385d('0x14'),auth[_0x385d('0xb')](),controller['getHopperBlacks']);router['get'](_0x385d('0x15'),auth[_0x385d('0xb')](),controller[_0x385d('0x16')]);router[_0x385d('0xa')](_0x385d('0x17'),auth['isAuthenticated'](),controller[_0x385d('0x18')]);router[_0x385d('0x19')]('/',auth[_0x385d('0xb')](),controller[_0x385d('0x1a')]);router[_0x385d('0x19')]('/:id/clone',auth[_0x385d('0xb')](),controller[_0x385d('0x1b')]);router[_0x385d('0x19')](_0x385d('0x15'),auth[_0x385d('0xb')](),controller[_0x385d('0x1c')]);router[_0x385d('0x19')](_0x385d('0x17'),auth[_0x385d('0xb')](),controller[_0x385d('0x1d')]);router[_0x385d('0x1e')](_0x385d('0xd'),auth[_0x385d('0xb')](),controller[_0x385d('0x1f')]);router[_0x385d('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x385d('0x21')]);router[_0x385d('0x20')](_0x385d('0x15'),auth[_0x385d('0xb')](),controller[_0x385d('0x22')]);router[_0x385d('0x20')](_0x385d('0x17'),auth[_0x385d('0xb')](),controller[_0x385d('0x23')]);module[_0x385d('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 47b8607..a82890a 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 _0x22a9=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x54283c,_0xcfb7a7){var _0x3d32fb=function(_0x1fb34f){while(--_0x1fb34f){_0x54283c['push'](_0x54283c['shift']());}};_0x3d32fb(++_0xcfb7a7);}(_0x22a9,0x1a2));var _0x922a=function(_0x3c6d53,_0x9e0f36){_0x3c6d53=_0x3c6d53-0x0;var _0x36fc1a=_0x22a9[_0x3c6d53];return _0x36fc1a;};'use strict';var Sequelize=require(_0x922a('0x0'));module[_0x922a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x922a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x922a('0x3')]},'name':{'type':Sequelize[_0x922a('0x4')],'get':function(){return this['getDataValue'](_0x922a('0x5'));}}}; \ No newline at end of file +var _0xcfd6=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x5c1d32,_0x19dd05){var _0x5a1e7d=function(_0xbee65e){while(--_0xbee65e){_0x5c1d32['push'](_0x5c1d32['shift']());}};_0x5a1e7d(++_0x19dd05);}(_0xcfd6,0x117));var _0x6cfd=function(_0x16b2a3,_0x14ae95){_0x16b2a3=_0x16b2a3-0x0;var _0x5ee973=_0xcfd6[_0x16b2a3];return _0x5ee973;};'use strict';var Sequelize=require(_0x6cfd('0x0'));module[_0x6cfd('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x6cfd('0x2')]},'name':{'type':Sequelize[_0x6cfd('0x3')],'get':function(){return this[_0x6cfd('0x4')](_0x6cfd('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index cc0bde2..939c46b 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 _0xa42b=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','rows','show','options','find','catch','body','params','create'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xa42b,0xbd));var _0xba42=function(_0x407fb6,_0x4676d5){_0x407fb6=_0x407fb6-0x0;var _0x2a1454=_0xa42b[_0x407fb6];return _0x2a1454;};'use strict';var emlformat=require(_0xba42('0x0'));var rimraf=require(_0xba42('0x1'));var zipdir=require(_0xba42('0x2'));var jsonpatch=require(_0xba42('0x3'));var rp=require(_0xba42('0x4'));var moment=require('moment');var BPromise=require(_0xba42('0x5'));var Mustache=require(_0xba42('0x6'));var util=require(_0xba42('0x7'));var path=require(_0xba42('0x8'));var sox=require(_0xba42('0x9'));var csv=require('to-csv');var ejs=require(_0xba42('0xa'));var fs=require('fs');var fs_extra=require(_0xba42('0xb'));var _=require(_0xba42('0xc'));var squel=require('squel');var crypto=require(_0xba42('0xd'));var jsforce=require(_0xba42('0xe'));var deskjs=require(_0xba42('0xf'));var toCsv=require('to-csv');var querystring=require(_0xba42('0x10'));var Papa=require(_0xba42('0x11'));var Redis=require(_0xba42('0x12'));var authService=require(_0xba42('0x13'));var qs=require(_0xba42('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba42('0x15'))(_0xba42('0x16'));var utils=require(_0xba42('0x17'));var config=require(_0xba42('0x18'));var licenseUtil=require(_0xba42('0x19'));var db=require(_0xba42('0x1a'))['db'];function respondWithStatusCode(_0x42efba,_0x6b24e8){_0x6b24e8=_0x6b24e8||0xcc;return function(_0x2afdd1){if(_0x2afdd1){return _0x42efba['sendStatus'](_0x6b24e8);}return _0x42efba[_0xba42('0x1b')](_0x6b24e8)[_0xba42('0x1c')]();};}function respondWithResult(_0x108455,_0x26be70){_0x26be70=_0x26be70||0xc8;return function(_0x3a2b3e){if(_0x3a2b3e){return _0x108455[_0xba42('0x1b')](_0x26be70)[_0xba42('0x1d')](_0x3a2b3e);}};}function respondWithFilteredResult(_0x2e2199,_0x16b747){return function(_0x951a9c){if(_0x951a9c){var _0x4d5ba8=typeof _0x16b747[_0xba42('0x1e')]===_0xba42('0x1f')&&typeof _0x16b747['limit']==='undefined';var _0x5ebb4d=_0x951a9c[_0xba42('0x20')];var _0x319934=_0x4d5ba8?0x0:_0x16b747[_0xba42('0x1e')];var _0x1c6218=_0x4d5ba8?_0x951a9c[_0xba42('0x20')]:_0x16b747[_0xba42('0x1e')]+_0x16b747[_0xba42('0x21')];var _0x304808;if(_0x1c6218>=_0x5ebb4d){_0x1c6218=_0x5ebb4d;_0x304808=0xc8;}else{_0x304808=0xce;}_0x2e2199[_0xba42('0x1b')](_0x304808);return _0x2e2199[_0xba42('0x22')](_0xba42('0x23'),_0x319934+'-'+_0x1c6218+'/'+_0x5ebb4d)['json'](_0x951a9c);}return null;};}function patchUpdates(_0xe8cca1){return function(_0x30e056){try{jsonpatch[_0xba42('0x24')](_0x30e056,_0xe8cca1,!![]);}catch(_0x3d76f5){return BPromise[_0xba42('0x25')](_0x3d76f5);}return _0x30e056[_0xba42('0x26')]();};}function saveUpdates(_0x95d37e,_0xed900f){return function(_0x213f95){if(_0x213f95){return _0x213f95[_0xba42('0x27')](_0x95d37e)[_0xba42('0x28')](function(_0x2f4961){return _0x2f4961;});}return null;};}function removeEntity(_0x55804b,_0x30d785){return function(_0x2e700e){if(_0x2e700e){return _0x2e700e[_0xba42('0x29')]()['then'](function(){var _0x3f6a62=_0x2e700e[_0xba42('0x2a')]({'plain':!![]});var _0x2f4271=_0xba42('0x2b');return db[_0xba42('0x2c')]['destroy']({'where':{'type':_0x2f4271,'resourceId':_0x3f6a62['id']}})[_0xba42('0x28')](function(){return _0x2e700e;});})['then'](function(){_0x55804b[_0xba42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7a63,_0x3a4edc){return function(_0x55f980){if(!_0x55f980){_0x4c7a63[_0xba42('0x2d')](0x194);}return _0x55f980;};}function handleError(_0x472d01,_0x1eddfa){_0x1eddfa=_0x1eddfa||0x1f4;return function(_0x1284df){logger[_0xba42('0x2e')](_0x1284df['stack']);if(_0x1284df[_0xba42('0x2f')]){delete _0x1284df[_0xba42('0x2f')];}_0x472d01['status'](_0x1eddfa)[_0xba42('0x30')](_0x1284df);};}exports[_0xba42('0x31')]=function(_0x2d39d7,_0x5d9356){var _0xe90a1b={},_0x548b3b={},_0x2ae5cd={'count':0x0,'rows':[]};var _0x86b858=_[_0xba42('0x32')](db[_0xba42('0x33')]['rawAttributes'],function(_0x10ea13){return{'name':_0x10ea13[_0xba42('0x34')],'type':_0x10ea13['type'][_0xba42('0x35')]};});_0x548b3b['model']=_[_0xba42('0x32')](_0x86b858,'name');_0x548b3b[_0xba42('0x36')]=_[_0xba42('0x37')](_0x2d39d7['query']);_0x548b3b[_0xba42('0x38')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],_0x548b3b[_0xba42('0x36')]);_0xe90a1b[_0xba42('0x3b')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x2d39d7[_0xba42('0x36')][_0xba42('0x3c')]));_0xe90a1b[_0xba42('0x3b')]=_0xe90a1b[_0xba42('0x3b')][_0xba42('0x3d')]?_0xe90a1b[_0xba42('0x3b')]:_0x548b3b['model'];if(!_0x2d39d7[_0xba42('0x36')][_0xba42('0x3e')]('nolimit')){_0xe90a1b[_0xba42('0x21')]=qs[_0xba42('0x21')](_0x2d39d7['query'][_0xba42('0x21')]);_0xe90a1b['offset']=qs['offset'](_0x2d39d7[_0xba42('0x36')][_0xba42('0x1e')]);}_0xe90a1b['order']=qs[_0xba42('0x3f')](_0x2d39d7['query'][_0xba42('0x3f')]);_0xe90a1b['where']=qs[_0xba42('0x38')](_[_0xba42('0x40')](_0x2d39d7[_0xba42('0x36')],_0x548b3b[_0xba42('0x38')]),_0x86b858);if(_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]){_0xe90a1b[_0xba42('0x42')]=_[_0xba42('0x43')](_0xe90a1b[_0xba42('0x42')],{'$or':[{'key':{'$like':'%'+_0x2d39d7['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]+'%'}}]});}_0xe90a1b=_['merge']({},_0xe90a1b,_0x2d39d7['options']);var _0x5da0b1={'where':_0xe90a1b[_0xba42('0x42')]};return db[_0xba42('0x33')]['count'](_0x5da0b1)['then'](function(_0x38d1a5){_0x2ae5cd[_0xba42('0x20')]=_0x38d1a5;if(_0x2d39d7['query'][_0xba42('0x44')]){_0xe90a1b[_0xba42('0x45')]=[{'all':!![]}];}return db[_0xba42('0x33')]['findAll'](_0xe90a1b);})['then'](function(_0x190d0f){_0x2ae5cd[_0xba42('0x46')]=_0x190d0f;return _0x2ae5cd;})['then'](respondWithFilteredResult(_0x5d9356,_0xe90a1b))['catch'](handleError(_0x5d9356,null));};exports[_0xba42('0x47')]=function(_0x11972c,_0x1bc1d2){var _0x5ed842={'raw':!![],'where':{'id':_0x11972c['params']['id']}},_0x2569c3={};_0x2569c3[_0xba42('0x3a')]=_[_0xba42('0x37')](db['CannedAnswer']['rawAttributes']);_0x2569c3['query']=_['keys'](_0x11972c[_0xba42('0x36')]);_0x2569c3[_0xba42('0x38')]=_[_0xba42('0x39')](_0x2569c3[_0xba42('0x3a')],_0x2569c3[_0xba42('0x36')]);_0x5ed842['attributes']=_['intersection'](_0x2569c3[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x11972c[_0xba42('0x36')][_0xba42('0x3c')]));_0x5ed842[_0xba42('0x3b')]=_0x5ed842[_0xba42('0x3b')][_0xba42('0x3d')]?_0x5ed842[_0xba42('0x3b')]:_0x2569c3[_0xba42('0x3a')];if(_0x11972c[_0xba42('0x36')]['includeAll']){_0x5ed842['include']=[{'all':!![]}];}_0x5ed842=_['merge']({},_0x5ed842,_0x11972c[_0xba42('0x48')]);return db['CannedAnswer'][_0xba42('0x49')](_0x5ed842)[_0xba42('0x28')](handleEntityNotFound(_0x1bc1d2,null))[_0xba42('0x28')](respondWithResult(_0x1bc1d2,null))[_0xba42('0x4a')](handleError(_0x1bc1d2,null));};exports[_0xba42('0x27')]=function(_0x2127ef,_0x5bd334){if(_0x2127ef['body']['id']){delete _0x2127ef[_0xba42('0x4b')]['id'];}return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x2127ef[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x5bd334,null))[_0xba42('0x28')](saveUpdates(_0x2127ef[_0xba42('0x4b')],null))[_0xba42('0x28')](respondWithResult(_0x5bd334,null))[_0xba42('0x4a')](handleError(_0x5bd334,null));};exports[_0xba42('0x29')]=function(_0x4ad92f,_0x3df239){return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x4ad92f[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x3df239,null))[_0xba42('0x28')](removeEntity(_0x3df239,null))[_0xba42('0x4a')](handleError(_0x3df239,null));};exports[_0xba42('0x4d')]=function(_0xc4ab0f,_0x12d743){var _0x3d2360={'key':_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x35')]};if(_0xc4ab0f[_0xba42('0x4b')]['MailAccountId']){_0x3d2360[_0xba42('0x4e')]=_0xc4ab0f[_0xba42('0x4b')]['MailAccountId'];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')]){_0x3d2360[_0xba42('0x4f')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')]){_0x3d2360[_0xba42('0x50')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')];}else if(_0xc4ab0f['body']['ChatWebsiteId']){_0x3d2360['ChatWebsiteId']=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x51')];}return db['CannedAnswer'][_0xba42('0x49')]({'where':_0x3d2360})[_0xba42('0x28')](function(_0xc4add9){if(_0xc4add9){throw new db[(_0xba42('0x52'))][(_0xba42('0x53'))](_0xba42('0x54'));}return db[_0xba42('0x33')][_0xba42('0x4d')](_0xc4ab0f[_0xba42('0x4b')]);})[_0xba42('0x28')](function(_0x17f622){var _0x43d7c5=_0xc4ab0f[_0xba42('0x55')][_0xba42('0x2a')]({'plain':!![]});if(!_0x43d7c5)throw new Error(_0xba42('0x56'));if(_0x43d7c5[_0xba42('0x57')]===_0xba42('0x55')){var _0x4196be=_0x17f622[_0xba42('0x2a')]({'plain':!![]});return db[_0xba42('0x58')][_0xba42('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x43d7c5['userProfileId']},'raw':!![]})['then'](function(_0x57887b){if(_0x57887b&&_0x57887b['autoAssociation']===0x0){return db[_0xba42('0x2c')][_0xba42('0x4d')]({'name':_0x4196be[_0xba42('0x2f')],'resourceId':_0x4196be['id'],'type':_0x57887b['name'],'sectionId':_0x57887b['id']},{})[_0xba42('0x28')](function(){return _0x17f622;});}else{return _0x17f622;}})[_0xba42('0x4a')](function(_0x1b814e){logger[_0xba42('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b814e);throw _0x1b814e;});}return _0x17f622;})[_0xba42('0x28')](respondWithResult(_0x12d743,0xc9))[_0xba42('0x4a')](handleError(_0x12d743,null));}; \ No newline at end of file +var _0xc936=['includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CannedAnswer'];(function(_0x5bf85a,_0x4360fe){var _0x31fbc2=function(_0x130c74){while(--_0x130c74){_0x5bf85a['push'](_0x5bf85a['shift']());}};_0x31fbc2(++_0x4360fe);}(_0xc936,0x1cc));var _0x6c93=function(_0x5eb2b4,_0x2fb1f1){_0x5eb2b4=_0x5eb2b4-0x0;var _0x4b434a=_0xc936[_0x5eb2b4];return _0x4b434a;};'use strict';var emlformat=require(_0x6c93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c93('0x1'));var jsonpatch=require(_0x6c93('0x2'));var rp=require(_0x6c93('0x3'));var moment=require(_0x6c93('0x4'));var BPromise=require(_0x6c93('0x5'));var Mustache=require('mustache');var util=require(_0x6c93('0x6'));var path=require('path');var sox=require(_0x6c93('0x7'));var csv=require(_0x6c93('0x8'));var ejs=require(_0x6c93('0x9'));var fs=require('fs');var fs_extra=require(_0x6c93('0xa'));var _=require('lodash');var squel=require(_0x6c93('0xb'));var crypto=require(_0x6c93('0xc'));var jsforce=require(_0x6c93('0xd'));var deskjs=require(_0x6c93('0xe'));var toCsv=require(_0x6c93('0x8'));var querystring=require(_0x6c93('0xf'));var Papa=require(_0x6c93('0x10'));var Redis=require(_0x6c93('0x11'));var authService=require(_0x6c93('0x12'));var qs=require(_0x6c93('0x13'));var as=require(_0x6c93('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c93('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6c93('0x16'));var licenseUtil=require(_0x6c93('0x17'));var db=require(_0x6c93('0x18'))['db'];function respondWithStatusCode(_0x3243d8,_0x43c52d){_0x43c52d=_0x43c52d||0xcc;return function(_0x59bc39){if(_0x59bc39){return _0x3243d8[_0x6c93('0x19')](_0x43c52d);}return _0x3243d8['status'](_0x43c52d)[_0x6c93('0x1a')]();};}function respondWithResult(_0x7da011,_0xdd53e9){_0xdd53e9=_0xdd53e9||0xc8;return function(_0x1cb86f){if(_0x1cb86f){return _0x7da011['status'](_0xdd53e9)[_0x6c93('0x1b')](_0x1cb86f);}};}function respondWithFilteredResult(_0x3b3424,_0x1258ee){return function(_0x8cb9d5){if(_0x8cb9d5){var _0x2a1ff9=typeof _0x1258ee[_0x6c93('0x1c')]===_0x6c93('0x1d')&&typeof _0x1258ee['limit']===_0x6c93('0x1d');var _0x4881ed=_0x8cb9d5['count'];var _0x30a53a=_0x2a1ff9?0x0:_0x1258ee[_0x6c93('0x1c')];var _0xd41cca=_0x2a1ff9?_0x8cb9d5[_0x6c93('0x1e')]:_0x1258ee['offset']+_0x1258ee['limit'];var _0x2968e5;if(_0xd41cca>=_0x4881ed){_0xd41cca=_0x4881ed;_0x2968e5=0xc8;}else{_0x2968e5=0xce;}_0x3b3424[_0x6c93('0x1f')](_0x2968e5);return _0x3b3424['set'](_0x6c93('0x20'),_0x30a53a+'-'+_0xd41cca+'/'+_0x4881ed)[_0x6c93('0x1b')](_0x8cb9d5);}return null;};}function patchUpdates(_0x461313){return function(_0x3b8c28){try{jsonpatch[_0x6c93('0x21')](_0x3b8c28,_0x461313,!![]);}catch(_0x1ce48f){return BPromise['reject'](_0x1ce48f);}return _0x3b8c28[_0x6c93('0x22')]();};}function saveUpdates(_0x5186e8,_0x55e9f2){return function(_0x1a2d8e){if(_0x1a2d8e){return _0x1a2d8e[_0x6c93('0x23')](_0x5186e8)[_0x6c93('0x24')](function(_0x480dc5){return _0x480dc5;});}return null;};}function removeEntity(_0x45fd9d,_0x132558){return function(_0x47cf07){if(_0x47cf07){return _0x47cf07[_0x6c93('0x25')]()[_0x6c93('0x24')](function(){var _0x271333=_0x47cf07[_0x6c93('0x26')]({'plain':!![]});var _0x2e5a60=_0x6c93('0x27');return db[_0x6c93('0x28')][_0x6c93('0x25')]({'where':{'type':_0x2e5a60,'resourceId':_0x271333['id']}})[_0x6c93('0x24')](function(){return _0x47cf07;});})['then'](function(){_0x45fd9d[_0x6c93('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1680ba,_0x4ca4a0){return function(_0x23876f){if(!_0x23876f){_0x1680ba[_0x6c93('0x19')](0x194);}return _0x23876f;};}function handleError(_0x3d823f,_0x1983a3){_0x1983a3=_0x1983a3||0x1f4;return function(_0x4da25a){logger['error'](_0x4da25a['stack']);if(_0x4da25a['name']){delete _0x4da25a[_0x6c93('0x29')];}_0x3d823f['status'](_0x1983a3)[_0x6c93('0x2a')](_0x4da25a);};}exports[_0x6c93('0x2b')]=function(_0x2fe03b,_0x3846f8){var _0x1e1121={},_0x31e89a={},_0xd8f5da={'count':0x0,'rows':[]};var _0xee864f=_[_0x6c93('0x2c')](db['CannedAnswer'][_0x6c93('0x2d')],function(_0x3fdc49){return{'name':_0x3fdc49[_0x6c93('0x2e')],'type':_0x3fdc49[_0x6c93('0x2f')][_0x6c93('0x30')]};});_0x31e89a[_0x6c93('0x31')]=_['map'](_0xee864f,_0x6c93('0x29'));_0x31e89a['query']=_[_0x6c93('0x32')](_0x2fe03b[_0x6c93('0x33')]);_0x31e89a[_0x6c93('0x34')]=_[_0x6c93('0x35')](_0x31e89a[_0x6c93('0x31')],_0x31e89a[_0x6c93('0x33')]);_0x1e1121[_0x6c93('0x36')]=_['intersection'](_0x31e89a[_0x6c93('0x31')],qs[_0x6c93('0x37')](_0x2fe03b[_0x6c93('0x33')][_0x6c93('0x37')]));_0x1e1121[_0x6c93('0x36')]=_0x1e1121[_0x6c93('0x36')][_0x6c93('0x38')]?_0x1e1121[_0x6c93('0x36')]:_0x31e89a['model'];if(!_0x2fe03b[_0x6c93('0x33')][_0x6c93('0x39')](_0x6c93('0x3a'))){_0x1e1121[_0x6c93('0x3b')]=qs[_0x6c93('0x3b')](_0x2fe03b['query'][_0x6c93('0x3b')]);_0x1e1121[_0x6c93('0x1c')]=qs['offset'](_0x2fe03b['query']['offset']);}_0x1e1121[_0x6c93('0x3c')]=qs['sort'](_0x2fe03b['query'][_0x6c93('0x3d')]);_0x1e1121[_0x6c93('0x3e')]=qs[_0x6c93('0x34')](_[_0x6c93('0x3f')](_0x2fe03b[_0x6c93('0x33')],_0x31e89a[_0x6c93('0x34')]),_0xee864f);if(_0x2fe03b[_0x6c93('0x33')][_0x6c93('0x40')]){_0x1e1121[_0x6c93('0x3e')]=_[_0x6c93('0x41')](_0x1e1121[_0x6c93('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2fe03b['query'][_0x6c93('0x40')]+'%'}},{'value':{'$like':'%'+_0x2fe03b['query'][_0x6c93('0x40')]+'%'}}]});}_0x1e1121=_[_0x6c93('0x41')]({},_0x1e1121,_0x2fe03b[_0x6c93('0x42')]);var _0x2cab16={'where':_0x1e1121['where']};return db[_0x6c93('0x43')][_0x6c93('0x1e')](_0x2cab16)[_0x6c93('0x24')](function(_0x488ac2){_0xd8f5da[_0x6c93('0x1e')]=_0x488ac2;if(_0x2fe03b[_0x6c93('0x33')][_0x6c93('0x44')]){_0x1e1121[_0x6c93('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6c93('0x46')](_0x1e1121);})[_0x6c93('0x24')](function(_0x1dd5ff){_0xd8f5da[_0x6c93('0x47')]=_0x1dd5ff;return _0xd8f5da;})[_0x6c93('0x24')](respondWithFilteredResult(_0x3846f8,_0x1e1121))[_0x6c93('0x48')](handleError(_0x3846f8,null));};exports['show']=function(_0x3bafb1,_0x4f90f0){var _0x2fcb4c={'raw':!![],'where':{'id':_0x3bafb1[_0x6c93('0x49')]['id']}},_0x21c26b={};_0x21c26b[_0x6c93('0x31')]=_[_0x6c93('0x32')](db[_0x6c93('0x43')]['rawAttributes']);_0x21c26b[_0x6c93('0x33')]=_[_0x6c93('0x32')](_0x3bafb1['query']);_0x21c26b['filters']=_[_0x6c93('0x35')](_0x21c26b[_0x6c93('0x31')],_0x21c26b[_0x6c93('0x33')]);_0x2fcb4c['attributes']=_[_0x6c93('0x35')](_0x21c26b[_0x6c93('0x31')],qs['fields'](_0x3bafb1[_0x6c93('0x33')][_0x6c93('0x37')]));_0x2fcb4c[_0x6c93('0x36')]=_0x2fcb4c[_0x6c93('0x36')][_0x6c93('0x38')]?_0x2fcb4c[_0x6c93('0x36')]:_0x21c26b[_0x6c93('0x31')];if(_0x3bafb1[_0x6c93('0x33')][_0x6c93('0x44')]){_0x2fcb4c['include']=[{'all':!![]}];}_0x2fcb4c=_[_0x6c93('0x41')]({},_0x2fcb4c,_0x3bafb1[_0x6c93('0x42')]);return db[_0x6c93('0x43')][_0x6c93('0x4a')](_0x2fcb4c)[_0x6c93('0x24')](handleEntityNotFound(_0x4f90f0,null))[_0x6c93('0x24')](respondWithResult(_0x4f90f0,null))['catch'](handleError(_0x4f90f0,null));};exports[_0x6c93('0x23')]=function(_0x311614,_0x2924e8){if(_0x311614[_0x6c93('0x4b')]['id']){delete _0x311614[_0x6c93('0x4b')]['id'];}return db[_0x6c93('0x43')][_0x6c93('0x4a')]({'where':{'id':_0x311614['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x2924e8,null))[_0x6c93('0x24')](saveUpdates(_0x311614[_0x6c93('0x4b')],null))['then'](respondWithResult(_0x2924e8,null))[_0x6c93('0x48')](handleError(_0x2924e8,null));};exports[_0x6c93('0x25')]=function(_0x3189c7,_0x2d659d){return db[_0x6c93('0x43')][_0x6c93('0x4a')]({'where':{'id':_0x3189c7['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x2d659d,null))[_0x6c93('0x24')](removeEntity(_0x2d659d,null))[_0x6c93('0x48')](handleError(_0x2d659d,null));};exports[_0x6c93('0x4c')]=function(_0x2b58ae,_0x44bb9e){var _0x35ac23={'key':_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x30')]};if(_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x4d')]){_0x35ac23[_0x6c93('0x4d')]=_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x4d')];}else if(_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x4e')]){_0x35ac23[_0x6c93('0x4e')]=_0x2b58ae['body']['SmsAccountId'];}else if(_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x4f')]){_0x35ac23[_0x6c93('0x4f')]=_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x4f')];}else if(_0x2b58ae['body'][_0x6c93('0x50')]){_0x35ac23[_0x6c93('0x50')]=_0x2b58ae[_0x6c93('0x4b')][_0x6c93('0x50')];}return db[_0x6c93('0x43')]['find']({'where':_0x35ac23})[_0x6c93('0x24')](function(_0x159e22){if(_0x159e22){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x6c93('0x43')]['create'](_0x2b58ae[_0x6c93('0x4b')]);})[_0x6c93('0x24')](function(_0x11e398){var _0x158f97=_0x2b58ae[_0x6c93('0x51')][_0x6c93('0x26')]({'plain':!![]});if(!_0x158f97)throw new Error(_0x6c93('0x52'));if(_0x158f97[_0x6c93('0x53')]===_0x6c93('0x51')){var _0x1d7dc1=_0x11e398[_0x6c93('0x26')]({'plain':!![]});return db[_0x6c93('0x54')][_0x6c93('0x4a')]({'where':{'name':_0x6c93('0x27'),'userProfileId':_0x158f97[_0x6c93('0x55')]},'raw':!![]})[_0x6c93('0x24')](function(_0x469c15){if(_0x469c15&&_0x469c15[_0x6c93('0x56')]===0x0){return db[_0x6c93('0x28')][_0x6c93('0x4c')]({'name':_0x1d7dc1[_0x6c93('0x29')],'resourceId':_0x1d7dc1['id'],'type':_0x469c15['name'],'sectionId':_0x469c15['id']},{})[_0x6c93('0x24')](function(){return _0x11e398;});}else{return _0x11e398;}})[_0x6c93('0x48')](function(_0x2bb122){logger[_0x6c93('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bb122);throw _0x2bb122;});}return _0x11e398;})['then'](respondWithResult(_0x44bb9e,0xc9))[_0x6c93('0x48')](handleError(_0x44bb9e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index aa2e18d..df4b17a 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 _0x348e=['exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x42acce,_0x30b09f){var _0x2e843b=function(_0x2697ff){while(--_0x2697ff){_0x42acce['push'](_0x42acce['shift']());}};_0x2e843b(++_0x30b09f);}(_0x348e,0x9f));var _0xe348=function(_0x27891e,_0x1d4f82){_0x27891e=_0x27891e-0x0;var _0x13dbd1=_0x348e[_0x27891e];return _0x13dbd1;};'use strict';var _=require(_0xe348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe348('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe348('0x2'));var fs=require('fs');var path=require(_0xe348('0x3'));var rimraf=require('rimraf');var config=require(_0xe348('0x4'));var attributes=require(_0xe348('0x5'));module[_0xe348('0x6')]=function(_0x2a70c1,_0xa16292){return _0x2a70c1[_0xe348('0x7')](_0xe348('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe348('0x9'),'collate':_0xe348('0xa')});}; \ No newline at end of file +var _0xac85=['../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x26c2ed,_0x385ba9){var _0x28c9fa=function(_0xf91911){while(--_0xf91911){_0x26c2ed['push'](_0x26c2ed['shift']());}};_0x28c9fa(++_0x385ba9);}(_0xac85,0xbd));var _0x5ac8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xac85[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5ac8('0x0'));var util=require(_0x5ac8('0x1'));var logger=require(_0x5ac8('0x2'))(_0x5ac8('0x3'));var moment=require('moment');var BPromise=require(_0x5ac8('0x4'));var rp=require(_0x5ac8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac8('0x6'));var config=require(_0x5ac8('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x5ac8('0x8')]=function(_0x2c3e60,_0x1dd588){return _0x2c3e60[_0x5ac8('0x9')](_0x5ac8('0xa'),attributes,{'tableName':_0x5ac8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ac8('0xc'),'collate':_0x5ac8('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 82787a2..e249e4c 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(_0x301b74,_0x223dfb){var _0x19e590=function(_0x2b2f66){while(--_0x2b2f66){_0x301b74['push'](_0x301b74['shift']());}};_0x19e590(++_0x223dfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x472aa6,_0x443557){var _0x2b55ed=function(_0x2afa1d){while(--_0x2afa1d){_0x472aa6['push'](_0x472aa6['shift']());}};_0x2b55ed(++_0x443557);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 579a027..d9f5213 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 _0x8abc=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','/:id'];(function(_0x8962b1,_0x4bb6b5){var _0x41e583=function(_0x1ea4d4){while(--_0x1ea4d4){_0x8962b1['push'](_0x8962b1['shift']());}};_0x41e583(++_0x4bb6b5);}(_0x8abc,0x1d2));var _0xc8ab=function(_0x155200,_0x228087){_0x155200=_0x155200-0x0;var _0x354c3a=_0x8abc[_0x155200];return _0x354c3a;};'use strict';var multer=require(_0xc8ab('0x0'));var util=require(_0xc8ab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc8ab('0x2')]();var fs_extra=require(_0xc8ab('0x3'));var auth=require(_0xc8ab('0x4'));var interaction=require(_0xc8ab('0x5'));var config=require('../../config/environment');var controller=require(_0xc8ab('0x6'));router['get']('/',auth[_0xc8ab('0x7')](),controller[_0xc8ab('0x8')]);router[_0xc8ab('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc8ab('0xa')]);router[_0xc8ab('0xb')]('/',auth['isAuthenticated'](),controller[_0xc8ab('0xc')]);router['put'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller['update']);router['delete'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller[_0xc8ab('0xe')]);module[_0xc8ab('0xf')]=router; \ No newline at end of file +var _0x3d88=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','update','delete','exports','multer','util','connect-timeout'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x3d88,0x16d));var _0x83d8=function(_0x2c1c5b,_0x1c0e99){_0x2c1c5b=_0x2c1c5b-0x0;var _0x2ecb6a=_0x3d88[_0x2c1c5b];return _0x2ecb6a;};'use strict';var multer=require(_0x83d8('0x0'));var util=require(_0x83d8('0x1'));var path=require('path');var timeout=require(_0x83d8('0x2'));var express=require('express');var router=express[_0x83d8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x83d8('0x4'));var interaction=require(_0x83d8('0x5'));var config=require(_0x83d8('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x83d8('0x7')](),controller[_0x83d8('0x8')]);router[_0x83d8('0x9')](_0x83d8('0xa'),auth[_0x83d8('0x7')](),controller[_0x83d8('0xb')]);router['post']('/',auth[_0x83d8('0x7')](),controller[_0x83d8('0xc')]);router['put'](_0x83d8('0xa'),auth[_0x83d8('0x7')](),controller[_0x83d8('0xd')]);router[_0x83d8('0xe')](_0x83d8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x83d8('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 8de04dc..4ee5ed5 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 _0xb48d=['sequelize','DATE','STRING','INTEGER'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xb48d,0x194));var _0xdb48=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb48d[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xdb48('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xdb48('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xdb48('0x2')]},'src':{'type':Sequelize[_0xdb48('0x2')]},'dst':{'type':Sequelize[_0xdb48('0x2')]},'dcontext':{'type':Sequelize[_0xdb48('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdb48('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xdb48('0x2')]},'duration':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdb48('0x2')]},'userfield':{'type':Sequelize[_0xdb48('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdb48('0x2')]},'sequence':{'type':Sequelize[_0xdb48('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb48('0x2')]},'tag':{'type':Sequelize[_0xdb48('0x2')]}}; \ No newline at end of file +var _0x9e3f=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x441235,_0x46ad88){var _0x1e12c5=function(_0x2e8ed5){while(--_0x2e8ed5){_0x441235['push'](_0x441235['shift']());}};_0x1e12c5(++_0x46ad88);}(_0x9e3f,0x1f0));var _0xf9e3=function(_0x4de51f,_0x5eb593){_0x4de51f=_0x4de51f-0x0;var _0x343048=_0x9e3f[_0x4de51f];return _0x343048;};'use strict';var Sequelize=require(_0xf9e3('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf9e3('0x1')],'allowNull':![],'defaultValue':_0xf9e3('0x2')},'clid':{'type':Sequelize[_0xf9e3('0x3')]},'src':{'type':Sequelize[_0xf9e3('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf9e3('0x3')]},'channel':{'type':Sequelize[_0xf9e3('0x3')]},'dstchannel':{'type':Sequelize[_0xf9e3('0x3')]},'lastapp':{'type':Sequelize[_0xf9e3('0x3')]},'lastdata':{'type':Sequelize[_0xf9e3('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf9e3('0x3')]},'amaflags':{'type':Sequelize[_0xf9e3('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf9e3('0x3')]},'userfield':{'type':Sequelize[_0xf9e3('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf9e3('0x3')]},'sequence':{'type':Sequelize[_0xf9e3('0x3')]},'peeraccount':{'type':Sequelize[_0xf9e3('0x3')]},'type':{'type':Sequelize[_0xf9e3('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 33e92c3..200f842 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 _0x723e=['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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x7129ea,_0x57833e){var _0x30a7ea=function(_0x5d89a5){while(--_0x5d89a5){_0x7129ea['push'](_0x7129ea['shift']());}};_0x30a7ea(++_0x57833e);}(_0x723e,0x179));var _0xe723=function(_0x10a96a,_0x2e8bda){_0x10a96a=_0x10a96a-0x0;var _0xf50a21=_0x723e[_0x10a96a];return _0xf50a21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));}; \ No newline at end of file +var _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x58df3b,_0x182132){var _0x1c82d6=function(_0x48b1a2){while(--_0x48b1a2){_0x58df3b['push'](_0x58df3b['shift']());}};_0x1c82d6(++_0x182132);}(_0x0618,0x1c6));var _0x8061=function(_0x52793e,_0x1e7bb4){_0x52793e=_0x52793e-0x0;var _0x5357bb=_0x0618[_0x52793e];return _0x5357bb;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 190b2aa..850b78f 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x317d61,_0x5e6335){var _0x3abc20=function(_0x556876){while(--_0x556876){_0x317d61['push'](_0x317d61['shift']());}};_0x3abc20(++_0x5e6335);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x41a184,_0x4437ea){var _0x43e0a0=function(_0x2a3569){while(--_0x2a3569){_0x41a184['push'](_0x41a184['shift']());}};_0x43e0a0(++_0x4437ea);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 c306691..025a55a 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 _0x16d3=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x33c7e6,_0x4f70aa){var _0x25dfa2=function(_0x33c2f7){while(--_0x33c2f7){_0x33c7e6['push'](_0x33c7e6['shift']());}};_0x25dfa2(++_0x4f70aa);}(_0x16d3,0x1ca));var _0x316d=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x16d3[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x316d('0x0'));var util=require(_0x316d('0x1'));var moment=require(_0x316d('0x2'));var BPromise=require(_0x316d('0x3'));var rs=require(_0x316d('0x4'));var fs=require('fs');var Redis=require(_0x316d('0x5'));var db=require(_0x316d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x316d('0x7'))(_0x316d('0x8'));var config=require(_0x316d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x316d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a4d8b,_0x2a46f0,_0x51db46){return new BPromise(function(_0x8b8df7,_0x2a5381){return client[_0x316d('0xb')](_0x5a4d8b,_0x51db46)[_0x316d('0xc')](function(_0x1c9419){logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));logger[_0x316d('0xf')](_0x316d('0x10'),_0x2a46f0,'request\x20sent',JSON['stringify'](_0x1c9419));if(_0x1c9419['error']){if(_0x1c9419[_0x316d('0x11')][_0x316d('0x12')]===0x1f4){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x1c9419['error'][_0x316d('0x13')]);return _0x2a5381(_0x1c9419['error'][_0x316d('0x13')]);}logger['error'](_0x316d('0x14'),_0x2a46f0,_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);return _0x8b8df7(_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);}else{logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));_0x8b8df7(_0x1c9419['result'][_0x316d('0x13')]);}})[_0x316d('0x15')](function(_0x935110){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x935110);_0x2a5381(_0x935110);});});} \ No newline at end of file +var _0xf2ef=['ioredis','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xf2ef,0x65));var _0xff2e=function(_0x370588,_0x7cae9b){_0x370588=_0x370588-0x0;var _0x820d1b=_0xf2ef[_0x370588];return _0x820d1b;};'use strict';var _=require(_0xff2e('0x0'));var util=require(_0xff2e('0x1'));var moment=require('moment');var BPromise=require(_0xff2e('0x2'));var rs=require(_0xff2e('0x3'));var fs=require('fs');var Redis=require(_0xff2e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xff2e('0x5'));var jayson=require(_0xff2e('0x6'));var client=jayson[_0xff2e('0x7')][_0xff2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x502ddc,_0x1f8910,_0x1753cf){return new BPromise(function(_0x532e69,_0x5dbee7){return client[_0xff2e('0x9')](_0x502ddc,_0x1753cf)[_0xff2e('0xa')](function(_0x4f01a7){logger[_0xff2e('0xb')](_0xff2e('0xc'),_0x1f8910,_0xff2e('0xd'));logger[_0xff2e('0xe')](_0xff2e('0xf'),_0x1f8910,_0xff2e('0xd'),JSON['stringify'](_0x4f01a7));if(_0x4f01a7[_0xff2e('0x10')]){if(_0x4f01a7[_0xff2e('0x10')][_0xff2e('0x11')]===0x1f4){logger[_0xff2e('0x10')]('Cdr,\x20%s,\x20%s',_0x1f8910,_0x4f01a7[_0xff2e('0x10')][_0xff2e('0x12')]);return _0x5dbee7(_0x4f01a7[_0xff2e('0x10')][_0xff2e('0x12')]);}logger['error'](_0xff2e('0xc'),_0x1f8910,_0x4f01a7['error'][_0xff2e('0x12')]);return _0x532e69(_0x4f01a7['error'][_0xff2e('0x12')]);}else{logger[_0xff2e('0xb')](_0xff2e('0xc'),_0x1f8910,'request\x20sent');_0x532e69(_0x4f01a7[_0xff2e('0x13')][_0xff2e('0x12')]);}})[_0xff2e('0x14')](function(_0x1109b3){logger[_0xff2e('0x10')](_0xff2e('0xc'),_0x1f8910,_0x1109b3);_0x5dbee7(_0x1109b3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 4bf2c02..a37c969 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 _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(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_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'));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 +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(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_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['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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b658592..ba21ae3 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 _0x4e88=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x56241f,_0xc69854){var _0x2f68ef=function(_0x3fe05e){while(--_0x3fe05e){_0x56241f['push'](_0x56241f['shift']());}};_0x2f68ef(++_0xc69854);}(_0x4e88,0x1d2));var _0x84e8=function(_0x269967,_0x49abd6){_0x269967=_0x269967-0x0;var _0xddff5a=_0x4e88[_0x269967];return _0xddff5a;};'use strict';var Sequelize=require('sequelize');module[_0x84e8('0x0')]={'priority':{'type':Sequelize[_0x84e8('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x84e8('0x2')},'appdata':{'type':Sequelize[_0x84e8('0x3')]()},'description':{'type':Sequelize[_0x84e8('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x84e8('0x5')}}; \ No newline at end of file +var _0x2611=['noop','sequelize','STRING'];(function(_0x809ea0,_0xbff89f){var _0x245147=function(_0x4f962c){while(--_0x4f962c){_0x809ea0['push'](_0x809ea0['shift']());}};_0x245147(++_0xbff89f);}(_0x2611,0x175));var _0x1261=function(_0x13467a,_0x144782){_0x13467a=_0x13467a-0x0;var _0x48672b=_0x2611[_0x13467a];return _0x48672b;};'use strict';var Sequelize=require(_0x1261('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1261('0x1')],'allowNull':![],'defaultValue':_0x1261('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1261('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 293f6fd..2229e08 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 _0x4ad3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14c696,_0x43e421){var _0x39d58e=function(_0x109913){while(--_0x109913){_0x14c696['push'](_0x14c696['shift']());}};_0x39d58e(++_0x43e421);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x4ad3[_0x334fea];return _0x3c5829;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];function respondWithStatusCode(_0x377c90,_0x14c9fd){_0x14c9fd=_0x14c9fd||0xcc;return function(_0x1be906){if(_0x1be906){return _0x377c90[_0x34ad('0x1c')](_0x14c9fd);}return _0x377c90[_0x34ad('0x1d')](_0x14c9fd)[_0x34ad('0x1e')]();};}function respondWithResult(_0xc64e62,_0x558097){_0x558097=_0x558097||0xc8;return function(_0x4764e9){if(_0x4764e9){return _0xc64e62[_0x34ad('0x1d')](_0x558097)[_0x34ad('0x1f')](_0x4764e9);}};}function respondWithFilteredResult(_0x5e2a1d,_0x21a78c){return function(_0x262123){if(_0x262123){var _0x38a15e=typeof _0x21a78c[_0x34ad('0x20')]===_0x34ad('0x21')&&typeof _0x21a78c['limit']===_0x34ad('0x21');var _0x4daa5c=_0x262123[_0x34ad('0x22')];var _0x294326=_0x38a15e?0x0:_0x21a78c[_0x34ad('0x20')];var _0x7036e0=_0x38a15e?_0x262123[_0x34ad('0x22')]:_0x21a78c['offset']+_0x21a78c[_0x34ad('0x23')];var _0x3a2cd5;if(_0x7036e0>=_0x4daa5c){_0x7036e0=_0x4daa5c;_0x3a2cd5=0xc8;}else{_0x3a2cd5=0xce;}_0x5e2a1d[_0x34ad('0x1d')](_0x3a2cd5);return _0x5e2a1d[_0x34ad('0x24')](_0x34ad('0x25'),_0x294326+'-'+_0x7036e0+'/'+_0x4daa5c)[_0x34ad('0x1f')](_0x262123);}return null;};}function patchUpdates(_0x3c178a){return function(_0x45557e){try{jsonpatch[_0x34ad('0x26')](_0x45557e,_0x3c178a,!![]);}catch(_0x55140c){return BPromise[_0x34ad('0x27')](_0x55140c);}return _0x45557e['save']();};}function saveUpdates(_0x1c2d49,_0x493f73){return function(_0x154ee8){if(_0x154ee8){return _0x154ee8[_0x34ad('0x28')](_0x1c2d49)[_0x34ad('0x29')](function(_0x1c2fa5){return _0x1c2fa5;});}return null;};}function removeEntity(_0x737c2d,_0x4a06a7){return function(_0x5a8379){if(_0x5a8379){return _0x5a8379[_0x34ad('0x2a')]()['then'](function(){_0x737c2d[_0x34ad('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5495,_0x34d2ae){return function(_0x3df4ca){if(!_0x3df4ca){_0x5d5495[_0x34ad('0x1c')](0x194);}return _0x3df4ca;};}function handleError(_0x3cb657,_0x17fc51){_0x17fc51=_0x17fc51||0x1f4;return function(_0x320b6a){logger[_0x34ad('0x2b')](_0x320b6a[_0x34ad('0x2c')]);if(_0x320b6a[_0x34ad('0x2d')]){delete _0x320b6a[_0x34ad('0x2d')];}_0x3cb657['status'](_0x17fc51)[_0x34ad('0x2e')](_0x320b6a);};}exports[_0x34ad('0x2f')]=function(_0x23bb04,_0x31b880){var _0x2bcdc3={'raw':!![],'where':{'id':_0x23bb04[_0x34ad('0x30')]['id']}},_0x1b2387={};_0x1b2387[_0x34ad('0x31')]=_[_0x34ad('0x32')](db[_0x34ad('0x33')][_0x34ad('0x34')]);_0x1b2387[_0x34ad('0x35')]=_[_0x34ad('0x32')](_0x23bb04[_0x34ad('0x35')]);_0x1b2387[_0x34ad('0x36')]=_[_0x34ad('0x37')](_0x1b2387['model'],_0x1b2387[_0x34ad('0x35')]);_0x2bcdc3['attributes']=_[_0x34ad('0x37')](_0x1b2387[_0x34ad('0x31')],qs[_0x34ad('0x38')](_0x23bb04[_0x34ad('0x35')]['fields']));_0x2bcdc3[_0x34ad('0x39')]=_0x2bcdc3[_0x34ad('0x39')][_0x34ad('0x3a')]?_0x2bcdc3[_0x34ad('0x39')]:_0x1b2387['model'];if(_0x23bb04['query']['includeAll']){_0x2bcdc3[_0x34ad('0x3b')]=[{'all':!![]}];}_0x2bcdc3=_[_0x34ad('0x3c')]({},_0x2bcdc3,_0x23bb04[_0x34ad('0x3d')]);return db[_0x34ad('0x33')][_0x34ad('0x3e')](_0x2bcdc3)['then'](handleEntityNotFound(_0x31b880,null))[_0x34ad('0x29')](respondWithResult(_0x31b880,null))[_0x34ad('0x3f')](handleError(_0x31b880,null));};exports[_0x34ad('0x28')]=function(_0x2a3330,_0x1b79b3){if(_0x2a3330[_0x34ad('0x40')]['id']){delete _0x2a3330[_0x34ad('0x40')]['id'];}return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x2a3330[_0x34ad('0x30')]['id']}})[_0x34ad('0x29')](handleEntityNotFound(_0x1b79b3,null))[_0x34ad('0x29')](saveUpdates(_0x2a3330[_0x34ad('0x40')],null))[_0x34ad('0x29')](respondWithResult(_0x1b79b3,null))[_0x34ad('0x3f')](handleError(_0x1b79b3,null));};exports[_0x34ad('0x2a')]=function(_0x41a5a2,_0x23e15b){return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x41a5a2['params']['id']}})['then'](handleEntityNotFound(_0x23e15b,null))[_0x34ad('0x29')](removeEntity(_0x23e15b,null))[_0x34ad('0x3f')](handleError(_0x23e15b,null));}; \ No newline at end of file +var _0xb264=['set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','catch','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x227cc7,_0x3fa15c){var _0x5afd41=function(_0x474ba0){while(--_0x474ba0){_0x227cc7['push'](_0x227cc7['shift']());}};_0x5afd41(++_0x3fa15c);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b26('0x0'));var rimraf=require(_0x4b26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b26('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b26('0x3'));var Mustache=require(_0x4b26('0x4'));var util=require(_0x4b26('0x5'));var path=require(_0x4b26('0x6'));var sox=require(_0x4b26('0x7'));var csv=require(_0x4b26('0x8'));var ejs=require(_0x4b26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b26('0xa'));var squel=require(_0x4b26('0xb'));var crypto=require('crypto');var jsforce=require(_0x4b26('0xc'));var deskjs=require(_0x4b26('0xd'));var toCsv=require(_0x4b26('0x8'));var querystring=require('querystring');var Papa=require(_0x4b26('0xe'));var Redis=require(_0x4b26('0xf'));var authService=require(_0x4b26('0x10'));var qs=require(_0x4b26('0x11'));var as=require(_0x4b26('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b26('0x13'))('api');var utils=require(_0x4b26('0x14'));var config=require(_0x4b26('0x15'));var licenseUtil=require(_0x4b26('0x16'));var db=require(_0x4b26('0x17'))['db'];function respondWithStatusCode(_0x46f945,_0x56f690){_0x56f690=_0x56f690||0xcc;return function(_0x25eaa9){if(_0x25eaa9){return _0x46f945[_0x4b26('0x18')](_0x56f690);}return _0x46f945['status'](_0x56f690)['end']();};}function respondWithResult(_0x18286d,_0x5d8306){_0x5d8306=_0x5d8306||0xc8;return function(_0x166b4e){if(_0x166b4e){return _0x18286d[_0x4b26('0x19')](_0x5d8306)[_0x4b26('0x1a')](_0x166b4e);}};}function respondWithFilteredResult(_0x5930eb,_0x157847){return function(_0x2811bc){if(_0x2811bc){var _0x278a8d=typeof _0x157847[_0x4b26('0x1b')]===_0x4b26('0x1c')&&typeof _0x157847[_0x4b26('0x1d')]===_0x4b26('0x1c');var _0x3105ed=_0x2811bc[_0x4b26('0x1e')];var _0x16e451=_0x278a8d?0x0:_0x157847[_0x4b26('0x1b')];var _0x501278=_0x278a8d?_0x2811bc[_0x4b26('0x1e')]:_0x157847['offset']+_0x157847['limit'];var _0x338ac4;if(_0x501278>=_0x3105ed){_0x501278=_0x3105ed;_0x338ac4=0xc8;}else{_0x338ac4=0xce;}_0x5930eb[_0x4b26('0x19')](_0x338ac4);return _0x5930eb[_0x4b26('0x1f')](_0x4b26('0x20'),_0x16e451+'-'+_0x501278+'/'+_0x3105ed)['json'](_0x2811bc);}return null;};}function patchUpdates(_0xe5f818){return function(_0x3769ed){try{jsonpatch[_0x4b26('0x21')](_0x3769ed,_0xe5f818,!![]);}catch(_0x302b14){return BPromise['reject'](_0x302b14);}return _0x3769ed['save']();};}function saveUpdates(_0x2b77d9,_0x3785f8){return function(_0x5b42d6){if(_0x5b42d6){return _0x5b42d6[_0x4b26('0x22')](_0x2b77d9)[_0x4b26('0x23')](function(_0x410af6){return _0x410af6;});}return null;};}function removeEntity(_0x328419,_0x291000){return function(_0x175bec){if(_0x175bec){return _0x175bec[_0x4b26('0x24')]()[_0x4b26('0x23')](function(){_0x328419[_0x4b26('0x19')](0xcc)[_0x4b26('0x25')]();});}};}function handleEntityNotFound(_0x141ac8,_0x26e3d1){return function(_0x2eb4bf){if(!_0x2eb4bf){_0x141ac8[_0x4b26('0x18')](0x194);}return _0x2eb4bf;};}function handleError(_0x5ddf42,_0x5914e2){_0x5914e2=_0x5914e2||0x1f4;return function(_0x48a05f){logger[_0x4b26('0x26')](_0x48a05f[_0x4b26('0x27')]);if(_0x48a05f['name']){delete _0x48a05f[_0x4b26('0x28')];}_0x5ddf42['status'](_0x5914e2)[_0x4b26('0x29')](_0x48a05f);};}exports[_0x4b26('0x2a')]=function(_0x54a2cc,_0x514874){var _0x34b0d2={'raw':!![],'where':{'id':_0x54a2cc['params']['id']}},_0x1c98ac={};_0x1c98ac[_0x4b26('0x2b')]=_[_0x4b26('0x2c')](db[_0x4b26('0x2d')][_0x4b26('0x2e')]);_0x1c98ac[_0x4b26('0x2f')]=_[_0x4b26('0x2c')](_0x54a2cc['query']);_0x1c98ac[_0x4b26('0x30')]=_[_0x4b26('0x31')](_0x1c98ac[_0x4b26('0x2b')],_0x1c98ac['query']);_0x34b0d2['attributes']=_['intersection'](_0x1c98ac[_0x4b26('0x2b')],qs[_0x4b26('0x32')](_0x54a2cc[_0x4b26('0x2f')][_0x4b26('0x32')]));_0x34b0d2[_0x4b26('0x33')]=_0x34b0d2['attributes'][_0x4b26('0x34')]?_0x34b0d2[_0x4b26('0x33')]:_0x1c98ac[_0x4b26('0x2b')];if(_0x54a2cc[_0x4b26('0x2f')][_0x4b26('0x35')]){_0x34b0d2['include']=[{'all':!![]}];}_0x34b0d2=_[_0x4b26('0x36')]({},_0x34b0d2,_0x54a2cc['options']);return db[_0x4b26('0x2d')]['find'](_0x34b0d2)[_0x4b26('0x23')](handleEntityNotFound(_0x514874,null))[_0x4b26('0x23')](respondWithResult(_0x514874,null))[_0x4b26('0x37')](handleError(_0x514874,null));};exports[_0x4b26('0x22')]=function(_0x23bed8,_0x1c8833){if(_0x23bed8[_0x4b26('0x38')]['id']){delete _0x23bed8['body']['id'];}return db[_0x4b26('0x2d')][_0x4b26('0x39')]({'where':{'id':_0x23bed8['params']['id']}})['then'](handleEntityNotFound(_0x1c8833,null))[_0x4b26('0x23')](saveUpdates(_0x23bed8['body'],null))[_0x4b26('0x23')](respondWithResult(_0x1c8833,null))[_0x4b26('0x37')](handleError(_0x1c8833,null));};exports[_0x4b26('0x24')]=function(_0x51a3b6,_0x2fbd3a){return db[_0x4b26('0x2d')]['find']({'where':{'id':_0x51a3b6[_0x4b26('0x3a')]['id']}})[_0x4b26('0x23')](handleEntityNotFound(_0x2fbd3a,null))['then'](removeEntity(_0x2fbd3a,null))['catch'](handleError(_0x2fbd3a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4896302..2460e21 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 _0x4385=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x4385,0x168));var _0x5438=function(_0x1336ff,_0x4426b6){_0x1336ff=_0x1336ff-0x0;var _0x1485d5=_0x4385[_0x1336ff];return _0x1485d5;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var logger=require(_0x5438('0x2'))(_0x5438('0x3'));var moment=require('moment');var BPromise=require(_0x5438('0x4'));var rp=require(_0x5438('0x5'));var fs=require('fs');var path=require(_0x5438('0x6'));var rimraf=require(_0x5438('0x7'));var config=require(_0x5438('0x8'));var attributes=require(_0x5438('0x9'));module[_0x5438('0xa')]=function(_0x4ce1df,_0x46c7fa){return _0x4ce1df[_0x5438('0xb')](_0x5438('0xc'),attributes,{'tableName':_0x5438('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5438('0xe')});}; \ No newline at end of file +var _0x663e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','api'];(function(_0x24a51e,_0x328dde){var _0x51ead6=function(_0x2f915c){while(--_0x2f915c){_0x24a51e['push'](_0x24a51e['shift']());}};_0x51ead6(++_0x328dde);}(_0x663e,0x1d2));var _0xe663=function(_0x19b066,_0x7a9a22){_0x19b066=_0x19b066-0x0;var _0x2133fa=_0x663e[_0x19b066];return _0x2133fa;};'use strict';var _=require('lodash');var util=require(_0xe663('0x0'));var logger=require('../../config/logger')(_0xe663('0x1'));var moment=require(_0xe663('0x2'));var BPromise=require(_0xe663('0x3'));var rp=require(_0xe663('0x4'));var fs=require('fs');var path=require(_0xe663('0x5'));var rimraf=require(_0xe663('0x6'));var config=require(_0xe663('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0xabf02e,_0x354af7){return _0xabf02e[_0xe663('0x8')](_0xe663('0x9'),attributes,{'tableName':_0xe663('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe663('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1104a57..210cf78 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 _0xcf6e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','moment','bluebird'];(function(_0x4314c4,_0x4a21db){var _0x315931=function(_0x38e0c7){while(--_0x38e0c7){_0x4314c4['push'](_0x4314c4['shift']());}};_0x315931(++_0x4a21db);}(_0xcf6e,0xf3));var _0xecf6=function(_0x17211b,_0x52ceee){_0x17211b=_0x17211b-0x0;var _0x27e7a2=_0xcf6e[_0x17211b];return _0x27e7a2;};'use strict';var _=require(_0xecf6('0x0'));var util=require(_0xecf6('0x1'));var moment=require(_0xecf6('0x2'));var BPromise=require(_0xecf6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecf6('0x4'));var db=require(_0xecf6('0x5'))['db'];var utils=require(_0xecf6('0x6'));var logger=require(_0xecf6('0x7'))(_0xecf6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xecf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d84f7,_0x10e3cf,_0x498ddb){return new BPromise(function(_0x5dfb00,_0x3c1554){return client[_0xecf6('0xa')](_0x4d84f7,_0x498ddb)['then'](function(_0x517a45){logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));logger['debug'](_0xecf6('0xe'),_0x10e3cf,'request\x20sent',JSON[_0xecf6('0xf')](_0x517a45));if(_0x517a45['error']){if(_0x517a45['error'][_0xecf6('0x10')]===0x1f4){logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')]['message']);return _0x3c1554(_0x517a45['error']['message']);}logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);return _0x5dfb00(_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);}else{logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));_0x5dfb00(_0x517a45['result']['message']);}})['catch'](function(_0x1b45ef){logger[_0xecf6('0x11')]('ChatApplication,\x20%s,\x20%s',_0x10e3cf,_0x1b45ef);_0x3c1554(_0x1b45ef);});});} \ No newline at end of file +var _0x115b=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x50f88a,_0x57cb22){var _0x2fc675=function(_0xbbeaa8){while(--_0xbbeaa8){_0x50f88a['push'](_0x50f88a['shift']());}};_0x2fc675(++_0x57cb22);}(_0x115b,0x1be));var _0xb115=function(_0x294d76,_0x38c8ac){_0x294d76=_0x294d76-0x0;var _0x1de3f4=_0x115b[_0x294d76];return _0x1de3f4;};'use strict';var _=require(_0xb115('0x0'));var util=require(_0xb115('0x1'));var moment=require('moment');var BPromise=require(_0xb115('0x2'));var rs=require(_0xb115('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb115('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb115('0x5'))('rpc');var config=require(_0xb115('0x6'));var jayson=require(_0xb115('0x7'));var client=jayson['client'][_0xb115('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x246bc7,_0x18313d,_0x5bed48){return new BPromise(function(_0x2fd154,_0x58982b){return client['request'](_0x246bc7,_0x5bed48)[_0xb115('0x9')](function(_0xce0162){logger['info'](_0xb115('0xa'),_0x18313d,_0xb115('0xb'));logger[_0xb115('0xc')](_0xb115('0xd'),_0x18313d,_0xb115('0xb'),JSON[_0xb115('0xe')](_0xce0162));if(_0xce0162['error']){if(_0xce0162[_0xb115('0xf')][_0xb115('0x10')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x18313d,_0xce0162[_0xb115('0xf')][_0xb115('0x11')]);return _0x58982b(_0xce0162['error']['message']);}logger['error'](_0xb115('0xa'),_0x18313d,_0xce0162[_0xb115('0xf')][_0xb115('0x11')]);return _0x2fd154(_0xce0162[_0xb115('0xf')][_0xb115('0x11')]);}else{logger['info'](_0xb115('0xa'),_0x18313d,_0xb115('0xb'));_0x2fd154(_0xce0162[_0xb115('0x12')][_0xb115('0x11')]);}})[_0xb115('0x13')](function(_0x5cdbd7){logger[_0xb115('0xf')](_0xb115('0xa'),_0x18313d,_0x5cdbd7);_0x58982b(_0x5cdbd7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 387f371..296defa 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 _0xf56e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xf56e,0x135));var _0xef56=function(_0x2068ae,_0x455540){_0x2068ae=_0x2068ae-0x0;var _0x37d844=_0xf56e[_0x2068ae];return _0x37d844;};'use strict';var multer=require(_0xef56('0x0'));var util=require(_0xef56('0x1'));var path=require(_0xef56('0x2'));var timeout=require(_0xef56('0x3'));var express=require(_0xef56('0x4'));var router=express[_0xef56('0x5')]();var fs_extra=require(_0xef56('0x6'));var auth=require(_0xef56('0x7'));var interaction=require(_0xef56('0x8'));var config=require(_0xef56('0x9'));var controller=require(_0xef56('0xa'));router['get'](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0xd')]);router['put']('/:id',auth[_0xef56('0xc')](),controller[_0xef56('0xe')]);router[_0xef56('0xf')](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0x10')]);module[_0xef56('0x11')]=router; \ No newline at end of file +var _0xd958=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','/:id','delete','isAuthenticated','destroy'];(function(_0x69f5b2,_0x3803d5){var _0x49290d=function(_0x553083){while(--_0x553083){_0x69f5b2['push'](_0x69f5b2['shift']());}};_0x49290d(++_0x3803d5);}(_0xd958,0x12c));var _0x8d95=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xd958[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0x8d95('0x0'));var util=require(_0x8d95('0x1'));var path=require('path');var timeout=require(_0x8d95('0x2'));var express=require(_0x8d95('0x3'));var router=express[_0x8d95('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d95('0x5'));var interaction=require(_0x8d95('0x6'));var config=require(_0x8d95('0x7'));var controller=require(_0x8d95('0x8'));router[_0x8d95('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8d95('0xa')]);router['put'](_0x8d95('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8d95('0xc')]('/:id',auth[_0x8d95('0xd')](),controller[_0x8d95('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 92ee992..2d98b6c 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 _0x0170=['STRING','BOOLEAN','sequelize','exports'];(function(_0x41430d,_0x45f545){var _0x3167da=function(_0x12640f){while(--_0x12640f){_0x41430d['push'](_0x41430d['shift']());}};_0x3167da(++_0x45f545);}(_0x0170,0x1d6));var _0x0017=function(_0x5e09f1,_0x4903d1){_0x5e09f1=_0x5e09f1-0x0;var _0x6e80c1=_0x0170[_0x5e09f1];return _0x6e80c1;};'use strict';var Sequelize=require(_0x0017('0x0'));module[_0x0017('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0017('0x2')]},'write':{'type':Sequelize[_0x0017('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0d62=['STRING','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0d62,0x1df));var _0x20d6=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x0d62[_0xd73d53];return _0x560148;};'use strict';var Sequelize=require(_0x20d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x20d6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x20d6('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index a44549e..783f4d1 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 _0xe8fc=['filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe8fc,0x149));var _0xce8f=function(_0x35d5ef,_0xf5d87d){_0x35d5ef=_0x35d5ef-0x0;var _0x40356f=_0xe8fc[_0x35d5ef];return _0x40356f;};'use strict';var emlformat=require(_0xce8f('0x0'));var rimraf=require(_0xce8f('0x1'));var zipdir=require(_0xce8f('0x2'));var jsonpatch=require(_0xce8f('0x3'));var rp=require('request-promise');var moment=require(_0xce8f('0x4'));var BPromise=require(_0xce8f('0x5'));var Mustache=require(_0xce8f('0x6'));var util=require(_0xce8f('0x7'));var path=require(_0xce8f('0x8'));var sox=require(_0xce8f('0x9'));var csv=require(_0xce8f('0xa'));var ejs=require(_0xce8f('0xb'));var fs=require('fs');var fs_extra=require(_0xce8f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce8f('0xd'));var jsforce=require(_0xce8f('0xe'));var deskjs=require(_0xce8f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce8f('0x10'));var Papa=require(_0xce8f('0x11'));var Redis=require(_0xce8f('0x12'));var authService=require(_0xce8f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xce8f('0x14'));var hardwareService=require(_0xce8f('0x15'));var logger=require(_0xce8f('0x16'))(_0xce8f('0x17'));var utils=require('../../config/utils');var config=require(_0xce8f('0x18'));var licenseUtil=require(_0xce8f('0x19'));var db=require(_0xce8f('0x1a'))['db'];config[_0xce8f('0x1b')]=_['defaults'](config[_0xce8f('0x1b')],{'host':_0xce8f('0x1c'),'port':0x18eb});var socket=require(_0xce8f('0x1d'))(new Redis(config[_0xce8f('0x1b')]));require(_0xce8f('0x1e'))[_0xce8f('0x1f')](socket);function respondWithStatusCode(_0x1e536e,_0x453e76){_0x453e76=_0x453e76||0xcc;return function(_0x34b16d){if(_0x34b16d){return _0x1e536e[_0xce8f('0x20')](_0x453e76);}return _0x1e536e[_0xce8f('0x21')](_0x453e76)['end']();};}function respondWithResult(_0x2055d8,_0x20c6c7){_0x20c6c7=_0x20c6c7||0xc8;return function(_0x21d085){if(_0x21d085){return _0x2055d8['status'](_0x20c6c7)[_0xce8f('0x22')](_0x21d085);}};}function respondWithFilteredResult(_0x482f41,_0x80e18a){return function(_0x58a219){if(_0x58a219){var _0x27fbb7=typeof _0x80e18a[_0xce8f('0x23')]===_0xce8f('0x24')&&typeof _0x80e18a[_0xce8f('0x25')]===_0xce8f('0x24');var _0x1631bb=_0x58a219[_0xce8f('0x26')];var _0x125c21=_0x27fbb7?0x0:_0x80e18a['offset'];var _0x38e38f=_0x27fbb7?_0x58a219[_0xce8f('0x26')]:_0x80e18a['offset']+_0x80e18a[_0xce8f('0x25')];var _0x19ca18;if(_0x38e38f>=_0x1631bb){_0x38e38f=_0x1631bb;_0x19ca18=0xc8;}else{_0x19ca18=0xce;}_0x482f41[_0xce8f('0x21')](_0x19ca18);return _0x482f41[_0xce8f('0x27')]('Content-Range',_0x125c21+'-'+_0x38e38f+'/'+_0x1631bb)[_0xce8f('0x22')](_0x58a219);}return null;};}function patchUpdates(_0x4cf30b){return function(_0x22113c){try{jsonpatch[_0xce8f('0x28')](_0x22113c,_0x4cf30b,!![]);}catch(_0x41a7df){return BPromise[_0xce8f('0x29')](_0x41a7df);}return _0x22113c[_0xce8f('0x2a')]();};}function saveUpdates(_0x503742,_0x539da4){return function(_0x59474a){if(_0x59474a){return _0x59474a[_0xce8f('0x2b')](_0x503742)['then'](function(_0x384a6f){return _0x384a6f;});}return null;};}function removeEntity(_0x2dd00a,_0x5a24e5){return function(_0x48207d){if(_0x48207d){return _0x48207d[_0xce8f('0x2c')]()[_0xce8f('0x2d')](function(){_0x2dd00a[_0xce8f('0x21')](0xcc)[_0xce8f('0x2e')]();});}};}function handleEntityNotFound(_0x70b22c,_0x1c34ba){return function(_0x2e2940){if(!_0x2e2940){_0x70b22c[_0xce8f('0x20')](0x194);}return _0x2e2940;};}function handleError(_0x4cfb2d,_0x5be323){_0x5be323=_0x5be323||0x1f4;return function(_0x1df531){logger['error'](_0x1df531[_0xce8f('0x2f')]);if(_0x1df531[_0xce8f('0x30')]){delete _0x1df531[_0xce8f('0x30')];}_0x4cfb2d[_0xce8f('0x21')](_0x5be323)[_0xce8f('0x31')](_0x1df531);};}exports[_0xce8f('0x32')]=function(_0x4ae044,_0xf228e8){var _0x39c8ae={},_0x44779d={},_0x272916={'count':0x0,'rows':[]};var _0x128e23=_[_0xce8f('0x33')](db['ChatGroup'][_0xce8f('0x34')],function(_0x354b14){return{'name':_0x354b14['fieldName'],'type':_0x354b14[_0xce8f('0x35')]['key']};});_0x44779d[_0xce8f('0x36')]=_[_0xce8f('0x33')](_0x128e23,'name');_0x44779d[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x4ae044[_0xce8f('0x37')]);_0x44779d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x44779d[_0xce8f('0x36')],_0x44779d['query']);_0x39c8ae[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x44779d['model'],qs[_0xce8f('0x3c')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x39c8ae['attributes']=_0x39c8ae[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x39c8ae[_0xce8f('0x3b')]:_0x44779d[_0xce8f('0x36')];if(!_0x4ae044[_0xce8f('0x37')]['hasOwnProperty'](_0xce8f('0x3e'))){_0x39c8ae[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x25')]);_0x39c8ae[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x4ae044[_0xce8f('0x37')]['offset']);}_0x39c8ae[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x40')]);_0x39c8ae[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x4ae044[_0xce8f('0x37')],_0x44779d[_0xce8f('0x39')]),_0x128e23);if(_0x4ae044['query'][_0xce8f('0x43')]){_0x39c8ae[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x39c8ae[_0xce8f('0x41')],{'$or':_['map'](_0x128e23,function(_0x46f987){if(_0x46f987['type']!==_0xce8f('0x45')){var _0x541e51={};_0x541e51[_0x46f987[_0xce8f('0x30')]]={'$like':'%'+_0x4ae044[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x541e51;}})});}_0x39c8ae=_['merge']({},_0x39c8ae,_0x4ae044[_0xce8f('0x46')]);var _0x50af6b={'where':_0x39c8ae['where']};return db[_0xce8f('0x47')][_0xce8f('0x26')](_0x50af6b)[_0xce8f('0x2d')](function(_0x51510a){_0x272916[_0xce8f('0x26')]=_0x51510a;if(_0x4ae044[_0xce8f('0x37')][_0xce8f('0x48')]){_0x39c8ae[_0xce8f('0x49')]=[{'all':!![]}];}return db[_0xce8f('0x47')][_0xce8f('0x4a')](_0x39c8ae);})[_0xce8f('0x2d')](function(_0x24d37a){_0x272916[_0xce8f('0x4b')]=_0x24d37a;return _0x272916;})[_0xce8f('0x2d')](respondWithFilteredResult(_0xf228e8,_0x39c8ae))['catch'](handleError(_0xf228e8,null));};exports[_0xce8f('0x4c')]=function(_0x39a1a3,_0x2522f8){var _0x55e594={'raw':!![],'where':{'id':_0x39a1a3[_0xce8f('0x4d')]['id']}},_0xc2707d={};_0xc2707d['model']=_[_0xce8f('0x38')](db['ChatGroup'][_0xce8f('0x34')]);_0xc2707d[_0xce8f('0x37')]=_['keys'](_0x39a1a3[_0xce8f('0x37')]);_0xc2707d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc2707d[_0xce8f('0x36')],_0xc2707d[_0xce8f('0x37')]);_0x55e594[_0xce8f('0x3b')]=_['intersection'](_0xc2707d[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x39a1a3['query']['fields']));_0x55e594[_0xce8f('0x3b')]=_0x55e594[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x55e594[_0xce8f('0x3b')]:_0xc2707d[_0xce8f('0x36')];if(_0x39a1a3[_0xce8f('0x37')]['includeAll']){_0x55e594['include']=[{'all':!![]}];}_0x55e594=_[_0xce8f('0x44')]({},_0x55e594,_0x39a1a3[_0xce8f('0x46')]);return db['ChatGroup'][_0xce8f('0x4e')](_0x55e594)[_0xce8f('0x2d')](handleEntityNotFound(_0x2522f8,null))[_0xce8f('0x2d')](respondWithResult(_0x2522f8,null))['catch'](handleError(_0x2522f8,null));};exports[_0xce8f('0x4f')]=function(_0x8bb87,_0x3f8691){return db[_0xce8f('0x47')][_0xce8f('0x4f')](_0x8bb87[_0xce8f('0x50')],{})['then'](respondWithResult(_0x3f8691,0xc9))[_0xce8f('0x51')](handleError(_0x3f8691,null));};exports['update']=function(_0x56e9db,_0xcb9d89){if(_0x56e9db['body']['id']){delete _0x56e9db['body']['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x56e9db[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0xcb9d89,null))[_0xce8f('0x2d')](saveUpdates(_0x56e9db[_0xce8f('0x50')],null))[_0xce8f('0x2d')](respondWithResult(_0xcb9d89,null))[_0xce8f('0x51')](handleError(_0xcb9d89,null));};exports[_0xce8f('0x2c')]=function(_0x5085c5,_0x32fc10){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x5085c5[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x32fc10,null))['then'](removeEntity(_0x32fc10,null))['catch'](handleError(_0x32fc10,null));};exports[_0xce8f('0x52')]=function(_0xb12016,_0x187453){return db[_0xce8f('0x47')][_0xce8f('0x52')]()[_0xce8f('0x2d')](respondWithResult(_0x187453,null))[_0xce8f('0x51')](handleError(_0x187453,null));};exports[_0xce8f('0x53')]=function(_0xa67632,_0x23b7a3,_0x3d87ac){return db[_0xce8f('0x54')]['count']({'where':{'ChatGroupId':_0xa67632['params']['id'],'ToId':_0xa67632[_0xce8f('0x55')]['id'],'read':![]}})[_0xce8f('0x2d')](function(_0x3926f9){return{'id':_[_0xce8f('0x56')](_0xa67632['params']['id']),'count':_0x3926f9};})[_0xce8f('0x2d')](respondWithResult(_0x23b7a3,null))[_0xce8f('0x51')](handleError(_0x23b7a3,null));};exports[_0xce8f('0x57')]=function(_0xdf1b63,_0x5d4254,_0x20e3f9){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0xdf1b63[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x5d4254,null))[_0xce8f('0x2d')](function(_0x29c876){if(_0x29c876){return _0x29c876[_0xce8f('0x57')](_0xdf1b63['body'][_0xce8f('0x58')],_['omit'](_0xdf1b63[_0xce8f('0x50')],[_0xce8f('0x58'),'id'])||{});}})['then'](respondWithResult(_0x5d4254,null))[_0xce8f('0x51')](handleError(_0x5d4254,null));};exports[_0xce8f('0x59')]=function(_0x2a55da,_0x1acab4,_0x52a4c4){var _0x48deea={};var _0x4353e2={};var _0x10d14a;var _0x2e3a86;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x2a55da[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x1acab4,null))['then'](function(_0x50a268){if(_0x50a268){_0x10d14a=_0x50a268;_0x4353e2[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x5b')][_0xce8f('0x34')]);_0x4353e2[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x2a55da[_0xce8f('0x37')]);_0x4353e2[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],_0x4353e2['query']);_0x48deea[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x2a55da['query'][_0xce8f('0x3c')]));_0x48deea[_0xce8f('0x3b')]=_0x48deea[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x48deea[_0xce8f('0x3b')]:_0x4353e2[_0xce8f('0x36')];_0x48deea[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x2a55da['query']['sort']);_0x48deea[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x2a55da['query'],_0x4353e2[_0xce8f('0x39')]));if(_0x2a55da['query']['filter']){_0x48deea[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x48deea['where'],{'$or':_[_0xce8f('0x33')](_0x48deea['attributes'],function(_0x2078d9){var _0x4ddd52={};_0x4ddd52[_0x2078d9]={'$like':'%'+_0x2a55da[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4ddd52;})});}_0x48deea=_[_0xce8f('0x44')]({},_0x48deea,_0x2a55da[_0xce8f('0x46')]);return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})['then'](function(_0x424136){if(_0x424136){_0x2e3a86=_0x424136[_0xce8f('0x3d')];if(!_0x2a55da['query']['hasOwnProperty']('nolimit')){_0x48deea['limit']=qs[_0xce8f('0x25')](_0x2a55da[_0xce8f('0x37')][_0xce8f('0x25')]);_0x48deea[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x2a55da['query'][_0xce8f('0x23')]);}return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})[_0xce8f('0x2d')](function(_0x8f90a7){if(_0x8f90a7){return _0x8f90a7?{'count':_0x2e3a86,'rows':_0x8f90a7}:null;}})['then'](respondWithResult(_0x1acab4,null))[_0xce8f('0x51')](handleError(_0x1acab4,null));};exports[_0xce8f('0x5c')]=function(_0x102448,_0x58cb40,_0x4c3d92){return db[_0xce8f('0x47')]['find']({'where':{'id':_0x102448[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x58cb40,null))['then'](function(_0x1c59bd){if(_0x1c59bd){return _0x1c59bd[_0xce8f('0x5c')](_0x102448[_0xce8f('0x37')][_0xce8f('0x58')]);}})[_0xce8f('0x2d')](respondWithStatusCode(_0x58cb40,null))[_0xce8f('0x51')](handleError(_0x58cb40,null));};exports['addMessage']=function(_0x1846d3,_0x176259,_0x4939e3){if(_0x1846d3[_0xce8f('0x50')]['id']){delete _0x1846d3[_0xce8f('0x50')]['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x1846d3[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x176259,null))[_0xce8f('0x2d')](function(_0x176512){if(_0x176512){_0x1846d3[_0xce8f('0x50')]['ChatGroupId']=_0x176512['id'];return db[_0xce8f('0x54')][_0xce8f('0x4f')](_0x1846d3[_0xce8f('0x50')]);}})[_0xce8f('0x2d')](respondWithResult(_0x176259,null))['catch'](handleError(_0x176259,null));};exports[_0xce8f('0x5d')]=function(_0x13d463,_0x9faf13,_0x4fb3af){var _0x100b2f={};var _0xc1bd60={};var _0x5777ba;var _0x17c9ca;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x13d463[_0xce8f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x9faf13,null))[_0xce8f('0x2d')](function(_0x1f2039){if(_0x1f2039){_0x5777ba=_0x1f2039;_0xc1bd60[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x54')][_0xce8f('0x34')]);_0xc1bd60[_0xce8f('0x37')]=_['keys'](_0x13d463[_0xce8f('0x37')]);_0xc1bd60[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc1bd60['model'],_0xc1bd60[_0xce8f('0x37')]);_0x100b2f[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0xc1bd60[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x100b2f[_0xce8f('0x3b')]=_0x100b2f[_0xce8f('0x3b')]['length']?_0x100b2f['attributes']:_0xc1bd60[_0xce8f('0x36')];_0x100b2f['order']=qs[_0xce8f('0x40')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x40')]);_0x100b2f[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x13d463[_0xce8f('0x37')],_0xc1bd60[_0xce8f('0x39')]));if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]){_0x100b2f[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],{'$or':_['map'](_0x100b2f[_0xce8f('0x3b')],function(_0x5e97eb){var _0x4c817c={};_0x4c817c[_0x5e97eb]={'$like':'%'+_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4c817c;})});}if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')]){var _0x5717f6=_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')][_0xce8f('0x5f')](',');var _0x57459a={};_0x57459a[_0x5717f6[0x0]]={'$gte':moment(_0x5717f6[0x1])[_0xce8f('0x60')](_0xce8f('0x61'))};_0x100b2f['where']=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],_0x57459a);}_0x100b2f=_[_0xce8f('0x44')]({},_0x100b2f,_0x13d463[_0xce8f('0x46')]);return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x3c3188){if(_0x3c3188){_0x17c9ca=_0x3c3188['length'];if(!_0x13d463[_0xce8f('0x37')][_0xce8f('0x62')](_0xce8f('0x3e'))){_0x100b2f[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x13d463['query']['limit']);_0x100b2f[_0xce8f('0x23')]=qs['offset'](_0x13d463[_0xce8f('0x37')][_0xce8f('0x23')]);}return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x26a434){if(_0x26a434){return _0x26a434?{'count':_0x17c9ca,'rows':_0x26a434}:null;}})[_0xce8f('0x2d')](respondWithResult(_0x9faf13,null))[_0xce8f('0x51')](handleError(_0x9faf13,null));}; \ No newline at end of file +var _0x035c=['filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','User','order','getMembers','nolimit','removeMembers','addMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','sort','where'];(function(_0x20e77c,_0x5db846){var _0x5ed0d1=function(_0x5c9914){while(--_0x5c9914){_0x20e77c['push'](_0x20e77c['shift']());}};_0x5ed0d1(++_0x5db846);}(_0x035c,0x81));var _0xc035=function(_0xf228f8,_0x433fdc){_0xf228f8=_0xf228f8-0x0;var _0x1a4b47=_0x035c[_0xf228f8];return _0x1a4b47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc035('0x0'));var zipdir=require(_0xc035('0x1'));var jsonpatch=require(_0xc035('0x2'));var rp=require(_0xc035('0x3'));var moment=require(_0xc035('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc035('0x5'));var util=require(_0xc035('0x6'));var path=require(_0xc035('0x7'));var sox=require(_0xc035('0x8'));var csv=require(_0xc035('0x9'));var ejs=require(_0xc035('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc035('0xb'));var squel=require('squel');var crypto=require(_0xc035('0xc'));var jsforce=require(_0xc035('0xd'));var deskjs=require(_0xc035('0xe'));var toCsv=require(_0xc035('0x9'));var querystring=require('querystring');var Papa=require(_0xc035('0xf'));var Redis=require(_0xc035('0x10'));var authService=require(_0xc035('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc035('0x12'))(_0xc035('0x13'));var utils=require(_0xc035('0x14'));var config=require(_0xc035('0x15'));var licenseUtil=require(_0xc035('0x16'));var db=require(_0xc035('0x17'))['db'];config[_0xc035('0x18')]=_[_0xc035('0x19')](config[_0xc035('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc035('0x1a'))(new Redis(config[_0xc035('0x18')]));require(_0xc035('0x1b'))[_0xc035('0x1c')](socket);function respondWithStatusCode(_0x4c0e0c,_0x5a5ec4){_0x5a5ec4=_0x5a5ec4||0xcc;return function(_0x5a7b8c){if(_0x5a7b8c){return _0x4c0e0c[_0xc035('0x1d')](_0x5a5ec4);}return _0x4c0e0c[_0xc035('0x1e')](_0x5a5ec4)['end']();};}function respondWithResult(_0x4cd927,_0x4cff05){_0x4cff05=_0x4cff05||0xc8;return function(_0x2dce8b){if(_0x2dce8b){return _0x4cd927['status'](_0x4cff05)[_0xc035('0x1f')](_0x2dce8b);}};}function respondWithFilteredResult(_0x3d7911,_0x5e52a1){return function(_0x24e06b){if(_0x24e06b){var _0x3277bf=typeof _0x5e52a1['offset']===_0xc035('0x20')&&typeof _0x5e52a1[_0xc035('0x21')]===_0xc035('0x20');var _0x5f5256=_0x24e06b['count'];var _0x50290e=_0x3277bf?0x0:_0x5e52a1['offset'];var _0x4b4cf4=_0x3277bf?_0x24e06b[_0xc035('0x22')]:_0x5e52a1[_0xc035('0x23')]+_0x5e52a1['limit'];var _0x55afcf;if(_0x4b4cf4>=_0x5f5256){_0x4b4cf4=_0x5f5256;_0x55afcf=0xc8;}else{_0x55afcf=0xce;}_0x3d7911['status'](_0x55afcf);return _0x3d7911[_0xc035('0x24')](_0xc035('0x25'),_0x50290e+'-'+_0x4b4cf4+'/'+_0x5f5256)[_0xc035('0x1f')](_0x24e06b);}return null;};}function patchUpdates(_0xf2332b){return function(_0x1141ee){try{jsonpatch[_0xc035('0x26')](_0x1141ee,_0xf2332b,!![]);}catch(_0x23f226){return BPromise[_0xc035('0x27')](_0x23f226);}return _0x1141ee[_0xc035('0x28')]();};}function saveUpdates(_0x5cc2a7,_0x216b87){return function(_0x4b5bb4){if(_0x4b5bb4){return _0x4b5bb4[_0xc035('0x29')](_0x5cc2a7)[_0xc035('0x2a')](function(_0x4b2dec){return _0x4b2dec;});}return null;};}function removeEntity(_0x194a47,_0x113329){return function(_0x1ba0ab){if(_0x1ba0ab){return _0x1ba0ab[_0xc035('0x2b')]()['then'](function(){_0x194a47['status'](0xcc)[_0xc035('0x2c')]();});}};}function handleEntityNotFound(_0x11a61a,_0x1378be){return function(_0x6cf650){if(!_0x6cf650){_0x11a61a[_0xc035('0x1d')](0x194);}return _0x6cf650;};}function handleError(_0x27632e,_0x419f7d){_0x419f7d=_0x419f7d||0x1f4;return function(_0x35b11d){logger[_0xc035('0x2d')](_0x35b11d[_0xc035('0x2e')]);if(_0x35b11d[_0xc035('0x2f')]){delete _0x35b11d['name'];}_0x27632e['status'](_0x419f7d)[_0xc035('0x30')](_0x35b11d);};}exports['index']=function(_0x1aa0cc,_0x4c82c1){var _0x3caf6f={},_0x5aa0d9={},_0x17d925={'count':0x0,'rows':[]};var _0x3fd496=_[_0xc035('0x31')](db[_0xc035('0x32')][_0xc035('0x33')],function(_0x4a874d){return{'name':_0x4a874d[_0xc035('0x34')],'type':_0x4a874d[_0xc035('0x35')]['key']};});_0x5aa0d9[_0xc035('0x36')]=_['map'](_0x3fd496,_0xc035('0x2f'));_0x5aa0d9[_0xc035('0x37')]=_[_0xc035('0x38')](_0x1aa0cc[_0xc035('0x37')]);_0x5aa0d9['filters']=_[_0xc035('0x39')](_0x5aa0d9[_0xc035('0x36')],_0x5aa0d9[_0xc035('0x37')]);_0x3caf6f['attributes']=_['intersection'](_0x5aa0d9[_0xc035('0x36')],qs[_0xc035('0x3a')](_0x1aa0cc[_0xc035('0x37')][_0xc035('0x3a')]));_0x3caf6f[_0xc035('0x3b')]=_0x3caf6f[_0xc035('0x3b')][_0xc035('0x3c')]?_0x3caf6f[_0xc035('0x3b')]:_0x5aa0d9[_0xc035('0x36')];if(!_0x1aa0cc[_0xc035('0x37')]['hasOwnProperty']('nolimit')){_0x3caf6f[_0xc035('0x21')]=qs[_0xc035('0x21')](_0x1aa0cc[_0xc035('0x37')][_0xc035('0x21')]);_0x3caf6f[_0xc035('0x23')]=qs['offset'](_0x1aa0cc[_0xc035('0x37')][_0xc035('0x23')]);}_0x3caf6f['order']=qs[_0xc035('0x3d')](_0x1aa0cc['query'][_0xc035('0x3d')]);_0x3caf6f[_0xc035('0x3e')]=qs[_0xc035('0x3f')](_['pick'](_0x1aa0cc[_0xc035('0x37')],_0x5aa0d9[_0xc035('0x3f')]),_0x3fd496);if(_0x1aa0cc['query'][_0xc035('0x40')]){_0x3caf6f[_0xc035('0x3e')]=_[_0xc035('0x41')](_0x3caf6f[_0xc035('0x3e')],{'$or':_['map'](_0x3fd496,function(_0x50ecb7){if(_0x50ecb7[_0xc035('0x35')]!==_0xc035('0x42')){var _0x1286b9={};_0x1286b9[_0x50ecb7[_0xc035('0x2f')]]={'$like':'%'+_0x1aa0cc[_0xc035('0x37')][_0xc035('0x40')]+'%'};return _0x1286b9;}})});}_0x3caf6f=_[_0xc035('0x41')]({},_0x3caf6f,_0x1aa0cc[_0xc035('0x43')]);var _0x1e810a={'where':_0x3caf6f['where']};return db[_0xc035('0x32')]['count'](_0x1e810a)[_0xc035('0x2a')](function(_0x31e58c){_0x17d925['count']=_0x31e58c;if(_0x1aa0cc[_0xc035('0x37')]['includeAll']){_0x3caf6f[_0xc035('0x44')]=[{'all':!![]}];}return db[_0xc035('0x32')][_0xc035('0x45')](_0x3caf6f);})[_0xc035('0x2a')](function(_0x4c3be5){_0x17d925[_0xc035('0x46')]=_0x4c3be5;return _0x17d925;})['then'](respondWithFilteredResult(_0x4c82c1,_0x3caf6f))[_0xc035('0x47')](handleError(_0x4c82c1,null));};exports[_0xc035('0x48')]=function(_0x50170e,_0x529849){var _0xc6023={'raw':!![],'where':{'id':_0x50170e[_0xc035('0x49')]['id']}},_0x307b23={};_0x307b23[_0xc035('0x36')]=_[_0xc035('0x38')](db['ChatGroup'][_0xc035('0x33')]);_0x307b23['query']=_[_0xc035('0x38')](_0x50170e['query']);_0x307b23['filters']=_['intersection'](_0x307b23[_0xc035('0x36')],_0x307b23['query']);_0xc6023[_0xc035('0x3b')]=_['intersection'](_0x307b23[_0xc035('0x36')],qs[_0xc035('0x3a')](_0x50170e[_0xc035('0x37')][_0xc035('0x3a')]));_0xc6023[_0xc035('0x3b')]=_0xc6023[_0xc035('0x3b')][_0xc035('0x3c')]?_0xc6023[_0xc035('0x3b')]:_0x307b23['model'];if(_0x50170e[_0xc035('0x37')][_0xc035('0x4a')]){_0xc6023[_0xc035('0x44')]=[{'all':!![]}];}_0xc6023=_[_0xc035('0x41')]({},_0xc6023,_0x50170e[_0xc035('0x43')]);return db[_0xc035('0x32')][_0xc035('0x4b')](_0xc6023)[_0xc035('0x2a')](handleEntityNotFound(_0x529849,null))[_0xc035('0x2a')](respondWithResult(_0x529849,null))[_0xc035('0x47')](handleError(_0x529849,null));};exports[_0xc035('0x4c')]=function(_0x411a3f,_0x443f1c){return db['ChatGroup'][_0xc035('0x4c')](_0x411a3f[_0xc035('0x4d')],{})[_0xc035('0x2a')](respondWithResult(_0x443f1c,0xc9))[_0xc035('0x47')](handleError(_0x443f1c,null));};exports[_0xc035('0x29')]=function(_0x37dd9a,_0x3e2a3f){if(_0x37dd9a[_0xc035('0x4d')]['id']){delete _0x37dd9a[_0xc035('0x4d')]['id'];}return db[_0xc035('0x32')][_0xc035('0x4b')]({'where':{'id':_0x37dd9a['params']['id']}})['then'](handleEntityNotFound(_0x3e2a3f,null))[_0xc035('0x2a')](saveUpdates(_0x37dd9a[_0xc035('0x4d')],null))[_0xc035('0x2a')](respondWithResult(_0x3e2a3f,null))[_0xc035('0x47')](handleError(_0x3e2a3f,null));};exports['destroy']=function(_0xa9eada,_0x1c4cc5){return db[_0xc035('0x32')]['find']({'where':{'id':_0xa9eada[_0xc035('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c4cc5,null))['then'](removeEntity(_0x1c4cc5,null))[_0xc035('0x47')](handleError(_0x1c4cc5,null));};exports['describe']=function(_0x2977da,_0x342021){return db[_0xc035('0x32')]['describe']()['then'](respondWithResult(_0x342021,null))[_0xc035('0x47')](handleError(_0x342021,null));};exports[_0xc035('0x4e')]=function(_0x2ef64b,_0x1a9bf8,_0x41cc44){return db[_0xc035('0x4f')][_0xc035('0x22')]({'where':{'ChatGroupId':_0x2ef64b[_0xc035('0x49')]['id'],'ToId':_0x2ef64b[_0xc035('0x50')]['id'],'read':![]}})['then'](function(_0x355f7e){return{'id':_[_0xc035('0x51')](_0x2ef64b[_0xc035('0x49')]['id']),'count':_0x355f7e};})[_0xc035('0x2a')](respondWithResult(_0x1a9bf8,null))['catch'](handleError(_0x1a9bf8,null));};exports[_0xc035('0x52')]=function(_0x33565b,_0x14035c,_0x2a4917){return db['ChatGroup'][_0xc035('0x4b')]({'where':{'id':_0x33565b['params']['id']}})['then'](handleEntityNotFound(_0x14035c,null))['then'](function(_0x4732bf){if(_0x4732bf){return _0x4732bf['addMembers'](_0x33565b[_0xc035('0x4d')]['ids'],_[_0xc035('0x53')](_0x33565b[_0xc035('0x4d')],[_0xc035('0x54'),'id'])||{});}})[_0xc035('0x2a')](respondWithResult(_0x14035c,null))['catch'](handleError(_0x14035c,null));};exports['getMembers']=function(_0x469dff,_0x186699,_0x5e3fa7){var _0x22da9e={};var _0x390658={};var _0x4d9dea;var _0x1771aa;return db[_0xc035('0x32')][_0xc035('0x55')]({'where':{'id':_0x469dff[_0xc035('0x49')]['id']}})[_0xc035('0x2a')](handleEntityNotFound(_0x186699,null))['then'](function(_0x332fb1){if(_0x332fb1){_0x4d9dea=_0x332fb1;_0x390658[_0xc035('0x36')]=_[_0xc035('0x38')](db[_0xc035('0x56')][_0xc035('0x33')]);_0x390658[_0xc035('0x37')]=_[_0xc035('0x38')](_0x469dff[_0xc035('0x37')]);_0x390658[_0xc035('0x3f')]=_[_0xc035('0x39')](_0x390658[_0xc035('0x36')],_0x390658[_0xc035('0x37')]);_0x22da9e[_0xc035('0x3b')]=_[_0xc035('0x39')](_0x390658[_0xc035('0x36')],qs[_0xc035('0x3a')](_0x469dff[_0xc035('0x37')][_0xc035('0x3a')]));_0x22da9e[_0xc035('0x3b')]=_0x22da9e[_0xc035('0x3b')][_0xc035('0x3c')]?_0x22da9e['attributes']:_0x390658[_0xc035('0x36')];_0x22da9e[_0xc035('0x57')]=qs[_0xc035('0x3d')](_0x469dff[_0xc035('0x37')][_0xc035('0x3d')]);_0x22da9e[_0xc035('0x3e')]=qs['filters'](_['pick'](_0x469dff[_0xc035('0x37')],_0x390658[_0xc035('0x3f')]));if(_0x469dff['query'][_0xc035('0x40')]){_0x22da9e[_0xc035('0x3e')]=_[_0xc035('0x41')](_0x22da9e[_0xc035('0x3e')],{'$or':_['map'](_0x22da9e[_0xc035('0x3b')],function(_0x556840){var _0x13c0a0={};_0x13c0a0[_0x556840]={'$like':'%'+_0x469dff['query'][_0xc035('0x40')]+'%'};return _0x13c0a0;})});}_0x22da9e=_[_0xc035('0x41')]({},_0x22da9e,_0x469dff[_0xc035('0x43')]);return _0x4d9dea[_0xc035('0x58')](_0x22da9e);}})[_0xc035('0x2a')](function(_0x1f0c2b){if(_0x1f0c2b){_0x1771aa=_0x1f0c2b[_0xc035('0x3c')];if(!_0x469dff[_0xc035('0x37')]['hasOwnProperty'](_0xc035('0x59'))){_0x22da9e[_0xc035('0x21')]=qs[_0xc035('0x21')](_0x469dff[_0xc035('0x37')]['limit']);_0x22da9e[_0xc035('0x23')]=qs[_0xc035('0x23')](_0x469dff['query'][_0xc035('0x23')]);}return _0x4d9dea[_0xc035('0x58')](_0x22da9e);}})[_0xc035('0x2a')](function(_0x244b8c){if(_0x244b8c){return _0x244b8c?{'count':_0x1771aa,'rows':_0x244b8c}:null;}})[_0xc035('0x2a')](respondWithResult(_0x186699,null))[_0xc035('0x47')](handleError(_0x186699,null));};exports['removeMembers']=function(_0x380cd9,_0x3b3391,_0x497d7c){return db['ChatGroup'][_0xc035('0x4b')]({'where':{'id':_0x380cd9[_0xc035('0x49')]['id']}})[_0xc035('0x2a')](handleEntityNotFound(_0x3b3391,null))['then'](function(_0x597792){if(_0x597792){return _0x597792[_0xc035('0x5a')](_0x380cd9[_0xc035('0x37')][_0xc035('0x54')]);}})[_0xc035('0x2a')](respondWithStatusCode(_0x3b3391,null))[_0xc035('0x47')](handleError(_0x3b3391,null));};exports[_0xc035('0x5b')]=function(_0x404016,_0x37ed15,_0x3ef531){if(_0x404016[_0xc035('0x4d')]['id']){delete _0x404016['body']['id'];}return db[_0xc035('0x32')][_0xc035('0x4b')]({'where':{'id':_0x404016['params']['id']}})['then'](handleEntityNotFound(_0x37ed15,null))[_0xc035('0x2a')](function(_0x16b688){if(_0x16b688){_0x404016[_0xc035('0x4d')]['ChatGroupId']=_0x16b688['id'];return db['ChatInternalMessage'][_0xc035('0x4c')](_0x404016[_0xc035('0x4d')]);}})[_0xc035('0x2a')](respondWithResult(_0x37ed15,null))[_0xc035('0x47')](handleError(_0x37ed15,null));};exports['getMessages']=function(_0x52f87d,_0x475253,_0x4a4779){var _0x26d96b={};var _0xca95bd={};var _0x44e1be;var _0x1ca6eb;return db[_0xc035('0x32')][_0xc035('0x55')]({'where':{'id':_0x52f87d[_0xc035('0x49')]['id']}})[_0xc035('0x2a')](handleEntityNotFound(_0x475253,null))[_0xc035('0x2a')](function(_0x35b791){if(_0x35b791){_0x44e1be=_0x35b791;_0xca95bd[_0xc035('0x36')]=_[_0xc035('0x38')](db[_0xc035('0x4f')][_0xc035('0x33')]);_0xca95bd[_0xc035('0x37')]=_[_0xc035('0x38')](_0x52f87d[_0xc035('0x37')]);_0xca95bd['filters']=_[_0xc035('0x39')](_0xca95bd[_0xc035('0x36')],_0xca95bd['query']);_0x26d96b[_0xc035('0x3b')]=_[_0xc035('0x39')](_0xca95bd[_0xc035('0x36')],qs[_0xc035('0x3a')](_0x52f87d[_0xc035('0x37')][_0xc035('0x3a')]));_0x26d96b['attributes']=_0x26d96b[_0xc035('0x3b')]['length']?_0x26d96b[_0xc035('0x3b')]:_0xca95bd[_0xc035('0x36')];_0x26d96b['order']=qs['sort'](_0x52f87d[_0xc035('0x37')][_0xc035('0x3d')]);_0x26d96b[_0xc035('0x3e')]=qs[_0xc035('0x3f')](_['pick'](_0x52f87d[_0xc035('0x37')],_0xca95bd[_0xc035('0x3f')]));if(_0x52f87d['query'][_0xc035('0x40')]){_0x26d96b[_0xc035('0x3e')]=_[_0xc035('0x41')](_0x26d96b[_0xc035('0x3e')],{'$or':_[_0xc035('0x31')](_0x26d96b[_0xc035('0x3b')],function(_0x4824e3){var _0x553406={};_0x553406[_0x4824e3]={'$like':'%'+_0x52f87d['query'][_0xc035('0x40')]+'%'};return _0x553406;})});}if(_0x52f87d[_0xc035('0x37')][_0xc035('0x5c')]){var _0x5b10a2=_0x52f87d[_0xc035('0x37')]['$gte']['split'](',');var _0x1c8771={};_0x1c8771[_0x5b10a2[0x0]]={'$gte':moment(_0x5b10a2[0x1])[_0xc035('0x5d')](_0xc035('0x5e'))};_0x26d96b['where']=_['merge'](_0x26d96b[_0xc035('0x3e')],_0x1c8771);}_0x26d96b=_[_0xc035('0x41')]({},_0x26d96b,_0x52f87d[_0xc035('0x43')]);return _0x44e1be['getMessages'](_0x26d96b);}})[_0xc035('0x2a')](function(_0x5ad5e6){if(_0x5ad5e6){_0x1ca6eb=_0x5ad5e6['length'];if(!_0x52f87d[_0xc035('0x37')]['hasOwnProperty'](_0xc035('0x59'))){_0x26d96b[_0xc035('0x21')]=qs['limit'](_0x52f87d['query'][_0xc035('0x21')]);_0x26d96b[_0xc035('0x23')]=qs['offset'](_0x52f87d[_0xc035('0x37')][_0xc035('0x23')]);}return _0x44e1be[_0xc035('0x5f')](_0x26d96b);}})[_0xc035('0x2a')](function(_0x37384b){if(_0x37384b){return _0x37384b?{'count':_0x1ca6eb,'rows':_0x37384b}:null;}})[_0xc035('0x2a')](respondWithResult(_0x475253,null))['catch'](handleError(_0x475253,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index c2391f9..d3bf312 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 _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xaecc,0x172));var _0xcaec=function(_0x3e1415,_0x2ad5ee){_0x3e1415=_0x3e1415-0x0;var _0x2e1ec7=_0xaecc[_0x3e1415];return _0x2e1ec7;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xdb79=['ChatGroup','update','hook','exports','events','../../mysqldb'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xdb79,0x1e4));var _0x9db7=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xdb79[_0x4b2863];return _0x567d67;};'use strict';var EventEmitter=require(_0x9db7('0x0'));var ChatGroup=require(_0x9db7('0x1'))['db'][_0x9db7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9db7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x9ed17){return function(_0x4cce35,_0x158a1b,_0x18c74a){ChatGroupEvents['emit'](_0x9ed17+':'+_0x4cce35['id'],_0x4cce35);ChatGroupEvents['emit'](_0x9ed17,_0x4cce35);_0x18c74a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9db7('0x4')](e,emitEvent(event));}}module[_0x9db7('0x5')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 45e9076..2cedca6 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 _0x9281=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x5820df,_0x24240a){var _0x7a47f1=function(_0x37410b){while(--_0x37410b){_0x5820df['push'](_0x5820df['shift']());}};_0x7a47f1(++_0x24240a);}(_0x9281,0x16b));var _0x1928=function(_0x11666c,_0x2544ad){_0x11666c=_0x11666c-0x0;var _0x4554a5=_0x9281[_0x11666c];return _0x4554a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1928('0x0'))(_0x1928('0x1'));var moment=require(_0x1928('0x2'));var BPromise=require(_0x1928('0x3'));var rp=require(_0x1928('0x4'));var fs=require('fs');var path=require(_0x1928('0x5'));var rimraf=require(_0x1928('0x6'));var config=require(_0x1928('0x7'));var attributes=require(_0x1928('0x8'));module[_0x1928('0x9')]=function(_0x3cd495,_0x58972c){return _0x3cd495['define'](_0x1928('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c1f=['chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x4c1f,0xcd));var _0xf4c1=function(_0x83bdf1,_0x3126e3){_0x83bdf1=_0x83bdf1-0x0;var _0x45c311=_0x4c1f[_0x83bdf1];return _0x45c311;};'use strict';var _=require(_0xf4c1('0x0'));var util=require('util');var logger=require(_0xf4c1('0x1'))(_0xf4c1('0x2'));var moment=require(_0xf4c1('0x3'));var BPromise=require(_0xf4c1('0x4'));var rp=require(_0xf4c1('0x5'));var fs=require('fs');var path=require(_0xf4c1('0x6'));var rimraf=require('rimraf');var config=require(_0xf4c1('0x7'));var attributes=require('./chatGroup.attributes');module[_0xf4c1('0x8')]=function(_0x41bb7b,_0x21d394){return _0x41bb7b[_0xf4c1('0x9')](_0xf4c1('0xa'),attributes,{'tableName':_0xf4c1('0xb'),'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 46f871e..e93985f 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 _0x39b3=['register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x39b3,0xc9));var _0x339b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x39b3[_0x432682];return _0x463d05;};'use strict';var _=require(_0x339b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x339b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x339b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x339b('0x3'));var logger=require(_0x339b('0x4'))(_0x339b('0x5'));var config=require(_0x339b('0x6'));var jayson=require(_0x339b('0x7'));var client=jayson[_0x339b('0x8')][_0x339b('0x9')]({'port':0x232a});config[_0x339b('0xa')]=_[_0x339b('0xb')](config[_0x339b('0xa')],{'host':_0x339b('0xc'),'port':0x18eb});var socket=require(_0x339b('0xd'))(new Redis(config[_0x339b('0xa')]));require(_0x339b('0xe'))[_0x339b('0xf')](socket);function respondWithRpcPromise(_0x3ce735,_0x2d37e6,_0x4a06ed){return new BPromise(function(_0x640d55,_0xd34d62){return client['request'](_0x3ce735,_0x4a06ed)['then'](function(_0x58cade){logger['info'](_0x339b('0x10'),_0x2d37e6,_0x339b('0x11'));logger[_0x339b('0x12')](_0x339b('0x13'),_0x2d37e6,'request\x20sent',JSON[_0x339b('0x14')](_0x58cade));if(_0x58cade[_0x339b('0x15')]){if(_0x58cade[_0x339b('0x15')][_0x339b('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0xd34d62(_0x58cade[_0x339b('0x15')]['message']);}logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0x640d55(_0x58cade[_0x339b('0x15')][_0x339b('0x17')]);}else{logger[_0x339b('0x18')](_0x339b('0x10'),_0x2d37e6,'request\x20sent');_0x640d55(_0x58cade[_0x339b('0x19')][_0x339b('0x17')]);}})[_0x339b('0x1a')](function(_0x7872a3){logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x7872a3);_0xd34d62(_0x7872a3);});});} \ No newline at end of file +var _0x3685=['error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33adeb,_0x2a9393){var _0x579bed=function(_0x429cde){while(--_0x429cde){_0x33adeb['push'](_0x33adeb['shift']());}};_0x579bed(++_0x2a9393);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});config[_0x5368('0xc')]=_[_0x5368('0xd')](config[_0x5368('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5368('0xe'))(new Redis(config[_0x5368('0xc')]));require(_0x5368('0xf'))[_0x5368('0x10')](socket);function respondWithRpcPromise(_0x14949b,_0x169e4a,_0xc001de){return new BPromise(function(_0x9823c9,_0x521e25){return client[_0x5368('0x11')](_0x14949b,_0xc001de)[_0x5368('0x12')](function(_0x27fc4f){logger['info'](_0x5368('0x13'),_0x169e4a,_0x5368('0x14'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x169e4a,'request\x20sent',JSON[_0x5368('0x15')](_0x27fc4f));if(_0x27fc4f[_0x5368('0x16')]){if(_0x27fc4f[_0x5368('0x16')][_0x5368('0x17')]===0x1f4){logger[_0x5368('0x16')](_0x5368('0x13'),_0x169e4a,_0x27fc4f[_0x5368('0x16')][_0x5368('0x18')]);return _0x521e25(_0x27fc4f[_0x5368('0x16')][_0x5368('0x18')]);}logger['error'](_0x5368('0x13'),_0x169e4a,_0x27fc4f[_0x5368('0x16')]['message']);return _0x9823c9(_0x27fc4f[_0x5368('0x16')][_0x5368('0x18')]);}else{logger[_0x5368('0x19')](_0x5368('0x13'),_0x169e4a,'request\x20sent');_0x9823c9(_0x27fc4f[_0x5368('0x1a')]['message']);}})['catch'](function(_0x996434){logger['error']('ChatGroup,\x20%s,\x20%s',_0x169e4a,_0x996434);_0x521e25(_0x996434);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ee6ce2d..f606f19 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 _0x9bfa=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x30fae7,_0x562858){var _0x1dbd52=function(_0x4d8c5e){while(--_0x4d8c5e){_0x30fae7['push'](_0x30fae7['shift']());}};_0x1dbd52(++_0x562858);}(_0x9bfa,0xee));var _0xa9bf=function(_0x38825f,_0x5155b4){_0x38825f=_0x38825f-0x0;var _0x364716=_0x9bfa[_0x38825f];return _0x364716;};'use strict';var ChatGroupEvents=require(_0xa9bf('0x0'));var events=[_0xa9bf('0x1'),_0xa9bf('0x2'),_0xa9bf('0x3')];function createListener(_0x47804e,_0x5865f4){return function(_0x2c5730){_0x5865f4[_0xa9bf('0x4')](_0x47804e,_0x2c5730);};}function removeListener(_0x29c7c8,_0x5a82cc){return function(){ChatGroupEvents[_0xa9bf('0x5')](_0x29c7c8,_0x5a82cc);};}exports[_0xa9bf('0x6')]=function(_0x2e9875){for(var _0x11e713=0x0,_0x25a80d=events[_0xa9bf('0x7')];_0x11e713<_0x25a80d;_0x11e713++){var _0x288721=events[_0x11e713];var _0x38307b=createListener(_0xa9bf('0x8')+_0x288721,_0x2e9875);ChatGroupEvents['on'](_0x288721,_0x38307b);}}; \ No newline at end of file +var _0x0b3d=['remove','update','removeListener','register','length','./chatGroup.events','save'];(function(_0xcedf4,_0x4a0de2){var _0x5dde6b=function(_0x3f5aa8){while(--_0x3f5aa8){_0xcedf4['push'](_0xcedf4['shift']());}};_0x5dde6b(++_0x4a0de2);}(_0x0b3d,0x1cc));var _0xd0b3=function(_0x189d12,_0x17aafc){_0x189d12=_0x189d12-0x0;var _0x39b0ad=_0x0b3d[_0x189d12];return _0x39b0ad;};'use strict';var ChatGroupEvents=require(_0xd0b3('0x0'));var events=[_0xd0b3('0x1'),_0xd0b3('0x2'),_0xd0b3('0x3')];function createListener(_0x12cb2f,_0x36eb31){return function(_0x3703e7){_0x36eb31['emit'](_0x12cb2f,_0x3703e7);};}function removeListener(_0x22787d,_0x3ffa95){return function(){ChatGroupEvents[_0xd0b3('0x4')](_0x22787d,_0x3ffa95);};}exports[_0xd0b3('0x5')]=function(_0x23039a){for(var _0x162d78=0x0,_0x23508b=events[_0xd0b3('0x6')];_0x162d78<_0x23508b;_0x162d78++){var _0x4fa9b8=events[_0x162d78];var _0x4660ba=createListener('chatGroup:'+_0x4fa9b8,_0x23039a);ChatGroupEvents['on'](_0x4fa9b8,_0x4660ba);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8e75fb0..8fc91e6 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 _0x652a=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','delete','destroy','removeMembers'];(function(_0x194d03,_0x34be64){var _0x14c9d5=function(_0x53a69b){while(--_0x53a69b){_0x194d03['push'](_0x194d03['shift']());}};_0x14c9d5(++_0x34be64);}(_0x652a,0x175));var _0xa652=function(_0x560788,_0x13d82a){_0x560788=_0x560788-0x0;var _0x4aa652=_0x652a[_0x560788];return _0x4aa652;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa652('0x0'));var timeout=require(_0xa652('0x1'));var express=require(_0xa652('0x2'));var router=express[_0xa652('0x3')]();var fs_extra=require(_0xa652('0x4'));var auth=require(_0xa652('0x5'));var interaction=require(_0xa652('0x6'));var config=require(_0xa652('0x7'));var controller=require(_0xa652('0x8'));router[_0xa652('0x9')]('/',auth['isAuthenticated'](),controller[_0xa652('0xa')]);router[_0xa652('0x9')](_0xa652('0xb'),auth[_0xa652('0xc')](),controller[_0xa652('0xd')]);router[_0xa652('0x9')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0xe')]);router[_0xa652('0x9')](_0xa652('0xf'),auth[_0xa652('0xc')](),controller[_0xa652('0x10')]);router[_0xa652('0x9')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x12')]);router[_0xa652('0x9')](_0xa652('0x13'),auth[_0xa652('0xc')](),controller[_0xa652('0x14')]);router[_0xa652('0x15')]('/',auth[_0xa652('0xc')](),controller[_0xa652('0x16')]);router[_0xa652('0x15')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xa652('0x18')]);router[_0xa652('0x19')](_0xa652('0x1a'),auth[_0xa652('0xc')](),controller['update']);router[_0xa652('0x1b')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0x1c')]);router[_0xa652('0x1b')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x1d')]);module[_0xa652('0x1e')]=router; \ No newline at end of file +var _0x69fd=['put','/:id','delete','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage'];(function(_0x381ce1,_0x1e9357){var _0x5c6c70=function(_0x57ede8){while(--_0x57ede8){_0x381ce1['push'](_0x381ce1['shift']());}};_0x5c6c70(++_0x1e9357);}(_0x69fd,0x79));var _0xd69f=function(_0x28f948,_0x39235e){_0x28f948=_0x28f948-0x0;var _0x45d8b0=_0x69fd[_0x28f948];return _0x45d8b0;};'use strict';var multer=require(_0xd69f('0x0'));var util=require(_0xd69f('0x1'));var path=require(_0xd69f('0x2'));var timeout=require('connect-timeout');var express=require(_0xd69f('0x3'));var router=express[_0xd69f('0x4')]();var fs_extra=require(_0xd69f('0x5'));var auth=require(_0xd69f('0x6'));var interaction=require(_0xd69f('0x7'));var config=require(_0xd69f('0x8'));var controller=require(_0xd69f('0x9'));router['get']('/',auth[_0xd69f('0xa')](),controller[_0xd69f('0xb')]);router['get']('/describe',auth[_0xd69f('0xa')](),controller[_0xd69f('0xc')]);router[_0xd69f('0xd')]('/:id',auth[_0xd69f('0xa')](),controller[_0xd69f('0xe')]);router[_0xd69f('0xd')](_0xd69f('0xf'),auth[_0xd69f('0xa')](),controller[_0xd69f('0x10')]);router[_0xd69f('0xd')](_0xd69f('0x11'),auth[_0xd69f('0xa')](),controller[_0xd69f('0x12')]);router[_0xd69f('0xd')](_0xd69f('0x13'),auth[_0xd69f('0xa')](),controller['getMessages']);router[_0xd69f('0x14')]('/',auth['isAuthenticated'](),controller[_0xd69f('0x15')]);router[_0xd69f('0x14')](_0xd69f('0x11'),auth[_0xd69f('0xa')](),controller[_0xd69f('0x16')]);router[_0xd69f('0x14')](_0xd69f('0x13'),auth[_0xd69f('0xa')](),controller[_0xd69f('0x17')]);router[_0xd69f('0x18')](_0xd69f('0x19'),auth[_0xd69f('0xa')](),controller['update']);router[_0xd69f('0x1a')](_0xd69f('0x19'),auth[_0xd69f('0xa')](),controller['destroy']);router['delete'](_0xd69f('0x11'),auth['isAuthenticated'](),controller[_0xd69f('0x1b')]);module[_0xd69f('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 8b82c36..bb3e1c4 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 _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xd3d9fa,_0x455487){var _0x441540=function(_0xc89223){while(--_0xc89223){_0xd3d9fa['push'](_0xd3d9fa['shift']());}};_0x441540(++_0x455487);}(_0xe511,0x16f));var _0x1e51=function(_0x69f883,_0x5c785d){_0x69f883=_0x69f883-0x0;var _0x5472ee=_0xe511[_0x69f883];return _0x5472ee;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4dd3=['DATE','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','star','TEXT'];(function(_0x1e4f33,_0x3d0af1){var _0x335ea5=function(_0x11cb80){while(--_0x11cb80){_0x1e4f33['push'](_0x1e4f33['shift']());}};_0x335ea5(++_0x3d0af1);}(_0x4dd3,0xf5));var _0x34dd=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x4dd3[_0x547456];return _0xc1fd7b;};'use strict';var Sequelize=require(_0x34dd('0x0'));module[_0x34dd('0x1')]={'closed':{'type':Sequelize[_0x34dd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x34dd('0x3'),'thumb'),'defaultValue':_0x34dd('0x3')},'ratingMessage':{'type':Sequelize[_0x34dd('0x4')]},'pathTranscript':{'type':Sequelize[_0x34dd('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x34dd('0x5')]},'disposition':{'type':Sequelize[_0x34dd('0x6')]},'secondDisposition':{'type':Sequelize[_0x34dd('0x6')]},'thirdDisposition':{'type':Sequelize[_0x34dd('0x6')]},'note':{'type':Sequelize[_0x34dd('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x34dd('0x6')]},'osVersion':{'type':Sequelize[_0x34dd('0x6')]},'deviceModel':{'type':Sequelize[_0x34dd('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x34dd('0x6')]},'referer':{'type':Sequelize[_0x34dd('0x4')]},'customerIp':{'type':Sequelize[_0x34dd('0x6')]},'formData':{'type':Sequelize[_0x34dd('0x4')](_0x34dd('0x7'))},'read1stAt':{'type':Sequelize[_0x34dd('0x5')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x34dd('0x8')]('in',_0x34dd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x34dd('0x6')]},'customerPort':{'type':Sequelize[_0x34dd('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x34dd('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 0a460c3..380058c 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 _0xa884=['getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','addTags','spread','Tag','color','emit','removeTags','unix','toString','server','tmp','files','transcript-%d-%s.zip','firstName','lastName','attachments','Owner','get','mkdirSync','Account','N.A.','createdAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','destroy','stack','name','send','render','merge','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','fields','length','attributes','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ContactId','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','%s%d','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids'];(function(_0x37c570,_0x537f0c){var _0x5e4c88=function(_0x3f3a0e){while(--_0x3f3a0e){_0x37c570['push'](_0x37c570['shift']());}};_0x5e4c88(++_0x537f0c);}(_0xa884,0x103));var _0x4a88=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xa884[_0x2136d5];return _0x3bee2e;};'use strict';var rimraf=require(_0x4a88('0x0'));var zipdir=require(_0x4a88('0x1'));var rp=require(_0x4a88('0x2'));var moment=require(_0x4a88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a88('0x4'));var util=require(_0x4a88('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4a88('0x6'));var Redis=require(_0x4a88('0x7'));var interaction=require(_0x4a88('0x8'));var qs=require(_0x4a88('0x9'));var pdf=require(_0x4a88('0xa'));var logger=require(_0x4a88('0xb'))(_0x4a88('0xc'));var config=require(_0x4a88('0xd'));var db=require(_0x4a88('0xe'))['db'];config['redis']=_[_0x4a88('0xf')](config[_0x4a88('0x10')],{'host':_0x4a88('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a88('0x10')]));require(_0x4a88('0x12'))['register'](socket);var jayson=require(_0x4a88('0x13'));var client=jayson[_0x4a88('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x4a88('0x14')][_0x4a88('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x386e6b,_0x4cdeff,_0x4c7ef6,_0x4c066d){return new BPromise(function(_0x4d13eb,_0x82b791){var _0x1b4a67=_0x4c066d||client;return _0x1b4a67[_0x4a88('0x16')](_0x386e6b,_0x4c7ef6)[_0x4a88('0x17')](function(_0x599852){logger[_0x4a88('0x18')](_0x4a88('0x19'),_0x4cdeff,'request\x20sent');logger['debug'](_0x4a88('0x1a'),_0x4cdeff,_0x4a88('0x1b'),JSON['stringify'](_0x599852));if(_0x599852[_0x4a88('0x1c')]){if(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1d')]===0x1f4){logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852['error'][_0x4a88('0x1e')]);return _0x82b791(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);return _0x4d13eb(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}else{logger[_0x4a88('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4cdeff,_0x4a88('0x1b'));_0x4d13eb(_0x599852[_0x4a88('0x1f')][_0x4a88('0x1e')]);}})[_0x4a88('0x20')](function(_0xd5c38a){logger[_0x4a88('0x1c')](_0x4a88('0x19'),_0x4cdeff,_0xd5c38a);_0x82b791(_0xd5c38a);});});}function respondWithStatusCode(_0x195525,_0x146523){_0x146523=_0x146523||0xcc;return function(_0x251c26){if(_0x251c26){return _0x195525[_0x4a88('0x21')](_0x146523);}return _0x195525[_0x4a88('0x22')](_0x146523)[_0x4a88('0x23')]();};}function respondWithResult(_0x2ad4b9,_0x38cef0){_0x38cef0=_0x38cef0||0xc8;return function(_0x13f020){if(_0x13f020){return _0x2ad4b9[_0x4a88('0x22')](_0x38cef0)[_0x4a88('0x24')](_0x13f020);}};}function respondWithFilteredResult(_0x4507f6,_0x378c65){return function(_0x47cd1d){if(_0x47cd1d){var _0x495ae2=typeof _0x378c65['offset']==='undefined'&&typeof _0x378c65[_0x4a88('0x25')]===_0x4a88('0x26');var _0x56afa9=_0x47cd1d[_0x4a88('0x27')];var _0x15a872=_0x495ae2?0x0:_0x378c65['offset'];var _0x47849b=_0x495ae2?_0x47cd1d[_0x4a88('0x27')]:_0x378c65[_0x4a88('0x28')]+_0x378c65[_0x4a88('0x25')];var _0x5aa141;if(_0x47849b>=_0x56afa9){_0x47849b=_0x56afa9;_0x5aa141=0xc8;}else{_0x5aa141=0xce;}_0x4507f6[_0x4a88('0x22')](_0x5aa141);return _0x4507f6['set'](_0x4a88('0x29'),_0x15a872+'-'+_0x47849b+'/'+_0x56afa9)[_0x4a88('0x24')](_0x47cd1d);}return null;};}function saveUpdates(_0x5b803b){return function(_0x457847){if(_0x457847){return _0x457847['update'](_0x5b803b)['then'](function(_0x5518e9){return _0x5518e9;});}return null;};}function removeEntity(_0x3fa33f){return function(_0x2c9f4f){if(_0x2c9f4f){return _0x2c9f4f[_0x4a88('0x2a')]()[_0x4a88('0x17')](function(){_0x3fa33f[_0x4a88('0x22')](0xcc)[_0x4a88('0x23')]();});}};}function handleEntityNotFound(_0x232977){return function(_0xef24a1){if(!_0xef24a1){_0x232977[_0x4a88('0x21')](0x194);}return _0xef24a1;};}function handleError(_0x1f7f26,_0x16881f){_0x16881f=_0x16881f||0x1f4;return function(_0x230650){logger[_0x4a88('0x1c')](_0x230650[_0x4a88('0x2b')]);if(_0x230650[_0x4a88('0x2c')]){delete _0x230650[_0x4a88('0x2c')];}_0x1f7f26[_0x4a88('0x22')](_0x16881f)[_0x4a88('0x2d')](_0x230650);};}function getMustacheRender(_0x4057d4,_0x5c4f99){return Mustache[_0x4a88('0x2e')](_0x4057d4,_[_0x4a88('0x2f')](_0x5c4f99[_0x4a88('0x30')],{'contact':_0x5c4f99[_0x4a88('0x31')],'message':_0x5c4f99[_0x4a88('0x1e')],'agent':_0x5c4f99[_0x4a88('0x32')],'interaction':_0x5c4f99['interaction'],'account':_0x5c4f99[_0x4a88('0x33')]}))||'';}exports[_0x4a88('0x34')]=function(_0x20a740,_0x817b69){var _0x4fc45e={};var _0x8e290e=_[_0x4a88('0x35')](db[_0x4a88('0x36')][_0x4a88('0x37')],function(_0x2f010e){return{'name':_0x2f010e['fieldName'],'type':_0x2f010e[_0x4a88('0x38')]['key']};});_0x4fc45e=qs[_0x4a88('0x39')](_0x8e290e,_0x20a740);return interaction[_0x4a88('0x3a')]('chat',_0x20a740[_0x4a88('0x3b')],_0x20a740[_0x4a88('0x3c')],_0x4fc45e,_0x8e290e)['then'](respondWithFilteredResult(_0x817b69,_0x4fc45e))[_0x4a88('0x20')](handleError(_0x817b69,null));};exports[_0x4a88('0x3d')]=function(_0x225f38,_0x439037){var _0x114660={'raw':![],'where':{'id':_0x225f38[_0x4a88('0x3e')]['id']}},_0x163e83={};_0x163e83[_0x4a88('0x3f')]=_[_0x4a88('0x40')](db['ChatInteraction'][_0x4a88('0x37')]);_0x163e83['query']=_[_0x4a88('0x40')](_0x225f38[_0x4a88('0x3b')]);_0x163e83[_0x4a88('0x41')]=_['intersection'](_0x163e83[_0x4a88('0x3f')],_0x163e83[_0x4a88('0x3b')]);_0x114660['attributes']=_[_0x4a88('0x42')](_0x163e83[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x225f38['query'][_0x4a88('0x43')]));_0x114660['attributes']=_0x114660['attributes'][_0x4a88('0x44')]?_0x114660[_0x4a88('0x45')]:_0x163e83['model'];if(_0x225f38[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x114660[_0x4a88('0x47')]=[{'all':!![]}];}_0x114660=_[_0x4a88('0x2f')]({},_0x114660,_0x225f38[_0x4a88('0x48')]);return db[_0x4a88('0x36')][_0x4a88('0x49')](_0x114660)[_0x4a88('0x17')](handleEntityNotFound(_0x439037,null))['then'](respondWithResult(_0x439037,null))[_0x4a88('0x20')](handleError(_0x439037,null));};exports[_0x4a88('0x4a')]=function(_0x5786e1,_0x62f319){return db[_0x4a88('0x36')]['create'](_0x5786e1[_0x4a88('0x30')],{})[_0x4a88('0x17')](respondWithResult(_0x62f319,0xc9))[_0x4a88('0x20')](handleError(_0x62f319,null));};exports['update']=function(_0x2e374a,_0x4c4da5){if(_0x2e374a[_0x4a88('0x30')]['id']){delete _0x2e374a[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x2e374a['params']['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x4c4da5,null))[_0x4a88('0x17')](saveUpdates(_0x2e374a[_0x4a88('0x30')],null))['then'](respondWithResult(_0x4c4da5,null))['catch'](handleError(_0x4c4da5,null));};exports['destroy']=function(_0x28ee5e,_0x22b486){return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x28ee5e[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x22b486,null))[_0x4a88('0x17')](removeEntity(_0x22b486,null))[_0x4a88('0x20')](handleError(_0x22b486,null));};exports[_0x4a88('0x4b')]=function(_0x5e8d78,_0x3f72db){return db['ChatInteraction'][_0x4a88('0x4b')]()[_0x4a88('0x17')](respondWithResult(_0x3f72db,null))[_0x4a88('0x20')](handleError(_0x3f72db,null));};exports[_0x4a88('0x4c')]=function(_0x142d43,_0x122f5c){var _0x69a45c=_0x142d43[_0x4a88('0x3e')]['id'];var _0x6158f0;var _0x313831;var _0x39c6db;return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x69a45c}})[_0x4a88('0x17')](function(_0x11d16c){_0x6158f0=_0x11d16c;return db[_0x4a88('0x4e')][_0x4a88('0x4d')]({'where':{'id':_0x11d16c[_0x4a88('0x4f')]},'attributes':['id',_0x4a88('0x50'),_0x4a88('0x51'),_0x4a88('0x52'),_0x4a88('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x2c8cce){if(_0x2c8cce&&_0x2c8cce[_0x4a88('0x50')]&&_0x2c8cce[_0x4a88('0x51')]){_0x313831=_0x2c8cce;var _0x19afe5={'interaction':{'id':_0x69a45c},'agent':{'id':_0x142d43['user']['id'],'name':_0x142d43[_0x4a88('0x3c')]['name'],'fullname':_0x142d43[_0x4a88('0x3c')]['fullname'],'email':_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]},'contact':_0x142d43['body'][_0x4a88('0x31')],'account':_0x142d43[_0x4a88('0x30')][_0x4a88('0x33')]};var _0x29fbc6={'rejectUnauthorized':![],'method':_0x4a88('0x55'),'url':_0x4a88('0x56'),'headers':{'X-APIKEY':_0x2c8cce[_0x4a88('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]],'buttons':null,'topic':_0x313831[_0x4a88('0x52')],'note':_[_0x4a88('0x57')](_0x313831[_0x4a88('0x53')])?null:getMustacheRender(_0x313831[_0x4a88('0x53')],_0x19afe5),'metadata':null},'redirect':_0x4a88('0x58'),'json':!![]};try{if(!_[_0x4a88('0x57')](_0x313831[_0x4a88('0x59')])){var _0x4fe8db=getMustacheRender(_0x313831[_0x4a88('0x59')],_0x19afe5);var _0x535ec0=JSON[_0x4a88('0x5a')](_0x4fe8db);_0x29fbc6[_0x4a88('0x30')][_0x4a88('0x5b')]=_0x535ec0;}}catch(_0x458c05){throw new db[(_0x4a88('0x5c'))]['ValidationError'](_0x4a88('0x5d'));}return rp(_0x29fbc6);}else{throw new db['Sequelize']['ValidationError'](_0x4a88('0x5e'));}})['then'](function(_0x2473fe){_0x39c6db=_0x2473fe;if(_0x39c6db['id']){var _0x52646d={'body':_0x39c6db[_0x4a88('0x5f')],'ChatWebsiteId':_0x313831['id'],'ChatInteractionId':_0x6158f0['id'],'direction':'out','UserId':_0x142d43[_0x4a88('0x3c')]['id']};return db['ChatMessage'][_0x4a88('0x4a')](_0x52646d,{});}else{throw new db['Sequelize'][(_0x4a88('0x60'))](_0x4a88('0x61'));}})[_0x4a88('0x17')](function(){return _0x6158f0[_0x4a88('0x62')]({'vidaooSessionId':_0x39c6db['id']});})[_0x4a88('0x17')](respondWithResult(_0x122f5c,null))['catch'](handleError(_0x122f5c,null));};exports['customUpdate']=function(_0x506b08,_0x366804){if(_0x506b08['body']['id']){delete _0x506b08[_0x4a88('0x30')]['id'];}return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x506b08['params']['id']},'include':[{'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64')}]})[_0x4a88('0x17')](handleEntityNotFound(_0x366804,null))[_0x4a88('0x17')](saveUpdates(_0x506b08['body'],null))[_0x4a88('0x17')](respondWithResult(_0x366804,null))[_0x4a88('0x20')](handleError(_0x366804,null));};exports[_0x4a88('0x65')]=function(_0x408990,_0xc4586d){if(_0x408990[_0x4a88('0x30')]['id']){delete _0x408990[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x408990[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](function(_0x5a28f0){if(!_0x5a28f0){logger[_0x4a88('0x1c')](_0x4a88('0x66'),_0x4a88('0x65'),0x194,_0x4a88('0x67'));_0xc4586d['sendStatus'](0x194);}else{if(_0x5a28f0[_0x4a88('0x68')]){throw new db['Sequelize']['ValidationError'](_0x4a88('0x69'));}}return _0x5a28f0;})['then'](function(_0x27b242){if(_0x27b242){return _0x27b242[_0x4a88('0x6a')]({'closed':_0x408990[_0x4a88('0x30')][_0x4a88('0x6b')],'disposition':_0x408990[_0x4a88('0x30')][_0x4a88('0x6c')]})['then'](function(_0x3db325){return _0x3db325;});}})[_0x4a88('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0x4a88('0x65'),_0x408990['body'],client9004);})['then'](respondWithResult(_0xc4586d,null))[_0x4a88('0x20')](handleError(_0xc4586d,null));};exports[_0x4a88('0x6d')]=function(_0x475795,_0x1eb510){_0x475795[_0x4a88('0x30')][_0x4a88('0x2c')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x6f')];_0x475795[_0x4a88('0x30')][_0x4a88('0x70')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x71')];_0x475795[_0x4a88('0x30')][_0x4a88('0x38')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x72')];return db[_0x4a88('0x73')][_0x4a88('0x4a')](_0x475795[_0x4a88('0x30')])[_0x4a88('0x17')](respondWithResult(_0x1eb510,0xc9))[_0x4a88('0x20')](handleError(_0x1eb510,null));};exports[_0x4a88('0x74')]=function(_0x3a819f,_0x2b2a83){return db[_0x4a88('0x36')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3e')]['id']},'raw':!![]})[_0x4a88('0x17')](handleEntityNotFound(_0x2b2a83,null))[_0x4a88('0x17')](function(_0x24b7f4){if(_0x24b7f4){if(_0x24b7f4[_0x4a88('0x6b')]){return _0x2b2a83[_0x4a88('0x22')](0x193)[_0x4a88('0x24')]({'status':0x193,'message':_0x4a88('0x75')});}return db[_0x4a88('0x73')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3b')][_0x4a88('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x2b2a83,null));}})[_0x4a88('0x17')](function(_0xd4cc3b){if(_0xd4cc3b){var _0x4778eb=_0xd4cc3b[_0x4a88('0x77')]!==null;var _0x251c7a=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0x7a'));if(_0x4778eb){_0x251c7a=path[_0x4a88('0x78')](_0x251c7a,'offline-chat/');}var _0x1315b6=path[_0x4a88('0x78')](_0x251c7a,_0xd4cc3b[_0x4a88('0x70')]);return _0x2b2a83[_0x4a88('0x7b')](_0x1315b6);}})['catch'](handleError(_0x2b2a83,null));};exports[_0x4a88('0x7c')]=function(_0x58099b,_0x43b23c){var _0x3bc7e3=null;var _0x585ed3=null;var _0x352e4e=null;if(_0x58099b[_0x4a88('0x30')]['id']){delete _0x58099b[_0x4a88('0x30')]['id'];}if(_0x58099b[_0x4a88('0x30')][_0x4a88('0x7d')]){_0x352e4e=path['join'](config[_0x4a88('0x79')],_0x4a88('0x7e'),util[_0x4a88('0x7f')]('transcript-%s.txt',Date[_0x4a88('0x80')]()));_0x58099b[_0x4a88('0x30')][_0x4a88('0x81')]=_0x352e4e;}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x58099b['params']['id']},'include':[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'include':[{'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84')}]}]})[_0x4a88('0x17')](handleEntityNotFound(_0x43b23c,null))[_0x4a88('0x17')](saveUpdates(_0x58099b[_0x4a88('0x30')],null))[_0x4a88('0x17')](function(_0x3e53bb){if(_0x3e53bb){_0x3bc7e3=_0x3e53bb;return db[_0x4a88('0x4e')]['find']({'where':{'id':_0x3bc7e3['ChatWebsiteId']}});}})[_0x4a88('0x17')](function(_0x4f1c48){if(_0x4f1c48){_0x585ed3=_0x4f1c48;return db[_0x4a88('0x63')]['find']({'where':{'id':_0x3bc7e3[_0x4a88('0x85')]}});}})['then'](function(_0x184b2c){if(_0x184b2c){if(_0x352e4e){var _0x4c9c5a=null;for(var _0x4fed14=0x1;_0x4fed14<_0x3bc7e3[_0x4a88('0x83')]['length'];++_0x4fed14){_0x4c9c5a=_0x3bc7e3[_0x4a88('0x83')][_0x4fed14];var _0x3684e6=_0x4c9c5a['UserId']?util[_0x4a88('0x7f')]('%s%d',_0x585ed3[_0x4a88('0x86')],_0x4c9c5a['UserId']):_0x4a88('0x87');var _0x591192=_0x58099b[_0x4a88('0x30')][_0x4a88('0x88')]||util[_0x4a88('0x7f')]('%s%d',_0x4a88('0x89'),_0x4c9c5a['ContactId']);switch(_0x585ed3[_0x4a88('0x8a')]){case _0x4a88('0x8b'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');break;case'agent_alias':_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a['User'][_0x4a88('0x8d')]||_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;case _0x4a88('0x8f'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;default:_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');}var _0x569f83=util[_0x4a88('0x7f')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4c9c5a['createdAt'])['format'](_0x4a88('0x90')),_0x4c9c5a[_0x4a88('0x91')]==='in'?_0x591192:_0x3684e6,_0x4c9c5a[_0x4a88('0x30')]);if(!_0x4c9c5a[_0x4a88('0x92')]){fs['appendFileSync'](_0x352e4e,_0x569f83);}}return db[_0x4a88('0x93')][_0x4a88('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4a88('0x94')],'as':_0x4a88('0x94'),'raw':!![]}]}]});}}})[_0x4a88('0x17')](function(_0x1b9c12){if(!_0x1b9c12||!_0x1b9c12[_0x4a88('0x95')]||!_0x58099b['body'])return _0x3bc7e3;var _0x498f0b=_0x1b9c12[_0x4a88('0x96')]();return respondWithRpcPromise(_0x4a88('0x97'),'sendMail',{'account':_0x498f0b,'message':{'from':util[_0x4a88('0x7f')](_0x4a88('0x98'),_0x1b9c12[_0x4a88('0x2c')],_0x1b9c12[_0x4a88('0x54')]||_0x1b9c12['Smtp'][_0x4a88('0x3c')]),'to':_0x58099b[_0x4a88('0x30')]['mailTranscript'],'subject':_0x4a88('0x99'),'text':util['format'](_0x4a88('0x9a'),_0x58099b[_0x4a88('0x30')]['mailTranscript']),'attachments':[{'path':_0x352e4e}]}})[_0x4a88('0x17')](function(){return _0x3bc7e3;})['catch'](function(_0x4962d1){logger[_0x4a88('0x1c')](_0x4962d1);});})['then'](respondWithStatusCode(_0x43b23c,0xc8))[_0x4a88('0x20')](handleError(_0x43b23c,null));};exports[_0x4a88('0x9b')]=function(_0x2da868,_0x273575){return db[_0x4a88('0x82')][_0x4a88('0x49')]({'where':{'id':_0x2da868[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x273575,null))[_0x4a88('0x17')](function(_0x1ed2bd){if(_0x1ed2bd){return _0x1ed2bd['addMessage'](_0x2da868[_0x4a88('0x30')][_0x4a88('0x9c')],_['omit'](_0x2da868[_0x4a88('0x30')],['ids','id'])||{});}})[_0x4a88('0x17')](respondWithResult(_0x273575,null))[_0x4a88('0x20')](handleError(_0x273575,null));};exports[_0x4a88('0x9d')]=function(_0x26d862,_0x5c7c1f){var _0x356c62={'raw':![],'where':{}};var _0x4e8548={};var _0x456429={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x26d862[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x5c7c1f,null))[_0x4a88('0x17')](function(_0x5f04ce){if(_0x5f04ce){_0x4e8548[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x4e8548[_0x4a88('0x3b')]=_[_0x4a88('0x40')](_0x26d862[_0x4a88('0x3b')]);_0x4e8548[_0x4a88('0x41')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],_0x4e8548[_0x4a88('0x3b')]);_0x356c62[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x26d862[_0x4a88('0x3b')]['fields']));_0x356c62['attributes']=_0x356c62[_0x4a88('0x45')]['length']?_0x356c62[_0x4a88('0x45')]:_0x4e8548[_0x4a88('0x3f')];if(!_0x26d862[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x356c62[_0x4a88('0x25')]=qs[_0x4a88('0x25')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x356c62[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x28')]);}_0x356c62[_0x4a88('0xa0')]=qs[_0x4a88('0xa1')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x356c62[_0x4a88('0xa2')]=qs['filters'](_['pick'](_0x26d862[_0x4a88('0x3b')],_0x4e8548[_0x4a88('0x41')]));_0x356c62['where'][_0x4a88('0xa3')]=_0x5f04ce['id'];if(_0x26d862['query'][_0x4a88('0xa4')]){_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62['where'],{'$or':_['map'](_0x356c62[_0x4a88('0x45')],function(_0x15f605){var _0x305aeb={};_0x305aeb[_0x15f605]={'$like':'%'+_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa4')]+'%'};return _0x305aeb;})});}if(_0x26d862[_0x4a88('0x3b')]['$gte']){var _0x5984b5=_0x26d862['query']['$gte']['split'](',');var _0x4b972a={};_0x4b972a[_0x5984b5[0x0]]={'$gte':moment(_0x5984b5[0x1])[_0x4a88('0x7f')](_0x4a88('0xa5'))};_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62[_0x4a88('0xa2')],_0x4b972a);}_0x356c62=_[_0x4a88('0x2f')]({},_0x356c62,_0x26d862[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x356c62[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x1e35ff){_0x456429[_0x4a88('0x27')]=_0x1e35ff;if(_0x26d862[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x356c62[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x356c62);})[_0x4a88('0x17')](function(_0xf03daf){_0x456429[_0x4a88('0xa6')]=_0xf03daf;return _0x456429;});}})[_0x4a88('0x17')](respondWithFilteredResult(_0x5c7c1f,_0x356c62))[_0x4a88('0x20')](handleError(_0x5c7c1f,null));};exports[_0x4a88('0xa7')]=function(_0x16ea34,_0x518d21){var _0x53ac01={'where':{}},_0x393d69={},_0x147902={'count':0x0,'rows':[]};return db[_0x4a88('0x36')]['findOne']({'where':{'id':_0x16ea34[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x518d21,null))[_0x4a88('0x17')](function(_0x20b19b){if(_0x20b19b){_0x393d69[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x393d69['query']=_['keys'](_0x16ea34[_0x4a88('0x3b')]);_0x393d69['filters']=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],_0x393d69[_0x4a88('0x3b')]);_0x53ac01[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x16ea34['query'][_0x4a88('0x43')]));_0x53ac01[_0x4a88('0x45')]=_0x53ac01[_0x4a88('0x45')][_0x4a88('0x44')]?_0x53ac01[_0x4a88('0x45')]:_0x393d69[_0x4a88('0x3f')];if(!_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x53ac01['limit']=qs['limit'](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x53ac01[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x16ea34['query'][_0x4a88('0x28')]);}_0x53ac01['order']=qs[_0x4a88('0xa1')](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x53ac01['where']=qs[_0x4a88('0x41')](_['pick'](_0x16ea34[_0x4a88('0x3b')],_0x393d69[_0x4a88('0x41')]));_0x53ac01[_0x4a88('0xa2')][_0x4a88('0xa3')]=_0x20b19b['id'];if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa4')]){_0x53ac01[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x53ac01[_0x4a88('0xa2')],{'$or':_['map'](_0x53ac01[_0x4a88('0x45')],function(_0x35f0ff){var _0x4c190c={};_0x4c190c[_0x35f0ff]={'$like':'%'+_0x16ea34['query'][_0x4a88('0xa4')]+'%'};return _0x4c190c;})});}_0x53ac01[_0x4a88('0xa2')]['secret']=![];if(_0x16ea34['query']['id']){_0x53ac01[_0x4a88('0xa2')]['id']={'$gt':_0x16ea34[_0x4a88('0x3b')]['id']};}_0x53ac01=_[_0x4a88('0x2f')]({},_0x53ac01,_0x16ea34[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x53ac01[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x2701ec){_0x147902['count']=_0x2701ec;_0x53ac01['include']=[];if(_0x16ea34['query'][_0x4a88('0xa8')]){_0x53ac01[_0x4a88('0x47')][_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id',_0x4a88('0x8e'),'alias']});}if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x53ac01[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x53ac01);})['then'](function(_0x493766){_0x147902[_0x4a88('0xa6')]=_0x493766;return _0x147902;});}})['then'](respondWithFilteredResult(_0x518d21,_0x53ac01))[_0x4a88('0x20')](handleError(_0x518d21,null));};exports[_0x4a88('0xaa')]=function(_0x1bdd83,_0x302e36){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x1bdd83['params']['id']}})['then'](handleEntityNotFound(_0x302e36,null))['then'](function(_0x2fb9e1){if(_0x2fb9e1){return _0x2fb9e1['setTags'](_0x1bdd83[_0x4a88('0x30')]['ids'],_['omit'](_0x1bdd83[_0x4a88('0x30')],['ids','id'])||{})[_0x4a88('0xab')](function(){return db[_0x4a88('0xac')][_0x4a88('0x3a')]({'attributes':['id',_0x4a88('0x2c'),_0x4a88('0xad')],'where':{'id':_0x1bdd83[_0x4a88('0x30')][_0x4a88('0x9c')]}});})['then'](function(_0x120834){socket[_0x4a88('0xae')]('chatInteractionTags:save',{'id':Number(_0x1bdd83[_0x4a88('0x3e')]['id']),'tags':_0x120834||[]});return{'id':Number(_0x1bdd83['params']['id']),'tags':_0x120834||[]};});}})[_0x4a88('0x17')](respondWithResult(_0x302e36,null))['catch'](handleError(_0x302e36,null));};exports[_0x4a88('0xaf')]=function(_0x3e6a52,_0xd0e507){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x3e6a52[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0xd0e507,null))[_0x4a88('0x17')](function(_0x3affa0){if(_0x3affa0){return _0x3affa0[_0x4a88('0xaf')](_0x3e6a52[_0x4a88('0x3b')][_0x4a88('0x9c')]);}})[_0x4a88('0x17')](respondWithStatusCode(_0xd0e507,null))[_0x4a88('0x20')](handleError(_0xd0e507,null));};exports['download']=function(_0x141936,_0x1b66c7){var _0x26dd8a=moment()[_0x4a88('0xb0')]()[_0x4a88('0xb1')]();var _0x307e98=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),'files',_0x4a88('0xb3'));var _0x426f91=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xb4'),'attachments');var _0x2795ff=path[_0x4a88('0x78')](_0x307e98,_0x26dd8a);var _0xaa40b8=util['format'](_0x4a88('0xb5'),_0x141936['params']['id'],_0x26dd8a);var _0x49dd2e=path[_0x4a88('0x78')](_0x307e98,_0xaa40b8);var _0x3eb485=[];_0x3eb485['push']({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64'),'attributes':['id',_0x4a88('0xb6'),_0x4a88('0xb7')],'raw':!![]});if(_0x141936[_0x4a88('0x3b')][_0x4a88('0xb8')]){_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x73')],'as':_0x4a88('0x73'),'raw':!![]});}var _0x4b77fc=[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'attributes':['id',_0x4a88('0x30'),'createdAt',_0x4a88('0x91'),_0x4a88('0x92'),'read'],'include':_0x3eb485}];_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x4e')],'as':'Account','attributes':['id',_0x4a88('0x2c')]});_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0xb9'),'attributes':['id',_0x4a88('0x8e')]});return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x141936[_0x4a88('0x3e')]['id']},'include':_0x4b77fc})['then'](handleEntityNotFound(_0x1b66c7,null))['then'](function(_0x23fe2a){if(_0x23fe2a){var _0x62f877=_0x23fe2a[_0x4a88('0xba')]({'plain':!![]});fs[_0x4a88('0xbb')](_0x2795ff);var _0x4ace18={'channel':'Chat','account':_0x62f877[_0x4a88('0xbc')]['name'],'agent':_0x62f877[_0x4a88('0xb9')]?_0x62f877[_0x4a88('0xb9')][_0x4a88('0x8e')]:_0x4a88('0xbd'),'createdAt':moment(_0x62f877[_0x4a88('0xbe')])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'closedAt':_0x62f877[_0x4a88('0x6b')]?moment(_0x62f877['closedAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))['toString']():'','disposition':_0x62f877[_0x4a88('0x6c')],'chatInfo':{'browser':_0x62f877[_0x4a88('0xbf')],'os':_0x62f877[_0x4a88('0xc0')],'referer':_0x62f877[_0x4a88('0xc1')],'customerIp':_0x62f877[_0x4a88('0xc2')],'customerPort':_0x62f877[_0x4a88('0xc3')]?_0x62f877[_0x4a88('0xc3')]:_0x4a88('0xbd')},'messages':_(_0x62f877[_0x4a88('0x83')])[_0x4a88('0xc4')]()[_0x4a88('0xa4')]({'secret':![]})[_0x4a88('0x35')](function(_0xe99d88){if(_0xe99d88[_0x4a88('0x73')]){var _0x56b269=path['join'](_0x426f91,_0xe99d88[_0x4a88('0x73')]['basename']);if(fs[_0x4a88('0xc5')](_0x56b269)){fs[_0x4a88('0xc6')](_0x56b269)[_0x4a88('0xc7')](fs['createWriteStream'](path[_0x4a88('0x78')](_0x2795ff,_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')])));}}return{'date':moment(_0xe99d88['createdAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'sender':_0xe99d88[_0x4a88('0x91')]===_0x4a88('0xc8')?_0xe99d88[_0x4a88('0x84')]?_0xe99d88['User'][_0x4a88('0x8e')]:_0x4a88('0x87'):_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb6')]+(_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb7')]?'\x20'+_0xe99d88[_0x4a88('0x64')]['lastName']:''),'body':_0xe99d88[_0x4a88('0x73')]?_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')]:_0xe99d88[_0x4a88('0x30')],'direction':_0xe99d88[_0x4a88('0x91')]==='out'?'A':'C','secret':_0xe99d88[_0x4a88('0x92')],'read':_0xe99d88['read'],'attachment':_0xe99d88['Attachment']};})['value']()};return ejs[_0x4a88('0xc9')](path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xca'),_0x4a88('0xcb')),{'interaction':_0x4ace18})[_0x4a88('0x17')](function(_0x19b8eb){var _0x2b6866=path['join'](_0x2795ff,_0x4a88('0xcc')+_0x62f877['id']+'-'+_0x26dd8a+_0x4a88('0xcd'));var _0x2e5c0d={'path':_0x2b6866,'channel':_0x4a88('0xce'),'interactionId':_0x62f877['id']};return pdf['createPdfFromHTML'](_0x19b8eb,_0x2e5c0d);})['then'](function(){return new Promise(function(_0x21e369,_0x43ad70){zipdir(_0x2795ff,{'saveTo':_0x49dd2e},function(_0x54b383,_0x264fc4){if(_0x54b383)return _0x43ad70(_0x54b383);return _0x21e369(_0x264fc4);});})[_0x4a88('0x17')](function(){return new BPromise(function(_0x5dc1e8,_0x12b992){rimraf(_0x2795ff,function(_0x54e77b){if(_0x54e77b)_0x12b992(_0x54e77b);return _0x5dc1e8();});});})['then'](function(){return _0x1b66c7[_0x4a88('0x7b')](_0x49dd2e,_0xaa40b8,function(_0x41d8ec){if(_0x41d8ec){logger[_0x4a88('0x1c')]('err',_0x41d8ec);}else{fs[_0x4a88('0xcf')](_0x49dd2e);}});});});}else{return _0x1b66c7['sendStatus'](0xc8);}})[_0x4a88('0x20')](handleError(_0x1b66c7,null));}; \ No newline at end of file +var _0xf197=['Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','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','addMessage','ids','omit','getMessages','hasOwnProperty','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','rows','getMyMessages','nolimit','pick','push','addTags','setTags','color','chatInteractionTags:save','removeTags','toString','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','browserName','osName','referer','customerIp','customerPort','N.A.','tail','pipe','createWriteStream','renderFile','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','http','client','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','stack','name','send','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsiteId'];(function(_0x5e871f,_0x4acf6e){var _0x18d9fc=function(_0x260115){while(--_0x260115){_0x5e871f['push'](_0x5e871f['shift']());}};_0x18d9fc(++_0x4acf6e);}(_0xf197,0x1e6));var _0x7f19=function(_0x4ee450,_0x56c699){_0x4ee450=_0x4ee450-0x0;var _0x597b52=_0xf197[_0x4ee450];return _0x597b52;};'use strict';var rimraf=require(_0x7f19('0x0'));var zipdir=require(_0x7f19('0x1'));var rp=require(_0x7f19('0x2'));var moment=require(_0x7f19('0x3'));var BPromise=require(_0x7f19('0x4'));var Mustache=require(_0x7f19('0x5'));var util=require(_0x7f19('0x6'));var path=require(_0x7f19('0x7'));var ejs=require(_0x7f19('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7f19('0x9'));var interaction=require(_0x7f19('0xa'));var qs=require(_0x7f19('0xb'));var pdf=require(_0x7f19('0xc'));var logger=require(_0x7f19('0xd'))('api');var config=require(_0x7f19('0xe'));var db=require(_0x7f19('0xf'))['db'];config['redis']=_['defaults'](config[_0x7f19('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f19('0x11'))(new Redis(config[_0x7f19('0x10')]));require(_0x7f19('0x12'))[_0x7f19('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7f19('0x14')]({'port':0x232b});var client9004=jayson[_0x7f19('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2688c9,_0x9ef628,_0x4fc5f5,_0x52004c){return new BPromise(function(_0x33c2b0,_0x3c9f05){var _0x213505=_0x52004c||client;return _0x213505['request'](_0x2688c9,_0x4fc5f5)[_0x7f19('0x16')](function(_0x43b4c8){logger[_0x7f19('0x17')](_0x7f19('0x18'),_0x9ef628,'request\x20sent');logger[_0x7f19('0x19')](_0x7f19('0x1a'),_0x9ef628,_0x7f19('0x1b'),JSON['stringify'](_0x43b4c8));if(_0x43b4c8[_0x7f19('0x1c')]){if(_0x43b4c8[_0x7f19('0x1c')][_0x7f19('0x1d')]===0x1f4){logger[_0x7f19('0x1c')](_0x7f19('0x18'),_0x9ef628,_0x43b4c8[_0x7f19('0x1c')][_0x7f19('0x1e')]);return _0x3c9f05(_0x43b4c8['error'][_0x7f19('0x1e')]);}logger[_0x7f19('0x1c')](_0x7f19('0x18'),_0x9ef628,_0x43b4c8[_0x7f19('0x1c')][_0x7f19('0x1e')]);return _0x33c2b0(_0x43b4c8[_0x7f19('0x1c')][_0x7f19('0x1e')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x9ef628,'request\x20sent');_0x33c2b0(_0x43b4c8['result'][_0x7f19('0x1e')]);}})[_0x7f19('0x1f')](function(_0x4ad8d1){logger['error'](_0x7f19('0x18'),_0x9ef628,_0x4ad8d1);_0x3c9f05(_0x4ad8d1);});});}function respondWithStatusCode(_0x228cb8,_0x317183){_0x317183=_0x317183||0xcc;return function(_0x1e5241){if(_0x1e5241){return _0x228cb8[_0x7f19('0x20')](_0x317183);}return _0x228cb8[_0x7f19('0x21')](_0x317183)[_0x7f19('0x22')]();};}function respondWithResult(_0x612605,_0x3a0211){_0x3a0211=_0x3a0211||0xc8;return function(_0xb897a9){if(_0xb897a9){return _0x612605[_0x7f19('0x21')](_0x3a0211)[_0x7f19('0x23')](_0xb897a9);}};}function respondWithFilteredResult(_0x2f489f,_0x32fb05){return function(_0x17e07b){if(_0x17e07b){var _0x2f8bcb=typeof _0x32fb05[_0x7f19('0x24')]===_0x7f19('0x25')&&typeof _0x32fb05[_0x7f19('0x26')]===_0x7f19('0x25');var _0x20172e=_0x17e07b['count'];var _0x4db537=_0x2f8bcb?0x0:_0x32fb05[_0x7f19('0x24')];var _0x3f6452=_0x2f8bcb?_0x17e07b['count']:_0x32fb05['offset']+_0x32fb05[_0x7f19('0x26')];var _0x2c933f;if(_0x3f6452>=_0x20172e){_0x3f6452=_0x20172e;_0x2c933f=0xc8;}else{_0x2c933f=0xce;}_0x2f489f[_0x7f19('0x21')](_0x2c933f);return _0x2f489f[_0x7f19('0x27')](_0x7f19('0x28'),_0x4db537+'-'+_0x3f6452+'/'+_0x20172e)['json'](_0x17e07b);}return null;};}function saveUpdates(_0x20ecbc){return function(_0x1367c5){if(_0x1367c5){return _0x1367c5[_0x7f19('0x29')](_0x20ecbc)[_0x7f19('0x16')](function(_0x30c0b6){return _0x30c0b6;});}return null;};}function removeEntity(_0x53f303){return function(_0x2377c4){if(_0x2377c4){return _0x2377c4[_0x7f19('0x2a')]()[_0x7f19('0x16')](function(){_0x53f303['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c92be){return function(_0x336230){if(!_0x336230){_0x4c92be[_0x7f19('0x20')](0x194);}return _0x336230;};}function handleError(_0x38bbc2,_0x4faa5a){_0x4faa5a=_0x4faa5a||0x1f4;return function(_0x21b748){logger['error'](_0x21b748[_0x7f19('0x2b')]);if(_0x21b748['name']){delete _0x21b748[_0x7f19('0x2c')];}_0x38bbc2[_0x7f19('0x21')](_0x4faa5a)[_0x7f19('0x2d')](_0x21b748);};}function getMustacheRender(_0x4339c1,_0x5e99bf){return Mustache['render'](_0x4339c1,_[_0x7f19('0x2e')](_0x5e99bf[_0x7f19('0x2f')],{'contact':_0x5e99bf['contact'],'message':_0x5e99bf['message'],'agent':_0x5e99bf['agent'],'interaction':_0x5e99bf[_0x7f19('0x30')],'account':_0x5e99bf[_0x7f19('0x31')]}))||'';}exports[_0x7f19('0x32')]=function(_0xa9abde,_0x112f5d){var _0x367685={};var _0x29b67e=_[_0x7f19('0x33')](db[_0x7f19('0x34')][_0x7f19('0x35')],function(_0x1d86b2){return{'name':_0x1d86b2[_0x7f19('0x36')],'type':_0x1d86b2[_0x7f19('0x37')][_0x7f19('0x38')]};});_0x367685=qs[_0x7f19('0x39')](_0x29b67e,_0xa9abde);return interaction[_0x7f19('0x3a')](_0x7f19('0x3b'),_0xa9abde['query'],_0xa9abde[_0x7f19('0x3c')],_0x367685,_0x29b67e)[_0x7f19('0x16')](respondWithFilteredResult(_0x112f5d,_0x367685))[_0x7f19('0x1f')](handleError(_0x112f5d,null));};exports['show']=function(_0x2d5319,_0x134549){var _0x2b2c7a={'raw':![],'where':{'id':_0x2d5319[_0x7f19('0x3d')]['id']}},_0x1cfb74={};_0x1cfb74[_0x7f19('0x3e')]=_[_0x7f19('0x3f')](db[_0x7f19('0x34')][_0x7f19('0x35')]);_0x1cfb74[_0x7f19('0x40')]=_[_0x7f19('0x3f')](_0x2d5319['query']);_0x1cfb74[_0x7f19('0x41')]=_[_0x7f19('0x42')](_0x1cfb74['model'],_0x1cfb74[_0x7f19('0x40')]);_0x2b2c7a[_0x7f19('0x43')]=_[_0x7f19('0x42')](_0x1cfb74[_0x7f19('0x3e')],qs[_0x7f19('0x44')](_0x2d5319['query'][_0x7f19('0x44')]));_0x2b2c7a[_0x7f19('0x43')]=_0x2b2c7a[_0x7f19('0x43')][_0x7f19('0x45')]?_0x2b2c7a[_0x7f19('0x43')]:_0x1cfb74[_0x7f19('0x3e')];if(_0x2d5319[_0x7f19('0x40')][_0x7f19('0x46')]){_0x2b2c7a[_0x7f19('0x47')]=[{'all':!![]}];}_0x2b2c7a=_[_0x7f19('0x2e')]({},_0x2b2c7a,_0x2d5319[_0x7f19('0x48')]);return db[_0x7f19('0x34')]['find'](_0x2b2c7a)[_0x7f19('0x16')](handleEntityNotFound(_0x134549,null))[_0x7f19('0x16')](respondWithResult(_0x134549,null))[_0x7f19('0x1f')](handleError(_0x134549,null));};exports['create']=function(_0x2d920d,_0x41b54c){return db[_0x7f19('0x34')][_0x7f19('0x49')](_0x2d920d[_0x7f19('0x2f')],{})[_0x7f19('0x16')](respondWithResult(_0x41b54c,0xc9))[_0x7f19('0x1f')](handleError(_0x41b54c,null));};exports['update']=function(_0x4c1515,_0x50b7d2){if(_0x4c1515[_0x7f19('0x2f')]['id']){delete _0x4c1515[_0x7f19('0x2f')]['id'];}return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x4c1515[_0x7f19('0x3d')]['id']}})[_0x7f19('0x16')](handleEntityNotFound(_0x50b7d2,null))[_0x7f19('0x16')](saveUpdates(_0x4c1515[_0x7f19('0x2f')],null))[_0x7f19('0x16')](respondWithResult(_0x50b7d2,null))[_0x7f19('0x1f')](handleError(_0x50b7d2,null));};exports['destroy']=function(_0x55faf4,_0xe47aa0){return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x55faf4['params']['id']}})[_0x7f19('0x16')](handleEntityNotFound(_0xe47aa0,null))['then'](removeEntity(_0xe47aa0,null))[_0x7f19('0x1f')](handleError(_0xe47aa0,null));};exports['describe']=function(_0x70f91b,_0x4ec8a9){return db[_0x7f19('0x34')][_0x7f19('0x4b')]()['then'](respondWithResult(_0x4ec8a9,null))[_0x7f19('0x1f')](handleError(_0x4ec8a9,null));};exports[_0x7f19('0x4c')]=function(_0x19fc73,_0x353f87){var _0x4acea4=_0x19fc73[_0x7f19('0x3d')]['id'];var _0x586d90;var _0x3db497;var _0x18a267;return db[_0x7f19('0x34')][_0x7f19('0x4d')]({'where':{'id':_0x4acea4}})[_0x7f19('0x16')](function(_0x4f3fd6){_0x586d90=_0x4f3fd6;return db[_0x7f19('0x4e')][_0x7f19('0x4d')]({'where':{'id':_0x4f3fd6['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x7f19('0x4f'),_0x7f19('0x50'),_0x7f19('0x51')],'raw':!![]});})['then'](function(_0x49af2a){if(_0x49af2a&&_0x49af2a[_0x7f19('0x52')]&&_0x49af2a[_0x7f19('0x53')]){_0x3db497=_0x49af2a;var _0x4c95b6={'interaction':{'id':_0x4acea4},'agent':{'id':_0x19fc73[_0x7f19('0x3c')]['id'],'name':_0x19fc73['user'][_0x7f19('0x2c')],'fullname':_0x19fc73[_0x7f19('0x3c')][_0x7f19('0x54')],'email':_0x19fc73['user'][_0x7f19('0x55')]},'contact':_0x19fc73[_0x7f19('0x2f')]['contact'],'account':_0x19fc73['body'][_0x7f19('0x31')]};var _0x7f3503={'rejectUnauthorized':![],'method':'POST','url':_0x7f19('0x56'),'headers':{'X-APIKEY':_0x49af2a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x19fc73[_0x7f19('0x3c')]['email']],'buttons':null,'topic':_0x3db497['vidaooTopic'],'note':_[_0x7f19('0x57')](_0x3db497['vidaooNote'])?null:getMustacheRender(_0x3db497[_0x7f19('0x50')],_0x4c95b6),'metadata':null},'redirect':_0x7f19('0x58'),'json':!![]};try{if(!_[_0x7f19('0x57')](_0x3db497[_0x7f19('0x51')])){var _0x1db39b=getMustacheRender(_0x3db497['vidaooMetadata'],_0x4c95b6);var _0x57dc71=JSON[_0x7f19('0x59')](_0x1db39b);_0x7f3503[_0x7f19('0x2f')][_0x7f19('0x5a')]=_0x57dc71;}}catch(_0x54f512){throw new db[(_0x7f19('0x5b'))][(_0x7f19('0x5c'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f3503);}else{throw new db['Sequelize'][(_0x7f19('0x5c'))](_0x7f19('0x5d'));}})['then'](function(_0x1567d6){_0x18a267=_0x1567d6;if(_0x18a267['id']){var _0x8a68ee={'body':_0x18a267[_0x7f19('0x5e')],'ChatWebsiteId':_0x3db497['id'],'ChatInteractionId':_0x586d90['id'],'direction':_0x7f19('0x5f'),'UserId':_0x19fc73[_0x7f19('0x3c')]['id']};return db['ChatMessage']['create'](_0x8a68ee,{});}else{throw new db[(_0x7f19('0x5b'))]['ValidationError'](_0x7f19('0x60'));}})[_0x7f19('0x16')](function(){return _0x586d90[_0x7f19('0x61')]({'vidaooSessionId':_0x18a267['id']});})['then'](respondWithResult(_0x353f87,null))[_0x7f19('0x1f')](handleError(_0x353f87,null));};exports[_0x7f19('0x62')]=function(_0x418b19,_0x56cb39){if(_0x418b19['body']['id']){delete _0x418b19['body']['id'];}return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x418b19['params']['id']},'include':[{'model':db[_0x7f19('0x63')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x56cb39,null))[_0x7f19('0x16')](saveUpdates(_0x418b19[_0x7f19('0x2f')],null))[_0x7f19('0x16')](respondWithResult(_0x56cb39,null))['catch'](handleError(_0x56cb39,null));};exports[_0x7f19('0x64')]=function(_0x372712,_0x4f7019){if(_0x372712[_0x7f19('0x2f')]['id']){delete _0x372712[_0x7f19('0x2f')]['id'];}return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x372712[_0x7f19('0x3d')]['id']}})[_0x7f19('0x16')](function(_0x4a0469){if(!_0x4a0469){logger['error'](_0x7f19('0x65'),_0x7f19('0x64'),0x194,_0x7f19('0x66'));_0x4f7019[_0x7f19('0x20')](0x194);}else{if(_0x4a0469[_0x7f19('0x67')]){throw new db[(_0x7f19('0x5b'))][(_0x7f19('0x5c'))](_0x7f19('0x68'));}}return _0x4a0469;})[_0x7f19('0x16')](function(_0x37be03){if(_0x37be03){return _0x37be03[_0x7f19('0x29')]({'closed':_0x372712[_0x7f19('0x2f')][_0x7f19('0x69')],'disposition':_0x372712['body'][_0x7f19('0x6a')]})['then'](function(_0x3a5fcb){return _0x3a5fcb;});}})[_0x7f19('0x16')](function(){return respondWithRpcPromise(_0x7f19('0x6b'),_0x7f19('0x64'),_0x372712[_0x7f19('0x2f')],client9004);})[_0x7f19('0x16')](respondWithResult(_0x4f7019,null))[_0x7f19('0x1f')](handleError(_0x4f7019,null));};exports['attachmentUpload']=function(_0x2b647f,_0x1de629){_0x2b647f[_0x7f19('0x2f')][_0x7f19('0x2c')]=_0x2b647f[_0x7f19('0x6c')][_0x7f19('0x6d')];_0x2b647f['body'][_0x7f19('0x6e')]=_0x2b647f[_0x7f19('0x6c')][_0x7f19('0x6f')];_0x2b647f[_0x7f19('0x2f')][_0x7f19('0x37')]=_0x2b647f[_0x7f19('0x6c')]['mimetype'];return db[_0x7f19('0x70')]['create'](_0x2b647f['body'])[_0x7f19('0x16')](respondWithResult(_0x1de629,0xc9))[_0x7f19('0x1f')](handleError(_0x1de629,null));};exports[_0x7f19('0x71')]=function(_0x473239,_0x2f7839){return db[_0x7f19('0x34')]['findOne']({'where':{'id':_0x473239['params']['id']},'raw':!![]})[_0x7f19('0x16')](handleEntityNotFound(_0x2f7839,null))[_0x7f19('0x16')](function(_0x53bb29){if(_0x53bb29){if(_0x53bb29[_0x7f19('0x69')]){return _0x2f7839['status'](0x193)[_0x7f19('0x23')]({'status':0x193,'message':_0x7f19('0x72')});}return db[_0x7f19('0x70')]['findOne']({'where':{'id':_0x473239['query']['attachId']},'raw':!![]})[_0x7f19('0x16')](handleEntityNotFound(_0x2f7839,null));}})[_0x7f19('0x16')](function(_0xaf6d3c){if(_0xaf6d3c){var _0x454c81=_0xaf6d3c['ChatOfflineMessageId']!==null;var _0x6246f7=path[_0x7f19('0x73')](config[_0x7f19('0x74')],_0x7f19('0x75'));if(_0x454c81){_0x6246f7=path[_0x7f19('0x73')](_0x6246f7,_0x7f19('0x76'));}var _0x40baff=path['join'](_0x6246f7,_0xaf6d3c[_0x7f19('0x6e')]);return _0x2f7839[_0x7f19('0x77')](_0x40baff);}})['catch'](handleError(_0x2f7839,null));};exports['close']=function(_0x26f56f,_0x48634b){var _0x2a01a2=null;var _0x1477c2=null;var _0x41040a=null;if(_0x26f56f['body']['id']){delete _0x26f56f[_0x7f19('0x2f')]['id'];}if(_0x26f56f['body'][_0x7f19('0x78')]){_0x41040a=path[_0x7f19('0x73')](config[_0x7f19('0x74')],_0x7f19('0x79'),util[_0x7f19('0x7a')](_0x7f19('0x7b'),Date[_0x7f19('0x7c')]()));_0x26f56f['body'][_0x7f19('0x7d')]=_0x41040a;}return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x26f56f[_0x7f19('0x3d')]['id']},'include':[{'model':db[_0x7f19('0x7e')],'as':'Messages','include':[{'model':db[_0x7f19('0x7f')],'as':_0x7f19('0x7f')}]}]})[_0x7f19('0x16')](handleEntityNotFound(_0x48634b,null))[_0x7f19('0x16')](saveUpdates(_0x26f56f[_0x7f19('0x2f')],null))[_0x7f19('0x16')](function(_0x3e501d){if(_0x3e501d){_0x2a01a2=_0x3e501d;return db['ChatWebsite']['find']({'where':{'id':_0x2a01a2[_0x7f19('0x80')]}});}})[_0x7f19('0x16')](function(_0x2f7dae){if(_0x2f7dae){_0x1477c2=_0x2f7dae;return db[_0x7f19('0x63')][_0x7f19('0x4a')]({'where':{'id':_0x2a01a2['ContactId']}});}})[_0x7f19('0x16')](function(_0xc9c7b4){if(_0xc9c7b4){if(_0x41040a){var _0x3c06b2=null;for(var _0x10332d=0x1;_0x10332d<_0x2a01a2[_0x7f19('0x81')][_0x7f19('0x45')];++_0x10332d){_0x3c06b2=_0x2a01a2['Messages'][_0x10332d];var _0x38d3a5=_0x3c06b2[_0x7f19('0x67')]?util['format']('%s%d',_0x1477c2[_0x7f19('0x82')],_0x3c06b2[_0x7f19('0x67')]):_0x7f19('0x83');var _0x1869ad=_0x26f56f[_0x7f19('0x2f')][_0x7f19('0x84')]||util[_0x7f19('0x7a')](_0x7f19('0x85'),_0x7f19('0x86'),_0x3c06b2['ContactId']);switch(_0x1477c2[_0x7f19('0x87')]){case'website_alias':_0x38d3a5=_0x3c06b2['UserId']?util[_0x7f19('0x7a')](_0x7f19('0x85'),_0x1477c2['agentAlias'],_0x3c06b2['UserId']):_0x7f19('0x83');break;case _0x7f19('0x88'):_0x38d3a5=_0x3c06b2[_0x7f19('0x67')]?_0x3c06b2['User'][_0x7f19('0x89')]||_0x3c06b2[_0x7f19('0x7f')]['fullname']:'System';break;case _0x7f19('0x8a'):_0x38d3a5=_0x3c06b2[_0x7f19('0x67')]?_0x3c06b2[_0x7f19('0x7f')][_0x7f19('0x54')]:'System';break;default:_0x38d3a5=_0x3c06b2[_0x7f19('0x67')]?util[_0x7f19('0x7a')](_0x7f19('0x85'),_0x1477c2[_0x7f19('0x82')],_0x3c06b2['UserId']):_0x7f19('0x83');}var _0x5d7c90=util[_0x7f19('0x7a')](_0x7f19('0x8b'),moment(_0x3c06b2[_0x7f19('0x8c')])[_0x7f19('0x7a')](_0x7f19('0x8d')),_0x3c06b2[_0x7f19('0x8e')]==='in'?_0x1869ad:_0x38d3a5,_0x3c06b2[_0x7f19('0x2f')]);if(!_0x3c06b2[_0x7f19('0x8f')]){fs[_0x7f19('0x90')](_0x41040a,_0x5d7c90);}}return db[_0x7f19('0x91')][_0x7f19('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x7f19('0x92')],'as':_0x7f19('0x93'),'raw':!![],'include':[{'model':db[_0x7f19('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x7f19('0x16')](function(_0x508b56){if(!_0x508b56||!_0x508b56[_0x7f19('0x93')]||!_0x26f56f[_0x7f19('0x2f')])return _0x2a01a2;var _0x480322=_0x508b56[_0x7f19('0x95')]();return respondWithRpcPromise(_0x7f19('0x96'),_0x7f19('0x97'),{'account':_0x480322,'message':{'from':util[_0x7f19('0x7a')](_0x7f19('0x98'),_0x508b56['name'],_0x508b56[_0x7f19('0x55')]||_0x508b56[_0x7f19('0x93')]['user']),'to':_0x26f56f[_0x7f19('0x2f')][_0x7f19('0x78')],'subject':'Mail\x20Transcript','text':util[_0x7f19('0x7a')](_0x7f19('0x99'),_0x26f56f['body'][_0x7f19('0x78')]),'attachments':[{'path':_0x41040a}]}})[_0x7f19('0x16')](function(){return _0x2a01a2;})['catch'](function(_0xedf4f8){logger[_0x7f19('0x1c')](_0xedf4f8);});})[_0x7f19('0x16')](respondWithStatusCode(_0x48634b,0xc8))['catch'](handleError(_0x48634b,null));};exports[_0x7f19('0x9a')]=function(_0x1bb445,_0xf8e2c0){return db[_0x7f19('0x7e')]['find']({'where':{'id':_0x1bb445['params']['id']}})[_0x7f19('0x16')](handleEntityNotFound(_0xf8e2c0,null))[_0x7f19('0x16')](function(_0x439d38){if(_0x439d38){return _0x439d38[_0x7f19('0x9a')](_0x1bb445[_0x7f19('0x2f')][_0x7f19('0x9b')],_[_0x7f19('0x9c')](_0x1bb445[_0x7f19('0x2f')],[_0x7f19('0x9b'),'id'])||{});}})[_0x7f19('0x16')](respondWithResult(_0xf8e2c0,null))[_0x7f19('0x1f')](handleError(_0xf8e2c0,null));};exports[_0x7f19('0x9d')]=function(_0x15acfb,_0x3fb2a9){var _0xc14335={'raw':![],'where':{}};var _0x10ef4f={};var _0x1a45c2={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x15acfb[_0x7f19('0x3d')]['id']}})[_0x7f19('0x16')](handleEntityNotFound(_0x3fb2a9,null))[_0x7f19('0x16')](function(_0x146716){if(_0x146716){_0x10ef4f[_0x7f19('0x3e')]=_[_0x7f19('0x3f')](db[_0x7f19('0x7e')][_0x7f19('0x35')]);_0x10ef4f[_0x7f19('0x40')]=_[_0x7f19('0x3f')](_0x15acfb['query']);_0x10ef4f[_0x7f19('0x41')]=_[_0x7f19('0x42')](_0x10ef4f['model'],_0x10ef4f['query']);_0xc14335[_0x7f19('0x43')]=_['intersection'](_0x10ef4f[_0x7f19('0x3e')],qs[_0x7f19('0x44')](_0x15acfb[_0x7f19('0x40')][_0x7f19('0x44')]));_0xc14335['attributes']=_0xc14335['attributes'][_0x7f19('0x45')]?_0xc14335[_0x7f19('0x43')]:_0x10ef4f[_0x7f19('0x3e')];if(!_0x15acfb[_0x7f19('0x40')][_0x7f19('0x9e')]('nolimit')){_0xc14335[_0x7f19('0x26')]=qs['limit'](_0x15acfb[_0x7f19('0x40')][_0x7f19('0x26')]);_0xc14335['offset']=qs[_0x7f19('0x24')](_0x15acfb[_0x7f19('0x40')][_0x7f19('0x24')]);}_0xc14335['order']=qs[_0x7f19('0x9f')](_0x15acfb[_0x7f19('0x40')][_0x7f19('0x9f')]);_0xc14335[_0x7f19('0xa0')]=qs['filters'](_['pick'](_0x15acfb[_0x7f19('0x40')],_0x10ef4f[_0x7f19('0x41')]));_0xc14335['where'][_0x7f19('0xa1')]=_0x146716['id'];if(_0x15acfb[_0x7f19('0x40')][_0x7f19('0xa2')]){_0xc14335[_0x7f19('0xa0')]=_[_0x7f19('0x2e')](_0xc14335[_0x7f19('0xa0')],{'$or':_[_0x7f19('0x33')](_0xc14335[_0x7f19('0x43')],function(_0x5cec4a){var _0x3d9df7={};_0x3d9df7[_0x5cec4a]={'$like':'%'+_0x15acfb[_0x7f19('0x40')][_0x7f19('0xa2')]+'%'};return _0x3d9df7;})});}if(_0x15acfb['query'][_0x7f19('0xa3')]){var _0x4cb414=_0x15acfb['query'][_0x7f19('0xa3')][_0x7f19('0xa4')](',');var _0x2c6543={};_0x2c6543[_0x4cb414[0x0]]={'$gte':moment(_0x4cb414[0x1])['format'](_0x7f19('0xa5'))};_0xc14335['where']=_[_0x7f19('0x2e')](_0xc14335[_0x7f19('0xa0')],_0x2c6543);}_0xc14335=_[_0x7f19('0x2e')]({},_0xc14335,_0x15acfb[_0x7f19('0x48')]);return db[_0x7f19('0x7e')][_0x7f19('0xa6')]({'where':_0xc14335[_0x7f19('0xa0')]})['then'](function(_0x591ac9){_0x1a45c2[_0x7f19('0xa6')]=_0x591ac9;if(_0x15acfb['query'][_0x7f19('0x46')]){_0xc14335[_0x7f19('0x47')]=[{'all':!![]}];}return db[_0x7f19('0x7e')][_0x7f19('0x3a')](_0xc14335);})[_0x7f19('0x16')](function(_0x20dd14){_0x1a45c2[_0x7f19('0xa7')]=_0x20dd14;return _0x1a45c2;});}})[_0x7f19('0x16')](respondWithFilteredResult(_0x3fb2a9,_0xc14335))[_0x7f19('0x1f')](handleError(_0x3fb2a9,null));};exports[_0x7f19('0xa8')]=function(_0x2d2a34,_0x579fbf){var _0x6f1951={'where':{}},_0x351046={},_0x4d521c={'count':0x0,'rows':[]};return db[_0x7f19('0x34')][_0x7f19('0x4d')]({'where':{'id':_0x2d2a34[_0x7f19('0x3d')]['id']}})['then'](handleEntityNotFound(_0x579fbf,null))['then'](function(_0x5c5ffd){if(_0x5c5ffd){_0x351046[_0x7f19('0x3e')]=_[_0x7f19('0x3f')](db[_0x7f19('0x7e')][_0x7f19('0x35')]);_0x351046[_0x7f19('0x40')]=_[_0x7f19('0x3f')](_0x2d2a34[_0x7f19('0x40')]);_0x351046[_0x7f19('0x41')]=_[_0x7f19('0x42')](_0x351046[_0x7f19('0x3e')],_0x351046['query']);_0x6f1951[_0x7f19('0x43')]=_[_0x7f19('0x42')](_0x351046[_0x7f19('0x3e')],qs[_0x7f19('0x44')](_0x2d2a34[_0x7f19('0x40')]['fields']));_0x6f1951[_0x7f19('0x43')]=_0x6f1951[_0x7f19('0x43')][_0x7f19('0x45')]?_0x6f1951[_0x7f19('0x43')]:_0x351046[_0x7f19('0x3e')];if(!_0x2d2a34[_0x7f19('0x40')][_0x7f19('0x9e')](_0x7f19('0xa9'))){_0x6f1951[_0x7f19('0x26')]=qs['limit'](_0x2d2a34[_0x7f19('0x40')][_0x7f19('0x26')]);_0x6f1951[_0x7f19('0x24')]=qs[_0x7f19('0x24')](_0x2d2a34[_0x7f19('0x40')]['offset']);}_0x6f1951['order']=qs[_0x7f19('0x9f')](_0x2d2a34[_0x7f19('0x40')][_0x7f19('0x9f')]);_0x6f1951[_0x7f19('0xa0')]=qs['filters'](_[_0x7f19('0xaa')](_0x2d2a34[_0x7f19('0x40')],_0x351046[_0x7f19('0x41')]));_0x6f1951[_0x7f19('0xa0')]['ChatInteractionId']=_0x5c5ffd['id'];if(_0x2d2a34['query']['filter']){_0x6f1951['where']=_[_0x7f19('0x2e')](_0x6f1951['where'],{'$or':_[_0x7f19('0x33')](_0x6f1951[_0x7f19('0x43')],function(_0xa43a10){var _0x1689e1={};_0x1689e1[_0xa43a10]={'$like':'%'+_0x2d2a34[_0x7f19('0x40')][_0x7f19('0xa2')]+'%'};return _0x1689e1;})});}_0x6f1951[_0x7f19('0xa0')][_0x7f19('0x8f')]=![];if(_0x2d2a34[_0x7f19('0x40')]['id']){_0x6f1951[_0x7f19('0xa0')]['id']={'$gt':_0x2d2a34[_0x7f19('0x40')]['id']};}_0x6f1951=_[_0x7f19('0x2e')]({},_0x6f1951,_0x2d2a34[_0x7f19('0x48')]);return db['ChatMessage']['count']({'where':_0x6f1951[_0x7f19('0xa0')]})[_0x7f19('0x16')](function(_0x4fe011){_0x4d521c[_0x7f19('0xa6')]=_0x4fe011;_0x6f1951[_0x7f19('0x47')]=[];if(_0x2d2a34[_0x7f19('0x40')]['includeAgent']){_0x6f1951[_0x7f19('0x47')][_0x7f19('0xab')]({'model':db['User'],'as':_0x7f19('0x7f'),'attributes':['id',_0x7f19('0x54'),_0x7f19('0x89')]});}if(_0x2d2a34['query'][_0x7f19('0x46')]){_0x6f1951['include']=[{'all':!![]}];}return db[_0x7f19('0x7e')][_0x7f19('0x3a')](_0x6f1951);})['then'](function(_0x14aec4){_0x4d521c['rows']=_0x14aec4;return _0x4d521c;});}})['then'](respondWithFilteredResult(_0x579fbf,_0x6f1951))[_0x7f19('0x1f')](handleError(_0x579fbf,null));};exports[_0x7f19('0xac')]=function(_0x3759a0,_0x2bf228){return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x3759a0['params']['id']}})['then'](handleEntityNotFound(_0x2bf228,null))[_0x7f19('0x16')](function(_0x3555f7){if(_0x3555f7){return _0x3555f7[_0x7f19('0xad')](_0x3759a0['body']['ids'],_[_0x7f19('0x9c')](_0x3759a0[_0x7f19('0x2f')],[_0x7f19('0x9b'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x7f19('0x2c'),_0x7f19('0xae')],'where':{'id':_0x3759a0[_0x7f19('0x2f')]['ids']}});})[_0x7f19('0x16')](function(_0x5563dd){socket['emit'](_0x7f19('0xaf'),{'id':Number(_0x3759a0[_0x7f19('0x3d')]['id']),'tags':_0x5563dd||[]});return{'id':Number(_0x3759a0[_0x7f19('0x3d')]['id']),'tags':_0x5563dd||[]};});}})[_0x7f19('0x16')](respondWithResult(_0x2bf228,null))[_0x7f19('0x1f')](handleError(_0x2bf228,null));};exports['removeTags']=function(_0x1160c8,_0x5d6f30){return db[_0x7f19('0x34')]['find']({'where':{'id':_0x1160c8[_0x7f19('0x3d')]['id']}})[_0x7f19('0x16')](handleEntityNotFound(_0x5d6f30,null))[_0x7f19('0x16')](function(_0x3dad1b){if(_0x3dad1b){return _0x3dad1b[_0x7f19('0xb0')](_0x1160c8[_0x7f19('0x40')]['ids']);}})[_0x7f19('0x16')](respondWithStatusCode(_0x5d6f30,null))[_0x7f19('0x1f')](handleError(_0x5d6f30,null));};exports[_0x7f19('0x77')]=function(_0x2138f3,_0x227c55){var _0x5215f0=moment()['unix']()[_0x7f19('0xb1')]();var _0x183048=path[_0x7f19('0x73')](config[_0x7f19('0x74')],_0x7f19('0xb2'),'files',_0x7f19('0xb3'));var _0x5eb49f=path[_0x7f19('0x73')](config[_0x7f19('0x74')],_0x7f19('0xb2'),_0x7f19('0xb4'),_0x7f19('0xb5'));var _0x2fe78a=path[_0x7f19('0x73')](_0x183048,_0x5215f0);var _0x262769=util[_0x7f19('0x7a')](_0x7f19('0xb6'),_0x2138f3[_0x7f19('0x3d')]['id'],_0x5215f0);var _0x2de9a3=path[_0x7f19('0x73')](_0x183048,_0x262769);var _0x5d605a=[];_0x5d605a[_0x7f19('0xab')]({'model':db[_0x7f19('0x7f')],'as':_0x7f19('0x7f'),'attributes':['id',_0x7f19('0x54')],'raw':!![]});_0x5d605a[_0x7f19('0xab')]({'model':db['CmContact'],'as':_0x7f19('0xb7'),'attributes':['id',_0x7f19('0xb8'),_0x7f19('0xb9')],'raw':!![]});if(_0x2138f3['query']['attachments']){_0x5d605a[_0x7f19('0xab')]({'model':db[_0x7f19('0x70')],'as':_0x7f19('0x70'),'raw':!![]});}var _0x194a87=[{'model':db['ChatMessage'],'as':_0x7f19('0x81'),'attributes':['id',_0x7f19('0x2f'),_0x7f19('0x8c'),_0x7f19('0x8e'),'secret',_0x7f19('0xba')],'include':_0x5d605a}];_0x194a87['push']({'model':db['ChatWebsite'],'as':_0x7f19('0xbb'),'attributes':['id',_0x7f19('0x2c')]});_0x194a87[_0x7f19('0xab')]({'model':db[_0x7f19('0x7f')],'as':_0x7f19('0xbc'),'attributes':['id','fullname']});return db[_0x7f19('0x34')][_0x7f19('0x4a')]({'where':{'id':_0x2138f3[_0x7f19('0x3d')]['id']},'include':_0x194a87})[_0x7f19('0x16')](handleEntityNotFound(_0x227c55,null))[_0x7f19('0x16')](function(_0x108ca3){if(_0x108ca3){var _0x5406a3=_0x108ca3[_0x7f19('0xbd')]({'plain':!![]});fs[_0x7f19('0xbe')](_0x2fe78a);var _0x57d891={'channel':_0x7f19('0xbf'),'account':_0x5406a3['Account'][_0x7f19('0x2c')],'agent':_0x5406a3[_0x7f19('0xbc')]?_0x5406a3[_0x7f19('0xbc')][_0x7f19('0x54')]:'N.A.','createdAt':moment(_0x5406a3[_0x7f19('0x8c')])[_0x7f19('0x7a')](_0x7f19('0xa5'))[_0x7f19('0xb1')](),'closedAt':_0x5406a3['closed']?moment(_0x5406a3['closedAt'])[_0x7f19('0x7a')](_0x7f19('0xa5'))[_0x7f19('0xb1')]():'','disposition':_0x5406a3[_0x7f19('0x6a')],'chatInfo':{'browser':_0x5406a3[_0x7f19('0xc0')],'os':_0x5406a3[_0x7f19('0xc1')],'referer':_0x5406a3[_0x7f19('0xc2')],'customerIp':_0x5406a3[_0x7f19('0xc3')],'customerPort':_0x5406a3[_0x7f19('0xc4')]?_0x5406a3[_0x7f19('0xc4')]:_0x7f19('0xc5')},'messages':_(_0x5406a3[_0x7f19('0x81')])[_0x7f19('0xc6')]()['filter']({'secret':![]})[_0x7f19('0x33')](function(_0x14162f){if(_0x14162f[_0x7f19('0x70')]){var _0x32b3ba=path[_0x7f19('0x73')](_0x5eb49f,_0x14162f['Attachment']['basename']);if(fs['existsSync'](_0x32b3ba)){fs['createReadStream'](_0x32b3ba)[_0x7f19('0xc7')](fs[_0x7f19('0xc8')](path[_0x7f19('0x73')](_0x2fe78a,_0x14162f[_0x7f19('0x70')][_0x7f19('0x6e')])));}}return{'date':moment(_0x14162f['createdAt'])[_0x7f19('0x7a')](_0x7f19('0xa5'))[_0x7f19('0xb1')](),'sender':_0x14162f[_0x7f19('0x8e')]===_0x7f19('0x5f')?_0x14162f[_0x7f19('0x7f')]?_0x14162f['User'][_0x7f19('0x54')]:_0x7f19('0x83'):_0x14162f[_0x7f19('0xb7')]['firstName']+(_0x14162f[_0x7f19('0xb7')][_0x7f19('0xb9')]?'\x20'+_0x14162f['Contact']['lastName']:''),'body':_0x14162f[_0x7f19('0x70')]?_0x14162f['Attachment'][_0x7f19('0x6e')]:_0x14162f[_0x7f19('0x2f')],'direction':_0x14162f['direction']===_0x7f19('0x5f')?'A':'C','secret':_0x14162f[_0x7f19('0x8f')],'read':_0x14162f[_0x7f19('0xba')],'attachment':_0x14162f[_0x7f19('0x70')]};})['value']()};return ejs[_0x7f19('0xc9')](path[_0x7f19('0x73')](config[_0x7f19('0x74')],_0x7f19('0xb2'),'views','downloadInteraction.ejs'),{'interaction':_0x57d891})[_0x7f19('0x16')](function(_0x1ede73){var _0x4ce6dc=path['join'](_0x2fe78a,_0x7f19('0xca')+_0x5406a3['id']+'-'+_0x5215f0+_0x7f19('0xcb'));var _0x50ea05={'path':_0x4ce6dc,'channel':_0x7f19('0xbf'),'interactionId':_0x5406a3['id']};return pdf[_0x7f19('0xcc')](_0x1ede73,_0x50ea05);})[_0x7f19('0x16')](function(){return new Promise(function(_0x580f5f,_0x56cbaa){zipdir(_0x2fe78a,{'saveTo':_0x2de9a3},function(_0x171cf0,_0x4d7dd3){if(_0x171cf0)return _0x56cbaa(_0x171cf0);return _0x580f5f(_0x4d7dd3);});})[_0x7f19('0x16')](function(){return new BPromise(function(_0x3a784c,_0x7718fb){rimraf(_0x2fe78a,function(_0x570560){if(_0x570560)_0x7718fb(_0x570560);return _0x3a784c();});});})[_0x7f19('0x16')](function(){return _0x227c55['download'](_0x2de9a3,_0x262769,function(_0x5d8465){if(_0x5d8465){logger['error']('err',_0x5d8465);}else{fs['unlinkSync'](_0x2de9a3);}});});});}else{return _0x227c55['sendStatus'](0xc8);}})[_0x7f19('0x1f')](handleError(_0x227c55,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 7362f28..8214a36 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 _0xbf0d=['catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit'];(function(_0x242d4b,_0x351a8b){var _0x45b4a8=function(_0x5b041e){while(--_0x5b041e){_0x242d4b['push'](_0x242d4b['shift']());}};_0x45b4a8(++_0x351a8b);}(_0xbf0d,0x1bc));var _0xdbf0=function(_0x2247d7,_0x402cf3){_0x2247d7=_0x2247d7-0x0;var _0x2e3191=_0xbf0d[_0x2247d7];return _0x2e3191;};'use strict';var EventEmitter=require(_0xdbf0('0x0'));var ChatInteraction=require(_0xdbf0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdbf0('0x1'))['db'][_0xdbf0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdbf0('0x3')](0x0);var events={'afterCreate':_0xdbf0('0x4'),'afterUpdate':_0xdbf0('0x5'),'afterDestroy':_0xdbf0('0x6')};function emitEvent(_0x42fd62){return function(_0x44422e,_0x293c64,_0x4cee31){_0x44422e[_0xdbf0('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b6ea6){_0x44422e['setDataValue'](_0xdbf0('0x8'),_0x1b6ea6[_0xdbf0('0x9')](function(_0x82992b){return{'id':_0x82992b['id']};}));return ChatMessage[_0xdbf0('0xa')]({'where':{'ChatInteractionId':_0x44422e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbf0('0xb')](function(_0x1c614b){_0x44422e[_0xdbf0('0xc')](_0xdbf0('0xd'),_0x1c614b['length']);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62+':'+_0x44422e['id'],_0x44422e);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62,_0x44422e);_0x4cee31(null);})[_0xdbf0('0xf')](_0x4cee31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdbf0('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xaa39=['map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','setDataValue'];(function(_0x595378,_0x2d3a80){var _0x43eac1=function(_0x1f7181){while(--_0x1f7181){_0x595378['push'](_0x595378['shift']());}};_0x43eac1(++_0x2d3a80);}(_0xaa39,0x133));var _0x9aa3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xaa39[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0x9aa3('0x0'));var ChatInteraction=require(_0x9aa3('0x1'))['db'][_0x9aa3('0x2')];var ChatMessage=require(_0x9aa3('0x1'))['db'][_0x9aa3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9aa3('0x4'),'afterUpdate':_0x9aa3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2255bd){return function(_0x49d125,_0x4927a7,_0x48ccb0){_0x49d125[_0x9aa3('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4539c2){_0x49d125[_0x9aa3('0x7')]('Users',_0x4539c2[_0x9aa3('0x8')](function(_0x175b87){return{'id':_0x175b87['id']};}));return ChatMessage[_0x9aa3('0x9')]({'where':{'ChatInteractionId':_0x49d125['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x36ba0a){_0x49d125[_0x9aa3('0x7')]('unreadMessages',_0x36ba0a['length']);ChatInteractionEvents[_0x9aa3('0xa')](_0x2255bd+':'+_0x49d125['id'],_0x49d125);ChatInteractionEvents[_0x9aa3('0xa')](_0x2255bd,_0x49d125);_0x48ccb0(null);})[_0x9aa3('0xb')](_0x48ccb0(null));};}for(var e in events){if(events[_0x9aa3('0xc')](e)){var event=events[e];ChatInteraction[_0x9aa3('0xd')](e,emitEvent(event));}}module[_0x9aa3('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ca1246c..9620149 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 _0x5565=['../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47a05e,_0x20ab31){var _0x436415=function(_0x13b68e){while(--_0x13b68e){_0x47a05e['push'](_0x47a05e['shift']());}};_0x436415(++_0x20ab31);}(_0x5565,0x199));var _0x5556=function(_0x49919f,_0x9eb84){_0x49919f=_0x49919f-0x0;var _0x17e37a=_0x5565[_0x49919f];return _0x17e37a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5556('0x0'))(_0x5556('0x1'));var moment=require(_0x5556('0x2'));var BPromise=require(_0x5556('0x3'));var rp=require(_0x5556('0x4'));var fs=require('fs');var path=require(_0x5556('0x5'));var rimraf=require(_0x5556('0x6'));var config=require(_0x5556('0x7'));var attributes=require(_0x5556('0x8'));module[_0x5556('0x9')]=function(_0x16c837,_0x3d4a83){return _0x16c837[_0x5556('0xa')]('ChatInteraction',attributes,{'tableName':_0x5556('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5750a0,_0x3081f6,_0x252102){if(_0x5750a0[_0x5556('0xc')]('closed')){_0x5750a0[_0x5556('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x252102(null,_0x5750a0);}},'charset':_0x5556('0xe'),'collate':_0x5556('0xf')});}; \ No newline at end of file +var _0x4684=['moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','format','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x36b48f,_0x3d1e2c){var _0x20e644=function(_0x48e25f){while(--_0x48e25f){_0x36b48f['push'](_0x36b48f['shift']());}};_0x20e644(++_0x3d1e2c);}(_0x4684,0xb4));var _0x4468=function(_0x1b7442,_0x392128){_0x1b7442=_0x1b7442-0x0;var _0x15ef34=_0x4684[_0x1b7442];return _0x15ef34;};'use strict';var _=require('lodash');var util=require(_0x4468('0x0'));var logger=require(_0x4468('0x1'))('api');var moment=require(_0x4468('0x2'));var BPromise=require(_0x4468('0x3'));var rp=require(_0x4468('0x4'));var fs=require('fs');var path=require(_0x4468('0x5'));var rimraf=require(_0x4468('0x6'));var config=require('../../config/environment');var attributes=require(_0x4468('0x7'));module[_0x4468('0x8')]=function(_0x167a40,_0x51645d){return _0x167a40['define'](_0x4468('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b5be8,_0x355196,_0x12b944){if(_0x3b5be8[_0x4468('0xa')](_0x4468('0xb'))){_0x3b5be8['closedAt']=moment()[_0x4468('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x12b944(null,_0x3b5be8);}},'charset':'utf8mb4','collate':_0x4468('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 907fe34..7ff85c4 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 _0xee85=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','update','options','where','attributes','UpdateChatInteraction','stringify','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x5aa042,_0x4b5430){var _0x2477a1=function(_0x1d1177){while(--_0x1d1177){_0x5aa042['push'](_0x5aa042['shift']());}};_0x2477a1(++_0x4b5430);}(_0xee85,0x13a));var _0x5ee8=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0xee85[_0x5ce268];return _0x28c96a;};'use strict';var _=require(_0x5ee8('0x0'));var util=require('util');var moment=require(_0x5ee8('0x1'));var BPromise=require(_0x5ee8('0x2'));var rs=require(_0x5ee8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ee8('0x4'));var logger=require('../../config/logger')(_0x5ee8('0x5'));var config=require(_0x5ee8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5ee8('0x7')][_0x5ee8('0x8')]({'port':0x232a});config[_0x5ee8('0x9')]=_[_0x5ee8('0xa')](config[_0x5ee8('0x9')],{'host':_0x5ee8('0xb'),'port':0x18eb});var socket=require(_0x5ee8('0xc'))(new Redis(config[_0x5ee8('0x9')]));require(_0x5ee8('0xd'))[_0x5ee8('0xe')](socket);function respondWithRpcPromise(_0x4464af,_0x2cc8c0,_0x13c18d){return new BPromise(function(_0x1a62ad,_0x49fb43){return client['request'](_0x4464af,_0x13c18d)[_0x5ee8('0xf')](function(_0x424787){logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));logger[_0x5ee8('0x13')](_0x5ee8('0x14'),_0x2cc8c0,_0x5ee8('0x12'),JSON['stringify'](_0x424787));if(_0x424787['error']){if(_0x424787[_0x5ee8('0x15')][_0x5ee8('0x16')]===0x1f4){logger[_0x5ee8('0x15')](_0x5ee8('0x11'),_0x2cc8c0,_0x424787['error'][_0x5ee8('0x17')]);return _0x49fb43(_0x424787['error']['message']);}logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x424787[_0x5ee8('0x15')][_0x5ee8('0x17')]);return _0x1a62ad(_0x424787['error']['message']);}else{logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));_0x1a62ad(_0x424787[_0x5ee8('0x18')][_0x5ee8('0x17')]);}})[_0x5ee8('0x19')](function(_0x439e76){logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x439e76);_0x49fb43(_0x439e76);});});}exports['UpdateChatInteraction']=function(_0x1e4fa7){var _0x4d98ec=this;return new Promise(function(_0xd5523e,_0x5c21a6){return db['ChatInteraction'][_0x5ee8('0x1a')](_0x1e4fa7['body'],{'raw':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null,'attributes':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1d')]||null:null,'limit':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['limit']||null:null})[_0x5ee8('0xf')](function(_0x1fceb0){logger[_0x5ee8('0x10')]('UpdateChatInteraction',_0x1e4fa7);logger['debug'](_0x5ee8('0x1e'),_0x1e4fa7,JSON[_0x5ee8('0x1f')](_0x1fceb0));_0xd5523e(_0x1fceb0);})[_0x5ee8('0x19')](function(_0x5b55bd){logger[_0x5ee8('0x15')](_0x5ee8('0x1e'),_0x5b55bd[_0x5ee8('0x17')],_0x1e4fa7);_0x5c21a6(_0x4d98ec[_0x5ee8('0x15')](0x1f4,_0x5b55bd[_0x5ee8('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x25b3c0){return new Promise(function(_0x409476,_0x1c643c){return db[_0x5ee8('0x20')][_0x5ee8('0x21')]({'where':_0x25b3c0[_0x5ee8('0x1b')]?_0x25b3c0[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null})['then'](function(_0x5e6912){if(_0x5e6912){return _0x5e6912[_0x5ee8('0x22')](_0x25b3c0[_0x5ee8('0x23')][_0x5ee8('0x24')],_[_0x5ee8('0x25')](_0x25b3c0[_0x5ee8('0x23')],[_0x5ee8('0x24'),'id'])||{});}})[_0x5ee8('0x26')](function(_0xd282a8){logger['info']('AddTags',_0x25b3c0);logger[_0x5ee8('0x13')](_0x5ee8('0x27'),_0x25b3c0,JSON['stringify'](_0xd282a8));_0x409476(_0xd282a8);})[_0x5ee8('0x19')](function(_0x59a6bd){logger[_0x5ee8('0x15')](_0x5ee8('0x27'),_0x59a6bd[_0x5ee8('0x17')],_0x25b3c0);_0x1c643c(_this[_0x5ee8('0x15')](0x1f4,_0x59a6bd[_0x5ee8('0x17')]));});});}; \ No newline at end of file +var _0x56ec=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','AddTagsToChatInteraction','addTags','omit','body','ids','spread','AddTags','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56ec,0x79));var _0xc56e=function(_0x586245,_0x132942){_0x586245=_0x586245-0x0;var _0x25b16a=_0x56ec[_0x586245];return _0x25b16a;};'use strict';var _=require(_0xc56e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc56e('0x1'));var rs=require(_0xc56e('0x2'));var fs=require('fs');var Redis=require(_0xc56e('0x3'));var db=require(_0xc56e('0x4'))['db'];var utils=require(_0xc56e('0x5'));var logger=require(_0xc56e('0x6'))(_0xc56e('0x7'));var config=require(_0xc56e('0x8'));var jayson=require(_0xc56e('0x9'));var client=jayson['client'][_0xc56e('0xa')]({'port':0x232a});config[_0xc56e('0xb')]=_[_0xc56e('0xc')](config[_0xc56e('0xb')],{'host':_0xc56e('0xd'),'port':0x18eb});var socket=require(_0xc56e('0xe'))(new Redis(config[_0xc56e('0xb')]));require(_0xc56e('0xf'))['register'](socket);function respondWithRpcPromise(_0x45bafd,_0x3863a1,_0x1f0b92){return new BPromise(function(_0x2877b6,_0xf72cc5){return client[_0xc56e('0x10')](_0x45bafd,_0x1f0b92)[_0xc56e('0x11')](function(_0x487bb8){logger[_0xc56e('0x12')](_0xc56e('0x13'),_0x3863a1,_0xc56e('0x14'));logger['debug'](_0xc56e('0x15'),_0x3863a1,_0xc56e('0x14'),JSON[_0xc56e('0x16')](_0x487bb8));if(_0x487bb8[_0xc56e('0x17')]){if(_0x487bb8['error'][_0xc56e('0x18')]===0x1f4){logger[_0xc56e('0x17')](_0xc56e('0x13'),_0x3863a1,_0x487bb8[_0xc56e('0x17')][_0xc56e('0x19')]);return _0xf72cc5(_0x487bb8[_0xc56e('0x17')]['message']);}logger[_0xc56e('0x17')](_0xc56e('0x13'),_0x3863a1,_0x487bb8[_0xc56e('0x17')][_0xc56e('0x19')]);return _0x2877b6(_0x487bb8[_0xc56e('0x17')][_0xc56e('0x19')]);}else{logger['info'](_0xc56e('0x13'),_0x3863a1,_0xc56e('0x14'));_0x2877b6(_0x487bb8[_0xc56e('0x1a')]['message']);}})[_0xc56e('0x1b')](function(_0x3b5d8f){logger[_0xc56e('0x17')](_0xc56e('0x13'),_0x3863a1,_0x3b5d8f);_0xf72cc5(_0x3b5d8f);});});}exports[_0xc56e('0x1c')]=function(_0x514c6c){var _0x744e49=this;return new Promise(function(_0x7198a3,_0x554a1c){return db[_0xc56e('0x1d')][_0xc56e('0x1e')](_0x514c6c['body'],{'raw':_0x514c6c['options']?_0x514c6c[_0xc56e('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514c6c[_0xc56e('0x1f')]?_0x514c6c[_0xc56e('0x1f')][_0xc56e('0x20')]||null:null,'attributes':_0x514c6c[_0xc56e('0x1f')]?_0x514c6c[_0xc56e('0x1f')][_0xc56e('0x21')]||null:null,'limit':_0x514c6c[_0xc56e('0x1f')]?_0x514c6c[_0xc56e('0x1f')]['limit']||null:null})[_0xc56e('0x11')](function(_0x2de51c){logger[_0xc56e('0x12')]('UpdateChatInteraction',_0x514c6c);logger['debug'](_0xc56e('0x1c'),_0x514c6c,JSON[_0xc56e('0x16')](_0x2de51c));_0x7198a3(_0x2de51c);})[_0xc56e('0x1b')](function(_0x27add3){logger[_0xc56e('0x17')](_0xc56e('0x1c'),_0x27add3[_0xc56e('0x19')],_0x514c6c);_0x554a1c(_0x744e49[_0xc56e('0x17')](0x1f4,_0x27add3[_0xc56e('0x19')]));});});};exports[_0xc56e('0x22')]=function(_0x3def3e){return new Promise(function(_0x3c6c53,_0x5d20c5){return db[_0xc56e('0x1d')]['find']({'where':_0x3def3e[_0xc56e('0x1f')]?_0x3def3e[_0xc56e('0x1f')][_0xc56e('0x20')]||null:null})['then'](function(_0x1e518e){if(_0x1e518e){return _0x1e518e[_0xc56e('0x23')](_0x3def3e['body']['ids'],_[_0xc56e('0x24')](_0x3def3e[_0xc56e('0x25')],[_0xc56e('0x26'),'id'])||{});}})[_0xc56e('0x27')](function(_0x1df120){logger[_0xc56e('0x12')](_0xc56e('0x28'),_0x3def3e);logger[_0xc56e('0x29')](_0xc56e('0x28'),_0x3def3e,JSON[_0xc56e('0x16')](_0x1df120));_0x3c6c53(_0x1df120);})[_0xc56e('0x1b')](function(_0x3c88be){logger[_0xc56e('0x17')](_0xc56e('0x28'),_0x3c88be[_0xc56e('0x19')],_0x3def3e);_0x5d20c5(_this[_0xc56e('0x17')](0x1f4,_0x3c88be[_0xc56e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 2bd5168..8989238 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 _0xae5e=['emit','register','length','chatInteraction:','./chatInteraction.events','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xae5e,0x1d2));var _0xeae5=function(_0x5cf032,_0x55f08d){_0x5cf032=_0x5cf032-0x0;var _0x5d21d8=_0xae5e[_0x5cf032];return _0x5d21d8;};'use strict';var ChatInteractionEvents=require(_0xeae5('0x0'));var events=['save','remove',_0xeae5('0x1')];function createListener(_0x2ff580,_0x244d0a){return function(_0x5e4920){_0x244d0a[_0xeae5('0x2')](_0x2ff580,_0x5e4920);};}function removeListener(_0x51f89d,_0xefba31){return function(){ChatInteractionEvents['removeListener'](_0x51f89d,_0xefba31);};}exports[_0xeae5('0x3')]=function(_0x2b2391){for(var _0x4728dd=0x0,_0x471e8d=events[_0xeae5('0x4')];_0x4728dd<_0x471e8d;_0x4728dd++){var _0x4ba737=events[_0x4728dd];var _0x38b135=createListener(_0xeae5('0x5')+_0x4ba737,_0x2b2391);ChatInteractionEvents['on'](_0x4ba737,_0x38b135);}}; \ No newline at end of file +var _0x1f5c=['./chatInteraction.events','save','remove','update','emit','register','length','chatInteraction:'];(function(_0xdddc26,_0x3db7b4){var _0x26f844=function(_0x201eb6){while(--_0x201eb6){_0xdddc26['push'](_0xdddc26['shift']());}};_0x26f844(++_0x3db7b4);}(_0x1f5c,0xb0));var _0xc1f5=function(_0x431265,_0x20d088){_0x431265=_0x431265-0x0;var _0x4a4484=_0x1f5c[_0x431265];return _0x4a4484;};'use strict';var ChatInteractionEvents=require(_0xc1f5('0x0'));var events=[_0xc1f5('0x1'),_0xc1f5('0x2'),_0xc1f5('0x3')];function createListener(_0x493fd3,_0x147cd7){return function(_0x75190a){_0x147cd7[_0xc1f5('0x4')](_0x493fd3,_0x75190a);};}function removeListener(_0x5689ec,_0x43868b){return function(){ChatInteractionEvents['removeListener'](_0x5689ec,_0x43868b);};}exports[_0xc1f5('0x5')]=function(_0x2dce24){for(var _0x264f8d=0x0,_0x17910d=events[_0xc1f5('0x6')];_0x264f8d<_0x17910d;_0x264f8d++){var _0x45cd04=events[_0x264f8d];var _0x24a1df=createListener(_0xc1f5('0x7')+_0x45cd04,_0x2dce24);ChatInteractionEvents['on'](_0x45cd04,_0x24a1df);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 671e3ff..89d5d72 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 _0x4050=['tracked','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete'];(function(_0x315585,_0x1acf90){var _0x2d9542=function(_0x531ce8){while(--_0x531ce8){_0x315585['push'](_0x315585['shift']());}};_0x2d9542(++_0x1acf90);}(_0x4050,0x193));var _0x0405=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x4050[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0x0405('0x0'));var util=require(_0x0405('0x1'));var path=require(_0x0405('0x2'));var timeout=require('connect-timeout');var express=require(_0x0405('0x3'));var router=express['Router']();var fs_extra=require(_0x0405('0x4'));var auth=require(_0x0405('0x5'));var interaction=require(_0x0405('0x6'));var config=require(_0x0405('0x7'));var controller=require(_0x0405('0x8'));router[_0x0405('0x9')]('/',auth[_0x0405('0xa')](),controller[_0x0405('0xb')]);router[_0x0405('0x9')](_0x0405('0xc'),auth[_0x0405('0xa')](),controller[_0x0405('0xd')]);router[_0x0405('0x9')](_0x0405('0xe'),auth[_0x0405('0xf')](),controller[_0x0405('0x10')]);router[_0x0405('0x9')](_0x0405('0x11'),auth[_0x0405('0xf')](),controller[_0x0405('0x12')]);router[_0x0405('0x9')](_0x0405('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0405('0x9')](_0x0405('0x14'),auth[_0x0405('0xf')](),controller['getMyMessages']);router[_0x0405('0x9')]('/:id/download',auth[_0x0405('0xa')](),controller[_0x0405('0x15')]);router['post']('/',auth[_0x0405('0xa')](),controller[_0x0405('0x16')]);router[_0x0405('0x17')](_0x0405('0x18'),auth[_0x0405('0xa')](),controller[_0x0405('0x19')]);var upload=multer({'storage':multer[_0x0405('0x1a')]({'destination':function(_0x607fe5,_0x8bee71,_0x4cd34c){_0x4cd34c(null,path[_0x0405('0x1b')](config[_0x0405('0x1c')],_0x0405('0x1d')));},'filename':function(_0x35e1c8,_0x3dfc44,_0x4271e0){_0x4271e0(null,util[_0x0405('0x1e')](_0x0405('0x1f'),Date[_0x0405('0x20')](),_0x3dfc44[_0x0405('0x21')][_0x0405('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0405('0x17')](_0x0405('0x23'),upload[_0x0405('0x24')](_0x0405('0x25')),controller[_0x0405('0x26')]);router['post']('/:id/messages',auth[_0x0405('0xf')](),controller[_0x0405('0x27')]);router['post'](_0x0405('0x28'),auth['isAuthenticated'](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2a')),controller[_0x0405('0x2b')]);router[_0x0405('0x2c')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2d')),controller[_0x0405('0x2e')]);router[_0x0405('0x2c')](_0x0405('0x2f'),controller[_0x0405('0x30')]);router[_0x0405('0x2c')]('/:id/abandon',auth[_0x0405('0xf')](),controller[_0x0405('0x31')]);router[_0x0405('0x2c')](_0x0405('0x32'),controller[_0x0405('0x33')]);router[_0x0405('0x34')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction[_0x0405('0x35')](_0x0405('0x29'),_0x0405('0x36')),controller[_0x0405('0x37')]);router['delete'](_0x0405('0x28'),auth[_0x0405('0xa')](),controller[_0x0405('0x38')]);module['exports']=router; \ No newline at end of file +var _0x54be=['download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','originalname','single','addMessage','/:id/tags','chat','put','tracked','chatinteraction:update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x4a30b7,_0x3dabc8){var _0xe48f3c=function(_0x391568){while(--_0x391568){_0x4a30b7['push'](_0x4a30b7['shift']());}};_0xe48f3c(++_0x3dabc8);}(_0x54be,0x135));var _0xe54b=function(_0x3a8d90,_0xe96556){_0x3a8d90=_0x3a8d90-0x0;var _0x34fb54=_0x54be[_0x3a8d90];return _0x34fb54;};'use strict';var multer=require(_0xe54b('0x0'));var util=require(_0xe54b('0x1'));var path=require('path');var timeout=require(_0xe54b('0x2'));var express=require(_0xe54b('0x3'));var router=express['Router']();var fs_extra=require(_0xe54b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe54b('0x5'));var config=require(_0xe54b('0x6'));var controller=require(_0xe54b('0x7'));router[_0xe54b('0x8')]('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0xa')]);router[_0xe54b('0x8')]('/describe',auth[_0xe54b('0x9')](),controller['describe']);router['get'](_0xe54b('0xb'),auth[_0xe54b('0xc')](),controller[_0xe54b('0xd')]);router[_0xe54b('0x8')]('/:id/attachment_download',auth[_0xe54b('0xc')](),controller[_0xe54b('0xe')]);router[_0xe54b('0x8')](_0xe54b('0xf'),auth['isAuthenticated'](),controller[_0xe54b('0x10')]);router[_0xe54b('0x8')](_0xe54b('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe54b('0x12')]);router[_0xe54b('0x8')](_0xe54b('0x13'),auth[_0xe54b('0x9')](),controller[_0xe54b('0x14')]);router[_0xe54b('0x15')]('/',auth[_0xe54b('0x9')](),controller[_0xe54b('0x16')]);router[_0xe54b('0x15')](_0xe54b('0x17'),auth[_0xe54b('0x9')](),controller[_0xe54b('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5293cf,_0x52e7e0,_0x11c552){_0x11c552(null,path[_0xe54b('0x19')](config[_0xe54b('0x1a')],_0xe54b('0x1b')));},'filename':function(_0x4003ad,_0x521657,_0x4237b3){_0x4237b3(null,util[_0xe54b('0x1c')](_0xe54b('0x1d'),Date['now'](),_0x521657[_0xe54b('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe54b('0x15')]('/:id/attachment_upload',upload[_0xe54b('0x1f')]('file'),controller['attachmentUpload']);router[_0xe54b('0x15')](_0xe54b('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe54b('0x20')]);router[_0xe54b('0x15')](_0xe54b('0x21'),auth[_0xe54b('0x9')](),interaction['tracked'](_0xe54b('0x22'),'chatinteraction:addtags'),controller['addTags']);router[_0xe54b('0x23')](_0xe54b('0xb'),auth['isAuthenticated'](),interaction[_0xe54b('0x24')](_0xe54b('0x22'),_0xe54b('0x25')),controller['update']);router[_0xe54b('0x23')]('/:id/custom_update',controller[_0xe54b('0x26')]);router[_0xe54b('0x23')]('/:id/abandon',auth[_0xe54b('0xc')](),controller[_0xe54b('0x27')]);router[_0xe54b('0x23')](_0xe54b('0x28'),controller[_0xe54b('0x29')]);router['delete']('/:id',auth[_0xe54b('0x9')](),interaction[_0xe54b('0x24')]('chat',_0xe54b('0x2a')),controller[_0xe54b('0x2b')]);router[_0xe54b('0x2c')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe54b('0x2d')]);module[_0xe54b('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 96d902d..af27797 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 _0x8df1=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x158bbc,_0x56cba7){var _0x4b7f70=function(_0x1204f0){while(--_0x1204f0){_0x158bbc['push'](_0x158bbc['shift']());}};_0x4b7f70(++_0x56cba7);}(_0x8df1,0xe6));var _0x18df=function(_0x29bafa,_0x1f0f42){_0x29bafa=_0x29bafa-0x0;var _0x3c76d4=_0x8df1[_0x29bafa];return _0x3c76d4;};'use strict';var Sequelize=require(_0x18df('0x0'));module['exports']={'body':{'type':Sequelize[_0x18df('0x1')](_0x18df('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x18df('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2a76=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x2a76,0x96));var _0x62a7=function(_0x1cbc1b,_0x2a88fd){_0x1cbc1b=_0x1cbc1b-0x0;var _0x409acd=_0x2a76[_0x1cbc1b];return _0x409acd;};'use strict';var Sequelize=require(_0x62a7('0x0'));module[_0x62a7('0x1')]={'body':{'type':Sequelize[_0x62a7('0x2')](_0x62a7('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x62a7('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 31e3d2e..f6f52d6 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 _0xdce3=['map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','include','findAll','catch','params','keys','ChatInternalMessage','includeAll','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','agent','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','apply','reject','save','then','error','stack','name','send','index','rawAttributes','type','key','model'];(function(_0x113a7b,_0x3d8bae){var _0xa6fedf=function(_0x57f7a2){while(--_0x57f7a2){_0x113a7b['push'](_0x113a7b['shift']());}};_0xa6fedf(++_0x3d8bae);}(_0xdce3,0x1f0));var _0x3dce=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdce3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3dce('0x0'));var rimraf=require(_0x3dce('0x1'));var zipdir=require(_0x3dce('0x2'));var jsonpatch=require(_0x3dce('0x3'));var rp=require(_0x3dce('0x4'));var moment=require(_0x3dce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3dce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3dce('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dce('0x8'));var _=require(_0x3dce('0x9'));var squel=require('squel');var crypto=require(_0x3dce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3dce('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3dce('0xc'));var Papa=require(_0x3dce('0xd'));var Redis=require(_0x3dce('0xe'));var authService=require(_0x3dce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3dce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dce('0x11'))('api');var utils=require(_0x3dce('0x12'));var config=require(_0x3dce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3dce('0x14'))['db'];config['redis']=_[_0x3dce('0x15')](config['redis'],{'host':_0x3dce('0x16'),'port':0x18eb});var socket=require(_0x3dce('0x17'))(new Redis(config[_0x3dce('0x18')]));require(_0x3dce('0x19'))[_0x3dce('0x1a')](socket);function respondWithStatusCode(_0x42c56d,_0x545f79){_0x545f79=_0x545f79||0xcc;return function(_0x50ca7f){if(_0x50ca7f){return _0x42c56d[_0x3dce('0x1b')](_0x545f79);}return _0x42c56d['status'](_0x545f79)[_0x3dce('0x1c')]();};}function respondWithResult(_0x45efab,_0x4d29de){_0x4d29de=_0x4d29de||0xc8;return function(_0x57b445){if(_0x57b445){return _0x45efab['status'](_0x4d29de)[_0x3dce('0x1d')](_0x57b445);}};}function respondWithFilteredResult(_0x37e8c4,_0x26ce8b){return function(_0x553fd2){if(_0x553fd2){var _0x3758d0=typeof _0x26ce8b['offset']==='undefined'&&typeof _0x26ce8b[_0x3dce('0x1e')]===_0x3dce('0x1f');var _0x382bcd=_0x553fd2[_0x3dce('0x20')];var _0x16f7a1=_0x3758d0?0x0:_0x26ce8b[_0x3dce('0x21')];var _0x3bc9dd=_0x3758d0?_0x553fd2[_0x3dce('0x20')]:_0x26ce8b['offset']+_0x26ce8b[_0x3dce('0x1e')];var _0x55b532;if(_0x3bc9dd>=_0x382bcd){_0x3bc9dd=_0x382bcd;_0x55b532=0xc8;}else{_0x55b532=0xce;}_0x37e8c4[_0x3dce('0x22')](_0x55b532);return _0x37e8c4[_0x3dce('0x23')]('Content-Range',_0x16f7a1+'-'+_0x3bc9dd+'/'+_0x382bcd)[_0x3dce('0x1d')](_0x553fd2);}return null;};}function patchUpdates(_0x118da3){return function(_0x43ec82){try{jsonpatch[_0x3dce('0x24')](_0x43ec82,_0x118da3,!![]);}catch(_0x519a1b){return BPromise[_0x3dce('0x25')](_0x519a1b);}return _0x43ec82[_0x3dce('0x26')]();};}function saveUpdates(_0x190450,_0x5d2039){return function(_0x4d59e8){if(_0x4d59e8){return _0x4d59e8['update'](_0x190450)[_0x3dce('0x27')](function(_0x3be493){return _0x3be493;});}return null;};}function removeEntity(_0x32d306,_0x1a9c4a){return function(_0x33fd99){if(_0x33fd99){return _0x33fd99['destroy']()['then'](function(){_0x32d306[_0x3dce('0x22')](0xcc)[_0x3dce('0x1c')]();});}};}function handleEntityNotFound(_0x36842a,_0x539cba){return function(_0x3ec2e3){if(!_0x3ec2e3){_0x36842a[_0x3dce('0x1b')](0x194);}return _0x3ec2e3;};}function handleError(_0x537fe2,_0x3991df){_0x3991df=_0x3991df||0x1f4;return function(_0x2e93dd){logger[_0x3dce('0x28')](_0x2e93dd[_0x3dce('0x29')]);if(_0x2e93dd[_0x3dce('0x2a')]){delete _0x2e93dd[_0x3dce('0x2a')];}_0x537fe2['status'](_0x3991df)[_0x3dce('0x2b')](_0x2e93dd);};}exports[_0x3dce('0x2c')]=function(_0x50ad15,_0x35cb15){var _0x38ccf9={},_0x15d2ac={},_0x29bfad={'count':0x0,'rows':[]};var _0x1490b3=_['map'](db['ChatInternalMessage'][_0x3dce('0x2d')],function(_0x394c6f){return{'name':_0x394c6f['fieldName'],'type':_0x394c6f[_0x3dce('0x2e')][_0x3dce('0x2f')]};});_0x15d2ac[_0x3dce('0x30')]=_[_0x3dce('0x31')](_0x1490b3,_0x3dce('0x2a'));_0x15d2ac['query']=_['keys'](_0x50ad15[_0x3dce('0x32')]);_0x15d2ac['filters']=_['intersection'](_0x15d2ac[_0x3dce('0x30')],_0x15d2ac[_0x3dce('0x32')]);_0x38ccf9[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x15d2ac[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x50ad15['query'][_0x3dce('0x35')]));_0x38ccf9['attributes']=_0x38ccf9[_0x3dce('0x33')][_0x3dce('0x36')]?_0x38ccf9[_0x3dce('0x33')]:_0x15d2ac[_0x3dce('0x30')];if(!_0x50ad15[_0x3dce('0x32')][_0x3dce('0x37')](_0x3dce('0x38'))){_0x38ccf9[_0x3dce('0x1e')]=qs['limit'](_0x50ad15[_0x3dce('0x32')]['limit']);_0x38ccf9['offset']=qs[_0x3dce('0x21')](_0x50ad15[_0x3dce('0x32')][_0x3dce('0x21')]);}_0x38ccf9[_0x3dce('0x39')]=qs[_0x3dce('0x3a')](_0x50ad15['query'][_0x3dce('0x3a')]);_0x38ccf9['where']=qs[_0x3dce('0x3b')](_[_0x3dce('0x3c')](_0x50ad15[_0x3dce('0x32')],_0x15d2ac[_0x3dce('0x3b')]),_0x1490b3);if(_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]){_0x38ccf9[_0x3dce('0x3e')]=_['merge'](_0x38ccf9[_0x3dce('0x3e')],{'$or':_[_0x3dce('0x31')](_0x1490b3,function(_0x2c5254){if(_0x2c5254[_0x3dce('0x2e')]!==_0x3dce('0x3f')){var _0x12102d={};_0x12102d[_0x2c5254[_0x3dce('0x2a')]]={'$like':'%'+_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]+'%'};return _0x12102d;}})});}_0x38ccf9=_[_0x3dce('0x40')]({},_0x38ccf9,_0x50ad15['options']);var _0x10f05b={'where':_0x38ccf9[_0x3dce('0x3e')]};return db['ChatInternalMessage'][_0x3dce('0x20')](_0x10f05b)['then'](function(_0x570fae){_0x29bfad[_0x3dce('0x20')]=_0x570fae;if(_0x50ad15['query']['includeAll']){_0x38ccf9[_0x3dce('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3dce('0x42')](_0x38ccf9);})[_0x3dce('0x27')](function(_0x159019){_0x29bfad['rows']=_0x159019;return _0x29bfad;})[_0x3dce('0x27')](respondWithFilteredResult(_0x35cb15,_0x38ccf9))[_0x3dce('0x43')](handleError(_0x35cb15,null));};exports['show']=function(_0x52ad27,_0x35a6d4){var _0x1db8a0={'raw':!![],'where':{'id':_0x52ad27[_0x3dce('0x44')]['id']}},_0x304335={};_0x304335[_0x3dce('0x30')]=_[_0x3dce('0x45')](db[_0x3dce('0x46')][_0x3dce('0x2d')]);_0x304335[_0x3dce('0x32')]=_['keys'](_0x52ad27[_0x3dce('0x32')]);_0x304335['filters']=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],_0x304335[_0x3dce('0x32')]);_0x1db8a0[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x52ad27[_0x3dce('0x32')]['fields']));_0x1db8a0[_0x3dce('0x33')]=_0x1db8a0[_0x3dce('0x33')]['length']?_0x1db8a0[_0x3dce('0x33')]:_0x304335[_0x3dce('0x30')];if(_0x52ad27[_0x3dce('0x32')][_0x3dce('0x47')]){_0x1db8a0[_0x3dce('0x41')]=[{'all':!![]}];}_0x1db8a0=_[_0x3dce('0x40')]({},_0x1db8a0,_0x52ad27['options']);return db[_0x3dce('0x46')]['find'](_0x1db8a0)['then'](handleEntityNotFound(_0x35a6d4,null))[_0x3dce('0x27')](respondWithResult(_0x35a6d4,null))['catch'](handleError(_0x35a6d4,null));};exports['create']=function(_0x468c6d,_0x5ee469){return db['ChatInternalMessage'][_0x3dce('0x48')](_0x468c6d[_0x3dce('0x49')],{})[_0x3dce('0x27')](respondWithResult(_0x5ee469,0xc9))[_0x3dce('0x43')](handleError(_0x5ee469,null));};exports[_0x3dce('0x4a')]=function(_0x5abab2,_0x12e223){if(_0x5abab2['body']['id']){delete _0x5abab2[_0x3dce('0x49')]['id'];}return db['ChatInternalMessage'][_0x3dce('0x4b')]({'where':{'id':_0x5abab2[_0x3dce('0x44')]['id']}})['then'](handleEntityNotFound(_0x12e223,null))[_0x3dce('0x27')](saveUpdates(_0x5abab2[_0x3dce('0x49')],null))[_0x3dce('0x27')](respondWithResult(_0x12e223,null))[_0x3dce('0x43')](handleError(_0x12e223,null));};exports['destroy']=function(_0xb3a8d4,_0x91d567){return db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'id':_0xb3a8d4[_0x3dce('0x44')]['id']}})[_0x3dce('0x27')](handleEntityNotFound(_0x91d567,null))['then'](removeEntity(_0x91d567,null))['catch'](handleError(_0x91d567,null));};exports[_0x3dce('0x4c')]=function(_0x38f442,_0x5424f8){return db[_0x3dce('0x46')][_0x3dce('0x4c')]()['then'](respondWithResult(_0x5424f8,null))[_0x3dce('0x43')](handleError(_0x5424f8,null));};function wrapUser(_0x115969){return function(_0x225e34){var _0x49b1e6=_0x115969[_0x3dce('0x4d')]({'plain':!![]});_0x49b1e6[_0x3dce('0x4e')]=[];if(_0x225e34){_0x49b1e6[_0x3dce('0x4f')]=_0x225e34[_0x3dce('0x50')];_0x49b1e6[_0x3dce('0x51')]=_0x225e34;}else{_0x49b1e6[_0x3dce('0x4f')]=moment(0x0)[_0x3dce('0x52')](_0x3dce('0x53'));_0x49b1e6[_0x3dce('0x51')]={};}return _0x49b1e6;};}exports[_0x3dce('0x54')]=function(_0x48ab06,_0x5e1c69,_0xaf9aca){var _0x1dfba5=[];return db[_0x3dce('0x55')][_0x3dce('0x42')]({'where':{'role':['agent',_0x3dce('0x56'),'user']},'attributes':['id',_0x3dce('0x57'),_0x3dce('0x2a'),_0x3dce('0x58'),_0x3dce('0x59'),_0x3dce('0x5a'),_0x3dce('0x5b'),_0x3dce('0x5c'),_0x3dce('0x5d'),'showWebBar'],'order':qs['sort'](_0x3dce('0x5e')),'include':[{'model':db[_0x3dce('0x5f')],'as':_0x3dce('0x60'),'attributes':['id',_0x3dce('0x2a'),_0x3dce('0x2e')],'through':{'attributes':[]}}]})[_0x3dce('0x27')](function(_0x19dae0){if(_0x19dae0){var _0x532b54=_0x48ab06[_0x3dce('0x61')][_0x3dce('0x4d')]({'plain':!![]});if(!_0x532b54)throw new Error(_0x3dce('0x62'));if(_0x532b54[_0x3dce('0x58')]===_0x3dce('0x61')){return db['UserProfileSection'][_0x3dce('0x4b')]({'where':{'name':_0x3dce('0x63'),'userProfileId':_0x532b54[_0x3dce('0x64')]},'raw':!![]})['then'](function(_0x3804dc){if(_0x3804dc){if(_0x3804dc[_0x3dce('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3804dc['id']},'raw':!![]})[_0x3dce('0x27')](function(_0x262d83){var _0x1a6baa=[];if(_[_0x3dce('0x66')](_0x262d83)){_0x1a6baa=_[_0x3dce('0x3d')](_0x19dae0,function(_0x16bec9){if(_0x16bec9['role']!==_0x3dce('0x67')){return _0x16bec9;}});return _0x1a6baa;}else{for(var _0x139617=0x0;_0x139617<_0x19dae0[_0x3dce('0x36')];_0x139617++){var _0x53c9ab=_0x19dae0[_0x139617];if(_0x53c9ab[_0x3dce('0x58')]===_0x3dce('0x67')){var _0x4fabd5=_['find'](_0x262d83,function(_0x31680a){return _0x31680a['resourceId']===_0x53c9ab['id'];});if(_0x4fabd5)_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}else{_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}}return _0x1a6baa;}});}else{return _0x19dae0;}}else{var _0x3a9a91=_[_0x3dce('0x3d')](_0x19dae0,function(_0x592fda){if(_0x592fda[_0x3dce('0x58')]!==_0x3dce('0x67')){return _0x592fda;}});return _0x3a9a91;}});}else{return _0x19dae0;}}})[_0x3dce('0x27')](function(_0x3b5050){var _0x523e0a=[];if(_0x3b5050){_0x1dfba5=_0x3b5050;for(var _0x254851=0x0;_0x254851<_0x3b5050['length'];_0x254851+=0x1){_0x1dfba5[_0x254851][_0x3dce('0x4e')]=[];_0x523e0a['push'](db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'FromId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ToId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ChatGroupId':null},'attributes':['id',_0x3dce('0x50'),_0x3dce('0x69'),_0x3dce('0x6a'),'read',_0x3dce('0x49')],'order':qs[_0x3dce('0x3a')](_0x3dce('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3dce('0x27')](wrapUser(_0x3b5050[_0x254851])));}return BPromise[_0x3dce('0x6c')](_0x523e0a);}return[];})[_0x3dce('0x27')](function(_0x568b3a){return{'rows':_0x568b3a,'count':_0x568b3a[_0x3dce('0x36')]};})[_0x3dce('0x27')](respondWithResult(_0x5e1c69,null))[_0x3dce('0x43')](handleError(_0x5e1c69,null));}; \ No newline at end of file +var _0x56fc=['moment','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','name','send','index','fieldName','type','model','map','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','ChatInternalMessage','findAll','rows','show','rawAttributes','includeAll','options','find','catch','create','body','params','describe','messages','lastMessageAt','lastMessage','format','getUsers','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2a99ea,_0x1bfb13){var _0x5887ae=function(_0x55dfc2){while(--_0x55dfc2){_0x2a99ea['push'](_0x2a99ea['shift']());}};_0x5887ae(++_0x1bfb13);}(_0x56fc,0x64));var _0xc56f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x56fc[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xc56f('0x0'));var rimraf=require(_0xc56f('0x1'));var zipdir=require(_0xc56f('0x2'));var jsonpatch=require(_0xc56f('0x3'));var rp=require(_0xc56f('0x4'));var moment=require(_0xc56f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc56f('0x6'));var sox=require(_0xc56f('0x7'));var csv=require(_0xc56f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc56f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc56f('0xa'));var jsforce=require(_0xc56f('0xb'));var deskjs=require(_0xc56f('0xc'));var toCsv=require(_0xc56f('0x8'));var querystring=require(_0xc56f('0xd'));var Papa=require('papaparse');var Redis=require(_0xc56f('0xe'));var authService=require(_0xc56f('0xf'));var qs=require(_0xc56f('0x10'));var as=require(_0xc56f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc56f('0x12'))(_0xc56f('0x13'));var utils=require('../../config/utils');var config=require(_0xc56f('0x14'));var licenseUtil=require(_0xc56f('0x15'));var db=require('../../mysqldb')['db'];config[_0xc56f('0x16')]=_['defaults'](config['redis'],{'host':_0xc56f('0x17'),'port':0x18eb});var socket=require(_0xc56f('0x18'))(new Redis(config[_0xc56f('0x16')]));require(_0xc56f('0x19'))['register'](socket);function respondWithStatusCode(_0x5a0819,_0x4a2060){_0x4a2060=_0x4a2060||0xcc;return function(_0x593b87){if(_0x593b87){return _0x5a0819[_0xc56f('0x1a')](_0x4a2060);}return _0x5a0819[_0xc56f('0x1b')](_0x4a2060)[_0xc56f('0x1c')]();};}function respondWithResult(_0x42f51f,_0x575ac2){_0x575ac2=_0x575ac2||0xc8;return function(_0x1ed946){if(_0x1ed946){return _0x42f51f[_0xc56f('0x1b')](_0x575ac2)[_0xc56f('0x1d')](_0x1ed946);}};}function respondWithFilteredResult(_0x2a9fe7,_0x43b3dd){return function(_0x45f5ec){if(_0x45f5ec){var _0x3d3b22=typeof _0x43b3dd['offset']===_0xc56f('0x1e')&&typeof _0x43b3dd[_0xc56f('0x1f')]===_0xc56f('0x1e');var _0x44b06d=_0x45f5ec[_0xc56f('0x20')];var _0x3a95b8=_0x3d3b22?0x0:_0x43b3dd[_0xc56f('0x21')];var _0x2e1056=_0x3d3b22?_0x45f5ec[_0xc56f('0x20')]:_0x43b3dd[_0xc56f('0x21')]+_0x43b3dd[_0xc56f('0x1f')];var _0x3ff1a0;if(_0x2e1056>=_0x44b06d){_0x2e1056=_0x44b06d;_0x3ff1a0=0xc8;}else{_0x3ff1a0=0xce;}_0x2a9fe7['status'](_0x3ff1a0);return _0x2a9fe7[_0xc56f('0x22')](_0xc56f('0x23'),_0x3a95b8+'-'+_0x2e1056+'/'+_0x44b06d)[_0xc56f('0x1d')](_0x45f5ec);}return null;};}function patchUpdates(_0x1e4d9a){return function(_0x3b453c){try{jsonpatch[_0xc56f('0x24')](_0x3b453c,_0x1e4d9a,!![]);}catch(_0x558994){return BPromise[_0xc56f('0x25')](_0x558994);}return _0x3b453c['save']();};}function saveUpdates(_0x579e32,_0x19d76a){return function(_0x413a76){if(_0x413a76){return _0x413a76[_0xc56f('0x26')](_0x579e32)['then'](function(_0x60f98f){return _0x60f98f;});}return null;};}function removeEntity(_0x2973b4,_0x52e8a7){return function(_0x9ad259){if(_0x9ad259){return _0x9ad259[_0xc56f('0x27')]()[_0xc56f('0x28')](function(){_0x2973b4[_0xc56f('0x1b')](0xcc)[_0xc56f('0x1c')]();});}};}function handleEntityNotFound(_0xe9fb21,_0x3182c6){return function(_0x2c0d1d){if(!_0x2c0d1d){_0xe9fb21[_0xc56f('0x1a')](0x194);}return _0x2c0d1d;};}function handleError(_0x25a839,_0x1fcc4c){_0x1fcc4c=_0x1fcc4c||0x1f4;return function(_0xcdaf4e){logger['error'](_0xcdaf4e['stack']);if(_0xcdaf4e[_0xc56f('0x29')]){delete _0xcdaf4e[_0xc56f('0x29')];}_0x25a839['status'](_0x1fcc4c)[_0xc56f('0x2a')](_0xcdaf4e);};}exports[_0xc56f('0x2b')]=function(_0x56dc2c,_0x5c3044){var _0x3aa79c={},_0x2c6b41={},_0x45f73d={'count':0x0,'rows':[]};var _0x140d9b=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x257aad){return{'name':_0x257aad[_0xc56f('0x2c')],'type':_0x257aad[_0xc56f('0x2d')]['key']};});_0x2c6b41[_0xc56f('0x2e')]=_[_0xc56f('0x2f')](_0x140d9b,'name');_0x2c6b41['query']=_[_0xc56f('0x30')](_0x56dc2c['query']);_0x2c6b41[_0xc56f('0x31')]=_[_0xc56f('0x32')](_0x2c6b41[_0xc56f('0x2e')],_0x2c6b41['query']);_0x3aa79c[_0xc56f('0x33')]=_['intersection'](_0x2c6b41['model'],qs['fields'](_0x56dc2c[_0xc56f('0x34')][_0xc56f('0x35')]));_0x3aa79c[_0xc56f('0x33')]=_0x3aa79c[_0xc56f('0x33')][_0xc56f('0x36')]?_0x3aa79c[_0xc56f('0x33')]:_0x2c6b41[_0xc56f('0x2e')];if(!_0x56dc2c[_0xc56f('0x34')][_0xc56f('0x37')](_0xc56f('0x38'))){_0x3aa79c[_0xc56f('0x1f')]=qs['limit'](_0x56dc2c['query']['limit']);_0x3aa79c[_0xc56f('0x21')]=qs[_0xc56f('0x21')](_0x56dc2c[_0xc56f('0x34')][_0xc56f('0x21')]);}_0x3aa79c[_0xc56f('0x39')]=qs['sort'](_0x56dc2c['query'][_0xc56f('0x3a')]);_0x3aa79c[_0xc56f('0x3b')]=qs['filters'](_['pick'](_0x56dc2c['query'],_0x2c6b41['filters']),_0x140d9b);if(_0x56dc2c[_0xc56f('0x34')][_0xc56f('0x3c')]){_0x3aa79c[_0xc56f('0x3b')]=_[_0xc56f('0x3d')](_0x3aa79c[_0xc56f('0x3b')],{'$or':_[_0xc56f('0x2f')](_0x140d9b,function(_0x3f27fd){if(_0x3f27fd[_0xc56f('0x2d')]!=='VIRTUAL'){var _0x4e2935={};_0x4e2935[_0x3f27fd[_0xc56f('0x29')]]={'$like':'%'+_0x56dc2c[_0xc56f('0x34')][_0xc56f('0x3c')]+'%'};return _0x4e2935;}})});}_0x3aa79c=_[_0xc56f('0x3d')]({},_0x3aa79c,_0x56dc2c['options']);var _0x2dbb8c={'where':_0x3aa79c[_0xc56f('0x3b')]};return db[_0xc56f('0x3e')][_0xc56f('0x20')](_0x2dbb8c)[_0xc56f('0x28')](function(_0x4e94b9){_0x45f73d[_0xc56f('0x20')]=_0x4e94b9;if(_0x56dc2c[_0xc56f('0x34')]['includeAll']){_0x3aa79c['include']=[{'all':!![]}];}return db[_0xc56f('0x3e')][_0xc56f('0x3f')](_0x3aa79c);})[_0xc56f('0x28')](function(_0x3ecf44){_0x45f73d[_0xc56f('0x40')]=_0x3ecf44;return _0x45f73d;})[_0xc56f('0x28')](respondWithFilteredResult(_0x5c3044,_0x3aa79c))['catch'](handleError(_0x5c3044,null));};exports[_0xc56f('0x41')]=function(_0x32ee73,_0x4abeba){var _0x258786={'raw':!![],'where':{'id':_0x32ee73['params']['id']}},_0x5d7072={};_0x5d7072['model']=_[_0xc56f('0x30')](db[_0xc56f('0x3e')][_0xc56f('0x42')]);_0x5d7072[_0xc56f('0x34')]=_[_0xc56f('0x30')](_0x32ee73[_0xc56f('0x34')]);_0x5d7072[_0xc56f('0x31')]=_['intersection'](_0x5d7072[_0xc56f('0x2e')],_0x5d7072[_0xc56f('0x34')]);_0x258786[_0xc56f('0x33')]=_[_0xc56f('0x32')](_0x5d7072[_0xc56f('0x2e')],qs[_0xc56f('0x35')](_0x32ee73[_0xc56f('0x34')]['fields']));_0x258786[_0xc56f('0x33')]=_0x258786[_0xc56f('0x33')][_0xc56f('0x36')]?_0x258786[_0xc56f('0x33')]:_0x5d7072[_0xc56f('0x2e')];if(_0x32ee73[_0xc56f('0x34')][_0xc56f('0x43')]){_0x258786['include']=[{'all':!![]}];}_0x258786=_[_0xc56f('0x3d')]({},_0x258786,_0x32ee73[_0xc56f('0x44')]);return db[_0xc56f('0x3e')][_0xc56f('0x45')](_0x258786)[_0xc56f('0x28')](handleEntityNotFound(_0x4abeba,null))['then'](respondWithResult(_0x4abeba,null))[_0xc56f('0x46')](handleError(_0x4abeba,null));};exports[_0xc56f('0x47')]=function(_0x562ca5,_0x1a59b9){return db[_0xc56f('0x3e')]['create'](_0x562ca5['body'],{})[_0xc56f('0x28')](respondWithResult(_0x1a59b9,0xc9))[_0xc56f('0x46')](handleError(_0x1a59b9,null));};exports['update']=function(_0x8bb9bc,_0x18b0ca){if(_0x8bb9bc[_0xc56f('0x48')]['id']){delete _0x8bb9bc[_0xc56f('0x48')]['id'];}return db['ChatInternalMessage'][_0xc56f('0x45')]({'where':{'id':_0x8bb9bc['params']['id']}})['then'](handleEntityNotFound(_0x18b0ca,null))[_0xc56f('0x28')](saveUpdates(_0x8bb9bc[_0xc56f('0x48')],null))[_0xc56f('0x28')](respondWithResult(_0x18b0ca,null))['catch'](handleError(_0x18b0ca,null));};exports[_0xc56f('0x27')]=function(_0x159a28,_0x120a6a){return db['ChatInternalMessage']['find']({'where':{'id':_0x159a28[_0xc56f('0x49')]['id']}})[_0xc56f('0x28')](handleEntityNotFound(_0x120a6a,null))[_0xc56f('0x28')](removeEntity(_0x120a6a,null))['catch'](handleError(_0x120a6a,null));};exports[_0xc56f('0x4a')]=function(_0x5efb31,_0x3d2fe2){return db['ChatInternalMessage'][_0xc56f('0x4a')]()['then'](respondWithResult(_0x3d2fe2,null))[_0xc56f('0x46')](handleError(_0x3d2fe2,null));};function wrapUser(_0x130e90){return function(_0x43de34){var _0xdd1dd6=_0x130e90['get']({'plain':!![]});_0xdd1dd6[_0xc56f('0x4b')]=[];if(_0x43de34){_0xdd1dd6[_0xc56f('0x4c')]=_0x43de34['createdAt'];_0xdd1dd6[_0xc56f('0x4d')]=_0x43de34;}else{_0xdd1dd6['lastMessageAt']=moment(0x0)[_0xc56f('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0xdd1dd6['lastMessage']={};}return _0xdd1dd6;};}exports[_0xc56f('0x4f')]=function(_0x4060fc,_0x19d207,_0x10ea10){var _0x7d9b1b=[];return db['User'][_0xc56f('0x3f')]({'where':{'role':[_0xc56f('0x50'),'admin',_0xc56f('0x51')]},'attributes':['id',_0xc56f('0x52'),_0xc56f('0x29'),_0xc56f('0x53'),_0xc56f('0x54'),_0xc56f('0x55'),_0xc56f('0x56'),_0xc56f('0x57'),_0xc56f('0x58'),'showWebBar'],'order':qs[_0xc56f('0x3a')](_0xc56f('0x59')),'include':[{'model':db[_0xc56f('0x5a')],'as':_0xc56f('0x5b'),'attributes':['id',_0xc56f('0x29'),_0xc56f('0x2d')],'through':{'attributes':[]}}]})[_0xc56f('0x28')](function(_0x81bb9f){if(_0x81bb9f){var _0x2ef31b=_0x4060fc['user'][_0xc56f('0x5c')]({'plain':!![]});if(!_0x2ef31b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ef31b['role']==='user'){return db['UserProfileSection'][_0xc56f('0x45')]({'where':{'name':_0xc56f('0x5d'),'userProfileId':_0x2ef31b[_0xc56f('0x5e')]},'raw':!![]})['then'](function(_0x45fc05){if(_0x45fc05){if(_0x45fc05['autoAssociation']===0x0){return db[_0xc56f('0x5f')][_0xc56f('0x3f')]({'where':{'sectionId':_0x45fc05['id']},'raw':!![]})[_0xc56f('0x28')](function(_0xec96fd){var _0x10a98b=[];if(_[_0xc56f('0x60')](_0xec96fd)){_0x10a98b=_[_0xc56f('0x3c')](_0x81bb9f,function(_0x19396b){if(_0x19396b['role']!=='agent'){return _0x19396b;}});return _0x10a98b;}else{for(var _0x523e09=0x0;_0x523e09<_0x81bb9f[_0xc56f('0x36')];_0x523e09++){var _0x53cb8d=_0x81bb9f[_0x523e09];if(_0x53cb8d['role']===_0xc56f('0x50')){var _0x41baad=_[_0xc56f('0x45')](_0xec96fd,function(_0x21b58b){return _0x21b58b[_0xc56f('0x61')]===_0x53cb8d['id'];});if(_0x41baad)_0x10a98b[_0xc56f('0x62')](_0x53cb8d);}else{_0x10a98b[_0xc56f('0x62')](_0x53cb8d);}}return _0x10a98b;}});}else{return _0x81bb9f;}}else{var _0xec4389=_['filter'](_0x81bb9f,function(_0x3c8055){if(_0x3c8055[_0xc56f('0x53')]!==_0xc56f('0x50')){return _0x3c8055;}});return _0xec4389;}});}else{return _0x81bb9f;}}})[_0xc56f('0x28')](function(_0xabdd57){var _0x3f0d84=[];if(_0xabdd57){_0x7d9b1b=_0xabdd57;for(var _0xf2451d=0x0;_0xf2451d<_0xabdd57[_0xc56f('0x36')];_0xf2451d+=0x1){_0x7d9b1b[_0xf2451d][_0xc56f('0x4b')]=[];_0x3f0d84['push'](db[_0xc56f('0x3e')]['find']({'where':{'FromId':[_0x4060fc[_0xc56f('0x51')]['id'],_0xabdd57[_0xf2451d]['id']],'ToId':[_0x4060fc['user']['id'],_0xabdd57[_0xf2451d]['id']],'ChatGroupId':null},'attributes':['id',_0xc56f('0x63'),_0xc56f('0x64'),_0xc56f('0x65'),_0xc56f('0x66'),'body'],'order':qs[_0xc56f('0x3a')](_0xc56f('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xabdd57[_0xf2451d])));}return BPromise[_0xc56f('0x68')](_0x3f0d84);}return[];})['then'](function(_0x5c85e8){return{'rows':_0x5c85e8,'count':_0x5c85e8[_0xc56f('0x36')]};})[_0xc56f('0x28')](respondWithResult(_0x19d207,null))[_0xc56f('0x46')](handleError(_0x19d207,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9a26020..45db35e 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 _0xed61=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed61,0x7e));var _0x1ed6=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0xed61[_0xd73d53];return _0x560148;};'use strict';var EventEmitter=require(_0x1ed6('0x0'));var ChatInternalMessage=require(_0x1ed6('0x1'))['db'][_0x1ed6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1ed6('0x3')](0x0);var events={'afterCreate':_0x1ed6('0x4'),'afterUpdate':_0x1ed6('0x5'),'afterDestroy':_0x1ed6('0x6')};function emitEvent(_0x9f07a6){return function(_0x2bf8fb,_0x4f4687,_0x5e4458){ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6+':'+_0x2bf8fb['id'],_0x2bf8fb);ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6,_0x2bf8fb);_0x5e4458(null);};}for(var e in events){if(events[_0x1ed6('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1ed6('0x9')](e,emitEvent(event));}}module[_0x1ed6('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbc5f=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','exports'];(function(_0x40c2b2,_0x91bd6e){var _0x35e372=function(_0x4e03ce){while(--_0x4e03ce){_0x40c2b2['push'](_0x40c2b2['shift']());}};_0x35e372(++_0x91bd6e);}(_0xbc5f,0x120));var _0xfbc5=function(_0x4ef730,_0x1b0eeb){_0x4ef730=_0x4ef730-0x0;var _0x2e24fe=_0xbc5f[_0x4ef730];return _0x2e24fe;};'use strict';var EventEmitter=require(_0xfbc5('0x0'));var ChatInternalMessage=require(_0xfbc5('0x1'))['db'][_0xfbc5('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfbc5('0x3')](0x0);var events={'afterCreate':_0xfbc5('0x4'),'afterUpdate':_0xfbc5('0x5'),'afterDestroy':_0xfbc5('0x6')};function emitEvent(_0x2ecc73){return function(_0x1ce74a,_0x3da70a,_0x106a6d){ChatInternalMessageEvents[_0xfbc5('0x7')](_0x2ecc73+':'+_0x1ce74a['id'],_0x1ce74a);ChatInternalMessageEvents['emit'](_0x2ecc73,_0x1ce74a);_0x106a6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xfbc5('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 44d7e40..1ae3e42 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 _0xe136=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xe136,0xd6));var _0x6e13=function(_0x459fee,_0x568ca0){_0x459fee=_0x459fee-0x0;var _0x7ba8e3=_0xe136[_0x459fee];return _0x7ba8e3;};'use strict';var _=require(_0x6e13('0x0'));var util=require(_0x6e13('0x1'));var logger=require('../../config/logger')(_0x6e13('0x2'));var moment=require(_0x6e13('0x3'));var BPromise=require(_0x6e13('0x4'));var rp=require(_0x6e13('0x5'));var fs=require('fs');var path=require(_0x6e13('0x6'));var rimraf=require('rimraf');var config=require(_0x6e13('0x7'));var attributes=require(_0x6e13('0x8'));module[_0x6e13('0x9')]=function(_0x31abfa,_0x6db7fd){return _0x31abfa['define'](_0x6e13('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e13('0xb'),'collate':_0x6e13('0xc')});}; \ No newline at end of file +var _0x6e39=['api','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x51b6c4,_0x496a07){var _0x2a563d=function(_0x409288){while(--_0x409288){_0x51b6c4['push'](_0x51b6c4['shift']());}};_0x2a563d(++_0x496a07);}(_0x6e39,0x15e));var _0x96e3=function(_0x45f616,_0x25f951){_0x45f616=_0x45f616-0x0;var _0x52562b=_0x6e39[_0x45f616];return _0x52562b;};'use strict';var _=require('lodash');var util=require(_0x96e3('0x0'));var logger=require(_0x96e3('0x1'))(_0x96e3('0x2'));var moment=require('moment');var BPromise=require(_0x96e3('0x3'));var rp=require(_0x96e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x96e3('0x5'));var attributes=require(_0x96e3('0x6'));module[_0x96e3('0x7')]=function(_0x1fcc3a,_0x61868c){return _0x1fcc3a[_0x96e3('0x8')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96e3('0x9'),'collate':_0x96e3('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index eec43e7..4a4395a 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 _0xfe6a=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xfe6a,0x16c));var _0xafe6=function(_0x5d2c6c,_0x33e6f5){_0x5d2c6c=_0x5d2c6c-0x0;var _0x4bb774=_0xfe6a[_0x5d2c6c];return _0x4bb774;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var moment=require(_0xafe6('0x2'));var BPromise=require('bluebird');var rs=require(_0xafe6('0x3'));var fs=require('fs');var Redis=require(_0xafe6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafe6('0x5'));var logger=require(_0xafe6('0x6'))(_0xafe6('0x7'));var config=require(_0xafe6('0x8'));var jayson=require(_0xafe6('0x9'));var client=jayson[_0xafe6('0xa')][_0xafe6('0xb')]({'port':0x232a});config[_0xafe6('0xc')]=_[_0xafe6('0xd')](config['redis'],{'host':_0xafe6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafe6('0xc')]));require(_0xafe6('0xf'))['register'](socket);function respondWithRpcPromise(_0x52ea92,_0xfe2a6e,_0x272cc3){return new BPromise(function(_0x5e3db2,_0x2e2f6a){return client[_0xafe6('0x10')](_0x52ea92,_0x272cc3)[_0xafe6('0x11')](function(_0x7aaac4){logger['info'](_0xafe6('0x12'),_0xfe2a6e,_0xafe6('0x13'));logger['debug'](_0xafe6('0x14'),_0xfe2a6e,_0xafe6('0x13'),JSON['stringify'](_0x7aaac4));if(_0x7aaac4[_0xafe6('0x15')]){if(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x16')]===0x1f4){logger['error'](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')]['message']);return _0x2e2f6a(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);return _0x5e3db2(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}else{logger[_0xafe6('0x18')](_0xafe6('0x12'),_0xfe2a6e,'request\x20sent');_0x5e3db2(_0x7aaac4[_0xafe6('0x19')]['message']);}})['catch'](function(_0x3bca7a){logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x3bca7a);_0x2e2f6a(_0x3bca7a);});});} \ No newline at end of file +var _0x8250=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x464493,_0x3ac700){var _0x4f0097=function(_0x1458c8){while(--_0x1458c8){_0x464493['push'](_0x464493['shift']());}};_0x4f0097(++_0x3ac700);}(_0x8250,0xfa));var _0x0825=function(_0x1df170,_0x5b9a15){_0x1df170=_0x1df170-0x0;var _0x38d4df=_0x8250[_0x1df170];return _0x38d4df;};'use strict';var _=require(_0x0825('0x0'));var util=require(_0x0825('0x1'));var moment=require(_0x0825('0x2'));var BPromise=require(_0x0825('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0825('0x4'));var db=require(_0x0825('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0825('0x6'))('rpc');var config=require(_0x0825('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0825('0x8')][_0x0825('0x9')]({'port':0x232a});config[_0x0825('0xa')]=_['defaults'](config[_0x0825('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0825('0xb'))(new Redis(config[_0x0825('0xa')]));require(_0x0825('0xc'))[_0x0825('0xd')](socket);function respondWithRpcPromise(_0xf1e504,_0x4adf19,_0x1e627d){return new BPromise(function(_0x5f3a3d,_0x470501){return client[_0x0825('0xe')](_0xf1e504,_0x1e627d)[_0x0825('0xf')](function(_0x5b2821){logger[_0x0825('0x10')](_0x0825('0x11'),_0x4adf19,'request\x20sent');logger[_0x0825('0x12')](_0x0825('0x13'),_0x4adf19,_0x0825('0x14'),JSON[_0x0825('0x15')](_0x5b2821));if(_0x5b2821[_0x0825('0x16')]){if(_0x5b2821[_0x0825('0x16')][_0x0825('0x17')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4adf19,_0x5b2821['error'][_0x0825('0x18')]);return _0x470501(_0x5b2821['error'][_0x0825('0x18')]);}logger[_0x0825('0x16')](_0x0825('0x11'),_0x4adf19,_0x5b2821[_0x0825('0x16')][_0x0825('0x18')]);return _0x5f3a3d(_0x5b2821['error']['message']);}else{logger[_0x0825('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4adf19,'request\x20sent');_0x5f3a3d(_0x5b2821[_0x0825('0x19')][_0x0825('0x18')]);}})[_0x0825('0x1a')](function(_0xae7b83){logger[_0x0825('0x16')](_0x0825('0x11'),_0x4adf19,_0xae7b83);_0x470501(_0xae7b83);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 70f24ee..e973f69 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 _0x56e8=['remove','emit','register','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5a8cb8,_0x4fb918){var _0xa5d455=function(_0x1ab326){while(--_0x1ab326){_0x5a8cb8['push'](_0x5a8cb8['shift']());}};_0xa5d455(++_0x4fb918);}(_0x56e8,0x184));var _0x856e=function(_0x5e6966,_0x985401){_0x5e6966=_0x5e6966-0x0;var _0x5409f2=_0x56e8[_0x5e6966];return _0x5409f2;};'use strict';var ChatInternalMessageEvents=require(_0x856e('0x0'));var events=[_0x856e('0x1'),_0x856e('0x2'),'update'];function createListener(_0x9d8f4e,_0x5899a9){return function(_0x29a139){_0x5899a9[_0x856e('0x3')](_0x9d8f4e,_0x29a139);};}function removeListener(_0x3a2890,_0x16b044){return function(){ChatInternalMessageEvents['removeListener'](_0x3a2890,_0x16b044);};}exports[_0x856e('0x4')]=function(_0x771474){for(var _0x5143f3=0x0,_0x436cff=events['length'];_0x5143f3<_0x436cff;_0x5143f3++){var _0x56f66f=events[_0x5143f3];var _0x5ec70c=createListener(_0x856e('0x5')+_0x56f66f,_0x771474);ChatInternalMessageEvents['on'](_0x56f66f,_0x5ec70c);}}; \ No newline at end of file +var _0x4f5e=['chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x4f5e,0xd9));var _0xe4f5=function(_0x2dd885,_0x539fc2){_0x2dd885=_0x2dd885-0x0;var _0x2bbc94=_0x4f5e[_0x2dd885];return _0x2bbc94;};'use strict';var ChatInternalMessageEvents=require(_0xe4f5('0x0'));var events=[_0xe4f5('0x1'),'remove',_0xe4f5('0x2')];function createListener(_0x3aa853,_0x2c3755){return function(_0x26e534){_0x2c3755[_0xe4f5('0x3')](_0x3aa853,_0x26e534);};}function removeListener(_0x493b05,_0x3c9609){return function(){ChatInternalMessageEvents[_0xe4f5('0x4')](_0x493b05,_0x3c9609);};}exports['register']=function(_0x48d85f){for(var _0x1594dc=0x0,_0x3c167c=events['length'];_0x1594dc<_0x3c167c;_0x1594dc++){var _0x8788b6=events[_0x1594dc];var _0x2c1d76=createListener(_0xe4f5('0x5')+_0x8788b6,_0x48d85f);ChatInternalMessageEvents['on'](_0x8788b6,_0x2c1d76);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 383bbfe..5ba8afd 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 _0x74be=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x58ef68,_0x275204){var _0x169a7f=function(_0x479c79){while(--_0x479c79){_0x58ef68['push'](_0x58ef68['shift']());}};_0x169a7f(++_0x275204);}(_0x74be,0xd7));var _0xe74b=function(_0x596496,_0x57a567){_0x596496=_0x596496-0x0;var _0x5f0acd=_0x74be[_0x596496];return _0x5f0acd;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require('path');var timeout=require(_0xe74b('0x1'));var express=require(_0xe74b('0x2'));var router=express[_0xe74b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x4'));var interaction=require(_0xe74b('0x5'));var config=require(_0xe74b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe74b('0x7')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x9')]);router[_0xe74b('0x7')](_0xe74b('0xa'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xb')]);router['get']('/users',auth[_0xe74b('0x8')](),controller[_0xe74b('0xc')]);router[_0xe74b('0x7')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xe')]);router[_0xe74b('0xf')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x10')]);router[_0xe74b('0x11')](_0xe74b('0xd'),controller['update']);router[_0xe74b('0x12')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller['destroy']);module[_0xe74b('0x13')]=router; \ No newline at end of file +var _0xfaa9=['get','isAuthenticated','index','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x53ef61,_0x44cda6){var _0x4e4207=function(_0x50af1b){while(--_0x50af1b){_0x53ef61['push'](_0x53ef61['shift']());}};_0x4e4207(++_0x44cda6);}(_0xfaa9,0x177));var _0x9faa=function(_0x20d667,_0x39d534){_0x20d667=_0x20d667-0x0;var _0x5b76cd=_0xfaa9[_0x20d667];return _0x5b76cd;};'use strict';var multer=require('multer');var util=require(_0x9faa('0x0'));var path=require(_0x9faa('0x1'));var timeout=require(_0x9faa('0x2'));var express=require(_0x9faa('0x3'));var router=express['Router']();var fs_extra=require(_0x9faa('0x4'));var auth=require(_0x9faa('0x5'));var interaction=require(_0x9faa('0x6'));var config=require(_0x9faa('0x7'));var controller=require(_0x9faa('0x8'));router[_0x9faa('0x9')]('/',auth[_0x9faa('0xa')](),controller[_0x9faa('0xb')]);router[_0x9faa('0x9')]('/describe',auth[_0x9faa('0xa')](),controller[_0x9faa('0xc')]);router[_0x9faa('0x9')](_0x9faa('0xd'),auth[_0x9faa('0xa')](),controller[_0x9faa('0xe')]);router[_0x9faa('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9faa('0xf')]);router[_0x9faa('0x10')]('/',auth[_0x9faa('0xa')](),controller[_0x9faa('0x11')]);router[_0x9faa('0x12')](_0x9faa('0x13'),controller[_0x9faa('0x14')]);router[_0x9faa('0x15')]('/:id',auth[_0x9faa('0xa')](),controller[_0x9faa('0x16')]);module[_0x9faa('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 572ace6..0e75185 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 _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x488db3,_0x4a5cae){var _0x358b3c=function(_0x4b3fcf){while(--_0x4b3fcf){_0x488db3['push'](_0x488db3['shift']());}};_0x358b3c(++_0x4a5cae);}(_0x7462,0x165));var _0x2746=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0x7462[_0x349a9e];return _0x24c207;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}}; \ No newline at end of file +var _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x56770b,_0x3be08a){var _0x1da57a=function(_0x2113a1){while(--_0x2113a1){_0x56770b['push'](_0x56770b['shift']());}};_0x1da57a(++_0x3be08a);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xbbdd[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 16a10f6..0da5db8 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 _0xd5a4=['get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','undefined','limit','count','offset','set','apply','destroy','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','where','pick','filter','VIRTUAL','merge','ChatMessage','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x255737,_0x23d57a){var _0x3e3310=function(_0x24da7a){while(--_0x24da7a){_0x255737['push'](_0x255737['shift']());}};_0x3e3310(++_0x23d57a);}(_0xd5a4,0x125));var _0x4d5a=function(_0x329dfd,_0x8b20c7){_0x329dfd=_0x329dfd-0x0;var _0x4ded23=_0xd5a4[_0x329dfd];return _0x4ded23;};'use strict';var emlformat=require(_0x4d5a('0x0'));var rimraf=require(_0x4d5a('0x1'));var zipdir=require(_0x4d5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d5a('0x3'));var moment=require(_0x4d5a('0x4'));var BPromise=require(_0x4d5a('0x5'));var Mustache=require(_0x4d5a('0x6'));var util=require('util');var path=require(_0x4d5a('0x7'));var sox=require(_0x4d5a('0x8'));var csv=require(_0x4d5a('0x9'));var ejs=require(_0x4d5a('0xa'));var fs=require('fs');var fs_extra=require(_0x4d5a('0xb'));var _=require(_0x4d5a('0xc'));var squel=require(_0x4d5a('0xd'));var crypto=require(_0x4d5a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d5a('0x9'));var querystring=require(_0x4d5a('0xf'));var Papa=require(_0x4d5a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d5a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5a('0x12'))(_0x4d5a('0x13'));var utils=require('../../config/utils');var config=require(_0x4d5a('0x14'));var licenseUtil=require(_0x4d5a('0x15'));var db=require(_0x4d5a('0x16'))['db'];config['redis']=_['defaults'](config[_0x4d5a('0x17')],{'host':_0x4d5a('0x18'),'port':0x18eb});var socket=require(_0x4d5a('0x19'))(new Redis(config[_0x4d5a('0x17')]));require(_0x4d5a('0x1a'))[_0x4d5a('0x1b')](socket);var jayson=require(_0x4d5a('0x1c'));var client=jayson[_0x4d5a('0x1d')][_0x4d5a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4d5a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2e2c59,_0x57d142,_0x2cb642,_0x332dae){return new BPromise(function(_0x395e2b,_0x266280){var _0x526a75=_0x332dae||client;return _0x526a75[_0x4d5a('0x1f')](_0x2e2c59,_0x2cb642)[_0x4d5a('0x20')](function(_0x572349){logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));logger[_0x4d5a('0x24')](_0x4d5a('0x25'),_0x57d142,_0x4d5a('0x23'),JSON[_0x4d5a('0x26')](_0x572349));if(_0x572349['error']){if(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x28')]===0x1f4){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);return _0x266280(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);}logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')]['message']);return _0x395e2b(_0x572349['error']['message']);}else{logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));_0x395e2b(_0x572349['result']['message']);}})['catch'](function(_0x5876bd){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x5876bd);_0x266280(_0x5876bd);});});}function respondWithStatusCode(_0x11f362,_0x5c9e37){_0x5c9e37=_0x5c9e37||0xcc;return function(_0x4ce22f){if(_0x4ce22f){return _0x11f362['sendStatus'](_0x5c9e37);}return _0x11f362[_0x4d5a('0x2a')](_0x5c9e37)[_0x4d5a('0x2b')]();};}function respondWithResult(_0x19f6ae,_0x5393e0){_0x5393e0=_0x5393e0||0xc8;return function(_0x1764ae){if(_0x1764ae){return _0x19f6ae[_0x4d5a('0x2a')](_0x5393e0)[_0x4d5a('0x2c')](_0x1764ae);}};}function respondWithFilteredResult(_0x402f96,_0x175517){return function(_0x597bfa){if(_0x597bfa){var _0x288976=typeof _0x175517['offset']===_0x4d5a('0x2d')&&typeof _0x175517[_0x4d5a('0x2e')]===_0x4d5a('0x2d');var _0x517f5b=_0x597bfa[_0x4d5a('0x2f')];var _0x1eef60=_0x288976?0x0:_0x175517[_0x4d5a('0x30')];var _0xdb1c99=_0x288976?_0x597bfa[_0x4d5a('0x2f')]:_0x175517[_0x4d5a('0x30')]+_0x175517[_0x4d5a('0x2e')];var _0x4e0198;if(_0xdb1c99>=_0x517f5b){_0xdb1c99=_0x517f5b;_0x4e0198=0xc8;}else{_0x4e0198=0xce;}_0x402f96['status'](_0x4e0198);return _0x402f96[_0x4d5a('0x31')]('Content-Range',_0x1eef60+'-'+_0xdb1c99+'/'+_0x517f5b)[_0x4d5a('0x2c')](_0x597bfa);}return null;};}function patchUpdates(_0x766744){return function(_0xd6ebc1){try{jsonpatch[_0x4d5a('0x32')](_0xd6ebc1,_0x766744,!![]);}catch(_0x3097e4){return BPromise['reject'](_0x3097e4);}return _0xd6ebc1['save']();};}function saveUpdates(_0x34fffd,_0x25555f){return function(_0x267482){if(_0x267482){return _0x267482['update'](_0x34fffd)[_0x4d5a('0x20')](function(_0xe55abb){return _0xe55abb;});}return null;};}function removeEntity(_0x316db4,_0x2660dc){return function(_0x136e5a){if(_0x136e5a){return _0x136e5a[_0x4d5a('0x33')]()[_0x4d5a('0x20')](function(){_0x316db4[_0x4d5a('0x2a')](0xcc)[_0x4d5a('0x2b')]();});}};}function handleEntityNotFound(_0x1a710a,_0x334083){return function(_0x2b2a38){if(!_0x2b2a38){_0x1a710a['sendStatus'](0x194);}return _0x2b2a38;};}function handleError(_0x3288a9,_0x1ba720){_0x1ba720=_0x1ba720||0x1f4;return function(_0xb2665c){logger[_0x4d5a('0x27')](_0xb2665c['stack']);if(_0xb2665c[_0x4d5a('0x34')]){delete _0xb2665c[_0x4d5a('0x34')];}_0x3288a9[_0x4d5a('0x2a')](_0x1ba720)[_0x4d5a('0x35')](_0xb2665c);};}exports['index']=function(_0x359caa,_0xf3d2dd){var _0x2a929d={},_0x1bb590={},_0x241423={'count':0x0,'rows':[]};var _0x5cb392=_[_0x4d5a('0x36')](db['ChatMessage'][_0x4d5a('0x37')],function(_0x44eb72){return{'name':_0x44eb72['fieldName'],'type':_0x44eb72[_0x4d5a('0x38')][_0x4d5a('0x39')]};});_0x1bb590['model']=_[_0x4d5a('0x36')](_0x5cb392,'name');_0x1bb590['query']=_[_0x4d5a('0x3a')](_0x359caa[_0x4d5a('0x3b')]);_0x1bb590[_0x4d5a('0x3c')]=_['intersection'](_0x1bb590['model'],_0x1bb590[_0x4d5a('0x3b')]);_0x2a929d['attributes']=_[_0x4d5a('0x3d')](_0x1bb590[_0x4d5a('0x3e')],qs[_0x4d5a('0x3f')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x3f')]));_0x2a929d['attributes']=_0x2a929d['attributes']['length']?_0x2a929d[_0x4d5a('0x40')]:_0x1bb590[_0x4d5a('0x3e')];if(!_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x41')]('nolimit')){_0x2a929d[_0x4d5a('0x2e')]=qs[_0x4d5a('0x2e')](_0x359caa['query'][_0x4d5a('0x2e')]);_0x2a929d[_0x4d5a('0x30')]=qs[_0x4d5a('0x30')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x30')]);}_0x2a929d['order']=qs['sort'](_0x359caa[_0x4d5a('0x3b')]['sort']);_0x2a929d[_0x4d5a('0x42')]=qs[_0x4d5a('0x3c')](_[_0x4d5a('0x43')](_0x359caa['query'],_0x1bb590[_0x4d5a('0x3c')]),_0x5cb392);if(_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]){_0x2a929d[_0x4d5a('0x42')]=_['merge'](_0x2a929d[_0x4d5a('0x42')],{'$or':_['map'](_0x5cb392,function(_0x292b48){if(_0x292b48[_0x4d5a('0x38')]!==_0x4d5a('0x45')){var _0x4b3ec8={};_0x4b3ec8[_0x292b48[_0x4d5a('0x34')]]={'$like':'%'+_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]+'%'};return _0x4b3ec8;}})});}_0x2a929d=_[_0x4d5a('0x46')]({},_0x2a929d,_0x359caa['options']);var _0x245e74={'where':_0x2a929d[_0x4d5a('0x42')]};return db[_0x4d5a('0x47')][_0x4d5a('0x2f')](_0x245e74)[_0x4d5a('0x20')](function(_0x1ec71f){_0x241423[_0x4d5a('0x2f')]=_0x1ec71f;if(_0x359caa['query'][_0x4d5a('0x48')]){_0x2a929d[_0x4d5a('0x49')]=[{'all':!![]}];}return db[_0x4d5a('0x47')][_0x4d5a('0x4a')](_0x2a929d);})[_0x4d5a('0x20')](function(_0x1cff4a){_0x241423[_0x4d5a('0x4b')]=_0x1cff4a;return _0x241423;})['then'](respondWithFilteredResult(_0xf3d2dd,_0x2a929d))[_0x4d5a('0x4c')](handleError(_0xf3d2dd,null));};exports[_0x4d5a('0x4d')]=function(_0x426227,_0x43ec6a){var _0x12d867={'raw':!![],'where':{'id':_0x426227[_0x4d5a('0x4e')]['id']}},_0x30c04b={};_0x30c04b[_0x4d5a('0x3e')]=_['keys'](db[_0x4d5a('0x47')][_0x4d5a('0x37')]);_0x30c04b[_0x4d5a('0x3b')]=_['keys'](_0x426227[_0x4d5a('0x3b')]);_0x30c04b[_0x4d5a('0x3c')]=_['intersection'](_0x30c04b[_0x4d5a('0x3e')],_0x30c04b[_0x4d5a('0x3b')]);_0x12d867[_0x4d5a('0x40')]=_[_0x4d5a('0x3d')](_0x30c04b['model'],qs[_0x4d5a('0x3f')](_0x426227[_0x4d5a('0x3b')]['fields']));_0x12d867[_0x4d5a('0x40')]=_0x12d867[_0x4d5a('0x40')][_0x4d5a('0x4f')]?_0x12d867[_0x4d5a('0x40')]:_0x30c04b[_0x4d5a('0x3e')];if(_0x426227['query'][_0x4d5a('0x48')]){_0x12d867[_0x4d5a('0x49')]=[{'all':!![]}];}_0x12d867=_['merge']({},_0x12d867,_0x426227[_0x4d5a('0x50')]);return db[_0x4d5a('0x47')][_0x4d5a('0x51')](_0x12d867)[_0x4d5a('0x20')](handleEntityNotFound(_0x43ec6a,null))[_0x4d5a('0x20')](respondWithResult(_0x43ec6a,null))[_0x4d5a('0x4c')](handleError(_0x43ec6a,null));};exports[_0x4d5a('0x52')]=function(_0x1fd6c1,_0x29d027){return db[_0x4d5a('0x47')]['create'](_0x1fd6c1[_0x4d5a('0x53')],{})[_0x4d5a('0x20')](respondWithResult(_0x29d027,0xc9))[_0x4d5a('0x4c')](handleError(_0x29d027,null));};exports['update']=function(_0xeaf250,_0xb0e5a8){if(_0xeaf250['body']['id']){delete _0xeaf250[_0x4d5a('0x53')]['id'];}return db[_0x4d5a('0x47')]['find']({'where':{'id':_0xeaf250[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb0e5a8,null))[_0x4d5a('0x20')](saveUpdates(_0xeaf250[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](respondWithResult(_0xb0e5a8,null))[_0x4d5a('0x4c')](handleError(_0xb0e5a8,null));};exports[_0x4d5a('0x33')]=function(_0x1e2dcf,_0x468def){return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x1e2dcf[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x468def,null))[_0x4d5a('0x20')](removeEntity(_0x468def,null))[_0x4d5a('0x4c')](handleError(_0x468def,null));};exports[_0x4d5a('0x54')]=function(_0x591a1f,_0x5ab8e7){return db[_0x4d5a('0x47')][_0x4d5a('0x54')]()[_0x4d5a('0x20')](respondWithResult(_0x5ab8e7,null))['catch'](handleError(_0x5ab8e7,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x56')]=function(_0x2a58c2,_0x3a02e5,_0x208825){var _0x57ce94={'agent':{},'channel':_0x4d5a('0x57')};if(_0x2a58c2[_0x4d5a('0x53')]['id']){delete _0x2a58c2[_0x4d5a('0x53')]['id'];}_0x2a58c2['body'][_0x4d5a('0x58')]=!![];_0x2a58c2['body']['readAt']=moment()[_0x4d5a('0x59')](_0x4d5a('0x5a'));_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]=_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x2a58c2[_0x4d5a('0x5c')]['id'];_0x57ce94[_0x4d5a('0x5d')]['id']=_0x2a58c2[_0x4d5a('0x53')]['UserId'];return db[_0x4d5a('0x47')]['find']({'where':{'id':_0x2a58c2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](saveUpdates(_0x2a58c2[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](function(_0x1d69b2){if(_0x1d69b2){_0x57ce94[_0x4d5a('0x29')]=_0x1d69b2[_0x4d5a('0x5e')]({'plain':!![]});return db[_0x4d5a('0x5f')][_0x4d5a('0x51')]({'where':{'id':_0x1d69b2[_0x4d5a('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](function(_0x91706f){if(_0x91706f){return _0x91706f[_0x4d5a('0x61')]({'UserId':_0x2a58c2[_0x4d5a('0x53')]['UserId'],'read1stAt':_[_0x4d5a('0x62')](_0x91706f[_0x4d5a('0x63')])?moment()['format'](_0x4d5a('0x5a')):undefined});}return null;})[_0x4d5a('0x20')](function(_0x4cade1){if(_0x4cade1){_0x57ce94[_0x4d5a('0x64')]=_0x4cade1[_0x4d5a('0x5e')]({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x65'),_0x2a58c2[_0x4d5a('0x5c')]['id'],_0x2a58c2['user'][_0x4d5a('0x34')],_0x2a58c2[_0x4d5a('0x5c')][_0x4d5a('0x66')],_0x57ce94['interaction']['id'],_0x2a58c2[_0x4d5a('0x53')]?JSON['stringify'](_0x2a58c2[_0x4d5a('0x53')]):_0x4d5a('0x67'));return respondWithRpcPromise('AcceptMessage',_0x4d5a('0x68'),_0x57ce94);}return null;})[_0x4d5a('0x20')](function(_0x5321f8){var _0x2b598c=_0x4d5a('0x69')+_0x5321f8[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x2b598c,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x5154d8){return _0x5154d8;});})[_0x4d5a('0x20')](function(_0x2bc246){if(_0x2bc246){_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x6f')]=_0x2bc246[0x0];if(!_0x2a58c2['body'][_0x4d5a('0x5b')])return;return db[_0x4d5a('0x70')][_0x4d5a('0x51')]({'where':{'id':_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')],'role':'agent'},'attributes':['id',_0x4d5a('0x34'),_0x4d5a('0x71'),_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x35fa95){if(!_0x35fa95)return null;_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x5d')]=_0x35fa95;return _0x57ce94;})[_0x4d5a('0x20')](function(_0x20b574){if(_0x20b574){if(_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x74')]){_0x57ce94['message'][_0x4d5a('0x75')]=util[_0x4d5a('0x59')]('SIP/%s',_0x2a58c2['user'][_0x4d5a('0x34')]);_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x76')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x77')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94['message'][_0x4d5a('0x78')]=_0x4d5a('0x56');return respondWithRpcPromise(_0x4d5a('0x79'),_0x4d5a('0x79'),{'event':_0x4d5a('0x7a'),'message':_['merge'](_0x57ce94['message'],JSON[_0x4d5a('0x7b')](_0x57ce94[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002)[_0x4d5a('0x20')](function(){return _0x57ce94;});}return _0x57ce94;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x3a02e5,null))[_0x4d5a('0x4c')](handleError(_0x3a02e5,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x7d')]=function(_0x11ed07,_0x5abec1,_0x3e8add){var _0x1a2c3b={'agent':{},'channel':_0x4d5a('0x57')};if(_0x11ed07[_0x4d5a('0x53')]['id']){delete _0x11ed07[_0x4d5a('0x53')]['id'];}_0x11ed07['body']['UserId']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x11ed07[_0x4d5a('0x5c')]['id'];_0x1a2c3b[_0x4d5a('0x5d')]['id']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')];return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x11ed07[_0x4d5a('0x4e')]['id'],'UserId':null}})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))[_0x4d5a('0x20')](function(_0xd0183b){if(_0xd0183b){_0x1a2c3b[_0x4d5a('0x29')]=_0xd0183b[_0x4d5a('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x4d5a('0x51')]({'where':{'id':_0xd0183b[_0x4d5a('0x60')]}});}return null;})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))['then'](function(_0x13fbc5){if(_0x13fbc5){_0x1a2c3b['interaction']=_0x13fbc5['get']({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x7e'),_0x11ed07[_0x4d5a('0x5c')]['id'],_0x11ed07[_0x4d5a('0x5c')]['name'],_0x11ed07['user']['role'],_0x1a2c3b[_0x4d5a('0x64')]['id'],_0x11ed07[_0x4d5a('0x53')]?JSON[_0x4d5a('0x26')](_0x11ed07[_0x4d5a('0x53')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1a2c3b);}return null;})['then'](function(_0x2a9d6a){var _0x222820='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a9d6a[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x222820,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x42040e){return _0x42040e;});})[_0x4d5a('0x20')](function(_0xf50bac){if(_0xf50bac){_0x1a2c3b[_0x4d5a('0x29')]['contact']=_0xf50bac[0x0];if(!_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')])return;return db['User'][_0x4d5a('0x51')]({'where':{'id':_0x11ed07['body'][_0x4d5a('0x5b')],'role':_0x4d5a('0x5d')},'attributes':['id',_0x4d5a('0x34'),'fullname',_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x3fbfc5){if(!_0x3fbfc5)return null;_0x1a2c3b['message'][_0x4d5a('0x5d')]=_0x3fbfc5;return _0x1a2c3b;})[_0x4d5a('0x20')](function(_0x1c2bab){if(_0x1c2bab){_0x1c2bab[_0x4d5a('0x29')]['interface']=util[_0x4d5a('0x59')](_0x4d5a('0x7f'),_0x11ed07[_0x4d5a('0x5c')]['name']);_0x1c2bab['message']['channel']=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab['message'][_0x4d5a('0x77')]=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab[_0x4d5a('0x29')][_0x4d5a('0x78')]=_0x4d5a('0x7d');respondWithRpcPromise('EventManager',_0x4d5a('0x79'),{'event':_0x4d5a('0x80'),'message':_[_0x4d5a('0x46')](_0x1a2c3b[_0x4d5a('0x29')],JSON['parse'](_0x1a2c3b[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002);return _0x1a2c3b;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x5abec1,null))[_0x4d5a('0x4c')](handleError(_0x5abec1,null));}; \ No newline at end of file +var _0x68c6=['offset','limit','count','Content-Range','apply','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','find','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','email','internal','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json'];(function(_0x2f2ddd,_0x224bd2){var _0x164d8f=function(_0x4213b3){while(--_0x4213b3){_0x2f2ddd['push'](_0x2f2ddd['shift']());}};_0x164d8f(++_0x224bd2);}(_0x68c6,0xe1));var _0x668c=function(_0x5ba46a,_0x582fe0){_0x5ba46a=_0x5ba46a-0x0;var _0x5cbf4f=_0x68c6[_0x5ba46a];return _0x5cbf4f;};'use strict';var emlformat=require(_0x668c('0x0'));var rimraf=require(_0x668c('0x1'));var zipdir=require(_0x668c('0x2'));var jsonpatch=require(_0x668c('0x3'));var rp=require('request-promise');var moment=require(_0x668c('0x4'));var BPromise=require(_0x668c('0x5'));var Mustache=require(_0x668c('0x6'));var util=require('util');var path=require(_0x668c('0x7'));var sox=require(_0x668c('0x8'));var csv=require(_0x668c('0x9'));var ejs=require(_0x668c('0xa'));var fs=require('fs');var fs_extra=require(_0x668c('0xb'));var _=require(_0x668c('0xc'));var squel=require(_0x668c('0xd'));var crypto=require(_0x668c('0xe'));var jsforce=require(_0x668c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x668c('0x9'));var querystring=require(_0x668c('0x10'));var Papa=require('papaparse');var Redis=require(_0x668c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x668c('0x12'));var hardwareService=require(_0x668c('0x13'));var logger=require(_0x668c('0x14'))(_0x668c('0x15'));var utils=require(_0x668c('0x16'));var config=require(_0x668c('0x17'));var licenseUtil=require(_0x668c('0x18'));var db=require(_0x668c('0x19'))['db'];config[_0x668c('0x1a')]=_[_0x668c('0x1b')](config[_0x668c('0x1a')],{'host':_0x668c('0x1c'),'port':0x18eb});var socket=require(_0x668c('0x1d'))(new Redis(config[_0x668c('0x1a')]));require('./chatMessage.socket')[_0x668c('0x1e')](socket);var jayson=require(_0x668c('0x1f'));var client=jayson[_0x668c('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x668c('0x20')][_0x668c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3d30a1,_0x29456b,_0x236fda,_0x153874){return new BPromise(function(_0x4140d9,_0x181b37){var _0x19abad=_0x153874||client;return _0x19abad[_0x668c('0x22')](_0x3d30a1,_0x236fda)[_0x668c('0x23')](function(_0x15df62){logger['info']('ChatMessage,\x20%s,\x20%s',_0x29456b,_0x668c('0x24'));logger[_0x668c('0x25')](_0x668c('0x26'),_0x29456b,_0x668c('0x24'),JSON[_0x668c('0x27')](_0x15df62));if(_0x15df62[_0x668c('0x28')]){if(_0x15df62[_0x668c('0x28')][_0x668c('0x29')]===0x1f4){logger[_0x668c('0x28')]('ChatMessage,\x20%s,\x20%s',_0x29456b,_0x15df62[_0x668c('0x28')][_0x668c('0x2a')]);return _0x181b37(_0x15df62['error']['message']);}logger[_0x668c('0x28')](_0x668c('0x2b'),_0x29456b,_0x15df62[_0x668c('0x28')]['message']);return _0x4140d9(_0x15df62['error'][_0x668c('0x2a')]);}else{logger[_0x668c('0x2c')](_0x668c('0x2b'),_0x29456b,'request\x20sent');_0x4140d9(_0x15df62[_0x668c('0x2d')][_0x668c('0x2a')]);}})[_0x668c('0x2e')](function(_0x2c0f1c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x29456b,_0x2c0f1c);_0x181b37(_0x2c0f1c);});});}function respondWithStatusCode(_0x3917df,_0x5ca4a0){_0x5ca4a0=_0x5ca4a0||0xcc;return function(_0x492767){if(_0x492767){return _0x3917df[_0x668c('0x2f')](_0x5ca4a0);}return _0x3917df[_0x668c('0x30')](_0x5ca4a0)[_0x668c('0x31')]();};}function respondWithResult(_0x3f1b22,_0x2c4527){_0x2c4527=_0x2c4527||0xc8;return function(_0x319013){if(_0x319013){return _0x3f1b22[_0x668c('0x30')](_0x2c4527)[_0x668c('0x32')](_0x319013);}};}function respondWithFilteredResult(_0x3edce8,_0x4ffca1){return function(_0xbaf7d9){if(_0xbaf7d9){var _0x399999=typeof _0x4ffca1[_0x668c('0x33')]==='undefined'&&typeof _0x4ffca1[_0x668c('0x34')]==='undefined';var _0x37f02b=_0xbaf7d9[_0x668c('0x35')];var _0x554f0e=_0x399999?0x0:_0x4ffca1[_0x668c('0x33')];var _0x338f27=_0x399999?_0xbaf7d9['count']:_0x4ffca1[_0x668c('0x33')]+_0x4ffca1[_0x668c('0x34')];var _0x33b0a2;if(_0x338f27>=_0x37f02b){_0x338f27=_0x37f02b;_0x33b0a2=0xc8;}else{_0x33b0a2=0xce;}_0x3edce8[_0x668c('0x30')](_0x33b0a2);return _0x3edce8['set'](_0x668c('0x36'),_0x554f0e+'-'+_0x338f27+'/'+_0x37f02b)['json'](_0xbaf7d9);}return null;};}function patchUpdates(_0x424661){return function(_0x1c540e){try{jsonpatch[_0x668c('0x37')](_0x1c540e,_0x424661,!![]);}catch(_0x1d8366){return BPromise['reject'](_0x1d8366);}return _0x1c540e['save']();};}function saveUpdates(_0x133228,_0x5c3bd7){return function(_0x2285ac){if(_0x2285ac){return _0x2285ac['update'](_0x133228)['then'](function(_0xa08278){return _0xa08278;});}return null;};}function removeEntity(_0x48f9d5,_0xc7e52){return function(_0x4d99f2){if(_0x4d99f2){return _0x4d99f2[_0x668c('0x38')]()[_0x668c('0x23')](function(){_0x48f9d5[_0x668c('0x30')](0xcc)[_0x668c('0x31')]();});}};}function handleEntityNotFound(_0x206030,_0x2ae6e5){return function(_0x102803){if(!_0x102803){_0x206030[_0x668c('0x2f')](0x194);}return _0x102803;};}function handleError(_0xeaa407,_0x220ab7){_0x220ab7=_0x220ab7||0x1f4;return function(_0x25fcd5){logger[_0x668c('0x28')](_0x25fcd5[_0x668c('0x39')]);if(_0x25fcd5[_0x668c('0x3a')]){delete _0x25fcd5[_0x668c('0x3a')];}_0xeaa407[_0x668c('0x30')](_0x220ab7)[_0x668c('0x3b')](_0x25fcd5);};}exports[_0x668c('0x3c')]=function(_0x396345,_0x8f0069){var _0x11a8f1={},_0x1e1f2f={},_0x4a6f68={'count':0x0,'rows':[]};var _0xe9eb4c=_[_0x668c('0x3d')](db[_0x668c('0x3e')][_0x668c('0x3f')],function(_0x3cab06){return{'name':_0x3cab06[_0x668c('0x40')],'type':_0x3cab06[_0x668c('0x41')][_0x668c('0x42')]};});_0x1e1f2f[_0x668c('0x43')]=_[_0x668c('0x3d')](_0xe9eb4c,_0x668c('0x3a'));_0x1e1f2f[_0x668c('0x44')]=_[_0x668c('0x45')](_0x396345[_0x668c('0x44')]);_0x1e1f2f[_0x668c('0x46')]=_['intersection'](_0x1e1f2f[_0x668c('0x43')],_0x1e1f2f['query']);_0x11a8f1[_0x668c('0x47')]=_[_0x668c('0x48')](_0x1e1f2f[_0x668c('0x43')],qs[_0x668c('0x49')](_0x396345[_0x668c('0x44')][_0x668c('0x49')]));_0x11a8f1[_0x668c('0x47')]=_0x11a8f1[_0x668c('0x47')][_0x668c('0x4a')]?_0x11a8f1[_0x668c('0x47')]:_0x1e1f2f[_0x668c('0x43')];if(!_0x396345[_0x668c('0x44')][_0x668c('0x4b')](_0x668c('0x4c'))){_0x11a8f1[_0x668c('0x34')]=qs[_0x668c('0x34')](_0x396345[_0x668c('0x44')]['limit']);_0x11a8f1['offset']=qs[_0x668c('0x33')](_0x396345[_0x668c('0x44')][_0x668c('0x33')]);}_0x11a8f1['order']=qs[_0x668c('0x4d')](_0x396345[_0x668c('0x44')]['sort']);_0x11a8f1[_0x668c('0x4e')]=qs['filters'](_[_0x668c('0x4f')](_0x396345[_0x668c('0x44')],_0x1e1f2f['filters']),_0xe9eb4c);if(_0x396345['query'][_0x668c('0x50')]){_0x11a8f1[_0x668c('0x4e')]=_[_0x668c('0x51')](_0x11a8f1[_0x668c('0x4e')],{'$or':_['map'](_0xe9eb4c,function(_0x417abd){if(_0x417abd[_0x668c('0x41')]!==_0x668c('0x52')){var _0x719b1d={};_0x719b1d[_0x417abd['name']]={'$like':'%'+_0x396345['query'][_0x668c('0x50')]+'%'};return _0x719b1d;}})});}_0x11a8f1=_[_0x668c('0x51')]({},_0x11a8f1,_0x396345[_0x668c('0x53')]);var _0x1e25bb={'where':_0x11a8f1[_0x668c('0x4e')]};return db[_0x668c('0x3e')][_0x668c('0x35')](_0x1e25bb)[_0x668c('0x23')](function(_0xb5ea1){_0x4a6f68['count']=_0xb5ea1;if(_0x396345[_0x668c('0x44')]['includeAll']){_0x11a8f1[_0x668c('0x54')]=[{'all':!![]}];}return db[_0x668c('0x3e')][_0x668c('0x55')](_0x11a8f1);})['then'](function(_0x388d07){_0x4a6f68[_0x668c('0x56')]=_0x388d07;return _0x4a6f68;})[_0x668c('0x23')](respondWithFilteredResult(_0x8f0069,_0x11a8f1))['catch'](handleError(_0x8f0069,null));};exports[_0x668c('0x57')]=function(_0xba002,_0x3bb73d){var _0x2eb23f={'raw':!![],'where':{'id':_0xba002[_0x668c('0x58')]['id']}},_0x3d144b={};_0x3d144b['model']=_[_0x668c('0x45')](db['ChatMessage']['rawAttributes']);_0x3d144b[_0x668c('0x44')]=_[_0x668c('0x45')](_0xba002[_0x668c('0x44')]);_0x3d144b[_0x668c('0x46')]=_[_0x668c('0x48')](_0x3d144b[_0x668c('0x43')],_0x3d144b[_0x668c('0x44')]);_0x2eb23f[_0x668c('0x47')]=_[_0x668c('0x48')](_0x3d144b['model'],qs[_0x668c('0x49')](_0xba002[_0x668c('0x44')]['fields']));_0x2eb23f[_0x668c('0x47')]=_0x2eb23f[_0x668c('0x47')][_0x668c('0x4a')]?_0x2eb23f['attributes']:_0x3d144b[_0x668c('0x43')];if(_0xba002['query'][_0x668c('0x59')]){_0x2eb23f[_0x668c('0x54')]=[{'all':!![]}];}_0x2eb23f=_[_0x668c('0x51')]({},_0x2eb23f,_0xba002['options']);return db[_0x668c('0x3e')]['find'](_0x2eb23f)[_0x668c('0x23')](handleEntityNotFound(_0x3bb73d,null))[_0x668c('0x23')](respondWithResult(_0x3bb73d,null))[_0x668c('0x2e')](handleError(_0x3bb73d,null));};exports[_0x668c('0x5a')]=function(_0xc878dc,_0x1d7ceb){return db[_0x668c('0x3e')]['create'](_0xc878dc['body'],{})['then'](respondWithResult(_0x1d7ceb,0xc9))[_0x668c('0x2e')](handleError(_0x1d7ceb,null));};exports['update']=function(_0xcaed5,_0x4dddef){if(_0xcaed5[_0x668c('0x5b')]['id']){delete _0xcaed5['body']['id'];}return db[_0x668c('0x3e')][_0x668c('0x5c')]({'where':{'id':_0xcaed5['params']['id']}})['then'](handleEntityNotFound(_0x4dddef,null))[_0x668c('0x23')](saveUpdates(_0xcaed5[_0x668c('0x5b')],null))[_0x668c('0x23')](respondWithResult(_0x4dddef,null))[_0x668c('0x2e')](handleError(_0x4dddef,null));};exports[_0x668c('0x38')]=function(_0x21d451,_0x1d1480){return db[_0x668c('0x3e')][_0x668c('0x5c')]({'where':{'id':_0x21d451[_0x668c('0x58')]['id']}})[_0x668c('0x23')](handleEntityNotFound(_0x1d1480,null))[_0x668c('0x23')](removeEntity(_0x1d1480,null))[_0x668c('0x2e')](handleError(_0x1d1480,null));};exports[_0x668c('0x5d')]=function(_0x5b23d2,_0x351e22){return db[_0x668c('0x3e')][_0x668c('0x5d')]()['then'](respondWithResult(_0x351e22,null))[_0x668c('0x2e')](handleError(_0x351e22,null));};var interaction_log=require(_0x668c('0x14'))('chat-interactions');exports['accept']=function(_0x4f0869,_0x492530,_0x8b45b1){var _0x10b6d2={'agent':{},'channel':_0x668c('0x5e')};if(_0x4f0869['body']['id']){delete _0x4f0869[_0x668c('0x5b')]['id'];}_0x4f0869['body'][_0x668c('0x5f')]=!![];_0x4f0869['body'][_0x668c('0x60')]=moment()[_0x668c('0x61')](_0x668c('0x62'));_0x4f0869[_0x668c('0x5b')][_0x668c('0x63')]=_0x4f0869[_0x668c('0x5b')]['UserId']||_0x4f0869[_0x668c('0x64')]['id'];_0x10b6d2['agent']['id']=_0x4f0869['body'][_0x668c('0x63')];return db['ChatMessage']['find']({'where':{'id':_0x4f0869['params']['id'],'UserId':null}})[_0x668c('0x23')](handleEntityNotFound(_0x492530,null))[_0x668c('0x23')](saveUpdates(_0x4f0869[_0x668c('0x5b')],null))[_0x668c('0x23')](function(_0x433171){if(_0x433171){_0x10b6d2['message']=_0x433171['get']({'plain':!![]});return db[_0x668c('0x65')][_0x668c('0x5c')]({'where':{'id':_0x433171[_0x668c('0x66')]}});}return null;})[_0x668c('0x23')](handleEntityNotFound(_0x492530,null))[_0x668c('0x23')](function(_0x285e3d){if(_0x285e3d){return _0x285e3d['update']({'UserId':_0x4f0869[_0x668c('0x5b')][_0x668c('0x63')],'read1stAt':_[_0x668c('0x67')](_0x285e3d[_0x668c('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x668c('0x23')](function(_0x1eb947){if(_0x1eb947){_0x10b6d2[_0x668c('0x69')]=_0x1eb947[_0x668c('0x6a')]({'plain':!![]});interaction_log[_0x668c('0x2c')](_0x668c('0x6b'),_0x4f0869[_0x668c('0x64')]['id'],_0x4f0869[_0x668c('0x64')]['name'],_0x4f0869[_0x668c('0x64')][_0x668c('0x6c')],_0x10b6d2[_0x668c('0x69')]['id'],_0x4f0869['body']?JSON[_0x668c('0x27')](_0x4f0869[_0x668c('0x5b')]):_0x668c('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x668c('0x6e'),_0x10b6d2);}return null;})[_0x668c('0x23')](function(_0x14c238){var _0x1a56fa=_0x668c('0x6f')+_0x14c238[_0x668c('0x2a')][_0x668c('0x70')];return db[_0x668c('0x71')]['query'](_0x1a56fa,{'type':db[_0x668c('0x72')]['QueryTypes'][_0x668c('0x73')],'raw':!![]})['then'](function(_0x3bd20c){return _0x3bd20c;});})[_0x668c('0x23')](function(_0x370c7f){if(_0x370c7f){_0x10b6d2[_0x668c('0x2a')]['contact']=_0x370c7f[0x0];if(!_0x4f0869[_0x668c('0x5b')][_0x668c('0x63')])return;return db[_0x668c('0x74')]['find']({'where':{'id':_0x4f0869[_0x668c('0x5b')][_0x668c('0x63')],'role':_0x668c('0x75')},'attributes':['id',_0x668c('0x3a'),_0x668c('0x76'),'email','internal'],'raw':!![]});}return null;})[_0x668c('0x23')](function(_0x4f1855){if(!_0x4f1855)return null;_0x10b6d2['message'][_0x668c('0x75')]=_0x4f1855;return _0x10b6d2;})['then'](function(_0x21eb27){if(_0x21eb27){if(_0x4f0869[_0x668c('0x5b')][_0x668c('0x77')]){_0x10b6d2[_0x668c('0x2a')][_0x668c('0x78')]=util['format'](_0x668c('0x79'),_0x4f0869[_0x668c('0x64')]['name']);_0x10b6d2[_0x668c('0x2a')][_0x668c('0x7a')]=_0x10b6d2['channel'];_0x10b6d2[_0x668c('0x2a')][_0x668c('0x7b')]=_0x10b6d2['channel'];_0x10b6d2[_0x668c('0x2a')][_0x668c('0x7c')]='accept';return respondWithRpcPromise(_0x668c('0x7d'),_0x668c('0x7d'),{'event':_0x668c('0x7e'),'message':_[_0x668c('0x51')](_0x10b6d2[_0x668c('0x2a')],JSON['parse'](_0x10b6d2[_0x668c('0x69')][_0x668c('0x7f')]))},client9002)[_0x668c('0x23')](function(){return _0x10b6d2;});}return _0x10b6d2;}return null;})[_0x668c('0x23')](respondWithResult(_0x492530,null))[_0x668c('0x2e')](handleError(_0x492530,null));};var interaction_log=require(_0x668c('0x14'))(_0x668c('0x80'));exports[_0x668c('0x81')]=function(_0x2e9d9c,_0x586a28,_0x5b4002){var _0x4a6b72={'agent':{},'channel':'chat'};if(_0x2e9d9c[_0x668c('0x5b')]['id']){delete _0x2e9d9c[_0x668c('0x5b')]['id'];}_0x2e9d9c['body'][_0x668c('0x63')]=_0x2e9d9c[_0x668c('0x5b')][_0x668c('0x63')]||_0x2e9d9c[_0x668c('0x64')]['id'];_0x4a6b72[_0x668c('0x75')]['id']=_0x2e9d9c[_0x668c('0x5b')][_0x668c('0x63')];return db[_0x668c('0x3e')][_0x668c('0x5c')]({'where':{'id':_0x2e9d9c[_0x668c('0x58')]['id'],'UserId':null}})[_0x668c('0x23')](handleEntityNotFound(_0x586a28,null))[_0x668c('0x23')](function(_0x443ef6){if(_0x443ef6){_0x4a6b72['message']=_0x443ef6[_0x668c('0x6a')]({'plain':!![]});return db[_0x668c('0x65')][_0x668c('0x5c')]({'where':{'id':_0x443ef6[_0x668c('0x66')]}});}return null;})[_0x668c('0x23')](handleEntityNotFound(_0x586a28,null))['then'](function(_0x4c1821){if(_0x4c1821){_0x4a6b72[_0x668c('0x69')]=_0x4c1821[_0x668c('0x6a')]({'plain':!![]});interaction_log[_0x668c('0x2c')](_0x668c('0x82'),_0x2e9d9c['user']['id'],_0x2e9d9c[_0x668c('0x64')][_0x668c('0x3a')],_0x2e9d9c[_0x668c('0x64')][_0x668c('0x6c')],_0x4a6b72['interaction']['id'],_0x2e9d9c[_0x668c('0x5b')]?JSON['stringify'](_0x2e9d9c['body']):_0x668c('0x6d'));return respondWithRpcPromise(_0x668c('0x83'),_0x668c('0x84'),_0x4a6b72);}return null;})['then'](function(_0x115c2c){var _0x176d85=_0x668c('0x6f')+_0x115c2c[_0x668c('0x2a')][_0x668c('0x70')];return db[_0x668c('0x71')][_0x668c('0x44')](_0x176d85,{'type':db['Sequelize']['QueryTypes'][_0x668c('0x73')],'raw':!![]})[_0x668c('0x23')](function(_0x4744ff){return _0x4744ff;});})[_0x668c('0x23')](function(_0x428561){if(_0x428561){_0x4a6b72['message'][_0x668c('0x85')]=_0x428561[0x0];if(!_0x2e9d9c[_0x668c('0x5b')][_0x668c('0x63')])return;return db[_0x668c('0x74')][_0x668c('0x5c')]({'where':{'id':_0x2e9d9c['body'][_0x668c('0x63')],'role':_0x668c('0x75')},'attributes':['id',_0x668c('0x3a'),_0x668c('0x76'),_0x668c('0x86'),_0x668c('0x87')],'raw':!![]});}return null;})[_0x668c('0x23')](function(_0x4fa29c){if(!_0x4fa29c)return null;_0x4a6b72[_0x668c('0x2a')][_0x668c('0x75')]=_0x4fa29c;return _0x4a6b72;})[_0x668c('0x23')](function(_0x293f92){if(_0x293f92){_0x293f92[_0x668c('0x2a')][_0x668c('0x78')]=util[_0x668c('0x61')](_0x668c('0x79'),_0x2e9d9c[_0x668c('0x64')][_0x668c('0x3a')]);_0x293f92[_0x668c('0x2a')][_0x668c('0x7a')]=_0x4a6b72[_0x668c('0x7a')];_0x293f92[_0x668c('0x2a')][_0x668c('0x7b')]=_0x4a6b72[_0x668c('0x7a')];_0x293f92['message'][_0x668c('0x7c')]=_0x668c('0x81');respondWithRpcPromise(_0x668c('0x7d'),_0x668c('0x7d'),{'event':_0x668c('0x88'),'message':_[_0x668c('0x51')](_0x4a6b72['message'],JSON[_0x668c('0x89')](_0x4a6b72['interaction'][_0x668c('0x7f')]))},client9002);return _0x4a6b72;}return null;})[_0x668c('0x23')](respondWithResult(_0x586a28,null))[_0x668c('0x2e')](handleError(_0x586a28,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 464ebb8..968e7fb 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 _0xadd3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0x4b9fcd,_0x10fc42){var _0x3f83cd=function(_0x539400){while(--_0x539400){_0x4b9fcd['push'](_0x4b9fcd['shift']());}};_0x3f83cd(++_0x10fc42);}(_0xadd3,0xc2));var _0x3add=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xadd3[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0x3add('0x0'));var ChatMessage=require(_0x3add('0x1'))['db'][_0x3add('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3add('0x3')](0x0);var events={'afterCreate':_0x3add('0x4'),'afterUpdate':'update','afterDestroy':_0x3add('0x5')};function emitEvent(_0x59666e){return function(_0x24cd62,_0x3ab179,_0x386081){ChatMessageEvents[_0x3add('0x6')](_0x59666e+':'+_0x24cd62['id'],_0x24cd62);ChatMessageEvents[_0x3add('0x6')](_0x59666e,_0x24cd62);_0x386081(null);};}for(var e in events){if(events[_0x3add('0x7')](e)){var event=events[e];ChatMessage[_0x3add('0x8')](e,emitEvent(event));}}module[_0x3add('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x7dee=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','save'];(function(_0x16e747,_0x26f24a){var _0x497a4a=function(_0x2ed2b0){while(--_0x2ed2b0){_0x16e747['push'](_0x16e747['shift']());}};_0x497a4a(++_0x26f24a);}(_0x7dee,0xd5));var _0xe7de=function(_0x39dee4,_0x5349c1){_0x39dee4=_0x39dee4-0x0;var _0x574dd3=_0x7dee[_0x39dee4];return _0x574dd3;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xe7de('0x0'))['db'][_0xe7de('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7de('0x2'),'afterUpdate':_0xe7de('0x3'),'afterDestroy':_0xe7de('0x4')};function emitEvent(_0x3685f9){return function(_0x223d73,_0x206a8f,_0x53117d){ChatMessageEvents['emit'](_0x3685f9+':'+_0x223d73['id'],_0x223d73);ChatMessageEvents[_0xe7de('0x5')](_0x3685f9,_0x223d73);_0x53117d(null);};}for(var e in events){if(events[_0xe7de('0x6')](e)){var event=events[e];ChatMessage[_0xe7de('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index a69880b..bafbb88 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 _0xca0f=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x11d61c,_0xc601d4){var _0x5ccbfa=function(_0x49ec4a){while(--_0x49ec4a){_0x11d61c['push'](_0x11d61c['shift']());}};_0x5ccbfa(++_0xc601d4);}(_0xca0f,0x90));var _0xfca0=function(_0x57bd7c,_0x40aa96){_0x57bd7c=_0x57bd7c-0x0;var _0xe558a=_0xca0f[_0x57bd7c];return _0xe558a;};'use strict';var _=require(_0xfca0('0x0'));var util=require(_0xfca0('0x1'));var logger=require(_0xfca0('0x2'))(_0xfca0('0x3'));var moment=require(_0xfca0('0x4'));var BPromise=require('bluebird');var rp=require(_0xfca0('0x5'));var fs=require('fs');var path=require(_0xfca0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfca0('0x7'));module[_0xfca0('0x8')]=function(_0x289dc2,_0x151284){return _0x289dc2[_0xfca0('0x9')](_0xfca0('0xa'),attributes,{'tableName':_0xfca0('0xb'),'paranoid':![],'indexes':[{'name':_0xfca0('0xc'),'fields':[_0xfca0('0xd')],'type':_0xfca0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c5430,_0x55c3fe,_0x269991){var _0x487e7f=_0x289dc2['models'];var _0x58aa2f=_0x5c5430[_0xfca0('0xf')]({'plain':!![]});if(_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()==='in'||_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()===_0xfca0('0x12')&&!_0x58aa2f[_0xfca0('0x13')]&&!_[_0xfca0('0x14')](_0x58aa2f[_0xfca0('0x15')])){_0x487e7f[_0xfca0('0x16')][_0xfca0('0x17')]({'where':{'id':_0x58aa2f[_0xfca0('0x18')]}})[_0xfca0('0x19')](function(_0x478e56){if(_0x478e56){_0x478e56[_0xfca0('0x1a')]({'lastMsgAt':_0x58aa2f[_0xfca0('0x1b')],'lastMsgDirection':_0x58aa2f['direction'][_0xfca0('0x11')]()});}})[_0xfca0('0x1c')](function(_0x3c9924){console['error'](_0x3c9924);});}_0x269991();}},'charset':_0xfca0('0x1d'),'collate':_0xfca0('0x1e')});}; \ No newline at end of file +var _0x9c55=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x13bd5f,_0x196142){var _0x401983=function(_0xe87766){while(--_0xe87766){_0x13bd5f['push'](_0x13bd5f['shift']());}};_0x401983(++_0x196142);}(_0x9c55,0x156));var _0x59c5=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0x9c55[_0x2ec5b9];return _0x10dcea;};'use strict';var _=require(_0x59c5('0x0'));var util=require('util');var logger=require(_0x59c5('0x1'))(_0x59c5('0x2'));var moment=require(_0x59c5('0x3'));var BPromise=require(_0x59c5('0x4'));var rp=require(_0x59c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59c5('0x6'));var config=require(_0x59c5('0x7'));var attributes=require(_0x59c5('0x8'));module['exports']=function(_0x5458a9,_0x1f1070){return _0x5458a9[_0x59c5('0x9')](_0x59c5('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x59c5('0xb'),'fields':[_0x59c5('0xc')],'type':_0x59c5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36f3ca,_0x470ffe,_0x4430ce){var _0x1f872c=_0x5458a9['models'];var _0x18ee1c=_0x36f3ca[_0x59c5('0xe')]({'plain':!![]});if(_0x18ee1c[_0x59c5('0xf')]['toLowerCase']()==='in'||_0x18ee1c[_0x59c5('0xf')][_0x59c5('0x10')]()===_0x59c5('0x11')&&!_0x18ee1c[_0x59c5('0x12')]&&!_[_0x59c5('0x13')](_0x18ee1c[_0x59c5('0x14')])){_0x1f872c[_0x59c5('0x15')][_0x59c5('0x16')]({'where':{'id':_0x18ee1c[_0x59c5('0x17')]}})[_0x59c5('0x18')](function(_0x350d2c){if(_0x350d2c){_0x350d2c[_0x59c5('0x19')]({'lastMsgAt':_0x18ee1c[_0x59c5('0x1a')],'lastMsgDirection':_0x18ee1c[_0x59c5('0xf')][_0x59c5('0x10')]()});}})[_0x59c5('0x1b')](function(_0x45aea3){console[_0x59c5('0x1c')](_0x45aea3);});}_0x4430ce();}},'charset':_0x59c5('0x1d'),'collate':_0x59c5('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c91b568..ff10f07 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 _0x2c27=['register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x58bb16,_0x5d2f3f){var _0x3e83ef=function(_0x275787){while(--_0x275787){_0x58bb16['push'](_0x58bb16['shift']());}};_0x3e83ef(++_0x5d2f3f);}(_0x2c27,0x9f));var _0x72c2=function(_0x134717,_0x5b6841){_0x134717=_0x134717-0x0;var _0x321b06=_0x2c27[_0x134717];return _0x321b06;};'use strict';var _=require(_0x72c2('0x0'));var util=require(_0x72c2('0x1'));var moment=require(_0x72c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x72c2('0x3'));var fs=require('fs');var Redis=require(_0x72c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x72c2('0x5'));var logger=require(_0x72c2('0x6'))(_0x72c2('0x7'));var config=require(_0x72c2('0x8'));var jayson=require(_0x72c2('0x9'));var client=jayson[_0x72c2('0xa')][_0x72c2('0xb')]({'port':0x232a});config['redis']=_[_0x72c2('0xc')](config[_0x72c2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x72c2('0xe'))(new Redis(config[_0x72c2('0xd')]));require(_0x72c2('0xf'))[_0x72c2('0x10')](socket);function respondWithRpcPromise(_0x623278,_0xc263bb,_0x599db9){return new BPromise(function(_0xcf25c5,_0x1296f5){return client[_0x72c2('0x11')](_0x623278,_0x599db9)[_0x72c2('0x12')](function(_0xb36679){logger[_0x72c2('0x13')](_0x72c2('0x14'),_0xc263bb,'request\x20sent');logger[_0x72c2('0x15')](_0x72c2('0x16'),_0xc263bb,_0x72c2('0x17'),JSON[_0x72c2('0x18')](_0xb36679));if(_0xb36679[_0x72c2('0x19')]){if(_0xb36679[_0x72c2('0x19')]['code']===0x1f4){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);return _0x1296f5(_0xb36679[_0x72c2('0x19')]['message']);}logger[_0x72c2('0x19')](_0x72c2('0x14'),_0xc263bb,_0xb36679[_0x72c2('0x19')]['message']);return _0xcf25c5(_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);}else{logger[_0x72c2('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x72c2('0x17'));_0xcf25c5(_0xb36679[_0x72c2('0x1b')][_0x72c2('0x1a')]);}})[_0x72c2('0x1c')](function(_0x283956){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x283956);_0x1296f5(_0x283956);});});}exports['CreateChatMessage']=function(_0x56bfbf){var _0x5148f9=this;return new Promise(function(_0x5ffd18,_0x5509d9){return db[_0x72c2('0x1d')][_0x72c2('0x1e')](_0x56bfbf[_0x72c2('0x1f')],{'raw':_0x56bfbf[_0x72c2('0x20')]?_0x56bfbf[_0x72c2('0x20')][_0x72c2('0x21')]===undefined?!![]:![]:!![]})[_0x72c2('0x12')](function(_0x5254f7){logger[_0x72c2('0x13')](_0x72c2('0x22'),_0x56bfbf);logger[_0x72c2('0x15')]('CreateChatMessage',_0x56bfbf,JSON[_0x72c2('0x18')](_0x5254f7));_0x5ffd18(_0x5254f7);})['catch'](function(_0x1ce66c){logger[_0x72c2('0x19')](_0x72c2('0x22'),_0x1ce66c['message'],_0x56bfbf);_0x5509d9(_0x5148f9[_0x72c2('0x19')](0x1f4,_0x1ce66c['message']));});});}; \ No newline at end of file +var _0x8d14=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x8d14,0x1a7));var _0x48d1=function(_0x29e755,_0x11a6bf){_0x29e755=_0x29e755-0x0;var _0x51f16e=_0x8d14[_0x29e755];return _0x51f16e;};'use strict';var _=require(_0x48d1('0x0'));var util=require('util');var moment=require(_0x48d1('0x1'));var BPromise=require(_0x48d1('0x2'));var rs=require(_0x48d1('0x3'));var fs=require('fs');var Redis=require(_0x48d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x48d1('0x5'));var config=require(_0x48d1('0x6'));var jayson=require(_0x48d1('0x7'));var client=jayson[_0x48d1('0x8')][_0x48d1('0x9')]({'port':0x232a});config[_0x48d1('0xa')]=_[_0x48d1('0xb')](config['redis'],{'host':_0x48d1('0xc'),'port':0x18eb});var socket=require(_0x48d1('0xd'))(new Redis(config[_0x48d1('0xa')]));require('./chatMessage.socket')[_0x48d1('0xe')](socket);function respondWithRpcPromise(_0x5a8a97,_0x14fee3,_0x214a3f){return new BPromise(function(_0x4ef105,_0x98612f){return client[_0x48d1('0xf')](_0x5a8a97,_0x214a3f)[_0x48d1('0x10')](function(_0x1c0619){logger[_0x48d1('0x11')](_0x48d1('0x12'),_0x14fee3,'request\x20sent');logger[_0x48d1('0x13')](_0x48d1('0x14'),_0x14fee3,_0x48d1('0x15'),JSON[_0x48d1('0x16')](_0x1c0619));if(_0x1c0619[_0x48d1('0x17')]){if(_0x1c0619[_0x48d1('0x17')][_0x48d1('0x18')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x14fee3,_0x1c0619[_0x48d1('0x17')][_0x48d1('0x19')]);return _0x98612f(_0x1c0619[_0x48d1('0x17')]['message']);}logger[_0x48d1('0x17')](_0x48d1('0x12'),_0x14fee3,_0x1c0619[_0x48d1('0x17')][_0x48d1('0x19')]);return _0x4ef105(_0x1c0619['error'][_0x48d1('0x19')]);}else{logger['info'](_0x48d1('0x12'),_0x14fee3,_0x48d1('0x15'));_0x4ef105(_0x1c0619[_0x48d1('0x1a')][_0x48d1('0x19')]);}})[_0x48d1('0x1b')](function(_0x1036fc){logger[_0x48d1('0x17')](_0x48d1('0x12'),_0x14fee3,_0x1036fc);_0x98612f(_0x1036fc);});});}exports[_0x48d1('0x1c')]=function(_0x3554ae){var _0x43b0e7=this;return new Promise(function(_0x5c70,_0xcc7b){return db[_0x48d1('0x1d')][_0x48d1('0x1e')](_0x3554ae[_0x48d1('0x1f')],{'raw':_0x3554ae[_0x48d1('0x20')]?_0x3554ae[_0x48d1('0x20')][_0x48d1('0x21')]===undefined?!![]:![]:!![]})[_0x48d1('0x10')](function(_0x5cb7de){logger[_0x48d1('0x11')](_0x48d1('0x1c'),_0x3554ae);logger[_0x48d1('0x13')](_0x48d1('0x1c'),_0x3554ae,JSON[_0x48d1('0x16')](_0x5cb7de));_0x5c70(_0x5cb7de);})[_0x48d1('0x1b')](function(_0x4a3209){logger['error'](_0x48d1('0x1c'),_0x4a3209['message'],_0x3554ae);_0xcc7b(_0x43b0e7[_0x48d1('0x17')](0x1f4,_0x4a3209[_0x48d1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 8668f65..b30e108 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 _0x8ad5=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8ad5,0xf1));var _0x58ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ad5[_0x3b380d];return _0x54502b;};'use strict';var ChatMessageEvents=require(_0x58ad('0x0'));var events=[_0x58ad('0x1'),_0x58ad('0x2'),_0x58ad('0x3')];function createListener(_0x4cfe26,_0x5dca8a){return function(_0x1e5eb9){_0x5dca8a[_0x58ad('0x4')](_0x4cfe26,_0x1e5eb9);};}function removeListener(_0x223e54,_0x22aba9){return function(){ChatMessageEvents[_0x58ad('0x5')](_0x223e54,_0x22aba9);};}exports[_0x58ad('0x6')]=function(_0x51d560){for(var _0x5888f7=0x0,_0x394972=events[_0x58ad('0x7')];_0x5888f7<_0x394972;_0x5888f7++){var _0x220c5f=events[_0x5888f7];var _0x2033a3=createListener(_0x58ad('0x8')+_0x220c5f,_0x51d560);ChatMessageEvents['on'](_0x220c5f,_0x2033a3);}}; \ No newline at end of file +var _0x6596=['update','emit','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x538239,_0x156746){var _0x353ac3=function(_0x1bd5cc){while(--_0x1bd5cc){_0x538239['push'](_0x538239['shift']());}};_0x353ac3(++_0x156746);}(_0x6596,0x1d3));var _0x6659=function(_0x1d547d,_0x258166){_0x1d547d=_0x1d547d-0x0;var _0x37b456=_0x6596[_0x1d547d];return _0x37b456;};'use strict';var ChatMessageEvents=require(_0x6659('0x0'));var events=[_0x6659('0x1'),'remove',_0x6659('0x2')];function createListener(_0x114579,_0x3b1b74){return function(_0x2c58e1){_0x3b1b74[_0x6659('0x3')](_0x114579,_0x2c58e1);};}function removeListener(_0x67ac1d,_0x4bfd3c){return function(){ChatMessageEvents['removeListener'](_0x67ac1d,_0x4bfd3c);};}exports[_0x6659('0x4')]=function(_0x3091f1){for(var _0xd6bf59=0x0,_0x1ed458=events[_0x6659('0x5')];_0xd6bf59<_0x1ed458;_0xd6bf59++){var _0x4a900d=events[_0xd6bf59];var _0x485ea0=createListener(_0x6659('0x6')+_0x4a900d,_0x3091f1);ChatMessageEvents['on'](_0x4a900d,_0x485ea0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 22994f6..be865e1 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 _0x39e1=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','chat','chatmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x39e1,0x14b));var _0x139e=function(_0x421273,_0x190dc3){_0x421273=_0x421273-0x0;var _0x564b90=_0x39e1[_0x421273];return _0x564b90;};'use strict';var multer=require('multer');var util=require(_0x139e('0x0'));var path=require('path');var timeout=require(_0x139e('0x1'));var express=require(_0x139e('0x2'));var router=express[_0x139e('0x3')]();var fs_extra=require(_0x139e('0x4'));var auth=require(_0x139e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x139e('0x6'));var controller=require('./chatMessage.controller');router[_0x139e('0x7')]('/',auth[_0x139e('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x139e('0x9')]);router['get']('/:id',auth[_0x139e('0x8')](),controller['show']);router['post']('/',auth[_0x139e('0x8')](),interaction['tracked'](_0x139e('0xa'),_0x139e('0xb')),controller[_0x139e('0xc')]);router[_0x139e('0xd')](_0x139e('0xe'),controller['update']);router['put'](_0x139e('0xf'),auth[_0x139e('0x8')](),controller[_0x139e('0x10')]);router[_0x139e('0xd')](_0x139e('0x11'),auth[_0x139e('0x8')](),controller[_0x139e('0x12')]);router[_0x139e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x139e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6c07=['isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get'];(function(_0x471799,_0x18895b){var _0x4c0d5d=function(_0x397ab7){while(--_0x397ab7){_0x471799['push'](_0x471799['shift']());}};_0x4c0d5d(++_0x18895b);}(_0x6c07,0x10c));var _0x76c0=function(_0x497f5d,_0x23f5fa){_0x497f5d=_0x497f5d-0x0;var _0x5a0c01=_0x6c07[_0x497f5d];return _0x5a0c01;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x76c0('0x0'));var router=express[_0x76c0('0x1')]();var fs_extra=require(_0x76c0('0x2'));var auth=require(_0x76c0('0x3'));var interaction=require(_0x76c0('0x4'));var config=require('../../config/environment');var controller=require(_0x76c0('0x5'));router[_0x76c0('0x6')]('/',auth[_0x76c0('0x7')](),controller[_0x76c0('0x8')]);router[_0x76c0('0x6')](_0x76c0('0x9'),auth[_0x76c0('0x7')](),controller[_0x76c0('0xa')]);router[_0x76c0('0x6')](_0x76c0('0xb'),auth[_0x76c0('0x7')](),controller[_0x76c0('0xc')]);router[_0x76c0('0xd')]('/',auth[_0x76c0('0x7')](),interaction[_0x76c0('0xe')](_0x76c0('0xf'),_0x76c0('0x10')),controller[_0x76c0('0x11')]);router[_0x76c0('0x12')]('/:id',controller[_0x76c0('0x13')]);router[_0x76c0('0x12')](_0x76c0('0x14'),auth['isAuthenticated'](),controller[_0x76c0('0x15')]);router[_0x76c0('0x12')](_0x76c0('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x76c0('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x76c0('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 3039d67..9fc00e8 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 _0x5f66=['medium','TEXT','exports'];(function(_0x36fd49,_0xea7b34){var _0x446d04=function(_0x576c89){while(--_0x576c89){_0x36fd49['push'](_0x36fd49['shift']());}};_0x446d04(++_0xea7b34);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x5a6983,_0x38627f){var _0x516234=function(_0x22fcdc){while(--_0x22fcdc){_0x5a6983['push'](_0x5a6983['shift']());}};_0x516234(++_0x38627f);}(_0x2032,0xd9));var _0x2203=function(_0x43e638,_0x2d898c){_0x43e638=_0x43e638-0x0;var _0x88d9ad=_0x2032[_0x43e638];return _0x88d9ad;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index f98bf65..3253fb7 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(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7a54,0x106));var _0x47a5=function(_0x4f08dd,_0x33b6ec){_0x4f08dd=_0x4f08dd-0x0;var _0x6dd3d7=_0x7a54[_0x4f08dd];return _0x6dd3d7;};'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 _0x9957=['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','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','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'];(function(_0x12a608,_0x42f3b6){var _0x19855a=function(_0x4747ce){while(--_0x4747ce){_0x12a608['push'](_0x12a608['shift']());}};_0x19855a(++_0x42f3b6);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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['ChatOfflineMessage']['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['ChatOfflineMessage'][_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['ChatOfflineMessage'][_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('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 7f497bf..bd60df5 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 _0x8efc=['hasOwnProperty','hook','exports','ChatOfflineMessage','save','remove','emit'];(function(_0x4f0ed9,_0x319274){var _0x58143d=function(_0x4cb6be){while(--_0x4cb6be){_0x4f0ed9['push'](_0x4f0ed9['shift']());}};_0x58143d(++_0x319274);}(_0x8efc,0x8f));var _0xc8ef=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x8efc[_0xd27ded];return _0x5ef850;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc8ef('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8ef('0x1'),'afterUpdate':'update','afterDestroy':_0xc8ef('0x2')};function emitEvent(_0xb39bee){return function(_0x4dbf24,_0x4ee0cc,_0x13b577){ChatOfflineMessageEvents['emit'](_0xb39bee+':'+_0x4dbf24['id'],_0x4dbf24);ChatOfflineMessageEvents[_0xc8ef('0x3')](_0xb39bee,_0x4dbf24);_0x13b577(null);};}for(var e in events){if(events[_0xc8ef('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xc8ef('0x5')](e,emitEvent(event));}}module[_0xc8ef('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x7c23=['update','remove','emit','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x66462e,_0x39ed96){var _0x29e88f=function(_0x47eb3d){while(--_0x47eb3d){_0x66462e['push'](_0x66462e['shift']());}};_0x29e88f(++_0x39ed96);}(_0x7c23,0xad));var _0x37c2=function(_0x179b7e,_0x438a3e){_0x179b7e=_0x179b7e-0x0;var _0x33d28f=_0x7c23[_0x179b7e];return _0x33d28f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x37c2('0x0'))['db'][_0x37c2('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x37c2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x37c2('0x3'),'afterDestroy':_0x37c2('0x4')};function emitEvent(_0x4e44bd){return function(_0x230aeb,_0x4f354a,_0x379b53){ChatOfflineMessageEvents[_0x37c2('0x5')](_0x4e44bd+':'+_0x230aeb['id'],_0x230aeb);ChatOfflineMessageEvents[_0x37c2('0x5')](_0x4e44bd,_0x230aeb);_0x379b53(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x37c2('0x6')](e,emitEvent(event));}}module[_0x37c2('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ade3620..68d5e06 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 _0xdd87=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xdd87,0xfc));var _0x7dd8=function(_0x3e9de5,_0x103a03){_0x3e9de5=_0x3e9de5-0x0;var _0x30f865=_0xdd87[_0x3e9de5];return _0x30f865;};'use strict';var attributes=require(_0x7dd8('0x0'));module[_0x7dd8('0x1')]=function(_0x5c9950){return _0x5c9950[_0x7dd8('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7dd8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7dd8('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa46e=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x50bc41,_0x494f99){var _0x92afea=function(_0x29e774){while(--_0x29e774){_0x50bc41['push'](_0x50bc41['shift']());}};_0x92afea(++_0x494f99);}(_0xa46e,0x12a));var _0xea46=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xa46e[_0x3b231a];return _0x18d67a;};'use strict';var attributes=require(_0xea46('0x0'));module[_0xea46('0x1')]=function(_0x261ca){return _0x261ca['define'](_0xea46('0x2'),attributes,{'tableName':_0xea46('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea46('0x4'),'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 0832fde..57f267b 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 _0xec96=['message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xec96,0x119));var _0x6ec9=function(_0x370847,_0x2123f9){_0x370847=_0x370847-0x0;var _0x60fc1b=_0xec96[_0x370847];return _0x60fc1b;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require(_0x6ec9('0x3'));var rs=require(_0x6ec9('0x4'));var fs=require('fs');var Redis=require(_0x6ec9('0x5'));var db=require(_0x6ec9('0x6'))['db'];var utils=require(_0x6ec9('0x7'));var logger=require('../../config/logger')(_0x6ec9('0x8'));var config=require(_0x6ec9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0xa')][_0x6ec9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e1d0,_0x32dd03,_0x53744b){return new BPromise(function(_0x38869b,_0x404ac0){return client[_0x6ec9('0xc')](_0x34e1d0,_0x53744b)[_0x6ec9('0xd')](function(_0x17e5c8){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x6ec9('0xe'));logger['debug'](_0x6ec9('0xf'),_0x32dd03,_0x6ec9('0xe'),JSON['stringify'](_0x17e5c8));if(_0x17e5c8[_0x6ec9('0x10')]){if(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x11')]===0x1f4){logger[_0x6ec9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x404ac0(_0x17e5c8['error'][_0x6ec9('0x12')]);}logger[_0x6ec9('0x10')](_0x6ec9('0x13'),_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x38869b(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);}else{logger[_0x6ec9('0x14')](_0x6ec9('0x13'),_0x32dd03,_0x6ec9('0xe'));_0x38869b(_0x17e5c8[_0x6ec9('0x15')]['message']);}})[_0x6ec9('0x16')](function(_0x124178){logger['error'](_0x6ec9('0x13'),_0x32dd03,_0x124178);_0x404ac0(_0x124178);});});} \ No newline at end of file +var _0xcb33=['http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5d058f,_0x5ceea6){var _0x1819d8=function(_0x5ee594){while(--_0x5ee594){_0x5d058f['push'](_0x5d058f['shift']());}};_0x1819d8(++_0x5ceea6);}(_0xcb33,0xae));var _0x3cb3=function(_0x3f9fbb,_0x1b0857){_0x3f9fbb=_0x3f9fbb-0x0;var _0xbe958f=_0xcb33[_0x3f9fbb];return _0xbe958f;};'use strict';var _=require(_0x3cb3('0x0'));var util=require(_0x3cb3('0x1'));var moment=require(_0x3cb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cb3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cb3('0x4'))['db'];var utils=require(_0x3cb3('0x5'));var logger=require(_0x3cb3('0x6'))(_0x3cb3('0x7'));var config=require('../../config/environment');var jayson=require(_0x3cb3('0x8'));var client=jayson[_0x3cb3('0x9')][_0x3cb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeef6e3,_0x96383e,_0x438a58){return new BPromise(function(_0x2b14f6,_0x57ba10){return client['request'](_0xeef6e3,_0x438a58)[_0x3cb3('0xb')](function(_0x142337){logger[_0x3cb3('0xc')](_0x3cb3('0xd'),_0x96383e,_0x3cb3('0xe'));logger[_0x3cb3('0xf')](_0x3cb3('0x10'),_0x96383e,'request\x20sent',JSON[_0x3cb3('0x11')](_0x142337));if(_0x142337[_0x3cb3('0x12')]){if(_0x142337[_0x3cb3('0x12')][_0x3cb3('0x13')]===0x1f4){logger[_0x3cb3('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x96383e,_0x142337[_0x3cb3('0x12')][_0x3cb3('0x14')]);return _0x57ba10(_0x142337['error']['message']);}logger['error'](_0x3cb3('0xd'),_0x96383e,_0x142337['error']['message']);return _0x2b14f6(_0x142337[_0x3cb3('0x12')][_0x3cb3('0x14')]);}else{logger[_0x3cb3('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x96383e,_0x3cb3('0xe'));_0x2b14f6(_0x142337[_0x3cb3('0x15')]['message']);}})[_0x3cb3('0x16')](function(_0x1f7833){logger[_0x3cb3('0x12')](_0x3cb3('0xd'),_0x96383e,_0x1f7833);_0x57ba10(_0x1f7833);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 82b6ef2..e66d814 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 _0x48eb=['show','post','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0xdfd39e,_0x400310){var _0x2cf782=function(_0x1cc8c3){while(--_0x1cc8c3){_0xdfd39e['push'](_0xdfd39e['shift']());}};_0x2cf782(++_0x400310);}(_0x48eb,0x147));var _0xb48e=function(_0x2cb4cb,_0x273e65){_0x2cb4cb=_0x2cb4cb-0x0;var _0x5566fd=_0x48eb[_0x2cb4cb];return _0x5566fd;};'use strict';var multer=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb48e('0x2')]();var fs_extra=require(_0xb48e('0x3'));var auth=require(_0xb48e('0x4'));var interaction=require(_0xb48e('0x5'));var config=require(_0xb48e('0x6'));var controller=require(_0xb48e('0x7'));router[_0xb48e('0x8')]('/',auth['isAuthenticated'](),controller[_0xb48e('0x9')]);router['get'](_0xb48e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb48e('0x8')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0xd')]);router[_0xb48e('0xe')]('/',auth[_0xb48e('0xc')](),controller[_0xb48e('0xf')]);router[_0xb48e('0x10')]('/:id',auth[_0xb48e('0xc')](),controller['update']);router[_0xb48e('0x11')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0x12')]);module[_0xb48e('0x13')]=router; \ No newline at end of file +var _0x5433=['get','isAuthenticated','/describe','/:id','post','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./chatOfflineMessage.controller'];(function(_0x348700,_0x512121){var _0x1b2496=function(_0x5e5cc2){while(--_0x5e5cc2){_0x348700['push'](_0x348700['shift']());}};_0x1b2496(++_0x512121);}(_0x5433,0x1b9));var _0x3543=function(_0x64b851,_0x4a8c0c){_0x64b851=_0x64b851-0x0;var _0x5217aa=_0x5433[_0x64b851];return _0x5217aa;};'use strict';var multer=require(_0x3543('0x0'));var util=require(_0x3543('0x1'));var path=require('path');var timeout=require(_0x3543('0x2'));var express=require('express');var router=express[_0x3543('0x3')]();var fs_extra=require(_0x3543('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3543('0x5'));var controller=require(_0x3543('0x6'));router[_0x3543('0x7')]('/',auth[_0x3543('0x8')](),controller['index']);router[_0x3543('0x7')](_0x3543('0x9'),auth[_0x3543('0x8')](),controller['describe']);router[_0x3543('0x7')](_0x3543('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3543('0xb')]('/',auth[_0x3543('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3543('0xc')]);router[_0x3543('0xd')](_0x3543('0xa'),auth[_0x3543('0x8')](),controller[_0x3543('0xe')]);module[_0x3543('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 7bcfedd..771ab27 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 _0x0bce=['mouseOver','INTEGER','STRING','ENUM'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x0bce,0x18e));var _0xe0bc=function(_0x594745,_0x28d995){_0x594745=_0x594745-0x0;var _0x543ec7=_0x0bce[_0x594745];return _0x543ec7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0bc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xe0bc('0x1')](_0xe0bc('0x2'),'timeout'),'defaultValue':_0xe0bc('0x2')},'selector':{'type':Sequelize[_0xe0bc('0x0')]},'timeout':{'type':Sequelize[_0xe0bc('0x3')]}}; \ No newline at end of file +var _0x8c23=['STRING','ENUM','mouseOver','timeout','exports'];(function(_0x48f3b8,_0x22693e){var _0x46b12a=function(_0x4fbe89){while(--_0x4fbe89){_0x48f3b8['push'](_0x48f3b8['shift']());}};_0x46b12a(++_0x22693e);}(_0x8c23,0x90));var _0x38c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8c23[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x38c2('0x0')]={'name':{'type':Sequelize[_0x38c2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x38c2('0x2')](_0x38c2('0x3'),_0x38c2('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x38c2('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 6201320..fcdf5de 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 _0xa566=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body'];(function(_0x50ca48,_0x493806){var _0x127340=function(_0x340ec7){while(--_0x340ec7){_0x50ca48['push'](_0x50ca48['shift']());}};_0x127340(++_0x493806);}(_0xa566,0x1c1));var _0x6a56=function(_0x192de1,_0x5485f0){_0x192de1=_0x192de1-0x0;var _0x20dc0e=_0xa566[_0x192de1];return _0x20dc0e;};'use strict';var emlformat=require(_0x6a56('0x0'));var rimraf=require(_0x6a56('0x1'));var zipdir=require(_0x6a56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a56('0x3'));var moment=require(_0x6a56('0x4'));var BPromise=require(_0x6a56('0x5'));var Mustache=require(_0x6a56('0x6'));var util=require('util');var path=require(_0x6a56('0x7'));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(_0x6a56('0x8'));var squel=require('squel');var crypto=require(_0x6a56('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6a56('0xa'));var toCsv=require(_0x6a56('0xb'));var querystring=require('querystring');var Papa=require(_0x6a56('0xc'));var Redis=require(_0x6a56('0xd'));var authService=require(_0x6a56('0xe'));var qs=require(_0x6a56('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a56('0x10'));var logger=require(_0x6a56('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6a56('0x12'));var licenseUtil=require(_0x6a56('0x13'));var db=require(_0x6a56('0x14'))['db'];function respondWithStatusCode(_0x26f443,_0x3e9389){_0x3e9389=_0x3e9389||0xcc;return function(_0x10f894){if(_0x10f894){return _0x26f443[_0x6a56('0x15')](_0x3e9389);}return _0x26f443['status'](_0x3e9389)[_0x6a56('0x16')]();};}function respondWithResult(_0x14237e,_0x46fbaa){_0x46fbaa=_0x46fbaa||0xc8;return function(_0x10fd64){if(_0x10fd64){return _0x14237e[_0x6a56('0x17')](_0x46fbaa)['json'](_0x10fd64);}};}function respondWithFilteredResult(_0x232176,_0xc0e603){return function(_0x28bb4e){if(_0x28bb4e){var _0xc5f78d=typeof _0xc0e603[_0x6a56('0x18')]==='undefined'&&typeof _0xc0e603['limit']===_0x6a56('0x19');var _0x2288b1=_0x28bb4e['count'];var _0x162c52=_0xc5f78d?0x0:_0xc0e603[_0x6a56('0x18')];var _0x4c2f9c=_0xc5f78d?_0x28bb4e[_0x6a56('0x1a')]:_0xc0e603[_0x6a56('0x18')]+_0xc0e603['limit'];var _0x26b33e;if(_0x4c2f9c>=_0x2288b1){_0x4c2f9c=_0x2288b1;_0x26b33e=0xc8;}else{_0x26b33e=0xce;}_0x232176['status'](_0x26b33e);return _0x232176[_0x6a56('0x1b')]('Content-Range',_0x162c52+'-'+_0x4c2f9c+'/'+_0x2288b1)[_0x6a56('0x1c')](_0x28bb4e);}return null;};}function patchUpdates(_0x2239ff){return function(_0x11e479){try{jsonpatch[_0x6a56('0x1d')](_0x11e479,_0x2239ff,!![]);}catch(_0x32118b){return BPromise[_0x6a56('0x1e')](_0x32118b);}return _0x11e479['save']();};}function saveUpdates(_0x2e217a,_0x148548){return function(_0x4845aa){if(_0x4845aa){return _0x4845aa[_0x6a56('0x1f')](_0x2e217a)[_0x6a56('0x20')](function(_0x3cf1b3){return _0x3cf1b3;});}return null;};}function removeEntity(_0x5a0986,_0x2a6ece){return function(_0x3e0aab){if(_0x3e0aab){return _0x3e0aab[_0x6a56('0x21')]()[_0x6a56('0x20')](function(){_0x5a0986[_0x6a56('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d23a,_0x5ce125){return function(_0x302316){if(!_0x302316){_0x51d23a[_0x6a56('0x15')](0x194);}return _0x302316;};}function handleError(_0x2bd80f,_0x55e714){_0x55e714=_0x55e714||0x1f4;return function(_0x1df843){logger[_0x6a56('0x22')](_0x1df843['stack']);if(_0x1df843[_0x6a56('0x23')]){delete _0x1df843[_0x6a56('0x23')];}_0x2bd80f[_0x6a56('0x17')](_0x55e714)['send'](_0x1df843);};}exports[_0x6a56('0x24')]=function(_0x27bcd0,_0x151537){var _0xe26d09={'raw':!![],'where':{'id':_0x27bcd0['params']['id']}},_0x10b1cb={};_0x10b1cb[_0x6a56('0x25')]=_[_0x6a56('0x26')](db[_0x6a56('0x27')][_0x6a56('0x28')]);_0x10b1cb['query']=_[_0x6a56('0x26')](_0x27bcd0[_0x6a56('0x29')]);_0x10b1cb[_0x6a56('0x2a')]=_['intersection'](_0x10b1cb[_0x6a56('0x25')],_0x10b1cb['query']);_0xe26d09[_0x6a56('0x2b')]=_[_0x6a56('0x2c')](_0x10b1cb[_0x6a56('0x25')],qs[_0x6a56('0x2d')](_0x27bcd0[_0x6a56('0x29')][_0x6a56('0x2d')]));_0xe26d09[_0x6a56('0x2b')]=_0xe26d09[_0x6a56('0x2b')][_0x6a56('0x2e')]?_0xe26d09[_0x6a56('0x2b')]:_0x10b1cb[_0x6a56('0x25')];if(_0x27bcd0['query'][_0x6a56('0x2f')]){_0xe26d09[_0x6a56('0x30')]=[{'all':!![]}];}_0xe26d09=_[_0x6a56('0x31')]({},_0xe26d09,_0x27bcd0[_0x6a56('0x32')]);return db['ChatProactiveAction'][_0x6a56('0x33')](_0xe26d09)[_0x6a56('0x20')](handleEntityNotFound(_0x151537,null))[_0x6a56('0x20')](respondWithResult(_0x151537,null))[_0x6a56('0x34')](handleError(_0x151537,null));};exports['create']=function(_0xf4ff24,_0xadea5b){return db['ChatProactiveAction'][_0x6a56('0x35')](_0xf4ff24['body'],{})[_0x6a56('0x20')](respondWithResult(_0xadea5b,0xc9))[_0x6a56('0x34')](handleError(_0xadea5b,null));};exports[_0x6a56('0x1f')]=function(_0x390444,_0x22ad72){if(_0x390444[_0x6a56('0x36')]['id']){delete _0x390444[_0x6a56('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a56('0x33')]({'where':{'id':_0x390444[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x22ad72,null))[_0x6a56('0x20')](saveUpdates(_0x390444[_0x6a56('0x36')],null))[_0x6a56('0x20')](respondWithResult(_0x22ad72,null))[_0x6a56('0x34')](handleError(_0x22ad72,null));};exports[_0x6a56('0x21')]=function(_0x130426,_0x4b1f65){return db[_0x6a56('0x27')][_0x6a56('0x33')]({'where':{'id':_0x130426[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x4b1f65,null))[_0x6a56('0x20')](removeEntity(_0x4b1f65,null))[_0x6a56('0x34')](handleError(_0x4b1f65,null));}; \ No newline at end of file +var _0x277c=['undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset'];(function(_0x26b1b8,_0x35bfd4){var _0x401762=function(_0x49b4f4){while(--_0x49b4f4){_0x26b1b8['push'](_0x26b1b8['shift']());}};_0x401762(++_0x35bfd4);}(_0x277c,0x153));var _0xc277=function(_0x5ab39e,_0x25efc3){_0x5ab39e=_0x5ab39e-0x0;var _0x1f4b9d=_0x277c[_0x5ab39e];return _0x1f4b9d;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={'raw':!![],'where':{'id':_0x4ebb0f[_0xc277('0x2b')]['id']}},_0x3bc773={};_0x3bc773[_0xc277('0x2c')]=_[_0xc277('0x2d')](db['ChatProactiveAction'][_0xc277('0x2e')]);_0x3bc773['query']=_[_0xc277('0x2d')](_0x4ebb0f[_0xc277('0x2f')]);_0x3bc773[_0xc277('0x30')]=_[_0xc277('0x31')](_0x3bc773['model'],_0x3bc773[_0xc277('0x2f')]);_0x388717['attributes']=_[_0xc277('0x31')](_0x3bc773[_0xc277('0x2c')],qs[_0xc277('0x32')](_0x4ebb0f[_0xc277('0x2f')]['fields']));_0x388717[_0xc277('0x33')]=_0x388717[_0xc277('0x33')]['length']?_0x388717[_0xc277('0x33')]:_0x3bc773['model'];if(_0x4ebb0f[_0xc277('0x2f')][_0xc277('0x34')]){_0x388717[_0xc277('0x35')]=[{'all':!![]}];}_0x388717=_[_0xc277('0x36')]({},_0x388717,_0x4ebb0f[_0xc277('0x37')]);return db[_0xc277('0x38')][_0xc277('0x39')](_0x388717)[_0xc277('0x23')](handleEntityNotFound(_0x4efc1e,null))[_0xc277('0x23')](respondWithResult(_0x4efc1e,null))[_0xc277('0x3a')](handleError(_0x4efc1e,null));};exports[_0xc277('0x3b')]=function(_0x5b2329,_0x18ebe8){return db[_0xc277('0x38')][_0xc277('0x3b')](_0x5b2329['body'],{})[_0xc277('0x23')](respondWithResult(_0x18ebe8,0xc9))[_0xc277('0x3a')](handleError(_0x18ebe8,null));};exports[_0xc277('0x22')]=function(_0x3e9701,_0x3522ee){if(_0x3e9701['body']['id']){delete _0x3e9701['body']['id'];}return db[_0xc277('0x38')]['find']({'where':{'id':_0x3e9701[_0xc277('0x2b')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x3522ee,null))[_0xc277('0x23')](saveUpdates(_0x3e9701[_0xc277('0x3c')],null))[_0xc277('0x23')](respondWithResult(_0x3522ee,null))[_0xc277('0x3a')](handleError(_0x3522ee,null));};exports[_0xc277('0x24')]=function(_0x28a2a1,_0x2e35b5){return db[_0xc277('0x38')][_0xc277('0x39')]({'where':{'id':_0x28a2a1['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x2e35b5,null))[_0xc277('0x23')](removeEntity(_0x2e35b5,null))[_0xc277('0x3a')](handleError(_0x2e35b5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7721261..2bdb52c 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 _0x26dd=['path','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4580eb,_0x5d0afa){var _0x3f7f92=function(_0x34a6d0){while(--_0x34a6d0){_0x4580eb['push'](_0x4580eb['shift']());}};_0x3f7f92(++_0x5d0afa);}(_0x26dd,0xf5));var _0xd26d=function(_0xdf61c7,_0x4dbc6e){_0xdf61c7=_0xdf61c7-0x0;var _0x3bb686=_0x26dd[_0xdf61c7];return _0x3bb686;};'use strict';var _=require(_0xd26d('0x0'));var util=require(_0xd26d('0x1'));var logger=require(_0xd26d('0x2'))('api');var moment=require(_0xd26d('0x3'));var BPromise=require(_0xd26d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd26d('0x5'));var rimraf=require('rimraf');var config=require(_0xd26d('0x6'));var attributes=require(_0xd26d('0x7'));module['exports']=function(_0x1a5196,_0x4b653b){return _0x1a5196['define'](_0xd26d('0x8'),attributes,{'tableName':_0xd26d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93b0=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x2490a6,_0x18b0ce){var _0x4a0e07=function(_0x3528a0){while(--_0x3528a0){_0x2490a6['push'](_0x2490a6['shift']());}};_0x4a0e07(++_0x18b0ce);}(_0x93b0,0x119));var _0x093b=function(_0x4319b7,_0x460d0b){_0x4319b7=_0x4319b7-0x0;var _0x167f1e=_0x93b0[_0x4319b7];return _0x167f1e;};'use strict';var _=require(_0x093b('0x0'));var util=require(_0x093b('0x1'));var logger=require(_0x093b('0x2'))(_0x093b('0x3'));var moment=require(_0x093b('0x4'));var BPromise=require(_0x093b('0x5'));var rp=require(_0x093b('0x6'));var fs=require('fs');var path=require(_0x093b('0x7'));var rimraf=require(_0x093b('0x8'));var config=require(_0x093b('0x9'));var attributes=require(_0x093b('0xa'));module['exports']=function(_0x97308c,_0xd7d3cf){return _0x97308c[_0x093b('0xb')](_0x093b('0xc'),attributes,{'tableName':_0x093b('0xd'),'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 694c2b5..64c366f 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 _0xfca1=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird'];(function(_0x118814,_0x1d5d0e){var _0x4dd647=function(_0x4f89f9){while(--_0x4f89f9){_0x118814['push'](_0x118814['shift']());}};_0x4dd647(++_0x1d5d0e);}(_0xfca1,0x168));var _0x1fca=function(_0x2e9497,_0x46a98d){_0x2e9497=_0x2e9497-0x0;var _0x59e0ab=_0xfca1[_0x2e9497];return _0x59e0ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1fca('0x0'));var rs=require(_0x1fca('0x1'));var fs=require('fs');var Redis=require(_0x1fca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fca('0x3'));var logger=require('../../config/logger')(_0x1fca('0x4'));var config=require('../../config/environment');var jayson=require(_0x1fca('0x5'));var client=jayson[_0x1fca('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365e3e,_0x3c4c3d,_0xf917af){return new BPromise(function(_0x573217,_0x1d5771){return client[_0x1fca('0x7')](_0x365e3e,_0xf917af)[_0x1fca('0x8')](function(_0x404500){logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,_0x1fca('0xb'));logger[_0x1fca('0xc')](_0x1fca('0xd'),_0x3c4c3d,'request\x20sent',JSON[_0x1fca('0xe')](_0x404500));if(_0x404500[_0x1fca('0xf')]){if(_0x404500['error'][_0x1fca('0x10')]===0x1f4){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);return _0x1d5771(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')]['message']);return _0x573217(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}else{logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,'request\x20sent');_0x573217(_0x404500['result'][_0x1fca('0x11')]);}})[_0x1fca('0x12')](function(_0x1280b0){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x1280b0);_0x1d5771(_0x1280b0);});});} \ No newline at end of file +var _0x393f=['../../config/logger','../../config/environment','jayson/promise','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x393f,0x18b));var _0xf393=function(_0x18e214,_0x5d08c7){_0x18e214=_0x18e214-0x0;var _0xb3338a=_0x393f[_0x18e214];return _0xb3338a;};'use strict';var _=require(_0xf393('0x0'));var util=require('util');var moment=require(_0xf393('0x1'));var BPromise=require(_0xf393('0x2'));var rs=require(_0xf393('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf393('0x4'));var logger=require(_0xf393('0x5'))('rpc');var config=require(_0xf393('0x6'));var jayson=require(_0xf393('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2601e9,_0x431884,_0x1025b1){return new BPromise(function(_0x2119e7,_0x1195c6){return client[_0xf393('0x8')](_0x2601e9,_0x1025b1)[_0xf393('0x9')](function(_0x292cb4){logger['info'](_0xf393('0xa'),_0x431884,'request\x20sent');logger[_0xf393('0xb')](_0xf393('0xc'),_0x431884,_0xf393('0xd'),JSON[_0xf393('0xe')](_0x292cb4));if(_0x292cb4[_0xf393('0xf')]){if(_0x292cb4[_0xf393('0xf')][_0xf393('0x10')]===0x1f4){logger['error'](_0xf393('0xa'),_0x431884,_0x292cb4['error']['message']);return _0x1195c6(_0x292cb4[_0xf393('0xf')][_0xf393('0x11')]);}logger[_0xf393('0xf')](_0xf393('0xa'),_0x431884,_0x292cb4['error'][_0xf393('0x11')]);return _0x2119e7(_0x292cb4[_0xf393('0xf')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x431884,_0xf393('0xd'));_0x2119e7(_0x292cb4[_0xf393('0x12')][_0xf393('0x11')]);}})[_0xf393('0x13')](function(_0x52c471){logger[_0xf393('0xf')](_0xf393('0xa'),_0x431884,_0x52c471);_0x1195c6(_0x52c471);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1bfc642..8be50a5 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x11f50c,_0x28e6e8){var _0x230df2=function(_0x319145){while(--_0x319145){_0x11f50c['push'](_0x11f50c['shift']());}};_0x230df2(++_0x28e6e8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5b9d0a,_0x105c2a){_0x5b9d0a=_0x5b9d0a-0x0;var _0x1eb7cb=_0xdbf5[_0x5b9d0a];return _0x1eb7cb;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x5437ae,_0x22f60f){var _0x58ce2d=function(_0x5821cc){while(--_0x5821cc){_0x5437ae['push'](_0x5437ae['shift']());}};_0x58ce2d(++_0x22f60f);}(_0x5d17,0x114));var _0x75d1=function(_0xb68695,_0x1881a4){_0xb68695=_0xb68695-0x0;var _0x15a817=_0x5d17[_0xb68695];return _0x15a817;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7262b40..ec43d9a 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 _0x6d5d=['sequelize','exports','INTEGER','beepall'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x6d5d,0x1d4));var _0xd6d5=function(_0x5a5c58,_0x26ced8){_0x5a5c58=_0x5a5c58-0x0;var _0x2e76b9=_0x6d5d[_0x5a5c58];return _0x2e76b9;};'use strict';var Sequelize=require(_0xd6d5('0x0'));module[_0xd6d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd6d5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd6d5('0x3'),'roundrobin')}}; \ No newline at end of file +var _0xabbb=['roundrobin','exports','STRING','ENUM','rrmemory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabbb,0x14b));var _0xbabb=function(_0x1c10ef,_0x54645e){_0x1c10ef=_0x1c10ef-0x0;var _0x1598da=_0xabbb[_0x1c10ef];return _0x1598da;};'use strict';var Sequelize=require('sequelize');module[_0xbabb('0x0')]={'name':{'type':Sequelize[_0xbabb('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbabb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbabb('0x2')](_0xbabb('0x3'),'beepall',_0xbabb('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index df73d2a..7b630fc 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 _0x3465=['result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','ChatQueue','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x3465,0x6e));var _0x5346=function(_0x583ba8,_0x40bb0d){_0x583ba8=_0x583ba8-0x0;var _0x515683=_0x3465[_0x583ba8];return _0x515683;};'use strict';var emlformat=require(_0x5346('0x0'));var rimraf=require(_0x5346('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5346('0x2'));var rp=require(_0x5346('0x3'));var moment=require('moment');var BPromise=require(_0x5346('0x4'));var Mustache=require(_0x5346('0x5'));var util=require(_0x5346('0x6'));var path=require(_0x5346('0x7'));var sox=require(_0x5346('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5346('0x9'));var _=require(_0x5346('0xa'));var squel=require(_0x5346('0xb'));var crypto=require(_0x5346('0xc'));var jsforce=require(_0x5346('0xd'));var deskjs=require(_0x5346('0xe'));var toCsv=require(_0x5346('0xf'));var querystring=require(_0x5346('0x10'));var Papa=require(_0x5346('0x11'));var Redis=require(_0x5346('0x12'));var authService=require(_0x5346('0x13'));var qs=require(_0x5346('0x14'));var as=require(_0x5346('0x15'));var hardwareService=require(_0x5346('0x16'));var logger=require('../../config/logger')(_0x5346('0x17'));var utils=require('../../config/utils');var config=require(_0x5346('0x18'));var licenseUtil=require(_0x5346('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5346('0x1a')](config[_0x5346('0x1b')],{'host':_0x5346('0x1c'),'port':0x18eb});var socket=require(_0x5346('0x1d'))(new Redis(config[_0x5346('0x1b')]));require(_0x5346('0x1e'))[_0x5346('0x1f')](socket);var jayson=require(_0x5346('0x20'));var client=jayson[_0x5346('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57bf39,_0x18304b,_0x239fdf,_0x474407){return new BPromise(function(_0x5e250f,_0x597410){var _0x4eafc5=_0x474407||client;return _0x4eafc5['request'](_0x57bf39,_0x239fdf)[_0x5346('0x22')](function(_0x21dbe2){logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));logger['debug'](_0x5346('0x25'),_0x18304b,_0x5346('0x24'),JSON[_0x5346('0x26')](_0x21dbe2));if(_0x21dbe2[_0x5346('0x27')]){if(_0x21dbe2[_0x5346('0x27')][_0x5346('0x28')]===0x1f4){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2[_0x5346('0x27')][_0x5346('0x2a')]);return _0x597410(_0x21dbe2['error'][_0x5346('0x2a')]);}logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2['error'][_0x5346('0x2a')]);return _0x5e250f(_0x21dbe2['error'][_0x5346('0x2a')]);}else{logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));_0x5e250f(_0x21dbe2[_0x5346('0x2b')][_0x5346('0x2a')]);}})[_0x5346('0x2c')](function(_0x1c3e36){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x1c3e36);_0x597410(_0x1c3e36);});});}function respondWithStatusCode(_0x4619ae,_0x42086c){_0x42086c=_0x42086c||0xcc;return function(_0x2f5169){if(_0x2f5169){return _0x4619ae['sendStatus'](_0x42086c);}return _0x4619ae[_0x5346('0x2d')](_0x42086c)[_0x5346('0x2e')]();};}function respondWithResult(_0x40aafa,_0x7d8747){_0x7d8747=_0x7d8747||0xc8;return function(_0x569a48){if(_0x569a48){return _0x40aafa[_0x5346('0x2d')](_0x7d8747)[_0x5346('0x2f')](_0x569a48);}};}function respondWithFilteredResult(_0x141e24,_0x2a918b){return function(_0x5ed7f1){if(_0x5ed7f1){var _0x459ee7=typeof _0x2a918b[_0x5346('0x30')]===_0x5346('0x31')&&typeof _0x2a918b['limit']===_0x5346('0x31');var _0x302828=_0x5ed7f1['count'];var _0x4fbc8d=_0x459ee7?0x0:_0x2a918b['offset'];var _0x18c747=_0x459ee7?_0x5ed7f1[_0x5346('0x32')]:_0x2a918b['offset']+_0x2a918b[_0x5346('0x33')];var _0x9877f;if(_0x18c747>=_0x302828){_0x18c747=_0x302828;_0x9877f=0xc8;}else{_0x9877f=0xce;}_0x141e24[_0x5346('0x2d')](_0x9877f);return _0x141e24[_0x5346('0x34')](_0x5346('0x35'),_0x4fbc8d+'-'+_0x18c747+'/'+_0x302828)[_0x5346('0x2f')](_0x5ed7f1);}return null;};}function patchUpdates(_0x1f0f9d){return function(_0x4c4ed6){try{jsonpatch[_0x5346('0x36')](_0x4c4ed6,_0x1f0f9d,!![]);}catch(_0x43625e){return BPromise[_0x5346('0x37')](_0x43625e);}return _0x4c4ed6[_0x5346('0x38')]();};}function saveUpdates(_0x2e294c,_0x1f2d3e){return function(_0x5d1c40){if(_0x5d1c40){return _0x5d1c40[_0x5346('0x39')](_0x2e294c)['then'](function(_0x4335d6){return _0x4335d6;});}return null;};}function removeEntity(_0x5a0fff,_0x3c4331){return function(_0x38f80c){if(_0x38f80c){return _0x38f80c[_0x5346('0x3a')]()[_0x5346('0x22')](function(){var _0x17987c=_0x38f80c[_0x5346('0x3b')]({'plain':!![]});var _0x3fe2cb=_0x5346('0x3c');return db[_0x5346('0x3d')][_0x5346('0x3a')]({'where':{'type':_0x3fe2cb,'resourceId':_0x17987c['id']}})[_0x5346('0x22')](function(){return _0x38f80c;});})[_0x5346('0x22')](function(){_0x5a0fff[_0x5346('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a13c,_0x32a8ea){return function(_0x5b8380){if(!_0x5b8380){_0x19a13c[_0x5346('0x3e')](0x194);}return _0x5b8380;};}function handleError(_0x52ff9d,_0xe44220){_0xe44220=_0xe44220||0x1f4;return function(_0x2008db){logger[_0x5346('0x27')](_0x2008db[_0x5346('0x3f')]);if(_0x2008db[_0x5346('0x40')]){delete _0x2008db['name'];}_0x52ff9d[_0x5346('0x2d')](_0xe44220)[_0x5346('0x41')](_0x2008db);};}exports[_0x5346('0x42')]=function(_0x85cc2b,_0x5cb986){var _0x5daa82={},_0x532eaf={},_0x1b4d2c={'count':0x0,'rows':[]};var _0x51fac8=_[_0x5346('0x43')](db['ChatQueue'][_0x5346('0x44')],function(_0x415d72){return{'name':_0x415d72[_0x5346('0x45')],'type':_0x415d72[_0x5346('0x46')][_0x5346('0x47')]};});_0x532eaf[_0x5346('0x48')]=_[_0x5346('0x43')](_0x51fac8,_0x5346('0x40'));_0x532eaf[_0x5346('0x49')]=_['keys'](_0x85cc2b[_0x5346('0x49')]);_0x532eaf['filters']=_[_0x5346('0x4a')](_0x532eaf[_0x5346('0x48')],_0x532eaf[_0x5346('0x49')]);_0x5daa82[_0x5346('0x4b')]=_['intersection'](_0x532eaf[_0x5346('0x48')],qs['fields'](_0x85cc2b[_0x5346('0x49')][_0x5346('0x4c')]));_0x5daa82[_0x5346('0x4b')]=_0x5daa82['attributes']['length']?_0x5daa82[_0x5346('0x4b')]:_0x532eaf[_0x5346('0x48')];if(!_0x85cc2b[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x5daa82[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x85cc2b[_0x5346('0x49')]['limit']);_0x5daa82[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x85cc2b[_0x5346('0x49')]['offset']);}_0x5daa82['order']=qs[_0x5346('0x4f')](_0x85cc2b[_0x5346('0x49')]['sort']);_0x5daa82[_0x5346('0x50')]=qs[_0x5346('0x51')](_['pick'](_0x85cc2b['query'],_0x532eaf[_0x5346('0x51')]),_0x51fac8);if(_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]){_0x5daa82[_0x5346('0x50')]=_[_0x5346('0x53')](_0x5daa82[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x51fac8,function(_0x27180f){if(_0x27180f[_0x5346('0x46')]!==_0x5346('0x54')){var _0x11613a={};_0x11613a[_0x27180f[_0x5346('0x40')]]={'$like':'%'+_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x11613a;}})});}_0x5daa82=_['merge']({},_0x5daa82,_0x85cc2b[_0x5346('0x55')]);var _0x285588={'where':_0x5daa82['where']};return db[_0x5346('0x56')][_0x5346('0x32')](_0x285588)[_0x5346('0x22')](function(_0x229789){_0x1b4d2c[_0x5346('0x32')]=_0x229789;if(_0x85cc2b[_0x5346('0x49')]['includeAll']){_0x5daa82[_0x5346('0x57')]=[{'all':!![]}];}return db[_0x5346('0x56')][_0x5346('0x58')](_0x5daa82);})[_0x5346('0x22')](function(_0x403751){_0x1b4d2c[_0x5346('0x59')]=_0x403751;return _0x1b4d2c;})['then'](respondWithFilteredResult(_0x5cb986,_0x5daa82))[_0x5346('0x2c')](handleError(_0x5cb986,null));};exports[_0x5346('0x5a')]=function(_0x36699c,_0x592fda){var _0x3406cd={'raw':!![],'where':{'id':_0x36699c[_0x5346('0x5b')]['id']}},_0x231bb7={};_0x231bb7[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x56')][_0x5346('0x44')]);_0x231bb7[_0x5346('0x49')]=_['keys'](_0x36699c['query']);_0x231bb7[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x231bb7['model'],_0x231bb7[_0x5346('0x49')]);_0x3406cd[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x231bb7['model'],qs[_0x5346('0x4c')](_0x36699c[_0x5346('0x49')][_0x5346('0x4c')]));_0x3406cd[_0x5346('0x4b')]=_0x3406cd['attributes'][_0x5346('0x5d')]?_0x3406cd[_0x5346('0x4b')]:_0x231bb7[_0x5346('0x48')];if(_0x36699c['query']['includeAll']){_0x3406cd[_0x5346('0x57')]=[{'all':!![]}];}_0x3406cd=_['merge']({},_0x3406cd,_0x36699c[_0x5346('0x55')]);return db[_0x5346('0x56')][_0x5346('0x5e')](_0x3406cd)[_0x5346('0x22')](handleEntityNotFound(_0x592fda,null))['then'](respondWithResult(_0x592fda,null))[_0x5346('0x2c')](handleError(_0x592fda,null));};exports[_0x5346('0x5f')]=function(_0x4ccaa3,_0x4a2a13){return db[_0x5346('0x56')][_0x5346('0x5f')](_0x4ccaa3[_0x5346('0x60')],{})[_0x5346('0x22')](function(_0x59cb30){var _0x39fe6e=_0x4ccaa3[_0x5346('0x61')][_0x5346('0x3b')]({'plain':!![]});if(!_0x39fe6e)throw new Error(_0x5346('0x62'));if(_0x39fe6e[_0x5346('0x63')]===_0x5346('0x61')){var _0x2d38b9=_0x59cb30[_0x5346('0x3b')]({'plain':!![]});var _0x35a0e4=_0x5346('0x3c');return db['UserProfileSection'][_0x5346('0x5e')]({'where':{'name':_0x35a0e4,'userProfileId':_0x39fe6e[_0x5346('0x64')]},'raw':!![]})[_0x5346('0x22')](function(_0x3dc34d){if(_0x3dc34d&&_0x3dc34d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2d38b9[_0x5346('0x40')],'resourceId':_0x2d38b9['id'],'type':_0x3dc34d['name'],'sectionId':_0x3dc34d['id']},{})[_0x5346('0x22')](function(){return _0x59cb30;});}else{return _0x59cb30;}})[_0x5346('0x2c')](function(_0x4641d2){logger[_0x5346('0x27')](_0x5346('0x65'),_0x4641d2);throw _0x4641d2;});}return _0x59cb30;})[_0x5346('0x22')](respondWithResult(_0x4a2a13,0xc9))['catch'](handleError(_0x4a2a13,null));};exports[_0x5346('0x39')]=function(_0x17bfba,_0x262020){if(_0x17bfba[_0x5346('0x60')]['id']){delete _0x17bfba[_0x5346('0x60')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x17bfba['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x262020,null))[_0x5346('0x22')](saveUpdates(_0x17bfba[_0x5346('0x60')],null))[_0x5346('0x22')](respondWithResult(_0x262020,null))[_0x5346('0x2c')](handleError(_0x262020,null));};exports['destroy']=function(_0x43d8ec,_0x59f746){return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x43d8ec[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x59f746,null))[_0x5346('0x22')](removeEntity(_0x59f746,null))[_0x5346('0x2c')](handleError(_0x59f746,null));};exports[_0x5346('0x66')]=function(_0x2279d3,_0x18d527){return db[_0x5346('0x56')][_0x5346('0x66')]()[_0x5346('0x22')](respondWithResult(_0x18d527,null))[_0x5346('0x2c')](handleError(_0x18d527,null));};exports[_0x5346('0x67')]=function(_0x31a9f8,_0xd7f89d,_0x45e3c0){var _0x354f7a={'raw':!![],'where':{}},_0x20857d={},_0x3cbc04;return db['ChatQueue']['findOne']({'where':{'id':_0x31a9f8['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0xd7f89d,null))[_0x5346('0x22')](function(_0x21ccc7){if(_0x21ccc7){_0x3cbc04=_0x21ccc7[_0x5346('0x3b')]({'plain':!![]});_0x20857d[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x68')][_0x5346('0x44')]);_0x20857d['query']=_[_0x5346('0x5c')](_0x31a9f8[_0x5346('0x49')]);_0x20857d[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],_0x20857d[_0x5346('0x49')]);_0x354f7a['attributes']=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],qs['fields'](_0x31a9f8[_0x5346('0x49')]['fields']));_0x354f7a[_0x5346('0x4b')]=_0x354f7a[_0x5346('0x4b')][_0x5346('0x5d')]?_0x354f7a[_0x5346('0x4b')]:_0x20857d[_0x5346('0x48')];if(!_0x31a9f8[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x354f7a[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x31a9f8[_0x5346('0x49')][_0x5346('0x33')]);_0x354f7a[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x31a9f8[_0x5346('0x49')]['offset']);}_0x354f7a[_0x5346('0x69')]=qs[_0x5346('0x4f')](_0x31a9f8['query'][_0x5346('0x4f')]);_0x354f7a[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x31a9f8[_0x5346('0x49')],_0x20857d['filters']));_0x354f7a[_0x5346('0x50')][_0x5346('0x6b')]=_0x21ccc7['id'];if(_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]){_0x354f7a[_0x5346('0x50')]=_[_0x5346('0x53')](_0x354f7a[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x354f7a[_0x5346('0x4b')],function(_0x366331){var _0x5af2e0={};_0x5af2e0[_0x366331]={'$like':'%'+_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x5af2e0;})});}_0x354f7a=_[_0x5346('0x53')]({},_0x354f7a,_0x31a9f8[_0x5346('0x55')]);return db[_0x5346('0x68')]['findAll'](_0x354f7a);}})[_0x5346('0x22')](function(_0x22b865){if(_0x22b865){return db[_0x5346('0x6c')][_0x5346('0x6d')]({'where':{'id':_[_0x5346('0x43')](_0x22b865,'UserId'),'role':_0x5346('0x6e')},'attributes':['id',_0x5346('0x40'),'chatPause',_0x5346('0x6f'),_0x5346('0x70')]});}})[_0x5346('0x22')](function(_0x397cc6){if(_0x397cc6){return{'count':_0x397cc6[_0x5346('0x32')],'rows':_[_0x5346('0x43')](_0x397cc6['rows'],function(_0x2c2ed4){return{'membername':_0x2c2ed4[_0x5346('0x40')],'UserId':_0x2c2ed4['id'],'queue_name':_0x3cbc04['name'],'ChatQueueId':_0x3cbc04['id'],'interface':util[_0x5346('0x71')](_0x5346('0x72'),'SIP',_0x2c2ed4['name']),'penalty':0x0,'paused':_0x2c2ed4['chatPause'],'createdAt':_0x2c2ed4[_0x5346('0x70')],'updatedAt':_0x2c2ed4[_0x5346('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5346('0x22')](respondWithFilteredResult(_0xd7f89d,_0x354f7a))[_0x5346('0x2c')](handleError(_0xd7f89d,null));};exports[_0x5346('0x73')]=function(_0x1efc79,_0x1fcb37,_0x38a941){var _0x2e7149={};var _0x5833b4={};var _0x4011d4;var _0x1e79b4;return db[_0x5346('0x56')][_0x5346('0x74')]({'where':{'id':_0x1efc79[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x1fcb37,null))['then'](function(_0x1ddec6){if(_0x1ddec6){_0x4011d4=_0x1ddec6;_0x5833b4[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x75')][_0x5346('0x44')]);_0x5833b4['query']=_[_0x5346('0x5c')](_0x1efc79[_0x5346('0x49')]);_0x5833b4[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x5833b4[_0x5346('0x48')],_0x5833b4[_0x5346('0x49')]);_0x2e7149[_0x5346('0x4b')]=_['intersection'](_0x5833b4[_0x5346('0x48')],qs['fields'](_0x1efc79['query'][_0x5346('0x4c')]));_0x2e7149[_0x5346('0x4b')]=_0x2e7149[_0x5346('0x4b')][_0x5346('0x5d')]?_0x2e7149[_0x5346('0x4b')]:_0x5833b4[_0x5346('0x48')];_0x2e7149['order']=qs[_0x5346('0x4f')](_0x1efc79[_0x5346('0x49')][_0x5346('0x4f')]);_0x2e7149['where']=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1efc79[_0x5346('0x49')],_0x5833b4['filters']));if(_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]){_0x2e7149['where']=_['merge'](_0x2e7149['where'],{'$or':_[_0x5346('0x43')](_0x2e7149[_0x5346('0x4b')],function(_0x7a7488){var _0x4073ea={};_0x4073ea[_0x7a7488]={'$like':'%'+_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4073ea;})});}_0x2e7149=_[_0x5346('0x53')]({},_0x2e7149,_0x1efc79['options']);return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})[_0x5346('0x22')](function(_0x3889ac){if(_0x3889ac){_0x1e79b4=_0x3889ac['length'];if(!_0x1efc79[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x2e7149[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x1efc79['query']['limit']);_0x2e7149['offset']=qs[_0x5346('0x30')](_0x1efc79[_0x5346('0x49')][_0x5346('0x30')]);}return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})['then'](function(_0x4c8952){if(_0x4c8952){return _0x4c8952?{'count':_0x1e79b4,'rows':_0x4c8952}:null;}})['then'](respondWithResult(_0x1fcb37,null))[_0x5346('0x2c')](handleError(_0x1fcb37,null));};exports[_0x5346('0x76')]=function(_0x4905fd,_0x372416,_0x1333a9){var _0x3db77c=_0x4905fd[_0x5346('0x60')][_0x5346('0x77')];return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x3db77c},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':'Agents','attributes':['id',_0x5346('0x40'),_0x5346('0x78'),'voicePause','interface'],'raw':!![]}]})[_0x5346('0x22')](function(_0x4e19dd){if(_0x4e19dd){var _0xb2c46=_[_0x5346('0x79')](_0x4e19dd,function(_0x4bd2f2){var _0x5dd48b=_0x4bd2f2[_0x5346('0x3b')]({'plain':!![]});return _0x5dd48b[_0x5346('0x7a')];});return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x4905fd[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0x20c6f9){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x2a43c4){return _0x20c6f9[_0x5346('0x76')](_0x3db77c,{'transaction':_0x2a43c4})[_0x5346('0x22')](function(){return BPromise['each'](_0xb2c46,function(_0x7d7a90){return db[_0x5346('0x68')][_0x5346('0x7d')]({'where':{'UserId':_0x7d7a90['id'],'ChatQueueId':_0x4905fd[_0x5346('0x5b')]['id']},'transaction':_0x2a43c4});});})[_0x5346('0x22')](function(){_0xb2c46[_0x5346('0x7e')](function(_0x264123){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':_0x264123['id'],'ChatQueueId':_0x20c6f9['id']});});});});});}})[_0x5346('0x22')](respondWithStatusCode(_0x372416,null))[_0x5346('0x2c')](handleError(_0x372416,null));};exports[_0x5346('0x81')]=function(_0x376a07,_0x26dba4,_0x24ffce){return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x376a07[_0x5346('0x49')][_0x5346('0x77')]},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':_0x5346('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x5346('0x22')](handleEntityNotFound(_0x26dba4,null))[_0x5346('0x22')](function(_0x244042){var _0x1d03c0=_[_0x5346('0x43')](_0x244042,'id');var _0x5efaff=[];var _0x87164=[];var _0x435a31=squel[_0x5346('0x82')]();_0x435a31[_0x5346('0x83')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x5346('0x84')](_0x5346('0x85'),'ut',_0x5346('0x86'))[_0x5346('0x50')](_0x5346('0x87'),_0x376a07[_0x5346('0x5b')]['id']);for(var _0x430700=0x0;_0x430700<_0x244042[_0x5346('0x5d')];_0x430700+=0x1){let _0x84c226=_0x244042[_0x430700];for(var _0x5622d4=0x0;_0x5622d4<_0x84c226['Agents']['length'];_0x5622d4+=0x1){let _0x1094a3=_0x84c226[_0x5346('0x7a')][_0x5622d4];var _0x958494=_0x435a31[_0x5346('0x88')]();_0x958494[_0x5346('0x50')](_0x5346('0x89'),_0x1094a3['id']);_0x87164['push'](db[_0x5346('0x7b')][_0x5346('0x49')](_0x958494[_0x5346('0x8a')](),{'type':db[_0x5346('0x7b')]['QueryTypes'][_0x5346('0x8b')]})[_0x5346('0x22')](function(_0x6e6885){if(_0x6e6885[_0x5346('0x5d')]===0x1){return _0x1094a3['id'];}else{var _0x13e940=_[_0x5346('0x8c')](_['map'](_0x6e6885,_0x5346('0x8d')),function(_0x25bb24){return _[_0x5346('0x8e')](_0x1d03c0,_0x25bb24);});if(_0x13e940){return _0x1094a3['id'];}}}));}}return BPromise[_0x5346('0x8f')](_0x87164)[_0x5346('0x22')](function(_0x4c3bd6){_0x5efaff=_(_0x5efaff)[_0x5346('0x90')](_0x4c3bd6)[_0x5346('0x91')]()[_0x5346('0x92')]();return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x376a07[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0xdc21aa){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x54ab71){return _0xdc21aa[_0x5346('0x81')](_0x376a07[_0x5346('0x49')][_0x5346('0x77')],{'transaction':_0x54ab71})[_0x5346('0x22')](function(){if(!_[_0x5346('0x93')](_0x5efaff)){return _0xdc21aa['removeAgents'](_0x5efaff,{'transaction':_0x54ab71});}})['then'](function(){_0x5efaff[_0x5346('0x7e')](function(_0x33304b){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':_0x33304b,'ChatQueueId':_0xdc21aa['id']});});});});});});})[_0x5346('0x22')](respondWithStatusCode(_0x26dba4,null))[_0x5346('0x2c')](handleError(_0x26dba4,null));};exports['addAgents']=function(_0x51097c,_0x44dd3f,_0x183b47){return db['ChatQueue'][_0x5346('0x5e')]({'where':{'id':_0x51097c[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x44dd3f,null))[_0x5346('0x22')](function(_0x2514d9){if(_0x2514d9){return _0x2514d9[_0x5346('0x95')](_0x51097c[_0x5346('0x60')][_0x5346('0x77')],_['omit'](_0x51097c[_0x5346('0x60')],['ids','id'])||{})[_0x5346('0x96')](function(_0x11ff87){for(var _0x1f9630=0x0;_0x1f9630<_0x51097c['body']['ids'][_0x5346('0x5d')];_0x1f9630+=0x1){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':Number(_0x51097c[_0x5346('0x60')][_0x5346('0x77')][_0x1f9630]),'ChatQueueId':Number(_0x51097c[_0x5346('0x5b')]['id'])});}return _0x11ff87;});}})[_0x5346('0x22')](respondWithResult(_0x44dd3f,null))[_0x5346('0x2c')](handleError(_0x44dd3f,null));};exports[_0x5346('0x97')]=function(_0x488585,_0x537d5e,_0x476116){return db['ChatQueue']['find']({'where':{'id':_0x488585[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x537d5e,null))[_0x5346('0x22')](function(_0x25b4b9){if(_0x25b4b9){return _0x25b4b9['removeAgents'](_0x488585[_0x5346('0x49')][_0x5346('0x77')])['then'](function(){if(_['isArray'](_0x488585['query'][_0x5346('0x77')])){for(var _0xe990b3=0x0;_0xe990b3<_0x488585[_0x5346('0x49')][_0x5346('0x77')][_0x5346('0x5d')];_0xe990b3+=0x1){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585['query'][_0x5346('0x77')][_0xe990b3]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}}else{socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585[_0x5346('0x49')][_0x5346('0x77')]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}});}})[_0x5346('0x22')](respondWithStatusCode(_0x537d5e,null))[_0x5346('0x2c')](handleError(_0x537d5e,null));};exports[_0x5346('0x98')]=function(_0x1cf58b,_0x241004,_0x3f6eed){var _0x106c60={};var _0x25e271={};var _0x3587ce;var _0x2ba96e;return db['ChatQueue'][_0x5346('0x74')]({'where':{'id':_0x1cf58b[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x241004,null))['then'](function(_0x2d1e65){if(_0x2d1e65){_0x3587ce=_0x2d1e65;_0x25e271['model']=_['keys'](db[_0x5346('0x6c')][_0x5346('0x44')]);_0x25e271[_0x5346('0x49')]=_[_0x5346('0x5c')](_0x1cf58b[_0x5346('0x49')]);_0x25e271['filters']=_[_0x5346('0x4a')](_0x25e271[_0x5346('0x48')],_0x25e271[_0x5346('0x49')]);_0x106c60[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x25e271['model'],qs['fields'](_0x1cf58b[_0x5346('0x49')][_0x5346('0x4c')]));_0x106c60[_0x5346('0x4b')]=_0x106c60[_0x5346('0x4b')][_0x5346('0x5d')]?_0x106c60[_0x5346('0x4b')]:_0x25e271[_0x5346('0x48')];_0x106c60['order']=qs['sort'](_0x1cf58b[_0x5346('0x49')]['sort']);_0x106c60[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1cf58b[_0x5346('0x49')],_0x25e271[_0x5346('0x51')]));if(_0x1cf58b[_0x5346('0x49')]['filter']){_0x106c60[_0x5346('0x50')]=_['merge'](_0x106c60[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x106c60[_0x5346('0x4b')],function(_0xe1dc18){var _0x4a0b18={};_0x4a0b18[_0xe1dc18]={'$like':'%'+_0x1cf58b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4a0b18;})});}_0x106c60=_['merge']({},_0x106c60,_0x1cf58b[_0x5346('0x55')]);return _0x3587ce[_0x5346('0x98')](_0x106c60);}})['then'](function(_0x487c8){if(_0x487c8){_0x2ba96e=_0x487c8[_0x5346('0x5d')];if(!_0x1cf58b[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x106c60['limit']=qs[_0x5346('0x33')](_0x1cf58b['query'][_0x5346('0x33')]);_0x106c60[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x1cf58b['query'][_0x5346('0x30')]);}return _0x3587ce[_0x5346('0x98')](_0x106c60);}})[_0x5346('0x22')](function(_0xc1ef7b){if(_0xc1ef7b){return _0xc1ef7b?{'count':_0x2ba96e,'rows':_0xc1ef7b}:null;}})['then'](respondWithResult(_0x241004,null))['catch'](handleError(_0x241004,null));}; \ No newline at end of file +var _0xee86=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','ChatQueue','includeAll','include','findAll','rows','show','params','find','body','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x13b20d,_0x3cae04){var _0x1f56db=function(_0x37dc72){while(--_0x37dc72){_0x13b20d['push'](_0x13b20d['shift']());}};_0x1f56db(++_0x3cae04);}(_0xee86,0x87));var _0x6ee8=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xee86[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x6ee8('0x0'));var rimraf=require(_0x6ee8('0x1'));var zipdir=require(_0x6ee8('0x2'));var jsonpatch=require(_0x6ee8('0x3'));var rp=require(_0x6ee8('0x4'));var moment=require('moment');var BPromise=require(_0x6ee8('0x5'));var Mustache=require(_0x6ee8('0x6'));var util=require(_0x6ee8('0x7'));var path=require(_0x6ee8('0x8'));var sox=require(_0x6ee8('0x9'));var csv=require(_0x6ee8('0xa'));var ejs=require(_0x6ee8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ee8('0xc'));var squel=require(_0x6ee8('0xd'));var crypto=require(_0x6ee8('0xe'));var jsforce=require(_0x6ee8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6ee8('0xa'));var querystring=require(_0x6ee8('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ee8('0x11'));var authService=require(_0x6ee8('0x12'));var qs=require(_0x6ee8('0x13'));var as=require(_0x6ee8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ee8('0x15'))(_0x6ee8('0x16'));var utils=require(_0x6ee8('0x17'));var config=require(_0x6ee8('0x18'));var licenseUtil=require(_0x6ee8('0x19'));var db=require(_0x6ee8('0x1a'))['db'];config[_0x6ee8('0x1b')]=_['defaults'](config[_0x6ee8('0x1b')],{'host':_0x6ee8('0x1c'),'port':0x18eb});var socket=require(_0x6ee8('0x1d'))(new Redis(config[_0x6ee8('0x1b')]));require(_0x6ee8('0x1e'))[_0x6ee8('0x1f')](socket);var jayson=require(_0x6ee8('0x20'));var client=jayson[_0x6ee8('0x21')][_0x6ee8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x288449,_0x5dfa2e,_0x65f88f,_0x39d756){return new BPromise(function(_0x3b7df1,_0x50de28){var _0x14c141=_0x39d756||client;return _0x14c141[_0x6ee8('0x23')](_0x288449,_0x65f88f)['then'](function(_0x58a361){logger[_0x6ee8('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5dfa2e,_0x6ee8('0x25'));logger[_0x6ee8('0x26')](_0x6ee8('0x27'),_0x5dfa2e,'request\x20sent',JSON[_0x6ee8('0x28')](_0x58a361));if(_0x58a361['error']){if(_0x58a361[_0x6ee8('0x29')][_0x6ee8('0x2a')]===0x1f4){logger[_0x6ee8('0x29')](_0x6ee8('0x2b'),_0x5dfa2e,_0x58a361[_0x6ee8('0x29')][_0x6ee8('0x2c')]);return _0x50de28(_0x58a361['error'][_0x6ee8('0x2c')]);}logger[_0x6ee8('0x29')](_0x6ee8('0x2b'),_0x5dfa2e,_0x58a361[_0x6ee8('0x29')][_0x6ee8('0x2c')]);return _0x3b7df1(_0x58a361[_0x6ee8('0x29')][_0x6ee8('0x2c')]);}else{logger[_0x6ee8('0x24')](_0x6ee8('0x2b'),_0x5dfa2e,_0x6ee8('0x25'));_0x3b7df1(_0x58a361[_0x6ee8('0x2d')][_0x6ee8('0x2c')]);}})[_0x6ee8('0x2e')](function(_0x4d4b25){logger['error'](_0x6ee8('0x2b'),_0x5dfa2e,_0x4d4b25);_0x50de28(_0x4d4b25);});});}function respondWithStatusCode(_0x147c1a,_0x17308a){_0x17308a=_0x17308a||0xcc;return function(_0xc4c202){if(_0xc4c202){return _0x147c1a[_0x6ee8('0x2f')](_0x17308a);}return _0x147c1a['status'](_0x17308a)['end']();};}function respondWithResult(_0x2ab84b,_0x238335){_0x238335=_0x238335||0xc8;return function(_0x13767b){if(_0x13767b){return _0x2ab84b[_0x6ee8('0x30')](_0x238335)[_0x6ee8('0x31')](_0x13767b);}};}function respondWithFilteredResult(_0x3f4f85,_0x2c7f7b){return function(_0x5efcf3){if(_0x5efcf3){var _0x275ea4=typeof _0x2c7f7b[_0x6ee8('0x32')]==='undefined'&&typeof _0x2c7f7b['limit']===_0x6ee8('0x33');var _0x93ab0a=_0x5efcf3[_0x6ee8('0x34')];var _0x1ac576=_0x275ea4?0x0:_0x2c7f7b[_0x6ee8('0x32')];var _0x559aa6=_0x275ea4?_0x5efcf3[_0x6ee8('0x34')]:_0x2c7f7b[_0x6ee8('0x32')]+_0x2c7f7b['limit'];var _0x2b9fe8;if(_0x559aa6>=_0x93ab0a){_0x559aa6=_0x93ab0a;_0x2b9fe8=0xc8;}else{_0x2b9fe8=0xce;}_0x3f4f85[_0x6ee8('0x30')](_0x2b9fe8);return _0x3f4f85['set']('Content-Range',_0x1ac576+'-'+_0x559aa6+'/'+_0x93ab0a)[_0x6ee8('0x31')](_0x5efcf3);}return null;};}function patchUpdates(_0x5b833c){return function(_0x1a195b){try{jsonpatch[_0x6ee8('0x35')](_0x1a195b,_0x5b833c,!![]);}catch(_0x230256){return BPromise[_0x6ee8('0x36')](_0x230256);}return _0x1a195b[_0x6ee8('0x37')]();};}function saveUpdates(_0x597f1c,_0x55f659){return function(_0xfd4d60){if(_0xfd4d60){return _0xfd4d60[_0x6ee8('0x38')](_0x597f1c)[_0x6ee8('0x39')](function(_0x1570e3){return _0x1570e3;});}return null;};}function removeEntity(_0x23dbaf,_0xad6d2b){return function(_0x54a4cd){if(_0x54a4cd){return _0x54a4cd['destroy']()[_0x6ee8('0x39')](function(){var _0xc47d25=_0x54a4cd[_0x6ee8('0x3a')]({'plain':!![]});var _0x32bdd8='ChatQueues';return db[_0x6ee8('0x3b')][_0x6ee8('0x3c')]({'where':{'type':_0x32bdd8,'resourceId':_0xc47d25['id']}})['then'](function(){return _0x54a4cd;});})[_0x6ee8('0x39')](function(){_0x23dbaf[_0x6ee8('0x30')](0xcc)[_0x6ee8('0x3d')]();});}};}function handleEntityNotFound(_0xf2ca18,_0x4e7aac){return function(_0x44efd0){if(!_0x44efd0){_0xf2ca18['sendStatus'](0x194);}return _0x44efd0;};}function handleError(_0x29ca8a,_0x1dd95e){_0x1dd95e=_0x1dd95e||0x1f4;return function(_0x2038d3){logger['error'](_0x2038d3['stack']);if(_0x2038d3[_0x6ee8('0x3e')]){delete _0x2038d3[_0x6ee8('0x3e')];}_0x29ca8a[_0x6ee8('0x30')](_0x1dd95e)[_0x6ee8('0x3f')](_0x2038d3);};}exports[_0x6ee8('0x40')]=function(_0x4e3990,_0x9ab483){var _0x544e95={},_0x598d9a={},_0x2443ad={'count':0x0,'rows':[]};var _0x4cba88=_['map'](db['ChatQueue'][_0x6ee8('0x41')],function(_0x148067){return{'name':_0x148067[_0x6ee8('0x42')],'type':_0x148067[_0x6ee8('0x43')][_0x6ee8('0x44')]};});_0x598d9a[_0x6ee8('0x45')]=_['map'](_0x4cba88,_0x6ee8('0x3e'));_0x598d9a[_0x6ee8('0x46')]=_[_0x6ee8('0x47')](_0x4e3990[_0x6ee8('0x46')]);_0x598d9a[_0x6ee8('0x48')]=_[_0x6ee8('0x49')](_0x598d9a[_0x6ee8('0x45')],_0x598d9a[_0x6ee8('0x46')]);_0x544e95[_0x6ee8('0x4a')]=_['intersection'](_0x598d9a[_0x6ee8('0x45')],qs[_0x6ee8('0x4b')](_0x4e3990['query']['fields']));_0x544e95[_0x6ee8('0x4a')]=_0x544e95[_0x6ee8('0x4a')][_0x6ee8('0x4c')]?_0x544e95[_0x6ee8('0x4a')]:_0x598d9a[_0x6ee8('0x45')];if(!_0x4e3990['query'][_0x6ee8('0x4d')](_0x6ee8('0x4e'))){_0x544e95[_0x6ee8('0x4f')]=qs['limit'](_0x4e3990[_0x6ee8('0x46')][_0x6ee8('0x4f')]);_0x544e95[_0x6ee8('0x32')]=qs[_0x6ee8('0x32')](_0x4e3990[_0x6ee8('0x46')][_0x6ee8('0x32')]);}_0x544e95[_0x6ee8('0x50')]=qs[_0x6ee8('0x51')](_0x4e3990[_0x6ee8('0x46')][_0x6ee8('0x51')]);_0x544e95[_0x6ee8('0x52')]=qs[_0x6ee8('0x48')](_[_0x6ee8('0x53')](_0x4e3990[_0x6ee8('0x46')],_0x598d9a[_0x6ee8('0x48')]),_0x4cba88);if(_0x4e3990[_0x6ee8('0x46')]['filter']){_0x544e95[_0x6ee8('0x52')]=_['merge'](_0x544e95['where'],{'$or':_[_0x6ee8('0x54')](_0x4cba88,function(_0x319229){if(_0x319229['type']!==_0x6ee8('0x55')){var _0x24d9b5={};_0x24d9b5[_0x319229[_0x6ee8('0x3e')]]={'$like':'%'+_0x4e3990[_0x6ee8('0x46')][_0x6ee8('0x56')]+'%'};return _0x24d9b5;}})});}_0x544e95=_[_0x6ee8('0x57')]({},_0x544e95,_0x4e3990[_0x6ee8('0x58')]);var _0x118fff={'where':_0x544e95[_0x6ee8('0x52')]};return db[_0x6ee8('0x59')][_0x6ee8('0x34')](_0x118fff)[_0x6ee8('0x39')](function(_0x4abb3d){_0x2443ad[_0x6ee8('0x34')]=_0x4abb3d;if(_0x4e3990['query'][_0x6ee8('0x5a')]){_0x544e95[_0x6ee8('0x5b')]=[{'all':!![]}];}return db['ChatQueue'][_0x6ee8('0x5c')](_0x544e95);})[_0x6ee8('0x39')](function(_0x50d9cb){_0x2443ad[_0x6ee8('0x5d')]=_0x50d9cb;return _0x2443ad;})[_0x6ee8('0x39')](respondWithFilteredResult(_0x9ab483,_0x544e95))['catch'](handleError(_0x9ab483,null));};exports[_0x6ee8('0x5e')]=function(_0x180e08,_0x4c7d1b){var _0x2905e3={'raw':!![],'where':{'id':_0x180e08[_0x6ee8('0x5f')]['id']}},_0x114be3={};_0x114be3[_0x6ee8('0x45')]=_[_0x6ee8('0x47')](db['ChatQueue']['rawAttributes']);_0x114be3[_0x6ee8('0x46')]=_[_0x6ee8('0x47')](_0x180e08[_0x6ee8('0x46')]);_0x114be3[_0x6ee8('0x48')]=_[_0x6ee8('0x49')](_0x114be3[_0x6ee8('0x45')],_0x114be3[_0x6ee8('0x46')]);_0x2905e3[_0x6ee8('0x4a')]=_[_0x6ee8('0x49')](_0x114be3['model'],qs['fields'](_0x180e08[_0x6ee8('0x46')][_0x6ee8('0x4b')]));_0x2905e3['attributes']=_0x2905e3[_0x6ee8('0x4a')][_0x6ee8('0x4c')]?_0x2905e3['attributes']:_0x114be3[_0x6ee8('0x45')];if(_0x180e08['query']['includeAll']){_0x2905e3[_0x6ee8('0x5b')]=[{'all':!![]}];}_0x2905e3=_[_0x6ee8('0x57')]({},_0x2905e3,_0x180e08[_0x6ee8('0x58')]);return db[_0x6ee8('0x59')][_0x6ee8('0x60')](_0x2905e3)[_0x6ee8('0x39')](handleEntityNotFound(_0x4c7d1b,null))[_0x6ee8('0x39')](respondWithResult(_0x4c7d1b,null))[_0x6ee8('0x2e')](handleError(_0x4c7d1b,null));};exports['create']=function(_0x40c090,_0x126837){return db['ChatQueue']['create'](_0x40c090[_0x6ee8('0x61')],{})[_0x6ee8('0x39')](function(_0x1e4998){var _0x14b338=_0x40c090['user']['get']({'plain':!![]});if(!_0x14b338)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14b338[_0x6ee8('0x62')]===_0x6ee8('0x63')){var _0x5bc167=_0x1e4998[_0x6ee8('0x3a')]({'plain':!![]});var _0x8bfb81=_0x6ee8('0x64');return db[_0x6ee8('0x65')][_0x6ee8('0x60')]({'where':{'name':_0x8bfb81,'userProfileId':_0x14b338[_0x6ee8('0x66')]},'raw':!![]})[_0x6ee8('0x39')](function(_0x29e8bb){if(_0x29e8bb&&_0x29e8bb[_0x6ee8('0x67')]===0x0){return db[_0x6ee8('0x3b')][_0x6ee8('0x68')]({'name':_0x5bc167[_0x6ee8('0x3e')],'resourceId':_0x5bc167['id'],'type':_0x29e8bb[_0x6ee8('0x3e')],'sectionId':_0x29e8bb['id']},{})[_0x6ee8('0x39')](function(){return _0x1e4998;});}else{return _0x1e4998;}})[_0x6ee8('0x2e')](function(_0x108148){logger[_0x6ee8('0x29')](_0x6ee8('0x69'),_0x108148);throw _0x108148;});}return _0x1e4998;})[_0x6ee8('0x39')](respondWithResult(_0x126837,0xc9))[_0x6ee8('0x2e')](handleError(_0x126837,null));};exports['update']=function(_0x54c02f,_0x4dbedf){if(_0x54c02f[_0x6ee8('0x61')]['id']){delete _0x54c02f['body']['id'];}return db[_0x6ee8('0x59')][_0x6ee8('0x60')]({'where':{'id':_0x54c02f[_0x6ee8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4dbedf,null))['then'](saveUpdates(_0x54c02f['body'],null))[_0x6ee8('0x39')](respondWithResult(_0x4dbedf,null))[_0x6ee8('0x2e')](handleError(_0x4dbedf,null));};exports[_0x6ee8('0x3c')]=function(_0x22e5db,_0x22dc50){return db['ChatQueue'][_0x6ee8('0x60')]({'where':{'id':_0x22e5db[_0x6ee8('0x5f')]['id']}})[_0x6ee8('0x39')](handleEntityNotFound(_0x22dc50,null))[_0x6ee8('0x39')](removeEntity(_0x22dc50,null))['catch'](handleError(_0x22dc50,null));};exports['describe']=function(_0x2b7caf,_0x53ce6d){return db[_0x6ee8('0x59')]['describe']()['then'](respondWithResult(_0x53ce6d,null))[_0x6ee8('0x2e')](handleError(_0x53ce6d,null));};exports[_0x6ee8('0x6a')]=function(_0x384e13,_0x2f72ab,_0x5beb81){var _0x5cfecb={'raw':!![],'where':{}},_0x2643a8={},_0x5da156;return db['ChatQueue'][_0x6ee8('0x6b')]({'where':{'id':_0x384e13[_0x6ee8('0x5f')]['id']}})[_0x6ee8('0x39')](handleEntityNotFound(_0x2f72ab,null))[_0x6ee8('0x39')](function(_0x1e3ced){if(_0x1e3ced){_0x5da156=_0x1e3ced[_0x6ee8('0x3a')]({'plain':!![]});_0x2643a8[_0x6ee8('0x45')]=_[_0x6ee8('0x47')](db[_0x6ee8('0x6c')]['rawAttributes']);_0x2643a8[_0x6ee8('0x46')]=_[_0x6ee8('0x47')](_0x384e13[_0x6ee8('0x46')]);_0x2643a8[_0x6ee8('0x48')]=_[_0x6ee8('0x49')](_0x2643a8[_0x6ee8('0x45')],_0x2643a8[_0x6ee8('0x46')]);_0x5cfecb[_0x6ee8('0x4a')]=_['intersection'](_0x2643a8[_0x6ee8('0x45')],qs['fields'](_0x384e13[_0x6ee8('0x46')][_0x6ee8('0x4b')]));_0x5cfecb[_0x6ee8('0x4a')]=_0x5cfecb[_0x6ee8('0x4a')]['length']?_0x5cfecb[_0x6ee8('0x4a')]:_0x2643a8[_0x6ee8('0x45')];if(!_0x384e13[_0x6ee8('0x46')][_0x6ee8('0x4d')](_0x6ee8('0x4e'))){_0x5cfecb[_0x6ee8('0x4f')]=qs[_0x6ee8('0x4f')](_0x384e13[_0x6ee8('0x46')]['limit']);_0x5cfecb['offset']=qs[_0x6ee8('0x32')](_0x384e13[_0x6ee8('0x46')][_0x6ee8('0x32')]);}_0x5cfecb[_0x6ee8('0x50')]=qs[_0x6ee8('0x51')](_0x384e13['query'][_0x6ee8('0x51')]);_0x5cfecb[_0x6ee8('0x52')]=qs[_0x6ee8('0x48')](_[_0x6ee8('0x53')](_0x384e13[_0x6ee8('0x46')],_0x2643a8[_0x6ee8('0x48')]));_0x5cfecb[_0x6ee8('0x52')][_0x6ee8('0x6d')]=_0x1e3ced['id'];if(_0x384e13[_0x6ee8('0x46')][_0x6ee8('0x56')]){_0x5cfecb['where']=_[_0x6ee8('0x57')](_0x5cfecb[_0x6ee8('0x52')],{'$or':_['map'](_0x5cfecb[_0x6ee8('0x4a')],function(_0x3d5e16){var _0x2fa05e={};_0x2fa05e[_0x3d5e16]={'$like':'%'+_0x384e13[_0x6ee8('0x46')][_0x6ee8('0x56')]+'%'};return _0x2fa05e;})});}_0x5cfecb=_[_0x6ee8('0x57')]({},_0x5cfecb,_0x384e13[_0x6ee8('0x58')]);return db['UserChatQueue'][_0x6ee8('0x5c')](_0x5cfecb);}})[_0x6ee8('0x39')](function(_0x14102c){if(_0x14102c){return db[_0x6ee8('0x6e')][_0x6ee8('0x6f')]({'where':{'id':_[_0x6ee8('0x54')](_0x14102c,'UserId'),'role':_0x6ee8('0x70')},'attributes':['id',_0x6ee8('0x3e'),_0x6ee8('0x71'),_0x6ee8('0x72'),'createdAt']});}})['then'](function(_0x341781){if(_0x341781){return{'count':_0x341781[_0x6ee8('0x34')],'rows':_[_0x6ee8('0x54')](_0x341781[_0x6ee8('0x5d')],function(_0x24c3f0){return{'membername':_0x24c3f0[_0x6ee8('0x3e')],'UserId':_0x24c3f0['id'],'queue_name':_0x5da156[_0x6ee8('0x3e')],'ChatQueueId':_0x5da156['id'],'interface':util['format'](_0x6ee8('0x73'),_0x6ee8('0x74'),_0x24c3f0['name']),'penalty':0x0,'paused':_0x24c3f0['chatPause'],'createdAt':_0x24c3f0[_0x6ee8('0x75')],'updatedAt':_0x24c3f0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f72ab,_0x5cfecb))[_0x6ee8('0x2e')](handleError(_0x2f72ab,null));};exports['getTeams']=function(_0x5ac9a8,_0x2f1366,_0x3e7ad3){var _0x822bb0={};var _0x2f5db8={};var _0x508982;var _0x77d07d;return db['ChatQueue'][_0x6ee8('0x6b')]({'where':{'id':_0x5ac9a8['params']['id']}})[_0x6ee8('0x39')](handleEntityNotFound(_0x2f1366,null))[_0x6ee8('0x39')](function(_0x10ce64){if(_0x10ce64){_0x508982=_0x10ce64;_0x2f5db8[_0x6ee8('0x45')]=_['keys'](db[_0x6ee8('0x76')]['rawAttributes']);_0x2f5db8[_0x6ee8('0x46')]=_['keys'](_0x5ac9a8['query']);_0x2f5db8[_0x6ee8('0x48')]=_[_0x6ee8('0x49')](_0x2f5db8['model'],_0x2f5db8[_0x6ee8('0x46')]);_0x822bb0[_0x6ee8('0x4a')]=_[_0x6ee8('0x49')](_0x2f5db8['model'],qs[_0x6ee8('0x4b')](_0x5ac9a8[_0x6ee8('0x46')][_0x6ee8('0x4b')]));_0x822bb0[_0x6ee8('0x4a')]=_0x822bb0['attributes'][_0x6ee8('0x4c')]?_0x822bb0[_0x6ee8('0x4a')]:_0x2f5db8[_0x6ee8('0x45')];_0x822bb0[_0x6ee8('0x50')]=qs[_0x6ee8('0x51')](_0x5ac9a8[_0x6ee8('0x46')]['sort']);_0x822bb0[_0x6ee8('0x52')]=qs['filters'](_[_0x6ee8('0x53')](_0x5ac9a8[_0x6ee8('0x46')],_0x2f5db8['filters']));if(_0x5ac9a8[_0x6ee8('0x46')][_0x6ee8('0x56')]){_0x822bb0[_0x6ee8('0x52')]=_[_0x6ee8('0x57')](_0x822bb0['where'],{'$or':_[_0x6ee8('0x54')](_0x822bb0[_0x6ee8('0x4a')],function(_0x505ab5){var _0x122c0f={};_0x122c0f[_0x505ab5]={'$like':'%'+_0x5ac9a8[_0x6ee8('0x46')][_0x6ee8('0x56')]+'%'};return _0x122c0f;})});}_0x822bb0=_[_0x6ee8('0x57')]({},_0x822bb0,_0x5ac9a8[_0x6ee8('0x58')]);return _0x508982[_0x6ee8('0x77')](_0x822bb0);}})[_0x6ee8('0x39')](function(_0x2818b3){if(_0x2818b3){_0x77d07d=_0x2818b3['length'];if(!_0x5ac9a8[_0x6ee8('0x46')][_0x6ee8('0x4d')](_0x6ee8('0x4e'))){_0x822bb0[_0x6ee8('0x4f')]=qs[_0x6ee8('0x4f')](_0x5ac9a8[_0x6ee8('0x46')]['limit']);_0x822bb0[_0x6ee8('0x32')]=qs[_0x6ee8('0x32')](_0x5ac9a8[_0x6ee8('0x46')][_0x6ee8('0x32')]);}return _0x508982[_0x6ee8('0x77')](_0x822bb0);}})['then'](function(_0xe6df1c){if(_0xe6df1c){return _0xe6df1c?{'count':_0x77d07d,'rows':_0xe6df1c}:null;}})['then'](respondWithResult(_0x2f1366,null))[_0x6ee8('0x2e')](handleError(_0x2f1366,null));};exports[_0x6ee8('0x78')]=function(_0x27dbf2,_0x85f1e9,_0x55c0e2){var _0x1ab444=_0x27dbf2['body'][_0x6ee8('0x79')];return db[_0x6ee8('0x76')][_0x6ee8('0x5c')]({'where':{'id':_0x1ab444},'attributes':['id'],'include':[{'model':db[_0x6ee8('0x6e')],'as':_0x6ee8('0x7a'),'attributes':['id',_0x6ee8('0x3e'),_0x6ee8('0x7b'),_0x6ee8('0x7c'),_0x6ee8('0x7d')],'raw':!![]}]})[_0x6ee8('0x39')](function(_0xf8ee6c){if(_0xf8ee6c){var _0x556f7c=_[_0x6ee8('0x7e')](_0xf8ee6c,function(_0x42dd77){var _0x56c99a=_0x42dd77['get']({'plain':!![]});return _0x56c99a['Agents'];});return db[_0x6ee8('0x59')][_0x6ee8('0x60')]({'where':{'id':_0x27dbf2['params']['id']}})['then'](function(_0x22668c){return db[_0x6ee8('0x7f')][_0x6ee8('0x80')](function(_0x4c8a0a){return _0x22668c[_0x6ee8('0x78')](_0x1ab444,{'transaction':_0x4c8a0a})['then'](function(){return BPromise['each'](_0x556f7c,function(_0x178c1d){return db[_0x6ee8('0x6c')][_0x6ee8('0x81')]({'where':{'UserId':_0x178c1d['id'],'ChatQueueId':_0x27dbf2['params']['id']},'transaction':_0x4c8a0a});});})[_0x6ee8('0x39')](function(){_0x556f7c[_0x6ee8('0x82')](function(_0x3b11e8){socket[_0x6ee8('0x83')](_0x6ee8('0x84'),{'UserId':_0x3b11e8['id'],'ChatQueueId':_0x22668c['id']});});});});});}})[_0x6ee8('0x39')](respondWithStatusCode(_0x85f1e9,null))[_0x6ee8('0x2e')](handleError(_0x85f1e9,null));};exports[_0x6ee8('0x85')]=function(_0x1f7d1e,_0x4a1aff,_0x1d3fb3){return db[_0x6ee8('0x76')][_0x6ee8('0x5c')]({'where':{'id':_0x1f7d1e[_0x6ee8('0x46')][_0x6ee8('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ee8('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x6ee8('0x39')](handleEntityNotFound(_0x4a1aff,null))['then'](function(_0x4bc42f){var _0x2823a0=_[_0x6ee8('0x54')](_0x4bc42f,'id');var _0x4a6aa6=[];var _0x4218a1=[];var _0x5a14d9=squel['select']();_0x5a14d9[_0x6ee8('0x86')](_0x6ee8('0x87'))[_0x6ee8('0x88')]('team_has_chat_queues','tq')[_0x6ee8('0x89')](_0x6ee8('0x8a'),'ut',_0x6ee8('0x8b'))[_0x6ee8('0x52')](_0x6ee8('0x8c'),_0x1f7d1e[_0x6ee8('0x5f')]['id']);for(var _0x735e3d=0x0;_0x735e3d<_0x4bc42f[_0x6ee8('0x4c')];_0x735e3d+=0x1){let _0x3b6d98=_0x4bc42f[_0x735e3d];for(var _0x108b8e=0x0;_0x108b8e<_0x3b6d98[_0x6ee8('0x7a')][_0x6ee8('0x4c')];_0x108b8e+=0x1){let _0x15aa9e=_0x3b6d98[_0x6ee8('0x7a')][_0x108b8e];var _0x58f96c=_0x5a14d9[_0x6ee8('0x8d')]();_0x58f96c[_0x6ee8('0x52')](_0x6ee8('0x8e'),_0x15aa9e['id']);_0x4218a1[_0x6ee8('0x8f')](db[_0x6ee8('0x7f')][_0x6ee8('0x46')](_0x58f96c['toString'](),{'type':db[_0x6ee8('0x7f')][_0x6ee8('0x90')][_0x6ee8('0x91')]})[_0x6ee8('0x39')](function(_0x27b730){if(_0x27b730[_0x6ee8('0x4c')]===0x1){return _0x15aa9e['id'];}else{var _0x4744fc=_[_0x6ee8('0x92')](_[_0x6ee8('0x54')](_0x27b730,_0x6ee8('0x93')),function(_0x3cb009){return _[_0x6ee8('0x94')](_0x2823a0,_0x3cb009);});if(_0x4744fc){return _0x15aa9e['id'];}}}));}}return BPromise[_0x6ee8('0x95')](_0x4218a1)[_0x6ee8('0x39')](function(_0x23c747){_0x4a6aa6=_(_0x4a6aa6)[_0x6ee8('0x96')](_0x23c747)[_0x6ee8('0x97')]()[_0x6ee8('0x98')]();return db[_0x6ee8('0x59')][_0x6ee8('0x60')]({'where':{'id':_0x1f7d1e['params']['id']}})['then'](function(_0x1dcf39){return db['sequelize'][_0x6ee8('0x80')](function(_0x1175e6){return _0x1dcf39[_0x6ee8('0x85')](_0x1f7d1e['query']['ids'],{'transaction':_0x1175e6})[_0x6ee8('0x39')](function(){if(!_[_0x6ee8('0x99')](_0x4a6aa6)){return _0x1dcf39['removeAgents'](_0x4a6aa6,{'transaction':_0x1175e6});}})[_0x6ee8('0x39')](function(){_0x4a6aa6[_0x6ee8('0x82')](function(_0xa65384){socket[_0x6ee8('0x83')](_0x6ee8('0x9a'),{'UserId':_0xa65384,'ChatQueueId':_0x1dcf39['id']});});});});});});})[_0x6ee8('0x39')](respondWithStatusCode(_0x4a1aff,null))[_0x6ee8('0x2e')](handleError(_0x4a1aff,null));};exports['addAgents']=function(_0x1eecf9,_0x1c94f9,_0x58f21f){return db[_0x6ee8('0x59')]['find']({'where':{'id':_0x1eecf9[_0x6ee8('0x5f')]['id']}})[_0x6ee8('0x39')](handleEntityNotFound(_0x1c94f9,null))[_0x6ee8('0x39')](function(_0x30ce76){if(_0x30ce76){return _0x30ce76['addAgents'](_0x1eecf9[_0x6ee8('0x61')][_0x6ee8('0x79')],_[_0x6ee8('0x9b')](_0x1eecf9[_0x6ee8('0x61')],['ids','id'])||{})['spread'](function(_0x358020){for(var _0x31a789=0x0;_0x31a789<_0x1eecf9[_0x6ee8('0x61')][_0x6ee8('0x79')]['length'];_0x31a789+=0x1){socket[_0x6ee8('0x83')](_0x6ee8('0x84'),{'UserId':Number(_0x1eecf9['body'][_0x6ee8('0x79')][_0x31a789]),'ChatQueueId':Number(_0x1eecf9[_0x6ee8('0x5f')]['id'])});}return _0x358020;});}})['then'](respondWithResult(_0x1c94f9,null))[_0x6ee8('0x2e')](handleError(_0x1c94f9,null));};exports[_0x6ee8('0x9c')]=function(_0x58aab2,_0x84fbe2,_0x203972){return db[_0x6ee8('0x59')]['find']({'where':{'id':_0x58aab2[_0x6ee8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x84fbe2,null))[_0x6ee8('0x39')](function(_0x458cbc){if(_0x458cbc){return _0x458cbc[_0x6ee8('0x9c')](_0x58aab2[_0x6ee8('0x46')][_0x6ee8('0x79')])[_0x6ee8('0x39')](function(){if(_[_0x6ee8('0x9d')](_0x58aab2[_0x6ee8('0x46')][_0x6ee8('0x79')])){for(var _0x5ad3c9=0x0;_0x5ad3c9<_0x58aab2[_0x6ee8('0x46')][_0x6ee8('0x79')][_0x6ee8('0x4c')];_0x5ad3c9+=0x1){socket[_0x6ee8('0x83')](_0x6ee8('0x9a'),{'UserId':Number(_0x58aab2[_0x6ee8('0x46')][_0x6ee8('0x79')][_0x5ad3c9]),'ChatQueueId':Number(_0x58aab2['params']['id'])});}}else{socket[_0x6ee8('0x83')](_0x6ee8('0x9a'),{'UserId':Number(_0x58aab2[_0x6ee8('0x46')][_0x6ee8('0x79')]),'ChatQueueId':Number(_0x58aab2[_0x6ee8('0x5f')]['id'])});}});}})[_0x6ee8('0x39')](respondWithStatusCode(_0x84fbe2,null))[_0x6ee8('0x2e')](handleError(_0x84fbe2,null));};exports['getAgents']=function(_0x5c4423,_0x3c2bd8,_0x572c2e){var _0x45888a={};var _0x4d0c0b={};var _0x1ab459;var _0x173bfe;return db['ChatQueue'][_0x6ee8('0x6b')]({'where':{'id':_0x5c4423[_0x6ee8('0x5f')]['id']}})[_0x6ee8('0x39')](handleEntityNotFound(_0x3c2bd8,null))[_0x6ee8('0x39')](function(_0x1302f0){if(_0x1302f0){_0x1ab459=_0x1302f0;_0x4d0c0b[_0x6ee8('0x45')]=_[_0x6ee8('0x47')](db[_0x6ee8('0x6e')][_0x6ee8('0x41')]);_0x4d0c0b[_0x6ee8('0x46')]=_[_0x6ee8('0x47')](_0x5c4423['query']);_0x4d0c0b[_0x6ee8('0x48')]=_[_0x6ee8('0x49')](_0x4d0c0b[_0x6ee8('0x45')],_0x4d0c0b['query']);_0x45888a[_0x6ee8('0x4a')]=_[_0x6ee8('0x49')](_0x4d0c0b[_0x6ee8('0x45')],qs[_0x6ee8('0x4b')](_0x5c4423['query']['fields']));_0x45888a['attributes']=_0x45888a[_0x6ee8('0x4a')][_0x6ee8('0x4c')]?_0x45888a[_0x6ee8('0x4a')]:_0x4d0c0b['model'];_0x45888a[_0x6ee8('0x50')]=qs[_0x6ee8('0x51')](_0x5c4423[_0x6ee8('0x46')]['sort']);_0x45888a[_0x6ee8('0x52')]=qs[_0x6ee8('0x48')](_['pick'](_0x5c4423[_0x6ee8('0x46')],_0x4d0c0b[_0x6ee8('0x48')]));if(_0x5c4423[_0x6ee8('0x46')][_0x6ee8('0x56')]){_0x45888a['where']=_['merge'](_0x45888a[_0x6ee8('0x52')],{'$or':_[_0x6ee8('0x54')](_0x45888a[_0x6ee8('0x4a')],function(_0x6b3c4f){var _0x45a5f1={};_0x45a5f1[_0x6b3c4f]={'$like':'%'+_0x5c4423[_0x6ee8('0x46')][_0x6ee8('0x56')]+'%'};return _0x45a5f1;})});}_0x45888a=_[_0x6ee8('0x57')]({},_0x45888a,_0x5c4423[_0x6ee8('0x58')]);return _0x1ab459[_0x6ee8('0x9e')](_0x45888a);}})[_0x6ee8('0x39')](function(_0x15e9ed){if(_0x15e9ed){_0x173bfe=_0x15e9ed['length'];if(!_0x5c4423[_0x6ee8('0x46')]['hasOwnProperty'](_0x6ee8('0x4e'))){_0x45888a[_0x6ee8('0x4f')]=qs[_0x6ee8('0x4f')](_0x5c4423[_0x6ee8('0x46')]['limit']);_0x45888a['offset']=qs[_0x6ee8('0x32')](_0x5c4423[_0x6ee8('0x46')]['offset']);}return _0x1ab459['getAgents'](_0x45888a);}})['then'](function(_0x21999f){if(_0x21999f){return _0x21999f?{'count':_0x173bfe,'rows':_0x21999f}:null;}})[_0x6ee8('0x39')](respondWithResult(_0x3c2bd8,null))[_0x6ee8('0x2e')](handleError(_0x3c2bd8,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ca55fd1..81107e8 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 _0x1195=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x1dc0d6,_0xa034fc){var _0x2d848c=function(_0x2494e5){while(--_0x2494e5){_0x1dc0d6['push'](_0x1dc0d6['shift']());}};_0x2d848c(++_0xa034fc);}(_0x1195,0xc4));var _0x5119=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x1195[_0x29e4c0];return _0x15b64b;};'use strict';var EventEmitter=require(_0x5119('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5119('0x1')](0x0);var events={'afterCreate':_0x5119('0x2'),'afterUpdate':'update','afterDestroy':_0x5119('0x3')};function emitEvent(_0x53400c){return function(_0x233402,_0x1e1546,_0x567cf9){ChatQueueEvents[_0x5119('0x4')](_0x53400c+':'+_0x233402['id'],_0x233402);ChatQueueEvents['emit'](_0x53400c,_0x233402);_0x567cf9(null);};}for(var e in events){if(events[_0x5119('0x5')](e)){var event=events[e];ChatQueue[_0x5119('0x6')](e,emitEvent(event));}}module[_0x5119('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xe642=['hasOwnProperty','exports','events','ChatQueue','update','remove'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xe642,0x17c));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2e64('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x2e64('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e64('0x2'),'afterDestroy':_0x2e64('0x3')};function emitEvent(_0x1f09a4){return function(_0x3d2a0f,_0x3ebc35,_0x47c94c){ChatQueueEvents['emit'](_0x1f09a4+':'+_0x3d2a0f['id'],_0x3d2a0f);ChatQueueEvents['emit'](_0x1f09a4,_0x3d2a0f);_0x47c94c(null);};}for(var e in events){if(events[_0x2e64('0x4')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x2e64('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index afc63cb..a58c517 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 _0x8837=['moment','bluebird','path','rimraf','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x432e72,_0x247efd){var _0x432ccd=function(_0x280670){while(--_0x280670){_0x432e72['push'](_0x432e72['shift']());}};_0x432ccd(++_0x247efd);}(_0x8837,0xd9));var _0x7883=function(_0x38e8ef,_0x59ae9a){_0x38e8ef=_0x38e8ef-0x0;var _0x310744=_0x8837[_0x38e8ef];return _0x310744;};'use strict';var _=require(_0x7883('0x0'));var util=require('util');var logger=require(_0x7883('0x1'))(_0x7883('0x2'));var moment=require(_0x7883('0x3'));var BPromise=require(_0x7883('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7883('0x5'));var rimraf=require(_0x7883('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x7883('0x7')]=function(_0x25e248,_0x557e03){return _0x25e248[_0x7883('0x8')](_0x7883('0x9'),attributes,{'tableName':_0x7883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d11=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3ab693,_0x302b18){var _0x11bd7c=function(_0x51a114){while(--_0x51a114){_0x3ab693['push'](_0x3ab693['shift']());}};_0x11bd7c(++_0x302b18);}(_0x7d11,0x1c2));var _0x17d1=function(_0x4fbb6e,_0x416dbc){_0x4fbb6e=_0x4fbb6e-0x0;var _0x1f55ad=_0x7d11[_0x4fbb6e];return _0x1f55ad;};'use strict';var _=require(_0x17d1('0x0'));var util=require(_0x17d1('0x1'));var logger=require(_0x17d1('0x2'))(_0x17d1('0x3'));var moment=require(_0x17d1('0x4'));var BPromise=require(_0x17d1('0x5'));var rp=require(_0x17d1('0x6'));var fs=require('fs');var path=require(_0x17d1('0x7'));var rimraf=require(_0x17d1('0x8'));var config=require(_0x17d1('0x9'));var attributes=require(_0x17d1('0xa'));module[_0x17d1('0xb')]=function(_0x4ff858,_0x3dfd2a){return _0x4ff858['define']('ChatQueue',attributes,{'tableName':'chat_queues','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 702ed13..ed14b5a 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 _0x1f75=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x1f75,0x13c));var _0x51f7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1f75[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x51f7('0x0'));var moment=require(_0x51f7('0x1'));var BPromise=require(_0x51f7('0x2'));var rs=require(_0x51f7('0x3'));var fs=require('fs');var Redis=require(_0x51f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f7('0x5'));var logger=require(_0x51f7('0x6'))(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var jayson=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232a});config[_0x51f7('0xc')]=_[_0x51f7('0xd')](config[_0x51f7('0xc')],{'host':_0x51f7('0xe'),'port':0x18eb});var socket=require(_0x51f7('0xf'))(new Redis(config['redis']));require(_0x51f7('0x10'))[_0x51f7('0x11')](socket);function respondWithRpcPromise(_0x4d7014,_0x11e24c,_0x3ad08e){return new BPromise(function(_0x4c5629,_0x4ddeb4){return client[_0x51f7('0x12')](_0x4d7014,_0x3ad08e)[_0x51f7('0x13')](function(_0x55e3cd){logger[_0x51f7('0x14')](_0x51f7('0x15'),_0x11e24c,'request\x20sent');logger[_0x51f7('0x16')](_0x51f7('0x17'),_0x11e24c,_0x51f7('0x18'),JSON['stringify'](_0x55e3cd));if(_0x55e3cd['error']){if(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1a')]===0x1f4){logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4ddeb4(_0x55e3cd['error'][_0x51f7('0x1b')]);}logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4c5629(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);}else{logger['info'](_0x51f7('0x15'),_0x11e24c,_0x51f7('0x18'));_0x4c5629(_0x55e3cd['result'][_0x51f7('0x1b')]);}})[_0x51f7('0x1c')](function(_0x4dfdef){logger['error']('ChatQueue,\x20%s,\x20%s',_0x11e24c,_0x4dfdef);_0x4ddeb4(_0x4dfdef);});});}exports[_0x51f7('0x1d')]=function(_0x5a4e63){var _0x5c869a=this;return new Promise(function(_0x293eee,_0x1decc1){return db[_0x51f7('0x1e')][_0x51f7('0x1f')]({'raw':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63['options'][_0x51f7('0x22')]||null:null,'attributes':_0x5a4e63['options']?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x23')]||null:null,'limit':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x24')]||null:null,'include':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')],function(_0x47ed7c){return{'model':db[_0x47ed7c[_0x51f7('0x27')]],'as':_0x47ed7c['as'],'attributes':_0x47ed7c[_0x51f7('0x23')],'include':_0x47ed7c[_0x51f7('0x25')]?_['map'](_0x47ed7c[_0x51f7('0x25')],function(_0x11e723){return{'model':db[_0x11e723[_0x51f7('0x27')]],'as':_0x11e723['as'],'attributes':_0x11e723[_0x51f7('0x23')],'include':_0x11e723['include']?_[_0x51f7('0x26')](_0x11e723[_0x51f7('0x25')],function(_0x1d8bf6){return{'model':db[_0x1d8bf6[_0x51f7('0x27')]],'as':_0x1d8bf6['as'],'attributes':_0x1d8bf6[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31cf1f){logger[_0x51f7('0x14')](_0x51f7('0x1d'),_0x5a4e63);logger['debug'](_0x51f7('0x1d'),_0x5a4e63,JSON['stringify'](_0x31cf1f));_0x293eee(_0x31cf1f);})['catch'](function(_0x12a9ce){logger[_0x51f7('0x19')](_0x51f7('0x1d'),_0x12a9ce[_0x51f7('0x1b')],_0x5a4e63);_0x1decc1(_0x5c869a[_0x51f7('0x19')](0x1f4,_0x12a9ce[_0x51f7('0x1b')]));});});};exports[_0x51f7('0x28')]=function(_0x5d7dec){var _0x4a8ee1=this;return new Promise(function(_0x411f39,_0x3e3078){return db[_0x51f7('0x1e')][_0x51f7('0x29')]({'raw':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')]['where']||null:null,'attributes':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec['options'][_0x51f7('0x23')]||null:null,'include':_0x5d7dec['options']?_0x5d7dec[_0x51f7('0x20')]['include']?_[_0x51f7('0x26')](_0x5d7dec['options'][_0x51f7('0x25')],function(_0x2506da){return{'model':db[_0x2506da[_0x51f7('0x27')]],'as':_0x2506da['as'],'attributes':_0x2506da['attributes'],'include':_0x2506da[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x2506da['include'],function(_0x537d7d){return{'model':db[_0x537d7d['model']],'as':_0x537d7d['as'],'attributes':_0x537d7d[_0x51f7('0x23')],'include':_0x537d7d[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x537d7d['include'],function(_0x8f385e){return{'model':db[_0x8f385e[_0x51f7('0x27')]],'as':_0x8f385e['as'],'attributes':_0x8f385e[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12aaa5){logger[_0x51f7('0x14')](_0x51f7('0x28'),_0x5d7dec);logger['debug'](_0x51f7('0x28'),_0x5d7dec,JSON[_0x51f7('0x2a')](_0x12aaa5));_0x411f39(_0x12aaa5);})[_0x51f7('0x1c')](function(_0x48ba5b){logger[_0x51f7('0x19')](_0x51f7('0x28'),_0x48ba5b[_0x51f7('0x1b')],_0x5d7dec);_0x3e3078(_0x4a8ee1[_0x51f7('0x19')](0x1f4,_0x48ba5b[_0x51f7('0x1b')]));});});}; \ No newline at end of file +var _0x2250=['client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatQueue','findAll','options','where','attributes','map','include','model','info','GetChatQueue','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x446103,_0x3b10e3){var _0x25c8cd=function(_0x39c046){while(--_0x39c046){_0x446103['push'](_0x446103['shift']());}};_0x25c8cd(++_0x3b10e3);}(_0x2250,0x178));var _0x0225=function(_0x12fde3,_0x4800c6){_0x12fde3=_0x12fde3-0x0;var _0x521038=_0x2250[_0x12fde3];return _0x521038;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var moment=require(_0x0225('0x2'));var BPromise=require(_0x0225('0x3'));var rs=require(_0x0225('0x4'));var fs=require('fs');var Redis=require(_0x0225('0x5'));var db=require(_0x0225('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require(_0x0225('0xa'));var client=jayson[_0x0225('0xb')][_0x0225('0xc')]({'port':0x232a});config[_0x0225('0xd')]=_[_0x0225('0xe')](config['redis'],{'host':_0x0225('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0225('0x10'))[_0x0225('0x11')](socket);function respondWithRpcPromise(_0x5ad1de,_0x27b060,_0x2cc6dd){return new BPromise(function(_0x4bcde6,_0x4428e6){return client[_0x0225('0x12')](_0x5ad1de,_0x2cc6dd)[_0x0225('0x13')](function(_0x679615){logger['info'](_0x0225('0x14'),_0x27b060,'request\x20sent');logger[_0x0225('0x15')](_0x0225('0x16'),_0x27b060,'request\x20sent',JSON[_0x0225('0x17')](_0x679615));if(_0x679615[_0x0225('0x18')]){if(_0x679615[_0x0225('0x18')][_0x0225('0x19')]===0x1f4){logger[_0x0225('0x18')](_0x0225('0x14'),_0x27b060,_0x679615[_0x0225('0x18')][_0x0225('0x1a')]);return _0x4428e6(_0x679615[_0x0225('0x18')][_0x0225('0x1a')]);}logger[_0x0225('0x18')]('ChatQueue,\x20%s,\x20%s',_0x27b060,_0x679615[_0x0225('0x18')][_0x0225('0x1a')]);return _0x4bcde6(_0x679615['error'][_0x0225('0x1a')]);}else{logger['info'](_0x0225('0x14'),_0x27b060,_0x0225('0x1b'));_0x4bcde6(_0x679615[_0x0225('0x1c')][_0x0225('0x1a')]);}})[_0x0225('0x1d')](function(_0x5ec4ac){logger[_0x0225('0x18')]('ChatQueue,\x20%s,\x20%s',_0x27b060,_0x5ec4ac);_0x4428e6(_0x5ec4ac);});});}exports['GetChatQueue']=function(_0x4bcccf){var _0x465672=this;return new Promise(function(_0x46a72c,_0x22fed3){return db[_0x0225('0x1e')][_0x0225('0x1f')]({'raw':_0x4bcccf[_0x0225('0x20')]?_0x4bcccf[_0x0225('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4bcccf[_0x0225('0x20')]?_0x4bcccf[_0x0225('0x20')][_0x0225('0x21')]||null:null,'attributes':_0x4bcccf['options']?_0x4bcccf['options'][_0x0225('0x22')]||null:null,'limit':_0x4bcccf['options']?_0x4bcccf['options']['limit']||null:null,'include':_0x4bcccf['options']?_0x4bcccf[_0x0225('0x20')]['include']?_[_0x0225('0x23')](_0x4bcccf[_0x0225('0x20')][_0x0225('0x24')],function(_0x2a4b31){return{'model':db[_0x2a4b31[_0x0225('0x25')]],'as':_0x2a4b31['as'],'attributes':_0x2a4b31[_0x0225('0x22')],'include':_0x2a4b31[_0x0225('0x24')]?_['map'](_0x2a4b31[_0x0225('0x24')],function(_0xb193c5){return{'model':db[_0xb193c5[_0x0225('0x25')]],'as':_0xb193c5['as'],'attributes':_0xb193c5[_0x0225('0x22')],'include':_0xb193c5['include']?_['map'](_0xb193c5['include'],function(_0x1c44d5){return{'model':db[_0x1c44d5['model']],'as':_0x1c44d5['as'],'attributes':_0x1c44d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0225('0x13')](function(_0x4eb9ab){logger[_0x0225('0x26')]('GetChatQueue',_0x4bcccf);logger[_0x0225('0x15')]('GetChatQueue',_0x4bcccf,JSON[_0x0225('0x17')](_0x4eb9ab));_0x46a72c(_0x4eb9ab);})[_0x0225('0x1d')](function(_0x3b793a){logger[_0x0225('0x18')](_0x0225('0x27'),_0x3b793a['message'],_0x4bcccf);_0x22fed3(_0x465672[_0x0225('0x18')](0x1f4,_0x3b793a[_0x0225('0x1a')]));});});};exports[_0x0225('0x28')]=function(_0x45d587){var _0x4ab5a8=this;return new Promise(function(_0x36e02a,_0x241631){return db['ChatQueue'][_0x0225('0x29')]({'raw':_0x45d587[_0x0225('0x20')]?_0x45d587[_0x0225('0x20')][_0x0225('0x2a')]===undefined?!![]:![]:!![],'where':_0x45d587[_0x0225('0x20')]?_0x45d587[_0x0225('0x20')]['where']||null:null,'attributes':_0x45d587[_0x0225('0x20')]?_0x45d587['options']['attributes']||null:null,'include':_0x45d587[_0x0225('0x20')]?_0x45d587['options']['include']?_[_0x0225('0x23')](_0x45d587['options'][_0x0225('0x24')],function(_0x54dff4){return{'model':db[_0x54dff4[_0x0225('0x25')]],'as':_0x54dff4['as'],'attributes':_0x54dff4[_0x0225('0x22')],'include':_0x54dff4[_0x0225('0x24')]?_['map'](_0x54dff4[_0x0225('0x24')],function(_0x61f1fe){return{'model':db[_0x61f1fe[_0x0225('0x25')]],'as':_0x61f1fe['as'],'attributes':_0x61f1fe[_0x0225('0x22')],'include':_0x61f1fe[_0x0225('0x24')]?_[_0x0225('0x23')](_0x61f1fe[_0x0225('0x24')],function(_0x2e0bd1){return{'model':db[_0x2e0bd1['model']],'as':_0x2e0bd1['as'],'attributes':_0x2e0bd1['attributes']};}):[]};}):[]};}):[]:[]})[_0x0225('0x13')](function(_0x375958){logger[_0x0225('0x26')](_0x0225('0x28'),_0x45d587);logger[_0x0225('0x15')](_0x0225('0x28'),_0x45d587,JSON[_0x0225('0x17')](_0x375958));_0x36e02a(_0x375958);})['catch'](function(_0x44f675){logger['error'](_0x0225('0x28'),_0x44f675[_0x0225('0x1a')],_0x45d587);_0x241631(_0x4ab5a8[_0x0225('0x18')](0x1f4,_0x44f675[_0x0225('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ebe9ae2..070a5f9 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 _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xf3cd[_0x2459fd];return _0x364cd2;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}}; \ No newline at end of file +var _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x19a5d8,_0x347207){_0x19a5d8=_0x19a5d8-0x0;var _0x30104a=_0x5ad3[_0x19a5d8];return _0x30104a;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 46a6ec4..7db6151 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5fc3[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('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(_0x5dbfe2,_0x2c9d92){var _0x113288=function(_0x54be60){while(--_0x54be60){_0x5dbfe2['push'](_0x5dbfe2['shift']());}};_0x113288(++_0x2c9d92);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'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 04df73a..d212448 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 _0xa786=['DATE','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa786,0x1d2));var _0x6a78=function(_0x230ba8,_0x2fa3ba){_0x230ba8=_0x230ba8-0x0;var _0x4a3d66=_0xa786[_0x230ba8];return _0x4a3d66;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6a78('0x0')]={'uniqueid':{'type':Sequelize[_0x6a78('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6a78('0x1')]},'joinAt':{'type':Sequelize[_0x6a78('0x2')]},'leaveAt':{'type':Sequelize[_0x6a78('0x2')]},'acceptAt':{'type':Sequelize[_0x6a78('0x2')]},'exitAt':{'type':Sequelize[_0x6a78('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x642b=['STRING','DATE','sequelize','exports'];(function(_0x299596,_0x58887e){var _0x129643=function(_0x2ea838){while(--_0x2ea838){_0x299596['push'](_0x299596['shift']());}};_0x129643(++_0x58887e);}(_0x642b,0x196));var _0xb642=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x642b[_0x1928c9];return _0x51b5fb;};'use strict';var moment=require('moment');var Sequelize=require(_0xb642('0x0'));module[_0xb642('0x1')]={'uniqueid':{'type':Sequelize[_0xb642('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb642('0x2')]},'joinAt':{'type':Sequelize[_0xb642('0x3')]},'leaveAt':{'type':Sequelize[_0xb642('0x3')]},'acceptAt':{'type':Sequelize[_0xb642('0x3')]},'exitAt':{'type':Sequelize[_0xb642('0x3')]},'reason':{'type':Sequelize[_0xb642('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 071d91f..20619af 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 _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9fd4,0x16c));var _0x49fd=function(_0x461eaa,_0x5b9604){_0x461eaa=_0x461eaa-0x0;var _0x3f2756=_0x9fd4[_0x461eaa];return _0x3f2756;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['ChatQueueReport']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['ChatQueueReport'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));}; \ No newline at end of file +var _0x539d=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../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','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','includeAll','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0xc689c7,_0x63165a){var _0x535e43=function(_0x429c8b){while(--_0x429c8b){_0xc689c7['push'](_0xc689c7['shift']());}};_0x535e43(++_0x63165a);}(_0x539d,0x17b));var _0xd539=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x539d[_0x1a5946];return _0x25e9d5;};'use strict';var emlformat=require(_0xd539('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd539('0x1'));var jsonpatch=require(_0xd539('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd539('0x3'));var Mustache=require(_0xd539('0x4'));var util=require(_0xd539('0x5'));var path=require(_0xd539('0x6'));var sox=require(_0xd539('0x7'));var csv=require('to-csv');var ejs=require(_0xd539('0x8'));var fs=require('fs');var fs_extra=require(_0xd539('0x9'));var _=require(_0xd539('0xa'));var squel=require(_0xd539('0xb'));var crypto=require(_0xd539('0xc'));var jsforce=require(_0xd539('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd539('0xe'));var querystring=require(_0xd539('0xf'));var Papa=require(_0xd539('0x10'));var Redis=require(_0xd539('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd539('0x12'));var hardwareService=require(_0xd539('0x13'));var logger=require(_0xd539('0x14'))(_0xd539('0x15'));var utils=require(_0xd539('0x16'));var config=require(_0xd539('0x17'));var licenseUtil=require(_0xd539('0x18'));var db=require(_0xd539('0x19'))['db'];function respondWithStatusCode(_0x5209f2,_0x17cbc0){_0x17cbc0=_0x17cbc0||0xcc;return function(_0x1a4645){if(_0x1a4645){return _0x5209f2[_0xd539('0x1a')](_0x17cbc0);}return _0x5209f2[_0xd539('0x1b')](_0x17cbc0)[_0xd539('0x1c')]();};}function respondWithResult(_0xac445e,_0x54706f){_0x54706f=_0x54706f||0xc8;return function(_0x278f49){if(_0x278f49){return _0xac445e[_0xd539('0x1b')](_0x54706f)[_0xd539('0x1d')](_0x278f49);}};}function respondWithFilteredResult(_0x3f402e,_0x23bce1){return function(_0x7b2b41){if(_0x7b2b41){var _0x30aea1=typeof _0x23bce1[_0xd539('0x1e')]===_0xd539('0x1f')&&typeof _0x23bce1[_0xd539('0x20')]===_0xd539('0x1f');var _0x54d8ff=_0x7b2b41[_0xd539('0x21')];var _0x41fb1e=_0x30aea1?0x0:_0x23bce1[_0xd539('0x1e')];var _0x99327a=_0x30aea1?_0x7b2b41[_0xd539('0x21')]:_0x23bce1[_0xd539('0x1e')]+_0x23bce1[_0xd539('0x20')];var _0x1714cf;if(_0x99327a>=_0x54d8ff){_0x99327a=_0x54d8ff;_0x1714cf=0xc8;}else{_0x1714cf=0xce;}_0x3f402e['status'](_0x1714cf);return _0x3f402e['set'](_0xd539('0x22'),_0x41fb1e+'-'+_0x99327a+'/'+_0x54d8ff)[_0xd539('0x1d')](_0x7b2b41);}return null;};}function patchUpdates(_0x3edf97){return function(_0xad186e){try{jsonpatch['apply'](_0xad186e,_0x3edf97,!![]);}catch(_0x91917b){return BPromise[_0xd539('0x23')](_0x91917b);}return _0xad186e[_0xd539('0x24')]();};}function saveUpdates(_0x259dde,_0x11c993){return function(_0x13445e){if(_0x13445e){return _0x13445e[_0xd539('0x25')](_0x259dde)[_0xd539('0x26')](function(_0x349610){return _0x349610;});}return null;};}function removeEntity(_0x56c100,_0x28d376){return function(_0x57789d){if(_0x57789d){return _0x57789d[_0xd539('0x27')]()['then'](function(){_0x56c100['status'](0xcc)[_0xd539('0x1c')]();});}};}function handleEntityNotFound(_0xfd3352,_0x1280c2){return function(_0xc1789e){if(!_0xc1789e){_0xfd3352['sendStatus'](0x194);}return _0xc1789e;};}function handleError(_0x39cef1,_0x495161){_0x495161=_0x495161||0x1f4;return function(_0x1343de){logger[_0xd539('0x28')](_0x1343de[_0xd539('0x29')]);if(_0x1343de[_0xd539('0x2a')]){delete _0x1343de['name'];}_0x39cef1['status'](_0x495161)[_0xd539('0x2b')](_0x1343de);};}exports[_0xd539('0x2c')]=function(_0x4f717b,_0x54b57a){var _0x575b63={},_0xe17d1c={},_0x406710={'count':0x0,'rows':[]};var _0x66b2ab=_[_0xd539('0x2d')](db['ChatQueueReport'][_0xd539('0x2e')],function(_0x2662fe){return{'name':_0x2662fe['fieldName'],'type':_0x2662fe[_0xd539('0x2f')][_0xd539('0x30')]};});_0xe17d1c[_0xd539('0x31')]=_[_0xd539('0x2d')](_0x66b2ab,_0xd539('0x2a'));_0xe17d1c['query']=_[_0xd539('0x32')](_0x4f717b['query']);_0xe17d1c[_0xd539('0x33')]=_['intersection'](_0xe17d1c[_0xd539('0x31')],_0xe17d1c['query']);_0x575b63[_0xd539('0x34')]=_[_0xd539('0x35')](_0xe17d1c[_0xd539('0x31')],qs[_0xd539('0x36')](_0x4f717b[_0xd539('0x37')][_0xd539('0x36')]));_0x575b63[_0xd539('0x34')]=_0x575b63[_0xd539('0x34')][_0xd539('0x38')]?_0x575b63[_0xd539('0x34')]:_0xe17d1c[_0xd539('0x31')];if(!_0x4f717b['query'][_0xd539('0x39')]('nolimit')){_0x575b63[_0xd539('0x20')]=qs[_0xd539('0x20')](_0x4f717b['query'][_0xd539('0x20')]);_0x575b63[_0xd539('0x1e')]=qs['offset'](_0x4f717b['query'][_0xd539('0x1e')]);}_0x575b63[_0xd539('0x3a')]=qs[_0xd539('0x3b')](_0x4f717b[_0xd539('0x37')]['sort']);_0x575b63[_0xd539('0x3c')]=qs[_0xd539('0x33')](_[_0xd539('0x3d')](_0x4f717b[_0xd539('0x37')],_0xe17d1c['filters']),_0x66b2ab);if(_0x4f717b[_0xd539('0x37')][_0xd539('0x3e')]){_0x575b63[_0xd539('0x3c')]=_[_0xd539('0x3f')](_0x575b63[_0xd539('0x3c')],{'$or':_[_0xd539('0x2d')](_0x66b2ab,function(_0x4b5059){if(_0x4b5059['type']!==_0xd539('0x40')){var _0x46eb3f={};_0x46eb3f[_0x4b5059[_0xd539('0x2a')]]={'$like':'%'+_0x4f717b[_0xd539('0x37')]['filter']+'%'};return _0x46eb3f;}})});}_0x575b63=_[_0xd539('0x3f')]({},_0x575b63,_0x4f717b[_0xd539('0x41')]);var _0x14175f={'where':_0x575b63['where']};return db[_0xd539('0x42')]['count'](_0x14175f)[_0xd539('0x26')](function(_0x4b44cf){_0x406710[_0xd539('0x21')]=_0x4b44cf;if(_0x4f717b['query']['includeAll']){_0x575b63[_0xd539('0x43')]=[{'all':!![]}];}return db[_0xd539('0x42')][_0xd539('0x44')](_0x575b63);})[_0xd539('0x26')](function(_0x1917c4){_0x406710[_0xd539('0x45')]=_0x1917c4;return _0x406710;})['then'](respondWithFilteredResult(_0x54b57a,_0x575b63))[_0xd539('0x46')](handleError(_0x54b57a,null));};exports[_0xd539('0x47')]=function(_0x24d43,_0x5d1d2c){var _0x3e9320={'raw':!![],'where':{'id':_0x24d43['params']['id']}},_0x53ea3f={};_0x53ea3f[_0xd539('0x31')]=_[_0xd539('0x32')](db[_0xd539('0x42')][_0xd539('0x2e')]);_0x53ea3f['query']=_[_0xd539('0x32')](_0x24d43[_0xd539('0x37')]);_0x53ea3f[_0xd539('0x33')]=_[_0xd539('0x35')](_0x53ea3f['model'],_0x53ea3f[_0xd539('0x37')]);_0x3e9320[_0xd539('0x34')]=_['intersection'](_0x53ea3f[_0xd539('0x31')],qs[_0xd539('0x36')](_0x24d43[_0xd539('0x37')][_0xd539('0x36')]));_0x3e9320['attributes']=_0x3e9320[_0xd539('0x34')][_0xd539('0x38')]?_0x3e9320[_0xd539('0x34')]:_0x53ea3f[_0xd539('0x31')];if(_0x24d43[_0xd539('0x37')][_0xd539('0x48')]){_0x3e9320[_0xd539('0x43')]=[{'all':!![]}];}_0x3e9320=_[_0xd539('0x3f')]({},_0x3e9320,_0x24d43[_0xd539('0x41')]);return db[_0xd539('0x42')]['find'](_0x3e9320)[_0xd539('0x26')](handleEntityNotFound(_0x5d1d2c,null))[_0xd539('0x26')](respondWithResult(_0x5d1d2c,null))[_0xd539('0x46')](handleError(_0x5d1d2c,null));};exports[_0xd539('0x49')]=function(_0x4f72f7,_0x3c5e1a){return db[_0xd539('0x42')][_0xd539('0x49')](_0x4f72f7[_0xd539('0x4a')],{})[_0xd539('0x26')](respondWithResult(_0x3c5e1a,0xc9))[_0xd539('0x46')](handleError(_0x3c5e1a,null));};exports[_0xd539('0x25')]=function(_0x5e1051,_0x2e47ed){if(_0x5e1051[_0xd539('0x4a')]['id']){delete _0x5e1051[_0xd539('0x4a')]['id'];}return db[_0xd539('0x42')][_0xd539('0x4b')]({'where':{'id':_0x5e1051[_0xd539('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e47ed,null))[_0xd539('0x26')](saveUpdates(_0x5e1051[_0xd539('0x4a')],null))['then'](respondWithResult(_0x2e47ed,null))['catch'](handleError(_0x2e47ed,null));};exports[_0xd539('0x27')]=function(_0x735b36,_0x5caf42){return db[_0xd539('0x42')][_0xd539('0x4b')]({'where':{'id':_0x735b36[_0xd539('0x4c')]['id']}})[_0xd539('0x26')](handleEntityNotFound(_0x5caf42,null))['then'](removeEntity(_0x5caf42,null))[_0xd539('0x46')](handleError(_0x5caf42,null));};exports[_0xd539('0x4d')]=function(_0x2965df,_0x2b794c){return db['ChatQueueReport'][_0xd539('0x4d')]()[_0xd539('0x26')](respondWithResult(_0x2b794c,null))[_0xd539('0x46')](handleError(_0x2b794c,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index ec25308..b7693c5 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e6b2e,_0x43cd8c){var _0x453c51=function(_0x153230){while(--_0x153230){_0x5e6b2e['push'](_0x5e6b2e['shift']());}};_0x453c51(++_0x43cd8c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x51e86d,_0x184749){var _0x56e9eb=function(_0x3b53c3){while(--_0x3b53c3){_0x51e86d['push'](_0x51e86d['shift']());}};_0x56e9eb(++_0x184749);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 585ffc1..5af190d 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 _0x63c6=['body','options','raw','then','info','where','UpdateChatQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x63c6,0xbb));var _0x663c=function(_0x10f318,_0x3b4ab5){_0x10f318=_0x10f318-0x0;var _0x1d471b=_0x63c6[_0x10f318];return _0x1d471b;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x663c('0x2'));var fs=require('fs');var Redis=require(_0x663c('0x3'));var db=require(_0x663c('0x4'))['db'];var utils=require(_0x663c('0x5'));var logger=require(_0x663c('0x6'))(_0x663c('0x7'));var config=require(_0x663c('0x8'));var jayson=require(_0x663c('0x9'));var client=jayson[_0x663c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbe47,_0xe6ac97,_0x3eb551){return new BPromise(function(_0xb32d9e,_0x5b9376){return client[_0x663c('0xb')](_0x1dbe47,_0x3eb551)['then'](function(_0x38dc88){logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));logger[_0x663c('0xe')](_0x663c('0xf'),_0xe6ac97,_0x663c('0xd'),JSON[_0x663c('0x10')](_0x38dc88));if(_0x38dc88[_0x663c('0x11')]){if(_0x38dc88['error']['code']===0x1f4){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x38dc88['error'][_0x663c('0x12')]);return _0x5b9376(_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);}logger[_0x663c('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xe6ac97,_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);return _0xb32d9e(_0x38dc88['error'][_0x663c('0x12')]);}else{logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));_0xb32d9e(_0x38dc88[_0x663c('0x13')][_0x663c('0x12')]);}})[_0x663c('0x14')](function(_0x2d2a8f){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x2d2a8f);_0x5b9376(_0x2d2a8f);});});}exports[_0x663c('0x15')]=function(_0x3c87fe){var _0x517f70=this;return new Promise(function(_0x2fd707,_0x33f149){return db[_0x663c('0x16')]['create'](_0x3c87fe[_0x663c('0x17')],{'raw':_0x3c87fe[_0x663c('0x18')]?_0x3c87fe[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![]})[_0x663c('0x1a')](function(_0x54fa2f){logger[_0x663c('0x1b')](_0x663c('0x15'),_0x3c87fe);logger[_0x663c('0xe')](_0x663c('0x15'),_0x3c87fe,JSON['stringify'](_0x54fa2f));_0x2fd707(_0x54fa2f);})['catch'](function(_0x2ac148){logger[_0x663c('0x11')](_0x663c('0x15'),_0x2ac148[_0x663c('0x12')],_0x3c87fe);_0x33f149(_0x517f70[_0x663c('0x11')](0x1f4,_0x2ac148['message']));});});};exports['UpdateChatQueueReport']=function(_0x4b7213){var _0x2587a5=this;return new Promise(function(_0x357986,_0x35842e){return db[_0x663c('0x16')]['update'](_0x4b7213[_0x663c('0x17')],{'raw':_0x4b7213[_0x663c('0x18')]?_0x4b7213[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b7213[_0x663c('0x18')]?_0x4b7213['options'][_0x663c('0x1c')]||null:null,'attributes':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['attributes']||null:null,'limit':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['limit']||null:null})[_0x663c('0x1a')](function(_0x274a2a){logger[_0x663c('0x1b')](_0x663c('0x1d'),_0x4b7213);logger[_0x663c('0xe')](_0x663c('0x1d'),_0x4b7213,JSON[_0x663c('0x10')](_0x274a2a));_0x357986(_0x274a2a);})['catch'](function(_0x61ebd3){logger[_0x663c('0x11')](_0x663c('0x1d'),_0x61ebd3[_0x663c('0x12')],_0x4b7213);_0x35842e(_0x2587a5[_0x663c('0x11')](0x1f4,_0x61ebd3[_0x663c('0x12')]));});});}; \ No newline at end of file +var _0x52fb=['error','code','message','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x249cc3,_0x824258){var _0x15a543=function(_0x536f62){while(--_0x536f62){_0x249cc3['push'](_0x249cc3['shift']());}};_0x15a543(++_0x824258);}(_0x52fb,0xa8));var _0xb52f=function(_0x2e622f,_0x229227){_0x2e622f=_0x2e622f-0x0;var _0x561288=_0x52fb[_0x2e622f];return _0x561288;};'use strict';var _=require(_0xb52f('0x0'));var util=require('util');var moment=require(_0xb52f('0x1'));var BPromise=require(_0xb52f('0x2'));var rs=require(_0xb52f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb52f('0x4'))['db'];var utils=require(_0xb52f('0x5'));var logger=require('../../config/logger')(_0xb52f('0x6'));var config=require('../../config/environment');var jayson=require(_0xb52f('0x7'));var client=jayson[_0xb52f('0x8')][_0xb52f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48779d,_0x2a6134,_0x5e657e){return new BPromise(function(_0x37a3b3,_0x3d91b8){return client[_0xb52f('0xa')](_0x48779d,_0x5e657e)[_0xb52f('0xb')](function(_0x179296){logger[_0xb52f('0xc')](_0xb52f('0xd'),_0x2a6134,'request\x20sent');logger[_0xb52f('0xe')](_0xb52f('0xf'),_0x2a6134,_0xb52f('0x10'),JSON[_0xb52f('0x11')](_0x179296));if(_0x179296[_0xb52f('0x12')]){if(_0x179296[_0xb52f('0x12')][_0xb52f('0x13')]===0x1f4){logger['error'](_0xb52f('0xd'),_0x2a6134,_0x179296['error'][_0xb52f('0x14')]);return _0x3d91b8(_0x179296[_0xb52f('0x12')][_0xb52f('0x14')]);}logger[_0xb52f('0x12')](_0xb52f('0xd'),_0x2a6134,_0x179296[_0xb52f('0x12')][_0xb52f('0x14')]);return _0x37a3b3(_0x179296[_0xb52f('0x12')]['message']);}else{logger['info'](_0xb52f('0xd'),_0x2a6134,_0xb52f('0x10'));_0x37a3b3(_0x179296['result'][_0xb52f('0x14')]);}})[_0xb52f('0x15')](function(_0x18f886){logger[_0xb52f('0x12')](_0xb52f('0xd'),_0x2a6134,_0x18f886);_0x3d91b8(_0x18f886);});});}exports[_0xb52f('0x16')]=function(_0x5b2417){var _0x157ac1=this;return new Promise(function(_0x5c9cb6,_0x3ab6f1){return db[_0xb52f('0x17')]['create'](_0x5b2417[_0xb52f('0x18')],{'raw':_0x5b2417['options']?_0x5b2417[_0xb52f('0x19')][_0xb52f('0x1a')]===undefined?!![]:![]:!![]})[_0xb52f('0xb')](function(_0x2b23c4){logger[_0xb52f('0xc')](_0xb52f('0x16'),_0x5b2417);logger[_0xb52f('0xe')](_0xb52f('0x16'),_0x5b2417,JSON['stringify'](_0x2b23c4));_0x5c9cb6(_0x2b23c4);})[_0xb52f('0x15')](function(_0x198faf){logger[_0xb52f('0x12')]('CreateChatQueueReport',_0x198faf[_0xb52f('0x14')],_0x5b2417);_0x3ab6f1(_0x157ac1[_0xb52f('0x12')](0x1f4,_0x198faf[_0xb52f('0x14')]));});});};exports[_0xb52f('0x1b')]=function(_0x36341a){var _0x788d3e=this;return new Promise(function(_0x56c318,_0x16ecfa){return db[_0xb52f('0x17')][_0xb52f('0x1c')](_0x36341a[_0xb52f('0x18')],{'raw':_0x36341a[_0xb52f('0x19')]?_0x36341a[_0xb52f('0x19')][_0xb52f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36341a[_0xb52f('0x19')]?_0x36341a['options'][_0xb52f('0x1d')]||null:null,'attributes':_0x36341a['options']?_0x36341a[_0xb52f('0x19')]['attributes']||null:null,'limit':_0x36341a[_0xb52f('0x19')]?_0x36341a[_0xb52f('0x19')][_0xb52f('0x1e')]||null:null})['then'](function(_0x3ffc97){logger['info'](_0xb52f('0x1b'),_0x36341a);logger['debug'](_0xb52f('0x1b'),_0x36341a,JSON[_0xb52f('0x11')](_0x3ffc97));_0x56c318(_0x3ffc97);})[_0xb52f('0x15')](function(_0x2aee08){logger[_0xb52f('0x12')](_0xb52f('0x1b'),_0x2aee08[_0xb52f('0x14')],_0x36341a);_0x16ecfa(_0x788d3e['error'](0x1f4,_0x2aee08['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 0eed898..e554083 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 _0x0b9b=['index','isAuthenticated','describe','show','create','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0b9b,0xf1));var _0xb0b9=function(_0x1e8821,_0x44257b){_0x1e8821=_0x1e8821-0x0;var _0x126b21=_0x0b9b[_0x1e8821];return _0x126b21;};'use strict';var multer=require(_0xb0b9('0x0'));var util=require(_0xb0b9('0x1'));var path=require(_0xb0b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b9('0x3'));var router=express[_0xb0b9('0x4')]();var fs_extra=require(_0xb0b9('0x5'));var auth=require(_0xb0b9('0x6'));var interaction=require(_0xb0b9('0x7'));var config=require(_0xb0b9('0x8'));var controller=require(_0xb0b9('0x9'));router[_0xb0b9('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0b9('0xb')]);router['get']('/describe',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xd')]);router[_0xb0b9('0xa')]('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0b9('0xf')]);router['put']('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x10')]);router[_0xb0b9('0x11')](_0xb0b9('0x12'),auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x13')]);module[_0xb0b9('0x14')]=router; \ No newline at end of file +var _0xcf20=['/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x42defe,_0x413299){var _0x2977ca=function(_0x2ab8ed){while(--_0x2ab8ed){_0x42defe['push'](_0x42defe['shift']());}};_0x2977ca(++_0x413299);}(_0xcf20,0x111));var _0x0cf2=function(_0x5bdddf,_0x122b93){_0x5bdddf=_0x5bdddf-0x0;var _0x423d60=_0xcf20[_0x5bdddf];return _0x423d60;};'use strict';var multer=require(_0x0cf2('0x0'));var util=require(_0x0cf2('0x1'));var path=require(_0x0cf2('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cf2('0x3'));var router=express[_0x0cf2('0x4')]();var fs_extra=require(_0x0cf2('0x5'));var auth=require(_0x0cf2('0x6'));var interaction=require(_0x0cf2('0x7'));var config=require(_0x0cf2('0x8'));var controller=require(_0x0cf2('0x9'));router[_0x0cf2('0xa')]('/',auth[_0x0cf2('0xb')](),controller[_0x0cf2('0xc')]);router[_0x0cf2('0xa')](_0x0cf2('0xd'),auth[_0x0cf2('0xb')](),controller[_0x0cf2('0xe')]);router[_0x0cf2('0xa')](_0x0cf2('0xf'),auth[_0x0cf2('0xb')](),controller[_0x0cf2('0x10')]);router[_0x0cf2('0x11')]('/',auth[_0x0cf2('0xb')](),controller['create']);router[_0x0cf2('0x12')](_0x0cf2('0xf'),auth[_0x0cf2('0xb')](),controller['update']);router[_0x0cf2('0x13')](_0x0cf2('0xf'),auth[_0x0cf2('0xb')](),controller[_0x0cf2('0x14')]);module[_0x0cf2('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 688ab0a..aa4c9ec 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb43b,0x1b2));var _0xbb43=function(_0x55acc5,_0x9a1492){_0x55acc5=_0x55acc5-0x0;var _0x5521b5=_0xb43b[_0x55acc5];return _0x5521b5;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x361ab2,_0xedfd90){var _0x426f2c=function(_0x9a3591){while(--_0x9a3591){_0x361ab2['push'](_0x361ab2['shift']());}};_0x426f2c(++_0xedfd90);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x00bb[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 14ec664..058ce58 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 _0xdf35=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','merge','ChatTransferReport','rows','catch','show','length','includeAll','include','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1ed46f,_0x7691d7){var _0x43b931=function(_0x5f2454){while(--_0x5f2454){_0x1ed46f['push'](_0x1ed46f['shift']());}};_0x43b931(++_0x7691d7);}(_0xdf35,0xd7));var _0x5df3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdf35[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5df3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5df3('0x1'));var jsonpatch=require(_0x5df3('0x2'));var rp=require(_0x5df3('0x3'));var moment=require(_0x5df3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5df3('0x5'));var sox=require(_0x5df3('0x6'));var csv=require(_0x5df3('0x7'));var ejs=require(_0x5df3('0x8'));var fs=require('fs');var fs_extra=require(_0x5df3('0x9'));var _=require(_0x5df3('0xa'));var squel=require(_0x5df3('0xb'));var crypto=require('crypto');var jsforce=require(_0x5df3('0xc'));var deskjs=require(_0x5df3('0xd'));var toCsv=require(_0x5df3('0x7'));var querystring=require(_0x5df3('0xe'));var Papa=require('papaparse');var Redis=require(_0x5df3('0xf'));var authService=require(_0x5df3('0x10'));var qs=require(_0x5df3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df3('0x12'));var logger=require(_0x5df3('0x13'))('api');var utils=require(_0x5df3('0x14'));var config=require(_0x5df3('0x15'));var licenseUtil=require(_0x5df3('0x16'));var db=require(_0x5df3('0x17'))['db'];function respondWithStatusCode(_0x2aa332,_0x36243c){_0x36243c=_0x36243c||0xcc;return function(_0x155fad){if(_0x155fad){return _0x2aa332[_0x5df3('0x18')](_0x36243c);}return _0x2aa332['status'](_0x36243c)[_0x5df3('0x19')]();};}function respondWithResult(_0x42bca6,_0x57af28){_0x57af28=_0x57af28||0xc8;return function(_0x4af505){if(_0x4af505){return _0x42bca6[_0x5df3('0x1a')](_0x57af28)[_0x5df3('0x1b')](_0x4af505);}};}function respondWithFilteredResult(_0x223439,_0x2066d7){return function(_0x983ddf){if(_0x983ddf){var _0x64cd75=typeof _0x2066d7[_0x5df3('0x1c')]===_0x5df3('0x1d')&&typeof _0x2066d7['limit']===_0x5df3('0x1d');var _0x49f1d9=_0x983ddf[_0x5df3('0x1e')];var _0x54166d=_0x64cd75?0x0:_0x2066d7[_0x5df3('0x1c')];var _0x3f9dc1=_0x64cd75?_0x983ddf['count']:_0x2066d7[_0x5df3('0x1c')]+_0x2066d7['limit'];var _0xf76c8b;if(_0x3f9dc1>=_0x49f1d9){_0x3f9dc1=_0x49f1d9;_0xf76c8b=0xc8;}else{_0xf76c8b=0xce;}_0x223439[_0x5df3('0x1a')](_0xf76c8b);return _0x223439[_0x5df3('0x1f')](_0x5df3('0x20'),_0x54166d+'-'+_0x3f9dc1+'/'+_0x49f1d9)[_0x5df3('0x1b')](_0x983ddf);}return null;};}function patchUpdates(_0x47f820){return function(_0x401a72){try{jsonpatch[_0x5df3('0x21')](_0x401a72,_0x47f820,!![]);}catch(_0x42ef33){return BPromise[_0x5df3('0x22')](_0x42ef33);}return _0x401a72[_0x5df3('0x23')]();};}function saveUpdates(_0x4c9404,_0x1beb40){return function(_0x1feda9){if(_0x1feda9){return _0x1feda9[_0x5df3('0x24')](_0x4c9404)['then'](function(_0x592d43){return _0x592d43;});}return null;};}function removeEntity(_0x8dba27,_0x4d191a){return function(_0x4d769c){if(_0x4d769c){return _0x4d769c[_0x5df3('0x25')]()[_0x5df3('0x26')](function(){_0x8dba27[_0x5df3('0x1a')](0xcc)[_0x5df3('0x19')]();});}};}function handleEntityNotFound(_0x133cbb,_0x30e116){return function(_0x5c28ac){if(!_0x5c28ac){_0x133cbb[_0x5df3('0x18')](0x194);}return _0x5c28ac;};}function handleError(_0x1441ca,_0x247876){_0x247876=_0x247876||0x1f4;return function(_0x5c1141){logger['error'](_0x5c1141[_0x5df3('0x27')]);if(_0x5c1141['name']){delete _0x5c1141[_0x5df3('0x28')];}_0x1441ca['status'](_0x247876)[_0x5df3('0x29')](_0x5c1141);};}exports[_0x5df3('0x2a')]=function(_0x30413a,_0x2070b6){var _0x39c946={},_0x5828d1={},_0xbf5357={'count':0x0,'rows':[]};var _0x1ba198=_['map'](db['ChatTransferReport'][_0x5df3('0x2b')],function(_0x9bd995){return{'name':_0x9bd995[_0x5df3('0x2c')],'type':_0x9bd995[_0x5df3('0x2d')][_0x5df3('0x2e')]};});_0x5828d1[_0x5df3('0x2f')]=_[_0x5df3('0x30')](_0x1ba198,_0x5df3('0x28'));_0x5828d1[_0x5df3('0x31')]=_[_0x5df3('0x32')](_0x30413a[_0x5df3('0x31')]);_0x5828d1['filters']=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],_0x5828d1[_0x5df3('0x31')]);_0x39c946[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x30413a[_0x5df3('0x31')]['fields']));_0x39c946['attributes']=_0x39c946[_0x5df3('0x34')]['length']?_0x39c946[_0x5df3('0x34')]:_0x5828d1['model'];if(!_0x30413a[_0x5df3('0x31')][_0x5df3('0x36')](_0x5df3('0x37'))){_0x39c946[_0x5df3('0x38')]=qs[_0x5df3('0x38')](_0x30413a['query'][_0x5df3('0x38')]);_0x39c946['offset']=qs[_0x5df3('0x1c')](_0x30413a[_0x5df3('0x31')]['offset']);}_0x39c946[_0x5df3('0x39')]=qs[_0x5df3('0x3a')](_0x30413a['query'][_0x5df3('0x3a')]);_0x39c946['where']=qs[_0x5df3('0x3b')](_[_0x5df3('0x3c')](_0x30413a[_0x5df3('0x31')],_0x5828d1['filters']),_0x1ba198);if(_0x30413a['query']['filter']){_0x39c946[_0x5df3('0x3d')]=_['merge'](_0x39c946[_0x5df3('0x3d')],{'$or':_[_0x5df3('0x30')](_0x1ba198,function(_0x18b964){if(_0x18b964[_0x5df3('0x2d')]!==_0x5df3('0x3e')){var _0x1d3662={};_0x1d3662[_0x18b964[_0x5df3('0x28')]]={'$like':'%'+_0x30413a[_0x5df3('0x31')][_0x5df3('0x3f')]+'%'};return _0x1d3662;}})});}_0x39c946=_[_0x5df3('0x40')]({},_0x39c946,_0x30413a['options']);var _0xbc2c0e={'where':_0x39c946[_0x5df3('0x3d')]};return db[_0x5df3('0x41')]['count'](_0xbc2c0e)[_0x5df3('0x26')](function(_0x52699e){_0xbf5357[_0x5df3('0x1e')]=_0x52699e;if(_0x30413a['query']['includeAll']){_0x39c946['include']=[{'all':!![]}];}return db[_0x5df3('0x41')]['findAll'](_0x39c946);})['then'](function(_0x334223){_0xbf5357[_0x5df3('0x42')]=_0x334223;return _0xbf5357;})['then'](respondWithFilteredResult(_0x2070b6,_0x39c946))[_0x5df3('0x43')](handleError(_0x2070b6,null));};exports[_0x5df3('0x44')]=function(_0x36c709,_0x3425b6){var _0x1a4af5={'raw':!![],'where':{'id':_0x36c709['params']['id']}},_0xc3dddf={};_0xc3dddf['model']=_[_0x5df3('0x32')](db['ChatTransferReport'][_0x5df3('0x2b')]);_0xc3dddf['query']=_[_0x5df3('0x32')](_0x36c709[_0x5df3('0x31')]);_0xc3dddf[_0x5df3('0x3b')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],_0xc3dddf['query']);_0x1a4af5[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x36c709[_0x5df3('0x31')]['fields']));_0x1a4af5['attributes']=_0x1a4af5[_0x5df3('0x34')][_0x5df3('0x45')]?_0x1a4af5['attributes']:_0xc3dddf[_0x5df3('0x2f')];if(_0x36c709[_0x5df3('0x31')][_0x5df3('0x46')]){_0x1a4af5[_0x5df3('0x47')]=[{'all':!![]}];}_0x1a4af5=_['merge']({},_0x1a4af5,_0x36c709[_0x5df3('0x48')]);return db[_0x5df3('0x41')][_0x5df3('0x49')](_0x1a4af5)[_0x5df3('0x26')](handleEntityNotFound(_0x3425b6,null))[_0x5df3('0x26')](respondWithResult(_0x3425b6,null))[_0x5df3('0x43')](handleError(_0x3425b6,null));};exports['create']=function(_0x56177f,_0x337e9c){return db[_0x5df3('0x41')][_0x5df3('0x4a')](_0x56177f[_0x5df3('0x4b')],{})['then'](respondWithResult(_0x337e9c,0xc9))[_0x5df3('0x43')](handleError(_0x337e9c,null));};exports[_0x5df3('0x24')]=function(_0x134be4,_0x4acd76){if(_0x134be4[_0x5df3('0x4b')]['id']){delete _0x134be4['body']['id'];}return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x134be4['params']['id']}})['then'](handleEntityNotFound(_0x4acd76,null))['then'](saveUpdates(_0x134be4['body'],null))[_0x5df3('0x26')](respondWithResult(_0x4acd76,null))[_0x5df3('0x43')](handleError(_0x4acd76,null));};exports['destroy']=function(_0x280d39,_0x514d6d){return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x280d39[_0x5df3('0x4c')]['id']}})[_0x5df3('0x26')](handleEntityNotFound(_0x514d6d,null))[_0x5df3('0x26')](removeEntity(_0x514d6d,null))['catch'](handleError(_0x514d6d,null));};exports['describe']=function(_0x5951ed,_0x53532c){return db[_0x5df3('0x41')][_0x5df3('0x4d')]()['then'](respondWithResult(_0x53532c,null))['catch'](handleError(_0x53532c,null));}; \ No newline at end of file +var _0x5ffd=['query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','keys','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','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','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','ChatTransferReport','type'];(function(_0x521eaf,_0x2e9fbd){var _0x42bba3=function(_0x31653c){while(--_0x31653c){_0x521eaf['push'](_0x521eaf['shift']());}};_0x42bba3(++_0x2e9fbd);}(_0x5ffd,0xf5));var _0xd5ff=function(_0x54a592,_0x466299){_0x54a592=_0x54a592-0x0;var _0x535d5e=_0x5ffd[_0x54a592];return _0x535d5e;};'use strict';var emlformat=require(_0xd5ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5ff('0x1'));var jsonpatch=require(_0xd5ff('0x2'));var rp=require(_0xd5ff('0x3'));var moment=require(_0xd5ff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd5ff('0x5'));var util=require(_0xd5ff('0x6'));var path=require(_0xd5ff('0x7'));var sox=require(_0xd5ff('0x8'));var csv=require(_0xd5ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ff('0xa'));var _=require(_0xd5ff('0xb'));var squel=require(_0xd5ff('0xc'));var crypto=require(_0xd5ff('0xd'));var jsforce=require(_0xd5ff('0xe'));var deskjs=require(_0xd5ff('0xf'));var toCsv=require(_0xd5ff('0x9'));var querystring=require(_0xd5ff('0x10'));var Papa=require(_0xd5ff('0x11'));var Redis=require(_0xd5ff('0x12'));var authService=require(_0xd5ff('0x13'));var qs=require(_0xd5ff('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5ff('0x15'))(_0xd5ff('0x16'));var utils=require(_0xd5ff('0x17'));var config=require(_0xd5ff('0x18'));var licenseUtil=require(_0xd5ff('0x19'));var db=require(_0xd5ff('0x1a'))['db'];function respondWithStatusCode(_0x7b1bd1,_0x3ee65a){_0x3ee65a=_0x3ee65a||0xcc;return function(_0x52baf7){if(_0x52baf7){return _0x7b1bd1['sendStatus'](_0x3ee65a);}return _0x7b1bd1[_0xd5ff('0x1b')](_0x3ee65a)['end']();};}function respondWithResult(_0x4faeb5,_0x2dde0b){_0x2dde0b=_0x2dde0b||0xc8;return function(_0x7b9de4){if(_0x7b9de4){return _0x4faeb5[_0xd5ff('0x1b')](_0x2dde0b)[_0xd5ff('0x1c')](_0x7b9de4);}};}function respondWithFilteredResult(_0x45895e,_0x5e8818){return function(_0xa98981){if(_0xa98981){var _0x3faaf8=typeof _0x5e8818['offset']===_0xd5ff('0x1d')&&typeof _0x5e8818[_0xd5ff('0x1e')]===_0xd5ff('0x1d');var _0x455565=_0xa98981[_0xd5ff('0x1f')];var _0x491faa=_0x3faaf8?0x0:_0x5e8818[_0xd5ff('0x20')];var _0xada9e=_0x3faaf8?_0xa98981[_0xd5ff('0x1f')]:_0x5e8818[_0xd5ff('0x20')]+_0x5e8818[_0xd5ff('0x1e')];var _0x5cbbfe;if(_0xada9e>=_0x455565){_0xada9e=_0x455565;_0x5cbbfe=0xc8;}else{_0x5cbbfe=0xce;}_0x45895e[_0xd5ff('0x1b')](_0x5cbbfe);return _0x45895e[_0xd5ff('0x21')](_0xd5ff('0x22'),_0x491faa+'-'+_0xada9e+'/'+_0x455565)[_0xd5ff('0x1c')](_0xa98981);}return null;};}function patchUpdates(_0x1f59b1){return function(_0x1a5db9){try{jsonpatch[_0xd5ff('0x23')](_0x1a5db9,_0x1f59b1,!![]);}catch(_0xada0d5){return BPromise[_0xd5ff('0x24')](_0xada0d5);}return _0x1a5db9[_0xd5ff('0x25')]();};}function saveUpdates(_0x381788,_0x47ba28){return function(_0x4cbfc8){if(_0x4cbfc8){return _0x4cbfc8[_0xd5ff('0x26')](_0x381788)['then'](function(_0x35c94a){return _0x35c94a;});}return null;};}function removeEntity(_0x2ba859,_0x39f23c){return function(_0x4a844b){if(_0x4a844b){return _0x4a844b['destroy']()[_0xd5ff('0x27')](function(){_0x2ba859[_0xd5ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ae15,_0x1b690b){return function(_0x277b43){if(!_0x277b43){_0x45ae15[_0xd5ff('0x28')](0x194);}return _0x277b43;};}function handleError(_0x1d2e3a,_0x465ab0){_0x465ab0=_0x465ab0||0x1f4;return function(_0x30d2c9){logger[_0xd5ff('0x29')](_0x30d2c9['stack']);if(_0x30d2c9[_0xd5ff('0x2a')]){delete _0x30d2c9[_0xd5ff('0x2a')];}_0x1d2e3a[_0xd5ff('0x1b')](_0x465ab0)[_0xd5ff('0x2b')](_0x30d2c9);};}exports['index']=function(_0x3467a1,_0xa6c871){var _0x4f3d55={},_0x5da383={},_0x16f3bd={'count':0x0,'rows':[]};var _0x4d334e=_[_0xd5ff('0x2c')](db[_0xd5ff('0x2d')]['rawAttributes'],function(_0x44bee7){return{'name':_0x44bee7['fieldName'],'type':_0x44bee7[_0xd5ff('0x2e')]['key']};});_0x5da383['model']=_['map'](_0x4d334e,'name');_0x5da383[_0xd5ff('0x2f')]=_['keys'](_0x3467a1[_0xd5ff('0x2f')]);_0x5da383[_0xd5ff('0x30')]=_['intersection'](_0x5da383[_0xd5ff('0x31')],_0x5da383[_0xd5ff('0x2f')]);_0x4f3d55[_0xd5ff('0x32')]=_[_0xd5ff('0x33')](_0x5da383['model'],qs[_0xd5ff('0x34')](_0x3467a1[_0xd5ff('0x2f')][_0xd5ff('0x34')]));_0x4f3d55[_0xd5ff('0x32')]=_0x4f3d55[_0xd5ff('0x32')][_0xd5ff('0x35')]?_0x4f3d55[_0xd5ff('0x32')]:_0x5da383[_0xd5ff('0x31')];if(!_0x3467a1[_0xd5ff('0x2f')][_0xd5ff('0x36')](_0xd5ff('0x37'))){_0x4f3d55['limit']=qs[_0xd5ff('0x1e')](_0x3467a1[_0xd5ff('0x2f')][_0xd5ff('0x1e')]);_0x4f3d55[_0xd5ff('0x20')]=qs[_0xd5ff('0x20')](_0x3467a1[_0xd5ff('0x2f')][_0xd5ff('0x20')]);}_0x4f3d55[_0xd5ff('0x38')]=qs[_0xd5ff('0x39')](_0x3467a1[_0xd5ff('0x2f')]['sort']);_0x4f3d55[_0xd5ff('0x3a')]=qs[_0xd5ff('0x30')](_[_0xd5ff('0x3b')](_0x3467a1['query'],_0x5da383['filters']),_0x4d334e);if(_0x3467a1[_0xd5ff('0x2f')][_0xd5ff('0x3c')]){_0x4f3d55[_0xd5ff('0x3a')]=_[_0xd5ff('0x3d')](_0x4f3d55['where'],{'$or':_[_0xd5ff('0x2c')](_0x4d334e,function(_0x2b9df6){if(_0x2b9df6[_0xd5ff('0x2e')]!=='VIRTUAL'){var _0x32edd1={};_0x32edd1[_0x2b9df6[_0xd5ff('0x2a')]]={'$like':'%'+_0x3467a1['query'][_0xd5ff('0x3c')]+'%'};return _0x32edd1;}})});}_0x4f3d55=_[_0xd5ff('0x3d')]({},_0x4f3d55,_0x3467a1[_0xd5ff('0x3e')]);var _0x2b2c0e={'where':_0x4f3d55['where']};return db['ChatTransferReport']['count'](_0x2b2c0e)['then'](function(_0x371b2f){_0x16f3bd[_0xd5ff('0x1f')]=_0x371b2f;if(_0x3467a1[_0xd5ff('0x2f')]['includeAll']){_0x4f3d55[_0xd5ff('0x3f')]=[{'all':!![]}];}return db[_0xd5ff('0x2d')][_0xd5ff('0x40')](_0x4f3d55);})['then'](function(_0x2da903){_0x16f3bd['rows']=_0x2da903;return _0x16f3bd;})[_0xd5ff('0x27')](respondWithFilteredResult(_0xa6c871,_0x4f3d55))[_0xd5ff('0x41')](handleError(_0xa6c871,null));};exports['show']=function(_0x1fa9b6,_0xcf036e){var _0x40987e={'raw':!![],'where':{'id':_0x1fa9b6['params']['id']}},_0x3e95ed={};_0x3e95ed[_0xd5ff('0x31')]=_[_0xd5ff('0x42')](db[_0xd5ff('0x2d')]['rawAttributes']);_0x3e95ed[_0xd5ff('0x2f')]=_[_0xd5ff('0x42')](_0x1fa9b6[_0xd5ff('0x2f')]);_0x3e95ed[_0xd5ff('0x30')]=_[_0xd5ff('0x33')](_0x3e95ed[_0xd5ff('0x31')],_0x3e95ed[_0xd5ff('0x2f')]);_0x40987e[_0xd5ff('0x32')]=_['intersection'](_0x3e95ed[_0xd5ff('0x31')],qs[_0xd5ff('0x34')](_0x1fa9b6['query'][_0xd5ff('0x34')]));_0x40987e[_0xd5ff('0x32')]=_0x40987e[_0xd5ff('0x32')][_0xd5ff('0x35')]?_0x40987e[_0xd5ff('0x32')]:_0x3e95ed[_0xd5ff('0x31')];if(_0x1fa9b6['query']['includeAll']){_0x40987e[_0xd5ff('0x3f')]=[{'all':!![]}];}_0x40987e=_[_0xd5ff('0x3d')]({},_0x40987e,_0x1fa9b6[_0xd5ff('0x3e')]);return db[_0xd5ff('0x2d')][_0xd5ff('0x43')](_0x40987e)[_0xd5ff('0x27')](handleEntityNotFound(_0xcf036e,null))[_0xd5ff('0x27')](respondWithResult(_0xcf036e,null))[_0xd5ff('0x41')](handleError(_0xcf036e,null));};exports['create']=function(_0x5407c4,_0x2bdbfd){return db[_0xd5ff('0x2d')][_0xd5ff('0x44')](_0x5407c4['body'],{})[_0xd5ff('0x27')](respondWithResult(_0x2bdbfd,0xc9))[_0xd5ff('0x41')](handleError(_0x2bdbfd,null));};exports[_0xd5ff('0x26')]=function(_0x36514e,_0x937992){if(_0x36514e[_0xd5ff('0x45')]['id']){delete _0x36514e[_0xd5ff('0x45')]['id'];}return db[_0xd5ff('0x2d')]['find']({'where':{'id':_0x36514e[_0xd5ff('0x46')]['id']}})[_0xd5ff('0x27')](handleEntityNotFound(_0x937992,null))['then'](saveUpdates(_0x36514e[_0xd5ff('0x45')],null))[_0xd5ff('0x27')](respondWithResult(_0x937992,null))[_0xd5ff('0x41')](handleError(_0x937992,null));};exports[_0xd5ff('0x47')]=function(_0x187249,_0x1c8181){return db['ChatTransferReport']['find']({'where':{'id':_0x187249['params']['id']}})[_0xd5ff('0x27')](handleEntityNotFound(_0x1c8181,null))[_0xd5ff('0x27')](removeEntity(_0x1c8181,null))[_0xd5ff('0x41')](handleError(_0x1c8181,null));};exports[_0xd5ff('0x48')]=function(_0x384e6b,_0x2ffb0a){return db[_0xd5ff('0x2d')][_0xd5ff('0x48')]()[_0xd5ff('0x27')](respondWithResult(_0x2ffb0a,null))[_0xd5ff('0x41')](handleError(_0x2ffb0a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 5d891e8..d90eacc 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 _0x593d=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x593d,0x159));var _0xd593=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x593d[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xd593('0x0'));var util=require('util');var logger=require(_0xd593('0x1'))(_0xd593('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd593('0x3'));var fs=require('fs');var path=require(_0xd593('0x4'));var rimraf=require(_0xd593('0x5'));var config=require(_0xd593('0x6'));var attributes=require(_0xd593('0x7'));module[_0xd593('0x8')]=function(_0x301d5d,_0x2861e1){return _0x301d5d[_0xd593('0x9')](_0xd593('0xa'),attributes,{'tableName':_0xd593('0xb'),'paranoid':![],'indexes':[{'name':_0xd593('0xc'),'fields':[_0xd593('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a51=['api','moment','bluebird','rimraf','../../config/environment','exports','define','uniqueid','lodash','../../config/logger'];(function(_0x406e18,_0x4f2cd0){var _0x2330db=function(_0x155bbd){while(--_0x155bbd){_0x406e18['push'](_0x406e18['shift']());}};_0x2330db(++_0x4f2cd0);}(_0x4a51,0x184));var _0x14a5=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x4a51[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x14a5('0x0'));var util=require('util');var logger=require(_0x14a5('0x1'))(_0x14a5('0x2'));var moment=require(_0x14a5('0x3'));var BPromise=require(_0x14a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x14a5('0x5'));var config=require(_0x14a5('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x14a5('0x7')]=function(_0x4554f1,_0x541e4b){return _0x4554f1[_0x14a5('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x14a5('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 37f73d8..d3aff89 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 _0x48eb=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4135d8,_0x19e538){var _0x10d479=function(_0x19a721){while(--_0x19a721){_0x4135d8['push'](_0x4135d8['shift']());}};_0x10d479(++_0x19e538);}(_0x48eb,0x170));var _0xb48e=function(_0x39065e,_0x17a1d2){_0x39065e=_0x39065e-0x0;var _0x456b5a=_0x48eb[_0x39065e];return _0x456b5a;};'use strict';var _=require(_0xb48e('0x0'));var util=require('util');var moment=require(_0xb48e('0x1'));var BPromise=require(_0xb48e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb48e('0x3'));var db=require(_0xb48e('0x4'))['db'];var utils=require(_0xb48e('0x5'));var logger=require('../../config/logger')(_0xb48e('0x6'));var config=require('../../config/environment');var jayson=require(_0xb48e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52a325,_0xc03c49,_0x2174f6){return new BPromise(function(_0x368b23,_0x48b813){return client[_0xb48e('0x8')](_0x52a325,_0x2174f6)[_0xb48e('0x9')](function(_0x15ce5f){logger['info'](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));logger[_0xb48e('0xc')](_0xb48e('0xd'),_0xc03c49,'request\x20sent',JSON[_0xb48e('0xe')](_0x15ce5f));if(_0x15ce5f[_0xb48e('0xf')]){if(_0x15ce5f['error']['code']===0x1f4){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0x15ce5f[_0xb48e('0xf')][_0xb48e('0x10')]);return _0x48b813(_0x15ce5f['error'][_0xb48e('0x10')]);}logger['error'](_0xb48e('0xa'),_0xc03c49,_0x15ce5f['error']['message']);return _0x368b23(_0x15ce5f['error'][_0xb48e('0x10')]);}else{logger[_0xb48e('0x11')](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));_0x368b23(_0x15ce5f[_0xb48e('0x12')][_0xb48e('0x10')]);}})[_0xb48e('0x13')](function(_0xe2c1a6){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0xe2c1a6);_0x48b813(_0xe2c1a6);});});} \ No newline at end of file +var _0xd29a=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0xd29a,0xb2));var _0xad29=function(_0x121f4c,_0xf31fc7){_0x121f4c=_0x121f4c-0x0;var _0x15c18c=_0xd29a[_0x121f4c];return _0x15c18c;};'use strict';var _=require(_0xad29('0x0'));var util=require('util');var moment=require(_0xad29('0x1'));var BPromise=require(_0xad29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad29('0x3'));var logger=require(_0xad29('0x4'))('rpc');var config=require(_0xad29('0x5'));var jayson=require(_0xad29('0x6'));var client=jayson[_0xad29('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4af157,_0xd6f3af,_0x477eaf){return new BPromise(function(_0x56fcdc,_0x35539f){return client['request'](_0x4af157,_0x477eaf)[_0xad29('0x8')](function(_0x431d63){logger['info'](_0xad29('0x9'),_0xd6f3af,_0xad29('0xa'));logger[_0xad29('0xb')](_0xad29('0xc'),_0xd6f3af,_0xad29('0xa'),JSON['stringify'](_0x431d63));if(_0x431d63['error']){if(_0x431d63[_0xad29('0xd')]['code']===0x1f4){logger[_0xad29('0xd')](_0xad29('0x9'),_0xd6f3af,_0x431d63[_0xad29('0xd')][_0xad29('0xe')]);return _0x35539f(_0x431d63[_0xad29('0xd')][_0xad29('0xe')]);}logger['error'](_0xad29('0x9'),_0xd6f3af,_0x431d63[_0xad29('0xd')][_0xad29('0xe')]);return _0x56fcdc(_0x431d63[_0xad29('0xd')][_0xad29('0xe')]);}else{logger[_0xad29('0xf')](_0xad29('0x9'),_0xd6f3af,_0xad29('0xa'));_0x56fcdc(_0x431d63['result'][_0xad29('0xe')]);}})[_0xad29('0x10')](function(_0x4365af){logger[_0xad29('0xd')](_0xad29('0x9'),_0xd6f3af,_0x4365af);_0x35539f(_0x4365af);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 1151d5a..57e19f9 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 _0xf43d=['../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25cf7c,_0x11966c){var _0x51d963=function(_0xf9dd94){while(--_0xf9dd94){_0x25cf7c['push'](_0x25cf7c['shift']());}};_0x51d963(++_0x11966c);}(_0xf43d,0x1f2));var _0xdf43=function(_0x100e02,_0x499d66){_0x100e02=_0x100e02-0x0;var _0x1f3fce=_0xf43d[_0x100e02];return _0x1f3fce;};'use strict';var multer=require('multer');var util=require(_0xdf43('0x0'));var path=require(_0xdf43('0x1'));var timeout=require(_0xdf43('0x2'));var express=require(_0xdf43('0x3'));var router=express[_0xdf43('0x4')]();var fs_extra=require(_0xdf43('0x5'));var auth=require(_0xdf43('0x6'));var interaction=require(_0xdf43('0x7'));var config=require(_0xdf43('0x8'));var controller=require(_0xdf43('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf43('0xa')]);router[_0xdf43('0xb')](_0xdf43('0xc'),auth['isAuthenticated'](),controller[_0xdf43('0xd')]);router[_0xdf43('0xb')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x10')]);router['post']('/',auth[_0xdf43('0xf')](),controller['create']);router[_0xdf43('0x11')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x12')]);router[_0xdf43('0x13')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x14')]);module[_0xdf43('0x15')]=router; \ No newline at end of file +var _0xe3e9=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','./chatTransferReport.controller','get','index','/describe','isAuthenticated','show','create','put','/:id'];(function(_0x428fb0,_0x36bab8){var _0x4ac37f=function(_0x5d89cb){while(--_0x5d89cb){_0x428fb0['push'](_0x428fb0['shift']());}};_0x4ac37f(++_0x36bab8);}(_0xe3e9,0x1ef));var _0x9e3e=function(_0x463192,_0x2a7738){_0x463192=_0x463192-0x0;var _0x3e6e6c=_0xe3e9[_0x463192];return _0x3e6e6c;};'use strict';var multer=require(_0x9e3e('0x0'));var util=require(_0x9e3e('0x1'));var path=require(_0x9e3e('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e3e('0x3'));var router=express[_0x9e3e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e3e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e3e('0x6'));router[_0x9e3e('0x7')]('/',auth['isAuthenticated'](),controller[_0x9e3e('0x8')]);router[_0x9e3e('0x7')](_0x9e3e('0x9'),auth[_0x9e3e('0xa')](),controller['describe']);router[_0x9e3e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9e3e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e3e('0xc')]);router[_0x9e3e('0xd')](_0x9e3e('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9e3e('0xe'),auth[_0x9e3e('0xa')](),controller[_0x9e3e('0xf')]);module[_0x9e3e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8f12943..bfe6af9 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 _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x5afbac,_0xb65c4d){var _0x325fba=function(_0x789e25){while(--_0x789e25){_0x5afbac['push'](_0x5afbac['shift']());}};_0x325fba(++_0xb65c4d);}(_0x9f62,0x154));var _0x29f6=function(_0x592308,_0xe42315){_0x592308=_0x592308-0x0;var _0x1dd0b9=_0x9f62[_0x592308];return _0x1dd0b9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xedd9=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e8f8b,_0x5c7b1d){_0x4e8f8b=_0x4e8f8b-0x0;var _0x7f6ee8=_0xedd9[_0x4e8f8b];return _0x7f6ee8;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'name':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'unique':_0x9edd('0x3')},'description':{'type':Sequelize[_0x9edd('0x2')]},'mapKey':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x4')},'key':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9edd('0x2')]},'animation':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9edd('0x9'),_0x9edd('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xb')},'start_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xc')},'offline_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'header_offline':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9edd('0x11')]},'closingQuestion':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x13')},'noteTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x14')},'closingMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x9edd('0x16'),_0x9edd('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x9edd('0x1a'),'required':!![]},'props':{'title':_0x9edd('0x1b'),'helpText':''}},{'type':_0x9edd('0x19'),'props':{'title':_0x9edd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9edd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x1d'))?JSON[_0x9edd('0x1e')](this[_0x9edd('0x1c')](_0x9edd('0x1d'))):{};},'set':function(_0x4d507f){return this['setDataValue'](_0x9edd('0x1d'),JSON[_0x9edd('0x18')](_0x4d507f));}},'offlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9edd('0x4')},'variable':null},{'type':_0x9edd('0x1f'),'config':{'placeholder':_0x9edd('0x20')},'props':{'title':'Comments','helpText':_0x9edd('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x22'))?JSON[_0x9edd('0x1e')](this['getDataValue'](_0x9edd('0x22'))):{};},'set':function(_0x3fb556){return this[_0x9edd('0x23')](_0x9edd('0x22'),JSON[_0x9edd('0x18')](_0x3fb556));}},'token':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return rs[_0x9edd('0x24')]();}},'autoclose':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9edd('0x2')]},'forwardOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9edd('0x2')]},'waitingTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x29')},'skipUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9edd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9edd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2b')},'messagesAlignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2c')},'defaultTitle':{'type':Sequelize[_0x9edd('0x2')]},'customerAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2d')},'systemAvatar':{'type':Sequelize[_0x9edd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9edd('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![],'comment':_0x9edd('0x2f'),'set':function(_0x48958a){if(!_0x48958a)this[_0x9edd('0x23')]('mandatoryDispositionPauseId',null);this[_0x9edd('0x23')](_0x9edd('0x30'),_0x48958a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9edd('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x31')},'vidaooNote':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9edd('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 8d0eaa4..936faac 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 _0x2552=['../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','undefined','count','limit','Content-Range','update','ChatWebsites','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','firstName','Chat','NotifyMailAccount','notifyMail','server','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','License','push','all','some','server/files/chat/iframe.ejs','utf8','3.1.0','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','bulkCreate','stack','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url'];(function(_0xd6ea2c,_0x3a4393){var _0x3eac91=function(_0x5d4fb9){while(--_0x5d4fb9){_0xd6ea2c['push'](_0xd6ea2c['shift']());}};_0x3eac91(++_0x3a4393);}(_0x2552,0x121));var _0x2255=function(_0xe290f9,_0x2ded4f){_0xe290f9=_0xe290f9-0x0;var _0x5d1402=_0x2552[_0xe290f9];return _0x5d1402;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x2255('0x0'));var util=require(_0x2255('0x1'));var path=require(_0x2255('0x2'));var ejs=require(_0x2255('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x2255('0x4'));var qs=require(_0x2255('0x5'));var logger=require(_0x2255('0x6'))('api');var config=require(_0x2255('0x7'));var url=require(_0x2255('0x8'));var db=require(_0x2255('0x9'))['db'];config[_0x2255('0xa')]=_[_0x2255('0xb')](config[_0x2255('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2255('0xc'))(new Redis(config[_0x2255('0xa')]));require(_0x2255('0xd'))[_0x2255('0xe')](socket);var htmlToText=require(_0x2255('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x2255('0x10')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2255('0x11')]({'port':0x232a});var client9003=jayson[_0x2255('0x10')][_0x2255('0x11')]({'port':0x232b});var client9001=jayson[_0x2255('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4cfe10,_0x147879,_0x1304e6,_0x5f2bb9){return new BPromise(function(_0x35af56,_0x53ee77){var _0x2755b2=_0x5f2bb9||client;return _0x2755b2[_0x2255('0x12')](_0x4cfe10,_0x1304e6)[_0x2255('0x13')](function(_0x40a477){logger[_0x2255('0x14')](_0x2255('0x15'),_0x147879,_0x2255('0x16'));logger['debug'](_0x2255('0x17'),_0x147879,_0x2255('0x16'),JSON['stringify'](_0x40a477));if(_0x40a477['error']){if(_0x40a477['error']['code']===0x1f4){logger[_0x2255('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x40a477['error']['message']);return _0x53ee77(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}logger['error'](_0x2255('0x15'),_0x147879,_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);return _0x35af56(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}else{logger[_0x2255('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x2255('0x16'));_0x35af56(_0x40a477[_0x2255('0x1a')][_0x2255('0x19')]);}})['catch'](function(_0x309c9f){logger[_0x2255('0x18')](_0x2255('0x15'),_0x147879,_0x309c9f);_0x53ee77(_0x309c9f);});});}function respondWithStatusCode(_0xfc8c0,_0x135772){_0x135772=_0x135772||0xcc;return function(_0x5ca2d4){if(_0x5ca2d4){return _0xfc8c0['sendStatus'](_0x135772);}return _0xfc8c0[_0x2255('0x1b')](_0x135772)[_0x2255('0x1c')]();};}function respondWithResult(_0x58aa88,_0x44f226){_0x44f226=_0x44f226||0xc8;return function(_0x4a7168){if(_0x4a7168){return _0x58aa88[_0x2255('0x1b')](_0x44f226)[_0x2255('0x1d')](_0x4a7168);}};}function respondWithFilteredResult(_0x372f85,_0x112c2d){return function(_0x52647e){if(_0x52647e){var _0x556a67=typeof _0x112c2d['offset']===_0x2255('0x1e')&&typeof _0x112c2d['limit']===_0x2255('0x1e');var _0x22db29=_0x52647e[_0x2255('0x1f')];var _0x15f48d=_0x556a67?0x0:_0x112c2d['offset'];var _0xd3229d=_0x556a67?_0x52647e[_0x2255('0x1f')]:_0x112c2d['offset']+_0x112c2d[_0x2255('0x20')];var _0xf4529d;if(_0xd3229d>=_0x22db29){_0xd3229d=_0x22db29;_0xf4529d=0xc8;}else{_0xf4529d=0xce;}_0x372f85[_0x2255('0x1b')](_0xf4529d);return _0x372f85['set'](_0x2255('0x21'),_0x15f48d+'-'+_0xd3229d+'/'+_0x22db29)['json'](_0x52647e);}return null;};}function saveUpdates(_0x23bc13){return function(_0x1817a9){if(_0x1817a9){return _0x1817a9[_0x2255('0x22')](_0x23bc13)[_0x2255('0x13')](function(_0x54768c){return _0x54768c;});}return null;};}function removeEntity(_0x308b64){return function(_0x4e3d1f){if(_0x4e3d1f){return _0x4e3d1f['destroy']()['then'](function(){var _0x5dc4e4=_0x4e3d1f['get']({'plain':!![]});var _0x496d99=_0x2255('0x23');return db[_0x2255('0x24')][_0x2255('0x25')]({'where':{'type':_0x496d99,'resourceId':_0x5dc4e4['id']}})['then'](function(){return _0x4e3d1f;});})[_0x2255('0x13')](function(){_0x308b64['status'](0xcc)[_0x2255('0x1c')]();});}};}function handleEntityNotFound(_0x43ae7e){return function(_0x151e50){if(!_0x151e50){_0x43ae7e[_0x2255('0x26')](0x194);}return _0x151e50;};}function handleError(_0x4e7b18,_0x4dce94){_0x4dce94=_0x4dce94||0x1f4;return function(_0x47f8cb){logger[_0x2255('0x18')](_0x47f8cb['stack']);if(_0x47f8cb[_0x2255('0x27')]){delete _0x47f8cb['name'];}_0x4e7b18[_0x2255('0x1b')](_0x4dce94)[_0x2255('0x28')](_0x47f8cb);};}exports[_0x2255('0x29')]=function(_0x1a4a83,_0x28e279){var _0x33e21c={'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x488425={},_0x373f1c={'count':0x0,'rows':[]};var _0x3c7905=_[_0x2255('0x2c')](db[_0x2255('0x2d')]['rawAttributes'],function(_0x155756){return{'name':_0x155756[_0x2255('0x2e')],'type':_0x155756['type']['key']};});_0x488425['model']=_[_0x2255('0x2c')](_0x3c7905,_0x2255('0x27'));_0x488425[_0x2255('0x2f')]=_['keys'](_0x1a4a83[_0x2255('0x2f')]);_0x488425['filters']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],_0x488425[_0x2255('0x2f')]);_0x33e21c['attributes']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1a4a83[_0x2255('0x2f')][_0x2255('0x32')]));_0x33e21c['attributes']=_0x33e21c[_0x2255('0x33')][_0x2255('0x34')]?_0x33e21c[_0x2255('0x33')]:_0x488425[_0x2255('0x31')];if(!_0x1a4a83[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x33e21c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x1a4a83['query'][_0x2255('0x20')]);_0x33e21c['offset']=qs[_0x2255('0x37')](_0x1a4a83['query'][_0x2255('0x37')]);}_0x33e21c[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x1a4a83[_0x2255('0x2f')]['sort']);_0x33e21c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1a4a83[_0x2255('0x2f')],_0x488425[_0x2255('0x3b')]),_0x3c7905);if(_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]){_0x33e21c['where']=_['merge'](_0x33e21c['where'],{'$or':_['map'](_0x3c7905,function(_0x107aa0){if(_0x107aa0[_0x2255('0x3e')]!==_0x2255('0x3f')){var _0x10f6e6={};_0x10f6e6[_0x107aa0[_0x2255('0x27')]]={'$like':'%'+_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x10f6e6;}})});}_0x33e21c=_[_0x2255('0x40')]({},_0x33e21c,_0x1a4a83[_0x2255('0x41')]);var _0x5d2aaa={'where':_0x33e21c[_0x2255('0x3a')]};return db[_0x2255('0x2d')][_0x2255('0x1f')](_0x5d2aaa)[_0x2255('0x13')](function(_0x41cb8b){_0x373f1c[_0x2255('0x1f')]=_0x41cb8b;if(_0x1a4a83[_0x2255('0x2f')]['includeAll']){_0x33e21c[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x2d')][_0x2255('0x43')](_0x33e21c);})[_0x2255('0x13')](function(_0x3d2eb3){_0x373f1c['rows']=_0x3d2eb3;return _0x373f1c;})[_0x2255('0x13')](respondWithFilteredResult(_0x28e279,_0x33e21c))[_0x2255('0x44')](handleError(_0x28e279,null));};exports['show']=function(_0x407568,_0x295f66){var _0x237be6={'raw':![],'where':{'id':_0x407568[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x52196c={};_0x52196c[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x2d')][_0x2255('0x47')]);_0x52196c['query']=_['keys'](_0x407568['query']);_0x52196c['filters']=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],_0x52196c[_0x2255('0x2f')]);_0x237be6[_0x2255('0x33')]=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],qs[_0x2255('0x32')](_0x407568['query'][_0x2255('0x32')]));_0x237be6[_0x2255('0x33')]=_0x237be6['attributes'][_0x2255('0x34')]?_0x237be6[_0x2255('0x33')]:_0x52196c[_0x2255('0x31')];if(_0x407568['query']['includeAll']){_0x237be6['include']=[{'all':!![]}];}_0x237be6=_[_0x2255('0x40')]({},_0x237be6,_0x407568[_0x2255('0x41')]);return db['ChatWebsite'][_0x2255('0x48')](_0x237be6)['then'](handleEntityNotFound(_0x295f66,null))['then'](respondWithResult(_0x295f66,null))['catch'](handleError(_0x295f66,null));};exports[_0x2255('0x49')]=function(_0x4304fa,_0x1fca6e){return db[_0x2255('0x2d')][_0x2255('0x49')](_0x4304fa[_0x2255('0x4a')],{})[_0x2255('0x13')](function(_0x5ebcb0){var _0x35ecf1=_0x4304fa[_0x2255('0x4b')][_0x2255('0x4c')]({'plain':!![]});if(!_0x35ecf1)throw new Error(_0x2255('0x4d'));if(_0x35ecf1['role']===_0x2255('0x4b')){var _0x3c9fa5=_0x5ebcb0[_0x2255('0x4c')]({'plain':!![]});var _0x5ca827=_0x2255('0x23');return db[_0x2255('0x4e')]['find']({'where':{'name':_0x5ca827,'userProfileId':_0x35ecf1[_0x2255('0x4f')]},'raw':!![]})[_0x2255('0x13')](function(_0x3ae936){if(_0x3ae936&&_0x3ae936[_0x2255('0x50')]===0x0){return db['UserProfileResource'][_0x2255('0x49')]({'name':_0x3c9fa5[_0x2255('0x27')],'resourceId':_0x3c9fa5['id'],'type':_0x3ae936[_0x2255('0x27')],'sectionId':_0x3ae936['id']},{})[_0x2255('0x13')](function(){return _0x5ebcb0;});}else{return _0x5ebcb0;}})['catch'](function(_0xea52c8){logger[_0x2255('0x18')](_0x2255('0x51'),_0xea52c8);throw _0xea52c8;});}return _0x5ebcb0;})[_0x2255('0x13')](respondWithResult(_0x1fca6e,0xc9))['catch'](handleError(_0x1fca6e,null));};exports[_0x2255('0x22')]=function(_0x4c2f8d,_0x30a785){if(_0x4c2f8d[_0x2255('0x4a')]['id']){delete _0x4c2f8d[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4c2f8d['params']['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]})[_0x2255('0x13')](handleEntityNotFound(_0x30a785,null))[_0x2255('0x13')](saveUpdates(_0x4c2f8d[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x30a785,null))[_0x2255('0x44')](handleError(_0x30a785,null));};exports[_0x2255('0x25')]=function(_0x2cb9b2,_0x43ff87){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2cb9b2['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x43ff87,null))['then'](removeEntity(_0x43ff87,null))['catch'](handleError(_0x43ff87,null));};exports[_0x2255('0x52')]=function(_0x2648d7,_0x5cfe38){return db[_0x2255('0x2d')]['describe']()[_0x2255('0x13')](respondWithResult(_0x5cfe38,null))['catch'](handleError(_0x5cfe38,null));};exports[_0x2255('0x53')]=function(_0x2aceba,_0x392cb1){if(_0x2aceba['body']['id']){delete _0x2aceba['body']['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2aceba[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x392cb1,null))[_0x2255('0x13')](function(_0x3ce7ae){if(_0x3ce7ae){_0x2aceba[_0x2255('0x4a')][_0x2255('0x54')]=_0x3ce7ae['id'];return db['Disposition'][_0x2255('0x49')](_0x2aceba[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x392cb1,null))['catch'](handleError(_0x392cb1,null));};exports[_0x2255('0x55')]=function(_0x15b5f8,_0x32e35a){var _0x1ff769={'raw':![],'where':{}};var _0xbdaab9={};var _0x3ad724={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2255('0x56')]({'where':{'id':_0x15b5f8['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x32e35a,null))[_0x2255('0x13')](function(_0x5e88fc){if(_0x5e88fc){_0xbdaab9[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x57')]['rawAttributes']);_0xbdaab9[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x15b5f8[_0x2255('0x2f')]);_0xbdaab9['filters']=_[_0x2255('0x30')](_0xbdaab9[_0x2255('0x31')],_0xbdaab9[_0x2255('0x2f')]);_0x1ff769[_0x2255('0x33')]=_[_0x2255('0x30')](_0xbdaab9['model'],qs[_0x2255('0x32')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x32')]));_0x1ff769[_0x2255('0x33')]=_0x1ff769[_0x2255('0x33')]['length']?_0x1ff769[_0x2255('0x33')]:_0xbdaab9[_0x2255('0x31')];if(!_0x15b5f8['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1ff769[_0x2255('0x20')]=qs['limit'](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x20')]);_0x1ff769[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1ff769[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x39')]);_0x1ff769[_0x2255('0x3a')]=qs['filters'](_['pick'](_0x15b5f8[_0x2255('0x2f')],_0xbdaab9['filters']));_0x1ff769[_0x2255('0x3a')]['ChatWebsiteId']=_0x5e88fc['id'];if(_0x15b5f8['query'][_0x2255('0x3d')]){_0x1ff769[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x1ff769['where'],{'$or':_[_0x2255('0x2c')](_0x1ff769[_0x2255('0x33')],function(_0x2ec1c4){var _0x9c9203={};_0x9c9203[_0x2ec1c4]={'$like':'%'+_0x15b5f8['query'][_0x2255('0x3d')]+'%'};return _0x9c9203;})});}_0x1ff769=_[_0x2255('0x40')]({},_0x1ff769,_0x15b5f8[_0x2255('0x41')]);return db[_0x2255('0x57')][_0x2255('0x1f')]({'where':_0x1ff769[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x5d1b5c){_0x3ad724[_0x2255('0x1f')]=_0x5d1b5c;if(_0x15b5f8['query'][_0x2255('0x58')]){_0x1ff769['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1ff769);})['then'](function(_0x25fb59){_0x3ad724[_0x2255('0x59')]=_0x25fb59;return _0x3ad724;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x32e35a,_0x1ff769))[_0x2255('0x44')](handleError(_0x32e35a,null));};exports[_0x2255('0x5a')]=function(_0x1a127e,_0x5bfaab){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x1a127e['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5bfaab,null))[_0x2255('0x13')](function(_0x578a68){if(_0x578a68){return _0x578a68[_0x2255('0x5a')](_0x1a127e[_0x2255('0x2f')][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x5bfaab,null))[_0x2255('0x44')](handleError(_0x5bfaab,null));};exports[_0x2255('0x5c')]=function(_0x2f74ea,_0x7018c2){if(_0x2f74ea[_0x2255('0x4a')]['id']){delete _0x2f74ea[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f74ea['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x7018c2,null))[_0x2255('0x13')](function(_0x57c7e6){if(_0x57c7e6){_0x2f74ea[_0x2255('0x4a')][_0x2255('0x54')]=_0x57c7e6['id'];return db[_0x2255('0x5d')][_0x2255('0x49')](_0x2f74ea[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x7018c2,null))[_0x2255('0x44')](handleError(_0x7018c2,null));};exports[_0x2255('0x5e')]=function(_0x43a1ac,_0x459a89){var _0x1cb659={'raw':![],'where':{}};var _0x4573d5={};var _0x2e6de7={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x43a1ac[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x459a89,null))['then'](function(_0x546bea){if(_0x546bea){_0x4573d5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x5d')][_0x2255('0x47')]);_0x4573d5[_0x2255('0x2f')]=_['keys'](_0x43a1ac[_0x2255('0x2f')]);_0x4573d5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4573d5['model'],_0x4573d5[_0x2255('0x2f')]);_0x1cb659[_0x2255('0x33')]=_[_0x2255('0x30')](_0x4573d5['model'],qs[_0x2255('0x32')](_0x43a1ac['query'][_0x2255('0x32')]));_0x1cb659[_0x2255('0x33')]=_0x1cb659['attributes']['length']?_0x1cb659[_0x2255('0x33')]:_0x4573d5[_0x2255('0x31')];if(!_0x43a1ac['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1cb659[_0x2255('0x20')]=qs['limit'](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x20')]);_0x1cb659[_0x2255('0x37')]=qs['offset'](_0x43a1ac[_0x2255('0x2f')]['offset']);}_0x1cb659[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x39')]);_0x1cb659[_0x2255('0x3a')]=qs['filters'](_[_0x2255('0x3c')](_0x43a1ac[_0x2255('0x2f')],_0x4573d5[_0x2255('0x3b')]));_0x1cb659[_0x2255('0x3a')][_0x2255('0x54')]=_0x546bea['id'];if(_0x43a1ac[_0x2255('0x2f')]['filter']){_0x1cb659[_0x2255('0x3a')]=_['merge'](_0x1cb659[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1cb659[_0x2255('0x33')],function(_0x5d9cf8){var _0x4c503b={};_0x4c503b[_0x5d9cf8]={'$like':'%'+_0x43a1ac[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x4c503b;})});}_0x1cb659=_[_0x2255('0x40')]({},_0x1cb659,_0x43a1ac[_0x2255('0x41')]);return db[_0x2255('0x5d')][_0x2255('0x1f')]({'where':_0x1cb659[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x15cd68){_0x2e6de7[_0x2255('0x1f')]=_0x15cd68;if(_0x43a1ac[_0x2255('0x2f')]['includeAll']){_0x1cb659[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x5d')][_0x2255('0x43')](_0x1cb659);})[_0x2255('0x13')](function(_0x3a4fc6){_0x2e6de7[_0x2255('0x59')]=_0x3a4fc6;return _0x2e6de7;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x459a89,_0x1cb659))[_0x2255('0x44')](handleError(_0x459a89,null));};exports[_0x2255('0x5f')]=function(_0x2f84ce,_0x18b269){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f84ce[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x18b269,null))[_0x2255('0x13')](function(_0x22e570){if(_0x22e570){return _0x22e570[_0x2255('0x5f')](_0x2f84ce['query'][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x18b269,null))[_0x2255('0x44')](handleError(_0x18b269,null));};exports[_0x2255('0x60')]=function(_0x1ef5cd,_0x299f40){_0x1ef5cd['body']['sitepic']=_0x1ef5cd[_0x2255('0x61')][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x1ef5cd['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x299f40,null))[_0x2255('0x13')](saveUpdates(_0x1ef5cd[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x299f40,null))['catch'](handleError(_0x299f40,null));};exports[_0x2255('0x63')]=function(_0x2a897f,_0x17ece0){_0x2a897f[_0x2255('0x4a')]['agentAvatar']=_0x2a897f['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2a897f[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x17ece0,null))[_0x2255('0x13')](saveUpdates(_0x2a897f['body'],null))[_0x2255('0x13')](respondWithResult(_0x17ece0,null))[_0x2255('0x44')](handleError(_0x17ece0,null));};exports[_0x2255('0x64')]=function(_0x46da65,_0x542ed1){_0x46da65[_0x2255('0x4a')]['customerAvatar']=_0x46da65['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x46da65[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x542ed1,null))[_0x2255('0x13')](saveUpdates(_0x46da65[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x542ed1,null))['catch'](handleError(_0x542ed1,null));};exports['addSystemAvatar']=function(_0x2ddce5,_0x1e0471){_0x2ddce5['body'][_0x2255('0x65')]=_0x2ddce5['file']['filename'];return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2ddce5['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x1e0471,null))['then'](saveUpdates(_0x2ddce5[_0x2255('0x4a')],null))['then'](respondWithResult(_0x1e0471,null))[_0x2255('0x44')](handleError(_0x1e0471,null));};exports[_0x2255('0x66')]=function(_0x348bf0,_0x3ecf30){var _0x23ced0=path[_0x2255('0x67')](config['root'],_0x2255('0x68'));var _0x5b2425={'where':{'id':_0x348bf0[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x69')],'raw':!![]};var _0x4cef55=![];return require(_0x2255('0x6a'))['getLicense']()['then'](function(_0x132f78){if(_0x132f78){_0x4cef55=_0x132f78['custom'];}})[_0x2255('0x13')](function(){return db['ChatWebsite'][_0x2255('0x48')](_0x5b2425);})[_0x2255('0x13')](handleEntityNotFound(_0x3ecf30,null))['then'](function(_0x3839ab){if(_0x3839ab){if(!_[_0x2255('0x6b')](_0x3839ab['sitepic'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]))&&_0x4cef55){_0x23ced0=path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]);}}return _0x3ecf30[_0x2255('0x6e')](_0x23ced0);}})[_0x2255('0x44')](handleError(_0x3ecf30,null));};exports[_0x2255('0x6f')]=function(_0x13bd2d,_0x10d88f){var _0x451494=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x70'));var _0x508ef7={'where':{'id':_0x13bd2d[_0x2255('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x508ef7)[_0x2255('0x13')](handleEntityNotFound(_0x10d88f,null))['then'](function(_0xdd5e72){if(_0xdd5e72){if(!_[_0x2255('0x6b')](_0xdd5e72[_0x2255('0x71')])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0xdd5e72['agentAvatar']))){_0x451494=path[_0x2255('0x67')](config['root'],_0x2255('0x73'),_0xdd5e72[_0x2255('0x71')]);}}return _0x10d88f[_0x2255('0x6e')](_0x451494);}})[_0x2255('0x44')](handleError(_0x10d88f,null));};exports[_0x2255('0x74')]=function(_0x2ba9f,_0x3ba0d8){var _0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x75'));var _0x2a0db0={'where':{'id':_0x2ba9f['params']['id']},'attributes':['id',_0x2255('0x76'),_0x2255('0x77')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2a0db0)[_0x2255('0x13')](handleEntityNotFound(_0x3ba0d8,null))['then'](function(_0xfd858c){if(_0xfd858c){if(!_[_0x2255('0x6b')](_0xfd858c['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c['customerAvatar']))&&_0xfd858c[_0x2255('0x77')]){_0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c[_0x2255('0x76')]);}}return _0x3ba0d8[_0x2255('0x6e')](_0x65ecd1);}})['catch'](handleError(_0x3ba0d8,null));};exports[_0x2255('0x78')]=function(_0x42a762,_0x208637){var _0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],'server/files/images/avatars/system_avatar.png');var _0x2af09e={'where':{'id':_0x42a762[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x65')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2af09e)[_0x2255('0x13')](handleEntityNotFound(_0x208637,null))['then'](function(_0x435639){if(_0x435639){if(!_[_0x2255('0x6b')](_0x435639['systemAvatar'])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0x435639['systemAvatar']))){_0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0x435639[_0x2255('0x65')]);}}return _0x208637[_0x2255('0x6e')](_0xc34330);}})[_0x2255('0x44')](handleError(_0x208637,null));};exports[_0x2255('0x79')]=function(_0x4dfb3b,_0x1e8515){var _0x1daaee=require(_0x2255('0x7a'));var _0x50ec82=new _0x1daaee();var _0x12b9cd=_0x50ec82[_0x2255('0x7b')](_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x7d')])['getResult']();var _0x31c0a4={'body':_0x4dfb3b[_0x2255('0x4a')],'channel':'chat'};var _0x488550=[];var _0x4eb4d7=[];var _0x2ffe0e={};var _0x450d66=![];return db[_0x2255('0x7e')]['describe']()[_0x2255('0x13')](function(_0xf640b8){if(!_0xf640b8){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x81'));}_0x488550=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),['createdAt',_0x2255('0x83')]);_0x4eb4d7=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),[_0x2255('0x84'),_0x2255('0x83'),_0x2255('0x85'),_0x2255('0x86')]);if(_0x4dfb3b[_0x2255('0x4a')]['id']){delete _0x4dfb3b[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x87')])){throw new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x88'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')]['body'])||_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x4a')]===''){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x89'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x8b')+_0x4eb4d7);}if(!_[_0x2255('0x8c')](_0x4eb4d7,_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x8d')+_0x4eb4d7);}_0x2ffe0e[_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')]]=_0x4dfb3b[_0x2255('0x4a')]['from'];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4dfb3b[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f'),'include':[{'model':db[_0x2255('0x7e')],'as':_0x2255('0x90'),'where':_0x2ffe0e,'limit':0x1,'order':[['updatedAt',_0x2255('0x91')]]}]},{'model':db[_0x2255('0x92')],'as':'Applications'}]});})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))['then'](function(_0x2756cf){if(_0x2756cf&&_0x2756cf[_0x2255('0x8f')]){_0x31c0a4['account']=_0x2756cf;_0x31c0a4[_0x2255('0x93')]=_0x2756cf[_0x2255('0x94')];_0x31c0a4['list']=_0x2756cf['List'];_0x31c0a4[_0x2255('0x93')]=_[_0x2255('0x95')](_0x31c0a4['applications'],[_0x2255('0x96')],[_0x2255('0x97')]);if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x94')]){delete _0x31c0a4[_0x2255('0x98')][_0x2255('0x94')];}if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')]&&_0x31c0a4['account'][_0x2255('0x8f')]['Contacts']['length']){return _0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')][_0x2255('0x90')][0x0];}var _0x7ab084=_[_0x2255('0xb')](_0x4dfb3b['body'],{'firstName':_0x4dfb3b[_0x2255('0x4a')]['from'],'ListId':_0x2756cf['ListId']});_0x7ab084[_0x4dfb3b[_0x2255('0x4a')]['mapKey']]=_0x4dfb3b[_0x2255('0x4a')]['from'];return db[_0x2255('0x7e')]['create'](_0x7ab084,{'fields':_0x488550,'raw':!![]});}})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))[_0x2255('0x13')](function(_0x11879d){_0x31c0a4[_0x2255('0x99')]=_0x11879d;var _0x1a00e4=_0x4dfb3b['body'][_0x2255('0x9a')];if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9b')]){_0x1a00e4=_0x4dfb3b['headers']['cf-connecting-ip'];}else if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9c')]){_0x1a00e4=_[_0x2255('0x9d')](_0x4dfb3b['headers'][_0x2255('0x9c')]['split'](','));}if(_0x11879d){var _0x2a5cab={'ContactId':_0x11879d['id'],'ChatWebsiteId':_0x4dfb3b['params']['id'],'from':(_0x11879d['firstName']||'')+'\x20'+(_0x11879d['lastName']||''),'customerIp':_0x1a00e4,'customerPort':_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9e')]?_0x4dfb3b['headers']['x-real-port']:null,'referer':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x9f')],'browserName':_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')]&&_0x12b9cd['browser'][_0x2255('0xa1')]?util['format'](_0x2255('0xa2'),_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')],_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]):_0x2255('0xa3'),'browserVersion':_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]||'unknown','osName':util[_0x2255('0xa4')](_0x2255('0xa2'),_0x12b9cd['os'][_0x2255('0x27')],_0x12b9cd['os'][_0x2255('0xa1')]),'osVersion':_0x12b9cd['os'][_0x2255('0xa1')],'deviceModel':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x31')]&&_0x12b9cd['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x12b9cd[_0x2255('0xa5')]['model'],_0x12b9cd['device']['vendor'],_0x12b9cd['device'][_0x2255('0x3e')]):null,'deviceVendor':_0x12b9cd[_0x2255('0xa5')]['vendor'],'deviceType':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x3e')],'formData':JSON[_0x2255('0xa6')](_0x4dfb3b['body'])};var _0x93374f={'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'closed':![]};if(_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]){_0x93374f[_0x2255('0xa7')]=_0x4dfb3b['body'][_0x2255('0xa7')];return db[_0x2255('0xa8')]['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x4e7188){if(_0x4e7188){return[_0x4e7188,![]];}_0x2a5cab[_0x2255('0xa7')]=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')];_0x2a5cab[_0x2255('0xa9')]=_0x4dfb3b['body'][_0x2255('0xa9')];return db[_0x2255('0xa8')]['create'](_0x2a5cab)[_0x2255('0x13')](function(_0x5a6ccd){return[_0x5a6ccd,!![]];});});}_0x93374f[_0x2255('0xaa')]=_0x11879d['id'];if(_0x4dfb3b['body']['interaction']&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xab')]['id']){_0x93374f['id']=_0x4dfb3b[_0x2255('0x4a')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x57e726){if(_0x57e726){return[_0x57e726,![]];}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)[_0x2255('0x13')](function(_0x2536ba){return[_0x2536ba,!![]];});});}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)['then'](function(_0x527634){return[_0x527634,!![]];});}})['spread'](function(_0x75fad,_0xe0da67){if(_0x75fad){_0x450d66=_0xe0da67;if(!_0xe0da67){var _0x31cf4e={'from':(_0x31c0a4[_0x2255('0x99')]['firstName']||'')+'\x20'+(_0x31c0a4['contact'][_0x2255('0xac')]||'')};if(_0x4dfb3b['body'][_0x2255('0xa7')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]!=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]){_0x31cf4e['threadId']=_0x4dfb3b['body']['messageId'];}return _0x75fad[_0x2255('0x22')](_0x31cf4e);}else{return _0x75fad;}}})['then'](function(_0x1ca603){_0x31c0a4[_0x2255('0xab')]=_0x1ca603[_0x2255('0x4c')]({'plain':!![]});_0x31c0a4['interaction'][_0x2255('0xae')]=_0x450d66;if(_0x31c0a4['interaction'][_0x2255('0xae')]){if(_0x31c0a4[_0x2255('0x98')][_0x2255('0xaf')]){_0x31c0a4['applications']['push']({'id':0x0,'priority':_0x31c0a4[_0x2255('0x93')][_0x2255('0x34')]+0x1,'app':_0x2255('0xb0'),'appdata':_0x2255('0xb1'),'interval':_0x2255('0xb2')});}}return db['ChatMessage'][_0x2255('0x49')]({'body':_0x4dfb3b[_0x2255('0x4a')]['body'],'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'ChatInteractionId':_0x1ca603['id'],'direction':'in','ContactId':_0x31c0a4[_0x2255('0x99')]['id'],'AttachmentId':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xb3')]});})[_0x2255('0x13')](function(_0x2b376c){_0x31c0a4['message']=_0x2b376c;if(_0x31c0a4['interaction'][_0x2255('0xb4')]){return db['User'][_0x2255('0x48')]({'attributes':['id',_0x2255('0x27')],'where':{'id':_0x31c0a4[_0x2255('0xab')][_0x2255('0xb4')]}})['then'](function(_0x4b2da5){if(_0x4b2da5){_0x31c0a4[_0x2255('0x93')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2255('0xb5'),'appdata':_0x4b2da5[_0x2255('0x27')]+','+(_0x31c0a4[_0x2255('0x98')][_0x2255('0xb6')]||0xa),'interval':_0x2255('0xb2')});_0x31c0a4[_0x2255('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x31c0a4);});}return respondWithRpcPromise('Start',_0x2255('0xb8'),_0x31c0a4);})[_0x2255('0x13')](function(_0xade164){respondWithRpcPromise(_0x2255('0xb9'),_0x2255('0xb9'),{'event':_0x2255('0x79'),'message':_0xade164},client9002);return _0xade164;})[_0x2255('0x13')](respondWithResult(_0x1e8515,null))[_0x2255('0x44')](handleError(_0x1e8515,null));};exports[_0x2255('0xba')]=function(_0xd0b191,_0x5b50c9){var _0x489100,_0x4e1abc,_0x20f6c0;var _0x4e99f0=[];var _0x3ac5cb={};var _0x3dd387=_0xd0b191[_0x2255('0xbb')]||[];var _0x2e29de=[];var _0x20b839;return db[_0x2255('0x7e')][_0x2255('0x52')]()[_0x2255('0x13')](function(_0x18eeee){if(!_0x18eeee){throw new db['Sequelize']['ValidationError'](_0x2255('0x81'));}_0x4e99f0=_[_0x2255('0x82')](_[_0x2255('0x46')](_0x18eeee),['createdAt',_0x2255('0x83'),_0x2255('0x85'),'ListId']);if(_0xd0b191['body']['id']){delete _0xd0b191[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')])){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)['send'](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x88')));}if(_[_0x2255('0x6b')](_0xd0b191['body'][_0x2255('0x4a')])||_0xd0b191['body'][_0x2255('0x4a')]===''){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x89')));}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbd')+_0x4e99f0));}if(!_['includes'](_0x4e99f0,_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbe')+_0x4e99f0));}_0x3ac5cb[_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')]]=_0xd0b191['body'][_0x2255('0x87')];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0xd0b191[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f')},{'model':db[_0x2255('0xbf')],'as':_0x2255('0xbf')}]});})[_0x2255('0x13')](handleEntityNotFound(_0x5b50c9,null))[_0x2255('0x13')](function(_0x272d2e){if(_0x272d2e&&_0x272d2e[_0x2255('0x8f')]){_0x4e1abc=_0x272d2e;var _0x5b3dab=_[_0x2255('0xb')](_0xd0b191[_0x2255('0x4a')],{'firstName':_0xd0b191[_0x2255('0x4a')]['from'],'phone':_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')],'ListId':_0x272d2e[_0x2255('0x86')]});_0x5b3dab[_0xd0b191['body']['mapKeyOffline']]=_0xd0b191['body']['from'];return db['CmContact'][_0x2255('0xc0')]({'where':_0x3ac5cb,'defaults':_0x5b3dab});}})[_0x2255('0xc1')](function(_0x3e758b){if(_0x3e758b){_0x20f6c0=_0x3e758b;var _0x10b6b0=fs[_0x2255('0xc2')](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xc3')),'utf8');var _0x4e2201=ejs['render'](_0x10b6b0,{'body':_[_0x2255('0xc4')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x4a')]),'bodyTitle':_0x4e1abc[_0x2255('0xc5')]});return db[_0x2255('0xc6')][_0x2255('0x49')]({'body':_0x4e2201,'plainBody':htmlToText[_0x2255('0xc7')](_0x4e2201),'ContactId':_0x3e758b['id'],'ChatWebsiteId':_0x4e1abc['id']});}})[_0x2255('0x13')](function(_0x29d98a){_0x20b839=_0x29d98a;if(_0x3dd387['length']){var _0x29c7d6=_0x3dd387[_0x2255('0x2c')](function(_0x14692b){return{'name':_0x14692b[_0x2255('0xc8')],'basename':_0x14692b['filename'],'type':_0x14692b[_0x2255('0xc9')],'ChatOfflineMessageId':_0x29d98a['id']};});_0x2e29de=_0x29c7d6['map'](_0xc2f789=>{var _0x89281={'filename':_0xc2f789['name'],'path':path['join'](config[_0x2255('0x6c')],'server',_0x2255('0xbb'),_0x2255('0xca'),'offline-chat',_0xc2f789[_0x2255('0xcb')])};return _0x89281;});if(!_0x4e1abc[_0x2255('0xcc')]){return db[_0x2255('0xcd')][_0x2255('0xce')](function(_0x92e3a){return db[_0x2255('0xcf')]['bulkCreate'](_0x29c7d6,{'transaction':_0x92e3a});});}}})['then'](function(){if(_0x20b839){_0x489100=_0x20b839;return db[_0x2255('0xbf')][_0x2255('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x2255('0xd0')],'as':_0x2255('0xd1'),'raw':!![],'include':[{'model':db[_0x2255('0xd2')],'as':_0x2255('0xd2'),'raw':!![]}]}]});}})[_0x2255('0x13')](function(_0x52f99b){if(_0x52f99b&&_0x52f99b[_0x2255('0xd1')]&&_0x4e1abc[_0x2255('0xd3')]&&_0x4e1abc[_0x2255('0xd4')]){var _0x5a9057=_0x52f99b['getSmtpOptions']();return respondWithRpcPromise(_0x2255('0xd5'),_0x2255('0xd6'),{'account':_0x5a9057,'message':{'from':util[_0x2255('0xa4')](_0x2255('0xd7'),_0x52f99b[_0x2255('0x27')],_0x52f99b[_0x2255('0xd8')]||_0x52f99b[_0x2255('0xd1')][_0x2255('0x4b')]),'to':_0x4e1abc[_0x2255('0xd4')],'subject':_0x4e1abc[_0x2255('0xd9')],'html':_0x489100['body'],'attachments':_0x2e29de}},client9003)[_0x2255('0x13')](function(){return _0x489100;})[_0x2255('0x44')](function(_0x16d042){logger[_0x2255('0x18')](_0x16d042);});}})[_0x2255('0x13')](function(){if(_0x4e1abc&&_0x4e1abc[_0x2255('0xcc')]&&_0x4e1abc[_0x2255('0xda')]){var _0x3aa029=[];if(_0x3dd387['length']){_0x3aa029=_0x3dd387[_0x2255('0x2c')](function(_0x2f2226){return{'name':_0x2f2226[_0x2255('0xc8')],'basename':_0x2f2226[_0x2255('0x62')],'type':_0x2f2226[_0x2255('0xc9')],'ChatOfflineMessageId':_0x20b839['id']};});}var _0xd05cf4;if(!_[_0x2255('0x6b')](_0x4e1abc['subjectOffline'])){var _0x28db2b=_[_0x2255('0x2c')](_0xd0b191['body'],function(_0x512d94){return _0x512d94;});var _0xf73e24=_['toPairsIn'](_0x28db2b)[0x0];var _0x154b6f=_[_0x2255('0xdb')](_0xf73e24,function(_0x3df43a){return _0x3df43a;});_0xd05cf4=_0x154b6f[0x1][_0x4e1abc[_0x2255('0xdc')]];}var _0x45df49={'from':_0x20f6c0[_0x2255('0xd8')],'firstName':_0x20f6c0[_0x2255('0xdd')],'lastName':_0x20f6c0[_0x2255('0xac')],'mapKey':_0x2255('0xd8'),'message':{'from':_0x20f6c0[_0x2255('0xd8')],'to':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')],'cc':'','subject':_[_0x2255('0x6b')](_0xd05cf4)?_0x4e1abc[_0x2255('0xd9')]:_0xd05cf4,'messageId':'','sentAt':new Date(),'attach':_0x3aa029['length'],'attachments':_0x3aa029,'originChannel':_0x2255('0xde'),'ChatWebsiteId':_0x4e1abc['id'],'ChatOfflineMessageId':_0x489100['id'],'originTo':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')]},'body':_0x489100['body']};var _0x1bc506={'account':{'id':_0x4e1abc[_0x2255('0xda')]},'body':_0x45df49,'log':_0x2255('0xdf')};return respondWithRpcPromise(_0x2255('0xdf'),_0x2255('0xe0'),_0x1bc506,client9001)[_0x2255('0x13')](function(){return _0x489100;})['catch'](function(_0x1d3d7c){logger[_0x2255('0x18')](_0x1d3d7c);});}return;})['then'](function(){if(_0x489100){return _0x489100;}})['then'](respondWithResult(_0x5b50c9,null))[_0x2255('0x44')](function(_0xfa6f06){logger[_0x2255('0x18')](_0x2255('0x44'),_0xfa6f06);for(var _0x59e784 of _0x3dd387){var _0x2a3b6d=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xe1'),_0x2255('0xbb'),_0x2255('0xca'),_0x2255('0xe2'),_0x59e784[_0x2255('0x62')]);fs_extra['remove'](_0x2a3b6d)[_0x2255('0x44')](function(_0x373729){logger[_0x2255('0x18')](_0x2255('0xe3'),_0x2a3b6d,_0x373729);});}});};exports[_0x2255('0xe4')]=function(_0x1c1891,_0x3d8d26){return db['ChatInteraction']['find']({'where':{'id':_0x1c1891[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3d8d26,null))[_0x2255('0x13')](function(_0x142bef){if(_0x142bef){return _0x142bef['addInteraction'](_0x1c1891[_0x2255('0x4a')][_0x2255('0x5b')],_['omit'](_0x1c1891['body'],[_0x2255('0x5b'),'id'])||{});}})[_0x2255('0x13')](respondWithResult(_0x3d8d26,null))['catch'](handleError(_0x3d8d26,null));};exports[_0x2255('0xe5')]=function(_0x27bf61,_0x4bd979){var _0x1adfaf={'raw':![],'where':{}};var _0x10d746={};var _0x300814={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x27bf61[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x4bd979,null))[_0x2255('0x13')](function(_0x393187){if(_0x393187){_0x10d746[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xa8')][_0x2255('0x47')]);_0x10d746[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x27bf61['query']);_0x10d746[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],_0x10d746['query']);_0x1adfaf[_0x2255('0x33')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],qs[_0x2255('0x32')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x32')]));_0x1adfaf['attributes']=_0x1adfaf[_0x2255('0x33')][_0x2255('0x34')]?_0x1adfaf[_0x2255('0x33')]:_0x10d746[_0x2255('0x31')];if(!_0x27bf61[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x1adfaf[_0x2255('0x20')]=qs['limit'](_0x27bf61['query'][_0x2255('0x20')]);_0x1adfaf[_0x2255('0x37')]=qs['offset'](_0x27bf61[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1adfaf[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x39')]);_0x1adfaf[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_['pick'](_0x27bf61[_0x2255('0x2f')],_0x10d746[_0x2255('0x3b')]));_0x1adfaf[_0x2255('0x3a')][_0x2255('0x54')]=_0x393187['id'];if(_0x27bf61['query'][_0x2255('0x3d')]){_0x1adfaf['where']=_[_0x2255('0x40')](_0x1adfaf[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1adfaf['attributes'],function(_0x5d7a39){var _0x5a7264={};_0x5a7264[_0x5d7a39]={'$like':'%'+_0x27bf61[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5a7264;})});}_0x1adfaf=_[_0x2255('0x40')]({},_0x1adfaf,_0x27bf61[_0x2255('0x41')]);return db['ChatInteraction'][_0x2255('0x1f')]({'where':_0x1adfaf[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x8cd8ee){_0x300814[_0x2255('0x1f')]=_0x8cd8ee;if(_0x27bf61[_0x2255('0x2f')]['includeAll']){_0x1adfaf[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':_0x2255('0xe6'),'required':![]},{'model':db[_0x2255('0xe7')],'as':_0x2255('0xe8'),'attributes':[_0x2255('0x27'),'fullname',_0x2255('0xe9')],'required':![]},{'model':db[_0x2255('0xea')],'as':_0x2255('0xeb'),'attributes':['id',_0x2255('0x27'),'color'],'where':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?{'id':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]}:undefined,'required':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1adfaf);})[_0x2255('0x13')](function(_0x2f2fe1){_0x300814['rows']=_0x2f2fe1;return _0x300814;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x4bd979,_0x1adfaf))['catch'](handleError(_0x4bd979,null));};function iftimePromise(_0x1ee3b5,_0x541df3){return respondWithRpcPromise(_0x2255('0xed'),_0x2255('0xee'),{'command':_0x541df3[_0x2255('0xef')]?util['format'](_0x2255('0xf0'),_0x1ee3b5['interval'],_0x541df3[_0x2255('0xef')]):util[_0x2255('0xa4')](_0x2255('0xf1'),_0x1ee3b5['interval'])},client9002)['then'](function(_0x26dd3e){var _0x6428f5=_0x26dd3e&&_0x26dd3e[_0x2255('0xf2')]('true')>=0x0?!![]:![];logger[_0x2255('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5['interval'],_0x6428f5?_0x2255('0xf3'):_0x2255('0xf4'),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return _0x6428f5;})[_0x2255('0x44')](function(_0x24f20e){logger['error'](_0x2255('0xf5'),_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5[_0x2255('0xf6')],util[_0x2255('0xf7')](_0x24f20e,{'showHidden':![],'depth':null}),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return![];});}exports[_0x2255('0xee')]=function(_0x520256,_0x362354){var _0x2b7424=0x0;var _0x1bd242=0x0;var _0x56936c=![];var _0x23bcce;var _0x807904;return db[_0x2255('0x2d')]['find']({'where':{'id':_0x520256[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf8'),'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf9'),'attributes':['id',_0x2255('0xf6')],'raw':!![]}]}]})[_0x2255('0x13')](handleEntityNotFound(_0x362354,null))[_0x2255('0x13')](function(_0x522c){if(_0x522c){_0x23bcce=_0x522c;return _0x522c[_0x2255('0xfa')]({'raw':!![]});}})[_0x2255('0x13')](function(_0x5a5a77){if(_0x23bcce){if(_0x5a5a77){_0x807904=_0x5a5a77;}}return require(_0x2255('0x6a'))[_0x2255('0xfb')]();})[_0x2255('0x13')](function(_0x2c7416){if(_0x2c7416){_0x1bd242=_0x2c7416[_0x2255('0xfc')];_0x56936c=_0x2c7416[_0x2255('0xfd')];}})['then'](function(){return db[_0x2255('0xa8')][_0x2255('0x1f')]({'where':{'closed':![]}});})[_0x2255('0x13')](function(_0x3ca15e){_0x2b7424=_0x3ca15e;if(_0x1bd242&&_0x3ca15e>_0x1bd242){return db[_0x2255('0xfe')][_0x2255('0x56')]({'where':{'id':0x1}})['then'](function(_0x4c789f){if(_0x4c789f){_0x4c789f['increment']('chatLicenseExceeded');}});}})[_0x2255('0x13')](function(){if(_0x23bcce[_0x2255('0xf8')]&&_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')]){var _0x1fdade=[];for(var _0x461010=0x0;_0x461010<_0x23bcce['Interval'][_0x2255('0xf9')][_0x2255('0x34')];_0x461010++){var _0x1c82e7=_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')][_0x461010][_0x2255('0x4c')]({'plain':!![]});_0x1fdade[_0x2255('0xff')](iftimePromise(_0x1c82e7,_0x23bcce));}return BPromise[_0x2255('0x100')](_0x1fdade)[_0x2255('0x13')](function(_0x206cfd){return _[_0x2255('0x101')](_0x206cfd);});}else{return!![];}})[_0x2255('0x13')](function(_0x5cebed){var _0x137c45=fs['readFileSync'](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x102')),_0x2255('0x103'));var _0x148c19=new url['URL'](_0x23bcce['address'])['origin'];var _0x595ebb=_0x2255('0x104');var _0x2ee95b=![];var _0x5368bb={'chatVersion':_0x595ebb,'chatWebsiteAddressOrigin':_0x148c19,'remote':_0x23bcce[_0x2255('0x105')],'query':querystring['stringify'](_['merge'](_0x23bcce[_0x2255('0x4c')]({'plain':!![]}),{'customerIp':_0x520256['headers'][_0x2255('0x9c')]||_0x520256[_0x2255('0x7c')][_0x2255('0x106')]||_0x520256[_0x2255('0x107')][_0x2255('0x108')]||_0x520256['ip'],'referer':_0x520256[_0x2255('0x7c')][_0x2255('0x9f')],'openedInteractions':_0x2b7424,'maxInteractions':_0x1bd242,'virtual':_0x56936c[_0x2255('0xfc')],'online':_0x5cebed,'custom':_0x56936c}))['replace'](/'/g,'\x5c\x27')};_0x362354[_0x2255('0x28')](ejs['render'](Mustache[_0x2255('0x109')](_0x137c45,_0x5368bb),{'proactiveActions':_0x807904,'alignment':_0x23bcce[_0x2255('0x10a')],'verticalAlignment':_0x23bcce[_0x2255('0x10b')],'div_color':_0x23bcce[_0x2255('0x10c')],'labelText':_0x23bcce['labelText'],'text_color':_0x23bcce[_0x2255('0x10d')],'text_button_color':_0x23bcce[_0x2255('0x10e')],'button_color':_0x23bcce[_0x2255('0x10f')],'background_color':_0x23bcce['backgroundColor'],'hideWhenOffline':_0x23bcce[_0x2255('0x110')],'intervalId':_0x23bcce[_0x2255('0x111')],'isDevelopment':_0x2ee95b,'chatVersion':_0x595ebb}));})[_0x2255('0x44')](handleError(_0x362354,null));};exports[_0x2255('0x112')]=function(_0x2abd15,_0x91fb01){var _0x9f1941=_0x2abd15[_0x2255('0x45')]['id'];var _0x533840=_0x2abd15[_0x2255('0x4a')];var _0x166f9d=0xc8;var _0x13f4f8=null;return db[_0x2255('0xcd')][_0x2255('0xce')]({'isolationLevel':db[_0x2255('0xcd')][_0x2255('0x113')][_0x2255('0x114')]['READ_COMMITTED']},function(_0x22bf0e){return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(_0x104273){if(_0x104273){return db[_0x2255('0x92')][_0x2255('0x25')]({'where':{'ChatWebsiteId':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(){var _0x5399ab=_[_0x2255('0x2c')](_0x533840,function(_0x2832b9){_0x2832b9[_0x2255('0x54')]=_0x9f1941;return _0x2832b9;});return db[_0x2255('0x92')][_0x2255('0x115')](_0x5399ab,{'transaction':_0x22bf0e});});}else{_0x166f9d=0x194;_0x13f4f8=[];}});})[_0x2255('0x13')](function(){if(_0x166f9d!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x9f1941},'order':'priority'})[_0x2255('0x13')](function(_0x3c2a51){_0x13f4f8=_0x3c2a51;});}})['catch'](function(_0x2cee93){_0x166f9d=0x1f4;logger[_0x2255('0x18')](_0x2cee93[_0x2255('0x116')]);if(_0x2cee93[_0x2255('0x27')]){delete _0x2cee93['name'];}_0x13f4f8=_0x2cee93;})['finally'](function(){if(_0x13f4f8===null){_0x91fb01[_0x2255('0x26')](_0x166f9d);}else{if(_0x166f9d===0x1f4){_0x91fb01[_0x2255('0x1b')](_0x166f9d)[_0x2255('0x28')](_0x13f4f8);}else{_0x91fb01['status'](_0x166f9d)[_0x2255('0x1d')](_0x13f4f8);}}});};exports['getApplications']=function(_0x341018,_0x3445b9){var _0x554170={};var _0x4c8a7a={};var _0x58d146;var _0x44308a;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x341018[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3445b9,null))[_0x2255('0x13')](function(_0x4012e0){if(_0x4012e0){_0x58d146=_0x4012e0;_0x4c8a7a['model']=_[_0x2255('0x46')](db[_0x2255('0x92')][_0x2255('0x47')]);_0x4c8a7a[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x341018[_0x2255('0x2f')]);_0x4c8a7a[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4c8a7a[_0x2255('0x31')],_0x4c8a7a[_0x2255('0x2f')]);_0x554170[_0x2255('0x33')]=_['intersection'](_0x4c8a7a[_0x2255('0x31')],qs[_0x2255('0x32')](_0x341018['query'][_0x2255('0x32')]));_0x554170[_0x2255('0x33')]=_0x554170['attributes'][_0x2255('0x34')]?_0x554170['attributes']:_0x4c8a7a[_0x2255('0x31')];_0x554170[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x341018['query'][_0x2255('0x39')]);_0x554170['where']=qs[_0x2255('0x3b')](_['pick'](_0x341018[_0x2255('0x2f')],_0x4c8a7a[_0x2255('0x3b')]));if(_0x341018['query']['filter']){_0x554170[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x554170[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x554170['attributes'],function(_0x340ba3){var _0x19592e={};_0x19592e[_0x340ba3]={'$like':'%'+_0x341018[_0x2255('0x2f')]['filter']+'%'};return _0x19592e;})});}_0x554170=_[_0x2255('0x40')]({},_0x554170,_0x341018[_0x2255('0x41')]);return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x26de4a){if(_0x26de4a){_0x44308a=_0x26de4a['length'];if(!_0x341018[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x554170[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x341018[_0x2255('0x2f')][_0x2255('0x20')]);_0x554170[_0x2255('0x37')]=qs['offset'](_0x341018[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x2017b4){if(_0x2017b4){return _0x2017b4?{'count':_0x44308a,'rows':_0x2017b4}:null;}})['then'](respondWithResult(_0x3445b9,null))[_0x2255('0x44')](handleError(_0x3445b9,null));};exports[_0x2255('0x118')]=function(_0x4b1661,_0x49fc39){return db[_0x2255('0x119')][_0x2255('0x48')]({'where':{'id':_0x4b1661[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x49fc39,null))[_0x2255('0x13')](function(_0x146b33){if(_0x146b33){return _0x146b33[_0x2255('0x118')](_0x4b1661[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x4b1661[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x49fc39,null))[_0x2255('0x44')](handleError(_0x49fc39,null));};exports['getProactiveActions']=function(_0x3e78e0,_0x322c49){var _0x39718c={};var _0xa35369={};var _0x4ad6ce;var _0x23cad3;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x3e78e0[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x322c49,null))[_0x2255('0x13')](function(_0x34e27a){if(_0x34e27a){_0x4ad6ce=_0x34e27a;_0xa35369[_0x2255('0x31')]=_['keys'](db['ChatProactiveAction'][_0x2255('0x47')]);_0xa35369[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x3e78e0['query']);_0xa35369[_0x2255('0x3b')]=_['intersection'](_0xa35369[_0x2255('0x31')],_0xa35369[_0x2255('0x2f')]);_0x39718c[_0x2255('0x33')]=_[_0x2255('0x30')](_0xa35369[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x32')]));_0x39718c['attributes']=_0x39718c[_0x2255('0x33')][_0x2255('0x34')]?_0x39718c[_0x2255('0x33')]:_0xa35369[_0x2255('0x31')];_0x39718c['order']=qs['sort'](_0x3e78e0[_0x2255('0x2f')]['sort']);_0x39718c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3e78e0[_0x2255('0x2f')],_0xa35369[_0x2255('0x3b')]));if(_0x3e78e0[_0x2255('0x2f')][_0x2255('0x3d')]){_0x39718c[_0x2255('0x3a')]=_['merge'](_0x39718c[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x39718c['attributes'],function(_0x585c7e){var _0x4b9063={};_0x4b9063[_0x585c7e]={'$like':'%'+_0x3e78e0['query'][_0x2255('0x3d')]+'%'};return _0x4b9063;})});}_0x39718c=_[_0x2255('0x40')]({},_0x39718c,_0x3e78e0['options']);return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})[_0x2255('0x13')](function(_0x465dfe){if(_0x465dfe){_0x23cad3=_0x465dfe['length'];if(!_0x3e78e0[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x39718c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3e78e0[_0x2255('0x2f')]['limit']);_0x39718c[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})['then'](function(_0x21170b){if(_0x21170b){return _0x21170b?{'count':_0x23cad3,'rows':_0x21170b}:null;}})[_0x2255('0x13')](respondWithResult(_0x322c49,null))[_0x2255('0x44')](handleError(_0x322c49,null));};exports[_0x2255('0x11b')]=function(_0x336144,_0x5cfd75){var _0x822924=_0x336144[_0x2255('0x2f')][_0x2255('0x11c')]===_0x2255('0x11d')?_0x2255('0x11e'):_0x2255('0x11f');return db[_0x2255('0x2d')][_0x2255('0x48')]({'attributes':['id',_0x822924],'where':{'id':_0x336144['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5cfd75,null))[_0x2255('0x13')](function(_0x27aabe){if(_0x27aabe){var _0x11ed02=_0x27aabe[_0x822924];var _0x42270f=_0x11ed02&&_0x11ed02[_0x2255('0x120')]?_0x11ed02['items']:[];_0x5cfd75['send']({'fromKey':_[_0x2255('0x6b')](_0x11ed02[_0x2255('0x121')])?undefined:_0x11ed02[_0x2255('0x121')],'count':_0x42270f[_0x2255('0x34')],'rows':_0x42270f});}})[_0x2255('0x44')](handleError(_0x5cfd75,null));};exports[_0x2255('0x122')]=function(_0x1ee3d2,_0x261f50){var _0x456c41={'raw':![],'where':{}};var _0x2750d8={};var _0x5b7a60={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x1ee3d2[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x261f50,null))['then'](function(_0x3ca90b){if(_0x3ca90b){_0x2750d8[_0x2255('0x31')]=_['keys'](db[_0x2255('0xc6')][_0x2255('0x47')]);_0x2750d8[_0x2255('0x2f')]=_['keys'](_0x1ee3d2[_0x2255('0x2f')]);_0x2750d8[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x2750d8['model'],_0x2750d8['query']);_0x456c41[_0x2255('0x33')]=_[_0x2255('0x30')](_0x2750d8[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1ee3d2[_0x2255('0x2f')]['fields']));_0x456c41[_0x2255('0x33')]=_0x456c41[_0x2255('0x33')]['length']?_0x456c41[_0x2255('0x33')]:_0x2750d8[_0x2255('0x31')];if(!_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x456c41['limit']=qs[_0x2255('0x20')](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x20')]);_0x456c41[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x1ee3d2[_0x2255('0x2f')]['offset']);}_0x456c41[_0x2255('0x38')]=qs['sort'](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x39')]);_0x456c41[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1ee3d2[_0x2255('0x2f')],_0x2750d8[_0x2255('0x3b')]));_0x456c41[_0x2255('0x3a')][_0x2255('0x54')]=_0x3ca90b['id'];if(_0x1ee3d2[_0x2255('0x2f')]['filter']){_0x456c41['where']=_[_0x2255('0x40')](_0x456c41[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x456c41['attributes'],function(_0x3e372b){var _0x5bac5d={};_0x5bac5d[_0x3e372b]={'$like':'%'+_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5bac5d;})});}_0x456c41=_['merge']({},_0x456c41,_0x1ee3d2['options']);return db[_0x2255('0xc6')][_0x2255('0x1f')]({'where':_0x456c41[_0x2255('0x3a')]})['then'](function(_0x1d296c){_0x5b7a60[_0x2255('0x1f')]=_0x1d296c;if(_0x1ee3d2[_0x2255('0x2f')]['includeAll']){_0x456c41[_0x2255('0x42')]=[{'all':!![]}];}else{_0x456c41[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x2255('0x123'),'required':![]}];}return db[_0x2255('0xc6')][_0x2255('0x43')](_0x456c41);})[_0x2255('0x13')](function(_0x34d838){_0x5b7a60[_0x2255('0x59')]=_0x34d838;return _0x5b7a60;});}})['then'](respondWithFilteredResult(_0x261f50,_0x456c41))[_0x2255('0x44')](handleError(_0x261f50,null));};exports[_0x2255('0x124')]=function(_0x21918b,_0x4809fa){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x21918b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x4809fa,null))['then'](function(_0x10d997){if(_0x10d997){return _0x10d997['addAgents'](_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x21918b[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{})[_0x2255('0xc1')](function(_0x4b6549){for(var _0x2e7149=0x0;_0x2e7149<_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')]['length'];_0x2e7149+=0x1){socket[_0x2255('0x125')](_0x2255('0x126'),{'UserId':Number(_0x21918b['body'][_0x2255('0x5b')][_0x2e7149]),'ChatWebsiteId':Number(_0x21918b['params']['id'])});}return _0x4b6549;});}})[_0x2255('0x13')](respondWithResult(_0x4809fa,null))['catch'](handleError(_0x4809fa,null));};exports[_0x2255('0x127')]=function(_0x22898b,_0x1bb465){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x22898b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bb465,null))[_0x2255('0x13')](function(_0x3d7038){if(_0x3d7038){return _0x3d7038[_0x2255('0x127')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])[_0x2255('0x13')](function(){if(_[_0x2255('0x128')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])){for(var _0x8cc1e1=0x0;_0x8cc1e1<_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x2255('0x34')];_0x8cc1e1+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x8cc1e1]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}}else{socket[_0x2255('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bb465,null))[_0x2255('0x44')](handleError(_0x1bb465,null));};exports[_0x2255('0x129')]=function(_0x3c0c1a,_0x26d12a){var _0x5a0e3d={};var _0x5e3ed5={};var _0x59b888;var _0x12d18b;return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x3c0c1a['params']['id']}})['then'](handleEntityNotFound(_0x26d12a,null))[_0x2255('0x13')](function(_0x253145){if(_0x253145){_0x59b888=_0x253145;_0x5e3ed5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xe7')][_0x2255('0x47')]);_0x5e3ed5[_0x2255('0x2f')]=_['keys'](_0x3c0c1a[_0x2255('0x2f')]);_0x5e3ed5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],_0x5e3ed5[_0x2255('0x2f')]);_0x5a0e3d[_0x2255('0x33')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3c0c1a[_0x2255('0x2f')]['fields']));_0x5a0e3d[_0x2255('0x33')]=_0x5a0e3d[_0x2255('0x33')][_0x2255('0x34')]?_0x5a0e3d['attributes']:_0x5e3ed5[_0x2255('0x31')];_0x5a0e3d[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x3c0c1a[_0x2255('0x2f')]['sort']);_0x5a0e3d[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3c0c1a[_0x2255('0x2f')],_0x5e3ed5[_0x2255('0x3b')]));if(_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]){_0x5a0e3d[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x5a0e3d[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x5a0e3d[_0x2255('0x33')],function(_0x5ec577){var _0xcd2444={};_0xcd2444[_0x5ec577]={'$like':'%'+_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0xcd2444;})});}_0x5a0e3d=_[_0x2255('0x40')]({},_0x5a0e3d,_0x3c0c1a['options']);return _0x59b888['getAgents'](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x2a37f6){if(_0x2a37f6){_0x12d18b=_0x2a37f6[_0x2255('0x34')];if(!_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x5a0e3d[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3c0c1a['query'][_0x2255('0x20')]);_0x5a0e3d[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x59b888[_0x2255('0x129')](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x31bd32){if(_0x31bd32){return _0x31bd32?{'count':_0x12d18b,'rows':_0x31bd32}:null;}})['then'](respondWithResult(_0x26d12a,null))[_0x2255('0x44')](handleError(_0x26d12a,null));}; \ No newline at end of file +var _0x73a5=['contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','close','unmanaged','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','push','all','some','server/files/chat/iframe.ejs','URL','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','referer','virtual','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','finally','getApplications','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','Contact','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','json','limit','offset','count','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','name','options','includeAll','include','findAll','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','findOne','Disposition','merge','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','existsSync','join','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','account','applications','list','orderBy','priority','asc','Applications','Contacts'];(function(_0x20692b,_0xb26d10){var _0x56e6df=function(_0x9a781d){while(--_0x9a781d){_0x20692b['push'](_0x20692b['shift']());}};_0x56e6df(++_0xb26d10);}(_0x73a5,0x8d));var _0x573a=function(_0x29290f,_0x146b26){_0x29290f=_0x29290f-0x0;var _0x3b4e63=_0x73a5[_0x29290f];return _0x3b4e63;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x573a('0x0'));var util=require('util');var path=require(_0x573a('0x1'));var ejs=require(_0x573a('0x2'));var fs=require('fs');var fs_extra=require(_0x573a('0x3'));var _=require(_0x573a('0x4'));var querystring=require(_0x573a('0x5'));var Redis=require('ioredis');var qs=require(_0x573a('0x6'));var logger=require(_0x573a('0x7'))(_0x573a('0x8'));var config=require(_0x573a('0x9'));var url=require(_0x573a('0xa'));var db=require('../../mysqldb')['db'];config[_0x573a('0xb')]=_[_0x573a('0xc')](config[_0x573a('0xb')],{'host':_0x573a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x573a('0xb')]));require(_0x573a('0xe'))[_0x573a('0xf')](socket);var htmlToText=require(_0x573a('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x573a('0x11')][_0x573a('0x12')]({'port':0x232c});var client9002=jayson[_0x573a('0x11')][_0x573a('0x12')]({'port':0x232a});var client9003=jayson[_0x573a('0x11')][_0x573a('0x12')]({'port':0x232b});var client9001=jayson[_0x573a('0x11')][_0x573a('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x2ab812,_0x17ddf9,_0x5c4deb,_0x1502ca){return new BPromise(function(_0x3afff7,_0x44c34a){var _0x39846e=_0x1502ca||client;return _0x39846e[_0x573a('0x13')](_0x2ab812,_0x5c4deb)[_0x573a('0x14')](function(_0xf696af){logger[_0x573a('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x17ddf9,'request\x20sent');logger[_0x573a('0x16')](_0x573a('0x17'),_0x17ddf9,'request\x20sent',JSON[_0x573a('0x18')](_0xf696af));if(_0xf696af['error']){if(_0xf696af[_0x573a('0x19')][_0x573a('0x1a')]===0x1f4){logger['error'](_0x573a('0x1b'),_0x17ddf9,_0xf696af[_0x573a('0x19')][_0x573a('0x1c')]);return _0x44c34a(_0xf696af[_0x573a('0x19')][_0x573a('0x1c')]);}logger[_0x573a('0x19')](_0x573a('0x1b'),_0x17ddf9,_0xf696af[_0x573a('0x19')][_0x573a('0x1c')]);return _0x3afff7(_0xf696af[_0x573a('0x19')][_0x573a('0x1c')]);}else{logger[_0x573a('0x15')](_0x573a('0x1b'),_0x17ddf9,_0x573a('0x1d'));_0x3afff7(_0xf696af[_0x573a('0x1e')]['message']);}})[_0x573a('0x1f')](function(_0x25a026){logger[_0x573a('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x17ddf9,_0x25a026);_0x44c34a(_0x25a026);});});}function respondWithStatusCode(_0x4102db,_0x242fee){_0x242fee=_0x242fee||0xcc;return function(_0x330a5a){if(_0x330a5a){return _0x4102db['sendStatus'](_0x242fee);}return _0x4102db[_0x573a('0x20')](_0x242fee)[_0x573a('0x21')]();};}function respondWithResult(_0x1859d0,_0x1f0970){_0x1f0970=_0x1f0970||0xc8;return function(_0xbc6078){if(_0xbc6078){return _0x1859d0[_0x573a('0x20')](_0x1f0970)[_0x573a('0x22')](_0xbc6078);}};}function respondWithFilteredResult(_0x577e17,_0x18938a){return function(_0x23421d){if(_0x23421d){var _0x170da2=typeof _0x18938a['offset']==='undefined'&&typeof _0x18938a[_0x573a('0x23')]==='undefined';var _0x56d3af=_0x23421d['count'];var _0x4a53a6=_0x170da2?0x0:_0x18938a[_0x573a('0x24')];var _0x2c03d4=_0x170da2?_0x23421d[_0x573a('0x25')]:_0x18938a[_0x573a('0x24')]+_0x18938a[_0x573a('0x23')];var _0x5a725e;if(_0x2c03d4>=_0x56d3af){_0x2c03d4=_0x56d3af;_0x5a725e=0xc8;}else{_0x5a725e=0xce;}_0x577e17[_0x573a('0x20')](_0x5a725e);return _0x577e17[_0x573a('0x26')](_0x573a('0x27'),_0x4a53a6+'-'+_0x2c03d4+'/'+_0x56d3af)[_0x573a('0x22')](_0x23421d);}return null;};}function saveUpdates(_0x23e2b5){return function(_0x19a88b){if(_0x19a88b){return _0x19a88b['update'](_0x23e2b5)[_0x573a('0x14')](function(_0x4fa742){return _0x4fa742;});}return null;};}function removeEntity(_0x5d56b5){return function(_0x127207){if(_0x127207){return _0x127207[_0x573a('0x28')]()['then'](function(){var _0x3c3e0f=_0x127207[_0x573a('0x29')]({'plain':!![]});var _0x2c549b=_0x573a('0x2a');return db[_0x573a('0x2b')]['destroy']({'where':{'type':_0x2c549b,'resourceId':_0x3c3e0f['id']}})[_0x573a('0x14')](function(){return _0x127207;});})[_0x573a('0x14')](function(){_0x5d56b5['status'](0xcc)[_0x573a('0x21')]();});}};}function handleEntityNotFound(_0x3adb96){return function(_0x89c3da){if(!_0x89c3da){_0x3adb96[_0x573a('0x2c')](0x194);}return _0x89c3da;};}function handleError(_0x4478f5,_0x55723e){_0x55723e=_0x55723e||0x1f4;return function(_0x575787){logger['error'](_0x575787[_0x573a('0x2d')]);if(_0x575787['name']){delete _0x575787['name'];}_0x4478f5[_0x573a('0x20')](_0x55723e)['send'](_0x575787);};}exports[_0x573a('0x2e')]=function(_0x237032,_0x3c1cec){var _0x17968b={'include':[{'model':db[_0x573a('0x2f')],'as':_0x573a('0x30')}]},_0x4efd2e={},_0x445cc9={'count':0x0,'rows':[]};var _0x194a50=_[_0x573a('0x31')](db[_0x573a('0x32')]['rawAttributes'],function(_0x3190dc){return{'name':_0x3190dc[_0x573a('0x33')],'type':_0x3190dc[_0x573a('0x34')][_0x573a('0x35')]};});_0x4efd2e[_0x573a('0x36')]=_[_0x573a('0x31')](_0x194a50,'name');_0x4efd2e[_0x573a('0x37')]=_[_0x573a('0x38')](_0x237032[_0x573a('0x37')]);_0x4efd2e[_0x573a('0x39')]=_[_0x573a('0x3a')](_0x4efd2e[_0x573a('0x36')],_0x4efd2e[_0x573a('0x37')]);_0x17968b[_0x573a('0x3b')]=_['intersection'](_0x4efd2e[_0x573a('0x36')],qs['fields'](_0x237032['query'][_0x573a('0x3c')]));_0x17968b['attributes']=_0x17968b['attributes'][_0x573a('0x3d')]?_0x17968b['attributes']:_0x4efd2e[_0x573a('0x36')];if(!_0x237032[_0x573a('0x37')][_0x573a('0x3e')](_0x573a('0x3f'))){_0x17968b[_0x573a('0x23')]=qs[_0x573a('0x23')](_0x237032[_0x573a('0x37')]['limit']);_0x17968b[_0x573a('0x24')]=qs[_0x573a('0x24')](_0x237032['query'][_0x573a('0x24')]);}_0x17968b[_0x573a('0x40')]=qs['sort'](_0x237032['query'][_0x573a('0x41')]);_0x17968b[_0x573a('0x42')]=qs[_0x573a('0x39')](_[_0x573a('0x43')](_0x237032[_0x573a('0x37')],_0x4efd2e[_0x573a('0x39')]),_0x194a50);if(_0x237032[_0x573a('0x37')][_0x573a('0x44')]){_0x17968b[_0x573a('0x42')]=_['merge'](_0x17968b[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x194a50,function(_0x13d261){if(_0x13d261[_0x573a('0x34')]!==_0x573a('0x45')){var _0x21b49f={};_0x21b49f[_0x13d261[_0x573a('0x46')]]={'$like':'%'+_0x237032[_0x573a('0x37')][_0x573a('0x44')]+'%'};return _0x21b49f;}})});}_0x17968b=_['merge']({},_0x17968b,_0x237032[_0x573a('0x47')]);var _0x2befda={'where':_0x17968b[_0x573a('0x42')]};return db[_0x573a('0x32')][_0x573a('0x25')](_0x2befda)[_0x573a('0x14')](function(_0xb300bf){_0x445cc9[_0x573a('0x25')]=_0xb300bf;if(_0x237032[_0x573a('0x37')][_0x573a('0x48')]){_0x17968b[_0x573a('0x49')]=[{'all':!![]}];}return db[_0x573a('0x32')][_0x573a('0x4a')](_0x17968b);})[_0x573a('0x14')](function(_0x11ba25){_0x445cc9['rows']=_0x11ba25;return _0x445cc9;})[_0x573a('0x14')](respondWithFilteredResult(_0x3c1cec,_0x17968b))[_0x573a('0x1f')](handleError(_0x3c1cec,null));};exports[_0x573a('0x4b')]=function(_0x61f846,_0x3c6ca9){var _0x1df556={'raw':![],'where':{'id':_0x61f846['params']['id']},'include':[{'model':db[_0x573a('0x2f')],'as':'mandatoryDispositionPause'}]},_0x45243d={};_0x45243d[_0x573a('0x36')]=_[_0x573a('0x38')](db[_0x573a('0x32')][_0x573a('0x4c')]);_0x45243d[_0x573a('0x37')]=_['keys'](_0x61f846['query']);_0x45243d[_0x573a('0x39')]=_['intersection'](_0x45243d[_0x573a('0x36')],_0x45243d['query']);_0x1df556[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x45243d[_0x573a('0x36')],qs['fields'](_0x61f846[_0x573a('0x37')][_0x573a('0x3c')]));_0x1df556['attributes']=_0x1df556['attributes']['length']?_0x1df556[_0x573a('0x3b')]:_0x45243d['model'];if(_0x61f846[_0x573a('0x37')][_0x573a('0x48')]){_0x1df556[_0x573a('0x49')]=[{'all':!![]}];}_0x1df556=_['merge']({},_0x1df556,_0x61f846['options']);return db['ChatWebsite'][_0x573a('0x4d')](_0x1df556)['then'](handleEntityNotFound(_0x3c6ca9,null))[_0x573a('0x14')](respondWithResult(_0x3c6ca9,null))[_0x573a('0x1f')](handleError(_0x3c6ca9,null));};exports[_0x573a('0x4e')]=function(_0x2a3ff6,_0x5e11f5){return db[_0x573a('0x32')]['create'](_0x2a3ff6[_0x573a('0x4f')],{})[_0x573a('0x14')](function(_0x54e859){var _0x17defd=_0x2a3ff6[_0x573a('0x50')][_0x573a('0x29')]({'plain':!![]});if(!_0x17defd)throw new Error(_0x573a('0x51'));if(_0x17defd[_0x573a('0x52')]===_0x573a('0x50')){var _0x3266ed=_0x54e859[_0x573a('0x29')]({'plain':!![]});var _0x3368fb='ChatWebsites';return db[_0x573a('0x53')][_0x573a('0x4d')]({'where':{'name':_0x3368fb,'userProfileId':_0x17defd['userProfileId']},'raw':!![]})['then'](function(_0x34cfbe){if(_0x34cfbe&&_0x34cfbe[_0x573a('0x54')]===0x0){return db['UserProfileResource'][_0x573a('0x4e')]({'name':_0x3266ed[_0x573a('0x46')],'resourceId':_0x3266ed['id'],'type':_0x34cfbe[_0x573a('0x46')],'sectionId':_0x34cfbe['id']},{})[_0x573a('0x14')](function(){return _0x54e859;});}else{return _0x54e859;}})['catch'](function(_0x52f1d1){logger[_0x573a('0x19')](_0x573a('0x55'),_0x52f1d1);throw _0x52f1d1;});}return _0x54e859;})['then'](respondWithResult(_0x5e11f5,0xc9))[_0x573a('0x1f')](handleError(_0x5e11f5,null));};exports['update']=function(_0x375317,_0x1542d3){if(_0x375317['body']['id']){delete _0x375317[_0x573a('0x4f')]['id'];}return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x375317[_0x573a('0x56')]['id']},'include':[{'model':db[_0x573a('0x2f')],'as':'mandatoryDispositionPause'}]})[_0x573a('0x14')](handleEntityNotFound(_0x1542d3,null))[_0x573a('0x14')](saveUpdates(_0x375317[_0x573a('0x4f')],null))[_0x573a('0x14')](respondWithResult(_0x1542d3,null))[_0x573a('0x1f')](handleError(_0x1542d3,null));};exports[_0x573a('0x28')]=function(_0x350697,_0xb7df4b){return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x350697[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0xb7df4b,null))[_0x573a('0x14')](removeEntity(_0xb7df4b,null))['catch'](handleError(_0xb7df4b,null));};exports[_0x573a('0x57')]=function(_0x3a5b19,_0x4f81ae){return db[_0x573a('0x32')][_0x573a('0x57')]()[_0x573a('0x14')](respondWithResult(_0x4f81ae,null))[_0x573a('0x1f')](handleError(_0x4f81ae,null));};exports['addDisposition']=function(_0x320187,_0x42d03a){if(_0x320187[_0x573a('0x4f')]['id']){delete _0x320187['body']['id'];}return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x320187[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x42d03a,null))[_0x573a('0x14')](function(_0x19cd72){if(_0x19cd72){_0x320187[_0x573a('0x4f')][_0x573a('0x58')]=_0x19cd72['id'];return db['Disposition'][_0x573a('0x4e')](_0x320187[_0x573a('0x4f')]);}})[_0x573a('0x14')](respondWithResult(_0x42d03a,null))['catch'](handleError(_0x42d03a,null));};exports['getDispositions']=function(_0x5db23e,_0x2994db){var _0x178dd7={'raw':![],'where':{}};var _0x3f1e3f={};var _0x3a071f={'count':0x0,'rows':[]};return db[_0x573a('0x32')][_0x573a('0x59')]({'where':{'id':_0x5db23e[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x2994db,null))[_0x573a('0x14')](function(_0x35bc96){if(_0x35bc96){_0x3f1e3f[_0x573a('0x36')]=_[_0x573a('0x38')](db[_0x573a('0x5a')][_0x573a('0x4c')]);_0x3f1e3f['query']=_[_0x573a('0x38')](_0x5db23e[_0x573a('0x37')]);_0x3f1e3f[_0x573a('0x39')]=_[_0x573a('0x3a')](_0x3f1e3f[_0x573a('0x36')],_0x3f1e3f[_0x573a('0x37')]);_0x178dd7[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x3f1e3f['model'],qs[_0x573a('0x3c')](_0x5db23e[_0x573a('0x37')][_0x573a('0x3c')]));_0x178dd7['attributes']=_0x178dd7[_0x573a('0x3b')]['length']?_0x178dd7[_0x573a('0x3b')]:_0x3f1e3f['model'];if(!_0x5db23e['query'][_0x573a('0x3e')](_0x573a('0x3f'))){_0x178dd7[_0x573a('0x23')]=qs[_0x573a('0x23')](_0x5db23e[_0x573a('0x37')][_0x573a('0x23')]);_0x178dd7[_0x573a('0x24')]=qs[_0x573a('0x24')](_0x5db23e[_0x573a('0x37')]['offset']);}_0x178dd7[_0x573a('0x40')]=qs[_0x573a('0x41')](_0x5db23e[_0x573a('0x37')][_0x573a('0x41')]);_0x178dd7[_0x573a('0x42')]=qs[_0x573a('0x39')](_['pick'](_0x5db23e['query'],_0x3f1e3f[_0x573a('0x39')]));_0x178dd7['where'][_0x573a('0x58')]=_0x35bc96['id'];if(_0x5db23e['query'][_0x573a('0x44')]){_0x178dd7[_0x573a('0x42')]=_['merge'](_0x178dd7['where'],{'$or':_[_0x573a('0x31')](_0x178dd7[_0x573a('0x3b')],function(_0x2856fb){var _0x28ca27={};_0x28ca27[_0x2856fb]={'$like':'%'+_0x5db23e[_0x573a('0x37')]['filter']+'%'};return _0x28ca27;})});}_0x178dd7=_[_0x573a('0x5b')]({},_0x178dd7,_0x5db23e[_0x573a('0x47')]);return db[_0x573a('0x5a')][_0x573a('0x25')]({'where':_0x178dd7[_0x573a('0x42')]})[_0x573a('0x14')](function(_0x252626){_0x3a071f['count']=_0x252626;if(_0x5db23e[_0x573a('0x37')][_0x573a('0x48')]){_0x178dd7[_0x573a('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x178dd7);})[_0x573a('0x14')](function(_0x3b81a6){_0x3a071f[_0x573a('0x5c')]=_0x3b81a6;return _0x3a071f;});}})[_0x573a('0x14')](respondWithFilteredResult(_0x2994db,_0x178dd7))['catch'](handleError(_0x2994db,null));};exports[_0x573a('0x5d')]=function(_0x524392,_0x4068df){return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x524392[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x4068df,null))[_0x573a('0x14')](function(_0x497a6b){if(_0x497a6b){return _0x497a6b[_0x573a('0x5d')](_0x524392[_0x573a('0x37')][_0x573a('0x5e')]);}})[_0x573a('0x14')](respondWithStatusCode(_0x4068df,null))[_0x573a('0x1f')](handleError(_0x4068df,null));};exports[_0x573a('0x5f')]=function(_0x407d08,_0x14d6b8){if(_0x407d08[_0x573a('0x4f')]['id']){delete _0x407d08[_0x573a('0x4f')]['id'];}return db['ChatWebsite'][_0x573a('0x4d')]({'where':{'id':_0x407d08['params']['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x14d6b8,null))[_0x573a('0x14')](function(_0x17406c){if(_0x17406c){_0x407d08[_0x573a('0x4f')][_0x573a('0x58')]=_0x17406c['id'];return db[_0x573a('0x60')][_0x573a('0x4e')](_0x407d08['body']);}})[_0x573a('0x14')](respondWithResult(_0x14d6b8,null))[_0x573a('0x1f')](handleError(_0x14d6b8,null));};exports[_0x573a('0x61')]=function(_0x27acf4,_0x3724ed){var _0x22a0cb={'raw':![],'where':{}};var _0x5c0578={};var _0xccaabc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x573a('0x59')]({'where':{'id':_0x27acf4[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x3724ed,null))['then'](function(_0x3aa3b0){if(_0x3aa3b0){_0x5c0578['model']=_['keys'](db[_0x573a('0x60')][_0x573a('0x4c')]);_0x5c0578['query']=_[_0x573a('0x38')](_0x27acf4[_0x573a('0x37')]);_0x5c0578[_0x573a('0x39')]=_[_0x573a('0x3a')](_0x5c0578[_0x573a('0x36')],_0x5c0578[_0x573a('0x37')]);_0x22a0cb[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x5c0578[_0x573a('0x36')],qs[_0x573a('0x3c')](_0x27acf4[_0x573a('0x37')]['fields']));_0x22a0cb[_0x573a('0x3b')]=_0x22a0cb[_0x573a('0x3b')][_0x573a('0x3d')]?_0x22a0cb[_0x573a('0x3b')]:_0x5c0578[_0x573a('0x36')];if(!_0x27acf4[_0x573a('0x37')]['hasOwnProperty'](_0x573a('0x3f'))){_0x22a0cb[_0x573a('0x23')]=qs[_0x573a('0x23')](_0x27acf4[_0x573a('0x37')]['limit']);_0x22a0cb['offset']=qs[_0x573a('0x24')](_0x27acf4[_0x573a('0x37')][_0x573a('0x24')]);}_0x22a0cb[_0x573a('0x40')]=qs[_0x573a('0x41')](_0x27acf4[_0x573a('0x37')][_0x573a('0x41')]);_0x22a0cb[_0x573a('0x42')]=qs[_0x573a('0x39')](_[_0x573a('0x43')](_0x27acf4[_0x573a('0x37')],_0x5c0578['filters']));_0x22a0cb[_0x573a('0x42')]['ChatWebsiteId']=_0x3aa3b0['id'];if(_0x27acf4['query'][_0x573a('0x44')]){_0x22a0cb[_0x573a('0x42')]=_[_0x573a('0x5b')](_0x22a0cb[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x22a0cb[_0x573a('0x3b')],function(_0x5cde69){var _0x54fee4={};_0x54fee4[_0x5cde69]={'$like':'%'+_0x27acf4['query'][_0x573a('0x44')]+'%'};return _0x54fee4;})});}_0x22a0cb=_[_0x573a('0x5b')]({},_0x22a0cb,_0x27acf4[_0x573a('0x47')]);return db[_0x573a('0x60')]['count']({'where':_0x22a0cb[_0x573a('0x42')]})[_0x573a('0x14')](function(_0x2d0bb7){_0xccaabc[_0x573a('0x25')]=_0x2d0bb7;if(_0x27acf4[_0x573a('0x37')][_0x573a('0x48')]){_0x22a0cb[_0x573a('0x49')]=[{'all':!![]}];}return db[_0x573a('0x60')][_0x573a('0x4a')](_0x22a0cb);})[_0x573a('0x14')](function(_0xc0b0e0){_0xccaabc[_0x573a('0x5c')]=_0xc0b0e0;return _0xccaabc;});}})[_0x573a('0x14')](respondWithFilteredResult(_0x3724ed,_0x22a0cb))[_0x573a('0x1f')](handleError(_0x3724ed,null));};exports[_0x573a('0x62')]=function(_0x120be4,_0x18240a){return db['ChatWebsite'][_0x573a('0x4d')]({'where':{'id':_0x120be4[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x18240a,null))['then'](function(_0x17369f){if(_0x17369f){return _0x17369f['removeAnswers'](_0x120be4['query']['ids']);}})[_0x573a('0x14')](respondWithStatusCode(_0x18240a,null))[_0x573a('0x1f')](handleError(_0x18240a,null));};exports[_0x573a('0x63')]=function(_0x2d2bee,_0x1c5f59){_0x2d2bee[_0x573a('0x4f')][_0x573a('0x64')]=_0x2d2bee['file']['filename'];return db['ChatWebsite'][_0x573a('0x4d')]({'where':{'id':_0x2d2bee[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x1c5f59,null))[_0x573a('0x14')](saveUpdates(_0x2d2bee[_0x573a('0x4f')],null))['then'](respondWithResult(_0x1c5f59,null))[_0x573a('0x1f')](handleError(_0x1c5f59,null));};exports['addAvatar']=function(_0x3f31f7,_0x1b3197){_0x3f31f7[_0x573a('0x4f')]['agentAvatar']=_0x3f31f7[_0x573a('0x65')][_0x573a('0x66')];return db[_0x573a('0x32')]['find']({'where':{'id':_0x3f31f7[_0x573a('0x56')]['id']}})['then'](handleEntityNotFound(_0x1b3197,null))[_0x573a('0x14')](saveUpdates(_0x3f31f7['body'],null))[_0x573a('0x14')](respondWithResult(_0x1b3197,null))[_0x573a('0x1f')](handleError(_0x1b3197,null));};exports[_0x573a('0x67')]=function(_0x533f12,_0x47c612){_0x533f12[_0x573a('0x4f')][_0x573a('0x68')]=_0x533f12[_0x573a('0x65')][_0x573a('0x66')];return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x533f12[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x47c612,null))['then'](saveUpdates(_0x533f12['body'],null))['then'](respondWithResult(_0x47c612,null))['catch'](handleError(_0x47c612,null));};exports[_0x573a('0x69')]=function(_0x1836e1,_0x2cade4){_0x1836e1[_0x573a('0x4f')][_0x573a('0x6a')]=_0x1836e1[_0x573a('0x65')][_0x573a('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x1836e1['params']['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x2cade4,null))[_0x573a('0x14')](saveUpdates(_0x1836e1[_0x573a('0x4f')],null))['then'](respondWithResult(_0x2cade4,null))[_0x573a('0x1f')](handleError(_0x2cade4,null));};exports[_0x573a('0x6b')]=function(_0x269b1f,_0x4370f0){var _0x2a3efc=path['join'](config[_0x573a('0x6c')],'server/files/images/logos/default_logo.svg');var _0x339599={'where':{'id':_0x269b1f[_0x573a('0x56')]['id']},'attributes':['id',_0x573a('0x64')],'raw':!![]};var _0x8c92c1=![];return require(_0x573a('0x6d'))[_0x573a('0x6e')]()[_0x573a('0x14')](function(_0xcf921e){if(_0xcf921e){_0x8c92c1=_0xcf921e[_0x573a('0x6f')];}})[_0x573a('0x14')](function(){return db[_0x573a('0x32')][_0x573a('0x4d')](_0x339599);})[_0x573a('0x14')](handleEntityNotFound(_0x4370f0,null))[_0x573a('0x14')](function(_0x5698e6){if(_0x5698e6){if(!_['isNil'](_0x5698e6[_0x573a('0x64')])){if(fs[_0x573a('0x70')](path[_0x573a('0x71')](config[_0x573a('0x6c')],'server/files/images/logos/',_0x5698e6[_0x573a('0x64')]))&&_0x8c92c1){_0x2a3efc=path[_0x573a('0x71')](config[_0x573a('0x6c')],'server/files/images/logos/',_0x5698e6[_0x573a('0x64')]);}}return _0x4370f0[_0x573a('0x72')](_0x2a3efc);}})['catch'](handleError(_0x4370f0,null));};exports[_0x573a('0x73')]=function(_0x4c9145,_0xe66b2a){var _0x56a5a6=path['join'](config[_0x573a('0x6c')],_0x573a('0x74'));var _0x304424={'where':{'id':_0x4c9145[_0x573a('0x56')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x573a('0x32')][_0x573a('0x4d')](_0x304424)['then'](handleEntityNotFound(_0xe66b2a,null))[_0x573a('0x14')](function(_0x1183e4){if(_0x1183e4){if(!_[_0x573a('0x75')](_0x1183e4[_0x573a('0x76')])){if(fs['existsSync'](path[_0x573a('0x71')](config[_0x573a('0x6c')],'server/files/images/avatars/',_0x1183e4[_0x573a('0x76')]))){_0x56a5a6=path['join'](config[_0x573a('0x6c')],'server/files/images/avatars/',_0x1183e4[_0x573a('0x76')]);}}return _0xe66b2a['download'](_0x56a5a6);}})[_0x573a('0x1f')](handleError(_0xe66b2a,null));};exports[_0x573a('0x77')]=function(_0x3024ba,_0x4af0d3){var _0x1f4f5d=path[_0x573a('0x71')](config['root'],_0x573a('0x78'));var _0x3676c1={'where':{'id':_0x3024ba[_0x573a('0x56')]['id']},'attributes':['id',_0x573a('0x68'),_0x573a('0x79')],'raw':!![]};return db['ChatWebsite'][_0x573a('0x4d')](_0x3676c1)['then'](handleEntityNotFound(_0x4af0d3,null))['then'](function(_0x4491b5){if(_0x4491b5){if(!_[_0x573a('0x75')](_0x4491b5[_0x573a('0x68')])){if(fs[_0x573a('0x70')](path[_0x573a('0x71')](config[_0x573a('0x6c')],_0x573a('0x7a'),_0x4491b5['customerAvatar']))&&_0x4491b5[_0x573a('0x79')]){_0x1f4f5d=path['join'](config[_0x573a('0x6c')],_0x573a('0x7a'),_0x4491b5[_0x573a('0x68')]);}}return _0x4af0d3[_0x573a('0x72')](_0x1f4f5d);}})['catch'](handleError(_0x4af0d3,null));};exports[_0x573a('0x7b')]=function(_0x2b9db4,_0x57edf4){var _0x5da2b5=path[_0x573a('0x71')](config[_0x573a('0x6c')],'server/files/images/avatars/system_avatar.png');var _0x2a6163={'where':{'id':_0x2b9db4[_0x573a('0x56')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x573a('0x32')][_0x573a('0x4d')](_0x2a6163)['then'](handleEntityNotFound(_0x57edf4,null))[_0x573a('0x14')](function(_0x2d2ebc){if(_0x2d2ebc){if(!_[_0x573a('0x75')](_0x2d2ebc[_0x573a('0x6a')])){if(fs['existsSync'](path[_0x573a('0x71')](config[_0x573a('0x6c')],_0x573a('0x7a'),_0x2d2ebc['systemAvatar']))){_0x5da2b5=path['join'](config[_0x573a('0x6c')],_0x573a('0x7a'),_0x2d2ebc[_0x573a('0x6a')]);}}return _0x57edf4[_0x573a('0x72')](_0x5da2b5);}})['catch'](handleError(_0x57edf4,null));};exports[_0x573a('0x7c')]=function(_0x1f0834,_0x136750){var _0x5e0d5f=require(_0x573a('0x7d'));var _0x5d09be=new _0x5e0d5f();var _0x5915ab=_0x5d09be['setUA'](_0x1f0834[_0x573a('0x7e')][_0x573a('0x7f')])[_0x573a('0x80')]();var _0x563643={'body':_0x1f0834[_0x573a('0x4f')],'channel':_0x573a('0x81')};var _0x57baea=[];var _0x14f886=[];var _0x2c726e={};var _0x415b94=![];return db[_0x573a('0x82')]['describe']()['then'](function(_0x1607d3){if(!_0x1607d3){throw new db[(_0x573a('0x83'))][(_0x573a('0x84'))](_0x573a('0x85'));}_0x57baea=_[_0x573a('0x86')](_[_0x573a('0x38')](_0x1607d3),[_0x573a('0x87'),_0x573a('0x88')]);_0x14f886=_['difference'](_[_0x573a('0x38')](_0x1607d3),[_0x573a('0x87'),'updatedAt',_0x573a('0x89'),_0x573a('0x8a')]);if(_0x1f0834[_0x573a('0x4f')]['id']){delete _0x1f0834[_0x573a('0x4f')]['id'];}if(_[_0x573a('0x75')](_0x1f0834[_0x573a('0x4f')][_0x573a('0x8b')])){throw new db[(_0x573a('0x83'))][(_0x573a('0x84'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1f0834[_0x573a('0x4f')]['body'])||_0x1f0834[_0x573a('0x4f')][_0x573a('0x4f')]===''){throw new db['Sequelize'][(_0x573a('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x573a('0x75')](_0x1f0834[_0x573a('0x4f')][_0x573a('0x8c')])){throw new db['Sequelize']['ValidationError'](_0x573a('0x8d')+_0x14f886);}if(!_[_0x573a('0x8e')](_0x14f886,_0x1f0834[_0x573a('0x4f')][_0x573a('0x8c')])){throw new db[(_0x573a('0x83'))][(_0x573a('0x84'))](_0x573a('0x8f')+_0x14f886);}_0x2c726e[_0x1f0834[_0x573a('0x4f')][_0x573a('0x8c')]]=_0x1f0834[_0x573a('0x4f')][_0x573a('0x8b')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1f0834[_0x573a('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x573a('0x90'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2c726e,'limit':0x1,'order':[[_0x573a('0x88'),_0x573a('0x91')]]}]},{'model':db[_0x573a('0x92')],'as':'Applications'}]});})[_0x573a('0x14')](handleEntityNotFound(_0x136750,null))['then'](function(_0x140c5b){if(_0x140c5b&&_0x140c5b[_0x573a('0x90')]){_0x563643[_0x573a('0x93')]=_0x140c5b;_0x563643[_0x573a('0x94')]=_0x140c5b['Applications'];_0x563643[_0x573a('0x95')]=_0x140c5b[_0x573a('0x90')];_0x563643[_0x573a('0x94')]=_[_0x573a('0x96')](_0x563643[_0x573a('0x94')],[_0x573a('0x97')],[_0x573a('0x98')]);if(_0x563643[_0x573a('0x93')][_0x573a('0x99')]){delete _0x563643[_0x573a('0x93')][_0x573a('0x99')];}if(_0x563643[_0x573a('0x93')][_0x573a('0x90')]&&_0x563643['account'][_0x573a('0x90')][_0x573a('0x9a')]['length']){return _0x563643[_0x573a('0x93')][_0x573a('0x90')]['Contacts'][0x0];}var _0x441240=_[_0x573a('0xc')](_0x1f0834[_0x573a('0x4f')],{'firstName':_0x1f0834['body'][_0x573a('0x8b')],'ListId':_0x140c5b[_0x573a('0x8a')]});_0x441240[_0x1f0834['body']['mapKey']]=_0x1f0834['body'][_0x573a('0x8b')];return db['CmContact']['create'](_0x441240,{'fields':_0x57baea,'raw':!![]});}})['then'](handleEntityNotFound(_0x136750,null))[_0x573a('0x14')](function(_0x2c17bb){_0x563643[_0x573a('0x9b')]=_0x2c17bb;var _0x751814=_0x1f0834['body']['customerIp'];if(_0x1f0834[_0x573a('0x7e')][_0x573a('0x9c')]){_0x751814=_0x1f0834[_0x573a('0x7e')][_0x573a('0x9c')];}else if(_0x1f0834[_0x573a('0x7e')][_0x573a('0x9d')]){_0x751814=_[_0x573a('0x9e')](_0x1f0834[_0x573a('0x7e')][_0x573a('0x9d')]['split'](','));}if(_0x2c17bb){var _0x226b67={'ContactId':_0x2c17bb['id'],'ChatWebsiteId':_0x1f0834[_0x573a('0x56')]['id'],'from':(_0x2c17bb[_0x573a('0x9f')]||'')+'\x20'+(_0x2c17bb[_0x573a('0xa0')]||''),'customerIp':_0x751814,'customerPort':_0x1f0834[_0x573a('0x7e')][_0x573a('0xa1')]?_0x1f0834[_0x573a('0x7e')][_0x573a('0xa1')]:null,'referer':_0x1f0834[_0x573a('0x4f')]['referer'],'browserName':_0x5915ab[_0x573a('0xa2')][_0x573a('0x46')]&&_0x5915ab['browser'][_0x573a('0xa3')]?util[_0x573a('0xa4')](_0x573a('0xa5'),_0x5915ab[_0x573a('0xa2')]['name'],_0x5915ab[_0x573a('0xa2')][_0x573a('0xa3')]):_0x573a('0xa6'),'browserVersion':_0x5915ab['browser'][_0x573a('0xa3')]||_0x573a('0xa6'),'osName':util[_0x573a('0xa4')](_0x573a('0xa5'),_0x5915ab['os'][_0x573a('0x46')],_0x5915ab['os'][_0x573a('0xa3')]),'osVersion':_0x5915ab['os'][_0x573a('0xa3')],'deviceModel':_0x5915ab[_0x573a('0xa7')][_0x573a('0x36')]&&_0x5915ab[_0x573a('0xa7')][_0x573a('0xa8')]?util[_0x573a('0xa4')]('%s\x20%s\x20%s',_0x5915ab['device']['model'],_0x5915ab[_0x573a('0xa7')][_0x573a('0xa8')],_0x5915ab[_0x573a('0xa7')][_0x573a('0x34')]):null,'deviceVendor':_0x5915ab[_0x573a('0xa7')]['vendor'],'deviceType':_0x5915ab[_0x573a('0xa7')][_0x573a('0x34')],'formData':JSON[_0x573a('0x18')](_0x1f0834[_0x573a('0x4f')])};var _0x3fa7ea={'ChatWebsiteId':_0x1f0834[_0x573a('0x56')]['id'],'closed':![]};if(_0x1f0834['body']['threadId']){_0x3fa7ea[_0x573a('0xa9')]=_0x1f0834[_0x573a('0x4f')][_0x573a('0xa9')];return db[_0x573a('0xaa')][_0x573a('0x4d')]({'where':_0x3fa7ea})[_0x573a('0x14')](function(_0xcd7ead){if(_0xcd7ead){return[_0xcd7ead,![]];}_0x226b67['threadId']=_0x1f0834[_0x573a('0x4f')][_0x573a('0xa9')];_0x226b67[_0x573a('0xab')]=_0x1f0834['body']['externalUrl'];return db[_0x573a('0xaa')][_0x573a('0x4e')](_0x226b67)['then'](function(_0x5114f6){return[_0x5114f6,!![]];});});}_0x3fa7ea[_0x573a('0xac')]=_0x2c17bb['id'];if(_0x1f0834[_0x573a('0x4f')]['interaction']&&_0x1f0834[_0x573a('0x4f')]['interaction']['id']){_0x3fa7ea['id']=_0x1f0834[_0x573a('0x4f')][_0x573a('0xad')]['id'];return db['ChatInteraction']['find']({'where':_0x3fa7ea})[_0x573a('0x14')](function(_0x32a96a){if(_0x32a96a){return[_0x32a96a,![]];}return db[_0x573a('0xaa')]['create'](_0x226b67)['then'](function(_0x321084){return[_0x321084,!![]];});});}return db['ChatInteraction'][_0x573a('0x4e')](_0x226b67)[_0x573a('0x14')](function(_0x421e4d){return[_0x421e4d,!![]];});}})[_0x573a('0xae')](function(_0x48b833,_0x4b3b72){if(_0x48b833){_0x415b94=_0x4b3b72;if(!_0x4b3b72){var _0x4b1560={'from':(_0x563643[_0x573a('0x9b')][_0x573a('0x9f')]||'')+'\x20'+(_0x563643[_0x573a('0x9b')][_0x573a('0xa0')]||'')};if(_0x1f0834['body']['threadId']&&_0x1f0834['body'][_0x573a('0xaf')]&&_0x1f0834['body'][_0x573a('0xa9')]!=_0x1f0834[_0x573a('0x4f')]['messageId']){_0x4b1560[_0x573a('0xa9')]=_0x1f0834[_0x573a('0x4f')][_0x573a('0xaf')];}return _0x48b833[_0x573a('0xb0')](_0x4b1560);}else{return _0x48b833;}}})[_0x573a('0x14')](function(_0x441a15){_0x563643[_0x573a('0xad')]=_0x441a15[_0x573a('0x29')]({'plain':!![]});_0x563643[_0x573a('0xad')][_0x573a('0xb1')]=_0x415b94;if(_0x563643[_0x573a('0xad')][_0x573a('0xb1')]){if(_0x563643[_0x573a('0x93')][_0x573a('0xb2')]){_0x563643[_0x573a('0x94')]['push']({'id':0x0,'priority':_0x563643[_0x573a('0x94')][_0x573a('0x3d')]+0x1,'app':_0x573a('0xb3'),'appdata':_0x573a('0xb4'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x573a('0x4e')]({'body':_0x1f0834['body']['body'],'ChatWebsiteId':_0x1f0834['params']['id'],'ChatInteractionId':_0x441a15['id'],'direction':'in','ContactId':_0x563643[_0x573a('0x9b')]['id'],'AttachmentId':_0x1f0834[_0x573a('0x4f')][_0x573a('0xb5')]});})['then'](function(_0x1fdc76){_0x563643[_0x573a('0x1c')]=_0x1fdc76;if(_0x563643[_0x573a('0xad')][_0x573a('0xb6')]){return db[_0x573a('0xb7')][_0x573a('0x4d')]({'attributes':['id','name'],'where':{'id':_0x563643[_0x573a('0xad')]['UserId']}})[_0x573a('0x14')](function(_0x4b5205){if(_0x4b5205){_0x563643[_0x573a('0x94')][_0x573a('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b5205['name']+','+(_0x563643[_0x573a('0x93')][_0x573a('0xb9')]||0xa),'interval':_0x573a('0xba')});_0x563643['forcedOwnership']=!![];}return respondWithRpcPromise(_0x573a('0xbb'),_0x573a('0xbc'),_0x563643);});}return respondWithRpcPromise(_0x573a('0xbb'),'startRouting',_0x563643);})['then'](function(_0x3a61a6){respondWithRpcPromise(_0x573a('0xbd'),_0x573a('0xbd'),{'event':_0x573a('0x7c'),'message':_0x3a61a6},client9002);return _0x3a61a6;})[_0x573a('0x14')](respondWithResult(_0x136750,null))[_0x573a('0x1f')](handleError(_0x136750,null));};exports[_0x573a('0xbe')]=function(_0x49ecc6,_0x36dfbf){var _0x27e6d2,_0x43bce4,_0x2987f4;var _0x1f5d29=[];var _0x6eea43={};var _0x3550e8=_0x49ecc6['files']||[];var _0x47278d=[];var _0x40f235;return db['CmContact'][_0x573a('0x57')]()[_0x573a('0x14')](function(_0x1f402c){if(!_0x1f402c){throw new db[(_0x573a('0x83'))][(_0x573a('0x84'))](_0x573a('0x85'));}_0x1f5d29=_[_0x573a('0x86')](_[_0x573a('0x38')](_0x1f402c),[_0x573a('0x87'),'updatedAt',_0x573a('0x89'),_0x573a('0x8a')]);if(_0x49ecc6[_0x573a('0x4f')]['id']){delete _0x49ecc6[_0x573a('0x4f')]['id'];}if(_[_0x573a('0x75')](_0x49ecc6[_0x573a('0x4f')][_0x573a('0x8b')])){throw _0x36dfbf[_0x573a('0x20')](0x1f4)[_0x573a('0xbf')](new db['Sequelize'][(_0x573a('0x84'))](_0x573a('0xc0')));}if(_[_0x573a('0x75')](_0x49ecc6['body'][_0x573a('0x4f')])||_0x49ecc6['body'][_0x573a('0x4f')]===''){throw _0x36dfbf['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x573a('0xc1')));}if(_[_0x573a('0x75')](_0x49ecc6['body'][_0x573a('0xc2')])){throw _0x36dfbf['status'](0x1f4)[_0x573a('0xbf')](new db[(_0x573a('0x83'))]['ValidationError'](_0x573a('0xc3')+_0x1f5d29));}if(!_[_0x573a('0x8e')](_0x1f5d29,_0x49ecc6[_0x573a('0x4f')][_0x573a('0xc2')])){throw _0x36dfbf[_0x573a('0x20')](0x1f4)['send'](new db['Sequelize'][(_0x573a('0x84'))](_0x573a('0xc4')+_0x1f5d29));}_0x6eea43[_0x49ecc6[_0x573a('0x4f')][_0x573a('0xc2')]]=_0x49ecc6[_0x573a('0x4f')][_0x573a('0x8b')];})['then'](function(){return db[_0x573a('0x32')]['find']({'where':{'id':_0x49ecc6[_0x573a('0x56')]['id']},'include':[{'model':db[_0x573a('0xc5')],'as':'List'},{'model':db['MailAccount'],'as':_0x573a('0xc6')}]});})[_0x573a('0x14')](handleEntityNotFound(_0x36dfbf,null))[_0x573a('0x14')](function(_0x1dcb95){if(_0x1dcb95&&_0x1dcb95[_0x573a('0x90')]){_0x43bce4=_0x1dcb95;var _0x442945=_[_0x573a('0xc')](_0x49ecc6[_0x573a('0x4f')],{'firstName':_0x49ecc6[_0x573a('0x4f')][_0x573a('0x8b')],'phone':_0x49ecc6[_0x573a('0x4f')]['from'],'ListId':_0x1dcb95['ListId']});_0x442945[_0x49ecc6[_0x573a('0x4f')][_0x573a('0xc2')]]=_0x49ecc6[_0x573a('0x4f')][_0x573a('0x8b')];return db[_0x573a('0x82')][_0x573a('0xc7')]({'where':_0x6eea43,'defaults':_0x442945});}})[_0x573a('0xae')](function(_0x53d8b6){if(_0x53d8b6){_0x2987f4=_0x53d8b6;var _0x314c7c=fs[_0x573a('0xc8')](path[_0x573a('0x71')](config[_0x573a('0x6c')],_0x573a('0xc9')),_0x573a('0xca'));var _0x53f99d=ejs[_0x573a('0xcb')](_0x314c7c,{'body':_['toPairs'](_0x49ecc6[_0x573a('0x4f')][_0x573a('0x4f')]),'bodyTitle':_0x43bce4['offlineMessageBody']});return db[_0x573a('0xcc')]['create']({'body':_0x53f99d,'plainBody':htmlToText[_0x573a('0xcd')](_0x53f99d),'ContactId':_0x53d8b6['id'],'ChatWebsiteId':_0x43bce4['id']});}})[_0x573a('0x14')](function(_0x423579){_0x40f235=_0x423579;if(_0x3550e8[_0x573a('0x3d')]){var _0x1985a1=_0x3550e8[_0x573a('0x31')](function(_0xf9977a){return{'name':_0xf9977a[_0x573a('0xce')],'basename':_0xf9977a[_0x573a('0x66')],'type':_0xf9977a['mimetype'],'ChatOfflineMessageId':_0x423579['id']};});_0x47278d=_0x1985a1['map'](_0x3ab5e2=>{var _0x2e804e={'filename':_0x3ab5e2['name'],'path':path[_0x573a('0x71')](config['root'],_0x573a('0xcf'),_0x573a('0xd0'),_0x573a('0xd1'),_0x573a('0xd2'),_0x3ab5e2[_0x573a('0xd3')])};return _0x2e804e;});if(!_0x43bce4[_0x573a('0xd4')]){return db[_0x573a('0xd5')][_0x573a('0xd6')](function(_0x1934ec){return db['Attachment'][_0x573a('0xd7')](_0x1985a1,{'transaction':_0x1934ec});});}}})['then'](function(){if(_0x40f235){_0x27e6d2=_0x40f235;return db[_0x573a('0xc6')][_0x573a('0x59')]({'where':{'service':!![]},'include':[{'model':db[_0x573a('0xd8')],'as':_0x573a('0xd9'),'raw':!![],'include':[{'model':db[_0x573a('0xda')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x573a('0x14')](function(_0x29a54d){if(_0x29a54d&&_0x29a54d['Smtp']&&_0x43bce4[_0x573a('0xdb')]&&_0x43bce4[_0x573a('0xdc')]){var _0x415d89=_0x29a54d[_0x573a('0xdd')]();return respondWithRpcPromise(_0x573a('0xde'),'sendMail',{'account':_0x415d89,'message':{'from':util[_0x573a('0xa4')]('\x22%s\x22\x20<%s>',_0x29a54d[_0x573a('0x46')],_0x29a54d[_0x573a('0xdf')]||_0x29a54d[_0x573a('0xd9')][_0x573a('0x50')]),'to':_0x43bce4[_0x573a('0xdc')],'subject':_0x43bce4[_0x573a('0xe0')],'html':_0x27e6d2['body'],'attachments':_0x47278d}},client9003)[_0x573a('0x14')](function(){return _0x27e6d2;})[_0x573a('0x1f')](function(_0x5e5ff7){logger['error'](_0x5e5ff7);});}})['then'](function(){if(_0x43bce4&&_0x43bce4['openNewInteraction']&&_0x43bce4[_0x573a('0xe1')]){var _0xee9513=[];if(_0x3550e8[_0x573a('0x3d')]){_0xee9513=_0x3550e8[_0x573a('0x31')](function(_0x3058f2){return{'name':_0x3058f2[_0x573a('0xce')],'basename':_0x3058f2['filename'],'type':_0x3058f2[_0x573a('0xe2')],'ChatOfflineMessageId':_0x40f235['id']};});}var _0x10462a;if(!_['isNil'](_0x43bce4[_0x573a('0xe3')])){var _0x54f93f=_[_0x573a('0x31')](_0x49ecc6['body'],function(_0x3d9585){return _0x3d9585;});var _0x3c0d25=_[_0x573a('0xe4')](_0x54f93f)[0x0];var _0x3e2120=_[_0x573a('0xe5')](_0x3c0d25,function(_0x3ee535){return _0x3ee535;});_0x10462a=_0x3e2120[0x1][_0x43bce4['subjectOffline']];}var _0x19de50={'from':_0x2987f4[_0x573a('0xdf')],'firstName':_0x2987f4[_0x573a('0x9f')],'lastName':_0x2987f4[_0x573a('0xa0')],'mapKey':_0x573a('0xdf'),'message':{'from':_0x2987f4['email'],'to':_0x43bce4[_0x573a('0xc6')][_0x573a('0xdf')],'cc':'','subject':_[_0x573a('0x75')](_0x10462a)?_0x43bce4[_0x573a('0xe0')]:_0x10462a,'messageId':'','sentAt':new Date(),'attach':_0xee9513['length'],'attachments':_0xee9513,'originChannel':'Chat','ChatWebsiteId':_0x43bce4['id'],'ChatOfflineMessageId':_0x27e6d2['id'],'originTo':_0x43bce4[_0x573a('0xc6')][_0x573a('0xdf')]},'body':_0x27e6d2[_0x573a('0x4f')]};var _0x2f4785={'account':{'id':_0x43bce4[_0x573a('0xe1')]},'body':_0x19de50,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x573a('0xe6'),_0x2f4785,client9001)['then'](function(){return _0x27e6d2;})[_0x573a('0x1f')](function(_0x83a310){logger['error'](_0x83a310);});}return;})[_0x573a('0x14')](function(){if(_0x27e6d2){return _0x27e6d2;}})[_0x573a('0x14')](respondWithResult(_0x36dfbf,null))['catch'](function(_0x8481dd){logger[_0x573a('0x19')](_0x573a('0x1f'),_0x8481dd);for(var _0x515698 of _0x3550e8){var _0x59225d=path[_0x573a('0x71')](config['root'],_0x573a('0xcf'),_0x573a('0xd0'),_0x573a('0xd1'),'offline-chat',_0x515698['filename']);fs_extra[_0x573a('0xe7')](_0x59225d)[_0x573a('0x1f')](function(_0x41d754){logger[_0x573a('0x19')](_0x573a('0xe8'),_0x59225d,_0x41d754);});}});};exports[_0x573a('0xe9')]=function(_0x133cec,_0x364316){return db[_0x573a('0xaa')][_0x573a('0x4d')]({'where':{'id':_0x133cec['params']['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x364316,null))[_0x573a('0x14')](function(_0x477b71){if(_0x477b71){return _0x477b71[_0x573a('0xe9')](_0x133cec[_0x573a('0x4f')][_0x573a('0x5e')],_[_0x573a('0xea')](_0x133cec[_0x573a('0x4f')],[_0x573a('0x5e'),'id'])||{});}})[_0x573a('0x14')](respondWithResult(_0x364316,null))[_0x573a('0x1f')](handleError(_0x364316,null));};exports[_0x573a('0xeb')]=function(_0x7c0b4e,_0x2729b6){var _0x1234d5={'raw':![],'where':{}};var _0x3306b6={};var _0x1365f4={'count':0x0,'rows':[]};return db[_0x573a('0x32')][_0x573a('0x59')]({'where':{'id':_0x7c0b4e[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x2729b6,null))[_0x573a('0x14')](function(_0xed084a){if(_0xed084a){_0x3306b6[_0x573a('0x36')]=_['keys'](db[_0x573a('0xaa')][_0x573a('0x4c')]);_0x3306b6[_0x573a('0x37')]=_[_0x573a('0x38')](_0x7c0b4e[_0x573a('0x37')]);_0x3306b6['filters']=_[_0x573a('0x3a')](_0x3306b6[_0x573a('0x36')],_0x3306b6[_0x573a('0x37')]);_0x1234d5[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x3306b6[_0x573a('0x36')],qs[_0x573a('0x3c')](_0x7c0b4e[_0x573a('0x37')][_0x573a('0x3c')]));_0x1234d5[_0x573a('0x3b')]=_0x1234d5[_0x573a('0x3b')][_0x573a('0x3d')]?_0x1234d5[_0x573a('0x3b')]:_0x3306b6[_0x573a('0x36')];if(!_0x7c0b4e[_0x573a('0x37')]['hasOwnProperty']('nolimit')){_0x1234d5[_0x573a('0x23')]=qs['limit'](_0x7c0b4e['query'][_0x573a('0x23')]);_0x1234d5['offset']=qs['offset'](_0x7c0b4e['query']['offset']);}_0x1234d5[_0x573a('0x40')]=qs[_0x573a('0x41')](_0x7c0b4e[_0x573a('0x37')]['sort']);_0x1234d5[_0x573a('0x42')]=qs[_0x573a('0x39')](_[_0x573a('0x43')](_0x7c0b4e[_0x573a('0x37')],_0x3306b6[_0x573a('0x39')]));_0x1234d5[_0x573a('0x42')]['ChatWebsiteId']=_0xed084a['id'];if(_0x7c0b4e[_0x573a('0x37')][_0x573a('0x44')]){_0x1234d5[_0x573a('0x42')]=_[_0x573a('0x5b')](_0x1234d5[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x1234d5[_0x573a('0x3b')],function(_0x5b534f){var _0x2da6f6={};_0x2da6f6[_0x5b534f]={'$like':'%'+_0x7c0b4e[_0x573a('0x37')][_0x573a('0x44')]+'%'};return _0x2da6f6;})});}_0x1234d5=_['merge']({},_0x1234d5,_0x7c0b4e[_0x573a('0x47')]);return db[_0x573a('0xaa')][_0x573a('0x25')]({'where':_0x1234d5[_0x573a('0x42')]})['then'](function(_0x310a9c){_0x1365f4['count']=_0x310a9c;if(_0x7c0b4e[_0x573a('0x37')][_0x573a('0x48')]){_0x1234d5[_0x573a('0x49')]=[{'model':db[_0x573a('0x82')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x573a('0x46'),_0x573a('0xec'),_0x573a('0xed')],'required':![]},{'model':db[_0x573a('0xee')],'as':'Tags','attributes':['id',_0x573a('0x46'),_0x573a('0xef')],'where':_0x7c0b4e[_0x573a('0x37')][_0x573a('0xf0')]?{'id':_0x7c0b4e[_0x573a('0x37')][_0x573a('0xf0')]}:undefined,'required':_0x7c0b4e[_0x573a('0x37')][_0x573a('0xf0')]?!![]:![]}];}return db[_0x573a('0xaa')][_0x573a('0x4a')](_0x1234d5);})[_0x573a('0x14')](function(_0x597137){_0x1365f4[_0x573a('0x5c')]=_0x597137;return _0x1365f4;});}})[_0x573a('0x14')](respondWithFilteredResult(_0x2729b6,_0x1234d5))[_0x573a('0x1f')](handleError(_0x2729b6,null));};function iftimePromise(_0x1a80c,_0x2d0983){return respondWithRpcPromise(_0x573a('0xf1'),_0x573a('0xf2'),{'command':_0x2d0983[_0x573a('0xf3')]?util[_0x573a('0xa4')](_0x573a('0xf4'),_0x1a80c[_0x573a('0xf5')],_0x2d0983['timezone']):util['format']('iftime\x20%s',_0x1a80c[_0x573a('0xf5')])},client9002)[_0x573a('0x14')](function(_0x452c4d){var _0x2644f6=_0x452c4d&&_0x452c4d[_0x573a('0xf6')](_0x573a('0xf7'))>=0x0?!![]:![];logger[_0x573a('0x15')](_0x573a('0xf8'),_0x2d0983['id'],_0x1a80c['id'],_0x1a80c['interval'],_0x2644f6?_0x573a('0xf9'):_0x573a('0xfa'),_0x2d0983[_0x573a('0xf3')]?_0x2d0983[_0x573a('0xf3')]:'No\x20timezone');return _0x2644f6;})[_0x573a('0x1f')](function(_0x4a3704){logger[_0x573a('0x19')](_0x573a('0xf8'),_0x2d0983['id'],_0x1a80c['id'],_0x1a80c[_0x573a('0xf5')],util[_0x573a('0xfb')](_0x4a3704,{'showHidden':![],'depth':null}),_0x2d0983[_0x573a('0xf3')]?_0x2d0983['timezone']:_0x573a('0xfc'));return![];});}exports['getSnippet']=function(_0x2f3d50,_0x732cca){var _0x139d35=0x0;var _0x52625e=0x0;var _0x775148=![];var _0x1e4aab;var _0x4db8e5;return db[_0x573a('0x32')]['find']({'where':{'id':_0x2f3d50[_0x573a('0x56')]['id']},'include':[{'model':db[_0x573a('0xfd')],'as':'Interval','include':[{'model':db[_0x573a('0xfd')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x573a('0x14')](handleEntityNotFound(_0x732cca,null))[_0x573a('0x14')](function(_0x126fcf){if(_0x126fcf){_0x1e4aab=_0x126fcf;return _0x126fcf[_0x573a('0xfe')]({'raw':!![]});}})[_0x573a('0x14')](function(_0x38dab3){if(_0x1e4aab){if(_0x38dab3){_0x4db8e5=_0x38dab3;}}return require(_0x573a('0x6d'))[_0x573a('0x6e')]();})['then'](function(_0x898616){if(_0x898616){_0x52625e=_0x898616['virtual'];_0x775148=_0x898616['custom'];}})[_0x573a('0x14')](function(){return db[_0x573a('0xaa')][_0x573a('0x25')]({'where':{'closed':![]}});})[_0x573a('0x14')](function(_0x2f2e88){_0x139d35=_0x2f2e88;if(_0x52625e&&_0x2f2e88>_0x52625e){return db[_0x573a('0xff')][_0x573a('0x59')]({'where':{'id':0x1}})[_0x573a('0x14')](function(_0x147b6a){if(_0x147b6a){_0x147b6a[_0x573a('0x100')](_0x573a('0x101'));}});}})[_0x573a('0x14')](function(){if(_0x1e4aab['Interval']&&_0x1e4aab[_0x573a('0xfd')][_0x573a('0x102')]){var _0x4f656f=[];for(var _0x5084bd=0x0;_0x5084bd<_0x1e4aab[_0x573a('0xfd')]['Intervals'][_0x573a('0x3d')];_0x5084bd++){var _0x1dbf5b=_0x1e4aab[_0x573a('0xfd')][_0x573a('0x102')][_0x5084bd][_0x573a('0x29')]({'plain':!![]});_0x4f656f[_0x573a('0x103')](iftimePromise(_0x1dbf5b,_0x1e4aab));}return BPromise[_0x573a('0x104')](_0x4f656f)[_0x573a('0x14')](function(_0x503b19){return _[_0x573a('0x105')](_0x503b19);});}else{return!![];}})[_0x573a('0x14')](function(_0x122358){var _0x3dfc1d=fs[_0x573a('0xc8')](path[_0x573a('0x71')](config['root'],_0x573a('0x106')),_0x573a('0xca'));var _0x3ae366=new url[(_0x573a('0x107'))](_0x1e4aab['address'])[_0x573a('0x108')];var _0x3a4315=_0x573a('0x109');var _0x56694e=![];var _0x3dfd19={'chatVersion':_0x3a4315,'chatWebsiteAddressOrigin':_0x3ae366,'remote':_0x1e4aab[_0x573a('0x10a')],'query':querystring['stringify'](_[_0x573a('0x5b')](_0x1e4aab[_0x573a('0x29')]({'plain':!![]}),{'customerIp':_0x2f3d50[_0x573a('0x7e')][_0x573a('0x9d')]||_0x2f3d50[_0x573a('0x7e')][_0x573a('0x10b')]||_0x2f3d50[_0x573a('0x10c')][_0x573a('0x10d')]||_0x2f3d50['ip'],'referer':_0x2f3d50['headers'][_0x573a('0x10e')],'openedInteractions':_0x139d35,'maxInteractions':_0x52625e,'virtual':_0x775148[_0x573a('0x10f')],'online':_0x122358,'custom':_0x775148}))['replace'](/'/g,'\x5c\x27')};_0x732cca['send'](ejs[_0x573a('0xcb')](Mustache[_0x573a('0xcb')](_0x3dfc1d,_0x3dfd19),{'proactiveActions':_0x4db8e5,'alignment':_0x1e4aab['alignment'],'verticalAlignment':_0x1e4aab['verticalAlignment'],'div_color':_0x1e4aab[_0x573a('0xef')],'labelText':_0x1e4aab[_0x573a('0x110')],'text_color':_0x1e4aab[_0x573a('0x111')],'text_button_color':_0x1e4aab[_0x573a('0x112')],'button_color':_0x1e4aab[_0x573a('0x113')],'background_color':_0x1e4aab['backgroundColor'],'hideWhenOffline':_0x1e4aab[_0x573a('0x114')],'intervalId':_0x1e4aab[_0x573a('0x115')],'isDevelopment':_0x56694e,'chatVersion':_0x3a4315}));})[_0x573a('0x1f')](handleError(_0x732cca,null));};exports[_0x573a('0x116')]=function(_0x53ab51,_0x3bbd1e){var _0x2c7556=_0x53ab51['params']['id'];var _0x17d9da=_0x53ab51['body'];var _0x27cae1=0xc8;var _0x4c0fc4=null;return db[_0x573a('0xd5')]['transaction']({'isolationLevel':db[_0x573a('0xd5')]['Transaction'][_0x573a('0x117')]['READ_COMMITTED']},function(_0x35e5c9){return db[_0x573a('0x32')][_0x573a('0x59')]({'where':{'id':_0x2c7556},'transaction':_0x35e5c9})[_0x573a('0x14')](function(_0xd7f873){if(_0xd7f873){return db[_0x573a('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x2c7556},'transaction':_0x35e5c9})[_0x573a('0x14')](function(){var _0x294fe6=_[_0x573a('0x31')](_0x17d9da,function(_0x571825){_0x571825[_0x573a('0x58')]=_0x2c7556;return _0x571825;});return db[_0x573a('0x92')][_0x573a('0xd7')](_0x294fe6,{'transaction':_0x35e5c9});});}else{_0x27cae1=0x194;_0x4c0fc4=[];}});})[_0x573a('0x14')](function(){if(_0x27cae1!==0x194){return db[_0x573a('0x92')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2c7556},'order':'priority'})[_0x573a('0x14')](function(_0x5f3998){_0x4c0fc4=_0x5f3998;});}})['catch'](function(_0x5de823){_0x27cae1=0x1f4;logger[_0x573a('0x19')](_0x5de823[_0x573a('0x2d')]);if(_0x5de823['name']){delete _0x5de823[_0x573a('0x46')];}_0x4c0fc4=_0x5de823;})[_0x573a('0x118')](function(){if(_0x4c0fc4===null){_0x3bbd1e['sendStatus'](_0x27cae1);}else{if(_0x27cae1===0x1f4){_0x3bbd1e[_0x573a('0x20')](_0x27cae1)[_0x573a('0xbf')](_0x4c0fc4);}else{_0x3bbd1e[_0x573a('0x20')](_0x27cae1)[_0x573a('0x22')](_0x4c0fc4);}}});};exports['getApplications']=function(_0x109a1e,_0x4f5858){var _0x930ada={};var _0x4f865={};var _0x87f773;var _0x53bad2;return db['ChatWebsite'][_0x573a('0x59')]({'where':{'id':_0x109a1e[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x4f5858,null))[_0x573a('0x14')](function(_0x41d110){if(_0x41d110){_0x87f773=_0x41d110;_0x4f865[_0x573a('0x36')]=_[_0x573a('0x38')](db[_0x573a('0x92')][_0x573a('0x4c')]);_0x4f865[_0x573a('0x37')]=_[_0x573a('0x38')](_0x109a1e[_0x573a('0x37')]);_0x4f865['filters']=_[_0x573a('0x3a')](_0x4f865['model'],_0x4f865[_0x573a('0x37')]);_0x930ada[_0x573a('0x3b')]=_['intersection'](_0x4f865[_0x573a('0x36')],qs[_0x573a('0x3c')](_0x109a1e[_0x573a('0x37')][_0x573a('0x3c')]));_0x930ada[_0x573a('0x3b')]=_0x930ada[_0x573a('0x3b')]['length']?_0x930ada['attributes']:_0x4f865['model'];_0x930ada['order']=qs[_0x573a('0x41')](_0x109a1e[_0x573a('0x37')][_0x573a('0x41')]);_0x930ada[_0x573a('0x42')]=qs[_0x573a('0x39')](_['pick'](_0x109a1e[_0x573a('0x37')],_0x4f865[_0x573a('0x39')]));if(_0x109a1e['query'][_0x573a('0x44')]){_0x930ada[_0x573a('0x42')]=_[_0x573a('0x5b')](_0x930ada[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x930ada['attributes'],function(_0x14460f){var _0x3927cf={};_0x3927cf[_0x14460f]={'$like':'%'+_0x109a1e[_0x573a('0x37')][_0x573a('0x44')]+'%'};return _0x3927cf;})});}_0x930ada=_[_0x573a('0x5b')]({},_0x930ada,_0x109a1e[_0x573a('0x47')]);return _0x87f773[_0x573a('0x119')](_0x930ada);}})[_0x573a('0x14')](function(_0x2b5182){if(_0x2b5182){_0x53bad2=_0x2b5182[_0x573a('0x3d')];if(!_0x109a1e[_0x573a('0x37')][_0x573a('0x3e')]('nolimit')){_0x930ada[_0x573a('0x23')]=qs['limit'](_0x109a1e[_0x573a('0x37')][_0x573a('0x23')]);_0x930ada[_0x573a('0x24')]=qs[_0x573a('0x24')](_0x109a1e[_0x573a('0x37')][_0x573a('0x24')]);}return _0x87f773[_0x573a('0x119')](_0x930ada);}})[_0x573a('0x14')](function(_0x36487a){if(_0x36487a){return _0x36487a?{'count':_0x53bad2,'rows':_0x36487a}:null;}})[_0x573a('0x14')](respondWithResult(_0x4f5858,null))[_0x573a('0x1f')](handleError(_0x4f5858,null));};exports[_0x573a('0x11a')]=function(_0x71c3b5,_0x5858e3){return db['chatProactiveAction'][_0x573a('0x4d')]({'where':{'id':_0x71c3b5[_0x573a('0x56')]['id']}})['then'](handleEntityNotFound(_0x5858e3,null))[_0x573a('0x14')](function(_0x287a6c){if(_0x287a6c){return _0x287a6c[_0x573a('0x11a')](_0x71c3b5['body'][_0x573a('0x5e')],_[_0x573a('0xea')](_0x71c3b5[_0x573a('0x4f')],[_0x573a('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x5858e3,null))[_0x573a('0x1f')](handleError(_0x5858e3,null));};exports[_0x573a('0xfe')]=function(_0x5d2572,_0xf6aac5){var _0x5b5b57={};var _0x31a0c0={};var _0x4a54f4;var _0x2e5008;return db[_0x573a('0x32')]['findOne']({'where':{'id':_0x5d2572['params']['id']}})[_0x573a('0x14')](handleEntityNotFound(_0xf6aac5,null))[_0x573a('0x14')](function(_0x2d4339){if(_0x2d4339){_0x4a54f4=_0x2d4339;_0x31a0c0[_0x573a('0x36')]=_[_0x573a('0x38')](db['ChatProactiveAction'][_0x573a('0x4c')]);_0x31a0c0['query']=_[_0x573a('0x38')](_0x5d2572['query']);_0x31a0c0['filters']=_[_0x573a('0x3a')](_0x31a0c0[_0x573a('0x36')],_0x31a0c0[_0x573a('0x37')]);_0x5b5b57[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x31a0c0['model'],qs['fields'](_0x5d2572[_0x573a('0x37')][_0x573a('0x3c')]));_0x5b5b57['attributes']=_0x5b5b57[_0x573a('0x3b')][_0x573a('0x3d')]?_0x5b5b57[_0x573a('0x3b')]:_0x31a0c0[_0x573a('0x36')];_0x5b5b57[_0x573a('0x40')]=qs[_0x573a('0x41')](_0x5d2572[_0x573a('0x37')]['sort']);_0x5b5b57['where']=qs[_0x573a('0x39')](_['pick'](_0x5d2572[_0x573a('0x37')],_0x31a0c0[_0x573a('0x39')]));if(_0x5d2572[_0x573a('0x37')]['filter']){_0x5b5b57[_0x573a('0x42')]=_[_0x573a('0x5b')](_0x5b5b57[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x5b5b57[_0x573a('0x3b')],function(_0x3ec971){var _0x35abb7={};_0x35abb7[_0x3ec971]={'$like':'%'+_0x5d2572[_0x573a('0x37')][_0x573a('0x44')]+'%'};return _0x35abb7;})});}_0x5b5b57=_[_0x573a('0x5b')]({},_0x5b5b57,_0x5d2572[_0x573a('0x47')]);return _0x4a54f4[_0x573a('0xfe')](_0x5b5b57);}})['then'](function(_0x576201){if(_0x576201){_0x2e5008=_0x576201[_0x573a('0x3d')];if(!_0x5d2572[_0x573a('0x37')][_0x573a('0x3e')]('nolimit')){_0x5b5b57[_0x573a('0x23')]=qs['limit'](_0x5d2572['query']['limit']);_0x5b5b57[_0x573a('0x24')]=qs[_0x573a('0x24')](_0x5d2572[_0x573a('0x37')]['offset']);}return _0x4a54f4[_0x573a('0xfe')](_0x5b5b57);}})[_0x573a('0x14')](function(_0x3c0550){if(_0x3c0550){return _0x3c0550?{'count':_0x2e5008,'rows':_0x3c0550}:null;}})[_0x573a('0x14')](respondWithResult(_0xf6aac5,null))[_0x573a('0x1f')](handleError(_0xf6aac5,null));};exports[_0x573a('0x11b')]=function(_0x4f6399,_0x5d6c4b){var _0x4ae38f=_0x4f6399[_0x573a('0x37')][_0x573a('0x11c')]===_0x573a('0x11d')?_0x573a('0x11e'):_0x573a('0x11f');return db[_0x573a('0x32')][_0x573a('0x4d')]({'attributes':['id',_0x4ae38f],'where':{'id':_0x4f6399[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x5d6c4b,null))['then'](function(_0x21d691){if(_0x21d691){var _0x57529f=_0x21d691[_0x4ae38f];var _0x32c507=_0x57529f&&_0x57529f[_0x573a('0x120')]?_0x57529f['items']:[];_0x5d6c4b[_0x573a('0xbf')]({'fromKey':_[_0x573a('0x75')](_0x57529f['fromKey'])?undefined:_0x57529f[_0x573a('0x121')],'count':_0x32c507['length'],'rows':_0x32c507});}})['catch'](handleError(_0x5d6c4b,null));};exports['getOfflineMessages']=function(_0x10444a,_0x197a12){var _0x87b3f6={'raw':![],'where':{}};var _0x55116e={};var _0x37687f={'count':0x0,'rows':[]};return db[_0x573a('0x32')][_0x573a('0x59')]({'where':{'id':_0x10444a[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x197a12,null))[_0x573a('0x14')](function(_0x53f6b7){if(_0x53f6b7){_0x55116e[_0x573a('0x36')]=_[_0x573a('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x55116e['query']=_[_0x573a('0x38')](_0x10444a[_0x573a('0x37')]);_0x55116e[_0x573a('0x39')]=_['intersection'](_0x55116e[_0x573a('0x36')],_0x55116e[_0x573a('0x37')]);_0x87b3f6['attributes']=_[_0x573a('0x3a')](_0x55116e[_0x573a('0x36')],qs[_0x573a('0x3c')](_0x10444a[_0x573a('0x37')][_0x573a('0x3c')]));_0x87b3f6[_0x573a('0x3b')]=_0x87b3f6[_0x573a('0x3b')][_0x573a('0x3d')]?_0x87b3f6[_0x573a('0x3b')]:_0x55116e[_0x573a('0x36')];if(!_0x10444a['query'][_0x573a('0x3e')](_0x573a('0x3f'))){_0x87b3f6[_0x573a('0x23')]=qs[_0x573a('0x23')](_0x10444a[_0x573a('0x37')][_0x573a('0x23')]);_0x87b3f6['offset']=qs['offset'](_0x10444a[_0x573a('0x37')][_0x573a('0x24')]);}_0x87b3f6['order']=qs[_0x573a('0x41')](_0x10444a[_0x573a('0x37')]['sort']);_0x87b3f6[_0x573a('0x42')]=qs[_0x573a('0x39')](_['pick'](_0x10444a[_0x573a('0x37')],_0x55116e[_0x573a('0x39')]));_0x87b3f6['where'][_0x573a('0x58')]=_0x53f6b7['id'];if(_0x10444a[_0x573a('0x37')][_0x573a('0x44')]){_0x87b3f6[_0x573a('0x42')]=_[_0x573a('0x5b')](_0x87b3f6[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x87b3f6[_0x573a('0x3b')],function(_0x36022f){var _0x2aa85c={};_0x2aa85c[_0x36022f]={'$like':'%'+_0x10444a[_0x573a('0x37')][_0x573a('0x44')]+'%'};return _0x2aa85c;})});}_0x87b3f6=_[_0x573a('0x5b')]({},_0x87b3f6,_0x10444a['options']);return db[_0x573a('0xcc')][_0x573a('0x25')]({'where':_0x87b3f6[_0x573a('0x42')]})[_0x573a('0x14')](function(_0x4cb686){_0x37687f[_0x573a('0x25')]=_0x4cb686;if(_0x10444a[_0x573a('0x37')]['includeAll']){_0x87b3f6[_0x573a('0x49')]=[{'all':!![]}];}else{_0x87b3f6[_0x573a('0x49')]=[{'model':db[_0x573a('0x82')],'as':_0x573a('0x122'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x573a('0x4a')](_0x87b3f6);})[_0x573a('0x14')](function(_0x4c589d){_0x37687f[_0x573a('0x5c')]=_0x4c589d;return _0x37687f;});}})[_0x573a('0x14')](respondWithFilteredResult(_0x197a12,_0x87b3f6))[_0x573a('0x1f')](handleError(_0x197a12,null));};exports[_0x573a('0x123')]=function(_0x2e91f4,_0x35e259){return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x2e91f4[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x35e259,null))[_0x573a('0x14')](function(_0x385d9a){if(_0x385d9a){return _0x385d9a[_0x573a('0x123')](_0x2e91f4['body'][_0x573a('0x5e')],_[_0x573a('0xea')](_0x2e91f4[_0x573a('0x4f')],[_0x573a('0x5e'),'id'])||{})[_0x573a('0xae')](function(_0x5f1a8d){for(var _0x4b0e7d=0x0;_0x4b0e7d<_0x2e91f4[_0x573a('0x4f')]['ids'][_0x573a('0x3d')];_0x4b0e7d+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x2e91f4[_0x573a('0x4f')]['ids'][_0x4b0e7d]),'ChatWebsiteId':Number(_0x2e91f4['params']['id'])});}return _0x5f1a8d;});}})[_0x573a('0x14')](respondWithResult(_0x35e259,null))[_0x573a('0x1f')](handleError(_0x35e259,null));};exports[_0x573a('0x124')]=function(_0x3eb2ef,_0x176d5c){return db[_0x573a('0x32')][_0x573a('0x4d')]({'where':{'id':_0x3eb2ef[_0x573a('0x56')]['id']}})[_0x573a('0x14')](handleEntityNotFound(_0x176d5c,null))[_0x573a('0x14')](function(_0x1eb121){if(_0x1eb121){return _0x1eb121[_0x573a('0x124')](_0x3eb2ef[_0x573a('0x37')][_0x573a('0x5e')])[_0x573a('0x14')](function(){if(_['isArray'](_0x3eb2ef[_0x573a('0x37')][_0x573a('0x5e')])){for(var _0x5f45a6=0x0;_0x5f45a6<_0x3eb2ef[_0x573a('0x37')][_0x573a('0x5e')][_0x573a('0x3d')];_0x5f45a6+=0x1){socket[_0x573a('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x3eb2ef[_0x573a('0x37')][_0x573a('0x5e')][_0x5f45a6]),'ChatWebsiteId':Number(_0x3eb2ef[_0x573a('0x56')]['id'])});}}else{socket[_0x573a('0x125')](_0x573a('0x126'),{'UserId':Number(_0x3eb2ef['query'][_0x573a('0x5e')]),'ChatWebsiteId':Number(_0x3eb2ef[_0x573a('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x176d5c,null))[_0x573a('0x1f')](handleError(_0x176d5c,null));};exports[_0x573a('0x127')]=function(_0x4df7ff,_0x20bcf9){var _0x586a11={};var _0x45c991={};var _0x674a6f;var _0x4fd392;return db[_0x573a('0x32')][_0x573a('0x59')]({'where':{'id':_0x4df7ff[_0x573a('0x56')]['id']}})['then'](handleEntityNotFound(_0x20bcf9,null))[_0x573a('0x14')](function(_0x4d4bcf){if(_0x4d4bcf){_0x674a6f=_0x4d4bcf;_0x45c991[_0x573a('0x36')]=_[_0x573a('0x38')](db[_0x573a('0xb7')]['rawAttributes']);_0x45c991[_0x573a('0x37')]=_['keys'](_0x4df7ff[_0x573a('0x37')]);_0x45c991['filters']=_['intersection'](_0x45c991['model'],_0x45c991[_0x573a('0x37')]);_0x586a11[_0x573a('0x3b')]=_[_0x573a('0x3a')](_0x45c991[_0x573a('0x36')],qs[_0x573a('0x3c')](_0x4df7ff[_0x573a('0x37')][_0x573a('0x3c')]));_0x586a11[_0x573a('0x3b')]=_0x586a11[_0x573a('0x3b')]['length']?_0x586a11['attributes']:_0x45c991[_0x573a('0x36')];_0x586a11[_0x573a('0x40')]=qs[_0x573a('0x41')](_0x4df7ff['query'][_0x573a('0x41')]);_0x586a11['where']=qs[_0x573a('0x39')](_[_0x573a('0x43')](_0x4df7ff[_0x573a('0x37')],_0x45c991[_0x573a('0x39')]));if(_0x4df7ff[_0x573a('0x37')][_0x573a('0x44')]){_0x586a11['where']=_['merge'](_0x586a11[_0x573a('0x42')],{'$or':_[_0x573a('0x31')](_0x586a11[_0x573a('0x3b')],function(_0x5d0e17){var _0x4ab275={};_0x4ab275[_0x5d0e17]={'$like':'%'+_0x4df7ff['query'][_0x573a('0x44')]+'%'};return _0x4ab275;})});}_0x586a11=_[_0x573a('0x5b')]({},_0x586a11,_0x4df7ff[_0x573a('0x47')]);return _0x674a6f[_0x573a('0x127')](_0x586a11);}})[_0x573a('0x14')](function(_0x10fec6){if(_0x10fec6){_0x4fd392=_0x10fec6[_0x573a('0x3d')];if(!_0x4df7ff[_0x573a('0x37')][_0x573a('0x3e')](_0x573a('0x3f'))){_0x586a11[_0x573a('0x23')]=qs[_0x573a('0x23')](_0x4df7ff[_0x573a('0x37')]['limit']);_0x586a11[_0x573a('0x24')]=qs[_0x573a('0x24')](_0x4df7ff[_0x573a('0x37')][_0x573a('0x24')]);}return _0x674a6f[_0x573a('0x127')](_0x586a11);}})['then'](function(_0x397b0c){if(_0x397b0c){return _0x397b0c?{'count':_0x4fd392,'rows':_0x397b0c}:null;}})[_0x573a('0x14')](respondWithResult(_0x20bcf9,null))[_0x573a('0x1f')](handleError(_0x20bcf9,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 8eb2065..95f61c2 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 _0xbe48=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0xbe48,0x121));var _0x8be4=function(_0xd80c55,_0x5866a0){_0xd80c55=_0xd80c55-0x0;var _0x5af3ff=_0xbe48[_0xd80c55];return _0x5af3ff;};'use strict';var EventEmitter=require(_0x8be4('0x0'));var ChatWebsite=require(_0x8be4('0x1'))['db'][_0x8be4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8be4('0x3')](0x0);var events={'afterCreate':_0x8be4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3404c7){return function(_0x95e50e,_0x53fdb0,_0x191a88){ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7+':'+_0x95e50e['id'],_0x95e50e);ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7,_0x95e50e);_0x191a88(null);};}for(var e in events){if(events[_0x8be4('0x6')](e)){var event=events[e];ChatWebsite[_0x8be4('0x7')](e,emitEvent(event));}}module[_0x8be4('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x08d9=['hasOwnProperty','exports','events','ChatWebsite','save','update','remove','emit'];(function(_0x4359bc,_0x237ad2){var _0x101f39=function(_0x37fc33){while(--_0x37fc33){_0x4359bc['push'](_0x4359bc['shift']());}};_0x101f39(++_0x237ad2);}(_0x08d9,0xc2));var _0x908d=function(_0x52e1ff,_0x22a521){_0x52e1ff=_0x52e1ff-0x0;var _0x2f4db0=_0x08d9[_0x52e1ff];return _0x2f4db0;};'use strict';var EventEmitter=require(_0x908d('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x908d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x908d('0x2'),'afterUpdate':_0x908d('0x3'),'afterDestroy':_0x908d('0x4')};function emitEvent(_0x5228dd){return function(_0x53cef4,_0x15dfb3,_0x396097){ChatWebsiteEvents[_0x908d('0x5')](_0x5228dd+':'+_0x53cef4['id'],_0x53cef4);ChatWebsiteEvents[_0x908d('0x5')](_0x5228dd,_0x53cef4);_0x396097(null);};}for(var e in events){if(events[_0x908d('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x908d('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 26c8ce4..47cc5a1 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 _0xf45b=['lodash','util','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x1e84f2,_0x235272){var _0x59973e=function(_0x51c2ac){while(--_0x51c2ac){_0x1e84f2['push'](_0x1e84f2['shift']());}};_0x59973e(++_0x235272);}(_0xf45b,0x6c));var _0xbf45=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xf45b[_0x4e697a];return _0x88850c;};'use strict';var _=require(_0xbf45('0x0'));var util=require(_0xbf45('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf45('0x2'));var fs=require('fs');var path=require(_0xbf45('0x3'));var rimraf=require(_0xbf45('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf45('0x5'));module['exports']=function(_0x1557aa,_0xe227c8){return _0x1557aa[_0xbf45('0x6')](_0xbf45('0x7'),attributes,{'tableName':_0xbf45('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e28=['api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e28,0x107));var _0x80e2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e28[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x80e2('0x0'))(_0x80e2('0x1'));var moment=require(_0x80e2('0x2'));var BPromise=require(_0x80e2('0x3'));var rp=require(_0x80e2('0x4'));var fs=require('fs');var path=require(_0x80e2('0x5'));var rimraf=require('rimraf');var config=require(_0x80e2('0x6'));var attributes=require(_0x80e2('0x7'));module[_0x80e2('0x8')]=function(_0x3e74bd,_0x120777){return _0x3e74bd[_0x80e2('0x9')]('ChatWebsite',attributes,{'tableName':_0x80e2('0xa'),'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 c771e0c..db1ccee 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 _0x163f=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x30fc83,_0x5a895a){var _0xd7247b=function(_0x41ea93){while(--_0x41ea93){_0x30fc83['push'](_0x30fc83['shift']());}};_0xd7247b(++_0x5a895a);}(_0x163f,0x112));var _0xf163=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x163f[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf163('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf163('0x3'));var logger=require(_0xf163('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf163('0x5'));var client=jayson[_0xf163('0x6')][_0xf163('0x7')]({'port':0x232a});config['redis']=_[_0xf163('0x8')](config[_0xf163('0x9')],{'host':_0xf163('0xa'),'port':0x18eb});var socket=require(_0xf163('0xb'))(new Redis(config[_0xf163('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1e2f7c,_0x15b53e,_0x313d24){return new BPromise(function(_0x2811bc,_0x54578d){return client['request'](_0x1e2f7c,_0x313d24)[_0xf163('0xc')](function(_0x1200df){logger[_0xf163('0xd')](_0xf163('0xe'),_0x15b53e,_0xf163('0xf'));logger[_0xf163('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15b53e,'request\x20sent',JSON['stringify'](_0x1200df));if(_0x1200df[_0xf163('0x11')]){if(_0x1200df['error'][_0xf163('0x12')]===0x1f4){logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')][_0xf163('0x13')]);return _0x54578d(_0x1200df[_0xf163('0x11')]['message']);}logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')]['message']);return _0x2811bc(_0x1200df['error'][_0xf163('0x13')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0xf163('0xf'));_0x2811bc(_0x1200df[_0xf163('0x14')][_0xf163('0x13')]);}})[_0xf163('0x15')](function(_0x5a67be){logger[_0xf163('0x11')](_0xf163('0xe'),_0x15b53e,_0x5a67be);_0x54578d(_0x5a67be);});});} \ No newline at end of file +var _0xada3=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xada3,0x1ca));var _0x3ada=function(_0x357654,_0x3bba0a){_0x357654=_0x357654-0x0;var _0x3ce758=_0xada3[_0x357654];return _0x3ce758;};'use strict';var _=require(_0x3ada('0x0'));var util=require(_0x3ada('0x1'));var moment=require('moment');var BPromise=require(_0x3ada('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ada('0x3'));var db=require(_0x3ada('0x4'))['db'];var utils=require(_0x3ada('0x5'));var logger=require('../../config/logger')(_0x3ada('0x6'));var config=require(_0x3ada('0x7'));var jayson=require(_0x3ada('0x8'));var client=jayson[_0x3ada('0x9')]['http']({'port':0x232a});config[_0x3ada('0xa')]=_[_0x3ada('0xb')](config[_0x3ada('0xa')],{'host':_0x3ada('0xc'),'port':0x18eb});var socket=require(_0x3ada('0xd'))(new Redis(config['redis']));require(_0x3ada('0xe'))[_0x3ada('0xf')](socket);function respondWithRpcPromise(_0x1e413e,_0x440411,_0x1a4fb0){return new BPromise(function(_0x4007d4,_0x13363e){return client['request'](_0x1e413e,_0x1a4fb0)[_0x3ada('0x10')](function(_0x4f0c5f){logger[_0x3ada('0x11')](_0x3ada('0x12'),_0x440411,'request\x20sent');logger[_0x3ada('0x13')](_0x3ada('0x14'),_0x440411,_0x3ada('0x15'),JSON[_0x3ada('0x16')](_0x4f0c5f));if(_0x4f0c5f[_0x3ada('0x17')]){if(_0x4f0c5f['error'][_0x3ada('0x18')]===0x1f4){logger[_0x3ada('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x440411,_0x4f0c5f[_0x3ada('0x17')][_0x3ada('0x19')]);return _0x13363e(_0x4f0c5f[_0x3ada('0x17')][_0x3ada('0x19')]);}logger[_0x3ada('0x17')](_0x3ada('0x12'),_0x440411,_0x4f0c5f[_0x3ada('0x17')]['message']);return _0x4007d4(_0x4f0c5f['error']['message']);}else{logger[_0x3ada('0x11')](_0x3ada('0x12'),_0x440411,_0x3ada('0x15'));_0x4007d4(_0x4f0c5f[_0x3ada('0x1a')]['message']);}})[_0x3ada('0x1b')](function(_0x3f2f86){logger[_0x3ada('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x440411,_0x3f2f86);_0x13363e(_0x3f2f86);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fd36c21..88498c7 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 _0x1895=['update','emit','register','length','save'];(function(_0x4686be,_0x39f490){var _0x44ead1=function(_0x4b6bff){while(--_0x4b6bff){_0x4686be['push'](_0x4686be['shift']());}};_0x44ead1(++_0x39f490);}(_0x1895,0x108));var _0x5189=function(_0x3d790e,_0x1ecaa3){_0x3d790e=_0x3d790e-0x0;var _0xb9b79a=_0x1895[_0x3d790e];return _0xb9b79a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x5189('0x0'),'remove',_0x5189('0x1')];function createListener(_0x23b607,_0x1b16c6){return function(_0x4d267f){_0x1b16c6[_0x5189('0x2')](_0x23b607,_0x4d267f);};}function removeListener(_0x2f7750,_0x2b0395){return function(){ChatWebsiteEvents['removeListener'](_0x2f7750,_0x2b0395);};}exports[_0x5189('0x3')]=function(_0x5522e4){for(var _0x127a96=0x0,_0x71b7c6=events[_0x5189('0x4')];_0x127a96<_0x71b7c6;_0x127a96++){var _0x454abe=events[_0x127a96];var _0x8970b0=createListener('chatWebsite:'+_0x454abe,_0x5522e4);ChatWebsiteEvents['on'](_0x454abe,_0x8970b0);}}; \ No newline at end of file +var _0x5216=['save','update','emit','register','length','./chatWebsite.events'];(function(_0x3a8dc2,_0x41b945){var _0x71d73a=function(_0x31d7c2){while(--_0x31d7c2){_0x3a8dc2['push'](_0x3a8dc2['shift']());}};_0x71d73a(++_0x41b945);}(_0x5216,0xe9));var _0x6521=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5216[_0x2641f9];return _0x585741;};'use strict';var ChatWebsiteEvents=require(_0x6521('0x0'));var events=[_0x6521('0x1'),'remove',_0x6521('0x2')];function createListener(_0x37b700,_0x27782b){return function(_0xe14c5a){_0x27782b[_0x6521('0x3')](_0x37b700,_0xe14c5a);};}function removeListener(_0x4def23,_0x410c56){return function(){ChatWebsiteEvents['removeListener'](_0x4def23,_0x410c56);};}exports[_0x6521('0x4')]=function(_0x33fcb7){for(var _0x3bd251=0x0,_0x73b4e=events[_0x6521('0x5')];_0x3bd251<_0x73b4e;_0x3bd251++){var _0x10b570=events[_0x3bd251];var _0x4e50dd=createListener('chatWebsite:'+_0x10b570,_0x33fcb7);ChatWebsiteEvents['on'](_0x10b570,_0x4e50dd);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d3b4d49..d5acf33 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 _0x6ad1=['getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','addAgents','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','describe','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0x6ad1,0x14b));var _0x16ad=function(_0x47088b,_0x576c1a){_0x47088b=_0x47088b-0x0;var _0x2cf2b8=_0x6ad1[_0x47088b];return _0x2cf2b8;};'use strict';var multer=require(_0x16ad('0x0'));var util=require(_0x16ad('0x1'));var path=require(_0x16ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x16ad('0x3'));var router=express[_0x16ad('0x4')]();var fs_extra=require(_0x16ad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x16ad('0x6'));var config=require(_0x16ad('0x7'));var controller=require('./chatWebsite.controller');router[_0x16ad('0x8')]('/',auth['isAuthenticated'](),controller[_0x16ad('0x9')]);router['get'](_0x16ad('0xa'),auth['isAuthenticated'](),controller[_0x16ad('0xb')]);router[_0x16ad('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x16ad('0xc')]);router[_0x16ad('0x8')](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller['getDispositions']);router[_0x16ad('0x8')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x10')]);router[_0x16ad('0x8')](_0x16ad('0x11'),controller[_0x16ad('0x12')]);router[_0x16ad('0x8')](_0x16ad('0x13'),controller[_0x16ad('0x14')]);router[_0x16ad('0x8')](_0x16ad('0x15'),controller[_0x16ad('0x16')]);router[_0x16ad('0x8')](_0x16ad('0x17'),controller['getSystemAvatar']);router[_0x16ad('0x8')](_0x16ad('0x18'),auth['isAuthenticated'](),controller[_0x16ad('0x19')]);router[_0x16ad('0x8')](_0x16ad('0x1a'),controller[_0x16ad('0x1b')]);router[_0x16ad('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x1c')]);router[_0x16ad('0x8')](_0x16ad('0x1d'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x1e')]);router[_0x16ad('0x8')](_0x16ad('0x1f'),controller[_0x16ad('0x20')]);router[_0x16ad('0x8')](_0x16ad('0x21'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x22')]);router[_0x16ad('0x8')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x24')]);router[_0x16ad('0x25')]('/',auth[_0x16ad('0xe')](),controller[_0x16ad('0x26')]);router['post'](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x27')]);router[_0x16ad('0x25')]('/:id/canned_answers',auth[_0x16ad('0xe')](),controller[_0x16ad('0x28')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x38ceb1,_0x334ca2,_0x5d1c5a){_0x5d1c5a(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x2c')));},'filename':function(_0x2f08a4,_0x5855d4,_0x2c3ba4){_0x2c3ba4(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date[_0x16ad('0x2f')](),_0x5855d4[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x11'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x32')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x4ee843,_0x365e3c,_0x30d426){_0x30d426(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x4903ff,_0xe17893,_0x23024d){_0x23024d(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0xe17893[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x13'),upload[_0x16ad('0x31')](_0x16ad('0x34')),controller[_0x16ad('0x35')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x1f054a,_0x58cb35,_0x106576){_0x106576(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x32574f,_0x49381b,_0x32ead5){_0x32ead5(null,util[_0x16ad('0x2d')]('%s-%s',Date['now'](),_0x49381b[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x15'),upload['single'](_0x16ad('0x34')),controller[_0x16ad('0x36')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x10d0d1,_0x3937b5,_0xb70e18){_0xb70e18(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x33')));},'filename':function(_0x587a48,_0x13fac5,_0x4edfd8){_0x4edfd8(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0x13fac5[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x17'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x37')]);router[_0x16ad('0x25')]('/:id/notify',controller[_0x16ad('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x53e19e,_0x23db80,_0xc7a05){const _0x1eea5e=path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x39'),_0x16ad('0x3a'),_0x16ad('0x3b'));fs_extra[_0x16ad('0x3c')](_0x1eea5e,function(){_0xc7a05(null,_0x1eea5e);});},'filename':function(_0x11b655,_0x3e9325,_0x16336b){const _0x379e1d=_0x3e9325['originalname'][_0x16ad('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5043ca=path['extname'](_0x379e1d);const _0xec53aa=Date[_0x16ad('0x2f')]()+'-'+_0x379e1d['replace'](_0x5043ca,'')+_0x5043ca;_0x16336b(null,_0xec53aa);}})});router[_0x16ad('0x25')](_0x16ad('0x3e'),offlineUploadMulter['any'](),controller[_0x16ad('0x3f')]);router['post'](_0x16ad('0x18'),auth[_0x16ad('0xe')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x40')]);router['post']('/:id/proactive_actions',auth[_0x16ad('0xe')](),controller[_0x16ad('0x41')]);router[_0x16ad('0x25')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x42')]);router['put'](_0x16ad('0x43'),auth['isAuthenticated'](),controller[_0x16ad('0x44')]);router[_0x16ad('0x45')](_0x16ad('0x43'),auth[_0x16ad('0xe')](),controller['destroy']);router[_0x16ad('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x16ad('0x46')]);router[_0x16ad('0x45')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x47')]);router[_0x16ad('0x45')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller['removeAgents']);module[_0x16ad('0x48')]=router; \ No newline at end of file +var _0x10c4=['describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','single','addLogo','server/files/images/avatars/','format','file','originalname','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','Router','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x10c4,0x151));var _0x410c=function(_0x3f599f,_0x35de4d){_0x3f599f=_0x3f599f-0x0;var _0x11ee81=_0x10c4[_0x3f599f];return _0x11ee81;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x410c('0x0'));var timeout=require(_0x410c('0x1'));var express=require('express');var router=express[_0x410c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x410c('0x3'));var controller=require(_0x410c('0x4'));router[_0x410c('0x5')]('/',auth['isAuthenticated'](),controller[_0x410c('0x6')]);router[_0x410c('0x5')]('/describe',auth[_0x410c('0x7')](),controller[_0x410c('0x8')]);router['get']('/:id',auth[_0x410c('0x7')](),controller[_0x410c('0x9')]);router[_0x410c('0x5')](_0x410c('0xa'),auth[_0x410c('0x7')](),controller[_0x410c('0xb')]);router[_0x410c('0x5')](_0x410c('0xc'),auth[_0x410c('0x7')](),controller['getAnswers']);router[_0x410c('0x5')](_0x410c('0xd'),controller[_0x410c('0xe')]);router[_0x410c('0x5')](_0x410c('0xf'),controller['getAvatar']);router['get'](_0x410c('0x10'),controller[_0x410c('0x11')]);router[_0x410c('0x5')](_0x410c('0x12'),controller[_0x410c('0x13')]);router[_0x410c('0x5')](_0x410c('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x410c('0x15'),controller[_0x410c('0x16')]);router[_0x410c('0x5')](_0x410c('0x17'),auth[_0x410c('0x7')](),controller[_0x410c('0x18')]);router[_0x410c('0x5')]('/:id/proactive_actions',auth[_0x410c('0x7')](),controller[_0x410c('0x19')]);router[_0x410c('0x5')](_0x410c('0x1a'),controller[_0x410c('0x1b')]);router[_0x410c('0x5')](_0x410c('0x1c'),auth[_0x410c('0x7')](),controller[_0x410c('0x1d')]);router[_0x410c('0x5')](_0x410c('0x1e'),auth[_0x410c('0x7')](),controller[_0x410c('0x1f')]);router[_0x410c('0x20')]('/',auth[_0x410c('0x7')](),controller[_0x410c('0x21')]);router[_0x410c('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x410c('0x22')]);router[_0x410c('0x20')](_0x410c('0xc'),auth[_0x410c('0x7')](),controller[_0x410c('0x23')]);var upload=multer({'storage':multer[_0x410c('0x24')]({'destination':function(_0x41d0f3,_0xe65023,_0x36db0d){_0x36db0d(null,path[_0x410c('0x25')](config[_0x410c('0x26')],_0x410c('0x27')));},'filename':function(_0x126225,_0x7b893a,_0x4711f4){_0x4711f4(null,util['format'](_0x410c('0x28'),Date[_0x410c('0x29')](),_0x7b893a['originalname']));}})});router[_0x410c('0x20')](_0x410c('0xd'),upload[_0x410c('0x2a')]('file'),controller[_0x410c('0x2b')]);var upload=multer({'storage':multer[_0x410c('0x24')]({'destination':function(_0x1bd42e,_0x30dc59,_0x5cb5b7){_0x5cb5b7(null,path[_0x410c('0x25')](config[_0x410c('0x26')],_0x410c('0x2c')));},'filename':function(_0x4f9d60,_0x531d73,_0x4a081b){_0x4a081b(null,util[_0x410c('0x2d')]('%s-%s',Date['now'](),_0x531d73['originalname']));}})});router[_0x410c('0x20')](_0x410c('0xf'),upload['single'](_0x410c('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e244d,_0x2c3b68,_0x804df0){_0x804df0(null,path[_0x410c('0x25')](config[_0x410c('0x26')],_0x410c('0x2c')));},'filename':function(_0x3ac0f0,_0x4e32b3,_0x28e610){_0x28e610(null,util['format'](_0x410c('0x28'),Date['now'](),_0x4e32b3[_0x410c('0x2f')]));}})});router[_0x410c('0x20')](_0x410c('0x10'),upload[_0x410c('0x2a')](_0x410c('0x2e')),controller[_0x410c('0x30')]);var upload=multer({'storage':multer[_0x410c('0x24')]({'destination':function(_0x1b5de1,_0x37aae6,_0x529379){_0x529379(null,path[_0x410c('0x25')](config['root'],_0x410c('0x2c')));},'filename':function(_0x5815df,_0x1c1001,_0x383661){_0x383661(null,util[_0x410c('0x2d')](_0x410c('0x28'),Date[_0x410c('0x29')](),_0x1c1001[_0x410c('0x2f')]));}})});router[_0x410c('0x20')](_0x410c('0x12'),upload[_0x410c('0x2a')](_0x410c('0x2e')),controller[_0x410c('0x31')]);router[_0x410c('0x20')]('/:id/notify',controller[_0x410c('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x410c('0x24')]({'destination':function(_0x5c8854,_0x85f137,_0xad124d){const _0xcc5401=path[_0x410c('0x25')](config['root'],_0x410c('0x33'),_0x410c('0x34'),_0x410c('0x35'));fs_extra[_0x410c('0x36')](_0xcc5401,function(){_0xad124d(null,_0xcc5401);});},'filename':function(_0x3df899,_0x7e6e23,_0x208527){const _0x120097=_0x7e6e23[_0x410c('0x2f')][_0x410c('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2d17ae=path['extname'](_0x120097);const _0x9b3a45=Date[_0x410c('0x29')]()+'-'+_0x120097['replace'](_0x2d17ae,'')+_0x2d17ae;_0x208527(null,_0x9b3a45);}})});router[_0x410c('0x20')](_0x410c('0x38'),offlineUploadMulter[_0x410c('0x39')](),controller[_0x410c('0x3a')]);router[_0x410c('0x20')]('/:id/interactions',auth[_0x410c('0x7')](),controller['addInteraction']);router[_0x410c('0x20')](_0x410c('0x17'),auth[_0x410c('0x7')](),controller['addApplications']);router[_0x410c('0x20')](_0x410c('0x3b'),auth['isAuthenticated'](),controller[_0x410c('0x3c')]);router[_0x410c('0x20')](_0x410c('0x1e'),auth[_0x410c('0x7')](),controller[_0x410c('0x3d')]);router[_0x410c('0x3e')](_0x410c('0x3f'),auth['isAuthenticated'](),controller['update']);router[_0x410c('0x40')](_0x410c('0x3f'),auth[_0x410c('0x7')](),controller[_0x410c('0x41')]);router[_0x410c('0x40')](_0x410c('0xa'),auth[_0x410c('0x7')](),controller[_0x410c('0x42')]);router['delete'](_0x410c('0xc'),auth[_0x410c('0x7')](),controller[_0x410c('0x43')]);router['delete']('/:id/users',auth[_0x410c('0x7')](),controller[_0x410c('0x44')]);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 c77850f..57757a5 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 _0xafda=['get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','app'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xafda,0xb0));var _0xaafd=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xafda[_0xcf4569];return _0x7fef;};var beaverLogger=require(_0xaafd('0x0'));var express=require('express');var auth=require(_0xaafd('0x1'));var config=require('../config/environment');var router=express[_0xaafd('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1baef7,_0x276110,_0x14a3eb){var _0x2873ef=_0x1baef7[_0xaafd('0x3')][_0xaafd('0x4')](_0xaafd('0x5'));if(!_0x2873ef){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xaafd('0x6')]({'uri':'/client-logs','logger':_0x2873ef,'enableCors':!isProduction})(_0x1baef7,_0x276110,_0x14a3eb);}router[_0xaafd('0x7')](auth[_0xaafd('0x8')](),clientSideLogs);module[_0xaafd('0x9')]=router; \ No newline at end of file +var _0x4c87=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','/client-logs','use'];(function(_0x4722a2,_0x4dbc04){var _0x61a7f2=function(_0x57d777){while(--_0x57d777){_0x4722a2['push'](_0x4722a2['shift']());}};_0x61a7f2(++_0x4dbc04);}(_0x4c87,0x16e));var _0x74c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4c87[_0x122ef9];return _0x42fba0;};var beaverLogger=require(_0x74c8('0x0'));var express=require(_0x74c8('0x1'));var auth=require(_0x74c8('0x2'));var config=require(_0x74c8('0x3'));var router=express[_0x74c8('0x4')]();var isProduction=config[_0x74c8('0x5')]===_0x74c8('0x6')||![];function clientSideLogs(_0x5c31ac,_0x1fda2e,_0x4dba1b){var _0x203788=_0x5c31ac[_0x74c8('0x7')][_0x74c8('0x8')](_0x74c8('0x9'));if(!_0x203788){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x74c8('0xa'),'logger':_0x203788,'enableCors':!isProduction})(_0x5c31ac,_0x1fda2e,_0x4dba1b);}router[_0x74c8('0xb')](auth[_0x74c8('0xc')](),clientSideLogs);module[_0x74c8('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 9bbf749..62c01fd 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 _0xbecd=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xbecd,0x189));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xdbec('0x0'));module[_0xdbec('0x1')]={'name':{'type':Sequelize[_0xdbec('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdbec('0x3')](_0xdbec('0x4'),_0xdbec('0x5'),_0xdbec('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdbec('0x3')]('Outlook365',_0xdbec('0x7'))},'data1':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xdbec('0x8')},'data4':{'type':Sequelize[_0xdbec('0x2')],'comment':_0xdbec('0x9')},'data5':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0xdbec('0xc')},'data7':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xd')}}; \ No newline at end of file +var _0x5e4a=['STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x32e7ce,_0x2a745a){var _0x5cbb80=function(_0x17b6e3){while(--_0x17b6e3){_0x32e7ce['push'](_0x32e7ce['shift']());}};_0x5cbb80(++_0x2a745a);}(_0x5e4a,0x67));var _0xa5e4=function(_0x7a97f3,_0x48b9eb){_0x7a97f3=_0x7a97f3-0x0;var _0x59ebfd=_0x5e4a[_0x7a97f3];return _0x59ebfd;};'use strict';var Sequelize=require('sequelize');module[_0xa5e4('0x0')]={'name':{'type':Sequelize[_0xa5e4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa5e4('0x2')](_0xa5e4('0x3'),_0xa5e4('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa5e4('0x2')](_0xa5e4('0x5'),_0xa5e4('0x6'))},'data1':{'type':Sequelize[_0xa5e4('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xa5e4('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xa5e4('0x1')],'comment':_0xa5e4('0x7')},'data4':{'type':Sequelize[_0xa5e4('0x1')],'comment':_0xa5e4('0x8')},'data5':{'type':Sequelize[_0xa5e4('0x9')],'comment':_0xa5e4('0xa')},'data6':{'type':Sequelize[_0xa5e4('0x9')],'comment':_0xa5e4('0xb')},'data7':{'type':Sequelize[_0xa5e4('0x9')],'comment':_0xa5e4('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 0339688..24e3319 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 _0x01c6=['user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','CloudProvider','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','encryptString','create','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x01c6,0x1f1));var _0x601c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x01c6[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x601c('0x0'));var Redis=require(_0x601c('0x1'));var qs=require(_0x601c('0x2'));var encryptor=require(_0x601c('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0x601c('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x601c('0x5')]=_[_0x601c('0x6')](config[_0x601c('0x5')],{'host':_0x601c('0x7'),'port':0x18eb});var socket=require(_0x601c('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x601c('0x5')]);function respondWithStatusCode(_0x2fdafc,_0x25ce77){_0x25ce77=_0x25ce77||0xcc;return function(_0x4ca925){if(_0x4ca925){return _0x2fdafc[_0x601c('0x9')](_0x25ce77);}return _0x2fdafc[_0x601c('0xa')](_0x25ce77)[_0x601c('0xb')]();};}function respondWithResult(_0x21d59b,_0xdcc448){_0xdcc448=_0xdcc448||0xc8;return function(_0x2a2eca){if(_0x2a2eca){return _0x21d59b['status'](_0xdcc448)['json'](_0x2a2eca);}};}function respondWithFilteredResult(_0x146961,_0x3f6ca8){return function(_0x3f2335){if(_0x3f2335){var _0x65b796=typeof _0x3f6ca8[_0x601c('0xc')]===_0x601c('0xd')&&typeof _0x3f6ca8[_0x601c('0xe')]===_0x601c('0xd');var _0xf3e47d=_0x3f2335[_0x601c('0xf')];var _0xfb350c=_0x65b796?0x0:_0x3f6ca8[_0x601c('0xc')];var _0x139c81=_0x65b796?_0x3f2335['count']:_0x3f6ca8[_0x601c('0xc')]+_0x3f6ca8[_0x601c('0xe')];var _0x4e4e46;if(_0x139c81>=_0xf3e47d){_0x139c81=_0xf3e47d;_0x4e4e46=0xc8;}else{_0x4e4e46=0xce;}_0x146961[_0x601c('0xa')](_0x4e4e46);return _0x146961[_0x601c('0x10')]('Content-Range',_0xfb350c+'-'+_0x139c81+'/'+_0xf3e47d)[_0x601c('0x11')](_0x3f2335);}return null;};}function saveUpdates(_0x42cc21){return function(_0x507b47){if(_0x507b47){return _0x507b47[_0x601c('0x12')](_0x42cc21)[_0x601c('0x13')](function(_0x3a32c8){return _0x3a32c8;});}return null;};}function removeEntity(_0x326dfb){return function(_0x49a356){if(_0x49a356){return _0x49a356['destroy']()[_0x601c('0x13')](function(){_0x326dfb['status'](0xcc)[_0x601c('0xb')]();});}};}function handleEntityNotFound(_0x424eff){return function(_0x151eca){if(!_0x151eca){_0x424eff[_0x601c('0x9')](0x194);}return _0x151eca;};}function handleError(_0xd22a37,_0x2edb6d){_0x2edb6d=_0x2edb6d||0x1f4;return function(_0x4721f3){logger[_0x601c('0x14')](_0x4721f3[_0x601c('0x15')]);if(_0x4721f3[_0x601c('0x16')]){delete _0x4721f3[_0x601c('0x16')];}_0xd22a37[_0x601c('0xa')](_0x2edb6d)[_0x601c('0x17')](_0x4721f3);};}function maskClientSecret(_0x20c8c0){return _['padEnd'](_0x20c8c0['slice'](0x0,0x3),0x14,'*');}exports[_0x601c('0x18')]=function(_0x55a0c2,_0x5b9451){var _0x3bc9df={},_0xc456ee={},_0x34b54b={'count':0x0,'rows':[]};var _0x13f136=_[_0x601c('0x19')](db['CloudProvider'][_0x601c('0x1a')],function(_0x3c471c){return{'name':_0x3c471c[_0x601c('0x1b')],'type':_0x3c471c['type']['key']};});_0xc456ee[_0x601c('0x1c')]=_[_0x601c('0x19')](_0x13f136,_0x601c('0x16'));_0xc456ee[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x55a0c2[_0x601c('0x1d')]);_0xc456ee[_0x601c('0x1f')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],_0xc456ee[_0x601c('0x1d')]);_0x3bc9df[_0x601c('0x21')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],qs[_0x601c('0x22')](_0x55a0c2[_0x601c('0x1d')]['fields']));_0x3bc9df[_0x601c('0x21')]=_0x3bc9df[_0x601c('0x21')]['length']?_0x3bc9df['attributes']:_0xc456ee[_0x601c('0x1c')];if(!_0x55a0c2['query'][_0x601c('0x23')](_0x601c('0x24'))){_0x3bc9df['limit']=qs['limit'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xe')]);_0x3bc9df[_0x601c('0xc')]=qs['offset'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xc')]);}_0x3bc9df[_0x601c('0x25')]=qs['sort'](_0x55a0c2['query'][_0x601c('0x26')]);_0x3bc9df[_0x601c('0x27')]=qs[_0x601c('0x1f')](_[_0x601c('0x28')](_0x55a0c2[_0x601c('0x1d')],_0xc456ee[_0x601c('0x1f')]),_0x13f136);if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]){_0x3bc9df['where']=_[_0x601c('0x2a')](_0x3bc9df['where'],{'$or':_[_0x601c('0x19')](_0x13f136,function(_0x3fb16a){if(_0x3fb16a[_0x601c('0x2b')]!=='VIRTUAL'){var _0x1740c7={};_0x1740c7[_0x3fb16a[_0x601c('0x16')]]={'$like':'%'+_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]+'%'};return _0x1740c7;}})});}_0x3bc9df=_[_0x601c('0x2a')]({},_0x3bc9df,_0x55a0c2[_0x601c('0x2c')]);var _0x2fd9d7={'where':_0x3bc9df[_0x601c('0x27')]};return db['CloudProvider']['count'](_0x2fd9d7)[_0x601c('0x13')](function(_0x209013){_0x34b54b['count']=_0x209013;if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x2d')]){_0x3bc9df['include']=[{'all':!![]}];}return db['CloudProvider'][_0x601c('0x2e')](_0x3bc9df);})[_0x601c('0x13')](function(_0xd08749){_0x34b54b[_0x601c('0x2f')]=_['map'](_0xd08749,function(_0x17f8d0){if(_0x17f8d0[_0x601c('0x30')]===_0x601c('0x31')){var _0x2f84f3=encryptor[_0x601c('0x32')](_0x17f8d0[_0x601c('0x33')]);_0x17f8d0[_0x601c('0x33')]=maskClientSecret(_0x2f84f3);}return _0x17f8d0;});return _0x34b54b;})[_0x601c('0x13')](respondWithFilteredResult(_0x5b9451,_0x3bc9df))[_0x601c('0x34')](handleError(_0x5b9451,null));};exports[_0x601c('0x35')]=function(_0x3d6506,_0x39815b){var _0x4d8af6={'raw':!![],'where':{'id':_0x3d6506['params']['id']}},_0x4e4311={};_0x4e4311[_0x601c('0x1c')]=_[_0x601c('0x1e')](db[_0x601c('0x36')][_0x601c('0x1a')]);_0x4e4311[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x3d6506['query']);_0x4e4311[_0x601c('0x1f')]=_[_0x601c('0x20')](_0x4e4311[_0x601c('0x1c')],_0x4e4311[_0x601c('0x1d')]);_0x4d8af6[_0x601c('0x21')]=_[_0x601c('0x20')](_0x4e4311['model'],qs[_0x601c('0x22')](_0x3d6506[_0x601c('0x1d')][_0x601c('0x22')]));_0x4d8af6[_0x601c('0x21')]=_0x4d8af6[_0x601c('0x21')]['length']?_0x4d8af6[_0x601c('0x21')]:_0x4e4311[_0x601c('0x1c')];if(_0x3d6506[_0x601c('0x1d')][_0x601c('0x2d')]){_0x4d8af6[_0x601c('0x37')]=[{'all':!![]}];}_0x4d8af6=_[_0x601c('0x2a')]({},_0x4d8af6,_0x3d6506['options']);return db[_0x601c('0x36')][_0x601c('0x38')](_0x4d8af6)[_0x601c('0x13')](handleEntityNotFound(_0x39815b,null))[_0x601c('0x13')](function(_0x438f55){if(_0x438f55[_0x601c('0x30')]===_0x601c('0x31')){var _0x2a17e2=encryptor['decryptString'](_0x438f55[_0x601c('0x33')]);_0x438f55[_0x601c('0x33')]=maskClientSecret(_0x2a17e2);}return _0x438f55;})[_0x601c('0x13')](respondWithResult(_0x39815b,null))[_0x601c('0x34')](handleError(_0x39815b,null));};exports['create']=function(_0x16915e,_0x1337a4){if(!_0x16915e[_0x601c('0x39')][_0x601c('0x16')])throw new Error(_0x601c('0x3a'));if(!_0x16915e[_0x601c('0x39')][_0x601c('0x30')])throw new Error(_0x601c('0x3b'));var _0x56fcc7=db[_0x601c('0x36')][_0x601c('0x1a')]['service']['values'];if(!_0x56fcc7['includes'](_0x16915e[_0x601c('0x39')][_0x601c('0x30')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x56fcc7['join'](',\x20'));if(_0x16915e[_0x601c('0x39')][_0x601c('0x30')]==='MicrosoftAzure'&&_0x16915e[_0x601c('0x39')]['data3']){_0x16915e[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x16915e[_0x601c('0x39')]['data3']);}return db[_0x601c('0x36')][_0x601c('0x3d')](_0x16915e[_0x601c('0x39')],{})['then'](respondWithResult(_0x1337a4,0xc9))[_0x601c('0x34')](handleError(_0x1337a4,null));};exports[_0x601c('0x12')]=function(_0x3d0c66,_0x2db8b6){if(_0x3d0c66['body']['id']){delete _0x3d0c66[_0x601c('0x39')]['id'];}return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x3d0c66[_0x601c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2db8b6,null))[_0x601c('0x13')](function(_0x47476b){if(_0x47476b[_0x601c('0x30')]===_0x601c('0x31')&&_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]){_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]);}return _0x47476b;})[_0x601c('0x13')](saveUpdates(_0x3d0c66[_0x601c('0x39')],null))[_0x601c('0x13')](respondWithResult(_0x2db8b6,null))[_0x601c('0x34')](handleError(_0x2db8b6,null));};exports[_0x601c('0x3f')]=function(_0x2670a3,_0x33eb98){return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x2670a3[_0x601c('0x3e')]['id']}})[_0x601c('0x13')](handleEntityNotFound(_0x33eb98,null))['then'](removeEntity(_0x33eb98,null))[_0x601c('0x34')](handleError(_0x33eb98,null));};exports[_0x601c('0x40')]=function(_0x3152d3,_0x5acaf9){return db['CloudProvider'][_0x601c('0x41')]({'where':{'id':_0x3152d3['params']['id']},'raw':!![]})[_0x601c('0x13')](function(_0x5cef5c){if(!_0x5cef5c)return _0x5acaf9[_0x601c('0x9')](0x194);return{'url':oauth[_0x601c('0x42')](_0x5cef5c,_0x3152d3[_0x601c('0x43')]['id'])};})[_0x601c('0x13')](respondWithResult(_0x5acaf9,null))[_0x601c('0x34')](handleError(_0x5acaf9,null));};exports[_0x601c('0x44')]=function(_0x3341dd,_0x59fe04){var _0x57f27a=_0x3341dd['body'];var _0x5d0433;var _0x718ada;if(_0x57f27a[_0x601c('0x14')])throw _0x57f27a;redis[_0x601c('0x45')](_0x57f27a[_0x601c('0x46')])['then'](function(_0x30b578){if(!_0x30b578)throw new Error(_0x601c('0x47'));_0x5d0433=JSON[_0x601c('0x48')](_0x30b578);var _0x449171=Buffer[_0x601c('0x49')](_0x57f27a[_0x601c('0x46')],_0x601c('0x4a'))[_0x601c('0x4b')](_0x601c('0x4c'));_0x718ada=JSON[_0x601c('0x48')](_0x449171);if(!oauth['isValidIdToken'](_0x57f27a[_0x601c('0x4d')],_0x5d0433[_0x601c('0x4e')]))throw new Error(_0x601c('0x4f'));redis[_0x601c('0x50')](_0x57f27a[_0x601c('0x46')]);return oauth[_0x601c('0x51')](_0x57f27a['code'],_0x5d0433);})[_0x601c('0x13')](function(_0x286aa2){_0x5d0433[_0x601c('0x52')]=_0x286aa2[_0x601c('0x53')];_0x5d0433['data6']=_0x286aa2[_0x601c('0x54')];return db[_0x601c('0x36')][_0x601c('0x12')]({'data5':_0x5d0433[_0x601c('0x52')],'data6':_0x5d0433[_0x601c('0x55')]},{'where':{'id':_0x5d0433['id']}});})[_0x601c('0x13')](function(){oauth[_0x601c('0x56')](_0x5d0433);socket[_0x601c('0x57')](_0x601c('0x58'),{'id':_0x718ada['id']});return;})[_0x601c('0x13')](respondWithStatusCode(_0x59fe04,null))[_0x601c('0x34')](function(_0x576b29){if(_0x718ada){socket['emit'](_0x601c('0x59'),{'id':_0x718ada['id']});}if(!_0x5d0433){logger[_0x601c('0x14')](_0x601c('0x5a'),_0x576b29);return _0x59fe04[_0x601c('0xa')](0x1f4)[_0x601c('0x17')](_0x576b29[_0x601c('0x5b')]);}logger[_0x601c('0x14')](_0x601c('0x5c'),_0x5d0433['id'],JSON[_0x601c('0x5d')](_0x576b29));});}; \ No newline at end of file +var _0x1dfc=['then','error','name','send','padEnd','slice','index','CloudProvider','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','map','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0x1dfc,0xaa));var _0xc1df=function(_0x3c7988,_0x112ac3){_0x3c7988=_0x3c7988-0x0;var _0x416dda=_0x1dfc[_0x3c7988];return _0x416dda;};'use strict';var _=require(_0xc1df('0x0'));var Redis=require(_0xc1df('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc1df('0x2'));var config=require(_0xc1df('0x3'));var logger=require(_0xc1df('0x4'))(_0xc1df('0x5'));var db=require(_0xc1df('0x6'))['db'];var oauth=require(_0xc1df('0x7'));config[_0xc1df('0x8')]=_[_0xc1df('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc1df('0xa'))(new Redis(config[_0xc1df('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xf5b4d7,_0x7b6fb5){_0x7b6fb5=_0x7b6fb5||0xcc;return function(_0x2ae5e7){if(_0x2ae5e7){return _0xf5b4d7[_0xc1df('0xb')](_0x7b6fb5);}return _0xf5b4d7[_0xc1df('0xc')](_0x7b6fb5)[_0xc1df('0xd')]();};}function respondWithResult(_0x2e210a,_0xe0ff27){_0xe0ff27=_0xe0ff27||0xc8;return function(_0x30ba50){if(_0x30ba50){return _0x2e210a['status'](_0xe0ff27)[_0xc1df('0xe')](_0x30ba50);}};}function respondWithFilteredResult(_0x6e475a,_0x3bc4ed){return function(_0x13ee97){if(_0x13ee97){var _0x19b428=typeof _0x3bc4ed[_0xc1df('0xf')]==='undefined'&&typeof _0x3bc4ed[_0xc1df('0x10')]==='undefined';var _0x3692e5=_0x13ee97[_0xc1df('0x11')];var _0x1ecf1c=_0x19b428?0x0:_0x3bc4ed[_0xc1df('0xf')];var _0x5ad04d=_0x19b428?_0x13ee97['count']:_0x3bc4ed['offset']+_0x3bc4ed[_0xc1df('0x10')];var _0xaf758d;if(_0x5ad04d>=_0x3692e5){_0x5ad04d=_0x3692e5;_0xaf758d=0xc8;}else{_0xaf758d=0xce;}_0x6e475a['status'](_0xaf758d);return _0x6e475a[_0xc1df('0x12')](_0xc1df('0x13'),_0x1ecf1c+'-'+_0x5ad04d+'/'+_0x3692e5)['json'](_0x13ee97);}return null;};}function saveUpdates(_0x3ff4e0){return function(_0x2efde3){if(_0x2efde3){return _0x2efde3[_0xc1df('0x14')](_0x3ff4e0)['then'](function(_0x1e2481){return _0x1e2481;});}return null;};}function removeEntity(_0x286d41){return function(_0x108b5e){if(_0x108b5e){return _0x108b5e[_0xc1df('0x15')]()[_0xc1df('0x16')](function(){_0x286d41[_0xc1df('0xc')](0xcc)[_0xc1df('0xd')]();});}};}function handleEntityNotFound(_0x4f71b3){return function(_0x4be721){if(!_0x4be721){_0x4f71b3[_0xc1df('0xb')](0x194);}return _0x4be721;};}function handleError(_0x472df9,_0x751b27){_0x751b27=_0x751b27||0x1f4;return function(_0x2e1a8f){logger[_0xc1df('0x17')](_0x2e1a8f['stack']);if(_0x2e1a8f[_0xc1df('0x18')]){delete _0x2e1a8f[_0xc1df('0x18')];}_0x472df9['status'](_0x751b27)[_0xc1df('0x19')](_0x2e1a8f);};}function maskClientSecret(_0x30fedf){return _[_0xc1df('0x1a')](_0x30fedf[_0xc1df('0x1b')](0x0,0x3),0x14,'*');}exports[_0xc1df('0x1c')]=function(_0x289437,_0x380c40){var _0x5f2cdf={},_0x1c56bd={},_0x3535df={'count':0x0,'rows':[]};var _0x17ed0a=_['map'](db[_0xc1df('0x1d')]['rawAttributes'],function(_0x4fee0c){return{'name':_0x4fee0c[_0xc1df('0x1e')],'type':_0x4fee0c['type']['key']};});_0x1c56bd[_0xc1df('0x1f')]=_['map'](_0x17ed0a,_0xc1df('0x18'));_0x1c56bd['query']=_[_0xc1df('0x20')](_0x289437[_0xc1df('0x21')]);_0x1c56bd[_0xc1df('0x22')]=_[_0xc1df('0x23')](_0x1c56bd[_0xc1df('0x1f')],_0x1c56bd[_0xc1df('0x21')]);_0x5f2cdf[_0xc1df('0x24')]=_[_0xc1df('0x23')](_0x1c56bd[_0xc1df('0x1f')],qs[_0xc1df('0x25')](_0x289437[_0xc1df('0x21')][_0xc1df('0x25')]));_0x5f2cdf[_0xc1df('0x24')]=_0x5f2cdf[_0xc1df('0x24')][_0xc1df('0x26')]?_0x5f2cdf[_0xc1df('0x24')]:_0x1c56bd['model'];if(!_0x289437[_0xc1df('0x21')][_0xc1df('0x27')](_0xc1df('0x28'))){_0x5f2cdf[_0xc1df('0x10')]=qs[_0xc1df('0x10')](_0x289437['query']['limit']);_0x5f2cdf[_0xc1df('0xf')]=qs[_0xc1df('0xf')](_0x289437['query']['offset']);}_0x5f2cdf[_0xc1df('0x29')]=qs['sort'](_0x289437[_0xc1df('0x21')][_0xc1df('0x2a')]);_0x5f2cdf[_0xc1df('0x2b')]=qs[_0xc1df('0x22')](_[_0xc1df('0x2c')](_0x289437[_0xc1df('0x21')],_0x1c56bd[_0xc1df('0x22')]),_0x17ed0a);if(_0x289437['query']['filter']){_0x5f2cdf[_0xc1df('0x2b')]=_[_0xc1df('0x2d')](_0x5f2cdf[_0xc1df('0x2b')],{'$or':_['map'](_0x17ed0a,function(_0xdcb2c7){if(_0xdcb2c7[_0xc1df('0x2e')]!==_0xc1df('0x2f')){var _0x2040b5={};_0x2040b5[_0xdcb2c7['name']]={'$like':'%'+_0x289437[_0xc1df('0x21')][_0xc1df('0x30')]+'%'};return _0x2040b5;}})});}_0x5f2cdf=_[_0xc1df('0x2d')]({},_0x5f2cdf,_0x289437[_0xc1df('0x31')]);var _0x267434={'where':_0x5f2cdf[_0xc1df('0x2b')]};return db[_0xc1df('0x1d')][_0xc1df('0x11')](_0x267434)[_0xc1df('0x16')](function(_0x28fccc){_0x3535df[_0xc1df('0x11')]=_0x28fccc;if(_0x289437[_0xc1df('0x21')][_0xc1df('0x32')]){_0x5f2cdf[_0xc1df('0x33')]=[{'all':!![]}];}return db[_0xc1df('0x1d')][_0xc1df('0x34')](_0x5f2cdf);})['then'](function(_0x4cddb0){_0x3535df[_0xc1df('0x35')]=_[_0xc1df('0x36')](_0x4cddb0,function(_0x1f9be9){if(_0x1f9be9['service']===_0xc1df('0x37')){var _0x4474f6=encryptor[_0xc1df('0x38')](_0x1f9be9[_0xc1df('0x39')]);_0x1f9be9[_0xc1df('0x39')]=maskClientSecret(_0x4474f6);}return _0x1f9be9;});return _0x3535df;})['then'](respondWithFilteredResult(_0x380c40,_0x5f2cdf))[_0xc1df('0x3a')](handleError(_0x380c40,null));};exports[_0xc1df('0x3b')]=function(_0x28f3d6,_0x4e62e2){var _0x58143a={'raw':!![],'where':{'id':_0x28f3d6[_0xc1df('0x3c')]['id']}},_0x51c1ca={};_0x51c1ca[_0xc1df('0x1f')]=_[_0xc1df('0x20')](db[_0xc1df('0x1d')][_0xc1df('0x3d')]);_0x51c1ca[_0xc1df('0x21')]=_['keys'](_0x28f3d6[_0xc1df('0x21')]);_0x51c1ca[_0xc1df('0x22')]=_[_0xc1df('0x23')](_0x51c1ca[_0xc1df('0x1f')],_0x51c1ca[_0xc1df('0x21')]);_0x58143a[_0xc1df('0x24')]=_['intersection'](_0x51c1ca[_0xc1df('0x1f')],qs[_0xc1df('0x25')](_0x28f3d6[_0xc1df('0x21')]['fields']));_0x58143a[_0xc1df('0x24')]=_0x58143a[_0xc1df('0x24')][_0xc1df('0x26')]?_0x58143a[_0xc1df('0x24')]:_0x51c1ca[_0xc1df('0x1f')];if(_0x28f3d6[_0xc1df('0x21')]['includeAll']){_0x58143a[_0xc1df('0x33')]=[{'all':!![]}];}_0x58143a=_['merge']({},_0x58143a,_0x28f3d6[_0xc1df('0x31')]);return db[_0xc1df('0x1d')][_0xc1df('0x3e')](_0x58143a)['then'](handleEntityNotFound(_0x4e62e2,null))[_0xc1df('0x16')](function(_0x353a89){if(_0x353a89[_0xc1df('0x3f')]===_0xc1df('0x37')){var _0x26102e=encryptor[_0xc1df('0x38')](_0x353a89[_0xc1df('0x39')]);_0x353a89[_0xc1df('0x39')]=maskClientSecret(_0x26102e);}return _0x353a89;})[_0xc1df('0x16')](respondWithResult(_0x4e62e2,null))[_0xc1df('0x3a')](handleError(_0x4e62e2,null));};exports[_0xc1df('0x40')]=function(_0x2b619f,_0x5eb1df){if(!_0x2b619f[_0xc1df('0x41')][_0xc1df('0x18')])throw new Error(_0xc1df('0x42'));if(!_0x2b619f[_0xc1df('0x41')][_0xc1df('0x3f')])throw new Error(_0xc1df('0x43'));var _0x2503b2=db[_0xc1df('0x1d')]['rawAttributes'][_0xc1df('0x3f')]['values'];if(!_0x2503b2[_0xc1df('0x44')](_0x2b619f[_0xc1df('0x41')]['service']))throw new Error(_0xc1df('0x45')+_0x2503b2[_0xc1df('0x46')](',\x20'));if(_0x2b619f['body'][_0xc1df('0x3f')]===_0xc1df('0x37')&&_0x2b619f[_0xc1df('0x41')][_0xc1df('0x39')]){_0x2b619f['body']['data3']=encryptor['encryptString'](_0x2b619f[_0xc1df('0x41')][_0xc1df('0x39')]);}return db['CloudProvider'][_0xc1df('0x40')](_0x2b619f[_0xc1df('0x41')],{})[_0xc1df('0x16')](respondWithResult(_0x5eb1df,0xc9))[_0xc1df('0x3a')](handleError(_0x5eb1df,null));};exports[_0xc1df('0x14')]=function(_0x3c9158,_0x3cc334){if(_0x3c9158[_0xc1df('0x41')]['id']){delete _0x3c9158[_0xc1df('0x41')]['id'];}return db[_0xc1df('0x1d')][_0xc1df('0x3e')]({'where':{'id':_0x3c9158['params']['id']}})[_0xc1df('0x16')](handleEntityNotFound(_0x3cc334,null))[_0xc1df('0x16')](function(_0xc79a65){if(_0xc79a65['service']==='MicrosoftAzure'&&_0x3c9158['body']['data3']){_0x3c9158[_0xc1df('0x41')][_0xc1df('0x39')]=encryptor[_0xc1df('0x47')](_0x3c9158[_0xc1df('0x41')][_0xc1df('0x39')]);}return _0xc79a65;})['then'](saveUpdates(_0x3c9158['body'],null))[_0xc1df('0x16')](respondWithResult(_0x3cc334,null))[_0xc1df('0x3a')](handleError(_0x3cc334,null));};exports['destroy']=function(_0x2bad72,_0x3b9789){return db['CloudProvider'][_0xc1df('0x3e')]({'where':{'id':_0x2bad72['params']['id']}})[_0xc1df('0x16')](handleEntityNotFound(_0x3b9789,null))['then'](removeEntity(_0x3b9789,null))[_0xc1df('0x3a')](handleError(_0x3b9789,null));};exports[_0xc1df('0x48')]=function(_0xbfa9e6,_0x6dfd){return db[_0xc1df('0x1d')][_0xc1df('0x49')]({'where':{'id':_0xbfa9e6[_0xc1df('0x3c')]['id']},'raw':!![]})[_0xc1df('0x16')](function(_0x43c292){if(!_0x43c292)return _0x6dfd[_0xc1df('0xb')](0x194);return{'url':oauth[_0xc1df('0x4a')](_0x43c292,_0xbfa9e6[_0xc1df('0x4b')]['id'])};})[_0xc1df('0x16')](respondWithResult(_0x6dfd,null))['catch'](handleError(_0x6dfd,null));};exports[_0xc1df('0x4c')]=function(_0x408e9d,_0x274583){var _0x4e244c=_0x408e9d[_0xc1df('0x41')];var _0x43a4dc;var _0x35e827;if(_0x4e244c[_0xc1df('0x17')])throw _0x4e244c;redis[_0xc1df('0x4d')](_0x4e244c[_0xc1df('0x4e')])[_0xc1df('0x16')](function(_0xe0f36d){if(!_0xe0f36d)throw new Error('Invalid\x20state\x20parameter');_0x43a4dc=JSON[_0xc1df('0x4f')](_0xe0f36d);var _0x8edce7=Buffer['from'](_0x4e244c[_0xc1df('0x4e')],_0xc1df('0x50'))[_0xc1df('0x51')](_0xc1df('0x52'));_0x35e827=JSON[_0xc1df('0x4f')](_0x8edce7);if(!oauth[_0xc1df('0x53')](_0x4e244c[_0xc1df('0x54')],_0x43a4dc[_0xc1df('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x4e244c[_0xc1df('0x4e')]);return oauth[_0xc1df('0x56')](_0x4e244c[_0xc1df('0x57')],_0x43a4dc);})['then'](function(_0x461edc){_0x43a4dc[_0xc1df('0x58')]=_0x461edc['access_token'];_0x43a4dc[_0xc1df('0x59')]=_0x461edc[_0xc1df('0x5a')];return db[_0xc1df('0x1d')][_0xc1df('0x14')]({'data5':_0x43a4dc['data5'],'data6':_0x43a4dc[_0xc1df('0x59')]},{'where':{'id':_0x43a4dc['id']}});})['then'](function(){oauth[_0xc1df('0x5b')](_0x43a4dc);socket[_0xc1df('0x5c')](_0xc1df('0x5d'),{'id':_0x35e827['id']});return;})[_0xc1df('0x16')](respondWithStatusCode(_0x274583,null))[_0xc1df('0x3a')](function(_0x7957c7){if(_0x35e827){socket['emit']('microsoftAuthorization:error',{'id':_0x35e827['id']});}if(!_0x43a4dc){logger[_0xc1df('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x7957c7);return _0x274583[_0xc1df('0xc')](0x1f4)[_0xc1df('0x19')](_0x7957c7[_0xc1df('0x5e')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x43a4dc['id'],JSON[_0xc1df('0x5f')](_0x7957c7));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a3ada3c..53c8626 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 _0xb9af=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cloud_providers','lodash'];(function(_0x2ba022,_0x59cad3){var _0x2bc6ca=function(_0x4cc435){while(--_0x4cc435){_0x2ba022['push'](_0x2ba022['shift']());}};_0x2bc6ca(++_0x59cad3);}(_0xb9af,0xb5));var _0xfb9a=function(_0x5f41de,_0x1d3e30){_0x5f41de=_0x5f41de-0x0;var _0x12cbf7=_0xb9af[_0x5f41de];return _0x12cbf7;};'use strict';var _=require(_0xfb9a('0x0'));var util=require(_0xfb9a('0x1'));var logger=require(_0xfb9a('0x2'))(_0xfb9a('0x3'));var moment=require(_0xfb9a('0x4'));var BPromise=require(_0xfb9a('0x5'));var rp=require(_0xfb9a('0x6'));var fs=require('fs');var path=require(_0xfb9a('0x7'));var rimraf=require(_0xfb9a('0x8'));var config=require(_0xfb9a('0x9'));var attributes=require('./cloudProvider.attributes');module[_0xfb9a('0xa')]=function(_0x4c9e73,_0x38f2b2){return _0x4c9e73[_0xfb9a('0xb')]('CloudProvider',attributes,{'tableName':_0xfb9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x139b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util'];(function(_0x4633ee,_0xc061fe){var _0x5c5ac0=function(_0x29ef60){while(--_0x29ef60){_0x4633ee['push'](_0x4633ee['shift']());}};_0x5c5ac0(++_0xc061fe);}(_0x139b,0x1b8));var _0xb139=function(_0x117be9,_0x2fa72e){_0x117be9=_0x117be9-0x0;var _0xc43448=_0x139b[_0x117be9];return _0xc43448;};'use strict';var _=require(_0xb139('0x0'));var util=require(_0xb139('0x1'));var logger=require(_0xb139('0x2'))(_0xb139('0x3'));var moment=require(_0xb139('0x4'));var BPromise=require(_0xb139('0x5'));var rp=require(_0xb139('0x6'));var fs=require('fs');var path=require(_0xb139('0x7'));var rimraf=require('rimraf');var config=require(_0xb139('0x8'));var attributes=require(_0xb139('0x9'));module[_0xb139('0xa')]=function(_0x466c55,_0x54ba65){return _0x466c55['define'](_0xb139('0xb'),attributes,{'tableName':_0xb139('0xc'),'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 f745d1d..5067370 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 _0xc32d=['Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','client_id','data1','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','map','value','oauth2/','set','decode','payload','iss','audience','unix','exp','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','data5','access_token','error','authorization_code','intervals','bind','findAll','all','catch','inspect','exports','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','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/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join'];(function(_0x5b8255,_0x2b696f){var _0x4559c3=function(_0x384edb){while(--_0x384edb){_0x5b8255['push'](_0x5b8255['shift']());}};_0x4559c3(++_0x2b696f);}(_0xc32d,0x10d));var _0xdc32=function(_0x279d07,_0x13f4bd){_0x279d07=_0x279d07-0x0;var _0x13b943=_0xc32d[_0x279d07];return _0x13b943;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xdc32('0x0'));var moment=require('moment');var Redis=require(_0xdc32('0x1'));var rp=require(_0xdc32('0x2'));var util=require(_0xdc32('0x3'));var encryptor=require(_0xdc32('0x4'));var config=require(_0xdc32('0x5'));var logger=require(_0xdc32('0x6'))(_0xdc32('0x7'));var schedule=require(_0xdc32('0x8'));var db=require(_0xdc32('0x9'))['db'];config['redis']=_['defaults'](config[_0xdc32('0xa')],{'host':_0xdc32('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xdc32('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdc32('0xd'),_0xdc32('0xe'),_0xdc32('0xf'),_0xdc32('0x10'),_0xdc32('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xdc32('0x12')],'Dynamics365':[_0xdc32('0xd'),_0xdc32('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xdc32('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xdc32('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x360df4){var _0x56095c=_['map'](AZURE_AUTH_SCOPES[_0x360df4[_0xdc32('0x15')]]);if(_0x360df4[_0xdc32('0x15')]===_0xdc32('0x16'))_0x56095c[_0xdc32('0x17')](_0x360df4[_0xdc32('0x18')]+_0xdc32('0x19'));return _0x56095c[_0xdc32('0x1a')]('\x20');}function getAccessTokenScope(_0x194ccd){if(_0x194ccd[_0xdc32('0x15')]===_0xdc32('0x1b'))return _0xdc32('0x11');if(_0x194ccd[_0xdc32('0x15')]==='Dynamics365')return _0x194ccd['data7']+_0xdc32('0x19');}function generateMicrosoftAuthorizationUrl(_0x5d08bf,_0x48047d){var _0x7df838=MICROSOFT_AUTH_URL[_0xdc32('0x1c')](_0xdc32('0x1d'),_0x5d08bf[_0xdc32('0x1e')]);var _0x15f889=['code',_0xdc32('0x1f')];var _0x21bf17=Buffer[_0xdc32('0x20')](JSON[_0xdc32('0x21')]({'id':_0x48047d}))[_0xdc32('0x22')]('base64');var _0x11b5f7=crypto['randomBytes'](0x10)[_0xdc32('0x22')]('hex');var _0x1b4e23=getAuthorizationScopes(_0x5d08bf);var _0x28f060=[{'key':_0xdc32('0x23'),'value':_0x5d08bf[_0xdc32('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x15f889[_0xdc32('0x1a')]('\x20'))},{'key':_0xdc32('0x25'),'value':_0x5d08bf[_0xdc32('0x26')]},{'key':'response_mode','value':_0xdc32('0x27')},{'key':_0xdc32('0x28'),'value':encodeURIComponent(_0x1b4e23)},{'key':_0xdc32('0x29'),'value':_0x21bf17},{'key':_0xdc32('0x2a'),'value':_0x11b5f7},{'key':_0xdc32('0x2b'),'value':_0xdc32('0x2c')}];var _0x3bb5e1=_0x7df838+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdc32('0x2d')](_0x28f060,function(_0x52f207){return _0x52f207['key']+'='+_0x52f207[_0xdc32('0x2e')];})[_0xdc32('0x1a')]('&');_0x5d08bf['oauth2Claims']={'issuer':_0x7df838[_0xdc32('0x1c')](_0xdc32('0x2f'),''),'audience':_0x5d08bf[_0xdc32('0x24')],'state':_0x21bf17,'nonce':_0x11b5f7};redis[_0xdc32('0x30')](_0x21bf17,JSON['stringify'](_0x5d08bf));return _0x3bb5e1;}function isValidIdToken(_0x4d642e,_0x43b7cd){try{var _0x1eef2b=jwt[_0xdc32('0x31')](_0x4d642e,{'complete':!![]});var _0xa4135b=_0x1eef2b[_0xdc32('0x32')];if(_0xa4135b[_0xdc32('0x33')]!==_0x43b7cd['issuer'])return![];if(_0xa4135b['aud']!==_0x43b7cd[_0xdc32('0x34')])return![];if(_0xa4135b[_0xdc32('0x2a')]!==_0x43b7cd['nonce'])return![];if(moment()['isAfter'](moment[_0xdc32('0x35')](_0xa4135b[_0xdc32('0x36')])))return![];return!![];}catch(_0xeb0c53){throw _0xeb0c53;}}function refreshOauth2MicrosoftAccessToken(_0x203bca){return Promise['resolve']()['then'](function(){if(_0x203bca[_0xdc32('0x37')])return _0x203bca;return db[_0xdc32('0x38')][_0xdc32('0x39')]({'where':{'id':_0x203bca['id']},'raw':!![]});})[_0xdc32('0x3a')](function(_0x49f6e7){var _0xe58865={'grant_type':_0xdc32('0x3b'),'refresh_token':_0x49f6e7[_0xdc32('0x3c')],'scope':getAccessTokenScope(_0x49f6e7),'redirect_uri':_0x49f6e7[_0xdc32('0x26')],'client_id':_0x49f6e7['data1'],'client_secret':encryptor[_0xdc32('0x3d')](_0x49f6e7[_0xdc32('0x37')])};var _0x370f77={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdc32('0x1d'),_0x49f6e7[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe58865,'json':!![]};return rp(_0x370f77);})[_0xdc32('0x3a')](function(_0xd75af){_0x203bca[_0xdc32('0x3f')]=_0xd75af[_0xdc32('0x40')];_0x203bca[_0xdc32('0x3c')]=_0xd75af[_0xdc32('0x3b')];return db[_0xdc32('0x38')]['update']({'data5':_0x203bca[_0xdc32('0x3f')],'data6':_0x203bca[_0xdc32('0x3c')]},{'where':{'id':_0x203bca['id']}});})['then'](function(){return _0x203bca;})['catch'](function(_0x4e52d4){logger[_0xdc32('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x203bca['id'],_0x4e52d4);});}function getOauth2MicrosoftAccessToken(_0x381c22,_0x95617a){var _0x944d3b={'grant_type':_0xdc32('0x42'),'code':_0x381c22,'scope':getAccessTokenScope(_0x95617a),'redirect_uri':_0x95617a['data4'],'client_id':_0x95617a[_0xdc32('0x24')],'client_secret':encryptor[_0xdc32('0x3d')](_0x95617a[_0xdc32('0x37')])};var _0x2c1032={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x95617a[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x944d3b,'json':!![]};return rp(_0x2c1032);}function startRefreshInterval(_0x1e0276){var _0x4df50a=schedule[_0xdc32('0x43')];if(_0x4df50a[_0x1e0276['id']])clearInterval(_0x4df50a[_0x1e0276['id']]);_0x4df50a[_0x1e0276['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdc32('0x44')](this,{'id':_0x1e0276['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdc32('0x43')]=_0x4df50a;}function startAllRefreshIntervals(){return db[_0xdc32('0x38')][_0xdc32('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xdc32('0x3a')](function(_0x205734){var _0x281de0=_0x205734['map'](function(_0x42936c){return refreshOauth2MicrosoftAccessToken(_0x42936c)[_0xdc32('0x3a')](function(_0x3a3b5e){startRefreshInterval(_0x3a3b5e);});});return Promise[_0xdc32('0x46')](_0x281de0);})[_0xdc32('0x47')](function(_0x6af338){var _0x39ac8f=_0x6af338?util[_0xdc32('0x48')](_0x6af338,{'showHidden':![],'depth':null}):'';logger[_0xdc32('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x39ac8f);});}module[_0xdc32('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x3765=['oauth2/','set','payload','issuer','aud','audience','nonce','isAfter','exp','resolve','then','data3','CloudProvider','findOne','decryptString','POST','replace','data5','data6','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data1','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','{TENANT_ID}','data2','from','stringify','base64','randomBytes','toString','hex','client_id','response_type','join','data4','response_mode','scope','login','value','oauth2Claims'];(function(_0x4f89fa,_0x39546d){var _0x338542=function(_0x4cfe9d){while(--_0x4cfe9d){_0x4f89fa['push'](_0x4f89fa['shift']());}};_0x338542(++_0x39546d);}(_0x3765,0x68));var _0x5376=function(_0x2f8428,_0x5d9cea){_0x2f8428=_0x2f8428-0x0;var _0x55aa96=_0x3765[_0x2f8428];return _0x55aa96;};'use strict';var _=require(_0x5376('0x0'));var crypto=require(_0x5376('0x1'));var jwt=require(_0x5376('0x2'));var moment=require('moment');var Redis=require(_0x5376('0x3'));var rp=require(_0x5376('0x4'));var util=require(_0x5376('0x5'));var encryptor=require(_0x5376('0x6'));var config=require('../../config/environment');var logger=require(_0x5376('0x7'))(_0x5376('0x8'));var schedule=require(_0x5376('0x9'));var db=require(_0x5376('0xa'))['db'];config[_0x5376('0xb')]=_['defaults'](config[_0x5376('0xb')],{'host':_0x5376('0xc'),'port':0x18eb});var redis=new Redis(config[_0x5376('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5376('0xd'),'profile',_0x5376('0xe'),'offline_access',_0x5376('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x5376('0x10')],'Dynamics365':[_0x5376('0xd'),_0x5376('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x5376('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x5376('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xd31528){var _0x441c32=_[_0x5376('0x14')](AZURE_AUTH_SCOPES[_0xd31528[_0x5376('0x15')]]);if(_0xd31528[_0x5376('0x15')]===_0x5376('0x16'))_0x441c32[_0x5376('0x17')](_0xd31528[_0x5376('0x18')]+_0x5376('0x19'));return _0x441c32['join']('\x20');}function getAccessTokenScope(_0x1c97d7){if(_0x1c97d7['type']===_0x5376('0x1a'))return _0x5376('0xf');if(_0x1c97d7[_0x5376('0x15')]===_0x5376('0x16'))return _0x1c97d7['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x576607,_0x35e6aa){var _0x594b31=MICROSOFT_AUTH_URL['replace'](_0x5376('0x1b'),_0x576607[_0x5376('0x1c')]);var _0xf230c5=['code','id_token'];var _0x50bb7e=Buffer[_0x5376('0x1d')](JSON[_0x5376('0x1e')]({'id':_0x35e6aa}))['toString'](_0x5376('0x1f'));var _0x230d1f=crypto[_0x5376('0x20')](0x10)[_0x5376('0x21')](_0x5376('0x22'));var _0x22c3a4=getAuthorizationScopes(_0x576607);var _0x2202ad=[{'key':_0x5376('0x23'),'value':_0x576607['data1']},{'key':_0x5376('0x24'),'value':encodeURIComponent(_0xf230c5[_0x5376('0x25')]('\x20'))},{'key':'redirect_uri','value':_0x576607[_0x5376('0x26')]},{'key':_0x5376('0x27'),'value':'form_post'},{'key':_0x5376('0x28'),'value':encodeURIComponent(_0x22c3a4)},{'key':'state','value':_0x50bb7e},{'key':'nonce','value':_0x230d1f},{'key':'prompt','value':_0x5376('0x29')}];var _0x2652fb=_0x594b31+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2202ad,function(_0x5b08e5){return _0x5b08e5['key']+'='+_0x5b08e5[_0x5376('0x2a')];})[_0x5376('0x25')]('&');_0x576607[_0x5376('0x2b')]={'issuer':_0x594b31['replace'](_0x5376('0x2c'),''),'audience':_0x576607['data1'],'state':_0x50bb7e,'nonce':_0x230d1f};redis[_0x5376('0x2d')](_0x50bb7e,JSON[_0x5376('0x1e')](_0x576607));return _0x2652fb;}function isValidIdToken(_0x17551b,_0x346f49){try{var _0xa6206b=jwt['decode'](_0x17551b,{'complete':!![]});var _0x554f8b=_0xa6206b[_0x5376('0x2e')];if(_0x554f8b['iss']!==_0x346f49[_0x5376('0x2f')])return![];if(_0x554f8b[_0x5376('0x30')]!==_0x346f49[_0x5376('0x31')])return![];if(_0x554f8b[_0x5376('0x32')]!==_0x346f49[_0x5376('0x32')])return![];if(moment()[_0x5376('0x33')](moment['unix'](_0x554f8b[_0x5376('0x34')])))return![];return!![];}catch(_0xb7396a){throw _0xb7396a;}}function refreshOauth2MicrosoftAccessToken(_0x2d53ef){return Promise[_0x5376('0x35')]()[_0x5376('0x36')](function(){if(_0x2d53ef[_0x5376('0x37')])return _0x2d53ef;return db[_0x5376('0x38')][_0x5376('0x39')]({'where':{'id':_0x2d53ef['id']},'raw':!![]});})[_0x5376('0x36')](function(_0x58b6e6){var _0x28df49={'grant_type':'refresh_token','refresh_token':_0x58b6e6['data6'],'scope':getAccessTokenScope(_0x58b6e6),'redirect_uri':_0x58b6e6[_0x5376('0x26')],'client_id':_0x58b6e6['data1'],'client_secret':encryptor[_0x5376('0x3a')](_0x58b6e6[_0x5376('0x37')])};var _0x1ac8d6={'method':_0x5376('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x5376('0x3c')](_0x5376('0x1b'),_0x58b6e6['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28df49,'json':!![]};return rp(_0x1ac8d6);})[_0x5376('0x36')](function(_0xb6e2f7){_0x2d53ef[_0x5376('0x3d')]=_0xb6e2f7['access_token'];_0x2d53ef[_0x5376('0x3e')]=_0xb6e2f7['refresh_token'];return db[_0x5376('0x38')]['update']({'data5':_0x2d53ef[_0x5376('0x3d')],'data6':_0x2d53ef[_0x5376('0x3e')]},{'where':{'id':_0x2d53ef['id']}});})[_0x5376('0x36')](function(){return _0x2d53ef;})[_0x5376('0x3f')](function(_0x1f38a8){logger['error'](_0x5376('0x40'),_0x2d53ef['id'],_0x1f38a8);});}function getOauth2MicrosoftAccessToken(_0x2f843a,_0x248a47){var _0x2c0070={'grant_type':_0x5376('0x41'),'code':_0x2f843a,'scope':getAccessTokenScope(_0x248a47),'redirect_uri':_0x248a47[_0x5376('0x26')],'client_id':_0x248a47[_0x5376('0x42')],'client_secret':encryptor['decryptString'](_0x248a47[_0x5376('0x37')])};var _0x54d5c6={'method':_0x5376('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x5376('0x1b'),_0x248a47[_0x5376('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c0070,'json':!![]};return rp(_0x54d5c6);}function startRefreshInterval(_0xf45866){var _0x3291c2=schedule[_0x5376('0x43')];if(_0x3291c2[_0xf45866['id']])clearInterval(_0x3291c2[_0xf45866['id']]);_0x3291c2[_0xf45866['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5376('0x44')](this,{'id':_0xf45866['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3291c2;}function startAllRefreshIntervals(){return db[_0x5376('0x38')][_0x5376('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5376('0x36')](function(_0x528b8a){var _0x455c1c=_0x528b8a[_0x5376('0x14')](function(_0x255274){return refreshOauth2MicrosoftAccessToken(_0x255274)[_0x5376('0x36')](function(_0x2dbe6e){startRefreshInterval(_0x2dbe6e);});});return Promise[_0x5376('0x46')](_0x455c1c);})[_0x5376('0x3f')](function(_0xd0e589){var _0x52b8d4=_0xd0e589?util[_0x5376('0x47')](_0xd0e589,{'showHidden':![],'depth':null}):'';logger['error'](_0x5376('0x48'),_0x52b8d4);});}module[_0x5376('0x49')]={'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 8a18cc7..e3d092d 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 _0xda81=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xda81,0x1c3));var _0x1da8=function(_0x19c8e1,_0x33f9da){_0x19c8e1=_0x19c8e1-0x0;var _0x73cbf3=_0xda81[_0x19c8e1];return _0x73cbf3;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});} \ No newline at end of file +var _0x404d=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x52fe17,_0x2af32a){var _0x5af586=function(_0x35721a){while(--_0x35721a){_0x52fe17['push'](_0x52fe17['shift']());}};_0x5af586(++_0x2af32a);}(_0x404d,0x1e9));var _0xd404=function(_0x18fbb8,_0x4c6ce8){_0x18fbb8=_0x18fbb8-0x0;var _0x14e1e8=_0x404d[_0x18fbb8];return _0x14e1e8;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7faf39,_0x5da99f,_0x5c335f){return new BPromise(function(_0x10021a,_0x3d7e8a){return client['request'](_0x7faf39,_0x5c335f)['then'](function(_0x3096f0){logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5da99f,_0xd404('0xe'),JSON[_0xd404('0xf')](_0x3096f0));if(_0x3096f0['error']){if(_0x3096f0[_0xd404('0x10')][_0xd404('0x11')]===0x1f4){logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x3d7e8a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x10021a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}else{logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));_0x10021a(_0x3096f0[_0xd404('0x13')][_0xd404('0x12')]);}})[_0xd404('0x14')](function(_0x155186){logger['error'](_0xd404('0xd'),_0x5da99f,_0x155186);_0x3d7e8a(_0x155186);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8342beb..0bd1bd9 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x118555,_0xe6dd6c){var _0x24ec92=function(_0x85f999){while(--_0x85f999){_0x118555['push'](_0x118555['shift']());}};_0x24ec92(++_0xe6dd6c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7a54,0x106));var _0x47a5=function(_0x5d6ec8,_0x4fbbab){_0x5d6ec8=_0x5d6ec8-0x0;var _0x1438b3=_0x7a54[_0x5d6ec8];return _0x1438b3;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7da178f..acb5079 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 _0x023f=['name','sequelize','exports','STRING'];(function(_0x34b951,_0x554a89){var _0x2b259f=function(_0x39bf00){while(--_0x39bf00){_0x34b951['push'](_0x34b951['shift']());}};_0x2b259f(++_0x554a89);}(_0x023f,0x69));var _0xf023=function(_0x44164b,_0x4b4ea1){_0x44164b=_0x44164b-0x0;var _0x869b3d=_0x023f[_0x44164b];return _0x869b3d;};'use strict';var Sequelize=require(_0xf023('0x0'));module[_0xf023('0x1')]={'name':{'type':Sequelize[_0xf023('0x2')],'unique':_0xf023('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf023('0x2')]},'companyId':{'type':Sequelize[_0xf023('0x2')]},'website':{'type':Sequelize[_0xf023('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf023('0x2')]},'type':{'type':Sequelize[_0xf023('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf023('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf023('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf023('0x2')]},'sStreet':{'type':Sequelize[_0xf023('0x2')]},'sPostalCode':{'type':Sequelize[_0xf023('0x2')]},'sCity':{'type':Sequelize[_0xf023('0x2')]},'sCountry':{'type':Sequelize[_0xf023('0x2')]},'description':{'type':Sequelize[_0xf023('0x2')]}}; \ No newline at end of file +var _0xa831=['sequelize','exports','STRING','name'];(function(_0x717974,_0x24b354){var _0x4b38fa=function(_0x32f842){while(--_0x32f842){_0x717974['push'](_0x717974['shift']());}};_0x4b38fa(++_0x24b354);}(_0xa831,0xbc));var _0x1a83=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xa831[_0x2e0443];return _0x52d450;};'use strict';var Sequelize=require(_0x1a83('0x0'));module[_0x1a83('0x1')]={'name':{'type':Sequelize[_0x1a83('0x2')],'unique':_0x1a83('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1a83('0x2')]},'companyId':{'type':Sequelize[_0x1a83('0x2')]},'website':{'type':Sequelize[_0x1a83('0x2')]},'phone':{'type':Sequelize[_0x1a83('0x2')]},'fax':{'type':Sequelize[_0x1a83('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1a83('0x2')]},'email':{'type':Sequelize[_0x1a83('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1a83('0x2')]},'sStreet':{'type':Sequelize[_0x1a83('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1a83('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a83('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 31f0dee..bee325c 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 _0x82cb=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x2f10b6,_0x565c9b){var _0x2f4066=function(_0x2b31b2){while(--_0x2b31b2){_0x2f10b6['push'](_0x2f10b6['shift']());}};_0x2f4066(++_0x565c9b);}(_0x82cb,0x17c));var _0xb82c=function(_0x13cd39,_0x5c317b){_0x13cd39=_0x13cd39-0x0;var _0x405d90=_0x82cb[_0x13cd39];return _0x405d90;};'use strict';var emlformat=require(_0xb82c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb82c('0x1'));var jsonpatch=require(_0xb82c('0x2'));var rp=require('request-promise');var moment=require(_0xb82c('0x3'));var BPromise=require(_0xb82c('0x4'));var Mustache=require(_0xb82c('0x5'));var util=require(_0xb82c('0x6'));var path=require(_0xb82c('0x7'));var sox=require(_0xb82c('0x8'));var csv=require(_0xb82c('0x9'));var ejs=require(_0xb82c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb82c('0xb'));var squel=require(_0xb82c('0xc'));var crypto=require(_0xb82c('0xd'));var jsforce=require(_0xb82c('0xe'));var deskjs=require(_0xb82c('0xf'));var toCsv=require(_0xb82c('0x9'));var querystring=require(_0xb82c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb82c('0x11'));var qs=require(_0xb82c('0x12'));var as=require(_0xb82c('0x13'));var hardwareService=require(_0xb82c('0x14'));var logger=require(_0xb82c('0x15'))(_0xb82c('0x16'));var utils=require(_0xb82c('0x17'));var config=require(_0xb82c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb82c('0x19'))['db'];function respondWithStatusCode(_0x193dcc,_0x1dfb16){_0x1dfb16=_0x1dfb16||0xcc;return function(_0x1eeac8){if(_0x1eeac8){return _0x193dcc[_0xb82c('0x1a')](_0x1dfb16);}return _0x193dcc['status'](_0x1dfb16)[_0xb82c('0x1b')]();};}function respondWithResult(_0x4eab47,_0x35fdf8){_0x35fdf8=_0x35fdf8||0xc8;return function(_0x63c6f1){if(_0x63c6f1){return _0x4eab47[_0xb82c('0x1c')](_0x35fdf8)[_0xb82c('0x1d')](_0x63c6f1);}};}function respondWithFilteredResult(_0x268bb6,_0x57b49a){return function(_0x459023){if(_0x459023){var _0x2deb89=typeof _0x57b49a[_0xb82c('0x1e')]==='undefined'&&typeof _0x57b49a[_0xb82c('0x1f')]===_0xb82c('0x20');var _0x4b1b23=_0x459023[_0xb82c('0x21')];var _0x13199c=_0x2deb89?0x0:_0x57b49a['offset'];var _0x2e1efa=_0x2deb89?_0x459023[_0xb82c('0x21')]:_0x57b49a['offset']+_0x57b49a[_0xb82c('0x1f')];var _0x58efaf;if(_0x2e1efa>=_0x4b1b23){_0x2e1efa=_0x4b1b23;_0x58efaf=0xc8;}else{_0x58efaf=0xce;}_0x268bb6['status'](_0x58efaf);return _0x268bb6[_0xb82c('0x22')](_0xb82c('0x23'),_0x13199c+'-'+_0x2e1efa+'/'+_0x4b1b23)[_0xb82c('0x1d')](_0x459023);}return null;};}function patchUpdates(_0x469508){return function(_0x3db8d7){try{jsonpatch['apply'](_0x3db8d7,_0x469508,!![]);}catch(_0x3a6588){return BPromise[_0xb82c('0x24')](_0x3a6588);}return _0x3db8d7[_0xb82c('0x25')]();};}function saveUpdates(_0x5c7aba,_0xa94978){return function(_0x236590){if(_0x236590){return _0x236590[_0xb82c('0x26')](_0x5c7aba)[_0xb82c('0x27')](function(_0x202761){return _0x202761;});}return null;};}function removeEntity(_0x9434c7,_0x2d7879){return function(_0x6762cd){if(_0x6762cd){return _0x6762cd[_0xb82c('0x28')]()[_0xb82c('0x27')](function(){var _0x227c09=_0x6762cd[_0xb82c('0x29')]({'plain':!![]});var _0x57ee5f=_0xb82c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x57ee5f,'resourceId':_0x227c09['id']}})[_0xb82c('0x27')](function(){return _0x6762cd;});})[_0xb82c('0x27')](function(){_0x9434c7[_0xb82c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415edf,_0x3df6aa){return function(_0x310777){if(!_0x310777){_0x415edf['sendStatus'](0x194);}return _0x310777;};}function handleError(_0x7ddd98,_0x4e0985){_0x4e0985=_0x4e0985||0x1f4;return function(_0x337f05){logger[_0xb82c('0x2b')](_0x337f05[_0xb82c('0x2c')]);if(_0x337f05[_0xb82c('0x2d')]){delete _0x337f05[_0xb82c('0x2d')];}_0x7ddd98[_0xb82c('0x1c')](_0x4e0985)[_0xb82c('0x2e')](_0x337f05);};}exports[_0xb82c('0x2f')]=function(_0x4bfd63,_0xd90571){var _0x49aab7={},_0xa60d95={},_0x52834c={'count':0x0,'rows':[]};return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](function(_0x460bd4){_0xa60d95['model']=_[_0xb82c('0x32')](_0x460bd4);_0xa60d95[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4bfd63[_0xb82c('0x33')]);_0xa60d95[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xa60d95['model'],_0xa60d95[_0xb82c('0x33')]);_0x49aab7['attributes']=_[_0xb82c('0x35')](_0xa60d95[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x37')]));_0x49aab7[_0xb82c('0x38')]=_0x49aab7[_0xb82c('0x38')][_0xb82c('0x39')]?_0x49aab7['attributes']:_0xa60d95['model'];if(!_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3a')]('nolimit')){_0x49aab7[_0xb82c('0x1f')]=qs[_0xb82c('0x1f')](_0x4bfd63['query'][_0xb82c('0x1f')]);_0x49aab7['offset']=qs[_0xb82c('0x1e')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x1e')]);}_0x49aab7[_0xb82c('0x3b')]=qs[_0xb82c('0x3c')](_0x4bfd63[_0xb82c('0x33')]['sort']);_0x49aab7['where']=qs['filters'](_[_0xb82c('0x3d')](_0x4bfd63['query'],_0xa60d95[_0xb82c('0x34')]),_0x460bd4);if(_0x4bfd63['query'][_0xb82c('0x3e')]){_0x49aab7[_0xb82c('0x3f')]=_[_0xb82c('0x40')](_0x49aab7[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x49aab7[_0xb82c('0x38')],function(_0x1d381c){var _0x232469={};_0x232469[_0x1d381c]={'$like':'%'+_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x232469;})});}_0x49aab7=_['merge']({},_0x49aab7,_0x4bfd63[_0xb82c('0x42')]);var _0x3eecf0={'where':_0x49aab7[_0xb82c('0x3f')]};return db['CmCompany'][_0xb82c('0x21')](_0x3eecf0)[_0xb82c('0x27')](function(_0x5a343e){_0x52834c[_0xb82c('0x21')]=_0x5a343e;if(_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x43')]){_0x49aab7[_0xb82c('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0xb82c('0x45')](_0x49aab7);})[_0xb82c('0x27')](function(_0x5f17a2){_0x52834c[_0xb82c('0x46')]=_0x5f17a2;return _0x52834c;})[_0xb82c('0x27')](respondWithFilteredResult(_0xd90571,_0x49aab7))[_0xb82c('0x47')](handleError(_0xd90571,null));})[_0xb82c('0x47')](handleError(_0xd90571,null));};exports[_0xb82c('0x48')]=function(_0x4d14b7,_0x310162){var _0x5c3be1={'raw':![],'where':{'id':_0x4d14b7[_0xb82c('0x49')]['id']}},_0xc810d9={};_0xc810d9[_0xb82c('0x36')]=_[_0xb82c('0x32')](db[_0xb82c('0x30')][_0xb82c('0x4a')]);_0xc810d9[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4d14b7[_0xb82c('0x33')]);_0xc810d9[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xc810d9['model'],_0xc810d9[_0xb82c('0x33')]);_0x5c3be1[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0xc810d9[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x37')]));_0x5c3be1[_0xb82c('0x38')]=_0x5c3be1['attributes'][_0xb82c('0x39')]?_0x5c3be1[_0xb82c('0x38')]:_0xc810d9[_0xb82c('0x36')];if(_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x43')]){_0x5c3be1[_0xb82c('0x44')]=[{'all':!![]}];}_0x5c3be1=_[_0xb82c('0x40')]({},_0x5c3be1,_0x4d14b7[_0xb82c('0x42')]);return db[_0xb82c('0x30')]['find'](_0x5c3be1)[_0xb82c('0x27')](handleEntityNotFound(_0x310162,null))['then'](respondWithResult(_0x310162,null))[_0xb82c('0x47')](handleError(_0x310162,null));};exports[_0xb82c('0x4b')]=function(_0x26bb54,_0x35fb4e){return db[_0xb82c('0x30')][_0xb82c('0x4b')](_0x26bb54[_0xb82c('0x4c')],{})['then'](function(_0x2bc92f){var _0x55c9b6=_0x26bb54[_0xb82c('0x4d')][_0xb82c('0x29')]({'plain':!![]});if(!_0x55c9b6)throw new Error(_0xb82c('0x4e'));if(_0x55c9b6[_0xb82c('0x4f')]===_0xb82c('0x4d')){var _0x5492d3=_0x2bc92f[_0xb82c('0x29')]({'plain':!![]});var _0x456d5a=_0xb82c('0x2a');return db[_0xb82c('0x50')]['find']({'where':{'name':_0x456d5a,'userProfileId':_0x55c9b6['userProfileId']},'raw':!![]})[_0xb82c('0x27')](function(_0x984d29){if(_0x984d29&&_0x984d29[_0xb82c('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5492d3[_0xb82c('0x2d')],'resourceId':_0x5492d3['id'],'type':_0x984d29[_0xb82c('0x2d')],'sectionId':_0x984d29['id']},{})[_0xb82c('0x27')](function(){return _0x2bc92f;});}else{return _0x2bc92f;}})[_0xb82c('0x47')](function(_0xaea839){logger[_0xb82c('0x2b')](_0xb82c('0x52'),_0xaea839);throw _0xaea839;});}return _0x2bc92f;})[_0xb82c('0x27')](respondWithResult(_0x35fb4e,0xc9))[_0xb82c('0x47')](handleError(_0x35fb4e,null));};exports[_0xb82c('0x26')]=function(_0x15859b,_0xf53f48){if(_0x15859b[_0xb82c('0x4c')]['id']){delete _0x15859b[_0xb82c('0x4c')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x15859b['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0xf53f48,null))[_0xb82c('0x27')](saveUpdates(_0x15859b['body'],null))[_0xb82c('0x27')](respondWithResult(_0xf53f48,null))['catch'](handleError(_0xf53f48,null));};exports['destroy']=function(_0x571767,_0x316ecd){return db[_0xb82c('0x30')][_0xb82c('0x53')]({'where':{'id':_0x571767[_0xb82c('0x49')]['id']}})['then'](handleEntityNotFound(_0x316ecd,null))['then'](removeEntity(_0x316ecd,null))[_0xb82c('0x47')](handleError(_0x316ecd,null));};exports[_0xb82c('0x31')]=function(_0x9ec2b8,_0x16f579){return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](respondWithResult(_0x16f579,null))[_0xb82c('0x47')](handleError(_0x16f579,null));};exports[_0xb82c('0x54')]=function(_0xca9a7c,_0x5c0c39,_0x35b55d){return db[_0xb82c('0x55')][_0xb82c('0x53')]({'where':{'id':_0xca9a7c['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x5c0c39,null))[_0xb82c('0x27')](function(_0x309465){if(_0x309465){return _0x309465[_0xb82c('0x54')](_0xca9a7c[_0xb82c('0x4c')][_0xb82c('0x56')],_[_0xb82c('0x57')](_0xca9a7c[_0xb82c('0x4c')],[_0xb82c('0x56'),'id'])||{});}})['then'](respondWithResult(_0x5c0c39,null))[_0xb82c('0x47')](handleError(_0x5c0c39,null));};exports[_0xb82c('0x58')]=function(_0x4f7f0c,_0x4ea230,_0x328773){var _0x331f2f={};var _0x5bb9e1={};var _0x5a9886;var _0x1477ac;return db[_0xb82c('0x30')][_0xb82c('0x59')]({'where':{'id':_0x4f7f0c[_0xb82c('0x49')]['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x4ea230,null))[_0xb82c('0x27')](function(_0x16d232){if(_0x16d232){_0x5a9886=_0x16d232;_0x5bb9e1[_0xb82c('0x36')]=_[_0xb82c('0x32')](db['CmContact'][_0xb82c('0x4a')]);_0x5bb9e1[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4f7f0c['query']);_0x5bb9e1[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],_0x5bb9e1[_0xb82c('0x33')]);_0x331f2f[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],qs['fields'](_0x4f7f0c['query'][_0xb82c('0x37')]));_0x331f2f[_0xb82c('0x38')]=_0x331f2f[_0xb82c('0x38')]['length']?_0x331f2f[_0xb82c('0x38')]:_0x5bb9e1['model'];_0x331f2f['order']=qs[_0xb82c('0x3c')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3c')]);_0x331f2f[_0xb82c('0x3f')]=qs['filters'](_[_0xb82c('0x3d')](_0x4f7f0c['query'],_0x5bb9e1[_0xb82c('0x34')]));if(_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]){_0x331f2f['where']=_[_0xb82c('0x40')](_0x331f2f[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x331f2f['attributes'],function(_0x583aaa){var _0x8ea71d={};_0x8ea71d[_0x583aaa]={'$like':'%'+_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x8ea71d;})});}_0x331f2f=_[_0xb82c('0x40')]({},_0x331f2f,_0x4f7f0c[_0xb82c('0x42')]);return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x1de299){if(_0x1de299){_0x1477ac=_0x1de299[_0xb82c('0x39')];if(!_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3a')](_0xb82c('0x5a'))){_0x331f2f[_0xb82c('0x1f')]=qs['limit'](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1f')]);_0x331f2f[_0xb82c('0x1e')]=qs[_0xb82c('0x1e')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1e')]);}return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x26fa17){if(_0x26fa17){return _0x26fa17?{'count':_0x1477ac,'rows':_0x26fa17}:null;}})['then'](respondWithResult(_0x4ea230,null))[_0xb82c('0x47')](handleError(_0x4ea230,null));}; \ No newline at end of file +var _0xfa9f=['count','set','Content-Range','json','reject','save','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','model','keys','query','filters','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','intersection','CmCompany','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','ids','omit','findOne','pick','map','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','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','../../mysqldb','status','end','offset','undefined','limit'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xfa9f,0x98));var _0xffa9=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0xfa9f[_0x871ef5];return _0x1f62ea;};'use strict';var emlformat=require(_0xffa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffa9('0x1'));var jsonpatch=require(_0xffa9('0x2'));var rp=require(_0xffa9('0x3'));var moment=require(_0xffa9('0x4'));var BPromise=require(_0xffa9('0x5'));var Mustache=require(_0xffa9('0x6'));var util=require('util');var path=require(_0xffa9('0x7'));var sox=require(_0xffa9('0x8'));var csv=require('to-csv');var ejs=require(_0xffa9('0x9'));var fs=require('fs');var fs_extra=require(_0xffa9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xffa9('0xb'));var deskjs=require(_0xffa9('0xc'));var toCsv=require(_0xffa9('0xd'));var querystring=require(_0xffa9('0xe'));var Papa=require(_0xffa9('0xf'));var Redis=require(_0xffa9('0x10'));var authService=require(_0xffa9('0x11'));var qs=require(_0xffa9('0x12'));var as=require(_0xffa9('0x13'));var hardwareService=require(_0xffa9('0x14'));var logger=require(_0xffa9('0x15'))(_0xffa9('0x16'));var utils=require(_0xffa9('0x17'));var config=require(_0xffa9('0x18'));var licenseUtil=require(_0xffa9('0x19'));var db=require(_0xffa9('0x1a'))['db'];function respondWithStatusCode(_0x95c077,_0x49682f){_0x49682f=_0x49682f||0xcc;return function(_0x46fe36){if(_0x46fe36){return _0x95c077['sendStatus'](_0x49682f);}return _0x95c077[_0xffa9('0x1b')](_0x49682f)[_0xffa9('0x1c')]();};}function respondWithResult(_0x162ff2,_0x1d02c6){_0x1d02c6=_0x1d02c6||0xc8;return function(_0xc914ff){if(_0xc914ff){return _0x162ff2[_0xffa9('0x1b')](_0x1d02c6)['json'](_0xc914ff);}};}function respondWithFilteredResult(_0x311669,_0x35d341){return function(_0x37aa62){if(_0x37aa62){var _0x1dda88=typeof _0x35d341[_0xffa9('0x1d')]===_0xffa9('0x1e')&&typeof _0x35d341[_0xffa9('0x1f')]===_0xffa9('0x1e');var _0x483265=_0x37aa62[_0xffa9('0x20')];var _0x7d5da5=_0x1dda88?0x0:_0x35d341[_0xffa9('0x1d')];var _0x516747=_0x1dda88?_0x37aa62[_0xffa9('0x20')]:_0x35d341[_0xffa9('0x1d')]+_0x35d341[_0xffa9('0x1f')];var _0x2117d4;if(_0x516747>=_0x483265){_0x516747=_0x483265;_0x2117d4=0xc8;}else{_0x2117d4=0xce;}_0x311669[_0xffa9('0x1b')](_0x2117d4);return _0x311669[_0xffa9('0x21')](_0xffa9('0x22'),_0x7d5da5+'-'+_0x516747+'/'+_0x483265)[_0xffa9('0x23')](_0x37aa62);}return null;};}function patchUpdates(_0x3cd902){return function(_0x589b2a){try{jsonpatch['apply'](_0x589b2a,_0x3cd902,!![]);}catch(_0x3f8604){return BPromise[_0xffa9('0x24')](_0x3f8604);}return _0x589b2a[_0xffa9('0x25')]();};}function saveUpdates(_0x14e617,_0x1a2210){return function(_0x18c52a){if(_0x18c52a){return _0x18c52a[_0xffa9('0x26')](_0x14e617)[_0xffa9('0x27')](function(_0x430aa0){return _0x430aa0;});}return null;};}function removeEntity(_0x585f92,_0x420f73){return function(_0x331314){if(_0x331314){return _0x331314[_0xffa9('0x28')]()[_0xffa9('0x27')](function(){var _0x37677e=_0x331314['get']({'plain':!![]});var _0x3af9ba=_0xffa9('0x29');return db[_0xffa9('0x2a')][_0xffa9('0x28')]({'where':{'type':_0x3af9ba,'resourceId':_0x37677e['id']}})[_0xffa9('0x27')](function(){return _0x331314;});})[_0xffa9('0x27')](function(){_0x585f92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9a53,_0x28c4da){return function(_0x3029cd){if(!_0x3029cd){_0x5e9a53[_0xffa9('0x2b')](0x194);}return _0x3029cd;};}function handleError(_0x3d5ec4,_0x25f8fa){_0x25f8fa=_0x25f8fa||0x1f4;return function(_0x3b8e36){logger[_0xffa9('0x2c')](_0x3b8e36[_0xffa9('0x2d')]);if(_0x3b8e36['name']){delete _0x3b8e36[_0xffa9('0x2e')];}_0x3d5ec4[_0xffa9('0x1b')](_0x25f8fa)[_0xffa9('0x2f')](_0x3b8e36);};}exports[_0xffa9('0x30')]=function(_0xf3d196,_0x54d354){var _0x3dfc48={},_0x250540={},_0x4d562c={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xffa9('0x27')](function(_0x1e0611){_0x250540[_0xffa9('0x31')]=_[_0xffa9('0x32')](_0x1e0611);_0x250540[_0xffa9('0x33')]=_[_0xffa9('0x32')](_0xf3d196[_0xffa9('0x33')]);_0x250540[_0xffa9('0x34')]=_['intersection'](_0x250540['model'],_0x250540[_0xffa9('0x33')]);_0x3dfc48['attributes']=_['intersection'](_0x250540[_0xffa9('0x31')],qs[_0xffa9('0x35')](_0xf3d196[_0xffa9('0x33')]['fields']));_0x3dfc48['attributes']=_0x3dfc48[_0xffa9('0x36')][_0xffa9('0x37')]?_0x3dfc48[_0xffa9('0x36')]:_0x250540[_0xffa9('0x31')];if(!_0xf3d196['query']['hasOwnProperty'](_0xffa9('0x38'))){_0x3dfc48[_0xffa9('0x1f')]=qs[_0xffa9('0x1f')](_0xf3d196[_0xffa9('0x33')]['limit']);_0x3dfc48['offset']=qs[_0xffa9('0x1d')](_0xf3d196[_0xffa9('0x33')][_0xffa9('0x1d')]);}_0x3dfc48[_0xffa9('0x39')]=qs[_0xffa9('0x3a')](_0xf3d196['query']['sort']);_0x3dfc48[_0xffa9('0x3b')]=qs['filters'](_['pick'](_0xf3d196[_0xffa9('0x33')],_0x250540[_0xffa9('0x34')]),_0x1e0611);if(_0xf3d196[_0xffa9('0x33')][_0xffa9('0x3c')]){_0x3dfc48[_0xffa9('0x3b')]=_[_0xffa9('0x3d')](_0x3dfc48[_0xffa9('0x3b')],{'$or':_['map'](_0x3dfc48[_0xffa9('0x36')],function(_0x2730d8){var _0x1ad7ee={};_0x1ad7ee[_0x2730d8]={'$like':'%'+_0xf3d196['query'][_0xffa9('0x3c')]+'%'};return _0x1ad7ee;})});}_0x3dfc48=_[_0xffa9('0x3d')]({},_0x3dfc48,_0xf3d196[_0xffa9('0x3e')]);var _0x1975cb={'where':_0x3dfc48[_0xffa9('0x3b')]};return db['CmCompany'][_0xffa9('0x20')](_0x1975cb)[_0xffa9('0x27')](function(_0x262563){_0x4d562c[_0xffa9('0x20')]=_0x262563;if(_0xf3d196[_0xffa9('0x33')][_0xffa9('0x3f')]){_0x3dfc48[_0xffa9('0x40')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3dfc48);})[_0xffa9('0x27')](function(_0x348384){_0x4d562c[_0xffa9('0x41')]=_0x348384;return _0x4d562c;})[_0xffa9('0x27')](respondWithFilteredResult(_0x54d354,_0x3dfc48))['catch'](handleError(_0x54d354,null));})[_0xffa9('0x42')](handleError(_0x54d354,null));};exports[_0xffa9('0x43')]=function(_0x13c288,_0x12da3e){var _0x21ced9={'raw':![],'where':{'id':_0x13c288['params']['id']}},_0x41a0fb={};_0x41a0fb['model']=_[_0xffa9('0x32')](db['CmCompany'][_0xffa9('0x44')]);_0x41a0fb[_0xffa9('0x33')]=_[_0xffa9('0x32')](_0x13c288[_0xffa9('0x33')]);_0x41a0fb['filters']=_[_0xffa9('0x45')](_0x41a0fb['model'],_0x41a0fb[_0xffa9('0x33')]);_0x21ced9[_0xffa9('0x36')]=_[_0xffa9('0x45')](_0x41a0fb[_0xffa9('0x31')],qs[_0xffa9('0x35')](_0x13c288[_0xffa9('0x33')]['fields']));_0x21ced9[_0xffa9('0x36')]=_0x21ced9[_0xffa9('0x36')][_0xffa9('0x37')]?_0x21ced9[_0xffa9('0x36')]:_0x41a0fb['model'];if(_0x13c288[_0xffa9('0x33')][_0xffa9('0x3f')]){_0x21ced9[_0xffa9('0x40')]=[{'all':!![]}];}_0x21ced9=_[_0xffa9('0x3d')]({},_0x21ced9,_0x13c288[_0xffa9('0x3e')]);return db[_0xffa9('0x46')][_0xffa9('0x47')](_0x21ced9)[_0xffa9('0x27')](handleEntityNotFound(_0x12da3e,null))[_0xffa9('0x27')](respondWithResult(_0x12da3e,null))['catch'](handleError(_0x12da3e,null));};exports[_0xffa9('0x48')]=function(_0x442a56,_0x248492){return db[_0xffa9('0x46')]['create'](_0x442a56[_0xffa9('0x49')],{})['then'](function(_0x15ddf0){var _0x8ea961=_0x442a56[_0xffa9('0x4a')]['get']({'plain':!![]});if(!_0x8ea961)throw new Error(_0xffa9('0x4b'));if(_0x8ea961[_0xffa9('0x4c')]==='user'){var _0x188e37=_0x15ddf0[_0xffa9('0x4d')]({'plain':!![]});var _0x3f48b4=_0xffa9('0x29');return db[_0xffa9('0x4e')][_0xffa9('0x47')]({'where':{'name':_0x3f48b4,'userProfileId':_0x8ea961[_0xffa9('0x4f')]},'raw':!![]})[_0xffa9('0x27')](function(_0x33d072){if(_0x33d072&&_0x33d072[_0xffa9('0x50')]===0x0){return db[_0xffa9('0x2a')][_0xffa9('0x48')]({'name':_0x188e37[_0xffa9('0x2e')],'resourceId':_0x188e37['id'],'type':_0x33d072[_0xffa9('0x2e')],'sectionId':_0x33d072['id']},{})[_0xffa9('0x27')](function(){return _0x15ddf0;});}else{return _0x15ddf0;}})[_0xffa9('0x42')](function(_0x3c4b2c){logger[_0xffa9('0x2c')](_0xffa9('0x51'),_0x3c4b2c);throw _0x3c4b2c;});}return _0x15ddf0;})[_0xffa9('0x27')](respondWithResult(_0x248492,0xc9))[_0xffa9('0x42')](handleError(_0x248492,null));};exports[_0xffa9('0x26')]=function(_0x5592a0,_0x15bb66){if(_0x5592a0[_0xffa9('0x49')]['id']){delete _0x5592a0['body']['id'];}return db['CmCompany'][_0xffa9('0x47')]({'where':{'id':_0x5592a0[_0xffa9('0x52')]['id']}})['then'](handleEntityNotFound(_0x15bb66,null))[_0xffa9('0x27')](saveUpdates(_0x5592a0[_0xffa9('0x49')],null))[_0xffa9('0x27')](respondWithResult(_0x15bb66,null))[_0xffa9('0x42')](handleError(_0x15bb66,null));};exports[_0xffa9('0x28')]=function(_0x1e94ff,_0x44c7c6){return db[_0xffa9('0x46')][_0xffa9('0x47')]({'where':{'id':_0x1e94ff['params']['id']}})[_0xffa9('0x27')](handleEntityNotFound(_0x44c7c6,null))[_0xffa9('0x27')](removeEntity(_0x44c7c6,null))['catch'](handleError(_0x44c7c6,null));};exports[_0xffa9('0x53')]=function(_0x2f66a7,_0x3363b2){return db['CmCompany'][_0xffa9('0x53')]()[_0xffa9('0x27')](respondWithResult(_0x3363b2,null))['catch'](handleError(_0x3363b2,null));};exports[_0xffa9('0x54')]=function(_0x18dd67,_0x5d27fe,_0x13e466){return db[_0xffa9('0x55')][_0xffa9('0x47')]({'where':{'id':_0x18dd67[_0xffa9('0x52')]['id']}})[_0xffa9('0x27')](handleEntityNotFound(_0x5d27fe,null))['then'](function(_0x4d3234){if(_0x4d3234){return _0x4d3234[_0xffa9('0x54')](_0x18dd67[_0xffa9('0x49')][_0xffa9('0x56')],_[_0xffa9('0x57')](_0x18dd67[_0xffa9('0x49')],[_0xffa9('0x56'),'id'])||{});}})[_0xffa9('0x27')](respondWithResult(_0x5d27fe,null))[_0xffa9('0x42')](handleError(_0x5d27fe,null));};exports['getContacts']=function(_0x594ab8,_0x59fc5f,_0x53d94b){var _0x518dc0={};var _0x3b9d56={};var _0x360787;var _0x52b8b0;return db['CmCompany'][_0xffa9('0x58')]({'where':{'id':_0x594ab8[_0xffa9('0x52')]['id']}})['then'](handleEntityNotFound(_0x59fc5f,null))[_0xffa9('0x27')](function(_0xa0aaa3){if(_0xa0aaa3){_0x360787=_0xa0aaa3;_0x3b9d56[_0xffa9('0x31')]=_[_0xffa9('0x32')](db[_0xffa9('0x55')]['rawAttributes']);_0x3b9d56[_0xffa9('0x33')]=_['keys'](_0x594ab8[_0xffa9('0x33')]);_0x3b9d56[_0xffa9('0x34')]=_['intersection'](_0x3b9d56[_0xffa9('0x31')],_0x3b9d56[_0xffa9('0x33')]);_0x518dc0[_0xffa9('0x36')]=_[_0xffa9('0x45')](_0x3b9d56[_0xffa9('0x31')],qs[_0xffa9('0x35')](_0x594ab8['query'][_0xffa9('0x35')]));_0x518dc0['attributes']=_0x518dc0[_0xffa9('0x36')][_0xffa9('0x37')]?_0x518dc0[_0xffa9('0x36')]:_0x3b9d56[_0xffa9('0x31')];_0x518dc0[_0xffa9('0x39')]=qs[_0xffa9('0x3a')](_0x594ab8['query']['sort']);_0x518dc0[_0xffa9('0x3b')]=qs[_0xffa9('0x34')](_[_0xffa9('0x59')](_0x594ab8[_0xffa9('0x33')],_0x3b9d56[_0xffa9('0x34')]));if(_0x594ab8[_0xffa9('0x33')][_0xffa9('0x3c')]){_0x518dc0[_0xffa9('0x3b')]=_[_0xffa9('0x3d')](_0x518dc0['where'],{'$or':_[_0xffa9('0x5a')](_0x518dc0[_0xffa9('0x36')],function(_0x1e6dd1){var _0x302360={};_0x302360[_0x1e6dd1]={'$like':'%'+_0x594ab8[_0xffa9('0x33')][_0xffa9('0x3c')]+'%'};return _0x302360;})});}_0x518dc0=_['merge']({},_0x518dc0,_0x594ab8[_0xffa9('0x3e')]);return _0x360787['getContacts'](_0x518dc0);}})['then'](function(_0x5f0ba9){if(_0x5f0ba9){_0x52b8b0=_0x5f0ba9[_0xffa9('0x37')];if(!_0x594ab8[_0xffa9('0x33')]['hasOwnProperty']('nolimit')){_0x518dc0[_0xffa9('0x1f')]=qs[_0xffa9('0x1f')](_0x594ab8['query']['limit']);_0x518dc0['offset']=qs[_0xffa9('0x1d')](_0x594ab8[_0xffa9('0x33')]['offset']);}return _0x360787[_0xffa9('0x5b')](_0x518dc0);}})[_0xffa9('0x27')](function(_0x769e39){if(_0x769e39){return _0x769e39?{'count':_0x52b8b0,'rows':_0x769e39}:null;}})['then'](respondWithResult(_0x59fc5f,null))[_0xffa9('0x42')](handleError(_0x59fc5f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index f562cea..000b3a6 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 _0x514e=['moment','bluebird','path','../../config/environment','./cmCompany.attributes','exports','CmCompany','lodash','../../config/logger','api'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x514e,0x197));var _0xe514=function(_0x59fcd3,_0x232666){_0x59fcd3=_0x59fcd3-0x0;var _0x1d0db7=_0x514e[_0x59fcd3];return _0x1d0db7;};'use strict';var _=require(_0xe514('0x0'));var util=require('util');var logger=require(_0xe514('0x1'))(_0xe514('0x2'));var moment=require(_0xe514('0x3'));var BPromise=require(_0xe514('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe514('0x5'));var rimraf=require('rimraf');var config=require(_0xe514('0x6'));var attributes=require(_0xe514('0x7'));module[_0xe514('0x8')]=function(_0x4fe7cf,_0x1da638){return _0x4fe7cf['define'](_0xe514('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0654=['../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x45c137,_0x411b9a){var _0x310012=function(_0x477a41){while(--_0x477a41){_0x45c137['push'](_0x45c137['shift']());}};_0x310012(++_0x411b9a);}(_0x0654,0x73));var _0x4065=function(_0x5f3a0b,_0x37693f){_0x5f3a0b=_0x5f3a0b-0x0;var _0x4b8438=_0x0654[_0x5f3a0b];return _0x4b8438;};'use strict';var _=require(_0x4065('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4065('0x1'));var moment=require('moment');var BPromise=require(_0x4065('0x2'));var rp=require(_0x4065('0x3'));var fs=require('fs');var path=require(_0x4065('0x4'));var rimraf=require(_0x4065('0x5'));var config=require(_0x4065('0x6'));var attributes=require(_0x4065('0x7'));module[_0x4065('0x8')]=function(_0x5d67f6,_0x21e563){return _0x5d67f6[_0x4065('0x9')]('CmCompany',attributes,{'tableName':_0x4065('0xa'),'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 0490afd..d2091f6 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 _0xb172=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x3e0ba8,_0x562bf7){var _0xcecac3=function(_0x3ad54a){while(--_0x3ad54a){_0x3e0ba8['push'](_0x3e0ba8['shift']());}};_0xcecac3(++_0x562bf7);}(_0xb172,0x70));var _0x2b17=function(_0x3652a6,_0x1c76ad){_0x3652a6=_0x3652a6-0x0;var _0x28da2e=_0xb172[_0x3652a6];return _0x28da2e;};'use strict';var _=require(_0x2b17('0x0'));var util=require(_0x2b17('0x1'));var moment=require('moment');var BPromise=require(_0x2b17('0x2'));var rs=require(_0x2b17('0x3'));var fs=require('fs');var Redis=require(_0x2b17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b17('0x5'));var logger=require('../../config/logger')(_0x2b17('0x6'));var config=require(_0x2b17('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b17('0x8')][_0x2b17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5719eb,_0x4b25ae,_0x14b904){return new BPromise(function(_0x91d10b,_0x45ff35){return client['request'](_0x5719eb,_0x14b904)[_0x2b17('0xa')](function(_0x479460){logger[_0x2b17('0xb')](_0x2b17('0xc'),_0x4b25ae,_0x2b17('0xd'));logger['debug'](_0x2b17('0xe'),_0x4b25ae,_0x2b17('0xd'),JSON['stringify'](_0x479460));if(_0x479460['error']){if(_0x479460[_0x2b17('0xf')][_0x2b17('0x10')]===0x1f4){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);return _0x45ff35(_0x479460['error'][_0x2b17('0x11')]);}logger[_0x2b17('0xf')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x479460['error'][_0x2b17('0x11')]);return _0x91d10b(_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);}else{logger[_0x2b17('0xb')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x2b17('0xd'));_0x91d10b(_0x479460[_0x2b17('0x12')][_0x2b17('0x11')]);}})['catch'](function(_0x4fd7c1){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x4fd7c1);_0x45ff35(_0x4fd7c1);});});} \ No newline at end of file +var _0x086b=['error','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x386c7c,_0x5bac87){var _0x2c6342=function(_0x394287){while(--_0x394287){_0x386c7c['push'](_0x386c7c['shift']());}};_0x2c6342(++_0x5bac87);}(_0x086b,0xa3));var _0xb086=function(_0x14047b,_0x4bebbd){_0x14047b=_0x14047b-0x0;var _0x6442ca=_0x086b[_0x14047b];return _0x6442ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb086('0x0'));var BPromise=require('bluebird');var rs=require(_0xb086('0x1'));var fs=require('fs');var Redis=require(_0xb086('0x2'));var db=require(_0xb086('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb086('0x4'))('rpc');var config=require(_0xb086('0x5'));var jayson=require(_0xb086('0x6'));var client=jayson['client'][_0xb086('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21142e,_0x3a605f,_0x4f083d){return new BPromise(function(_0x129cbe,_0x2164fd){return client['request'](_0x21142e,_0x4f083d)[_0xb086('0x8')](function(_0x17137b){logger[_0xb086('0x9')](_0xb086('0xa'),_0x3a605f,'request\x20sent');logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x3a605f,_0xb086('0xb'),JSON[_0xb086('0xc')](_0x17137b));if(_0x17137b[_0xb086('0xd')]){if(_0x17137b[_0xb086('0xd')]['code']===0x1f4){logger['error'](_0xb086('0xa'),_0x3a605f,_0x17137b[_0xb086('0xd')][_0xb086('0xe')]);return _0x2164fd(_0x17137b['error'][_0xb086('0xe')]);}logger[_0xb086('0xd')](_0xb086('0xa'),_0x3a605f,_0x17137b['error'][_0xb086('0xe')]);return _0x129cbe(_0x17137b[_0xb086('0xd')][_0xb086('0xe')]);}else{logger[_0xb086('0x9')]('CmCompany,\x20%s,\x20%s',_0x3a605f,'request\x20sent');_0x129cbe(_0x17137b['result'][_0xb086('0xe')]);}})[_0xb086('0xf')](function(_0x493646){logger[_0xb086('0xd')]('CmCompany,\x20%s,\x20%s',_0x3a605f,_0x493646);_0x2164fd(_0x493646);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8a5130a..ba1ab1a 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 _0x30a0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x6ddbbc,_0x5061a9){var _0xcb1ef0=function(_0x23f7ad){while(--_0x23f7ad){_0x6ddbbc['push'](_0x6ddbbc['shift']());}};_0xcb1ef0(++_0x5061a9);}(_0x30a0,0x19b));var _0x030a=function(_0xb55873,_0x5b0e91){_0xb55873=_0xb55873-0x0;var _0xc7408d=_0x30a0[_0xb55873];return _0xc7408d;};'use strict';var multer=require(_0x030a('0x0'));var util=require(_0x030a('0x1'));var path=require('path');var timeout=require(_0x030a('0x2'));var express=require(_0x030a('0x3'));var router=express[_0x030a('0x4')]();var fs_extra=require(_0x030a('0x5'));var auth=require(_0x030a('0x6'));var interaction=require(_0x030a('0x7'));var config=require('../../config/environment');var controller=require(_0x030a('0x8'));router[_0x030a('0x9')]('/',auth[_0x030a('0xa')](),controller[_0x030a('0xb')]);router[_0x030a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x030a('0xc')]);router[_0x030a('0x9')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller['show']);router[_0x030a('0x9')](_0x030a('0xe'),auth[_0x030a('0xa')](),controller['getContacts']);router[_0x030a('0xf')]('/',auth['isAuthenticated'](),controller[_0x030a('0x10')]);router['post'](_0x030a('0xe'),auth[_0x030a('0xa')](),controller[_0x030a('0x11')]);router[_0x030a('0x12')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x13')]);router[_0x030a('0x14')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x15')]);module[_0x030a('0x16')]=router; \ No newline at end of file +var _0x1989=['create','addContacts','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmCompany.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x1989,0x149));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9198('0x0'));var timeout=require(_0x9198('0x1'));var express=require('express');var router=express[_0x9198('0x2')]();var fs_extra=require(_0x9198('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9198('0x4'));var config=require('../../config/environment');var controller=require(_0x9198('0x5'));router[_0x9198('0x6')]('/',auth['isAuthenticated'](),controller[_0x9198('0x7')]);router[_0x9198('0x6')](_0x9198('0x8'),auth['isAuthenticated'](),controller[_0x9198('0x9')]);router[_0x9198('0x6')](_0x9198('0xa'),auth[_0x9198('0xb')](),controller[_0x9198('0xc')]);router['get'](_0x9198('0xd'),auth['isAuthenticated'](),controller[_0x9198('0xe')]);router[_0x9198('0xf')]('/',auth['isAuthenticated'](),controller[_0x9198('0x10')]);router[_0x9198('0xf')](_0x9198('0xd'),auth['isAuthenticated'](),controller[_0x9198('0x11')]);router[_0x9198('0x12')](_0x9198('0xa'),auth['isAuthenticated'](),controller[_0x9198('0x13')]);router[_0x9198('0x14')]('/:id',auth[_0x9198('0xb')](),controller[_0x9198('0x15')]);module[_0x9198('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 9f554ed..6097da8 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 _0x5dca=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x391606,_0x1407f2){var _0xad5ff7=function(_0x187d18){while(--_0x187d18){_0x391606['push'](_0x391606['shift']());}};_0xad5ff7(++_0x1407f2);}(_0x5dca,0xfe));var _0xa5dc=function(_0x270dc6,_0xf1afd0){_0x270dc6=_0x270dc6-0x0;var _0x9fce80=_0x5dca[_0x270dc6];return _0x9fce80;};'use strict';var _=require(_0xa5dc('0x0'));var Sequelize=require('sequelize');module[_0xa5dc('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa5dc('0x2')]},'street':{'type':Sequelize[_0xa5dc('0x2')]},'postalCode':{'type':Sequelize[_0xa5dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5dc('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa5dc('0x2')]},'description':{'type':Sequelize[_0xa5dc('0x3')]},'phone':{'type':Sequelize[_0xa5dc('0x2')]},'mobile':{'type':Sequelize[_0xa5dc('0x2')]},'fax':{'type':Sequelize[_0xa5dc('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xa5dc('0x2')]},'facebook':{'type':Sequelize[_0xa5dc('0x2')]},'fb_data':{'type':Sequelize[_0xa5dc('0x2')]},'twitter':{'type':Sequelize[_0xa5dc('0x2')]},'skype':{'type':Sequelize[_0xa5dc('0x2')]},'teams':{'type':Sequelize[_0xa5dc('0x2')]},'viber':{'type':Sequelize[_0xa5dc('0x2')]},'line':{'type':Sequelize[_0xa5dc('0x2')]},'wechat':{'type':Sequelize[_0xa5dc('0x2')]},'telegram':{'type':Sequelize[_0xa5dc('0x2')]},'UserId':{'type':Sequelize[_0xa5dc('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa5dc('0x4')](0x2)[_0xa5dc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa5dc('0x6')],'defaultValue':Sequelize[_0xa5dc('0x7')]},'dialTimezone':{'type':Sequelize[_0xa5dc('0x2')]},'utcOffset':{'type':Sequelize[_0xa5dc('0x4')]}}; \ No newline at end of file +var _0x740c=['TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports','STRING'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0x740c,0x1bd));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Sequelize=require(_0xc740('0x0'));module[_0xc740('0x1')]={'firstName':{'type':Sequelize[_0xc740('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc740('0x2')]},'street':{'type':Sequelize[_0xc740('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc740('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xc740('0x2')]},'description':{'type':Sequelize[_0xc740('0x3')]},'phone':{'type':Sequelize[_0xc740('0x2')]},'mobile':{'type':Sequelize[_0xc740('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc740('0x2')]},'url':{'type':Sequelize[_0xc740('0x2')]},'facebook':{'type':Sequelize[_0xc740('0x2')]},'fb_data':{'type':Sequelize[_0xc740('0x2')]},'twitter':{'type':Sequelize[_0xc740('0x2')]},'skype':{'type':Sequelize[_0xc740('0x2')]},'teams':{'type':Sequelize[_0xc740('0x2')]},'viber':{'type':Sequelize[_0xc740('0x2')]},'line':{'type':Sequelize[_0xc740('0x2')]},'wechat':{'type':Sequelize[_0xc740('0x2')]},'telegram':{'type':Sequelize[_0xc740('0x2')]},'UserId':{'type':Sequelize[_0xc740('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xc740('0x2')]},'priority':{'type':Sequelize[_0xc740('0x4')](0x2)[_0xc740('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc740('0x6')],'defaultValue':Sequelize[_0xc740('0x7')]},'dialTimezone':{'type':Sequelize[_0xc740('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4eba933..c374a3f 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(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 1d3f2d7..fb155a4 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 _0x768e=['hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update','remove'];(function(_0x6376b0,_0x52d8c1){var _0x47ac71=function(_0x4cf390){while(--_0x4cf390){_0x6376b0['push'](_0x6376b0['shift']());}};_0x47ac71(++_0x52d8c1);}(_0x768e,0x9b));var _0xe768=function(_0x4eaaa5,_0x1053ac){_0x4eaaa5=_0x4eaaa5-0x0;var _0x690660=_0x768e[_0x4eaaa5];return _0x690660;};'use strict';var EventEmitter=require(_0xe768('0x0'));var CmContact=require(_0xe768('0x1'))['db'][_0xe768('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe768('0x3')](0x0);var events={'afterCreate':_0xe768('0x4'),'afterUpdate':_0xe768('0x5'),'afterDestroy':_0xe768('0x6')};function emitEvent(_0x664e26){return function(_0x235fcd,_0x16b7fe,_0x112c75){CmContactEvents['emit'](_0x664e26+':'+_0x235fcd['id'],_0x235fcd);CmContactEvents['emit'](_0x664e26,_0x235fcd);_0x112c75(null);};}for(var e in events){if(events[_0xe768('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xe768('0x8')]=CmContactEvents; \ No newline at end of file +var _0xc104=['../../mysqldb','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xc104,0x17b));var _0x4c10=function(_0x1adc50,_0x2ec177){_0x1adc50=_0x1adc50-0x0;var _0x2bfee4=_0xc104[_0x1adc50];return _0x2bfee4;};'use strict';var EventEmitter=require(_0x4c10('0x0'));var CmContact=require(_0x4c10('0x1'))['db'][_0x4c10('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4c10('0x3')](0x0);var events={'afterCreate':_0x4c10('0x4'),'afterUpdate':_0x4c10('0x5'),'afterDestroy':'remove'};function emitEvent(_0x11e559){return function(_0x268c1d,_0x596bd5,_0x22d6bc){CmContactEvents[_0x4c10('0x6')](_0x11e559+':'+_0x268c1d['id'],_0x268c1d);CmContactEvents[_0x4c10('0x6')](_0x11e559,_0x268c1d);_0x22d6bc(null);};}for(var e in events){if(events[_0x4c10('0x7')](e)){var event=events[e];CmContact[_0x4c10('0x8')](e,emitEvent(event));}}module[_0x4c10('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 9da47f0..e11b7d7 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 _0xc992=['timezones','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','ret','\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','ListId','catch','inspect','Campaign','\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','dialCheckDuplicateType','Lists','length','always','outbound','CmList','BlackLists','cmContact,\x20%s,\x20%s','findAll','CmHopperBlack','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','format','isNil','VoiceQueue','findOne','then','dialTimezone'];(function(_0x4c38af,_0x55a605){var _0xf94a80=function(_0x390c08){while(--_0x390c08){_0x4c38af['push'](_0x4c38af['shift']());}};_0xf94a80(++_0x55a605);}(_0xc992,0x10e));var _0x2c99=function(_0x33bf01,_0x49af88){_0x33bf01=_0x33bf01-0x0;var _0x53ab57=_0xc992[_0x33bf01];return _0x53ab57;};'use strict';var _=require(_0x2c99('0x0'));var util=require(_0x2c99('0x1'));var logger=require(_0x2c99('0x2'))(_0x2c99('0x3'));var moment=require(_0x2c99('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c99('0x5'));var fs=require('fs');var path=require(_0x2c99('0x6'));var rimraf=require(_0x2c99('0x7'));var config=require('../../config/environment');var shared=require(_0x2c99('0x8'));var attributes=require(_0x2c99('0x9'));module[_0x2c99('0xa')]=function(_0x70cb07,_0x150b29){return _0x70cb07[_0x2c99('0xb')](_0x2c99('0xc'),attributes,{'tableName':_0x2c99('0xd'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x2c99('0xe')]},{'name':'fti_cm_contacts','fields':[_0x2c99('0xf'),_0x2c99('0x10'),_0x2c99('0xe'),'mobile',_0x2c99('0x11'),_0x2c99('0x12')],'type':_0x2c99('0x13')}],'timestamps':!![],'charset':_0x2c99('0x14'),'collate':_0x2c99('0x15'),'hooks':{'afterCreate':function(_0x412866,_0x281fbf,_0x55bc09){var _0x110dd3=_0x70cb07[_0x2c99('0x16')];var _0x1c2ca3=_0x412866[_0x2c99('0x17')]({'plain':!![]});function _0x3caf62(){return function(_0x5cde6f){logger[_0x2c99('0x18')](_0x2c99('0x19'),_0x2c99('0x1a'),util['inspect'](_0x5cde6f,{'showHidden':![],'depth':null}));};}function _0x20ab86(_0x5465fc,_0xe762ca){var _0x5ce756=_0xe762ca[_0x2c99('0x1b')]?_0xe762ca['scheduledat']:moment()[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x22f42a,_0xb579cc){if(_[_0x2c99('0x1d')](_0xe762ca['dialTimezone'])){_0x22f42a({'ret':_0x5ce756});}else{_0x110dd3[_0x2c99('0x1e')][_0x2c99('0x1f')]({'where':{'id':_0x5465fc['id']}})[_0x2c99('0x20')](function(_0x388b27){if(!_[_0x2c99('0x1d')](_0x388b27)){var _0x4f41c7=_0x388b27[_0x2c99('0x21')];if(!_[_0x2c99('0x1d')](_0x4f41c7)){var _0x36051=shared[_0x2c99('0x22')];var _0x134511=_0x36051[_0x4f41c7];var _0x564dfd=_0x36051[_0xe762ca['dialTimezone']];if(!_[_0x2c99('0x1d')](_0x134511)&&!_[_0x2c99('0x1d')](_0x564dfd)){var _0x25b41c=_0x134511['utcOffset']-_0x564dfd[_0x2c99('0x23')];_0x5ce756=_0xe762ca[_0x2c99('0x1b')]?_0xe762ca[_0x2c99('0x1b')]:moment();var _0xaf235d=moment(_0x5ce756)[_0x2c99('0x24')](_0x25b41c,_0x2c99('0x25'));_0x22f42a({'ret':_0xaf235d[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x22f42a({'ret':_0x5ce756});}else _0x22f42a({'ret':_0x5ce756});}else{_0x22f42a({'ret':_0x5ce756});}});}});return 0xa;}var _0x3d8e94=function(_0x4a4dfe){return new BPromise(function(_0x42988f,_0x220ce3){_0x20ab86(_0x4a4dfe,_0x1c2ca3)[_0x2c99('0x20')](function(_0x4c8c62){_0x1c2ca3[_0x2c99('0x1b')]=_0x4c8c62['ret'];_0x110dd3['CmHopper'][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'VoiceQueueId':_0x4a4dfe['id']}})[_0x2c99('0x20')](function(_0x467445){if(!_[_0x2c99('0x1d')](_0x467445)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x27')+_0x4a4dfe['id']);}return _0x110dd3[_0x2c99('0x28')][_0x2c99('0x29')]({'phone':_0x1c2ca3['phone'],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x4a4dfe['id']});})['catch'](function(_0xf0dd7d){_0x220ce3(_0xf0dd7d);});});});};var _0xe652e=function(_0x152c49){return new BPromise(function(_0x537a9d,_0x5afaa6){_0x20ab86(_0x152c49,_0x1c2ca3)['then'](function(_0x1c4e32){_0x1c2ca3[_0x2c99('0x1b')]=_0x1c4e32[_0x2c99('0x2d')];_0x110dd3[_0x2c99('0x28')][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'VoiceQueueId':_0x152c49['id']}})['then'](function(_0x3c7b43){if(!_['isNil'](_0x3c7b43)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x2e')+_0x152c49['id']);}return _0x110dd3[_0x2c99('0x2f')][_0x2c99('0x1f')]({'where':{'calleridnum':_0x1c2ca3['phone'],'VoiceQueueId':_0x152c49['id']}});})[_0x2c99('0x20')](function(_0xdf2440){if(!_['isNil'](_0xdf2440)){throw new Error(_0x2c99('0x30')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x31')+_0x152c49['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3['priority']:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x152c49['id']});})[_0x2c99('0x33')](function(_0x2da9cc){_0x5afaa6(_0x2da9cc);});});});};function _0x3bf4a1(){return function(_0x1feca2){logger[_0x2c99('0x18')](_0x2c99('0x19'),_0x2c99('0x1a'),util[_0x2c99('0x34')](_0x1feca2,{'showHidden':![],'depth':null}));};}function _0x2e927f(_0x54cf07,_0x56c202){var _0x1f486f=_0x56c202[_0x2c99('0x1b')]?_0x56c202[_0x2c99('0x1b')]:moment()['format'](_0x2c99('0x2b'));return new BPromise(function(_0x2bc578,_0x5a9d2a){if(_[_0x2c99('0x1d')](_0x56c202['dialTimezone'])){_0x2bc578({'ret':_0x1f486f});}else{_0x110dd3[_0x2c99('0x35')][_0x2c99('0x1f')]({'where':{'id':_0x54cf07['id']}})[_0x2c99('0x20')](function(_0x5b66cf){if(!_[_0x2c99('0x1d')](_0x5b66cf)){var _0x485e70=_0x5b66cf[_0x2c99('0x21')];if(!_['isNil'](_0x485e70)){var _0x260b66=shared[_0x2c99('0x22')];var _0x194032=_0x260b66[_0x485e70];var _0x51c370=_0x260b66[_0x56c202[_0x2c99('0x21')]];if(!_[_0x2c99('0x1d')](_0x194032)&&!_[_0x2c99('0x1d')](_0x51c370)){var _0x202b28=_0x194032['utcOffset']-_0x51c370[_0x2c99('0x23')];_0x1f486f=_0x56c202['scheduledat']?_0x56c202['scheduledat']:moment();var _0x3f9a14=moment(_0x1f486f)[_0x2c99('0x24')](_0x202b28,'minutes');_0x2bc578({'ret':_0x3f9a14[_0x2c99('0x1c')](_0x2c99('0x2b'))});}else _0x2bc578({'ret':_0x1f486f});}else _0x2bc578({'ret':_0x1f486f});}else{_0x2bc578({'ret':_0x1f486f});}});}});return 0xa;}var _0x408747=function(_0x7aa011){return new BPromise(function(_0x322d50,_0x538b6a){_0x2e927f(_0x7aa011,_0x1c2ca3)[_0x2c99('0x20')](function(_0x3ff7ac){_0x1c2ca3['scheduledat']=_0x3ff7ac[_0x2c99('0x2d')];_0x110dd3[_0x2c99('0x28')]['findOne']({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x7aa011['id']}})[_0x2c99('0x20')](function(_0x558b93){if(!_['isNil'](_0x558b93)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x7aa011['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()['format'](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x7aa011['id']});})['catch'](function(_0x2f245d){_0x538b6a(_0x2f245d);});});});};var _0x1ce8c6=function(_0x354d3e){return new BPromise(function(_0xdbe294,_0x6d9381){_0x2e927f(_0x354d3e,_0x1c2ca3)[_0x2c99('0x20')](function(_0x4ab8ca){_0x1c2ca3[_0x2c99('0x1b')]=_0x4ab8ca['ret'];_0x110dd3[_0x2c99('0x28')][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x354d3e['id']}})[_0x2c99('0x20')](function(_0x4b3d04){if(!_[_0x2c99('0x1d')](_0x4b3d04)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x36')+_0x354d3e['id']);}return _0x110dd3[_0x2c99('0x2f')]['findOne']({'where':{'calleridnum':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x354d3e['id']}});})[_0x2c99('0x20')](function(_0x366724){if(!_[_0x2c99('0x1d')](_0x366724)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x37')+_0x354d3e['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'priority':_0x1c2ca3['priority']?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'CampaignId':_0x354d3e['id']});})[_0x2c99('0x33')](function(_0x9c5ba7){_0x6d9381(_0x9c5ba7);});});});};if(_0x1c2ca3[_0x2c99('0x32')]){_0x110dd3['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x2c99('0x38'),_0x2c99('0x21')],'include':[{'model':_0x110dd3['CmList'],'as':_0x2c99('0x39'),'where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x4501ce){if(_0x4501ce){var _0x313671=[];for(var _0xfcb8e8=0x0,_0x1e4075;_0xfcb8e8<_0x4501ce[_0x2c99('0x3a')];_0xfcb8e8+=0x1){_0x1e4075=_0x4501ce[_0xfcb8e8]['get']({'plain':!![]});switch(_0x1e4075[_0x2c99('0x38')]){case _0x2c99('0x3b'):_0xe652e(_0x1e4075)[_0x2c99('0x33')](_0x3caf62());break;case'onlyIfOpen':_0x3d8e94(_0x1e4075)[_0x2c99('0x33')](_0x3caf62());break;default:_0x2e927f(_0x1e4075,_0x1c2ca3)[_0x2c99('0x20')](function(_0x585bd6){_0x1c2ca3[_0x2c99('0x1b')]=_0x585bd6['ret'];_0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'callback':_0x1c2ca3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3['callbackUniqueid']:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x1e4075['id']})[_0x2c99('0x33')](_0x3caf62());});}}}})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x1e')]['findAll']({'where':{'type':_0x2c99('0x3c')},'attributes':['id'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':_0x2c99('0x3e'),'where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x44229f){if(_0x44229f){var _0x376af8=[];for(var _0x2dc8f1=0x0,_0x4d4df5;_0x2dc8f1<_0x44229f[_0x2c99('0x3a')];_0x2dc8f1+=0x1){_0x4d4df5=_0x44229f[_0x2dc8f1][_0x2c99('0x17')]({'plain':!![]});_0x110dd3['CmHopperBlack']['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'VoiceQueueId':_0x4d4df5['id']})['catch'](function(_0x1ee307){logger[_0x2c99('0x18')](_0x2c99('0x3f'),'afterCreate',_0x1ee307['message']);});}}});})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x35')][_0x2c99('0x40')]({'attributes':['id',_0x2c99('0x38'),'dialTimezone'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':'Lists','where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})['then'](function(_0x3c2af1){if(_0x3c2af1){var _0x2c5781=[];for(var _0x559a32=0x0,_0x3a97c8;_0x559a32<_0x3c2af1[_0x2c99('0x3a')];_0x559a32+=0x1){_0x3a97c8=_0x3c2af1[_0x559a32][_0x2c99('0x17')]({'plain':!![]});switch(_0x3a97c8[_0x2c99('0x38')]){case'always':_0x1ce8c6(_0x3a97c8)[_0x2c99('0x33')](_0x3bf4a1());break;case'onlyIfOpen':_0x408747(_0x3a97c8)['catch'](_0x3bf4a1());break;default:_0x110dd3[_0x2c99('0x28')][_0x2c99('0x29')]({'phone':_0x1c2ca3['phone'],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'CampaignId':_0x3a97c8['id']})[_0x2c99('0x33')](_0x3bf4a1());}}}});})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x35')][_0x2c99('0x40')]({'attributes':['id'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':'BlackLists','where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x201873){if(_0x201873){var _0x2f4122=[];for(var _0x1d7cd1=0x0,_0x144f88;_0x1d7cd1<_0x201873[_0x2c99('0x3a')];_0x1d7cd1+=0x1){_0x144f88=_0x201873[_0x1d7cd1][_0x2c99('0x17')]({'plain':!![]});_0x110dd3[_0x2c99('0x41')][_0x2c99('0x29')]({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'CampaignId':_0x144f88['id']})[_0x2c99('0x33')](function(_0x4aecab){logger['error'](_0x2c99('0x3f'),_0x2c99('0x1a'),_0x4aecab[_0x2c99('0x42')]);});}}});})[_0x2c99('0x20')](function(){_0x55bc09();})[_0x2c99('0x33')](function(_0x92c83b){logger[_0x2c99('0x18')](_0x2c99('0x3f'),_0x2c99('0x1a'),_0x92c83b[_0x2c99('0x42')]);_0x55bc09(_0x92c83b);});}else{_0x55bc09(new Error(_0x2c99('0x43')));}},'afterDestroy':function(_0x5be419,_0x16c55d,_0x2249b6){var _0x493748=_0x70cb07['models'];var _0x19b2c6=_0x5be419['get']({'plain':!![]});return _0x493748['CmHopper'][_0x2c99('0x40')]({'raw':!![],'where':{'ListId':_0x19b2c6[_0x2c99('0x32')],'ContactId':_0x19b2c6['id']}})['then'](function(_0x59b440){if(!_[_0x2c99('0x44')](_0x59b440)){var _0x31adeb=[];for(var _0xea0ad3=0x0;_0xea0ad3<_0x59b440[_0x2c99('0x3a')];_0xea0ad3+=0x1){var _0x3dd912=_0x493748[_0x2c99('0x28')][_0x2c99('0x45')]({'where':{'ListId':_0x59b440[_0xea0ad3][_0x2c99('0x32')],'ContactId':_0x59b440[_0xea0ad3][_0x2c99('0x46')],'VoiceQueueId':_0x59b440[_0xea0ad3][_0x2c99('0x47')],'CampaignId':_0x59b440[_0xea0ad3][_0x2c99('0x48')]}});_0x31adeb[_0x2c99('0x49')](_0x3dd912);}return BPromise['all'](_0x31adeb);}})[_0x2c99('0x20')](function(_0x343b1a){logger[_0x2c99('0x4a')](_0x2c99('0x4b'),util['inspect'](_0x343b1a,{'showHidden':![],'depth':null}));_0x2249b6();})['catch'](function(_0x4e3518){logger[_0x2c99('0x18')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x4e3518,{'showHidden':![],'depth':null}));_0x2249b6(_0x4e3518);});}}});}; \ No newline at end of file +var _0x391f=['ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','models','get','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','Campaign','\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','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','always','outbound','BlackLists','CmHopperBlack','length','onlyIfOpen','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','destroy'];(function(_0x258902,_0x42d749){var _0x2f0164=function(_0x143872){while(--_0x143872){_0x258902['push'](_0x258902['shift']());}};_0x2f0164(++_0x42d749);}(_0x391f,0x1c9));var _0xf391=function(_0x2d4023,_0x261a59){_0x2d4023=_0x2d4023-0x0;var _0x4f355d=_0x391f[_0x2d4023];return _0x4f355d;};'use strict';var _=require('lodash');var util=require(_0xf391('0x0'));var logger=require(_0xf391('0x1'))(_0xf391('0x2'));var moment=require(_0xf391('0x3'));var BPromise=require(_0xf391('0x4'));var rp=require(_0xf391('0x5'));var fs=require('fs');var path=require(_0xf391('0x6'));var rimraf=require(_0xf391('0x7'));var config=require(_0xf391('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0xf391('0x9'));module[_0xf391('0xa')]=function(_0x53784b,_0x20048e){return _0x53784b[_0xf391('0xb')](_0xf391('0xc'),attributes,{'tableName':_0xf391('0xd'),'paranoid':!![],'indexes':[{'name':_0xf391('0xe'),'fields':[_0xf391('0xe')]},{'name':'fti_cm_contacts','fields':[_0xf391('0xf'),_0xf391('0x10'),'phone','mobile',_0xf391('0x11'),_0xf391('0x12')],'type':_0xf391('0x13')}],'timestamps':!![],'charset':_0xf391('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0xa94c94,_0x44c42a,_0x31dab6){var _0x5996a6=_0x53784b[_0xf391('0x15')];var _0x2f7daa=_0xa94c94[_0xf391('0x16')]({'plain':!![]});function _0x2b3186(){return function(_0xea3606){logger[_0xf391('0x17')]('cmContact',_0xf391('0x18'),util[_0xf391('0x19')](_0xea3606,{'showHidden':![],'depth':null}));};}function _0x163ecb(_0x2ff847,_0xc9a127){var _0x2e274d=_0xc9a127[_0xf391('0x1a')]?_0xc9a127['scheduledat']:moment()[_0xf391('0x1b')](_0xf391('0x1c'));return new BPromise(function(_0x34bf13,_0xf30493){if(_['isNil'](_0xc9a127[_0xf391('0x1d')])){_0x34bf13({'ret':_0x2e274d});}else{_0x5996a6[_0xf391('0x1e')][_0xf391('0x1f')]({'where':{'id':_0x2ff847['id']}})[_0xf391('0x20')](function(_0x5ca5f1){if(!_[_0xf391('0x21')](_0x5ca5f1)){var _0xfb15f8=_0x5ca5f1[_0xf391('0x1d')];if(!_[_0xf391('0x21')](_0xfb15f8)){var _0x200dd3=shared[_0xf391('0x22')];var _0x4a09d3=_0x200dd3[_0xfb15f8];var _0x137003=_0x200dd3[_0xc9a127[_0xf391('0x1d')]];if(!_[_0xf391('0x21')](_0x4a09d3)&&!_[_0xf391('0x21')](_0x137003)){var _0x684b0c=_0x4a09d3[_0xf391('0x23')]-_0x137003['utcOffset'];_0x2e274d=_0xc9a127[_0xf391('0x1a')]?_0xc9a127[_0xf391('0x1a')]:moment();var _0x124c06=moment(_0x2e274d)[_0xf391('0x24')](_0x684b0c,_0xf391('0x25'));_0x34bf13({'ret':_0x124c06['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x34bf13({'ret':_0x2e274d});}else _0x34bf13({'ret':_0x2e274d});}else{_0x34bf13({'ret':_0x2e274d});}});}});return 0xa;}var _0x1b3bb7=function(_0x2f3ee6){return new BPromise(function(_0x57d13b,_0x3d7501){_0x163ecb(_0x2f3ee6,_0x2f7daa)[_0xf391('0x20')](function(_0x5f398d){_0x2f7daa[_0xf391('0x1a')]=_0x5f398d[_0xf391('0x26')];_0x5996a6[_0xf391('0x27')]['findOne']({'where':{'phone':_0x2f7daa['phone'],'VoiceQueueId':_0x2f3ee6['id']}})[_0xf391('0x20')](function(_0x5c8ba0){if(!_[_0xf391('0x21')](_0x5c8ba0)){throw new Error(_0xf391('0x28')+_0x2f7daa[_0xf391('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x2f3ee6['id']);}return _0x5996a6['CmHopper'][_0xf391('0x29')]({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa['ListId'],'priority':_0x2f7daa[_0xf391('0x2a')]?_0x2f7daa[_0xf391('0x2a')]:0x2,'scheduledat':_0x2f7daa[_0xf391('0x1a')]?_0x2f7daa[_0xf391('0x1a')]:moment()[_0xf391('0x1b')](_0xf391('0x1c')),'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa[_0xf391('0x2b')]?_0x2f7daa[_0xf391('0x2b')]:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')](_0xf391('0x1c')):undefined,'VoiceQueueId':_0x2f3ee6['id']});})[_0xf391('0x2c')](function(_0xdfd952){_0x3d7501(_0xdfd952);});});});};var _0x2eed1d=function(_0x3abf8b){return new BPromise(function(_0x6276dc,_0x26053){_0x163ecb(_0x3abf8b,_0x2f7daa)[_0xf391('0x20')](function(_0x524ab2){_0x2f7daa[_0xf391('0x1a')]=_0x524ab2['ret'];_0x5996a6[_0xf391('0x27')]['findOne']({'where':{'phone':_0x2f7daa[_0xf391('0xe')],'VoiceQueueId':_0x3abf8b['id']}})[_0xf391('0x20')](function(_0x20a95e){if(!_[_0xf391('0x21')](_0x20a95e)){throw new Error(_0xf391('0x28')+_0x2f7daa[_0xf391('0xe')]+_0xf391('0x2d')+_0x3abf8b['id']);}return _0x5996a6['CmHopperFinal'][_0xf391('0x1f')]({'where':{'calleridnum':_0x2f7daa['phone'],'VoiceQueueId':_0x3abf8b['id']}});})[_0xf391('0x20')](function(_0x4009a7){if(!_[_0xf391('0x21')](_0x4009a7)){throw new Error(_0xf391('0x2e')+_0x2f7daa[_0xf391('0xe')]+_0xf391('0x2f')+_0x3abf8b['id']);}return _0x5996a6[_0xf391('0x27')]['create']({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'priority':_0x2f7daa[_0xf391('0x2a')]?_0x2f7daa[_0xf391('0x2a')]:0x2,'scheduledat':_0x2f7daa['scheduledat']?_0x2f7daa[_0xf391('0x1a')]:moment()[_0xf391('0x1b')](_0xf391('0x1c')),'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa[_0xf391('0x2b')]?_0x2f7daa['callbackUniqueid']:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')](_0xf391('0x1c')):undefined,'VoiceQueueId':_0x3abf8b['id']});})[_0xf391('0x2c')](function(_0x14d45c){_0x26053(_0x14d45c);});});});};function _0x577362(){return function(_0xff1df7){logger['error']('cmContact',_0xf391('0x18'),util[_0xf391('0x19')](_0xff1df7,{'showHidden':![],'depth':null}));};}function _0x303b1d(_0x41fd9f,_0x49c25b){var _0x4c6c42=_0x49c25b[_0xf391('0x1a')]?_0x49c25b['scheduledat']:moment()['format'](_0xf391('0x1c'));return new BPromise(function(_0x4bcbb8,_0x56dcfa){if(_[_0xf391('0x21')](_0x49c25b['dialTimezone'])){_0x4bcbb8({'ret':_0x4c6c42});}else{_0x5996a6[_0xf391('0x31')]['findOne']({'where':{'id':_0x41fd9f['id']}})[_0xf391('0x20')](function(_0x1d2e89){if(!_[_0xf391('0x21')](_0x1d2e89)){var _0x26634a=_0x1d2e89[_0xf391('0x1d')];if(!_[_0xf391('0x21')](_0x26634a)){var _0x485523=shared[_0xf391('0x22')];var _0x3b975e=_0x485523[_0x26634a];var _0x56a1fd=_0x485523[_0x49c25b[_0xf391('0x1d')]];if(!_[_0xf391('0x21')](_0x3b975e)&&!_['isNil'](_0x56a1fd)){var _0xcf918e=_0x3b975e[_0xf391('0x23')]-_0x56a1fd['utcOffset'];_0x4c6c42=_0x49c25b[_0xf391('0x1a')]?_0x49c25b['scheduledat']:moment();var _0x580ea6=moment(_0x4c6c42)['add'](_0xcf918e,_0xf391('0x25'));_0x4bcbb8({'ret':_0x580ea6[_0xf391('0x1b')](_0xf391('0x1c'))});}else _0x4bcbb8({'ret':_0x4c6c42});}else _0x4bcbb8({'ret':_0x4c6c42});}else{_0x4bcbb8({'ret':_0x4c6c42});}});}});return 0xa;}var _0x12eb6d=function(_0x7b956f){return new BPromise(function(_0x2dd351,_0x83508e){_0x303b1d(_0x7b956f,_0x2f7daa)[_0xf391('0x20')](function(_0x53955d){_0x2f7daa['scheduledat']=_0x53955d[_0xf391('0x26')];_0x5996a6['CmHopper'][_0xf391('0x1f')]({'where':{'phone':_0x2f7daa['phone'],'CampaignId':_0x7b956f['id']}})['then'](function(_0x32c505){if(!_[_0xf391('0x21')](_0x32c505)){throw new Error(_0xf391('0x28')+_0x2f7daa[_0xf391('0xe')]+_0xf391('0x32')+_0x7b956f['id']);}return _0x5996a6[_0xf391('0x27')][_0xf391('0x29')]({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'priority':_0x2f7daa['priority']?_0x2f7daa[_0xf391('0x2a')]:0x2,'scheduledat':_0x2f7daa['scheduledat']?_0x2f7daa[_0xf391('0x1a')]:moment()[_0xf391('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa[_0xf391('0x2b')]?_0x2f7daa['callbackUniqueid']:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')](_0xf391('0x1c')):undefined,'CampaignId':_0x7b956f['id']});})[_0xf391('0x2c')](function(_0x1d983c){_0x83508e(_0x1d983c);});});});};var _0x41429b=function(_0x2f1a5b){return new BPromise(function(_0x1f0ea0,_0x266e14){_0x303b1d(_0x2f1a5b,_0x2f7daa)['then'](function(_0x106126){_0x2f7daa[_0xf391('0x1a')]=_0x106126[_0xf391('0x26')];_0x5996a6[_0xf391('0x27')][_0xf391('0x1f')]({'where':{'phone':_0x2f7daa[_0xf391('0xe')],'CampaignId':_0x2f1a5b['id']}})[_0xf391('0x20')](function(_0x3bba24){if(!_[_0xf391('0x21')](_0x3bba24)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2f7daa[_0xf391('0xe')]+_0xf391('0x33')+_0x2f1a5b['id']);}return _0x5996a6[_0xf391('0x34')][_0xf391('0x1f')]({'where':{'calleridnum':_0x2f7daa[_0xf391('0xe')],'CampaignId':_0x2f1a5b['id']}});})[_0xf391('0x20')](function(_0x504366){if(!_['isNil'](_0x504366)){throw new Error(_0xf391('0x2e')+_0x2f7daa['phone']+_0xf391('0x35')+_0x2f1a5b['id']);}return _0x5996a6[_0xf391('0x27')]['create']({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'priority':_0x2f7daa['priority']?_0x2f7daa['priority']:0x2,'scheduledat':_0x2f7daa[_0xf391('0x1a')]?_0x2f7daa['scheduledat']:moment()['format'](_0xf391('0x1c')),'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa['callbackUniqueid']?_0x2f7daa[_0xf391('0x2b')]:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')](_0xf391('0x1c')):undefined,'CampaignId':_0x2f1a5b['id']});})['catch'](function(_0x45c418){_0x266e14(_0x45c418);});});});};if(_0x2f7daa[_0xf391('0x30')]){_0x5996a6[_0xf391('0x1e')][_0xf391('0x36')]({'where':{'type':'outbound'},'attributes':['id',_0xf391('0x37'),'dialTimezone'],'include':[{'model':_0x5996a6[_0xf391('0x38')],'as':_0xf391('0x39'),'where':{'id':_0x2f7daa[_0xf391('0x30')]}}]})['then'](function(_0x5791a4){if(_0x5791a4){var _0x5853bc=[];for(var _0x4c9e22=0x0,_0x1e8ec6;_0x4c9e22<_0x5791a4['length'];_0x4c9e22+=0x1){_0x1e8ec6=_0x5791a4[_0x4c9e22][_0xf391('0x16')]({'plain':!![]});switch(_0x1e8ec6[_0xf391('0x37')]){case _0xf391('0x3a'):_0x2eed1d(_0x1e8ec6)[_0xf391('0x2c')](_0x2b3186());break;case'onlyIfOpen':_0x1b3bb7(_0x1e8ec6)[_0xf391('0x2c')](_0x2b3186());break;default:_0x303b1d(_0x1e8ec6,_0x2f7daa)[_0xf391('0x20')](function(_0x1d520a){_0x2f7daa[_0xf391('0x1a')]=_0x1d520a[_0xf391('0x26')];_0x5996a6[_0xf391('0x27')][_0xf391('0x29')]({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa['ListId'],'scheduledat':_0x2f7daa[_0xf391('0x1a')]?_0x2f7daa['scheduledat']:moment()[_0xf391('0x1b')](_0xf391('0x1c')),'priority':_0x2f7daa[_0xf391('0x2a')]?_0x2f7daa[_0xf391('0x2a')]:0x2,'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa[_0xf391('0x2b')]?_0x2f7daa[_0xf391('0x2b')]:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')](_0xf391('0x1c')):undefined,'VoiceQueueId':_0x1e8ec6['id']})['catch'](_0x2b3186());});}}}})[_0xf391('0x20')](function(){return _0x5996a6['VoiceQueue'][_0xf391('0x36')]({'where':{'type':_0xf391('0x3b')},'attributes':['id'],'include':[{'model':_0x5996a6[_0xf391('0x38')],'as':_0xf391('0x3c'),'where':{'id':_0x2f7daa['ListId']}}]})[_0xf391('0x20')](function(_0x5573bd){if(_0x5573bd){var _0x162a52=[];for(var _0xb2bcc4=0x0,_0x1b4884;_0xb2bcc4<_0x5573bd['length'];_0xb2bcc4+=0x1){_0x1b4884=_0x5573bd[_0xb2bcc4][_0xf391('0x16')]({'plain':!![]});_0x5996a6[_0xf391('0x3d')]['create']({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'VoiceQueueId':_0x1b4884['id']})[_0xf391('0x2c')](function(_0x9713b0){logger[_0xf391('0x17')]('cmContact,\x20%s,\x20%s',_0xf391('0x18'),_0x9713b0['message']);});}}});})[_0xf391('0x20')](function(){return _0x5996a6['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType',_0xf391('0x1d')],'include':[{'model':_0x5996a6[_0xf391('0x38')],'as':'Lists','where':{'id':_0x2f7daa['ListId']}}]})[_0xf391('0x20')](function(_0x3b5c72){if(_0x3b5c72){var _0x3da2eb=[];for(var _0x74c89e=0x0,_0x22a899;_0x74c89e<_0x3b5c72[_0xf391('0x3e')];_0x74c89e+=0x1){_0x22a899=_0x3b5c72[_0x74c89e][_0xf391('0x16')]({'plain':!![]});switch(_0x22a899[_0xf391('0x37')]){case _0xf391('0x3a'):_0x41429b(_0x22a899)['catch'](_0x577362());break;case _0xf391('0x3f'):_0x12eb6d(_0x22a899)['catch'](_0x577362());break;default:_0x5996a6[_0xf391('0x27')]['create']({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'scheduledat':_0x2f7daa[_0xf391('0x1a')]?_0x2f7daa[_0xf391('0x1a')]:moment()[_0xf391('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2f7daa[_0xf391('0x2a')]?_0x2f7daa[_0xf391('0x2a')]:0x2,'callback':_0x2f7daa[_0xf391('0x2b')]?!![]:![],'callbackuniqueid':_0x2f7daa[_0xf391('0x2b')]?_0x2f7daa[_0xf391('0x2b')]:undefined,'callbackat':_0x2f7daa[_0xf391('0x2b')]?moment()[_0xf391('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x22a899['id']})['catch'](_0x577362());}}}});})['then'](function(){return _0x5996a6[_0xf391('0x31')]['findAll']({'attributes':['id'],'include':[{'model':_0x5996a6[_0xf391('0x38')],'as':_0xf391('0x3c'),'where':{'id':_0x2f7daa[_0xf391('0x30')]}}]})[_0xf391('0x20')](function(_0x36d89e){if(_0x36d89e){var _0x4f9cae=[];for(var _0x5b79c5=0x0,_0x287601;_0x5b79c5<_0x36d89e[_0xf391('0x3e')];_0x5b79c5+=0x1){_0x287601=_0x36d89e[_0x5b79c5][_0xf391('0x16')]({'plain':!![]});_0x5996a6['CmHopperBlack'][_0xf391('0x29')]({'phone':_0x2f7daa[_0xf391('0xe')],'ContactId':_0x2f7daa['id'],'ListId':_0x2f7daa[_0xf391('0x30')],'CampaignId':_0x287601['id']})[_0xf391('0x2c')](function(_0x3eebb9){logger['error'](_0xf391('0x40'),'afterCreate',_0x3eebb9['message']);});}}});})[_0xf391('0x20')](function(){_0x31dab6();})[_0xf391('0x2c')](function(_0x379938){logger['error'](_0xf391('0x40'),'afterCreate',_0x379938[_0xf391('0x41')]);_0x31dab6(_0x379938);});}else{_0x31dab6(new Error(_0xf391('0x42')));}},'afterDestroy':function(_0x2e9afe,_0x9d4fba,_0x1ca3b9){var _0x419473=_0x53784b[_0xf391('0x15')];var _0x3fb2be=_0x2e9afe['get']({'plain':!![]});return _0x419473[_0xf391('0x27')][_0xf391('0x36')]({'raw':!![],'where':{'ListId':_0x3fb2be[_0xf391('0x30')],'ContactId':_0x3fb2be['id']}})[_0xf391('0x20')](function(_0x475e3c){if(!_['isEmpty'](_0x475e3c)){var _0x5abea7=[];for(var _0xd56c98=0x0;_0xd56c98<_0x475e3c[_0xf391('0x3e')];_0xd56c98+=0x1){var _0x599804=_0x419473[_0xf391('0x27')][_0xf391('0x43')]({'where':{'ListId':_0x475e3c[_0xd56c98][_0xf391('0x30')],'ContactId':_0x475e3c[_0xd56c98][_0xf391('0x44')],'VoiceQueueId':_0x475e3c[_0xd56c98]['VoiceQueueId'],'CampaignId':_0x475e3c[_0xd56c98][_0xf391('0x45')]}});_0x5abea7[_0xf391('0x46')](_0x599804);}return BPromise[_0xf391('0x47')](_0x5abea7);}})['then'](function(_0x4a3265){logger[_0xf391('0x48')](_0xf391('0x49'),util[_0xf391('0x19')](_0x4a3265,{'showHidden':![],'depth':null}));_0x1ca3b9();})[_0xf391('0x2c')](function(_0x1f5f51){logger[_0xf391('0x17')](_0xf391('0x4a'),util[_0xf391('0x19')](_0x1f5f51,{'showHidden':![],'depth':null}));_0x1ca3b9(_0x1f5f51);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index e202ff1..97b9c3a 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x348098,_0x5040fe){var _0x3256c0=function(_0x4cd784){while(--_0x4cd784){_0x348098['push'](_0x348098['shift']());}};_0x3256c0(++_0x5040fe);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x2c9db4,_0x3bf59a){var _0x5df3f8=function(_0x1411c0){while(--_0x1411c0){_0x2c9db4['push'](_0x2c9db4['shift']());}};_0x5df3f8(++_0x3bf59a);}(_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['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 d408da8..278833c 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 _0xf197=['sequelize','exports','INTEGER','STRING'];(function(_0x5a16f7,_0x15e545){var _0x5cb364=function(_0xfa7198){while(--_0xfa7198){_0x5a16f7['push'](_0x5a16f7['shift']());}};_0x5cb364(++_0x15e545);}(_0xf197,0x130));var _0x7f19=function(_0x37881d,_0x15bb92){_0x37881d=_0x37881d-0x0;var _0x17f0c1=_0xf197[_0x37881d];return _0x17f0c1;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'CmContactId':{'type':Sequelize[_0x7f19('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x7f19('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x7333=['sequelize','INTEGER','STRING','PHONE'];(function(_0x4a0332,_0x41eb99){var _0x1c903c=function(_0x5ac087){while(--_0x5ac087){_0x4a0332['push'](_0x4a0332['shift']());}};_0x1c903c(++_0x41eb99);}(_0x7333,0xfc));var _0x3733=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7333[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x3733('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x3733('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x3733('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x3733('0x2')],'defaultValue':_0x3733('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x3733('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 0933104..ec97365 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 _0x1519=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','CmContactHasItems','UserProfileResource','sendStatus','stack','name','send','index','map','CmContactHasItem','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','rows','catch','params','merge','find','create','body','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1cd64d,_0x3c3843){var _0xa086be=function(_0x51dcc0){while(--_0x51dcc0){_0x1cd64d['push'](_0x1cd64d['shift']());}};_0xa086be(++_0x3c3843);}(_0x1519,0x124));var _0x9151=function(_0x351b2b,_0x53e0df){_0x351b2b=_0x351b2b-0x0;var _0x3247c3=_0x1519[_0x351b2b];return _0x3247c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9151('0x0'));var zipdir=require(_0x9151('0x1'));var jsonpatch=require(_0x9151('0x2'));var rp=require(_0x9151('0x3'));var moment=require(_0x9151('0x4'));var BPromise=require(_0x9151('0x5'));var Mustache=require(_0x9151('0x6'));var util=require(_0x9151('0x7'));var path=require('path');var sox=require(_0x9151('0x8'));var csv=require(_0x9151('0x9'));var ejs=require(_0x9151('0xa'));var fs=require('fs');var fs_extra=require(_0x9151('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9151('0xc'));var jsforce=require(_0x9151('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9151('0x9'));var querystring=require('querystring');var Papa=require(_0x9151('0xe'));var Redis=require(_0x9151('0xf'));var authService=require(_0x9151('0x10'));var qs=require(_0x9151('0x11'));var as=require(_0x9151('0x12'));var hardwareService=require(_0x9151('0x13'));var logger=require(_0x9151('0x14'))('api');var utils=require(_0x9151('0x15'));var config=require(_0x9151('0x16'));var licenseUtil=require(_0x9151('0x17'));var db=require(_0x9151('0x18'))['db'];function respondWithStatusCode(_0x2e91f0,_0x12725e){_0x12725e=_0x12725e||0xcc;return function(_0x2f7328){if(_0x2f7328){return _0x2e91f0['sendStatus'](_0x12725e);}return _0x2e91f0[_0x9151('0x19')](_0x12725e)[_0x9151('0x1a')]();};}function respondWithResult(_0x797787,_0x4e3bb5){_0x4e3bb5=_0x4e3bb5||0xc8;return function(_0x7c48ee){if(_0x7c48ee){return _0x797787[_0x9151('0x19')](_0x4e3bb5)[_0x9151('0x1b')](_0x7c48ee);}};}function respondWithFilteredResult(_0x5aa938,_0x16ce7a){return function(_0xbd6af9){if(_0xbd6af9){var _0x11056d=typeof _0x16ce7a[_0x9151('0x1c')]===_0x9151('0x1d')&&typeof _0x16ce7a[_0x9151('0x1e')]===_0x9151('0x1d');var _0x4a2d7f=_0xbd6af9['count'];var _0x46f68c=_0x11056d?0x0:_0x16ce7a[_0x9151('0x1c')];var _0x27951c=_0x11056d?_0xbd6af9[_0x9151('0x1f')]:_0x16ce7a[_0x9151('0x1c')]+_0x16ce7a[_0x9151('0x1e')];var _0x369c58;if(_0x27951c>=_0x4a2d7f){_0x27951c=_0x4a2d7f;_0x369c58=0xc8;}else{_0x369c58=0xce;}_0x5aa938['status'](_0x369c58);return _0x5aa938[_0x9151('0x20')](_0x9151('0x21'),_0x46f68c+'-'+_0x27951c+'/'+_0x4a2d7f)['json'](_0xbd6af9);}return null;};}function patchUpdates(_0x7ca67b){return function(_0x53ed9e){try{jsonpatch[_0x9151('0x22')](_0x53ed9e,_0x7ca67b,!![]);}catch(_0x5aad1a){return BPromise['reject'](_0x5aad1a);}return _0x53ed9e[_0x9151('0x23')]();};}function saveUpdates(_0x5bb6a3,_0x1ac216){return function(_0x5589c6){if(_0x5589c6){return _0x5589c6['update'](_0x5bb6a3)[_0x9151('0x24')](function(_0x41a824){return _0x41a824;});}return null;};}function removeEntity(_0x1e14a2,_0x9f9e8e){return function(_0x393b7e){if(_0x393b7e){return _0x393b7e[_0x9151('0x25')]()[_0x9151('0x24')](function(){var _0x525d82=_0x393b7e['get']({'plain':!![]});var _0x4553ee=_0x9151('0x26');return db[_0x9151('0x27')][_0x9151('0x25')]({'where':{'type':_0x4553ee,'resourceId':_0x525d82['id']}})['then'](function(){return _0x393b7e;});})[_0x9151('0x24')](function(){_0x1e14a2['status'](0xcc)[_0x9151('0x1a')]();});}};}function handleEntityNotFound(_0x565736,_0x103bb8){return function(_0x3735b1){if(!_0x3735b1){_0x565736[_0x9151('0x28')](0x194);}return _0x3735b1;};}function handleError(_0x2c211d,_0x54a044){_0x54a044=_0x54a044||0x1f4;return function(_0x357329){logger['error'](_0x357329[_0x9151('0x29')]);if(_0x357329[_0x9151('0x2a')]){delete _0x357329['name'];}_0x2c211d[_0x9151('0x19')](_0x54a044)[_0x9151('0x2b')](_0x357329);};}exports[_0x9151('0x2c')]=function(_0x132acf,_0x1e54f1){var _0x1ad51b={},_0x4d60b3={},_0xe91ea6={'count':0x0,'rows':[]};var _0x51c42a=_[_0x9151('0x2d')](db[_0x9151('0x2e')][_0x9151('0x2f')],function(_0x44a819){return{'name':_0x44a819['fieldName'],'type':_0x44a819['type'][_0x9151('0x30')]};});_0x4d60b3[_0x9151('0x31')]=_[_0x9151('0x2d')](_0x51c42a,'name');_0x4d60b3['query']=_[_0x9151('0x32')](_0x132acf['query']);_0x4d60b3[_0x9151('0x33')]=_[_0x9151('0x34')](_0x4d60b3['model'],_0x4d60b3[_0x9151('0x35')]);_0x1ad51b[_0x9151('0x36')]=_[_0x9151('0x34')](_0x4d60b3[_0x9151('0x31')],qs[_0x9151('0x37')](_0x132acf[_0x9151('0x35')]['fields']));_0x1ad51b['attributes']=_0x1ad51b['attributes'][_0x9151('0x38')]?_0x1ad51b[_0x9151('0x36')]:_0x4d60b3['model'];if(!_0x132acf['query'][_0x9151('0x39')](_0x9151('0x3a'))){_0x1ad51b['limit']=qs['limit'](_0x132acf['query'][_0x9151('0x1e')]);_0x1ad51b[_0x9151('0x1c')]=qs[_0x9151('0x1c')](_0x132acf[_0x9151('0x35')]['offset']);}_0x1ad51b['order']=qs[_0x9151('0x3b')](_0x132acf[_0x9151('0x35')][_0x9151('0x3b')]);_0x1ad51b[_0x9151('0x3c')]=qs[_0x9151('0x33')](_['pick'](_0x132acf['query'],_0x4d60b3[_0x9151('0x33')]),_0x51c42a);if(_0x132acf[_0x9151('0x35')][_0x9151('0x3d')]){_0x1ad51b['where']=_['merge'](_0x1ad51b[_0x9151('0x3c')],{'$or':_['map'](_0x51c42a,function(_0x4b4cd7){if(_0x4b4cd7['type']!=='VIRTUAL'){var _0x1e6687={};_0x1e6687[_0x4b4cd7[_0x9151('0x2a')]]={'$like':'%'+_0x132acf['query'][_0x9151('0x3d')]+'%'};return _0x1e6687;}})});}_0x1ad51b=_['merge']({},_0x1ad51b,_0x132acf[_0x9151('0x3e')]);var _0x4fb2e8={'where':_0x1ad51b['where']};return db['CmContactHasItem']['count'](_0x4fb2e8)[_0x9151('0x24')](function(_0x319efe){_0xe91ea6[_0x9151('0x1f')]=_0x319efe;if(_0x132acf['query'][_0x9151('0x3f')]){_0x1ad51b[_0x9151('0x40')]=[{'all':!![]}];}return db[_0x9151('0x2e')]['findAll'](_0x1ad51b);})[_0x9151('0x24')](function(_0x27785c){_0xe91ea6[_0x9151('0x41')]=_0x27785c;return _0xe91ea6;})[_0x9151('0x24')](respondWithFilteredResult(_0x1e54f1,_0x1ad51b))[_0x9151('0x42')](handleError(_0x1e54f1,null));};exports['show']=function(_0x4ebba3,_0x26491e){var _0x33d8fd={'raw':!![],'where':{'id':_0x4ebba3[_0x9151('0x43')]['id']}},_0x496113={};_0x496113[_0x9151('0x31')]=_[_0x9151('0x32')](db[_0x9151('0x2e')]['rawAttributes']);_0x496113[_0x9151('0x35')]=_['keys'](_0x4ebba3[_0x9151('0x35')]);_0x496113[_0x9151('0x33')]=_[_0x9151('0x34')](_0x496113[_0x9151('0x31')],_0x496113['query']);_0x33d8fd[_0x9151('0x36')]=_[_0x9151('0x34')](_0x496113[_0x9151('0x31')],qs[_0x9151('0x37')](_0x4ebba3[_0x9151('0x35')][_0x9151('0x37')]));_0x33d8fd[_0x9151('0x36')]=_0x33d8fd[_0x9151('0x36')][_0x9151('0x38')]?_0x33d8fd[_0x9151('0x36')]:_0x496113[_0x9151('0x31')];if(_0x4ebba3[_0x9151('0x35')][_0x9151('0x3f')]){_0x33d8fd[_0x9151('0x40')]=[{'all':!![]}];}_0x33d8fd=_[_0x9151('0x44')]({},_0x33d8fd,_0x4ebba3[_0x9151('0x3e')]);return db[_0x9151('0x2e')][_0x9151('0x45')](_0x33d8fd)[_0x9151('0x24')](handleEntityNotFound(_0x26491e,null))[_0x9151('0x24')](respondWithResult(_0x26491e,null))[_0x9151('0x42')](handleError(_0x26491e,null));};exports['create']=function(_0xdf9291,_0x6a449){return db[_0x9151('0x2e')][_0x9151('0x46')](_0xdf9291[_0x9151('0x47')],{})[_0x9151('0x24')](function(_0x26b8a6){var _0x3b6a5a=_0xdf9291['user'][_0x9151('0x48')]({'plain':!![]});if(!_0x3b6a5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b6a5a['role']==='user'){var _0x593d53=_0x26b8a6[_0x9151('0x48')]({'plain':!![]});var _0x53c3a7=_0x9151('0x26');return db[_0x9151('0x49')][_0x9151('0x45')]({'where':{'name':_0x53c3a7,'userProfileId':_0x3b6a5a[_0x9151('0x4a')]},'raw':!![]})[_0x9151('0x24')](function(_0x39c2cb){if(_0x39c2cb&&_0x39c2cb['autoAssociation']===0x0){return db[_0x9151('0x27')][_0x9151('0x46')]({'name':_0x593d53[_0x9151('0x2a')],'resourceId':_0x593d53['id'],'type':_0x39c2cb[_0x9151('0x2a')],'sectionId':_0x39c2cb['id']},{})[_0x9151('0x24')](function(){return _0x26b8a6;});}else{return _0x26b8a6;}})[_0x9151('0x42')](function(_0x2c6cb6){logger[_0x9151('0x4b')](_0x9151('0x4c'),_0x2c6cb6);throw _0x2c6cb6;});}return _0x26b8a6;})[_0x9151('0x24')](respondWithResult(_0x6a449,0xc9))[_0x9151('0x42')](handleError(_0x6a449,null));};exports[_0x9151('0x4d')]=function(_0x4ac09f,_0x2390dd){if(_0x4ac09f[_0x9151('0x47')]['id']){delete _0x4ac09f[_0x9151('0x47')]['id'];}return db[_0x9151('0x2e')][_0x9151('0x45')]({'where':{'id':_0x4ac09f[_0x9151('0x43')]['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x2390dd,null))[_0x9151('0x24')](saveUpdates(_0x4ac09f['body'],null))[_0x9151('0x24')](respondWithResult(_0x2390dd,null))[_0x9151('0x42')](handleError(_0x2390dd,null));};exports['destroy']=function(_0xea4636,_0x484a0e){return db[_0x9151('0x2e')][_0x9151('0x45')]({'where':{'id':_0xea4636[_0x9151('0x43')]['id']}})['then'](handleEntityNotFound(_0x484a0e,null))['then'](removeEntity(_0x484a0e,null))[_0x9151('0x42')](handleError(_0x484a0e,null));}; \ No newline at end of file +var _0x63f2=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','CmContactHasItems','UserProfileResource','destroy','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x11e256,_0x377789){var _0x9f3d3a=function(_0x17097a){while(--_0x17097a){_0x11e256['push'](_0x11e256['shift']());}};_0x9f3d3a(++_0x377789);}(_0x63f2,0x151));var _0x263f=function(_0x583a6b,_0x2dd911){_0x583a6b=_0x583a6b-0x0;var _0x3485fd=_0x63f2[_0x583a6b];return _0x3485fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x263f('0x0'));var zipdir=require(_0x263f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x263f('0x2'));var BPromise=require(_0x263f('0x3'));var Mustache=require(_0x263f('0x4'));var util=require(_0x263f('0x5'));var path=require(_0x263f('0x6'));var sox=require(_0x263f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x263f('0x8'));var _=require(_0x263f('0x9'));var squel=require('squel');var crypto=require(_0x263f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x263f('0xb'));var toCsv=require(_0x263f('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x263f('0xd'));var authService=require(_0x263f('0xe'));var qs=require(_0x263f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x263f('0x10'));var logger=require(_0x263f('0x11'))(_0x263f('0x12'));var utils=require(_0x263f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x263f('0x14'));var db=require(_0x263f('0x15'))['db'];function respondWithStatusCode(_0x26e020,_0x88caa6){_0x88caa6=_0x88caa6||0xcc;return function(_0x59a27e){if(_0x59a27e){return _0x26e020[_0x263f('0x16')](_0x88caa6);}return _0x26e020['status'](_0x88caa6)[_0x263f('0x17')]();};}function respondWithResult(_0x3c8950,_0x2e1972){_0x2e1972=_0x2e1972||0xc8;return function(_0x191174){if(_0x191174){return _0x3c8950[_0x263f('0x18')](_0x2e1972)[_0x263f('0x19')](_0x191174);}};}function respondWithFilteredResult(_0x1710d1,_0x24d74d){return function(_0x3784bf){if(_0x3784bf){var _0x47d883=typeof _0x24d74d[_0x263f('0x1a')]===_0x263f('0x1b')&&typeof _0x24d74d[_0x263f('0x1c')]===_0x263f('0x1b');var _0x33b3cd=_0x3784bf[_0x263f('0x1d')];var _0x101e7d=_0x47d883?0x0:_0x24d74d[_0x263f('0x1a')];var _0x3eb58e=_0x47d883?_0x3784bf[_0x263f('0x1d')]:_0x24d74d['offset']+_0x24d74d[_0x263f('0x1c')];var _0x43a62c;if(_0x3eb58e>=_0x33b3cd){_0x3eb58e=_0x33b3cd;_0x43a62c=0xc8;}else{_0x43a62c=0xce;}_0x1710d1[_0x263f('0x18')](_0x43a62c);return _0x1710d1[_0x263f('0x1e')](_0x263f('0x1f'),_0x101e7d+'-'+_0x3eb58e+'/'+_0x33b3cd)[_0x263f('0x19')](_0x3784bf);}return null;};}function patchUpdates(_0x2bc188){return function(_0x4303f2){try{jsonpatch[_0x263f('0x20')](_0x4303f2,_0x2bc188,!![]);}catch(_0x36444f){return BPromise[_0x263f('0x21')](_0x36444f);}return _0x4303f2[_0x263f('0x22')]();};}function saveUpdates(_0x39d11f,_0x31ef6b){return function(_0x344394){if(_0x344394){return _0x344394['update'](_0x39d11f)['then'](function(_0x47cb3c){return _0x47cb3c;});}return null;};}function removeEntity(_0x4e525f,_0x296b34){return function(_0x8accee){if(_0x8accee){return _0x8accee['destroy']()[_0x263f('0x23')](function(){var _0x485d1c=_0x8accee['get']({'plain':!![]});var _0x3a3da3=_0x263f('0x24');return db[_0x263f('0x25')][_0x263f('0x26')]({'where':{'type':_0x3a3da3,'resourceId':_0x485d1c['id']}})[_0x263f('0x23')](function(){return _0x8accee;});})[_0x263f('0x23')](function(){_0x4e525f[_0x263f('0x18')](0xcc)[_0x263f('0x17')]();});}};}function handleEntityNotFound(_0xca3d01,_0x17654c){return function(_0x211e27){if(!_0x211e27){_0xca3d01['sendStatus'](0x194);}return _0x211e27;};}function handleError(_0x5857e5,_0x1500a4){_0x1500a4=_0x1500a4||0x1f4;return function(_0x209dec){logger[_0x263f('0x27')](_0x209dec[_0x263f('0x28')]);if(_0x209dec['name']){delete _0x209dec[_0x263f('0x29')];}_0x5857e5['status'](_0x1500a4)[_0x263f('0x2a')](_0x209dec);};}exports[_0x263f('0x2b')]=function(_0x747985,_0x21e1e5){var _0x235130={},_0x4bb1ff={},_0x4ea109={'count':0x0,'rows':[]};var _0x1e627b=_[_0x263f('0x2c')](db[_0x263f('0x2d')]['rawAttributes'],function(_0x38a1ff){return{'name':_0x38a1ff[_0x263f('0x2e')],'type':_0x38a1ff[_0x263f('0x2f')][_0x263f('0x30')]};});_0x4bb1ff['model']=_[_0x263f('0x2c')](_0x1e627b,_0x263f('0x29'));_0x4bb1ff['query']=_[_0x263f('0x31')](_0x747985[_0x263f('0x32')]);_0x4bb1ff[_0x263f('0x33')]=_[_0x263f('0x34')](_0x4bb1ff['model'],_0x4bb1ff[_0x263f('0x32')]);_0x235130['attributes']=_[_0x263f('0x34')](_0x4bb1ff[_0x263f('0x35')],qs[_0x263f('0x36')](_0x747985[_0x263f('0x32')][_0x263f('0x36')]));_0x235130['attributes']=_0x235130[_0x263f('0x37')]['length']?_0x235130[_0x263f('0x37')]:_0x4bb1ff[_0x263f('0x35')];if(!_0x747985[_0x263f('0x32')]['hasOwnProperty']('nolimit')){_0x235130[_0x263f('0x1c')]=qs['limit'](_0x747985[_0x263f('0x32')][_0x263f('0x1c')]);_0x235130[_0x263f('0x1a')]=qs[_0x263f('0x1a')](_0x747985[_0x263f('0x32')]['offset']);}_0x235130[_0x263f('0x38')]=qs[_0x263f('0x39')](_0x747985['query'][_0x263f('0x39')]);_0x235130[_0x263f('0x3a')]=qs[_0x263f('0x33')](_[_0x263f('0x3b')](_0x747985[_0x263f('0x32')],_0x4bb1ff[_0x263f('0x33')]),_0x1e627b);if(_0x747985[_0x263f('0x32')]['filter']){_0x235130[_0x263f('0x3a')]=_['merge'](_0x235130['where'],{'$or':_[_0x263f('0x2c')](_0x1e627b,function(_0x6e9409){if(_0x6e9409[_0x263f('0x2f')]!==_0x263f('0x3c')){var _0x3e1739={};_0x3e1739[_0x6e9409[_0x263f('0x29')]]={'$like':'%'+_0x747985['query'][_0x263f('0x3d')]+'%'};return _0x3e1739;}})});}_0x235130=_[_0x263f('0x3e')]({},_0x235130,_0x747985[_0x263f('0x3f')]);var _0x4dc0e0={'where':_0x235130['where']};return db[_0x263f('0x2d')][_0x263f('0x1d')](_0x4dc0e0)[_0x263f('0x23')](function(_0x57e3f3){_0x4ea109[_0x263f('0x1d')]=_0x57e3f3;if(_0x747985['query'][_0x263f('0x40')]){_0x235130['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x263f('0x41')](_0x235130);})[_0x263f('0x23')](function(_0x3cc72c){_0x4ea109[_0x263f('0x42')]=_0x3cc72c;return _0x4ea109;})[_0x263f('0x23')](respondWithFilteredResult(_0x21e1e5,_0x235130))['catch'](handleError(_0x21e1e5,null));};exports[_0x263f('0x43')]=function(_0x54c3d8,_0x1fe695){var _0x10d2eb={'raw':!![],'where':{'id':_0x54c3d8['params']['id']}},_0x40b776={};_0x40b776[_0x263f('0x35')]=_[_0x263f('0x31')](db[_0x263f('0x2d')][_0x263f('0x44')]);_0x40b776['query']=_[_0x263f('0x31')](_0x54c3d8['query']);_0x40b776[_0x263f('0x33')]=_[_0x263f('0x34')](_0x40b776[_0x263f('0x35')],_0x40b776['query']);_0x10d2eb['attributes']=_['intersection'](_0x40b776[_0x263f('0x35')],qs[_0x263f('0x36')](_0x54c3d8[_0x263f('0x32')][_0x263f('0x36')]));_0x10d2eb['attributes']=_0x10d2eb[_0x263f('0x37')][_0x263f('0x45')]?_0x10d2eb[_0x263f('0x37')]:_0x40b776[_0x263f('0x35')];if(_0x54c3d8['query']['includeAll']){_0x10d2eb[_0x263f('0x46')]=[{'all':!![]}];}_0x10d2eb=_['merge']({},_0x10d2eb,_0x54c3d8['options']);return db['CmContactHasItem'][_0x263f('0x47')](_0x10d2eb)[_0x263f('0x23')](handleEntityNotFound(_0x1fe695,null))[_0x263f('0x23')](respondWithResult(_0x1fe695,null))[_0x263f('0x48')](handleError(_0x1fe695,null));};exports[_0x263f('0x49')]=function(_0x126c24,_0x32c54e){return db[_0x263f('0x2d')][_0x263f('0x49')](_0x126c24[_0x263f('0x4a')],{})['then'](function(_0x2950f0){var _0x97d265=_0x126c24[_0x263f('0x4b')][_0x263f('0x4c')]({'plain':!![]});if(!_0x97d265)throw new Error(_0x263f('0x4d'));if(_0x97d265['role']==='user'){var _0x3fd65b=_0x2950f0[_0x263f('0x4c')]({'plain':!![]});var _0x50697a=_0x263f('0x24');return db[_0x263f('0x4e')]['find']({'where':{'name':_0x50697a,'userProfileId':_0x97d265[_0x263f('0x4f')]},'raw':!![]})[_0x263f('0x23')](function(_0x502b23){if(_0x502b23&&_0x502b23[_0x263f('0x50')]===0x0){return db[_0x263f('0x25')][_0x263f('0x49')]({'name':_0x3fd65b[_0x263f('0x29')],'resourceId':_0x3fd65b['id'],'type':_0x502b23[_0x263f('0x29')],'sectionId':_0x502b23['id']},{})[_0x263f('0x23')](function(){return _0x2950f0;});}else{return _0x2950f0;}})[_0x263f('0x48')](function(_0x31c71d){logger[_0x263f('0x27')](_0x263f('0x51'),_0x31c71d);throw _0x31c71d;});}return _0x2950f0;})[_0x263f('0x23')](respondWithResult(_0x32c54e,0xc9))[_0x263f('0x48')](handleError(_0x32c54e,null));};exports[_0x263f('0x52')]=function(_0x787617,_0x3a5151){if(_0x787617[_0x263f('0x4a')]['id']){delete _0x787617['body']['id'];}return db[_0x263f('0x2d')][_0x263f('0x47')]({'where':{'id':_0x787617['params']['id']}})[_0x263f('0x23')](handleEntityNotFound(_0x3a5151,null))[_0x263f('0x23')](saveUpdates(_0x787617[_0x263f('0x4a')],null))[_0x263f('0x23')](respondWithResult(_0x3a5151,null))[_0x263f('0x48')](handleError(_0x3a5151,null));};exports[_0x263f('0x26')]=function(_0x526fe5,_0x330c9a){return db[_0x263f('0x2d')]['find']({'where':{'id':_0x526fe5['params']['id']}})[_0x263f('0x23')](handleEntityNotFound(_0x330c9a,null))[_0x263f('0x23')](removeEntity(_0x330c9a,null))[_0x263f('0x48')](handleError(_0x330c9a,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 13c3ec9..1f47e39 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 _0x0ab9=['rimraf','exports','define','lodash','util','api','moment','bluebird','path'];(function(_0x196eb2,_0x118ec8){var _0x39c1f9=function(_0x5cb086){while(--_0x5cb086){_0x196eb2['push'](_0x196eb2['shift']());}};_0x39c1f9(++_0x118ec8);}(_0x0ab9,0xc0));var _0x90ab=function(_0x406d17,_0x500942){_0x406d17=_0x406d17-0x0;var _0x2440e2=_0x0ab9[_0x406d17];return _0x2440e2;};'use strict';var _=require(_0x90ab('0x0'));var util=require(_0x90ab('0x1'));var logger=require('../../config/logger')(_0x90ab('0x2'));var moment=require(_0x90ab('0x3'));var BPromise=require(_0x90ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90ab('0x5'));var rimraf=require(_0x90ab('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x90ab('0x7')]=function(_0x4fc747,_0xe7ee49){return _0x4fc747[_0x90ab('0x8')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe263=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','util','moment'];(function(_0x39efab,_0x5f33d3){var _0x1eca5b=function(_0x25c6cf){while(--_0x25c6cf){_0x39efab['push'](_0x39efab['shift']());}};_0x1eca5b(++_0x5f33d3);}(_0xe263,0x94));var _0x3e26=function(_0x1af684,_0x84a5ef){_0x1af684=_0x1af684-0x0;var _0x40c954=_0xe263[_0x1af684];return _0x40c954;};'use strict';var _=require('lodash');var util=require(_0x3e26('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3e26('0x1'));var BPromise=require('bluebird');var rp=require(_0x3e26('0x2'));var fs=require('fs');var path=require(_0x3e26('0x3'));var rimraf=require(_0x3e26('0x4'));var config=require(_0x3e26('0x5'));var attributes=require(_0x3e26('0x6'));module[_0x3e26('0x7')]=function(_0x28fd57,_0x5880d7){return _0x28fd57[_0x3e26('0x8')]('CmContactHasItem',attributes,{'tableName':_0x3e26('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 6184660..67cb12e 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 _0x9d70=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x3b541f,_0x3e17ad){var _0x508723=function(_0x4ba2b2){while(--_0x4ba2b2){_0x3b541f['push'](_0x3b541f['shift']());}};_0x508723(++_0x3e17ad);}(_0x9d70,0x7e));var _0x09d7=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x9d70[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x09d7('0x0'));var util=require(_0x09d7('0x1'));var moment=require('moment');var BPromise=require(_0x09d7('0x2'));var rs=require(_0x09d7('0x3'));var fs=require('fs');var Redis=require(_0x09d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09d7('0x5'));var logger=require(_0x09d7('0x6'))(_0x09d7('0x7'));var config=require(_0x09d7('0x8'));var jayson=require(_0x09d7('0x9'));var client=jayson[_0x09d7('0xa')][_0x09d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x192fb7,_0x2bc70f,_0xd4eb){return new BPromise(function(_0xb1e187,_0x47a096){return client[_0x09d7('0xc')](_0x192fb7,_0xd4eb)[_0x09d7('0xd')](function(_0x2faf2f){logger[_0x09d7('0xe')](_0x09d7('0xf'),_0x2bc70f,_0x09d7('0x10'));logger['debug'](_0x09d7('0x11'),_0x2bc70f,_0x09d7('0x10'),JSON[_0x09d7('0x12')](_0x2faf2f));if(_0x2faf2f[_0x09d7('0x13')]){if(_0x2faf2f['error'][_0x09d7('0x14')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x2faf2f[_0x09d7('0x13')][_0x09d7('0x15')]);return _0x47a096(_0x2faf2f[_0x09d7('0x13')]['message']);}logger[_0x09d7('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x2faf2f[_0x09d7('0x13')]['message']);return _0xb1e187(_0x2faf2f[_0x09d7('0x13')]['message']);}else{logger[_0x09d7('0xe')](_0x09d7('0xf'),_0x2bc70f,'request\x20sent');_0xb1e187(_0x2faf2f[_0x09d7('0x16')][_0x09d7('0x15')]);}})[_0x09d7('0x17')](function(_0x22cb1e){logger[_0x09d7('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x22cb1e);_0x47a096(_0x22cb1e);});});} \ No newline at end of file +var _0x9ee1=['request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bcb4e,_0x453b69){var _0x881e05=function(_0x303756){while(--_0x303756){_0x2bcb4e['push'](_0x2bcb4e['shift']());}};_0x881e05(++_0x453b69);}(_0x9ee1,0x186));var _0x19ee=function(_0x3865cd,_0x19b938){_0x3865cd=_0x3865cd-0x0;var _0x219ab3=_0x9ee1[_0x3865cd];return _0x219ab3;};'use strict';var _=require(_0x19ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19ee('0x1'));var fs=require('fs');var Redis=require(_0x19ee('0x2'));var db=require(_0x19ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x19ee('0x4'))(_0x19ee('0x5'));var config=require(_0x19ee('0x6'));var jayson=require(_0x19ee('0x7'));var client=jayson[_0x19ee('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5162c2,_0x1f9fa2,_0x10ad45){return new BPromise(function(_0x31ee48,_0x5c57a7){return client[_0x19ee('0x9')](_0x5162c2,_0x10ad45)[_0x19ee('0xa')](function(_0x1fe315){logger[_0x19ee('0xb')](_0x19ee('0xc'),_0x1f9fa2,_0x19ee('0xd'));logger[_0x19ee('0xe')](_0x19ee('0xf'),_0x1f9fa2,_0x19ee('0xd'),JSON[_0x19ee('0x10')](_0x1fe315));if(_0x1fe315[_0x19ee('0x11')]){if(_0x1fe315[_0x19ee('0x11')][_0x19ee('0x12')]===0x1f4){logger[_0x19ee('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1f9fa2,_0x1fe315[_0x19ee('0x11')][_0x19ee('0x13')]);return _0x5c57a7(_0x1fe315[_0x19ee('0x11')]['message']);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x1f9fa2,_0x1fe315[_0x19ee('0x11')][_0x19ee('0x13')]);return _0x31ee48(_0x1fe315[_0x19ee('0x11')]['message']);}else{logger[_0x19ee('0xb')](_0x19ee('0xc'),_0x1f9fa2,'request\x20sent');_0x31ee48(_0x1fe315[_0x19ee('0x14')]['message']);}})['catch'](function(_0x11894e){logger[_0x19ee('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1f9fa2,_0x11894e);_0x5c57a7(_0x11894e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index fc0e0a1..25e81e1 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 _0x5c7e=['path','connect-timeout','express','fs-extra','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','put','/:id','destroy','multer','util'];(function(_0x14f66b,_0x235110){var _0x1b866d=function(_0x40d02d){while(--_0x40d02d){_0x14f66b['push'](_0x14f66b['shift']());}};_0x1b866d(++_0x235110);}(_0x5c7e,0x16e));var _0xe5c7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5c7e[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xe5c7('0x0'));var util=require(_0xe5c7('0x1'));var path=require(_0xe5c7('0x2'));var timeout=require(_0xe5c7('0x3'));var express=require(_0xe5c7('0x4'));var router=express['Router']();var fs_extra=require(_0xe5c7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5c7('0x6'));var controller=require(_0xe5c7('0x7'));router[_0xe5c7('0x8')]('/',auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xa')]);router[_0xe5c7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe5c7('0xb')]);router['post']('/',auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xc')]);router[_0xe5c7('0xd')](_0xe5c7('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe5c7('0xe'),auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2584=['Router','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','show','post','/:id','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x10bfd7,_0x38dd2d){var _0x4a1015=function(_0x513232){while(--_0x513232){_0x10bfd7['push'](_0x10bfd7['shift']());}};_0x4a1015(++_0x38dd2d);}(_0x2584,0x155));var _0x4258=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x2584[_0x204eb7];return _0x37e444;};'use strict';var multer=require(_0x4258('0x0'));var util=require('util');var path=require(_0x4258('0x1'));var timeout=require(_0x4258('0x2'));var express=require(_0x4258('0x3'));var router=express[_0x4258('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4258('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4258('0x6'));var controller=require(_0x4258('0x7'));router['get']('/',auth[_0x4258('0x8')](),controller['index']);router['get']('/:id',auth[_0x4258('0x8')](),controller[_0x4258('0x9')]);router[_0x4258('0xa')]('/',auth[_0x4258('0x8')](),controller['create']);router['put'](_0x4258('0xb'),auth[_0x4258('0x8')](),controller[_0x4258('0xc')]);router[_0x4258('0xd')](_0x4258('0xb'),auth[_0x4258('0x8')](),controller['destroy']);module[_0x4258('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 642e5b3..5358f48 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 _0x91f9=['voice','exports','VIRTUAL','alias','STRING','setDataValue','long','type','select','parse','getDataValue','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x91f9,0xa1));var _0x991f=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0x91f9[_0xd6aad];return _0x1109e6;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x991f('0x0')]={'name':{'type':Sequelize[_0x991f('0x1')],'get':function(_0x4ffcd2){return this['getDataValue'](_0x991f('0x2'));}},'alias':{'type':Sequelize[_0x991f('0x3')],'allowNull':![],'set':function(_0x9129dc){this[_0x991f('0x4')](_0x991f('0x2'),_0x9129dc?_0x9129dc:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x991f('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x991f('0x5')),'get':function(){if(this['getDataValue'](_0x991f('0x6'))===_0x991f('0x7')){return JSON[_0x991f('0x8')](this[_0x991f('0x9')](_0x991f('0xa')));}else{return this[_0x991f('0x9')](_0x991f('0xa'));}},'set':function(_0x139015){if(Array[_0x991f('0xb')](_0x139015)){this['setDataValue'](_0x991f('0xa'),JSON[_0x991f('0xc')](_0x139015));}else{this[_0x991f('0x4')]('values',_0x139015);}}},'required':{'type':Sequelize[_0x991f('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x991f('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x991f('0xe')](_0x991f('0xf'))}}; \ No newline at end of file +var _0x73b1=['exports','VIRTUAL','getDataValue','alias','STRING','type','select','values','BOOLEAN','voice','lodash'];(function(_0x4897b0,_0x120200){var _0x171c64=function(_0x237d62){while(--_0x237d62){_0x4897b0['push'](_0x4897b0['shift']());}};_0x171c64(++_0x120200);}(_0x73b1,0x112));var _0x173b=function(_0x59d6a3,_0x2eac3c){_0x59d6a3=_0x59d6a3-0x0;var _0x50627f=_0x73b1[_0x59d6a3];return _0x50627f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x173b('0x0'));module[_0x173b('0x1')]={'name':{'type':Sequelize[_0x173b('0x2')],'get':function(_0x418aff){return this[_0x173b('0x3')](_0x173b('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x81825b){this['setDataValue']('alias',_0x81825b?_0x81825b:this[_0x173b('0x3')]('name'));}},'type':{'type':Sequelize[_0x173b('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x173b('0x6'))===_0x173b('0x7')){return JSON['parse'](this[_0x173b('0x3')](_0x173b('0x8')));}else{return this[_0x173b('0x3')](_0x173b('0x8'));}},'set':function(_0x14c353){if(Array['isArray'](_0x14c353)){this['setDataValue'](_0x173b('0x8'),JSON['stringify'](_0x14c353));}else{this['setDataValue'](_0x173b('0x8'),_0x14c353);}}},'required':{'type':Sequelize[_0x173b('0x9')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x173b('0x9')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x173b('0xa'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 044a42a..628f980 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 _0x0650=['name','send','index','map','CmCustomField','rawAttributes','fieldName','differenceBy','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','count','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x78a4c9,_0x5f67d0){var _0x3abd9b=function(_0x5781e3){while(--_0x5781e3){_0x78a4c9['push'](_0x78a4c9['shift']());}};_0x3abd9b(++_0x5f67d0);}(_0x0650,0x1ed));var _0x0065=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x0650[_0x421791];return _0x495838;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require(_0x0065('0x1'));var zipdir=require(_0x0065('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0065('0x3'));var moment=require(_0x0065('0x4'));var BPromise=require(_0x0065('0x5'));var Mustache=require('mustache');var util=require(_0x0065('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0065('0x7'));var ejs=require(_0x0065('0x8'));var fs=require('fs');var fs_extra=require(_0x0065('0x9'));var _=require(_0x0065('0xa'));var squel=require('squel');var crypto=require(_0x0065('0xb'));var jsforce=require(_0x0065('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0065('0xd'));var Redis=require(_0x0065('0xe'));var authService=require(_0x0065('0xf'));var qs=require(_0x0065('0x10'));var as=require(_0x0065('0x11'));var hardwareService=require(_0x0065('0x12'));var logger=require('../../config/logger')(_0x0065('0x13'));var utils=require(_0x0065('0x14'));var config=require(_0x0065('0x15'));var licenseUtil=require(_0x0065('0x16'));var db=require(_0x0065('0x17'))['db'];function respondWithStatusCode(_0x1d3856,_0x440df3){_0x440df3=_0x440df3||0xcc;return function(_0x4d4c91){if(_0x4d4c91){return _0x1d3856[_0x0065('0x18')](_0x440df3);}return _0x1d3856[_0x0065('0x19')](_0x440df3)['end']();};}function respondWithResult(_0x52d4da,_0x13d8b8){_0x13d8b8=_0x13d8b8||0xc8;return function(_0x5a5856){if(_0x5a5856){return _0x52d4da['status'](_0x13d8b8)['json'](_0x5a5856);}};}function respondWithFilteredResult(_0x5042ab,_0xba4299){return function(_0x1b7b24){if(_0x1b7b24){var _0x466fe4=typeof _0xba4299[_0x0065('0x1a')]===_0x0065('0x1b')&&typeof _0xba4299['limit']===_0x0065('0x1b');var _0x2af9bb=_0x1b7b24[_0x0065('0x1c')];var _0xddac63=_0x466fe4?0x0:_0xba4299['offset'];var _0x2001ed=_0x466fe4?_0x1b7b24[_0x0065('0x1c')]:_0xba4299[_0x0065('0x1a')]+_0xba4299[_0x0065('0x1d')];var _0x5290d6;if(_0x2001ed>=_0x2af9bb){_0x2001ed=_0x2af9bb;_0x5290d6=0xc8;}else{_0x5290d6=0xce;}_0x5042ab['status'](_0x5290d6);return _0x5042ab[_0x0065('0x1e')]('Content-Range',_0xddac63+'-'+_0x2001ed+'/'+_0x2af9bb)[_0x0065('0x1f')](_0x1b7b24);}return null;};}function patchUpdates(_0x2bee5a){return function(_0x4b4386){try{jsonpatch[_0x0065('0x20')](_0x4b4386,_0x2bee5a,!![]);}catch(_0x2b61db){return BPromise[_0x0065('0x21')](_0x2b61db);}return _0x4b4386[_0x0065('0x22')]();};}function saveUpdates(_0x2768ad,_0x58d195){return function(_0x3ec487){if(_0x3ec487){return _0x3ec487[_0x0065('0x23')](_0x2768ad)[_0x0065('0x24')](function(_0xbf2fc8){return _0xbf2fc8;});}return null;};}function removeEntity(_0x5020eb,_0x5c7b9a){return function(_0x4e0dfe){if(_0x4e0dfe){return _0x4e0dfe[_0x0065('0x25')]()[_0x0065('0x24')](function(){_0x5020eb[_0x0065('0x19')](0xcc)[_0x0065('0x26')]();});}};}function handleEntityNotFound(_0x95be27,_0x236d00){return function(_0x15966d){if(!_0x15966d){_0x95be27['sendStatus'](0x194);}return _0x15966d;};}function handleError(_0x34ee33,_0x3d8c40){_0x3d8c40=_0x3d8c40||0x1f4;return function(_0x56d9bf){logger[_0x0065('0x27')](_0x56d9bf[_0x0065('0x28')]);if(_0x56d9bf[_0x0065('0x29')]){delete _0x56d9bf[_0x0065('0x29')];}_0x34ee33[_0x0065('0x19')](_0x3d8c40)[_0x0065('0x2a')](_0x56d9bf);};}exports[_0x0065('0x2b')]=function(_0x447bb0,_0x26c9c3){var _0x45a695={},_0x453228={},_0x4852c1={'count':0x0,'rows':[]};var _0x3fbf4d=_[_0x0065('0x2c')](db[_0x0065('0x2d')][_0x0065('0x2e')],function(_0x272dfe){return{'name':_0x272dfe[_0x0065('0x2f')],'type':_0x272dfe['type']['key']};});_0x453228['model']=_[_0x0065('0x30')](_[_0x0065('0x2c')](_0x3fbf4d,_0x0065('0x29')),[_0x0065('0x29')]);_0x453228[_0x0065('0x31')]=_['keys'](_0x447bb0[_0x0065('0x31')]);_0x453228[_0x0065('0x32')]=_['intersection'](_0x453228[_0x0065('0x33')],_0x453228[_0x0065('0x31')]);_0x45a695[_0x0065('0x34')]=_[_0x0065('0x35')](_0x453228[_0x0065('0x33')],qs['fields'](_0x447bb0[_0x0065('0x31')][_0x0065('0x36')]));_0x45a695[_0x0065('0x34')]=_0x45a695[_0x0065('0x34')][_0x0065('0x37')]?_0x45a695[_0x0065('0x34')]:_0x453228[_0x0065('0x33')];if(!_0x447bb0[_0x0065('0x31')][_0x0065('0x38')](_0x0065('0x39'))){_0x45a695['limit']=qs[_0x0065('0x1d')](_0x447bb0['query'][_0x0065('0x1d')]);_0x45a695[_0x0065('0x1a')]=qs[_0x0065('0x1a')](_0x447bb0[_0x0065('0x31')]['offset']);}_0x45a695[_0x0065('0x3a')]=qs['sort'](_0x447bb0[_0x0065('0x31')][_0x0065('0x3b')]);_0x45a695[_0x0065('0x3c')]=qs[_0x0065('0x32')](_[_0x0065('0x3d')](_0x447bb0[_0x0065('0x31')],_0x453228[_0x0065('0x32')]),_0x3fbf4d);if(_0x447bb0['query'][_0x0065('0x3e')]){_0x45a695[_0x0065('0x3c')]=_['merge'](_0x45a695[_0x0065('0x3c')],{'$or':_['map'](_0x3fbf4d,function(_0x131117){if(_0x131117[_0x0065('0x3f')]!==_0x0065('0x40')){var _0x8f4689={};_0x8f4689[_0x131117['name']]={'$like':'%'+_0x447bb0[_0x0065('0x31')][_0x0065('0x3e')]+'%'};return _0x8f4689;}})});}_0x45a695=_[_0x0065('0x41')]({},_0x45a695,_0x447bb0[_0x0065('0x42')]);var _0x1a16b3={'where':_0x45a695[_0x0065('0x3c')]};return db['CmCustomField'][_0x0065('0x1c')](_0x1a16b3)[_0x0065('0x24')](function(_0x47480f){_0x4852c1[_0x0065('0x1c')]=_0x47480f;if(_0x447bb0[_0x0065('0x31')][_0x0065('0x43')]){_0x45a695[_0x0065('0x44')]=[{'all':!![]}];}return db[_0x0065('0x2d')][_0x0065('0x45')](_0x45a695);})[_0x0065('0x24')](function(_0x48120d){_0x4852c1[_0x0065('0x46')]=_0x48120d;return _0x4852c1;})[_0x0065('0x24')](respondWithFilteredResult(_0x26c9c3,_0x45a695))[_0x0065('0x47')](handleError(_0x26c9c3,null));};exports['show']=function(_0x53bad5,_0x551be0){var _0x48b320={'raw':!![],'where':{'id':_0x53bad5[_0x0065('0x48')]['id']}},_0x1b4ee9={};_0x1b4ee9[_0x0065('0x33')]=_['keys'](db['CmCustomField'][_0x0065('0x2e')]);_0x1b4ee9[_0x0065('0x31')]=_[_0x0065('0x49')](_0x53bad5['query']);_0x1b4ee9[_0x0065('0x32')]=_['intersection'](_0x1b4ee9[_0x0065('0x33')],_0x1b4ee9[_0x0065('0x31')]);_0x48b320[_0x0065('0x34')]=_['intersection'](_0x1b4ee9[_0x0065('0x33')],qs[_0x0065('0x36')](_0x53bad5['query'][_0x0065('0x36')]));_0x48b320['attributes']=_0x48b320[_0x0065('0x34')][_0x0065('0x37')]?_0x48b320['attributes']:_0x1b4ee9[_0x0065('0x33')];if(_0x53bad5['query'][_0x0065('0x43')]){_0x48b320['include']=[{'all':!![]}];}_0x48b320=_[_0x0065('0x41')]({},_0x48b320,_0x53bad5[_0x0065('0x42')]);return db[_0x0065('0x2d')][_0x0065('0x4a')](_0x48b320)[_0x0065('0x24')](handleEntityNotFound(_0x551be0,null))[_0x0065('0x24')](respondWithResult(_0x551be0,null))[_0x0065('0x47')](handleError(_0x551be0,null));};exports[_0x0065('0x23')]=function(_0x46afa1,_0x52a709){if(_0x46afa1[_0x0065('0x4b')]['id']){delete _0x46afa1[_0x0065('0x4b')]['id'];}return db[_0x0065('0x2d')][_0x0065('0x4a')]({'where':{'id':_0x46afa1['params']['id']}})[_0x0065('0x24')](handleEntityNotFound(_0x52a709,null))[_0x0065('0x24')](saveUpdates(_0x46afa1[_0x0065('0x4b')],null))[_0x0065('0x24')](respondWithResult(_0x52a709,null))['catch'](handleError(_0x52a709,null));};exports[_0x0065('0x25')]=function(_0x5076ea,_0x30446b){return db['CmCustomField'][_0x0065('0x4a')]({'where':{'id':_0x5076ea[_0x0065('0x48')]['id']}})[_0x0065('0x24')](handleEntityNotFound(_0x30446b,null))[_0x0065('0x24')](removeEntity(_0x30446b,null))['catch'](handleError(_0x30446b,null));};exports[_0x0065('0x4c')]=function(_0x1b23ef,_0x303f3c){var _0x3ac273;return db[_0x0065('0x4d')][_0x0065('0x4e')](function(_0x442af3){return db['CmCustomField'][_0x0065('0x4c')](_0x1b23ef[_0x0065('0x4b')],{'transaction':_0x442af3})[_0x0065('0x24')](function(_0x5d5fad){_0x3ac273=_0x5d5fad;var _0x1c0c46={'type':db['Sequelize'][_0x0065('0x4f')],'transaction':_0x442af3};switch(_0x1b23ef[_0x0065('0x4b')][_0x0065('0x3f')]){case _0x0065('0x50'):_0x1c0c46['type']=db[_0x0065('0x51')]['TEXT'];break;case _0x0065('0x52'):_0x1c0c46[_0x0065('0x3f')]=db[_0x0065('0x51')][_0x0065('0x53')];break;case'switch':_0x1c0c46['type']=db[_0x0065('0x51')][_0x0065('0x54')];_0x1c0c46[_0x0065('0x55')]=![];break;default:}return db['sequelize'][_0x0065('0x56')][_0x0065('0x57')]('cm_contacts',util[_0x0065('0x58')]('cf_%d',_0x3ac273['id']),_0x1c0c46);})[_0x0065('0x24')](function(){return _0x3ac273;});})[_0x0065('0x24')](respondWithResult(_0x303f3c,0xc9))[_0x0065('0x47')](handleError(_0x303f3c,null));}; \ No newline at end of file +var _0x26c1=['rows','catch','params','options','find','body','create','sequelize','transaction','Sequelize','TEXT','number','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','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','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','name','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','filter','where','merge','VIRTUAL','include','findAll'];(function(_0x574483,_0x5c618f){var _0x398515=function(_0x56ab02){while(--_0x56ab02){_0x574483['push'](_0x574483['shift']());}};_0x398515(++_0x5c618f);}(_0x26c1,0x161));var _0x126c=function(_0x11f0e3,_0x5170bc){_0x11f0e3=_0x11f0e3-0x0;var _0x2892e8=_0x26c1[_0x11f0e3];return _0x2892e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x126c('0x0'));var zipdir=require(_0x126c('0x1'));var jsonpatch=require(_0x126c('0x2'));var rp=require(_0x126c('0x3'));var moment=require(_0x126c('0x4'));var BPromise=require(_0x126c('0x5'));var Mustache=require(_0x126c('0x6'));var util=require(_0x126c('0x7'));var path=require(_0x126c('0x8'));var sox=require(_0x126c('0x9'));var csv=require(_0x126c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x126c('0xb'));var _=require(_0x126c('0xc'));var squel=require(_0x126c('0xd'));var crypto=require(_0x126c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x126c('0xa'));var querystring=require(_0x126c('0xf'));var Papa=require(_0x126c('0x10'));var Redis=require('ioredis');var authService=require(_0x126c('0x11'));var qs=require(_0x126c('0x12'));var as=require(_0x126c('0x13'));var hardwareService=require(_0x126c('0x14'));var logger=require(_0x126c('0x15'))(_0x126c('0x16'));var utils=require(_0x126c('0x17'));var config=require(_0x126c('0x18'));var licenseUtil=require(_0x126c('0x19'));var db=require(_0x126c('0x1a'))['db'];function respondWithStatusCode(_0xd604d2,_0x48ece5){_0x48ece5=_0x48ece5||0xcc;return function(_0x353636){if(_0x353636){return _0xd604d2[_0x126c('0x1b')](_0x48ece5);}return _0xd604d2['status'](_0x48ece5)['end']();};}function respondWithResult(_0x31442f,_0x235fa8){_0x235fa8=_0x235fa8||0xc8;return function(_0x2aed80){if(_0x2aed80){return _0x31442f[_0x126c('0x1c')](_0x235fa8)[_0x126c('0x1d')](_0x2aed80);}};}function respondWithFilteredResult(_0x509c93,_0x341e7f){return function(_0x16709f){if(_0x16709f){var _0x15bb3a=typeof _0x341e7f[_0x126c('0x1e')]==='undefined'&&typeof _0x341e7f[_0x126c('0x1f')]===_0x126c('0x20');var _0x48b521=_0x16709f[_0x126c('0x21')];var _0x2fd80a=_0x15bb3a?0x0:_0x341e7f[_0x126c('0x1e')];var _0x371baf=_0x15bb3a?_0x16709f[_0x126c('0x21')]:_0x341e7f[_0x126c('0x1e')]+_0x341e7f[_0x126c('0x1f')];var _0x5bacd6;if(_0x371baf>=_0x48b521){_0x371baf=_0x48b521;_0x5bacd6=0xc8;}else{_0x5bacd6=0xce;}_0x509c93[_0x126c('0x1c')](_0x5bacd6);return _0x509c93['set'](_0x126c('0x22'),_0x2fd80a+'-'+_0x371baf+'/'+_0x48b521)[_0x126c('0x1d')](_0x16709f);}return null;};}function patchUpdates(_0x402c65){return function(_0x3631c7){try{jsonpatch['apply'](_0x3631c7,_0x402c65,!![]);}catch(_0x9330fb){return BPromise[_0x126c('0x23')](_0x9330fb);}return _0x3631c7[_0x126c('0x24')]();};}function saveUpdates(_0x1265d9,_0x40107e){return function(_0x190ed7){if(_0x190ed7){return _0x190ed7[_0x126c('0x25')](_0x1265d9)[_0x126c('0x26')](function(_0x4a89da){return _0x4a89da;});}return null;};}function removeEntity(_0x4b86a9,_0x484a3a){return function(_0x535d81){if(_0x535d81){return _0x535d81[_0x126c('0x27')]()[_0x126c('0x26')](function(){_0x4b86a9[_0x126c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x507159,_0x4c19ac){return function(_0x3c31d8){if(!_0x3c31d8){_0x507159[_0x126c('0x1b')](0x194);}return _0x3c31d8;};}function handleError(_0x791aba,_0x574d86){_0x574d86=_0x574d86||0x1f4;return function(_0x48e2fa){logger[_0x126c('0x28')](_0x48e2fa[_0x126c('0x29')]);if(_0x48e2fa['name']){delete _0x48e2fa['name'];}_0x791aba[_0x126c('0x1c')](_0x574d86)[_0x126c('0x2a')](_0x48e2fa);};}exports['index']=function(_0x1b3dcb,_0x55f94f){var _0x51018={},_0x24ed45={},_0x484295={'count':0x0,'rows':[]};var _0x1428b9=_[_0x126c('0x2b')](db[_0x126c('0x2c')][_0x126c('0x2d')],function(_0x9e7e15){return{'name':_0x9e7e15[_0x126c('0x2e')],'type':_0x9e7e15[_0x126c('0x2f')][_0x126c('0x30')]};});_0x24ed45[_0x126c('0x31')]=_[_0x126c('0x32')](_[_0x126c('0x2b')](_0x1428b9,_0x126c('0x33')),[_0x126c('0x33')]);_0x24ed45[_0x126c('0x34')]=_[_0x126c('0x35')](_0x1b3dcb[_0x126c('0x34')]);_0x24ed45['filters']=_['intersection'](_0x24ed45[_0x126c('0x31')],_0x24ed45['query']);_0x51018[_0x126c('0x36')]=_[_0x126c('0x37')](_0x24ed45['model'],qs[_0x126c('0x38')](_0x1b3dcb[_0x126c('0x34')]['fields']));_0x51018[_0x126c('0x36')]=_0x51018[_0x126c('0x36')][_0x126c('0x39')]?_0x51018[_0x126c('0x36')]:_0x24ed45[_0x126c('0x31')];if(!_0x1b3dcb[_0x126c('0x34')]['hasOwnProperty'](_0x126c('0x3a'))){_0x51018[_0x126c('0x1f')]=qs['limit'](_0x1b3dcb[_0x126c('0x34')][_0x126c('0x1f')]);_0x51018[_0x126c('0x1e')]=qs[_0x126c('0x1e')](_0x1b3dcb['query'][_0x126c('0x1e')]);}_0x51018['order']=qs[_0x126c('0x3b')](_0x1b3dcb[_0x126c('0x34')][_0x126c('0x3b')]);_0x51018['where']=qs['filters'](_['pick'](_0x1b3dcb['query'],_0x24ed45[_0x126c('0x3c')]),_0x1428b9);if(_0x1b3dcb[_0x126c('0x34')][_0x126c('0x3d')]){_0x51018[_0x126c('0x3e')]=_[_0x126c('0x3f')](_0x51018[_0x126c('0x3e')],{'$or':_[_0x126c('0x2b')](_0x1428b9,function(_0x2d1db4){if(_0x2d1db4[_0x126c('0x2f')]!==_0x126c('0x40')){var _0x1045aa={};_0x1045aa[_0x2d1db4[_0x126c('0x33')]]={'$like':'%'+_0x1b3dcb['query'][_0x126c('0x3d')]+'%'};return _0x1045aa;}})});}_0x51018=_[_0x126c('0x3f')]({},_0x51018,_0x1b3dcb['options']);var _0x3ab526={'where':_0x51018['where']};return db[_0x126c('0x2c')][_0x126c('0x21')](_0x3ab526)[_0x126c('0x26')](function(_0xa5dc68){_0x484295['count']=_0xa5dc68;if(_0x1b3dcb[_0x126c('0x34')]['includeAll']){_0x51018[_0x126c('0x41')]=[{'all':!![]}];}return db[_0x126c('0x2c')][_0x126c('0x42')](_0x51018);})['then'](function(_0x1786ec){_0x484295[_0x126c('0x43')]=_0x1786ec;return _0x484295;})['then'](respondWithFilteredResult(_0x55f94f,_0x51018))[_0x126c('0x44')](handleError(_0x55f94f,null));};exports['show']=function(_0x1cc8f2,_0x567334){var _0xbbfa88={'raw':!![],'where':{'id':_0x1cc8f2[_0x126c('0x45')]['id']}},_0x2d9155={};_0x2d9155['model']=_[_0x126c('0x35')](db[_0x126c('0x2c')][_0x126c('0x2d')]);_0x2d9155[_0x126c('0x34')]=_[_0x126c('0x35')](_0x1cc8f2[_0x126c('0x34')]);_0x2d9155[_0x126c('0x3c')]=_[_0x126c('0x37')](_0x2d9155[_0x126c('0x31')],_0x2d9155[_0x126c('0x34')]);_0xbbfa88[_0x126c('0x36')]=_['intersection'](_0x2d9155[_0x126c('0x31')],qs[_0x126c('0x38')](_0x1cc8f2[_0x126c('0x34')][_0x126c('0x38')]));_0xbbfa88[_0x126c('0x36')]=_0xbbfa88[_0x126c('0x36')][_0x126c('0x39')]?_0xbbfa88[_0x126c('0x36')]:_0x2d9155[_0x126c('0x31')];if(_0x1cc8f2[_0x126c('0x34')]['includeAll']){_0xbbfa88[_0x126c('0x41')]=[{'all':!![]}];}_0xbbfa88=_[_0x126c('0x3f')]({},_0xbbfa88,_0x1cc8f2[_0x126c('0x46')]);return db[_0x126c('0x2c')][_0x126c('0x47')](_0xbbfa88)[_0x126c('0x26')](handleEntityNotFound(_0x567334,null))[_0x126c('0x26')](respondWithResult(_0x567334,null))[_0x126c('0x44')](handleError(_0x567334,null));};exports[_0x126c('0x25')]=function(_0x572c79,_0x15e2ab){if(_0x572c79[_0x126c('0x48')]['id']){delete _0x572c79[_0x126c('0x48')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x572c79[_0x126c('0x45')]['id']}})[_0x126c('0x26')](handleEntityNotFound(_0x15e2ab,null))['then'](saveUpdates(_0x572c79['body'],null))[_0x126c('0x26')](respondWithResult(_0x15e2ab,null))[_0x126c('0x44')](handleError(_0x15e2ab,null));};exports[_0x126c('0x27')]=function(_0xa0d6a9,_0x17a078){return db['CmCustomField']['find']({'where':{'id':_0xa0d6a9[_0x126c('0x45')]['id']}})[_0x126c('0x26')](handleEntityNotFound(_0x17a078,null))['then'](removeEntity(_0x17a078,null))[_0x126c('0x44')](handleError(_0x17a078,null));};exports[_0x126c('0x49')]=function(_0x8a582e,_0x2a8dc5){var _0x543923;return db[_0x126c('0x4a')][_0x126c('0x4b')](function(_0x363502){return db[_0x126c('0x2c')][_0x126c('0x49')](_0x8a582e[_0x126c('0x48')],{'transaction':_0x363502})[_0x126c('0x26')](function(_0x25e2a5){_0x543923=_0x25e2a5;var _0x4cad84={'type':db[_0x126c('0x4c')][_0x126c('0x4d')],'transaction':_0x363502};switch(_0x8a582e[_0x126c('0x48')]['type']){case'text':_0x4cad84[_0x126c('0x2f')]=db[_0x126c('0x4c')][_0x126c('0x4d')];break;case _0x126c('0x4e'):_0x4cad84[_0x126c('0x2f')]=db[_0x126c('0x4c')]['INTEGER'];break;case'switch':_0x4cad84[_0x126c('0x2f')]=db[_0x126c('0x4c')][_0x126c('0x4f')];_0x4cad84[_0x126c('0x50')]=![];break;default:}return db[_0x126c('0x4a')][_0x126c('0x51')][_0x126c('0x52')](_0x126c('0x53'),util['format']('cf_%d',_0x543923['id']),_0x4cad84);})[_0x126c('0x26')](function(){return _0x543923;});})[_0x126c('0x26')](respondWithResult(_0x2a8dc5,0xc9))[_0x126c('0x44')](handleError(_0x2a8dc5,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index aa42f4d..76cb198 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 _0x55a2=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','cm_custom_fields'];(function(_0xb1b481,_0x337b26){var _0x2433d2=function(_0x5c8bdf){while(--_0x5c8bdf){_0xb1b481['push'](_0xb1b481['shift']());}};_0x2433d2(++_0x337b26);}(_0x55a2,0xf3));var _0x255a=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x55a2[_0x1db251];return _0x56685a;};'use strict';var _=require(_0x255a('0x0'));var util=require(_0x255a('0x1'));var logger=require(_0x255a('0x2'))(_0x255a('0x3'));var moment=require(_0x255a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x255a('0x5'));var rimraf=require(_0x255a('0x6'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x255a('0x7')]=function(_0x2addb1,_0x1118c1){return _0x2addb1['define']('CmCustomField',attributes,{'tableName':_0x255a('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1821=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','cm_custom_fields','lodash'];(function(_0x37e99c,_0x26aaa9){var _0x24699d=function(_0x51d092){while(--_0x51d092){_0x37e99c['push'](_0x37e99c['shift']());}};_0x24699d(++_0x26aaa9);}(_0x1821,0xc5));var _0x1182=function(_0x318426,_0x1283a6){_0x318426=_0x318426-0x0;var _0x5697f0=_0x1821[_0x318426];return _0x5697f0;};'use strict';var _=require(_0x1182('0x0'));var util=require(_0x1182('0x1'));var logger=require(_0x1182('0x2'))(_0x1182('0x3'));var moment=require('moment');var BPromise=require(_0x1182('0x4'));var rp=require(_0x1182('0x5'));var fs=require('fs');var path=require(_0x1182('0x6'));var rimraf=require(_0x1182('0x7'));var config=require(_0x1182('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x1182('0x9')]=function(_0x500db5,_0x2045b5){return _0x500db5['define']('CmCustomField',attributes,{'tableName':_0x1182('0xa'),'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 76bc97f..50e869a 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 _0x60fa=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x4bc4f6,_0x46272d){var _0x226260=function(_0x44ae52){while(--_0x44ae52){_0x4bc4f6['push'](_0x4bc4f6['shift']());}};_0x226260(++_0x46272d);}(_0x60fa,0x149));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa60f('0x0'));var util=require(_0xa60f('0x1'));var moment=require('moment');var BPromise=require(_0xa60f('0x2'));var rs=require(_0xa60f('0x3'));var fs=require('fs');var Redis=require(_0xa60f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa60f('0x5'));var logger=require('../../config/logger')(_0xa60f('0x6'));var config=require(_0xa60f('0x7'));var jayson=require(_0xa60f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa638,_0x3c7918,_0x5bc108){return new BPromise(function(_0x8975dc,_0x2a2705){return client['request'](_0x3aa638,_0x5bc108)[_0xa60f('0x9')](function(_0x194256){logger[_0xa60f('0xa')]('CmCustomField,\x20%s,\x20%s',_0x3c7918,_0xa60f('0xb'));logger['debug'](_0xa60f('0xc'),_0x3c7918,_0xa60f('0xb'),JSON['stringify'](_0x194256));if(_0x194256[_0xa60f('0xd')]){if(_0x194256['error']['code']===0x1f4){logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);return _0x2a2705(_0x194256['error']['message']);}logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);return _0x8975dc(_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x3c7918,'request\x20sent');_0x8975dc(_0x194256[_0xa60f('0x10')][_0xa60f('0xf')]);}})[_0xa60f('0x11')](function(_0x4626e2){logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x4626e2);_0x2a2705(_0x4626e2);});});} \ No newline at end of file +var _0xd200=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0xd200,0x1b4));var _0x0d20=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xd200[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x0d20('0x0'));var moment=require(_0x0d20('0x1'));var BPromise=require(_0x0d20('0x2'));var rs=require(_0x0d20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d20('0x4'))['db'];var utils=require(_0x0d20('0x5'));var logger=require(_0x0d20('0x6'))('rpc');var config=require(_0x0d20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d20('0x8')][_0x0d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30b9b4,_0x473700,_0x5eb00b){return new BPromise(function(_0x47759e,_0x4d57cc){return client[_0x0d20('0xa')](_0x30b9b4,_0x5eb00b)[_0x0d20('0xb')](function(_0x4684ed){logger['info'](_0x0d20('0xc'),_0x473700,_0x0d20('0xd'));logger[_0x0d20('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x473700,_0x0d20('0xd'),JSON[_0x0d20('0xf')](_0x4684ed));if(_0x4684ed[_0x0d20('0x10')]){if(_0x4684ed[_0x0d20('0x10')][_0x0d20('0x11')]===0x1f4){logger[_0x0d20('0x10')](_0x0d20('0xc'),_0x473700,_0x4684ed[_0x0d20('0x10')]['message']);return _0x4d57cc(_0x4684ed[_0x0d20('0x10')]['message']);}logger[_0x0d20('0x10')](_0x0d20('0xc'),_0x473700,_0x4684ed[_0x0d20('0x10')][_0x0d20('0x12')]);return _0x47759e(_0x4684ed[_0x0d20('0x10')][_0x0d20('0x12')]);}else{logger[_0x0d20('0x13')](_0x0d20('0xc'),_0x473700,_0x0d20('0xd'));_0x47759e(_0x4684ed[_0x0d20('0x14')][_0x0d20('0x12')]);}})['catch'](function(_0x5199fd){logger[_0x0d20('0x10')](_0x0d20('0xc'),_0x473700,_0x5199fd);_0x4d57cc(_0x5199fd);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 4b14afa..db7a98f 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 _0x3de2=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x246bcc,_0x4051a2){var _0x2e5f50=function(_0x1e118f){while(--_0x1e118f){_0x246bcc['push'](_0x246bcc['shift']());}};_0x2e5f50(++_0x4051a2);}(_0x3de2,0x79));var _0x23de=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x3de2[_0x1762b4];return _0x29beda;};'use strict';var multer=require(_0x23de('0x0'));var util=require('util');var path=require(_0x23de('0x1'));var timeout=require(_0x23de('0x2'));var express=require(_0x23de('0x3'));var router=express[_0x23de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x23de('0x5'));var config=require(_0x23de('0x6'));var controller=require(_0x23de('0x7'));router[_0x23de('0x8')]('/',auth['isAuthenticated'](),controller[_0x23de('0x9')]);router['get'](_0x23de('0xa'),auth[_0x23de('0xb')](),controller[_0x23de('0xc')]);router[_0x23de('0xd')]('/',auth[_0x23de('0xb')](),controller[_0x23de('0xe')]);router[_0x23de('0xf')]('/:id',auth[_0x23de('0xb')](),controller['update']);router[_0x23de('0x10')](_0x23de('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x23de('0x11')]=router; \ No newline at end of file +var _0xd0e7=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x5321f8,_0x19711a){var _0x153f70=function(_0x291195){while(--_0x291195){_0x5321f8['push'](_0x5321f8['shift']());}};_0x153f70(++_0x19711a);}(_0xd0e7,0x10d));var _0x7d0e=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xd0e7[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var path=require(_0x7d0e('0x2'));var timeout=require(_0x7d0e('0x3'));var express=require('express');var router=express[_0x7d0e('0x4')]();var fs_extra=require(_0x7d0e('0x5'));var auth=require(_0x7d0e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d0e('0x7'));router[_0x7d0e('0x8')]('/',auth[_0x7d0e('0x9')](),controller[_0x7d0e('0xa')]);router[_0x7d0e('0x8')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0xc')]);router[_0x7d0e('0xd')]('/',auth[_0x7d0e('0x9')](),controller[_0x7d0e('0xe')]);router[_0x7d0e('0xf')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0x10')]);router[_0x7d0e('0x11')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0x12')]);module[_0x7d0e('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 23dc2ab..3c2b30c 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 _0xc6b2=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x583636,_0x8ba17e){var _0x5cc9d0=function(_0x3c9c60){while(--_0x3c9c60){_0x583636['push'](_0x583636['shift']());}};_0x5cc9d0(++_0x8ba17e);}(_0xc6b2,0x12b));var _0x2c6b=function(_0x531e62,_0x1dbb03){_0x531e62=_0x531e62-0x0;var _0x45b806=_0xc6b2[_0x531e62];return _0x45b806;};'use strict';var moment=require('moment');var Sequelize=require(_0x2c6b('0x0'));module[_0x2c6b('0x1')]={'phone':{'type':Sequelize[_0x2c6b('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2c6b('0x4')],'defaultValue':moment()['format'](_0x2c6b('0x5'))},'countbusyretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2c6b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2c6b('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2c6b('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x2c6b('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2c6b('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x2c6b('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x8329=['DATE','format','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x102bd8,_0x5d844a){var _0xfeb51=function(_0x4b29fd){while(--_0x4b29fd){_0x102bd8['push'](_0x102bd8['shift']());}};_0xfeb51(++_0x5d844a);}(_0x8329,0x1b3));var _0x9832=function(_0x127f6c,_0x3b81ec){_0x127f6c=_0x127f6c-0x0;var _0x22243a=_0x8329[_0x127f6c];return _0x22243a;};'use strict';var moment=require(_0x9832('0x0'));var Sequelize=require(_0x9832('0x1'));module[_0x9832('0x2')]={'phone':{'type':Sequelize[_0x9832('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9832('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9832('0x5')],'defaultValue':moment()[_0x9832('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9832('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9832('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9832('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9832('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9832('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9832('0x7')],'unique':_0x9832('0x9')},'ListId':{'type':Sequelize[_0x9832('0x7')],'unique':_0x9832('0x9')},'UserId':{'type':Sequelize[_0x9832('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x9832('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x9832('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x9832('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9832('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9832('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9832('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9832('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x9832('0x5')],'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 113f339..44e09d2 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 _0x106f=['where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','find','catch','create','body','describe','destroy','params','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','firstName','isNil','calleridname','lastName','CmHopperFinal','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','recallme','UPDATE','CmList','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','update','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$iLike','$notILike','$like','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x22d670,_0x2611ef){var _0x21ef8f=function(_0x1ed25f){while(--_0x1ed25f){_0x22d670['push'](_0x22d670['shift']());}};_0x21ef8f(++_0x2611ef);}(_0x106f,0x162));var _0xf106=function(_0x7c829f,_0x111571){_0x7c829f=_0x7c829f-0x0;var _0x2c5b51=_0x106f[_0x7c829f];return _0x2c5b51;};'use strict';var moment=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xf106('0x2'))(_0xf106('0x3'));var shared=require('../../config/environment');var db=require(_0xf106('0x4'))['db'];function respondWithResult(_0x4ab04f,_0x1236af){_0x1236af=_0x1236af||0xc8;return function(_0x370f6a){if(_0x370f6a){return _0x4ab04f[_0xf106('0x5')](_0x1236af)[_0xf106('0x6')](_0x370f6a);}};}function respondWithFilteredResult(_0x253f6d,_0x282fd4){return function(_0xc9588d){if(_0xc9588d){var _0x546acc=typeof _0x282fd4[_0xf106('0x7')]===_0xf106('0x8')&&typeof _0x282fd4['limit']==='undefined';var _0x507ad9=_0xc9588d['count'];var _0x52befe=_0x546acc?0x0:_0x282fd4[_0xf106('0x7')];var _0x3761d5=_0x546acc?_0xc9588d[_0xf106('0x9')]:_0x282fd4[_0xf106('0x7')]+_0x282fd4[_0xf106('0xa')];var _0x32ba4d;if(_0x3761d5>=_0x507ad9){_0x3761d5=_0x507ad9;_0x32ba4d=0xc8;}else{_0x32ba4d=0xce;}_0x253f6d[_0xf106('0x5')](_0x32ba4d);return _0x253f6d[_0xf106('0xb')](_0xf106('0xc'),_0x52befe+'-'+_0x3761d5+'/'+_0x507ad9)[_0xf106('0x6')](_0xc9588d);}return null;};}function saveUpdates(_0x31eebf,_0x5e9da8){return function(_0x2bd234){if(_0x2bd234){return _0x2bd234[_0xf106('0xd')](_0x31eebf)['then'](function(_0x59854c){return _0x59854c;});}return null;};}function handleEntityNotFound(_0x322351,_0x2cdbf6){return function(_0x292a0d){if(!_0x292a0d){_0x322351['sendStatus'](0x194);}return _0x292a0d;};}function handleError(_0x26bd1b,_0x26186f){_0x26186f=_0x26186f||0x1f4;return function(_0xf05683){logger['error'](_0xf05683[_0xf106('0xe')]);if(_0xf05683[_0xf106('0xf')]){delete _0xf05683['name'];}_0x26bd1b[_0xf106('0x5')](_0x26186f)[_0xf106('0x10')](_0xf05683);};}exports[_0xf106('0x11')]=function(_0x5e4c8f,_0x5d02c0){var _0x13b6b4={},_0x726d7c={},_0x7e15d1={'count':0x0,'rows':[]};var _0x4d395d=_[_0xf106('0x12')](db[_0xf106('0x13')][_0xf106('0x14')],function(_0x17b243){return{'name':_0x17b243[_0xf106('0x15')],'type':_0x17b243[_0xf106('0x16')][_0xf106('0x17')]};});_0x726d7c[_0xf106('0x18')]=_[_0xf106('0x12')](_0x4d395d,'name');_0x726d7c['query']=_[_0xf106('0x19')](_0x5e4c8f['query']);_0x726d7c[_0xf106('0x1a')]=_[_0xf106('0x1b')](_0x726d7c[_0xf106('0x18')],_0x726d7c[_0xf106('0x1c')]);_0x726d7c[_0xf106('0x1a')]=_['concat'](_0x726d7c['filters'],[_0xf106('0x1d'),_0xf106('0x1e'),_0xf106('0x1f'),_0xf106('0x20'),_0xf106('0x21'),_0xf106('0x22'),_0xf106('0x23'),_0xf106('0x24'),_0xf106('0x25'),_0xf106('0x26'),_0xf106('0x27'),_0xf106('0x28'),'$notIn','$like','$notLike',_0xf106('0x29'),_0xf106('0x2a'),_0xf106('0x2b'),_0xf106('0x2c'),_0xf106('0x2d'),_0xf106('0x2e'),'$any']);_0x13b6b4[_0xf106('0x2f')]=_[_0xf106('0x1b')](_0x726d7c[_0xf106('0x18')],qs[_0xf106('0x30')](_0x5e4c8f['query'][_0xf106('0x30')]));_0x13b6b4[_0xf106('0x2f')]=_0x13b6b4[_0xf106('0x2f')][_0xf106('0x31')]?_0x13b6b4[_0xf106('0x2f')]:_0x726d7c[_0xf106('0x18')];if(!_0x5e4c8f['query'][_0xf106('0x32')](_0xf106('0x33'))){_0x13b6b4[_0xf106('0xa')]=qs[_0xf106('0xa')](_0x5e4c8f['query'][_0xf106('0xa')]);_0x13b6b4[_0xf106('0x7')]=qs['offset'](_0x5e4c8f[_0xf106('0x1c')][_0xf106('0x7')]);}_0x13b6b4[_0xf106('0x34')]=qs[_0xf106('0x35')](_0x5e4c8f[_0xf106('0x1c')][_0xf106('0x35')]);_0x13b6b4[_0xf106('0x36')]=qs[_0xf106('0x1a')](_[_0xf106('0x37')](_0x5e4c8f[_0xf106('0x1c')],_0x726d7c[_0xf106('0x1a')]),_0x4d395d);if(_0x5e4c8f['query']['filter']){_0x13b6b4[_0xf106('0x36')]=_[_0xf106('0x38')](_0x13b6b4[_0xf106('0x36')],{'$or':_['map'](_0x4d395d,function(_0x149645){if(_0x149645[_0xf106('0x16')]!==_0xf106('0x39')){var _0xebb99={};_0xebb99[_0x149645[_0xf106('0xf')]]={'$like':'%'+_0x5e4c8f['query'][_0xf106('0x3a')]+'%'};return _0xebb99;}})});}_0x13b6b4=_['merge']({},_0x13b6b4,_0x5e4c8f[_0xf106('0x3b')]);var _0x2e4c93={'where':_0x13b6b4[_0xf106('0x36')]};return db[_0xf106('0x13')]['count'](_0x2e4c93)[_0xf106('0x3c')](function(_0x3d1e1f){_0x7e15d1[_0xf106('0x9')]=_0x3d1e1f;if(_0x5e4c8f['query']['includeAll']){_0x13b6b4['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x13b6b4);})[_0xf106('0x3c')](function(_0x5de95b){_0x7e15d1['rows']=_0x5de95b;return _0x7e15d1;})[_0xf106('0x3c')](respondWithFilteredResult(_0x5d02c0,_0x13b6b4))['catch'](handleError(_0x5d02c0,null));};exports['show']=function(_0x26ffc3,_0x1a3b02){var _0x2d4c90={'raw':!![],'where':{'id':_0x26ffc3['params']['id']}},_0x3e557d={};_0x3e557d[_0xf106('0x18')]=_[_0xf106('0x19')](db['CmHopper'][_0xf106('0x14')]);_0x3e557d[_0xf106('0x1c')]=_[_0xf106('0x19')](_0x26ffc3[_0xf106('0x1c')]);_0x3e557d[_0xf106('0x1a')]=_[_0xf106('0x1b')](_0x3e557d[_0xf106('0x18')],_0x3e557d['query']);_0x2d4c90['attributes']=_[_0xf106('0x1b')](_0x3e557d['model'],qs['fields'](_0x26ffc3[_0xf106('0x1c')][_0xf106('0x30')]));_0x2d4c90['attributes']=_0x2d4c90['attributes'][_0xf106('0x31')]?_0x2d4c90['attributes']:_0x3e557d[_0xf106('0x18')];if(_0x26ffc3[_0xf106('0x1c')][_0xf106('0x3d')]){_0x2d4c90[_0xf106('0x3e')]=[{'all':!![]}];}_0x2d4c90=_[_0xf106('0x38')]({},_0x2d4c90,_0x26ffc3[_0xf106('0x3b')]);return db[_0xf106('0x13')][_0xf106('0x3f')](_0x2d4c90)[_0xf106('0x3c')](handleEntityNotFound(_0x1a3b02,null))[_0xf106('0x3c')](respondWithResult(_0x1a3b02,null))[_0xf106('0x40')](handleError(_0x1a3b02,null));};exports[_0xf106('0x41')]=function(_0x39763c,_0x252ee1){return db[_0xf106('0x13')][_0xf106('0x41')](_0x39763c[_0xf106('0x42')],{})[_0xf106('0x3c')](respondWithResult(_0x252ee1,0xc9))['catch'](handleError(_0x252ee1,null));};exports[_0xf106('0xd')]=function(_0x20942e,_0xd0e741){if(_0x20942e[_0xf106('0x42')]['id']){delete _0x20942e[_0xf106('0x42')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x20942e['params']['id']}})['then'](handleEntityNotFound(_0xd0e741,null))[_0xf106('0x3c')](saveUpdates(_0x20942e['body'],null))['then'](respondWithResult(_0xd0e741,null))[_0xf106('0x40')](handleError(_0xd0e741,null));};exports[_0xf106('0x43')]=function(_0xd50443,_0x105337){return db['CmHopper'][_0xf106('0x43')]()[_0xf106('0x3c')](respondWithResult(_0x105337,null))[_0xf106('0x40')](handleError(_0x105337,null));};exports[_0xf106('0x44')]=function(_0x1bf065,_0x519192){var _0x59bd01;var _0x37dc6a=_0x1bf065[_0xf106('0x45')]['id'];return db[_0xf106('0x13')]['find']({'where':{'id':_0x1bf065[_0xf106('0x45')]['id']}})[_0xf106('0x3c')](handleEntityNotFound(_0x519192,null))[_0xf106('0x3c')](function(_0x1ddfce){if(_0x1ddfce){return _0x1ddfce['destroy']()[_0xf106('0x3c')](function(_0x5b80a8){return _0x5b80a8;});}})['then'](function(_0x148730){_0x59bd01=_0x148730;if(_0x148730){if(_0x148730[_0xf106('0x46')]||_0x148730['CampaignId']){return db[_0x148730[_0xf106('0x46')]?_0xf106('0x47'):_0xf106('0x48')][_0xf106('0x3f')]({'where':{'id':_0x148730[_0xf106('0x46')]?_0x148730[_0xf106('0x46')]:_0x148730['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xf106('0x3c')](function(_0x53b682){var _0x20c935={};if(_0x53b682){_['merge'](_0x20c935,_[_0xf106('0x49')](_0x59bd01[_0xf106('0x4a')],[_0xf106('0x4b'),_0xf106('0x4c'),'id']));_0x20c935['state']=0x15;_0x20c935[_0xf106('0x4d')]=_0xf106('0x4e');_0x20c935[_0xf106('0x4f')]=_0x53b682[_0xf106('0xf')];_0x20c935[_0xf106('0x50')]=_0x1bf065[_0xf106('0x51')][_0xf106('0xf')];_0x20c935[_0xf106('0x52')]=_0x1bf065[_0xf106('0x51')]['id'];_0x20c935[_0xf106('0x4e')]=!![];_0x20c935[_0xf106('0x53')]=moment()[_0xf106('0x54')](_0xf106('0x55'));_0x20c935[_0xf106('0x56')]=_0x59bd01[_0xf106('0x57')];_0x20c935[_0xf106('0x58')]=_0x59bd01['VoiceQueueId']?'queue':_0xf106('0x59');return db[_0xf106('0x5a')][_0xf106('0x3f')]({'where':{'id':_0x20c935['ContactId']},'attributes':[_0xf106('0x5b'),'lastName']})[_0xf106('0x3c')](function(_0x332a79){if(!_[_0xf106('0x5c')](_0x519192)&&!_['isNil'](_0x332a79[_0xf106('0x5b')])){_0x20c935['calleridname']=_0x332a79[_0xf106('0x5b')];if(!_[_0xf106('0x5c')](_0x332a79['lastName'])){_0x20c935[_0xf106('0x5d')]+='\x20'+_0x332a79[_0xf106('0x5e')];}}})['finally'](function(){return db[_0xf106('0x5f')][_0xf106('0x41')](_0x20c935);});}})['then'](function(_0x24f283){return db['CmHopperAdditionalPhone'][_0xf106('0x44')]({'where':{'CmHopperId':_0x37dc6a}});})[_0xf106('0x3c')](function(){return _0x519192['status'](0xcc)[_0xf106('0x60')]();})['catch'](handleError(_0x519192,null));};exports['getPreview']=function(_0x151d33,_0x1b903b){var _0x15bf0f=[];return db[_0xf106('0x5a')][_0xf106('0x43')]()[_0xf106('0x3c')](function(_0xe2c0ee){_0x15bf0f=_[_0xf106('0x19')](_0xe2c0ee);return _0x151d33[_0xf106('0x51')][_0xf106('0x61')]({'where':{'type':_0xf106('0x62'),'dialActive':!![],'dialMethod':_0xf106('0x63')},'attributes':['id',_0xf106('0x64'),_0xf106('0x65')],'raw':!![]});})[_0xf106('0x3c')](function(_0x40bc98){if(_0x40bc98&&_0x40bc98['length']){return db[_0xf106('0x66')]['transaction'](function(_0x40be0c){var _0x505f8f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf106('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x40bc98,'id')},'$or':[{'UserId':null},{'UserId':_0x151d33[_0xf106('0x51')]['id']}]};var _0x3c07c6={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x40bc98)[_0xf106('0x3a')]([_0xf106('0x65'),0x0])[_0xf106('0x12')]('id')[_0xf106('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x151d33[_0xf106('0x51')]['id']}]};var _0x1eac36={'$or':[_0x505f8f,_0x3c07c6]};var _0x409d13=[];if(_0x151d33['body'][_0xf106('0x68')]&&_0x151d33[_0xf106('0x42')]['direction']===_0xf106('0x69')){if(!_['isEmpty'](_0x151d33[_0xf106('0x42')][_0xf106('0x6a')])){_0x1eac36['id']={'$in':_0x151d33[_0xf106('0x42')][_0xf106('0x6a')]};}_0x409d13=[['priority',_0xf106('0x6b')],[_0xf106('0x6c'),_0x40bc98[0x0][_0xf106('0x64')]===_0xf106('0x6b')?'DESC':_0xf106('0x6b')],db[_0xf106('0x66')][_0xf106('0x6d')](_0xf106('0x6e')),['id',_0xf106('0x6f')]];}else{if(!_[_0xf106('0x70')](_0x151d33[_0xf106('0x42')][_0xf106('0x6a')])){_0x1eac36['id']={'$notIn':_0x151d33[_0xf106('0x42')][_0xf106('0x6a')]};}_0x409d13=[[_0xf106('0x71'),_0xf106('0x6f')],['scheduledAt',_0x40bc98[0x0][_0xf106('0x64')]],db[_0xf106('0x66')][_0xf106('0x6d')](_0xf106('0x72')),['id',_0xf106('0x6b')]];}return db['CmHopper'][_0xf106('0x73')]({'attributes':['id',_0xf106('0x74'),_0xf106('0x57'),'recallme'],'where':_0x1eac36,'order':_0x409d13,'transaction':_0x40be0c,'lock':_0x40be0c[_0xf106('0x75')]['UPDATE'],'include':[{'model':db[_0xf106('0x5a')],'as':_0xf106('0x76'),'attributes':_0x15bf0f,'include':[{'model':db[_0xf106('0x77')],'as':_0xf106('0x78'),'attributes':['id',_0xf106('0xf')]}]},{'model':db['CmList'],'as':_0xf106('0x79'),'attributes':['id','name']},{'model':db[_0xf106('0x47')],'as':_0xf106('0x7a'),'attributes':['id',_0xf106('0xf'),_0xf106('0x7b')]}]})[_0xf106('0x3c')](function(_0x27f68c){if(_0x27f68c){return _0x27f68c[_0xf106('0xd')]({'UserId':_0x151d33[_0xf106('0x51')]['id']},{'transaction':_0x40be0c});}});});}})['then'](handleEntityNotFound(_0x1b903b,null))[_0xf106('0x3c')](respondWithResult(_0x1b903b,null))['catch'](handleError(_0x1b903b,null));};exports[_0xf106('0x7c')]=function(_0x4393b1,_0x5974ed,_0x1d4b0f){var _0x340317=[];var _0x5258ad=_0x4393b1[_0xf106('0x45')]['id'];var _0x5eafcf=_0x4393b1[_0xf106('0x51')]['id'];return db[_0xf106('0x5a')][_0xf106('0x43')]()['then'](function(_0x35263c){_0x340317=_['keys'](_0x35263c);return db[_0xf106('0x66')]['transaction'](function(_0x26fc26){const _0x28e042={'id':_0x5258ad};return db[_0xf106('0x13')][_0xf106('0x73')]({'attributes':['id',_0xf106('0x74'),_0xf106('0x7d')],'where':_0x28e042,'transaction':_0x26fc26,'lock':_0x26fc26[_0xf106('0x75')][_0xf106('0x7e')],'include':[{'model':db[_0xf106('0x5a')],'as':_0xf106('0x76'),'attributes':_0x340317,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xf106('0xf')]}]},{'model':db[_0xf106('0x7f')],'as':_0xf106('0x79'),'attributes':['id',_0xf106('0xf')]},{'model':db[_0xf106('0x47')],'as':_0xf106('0x7a'),'attributes':['id','name',_0xf106('0x7b')]}]})[_0xf106('0x3c')](function(_0x4b5ef5){if(_0x4b5ef5){return _0x4b5ef5[_0xf106('0xd')]({'UserId':_0x5eafcf},{'transaction':_0x26fc26});}});});})[_0xf106('0x3c')](handleEntityNotFound(_0x5974ed,null))['then'](respondWithResult(_0x5974ed,null))[_0xf106('0x40')](handleError(_0x5974ed,null));};exports[_0xf106('0x80')]=function(_0x1ce81f,_0x5a1d5e){return _0x1ce81f[_0xf106('0x51')][_0xf106('0x61')]({'where':{'type':_0xf106('0x62'),'dialActive':!![],'dialMethod':_0xf106('0x63')},'attributes':['id'],'raw':!![]})[_0xf106('0x3c')](function(_0x2f6a31){if(_0x2f6a31&&_0x2f6a31[_0xf106('0x31')]){return db[_0xf106('0x13')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf106('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x2f6a31,'id')},'$or':[{'UserId':null},{'UserId':_0x1ce81f['user']['id']}]}});}return 0x0;})[_0xf106('0x3c')](function(_0x5547ed){if(!_[_0xf106('0x5c')](_0x5547ed)&&_['isNumber'](_0x5547ed)){return _0x5a1d5e[_0xf106('0x5')](0xc8)[_0xf106('0x6')]({'contacts':_0x5547ed});}else{logger['error'](_0xf106('0x81'),_0xf106('0x80'),0x194,_0xf106('0x82'));_0x5a1d5e[_0xf106('0x83')](0x194);}})[_0xf106('0x40')](handleError(_0x5a1d5e,null));};exports[_0xf106('0x84')]=function(_0x50d390,_0x92e626){var _0x4760fd=shared['timezones'];var _0x4b6927=[];_[_0xf106('0x12')](_0x4760fd,function(_0x1f2297){_0x4b6927[_0xf106('0x85')]({'id':_0x1f2297[_0xf106('0xf')],'name':_0x1f2297[_0xf106('0xf')],'utcOffset':_0x1f2297[_0xf106('0x86')]});});return _0x92e626[_0xf106('0x5')](0xc8)[_0xf106('0x6')]({'tz':_0x4b6927});};exports[_0xf106('0x87')]=function(_0x578815,_0x3e037e){var _0x10fb6e=shared['timezones'];var _0x4986c9={};if(!_[_0xf106('0x5c')](_0x10fb6e[_0x578815[_0xf106('0x42')]['id']]))_0x4986c9=_0x10fb6e[_0x578815['body']['id']];return _0x3e037e[_0xf106('0x5')](0xc8)['json'](_0x4986c9);}; \ No newline at end of file +var _0x7a59=['$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','model','keys','rawAttributes','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','dataValues','createdAt','updatedAt','campaign','membername','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','outbound','preview','sequelize','dialPreviewAutoRecallMe','value','direction','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','transaction','LOCK','CmList','dialActive','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','update','then','sendStatus','error','stack','name','send','map','CmHopper','fieldName','type','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x7a59,0x16e));var _0x97a5=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x7a59[_0xfbdff6];return _0x4cb9be;};'use strict';var moment=require(_0x97a5('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x97a5('0x1'))(_0x97a5('0x2'));var shared=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];function respondWithResult(_0x281bfd,_0x5e2db0){_0x5e2db0=_0x5e2db0||0xc8;return function(_0x3ba155){if(_0x3ba155){return _0x281bfd[_0x97a5('0x5')](_0x5e2db0)[_0x97a5('0x6')](_0x3ba155);}};}function respondWithFilteredResult(_0x48201b,_0x438520){return function(_0x52d32f){if(_0x52d32f){var _0x2663b9=typeof _0x438520[_0x97a5('0x7')]===_0x97a5('0x8')&&typeof _0x438520[_0x97a5('0x9')]===_0x97a5('0x8');var _0x5a51bc=_0x52d32f[_0x97a5('0xa')];var _0x101c3f=_0x2663b9?0x0:_0x438520[_0x97a5('0x7')];var _0x388bd7=_0x2663b9?_0x52d32f[_0x97a5('0xa')]:_0x438520['offset']+_0x438520['limit'];var _0x11d2eb;if(_0x388bd7>=_0x5a51bc){_0x388bd7=_0x5a51bc;_0x11d2eb=0xc8;}else{_0x11d2eb=0xce;}_0x48201b[_0x97a5('0x5')](_0x11d2eb);return _0x48201b[_0x97a5('0xb')]('Content-Range',_0x101c3f+'-'+_0x388bd7+'/'+_0x5a51bc)[_0x97a5('0x6')](_0x52d32f);}return null;};}function saveUpdates(_0x350720,_0x55305a){return function(_0x4f85a0){if(_0x4f85a0){return _0x4f85a0[_0x97a5('0xc')](_0x350720)[_0x97a5('0xd')](function(_0x50d291){return _0x50d291;});}return null;};}function handleEntityNotFound(_0x595437,_0x51d5e2){return function(_0x5a4471){if(!_0x5a4471){_0x595437[_0x97a5('0xe')](0x194);}return _0x5a4471;};}function handleError(_0x3dfb08,_0x3603e4){_0x3603e4=_0x3603e4||0x1f4;return function(_0x4d8ba7){logger[_0x97a5('0xf')](_0x4d8ba7[_0x97a5('0x10')]);if(_0x4d8ba7['name']){delete _0x4d8ba7[_0x97a5('0x11')];}_0x3dfb08['status'](_0x3603e4)[_0x97a5('0x12')](_0x4d8ba7);};}exports['index']=function(_0x4b7a38,_0x52ce92){var _0x32b00d={},_0x5c5740={},_0x79a5f7={'count':0x0,'rows':[]};var _0x9863ea=_[_0x97a5('0x13')](db[_0x97a5('0x14')]['rawAttributes'],function(_0x57dc28){return{'name':_0x57dc28[_0x97a5('0x15')],'type':_0x57dc28[_0x97a5('0x16')]['key']};});_0x5c5740['model']=_[_0x97a5('0x13')](_0x9863ea,_0x97a5('0x11'));_0x5c5740[_0x97a5('0x17')]=_['keys'](_0x4b7a38[_0x97a5('0x17')]);_0x5c5740[_0x97a5('0x18')]=_[_0x97a5('0x19')](_0x5c5740['model'],_0x5c5740[_0x97a5('0x17')]);_0x5c5740[_0x97a5('0x18')]=_['concat'](_0x5c5740[_0x97a5('0x18')],[_0x97a5('0x1a'),_0x97a5('0x1b'),_0x97a5('0x1c'),_0x97a5('0x1d'),_0x97a5('0x1e'),_0x97a5('0x1f'),_0x97a5('0x20'),_0x97a5('0x21'),'$not',_0x97a5('0x22'),_0x97a5('0x23'),_0x97a5('0x24'),_0x97a5('0x25'),_0x97a5('0x26'),_0x97a5('0x27'),'$iLike',_0x97a5('0x28'),_0x97a5('0x26'),'$overlap',_0x97a5('0x29'),_0x97a5('0x2a'),'$any']);_0x32b00d[_0x97a5('0x2b')]=_[_0x97a5('0x19')](_0x5c5740['model'],qs[_0x97a5('0x2c')](_0x4b7a38['query'][_0x97a5('0x2c')]));_0x32b00d[_0x97a5('0x2b')]=_0x32b00d[_0x97a5('0x2b')][_0x97a5('0x2d')]?_0x32b00d['attributes']:_0x5c5740['model'];if(!_0x4b7a38[_0x97a5('0x17')][_0x97a5('0x2e')](_0x97a5('0x2f'))){_0x32b00d['limit']=qs[_0x97a5('0x9')](_0x4b7a38[_0x97a5('0x17')]['limit']);_0x32b00d[_0x97a5('0x7')]=qs[_0x97a5('0x7')](_0x4b7a38['query'][_0x97a5('0x7')]);}_0x32b00d[_0x97a5('0x30')]=qs[_0x97a5('0x31')](_0x4b7a38['query'][_0x97a5('0x31')]);_0x32b00d[_0x97a5('0x32')]=qs[_0x97a5('0x18')](_[_0x97a5('0x33')](_0x4b7a38[_0x97a5('0x17')],_0x5c5740[_0x97a5('0x18')]),_0x9863ea);if(_0x4b7a38[_0x97a5('0x17')]['filter']){_0x32b00d[_0x97a5('0x32')]=_[_0x97a5('0x34')](_0x32b00d[_0x97a5('0x32')],{'$or':_[_0x97a5('0x13')](_0x9863ea,function(_0x369d7b){if(_0x369d7b[_0x97a5('0x16')]!==_0x97a5('0x35')){var _0x59ba99={};_0x59ba99[_0x369d7b[_0x97a5('0x11')]]={'$like':'%'+_0x4b7a38[_0x97a5('0x17')][_0x97a5('0x36')]+'%'};return _0x59ba99;}})});}_0x32b00d=_[_0x97a5('0x34')]({},_0x32b00d,_0x4b7a38[_0x97a5('0x37')]);var _0x49b19a={'where':_0x32b00d[_0x97a5('0x32')]};return db[_0x97a5('0x14')][_0x97a5('0xa')](_0x49b19a)[_0x97a5('0xd')](function(_0x2aec4e){_0x79a5f7['count']=_0x2aec4e;if(_0x4b7a38['query'][_0x97a5('0x38')]){_0x32b00d[_0x97a5('0x39')]=[{'all':!![]}];}return db[_0x97a5('0x14')][_0x97a5('0x3a')](_0x32b00d);})[_0x97a5('0xd')](function(_0x3dd209){_0x79a5f7['rows']=_0x3dd209;return _0x79a5f7;})[_0x97a5('0xd')](respondWithFilteredResult(_0x52ce92,_0x32b00d))['catch'](handleError(_0x52ce92,null));};exports[_0x97a5('0x3b')]=function(_0x1bde97,_0x30fc3b){var _0x798318={'raw':!![],'where':{'id':_0x1bde97['params']['id']}},_0x341cba={};_0x341cba[_0x97a5('0x3c')]=_[_0x97a5('0x3d')](db[_0x97a5('0x14')][_0x97a5('0x3e')]);_0x341cba[_0x97a5('0x17')]=_['keys'](_0x1bde97['query']);_0x341cba[_0x97a5('0x18')]=_[_0x97a5('0x19')](_0x341cba[_0x97a5('0x3c')],_0x341cba[_0x97a5('0x17')]);_0x798318['attributes']=_[_0x97a5('0x19')](_0x341cba['model'],qs[_0x97a5('0x2c')](_0x1bde97[_0x97a5('0x17')][_0x97a5('0x2c')]));_0x798318['attributes']=_0x798318[_0x97a5('0x2b')][_0x97a5('0x2d')]?_0x798318['attributes']:_0x341cba[_0x97a5('0x3c')];if(_0x1bde97[_0x97a5('0x17')][_0x97a5('0x38')]){_0x798318[_0x97a5('0x39')]=[{'all':!![]}];}_0x798318=_[_0x97a5('0x34')]({},_0x798318,_0x1bde97[_0x97a5('0x37')]);return db[_0x97a5('0x14')][_0x97a5('0x3f')](_0x798318)[_0x97a5('0xd')](handleEntityNotFound(_0x30fc3b,null))[_0x97a5('0xd')](respondWithResult(_0x30fc3b,null))[_0x97a5('0x40')](handleError(_0x30fc3b,null));};exports[_0x97a5('0x41')]=function(_0x5d54cc,_0x5c73f){return db[_0x97a5('0x14')][_0x97a5('0x41')](_0x5d54cc['body'],{})[_0x97a5('0xd')](respondWithResult(_0x5c73f,0xc9))[_0x97a5('0x40')](handleError(_0x5c73f,null));};exports[_0x97a5('0xc')]=function(_0x218f2b,_0x4b816){if(_0x218f2b['body']['id']){delete _0x218f2b[_0x97a5('0x42')]['id'];}return db[_0x97a5('0x14')][_0x97a5('0x3f')]({'where':{'id':_0x218f2b[_0x97a5('0x43')]['id']}})[_0x97a5('0xd')](handleEntityNotFound(_0x4b816,null))['then'](saveUpdates(_0x218f2b[_0x97a5('0x42')],null))['then'](respondWithResult(_0x4b816,null))[_0x97a5('0x40')](handleError(_0x4b816,null));};exports[_0x97a5('0x44')]=function(_0x330f6a,_0x4b3c38){return db[_0x97a5('0x14')][_0x97a5('0x44')]()[_0x97a5('0xd')](respondWithResult(_0x4b3c38,null))[_0x97a5('0x40')](handleError(_0x4b3c38,null));};exports[_0x97a5('0x45')]=function(_0x42ced6,_0x49b215){var _0x318469;var _0x7edab1=_0x42ced6[_0x97a5('0x43')]['id'];return db[_0x97a5('0x14')]['find']({'where':{'id':_0x42ced6[_0x97a5('0x43')]['id']}})[_0x97a5('0xd')](handleEntityNotFound(_0x49b215,null))['then'](function(_0x257a5d){if(_0x257a5d){return _0x257a5d[_0x97a5('0x45')]()[_0x97a5('0xd')](function(_0x56890f){return _0x56890f;});}})[_0x97a5('0xd')](function(_0x34d934){_0x318469=_0x34d934;if(_0x34d934){if(_0x34d934['VoiceQueueId']||_0x34d934[_0x97a5('0x46')]){return db[_0x34d934[_0x97a5('0x47')]?_0x97a5('0x48'):'Campaign'][_0x97a5('0x3f')]({'where':{'id':_0x34d934[_0x97a5('0x47')]?_0x34d934[_0x97a5('0x47')]:_0x34d934['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x97a5('0xd')](function(_0x7c4886){var _0x3ccb26={};if(_0x7c4886){_[_0x97a5('0x34')](_0x3ccb26,_['omit'](_0x318469[_0x97a5('0x49')],[_0x97a5('0x4a'),_0x97a5('0x4b'),'id']));_0x3ccb26['state']=0x15;_0x3ccb26['statedesc']='deleted';_0x3ccb26[_0x97a5('0x4c')]=_0x7c4886[_0x97a5('0x11')];_0x3ccb26[_0x97a5('0x4d')]=_0x42ced6['user'][_0x97a5('0x11')];_0x3ccb26[_0x97a5('0x4e')]=_0x42ced6[_0x97a5('0x4f')]['id'];_0x3ccb26[_0x97a5('0x50')]=!![];_0x3ccb26[_0x97a5('0x51')]=moment()[_0x97a5('0x52')](_0x97a5('0x53'));_0x3ccb26['calleridnum']=_0x318469[_0x97a5('0x54')];_0x3ccb26['campaigntype']=_0x318469[_0x97a5('0x47')]?'queue':'ivr';return db[_0x97a5('0x55')][_0x97a5('0x3f')]({'where':{'id':_0x3ccb26['ContactId']},'attributes':[_0x97a5('0x56'),_0x97a5('0x57')]})['then'](function(_0x116ded){if(!_['isNil'](_0x49b215)&&!_[_0x97a5('0x58')](_0x116ded['firstName'])){_0x3ccb26[_0x97a5('0x59')]=_0x116ded['firstName'];if(!_[_0x97a5('0x58')](_0x116ded[_0x97a5('0x57')])){_0x3ccb26['calleridname']+='\x20'+_0x116ded[_0x97a5('0x57')];}}})['finally'](function(){return db[_0x97a5('0x5a')]['create'](_0x3ccb26);});}})['then'](function(_0x537e29){return db[_0x97a5('0x5b')][_0x97a5('0x45')]({'where':{'CmHopperId':_0x7edab1}});})[_0x97a5('0xd')](function(){return _0x49b215[_0x97a5('0x5')](0xcc)[_0x97a5('0x5c')]();})[_0x97a5('0x40')](handleError(_0x49b215,null));};exports[_0x97a5('0x5d')]=function(_0xbfde6,_0x522e6f){var _0x5bec31=[];return db['CmContact'][_0x97a5('0x44')]()['then'](function(_0x5ba758){_0x5bec31=_[_0x97a5('0x3d')](_0x5ba758);return _0xbfde6[_0x97a5('0x4f')]['getVoiceQueues']({'where':{'type':_0x97a5('0x5e'),'dialActive':!![],'dialMethod':_0x97a5('0x5f')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x97a5('0xd')](function(_0x2b7156){if(_0x2b7156&&_0x2b7156[_0x97a5('0x2d')]){return db[_0x97a5('0x60')]['transaction'](function(_0x30d166){var _0x270991={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x97a5('0x52')](_0x97a5('0x53'))},'VoiceQueueId':{'$in':_[_0x97a5('0x13')](_0x2b7156,'id')},'$or':[{'UserId':null},{'UserId':_0xbfde6['user']['id']}]};var _0x4914ca={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2b7156)[_0x97a5('0x36')]([_0x97a5('0x61'),0x0])['map']('id')[_0x97a5('0x62')]()},'$or':[{'UserId':null},{'UserId':_0xbfde6[_0x97a5('0x4f')]['id']}]};var _0x31460b={'$or':[_0x270991,_0x4914ca]};var _0x3ba5db=[];if(_0xbfde6['body'][_0x97a5('0x63')]&&_0xbfde6['body']['direction']==='prev'){if(!_['isEmpty'](_0xbfde6[_0x97a5('0x42')][_0x97a5('0x64')])){_0x31460b['id']={'$in':_0xbfde6[_0x97a5('0x42')][_0x97a5('0x64')]};}_0x3ba5db=[[_0x97a5('0x65'),_0x97a5('0x66')],[_0x97a5('0x67'),_0x2b7156[0x0][_0x97a5('0x68')]==='ASC'?_0x97a5('0x69'):_0x97a5('0x66')],db['sequelize'][_0x97a5('0x6a')](_0x97a5('0x6b')),['id','DESC']];}else{if(!_[_0x97a5('0x6c')](_0xbfde6[_0x97a5('0x42')]['hopperIds'])){_0x31460b['id']={'$notIn':_0xbfde6[_0x97a5('0x42')][_0x97a5('0x64')]};}_0x3ba5db=[['priority','DESC'],[_0x97a5('0x67'),_0x2b7156[0x0]['dialOrderByScheduledAt']],db[_0x97a5('0x60')]['literal'](_0x97a5('0x6d')),['id',_0x97a5('0x66')]];}return db[_0x97a5('0x14')][_0x97a5('0x6e')]({'attributes':['id',_0x97a5('0x6f'),_0x97a5('0x54'),_0x97a5('0x70')],'where':_0x31460b,'order':_0x3ba5db,'transaction':_0x30d166,'lock':_0x30d166['LOCK'][_0x97a5('0x71')],'include':[{'model':db[_0x97a5('0x55')],'as':_0x97a5('0x72'),'attributes':_0x5bec31,'include':[{'model':db[_0x97a5('0x73')],'as':_0x97a5('0x74'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x97a5('0x75'),'attributes':['id',_0x97a5('0x11')]},{'model':db['VoiceQueue'],'as':_0x97a5('0x76'),'attributes':['id',_0x97a5('0x11'),'dialActive']}]})[_0x97a5('0xd')](function(_0x5df8b3){if(_0x5df8b3){return _0x5df8b3[_0x97a5('0xc')]({'UserId':_0xbfde6[_0x97a5('0x4f')]['id']},{'transaction':_0x30d166});}});});}})[_0x97a5('0xd')](handleEntityNotFound(_0x522e6f,null))[_0x97a5('0xd')](respondWithResult(_0x522e6f,null))[_0x97a5('0x40')](handleError(_0x522e6f,null));};exports['getPreviewRecall']=function(_0x2df3f0,_0x552e76,_0x3abe99){var _0x4f30fb=[];var _0x140320=_0x2df3f0[_0x97a5('0x43')]['id'];var _0x50979b=_0x2df3f0[_0x97a5('0x4f')]['id'];return db[_0x97a5('0x55')][_0x97a5('0x44')]()['then'](function(_0x274d85){_0x4f30fb=_[_0x97a5('0x3d')](_0x274d85);return db[_0x97a5('0x60')][_0x97a5('0x77')](function(_0x1981b9){const _0x360df4={'id':_0x140320};return db[_0x97a5('0x14')][_0x97a5('0x6e')]({'attributes':['id',_0x97a5('0x6f'),_0x97a5('0x70')],'where':_0x360df4,'transaction':_0x1981b9,'lock':_0x1981b9[_0x97a5('0x78')][_0x97a5('0x71')],'include':[{'model':db['CmContact'],'as':_0x97a5('0x72'),'attributes':_0x4f30fb,'include':[{'model':db[_0x97a5('0x73')],'as':_0x97a5('0x74'),'attributes':['id','name']}]},{'model':db[_0x97a5('0x79')],'as':'List','attributes':['id',_0x97a5('0x11')]},{'model':db[_0x97a5('0x48')],'as':_0x97a5('0x76'),'attributes':['id',_0x97a5('0x11'),_0x97a5('0x7a')]}]})['then'](function(_0x16eb72){if(_0x16eb72){return _0x16eb72[_0x97a5('0xc')]({'UserId':_0x50979b},{'transaction':_0x1981b9});}});});})[_0x97a5('0xd')](handleEntityNotFound(_0x552e76,null))[_0x97a5('0xd')](respondWithResult(_0x552e76,null))['catch'](handleError(_0x552e76,null));};exports['getOpenContacts']=function(_0x4fb59c,_0x14bab0){return _0x4fb59c[_0x97a5('0x4f')][_0x97a5('0x7b')]({'where':{'type':_0x97a5('0x5e'),'dialActive':!![],'dialMethod':_0x97a5('0x5f')},'attributes':['id'],'raw':!![]})[_0x97a5('0xd')](function(_0x277b35){if(_0x277b35&&_0x277b35[_0x97a5('0x2d')]){return db[_0x97a5('0x14')][_0x97a5('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x97a5('0x52')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x97a5('0x13')](_0x277b35,'id')},'$or':[{'UserId':null},{'UserId':_0x4fb59c[_0x97a5('0x4f')]['id']}]}});}return 0x0;})[_0x97a5('0xd')](function(_0x1995a7){if(!_['isNil'](_0x1995a7)&&_[_0x97a5('0x7c')](_0x1995a7)){return _0x14bab0[_0x97a5('0x5')](0xc8)['json']({'contacts':_0x1995a7});}else{logger[_0x97a5('0xf')](_0x97a5('0x7d'),_0x97a5('0x7e'),0x194,_0x97a5('0x7f'));_0x14bab0[_0x97a5('0xe')](0x194);}})[_0x97a5('0x40')](handleError(_0x14bab0,null));};exports[_0x97a5('0x80')]=function(_0x484282,_0x2c8fee){var _0x568396=shared[_0x97a5('0x81')];var _0x5a0b6d=[];_[_0x97a5('0x13')](_0x568396,function(_0xe46572){_0x5a0b6d[_0x97a5('0x82')]({'id':_0xe46572[_0x97a5('0x11')],'name':_0xe46572[_0x97a5('0x11')],'utcOffset':_0xe46572[_0x97a5('0x83')]});});return _0x2c8fee['status'](0xc8)['json']({'tz':_0x5a0b6d});};exports[_0x97a5('0x84')]=function(_0x59facf,_0x4eacff){var _0x162d93=shared[_0x97a5('0x81')];var _0x377257={};if(!_[_0x97a5('0x58')](_0x162d93[_0x59facf[_0x97a5('0x42')]['id']]))_0x377257=_0x162d93[_0x59facf[_0x97a5('0x42')]['id']];return _0x4eacff['status'](0xc8)[_0x97a5('0x6')](_0x377257);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6e0c570..00d8b97 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 _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x315b4f,_0x295860){var _0x1d1f56=function(_0x163d50){while(--_0x163d50){_0x315b4f['push'](_0x315b4f['shift']());}};_0x1d1f56(++_0x295860);}(_0xeff8,0x186));var _0x8eff=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xeff8[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xda19,0xd5));var _0x9da1=function(_0x5715ef,_0x55bcf7){_0x5715ef=_0x5715ef-0x0;var _0x49e2d8=_0xda19[_0x5715ef];return _0x49e2d8;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index dffea61..1dea8a3 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 _0x60a8=['ContactId','active','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','sequelize','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','GetCmHopperPreview','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','info','debug','stringify','error','message','ShowCmHopper','find','CreateCmHopper','create','body','then','catch','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','UPDATE','Contact','keys','User','name','voicePause','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x60a8,0x16a));var _0x860a=function(_0x152518,_0x5dbbe6){_0x152518=_0x152518-0x0;var _0x5b752f=_0x60a8[_0x152518];return _0x5b752f;};'use strict';var _=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var moment=require(_0x860a('0x2'));var BPromise=require(_0x860a('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x860a('0x4'))('rpc');exports[_0x860a('0x5')]=function(_0x4ec4ee){var _0x4d8583=this;return new Promise(function(_0x1e8cfb,_0x20be23){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'where':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')]['attributes']||null:null,'limit':_0x4ec4ee['options']?_0x4ec4ee['options'][_0x860a('0xb')]||null:null,'include':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x4ec4ee[_0x860a('0x8')][_0x860a('0xc')],function(_0x1747bb){return{'model':db[_0x1747bb[_0x860a('0xe')]],'as':_0x1747bb['as'],'attributes':_0x1747bb[_0x860a('0xf')],'include':_0x1747bb[_0x860a('0xc')]?_[_0x860a('0xd')](_0x1747bb[_0x860a('0xc')],function(_0xca8754){return{'model':db[_0xca8754['model']],'as':_0xca8754['as'],'attributes':_0xca8754[_0x860a('0xf')],'include':_0xca8754[_0x860a('0xc')]?_['map'](_0xca8754[_0x860a('0xc')],function(_0x445193){return{'model':db[_0x445193[_0x860a('0xe')]],'as':_0x445193['as'],'attributes':_0x445193['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20eca6){logger[_0x860a('0x10')](_0x860a('0x5'),_0x4ec4ee);logger[_0x860a('0x11')]('GetCmHopper',_0x4ec4ee,JSON[_0x860a('0x12')](_0x20eca6));_0x1e8cfb(_0x20eca6);})['catch'](function(_0x2a9591){logger[_0x860a('0x13')]('GetCmHopper',_0x2a9591[_0x860a('0x14')],_0x4ec4ee);_0x20be23(_0x4d8583[_0x860a('0x13')](0x1f4,_0x2a9591[_0x860a('0x14')]));});});};exports[_0x860a('0x15')]=function(_0x41798b){var _0x85c2e3=this;return new Promise(function(_0x13f0fb,_0xf0ac9f){return db[_0x860a('0x6')][_0x860a('0x16')]({'raw':_0x41798b['options']?_0x41798b[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xf')]||null:null,'include':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x41798b[_0x860a('0x8')]['include'],function(_0x33a0c5){return{'model':db[_0x33a0c5[_0x860a('0xe')]],'as':_0x33a0c5['as'],'attributes':_0x33a0c5[_0x860a('0xf')],'include':_0x33a0c5[_0x860a('0xc')]?_[_0x860a('0xd')](_0x33a0c5[_0x860a('0xc')],function(_0x388a0a){return{'model':db[_0x388a0a[_0x860a('0xe')]],'as':_0x388a0a['as'],'attributes':_0x388a0a[_0x860a('0xf')],'include':_0x388a0a['include']?_['map'](_0x388a0a[_0x860a('0xc')],function(_0x5dd335){return{'model':db[_0x5dd335[_0x860a('0xe')]],'as':_0x5dd335['as'],'attributes':_0x5dd335[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d5af8){logger[_0x860a('0x10')](_0x860a('0x15'),_0x41798b);logger['debug']('ShowCmHopper',_0x41798b,JSON[_0x860a('0x12')](_0x8d5af8));_0x13f0fb(_0x8d5af8);})['catch'](function(_0xf0e855){logger['error'](_0x860a('0x15'),_0xf0e855[_0x860a('0x14')],_0x41798b);_0xf0ac9f(_0x85c2e3[_0x860a('0x13')](0x1f4,_0xf0e855['message']));});});};exports[_0x860a('0x17')]=function(_0x3809c3){var _0x4ed18f=this;return new Promise(function(_0x457396,_0x28e4fd){return db[_0x860a('0x6')][_0x860a('0x18')](_0x3809c3[_0x860a('0x19')],{'raw':_0x3809c3[_0x860a('0x8')]?_0x3809c3[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![]})[_0x860a('0x1a')](function(_0x403eae){logger[_0x860a('0x10')]('CreateCmHopper',_0x3809c3);logger[_0x860a('0x11')](_0x860a('0x17'),_0x3809c3,JSON[_0x860a('0x12')](_0x403eae));_0x457396(_0x403eae);})[_0x860a('0x1b')](function(_0x344cde){logger[_0x860a('0x13')](_0x860a('0x17'),_0x344cde[_0x860a('0x14')],_0x3809c3);_0x28e4fd(_0x4ed18f[_0x860a('0x13')](0x1f4,_0x344cde[_0x860a('0x14')]));});});};exports[_0x860a('0x1c')]=function(_0x525d36){var _0x559c30=this;return new Promise(function(_0x42f7ba,_0x415674){return db[_0x860a('0x6')][_0x860a('0x1d')](_0x525d36[_0x860a('0x19')],{'raw':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x525d36[_0x860a('0x8')]?_0x525d36['options'][_0x860a('0xf')]||null:null,'limit':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0xb')]||null:null})[_0x860a('0x1a')](function(_0x670a9e){logger[_0x860a('0x10')](_0x860a('0x1c'),_0x525d36);logger[_0x860a('0x10')](_0x860a('0x1e'),JSON[_0x860a('0x12')](_0x525d36[_0x860a('0x8')][_0x860a('0xa')]),_0x525d36[_0x860a('0x19')]['active']);logger[_0x860a('0x11')](_0x860a('0x1c'),_0x525d36,JSON[_0x860a('0x12')](_0x670a9e));_0x42f7ba(_0x670a9e);})[_0x860a('0x1b')](function(_0x2deed9){logger['error']('UpdateCmHopper',_0x2deed9[_0x860a('0x14')],_0x525d36);_0x415674(_0x559c30['error'](0x1f4,_0x2deed9[_0x860a('0x14')]));});});};exports[_0x860a('0x1f')]=function(_0x3a13a6){var _0x1bb835=this;return new Promise(function(_0x3aa701,_0x3026fe){return db[_0x860a('0x6')][_0x860a('0x20')]({'where':_0x3a13a6[_0x860a('0x8')]?_0x3a13a6[_0x860a('0x8')][_0x860a('0xa')]||null:null})[_0x860a('0x1a')](function(_0x4d228e){logger['info']('DestroyCmHopper',_0x3a13a6);logger['debug']('DestroyCmHopper',_0x3a13a6,JSON[_0x860a('0x12')](_0x4d228e));_0x3aa701(_0x4d228e);})['catch'](function(_0x5b6e3b){logger['error'](_0x860a('0x1f'),_0x5b6e3b[_0x860a('0x14')],_0x3a13a6);_0x3026fe(_0x1bb835[_0x860a('0x13')](0x1f4,_0x5b6e3b[_0x860a('0x14')]));});});};exports[_0x860a('0x21')]=function(_0x409cf6){var _0x2bb2f6=this;return new Promise(function(_0x27b0c4,_0x3214bd){return db[_0x860a('0x22')][_0x860a('0x23')]()[_0x860a('0x1a')](function(_0x446a1e){return db['sequelize']['transaction'](function(_0x43f736){return db[_0x860a('0x6')][_0x860a('0x7')]({'where':_0x409cf6[_0x860a('0x8')]?_0x409cf6['options'][_0x860a('0xa')]||null:null,'attributes':_0x409cf6[_0x860a('0x8')]?_0x409cf6[_0x860a('0x8')][_0x860a('0xf')]||null:null,'limit':_0x409cf6['options']?_0x409cf6['options'][_0x860a('0xb')]||null:null,'order':_0x409cf6['options']?_0x409cf6['options'][_0x860a('0x24')]||null:null,'transaction':_0x43f736,'lock':_0x43f736['LOCK'][_0x860a('0x25')],'include':[{'model':db[_0x860a('0x22')],'as':_0x860a('0x26'),'attributes':_[_0x860a('0x27')](_0x446a1e)},{'model':db[_0x860a('0x28')],'as':'Agent','attributes':['id',_0x860a('0x29'),_0x860a('0x2a')]}]})[_0x860a('0x1a')](function(_0x3bd842){var _0x14efea=[];var _0x348750=[];for(var _0x91cadf=0x0;_0x91cadf<_0x3bd842['length'];_0x91cadf+=0x1){var _0x100e22=_0x3bd842[_0x91cadf]['UserId'];if(_0x100e22===null){_0x14efea[_0x860a('0x2b')](_0x3bd842[_0x91cadf][_0x860a('0x1d')](_0x409cf6[_0x860a('0x19')],{'transaction':_0x43f736}));}else if(!_0x348750['includes'](_0x100e22)){_0x348750['push'](_0x100e22);_0x14efea[_0x860a('0x2b')](_0x3bd842[_0x91cadf]['update'](_0x409cf6['body'],{'transaction':_0x43f736}));}}return BPromise[_0x860a('0x2c')](_0x14efea);});})['then'](function(_0x4afe41){logger[_0x860a('0x10')](_0x860a('0x21'),_0x409cf6);if(_0x4afe41[_0x860a('0x2d')]>0x0){logger[_0x860a('0x10')](_0x860a('0x2e'),_0x4afe41[0x0][_0x860a('0x2f')]['id'],_0x4afe41[0x0]['dataValues'][_0x860a('0x30')],_0x4afe41[0x0][_0x860a('0x2f')][_0x860a('0x31')]);}logger[_0x860a('0x11')](_0x860a('0x21'),_0x409cf6,JSON[_0x860a('0x12')](_0x4afe41));_0x27b0c4(_0x4afe41);})['catch'](function(_0x58dff9){logger[_0x860a('0x13')]('GetContactDialer',_0x58dff9[_0x860a('0x14')],_0x409cf6);_0x3214bd(_0x2bb2f6[_0x860a('0x13')](0x1f4,_0x58dff9[_0x860a('0x14')]));});});});};exports[_0x860a('0x32')]=function(_0xba8782){var _0x559f0f=this;return new Promise(function(_0x4c7cab,_0x44348f){return db['sequelize'][_0x860a('0x33')](function(_0x103220){return db[_0x860a('0x34')][_0x860a('0x18')](_0xba8782[_0x860a('0x19')],{'raw':_0xba8782[_0x860a('0x8')]?_0xba8782[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'transaction':_0x103220})[_0x860a('0x1a')](function(){logger[_0x860a('0x10')](_0x860a('0x35'),JSON[_0x860a('0x12')](_0xba8782[_0x860a('0x8')][_0x860a('0xa')]),_0xba8782[_0x860a('0x8')][_0x860a('0xa')][_0x860a('0x31')]);return db[_0x860a('0x6')][_0x860a('0x20')]({'where':_0xba8782[_0x860a('0x8')]?_0xba8782[_0x860a('0x8')][_0x860a('0xa')]||null:null,'transaction':_0x103220});});})[_0x860a('0x1a')](function(_0x3289d0){logger[_0x860a('0x10')](_0x860a('0x32'),_0xba8782);logger[_0x860a('0x11')]('MoveContactManagedDialer',_0xba8782,JSON[_0x860a('0x12')](_0x3289d0));_0x4c7cab(_0x3289d0);})[_0x860a('0x1b')](function(_0x371d86){logger[_0x860a('0x13')](_0x860a('0x32'),_0x371d86[_0x860a('0x14')],_0xba8782);_0x44348f(_0x559f0f[_0x860a('0x13')](0x1f4,_0x371d86[_0x860a('0x14')]));});});};exports[_0x860a('0x36')]=function(_0x8cc823){var _0x47ec75=this;return new Promise(function(_0x555f4a,_0x280c8d){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x8cc823[_0x860a('0x8')]?_0x8cc823[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'where':_0x8cc823['options']?_0x8cc823[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0x860a('0x37'),db[_0x860a('0x38')]['fn']('IF',db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x3a')+util['format'](_0x860a('0x3b'),moment()[_0x860a('0x3c')](_0x860a('0x3d')))+_0x860a('0x3e')))),_0x860a('0x3f')]]})[_0x860a('0x1a')](function(_0x11faa5){logger[_0x860a('0x10')](_0x860a('0x36'),_0x8cc823);logger[_0x860a('0x11')](_0x860a('0x36'),_0x8cc823,JSON['stringify'](_0x11faa5));_0x555f4a(_0x11faa5);})[_0x860a('0x1b')](function(_0x212607){logger['error'](_0x860a('0x36'),_0x212607[_0x860a('0x14')],_0x8cc823);_0x280c8d(_0x47ec75[_0x860a('0x13')](0x1f4,_0x212607[_0x860a('0x14')]));});});};exports[_0x860a('0x40')]=function(_0x1afb95){var _0x553fe2=this;return new Promise(function(_0x55d943,_0x3203cd){return db[_0x860a('0x22')]['describe']()[_0x860a('0x1a')](function(){return db[_0x860a('0x38')][_0x860a('0x33')](function(_0x215381){return db['CmHopper']['findAll']({'where':_0x1afb95[_0x860a('0x8')]?_0x1afb95[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x1afb95[_0x860a('0x8')]?_0x1afb95[_0x860a('0x8')][_0x860a('0xf')]||null:null,'limit':0x1,'order':_0x1afb95[_0x860a('0x8')]?_0x1afb95['options'][_0x860a('0x24')]||null:null,'group':db['CmHopper'][_0x860a('0x41')],'transaction':_0x215381,'lock':_0x215381[_0x860a('0x42')][_0x860a('0x25')],'include':_0x1afb95[_0x860a('0x8')]?_0x1afb95['options']['include']?_[_0x860a('0xd')](_0x1afb95[_0x860a('0x8')][_0x860a('0xc')],function(_0x42137b){return{'model':db[_0x42137b[_0x860a('0xe')]],'as':_0x42137b['as'],'attributes':_0x42137b['attributes'],'include':_0x42137b[_0x860a('0xc')]?_[_0x860a('0xd')](_0x42137b['include'],function(_0x4e497e){return{'model':db[_0x4e497e['model']],'as':_0x4e497e['as'],'attributes':_0x4e497e[_0x860a('0xf')],'include':_0x4e497e[_0x860a('0xc')]?_['map'](_0x4e497e['include'],function(_0xa16182){return{'model':db[_0xa16182['model']],'as':_0xa16182['as'],'attributes':_0xa16182[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})[_0x860a('0x1a')](function(_0x24b552){var _0x2663fc=[];for(var _0x4fd7e6=0x0;_0x4fd7e6<_0x24b552[_0x860a('0x2d')];_0x4fd7e6+=0x1){_0x2663fc[_0x860a('0x2b')](_0x24b552[_0x4fd7e6][_0x860a('0x1d')](_0x1afb95[_0x860a('0x19')],{'transaction':_0x215381}));}return BPromise[_0x860a('0x2c')](_0x2663fc);});})[_0x860a('0x1a')](function(_0x45f9ea){logger[_0x860a('0x10')](_0x860a('0x40'),_0x1afb95);logger[_0x860a('0x11')](_0x860a('0x40'),_0x1afb95,JSON[_0x860a('0x12')](_0x45f9ea));_0x55d943(_0x45f9ea);})[_0x860a('0x1b')](function(_0x8806cb){logger[_0x860a('0x13')](_0x860a('0x40'),_0x8806cb[_0x860a('0x14')],_0x1afb95);_0x3203cd(_0x553fe2[_0x860a('0x13')](0x1f4,_0x8806cb[_0x860a('0x14')]));});});});};exports[_0x860a('0x43')]=function(_0x3ebfed){var _0x47d654=this;return new Promise(function(_0x109def,_0x36f996){db[_0x860a('0x22')]['describe']()[_0x860a('0x1a')](function(_0x58627b){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')]['attributes']||null:null,'limit':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xb')]||null:null,'include':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x3ebfed[_0x860a('0x8')]['include'],function(_0x2efb82){return{'model':db[_0x2efb82[_0x860a('0xe')]],'as':_0x2efb82['as'],'attributes':_0x2efb82['as']===_0x860a('0x26')?_['keys'](_0x58627b):_0x2efb82[_0x860a('0xf')],'include':_0x2efb82[_0x860a('0xc')]?_['map'](_0x2efb82[_0x860a('0xc')],function(_0x1090ca){return{'model':db[_0x1090ca['model']],'as':_0x1090ca['as'],'attributes':_0x1090ca[_0x860a('0xf')],'include':_0x1090ca[_0x860a('0xc')]?_[_0x860a('0xd')](_0x1090ca[_0x860a('0xc')],function(_0x1e80fe){return{'model':db[_0x1e80fe['model']],'as':_0x1e80fe['as'],'attributes':_0x1e80fe[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})[_0x860a('0x1a')](function(_0x384f58){logger[_0x860a('0x10')](_0x860a('0x5'),_0x3ebfed);logger[_0x860a('0x11')]('GetCmHopper',_0x3ebfed,JSON[_0x860a('0x12')](_0x384f58));_0x109def(_0x384f58);})['catch'](function(_0x1a5f0e){logger[_0x860a('0x13')]('GetCmHopper',_0x1a5f0e[_0x860a('0x14')],_0x3ebfed);_0x36f996(_0x47d654[_0x860a('0x13')](0x1f4,_0x1a5f0e[_0x860a('0x14')]));});});});};exports[_0x860a('0x44')]=function(_0x27983d){var _0x430d73=this;return new Promise(function(_0x1e6d2f,_0x412b6c){return db[_0x860a('0x22')][_0x860a('0x45')]({'raw':!![],'where':{'phone':_0x27983d[_0x860a('0x8')][_0x860a('0xa')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x860a('0x46')]]})[_0x860a('0x1a')](function(_0x376622){logger['info'](_0x860a('0x47'),_0x27983d);logger[_0x860a('0x11')](_0x860a('0x47'),_0x27983d,JSON['stringify'](_0x376622));_0x1e6d2f(_0x376622);})['catch'](function(_0x5e9676){logger['error'](_0x860a('0x47'),_0x5e9676[_0x860a('0x14')],_0x27983d);_0x412b6c(_0x430d73[_0x860a('0x13')](0x1f4,_0x5e9676[_0x860a('0x14')]));});});};exports[_0x860a('0x48')]=function(_0x5ef95c){var _0x57f023=this;return new Promise(function(_0x18a867,_0x1a5529){return db[_0x860a('0x38')][_0x860a('0x33')](function(_0x3bbf6b){var _0x3b5773=_0x5ef95c[_0x860a('0x8')]&&_0x5ef95c[_0x860a('0x8')][_0x860a('0xa')]?_0x5ef95c[_0x860a('0x8')][_0x860a('0xa')]:{};return db['CmHopper'][_0x860a('0x1d')](_0x5ef95c[_0x860a('0x19')],{'where':_0x3b5773,'transaction':_0x3bbf6b})[_0x860a('0x1a')](function(_0x2d5072){logger['info'](_0x860a('0x48'),_0x5ef95c);logger[_0x860a('0x11')](_0x860a('0x48'),_0x5ef95c,JSON['stringify'](_0x2d5072));_0x18a867(_0x2d5072);})[_0x860a('0x1b')](function(_0x4a9c77){logger[_0x860a('0x13')](_0x860a('0x48'),_0x4a9c77[_0x860a('0x14')],_0x5ef95c);_0x1a5529(_0x57f023[_0x860a('0x13')](0x1f4,_0x4a9c77[_0x860a('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x243d0f){var _0x4490de=this;var _0x11b1ba=_0x243d0f[_0x860a('0x19')][_0x860a('0xa')][_0x860a('0x49')];var _0x2e9f53=_0x243d0f['body']['where']['interval'];var _0x2be9fb=_0x243d0f['body'][_0x860a('0xa')][_0x860a('0x4a')];return new Promise(function(_0x428a0f,_0x3c67e4){return db['CmHopper'][_0x860a('0x7')]({'where':{'voiceQueueId':{'$in':_0x11b1ba},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x860a('0x38')]['literal'](_0x860a('0x4b')+_0x2e9f53+_0x860a('0x4c')),'$gt':db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x4d'))}},'UserId':{'$in':_0x2be9fb}},'include':[{'model':db[_0x860a('0x22')],'as':'Contact'},{'model':db[_0x860a('0x28')],'as':_0x860a('0x4e'),'attributes':['id',_0x860a('0x29'),'voicePause']},{'model':db[_0x860a('0x4f')],'as':_0x860a('0x50')}]})['then'](function(_0x4f3956){if(_0x4f3956['length']>0x0){return db['sequelize'][_0x860a('0x33')](function(_0x55a54a){return db[_0x860a('0x6')]['update']({'recallmeNotifiedDate':db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x4d'))},{'where':{'id':{'$in':_['map'](_0x4f3956,'id')}},'transaction':_0x55a54a})[_0x860a('0x1a')](function(){_0x428a0f(_0x4f3956);})['catch'](function(_0x38c9dc){logger[_0x860a('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x38c9dc[_0x860a('0x14')],_0x243d0f);_0x3c67e4(_0x4490de[_0x860a('0x13')](0x1f4,_0x38c9dc[_0x860a('0x14')]));});})[_0x860a('0x1b')](function(_0xf72ddb){logger[_0x860a('0x13')](_0x860a('0x51'),_0xf72ddb[_0x860a('0x14')],_0x243d0f);_0x3c67e4(_0x4490de[_0x860a('0x13')](0x1f4,_0xf72ddb[_0x860a('0x14')]));});}else{_0x428a0f(_0x4f3956);}});});}; \ No newline at end of file +var _0x37f5=['error','CreateCmHopper','create','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','transaction','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','sequelize','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','GetCmHopperPreview','describe','GetContactByPhone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','moment','bluebird','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','message','ShowCmHopper','find'];(function(_0x28cc49,_0x92d793){var _0x51bf1b=function(_0xa983c9){while(--_0xa983c9){_0x28cc49['push'](_0x28cc49['shift']());}};_0x51bf1b(++_0x92d793);}(_0x37f5,0xd0));var _0x537f=function(_0x22585b,_0x3cd9d8){_0x22585b=_0x22585b-0x0;var _0x1d6c18=_0x37f5[_0x22585b];return _0x1d6c18;};'use strict';var _=require(_0x537f('0x0'));var util=require('util');var moment=require(_0x537f('0x1'));var BPromise=require(_0x537f('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x537f('0x3'));exports[_0x537f('0x4')]=function(_0x43de1f){var _0x291b06=this;return new Promise(function(_0x3743e4,_0x10869f){return db[_0x537f('0x5')][_0x537f('0x6')]({'raw':_0x43de1f[_0x537f('0x7')]?_0x43de1f[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![],'where':_0x43de1f[_0x537f('0x7')]?_0x43de1f[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x43de1f['options']?_0x43de1f[_0x537f('0x7')][_0x537f('0xa')]||null:null,'limit':_0x43de1f[_0x537f('0x7')]?_0x43de1f[_0x537f('0x7')][_0x537f('0xb')]||null:null,'include':_0x43de1f[_0x537f('0x7')]?_0x43de1f[_0x537f('0x7')][_0x537f('0xc')]?_[_0x537f('0xd')](_0x43de1f[_0x537f('0x7')][_0x537f('0xc')],function(_0x27e3f8){return{'model':db[_0x27e3f8['model']],'as':_0x27e3f8['as'],'attributes':_0x27e3f8[_0x537f('0xa')],'include':_0x27e3f8[_0x537f('0xc')]?_['map'](_0x27e3f8[_0x537f('0xc')],function(_0x24493d){return{'model':db[_0x24493d[_0x537f('0xe')]],'as':_0x24493d['as'],'attributes':_0x24493d[_0x537f('0xa')],'include':_0x24493d[_0x537f('0xc')]?_[_0x537f('0xd')](_0x24493d[_0x537f('0xc')],function(_0x50ca09){return{'model':db[_0x50ca09[_0x537f('0xe')]],'as':_0x50ca09['as'],'attributes':_0x50ca09[_0x537f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x537f('0xf')](function(_0x3ec8db){logger[_0x537f('0x10')](_0x537f('0x4'),_0x43de1f);logger[_0x537f('0x11')](_0x537f('0x4'),_0x43de1f,JSON[_0x537f('0x12')](_0x3ec8db));_0x3743e4(_0x3ec8db);})[_0x537f('0x13')](function(_0x35ee3a){logger['error']('GetCmHopper',_0x35ee3a[_0x537f('0x14')],_0x43de1f);_0x10869f(_0x291b06['error'](0x1f4,_0x35ee3a[_0x537f('0x14')]));});});};exports[_0x537f('0x15')]=function(_0x270937){var _0x293074=this;return new Promise(function(_0x1afcb0,_0x597fbb){return db[_0x537f('0x5')][_0x537f('0x16')]({'raw':_0x270937[_0x537f('0x7')]?_0x270937[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![],'where':_0x270937[_0x537f('0x7')]?_0x270937[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x270937[_0x537f('0x7')]?_0x270937['options'][_0x537f('0xa')]||null:null,'include':_0x270937[_0x537f('0x7')]?_0x270937[_0x537f('0x7')][_0x537f('0xc')]?_[_0x537f('0xd')](_0x270937['options'][_0x537f('0xc')],function(_0x261b2f){return{'model':db[_0x261b2f[_0x537f('0xe')]],'as':_0x261b2f['as'],'attributes':_0x261b2f[_0x537f('0xa')],'include':_0x261b2f['include']?_[_0x537f('0xd')](_0x261b2f['include'],function(_0x7496a8){return{'model':db[_0x7496a8[_0x537f('0xe')]],'as':_0x7496a8['as'],'attributes':_0x7496a8[_0x537f('0xa')],'include':_0x7496a8[_0x537f('0xc')]?_[_0x537f('0xd')](_0x7496a8[_0x537f('0xc')],function(_0x5a09b5){return{'model':db[_0x5a09b5[_0x537f('0xe')]],'as':_0x5a09b5['as'],'attributes':_0x5a09b5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f42bd){logger[_0x537f('0x10')](_0x537f('0x15'),_0x270937);logger[_0x537f('0x11')](_0x537f('0x15'),_0x270937,JSON[_0x537f('0x12')](_0x4f42bd));_0x1afcb0(_0x4f42bd);})[_0x537f('0x13')](function(_0x4ad9ac){logger['error'](_0x537f('0x15'),_0x4ad9ac[_0x537f('0x14')],_0x270937);_0x597fbb(_0x293074[_0x537f('0x17')](0x1f4,_0x4ad9ac[_0x537f('0x14')]));});});};exports[_0x537f('0x18')]=function(_0x243234){var _0x11a409=this;return new Promise(function(_0x42d88a,_0x1a4099){return db[_0x537f('0x5')][_0x537f('0x19')](_0x243234[_0x537f('0x1a')],{'raw':_0x243234[_0x537f('0x7')]?_0x243234[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![]})[_0x537f('0xf')](function(_0x3c71c0){logger[_0x537f('0x10')](_0x537f('0x18'),_0x243234);logger[_0x537f('0x11')](_0x537f('0x18'),_0x243234,JSON[_0x537f('0x12')](_0x3c71c0));_0x42d88a(_0x3c71c0);})['catch'](function(_0x48e7a3){logger[_0x537f('0x17')](_0x537f('0x18'),_0x48e7a3['message'],_0x243234);_0x1a4099(_0x11a409[_0x537f('0x17')](0x1f4,_0x48e7a3['message']));});});};exports['UpdateCmHopper']=function(_0x253db5){var _0x21a4dd=this;return new Promise(function(_0x43fc14,_0x7b0b70){return db[_0x537f('0x5')]['update'](_0x253db5['body'],{'raw':_0x253db5[_0x537f('0x7')]?_0x253db5['options'][_0x537f('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x253db5[_0x537f('0x7')]?_0x253db5[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x253db5[_0x537f('0x7')]?_0x253db5[_0x537f('0x7')]['attributes']||null:null,'limit':_0x253db5[_0x537f('0x7')]?_0x253db5[_0x537f('0x7')][_0x537f('0xb')]||null:null})['then'](function(_0x32651f){logger['info']('UpdateCmHopper',_0x253db5);logger[_0x537f('0x10')](_0x537f('0x1b'),JSON[_0x537f('0x12')](_0x253db5[_0x537f('0x7')]['where']),_0x253db5['body']['active']);logger[_0x537f('0x11')](_0x537f('0x1c'),_0x253db5,JSON[_0x537f('0x12')](_0x32651f));_0x43fc14(_0x32651f);})[_0x537f('0x13')](function(_0x28413c){logger[_0x537f('0x17')](_0x537f('0x1c'),_0x28413c[_0x537f('0x14')],_0x253db5);_0x7b0b70(_0x21a4dd[_0x537f('0x17')](0x1f4,_0x28413c['message']));});});};exports['DestroyCmHopper']=function(_0x298530){var _0x1d0eb7=this;return new Promise(function(_0x50c07b,_0x1746d8){return db[_0x537f('0x5')][_0x537f('0x1d')]({'where':_0x298530['options']?_0x298530[_0x537f('0x7')][_0x537f('0x9')]||null:null})['then'](function(_0x30ee51){logger['info'](_0x537f('0x1e'),_0x298530);logger[_0x537f('0x11')](_0x537f('0x1e'),_0x298530,JSON['stringify'](_0x30ee51));_0x50c07b(_0x30ee51);})[_0x537f('0x13')](function(_0x198364){logger['error'](_0x537f('0x1e'),_0x198364['message'],_0x298530);_0x1746d8(_0x1d0eb7[_0x537f('0x17')](0x1f4,_0x198364[_0x537f('0x14')]));});});};exports[_0x537f('0x1f')]=function(_0x216269){var _0x4e6aaa=this;return new Promise(function(_0x2ef1fe,_0x491687){return db[_0x537f('0x20')]['describe']()[_0x537f('0xf')](function(_0x1de226){return db['sequelize'][_0x537f('0x21')](function(_0x211c1b){return db[_0x537f('0x5')][_0x537f('0x6')]({'where':_0x216269[_0x537f('0x7')]?_0x216269[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x216269['options']?_0x216269[_0x537f('0x7')][_0x537f('0xa')]||null:null,'limit':_0x216269[_0x537f('0x7')]?_0x216269[_0x537f('0x7')][_0x537f('0xb')]||null:null,'order':_0x216269[_0x537f('0x7')]?_0x216269[_0x537f('0x7')][_0x537f('0x22')]||null:null,'transaction':_0x211c1b,'lock':_0x211c1b[_0x537f('0x23')][_0x537f('0x24')],'include':[{'model':db[_0x537f('0x20')],'as':_0x537f('0x25'),'attributes':_[_0x537f('0x26')](_0x1de226)},{'model':db[_0x537f('0x27')],'as':'Agent','attributes':['id',_0x537f('0x28'),_0x537f('0x29')]}]})['then'](function(_0x2e96a4){var _0x38e852=[];var _0x47c296=[];for(var _0x1e5bd8=0x0;_0x1e5bd8<_0x2e96a4[_0x537f('0x2a')];_0x1e5bd8+=0x1){var _0x13dbd5=_0x2e96a4[_0x1e5bd8]['UserId'];if(_0x13dbd5===null){_0x38e852[_0x537f('0x2b')](_0x2e96a4[_0x1e5bd8][_0x537f('0x2c')](_0x216269['body'],{'transaction':_0x211c1b}));}else if(!_0x47c296[_0x537f('0x2d')](_0x13dbd5)){_0x47c296['push'](_0x13dbd5);_0x38e852['push'](_0x2e96a4[_0x1e5bd8][_0x537f('0x2c')](_0x216269[_0x537f('0x1a')],{'transaction':_0x211c1b}));}}return BPromise[_0x537f('0x2e')](_0x38e852);});})['then'](function(_0x5354fd){logger[_0x537f('0x10')](_0x537f('0x1f'),_0x216269);if(_0x5354fd[_0x537f('0x2a')]>0x0){logger[_0x537f('0x10')](_0x537f('0x2f'),_0x5354fd[0x0][_0x537f('0x30')]['id'],_0x5354fd[0x0][_0x537f('0x30')][_0x537f('0x31')],_0x5354fd[0x0][_0x537f('0x30')][_0x537f('0x32')]);}logger[_0x537f('0x11')](_0x537f('0x1f'),_0x216269,JSON[_0x537f('0x12')](_0x5354fd));_0x2ef1fe(_0x5354fd);})[_0x537f('0x13')](function(_0x14d387){logger[_0x537f('0x17')](_0x537f('0x1f'),_0x14d387[_0x537f('0x14')],_0x216269);_0x491687(_0x4e6aaa[_0x537f('0x17')](0x1f4,_0x14d387['message']));});});});};exports[_0x537f('0x33')]=function(_0x214cc3){var _0x485164=this;return new Promise(function(_0xcfe4bd,_0x50f93c){return db['sequelize']['transaction'](function(_0x322854){return db['CmHopperFinal'][_0x537f('0x19')](_0x214cc3[_0x537f('0x1a')],{'raw':_0x214cc3[_0x537f('0x7')]?_0x214cc3[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![],'transaction':_0x322854})[_0x537f('0xf')](function(){logger[_0x537f('0x10')](_0x537f('0x34'),JSON[_0x537f('0x12')](_0x214cc3[_0x537f('0x7')][_0x537f('0x9')]),_0x214cc3['options'][_0x537f('0x9')][_0x537f('0x32')]);return db['CmHopper']['destroy']({'where':_0x214cc3[_0x537f('0x7')]?_0x214cc3[_0x537f('0x7')][_0x537f('0x9')]||null:null,'transaction':_0x322854});});})[_0x537f('0xf')](function(_0x1dc4c3){logger[_0x537f('0x10')](_0x537f('0x33'),_0x214cc3);logger['debug'](_0x537f('0x33'),_0x214cc3,JSON[_0x537f('0x12')](_0x1dc4c3));_0xcfe4bd(_0x1dc4c3);})[_0x537f('0x13')](function(_0x57e63a){logger[_0x537f('0x17')](_0x537f('0x33'),_0x57e63a[_0x537f('0x14')],_0x214cc3);_0x50f93c(_0x485164['error'](0x1f4,_0x57e63a[_0x537f('0x14')]));});});};exports['CountReScheduled']=function(_0x407ac3){var _0x564c08=this;return new Promise(function(_0x486f6e,_0x43ea3d){return db[_0x537f('0x5')][_0x537f('0x6')]({'raw':_0x407ac3[_0x537f('0x7')]?_0x407ac3[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![],'where':_0x407ac3[_0x537f('0x7')]?_0x407ac3[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':[[db[_0x537f('0x35')]['fn']('COUNT',db[_0x537f('0x35')]['fn']('IF',db[_0x537f('0x35')]['literal'](_0x537f('0x36')+util[_0x537f('0x37')](_0x537f('0x38'),moment()[_0x537f('0x37')](_0x537f('0x39')))+'\x20,\x201,\x20null'))),_0x537f('0x3a')]]})[_0x537f('0xf')](function(_0x535973){logger[_0x537f('0x10')](_0x537f('0x3b'),_0x407ac3);logger['debug'](_0x537f('0x3b'),_0x407ac3,JSON['stringify'](_0x535973));_0x486f6e(_0x535973);})[_0x537f('0x13')](function(_0x45da2b){logger[_0x537f('0x17')](_0x537f('0x3b'),_0x45da2b[_0x537f('0x14')],_0x407ac3);_0x43ea3d(_0x564c08['error'](0x1f4,_0x45da2b['message']));});});};exports[_0x537f('0x3c')]=function(_0x368447){var _0x34dfdf=this;return new Promise(function(_0x4cf345,_0x2b0c5f){return db[_0x537f('0x20')]['describe']()['then'](function(){return db[_0x537f('0x35')][_0x537f('0x21')](function(_0x25f9bc){return db[_0x537f('0x5')][_0x537f('0x6')]({'where':_0x368447['options']?_0x368447[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x368447['options']?_0x368447[_0x537f('0x7')][_0x537f('0xa')]||null:null,'limit':0x1,'order':_0x368447[_0x537f('0x7')]?_0x368447[_0x537f('0x7')][_0x537f('0x22')]||null:null,'group':db['CmHopper'][_0x537f('0x3d')],'transaction':_0x25f9bc,'lock':_0x25f9bc['LOCK'][_0x537f('0x24')],'include':_0x368447[_0x537f('0x7')]?_0x368447['options'][_0x537f('0xc')]?_[_0x537f('0xd')](_0x368447[_0x537f('0x7')][_0x537f('0xc')],function(_0x338a04){return{'model':db[_0x338a04['model']],'as':_0x338a04['as'],'attributes':_0x338a04[_0x537f('0xa')],'include':_0x338a04[_0x537f('0xc')]?_['map'](_0x338a04[_0x537f('0xc')],function(_0x4c4e26){return{'model':db[_0x4c4e26[_0x537f('0xe')]],'as':_0x4c4e26['as'],'attributes':_0x4c4e26[_0x537f('0xa')],'include':_0x4c4e26[_0x537f('0xc')]?_[_0x537f('0xd')](_0x4c4e26[_0x537f('0xc')],function(_0x3feac9){return{'model':db[_0x3feac9[_0x537f('0xe')]],'as':_0x3feac9['as'],'attributes':_0x3feac9[_0x537f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x537f('0xf')](function(_0x1607d2){var _0x1eb5ba=[];for(var _0x1fdf11=0x0;_0x1fdf11<_0x1607d2['length'];_0x1fdf11+=0x1){_0x1eb5ba[_0x537f('0x2b')](_0x1607d2[_0x1fdf11][_0x537f('0x2c')](_0x368447[_0x537f('0x1a')],{'transaction':_0x25f9bc}));}return BPromise['all'](_0x1eb5ba);});})['then'](function(_0x496af0){logger[_0x537f('0x10')](_0x537f('0x3c'),_0x368447);logger['debug'](_0x537f('0x3c'),_0x368447,JSON[_0x537f('0x12')](_0x496af0));_0x4cf345(_0x496af0);})[_0x537f('0x13')](function(_0x434531){logger[_0x537f('0x17')]('GetContactRecallMe',_0x434531[_0x537f('0x14')],_0x368447);_0x2b0c5f(_0x34dfdf[_0x537f('0x17')](0x1f4,_0x434531[_0x537f('0x14')]));});});});};exports[_0x537f('0x3e')]=function(_0x11aa68){var _0x287d9e=this;return new Promise(function(_0x448d5e,_0x3fa89d){db['CmContact'][_0x537f('0x3f')]()[_0x537f('0xf')](function(_0x2aca28){return db[_0x537f('0x5')][_0x537f('0x6')]({'raw':_0x11aa68[_0x537f('0x7')]?_0x11aa68[_0x537f('0x7')][_0x537f('0x8')]===undefined?!![]:![]:!![],'where':_0x11aa68[_0x537f('0x7')]?_0x11aa68[_0x537f('0x7')][_0x537f('0x9')]||null:null,'attributes':_0x11aa68['options']?_0x11aa68[_0x537f('0x7')]['attributes']||null:null,'limit':_0x11aa68[_0x537f('0x7')]?_0x11aa68['options'][_0x537f('0xb')]||null:null,'include':_0x11aa68['options']?_0x11aa68[_0x537f('0x7')][_0x537f('0xc')]?_[_0x537f('0xd')](_0x11aa68[_0x537f('0x7')][_0x537f('0xc')],function(_0x21422c){return{'model':db[_0x21422c[_0x537f('0xe')]],'as':_0x21422c['as'],'attributes':_0x21422c['as']===_0x537f('0x25')?_[_0x537f('0x26')](_0x2aca28):_0x21422c[_0x537f('0xa')],'include':_0x21422c['include']?_[_0x537f('0xd')](_0x21422c[_0x537f('0xc')],function(_0x58552c){return{'model':db[_0x58552c['model']],'as':_0x58552c['as'],'attributes':_0x58552c[_0x537f('0xa')],'include':_0x58552c[_0x537f('0xc')]?_[_0x537f('0xd')](_0x58552c[_0x537f('0xc')],function(_0x46e986){return{'model':db[_0x46e986['model']],'as':_0x46e986['as'],'attributes':_0x46e986[_0x537f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x537f('0xf')](function(_0x5d3ec6){logger['info'](_0x537f('0x4'),_0x11aa68);logger['debug'](_0x537f('0x4'),_0x11aa68,JSON[_0x537f('0x12')](_0x5d3ec6));_0x448d5e(_0x5d3ec6);})[_0x537f('0x13')](function(_0x6d88d3){logger[_0x537f('0x17')]('GetCmHopper',_0x6d88d3[_0x537f('0x14')],_0x11aa68);_0x3fa89d(_0x287d9e[_0x537f('0x17')](0x1f4,_0x6d88d3[_0x537f('0x14')]));});});});};exports[_0x537f('0x40')]=function(_0x1e11a1){var _0x577a10=this;return new Promise(function(_0x2f7c69,_0x4faa93){return db[_0x537f('0x20')]['findOne']({'raw':!![],'where':{'phone':_0x1e11a1[_0x537f('0x7')][_0x537f('0x9')]['phone']},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x537f('0xf')](function(_0x40eb5e){logger[_0x537f('0x10')]('getContactByPhone',_0x1e11a1);logger['debug'](_0x537f('0x41'),_0x1e11a1,JSON[_0x537f('0x12')](_0x40eb5e));_0x2f7c69(_0x40eb5e);})[_0x537f('0x13')](function(_0x5c4a2c){logger[_0x537f('0x17')](_0x537f('0x41'),_0x5c4a2c[_0x537f('0x14')],_0x1e11a1);_0x4faa93(_0x577a10[_0x537f('0x17')](0x1f4,_0x5c4a2c[_0x537f('0x14')]));});});};exports[_0x537f('0x42')]=function(_0xbee511){var _0x4e42dd=this;return new Promise(function(_0x429e48,_0x4d940d){return db[_0x537f('0x35')]['transaction'](function(_0x4be39f){var _0x221991=_0xbee511['options']&&_0xbee511[_0x537f('0x7')]['where']?_0xbee511[_0x537f('0x7')][_0x537f('0x9')]:{};return db['CmHopper']['update'](_0xbee511[_0x537f('0x1a')],{'where':_0x221991,'transaction':_0x4be39f})[_0x537f('0xf')](function(_0x50ed0b){logger['info'](_0x537f('0x42'),_0xbee511);logger[_0x537f('0x11')](_0x537f('0x42'),_0xbee511,JSON['stringify'](_0x50ed0b));_0x429e48(_0x50ed0b);})[_0x537f('0x13')](function(_0x25349f){logger['error'](_0x537f('0x42'),_0x25349f[_0x537f('0x14')],_0xbee511);_0x4d940d(_0x4e42dd[_0x537f('0x17')](0x1f4,_0x25349f[_0x537f('0x14')]));});});});};exports[_0x537f('0x43')]=function(_0x15c41e){var _0x354f89=this;var _0x36444e=_0x15c41e['body'][_0x537f('0x9')][_0x537f('0x44')];var _0x13a9c1=_0x15c41e[_0x537f('0x1a')][_0x537f('0x9')][_0x537f('0x45')];var _0x3ee1b8=_0x15c41e[_0x537f('0x1a')][_0x537f('0x9')][_0x537f('0x46')];return new Promise(function(_0x67f6a8,_0x17898d){return db[_0x537f('0x5')][_0x537f('0x6')]({'where':{'voiceQueueId':{'$in':_0x36444e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x537f('0x47')](_0x537f('0x48')+_0x13a9c1+_0x537f('0x49')),'$gt':db[_0x537f('0x35')][_0x537f('0x47')](_0x537f('0x4a'))}},'UserId':{'$in':_0x3ee1b8}},'include':[{'model':db[_0x537f('0x20')],'as':_0x537f('0x25')},{'model':db[_0x537f('0x27')],'as':'Agent','attributes':['id',_0x537f('0x28'),_0x537f('0x29')]},{'model':db[_0x537f('0x4b')],'as':_0x537f('0x4c')}]})[_0x537f('0xf')](function(_0x49de6a){if(_0x49de6a[_0x537f('0x2a')]>0x0){return db['sequelize'][_0x537f('0x21')](function(_0x2d47b0){return db[_0x537f('0x5')][_0x537f('0x2c')]({'recallmeNotifiedDate':db[_0x537f('0x35')]['literal']('NOW()')},{'where':{'id':{'$in':_[_0x537f('0xd')](_0x49de6a,'id')}},'transaction':_0x2d47b0})[_0x537f('0xf')](function(){_0x67f6a8(_0x49de6a);})[_0x537f('0x13')](function(_0x5c64b2){logger[_0x537f('0x17')](_0x537f('0x43'),_0x5c64b2[_0x537f('0x14')],_0x15c41e);_0x17898d(_0x354f89[_0x537f('0x17')](0x1f4,_0x5c64b2['message']));});})[_0x537f('0x13')](function(_0x3351ad){logger[_0x537f('0x17')](_0x537f('0x43'),_0x3351ad[_0x537f('0x14')],_0x15c41e);_0x17898d(_0x354f89[_0x537f('0x17')](0x1f4,_0x3351ad[_0x537f('0x14')]));});}else{_0x67f6a8(_0x49de6a);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3a09b67..5890f96 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 _0x9952=['isAuthenticated','index','/describe','describe','/opencontacts','/timezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','/:id','update','destroy','exports','express','Router','./cmHopper.controller','get'];(function(_0x513a35,_0x309c26){var _0x4a31d5=function(_0x574227){while(--_0x574227){_0x513a35['push'](_0x513a35['shift']());}};_0x4a31d5(++_0x309c26);}(_0x9952,0xcb));var _0x2995=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x9952[_0x23c6f2];return _0x4c270b;};'use strict';var express=require(_0x2995('0x0'));var router=express[_0x2995('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x2995('0x2'));router[_0x2995('0x3')]('/',auth[_0x2995('0x4')](),controller[_0x2995('0x5')]);router[_0x2995('0x3')](_0x2995('0x6'),auth[_0x2995('0x4')](),controller[_0x2995('0x7')]);router['get'](_0x2995('0x8'),auth[_0x2995('0x4')](),controller['getOpenContacts']);router[_0x2995('0x3')](_0x2995('0x9'),auth[_0x2995('0x4')](),controller['getTimezones']);router[_0x2995('0x3')]('/:id',auth[_0x2995('0x4')](),controller[_0x2995('0xa')]);router[_0x2995('0x3')](_0x2995('0xb'),auth[_0x2995('0x4')](),controller[_0x2995('0xc')]);router[_0x2995('0xd')]('/',auth[_0x2995('0x4')](),controller[_0x2995('0xe')]);router['post'](_0x2995('0xf'),auth['isAuthenticated'](),controller[_0x2995('0x10')]);router['post']('/timezone',auth['isAuthenticated'](),controller[_0x2995('0x11')]);router[_0x2995('0x12')](_0x2995('0x13'),auth[_0x2995('0x4')](),controller[_0x2995('0x14')]);router['delete'](_0x2995('0x13'),auth[_0x2995('0x4')](),controller[_0x2995('0x15')]);module[_0x2995('0x16')]=router; \ No newline at end of file +var _0xa28d=['isAuthenticated','index','get','/describe','describe','getOpenContacts','/timezones','show','/:id/previewrecall','getPreviewRecall','post','create','/timezone','put','delete','/:id','destroy','exports','Router','../../components/auth/service','./cmHopper.controller'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa28d,0xa5));var _0xda28=function(_0x5d3125,_0xbdb58f){_0x5d3125=_0x5d3125-0x0;var _0x5647ca=_0xa28d[_0x5d3125];return _0x5647ca;};'use strict';var express=require('express');var router=express[_0xda28('0x0')]();var auth=require(_0xda28('0x1'));var controller=require(_0xda28('0x2'));router['get']('/',auth[_0xda28('0x3')](),controller[_0xda28('0x4')]);router[_0xda28('0x5')](_0xda28('0x6'),auth[_0xda28('0x3')](),controller[_0xda28('0x7')]);router[_0xda28('0x5')]('/opencontacts',auth[_0xda28('0x3')](),controller[_0xda28('0x8')]);router['get'](_0xda28('0x9'),auth['isAuthenticated'](),controller['getTimezones']);router[_0xda28('0x5')]('/:id',auth[_0xda28('0x3')](),controller[_0xda28('0xa')]);router[_0xda28('0x5')](_0xda28('0xb'),auth['isAuthenticated'](),controller[_0xda28('0xc')]);router[_0xda28('0xd')]('/',auth[_0xda28('0x3')](),controller[_0xda28('0xe')]);router[_0xda28('0xd')]('/preview',auth[_0xda28('0x3')](),controller['getPreview']);router['post'](_0xda28('0xf'),auth[_0xda28('0x3')](),controller['getTimezone']);router[_0xda28('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xda28('0x11')](_0xda28('0x12'),auth[_0xda28('0x3')](),controller[_0xda28('0x13')]);module[_0xda28('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index bb9fc68..a39db26 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 _0xde41=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4e5f27,_0x58efea){var _0x4b67ae=function(_0x83bb4d){while(--_0x83bb4d){_0x4e5f27['push'](_0x4e5f27['shift']());}};_0x4b67ae(++_0x58efea);}(_0xde41,0xf0));var _0x1de4=function(_0x57209c,_0x567249){_0x57209c=_0x57209c-0x0;var _0x575b1f=_0xde41[_0x57209c];return _0x575b1f;};'use strict';var moment=require('moment');var Sequelize=require(_0x1de4('0x0'));module[_0x1de4('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x1de4('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1de4('0x4')],'defaultValue':moment()[_0x1de4('0x5')](_0x1de4('0x6'))},'countbusyretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ca8=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4ca8,0x17e));var _0x84ca=function(_0x1fa31b,_0x429701){_0x1fa31b=_0x1fa31b-0x0;var _0x1dab57=_0x4ca8[_0x1fa31b];return _0x1dab57;};'use strict';var moment=require(_0x84ca('0x0'));var Sequelize=require(_0x84ca('0x1'));module[_0x84ca('0x2')]={'CmHopperId':{'type':Sequelize[_0x84ca('0x3')]},'phone':{'type':Sequelize[_0x84ca('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x84ca('0x5')],'defaultValue':moment()[_0x84ca('0x6')](_0x84ca('0x7'))},'countbusyretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x84ca('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x84ca('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 1742db3..acf9363 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 _0xdc94=['get','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3fe54c,_0x5a4bcd){var _0x370328=function(_0xf1b04c){while(--_0xf1b04c){_0x3fe54c['push'](_0x3fe54c['shift']());}};_0x370328(++_0x5a4bcd);}(_0xdc94,0x1e4));var _0x4dc9=function(_0x2d72bd,_0xc16f3a){_0x2d72bd=_0x2d72bd-0x0;var _0x63a00a=_0xdc94[_0x2d72bd];return _0x63a00a;};'use strict';var emlformat=require(_0x4dc9('0x0'));var rimraf=require(_0x4dc9('0x1'));var zipdir=require(_0x4dc9('0x2'));var jsonpatch=require(_0x4dc9('0x3'));var rp=require('request-promise');var moment=require(_0x4dc9('0x4'));var BPromise=require(_0x4dc9('0x5'));var Mustache=require('mustache');var util=require(_0x4dc9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4dc9('0x7'));var ejs=require(_0x4dc9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4dc9('0x9'));var squel=require('squel');var crypto=require(_0x4dc9('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(_0x4dc9('0xb'));var authService=require(_0x4dc9('0xc'));var qs=require(_0x4dc9('0xd'));var as=require(_0x4dc9('0xe'));var hardwareService=require(_0x4dc9('0xf'));var logger=require(_0x4dc9('0x10'))('api');var utils=require(_0x4dc9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4dc9('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd811,_0x3c57c6){_0x3c57c6=_0x3c57c6||0xcc;return function(_0x29e2e8){if(_0x29e2e8){return _0x1dd811[_0x4dc9('0x13')](_0x3c57c6);}return _0x1dd811[_0x4dc9('0x14')](_0x3c57c6)[_0x4dc9('0x15')]();};}function respondWithResult(_0x366069,_0x7cc1d){_0x7cc1d=_0x7cc1d||0xc8;return function(_0x7fc639){if(_0x7fc639){return _0x366069['status'](_0x7cc1d)[_0x4dc9('0x16')](_0x7fc639);}};}function respondWithFilteredResult(_0xa6801b,_0x1cacaa){return function(_0x4ffbf9){if(_0x4ffbf9){var _0x58705b=typeof _0x1cacaa[_0x4dc9('0x17')]===_0x4dc9('0x18')&&typeof _0x1cacaa[_0x4dc9('0x19')]==='undefined';var _0x42a60d=_0x4ffbf9[_0x4dc9('0x1a')];var _0x2b086d=_0x58705b?0x0:_0x1cacaa[_0x4dc9('0x17')];var _0x42cbd7=_0x58705b?_0x4ffbf9[_0x4dc9('0x1a')]:_0x1cacaa['offset']+_0x1cacaa['limit'];var _0x6d455;if(_0x42cbd7>=_0x42a60d){_0x42cbd7=_0x42a60d;_0x6d455=0xc8;}else{_0x6d455=0xce;}_0xa6801b['status'](_0x6d455);return _0xa6801b['set'](_0x4dc9('0x1b'),_0x2b086d+'-'+_0x42cbd7+'/'+_0x42a60d)[_0x4dc9('0x16')](_0x4ffbf9);}return null;};}function patchUpdates(_0x2f0446){return function(_0x44b12d){try{jsonpatch[_0x4dc9('0x1c')](_0x44b12d,_0x2f0446,!![]);}catch(_0x3e5604){return BPromise[_0x4dc9('0x1d')](_0x3e5604);}return _0x44b12d[_0x4dc9('0x1e')]();};}function saveUpdates(_0x428389,_0x4cce71){return function(_0x373850){if(_0x373850){return _0x373850[_0x4dc9('0x1f')](_0x428389)[_0x4dc9('0x20')](function(_0x366617){return _0x366617;});}return null;};}function removeEntity(_0x315fcb,_0x394786){return function(_0x1e20cc){if(_0x1e20cc){return _0x1e20cc[_0x4dc9('0x21')]()['then'](function(){var _0x36368e=_0x1e20cc[_0x4dc9('0x22')]({'plain':!![]});var _0x270f5c='CmHopperAdditionalPhones';return db[_0x4dc9('0x23')]['destroy']({'where':{'type':_0x270f5c,'resourceId':_0x36368e['id']}})['then'](function(){return _0x1e20cc;});})[_0x4dc9('0x20')](function(){_0x315fcb['status'](0xcc)[_0x4dc9('0x15')]();});}};}function handleEntityNotFound(_0x11851,_0x53f61d){return function(_0x1ae9ec){if(!_0x1ae9ec){_0x11851[_0x4dc9('0x13')](0x194);}return _0x1ae9ec;};}function handleError(_0xc33840,_0xb687c2){_0xb687c2=_0xb687c2||0x1f4;return function(_0x3b6b82){logger[_0x4dc9('0x24')](_0x3b6b82[_0x4dc9('0x25')]);if(_0x3b6b82['name']){delete _0x3b6b82[_0x4dc9('0x26')];}_0xc33840[_0x4dc9('0x14')](_0xb687c2)[_0x4dc9('0x27')](_0x3b6b82);};}exports[_0x4dc9('0x28')]=function(_0x4e9d9c,_0xf31d31){var _0x4d571d={},_0x7994c6={},_0x5ac31d={'count':0x0,'rows':[]};var _0x58bc1b=_['map'](db[_0x4dc9('0x29')]['rawAttributes'],function(_0x141fa6){return{'name':_0x141fa6['fieldName'],'type':_0x141fa6['type'][_0x4dc9('0x2a')]};});_0x7994c6['model']=_[_0x4dc9('0x2b')](_0x58bc1b,_0x4dc9('0x26'));_0x7994c6[_0x4dc9('0x2c')]=_[_0x4dc9('0x2d')](_0x4e9d9c[_0x4dc9('0x2c')]);_0x7994c6[_0x4dc9('0x2e')]=_[_0x4dc9('0x2f')](_0x7994c6[_0x4dc9('0x30')],_0x7994c6[_0x4dc9('0x2c')]);_0x4d571d[_0x4dc9('0x31')]=_[_0x4dc9('0x2f')](_0x7994c6['model'],qs[_0x4dc9('0x32')](_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x32')]));_0x4d571d[_0x4dc9('0x31')]=_0x4d571d[_0x4dc9('0x31')]['length']?_0x4d571d[_0x4dc9('0x31')]:_0x7994c6[_0x4dc9('0x30')];if(!_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x33')](_0x4dc9('0x34'))){_0x4d571d[_0x4dc9('0x19')]=qs[_0x4dc9('0x19')](_0x4e9d9c['query'][_0x4dc9('0x19')]);_0x4d571d[_0x4dc9('0x17')]=qs[_0x4dc9('0x17')](_0x4e9d9c['query'][_0x4dc9('0x17')]);}_0x4d571d[_0x4dc9('0x35')]=qs[_0x4dc9('0x36')](_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x36')]);_0x4d571d[_0x4dc9('0x37')]=qs[_0x4dc9('0x2e')](_['pick'](_0x4e9d9c[_0x4dc9('0x2c')],_0x7994c6[_0x4dc9('0x2e')]),_0x58bc1b);if(_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x38')]){_0x4d571d[_0x4dc9('0x37')]=_[_0x4dc9('0x39')](_0x4d571d[_0x4dc9('0x37')],{'$or':_[_0x4dc9('0x2b')](_0x58bc1b,function(_0x39e84d){if(_0x39e84d['type']!=='VIRTUAL'){var _0x40c344={};_0x40c344[_0x39e84d['name']]={'$like':'%'+_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x38')]+'%'};return _0x40c344;}})});}_0x4d571d=_[_0x4dc9('0x39')]({},_0x4d571d,_0x4e9d9c[_0x4dc9('0x3a')]);var _0x24a6a1={'where':_0x4d571d[_0x4dc9('0x37')]};return db['CmHopperAdditionalPhone'][_0x4dc9('0x1a')](_0x24a6a1)[_0x4dc9('0x20')](function(_0x1e4bbb){_0x5ac31d[_0x4dc9('0x1a')]=_0x1e4bbb;if(_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x3b')]){_0x4d571d['include']=[{'all':!![]}];}return db[_0x4dc9('0x29')][_0x4dc9('0x3c')](_0x4d571d);})[_0x4dc9('0x20')](function(_0x1a7d85){_0x5ac31d['rows']=_0x1a7d85;return _0x5ac31d;})[_0x4dc9('0x20')](respondWithFilteredResult(_0xf31d31,_0x4d571d))[_0x4dc9('0x3d')](handleError(_0xf31d31,null));};exports['show']=function(_0x253fd7,_0x5c5b05){var _0x115b24={'raw':!![],'where':{'id':_0x253fd7[_0x4dc9('0x3e')]['id']}},_0x2af733={};_0x2af733[_0x4dc9('0x30')]=_[_0x4dc9('0x2d')](db[_0x4dc9('0x29')][_0x4dc9('0x3f')]);_0x2af733[_0x4dc9('0x2c')]=_[_0x4dc9('0x2d')](_0x253fd7[_0x4dc9('0x2c')]);_0x2af733[_0x4dc9('0x2e')]=_[_0x4dc9('0x2f')](_0x2af733[_0x4dc9('0x30')],_0x2af733[_0x4dc9('0x2c')]);_0x115b24[_0x4dc9('0x31')]=_['intersection'](_0x2af733[_0x4dc9('0x30')],qs[_0x4dc9('0x32')](_0x253fd7[_0x4dc9('0x2c')][_0x4dc9('0x32')]));_0x115b24[_0x4dc9('0x31')]=_0x115b24['attributes'][_0x4dc9('0x40')]?_0x115b24[_0x4dc9('0x31')]:_0x2af733[_0x4dc9('0x30')];if(_0x253fd7[_0x4dc9('0x2c')]['includeAll']){_0x115b24['include']=[{'all':!![]}];}_0x115b24=_[_0x4dc9('0x39')]({},_0x115b24,_0x253fd7['options']);return db[_0x4dc9('0x29')][_0x4dc9('0x41')](_0x115b24)['then'](handleEntityNotFound(_0x5c5b05,null))[_0x4dc9('0x20')](respondWithResult(_0x5c5b05,null))['catch'](handleError(_0x5c5b05,null));};exports[_0x4dc9('0x42')]=function(_0x2559b0,_0x38026c){return db['CmHopperAdditionalPhone']['create'](_0x2559b0[_0x4dc9('0x43')],{})[_0x4dc9('0x20')](function(_0x251bd3){var _0x728a88=_0x2559b0[_0x4dc9('0x44')][_0x4dc9('0x22')]({'plain':!![]});if(!_0x728a88)throw new Error(_0x4dc9('0x45'));if(_0x728a88['role']==='user'){var _0x340064=_0x251bd3[_0x4dc9('0x22')]({'plain':!![]});var _0x120f3c=_0x4dc9('0x46');return db[_0x4dc9('0x47')][_0x4dc9('0x41')]({'where':{'name':_0x120f3c,'userProfileId':_0x728a88[_0x4dc9('0x48')]},'raw':!![]})[_0x4dc9('0x20')](function(_0x19a6d0){if(_0x19a6d0&&_0x19a6d0[_0x4dc9('0x49')]===0x0){return db['UserProfileResource'][_0x4dc9('0x42')]({'name':_0x340064['name'],'resourceId':_0x340064['id'],'type':_0x19a6d0['name'],'sectionId':_0x19a6d0['id']},{})['then'](function(){return _0x251bd3;});}else{return _0x251bd3;}})[_0x4dc9('0x3d')](function(_0x32f81a){logger[_0x4dc9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32f81a);throw _0x32f81a;});}return _0x251bd3;})['then'](respondWithResult(_0x38026c,0xc9))['catch'](handleError(_0x38026c,null));};exports[_0x4dc9('0x1f')]=function(_0x9cbf0,_0xdc1afa){if(_0x9cbf0[_0x4dc9('0x43')]['id']){delete _0x9cbf0[_0x4dc9('0x43')]['id'];}return db[_0x4dc9('0x29')][_0x4dc9('0x41')]({'where':{'id':_0x9cbf0[_0x4dc9('0x3e')]['id']}})[_0x4dc9('0x20')](handleEntityNotFound(_0xdc1afa,null))[_0x4dc9('0x20')](saveUpdates(_0x9cbf0[_0x4dc9('0x43')],null))[_0x4dc9('0x20')](respondWithResult(_0xdc1afa,null))['catch'](handleError(_0xdc1afa,null));};exports[_0x4dc9('0x21')]=function(_0x521ad2,_0x37aa30){return db[_0x4dc9('0x29')]['find']({'where':{'id':_0x521ad2[_0x4dc9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37aa30,null))[_0x4dc9('0x20')](removeEntity(_0x37aa30,null))['catch'](handleError(_0x37aa30,null));}; \ No newline at end of file +var _0x1797=['path','to-csv','ejs','squel','crypto','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','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','CmHopperAdditionalPhone','findAll','rows','catch','show','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','request-promise','moment','util'];(function(_0x179de0,_0x4f407c){var _0x5e50dd=function(_0x29ba77){while(--_0x29ba77){_0x179de0['push'](_0x179de0['shift']());}};_0x5e50dd(++_0x4f407c);}(_0x1797,0xf1));var _0x7179=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1797[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7179('0x0'));var zipdir=require(_0x7179('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7179('0x2'));var moment=require(_0x7179('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7179('0x4'));var path=require(_0x7179('0x5'));var sox=require('sox');var csv=require(_0x7179('0x6'));var ejs=require(_0x7179('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7179('0x8'));var crypto=require(_0x7179('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7179('0xa'));var toCsv=require(_0x7179('0x6'));var querystring=require(_0x7179('0xb'));var Papa=require('papaparse');var Redis=require(_0x7179('0xc'));var authService=require(_0x7179('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7179('0xe'));var hardwareService=require(_0x7179('0xf'));var logger=require(_0x7179('0x10'))(_0x7179('0x11'));var utils=require(_0x7179('0x12'));var config=require(_0x7179('0x13'));var licenseUtil=require(_0x7179('0x14'));var db=require(_0x7179('0x15'))['db'];function respondWithStatusCode(_0x4db25b,_0x5133d2){_0x5133d2=_0x5133d2||0xcc;return function(_0x4f53b0){if(_0x4f53b0){return _0x4db25b[_0x7179('0x16')](_0x5133d2);}return _0x4db25b[_0x7179('0x17')](_0x5133d2)[_0x7179('0x18')]();};}function respondWithResult(_0x363215,_0x26ff19){_0x26ff19=_0x26ff19||0xc8;return function(_0x5ab18a){if(_0x5ab18a){return _0x363215['status'](_0x26ff19)[_0x7179('0x19')](_0x5ab18a);}};}function respondWithFilteredResult(_0x4870ca,_0x52e96e){return function(_0xb70396){if(_0xb70396){var _0xf70e21=typeof _0x52e96e[_0x7179('0x1a')]==='undefined'&&typeof _0x52e96e[_0x7179('0x1b')]===_0x7179('0x1c');var _0x22e794=_0xb70396[_0x7179('0x1d')];var _0x5f4d73=_0xf70e21?0x0:_0x52e96e[_0x7179('0x1a')];var _0x2f77c3=_0xf70e21?_0xb70396['count']:_0x52e96e[_0x7179('0x1a')]+_0x52e96e[_0x7179('0x1b')];var _0x3fedd7;if(_0x2f77c3>=_0x22e794){_0x2f77c3=_0x22e794;_0x3fedd7=0xc8;}else{_0x3fedd7=0xce;}_0x4870ca[_0x7179('0x17')](_0x3fedd7);return _0x4870ca[_0x7179('0x1e')](_0x7179('0x1f'),_0x5f4d73+'-'+_0x2f77c3+'/'+_0x22e794)[_0x7179('0x19')](_0xb70396);}return null;};}function patchUpdates(_0x503720){return function(_0x29cfe7){try{jsonpatch[_0x7179('0x20')](_0x29cfe7,_0x503720,!![]);}catch(_0x44a88e){return BPromise[_0x7179('0x21')](_0x44a88e);}return _0x29cfe7['save']();};}function saveUpdates(_0x18ce11,_0x3fb74e){return function(_0x5bddc5){if(_0x5bddc5){return _0x5bddc5['update'](_0x18ce11)[_0x7179('0x22')](function(_0x5b91b8){return _0x5b91b8;});}return null;};}function removeEntity(_0x5e44fa,_0x10d633){return function(_0x337c86){if(_0x337c86){return _0x337c86[_0x7179('0x23')]()[_0x7179('0x22')](function(){var _0x22f0be=_0x337c86[_0x7179('0x24')]({'plain':!![]});var _0x5f5a0b=_0x7179('0x25');return db[_0x7179('0x26')]['destroy']({'where':{'type':_0x5f5a0b,'resourceId':_0x22f0be['id']}})[_0x7179('0x22')](function(){return _0x337c86;});})[_0x7179('0x22')](function(){_0x5e44fa[_0x7179('0x17')](0xcc)[_0x7179('0x18')]();});}};}function handleEntityNotFound(_0x36bc0b,_0x41b6be){return function(_0x13e4f3){if(!_0x13e4f3){_0x36bc0b[_0x7179('0x16')](0x194);}return _0x13e4f3;};}function handleError(_0x33dad1,_0x5381de){_0x5381de=_0x5381de||0x1f4;return function(_0x29a55a){logger[_0x7179('0x27')](_0x29a55a[_0x7179('0x28')]);if(_0x29a55a[_0x7179('0x29')]){delete _0x29a55a[_0x7179('0x29')];}_0x33dad1['status'](_0x5381de)['send'](_0x29a55a);};}exports[_0x7179('0x2a')]=function(_0x21dc17,_0x4d4044){var _0x1f9b68={},_0x56ce1a={},_0x46fdb9={'count':0x0,'rows':[]};var _0x27c618=_['map'](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x3ee539){return{'name':_0x3ee539[_0x7179('0x2b')],'type':_0x3ee539[_0x7179('0x2c')][_0x7179('0x2d')]};});_0x56ce1a[_0x7179('0x2e')]=_[_0x7179('0x2f')](_0x27c618,_0x7179('0x29'));_0x56ce1a[_0x7179('0x30')]=_[_0x7179('0x31')](_0x21dc17[_0x7179('0x30')]);_0x56ce1a[_0x7179('0x32')]=_[_0x7179('0x33')](_0x56ce1a[_0x7179('0x2e')],_0x56ce1a['query']);_0x1f9b68['attributes']=_['intersection'](_0x56ce1a['model'],qs['fields'](_0x21dc17['query'][_0x7179('0x34')]));_0x1f9b68[_0x7179('0x35')]=_0x1f9b68['attributes'][_0x7179('0x36')]?_0x1f9b68[_0x7179('0x35')]:_0x56ce1a[_0x7179('0x2e')];if(!_0x21dc17[_0x7179('0x30')][_0x7179('0x37')](_0x7179('0x38'))){_0x1f9b68[_0x7179('0x1b')]=qs['limit'](_0x21dc17[_0x7179('0x30')][_0x7179('0x1b')]);_0x1f9b68[_0x7179('0x1a')]=qs[_0x7179('0x1a')](_0x21dc17['query']['offset']);}_0x1f9b68[_0x7179('0x39')]=qs[_0x7179('0x3a')](_0x21dc17[_0x7179('0x30')]['sort']);_0x1f9b68[_0x7179('0x3b')]=qs[_0x7179('0x32')](_[_0x7179('0x3c')](_0x21dc17['query'],_0x56ce1a[_0x7179('0x32')]),_0x27c618);if(_0x21dc17[_0x7179('0x30')][_0x7179('0x3d')]){_0x1f9b68[_0x7179('0x3b')]=_['merge'](_0x1f9b68['where'],{'$or':_[_0x7179('0x2f')](_0x27c618,function(_0x57b7d4){if(_0x57b7d4[_0x7179('0x2c')]!==_0x7179('0x3e')){var _0x3d4b7e={};_0x3d4b7e[_0x57b7d4[_0x7179('0x29')]]={'$like':'%'+_0x21dc17[_0x7179('0x30')][_0x7179('0x3d')]+'%'};return _0x3d4b7e;}})});}_0x1f9b68=_[_0x7179('0x3f')]({},_0x1f9b68,_0x21dc17[_0x7179('0x40')]);var _0x8de95={'where':_0x1f9b68[_0x7179('0x3b')]};return db['CmHopperAdditionalPhone'][_0x7179('0x1d')](_0x8de95)[_0x7179('0x22')](function(_0x46459f){_0x46fdb9['count']=_0x46459f;if(_0x21dc17['query'][_0x7179('0x41')]){_0x1f9b68[_0x7179('0x42')]=[{'all':!![]}];}return db[_0x7179('0x43')][_0x7179('0x44')](_0x1f9b68);})[_0x7179('0x22')](function(_0x350cc0){_0x46fdb9[_0x7179('0x45')]=_0x350cc0;return _0x46fdb9;})[_0x7179('0x22')](respondWithFilteredResult(_0x4d4044,_0x1f9b68))[_0x7179('0x46')](handleError(_0x4d4044,null));};exports[_0x7179('0x47')]=function(_0x220e21,_0xf2d130){var _0x5eacb4={'raw':!![],'where':{'id':_0x220e21['params']['id']}},_0x453f52={};_0x453f52['model']=_['keys'](db['CmHopperAdditionalPhone'][_0x7179('0x48')]);_0x453f52[_0x7179('0x30')]=_[_0x7179('0x31')](_0x220e21[_0x7179('0x30')]);_0x453f52[_0x7179('0x32')]=_[_0x7179('0x33')](_0x453f52[_0x7179('0x2e')],_0x453f52['query']);_0x5eacb4[_0x7179('0x35')]=_['intersection'](_0x453f52['model'],qs[_0x7179('0x34')](_0x220e21[_0x7179('0x30')][_0x7179('0x34')]));_0x5eacb4[_0x7179('0x35')]=_0x5eacb4[_0x7179('0x35')]['length']?_0x5eacb4[_0x7179('0x35')]:_0x453f52['model'];if(_0x220e21[_0x7179('0x30')]['includeAll']){_0x5eacb4[_0x7179('0x42')]=[{'all':!![]}];}_0x5eacb4=_[_0x7179('0x3f')]({},_0x5eacb4,_0x220e21[_0x7179('0x40')]);return db[_0x7179('0x43')][_0x7179('0x49')](_0x5eacb4)[_0x7179('0x22')](handleEntityNotFound(_0xf2d130,null))[_0x7179('0x22')](respondWithResult(_0xf2d130,null))[_0x7179('0x46')](handleError(_0xf2d130,null));};exports['create']=function(_0x37872a,_0x26ac03){return db[_0x7179('0x43')][_0x7179('0x4a')](_0x37872a[_0x7179('0x4b')],{})[_0x7179('0x22')](function(_0x2efaef){var _0x20e736=_0x37872a[_0x7179('0x4c')][_0x7179('0x24')]({'plain':!![]});if(!_0x20e736)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e736[_0x7179('0x4d')]===_0x7179('0x4c')){var _0x15d59b=_0x2efaef[_0x7179('0x24')]({'plain':!![]});var _0x1044b4='CmHopperAdditionalPhones';return db['UserProfileSection'][_0x7179('0x49')]({'where':{'name':_0x1044b4,'userProfileId':_0x20e736[_0x7179('0x4e')]},'raw':!![]})[_0x7179('0x22')](function(_0x109c08){if(_0x109c08&&_0x109c08[_0x7179('0x4f')]===0x0){return db[_0x7179('0x26')][_0x7179('0x4a')]({'name':_0x15d59b[_0x7179('0x29')],'resourceId':_0x15d59b['id'],'type':_0x109c08[_0x7179('0x29')],'sectionId':_0x109c08['id']},{})[_0x7179('0x22')](function(){return _0x2efaef;});}else{return _0x2efaef;}})[_0x7179('0x46')](function(_0x22a494){logger[_0x7179('0x27')](_0x7179('0x50'),_0x22a494);throw _0x22a494;});}return _0x2efaef;})[_0x7179('0x22')](respondWithResult(_0x26ac03,0xc9))[_0x7179('0x46')](handleError(_0x26ac03,null));};exports[_0x7179('0x51')]=function(_0xcbfbbe,_0x376485){if(_0xcbfbbe[_0x7179('0x4b')]['id']){delete _0xcbfbbe['body']['id'];}return db[_0x7179('0x43')][_0x7179('0x49')]({'where':{'id':_0xcbfbbe['params']['id']}})[_0x7179('0x22')](handleEntityNotFound(_0x376485,null))['then'](saveUpdates(_0xcbfbbe[_0x7179('0x4b')],null))[_0x7179('0x22')](respondWithResult(_0x376485,null))['catch'](handleError(_0x376485,null));};exports['destroy']=function(_0x5671d1,_0x3b987d){return db[_0x7179('0x43')][_0x7179('0x49')]({'where':{'id':_0x5671d1['params']['id']}})[_0x7179('0x22')](handleEntityNotFound(_0x3b987d,null))[_0x7179('0x22')](removeEntity(_0x3b987d,null))['catch'](handleError(_0x3b987d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 1312873..547fc78 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 _0x03f5=['CmHopperAdditionalPhone','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x202281,_0x232389){var _0x3d3abe=function(_0x548acf){while(--_0x548acf){_0x202281['push'](_0x202281['shift']());}};_0x3d3abe(++_0x232389);}(_0x03f5,0xc9));var _0x503f=function(_0x11ec53,_0x37fd2b){_0x11ec53=_0x11ec53-0x0;var _0x4b46da=_0x03f5[_0x11ec53];return _0x4b46da;};'use strict';var _=require(_0x503f('0x0'));var util=require(_0x503f('0x1'));var logger=require(_0x503f('0x2'))(_0x503f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x503f('0x4'));var rimraf=require(_0x503f('0x5'));var config=require(_0x503f('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x503f('0x7')]=function(_0x3038d3,_0x2d642f){return _0x3038d3[_0x503f('0x8')](_0x503f('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac5d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','lodash'];(function(_0x6db6f3,_0x18ddca){var _0x249b98=function(_0x6cbdd4){while(--_0x6cbdd4){_0x6db6f3['push'](_0x6db6f3['shift']());}};_0x249b98(++_0x18ddca);}(_0xac5d,0x83));var _0xdac5=function(_0xc72a72,_0xfaaf35){_0xc72a72=_0xc72a72-0x0;var _0x20f9a9=_0xac5d[_0xc72a72];return _0x20f9a9;};'use strict';var _=require(_0xdac5('0x0'));var util=require(_0xdac5('0x1'));var logger=require(_0xdac5('0x2'))(_0xdac5('0x3'));var moment=require(_0xdac5('0x4'));var BPromise=require(_0xdac5('0x5'));var rp=require(_0xdac5('0x6'));var fs=require('fs');var path=require(_0xdac5('0x7'));var rimraf=require(_0xdac5('0x8'));var config=require(_0xdac5('0x9'));var attributes=require(_0xdac5('0xa'));module[_0xdac5('0xb')]=function(_0x6f1235,_0x386d4f){return _0x6f1235['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','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 f0dfbd3..6245384 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 _0x5289=['transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','ListId','VoiceQueueId','body','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize'];(function(_0x6ca542,_0x42bdeb){var _0x364a74=function(_0x33e420){while(--_0x33e420){_0x6ca542['push'](_0x6ca542['shift']());}};_0x364a74(++_0x42bdeb);}(_0x5289,0x1bd));var _0x9528=function(_0x12565e,_0x4640b4){_0x12565e=_0x12565e-0x0;var _0x338be7=_0x5289[_0x12565e];return _0x338be7;};'use strict';var _=require(_0x9528('0x0'));var util=require(_0x9528('0x1'));var moment=require(_0x9528('0x2'));var BPromise=require(_0x9528('0x3'));var rs=require(_0x9528('0x4'));var fs=require('fs');var Redis=require(_0x9528('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9528('0x6'));var logger=require(_0x9528('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9528('0x8'));var client=jayson[_0x9528('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x294821,_0x28db7c,_0x358b61){return new BPromise(function(_0x208229,_0x2c7bb7){return client[_0x9528('0xa')](_0x294821,_0x358b61)['then'](function(_0x49df58){logger[_0x9528('0xb')](_0x9528('0xc'),_0x28db7c,_0x9528('0xd'));logger['debug'](_0x9528('0xe'),_0x28db7c,_0x9528('0xd'),JSON[_0x9528('0xf')](_0x49df58));if(_0x49df58[_0x9528('0x10')]){if(_0x49df58[_0x9528('0x10')][_0x9528('0x11')]===0x1f4){logger[_0x9528('0x10')](_0x9528('0xc'),_0x28db7c,_0x49df58[_0x9528('0x10')]['message']);return _0x2c7bb7(_0x49df58[_0x9528('0x10')][_0x9528('0x12')]);}logger['error'](_0x9528('0xc'),_0x28db7c,_0x49df58[_0x9528('0x10')][_0x9528('0x12')]);return _0x208229(_0x49df58['error'][_0x9528('0x12')]);}else{logger[_0x9528('0xb')](_0x9528('0xc'),_0x28db7c,_0x9528('0xd'));_0x208229(_0x49df58[_0x9528('0x13')][_0x9528('0x12')]);}})[_0x9528('0x14')](function(_0x315b5f){logger[_0x9528('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x28db7c,_0x315b5f);_0x2c7bb7(_0x315b5f);});});}exports[_0x9528('0x15')]=function(_0x1f1250){var _0x18745c=this;return new Promise(function(_0x19f382,_0x3bc515){return db[_0x9528('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x1f1250['body']['ContactId'],'ListId':_0x1f1250['body'][_0x9528('0x17')],'VoiceQueueId':_0x1f1250['body'][_0x9528('0x18')]===undefined?null:_0x1f1250['body'][_0x9528('0x18')],'CampaignId':_0x1f1250[_0x9528('0x19')]['CampaignId']===undefined?null:_0x1f1250[_0x9528('0x19')][_0x9528('0x1a')]}})[_0x9528('0x1b')](function(_0x4f1abd){if(_0x4f1abd!=null){return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4f1abd['id'],'OrderBy':{'$gt':_0x4f1abd[_0x9528('0x1e')]}},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x15f19f){var _0x408d94=0x0;if(_0x15f19f){if(_0x15f19f[_0x9528('0x20')]+_0x15f19f['countcongestionretry']+_0x15f19f[_0x9528('0x21')]+_0x15f19f[_0x9528('0x22')]+_0x15f19f[_0x9528('0x23')]+_0x15f19f[_0x9528('0x24')]+_0x15f19f[_0x9528('0x25')]+_0x15f19f[_0x9528('0x26')]<_0x1f1250[_0x9528('0x27')][_0x9528('0x28')])_0x408d94=0x1;_0x19f382({'additional':_0x408d94});}else{return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4f1abd['id']},'order':[['OrderBy','ASC']]})[_0x9528('0x1b')](function(_0x339463){var _0x587bd2=0x0;if(_0x339463){if(_0x339463[_0x9528('0x20')]+_0x339463['countcongestionretry']+_0x339463[_0x9528('0x21')]+_0x339463[_0x9528('0x22')]+_0x339463[_0x9528('0x23')]+_0x339463[_0x9528('0x24')]+_0x339463[_0x9528('0x25')]+_0x339463[_0x9528('0x26')]<_0x1f1250[_0x9528('0x27')][_0x9528('0x28')])_0x587bd2=0x1;_0x19f382({'additional':_0x587bd2});}else{_0x19f382({'additional':0x0});}})[_0x9528('0x14')](function(_0x11154d){logger[_0x9528('0x10')]('VerifyAdditionalPhones',_0x11154d['message']);_0x3bc515(_0x18745c[_0x9528('0x10')](0x1f4,_0x11154d[_0x9528('0x12')]));});}})[_0x9528('0x14')](function(_0x3539b0){logger['error'](_0x9528('0x15'),_0x3539b0['message']);_0x3bc515(_0x18745c[_0x9528('0x10')](0x1f4,_0x3539b0[_0x9528('0x12')]));});}else _0x19f382({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x2f3f7d){var _0x46642c=this;return new Promise(function(_0x503aac,_0x43988c){return db[_0x9528('0x16')][_0x9528('0x1d')]({'raw':!![],'where':{'ContactId':_0x2f3f7d['body']['ContactId'],'ListId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x17')],'VoiceQueueId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x18')]===undefined?null:_0x2f3f7d[_0x9528('0x19')][_0x9528('0x18')],'CampaignId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x1a')]===undefined?null:_0x2f3f7d[_0x9528('0x19')]['CampaignId']}})[_0x9528('0x1b')](function(_0x4cb8e2){if(_0x4cb8e2!=null){return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4cb8e2['id'],'OrderBy':{'$gte':_0x4cb8e2[_0x9528('0x1e')]}},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x326b09){if(_0x326b09)return activateAdditionalPhone(_0x4cb8e2,_0x2f3f7d[_0x9528('0x19')],_0x326b09,_0x2f3f7d['duration'],_0x2f3f7d[_0x9528('0x29')])['then'](function(_0x28f78f){_0x503aac(_0x28f78f);});else{return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4cb8e2['id']},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x1191fa){if(_0x1191fa)return activateAdditionalPhone(_0x4cb8e2,_0x2f3f7d['body'],_0x1191fa,_0x2f3f7d['duration'],_0x2f3f7d[_0x9528('0x29')])['then'](function(_0x18da44){_0x503aac(_0x18da44);});else{_0x503aac({'id':_0x4cb8e2['id'],'phone':''});}})[_0x9528('0x14')](function(_0x6a3900){logger['error'](_0x9528('0x15'),_0x6a3900[_0x9528('0x12')]);_0x43988c(_0x46642c[_0x9528('0x10')](0x1f4,_0x6a3900['message']));});}})[_0x9528('0x14')](function(_0x520aac){logger[_0x9528('0x10')](_0x9528('0x15'),_0x520aac['message']);_0x43988c(_0x46642c[_0x9528('0x10')](0x1f4,_0x520aac[_0x9528('0x12')]));});}else _0x503aac(0x1);});});};function activateAdditionalPhone(_0xa49832,_0x26b2d9,_0x56218e,_0x2e23fa,_0x352003){return new Promise(function(_0xb8e283,_0x3f4f70){var _0x4b3616;if(_[_0x9528('0x2a')](_0x56218e[_0x9528('0x2b')])){_0x56218e['scheduledat']=moment();}if(moment()>moment(_0x56218e[_0x9528('0x2b')])){_0x4b3616=moment()[_0x9528('0x2c')](_0x352003||0x3,_0x9528('0x2d'));}else{if(_0x56218e[_0x9528('0x1e')]==0x0){_0x4b3616=moment(_0x56218e[_0x9528('0x2b')]);}else{_0x4b3616=moment()['add'](_0x352003||0x3,_0x9528('0x2d'));}}if(_[_0x9528('0x2a')](_0x4b3616)){_0x4b3616=moment()[_0x9528('0x2c')](_0x352003||0x3,_0x9528('0x2d'));}var _0x2dffb9={'phone':_0xa49832[_0x9528('0x2e')],'active':0x0,'OrderBy':_['isNil'](_0xa49832['OrderBy'])?0x0:_0xa49832[_0x9528('0x1e')],'scheduledat':moment()['add'](_0x2e23fa||0x1,_0x9528('0x2d')),'countbusyretry':_0x26b2d9[_0x9528('0x20')],'countcongestionretry':_0x26b2d9['countcongestionretry'],'countnoanswerretry':_0x26b2d9[_0x9528('0x21')],'countnosuchnumberretry':_0x26b2d9[_0x9528('0x22')],'countdropretry':_0x26b2d9['countdropretry'],'countabandonedretry':_0x26b2d9[_0x9528('0x24')],'countmachineretry':_0x26b2d9[_0x9528('0x25')],'countagentrejectretry':_0x26b2d9[_0x9528('0x26')],'createdAt':_0x26b2d9[_0x9528('0x2f')],'updatedAt':_0x26b2d9[_0x9528('0x30')]};var _0x30c0d3={'CmHopperId':_0xa49832['id'],'phone':_0x56218e[_0x9528('0x2e')],'active':0x0,'OrderBy':_[_0x9528('0x2a')](_0x56218e['OrderBy'])?0x0:_0x56218e[_0x9528('0x1e')],'scheduledat':_0x4b3616,'countbusyretry':_0x56218e[_0x9528('0x20')],'countcongestionretry':_0x56218e['countcongestionretry'],'countnoanswerretry':_0x56218e[_0x9528('0x21')],'countnosuchnumberretry':_0x56218e[_0x9528('0x22')],'countdropretry':_0x56218e['countdropretry'],'countabandonedretry':_0x56218e[_0x9528('0x24')],'countmachineretry':_0x56218e[_0x9528('0x25')],'countagentrejectretry':_0x56218e[_0x9528('0x26')],'createdAt':_0x56218e[_0x9528('0x2f')],'updatedAt':_0x56218e['updatedAt']};return db[_0x9528('0x31')][_0x9528('0x32')](function(_0x59e202){return db[_0x9528('0x1c')][_0x9528('0x33')](_0x2dffb9,{'where':{'id':_0x56218e['id']}},{'transaction':_0x59e202})[_0x9528('0x1b')](function(){return db['CmHopper']['update'](_0x30c0d3,{'where':{'id':_0xa49832['id']}},{'transaction':_0x59e202});});})[_0x9528('0x1b')](function(_0x4a3344){_0xb8e283({'id':_0xa49832['id'],'phone':_0x56218e[_0x9528('0x2e')]});})[_0x9528('0x14')](function(_0x569efc){logger[_0x9528('0x10')](_0x9528('0x34'),_0x569efc['message']);_0x3f4f70({'error':_0x569efc['message']});});});}exports[_0x9528('0x35')]=function(_0x531f99){var _0x7b72e2=this;return new Promise(function(_0x2d2ab0,_0xa9eca3){return db[_0x9528('0x16')][_0x9528('0x33')](_0x531f99[_0x9528('0x19')][_0x9528('0x36')],{'where':{'id':_0x531f99[_0x9528('0x19')]['id']}})[_0x9528('0x1b')](function(_0x3ba3a3){_0x2d2ab0(_0x3ba3a3);})[_0x9528('0x14')](function(_0x29effc){logger[_0x9528('0x10')]('IncrementPreviewCounters',_0x29effc[_0x9528('0x12')]);_0xa9eca3(_0x7b72e2[_0x9528('0x10')](0x1f4,_0x29effc['message']));});});}; \ No newline at end of file +var _0x2902=['field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','findOne','countcongestionretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','createdAt','phone','countdropretry','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters'];(function(_0x403435,_0x582bcc){var _0x544a5d=function(_0x12c1d4){while(--_0x12c1d4){_0x403435['push'](_0x403435['shift']());}};_0x544a5d(++_0x582bcc);}(_0x2902,0x77));var _0x2290=function(_0x411e71,_0xf9652){_0x411e71=_0x411e71-0x0;var _0x226ae3=_0x2902[_0x411e71];return _0x226ae3;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var moment=require(_0x2290('0x2'));var BPromise=require(_0x2290('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2290('0x4'));var db=require(_0x2290('0x5'))['db'];var utils=require(_0x2290('0x6'));var logger=require('../../config/logger')(_0x2290('0x7'));var config=require(_0x2290('0x8'));var jayson=require(_0x2290('0x9'));var client=jayson['client'][_0x2290('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15813e,_0x485c31,_0x544c4b){return new BPromise(function(_0x1e7953,_0x3edbfb){return client[_0x2290('0xb')](_0x15813e,_0x544c4b)['then'](function(_0x150a8c){logger['info'](_0x2290('0xc'),_0x485c31,_0x2290('0xd'));logger[_0x2290('0xe')](_0x2290('0xf'),_0x485c31,'request\x20sent',JSON[_0x2290('0x10')](_0x150a8c));if(_0x150a8c[_0x2290('0x11')]){if(_0x150a8c[_0x2290('0x11')][_0x2290('0x12')]===0x1f4){logger[_0x2290('0x11')](_0x2290('0xc'),_0x485c31,_0x150a8c[_0x2290('0x11')][_0x2290('0x13')]);return _0x3edbfb(_0x150a8c['error'][_0x2290('0x13')]);}logger['error'](_0x2290('0xc'),_0x485c31,_0x150a8c[_0x2290('0x11')][_0x2290('0x13')]);return _0x1e7953(_0x150a8c[_0x2290('0x11')]['message']);}else{logger['info'](_0x2290('0xc'),_0x485c31,_0x2290('0xd'));_0x1e7953(_0x150a8c[_0x2290('0x14')][_0x2290('0x13')]);}})[_0x2290('0x15')](function(_0x1c74aa){logger[_0x2290('0x11')](_0x2290('0xc'),_0x485c31,_0x1c74aa);_0x3edbfb(_0x1c74aa);});});}exports[_0x2290('0x16')]=function(_0x5c46fd){var _0xdcee7b=this;return new Promise(function(_0x3c277c,_0x1729c1){return db[_0x2290('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x5c46fd[_0x2290('0x18')][_0x2290('0x19')],'ListId':_0x5c46fd[_0x2290('0x18')][_0x2290('0x1a')],'VoiceQueueId':_0x5c46fd[_0x2290('0x18')][_0x2290('0x1b')]===undefined?null:_0x5c46fd[_0x2290('0x18')][_0x2290('0x1b')],'CampaignId':_0x5c46fd[_0x2290('0x18')][_0x2290('0x1c')]===undefined?null:_0x5c46fd['body'][_0x2290('0x1c')]}})[_0x2290('0x1d')](function(_0x4182dc){if(_0x4182dc!=null){return db[_0x2290('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4182dc['id'],'OrderBy':{'$gt':_0x4182dc[_0x2290('0x1f')]}},'order':[[_0x2290('0x1f'),_0x2290('0x20')]]})[_0x2290('0x1d')](function(_0x5530a9){var _0xa12a13=0x0;if(_0x5530a9){if(_0x5530a9[_0x2290('0x21')]+_0x5530a9['countcongestionretry']+_0x5530a9[_0x2290('0x22')]+_0x5530a9[_0x2290('0x23')]+_0x5530a9['countdropretry']+_0x5530a9[_0x2290('0x24')]+_0x5530a9[_0x2290('0x25')]+_0x5530a9[_0x2290('0x26')]<_0x5c46fd[_0x2290('0x27')][_0x2290('0x28')])_0xa12a13=0x1;_0x3c277c({'additional':_0xa12a13});}else{return db[_0x2290('0x1e')][_0x2290('0x29')]({'raw':!![],'where':{'CmHopperId':_0x4182dc['id']},'order':[[_0x2290('0x1f'),_0x2290('0x20')]]})[_0x2290('0x1d')](function(_0x508e7f){var _0x26c712=0x0;if(_0x508e7f){if(_0x508e7f[_0x2290('0x21')]+_0x508e7f[_0x2290('0x2a')]+_0x508e7f[_0x2290('0x22')]+_0x508e7f['countnosuchnumberretry']+_0x508e7f['countdropretry']+_0x508e7f[_0x2290('0x24')]+_0x508e7f[_0x2290('0x25')]+_0x508e7f[_0x2290('0x26')]<_0x5c46fd[_0x2290('0x27')]['dialGlobalMaxRetry'])_0x26c712=0x1;_0x3c277c({'additional':_0x26c712});}else{_0x3c277c({'additional':0x0});}})[_0x2290('0x15')](function(_0x18436c){logger['error'](_0x2290('0x16'),_0x18436c[_0x2290('0x13')]);_0x1729c1(_0xdcee7b[_0x2290('0x11')](0x1f4,_0x18436c[_0x2290('0x13')]));});}})['catch'](function(_0x308e5a){logger[_0x2290('0x11')](_0x2290('0x16'),_0x308e5a[_0x2290('0x13')]);_0x1729c1(_0xdcee7b['error'](0x1f4,_0x308e5a['message']));});}else _0x3c277c({'additional':0x0});});});};exports[_0x2290('0x2b')]=function(_0x3d2c8a){var _0x5086f7=this;return new Promise(function(_0x1acfe0,_0x44bf84){return db[_0x2290('0x17')][_0x2290('0x29')]({'raw':!![],'where':{'ContactId':_0x3d2c8a[_0x2290('0x18')][_0x2290('0x19')],'ListId':_0x3d2c8a['body'][_0x2290('0x1a')],'VoiceQueueId':_0x3d2c8a[_0x2290('0x18')][_0x2290('0x1b')]===undefined?null:_0x3d2c8a[_0x2290('0x18')]['VoiceQueueId'],'CampaignId':_0x3d2c8a[_0x2290('0x18')][_0x2290('0x1c')]===undefined?null:_0x3d2c8a[_0x2290('0x18')]['CampaignId']}})['then'](function(_0x50ce99){if(_0x50ce99!=null){return db[_0x2290('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x50ce99['id'],'OrderBy':{'$gte':_0x50ce99[_0x2290('0x1f')]}},'order':[[_0x2290('0x1f'),_0x2290('0x20')]]})[_0x2290('0x1d')](function(_0x40e4cb){if(_0x40e4cb)return activateAdditionalPhone(_0x50ce99,_0x3d2c8a[_0x2290('0x18')],_0x40e4cb,_0x3d2c8a[_0x2290('0x2c')],_0x3d2c8a[_0x2290('0x2d')])[_0x2290('0x1d')](function(_0x570c86){_0x1acfe0(_0x570c86);});else{return db[_0x2290('0x1e')][_0x2290('0x29')]({'raw':!![],'where':{'CmHopperId':_0x50ce99['id']},'order':[[_0x2290('0x1f'),_0x2290('0x20')]]})[_0x2290('0x1d')](function(_0x559a66){if(_0x559a66)return activateAdditionalPhone(_0x50ce99,_0x3d2c8a[_0x2290('0x18')],_0x559a66,_0x3d2c8a[_0x2290('0x2c')],_0x3d2c8a[_0x2290('0x2d')])[_0x2290('0x1d')](function(_0x202906){_0x1acfe0(_0x202906);});else{_0x1acfe0({'id':_0x50ce99['id'],'phone':''});}})[_0x2290('0x15')](function(_0x590fe8){logger[_0x2290('0x11')](_0x2290('0x16'),_0x590fe8[_0x2290('0x13')]);_0x44bf84(_0x5086f7['error'](0x1f4,_0x590fe8[_0x2290('0x13')]));});}})['catch'](function(_0x32f221){logger[_0x2290('0x11')]('VerifyAdditionalPhones',_0x32f221[_0x2290('0x13')]);_0x44bf84(_0x5086f7[_0x2290('0x11')](0x1f4,_0x32f221[_0x2290('0x13')]));});}else _0x1acfe0(0x1);});});};function activateAdditionalPhone(_0x3a1b8e,_0x35b151,_0x1e23d1,_0x49bde9,_0x1d794e){return new Promise(function(_0x4681b0,_0x4ff109){var _0x1db8a1;if(_[_0x2290('0x2e')](_0x1e23d1[_0x2290('0x2f')])){_0x1e23d1[_0x2290('0x2f')]=moment();}if(moment()>moment(_0x1e23d1[_0x2290('0x2f')])){_0x1db8a1=moment()['add'](_0x1d794e||0x3,_0x2290('0x30'));}else{if(_0x1e23d1[_0x2290('0x1f')]==0x0){_0x1db8a1=moment(_0x1e23d1['scheduledat']);}else{_0x1db8a1=moment()['add'](_0x1d794e||0x3,_0x2290('0x30'));}}if(_[_0x2290('0x2e')](_0x1db8a1)){_0x1db8a1=moment()[_0x2290('0x31')](_0x1d794e||0x3,_0x2290('0x30'));}var _0x3e1efc={'phone':_0x3a1b8e['phone'],'active':0x0,'OrderBy':_['isNil'](_0x3a1b8e[_0x2290('0x1f')])?0x0:_0x3a1b8e['OrderBy'],'scheduledat':moment()[_0x2290('0x31')](_0x49bde9||0x1,'minutes'),'countbusyretry':_0x35b151[_0x2290('0x21')],'countcongestionretry':_0x35b151['countcongestionretry'],'countnoanswerretry':_0x35b151[_0x2290('0x22')],'countnosuchnumberretry':_0x35b151[_0x2290('0x23')],'countdropretry':_0x35b151['countdropretry'],'countabandonedretry':_0x35b151[_0x2290('0x24')],'countmachineretry':_0x35b151[_0x2290('0x25')],'countagentrejectretry':_0x35b151[_0x2290('0x26')],'createdAt':_0x35b151[_0x2290('0x32')],'updatedAt':_0x35b151['updatedAt']};var _0x1aa69f={'CmHopperId':_0x3a1b8e['id'],'phone':_0x1e23d1[_0x2290('0x33')],'active':0x0,'OrderBy':_[_0x2290('0x2e')](_0x1e23d1[_0x2290('0x1f')])?0x0:_0x1e23d1[_0x2290('0x1f')],'scheduledat':_0x1db8a1,'countbusyretry':_0x1e23d1['countbusyretry'],'countcongestionretry':_0x1e23d1['countcongestionretry'],'countnoanswerretry':_0x1e23d1[_0x2290('0x22')],'countnosuchnumberretry':_0x1e23d1['countnosuchnumberretry'],'countdropretry':_0x1e23d1[_0x2290('0x34')],'countabandonedretry':_0x1e23d1[_0x2290('0x24')],'countmachineretry':_0x1e23d1[_0x2290('0x25')],'countagentrejectretry':_0x1e23d1[_0x2290('0x26')],'createdAt':_0x1e23d1[_0x2290('0x32')],'updatedAt':_0x1e23d1['updatedAt']};return db[_0x2290('0x35')][_0x2290('0x36')](function(_0x21ade0){return db['CmHopperAdditionalPhone'][_0x2290('0x37')](_0x3e1efc,{'where':{'id':_0x1e23d1['id']}},{'transaction':_0x21ade0})['then'](function(){return db['CmHopper'][_0x2290('0x37')](_0x1aa69f,{'where':{'id':_0x3a1b8e['id']}},{'transaction':_0x21ade0});});})['then'](function(_0x18baf1){_0x4681b0({'id':_0x3a1b8e['id'],'phone':_0x1e23d1[_0x2290('0x33')]});})[_0x2290('0x15')](function(_0x127883){logger['error'](_0x2290('0x38'),_0x127883[_0x2290('0x13')]);_0x4ff109({'error':_0x127883[_0x2290('0x13')]});});});}exports[_0x2290('0x39')]=function(_0x2da79d){var _0x5659e5=this;return new Promise(function(_0x142bb6,_0x556625){return db[_0x2290('0x17')]['update'](_0x2da79d[_0x2290('0x18')][_0x2290('0x3a')],{'where':{'id':_0x2da79d[_0x2290('0x18')]['id']}})[_0x2290('0x1d')](function(_0x2b1619){_0x142bb6(_0x2b1619);})['catch'](function(_0x1859d3){logger[_0x2290('0x11')](_0x2290('0x39'),_0x1859d3['message']);_0x556625(_0x5659e5['error'](0x1f4,_0x1859d3[_0x2290('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 5589a9b..24697fb 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 _0x15bf=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','show','post','/:id','update','destroy','exports','multer','util'];(function(_0x2a9dcf,_0x408af3){var _0x9d5122=function(_0x5bc6bc){while(--_0x5bc6bc){_0x2a9dcf['push'](_0x2a9dcf['shift']());}};_0x9d5122(++_0x408af3);}(_0x15bf,0x18e));var _0xf15b=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x15bf[_0x35af23];return _0x340506;};'use strict';var multer=require(_0xf15b('0x0'));var util=require(_0xf15b('0x1'));var path=require('path');var timeout=require(_0xf15b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf15b('0x3'));var auth=require(_0xf15b('0x4'));var interaction=require(_0xf15b('0x5'));var config=require('../../config/environment');var controller=require(_0xf15b('0x6'));router['get']('/',auth[_0xf15b('0x7')](),controller[_0xf15b('0x8')]);router[_0xf15b('0x9')]('/:id',auth[_0xf15b('0x7')](),controller[_0xf15b('0xa')]);router[_0xf15b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf15b('0xc'),auth[_0xf15b('0x7')](),controller[_0xf15b('0xd')]);router['delete'](_0xf15b('0xc'),auth['isAuthenticated'](),controller[_0xf15b('0xe')]);module[_0xf15b('0xf')]=router; \ No newline at end of file +var _0x657e=['isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x657e,0x1c2));var _0xe657=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x657e[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var path=require(_0xe657('0x2'));var timeout=require(_0xe657('0x3'));var express=require('express');var router=express[_0xe657('0x4')]();var fs_extra=require(_0xe657('0x5'));var auth=require(_0xe657('0x6'));var interaction=require(_0xe657('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0xe657('0x8')]('/',auth[_0xe657('0x9')](),controller['index']);router[_0xe657('0x8')](_0xe657('0xa'),auth[_0xe657('0x9')](),controller['show']);router[_0xe657('0xb')]('/',auth[_0xe657('0x9')](),controller[_0xe657('0xc')]);router[_0xe657('0xd')](_0xe657('0xa'),auth[_0xe657('0x9')](),controller['update']);router[_0xe657('0xe')](_0xe657('0xa'),auth['isAuthenticated'](),controller[_0xe657('0xf')]);module[_0xe657('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 19a59f5..3a1c259 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 _0xe58e=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0xe58e,0x10e));var _0xee58=function(_0x2946a1,_0x5b5fa4){_0x2946a1=_0x2946a1-0x0;var _0x342ccd=_0xe58e[_0x2946a1];return _0x342ccd;};'use strict';var moment=require(_0xee58('0x0'));var Sequelize=require(_0xee58('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')},'ListId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')},'VoiceQueueId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')}}; \ No newline at end of file +var _0x8c45=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x29d362,_0x2dc453){var _0x2cd13c=function(_0x28593c){while(--_0x28593c){_0x29d362['push'](_0x29d362['shift']());}};_0x2cd13c(++_0x2dc453);}(_0x8c45,0xda));var _0x58c4=function(_0x48f182,_0x32b4ba){_0x48f182=_0x48f182-0x0;var _0x3b807e=_0x8c45[_0x48f182];return _0x3b807e;};'use strict';var moment=require(_0x58c4('0x0'));var Sequelize=require(_0x58c4('0x1'));module[_0x58c4('0x2')]={'phone':{'type':Sequelize[_0x58c4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x58c4('0x4')],'unique':_0x58c4('0x5')},'ListId':{'type':Sequelize[_0x58c4('0x4')],'unique':_0x58c4('0x5')},'VoiceQueueId':{'type':Sequelize[_0x58c4('0x4')],'unique':_0x58c4('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 0dc1ce1..1dd5a96 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 _0x6851=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','query','keys','intersection','model'];(function(_0x7a4b16,_0x2c3b70){var _0x59e441=function(_0xfc8375){while(--_0xfc8375){_0x7a4b16['push'](_0x7a4b16['shift']());}};_0x59e441(++_0x2c3b70);}(_0x6851,0xb3));var _0x1685=function(_0x16ff13,_0x574da6){_0x16ff13=_0x16ff13-0x0;var _0x167afd=_0x6851[_0x16ff13];return _0x167afd;};'use strict';var emlformat=require(_0x1685('0x0'));var rimraf=require(_0x1685('0x1'));var zipdir=require(_0x1685('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1685('0x3'));var moment=require(_0x1685('0x4'));var BPromise=require(_0x1685('0x5'));var Mustache=require('mustache');var util=require(_0x1685('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1685('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1685('0x8'));var _=require(_0x1685('0x9'));var squel=require(_0x1685('0xa'));var crypto=require(_0x1685('0xb'));var jsforce=require(_0x1685('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1685('0x7'));var querystring=require(_0x1685('0xd'));var Papa=require(_0x1685('0xe'));var Redis=require(_0x1685('0xf'));var authService=require(_0x1685('0x10'));var qs=require(_0x1685('0x11'));var as=require(_0x1685('0x12'));var hardwareService=require(_0x1685('0x13'));var logger=require(_0x1685('0x14'))(_0x1685('0x15'));var utils=require(_0x1685('0x16'));var config=require(_0x1685('0x17'));var licenseUtil=require(_0x1685('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e9b8a,_0x3bfeba){_0x3bfeba=_0x3bfeba||0xcc;return function(_0x59141a){if(_0x59141a){return _0x3e9b8a[_0x1685('0x19')](_0x3bfeba);}return _0x3e9b8a[_0x1685('0x1a')](_0x3bfeba)[_0x1685('0x1b')]();};}function respondWithResult(_0x19b47e,_0x1c7066){_0x1c7066=_0x1c7066||0xc8;return function(_0x373e37){if(_0x373e37){return _0x19b47e[_0x1685('0x1a')](_0x1c7066)[_0x1685('0x1c')](_0x373e37);}};}function respondWithFilteredResult(_0x56e76b,_0x2f39f3){return function(_0x20cba9){if(_0x20cba9){var _0xec8710=typeof _0x2f39f3[_0x1685('0x1d')]===_0x1685('0x1e')&&typeof _0x2f39f3[_0x1685('0x1f')]===_0x1685('0x1e');var _0x240447=_0x20cba9[_0x1685('0x20')];var _0x3471c6=_0xec8710?0x0:_0x2f39f3[_0x1685('0x1d')];var _0x2b4155=_0xec8710?_0x20cba9[_0x1685('0x20')]:_0x2f39f3[_0x1685('0x1d')]+_0x2f39f3['limit'];var _0x59f610;if(_0x2b4155>=_0x240447){_0x2b4155=_0x240447;_0x59f610=0xc8;}else{_0x59f610=0xce;}_0x56e76b[_0x1685('0x1a')](_0x59f610);return _0x56e76b[_0x1685('0x21')](_0x1685('0x22'),_0x3471c6+'-'+_0x2b4155+'/'+_0x240447)[_0x1685('0x1c')](_0x20cba9);}return null;};}function patchUpdates(_0x425728){return function(_0x514312){try{jsonpatch['apply'](_0x514312,_0x425728,!![]);}catch(_0xd87d1){return BPromise['reject'](_0xd87d1);}return _0x514312[_0x1685('0x23')]();};}function saveUpdates(_0x4bc5b7,_0x53f5bc){return function(_0x3855f4){if(_0x3855f4){return _0x3855f4['update'](_0x4bc5b7)[_0x1685('0x24')](function(_0x59497f){return _0x59497f;});}return null;};}function removeEntity(_0x8c0424,_0x50e4f9){return function(_0x3c4323){if(_0x3c4323){return _0x3c4323[_0x1685('0x25')]()[_0x1685('0x24')](function(){_0x8c0424['status'](0xcc)[_0x1685('0x1b')]();});}};}function handleEntityNotFound(_0x43ce51,_0xb3ce42){return function(_0x5f36ce){if(!_0x5f36ce){_0x43ce51['sendStatus'](0x194);}return _0x5f36ce;};}function handleError(_0xd2120e,_0x2be024){_0x2be024=_0x2be024||0x1f4;return function(_0x506f12){logger[_0x1685('0x26')](_0x506f12[_0x1685('0x27')]);if(_0x506f12[_0x1685('0x28')]){delete _0x506f12[_0x1685('0x28')];}_0xd2120e[_0x1685('0x1a')](_0x2be024)[_0x1685('0x29')](_0x506f12);};}exports[_0x1685('0x2a')]=function(_0x1a7fd7,_0x585a16){var _0x2625af={},_0x2e66e4={},_0x30a8f9={'count':0x0,'rows':[]};var _0x41a751=_[_0x1685('0x2b')](db[_0x1685('0x2c')]['rawAttributes'],function(_0x59a527){return{'name':_0x59a527[_0x1685('0x2d')],'type':_0x59a527[_0x1685('0x2e')][_0x1685('0x2f')]};});_0x2e66e4['model']=_['map'](_0x41a751,'name');_0x2e66e4[_0x1685('0x30')]=_[_0x1685('0x31')](_0x1a7fd7['query']);_0x2e66e4['filters']=_[_0x1685('0x32')](_0x2e66e4[_0x1685('0x33')],_0x2e66e4['query']);_0x2625af[_0x1685('0x34')]=_[_0x1685('0x32')](_0x2e66e4[_0x1685('0x33')],qs[_0x1685('0x35')](_0x1a7fd7['query'][_0x1685('0x35')]));_0x2625af[_0x1685('0x34')]=_0x2625af[_0x1685('0x34')][_0x1685('0x36')]?_0x2625af[_0x1685('0x34')]:_0x2e66e4[_0x1685('0x33')];if(!_0x1a7fd7[_0x1685('0x30')][_0x1685('0x37')](_0x1685('0x38'))){_0x2625af[_0x1685('0x1f')]=qs[_0x1685('0x1f')](_0x1a7fd7[_0x1685('0x30')]['limit']);_0x2625af[_0x1685('0x1d')]=qs[_0x1685('0x1d')](_0x1a7fd7[_0x1685('0x30')][_0x1685('0x1d')]);}_0x2625af[_0x1685('0x39')]=qs[_0x1685('0x3a')](_0x1a7fd7[_0x1685('0x30')][_0x1685('0x3a')]);_0x2625af[_0x1685('0x3b')]=qs[_0x1685('0x3c')](_[_0x1685('0x3d')](_0x1a7fd7[_0x1685('0x30')],_0x2e66e4[_0x1685('0x3c')]),_0x41a751);if(_0x1a7fd7[_0x1685('0x30')]['filter']){_0x2625af[_0x1685('0x3b')]=_[_0x1685('0x3e')](_0x2625af['where'],{'$or':_[_0x1685('0x2b')](_0x41a751,function(_0x46a3ee){if(_0x46a3ee[_0x1685('0x2e')]!=='VIRTUAL'){var _0x43e2ff={};_0x43e2ff[_0x46a3ee[_0x1685('0x28')]]={'$like':'%'+_0x1a7fd7[_0x1685('0x30')][_0x1685('0x3f')]+'%'};return _0x43e2ff;}})});}_0x2625af=_['merge']({},_0x2625af,_0x1a7fd7[_0x1685('0x40')]);var _0x38b975={'where':_0x2625af[_0x1685('0x3b')]};return db[_0x1685('0x2c')][_0x1685('0x20')](_0x38b975)['then'](function(_0x27afc5){_0x30a8f9[_0x1685('0x20')]=_0x27afc5;if(_0x1a7fd7[_0x1685('0x30')][_0x1685('0x41')]){_0x2625af['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x1685('0x42')](_0x2625af);})[_0x1685('0x24')](function(_0x5b09d0){_0x30a8f9[_0x1685('0x43')]=_0x5b09d0;return _0x30a8f9;})['then'](respondWithFilteredResult(_0x585a16,_0x2625af))['catch'](handleError(_0x585a16,null));};exports[_0x1685('0x44')]=function(_0x1bbeb9,_0x1f89b5){var _0x4293e1={'raw':!![],'where':{'id':_0x1bbeb9[_0x1685('0x45')]['id']}},_0x28326c={};_0x28326c[_0x1685('0x33')]=_['keys'](db[_0x1685('0x2c')][_0x1685('0x46')]);_0x28326c[_0x1685('0x30')]=_[_0x1685('0x31')](_0x1bbeb9[_0x1685('0x30')]);_0x28326c[_0x1685('0x3c')]=_[_0x1685('0x32')](_0x28326c[_0x1685('0x33')],_0x28326c[_0x1685('0x30')]);_0x4293e1[_0x1685('0x34')]=_[_0x1685('0x32')](_0x28326c[_0x1685('0x33')],qs[_0x1685('0x35')](_0x1bbeb9[_0x1685('0x30')][_0x1685('0x35')]));_0x4293e1[_0x1685('0x34')]=_0x4293e1[_0x1685('0x34')][_0x1685('0x36')]?_0x4293e1[_0x1685('0x34')]:_0x28326c[_0x1685('0x33')];if(_0x1bbeb9['query'][_0x1685('0x41')]){_0x4293e1[_0x1685('0x47')]=[{'all':!![]}];}_0x4293e1=_[_0x1685('0x3e')]({},_0x4293e1,_0x1bbeb9['options']);return db[_0x1685('0x2c')]['find'](_0x4293e1)['then'](handleEntityNotFound(_0x1f89b5,null))['then'](respondWithResult(_0x1f89b5,null))[_0x1685('0x48')](handleError(_0x1f89b5,null));};exports[_0x1685('0x49')]=function(_0x485d7b,_0xcdfa64){if(_0x485d7b[_0x1685('0x4a')]['id']){delete _0x485d7b[_0x1685('0x4a')]['id'];}return db[_0x1685('0x2c')][_0x1685('0x4b')]({'where':{'id':_0x485d7b[_0x1685('0x45')]['id']}})[_0x1685('0x24')](handleEntityNotFound(_0xcdfa64,null))['then'](saveUpdates(_0x485d7b['body'],null))[_0x1685('0x24')](respondWithResult(_0xcdfa64,null))[_0x1685('0x48')](handleError(_0xcdfa64,null));};exports[_0x1685('0x25')]=function(_0xf1c8df,_0x86f57e){return db[_0x1685('0x2c')][_0x1685('0x4b')]({'where':{'id':_0xf1c8df[_0x1685('0x45')]['id']}})[_0x1685('0x24')](handleEntityNotFound(_0x86f57e,null))[_0x1685('0x24')](removeEntity(_0x86f57e,null))['catch'](handleError(_0x86f57e,null));};exports[_0x1685('0x4c')]=function(_0x1ba734,_0x3470aa){return db[_0x1685('0x2c')][_0x1685('0x4c')]()['then'](respondWithResult(_0x3470aa,null))['catch'](handleError(_0x3470aa,null));}; \ No newline at end of file +var _0x48a5=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','save','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','length','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5255ba,_0x11a686){var _0x37f650=function(_0x3d5c53){while(--_0x3d5c53){_0x5255ba['push'](_0x5255ba['shift']());}};_0x37f650(++_0x11a686);}(_0x48a5,0xcb));var _0x548a=function(_0x24ba23,_0x29cb95){_0x24ba23=_0x24ba23-0x0;var _0x23fcb8=_0x48a5[_0x24ba23];return _0x23fcb8;};'use strict';var emlformat=require(_0x548a('0x0'));var rimraf=require(_0x548a('0x1'));var zipdir=require(_0x548a('0x2'));var jsonpatch=require(_0x548a('0x3'));var rp=require(_0x548a('0x4'));var moment=require(_0x548a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x548a('0x6'));var path=require(_0x548a('0x7'));var sox=require(_0x548a('0x8'));var csv=require('to-csv');var ejs=require(_0x548a('0x9'));var fs=require('fs');var fs_extra=require(_0x548a('0xa'));var _=require(_0x548a('0xb'));var squel=require(_0x548a('0xc'));var crypto=require(_0x548a('0xd'));var jsforce=require(_0x548a('0xe'));var deskjs=require(_0x548a('0xf'));var toCsv=require(_0x548a('0x10'));var querystring=require(_0x548a('0x11'));var Papa=require(_0x548a('0x12'));var Redis=require(_0x548a('0x13'));var authService=require(_0x548a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x548a('0x15'));var hardwareService=require(_0x548a('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x548a('0x17'));var licenseUtil=require(_0x548a('0x18'));var db=require(_0x548a('0x19'))['db'];function respondWithStatusCode(_0x53afe8,_0x1df885){_0x1df885=_0x1df885||0xcc;return function(_0x1a4e2d){if(_0x1a4e2d){return _0x53afe8['sendStatus'](_0x1df885);}return _0x53afe8[_0x548a('0x1a')](_0x1df885)[_0x548a('0x1b')]();};}function respondWithResult(_0x2f881f,_0xc9dda4){_0xc9dda4=_0xc9dda4||0xc8;return function(_0x3be8cb){if(_0x3be8cb){return _0x2f881f[_0x548a('0x1a')](_0xc9dda4)[_0x548a('0x1c')](_0x3be8cb);}};}function respondWithFilteredResult(_0x84c53e,_0x3e6ee9){return function(_0x502bfe){if(_0x502bfe){var _0xd2da34=typeof _0x3e6ee9['offset']==='undefined'&&typeof _0x3e6ee9[_0x548a('0x1d')]==='undefined';var _0x400907=_0x502bfe['count'];var _0x315bde=_0xd2da34?0x0:_0x3e6ee9['offset'];var _0x2df2b6=_0xd2da34?_0x502bfe[_0x548a('0x1e')]:_0x3e6ee9[_0x548a('0x1f')]+_0x3e6ee9[_0x548a('0x1d')];var _0x57bf71;if(_0x2df2b6>=_0x400907){_0x2df2b6=_0x400907;_0x57bf71=0xc8;}else{_0x57bf71=0xce;}_0x84c53e[_0x548a('0x1a')](_0x57bf71);return _0x84c53e[_0x548a('0x20')](_0x548a('0x21'),_0x315bde+'-'+_0x2df2b6+'/'+_0x400907)['json'](_0x502bfe);}return null;};}function patchUpdates(_0x577359){return function(_0x27ca07){try{jsonpatch['apply'](_0x27ca07,_0x577359,!![]);}catch(_0x35dfd5){return BPromise['reject'](_0x35dfd5);}return _0x27ca07[_0x548a('0x22')]();};}function saveUpdates(_0x5ab4a8,_0x95273b){return function(_0x31ba96){if(_0x31ba96){return _0x31ba96['update'](_0x5ab4a8)[_0x548a('0x23')](function(_0x5093a1){return _0x5093a1;});}return null;};}function removeEntity(_0x4061e7,_0x258a75){return function(_0x3fe1f1){if(_0x3fe1f1){return _0x3fe1f1['destroy']()[_0x548a('0x23')](function(){_0x4061e7[_0x548a('0x1a')](0xcc)[_0x548a('0x1b')]();});}};}function handleEntityNotFound(_0x4c38eb,_0x4de9fc){return function(_0x240390){if(!_0x240390){_0x4c38eb['sendStatus'](0x194);}return _0x240390;};}function handleError(_0x39a2a8,_0x5b8796){_0x5b8796=_0x5b8796||0x1f4;return function(_0x450ce3){logger[_0x548a('0x24')](_0x450ce3[_0x548a('0x25')]);if(_0x450ce3[_0x548a('0x26')]){delete _0x450ce3[_0x548a('0x26')];}_0x39a2a8[_0x548a('0x1a')](_0x5b8796)[_0x548a('0x27')](_0x450ce3);};}exports[_0x548a('0x28')]=function(_0x2834d1,_0xefe850){var _0x333fef={},_0x523dd2={},_0x5e1ee8={'count':0x0,'rows':[]};var _0x4b0fe5=_[_0x548a('0x29')](db[_0x548a('0x2a')][_0x548a('0x2b')],function(_0xdb8cb3){return{'name':_0xdb8cb3[_0x548a('0x2c')],'type':_0xdb8cb3[_0x548a('0x2d')][_0x548a('0x2e')]};});_0x523dd2[_0x548a('0x2f')]=_[_0x548a('0x29')](_0x4b0fe5,_0x548a('0x26'));_0x523dd2[_0x548a('0x30')]=_[_0x548a('0x31')](_0x2834d1[_0x548a('0x30')]);_0x523dd2[_0x548a('0x32')]=_['intersection'](_0x523dd2['model'],_0x523dd2[_0x548a('0x30')]);_0x333fef[_0x548a('0x33')]=_['intersection'](_0x523dd2[_0x548a('0x2f')],qs[_0x548a('0x34')](_0x2834d1[_0x548a('0x30')]['fields']));_0x333fef[_0x548a('0x33')]=_0x333fef[_0x548a('0x33')]['length']?_0x333fef[_0x548a('0x33')]:_0x523dd2['model'];if(!_0x2834d1[_0x548a('0x30')][_0x548a('0x35')](_0x548a('0x36'))){_0x333fef['limit']=qs[_0x548a('0x1d')](_0x2834d1[_0x548a('0x30')]['limit']);_0x333fef['offset']=qs['offset'](_0x2834d1[_0x548a('0x30')][_0x548a('0x1f')]);}_0x333fef[_0x548a('0x37')]=qs[_0x548a('0x38')](_0x2834d1[_0x548a('0x30')][_0x548a('0x38')]);_0x333fef[_0x548a('0x39')]=qs[_0x548a('0x32')](_['pick'](_0x2834d1[_0x548a('0x30')],_0x523dd2[_0x548a('0x32')]),_0x4b0fe5);if(_0x2834d1[_0x548a('0x30')][_0x548a('0x3a')]){_0x333fef[_0x548a('0x39')]=_[_0x548a('0x3b')](_0x333fef[_0x548a('0x39')],{'$or':_[_0x548a('0x29')](_0x4b0fe5,function(_0x127453){if(_0x127453['type']!==_0x548a('0x3c')){var _0x321bb1={};_0x321bb1[_0x127453[_0x548a('0x26')]]={'$like':'%'+_0x2834d1['query'][_0x548a('0x3a')]+'%'};return _0x321bb1;}})});}_0x333fef=_[_0x548a('0x3b')]({},_0x333fef,_0x2834d1[_0x548a('0x3d')]);var _0x42fda5={'where':_0x333fef[_0x548a('0x39')]};return db['CmHopperBlack'][_0x548a('0x1e')](_0x42fda5)[_0x548a('0x23')](function(_0xd2e98f){_0x5e1ee8['count']=_0xd2e98f;if(_0x2834d1[_0x548a('0x30')][_0x548a('0x3e')]){_0x333fef[_0x548a('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x333fef);})[_0x548a('0x23')](function(_0x29a046){_0x5e1ee8[_0x548a('0x40')]=_0x29a046;return _0x5e1ee8;})[_0x548a('0x23')](respondWithFilteredResult(_0xefe850,_0x333fef))[_0x548a('0x41')](handleError(_0xefe850,null));};exports['show']=function(_0x5c29e9,_0x1c6404){var _0x38c243={'raw':!![],'where':{'id':_0x5c29e9[_0x548a('0x42')]['id']}},_0x58b260={};_0x58b260['model']=_[_0x548a('0x31')](db[_0x548a('0x2a')][_0x548a('0x2b')]);_0x58b260['query']=_[_0x548a('0x31')](_0x5c29e9['query']);_0x58b260[_0x548a('0x32')]=_[_0x548a('0x43')](_0x58b260[_0x548a('0x2f')],_0x58b260[_0x548a('0x30')]);_0x38c243[_0x548a('0x33')]=_[_0x548a('0x43')](_0x58b260[_0x548a('0x2f')],qs['fields'](_0x5c29e9[_0x548a('0x30')][_0x548a('0x34')]));_0x38c243['attributes']=_0x38c243[_0x548a('0x33')][_0x548a('0x44')]?_0x38c243[_0x548a('0x33')]:_0x58b260[_0x548a('0x2f')];if(_0x5c29e9['query']['includeAll']){_0x38c243['include']=[{'all':!![]}];}_0x38c243=_[_0x548a('0x3b')]({},_0x38c243,_0x5c29e9[_0x548a('0x3d')]);return db[_0x548a('0x2a')]['find'](_0x38c243)[_0x548a('0x23')](handleEntityNotFound(_0x1c6404,null))[_0x548a('0x23')](respondWithResult(_0x1c6404,null))[_0x548a('0x41')](handleError(_0x1c6404,null));};exports['update']=function(_0x179aa2,_0x39baf){if(_0x179aa2[_0x548a('0x45')]['id']){delete _0x179aa2[_0x548a('0x45')]['id'];}return db[_0x548a('0x2a')][_0x548a('0x46')]({'where':{'id':_0x179aa2[_0x548a('0x42')]['id']}})[_0x548a('0x23')](handleEntityNotFound(_0x39baf,null))[_0x548a('0x23')](saveUpdates(_0x179aa2[_0x548a('0x45')],null))[_0x548a('0x23')](respondWithResult(_0x39baf,null))[_0x548a('0x41')](handleError(_0x39baf,null));};exports[_0x548a('0x47')]=function(_0x435e53,_0x5572b3){return db[_0x548a('0x2a')]['find']({'where':{'id':_0x435e53[_0x548a('0x42')]['id']}})[_0x548a('0x23')](handleEntityNotFound(_0x5572b3,null))[_0x548a('0x23')](removeEntity(_0x5572b3,null))[_0x548a('0x41')](handleError(_0x5572b3,null));};exports[_0x548a('0x48')]=function(_0x333115,_0x5862a6){return db[_0x548a('0x2a')][_0x548a('0x48')]()[_0x548a('0x23')](respondWithResult(_0x5862a6,null))['catch'](handleError(_0x5862a6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4ba7f42..d29080c 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 _0xdd58=['cm_hopper_black','lodash','util','../../config/logger','api','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define'];(function(_0x45903d,_0x382ee6){var _0x298cea=function(_0x311ac3){while(--_0x311ac3){_0x45903d['push'](_0x45903d['shift']());}};_0x298cea(++_0x382ee6);}(_0xdd58,0xfe));var _0x8dd5=function(_0x10cf5d,_0x396a02){_0x10cf5d=_0x10cf5d-0x0;var _0x5b9d4b=_0xdd58[_0x10cf5d];return _0x5b9d4b;};'use strict';var _=require(_0x8dd5('0x0'));var util=require(_0x8dd5('0x1'));var logger=require(_0x8dd5('0x2'))(_0x8dd5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8dd5('0x4'));var fs=require('fs');var path=require(_0x8dd5('0x5'));var rimraf=require(_0x8dd5('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dd5('0x7'));module[_0x8dd5('0x8')]=function(_0x4f63f6,_0x1ff388){return _0x4f63f6[_0x8dd5('0x9')]('CmHopperBlack',attributes,{'tableName':_0x8dd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e61=['path','../../config/environment','exports','define','CmHopperBlack','../../config/logger','api','moment','request-promise'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0x5e61,0x1d9));var _0x15e6=function(_0x52efc7,_0x5ae099){_0x52efc7=_0x52efc7-0x0;var _0x23c956=_0x5e61[_0x52efc7];return _0x23c956;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x15e6('0x0'))(_0x15e6('0x1'));var moment=require(_0x15e6('0x2'));var BPromise=require('bluebird');var rp=require(_0x15e6('0x3'));var fs=require('fs');var path=require(_0x15e6('0x4'));var rimraf=require('rimraf');var config=require(_0x15e6('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0x15e6('0x6')]=function(_0x497fbc,_0x3d23cd){return _0x497fbc[_0x15e6('0x7')](_0x15e6('0x8'),attributes,{'tableName':'cm_hopper_black','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 8a08a4b..c0c4570 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 _0x6aef=['attributes','stringify','UpdateCmHopperBlack','body','raw','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','include','map','model'];(function(_0x5d08e4,_0x1c1ba6){var _0x1c7d40=function(_0x378004){while(--_0x378004){_0x5d08e4['push'](_0x5d08e4['shift']());}};_0x1c7d40(++_0x1c1ba6);}(_0x6aef,0x1c0));var _0xf6ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ae('0x0'));var util=require(_0xf6ae('0x1'));var moment=require(_0xf6ae('0x2'));var BPromise=require(_0xf6ae('0x3'));var rs=require(_0xf6ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6ae('0x5'))['db'];var utils=require(_0xf6ae('0x6'));var logger=require(_0xf6ae('0x7'))(_0xf6ae('0x8'));var config=require(_0xf6ae('0x9'));var jayson=require(_0xf6ae('0xa'));var client=jayson[_0xf6ae('0xb')][_0xf6ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21a337,_0x3e292c,_0x3f54a1){return new BPromise(function(_0x38039b,_0x2c8215){return client['request'](_0x21a337,_0x3f54a1)[_0xf6ae('0xd')](function(_0x18f31a){logger[_0xf6ae('0xe')](_0xf6ae('0xf'),_0x3e292c,_0xf6ae('0x10'));logger[_0xf6ae('0x11')](_0xf6ae('0x12'),_0x3e292c,_0xf6ae('0x10'),JSON['stringify'](_0x18f31a));if(_0x18f31a['error']){if(_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x14')]===0x1f4){logger[_0xf6ae('0x13')](_0xf6ae('0xf'),_0x3e292c,_0x18f31a['error'][_0xf6ae('0x15')]);return _0x2c8215(_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x15')]);}logger[_0xf6ae('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x3e292c,_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x15')]);return _0x38039b(_0x18f31a['error'][_0xf6ae('0x15')]);}else{logger['info'](_0xf6ae('0xf'),_0x3e292c,_0xf6ae('0x10'));_0x38039b(_0x18f31a[_0xf6ae('0x16')][_0xf6ae('0x15')]);}})[_0xf6ae('0x17')](function(_0x1583ea){logger['error'](_0xf6ae('0xf'),_0x3e292c,_0x1583ea);_0x2c8215(_0x1583ea);});});}exports[_0xf6ae('0x18')]=function(_0x316f3c){var _0x2300ea=this;return new Promise(function(_0x50e19d,_0x24e7bb){return db[_0xf6ae('0x19')][_0xf6ae('0x1a')]({'raw':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x316f3c['options']?_0x316f3c[_0xf6ae('0x1b')][_0xf6ae('0x1c')]||null:null,'attributes':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['attributes']||null:null,'limit':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['limit']||null:null,'include':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')][_0xf6ae('0x1d')]?_[_0xf6ae('0x1e')](_0x316f3c[_0xf6ae('0x1b')]['include'],function(_0x50c1b2){return{'model':db[_0x50c1b2[_0xf6ae('0x1f')]],'as':_0x50c1b2['as'],'attributes':_0x50c1b2[_0xf6ae('0x20')],'include':_0x50c1b2[_0xf6ae('0x1d')]?_['map'](_0x50c1b2[_0xf6ae('0x1d')],function(_0x20974e){return{'model':db[_0x20974e[_0xf6ae('0x1f')]],'as':_0x20974e['as'],'attributes':_0x20974e[_0xf6ae('0x20')],'include':_0x20974e['include']?_[_0xf6ae('0x1e')](_0x20974e[_0xf6ae('0x1d')],function(_0x172964){return{'model':db[_0x172964[_0xf6ae('0x1f')]],'as':_0x172964['as'],'attributes':_0x172964[_0xf6ae('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x431b22){logger[_0xf6ae('0xe')](_0xf6ae('0x18'),_0x316f3c);logger[_0xf6ae('0x11')](_0xf6ae('0x18'),_0x316f3c,JSON[_0xf6ae('0x21')](_0x431b22));_0x50e19d(_0x431b22);})['catch'](function(_0x380f5b){logger['error'](_0xf6ae('0x18'),_0x380f5b[_0xf6ae('0x15')],_0x316f3c);_0x24e7bb(_0x2300ea['error'](0x1f4,_0x380f5b['message']));});});};exports[_0xf6ae('0x22')]=function(_0x3c376d){var _0x451e43=this;return new Promise(function(_0xad46c4,_0x3d17ba){return db['CmHopperBlack']['update'](_0x3c376d[_0xf6ae('0x23')],{'raw':_0x3c376d['options']?_0x3c376d[_0xf6ae('0x1b')][_0xf6ae('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c376d[_0xf6ae('0x1b')]?_0x3c376d['options'][_0xf6ae('0x1c')]||null:null,'attributes':_0x3c376d['options']?_0x3c376d['options'][_0xf6ae('0x20')]||null:null,'limit':_0x3c376d['options']?_0x3c376d['options'][_0xf6ae('0x25')]||null:null})[_0xf6ae('0xd')](function(_0x41f1d3){logger['info']('UpdateCmHopperBlack',_0x3c376d);logger['debug'](_0xf6ae('0x22'),_0x3c376d,JSON[_0xf6ae('0x21')](_0x41f1d3));_0xad46c4(_0x41f1d3);})['catch'](function(_0x37d744){logger[_0xf6ae('0x13')](_0xf6ae('0x22'),_0x37d744[_0xf6ae('0x15')],_0x3c376d);_0x3d17ba(_0x451e43[_0xf6ae('0x13')](0x1f4,_0x37d744[_0xf6ae('0x15')]));});});};exports[_0xf6ae('0x26')]=function(_0x372d42){var _0x2424bc=this;return new Promise(function(_0x5efc3c,_0xce85d2){return db[_0xf6ae('0x19')][_0xf6ae('0x27')]({'where':_0x372d42['options']?_0x372d42[_0xf6ae('0x1b')]['where']||null:null})[_0xf6ae('0xd')](function(_0x137791){logger[_0xf6ae('0xe')](_0xf6ae('0x26'),_0x372d42);logger[_0xf6ae('0x11')](_0xf6ae('0x26'),_0x372d42,JSON['stringify'](_0x137791));_0x5efc3c(_0x137791);})[_0xf6ae('0x17')](function(_0x32cd84){logger[_0xf6ae('0x13')]('DestroyCmHopperBlack',_0x32cd84[_0xf6ae('0x15')],_0x372d42);_0xce85d2(_0x2424bc[_0xf6ae('0x13')](0x1f4,_0x32cd84[_0xf6ae('0x15')]));});});}; \ No newline at end of file +var _0x8a88=['options','raw','attributes','limit','include','map','model','update','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','CmHopperBlack','findAll'];(function(_0xc2fa88,_0x44149f){var _0x16df5f=function(_0x8c5e26){while(--_0x8c5e26){_0xc2fa88['push'](_0xc2fa88['shift']());}};_0x16df5f(++_0x44149f);}(_0x8a88,0xeb));var _0x88a8=function(_0x40e60f,_0x5365e1){_0x40e60f=_0x40e60f-0x0;var _0x35511f=_0x8a88[_0x40e60f];return _0x35511f;};'use strict';var _=require(_0x88a8('0x0'));var util=require(_0x88a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x88a8('0x2'));var fs=require('fs');var Redis=require(_0x88a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x88a8('0x4'));var logger=require(_0x88a8('0x5'))('rpc');var config=require(_0x88a8('0x6'));var jayson=require(_0x88a8('0x7'));var client=jayson[_0x88a8('0x8')][_0x88a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43447b,_0x4ae02e,_0x305b38){return new BPromise(function(_0x787b1a,_0x57c5f1){return client[_0x88a8('0xa')](_0x43447b,_0x305b38)[_0x88a8('0xb')](function(_0x54b5df){logger[_0x88a8('0xc')](_0x88a8('0xd'),_0x4ae02e,'request\x20sent');logger[_0x88a8('0xe')](_0x88a8('0xf'),_0x4ae02e,_0x88a8('0x10'),JSON[_0x88a8('0x11')](_0x54b5df));if(_0x54b5df['error']){if(_0x54b5df['error'][_0x88a8('0x12')]===0x1f4){logger['error'](_0x88a8('0xd'),_0x4ae02e,_0x54b5df[_0x88a8('0x13')][_0x88a8('0x14')]);return _0x57c5f1(_0x54b5df[_0x88a8('0x13')][_0x88a8('0x14')]);}logger[_0x88a8('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4ae02e,_0x54b5df[_0x88a8('0x13')][_0x88a8('0x14')]);return _0x787b1a(_0x54b5df[_0x88a8('0x13')][_0x88a8('0x14')]);}else{logger[_0x88a8('0xc')](_0x88a8('0xd'),_0x4ae02e,_0x88a8('0x10'));_0x787b1a(_0x54b5df['result']['message']);}})[_0x88a8('0x15')](function(_0x4f3b4b){logger[_0x88a8('0x13')](_0x88a8('0xd'),_0x4ae02e,_0x4f3b4b);_0x57c5f1(_0x4f3b4b);});});}exports['GetCmHopperBlack']=function(_0x220abd){var _0x52efa7=this;return new Promise(function(_0x3a3efa,_0x1f9770){return db[_0x88a8('0x16')][_0x88a8('0x17')]({'raw':_0x220abd[_0x88a8('0x18')]?_0x220abd[_0x88a8('0x18')][_0x88a8('0x19')]===undefined?!![]:![]:!![],'where':_0x220abd[_0x88a8('0x18')]?_0x220abd[_0x88a8('0x18')]['where']||null:null,'attributes':_0x220abd['options']?_0x220abd[_0x88a8('0x18')][_0x88a8('0x1a')]||null:null,'limit':_0x220abd[_0x88a8('0x18')]?_0x220abd[_0x88a8('0x18')][_0x88a8('0x1b')]||null:null,'include':_0x220abd[_0x88a8('0x18')]?_0x220abd['options'][_0x88a8('0x1c')]?_[_0x88a8('0x1d')](_0x220abd['options'][_0x88a8('0x1c')],function(_0xf9ece1){return{'model':db[_0xf9ece1[_0x88a8('0x1e')]],'as':_0xf9ece1['as'],'attributes':_0xf9ece1[_0x88a8('0x1a')],'include':_0xf9ece1[_0x88a8('0x1c')]?_[_0x88a8('0x1d')](_0xf9ece1['include'],function(_0x95150b){return{'model':db[_0x95150b[_0x88a8('0x1e')]],'as':_0x95150b['as'],'attributes':_0x95150b['attributes'],'include':_0x95150b[_0x88a8('0x1c')]?_['map'](_0x95150b['include'],function(_0x59f450){return{'model':db[_0x59f450[_0x88a8('0x1e')]],'as':_0x59f450['as'],'attributes':_0x59f450['attributes']};}):[]};}):[]};}):[]:[]})[_0x88a8('0xb')](function(_0x465920){logger[_0x88a8('0xc')]('GetCmHopperBlack',_0x220abd);logger['debug']('GetCmHopperBlack',_0x220abd,JSON[_0x88a8('0x11')](_0x465920));_0x3a3efa(_0x465920);})[_0x88a8('0x15')](function(_0x1e9cf7){logger[_0x88a8('0x13')]('GetCmHopperBlack',_0x1e9cf7['message'],_0x220abd);_0x1f9770(_0x52efa7['error'](0x1f4,_0x1e9cf7[_0x88a8('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x4f0779){var _0x2d87f2=this;return new Promise(function(_0x3a9f62,_0x5224fd){return db['CmHopperBlack'][_0x88a8('0x1f')](_0x4f0779[_0x88a8('0x20')],{'raw':_0x4f0779[_0x88a8('0x18')]?_0x4f0779[_0x88a8('0x18')][_0x88a8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0779[_0x88a8('0x18')]?_0x4f0779['options'][_0x88a8('0x21')]||null:null,'attributes':_0x4f0779[_0x88a8('0x18')]?_0x4f0779[_0x88a8('0x18')][_0x88a8('0x1a')]||null:null,'limit':_0x4f0779[_0x88a8('0x18')]?_0x4f0779[_0x88a8('0x18')][_0x88a8('0x1b')]||null:null})['then'](function(_0x55c3d5){logger[_0x88a8('0xc')](_0x88a8('0x22'),_0x4f0779);logger[_0x88a8('0xe')](_0x88a8('0x22'),_0x4f0779,JSON[_0x88a8('0x11')](_0x55c3d5));_0x3a9f62(_0x55c3d5);})[_0x88a8('0x15')](function(_0x57670f){logger[_0x88a8('0x13')](_0x88a8('0x22'),_0x57670f[_0x88a8('0x14')],_0x4f0779);_0x5224fd(_0x2d87f2['error'](0x1f4,_0x57670f[_0x88a8('0x14')]));});});};exports[_0x88a8('0x23')]=function(_0x4b74bb){var _0x42f6c6=this;return new Promise(function(_0x5d7702,_0x1aa7e1){return db[_0x88a8('0x16')][_0x88a8('0x24')]({'where':_0x4b74bb[_0x88a8('0x18')]?_0x4b74bb[_0x88a8('0x18')]['where']||null:null})[_0x88a8('0xb')](function(_0x157374){logger[_0x88a8('0xc')](_0x88a8('0x23'),_0x4b74bb);logger[_0x88a8('0xe')](_0x88a8('0x23'),_0x4b74bb,JSON[_0x88a8('0x11')](_0x157374));_0x5d7702(_0x157374);})['catch'](function(_0x2bc78a){logger[_0x88a8('0x13')](_0x88a8('0x23'),_0x2bc78a[_0x88a8('0x14')],_0x4b74bb);_0x1aa7e1(_0x42f6c6[_0x88a8('0x13')](0x1f4,_0x2bc78a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 571e669..cd58847 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 _0x1261=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','/:id','put','delete','destroy'];(function(_0x230bac,_0x542cfe){var _0x5148be=function(_0x1e6ed5){while(--_0x1e6ed5){_0x230bac['push'](_0x230bac['shift']());}};_0x5148be(++_0x542cfe);}(_0x1261,0x144));var _0x1126=function(_0x442ede,_0x2c3376){_0x442ede=_0x442ede-0x0;var _0x3b7c68=_0x1261[_0x442ede];return _0x3b7c68;};'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')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['update']);router[_0x1126('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0x11')]);module['exports']=router; \ No newline at end of file +var _0x326f=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x326f,0xd1));var _0xf326=function(_0xc9ecb6,_0xf19494){_0xc9ecb6=_0xc9ecb6-0x0;var _0x204c52=_0x326f[_0xc9ecb6];return _0x204c52;};'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('0xe')](_0xf326('0xf'),auth[_0xf326('0xa')](),controller[_0xf326('0x10')]);router['delete'](_0xf326('0xf'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);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 f704131..9bbcc76 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 _0xbc80=['followuptime','diff','seconds','BOOLEAN','sequelize','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xbc80,0xae));var _0x0bc8=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xbc80[_0x580b15];return _0x1adb1b;};'use strict';var Sequelize=require(_0x0bc8('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x0bc8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0bc8('0x2')]},'scheduledat':{'type':Sequelize[_0x0bc8('0x3')]},'countbusyretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0bc8('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0bc8('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0bc8('0x2')]},'calleridnum':{'type':Sequelize[_0x0bc8('0x2')]},'calleridname':{'type':Sequelize[_0x0bc8('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0bc8('0x3')]},'answertime':{'type':Sequelize[_0x0bc8('0x3')]},'droptime':{'type':Sequelize[_0x0bc8('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0bc8('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0bc8('0x2')]},'membername':{'type':Sequelize[_0x0bc8('0x2')]},'reason':{'type':Sequelize[_0x0bc8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0bc8('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x0bc8('0x3')],'set':function(_0x3f6b78){var _0x4a66b2=this[_0x0bc8('0x4')]('endtime');if(_0x4a66b2&&_0x3f6b78){this[_0x0bc8('0x5')](_0x0bc8('0x6'),moment(_0x3f6b78)[_0x0bc8('0x7')](moment(_0x4a66b2),_0x0bc8('0x8')));}}},'amd':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0bc8('0x3')]},'callback':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0bc8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x0bc8('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0bc8('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0bc8('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5e8c=['INTEGER','DATE','STRING','endtime','diff','seconds','BOOLEAN','moment','exports'];(function(_0x45911d,_0x25b782){var _0x387de2=function(_0x148819){while(--_0x148819){_0x45911d['push'](_0x45911d['shift']());}};_0x387de2(++_0x25b782);}(_0x5e8c,0xfa));var _0xc5e8=function(_0x1ab155,_0x3b918e){_0x1ab155=_0x1ab155-0x0;var _0x350ef9=_0x5e8c[_0x1ab155];return _0x350ef9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc5e8('0x0'));module[_0xc5e8('0x1')]={'state':{'type':Sequelize[_0xc5e8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xc5e8('0x3')]},'countbusyretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc5e8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xc5e8('0x4')]},'originatecalleridname':{'type':Sequelize[_0xc5e8('0x4')]},'calleridnum':{'type':Sequelize[_0xc5e8('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc5e8('0x3')]},'responsetime':{'type':Sequelize[_0xc5e8('0x3')]},'answertime':{'type':Sequelize[_0xc5e8('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc5e8('0x3')]},'ringtime':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc5e8('0x4')]},'campaign':{'type':Sequelize[_0xc5e8('0x4')]},'campaigntype':{'type':Sequelize[_0xc5e8('0x4')]},'membername':{'type':Sequelize[_0xc5e8('0x4')]},'reason':{'type':Sequelize[_0xc5e8('0x4')]},'disposition':{'type':Sequelize[_0xc5e8('0x4')]},'secondDisposition':{'type':Sequelize[_0xc5e8('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc5e8('0x4')]},'dispositionat':{'type':Sequelize[_0xc5e8('0x3')],'set':function(_0x51c882){var _0x51054c=this['getDataValue'](_0xc5e8('0x5'));if(_0x51054c&&_0x51c882){this['setDataValue']('followuptime',moment(_0x51c882)[_0xc5e8('0x6')](moment(_0x51054c),_0xc5e8('0x7')));}}},'amd':{'type':Sequelize[_0xc5e8('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc5e8('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc5e8('0x3')]},'callback':{'type':Sequelize[_0xc5e8('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc5e8('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc5e8('0x3')]},'deleted':{'type':Sequelize[_0xc5e8('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc5e8('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc5e8('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 48fa30c..9b00e5d 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 _0x57ca=['state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','toString','group','moveContactsIvrCampaignHopperFinal','scheduledAt','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','from','state\x20=\x204','checkContactHopper','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','CmHopperFinal','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x1bec15,_0x501038){var _0x5cec2b=function(_0x39f11d){while(--_0x39f11d){_0x1bec15['push'](_0x1bec15['shift']());}};_0x5cec2b(++_0x501038);}(_0x57ca,0x108));var _0xa57c=function(_0xa015cf,_0x14c10c){_0xa015cf=_0xa015cf-0x0;var _0x4f9ee9=_0x57ca[_0xa015cf];return _0x4f9ee9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')]()['then'](respondWithResult(_0x44ea0a,null))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x5082ef,_0x232675){if(_0x5082ef['body'][_0xa57c('0x42')]){delete _0x5082ef[_0xa57c('0x43')]['uniqueid'];}return db[_0xa57c('0x2a')][_0xa57c('0x3f')]({'where':{'uniqueid':_0x5082ef[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x232675,null))[_0xa57c('0x21')](saveUpdates(_0x5082ef['body'],null))[_0xa57c('0x21')](respondWithResult(_0x232675,null))[_0xa57c('0x40')](handleError(_0x232675,null));};exports[_0xa57c('0x44')]=function(_0xd57bac,_0x2e4b84,_0x5ace6d){return db[_0xa57c('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0xd57bac['params']['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize']['literal'](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4a')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x4b')))),_0xa57c('0x4c')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),_0xa57c('0x4f')],[db['sequelize']['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db['sequelize']['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0x2e4b84,null))['then'](respondWithResult(_0x2e4b84,null))[_0xa57c('0x40')](handleError(_0x2e4b84,null));};exports[_0xa57c('0x56')]=function(_0x1899ad,_0xb19d93,_0x2adcf6){return db[_0xa57c('0x2a')][_0xa57c('0x3d')]({'raw':![],'where':{'CampaignId':_0x1899ad[_0xa57c('0x3e')]['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0xa57c('0x57')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4b')))),'busyContacts'],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),'dropContacts'],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0xb19d93,null))['then'](respondWithResult(_0xb19d93,null))[_0xa57c('0x40')](handleError(_0xb19d93,null));};exports[_0xa57c('0x58')]=function(_0x1be631,_0x47e3d5,_0x571e10){return db[_0xa57c('0x59')][_0xa57c('0x3f')]({'where':{'id':_0x1be631[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x47e3d5,null))[_0xa57c('0x21')](function(_0x39411b){var _0x2a7aab;if(_0x39411b){_0x2a7aab=squel[_0xa57c('0x5a')]()[_0xa57c('0x5b')]('cm_hopper')[_0xa57c('0x5c')]([_0xa57c('0x5d'),'scheduledAt',_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x60'),_0xa57c('0x61'),_0xa57c('0x62')],squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x65'),'phone')[_0xa57c('0x64')](_0xa57c('0x66'),'scheduledAt')[_0xa57c('0x64')](_0xa57c('0x67'),'ContactId')['field'](_0xa57c('0x68'),_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x69'),_0xa57c('0x60'))['field'](_0xa57c('0x66'),_0xa57c('0x61'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x62'))['from'](_0xa57c('0x6a'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1be631[_0xa57c('0x43')][_0xa57c('0x6d')]['toString']())[_0xa57c('0x37')](_0xa57c('0x6e'))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x5d'))['from'](_0xa57c('0x6f'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']()))[_0xa57c('0x37')](_0xa57c('0x70'),squel['select']()[_0xa57c('0x64')](_0xa57c('0x71'))['from'](_0xa57c('0x6a'))['where'](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id'][_0xa57c('0x72')]())[_0xa57c('0x37')]('state\x20=\x204'))[_0xa57c('0x73')](_0xa57c('0x5e')))[_0xa57c('0x72')]();return db[_0xa57c('0x45')][_0xa57c('0x2e')](_0x2a7aab);}return[];})[_0xa57c('0x21')](respondWithResult(_0x47e3d5,null))[_0xa57c('0x40')](handleError(_0x47e3d5,null));};exports[_0xa57c('0x74')]=function(_0x1129f,_0x2c4e6c,_0x46dbb1){return db['Campaign']['find']({'where':{'id':_0x1129f['params']['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x2c4e6c,null))['then'](function(_0x43c430){var _0x442dc7;if(_0x43c430){_0x442dc7=squel[_0xa57c('0x5a')]()['into'](_0xa57c('0x6f'))[_0xa57c('0x5c')]([_0xa57c('0x5d'),_0xa57c('0x75'),_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x76'),'createdAt',_0xa57c('0x62')],squel[_0xa57c('0x63')]()['field']('ANY_VALUE(calleridnum)',_0xa57c('0x5d'))[_0xa57c('0x64')]('NOW()','scheduledAt')[_0xa57c('0x64')]('ANY_VALUE(ContactId)',_0xa57c('0x5e'))[_0xa57c('0x64')]('ANY_VALUE(ListId)',_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x77'),_0xa57c('0x76'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x61'))['field'](_0xa57c('0x66'),_0xa57c('0x62'))['from']('cm_hopper_final')['where'](_0xa57c('0x78'),_0x1129f['params']['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1129f[_0xa57c('0x43')]['state'][_0xa57c('0x72')]())[_0xa57c('0x37')](_0xa57c('0x6e'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()['field'](_0xa57c('0x5d'))[_0xa57c('0x79')]('cm_hopper')[_0xa57c('0x37')]('CampaignId\x20=\x20?',_0x1129f['params']['id']['toString']()))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xa57c('0x71'))[_0xa57c('0x79')]('cm_hopper_final')[_0xa57c('0x37')](_0xa57c('0x78'),_0x1129f[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x7a')))[_0xa57c('0x73')](_0xa57c('0x5e')))['toString']();return db['sequelize'][_0xa57c('0x2e')](_0x442dc7);}return[];})['then'](respondWithResult(_0x2c4e6c,null))[_0xa57c('0x40')](handleError(_0x2c4e6c,null));};exports[_0xa57c('0x7b')]=function(_0x2cc12b,_0x4dc6ac,_0x138c4e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x2cc12b[_0xa57c('0x43')]['VoiceQueueId'],'CampaignId':_0x2cc12b[_0xa57c('0x43')][_0xa57c('0x76')],'ContactId':_0x2cc12b['body']['ContactId']}})[_0xa57c('0x21')](handleEntityNotFound(_0x4dc6ac,null))[_0xa57c('0x21')](function(_0x50a940){if(_0x50a940){return _0x50a940;}return null;})['then'](respondWithResult(_0x4dc6ac,null))[_0xa57c('0x40')](handleError(_0x4dc6ac,null));}; \ No newline at end of file +var _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x58389d,_0x3137df){var _0x2be20a=function(_0x2b6f46){while(--_0x2b6f46){_0x58389d['push'](_0x58389d['shift']());}};_0x2be20a(++_0x3137df);}(_0x5d58,0x187));var _0x85d5=function(_0x10e69e,_0x615ec9){_0x10e69e=_0x10e69e-0x0;var _0x3a6754=_0x5d58[_0x10e69e];return _0x3a6754;};'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('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index da940fe..9accc98 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 _0x47b2=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x47b2,0x111));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x247b('0x0'));var util=require(_0x247b('0x1'));var logger=require(_0x247b('0x2'))(_0x247b('0x3'));var moment=require(_0x247b('0x4'));var BPromise=require(_0x247b('0x5'));var rp=require(_0x247b('0x6'));var fs=require('fs');var path=require(_0x247b('0x7'));var rimraf=require(_0x247b('0x8'));var config=require(_0x247b('0x9'));var attributes=require(_0x247b('0xa'));module[_0x247b('0xb')]=function(_0x85ba64,_0x219a89){return _0x85ba64['define'](_0x247b('0xc'),attributes,{'tableName':_0x247b('0xd'),'paranoid':![],'indexes':[{'name':_0x247b('0xe'),'fields':[_0x247b('0xe')]},{'name':_0x247b('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b40=['util','../../config/logger','api','moment','request-promise','path','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x1b40,0x1ed));var _0x01b4=function(_0x18032f,_0x4f4e45){_0x18032f=_0x18032f-0x0;var _0xb0b2b8=_0x1b40[_0x18032f];return _0xb0b2b8;};'use strict';var _=require(_0x01b4('0x0'));var util=require(_0x01b4('0x1'));var logger=require(_0x01b4('0x2'))(_0x01b4('0x3'));var moment=require(_0x01b4('0x4'));var BPromise=require('bluebird');var rp=require(_0x01b4('0x5'));var fs=require('fs');var path=require(_0x01b4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x01b4('0x7'));module['exports']=function(_0xd37052,_0x250ca6){return _0xd37052[_0x01b4('0x8')](_0x01b4('0x9'),attributes,{'tableName':_0x01b4('0xa'),'paranoid':![],'indexes':[{'name':_0x01b4('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x01b4('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 9c8925f..247176d 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1ec9ef,_0x496bc2){var _0x3ce85c=function(_0x2985d4){while(--_0x2985d4){_0x1ec9ef['push'](_0x1ec9ef['shift']());}};_0x3ce85c(++_0x496bc2);}(_0x7a54,0x106));var _0x47a5=function(_0x5442b3,_0x9b8660){_0x5442b3=_0x5442b3-0x0;var _0x568fd1=_0x7a54[_0x5442b3];return _0x568fd1;};'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')]('CmHopperFinal,\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['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x110ddb,_0xcb03e9){var _0x170861=function(_0x2f6327){while(--_0x2f6327){_0x110ddb['push'](_0x110ddb['shift']());}};_0x170861(++_0xcb03e9);}(_0x7a54,0x106));var _0x47a5=function(_0x387785,_0x4e5b73){_0x387785=_0x387785-0x0;var _0xace407=_0x7a54[_0x387785];return _0xace407;};'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')]('CmHopperFinal,\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['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4037644..698d8eb 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 _0x2420=['./cmHopperFinal.controller','index','get','/describe','isAuthenticated','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5a2141,_0x10f036){var _0x577f88=function(_0xc7f5b3){while(--_0xc7f5b3){_0x5a2141['push'](_0x5a2141['shift']());}};_0x577f88(++_0x10f036);}(_0x2420,0xfd));var _0x0242=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x2420[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x0242('0x0'));var util=require(_0x0242('0x1'));var path=require(_0x0242('0x2'));var timeout=require(_0x0242('0x3'));var express=require('express');var router=express[_0x0242('0x4')]();var fs_extra=require(_0x0242('0x5'));var auth=require(_0x0242('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0242('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0242('0x8')]);router[_0x0242('0x9')](_0x0242('0xa'),auth[_0x0242('0xb')](),controller[_0x0242('0xc')]);router[_0x0242('0x9')](_0x0242('0xd'),auth[_0x0242('0xb')](),controller['show']);router[_0x0242('0x9')]('/voice/queue/countAttributes/:id',auth[_0x0242('0xb')](),controller[_0x0242('0xe')]);router[_0x0242('0x9')](_0x0242('0xf'),auth[_0x0242('0xb')](),controller[_0x0242('0x10')]);router[_0x0242('0x11')](_0x0242('0x12'),auth[_0x0242('0xb')](),controller[_0x0242('0x13')]);router[_0x0242('0x11')](_0x0242('0x14'),auth[_0x0242('0xb')](),controller[_0x0242('0x15')]);router[_0x0242('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x0242('0x16')]);router[_0x0242('0x17')](_0x0242('0xd'),auth[_0x0242('0xb')](),controller[_0x0242('0x18')]);module[_0x0242('0x19')]=router; \ No newline at end of file +var _0x7bd5=['path','Router','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','util'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x7bd5,0x72));var _0x57bd=function(_0x7014dc,_0x53d244){_0x7014dc=_0x7014dc-0x0;var _0x42d253=_0x7bd5[_0x7014dc];return _0x42d253;};'use strict';var multer=require('multer');var util=require(_0x57bd('0x0'));var path=require(_0x57bd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x57bd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x57bd('0x3'));var controller=require(_0x57bd('0x4'));router[_0x57bd('0x5')]('/',auth[_0x57bd('0x6')](),controller[_0x57bd('0x7')]);router[_0x57bd('0x5')](_0x57bd('0x8'),auth[_0x57bd('0x6')](),controller['describe']);router[_0x57bd('0x5')](_0x57bd('0x9'),auth[_0x57bd('0x6')](),controller[_0x57bd('0xa')]);router[_0x57bd('0x5')](_0x57bd('0xb'),auth[_0x57bd('0x6')](),controller[_0x57bd('0xc')]);router[_0x57bd('0x5')](_0x57bd('0xd'),auth[_0x57bd('0x6')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x57bd('0xe')](_0x57bd('0xf'),auth['isAuthenticated'](),controller[_0x57bd('0x10')]);router[_0x57bd('0xe')](_0x57bd('0x11'),auth[_0x57bd('0x6')](),controller[_0x57bd('0x12')]);router[_0x57bd('0xe')]('/checkContactHopper',auth[_0x57bd('0x6')](),controller[_0x57bd('0x13')]);router[_0x57bd('0x14')](_0x57bd('0x9'),auth[_0x57bd('0x6')](),controller[_0x57bd('0x15')]);module[_0x57bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index da7af50..ba58cfe 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 _0x8da0=['DATE','STRING','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8da0,0x135));var _0x08da=function(_0x2fde0d,_0x562ca3){_0x2fde0d=_0x2fde0d-0x0;var _0x48d470=_0x8da0[_0x2fde0d];return _0x48d470;};'use strict';var Sequelize=require(_0x08da('0x0'));module[_0x08da('0x1')]={'state':{'type':Sequelize[_0x08da('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x08da('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x08da('0x4')]},'calleridnum':{'type':Sequelize[_0x08da('0x4')]},'calleridname':{'type':Sequelize[_0x08da('0x4')]},'starttime':{'type':Sequelize[_0x08da('0x3')]},'responsetime':{'type':Sequelize[_0x08da('0x3')]},'answertime':{'type':Sequelize[_0x08da('0x3')]},'droptime':{'type':Sequelize[_0x08da('0x3')]},'endtime':{'type':Sequelize[_0x08da('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x08da('0x4')]},'campaign':{'type':Sequelize[_0x08da('0x4')]},'campaigntype':{'type':Sequelize[_0x08da('0x4')]},'membername':{'type':Sequelize[_0x08da('0x4')]},'reason':{'type':Sequelize[_0x08da('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x08da('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x08da('0x3')]},'recallme':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x08da('0x3')]},'edited':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5921=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x241fe1,_0x1a041f){var _0x4b3a3d=function(_0x1698be){while(--_0x1698be){_0x241fe1['push'](_0x241fe1['shift']());}};_0x4b3a3d(++_0x1a041f);}(_0x5921,0x16e));var _0x1592=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x5921[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x1592('0x0'));module[_0x1592('0x1')]={'state':{'type':Sequelize[_0x1592('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1592('0x3')]},'countbusyretry':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1592('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1592('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1592('0x4')]},'calleridname':{'type':Sequelize[_0x1592('0x4')]},'starttime':{'type':Sequelize[_0x1592('0x3')]},'responsetime':{'type':Sequelize[_0x1592('0x3')]},'answertime':{'type':Sequelize[_0x1592('0x3')]},'droptime':{'type':Sequelize[_0x1592('0x3')]},'endtime':{'type':Sequelize[_0x1592('0x3')]},'ringtime':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1592('0x4')]},'campaign':{'type':Sequelize[_0x1592('0x4')]},'campaigntype':{'type':Sequelize[_0x1592('0x4')]},'membername':{'type':Sequelize[_0x1592('0x4')]},'reason':{'type':Sequelize[_0x1592('0x4')]},'amd':{'type':Sequelize[_0x1592('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1592('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1592('0x3')]},'recallme':{'type':Sequelize[_0x1592('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1592('0x3')]},'edited':{'type':Sequelize[_0x1592('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1592('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1592('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3ad941a..413c27a 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 _0xcaac=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','include','rows','show','params','includeAll','options','catch','create','body','describe','find','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','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','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection'];(function(_0x3235ad,_0x32d674){var _0x4d64d4=function(_0x3a62fc){while(--_0x3a62fc){_0x3235ad['push'](_0x3235ad['shift']());}};_0x4d64d4(++_0x32d674);}(_0xcaac,0xae));var _0xccaa=function(_0x410764,_0x12442e){_0x410764=_0x410764-0x0;var _0x145342=_0xcaac[_0x410764];return _0x145342;};'use strict';var emlformat=require(_0xccaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccaa('0x1'));var jsonpatch=require(_0xccaa('0x2'));var rp=require(_0xccaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xccaa('0x4'));var util=require('util');var path=require(_0xccaa('0x5'));var sox=require(_0xccaa('0x6'));var csv=require(_0xccaa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccaa('0x8'));var crypto=require('crypto');var jsforce=require(_0xccaa('0x9'));var deskjs=require(_0xccaa('0xa'));var toCsv=require(_0xccaa('0x7'));var querystring=require('querystring');var Papa=require(_0xccaa('0xb'));var Redis=require(_0xccaa('0xc'));var authService=require(_0xccaa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xccaa('0xe'));var hardwareService=require(_0xccaa('0xf'));var logger=require(_0xccaa('0x10'))(_0xccaa('0x11'));var utils=require(_0xccaa('0x12'));var config=require(_0xccaa('0x13'));var licenseUtil=require(_0xccaa('0x14'));var db=require(_0xccaa('0x15'))['db'];function respondWithStatusCode(_0x8e8ffb,_0x3d5341){_0x3d5341=_0x3d5341||0xcc;return function(_0x3e2171){if(_0x3e2171){return _0x8e8ffb[_0xccaa('0x16')](_0x3d5341);}return _0x8e8ffb[_0xccaa('0x17')](_0x3d5341)[_0xccaa('0x18')]();};}function respondWithResult(_0x58ff45,_0x1b1db4){_0x1b1db4=_0x1b1db4||0xc8;return function(_0x15392d){if(_0x15392d){return _0x58ff45['status'](_0x1b1db4)[_0xccaa('0x19')](_0x15392d);}};}function respondWithFilteredResult(_0x17e62d,_0x3a9292){return function(_0x247faa){if(_0x247faa){var _0x46e6ca=typeof _0x3a9292[_0xccaa('0x1a')]===_0xccaa('0x1b')&&typeof _0x3a9292[_0xccaa('0x1c')]===_0xccaa('0x1b');var _0x2a7bf0=_0x247faa[_0xccaa('0x1d')];var _0x3cfc35=_0x46e6ca?0x0:_0x3a9292[_0xccaa('0x1a')];var _0x1980a6=_0x46e6ca?_0x247faa['count']:_0x3a9292[_0xccaa('0x1a')]+_0x3a9292[_0xccaa('0x1c')];var _0x219a3e;if(_0x1980a6>=_0x2a7bf0){_0x1980a6=_0x2a7bf0;_0x219a3e=0xc8;}else{_0x219a3e=0xce;}_0x17e62d['status'](_0x219a3e);return _0x17e62d['set'](_0xccaa('0x1e'),_0x3cfc35+'-'+_0x1980a6+'/'+_0x2a7bf0)[_0xccaa('0x19')](_0x247faa);}return null;};}function patchUpdates(_0x2165a0){return function(_0x19d27b){try{jsonpatch[_0xccaa('0x1f')](_0x19d27b,_0x2165a0,!![]);}catch(_0x10f400){return BPromise['reject'](_0x10f400);}return _0x19d27b[_0xccaa('0x20')]();};}function saveUpdates(_0xc76944,_0x354ebb){return function(_0x2a0c8a){if(_0x2a0c8a){return _0x2a0c8a[_0xccaa('0x21')](_0xc76944)[_0xccaa('0x22')](function(_0x385802){return _0x385802;});}return null;};}function removeEntity(_0x237c99,_0x44644){return function(_0x2bd1cb){if(_0x2bd1cb){return _0x2bd1cb[_0xccaa('0x23')]()['then'](function(){_0x237c99[_0xccaa('0x17')](0xcc)[_0xccaa('0x18')]();});}};}function handleEntityNotFound(_0x27824b,_0x1be091){return function(_0x586da7){if(!_0x586da7){_0x27824b['sendStatus'](0x194);}return _0x586da7;};}function handleError(_0x172409,_0x9733fd){_0x9733fd=_0x9733fd||0x1f4;return function(_0x16e05e){logger[_0xccaa('0x24')](_0x16e05e[_0xccaa('0x25')]);if(_0x16e05e[_0xccaa('0x26')]){delete _0x16e05e[_0xccaa('0x26')];}_0x172409[_0xccaa('0x17')](_0x9733fd)[_0xccaa('0x27')](_0x16e05e);};}exports[_0xccaa('0x28')]=function(_0x2c0b32,_0x58b03a){var _0x44f019={},_0x6fef3d={},_0x12af35={'count':0x0,'rows':[]};var _0x7ac198=_[_0xccaa('0x29')](db[_0xccaa('0x2a')][_0xccaa('0x2b')],function(_0x4d6764){return{'name':_0x4d6764[_0xccaa('0x2c')],'type':_0x4d6764[_0xccaa('0x2d')][_0xccaa('0x2e')]};});_0x6fef3d[_0xccaa('0x2f')]=_[_0xccaa('0x29')](_0x7ac198,_0xccaa('0x26'));_0x6fef3d['query']=_[_0xccaa('0x30')](_0x2c0b32[_0xccaa('0x31')]);_0x6fef3d['filters']=_[_0xccaa('0x32')](_0x6fef3d[_0xccaa('0x2f')],_0x6fef3d[_0xccaa('0x31')]);_0x44f019[_0xccaa('0x33')]=_['intersection'](_0x6fef3d['model'],qs[_0xccaa('0x34')](_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x34')]));_0x44f019[_0xccaa('0x33')]=_0x44f019[_0xccaa('0x33')][_0xccaa('0x35')]?_0x44f019[_0xccaa('0x33')]:_0x6fef3d['model'];if(!_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x36')](_0xccaa('0x37'))){_0x44f019[_0xccaa('0x1c')]=qs['limit'](_0x2c0b32[_0xccaa('0x31')]['limit']);_0x44f019[_0xccaa('0x1a')]=qs['offset'](_0x2c0b32['query'][_0xccaa('0x1a')]);}_0x44f019[_0xccaa('0x38')]=qs[_0xccaa('0x39')](_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x39')]);_0x44f019['where']=qs[_0xccaa('0x3a')](_[_0xccaa('0x3b')](_0x2c0b32[_0xccaa('0x31')],_0x6fef3d['filters']),_0x7ac198);if(_0x2c0b32['query'][_0xccaa('0x3c')]){_0x44f019['where']=_[_0xccaa('0x3d')](_0x44f019[_0xccaa('0x3e')],{'$or':_[_0xccaa('0x29')](_0x7ac198,function(_0x512830){if(_0x512830[_0xccaa('0x2d')]!==_0xccaa('0x3f')){var _0x5b79fe={};_0x5b79fe[_0x512830[_0xccaa('0x26')]]={'$like':'%'+_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x3c')]+'%'};return _0x5b79fe;}})});}_0x44f019=_['merge']({},_0x44f019,_0x2c0b32['options']);var _0x4331f4={'where':_0x44f019[_0xccaa('0x3e')]};return db[_0xccaa('0x2a')]['count'](_0x4331f4)[_0xccaa('0x22')](function(_0x257473){_0x12af35[_0xccaa('0x1d')]=_0x257473;if(_0x2c0b32[_0xccaa('0x31')]['includeAll']){_0x44f019[_0xccaa('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x44f019);})['then'](function(_0x1db5db){_0x12af35[_0xccaa('0x41')]=_0x1db5db;return _0x12af35;})[_0xccaa('0x22')](respondWithFilteredResult(_0x58b03a,_0x44f019))['catch'](handleError(_0x58b03a,null));};exports[_0xccaa('0x42')]=function(_0x5c283b,_0x5bc543){var _0xb2f0ea={'raw':!![],'where':{'id':_0x5c283b[_0xccaa('0x43')]['id']}},_0x424a3f={};_0x424a3f[_0xccaa('0x2f')]=_[_0xccaa('0x30')](db[_0xccaa('0x2a')][_0xccaa('0x2b')]);_0x424a3f[_0xccaa('0x31')]=_[_0xccaa('0x30')](_0x5c283b[_0xccaa('0x31')]);_0x424a3f[_0xccaa('0x3a')]=_[_0xccaa('0x32')](_0x424a3f[_0xccaa('0x2f')],_0x424a3f[_0xccaa('0x31')]);_0xb2f0ea[_0xccaa('0x33')]=_[_0xccaa('0x32')](_0x424a3f[_0xccaa('0x2f')],qs[_0xccaa('0x34')](_0x5c283b['query'][_0xccaa('0x34')]));_0xb2f0ea['attributes']=_0xb2f0ea['attributes']['length']?_0xb2f0ea[_0xccaa('0x33')]:_0x424a3f['model'];if(_0x5c283b[_0xccaa('0x31')][_0xccaa('0x44')]){_0xb2f0ea[_0xccaa('0x40')]=[{'all':!![]}];}_0xb2f0ea=_[_0xccaa('0x3d')]({},_0xb2f0ea,_0x5c283b[_0xccaa('0x45')]);return db['CmHopperHistory']['find'](_0xb2f0ea)[_0xccaa('0x22')](handleEntityNotFound(_0x5bc543,null))['then'](respondWithResult(_0x5bc543,null))[_0xccaa('0x46')](handleError(_0x5bc543,null));};exports[_0xccaa('0x47')]=function(_0x537734,_0x2046c1){return db[_0xccaa('0x2a')]['create'](_0x537734[_0xccaa('0x48')],{})[_0xccaa('0x22')](respondWithResult(_0x2046c1,0xc9))[_0xccaa('0x46')](handleError(_0x2046c1,null));};exports[_0xccaa('0x49')]=function(_0x37e137,_0x297d74){return db[_0xccaa('0x2a')][_0xccaa('0x49')]()['then'](respondWithResult(_0x297d74,null))[_0xccaa('0x46')](handleError(_0x297d74,null));};exports[_0xccaa('0x21')]=function(_0xc00dc2,_0xcc43db){if(_0xc00dc2[_0xccaa('0x48')]['uniqueid']){delete _0xc00dc2['body']['uniqueid'];}return db[_0xccaa('0x2a')][_0xccaa('0x4a')]({'where':{'uniqueid':_0xc00dc2[_0xccaa('0x43')]['id']}})[_0xccaa('0x22')](handleEntityNotFound(_0xcc43db,null))['then'](saveUpdates(_0xc00dc2['body'],null))[_0xccaa('0x22')](respondWithResult(_0xcc43db,null))['catch'](handleError(_0xcc43db,null));}; \ No newline at end of file +var _0x4262=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4262,0x138));var _0x2426=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4262[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x2426('0x0'));var rimraf=require(_0x2426('0x1'));var zipdir=require(_0x2426('0x2'));var jsonpatch=require(_0x2426('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2426('0x4'));var Mustache=require('mustache');var util=require(_0x2426('0x5'));var path=require('path');var sox=require(_0x2426('0x6'));var csv=require('to-csv');var ejs=require(_0x2426('0x7'));var fs=require('fs');var fs_extra=require(_0x2426('0x8'));var _=require(_0x2426('0x9'));var squel=require(_0x2426('0xa'));var crypto=require(_0x2426('0xb'));var jsforce=require(_0x2426('0xc'));var deskjs=require(_0x2426('0xd'));var toCsv=require(_0x2426('0xe'));var querystring=require(_0x2426('0xf'));var Papa=require('papaparse');var Redis=require(_0x2426('0x10'));var authService=require(_0x2426('0x11'));var qs=require(_0x2426('0x12'));var as=require(_0x2426('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2426('0x14'))(_0x2426('0x15'));var utils=require('../../config/utils');var config=require(_0x2426('0x16'));var licenseUtil=require(_0x2426('0x17'));var db=require(_0x2426('0x18'))['db'];function respondWithStatusCode(_0x309a5d,_0x1c551f){_0x1c551f=_0x1c551f||0xcc;return function(_0x38f1c9){if(_0x38f1c9){return _0x309a5d[_0x2426('0x19')](_0x1c551f);}return _0x309a5d[_0x2426('0x1a')](_0x1c551f)['end']();};}function respondWithResult(_0x203ef1,_0x484cf2){_0x484cf2=_0x484cf2||0xc8;return function(_0x2311b5){if(_0x2311b5){return _0x203ef1[_0x2426('0x1a')](_0x484cf2)[_0x2426('0x1b')](_0x2311b5);}};}function respondWithFilteredResult(_0x4628df,_0x6a2c30){return function(_0x5d5bb7){if(_0x5d5bb7){var _0x5264e3=typeof _0x6a2c30['offset']===_0x2426('0x1c')&&typeof _0x6a2c30['limit']===_0x2426('0x1c');var _0x3aa0e5=_0x5d5bb7[_0x2426('0x1d')];var _0x5617e6=_0x5264e3?0x0:_0x6a2c30[_0x2426('0x1e')];var _0x40a47b=_0x5264e3?_0x5d5bb7[_0x2426('0x1d')]:_0x6a2c30[_0x2426('0x1e')]+_0x6a2c30[_0x2426('0x1f')];var _0x4aecb7;if(_0x40a47b>=_0x3aa0e5){_0x40a47b=_0x3aa0e5;_0x4aecb7=0xc8;}else{_0x4aecb7=0xce;}_0x4628df[_0x2426('0x1a')](_0x4aecb7);return _0x4628df[_0x2426('0x20')](_0x2426('0x21'),_0x5617e6+'-'+_0x40a47b+'/'+_0x3aa0e5)[_0x2426('0x1b')](_0x5d5bb7);}return null;};}function patchUpdates(_0x40ee81){return function(_0x4b402c){try{jsonpatch[_0x2426('0x22')](_0x4b402c,_0x40ee81,!![]);}catch(_0x5257a7){return BPromise[_0x2426('0x23')](_0x5257a7);}return _0x4b402c[_0x2426('0x24')]();};}function saveUpdates(_0x2b4c13,_0x301786){return function(_0x1deabb){if(_0x1deabb){return _0x1deabb[_0x2426('0x25')](_0x2b4c13)[_0x2426('0x26')](function(_0x352807){return _0x352807;});}return null;};}function removeEntity(_0x58b81d,_0x2df007){return function(_0x57b952){if(_0x57b952){return _0x57b952[_0x2426('0x27')]()['then'](function(){_0x58b81d['status'](0xcc)[_0x2426('0x28')]();});}};}function handleEntityNotFound(_0x395378,_0x217f8b){return function(_0x3fc5c6){if(!_0x3fc5c6){_0x395378[_0x2426('0x19')](0x194);}return _0x3fc5c6;};}function handleError(_0x32c477,_0x1ff9e6){_0x1ff9e6=_0x1ff9e6||0x1f4;return function(_0x22f4be){logger[_0x2426('0x29')](_0x22f4be[_0x2426('0x2a')]);if(_0x22f4be[_0x2426('0x2b')]){delete _0x22f4be['name'];}_0x32c477[_0x2426('0x1a')](_0x1ff9e6)[_0x2426('0x2c')](_0x22f4be);};}exports[_0x2426('0x2d')]=function(_0x6388d4,_0x1ec182){var _0x518d50={},_0x539b97={},_0x138893={'count':0x0,'rows':[]};var _0x7c56ef=_[_0x2426('0x2e')](db[_0x2426('0x2f')][_0x2426('0x30')],function(_0x454b7f){return{'name':_0x454b7f[_0x2426('0x31')],'type':_0x454b7f[_0x2426('0x32')][_0x2426('0x33')]};});_0x539b97['model']=_['map'](_0x7c56ef,_0x2426('0x2b'));_0x539b97[_0x2426('0x34')]=_[_0x2426('0x35')](_0x6388d4['query']);_0x539b97[_0x2426('0x36')]=_[_0x2426('0x37')](_0x539b97[_0x2426('0x38')],_0x539b97[_0x2426('0x34')]);_0x518d50['attributes']=_[_0x2426('0x37')](_0x539b97[_0x2426('0x38')],qs[_0x2426('0x39')](_0x6388d4[_0x2426('0x34')][_0x2426('0x39')]));_0x518d50[_0x2426('0x3a')]=_0x518d50[_0x2426('0x3a')][_0x2426('0x3b')]?_0x518d50['attributes']:_0x539b97[_0x2426('0x38')];if(!_0x6388d4[_0x2426('0x34')][_0x2426('0x3c')]('nolimit')){_0x518d50['limit']=qs[_0x2426('0x1f')](_0x6388d4[_0x2426('0x34')][_0x2426('0x1f')]);_0x518d50[_0x2426('0x1e')]=qs['offset'](_0x6388d4[_0x2426('0x34')][_0x2426('0x1e')]);}_0x518d50[_0x2426('0x3d')]=qs[_0x2426('0x3e')](_0x6388d4[_0x2426('0x34')]['sort']);_0x518d50[_0x2426('0x3f')]=qs[_0x2426('0x36')](_[_0x2426('0x40')](_0x6388d4[_0x2426('0x34')],_0x539b97[_0x2426('0x36')]),_0x7c56ef);if(_0x6388d4[_0x2426('0x34')][_0x2426('0x41')]){_0x518d50['where']=_[_0x2426('0x42')](_0x518d50['where'],{'$or':_['map'](_0x7c56ef,function(_0x180f73){if(_0x180f73[_0x2426('0x32')]!==_0x2426('0x43')){var _0x3ef70c={};_0x3ef70c[_0x180f73[_0x2426('0x2b')]]={'$like':'%'+_0x6388d4[_0x2426('0x34')][_0x2426('0x41')]+'%'};return _0x3ef70c;}})});}_0x518d50=_[_0x2426('0x42')]({},_0x518d50,_0x6388d4['options']);var _0x31a7af={'where':_0x518d50[_0x2426('0x3f')]};return db['CmHopperHistory'][_0x2426('0x1d')](_0x31a7af)[_0x2426('0x26')](function(_0x33c8bc){_0x138893[_0x2426('0x1d')]=_0x33c8bc;if(_0x6388d4[_0x2426('0x34')][_0x2426('0x44')]){_0x518d50['include']=[{'all':!![]}];}return db[_0x2426('0x2f')][_0x2426('0x45')](_0x518d50);})[_0x2426('0x26')](function(_0x4e84e3){_0x138893['rows']=_0x4e84e3;return _0x138893;})[_0x2426('0x26')](respondWithFilteredResult(_0x1ec182,_0x518d50))[_0x2426('0x46')](handleError(_0x1ec182,null));};exports[_0x2426('0x47')]=function(_0x1b7769,_0x4a7a38){var _0x43e840={'raw':!![],'where':{'id':_0x1b7769[_0x2426('0x48')]['id']}},_0xc87cad={};_0xc87cad['model']=_[_0x2426('0x35')](db[_0x2426('0x2f')]['rawAttributes']);_0xc87cad[_0x2426('0x34')]=_['keys'](_0x1b7769[_0x2426('0x34')]);_0xc87cad[_0x2426('0x36')]=_['intersection'](_0xc87cad[_0x2426('0x38')],_0xc87cad['query']);_0x43e840['attributes']=_[_0x2426('0x37')](_0xc87cad[_0x2426('0x38')],qs[_0x2426('0x39')](_0x1b7769[_0x2426('0x34')][_0x2426('0x39')]));_0x43e840[_0x2426('0x3a')]=_0x43e840['attributes']['length']?_0x43e840[_0x2426('0x3a')]:_0xc87cad[_0x2426('0x38')];if(_0x1b7769[_0x2426('0x34')][_0x2426('0x44')]){_0x43e840[_0x2426('0x49')]=[{'all':!![]}];}_0x43e840=_[_0x2426('0x42')]({},_0x43e840,_0x1b7769[_0x2426('0x4a')]);return db[_0x2426('0x2f')][_0x2426('0x4b')](_0x43e840)[_0x2426('0x26')](handleEntityNotFound(_0x4a7a38,null))[_0x2426('0x26')](respondWithResult(_0x4a7a38,null))[_0x2426('0x46')](handleError(_0x4a7a38,null));};exports['create']=function(_0x3ae80f,_0x4683ea){return db['CmHopperHistory'][_0x2426('0x4c')](_0x3ae80f[_0x2426('0x4d')],{})[_0x2426('0x26')](respondWithResult(_0x4683ea,0xc9))['catch'](handleError(_0x4683ea,null));};exports[_0x2426('0x4e')]=function(_0x4e415d,_0x290ea4){return db['CmHopperHistory'][_0x2426('0x4e')]()[_0x2426('0x26')](respondWithResult(_0x290ea4,null))[_0x2426('0x46')](handleError(_0x290ea4,null));};exports[_0x2426('0x25')]=function(_0x451577,_0x2a59ec){if(_0x451577[_0x2426('0x4d')]['uniqueid']){delete _0x451577[_0x2426('0x4d')][_0x2426('0x4f')];}return db[_0x2426('0x2f')][_0x2426('0x4b')]({'where':{'uniqueid':_0x451577[_0x2426('0x48')]['id']}})[_0x2426('0x26')](handleEntityNotFound(_0x2a59ec,null))['then'](saveUpdates(_0x451577[_0x2426('0x4d')],null))[_0x2426('0x26')](respondWithResult(_0x2a59ec,null))[_0x2426('0x46')](handleError(_0x2a59ec,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 60d150d..22924c0 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 _0x5ed9=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x5341bb,_0x91e184){var _0x4d043c=function(_0x34891b){while(--_0x34891b){_0x5341bb['push'](_0x5341bb['shift']());}};_0x4d043c(++_0x91e184);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ed9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var logger=require('../../config/logger')(_0x95ed('0x2'));var moment=require(_0x95ed('0x3'));var BPromise=require(_0x95ed('0x4'));var rp=require(_0x95ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95ed('0x6'));var config=require(_0x95ed('0x7'));var attributes=require(_0x95ed('0x8'));module['exports']=function(_0x2c9009,_0x5a5117){return _0x2c9009[_0x95ed('0x9')](_0x95ed('0xa'),attributes,{'tableName':_0x95ed('0xb'),'paranoid':![],'indexes':[{'name':_0x95ed('0xc'),'fields':[_0x95ed('0xc')]},{'name':_0x95ed('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0424=['define','CmHopperHistory','cm_hopper_history','uniqueid','../../config/logger','api','moment','bluebird','path','./cmHopperHistory.attributes','exports'];(function(_0x2bb612,_0xaedf28){var _0x4ef64c=function(_0x45bcff){while(--_0x45bcff){_0x2bb612['push'](_0x2bb612['shift']());}};_0x4ef64c(++_0xaedf28);}(_0x0424,0x159));var _0x4042=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x0424[_0x44b7d6];return _0x5346f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x4042('0xa'),'fields':[_0x4042('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 051804d..34d964b 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 _0x79d3=['outboundReCallsDay','GetVoiceQueueHopperHistory','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x2f13cb,_0x475f96){var _0x571b65=function(_0xb65af3){while(--_0xb65af3){_0x2f13cb['push'](_0x2f13cb['shift']());}};_0x571b65(++_0x475f96);}(_0x79d3,0x179));var _0x379d=function(_0x1320fe,_0x5dae3a){_0x1320fe=_0x1320fe-0x0;var _0xe9340a=_0x79d3[_0x1320fe];return _0xe9340a;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x379d('0x6'));var logger=require(_0x379d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x379d('0x8'));var client=jayson[_0x379d('0x9')][_0x379d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214194,_0x2bf985,_0x4f32c7){return new BPromise(function(_0x226765,_0x1fb281){return client[_0x379d('0xb')](_0x214194,_0x4f32c7)['then'](function(_0x59c547){logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,'request\x20sent');logger[_0x379d('0xe')](_0x379d('0xf'),_0x2bf985,_0x379d('0x10'),JSON[_0x379d('0x11')](_0x59c547));if(_0x59c547['error']){if(_0x59c547[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0xd'),_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x1fb281(_0x59c547['error'][_0x379d('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x226765(_0x59c547[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,_0x379d('0x10'));_0x226765(_0x59c547[_0x379d('0x15')][_0x379d('0x14')]);}})[_0x379d('0x16')](function(_0x18f0fb){logger[_0x379d('0x12')](_0x379d('0xd'),_0x2bf985,_0x18f0fb);_0x1fb281(_0x18f0fb);});});}exports[_0x379d('0x17')]=function(_0x58653d){var _0x4c2add=this;return new Promise(function(_0x37f319,_0xf18983){return db[_0x379d('0x18')][_0x379d('0x19')](_0x58653d[_0x379d('0x1a')],{'raw':_0x58653d[_0x379d('0x1b')]?_0x58653d['options'][_0x379d('0x1c')]===undefined?!![]:![]:!![]})[_0x379d('0x1d')](function(_0x34f791){logger[_0x379d('0xc')](_0x379d('0x17'),_0x58653d);logger[_0x379d('0xe')](_0x379d('0x17'),_0x58653d,JSON[_0x379d('0x11')](_0x34f791));_0x37f319(_0x34f791);})[_0x379d('0x16')](function(_0x139d23){logger[_0x379d('0x12')](_0x379d('0x17'),_0x139d23[_0x379d('0x14')],_0x58653d);_0xf18983(_0x4c2add[_0x379d('0x12')](0x1f4,_0x139d23[_0x379d('0x14')]));});});};exports[_0x379d('0x1e')]=function(_0x26e2b3){var _0x1471c8=this;return new Promise(function(_0x15c29c,_0x4a082b){return db[_0x379d('0x18')]['findAll']({'raw':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x24')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x25')))),_0x379d('0x26')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x27')))),_0x379d('0x28')],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2b')))),_0x379d('0x2c')]]})[_0x379d('0x1d')](function(_0xd6bb2d){logger['info'](_0x379d('0x1e'),_0x26e2b3);logger['debug'](_0x379d('0x1e'),_0x26e2b3,JSON[_0x379d('0x11')](_0xd6bb2d));_0x15c29c(_0xd6bb2d);})[_0x379d('0x16')](function(_0x4cc85a){logger['error'](_0x379d('0x1e'),_0x4cc85a[_0x379d('0x14')],_0x26e2b3);_0x4a082b(_0x1471c8['error'](0x1f4,_0x4cc85a[_0x379d('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4f44d7){var _0x5455e3=this;return new Promise(function(_0x408740,_0x459dce){return db[_0x379d('0x18')][_0x379d('0x2d')]({'raw':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7['options'][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),'name'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2f')))),_0x379d('0x30')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')]['literal'](_0x379d('0x31')))),_0x379d('0x32')],[db['sequelize']['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x33')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x34')))),_0x379d('0x35')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x37')))),_0x379d('0x38')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x39')))),_0x379d('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x3b')))),_0x379d('0x3c')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3d')))),_0x379d('0x3e')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3f')))),'outboundRejectCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x379d('0x41')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x42')))),_0x379d('0x43')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x4fb8fe){logger['info'](_0x379d('0x44'),_0x4f44d7);logger[_0x379d('0xe')](_0x379d('0x44'),_0x4f44d7,JSON[_0x379d('0x11')](_0x4fb8fe));_0x408740(_0x4fb8fe);})['catch'](function(_0x58da4e){logger[_0x379d('0x12')](_0x379d('0x44'),_0x58da4e[_0x379d('0x14')],_0x4f44d7);_0x459dce(_0x5455e3[_0x379d('0x12')](0x1f4,_0x58da4e[_0x379d('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x1fdb72){var _0x11a6c8=this;return new Promise(function(_0x2d07f1,_0x2120e1){return db['CmHopperHistory']['findAll']({'raw':_0x1fdb72['options']?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fdb72[_0x379d('0x1b')]?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),_0x379d('0x45')],[db['sequelize']['fn'](_0x379d('0x21'),db[_0x379d('0x20')][_0x379d('0x46')]('id')),_0x379d('0x47')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x48')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x5bef33){logger[_0x379d('0xc')]('GetCampaignHopperHistory',_0x1fdb72);logger['debug'](_0x379d('0x49'),_0x1fdb72,JSON['stringify'](_0x5bef33));_0x2d07f1(_0x5bef33);})['catch'](function(_0x57587a){logger[_0x379d('0x12')](_0x379d('0x49'),_0x57587a['message'],_0x1fdb72);_0x2120e1(_0x11a6c8[_0x379d('0x12')](0x1f4,_0x57587a[_0x379d('0x14')]));});});}; \ No newline at end of file +var _0x418f=['outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','stringify','findAll','raw','where','COUNT','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null'];(function(_0x38d6a3,_0x43990e){var _0x48237d=function(_0x21a5b7){while(--_0x21a5b7){_0x38d6a3['push'](_0x38d6a3['shift']());}};_0x48237d(++_0x43990e);}(_0x418f,0xdf));var _0xf418=function(_0x2d2a9b,_0x5870ff){_0x2d2a9b=_0x2d2a9b-0x0;var _0x3d2d49=_0x418f[_0x2d2a9b];return _0x3d2d49;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var moment=require(_0xf418('0x2'));var BPromise=require(_0xf418('0x3'));var rs=require(_0xf418('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf418('0x5'))['db'];var utils=require(_0xf418('0x6'));var logger=require(_0xf418('0x7'))(_0xf418('0x8'));var config=require('../../config/environment');var jayson=require(_0xf418('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x599239,_0x504f3f,_0x17ca7c){return new BPromise(function(_0x402b3f,_0x31c594){return client[_0xf418('0xa')](_0x599239,_0x17ca7c)[_0xf418('0xb')](function(_0x523254){logger[_0xf418('0xc')](_0xf418('0xd'),_0x504f3f,_0xf418('0xe'));logger[_0xf418('0xf')](_0xf418('0x10'),_0x504f3f,_0xf418('0xe'),JSON['stringify'](_0x523254));if(_0x523254[_0xf418('0x11')]){if(_0x523254[_0xf418('0x11')]['code']===0x1f4){logger[_0xf418('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x504f3f,_0x523254[_0xf418('0x11')]['message']);return _0x31c594(_0x523254['error'][_0xf418('0x12')]);}logger[_0xf418('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x504f3f,_0x523254[_0xf418('0x11')][_0xf418('0x12')]);return _0x402b3f(_0x523254[_0xf418('0x11')][_0xf418('0x12')]);}else{logger[_0xf418('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x504f3f,_0xf418('0xe'));_0x402b3f(_0x523254[_0xf418('0x13')]['message']);}})[_0xf418('0x14')](function(_0x1d50f3){logger[_0xf418('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x504f3f,_0x1d50f3);_0x31c594(_0x1d50f3);});});}exports[_0xf418('0x15')]=function(_0x257abe){var _0x2fc993=this;return new Promise(function(_0x3a63e4,_0xecf533){return db[_0xf418('0x16')][_0xf418('0x17')](_0x257abe['body'],{'raw':_0x257abe[_0xf418('0x18')]?_0x257abe[_0xf418('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf418('0xb')](function(_0xb7c2ee){logger[_0xf418('0xc')](_0xf418('0x15'),_0x257abe);logger['debug']('CreateCmHopperHistory',_0x257abe,JSON[_0xf418('0x19')](_0xb7c2ee));_0x3a63e4(_0xb7c2ee);})['catch'](function(_0x450993){logger[_0xf418('0x11')]('CreateCmHopperHistory',_0x450993[_0xf418('0x12')],_0x257abe);_0xecf533(_0x2fc993[_0xf418('0x11')](0x1f4,_0x450993['message']));});});};exports['AvgHandleTime']=function(_0x318347){var _0x434a95=this;return new Promise(function(_0x37053c,_0x2dbcae){return db['CmHopperHistory'][_0xf418('0x1a')]({'raw':_0x318347[_0xf418('0x18')]?_0x318347['options'][_0xf418('0x1b')]===undefined?!![]:![]:!![],'where':_0x318347[_0xf418('0x18')]?_0x318347['options'][_0xf418('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf418('0x1d'),db['sequelize']['col']('id')),_0xf418('0x1e')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x21')))),_0xf418('0x22')],[db['sequelize']['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0xf418('0x23')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xf418('0x20')](_0xf418('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xf418('0x25'),db[_0xf418('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xf418('0x26')))),_0xf418('0x27')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x25'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x28')))),_0xf418('0x29')]]})[_0xf418('0xb')](function(_0x25e6d9){logger['info']('AvgHandleTime',_0x318347);logger[_0xf418('0xf')](_0xf418('0x2a'),_0x318347,JSON[_0xf418('0x19')](_0x25e6d9));_0x37053c(_0x25e6d9);})[_0xf418('0x14')](function(_0x196ed0){logger[_0xf418('0x11')](_0xf418('0x2a'),_0x196ed0['message'],_0x318347);_0x2dbcae(_0x434a95[_0xf418('0x11')](0x1f4,_0x196ed0[_0xf418('0x12')]));});});};exports[_0xf418('0x2b')]=function(_0x21f6bf){var _0x28edf2=this;return new Promise(function(_0x2ae7e5,_0x4bb120){return db['CmHopperHistory']['findAll']({'raw':_0x21f6bf[_0xf418('0x18')]?_0x21f6bf[_0xf418('0x18')][_0xf418('0x1b')]===undefined?!![]:![]:!![],'where':_0x21f6bf[_0xf418('0x18')]?_0x21f6bf[_0xf418('0x18')][_0xf418('0x1c')]||null:null,'attributes':[[_0xf418('0x2c'),'name'],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x2d')))),_0xf418('0x2e')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x21')))),_0xf418('0x2f')],[db[_0xf418('0x1f')]['fn']('COUNT',db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x30')))),_0xf418('0x31')],[db[_0xf418('0x1f')]['fn']('COUNT',db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')]['literal'](_0xf418('0x32')))),_0xf418('0x33')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x34')))),_0xf418('0x35')],[db['sequelize']['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf418('0x36')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0xf418('0x37')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')]['literal'](_0xf418('0x38')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')]['literal'](_0xf418('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')]['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x3a')))),_0xf418('0x3b')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')]['literal'](_0xf418('0x3c')))),_0xf418('0x3d')],[db['sequelize']['fn'](_0xf418('0x1d'),db['sequelize']['fn']('IF',db[_0xf418('0x1f')][_0xf418('0x20')](_0xf418('0x3e')))),'outboundReCallsDay']],'group':[_0xf418('0x2c')]})[_0xf418('0xb')](function(_0x4087c5){logger[_0xf418('0xc')](_0xf418('0x2b'),_0x21f6bf);logger[_0xf418('0xf')](_0xf418('0x2b'),_0x21f6bf,JSON[_0xf418('0x19')](_0x4087c5));_0x2ae7e5(_0x4087c5);})[_0xf418('0x14')](function(_0x10c540){logger[_0xf418('0x11')](_0xf418('0x2b'),_0x10c540[_0xf418('0x12')],_0x21f6bf);_0x4bb120(_0x28edf2[_0xf418('0x11')](0x1f4,_0x10c540[_0xf418('0x12')]));});});};exports[_0xf418('0x3f')]=function(_0xc7e64e){var _0x2ee4b3=this;return new Promise(function(_0x129074,_0x583505){return db[_0xf418('0x16')]['findAll']({'raw':_0xc7e64e[_0xf418('0x18')]?_0xc7e64e[_0xf418('0x18')][_0xf418('0x1b')]===undefined?!![]:![]:!![],'where':_0xc7e64e[_0xf418('0x18')]?_0xc7e64e[_0xf418('0x18')][_0xf418('0x1c')]||null:null,'attributes':[['campaign',_0xf418('0x40')],[db[_0xf418('0x1f')]['fn'](_0xf418('0x1d'),db[_0xf418('0x1f')][_0xf418('0x41')]('id')),_0xf418('0x42')],[db[_0xf418('0x1f')]['fn']('COUNT',db[_0xf418('0x1f')]['fn']('IF',db['sequelize'][_0xf418('0x20')](_0xf418('0x21')))),_0xf418('0x43')]],'group':[_0xf418('0x2c')]})[_0xf418('0xb')](function(_0x34857e){logger[_0xf418('0xc')]('GetCampaignHopperHistory',_0xc7e64e);logger['debug'](_0xf418('0x3f'),_0xc7e64e,JSON[_0xf418('0x19')](_0x34857e));_0x129074(_0x34857e);})[_0xf418('0x14')](function(_0x308836){logger['error'](_0xf418('0x3f'),_0x308836[_0xf418('0x12')],_0xc7e64e);_0x583505(_0x2ee4b3['error'](0x1f4,_0x308836[_0xf418('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 4b2b75e..9519153 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 _0x5930=['Router','fs-extra','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','show','/:id','update','exports','multer','util','connect-timeout','express'];(function(_0xe0d11,_0x5aae5d){var _0x1210bb=function(_0x58662f){while(--_0x58662f){_0xe0d11['push'](_0xe0d11['shift']());}};_0x1210bb(++_0x5aae5d);}(_0x5930,0x12e));var _0x0593=function(_0x261750,_0x5d0d44){_0x261750=_0x261750-0x0;var _0x12a0a3=_0x5930[_0x261750];return _0x12a0a3;};'use strict';var multer=require(_0x0593('0x0'));var util=require(_0x0593('0x1'));var path=require('path');var timeout=require(_0x0593('0x2'));var express=require(_0x0593('0x3'));var router=express[_0x0593('0x4')]();var fs_extra=require(_0x0593('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0593('0x6'));var controller=require(_0x0593('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0593('0x8')]);router[_0x0593('0x9')](_0x0593('0xa'),auth[_0x0593('0xb')](),controller[_0x0593('0xc')]);router[_0x0593('0x9')]('/:id',auth[_0x0593('0xb')](),controller[_0x0593('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0593('0xe'),auth[_0x0593('0xb')](),controller[_0x0593('0xf')]);module[_0x0593('0x10')]=router; \ No newline at end of file +var _0xca79=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xca79,0x1b8));var _0x9ca7=function(_0x31d5b8,_0x55846c){_0x31d5b8=_0x31d5b8-0x0;var _0x30a1b7=_0xca79[_0x31d5b8];return _0x30a1b7;};'use strict';var multer=require(_0x9ca7('0x0'));var util=require(_0x9ca7('0x1'));var path=require(_0x9ca7('0x2'));var timeout=require(_0x9ca7('0x3'));var express=require(_0x9ca7('0x4'));var router=express[_0x9ca7('0x5')]();var fs_extra=require(_0x9ca7('0x6'));var auth=require(_0x9ca7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9ca7('0x8'));var controller=require(_0x9ca7('0x9'));router['get']('/',auth[_0x9ca7('0xa')](),controller[_0x9ca7('0xb')]);router[_0x9ca7('0xc')](_0x9ca7('0xd'),auth[_0x9ca7('0xa')](),controller[_0x9ca7('0xe')]);router[_0x9ca7('0xc')](_0x9ca7('0xf'),auth['isAuthenticated'](),controller[_0x9ca7('0x10')]);router[_0x9ca7('0x11')]('/',auth['isAuthenticated'](),controller[_0x9ca7('0x12')]);router[_0x9ca7('0x13')]('/:id',auth[_0x9ca7('0xa')](),controller[_0x9ca7('0x14')]);module[_0x9ca7('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 935c7a5..f4c7188 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 _0xb26e=['STRING','sequelize'];(function(_0x1853e5,_0x2193d4){var _0x26baad=function(_0x5405c5){while(--_0x5405c5){_0x1853e5['push'](_0x1853e5['shift']());}};_0x26baad(++_0x2193d4);}(_0xb26e,0x11d));var _0xeb26=function(_0x2f4345,_0x14c406){_0x2f4345=_0x2f4345-0x0;var _0x59f2e4=_0xb26e[_0x2f4345];return _0x59f2e4;};'use strict';var Sequelize=require(_0xeb26('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeb26('0x1')]},'dialPrefix':{'type':Sequelize[_0xeb26('0x1')]}}; \ No newline at end of file +var _0x7d55=['sequelize','exports','STRING','name'];(function(_0x5b387b,_0x2350ad){var _0x6908b9=function(_0x1b688f){while(--_0x1b688f){_0x5b387b['push'](_0x5b387b['shift']());}};_0x6908b9(++_0x2350ad);}(_0x7d55,0x1bc));var _0x57d5=function(_0xb10d46,_0x272d64){_0xb10d46=_0xb10d46-0x0;var _0x56eea2=_0x7d55[_0xb10d46];return _0x56eea2;};'use strict';var Sequelize=require(_0x57d5('0x0'));module[_0x57d5('0x1')]={'name':{'type':Sequelize[_0x57d5('0x2')],'unique':_0x57d5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 54cf803..5d96d7a 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 _0xdbfa=['isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','text/csv','download','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','name','index','map','CmList','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','include','findAll','rows','catch','params','keys','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','getContactsCsv','alias','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','from','CmContactId\x20=\x20c.id','description_additionalPhone_','toString'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0xdbfa,0x15e));var _0xadbf=function(_0x11ac68,_0x56debc){_0x11ac68=_0x11ac68-0x0;var _0x1d5277=_0xdbfa[_0x11ac68];return _0x1d5277;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xadbf('0x0'));var jsonpatch=require(_0xadbf('0x1'));var rp=require(_0xadbf('0x2'));var moment=require('moment');var BPromise=require(_0xadbf('0x3'));var Mustache=require(_0xadbf('0x4'));var util=require(_0xadbf('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xadbf('0x6'));var fs=require('fs');var fs_extra=require(_0xadbf('0x7'));var _=require(_0xadbf('0x8'));var squel=require(_0xadbf('0x9'));var crypto=require(_0xadbf('0xa'));var jsforce=require(_0xadbf('0xb'));var deskjs=require(_0xadbf('0xc'));var toCsv=require(_0xadbf('0xd'));var querystring=require(_0xadbf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xadbf('0xf'));var qs=require(_0xadbf('0x10'));var as=require(_0xadbf('0x11'));var hardwareService=require(_0xadbf('0x12'));var logger=require('../../config/logger')(_0xadbf('0x13'));var utils=require(_0xadbf('0x14'));var config=require(_0xadbf('0x15'));var licenseUtil=require(_0xadbf('0x16'));var db=require(_0xadbf('0x17'))['db'];var csv_results;config['redis']=_[_0xadbf('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadbf('0x19')]));require('./cmList.socket')[_0xadbf('0x1a')](socket);function respondWithStatusCode(_0x30bc20,_0x5b7709){_0x5b7709=_0x5b7709||0xcc;return function(_0x4d0591){if(_0x4d0591){return _0x30bc20[_0xadbf('0x1b')](_0x5b7709);}return _0x30bc20[_0xadbf('0x1c')](_0x5b7709)['end']();};}function respondWithResult(_0x160eee,_0x3a918c){_0x3a918c=_0x3a918c||0xc8;return function(_0x2a64ac){if(_0x2a64ac){return _0x160eee[_0xadbf('0x1c')](_0x3a918c)[_0xadbf('0x1d')](_0x2a64ac);}};}function respondWithFilteredResult(_0x43cc16,_0x42f207){return function(_0x103ba6){if(_0x103ba6){var _0x54f0cb=typeof _0x42f207[_0xadbf('0x1e')]===_0xadbf('0x1f')&&typeof _0x42f207['limit']===_0xadbf('0x1f');var _0x5e86ec=_0x103ba6[_0xadbf('0x20')];var _0x4779f8=_0x54f0cb?0x0:_0x42f207['offset'];var _0x1f2ee7=_0x54f0cb?_0x103ba6['count']:_0x42f207[_0xadbf('0x1e')]+_0x42f207[_0xadbf('0x21')];var _0x5d0cf9;if(_0x1f2ee7>=_0x5e86ec){_0x1f2ee7=_0x5e86ec;_0x5d0cf9=0xc8;}else{_0x5d0cf9=0xce;}_0x43cc16[_0xadbf('0x1c')](_0x5d0cf9);return _0x43cc16['set'](_0xadbf('0x22'),_0x4779f8+'-'+_0x1f2ee7+'/'+_0x5e86ec)[_0xadbf('0x1d')](_0x103ba6);}return null;};}function patchUpdates(_0x2aa7cd){return function(_0x528773){try{jsonpatch[_0xadbf('0x23')](_0x528773,_0x2aa7cd,!![]);}catch(_0x42bf75){return BPromise[_0xadbf('0x24')](_0x42bf75);}return _0x528773[_0xadbf('0x25')]();};}function saveUpdates(_0xd30da9,_0x5142f8){return function(_0x5eb809){if(_0x5eb809){return _0x5eb809[_0xadbf('0x26')](_0xd30da9)[_0xadbf('0x27')](function(_0x461df4){return _0x461df4;});}return null;};}function removeEntity(_0x52304f,_0x58d203){return function(_0x5c84a2){if(_0x5c84a2){return _0x5c84a2[_0xadbf('0x28')]()[_0xadbf('0x27')](function(){var _0x542a3b=_0x5c84a2[_0xadbf('0x29')]({'plain':!![]});var _0x2bb6e5=_0xadbf('0x2a');return db[_0xadbf('0x2b')]['destroy']({'where':{'type':_0x2bb6e5,'resourceId':_0x542a3b['id']}})['then'](function(){return _0x5c84a2;});})['then'](function(){_0x52304f['status'](0xcc)[_0xadbf('0x2c')]();});}};}function handleEntityNotFound(_0x1e2df1,_0x195e8a){return function(_0x1d248b){if(!_0x1d248b){_0x1e2df1['sendStatus'](0x194);}return _0x1d248b;};}function handleError(_0xde74d7,_0x1f2c13){_0x1f2c13=_0x1f2c13||0x1f4;return function(_0xb945fa){logger['error'](_0xb945fa['stack']);if(_0xb945fa['name']){delete _0xb945fa[_0xadbf('0x2d')];}_0xde74d7[_0xadbf('0x1c')](_0x1f2c13)['send'](_0xb945fa);};}exports[_0xadbf('0x2e')]=function(_0x2ca0d0,_0x59555e){var _0x42627c={},_0x2676c3={},_0x44e566={'count':0x0,'rows':[]};var _0x2eaf6e=_[_0xadbf('0x2f')](db[_0xadbf('0x30')][_0xadbf('0x31')],function(_0x41dcaf){return{'name':_0x41dcaf[_0xadbf('0x32')],'type':_0x41dcaf[_0xadbf('0x33')][_0xadbf('0x34')]};});_0x2676c3['model']=_[_0xadbf('0x2f')](_0x2eaf6e,_0xadbf('0x2d'));_0x2676c3[_0xadbf('0x35')]=_['keys'](_0x2ca0d0[_0xadbf('0x35')]);_0x2676c3[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x2676c3['model'],_0x2676c3[_0xadbf('0x35')]);_0x42627c[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2676c3[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x2ca0d0[_0xadbf('0x35')]['fields']));_0x42627c[_0xadbf('0x38')]=_0x42627c[_0xadbf('0x38')]['length']?_0x42627c[_0xadbf('0x38')]:_0x2676c3['model'];if(!_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x3b')](_0xadbf('0x3c'))){_0x42627c[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x21')]);_0x42627c[_0xadbf('0x1e')]=qs['offset'](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x42627c[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x42627c['where']=qs['filters'](_[_0xadbf('0x3f')](_0x2ca0d0['query'],_0x2676c3['filters']),_0x2eaf6e);if(_0x2ca0d0[_0xadbf('0x35')]['filter']){_0x42627c[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x42627c['where'],{'$or':_[_0xadbf('0x2f')](_0x2eaf6e,function(_0x225947){if(_0x225947[_0xadbf('0x33')]!=='VIRTUAL'){var _0x2c1eb2={};_0x2c1eb2[_0x225947[_0xadbf('0x2d')]]={'$like':'%'+_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x42')]+'%'};return _0x2c1eb2;}})});}_0x42627c=_[_0xadbf('0x41')]({},_0x42627c,_0x2ca0d0[_0xadbf('0x43')]);var _0x1a0704={'where':_0x42627c[_0xadbf('0x40')]};return db[_0xadbf('0x30')][_0xadbf('0x20')](_0x1a0704)[_0xadbf('0x27')](function(_0x4410dd){_0x44e566[_0xadbf('0x20')]=_0x4410dd;if(_0x2ca0d0[_0xadbf('0x35')]['includeAll']){_0x42627c[_0xadbf('0x44')]=[{'all':!![]}];}return db['CmList'][_0xadbf('0x45')](_0x42627c);})[_0xadbf('0x27')](function(_0x302fff){_0x44e566[_0xadbf('0x46')]=_0x302fff;return _0x44e566;})[_0xadbf('0x27')](respondWithFilteredResult(_0x59555e,_0x42627c))[_0xadbf('0x47')](handleError(_0x59555e,null));};exports['show']=function(_0x1c2205,_0x5690f8){var _0x8cf05f={'raw':![],'where':{'id':_0x1c2205[_0xadbf('0x48')]['id']}},_0x3380d1={};_0x3380d1[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x30')][_0xadbf('0x31')]);_0x3380d1[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x1c2205[_0xadbf('0x35')]);_0x3380d1[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x3380d1['model'],_0x3380d1['query']);_0x8cf05f[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x3380d1[_0xadbf('0x39')],qs['fields'](_0x1c2205['query']['fields']));_0x8cf05f[_0xadbf('0x38')]=_0x8cf05f['attributes'][_0xadbf('0x4a')]?_0x8cf05f[_0xadbf('0x38')]:_0x3380d1[_0xadbf('0x39')];if(_0x1c2205[_0xadbf('0x35')][_0xadbf('0x4b')]){_0x8cf05f[_0xadbf('0x44')]=[{'all':!![]}];}_0x8cf05f=_[_0xadbf('0x41')]({},_0x8cf05f,_0x1c2205[_0xadbf('0x43')]);return db[_0xadbf('0x30')]['find'](_0x8cf05f)['then'](handleEntityNotFound(_0x5690f8,null))[_0xadbf('0x27')](respondWithResult(_0x5690f8,null))[_0xadbf('0x47')](handleError(_0x5690f8,null));};exports[_0xadbf('0x4c')]=function(_0x50d14b,_0x5dfa9e){return db[_0xadbf('0x30')][_0xadbf('0x4c')](_0x50d14b[_0xadbf('0x4d')],{})[_0xadbf('0x27')](function(_0x81243b){var _0x643f4d=_0x50d14b[_0xadbf('0x4e')][_0xadbf('0x29')]({'plain':!![]});if(!_0x643f4d)throw new Error(_0xadbf('0x4f'));if(_0x643f4d[_0xadbf('0x50')]===_0xadbf('0x4e')){var _0x23b513=_0x81243b[_0xadbf('0x29')]({'plain':!![]});var _0x593084=_0xadbf('0x2a');return db[_0xadbf('0x51')][_0xadbf('0x52')]({'where':{'name':_0x593084,'userProfileId':_0x643f4d[_0xadbf('0x53')]},'raw':!![]})[_0xadbf('0x27')](function(_0x49d290){if(_0x49d290&&_0x49d290['autoAssociation']===0x0){return db[_0xadbf('0x2b')][_0xadbf('0x4c')]({'name':_0x23b513[_0xadbf('0x2d')],'resourceId':_0x23b513['id'],'type':_0x49d290['name'],'sectionId':_0x49d290['id']},{})[_0xadbf('0x27')](function(){return _0x81243b;});}else{return _0x81243b;}})[_0xadbf('0x47')](function(_0x380612){logger[_0xadbf('0x54')](_0xadbf('0x55'),_0x380612);throw _0x380612;});}return _0x81243b;})[_0xadbf('0x27')](respondWithResult(_0x5dfa9e,0xc9))[_0xadbf('0x47')](handleError(_0x5dfa9e,null));};exports[_0xadbf('0x26')]=function(_0xf054e,_0x5d5c17){if(_0xf054e[_0xadbf('0x4d')]['id']){delete _0xf054e[_0xadbf('0x4d')]['id'];}return db[_0xadbf('0x30')]['find']({'where':{'id':_0xf054e[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d5c17,null))[_0xadbf('0x27')](saveUpdates(_0xf054e[_0xadbf('0x4d')],null))['then'](respondWithResult(_0x5d5c17,null))[_0xadbf('0x47')](handleError(_0x5d5c17,null));};exports['destroy']=function(_0x3db271,_0x1666aa){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x3db271[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1666aa,null))[_0xadbf('0x27')](removeEntity(_0x1666aa,null))[_0xadbf('0x47')](handleError(_0x1666aa,null));};exports['describe']=function(_0x370896,_0x2dc85d){return db[_0xadbf('0x30')][_0xadbf('0x56')]()[_0xadbf('0x27')](respondWithResult(_0x2dc85d,null))['catch'](handleError(_0x2dc85d,null));};exports[_0xadbf('0x57')]=function(_0x5ba99d,_0x146fce,_0x545086){if(_0x5ba99d['body']['id']){delete _0x5ba99d['body']['id'];}return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x5ba99d[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x146fce,null))[_0xadbf('0x27')](function(_0x488ccb){if(_0x488ccb){_0x5ba99d[_0xadbf('0x4d')][_0xadbf('0x58')]=_0x488ccb['id'];return db[_0xadbf('0x59')][_0xadbf('0x4c')](_0x5ba99d['body']);}})['then'](respondWithResult(_0x146fce,null))['catch'](handleError(_0x146fce,null));};exports[_0xadbf('0x5a')]=function(_0x2ec8cb,_0x52ecd9,_0x5685b9){var _0x54849f={'raw':![],'where':{}};var _0x491d81={};var _0x1670c3={'count':0x0,'rows':[]};return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x2ec8cb[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x52ecd9,null))[_0xadbf('0x27')](function(_0x37da07){if(_0x37da07){_0x491d81[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x59')]['rawAttributes']);_0x491d81['query']=_[_0xadbf('0x49')](_0x2ec8cb[_0xadbf('0x35')]);_0x491d81[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x491d81['model'],_0x491d81['query']);_0x54849f[_0xadbf('0x38')]=_['intersection'](_0x491d81[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x2ec8cb['query']['fields']));_0x54849f[_0xadbf('0x38')]=_0x54849f[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x54849f[_0xadbf('0x38')]:_0x491d81[_0xadbf('0x39')];if(!_0x2ec8cb['query'][_0xadbf('0x3b')](_0xadbf('0x3c'))){_0x54849f[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x21')]);_0x54849f['offset']=qs[_0xadbf('0x1e')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x54849f['order']=qs[_0xadbf('0x3e')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x54849f['where']=qs[_0xadbf('0x36')](_['pick'](_0x2ec8cb[_0xadbf('0x35')],_0x491d81['filters']));_0x54849f[_0xadbf('0x40')]['ListId']=_0x37da07['id'];if(_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x42')]){_0x54849f[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x54849f['where'],{'$or':_[_0xadbf('0x2f')](_0x54849f[_0xadbf('0x38')],function(_0x4a9154){var _0x2aabc0={};_0x2aabc0[_0x4a9154]={'$like':'%'+_0x2ec8cb['query'][_0xadbf('0x42')]+'%'};return _0x2aabc0;})});}_0x54849f=_[_0xadbf('0x41')]({},_0x54849f,_0x2ec8cb['options']);return db['Disposition'][_0xadbf('0x20')]({'where':_0x54849f['where']})[_0xadbf('0x27')](function(_0x482b88){_0x1670c3[_0xadbf('0x20')]=_0x482b88;if(_0x2ec8cb[_0xadbf('0x35')]['includeAll']){_0x54849f[_0xadbf('0x44')]=[{'all':!![]}];}return db[_0xadbf('0x59')][_0xadbf('0x45')](_0x54849f);})[_0xadbf('0x27')](function(_0x4f5909){_0x1670c3[_0xadbf('0x46')]=_0x4f5909;return _0x1670c3;});}})['then'](respondWithFilteredResult(_0x52ecd9,_0x54849f))[_0xadbf('0x47')](handleError(_0x52ecd9,null));};exports[_0xadbf('0x5c')]=function(_0x48c7e9,_0x5c27ed,_0x2f0fd0){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x48c7e9[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x5c27ed,null))['then'](function(_0x3adeab){if(_0x3adeab){return _0x3adeab[_0xadbf('0x5c')](_0x48c7e9[_0xadbf('0x35')][_0xadbf('0x5d')]);}})[_0xadbf('0x27')](respondWithStatusCode(_0x5c27ed,null))[_0xadbf('0x47')](handleError(_0x5c27ed,null));};exports['addContacts']=function(_0x48c6bb,_0x427bf9,_0x304cc2){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x48c6bb[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x427bf9,null))['then'](function(_0x132c32){if(_0x132c32){var _0x346d38=[];var _0x3832cb={'success':[],'errors':[]};return db[_0xadbf('0x5e')][_0xadbf('0x56')]()[_0xadbf('0x27')](function(_0x4d19a5){if(_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]&&_[_0xadbf('0x60')](_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')])){if(_0x48c6bb[_0xadbf('0x4d')]['tags'][_0xadbf('0x4a')]){_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')][_0xadbf('0x61')](';')+';';}else{_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=null;}}else{_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=null;}if(_0x48c6bb[_0xadbf('0x4d')]&&_['isArray'](_0x48c6bb[_0xadbf('0x4d')])){for(var _0x49dfc5=0x0;_0x49dfc5<_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x4a')];_0x49dfc5+=0x1){_0x48c6bb[_0xadbf('0x4d')][_0x49dfc5][_0xadbf('0x58')]=_0x48c6bb[_0xadbf('0x48')]['id'];_0x346d38[_0xadbf('0x62')](_0x48c6bb[_0xadbf('0x4d')][_0x49dfc5]);}return BPromise[_0xadbf('0x63')](_0x346d38,function(_0x463ffe){return db[_0xadbf('0x5e')][_0xadbf('0x4c')](_[_0xadbf('0x64')](_0x463ffe,[_0xadbf('0x5d'),'id'])||{},{'fields':_[_0xadbf('0x49')](_0x4d19a5),'raw':!![]})[_0xadbf('0x27')](function(_0x344fb1){_0x3832cb[_0xadbf('0x65')][_0xadbf('0x62')](_0x344fb1[_0xadbf('0x66')]);})[_0xadbf('0x47')](function(_0x3caad3){_0x3832cb[_0xadbf('0x67')]['push']({'data':_0x463ffe,'error':_0x3caad3[_0xadbf('0x68')]});});})['then'](function(_0x1b870c){return _0x3832cb;})[_0xadbf('0x47')](function(_0x380187){return _0x380187;});}else{_0x427bf9[_0xadbf('0x1c')](0x190)[_0xadbf('0x1d')]({'message':_0xadbf('0x69')});}});}})[_0xadbf('0x27')](respondWithResult(_0x427bf9,null))['catch'](handleError(_0x427bf9,null));};exports[_0xadbf('0x6a')]=function(_0x570db7,_0x201f2e,_0x520c42){var _0xa34365;return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x570db7[_0xadbf('0x48')]['id']},'include':[{'model':db[_0xadbf('0x6b')],'as':_0xadbf('0x6c')}]})[_0xadbf('0x27')](handleEntityNotFound(_0x201f2e,null))[_0xadbf('0x27')](function(_0xbe8e75){if(_0xbe8e75){_0xa34365=_0xbe8e75;return db[_0xadbf('0x5e')][_0xadbf('0x31')];}})['then'](function(_0x391ca7){if(_0x391ca7){var _0x5d626e={};var _0x2737db={};_0x2737db[_0xadbf('0x39')]=_['concat'](_[_0xadbf('0x49')](_0x391ca7),_[_0xadbf('0x2f')](_0xa34365[_0xadbf('0x6c')],function(_0x44ac4c){return util[_0xadbf('0x6d')]('cf_%d',_0x44ac4c['id']);}));_0x2737db[_0xadbf('0x35')]=_['keys'](_0x570db7[_0xadbf('0x35')]);_0x2737db[_0xadbf('0x36')]=_['intersection'](_0x2737db[_0xadbf('0x39')],_0x2737db[_0xadbf('0x35')]);_0x5d626e[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2737db[_0xadbf('0x39')],qs['fields'](_0x570db7[_0xadbf('0x35')]['fields']));_0x5d626e[_0xadbf('0x38')]=_0x5d626e['attributes'][_0xadbf('0x4a')]?_0x5d626e[_0xadbf('0x38')]:_0x2737db[_0xadbf('0x39')];if(!_0x570db7['query']['hasOwnProperty']('nolimit')){_0x5d626e[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x570db7[_0xadbf('0x35')][_0xadbf('0x21')]);_0x5d626e[_0xadbf('0x1e')]=qs['offset'](_0x570db7[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x5d626e['order']=qs[_0xadbf('0x3e')](_0x570db7[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x5d626e[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_['pick'](_0x570db7[_0xadbf('0x35')],_0x2737db[_0xadbf('0x36')]));_0x5d626e[_0xadbf('0x6e')]=!![];if(_0x570db7[_0xadbf('0x35')]['filter']){_0x5d626e[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x5d626e['where'],{'$or':_['map'](_0x5d626e[_0xadbf('0x38')],function(_0x227885){var _0x1db020={};_0x1db020[_0x227885]={'$like':'%'+_0x570db7['query']['filter']+'%'};return _0x1db020;})});}_0x5d626e=_[_0xadbf('0x41')]({},_0x5d626e,_0x570db7[_0xadbf('0x43')]);return _0xa34365['getContacts'](_0x5d626e);}})['then'](respondWithResult(_0x201f2e,null))[_0xadbf('0x47')](handleError(_0x201f2e,null));};exports[_0xadbf('0x6f')]=function(_0x507784,_0x77f363,_0x6887c8){var _0x6d4cc5;var _0x515199;var _0x4ca093;var _0x5c64be=_0x507784['params']['id'];csv_results=[];return db['ContactItemType'][_0xadbf('0x45')]({'attributes':['id',_0xadbf('0x2d')],'raw':!![],'order':['OrderBy']})['then'](function(_0x1eb570){_0x6d4cc5=_0x1eb570;var _0x47adf9=_[_0xadbf('0x49')](db['CmContact'][_0xadbf('0x31')]);return db[_0xadbf('0x6b')][_0xadbf('0x45')]({'raw':!![],'attributes':['id',_0xadbf('0x70')]})[_0xadbf('0x27')](function(_0x1d6991){_0x515199=_0x1d6991;var _0x1118ab=squel[_0xadbf('0x71')]()[_0xadbf('0x3a')](_0x47adf9)['from']('cm_contacts','c')[_0xadbf('0x40')](_0xadbf('0x72'),_0x5c64be)[_0xadbf('0x40')](_0xadbf('0x73'))[_0xadbf('0x74')]();for(var _0x447141=0x0;_0x447141<_0x515199[_0xadbf('0x4a')];_0x447141++){_0x1118ab[_0xadbf('0x75')]('c.cf_'+_0x515199[_0x447141]['id'],_0xadbf('0x76')+_0x515199[_0x447141][_0xadbf('0x70')]);}for(var _0x447141=0x0;_0x447141<_0x6d4cc5[_0xadbf('0x4a')];_0x447141++){_0x1118ab['field'](squel[_0xadbf('0x71')]()['field']('item')['from'](_0xadbf('0x77'))['where'](_0xadbf('0x78'),_0x6d4cc5[_0x447141]['id'])[_0xadbf('0x40')]('CmContactId\x20=\x20c.id'),_0xadbf('0x79')+_0x6d4cc5[_0x447141][_0xadbf('0x2d')]);_0x1118ab['field'](squel['select']()[_0xadbf('0x75')](_0xadbf('0x7a'))[_0xadbf('0x7b')](_0xadbf('0x77'))[_0xadbf('0x40')](_0xadbf('0x78'),_0x6d4cc5[_0x447141]['id'])[_0xadbf('0x40')](_0xadbf('0x7c')),_0xadbf('0x7d')+_0x6d4cc5[_0x447141][_0xadbf('0x2d')]);}var _0x576609=[];_0x576609[_0xadbf('0x62')](_0x1118ab['toString']());BPromise['each'](_0x576609,handleQuery)[_0xadbf('0x27')](function(_0x53740f){handleQuery(_0x1118ab[_0xadbf('0x7e')]());var _0x37e60a=csv_results[0x0];if(!_[_0xadbf('0x7f')](_0x37e60a)){var _0x80f62f=toCsv(_0x37e60a);var _0x23bd7e=Date[_0xadbf('0x80')]();fs[_0xadbf('0x81')](util[_0xadbf('0x6d')](_0xadbf('0x82'),_0x5c64be,_0x23bd7e),_0x80f62f);_0x77f363[_0xadbf('0x83')]('Content-disposition',_0xadbf('0x84')+util[_0xadbf('0x6d')]('list_%d_%s.csv',_0x5c64be,_0x23bd7e));_0x77f363[_0xadbf('0x83')]('Content-type',_0xadbf('0x85'));return _0x77f363[_0xadbf('0x86')](util[_0xadbf('0x6d')](_0xadbf('0x82'),_0x5c64be,_0x23bd7e));}else{return _0x77f363[_0xadbf('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x387b49,_0x4b3d07,_0x1a8940){var _0x525de2;delete _0x387b49[_0xadbf('0x4d')]['id'];return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x387b49['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x4b3d07,null))[_0xadbf('0x27')](function(_0x2e6991){if(_0x2e6991){return db['sequelize'][_0xadbf('0x87')](function(_0x1628cb){return db['CmCustomField']['create'](_0x387b49['body'],{'transaction':_0x1628cb})[_0xadbf('0x27')](function(_0x1e5dd7){_0x525de2=_0x1e5dd7;return _0x2e6991['addCustomFields'](_0x1e5dd7,{'transaction':_0x1628cb});})[_0xadbf('0x27')](function(){var _0x26ad2c={'type':db[_0xadbf('0x88')][_0xadbf('0x89')],'transaction':_0x1628cb};switch(_0x387b49['body'][_0xadbf('0x33')]){case _0xadbf('0x8a'):_0x26ad2c[_0xadbf('0x33')]=db[_0xadbf('0x88')][_0xadbf('0x89')];break;case _0xadbf('0x8b'):_0x26ad2c[_0xadbf('0x33')]=db['Sequelize'][_0xadbf('0x8c')];break;case _0xadbf('0x8d'):_0x26ad2c[_0xadbf('0x33')]=db[_0xadbf('0x88')]['BOOLEAN'];_0x26ad2c[_0xadbf('0x8e')]=![];break;default:}return db[_0xadbf('0x8f')][_0xadbf('0x90')][_0xadbf('0x91')](_0xadbf('0x92'),util[_0xadbf('0x6d')](_0xadbf('0x93'),_0x525de2['id']),_0x26ad2c);})[_0xadbf('0x27')](function(){return _0x525de2;});});}})[_0xadbf('0x27')](respondWithResult(_0x4b3d07,null))[_0xadbf('0x47')](handleError(_0x4b3d07,null));};exports[_0xadbf('0x94')]=function(_0x44237e,_0x617f57,_0x4d45a8){var _0x8bc6d1={};var _0x3aa6a5={};var _0x356d93;var _0x400227;return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x44237e['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x617f57,null))[_0xadbf('0x27')](function(_0x176453){if(_0x176453){_0x356d93=_0x176453;_0x3aa6a5[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x6b')][_0xadbf('0x31')]);_0x3aa6a5[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x44237e['query']);_0x3aa6a5['filters']=_[_0xadbf('0x37')](_0x3aa6a5[_0xadbf('0x39')],_0x3aa6a5[_0xadbf('0x35')]);_0x8bc6d1[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x3aa6a5[_0xadbf('0x39')],qs['fields'](_0x44237e['query'][_0xadbf('0x3a')]));_0x8bc6d1['attributes']=_0x8bc6d1[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x8bc6d1['attributes']:_0x3aa6a5[_0xadbf('0x39')];_0x8bc6d1[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x44237e[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x8bc6d1[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_[_0xadbf('0x3f')](_0x44237e[_0xadbf('0x35')],_0x3aa6a5[_0xadbf('0x36')]));_0x8bc6d1[_0xadbf('0x40')]=_['merge'](_0x8bc6d1[_0xadbf('0x40')],{'$or':[{'ListId':_0x176453['id']},{'ListId':null}]});if(_0x44237e[_0xadbf('0x35')][_0xadbf('0x42')]){_0x8bc6d1[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x8bc6d1[_0xadbf('0x40')],{'$or':_['map'](_0x8bc6d1[_0xadbf('0x38')],function(_0x41ae41){var _0x52cdf8={};_0x52cdf8[_0x41ae41]={'$like':'%'+_0x44237e[_0xadbf('0x35')]['filter']+'%'};return _0x52cdf8;})});}_0x8bc6d1=_['merge']({},_0x8bc6d1,_0x44237e['options']);return db[_0xadbf('0x6b')][_0xadbf('0x95')](_0x8bc6d1);}})[_0xadbf('0x27')](respondWithResult(_0x617f57,null))['catch'](handleError(_0x617f57,null));};exports[_0xadbf('0x96')]=function(_0x951cf1,_0x4183da){return db[_0xadbf('0x6b')][_0xadbf('0x95')]({'where':{'ListId':null}})[_0xadbf('0x27')](handleEntityNotFound(_0x4183da,null))['then'](function(_0x10c7df){return _0x10c7df;})[_0xadbf('0x27')](respondWithResult(_0x4183da,null))[_0xadbf('0x47')](handleError(_0x4183da,null));};exports[_0xadbf('0x97')]=function(_0x32cbd0,_0x340868,_0x2bb40c){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x32cbd0[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x340868,null))['then'](function(_0x11f12c){if(_0x11f12c){return _0x11f12c['addAgents'](_0x32cbd0[_0xadbf('0x4d')]['ids'],_['omit'](_0x32cbd0['body'],[_0xadbf('0x5d'),'id'])||{})[_0xadbf('0x98')](function(_0x1ab7d5){for(var _0x4af5c3=0x0;_0x4af5c3<_0x32cbd0[_0xadbf('0x4d')][_0xadbf('0x5d')]['length'];_0x4af5c3+=0x1){socket[_0xadbf('0x99')]('userCmList:save',{'UserId':Number(_0x32cbd0['body'][_0xadbf('0x5d')][_0x4af5c3]),'CmListId':Number(_0x32cbd0[_0xadbf('0x48')]['id'])});}return _0x1ab7d5;});}})[_0xadbf('0x27')](respondWithResult(_0x340868,null))[_0xadbf('0x47')](handleError(_0x340868,null));};exports[_0xadbf('0x9a')]=function(_0x556d91,_0xce1858,_0x456598){return db['CmList'][_0xadbf('0x52')]({'where':{'id':_0x556d91[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0xce1858,null))[_0xadbf('0x27')](function(_0x20360f){if(_0x20360f){return _0x20360f['removeAgents'](_0x556d91['query'][_0xadbf('0x5d')])[_0xadbf('0x27')](function(){if(_['isArray'](_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')])){for(var _0x339040=0x0;_0x339040<_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')][_0xadbf('0x4a')];_0x339040+=0x1){socket[_0xadbf('0x99')]('userCmList:remove',{'UserId':Number(_0x556d91['query'][_0xadbf('0x5d')][_0x339040]),'CmListId':Number(_0x556d91[_0xadbf('0x48')]['id'])});}}else{socket['emit'](_0xadbf('0x9b'),{'UserId':Number(_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')]),'CmListId':Number(_0x556d91[_0xadbf('0x48')]['id'])});}});}})[_0xadbf('0x27')](respondWithStatusCode(_0xce1858,null))[_0xadbf('0x47')](handleError(_0xce1858,null));};exports[_0xadbf('0x9c')]=function(_0x43720c,_0x5c47f2,_0x121841){var _0x4b826f={};var _0x2ec722={};var _0x73b541;var _0x4d8f95;return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x43720c['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x5c47f2,null))[_0xadbf('0x27')](function(_0x4d6589){if(_0x4d6589){_0x73b541=_0x4d6589;_0x2ec722['model']=_['keys'](db[_0xadbf('0x9d')][_0xadbf('0x31')]);_0x2ec722[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x43720c[_0xadbf('0x35')]);_0x2ec722[_0xadbf('0x36')]=_['intersection'](_0x2ec722[_0xadbf('0x39')],_0x2ec722['query']);_0x4b826f[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2ec722[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x3a')]));_0x4b826f['attributes']=_0x4b826f[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x4b826f[_0xadbf('0x38')]:_0x2ec722[_0xadbf('0x39')];_0x4b826f[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x4b826f[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_['pick'](_0x43720c[_0xadbf('0x35')],_0x2ec722[_0xadbf('0x36')]));if(_0x43720c[_0xadbf('0x35')][_0xadbf('0x42')]){_0x4b826f[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x4b826f[_0xadbf('0x40')],{'$or':_[_0xadbf('0x2f')](_0x4b826f[_0xadbf('0x38')],function(_0x1d3810){var _0x1d7bf5={};_0x1d7bf5[_0x1d3810]={'$like':'%'+_0x43720c[_0xadbf('0x35')][_0xadbf('0x42')]+'%'};return _0x1d7bf5;})});}_0x4b826f=_[_0xadbf('0x41')]({},_0x4b826f,_0x43720c[_0xadbf('0x43')]);return _0x73b541[_0xadbf('0x9c')](_0x4b826f);}})[_0xadbf('0x27')](function(_0x1dae8e){if(_0x1dae8e){_0x4d8f95=_0x1dae8e['length'];if(!_0x43720c[_0xadbf('0x35')][_0xadbf('0x3b')]('nolimit')){_0x4b826f[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x21')]);_0x4b826f['offset']=qs[_0xadbf('0x1e')](_0x43720c[_0xadbf('0x35')]['offset']);}return _0x73b541['getAgents'](_0x4b826f);}})[_0xadbf('0x27')](function(_0x23627e){if(_0x23627e){return _0x23627e?{'count':_0x4d8f95,'rows':_0x23627e}:null;}})['then'](respondWithResult(_0x5c47f2,null))[_0xadbf('0x47')](handleError(_0x5c47f2,null));};function handleQuery(_0x1491ad){logger[_0xadbf('0x9e')](_0x1491ad);return db[_0xadbf('0x8f')][_0xadbf('0x35')](_0x1491ad)[_0xadbf('0x98')](function(_0x3dad11){csv_results[_0xadbf('0x62')](_0x3dad11);})[_0xadbf('0x47')](function(_0x5609cd){logger[_0xadbf('0x54')](_0x5609cd[_0xadbf('0x68')]);});} \ No newline at end of file +var _0xce65=['sequelize','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','Lists','error','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','getDispositions','Disposition','order','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','OrderBy','alias','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','select','item','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','toString','now','writeFileSync','format','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','/tmp/list_%d_%s.csv','addCustomField','findOne','addCustomFields','TEXT','Sequelize','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','nolimit','info'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xce65,0xa8));var _0x5ce6=function(_0x2a5d4d,_0x4489da){_0x2a5d4d=_0x2a5d4d-0x0;var _0x3e1687=_0xce65[_0x2a5d4d];return _0x3e1687;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ce6('0x0'));var zipdir=require(_0x5ce6('0x1'));var jsonpatch=require(_0x5ce6('0x2'));var rp=require(_0x5ce6('0x3'));var moment=require(_0x5ce6('0x4'));var BPromise=require(_0x5ce6('0x5'));var Mustache=require(_0x5ce6('0x6'));var util=require(_0x5ce6('0x7'));var path=require(_0x5ce6('0x8'));var sox=require('sox');var csv=require(_0x5ce6('0x9'));var ejs=require(_0x5ce6('0xa'));var fs=require('fs');var fs_extra=require(_0x5ce6('0xb'));var _=require(_0x5ce6('0xc'));var squel=require(_0x5ce6('0xd'));var crypto=require(_0x5ce6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5ce6('0xf'));var toCsv=require(_0x5ce6('0x9'));var querystring=require(_0x5ce6('0x10'));var Papa=require(_0x5ce6('0x11'));var Redis=require(_0x5ce6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5ce6('0x13'));var as=require(_0x5ce6('0x14'));var hardwareService=require(_0x5ce6('0x15'));var logger=require(_0x5ce6('0x16'))(_0x5ce6('0x17'));var utils=require(_0x5ce6('0x18'));var config=require(_0x5ce6('0x19'));var licenseUtil=require(_0x5ce6('0x1a'));var db=require(_0x5ce6('0x1b'))['db'];var csv_results;config['redis']=_[_0x5ce6('0x1c')](config[_0x5ce6('0x1d')],{'host':_0x5ce6('0x1e'),'port':0x18eb});var socket=require(_0x5ce6('0x1f'))(new Redis(config['redis']));require(_0x5ce6('0x20'))[_0x5ce6('0x21')](socket);function respondWithStatusCode(_0x1f2043,_0x2a9be5){_0x2a9be5=_0x2a9be5||0xcc;return function(_0xf1f58d){if(_0xf1f58d){return _0x1f2043[_0x5ce6('0x22')](_0x2a9be5);}return _0x1f2043[_0x5ce6('0x23')](_0x2a9be5)[_0x5ce6('0x24')]();};}function respondWithResult(_0x1b93cd,_0x3bf14c){_0x3bf14c=_0x3bf14c||0xc8;return function(_0x353fc1){if(_0x353fc1){return _0x1b93cd['status'](_0x3bf14c)[_0x5ce6('0x25')](_0x353fc1);}};}function respondWithFilteredResult(_0x4e12aa,_0x582afa){return function(_0x2f03d3){if(_0x2f03d3){var _0xad842e=typeof _0x582afa[_0x5ce6('0x26')]===_0x5ce6('0x27')&&typeof _0x582afa['limit']===_0x5ce6('0x27');var _0xae403d=_0x2f03d3[_0x5ce6('0x28')];var _0x1ca363=_0xad842e?0x0:_0x582afa[_0x5ce6('0x26')];var _0x1c4d5b=_0xad842e?_0x2f03d3['count']:_0x582afa[_0x5ce6('0x26')]+_0x582afa[_0x5ce6('0x29')];var _0x3516bd;if(_0x1c4d5b>=_0xae403d){_0x1c4d5b=_0xae403d;_0x3516bd=0xc8;}else{_0x3516bd=0xce;}_0x4e12aa[_0x5ce6('0x23')](_0x3516bd);return _0x4e12aa['set'](_0x5ce6('0x2a'),_0x1ca363+'-'+_0x1c4d5b+'/'+_0xae403d)[_0x5ce6('0x25')](_0x2f03d3);}return null;};}function patchUpdates(_0x5d6854){return function(_0x3819fc){try{jsonpatch[_0x5ce6('0x2b')](_0x3819fc,_0x5d6854,!![]);}catch(_0x1b4417){return BPromise['reject'](_0x1b4417);}return _0x3819fc[_0x5ce6('0x2c')]();};}function saveUpdates(_0x521ced,_0x283fbe){return function(_0x291095){if(_0x291095){return _0x291095[_0x5ce6('0x2d')](_0x521ced)[_0x5ce6('0x2e')](function(_0x3a1ac8){return _0x3a1ac8;});}return null;};}function removeEntity(_0x5bdd6f,_0x10b953){return function(_0x11e346){if(_0x11e346){return _0x11e346[_0x5ce6('0x2f')]()[_0x5ce6('0x2e')](function(){var _0xb8bc2c=_0x11e346[_0x5ce6('0x30')]({'plain':!![]});var _0x3ed08f=_0x5ce6('0x31');return db['UserProfileResource'][_0x5ce6('0x2f')]({'where':{'type':_0x3ed08f,'resourceId':_0xb8bc2c['id']}})[_0x5ce6('0x2e')](function(){return _0x11e346;});})[_0x5ce6('0x2e')](function(){_0x5bdd6f[_0x5ce6('0x23')](0xcc)[_0x5ce6('0x24')]();});}};}function handleEntityNotFound(_0x4d2e21,_0x40d7ef){return function(_0x13d11a){if(!_0x13d11a){_0x4d2e21[_0x5ce6('0x22')](0x194);}return _0x13d11a;};}function handleError(_0x2ac8d9,_0x19728c){_0x19728c=_0x19728c||0x1f4;return function(_0x130e37){logger[_0x5ce6('0x32')](_0x130e37['stack']);if(_0x130e37['name']){delete _0x130e37[_0x5ce6('0x33')];}_0x2ac8d9[_0x5ce6('0x23')](_0x19728c)[_0x5ce6('0x34')](_0x130e37);};}exports[_0x5ce6('0x35')]=function(_0x1e0a7f,_0x47d8f7){var _0x1494d3={},_0x76fd48={},_0xef343f={'count':0x0,'rows':[]};var _0x5b88b5=_[_0x5ce6('0x36')](db[_0x5ce6('0x37')][_0x5ce6('0x38')],function(_0x55c8fb){return{'name':_0x55c8fb[_0x5ce6('0x39')],'type':_0x55c8fb[_0x5ce6('0x3a')]['key']};});_0x76fd48[_0x5ce6('0x3b')]=_['map'](_0x5b88b5,_0x5ce6('0x33'));_0x76fd48[_0x5ce6('0x3c')]=_['keys'](_0x1e0a7f['query']);_0x76fd48[_0x5ce6('0x3d')]=_['intersection'](_0x76fd48['model'],_0x76fd48[_0x5ce6('0x3c')]);_0x1494d3[_0x5ce6('0x3e')]=_[_0x5ce6('0x3f')](_0x76fd48[_0x5ce6('0x3b')],qs[_0x5ce6('0x40')](_0x1e0a7f[_0x5ce6('0x3c')][_0x5ce6('0x40')]));_0x1494d3[_0x5ce6('0x3e')]=_0x1494d3[_0x5ce6('0x3e')][_0x5ce6('0x41')]?_0x1494d3[_0x5ce6('0x3e')]:_0x76fd48['model'];if(!_0x1e0a7f[_0x5ce6('0x3c')][_0x5ce6('0x42')]('nolimit')){_0x1494d3['limit']=qs[_0x5ce6('0x29')](_0x1e0a7f[_0x5ce6('0x3c')][_0x5ce6('0x29')]);_0x1494d3[_0x5ce6('0x26')]=qs[_0x5ce6('0x26')](_0x1e0a7f['query'][_0x5ce6('0x26')]);}_0x1494d3['order']=qs[_0x5ce6('0x43')](_0x1e0a7f['query'][_0x5ce6('0x43')]);_0x1494d3[_0x5ce6('0x44')]=qs[_0x5ce6('0x3d')](_[_0x5ce6('0x45')](_0x1e0a7f['query'],_0x76fd48['filters']),_0x5b88b5);if(_0x1e0a7f[_0x5ce6('0x3c')][_0x5ce6('0x46')]){_0x1494d3[_0x5ce6('0x44')]=_[_0x5ce6('0x47')](_0x1494d3[_0x5ce6('0x44')],{'$or':_[_0x5ce6('0x36')](_0x5b88b5,function(_0x521b68){if(_0x521b68[_0x5ce6('0x3a')]!==_0x5ce6('0x48')){var _0xd10038={};_0xd10038[_0x521b68[_0x5ce6('0x33')]]={'$like':'%'+_0x1e0a7f['query'][_0x5ce6('0x46')]+'%'};return _0xd10038;}})});}_0x1494d3=_[_0x5ce6('0x47')]({},_0x1494d3,_0x1e0a7f[_0x5ce6('0x49')]);var _0x4bcfa6={'where':_0x1494d3[_0x5ce6('0x44')]};return db[_0x5ce6('0x37')][_0x5ce6('0x28')](_0x4bcfa6)[_0x5ce6('0x2e')](function(_0x26837d){_0xef343f[_0x5ce6('0x28')]=_0x26837d;if(_0x1e0a7f[_0x5ce6('0x3c')]['includeAll']){_0x1494d3[_0x5ce6('0x4a')]=[{'all':!![]}];}return db[_0x5ce6('0x37')][_0x5ce6('0x4b')](_0x1494d3);})[_0x5ce6('0x2e')](function(_0x4784e1){_0xef343f[_0x5ce6('0x4c')]=_0x4784e1;return _0xef343f;})['then'](respondWithFilteredResult(_0x47d8f7,_0x1494d3))[_0x5ce6('0x4d')](handleError(_0x47d8f7,null));};exports['show']=function(_0x434fdf,_0x263bb4){var _0x2fab64={'raw':![],'where':{'id':_0x434fdf[_0x5ce6('0x4e')]['id']}},_0x299b4a={};_0x299b4a[_0x5ce6('0x3b')]=_[_0x5ce6('0x4f')](db[_0x5ce6('0x37')][_0x5ce6('0x38')]);_0x299b4a[_0x5ce6('0x3c')]=_[_0x5ce6('0x4f')](_0x434fdf[_0x5ce6('0x3c')]);_0x299b4a['filters']=_[_0x5ce6('0x3f')](_0x299b4a['model'],_0x299b4a[_0x5ce6('0x3c')]);_0x2fab64[_0x5ce6('0x3e')]=_[_0x5ce6('0x3f')](_0x299b4a[_0x5ce6('0x3b')],qs[_0x5ce6('0x40')](_0x434fdf[_0x5ce6('0x3c')][_0x5ce6('0x40')]));_0x2fab64[_0x5ce6('0x3e')]=_0x2fab64[_0x5ce6('0x3e')]['length']?_0x2fab64[_0x5ce6('0x3e')]:_0x299b4a[_0x5ce6('0x3b')];if(_0x434fdf[_0x5ce6('0x3c')][_0x5ce6('0x50')]){_0x2fab64['include']=[{'all':!![]}];}_0x2fab64=_[_0x5ce6('0x47')]({},_0x2fab64,_0x434fdf[_0x5ce6('0x49')]);return db[_0x5ce6('0x37')][_0x5ce6('0x51')](_0x2fab64)[_0x5ce6('0x2e')](handleEntityNotFound(_0x263bb4,null))[_0x5ce6('0x2e')](respondWithResult(_0x263bb4,null))[_0x5ce6('0x4d')](handleError(_0x263bb4,null));};exports['create']=function(_0x13b552,_0x212519){return db[_0x5ce6('0x37')][_0x5ce6('0x52')](_0x13b552['body'],{})[_0x5ce6('0x2e')](function(_0x8d3a1f){var _0x3e8cc7=_0x13b552[_0x5ce6('0x53')]['get']({'plain':!![]});if(!_0x3e8cc7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e8cc7['role']===_0x5ce6('0x53')){var _0x2753ab=_0x8d3a1f[_0x5ce6('0x30')]({'plain':!![]});var _0x3570b5='Lists';return db[_0x5ce6('0x54')][_0x5ce6('0x51')]({'where':{'name':_0x3570b5,'userProfileId':_0x3e8cc7['userProfileId']},'raw':!![]})[_0x5ce6('0x2e')](function(_0x4e5fe4){if(_0x4e5fe4&&_0x4e5fe4[_0x5ce6('0x55')]===0x0){return db['UserProfileResource'][_0x5ce6('0x52')]({'name':_0x2753ab[_0x5ce6('0x33')],'resourceId':_0x2753ab['id'],'type':_0x4e5fe4[_0x5ce6('0x33')],'sectionId':_0x4e5fe4['id']},{})['then'](function(){return _0x8d3a1f;});}else{return _0x8d3a1f;}})[_0x5ce6('0x4d')](function(_0x32aaa0){logger['error'](_0x5ce6('0x56'),_0x32aaa0);throw _0x32aaa0;});}return _0x8d3a1f;})[_0x5ce6('0x2e')](respondWithResult(_0x212519,0xc9))[_0x5ce6('0x4d')](handleError(_0x212519,null));};exports[_0x5ce6('0x2d')]=function(_0x91eaee,_0x3ef31e){if(_0x91eaee['body']['id']){delete _0x91eaee[_0x5ce6('0x57')]['id'];}return db[_0x5ce6('0x37')][_0x5ce6('0x51')]({'where':{'id':_0x91eaee[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x3ef31e,null))[_0x5ce6('0x2e')](saveUpdates(_0x91eaee['body'],null))['then'](respondWithResult(_0x3ef31e,null))[_0x5ce6('0x4d')](handleError(_0x3ef31e,null));};exports[_0x5ce6('0x2f')]=function(_0x5815f6,_0x19e063){return db['CmList']['find']({'where':{'id':_0x5815f6[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x19e063,null))[_0x5ce6('0x2e')](removeEntity(_0x19e063,null))[_0x5ce6('0x4d')](handleError(_0x19e063,null));};exports[_0x5ce6('0x58')]=function(_0x2dbae3,_0x53d223){return db[_0x5ce6('0x37')][_0x5ce6('0x58')]()[_0x5ce6('0x2e')](respondWithResult(_0x53d223,null))[_0x5ce6('0x4d')](handleError(_0x53d223,null));};exports[_0x5ce6('0x59')]=function(_0x14fe52,_0x3e3557,_0x2f979e){if(_0x14fe52[_0x5ce6('0x57')]['id']){delete _0x14fe52[_0x5ce6('0x57')]['id'];}return db[_0x5ce6('0x37')][_0x5ce6('0x51')]({'where':{'id':_0x14fe52[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x3e3557,null))[_0x5ce6('0x2e')](function(_0x421130){if(_0x421130){_0x14fe52[_0x5ce6('0x57')][_0x5ce6('0x5a')]=_0x421130['id'];return db['Disposition']['create'](_0x14fe52['body']);}})[_0x5ce6('0x2e')](respondWithResult(_0x3e3557,null))[_0x5ce6('0x4d')](handleError(_0x3e3557,null));};exports[_0x5ce6('0x5b')]=function(_0x3e7cf1,_0x1f950b,_0x34c948){var _0x30f9d5={'raw':![],'where':{}};var _0x3f6a04={};var _0x50eafb={'count':0x0,'rows':[]};return db[_0x5ce6('0x37')]['findOne']({'where':{'id':_0x3e7cf1['params']['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x1f950b,null))[_0x5ce6('0x2e')](function(_0x41c2d5){if(_0x41c2d5){_0x3f6a04[_0x5ce6('0x3b')]=_[_0x5ce6('0x4f')](db[_0x5ce6('0x5c')]['rawAttributes']);_0x3f6a04[_0x5ce6('0x3c')]=_[_0x5ce6('0x4f')](_0x3e7cf1[_0x5ce6('0x3c')]);_0x3f6a04[_0x5ce6('0x3d')]=_[_0x5ce6('0x3f')](_0x3f6a04[_0x5ce6('0x3b')],_0x3f6a04['query']);_0x30f9d5[_0x5ce6('0x3e')]=_[_0x5ce6('0x3f')](_0x3f6a04['model'],qs['fields'](_0x3e7cf1[_0x5ce6('0x3c')]['fields']));_0x30f9d5[_0x5ce6('0x3e')]=_0x30f9d5['attributes'][_0x5ce6('0x41')]?_0x30f9d5[_0x5ce6('0x3e')]:_0x3f6a04[_0x5ce6('0x3b')];if(!_0x3e7cf1[_0x5ce6('0x3c')][_0x5ce6('0x42')]('nolimit')){_0x30f9d5[_0x5ce6('0x29')]=qs['limit'](_0x3e7cf1[_0x5ce6('0x3c')][_0x5ce6('0x29')]);_0x30f9d5[_0x5ce6('0x26')]=qs[_0x5ce6('0x26')](_0x3e7cf1[_0x5ce6('0x3c')][_0x5ce6('0x26')]);}_0x30f9d5[_0x5ce6('0x5d')]=qs[_0x5ce6('0x43')](_0x3e7cf1['query'][_0x5ce6('0x43')]);_0x30f9d5[_0x5ce6('0x44')]=qs['filters'](_[_0x5ce6('0x45')](_0x3e7cf1['query'],_0x3f6a04[_0x5ce6('0x3d')]));_0x30f9d5[_0x5ce6('0x44')][_0x5ce6('0x5a')]=_0x41c2d5['id'];if(_0x3e7cf1['query'][_0x5ce6('0x46')]){_0x30f9d5['where']=_[_0x5ce6('0x47')](_0x30f9d5[_0x5ce6('0x44')],{'$or':_[_0x5ce6('0x36')](_0x30f9d5['attributes'],function(_0x43e51){var _0x18a18b={};_0x18a18b[_0x43e51]={'$like':'%'+_0x3e7cf1[_0x5ce6('0x3c')]['filter']+'%'};return _0x18a18b;})});}_0x30f9d5=_[_0x5ce6('0x47')]({},_0x30f9d5,_0x3e7cf1[_0x5ce6('0x49')]);return db[_0x5ce6('0x5c')][_0x5ce6('0x28')]({'where':_0x30f9d5['where']})[_0x5ce6('0x2e')](function(_0x59ec13){_0x50eafb[_0x5ce6('0x28')]=_0x59ec13;if(_0x3e7cf1[_0x5ce6('0x3c')][_0x5ce6('0x50')]){_0x30f9d5[_0x5ce6('0x4a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x30f9d5);})['then'](function(_0x4a3305){_0x50eafb[_0x5ce6('0x4c')]=_0x4a3305;return _0x50eafb;});}})['then'](respondWithFilteredResult(_0x1f950b,_0x30f9d5))['catch'](handleError(_0x1f950b,null));};exports[_0x5ce6('0x5e')]=function(_0xc8098b,_0x12556f,_0x11ae7b){return db['CmList'][_0x5ce6('0x51')]({'where':{'id':_0xc8098b[_0x5ce6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x12556f,null))[_0x5ce6('0x2e')](function(_0x5f1d7a){if(_0x5f1d7a){return _0x5f1d7a['removeDispositions'](_0xc8098b[_0x5ce6('0x3c')][_0x5ce6('0x5f')]);}})[_0x5ce6('0x2e')](respondWithStatusCode(_0x12556f,null))[_0x5ce6('0x4d')](handleError(_0x12556f,null));};exports[_0x5ce6('0x60')]=function(_0x481afa,_0x293385,_0x3113f7){return db['CmList']['find']({'where':{'id':_0x481afa[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x293385,null))[_0x5ce6('0x2e')](function(_0x1dd47d){if(_0x1dd47d){var _0x369dda=[];var _0x177c9d={'success':[],'errors':[]};return db[_0x5ce6('0x61')][_0x5ce6('0x58')]()['then'](function(_0x31e23a){if(_0x481afa[_0x5ce6('0x57')][_0x5ce6('0x62')]&&_['isArray'](_0x481afa[_0x5ce6('0x57')]['tags'])){if(_0x481afa[_0x5ce6('0x57')]['tags']['length']){_0x481afa['body'][_0x5ce6('0x62')]=_0x481afa[_0x5ce6('0x57')][_0x5ce6('0x62')]['join'](';')+';';}else{_0x481afa[_0x5ce6('0x57')][_0x5ce6('0x62')]=null;}}else{_0x481afa[_0x5ce6('0x57')][_0x5ce6('0x62')]=null;}if(_0x481afa[_0x5ce6('0x57')]&&_[_0x5ce6('0x63')](_0x481afa[_0x5ce6('0x57')])){for(var _0x238f5e=0x0;_0x238f5e<_0x481afa[_0x5ce6('0x57')][_0x5ce6('0x41')];_0x238f5e+=0x1){_0x481afa['body'][_0x238f5e][_0x5ce6('0x5a')]=_0x481afa['params']['id'];_0x369dda[_0x5ce6('0x64')](_0x481afa[_0x5ce6('0x57')][_0x238f5e]);}return BPromise[_0x5ce6('0x65')](_0x369dda,function(_0xabac00){return db[_0x5ce6('0x61')][_0x5ce6('0x52')](_['omit'](_0xabac00,['ids','id'])||{},{'fields':_[_0x5ce6('0x4f')](_0x31e23a),'raw':!![]})[_0x5ce6('0x2e')](function(_0x7df11a){_0x177c9d['success'][_0x5ce6('0x64')](_0x7df11a[_0x5ce6('0x66')]);})['catch'](function(_0x3ef025){_0x177c9d[_0x5ce6('0x67')][_0x5ce6('0x64')]({'data':_0xabac00,'error':_0x3ef025[_0x5ce6('0x68')]});});})[_0x5ce6('0x2e')](function(_0x6dafaa){return _0x177c9d;})[_0x5ce6('0x4d')](function(_0x29a6ce){return _0x29a6ce;});}else{_0x293385['status'](0x190)[_0x5ce6('0x25')]({'message':_0x5ce6('0x69')});}});}})['then'](respondWithResult(_0x293385,null))[_0x5ce6('0x4d')](handleError(_0x293385,null));};exports['getContacts']=function(_0x25b90d,_0x128476,_0x49f42e){var _0x39d770;return db[_0x5ce6('0x37')][_0x5ce6('0x51')]({'where':{'id':_0x25b90d[_0x5ce6('0x4e')]['id']},'include':[{'model':db[_0x5ce6('0x6a')],'as':_0x5ce6('0x6b')}]})[_0x5ce6('0x2e')](handleEntityNotFound(_0x128476,null))[_0x5ce6('0x2e')](function(_0x5c9ac9){if(_0x5c9ac9){_0x39d770=_0x5c9ac9;return db[_0x5ce6('0x61')][_0x5ce6('0x38')];}})['then'](function(_0x52949b){if(_0x52949b){var _0x17ed09={};var _0x5d1ff1={};_0x5d1ff1[_0x5ce6('0x3b')]=_[_0x5ce6('0x6c')](_[_0x5ce6('0x4f')](_0x52949b),_['map'](_0x39d770[_0x5ce6('0x6b')],function(_0x547e4a){return util['format'](_0x5ce6('0x6d'),_0x547e4a['id']);}));_0x5d1ff1[_0x5ce6('0x3c')]=_[_0x5ce6('0x4f')](_0x25b90d[_0x5ce6('0x3c')]);_0x5d1ff1[_0x5ce6('0x3d')]=_[_0x5ce6('0x3f')](_0x5d1ff1[_0x5ce6('0x3b')],_0x5d1ff1[_0x5ce6('0x3c')]);_0x17ed09[_0x5ce6('0x3e')]=_[_0x5ce6('0x3f')](_0x5d1ff1[_0x5ce6('0x3b')],qs[_0x5ce6('0x40')](_0x25b90d[_0x5ce6('0x3c')]['fields']));_0x17ed09['attributes']=_0x17ed09['attributes']['length']?_0x17ed09[_0x5ce6('0x3e')]:_0x5d1ff1[_0x5ce6('0x3b')];if(!_0x25b90d[_0x5ce6('0x3c')]['hasOwnProperty']('nolimit')){_0x17ed09[_0x5ce6('0x29')]=qs[_0x5ce6('0x29')](_0x25b90d[_0x5ce6('0x3c')]['limit']);_0x17ed09[_0x5ce6('0x26')]=qs[_0x5ce6('0x26')](_0x25b90d[_0x5ce6('0x3c')][_0x5ce6('0x26')]);}_0x17ed09['order']=qs[_0x5ce6('0x43')](_0x25b90d[_0x5ce6('0x3c')]['sort']);_0x17ed09[_0x5ce6('0x44')]=qs[_0x5ce6('0x3d')](_[_0x5ce6('0x45')](_0x25b90d['query'],_0x5d1ff1[_0x5ce6('0x3d')]));_0x17ed09[_0x5ce6('0x6e')]=!![];if(_0x25b90d[_0x5ce6('0x3c')][_0x5ce6('0x46')]){_0x17ed09['where']=_[_0x5ce6('0x47')](_0x17ed09[_0x5ce6('0x44')],{'$or':_[_0x5ce6('0x36')](_0x17ed09['attributes'],function(_0xea637a){var _0x5dc351={};_0x5dc351[_0xea637a]={'$like':'%'+_0x25b90d[_0x5ce6('0x3c')][_0x5ce6('0x46')]+'%'};return _0x5dc351;})});}_0x17ed09=_[_0x5ce6('0x47')]({},_0x17ed09,_0x25b90d[_0x5ce6('0x49')]);return _0x39d770[_0x5ce6('0x6f')](_0x17ed09);}})[_0x5ce6('0x2e')](respondWithResult(_0x128476,null))[_0x5ce6('0x4d')](handleError(_0x128476,null));};exports[_0x5ce6('0x70')]=function(_0x2ba23a,_0x15042b,_0x4d6987){var _0x1b975f;var _0x1a6cbe;var _0x567a7a;var _0x5b5d22=_0x2ba23a[_0x5ce6('0x4e')]['id'];csv_results=[];return db[_0x5ce6('0x71')][_0x5ce6('0x4b')]({'attributes':['id','name'],'raw':!![],'order':[_0x5ce6('0x72')]})[_0x5ce6('0x2e')](function(_0x222b10){_0x1b975f=_0x222b10;var _0x11a6c3=_[_0x5ce6('0x4f')](db[_0x5ce6('0x61')][_0x5ce6('0x38')]);return db[_0x5ce6('0x6a')][_0x5ce6('0x4b')]({'raw':!![],'attributes':['id',_0x5ce6('0x73')]})[_0x5ce6('0x2e')](function(_0x43779c){_0x1a6cbe=_0x43779c;var _0x27121d=squel['select']()['fields'](_0x11a6c3)['from']('cm_contacts','c')[_0x5ce6('0x44')](_0x5ce6('0x74'),_0x5b5d22)['where'](_0x5ce6('0x75'))[_0x5ce6('0x76')]();for(var _0x185f48=0x0;_0x185f48<_0x1a6cbe['length'];_0x185f48++){_0x27121d[_0x5ce6('0x77')](_0x5ce6('0x78')+_0x1a6cbe[_0x185f48]['id'],_0x5ce6('0x79')+_0x1a6cbe[_0x185f48][_0x5ce6('0x73')]);}for(var _0x185f48=0x0;_0x185f48<_0x1b975f[_0x5ce6('0x41')];_0x185f48++){_0x27121d[_0x5ce6('0x77')](squel[_0x5ce6('0x7a')]()['field'](_0x5ce6('0x7b'))[_0x5ce6('0x7c')]('cm_contact_has_items')[_0x5ce6('0x44')](_0x5ce6('0x7d'),_0x1b975f[_0x185f48]['id'])['where'](_0x5ce6('0x7e')),_0x5ce6('0x7f')+_0x1b975f[_0x185f48][_0x5ce6('0x33')]);_0x27121d[_0x5ce6('0x77')](squel['select']()[_0x5ce6('0x77')](_0x5ce6('0x80'))[_0x5ce6('0x7c')](_0x5ce6('0x81'))['where'](_0x5ce6('0x7d'),_0x1b975f[_0x185f48]['id'])[_0x5ce6('0x44')](_0x5ce6('0x7e')),_0x5ce6('0x82')+_0x1b975f[_0x185f48][_0x5ce6('0x33')]);}var _0x59ad50=[];_0x59ad50['push'](_0x27121d[_0x5ce6('0x83')]());BPromise[_0x5ce6('0x65')](_0x59ad50,handleQuery)[_0x5ce6('0x2e')](function(_0x320c92){handleQuery(_0x27121d['toString']());var _0x51a591=csv_results[0x0];if(!_['isEmpty'](_0x51a591)){var _0x3bd686=toCsv(_0x51a591);var _0x340830=Date[_0x5ce6('0x84')]();fs[_0x5ce6('0x85')](util[_0x5ce6('0x86')]('/tmp/list_%d_%s.csv',_0x5b5d22,_0x340830),_0x3bd686);_0x15042b[_0x5ce6('0x87')]('Content-disposition',_0x5ce6('0x88')+util[_0x5ce6('0x86')](_0x5ce6('0x89'),_0x5b5d22,_0x340830));_0x15042b[_0x5ce6('0x87')](_0x5ce6('0x8a'),_0x5ce6('0x8b'));return _0x15042b['download'](util['format'](_0x5ce6('0x8c'),_0x5b5d22,_0x340830));}else{return _0x15042b[_0x5ce6('0x22')](0xcc);}});});});};exports[_0x5ce6('0x8d')]=function(_0x2a345b,_0x5d5ee9,_0x550ada){var _0x4415c3;delete _0x2a345b[_0x5ce6('0x57')]['id'];return db['CmList'][_0x5ce6('0x8e')]({'where':{'id':_0x2a345b[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x5d5ee9,null))[_0x5ce6('0x2e')](function(_0x2e6312){if(_0x2e6312){return db['sequelize']['transaction'](function(_0x19c537){return db[_0x5ce6('0x6a')][_0x5ce6('0x52')](_0x2a345b['body'],{'transaction':_0x19c537})[_0x5ce6('0x2e')](function(_0x4c005d){_0x4415c3=_0x4c005d;return _0x2e6312[_0x5ce6('0x8f')](_0x4c005d,{'transaction':_0x19c537});})[_0x5ce6('0x2e')](function(){var _0x29e764={'type':db['Sequelize'][_0x5ce6('0x90')],'transaction':_0x19c537};switch(_0x2a345b[_0x5ce6('0x57')][_0x5ce6('0x3a')]){case'text':_0x29e764['type']=db[_0x5ce6('0x91')]['TEXT'];break;case _0x5ce6('0x92'):_0x29e764[_0x5ce6('0x3a')]=db[_0x5ce6('0x91')][_0x5ce6('0x93')];break;case'switch':_0x29e764[_0x5ce6('0x3a')]=db[_0x5ce6('0x91')]['BOOLEAN'];_0x29e764[_0x5ce6('0x94')]=![];break;default:}return db['sequelize'][_0x5ce6('0x95')][_0x5ce6('0x96')](_0x5ce6('0x97'),util['format'](_0x5ce6('0x98'),_0x4415c3['id']),_0x29e764);})['then'](function(){return _0x4415c3;});});}})['then'](respondWithResult(_0x5d5ee9,null))['catch'](handleError(_0x5d5ee9,null));};exports[_0x5ce6('0x99')]=function(_0x5a8fdd,_0x489712,_0x280931){var _0x2a446e={};var _0x31a35d={};var _0x57ef05;var _0x20132a;return db[_0x5ce6('0x37')][_0x5ce6('0x8e')]({'where':{'id':_0x5a8fdd[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x489712,null))[_0x5ce6('0x2e')](function(_0x387140){if(_0x387140){_0x57ef05=_0x387140;_0x31a35d['model']=_[_0x5ce6('0x4f')](db[_0x5ce6('0x6a')]['rawAttributes']);_0x31a35d[_0x5ce6('0x3c')]=_[_0x5ce6('0x4f')](_0x5a8fdd[_0x5ce6('0x3c')]);_0x31a35d[_0x5ce6('0x3d')]=_['intersection'](_0x31a35d[_0x5ce6('0x3b')],_0x31a35d['query']);_0x2a446e[_0x5ce6('0x3e')]=_[_0x5ce6('0x3f')](_0x31a35d[_0x5ce6('0x3b')],qs[_0x5ce6('0x40')](_0x5a8fdd[_0x5ce6('0x3c')][_0x5ce6('0x40')]));_0x2a446e[_0x5ce6('0x3e')]=_0x2a446e['attributes'][_0x5ce6('0x41')]?_0x2a446e[_0x5ce6('0x3e')]:_0x31a35d[_0x5ce6('0x3b')];_0x2a446e[_0x5ce6('0x5d')]=qs[_0x5ce6('0x43')](_0x5a8fdd[_0x5ce6('0x3c')][_0x5ce6('0x43')]);_0x2a446e['where']=qs[_0x5ce6('0x3d')](_[_0x5ce6('0x45')](_0x5a8fdd['query'],_0x31a35d[_0x5ce6('0x3d')]));_0x2a446e['where']=_[_0x5ce6('0x47')](_0x2a446e['where'],{'$or':[{'ListId':_0x387140['id']},{'ListId':null}]});if(_0x5a8fdd['query']['filter']){_0x2a446e[_0x5ce6('0x44')]=_[_0x5ce6('0x47')](_0x2a446e[_0x5ce6('0x44')],{'$or':_[_0x5ce6('0x36')](_0x2a446e[_0x5ce6('0x3e')],function(_0x13b8c3){var _0x127114={};_0x127114[_0x13b8c3]={'$like':'%'+_0x5a8fdd['query'][_0x5ce6('0x46')]+'%'};return _0x127114;})});}_0x2a446e=_[_0x5ce6('0x47')]({},_0x2a446e,_0x5a8fdd[_0x5ce6('0x49')]);return db[_0x5ce6('0x6a')]['findAndCountAll'](_0x2a446e);}})[_0x5ce6('0x2e')](respondWithResult(_0x489712,null))[_0x5ce6('0x4d')](handleError(_0x489712,null));};exports[_0x5ce6('0x9a')]=function(_0x417ad1,_0x8fae22){return db[_0x5ce6('0x6a')][_0x5ce6('0x9b')]({'where':{'ListId':null}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x8fae22,null))['then'](function(_0xc257f0){return _0xc257f0;})[_0x5ce6('0x2e')](respondWithResult(_0x8fae22,null))[_0x5ce6('0x4d')](handleError(_0x8fae22,null));};exports[_0x5ce6('0x9c')]=function(_0x27083b,_0x4f3da0,_0xef484d){return db[_0x5ce6('0x37')]['find']({'where':{'id':_0x27083b[_0x5ce6('0x4e')]['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x4f3da0,null))[_0x5ce6('0x2e')](function(_0x3aeb34){if(_0x3aeb34){return _0x3aeb34[_0x5ce6('0x9c')](_0x27083b['body']['ids'],_['omit'](_0x27083b[_0x5ce6('0x57')],[_0x5ce6('0x5f'),'id'])||{})[_0x5ce6('0x9d')](function(_0x12dd66){for(var _0x189152=0x0;_0x189152<_0x27083b[_0x5ce6('0x57')][_0x5ce6('0x5f')][_0x5ce6('0x41')];_0x189152+=0x1){socket[_0x5ce6('0x9e')](_0x5ce6('0x9f'),{'UserId':Number(_0x27083b[_0x5ce6('0x57')]['ids'][_0x189152]),'CmListId':Number(_0x27083b['params']['id'])});}return _0x12dd66;});}})['then'](respondWithResult(_0x4f3da0,null))[_0x5ce6('0x4d')](handleError(_0x4f3da0,null));};exports[_0x5ce6('0xa0')]=function(_0x120011,_0x185e25,_0x437703){return db[_0x5ce6('0x37')]['find']({'where':{'id':_0x120011['params']['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x185e25,null))['then'](function(_0x2b6274){if(_0x2b6274){return _0x2b6274[_0x5ce6('0xa0')](_0x120011[_0x5ce6('0x3c')]['ids'])[_0x5ce6('0x2e')](function(){if(_[_0x5ce6('0x63')](_0x120011['query'][_0x5ce6('0x5f')])){for(var _0x26110a=0x0;_0x26110a<_0x120011[_0x5ce6('0x3c')][_0x5ce6('0x5f')][_0x5ce6('0x41')];_0x26110a+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x120011['query'][_0x5ce6('0x5f')][_0x26110a]),'CmListId':Number(_0x120011[_0x5ce6('0x4e')]['id'])});}}else{socket[_0x5ce6('0x9e')](_0x5ce6('0xa1'),{'UserId':Number(_0x120011[_0x5ce6('0x3c')][_0x5ce6('0x5f')]),'CmListId':Number(_0x120011[_0x5ce6('0x4e')]['id'])});}});}})[_0x5ce6('0x2e')](respondWithStatusCode(_0x185e25,null))[_0x5ce6('0x4d')](handleError(_0x185e25,null));};exports[_0x5ce6('0xa2')]=function(_0x239fd2,_0x558612,_0x10ab52){var _0x16a64d={};var _0x4fd314={};var _0x2617b3;var _0x377d80;return db[_0x5ce6('0x37')][_0x5ce6('0x8e')]({'where':{'id':_0x239fd2['params']['id']}})[_0x5ce6('0x2e')](handleEntityNotFound(_0x558612,null))[_0x5ce6('0x2e')](function(_0x31eefb){if(_0x31eefb){_0x2617b3=_0x31eefb;_0x4fd314[_0x5ce6('0x3b')]=_[_0x5ce6('0x4f')](db[_0x5ce6('0xa3')]['rawAttributes']);_0x4fd314[_0x5ce6('0x3c')]=_[_0x5ce6('0x4f')](_0x239fd2[_0x5ce6('0x3c')]);_0x4fd314[_0x5ce6('0x3d')]=_['intersection'](_0x4fd314['model'],_0x4fd314[_0x5ce6('0x3c')]);_0x16a64d['attributes']=_[_0x5ce6('0x3f')](_0x4fd314[_0x5ce6('0x3b')],qs['fields'](_0x239fd2[_0x5ce6('0x3c')][_0x5ce6('0x40')]));_0x16a64d[_0x5ce6('0x3e')]=_0x16a64d['attributes'][_0x5ce6('0x41')]?_0x16a64d[_0x5ce6('0x3e')]:_0x4fd314[_0x5ce6('0x3b')];_0x16a64d[_0x5ce6('0x5d')]=qs[_0x5ce6('0x43')](_0x239fd2[_0x5ce6('0x3c')]['sort']);_0x16a64d['where']=qs[_0x5ce6('0x3d')](_[_0x5ce6('0x45')](_0x239fd2['query'],_0x4fd314['filters']));if(_0x239fd2[_0x5ce6('0x3c')][_0x5ce6('0x46')]){_0x16a64d[_0x5ce6('0x44')]=_['merge'](_0x16a64d['where'],{'$or':_['map'](_0x16a64d[_0x5ce6('0x3e')],function(_0x3e9c18){var _0x3203a9={};_0x3203a9[_0x3e9c18]={'$like':'%'+_0x239fd2[_0x5ce6('0x3c')]['filter']+'%'};return _0x3203a9;})});}_0x16a64d=_[_0x5ce6('0x47')]({},_0x16a64d,_0x239fd2['options']);return _0x2617b3[_0x5ce6('0xa2')](_0x16a64d);}})[_0x5ce6('0x2e')](function(_0x1c856d){if(_0x1c856d){_0x377d80=_0x1c856d[_0x5ce6('0x41')];if(!_0x239fd2[_0x5ce6('0x3c')]['hasOwnProperty'](_0x5ce6('0xa4'))){_0x16a64d[_0x5ce6('0x29')]=qs[_0x5ce6('0x29')](_0x239fd2[_0x5ce6('0x3c')][_0x5ce6('0x29')]);_0x16a64d[_0x5ce6('0x26')]=qs[_0x5ce6('0x26')](_0x239fd2['query'][_0x5ce6('0x26')]);}return _0x2617b3['getAgents'](_0x16a64d);}})[_0x5ce6('0x2e')](function(_0x409771){if(_0x409771){return _0x409771?{'count':_0x377d80,'rows':_0x409771}:null;}})[_0x5ce6('0x2e')](respondWithResult(_0x558612,null))[_0x5ce6('0x4d')](handleError(_0x558612,null));};function handleQuery(_0x142983){logger[_0x5ce6('0xa5')](_0x142983);return db[_0x5ce6('0xa6')][_0x5ce6('0x3c')](_0x142983)['spread'](function(_0xb1e07b){csv_results['push'](_0xb1e07b);})[_0x5ce6('0x4d')](function(_0x443fe7){logger['error'](_0x443fe7[_0x5ce6('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index f9aead1..5589fea 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1d1b12,_0x22604b){var _0x5f26c8=function(_0x42c78d){while(--_0x42c78d){_0x1d1b12['push'](_0x1d1b12['shift']());}};_0x5f26c8(++_0x22604b);}(_0x814b,0x1a2));var _0xb814=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x814b[_0x9a7ea6];return _0x1c2040;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x157d67,_0xe5c888){_0x157d67=_0x157d67-0x0;var _0x156176=_0x326f[_0x157d67];return _0x156176;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ba48bd5..4cfb6f7 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 _0x750a=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','moment','bluebird','request-promise'];(function(_0x1d73ab,_0x4db32c){var _0x2ed1df=function(_0x245cc6){while(--_0x245cc6){_0x1d73ab['push'](_0x1d73ab['shift']());}};_0x2ed1df(++_0x4db32c);}(_0x750a,0x140));var _0xa750=function(_0x1b1ad8,_0x2a4b7c){_0x1b1ad8=_0x1b1ad8-0x0;var _0x2bc059=_0x750a[_0x1b1ad8];return _0x2bc059;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x10682f,_0x56a846){var _0x3fa3b0=function(_0x1104cb){while(--_0x1104cb){_0x10682f['push'](_0x10682f['shift']());}};_0x3fa3b0(++_0x56a846);}(_0x5ff3,0x17d));var _0x35ff=function(_0x52f1df,_0x141e78){_0x52f1df=_0x52f1df-0x0;var _0x29bd13=_0x5ff3[_0x52f1df];return _0x29bd13;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'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 1de9561..ce9058b 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 _0xd3fb=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','request\x20sent','debug','stringify','error','CmList,\x20%s,\x20%s','message'];(function(_0x45f426,_0x1db67b){var _0x3d1326=function(_0x1514a7){while(--_0x1514a7){_0x45f426['push'](_0x45f426['shift']());}};_0x3d1326(++_0x1db67b);}(_0xd3fb,0x17d));var _0xbd3f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd3fb[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xbd3f('0x0'));var moment=require(_0xbd3f('0x1'));var BPromise=require(_0xbd3f('0x2'));var rs=require(_0xbd3f('0x3'));var fs=require('fs');var Redis=require(_0xbd3f('0x4'));var db=require(_0xbd3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd3f('0x6'))(_0xbd3f('0x7'));var config=require(_0xbd3f('0x8'));var jayson=require(_0xbd3f('0x9'));var client=jayson[_0xbd3f('0xa')][_0xbd3f('0xb')]({'port':0x232a});config[_0xbd3f('0xc')]=_[_0xbd3f('0xd')](config[_0xbd3f('0xc')],{'host':_0xbd3f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd3f('0xc')]));require(_0xbd3f('0xf'))[_0xbd3f('0x10')](socket);function respondWithRpcPromise(_0x21f630,_0x1147b3,_0x578d81){return new BPromise(function(_0x506fd0,_0x318e01){return client[_0xbd3f('0x11')](_0x21f630,_0x578d81)['then'](function(_0x38015c){logger['info']('CmList,\x20%s,\x20%s',_0x1147b3,_0xbd3f('0x12'));logger[_0xbd3f('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x1147b3,_0xbd3f('0x12'),JSON[_0xbd3f('0x14')](_0x38015c));if(_0x38015c['error']){if(_0x38015c[_0xbd3f('0x15')]['code']===0x1f4){logger['error'](_0xbd3f('0x16'),_0x1147b3,_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);return _0x318e01(_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);}logger[_0xbd3f('0x15')]('CmList,\x20%s,\x20%s',_0x1147b3,_0x38015c[_0xbd3f('0x15')]['message']);return _0x506fd0(_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);}else{logger[_0xbd3f('0x18')](_0xbd3f('0x16'),_0x1147b3,_0xbd3f('0x12'));_0x506fd0(_0x38015c[_0xbd3f('0x19')][_0xbd3f('0x17')]);}})[_0xbd3f('0x1a')](function(_0x457332){logger['error']('CmList,\x20%s,\x20%s',_0x1147b3,_0x457332);_0x318e01(_0x457332);});});} \ No newline at end of file +var _0x1d10=['moment','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x1f20bc,_0x539966){var _0x2849ab=function(_0x4f7e0a){while(--_0x4f7e0a){_0x1f20bc['push'](_0x1f20bc['shift']());}};_0x2849ab(++_0x539966);}(_0x1d10,0x196));var _0x01d1=function(_0x4ad997,_0x195752){_0x4ad997=_0x4ad997-0x0;var _0x3372ca=_0x1d10[_0x4ad997];return _0x3372ca;};'use strict';var _=require(_0x01d1('0x0'));var util=require(_0x01d1('0x1'));var moment=require(_0x01d1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01d1('0x3'));var db=require(_0x01d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x01d1('0x5'))(_0x01d1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01d1('0x7')][_0x01d1('0x8')]({'port':0x232a});config[_0x01d1('0x9')]=_[_0x01d1('0xa')](config['redis'],{'host':_0x01d1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x01d1('0xc')](socket);function respondWithRpcPromise(_0x1cefc9,_0x4b875a,_0x546fd4){return new BPromise(function(_0x50cf43,_0x56a611){return client[_0x01d1('0xd')](_0x1cefc9,_0x546fd4)[_0x01d1('0xe')](function(_0x5ffd26){logger[_0x01d1('0xf')]('CmList,\x20%s,\x20%s',_0x4b875a,_0x01d1('0x10'));logger[_0x01d1('0x11')](_0x01d1('0x12'),_0x4b875a,_0x01d1('0x10'),JSON[_0x01d1('0x13')](_0x5ffd26));if(_0x5ffd26[_0x01d1('0x14')]){if(_0x5ffd26[_0x01d1('0x14')]['code']===0x1f4){logger[_0x01d1('0x14')](_0x01d1('0x15'),_0x4b875a,_0x5ffd26['error'][_0x01d1('0x16')]);return _0x56a611(_0x5ffd26[_0x01d1('0x14')][_0x01d1('0x16')]);}logger['error'](_0x01d1('0x15'),_0x4b875a,_0x5ffd26[_0x01d1('0x14')][_0x01d1('0x16')]);return _0x50cf43(_0x5ffd26['error'][_0x01d1('0x16')]);}else{logger[_0x01d1('0xf')](_0x01d1('0x15'),_0x4b875a,_0x01d1('0x10'));_0x50cf43(_0x5ffd26['result'][_0x01d1('0x16')]);}})[_0x01d1('0x17')](function(_0x21142c){logger[_0x01d1('0x14')]('CmList,\x20%s,\x20%s',_0x4b875a,_0x21142c);_0x56a611(_0x21142c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 121d571..325f64e 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 _0x4770=['register','cmList:','save','update','removeListener'];(function(_0x1d2a74,_0x5ec11c){var _0x2c937a=function(_0x165eb1){while(--_0x165eb1){_0x1d2a74['push'](_0x1d2a74['shift']());}};_0x2c937a(++_0x5ec11c);}(_0x4770,0xf2));var _0x0477=function(_0x223124,_0x5607d3){_0x223124=_0x223124-0x0;var _0x391c38=_0x4770[_0x223124];return _0x391c38;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x0477('0x0'),'remove',_0x0477('0x1')];function createListener(_0x35bbee,_0x4f354f){return function(_0x2ee803){_0x4f354f['emit'](_0x35bbee,_0x2ee803);};}function removeListener(_0x11f522,_0x3d4c46){return function(){CmListEvents[_0x0477('0x2')](_0x11f522,_0x3d4c46);};}exports[_0x0477('0x3')]=function(_0x373e35){for(var _0x40c4d5=0x0,_0x2e0f58=events['length'];_0x40c4d5<_0x2e0f58;_0x40c4d5++){var _0x1c366e=events[_0x40c4d5];var _0x2701a6=createListener(_0x0477('0x4')+_0x1c366e,_0x373e35);CmListEvents['on'](_0x1c366e,_0x2701a6);}}; \ No newline at end of file +var _0xb815=['emit','register','length','cmList:','./cmList.events','save'];(function(_0x326b91,_0x4b11e9){var _0x525073=function(_0x152d85){while(--_0x152d85){_0x326b91['push'](_0x326b91['shift']());}};_0x525073(++_0x4b11e9);}(_0xb815,0x160));var _0x5b81=function(_0x4f3e52,_0x3325b5){_0x4f3e52=_0x4f3e52-0x0;var _0x3c0716=_0xb815[_0x4f3e52];return _0x3c0716;};'use strict';var CmListEvents=require(_0x5b81('0x0'));var events=[_0x5b81('0x1'),'remove','update'];function createListener(_0x2ec5d4,_0x5ae6ff){return function(_0x3cab0b){_0x5ae6ff[_0x5b81('0x2')](_0x2ec5d4,_0x3cab0b);};}function removeListener(_0x24aaec,_0x114114){return function(){CmListEvents['removeListener'](_0x24aaec,_0x114114);};}exports[_0x5b81('0x3')]=function(_0x971823){for(var _0xfb1bec=0x0,_0x340970=events[_0x5b81('0x4')];_0xfb1bec<_0x340970;_0xfb1bec++){var _0x682c3e=events[_0xfb1bec];var _0x13b3a2=createListener(_0x5b81('0x5')+_0x682c3e,_0x971823);CmListEvents['on'](_0x682c3e,_0x13b3a2);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 384aa4b..ed5bf86 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 _0x94c9=['addContacts','addCustomField','/:id/users','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','create','addDisposition','post'];(function(_0x47d732,_0x14aa71){var _0x31dcbc=function(_0x3f6dc5){while(--_0x3f6dc5){_0x47d732['push'](_0x47d732['shift']());}};_0x31dcbc(++_0x14aa71);}(_0x94c9,0x1dd));var _0x994c=function(_0x185a67,_0x244aa7){_0x185a67=_0x185a67-0x0;var _0x95a3f4=_0x94c9[_0x185a67];return _0x95a3f4;};'use strict';var multer=require(_0x994c('0x0'));var util=require(_0x994c('0x1'));var path=require(_0x994c('0x2'));var timeout=require('connect-timeout');var express=require(_0x994c('0x3'));var router=express[_0x994c('0x4')]();var fs_extra=require(_0x994c('0x5'));var auth=require(_0x994c('0x6'));var interaction=require(_0x994c('0x7'));var config=require('../../config/environment');var controller=require(_0x994c('0x8'));router[_0x994c('0x9')]('/',auth[_0x994c('0xa')](),controller[_0x994c('0xb')]);router[_0x994c('0x9')](_0x994c('0xc'),auth[_0x994c('0xa')](),controller[_0x994c('0xd')]);router['get'](_0x994c('0xe'),auth[_0x994c('0xa')](),controller[_0x994c('0xf')]);router[_0x994c('0x9')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller[_0x994c('0x11')]);router[_0x994c('0x9')](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x13')]);router[_0x994c('0x9')]('/:id/contacts',auth[_0x994c('0xa')](),controller[_0x994c('0x14')]);router[_0x994c('0x9')](_0x994c('0x15'),auth[_0x994c('0xa')](),controller['getContactsCsv']);router[_0x994c('0x9')](_0x994c('0x16'),auth[_0x994c('0xa')](),controller[_0x994c('0x17')]);router[_0x994c('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x994c('0xa')](),controller[_0x994c('0x18')]);router['post'](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x19')]);router[_0x994c('0x1a')]('/:id/contacts',auth[_0x994c('0xa')](),controller[_0x994c('0x1b')]);router[_0x994c('0x1a')](_0x994c('0x16'),auth[_0x994c('0xa')](),controller[_0x994c('0x1c')]);router[_0x994c('0x1a')](_0x994c('0x1d'),auth[_0x994c('0xa')](),controller[_0x994c('0x1e')]);router[_0x994c('0x1f')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller[_0x994c('0x20')]);router[_0x994c('0x21')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller['destroy']);router[_0x994c('0x21')](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x22')]);router[_0x994c('0x21')](_0x994c('0x1d'),auth[_0x994c('0xa')](),controller['removeAgents']);module[_0x994c('0x23')]=router; \ No newline at end of file +var _0xda5d=['removeDispositions','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','getGlobalCustomFields','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','destroy','delete'];(function(_0x5d672b,_0x28f0e4){var _0x3268fc=function(_0x47aa90){while(--_0x47aa90){_0x5d672b['push'](_0x5d672b['shift']());}};_0x3268fc(++_0x28f0e4);}(_0xda5d,0xc8));var _0xdda5=function(_0x50a7f7,_0x7c611){_0x50a7f7=_0x50a7f7-0x0;var _0x192449=_0xda5d[_0x50a7f7];return _0x192449;};'use strict';var multer=require('multer');var util=require(_0xdda5('0x0'));var path=require(_0xdda5('0x1'));var timeout=require(_0xdda5('0x2'));var express=require(_0xdda5('0x3'));var router=express['Router']();var fs_extra=require(_0xdda5('0x4'));var auth=require(_0xdda5('0x5'));var interaction=require(_0xdda5('0x6'));var config=require('../../config/environment');var controller=require(_0xdda5('0x7'));router[_0xdda5('0x8')]('/',auth[_0xdda5('0x9')](),controller[_0xdda5('0xa')]);router['get'](_0xdda5('0xb'),auth[_0xdda5('0x9')](),controller[_0xdda5('0xc')]);router['get']('/global_fields',auth[_0xdda5('0x9')](),controller[_0xdda5('0xd')]);router['get'](_0xdda5('0xe'),auth[_0xdda5('0x9')](),controller[_0xdda5('0xf')]);router[_0xdda5('0x8')]('/:id/dispositions',auth[_0xdda5('0x9')](),controller['getDispositions']);router[_0xdda5('0x8')](_0xdda5('0x10'),auth[_0xdda5('0x9')](),controller[_0xdda5('0x11')]);router[_0xdda5('0x8')](_0xdda5('0x12'),auth[_0xdda5('0x9')](),controller[_0xdda5('0x13')]);router[_0xdda5('0x8')](_0xdda5('0x14'),auth[_0xdda5('0x9')](),controller[_0xdda5('0x15')]);router[_0xdda5('0x8')](_0xdda5('0x16'),auth[_0xdda5('0x9')](),controller['getAgents']);router[_0xdda5('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdda5('0x17')](_0xdda5('0x18'),auth['isAuthenticated'](),controller[_0xdda5('0x19')]);router['post'](_0xdda5('0x10'),auth[_0xdda5('0x9')](),controller[_0xdda5('0x1a')]);router['post'](_0xdda5('0x14'),auth['isAuthenticated'](),controller[_0xdda5('0x1b')]);router[_0xdda5('0x17')]('/:id/users',auth[_0xdda5('0x9')](),controller[_0xdda5('0x1c')]);router['put']('/:id',auth[_0xdda5('0x9')](),controller['update']);router['delete']('/:id',auth[_0xdda5('0x9')](),controller[_0xdda5('0x1d')]);router[_0xdda5('0x1e')](_0xdda5('0x18'),auth[_0xdda5('0x9')](),controller[_0xdda5('0x1f')]);router['delete'](_0xdda5('0x16'),auth['isAuthenticated'](),controller[_0xdda5('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index cddbdc1..7ee738d 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 _0x25fd=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x578c21,_0x162330){var _0x48ae7b=function(_0xb9cde3){while(--_0xb9cde3){_0x578c21['push'](_0x578c21['shift']());}};_0x48ae7b(++_0x162330);}(_0x25fd,0x1b9));var _0xd25f=function(_0x1c6873,_0x96f1aa){_0x1c6873=_0x1c6873-0x0;var _0x31dac9=_0x25fd[_0x1c6873];return _0x31dac9;};'use strict';var Sequelize=require(_0xd25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd25f('0x1')],'get':function(_0xfbf32d){return this[_0xd25f('0x2')](_0xd25f('0x3'));}},'field':{'type':Sequelize[_0xd25f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xd25f('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc44d=['STRING','sequelize','VIRTUAL','field'];(function(_0xf50032,_0x397169){var _0x2a83d9=function(_0x336e86){while(--_0x336e86){_0xf50032['push'](_0xf50032['shift']());}};_0x2a83d9(++_0x397169);}(_0xc44d,0x18d));var _0xdc44=function(_0x1a321b,_0x1b2ce9){_0x1a321b=_0x1a321b-0x0;var _0x22fa1a=_0xc44d[_0x1a321b];return _0x22fa1a;};'use strict';var Sequelize=require(_0xdc44('0x0'));module['exports']={'name':{'type':Sequelize[_0xdc44('0x1')],'get':function(_0x27bbd3){return this['getDataValue'](_0xdc44('0x2'));}},'field':{'type':Sequelize[_0xdc44('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xdc44('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xdc44('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index ef9719b..1f9ce39 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 _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(_0x169fd6,_0x5ad6d2){var _0x3e6a90=function(_0x243e46){while(--_0x243e46){_0x169fd6['push'](_0x169fd6['shift']());}};_0x3e6a90(++_0x5ad6d2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 +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(_0x161e89,_0x387d33){var _0x3d6a0e=function(_0x385ad0){while(--_0x385ad0){_0x161e89['push'](_0x161e89['shift']());}};_0x3d6a0e(++_0x387d33);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 9943880..2e93eb9 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 _0x39f0=['request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cff16,_0x5d25e3){var _0x1ab256=function(_0x4110aa){while(--_0x4110aa){_0x1cff16['push'](_0x1cff16['shift']());}};_0x1ab256(++_0x5d25e3);}(_0x39f0,0xe8));var _0x039f=function(_0x67acd2,_0x49abcb){_0x67acd2=_0x67acd2-0x0;var _0x2cd246=_0x39f0[_0x67acd2];return _0x2cd246;};'use strict';var _=require(_0x039f('0x0'));var util=require(_0x039f('0x1'));var logger=require(_0x039f('0x2'))(_0x039f('0x3'));var moment=require(_0x039f('0x4'));var BPromise=require(_0x039f('0x5'));var rp=require(_0x039f('0x6'));var fs=require('fs');var path=require(_0x039f('0x7'));var rimraf=require(_0x039f('0x8'));var config=require('../../config/environment');var attributes=require(_0x039f('0x9'));module[_0x039f('0xa')]=function(_0x165923,_0x5cfc83){return _0x165923[_0x039f('0xb')](_0x039f('0xc'),attributes,{'tableName':_0x039f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9919=['rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','api','moment','bluebird','request-promise','path'];(function(_0x249c0c,_0x22dcc4){var _0x5da81d=function(_0x247e86){while(--_0x247e86){_0x249c0c['push'](_0x249c0c['shift']());}};_0x5da81d(++_0x22dcc4);}(_0x9919,0x66));var _0x9991=function(_0x3d34f0,_0x4a5dc0){_0x3d34f0=_0x3d34f0-0x0;var _0x135ecd=_0x9919[_0x3d34f0];return _0x135ecd;};'use strict';var _=require(_0x9991('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9991('0x1'));var moment=require(_0x9991('0x2'));var BPromise=require(_0x9991('0x3'));var rp=require(_0x9991('0x4'));var fs=require('fs');var path=require(_0x9991('0x5'));var rimraf=require(_0x9991('0x6'));var config=require(_0x9991('0x7'));var attributes=require(_0x9991('0x8'));module[_0x9991('0x9')]=function(_0x339b85,_0x20cfcd){return _0x339b85['define'](_0x9991('0xa'),attributes,{'tableName':_0x9991('0xb'),'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 198183d..70bcc85 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 _0x51d9=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0x51d9,0x106));var _0x951d=function(_0x26fa6f,_0x331c69){_0x26fa6f=_0x26fa6f-0x0;var _0x34c23c=_0x51d9[_0x26fa6f];return _0x34c23c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x951d('0x0'));var BPromise=require(_0x951d('0x1'));var rs=require(_0x951d('0x2'));var fs=require('fs');var Redis=require(_0x951d('0x3'));var db=require(_0x951d('0x4'))['db'];var utils=require(_0x951d('0x5'));var logger=require(_0x951d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x951d('0x7'));var client=jayson['client'][_0x951d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x407c79,_0x24be89,_0x492231){return new BPromise(function(_0x48e4b5,_0x954f77){return client['request'](_0x407c79,_0x492231)[_0x951d('0x9')](function(_0x536904){logger[_0x951d('0xa')](_0x951d('0xb'),_0x24be89,_0x951d('0xc'));logger[_0x951d('0xd')](_0x951d('0xe'),_0x24be89,_0x951d('0xc'),JSON[_0x951d('0xf')](_0x536904));if(_0x536904[_0x951d('0x10')]){if(_0x536904[_0x951d('0x10')]['code']===0x1f4){logger['error'](_0x951d('0xb'),_0x24be89,_0x536904[_0x951d('0x10')][_0x951d('0x11')]);return _0x954f77(_0x536904[_0x951d('0x10')]['message']);}logger['error']('Condition,\x20%s,\x20%s',_0x24be89,_0x536904[_0x951d('0x10')][_0x951d('0x11')]);return _0x48e4b5(_0x536904[_0x951d('0x10')][_0x951d('0x11')]);}else{logger[_0x951d('0xa')](_0x951d('0xb'),_0x24be89,_0x951d('0xc'));_0x48e4b5(_0x536904[_0x951d('0x12')][_0x951d('0x11')]);}})['catch'](function(_0x1f3c6b){logger[_0x951d('0x10')](_0x951d('0xb'),_0x24be89,_0x1f3c6b);_0x954f77(_0x1f3c6b);});});} \ No newline at end of file +var _0x7c45=['then','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x7c45,0x1be));var _0x57c4=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7c45[_0x35885a];return _0xe86249;};'use strict';var _=require('lodash');var util=require(_0x57c4('0x0'));var moment=require(_0x57c4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57c4('0x2'));var db=require(_0x57c4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x57c4('0x4'))(_0x57c4('0x5'));var config=require('../../config/environment');var jayson=require(_0x57c4('0x6'));var client=jayson[_0x57c4('0x7')][_0x57c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb9f01a,_0x511f63,_0x35a4e9){return new BPromise(function(_0x4abeae,_0x4d3205){return client[_0x57c4('0x9')](_0xb9f01a,_0x35a4e9)[_0x57c4('0xa')](function(_0x85b521){logger['info'](_0x57c4('0xb'),_0x511f63,'request\x20sent');logger['debug'](_0x57c4('0xc'),_0x511f63,'request\x20sent',JSON['stringify'](_0x85b521));if(_0x85b521[_0x57c4('0xd')]){if(_0x85b521[_0x57c4('0xd')]['code']===0x1f4){logger[_0x57c4('0xd')](_0x57c4('0xb'),_0x511f63,_0x85b521[_0x57c4('0xd')][_0x57c4('0xe')]);return _0x4d3205(_0x85b521[_0x57c4('0xd')][_0x57c4('0xe')]);}logger[_0x57c4('0xd')]('Condition,\x20%s,\x20%s',_0x511f63,_0x85b521[_0x57c4('0xd')][_0x57c4('0xe')]);return _0x4abeae(_0x85b521['error'][_0x57c4('0xe')]);}else{logger[_0x57c4('0xf')](_0x57c4('0xb'),_0x511f63,_0x57c4('0x10'));_0x4abeae(_0x85b521[_0x57c4('0x11')][_0x57c4('0xe')]);}})[_0x57c4('0x12')](function(_0x5df54f){logger[_0x57c4('0xd')]('Condition,\x20%s,\x20%s',_0x511f63,_0x5df54f);_0x4d3205(_0x5df54f);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d1c359a..10b3569 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 _0x2eda=['isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x5e9d5c,_0x4e7595){var _0x26970f=function(_0x4ab4e1){while(--_0x4ab4e1){_0x5e9d5c['push'](_0x5e9d5c['shift']());}};_0x26970f(++_0x4e7595);}(_0x2eda,0xb8));var _0xa2ed=function(_0x239d9f,_0x4f5a4b){_0x239d9f=_0x239d9f-0x0;var _0x12422a=_0x2eda[_0x239d9f];return _0x12422a;};'use strict';var multer=require(_0xa2ed('0x0'));var util=require(_0xa2ed('0x1'));var path=require(_0xa2ed('0x2'));var timeout=require(_0xa2ed('0x3'));var express=require('express');var router=express[_0xa2ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa2ed('0x5'));var interaction=require(_0xa2ed('0x6'));var config=require(_0xa2ed('0x7'));var controller=require(_0xa2ed('0x8'));router[_0xa2ed('0x9')](_0xa2ed('0xa'),auth[_0xa2ed('0xb')](),controller[_0xa2ed('0xc')]);router['delete'](_0xa2ed('0xa'),auth[_0xa2ed('0xb')](),controller[_0xa2ed('0xd')]);module[_0xa2ed('0xe')]=router; \ No newline at end of file +var _0xa585=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','path','express'];(function(_0x4c3fc8,_0x42d92e){var _0x5596f6=function(_0x5047f8){while(--_0x5047f8){_0x4c3fc8['push'](_0x4c3fc8['shift']());}};_0x5596f6(++_0x42d92e);}(_0xa585,0x1cc));var _0x5a58=function(_0x16eb6d,_0x5625cf){_0x16eb6d=_0x16eb6d-0x0;var _0x50614c=_0xa585[_0x16eb6d];return _0x50614c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a58('0x0'));var timeout=require('connect-timeout');var express=require(_0x5a58('0x1'));var router=express[_0x5a58('0x2')]();var fs_extra=require(_0x5a58('0x3'));var auth=require(_0x5a58('0x4'));var interaction=require(_0x5a58('0x5'));var config=require(_0x5a58('0x6'));var controller=require(_0x5a58('0x7'));router[_0x5a58('0x8')](_0x5a58('0x9'),auth[_0x5a58('0xa')](),controller[_0x5a58('0xb')]);router[_0x5a58('0xc')]('/:id',auth[_0x5a58('0xa')](),controller[_0x5a58('0xd')]);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 bb480dc..8a77e42 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 _0x2ff0=['STRING','name','INTEGER','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ff0,0x80));var _0x02ff=function(_0x4e8823,_0x1767d8){_0x4e8823=_0x4e8823-0x0;var _0x42cd85=_0x2ff0[_0x4e8823];return _0x42cd85;};'use strict';var Sequelize=require(_0x02ff('0x0'));module[_0x02ff('0x1')]={'name':{'type':Sequelize[_0x02ff('0x2')],'allowNull':![],'unique':_0x02ff('0x3')},'OrderBy':{'type':Sequelize[_0x02ff('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x02ff('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc74b=['sequelize','STRING','name','INTEGER'];(function(_0x150a8b,_0x8f4e20){var _0x4879c0=function(_0x1b1e3d){while(--_0x1b1e3d){_0x150a8b['push'](_0x150a8b['shift']());}};_0x4879c0(++_0x8f4e20);}(_0xc74b,0x88));var _0xbc74=function(_0x18bca9,_0x3034e1){_0x18bca9=_0x18bca9-0x0;var _0x3bb1b0=_0xc74b[_0x18bca9];return _0x3bb1b0;};'use strict';var Sequelize=require(_0xbc74('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc74('0x1')],'allowNull':![],'unique':_0xbc74('0x2')},'OrderBy':{'type':Sequelize[_0xbc74('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xbc74('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 46f8204..5be5a9c 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 _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x531073,_0x7f076c){var _0x1b6566=function(_0x36455d){while(--_0x36455d){_0x531073['push'](_0x531073['shift']());}};_0x1b6566(++_0x7f076c);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x54d1ae,_0x56a2b9){_0x54d1ae=_0x54d1ae-0x0;var _0x5b033b=_0xbbbc[_0x54d1ae];return _0x5b033b;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));}; \ No newline at end of file +var _0x63a5=['end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','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'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x63a5,0x18e));var _0x563a=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x63a5[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){var _0x1250e6=_0x44e2c1[_0x563a('0x28')]({'plain':!![]});var _0x1682ee=_0x563a('0x29');return db[_0x563a('0x2a')]['destroy']({'where':{'type':_0x1682ee,'resourceId':_0x1250e6['id']}})[_0x563a('0x26')](function(){return _0x44e2c1;});})[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0xce8165,_0x1898f9){return function(_0x1afdff){if(!_0x1afdff){_0xce8165[_0x563a('0x19')](0x194);}return _0x1afdff;};}function handleError(_0x249db8,_0x8f3429){_0x8f3429=_0x8f3429||0x1f4;return function(_0x1a69d5){logger[_0x563a('0x2b')](_0x1a69d5[_0x563a('0x2c')]);if(_0x1a69d5[_0x563a('0x2d')]){delete _0x1a69d5['name'];}_0x249db8[_0x563a('0x1a')](_0x8f3429)[_0x563a('0x2e')](_0x1a69d5);};}exports[_0x563a('0x2f')]=function(_0x4aaa3d,_0x1e8d43){var _0x2e5c4b={},_0x3a59cb={},_0x28a8f6={'count':0x0,'rows':[]};var _0x166f89=_[_0x563a('0x30')](db[_0x563a('0x31')]['rawAttributes'],function(_0x2418ae){return{'name':_0x2418ae[_0x563a('0x32')],'type':_0x2418ae[_0x563a('0x33')][_0x563a('0x34')]};});_0x3a59cb[_0x563a('0x35')]=_['map'](_0x166f89,'name');_0x3a59cb['query']=_['keys'](_0x4aaa3d[_0x563a('0x36')]);_0x3a59cb[_0x563a('0x37')]=_[_0x563a('0x38')](_0x3a59cb[_0x563a('0x35')],_0x3a59cb[_0x563a('0x36')]);_0x2e5c4b[_0x563a('0x39')]=_['intersection'](_0x3a59cb['model'],qs[_0x563a('0x3a')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3a')]));_0x2e5c4b[_0x563a('0x39')]=_0x2e5c4b[_0x563a('0x39')][_0x563a('0x3b')]?_0x2e5c4b[_0x563a('0x39')]:_0x3a59cb[_0x563a('0x35')];if(!_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3c')](_0x563a('0x3d'))){_0x2e5c4b[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1e')]);_0x2e5c4b[_0x563a('0x1f')]=qs['offset'](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1f')]);}_0x2e5c4b[_0x563a('0x3e')]=qs['sort'](_0x4aaa3d[_0x563a('0x36')]['sort']);_0x2e5c4b[_0x563a('0x3f')]=qs[_0x563a('0x37')](_['pick'](_0x4aaa3d['query'],_0x3a59cb[_0x563a('0x37')]),_0x166f89);if(_0x4aaa3d['query'][_0x563a('0x40')]){_0x2e5c4b[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x2e5c4b[_0x563a('0x3f')],{'$or':_['map'](_0x166f89,function(_0x47d37a){if(_0x47d37a[_0x563a('0x33')]!=='VIRTUAL'){var _0x46d471={};_0x46d471[_0x47d37a[_0x563a('0x2d')]]={'$like':'%'+_0x4aaa3d[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x46d471;}})});}_0x2e5c4b=_[_0x563a('0x41')]({},_0x2e5c4b,_0x4aaa3d[_0x563a('0x42')]);var _0x4bf555={'where':_0x2e5c4b[_0x563a('0x3f')]};return db['ContactItemType'][_0x563a('0x20')](_0x4bf555)['then'](function(_0x20c142){_0x28a8f6[_0x563a('0x20')]=_0x20c142;if(_0x4aaa3d[_0x563a('0x36')][_0x563a('0x43')]){_0x2e5c4b['include']=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x2e5c4b);})[_0x563a('0x26')](function(_0x1255da){_0x28a8f6[_0x563a('0x44')]=_0x1255da;return _0x28a8f6;})[_0x563a('0x26')](respondWithFilteredResult(_0x1e8d43,_0x2e5c4b))[_0x563a('0x45')](handleError(_0x1e8d43,null));};exports[_0x563a('0x46')]=function(_0x29a1c0,_0x2ca0f4){var _0x19c2cc={'raw':!![],'where':{'id':_0x29a1c0[_0x563a('0x47')]['id']}},_0x433353={};_0x433353[_0x563a('0x35')]=_[_0x563a('0x48')](db[_0x563a('0x31')][_0x563a('0x49')]);_0x433353[_0x563a('0x36')]=_[_0x563a('0x48')](_0x29a1c0[_0x563a('0x36')]);_0x433353[_0x563a('0x37')]=_['intersection'](_0x433353['model'],_0x433353[_0x563a('0x36')]);_0x19c2cc[_0x563a('0x39')]=_[_0x563a('0x38')](_0x433353[_0x563a('0x35')],qs[_0x563a('0x3a')](_0x29a1c0[_0x563a('0x36')][_0x563a('0x3a')]));_0x19c2cc[_0x563a('0x39')]=_0x19c2cc['attributes']['length']?_0x19c2cc[_0x563a('0x39')]:_0x433353[_0x563a('0x35')];if(_0x29a1c0[_0x563a('0x36')][_0x563a('0x43')]){_0x19c2cc[_0x563a('0x4a')]=[{'all':!![]}];}_0x19c2cc=_[_0x563a('0x41')]({},_0x19c2cc,_0x29a1c0[_0x563a('0x42')]);return db[_0x563a('0x31')]['find'](_0x19c2cc)[_0x563a('0x26')](handleEntityNotFound(_0x2ca0f4,null))[_0x563a('0x26')](respondWithResult(_0x2ca0f4,null))['catch'](handleError(_0x2ca0f4,null));};exports[_0x563a('0x4b')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x31')][_0x563a('0x4b')](_0x5a063a['body'],{})[_0x563a('0x26')](function(_0x23efcf){var _0xb1dbc8=_0x5a063a[_0x563a('0x4c')][_0x563a('0x28')]({'plain':!![]});if(!_0xb1dbc8)throw new Error(_0x563a('0x4d'));if(_0xb1dbc8[_0x563a('0x4e')]===_0x563a('0x4c')){var _0x277d54=_0x23efcf[_0x563a('0x28')]({'plain':!![]});var _0x3c98d5=_0x563a('0x29');return db[_0x563a('0x4f')]['find']({'where':{'name':_0x3c98d5,'userProfileId':_0xb1dbc8['userProfileId']},'raw':!![]})[_0x563a('0x26')](function(_0xaae9fd){if(_0xaae9fd&&_0xaae9fd[_0x563a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x277d54[_0x563a('0x2d')],'resourceId':_0x277d54['id'],'type':_0xaae9fd[_0x563a('0x2d')],'sectionId':_0xaae9fd['id']},{})['then'](function(){return _0x23efcf;});}else{return _0x23efcf;}})['catch'](function(_0x51e142){logger[_0x563a('0x2b')](_0x563a('0x51'),_0x51e142);throw _0x51e142;});}return _0x23efcf;})[_0x563a('0x26')](respondWithResult(_0x3ea787,0xc9))[_0x563a('0x45')](handleError(_0x3ea787,null));};exports[_0x563a('0x25')]=function(_0x2805eb,_0x4dd257){if(_0x2805eb['body']['id']){delete _0x2805eb[_0x563a('0x52')]['id'];}return db['ContactItemType'][_0x563a('0x53')]({'where':{'id':_0x2805eb[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x4dd257,null))[_0x563a('0x26')](saveUpdates(_0x2805eb[_0x563a('0x52')],null))[_0x563a('0x26')](respondWithResult(_0x4dd257,null))[_0x563a('0x45')](handleError(_0x4dd257,null));};exports['destroy']=function(_0x22cc91,_0x227372){return db['ContactItemType'][_0x563a('0x53')]({'where':{'id':_0x22cc91[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x227372,null))[_0x563a('0x26')](db[_0x563a('0x54')][_0x563a('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x22cc91[_0x563a('0x47')]['id']}}))[_0x563a('0x26')](removeEntity(_0x227372,null))[_0x563a('0x45')](handleError(_0x227372,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 736ae37..1f387e8 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 _0x3cc2=['tools_contact_item_types','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x3cc2,0x14b));var _0x23cc=function(_0x20b003,_0x45162c){_0x20b003=_0x20b003-0x0;var _0x1161fd=_0x3cc2[_0x20b003];return _0x1161fd;};'use strict';var _=require(_0x23cc('0x0'));var util=require(_0x23cc('0x1'));var logger=require(_0x23cc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x23cc('0x3'));var rp=require(_0x23cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23cc('0x5'));var config=require(_0x23cc('0x6'));var attributes=require(_0x23cc('0x7'));module['exports']=function(_0x4443da,_0x322ac2){return _0x4443da[_0x23cc('0x8')](_0x23cc('0x9'),attributes,{'tableName':_0x23cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf42d=['api','request-promise','path','rimraf','./contactItemType.attributes','exports','define','ContactItemType','lodash','util','../../config/logger'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xf42d,0x8c));var _0xdf42=function(_0x5a95db,_0x501b0e){_0x5a95db=_0x5a95db-0x0;var _0x25efdd=_0xf42d[_0x5a95db];return _0x25efdd;};'use strict';var _=require(_0xdf42('0x0'));var util=require(_0xdf42('0x1'));var logger=require(_0xdf42('0x2'))(_0xdf42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf42('0x4'));var fs=require('fs');var path=require(_0xdf42('0x5'));var rimraf=require(_0xdf42('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf42('0x7'));module[_0xdf42('0x8')]=function(_0x3f4a6a,_0x2fcf94){return _0x3f4a6a[_0xdf42('0x9')](_0xdf42('0xa'),attributes,{'tableName':'tools_contact_item_types','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 75161d6..165e632 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 _0x7701=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x221f3f,_0x572f89){var _0x4cee7c=function(_0x474015){while(--_0x474015){_0x221f3f['push'](_0x221f3f['shift']());}};_0x4cee7c(++_0x572f89);}(_0x7701,0xc2));var _0x1770=function(_0x47faab,_0x2f0254){_0x47faab=_0x47faab-0x0;var _0x392a8b=_0x7701[_0x47faab];return _0x392a8b;};'use strict';var _=require(_0x1770('0x0'));var util=require(_0x1770('0x1'));var moment=require(_0x1770('0x2'));var BPromise=require(_0x1770('0x3'));var rs=require(_0x1770('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1770('0x5'))['db'];var utils=require(_0x1770('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1770('0x7'));var client=jayson[_0x1770('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1311c2,_0x18b2bb,_0x505bfa){return new BPromise(function(_0x433c9f,_0x442af9){return client['request'](_0x1311c2,_0x505bfa)['then'](function(_0x1641ef){logger[_0x1770('0x9')](_0x1770('0xa'),_0x18b2bb,_0x1770('0xb'));logger[_0x1770('0xc')](_0x1770('0xd'),_0x18b2bb,_0x1770('0xb'),JSON[_0x1770('0xe')](_0x1641ef));if(_0x1641ef[_0x1770('0xf')]){if(_0x1641ef[_0x1770('0xf')]['code']===0x1f4){logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x1641ef['error']['message']);return _0x442af9(_0x1641ef[_0x1770('0xf')][_0x1770('0x10')]);}logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x1641ef[_0x1770('0xf')]['message']);return _0x433c9f(_0x1641ef['error'][_0x1770('0x10')]);}else{logger[_0x1770('0x9')](_0x1770('0xa'),_0x18b2bb,_0x1770('0xb'));_0x433c9f(_0x1641ef[_0x1770('0x11')]['message']);}})[_0x1770('0x12')](function(_0x441705){logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x441705);_0x442af9(_0x441705);});});} \ No newline at end of file +var _0x6b67=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result'];(function(_0x5c83dc,_0x2be76e){var _0x28cdb0=function(_0x1642e1){while(--_0x1642e1){_0x5c83dc['push'](_0x5c83dc['shift']());}};_0x28cdb0(++_0x2be76e);}(_0x6b67,0x118));var _0x76b6=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x6b67[_0x83af7f];return _0x32d85c;};'use strict';var _=require(_0x76b6('0x0'));var util=require(_0x76b6('0x1'));var moment=require(_0x76b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x76b6('0x3'));var fs=require('fs');var Redis=require(_0x76b6('0x4'));var db=require(_0x76b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76b6('0x6'))('rpc');var config=require(_0x76b6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbebe8,_0x1c50db,_0x37f54b){return new BPromise(function(_0x1172ad,_0x33ab0d){return client[_0x76b6('0x8')](_0xbebe8,_0x37f54b)[_0x76b6('0x9')](function(_0x55e4fb){logger[_0x76b6('0xa')]('ContactItemType,\x20%s,\x20%s',_0x1c50db,_0x76b6('0xb'));logger[_0x76b6('0xc')](_0x76b6('0xd'),_0x1c50db,_0x76b6('0xb'),JSON[_0x76b6('0xe')](_0x55e4fb));if(_0x55e4fb[_0x76b6('0xf')]){if(_0x55e4fb[_0x76b6('0xf')][_0x76b6('0x10')]===0x1f4){logger[_0x76b6('0xf')]('ContactItemType,\x20%s,\x20%s',_0x1c50db,_0x55e4fb['error'][_0x76b6('0x11')]);return _0x33ab0d(_0x55e4fb[_0x76b6('0xf')]['message']);}logger[_0x76b6('0xf')](_0x76b6('0x12'),_0x1c50db,_0x55e4fb[_0x76b6('0xf')][_0x76b6('0x11')]);return _0x1172ad(_0x55e4fb[_0x76b6('0xf')][_0x76b6('0x11')]);}else{logger['info'](_0x76b6('0x12'),_0x1c50db,_0x76b6('0xb'));_0x1172ad(_0x55e4fb[_0x76b6('0x13')]['message']);}})['catch'](function(_0x227221){logger[_0x76b6('0xf')](_0x76b6('0x12'),_0x1c50db,_0x227221);_0x33ab0d(_0x227221);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 5a7894b..30292d9 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 _0x5822=['../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0x5822,0xbf));var _0x2582=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x5822[_0x4dab14];return _0xf41aa;};'use strict';var multer=require('multer');var util=require(_0x2582('0x0'));var path=require(_0x2582('0x1'));var timeout=require(_0x2582('0x2'));var express=require(_0x2582('0x3'));var router=express[_0x2582('0x4')]();var fs_extra=require(_0x2582('0x5'));var auth=require(_0x2582('0x6'));var interaction=require(_0x2582('0x7'));var config=require('../../config/environment');var controller=require(_0x2582('0x8'));router[_0x2582('0x9')]('/',auth[_0x2582('0xa')](),controller[_0x2582('0xb')]);router['get'](_0x2582('0xc'),auth['isAuthenticated'](),controller[_0x2582('0xd')]);router[_0x2582('0xe')]('/',auth[_0x2582('0xa')](),controller['create']);router[_0x2582('0xf')](_0x2582('0xc'),auth['isAuthenticated'](),controller[_0x2582('0x10')]);router['delete'](_0x2582('0xc'),auth[_0x2582('0xa')](),controller['destroy']);module[_0x2582('0x11')]=router; \ No newline at end of file +var _0x7f93=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','index','get','show','post','put','update','delete','/:id','destroy','exports','connect-timeout','express','Router'];(function(_0x5516c7,_0x3d46e4){var _0x314076=function(_0x3e3b38){while(--_0x3e3b38){_0x5516c7['push'](_0x5516c7['shift']());}};_0x314076(++_0x3d46e4);}(_0x7f93,0x153));var _0x37f9=function(_0x421d76,_0xdf1f19){_0x421d76=_0x421d76-0x0;var _0x27b01a=_0x7f93[_0x421d76];return _0x27b01a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x37f9('0x0'));var express=require(_0x37f9('0x1'));var router=express[_0x37f9('0x2')]();var fs_extra=require(_0x37f9('0x3'));var auth=require(_0x37f9('0x4'));var interaction=require(_0x37f9('0x5'));var config=require(_0x37f9('0x6'));var controller=require(_0x37f9('0x7'));router['get']('/',auth[_0x37f9('0x8')](),controller[_0x37f9('0x9')]);router[_0x37f9('0xa')]('/:id',auth[_0x37f9('0x8')](),controller[_0x37f9('0xb')]);router[_0x37f9('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x37f9('0xd')]('/:id',auth[_0x37f9('0x8')](),controller[_0x37f9('0xe')]);router[_0x37f9('0xf')](_0x37f9('0x10'),auth['isAuthenticated'](),controller[_0x37f9('0x11')]);module[_0x37f9('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4850ecc..f1dae97 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(_0x194431,_0x29170c){var _0x5bfcbd=function(_0x349c87){while(--_0x349c87){_0x194431['push'](_0x194431['shift']());}};_0x5bfcbd(++_0x29170c);}(_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 +var _0xb10b=['name','sequelize','STRING'];(function(_0x181b98,_0x1ad65e){var _0x1969a3=function(_0x486a12){while(--_0x486a12){_0x181b98['push'](_0x181b98['shift']());}};_0x1969a3(++_0x1ad65e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2558ee,_0x2a2574){_0x2558ee=_0x2558ee-0x0;var _0x431306=_0xb10b[_0x2558ee];return _0x431306;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 180f57b..a32d672 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 _0xf16d=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','UserProfileSection','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','stringify','addItem','DashboardItem','getItems','findOne','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','CustomDashboards','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','Dashboard','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0xf16d,0x1b9));var _0xdf16=function(_0x365179,_0x254d11){_0x365179=_0x365179-0x0;var _0x3cb0d0=_0xf16d[_0x365179];return _0x3cb0d0;};'use strict';var emlformat=require(_0xdf16('0x0'));var rimraf=require(_0xdf16('0x1'));var zipdir=require(_0xdf16('0x2'));var jsonpatch=require(_0xdf16('0x3'));var rp=require(_0xdf16('0x4'));var moment=require(_0xdf16('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf16('0x6'));var path=require(_0xdf16('0x7'));var sox=require(_0xdf16('0x8'));var csv=require('to-csv');var ejs=require(_0xdf16('0x9'));var fs=require('fs');var fs_extra=require(_0xdf16('0xa'));var _=require(_0xdf16('0xb'));var squel=require(_0xdf16('0xc'));var crypto=require('crypto');var jsforce=require(_0xdf16('0xd'));var deskjs=require(_0xdf16('0xe'));var toCsv=require(_0xdf16('0xf'));var querystring=require(_0xdf16('0x10'));var Papa=require(_0xdf16('0x11'));var Redis=require(_0xdf16('0x12'));var authService=require(_0xdf16('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdf16('0x14'));var hardwareService=require(_0xdf16('0x15'));var logger=require('../../config/logger')(_0xdf16('0x16'));var utils=require('../../config/utils');var config=require(_0xdf16('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdf16('0x18')]=_[_0xdf16('0x19')](config[_0xdf16('0x18')],{'host':_0xdf16('0x1a'),'port':0x18eb});var socket=require(_0xdf16('0x1b'))(new Redis(config[_0xdf16('0x18')]));require(_0xdf16('0x1c'))[_0xdf16('0x1d')](socket);function respondWithStatusCode(_0x3fccb1,_0x52ff99){_0x52ff99=_0x52ff99||0xcc;return function(_0x1557f6){if(_0x1557f6){return _0x3fccb1[_0xdf16('0x1e')](_0x52ff99);}return _0x3fccb1[_0xdf16('0x1f')](_0x52ff99)[_0xdf16('0x20')]();};}function respondWithResult(_0x21c082,_0x35d412){_0x35d412=_0x35d412||0xc8;return function(_0x5e8052){if(_0x5e8052){return _0x21c082[_0xdf16('0x1f')](_0x35d412)['json'](_0x5e8052);}};}function respondWithFilteredResult(_0x5cdfbd,_0x56c915){return function(_0x2b9d83){if(_0x2b9d83){var _0x2606f4=typeof _0x56c915['offset']===_0xdf16('0x21')&&typeof _0x56c915[_0xdf16('0x22')]===_0xdf16('0x21');var _0x1260ef=_0x2b9d83[_0xdf16('0x23')];var _0x24bef8=_0x2606f4?0x0:_0x56c915[_0xdf16('0x24')];var _0x4e735b=_0x2606f4?_0x2b9d83[_0xdf16('0x23')]:_0x56c915[_0xdf16('0x24')]+_0x56c915[_0xdf16('0x22')];var _0x17e4c2;if(_0x4e735b>=_0x1260ef){_0x4e735b=_0x1260ef;_0x17e4c2=0xc8;}else{_0x17e4c2=0xce;}_0x5cdfbd[_0xdf16('0x1f')](_0x17e4c2);return _0x5cdfbd[_0xdf16('0x25')](_0xdf16('0x26'),_0x24bef8+'-'+_0x4e735b+'/'+_0x1260ef)[_0xdf16('0x27')](_0x2b9d83);}return null;};}function patchUpdates(_0x48c4b7){return function(_0x176032){try{jsonpatch[_0xdf16('0x28')](_0x176032,_0x48c4b7,!![]);}catch(_0xf48765){return BPromise['reject'](_0xf48765);}return _0x176032['save']();};}function saveUpdates(_0x27892a,_0x11fd58){return function(_0x2358f2){if(_0x2358f2){return _0x2358f2[_0xdf16('0x29')](_0x27892a)[_0xdf16('0x2a')](function(_0x379d33){return _0x379d33;});}return null;};}function removeEntity(_0x587682,_0x44e83e){return function(_0x1e27aa){if(_0x1e27aa){return _0x1e27aa[_0xdf16('0x2b')]()[_0xdf16('0x2a')](function(){var _0x1eb34b=_0x1e27aa[_0xdf16('0x2c')]({'plain':!![]});var _0x379816=_0xdf16('0x2d');return db['UserProfileResource'][_0xdf16('0x2b')]({'where':{'type':_0x379816,'resourceId':_0x1eb34b['id']}})[_0xdf16('0x2a')](function(){return _0x1e27aa;});})['then'](function(){_0x587682[_0xdf16('0x1f')](0xcc)[_0xdf16('0x20')]();});}};}function handleEntityNotFound(_0xc344d9,_0x1cc5ae){return function(_0x1ee4bd){if(!_0x1ee4bd){_0xc344d9[_0xdf16('0x1e')](0x194);}return _0x1ee4bd;};}function handleError(_0x1e121b,_0x2ad3e6){_0x2ad3e6=_0x2ad3e6||0x1f4;return function(_0x59b14a){logger[_0xdf16('0x2e')](_0x59b14a[_0xdf16('0x2f')]);if(_0x59b14a[_0xdf16('0x30')]){delete _0x59b14a[_0xdf16('0x30')];}_0x1e121b[_0xdf16('0x1f')](_0x2ad3e6)[_0xdf16('0x31')](_0x59b14a);};}exports['index']=function(_0x2bdcea,_0x5dcc55){var _0x9a197c={},_0x55154c={},_0x21fb8a={'count':0x0,'rows':[]};var _0x462511=_[_0xdf16('0x32')](db['Dashboard'][_0xdf16('0x33')],function(_0x16803e){return{'name':_0x16803e[_0xdf16('0x34')],'type':_0x16803e['type'][_0xdf16('0x35')]};});_0x55154c[_0xdf16('0x36')]=_[_0xdf16('0x32')](_0x462511,_0xdf16('0x30'));_0x55154c[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x2bdcea[_0xdf16('0x37')]);_0x55154c[_0xdf16('0x39')]=_['intersection'](_0x55154c[_0xdf16('0x36')],_0x55154c[_0xdf16('0x37')]);_0x9a197c[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x55154c[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x2bdcea['query'][_0xdf16('0x3c')]));_0x9a197c[_0xdf16('0x3a')]=_0x9a197c['attributes'][_0xdf16('0x3d')]?_0x9a197c[_0xdf16('0x3a')]:_0x55154c[_0xdf16('0x36')];if(!_0x2bdcea['query'][_0xdf16('0x3e')]('nolimit')){_0x9a197c[_0xdf16('0x22')]=qs[_0xdf16('0x22')](_0x2bdcea[_0xdf16('0x37')]['limit']);_0x9a197c['offset']=qs[_0xdf16('0x24')](_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x24')]);}_0x9a197c['order']=qs[_0xdf16('0x3f')](_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x3f')]);_0x9a197c[_0xdf16('0x40')]=qs[_0xdf16('0x39')](_[_0xdf16('0x41')](_0x2bdcea['query'],_0x55154c[_0xdf16('0x39')]),_0x462511);if(_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x42')]){_0x9a197c[_0xdf16('0x40')]=_[_0xdf16('0x43')](_0x9a197c[_0xdf16('0x40')],{'$or':_[_0xdf16('0x32')](_0x462511,function(_0x2d0df8){if(_0x2d0df8[_0xdf16('0x44')]!=='VIRTUAL'){var _0x41543b={};_0x41543b[_0x2d0df8[_0xdf16('0x30')]]={'$like':'%'+_0x2bdcea['query'][_0xdf16('0x42')]+'%'};return _0x41543b;}})});}_0x9a197c=_[_0xdf16('0x43')]({},_0x9a197c,_0x2bdcea[_0xdf16('0x45')]);var _0x496790={'where':_0x9a197c[_0xdf16('0x40')]};return db[_0xdf16('0x46')][_0xdf16('0x23')](_0x496790)[_0xdf16('0x2a')](function(_0xd83b36){_0x21fb8a[_0xdf16('0x23')]=_0xd83b36;if(_0x2bdcea['query'][_0xdf16('0x47')]){_0x9a197c[_0xdf16('0x48')]=[{'all':!![]}];}return db[_0xdf16('0x46')][_0xdf16('0x49')](_0x9a197c);})[_0xdf16('0x2a')](function(_0x23643f){_0x21fb8a[_0xdf16('0x4a')]=_0x23643f;return _0x21fb8a;})[_0xdf16('0x2a')](respondWithFilteredResult(_0x5dcc55,_0x9a197c))['catch'](handleError(_0x5dcc55,null));};exports[_0xdf16('0x4b')]=function(_0x22d696,_0x52c49e){var _0x5c524a={'raw':![],'where':{'id':_0x22d696[_0xdf16('0x4c')]['id']}},_0x4a4003={};_0x4a4003['model']=_[_0xdf16('0x38')](db[_0xdf16('0x46')]['rawAttributes']);_0x4a4003['query']=_[_0xdf16('0x38')](_0x22d696[_0xdf16('0x37')]);_0x4a4003[_0xdf16('0x39')]=_[_0xdf16('0x3b')](_0x4a4003[_0xdf16('0x36')],_0x4a4003['query']);_0x5c524a[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x4a4003[_0xdf16('0x36')],qs['fields'](_0x22d696['query'][_0xdf16('0x3c')]));_0x5c524a[_0xdf16('0x3a')]=_0x5c524a['attributes'][_0xdf16('0x3d')]?_0x5c524a[_0xdf16('0x3a')]:_0x4a4003['model'];if(_0x22d696[_0xdf16('0x37')][_0xdf16('0x47')]){_0x5c524a[_0xdf16('0x48')]=[{'all':!![]}];}_0x5c524a=_[_0xdf16('0x43')]({},_0x5c524a,_0x22d696[_0xdf16('0x45')]);return db[_0xdf16('0x46')][_0xdf16('0x4d')](_0x5c524a)[_0xdf16('0x2a')](handleEntityNotFound(_0x52c49e,null))[_0xdf16('0x2a')](respondWithResult(_0x52c49e,null))[_0xdf16('0x4e')](handleError(_0x52c49e,null));};exports[_0xdf16('0x4f')]=function(_0x26c384,_0xbc7139){return db['Dashboard'][_0xdf16('0x4f')](_0x26c384[_0xdf16('0x50')],{})[_0xdf16('0x2a')](function(_0x43d959){var _0x1a0274=_0x26c384[_0xdf16('0x51')]['get']({'plain':!![]});if(!_0x1a0274)throw new Error(_0xdf16('0x52'));if(_0x1a0274['role']===_0xdf16('0x51')){var _0x3acacc=_0x43d959['get']({'plain':!![]});var _0x13dd2a='CustomDashboards';return db['UserProfileSection'][_0xdf16('0x4d')]({'where':{'name':_0x13dd2a,'userProfileId':_0x1a0274[_0xdf16('0x53')]},'raw':!![]})[_0xdf16('0x2a')](function(_0x586e2e){if(_0x586e2e&&_0x586e2e[_0xdf16('0x54')]===0x0){return db[_0xdf16('0x55')][_0xdf16('0x4f')]({'name':_0x3acacc[_0xdf16('0x30')],'resourceId':_0x3acacc['id'],'type':_0x586e2e[_0xdf16('0x30')],'sectionId':_0x586e2e['id']},{})[_0xdf16('0x2a')](function(){return _0x43d959;});}else{return _0x43d959;}})[_0xdf16('0x4e')](function(_0x6fc6f0){logger[_0xdf16('0x2e')](_0xdf16('0x56'),_0x6fc6f0);throw _0x6fc6f0;});}return _0x43d959;})[_0xdf16('0x2a')](respondWithResult(_0xbc7139,0xc9))['catch'](handleError(_0xbc7139,null));};exports[_0xdf16('0x57')]=function(_0x42d940,_0x331da4){var _0xee7405={'where':{'id':_0x42d940[_0xdf16('0x4c')]['id']}},_0x1e79fc={};_0x1e79fc[_0xdf16('0x36')]=_[_0xdf16('0x38')](db['Dashboard'][_0xdf16('0x33')]);_0xee7405[_0xdf16('0x3a')]=_['intersection'](_0x1e79fc[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x42d940[_0xdf16('0x37')][_0xdf16('0x3c')]));_0xee7405[_0xdf16('0x3a')]=_0xee7405[_0xdf16('0x3a')][_0xdf16('0x3d')]?_0xee7405[_0xdf16('0x3a')]:_0x1e79fc[_0xdf16('0x36')];if(_0x42d940[_0xdf16('0x37')][_0xdf16('0x47')]){_0xee7405['include']=[{'all':!![]}];}_0xee7405=_[_0xdf16('0x43')]({},_0xee7405,_0x42d940[_0xdf16('0x45')]);return db[_0xdf16('0x46')][_0xdf16('0x4d')](_0xee7405)[_0xdf16('0x2a')](handleEntityNotFound(_0x331da4,null))[_0xdf16('0x2a')](function(_0xcdd4f2){if(_0xcdd4f2){var _0x59a402=_0xcdd4f2[_0xdf16('0x2c')]({'plain':!![]});_0x59a402=qs[_0xdf16('0x58')](_0x59a402,['id','createdAt','updatedAt']);_0x42d940[_0xdf16('0x50')]=_[_0xdf16('0x58')](_0x42d940[_0xdf16('0x50')],['id','createdAt',_0xdf16('0x59')]);return db[_0xdf16('0x46')][_0xdf16('0x4f')](_[_0xdf16('0x43')](_0x59a402,_0x42d940[_0xdf16('0x50')]),{'include':_0x42d940['query'][_0xdf16('0x47')]?[{'all':!![]}]:undefined})[_0xdf16('0x2a')](function(_0x26298a){var _0x33296f=_0x42d940['user']['get']({'plain':!![]});if(!_0x33296f)throw new Error(_0xdf16('0x52'));if(_0x33296f[_0xdf16('0x5a')]===_0xdf16('0x51')){var _0x5ed021=_0x26298a['get']({'plain':!![]});var _0x5cc306=_0xdf16('0x2d');return db[_0xdf16('0x5b')][_0xdf16('0x4d')]({'where':{'name':_0x5cc306,'userProfileId':_0x33296f[_0xdf16('0x53')]},'raw':!![]})[_0xdf16('0x2a')](function(_0x3ee8d7){if(_0x3ee8d7&&_0x3ee8d7[_0xdf16('0x54')]===0x0){return db[_0xdf16('0x55')][_0xdf16('0x4f')]({'name':_0x5ed021[_0xdf16('0x30')],'resourceId':_0x5ed021['id'],'type':_0x3ee8d7[_0xdf16('0x30')],'sectionId':_0x3ee8d7['id']},{})[_0xdf16('0x2a')](function(){return _0x26298a;});}else{return _0x26298a;}})[_0xdf16('0x4e')](function(_0x5d5163){logger[_0xdf16('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d5163);throw _0x5d5163;});}return _0x26298a;});}})[_0xdf16('0x2a')](respondWithResult(_0x331da4,0xc9))['catch'](handleError(_0x331da4,null));};exports[_0xdf16('0x29')]=function(_0x2ee497,_0x4989a8){if(_0x2ee497['body']['id']){delete _0x2ee497[_0xdf16('0x50')]['id'];}return db[_0xdf16('0x46')][_0xdf16('0x4d')]({'where':{'id':_0x2ee497[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x4989a8,null))['then'](saveUpdates(_0x2ee497[_0xdf16('0x50')],null))[_0xdf16('0x2a')](respondWithResult(_0x4989a8,null))[_0xdf16('0x4e')](handleError(_0x4989a8,null));};exports[_0xdf16('0x2b')]=function(_0x3207c0,_0xe71cf4){return db[_0xdf16('0x46')]['find']({'where':{'id':_0x3207c0['params']['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0xe71cf4,null))[_0xdf16('0x2a')](removeEntity(_0xe71cf4,null))['catch'](handleError(_0xe71cf4,null));};function widgetAttributes(_0x1cf565){try{switch(_0x1cf565['type']){case _0xdf16('0x5c'):return[{'name':_0xdf16('0x5d'),'value':_0x1cf565['attrUrl']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x60')}];case'custom':return[{'name':_0xdf16('0x61'),'value':_0x1cf565['attrPath']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||''}];case _0xdf16('0x62'):return[{'name':_0xdf16('0x63'),'value':_0x1cf565[_0xdf16('0x63')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565['attrs'][0x0]['value']:undefined)||_0xdf16('0x64')},{'name':_0xdf16('0x65'),'value':_0x1cf565[_0xdf16('0x65')]||(_0x1cf565['attrs']&&_0x1cf565['attrs'][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||_0xdf16('0x66')},{'name':_0xdf16('0x67'),'value':_0x1cf565[_0xdf16('0x67')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||0xc}];case _0xdf16('0x68'):return[{'name':_0xdf16('0x69'),'value':_0x1cf565['attrMetric']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6a')},{'name':_0xdf16('0x6b'),'value':_0x1cf565[_0xdf16('0x6b')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x1cf565[_0xdf16('0x67')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||0x14},{'name':_0xdf16('0x6c'),'value':_0x1cf565[_0xdf16('0x6c')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x3]?_0x1cf565[_0xdf16('0x5e')][0x3][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6d')},{'name':_0xdf16('0x6e'),'value':_0x1cf565[_0xdf16('0x6e')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x4]?_0x1cf565[_0xdf16('0x5e')][0x4][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x6f'),'value':_0x1cf565['attrFaxAccounts']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x5]?_0x1cf565[_0xdf16('0x5e')][0x5][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x70'),'value':_0x1cf565[_0xdf16('0x70')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x6]?_0x1cf565[_0xdf16('0x5e')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1cf565[_0xdf16('0x71')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x7]?_0x1cf565['attrs'][0x7][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x72'),'value':_0x1cf565[_0xdf16('0x72')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x8]?_0x1cf565[_0xdf16('0x5e')][0x8][_0xdf16('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1cf565[_0xdf16('0x73')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x9]?_0x1cf565[_0xdf16('0x5e')][0x9][_0xdf16('0x5f')]:undefined)||''}];case _0xdf16('0x74'):case _0xdf16('0x75'):return[{'name':_0xdf16('0x76'),'value':_0x1cf565[_0xdf16('0x76')]||(_0x1cf565['attrs']&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6a')},{'name':'attrSerie2','value':_0x1cf565[_0xdf16('0x77')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1]['value']:undefined)||null},{'name':_0xdf16('0x78'),'value':_0x1cf565['attrSerie3']||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||null},{'name':_0xdf16('0x6b'),'value':_0x1cf565[_0xdf16('0x6b')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x3]?_0x1cf565[_0xdf16('0x5e')][0x3][_0xdf16('0x5f')]:undefined)||[]},{'name':_0xdf16('0x6c'),'value':_0x1cf565[_0xdf16('0x6c')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x4]?_0x1cf565[_0xdf16('0x5e')][0x4][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6d')},{'name':_0xdf16('0x6e'),'value':_0x1cf565['attrEmailAccounts']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x5]?_0x1cf565['attrs'][0x5][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x6f'),'value':_0x1cf565[_0xdf16('0x6f')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x6]?_0x1cf565[_0xdf16('0x5e')][0x6]['value']:undefined)||''},{'name':_0xdf16('0x70'),'value':_0x1cf565[_0xdf16('0x70')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x7]?_0x1cf565[_0xdf16('0x5e')][0x7]['value']:undefined)||''},{'name':_0xdf16('0x71'),'value':_0x1cf565[_0xdf16('0x71')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x8]?_0x1cf565[_0xdf16('0x5e')][0x8][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x72'),'value':_0x1cf565[_0xdf16('0x72')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x9]?_0x1cf565['attrs'][0x9][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x73'),'value':_0x1cf565[_0xdf16('0x73')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0xa]?_0x1cf565[_0xdf16('0x5e')][0xa]['value']:undefined)||''}];case _0xdf16('0x79'):return[{'name':_0xdf16('0x7a'),'type':_0x1cf565[_0xdf16('0x7b')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0]['type']:undefined)||null,'value':_0x1cf565[_0xdf16('0x7a')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x1cf565['attrRefresh']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2eff41){logger['error']('widgetAttributes:\x20%s',JSON[_0xdf16('0x7c')](_0x2eff41));return[];}}exports[_0xdf16('0x7d')]=function(_0x526e81,_0x33d1a0,_0x123f77){if(_0x526e81[_0xdf16('0x50')]['id']){delete _0x526e81['body']['id'];}return db[_0xdf16('0x46')][_0xdf16('0x4d')]({'where':{'id':_0x526e81[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x33d1a0,null))[_0xdf16('0x2a')](function(_0x55d815){if(_0x55d815){_0x526e81[_0xdf16('0x50')]['DashboardId']=_0x55d815['id'];_0x526e81['body'][_0xdf16('0x5e')]=widgetAttributes(_0x526e81[_0xdf16('0x50')]);return db[_0xdf16('0x7e')]['create'](_0x526e81[_0xdf16('0x50')]);}})[_0xdf16('0x2a')](respondWithResult(_0x33d1a0,null))[_0xdf16('0x4e')](handleError(_0x33d1a0,null));};exports[_0xdf16('0x7f')]=function(_0x4a18ee,_0x459ea7,_0x1469f3){var _0x2833c3={};var _0x36bd13={};var _0x30e113;var _0x455be4;return db[_0xdf16('0x46')][_0xdf16('0x80')]({'where':{'id':_0x4a18ee[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x459ea7,null))[_0xdf16('0x2a')](function(_0x5ef04e){if(_0x5ef04e){_0x30e113=_0x5ef04e;_0x36bd13[_0xdf16('0x36')]=_[_0xdf16('0x38')](db[_0xdf16('0x7e')][_0xdf16('0x33')]);_0x36bd13['query']=_[_0xdf16('0x38')](_0x4a18ee[_0xdf16('0x37')]);_0x36bd13[_0xdf16('0x39')]=_[_0xdf16('0x3b')](_0x36bd13[_0xdf16('0x36')],_0x36bd13[_0xdf16('0x37')]);_0x2833c3[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x36bd13[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x3c')]));_0x2833c3['attributes']=_0x2833c3['attributes'][_0xdf16('0x3d')]?_0x2833c3[_0xdf16('0x3a')]:_0x36bd13[_0xdf16('0x36')];_0x2833c3[_0xdf16('0x81')]=qs[_0xdf16('0x3f')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x3f')]);_0x2833c3[_0xdf16('0x40')]=qs[_0xdf16('0x39')](_[_0xdf16('0x41')](_0x4a18ee[_0xdf16('0x37')],_0x36bd13[_0xdf16('0x39')]));if(_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x42')]){_0x2833c3[_0xdf16('0x40')]=_['merge'](_0x2833c3['where'],{'$or':_[_0xdf16('0x32')](_0x2833c3[_0xdf16('0x3a')],function(_0x4c9568){var _0xad67ca={};_0xad67ca[_0x4c9568]={'$like':'%'+_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x42')]+'%'};return _0xad67ca;})});}_0x2833c3=_['merge']({},_0x2833c3,_0x4a18ee[_0xdf16('0x45')]);return _0x30e113['getItems'](_0x2833c3);}})[_0xdf16('0x2a')](function(_0xbba289){if(_0xbba289){_0x455be4=_0xbba289[_0xdf16('0x3d')];if(!_0x4a18ee[_0xdf16('0x37')]['hasOwnProperty'](_0xdf16('0x82'))){_0x2833c3[_0xdf16('0x22')]=qs[_0xdf16('0x22')](_0x4a18ee[_0xdf16('0x37')]['limit']);_0x2833c3['offset']=qs[_0xdf16('0x24')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x24')]);}return _0x30e113[_0xdf16('0x7f')](_0x2833c3);}})[_0xdf16('0x2a')](function(_0x49afed){if(_0x49afed){return _0x49afed?{'count':_0x455be4,'rows':_0x49afed}:null;}})[_0xdf16('0x2a')](respondWithResult(_0x459ea7,null))[_0xdf16('0x4e')](handleError(_0x459ea7,null));}; \ No newline at end of file +var _0xa3c9=['attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','get','CustomDashboards','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','filter','findAll','rows','show','params','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','autoAssociation','update','iframe','attrUrl'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa3c9,0x1b8));var _0x9a3c=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xa3c9[_0x46f1a6];return _0x38429a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a3c('0x0'));var zipdir=require(_0x9a3c('0x1'));var jsonpatch=require(_0x9a3c('0x2'));var rp=require(_0x9a3c('0x3'));var moment=require(_0x9a3c('0x4'));var BPromise=require(_0x9a3c('0x5'));var Mustache=require(_0x9a3c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9a3c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a3c('0x8'));var _=require(_0x9a3c('0x9'));var squel=require(_0x9a3c('0xa'));var crypto=require(_0x9a3c('0xb'));var jsforce=require(_0x9a3c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a3c('0xd'));var Papa=require(_0x9a3c('0xe'));var Redis=require('ioredis');var authService=require(_0x9a3c('0xf'));var qs=require(_0x9a3c('0x10'));var as=require(_0x9a3c('0x11'));var hardwareService=require(_0x9a3c('0x12'));var logger=require(_0x9a3c('0x13'))(_0x9a3c('0x14'));var utils=require('../../config/utils');var config=require(_0x9a3c('0x15'));var licenseUtil=require(_0x9a3c('0x16'));var db=require(_0x9a3c('0x17'))['db'];config[_0x9a3c('0x18')]=_[_0x9a3c('0x19')](config[_0x9a3c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a3c('0x1a'))(new Redis(config[_0x9a3c('0x18')]));require(_0x9a3c('0x1b'))[_0x9a3c('0x1c')](socket);function respondWithStatusCode(_0x2de8d4,_0x271677){_0x271677=_0x271677||0xcc;return function(_0x4f4753){if(_0x4f4753){return _0x2de8d4['sendStatus'](_0x271677);}return _0x2de8d4[_0x9a3c('0x1d')](_0x271677)[_0x9a3c('0x1e')]();};}function respondWithResult(_0x167650,_0x30033f){_0x30033f=_0x30033f||0xc8;return function(_0x1195b4){if(_0x1195b4){return _0x167650[_0x9a3c('0x1d')](_0x30033f)[_0x9a3c('0x1f')](_0x1195b4);}};}function respondWithFilteredResult(_0x228bb1,_0x5950af){return function(_0x271964){if(_0x271964){var _0x565aaa=typeof _0x5950af[_0x9a3c('0x20')]===_0x9a3c('0x21')&&typeof _0x5950af['limit']===_0x9a3c('0x21');var _0x512e67=_0x271964[_0x9a3c('0x22')];var _0x5a4a09=_0x565aaa?0x0:_0x5950af[_0x9a3c('0x20')];var _0x1d5698=_0x565aaa?_0x271964[_0x9a3c('0x22')]:_0x5950af[_0x9a3c('0x20')]+_0x5950af['limit'];var _0x23ebd4;if(_0x1d5698>=_0x512e67){_0x1d5698=_0x512e67;_0x23ebd4=0xc8;}else{_0x23ebd4=0xce;}_0x228bb1[_0x9a3c('0x1d')](_0x23ebd4);return _0x228bb1[_0x9a3c('0x23')](_0x9a3c('0x24'),_0x5a4a09+'-'+_0x1d5698+'/'+_0x512e67)[_0x9a3c('0x1f')](_0x271964);}return null;};}function patchUpdates(_0x25413f){return function(_0xdf96dd){try{jsonpatch['apply'](_0xdf96dd,_0x25413f,!![]);}catch(_0xc30240){return BPromise[_0x9a3c('0x25')](_0xc30240);}return _0xdf96dd[_0x9a3c('0x26')]();};}function saveUpdates(_0x5e0447,_0x9c49b6){return function(_0x559753){if(_0x559753){return _0x559753['update'](_0x5e0447)[_0x9a3c('0x27')](function(_0x51dbc2){return _0x51dbc2;});}return null;};}function removeEntity(_0x46eb06,_0x355420){return function(_0x4e59f0){if(_0x4e59f0){return _0x4e59f0[_0x9a3c('0x28')]()['then'](function(){var _0x57cf52=_0x4e59f0[_0x9a3c('0x29')]({'plain':!![]});var _0x2aca05=_0x9a3c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2aca05,'resourceId':_0x57cf52['id']}})['then'](function(){return _0x4e59f0;});})[_0x9a3c('0x27')](function(){_0x46eb06['status'](0xcc)[_0x9a3c('0x1e')]();});}};}function handleEntityNotFound(_0x276dad,_0x189e9c){return function(_0xa95ff1){if(!_0xa95ff1){_0x276dad['sendStatus'](0x194);}return _0xa95ff1;};}function handleError(_0x36e9d7,_0x2720cf){_0x2720cf=_0x2720cf||0x1f4;return function(_0x13f4ea){logger['error'](_0x13f4ea[_0x9a3c('0x2b')]);if(_0x13f4ea[_0x9a3c('0x2c')]){delete _0x13f4ea[_0x9a3c('0x2c')];}_0x36e9d7[_0x9a3c('0x1d')](_0x2720cf)[_0x9a3c('0x2d')](_0x13f4ea);};}exports[_0x9a3c('0x2e')]=function(_0x2b7c01,_0x1722c2){var _0x59e17d={},_0x1ed06d={},_0x49ab6c={'count':0x0,'rows':[]};var _0x50203e=_['map'](db[_0x9a3c('0x2f')][_0x9a3c('0x30')],function(_0x19e556){return{'name':_0x19e556[_0x9a3c('0x31')],'type':_0x19e556[_0x9a3c('0x32')][_0x9a3c('0x33')]};});_0x1ed06d[_0x9a3c('0x34')]=_['map'](_0x50203e,_0x9a3c('0x2c'));_0x1ed06d[_0x9a3c('0x35')]=_[_0x9a3c('0x36')](_0x2b7c01['query']);_0x1ed06d[_0x9a3c('0x37')]=_['intersection'](_0x1ed06d[_0x9a3c('0x34')],_0x1ed06d[_0x9a3c('0x35')]);_0x59e17d['attributes']=_[_0x9a3c('0x38')](_0x1ed06d[_0x9a3c('0x34')],qs['fields'](_0x2b7c01[_0x9a3c('0x35')][_0x9a3c('0x39')]));_0x59e17d[_0x9a3c('0x3a')]=_0x59e17d[_0x9a3c('0x3a')][_0x9a3c('0x3b')]?_0x59e17d[_0x9a3c('0x3a')]:_0x1ed06d[_0x9a3c('0x34')];if(!_0x2b7c01[_0x9a3c('0x35')]['hasOwnProperty'](_0x9a3c('0x3c'))){_0x59e17d[_0x9a3c('0x3d')]=qs['limit'](_0x2b7c01[_0x9a3c('0x35')][_0x9a3c('0x3d')]);_0x59e17d[_0x9a3c('0x20')]=qs[_0x9a3c('0x20')](_0x2b7c01[_0x9a3c('0x35')][_0x9a3c('0x20')]);}_0x59e17d[_0x9a3c('0x3e')]=qs[_0x9a3c('0x3f')](_0x2b7c01[_0x9a3c('0x35')][_0x9a3c('0x3f')]);_0x59e17d['where']=qs[_0x9a3c('0x37')](_[_0x9a3c('0x40')](_0x2b7c01[_0x9a3c('0x35')],_0x1ed06d[_0x9a3c('0x37')]),_0x50203e);if(_0x2b7c01[_0x9a3c('0x35')]['filter']){_0x59e17d['where']=_[_0x9a3c('0x41')](_0x59e17d[_0x9a3c('0x42')],{'$or':_['map'](_0x50203e,function(_0x328634){if(_0x328634[_0x9a3c('0x32')]!==_0x9a3c('0x43')){var _0x12a55f={};_0x12a55f[_0x328634[_0x9a3c('0x2c')]]={'$like':'%'+_0x2b7c01[_0x9a3c('0x35')][_0x9a3c('0x44')]+'%'};return _0x12a55f;}})});}_0x59e17d=_[_0x9a3c('0x41')]({},_0x59e17d,_0x2b7c01['options']);var _0x57f38e={'where':_0x59e17d[_0x9a3c('0x42')]};return db[_0x9a3c('0x2f')][_0x9a3c('0x22')](_0x57f38e)[_0x9a3c('0x27')](function(_0x2dbcf0){_0x49ab6c['count']=_0x2dbcf0;if(_0x2b7c01[_0x9a3c('0x35')]['includeAll']){_0x59e17d['include']=[{'all':!![]}];}return db[_0x9a3c('0x2f')][_0x9a3c('0x45')](_0x59e17d);})['then'](function(_0x4d0f6c){_0x49ab6c[_0x9a3c('0x46')]=_0x4d0f6c;return _0x49ab6c;})[_0x9a3c('0x27')](respondWithFilteredResult(_0x1722c2,_0x59e17d))['catch'](handleError(_0x1722c2,null));};exports[_0x9a3c('0x47')]=function(_0x3aad3a,_0x42d54a){var _0x25a8c5={'raw':![],'where':{'id':_0x3aad3a[_0x9a3c('0x48')]['id']}},_0x20c78a={};_0x20c78a['model']=_[_0x9a3c('0x36')](db[_0x9a3c('0x2f')][_0x9a3c('0x30')]);_0x20c78a[_0x9a3c('0x35')]=_[_0x9a3c('0x36')](_0x3aad3a[_0x9a3c('0x35')]);_0x20c78a['filters']=_['intersection'](_0x20c78a['model'],_0x20c78a['query']);_0x25a8c5['attributes']=_[_0x9a3c('0x38')](_0x20c78a[_0x9a3c('0x34')],qs['fields'](_0x3aad3a[_0x9a3c('0x35')][_0x9a3c('0x39')]));_0x25a8c5[_0x9a3c('0x3a')]=_0x25a8c5['attributes'][_0x9a3c('0x3b')]?_0x25a8c5[_0x9a3c('0x3a')]:_0x20c78a[_0x9a3c('0x34')];if(_0x3aad3a['query'][_0x9a3c('0x49')]){_0x25a8c5[_0x9a3c('0x4a')]=[{'all':!![]}];}_0x25a8c5=_['merge']({},_0x25a8c5,_0x3aad3a[_0x9a3c('0x4b')]);return db['Dashboard'][_0x9a3c('0x4c')](_0x25a8c5)['then'](handleEntityNotFound(_0x42d54a,null))['then'](respondWithResult(_0x42d54a,null))['catch'](handleError(_0x42d54a,null));};exports[_0x9a3c('0x4d')]=function(_0x214a7e,_0x275669){return db[_0x9a3c('0x2f')][_0x9a3c('0x4d')](_0x214a7e['body'],{})[_0x9a3c('0x27')](function(_0x46f51b){var _0x5289bc=_0x214a7e[_0x9a3c('0x4e')]['get']({'plain':!![]});if(!_0x5289bc)throw new Error(_0x9a3c('0x4f'));if(_0x5289bc[_0x9a3c('0x50')]===_0x9a3c('0x4e')){var _0x4b3492=_0x46f51b[_0x9a3c('0x29')]({'plain':!![]});var _0x43eef0=_0x9a3c('0x2a');return db[_0x9a3c('0x51')][_0x9a3c('0x4c')]({'where':{'name':_0x43eef0,'userProfileId':_0x5289bc[_0x9a3c('0x52')]},'raw':!![]})[_0x9a3c('0x27')](function(_0x174cd1){if(_0x174cd1&&_0x174cd1['autoAssociation']===0x0){return db[_0x9a3c('0x53')][_0x9a3c('0x4d')]({'name':_0x4b3492[_0x9a3c('0x2c')],'resourceId':_0x4b3492['id'],'type':_0x174cd1[_0x9a3c('0x2c')],'sectionId':_0x174cd1['id']},{})['then'](function(){return _0x46f51b;});}else{return _0x46f51b;}})[_0x9a3c('0x54')](function(_0x54fb38){logger[_0x9a3c('0x55')](_0x9a3c('0x56'),_0x54fb38);throw _0x54fb38;});}return _0x46f51b;})[_0x9a3c('0x27')](respondWithResult(_0x275669,0xc9))[_0x9a3c('0x54')](handleError(_0x275669,null));};exports[_0x9a3c('0x57')]=function(_0x3dd2ec,_0x28ce3a){var _0x35a7ec={'where':{'id':_0x3dd2ec[_0x9a3c('0x48')]['id']}},_0x553d36={};_0x553d36['model']=_[_0x9a3c('0x36')](db['Dashboard'][_0x9a3c('0x30')]);_0x35a7ec[_0x9a3c('0x3a')]=_[_0x9a3c('0x38')](_0x553d36[_0x9a3c('0x34')],qs[_0x9a3c('0x39')](_0x3dd2ec[_0x9a3c('0x35')][_0x9a3c('0x39')]));_0x35a7ec[_0x9a3c('0x3a')]=_0x35a7ec['attributes'][_0x9a3c('0x3b')]?_0x35a7ec[_0x9a3c('0x3a')]:_0x553d36['model'];if(_0x3dd2ec[_0x9a3c('0x35')][_0x9a3c('0x49')]){_0x35a7ec[_0x9a3c('0x4a')]=[{'all':!![]}];}_0x35a7ec=_[_0x9a3c('0x41')]({},_0x35a7ec,_0x3dd2ec[_0x9a3c('0x4b')]);return db[_0x9a3c('0x2f')]['find'](_0x35a7ec)[_0x9a3c('0x27')](handleEntityNotFound(_0x28ce3a,null))['then'](function(_0x8bfe30){if(_0x8bfe30){var _0x34a68b=_0x8bfe30['get']({'plain':!![]});_0x34a68b=qs[_0x9a3c('0x58')](_0x34a68b,['id',_0x9a3c('0x59'),'updatedAt']);_0x3dd2ec[_0x9a3c('0x5a')]=_['omit'](_0x3dd2ec[_0x9a3c('0x5a')],['id',_0x9a3c('0x59'),_0x9a3c('0x5b')]);return db[_0x9a3c('0x2f')][_0x9a3c('0x4d')](_[_0x9a3c('0x41')](_0x34a68b,_0x3dd2ec['body']),{'include':_0x3dd2ec[_0x9a3c('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x9a3c('0x27')](function(_0x39723f){var _0x59ca13=_0x3dd2ec[_0x9a3c('0x4e')]['get']({'plain':!![]});if(!_0x59ca13)throw new Error(_0x9a3c('0x4f'));if(_0x59ca13[_0x9a3c('0x50')]===_0x9a3c('0x4e')){var _0x1f64d1=_0x39723f[_0x9a3c('0x29')]({'plain':!![]});var _0x34aa01=_0x9a3c('0x2a');return db[_0x9a3c('0x51')][_0x9a3c('0x4c')]({'where':{'name':_0x34aa01,'userProfileId':_0x59ca13[_0x9a3c('0x52')]},'raw':!![]})['then'](function(_0x161b11){if(_0x161b11&&_0x161b11[_0x9a3c('0x5c')]===0x0){return db[_0x9a3c('0x53')]['create']({'name':_0x1f64d1[_0x9a3c('0x2c')],'resourceId':_0x1f64d1['id'],'type':_0x161b11[_0x9a3c('0x2c')],'sectionId':_0x161b11['id']},{})[_0x9a3c('0x27')](function(){return _0x39723f;});}else{return _0x39723f;}})[_0x9a3c('0x54')](function(_0x3cec05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cec05);throw _0x3cec05;});}return _0x39723f;});}})['then'](respondWithResult(_0x28ce3a,0xc9))[_0x9a3c('0x54')](handleError(_0x28ce3a,null));};exports[_0x9a3c('0x5d')]=function(_0x420b3e,_0x390cea){if(_0x420b3e[_0x9a3c('0x5a')]['id']){delete _0x420b3e[_0x9a3c('0x5a')]['id'];}return db[_0x9a3c('0x2f')]['find']({'where':{'id':_0x420b3e[_0x9a3c('0x48')]['id']}})[_0x9a3c('0x27')](handleEntityNotFound(_0x390cea,null))[_0x9a3c('0x27')](saveUpdates(_0x420b3e[_0x9a3c('0x5a')],null))[_0x9a3c('0x27')](respondWithResult(_0x390cea,null))['catch'](handleError(_0x390cea,null));};exports[_0x9a3c('0x28')]=function(_0x5b870c,_0x4c2dfc){return db['Dashboard'][_0x9a3c('0x4c')]({'where':{'id':_0x5b870c[_0x9a3c('0x48')]['id']}})[_0x9a3c('0x27')](handleEntityNotFound(_0x4c2dfc,null))[_0x9a3c('0x27')](removeEntity(_0x4c2dfc,null))['catch'](handleError(_0x4c2dfc,null));};function widgetAttributes(_0xeef8f){try{switch(_0xeef8f['type']){case _0x9a3c('0x5e'):return[{'name':_0x9a3c('0x5f'),'value':_0xeef8f[_0x9a3c('0x5f')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0]['value']:undefined)||_0x9a3c('0x61')}];case _0x9a3c('0x62'):return[{'name':'attrPath','value':_0xeef8f[_0x9a3c('0x63')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x64')]:undefined)||''}];case _0x9a3c('0x65'):return[{'name':'attrHourFormat','value':_0xeef8f[_0x9a3c('0x66')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x67')},{'name':_0x9a3c('0x68'),'value':_0xeef8f[_0x9a3c('0x68')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x1]?_0xeef8f['attrs'][0x1][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x69')},{'name':_0x9a3c('0x6a'),'value':_0xeef8f[_0x9a3c('0x6a')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x2]?_0xeef8f[_0x9a3c('0x60')][0x2][_0x9a3c('0x64')]:undefined)||0xc}];case'counter':return[{'name':_0x9a3c('0x6b'),'value':_0xeef8f[_0x9a3c('0x6b')]||(_0xeef8f['attrs']&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x6c')},{'name':_0x9a3c('0x6d'),'value':_0xeef8f[_0x9a3c('0x6d')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x1]?_0xeef8f[_0x9a3c('0x60')][0x1]['value']:undefined)||[]},{'name':_0x9a3c('0x6a'),'value':_0xeef8f[_0x9a3c('0x6a')]||(_0xeef8f['attrs']&&_0xeef8f['attrs'][0x2]?_0xeef8f[_0x9a3c('0x60')][0x2][_0x9a3c('0x64')]:undefined)||0x14},{'name':_0x9a3c('0x6e'),'value':_0xeef8f['attrChannel']||(_0xeef8f['attrs']&&_0xeef8f[_0x9a3c('0x60')][0x3]?_0xeef8f['attrs'][0x3][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x6f')},{'name':_0x9a3c('0x70'),'value':_0xeef8f[_0x9a3c('0x70')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x4]?_0xeef8f[_0x9a3c('0x60')][0x4][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x71'),'value':_0xeef8f[_0x9a3c('0x71')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x5]?_0xeef8f['attrs'][0x5][_0x9a3c('0x64')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xeef8f['attrSmsAccounts']||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x6]?_0xeef8f[_0x9a3c('0x60')][0x6][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x72'),'value':_0xeef8f[_0x9a3c('0x72')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x7]?_0xeef8f[_0x9a3c('0x60')][0x7][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x73'),'value':_0xeef8f[_0x9a3c('0x73')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x8]?_0xeef8f[_0x9a3c('0x60')][0x8][_0x9a3c('0x64')]:undefined)||''},{'name':'attrChatWebsites','value':_0xeef8f[_0x9a3c('0x74')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f['attrs'][0x9]?_0xeef8f[_0x9a3c('0x60')][0x9][_0x9a3c('0x64')]:undefined)||''}];case _0x9a3c('0x75'):case _0x9a3c('0x76'):return[{'name':_0x9a3c('0x77'),'value':_0xeef8f[_0x9a3c('0x77')]||(_0xeef8f['attrs']&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x6c')},{'name':'attrSerie2','value':_0xeef8f['attrSerie2']||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f['attrs'][0x1]?_0xeef8f[_0x9a3c('0x60')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0xeef8f[_0x9a3c('0x78')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x2]?_0xeef8f['attrs'][0x2][_0x9a3c('0x64')]:undefined)||null},{'name':_0x9a3c('0x6d'),'value':_0xeef8f['attrVoiceQueues']||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x3]?_0xeef8f['attrs'][0x3][_0x9a3c('0x64')]:undefined)||[]},{'name':_0x9a3c('0x6e'),'value':_0xeef8f['attrChannel']||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x4]?_0xeef8f[_0x9a3c('0x60')][0x4][_0x9a3c('0x64')]:undefined)||_0x9a3c('0x6f')},{'name':_0x9a3c('0x70'),'value':_0xeef8f[_0x9a3c('0x70')]||(_0xeef8f['attrs']&&_0xeef8f['attrs'][0x5]?_0xeef8f[_0x9a3c('0x60')][0x5][_0x9a3c('0x64')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xeef8f[_0x9a3c('0x71')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x6]?_0xeef8f['attrs'][0x6][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x79'),'value':_0xeef8f[_0x9a3c('0x79')]||(_0xeef8f['attrs']&&_0xeef8f['attrs'][0x7]?_0xeef8f[_0x9a3c('0x60')][0x7][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x72'),'value':_0xeef8f['attrOpenchannelAccounts']||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x8]?_0xeef8f[_0x9a3c('0x60')][0x8][_0x9a3c('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xeef8f[_0x9a3c('0x73')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f['attrs'][0x9]?_0xeef8f[_0x9a3c('0x60')][0x9][_0x9a3c('0x64')]:undefined)||''},{'name':_0x9a3c('0x74'),'value':_0xeef8f[_0x9a3c('0x74')]||(_0xeef8f['attrs']&&_0xeef8f['attrs'][0xa]?_0xeef8f[_0x9a3c('0x60')][0xa]['value']:undefined)||''}];case _0x9a3c('0x7a'):return[{'name':_0x9a3c('0x7b'),'type':_0xeef8f[_0x9a3c('0x7c')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f['attrs'][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x32')]:undefined)||null,'value':_0xeef8f[_0x9a3c('0x7b')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x0]?_0xeef8f[_0x9a3c('0x60')][0x0][_0x9a3c('0x64')]:undefined)||null},{'name':_0x9a3c('0x7d'),'value':_0xeef8f[_0x9a3c('0x7d')]||(_0xeef8f[_0x9a3c('0x60')]&&_0xeef8f[_0x9a3c('0x60')][0x1]?_0xeef8f[_0x9a3c('0x60')][0x1][_0x9a3c('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x1be9a4){logger['error'](_0x9a3c('0x7e'),JSON[_0x9a3c('0x7f')](_0x1be9a4));return[];}}exports[_0x9a3c('0x80')]=function(_0x451091,_0x482cb0,_0x1ed966){if(_0x451091[_0x9a3c('0x5a')]['id']){delete _0x451091[_0x9a3c('0x5a')]['id'];}return db[_0x9a3c('0x2f')][_0x9a3c('0x4c')]({'where':{'id':_0x451091[_0x9a3c('0x48')]['id']}})[_0x9a3c('0x27')](handleEntityNotFound(_0x482cb0,null))[_0x9a3c('0x27')](function(_0x5a62f4){if(_0x5a62f4){_0x451091[_0x9a3c('0x5a')][_0x9a3c('0x81')]=_0x5a62f4['id'];_0x451091[_0x9a3c('0x5a')][_0x9a3c('0x60')]=widgetAttributes(_0x451091['body']);return db[_0x9a3c('0x82')][_0x9a3c('0x4d')](_0x451091[_0x9a3c('0x5a')]);}})['then'](respondWithResult(_0x482cb0,null))[_0x9a3c('0x54')](handleError(_0x482cb0,null));};exports[_0x9a3c('0x83')]=function(_0x40fa87,_0x184339,_0x6d09bb){var _0x2dab5f={};var _0x4bbe7f={};var _0x4e32b8;var _0x54c48c;return db[_0x9a3c('0x2f')][_0x9a3c('0x84')]({'where':{'id':_0x40fa87[_0x9a3c('0x48')]['id']}})[_0x9a3c('0x27')](handleEntityNotFound(_0x184339,null))[_0x9a3c('0x27')](function(_0x2a0b92){if(_0x2a0b92){_0x4e32b8=_0x2a0b92;_0x4bbe7f[_0x9a3c('0x34')]=_[_0x9a3c('0x36')](db[_0x9a3c('0x82')][_0x9a3c('0x30')]);_0x4bbe7f[_0x9a3c('0x35')]=_[_0x9a3c('0x36')](_0x40fa87[_0x9a3c('0x35')]);_0x4bbe7f[_0x9a3c('0x37')]=_[_0x9a3c('0x38')](_0x4bbe7f[_0x9a3c('0x34')],_0x4bbe7f[_0x9a3c('0x35')]);_0x2dab5f[_0x9a3c('0x3a')]=_[_0x9a3c('0x38')](_0x4bbe7f[_0x9a3c('0x34')],qs[_0x9a3c('0x39')](_0x40fa87[_0x9a3c('0x35')][_0x9a3c('0x39')]));_0x2dab5f[_0x9a3c('0x3a')]=_0x2dab5f[_0x9a3c('0x3a')][_0x9a3c('0x3b')]?_0x2dab5f['attributes']:_0x4bbe7f['model'];_0x2dab5f[_0x9a3c('0x3e')]=qs[_0x9a3c('0x3f')](_0x40fa87[_0x9a3c('0x35')][_0x9a3c('0x3f')]);_0x2dab5f[_0x9a3c('0x42')]=qs[_0x9a3c('0x37')](_[_0x9a3c('0x40')](_0x40fa87['query'],_0x4bbe7f[_0x9a3c('0x37')]));if(_0x40fa87[_0x9a3c('0x35')]['filter']){_0x2dab5f[_0x9a3c('0x42')]=_['merge'](_0x2dab5f[_0x9a3c('0x42')],{'$or':_['map'](_0x2dab5f[_0x9a3c('0x3a')],function(_0x321c2b){var _0x1af297={};_0x1af297[_0x321c2b]={'$like':'%'+_0x40fa87['query'][_0x9a3c('0x44')]+'%'};return _0x1af297;})});}_0x2dab5f=_[_0x9a3c('0x41')]({},_0x2dab5f,_0x40fa87['options']);return _0x4e32b8[_0x9a3c('0x83')](_0x2dab5f);}})['then'](function(_0x2fa199){if(_0x2fa199){_0x54c48c=_0x2fa199['length'];if(!_0x40fa87[_0x9a3c('0x35')][_0x9a3c('0x85')](_0x9a3c('0x3c'))){_0x2dab5f[_0x9a3c('0x3d')]=qs[_0x9a3c('0x3d')](_0x40fa87[_0x9a3c('0x35')][_0x9a3c('0x3d')]);_0x2dab5f[_0x9a3c('0x20')]=qs[_0x9a3c('0x20')](_0x40fa87[_0x9a3c('0x35')][_0x9a3c('0x20')]);}return _0x4e32b8[_0x9a3c('0x83')](_0x2dab5f);}})['then'](function(_0x256670){if(_0x256670){return _0x256670?{'count':_0x54c48c,'rows':_0x256670}:null;}})[_0x9a3c('0x27')](respondWithResult(_0x184339,null))['catch'](handleError(_0x184339,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 21936a5..611f626 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 _0xbeff=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x14a2e3,_0x4b8009){var _0x1277d9=function(_0x15c805){while(--_0x15c805){_0x14a2e3['push'](_0x14a2e3['shift']());}};_0x1277d9(++_0x4b8009);}(_0xbeff,0x14b));var _0xfbef=function(_0x3378ae,_0x39af6b){_0x3378ae=_0x3378ae-0x0;var _0x4892e7=_0xbeff[_0x3378ae];return _0x4892e7;};'use strict';var EventEmitter=require(_0xfbef('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xfbef('0x1')](0x0);var events={'afterCreate':_0xfbef('0x2'),'afterUpdate':'update','afterDestroy':_0xfbef('0x3')};function emitEvent(_0x13da02){return function(_0x281e14,_0x159047,_0x150bab){DashboardEvents[_0xfbef('0x4')](_0x13da02+':'+_0x281e14['id'],_0x281e14);DashboardEvents[_0xfbef('0x4')](_0x13da02,_0x281e14);_0x150bab(null);};}for(var e in events){if(events[_0xfbef('0x5')](e)){var event=events[e];Dashboard[_0xfbef('0x6')](e,emitEvent(event));}}module[_0xfbef('0x7')]=DashboardEvents; \ No newline at end of file +var _0xf403=['hasOwnProperty','hook','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x2589ea,_0x17b1e3){var _0x3e8498=function(_0x34e3da){while(--_0x34e3da){_0x2589ea['push'](_0x2589ea['shift']());}};_0x3e8498(++_0x17b1e3);}(_0xf403,0x158));var _0x3f40=function(_0x256cea,_0x327540){_0x256cea=_0x256cea-0x0;var _0x427f2a=_0xf403[_0x256cea];return _0x427f2a;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x3f40('0x0'))['db'][_0x3f40('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3f40('0x2')](0x0);var events={'afterCreate':_0x3f40('0x3'),'afterUpdate':_0x3f40('0x4'),'afterDestroy':_0x3f40('0x5')};function emitEvent(_0x384b8c){return function(_0x5f1f55,_0x2e74c9,_0x695004){DashboardEvents[_0x3f40('0x6')](_0x384b8c+':'+_0x5f1f55['id'],_0x5f1f55);DashboardEvents['emit'](_0x384b8c,_0x5f1f55);_0x695004(null);};}for(var e in events){if(events[_0x3f40('0x7')](e)){var event=events[e];Dashboard[_0x3f40('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 32d64ca..8a04497 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 _0x4abf=['moment','request-promise','path','rimraf','../../config/environment','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x19042a,_0x5d5f34){var _0x368e80=function(_0xf95424){while(--_0xf95424){_0x19042a['push'](_0x19042a['shift']());}};_0x368e80(++_0x5d5f34);}(_0x4abf,0x8c));var _0xf4ab=function(_0x3ec510,_0x196121){_0x3ec510=_0x3ec510-0x0;var _0x30a8f7=_0x4abf[_0x3ec510];return _0x30a8f7;};'use strict';var _=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var logger=require(_0xf4ab('0x2'))(_0xf4ab('0x3'));var moment=require(_0xf4ab('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4ab('0x5'));var fs=require('fs');var path=require(_0xf4ab('0x6'));var rimraf=require(_0xf4ab('0x7'));var config=require(_0xf4ab('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x2b66bd,_0x10079e){return _0x2b66bd[_0xf4ab('0x9')](_0xf4ab('0xa'),attributes,{'tableName':_0xf4ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2408=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','api','moment'];(function(_0xec42c4,_0x2ce9a2){var _0x1ac6dc=function(_0x27e572){while(--_0x27e572){_0xec42c4['push'](_0xec42c4['shift']());}};_0x1ac6dc(++_0x2ce9a2);}(_0x2408,0x172));var _0x8240=function(_0x5cf12b,_0x1c6c3f){_0x5cf12b=_0x5cf12b-0x0;var _0x2f864a=_0x2408[_0x5cf12b];return _0x2f864a;};'use strict';var _=require(_0x8240('0x0'));var util=require(_0x8240('0x1'));var logger=require('../../config/logger')(_0x8240('0x2'));var moment=require(_0x8240('0x3'));var BPromise=require('bluebird');var rp=require(_0x8240('0x4'));var fs=require('fs');var path=require(_0x8240('0x5'));var rimraf=require('rimraf');var config=require(_0x8240('0x6'));var attributes=require(_0x8240('0x7'));module[_0x8240('0x8')]=function(_0x436913,_0x5803c0){return _0x436913[_0x8240('0x9')](_0x8240('0xa'),attributes,{'tableName':'dashboards','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 0c7565c..16c7c30 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 _0x8d56=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xc1f465,_0x469e9e){var _0x2a092e=function(_0x123b1a){while(--_0x123b1a){_0xc1f465['push'](_0xc1f465['shift']());}};_0x2a092e(++_0x469e9e);}(_0x8d56,0x128));var _0x68d5=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x8d56[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x68d5('0x0'));var util=require(_0x68d5('0x1'));var moment=require('moment');var BPromise=require(_0x68d5('0x2'));var rs=require(_0x68d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68d5('0x4'))['db'];var utils=require(_0x68d5('0x5'));var logger=require(_0x68d5('0x6'))(_0x68d5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68d5('0x8'));var client=jayson[_0x68d5('0x9')][_0x68d5('0xa')]({'port':0x232a});config[_0x68d5('0xb')]=_['defaults'](config[_0x68d5('0xb')],{'host':_0x68d5('0xc'),'port':0x18eb});var socket=require(_0x68d5('0xd'))(new Redis(config[_0x68d5('0xb')]));require(_0x68d5('0xe'))[_0x68d5('0xf')](socket);function respondWithRpcPromise(_0x3ffbcc,_0x26a938,_0x22fbfa){return new BPromise(function(_0x4fe842,_0x347977){return client['request'](_0x3ffbcc,_0x22fbfa)[_0x68d5('0x10')](function(_0x52c854){logger[_0x68d5('0x11')](_0x68d5('0x12'),_0x26a938,_0x68d5('0x13'));logger[_0x68d5('0x14')](_0x68d5('0x15'),_0x26a938,'request\x20sent',JSON[_0x68d5('0x16')](_0x52c854));if(_0x52c854[_0x68d5('0x17')]){if(_0x52c854[_0x68d5('0x17')][_0x68d5('0x18')]===0x1f4){logger[_0x68d5('0x17')]('Dashboard,\x20%s,\x20%s',_0x26a938,_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);return _0x347977(_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x26a938,_0x52c854[_0x68d5('0x17')]['message']);return _0x4fe842(_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);}else{logger[_0x68d5('0x11')](_0x68d5('0x12'),_0x26a938,_0x68d5('0x13'));_0x4fe842(_0x52c854['result'][_0x68d5('0x19')]);}})[_0x68d5('0x1a')](function(_0x2aeb71){logger[_0x68d5('0x17')](_0x68d5('0x12'),_0x26a938,_0x2aeb71);_0x347977(_0x2aeb71);});});} \ No newline at end of file +var _0x774c=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./dashboard.socket','register','request','then'];(function(_0x336df4,_0x52c1dc){var _0x580d8c=function(_0x2febf1){while(--_0x2febf1){_0x336df4['push'](_0x336df4['shift']());}};_0x580d8c(++_0x52c1dc);}(_0x774c,0x11d));var _0xc774=function(_0x13a14d,_0x1e10d2){_0x13a14d=_0x13a14d-0x0;var _0x4772c6=_0x774c[_0x13a14d];return _0x4772c6;};'use strict';var _=require('lodash');var util=require(_0xc774('0x0'));var moment=require(_0xc774('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc774('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc774('0x3'))('rpc');var config=require(_0xc774('0x4'));var jayson=require(_0xc774('0x5'));var client=jayson[_0xc774('0x6')][_0xc774('0x7')]({'port':0x232a});config['redis']=_[_0xc774('0x8')](config[_0xc774('0x9')],{'host':_0xc774('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc774('0x9')]));require(_0xc774('0xb'))[_0xc774('0xc')](socket);function respondWithRpcPromise(_0x1b5865,_0x4b068e,_0x547e03){return new BPromise(function(_0x38bfaf,_0x71cbc9){return client[_0xc774('0xd')](_0x1b5865,_0x547e03)[_0xc774('0xe')](function(_0x29290c){logger[_0xc774('0xf')](_0xc774('0x10'),_0x4b068e,_0xc774('0x11'));logger[_0xc774('0x12')](_0xc774('0x13'),_0x4b068e,'request\x20sent',JSON[_0xc774('0x14')](_0x29290c));if(_0x29290c['error']){if(_0x29290c['error'][_0xc774('0x15')]===0x1f4){logger[_0xc774('0x16')](_0xc774('0x10'),_0x4b068e,_0x29290c[_0xc774('0x16')]['message']);return _0x71cbc9(_0x29290c[_0xc774('0x16')][_0xc774('0x17')]);}logger['error'](_0xc774('0x10'),_0x4b068e,_0x29290c[_0xc774('0x16')][_0xc774('0x17')]);return _0x38bfaf(_0x29290c[_0xc774('0x16')][_0xc774('0x17')]);}else{logger[_0xc774('0xf')](_0xc774('0x10'),_0x4b068e,_0xc774('0x11'));_0x38bfaf(_0x29290c[_0xc774('0x18')]['message']);}})['catch'](function(_0x196407){logger[_0xc774('0x16')]('Dashboard,\x20%s,\x20%s',_0x4b068e,_0x196407);_0x71cbc9(_0x196407);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 26887ec..f8260b7 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 _0xc521=['save','remove','update','emit','./dashboard.events'];(function(_0x177b03,_0x128b63){var _0x5a5b23=function(_0x2e054c){while(--_0x2e054c){_0x177b03['push'](_0x177b03['shift']());}};_0x5a5b23(++_0x128b63);}(_0xc521,0x171));var _0x1c52=function(_0xbc6b6d,_0x2085e7){_0xbc6b6d=_0xbc6b6d-0x0;var _0x5e2937=_0xc521[_0xbc6b6d];return _0x5e2937;};'use strict';var DashboardEvents=require(_0x1c52('0x0'));var events=[_0x1c52('0x1'),_0x1c52('0x2'),_0x1c52('0x3')];function createListener(_0x142a2b,_0x83afb6){return function(_0x4fd0df){_0x83afb6[_0x1c52('0x4')](_0x142a2b,_0x4fd0df);};}function removeListener(_0x212eea,_0x4df419){return function(){DashboardEvents['removeListener'](_0x212eea,_0x4df419);};}exports['register']=function(_0x703b62){for(var _0x40a070=0x0,_0x5a1b93=events['length'];_0x40a070<_0x5a1b93;_0x40a070++){var _0x4c71c8=events[_0x40a070];var _0x35148d=createListener('dashboard:'+_0x4c71c8,_0x703b62);DashboardEvents['on'](_0x4c71c8,_0x35148d);}}; \ No newline at end of file +var _0x75cc=['dashboard:','./dashboard.events','remove','update','emit','length'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x75cc,0x7f));var _0xc75c=function(_0x7b1208,_0x3e8278){_0x7b1208=_0x7b1208-0x0;var _0x30f76f=_0x75cc[_0x7b1208];return _0x30f76f;};'use strict';var DashboardEvents=require(_0xc75c('0x0'));var events=['save',_0xc75c('0x1'),_0xc75c('0x2')];function createListener(_0x344dc2,_0x11ee32){return function(_0x24346a){_0x11ee32[_0xc75c('0x3')](_0x344dc2,_0x24346a);};}function removeListener(_0x215cad,_0x55a86f){return function(){DashboardEvents['removeListener'](_0x215cad,_0x55a86f);};}exports['register']=function(_0xe2efc4){for(var _0x1dc305=0x0,_0x3a8f3b=events[_0xc75c('0x4')];_0x1dc305<_0x3a8f3b;_0x1dc305++){var _0x5f14b3=events[_0x1dc305];var _0x458811=createListener(_0xc75c('0x5')+_0x5f14b3,_0xe2efc4);DashboardEvents['on'](_0x5f14b3,_0x458811);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0d3a01e..7ebe4ac 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 _0x3584=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','/:id/clone','clone','update','exports','multer'];(function(_0x345ac8,_0x2daa49){var _0x552f86=function(_0x2210b8){while(--_0x2210b8){_0x345ac8['push'](_0x345ac8['shift']());}};_0x552f86(++_0x2daa49);}(_0x3584,0xe6));var _0x4358=function(_0x393b18,_0x3ac010){_0x393b18=_0x393b18-0x0;var _0x310964=_0x3584[_0x393b18];return _0x310964;};'use strict';var multer=require(_0x4358('0x0'));var util=require(_0x4358('0x1'));var path=require(_0x4358('0x2'));var timeout=require(_0x4358('0x3'));var express=require(_0x4358('0x4'));var router=express[_0x4358('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4358('0x6'));var interaction=require(_0x4358('0x7'));var config=require(_0x4358('0x8'));var controller=require(_0x4358('0x9'));router[_0x4358('0xa')]('/',auth[_0x4358('0xb')](),controller[_0x4358('0xc')]);router[_0x4358('0xa')](_0x4358('0xd'),auth[_0x4358('0xb')](),controller[_0x4358('0xe')]);router[_0x4358('0xa')]('/:id/items',auth[_0x4358('0xb')](),controller[_0x4358('0xf')]);router[_0x4358('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4358('0x10')](_0x4358('0x11'),auth[_0x4358('0xb')](),controller[_0x4358('0x12')]);router['post']('/:id/items',auth[_0x4358('0xb')](),controller['addItem']);router['put'](_0x4358('0xd'),auth[_0x4358('0xb')](),controller[_0x4358('0x13')]);router['delete']('/:id',auth[_0x4358('0xb')](),controller['destroy']);module[_0x4358('0x14')]=router; \ No newline at end of file +var _0x02c7=['show','get','getItems','post','create','/:id/clone','clone','/:id/items','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id'];(function(_0x210e50,_0x5b02cf){var _0x17ae67=function(_0x57b078){while(--_0x57b078){_0x210e50['push'](_0x210e50['shift']());}};_0x17ae67(++_0x5b02cf);}(_0x02c7,0x18d));var _0x702c=function(_0x1a322f,_0x54d072){_0x1a322f=_0x1a322f-0x0;var _0x4fe52c=_0x02c7[_0x1a322f];return _0x4fe52c;};'use strict';var multer=require(_0x702c('0x0'));var util=require(_0x702c('0x1'));var path=require(_0x702c('0x2'));var timeout=require(_0x702c('0x3'));var express=require(_0x702c('0x4'));var router=express[_0x702c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x702c('0x6'));var interaction=require(_0x702c('0x7'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router['get']('/',auth[_0x702c('0x8')](),controller[_0x702c('0x9')]);router['get'](_0x702c('0xa'),auth[_0x702c('0x8')](),controller[_0x702c('0xb')]);router[_0x702c('0xc')]('/:id/items',auth['isAuthenticated'](),controller[_0x702c('0xd')]);router[_0x702c('0xe')]('/',auth[_0x702c('0x8')](),controller[_0x702c('0xf')]);router[_0x702c('0xe')](_0x702c('0x10'),auth[_0x702c('0x8')](),controller[_0x702c('0x11')]);router['post'](_0x702c('0x12'),auth[_0x702c('0x8')](),controller['addItem']);router[_0x702c('0x13')](_0x702c('0xa'),auth['isAuthenticated'](),controller[_0x702c('0x14')]);router[_0x702c('0x15')](_0x702c('0xa'),auth[_0x702c('0x8')](),controller[_0x702c('0x16')]);module[_0x702c('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e2195d3..9c3e4ba 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xabce[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xd117=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd117,0x182));var _0x7d11=function(_0xe89d97,_0x33e5ac){_0xe89d97=_0xe89d97-0x0;var _0x1b6e5d=_0xd117[_0xe89d97];return _0x1b6e5d;};'use strict';var Sequelize=require(_0x7d11('0x0'));var squel=require(_0x7d11('0x1'));var _=require(_0x7d11('0x2'));module[_0x7d11('0x3')]={'title':{'type':Sequelize[_0x7d11('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6')),'get':function(){try{return JSON[_0x7d11('0x7')](this[_0x7d11('0x8')](_0x7d11('0x9')));}catch(_0x2689c6){return[];}},'set':function(_0x27d7e8){try{this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')](_0x27d7e8));}catch(_0x47b5e6){this[_0x7d11('0xa')](_0x7d11('0x9'),JSON[_0x7d11('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7d11('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7d11('0xc')]},'col':{'type':Sequelize[_0x7d11('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7d11('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7d11('0x4')]},'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 16e4abd..b1bf863 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 _0x9e54=['attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','error','stringify','create','body','update','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','end','sendStatus','stack','name','send','show','params','model','keys','DashboardItem','query','filters','intersection'];(function(_0x1090db,_0x1460e6){var _0x3c41fb=function(_0x18e7da){while(--_0x18e7da){_0x1090db['push'](_0x1090db['shift']());}};_0x3c41fb(++_0x1460e6);}(_0x9e54,0x88));var _0x49e5=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x9e54[_0x52bd65];return _0x13fd57;};'use strict';var emlformat=require(_0x49e5('0x0'));var rimraf=require(_0x49e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x49e5('0x2'));var BPromise=require(_0x49e5('0x3'));var Mustache=require(_0x49e5('0x4'));var util=require('util');var path=require(_0x49e5('0x5'));var sox=require(_0x49e5('0x6'));var csv=require('to-csv');var ejs=require(_0x49e5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49e5('0x8'));var crypto=require('crypto');var jsforce=require(_0x49e5('0x9'));var deskjs=require(_0x49e5('0xa'));var toCsv=require(_0x49e5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x49e5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x49e5('0xd'));var as=require(_0x49e5('0xe'));var hardwareService=require(_0x49e5('0xf'));var logger=require(_0x49e5('0x10'))(_0x49e5('0x11'));var utils=require('../../config/utils');var config=require(_0x49e5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x49e5('0x13'))['db'];config[_0x49e5('0x14')]=_[_0x49e5('0x15')](config[_0x49e5('0x14')],{'host':_0x49e5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x49e5('0x17'))[_0x49e5('0x18')](socket);function respondWithStatusCode(_0x5ea43e,_0x56ae34){_0x56ae34=_0x56ae34||0xcc;return function(_0x3b7cd4){if(_0x3b7cd4){return _0x5ea43e['sendStatus'](_0x56ae34);}return _0x5ea43e[_0x49e5('0x19')](_0x56ae34)['end']();};}function respondWithResult(_0x2cc353,_0x13bc7f){_0x13bc7f=_0x13bc7f||0xc8;return function(_0x375488){if(_0x375488){return _0x2cc353['status'](_0x13bc7f)[_0x49e5('0x1a')](_0x375488);}};}function respondWithFilteredResult(_0x273023,_0x37c0d3){return function(_0x1e2723){if(_0x1e2723){var _0xfc4935=typeof _0x37c0d3[_0x49e5('0x1b')]===_0x49e5('0x1c')&&typeof _0x37c0d3['limit']===_0x49e5('0x1c');var _0x200a4e=_0x1e2723['count'];var _0x2370ad=_0xfc4935?0x0:_0x37c0d3['offset'];var _0x305b4c=_0xfc4935?_0x1e2723[_0x49e5('0x1d')]:_0x37c0d3['offset']+_0x37c0d3[_0x49e5('0x1e')];var _0x41c6d0;if(_0x305b4c>=_0x200a4e){_0x305b4c=_0x200a4e;_0x41c6d0=0xc8;}else{_0x41c6d0=0xce;}_0x273023[_0x49e5('0x19')](_0x41c6d0);return _0x273023[_0x49e5('0x1f')](_0x49e5('0x20'),_0x2370ad+'-'+_0x305b4c+'/'+_0x200a4e)[_0x49e5('0x1a')](_0x1e2723);}return null;};}function patchUpdates(_0x5e8569){return function(_0x1a2f8e){try{jsonpatch['apply'](_0x1a2f8e,_0x5e8569,!![]);}catch(_0x3f2f6b){return BPromise[_0x49e5('0x21')](_0x3f2f6b);}return _0x1a2f8e[_0x49e5('0x22')]();};}function saveUpdates(_0x2d1d63,_0x25ecb9){return function(_0xe5b1ea){if(_0xe5b1ea){return _0xe5b1ea['update'](_0x2d1d63)['then'](function(_0xd96520){return _0xd96520;});}return null;};}function removeEntity(_0x3bdd2b,_0x5531bf){return function(_0x3a6837){if(_0x3a6837){return _0x3a6837[_0x49e5('0x23')]()[_0x49e5('0x24')](function(){_0x3bdd2b[_0x49e5('0x19')](0xcc)[_0x49e5('0x25')]();});}};}function handleEntityNotFound(_0x21b29a,_0x4e0ed2){return function(_0xadf789){if(!_0xadf789){_0x21b29a[_0x49e5('0x26')](0x194);}return _0xadf789;};}function handleError(_0x3cb351,_0x5d0700){_0x5d0700=_0x5d0700||0x1f4;return function(_0x300754){logger['error'](_0x300754[_0x49e5('0x27')]);if(_0x300754[_0x49e5('0x28')]){delete _0x300754['name'];}_0x3cb351['status'](_0x5d0700)[_0x49e5('0x29')](_0x300754);};}exports[_0x49e5('0x2a')]=function(_0x51f1ad,_0x35a5f4){var _0x5c0cb8={'raw':![],'where':{'id':_0x51f1ad[_0x49e5('0x2b')]['id']}},_0x36d49e={};_0x36d49e[_0x49e5('0x2c')]=_[_0x49e5('0x2d')](db[_0x49e5('0x2e')]['rawAttributes']);_0x36d49e[_0x49e5('0x2f')]=_[_0x49e5('0x2d')](_0x51f1ad[_0x49e5('0x2f')]);_0x36d49e[_0x49e5('0x30')]=_[_0x49e5('0x31')](_0x36d49e['model'],_0x36d49e[_0x49e5('0x2f')]);_0x5c0cb8[_0x49e5('0x32')]=_['intersection'](_0x36d49e[_0x49e5('0x2c')],qs['fields'](_0x51f1ad['query'][_0x49e5('0x33')]));_0x5c0cb8[_0x49e5('0x32')]=_0x5c0cb8['attributes']['length']?_0x5c0cb8[_0x49e5('0x32')]:_0x36d49e['model'];if(_0x51f1ad[_0x49e5('0x2f')][_0x49e5('0x34')]){_0x5c0cb8[_0x49e5('0x35')]=[{'all':!![]}];}_0x5c0cb8=_[_0x49e5('0x36')]({},_0x5c0cb8,_0x51f1ad[_0x49e5('0x37')]);return db[_0x49e5('0x2e')][_0x49e5('0x38')](_0x5c0cb8)[_0x49e5('0x24')](handleEntityNotFound(_0x35a5f4,null))[_0x49e5('0x24')](respondWithResult(_0x35a5f4,null))[_0x49e5('0x39')](handleError(_0x35a5f4,null));};exports['destroy']=function(_0xdbf2a6,_0x4cf7a2){return db['DashboardItem'][_0x49e5('0x38')]({'where':{'id':_0xdbf2a6[_0x49e5('0x2b')]['id']}})[_0x49e5('0x24')](handleEntityNotFound(_0x4cf7a2,null))[_0x49e5('0x24')](removeEntity(_0x4cf7a2,null))[_0x49e5('0x39')](handleError(_0x4cf7a2,null));};function widgetAttributes(_0x2c0e59){try{switch(_0x2c0e59[_0x49e5('0x3a')]){case _0x49e5('0x3b'):return[{'name':_0x49e5('0x3c'),'value':_0x2c0e59[_0x49e5('0x3c')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x3f')}];case'custom':return[{'name':_0x49e5('0x40'),'value':_0x2c0e59['attrPath']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59['attrs'][0x0][_0x49e5('0x3e')]:undefined)||''}];case _0x49e5('0x41'):return[{'name':'attrHourFormat','value':_0x2c0e59[_0x49e5('0x42')]||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||'HH:mm:ss'},{'name':_0x49e5('0x43'),'value':_0x2c0e59[_0x49e5('0x43')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x1]?_0x2c0e59[_0x49e5('0x3d')][0x1]['value']:undefined)||_0x49e5('0x44')},{'name':'attrFontSize','value':_0x2c0e59[_0x49e5('0x45')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2][_0x49e5('0x3e')]:undefined)||0xc}];case _0x49e5('0x46'):return[{'name':_0x49e5('0x47'),'value':_0x2c0e59[_0x49e5('0x47')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59['attrs'][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x48')},{'name':'attrVoiceQueues','value':_0x2c0e59[_0x49e5('0x49')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59['attrs'][0x1][_0x49e5('0x3e')]:undefined)||[]},{'name':_0x49e5('0x45'),'value':_0x2c0e59['attrFontSize']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2]['value']:undefined)||0x14},{'name':_0x49e5('0x4a'),'value':_0x2c0e59[_0x49e5('0x4a')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x3]?_0x2c0e59[_0x49e5('0x3d')][0x3][_0x49e5('0x3e')]:undefined)||_0x49e5('0x4b')},{'name':_0x49e5('0x4c'),'value':_0x2c0e59['attrEmailAccounts']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x4]?_0x2c0e59[_0x49e5('0x3d')][0x4][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4d'),'value':_0x2c0e59[_0x49e5('0x4d')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x5]?_0x2c0e59[_0x49e5('0x3d')][0x5][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4e'),'value':_0x2c0e59[_0x49e5('0x4e')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x6]?_0x2c0e59[_0x49e5('0x3d')][0x6][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4f'),'value':_0x2c0e59[_0x49e5('0x4f')]||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x7]?_0x2c0e59[_0x49e5('0x3d')][0x7][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x50'),'value':_0x2c0e59['attrWhatsappAccounts']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x8]?_0x2c0e59[_0x49e5('0x3d')][0x8][_0x49e5('0x3e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c0e59[_0x49e5('0x51')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x9]?_0x2c0e59[_0x49e5('0x3d')][0x9][_0x49e5('0x3e')]:undefined)||''}];case'multibar-chart':case _0x49e5('0x52'):return[{'name':_0x49e5('0x53'),'value':_0x2c0e59[_0x49e5('0x53')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x48')},{'name':'attrSerie2','value':_0x2c0e59['attrSerie2']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59['attrs'][0x1][_0x49e5('0x3e')]:undefined)||null},{'name':_0x49e5('0x54'),'value':_0x2c0e59['attrSerie3']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2][_0x49e5('0x3e')]:undefined)||null},{'name':_0x49e5('0x49'),'value':_0x2c0e59[_0x49e5('0x49')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x3]?_0x2c0e59[_0x49e5('0x3d')][0x3]['value']:undefined)||[]},{'name':_0x49e5('0x4a'),'value':_0x2c0e59[_0x49e5('0x4a')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x4]?_0x2c0e59[_0x49e5('0x3d')][0x4]['value']:undefined)||_0x49e5('0x4b')},{'name':_0x49e5('0x4c'),'value':_0x2c0e59['attrEmailAccounts']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x5]?_0x2c0e59['attrs'][0x5]['value']:undefined)||''},{'name':_0x49e5('0x4d'),'value':_0x2c0e59[_0x49e5('0x4d')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x6]?_0x2c0e59['attrs'][0x6][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4e'),'value':_0x2c0e59[_0x49e5('0x4e')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x7]?_0x2c0e59['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c0e59['attrOpenchannelAccounts']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x8]?_0x2c0e59['attrs'][0x8][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x50'),'value':_0x2c0e59[_0x49e5('0x50')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x9]?_0x2c0e59[_0x49e5('0x3d')][0x9][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x51'),'value':_0x2c0e59[_0x49e5('0x51')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0xa]?_0x2c0e59[_0x49e5('0x3d')][0xa][_0x49e5('0x3e')]:undefined)||''}];case _0x49e5('0x55'):return[{'name':_0x49e5('0x56'),'type':_0x2c0e59['reportType']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3a')]:undefined)||null,'value':_0x2c0e59['attrReport']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0]['value']:undefined)||null},{'name':_0x49e5('0x57'),'value':_0x2c0e59[_0x49e5('0x57')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59[_0x49e5('0x3d')][0x1][_0x49e5('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x42e6be){logger[_0x49e5('0x58')]('widgetAttributes:\x20%s',JSON[_0x49e5('0x59')](_0x42e6be));return[];}}exports[_0x49e5('0x5a')]=function(_0x34a920,_0x3d9dca){if(_0x34a920[_0x49e5('0x5b')]){_0x34a920[_0x49e5('0x5b')][_0x49e5('0x3d')]=widgetAttributes(_0x34a920[_0x49e5('0x5b')]);}return db[_0x49e5('0x2e')][_0x49e5('0x5a')](_0x34a920[_0x49e5('0x5b')],{})[_0x49e5('0x24')](respondWithResult(_0x3d9dca,0xc9))[_0x49e5('0x39')](handleError(_0x3d9dca,null));};exports[_0x49e5('0x5c')]=function(_0x292cbe,_0x47e48c){if(_0x292cbe[_0x49e5('0x5b')]['id']){delete _0x292cbe[_0x49e5('0x5b')]['id'];}_0x292cbe[_0x49e5('0x5b')][_0x49e5('0x3d')]=widgetAttributes(_0x292cbe[_0x49e5('0x5b')]);return db[_0x49e5('0x2e')]['find']({'where':{'id':_0x292cbe[_0x49e5('0x2b')]['id']}})[_0x49e5('0x24')](handleEntityNotFound(_0x47e48c,null))['then'](saveUpdates(_0x292cbe[_0x49e5('0x5b')],null))[_0x49e5('0x24')](respondWithResult(_0x47e48c,null))[_0x49e5('0x39')](handleError(_0x47e48c,null));}; \ No newline at end of file +var _0xe978=['attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','redis','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','include','merge','options','find','catch','params','type','iframe','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x32b404,_0x2478fd){var _0x5f2e1d=function(_0x4787b0){while(--_0x4787b0){_0x32b404['push'](_0x32b404['shift']());}};_0x5f2e1d(++_0x2478fd);}(_0xe978,0x70));var _0x8e97=function(_0x4c4d52,_0xba8cfb){_0x4c4d52=_0x4c4d52-0x0;var _0x1a75c0=_0xe978[_0x4c4d52];return _0x1a75c0;};'use strict';var emlformat=require(_0x8e97('0x0'));var rimraf=require(_0x8e97('0x1'));var zipdir=require(_0x8e97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8e97('0x3'));var BPromise=require(_0x8e97('0x4'));var Mustache=require(_0x8e97('0x5'));var util=require(_0x8e97('0x6'));var path=require(_0x8e97('0x7'));var sox=require('sox');var csv=require(_0x8e97('0x8'));var ejs=require(_0x8e97('0x9'));var fs=require('fs');var fs_extra=require(_0x8e97('0xa'));var _=require(_0x8e97('0xb'));var squel=require(_0x8e97('0xc'));var crypto=require('crypto');var jsforce=require(_0x8e97('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8e97('0x8'));var querystring=require(_0x8e97('0xe'));var Papa=require(_0x8e97('0xf'));var Redis=require('ioredis');var authService=require(_0x8e97('0x10'));var qs=require(_0x8e97('0x11'));var as=require(_0x8e97('0x12'));var hardwareService=require(_0x8e97('0x13'));var logger=require(_0x8e97('0x14'))(_0x8e97('0x15'));var utils=require(_0x8e97('0x16'));var config=require(_0x8e97('0x17'));var licenseUtil=require(_0x8e97('0x18'));var db=require(_0x8e97('0x19'))['db'];config[_0x8e97('0x1a')]=_['defaults'](config[_0x8e97('0x1a')],{'host':_0x8e97('0x1b'),'port':0x18eb});var socket=require(_0x8e97('0x1c'))(new Redis(config[_0x8e97('0x1a')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x583c0a,_0x516c91){_0x516c91=_0x516c91||0xcc;return function(_0x5d78c5){if(_0x5d78c5){return _0x583c0a['sendStatus'](_0x516c91);}return _0x583c0a[_0x8e97('0x1d')](_0x516c91)['end']();};}function respondWithResult(_0x33b6b3,_0x3bb176){_0x3bb176=_0x3bb176||0xc8;return function(_0x4943c1){if(_0x4943c1){return _0x33b6b3['status'](_0x3bb176)[_0x8e97('0x1e')](_0x4943c1);}};}function respondWithFilteredResult(_0x3f3738,_0xb779ed){return function(_0x2f475c){if(_0x2f475c){var _0x2155ab=typeof _0xb779ed[_0x8e97('0x1f')]===_0x8e97('0x20')&&typeof _0xb779ed[_0x8e97('0x21')]===_0x8e97('0x20');var _0x596d71=_0x2f475c[_0x8e97('0x22')];var _0x442f99=_0x2155ab?0x0:_0xb779ed[_0x8e97('0x1f')];var _0x19f487=_0x2155ab?_0x2f475c[_0x8e97('0x22')]:_0xb779ed[_0x8e97('0x1f')]+_0xb779ed[_0x8e97('0x21')];var _0x5a5c99;if(_0x19f487>=_0x596d71){_0x19f487=_0x596d71;_0x5a5c99=0xc8;}else{_0x5a5c99=0xce;}_0x3f3738[_0x8e97('0x1d')](_0x5a5c99);return _0x3f3738[_0x8e97('0x23')](_0x8e97('0x24'),_0x442f99+'-'+_0x19f487+'/'+_0x596d71)[_0x8e97('0x1e')](_0x2f475c);}return null;};}function patchUpdates(_0x387748){return function(_0x1763e7){try{jsonpatch[_0x8e97('0x25')](_0x1763e7,_0x387748,!![]);}catch(_0x18fcdb){return BPromise[_0x8e97('0x26')](_0x18fcdb);}return _0x1763e7[_0x8e97('0x27')]();};}function saveUpdates(_0x517c1e,_0x5d5a94){return function(_0x4b08ed){if(_0x4b08ed){return _0x4b08ed[_0x8e97('0x28')](_0x517c1e)[_0x8e97('0x29')](function(_0x2be986){return _0x2be986;});}return null;};}function removeEntity(_0xcee009,_0x1bae19){return function(_0x10f327){if(_0x10f327){return _0x10f327[_0x8e97('0x2a')]()[_0x8e97('0x29')](function(){_0xcee009['status'](0xcc)[_0x8e97('0x2b')]();});}};}function handleEntityNotFound(_0x2a5f18,_0x33e801){return function(_0x5bb338){if(!_0x5bb338){_0x2a5f18[_0x8e97('0x2c')](0x194);}return _0x5bb338;};}function handleError(_0x4ef232,_0x7f0baf){_0x7f0baf=_0x7f0baf||0x1f4;return function(_0x7f3ea1){logger[_0x8e97('0x2d')](_0x7f3ea1[_0x8e97('0x2e')]);if(_0x7f3ea1[_0x8e97('0x2f')]){delete _0x7f3ea1[_0x8e97('0x2f')];}_0x4ef232[_0x8e97('0x1d')](_0x7f0baf)['send'](_0x7f3ea1);};}exports['show']=function(_0x1271c1,_0x364296){var _0x19d800={'raw':![],'where':{'id':_0x1271c1['params']['id']}},_0x3f24d0={};_0x3f24d0[_0x8e97('0x30')]=_[_0x8e97('0x31')](db[_0x8e97('0x32')][_0x8e97('0x33')]);_0x3f24d0[_0x8e97('0x34')]=_['keys'](_0x1271c1[_0x8e97('0x34')]);_0x3f24d0[_0x8e97('0x35')]=_[_0x8e97('0x36')](_0x3f24d0[_0x8e97('0x30')],_0x3f24d0[_0x8e97('0x34')]);_0x19d800['attributes']=_[_0x8e97('0x36')](_0x3f24d0['model'],qs[_0x8e97('0x37')](_0x1271c1[_0x8e97('0x34')][_0x8e97('0x37')]));_0x19d800[_0x8e97('0x38')]=_0x19d800[_0x8e97('0x38')]['length']?_0x19d800[_0x8e97('0x38')]:_0x3f24d0[_0x8e97('0x30')];if(_0x1271c1['query']['includeAll']){_0x19d800[_0x8e97('0x39')]=[{'all':!![]}];}_0x19d800=_[_0x8e97('0x3a')]({},_0x19d800,_0x1271c1[_0x8e97('0x3b')]);return db['DashboardItem'][_0x8e97('0x3c')](_0x19d800)[_0x8e97('0x29')](handleEntityNotFound(_0x364296,null))[_0x8e97('0x29')](respondWithResult(_0x364296,null))[_0x8e97('0x3d')](handleError(_0x364296,null));};exports[_0x8e97('0x2a')]=function(_0x535fde,_0x197b29){return db['DashboardItem'][_0x8e97('0x3c')]({'where':{'id':_0x535fde[_0x8e97('0x3e')]['id']}})[_0x8e97('0x29')](handleEntityNotFound(_0x197b29,null))['then'](removeEntity(_0x197b29,null))['catch'](handleError(_0x197b29,null));};function widgetAttributes(_0x3b8fae){try{switch(_0x3b8fae[_0x8e97('0x3f')]){case _0x8e97('0x40'):return[{'name':'attrUrl','value':_0x3b8fae['attrUrl']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0]['value']:undefined)||'https://'}];case _0x8e97('0x42'):return[{'name':'attrPath','value':_0x3b8fae[_0x8e97('0x43')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x45'):return[{'name':_0x8e97('0x46'),'value':_0x3b8fae['attrHourFormat']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x47')},{'name':_0x8e97('0x48'),'value':_0x3b8fae[_0x8e97('0x48')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae[_0x8e97('0x41')][0x1][_0x8e97('0x44')]:undefined)||_0x8e97('0x49')},{'name':'attrFontSize','value':_0x3b8fae[_0x8e97('0x4a')]||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x8e97('0x4b'),'value':_0x3b8fae[_0x8e97('0x4b')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x4c')},{'name':'attrVoiceQueues','value':_0x3b8fae[_0x8e97('0x4d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x1]?_0x3b8fae[_0x8e97('0x41')][0x1][_0x8e97('0x44')]:undefined)||[]},{'name':_0x8e97('0x4a'),'value':_0x3b8fae['attrFontSize']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x3b8fae[_0x8e97('0x4e')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x3]?_0x3b8fae[_0x8e97('0x41')][0x3][_0x8e97('0x44')]:undefined)||_0x8e97('0x4f')},{'name':'attrEmailAccounts','value':_0x3b8fae[_0x8e97('0x50')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x4]?_0x3b8fae[_0x8e97('0x41')][0x4]['value']:undefined)||''},{'name':_0x8e97('0x51'),'value':_0x3b8fae['attrFaxAccounts']||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x5]?_0x3b8fae[_0x8e97('0x41')][0x5][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x52'),'value':_0x3b8fae[_0x8e97('0x52')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x6]?_0x3b8fae[_0x8e97('0x41')][0x6][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x53'),'value':_0x3b8fae[_0x8e97('0x53')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x7]?_0x3b8fae['attrs'][0x7][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x54'),'value':_0x3b8fae['attrWhatsappAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x8]?_0x3b8fae[_0x8e97('0x41')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3b8fae[_0x8e97('0x55')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x9]?_0x3b8fae[_0x8e97('0x41')][0x9][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x56'):case _0x8e97('0x57'):return[{'name':_0x8e97('0x58'),'value':_0x3b8fae[_0x8e97('0x58')]||(_0x3b8fae['attrs']&&_0x3b8fae['attrs'][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x44')]:undefined)||_0x8e97('0x4c')},{'name':_0x8e97('0x59'),'value':_0x3b8fae['attrSerie2']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae['attrs'][0x1][_0x8e97('0x44')]:undefined)||null},{'name':_0x8e97('0x5a'),'value':_0x3b8fae[_0x8e97('0x5a')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x2]?_0x3b8fae[_0x8e97('0x41')][0x2]['value']:undefined)||null},{'name':_0x8e97('0x4d'),'value':_0x3b8fae[_0x8e97('0x4d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x3]?_0x3b8fae[_0x8e97('0x41')][0x3]['value']:undefined)||[]},{'name':_0x8e97('0x4e'),'value':_0x3b8fae['attrChannel']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x4]?_0x3b8fae['attrs'][0x4][_0x8e97('0x44')]:undefined)||_0x8e97('0x4f')},{'name':_0x8e97('0x50'),'value':_0x3b8fae[_0x8e97('0x50')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x5]?_0x3b8fae[_0x8e97('0x41')][0x5][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x51'),'value':_0x3b8fae['attrFaxAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x6]?_0x3b8fae[_0x8e97('0x41')][0x6][_0x8e97('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3b8fae[_0x8e97('0x52')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x7]?_0x3b8fae[_0x8e97('0x41')][0x7][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x53'),'value':_0x3b8fae[_0x8e97('0x53')]||(_0x3b8fae['attrs']&&_0x3b8fae['attrs'][0x8]?_0x3b8fae['attrs'][0x8][_0x8e97('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3b8fae['attrWhatsappAccounts']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x9]?_0x3b8fae[_0x8e97('0x41')][0x9][_0x8e97('0x44')]:undefined)||''},{'name':_0x8e97('0x55'),'value':_0x3b8fae['attrChatWebsites']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0xa]?_0x3b8fae[_0x8e97('0x41')][0xa][_0x8e97('0x44')]:undefined)||''}];case _0x8e97('0x5b'):return[{'name':_0x8e97('0x5c'),'type':_0x3b8fae['reportType']||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0][_0x8e97('0x3f')]:undefined)||null,'value':_0x3b8fae[_0x8e97('0x5c')]||(_0x3b8fae['attrs']&&_0x3b8fae[_0x8e97('0x41')][0x0]?_0x3b8fae[_0x8e97('0x41')][0x0]['value']:undefined)||null},{'name':_0x8e97('0x5d'),'value':_0x3b8fae[_0x8e97('0x5d')]||(_0x3b8fae[_0x8e97('0x41')]&&_0x3b8fae['attrs'][0x1]?_0x3b8fae['attrs'][0x1][_0x8e97('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5ec6d5){logger[_0x8e97('0x2d')](_0x8e97('0x5e'),JSON['stringify'](_0x5ec6d5));return[];}}exports[_0x8e97('0x5f')]=function(_0x36eaa6,_0x32a851){if(_0x36eaa6[_0x8e97('0x60')]){_0x36eaa6[_0x8e97('0x60')][_0x8e97('0x41')]=widgetAttributes(_0x36eaa6[_0x8e97('0x60')]);}return db[_0x8e97('0x32')][_0x8e97('0x5f')](_0x36eaa6[_0x8e97('0x60')],{})[_0x8e97('0x29')](respondWithResult(_0x32a851,0xc9))[_0x8e97('0x3d')](handleError(_0x32a851,null));};exports[_0x8e97('0x28')]=function(_0x181e0f,_0x4f5dce){if(_0x181e0f[_0x8e97('0x60')]['id']){delete _0x181e0f[_0x8e97('0x60')]['id'];}_0x181e0f['body'][_0x8e97('0x41')]=widgetAttributes(_0x181e0f['body']);return db[_0x8e97('0x32')]['find']({'where':{'id':_0x181e0f[_0x8e97('0x3e')]['id']}})[_0x8e97('0x29')](handleEntityNotFound(_0x4f5dce,null))['then'](saveUpdates(_0x181e0f[_0x8e97('0x60')],null))['then'](respondWithResult(_0x4f5dce,null))[_0x8e97('0x3d')](handleError(_0x4f5dce,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 8890c2c..a075cf9 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 _0x99b4=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1cb84c,_0x576b00){var _0x1ff4ed=function(_0x27e6b4){while(--_0x27e6b4){_0x1cb84c['push'](_0x1cb84c['shift']());}};_0x1ff4ed(++_0x576b00);}(_0x99b4,0x139));var _0x499b=function(_0x517369,_0x3b6b69){_0x517369=_0x517369-0x0;var _0x4a2428=_0x99b4[_0x517369];return _0x4a2428;};'use strict';var EventEmitter=require(_0x499b('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x499b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x499b('0x2'),'afterDestroy':_0x499b('0x3')};function emitEvent(_0x55401c){return function(_0x478ad4,_0x57ebbf,_0x2aba1d){DashboardItemEvents[_0x499b('0x4')](_0x55401c+':'+_0x478ad4['id'],_0x478ad4);DashboardItemEvents[_0x499b('0x4')](_0x55401c,_0x478ad4);_0x2aba1d(null);};}for(var e in events){if(events[_0x499b('0x5')](e)){var event=events[e];DashboardItem[_0x499b('0x6')](e,emitEvent(event));}}module[_0x499b('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xdf76=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hook','exports'];(function(_0x7725ea,_0x2c0c4a){var _0x3f05fb=function(_0x2e1f36){while(--_0x2e1f36){_0x7725ea['push'](_0x7725ea['shift']());}};_0x3f05fb(++_0x2c0c4a);}(_0xdf76,0x1c2));var _0x6df7=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0xdf76[_0x460fd7];return _0x44d1c2;};'use strict';var EventEmitter=require(_0x6df7('0x0'));var DashboardItem=require(_0x6df7('0x1'))['db'][_0x6df7('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6df7('0x3')](0x0);var events={'afterCreate':_0x6df7('0x4'),'afterUpdate':_0x6df7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a56e3){return function(_0x6f8419,_0x189291,_0x47ded0){DashboardItemEvents[_0x6df7('0x6')](_0x1a56e3+':'+_0x6f8419['id'],_0x6f8419);DashboardItemEvents[_0x6df7('0x6')](_0x1a56e3,_0x6f8419);_0x47ded0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x6df7('0x7')](e,emitEvent(event));}}module[_0x6df7('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d3c5ef0..4478351 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 _0x6343=['../../config/logger','api','request-promise','path','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','util'];(function(_0x5ccd0c,_0x4c70fb){var _0x5a0634=function(_0x245c52){while(--_0x245c52){_0x5ccd0c['push'](_0x5ccd0c['shift']());}};_0x5a0634(++_0x4c70fb);}(_0x6343,0x1e9));var _0x3634=function(_0x2074c0,_0x5146a8){_0x2074c0=_0x2074c0-0x0;var _0x514e2e=_0x6343[_0x2074c0];return _0x514e2e;};'use strict';var _=require('lodash');var util=require(_0x3634('0x0'));var logger=require(_0x3634('0x1'))(_0x3634('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3634('0x3'));var fs=require('fs');var path=require(_0x3634('0x4'));var rimraf=require(_0x3634('0x5'));var config=require('../../config/environment');var attributes=require(_0x3634('0x6'));module[_0x3634('0x7')]=function(_0x5db25c,_0x4c5f9a){return _0x5db25c['define'](_0x3634('0x8'),attributes,{'tableName':_0x3634('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd20e=['api','bluebird','request-promise','rimraf','../../config/environment','exports','DashboardItem','lodash','util','../../config/logger'];(function(_0x217e48,_0x2e4ae2){var _0x47f9c4=function(_0x4dc60c){while(--_0x4dc60c){_0x217e48['push'](_0x217e48['shift']());}};_0x47f9c4(++_0x2e4ae2);}(_0xd20e,0xbb));var _0xed20=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xd20e[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xed20('0x0'));var util=require(_0xed20('0x1'));var logger=require(_0xed20('0x2'))(_0xed20('0x3'));var moment=require('moment');var BPromise=require(_0xed20('0x4'));var rp=require(_0xed20('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed20('0x6'));var config=require(_0xed20('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xed20('0x8')]=function(_0x1eda4e,_0x408ac3){return _0x1eda4e['define'](_0xed20('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index fecd552..abd0c4b 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 _0x7703=['message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x7703,0x93));var _0x3770=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x7703[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var moment=require(_0x3770('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3770('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3770('0x4'))(_0x3770('0x5'));var config=require(_0x3770('0x6'));var jayson=require(_0x3770('0x7'));var client=jayson[_0x3770('0x8')][_0x3770('0x9')]({'port':0x232a});config['redis']=_[_0x3770('0xa')](config[_0x3770('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3770('0xc'))(new Redis(config['redis']));require(_0x3770('0xd'))[_0x3770('0xe')](socket);function respondWithRpcPromise(_0x12e9bc,_0x3893a5,_0x1ec7c7){return new BPromise(function(_0x541543,_0x20286d){return client['request'](_0x12e9bc,_0x1ec7c7)[_0x3770('0xf')](function(_0x1ec069){logger[_0x3770('0x10')](_0x3770('0x11'),_0x3893a5,_0x3770('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3893a5,_0x3770('0x12'),JSON['stringify'](_0x1ec069));if(_0x1ec069[_0x3770('0x13')]){if(_0x1ec069['error'][_0x3770('0x14')]===0x1f4){logger['error'](_0x3770('0x11'),_0x3893a5,_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);return _0x20286d(_0x1ec069[_0x3770('0x13')]['message']);}logger[_0x3770('0x13')](_0x3770('0x11'),_0x3893a5,_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);return _0x541543(_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);}else{logger[_0x3770('0x10')](_0x3770('0x11'),_0x3893a5,_0x3770('0x12'));_0x541543(_0x1ec069[_0x3770('0x16')][_0x3770('0x15')]);}})[_0x3770('0x17')](function(_0x53b502){logger[_0x3770('0x13')](_0x3770('0x11'),_0x3893a5,_0x53b502);_0x20286d(_0x53b502);});});} \ No newline at end of file +var _0x51d4=['DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x260082,_0xe76e2f){var _0x5d24ae=function(_0x1d548d){while(--_0x1d548d){_0x260082['push'](_0x260082['shift']());}};_0x5d24ae(++_0xe76e2f);}(_0x51d4,0x1ae));var _0x451d=function(_0x2e56fc,_0xcd8e83){_0x2e56fc=_0x2e56fc-0x0;var _0x1720f4=_0x51d4[_0x2e56fc];return _0x1720f4;};'use strict';var _=require(_0x451d('0x0'));var util=require(_0x451d('0x1'));var moment=require('moment');var BPromise=require(_0x451d('0x2'));var rs=require(_0x451d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x451d('0x4'))['db'];var utils=require(_0x451d('0x5'));var logger=require(_0x451d('0x6'))(_0x451d('0x7'));var config=require(_0x451d('0x8'));var jayson=require(_0x451d('0x9'));var client=jayson[_0x451d('0xa')][_0x451d('0xb')]({'port':0x232a});config[_0x451d('0xc')]=_[_0x451d('0xd')](config['redis'],{'host':_0x451d('0xe'),'port':0x18eb});var socket=require(_0x451d('0xf'))(new Redis(config[_0x451d('0xc')]));require(_0x451d('0x10'))[_0x451d('0x11')](socket);function respondWithRpcPromise(_0x300ced,_0x16a9de,_0x43f2ec){return new BPromise(function(_0x2eb65f,_0x38bae3){return client[_0x451d('0x12')](_0x300ced,_0x43f2ec)[_0x451d('0x13')](function(_0x3e603e){logger['info'](_0x451d('0x14'),_0x16a9de,_0x451d('0x15'));logger[_0x451d('0x16')](_0x451d('0x17'),_0x16a9de,_0x451d('0x15'),JSON[_0x451d('0x18')](_0x3e603e));if(_0x3e603e['error']){if(_0x3e603e['error'][_0x451d('0x19')]===0x1f4){logger[_0x451d('0x1a')](_0x451d('0x14'),_0x16a9de,_0x3e603e[_0x451d('0x1a')][_0x451d('0x1b')]);return _0x38bae3(_0x3e603e[_0x451d('0x1a')]['message']);}logger[_0x451d('0x1a')](_0x451d('0x14'),_0x16a9de,_0x3e603e[_0x451d('0x1a')][_0x451d('0x1b')]);return _0x2eb65f(_0x3e603e[_0x451d('0x1a')][_0x451d('0x1b')]);}else{logger[_0x451d('0x1c')](_0x451d('0x14'),_0x16a9de,_0x451d('0x15'));_0x2eb65f(_0x3e603e[_0x451d('0x1d')][_0x451d('0x1b')]);}})['catch'](function(_0x5c3f61){logger[_0x451d('0x1a')](_0x451d('0x14'),_0x16a9de,_0x5c3f61);_0x38bae3(_0x5c3f61);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 62b8f3d..3e3f54d 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 _0x3fcb=['remove','update','emit','removeListener','register','length','dashboardItem:','save'];(function(_0xa06e0b,_0x6c2305){var _0x14142f=function(_0x2ac612){while(--_0x2ac612){_0xa06e0b['push'](_0xa06e0b['shift']());}};_0x14142f(++_0x6c2305);}(_0x3fcb,0x1bf));var _0xb3fc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3fcb[_0xbca1b1];return _0x4e1686;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb3fc('0x0'),_0xb3fc('0x1'),_0xb3fc('0x2')];function createListener(_0x3adf8d,_0x474491){return function(_0x1764ca){_0x474491[_0xb3fc('0x3')](_0x3adf8d,_0x1764ca);};}function removeListener(_0x19705a,_0x43150e){return function(){DashboardItemEvents[_0xb3fc('0x4')](_0x19705a,_0x43150e);};}exports[_0xb3fc('0x5')]=function(_0x5b0254){for(var _0x29e7ef=0x0,_0x491a82=events[_0xb3fc('0x6')];_0x29e7ef<_0x491a82;_0x29e7ef++){var _0x57a45c=events[_0x29e7ef];var _0x5367bb=createListener(_0xb3fc('0x7')+_0x57a45c,_0x5b0254);DashboardItemEvents['on'](_0x57a45c,_0x5367bb);}}; \ No newline at end of file +var _0x4521=['length','dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener','register'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4521,0xd2));var _0x1452=function(_0xbb874,_0x2b7f90){_0xbb874=_0xbb874-0x0;var _0x13a525=_0x4521[_0xbb874];return _0x13a525;};'use strict';var DashboardItemEvents=require(_0x1452('0x0'));var events=['save',_0x1452('0x1'),_0x1452('0x2')];function createListener(_0x1d43a1,_0x4c328e){return function(_0x1d2aa5){_0x4c328e[_0x1452('0x3')](_0x1d43a1,_0x1d2aa5);};}function removeListener(_0x2301a0,_0xf0942b){return function(){DashboardItemEvents[_0x1452('0x4')](_0x2301a0,_0xf0942b);};}exports[_0x1452('0x5')]=function(_0x584955){for(var _0x362547=0x0,_0x265c34=events[_0x1452('0x6')];_0x362547<_0x265c34;_0x362547++){var _0x1b0e74=events[_0x362547];var _0x74eb99=createListener(_0x1452('0x7')+_0x1b0e74,_0x584955);DashboardItemEvents['on'](_0x1b0e74,_0x74eb99);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index cbe50b2..f3ce492 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 _0x5f0d=['post','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboardItem.controller','show'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5f0d,0x1a6));var _0xd5f0=function(_0x46a088,_0x1d5b12){_0x46a088=_0x46a088-0x0;var _0x490de3=_0x5f0d[_0x46a088];return _0x490de3;};'use strict';var multer=require(_0xd5f0('0x0'));var util=require(_0xd5f0('0x1'));var path=require(_0xd5f0('0x2'));var timeout=require(_0xd5f0('0x3'));var express=require(_0xd5f0('0x4'));var router=express[_0xd5f0('0x5')]();var fs_extra=require(_0xd5f0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd5f0('0x7'));var controller=require(_0xd5f0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5f0('0x9')]);router[_0xd5f0('0xa')]('/',auth[_0xd5f0('0xb')](),controller[_0xd5f0('0xc')]);router[_0xd5f0('0xd')](_0xd5f0('0xe'),auth[_0xd5f0('0xb')](),controller[_0xd5f0('0xf')]);router[_0xd5f0('0x10')](_0xd5f0('0xe'),auth[_0xd5f0('0xb')](),controller['destroy']);module[_0xd5f0('0x11')]=router; \ No newline at end of file +var _0x4e44=['Router','../../components/auth/service','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','util','path','express'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x4e44,0x1cd));var _0x44e4=function(_0x51d188,_0x937fba){_0x51d188=_0x51d188-0x0;var _0x27289b=_0x4e44[_0x51d188];return _0x27289b;};'use strict';var multer=require(_0x44e4('0x0'));var util=require(_0x44e4('0x1'));var path=require(_0x44e4('0x2'));var timeout=require('connect-timeout');var express=require(_0x44e4('0x3'));var router=express[_0x44e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x44e4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x44e4('0x6')](_0x44e4('0x7'),auth['isAuthenticated'](),controller[_0x44e4('0x8')]);router[_0x44e4('0x9')]('/',auth[_0x44e4('0xa')](),controller[_0x44e4('0xb')]);router['put'](_0x44e4('0x7'),auth[_0x44e4('0xa')](),controller[_0x44e4('0xc')]);router[_0x44e4('0xd')](_0x44e4('0x7'),auth[_0x44e4('0xa')](),controller[_0x44e4('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 539bfee..3ff2637 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 _0xf804=['first','exports','ENUM','second'];(function(_0x495e8f,_0x2b5af6){var _0x2dd9f3=function(_0x1517b9){while(--_0x1517b9){_0x495e8f['push'](_0x495e8f['shift']());}};_0x2dd9f3(++_0x2b5af6);}(_0xf804,0x81));var _0x4f80=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf804[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x4f80('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x4f80('0x1')]('first',_0x4f80('0x2'),'third'),'allowNull':![],'defaultValue':_0x4f80('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc547=['STRING','sequelize','ENUM','first','second','third'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xc547,0xaf));var _0x7c54=function(_0x4d6400,_0x40ef47){_0x4d6400=_0x4d6400-0x0;var _0x5d89a4=_0xc547[_0x4d6400];return _0x5d89a4;};'use strict';var Sequelize=require(_0x7c54('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x7c54('0x1')](_0x7c54('0x2'),_0x7c54('0x3'),_0x7c54('0x4')),'allowNull':![],'defaultValue':_0x7c54('0x2')},'description':{'type':Sequelize[_0x7c54('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 42b164e..6f7ae4b 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 _0xd9dc=['update','destroy','Dispositions','then','sendStatus','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','Disposition','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','Content-Range','apply','save'];(function(_0x16764b,_0x392163){var _0x418b11=function(_0x4c6745){while(--_0x4c6745){_0x16764b['push'](_0x16764b['shift']());}};_0x418b11(++_0x392163);}(_0xd9dc,0x18b));var _0xcd9d=function(_0x2d2823,_0x2c1e2f){_0x2d2823=_0x2d2823-0x0;var _0x339a27=_0xd9dc[_0x2d2823];return _0x339a27;};'use strict';var emlformat=require(_0xcd9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require(_0xcd9d('0x2'));var rp=require(_0xcd9d('0x3'));var moment=require(_0xcd9d('0x4'));var BPromise=require(_0xcd9d('0x5'));var Mustache=require(_0xcd9d('0x6'));var util=require(_0xcd9d('0x7'));var path=require(_0xcd9d('0x8'));var sox=require(_0xcd9d('0x9'));var csv=require(_0xcd9d('0xa'));var ejs=require(_0xcd9d('0xb'));var fs=require('fs');var fs_extra=require(_0xcd9d('0xc'));var _=require(_0xcd9d('0xd'));var squel=require(_0xcd9d('0xe'));var crypto=require('crypto');var jsforce=require(_0xcd9d('0xf'));var deskjs=require(_0xcd9d('0x10'));var toCsv=require(_0xcd9d('0xa'));var querystring=require(_0xcd9d('0x11'));var Papa=require(_0xcd9d('0x12'));var Redis=require(_0xcd9d('0x13'));var authService=require(_0xcd9d('0x14'));var qs=require(_0xcd9d('0x15'));var as=require(_0xcd9d('0x16'));var hardwareService=require(_0xcd9d('0x17'));var logger=require(_0xcd9d('0x18'))(_0xcd9d('0x19'));var utils=require(_0xcd9d('0x1a'));var config=require(_0xcd9d('0x1b'));var licenseUtil=require(_0xcd9d('0x1c'));var db=require(_0xcd9d('0x1d'))['db'];function respondWithStatusCode(_0x2a7c70,_0x24e9eb){_0x24e9eb=_0x24e9eb||0xcc;return function(_0x26f7b4){if(_0x26f7b4){return _0x2a7c70['sendStatus'](_0x24e9eb);}return _0x2a7c70['status'](_0x24e9eb)[_0xcd9d('0x1e')]();};}function respondWithResult(_0x5beba3,_0x3fe56d){_0x3fe56d=_0x3fe56d||0xc8;return function(_0x195a50){if(_0x195a50){return _0x5beba3[_0xcd9d('0x1f')](_0x3fe56d)[_0xcd9d('0x20')](_0x195a50);}};}function respondWithFilteredResult(_0x5c8a04,_0xaed2f9){return function(_0x2e5b9e){if(_0x2e5b9e){var _0x9481e3=typeof _0xaed2f9['offset']==='undefined'&&typeof _0xaed2f9['limit']===_0xcd9d('0x21');var _0x1052b7=_0x2e5b9e[_0xcd9d('0x22')];var _0x4e18e8=_0x9481e3?0x0:_0xaed2f9[_0xcd9d('0x23')];var _0x2cc86a=_0x9481e3?_0x2e5b9e['count']:_0xaed2f9[_0xcd9d('0x23')]+_0xaed2f9[_0xcd9d('0x24')];var _0x47ae73;if(_0x2cc86a>=_0x1052b7){_0x2cc86a=_0x1052b7;_0x47ae73=0xc8;}else{_0x47ae73=0xce;}_0x5c8a04['status'](_0x47ae73);return _0x5c8a04['set'](_0xcd9d('0x25'),_0x4e18e8+'-'+_0x2cc86a+'/'+_0x1052b7)['json'](_0x2e5b9e);}return null;};}function patchUpdates(_0x4a873b){return function(_0x1d2ac2){try{jsonpatch[_0xcd9d('0x26')](_0x1d2ac2,_0x4a873b,!![]);}catch(_0x287dbe){return BPromise['reject'](_0x287dbe);}return _0x1d2ac2[_0xcd9d('0x27')]();};}function saveUpdates(_0x47e5a5,_0x16b8e0){return function(_0x557354){if(_0x557354){return _0x557354[_0xcd9d('0x28')](_0x47e5a5)['then'](function(_0x10fa94){return _0x10fa94;});}return null;};}function removeEntity(_0xfca313,_0x289771){return function(_0x3d421f){if(_0x3d421f){return _0x3d421f[_0xcd9d('0x29')]()['then'](function(){var _0x15bb5d=_0x3d421f['get']({'plain':!![]});var _0x4cdb1d=_0xcd9d('0x2a');return db['UserProfileResource'][_0xcd9d('0x29')]({'where':{'type':_0x4cdb1d,'resourceId':_0x15bb5d['id']}})[_0xcd9d('0x2b')](function(){return _0x3d421f;});})[_0xcd9d('0x2b')](function(){_0xfca313['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x94d7e0,_0x4eb1c0){return function(_0x1b6c0b){if(!_0x1b6c0b){_0x94d7e0[_0xcd9d('0x2c')](0x194);}return _0x1b6c0b;};}function handleError(_0x5d58bc,_0x37dc1a){_0x37dc1a=_0x37dc1a||0x1f4;return function(_0x113979){logger['error'](_0x113979[_0xcd9d('0x2d')]);if(_0x113979['name']){delete _0x113979[_0xcd9d('0x2e')];}_0x5d58bc['status'](_0x37dc1a)[_0xcd9d('0x2f')](_0x113979);};}exports[_0xcd9d('0x30')]=function(_0x27e2c4,_0x4801dd){var _0x22fb76={},_0xf38a99={},_0x4a4bc3={'count':0x0,'rows':[]};var _0x5385be=_['map'](db['Disposition'][_0xcd9d('0x31')],function(_0x4e2fea){return{'name':_0x4e2fea['fieldName'],'type':_0x4e2fea[_0xcd9d('0x32')][_0xcd9d('0x33')]};});_0xf38a99[_0xcd9d('0x34')]=_[_0xcd9d('0x35')](_0x5385be,_0xcd9d('0x2e'));_0xf38a99[_0xcd9d('0x36')]=_['keys'](_0x27e2c4[_0xcd9d('0x36')]);_0xf38a99[_0xcd9d('0x37')]=_[_0xcd9d('0x38')](_0xf38a99[_0xcd9d('0x34')],_0xf38a99[_0xcd9d('0x36')]);_0x22fb76[_0xcd9d('0x39')]=_[_0xcd9d('0x38')](_0xf38a99[_0xcd9d('0x34')],qs[_0xcd9d('0x3a')](_0x27e2c4['query'][_0xcd9d('0x3a')]));_0x22fb76[_0xcd9d('0x39')]=_0x22fb76[_0xcd9d('0x39')][_0xcd9d('0x3b')]?_0x22fb76[_0xcd9d('0x39')]:_0xf38a99['model'];if(!_0x27e2c4['query'][_0xcd9d('0x3c')]('nolimit')){_0x22fb76['limit']=qs[_0xcd9d('0x24')](_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x24')]);_0x22fb76[_0xcd9d('0x23')]=qs['offset'](_0x27e2c4[_0xcd9d('0x36')]['offset']);}_0x22fb76[_0xcd9d('0x3d')]=qs[_0xcd9d('0x3e')](_0x27e2c4[_0xcd9d('0x36')]['sort']);_0x22fb76[_0xcd9d('0x3f')]=qs[_0xcd9d('0x37')](_[_0xcd9d('0x40')](_0x27e2c4[_0xcd9d('0x36')],_0xf38a99[_0xcd9d('0x37')]),_0x5385be);if(_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x41')]){_0x22fb76['where']=_['merge'](_0x22fb76['where'],{'$or':_[_0xcd9d('0x35')](_0x5385be,function(_0x37bbb1){if(_0x37bbb1[_0xcd9d('0x32')]!==_0xcd9d('0x42')){var _0x1e67d2={};_0x1e67d2[_0x37bbb1['name']]={'$like':'%'+_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x41')]+'%'};return _0x1e67d2;}})});}_0x22fb76=_[_0xcd9d('0x43')]({},_0x22fb76,_0x27e2c4[_0xcd9d('0x44')]);var _0x16c773={'where':_0x22fb76[_0xcd9d('0x3f')]};return db['Disposition'][_0xcd9d('0x22')](_0x16c773)[_0xcd9d('0x2b')](function(_0x46b781){_0x4a4bc3['count']=_0x46b781;if(_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x45')]){_0x22fb76['include']=[{'all':!![]}];}return db[_0xcd9d('0x46')][_0xcd9d('0x47')](_0x22fb76);})[_0xcd9d('0x2b')](function(_0x105d50){_0x4a4bc3[_0xcd9d('0x48')]=_0x105d50;return _0x4a4bc3;})['then'](respondWithFilteredResult(_0x4801dd,_0x22fb76))[_0xcd9d('0x49')](handleError(_0x4801dd,null));};exports[_0xcd9d('0x4a')]=function(_0x1bccd6,_0x121634){var _0x402462={'raw':!![],'where':{'id':_0x1bccd6[_0xcd9d('0x4b')]['id']}},_0x4d0dff={};_0x4d0dff[_0xcd9d('0x34')]=_[_0xcd9d('0x4c')](db['Disposition'][_0xcd9d('0x31')]);_0x4d0dff[_0xcd9d('0x36')]=_[_0xcd9d('0x4c')](_0x1bccd6[_0xcd9d('0x36')]);_0x4d0dff[_0xcd9d('0x37')]=_['intersection'](_0x4d0dff[_0xcd9d('0x34')],_0x4d0dff['query']);_0x402462[_0xcd9d('0x39')]=_['intersection'](_0x4d0dff[_0xcd9d('0x34')],qs['fields'](_0x1bccd6['query'][_0xcd9d('0x3a')]));_0x402462[_0xcd9d('0x39')]=_0x402462['attributes'][_0xcd9d('0x3b')]?_0x402462[_0xcd9d('0x39')]:_0x4d0dff[_0xcd9d('0x34')];if(_0x1bccd6[_0xcd9d('0x36')][_0xcd9d('0x45')]){_0x402462['include']=[{'all':!![]}];}_0x402462=_[_0xcd9d('0x43')]({},_0x402462,_0x1bccd6[_0xcd9d('0x44')]);return db[_0xcd9d('0x46')][_0xcd9d('0x4d')](_0x402462)[_0xcd9d('0x2b')](handleEntityNotFound(_0x121634,null))[_0xcd9d('0x2b')](respondWithResult(_0x121634,null))[_0xcd9d('0x49')](handleError(_0x121634,null));};exports[_0xcd9d('0x4e')]=function(_0xf2946e,_0x5d1a43){return db['Disposition']['create'](_0xf2946e[_0xcd9d('0x4f')],{})[_0xcd9d('0x2b')](function(_0xea1ebd){var _0x318d3e=_0xf2946e[_0xcd9d('0x50')][_0xcd9d('0x51')]({'plain':!![]});if(!_0x318d3e)throw new Error(_0xcd9d('0x52'));if(_0x318d3e['role']===_0xcd9d('0x50')){var _0x135990=_0xea1ebd[_0xcd9d('0x51')]({'plain':!![]});var _0x469475=_0xcd9d('0x2a');return db[_0xcd9d('0x53')][_0xcd9d('0x4d')]({'where':{'name':_0x469475,'userProfileId':_0x318d3e[_0xcd9d('0x54')]},'raw':!![]})[_0xcd9d('0x2b')](function(_0x11db47){if(_0x11db47&&_0x11db47[_0xcd9d('0x55')]===0x0){return db['UserProfileResource'][_0xcd9d('0x4e')]({'name':_0x135990[_0xcd9d('0x2e')],'resourceId':_0x135990['id'],'type':_0x11db47[_0xcd9d('0x2e')],'sectionId':_0x11db47['id']},{})[_0xcd9d('0x2b')](function(){return _0xea1ebd;});}else{return _0xea1ebd;}})['catch'](function(_0x42670c){logger[_0xcd9d('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42670c);throw _0x42670c;});}return _0xea1ebd;})[_0xcd9d('0x2b')](respondWithResult(_0x5d1a43,0xc9))['catch'](handleError(_0x5d1a43,null));};exports[_0xcd9d('0x28')]=function(_0x5c682f,_0x42a505){if(_0x5c682f['body']['id']){delete _0x5c682f['body']['id'];}return db[_0xcd9d('0x46')]['find']({'where':{'id':_0x5c682f['params']['id']}})[_0xcd9d('0x2b')](handleEntityNotFound(_0x42a505,null))['then'](saveUpdates(_0x5c682f[_0xcd9d('0x4f')],null))['then'](respondWithResult(_0x42a505,null))[_0xcd9d('0x49')](handleError(_0x42a505,null));};exports[_0xcd9d('0x29')]=function(_0x1c230d,_0x4dbeae){return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x1c230d[_0xcd9d('0x4b')]['id']}})[_0xcd9d('0x2b')](handleEntityNotFound(_0x4dbeae,null))[_0xcd9d('0x2b')](removeEntity(_0x4dbeae,null))[_0xcd9d('0x49')](handleError(_0x4dbeae,null));}; \ No newline at end of file +var _0xf6f0=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','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','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','then','get','Dispositions','end','error','name','index','map','Disposition','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes'];(function(_0x251762,_0xba82a5){var _0x54dd64=function(_0x2a8f72){while(--_0x2a8f72){_0x251762['push'](_0x251762['shift']());}};_0x54dd64(++_0xba82a5);}(_0xf6f0,0x157));var _0x0f6f=function(_0x2d0fff,_0x128adc){_0x2d0fff=_0x2d0fff-0x0;var _0x40c5b1=_0xf6f0[_0x2d0fff];return _0x40c5b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f6f('0x0'));var rp=require(_0x0f6f('0x1'));var moment=require(_0x0f6f('0x2'));var BPromise=require(_0x0f6f('0x3'));var Mustache=require(_0x0f6f('0x4'));var util=require(_0x0f6f('0x5'));var path=require(_0x0f6f('0x6'));var sox=require(_0x0f6f('0x7'));var csv=require(_0x0f6f('0x8'));var ejs=require(_0x0f6f('0x9'));var fs=require('fs');var fs_extra=require(_0x0f6f('0xa'));var _=require(_0x0f6f('0xb'));var squel=require(_0x0f6f('0xc'));var crypto=require(_0x0f6f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0f6f('0xe'));var toCsv=require(_0x0f6f('0x8'));var querystring=require(_0x0f6f('0xf'));var Papa=require(_0x0f6f('0x10'));var Redis=require(_0x0f6f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0f6f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f6f('0x13'));var logger=require('../../config/logger')(_0x0f6f('0x14'));var utils=require(_0x0f6f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0f6f('0x16'));var db=require(_0x0f6f('0x17'))['db'];function respondWithStatusCode(_0x26d8b3,_0x5e1c60){_0x5e1c60=_0x5e1c60||0xcc;return function(_0x36f908){if(_0x36f908){return _0x26d8b3[_0x0f6f('0x18')](_0x5e1c60);}return _0x26d8b3[_0x0f6f('0x19')](_0x5e1c60)['end']();};}function respondWithResult(_0x3e8595,_0x1ce704){_0x1ce704=_0x1ce704||0xc8;return function(_0x3a5cfd){if(_0x3a5cfd){return _0x3e8595[_0x0f6f('0x19')](_0x1ce704)[_0x0f6f('0x1a')](_0x3a5cfd);}};}function respondWithFilteredResult(_0x462073,_0x323756){return function(_0x19ef40){if(_0x19ef40){var _0x519512=typeof _0x323756[_0x0f6f('0x1b')]===_0x0f6f('0x1c')&&typeof _0x323756[_0x0f6f('0x1d')]===_0x0f6f('0x1c');var _0x4ab23f=_0x19ef40[_0x0f6f('0x1e')];var _0x156a5e=_0x519512?0x0:_0x323756[_0x0f6f('0x1b')];var _0x22adcc=_0x519512?_0x19ef40[_0x0f6f('0x1e')]:_0x323756['offset']+_0x323756['limit'];var _0x1b0422;if(_0x22adcc>=_0x4ab23f){_0x22adcc=_0x4ab23f;_0x1b0422=0xc8;}else{_0x1b0422=0xce;}_0x462073[_0x0f6f('0x19')](_0x1b0422);return _0x462073['set'](_0x0f6f('0x1f'),_0x156a5e+'-'+_0x22adcc+'/'+_0x4ab23f)[_0x0f6f('0x1a')](_0x19ef40);}return null;};}function patchUpdates(_0x4c801b){return function(_0x476a1d){try{jsonpatch[_0x0f6f('0x20')](_0x476a1d,_0x4c801b,!![]);}catch(_0x5bf46a){return BPromise['reject'](_0x5bf46a);}return _0x476a1d['save']();};}function saveUpdates(_0x4679a8,_0x304707){return function(_0x55a42d){if(_0x55a42d){return _0x55a42d['update'](_0x4679a8)['then'](function(_0x1bc684){return _0x1bc684;});}return null;};}function removeEntity(_0x1aeafd,_0x499e6f){return function(_0x1fd47b){if(_0x1fd47b){return _0x1fd47b[_0x0f6f('0x21')]()[_0x0f6f('0x22')](function(){var _0x2d39b6=_0x1fd47b[_0x0f6f('0x23')]({'plain':!![]});var _0x5b118a=_0x0f6f('0x24');return db['UserProfileResource'][_0x0f6f('0x21')]({'where':{'type':_0x5b118a,'resourceId':_0x2d39b6['id']}})[_0x0f6f('0x22')](function(){return _0x1fd47b;});})[_0x0f6f('0x22')](function(){_0x1aeafd[_0x0f6f('0x19')](0xcc)[_0x0f6f('0x25')]();});}};}function handleEntityNotFound(_0x291609,_0x14700e){return function(_0x431d05){if(!_0x431d05){_0x291609['sendStatus'](0x194);}return _0x431d05;};}function handleError(_0x3e6618,_0x2e7b28){_0x2e7b28=_0x2e7b28||0x1f4;return function(_0x21c262){logger[_0x0f6f('0x26')](_0x21c262['stack']);if(_0x21c262[_0x0f6f('0x27')]){delete _0x21c262[_0x0f6f('0x27')];}_0x3e6618[_0x0f6f('0x19')](_0x2e7b28)['send'](_0x21c262);};}exports[_0x0f6f('0x28')]=function(_0x47c684,_0x325312){var _0x4d43ed={},_0x12feec={},_0x11b9bc={'count':0x0,'rows':[]};var _0x293397=_[_0x0f6f('0x29')](db[_0x0f6f('0x2a')][_0x0f6f('0x2b')],function(_0x24bc52){return{'name':_0x24bc52[_0x0f6f('0x2c')],'type':_0x24bc52[_0x0f6f('0x2d')]['key']};});_0x12feec['model']=_[_0x0f6f('0x29')](_0x293397,'name');_0x12feec['query']=_[_0x0f6f('0x2e')](_0x47c684[_0x0f6f('0x2f')]);_0x12feec[_0x0f6f('0x30')]=_[_0x0f6f('0x31')](_0x12feec[_0x0f6f('0x32')],_0x12feec['query']);_0x4d43ed[_0x0f6f('0x33')]=_[_0x0f6f('0x31')](_0x12feec[_0x0f6f('0x32')],qs['fields'](_0x47c684[_0x0f6f('0x2f')]['fields']));_0x4d43ed[_0x0f6f('0x33')]=_0x4d43ed[_0x0f6f('0x33')][_0x0f6f('0x34')]?_0x4d43ed['attributes']:_0x12feec[_0x0f6f('0x32')];if(!_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x35')](_0x0f6f('0x36'))){_0x4d43ed['limit']=qs[_0x0f6f('0x1d')](_0x47c684[_0x0f6f('0x2f')]['limit']);_0x4d43ed['offset']=qs[_0x0f6f('0x1b')](_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x1b')]);}_0x4d43ed[_0x0f6f('0x37')]=qs[_0x0f6f('0x38')](_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x38')]);_0x4d43ed[_0x0f6f('0x39')]=qs[_0x0f6f('0x30')](_[_0x0f6f('0x3a')](_0x47c684[_0x0f6f('0x2f')],_0x12feec['filters']),_0x293397);if(_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x3b')]){_0x4d43ed['where']=_[_0x0f6f('0x3c')](_0x4d43ed[_0x0f6f('0x39')],{'$or':_[_0x0f6f('0x29')](_0x293397,function(_0x5628c8){if(_0x5628c8[_0x0f6f('0x2d')]!==_0x0f6f('0x3d')){var _0x212499={};_0x212499[_0x5628c8[_0x0f6f('0x27')]]={'$like':'%'+_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x3b')]+'%'};return _0x212499;}})});}_0x4d43ed=_[_0x0f6f('0x3c')]({},_0x4d43ed,_0x47c684[_0x0f6f('0x3e')]);var _0x107d2d={'where':_0x4d43ed[_0x0f6f('0x39')]};return db[_0x0f6f('0x2a')][_0x0f6f('0x1e')](_0x107d2d)[_0x0f6f('0x22')](function(_0x36af26){_0x11b9bc[_0x0f6f('0x1e')]=_0x36af26;if(_0x47c684[_0x0f6f('0x2f')][_0x0f6f('0x3f')]){_0x4d43ed[_0x0f6f('0x40')]=[{'all':!![]}];}return db[_0x0f6f('0x2a')]['findAll'](_0x4d43ed);})[_0x0f6f('0x22')](function(_0x4e6728){_0x11b9bc[_0x0f6f('0x41')]=_0x4e6728;return _0x11b9bc;})['then'](respondWithFilteredResult(_0x325312,_0x4d43ed))[_0x0f6f('0x42')](handleError(_0x325312,null));};exports[_0x0f6f('0x43')]=function(_0x5e26ce,_0x5b9ca0){var _0x11bb8f={'raw':!![],'where':{'id':_0x5e26ce[_0x0f6f('0x44')]['id']}},_0x3e70c8={};_0x3e70c8[_0x0f6f('0x32')]=_[_0x0f6f('0x2e')](db[_0x0f6f('0x2a')]['rawAttributes']);_0x3e70c8[_0x0f6f('0x2f')]=_[_0x0f6f('0x2e')](_0x5e26ce['query']);_0x3e70c8[_0x0f6f('0x30')]=_['intersection'](_0x3e70c8[_0x0f6f('0x32')],_0x3e70c8[_0x0f6f('0x2f')]);_0x11bb8f[_0x0f6f('0x33')]=_['intersection'](_0x3e70c8['model'],qs[_0x0f6f('0x45')](_0x5e26ce[_0x0f6f('0x2f')]['fields']));_0x11bb8f[_0x0f6f('0x33')]=_0x11bb8f[_0x0f6f('0x33')][_0x0f6f('0x34')]?_0x11bb8f[_0x0f6f('0x33')]:_0x3e70c8[_0x0f6f('0x32')];if(_0x5e26ce[_0x0f6f('0x2f')][_0x0f6f('0x3f')]){_0x11bb8f[_0x0f6f('0x40')]=[{'all':!![]}];}_0x11bb8f=_[_0x0f6f('0x3c')]({},_0x11bb8f,_0x5e26ce[_0x0f6f('0x3e')]);return db[_0x0f6f('0x2a')]['find'](_0x11bb8f)[_0x0f6f('0x22')](handleEntityNotFound(_0x5b9ca0,null))['then'](respondWithResult(_0x5b9ca0,null))[_0x0f6f('0x42')](handleError(_0x5b9ca0,null));};exports[_0x0f6f('0x46')]=function(_0x48a95f,_0xad5b45){return db[_0x0f6f('0x2a')][_0x0f6f('0x46')](_0x48a95f[_0x0f6f('0x47')],{})[_0x0f6f('0x22')](function(_0x8df099){var _0xc0dfde=_0x48a95f[_0x0f6f('0x48')][_0x0f6f('0x23')]({'plain':!![]});if(!_0xc0dfde)throw new Error(_0x0f6f('0x49'));if(_0xc0dfde['role']==='user'){var _0x5159ca=_0x8df099[_0x0f6f('0x23')]({'plain':!![]});var _0x51ccf4=_0x0f6f('0x24');return db['UserProfileSection'][_0x0f6f('0x4a')]({'where':{'name':_0x51ccf4,'userProfileId':_0xc0dfde[_0x0f6f('0x4b')]},'raw':!![]})['then'](function(_0x7fe4a9){if(_0x7fe4a9&&_0x7fe4a9['autoAssociation']===0x0){return db[_0x0f6f('0x4c')][_0x0f6f('0x46')]({'name':_0x5159ca['name'],'resourceId':_0x5159ca['id'],'type':_0x7fe4a9[_0x0f6f('0x27')],'sectionId':_0x7fe4a9['id']},{})[_0x0f6f('0x22')](function(){return _0x8df099;});}else{return _0x8df099;}})[_0x0f6f('0x42')](function(_0xce2407){logger[_0x0f6f('0x26')](_0x0f6f('0x4d'),_0xce2407);throw _0xce2407;});}return _0x8df099;})[_0x0f6f('0x22')](respondWithResult(_0xad5b45,0xc9))[_0x0f6f('0x42')](handleError(_0xad5b45,null));};exports[_0x0f6f('0x4e')]=function(_0x5ab028,_0x139404){if(_0x5ab028['body']['id']){delete _0x5ab028['body']['id'];}return db['Disposition'][_0x0f6f('0x4a')]({'where':{'id':_0x5ab028['params']['id']}})[_0x0f6f('0x22')](handleEntityNotFound(_0x139404,null))[_0x0f6f('0x22')](saveUpdates(_0x5ab028[_0x0f6f('0x47')],null))[_0x0f6f('0x22')](respondWithResult(_0x139404,null))[_0x0f6f('0x42')](handleError(_0x139404,null));};exports[_0x0f6f('0x21')]=function(_0x2b22ee,_0x10d24e){return db['Disposition'][_0x0f6f('0x4a')]({'where':{'id':_0x2b22ee[_0x0f6f('0x44')]['id']}})[_0x0f6f('0x22')](handleEntityNotFound(_0x10d24e,null))[_0x0f6f('0x22')](removeEntity(_0x10d24e,null))[_0x0f6f('0x42')](handleError(_0x10d24e,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9f5b237..9d1fff8 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 _0x1f07=['name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId'];(function(_0x574fc1,_0x9079d){var _0x422848=function(_0x6e6906){while(--_0x6e6906){_0x574fc1['push'](_0x574fc1['shift']());}};_0x422848(++_0x9079d);}(_0x1f07,0x148));var _0x71f0=function(_0x6a13ef,_0x5e6baf){_0x6a13ef=_0x6a13ef-0x0;var _0x35262b=_0x1f07[_0x6a13ef];return _0x35262b;};'use strict';var _=require('lodash');var util=require(_0x71f0('0x0'));var logger=require(_0x71f0('0x1'))(_0x71f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71f0('0x3'));var fs=require('fs');var path=require(_0x71f0('0x4'));var rimraf=require(_0x71f0('0x5'));var config=require(_0x71f0('0x6'));var attributes=require(_0x71f0('0x7'));module['exports']=function(_0x225f7f,_0x202262){return _0x225f7f[_0x71f0('0x8')](_0x71f0('0x9'),attributes,{'tableName':_0x71f0('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x71f0('0xb'),'fields':[_0x71f0('0xc'),_0x71f0('0xd')]},{'unique':!![],'name':_0x71f0('0xe'),'fields':[_0x71f0('0xc'),_0x71f0('0xf')]},{'unique':!![],'name':_0x71f0('0x10'),'fields':[_0x71f0('0xc'),_0x71f0('0x11')]},{'unique':!![],'name':_0x71f0('0x12'),'fields':[_0x71f0('0xc'),_0x71f0('0x13')]},{'unique':!![],'name':_0x71f0('0x14'),'fields':['name',_0x71f0('0x15')]},{'unique':!![],'name':_0x71f0('0x16'),'fields':[_0x71f0('0xc'),_0x71f0('0x17')]},{'unique':!![],'name':_0x71f0('0x18'),'fields':[_0x71f0('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xef43=['api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x32055a,_0x3456ec){var _0x469c56=function(_0x4c09a6){while(--_0x4c09a6){_0x32055a['push'](_0x32055a['shift']());}};_0x469c56(++_0x3456ec);}(_0xef43,0x1bf));var _0x3ef4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xef43[_0x432682];return _0x463d05;};'use strict';var _=require(_0x3ef4('0x0'));var util=require(_0x3ef4('0x1'));var logger=require(_0x3ef4('0x2'))(_0x3ef4('0x3'));var moment=require('moment');var BPromise=require(_0x3ef4('0x4'));var rp=require(_0x3ef4('0x5'));var fs=require('fs');var path=require(_0x3ef4('0x6'));var rimraf=require(_0x3ef4('0x7'));var config=require(_0x3ef4('0x8'));var attributes=require(_0x3ef4('0x9'));module['exports']=function(_0x123c10,_0x4ca7e1){return _0x123c10[_0x3ef4('0xa')](_0x3ef4('0xb'),attributes,{'tableName':_0x3ef4('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3ef4('0xd'),'fields':[_0x3ef4('0xe'),_0x3ef4('0xf')]},{'unique':!![],'name':_0x3ef4('0x10'),'fields':[_0x3ef4('0xe'),_0x3ef4('0x11')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x3ef4('0x12'),'fields':['name',_0x3ef4('0x13')]},{'unique':!![],'name':_0x3ef4('0x14'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x3ef4('0x15'),'fields':['name',_0x3ef4('0x16')]},{'unique':!![],'name':_0x3ef4('0x17'),'fields':['name',_0x3ef4('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2b4dfca..dfe2a4d 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(_0x12b18d,_0x21a617){var _0x90e3de=function(_0x30c745){while(--_0x30c745){_0x12b18d['push'](_0x12b18d['shift']());}};_0x90e3de(++_0x21a617);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _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(_0x1ed6a6,_0x31132b){var _0x21e07d=function(_0x589dc6){while(--_0x589dc6){_0x1ed6a6['push'](_0x1ed6a6['shift']());}};_0x21e07d(++_0x31132b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 a6e5031..73c2b68 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 _0x5ee9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x4d5827,_0x2415e8){var _0x18afc5=function(_0x33fe27){while(--_0x33fe27){_0x4d5827['push'](_0x4d5827['shift']());}};_0x18afc5(++_0x2415e8);}(_0x5ee9,0x7d));var _0x95ee=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5ee9[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x95ee('0x0'));var path=require(_0x95ee('0x1'));var timeout=require(_0x95ee('0x2'));var express=require(_0x95ee('0x3'));var router=express[_0x95ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x95ee('0x5'));var interaction=require(_0x95ee('0x6'));var config=require(_0x95ee('0x7'));var controller=require(_0x95ee('0x8'));router[_0x95ee('0x9')]('/',auth[_0x95ee('0xa')](),controller[_0x95ee('0xb')]);router[_0x95ee('0x9')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0xd')]);router[_0x95ee('0xe')]('/',auth['isAuthenticated'](),controller[_0x95ee('0xf')]);router[_0x95ee('0x10')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0x11')]);router[_0x95ee('0x12')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0x13')]);module[_0x95ee('0x14')]=router; \ No newline at end of file +var _0xe9d7=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','update','exports','multer','util','Router','fs-extra'];(function(_0x127761,_0x1be7d9){var _0x56b863=function(_0x244698){while(--_0x244698){_0x127761['push'](_0x127761['shift']());}};_0x56b863(++_0x1be7d9);}(_0xe9d7,0x14c));var _0x7e9d=function(_0x36f82a,_0x4ec395){_0x36f82a=_0x36f82a-0x0;var _0x495067=_0xe9d7[_0x36f82a];return _0x495067;};'use strict';var multer=require(_0x7e9d('0x0'));var util=require(_0x7e9d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e9d('0x2')]();var fs_extra=require(_0x7e9d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7e9d('0x4'));var config=require('../../config/environment');var controller=require('./disposition.controller');router['get']('/',auth[_0x7e9d('0x5')](),controller[_0x7e9d('0x6')]);router[_0x7e9d('0x7')](_0x7e9d('0x8'),auth[_0x7e9d('0x5')](),controller[_0x7e9d('0x9')]);router[_0x7e9d('0xa')]('/',auth[_0x7e9d('0x5')](),controller[_0x7e9d('0xb')]);router['put'](_0x7e9d('0x8'),auth[_0x7e9d('0x5')](),controller[_0x7e9d('0xc')]);router['delete'](_0x7e9d('0x8'),auth[_0x7e9d('0x5')](),controller['destroy']);module[_0x7e9d('0xd')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1b73617..fe9c777 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 _0xaced=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','14400','2400','4800','v17,v27,v29','INTEGER','DADHI','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x235481,_0x4624ab){var _0x40295b=function(_0x6cc636){while(--_0x6cc636){_0x235481['push'](_0x235481['shift']());}};_0x40295b(++_0x4624ab);}(_0xaced,0x18c));var _0xdace=function(_0x143a27,_0xa06ddb){_0x143a27=_0x143a27-0x0;var _0x3956f4=_0xaced[_0x143a27];return _0x3956f4;};'use strict';var Sequelize=require(_0xdace('0x0'));module[_0xdace('0x1')]={'name':{'type':Sequelize[_0xdace('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdace('0x2')]},'ecm':{'type':Sequelize[_0xdace('0x3')]('yes','no'),'defaultValue':_0xdace('0x4')},'headerinfo':{'type':Sequelize[_0xdace('0x2')],'defaultValue':_0xdace('0x5')},'localstationid':{'type':Sequelize[_0xdace('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xdace('0x3')]('2400','4800',_0xdace('0x6'),_0xdace('0x7'),_0xdace('0x8'),_0xdace('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xdace('0xa'),_0xdace('0xb'),_0xdace('0x6'),_0xdace('0x7'),'12000',_0xdace('0x9')),'defaultValue':_0xdace('0x9')},'modem':{'type':Sequelize[_0xdace('0x2')],'defaultValue':_0xdace('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdace('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdace('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX',_0xdace('0xe'),'KHOMP'),'defaultValue':_0xdace('0xf')},'key':{'type':Sequelize[_0xdace('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdace('0x10')],'defaultValue':function(){return _0xdace('0x11');}},'notificationSound':{'type':Sequelize[_0xdace('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdace('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdace('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xdace('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![],'comment':_0xdace('0x14'),'set':function(_0xa3594e){if(!_0xa3594e)this[_0xdace('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xa3594e);}}}; \ No newline at end of file +var _0x4bcd=['9600','12000','14400','INTEGER','SIP','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','exports','STRING','ENUM','yes','localstationid','4800','7200'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x4bcd,0x187));var _0xd4bc=function(_0x1af98a,_0x1b684f){_0x1af98a=_0x1af98a-0x0;var _0x12028b=_0x4bcd[_0x1af98a];return _0x12028b;};'use strict';var Sequelize=require(_0xd4bc('0x0'));module[_0xd4bc('0x1')]={'name':{'type':Sequelize[_0xd4bc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd4bc('0x2')]},'ecm':{'type':Sequelize[_0xd4bc('0x3')](_0xd4bc('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xd4bc('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd4bc('0x2')],'unique':_0xd4bc('0x5')},'minrate':{'type':Sequelize[_0xd4bc('0x3')]('2400',_0xd4bc('0x6'),_0xd4bc('0x7'),_0xd4bc('0x8'),_0xd4bc('0x9'),_0xd4bc('0xa')),'defaultValue':_0xd4bc('0x6')},'maxrate':{'type':Sequelize[_0xd4bc('0x3')]('2400',_0xd4bc('0x6'),_0xd4bc('0x7'),_0xd4bc('0x8'),_0xd4bc('0x9'),_0xd4bc('0xa')),'defaultValue':_0xd4bc('0xa')},'modem':{'type':Sequelize[_0xd4bc('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xd4bc('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[_0xd4bc('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd4bc('0x3')](_0xd4bc('0xc'),'IAX','DADHI',_0xd4bc('0xd')),'defaultValue':_0xd4bc('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd4bc('0xe')],'defaultValue':function(){return _0xd4bc('0xf');}},'notificationSound':{'type':Sequelize[_0xd4bc('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd4bc('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd4bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd4bc('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd4bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd4bc('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd4bc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd4bc('0x11'),'set':function(_0x44cfa9){if(!_0x44cfa9)this[_0xd4bc('0x12')](_0xd4bc('0x13'),null);this[_0xd4bc('0x12')](_0xd4bc('0x14'),_0x44cfa9);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 64d5181..d6783eb 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 _0x9e70=['Tags','color','tag','FaxInteraction','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','ListId','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','Messages','dataValues','SendFax','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','destroy','FaxAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','filter','options','where','includeAll','findAll','rows','params','rawAttributes','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','omit','getInteractions','CmContact','Contact','User','fullname','internal'];(function(_0x22f238,_0x64514e){var _0x370c2c=function(_0x280981){while(--_0x280981){_0x22f238['push'](_0x22f238['shift']());}};_0x370c2c(++_0x64514e);}(_0x9e70,0x10a));var _0x09e7=function(_0x5845d3,_0x2e2ca0){_0x5845d3=_0x5845d3-0x0;var _0x4d01ae=_0x9e70[_0x5845d3];return _0x4d01ae;};'use strict';var emlformat=require(_0x09e7('0x0'));var rimraf=require(_0x09e7('0x1'));var zipdir=require(_0x09e7('0x2'));var jsonpatch=require(_0x09e7('0x3'));var rp=require(_0x09e7('0x4'));var moment=require(_0x09e7('0x5'));var BPromise=require(_0x09e7('0x6'));var Mustache=require(_0x09e7('0x7'));var util=require(_0x09e7('0x8'));var path=require(_0x09e7('0x9'));var sox=require(_0x09e7('0xa'));var csv=require(_0x09e7('0xb'));var ejs=require(_0x09e7('0xc'));var fs=require('fs');var fs_extra=require(_0x09e7('0xd'));var _=require('lodash');var squel=require(_0x09e7('0xe'));var crypto=require(_0x09e7('0xf'));var jsforce=require(_0x09e7('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09e7('0x11'));var Papa=require(_0x09e7('0x12'));var Redis=require(_0x09e7('0x13'));var authService=require(_0x09e7('0x14'));var qs=require(_0x09e7('0x15'));var as=require(_0x09e7('0x16'));var hardwareService=require(_0x09e7('0x17'));var logger=require('../../config/logger')(_0x09e7('0x18'));var utils=require(_0x09e7('0x19'));var config=require(_0x09e7('0x1a'));var licenseUtil=require(_0x09e7('0x1b'));var db=require(_0x09e7('0x1c'))['db'];config['redis']=_['defaults'](config[_0x09e7('0x1d')],{'host':_0x09e7('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x09e7('0x1d')]));require(_0x09e7('0x1f'))[_0x09e7('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x09e7('0x21')][_0x09e7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3ab0f0,_0x7536e3,_0xfc8fd1,_0x574c2a){return new BPromise(function(_0xa97f34,_0x6f657d){var _0x5352a5=_0x574c2a||client;return _0x5352a5['request'](_0x3ab0f0,_0xfc8fd1)[_0x09e7('0x23')](function(_0x367408){logger[_0x09e7('0x24')](_0x09e7('0x25'),_0x7536e3,'request\x20sent');logger[_0x09e7('0x26')](_0x09e7('0x27'),_0x7536e3,'request\x20sent',JSON[_0x09e7('0x28')](_0x367408));if(_0x367408[_0x09e7('0x29')]){if(_0x367408[_0x09e7('0x29')][_0x09e7('0x2a')]===0x1f4){logger[_0x09e7('0x29')](_0x09e7('0x25'),_0x7536e3,_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);return _0x6f657d(_0x367408['error'][_0x09e7('0x2b')]);}logger['error'](_0x09e7('0x25'),_0x7536e3,_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);return _0xa97f34(_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);}else{logger[_0x09e7('0x24')](_0x09e7('0x25'),_0x7536e3,_0x09e7('0x2c'));_0xa97f34(_0x367408[_0x09e7('0x2d')][_0x09e7('0x2b')]);}})[_0x09e7('0x2e')](function(_0x43c558){logger['error'](_0x09e7('0x25'),_0x7536e3,_0x43c558);_0x6f657d(_0x43c558);});});}function respondWithStatusCode(_0x1b37ef,_0x5ea573){_0x5ea573=_0x5ea573||0xcc;return function(_0xb18c8b){if(_0xb18c8b){return _0x1b37ef['sendStatus'](_0x5ea573);}return _0x1b37ef[_0x09e7('0x2f')](_0x5ea573)[_0x09e7('0x30')]();};}function respondWithResult(_0x27479a,_0x5515eb){_0x5515eb=_0x5515eb||0xc8;return function(_0x356782){if(_0x356782){return _0x27479a[_0x09e7('0x2f')](_0x5515eb)[_0x09e7('0x31')](_0x356782);}};}function respondWithFilteredResult(_0x322eb6,_0x2259d5){return function(_0x413789){if(_0x413789){var _0x2ed0e7=typeof _0x2259d5['offset']===_0x09e7('0x32')&&typeof _0x2259d5[_0x09e7('0x33')]===_0x09e7('0x32');var _0x29175f=_0x413789[_0x09e7('0x34')];var _0x4e4bef=_0x2ed0e7?0x0:_0x2259d5[_0x09e7('0x35')];var _0x5937b0=_0x2ed0e7?_0x413789[_0x09e7('0x34')]:_0x2259d5[_0x09e7('0x35')]+_0x2259d5[_0x09e7('0x33')];var _0x99adae;if(_0x5937b0>=_0x29175f){_0x5937b0=_0x29175f;_0x99adae=0xc8;}else{_0x99adae=0xce;}_0x322eb6['status'](_0x99adae);return _0x322eb6[_0x09e7('0x36')](_0x09e7('0x37'),_0x4e4bef+'-'+_0x5937b0+'/'+_0x29175f)[_0x09e7('0x31')](_0x413789);}return null;};}function patchUpdates(_0x3a931e){return function(_0x7379e5){try{jsonpatch[_0x09e7('0x38')](_0x7379e5,_0x3a931e,!![]);}catch(_0xd291b1){return BPromise['reject'](_0xd291b1);}return _0x7379e5['save']();};}function saveUpdates(_0x5bf05b,_0x1a0e8c){return function(_0xe078cc){if(_0xe078cc){return _0xe078cc['update'](_0x5bf05b)[_0x09e7('0x23')](function(_0x5dcb40){return _0x5dcb40;});}return null;};}function removeEntity(_0x4407b2,_0x2dfc64){return function(_0x4db1be){if(_0x4db1be){return _0x4db1be[_0x09e7('0x39')]()[_0x09e7('0x23')](function(){var _0x46f880=_0x4db1be['get']({'plain':!![]});var _0x413e77=_0x09e7('0x3a');return db['UserProfileResource'][_0x09e7('0x39')]({'where':{'type':_0x413e77,'resourceId':_0x46f880['id']}})[_0x09e7('0x23')](function(){return _0x4db1be;});})[_0x09e7('0x23')](function(){_0x4407b2[_0x09e7('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8464,_0x252fdc){return function(_0x8364dd){if(!_0x8364dd){_0x5b8464[_0x09e7('0x3b')](0x194);}return _0x8364dd;};}function handleError(_0x34c0d2,_0x20aa94){_0x20aa94=_0x20aa94||0x1f4;return function(_0xc4c4b3){logger[_0x09e7('0x29')](_0xc4c4b3[_0x09e7('0x3c')]);if(_0xc4c4b3[_0x09e7('0x3d')]){delete _0xc4c4b3[_0x09e7('0x3d')];}_0x34c0d2['status'](_0x20aa94)[_0x09e7('0x3e')](_0xc4c4b3);};}exports[_0x09e7('0x3f')]=function(_0x41a1b8,_0x1ca8ed){var _0x22af0a={'include':[{'model':db[_0x09e7('0x40')],'as':_0x09e7('0x41')}]},_0x153801={},_0x577cb2={'count':0x0,'rows':[]};var _0x194fa7=_[_0x09e7('0x42')](db[_0x09e7('0x43')]['rawAttributes'],function(_0x5bc0b7){return{'name':_0x5bc0b7['fieldName'],'type':_0x5bc0b7[_0x09e7('0x44')]['key']};});_0x153801[_0x09e7('0x45')]=_[_0x09e7('0x42')](_0x194fa7,_0x09e7('0x3d'));_0x153801[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x41a1b8[_0x09e7('0x46')]);_0x153801[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x153801[_0x09e7('0x45')],_0x153801['query']);_0x22af0a[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x153801[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x41a1b8[_0x09e7('0x46')]['fields']));_0x22af0a[_0x09e7('0x4a')]=_0x22af0a[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x22af0a[_0x09e7('0x4a')]:_0x153801['model'];if(!_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x22af0a['limit']=qs[_0x09e7('0x33')](_0x41a1b8[_0x09e7('0x46')]['limit']);_0x22af0a[_0x09e7('0x35')]=qs[_0x09e7('0x35')](_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x35')]);}_0x22af0a[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x41a1b8['query'][_0x09e7('0x4f')]);_0x22af0a['where']=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x41a1b8[_0x09e7('0x46')],_0x153801[_0x09e7('0x48')]),_0x194fa7);if(_0x41a1b8[_0x09e7('0x46')]['filter']){_0x22af0a['where']=_[_0x09e7('0x51')](_0x22af0a['where'],{'$or':_[_0x09e7('0x42')](_0x194fa7,function(_0x27cf18){if(_0x27cf18[_0x09e7('0x44')]!=='VIRTUAL'){var _0x1da447={};_0x1da447[_0x27cf18[_0x09e7('0x3d')]]={'$like':'%'+_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x1da447;}})});}_0x22af0a=_[_0x09e7('0x51')]({},_0x22af0a,_0x41a1b8[_0x09e7('0x53')]);var _0x12a69={'where':_0x22af0a[_0x09e7('0x54')]};return db[_0x09e7('0x43')]['count'](_0x12a69)[_0x09e7('0x23')](function(_0x845c4e){_0x577cb2['count']=_0x845c4e;if(_0x41a1b8['query'][_0x09e7('0x55')]){_0x22af0a['include']=[{'all':!![]}];}return db['FaxAccount'][_0x09e7('0x56')](_0x22af0a);})[_0x09e7('0x23')](function(_0x55a3cc){_0x577cb2[_0x09e7('0x57')]=_0x55a3cc;return _0x577cb2;})[_0x09e7('0x23')](respondWithFilteredResult(_0x1ca8ed,_0x22af0a))[_0x09e7('0x2e')](handleError(_0x1ca8ed,null));};exports['show']=function(_0x500434,_0x363b22){var _0x53bfea={'raw':![],'where':{'id':_0x500434[_0x09e7('0x58')]['id']},'include':[{'model':db[_0x09e7('0x40')],'as':'mandatoryDispositionPause'}]},_0x24832c={};_0x24832c[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x43')][_0x09e7('0x59')]);_0x24832c[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x500434['query']);_0x24832c[_0x09e7('0x48')]=_['intersection'](_0x24832c[_0x09e7('0x45')],_0x24832c[_0x09e7('0x46')]);_0x53bfea['attributes']=_[_0x09e7('0x49')](_0x24832c[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x500434[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x53bfea[_0x09e7('0x4a')]=_0x53bfea[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x53bfea[_0x09e7('0x4a')]:_0x24832c[_0x09e7('0x45')];if(_0x500434[_0x09e7('0x46')][_0x09e7('0x55')]){_0x53bfea[_0x09e7('0x5a')]=[{'all':!![]}];}_0x53bfea=_[_0x09e7('0x51')]({},_0x53bfea,_0x500434[_0x09e7('0x53')]);return db['FaxAccount'][_0x09e7('0x5b')](_0x53bfea)[_0x09e7('0x23')](handleEntityNotFound(_0x363b22,null))[_0x09e7('0x23')](respondWithResult(_0x363b22,null))[_0x09e7('0x2e')](handleError(_0x363b22,null));};exports[_0x09e7('0x5c')]=function(_0x3540bd,_0x3fe194){return db[_0x09e7('0x43')][_0x09e7('0x5c')](_0x3540bd[_0x09e7('0x5d')],{})[_0x09e7('0x23')](function(_0x176809){var _0x574582=_0x3540bd[_0x09e7('0x5e')][_0x09e7('0x5f')]({'plain':!![]});if(!_0x574582)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x574582[_0x09e7('0x60')]==='user'){var _0x24e21f=_0x176809['get']({'plain':!![]});var _0x12cb63=_0x09e7('0x3a');return db[_0x09e7('0x61')][_0x09e7('0x5b')]({'where':{'name':_0x12cb63,'userProfileId':_0x574582[_0x09e7('0x62')]},'raw':!![]})[_0x09e7('0x23')](function(_0x5390fb){if(_0x5390fb&&_0x5390fb[_0x09e7('0x63')]===0x0){return db[_0x09e7('0x64')]['create']({'name':_0x24e21f[_0x09e7('0x3d')],'resourceId':_0x24e21f['id'],'type':_0x5390fb[_0x09e7('0x3d')],'sectionId':_0x5390fb['id']},{})['then'](function(){return _0x176809;});}else{return _0x176809;}})['catch'](function(_0x277b23){logger[_0x09e7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x277b23);throw _0x277b23;});}return _0x176809;})[_0x09e7('0x23')](respondWithResult(_0x3fe194,0xc9))[_0x09e7('0x2e')](handleError(_0x3fe194,null));};exports['update']=function(_0x4c2846,_0x1a7763){if(_0x4c2846['body']['id']){delete _0x4c2846[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x4c2846[_0x09e7('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x09e7('0x41')}]})[_0x09e7('0x23')](handleEntityNotFound(_0x1a7763,null))[_0x09e7('0x23')](saveUpdates(_0x4c2846['body'],null))[_0x09e7('0x23')](respondWithResult(_0x1a7763,null))[_0x09e7('0x2e')](handleError(_0x1a7763,null));};exports[_0x09e7('0x39')]=function(_0x551aa3,_0x3131a5){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x551aa3[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3131a5,null))[_0x09e7('0x23')](removeEntity(_0x3131a5,null))[_0x09e7('0x2e')](handleError(_0x3131a5,null));};exports[_0x09e7('0x65')]=function(_0x583c4c,_0x1749ad){return db[_0x09e7('0x43')][_0x09e7('0x65')]()[_0x09e7('0x23')](respondWithResult(_0x1749ad,null))[_0x09e7('0x2e')](handleError(_0x1749ad,null));};exports[_0x09e7('0x66')]=function(_0xcf8b15,_0x356cf9,_0x4ac4bb){if(_0xcf8b15[_0x09e7('0x5d')]['id']){delete _0xcf8b15[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0xcf8b15[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0x356cf9,null))[_0x09e7('0x23')](function(_0x312b89){if(_0x312b89){_0xcf8b15[_0x09e7('0x5d')][_0x09e7('0x67')]=_0x312b89['id'];return db[_0x09e7('0x68')]['create'](_0xcf8b15[_0x09e7('0x5d')]);}})[_0x09e7('0x23')](respondWithResult(_0x356cf9,null))['catch'](handleError(_0x356cf9,null));};exports[_0x09e7('0x69')]=function(_0x5ac31f,_0x2b5d80,_0x363de8){var _0x4223ca={'raw':![],'where':{}};var _0x23c079={};var _0x3e1743={'count':0x0,'rows':[]};return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x5ac31f[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x2b5d80,null))[_0x09e7('0x23')](function(_0x2d953e){if(_0x2d953e){_0x23c079[_0x09e7('0x45')]=_[_0x09e7('0x47')](db[_0x09e7('0x68')][_0x09e7('0x59')]);_0x23c079['query']=_['keys'](_0x5ac31f['query']);_0x23c079[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x23c079['model'],_0x23c079['query']);_0x4223ca[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x23c079[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x4223ca['attributes']=_0x4223ca[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x4223ca[_0x09e7('0x4a')]:_0x23c079['model'];if(!_0x5ac31f['query']['hasOwnProperty'](_0x09e7('0x6b'))){_0x4223ca[_0x09e7('0x33')]=qs['limit'](_0x5ac31f['query']['limit']);_0x4223ca[_0x09e7('0x35')]=qs[_0x09e7('0x35')](_0x5ac31f[_0x09e7('0x46')]['offset']);}_0x4223ca[_0x09e7('0x4e')]=qs['sort'](_0x5ac31f[_0x09e7('0x46')]['sort']);_0x4223ca[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x5ac31f[_0x09e7('0x46')],_0x23c079[_0x09e7('0x48')]));_0x4223ca[_0x09e7('0x54')][_0x09e7('0x67')]=_0x2d953e['id'];if(_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x52')]){_0x4223ca[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x4223ca[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0x4223ca[_0x09e7('0x4a')],function(_0x53ad47){var _0x3e4216={};_0x3e4216[_0x53ad47]={'$like':'%'+_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x3e4216;})});}_0x4223ca=_[_0x09e7('0x51')]({},_0x4223ca,_0x5ac31f['options']);return db[_0x09e7('0x68')][_0x09e7('0x34')]({'where':_0x4223ca['where']})[_0x09e7('0x23')](function(_0x2e6972){_0x3e1743[_0x09e7('0x34')]=_0x2e6972;if(_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x55')]){_0x4223ca[_0x09e7('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x09e7('0x56')](_0x4223ca);})[_0x09e7('0x23')](function(_0xbf335b){_0x3e1743[_0x09e7('0x57')]=_0xbf335b;return _0x3e1743;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x2b5d80,_0x4223ca))['catch'](handleError(_0x2b5d80,null));};exports[_0x09e7('0x6c')]=function(_0x3432fa,_0x55b5bc,_0x51940e){return db[_0x09e7('0x43')]['find']({'where':{'id':_0x3432fa[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x55b5bc,null))[_0x09e7('0x23')](function(_0x44f825){if(_0x44f825){return _0x44f825[_0x09e7('0x6c')](_0x3432fa[_0x09e7('0x46')][_0x09e7('0x6d')]);}})[_0x09e7('0x23')](respondWithStatusCode(_0x55b5bc,null))['catch'](handleError(_0x55b5bc,null));};exports[_0x09e7('0x6e')]=function(_0x24d985,_0x4ce1a9,_0x1b3e3b){if(_0x24d985['body']['id']){delete _0x24d985[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x24d985['params']['id']}})['then'](handleEntityNotFound(_0x4ce1a9,null))[_0x09e7('0x23')](function(_0x9e3e9c){if(_0x9e3e9c){_0x24d985[_0x09e7('0x5d')][_0x09e7('0x67')]=_0x9e3e9c['id'];return db[_0x09e7('0x6f')][_0x09e7('0x5c')](_0x24d985['body']);}})[_0x09e7('0x23')](respondWithResult(_0x4ce1a9,null))[_0x09e7('0x2e')](handleError(_0x4ce1a9,null));};exports['getAnswers']=function(_0x55522a,_0xe52f20,_0x409ca4){var _0x31e581={'raw':![],'where':{}};var _0x2afc6e={};var _0x3a8461={'count':0x0,'rows':[]};return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x55522a[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0xe52f20,null))[_0x09e7('0x23')](function(_0xb69b54){if(_0xb69b54){_0x2afc6e[_0x09e7('0x45')]=_[_0x09e7('0x47')](db[_0x09e7('0x6f')]['rawAttributes']);_0x2afc6e[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x55522a[_0x09e7('0x46')]);_0x2afc6e[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x2afc6e[_0x09e7('0x45')],_0x2afc6e[_0x09e7('0x46')]);_0x31e581[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x2afc6e[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x55522a['query'][_0x09e7('0x4b')]));_0x31e581[_0x09e7('0x4a')]=_0x31e581[_0x09e7('0x4a')]['length']?_0x31e581[_0x09e7('0x4a')]:_0x2afc6e[_0x09e7('0x45')];if(!_0x55522a['query']['hasOwnProperty'](_0x09e7('0x6b'))){_0x31e581[_0x09e7('0x33')]=qs['limit'](_0x55522a['query']['limit']);_0x31e581[_0x09e7('0x35')]=qs['offset'](_0x55522a[_0x09e7('0x46')]['offset']);}_0x31e581[_0x09e7('0x4e')]=qs['sort'](_0x55522a[_0x09e7('0x46')][_0x09e7('0x4f')]);_0x31e581[_0x09e7('0x54')]=qs['filters'](_[_0x09e7('0x50')](_0x55522a[_0x09e7('0x46')],_0x2afc6e[_0x09e7('0x48')]));_0x31e581[_0x09e7('0x54')][_0x09e7('0x67')]=_0xb69b54['id'];if(_0x55522a['query'][_0x09e7('0x52')]){_0x31e581[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x31e581[_0x09e7('0x54')],{'$or':_['map'](_0x31e581[_0x09e7('0x4a')],function(_0x42525f){var _0x1cc50b={};_0x1cc50b[_0x42525f]={'$like':'%'+_0x55522a[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x1cc50b;})});}_0x31e581=_[_0x09e7('0x51')]({},_0x31e581,_0x55522a[_0x09e7('0x53')]);return db['CannedAnswer'][_0x09e7('0x34')]({'where':_0x31e581[_0x09e7('0x54')]})[_0x09e7('0x23')](function(_0x14ef40){_0x3a8461[_0x09e7('0x34')]=_0x14ef40;if(_0x55522a[_0x09e7('0x46')]['includeAll']){_0x31e581[_0x09e7('0x5a')]=[{'all':!![]}];}return db[_0x09e7('0x6f')]['findAll'](_0x31e581);})[_0x09e7('0x23')](function(_0xa3bb3a){_0x3a8461[_0x09e7('0x57')]=_0xa3bb3a;return _0x3a8461;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0xe52f20,_0x31e581))[_0x09e7('0x2e')](handleError(_0xe52f20,null));};exports[_0x09e7('0x70')]=function(_0x15df75,_0x474228,_0x1df4fe){return db[_0x09e7('0x43')]['find']({'where':{'id':_0x15df75['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x474228,null))[_0x09e7('0x23')](function(_0x18bd71){if(_0x18bd71){return _0x18bd71[_0x09e7('0x70')](_0x15df75[_0x09e7('0x46')][_0x09e7('0x6d')]);}})[_0x09e7('0x23')](respondWithStatusCode(_0x474228,null))[_0x09e7('0x2e')](handleError(_0x474228,null));};exports['addInteraction']=function(_0xab2893,_0x116348,_0x1a1d46){return db['FaxInteraction']['find']({'where':{'id':_0xab2893[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0x116348,null))[_0x09e7('0x23')](function(_0x16bdad){if(_0x16bdad){return _0x16bdad['addInteraction'](_0xab2893[_0x09e7('0x5d')]['ids'],_[_0x09e7('0x71')](_0xab2893[_0x09e7('0x5d')],['ids','id'])||{});}})[_0x09e7('0x23')](respondWithResult(_0x116348,null))[_0x09e7('0x2e')](handleError(_0x116348,null));};exports[_0x09e7('0x72')]=function(_0x44c015,_0x468fdf,_0x693d8e){var _0x59c359={'raw':![],'where':{}};var _0x201491={};var _0x1a6660={'count':0x0,'rows':[]};return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x44c015[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x468fdf,null))['then'](function(_0x289e4b){if(_0x289e4b){_0x201491[_0x09e7('0x45')]=_[_0x09e7('0x47')](db['FaxInteraction'][_0x09e7('0x59')]);_0x201491[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x44c015[_0x09e7('0x46')]);_0x201491['filters']=_[_0x09e7('0x49')](_0x201491[_0x09e7('0x45')],_0x201491['query']);_0x59c359[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x201491[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x44c015['query'][_0x09e7('0x4b')]));_0x59c359[_0x09e7('0x4a')]=_0x59c359[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x59c359[_0x09e7('0x4a')]:_0x201491[_0x09e7('0x45')];if(!_0x44c015[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x59c359[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x44c015[_0x09e7('0x46')][_0x09e7('0x33')]);_0x59c359[_0x09e7('0x35')]=qs['offset'](_0x44c015[_0x09e7('0x46')]['offset']);}_0x59c359[_0x09e7('0x4e')]=qs['sort'](_0x44c015[_0x09e7('0x46')][_0x09e7('0x4f')]);_0x59c359[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_['pick'](_0x44c015[_0x09e7('0x46')],_0x201491[_0x09e7('0x48')]));_0x59c359[_0x09e7('0x54')][_0x09e7('0x67')]=_0x289e4b['id'];if(_0x44c015[_0x09e7('0x46')][_0x09e7('0x52')]){_0x59c359[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x59c359[_0x09e7('0x54')],{'$or':_['map'](_0x59c359[_0x09e7('0x4a')],function(_0x22e257){var _0x36740d={};_0x36740d[_0x22e257]={'$like':'%'+_0x44c015['query'][_0x09e7('0x52')]+'%'};return _0x36740d;})});}_0x59c359=_[_0x09e7('0x51')]({},_0x59c359,_0x44c015[_0x09e7('0x53')]);return db['FaxInteraction'][_0x09e7('0x34')]({'where':_0x59c359['where']})[_0x09e7('0x23')](function(_0x19013a){_0x1a6660['count']=_0x19013a;if(_0x44c015['query'][_0x09e7('0x55')]){_0x59c359['include']=[{'model':db[_0x09e7('0x73')],'as':_0x09e7('0x74'),'required':![]},{'model':db[_0x09e7('0x75')],'as':'Owner','attributes':[_0x09e7('0x3d'),_0x09e7('0x76'),_0x09e7('0x77')],'required':![]},{'model':db['Tag'],'as':_0x09e7('0x78'),'attributes':['id',_0x09e7('0x3d'),_0x09e7('0x79')],'where':_0x44c015[_0x09e7('0x46')][_0x09e7('0x7a')]?{'id':_0x44c015['query']['tag']}:undefined,'required':_0x44c015[_0x09e7('0x46')][_0x09e7('0x7a')]?!![]:![]}];}return db[_0x09e7('0x7b')][_0x09e7('0x56')](_0x59c359);})[_0x09e7('0x23')](function(_0x372633){_0x1a6660['rows']=_0x372633;return _0x1a6660;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x468fdf,_0x59c359))[_0x09e7('0x2e')](handleError(_0x468fdf,null));};exports[_0x09e7('0x7c')]=function(_0x29e885,_0x108bb6){var _0x107df2=_0x29e885[_0x09e7('0x58')]['id'];var _0x4a9dda=_0x29e885[_0x09e7('0x5d')];var _0x49a9cd=0xc8;var _0x732e4f=null;return db[_0x09e7('0x7d')][_0x09e7('0x7e')]({'isolationLevel':db[_0x09e7('0x7d')][_0x09e7('0x7f')][_0x09e7('0x80')]['READ_COMMITTED']},function(_0x401f37){return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x107df2},'transaction':_0x401f37})[_0x09e7('0x23')](function(_0x2090b4){if(_0x2090b4){return db[_0x09e7('0x81')][_0x09e7('0x39')]({'where':{'FaxAccountId':_0x107df2},'transaction':_0x401f37})[_0x09e7('0x23')](function(){var _0x4a866f=_['map'](_0x4a9dda,function(_0x27c89d){_0x27c89d[_0x09e7('0x67')]=_0x107df2;return _0x27c89d;});return db[_0x09e7('0x81')][_0x09e7('0x82')](_0x4a866f,{'transaction':_0x401f37});});}else{_0x49a9cd=0x194;_0x732e4f=[];}});})[_0x09e7('0x23')](function(){if(_0x49a9cd!==0x194){return db['FaxApplication'][_0x09e7('0x83')]({'where':{'FaxAccountId':_0x107df2},'order':_0x09e7('0x84')})[_0x09e7('0x23')](function(_0x20e13e){_0x732e4f=_0x20e13e;});}})['catch'](function(_0x1f8c20){_0x49a9cd=0x1f4;logger[_0x09e7('0x29')](_0x1f8c20[_0x09e7('0x3c')]);if(_0x1f8c20[_0x09e7('0x3d')]){delete _0x1f8c20[_0x09e7('0x3d')];}_0x732e4f=_0x1f8c20;})[_0x09e7('0x85')](function(){if(_0x732e4f===null){_0x108bb6[_0x09e7('0x3b')](_0x49a9cd);}else{if(_0x49a9cd===0x1f4){_0x108bb6[_0x09e7('0x2f')](_0x49a9cd)['send'](_0x732e4f);}else{_0x108bb6[_0x09e7('0x2f')](_0x49a9cd)['json'](_0x732e4f);}}});};exports[_0x09e7('0x86')]=function(_0x2ddfb3,_0x38856c,_0x2a51b5){var _0x46d861={};var _0xc9e1f7={};var _0xd3e6a9;var _0x317cda;return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x2ddfb3['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x38856c,null))['then'](function(_0x5124eb){if(_0x5124eb){_0xd3e6a9=_0x5124eb;_0xc9e1f7[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x81')][_0x09e7('0x59')]);_0xc9e1f7[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x2ddfb3[_0x09e7('0x46')]);_0xc9e1f7['filters']=_[_0x09e7('0x49')](_0xc9e1f7[_0x09e7('0x45')],_0xc9e1f7['query']);_0x46d861[_0x09e7('0x4a')]=_['intersection'](_0xc9e1f7[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x46d861[_0x09e7('0x4a')]=_0x46d861[_0x09e7('0x4a')]['length']?_0x46d861[_0x09e7('0x4a')]:_0xc9e1f7['model'];_0x46d861['order']=qs[_0x09e7('0x4f')](_0x2ddfb3[_0x09e7('0x46')]['sort']);_0x46d861['where']=qs['filters'](_[_0x09e7('0x50')](_0x2ddfb3[_0x09e7('0x46')],_0xc9e1f7[_0x09e7('0x48')]));if(_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x52')]){_0x46d861[_0x09e7('0x54')]=_['merge'](_0x46d861[_0x09e7('0x54')],{'$or':_['map'](_0x46d861[_0x09e7('0x4a')],function(_0x446c0e){var _0x4b298b={};_0x4b298b[_0x446c0e]={'$like':'%'+_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x4b298b;})});}_0x46d861=_[_0x09e7('0x51')]({},_0x46d861,_0x2ddfb3[_0x09e7('0x53')]);return _0xd3e6a9[_0x09e7('0x86')](_0x46d861);}})['then'](function(_0x1e2237){if(_0x1e2237){_0x317cda=_0x1e2237[_0x09e7('0x4c')];if(!_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x46d861[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x2ddfb3['query'][_0x09e7('0x33')]);_0x46d861[_0x09e7('0x35')]=qs['offset'](_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x35')]);}return _0xd3e6a9[_0x09e7('0x86')](_0x46d861);}})['then'](function(_0x5596f0){if(_0x5596f0){return _0x5596f0?{'count':_0x317cda,'rows':_0x5596f0}:null;}})[_0x09e7('0x23')](respondWithResult(_0x38856c,null))[_0x09e7('0x2e')](handleError(_0x38856c,null));};function Extension(_0x5e8ef2,_0xfcd6ef,_0x4e7c44,_0x434c07){this[_0x09e7('0x87')]=_0x09e7('0x88');this[_0x09e7('0x89')]=_0x5e8ef2[_0x09e7('0x8a')];this[_0x09e7('0x8b')]=_0x434c07;this[_0x09e7('0x44')]=_0x09e7('0x8c');this['description']=_0x09e7('0x8d');this['FaxAccountId']=_0x5e8ef2['id'];this['priority']=_0xfcd6ef;this[_0x09e7('0x8e')]=_0x4e7c44;}function createExtensionsReciveFax(_0x822dc1){var _0x753d62=0x1;var _0x2107bf=[];_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,'',_0x09e7('0x90')));_0x753d62+=0x1;_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x91'),_0x09e7('0x92')));_0x753d62+=0x1;for(var _0x45f820 in _0x822dc1){if(_0x822dc1[_0x09e7('0x4d')](_0x45f820)&&(_0x45f820===_0x09e7('0x93')||_0x45f820===_0x09e7('0x8a')||_0x45f820===_0x09e7('0x94')||_0x45f820==='faxdetect'||_0x45f820==='headerinfo'||_0x45f820===_0x09e7('0x95')||_0x45f820===_0x09e7('0x96')||_0x45f820===_0x09e7('0x97')||_0x45f820===_0x09e7('0x98'))){_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x99')+_0x45f820+')='+_0x822dc1[_0x45f820],_0x09e7('0x92')));_0x753d62+=0x1;}}_0x2107bf['push'](new Extension(_0x822dc1,_0x753d62,'6',_0x09e7('0x9a')));_0x753d62+=0x1;_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x9b'),'ReceiveFax'));_0x753d62=0x0;return _0x2107bf;}exports[_0x09e7('0x9c')]=function(_0x54e778,_0x309aac,_0x355a55){var _0x26c4e9;return db[_0x09e7('0x7d')][_0x09e7('0x7e')](function(_0x2e69ae){return db[_0x09e7('0x43')][_0x09e7('0x5c')](_0x54e778[_0x09e7('0x5d')],{'transaction':_0x2e69ae})[_0x09e7('0x23')](function(_0x6e0cfc){_0x26c4e9=_0x6e0cfc[_0x09e7('0x5f')]({'plain':!![]});return db[_0x09e7('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0x26c4e9),{'transaction':_0x2e69ae});});})[_0x09e7('0x23')](function(){return _0x26c4e9;})['then'](respondWithResult(_0x309aac,null))[_0x09e7('0x2e')](handleError(_0x309aac,null));};exports[_0x09e7('0x9e')]=function(_0x169fac,_0x311b66,_0x1caeaa){var _0x45c16b;return db[_0x09e7('0x7d')][_0x09e7('0x7e')](function(_0x5d4257){return db[_0x09e7('0x43')]['update'](_0x169fac[_0x09e7('0x5d')],{'where':{'id':_0x169fac['body']['id']},'transaction':_0x5d4257})[_0x09e7('0x23')](function(_0x5094b6){return db[_0x09e7('0x9d')][_0x09e7('0x39')]({'where':{'FaxAccountId':_0x169fac[_0x09e7('0x5d')]['id']},'transaction':_0x5d4257})['then'](function(_0x1bf067){return db['VoiceExtension'][_0x09e7('0x82')](createExtensionsReciveFax(_[_0x09e7('0x71')](_0x169fac[_0x09e7('0x5d')],['tech','key',_0x09e7('0x9f'),_0x09e7('0xa0'),_0x09e7('0xa1'),'ListId'])),{'transaction':_0x5d4257});});});})[_0x09e7('0x23')](function(){return db['FaxAccount']['findById'](_0x169fac[_0x09e7('0x5d')]['id']);})[_0x09e7('0x23')](respondWithResult(_0x311b66,null))['catch'](handleError(_0x311b66,null));};exports[_0x09e7('0xa2')]=function(_0x1adb56,_0x3b2334,_0x30dafc){var _0xee9f5b={'raw':!![],'where':{}};var _0x2acf5e={};var _0xf7763d={'count':0x0,'rows':[]};return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x1adb56[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3b2334,null))[_0x09e7('0x23')](function(_0x5d038c){if(_0x5d038c){_0x2acf5e[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0xa3')][_0x09e7('0x59')]);_0x2acf5e['query']=_[_0x09e7('0x47')](_0x1adb56[_0x09e7('0x46')]);_0x2acf5e[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x2acf5e[_0x09e7('0x45')],_0x2acf5e[_0x09e7('0x46')]);_0xee9f5b[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x2acf5e[_0x09e7('0x45')],qs['fields'](_0x1adb56[_0x09e7('0x46')][_0x09e7('0x4b')]));_0xee9f5b[_0x09e7('0x4a')]=_0xee9f5b['attributes'][_0x09e7('0x4c')]?_0xee9f5b['attributes']:_0x2acf5e['model'];if(!_0x1adb56[_0x09e7('0x46')]['hasOwnProperty'](_0x09e7('0x6b'))){_0xee9f5b[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x1adb56[_0x09e7('0x46')]['limit']);_0xee9f5b['offset']=qs[_0x09e7('0x35')](_0x1adb56['query']['offset']);}_0xee9f5b[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x1adb56['query'][_0x09e7('0x4f')]);_0xee9f5b[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x1adb56[_0x09e7('0x46')],_0x2acf5e[_0x09e7('0x48')]));_0xee9f5b[_0x09e7('0x54')][_0x09e7('0x67')]=_0x5d038c['id'];if(_0x1adb56['query'][_0x09e7('0x52')]){_0xee9f5b[_0x09e7('0x54')]=_['merge'](_0xee9f5b[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0xee9f5b[_0x09e7('0x4a')],function(_0x4f384c){var _0x3c084f={};_0x3c084f[_0x4f384c]={'$like':'%'+_0x1adb56['query']['filter']+'%'};return _0x3c084f;})});}if(_0x1adb56[_0x09e7('0x46')][_0x09e7('0xa4')]){var _0x4937d9=_0x1adb56[_0x09e7('0x46')]['$gte'][_0x09e7('0xa5')](',');var _0xd2ceb3={};_0xd2ceb3[_0x4937d9[0x0]]={'$gte':moment(_0x4937d9[0x1])[_0x09e7('0xa6')](_0x09e7('0xa7'))};_0xee9f5b[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0xee9f5b[_0x09e7('0x54')],_0xd2ceb3);}_0xee9f5b=_[_0x09e7('0x51')]({},_0xee9f5b,_0x1adb56[_0x09e7('0x53')]);return db[_0x09e7('0xa3')][_0x09e7('0x34')]({'where':_0xee9f5b[_0x09e7('0x54')]})[_0x09e7('0x23')](function(_0x52c206){_0xf7763d['count']=_0x52c206;if(_0x1adb56['query'][_0x09e7('0x55')]){_0xee9f5b[_0x09e7('0x5a')]=[{'all':!![]}];}return db['FaxMessage'][_0x09e7('0x56')](_0xee9f5b);})[_0x09e7('0x23')](function(_0x32567e){_0xf7763d[_0x09e7('0x57')]=_0x32567e;return _0xf7763d;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x3b2334,_0xee9f5b))[_0x09e7('0x2e')](handleError(_0x3b2334,null));};exports['send']=function(_0x5a4771,_0x3f7bb5,_0x4b8baa){var _0x3a42ef,_0x2bc5f5={},_0x126c2b;if(_0x5a4771[_0x09e7('0x5d')]['to']){_0x126c2b=_0x5a4771['body']['to'][0x0];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x5a4771[_0x09e7('0x58')]['id']},'include':[{'model':db[_0x09e7('0xa8')],'as':_0x09e7('0xa9'),'include':[{'model':db[_0x09e7('0x73')],'as':_0x09e7('0xaa'),'where':{'fax':_0x126c2b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x09e7('0x23')](handleEntityNotFound(_0x3f7bb5,null))[_0x09e7('0x23')](function(_0x1b7bfe){_0x3a42ef=_0x1b7bfe;if(_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')]&&_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x09e7('0x4c')]){for(var _0x18431b=0x0;_0x18431b<_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x09e7('0x4c')];_0x18431b+=0x1){_0x5a4771['body'][_0x09e7('0xab')][_0x18431b]={'filename':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x18431b][_0x09e7('0x3d')],'id':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x18431b]['id'],'path':path['join'](config['root'],_0x09e7('0xac'),_0x5a4771['body']['attachments'][_0x18431b]['basename'])};}}return respondWithRpcPromise(_0x09e7('0xad'),_0x09e7('0xad'),{'FaxAccountId':_[_0x09e7('0xae')](_0x5a4771['params']['id'])?undefined:_0x5a4771[_0x09e7('0x58')]['id'],'path':_[_0x09e7('0xae')](_0x5a4771['body'][_0x09e7('0xab')][0x0]['path'])?undefined:_0x5a4771['body']['attachments'][0x0][_0x09e7('0x9')],'fax':_[_0x09e7('0xae')](_0x5a4771[_0x09e7('0x5d')]['to'][0x0])?undefined:_0x5a4771['body']['to'][0x0]},client9002);})['then'](function(){if(_0x3a42ef){if(_[_0x09e7('0xae')](_0x5a4771['body'][_0x09e7('0xaf')])){_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xaf')]=util['format'](_0x09e7('0xb0'),_0x3a42ef[_0x09e7('0x3d')],_0x3a42ef[_0x09e7('0xb1')]);}if(_0x3a42ef[_0x09e7('0xa9')]){if(_0x3a42ef[_0x09e7('0xa9')]['Contacts'][_0x09e7('0x4c')]){return _0x3a42ef[_0x09e7('0xa9')]['Contacts'][0x0];}else{return db[_0x09e7('0x73')][_0x09e7('0x5c')](_[_0x09e7('0xb2')](_0x5a4771[_0x09e7('0x5d')],{'firstName':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'phone':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'fax':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'ListId':_0x3a42ef[_0x09e7('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x09e7('0xb4'));}})[_0x09e7('0x23')](function(_0x4f38b6){if(_0x4f38b6){return db[_0x09e7('0x7b')][_0x09e7('0x5b')]({'where':{'ContactId':_0x4f38b6['id'],'closed':![],'FaxAccountId':_0x3a42ef['id']}})[_0x09e7('0x23')](function(_0x1232e6){if(_0x1232e6){return[_0x1232e6,![]];}return db[_0x09e7('0x7b')][_0x09e7('0x5c')]({'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x4f38b6['id'],'FaxAccountId':_0x3a42ef['id'],'fax':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'firstMsgDirection':_0x09e7('0xb5'),'Messages':[_['merge'](_0x5a4771['body'],{'read':![],'body':_0x5a4771['body'][_0x09e7('0xab')][0x0]['filename'],'FaxAccountId':_0x3a42ef['id'],'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x4f38b6['id'],'AttachmentId':_0x5a4771[_0x09e7('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x09e7('0x23')](function(_0x36e360){return[_0x36e360,!![]];});});}else{throw new Error(_0x09e7('0xb6'));}})[_0x09e7('0xb7')](function(_0x31b73d,_0x3d4da2){if(_0x3d4da2){return _0x31b73d;}return db[_0x09e7('0xa3')][_0x09e7('0x5c')]({'direction':_0x09e7('0xb5'),'read':![],'body':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['filename'],'FaxAccountId':_0x3a42ef['id'],'FaxInteractionId':_0x31b73d['id'],'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x31b73d['ContactId'],'AttachmentId':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['id']})[_0x09e7('0x23')](function(_0x943580){_0x31b73d['dataValues']['Messages']=[];_0x31b73d['dataValues'][_0x09e7('0xb8')][_0x09e7('0x8f')](_0x943580[_0x09e7('0xb9')]);return _0x31b73d;});})['then'](function(_0x4693ff){respondWithRpcPromise(_0x09e7('0xba'),_0x09e7('0xba'),{'FaxAccountId':_['isNil'](_0x5a4771[_0x09e7('0x58')]['id'])?undefined:_0x5a4771[_0x09e7('0x58')]['id'],'path':_[_0x09e7('0xae')](_0x5a4771[_0x09e7('0x5d')]['attachments'][0x0][_0x09e7('0x9')])?undefined:_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0][_0x09e7('0x9')],'fax':_['isNil'](_0x5a4771[_0x09e7('0x5d')]['to'][0x0])?undefined:_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'AttachmentId':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['id']},client9002)[_0x09e7('0x23')](function(_0x155b59){logger[_0x09e7('0x24')]('SendFaxRpc,\x20%s',_0x155b59);})[_0x09e7('0x2e')](function(_0x32d248){logger[_0x09e7('0x24')]('SendFaxRpc,\x20%s',_0x32d248);});return _0x4693ff;})['then'](respondWithResult(_0x3f7bb5,null))[_0x09e7('0x2e')](handleError(_0x3f7bb5,null));};exports[_0x09e7('0xbb')]=function(_0x4add6f,_0x25eeda,_0x404f30){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x4add6f['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x25eeda,null))[_0x09e7('0x23')](function(_0x4badfe){if(_0x4badfe){return _0x4badfe[_0x09e7('0xbb')](_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')],_[_0x09e7('0x71')](_0x4add6f[_0x09e7('0x5d')],[_0x09e7('0x6d'),'id'])||{})[_0x09e7('0xb7')](function(_0x2483dd){for(var _0x3d46c5=0x0;_0x3d46c5<_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')][_0x09e7('0x4c')];_0x3d46c5+=0x1){socket['emit'](_0x09e7('0xbc'),{'UserId':Number(_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')][_0x3d46c5]),'FaxAccountId':Number(_0x4add6f['params']['id'])});}return _0x2483dd;});}})['then'](respondWithResult(_0x25eeda,null))[_0x09e7('0x2e')](handleError(_0x25eeda,null));};exports['removeAgents']=function(_0x2a9e83,_0x3a13df,_0x4b2b01){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x2a9e83[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3a13df,null))['then'](function(_0x56f53a){if(_0x56f53a){return _0x56f53a['removeAgents'](_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')])[_0x09e7('0x23')](function(){if(_[_0x09e7('0xbd')](_0x2a9e83[_0x09e7('0x46')]['ids'])){for(var _0x4ce818=0x0;_0x4ce818<_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')][_0x09e7('0x4c')];_0x4ce818+=0x1){socket[_0x09e7('0xbe')](_0x09e7('0xbf'),{'UserId':Number(_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')][_0x4ce818]),'FaxAccountId':Number(_0x2a9e83['params']['id'])});}}else{socket[_0x09e7('0xbe')](_0x09e7('0xbf'),{'UserId':Number(_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')]),'FaxAccountId':Number(_0x2a9e83[_0x09e7('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a13df,null))['catch'](handleError(_0x3a13df,null));};exports['getAgents']=function(_0x586ea4,_0x389b97,_0x5a33e7){var _0x566aeb={};var _0x5a4a28={};var _0x1b78fc;var _0x109352;return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x586ea4['params']['id']}})['then'](handleEntityNotFound(_0x389b97,null))[_0x09e7('0x23')](function(_0x47a993){if(_0x47a993){_0x1b78fc=_0x47a993;_0x5a4a28[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x75')][_0x09e7('0x59')]);_0x5a4a28[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x586ea4[_0x09e7('0x46')]);_0x5a4a28[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x5a4a28[_0x09e7('0x45')],_0x5a4a28[_0x09e7('0x46')]);_0x566aeb[_0x09e7('0x4a')]=_['intersection'](_0x5a4a28[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x586ea4[_0x09e7('0x46')]['fields']));_0x566aeb[_0x09e7('0x4a')]=_0x566aeb['attributes']['length']?_0x566aeb[_0x09e7('0x4a')]:_0x5a4a28[_0x09e7('0x45')];_0x566aeb[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x586ea4['query']['sort']);_0x566aeb[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_['pick'](_0x586ea4['query'],_0x5a4a28[_0x09e7('0x48')]));if(_0x586ea4[_0x09e7('0x46')]['filter']){_0x566aeb[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x566aeb[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0x566aeb[_0x09e7('0x4a')],function(_0x3810f8){var _0x4ac12d={};_0x4ac12d[_0x3810f8]={'$like':'%'+_0x586ea4[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x4ac12d;})});}_0x566aeb=_['merge']({},_0x566aeb,_0x586ea4[_0x09e7('0x53')]);return _0x1b78fc[_0x09e7('0xc0')](_0x566aeb);}})[_0x09e7('0x23')](function(_0x8ea913){if(_0x8ea913){_0x109352=_0x8ea913[_0x09e7('0x4c')];if(!_0x586ea4[_0x09e7('0x46')][_0x09e7('0x4d')](_0x09e7('0x6b'))){_0x566aeb[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x586ea4[_0x09e7('0x46')][_0x09e7('0x33')]);_0x566aeb['offset']=qs[_0x09e7('0x35')](_0x586ea4[_0x09e7('0x46')][_0x09e7('0x35')]);}return _0x1b78fc[_0x09e7('0xc0')](_0x566aeb);}})[_0x09e7('0x23')](function(_0x4fe1d5){if(_0x4fe1d5){return _0x4fe1d5?{'count':_0x109352,'rows':_0x4fe1d5}:null;}})[_0x09e7('0x23')](respondWithResult(_0x389b97,null))[_0x09e7('0x2e')](handleError(_0x389b97,null));}; \ No newline at end of file +var _0x20ff=['updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','ListId','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','FaxAccounts','UserProfileResource','sendStatus','name','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','show','params','create','body','user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rawAttributes','findAll','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','Owner','fullname','Tag','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','stack','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt'];(function(_0x413df5,_0x525343){var _0x435678=function(_0x425c85){while(--_0x425c85){_0x413df5['push'](_0x413df5['shift']());}};_0x435678(++_0x525343);}(_0x20ff,0xe9));var _0xf20f=function(_0x3b0138,_0x4b4e19){_0x3b0138=_0x3b0138-0x0;var _0x4969ed=_0x20ff[_0x3b0138];return _0x4969ed;};'use strict';var emlformat=require(_0xf20f('0x0'));var rimraf=require(_0xf20f('0x1'));var zipdir=require(_0xf20f('0x2'));var jsonpatch=require(_0xf20f('0x3'));var rp=require(_0xf20f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf20f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf20f('0x6'));var fs=require('fs');var fs_extra=require(_0xf20f('0x7'));var _=require(_0xf20f('0x8'));var squel=require(_0xf20f('0x9'));var crypto=require(_0xf20f('0xa'));var jsforce=require(_0xf20f('0xb'));var deskjs=require(_0xf20f('0xc'));var toCsv=require(_0xf20f('0xd'));var querystring=require(_0xf20f('0xe'));var Papa=require(_0xf20f('0xf'));var Redis=require(_0xf20f('0x10'));var authService=require(_0xf20f('0x11'));var qs=require(_0xf20f('0x12'));var as=require(_0xf20f('0x13'));var hardwareService=require(_0xf20f('0x14'));var logger=require(_0xf20f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf20f('0x16'));var db=require(_0xf20f('0x17'))['db'];config[_0xf20f('0x18')]=_[_0xf20f('0x19')](config[_0xf20f('0x18')],{'host':_0xf20f('0x1a'),'port':0x18eb});var socket=require(_0xf20f('0x1b'))(new Redis(config[_0xf20f('0x18')]));require(_0xf20f('0x1c'))[_0xf20f('0x1d')](socket);var jayson=require(_0xf20f('0x1e'));var client=jayson[_0xf20f('0x1f')][_0xf20f('0x20')]({'port':0x232c});var client9002=jayson[_0xf20f('0x1f')][_0xf20f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x181711,_0x247e0b,_0x340b4f,_0x121bb1){return new BPromise(function(_0x1aed2b,_0x59623e){var _0x3cafca=_0x121bb1||client;return _0x3cafca[_0xf20f('0x21')](_0x181711,_0x340b4f)['then'](function(_0x36690a){logger[_0xf20f('0x22')](_0xf20f('0x23'),_0x247e0b,_0xf20f('0x24'));logger[_0xf20f('0x25')](_0xf20f('0x26'),_0x247e0b,_0xf20f('0x24'),JSON[_0xf20f('0x27')](_0x36690a));if(_0x36690a[_0xf20f('0x28')]){if(_0x36690a['error'][_0xf20f('0x29')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x247e0b,_0x36690a[_0xf20f('0x28')][_0xf20f('0x2a')]);return _0x59623e(_0x36690a[_0xf20f('0x28')][_0xf20f('0x2a')]);}logger[_0xf20f('0x28')](_0xf20f('0x23'),_0x247e0b,_0x36690a[_0xf20f('0x28')]['message']);return _0x1aed2b(_0x36690a['error'][_0xf20f('0x2a')]);}else{logger[_0xf20f('0x22')]('FaxAccount,\x20%s,\x20%s',_0x247e0b,_0xf20f('0x24'));_0x1aed2b(_0x36690a[_0xf20f('0x2b')][_0xf20f('0x2a')]);}})[_0xf20f('0x2c')](function(_0x3d6723){logger['error']('FaxAccount,\x20%s,\x20%s',_0x247e0b,_0x3d6723);_0x59623e(_0x3d6723);});});}function respondWithStatusCode(_0x52e7d0,_0x2200ca){_0x2200ca=_0x2200ca||0xcc;return function(_0x3cb92f){if(_0x3cb92f){return _0x52e7d0['sendStatus'](_0x2200ca);}return _0x52e7d0[_0xf20f('0x2d')](_0x2200ca)[_0xf20f('0x2e')]();};}function respondWithResult(_0x19b7a6,_0x36513b){_0x36513b=_0x36513b||0xc8;return function(_0x17f34b){if(_0x17f34b){return _0x19b7a6[_0xf20f('0x2d')](_0x36513b)[_0xf20f('0x2f')](_0x17f34b);}};}function respondWithFilteredResult(_0x368fd1,_0x20239a){return function(_0x219856){if(_0x219856){var _0x2a8ee1=typeof _0x20239a[_0xf20f('0x30')]===_0xf20f('0x31')&&typeof _0x20239a[_0xf20f('0x32')]===_0xf20f('0x31');var _0x162969=_0x219856[_0xf20f('0x33')];var _0x50f8a1=_0x2a8ee1?0x0:_0x20239a[_0xf20f('0x30')];var _0x1d1f84=_0x2a8ee1?_0x219856['count']:_0x20239a[_0xf20f('0x30')]+_0x20239a[_0xf20f('0x32')];var _0x44ce26;if(_0x1d1f84>=_0x162969){_0x1d1f84=_0x162969;_0x44ce26=0xc8;}else{_0x44ce26=0xce;}_0x368fd1[_0xf20f('0x2d')](_0x44ce26);return _0x368fd1['set'](_0xf20f('0x34'),_0x50f8a1+'-'+_0x1d1f84+'/'+_0x162969)[_0xf20f('0x2f')](_0x219856);}return null;};}function patchUpdates(_0x505c23){return function(_0x370910){try{jsonpatch[_0xf20f('0x35')](_0x370910,_0x505c23,!![]);}catch(_0x142660){return BPromise[_0xf20f('0x36')](_0x142660);}return _0x370910['save']();};}function saveUpdates(_0x1f9ce1,_0x466201){return function(_0x1c7024){if(_0x1c7024){return _0x1c7024[_0xf20f('0x37')](_0x1f9ce1)['then'](function(_0x1def6f){return _0x1def6f;});}return null;};}function removeEntity(_0x272669,_0x5bd162){return function(_0x57fd10){if(_0x57fd10){return _0x57fd10[_0xf20f('0x38')]()[_0xf20f('0x39')](function(){var _0x443781=_0x57fd10['get']({'plain':!![]});var _0xc091cc=_0xf20f('0x3a');return db[_0xf20f('0x3b')][_0xf20f('0x38')]({'where':{'type':_0xc091cc,'resourceId':_0x443781['id']}})[_0xf20f('0x39')](function(){return _0x57fd10;});})[_0xf20f('0x39')](function(){_0x272669[_0xf20f('0x2d')](0xcc)[_0xf20f('0x2e')]();});}};}function handleEntityNotFound(_0x296973,_0x3843c3){return function(_0x3aaab1){if(!_0x3aaab1){_0x296973[_0xf20f('0x3c')](0x194);}return _0x3aaab1;};}function handleError(_0x14a686,_0x1ed774){_0x1ed774=_0x1ed774||0x1f4;return function(_0x53e6eb){logger['error'](_0x53e6eb['stack']);if(_0x53e6eb[_0xf20f('0x3d')]){delete _0x53e6eb['name'];}_0x14a686[_0xf20f('0x2d')](_0x1ed774)['send'](_0x53e6eb);};}exports['index']=function(_0x3d539f,_0x584022){var _0xf49fac={'include':[{'model':db[_0xf20f('0x3e')],'as':_0xf20f('0x3f')}]},_0x2b8288={},_0x475838={'count':0x0,'rows':[]};var _0xcf2202=_[_0xf20f('0x40')](db[_0xf20f('0x41')]['rawAttributes'],function(_0x388118){return{'name':_0x388118[_0xf20f('0x42')],'type':_0x388118[_0xf20f('0x43')][_0xf20f('0x44')]};});_0x2b8288[_0xf20f('0x45')]=_[_0xf20f('0x40')](_0xcf2202,_0xf20f('0x3d'));_0x2b8288[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x3d539f[_0xf20f('0x46')]);_0x2b8288[_0xf20f('0x48')]=_[_0xf20f('0x49')](_0x2b8288[_0xf20f('0x45')],_0x2b8288['query']);_0xf49fac[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x2b8288[_0xf20f('0x45')],qs['fields'](_0x3d539f[_0xf20f('0x46')][_0xf20f('0x4b')]));_0xf49fac[_0xf20f('0x4a')]=_0xf49fac[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0xf49fac[_0xf20f('0x4a')]:_0x2b8288[_0xf20f('0x45')];if(!_0x3d539f[_0xf20f('0x46')][_0xf20f('0x4d')](_0xf20f('0x4e'))){_0xf49fac['limit']=qs[_0xf20f('0x32')](_0x3d539f[_0xf20f('0x46')]['limit']);_0xf49fac[_0xf20f('0x30')]=qs[_0xf20f('0x30')](_0x3d539f['query'][_0xf20f('0x30')]);}_0xf49fac[_0xf20f('0x4f')]=qs['sort'](_0x3d539f['query'][_0xf20f('0x50')]);_0xf49fac['where']=qs['filters'](_[_0xf20f('0x51')](_0x3d539f[_0xf20f('0x46')],_0x2b8288[_0xf20f('0x48')]),_0xcf2202);if(_0x3d539f[_0xf20f('0x46')][_0xf20f('0x52')]){_0xf49fac['where']=_[_0xf20f('0x53')](_0xf49fac[_0xf20f('0x54')],{'$or':_[_0xf20f('0x40')](_0xcf2202,function(_0x4d278d){if(_0x4d278d[_0xf20f('0x43')]!==_0xf20f('0x55')){var _0x4ab8e8={};_0x4ab8e8[_0x4d278d[_0xf20f('0x3d')]]={'$like':'%'+_0x3d539f[_0xf20f('0x46')]['filter']+'%'};return _0x4ab8e8;}})});}_0xf49fac=_[_0xf20f('0x53')]({},_0xf49fac,_0x3d539f['options']);var _0x11c8bb={'where':_0xf49fac[_0xf20f('0x54')]};return db[_0xf20f('0x41')][_0xf20f('0x33')](_0x11c8bb)[_0xf20f('0x39')](function(_0x15c112){_0x475838[_0xf20f('0x33')]=_0x15c112;if(_0x3d539f['query'][_0xf20f('0x56')]){_0xf49fac[_0xf20f('0x57')]=[{'all':!![]}];}return db[_0xf20f('0x41')]['findAll'](_0xf49fac);})['then'](function(_0x1ce301){_0x475838[_0xf20f('0x58')]=_0x1ce301;return _0x475838;})[_0xf20f('0x39')](respondWithFilteredResult(_0x584022,_0xf49fac))['catch'](handleError(_0x584022,null));};exports[_0xf20f('0x59')]=function(_0x446b57,_0x1a7870){var _0x256953={'raw':![],'where':{'id':_0x446b57[_0xf20f('0x5a')]['id']},'include':[{'model':db[_0xf20f('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3e44a9={};_0x3e44a9[_0xf20f('0x45')]=_[_0xf20f('0x47')](db[_0xf20f('0x41')]['rawAttributes']);_0x3e44a9[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x446b57['query']);_0x3e44a9[_0xf20f('0x48')]=_[_0xf20f('0x49')](_0x3e44a9['model'],_0x3e44a9[_0xf20f('0x46')]);_0x256953[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x3e44a9[_0xf20f('0x45')],qs[_0xf20f('0x4b')](_0x446b57[_0xf20f('0x46')][_0xf20f('0x4b')]));_0x256953['attributes']=_0x256953[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0x256953[_0xf20f('0x4a')]:_0x3e44a9['model'];if(_0x446b57[_0xf20f('0x46')][_0xf20f('0x56')]){_0x256953[_0xf20f('0x57')]=[{'all':!![]}];}_0x256953=_[_0xf20f('0x53')]({},_0x256953,_0x446b57['options']);return db[_0xf20f('0x41')]['find'](_0x256953)[_0xf20f('0x39')](handleEntityNotFound(_0x1a7870,null))[_0xf20f('0x39')](respondWithResult(_0x1a7870,null))[_0xf20f('0x2c')](handleError(_0x1a7870,null));};exports[_0xf20f('0x5b')]=function(_0x6e669c,_0x3995cc){return db[_0xf20f('0x41')][_0xf20f('0x5b')](_0x6e669c[_0xf20f('0x5c')],{})['then'](function(_0x5aaaac){var _0x380b24=_0x6e669c[_0xf20f('0x5d')][_0xf20f('0x5e')]({'plain':!![]});if(!_0x380b24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x380b24['role']===_0xf20f('0x5d')){var _0x240556=_0x5aaaac['get']({'plain':!![]});var _0x55a0e7=_0xf20f('0x3a');return db[_0xf20f('0x5f')][_0xf20f('0x60')]({'where':{'name':_0x55a0e7,'userProfileId':_0x380b24['userProfileId']},'raw':!![]})[_0xf20f('0x39')](function(_0x336b4b){if(_0x336b4b&&_0x336b4b[_0xf20f('0x61')]===0x0){return db[_0xf20f('0x3b')][_0xf20f('0x5b')]({'name':_0x240556[_0xf20f('0x3d')],'resourceId':_0x240556['id'],'type':_0x336b4b[_0xf20f('0x3d')],'sectionId':_0x336b4b['id']},{})['then'](function(){return _0x5aaaac;});}else{return _0x5aaaac;}})[_0xf20f('0x2c')](function(_0xd91aab){logger[_0xf20f('0x28')](_0xf20f('0x62'),_0xd91aab);throw _0xd91aab;});}return _0x5aaaac;})['then'](respondWithResult(_0x3995cc,0xc9))[_0xf20f('0x2c')](handleError(_0x3995cc,null));};exports[_0xf20f('0x37')]=function(_0x5bf672,_0x4e69f0){if(_0x5bf672[_0xf20f('0x5c')]['id']){delete _0x5bf672[_0xf20f('0x5c')]['id'];}return db[_0xf20f('0x41')][_0xf20f('0x60')]({'where':{'id':_0x5bf672['params']['id']},'include':[{'model':db[_0xf20f('0x3e')],'as':_0xf20f('0x3f')}]})[_0xf20f('0x39')](handleEntityNotFound(_0x4e69f0,null))[_0xf20f('0x39')](saveUpdates(_0x5bf672[_0xf20f('0x5c')],null))[_0xf20f('0x39')](respondWithResult(_0x4e69f0,null))[_0xf20f('0x2c')](handleError(_0x4e69f0,null));};exports['destroy']=function(_0x28fccc,_0x49d6d6){return db['FaxAccount'][_0xf20f('0x60')]({'where':{'id':_0x28fccc['params']['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x49d6d6,null))[_0xf20f('0x39')](removeEntity(_0x49d6d6,null))[_0xf20f('0x2c')](handleError(_0x49d6d6,null));};exports['describe']=function(_0x39af5a,_0xd837eb){return db[_0xf20f('0x41')][_0xf20f('0x63')]()[_0xf20f('0x39')](respondWithResult(_0xd837eb,null))['catch'](handleError(_0xd837eb,null));};exports['addDisposition']=function(_0x4a77c1,_0x38402f,_0x104b01){if(_0x4a77c1[_0xf20f('0x5c')]['id']){delete _0x4a77c1[_0xf20f('0x5c')]['id'];}return db[_0xf20f('0x41')][_0xf20f('0x60')]({'where':{'id':_0x4a77c1[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x38402f,null))[_0xf20f('0x39')](function(_0x4dc672){if(_0x4dc672){_0x4a77c1[_0xf20f('0x5c')][_0xf20f('0x64')]=_0x4dc672['id'];return db[_0xf20f('0x65')][_0xf20f('0x5b')](_0x4a77c1['body']);}})['then'](respondWithResult(_0x38402f,null))[_0xf20f('0x2c')](handleError(_0x38402f,null));};exports[_0xf20f('0x66')]=function(_0x53e7e6,_0x2e7662,_0x5a3a59){var _0x36b244={'raw':![],'where':{}};var _0x347e4f={};var _0x17536c={'count':0x0,'rows':[]};return db[_0xf20f('0x41')]['findOne']({'where':{'id':_0x53e7e6[_0xf20f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2e7662,null))[_0xf20f('0x39')](function(_0x3482c3){if(_0x3482c3){_0x347e4f[_0xf20f('0x45')]=_[_0xf20f('0x47')](db[_0xf20f('0x65')]['rawAttributes']);_0x347e4f[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x53e7e6['query']);_0x347e4f['filters']=_['intersection'](_0x347e4f[_0xf20f('0x45')],_0x347e4f[_0xf20f('0x46')]);_0x36b244[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x347e4f['model'],qs[_0xf20f('0x4b')](_0x53e7e6['query'][_0xf20f('0x4b')]));_0x36b244[_0xf20f('0x4a')]=_0x36b244[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0x36b244[_0xf20f('0x4a')]:_0x347e4f['model'];if(!_0x53e7e6[_0xf20f('0x46')][_0xf20f('0x4d')](_0xf20f('0x4e'))){_0x36b244['limit']=qs['limit'](_0x53e7e6[_0xf20f('0x46')][_0xf20f('0x32')]);_0x36b244[_0xf20f('0x30')]=qs['offset'](_0x53e7e6['query'][_0xf20f('0x30')]);}_0x36b244[_0xf20f('0x4f')]=qs[_0xf20f('0x50')](_0x53e7e6[_0xf20f('0x46')]['sort']);_0x36b244['where']=qs['filters'](_[_0xf20f('0x51')](_0x53e7e6[_0xf20f('0x46')],_0x347e4f['filters']));_0x36b244[_0xf20f('0x54')][_0xf20f('0x64')]=_0x3482c3['id'];if(_0x53e7e6[_0xf20f('0x46')][_0xf20f('0x52')]){_0x36b244[_0xf20f('0x54')]=_[_0xf20f('0x53')](_0x36b244[_0xf20f('0x54')],{'$or':_[_0xf20f('0x40')](_0x36b244[_0xf20f('0x4a')],function(_0x5a68a3){var _0x47aa87={};_0x47aa87[_0x5a68a3]={'$like':'%'+_0x53e7e6[_0xf20f('0x46')][_0xf20f('0x52')]+'%'};return _0x47aa87;})});}_0x36b244=_[_0xf20f('0x53')]({},_0x36b244,_0x53e7e6[_0xf20f('0x67')]);return db[_0xf20f('0x65')]['count']({'where':_0x36b244[_0xf20f('0x54')]})[_0xf20f('0x39')](function(_0x3ab475){_0x17536c[_0xf20f('0x33')]=_0x3ab475;if(_0x53e7e6['query'][_0xf20f('0x56')]){_0x36b244[_0xf20f('0x57')]=[{'all':!![]}];}return db[_0xf20f('0x65')]['findAll'](_0x36b244);})['then'](function(_0x6f9326){_0x17536c['rows']=_0x6f9326;return _0x17536c;});}})['then'](respondWithFilteredResult(_0x2e7662,_0x36b244))['catch'](handleError(_0x2e7662,null));};exports['removeDispositions']=function(_0x417b20,_0x26a25e,_0x18d0d3){return db[_0xf20f('0x41')][_0xf20f('0x60')]({'where':{'id':_0x417b20['params']['id']}})['then'](handleEntityNotFound(_0x26a25e,null))[_0xf20f('0x39')](function(_0x1ee0f6){if(_0x1ee0f6){return _0x1ee0f6[_0xf20f('0x68')](_0x417b20['query'][_0xf20f('0x69')]);}})[_0xf20f('0x39')](respondWithStatusCode(_0x26a25e,null))[_0xf20f('0x2c')](handleError(_0x26a25e,null));};exports[_0xf20f('0x6a')]=function(_0xe76f1f,_0x1df400,_0x14735a){if(_0xe76f1f[_0xf20f('0x5c')]['id']){delete _0xe76f1f['body']['id'];}return db[_0xf20f('0x41')][_0xf20f('0x60')]({'where':{'id':_0xe76f1f[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x1df400,null))[_0xf20f('0x39')](function(_0x158fd9){if(_0x158fd9){_0xe76f1f['body']['FaxAccountId']=_0x158fd9['id'];return db[_0xf20f('0x6b')][_0xf20f('0x5b')](_0xe76f1f[_0xf20f('0x5c')]);}})[_0xf20f('0x39')](respondWithResult(_0x1df400,null))[_0xf20f('0x2c')](handleError(_0x1df400,null));};exports[_0xf20f('0x6c')]=function(_0x117544,_0x41c872,_0x1b26b5){var _0x234e8f={'raw':![],'where':{}};var _0x2d175d={};var _0x44eade={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf20f('0x6d')]({'where':{'id':_0x117544['params']['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x41c872,null))[_0xf20f('0x39')](function(_0x2b67d6){if(_0x2b67d6){_0x2d175d[_0xf20f('0x45')]=_['keys'](db['CannedAnswer'][_0xf20f('0x6e')]);_0x2d175d[_0xf20f('0x46')]=_['keys'](_0x117544[_0xf20f('0x46')]);_0x2d175d['filters']=_['intersection'](_0x2d175d['model'],_0x2d175d[_0xf20f('0x46')]);_0x234e8f[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x2d175d[_0xf20f('0x45')],qs[_0xf20f('0x4b')](_0x117544[_0xf20f('0x46')][_0xf20f('0x4b')]));_0x234e8f[_0xf20f('0x4a')]=_0x234e8f[_0xf20f('0x4a')]['length']?_0x234e8f[_0xf20f('0x4a')]:_0x2d175d[_0xf20f('0x45')];if(!_0x117544['query'][_0xf20f('0x4d')]('nolimit')){_0x234e8f[_0xf20f('0x32')]=qs[_0xf20f('0x32')](_0x117544[_0xf20f('0x46')]['limit']);_0x234e8f[_0xf20f('0x30')]=qs[_0xf20f('0x30')](_0x117544[_0xf20f('0x46')][_0xf20f('0x30')]);}_0x234e8f['order']=qs[_0xf20f('0x50')](_0x117544['query']['sort']);_0x234e8f[_0xf20f('0x54')]=qs['filters'](_[_0xf20f('0x51')](_0x117544[_0xf20f('0x46')],_0x2d175d[_0xf20f('0x48')]));_0x234e8f[_0xf20f('0x54')][_0xf20f('0x64')]=_0x2b67d6['id'];if(_0x117544[_0xf20f('0x46')][_0xf20f('0x52')]){_0x234e8f[_0xf20f('0x54')]=_[_0xf20f('0x53')](_0x234e8f[_0xf20f('0x54')],{'$or':_['map'](_0x234e8f[_0xf20f('0x4a')],function(_0x32ae28){var _0xf45246={};_0xf45246[_0x32ae28]={'$like':'%'+_0x117544[_0xf20f('0x46')][_0xf20f('0x52')]+'%'};return _0xf45246;})});}_0x234e8f=_[_0xf20f('0x53')]({},_0x234e8f,_0x117544[_0xf20f('0x67')]);return db[_0xf20f('0x6b')][_0xf20f('0x33')]({'where':_0x234e8f[_0xf20f('0x54')]})[_0xf20f('0x39')](function(_0x395432){_0x44eade[_0xf20f('0x33')]=_0x395432;if(_0x117544[_0xf20f('0x46')][_0xf20f('0x56')]){_0x234e8f[_0xf20f('0x57')]=[{'all':!![]}];}return db[_0xf20f('0x6b')][_0xf20f('0x6f')](_0x234e8f);})['then'](function(_0x4583ba){_0x44eade['rows']=_0x4583ba;return _0x44eade;});}})[_0xf20f('0x39')](respondWithFilteredResult(_0x41c872,_0x234e8f))[_0xf20f('0x2c')](handleError(_0x41c872,null));};exports[_0xf20f('0x70')]=function(_0x1f9ea9,_0x4c9263,_0x5ca934){return db[_0xf20f('0x41')][_0xf20f('0x60')]({'where':{'id':_0x1f9ea9[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x4c9263,null))[_0xf20f('0x39')](function(_0xdf3979){if(_0xdf3979){return _0xdf3979[_0xf20f('0x70')](_0x1f9ea9[_0xf20f('0x46')][_0xf20f('0x69')]);}})['then'](respondWithStatusCode(_0x4c9263,null))[_0xf20f('0x2c')](handleError(_0x4c9263,null));};exports['addInteraction']=function(_0x35ad59,_0x433063,_0x254f33){return db['FaxInteraction'][_0xf20f('0x60')]({'where':{'id':_0x35ad59[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x433063,null))['then'](function(_0x559568){if(_0x559568){return _0x559568[_0xf20f('0x71')](_0x35ad59[_0xf20f('0x5c')][_0xf20f('0x69')],_[_0xf20f('0x72')](_0x35ad59[_0xf20f('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x433063,null))[_0xf20f('0x2c')](handleError(_0x433063,null));};exports['getInteractions']=function(_0x53da3c,_0x1a60a9,_0x4dde7a){var _0x2d762e={'raw':![],'where':{}};var _0x4dd873={};var _0x501c1a={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x53da3c[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x1a60a9,null))[_0xf20f('0x39')](function(_0x3a76bb){if(_0x3a76bb){_0x4dd873[_0xf20f('0x45')]=_[_0xf20f('0x47')](db[_0xf20f('0x73')][_0xf20f('0x6e')]);_0x4dd873[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x53da3c[_0xf20f('0x46')]);_0x4dd873[_0xf20f('0x48')]=_[_0xf20f('0x49')](_0x4dd873[_0xf20f('0x45')],_0x4dd873['query']);_0x2d762e['attributes']=_[_0xf20f('0x49')](_0x4dd873[_0xf20f('0x45')],qs[_0xf20f('0x4b')](_0x53da3c[_0xf20f('0x46')]['fields']));_0x2d762e[_0xf20f('0x4a')]=_0x2d762e[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0x2d762e['attributes']:_0x4dd873[_0xf20f('0x45')];if(!_0x53da3c['query'][_0xf20f('0x4d')](_0xf20f('0x4e'))){_0x2d762e[_0xf20f('0x32')]=qs[_0xf20f('0x32')](_0x53da3c[_0xf20f('0x46')][_0xf20f('0x32')]);_0x2d762e[_0xf20f('0x30')]=qs[_0xf20f('0x30')](_0x53da3c[_0xf20f('0x46')][_0xf20f('0x30')]);}_0x2d762e[_0xf20f('0x4f')]=qs['sort'](_0x53da3c[_0xf20f('0x46')][_0xf20f('0x50')]);_0x2d762e['where']=qs[_0xf20f('0x48')](_[_0xf20f('0x51')](_0x53da3c[_0xf20f('0x46')],_0x4dd873[_0xf20f('0x48')]));_0x2d762e['where']['FaxAccountId']=_0x3a76bb['id'];if(_0x53da3c[_0xf20f('0x46')][_0xf20f('0x52')]){_0x2d762e[_0xf20f('0x54')]=_[_0xf20f('0x53')](_0x2d762e[_0xf20f('0x54')],{'$or':_[_0xf20f('0x40')](_0x2d762e[_0xf20f('0x4a')],function(_0x269f99){var _0x647f93={};_0x647f93[_0x269f99]={'$like':'%'+_0x53da3c['query'][_0xf20f('0x52')]+'%'};return _0x647f93;})});}_0x2d762e=_[_0xf20f('0x53')]({},_0x2d762e,_0x53da3c['options']);return db[_0xf20f('0x73')][_0xf20f('0x33')]({'where':_0x2d762e['where']})[_0xf20f('0x39')](function(_0x4cf283){_0x501c1a[_0xf20f('0x33')]=_0x4cf283;if(_0x53da3c['query'][_0xf20f('0x56')]){_0x2d762e[_0xf20f('0x57')]=[{'model':db['CmContact'],'as':_0xf20f('0x74'),'required':![]},{'model':db[_0xf20f('0x75')],'as':_0xf20f('0x76'),'attributes':[_0xf20f('0x3d'),_0xf20f('0x77'),'internal'],'required':![]},{'model':db[_0xf20f('0x78')],'as':'Tags','attributes':['id',_0xf20f('0x3d'),'color'],'where':_0x53da3c['query']['tag']?{'id':_0x53da3c[_0xf20f('0x46')][_0xf20f('0x79')]}:undefined,'required':_0x53da3c['query'][_0xf20f('0x79')]?!![]:![]}];}return db['FaxInteraction'][_0xf20f('0x6f')](_0x2d762e);})['then'](function(_0x3e4bba){_0x501c1a[_0xf20f('0x58')]=_0x3e4bba;return _0x501c1a;});}})[_0xf20f('0x39')](respondWithFilteredResult(_0x1a60a9,_0x2d762e))['catch'](handleError(_0x1a60a9,null));};exports['addApplications']=function(_0x1353a6,_0x468ca5){var _0x33421b=_0x1353a6[_0xf20f('0x5a')]['id'];var _0x514313=_0x1353a6[_0xf20f('0x5c')];var _0x58bec5=0xc8;var _0x5a92f9=null;return db[_0xf20f('0x7a')][_0xf20f('0x7b')]({'isolationLevel':db[_0xf20f('0x7a')]['Transaction'][_0xf20f('0x7c')][_0xf20f('0x7d')]},function(_0xabe776){return db[_0xf20f('0x41')]['findOne']({'where':{'id':_0x33421b},'transaction':_0xabe776})[_0xf20f('0x39')](function(_0x1fb014){if(_0x1fb014){return db['FaxApplication'][_0xf20f('0x38')]({'where':{'FaxAccountId':_0x33421b},'transaction':_0xabe776})[_0xf20f('0x39')](function(){var _0x542310=_[_0xf20f('0x40')](_0x514313,function(_0x109e63){_0x109e63[_0xf20f('0x64')]=_0x33421b;return _0x109e63;});return db[_0xf20f('0x7e')][_0xf20f('0x7f')](_0x542310,{'transaction':_0xabe776});});}else{_0x58bec5=0x194;_0x5a92f9=[];}});})[_0xf20f('0x39')](function(){if(_0x58bec5!==0x194){return db[_0xf20f('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x33421b},'order':_0xf20f('0x80')})[_0xf20f('0x39')](function(_0x30b30c){_0x5a92f9=_0x30b30c;});}})[_0xf20f('0x2c')](function(_0x59de2a){_0x58bec5=0x1f4;logger['error'](_0x59de2a[_0xf20f('0x81')]);if(_0x59de2a['name']){delete _0x59de2a[_0xf20f('0x3d')];}_0x5a92f9=_0x59de2a;})[_0xf20f('0x82')](function(){if(_0x5a92f9===null){_0x468ca5[_0xf20f('0x3c')](_0x58bec5);}else{if(_0x58bec5===0x1f4){_0x468ca5['status'](_0x58bec5)['send'](_0x5a92f9);}else{_0x468ca5[_0xf20f('0x2d')](_0x58bec5)['json'](_0x5a92f9);}}});};exports['getApplications']=function(_0x2ac588,_0xc667a5,_0x1ee7fb){var _0x402843={};var _0x32df53={};var _0x112218;var _0x57b098;return db[_0xf20f('0x41')][_0xf20f('0x6d')]({'where':{'id':_0x2ac588[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0xc667a5,null))[_0xf20f('0x39')](function(_0x2974d3){if(_0x2974d3){_0x112218=_0x2974d3;_0x32df53[_0xf20f('0x45')]=_['keys'](db[_0xf20f('0x7e')][_0xf20f('0x6e')]);_0x32df53[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x2ac588[_0xf20f('0x46')]);_0x32df53[_0xf20f('0x48')]=_[_0xf20f('0x49')](_0x32df53[_0xf20f('0x45')],_0x32df53[_0xf20f('0x46')]);_0x402843['attributes']=_[_0xf20f('0x49')](_0x32df53[_0xf20f('0x45')],qs[_0xf20f('0x4b')](_0x2ac588[_0xf20f('0x46')][_0xf20f('0x4b')]));_0x402843['attributes']=_0x402843['attributes'][_0xf20f('0x4c')]?_0x402843[_0xf20f('0x4a')]:_0x32df53['model'];_0x402843['order']=qs['sort'](_0x2ac588[_0xf20f('0x46')][_0xf20f('0x50')]);_0x402843['where']=qs[_0xf20f('0x48')](_[_0xf20f('0x51')](_0x2ac588['query'],_0x32df53[_0xf20f('0x48')]));if(_0x2ac588['query'][_0xf20f('0x52')]){_0x402843[_0xf20f('0x54')]=_['merge'](_0x402843[_0xf20f('0x54')],{'$or':_[_0xf20f('0x40')](_0x402843[_0xf20f('0x4a')],function(_0x23b722){var _0x4f5cf4={};_0x4f5cf4[_0x23b722]={'$like':'%'+_0x2ac588[_0xf20f('0x46')][_0xf20f('0x52')]+'%'};return _0x4f5cf4;})});}_0x402843=_[_0xf20f('0x53')]({},_0x402843,_0x2ac588[_0xf20f('0x67')]);return _0x112218[_0xf20f('0x83')](_0x402843);}})['then'](function(_0x4eaf50){if(_0x4eaf50){_0x57b098=_0x4eaf50[_0xf20f('0x4c')];if(!_0x2ac588[_0xf20f('0x46')]['hasOwnProperty'](_0xf20f('0x4e'))){_0x402843[_0xf20f('0x32')]=qs['limit'](_0x2ac588['query']['limit']);_0x402843[_0xf20f('0x30')]=qs[_0xf20f('0x30')](_0x2ac588[_0xf20f('0x46')]['offset']);}return _0x112218[_0xf20f('0x83')](_0x402843);}})['then'](function(_0x4ac40c){if(_0x4ac40c){return _0x4ac40c?{'count':_0x57b098,'rows':_0x4ac40c}:null;}})['then'](respondWithResult(_0xc667a5,null))[_0xf20f('0x2c')](handleError(_0xc667a5,null));};function Extension(_0x3215a2,_0xf20c07,_0x33544b,_0x76fab2){this[_0xf20f('0x84')]=_0xf20f('0x85');this[_0xf20f('0x86')]=_0x3215a2[_0xf20f('0x87')];this[_0xf20f('0x88')]=_0x76fab2;this[_0xf20f('0x43')]=_0xf20f('0x89');this[_0xf20f('0x8a')]=_0xf20f('0x8b');this['FaxAccountId']=_0x3215a2['id'];this[_0xf20f('0x80')]=_0xf20c07;this[_0xf20f('0x8c')]=_0x33544b;}function createExtensionsReciveFax(_0x1c90a3){var _0x24f77c=0x1;var _0x35e274=[];_0x35e274[_0xf20f('0x8d')](new Extension(_0x1c90a3,_0x24f77c,'',_0xf20f('0x8e')));_0x24f77c+=0x1;_0x35e274['push'](new Extension(_0x1c90a3,_0x24f77c,_0xf20f('0x8f'),_0xf20f('0x90')));_0x24f77c+=0x1;for(var _0x998253 in _0x1c90a3){if(_0x1c90a3['hasOwnProperty'](_0x998253)&&(_0x998253==='ecm'||_0x998253===_0xf20f('0x87')||_0x998253===_0xf20f('0x91')||_0x998253===_0xf20f('0x92')||_0x998253===_0xf20f('0x93')||_0x998253==='maxrate'||_0x998253==='minrate'||_0x998253===_0xf20f('0x94')||_0x998253===_0xf20f('0x95'))){_0x35e274[_0xf20f('0x8d')](new Extension(_0x1c90a3,_0x24f77c,_0xf20f('0x96')+_0x998253+')='+_0x1c90a3[_0x998253],_0xf20f('0x90')));_0x24f77c+=0x1;}}_0x35e274['push'](new Extension(_0x1c90a3,_0x24f77c,'6',_0xf20f('0x97')));_0x24f77c+=0x1;_0x35e274[_0xf20f('0x8d')](new Extension(_0x1c90a3,_0x24f77c,'/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',_0xf20f('0x98')));_0x24f77c=0x0;return _0x35e274;}exports['addAccountApplications']=function(_0x4669bc,_0x220ed8,_0x4728f6){var _0xbfd81d;return db[_0xf20f('0x7a')][_0xf20f('0x7b')](function(_0x4500d6){return db['FaxAccount'][_0xf20f('0x5b')](_0x4669bc[_0xf20f('0x5c')],{'transaction':_0x4500d6})[_0xf20f('0x39')](function(_0x21291b){_0xbfd81d=_0x21291b[_0xf20f('0x5e')]({'plain':!![]});return db[_0xf20f('0x99')][_0xf20f('0x7f')](createExtensionsReciveFax(_0xbfd81d),{'transaction':_0x4500d6});});})['then'](function(){return _0xbfd81d;})[_0xf20f('0x39')](respondWithResult(_0x220ed8,null))[_0xf20f('0x2c')](handleError(_0x220ed8,null));};exports[_0xf20f('0x9a')]=function(_0x3600ae,_0x3b3bfd,_0x264877){var _0x174e1b;return db['sequelize']['transaction'](function(_0x526166){return db['FaxAccount'][_0xf20f('0x37')](_0x3600ae[_0xf20f('0x5c')],{'where':{'id':_0x3600ae[_0xf20f('0x5c')]['id']},'transaction':_0x526166})[_0xf20f('0x39')](function(_0x25104b){return db[_0xf20f('0x99')][_0xf20f('0x38')]({'where':{'FaxAccountId':_0x3600ae['body']['id']},'transaction':_0x526166})[_0xf20f('0x39')](function(_0xcfaad4){return db[_0xf20f('0x99')][_0xf20f('0x7f')](createExtensionsReciveFax(_['omit'](_0x3600ae[_0xf20f('0x5c')],[_0xf20f('0x9b'),_0xf20f('0x44'),_0xf20f('0x9c'),_0xf20f('0x9d'),_0xf20f('0x9e'),'ListId'])),{'transaction':_0x526166});});});})['then'](function(){return db[_0xf20f('0x41')][_0xf20f('0x9f')](_0x3600ae[_0xf20f('0x5c')]['id']);})['then'](respondWithResult(_0x3b3bfd,null))[_0xf20f('0x2c')](handleError(_0x3b3bfd,null));};exports[_0xf20f('0xa0')]=function(_0x4488bc,_0x3645e7,_0x4fda06){var _0x34c555={'raw':!![],'where':{}};var _0x3874e7={};var _0xa014fc={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf20f('0x6d')]({'where':{'id':_0x4488bc[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x3645e7,null))[_0xf20f('0x39')](function(_0x2b9bd9){if(_0x2b9bd9){_0x3874e7[_0xf20f('0x45')]=_['keys'](db[_0xf20f('0xa1')]['rawAttributes']);_0x3874e7[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x4488bc[_0xf20f('0x46')]);_0x3874e7['filters']=_[_0xf20f('0x49')](_0x3874e7[_0xf20f('0x45')],_0x3874e7[_0xf20f('0x46')]);_0x34c555[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x3874e7['model'],qs[_0xf20f('0x4b')](_0x4488bc[_0xf20f('0x46')]['fields']));_0x34c555[_0xf20f('0x4a')]=_0x34c555[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0x34c555[_0xf20f('0x4a')]:_0x3874e7[_0xf20f('0x45')];if(!_0x4488bc[_0xf20f('0x46')][_0xf20f('0x4d')](_0xf20f('0x4e'))){_0x34c555[_0xf20f('0x32')]=qs[_0xf20f('0x32')](_0x4488bc['query'][_0xf20f('0x32')]);_0x34c555[_0xf20f('0x30')]=qs[_0xf20f('0x30')](_0x4488bc[_0xf20f('0x46')][_0xf20f('0x30')]);}_0x34c555[_0xf20f('0x4f')]=qs[_0xf20f('0x50')](_0x4488bc[_0xf20f('0x46')][_0xf20f('0x50')]);_0x34c555[_0xf20f('0x54')]=qs[_0xf20f('0x48')](_[_0xf20f('0x51')](_0x4488bc[_0xf20f('0x46')],_0x3874e7[_0xf20f('0x48')]));_0x34c555[_0xf20f('0x54')][_0xf20f('0x64')]=_0x2b9bd9['id'];if(_0x4488bc['query'][_0xf20f('0x52')]){_0x34c555[_0xf20f('0x54')]=_[_0xf20f('0x53')](_0x34c555['where'],{'$or':_[_0xf20f('0x40')](_0x34c555[_0xf20f('0x4a')],function(_0x569be9){var _0x4865c7={};_0x4865c7[_0x569be9]={'$like':'%'+_0x4488bc[_0xf20f('0x46')]['filter']+'%'};return _0x4865c7;})});}if(_0x4488bc['query'][_0xf20f('0xa2')]){var _0x204477=_0x4488bc[_0xf20f('0x46')][_0xf20f('0xa2')]['split'](',');var _0x36aa7e={};_0x36aa7e[_0x204477[0x0]]={'$gte':moment(_0x204477[0x1])[_0xf20f('0xa3')](_0xf20f('0xa4'))};_0x34c555[_0xf20f('0x54')]=_[_0xf20f('0x53')](_0x34c555[_0xf20f('0x54')],_0x36aa7e);}_0x34c555=_['merge']({},_0x34c555,_0x4488bc[_0xf20f('0x67')]);return db['FaxMessage'][_0xf20f('0x33')]({'where':_0x34c555[_0xf20f('0x54')]})[_0xf20f('0x39')](function(_0x54d910){_0xa014fc[_0xf20f('0x33')]=_0x54d910;if(_0x4488bc['query'][_0xf20f('0x56')]){_0x34c555[_0xf20f('0x57')]=[{'all':!![]}];}return db[_0xf20f('0xa1')]['findAll'](_0x34c555);})['then'](function(_0x4afa9f){_0xa014fc[_0xf20f('0x58')]=_0x4afa9f;return _0xa014fc;});}})[_0xf20f('0x39')](respondWithFilteredResult(_0x3645e7,_0x34c555))['catch'](handleError(_0x3645e7,null));};exports[_0xf20f('0xa5')]=function(_0x445463,_0x3ed492,_0xae5c17){var _0x5b9207,_0x28134b={},_0x2edd7f;if(_0x445463[_0xf20f('0x5c')]['to']){_0x2edd7f=_0x445463[_0xf20f('0x5c')]['to'][0x0];}return db['FaxAccount'][_0xf20f('0x60')]({'where':{'id':_0x445463[_0xf20f('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xf20f('0xa6'),'include':[{'model':db['CmContact'],'as':_0xf20f('0xa7'),'where':{'fax':_0x2edd7f},'limit':0x1,'order':[['updatedAt',_0xf20f('0xa8')]]}]}]})[_0xf20f('0x39')](handleEntityNotFound(_0x3ed492,null))[_0xf20f('0x39')](function(_0x213a55){_0x5b9207=_0x213a55;if(_0x445463[_0xf20f('0x5c')]['attachments']&&_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')]['length']){for(var _0x53cdae=0x0;_0x53cdae<_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')][_0xf20f('0x4c')];_0x53cdae+=0x1){_0x445463['body'][_0xf20f('0xa9')][_0x53cdae]={'filename':_0x445463['body']['attachments'][_0x53cdae][_0xf20f('0x3d')],'id':_0x445463['body'][_0xf20f('0xa9')][_0x53cdae]['id'],'path':path[_0xf20f('0xaa')](config[_0xf20f('0xab')],_0xf20f('0xac'),_0x445463['body'][_0xf20f('0xa9')][_0x53cdae][_0xf20f('0xad')])};}}return respondWithRpcPromise(_0xf20f('0xae'),_0xf20f('0xae'),{'FaxAccountId':_[_0xf20f('0xaf')](_0x445463[_0xf20f('0x5a')]['id'])?undefined:_0x445463['params']['id'],'path':_[_0xf20f('0xaf')](_0x445463['body']['attachments'][0x0][_0xf20f('0xb0')])?undefined:_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')][0x0][_0xf20f('0xb0')],'fax':_[_0xf20f('0xaf')](_0x445463[_0xf20f('0x5c')]['to'][0x0])?undefined:_0x445463[_0xf20f('0x5c')]['to'][0x0]},client9002);})[_0xf20f('0x39')](function(){if(_0x5b9207){if(_[_0xf20f('0xaf')](_0x445463['body'][_0xf20f('0xb1')])){_0x445463[_0xf20f('0x5c')][_0xf20f('0xb1')]=util[_0xf20f('0xa3')](_0xf20f('0xb2'),_0x5b9207[_0xf20f('0x3d')],_0x5b9207['fax']);}if(_0x5b9207[_0xf20f('0xa6')]){if(_0x5b9207[_0xf20f('0xa6')][_0xf20f('0xa7')][_0xf20f('0x4c')]){return _0x5b9207[_0xf20f('0xa6')][_0xf20f('0xa7')][0x0];}else{return db['CmContact'][_0xf20f('0x5b')](_[_0xf20f('0x19')](_0x445463[_0xf20f('0x5c')],{'firstName':_0x445463[_0xf20f('0x5c')]['to'][0x0],'phone':_0x445463[_0xf20f('0x5c')]['to'][0x0],'fax':_0x445463[_0xf20f('0x5c')]['to'][0x0],'ListId':_0x5b9207[_0xf20f('0xb3')]}));}}else{throw new Error(_0xf20f('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x5b0cd5){if(_0x5b0cd5){return db[_0xf20f('0x73')]['find']({'where':{'ContactId':_0x5b0cd5['id'],'closed':![],'FaxAccountId':_0x5b9207['id']}})[_0xf20f('0x39')](function(_0x4a51dc){if(_0x4a51dc){return[_0x4a51dc,![]];}return db['FaxInteraction'][_0xf20f('0x5b')]({'UserId':_0x445463['user']['id'],'ContactId':_0x5b0cd5['id'],'FaxAccountId':_0x5b9207['id'],'fax':_0x445463[_0xf20f('0x5c')]['to'][0x0],'firstMsgDirection':_0xf20f('0xb5'),'Messages':[_[_0xf20f('0x53')](_0x445463[_0xf20f('0x5c')],{'read':![],'body':_0x445463[_0xf20f('0x5c')]['attachments'][0x0][_0xf20f('0xb6')],'FaxAccountId':_0x5b9207['id'],'UserId':_0x445463[_0xf20f('0x5d')]['id'],'ContactId':_0x5b0cd5['id'],'AttachmentId':_0x445463[_0xf20f('0x5c')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xf20f('0xa1')],'as':_0xf20f('0xb7')}]})[_0xf20f('0x39')](function(_0x3a2bcb){return[_0x3a2bcb,!![]];});});}else{throw new Error(_0xf20f('0xb8'));}})[_0xf20f('0xb9')](function(_0x5028b5,_0x50dcce){if(_0x50dcce){return _0x5028b5;}return db[_0xf20f('0xa1')][_0xf20f('0x5b')]({'direction':_0xf20f('0xb5'),'read':![],'body':_0x445463['body']['attachments'][0x0][_0xf20f('0xb6')],'FaxAccountId':_0x5b9207['id'],'FaxInteractionId':_0x5028b5['id'],'UserId':_0x445463[_0xf20f('0x5d')]['id'],'ContactId':_0x5028b5[_0xf20f('0xba')],'AttachmentId':_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')][0x0]['id']})[_0xf20f('0x39')](function(_0x151f0c){_0x5028b5['dataValues'][_0xf20f('0xb7')]=[];_0x5028b5[_0xf20f('0xbb')][_0xf20f('0xb7')][_0xf20f('0x8d')](_0x151f0c[_0xf20f('0xbb')]);return _0x5028b5;});})[_0xf20f('0x39')](function(_0x4749df){respondWithRpcPromise(_0xf20f('0xbc'),_0xf20f('0xbc'),{'FaxAccountId':_[_0xf20f('0xaf')](_0x445463[_0xf20f('0x5a')]['id'])?undefined:_0x445463[_0xf20f('0x5a')]['id'],'path':_[_0xf20f('0xaf')](_0x445463[_0xf20f('0x5c')]['attachments'][0x0][_0xf20f('0xb0')])?undefined:_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')][0x0][_0xf20f('0xb0')],'fax':_[_0xf20f('0xaf')](_0x445463[_0xf20f('0x5c')]['to'][0x0])?undefined:_0x445463[_0xf20f('0x5c')]['to'][0x0],'AttachmentId':_0x445463[_0xf20f('0x5c')][_0xf20f('0xa9')][0x0]['id']},client9002)[_0xf20f('0x39')](function(_0x2573d){logger[_0xf20f('0x22')](_0xf20f('0xbd'),_0x2573d);})[_0xf20f('0x2c')](function(_0xe77fad){logger[_0xf20f('0x22')]('SendFaxRpc,\x20%s',_0xe77fad);});return _0x4749df;})[_0xf20f('0x39')](respondWithResult(_0x3ed492,null))[_0xf20f('0x2c')](handleError(_0x3ed492,null));};exports[_0xf20f('0xbe')]=function(_0x466551,_0x24b1e8,_0x4c6494){return db[_0xf20f('0x41')]['find']({'where':{'id':_0x466551[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x24b1e8,null))[_0xf20f('0x39')](function(_0x57a81c){if(_0x57a81c){return _0x57a81c[_0xf20f('0xbe')](_0x466551[_0xf20f('0x5c')][_0xf20f('0x69')],_[_0xf20f('0x72')](_0x466551[_0xf20f('0x5c')],[_0xf20f('0x69'),'id'])||{})['spread'](function(_0x5a9a45){for(var _0x57958b=0x0;_0x57958b<_0x466551[_0xf20f('0x5c')]['ids'][_0xf20f('0x4c')];_0x57958b+=0x1){socket[_0xf20f('0xbf')]('userFaxAccount:save',{'UserId':Number(_0x466551[_0xf20f('0x5c')][_0xf20f('0x69')][_0x57958b]),'FaxAccountId':Number(_0x466551[_0xf20f('0x5a')]['id'])});}return _0x5a9a45;});}})[_0xf20f('0x39')](respondWithResult(_0x24b1e8,null))[_0xf20f('0x2c')](handleError(_0x24b1e8,null));};exports[_0xf20f('0xc0')]=function(_0x2d37bf,_0x36b7ad,_0x376fce){return db['FaxAccount'][_0xf20f('0x60')]({'where':{'id':_0x2d37bf[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x36b7ad,null))[_0xf20f('0x39')](function(_0x49ac84){if(_0x49ac84){return _0x49ac84['removeAgents'](_0x2d37bf['query'][_0xf20f('0x69')])[_0xf20f('0x39')](function(){if(_['isArray'](_0x2d37bf[_0xf20f('0x46')]['ids'])){for(var _0x3b319a=0x0;_0x3b319a<_0x2d37bf[_0xf20f('0x46')][_0xf20f('0x69')][_0xf20f('0x4c')];_0x3b319a+=0x1){socket[_0xf20f('0xbf')](_0xf20f('0xc1'),{'UserId':Number(_0x2d37bf['query']['ids'][_0x3b319a]),'FaxAccountId':Number(_0x2d37bf['params']['id'])});}}else{socket['emit'](_0xf20f('0xc1'),{'UserId':Number(_0x2d37bf['query'][_0xf20f('0x69')]),'FaxAccountId':Number(_0x2d37bf[_0xf20f('0x5a')]['id'])});}});}})[_0xf20f('0x39')](respondWithStatusCode(_0x36b7ad,null))[_0xf20f('0x2c')](handleError(_0x36b7ad,null));};exports[_0xf20f('0xc2')]=function(_0x30ba16,_0x549aef,_0x1f7f4c){var _0x12a007={};var _0x53dd50={};var _0x4279e;var _0x193482;return db['FaxAccount'][_0xf20f('0x6d')]({'where':{'id':_0x30ba16[_0xf20f('0x5a')]['id']}})[_0xf20f('0x39')](handleEntityNotFound(_0x549aef,null))[_0xf20f('0x39')](function(_0x67b464){if(_0x67b464){_0x4279e=_0x67b464;_0x53dd50[_0xf20f('0x45')]=_['keys'](db[_0xf20f('0x75')][_0xf20f('0x6e')]);_0x53dd50[_0xf20f('0x46')]=_[_0xf20f('0x47')](_0x30ba16['query']);_0x53dd50[_0xf20f('0x48')]=_['intersection'](_0x53dd50[_0xf20f('0x45')],_0x53dd50[_0xf20f('0x46')]);_0x12a007[_0xf20f('0x4a')]=_[_0xf20f('0x49')](_0x53dd50[_0xf20f('0x45')],qs[_0xf20f('0x4b')](_0x30ba16['query'][_0xf20f('0x4b')]));_0x12a007[_0xf20f('0x4a')]=_0x12a007[_0xf20f('0x4a')][_0xf20f('0x4c')]?_0x12a007['attributes']:_0x53dd50[_0xf20f('0x45')];_0x12a007[_0xf20f('0x4f')]=qs['sort'](_0x30ba16[_0xf20f('0x46')][_0xf20f('0x50')]);_0x12a007['where']=qs[_0xf20f('0x48')](_[_0xf20f('0x51')](_0x30ba16[_0xf20f('0x46')],_0x53dd50[_0xf20f('0x48')]));if(_0x30ba16[_0xf20f('0x46')][_0xf20f('0x52')]){_0x12a007[_0xf20f('0x54')]=_['merge'](_0x12a007['where'],{'$or':_[_0xf20f('0x40')](_0x12a007[_0xf20f('0x4a')],function(_0x527d28){var _0x4c71eb={};_0x4c71eb[_0x527d28]={'$like':'%'+_0x30ba16[_0xf20f('0x46')][_0xf20f('0x52')]+'%'};return _0x4c71eb;})});}_0x12a007=_[_0xf20f('0x53')]({},_0x12a007,_0x30ba16[_0xf20f('0x67')]);return _0x4279e[_0xf20f('0xc2')](_0x12a007);}})['then'](function(_0x123959){if(_0x123959){_0x193482=_0x123959[_0xf20f('0x4c')];if(!_0x30ba16[_0xf20f('0x46')][_0xf20f('0x4d')]('nolimit')){_0x12a007[_0xf20f('0x32')]=qs[_0xf20f('0x32')](_0x30ba16[_0xf20f('0x46')][_0xf20f('0x32')]);_0x12a007['offset']=qs['offset'](_0x30ba16['query'][_0xf20f('0x30')]);}return _0x4279e['getAgents'](_0x12a007);}})[_0xf20f('0x39')](function(_0x2dfebd){if(_0x2dfebd){return _0x2dfebd?{'count':_0x193482,'rows':_0x2dfebd}:null;}})[_0xf20f('0x39')](respondWithResult(_0x549aef,null))[_0xf20f('0x2c')](handleError(_0x549aef,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9013b13..a44389c 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 _0x1c5e=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3aacbb,_0x2e334f){var _0x199e55=function(_0x55e3f2){while(--_0x55e3f2){_0x3aacbb['push'](_0x3aacbb['shift']());}};_0x199e55(++_0x2e334f);}(_0x1c5e,0x15d));var _0xe1c5=function(_0x310a23,_0x49f6b5){_0x310a23=_0x310a23-0x0;var _0x50fe57=_0x1c5e[_0x310a23];return _0x50fe57;};'use strict';var EventEmitter=require(_0xe1c5('0x0'));var FaxAccount=require(_0xe1c5('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe1c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe1c5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x553163){return function(_0x4f319a,_0x40a5f0,_0xdcad13){FaxAccountEvents['emit'](_0x553163+':'+_0x4f319a['id'],_0x4f319a);FaxAccountEvents[_0xe1c5('0x4')](_0x553163,_0x4f319a);_0xdcad13(null);};}for(var e in events){if(events[_0xe1c5('0x5')](e)){var event=events[e];FaxAccount[_0xe1c5('0x6')](e,emitEvent(event));}}module[_0xe1c5('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x1f81=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0xffdec4,_0x322bec){var _0x479138=function(_0x49b019){while(--_0x49b019){_0xffdec4['push'](_0xffdec4['shift']());}};_0x479138(++_0x322bec);}(_0x1f81,0xab));var _0x11f8=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x1f81[_0x3b0912];return _0xa8f339;};'use strict';var EventEmitter=require(_0x11f8('0x0'));var FaxAccount=require(_0x11f8('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x11f8('0x2')](0x0);var events={'afterCreate':_0x11f8('0x3'),'afterUpdate':'update','afterDestroy':_0x11f8('0x4')};function emitEvent(_0x2b6912){return function(_0xa169ce,_0x454d02,_0x1c6cc7){FaxAccountEvents[_0x11f8('0x5')](_0x2b6912+':'+_0xa169ce['id'],_0xa169ce);FaxAccountEvents[_0x11f8('0x5')](_0x2b6912,_0xa169ce);_0x1c6cc7(null);};}for(var e in events){if(events[_0x11f8('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x11f8('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index a8e9cd4..afdbb28 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 _0x9332=['define','FaxAccount','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2b86eb,_0x2f8516){var _0x4d4f06=function(_0x5f2965){while(--_0x5f2965){_0x2b86eb['push'](_0x2b86eb['shift']());}};_0x4d4f06(++_0x2f8516);}(_0x9332,0x86));var _0x2933=function(_0x114adc,_0x1b1c55){_0x114adc=_0x114adc-0x0;var _0x19199a=_0x9332[_0x114adc];return _0x19199a;};'use strict';var _=require(_0x2933('0x0'));var util=require(_0x2933('0x1'));var logger=require(_0x2933('0x2'))(_0x2933('0x3'));var moment=require(_0x2933('0x4'));var BPromise=require(_0x2933('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2933('0x6'));var rimraf=require(_0x2933('0x7'));var config=require(_0x2933('0x8'));var attributes=require('./faxAccount.attributes');module[_0x2933('0x9')]=function(_0x27af6e,_0x5b9803){return _0x27af6e[_0x2933('0xa')](_0x2933('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb60=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts'];(function(_0x25f7a4,_0xd3669b){var _0xce1383=function(_0x1182d9){while(--_0x1182d9){_0x25f7a4['push'](_0x25f7a4['shift']());}};_0xce1383(++_0xd3669b);}(_0xdb60,0x1ec));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0db6('0x0'))(_0x0db6('0x1'));var moment=require(_0x0db6('0x2'));var BPromise=require(_0x0db6('0x3'));var rp=require(_0x0db6('0x4'));var fs=require('fs');var path=require(_0x0db6('0x5'));var rimraf=require(_0x0db6('0x6'));var config=require(_0x0db6('0x7'));var attributes=require('./faxAccount.attributes');module[_0x0db6('0x8')]=function(_0x146bf7,_0x59ef92){return _0x146bf7[_0x0db6('0x9')](_0x0db6('0xa'),attributes,{'tableName':_0x0db6('0xb'),'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 2572b2c..c7eec51 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 _0x9007=['options','where','attributes','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','agent','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxAccount','findAll'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x9007,0x9c));var _0x7900=function(_0x5da63e,_0x4d3503){_0x5da63e=_0x5da63e-0x0;var _0x442aca=_0x9007[_0x5da63e];return _0x442aca;};'use strict';var _=require(_0x7900('0x0'));var util=require('util');var moment=require(_0x7900('0x1'));var BPromise=require('bluebird');var rs=require(_0x7900('0x2'));var fs=require('fs');var Redis=require(_0x7900('0x3'));var db=require(_0x7900('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7900('0x5'));var config=require(_0x7900('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7900('0x7')]({'port':0x232c});config[_0x7900('0x8')]=_[_0x7900('0x9')](config[_0x7900('0x8')],{'host':_0x7900('0xa'),'port':0x18eb});var socket=require(_0x7900('0xb'))(new Redis(config[_0x7900('0x8')]));require(_0x7900('0xc'))[_0x7900('0xd')](socket);function respondWithRpcPromise(_0x282bb4,_0x41e2d8,_0x4b6778){return new BPromise(function(_0x4ba254,_0xcb9f75){return client[_0x7900('0xe')](_0x282bb4,_0x4b6778)[_0x7900('0xf')](function(_0x15dd71){logger[_0x7900('0x10')](_0x7900('0x11'),_0x41e2d8,'request\x20sent');logger[_0x7900('0x12')](_0x7900('0x13'),_0x41e2d8,_0x7900('0x14'),JSON['stringify'](_0x15dd71));if(_0x15dd71[_0x7900('0x15')]){if(_0x15dd71['error'][_0x7900('0x16')]===0x1f4){logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);return _0xcb9f75(_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);}logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);return _0x4ba254(_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);}else{logger['info'](_0x7900('0x11'),_0x41e2d8,_0x7900('0x14'));_0x4ba254(_0x15dd71[_0x7900('0x18')]['message']);}})[_0x7900('0x19')](function(_0xa62cde){logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0xa62cde);_0xcb9f75(_0xa62cde);});});}exports[_0x7900('0x1a')]=function(_0x1094bf){var _0x293775=this;return new Promise(function(_0x1acd52,_0x2b241f){return db['FaxAccount'][_0x7900('0x1b')]({'raw':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1094bf['options']?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1d')]||null:null,'attributes':_0x1094bf['options']?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1e')]||null:null,'limit':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')]['limit']||null:null,'include':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1f')]?_[_0x7900('0x20')](_0x1094bf[_0x7900('0x1c')][_0x7900('0x1f')],function(_0x45af21){return{'model':db[_0x45af21[_0x7900('0x21')]],'as':_0x45af21['as'],'attributes':_0x45af21[_0x7900('0x1e')],'include':_0x45af21[_0x7900('0x1f')]?_[_0x7900('0x20')](_0x45af21['include'],function(_0x31f756){return{'model':db[_0x31f756[_0x7900('0x21')]],'as':_0x31f756['as'],'attributes':_0x31f756[_0x7900('0x1e')],'include':_0x31f756['include']?_['map'](_0x31f756['include'],function(_0x2fde16){return{'model':db[_0x2fde16['model']],'as':_0x2fde16['as'],'attributes':_0x2fde16[_0x7900('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7900('0xf')](function(_0x93b92d){logger[_0x7900('0x10')]('GetFaxAccount',_0x1094bf);logger[_0x7900('0x12')]('GetFaxAccount',_0x1094bf,JSON[_0x7900('0x22')](_0x93b92d));_0x1acd52(_0x93b92d);})[_0x7900('0x19')](function(_0xbcb92){logger['error'](_0x7900('0x1a'),_0xbcb92[_0x7900('0x17')],_0x1094bf);_0x2b241f(_0x293775[_0x7900('0x15')](0x1f4,_0xbcb92[_0x7900('0x17')]));});});};exports[_0x7900('0x23')]=function(_0x2c8c88,_0x38a90e,_0x19b438){var _0x461b34=this;return new Promise(function(_0x395cab,_0x2b6d84){var _0x369ba7={'body':_0x2c8c88[_0x7900('0x24')],'channel':_0x7900('0x25')};var _0x3aed9f=[];var _0x304bff=[];var _0x259165={};return db['CmContact'][_0x7900('0x26')]()[_0x7900('0xf')](function(_0x4a2ace){if(!_0x4a2ace){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x29'));}_0x3aed9f=_[_0x7900('0x2a')](_[_0x7900('0x2b')](_0x4a2ace),[_0x7900('0x2c'),'updatedAt']);_0x304bff=_['difference'](_[_0x7900('0x2b')](_0x4a2ace),[_0x7900('0x2c'),_0x7900('0x2d'),_0x7900('0x2e'),_0x7900('0x2f')]);if(_0x2c8c88[_0x7900('0x24')]['id']){delete _0x2c8c88['body']['id'];}if(_[_0x7900('0x30')](_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')])){throw new db[(_0x7900('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x7900('0x30')](_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')])||_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')]===''){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x32'));}if(_['isNil'](_0x2c8c88[_0x7900('0x24')]['mapKey'])){throw new db['Sequelize'][(_0x7900('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x304bff);}if(!_[_0x7900('0x33')](_0x304bff,_0x2c8c88['body'][_0x7900('0x34')])){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x35')+_0x304bff);}_0x259165[_0x2c8c88[_0x7900('0x24')][_0x7900('0x34')]]=_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')];})[_0x7900('0xf')](function(){return db[_0x7900('0x36')][_0x7900('0x37')]({'where':{'id':_0x2c8c88[_0x7900('0x38')]['id']},'include':[{'model':db[_0x7900('0x39')],'as':_0x7900('0x3a'),'include':[{'model':db['CmContact'],'as':_0x7900('0x3b'),'where':_0x259165,'limit':0x1,'order':[['updatedAt',_0x7900('0x3c')]]}]},{'model':db[_0x7900('0x3d')],'as':_0x7900('0x3e')}]});})[_0x7900('0xf')](function(_0x1b193d){if(_0x1b193d&&_0x1b193d['List']){var _0x2556ae=_0x1b193d['get']({'plain':!![]});_0x369ba7['account']=_0x2556ae;_0x369ba7[_0x7900('0x3f')]=_0x2556ae[_0x7900('0x3e')];_0x369ba7[_0x7900('0x40')]=_0x2556ae[_0x7900('0x3a')];_0x369ba7[_0x7900('0x3f')]=_[_0x7900('0x41')](_0x369ba7[_0x7900('0x3f')],[_0x7900('0x42')],[_0x7900('0x43')]);if(_0x369ba7[_0x7900('0x38')]['Applications']){delete _0x369ba7['account'][_0x7900('0x3e')];}if(_0x369ba7[_0x7900('0x38')][_0x7900('0x3a')]&&_0x369ba7[_0x7900('0x38')][_0x7900('0x3a')][_0x7900('0x3b')][_0x7900('0x44')]){return _0x369ba7[_0x7900('0x38')][_0x7900('0x3a')][_0x7900('0x3b')][0x0];}var _0x4a341f=_[_0x7900('0x9')](_0x2c8c88['body'],{'firstName':_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')],'ListId':_0x2556ae['ListId']});_0x4a341f[_0x2c8c88[_0x7900('0x24')][_0x7900('0x34')]]=_0x2c8c88['body'][_0x7900('0x31')];return db[_0x7900('0x45')][_0x7900('0x46')](_0x4a341f,{'fields':_0x3aed9f,'raw':!![]});}})[_0x7900('0xf')](function(_0x1572f2){_0x369ba7[_0x7900('0x47')]=_0x1572f2;if(_0x1572f2){var _0x3e36f0={'ContactId':_0x1572f2['id'],'FaxAccountId':_0x2c8c88[_0x7900('0x38')]['id'],'fax':_0x1572f2[_0x7900('0x25')]};return db[_0x7900('0x48')][_0x7900('0x37')]({'where':{'ContactId':_0x1572f2['id'],'closed':![],'FaxAccountId':_0x2c8c88[_0x7900('0x38')]['id']}})[_0x7900('0xf')](function(_0x558c3b){if(_0x558c3b){return[_0x558c3b,![]];}return db[_0x7900('0x48')]['create'](_0x3e36f0)[_0x7900('0xf')](function(_0x256cc1){return[_0x256cc1,!![]];});});}else{throw new Error(_0x7900('0x49'));}})[_0x7900('0x4a')](function(_0x53bdfe,_0x12b534){var _0x1faf8f=_0x53bdfe[_0x7900('0x4b')]({'plain':!![]});if(_0x12b534){if(_0x369ba7[_0x7900('0x38')][_0x7900('0x4c')]){_0x369ba7[_0x7900('0x3f')][_0x7900('0x4d')]({'id':0x0,'priority':_0x369ba7['applications']['length']+0x1,'app':_0x7900('0x4e'),'appdata':_0x7900('0x4f'),'interval':_0x7900('0x50')});}_0x1faf8f[_0x7900('0x51')]=!![];}else{_0x1faf8f[_0x7900('0x51')]=![];}_0x369ba7['interaction']=_0x1faf8f;return db[_0x7900('0x52')]['create']({'body':_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')],'FaxAccountId':_0x2c8c88['account']['id'],'FaxInteractionId':_0x53bdfe['id'],'direction':'in','ContactId':_0x53bdfe[_0x7900('0x53')],'AttachmentId':_0x2c8c88[_0x7900('0x24')][_0x7900('0x54')]});})[_0x7900('0xf')](function(_0x247280){_0x369ba7[_0x7900('0x17')]=_0x247280;if(_0x369ba7[_0x7900('0x55')][_0x7900('0x56')]){return db[_0x7900('0x57')][_0x7900('0x37')]({'attributes':['id',_0x7900('0x58')],'where':{'id':_0x369ba7['interaction']['UserId']}})[_0x7900('0xf')](function(_0x234421){if(_0x234421){_0x369ba7[_0x7900('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7900('0x59'),'appdata':_0x234421[_0x7900('0x58')]+','+(_0x369ba7[_0x7900('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x7900('0x50')});}return respondWithRpcPromise('Start',_0x7900('0x5a'),_0x369ba7);});}return respondWithRpcPromise(_0x7900('0x5b'),'startRouting',_0x369ba7);})[_0x7900('0xf')](function(_0x18a5f7){_0x395cab(_0x18a5f7);})[_0x7900('0x19')](function(_0x59da59){_0x2b6d84(_0x461b34['error'](0x1f4,_0x59da59['message']));});});}; \ No newline at end of file +var _0x9920=['unmanaged','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxAccount','options','raw','where','map','include','model','attributes','info','GetFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','length','contact','FaxInteraction','create','Contact\x20not\x20found','autoclose','push'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9920,0x68));var _0x0992=function(_0x52469b,_0x4531d3){_0x52469b=_0x52469b-0x0;var _0x573d01=_0x9920[_0x52469b];return _0x573d01;};'use strict';var _=require(_0x0992('0x0'));var util=require('util');var moment=require(_0x0992('0x1'));var BPromise=require('bluebird');var rs=require(_0x0992('0x2'));var fs=require('fs');var Redis=require(_0x0992('0x3'));var db=require(_0x0992('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0992('0x5'))(_0x0992('0x6'));var config=require(_0x0992('0x7'));var jayson=require(_0x0992('0x8'));var client=jayson['client'][_0x0992('0x9')]({'port':0x232c});config['redis']=_[_0x0992('0xa')](config[_0x0992('0xb')],{'host':_0x0992('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0992('0xb')]));require(_0x0992('0xd'))[_0x0992('0xe')](socket);function respondWithRpcPromise(_0x427bb3,_0x3baed2,_0x26a0ea){return new BPromise(function(_0x1a0d86,_0x4e1d93){return client[_0x0992('0xf')](_0x427bb3,_0x26a0ea)[_0x0992('0x10')](function(_0x572dfb){logger['info'](_0x0992('0x11'),_0x3baed2,_0x0992('0x12'));logger[_0x0992('0x13')](_0x0992('0x14'),_0x3baed2,_0x0992('0x12'),JSON[_0x0992('0x15')](_0x572dfb));if(_0x572dfb[_0x0992('0x16')]){if(_0x572dfb[_0x0992('0x16')]['code']===0x1f4){logger['error'](_0x0992('0x11'),_0x3baed2,_0x572dfb[_0x0992('0x16')][_0x0992('0x17')]);return _0x4e1d93(_0x572dfb[_0x0992('0x16')][_0x0992('0x17')]);}logger[_0x0992('0x16')](_0x0992('0x11'),_0x3baed2,_0x572dfb[_0x0992('0x16')][_0x0992('0x17')]);return _0x1a0d86(_0x572dfb[_0x0992('0x16')][_0x0992('0x17')]);}else{logger['info'](_0x0992('0x11'),_0x3baed2,'request\x20sent');_0x1a0d86(_0x572dfb[_0x0992('0x18')][_0x0992('0x17')]);}})[_0x0992('0x19')](function(_0x26bd5f){logger[_0x0992('0x16')]('FaxAccount,\x20%s,\x20%s',_0x3baed2,_0x26bd5f);_0x4e1d93(_0x26bd5f);});});}exports['GetFaxAccount']=function(_0xe3a9c4){var _0x2a05ec=this;return new Promise(function(_0x56d176,_0x314d95){return db[_0x0992('0x1a')]['findAll']({'raw':_0xe3a9c4[_0x0992('0x1b')]?_0xe3a9c4[_0x0992('0x1b')][_0x0992('0x1c')]===undefined?!![]:![]:!![],'where':_0xe3a9c4[_0x0992('0x1b')]?_0xe3a9c4[_0x0992('0x1b')][_0x0992('0x1d')]||null:null,'attributes':_0xe3a9c4['options']?_0xe3a9c4[_0x0992('0x1b')]['attributes']||null:null,'limit':_0xe3a9c4[_0x0992('0x1b')]?_0xe3a9c4[_0x0992('0x1b')]['limit']||null:null,'include':_0xe3a9c4[_0x0992('0x1b')]?_0xe3a9c4[_0x0992('0x1b')]['include']?_[_0x0992('0x1e')](_0xe3a9c4['options'][_0x0992('0x1f')],function(_0x2f2725){return{'model':db[_0x2f2725[_0x0992('0x20')]],'as':_0x2f2725['as'],'attributes':_0x2f2725[_0x0992('0x21')],'include':_0x2f2725[_0x0992('0x1f')]?_['map'](_0x2f2725[_0x0992('0x1f')],function(_0x51ec32){return{'model':db[_0x51ec32[_0x0992('0x20')]],'as':_0x51ec32['as'],'attributes':_0x51ec32[_0x0992('0x21')],'include':_0x51ec32[_0x0992('0x1f')]?_[_0x0992('0x1e')](_0x51ec32[_0x0992('0x1f')],function(_0x994134){return{'model':db[_0x994134[_0x0992('0x20')]],'as':_0x994134['as'],'attributes':_0x994134['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x346d6d){logger[_0x0992('0x22')](_0x0992('0x23'),_0xe3a9c4);logger['debug'](_0x0992('0x23'),_0xe3a9c4,JSON[_0x0992('0x15')](_0x346d6d));_0x56d176(_0x346d6d);})[_0x0992('0x19')](function(_0x49e720){logger[_0x0992('0x16')](_0x0992('0x23'),_0x49e720[_0x0992('0x17')],_0xe3a9c4);_0x314d95(_0x2a05ec[_0x0992('0x16')](0x1f4,_0x49e720[_0x0992('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x59526f,_0x40d4a9,_0xccf5e5){var _0x3be06b=this;return new Promise(function(_0x5e5e46,_0x10b00e){var _0x3a8204={'body':_0x59526f[_0x0992('0x24')],'channel':_0x0992('0x25')};var _0x2c2d72=[];var _0x4c3f4b=[];var _0x505a7b={};return db[_0x0992('0x26')][_0x0992('0x27')]()[_0x0992('0x10')](function(_0x48032f){if(!_0x48032f){throw new db[(_0x0992('0x28'))][(_0x0992('0x29'))](_0x0992('0x2a'));}_0x2c2d72=_['difference'](_[_0x0992('0x2b')](_0x48032f),[_0x0992('0x2c'),'updatedAt']);_0x4c3f4b=_[_0x0992('0x2d')](_[_0x0992('0x2b')](_0x48032f),[_0x0992('0x2c'),_0x0992('0x2e'),_0x0992('0x2f'),_0x0992('0x30')]);if(_0x59526f[_0x0992('0x24')]['id']){delete _0x59526f[_0x0992('0x24')]['id'];}if(_[_0x0992('0x31')](_0x59526f[_0x0992('0x24')][_0x0992('0x32')])){throw new db[(_0x0992('0x28'))][(_0x0992('0x29'))](_0x0992('0x33'));}if(_['isNil'](_0x59526f[_0x0992('0x24')]['body'])||_0x59526f['body'][_0x0992('0x24')]===''){throw new db[(_0x0992('0x28'))][(_0x0992('0x29'))](_0x0992('0x34'));}if(_[_0x0992('0x31')](_0x59526f[_0x0992('0x24')][_0x0992('0x35')])){throw new db[(_0x0992('0x28'))]['ValidationError'](_0x0992('0x36')+_0x4c3f4b);}if(!_[_0x0992('0x37')](_0x4c3f4b,_0x59526f[_0x0992('0x24')][_0x0992('0x35')])){throw new db[(_0x0992('0x28'))][(_0x0992('0x29'))](_0x0992('0x38')+_0x4c3f4b);}_0x505a7b[_0x59526f[_0x0992('0x24')][_0x0992('0x35')]]=_0x59526f[_0x0992('0x24')]['from'];})[_0x0992('0x10')](function(){return db['FaxAccount'][_0x0992('0x39')]({'where':{'id':_0x59526f[_0x0992('0x3a')]['id']},'include':[{'model':db[_0x0992('0x3b')],'as':_0x0992('0x3c'),'include':[{'model':db[_0x0992('0x26')],'as':_0x0992('0x3d'),'where':_0x505a7b,'limit':0x1,'order':[[_0x0992('0x2e'),_0x0992('0x3e')]]}]},{'model':db[_0x0992('0x3f')],'as':'Applications'}]});})[_0x0992('0x10')](function(_0x1f9257){if(_0x1f9257&&_0x1f9257[_0x0992('0x3c')]){var _0x4a9e8c=_0x1f9257[_0x0992('0x40')]({'plain':!![]});_0x3a8204[_0x0992('0x3a')]=_0x4a9e8c;_0x3a8204[_0x0992('0x41')]=_0x4a9e8c[_0x0992('0x42')];_0x3a8204[_0x0992('0x43')]=_0x4a9e8c['List'];_0x3a8204[_0x0992('0x41')]=_[_0x0992('0x44')](_0x3a8204[_0x0992('0x41')],[_0x0992('0x45')],[_0x0992('0x46')]);if(_0x3a8204[_0x0992('0x3a')][_0x0992('0x42')]){delete _0x3a8204[_0x0992('0x3a')][_0x0992('0x42')];}if(_0x3a8204['account']['List']&&_0x3a8204[_0x0992('0x3a')][_0x0992('0x3c')][_0x0992('0x3d')][_0x0992('0x47')]){return _0x3a8204[_0x0992('0x3a')][_0x0992('0x3c')][_0x0992('0x3d')][0x0];}var _0x191024=_[_0x0992('0xa')](_0x59526f[_0x0992('0x24')],{'firstName':_0x59526f['body'][_0x0992('0x32')],'ListId':_0x4a9e8c[_0x0992('0x30')]});_0x191024[_0x59526f[_0x0992('0x24')][_0x0992('0x35')]]=_0x59526f[_0x0992('0x24')][_0x0992('0x32')];return db[_0x0992('0x26')]['create'](_0x191024,{'fields':_0x2c2d72,'raw':!![]});}})[_0x0992('0x10')](function(_0x23825f){_0x3a8204[_0x0992('0x48')]=_0x23825f;if(_0x23825f){var _0x414f8d={'ContactId':_0x23825f['id'],'FaxAccountId':_0x59526f[_0x0992('0x3a')]['id'],'fax':_0x23825f[_0x0992('0x25')]};return db['FaxInteraction'][_0x0992('0x39')]({'where':{'ContactId':_0x23825f['id'],'closed':![],'FaxAccountId':_0x59526f['account']['id']}})[_0x0992('0x10')](function(_0x2cbcd0){if(_0x2cbcd0){return[_0x2cbcd0,![]];}return db[_0x0992('0x49')][_0x0992('0x4a')](_0x414f8d)[_0x0992('0x10')](function(_0x4737dc){return[_0x4737dc,!![]];});});}else{throw new Error(_0x0992('0x4b'));}})['spread'](function(_0x55c9ef,_0x5250bf){var _0x493b6a=_0x55c9ef[_0x0992('0x40')]({'plain':!![]});if(_0x5250bf){if(_0x3a8204[_0x0992('0x3a')][_0x0992('0x4c')]){_0x3a8204[_0x0992('0x41')][_0x0992('0x4d')]({'id':0x0,'priority':_0x3a8204[_0x0992('0x41')][_0x0992('0x47')]+0x1,'app':'close','appdata':_0x0992('0x4e'),'interval':_0x0992('0x4f')});}_0x493b6a['created']=!![];}else{_0x493b6a['created']=![];}_0x3a8204[_0x0992('0x50')]=_0x493b6a;return db[_0x0992('0x51')][_0x0992('0x4a')]({'body':_0x59526f[_0x0992('0x24')]['body'],'FaxAccountId':_0x59526f[_0x0992('0x3a')]['id'],'FaxInteractionId':_0x55c9ef['id'],'direction':'in','ContactId':_0x55c9ef[_0x0992('0x52')],'AttachmentId':_0x59526f[_0x0992('0x24')][_0x0992('0x53')]});})[_0x0992('0x10')](function(_0x429742){_0x3a8204[_0x0992('0x17')]=_0x429742;if(_0x3a8204[_0x0992('0x50')]['UserId']){return db[_0x0992('0x54')]['find']({'attributes':['id',_0x0992('0x55')],'where':{'id':_0x3a8204[_0x0992('0x50')][_0x0992('0x56')]}})[_0x0992('0x10')](function(_0x45e9d0){if(_0x45e9d0){_0x3a8204['applications'][_0x0992('0x57')]({'id':0x0,'priority':0x0,'app':_0x0992('0x58'),'appdata':_0x45e9d0['name']+','+(_0x3a8204[_0x0992('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0x0992('0x4f')});}return respondWithRpcPromise(_0x0992('0x59'),_0x0992('0x5a'),_0x3a8204);});}return respondWithRpcPromise(_0x0992('0x59'),'startRouting',_0x3a8204);})[_0x0992('0x10')](function(_0x1c63e6){_0x5e5e46(_0x1c63e6);})[_0x0992('0x19')](function(_0x790fc4){_0x10b00e(_0x3be06b[_0x0992('0x16')](0x1f4,_0x790fc4[_0x0992('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index cb1ac1b..59ce4fe 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 _0x7501=['./faxAccount.events','save','remove','update','emit','length','faxAccount:'];(function(_0x3024be,_0x581862){var _0x3c26b3=function(_0x5cf1d1){while(--_0x5cf1d1){_0x3024be['push'](_0x3024be['shift']());}};_0x3c26b3(++_0x581862);}(_0x7501,0x10a));var _0x1750=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7501[_0x1762b4];return _0x29beda;};'use strict';var FaxAccountEvents=require(_0x1750('0x0'));var events=[_0x1750('0x1'),_0x1750('0x2'),_0x1750('0x3')];function createListener(_0xa186db,_0x1665a7){return function(_0x4c04f8){_0x1665a7[_0x1750('0x4')](_0xa186db,_0x4c04f8);};}function removeListener(_0x32951f,_0x216136){return function(){FaxAccountEvents['removeListener'](_0x32951f,_0x216136);};}exports['register']=function(_0x316756){for(var _0x20312b=0x0,_0xce3df=events[_0x1750('0x5')];_0x20312b<_0xce3df;_0x20312b++){var _0x158e38=events[_0x20312b];var _0x999bc=createListener(_0x1750('0x6')+_0x158e38,_0x316756);FaxAccountEvents['on'](_0x158e38,_0x999bc);}}; \ No newline at end of file +var _0x5bb4=['remove','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5bb4,0x148));var _0x45bb=function(_0x5a137a,_0x99ecb9){_0x5a137a=_0x5a137a-0x0;var _0x2f2dfd=_0x5bb4[_0x5a137a];return _0x2f2dfd;};'use strict';var FaxAccountEvents=require(_0x45bb('0x0'));var events=[_0x45bb('0x1'),_0x45bb('0x2'),'update'];function createListener(_0x3da47d,_0x1f8fd9){return function(_0x19a0bf){_0x1f8fd9['emit'](_0x3da47d,_0x19a0bf);};}function removeListener(_0x1f598c,_0x32fde1){return function(){FaxAccountEvents['removeListener'](_0x1f598c,_0x32fde1);};}exports[_0x45bb('0x3')]=function(_0x2ea7ff){for(var _0xa6e4fc=0x0,_0x486223=events[_0x45bb('0x4')];_0xa6e4fc<_0x486223;_0xa6e4fc++){var _0x418009=events[_0xa6e4fc];var _0x4d45c5=createListener(_0x45bb('0x5')+_0x418009,_0x2ea7ff);FaxAccountEvents['on'](_0x418009,_0x4d45c5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2284c5e..6e1d6c2 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(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x9bb6f8,_0xddf652){var _0x12d1e2=function(_0x8ed46a){while(--_0x8ed46a){_0x9bb6f8['push'](_0x9bb6f8['shift']());}};_0x12d1e2(++_0xddf652);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 53f34b9..a6883ac 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 _0x7efa=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x73dcd,_0x482364){var _0x4949fa=function(_0x593f20){while(--_0x593f20){_0x73dcd['push'](_0x73dcd['shift']());}};_0x4949fa(++_0x482364);}(_0x7efa,0x130));var _0xa7ef=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x7efa[_0x1a0ef3];return _0x2b86da;};'use strict';var Sequelize=require('sequelize');module[_0xa7ef('0x0')]={'priority':{'type':Sequelize[_0xa7ef('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa7ef('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa7ef('0x3')]()},'description':{'type':Sequelize[_0xa7ef('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa7ef('0x4')}}; \ No newline at end of file +var _0x1419=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x3a86e9,_0x58e88e){var _0x1bf002=function(_0x371116){while(--_0x371116){_0x3a86e9['push'](_0x3a86e9['shift']());}};_0x1bf002(++_0x58e88e);}(_0x1419,0x1ed));var _0x9141=function(_0x42afd0,_0x34657a){_0x42afd0=_0x42afd0-0x0;var _0x1aa790=_0x1419[_0x42afd0];return _0x1aa790;};'use strict';var Sequelize=require(_0x9141('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9141('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9141('0x2')],'allowNull':![],'defaultValue':_0x9141('0x3')},'appdata':{'type':Sequelize[_0x9141('0x4')]()},'description':{'type':Sequelize[_0x9141('0x2')]},'interval':{'type':Sequelize[_0x9141('0x2')],'defaultValue':_0x9141('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 72c67ad..f0d2a84 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 _0xd927=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','moment','util','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/utils','../../config/environment'];(function(_0x497ea0,_0x655799){var _0x559272=function(_0x1dd1fd){while(--_0x1dd1fd){_0x497ea0['push'](_0x497ea0['shift']());}};_0x559272(++_0x655799);}(_0xd927,0x1eb));var _0x7d92=function(_0x900f11,_0x207f78){_0x900f11=_0x900f11-0x0;var _0x27d255=_0xd927[_0x900f11];return _0x27d255;};'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('request-promise');var moment=require(_0x7d92('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d92('0x1'));var path=require('path');var sox=require(_0x7d92('0x2'));var csv=require(_0x7d92('0x3'));var ejs=require(_0x7d92('0x4'));var fs=require('fs');var fs_extra=require(_0x7d92('0x5'));var _=require('lodash');var squel=require(_0x7d92('0x6'));var crypto=require(_0x7d92('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7d92('0x8'));var toCsv=require(_0x7d92('0x3'));var querystring=require(_0x7d92('0x9'));var Papa=require(_0x7d92('0xa'));var Redis=require(_0x7d92('0xb'));var authService=require(_0x7d92('0xc'));var qs=require(_0x7d92('0xd'));var as=require(_0x7d92('0xe'));var hardwareService=require(_0x7d92('0xf'));var logger=require(_0x7d92('0x10'))(_0x7d92('0x11'));var utils=require(_0x7d92('0x12'));var config=require(_0x7d92('0x13'));var licenseUtil=require(_0x7d92('0x14'));var db=require(_0x7d92('0x15'))['db'];function respondWithStatusCode(_0x3ee2ab,_0x7a92f0){_0x7a92f0=_0x7a92f0||0xcc;return function(_0x506394){if(_0x506394){return _0x3ee2ab[_0x7d92('0x16')](_0x7a92f0);}return _0x3ee2ab['status'](_0x7a92f0)[_0x7d92('0x17')]();};}function respondWithResult(_0x251851,_0x4be42f){_0x4be42f=_0x4be42f||0xc8;return function(_0x11eb69){if(_0x11eb69){return _0x251851[_0x7d92('0x18')](_0x4be42f)['json'](_0x11eb69);}};}function respondWithFilteredResult(_0x4c4933,_0x737d22){return function(_0x44f5b3){if(_0x44f5b3){var _0x5f26b6=typeof _0x737d22[_0x7d92('0x19')]==='undefined'&&typeof _0x737d22[_0x7d92('0x1a')]===_0x7d92('0x1b');var _0x28acb3=_0x44f5b3[_0x7d92('0x1c')];var _0x13f16f=_0x5f26b6?0x0:_0x737d22['offset'];var _0x5d90a5=_0x5f26b6?_0x44f5b3[_0x7d92('0x1c')]:_0x737d22[_0x7d92('0x19')]+_0x737d22[_0x7d92('0x1a')];var _0x2f995a;if(_0x5d90a5>=_0x28acb3){_0x5d90a5=_0x28acb3;_0x2f995a=0xc8;}else{_0x2f995a=0xce;}_0x4c4933[_0x7d92('0x18')](_0x2f995a);return _0x4c4933[_0x7d92('0x1d')](_0x7d92('0x1e'),_0x13f16f+'-'+_0x5d90a5+'/'+_0x28acb3)[_0x7d92('0x1f')](_0x44f5b3);}return null;};}function patchUpdates(_0x1dfc4b){return function(_0x13a2b9){try{jsonpatch[_0x7d92('0x20')](_0x13a2b9,_0x1dfc4b,!![]);}catch(_0x3dfb0d){return BPromise['reject'](_0x3dfb0d);}return _0x13a2b9[_0x7d92('0x21')]();};}function saveUpdates(_0x538e1d,_0x22c4e9){return function(_0x1b90ac){if(_0x1b90ac){return _0x1b90ac[_0x7d92('0x22')](_0x538e1d)[_0x7d92('0x23')](function(_0x3b7478){return _0x3b7478;});}return null;};}function removeEntity(_0x95df00,_0x358c52){return function(_0x3bd62d){if(_0x3bd62d){return _0x3bd62d[_0x7d92('0x24')]()[_0x7d92('0x23')](function(){_0x95df00[_0x7d92('0x18')](0xcc)[_0x7d92('0x17')]();});}};}function handleEntityNotFound(_0x1cc803,_0x4edb40){return function(_0x4c2e90){if(!_0x4c2e90){_0x1cc803[_0x7d92('0x16')](0x194);}return _0x4c2e90;};}function handleError(_0xe70e5e,_0xfe50b3){_0xfe50b3=_0xfe50b3||0x1f4;return function(_0x4fb032){logger[_0x7d92('0x25')](_0x4fb032[_0x7d92('0x26')]);if(_0x4fb032[_0x7d92('0x27')]){delete _0x4fb032[_0x7d92('0x27')];}_0xe70e5e['status'](_0xfe50b3)[_0x7d92('0x28')](_0x4fb032);};}exports[_0x7d92('0x29')]=function(_0x6dbe45,_0x27befc){var _0x3396bb={},_0x3152de={},_0x533add={'count':0x0,'rows':[]};var _0x2e161a=_[_0x7d92('0x2a')](db[_0x7d92('0x2b')]['rawAttributes'],function(_0x525e36){return{'name':_0x525e36[_0x7d92('0x2c')],'type':_0x525e36[_0x7d92('0x2d')][_0x7d92('0x2e')]};});_0x3152de[_0x7d92('0x2f')]=_[_0x7d92('0x2a')](_0x2e161a,_0x7d92('0x27'));_0x3152de['query']=_[_0x7d92('0x30')](_0x6dbe45['query']);_0x3152de[_0x7d92('0x31')]=_[_0x7d92('0x32')](_0x3152de[_0x7d92('0x2f')],_0x3152de['query']);_0x3396bb['attributes']=_[_0x7d92('0x32')](_0x3152de['model'],qs[_0x7d92('0x33')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x33')]));_0x3396bb[_0x7d92('0x35')]=_0x3396bb[_0x7d92('0x35')][_0x7d92('0x36')]?_0x3396bb['attributes']:_0x3152de['model'];if(!_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x37')](_0x7d92('0x38'))){_0x3396bb[_0x7d92('0x1a')]=qs[_0x7d92('0x1a')](_0x6dbe45['query']['limit']);_0x3396bb['offset']=qs[_0x7d92('0x19')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x19')]);}_0x3396bb[_0x7d92('0x39')]=qs[_0x7d92('0x3a')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x3a')]);_0x3396bb[_0x7d92('0x3b')]=qs['filters'](_['pick'](_0x6dbe45[_0x7d92('0x34')],_0x3152de['filters']),_0x2e161a);if(_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x3c')]){_0x3396bb['where']=_['merge'](_0x3396bb[_0x7d92('0x3b')],{'$or':_[_0x7d92('0x2a')](_0x2e161a,function(_0x2bebc7){if(_0x2bebc7[_0x7d92('0x2d')]!==_0x7d92('0x3d')){var _0x3bf7af={};_0x3bf7af[_0x2bebc7[_0x7d92('0x27')]]={'$like':'%'+_0x6dbe45['query'][_0x7d92('0x3c')]+'%'};return _0x3bf7af;}})});}_0x3396bb=_[_0x7d92('0x3e')]({},_0x3396bb,_0x6dbe45[_0x7d92('0x3f')]);var _0x55e11c={'where':_0x3396bb[_0x7d92('0x3b')]};return db[_0x7d92('0x2b')]['count'](_0x55e11c)[_0x7d92('0x23')](function(_0xa5f227){_0x533add[_0x7d92('0x1c')]=_0xa5f227;if(_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x40')]){_0x3396bb[_0x7d92('0x41')]=[{'all':!![]}];}return db[_0x7d92('0x2b')][_0x7d92('0x42')](_0x3396bb);})[_0x7d92('0x23')](function(_0x27f329){_0x533add['rows']=_0x27f329;return _0x533add;})[_0x7d92('0x23')](respondWithFilteredResult(_0x27befc,_0x3396bb))[_0x7d92('0x43')](handleError(_0x27befc,null));};exports[_0x7d92('0x44')]=function(_0x49d556,_0x214282){var _0x4a5e12={'raw':!![],'where':{'id':_0x49d556[_0x7d92('0x45')]['id']}},_0x10e567={};_0x10e567[_0x7d92('0x2f')]=_['keys'](db[_0x7d92('0x2b')]['rawAttributes']);_0x10e567[_0x7d92('0x34')]=_[_0x7d92('0x30')](_0x49d556['query']);_0x10e567[_0x7d92('0x31')]=_[_0x7d92('0x32')](_0x10e567[_0x7d92('0x2f')],_0x10e567[_0x7d92('0x34')]);_0x4a5e12[_0x7d92('0x35')]=_['intersection'](_0x10e567[_0x7d92('0x2f')],qs[_0x7d92('0x33')](_0x49d556[_0x7d92('0x34')][_0x7d92('0x33')]));_0x4a5e12[_0x7d92('0x35')]=_0x4a5e12[_0x7d92('0x35')][_0x7d92('0x36')]?_0x4a5e12[_0x7d92('0x35')]:_0x10e567['model'];if(_0x49d556[_0x7d92('0x34')][_0x7d92('0x40')]){_0x4a5e12[_0x7d92('0x41')]=[{'all':!![]}];}_0x4a5e12=_[_0x7d92('0x3e')]({},_0x4a5e12,_0x49d556[_0x7d92('0x3f')]);return db[_0x7d92('0x2b')][_0x7d92('0x46')](_0x4a5e12)[_0x7d92('0x23')](handleEntityNotFound(_0x214282,null))[_0x7d92('0x23')](respondWithResult(_0x214282,null))['catch'](handleError(_0x214282,null));};exports[_0x7d92('0x47')]=function(_0x34110c,_0x218db9){return db[_0x7d92('0x2b')][_0x7d92('0x47')](_0x34110c[_0x7d92('0x48')],{})['then'](respondWithResult(_0x218db9,0xc9))[_0x7d92('0x43')](handleError(_0x218db9,null));};exports[_0x7d92('0x22')]=function(_0x23092d,_0x6752a9){if(_0x23092d['body']['id']){delete _0x23092d[_0x7d92('0x48')]['id'];}return db[_0x7d92('0x2b')][_0x7d92('0x46')]({'where':{'id':_0x23092d['params']['id']}})[_0x7d92('0x23')](handleEntityNotFound(_0x6752a9,null))['then'](saveUpdates(_0x23092d[_0x7d92('0x48')],null))['then'](respondWithResult(_0x6752a9,null))[_0x7d92('0x43')](handleError(_0x6752a9,null));};exports[_0x7d92('0x24')]=function(_0x40343b,_0xce854d){return db[_0x7d92('0x2b')][_0x7d92('0x46')]({'where':{'id':_0x40343b[_0x7d92('0x45')]['id']}})[_0x7d92('0x23')](handleEntityNotFound(_0xce854d,null))[_0x7d92('0x23')](removeEntity(_0xce854d,null))[_0x7d92('0x43')](handleError(_0xce854d,null));}; \ No newline at end of file +var _0x4cd8=['lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','error','stack','name','send','map','FaxApplication','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x935802,_0x35f410){var _0x1fce56=function(_0x410e73){while(--_0x410e73){_0x935802['push'](_0x935802['shift']());}};_0x1fce56(++_0x35f410);}(_0x4cd8,0x87));var _0x84cd=function(_0x3a6b78,_0x2d62be){_0x3a6b78=_0x3a6b78-0x0;var _0x4943d4=_0x4cd8[_0x3a6b78];return _0x4943d4;};'use strict';var emlformat=require(_0x84cd('0x0'));var rimraf=require(_0x84cd('0x1'));var zipdir=require(_0x84cd('0x2'));var jsonpatch=require(_0x84cd('0x3'));var rp=require(_0x84cd('0x4'));var moment=require('moment');var BPromise=require(_0x84cd('0x5'));var Mustache=require(_0x84cd('0x6'));var util=require(_0x84cd('0x7'));var path=require(_0x84cd('0x8'));var sox=require(_0x84cd('0x9'));var csv=require(_0x84cd('0xa'));var ejs=require(_0x84cd('0xb'));var fs=require('fs');var fs_extra=require(_0x84cd('0xc'));var _=require(_0x84cd('0xd'));var squel=require('squel');var crypto=require(_0x84cd('0xe'));var jsforce=require(_0x84cd('0xf'));var deskjs=require(_0x84cd('0x10'));var toCsv=require(_0x84cd('0xa'));var querystring=require('querystring');var Papa=require(_0x84cd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84cd('0x12'));var as=require(_0x84cd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cd('0x14'))(_0x84cd('0x15'));var utils=require(_0x84cd('0x16'));var config=require(_0x84cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x84cd('0x18'))['db'];function respondWithStatusCode(_0x453f09,_0x13a2e1){_0x13a2e1=_0x13a2e1||0xcc;return function(_0x1f2270){if(_0x1f2270){return _0x453f09[_0x84cd('0x19')](_0x13a2e1);}return _0x453f09[_0x84cd('0x1a')](_0x13a2e1)[_0x84cd('0x1b')]();};}function respondWithResult(_0x3b4a1f,_0x23fc26){_0x23fc26=_0x23fc26||0xc8;return function(_0x43414f){if(_0x43414f){return _0x3b4a1f[_0x84cd('0x1a')](_0x23fc26)[_0x84cd('0x1c')](_0x43414f);}};}function respondWithFilteredResult(_0x273655,_0x34d37c){return function(_0x576eef){if(_0x576eef){var _0x968639=typeof _0x34d37c['offset']===_0x84cd('0x1d')&&typeof _0x34d37c[_0x84cd('0x1e')]===_0x84cd('0x1d');var _0xe58284=_0x576eef[_0x84cd('0x1f')];var _0x53ddff=_0x968639?0x0:_0x34d37c[_0x84cd('0x20')];var _0x2eaabd=_0x968639?_0x576eef['count']:_0x34d37c[_0x84cd('0x20')]+_0x34d37c['limit'];var _0x492490;if(_0x2eaabd>=_0xe58284){_0x2eaabd=_0xe58284;_0x492490=0xc8;}else{_0x492490=0xce;}_0x273655['status'](_0x492490);return _0x273655[_0x84cd('0x21')](_0x84cd('0x22'),_0x53ddff+'-'+_0x2eaabd+'/'+_0xe58284)['json'](_0x576eef);}return null;};}function patchUpdates(_0x4b34a9){return function(_0x3f0a92){try{jsonpatch['apply'](_0x3f0a92,_0x4b34a9,!![]);}catch(_0x47656f){return BPromise[_0x84cd('0x23')](_0x47656f);}return _0x3f0a92[_0x84cd('0x24')]();};}function saveUpdates(_0x3755ec,_0x21661d){return function(_0x5bb9d8){if(_0x5bb9d8){return _0x5bb9d8[_0x84cd('0x25')](_0x3755ec)['then'](function(_0x1fd9b7){return _0x1fd9b7;});}return null;};}function removeEntity(_0x19c663,_0x32667c){return function(_0x465599){if(_0x465599){return _0x465599[_0x84cd('0x26')]()['then'](function(){_0x19c663['status'](0xcc)[_0x84cd('0x1b')]();});}};}function handleEntityNotFound(_0x4ba112,_0x518a80){return function(_0x13bbaf){if(!_0x13bbaf){_0x4ba112[_0x84cd('0x19')](0x194);}return _0x13bbaf;};}function handleError(_0x376107,_0x2ba15b){_0x2ba15b=_0x2ba15b||0x1f4;return function(_0x427aa3){logger[_0x84cd('0x27')](_0x427aa3[_0x84cd('0x28')]);if(_0x427aa3[_0x84cd('0x29')]){delete _0x427aa3[_0x84cd('0x29')];}_0x376107[_0x84cd('0x1a')](_0x2ba15b)[_0x84cd('0x2a')](_0x427aa3);};}exports['index']=function(_0x5eee61,_0x2b775f){var _0x584e83={},_0x13b565={},_0x43f91={'count':0x0,'rows':[]};var _0x2b688c=_[_0x84cd('0x2b')](db[_0x84cd('0x2c')]['rawAttributes'],function(_0x464dcb){return{'name':_0x464dcb['fieldName'],'type':_0x464dcb[_0x84cd('0x2d')][_0x84cd('0x2e')]};});_0x13b565[_0x84cd('0x2f')]=_[_0x84cd('0x2b')](_0x2b688c,_0x84cd('0x29'));_0x13b565[_0x84cd('0x30')]=_[_0x84cd('0x31')](_0x5eee61[_0x84cd('0x30')]);_0x13b565['filters']=_[_0x84cd('0x32')](_0x13b565[_0x84cd('0x2f')],_0x13b565[_0x84cd('0x30')]);_0x584e83['attributes']=_[_0x84cd('0x32')](_0x13b565[_0x84cd('0x2f')],qs[_0x84cd('0x33')](_0x5eee61[_0x84cd('0x30')][_0x84cd('0x33')]));_0x584e83[_0x84cd('0x34')]=_0x584e83['attributes'][_0x84cd('0x35')]?_0x584e83['attributes']:_0x13b565[_0x84cd('0x2f')];if(!_0x5eee61[_0x84cd('0x30')]['hasOwnProperty'](_0x84cd('0x36'))){_0x584e83['limit']=qs[_0x84cd('0x1e')](_0x5eee61[_0x84cd('0x30')][_0x84cd('0x1e')]);_0x584e83[_0x84cd('0x20')]=qs['offset'](_0x5eee61['query'][_0x84cd('0x20')]);}_0x584e83[_0x84cd('0x37')]=qs[_0x84cd('0x38')](_0x5eee61[_0x84cd('0x30')][_0x84cd('0x38')]);_0x584e83[_0x84cd('0x39')]=qs[_0x84cd('0x3a')](_[_0x84cd('0x3b')](_0x5eee61[_0x84cd('0x30')],_0x13b565[_0x84cd('0x3a')]),_0x2b688c);if(_0x5eee61[_0x84cd('0x30')][_0x84cd('0x3c')]){_0x584e83['where']=_[_0x84cd('0x3d')](_0x584e83[_0x84cd('0x39')],{'$or':_[_0x84cd('0x2b')](_0x2b688c,function(_0x58516a){if(_0x58516a[_0x84cd('0x2d')]!=='VIRTUAL'){var _0x2912dc={};_0x2912dc[_0x58516a[_0x84cd('0x29')]]={'$like':'%'+_0x5eee61[_0x84cd('0x30')][_0x84cd('0x3c')]+'%'};return _0x2912dc;}})});}_0x584e83=_['merge']({},_0x584e83,_0x5eee61[_0x84cd('0x3e')]);var _0x271ccd={'where':_0x584e83[_0x84cd('0x39')]};return db['FaxApplication'][_0x84cd('0x1f')](_0x271ccd)[_0x84cd('0x3f')](function(_0x11397d){_0x43f91[_0x84cd('0x1f')]=_0x11397d;if(_0x5eee61[_0x84cd('0x30')][_0x84cd('0x40')]){_0x584e83[_0x84cd('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x84cd('0x42')](_0x584e83);})[_0x84cd('0x3f')](function(_0x4f0f7d){_0x43f91['rows']=_0x4f0f7d;return _0x43f91;})[_0x84cd('0x3f')](respondWithFilteredResult(_0x2b775f,_0x584e83))['catch'](handleError(_0x2b775f,null));};exports[_0x84cd('0x43')]=function(_0xf6f39f,_0x505436){var _0x408cbb={'raw':!![],'where':{'id':_0xf6f39f[_0x84cd('0x44')]['id']}},_0x2e36bc={};_0x2e36bc[_0x84cd('0x2f')]=_['keys'](db[_0x84cd('0x2c')][_0x84cd('0x45')]);_0x2e36bc['query']=_[_0x84cd('0x31')](_0xf6f39f[_0x84cd('0x30')]);_0x2e36bc[_0x84cd('0x3a')]=_[_0x84cd('0x32')](_0x2e36bc['model'],_0x2e36bc[_0x84cd('0x30')]);_0x408cbb[_0x84cd('0x34')]=_['intersection'](_0x2e36bc[_0x84cd('0x2f')],qs[_0x84cd('0x33')](_0xf6f39f[_0x84cd('0x30')][_0x84cd('0x33')]));_0x408cbb[_0x84cd('0x34')]=_0x408cbb['attributes'][_0x84cd('0x35')]?_0x408cbb['attributes']:_0x2e36bc[_0x84cd('0x2f')];if(_0xf6f39f[_0x84cd('0x30')]['includeAll']){_0x408cbb[_0x84cd('0x41')]=[{'all':!![]}];}_0x408cbb=_['merge']({},_0x408cbb,_0xf6f39f[_0x84cd('0x3e')]);return db[_0x84cd('0x2c')][_0x84cd('0x46')](_0x408cbb)[_0x84cd('0x3f')](handleEntityNotFound(_0x505436,null))[_0x84cd('0x3f')](respondWithResult(_0x505436,null))[_0x84cd('0x47')](handleError(_0x505436,null));};exports[_0x84cd('0x48')]=function(_0x551729,_0x5c68df){return db[_0x84cd('0x2c')]['create'](_0x551729['body'],{})[_0x84cd('0x3f')](respondWithResult(_0x5c68df,0xc9))[_0x84cd('0x47')](handleError(_0x5c68df,null));};exports['update']=function(_0x30f2be,_0x465fc4){if(_0x30f2be['body']['id']){delete _0x30f2be['body']['id'];}return db[_0x84cd('0x2c')]['find']({'where':{'id':_0x30f2be['params']['id']}})[_0x84cd('0x3f')](handleEntityNotFound(_0x465fc4,null))[_0x84cd('0x3f')](saveUpdates(_0x30f2be[_0x84cd('0x49')],null))[_0x84cd('0x3f')](respondWithResult(_0x465fc4,null))['catch'](handleError(_0x465fc4,null));};exports['destroy']=function(_0x3d0797,_0x2fdbff){return db['FaxApplication']['find']({'where':{'id':_0x3d0797[_0x84cd('0x44')]['id']}})[_0x84cd('0x3f')](handleEntityNotFound(_0x2fdbff,null))[_0x84cd('0x3f')](removeEntity(_0x2fdbff,null))[_0x84cd('0x47')](handleError(_0x2fdbff,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6a74b1c..b8c97e0 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 _0x5a94=['utf8mb4_unicode_ci','../../config/logger','moment','rimraf','./faxApplication.attributes','exports','utf8mb4'];(function(_0x5cc5b8,_0x18eeb2){var _0x54d755=function(_0x655836){while(--_0x655836){_0x5cc5b8['push'](_0x5cc5b8['shift']());}};_0x54d755(++_0x18eeb2);}(_0x5a94,0xe8));var _0x45a9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5a94[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x45a9('0x0'))('api');var moment=require(_0x45a9('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x45a9('0x2'));var config=require('../../config/environment');var attributes=require(_0x45a9('0x3'));module[_0x45a9('0x4')]=function(_0x12abc9,_0x1859b4){return _0x12abc9['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45a9('0x5'),'collate':_0x45a9('0x6')});}; \ No newline at end of file +var _0x8731=['moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x25c484,_0x2a95af){var _0x310e64=function(_0x109439){while(--_0x109439){_0x25c484['push'](_0x25c484['shift']());}};_0x310e64(++_0x2a95af);}(_0x8731,0x193));var _0x1873=function(_0x3c9d03,_0x377b71){_0x3c9d03=_0x3c9d03-0x0;var _0x479cf5=_0x8731[_0x3c9d03];return _0x479cf5;};'use strict';var _=require('lodash');var util=require(_0x1873('0x0'));var logger=require(_0x1873('0x1'))(_0x1873('0x2'));var moment=require(_0x1873('0x3'));var BPromise=require(_0x1873('0x4'));var rp=require(_0x1873('0x5'));var fs=require('fs');var path=require(_0x1873('0x6'));var rimraf=require('rimraf');var config=require(_0x1873('0x7'));var attributes=require(_0x1873('0x8'));module['exports']=function(_0x167c04,_0x1bf542){return _0x167c04[_0x1873('0x9')](_0x1873('0xa'),attributes,{'tableName':_0x1873('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1873('0xc'),'collate':_0x1873('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 54052df..c3e4e53 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 _0xad1b=['code','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','error'];(function(_0x2950fc,_0x1219c6){var _0x4bbb25=function(_0x40f217){while(--_0x40f217){_0x2950fc['push'](_0x2950fc['shift']());}};_0x4bbb25(++_0x1219c6);}(_0xad1b,0x12f));var _0xbad1=function(_0x2f8d91,_0x208e5f){_0x2f8d91=_0x2f8d91-0x0;var _0x271286=_0xad1b[_0x2f8d91];return _0x271286;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var moment=require(_0xbad1('0x2'));var BPromise=require(_0xbad1('0x3'));var rs=require(_0xbad1('0x4'));var fs=require('fs');var Redis=require(_0xbad1('0x5'));var db=require(_0xbad1('0x6'))['db'];var utils=require(_0xbad1('0x7'));var logger=require(_0xbad1('0x8'))(_0xbad1('0x9'));var config=require(_0xbad1('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbad1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34eb0e,_0xda4c5a,_0x36cb85){return new BPromise(function(_0x43f29a,_0x2b03ec){return client[_0xbad1('0xc')](_0x34eb0e,_0x36cb85)['then'](function(_0x26a11e){logger[_0xbad1('0xd')]('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'));logger[_0xbad1('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'),JSON['stringify'](_0x26a11e));if(_0x26a11e[_0xbad1('0x10')]){if(_0x26a11e[_0xbad1('0x10')][_0xbad1('0x11')]===0x1f4){logger[_0xbad1('0x10')](_0xbad1('0x12'),_0xda4c5a,_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);return _0x2b03ec(_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);}logger[_0xbad1('0x10')](_0xbad1('0x12'),_0xda4c5a,_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);return _0x43f29a(_0x26a11e['error']['message']);}else{logger[_0xbad1('0xd')]('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'));_0x43f29a(_0x26a11e[_0xbad1('0x14')][_0xbad1('0x13')]);}})[_0xbad1('0x15')](function(_0x2fc162){logger['error']('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0x2fc162);_0x2b03ec(_0x2fc162);});});}exports['UpdateFaxApplication']=function(_0x436de4){var _0x621f2=this;return new Promise(function(_0xde0cca,_0x359765){return db[_0xbad1('0x16')]['update'](_0x436de4[_0xbad1('0x17')],{'raw':_0x436de4['options']?_0x436de4[_0xbad1('0x18')][_0xbad1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1a')]||null:null,'attributes':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1b')]||null:null,'limit':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1c')]||null:null})[_0xbad1('0x1d')](function(_0x164272){logger['info'](_0xbad1('0x1e'),_0x436de4);logger[_0xbad1('0xf')](_0xbad1('0x1e'),_0x436de4,JSON[_0xbad1('0x1f')](_0x164272));_0xde0cca(_0x164272);})[_0xbad1('0x15')](function(_0x5a98d6){logger[_0xbad1('0x10')](_0xbad1('0x1e'),_0x5a98d6[_0xbad1('0x13')],_0x436de4);_0x359765(_0x621f2[_0xbad1('0x10')](0x1f4,_0x5a98d6[_0xbad1('0x13')]));});});}; \ No newline at end of file +var _0x1c00=['info','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','attributes','limit','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x149105,_0x43dded){var _0x327a27=function(_0x3911b0){while(--_0x3911b0){_0x149105['push'](_0x149105['shift']());}};_0x327a27(++_0x43dded);}(_0x1c00,0x137));var _0x01c0=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x1c00[_0x174ef5];return _0x1cc379;};'use strict';var _=require('lodash');var util=require(_0x01c0('0x0'));var moment=require(_0x01c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x01c0('0x2'));var fs=require('fs');var Redis=require(_0x01c0('0x3'));var db=require(_0x01c0('0x4'))['db'];var utils=require(_0x01c0('0x5'));var logger=require(_0x01c0('0x6'))(_0x01c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x01c0('0x8'));var client=jayson['client'][_0x01c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59a0d8,_0x3f060c,_0x25984d){return new BPromise(function(_0x4515db,_0xe97c2f){return client[_0x01c0('0xa')](_0x59a0d8,_0x25984d)[_0x01c0('0xb')](function(_0x474a3e){logger['info'](_0x01c0('0xc'),_0x3f060c,_0x01c0('0xd'));logger[_0x01c0('0xe')](_0x01c0('0xf'),_0x3f060c,_0x01c0('0xd'),JSON['stringify'](_0x474a3e));if(_0x474a3e[_0x01c0('0x10')]){if(_0x474a3e[_0x01c0('0x10')][_0x01c0('0x11')]===0x1f4){logger[_0x01c0('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3f060c,_0x474a3e[_0x01c0('0x10')][_0x01c0('0x12')]);return _0xe97c2f(_0x474a3e[_0x01c0('0x10')]['message']);}logger[_0x01c0('0x10')](_0x01c0('0xc'),_0x3f060c,_0x474a3e['error'][_0x01c0('0x12')]);return _0x4515db(_0x474a3e[_0x01c0('0x10')][_0x01c0('0x12')]);}else{logger[_0x01c0('0x13')]('FaxApplication,\x20%s,\x20%s',_0x3f060c,_0x01c0('0xd'));_0x4515db(_0x474a3e[_0x01c0('0x14')][_0x01c0('0x12')]);}})[_0x01c0('0x15')](function(_0x35dd2b){logger[_0x01c0('0x10')](_0x01c0('0xc'),_0x3f060c,_0x35dd2b);_0xe97c2f(_0x35dd2b);});});}exports[_0x01c0('0x16')]=function(_0x40df35){var _0x273d81=this;return new Promise(function(_0x254a55,_0x33bb88){return db[_0x01c0('0x17')]['update'](_0x40df35[_0x01c0('0x18')],{'raw':_0x40df35[_0x01c0('0x19')]?_0x40df35[_0x01c0('0x19')][_0x01c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40df35['options']?_0x40df35[_0x01c0('0x19')]['where']||null:null,'attributes':_0x40df35[_0x01c0('0x19')]?_0x40df35[_0x01c0('0x19')][_0x01c0('0x1b')]||null:null,'limit':_0x40df35[_0x01c0('0x19')]?_0x40df35[_0x01c0('0x19')][_0x01c0('0x1c')]||null:null})['then'](function(_0x2be004){logger[_0x01c0('0x13')](_0x01c0('0x16'),_0x40df35);logger[_0x01c0('0xe')](_0x01c0('0x16'),_0x40df35,JSON[_0x01c0('0x1d')](_0x2be004));_0x254a55(_0x2be004);})[_0x01c0('0x15')](function(_0x5756e3){logger[_0x01c0('0x10')]('UpdateFaxApplication',_0x5756e3[_0x01c0('0x12')],_0x40df35);_0x33bb88(_0x273d81[_0x01c0('0x10')](0x1f4,_0x5756e3['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 62c0e3a..bc3c0c8 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 _0xb10b=['./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x86c61b,_0x3b6335){var _0x40d661=function(_0x28efbc){while(--_0x28efbc){_0x86c61b['push'](_0x86c61b['shift']());}};_0x40d661(++_0x3b6335);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d417e,_0x3f0f60){_0x4d417e=_0x4d417e-0x0;var _0x34fb1d=_0xb10b[_0x4d417e];return _0x34fb1d;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x4f2a8d,_0x4a3491){var _0x459616=function(_0x2759d5){while(--_0x2759d5){_0x4f2a8d['push'](_0x4f2a8d['shift']());}};_0x459616(++_0x4a3491);}(_0xd4a2,0x173));var _0x2d4a=function(_0x5c0754,_0x28b3ed){_0x5c0754=_0x5c0754-0x0;var _0x49b406=_0xd4a2[_0x5c0754];return _0x49b406;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f1d645b..969dc86 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 _0x8e8a=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x579e83,_0x1d9b3d){var _0x212cce=function(_0x4e6f4d){while(--_0x4e6f4d){_0x579e83['push'](_0x579e83['shift']());}};_0x212cce(++_0x1d9b3d);}(_0x8e8a,0x1ad));var _0xa8e8=function(_0x281918,_0xb2b078){_0x281918=_0x281918-0x0;var _0x359ab1=_0x8e8a[_0x281918];return _0x359ab1;};'use strict';var Sequelize=require(_0xa8e8('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa8e8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa8e8('0x2')]},'disposition':{'type':Sequelize[_0xa8e8('0x3')]},'secondDisposition':{'type':Sequelize[_0xa8e8('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa8e8('0x3')]},'note':{'type':Sequelize[_0xa8e8('0x3')]},'read1stAt':{'type':Sequelize[_0xa8e8('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa8e8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa8e8('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa8e8('0x4')]('in',_0xa8e8('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x978b=['ENUM','sequelize','DATE','STRING','out'];(function(_0x187924,_0x17e8e1){var _0x434cff=function(_0xf187eb){while(--_0xf187eb){_0x187924['push'](_0x187924['shift']());}};_0x434cff(++_0x17e8e1);}(_0x978b,0x1e6));var _0xb978=function(_0x15d69f,_0x2f39bf){_0x15d69f=_0x15d69f-0x0;var _0x2df9ff=_0x978b[_0x15d69f];return _0x2df9ff;};'use strict';var Sequelize=require(_0xb978('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb978('0x1')]},'disposition':{'type':Sequelize[_0xb978('0x2')]},'secondDisposition':{'type':Sequelize[_0xb978('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb978('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb978('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb978('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb978('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb978('0x4')]('in',_0xb978('0x3')),'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 82cfc0c..ac548f2 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 _0x1fdd=['addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','createReadStream','pipe','resolve','err','unlinkSync','rimraf','zip-dir','moment','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','defaults','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','FaxInteraction','rawAttributes','fieldName','key','query','user','catch','show','model','keys','attributes','intersection','fields','length','includeAll','merge','options','create','body','find','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x1fdd,0x19f));var _0xd1fd=function(_0x22c718,_0x4126b8){_0x22c718=_0x22c718-0x0;var _0x921848=_0x1fdd[_0x22c718];return _0x921848;};'use strict';var rimraf=require(_0xd1fd('0x0'));var zipdir=require(_0xd1fd('0x1'));var moment=require(_0xd1fd('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd1fd('0x3'));var fs=require('fs');var _=require(_0xd1fd('0x4'));var Redis=require(_0xd1fd('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xd1fd('0x6'));var logger=require('../../config/logger')('api');var config=require(_0xd1fd('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd1fd('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd1fd('0x9'))(new Redis(config[_0xd1fd('0xa')]));require(_0xd1fd('0xb'))[_0xd1fd('0xc')](socket);function respondWithStatusCode(_0x2e0559,_0x2a7472){_0x2a7472=_0x2a7472||0xcc;return function(_0x1b4a2f){if(_0x1b4a2f){return _0x2e0559[_0xd1fd('0xd')](_0x2a7472);}return _0x2e0559['status'](_0x2a7472)[_0xd1fd('0xe')]();};}function respondWithResult(_0x348382,_0x5a8ec9){_0x5a8ec9=_0x5a8ec9||0xc8;return function(_0x59f931){if(_0x59f931){return _0x348382[_0xd1fd('0xf')](_0x5a8ec9)['json'](_0x59f931);}};}function respondWithFilteredResult(_0x26d766,_0x27fafe){return function(_0x10bd94){if(_0x10bd94){var _0x21028f=typeof _0x27fafe[_0xd1fd('0x10')]===_0xd1fd('0x11')&&typeof _0x27fafe[_0xd1fd('0x12')]===_0xd1fd('0x11');var _0x3099fe=_0x10bd94['count'];var _0x1b80ca=_0x21028f?0x0:_0x27fafe[_0xd1fd('0x10')];var _0x3ea084=_0x21028f?_0x10bd94[_0xd1fd('0x13')]:_0x27fafe[_0xd1fd('0x10')]+_0x27fafe[_0xd1fd('0x12')];var _0x4ea348;if(_0x3ea084>=_0x3099fe){_0x3ea084=_0x3099fe;_0x4ea348=0xc8;}else{_0x4ea348=0xce;}_0x26d766[_0xd1fd('0xf')](_0x4ea348);return _0x26d766['set'](_0xd1fd('0x14'),_0x1b80ca+'-'+_0x3ea084+'/'+_0x3099fe)['json'](_0x10bd94);}return null;};}function saveUpdates(_0x74560){return function(_0x1fbeef){if(_0x1fbeef){return _0x1fbeef[_0xd1fd('0x15')](_0x74560)[_0xd1fd('0x16')](function(_0x51ed01){return _0x51ed01;});}return null;};}function removeEntity(_0x2043d4){return function(_0x1c6e61){if(_0x1c6e61){return _0x1c6e61['destroy']()['then'](function(){_0x2043d4[_0xd1fd('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c92f8){return function(_0x38ab08){if(!_0x38ab08){_0x3c92f8[_0xd1fd('0xd')](0x194);}return _0x38ab08;};}function handleError(_0x443457,_0x16519b){_0x16519b=_0x16519b||0x1f4;return function(_0x31958f){logger[_0xd1fd('0x17')](_0x31958f[_0xd1fd('0x18')]);if(_0x31958f[_0xd1fd('0x19')]){delete _0x31958f['name'];}_0x443457[_0xd1fd('0xf')](_0x16519b)[_0xd1fd('0x1a')](_0x31958f);};}exports['index']=function(_0x208775,_0x5b108c){var _0x31bf1f={};var _0x10e12f=_['map'](db[_0xd1fd('0x1b')][_0xd1fd('0x1c')],function(_0x4093cb){return{'name':_0x4093cb[_0xd1fd('0x1d')],'type':_0x4093cb['type'][_0xd1fd('0x1e')]};});_0x31bf1f=qs['getOptions'](_0x10e12f,_0x208775);return interaction['findAll']('fax',_0x208775[_0xd1fd('0x1f')],_0x208775[_0xd1fd('0x20')],_0x31bf1f,_0x10e12f)['then'](respondWithFilteredResult(_0x5b108c,_0x31bf1f))[_0xd1fd('0x21')](handleError(_0x5b108c,null));};exports[_0xd1fd('0x22')]=function(_0x13dcd4,_0xe7a804){var _0x41fe51={'raw':![],'where':{'id':_0x13dcd4['params']['id']}},_0x37f887={};_0x37f887[_0xd1fd('0x23')]=_[_0xd1fd('0x24')](db[_0xd1fd('0x1b')][_0xd1fd('0x1c')]);_0x37f887[_0xd1fd('0x1f')]=_[_0xd1fd('0x24')](_0x13dcd4['query']);_0x37f887['filters']=_['intersection'](_0x37f887['model'],_0x37f887[_0xd1fd('0x1f')]);_0x41fe51[_0xd1fd('0x25')]=_[_0xd1fd('0x26')](_0x37f887[_0xd1fd('0x23')],qs['fields'](_0x13dcd4[_0xd1fd('0x1f')][_0xd1fd('0x27')]));_0x41fe51[_0xd1fd('0x25')]=_0x41fe51['attributes'][_0xd1fd('0x28')]?_0x41fe51['attributes']:_0x37f887[_0xd1fd('0x23')];if(_0x13dcd4[_0xd1fd('0x1f')][_0xd1fd('0x29')]){_0x41fe51['include']=[{'all':!![]}];}_0x41fe51=_[_0xd1fd('0x2a')]({},_0x41fe51,_0x13dcd4[_0xd1fd('0x2b')]);return db[_0xd1fd('0x1b')]['find'](_0x41fe51)[_0xd1fd('0x16')](handleEntityNotFound(_0xe7a804,null))['then'](respondWithResult(_0xe7a804,null))[_0xd1fd('0x21')](handleError(_0xe7a804,null));};exports[_0xd1fd('0x2c')]=function(_0x4eeb27,_0x432584){return db[_0xd1fd('0x1b')][_0xd1fd('0x2c')](_0x4eeb27[_0xd1fd('0x2d')],{})[_0xd1fd('0x16')](respondWithResult(_0x432584,0xc9))['catch'](handleError(_0x432584,null));};exports[_0xd1fd('0x15')]=function(_0x59a3c0,_0x312d32){if(_0x59a3c0[_0xd1fd('0x2d')]['id']){delete _0x59a3c0['body']['id'];}return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x59a3c0[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x312d32,null))[_0xd1fd('0x16')](saveUpdates(_0x59a3c0['body'],null))[_0xd1fd('0x16')](respondWithResult(_0x312d32,null))[_0xd1fd('0x21')](handleError(_0x312d32,null));};exports['destroy']=function(_0x3324,_0x5a8759){return db[_0xd1fd('0x1b')]['find']({'where':{'id':_0x3324['params']['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x5a8759,null))[_0xd1fd('0x16')](removeEntity(_0x5a8759,null))['catch'](handleError(_0x5a8759,null));};exports[_0xd1fd('0x30')]=function(_0x4fd0c5,_0x83f4b7){return db[_0xd1fd('0x1b')]['describe']()[_0xd1fd('0x16')](respondWithResult(_0x83f4b7,null))[_0xd1fd('0x21')](handleError(_0x83f4b7,null));};exports[_0xd1fd('0x31')]=function(_0x46a572,_0x30288b){return db[_0xd1fd('0x32')]['find']({'where':{'id':_0x46a572[_0xd1fd('0x2f')]['id']}})['then'](handleEntityNotFound(_0x30288b,null))['then'](function(_0x414e93){if(_0x414e93){return _0x414e93[_0xd1fd('0x31')](_0x46a572[_0xd1fd('0x2d')][_0xd1fd('0x33')],_[_0xd1fd('0x34')](_0x46a572[_0xd1fd('0x2d')],[_0xd1fd('0x33'),'id'])||{});}})[_0xd1fd('0x16')](respondWithResult(_0x30288b,null))[_0xd1fd('0x21')](handleError(_0x30288b,null));};exports[_0xd1fd('0x35')]=function(_0x13ec6b,_0x201042){var _0x36dc6b={'raw':![],'where':{}};var _0x360f4d={};var _0x5a888c={'count':0x0,'rows':[]};return db[_0xd1fd('0x1b')][_0xd1fd('0x36')]({'where':{'id':_0x13ec6b[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x201042,null))['then'](function(_0xb79411){if(_0xb79411){_0x360f4d[_0xd1fd('0x23')]=_[_0xd1fd('0x24')](db[_0xd1fd('0x32')]['rawAttributes']);_0x360f4d[_0xd1fd('0x1f')]=_[_0xd1fd('0x24')](_0x13ec6b[_0xd1fd('0x1f')]);_0x360f4d[_0xd1fd('0x37')]=_[_0xd1fd('0x26')](_0x360f4d[_0xd1fd('0x23')],_0x360f4d[_0xd1fd('0x1f')]);_0x36dc6b[_0xd1fd('0x25')]=_[_0xd1fd('0x26')](_0x360f4d[_0xd1fd('0x23')],qs[_0xd1fd('0x27')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x27')]));_0x36dc6b[_0xd1fd('0x25')]=_0x36dc6b['attributes'][_0xd1fd('0x28')]?_0x36dc6b[_0xd1fd('0x25')]:_0x360f4d['model'];if(!_0x13ec6b['query'][_0xd1fd('0x38')](_0xd1fd('0x39'))){_0x36dc6b[_0xd1fd('0x12')]=qs[_0xd1fd('0x12')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x12')]);_0x36dc6b[_0xd1fd('0x10')]=qs[_0xd1fd('0x10')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x10')]);}_0x36dc6b[_0xd1fd('0x3a')]=qs[_0xd1fd('0x3b')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x3b')]);_0x36dc6b[_0xd1fd('0x3c')]=qs['filters'](_[_0xd1fd('0x3d')](_0x13ec6b['query'],_0x360f4d['filters']));_0x36dc6b[_0xd1fd('0x3c')][_0xd1fd('0x3e')]=_0xb79411['id'];if(_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x3f')]){_0x36dc6b[_0xd1fd('0x3c')]=_['merge'](_0x36dc6b[_0xd1fd('0x3c')],{'$or':_[_0xd1fd('0x40')](_0x36dc6b['attributes'],function(_0x542bbb){var _0x3caa50={};_0x3caa50[_0x542bbb]={'$like':'%'+_0x13ec6b['query'][_0xd1fd('0x3f')]+'%'};return _0x3caa50;})});}if(_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x41')]){var _0x15cd5d=_0x13ec6b[_0xd1fd('0x1f')]['$gte'][_0xd1fd('0x42')](',');var _0x1b2bc6={};_0x1b2bc6[_0x15cd5d[0x0]]={'$gte':moment(_0x15cd5d[0x1])['format'](_0xd1fd('0x43'))};_0x36dc6b['where']=_[_0xd1fd('0x2a')](_0x36dc6b['where'],_0x1b2bc6);}_0x36dc6b=_[_0xd1fd('0x2a')]({},_0x36dc6b,_0x13ec6b[_0xd1fd('0x2b')]);return db['FaxMessage']['count']({'where':_0x36dc6b[_0xd1fd('0x3c')]})['then'](function(_0x30620a){_0x5a888c[_0xd1fd('0x13')]=_0x30620a;if(_0x13ec6b['query'][_0xd1fd('0x29')]){_0x36dc6b['include']=[{'all':!![]}];}return db[_0xd1fd('0x32')][_0xd1fd('0x44')](_0x36dc6b);})[_0xd1fd('0x16')](function(_0x224d8a){_0x5a888c[_0xd1fd('0x45')]=_0x224d8a;return _0x5a888c;});}})[_0xd1fd('0x16')](respondWithFilteredResult(_0x201042,_0x36dc6b))[_0xd1fd('0x21')](handleError(_0x201042,null));};exports[_0xd1fd('0x46')]=function(_0x17eade,_0x10eb9f){return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x17eade[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x10eb9f,null))[_0xd1fd('0x16')](function(_0x125025){if(_0x125025){return _0x125025[_0xd1fd('0x47')](_0x17eade[_0xd1fd('0x2d')][_0xd1fd('0x33')],_[_0xd1fd('0x34')](_0x17eade[_0xd1fd('0x2d')],[_0xd1fd('0x33'),'id'])||{})[_0xd1fd('0x48')](function(){return db['Tag']['findAll']({'attributes':['id',_0xd1fd('0x19'),_0xd1fd('0x49')],'where':{'id':_0x17eade['body'][_0xd1fd('0x33')]}});})[_0xd1fd('0x16')](function(_0x49e037){socket[_0xd1fd('0x4a')](_0xd1fd('0x4b'),{'id':Number(_0x17eade[_0xd1fd('0x2f')]['id']),'tags':_0x49e037||[]});return{'id':Number(_0x17eade[_0xd1fd('0x2f')]['id']),'tags':_0x49e037||[]};});}})['then'](respondWithResult(_0x10eb9f,null))[_0xd1fd('0x21')](handleError(_0x10eb9f,null));};exports[_0xd1fd('0x4c')]=function(_0x4040a5,_0x5dccce){return db[_0xd1fd('0x1b')]['find']({'where':{'id':_0x4040a5[_0xd1fd('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5dccce,null))[_0xd1fd('0x16')](function(_0x19968f){if(_0x19968f){return _0x19968f[_0xd1fd('0x4c')](_0x4040a5[_0xd1fd('0x1f')][_0xd1fd('0x33')]);}})[_0xd1fd('0x16')](respondWithStatusCode(_0x5dccce,null))['catch'](handleError(_0x5dccce,null));};exports[_0xd1fd('0x4d')]=function(_0x4944e4,_0xa7b864){var _0x5f199e=moment()[_0xd1fd('0x4e')]()[_0xd1fd('0x4f')]();var _0x49019e=path[_0xd1fd('0x50')](config[_0xd1fd('0x51')],_0xd1fd('0x52'),_0xd1fd('0x53'),_0xd1fd('0x54'));var _0x810ebb=path[_0xd1fd('0x50')](config[_0xd1fd('0x51')],'server',_0xd1fd('0x53'),_0xd1fd('0x55'));var _0x5e8d3c=path[_0xd1fd('0x50')](_0x49019e,_0x5f199e);var _0x37de8c=util['format'](_0xd1fd('0x56'),_0x4944e4[_0xd1fd('0x2f')]['id'],_0x5f199e);var _0x59db5b=path[_0xd1fd('0x50')](_0x49019e,_0x37de8c);var _0x3bf202=[];_0x3bf202[_0xd1fd('0x57')]({'model':db[_0xd1fd('0x58')],'as':_0xd1fd('0x58'),'raw':!![]});var _0x47d323=[{'model':db[_0xd1fd('0x32')],'as':_0xd1fd('0x59'),'attributes':['id',_0xd1fd('0x2d'),'createdAt'],'include':_0x3bf202}];return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x4944e4['params']['id']},'include':_0x47d323})[_0xd1fd('0x16')](handleEntityNotFound(_0xa7b864,null))[_0xd1fd('0x16')](function(_0x18f9a1){if(_0x18f9a1&&_0x18f9a1[_0xd1fd('0x59')]){var _0x3ee0e1=_0x18f9a1[_0xd1fd('0x5a')]({'plain':!![]});fs[_0xd1fd('0x5b')](_0x5e8d3c);for(var _0x4eed3b=0x0;_0x4eed3b<_0x3ee0e1[_0xd1fd('0x59')][_0xd1fd('0x28')];_0x4eed3b++){var _0x4ce391=_0x3ee0e1['Messages'][_0x4eed3b][_0xd1fd('0x58')];if(_0x4ce391){var _0x56f81a=path[_0xd1fd('0x50')](_0x810ebb,_0x4ce391['basename']);if(fs['existsSync'](_0x56f81a)){fs[_0xd1fd('0x5c')](_0x56f81a)[_0xd1fd('0x5d')](fs['createWriteStream'](path[_0xd1fd('0x50')](_0x5e8d3c,_0x4ce391['basename'])));}}}return BPromise[_0xd1fd('0x5e')]()['then'](function(){return new BPromise(function(_0x5795fe,_0xdd6bab){zipdir(_0x5e8d3c,{'saveTo':_0x59db5b},function(_0x55ee1f,_0x1b903b){if(_0x55ee1f)return _0xdd6bab(_0x55ee1f);return _0x5795fe(_0x1b903b);});})['then'](function(){return new BPromise(function(_0x17fbf2,_0x4a3f28){rimraf(_0x5e8d3c,function(_0x40e8ba){if(_0x40e8ba)_0x4a3f28(_0x40e8ba);return _0x17fbf2();});});})[_0xd1fd('0x16')](function(){return _0xa7b864['download'](_0x59db5b,_0x37de8c,function(_0x4d777d){if(_0x4d777d){console['log'](_0xd1fd('0x5f'),_0x4d777d);}else{fs[_0xd1fd('0x60')](_0x59db5b);}});});});}else{return _0xa7b864[_0xd1fd('0xd')](0xc8);}})[_0xd1fd('0x21')](handleError(_0xa7b864,null));}; \ No newline at end of file +var _0x2246=['sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','zip-dir','moment','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','params','keys','filters','intersection','attributes','model','fields','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2246,0x15a));var _0x6224=function(_0x443111,_0x3c94ae){_0x443111=_0x443111-0x0;var _0x3056c5=_0x2246[_0x443111];return _0x3056c5;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6224('0x0'));var moment=require(_0x6224('0x1'));var BPromise=require('bluebird');var util=require(_0x6224('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x6224('0x3'));var Redis=require(_0x6224('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x6224('0x5'));var logger=require(_0x6224('0x6'))(_0x6224('0x7'));var config=require(_0x6224('0x8'));var db=require('../../mysqldb')['db'];config[_0x6224('0x9')]=_[_0x6224('0xa')](config[_0x6224('0x9')],{'host':_0x6224('0xb'),'port':0x18eb});var socket=require(_0x6224('0xc'))(new Redis(config[_0x6224('0x9')]));require('./faxInteraction.socket')[_0x6224('0xd')](socket);function respondWithStatusCode(_0x3974cf,_0x1202fb){_0x1202fb=_0x1202fb||0xcc;return function(_0x70eb19){if(_0x70eb19){return _0x3974cf[_0x6224('0xe')](_0x1202fb);}return _0x3974cf[_0x6224('0xf')](_0x1202fb)[_0x6224('0x10')]();};}function respondWithResult(_0x135976,_0x27da76){_0x27da76=_0x27da76||0xc8;return function(_0x188eed){if(_0x188eed){return _0x135976[_0x6224('0xf')](_0x27da76)[_0x6224('0x11')](_0x188eed);}};}function respondWithFilteredResult(_0x5e49ee,_0x5a2043){return function(_0x1a622c){if(_0x1a622c){var _0x9cee90=typeof _0x5a2043[_0x6224('0x12')]===_0x6224('0x13')&&typeof _0x5a2043[_0x6224('0x14')]===_0x6224('0x13');var _0x122bb1=_0x1a622c[_0x6224('0x15')];var _0x2db82c=_0x9cee90?0x0:_0x5a2043['offset'];var _0x228b9c=_0x9cee90?_0x1a622c['count']:_0x5a2043['offset']+_0x5a2043[_0x6224('0x14')];var _0x51038d;if(_0x228b9c>=_0x122bb1){_0x228b9c=_0x122bb1;_0x51038d=0xc8;}else{_0x51038d=0xce;}_0x5e49ee[_0x6224('0xf')](_0x51038d);return _0x5e49ee['set'](_0x6224('0x16'),_0x2db82c+'-'+_0x228b9c+'/'+_0x122bb1)[_0x6224('0x11')](_0x1a622c);}return null;};}function saveUpdates(_0x1bd32a){return function(_0xf2f820){if(_0xf2f820){return _0xf2f820[_0x6224('0x17')](_0x1bd32a)[_0x6224('0x18')](function(_0x5ef4d8){return _0x5ef4d8;});}return null;};}function removeEntity(_0x558fed){return function(_0x45d7a7){if(_0x45d7a7){return _0x45d7a7[_0x6224('0x19')]()['then'](function(){_0x558fed[_0x6224('0xf')](0xcc)[_0x6224('0x10')]();});}};}function handleEntityNotFound(_0xe379dd){return function(_0x272f46){if(!_0x272f46){_0xe379dd[_0x6224('0xe')](0x194);}return _0x272f46;};}function handleError(_0x29016d,_0x51826b){_0x51826b=_0x51826b||0x1f4;return function(_0x534bbb){logger['error'](_0x534bbb[_0x6224('0x1a')]);if(_0x534bbb['name']){delete _0x534bbb[_0x6224('0x1b')];}_0x29016d[_0x6224('0xf')](_0x51826b)[_0x6224('0x1c')](_0x534bbb);};}exports[_0x6224('0x1d')]=function(_0x3f2118,_0x36090c){var _0x44da6a={};var _0x25192f=_[_0x6224('0x1e')](db[_0x6224('0x1f')][_0x6224('0x20')],function(_0x1203bd){return{'name':_0x1203bd[_0x6224('0x21')],'type':_0x1203bd[_0x6224('0x22')][_0x6224('0x23')]};});_0x44da6a=qs[_0x6224('0x24')](_0x25192f,_0x3f2118);return interaction[_0x6224('0x25')](_0x6224('0x26'),_0x3f2118[_0x6224('0x27')],_0x3f2118[_0x6224('0x28')],_0x44da6a,_0x25192f)[_0x6224('0x18')](respondWithFilteredResult(_0x36090c,_0x44da6a))[_0x6224('0x29')](handleError(_0x36090c,null));};exports[_0x6224('0x2a')]=function(_0x4d7d26,_0x5d22af){var _0x57997e={'raw':![],'where':{'id':_0x4d7d26[_0x6224('0x2b')]['id']}},_0x4b035e={};_0x4b035e['model']=_[_0x6224('0x2c')](db[_0x6224('0x1f')][_0x6224('0x20')]);_0x4b035e[_0x6224('0x27')]=_[_0x6224('0x2c')](_0x4d7d26[_0x6224('0x27')]);_0x4b035e[_0x6224('0x2d')]=_[_0x6224('0x2e')](_0x4b035e['model'],_0x4b035e[_0x6224('0x27')]);_0x57997e[_0x6224('0x2f')]=_[_0x6224('0x2e')](_0x4b035e[_0x6224('0x30')],qs[_0x6224('0x31')](_0x4d7d26[_0x6224('0x27')]['fields']));_0x57997e[_0x6224('0x2f')]=_0x57997e['attributes']['length']?_0x57997e[_0x6224('0x2f')]:_0x4b035e['model'];if(_0x4d7d26[_0x6224('0x27')]['includeAll']){_0x57997e[_0x6224('0x32')]=[{'all':!![]}];}_0x57997e=_[_0x6224('0x33')]({},_0x57997e,_0x4d7d26[_0x6224('0x34')]);return db[_0x6224('0x1f')][_0x6224('0x35')](_0x57997e)[_0x6224('0x18')](handleEntityNotFound(_0x5d22af,null))[_0x6224('0x18')](respondWithResult(_0x5d22af,null))[_0x6224('0x29')](handleError(_0x5d22af,null));};exports[_0x6224('0x36')]=function(_0x47c8af,_0x52920c){return db[_0x6224('0x1f')][_0x6224('0x36')](_0x47c8af[_0x6224('0x37')],{})[_0x6224('0x18')](respondWithResult(_0x52920c,0xc9))[_0x6224('0x29')](handleError(_0x52920c,null));};exports[_0x6224('0x17')]=function(_0xe2e8b6,_0x4d5830){if(_0xe2e8b6[_0x6224('0x37')]['id']){delete _0xe2e8b6['body']['id'];}return db[_0x6224('0x1f')][_0x6224('0x35')]({'where':{'id':_0xe2e8b6[_0x6224('0x2b')]['id']}})[_0x6224('0x18')](handleEntityNotFound(_0x4d5830,null))[_0x6224('0x18')](saveUpdates(_0xe2e8b6[_0x6224('0x37')],null))[_0x6224('0x18')](respondWithResult(_0x4d5830,null))['catch'](handleError(_0x4d5830,null));};exports[_0x6224('0x19')]=function(_0x4c617a,_0x45eba7){return db[_0x6224('0x1f')][_0x6224('0x35')]({'where':{'id':_0x4c617a['params']['id']}})[_0x6224('0x18')](handleEntityNotFound(_0x45eba7,null))[_0x6224('0x18')](removeEntity(_0x45eba7,null))[_0x6224('0x29')](handleError(_0x45eba7,null));};exports[_0x6224('0x38')]=function(_0xb16ec7,_0x3fd0e6){return db[_0x6224('0x1f')]['describe']()[_0x6224('0x18')](respondWithResult(_0x3fd0e6,null))['catch'](handleError(_0x3fd0e6,null));};exports[_0x6224('0x39')]=function(_0xd39e38,_0x2746a6){return db[_0x6224('0x3a')][_0x6224('0x35')]({'where':{'id':_0xd39e38[_0x6224('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2746a6,null))['then'](function(_0x16de22){if(_0x16de22){return _0x16de22[_0x6224('0x39')](_0xd39e38['body'][_0x6224('0x3b')],_[_0x6224('0x3c')](_0xd39e38['body'],[_0x6224('0x3b'),'id'])||{});}})[_0x6224('0x18')](respondWithResult(_0x2746a6,null))['catch'](handleError(_0x2746a6,null));};exports[_0x6224('0x3d')]=function(_0x5da8b3,_0x2883e2){var _0x4bc40c={'raw':![],'where':{}};var _0x52bbfe={};var _0x2827d0={'count':0x0,'rows':[]};return db[_0x6224('0x1f')][_0x6224('0x3e')]({'where':{'id':_0x5da8b3[_0x6224('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2883e2,null))[_0x6224('0x18')](function(_0x156b23){if(_0x156b23){_0x52bbfe[_0x6224('0x30')]=_['keys'](db[_0x6224('0x3a')][_0x6224('0x20')]);_0x52bbfe['query']=_[_0x6224('0x2c')](_0x5da8b3[_0x6224('0x27')]);_0x52bbfe[_0x6224('0x2d')]=_[_0x6224('0x2e')](_0x52bbfe[_0x6224('0x30')],_0x52bbfe['query']);_0x4bc40c['attributes']=_[_0x6224('0x2e')](_0x52bbfe[_0x6224('0x30')],qs[_0x6224('0x31')](_0x5da8b3[_0x6224('0x27')][_0x6224('0x31')]));_0x4bc40c['attributes']=_0x4bc40c[_0x6224('0x2f')][_0x6224('0x3f')]?_0x4bc40c[_0x6224('0x2f')]:_0x52bbfe[_0x6224('0x30')];if(!_0x5da8b3[_0x6224('0x27')][_0x6224('0x40')](_0x6224('0x41'))){_0x4bc40c[_0x6224('0x14')]=qs['limit'](_0x5da8b3[_0x6224('0x27')]['limit']);_0x4bc40c['offset']=qs['offset'](_0x5da8b3[_0x6224('0x27')]['offset']);}_0x4bc40c['order']=qs[_0x6224('0x42')](_0x5da8b3[_0x6224('0x27')]['sort']);_0x4bc40c[_0x6224('0x43')]=qs[_0x6224('0x2d')](_[_0x6224('0x44')](_0x5da8b3[_0x6224('0x27')],_0x52bbfe[_0x6224('0x2d')]));_0x4bc40c['where']['FaxInteractionId']=_0x156b23['id'];if(_0x5da8b3[_0x6224('0x27')]['filter']){_0x4bc40c[_0x6224('0x43')]=_[_0x6224('0x33')](_0x4bc40c[_0x6224('0x43')],{'$or':_[_0x6224('0x1e')](_0x4bc40c['attributes'],function(_0x2d7dbb){var _0x1991d4={};_0x1991d4[_0x2d7dbb]={'$like':'%'+_0x5da8b3[_0x6224('0x27')][_0x6224('0x45')]+'%'};return _0x1991d4;})});}if(_0x5da8b3[_0x6224('0x27')][_0x6224('0x46')]){var _0x23f043=_0x5da8b3['query'][_0x6224('0x46')][_0x6224('0x47')](',');var _0x4d615e={};_0x4d615e[_0x23f043[0x0]]={'$gte':moment(_0x23f043[0x1])[_0x6224('0x48')](_0x6224('0x49'))};_0x4bc40c[_0x6224('0x43')]=_[_0x6224('0x33')](_0x4bc40c['where'],_0x4d615e);}_0x4bc40c=_[_0x6224('0x33')]({},_0x4bc40c,_0x5da8b3['options']);return db[_0x6224('0x3a')][_0x6224('0x15')]({'where':_0x4bc40c[_0x6224('0x43')]})[_0x6224('0x18')](function(_0xac122a){_0x2827d0[_0x6224('0x15')]=_0xac122a;if(_0x5da8b3[_0x6224('0x27')][_0x6224('0x4a')]){_0x4bc40c['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4bc40c);})['then'](function(_0x17bc0d){_0x2827d0['rows']=_0x17bc0d;return _0x2827d0;});}})[_0x6224('0x18')](respondWithFilteredResult(_0x2883e2,_0x4bc40c))[_0x6224('0x29')](handleError(_0x2883e2,null));};exports[_0x6224('0x4b')]=function(_0x3c4ff0,_0x50e757){return db['FaxInteraction']['find']({'where':{'id':_0x3c4ff0[_0x6224('0x2b')]['id']}})[_0x6224('0x18')](handleEntityNotFound(_0x50e757,null))[_0x6224('0x18')](function(_0x199539){if(_0x199539){return _0x199539[_0x6224('0x4c')](_0x3c4ff0[_0x6224('0x37')][_0x6224('0x3b')],_[_0x6224('0x3c')](_0x3c4ff0[_0x6224('0x37')],[_0x6224('0x3b'),'id'])||{})[_0x6224('0x4d')](function(){return db[_0x6224('0x4e')][_0x6224('0x25')]({'attributes':['id',_0x6224('0x1b'),_0x6224('0x4f')],'where':{'id':_0x3c4ff0['body'][_0x6224('0x3b')]}});})[_0x6224('0x18')](function(_0x4786f4){socket[_0x6224('0x50')](_0x6224('0x51'),{'id':Number(_0x3c4ff0[_0x6224('0x2b')]['id']),'tags':_0x4786f4||[]});return{'id':Number(_0x3c4ff0[_0x6224('0x2b')]['id']),'tags':_0x4786f4||[]};});}})[_0x6224('0x18')](respondWithResult(_0x50e757,null))['catch'](handleError(_0x50e757,null));};exports['removeTags']=function(_0x3ab83e,_0x1c703a){return db['FaxInteraction']['find']({'where':{'id':_0x3ab83e[_0x6224('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1c703a,null))[_0x6224('0x18')](function(_0x420159){if(_0x420159){return _0x420159['removeTags'](_0x3ab83e[_0x6224('0x27')]['ids']);}})['then'](respondWithStatusCode(_0x1c703a,null))[_0x6224('0x29')](handleError(_0x1c703a,null));};exports[_0x6224('0x52')]=function(_0x5075e0,_0x2076bc){var _0x38540e=moment()[_0x6224('0x53')]()[_0x6224('0x54')]();var _0x106ecc=path[_0x6224('0x55')](config[_0x6224('0x56')],_0x6224('0x57'),_0x6224('0x58'),'tmp');var _0x12977e=path[_0x6224('0x55')](config[_0x6224('0x56')],_0x6224('0x57'),_0x6224('0x58'),_0x6224('0x59'));var _0x4cf2d5=path[_0x6224('0x55')](_0x106ecc,_0x38540e);var _0x25dd3f=util[_0x6224('0x48')](_0x6224('0x5a'),_0x5075e0[_0x6224('0x2b')]['id'],_0x38540e);var _0x4131dd=path[_0x6224('0x55')](_0x106ecc,_0x25dd3f);var _0x53bfda=[];_0x53bfda[_0x6224('0x5b')]({'model':db[_0x6224('0x5c')],'as':_0x6224('0x5c'),'raw':!![]});var _0x184a1d=[{'model':db[_0x6224('0x3a')],'as':_0x6224('0x5d'),'attributes':['id',_0x6224('0x37'),'createdAt'],'include':_0x53bfda}];return db[_0x6224('0x1f')][_0x6224('0x35')]({'where':{'id':_0x5075e0['params']['id']},'include':_0x184a1d})[_0x6224('0x18')](handleEntityNotFound(_0x2076bc,null))[_0x6224('0x18')](function(_0x204080){if(_0x204080&&_0x204080[_0x6224('0x5d')]){var _0x54aec4=_0x204080[_0x6224('0x5e')]({'plain':!![]});fs[_0x6224('0x5f')](_0x4cf2d5);for(var _0x5e8194=0x0;_0x5e8194<_0x54aec4['Messages'][_0x6224('0x3f')];_0x5e8194++){var _0x1f5e94=_0x54aec4['Messages'][_0x5e8194][_0x6224('0x5c')];if(_0x1f5e94){var _0x1c9957=path[_0x6224('0x55')](_0x12977e,_0x1f5e94[_0x6224('0x60')]);if(fs[_0x6224('0x61')](_0x1c9957)){fs[_0x6224('0x62')](_0x1c9957)['pipe'](fs[_0x6224('0x63')](path[_0x6224('0x55')](_0x4cf2d5,_0x1f5e94['basename'])));}}}return BPromise['resolve']()[_0x6224('0x18')](function(){return new BPromise(function(_0x47d34a,_0x2c47db){zipdir(_0x4cf2d5,{'saveTo':_0x4131dd},function(_0x3faa2f,_0x2cd50e){if(_0x3faa2f)return _0x2c47db(_0x3faa2f);return _0x47d34a(_0x2cd50e);});})[_0x6224('0x18')](function(){return new BPromise(function(_0x2880c0,_0x4af839){rimraf(_0x4cf2d5,function(_0x43270f){if(_0x43270f)_0x4af839(_0x43270f);return _0x2880c0();});});})[_0x6224('0x18')](function(){return _0x2076bc[_0x6224('0x52')](_0x4131dd,_0x25dd3f,function(_0x1e81df){if(_0x1e81df){console[_0x6224('0x64')](_0x6224('0x65'),_0x1e81df);}else{fs[_0x6224('0x66')](_0x4131dd);}});});});}else{return _0x2076bc['sendStatus'](0xc8);}})[_0x6224('0x29')](handleError(_0x2076bc,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a10f7b7..f9a78ed 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 _0xcb9b=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x3bab18,_0x53d735){var _0x12585f=function(_0x6cb5c4){while(--_0x6cb5c4){_0x3bab18['push'](_0x3bab18['shift']());}};_0x12585f(++_0x53d735);}(_0xcb9b,0xcb));var _0xbcb9=function(_0x28cf13,_0x26cf35){_0x28cf13=_0x28cf13-0x0;var _0x202155=_0xcb9b[_0x28cf13];return _0x202155;};'use strict';var EventEmitter=require(_0xbcb9('0x0'));var FaxInteraction=require(_0xbcb9('0x1'))['db'][_0xbcb9('0x2')];var FaxMessage=require(_0xbcb9('0x1'))['db'][_0xbcb9('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xbcb9('0x4')](0x0);var events={'afterCreate':_0xbcb9('0x5'),'afterUpdate':'update','afterDestroy':_0xbcb9('0x6')};function emitEvent(_0x239864){return function(_0x14ec9a,_0x32b292,_0x377d7c){_0x14ec9a[_0xbcb9('0x7')]({'attributes':['id'],'raw':!![]})[_0xbcb9('0x8')](function(_0x3e70da){_0x14ec9a[_0xbcb9('0x9')]('Users',_0x3e70da['map'](function(_0x258ded){return{'id':_0x258ded['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x14ec9a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbcb9('0x8')](function(_0x5825ab){_0x14ec9a[_0xbcb9('0x9')](_0xbcb9('0xa'),_0x5825ab[_0xbcb9('0xb')]);FaxInteractionEvents[_0xbcb9('0xc')](_0x239864+':'+_0x14ec9a['id'],_0x14ec9a);FaxInteractionEvents[_0xbcb9('0xc')](_0x239864,_0x14ec9a);_0x377d7c(null);})[_0xbcb9('0xd')](_0x377d7c(null));};}for(var e in events){if(events[_0xbcb9('0xe')](e)){var event=events[e];FaxInteraction[_0xbcb9('0xf')](e,emitEvent(event));}}module[_0xbcb9('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xbbb3=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x1f0d8d,_0x434559){var _0x2083c2=function(_0x49fe1b){while(--_0x49fe1b){_0x1f0d8d['push'](_0x1f0d8d['shift']());}};_0x2083c2(++_0x434559);}(_0xbbb3,0x1b7));var _0x3bbb=function(_0x21dc0b,_0x4efdc5){_0x21dc0b=_0x21dc0b-0x0;var _0x4e4d2d=_0xbbb3[_0x21dc0b];return _0x4e4d2d;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x3bbb('0x0'))['db'][_0x3bbb('0x1')];var FaxMessage=require(_0x3bbb('0x0'))['db'][_0x3bbb('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3bbb('0x3'),'afterDestroy':_0x3bbb('0x4')};function emitEvent(_0x7b1dc2){return function(_0xd5d104,_0x11fb31,_0x5b96e3){_0xd5d104[_0x3bbb('0x5')]({'attributes':['id'],'raw':!![]})[_0x3bbb('0x6')](function(_0xc4d680){_0xd5d104[_0x3bbb('0x7')](_0x3bbb('0x8'),_0xc4d680[_0x3bbb('0x9')](function(_0x49ffca){return{'id':_0x49ffca['id']};}));return FaxMessage[_0x3bbb('0xa')]({'where':{'FaxInteractionId':_0xd5d104['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3bbb('0x6')](function(_0x2e584f){_0xd5d104[_0x3bbb('0x7')](_0x3bbb('0xb'),_0x2e584f[_0x3bbb('0xc')]);FaxInteractionEvents[_0x3bbb('0xd')](_0x7b1dc2+':'+_0xd5d104['id'],_0xd5d104);FaxInteractionEvents[_0x3bbb('0xd')](_0x7b1dc2,_0xd5d104);_0x5b96e3(null);})[_0x3bbb('0xe')](_0x5b96e3(null));};}for(var e in events){if(events[_0x3bbb('0xf')](e)){var event=events[e];FaxInteraction[_0x3bbb('0x10')](e,emitEvent(event));}}module[_0x3bbb('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 65cda84..bae15b8 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 _0xf365=['path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','request-promise'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xf365,0x1a0));var _0x5f36=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0xf365[_0x17249c];return _0x324e7b;};'use strict';var _=require(_0x5f36('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f36('0x1'));var moment=require('moment');var BPromise=require(_0x5f36('0x2'));var rp=require(_0x5f36('0x3'));var fs=require('fs');var path=require(_0x5f36('0x4'));var rimraf=require(_0x5f36('0x5'));var config=require(_0x5f36('0x6'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0xe0f49e,_0x29bf2d){return _0xe0f49e[_0x5f36('0x7')](_0x5f36('0x8'),attributes,{'tableName':_0x5f36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a698e,_0x3c1776,_0x43d67e){if(_0x5a698e[_0x5f36('0xa')](_0x5f36('0xb'))){_0x5a698e[_0x5f36('0xc')]=moment()['format'](_0x5f36('0xd'));}_0x43d67e(null,_0x5a698e);}}});}; \ No newline at end of file +var _0x752a=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x752a,0x109));var _0xa752=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x752a[_0x3e25c1];return _0x52e7f2;};'use strict';var _=require('lodash');var util=require(_0xa752('0x0'));var logger=require(_0xa752('0x1'))(_0xa752('0x2'));var moment=require(_0xa752('0x3'));var BPromise=require('bluebird');var rp=require(_0xa752('0x4'));var fs=require('fs');var path=require(_0xa752('0x5'));var rimraf=require(_0xa752('0x6'));var config=require(_0xa752('0x7'));var attributes=require(_0xa752('0x8'));module[_0xa752('0x9')]=function(_0x3f8802,_0x4233f8){return _0x3f8802[_0xa752('0xa')](_0xa752('0xb'),attributes,{'tableName':_0xa752('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1659a0,_0x4e7d7d,_0x46d195){if(_0x1659a0[_0xa752('0xd')]('closed')){_0x1659a0[_0xa752('0xe')]=moment()[_0xa752('0xf')](_0xa752('0x10'));}_0x46d195(null,_0x1659a0);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ae57a20..d682b28 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 _0xfc25=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x39b634,_0x205c0b){var _0x1e17cc=function(_0x482269){while(--_0x482269){_0x39b634['push'](_0x39b634['shift']());}};_0x1e17cc(++_0x205c0b);}(_0xfc25,0x67));var _0x5fc2=function(_0x21a055,_0x4b2849){_0x21a055=_0x21a055-0x0;var _0x394416=_0xfc25[_0x21a055];return _0x394416;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5fc2('0x0'));var BPromise=require(_0x5fc2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fc2('0x2'));var db=require(_0x5fc2('0x3'))['db'];var utils=require(_0x5fc2('0x4'));var logger=require(_0x5fc2('0x5'))(_0x5fc2('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fc2('0x7'));var client=jayson[_0x5fc2('0x8')][_0x5fc2('0x9')]({'port':0x232a});config[_0x5fc2('0xa')]=_['defaults'](config['redis'],{'host':_0x5fc2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5fc2('0xc'))[_0x5fc2('0xd')](socket);function respondWithRpcPromise(_0x278c9a,_0x3249d5,_0x401568){return new BPromise(function(_0x3b66f7,_0x4aa63f){return client[_0x5fc2('0xe')](_0x278c9a,_0x401568)[_0x5fc2('0xf')](function(_0x134cac){logger[_0x5fc2('0x10')](_0x5fc2('0x11'),_0x3249d5,_0x5fc2('0x12'));logger[_0x5fc2('0x13')](_0x5fc2('0x14'),_0x3249d5,'request\x20sent',JSON['stringify'](_0x134cac));if(_0x134cac[_0x5fc2('0x15')]){if(_0x134cac[_0x5fc2('0x15')][_0x5fc2('0x16')]===0x1f4){logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x134cac['error']['message']);return _0x4aa63f(_0x134cac['error'][_0x5fc2('0x17')]);}logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x134cac[_0x5fc2('0x15')][_0x5fc2('0x17')]);return _0x3b66f7(_0x134cac['error']['message']);}else{logger[_0x5fc2('0x10')](_0x5fc2('0x11'),_0x3249d5,_0x5fc2('0x12'));_0x3b66f7(_0x134cac[_0x5fc2('0x18')][_0x5fc2('0x17')]);}})[_0x5fc2('0x19')](function(_0x4ad411){logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x4ad411);_0x4aa63f(_0x4ad411);});});}exports[_0x5fc2('0x1a')]=function(_0x1d1c64){var _0x10f7e8=this;return new Promise(function(_0x302537,_0x3ebd50){return db[_0x5fc2('0x1b')][_0x5fc2('0x1c')](_0x1d1c64[_0x5fc2('0x1d')],{'raw':_0x1d1c64['options']?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1c64['options']?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x20')]||null:null,'attributes':_0x1d1c64[_0x5fc2('0x1e')]?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x21')]||null:null,'limit':_0x1d1c64[_0x5fc2('0x1e')]?_0x1d1c64['options'][_0x5fc2('0x22')]||null:null})[_0x5fc2('0xf')](function(_0x1f7f68){logger[_0x5fc2('0x10')](_0x5fc2('0x1a'),_0x1d1c64);logger[_0x5fc2('0x13')](_0x5fc2('0x1a'),_0x1d1c64,JSON[_0x5fc2('0x23')](_0x1f7f68));_0x302537(_0x1f7f68);})['catch'](function(_0x2a858d){logger[_0x5fc2('0x15')]('UpdateFaxInteraction',_0x2a858d['message'],_0x1d1c64);_0x3ebd50(_0x10f7e8[_0x5fc2('0x15')](0x1f4,_0x2a858d[_0x5fc2('0x17')]));});});};exports[_0x5fc2('0x24')]=function(_0x158258){return new Promise(function(_0x37244d,_0x4daec9){return db[_0x5fc2('0x1b')][_0x5fc2('0x25')]({'where':_0x158258[_0x5fc2('0x1e')]?_0x158258[_0x5fc2('0x1e')][_0x5fc2('0x20')]||null:null})['then'](function(_0x272e3a){if(_0x272e3a){return _0x272e3a[_0x5fc2('0x26')](_0x158258['body'][_0x5fc2('0x27')],_[_0x5fc2('0x28')](_0x158258[_0x5fc2('0x1d')],[_0x5fc2('0x27'),'id'])||{});}})[_0x5fc2('0x29')](function(_0x3c9c22){logger[_0x5fc2('0x10')](_0x5fc2('0x2a'),_0x158258);logger[_0x5fc2('0x13')](_0x5fc2('0x2a'),_0x158258,JSON[_0x5fc2('0x23')](_0x3c9c22));_0x37244d(_0x3c9c22);})['catch'](function(_0x5c268f){logger[_0x5fc2('0x15')](_0x5fc2('0x2a'),_0x5c268f[_0x5fc2('0x17')],_0x158258);_0x4daec9(_this[_0x5fc2('0x15')](0x1f4,_0x5c268f[_0x5fc2('0x17')]));});});}; \ No newline at end of file +var _0x02b9=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x02b9,0x1e3));var _0x902b=function(_0x4a3960,_0x229ff7){_0x4a3960=_0x4a3960-0x0;var _0x48f79c=_0x02b9[_0x4a3960];return _0x48f79c;};'use strict';var _=require(_0x902b('0x0'));var util=require(_0x902b('0x1'));var moment=require(_0x902b('0x2'));var BPromise=require(_0x902b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x902b('0x4'));var db=require(_0x902b('0x5'))['db'];var utils=require(_0x902b('0x6'));var logger=require(_0x902b('0x7'))(_0x902b('0x8'));var config=require(_0x902b('0x9'));var jayson=require(_0x902b('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x902b('0xb')]=_[_0x902b('0xc')](config['redis'],{'host':_0x902b('0xd'),'port':0x18eb});var socket=require(_0x902b('0xe'))(new Redis(config[_0x902b('0xb')]));require(_0x902b('0xf'))[_0x902b('0x10')](socket);function respondWithRpcPromise(_0x3f3d32,_0x341b37,_0x18a754){return new BPromise(function(_0x24946b,_0x1b5b8b){return client[_0x902b('0x11')](_0x3f3d32,_0x18a754)[_0x902b('0x12')](function(_0x38e7cb){logger[_0x902b('0x13')](_0x902b('0x14'),_0x341b37,_0x902b('0x15'));logger[_0x902b('0x16')](_0x902b('0x17'),_0x341b37,_0x902b('0x15'),JSON[_0x902b('0x18')](_0x38e7cb));if(_0x38e7cb[_0x902b('0x19')]){if(_0x38e7cb[_0x902b('0x19')][_0x902b('0x1a')]===0x1f4){logger[_0x902b('0x19')](_0x902b('0x14'),_0x341b37,_0x38e7cb['error'][_0x902b('0x1b')]);return _0x1b5b8b(_0x38e7cb[_0x902b('0x19')]['message']);}logger[_0x902b('0x19')](_0x902b('0x14'),_0x341b37,_0x38e7cb[_0x902b('0x19')][_0x902b('0x1b')]);return _0x24946b(_0x38e7cb['error']['message']);}else{logger[_0x902b('0x13')](_0x902b('0x14'),_0x341b37,_0x902b('0x15'));_0x24946b(_0x38e7cb[_0x902b('0x1c')][_0x902b('0x1b')]);}})[_0x902b('0x1d')](function(_0x1ad88c){logger[_0x902b('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x341b37,_0x1ad88c);_0x1b5b8b(_0x1ad88c);});});}exports[_0x902b('0x1e')]=function(_0x565def){var _0x4e8ab4=this;return new Promise(function(_0x444384,_0x3ddcad){return db[_0x902b('0x1f')][_0x902b('0x20')](_0x565def[_0x902b('0x21')],{'raw':_0x565def[_0x902b('0x22')]?_0x565def[_0x902b('0x22')][_0x902b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565def[_0x902b('0x22')]?_0x565def[_0x902b('0x22')]['where']||null:null,'attributes':_0x565def[_0x902b('0x22')]?_0x565def[_0x902b('0x22')][_0x902b('0x24')]||null:null,'limit':_0x565def['options']?_0x565def['options'][_0x902b('0x25')]||null:null})[_0x902b('0x12')](function(_0x241b5f){logger[_0x902b('0x13')](_0x902b('0x1e'),_0x565def);logger[_0x902b('0x16')](_0x902b('0x1e'),_0x565def,JSON[_0x902b('0x18')](_0x241b5f));_0x444384(_0x241b5f);})[_0x902b('0x1d')](function(_0x529248){logger[_0x902b('0x19')](_0x902b('0x1e'),_0x529248[_0x902b('0x1b')],_0x565def);_0x3ddcad(_0x4e8ab4[_0x902b('0x19')](0x1f4,_0x529248[_0x902b('0x1b')]));});});};exports[_0x902b('0x26')]=function(_0x3ddec7){return new Promise(function(_0x349bac,_0x46225e){return db['FaxInteraction'][_0x902b('0x27')]({'where':_0x3ddec7['options']?_0x3ddec7[_0x902b('0x22')][_0x902b('0x28')]||null:null})[_0x902b('0x12')](function(_0x3055ed){if(_0x3055ed){return _0x3055ed[_0x902b('0x29')](_0x3ddec7[_0x902b('0x21')][_0x902b('0x2a')],_[_0x902b('0x2b')](_0x3ddec7['body'],['ids','id'])||{});}})[_0x902b('0x2c')](function(_0x22b517){logger['info'](_0x902b('0x2d'),_0x3ddec7);logger[_0x902b('0x16')](_0x902b('0x2d'),_0x3ddec7,JSON[_0x902b('0x18')](_0x22b517));_0x349bac(_0x22b517);})[_0x902b('0x1d')](function(_0x3af80b){logger[_0x902b('0x19')](_0x902b('0x2d'),_0x3af80b[_0x902b('0x1b')],_0x3ddec7);_0x46225e(_this[_0x902b('0x19')](0x1f4,_0x3af80b[_0x902b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b70cdba..aabfa2a 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 _0x7c95=['./faxInteraction.events','save','remove','update','emit','removeListener','length','faxInteraction:'];(function(_0x11c3c0,_0x13d09e){var _0x584eb0=function(_0x3a5274){while(--_0x3a5274){_0x11c3c0['push'](_0x11c3c0['shift']());}};_0x584eb0(++_0x13d09e);}(_0x7c95,0x160));var _0x57c9=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7c95[_0x2dadb9];return _0x2f0097;};'use strict';var FaxInteractionEvents=require(_0x57c9('0x0'));var events=[_0x57c9('0x1'),_0x57c9('0x2'),_0x57c9('0x3')];function createListener(_0x39277d,_0x164d2c){return function(_0x399b57){_0x164d2c[_0x57c9('0x4')](_0x39277d,_0x399b57);};}function removeListener(_0x589028,_0x2c031e){return function(){FaxInteractionEvents[_0x57c9('0x5')](_0x589028,_0x2c031e);};}exports['register']=function(_0x342684){for(var _0x440e30=0x0,_0x2a1074=events[_0x57c9('0x6')];_0x440e30<_0x2a1074;_0x440e30++){var _0x3c5a13=events[_0x440e30];var _0x252385=createListener(_0x57c9('0x7')+_0x3c5a13,_0x342684);FaxInteractionEvents['on'](_0x3c5a13,_0x252385);}}; \ No newline at end of file +var _0xbc3b=['save','remove','update','removeListener','register','faxInteraction:','./faxInteraction.events'];(function(_0x1e4e28,_0x194366){var _0x49b11c=function(_0x5d39a1){while(--_0x5d39a1){_0x1e4e28['push'](_0x1e4e28['shift']());}};_0x49b11c(++_0x194366);}(_0xbc3b,0x179));var _0xbbc3=function(_0x373ba3,_0x265ccc){_0x373ba3=_0x373ba3-0x0;var _0x151f21=_0xbc3b[_0x373ba3];return _0x151f21;};'use strict';var FaxInteractionEvents=require(_0xbbc3('0x0'));var events=[_0xbbc3('0x1'),_0xbbc3('0x2'),_0xbbc3('0x3')];function createListener(_0x193f57,_0xfd7de5){return function(_0x1e7a93){_0xfd7de5['emit'](_0x193f57,_0x1e7a93);};}function removeListener(_0x5a4025,_0x3bcb90){return function(){FaxInteractionEvents[_0xbbc3('0x4')](_0x5a4025,_0x3bcb90);};}exports[_0xbbc3('0x5')]=function(_0x2b979a){for(var _0x51d5e9=0x0,_0x153b5c=events['length'];_0x51d5e9<_0x153b5c;_0x51d5e9++){var _0x2bd7a5=events[_0x51d5e9];var _0x39e41a=createListener(_0xbbc3('0x6')+_0x2bd7a5,_0x2b979a);FaxInteractionEvents['on'](_0x2bd7a5,_0x39e41a);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b6973bd..e6fa794 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 _0x0002=['Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','create','/:id/messages','addMessage','post','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','/:id/tags','removeTags','exports','util','connect-timeout','express'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0x0002,0x8e));var _0x2000=function(_0x109839,_0x34aed1){_0x109839=_0x109839-0x0;var _0x18c491=_0x0002[_0x109839];return _0x18c491;};'use strict';var multer=require('multer');var util=require(_0x2000('0x0'));var path=require('path');var timeout=require(_0x2000('0x1'));var express=require(_0x2000('0x2'));var router=express[_0x2000('0x3')]();var fs_extra=require(_0x2000('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2000('0x5'));var config=require('../../config/environment');var controller=require(_0x2000('0x6'));router[_0x2000('0x7')]('/',auth[_0x2000('0x8')](),controller[_0x2000('0x9')]);router['get'](_0x2000('0xa'),auth['isAuthenticated'](),controller[_0x2000('0xb')]);router[_0x2000('0x7')]('/:id',auth[_0x2000('0x8')](),controller[_0x2000('0xc')]);router['get']('/:id/messages',auth[_0x2000('0x8')](),controller[_0x2000('0xd')]);router[_0x2000('0x7')](_0x2000('0xe'),auth[_0x2000('0x8')](),controller['download']);router['post']('/',auth[_0x2000('0x8')](),controller[_0x2000('0xf')]);router['post'](_0x2000('0x10'),auth[_0x2000('0x8')](),controller[_0x2000('0x11')]);router[_0x2000('0x12')]('/:id/tags',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')](_0x2000('0x14'),_0x2000('0x15')),controller[_0x2000('0x16')]);router['put']('/:id',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')](_0x2000('0x14'),'faxinteraction:update'),controller[_0x2000('0x17')]);router[_0x2000('0x18')]('/:id',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')]('fax',_0x2000('0x19')),controller['destroy']);router[_0x2000('0x18')](_0x2000('0x1a'),auth[_0x2000('0x8')](),controller[_0x2000('0x1b')]);module[_0x2000('0x1c')]=router; \ No newline at end of file +var _0x80b9=['./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','download','create','post','addMessage','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','faxinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x80b9,0x8e));var _0x980b=function(_0x3c8277,_0x426041){_0x3c8277=_0x3c8277-0x0;var _0x40765b=_0x80b9[_0x3c8277];return _0x40765b;};'use strict';var multer=require(_0x980b('0x0'));var util=require(_0x980b('0x1'));var path=require(_0x980b('0x2'));var timeout=require(_0x980b('0x3'));var express=require('express');var router=express[_0x980b('0x4')]();var fs_extra=require(_0x980b('0x5'));var auth=require(_0x980b('0x6'));var interaction=require(_0x980b('0x7'));var config=require('../../config/environment');var controller=require(_0x980b('0x8'));router[_0x980b('0x9')]('/',auth[_0x980b('0xa')](),controller[_0x980b('0xb')]);router['get']('/describe',auth[_0x980b('0xa')](),controller[_0x980b('0xc')]);router[_0x980b('0x9')](_0x980b('0xd'),auth[_0x980b('0xa')](),controller[_0x980b('0xe')]);router['get']('/:id/messages',auth[_0x980b('0xa')](),controller[_0x980b('0xf')]);router[_0x980b('0x9')]('/:id/download',auth[_0x980b('0xa')](),controller[_0x980b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x980b('0x11')]);router[_0x980b('0x12')]('/:id/messages',auth[_0x980b('0xa')](),controller[_0x980b('0x13')]);router[_0x980b('0x12')]('/:id/tags',auth[_0x980b('0xa')](),interaction[_0x980b('0x14')]('fax',_0x980b('0x15')),controller[_0x980b('0x16')]);router[_0x980b('0x17')]('/:id',auth[_0x980b('0xa')](),interaction['tracked'](_0x980b('0x18'),_0x980b('0x19')),controller['update']);router['delete'](_0x980b('0xd'),auth['isAuthenticated'](),interaction['tracked']('fax',_0x980b('0x1a')),controller['destroy']);router[_0x980b('0x1b')]('/:id/tags',auth[_0x980b('0xa')](),controller[_0x980b('0x1c')]);module[_0x980b('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 cf33f03..4e5d1c0 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 _0xe0c3=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x40aada,_0x102460){var _0x503f78=function(_0x21ccfa){while(--_0x21ccfa){_0x40aada['push'](_0x40aada['shift']());}};_0x503f78(++_0x102460);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3e0c('0x0'));module['exports']={'body':{'type':Sequelize[_0x3e0c('0x1')](_0x3e0c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e0c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e0c('0x4')]('in',_0x3e0c('0x5')),'defaultValue':_0x3e0c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3e0c('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3e0c('0x6')]}}; \ No newline at end of file +var _0x81bd=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x81bd,0x7c));var _0xd81b=function(_0x2b43ba,_0x3510f1){_0x2b43ba=_0x2b43ba-0x0;var _0x26d41e=_0x81bd[_0x2b43ba];return _0x26d41e;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'body':{'type':Sequelize[_0xd81b('0x2')](_0xd81b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd81b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd81b('0x5')]('in',_0xd81b('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xd81b('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd81b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 9c0613a..3284cbe 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 _0xc34e=['agent','get','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','fullname','internal','motionChannel','rejectmessage','create','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','rows','show','params','body','find','describe','fax-interactions','fax','read','readAt','format','UserId'];(function(_0x1b2a09,_0x2d2258){var _0x5bd49d=function(_0x4d30a7){while(--_0x4d30a7){_0x1b2a09['push'](_0x1b2a09['shift']());}};_0x5bd49d(++_0x2d2258);}(_0xc34e,0x149));var _0xec34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xec34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec34('0x1'));var jsonpatch=require(_0xec34('0x2'));var rp=require(_0xec34('0x3'));var moment=require(_0xec34('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec34('0x5'));var util=require(_0xec34('0x6'));var path=require(_0xec34('0x7'));var sox=require(_0xec34('0x8'));var csv=require(_0xec34('0x9'));var ejs=require(_0xec34('0xa'));var fs=require('fs');var fs_extra=require(_0xec34('0xb'));var _=require('lodash');var squel=require(_0xec34('0xc'));var crypto=require(_0xec34('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec34('0xe'));var toCsv=require(_0xec34('0x9'));var querystring=require(_0xec34('0xf'));var Papa=require('papaparse');var Redis=require(_0xec34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xec34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec34('0x12'));var logger=require(_0xec34('0x13'))('api');var utils=require(_0xec34('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xec34('0x15'));var db=require(_0xec34('0x16'))['db'];config[_0xec34('0x17')]=_[_0xec34('0x18')](config['redis'],{'host':_0xec34('0x19'),'port':0x18eb});var socket=require(_0xec34('0x1a'))(new Redis(config[_0xec34('0x17')]));require(_0xec34('0x1b'))[_0xec34('0x1c')](socket);var jayson=require(_0xec34('0x1d'));var client=jayson[_0xec34('0x1e')][_0xec34('0x1f')]({'port':0x232c});var client9002=jayson[_0xec34('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250aea,_0x15728a,_0x36be41,_0x331954){return new BPromise(function(_0x5e099a,_0x22925d){var _0x13dcf5=_0x331954||client;return _0x13dcf5[_0xec34('0x20')](_0x250aea,_0x36be41)[_0xec34('0x21')](function(_0x499ef5){logger[_0xec34('0x22')](_0xec34('0x23'),_0x15728a,_0xec34('0x24'));logger[_0xec34('0x25')](_0xec34('0x26'),_0x15728a,_0xec34('0x24'),JSON['stringify'](_0x499ef5));if(_0x499ef5[_0xec34('0x27')]){if(_0x499ef5[_0xec34('0x27')][_0xec34('0x28')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x15728a,_0x499ef5[_0xec34('0x27')][_0xec34('0x29')]);return _0x22925d(_0x499ef5[_0xec34('0x27')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x15728a,_0x499ef5[_0xec34('0x27')]['message']);return _0x5e099a(_0x499ef5['error']['message']);}else{logger[_0xec34('0x22')](_0xec34('0x23'),_0x15728a,_0xec34('0x24'));_0x5e099a(_0x499ef5['result'][_0xec34('0x29')]);}})[_0xec34('0x2a')](function(_0x18ba90){logger[_0xec34('0x27')](_0xec34('0x23'),_0x15728a,_0x18ba90);_0x22925d(_0x18ba90);});});}function respondWithStatusCode(_0x1832aa,_0xc749f){_0xc749f=_0xc749f||0xcc;return function(_0x38f66b){if(_0x38f66b){return _0x1832aa[_0xec34('0x2b')](_0xc749f);}return _0x1832aa['status'](_0xc749f)[_0xec34('0x2c')]();};}function respondWithResult(_0x40732f,_0x2a6356){_0x2a6356=_0x2a6356||0xc8;return function(_0x562cf2){if(_0x562cf2){return _0x40732f['status'](_0x2a6356)[_0xec34('0x2d')](_0x562cf2);}};}function respondWithFilteredResult(_0x3898d6,_0x595b03){return function(_0x114de2){if(_0x114de2){var _0x414db4=typeof _0x595b03[_0xec34('0x2e')]==='undefined'&&typeof _0x595b03[_0xec34('0x2f')]===_0xec34('0x30');var _0x4b7d11=_0x114de2[_0xec34('0x31')];var _0x5f35ab=_0x414db4?0x0:_0x595b03[_0xec34('0x2e')];var _0xac283c=_0x414db4?_0x114de2[_0xec34('0x31')]:_0x595b03[_0xec34('0x2e')]+_0x595b03['limit'];var _0x4d512f;if(_0xac283c>=_0x4b7d11){_0xac283c=_0x4b7d11;_0x4d512f=0xc8;}else{_0x4d512f=0xce;}_0x3898d6[_0xec34('0x32')](_0x4d512f);return _0x3898d6[_0xec34('0x33')](_0xec34('0x34'),_0x5f35ab+'-'+_0xac283c+'/'+_0x4b7d11)[_0xec34('0x2d')](_0x114de2);}return null;};}function patchUpdates(_0x205e5c){return function(_0x10e196){try{jsonpatch[_0xec34('0x35')](_0x10e196,_0x205e5c,!![]);}catch(_0x23469c){return BPromise[_0xec34('0x36')](_0x23469c);}return _0x10e196[_0xec34('0x37')]();};}function saveUpdates(_0x500cae,_0x4b8de2){return function(_0x2f919a){if(_0x2f919a){return _0x2f919a[_0xec34('0x38')](_0x500cae)[_0xec34('0x21')](function(_0x4fbe8f){return _0x4fbe8f;});}return null;};}function removeEntity(_0x31cd23,_0x48fbdc){return function(_0x53302b){if(_0x53302b){return _0x53302b[_0xec34('0x39')]()['then'](function(){_0x31cd23['status'](0xcc)[_0xec34('0x2c')]();});}};}function handleEntityNotFound(_0x53d9c0,_0x38eed5){return function(_0x3c936d){if(!_0x3c936d){_0x53d9c0[_0xec34('0x2b')](0x194);}return _0x3c936d;};}function handleError(_0x2d9755,_0x241f6b){_0x241f6b=_0x241f6b||0x1f4;return function(_0x3977cc){logger[_0xec34('0x27')](_0x3977cc[_0xec34('0x3a')]);if(_0x3977cc[_0xec34('0x3b')]){delete _0x3977cc['name'];}_0x2d9755['status'](_0x241f6b)['send'](_0x3977cc);};}exports[_0xec34('0x3c')]=function(_0x2c9570,_0x59a44d){var _0x4c31fe={},_0x52edba={},_0x7a3bbc={'count':0x0,'rows':[]};var _0x3f79e=_[_0xec34('0x3d')](db['FaxMessage'][_0xec34('0x3e')],function(_0x4ea0f9){return{'name':_0x4ea0f9[_0xec34('0x3f')],'type':_0x4ea0f9[_0xec34('0x40')]['key']};});_0x52edba['model']=_[_0xec34('0x3d')](_0x3f79e,_0xec34('0x3b'));_0x52edba[_0xec34('0x41')]=_[_0xec34('0x42')](_0x2c9570['query']);_0x52edba['filters']=_[_0xec34('0x43')](_0x52edba['model'],_0x52edba['query']);_0x4c31fe[_0xec34('0x44')]=_[_0xec34('0x43')](_0x52edba[_0xec34('0x45')],qs[_0xec34('0x46')](_0x2c9570[_0xec34('0x41')]['fields']));_0x4c31fe[_0xec34('0x44')]=_0x4c31fe[_0xec34('0x44')]['length']?_0x4c31fe[_0xec34('0x44')]:_0x52edba[_0xec34('0x45')];if(!_0x2c9570['query'][_0xec34('0x47')](_0xec34('0x48'))){_0x4c31fe[_0xec34('0x2f')]=qs[_0xec34('0x2f')](_0x2c9570[_0xec34('0x41')][_0xec34('0x2f')]);_0x4c31fe['offset']=qs[_0xec34('0x2e')](_0x2c9570[_0xec34('0x41')]['offset']);}_0x4c31fe['order']=qs[_0xec34('0x49')](_0x2c9570[_0xec34('0x41')][_0xec34('0x49')]);_0x4c31fe[_0xec34('0x4a')]=qs['filters'](_[_0xec34('0x4b')](_0x2c9570[_0xec34('0x41')],_0x52edba[_0xec34('0x4c')]),_0x3f79e);if(_0x2c9570[_0xec34('0x41')]['filter']){_0x4c31fe[_0xec34('0x4a')]=_[_0xec34('0x4d')](_0x4c31fe[_0xec34('0x4a')],{'$or':_[_0xec34('0x3d')](_0x3f79e,function(_0x2cff39){if(_0x2cff39[_0xec34('0x40')]!==_0xec34('0x4e')){var _0x14b54f={};_0x14b54f[_0x2cff39[_0xec34('0x3b')]]={'$like':'%'+_0x2c9570[_0xec34('0x41')][_0xec34('0x4f')]+'%'};return _0x14b54f;}})});}_0x4c31fe=_[_0xec34('0x4d')]({},_0x4c31fe,_0x2c9570[_0xec34('0x50')]);var _0x5384cc={'where':_0x4c31fe[_0xec34('0x4a')]};return db[_0xec34('0x51')][_0xec34('0x31')](_0x5384cc)[_0xec34('0x21')](function(_0x3860d1){_0x7a3bbc[_0xec34('0x31')]=_0x3860d1;if(_0x2c9570[_0xec34('0x41')][_0xec34('0x52')]){_0x4c31fe[_0xec34('0x53')]=[{'all':!![]}];}return db[_0xec34('0x51')][_0xec34('0x54')](_0x4c31fe);})[_0xec34('0x21')](function(_0x32be4c){_0x7a3bbc[_0xec34('0x55')]=_0x32be4c;return _0x7a3bbc;})[_0xec34('0x21')](respondWithFilteredResult(_0x59a44d,_0x4c31fe))['catch'](handleError(_0x59a44d,null));};exports[_0xec34('0x56')]=function(_0x4cfd60,_0x25032f){var _0x3b97a5={'raw':!![],'where':{'id':_0x4cfd60[_0xec34('0x57')]['id']}},_0x52e097={};_0x52e097[_0xec34('0x45')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x52e097[_0xec34('0x41')]=_[_0xec34('0x42')](_0x4cfd60[_0xec34('0x41')]);_0x52e097[_0xec34('0x4c')]=_['intersection'](_0x52e097['model'],_0x52e097['query']);_0x3b97a5[_0xec34('0x44')]=_[_0xec34('0x43')](_0x52e097[_0xec34('0x45')],qs[_0xec34('0x46')](_0x4cfd60[_0xec34('0x41')][_0xec34('0x46')]));_0x3b97a5['attributes']=_0x3b97a5[_0xec34('0x44')]['length']?_0x3b97a5['attributes']:_0x52e097['model'];if(_0x4cfd60['query']['includeAll']){_0x3b97a5['include']=[{'all':!![]}];}_0x3b97a5=_[_0xec34('0x4d')]({},_0x3b97a5,_0x4cfd60[_0xec34('0x50')]);return db[_0xec34('0x51')]['find'](_0x3b97a5)[_0xec34('0x21')](handleEntityNotFound(_0x25032f,null))['then'](respondWithResult(_0x25032f,null))[_0xec34('0x2a')](handleError(_0x25032f,null));};exports[_0xec34('0x38')]=function(_0x414786,_0x1f8338){if(_0x414786[_0xec34('0x58')]['id']){delete _0x414786['body']['id'];}return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x414786[_0xec34('0x57')]['id']}})[_0xec34('0x21')](handleEntityNotFound(_0x1f8338,null))[_0xec34('0x21')](saveUpdates(_0x414786[_0xec34('0x58')],null))[_0xec34('0x21')](respondWithResult(_0x1f8338,null))[_0xec34('0x2a')](handleError(_0x1f8338,null));};exports['destroy']=function(_0x1732e5,_0x32d39a){return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x1732e5[_0xec34('0x57')]['id']}})[_0xec34('0x21')](handleEntityNotFound(_0x32d39a,null))[_0xec34('0x21')](removeEntity(_0x32d39a,null))['catch'](handleError(_0x32d39a,null));};exports[_0xec34('0x5a')]=function(_0xec5833,_0x104266){return db['FaxMessage'][_0xec34('0x5a')]()[_0xec34('0x21')](respondWithResult(_0x104266,null))[_0xec34('0x2a')](handleError(_0x104266,null));};var interaction_log=require('../../config/logger')(_0xec34('0x5b'));exports['accept']=function(_0x35422b,_0x4121b6,_0x49d664){var _0x39e846={'agent':{},'channel':_0xec34('0x5c')};if(_0x35422b['body']['id']){delete _0x35422b[_0xec34('0x58')]['id'];}_0x35422b[_0xec34('0x58')][_0xec34('0x5d')]=!![];_0x35422b[_0xec34('0x58')][_0xec34('0x5e')]=moment()[_0xec34('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x35422b[_0xec34('0x58')]['UserId']=_0x35422b[_0xec34('0x58')][_0xec34('0x60')]||_0x35422b['user']['id'];_0x39e846[_0xec34('0x61')]['id']=_0x35422b[_0xec34('0x58')][_0xec34('0x60')];return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x35422b['params']['id'],'UserId':null}})[_0xec34('0x21')](handleEntityNotFound(_0x4121b6,null))['then'](saveUpdates(_0x35422b[_0xec34('0x58')],null))[_0xec34('0x21')](function(_0x59bdeb){if(_0x59bdeb){_0x39e846['message']=_0x59bdeb[_0xec34('0x62')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x59bdeb[_0xec34('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4121b6,null))[_0xec34('0x21')](function(_0x460b59){if(_0x460b59){return _0x460b59[_0xec34('0x38')]({'UserId':_0x35422b[_0xec34('0x58')][_0xec34('0x60')],'read1stAt':_[_0xec34('0x64')](_0x460b59[_0xec34('0x65')])?moment()[_0xec34('0x5f')](_0xec34('0x66')):undefined});}return null;})[_0xec34('0x21')](function(_0x30853b){if(_0x30853b){_0x39e846['interaction']=_0x30853b[_0xec34('0x62')]({'plain':!![]});interaction_log[_0xec34('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35422b[_0xec34('0x67')]['id'],_0x35422b[_0xec34('0x67')][_0xec34('0x3b')],_0x35422b[_0xec34('0x67')][_0xec34('0x68')],_0x39e846[_0xec34('0x69')]['id'],_0x35422b['body']?JSON['stringify'](_0x35422b[_0xec34('0x58')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x39e846);}return null;})[_0xec34('0x21')](function(_0x55ad6f){var _0x2dbf46=_0xec34('0x6a')+_0x55ad6f[_0xec34('0x29')][_0xec34('0x6b')];return db[_0xec34('0x6c')]['query'](_0x2dbf46,{'type':db[_0xec34('0x6d')][_0xec34('0x6e')][_0xec34('0x6f')],'raw':!![]})[_0xec34('0x21')](function(_0x2111f9){return _0x2111f9;});})[_0xec34('0x21')](function(_0x1cac5c){if(_0x1cac5c){_0x39e846[_0xec34('0x29')]['contact']=_0x1cac5c[0x0];if(!_0x35422b[_0xec34('0x58')][_0xec34('0x60')])return;return db[_0xec34('0x70')][_0xec34('0x59')]({'where':{'id':_0x35422b[_0xec34('0x58')][_0xec34('0x60')],'role':_0xec34('0x61')},'attributes':['id',_0xec34('0x3b'),'fullname',_0xec34('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x398b62){if(!_0x398b62)return null;_0x39e846['message']['agent']=_0x398b62;return _0x39e846;})[_0xec34('0x21')](function(_0x242f2b){if(_0x242f2b){if(_0x35422b[_0xec34('0x58')]['manual']){_0x39e846[_0xec34('0x29')][_0xec34('0x72')]=util['format'](_0xec34('0x73'),_0x35422b[_0xec34('0x67')][_0xec34('0x3b')]);_0x39e846[_0xec34('0x29')]['channel']=_0x39e846['channel'];_0x39e846[_0xec34('0x29')]['motionChannel']=_0x39e846[_0xec34('0x74')];_0x39e846[_0xec34('0x29')][_0xec34('0x75')]=_0xec34('0x76');return respondWithRpcPromise(_0xec34('0x77'),'EventManager',{'event':_0xec34('0x78'),'message':_0x39e846[_0xec34('0x29')]},client9002)[_0xec34('0x21')](function(){return _0x39e846;});}return _0x39e846;}return null;})[_0xec34('0x21')](respondWithResult(_0x4121b6,null))['catch'](handleError(_0x4121b6,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xec34('0x36')]=function(_0xf48e59,_0x1eb952,_0x1117f6){var _0x3a2d7d={'agent':{},'channel':'fax'};if(_0xf48e59[_0xec34('0x58')]['id']){delete _0xf48e59[_0xec34('0x58')]['id'];}_0xf48e59[_0xec34('0x58')][_0xec34('0x60')]=_0xf48e59[_0xec34('0x58')][_0xec34('0x60')]||_0xf48e59['user']['id'];_0x3a2d7d[_0xec34('0x61')]['id']=_0xf48e59['body']['UserId'];return db['FaxMessage'][_0xec34('0x59')]({'where':{'id':_0xf48e59[_0xec34('0x57')]['id'],'UserId':null}})[_0xec34('0x21')](handleEntityNotFound(_0x1eb952,null))[_0xec34('0x21')](function(_0x21b052){if(_0x21b052){_0x3a2d7d[_0xec34('0x29')]=_0x21b052[_0xec34('0x62')]({'plain':!![]});return db[_0xec34('0x79')]['find']({'where':{'id':_0x21b052['FaxInteractionId']}});}return null;})[_0xec34('0x21')](handleEntityNotFound(_0x1eb952,null))['then'](function(_0x263846){if(_0x263846){_0x3a2d7d[_0xec34('0x69')]=_0x263846['get']({'plain':!![]});interaction_log[_0xec34('0x22')](_0xec34('0x7a'),_0xf48e59[_0xec34('0x67')]['id'],_0xf48e59[_0xec34('0x67')]['name'],_0xf48e59[_0xec34('0x67')][_0xec34('0x68')],_0x3a2d7d['interaction']['id'],_0xf48e59[_0xec34('0x58')]?JSON[_0xec34('0x7b')](_0xf48e59[_0xec34('0x58')]):_0xec34('0x7c'));return respondWithRpcPromise(_0xec34('0x7d'),_0xec34('0x7e'),_0x3a2d7d);}return null;})[_0xec34('0x21')](function(_0x4f918a){var _0x31c55d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f918a[_0xec34('0x29')][_0xec34('0x6b')];return db['sequelize'][_0xec34('0x41')](_0x31c55d,{'type':db['Sequelize'][_0xec34('0x6e')][_0xec34('0x6f')],'raw':!![]})[_0xec34('0x21')](function(_0x13eb62){return _0x13eb62;});})[_0xec34('0x21')](function(_0x2933de){if(_0x2933de){_0x3a2d7d['message']['contact']=_0x2933de[0x0];if(!_0xf48e59[_0xec34('0x58')][_0xec34('0x60')])return;return db[_0xec34('0x70')][_0xec34('0x59')]({'where':{'id':_0xf48e59[_0xec34('0x58')][_0xec34('0x60')],'role':'agent'},'attributes':['id',_0xec34('0x3b'),_0xec34('0x7f'),_0xec34('0x71'),_0xec34('0x80')],'raw':!![]});}return null;})[_0xec34('0x21')](function(_0x3f4f61){if(!_0x3f4f61)return null;_0x3a2d7d[_0xec34('0x29')][_0xec34('0x61')]=_0x3f4f61;return _0x3a2d7d;})['then'](function(_0x2e1cbc){if(_0x2e1cbc){_0x2e1cbc[_0xec34('0x29')]['interface']=util[_0xec34('0x5f')](_0xec34('0x73'),_0xf48e59[_0xec34('0x67')][_0xec34('0x3b')]);_0x2e1cbc[_0xec34('0x29')][_0xec34('0x74')]=_0x3a2d7d[_0xec34('0x74')];_0x2e1cbc[_0xec34('0x29')][_0xec34('0x81')]=_0x3a2d7d[_0xec34('0x74')];_0x2e1cbc['message'][_0xec34('0x75')]=_0xec34('0x36');respondWithRpcPromise(_0xec34('0x77'),_0xec34('0x77'),{'event':_0xec34('0x82'),'message':_0x2e1cbc[_0xec34('0x29')]},client9002);return _0x3a2d7d;}return null;})['then'](respondWithResult(_0x1eb952,null))[_0xec34('0x2a')](handleError(_0x1eb952,null));};exports[_0xec34('0x83')]=function(_0x49f343,_0x54d52d){var _0x11ccfb;return db[_0xec34('0x51')][_0xec34('0x83')](_0x49f343[_0xec34('0x58')],{})['then'](function(_0x5cbb60){_0x11ccfb=_0x5cbb60;return db['CmContact']['findOne']({'where':{'id':_0x11ccfb[_0xec34('0x6b')]}});})[_0xec34('0x21')](function(_0x280fb2){if(_['isNil'](_0x280fb2)){return;}else{_0x11ccfb[_0xec34('0x5c')]=_0x280fb2[_0xec34('0x5c')];return db[_0xec34('0x84')]['findOne']({'where':{'id':_0x11ccfb[_0xec34('0x85')]}});}})[_0xec34('0x21')](function(_0x49b454){return respondWithRpcPromise(_0xec34('0x86'),'SendFax',{'FaxAccountId':_[_0xec34('0x64')](_0x49f343[_0xec34('0x58')])?undefined:_0x49f343[_0xec34('0x58')]['FaxAccountId'],'path':_[_0xec34('0x64')](_0x49b454)?undefined:util[_0xec34('0x5f')](_0xec34('0x87'),_0x49b454['basename']),'fax':_['isNil'](_0x11ccfb[_0xec34('0x5c')])?undefined:_0x11ccfb[_0xec34('0x5c')],'AttachmentId':_0x11ccfb[_0xec34('0x85')]},client9002);})[_0xec34('0x21')](respondWithResult(_0x54d52d,0xc9))[_0xec34('0x2a')](handleError(_0x54d52d,null));};exports['download']=function(_0x5d621f,_0x3293c5){var _0x311c96=path[_0xec34('0x88')](config[_0xec34('0x89')],_0xec34('0x8a'),_0xec34('0x8b'),_0xec34('0x8c'));return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x5d621f[_0xec34('0x57')]['id']},'include':[{'model':db[_0xec34('0x84')],'as':'Attachment'}]})[_0xec34('0x21')](handleEntityNotFound(_0x3293c5,null))[_0xec34('0x21')](function(_0x501b2f){if(_0x501b2f){return _0x3293c5['download'](path['join'](_0x311c96,_0x501b2f[_0xec34('0x84')][_0xec34('0x8d')]));}})[_0xec34('0x2a')](handleError(_0x3293c5,null));}; \ No newline at end of file +var _0x2607=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','FaxMessage','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','destroy','describe','fax-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','motionChannel','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x50dd3e,_0x15f898){var _0x366108=function(_0x53e891){while(--_0x53e891){_0x50dd3e['push'](_0x50dd3e['shift']());}};_0x366108(++_0x15f898);}(_0x2607,0x7f));var _0x7260=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x2607[_0x53f37f];return _0x2fe5f8;};'use strict';var emlformat=require(_0x7260('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7260('0x1'));var jsonpatch=require(_0x7260('0x2'));var rp=require(_0x7260('0x3'));var moment=require(_0x7260('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7260('0x5'));var util=require(_0x7260('0x6'));var path=require(_0x7260('0x7'));var sox=require(_0x7260('0x8'));var csv=require(_0x7260('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7260('0xa'));var squel=require(_0x7260('0xb'));var crypto=require(_0x7260('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7260('0x9'));var querystring=require('querystring');var Papa=require(_0x7260('0xd'));var Redis=require(_0x7260('0xe'));var authService=require(_0x7260('0xf'));var qs=require(_0x7260('0x10'));var as=require(_0x7260('0x11'));var hardwareService=require(_0x7260('0x12'));var logger=require(_0x7260('0x13'))(_0x7260('0x14'));var utils=require('../../config/utils');var config=require(_0x7260('0x15'));var licenseUtil=require(_0x7260('0x16'));var db=require(_0x7260('0x17'))['db'];config[_0x7260('0x18')]=_[_0x7260('0x19')](config[_0x7260('0x18')],{'host':_0x7260('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7260('0x18')]));require(_0x7260('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7260('0x1c')][_0x7260('0x1d')]({'port':0x232c});var client9002=jayson[_0x7260('0x1c')][_0x7260('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x31c955,_0x290d3c,_0x32a404,_0x5d43ee){return new BPromise(function(_0x4abf07,_0x2e5b15){var _0x3aa97d=_0x5d43ee||client;return _0x3aa97d[_0x7260('0x1e')](_0x31c955,_0x32a404)['then'](function(_0x5b657f){logger[_0x7260('0x1f')](_0x7260('0x20'),_0x290d3c,_0x7260('0x21'));logger['debug'](_0x7260('0x22'),_0x290d3c,_0x7260('0x21'),JSON[_0x7260('0x23')](_0x5b657f));if(_0x5b657f[_0x7260('0x24')]){if(_0x5b657f[_0x7260('0x24')][_0x7260('0x25')]===0x1f4){logger[_0x7260('0x24')]('FaxMessage,\x20%s,\x20%s',_0x290d3c,_0x5b657f['error']['message']);return _0x2e5b15(_0x5b657f['error'][_0x7260('0x26')]);}logger[_0x7260('0x24')](_0x7260('0x20'),_0x290d3c,_0x5b657f[_0x7260('0x24')][_0x7260('0x26')]);return _0x4abf07(_0x5b657f[_0x7260('0x24')][_0x7260('0x26')]);}else{logger[_0x7260('0x1f')](_0x7260('0x20'),_0x290d3c,_0x7260('0x21'));_0x4abf07(_0x5b657f[_0x7260('0x27')]['message']);}})[_0x7260('0x28')](function(_0x154079){logger[_0x7260('0x24')](_0x7260('0x20'),_0x290d3c,_0x154079);_0x2e5b15(_0x154079);});});}function respondWithStatusCode(_0x537c2b,_0x326174){_0x326174=_0x326174||0xcc;return function(_0x45940d){if(_0x45940d){return _0x537c2b['sendStatus'](_0x326174);}return _0x537c2b[_0x7260('0x29')](_0x326174)[_0x7260('0x2a')]();};}function respondWithResult(_0x31ec13,_0x1c078f){_0x1c078f=_0x1c078f||0xc8;return function(_0x5292db){if(_0x5292db){return _0x31ec13[_0x7260('0x29')](_0x1c078f)[_0x7260('0x2b')](_0x5292db);}};}function respondWithFilteredResult(_0x178dc3,_0x36d4d4){return function(_0x2cf1b1){if(_0x2cf1b1){var _0x15c12b=typeof _0x36d4d4[_0x7260('0x2c')]===_0x7260('0x2d')&&typeof _0x36d4d4['limit']===_0x7260('0x2d');var _0x3c255b=_0x2cf1b1[_0x7260('0x2e')];var _0x4d4709=_0x15c12b?0x0:_0x36d4d4[_0x7260('0x2c')];var _0x19b961=_0x15c12b?_0x2cf1b1[_0x7260('0x2e')]:_0x36d4d4[_0x7260('0x2c')]+_0x36d4d4[_0x7260('0x2f')];var _0x4456f5;if(_0x19b961>=_0x3c255b){_0x19b961=_0x3c255b;_0x4456f5=0xc8;}else{_0x4456f5=0xce;}_0x178dc3[_0x7260('0x29')](_0x4456f5);return _0x178dc3[_0x7260('0x30')](_0x7260('0x31'),_0x4d4709+'-'+_0x19b961+'/'+_0x3c255b)[_0x7260('0x2b')](_0x2cf1b1);}return null;};}function patchUpdates(_0x1906c1){return function(_0x5e1316){try{jsonpatch[_0x7260('0x32')](_0x5e1316,_0x1906c1,!![]);}catch(_0x3e7c52){return BPromise[_0x7260('0x33')](_0x3e7c52);}return _0x5e1316[_0x7260('0x34')]();};}function saveUpdates(_0x48f2f4,_0x4a9ff5){return function(_0xf6e414){if(_0xf6e414){return _0xf6e414[_0x7260('0x35')](_0x48f2f4)[_0x7260('0x36')](function(_0x4f872f){return _0x4f872f;});}return null;};}function removeEntity(_0x44af19,_0x47c5f9){return function(_0x225f45){if(_0x225f45){return _0x225f45['destroy']()[_0x7260('0x36')](function(){_0x44af19['status'](0xcc)[_0x7260('0x2a')]();});}};}function handleEntityNotFound(_0x35555c,_0x4f92a7){return function(_0x217918){if(!_0x217918){_0x35555c['sendStatus'](0x194);}return _0x217918;};}function handleError(_0x19def9,_0x453180){_0x453180=_0x453180||0x1f4;return function(_0x11b7a0){logger['error'](_0x11b7a0[_0x7260('0x37')]);if(_0x11b7a0[_0x7260('0x38')]){delete _0x11b7a0[_0x7260('0x38')];}_0x19def9['status'](_0x453180)['send'](_0x11b7a0);};}exports[_0x7260('0x39')]=function(_0x494e59,_0x169b76){var _0x46003a={},_0x45b04e={},_0x37e94a={'count':0x0,'rows':[]};var _0x4400ec=_[_0x7260('0x3a')](db[_0x7260('0x3b')][_0x7260('0x3c')],function(_0x5b290a){return{'name':_0x5b290a['fieldName'],'type':_0x5b290a['type'][_0x7260('0x3d')]};});_0x45b04e[_0x7260('0x3e')]=_[_0x7260('0x3a')](_0x4400ec,_0x7260('0x38'));_0x45b04e['query']=_[_0x7260('0x3f')](_0x494e59[_0x7260('0x40')]);_0x45b04e['filters']=_[_0x7260('0x41')](_0x45b04e[_0x7260('0x3e')],_0x45b04e[_0x7260('0x40')]);_0x46003a[_0x7260('0x42')]=_[_0x7260('0x41')](_0x45b04e[_0x7260('0x3e')],qs['fields'](_0x494e59[_0x7260('0x40')][_0x7260('0x43')]));_0x46003a[_0x7260('0x42')]=_0x46003a[_0x7260('0x42')][_0x7260('0x44')]?_0x46003a['attributes']:_0x45b04e[_0x7260('0x3e')];if(!_0x494e59[_0x7260('0x40')][_0x7260('0x45')](_0x7260('0x46'))){_0x46003a[_0x7260('0x2f')]=qs[_0x7260('0x2f')](_0x494e59[_0x7260('0x40')][_0x7260('0x2f')]);_0x46003a[_0x7260('0x2c')]=qs[_0x7260('0x2c')](_0x494e59[_0x7260('0x40')][_0x7260('0x2c')]);}_0x46003a['order']=qs['sort'](_0x494e59[_0x7260('0x40')][_0x7260('0x47')]);_0x46003a[_0x7260('0x48')]=qs[_0x7260('0x49')](_[_0x7260('0x4a')](_0x494e59[_0x7260('0x40')],_0x45b04e[_0x7260('0x49')]),_0x4400ec);if(_0x494e59[_0x7260('0x40')][_0x7260('0x4b')]){_0x46003a[_0x7260('0x48')]=_[_0x7260('0x4c')](_0x46003a[_0x7260('0x48')],{'$or':_[_0x7260('0x3a')](_0x4400ec,function(_0x1d8e47){if(_0x1d8e47['type']!==_0x7260('0x4d')){var _0x5799fc={};_0x5799fc[_0x1d8e47[_0x7260('0x38')]]={'$like':'%'+_0x494e59[_0x7260('0x40')][_0x7260('0x4b')]+'%'};return _0x5799fc;}})});}_0x46003a=_[_0x7260('0x4c')]({},_0x46003a,_0x494e59[_0x7260('0x4e')]);var _0x3c24b3={'where':_0x46003a[_0x7260('0x48')]};return db[_0x7260('0x3b')][_0x7260('0x2e')](_0x3c24b3)[_0x7260('0x36')](function(_0x1b16f2){_0x37e94a[_0x7260('0x2e')]=_0x1b16f2;if(_0x494e59['query'][_0x7260('0x4f')]){_0x46003a[_0x7260('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x7260('0x51')](_0x46003a);})[_0x7260('0x36')](function(_0x5bc825){_0x37e94a[_0x7260('0x52')]=_0x5bc825;return _0x37e94a;})[_0x7260('0x36')](respondWithFilteredResult(_0x169b76,_0x46003a))[_0x7260('0x28')](handleError(_0x169b76,null));};exports[_0x7260('0x53')]=function(_0x19499f,_0x162fc2){var _0x129549={'raw':!![],'where':{'id':_0x19499f[_0x7260('0x54')]['id']}},_0x521045={};_0x521045[_0x7260('0x3e')]=_[_0x7260('0x3f')](db['FaxMessage'][_0x7260('0x3c')]);_0x521045[_0x7260('0x40')]=_['keys'](_0x19499f[_0x7260('0x40')]);_0x521045['filters']=_[_0x7260('0x41')](_0x521045[_0x7260('0x3e')],_0x521045[_0x7260('0x40')]);_0x129549[_0x7260('0x42')]=_[_0x7260('0x41')](_0x521045[_0x7260('0x3e')],qs[_0x7260('0x43')](_0x19499f[_0x7260('0x40')][_0x7260('0x43')]));_0x129549[_0x7260('0x42')]=_0x129549['attributes'][_0x7260('0x44')]?_0x129549[_0x7260('0x42')]:_0x521045[_0x7260('0x3e')];if(_0x19499f[_0x7260('0x40')][_0x7260('0x4f')]){_0x129549['include']=[{'all':!![]}];}_0x129549=_[_0x7260('0x4c')]({},_0x129549,_0x19499f[_0x7260('0x4e')]);return db[_0x7260('0x3b')][_0x7260('0x55')](_0x129549)[_0x7260('0x36')](handleEntityNotFound(_0x162fc2,null))['then'](respondWithResult(_0x162fc2,null))['catch'](handleError(_0x162fc2,null));};exports[_0x7260('0x35')]=function(_0x35262a,_0x476ed1){if(_0x35262a[_0x7260('0x56')]['id']){delete _0x35262a[_0x7260('0x56')]['id'];}return db[_0x7260('0x3b')][_0x7260('0x55')]({'where':{'id':_0x35262a[_0x7260('0x54')]['id']}})['then'](handleEntityNotFound(_0x476ed1,null))[_0x7260('0x36')](saveUpdates(_0x35262a[_0x7260('0x56')],null))[_0x7260('0x36')](respondWithResult(_0x476ed1,null))[_0x7260('0x28')](handleError(_0x476ed1,null));};exports[_0x7260('0x57')]=function(_0x47f266,_0x42fb37){return db['FaxMessage'][_0x7260('0x55')]({'where':{'id':_0x47f266[_0x7260('0x54')]['id']}})[_0x7260('0x36')](handleEntityNotFound(_0x42fb37,null))['then'](removeEntity(_0x42fb37,null))['catch'](handleError(_0x42fb37,null));};exports[_0x7260('0x58')]=function(_0x2744cf,_0x12e7a8){return db[_0x7260('0x3b')][_0x7260('0x58')]()[_0x7260('0x36')](respondWithResult(_0x12e7a8,null))[_0x7260('0x28')](handleError(_0x12e7a8,null));};var interaction_log=require(_0x7260('0x13'))(_0x7260('0x59'));exports[_0x7260('0x5a')]=function(_0x49feba,_0x146bf9,_0x15736d){var _0x1bf5ba={'agent':{},'channel':'fax'};if(_0x49feba[_0x7260('0x56')]['id']){delete _0x49feba[_0x7260('0x56')]['id'];}_0x49feba['body'][_0x7260('0x5b')]=!![];_0x49feba['body'][_0x7260('0x5c')]=moment()['format'](_0x7260('0x5d'));_0x49feba[_0x7260('0x56')][_0x7260('0x5e')]=_0x49feba[_0x7260('0x56')][_0x7260('0x5e')]||_0x49feba[_0x7260('0x5f')]['id'];_0x1bf5ba[_0x7260('0x60')]['id']=_0x49feba[_0x7260('0x56')][_0x7260('0x5e')];return db[_0x7260('0x3b')][_0x7260('0x55')]({'where':{'id':_0x49feba[_0x7260('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x146bf9,null))[_0x7260('0x36')](saveUpdates(_0x49feba[_0x7260('0x56')],null))[_0x7260('0x36')](function(_0x3db26c){if(_0x3db26c){_0x1bf5ba[_0x7260('0x26')]=_0x3db26c[_0x7260('0x61')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x3db26c[_0x7260('0x62')]}});}return null;})[_0x7260('0x36')](handleEntityNotFound(_0x146bf9,null))[_0x7260('0x36')](function(_0x232ad5){if(_0x232ad5){return _0x232ad5[_0x7260('0x35')]({'UserId':_0x49feba['body'][_0x7260('0x5e')],'read1stAt':_[_0x7260('0x63')](_0x232ad5[_0x7260('0x64')])?moment()[_0x7260('0x65')](_0x7260('0x5d')):undefined});}return null;})[_0x7260('0x36')](function(_0x466e15){if(_0x466e15){_0x1bf5ba[_0x7260('0x66')]=_0x466e15[_0x7260('0x61')]({'plain':!![]});interaction_log[_0x7260('0x1f')](_0x7260('0x67'),_0x49feba[_0x7260('0x5f')]['id'],_0x49feba[_0x7260('0x5f')][_0x7260('0x38')],_0x49feba[_0x7260('0x5f')][_0x7260('0x68')],_0x1bf5ba[_0x7260('0x66')]['id'],_0x49feba[_0x7260('0x56')]?JSON['stringify'](_0x49feba[_0x7260('0x56')]):_0x7260('0x69'));return respondWithRpcPromise(_0x7260('0x6a'),'acceptMessage',_0x1bf5ba);}return null;})[_0x7260('0x36')](function(_0x23540e){var _0x119525=_0x7260('0x6b')+_0x23540e[_0x7260('0x26')][_0x7260('0x6c')];return db[_0x7260('0x6d')][_0x7260('0x40')](_0x119525,{'type':db[_0x7260('0x6e')][_0x7260('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x585658){return _0x585658;});})['then'](function(_0x36ba0b){if(_0x36ba0b){_0x1bf5ba[_0x7260('0x26')]['contact']=_0x36ba0b[0x0];if(!_0x49feba[_0x7260('0x56')][_0x7260('0x5e')])return;return db[_0x7260('0x70')][_0x7260('0x55')]({'where':{'id':_0x49feba[_0x7260('0x56')]['UserId'],'role':_0x7260('0x60')},'attributes':['id',_0x7260('0x38'),_0x7260('0x71'),_0x7260('0x72'),_0x7260('0x73')],'raw':!![]});}return null;})[_0x7260('0x36')](function(_0x1b5955){if(!_0x1b5955)return null;_0x1bf5ba['message']['agent']=_0x1b5955;return _0x1bf5ba;})['then'](function(_0x25e275){if(_0x25e275){if(_0x49feba[_0x7260('0x56')][_0x7260('0x74')]){_0x1bf5ba[_0x7260('0x26')][_0x7260('0x75')]=util[_0x7260('0x65')](_0x7260('0x76'),_0x49feba[_0x7260('0x5f')]['name']);_0x1bf5ba[_0x7260('0x26')]['channel']=_0x1bf5ba[_0x7260('0x77')];_0x1bf5ba[_0x7260('0x26')]['motionChannel']=_0x1bf5ba[_0x7260('0x77')];_0x1bf5ba[_0x7260('0x26')][_0x7260('0x78')]=_0x7260('0x5a');return respondWithRpcPromise('EventManager',_0x7260('0x79'),{'event':_0x7260('0x7a'),'message':_0x1bf5ba[_0x7260('0x26')]},client9002)['then'](function(){return _0x1bf5ba;});}return _0x1bf5ba;}return null;})[_0x7260('0x36')](respondWithResult(_0x146bf9,null))[_0x7260('0x28')](handleError(_0x146bf9,null));};var interaction_log=require(_0x7260('0x13'))(_0x7260('0x59'));exports[_0x7260('0x33')]=function(_0x327317,_0x2bfe6e,_0x5c2a89){var _0x9af070={'agent':{},'channel':_0x7260('0x7b')};if(_0x327317[_0x7260('0x56')]['id']){delete _0x327317[_0x7260('0x56')]['id'];}_0x327317['body'][_0x7260('0x5e')]=_0x327317[_0x7260('0x56')]['UserId']||_0x327317[_0x7260('0x5f')]['id'];_0x9af070['agent']['id']=_0x327317[_0x7260('0x56')]['UserId'];return db['FaxMessage'][_0x7260('0x55')]({'where':{'id':_0x327317[_0x7260('0x54')]['id'],'UserId':null}})[_0x7260('0x36')](handleEntityNotFound(_0x2bfe6e,null))[_0x7260('0x36')](function(_0xe6b123){if(_0xe6b123){_0x9af070['message']=_0xe6b123[_0x7260('0x61')]({'plain':!![]});return db[_0x7260('0x7c')][_0x7260('0x55')]({'where':{'id':_0xe6b123[_0x7260('0x62')]}});}return null;})[_0x7260('0x36')](handleEntityNotFound(_0x2bfe6e,null))[_0x7260('0x36')](function(_0x171862){if(_0x171862){_0x9af070[_0x7260('0x66')]=_0x171862['get']({'plain':!![]});interaction_log['info'](_0x7260('0x7d'),_0x327317[_0x7260('0x5f')]['id'],_0x327317[_0x7260('0x5f')][_0x7260('0x38')],_0x327317[_0x7260('0x5f')][_0x7260('0x68')],_0x9af070[_0x7260('0x66')]['id'],_0x327317[_0x7260('0x56')]?JSON[_0x7260('0x23')](_0x327317[_0x7260('0x56')]):'null');return respondWithRpcPromise(_0x7260('0x7e'),_0x7260('0x7f'),_0x9af070);}return null;})[_0x7260('0x36')](function(_0x168b13){var _0x414080=_0x7260('0x6b')+_0x168b13['message'][_0x7260('0x6c')];return db[_0x7260('0x6d')]['query'](_0x414080,{'type':db[_0x7260('0x6e')][_0x7260('0x6f')][_0x7260('0x80')],'raw':!![]})['then'](function(_0x361d1f){return _0x361d1f;});})[_0x7260('0x36')](function(_0x598f35){if(_0x598f35){_0x9af070[_0x7260('0x26')][_0x7260('0x81')]=_0x598f35[0x0];if(!_0x327317['body']['UserId'])return;return db['User'][_0x7260('0x55')]({'where':{'id':_0x327317[_0x7260('0x56')]['UserId'],'role':_0x7260('0x60')},'attributes':['id',_0x7260('0x38'),_0x7260('0x71'),_0x7260('0x72'),_0x7260('0x73')],'raw':!![]});}return null;})[_0x7260('0x36')](function(_0x35e283){if(!_0x35e283)return null;_0x9af070['message'][_0x7260('0x60')]=_0x35e283;return _0x9af070;})['then'](function(_0x93454b){if(_0x93454b){_0x93454b[_0x7260('0x26')][_0x7260('0x75')]=util['format']('SIP/%s',_0x327317[_0x7260('0x5f')][_0x7260('0x38')]);_0x93454b[_0x7260('0x26')][_0x7260('0x77')]=_0x9af070[_0x7260('0x77')];_0x93454b[_0x7260('0x26')][_0x7260('0x82')]=_0x9af070[_0x7260('0x77')];_0x93454b['message'][_0x7260('0x78')]='reject';respondWithRpcPromise(_0x7260('0x79'),_0x7260('0x79'),{'event':'rejectmessage','message':_0x93454b[_0x7260('0x26')]},client9002);return _0x9af070;}return null;})['then'](respondWithResult(_0x2bfe6e,null))[_0x7260('0x28')](handleError(_0x2bfe6e,null));};exports[_0x7260('0x83')]=function(_0x455291,_0x50a6f2){var _0xaaec8b;return db['FaxMessage']['create'](_0x455291['body'],{})[_0x7260('0x36')](function(_0x179ef7){_0xaaec8b=_0x179ef7;return db['CmContact'][_0x7260('0x84')]({'where':{'id':_0xaaec8b[_0x7260('0x6c')]}});})['then'](function(_0x1b18e7){if(_[_0x7260('0x63')](_0x1b18e7)){return;}else{_0xaaec8b['fax']=_0x1b18e7[_0x7260('0x7b')];return db[_0x7260('0x85')][_0x7260('0x84')]({'where':{'id':_0xaaec8b['AttachmentId']}});}})[_0x7260('0x36')](function(_0x2037c9){return respondWithRpcPromise(_0x7260('0x86'),_0x7260('0x86'),{'FaxAccountId':_[_0x7260('0x63')](_0x455291['body'])?undefined:_0x455291['body'][_0x7260('0x87')],'path':_[_0x7260('0x63')](_0x2037c9)?undefined:util['format'](_0x7260('0x88'),_0x2037c9[_0x7260('0x89')]),'fax':_[_0x7260('0x63')](_0xaaec8b[_0x7260('0x7b')])?undefined:_0xaaec8b[_0x7260('0x7b')],'AttachmentId':_0xaaec8b[_0x7260('0x8a')]},client9002);})[_0x7260('0x36')](respondWithResult(_0x50a6f2,0xc9))[_0x7260('0x28')](handleError(_0x50a6f2,null));};exports[_0x7260('0x8b')]=function(_0x477ae3,_0x146a3b){var _0x2b0cc6=path['join'](config[_0x7260('0x8c')],_0x7260('0x8d'),_0x7260('0x8e'),'attachments');return db['FaxMessage']['find']({'where':{'id':_0x477ae3['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x7260('0x36')](handleEntityNotFound(_0x146a3b,null))[_0x7260('0x36')](function(_0x1015a0){if(_0x1015a0){return _0x146a3b[_0x7260('0x8b')](path[_0x7260('0x8f')](_0x2b0cc6,_0x1015a0['Attachment'][_0x7260('0x89')]));}})[_0x7260('0x28')](handleError(_0x146a3b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index a8c0211..59b8cc6 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 _0x9a96=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x9a96,0xd0));var _0x69a9=function(_0x23faaa,_0x41f6e2){_0x23faaa=_0x23faaa-0x0;var _0x53e177=_0x9a96[_0x23faaa];return _0x53e177;};'use strict';var EventEmitter=require(_0x69a9('0x0'));var FaxMessage=require(_0x69a9('0x1'))['db'][_0x69a9('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x69a9('0x3')](0x0);var events={'afterCreate':_0x69a9('0x4'),'afterUpdate':_0x69a9('0x5'),'afterDestroy':_0x69a9('0x6')};function emitEvent(_0x6c91e5){return function(_0x303516,_0x2480e1,_0xb7ac87){FaxMessageEvents[_0x69a9('0x7')](_0x6c91e5+':'+_0x303516['id'],_0x303516);FaxMessageEvents['emit'](_0x6c91e5,_0x303516);_0xb7ac87(null);};}for(var e in events){if(events[_0x69a9('0x8')](e)){var event=events[e];FaxMessage[_0x69a9('0x9')](e,emitEvent(event));}}module[_0x69a9('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x55c1=['hasOwnProperty','exports','events','../../mysqldb','update','remove','emit'];(function(_0x50cbb4,_0x196b3b){var _0x246938=function(_0xc2ce17){while(--_0xc2ce17){_0x50cbb4['push'](_0x50cbb4['shift']());}};_0x246938(++_0x196b3b);}(_0x55c1,0x1e5));var _0x155c=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0x55c1[_0x3ed054];return _0x16dd95;};'use strict';var EventEmitter=require(_0x155c('0x0'));var FaxMessage=require(_0x155c('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x155c('0x2'),'afterDestroy':_0x155c('0x3')};function emitEvent(_0x30444a){return function(_0x64c8aa,_0xb127e8,_0x5305d5){FaxMessageEvents[_0x155c('0x4')](_0x30444a+':'+_0x64c8aa['id'],_0x64c8aa);FaxMessageEvents[_0x155c('0x4')](_0x30444a,_0x64c8aa);_0x5305d5(null);};}for(var e in events){if(events[_0x155c('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x155c('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 10f0a20..17d957c 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 _0x6e98=['../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x302579,_0x5d6904){var _0x5d1267=function(_0x1fcff6){while(--_0x1fcff6){_0x302579['push'](_0x302579['shift']());}};_0x5d1267(++_0x5d6904);}(_0x6e98,0x159));var _0x86e9=function(_0x24cf7f,_0xcda231){_0x24cf7f=_0x24cf7f-0x0;var _0x4c6742=_0x6e98[_0x24cf7f];return _0x4c6742;};'use strict';var _=require(_0x86e9('0x0'));var util=require('util');var logger=require(_0x86e9('0x1'))(_0x86e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86e9('0x3'));var fs=require('fs');var path=require(_0x86e9('0x4'));var rimraf=require(_0x86e9('0x5'));var config=require(_0x86e9('0x6'));var attributes=require('./faxMessage.attributes');module[_0x86e9('0x7')]=function(_0x42d57c,_0x283be3){return _0x42d57c[_0x86e9('0x8')](_0x86e9('0x9'),attributes,{'tableName':_0x86e9('0xa'),'paranoid':![],'indexes':[{'name':_0x86e9('0xb'),'fields':[_0x86e9('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd66cfd,_0x461f9d,_0x2ccca6){var _0x33c2c0=_0x42d57c[_0x86e9('0xd')];var _0xf151d0=_0xd66cfd[_0x86e9('0xe')]({'plain':!![]});if(_0xf151d0['direction'][_0x86e9('0xf')]()==='in'||_0xf151d0[_0x86e9('0x10')][_0x86e9('0xf')]()==='out'&&!_0xf151d0[_0x86e9('0x11')]&&!_[_0x86e9('0x12')](_0xf151d0[_0x86e9('0x13')])){_0x33c2c0[_0x86e9('0x14')][_0x86e9('0x15')]({'where':{'id':_0xf151d0['FaxInteractionId']}})[_0x86e9('0x16')](function(_0x276f98){if(_0x276f98){_0x276f98[_0x86e9('0x17')]({'lastMsgAt':_0xf151d0[_0x86e9('0x18')],'lastMsgDirection':_0xf151d0['direction'][_0x86e9('0xf')]()});}})['catch'](function(_0x4b74ea){console[_0x86e9('0x19')](_0x4b74ea);});}_0x2ccca6();}},'charset':'utf8mb4','collate':_0x86e9('0x1a')});}; \ No newline at end of file +var _0xd7e3=['FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','catch','util','api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define'];(function(_0x490dca,_0x49324a){var _0x2212a6=function(_0x1eddd4){while(--_0x1eddd4){_0x490dca['push'](_0x490dca['shift']());}};_0x2212a6(++_0x49324a);}(_0xd7e3,0x142));var _0x3d7e=function(_0x59b86c,_0x244d0d){_0x59b86c=_0x59b86c-0x0;var _0x4936fc=_0xd7e3[_0x59b86c];return _0x4936fc;};'use strict';var _=require('lodash');var util=require(_0x3d7e('0x0'));var logger=require('../../config/logger')(_0x3d7e('0x1'));var moment=require(_0x3d7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x3d7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d7e('0x4'));var config=require(_0x3d7e('0x5'));var attributes=require(_0x3d7e('0x6'));module['exports']=function(_0x5a1894,_0x310e1b){return _0x5a1894[_0x3d7e('0x7')](_0x3d7e('0x8'),attributes,{'tableName':_0x3d7e('0x9'),'paranoid':![],'indexes':[{'name':_0x3d7e('0xa'),'fields':['body'],'type':_0x3d7e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3af511,_0x576428,_0x31eb3c){var _0x2e66f2=_0x5a1894[_0x3d7e('0xc')];var _0x37a207=_0x3af511[_0x3d7e('0xd')]({'plain':!![]});if(_0x37a207[_0x3d7e('0xe')][_0x3d7e('0xf')]()==='in'||_0x37a207[_0x3d7e('0xe')]['toLowerCase']()==='out'&&!_0x37a207[_0x3d7e('0x10')]&&!_[_0x3d7e('0x11')](_0x37a207[_0x3d7e('0x12')])){_0x2e66f2[_0x3d7e('0x13')][_0x3d7e('0x14')]({'where':{'id':_0x37a207['FaxInteractionId']}})['then'](function(_0x4e3fdc){if(_0x4e3fdc){_0x4e3fdc['update']({'lastMsgAt':_0x37a207['createdAt'],'lastMsgDirection':_0x37a207['direction'][_0x3d7e('0xf')]()});}})[_0x3d7e('0x15')](function(_0x41122b){console['error'](_0x41122b);});}_0x31eb3c();}},'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 79370a2..6bd36e8 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 _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1e3cdb,_0x3767f9){var _0x3fb2f9=function(_0x1c9e5a){while(--_0x1c9e5a){_0x1e3cdb['push'](_0x1e3cdb['shift']());}};_0x3fb2f9(++_0x3767f9);}(_0x54ef,0x112));var _0xf54e=function(_0x102137,_0x476aba){_0x102137=_0x102137-0x0;var _0x5f573d=_0x54ef[_0x102137];return _0x5f573d;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});}; \ No newline at end of file +var _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4862bb,_0x752b16){var _0x2653c6=function(_0x121a3d){while(--_0x121a3d){_0x4862bb['push'](_0x4862bb['shift']());}};_0x2653c6(++_0x752b16);}(_0x84ab,0x12f));var _0xb84a=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x84ab[_0xcd0918];return _0x250704;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b3e977f..7e27e8b 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 _0x2e16=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x339dd4,_0x4c1563){var _0x10992f=function(_0x44a770){while(--_0x44a770){_0x339dd4['push'](_0x339dd4['shift']());}};_0x10992f(++_0x4c1563);}(_0x2e16,0x1ce));var _0x62e1=function(_0x36ddcf,_0x2010c9){_0x36ddcf=_0x36ddcf-0x0;var _0x1da059=_0x2e16[_0x36ddcf];return _0x1da059;};'use strict';var FaxMessageEvents=require(_0x62e1('0x0'));var events=[_0x62e1('0x1'),_0x62e1('0x2'),_0x62e1('0x3')];function createListener(_0x27c8d3,_0x25182d){return function(_0x2c88fc){_0x25182d[_0x62e1('0x4')](_0x27c8d3,_0x2c88fc);};}function removeListener(_0x1df16f,_0x363b70){return function(){FaxMessageEvents[_0x62e1('0x5')](_0x1df16f,_0x363b70);};}exports[_0x62e1('0x6')]=function(_0x178fa2){for(var _0x1e70bf=0x0,_0x59cc34=events[_0x62e1('0x7')];_0x1e70bf<_0x59cc34;_0x1e70bf++){var _0x172609=events[_0x1e70bf];var _0x49c0f3=createListener(_0x62e1('0x8')+_0x172609,_0x178fa2);FaxMessageEvents['on'](_0x172609,_0x49c0f3);}}; \ No newline at end of file +var _0x1088=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1088,0xac));var _0x8108=function(_0x3d1644,_0x5e9460){_0x3d1644=_0x3d1644-0x0;var _0x5a3c39=_0x1088[_0x3d1644];return _0x5a3c39;};'use strict';var FaxMessageEvents=require(_0x8108('0x0'));var events=[_0x8108('0x1'),_0x8108('0x2'),_0x8108('0x3')];function createListener(_0x297ec5,_0x5047a6){return function(_0x30e2c2){_0x5047a6['emit'](_0x297ec5,_0x30e2c2);};}function removeListener(_0x2c56ba,_0x180d26){return function(){FaxMessageEvents[_0x8108('0x4')](_0x2c56ba,_0x180d26);};}exports[_0x8108('0x5')]=function(_0x1c508b){for(var _0x2b9438=0x0,_0x2449cb=events[_0x8108('0x6')];_0x2b9438<_0x2449cb;_0x2b9438++){var _0x553faf=events[_0x2b9438];var _0x98f360=createListener(_0x8108('0x7')+_0x553faf,_0x1c508b);FaxMessageEvents['on'](_0x553faf,_0x98f360);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a2f1bae..0c1634b 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','faxmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe706,0xa3));var _0x6e70=function(_0x2089b3,_0x31fbde){_0x2089b3=_0x2089b3-0x0;var _0x181087=_0xe706[_0x2089b3];return _0x181087;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('fax',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xb688=['accept','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','fax','faxmessage:create','create','put','update','/:id/accept'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb688,0xcf));var _0x8b68=function(_0x51cdca,_0x1cd055){_0x51cdca=_0x51cdca-0x0;var _0x58b208=_0xb688[_0x51cdca];return _0x58b208;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')]('/',auth[_0x8b68('0xc')](),interaction['tracked'](_0x8b68('0x13'),_0x8b68('0x14')),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')](_0x8b68('0x18'),auth['isAuthenticated'](),controller[_0x8b68('0x19')]);router['put']('/:id/reject',auth[_0x8b68('0xc')](),controller[_0x8b68('0x1a')]);router[_0x8b68('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x8b68('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f47e685..a5a093f 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 _0x9354=['INTEGER','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x1edf32,_0x1246c7){var _0x291779=function(_0x1fc985){while(--_0x1fc985){_0x1edf32['push'](_0x1edf32['shift']());}};_0x291779(++_0x1246c7);}(_0x9354,0xf6));var _0x4935=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x9354[_0x4bf96c];return _0x281d09;};'use strict';var Sequelize=require(_0x4935('0x0'));module[_0x4935('0x1')]={'name':{'type':Sequelize[_0x4935('0x2')],'unique':_0x4935('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4935('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4935('0x4')]('rrmemory',_0x4935('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4935('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x30e9=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30e9,0x121));var _0x930e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x30e9[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x930e('0x0'));module[_0x930e('0x1')]={'name':{'type':Sequelize[_0x930e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x930e('0x2')]},'timeout':{'type':Sequelize[_0x930e('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x930e('0x4')](_0x930e('0x5'),_0x930e('0x6'),_0x930e('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x930e('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 e2073b4..c684e09 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 _0xba6f=['Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','value','emit','userFaxQueue:remove','addAgents','userFaxQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','FaxQueues','error','stack','name','send','map','FaxQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','faxPause','updatedAt','getTeams','hasOwnProperty','addTeams','ids','Team','findAll'];(function(_0x4a2689,_0x314a16){var _0x463450=function(_0x5388b8){while(--_0x5388b8){_0x4a2689['push'](_0x4a2689['shift']());}};_0x463450(++_0x314a16);}(_0xba6f,0x1d0));var _0xfba6=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0xba6f[_0x11946c];return _0x383935;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba6('0x1'));var jsonpatch=require(_0xfba6('0x2'));var rp=require(_0xfba6('0x3'));var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require(_0xfba6('0x7'));var path=require(_0xfba6('0x8'));var sox=require(_0xfba6('0x9'));var csv=require(_0xfba6('0xa'));var ejs=require(_0xfba6('0xb'));var fs=require('fs');var fs_extra=require(_0xfba6('0xc'));var _=require(_0xfba6('0xd'));var squel=require('squel');var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfba6('0x10'));var Redis=require(_0xfba6('0x11'));var authService=require(_0xfba6('0x12'));var qs=require(_0xfba6('0x13'));var as=require(_0xfba6('0x14'));var hardwareService=require(_0xfba6('0x15'));var logger=require(_0xfba6('0x16'))(_0xfba6('0x17'));var utils=require(_0xfba6('0x18'));var config=require(_0xfba6('0x19'));var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfba6('0x1b')]=_[_0xfba6('0x1c')](config[_0xfba6('0x1b')],{'host':_0xfba6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfba6('0x1b')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x184169,_0x30e5cb){_0x30e5cb=_0x30e5cb||0xcc;return function(_0x12534b){if(_0x12534b){return _0x184169[_0xfba6('0x1e')](_0x30e5cb);}return _0x184169[_0xfba6('0x1f')](_0x30e5cb)[_0xfba6('0x20')]();};}function respondWithResult(_0x24b6a0,_0x2f575f){_0x2f575f=_0x2f575f||0xc8;return function(_0x401f25){if(_0x401f25){return _0x24b6a0[_0xfba6('0x1f')](_0x2f575f)[_0xfba6('0x21')](_0x401f25);}};}function respondWithFilteredResult(_0xf3dbbc,_0x2ef1b8){return function(_0x5a29a4){if(_0x5a29a4){var _0x35e4a7=typeof _0x2ef1b8[_0xfba6('0x22')]==='undefined'&&typeof _0x2ef1b8['limit']===_0xfba6('0x23');var _0x204784=_0x5a29a4['count'];var _0x14990f=_0x35e4a7?0x0:_0x2ef1b8[_0xfba6('0x22')];var _0x34d440=_0x35e4a7?_0x5a29a4['count']:_0x2ef1b8[_0xfba6('0x22')]+_0x2ef1b8[_0xfba6('0x24')];var _0xa16868;if(_0x34d440>=_0x204784){_0x34d440=_0x204784;_0xa16868=0xc8;}else{_0xa16868=0xce;}_0xf3dbbc['status'](_0xa16868);return _0xf3dbbc[_0xfba6('0x25')](_0xfba6('0x26'),_0x14990f+'-'+_0x34d440+'/'+_0x204784)[_0xfba6('0x21')](_0x5a29a4);}return null;};}function patchUpdates(_0x2afd26){return function(_0x76af17){try{jsonpatch[_0xfba6('0x27')](_0x76af17,_0x2afd26,!![]);}catch(_0x203a4e){return BPromise['reject'](_0x203a4e);}return _0x76af17['save']();};}function saveUpdates(_0x41b356,_0x27bf10){return function(_0x21f7b9){if(_0x21f7b9){return _0x21f7b9[_0xfba6('0x28')](_0x41b356)[_0xfba6('0x29')](function(_0x53c99a){return _0x53c99a;});}return null;};}function removeEntity(_0x408ccc,_0x4114bc){return function(_0x314f65){if(_0x314f65){return _0x314f65[_0xfba6('0x2a')]()[_0xfba6('0x29')](function(){var _0x7c7f6a=_0x314f65['get']({'plain':!![]});var _0x29b513=_0xfba6('0x2b');return db['UserProfileResource'][_0xfba6('0x2a')]({'where':{'type':_0x29b513,'resourceId':_0x7c7f6a['id']}})[_0xfba6('0x29')](function(){return _0x314f65;});})['then'](function(){_0x408ccc[_0xfba6('0x1f')](0xcc)[_0xfba6('0x20')]();});}};}function handleEntityNotFound(_0x5f31af,_0x47973f){return function(_0x56e8e6){if(!_0x56e8e6){_0x5f31af[_0xfba6('0x1e')](0x194);}return _0x56e8e6;};}function handleError(_0x373f14,_0x24e860){_0x24e860=_0x24e860||0x1f4;return function(_0x57dd4f){logger[_0xfba6('0x2c')](_0x57dd4f[_0xfba6('0x2d')]);if(_0x57dd4f[_0xfba6('0x2e')]){delete _0x57dd4f[_0xfba6('0x2e')];}_0x373f14['status'](_0x24e860)[_0xfba6('0x2f')](_0x57dd4f);};}exports['index']=function(_0xe3ea6d,_0xb72cf9){var _0x43a2c={},_0x221b7f={},_0x37dca0={'count':0x0,'rows':[]};var _0x47933b=_[_0xfba6('0x30')](db[_0xfba6('0x31')]['rawAttributes'],function(_0x388917){return{'name':_0x388917[_0xfba6('0x32')],'type':_0x388917[_0xfba6('0x33')][_0xfba6('0x34')]};});_0x221b7f[_0xfba6('0x35')]=_[_0xfba6('0x30')](_0x47933b,_0xfba6('0x2e'));_0x221b7f[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0xe3ea6d[_0xfba6('0x36')]);_0x221b7f[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x221b7f['model'],_0x221b7f[_0xfba6('0x36')]);_0x43a2c[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x221b7f[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x43a2c[_0xfba6('0x3a')]=_0x43a2c[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x43a2c[_0xfba6('0x3a')]:_0x221b7f['model'];if(!_0xe3ea6d[_0xfba6('0x36')]['hasOwnProperty'](_0xfba6('0x3d'))){_0x43a2c[_0xfba6('0x24')]=qs[_0xfba6('0x24')](_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x24')]);_0x43a2c[_0xfba6('0x22')]=qs[_0xfba6('0x22')](_0xe3ea6d[_0xfba6('0x36')]['offset']);}_0x43a2c[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0xe3ea6d['query'][_0xfba6('0x3f')]);_0x43a2c['where']=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0xe3ea6d['query'],_0x221b7f[_0xfba6('0x38')]),_0x47933b);if(_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x41')]){_0x43a2c['where']=_[_0xfba6('0x42')](_0x43a2c[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x47933b,function(_0x2126b9){if(_0x2126b9[_0xfba6('0x33')]!==_0xfba6('0x44')){var _0x47dfae={};_0x47dfae[_0x2126b9[_0xfba6('0x2e')]]={'$like':'%'+_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x47dfae;}})});}_0x43a2c=_[_0xfba6('0x42')]({},_0x43a2c,_0xe3ea6d[_0xfba6('0x45')]);var _0x7140f8={'where':_0x43a2c[_0xfba6('0x43')]};return db[_0xfba6('0x31')]['count'](_0x7140f8)['then'](function(_0x18b81d){_0x37dca0['count']=_0x18b81d;if(_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x46')]){_0x43a2c[_0xfba6('0x47')]=[{'all':!![]}];}return db[_0xfba6('0x31')]['findAll'](_0x43a2c);})[_0xfba6('0x29')](function(_0x5aaa7f){_0x37dca0[_0xfba6('0x48')]=_0x5aaa7f;return _0x37dca0;})['then'](respondWithFilteredResult(_0xb72cf9,_0x43a2c))[_0xfba6('0x49')](handleError(_0xb72cf9,null));};exports[_0xfba6('0x4a')]=function(_0x28a675,_0xda0205){var _0x6a17={'raw':!![],'where':{'id':_0x28a675[_0xfba6('0x4b')]['id']}},_0x279857={};_0x279857[_0xfba6('0x35')]=_[_0xfba6('0x37')](db['FaxQueue'][_0xfba6('0x4c')]);_0x279857[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x28a675[_0xfba6('0x36')]);_0x279857[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x279857[_0xfba6('0x35')],_0x279857[_0xfba6('0x36')]);_0x6a17[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x279857[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x28a675[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x6a17[_0xfba6('0x3a')]=_0x6a17['attributes'][_0xfba6('0x3c')]?_0x6a17[_0xfba6('0x3a')]:_0x279857[_0xfba6('0x35')];if(_0x28a675[_0xfba6('0x36')][_0xfba6('0x46')]){_0x6a17[_0xfba6('0x47')]=[{'all':!![]}];}_0x6a17=_[_0xfba6('0x42')]({},_0x6a17,_0x28a675[_0xfba6('0x45')]);return db['FaxQueue']['find'](_0x6a17)[_0xfba6('0x29')](handleEntityNotFound(_0xda0205,null))[_0xfba6('0x29')](respondWithResult(_0xda0205,null))[_0xfba6('0x49')](handleError(_0xda0205,null));};exports[_0xfba6('0x4d')]=function(_0x4158f8,_0x47ca4c){return db['FaxQueue'][_0xfba6('0x4d')](_0x4158f8[_0xfba6('0x4e')],{})['then'](function(_0x4c150){var _0x4cbd77=_0x4158f8[_0xfba6('0x4f')]['get']({'plain':!![]});if(!_0x4cbd77)throw new Error(_0xfba6('0x50'));if(_0x4cbd77['role']===_0xfba6('0x4f')){var _0x1a68b3=_0x4c150[_0xfba6('0x51')]({'plain':!![]});var _0x8d3364=_0xfba6('0x2b');return db[_0xfba6('0x52')][_0xfba6('0x53')]({'where':{'name':_0x8d3364,'userProfileId':_0x4cbd77[_0xfba6('0x54')]},'raw':!![]})[_0xfba6('0x29')](function(_0x72db){if(_0x72db&&_0x72db[_0xfba6('0x55')]===0x0){return db[_0xfba6('0x56')][_0xfba6('0x4d')]({'name':_0x1a68b3['name'],'resourceId':_0x1a68b3['id'],'type':_0x72db[_0xfba6('0x2e')],'sectionId':_0x72db['id']},{})['then'](function(){return _0x4c150;});}else{return _0x4c150;}})[_0xfba6('0x49')](function(_0x327833){logger['error'](_0xfba6('0x57'),_0x327833);throw _0x327833;});}return _0x4c150;})[_0xfba6('0x29')](respondWithResult(_0x47ca4c,0xc9))[_0xfba6('0x49')](handleError(_0x47ca4c,null));};exports[_0xfba6('0x28')]=function(_0x7a6bf1,_0x4407b4){if(_0x7a6bf1[_0xfba6('0x4e')]['id']){delete _0x7a6bf1[_0xfba6('0x4e')]['id'];}return db[_0xfba6('0x31')]['find']({'where':{'id':_0x7a6bf1[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x4407b4,null))[_0xfba6('0x29')](saveUpdates(_0x7a6bf1[_0xfba6('0x4e')],null))[_0xfba6('0x29')](respondWithResult(_0x4407b4,null))[_0xfba6('0x49')](handleError(_0x4407b4,null));};exports[_0xfba6('0x2a')]=function(_0x20af75,_0x2e6296){return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x20af75[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x2e6296,null))['then'](removeEntity(_0x2e6296,null))[_0xfba6('0x49')](handleError(_0x2e6296,null));};exports[_0xfba6('0x58')]=function(_0x48b937,_0x2014a1){return db[_0xfba6('0x31')][_0xfba6('0x58')]()[_0xfba6('0x29')](respondWithResult(_0x2014a1,null))[_0xfba6('0x49')](handleError(_0x2014a1,null));};exports[_0xfba6('0x59')]=function(_0x445a8e,_0x4c5a20,_0x51b3c6){var _0x56e3ab={'raw':!![],'where':{}},_0x5832fb={},_0x1bb0c1;return db[_0xfba6('0x31')][_0xfba6('0x5a')]({'where':{'id':_0x445a8e[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x4c5a20,null))[_0xfba6('0x29')](function(_0x5c3329){if(_0x5c3329){_0x1bb0c1=_0x5c3329[_0xfba6('0x51')]({'plain':!![]});_0x5832fb[_0xfba6('0x35')]=_[_0xfba6('0x37')](db[_0xfba6('0x5b')][_0xfba6('0x4c')]);_0x5832fb[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x445a8e['query']);_0x5832fb[_0xfba6('0x38')]=_['intersection'](_0x5832fb[_0xfba6('0x35')],_0x5832fb[_0xfba6('0x36')]);_0x56e3ab[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x5832fb['model'],qs[_0xfba6('0x3b')](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x56e3ab[_0xfba6('0x3a')]=_0x56e3ab[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x56e3ab['attributes']:_0x5832fb['model'];if(!_0x445a8e[_0xfba6('0x36')]['hasOwnProperty'](_0xfba6('0x3d'))){_0x56e3ab['limit']=qs[_0xfba6('0x24')](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x24')]);_0x56e3ab[_0xfba6('0x22')]=qs['offset'](_0x445a8e[_0xfba6('0x36')]['offset']);}_0x56e3ab[_0xfba6('0x3e')]=qs['sort'](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x3f')]);_0x56e3ab['where']=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0x445a8e[_0xfba6('0x36')],_0x5832fb[_0xfba6('0x38')]));_0x56e3ab[_0xfba6('0x43')][_0xfba6('0x5c')]=_0x5c3329['id'];if(_0x445a8e[_0xfba6('0x36')][_0xfba6('0x41')]){_0x56e3ab[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x56e3ab[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x56e3ab['attributes'],function(_0x5568d6){var _0x4a5b86={};_0x4a5b86[_0x5568d6]={'$like':'%'+_0x445a8e[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x4a5b86;})});}_0x56e3ab=_[_0xfba6('0x42')]({},_0x56e3ab,_0x445a8e['options']);return db['UserFaxQueue']['findAll'](_0x56e3ab);}})[_0xfba6('0x29')](function(_0xefc11e){if(_0xefc11e){return db[_0xfba6('0x5d')][_0xfba6('0x5e')]({'where':{'id':_[_0xfba6('0x30')](_0xefc11e,_0xfba6('0x5f')),'role':_0xfba6('0x60')},'attributes':['id',_0xfba6('0x2e'),'faxPause','updatedAt',_0xfba6('0x61')]});}})[_0xfba6('0x29')](function(_0xf9c01e){if(_0xf9c01e){return{'count':_0xf9c01e['count'],'rows':_['map'](_0xf9c01e[_0xfba6('0x48')],function(_0x591126){return{'membername':_0x591126[_0xfba6('0x2e')],'UserId':_0x591126['id'],'queue_name':_0x1bb0c1[_0xfba6('0x2e')],'FaxQueueId':_0x1bb0c1['id'],'interface':util[_0xfba6('0x62')](_0xfba6('0x63'),'SIP',_0x591126[_0xfba6('0x2e')]),'penalty':0x0,'paused':_0x591126[_0xfba6('0x64')],'createdAt':_0x591126[_0xfba6('0x61')],'updatedAt':_0x591126[_0xfba6('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfba6('0x29')](respondWithFilteredResult(_0x4c5a20,_0x56e3ab))[_0xfba6('0x49')](handleError(_0x4c5a20,null));};exports[_0xfba6('0x66')]=function(_0xfc1301,_0x3a18d4,_0x2931d7){var _0x14825e={};var _0x27c1e3={};var _0x1c3954;var _0x1e04bf;return db[_0xfba6('0x31')][_0xfba6('0x5a')]({'where':{'id':_0xfc1301[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x3a18d4,null))[_0xfba6('0x29')](function(_0x479253){if(_0x479253){_0x1c3954=_0x479253;_0x27c1e3[_0xfba6('0x35')]=_[_0xfba6('0x37')](db['Team'][_0xfba6('0x4c')]);_0x27c1e3['query']=_[_0xfba6('0x37')](_0xfc1301['query']);_0x27c1e3[_0xfba6('0x38')]=_['intersection'](_0x27c1e3[_0xfba6('0x35')],_0x27c1e3[_0xfba6('0x36')]);_0x14825e[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x27c1e3['model'],qs['fields'](_0xfc1301[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x14825e['attributes']=_0x14825e[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x14825e[_0xfba6('0x3a')]:_0x27c1e3['model'];_0x14825e[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0xfc1301[_0xfba6('0x36')][_0xfba6('0x3f')]);_0x14825e[_0xfba6('0x43')]=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0xfc1301[_0xfba6('0x36')],_0x27c1e3[_0xfba6('0x38')]));if(_0xfc1301[_0xfba6('0x36')][_0xfba6('0x41')]){_0x14825e[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x14825e['where'],{'$or':_[_0xfba6('0x30')](_0x14825e['attributes'],function(_0x3e93ac){var _0x3804c2={};_0x3804c2[_0x3e93ac]={'$like':'%'+_0xfc1301[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x3804c2;})});}_0x14825e=_[_0xfba6('0x42')]({},_0x14825e,_0xfc1301[_0xfba6('0x45')]);return _0x1c3954[_0xfba6('0x66')](_0x14825e);}})[_0xfba6('0x29')](function(_0x1f8053){if(_0x1f8053){_0x1e04bf=_0x1f8053[_0xfba6('0x3c')];if(!_0xfc1301['query'][_0xfba6('0x67')](_0xfba6('0x3d'))){_0x14825e[_0xfba6('0x24')]=qs[_0xfba6('0x24')](_0xfc1301['query'][_0xfba6('0x24')]);_0x14825e['offset']=qs[_0xfba6('0x22')](_0xfc1301[_0xfba6('0x36')]['offset']);}return _0x1c3954['getTeams'](_0x14825e);}})[_0xfba6('0x29')](function(_0x578116){if(_0x578116){return _0x578116?{'count':_0x1e04bf,'rows':_0x578116}:null;}})[_0xfba6('0x29')](respondWithResult(_0x3a18d4,null))[_0xfba6('0x49')](handleError(_0x3a18d4,null));};exports[_0xfba6('0x68')]=function(_0x40e31c,_0x46e6a7,_0x1c6e99){var _0x45a640=_0x40e31c[_0xfba6('0x4e')][_0xfba6('0x69')];return db[_0xfba6('0x6a')][_0xfba6('0x6b')]({'where':{'id':_0x45a640},'attributes':['id'],'include':[{'model':db[_0xfba6('0x5d')],'as':_0xfba6('0x6c'),'attributes':['id',_0xfba6('0x2e'),_0xfba6('0x6d'),_0xfba6('0x6e'),_0xfba6('0x6f')],'raw':!![]}]})[_0xfba6('0x29')](function(_0x2c8cda){if(_0x2c8cda){var _0x120265=_[_0xfba6('0x70')](_0x2c8cda,function(_0x214b97){var _0x518095=_0x214b97[_0xfba6('0x51')]({'plain':!![]});return _0x518095[_0xfba6('0x6c')];});return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x40e31c[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](function(_0x423c00){return db[_0xfba6('0x71')][_0xfba6('0x72')](function(_0x564fdf){return _0x423c00[_0xfba6('0x68')](_0x45a640,{'transaction':_0x564fdf})[_0xfba6('0x29')](function(){return BPromise[_0xfba6('0x73')](_0x120265,function(_0x3cd3a9){return db[_0xfba6('0x5b')]['findOrCreate']({'where':{'UserId':_0x3cd3a9['id'],'FaxQueueId':_0x40e31c[_0xfba6('0x4b')]['id']},'transaction':_0x564fdf});});})[_0xfba6('0x29')](function(){_0x120265[_0xfba6('0x74')](function(_0x4c6834){socket['emit']('userFaxQueue:save',{'UserId':_0x4c6834['id'],'FaxQueueId':_0x423c00['id']});});});});});}})[_0xfba6('0x29')](respondWithStatusCode(_0x46e6a7,null))[_0xfba6('0x49')](handleError(_0x46e6a7,null));};exports[_0xfba6('0x75')]=function(_0x530f7d,_0x4c8bed,_0x62abc3){return db[_0xfba6('0x6a')][_0xfba6('0x6b')]({'where':{'id':_0x530f7d['query'][_0xfba6('0x69')]},'attributes':['id'],'include':[{'model':db[_0xfba6('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfba6('0x29')](handleEntityNotFound(_0x4c8bed,null))['then'](function(_0x4f9143){var _0x1b03e9=_['map'](_0x4f9143,'id');var _0x173663=[];var _0x13b979=[];var _0xa8fb50=squel[_0xfba6('0x76')]();_0xa8fb50[_0xfba6('0x77')](_0xfba6('0x78'))[_0xfba6('0x79')](_0xfba6('0x7a'),'tq')[_0xfba6('0x7b')](_0xfba6('0x7c'),'ut',_0xfba6('0x7d'))[_0xfba6('0x43')](_0xfba6('0x7e'),_0x530f7d[_0xfba6('0x4b')]['id']);for(var _0x12e4cb=0x0;_0x12e4cb<_0x4f9143[_0xfba6('0x3c')];_0x12e4cb+=0x1){let _0xd63cfe=_0x4f9143[_0x12e4cb];for(var _0xbc565e=0x0;_0xbc565e<_0xd63cfe['Agents'][_0xfba6('0x3c')];_0xbc565e+=0x1){let _0x2db65d=_0xd63cfe[_0xfba6('0x6c')][_0xbc565e];var _0x86d4c1=_0xa8fb50['clone']();_0x86d4c1[_0xfba6('0x43')](_0xfba6('0x7f'),_0x2db65d['id']);_0x13b979['push'](db['sequelize'][_0xfba6('0x36')](_0x86d4c1[_0xfba6('0x80')](),{'type':db[_0xfba6('0x71')][_0xfba6('0x81')][_0xfba6('0x82')]})[_0xfba6('0x29')](function(_0x491030){if(_0x491030['length']===0x1){return _0x2db65d['id'];}else{var _0x2f5f03=_[_0xfba6('0x83')](_[_0xfba6('0x30')](_0x491030,_0xfba6('0x84')),function(_0xe563ba){return _['includes'](_0x1b03e9,_0xe563ba);});if(_0x2f5f03){return _0x2db65d['id'];}}}));}}return BPromise[_0xfba6('0x85')](_0x13b979)[_0xfba6('0x29')](function(_0x24da3b){_0x173663=_(_0x173663)[_0xfba6('0x86')](_0x24da3b)['compact']()[_0xfba6('0x87')]();return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x530f7d[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](function(_0x53e329){return db[_0xfba6('0x71')][_0xfba6('0x72')](function(_0x197625){return _0x53e329[_0xfba6('0x75')](_0x530f7d[_0xfba6('0x36')][_0xfba6('0x69')],{'transaction':_0x197625})[_0xfba6('0x29')](function(){if(!_['isEmpty'](_0x173663)){return _0x53e329['removeAgents'](_0x173663,{'transaction':_0x197625});}})['then'](function(){_0x173663['forEach'](function(_0x1e78b8){socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':_0x1e78b8,'FaxQueueId':_0x53e329['id']});});});});});});})['then'](respondWithStatusCode(_0x4c8bed,null))['catch'](handleError(_0x4c8bed,null));};exports[_0xfba6('0x8a')]=function(_0x10f346,_0x59d4be,_0x295114){return db['FaxQueue']['find']({'where':{'id':_0x10f346['params']['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x59d4be,null))[_0xfba6('0x29')](function(_0x10363d){if(_0x10363d){return _0x10363d[_0xfba6('0x8a')](_0x10f346['body'][_0xfba6('0x69')],_['omit'](_0x10f346[_0xfba6('0x4e')],['ids','id'])||{})['spread'](function(_0x5894df){for(var _0x22e470=0x0;_0x22e470<_0x10f346[_0xfba6('0x4e')][_0xfba6('0x69')][_0xfba6('0x3c')];_0x22e470+=0x1){socket[_0xfba6('0x88')](_0xfba6('0x8b'),{'UserId':Number(_0x10f346[_0xfba6('0x4e')][_0xfba6('0x69')][_0x22e470]),'FaxQueueId':Number(_0x10f346[_0xfba6('0x4b')]['id'])});}return _0x5894df;});}})[_0xfba6('0x29')](respondWithResult(_0x59d4be,null))[_0xfba6('0x49')](handleError(_0x59d4be,null));};exports[_0xfba6('0x8c')]=function(_0x56b56a,_0x3b8697,_0x4ddb14){return db['FaxQueue'][_0xfba6('0x53')]({'where':{'id':_0x56b56a['params']['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x3b8697,null))['then'](function(_0x2ceba7){if(_0x2ceba7){return _0x2ceba7[_0xfba6('0x8c')](_0x56b56a[_0xfba6('0x36')][_0xfba6('0x69')])[_0xfba6('0x29')](function(){if(_[_0xfba6('0x8d')](_0x56b56a[_0xfba6('0x36')]['ids'])){for(var _0x325297=0x0;_0x325297<_0x56b56a[_0xfba6('0x36')]['ids'][_0xfba6('0x3c')];_0x325297+=0x1){socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':Number(_0x56b56a[_0xfba6('0x36')]['ids'][_0x325297]),'FaxQueueId':Number(_0x56b56a[_0xfba6('0x4b')]['id'])});}}else{socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':Number(_0x56b56a['query'][_0xfba6('0x69')]),'FaxQueueId':Number(_0x56b56a[_0xfba6('0x4b')]['id'])});}});}})[_0xfba6('0x29')](respondWithStatusCode(_0x3b8697,null))[_0xfba6('0x49')](handleError(_0x3b8697,null));};exports[_0xfba6('0x8e')]=function(_0x2ca257,_0x353af4,_0x3a138b){var _0x12d7d5={};var _0x419005={};var _0x4cadc4;var _0x11817f;return db[_0xfba6('0x31')]['findOne']({'where':{'id':_0x2ca257[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x353af4,null))[_0xfba6('0x29')](function(_0xa8950e){if(_0xa8950e){_0x4cadc4=_0xa8950e;_0x419005[_0xfba6('0x35')]=_[_0xfba6('0x37')](db[_0xfba6('0x5d')][_0xfba6('0x4c')]);_0x419005[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x2ca257['query']);_0x419005[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x419005[_0xfba6('0x35')],_0x419005[_0xfba6('0x36')]);_0x12d7d5[_0xfba6('0x3a')]=_['intersection'](_0x419005[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x2ca257[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x12d7d5['attributes']=_0x12d7d5[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x12d7d5['attributes']:_0x419005[_0xfba6('0x35')];_0x12d7d5[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0x2ca257[_0xfba6('0x36')]['sort']);_0x12d7d5[_0xfba6('0x43')]=qs[_0xfba6('0x38')](_['pick'](_0x2ca257['query'],_0x419005[_0xfba6('0x38')]));if(_0x2ca257['query'][_0xfba6('0x41')]){_0x12d7d5[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x12d7d5[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x12d7d5[_0xfba6('0x3a')],function(_0x18bead){var _0x2c996d={};_0x2c996d[_0x18bead]={'$like':'%'+_0x2ca257['query'][_0xfba6('0x41')]+'%'};return _0x2c996d;})});}_0x12d7d5=_['merge']({},_0x12d7d5,_0x2ca257[_0xfba6('0x45')]);return _0x4cadc4[_0xfba6('0x8e')](_0x12d7d5);}})[_0xfba6('0x29')](function(_0x796be0){if(_0x796be0){_0x11817f=_0x796be0['length'];if(!_0x2ca257['query']['hasOwnProperty']('nolimit')){_0x12d7d5[_0xfba6('0x24')]=qs['limit'](_0x2ca257[_0xfba6('0x36')]['limit']);_0x12d7d5['offset']=qs[_0xfba6('0x22')](_0x2ca257['query'][_0xfba6('0x22')]);}return _0x4cadc4[_0xfba6('0x8e')](_0x12d7d5);}})[_0xfba6('0x29')](function(_0x544019){if(_0x544019){return _0x544019?{'count':_0x11817f,'rows':_0x544019}:null;}})['then'](respondWithResult(_0x353af4,null))[_0xfba6('0x49')](handleError(_0x353af4,null));}; \ No newline at end of file +var _0x25c8=['name','send','map','FaxQueue','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','FaxQueueId','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','field','tq.TeamId','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack'];(function(_0x4f8ac0,_0x5f2776){var _0x2b6329=function(_0x3d2c73){while(--_0x3d2c73){_0x4f8ac0['push'](_0x4f8ac0['shift']());}};_0x2b6329(++_0x5f2776);}(_0x25c8,0x16e));var _0x825c=function(_0x2899e3,_0x5b05a7){_0x2899e3=_0x2899e3-0x0;var _0x24fcbd=_0x25c8[_0x2899e3];return _0x24fcbd;};'use strict';var emlformat=require(_0x825c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x825c('0x1'));var jsonpatch=require(_0x825c('0x2'));var rp=require(_0x825c('0x3'));var moment=require(_0x825c('0x4'));var BPromise=require(_0x825c('0x5'));var Mustache=require(_0x825c('0x6'));var util=require(_0x825c('0x7'));var path=require(_0x825c('0x8'));var sox=require(_0x825c('0x9'));var csv=require(_0x825c('0xa'));var ejs=require(_0x825c('0xb'));var fs=require('fs');var fs_extra=require(_0x825c('0xc'));var _=require('lodash');var squel=require(_0x825c('0xd'));var crypto=require(_0x825c('0xe'));var jsforce=require(_0x825c('0xf'));var deskjs=require(_0x825c('0x10'));var toCsv=require(_0x825c('0xa'));var querystring=require(_0x825c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x825c('0x12'));var qs=require(_0x825c('0x13'));var as=require(_0x825c('0x14'));var hardwareService=require(_0x825c('0x15'));var logger=require(_0x825c('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x825c('0x17'));var db=require('../../mysqldb')['db'];config[_0x825c('0x18')]=_['defaults'](config['redis'],{'host':_0x825c('0x19'),'port':0x18eb});var socket=require(_0x825c('0x1a'))(new Redis(config['redis']));require(_0x825c('0x1b'))[_0x825c('0x1c')](socket);function respondWithStatusCode(_0xb742bf,_0x3b7241){_0x3b7241=_0x3b7241||0xcc;return function(_0x177248){if(_0x177248){return _0xb742bf[_0x825c('0x1d')](_0x3b7241);}return _0xb742bf['status'](_0x3b7241)['end']();};}function respondWithResult(_0x3eb965,_0x6b4102){_0x6b4102=_0x6b4102||0xc8;return function(_0x364da6){if(_0x364da6){return _0x3eb965[_0x825c('0x1e')](_0x6b4102)['json'](_0x364da6);}};}function respondWithFilteredResult(_0x371ca5,_0x462037){return function(_0x297ff6){if(_0x297ff6){var _0xd12a36=typeof _0x462037['offset']===_0x825c('0x1f')&&typeof _0x462037[_0x825c('0x20')]==='undefined';var _0x51b7b1=_0x297ff6[_0x825c('0x21')];var _0x18cf37=_0xd12a36?0x0:_0x462037[_0x825c('0x22')];var _0x216812=_0xd12a36?_0x297ff6[_0x825c('0x21')]:_0x462037[_0x825c('0x22')]+_0x462037[_0x825c('0x20')];var _0x5afc60;if(_0x216812>=_0x51b7b1){_0x216812=_0x51b7b1;_0x5afc60=0xc8;}else{_0x5afc60=0xce;}_0x371ca5['status'](_0x5afc60);return _0x371ca5['set'](_0x825c('0x23'),_0x18cf37+'-'+_0x216812+'/'+_0x51b7b1)[_0x825c('0x24')](_0x297ff6);}return null;};}function patchUpdates(_0x597ec1){return function(_0x44cf7e){try{jsonpatch['apply'](_0x44cf7e,_0x597ec1,!![]);}catch(_0x521c01){return BPromise[_0x825c('0x25')](_0x521c01);}return _0x44cf7e[_0x825c('0x26')]();};}function saveUpdates(_0x44050d,_0x50daab){return function(_0xef8ec9){if(_0xef8ec9){return _0xef8ec9[_0x825c('0x27')](_0x44050d)[_0x825c('0x28')](function(_0x12e570){return _0x12e570;});}return null;};}function removeEntity(_0xa5373e,_0x3a8c52){return function(_0x4473c5){if(_0x4473c5){return _0x4473c5[_0x825c('0x29')]()[_0x825c('0x28')](function(){var _0x4ea6e2=_0x4473c5[_0x825c('0x2a')]({'plain':!![]});var _0x270daa=_0x825c('0x2b');return db[_0x825c('0x2c')]['destroy']({'where':{'type':_0x270daa,'resourceId':_0x4ea6e2['id']}})[_0x825c('0x28')](function(){return _0x4473c5;});})[_0x825c('0x28')](function(){_0xa5373e['status'](0xcc)[_0x825c('0x2d')]();});}};}function handleEntityNotFound(_0x239e49,_0x373602){return function(_0xa9393e){if(!_0xa9393e){_0x239e49[_0x825c('0x1d')](0x194);}return _0xa9393e;};}function handleError(_0x5c7b5a,_0x46145f){_0x46145f=_0x46145f||0x1f4;return function(_0x3926a5){logger[_0x825c('0x2e')](_0x3926a5[_0x825c('0x2f')]);if(_0x3926a5[_0x825c('0x30')]){delete _0x3926a5[_0x825c('0x30')];}_0x5c7b5a[_0x825c('0x1e')](_0x46145f)[_0x825c('0x31')](_0x3926a5);};}exports['index']=function(_0x240b00,_0x3e1f9b){var _0x5594cc={},_0x5c7877={},_0x421d1b={'count':0x0,'rows':[]};var _0x5f0d52=_[_0x825c('0x32')](db[_0x825c('0x33')][_0x825c('0x34')],function(_0x2653ec){return{'name':_0x2653ec[_0x825c('0x35')],'type':_0x2653ec[_0x825c('0x36')][_0x825c('0x37')]};});_0x5c7877['model']=_[_0x825c('0x32')](_0x5f0d52,_0x825c('0x30'));_0x5c7877['query']=_[_0x825c('0x38')](_0x240b00[_0x825c('0x39')]);_0x5c7877[_0x825c('0x3a')]=_['intersection'](_0x5c7877[_0x825c('0x3b')],_0x5c7877[_0x825c('0x39')]);_0x5594cc[_0x825c('0x3c')]=_[_0x825c('0x3d')](_0x5c7877[_0x825c('0x3b')],qs[_0x825c('0x3e')](_0x240b00[_0x825c('0x39')][_0x825c('0x3e')]));_0x5594cc['attributes']=_0x5594cc[_0x825c('0x3c')][_0x825c('0x3f')]?_0x5594cc['attributes']:_0x5c7877['model'];if(!_0x240b00['query'][_0x825c('0x40')](_0x825c('0x41'))){_0x5594cc[_0x825c('0x20')]=qs[_0x825c('0x20')](_0x240b00['query'][_0x825c('0x20')]);_0x5594cc[_0x825c('0x22')]=qs[_0x825c('0x22')](_0x240b00[_0x825c('0x39')][_0x825c('0x22')]);}_0x5594cc[_0x825c('0x42')]=qs[_0x825c('0x43')](_0x240b00[_0x825c('0x39')][_0x825c('0x43')]);_0x5594cc[_0x825c('0x44')]=qs[_0x825c('0x3a')](_[_0x825c('0x45')](_0x240b00[_0x825c('0x39')],_0x5c7877[_0x825c('0x3a')]),_0x5f0d52);if(_0x240b00[_0x825c('0x39')][_0x825c('0x46')]){_0x5594cc[_0x825c('0x44')]=_[_0x825c('0x47')](_0x5594cc[_0x825c('0x44')],{'$or':_[_0x825c('0x32')](_0x5f0d52,function(_0x3ede74){if(_0x3ede74[_0x825c('0x36')]!=='VIRTUAL'){var _0x5bc043={};_0x5bc043[_0x3ede74[_0x825c('0x30')]]={'$like':'%'+_0x240b00[_0x825c('0x39')][_0x825c('0x46')]+'%'};return _0x5bc043;}})});}_0x5594cc=_['merge']({},_0x5594cc,_0x240b00[_0x825c('0x48')]);var _0x8a1dc9={'where':_0x5594cc[_0x825c('0x44')]};return db[_0x825c('0x33')][_0x825c('0x21')](_0x8a1dc9)['then'](function(_0x43ec52){_0x421d1b[_0x825c('0x21')]=_0x43ec52;if(_0x240b00[_0x825c('0x39')]['includeAll']){_0x5594cc[_0x825c('0x49')]=[{'all':!![]}];}return db[_0x825c('0x33')][_0x825c('0x4a')](_0x5594cc);})['then'](function(_0x2b90b6){_0x421d1b[_0x825c('0x4b')]=_0x2b90b6;return _0x421d1b;})[_0x825c('0x28')](respondWithFilteredResult(_0x3e1f9b,_0x5594cc))[_0x825c('0x4c')](handleError(_0x3e1f9b,null));};exports[_0x825c('0x4d')]=function(_0x574e21,_0xa27806){var _0x23c072={'raw':!![],'where':{'id':_0x574e21[_0x825c('0x4e')]['id']}},_0x2eb152={};_0x2eb152[_0x825c('0x3b')]=_['keys'](db[_0x825c('0x33')]['rawAttributes']);_0x2eb152[_0x825c('0x39')]=_['keys'](_0x574e21[_0x825c('0x39')]);_0x2eb152[_0x825c('0x3a')]=_['intersection'](_0x2eb152[_0x825c('0x3b')],_0x2eb152[_0x825c('0x39')]);_0x23c072[_0x825c('0x3c')]=_[_0x825c('0x3d')](_0x2eb152[_0x825c('0x3b')],qs[_0x825c('0x3e')](_0x574e21['query'][_0x825c('0x3e')]));_0x23c072[_0x825c('0x3c')]=_0x23c072['attributes'][_0x825c('0x3f')]?_0x23c072[_0x825c('0x3c')]:_0x2eb152[_0x825c('0x3b')];if(_0x574e21[_0x825c('0x39')][_0x825c('0x4f')]){_0x23c072[_0x825c('0x49')]=[{'all':!![]}];}_0x23c072=_[_0x825c('0x47')]({},_0x23c072,_0x574e21['options']);return db[_0x825c('0x33')][_0x825c('0x50')](_0x23c072)[_0x825c('0x28')](handleEntityNotFound(_0xa27806,null))[_0x825c('0x28')](respondWithResult(_0xa27806,null))[_0x825c('0x4c')](handleError(_0xa27806,null));};exports[_0x825c('0x51')]=function(_0x11d610,_0x3baa3b){return db[_0x825c('0x33')]['create'](_0x11d610[_0x825c('0x52')],{})['then'](function(_0x3c7c99){var _0x499520=_0x11d610['user']['get']({'plain':!![]});if(!_0x499520)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x499520[_0x825c('0x53')]===_0x825c('0x54')){var _0x50ef1d=_0x3c7c99[_0x825c('0x2a')]({'plain':!![]});var _0x3eba72=_0x825c('0x2b');return db[_0x825c('0x55')][_0x825c('0x50')]({'where':{'name':_0x3eba72,'userProfileId':_0x499520[_0x825c('0x56')]},'raw':!![]})[_0x825c('0x28')](function(_0x1ffd76){if(_0x1ffd76&&_0x1ffd76[_0x825c('0x57')]===0x0){return db[_0x825c('0x2c')]['create']({'name':_0x50ef1d[_0x825c('0x30')],'resourceId':_0x50ef1d['id'],'type':_0x1ffd76[_0x825c('0x30')],'sectionId':_0x1ffd76['id']},{})[_0x825c('0x28')](function(){return _0x3c7c99;});}else{return _0x3c7c99;}})[_0x825c('0x4c')](function(_0x21cfa4){logger[_0x825c('0x2e')](_0x825c('0x58'),_0x21cfa4);throw _0x21cfa4;});}return _0x3c7c99;})[_0x825c('0x28')](respondWithResult(_0x3baa3b,0xc9))[_0x825c('0x4c')](handleError(_0x3baa3b,null));};exports[_0x825c('0x27')]=function(_0x3f1679,_0x4b6ebf){if(_0x3f1679[_0x825c('0x52')]['id']){delete _0x3f1679['body']['id'];}return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x3f1679[_0x825c('0x4e')]['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x4b6ebf,null))[_0x825c('0x28')](saveUpdates(_0x3f1679['body'],null))[_0x825c('0x28')](respondWithResult(_0x4b6ebf,null))[_0x825c('0x4c')](handleError(_0x4b6ebf,null));};exports[_0x825c('0x29')]=function(_0x571939,_0x537319){return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x571939[_0x825c('0x4e')]['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x537319,null))[_0x825c('0x28')](removeEntity(_0x537319,null))[_0x825c('0x4c')](handleError(_0x537319,null));};exports['describe']=function(_0x175e1c,_0xb23cda){return db[_0x825c('0x33')][_0x825c('0x59')]()[_0x825c('0x28')](respondWithResult(_0xb23cda,null))[_0x825c('0x4c')](handleError(_0xb23cda,null));};exports[_0x825c('0x5a')]=function(_0x5429ee,_0x48b1fe,_0xf245e8){var _0x1fc411={'raw':!![],'where':{}},_0x2a5c17={},_0x49f7f2;return db[_0x825c('0x33')]['findOne']({'where':{'id':_0x5429ee['params']['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x48b1fe,null))[_0x825c('0x28')](function(_0x1dff81){if(_0x1dff81){_0x49f7f2=_0x1dff81[_0x825c('0x2a')]({'plain':!![]});_0x2a5c17[_0x825c('0x3b')]=_[_0x825c('0x38')](db[_0x825c('0x5b')][_0x825c('0x34')]);_0x2a5c17[_0x825c('0x39')]=_[_0x825c('0x38')](_0x5429ee[_0x825c('0x39')]);_0x2a5c17['filters']=_['intersection'](_0x2a5c17[_0x825c('0x3b')],_0x2a5c17['query']);_0x1fc411['attributes']=_[_0x825c('0x3d')](_0x2a5c17['model'],qs[_0x825c('0x3e')](_0x5429ee[_0x825c('0x39')][_0x825c('0x3e')]));_0x1fc411[_0x825c('0x3c')]=_0x1fc411[_0x825c('0x3c')][_0x825c('0x3f')]?_0x1fc411[_0x825c('0x3c')]:_0x2a5c17[_0x825c('0x3b')];if(!_0x5429ee[_0x825c('0x39')][_0x825c('0x40')]('nolimit')){_0x1fc411[_0x825c('0x20')]=qs[_0x825c('0x20')](_0x5429ee[_0x825c('0x39')][_0x825c('0x20')]);_0x1fc411['offset']=qs['offset'](_0x5429ee[_0x825c('0x39')][_0x825c('0x22')]);}_0x1fc411[_0x825c('0x42')]=qs[_0x825c('0x43')](_0x5429ee['query']['sort']);_0x1fc411[_0x825c('0x44')]=qs[_0x825c('0x3a')](_[_0x825c('0x45')](_0x5429ee[_0x825c('0x39')],_0x2a5c17[_0x825c('0x3a')]));_0x1fc411[_0x825c('0x44')][_0x825c('0x5c')]=_0x1dff81['id'];if(_0x5429ee[_0x825c('0x39')][_0x825c('0x46')]){_0x1fc411['where']=_['merge'](_0x1fc411[_0x825c('0x44')],{'$or':_['map'](_0x1fc411[_0x825c('0x3c')],function(_0x575076){var _0x1a7764={};_0x1a7764[_0x575076]={'$like':'%'+_0x5429ee[_0x825c('0x39')][_0x825c('0x46')]+'%'};return _0x1a7764;})});}_0x1fc411=_[_0x825c('0x47')]({},_0x1fc411,_0x5429ee[_0x825c('0x48')]);return db[_0x825c('0x5b')][_0x825c('0x4a')](_0x1fc411);}})[_0x825c('0x28')](function(_0x589331){if(_0x589331){return db['User']['findAndCountAll']({'where':{'id':_[_0x825c('0x32')](_0x589331,_0x825c('0x5d')),'role':'agent'},'attributes':['id','name',_0x825c('0x5e'),'updatedAt',_0x825c('0x5f')]});}})[_0x825c('0x28')](function(_0xb5e838){if(_0xb5e838){return{'count':_0xb5e838[_0x825c('0x21')],'rows':_[_0x825c('0x32')](_0xb5e838['rows'],function(_0x4045ac){return{'membername':_0x4045ac[_0x825c('0x30')],'UserId':_0x4045ac['id'],'queue_name':_0x49f7f2[_0x825c('0x30')],'FaxQueueId':_0x49f7f2['id'],'interface':util[_0x825c('0x60')](_0x825c('0x61'),_0x825c('0x62'),_0x4045ac[_0x825c('0x30')]),'penalty':0x0,'paused':_0x4045ac[_0x825c('0x5e')],'createdAt':_0x4045ac[_0x825c('0x5f')],'updatedAt':_0x4045ac[_0x825c('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x48b1fe,_0x1fc411))['catch'](handleError(_0x48b1fe,null));};exports[_0x825c('0x64')]=function(_0x26a49a,_0x2c6626,_0x45b6ee){var _0x498526={};var _0x1ca7e6={};var _0x24427f;var _0x29e2d0;return db[_0x825c('0x33')]['findOne']({'where':{'id':_0x26a49a['params']['id']}})['then'](handleEntityNotFound(_0x2c6626,null))['then'](function(_0x33dbb5){if(_0x33dbb5){_0x24427f=_0x33dbb5;_0x1ca7e6[_0x825c('0x3b')]=_[_0x825c('0x38')](db[_0x825c('0x65')][_0x825c('0x34')]);_0x1ca7e6[_0x825c('0x39')]=_[_0x825c('0x38')](_0x26a49a[_0x825c('0x39')]);_0x1ca7e6[_0x825c('0x3a')]=_['intersection'](_0x1ca7e6[_0x825c('0x3b')],_0x1ca7e6[_0x825c('0x39')]);_0x498526[_0x825c('0x3c')]=_[_0x825c('0x3d')](_0x1ca7e6['model'],qs['fields'](_0x26a49a['query'][_0x825c('0x3e')]));_0x498526[_0x825c('0x3c')]=_0x498526[_0x825c('0x3c')][_0x825c('0x3f')]?_0x498526['attributes']:_0x1ca7e6[_0x825c('0x3b')];_0x498526[_0x825c('0x42')]=qs[_0x825c('0x43')](_0x26a49a[_0x825c('0x39')][_0x825c('0x43')]);_0x498526[_0x825c('0x44')]=qs[_0x825c('0x3a')](_[_0x825c('0x45')](_0x26a49a[_0x825c('0x39')],_0x1ca7e6[_0x825c('0x3a')]));if(_0x26a49a[_0x825c('0x39')]['filter']){_0x498526[_0x825c('0x44')]=_[_0x825c('0x47')](_0x498526[_0x825c('0x44')],{'$or':_[_0x825c('0x32')](_0x498526[_0x825c('0x3c')],function(_0x2cf8b5){var _0x34fbc8={};_0x34fbc8[_0x2cf8b5]={'$like':'%'+_0x26a49a['query'][_0x825c('0x46')]+'%'};return _0x34fbc8;})});}_0x498526=_['merge']({},_0x498526,_0x26a49a[_0x825c('0x48')]);return _0x24427f[_0x825c('0x64')](_0x498526);}})[_0x825c('0x28')](function(_0x15a0af){if(_0x15a0af){_0x29e2d0=_0x15a0af[_0x825c('0x3f')];if(!_0x26a49a[_0x825c('0x39')][_0x825c('0x40')](_0x825c('0x41'))){_0x498526[_0x825c('0x20')]=qs['limit'](_0x26a49a[_0x825c('0x39')][_0x825c('0x20')]);_0x498526[_0x825c('0x22')]=qs[_0x825c('0x22')](_0x26a49a[_0x825c('0x39')][_0x825c('0x22')]);}return _0x24427f[_0x825c('0x64')](_0x498526);}})['then'](function(_0x166671){if(_0x166671){return _0x166671?{'count':_0x29e2d0,'rows':_0x166671}:null;}})[_0x825c('0x28')](respondWithResult(_0x2c6626,null))[_0x825c('0x4c')](handleError(_0x2c6626,null));};exports[_0x825c('0x66')]=function(_0x29d9ec,_0x4a0975,_0xaa0591){var _0x35b415=_0x29d9ec[_0x825c('0x52')][_0x825c('0x67')];return db['Team']['findAll']({'where':{'id':_0x35b415},'attributes':['id'],'include':[{'model':db['User'],'as':_0x825c('0x68'),'attributes':['id',_0x825c('0x30'),_0x825c('0x69'),_0x825c('0x6a'),_0x825c('0x6b')],'raw':!![]}]})['then'](function(_0x3e64af){if(_0x3e64af){var _0x19df37=_[_0x825c('0x6c')](_0x3e64af,function(_0x27df42){var _0x342b09=_0x27df42[_0x825c('0x2a')]({'plain':!![]});return _0x342b09[_0x825c('0x68')];});return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x29d9ec['params']['id']}})['then'](function(_0x7c8222){return db[_0x825c('0x6d')][_0x825c('0x6e')](function(_0x2ddc1e){return _0x7c8222[_0x825c('0x66')](_0x35b415,{'transaction':_0x2ddc1e})[_0x825c('0x28')](function(){return BPromise['each'](_0x19df37,function(_0x4e8d67){return db[_0x825c('0x5b')][_0x825c('0x6f')]({'where':{'UserId':_0x4e8d67['id'],'FaxQueueId':_0x29d9ec[_0x825c('0x4e')]['id']},'transaction':_0x2ddc1e});});})[_0x825c('0x28')](function(){_0x19df37[_0x825c('0x70')](function(_0x8f7d8){socket[_0x825c('0x71')](_0x825c('0x72'),{'UserId':_0x8f7d8['id'],'FaxQueueId':_0x7c8222['id']});});});});});}})[_0x825c('0x28')](respondWithStatusCode(_0x4a0975,null))[_0x825c('0x4c')](handleError(_0x4a0975,null));};exports[_0x825c('0x73')]=function(_0x2b1e50,_0x119d81,_0x4a398e){return db[_0x825c('0x65')]['findAll']({'where':{'id':_0x2b1e50[_0x825c('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x825c('0x74')],'as':_0x825c('0x68'),'attributes':['id'],'raw':!![]}]})[_0x825c('0x28')](handleEntityNotFound(_0x119d81,null))[_0x825c('0x28')](function(_0x6119ab){var _0x27c537=_[_0x825c('0x32')](_0x6119ab,'id');var _0x40e5c4=[];var _0x3d19b0=[];var _0x391b6f=squel['select']();_0x391b6f[_0x825c('0x75')](_0x825c('0x76'))['from']('team_has_fax_queues','tq')[_0x825c('0x77')](_0x825c('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x825c('0x79'),_0x2b1e50[_0x825c('0x4e')]['id']);for(var _0x364790=0x0;_0x364790<_0x6119ab[_0x825c('0x3f')];_0x364790+=0x1){let _0x4d9c3c=_0x6119ab[_0x364790];for(var _0x4421c7=0x0;_0x4421c7<_0x4d9c3c['Agents'][_0x825c('0x3f')];_0x4421c7+=0x1){let _0x1e7392=_0x4d9c3c[_0x825c('0x68')][_0x4421c7];var _0x1cf09b=_0x391b6f[_0x825c('0x7a')]();_0x1cf09b['where'](_0x825c('0x7b'),_0x1e7392['id']);_0x3d19b0[_0x825c('0x7c')](db[_0x825c('0x6d')][_0x825c('0x39')](_0x1cf09b[_0x825c('0x7d')](),{'type':db['sequelize'][_0x825c('0x7e')]['SELECT']})[_0x825c('0x28')](function(_0x58df03){if(_0x58df03[_0x825c('0x3f')]===0x1){return _0x1e7392['id'];}else{var _0x12d5e6=_[_0x825c('0x7f')](_['map'](_0x58df03,_0x825c('0x80')),function(_0x4c63f1){return _[_0x825c('0x81')](_0x27c537,_0x4c63f1);});if(_0x12d5e6){return _0x1e7392['id'];}}}));}}return BPromise['all'](_0x3d19b0)[_0x825c('0x28')](function(_0x1516ec){_0x40e5c4=_(_0x40e5c4)[_0x825c('0x82')](_0x1516ec)['compact']()['value']();return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x2b1e50['params']['id']}})['then'](function(_0x522dd7){return db[_0x825c('0x6d')][_0x825c('0x6e')](function(_0x3447bd){return _0x522dd7[_0x825c('0x73')](_0x2b1e50[_0x825c('0x39')]['ids'],{'transaction':_0x3447bd})[_0x825c('0x28')](function(){if(!_['isEmpty'](_0x40e5c4)){return _0x522dd7[_0x825c('0x83')](_0x40e5c4,{'transaction':_0x3447bd});}})[_0x825c('0x28')](function(){_0x40e5c4[_0x825c('0x70')](function(_0x51962b){socket[_0x825c('0x71')](_0x825c('0x84'),{'UserId':_0x51962b,'FaxQueueId':_0x522dd7['id']});});});});});});})[_0x825c('0x28')](respondWithStatusCode(_0x119d81,null))[_0x825c('0x4c')](handleError(_0x119d81,null));};exports['addAgents']=function(_0x4aa05e,_0x5b3c1f,_0x5a7052){return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x4aa05e['params']['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x5b3c1f,null))['then'](function(_0x1590dc){if(_0x1590dc){return _0x1590dc[_0x825c('0x85')](_0x4aa05e[_0x825c('0x52')]['ids'],_[_0x825c('0x86')](_0x4aa05e[_0x825c('0x52')],[_0x825c('0x67'),'id'])||{})[_0x825c('0x87')](function(_0x2fd268){for(var _0x5d962a=0x0;_0x5d962a<_0x4aa05e[_0x825c('0x52')][_0x825c('0x67')][_0x825c('0x3f')];_0x5d962a+=0x1){socket[_0x825c('0x71')](_0x825c('0x72'),{'UserId':Number(_0x4aa05e['body'][_0x825c('0x67')][_0x5d962a]),'FaxQueueId':Number(_0x4aa05e[_0x825c('0x4e')]['id'])});}return _0x2fd268;});}})[_0x825c('0x28')](respondWithResult(_0x5b3c1f,null))[_0x825c('0x4c')](handleError(_0x5b3c1f,null));};exports['removeAgents']=function(_0x5f3409,_0x3e0330,_0x14ee44){return db[_0x825c('0x33')][_0x825c('0x50')]({'where':{'id':_0x5f3409[_0x825c('0x4e')]['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x3e0330,null))[_0x825c('0x28')](function(_0x1f64c2){if(_0x1f64c2){return _0x1f64c2[_0x825c('0x83')](_0x5f3409[_0x825c('0x39')][_0x825c('0x67')])[_0x825c('0x28')](function(){if(_['isArray'](_0x5f3409[_0x825c('0x39')][_0x825c('0x67')])){for(var _0x441ffe=0x0;_0x441ffe<_0x5f3409[_0x825c('0x39')]['ids'][_0x825c('0x3f')];_0x441ffe+=0x1){socket[_0x825c('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x5f3409['query'][_0x825c('0x67')][_0x441ffe]),'FaxQueueId':Number(_0x5f3409[_0x825c('0x4e')]['id'])});}}else{socket[_0x825c('0x71')](_0x825c('0x84'),{'UserId':Number(_0x5f3409[_0x825c('0x39')][_0x825c('0x67')]),'FaxQueueId':Number(_0x5f3409[_0x825c('0x4e')]['id'])});}});}})[_0x825c('0x28')](respondWithStatusCode(_0x3e0330,null))[_0x825c('0x4c')](handleError(_0x3e0330,null));};exports[_0x825c('0x88')]=function(_0x5215f3,_0x5556dd,_0x393af4){var _0x122a0a={};var _0x1d390b={};var _0x582be3;var _0x24c967;return db[_0x825c('0x33')][_0x825c('0x89')]({'where':{'id':_0x5215f3[_0x825c('0x4e')]['id']}})[_0x825c('0x28')](handleEntityNotFound(_0x5556dd,null))[_0x825c('0x28')](function(_0x96d03){if(_0x96d03){_0x582be3=_0x96d03;_0x1d390b['model']=_[_0x825c('0x38')](db[_0x825c('0x74')][_0x825c('0x34')]);_0x1d390b['query']=_['keys'](_0x5215f3[_0x825c('0x39')]);_0x1d390b[_0x825c('0x3a')]=_['intersection'](_0x1d390b['model'],_0x1d390b[_0x825c('0x39')]);_0x122a0a[_0x825c('0x3c')]=_['intersection'](_0x1d390b[_0x825c('0x3b')],qs[_0x825c('0x3e')](_0x5215f3[_0x825c('0x39')]['fields']));_0x122a0a['attributes']=_0x122a0a[_0x825c('0x3c')][_0x825c('0x3f')]?_0x122a0a[_0x825c('0x3c')]:_0x1d390b[_0x825c('0x3b')];_0x122a0a[_0x825c('0x42')]=qs['sort'](_0x5215f3[_0x825c('0x39')][_0x825c('0x43')]);_0x122a0a[_0x825c('0x44')]=qs[_0x825c('0x3a')](_[_0x825c('0x45')](_0x5215f3[_0x825c('0x39')],_0x1d390b[_0x825c('0x3a')]));if(_0x5215f3['query'][_0x825c('0x46')]){_0x122a0a[_0x825c('0x44')]=_[_0x825c('0x47')](_0x122a0a[_0x825c('0x44')],{'$or':_[_0x825c('0x32')](_0x122a0a['attributes'],function(_0x23be7b){var _0x3bc3c0={};_0x3bc3c0[_0x23be7b]={'$like':'%'+_0x5215f3[_0x825c('0x39')][_0x825c('0x46')]+'%'};return _0x3bc3c0;})});}_0x122a0a=_[_0x825c('0x47')]({},_0x122a0a,_0x5215f3[_0x825c('0x48')]);return _0x582be3['getAgents'](_0x122a0a);}})['then'](function(_0x3a60ee){if(_0x3a60ee){_0x24c967=_0x3a60ee[_0x825c('0x3f')];if(!_0x5215f3['query'][_0x825c('0x40')](_0x825c('0x41'))){_0x122a0a[_0x825c('0x20')]=qs[_0x825c('0x20')](_0x5215f3[_0x825c('0x39')][_0x825c('0x20')]);_0x122a0a[_0x825c('0x22')]=qs[_0x825c('0x22')](_0x5215f3['query'][_0x825c('0x22')]);}return _0x582be3[_0x825c('0x88')](_0x122a0a);}})[_0x825c('0x28')](function(_0x3c4852){if(_0x3c4852){return _0x3c4852?{'count':_0x24c967,'rows':_0x3c4852}:null;}})[_0x825c('0x28')](respondWithResult(_0x5556dd,null))[_0x825c('0x4c')](handleError(_0x5556dd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index cf2e984..ac56297 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 _0x3dfd=['../../mysqldb','FaxQueue','save','update','remove','emit','hook','events'];(function(_0x515f30,_0x5ae1ae){var _0x532d1b=function(_0x1b9ebc){while(--_0x1b9ebc){_0x515f30['push'](_0x515f30['shift']());}};_0x532d1b(++_0x5ae1ae);}(_0x3dfd,0xb7));var _0xd3df=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3dfd[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xd3df('0x0'));var FaxQueue=require(_0xd3df('0x1'))['db'][_0xd3df('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3df('0x3'),'afterUpdate':_0xd3df('0x4'),'afterDestroy':_0xd3df('0x5')};function emitEvent(_0x35570f){return function(_0x222223,_0x35d494,_0x31825e){FaxQueueEvents[_0xd3df('0x6')](_0x35570f+':'+_0x222223['id'],_0x222223);FaxQueueEvents[_0xd3df('0x6')](_0x35570f,_0x222223);_0x31825e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xd3df('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x411c=['../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x476b5b,_0x6172f8){var _0x24a924=function(_0x258664){while(--_0x258664){_0x476b5b['push'](_0x476b5b['shift']());}};_0x24a924(++_0x6172f8);}(_0x411c,0xc8));var _0xc411=function(_0x4689d9,_0x3162d9){_0x4689d9=_0x4689d9-0x0;var _0x5174d1=_0x411c[_0x4689d9];return _0x5174d1;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xc411('0x0'))['db'][_0xc411('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc411('0x2')](0x0);var events={'afterCreate':_0xc411('0x3'),'afterUpdate':_0xc411('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5834f8){return function(_0x23b8a9,_0x1c1136,_0xc27655){FaxQueueEvents['emit'](_0x5834f8+':'+_0x23b8a9['id'],_0x23b8a9);FaxQueueEvents[_0xc411('0x5')](_0x5834f8,_0x23b8a9);_0xc27655(null);};}for(var e in events){if(events[_0xc411('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xc411('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 3f824df..2b813a6 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 _0xb57d=['FaxQueue','util','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xb57d,0xd9));var _0xdb57=function(_0x1144c8,_0x454242){_0x1144c8=_0x1144c8-0x0;var _0xa4c112=_0xb57d[_0x1144c8];return _0xa4c112;};'use strict';var _=require('lodash');var util=require(_0xdb57('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdb57('0x1'));var rp=require(_0xdb57('0x2'));var fs=require('fs');var path=require(_0xdb57('0x3'));var rimraf=require(_0xdb57('0x4'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xdb57('0x5')]=function(_0x392967,_0x3a4ad9){return _0x392967[_0xdb57('0x6')](_0xdb57('0x7'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd635=['../../config/logger','api','moment','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0xd635,0x1e6));var _0x5d63=function(_0x1a84fc,_0x32fb6f){_0x1a84fc=_0x1a84fc-0x0;var _0x178d3a=_0xd635[_0x1a84fc];return _0x178d3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d63('0x0'))(_0x5d63('0x1'));var moment=require(_0x5d63('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d63('0x3'));var rimraf=require(_0x5d63('0x4'));var config=require(_0x5d63('0x5'));var attributes=require(_0x5d63('0x6'));module['exports']=function(_0x2f048c,_0xabd984){return _0x2f048c[_0x5d63('0x7')](_0x5d63('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index cb41eea..5386642 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 _0x7086=['rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','findAll','options','attributes','limit','include','map','model','GetFaxQueue','FaxQueue','find','raw','then','ShowFaxQueue','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x49d04b,_0x3057e8){var _0xbef275=function(_0x18c062){while(--_0x18c062){_0x49d04b['push'](_0x49d04b['shift']());}};_0xbef275(++_0x3057e8);}(_0x7086,0xb4));var _0x6708=function(_0xb26a90,_0x35cc71){_0xb26a90=_0xb26a90-0x0;var _0x147751=_0x7086[_0xb26a90];return _0x147751;};'use strict';var _=require(_0x6708('0x0'));var util=require('util');var moment=require(_0x6708('0x1'));var BPromise=require(_0x6708('0x2'));var rs=require(_0x6708('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6708('0x4'));var logger=require('../../config/logger')(_0x6708('0x5'));var config=require(_0x6708('0x6'));var jayson=require(_0x6708('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6708('0x8')]=_[_0x6708('0x9')](config[_0x6708('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6708('0xa'))(new Redis(config[_0x6708('0x8')]));require(_0x6708('0xb'))[_0x6708('0xc')](socket);function respondWithRpcPromise(_0x2350ba,_0x3bf276,_0x67bdb1){return new BPromise(function(_0x3ccdee,_0x17d648){return client[_0x6708('0xd')](_0x2350ba,_0x67bdb1)['then'](function(_0x56b433){logger[_0x6708('0xe')]('FaxQueue,\x20%s,\x20%s',_0x3bf276,_0x6708('0xf'));logger[_0x6708('0x10')](_0x6708('0x11'),_0x3bf276,_0x6708('0xf'),JSON[_0x6708('0x12')](_0x56b433));if(_0x56b433[_0x6708('0x13')]){if(_0x56b433['error'][_0x6708('0x14')]===0x1f4){logger[_0x6708('0x13')](_0x6708('0x15'),_0x3bf276,_0x56b433[_0x6708('0x13')][_0x6708('0x16')]);return _0x17d648(_0x56b433[_0x6708('0x13')][_0x6708('0x16')]);}logger[_0x6708('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3bf276,_0x56b433[_0x6708('0x13')]['message']);return _0x3ccdee(_0x56b433[_0x6708('0x13')]['message']);}else{logger[_0x6708('0xe')](_0x6708('0x15'),_0x3bf276,_0x6708('0xf'));_0x3ccdee(_0x56b433['result'][_0x6708('0x16')]);}})[_0x6708('0x17')](function(_0x5e0e25){logger['error'](_0x6708('0x15'),_0x3bf276,_0x5e0e25);_0x17d648(_0x5e0e25);});});}exports['GetFaxQueue']=function(_0x2c0128){var _0x2a5979=this;return new Promise(function(_0xf94c7c,_0x136308){return db['FaxQueue'][_0x6708('0x18')]({'raw':_0x2c0128['options']?_0x2c0128['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c0128['options']?_0x2c0128[_0x6708('0x19')]['where']||null:null,'attributes':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1a')]||null:null,'limit':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1b')]||null:null,'include':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x2c0128[_0x6708('0x19')]['include'],function(_0x387a19){return{'model':db[_0x387a19[_0x6708('0x1e')]],'as':_0x387a19['as'],'attributes':_0x387a19['attributes'],'include':_0x387a19[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x387a19[_0x6708('0x1c')],function(_0x3f304){return{'model':db[_0x3f304['model']],'as':_0x3f304['as'],'attributes':_0x3f304[_0x6708('0x1a')],'include':_0x3f304[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x3f304[_0x6708('0x1c')],function(_0x2d3f6b){return{'model':db[_0x2d3f6b[_0x6708('0x1e')]],'as':_0x2d3f6b['as'],'attributes':_0x2d3f6b[_0x6708('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f63da){logger[_0x6708('0xe')](_0x6708('0x1f'),_0x2c0128);logger[_0x6708('0x10')](_0x6708('0x1f'),_0x2c0128,JSON[_0x6708('0x12')](_0x3f63da));_0xf94c7c(_0x3f63da);})['catch'](function(_0x4bc260){logger[_0x6708('0x13')](_0x6708('0x1f'),_0x4bc260[_0x6708('0x16')],_0x2c0128);_0x136308(_0x2a5979[_0x6708('0x13')](0x1f4,_0x4bc260[_0x6708('0x16')]));});});};exports['ShowFaxQueue']=function(_0x18992f){var _0x32ef6b=this;return new Promise(function(_0x2c7658,_0x41529f){return db[_0x6708('0x20')][_0x6708('0x21')]({'raw':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x22')]===undefined?!![]:![]:!![],'where':_0x18992f[_0x6708('0x19')]?_0x18992f['options']['where']||null:null,'attributes':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x1a')]||null:null,'include':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x1c')]?_['map'](_0x18992f['options'][_0x6708('0x1c')],function(_0x42edcd){return{'model':db[_0x42edcd[_0x6708('0x1e')]],'as':_0x42edcd['as'],'attributes':_0x42edcd['attributes'],'include':_0x42edcd[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x42edcd[_0x6708('0x1c')],function(_0x54b0d6){return{'model':db[_0x54b0d6[_0x6708('0x1e')]],'as':_0x54b0d6['as'],'attributes':_0x54b0d6['attributes'],'include':_0x54b0d6[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x54b0d6[_0x6708('0x1c')],function(_0x52c7c8){return{'model':db[_0x52c7c8[_0x6708('0x1e')]],'as':_0x52c7c8['as'],'attributes':_0x52c7c8[_0x6708('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6708('0x23')](function(_0x32ed86){logger['info'](_0x6708('0x24'),_0x18992f);logger[_0x6708('0x10')](_0x6708('0x24'),_0x18992f,JSON['stringify'](_0x32ed86));_0x2c7658(_0x32ed86);})['catch'](function(_0x44f00b){logger[_0x6708('0x13')](_0x6708('0x24'),_0x44f00b[_0x6708('0x16')],_0x18992f);_0x41529f(_0x32ef6b[_0x6708('0x13')](0x1f4,_0x44f00b[_0x6708('0x16')]));});});}; \ No newline at end of file +var _0x4085=['defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','redis'];(function(_0x1fad89,_0x3fa02b){var _0x46e69c=function(_0x316e32){while(--_0x316e32){_0x1fad89['push'](_0x1fad89['shift']());}};_0x46e69c(++_0x3fa02b);}(_0x4085,0x100));var _0x5408=function(_0x243aa4,_0x4136bf){_0x243aa4=_0x243aa4-0x0;var _0x5b9261=_0x4085[_0x243aa4];return _0x5b9261;};'use strict';var _=require(_0x5408('0x0'));var util=require(_0x5408('0x1'));var moment=require(_0x5408('0x2'));var BPromise=require(_0x5408('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5408('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5408('0x5'));var logger=require('../../config/logger')(_0x5408('0x6'));var config=require(_0x5408('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5408('0x8')]({'port':0x232a});config[_0x5408('0x9')]=_[_0x5408('0xa')](config[_0x5408('0x9')],{'host':_0x5408('0xb'),'port':0x18eb});var socket=require(_0x5408('0xc'))(new Redis(config['redis']));require(_0x5408('0xd'))[_0x5408('0xe')](socket);function respondWithRpcPromise(_0x4ae9b2,_0x17dd7b,_0x570919){return new BPromise(function(_0x2c6984,_0x285fc6){return client[_0x5408('0xf')](_0x4ae9b2,_0x570919)['then'](function(_0x465ad1){logger[_0x5408('0x10')](_0x5408('0x11'),_0x17dd7b,'request\x20sent');logger[_0x5408('0x12')](_0x5408('0x13'),_0x17dd7b,_0x5408('0x14'),JSON[_0x5408('0x15')](_0x465ad1));if(_0x465ad1[_0x5408('0x16')]){if(_0x465ad1[_0x5408('0x16')]['code']===0x1f4){logger[_0x5408('0x16')]('FaxQueue,\x20%s,\x20%s',_0x17dd7b,_0x465ad1[_0x5408('0x16')][_0x5408('0x17')]);return _0x285fc6(_0x465ad1[_0x5408('0x16')][_0x5408('0x17')]);}logger[_0x5408('0x16')](_0x5408('0x11'),_0x17dd7b,_0x465ad1['error']['message']);return _0x2c6984(_0x465ad1[_0x5408('0x16')][_0x5408('0x17')]);}else{logger[_0x5408('0x10')](_0x5408('0x11'),_0x17dd7b,_0x5408('0x14'));_0x2c6984(_0x465ad1['result'][_0x5408('0x17')]);}})[_0x5408('0x18')](function(_0x51bda8){logger[_0x5408('0x16')]('FaxQueue,\x20%s,\x20%s',_0x17dd7b,_0x51bda8);_0x285fc6(_0x51bda8);});});}exports[_0x5408('0x19')]=function(_0x3afc67){var _0x6de97b=this;return new Promise(function(_0x423562,_0x2768e3){return db[_0x5408('0x1a')][_0x5408('0x1b')]({'raw':_0x3afc67['options']?_0x3afc67[_0x5408('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3afc67[_0x5408('0x1c')]?_0x3afc67[_0x5408('0x1c')][_0x5408('0x1d')]||null:null,'attributes':_0x3afc67[_0x5408('0x1c')]?_0x3afc67[_0x5408('0x1c')][_0x5408('0x1e')]||null:null,'limit':_0x3afc67['options']?_0x3afc67[_0x5408('0x1c')][_0x5408('0x1f')]||null:null,'include':_0x3afc67['options']?_0x3afc67[_0x5408('0x1c')][_0x5408('0x20')]?_[_0x5408('0x21')](_0x3afc67['options'][_0x5408('0x20')],function(_0x1d026c){return{'model':db[_0x1d026c[_0x5408('0x22')]],'as':_0x1d026c['as'],'attributes':_0x1d026c[_0x5408('0x1e')],'include':_0x1d026c[_0x5408('0x20')]?_[_0x5408('0x21')](_0x1d026c['include'],function(_0x460763){return{'model':db[_0x460763['model']],'as':_0x460763['as'],'attributes':_0x460763['attributes'],'include':_0x460763[_0x5408('0x20')]?_[_0x5408('0x21')](_0x460763[_0x5408('0x20')],function(_0x340338){return{'model':db[_0x340338[_0x5408('0x22')]],'as':_0x340338['as'],'attributes':_0x340338[_0x5408('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5408('0x23')](function(_0x4f942a){logger[_0x5408('0x10')](_0x5408('0x19'),_0x3afc67);logger[_0x5408('0x12')]('GetFaxQueue',_0x3afc67,JSON[_0x5408('0x15')](_0x4f942a));_0x423562(_0x4f942a);})[_0x5408('0x18')](function(_0x542951){logger['error'](_0x5408('0x19'),_0x542951[_0x5408('0x17')],_0x3afc67);_0x2768e3(_0x6de97b[_0x5408('0x16')](0x1f4,_0x542951[_0x5408('0x17')]));});});};exports[_0x5408('0x24')]=function(_0x10a6de){var _0x56222a=this;return new Promise(function(_0x4a3aad,_0x5e1176){return db[_0x5408('0x1a')][_0x5408('0x25')]({'raw':_0x10a6de[_0x5408('0x1c')]?_0x10a6de[_0x5408('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x10a6de[_0x5408('0x1c')]?_0x10a6de['options']['where']||null:null,'attributes':_0x10a6de[_0x5408('0x1c')]?_0x10a6de[_0x5408('0x1c')][_0x5408('0x1e')]||null:null,'include':_0x10a6de[_0x5408('0x1c')]?_0x10a6de[_0x5408('0x1c')][_0x5408('0x20')]?_[_0x5408('0x21')](_0x10a6de[_0x5408('0x1c')][_0x5408('0x20')],function(_0x4da793){return{'model':db[_0x4da793[_0x5408('0x22')]],'as':_0x4da793['as'],'attributes':_0x4da793['attributes'],'include':_0x4da793['include']?_[_0x5408('0x21')](_0x4da793['include'],function(_0x2d48af){return{'model':db[_0x2d48af['model']],'as':_0x2d48af['as'],'attributes':_0x2d48af[_0x5408('0x1e')],'include':_0x2d48af[_0x5408('0x20')]?_['map'](_0x2d48af['include'],function(_0x402480){return{'model':db[_0x402480[_0x5408('0x22')]],'as':_0x402480['as'],'attributes':_0x402480[_0x5408('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5408('0x23')](function(_0x3c0515){logger[_0x5408('0x10')](_0x5408('0x24'),_0x10a6de);logger['debug'](_0x5408('0x24'),_0x10a6de,JSON['stringify'](_0x3c0515));_0x4a3aad(_0x3c0515);})[_0x5408('0x18')](function(_0x1032f5){logger[_0x5408('0x16')](_0x5408('0x24'),_0x1032f5['message'],_0x10a6de);_0x5e1176(_0x56222a[_0x5408('0x16')](0x1f4,_0x1032f5[_0x5408('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 3cc9b5e..2fdcda9 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 _0x8ae2=['length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x5162e9,_0x55c047){var _0xea59da=function(_0x5e71ed){while(--_0x5e71ed){_0x5162e9['push'](_0x5162e9['shift']());}};_0xea59da(++_0x55c047);}(_0x8ae2,0x140));var _0x28ae=function(_0x125318,_0x43102e){_0x125318=_0x125318-0x0;var _0x1db4fc=_0x8ae2[_0x125318];return _0x1db4fc;};'use strict';var FaxQueueEvents=require(_0x28ae('0x0'));var events=[_0x28ae('0x1'),_0x28ae('0x2'),_0x28ae('0x3')];function createListener(_0x4c8c9d,_0x425112){return function(_0x23bb74){_0x425112['emit'](_0x4c8c9d,_0x23bb74);};}function removeListener(_0xf430bb,_0x5df267){return function(){FaxQueueEvents['removeListener'](_0xf430bb,_0x5df267);};}exports['register']=function(_0x3ea80d){for(var _0x2ea573=0x0,_0x1debf2=events[_0x28ae('0x4')];_0x2ea573<_0x1debf2;_0x2ea573++){var _0x328f8e=events[_0x2ea573];var _0x3ce5d6=createListener(_0x28ae('0x5')+_0x328f8e,_0x3ea80d);FaxQueueEvents['on'](_0x328f8e,_0x3ce5d6);}}; \ No newline at end of file +var _0x2984=['remove','update','removeListener','register','length','faxQueue:','save'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x2984,0xae));var _0x4298=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2984[_0x134c2e];return _0x2825db;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x4298('0x0'),_0x4298('0x1'),_0x4298('0x2')];function createListener(_0x492cd0,_0x2b0ab3){return function(_0x22ee0a){_0x2b0ab3['emit'](_0x492cd0,_0x22ee0a);};}function removeListener(_0xaccb26,_0xe8665){return function(){FaxQueueEvents[_0x4298('0x3')](_0xaccb26,_0xe8665);};}exports[_0x4298('0x4')]=function(_0x1cd1d8){for(var _0x527eb7=0x0,_0x16972c=events[_0x4298('0x5')];_0x527eb7<_0x16972c;_0x527eb7++){var _0x3ed0cd=events[_0x527eb7];var _0x27cd31=createListener(_0x4298('0x6')+_0x3ed0cd,_0x1cd1d8);FaxQueueEvents['on'](_0x3ed0cd,_0x27cd31);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 63080c8..675fb0e 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 _0xaa37=['delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','/:id','destroy'];(function(_0x1a9f7c,_0x271aaa){var _0x56046b=function(_0x31ed8b){while(--_0x31ed8b){_0x1a9f7c['push'](_0x1a9f7c['shift']());}};_0x56046b(++_0x271aaa);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xaa37[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/describe',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0xa')](_0x7aa3('0xf'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x10')]);router['get']('/:id/teams',auth[_0x7aa3('0xc')](),controller['getTeams']);router[_0x7aa3('0xa')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x12')]);router[_0x7aa3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7aa3('0x14'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x15')]);router[_0x7aa3('0x13')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x16')]);router[_0x7aa3('0x17')](_0x7aa3('0x18'),auth[_0x7aa3('0xc')](),controller['update']);router['delete'](_0x7aa3('0x18'),auth['isAuthenticated'](),controller[_0x7aa3('0x19')]);router[_0x7aa3('0x1a')]('/:id/teams',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x1b')]);router[_0x7aa3('0x1a')](_0x7aa3('0x11'),auth[_0x7aa3('0xc')](),controller['removeAgents']);module[_0x7aa3('0x1c')]=router; \ No newline at end of file +var _0xbd10=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','update','destroy','delete','removeTeams','multer','util'];(function(_0x1f4095,_0xba697b){var _0x16ab98=function(_0x24b757){while(--_0x24b757){_0x1f4095['push'](_0x1f4095['shift']());}};_0x16ab98(++_0xba697b);}(_0xbd10,0x85));var _0x0bd1=function(_0x263e02,_0x1256b6){_0x263e02=_0x263e02-0x0;var _0x27d5b6=_0xbd10[_0x263e02];return _0x27d5b6;};'use strict';var multer=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var path=require(_0x0bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd1('0x3'));var router=express[_0x0bd1('0x4')]();var fs_extra=require(_0x0bd1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0bd1('0x6'));var config=require(_0x0bd1('0x7'));var controller=require(_0x0bd1('0x8'));router[_0x0bd1('0x9')]('/',auth[_0x0bd1('0xa')](),controller[_0x0bd1('0xb')]);router['get'](_0x0bd1('0xc'),auth['isAuthenticated'](),controller[_0x0bd1('0xd')]);router[_0x0bd1('0x9')](_0x0bd1('0xe'),auth[_0x0bd1('0xa')](),controller['show']);router[_0x0bd1('0x9')](_0x0bd1('0xf'),auth[_0x0bd1('0xa')](),controller[_0x0bd1('0x10')]);router[_0x0bd1('0x9')](_0x0bd1('0x11'),auth['isAuthenticated'](),controller[_0x0bd1('0x12')]);router[_0x0bd1('0x9')](_0x0bd1('0x13'),auth[_0x0bd1('0xa')](),controller[_0x0bd1('0x14')]);router[_0x0bd1('0x15')]('/',auth['isAuthenticated'](),controller[_0x0bd1('0x16')]);router[_0x0bd1('0x15')](_0x0bd1('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x0bd1('0x15')](_0x0bd1('0x13'),auth[_0x0bd1('0xa')](),controller['addAgents']);router['put'](_0x0bd1('0xe'),auth[_0x0bd1('0xa')](),controller[_0x0bd1('0x17')]);router['delete'](_0x0bd1('0xe'),auth[_0x0bd1('0xa')](),controller[_0x0bd1('0x18')]);router[_0x0bd1('0x19')]('/:id/teams',auth[_0x0bd1('0xa')](),controller[_0x0bd1('0x1a')]);router['delete'](_0x0bd1('0x13'),auth[_0x0bd1('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 4442ae9..4680634 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 _0x66a4=['DATE','moment','sequelize','exports','STRING'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x66a4,0x123));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x466a('0x0'));var Sequelize=require(_0x466a('0x1'));module[_0x466a('0x2')]={'uniqueid':{'type':Sequelize[_0x466a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x466a('0x4')]},'exitAt':{'type':Sequelize[_0x466a('0x4')]},'reason':{'type':Sequelize[_0x466a('0x3')]}}; \ No newline at end of file +var _0xf067=['moment','sequelize','STRING','DATE'];(function(_0x5cd003,_0x175cba){var _0x3c6930=function(_0x3de2b0){while(--_0x3de2b0){_0x5cd003['push'](_0x5cd003['shift']());}};_0x3c6930(++_0x175cba);}(_0xf067,0x124));var _0x7f06=function(_0x2c9315,_0x356307){_0x2c9315=_0x2c9315-0x0;var _0x4a4fec=_0xf067[_0x2c9315];return _0x4a4fec;};'use strict';var moment=require(_0x7f06('0x0'));var Sequelize=require(_0x7f06('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7f06('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7f06('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7f06('0x3')]},'reason':{'type':Sequelize[_0x7f06('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 40e0473..665bf34 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 _0x7dc2=['find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','catch','show','keys'];(function(_0x2cca07,_0x310dd3){var _0x18767f=function(_0x4080a5){while(--_0x4080a5){_0x2cca07['push'](_0x2cca07['shift']());}};_0x18767f(++_0x310dd3);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27dc('0x0'));var jsonpatch=require(_0x27dc('0x1'));var rp=require(_0x27dc('0x2'));var moment=require(_0x27dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27dc('0x4'));var util=require(_0x27dc('0x5'));var path=require('path');var sox=require(_0x27dc('0x6'));var csv=require(_0x27dc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27dc('0x8'));var _=require('lodash');var squel=require(_0x27dc('0x9'));var crypto=require(_0x27dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x27dc('0xb'));var toCsv=require(_0x27dc('0x7'));var querystring=require(_0x27dc('0xc'));var Papa=require(_0x27dc('0xd'));var Redis=require('ioredis');var authService=require(_0x27dc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x27dc('0xf'));var hardwareService=require(_0x27dc('0x10'));var logger=require(_0x27dc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x27dc('0x12'));var licenseUtil=require(_0x27dc('0x13'));var db=require(_0x27dc('0x14'))['db'];function respondWithStatusCode(_0x1c7a9e,_0x4d8afd){_0x4d8afd=_0x4d8afd||0xcc;return function(_0x2d7799){if(_0x2d7799){return _0x1c7a9e['sendStatus'](_0x4d8afd);}return _0x1c7a9e[_0x27dc('0x15')](_0x4d8afd)['end']();};}function respondWithResult(_0x1282f2,_0x22d9ac){_0x22d9ac=_0x22d9ac||0xc8;return function(_0x7972d8){if(_0x7972d8){return _0x1282f2[_0x27dc('0x15')](_0x22d9ac)['json'](_0x7972d8);}};}function respondWithFilteredResult(_0x110316,_0x1bd473){return function(_0x798f50){if(_0x798f50){var _0x4193f9=typeof _0x1bd473[_0x27dc('0x16')]==='undefined'&&typeof _0x1bd473[_0x27dc('0x17')]===_0x27dc('0x18');var _0x21f537=_0x798f50[_0x27dc('0x19')];var _0x5d308b=_0x4193f9?0x0:_0x1bd473[_0x27dc('0x16')];var _0x1ff9a2=_0x4193f9?_0x798f50[_0x27dc('0x19')]:_0x1bd473[_0x27dc('0x16')]+_0x1bd473[_0x27dc('0x17')];var _0x3dcfca;if(_0x1ff9a2>=_0x21f537){_0x1ff9a2=_0x21f537;_0x3dcfca=0xc8;}else{_0x3dcfca=0xce;}_0x110316[_0x27dc('0x15')](_0x3dcfca);return _0x110316[_0x27dc('0x1a')](_0x27dc('0x1b'),_0x5d308b+'-'+_0x1ff9a2+'/'+_0x21f537)[_0x27dc('0x1c')](_0x798f50);}return null;};}function patchUpdates(_0x5064d5){return function(_0x3b9afc){try{jsonpatch[_0x27dc('0x1d')](_0x3b9afc,_0x5064d5,!![]);}catch(_0x4bb946){return BPromise[_0x27dc('0x1e')](_0x4bb946);}return _0x3b9afc['save']();};}function saveUpdates(_0x5c0fca,_0x2843b1){return function(_0x4eddfe){if(_0x4eddfe){return _0x4eddfe[_0x27dc('0x1f')](_0x5c0fca)['then'](function(_0x4a7d2a){return _0x4a7d2a;});}return null;};}function removeEntity(_0x14fa88,_0x4a9da0){return function(_0x37917e){if(_0x37917e){return _0x37917e['destroy']()[_0x27dc('0x20')](function(){_0x14fa88[_0x27dc('0x15')](0xcc)[_0x27dc('0x21')]();});}};}function handleEntityNotFound(_0x19db16,_0x5205ed){return function(_0x473e2d){if(!_0x473e2d){_0x19db16['sendStatus'](0x194);}return _0x473e2d;};}function handleError(_0x4d91f7,_0x1409fd){_0x1409fd=_0x1409fd||0x1f4;return function(_0x25bfb7){logger['error'](_0x25bfb7[_0x27dc('0x22')]);if(_0x25bfb7[_0x27dc('0x23')]){delete _0x25bfb7[_0x27dc('0x23')];}_0x4d91f7[_0x27dc('0x15')](_0x1409fd)[_0x27dc('0x24')](_0x25bfb7);};}exports[_0x27dc('0x25')]=function(_0x76d54b,_0x15904d){var _0x1e751d={},_0xb4e273={},_0x295776={'count':0x0,'rows':[]};var _0x5ef2cc=_[_0x27dc('0x26')](db[_0x27dc('0x27')]['rawAttributes'],function(_0x14a8a1){return{'name':_0x14a8a1[_0x27dc('0x28')],'type':_0x14a8a1[_0x27dc('0x29')][_0x27dc('0x2a')]};});_0xb4e273['model']=_[_0x27dc('0x26')](_0x5ef2cc,_0x27dc('0x23'));_0xb4e273[_0x27dc('0x2b')]=_['keys'](_0x76d54b[_0x27dc('0x2b')]);_0xb4e273[_0x27dc('0x2c')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],_0xb4e273['query']);_0x1e751d[_0x27dc('0x2f')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],qs['fields'](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x1e751d[_0x27dc('0x2f')]=_0x1e751d[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x1e751d['attributes']:_0xb4e273[_0x27dc('0x2e')];if(!_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x32')](_0x27dc('0x33'))){_0x1e751d[_0x27dc('0x17')]=qs['limit'](_0x76d54b['query'][_0x27dc('0x17')]);_0x1e751d[_0x27dc('0x16')]=qs[_0x27dc('0x16')](_0x76d54b[_0x27dc('0x2b')]['offset']);}_0x1e751d['order']=qs[_0x27dc('0x34')](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x34')]);_0x1e751d['where']=qs[_0x27dc('0x2c')](_['pick'](_0x76d54b[_0x27dc('0x2b')],_0xb4e273['filters']),_0x5ef2cc);if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x35')]){_0x1e751d[_0x27dc('0x36')]=_[_0x27dc('0x37')](_0x1e751d[_0x27dc('0x36')],{'$or':_[_0x27dc('0x26')](_0x5ef2cc,function(_0x1f72fc){if(_0x1f72fc[_0x27dc('0x29')]!=='VIRTUAL'){var _0x3f017b={};_0x3f017b[_0x1f72fc[_0x27dc('0x23')]]={'$like':'%'+_0x76d54b['query'][_0x27dc('0x35')]+'%'};return _0x3f017b;}})});}_0x1e751d=_[_0x27dc('0x37')]({},_0x1e751d,_0x76d54b[_0x27dc('0x38')]);var _0x49fa10={'where':_0x1e751d[_0x27dc('0x36')]};return db[_0x27dc('0x27')][_0x27dc('0x19')](_0x49fa10)[_0x27dc('0x20')](function(_0x5800fa){_0x295776[_0x27dc('0x19')]=_0x5800fa;if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x39')]){_0x1e751d[_0x27dc('0x3a')]=[{'all':!![]}];}return db[_0x27dc('0x27')][_0x27dc('0x3b')](_0x1e751d);})['then'](function(_0x5066b5){_0x295776['rows']=_0x5066b5;return _0x295776;})[_0x27dc('0x20')](respondWithFilteredResult(_0x15904d,_0x1e751d))[_0x27dc('0x3c')](handleError(_0x15904d,null));};exports[_0x27dc('0x3d')]=function(_0xc15911,_0x4fcbe6){var _0x57b207={'raw':!![],'where':{'id':_0xc15911['params']['id']}},_0x725244={};_0x725244[_0x27dc('0x2e')]=_[_0x27dc('0x3e')](db[_0x27dc('0x27')]['rawAttributes']);_0x725244[_0x27dc('0x2b')]=_[_0x27dc('0x3e')](_0xc15911[_0x27dc('0x2b')]);_0x725244[_0x27dc('0x2c')]=_['intersection'](_0x725244[_0x27dc('0x2e')],_0x725244[_0x27dc('0x2b')]);_0x57b207['attributes']=_[_0x27dc('0x2d')](_0x725244[_0x27dc('0x2e')],qs[_0x27dc('0x30')](_0xc15911[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x57b207[_0x27dc('0x2f')]=_0x57b207[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x57b207[_0x27dc('0x2f')]:_0x725244['model'];if(_0xc15911[_0x27dc('0x2b')]['includeAll']){_0x57b207[_0x27dc('0x3a')]=[{'all':!![]}];}_0x57b207=_[_0x27dc('0x37')]({},_0x57b207,_0xc15911[_0x27dc('0x38')]);return db[_0x27dc('0x27')][_0x27dc('0x3f')](_0x57b207)['then'](handleEntityNotFound(_0x4fcbe6,null))[_0x27dc('0x20')](respondWithResult(_0x4fcbe6,null))[_0x27dc('0x3c')](handleError(_0x4fcbe6,null));};exports[_0x27dc('0x40')]=function(_0x255323,_0x1a3256){return db[_0x27dc('0x27')][_0x27dc('0x40')](_0x255323[_0x27dc('0x41')],{})[_0x27dc('0x20')](respondWithResult(_0x1a3256,0xc9))['catch'](handleError(_0x1a3256,null));};exports['update']=function(_0x8db62d,_0x37517d){if(_0x8db62d['body']['id']){delete _0x8db62d[_0x27dc('0x41')]['id'];}return db[_0x27dc('0x27')]['find']({'where':{'id':_0x8db62d['params']['id']}})['then'](handleEntityNotFound(_0x37517d,null))[_0x27dc('0x20')](saveUpdates(_0x8db62d['body'],null))['then'](respondWithResult(_0x37517d,null))[_0x27dc('0x3c')](handleError(_0x37517d,null));};exports[_0x27dc('0x42')]=function(_0x22f3df,_0x5ee5e3){return db[_0x27dc('0x27')][_0x27dc('0x3f')]({'where':{'id':_0x22f3df['params']['id']}})[_0x27dc('0x20')](handleEntityNotFound(_0x5ee5e3,null))[_0x27dc('0x20')](removeEntity(_0x5ee5e3,null))['catch'](handleError(_0x5ee5e3,null));};exports[_0x27dc('0x43')]=function(_0xb2eda0,_0x371516){return db[_0x27dc('0x27')][_0x27dc('0x43')]()[_0x27dc('0x20')](respondWithResult(_0x371516,null))['catch'](handleError(_0x371516,null));}; \ No newline at end of file +var _0x8482=['count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','options','findAll','rows','show','length','includeAll','include','find','create','body','catch','params','describe','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'];(function(_0x1a7abc,_0x58311c){var _0x135e97=function(_0x4d7f74){while(--_0x4d7f74){_0x1a7abc['push'](_0x1a7abc['shift']());}};_0x135e97(++_0x58311c);}(_0x8482,0x14e));var _0x2848=function(_0x2f84fb,_0x2c7f84){_0x2f84fb=_0x2f84fb-0x0;var _0x593d98=_0x8482[_0x2f84fb];return _0x593d98;};'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={},_0x189701={},_0x528825={'count':0x0,'rows':[]};var _0x4c9685=_['map'](db[_0x2848('0x29')][_0x2848('0x2a')],function(_0x1ff601){return{'name':_0x1ff601[_0x2848('0x2b')],'type':_0x1ff601[_0x2848('0x2c')][_0x2848('0x2d')]};});_0x189701[_0x2848('0x2e')]=_[_0x2848('0x2f')](_0x4c9685,_0x2848('0x27'));_0x189701[_0x2848('0x30')]=_[_0x2848('0x31')](_0x18df37['query']);_0x189701[_0x2848('0x32')]=_[_0x2848('0x33')](_0x189701[_0x2848('0x2e')],_0x189701[_0x2848('0x30')]);_0x3f915b['attributes']=_[_0x2848('0x33')](_0x189701[_0x2848('0x2e')],qs[_0x2848('0x34')](_0x18df37[_0x2848('0x30')]['fields']));_0x3f915b['attributes']=_0x3f915b['attributes']['length']?_0x3f915b[_0x2848('0x35')]:_0x189701[_0x2848('0x2e')];if(!_0x18df37['query']['hasOwnProperty'](_0x2848('0x36'))){_0x3f915b[_0x2848('0x1c')]=qs[_0x2848('0x1c')](_0x18df37[_0x2848('0x30')][_0x2848('0x1c')]);_0x3f915b['offset']=qs[_0x2848('0x1b')](_0x18df37[_0x2848('0x30')][_0x2848('0x1b')]);}_0x3f915b['order']=qs[_0x2848('0x37')](_0x18df37[_0x2848('0x30')][_0x2848('0x37')]);_0x3f915b[_0x2848('0x38')]=qs[_0x2848('0x32')](_['pick'](_0x18df37['query'],_0x189701[_0x2848('0x32')]),_0x4c9685);if(_0x18df37[_0x2848('0x30')][_0x2848('0x39')]){_0x3f915b[_0x2848('0x38')]=_[_0x2848('0x3a')](_0x3f915b[_0x2848('0x38')],{'$or':_['map'](_0x4c9685,function(_0x489ed8){if(_0x489ed8['type']!=='VIRTUAL'){var _0x5c3d4e={};_0x5c3d4e[_0x489ed8[_0x2848('0x27')]]={'$like':'%'+_0x18df37['query'][_0x2848('0x39')]+'%'};return _0x5c3d4e;}})});}_0x3f915b=_['merge']({},_0x3f915b,_0x18df37[_0x2848('0x3b')]);var _0x24af01={'where':_0x3f915b[_0x2848('0x38')]};return db['FaxQueueReport'][_0x2848('0x1a')](_0x24af01)[_0x2848('0x23')](function(_0x368ef1){_0x528825[_0x2848('0x1a')]=_0x368ef1;if(_0x18df37[_0x2848('0x30')]['includeAll']){_0x3f915b['include']=[{'all':!![]}];}return db[_0x2848('0x29')][_0x2848('0x3c')](_0x3f915b);})[_0x2848('0x23')](function(_0xfe7e37){_0x528825[_0x2848('0x3d')]=_0xfe7e37;return _0x528825;})[_0x2848('0x23')](respondWithFilteredResult(_0x3b9c0d,_0x3f915b))['catch'](handleError(_0x3b9c0d,null));};exports[_0x2848('0x3e')]=function(_0x5ef41f,_0x3208f2){var _0x56d0fa={'raw':!![],'where':{'id':_0x5ef41f['params']['id']}},_0x32f51a={};_0x32f51a['model']=_['keys'](db['FaxQueueReport'][_0x2848('0x2a')]);_0x32f51a[_0x2848('0x30')]=_[_0x2848('0x31')](_0x5ef41f[_0x2848('0x30')]);_0x32f51a[_0x2848('0x32')]=_[_0x2848('0x33')](_0x32f51a[_0x2848('0x2e')],_0x32f51a[_0x2848('0x30')]);_0x56d0fa[_0x2848('0x35')]=_['intersection'](_0x32f51a[_0x2848('0x2e')],qs[_0x2848('0x34')](_0x5ef41f[_0x2848('0x30')]['fields']));_0x56d0fa[_0x2848('0x35')]=_0x56d0fa[_0x2848('0x35')][_0x2848('0x3f')]?_0x56d0fa[_0x2848('0x35')]:_0x32f51a[_0x2848('0x2e')];if(_0x5ef41f['query'][_0x2848('0x40')]){_0x56d0fa[_0x2848('0x41')]=[{'all':!![]}];}_0x56d0fa=_[_0x2848('0x3a')]({},_0x56d0fa,_0x5ef41f[_0x2848('0x3b')]);return db['FaxQueueReport'][_0x2848('0x42')](_0x56d0fa)[_0x2848('0x23')](handleEntityNotFound(_0x3208f2,null))[_0x2848('0x23')](respondWithResult(_0x3208f2,null))['catch'](handleError(_0x3208f2,null));};exports[_0x2848('0x43')]=function(_0xf6c69,_0x53420b){return db['FaxQueueReport'][_0x2848('0x43')](_0xf6c69[_0x2848('0x44')],{})[_0x2848('0x23')](respondWithResult(_0x53420b,0xc9))[_0x2848('0x45')](handleError(_0x53420b,null));};exports[_0x2848('0x22')]=function(_0x4e4b1e,_0x35ed61){if(_0x4e4b1e[_0x2848('0x44')]['id']){delete _0x4e4b1e[_0x2848('0x44')]['id'];}return db[_0x2848('0x29')][_0x2848('0x42')]({'where':{'id':_0x4e4b1e[_0x2848('0x46')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x35ed61,null))[_0x2848('0x23')](saveUpdates(_0x4e4b1e[_0x2848('0x44')],null))[_0x2848('0x23')](respondWithResult(_0x35ed61,null))[_0x2848('0x45')](handleError(_0x35ed61,null));};exports[_0x2848('0x24')]=function(_0xe8e50,_0x1a8946){return db[_0x2848('0x29')][_0x2848('0x42')]({'where':{'id':_0xe8e50[_0x2848('0x46')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x1a8946,null))[_0x2848('0x23')](removeEntity(_0x1a8946,null))[_0x2848('0x45')](handleError(_0x1a8946,null));};exports['describe']=function(_0x2814a2,_0x3b996e){return db['FaxQueueReport'][_0x2848('0x47')]()[_0x2848('0x23')](respondWithResult(_0x3b996e,null))['catch'](handleError(_0x3b996e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 146ab50..723ad86 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1f7451,_0x37e415){var _0x17cb1a=function(_0x2a376d){while(--_0x2a376d){_0x1f7451['push'](_0x1f7451['shift']());}};_0x17cb1a(++_0x37e415);}(_0xabce,0x103));var _0xeabc=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xabce[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x4a439c,_0x1a04a5){var _0x5aa32b=function(_0x387aa8){while(--_0x387aa8){_0x4a439c['push'](_0x4a439c['shift']());}};_0x5aa32b(++_0x1a04a5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7fbe[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('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 56590b5..6292768 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 _0xc3b5=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateFaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','FaxQueueReport','update','limit','then','lodash','util','moment','randomstring'];(function(_0x40116b,_0x3c4870){var _0x12df1d=function(_0x1c5e5b){while(--_0x1c5e5b){_0x40116b['push'](_0x40116b['shift']());}};_0x12df1d(++_0x3c4870);}(_0xc3b5,0x15c));var _0x5c3b=function(_0x13fba5,_0x330e55){_0x13fba5=_0x13fba5-0x0;var _0x5c27d7=_0xc3b5[_0x13fba5];return _0x5c27d7;};'use strict';var _=require(_0x5c3b('0x0'));var util=require(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c3b('0x3'));var fs=require('fs');var Redis=require(_0x5c3b('0x4'));var db=require(_0x5c3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require(_0x5c3b('0x8'));var jayson=require(_0x5c3b('0x9'));var client=jayson[_0x5c3b('0xa')][_0x5c3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f33f1,_0x1b790b,_0x5b26aa){return new BPromise(function(_0x28efb9,_0x263b22){return client[_0x5c3b('0xc')](_0x5f33f1,_0x5b26aa)['then'](function(_0x551ab6){logger[_0x5c3b('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1b790b,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1b790b,'request\x20sent',JSON[_0x5c3b('0xe')](_0x551ab6));if(_0x551ab6[_0x5c3b('0xf')]){if(_0x551ab6[_0x5c3b('0xf')]['code']===0x1f4){logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x551ab6[_0x5c3b('0xf')][_0x5c3b('0x11')]);return _0x263b22(_0x551ab6['error'][_0x5c3b('0x11')]);}logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x551ab6[_0x5c3b('0xf')]['message']);return _0x28efb9(_0x551ab6['error'][_0x5c3b('0x11')]);}else{logger[_0x5c3b('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1b790b,_0x5c3b('0x12'));_0x28efb9(_0x551ab6[_0x5c3b('0x13')][_0x5c3b('0x11')]);}})[_0x5c3b('0x14')](function(_0x5ec186){logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x5ec186);_0x263b22(_0x5ec186);});});}exports[_0x5c3b('0x15')]=function(_0x4d112d){var _0x832209=this;return new Promise(function(_0x42d12d,_0x6d2861){return db['FaxQueueReport'][_0x5c3b('0x16')](_0x4d112d[_0x5c3b('0x17')],{'raw':_0x4d112d[_0x5c3b('0x18')]?_0x4d112d[_0x5c3b('0x18')][_0x5c3b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3f76c4){logger[_0x5c3b('0xd')](_0x5c3b('0x15'),_0x4d112d);logger[_0x5c3b('0x1a')](_0x5c3b('0x15'),_0x4d112d,JSON['stringify'](_0x3f76c4));_0x42d12d(_0x3f76c4);})[_0x5c3b('0x14')](function(_0x10e6fd){logger[_0x5c3b('0xf')](_0x5c3b('0x15'),_0x10e6fd[_0x5c3b('0x11')],_0x4d112d);_0x6d2861(_0x832209['error'](0x1f4,_0x10e6fd[_0x5c3b('0x11')]));});});};exports[_0x5c3b('0x1b')]=function(_0x317710){var _0x2dfcd9=this;return new Promise(function(_0x110e1e,_0x1dcfeb){return db[_0x5c3b('0x1c')][_0x5c3b('0x1d')](_0x317710[_0x5c3b('0x17')],{'raw':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['where']||null:null,'attributes':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['attributes']||null:null,'limit':_0x317710[_0x5c3b('0x18')]?_0x317710['options'][_0x5c3b('0x1e')]||null:null})[_0x5c3b('0x1f')](function(_0x14b0b6){logger['info'](_0x5c3b('0x1b'),_0x317710);logger[_0x5c3b('0x1a')]('UpdateFaxQueueReport',_0x317710,JSON['stringify'](_0x14b0b6));_0x110e1e(_0x14b0b6);})[_0x5c3b('0x14')](function(_0x4f957a){logger[_0x5c3b('0xf')](_0x5c3b('0x1b'),_0x4f957a[_0x5c3b('0x11')],_0x317710);_0x1dcfeb(_0x2dfcd9[_0x5c3b('0xf')](0x1f4,_0x4f957a[_0x5c3b('0x11')]));});});}; \ No newline at end of file +var _0xbd97=['http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x294c52,_0x447c50){var _0x31eb24=function(_0x124d40){while(--_0x124d40){_0x294c52['push'](_0x294c52['shift']());}};_0x31eb24(++_0x447c50);}(_0xbd97,0x11c));var _0x7bd9=function(_0xe3e430,_0x594a7c){_0xe3e430=_0xe3e430-0x0;var _0x4c67ee=_0xbd97[_0xe3e430];return _0x4c67ee;};'use strict';var _=require(_0x7bd9('0x0'));var util=require(_0x7bd9('0x1'));var moment=require(_0x7bd9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7bd9('0x3'));var fs=require('fs');var Redis=require(_0x7bd9('0x4'));var db=require(_0x7bd9('0x5'))['db'];var utils=require(_0x7bd9('0x6'));var logger=require(_0x7bd9('0x7'))(_0x7bd9('0x8'));var config=require(_0x7bd9('0x9'));var jayson=require(_0x7bd9('0xa'));var client=jayson[_0x7bd9('0xb')][_0x7bd9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f4dc3,_0x576268,_0x33db3c){return new BPromise(function(_0x229b4a,_0x2ae8d1){return client[_0x7bd9('0xd')](_0x1f4dc3,_0x33db3c)['then'](function(_0xee60b4){logger[_0x7bd9('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x576268,_0x7bd9('0xf'));logger[_0x7bd9('0x10')](_0x7bd9('0x11'),_0x576268,_0x7bd9('0xf'),JSON[_0x7bd9('0x12')](_0xee60b4));if(_0xee60b4[_0x7bd9('0x13')]){if(_0xee60b4[_0x7bd9('0x13')][_0x7bd9('0x14')]===0x1f4){logger[_0x7bd9('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x576268,_0xee60b4['error'][_0x7bd9('0x15')]);return _0x2ae8d1(_0xee60b4['error'][_0x7bd9('0x15')]);}logger[_0x7bd9('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x576268,_0xee60b4[_0x7bd9('0x13')][_0x7bd9('0x15')]);return _0x229b4a(_0xee60b4[_0x7bd9('0x13')]['message']);}else{logger[_0x7bd9('0xe')](_0x7bd9('0x16'),_0x576268,'request\x20sent');_0x229b4a(_0xee60b4[_0x7bd9('0x17')][_0x7bd9('0x15')]);}})[_0x7bd9('0x18')](function(_0x3666ae){logger[_0x7bd9('0x13')](_0x7bd9('0x16'),_0x576268,_0x3666ae);_0x2ae8d1(_0x3666ae);});});}exports[_0x7bd9('0x19')]=function(_0xa65d9d){var _0x3da38f=this;return new Promise(function(_0x590dee,_0x59a0d8){return db[_0x7bd9('0x1a')][_0x7bd9('0x1b')](_0xa65d9d[_0x7bd9('0x1c')],{'raw':_0xa65d9d['options']?_0xa65d9d[_0x7bd9('0x1d')][_0x7bd9('0x1e')]===undefined?!![]:![]:!![]})[_0x7bd9('0x1f')](function(_0x5968e0){logger['info'](_0x7bd9('0x19'),_0xa65d9d);logger[_0x7bd9('0x10')]('CreateFaxQueueReport',_0xa65d9d,JSON[_0x7bd9('0x12')](_0x5968e0));_0x590dee(_0x5968e0);})[_0x7bd9('0x18')](function(_0x2c5599){logger['error'](_0x7bd9('0x19'),_0x2c5599[_0x7bd9('0x15')],_0xa65d9d);_0x59a0d8(_0x3da38f[_0x7bd9('0x13')](0x1f4,_0x2c5599[_0x7bd9('0x15')]));});});};exports[_0x7bd9('0x20')]=function(_0x186516){var _0x315790=this;return new Promise(function(_0x4b8c23,_0x571924){return db[_0x7bd9('0x1a')][_0x7bd9('0x21')](_0x186516[_0x7bd9('0x1c')],{'raw':_0x186516['options']?_0x186516[_0x7bd9('0x1d')][_0x7bd9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x186516[_0x7bd9('0x1d')]?_0x186516['options'][_0x7bd9('0x22')]||null:null,'attributes':_0x186516[_0x7bd9('0x1d')]?_0x186516[_0x7bd9('0x1d')][_0x7bd9('0x23')]||null:null,'limit':_0x186516[_0x7bd9('0x1d')]?_0x186516[_0x7bd9('0x1d')][_0x7bd9('0x24')]||null:null})['then'](function(_0x22863a){logger[_0x7bd9('0xe')](_0x7bd9('0x20'),_0x186516);logger[_0x7bd9('0x10')](_0x7bd9('0x20'),_0x186516,JSON[_0x7bd9('0x12')](_0x22863a));_0x4b8c23(_0x22863a);})['catch'](function(_0x1e5d0c){logger[_0x7bd9('0x13')](_0x7bd9('0x20'),_0x1e5d0c['message'],_0x186516);_0x571924(_0x315790['error'](0x1f4,_0x1e5d0c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c72f0bc..90ccdbb 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 _0x0df5=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x4e0717,_0x43ba49){var _0x5c89a1=function(_0x4dc7f3){while(--_0x4dc7f3){_0x4e0717['push'](_0x4e0717['shift']());}};_0x5c89a1(++_0x43ba49);}(_0x0df5,0x168));var _0x50df=function(_0x23130e,_0x938869){_0x23130e=_0x23130e-0x0;var _0x5dfd0d=_0x0df5[_0x23130e];return _0x5dfd0d;};'use strict';var multer=require(_0x50df('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50df('0x1'));var router=express[_0x50df('0x2')]();var fs_extra=require(_0x50df('0x3'));var auth=require(_0x50df('0x4'));var interaction=require(_0x50df('0x5'));var config=require(_0x50df('0x6'));var controller=require('./faxQueueReport.controller');router[_0x50df('0x7')]('/',auth[_0x50df('0x8')](),controller[_0x50df('0x9')]);router[_0x50df('0x7')](_0x50df('0xa'),auth['isAuthenticated'](),controller[_0x50df('0xb')]);router['get'](_0x50df('0xc'),auth['isAuthenticated'](),controller[_0x50df('0xd')]);router[_0x50df('0xe')]('/',auth[_0x50df('0x8')](),controller[_0x50df('0xf')]);router[_0x50df('0x10')](_0x50df('0xc'),auth[_0x50df('0x8')](),controller['update']);router[_0x50df('0x11')](_0x50df('0xc'),auth[_0x50df('0x8')](),controller[_0x50df('0x12')]);module[_0x50df('0x13')]=router; \ No newline at end of file +var _0xecbe=['post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x37abb8,_0x5179a0){var _0x7babf1=function(_0x412f89){while(--_0x412f89){_0x37abb8['push'](_0x37abb8['shift']());}};_0x7babf1(++_0x5179a0);}(_0xecbe,0x101));var _0xeecb=function(_0x37d36f,_0x736947){_0x37d36f=_0x37d36f-0x0;var _0x285016=_0xecbe[_0x37d36f];return _0x285016;};'use strict';var multer=require(_0xeecb('0x0'));var util=require(_0xeecb('0x1'));var path=require(_0xeecb('0x2'));var timeout=require(_0xeecb('0x3'));var express=require(_0xeecb('0x4'));var router=express[_0xeecb('0x5')]();var fs_extra=require(_0xeecb('0x6'));var auth=require(_0xeecb('0x7'));var interaction=require(_0xeecb('0x8'));var config=require('../../config/environment');var controller=require(_0xeecb('0x9'));router['get']('/',auth[_0xeecb('0xa')](),controller['index']);router[_0xeecb('0xb')](_0xeecb('0xc'),auth[_0xeecb('0xa')](),controller[_0xeecb('0xd')]);router[_0xeecb('0xb')](_0xeecb('0xe'),auth[_0xeecb('0xa')](),controller[_0xeecb('0xf')]);router[_0xeecb('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeecb('0x11')](_0xeecb('0xe'),auth[_0xeecb('0xa')](),controller['update']);router[_0xeecb('0x12')](_0xeecb('0xe'),auth[_0xeecb('0xa')](),controller[_0xeecb('0x13')]);module[_0xeecb('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 fd0b508..1541038 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x561248,_0x360e7c){var _0x58e857=function(_0x1ff481){while(--_0x1ff481){_0x561248['push'](_0x561248['shift']());}};_0x58e857(++_0x360e7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0d1b2b7..9af4345 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 _0xe8f0=['mustache','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','error','stack','name','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','describe','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe8f0,0x145));var _0x0e8f=function(_0x3ea384,_0x461b81){_0x3ea384=_0x3ea384-0x0;var _0x3fec60=_0xe8f0[_0x3ea384];return _0x3fec60;};'use strict';var emlformat=require(_0x0e8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e8f('0x1'));var rp=require(_0x0e8f('0x2'));var moment=require(_0x0e8f('0x3'));var BPromise=require(_0x0e8f('0x4'));var Mustache=require(_0x0e8f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0e8f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e8f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0e8f('0x8'));var jsforce=require(_0x0e8f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0e8f('0x6'));var querystring=require(_0x0e8f('0xa'));var Papa=require(_0x0e8f('0xb'));var Redis=require(_0x0e8f('0xc'));var authService=require(_0x0e8f('0xd'));var qs=require(_0x0e8f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e8f('0xf'));var logger=require('../../config/logger')(_0x0e8f('0x10'));var utils=require(_0x0e8f('0x11'));var config=require(_0x0e8f('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279c66,_0x8adb58){_0x8adb58=_0x8adb58||0xcc;return function(_0x4d0655){if(_0x4d0655){return _0x279c66['sendStatus'](_0x8adb58);}return _0x279c66[_0x0e8f('0x13')](_0x8adb58)[_0x0e8f('0x14')]();};}function respondWithResult(_0x31995a,_0x131a5a){_0x131a5a=_0x131a5a||0xc8;return function(_0x4b72e8){if(_0x4b72e8){return _0x31995a[_0x0e8f('0x13')](_0x131a5a)[_0x0e8f('0x15')](_0x4b72e8);}};}function respondWithFilteredResult(_0x4f27c1,_0x3478b3){return function(_0x27c9b){if(_0x27c9b){var _0x5cb83a=typeof _0x3478b3[_0x0e8f('0x16')]==='undefined'&&typeof _0x3478b3[_0x0e8f('0x17')]===_0x0e8f('0x18');var _0x5c5fe4=_0x27c9b[_0x0e8f('0x19')];var _0x43d910=_0x5cb83a?0x0:_0x3478b3[_0x0e8f('0x16')];var _0x2e09b6=_0x5cb83a?_0x27c9b[_0x0e8f('0x19')]:_0x3478b3[_0x0e8f('0x16')]+_0x3478b3[_0x0e8f('0x17')];var _0x1ff3ff;if(_0x2e09b6>=_0x5c5fe4){_0x2e09b6=_0x5c5fe4;_0x1ff3ff=0xc8;}else{_0x1ff3ff=0xce;}_0x4f27c1[_0x0e8f('0x13')](_0x1ff3ff);return _0x4f27c1['set'](_0x0e8f('0x1a'),_0x43d910+'-'+_0x2e09b6+'/'+_0x5c5fe4)[_0x0e8f('0x15')](_0x27c9b);}return null;};}function patchUpdates(_0x2cd488){return function(_0x1d3e39){try{jsonpatch[_0x0e8f('0x1b')](_0x1d3e39,_0x2cd488,!![]);}catch(_0x137caf){return BPromise[_0x0e8f('0x1c')](_0x137caf);}return _0x1d3e39['save']();};}function saveUpdates(_0x223495,_0x355be6){return function(_0x530eb9){if(_0x530eb9){return _0x530eb9['update'](_0x223495)[_0x0e8f('0x1d')](function(_0x50a525){return _0x50a525;});}return null;};}function removeEntity(_0x5a8e41,_0x6619f9){return function(_0x36b6c5){if(_0x36b6c5){return _0x36b6c5['destroy']()[_0x0e8f('0x1d')](function(){_0x5a8e41[_0x0e8f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38de31,_0x5ccea0){return function(_0x4c443d){if(!_0x4c443d){_0x38de31['sendStatus'](0x194);}return _0x4c443d;};}function handleError(_0x22d952,_0x421c98){_0x421c98=_0x421c98||0x1f4;return function(_0x57279f){logger[_0x0e8f('0x1e')](_0x57279f[_0x0e8f('0x1f')]);if(_0x57279f[_0x0e8f('0x20')]){delete _0x57279f['name'];}_0x22d952['status'](_0x421c98)['send'](_0x57279f);};}exports['index']=function(_0x8e2778,_0x5488b2){var _0x24d3da={},_0x2d3747={},_0x51eb41={'count':0x0,'rows':[]};var _0xb0886f=_[_0x0e8f('0x21')](db[_0x0e8f('0x22')][_0x0e8f('0x23')],function(_0x4afbce){return{'name':_0x4afbce[_0x0e8f('0x24')],'type':_0x4afbce[_0x0e8f('0x25')]['key']};});_0x2d3747[_0x0e8f('0x26')]=_[_0x0e8f('0x21')](_0xb0886f,'name');_0x2d3747[_0x0e8f('0x27')]=_['keys'](_0x8e2778[_0x0e8f('0x27')]);_0x2d3747['filters']=_['intersection'](_0x2d3747[_0x0e8f('0x26')],_0x2d3747[_0x0e8f('0x27')]);_0x24d3da['attributes']=_[_0x0e8f('0x28')](_0x2d3747[_0x0e8f('0x26')],qs[_0x0e8f('0x29')](_0x8e2778['query']['fields']));_0x24d3da['attributes']=_0x24d3da[_0x0e8f('0x2a')][_0x0e8f('0x2b')]?_0x24d3da[_0x0e8f('0x2a')]:_0x2d3747[_0x0e8f('0x26')];if(!_0x8e2778['query'][_0x0e8f('0x2c')]('nolimit')){_0x24d3da[_0x0e8f('0x17')]=qs['limit'](_0x8e2778[_0x0e8f('0x27')][_0x0e8f('0x17')]);_0x24d3da[_0x0e8f('0x16')]=qs[_0x0e8f('0x16')](_0x8e2778[_0x0e8f('0x27')][_0x0e8f('0x16')]);}_0x24d3da[_0x0e8f('0x2d')]=qs['sort'](_0x8e2778[_0x0e8f('0x27')]['sort']);_0x24d3da[_0x0e8f('0x2e')]=qs[_0x0e8f('0x2f')](_[_0x0e8f('0x30')](_0x8e2778[_0x0e8f('0x27')],_0x2d3747[_0x0e8f('0x2f')]),_0xb0886f);if(_0x8e2778[_0x0e8f('0x27')]['filter']){_0x24d3da[_0x0e8f('0x2e')]=_[_0x0e8f('0x31')](_0x24d3da['where'],{'$or':_['map'](_0xb0886f,function(_0x9d4383){if(_0x9d4383[_0x0e8f('0x25')]!==_0x0e8f('0x32')){var _0x569741={};_0x569741[_0x9d4383[_0x0e8f('0x20')]]={'$like':'%'+_0x8e2778['query'][_0x0e8f('0x33')]+'%'};return _0x569741;}})});}_0x24d3da=_[_0x0e8f('0x31')]({},_0x24d3da,_0x8e2778['options']);var _0x17a129={'where':_0x24d3da[_0x0e8f('0x2e')]};return db['FaxTransferReport']['count'](_0x17a129)['then'](function(_0x10d9c1){_0x51eb41[_0x0e8f('0x19')]=_0x10d9c1;if(_0x8e2778['query'][_0x0e8f('0x34')]){_0x24d3da[_0x0e8f('0x35')]=[{'all':!![]}];}return db[_0x0e8f('0x22')][_0x0e8f('0x36')](_0x24d3da);})[_0x0e8f('0x1d')](function(_0x2d89ca){_0x51eb41[_0x0e8f('0x37')]=_0x2d89ca;return _0x51eb41;})[_0x0e8f('0x1d')](respondWithFilteredResult(_0x5488b2,_0x24d3da))[_0x0e8f('0x38')](handleError(_0x5488b2,null));};exports[_0x0e8f('0x39')]=function(_0x1cd6fd,_0x80f131){var _0x436553={'raw':!![],'where':{'id':_0x1cd6fd[_0x0e8f('0x3a')]['id']}},_0x5cfff3={};_0x5cfff3['model']=_[_0x0e8f('0x3b')](db['FaxTransferReport']['rawAttributes']);_0x5cfff3['query']=_[_0x0e8f('0x3b')](_0x1cd6fd[_0x0e8f('0x27')]);_0x5cfff3['filters']=_['intersection'](_0x5cfff3[_0x0e8f('0x26')],_0x5cfff3['query']);_0x436553['attributes']=_[_0x0e8f('0x28')](_0x5cfff3[_0x0e8f('0x26')],qs[_0x0e8f('0x29')](_0x1cd6fd[_0x0e8f('0x27')]['fields']));_0x436553[_0x0e8f('0x2a')]=_0x436553[_0x0e8f('0x2a')][_0x0e8f('0x2b')]?_0x436553[_0x0e8f('0x2a')]:_0x5cfff3['model'];if(_0x1cd6fd[_0x0e8f('0x27')][_0x0e8f('0x34')]){_0x436553[_0x0e8f('0x35')]=[{'all':!![]}];}_0x436553=_[_0x0e8f('0x31')]({},_0x436553,_0x1cd6fd[_0x0e8f('0x3c')]);return db[_0x0e8f('0x22')][_0x0e8f('0x3d')](_0x436553)['then'](handleEntityNotFound(_0x80f131,null))[_0x0e8f('0x1d')](respondWithResult(_0x80f131,null))[_0x0e8f('0x38')](handleError(_0x80f131,null));};exports[_0x0e8f('0x3e')]=function(_0x29a7a3,_0x102101){return db[_0x0e8f('0x22')]['create'](_0x29a7a3[_0x0e8f('0x3f')],{})['then'](respondWithResult(_0x102101,0xc9))[_0x0e8f('0x38')](handleError(_0x102101,null));};exports[_0x0e8f('0x40')]=function(_0x40fe61,_0xd53a00){if(_0x40fe61['body']['id']){delete _0x40fe61[_0x0e8f('0x3f')]['id'];}return db[_0x0e8f('0x22')][_0x0e8f('0x3d')]({'where':{'id':_0x40fe61[_0x0e8f('0x3a')]['id']}})[_0x0e8f('0x1d')](handleEntityNotFound(_0xd53a00,null))[_0x0e8f('0x1d')](saveUpdates(_0x40fe61[_0x0e8f('0x3f')],null))[_0x0e8f('0x1d')](respondWithResult(_0xd53a00,null))['catch'](handleError(_0xd53a00,null));};exports['destroy']=function(_0x28349c,_0x1e6fb6){return db[_0x0e8f('0x22')][_0x0e8f('0x3d')]({'where':{'id':_0x28349c['params']['id']}})[_0x0e8f('0x1d')](handleEntityNotFound(_0x1e6fb6,null))[_0x0e8f('0x1d')](removeEntity(_0x1e6fb6,null))[_0x0e8f('0x38')](handleError(_0x1e6fb6,null));};exports[_0x0e8f('0x41')]=function(_0x346baf,_0x4d6fab){return db[_0x0e8f('0x22')]['describe']()[_0x0e8f('0x1d')](respondWithResult(_0x4d6fab,null))[_0x0e8f('0x38')](handleError(_0x4d6fab,null));}; \ No newline at end of file +var _0x7777=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','reject','save','then','destroy','stack','name','index','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','where','pick','merge','type','FaxTransferReport','includeAll','include','findAll','rows','keys','options','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs'];(function(_0x36592d,_0x486b5f){var _0x1ba6e5=function(_0xbec377){while(--_0xbec377){_0x36592d['push'](_0x36592d['shift']());}};_0x1ba6e5(++_0x486b5f);}(_0x7777,0x1c2));var _0x7777=function(_0x4559d6,_0x21ff92){_0x4559d6=_0x4559d6-0x0;var _0x3b77ae=_0x7777[_0x4559d6];return _0x3b77ae;};'use strict';var emlformat=require(_0x7777('0x0'));var rimraf=require(_0x7777('0x1'));var zipdir=require(_0x7777('0x2'));var jsonpatch=require(_0x7777('0x3'));var rp=require(_0x7777('0x4'));var moment=require(_0x7777('0x5'));var BPromise=require(_0x7777('0x6'));var Mustache=require(_0x7777('0x7'));var util=require(_0x7777('0x8'));var path=require(_0x7777('0x9'));var sox=require(_0x7777('0xa'));var csv=require('to-csv');var ejs=require(_0x7777('0xb'));var fs=require('fs');var fs_extra=require(_0x7777('0xc'));var _=require(_0x7777('0xd'));var squel=require('squel');var crypto=require(_0x7777('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7777('0xf'));var toCsv=require(_0x7777('0x10'));var querystring=require('querystring');var Papa=require(_0x7777('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7777('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7777('0x13'));var utils=require(_0x7777('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7777('0x15'));var db=require(_0x7777('0x16'))['db'];function respondWithStatusCode(_0x234ebb,_0x3f8e59){_0x3f8e59=_0x3f8e59||0xcc;return function(_0x3044dc){if(_0x3044dc){return _0x234ebb[_0x7777('0x17')](_0x3f8e59);}return _0x234ebb[_0x7777('0x18')](_0x3f8e59)[_0x7777('0x19')]();};}function respondWithResult(_0x311ee7,_0x2b0d1c){_0x2b0d1c=_0x2b0d1c||0xc8;return function(_0x15b3af){if(_0x15b3af){return _0x311ee7['status'](_0x2b0d1c)['json'](_0x15b3af);}};}function respondWithFilteredResult(_0x3c9b43,_0x2cb7ae){return function(_0x4d9611){if(_0x4d9611){var _0x2210be=typeof _0x2cb7ae[_0x7777('0x1a')]==='undefined'&&typeof _0x2cb7ae['limit']==='undefined';var _0x28111a=_0x4d9611[_0x7777('0x1b')];var _0x818f32=_0x2210be?0x0:_0x2cb7ae[_0x7777('0x1a')];var _0x1228bc=_0x2210be?_0x4d9611['count']:_0x2cb7ae[_0x7777('0x1a')]+_0x2cb7ae[_0x7777('0x1c')];var _0x276d45;if(_0x1228bc>=_0x28111a){_0x1228bc=_0x28111a;_0x276d45=0xc8;}else{_0x276d45=0xce;}_0x3c9b43[_0x7777('0x18')](_0x276d45);return _0x3c9b43[_0x7777('0x1d')](_0x7777('0x1e'),_0x818f32+'-'+_0x1228bc+'/'+_0x28111a)[_0x7777('0x1f')](_0x4d9611);}return null;};}function patchUpdates(_0x250ea7){return function(_0x70a41c){try{jsonpatch['apply'](_0x70a41c,_0x250ea7,!![]);}catch(_0x550a79){return BPromise[_0x7777('0x20')](_0x550a79);}return _0x70a41c[_0x7777('0x21')]();};}function saveUpdates(_0x41e2d2,_0x20d189){return function(_0x481321){if(_0x481321){return _0x481321['update'](_0x41e2d2)[_0x7777('0x22')](function(_0x210e55){return _0x210e55;});}return null;};}function removeEntity(_0x35b5e1,_0x4c4e57){return function(_0x131a6e){if(_0x131a6e){return _0x131a6e[_0x7777('0x23')]()[_0x7777('0x22')](function(){_0x35b5e1[_0x7777('0x18')](0xcc)[_0x7777('0x19')]();});}};}function handleEntityNotFound(_0x5444dd,_0x3c0a35){return function(_0x286645){if(!_0x286645){_0x5444dd[_0x7777('0x17')](0x194);}return _0x286645;};}function handleError(_0x529844,_0x3a465b){_0x3a465b=_0x3a465b||0x1f4;return function(_0x2ae2c3){logger['error'](_0x2ae2c3[_0x7777('0x24')]);if(_0x2ae2c3[_0x7777('0x25')]){delete _0x2ae2c3['name'];}_0x529844[_0x7777('0x18')](_0x3a465b)['send'](_0x2ae2c3);};}exports[_0x7777('0x26')]=function(_0x11f528,_0x178cd4){var _0x378987={},_0x35da22={},_0x1e574d={'count':0x0,'rows':[]};var _0x571b3d=_[_0x7777('0x27')](db['FaxTransferReport'][_0x7777('0x28')],function(_0x31f372){return{'name':_0x31f372['fieldName'],'type':_0x31f372['type']['key']};});_0x35da22[_0x7777('0x29')]=_[_0x7777('0x27')](_0x571b3d,_0x7777('0x25'));_0x35da22[_0x7777('0x2a')]=_['keys'](_0x11f528[_0x7777('0x2a')]);_0x35da22[_0x7777('0x2b')]=_[_0x7777('0x2c')](_0x35da22[_0x7777('0x29')],_0x35da22[_0x7777('0x2a')]);_0x378987[_0x7777('0x2d')]=_[_0x7777('0x2c')](_0x35da22[_0x7777('0x29')],qs[_0x7777('0x2e')](_0x11f528[_0x7777('0x2a')][_0x7777('0x2e')]));_0x378987['attributes']=_0x378987[_0x7777('0x2d')][_0x7777('0x2f')]?_0x378987[_0x7777('0x2d')]:_0x35da22['model'];if(!_0x11f528['query']['hasOwnProperty'](_0x7777('0x30'))){_0x378987['limit']=qs[_0x7777('0x1c')](_0x11f528['query'][_0x7777('0x1c')]);_0x378987['offset']=qs[_0x7777('0x1a')](_0x11f528[_0x7777('0x2a')][_0x7777('0x1a')]);}_0x378987['order']=qs['sort'](_0x11f528[_0x7777('0x2a')]['sort']);_0x378987[_0x7777('0x31')]=qs[_0x7777('0x2b')](_[_0x7777('0x32')](_0x11f528[_0x7777('0x2a')],_0x35da22[_0x7777('0x2b')]),_0x571b3d);if(_0x11f528[_0x7777('0x2a')]['filter']){_0x378987[_0x7777('0x31')]=_[_0x7777('0x33')](_0x378987[_0x7777('0x31')],{'$or':_[_0x7777('0x27')](_0x571b3d,function(_0x4081ea){if(_0x4081ea[_0x7777('0x34')]!=='VIRTUAL'){var _0x43a48={};_0x43a48[_0x4081ea['name']]={'$like':'%'+_0x11f528[_0x7777('0x2a')]['filter']+'%'};return _0x43a48;}})});}_0x378987=_['merge']({},_0x378987,_0x11f528['options']);var _0x52f320={'where':_0x378987['where']};return db[_0x7777('0x35')]['count'](_0x52f320)['then'](function(_0x33c02d){_0x1e574d[_0x7777('0x1b')]=_0x33c02d;if(_0x11f528[_0x7777('0x2a')][_0x7777('0x36')]){_0x378987[_0x7777('0x37')]=[{'all':!![]}];}return db[_0x7777('0x35')][_0x7777('0x38')](_0x378987);})['then'](function(_0x581a91){_0x1e574d[_0x7777('0x39')]=_0x581a91;return _0x1e574d;})[_0x7777('0x22')](respondWithFilteredResult(_0x178cd4,_0x378987))['catch'](handleError(_0x178cd4,null));};exports['show']=function(_0x5232c1,_0x4613f1){var _0x3d1151={'raw':!![],'where':{'id':_0x5232c1['params']['id']}},_0x23f8b2={};_0x23f8b2['model']=_[_0x7777('0x3a')](db[_0x7777('0x35')][_0x7777('0x28')]);_0x23f8b2[_0x7777('0x2a')]=_['keys'](_0x5232c1[_0x7777('0x2a')]);_0x23f8b2[_0x7777('0x2b')]=_[_0x7777('0x2c')](_0x23f8b2[_0x7777('0x29')],_0x23f8b2[_0x7777('0x2a')]);_0x3d1151[_0x7777('0x2d')]=_[_0x7777('0x2c')](_0x23f8b2['model'],qs[_0x7777('0x2e')](_0x5232c1[_0x7777('0x2a')][_0x7777('0x2e')]));_0x3d1151[_0x7777('0x2d')]=_0x3d1151[_0x7777('0x2d')]['length']?_0x3d1151[_0x7777('0x2d')]:_0x23f8b2['model'];if(_0x5232c1[_0x7777('0x2a')][_0x7777('0x36')]){_0x3d1151[_0x7777('0x37')]=[{'all':!![]}];}_0x3d1151=_[_0x7777('0x33')]({},_0x3d1151,_0x5232c1[_0x7777('0x3b')]);return db[_0x7777('0x35')][_0x7777('0x3c')](_0x3d1151)['then'](handleEntityNotFound(_0x4613f1,null))[_0x7777('0x22')](respondWithResult(_0x4613f1,null))[_0x7777('0x3d')](handleError(_0x4613f1,null));};exports[_0x7777('0x3e')]=function(_0x510576,_0x5e5d36){return db[_0x7777('0x35')][_0x7777('0x3e')](_0x510576[_0x7777('0x3f')],{})[_0x7777('0x22')](respondWithResult(_0x5e5d36,0xc9))[_0x7777('0x3d')](handleError(_0x5e5d36,null));};exports[_0x7777('0x40')]=function(_0x2f194d,_0x52f34d){if(_0x2f194d[_0x7777('0x3f')]['id']){delete _0x2f194d['body']['id'];}return db['FaxTransferReport'][_0x7777('0x3c')]({'where':{'id':_0x2f194d[_0x7777('0x41')]['id']}})[_0x7777('0x22')](handleEntityNotFound(_0x52f34d,null))[_0x7777('0x22')](saveUpdates(_0x2f194d[_0x7777('0x3f')],null))[_0x7777('0x22')](respondWithResult(_0x52f34d,null))['catch'](handleError(_0x52f34d,null));};exports[_0x7777('0x23')]=function(_0xd89128,_0x3f9c9e){return db[_0x7777('0x35')][_0x7777('0x3c')]({'where':{'id':_0xd89128[_0x7777('0x41')]['id']}})[_0x7777('0x22')](handleEntityNotFound(_0x3f9c9e,null))[_0x7777('0x22')](removeEntity(_0x3f9c9e,null))[_0x7777('0x3d')](handleError(_0x3f9c9e,null));};exports[_0x7777('0x42')]=function(_0x48c019,_0xb4a839){return db[_0x7777('0x35')][_0x7777('0x42')]()[_0x7777('0x22')](respondWithResult(_0xb4a839,null))['catch'](handleError(_0xb4a839,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1b5148a..bd6be19 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 _0x76e0=['path','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','moment','request-promise'];(function(_0x1e8ac6,_0x121f2f){var _0x2f96c7=function(_0x44363e){while(--_0x44363e){_0x1e8ac6['push'](_0x1e8ac6['shift']());}};_0x2f96c7(++_0x121f2f);}(_0x76e0,0x6e));var _0x076e=function(_0x1b2221,_0x2ccd50){_0x1b2221=_0x1b2221-0x0;var _0x54c723=_0x76e0[_0x1b2221];return _0x54c723;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x076e('0x0'));var BPromise=require('bluebird');var rp=require(_0x076e('0x1'));var fs=require('fs');var path=require(_0x076e('0x2'));var rimraf=require('rimraf');var config=require(_0x076e('0x3'));var attributes=require(_0x076e('0x4'));module[_0x076e('0x5')]=function(_0x617416,_0x70551c){return _0x617416['define']('FaxTransferReport',attributes,{'tableName':_0x076e('0x6'),'paranoid':![],'indexes':[{'name':_0x076e('0x7'),'fields':[_0x076e('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1403=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x186872,_0x50a406){var _0x2f440d=function(_0x41691d){while(--_0x41691d){_0x186872['push'](_0x186872['shift']());}};_0x2f440d(++_0x50a406);}(_0x1403,0xcb));var _0x3140=function(_0x51d93b,_0x1c0c07){_0x51d93b=_0x51d93b-0x0;var _0x23bc18=_0x1403[_0x51d93b];return _0x23bc18;};'use strict';var _=require(_0x3140('0x0'));var util=require('util');var logger=require(_0x3140('0x1'))(_0x3140('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3140('0x3'));var fs=require('fs');var path=require(_0x3140('0x4'));var rimraf=require(_0x3140('0x5'));var config=require(_0x3140('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x3140('0x7')]=function(_0xff922b,_0x373a2b){return _0xff922b[_0x3140('0x8')](_0x3140('0x9'),attributes,{'tableName':_0x3140('0xa'),'paranoid':![],'indexes':[{'name':_0x3140('0xb'),'fields':[_0x3140('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 9ab7de5..dff73a7 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 _0xa8cd=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x21e6bf,_0x5af80c){var _0x5ac6ed=function(_0x10da02){while(--_0x10da02){_0x21e6bf['push'](_0x21e6bf['shift']());}};_0x5ac6ed(++_0x5af80c);}(_0xa8cd,0x140));var _0xda8c=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xa8cd[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0xda8c('0x0'));var util=require(_0xda8c('0x1'));var moment=require(_0xda8c('0x2'));var BPromise=require(_0xda8c('0x3'));var rs=require(_0xda8c('0x4'));var fs=require('fs');var Redis=require(_0xda8c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda8c('0x6'));var logger=require(_0xda8c('0x7'))('rpc');var config=require(_0xda8c('0x8'));var jayson=require(_0xda8c('0x9'));var client=jayson['client'][_0xda8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8116b0,_0x343bb4,_0x56c34d){return new BPromise(function(_0xbac66c,_0x2840ba){return client[_0xda8c('0xb')](_0x8116b0,_0x56c34d)['then'](function(_0x3aaf93){logger['info'](_0xda8c('0xc'),_0x343bb4,_0xda8c('0xd'));logger['debug'](_0xda8c('0xe'),_0x343bb4,_0xda8c('0xd'),JSON['stringify'](_0x3aaf93));if(_0x3aaf93['error']){if(_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x10')]===0x1f4){logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x3aaf93[_0xda8c('0xf')]['message']);return _0x2840ba(_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x11')]);}logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x11')]);return _0xbac66c(_0x3aaf93['error'][_0xda8c('0x11')]);}else{logger[_0xda8c('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x343bb4,_0xda8c('0xd'));_0xbac66c(_0x3aaf93[_0xda8c('0x13')][_0xda8c('0x11')]);}})[_0xda8c('0x14')](function(_0x12686d){logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x12686d);_0x2840ba(_0x12686d);});});} \ No newline at end of file +var _0xa2ab=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x4bb28b,_0x296703){var _0x2b7452=function(_0x433b4f){while(--_0x433b4f){_0x4bb28b['push'](_0x4bb28b['shift']());}};_0x2b7452(++_0x296703);}(_0xa2ab,0x65));var _0xba2a=function(_0x149380,_0x162914){_0x149380=_0x149380-0x0;var _0x46cad=_0xa2ab[_0x149380];return _0x46cad;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var BPromise=require(_0xba2a('0x3'));var rs=require(_0xba2a('0x4'));var fs=require('fs');var Redis=require(_0xba2a('0x5'));var db=require(_0xba2a('0x6'))['db'];var utils=require(_0xba2a('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xba2a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9f3f99,_0x575162,_0x13f7ff){return new BPromise(function(_0x35828d,_0x22625a){return client[_0xba2a('0x9')](_0x9f3f99,_0x13f7ff)[_0xba2a('0xa')](function(_0x499cd3){logger[_0xba2a('0xb')](_0xba2a('0xc'),_0x575162,_0xba2a('0xd'));logger[_0xba2a('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x575162,_0xba2a('0xd'),JSON[_0xba2a('0xf')](_0x499cd3));if(_0x499cd3[_0xba2a('0x10')]){if(_0x499cd3[_0xba2a('0x10')]['code']===0x1f4){logger[_0xba2a('0x10')](_0xba2a('0xc'),_0x575162,_0x499cd3[_0xba2a('0x10')]['message']);return _0x22625a(_0x499cd3[_0xba2a('0x10')]['message']);}logger['error'](_0xba2a('0xc'),_0x575162,_0x499cd3[_0xba2a('0x10')]['message']);return _0x35828d(_0x499cd3[_0xba2a('0x10')][_0xba2a('0x11')]);}else{logger[_0xba2a('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x575162,_0xba2a('0xd'));_0x35828d(_0x499cd3[_0xba2a('0x12')][_0xba2a('0x11')]);}})[_0xba2a('0x13')](function(_0x1f27e9){logger[_0xba2a('0x10')](_0xba2a('0xc'),_0x575162,_0x1f27e9);_0x22625a(_0x1f27e9);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index e115abe..7dcec06 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 _0xb722=['update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x244055,_0x3bf2c0){var _0x31cd46=function(_0xaebf68){while(--_0xaebf68){_0x244055['push'](_0x244055['shift']());}};_0x31cd46(++_0x3bf2c0);}(_0xb722,0x129));var _0x2b72=function(_0x841743,_0x3c81df){_0x841743=_0x841743-0x0;var _0x5a1384=_0xb722[_0x841743];return _0x5a1384;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b72('0x0'));var timeout=require(_0x2b72('0x1'));var express=require(_0x2b72('0x2'));var router=express['Router']();var fs_extra=require(_0x2b72('0x3'));var auth=require(_0x2b72('0x4'));var interaction=require(_0x2b72('0x5'));var config=require(_0x2b72('0x6'));var controller=require(_0x2b72('0x7'));router[_0x2b72('0x8')]('/',auth[_0x2b72('0x9')](),controller[_0x2b72('0xa')]);router[_0x2b72('0x8')](_0x2b72('0xb'),auth[_0x2b72('0x9')](),controller[_0x2b72('0xc')]);router['get'](_0x2b72('0xd'),auth[_0x2b72('0x9')](),controller[_0x2b72('0xe')]);router[_0x2b72('0xf')]('/',auth['isAuthenticated'](),controller[_0x2b72('0x10')]);router[_0x2b72('0x11')](_0x2b72('0xd'),auth[_0x2b72('0x9')](),controller[_0x2b72('0x12')]);router[_0x2b72('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2b72('0x14')]=router; \ No newline at end of file +var _0xb761=['multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','/:id','destroy','exports'];(function(_0x2a0f1a,_0x4e7206){var _0x2721bc=function(_0x42d2b8){while(--_0x42d2b8){_0x2a0f1a['push'](_0x2a0f1a['shift']());}};_0x2721bc(++_0x4e7206);}(_0xb761,0x1a0));var _0x1b76=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xb761[_0x257495];return _0x3849aa;};'use strict';var multer=require(_0x1b76('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b76('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x1b76('0x2'));var interaction=require(_0x1b76('0x3'));var config=require(_0x1b76('0x4'));var controller=require('./faxTransferReport.controller');router[_0x1b76('0x5')]('/',auth['isAuthenticated'](),controller[_0x1b76('0x6')]);router[_0x1b76('0x5')](_0x1b76('0x7'),auth[_0x1b76('0x8')](),controller[_0x1b76('0x9')]);router[_0x1b76('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x1b76('0xa')]);router[_0x1b76('0xb')]('/',auth[_0x1b76('0x8')](),controller[_0x1b76('0xc')]);router['put'](_0x1b76('0xd'),auth[_0x1b76('0x8')](),controller['update']);router['delete'](_0x1b76('0xd'),auth[_0x1b76('0x8')](),controller[_0x1b76('0xe')]);module[_0x1b76('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e00a6c2..425af9f 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 _0x775d=['post','create','/:id/configurations','addConfiguration','update','delete','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x343b4b,_0x42f443){var _0xe26b35=function(_0x5b8229){while(--_0x5b8229){_0x343b4b['push'](_0x343b4b['shift']());}};_0xe26b35(++_0x42f443);}(_0x775d,0xce));var _0xd775=function(_0x5016a9,_0x2bf9b4){_0x5016a9=_0x5016a9-0x0;var _0x1f1941=_0x775d[_0x5016a9];return _0x1f1941;};'use strict';var multer=require(_0xd775('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd775('0x1'));var express=require(_0xd775('0x2'));var router=express[_0xd775('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd775('0x4'));var config=require(_0xd775('0x5'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xd775('0x6')](),controller[_0xd775('0x7')]);router[_0xd775('0x8')](_0xd775('0x9'),auth[_0xd775('0x6')](),controller[_0xd775('0xa')]);router['get']('/:id/configurations',auth[_0xd775('0x6')](),controller[_0xd775('0xb')]);router[_0xd775('0x8')](_0xd775('0xc'),auth[_0xd775('0x6')](),controller[_0xd775('0xd')]);router[_0xd775('0xe')]('/',auth[_0xd775('0x6')](),controller[_0xd775('0xf')]);router[_0xd775('0xe')](_0xd775('0x10'),auth[_0xd775('0x6')](),controller[_0xd775('0x11')]);router['put'](_0xd775('0x9'),auth[_0xd775('0x6')](),controller[_0xd775('0x12')]);router[_0xd775('0x13')](_0xd775('0x9'),auth[_0xd775('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef5a=['../../components/interaction/service','./intDeskAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service'];(function(_0x19e9c8,_0x4474ed){var _0xc0152f=function(_0x3cabda){while(--_0x3cabda){_0x19e9c8['push'](_0x19e9c8['shift']());}};_0xc0152f(++_0x4474ed);}(_0xef5a,0x150));var _0xaef5=function(_0x376b0d,_0x52755d){_0x376b0d=_0x376b0d-0x0;var _0x123313=_0xef5a[_0x376b0d];return _0x123313;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xaef5('0x0'));var express=require(_0xaef5('0x1'));var router=express[_0xaef5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xaef5('0x3'));var interaction=require(_0xaef5('0x4'));var config=require('../../config/environment');var controller=require(_0xaef5('0x5'));router[_0xaef5('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaef5('0x6')](_0xaef5('0x7'),auth['isAuthenticated'](),controller[_0xaef5('0x8')]);router[_0xaef5('0x6')](_0xaef5('0x9'),auth[_0xaef5('0xa')](),controller[_0xaef5('0xb')]);router[_0xaef5('0x6')](_0xaef5('0xc'),auth[_0xaef5('0xa')](),controller[_0xaef5('0xd')]);router[_0xaef5('0xe')]('/',auth[_0xaef5('0xa')](),controller['create']);router[_0xaef5('0xe')](_0xaef5('0x9'),auth['isAuthenticated'](),controller[_0xaef5('0xf')]);router[_0xaef5('0x10')](_0xaef5('0x7'),auth[_0xaef5('0xa')](),controller['update']);router[_0xaef5('0x11')](_0xaef5('0x7'),auth[_0xaef5('0xa')](),controller[_0xaef5('0x12')]);module[_0xaef5('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5274b62..77961b8 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 _0xd134=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xd134,0x15f));var _0x4d13=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xd134[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0x4d13('0x0'));module[_0x4d13('0x1')]={'name':{'type':Sequelize[_0x4d13('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d13('0x2')]},'remoteUri':{'type':Sequelize[_0x4d13('0x2')]},'authType':{'type':Sequelize[_0x4d13('0x3')]('basic'),'defaultValue':_0x4d13('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4d13('0x2')]},'consumerSecret':{'type':Sequelize[_0x4d13('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x4d13('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d13('0x3')](_0x4d13('0x5'),_0x4d13('0x6')),'defaultValue':_0x4d13('0x5')}}; \ No newline at end of file +var _0xb39b=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x470f34,_0x2d29da){var _0x2ce792=function(_0x166b86){while(--_0x166b86){_0x470f34['push'](_0x470f34['shift']());}};_0x2ce792(++_0x2d29da);}(_0xb39b,0xa6));var _0xbb39=function(_0x59d983,_0x4e150b){_0x59d983=_0x59d983-0x0;var _0x5e1e97=_0xb39b[_0x59d983];return _0x5e1e97;};'use strict';var Sequelize=require(_0xbb39('0x0'));module[_0xbb39('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbb39('0x2')]},'remoteUri':{'type':Sequelize[_0xbb39('0x2')]},'authType':{'type':Sequelize[_0xbb39('0x3')]('basic'),'defaultValue':_0xbb39('0x4')},'password':{'type':Sequelize[_0xbb39('0x2')]},'consumerKey':{'type':Sequelize[_0xbb39('0x2')]},'consumerSecret':{'type':Sequelize[_0xbb39('0x2')]},'token':{'type':Sequelize[_0xbb39('0x2')]},'tokenSecret':{'type':Sequelize[_0xbb39('0x2')]},'serverUrl':{'type':Sequelize[_0xbb39('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbb39('0x5'),_0xbb39('0x6')),'defaultValue':_0xbb39('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 87e4b30..4c7503b 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 _0xaad0=['AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','GET','format','application/json','basic','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','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','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','DeskAccount','findAll','rows','show','params','options','create','body','catch','find','DeskConfiguration','rawAttributes','nolimit','getConfigurations','addConfiguration','findOne'];(function(_0x49dc8,_0x331325){var _0x1be465=function(_0xa39f6){while(--_0xa39f6){_0x49dc8['push'](_0x49dc8['shift']());}};_0x1be465(++_0x331325);}(_0xaad0,0xff));var _0x0aad=function(_0x415332,_0x1663c8){_0x415332=_0x415332-0x0;var _0x39c980=_0xaad0[_0x415332];return _0x39c980;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0aad('0x0'));var jsonpatch=require(_0x0aad('0x1'));var rp=require(_0x0aad('0x2'));var moment=require(_0x0aad('0x3'));var BPromise=require(_0x0aad('0x4'));var Mustache=require(_0x0aad('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0aad('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0aad('0x7'));var toCsv=require(_0x0aad('0x6'));var querystring=require(_0x0aad('0x8'));var Papa=require(_0x0aad('0x9'));var Redis=require('ioredis');var authService=require(_0x0aad('0xa'));var qs=require(_0x0aad('0xb'));var as=require(_0x0aad('0xc'));var hardwareService=require(_0x0aad('0xd'));var logger=require(_0x0aad('0xe'))(_0x0aad('0xf'));var utils=require(_0x0aad('0x10'));var config=require(_0x0aad('0x11'));var licenseUtil=require(_0x0aad('0x12'));var db=require(_0x0aad('0x13'))['db'];var integrations=require(_0x0aad('0x14'));function respondWithStatusCode(_0x17b7f3,_0x35aa22){_0x35aa22=_0x35aa22||0xcc;return function(_0x172a1b){if(_0x172a1b){return _0x17b7f3[_0x0aad('0x15')](_0x35aa22);}return _0x17b7f3[_0x0aad('0x16')](_0x35aa22)['end']();};}function respondWithResult(_0x45105a,_0x1e9d9b){_0x1e9d9b=_0x1e9d9b||0xc8;return function(_0x2188cc){if(_0x2188cc){return _0x45105a[_0x0aad('0x16')](_0x1e9d9b)[_0x0aad('0x17')](_0x2188cc);}};}function respondWithFilteredResult(_0x3d88ef,_0x4d6f5d){return function(_0x168d75){if(_0x168d75){var _0x29ef67=typeof _0x4d6f5d[_0x0aad('0x18')]===_0x0aad('0x19')&&typeof _0x4d6f5d[_0x0aad('0x1a')]===_0x0aad('0x19');var _0x408a84=_0x168d75['count'];var _0x4b93df=_0x29ef67?0x0:_0x4d6f5d[_0x0aad('0x18')];var _0x6d8aae=_0x29ef67?_0x168d75[_0x0aad('0x1b')]:_0x4d6f5d[_0x0aad('0x18')]+_0x4d6f5d['limit'];var _0x18213c;if(_0x6d8aae>=_0x408a84){_0x6d8aae=_0x408a84;_0x18213c=0xc8;}else{_0x18213c=0xce;}_0x3d88ef[_0x0aad('0x16')](_0x18213c);return _0x3d88ef[_0x0aad('0x1c')](_0x0aad('0x1d'),_0x4b93df+'-'+_0x6d8aae+'/'+_0x408a84)[_0x0aad('0x17')](_0x168d75);}return null;};}function patchUpdates(_0x126f72){return function(_0x2dfd27){try{jsonpatch[_0x0aad('0x1e')](_0x2dfd27,_0x126f72,!![]);}catch(_0x30eb11){return BPromise[_0x0aad('0x1f')](_0x30eb11);}return _0x2dfd27[_0x0aad('0x20')]();};}function saveUpdates(_0x3aff45,_0x4b4d05){return function(_0x4750e5){if(_0x4750e5){return _0x4750e5[_0x0aad('0x21')](_0x3aff45)[_0x0aad('0x22')](function(_0xa16803){return _0xa16803;});}return null;};}function removeEntity(_0x39b8ae,_0x136d07){return function(_0x197502){if(_0x197502){return _0x197502[_0x0aad('0x23')]()[_0x0aad('0x22')](function(){_0x39b8ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ff07,_0x12ef1b){return function(_0x1bc676){if(!_0x1bc676){_0x39ff07[_0x0aad('0x15')](0x194);}return _0x1bc676;};}function handleError(_0x42f9c6,_0x4824c3){_0x4824c3=_0x4824c3||0x1f4;return function(_0x4b97fc){logger[_0x0aad('0x24')](_0x4b97fc['stack']);if(_0x4b97fc[_0x0aad('0x25')]){delete _0x4b97fc[_0x0aad('0x25')];}_0x42f9c6['status'](_0x4824c3)[_0x0aad('0x26')](_0x4b97fc);};}exports[_0x0aad('0x27')]=function(_0x37d760,_0x2534a4){var _0x16eb46={},_0x2606d0={},_0x23c8a9={'count':0x0,'rows':[]};var _0x52b7b0=_['map'](db['DeskAccount']['rawAttributes'],function(_0x2e0f48){return{'name':_0x2e0f48[_0x0aad('0x28')],'type':_0x2e0f48[_0x0aad('0x29')][_0x0aad('0x2a')]};});_0x2606d0[_0x0aad('0x2b')]=_[_0x0aad('0x2c')](_0x52b7b0,_0x0aad('0x25'));_0x2606d0[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x37d760[_0x0aad('0x2d')]);_0x2606d0[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x2606d0[_0x0aad('0x2b')],_0x2606d0['query']);_0x16eb46[_0x0aad('0x31')]=_[_0x0aad('0x30')](_0x2606d0['model'],qs[_0x0aad('0x32')](_0x37d760[_0x0aad('0x2d')][_0x0aad('0x32')]));_0x16eb46[_0x0aad('0x31')]=_0x16eb46[_0x0aad('0x31')][_0x0aad('0x33')]?_0x16eb46[_0x0aad('0x31')]:_0x2606d0['model'];if(!_0x37d760[_0x0aad('0x2d')][_0x0aad('0x34')]('nolimit')){_0x16eb46[_0x0aad('0x1a')]=qs[_0x0aad('0x1a')](_0x37d760[_0x0aad('0x2d')][_0x0aad('0x1a')]);_0x16eb46[_0x0aad('0x18')]=qs['offset'](_0x37d760[_0x0aad('0x2d')]['offset']);}_0x16eb46[_0x0aad('0x35')]=qs[_0x0aad('0x36')](_0x37d760[_0x0aad('0x2d')]['sort']);_0x16eb46['where']=qs['filters'](_[_0x0aad('0x37')](_0x37d760[_0x0aad('0x2d')],_0x2606d0[_0x0aad('0x2f')]),_0x52b7b0);if(_0x37d760[_0x0aad('0x2d')][_0x0aad('0x38')]){_0x16eb46[_0x0aad('0x39')]=_[_0x0aad('0x3a')](_0x16eb46['where'],{'$or':_[_0x0aad('0x2c')](_0x52b7b0,function(_0x13841e){if(_0x13841e['type']!==_0x0aad('0x3b')){var _0x5b2d02={};_0x5b2d02[_0x13841e['name']]={'$like':'%'+_0x37d760[_0x0aad('0x2d')]['filter']+'%'};return _0x5b2d02;}})});}_0x16eb46=_[_0x0aad('0x3a')]({},_0x16eb46,_0x37d760['options']);var _0x387b85={'where':_0x16eb46[_0x0aad('0x39')]};return db['DeskAccount']['count'](_0x387b85)[_0x0aad('0x22')](function(_0x2b1624){_0x23c8a9[_0x0aad('0x1b')]=_0x2b1624;if(_0x37d760[_0x0aad('0x2d')][_0x0aad('0x3c')]){_0x16eb46[_0x0aad('0x3d')]=[{'all':!![]}];}return db[_0x0aad('0x3e')][_0x0aad('0x3f')](_0x16eb46);})[_0x0aad('0x22')](function(_0x528b63){_0x23c8a9[_0x0aad('0x40')]=_0x528b63;return _0x23c8a9;})[_0x0aad('0x22')](respondWithFilteredResult(_0x2534a4,_0x16eb46))['catch'](handleError(_0x2534a4,null));};exports[_0x0aad('0x41')]=function(_0x2b57c0,_0xad5668){var _0x4ad519={'raw':![],'where':{'id':_0x2b57c0[_0x0aad('0x42')]['id']}},_0x399d75={};_0x399d75[_0x0aad('0x2b')]=_[_0x0aad('0x2e')](db[_0x0aad('0x3e')]['rawAttributes']);_0x399d75[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x2b57c0[_0x0aad('0x2d')]);_0x399d75[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x399d75[_0x0aad('0x2b')],_0x399d75[_0x0aad('0x2d')]);_0x4ad519['attributes']=_['intersection'](_0x399d75[_0x0aad('0x2b')],qs[_0x0aad('0x32')](_0x2b57c0[_0x0aad('0x2d')][_0x0aad('0x32')]));_0x4ad519['attributes']=_0x4ad519['attributes'][_0x0aad('0x33')]?_0x4ad519[_0x0aad('0x31')]:_0x399d75[_0x0aad('0x2b')];if(_0x2b57c0[_0x0aad('0x2d')][_0x0aad('0x3c')]){_0x4ad519[_0x0aad('0x3d')]=[{'all':!![]}];}_0x4ad519=_[_0x0aad('0x3a')]({},_0x4ad519,_0x2b57c0[_0x0aad('0x43')]);return db[_0x0aad('0x3e')]['find'](_0x4ad519)['then'](handleEntityNotFound(_0xad5668,null))[_0x0aad('0x22')](respondWithResult(_0xad5668,null))['catch'](handleError(_0xad5668,null));};exports[_0x0aad('0x44')]=function(_0x2742c6,_0x5847c5){return db['DeskAccount'][_0x0aad('0x44')](_0x2742c6[_0x0aad('0x45')],{})['then'](respondWithResult(_0x5847c5,0xc9))[_0x0aad('0x46')](handleError(_0x5847c5,null));};exports['update']=function(_0xdebba7,_0x2f71f0){if(_0xdebba7[_0x0aad('0x45')]['id']){delete _0xdebba7['body']['id'];}return db[_0x0aad('0x3e')][_0x0aad('0x47')]({'where':{'id':_0xdebba7[_0x0aad('0x42')]['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x2f71f0,null))[_0x0aad('0x22')](saveUpdates(_0xdebba7[_0x0aad('0x45')],null))[_0x0aad('0x22')](respondWithResult(_0x2f71f0,null))[_0x0aad('0x46')](handleError(_0x2f71f0,null));};exports[_0x0aad('0x23')]=function(_0xcaf217,_0x176c10){return db[_0x0aad('0x3e')][_0x0aad('0x47')]({'where':{'id':_0xcaf217['params']['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x176c10,null))[_0x0aad('0x22')](removeEntity(_0x176c10,null))[_0x0aad('0x46')](handleError(_0x176c10,null));};exports['getConfigurations']=function(_0x993694,_0x569432,_0x57a137){var _0xd18c3c={};var _0x4469e1={};var _0x15ad64;var _0x535645;return db[_0x0aad('0x3e')]['findOne']({'where':{'id':_0x993694['params']['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x569432,null))[_0x0aad('0x22')](function(_0x536453){if(_0x536453){_0x15ad64=_0x536453;_0x4469e1[_0x0aad('0x2b')]=_[_0x0aad('0x2e')](db[_0x0aad('0x48')][_0x0aad('0x49')]);_0x4469e1[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x993694['query']);_0x4469e1[_0x0aad('0x2f')]=_['intersection'](_0x4469e1[_0x0aad('0x2b')],_0x4469e1[_0x0aad('0x2d')]);_0xd18c3c['attributes']=_[_0x0aad('0x30')](_0x4469e1['model'],qs['fields'](_0x993694[_0x0aad('0x2d')]['fields']));_0xd18c3c['attributes']=_0xd18c3c[_0x0aad('0x31')]['length']?_0xd18c3c['attributes']:_0x4469e1[_0x0aad('0x2b')];_0xd18c3c[_0x0aad('0x35')]=qs[_0x0aad('0x36')](_0x993694[_0x0aad('0x2d')][_0x0aad('0x36')]);_0xd18c3c['where']=qs[_0x0aad('0x2f')](_[_0x0aad('0x37')](_0x993694[_0x0aad('0x2d')],_0x4469e1[_0x0aad('0x2f')]));if(_0x993694[_0x0aad('0x2d')][_0x0aad('0x38')]){_0xd18c3c[_0x0aad('0x39')]=_[_0x0aad('0x3a')](_0xd18c3c[_0x0aad('0x39')],{'$or':_['map'](_0xd18c3c['attributes'],function(_0x406dec){var _0x4a7524={};_0x4a7524[_0x406dec]={'$like':'%'+_0x993694[_0x0aad('0x2d')][_0x0aad('0x38')]+'%'};return _0x4a7524;})});}_0xd18c3c=_[_0x0aad('0x3a')]({},_0xd18c3c,_0x993694['options']);return _0x15ad64['getConfigurations'](_0xd18c3c);}})[_0x0aad('0x22')](function(_0x2c45e8){if(_0x2c45e8){_0x535645=_0x2c45e8[_0x0aad('0x33')];if(!_0x993694[_0x0aad('0x2d')][_0x0aad('0x34')](_0x0aad('0x4a'))){_0xd18c3c[_0x0aad('0x1a')]=qs[_0x0aad('0x1a')](_0x993694['query'][_0x0aad('0x1a')]);_0xd18c3c[_0x0aad('0x18')]=qs[_0x0aad('0x18')](_0x993694[_0x0aad('0x2d')][_0x0aad('0x18')]);}return _0x15ad64[_0x0aad('0x4b')](_0xd18c3c);}})[_0x0aad('0x22')](function(_0x149aeb){if(_0x149aeb){return _0x149aeb?{'count':_0x535645,'rows':_0x149aeb}:null;}})[_0x0aad('0x22')](respondWithResult(_0x569432,null))['catch'](handleError(_0x569432,null));};exports[_0x0aad('0x4c')]=function(_0x52b9f4,_0x4bfc2c,_0x22353d){if(_0x52b9f4[_0x0aad('0x45')]['id']){delete _0x52b9f4[_0x0aad('0x45')]['id'];}return db[_0x0aad('0x3e')][_0x0aad('0x4d')]({'where':{'id':_0x52b9f4[_0x0aad('0x42')]['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x4bfc2c,null))[_0x0aad('0x22')](function(_0x3d72a7){if(_0x3d72a7){_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x4e')]=_0x3d72a7['id'];_0x52b9f4['body'][_0x0aad('0x4f')]=integrations['getSubjects'](_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x50')],_0x52b9f4['body'][_0x0aad('0x29')]);_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x51')]=integrations[_0x0aad('0x52')](_0x52b9f4['body']['channel'],_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x29')]);return db['DeskConfiguration'][_0x0aad('0x44')](_0x52b9f4['body'],{'include':[{'model':db[_0x0aad('0x53')],'as':_0x0aad('0x4f')},{'model':db[_0x0aad('0x53')],'as':_0x0aad('0x51')}]});}return null;})['then'](respondWithResult(_0x4bfc2c,null))[_0x0aad('0x46')](handleError(_0x4bfc2c,null));};exports[_0x0aad('0x54')]=function(_0xeab00b,_0x344035,_0x3cf82b){var _0x2ca1df=[{'name':_0x0aad('0x55'),'label':_0x0aad('0x55'),'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 _0x396523='';return db[_0x0aad('0x3e')][_0x0aad('0x4d')]({'where':{'id':_0xeab00b[_0x0aad('0x42')]['id']},'attributes':['id',_0x0aad('0x56'),_0x0aad('0x57'),_0x0aad('0x58'),_0x0aad('0x59'),_0x0aad('0x5a'),_0x0aad('0x5b'),_0x0aad('0x5c'),_0x0aad('0x5d')]})[_0x0aad('0x22')](handleEntityNotFound(_0x344035,null))[_0x0aad('0x22')](function(_0x34ed0d){if(_0x34ed0d){_0x396523=_0x34ed0d['remoteUri'];var _0x4da3d4=_0x396523[_0x0aad('0x5e')](-0x1);if(_0x4da3d4==='/'){_0x396523=_0x396523['substring'](0x0,_0x396523['lastIndexOf'](_0x4da3d4));}var _0x513781={'method':_0x0aad('0x5f'),'uri':util[_0x0aad('0x60')]('%s/custom_fields',_0x396523),'headers':{'Content-Type':_0x0aad('0x61'),'Accept':'application/json'},'json':!![]};if(_0x34ed0d[_0x0aad('0x57')]===_0x0aad('0x62')){_0x513781['headers'][_0x0aad('0x63')]=util[_0x0aad('0x60')](_0x0aad('0x64'),new Buffer(util[_0x0aad('0x60')]('%s:%s',_0x34ed0d[_0x0aad('0x58')],_0x34ed0d[_0x0aad('0x59')]))[_0x0aad('0x65')](_0x0aad('0x66')));}return rp(_0x513781)['then'](function(_0x16def1){return _0x2ca1df[_0x0aad('0x67')](_[_0x0aad('0x2c')](_0x16def1[_0x0aad('0x68')][_0x0aad('0x69')],function(_0x1fec7c){return{'id':_0x1fec7c[_0x0aad('0x25')],'name':_0x1fec7c[_0x0aad('0x25')],'type':_0x1fec7c[_0x0aad('0x29')],'active':_0x1fec7c[_0x0aad('0x6a')],'label':_0x1fec7c[_0x0aad('0x6b')],'custom':!![]};}));});}})[_0x0aad('0x22')](function(_0x4a5845){return{'count':_0x4a5845[_0x0aad('0x33')],'rows':_0x4a5845};})[_0x0aad('0x22')](respondWithResult(_0x344035,null))[_0x0aad('0x46')](function(_0xf9b6a){var _0x1fcd33=_0xeab00b['query'][_0x0aad('0x6c')]?0x1f4:_0xf9b6a['statusCode']||0x1f4;logger[_0x0aad('0x24')](_0x0aad('0x6d'),_0x0aad('0x54'),_0x1fcd33,JSON['stringify'](_0xf9b6a));delete _0xf9b6a['name'];if(_0x1fcd33===0x191){_0x1fcd33=0x190;}_0x344035[_0x0aad('0x16')](_0x1fcd33)['send'](_0xeab00b[_0x0aad('0x2d')][_0x0aad('0x6c')]?{'message':_0x0aad('0x6e'),'statusCode':_0xf9b6a['statusCode']}:_0xf9b6a);});}; \ No newline at end of file +var _0x9a8a=['merge','filter','options','rows','catch','show','params','rawAttributes','keys','length','includeAll','include','find','create','body','getConfigurations','DeskConfiguration','pick','findOne','Subjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','DeskAccount','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x347999,_0x315e31){var _0x48aec3=function(_0x55b84a){while(--_0x55b84a){_0x347999['push'](_0x347999['shift']());}};_0x48aec3(++_0x315e31);}(_0x9a8a,0xab));var _0xa9a8=function(_0x4e8189,_0x3f507c){_0x4e8189=_0x4e8189-0x0;var _0x2a91bf=_0x9a8a[_0x4e8189];return _0x2a91bf;};'use strict';var emlformat=require(_0xa9a8('0x0'));var rimraf=require(_0xa9a8('0x1'));var zipdir=require(_0xa9a8('0x2'));var jsonpatch=require(_0xa9a8('0x3'));var rp=require(_0xa9a8('0x4'));var moment=require(_0xa9a8('0x5'));var BPromise=require(_0xa9a8('0x6'));var Mustache=require(_0xa9a8('0x7'));var util=require(_0xa9a8('0x8'));var path=require(_0xa9a8('0x9'));var sox=require(_0xa9a8('0xa'));var csv=require('to-csv');var ejs=require(_0xa9a8('0xb'));var fs=require('fs');var fs_extra=require(_0xa9a8('0xc'));var _=require('lodash');var squel=require(_0xa9a8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa9a8('0xe'));var toCsv=require(_0xa9a8('0xf'));var querystring=require('querystring');var Papa=require(_0xa9a8('0x10'));var Redis=require(_0xa9a8('0x11'));var authService=require(_0xa9a8('0x12'));var qs=require(_0xa9a8('0x13'));var as=require(_0xa9a8('0x14'));var hardwareService=require(_0xa9a8('0x15'));var logger=require(_0xa9a8('0x16'))(_0xa9a8('0x17'));var utils=require(_0xa9a8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa9a8('0x19'));var db=require(_0xa9a8('0x1a'))['db'];var integrations=require(_0xa9a8('0x1b'));function respondWithStatusCode(_0xd5b67f,_0x17429d){_0x17429d=_0x17429d||0xcc;return function(_0x52804f){if(_0x52804f){return _0xd5b67f[_0xa9a8('0x1c')](_0x17429d);}return _0xd5b67f[_0xa9a8('0x1d')](_0x17429d)['end']();};}function respondWithResult(_0x200ffd,_0x56e03c){_0x56e03c=_0x56e03c||0xc8;return function(_0x281430){if(_0x281430){return _0x200ffd[_0xa9a8('0x1d')](_0x56e03c)[_0xa9a8('0x1e')](_0x281430);}};}function respondWithFilteredResult(_0x68b47e,_0x5c9787){return function(_0x57e49a){if(_0x57e49a){var _0x564892=typeof _0x5c9787[_0xa9a8('0x1f')]==='undefined'&&typeof _0x5c9787[_0xa9a8('0x20')]===_0xa9a8('0x21');var _0x1a4d45=_0x57e49a['count'];var _0x407639=_0x564892?0x0:_0x5c9787[_0xa9a8('0x1f')];var _0x5ace41=_0x564892?_0x57e49a[_0xa9a8('0x22')]:_0x5c9787['offset']+_0x5c9787['limit'];var _0x178e6e;if(_0x5ace41>=_0x1a4d45){_0x5ace41=_0x1a4d45;_0x178e6e=0xc8;}else{_0x178e6e=0xce;}_0x68b47e[_0xa9a8('0x1d')](_0x178e6e);return _0x68b47e[_0xa9a8('0x23')](_0xa9a8('0x24'),_0x407639+'-'+_0x5ace41+'/'+_0x1a4d45)['json'](_0x57e49a);}return null;};}function patchUpdates(_0x463335){return function(_0x143ba9){try{jsonpatch[_0xa9a8('0x25')](_0x143ba9,_0x463335,!![]);}catch(_0xb56f0f){return BPromise[_0xa9a8('0x26')](_0xb56f0f);}return _0x143ba9[_0xa9a8('0x27')]();};}function saveUpdates(_0x7a2569,_0x5c6aeb){return function(_0x11c01b){if(_0x11c01b){return _0x11c01b[_0xa9a8('0x28')](_0x7a2569)[_0xa9a8('0x29')](function(_0x2770f6){return _0x2770f6;});}return null;};}function removeEntity(_0x3a06dc,_0x23f2d9){return function(_0x133ad8){if(_0x133ad8){return _0x133ad8[_0xa9a8('0x2a')]()['then'](function(){_0x3a06dc[_0xa9a8('0x1d')](0xcc)[_0xa9a8('0x2b')]();});}};}function handleEntityNotFound(_0x360194,_0x5cb798){return function(_0x5c6449){if(!_0x5c6449){_0x360194[_0xa9a8('0x1c')](0x194);}return _0x5c6449;};}function handleError(_0x35b0dd,_0x630fe2){_0x630fe2=_0x630fe2||0x1f4;return function(_0x41f134){logger[_0xa9a8('0x2c')](_0x41f134[_0xa9a8('0x2d')]);if(_0x41f134[_0xa9a8('0x2e')]){delete _0x41f134['name'];}_0x35b0dd[_0xa9a8('0x1d')](_0x630fe2)[_0xa9a8('0x2f')](_0x41f134);};}exports[_0xa9a8('0x30')]=function(_0xcad8d0,_0x560bed){var _0x1dcd07={},_0x4359b2={},_0x3e83f3={'count':0x0,'rows':[]};var _0x421857=_[_0xa9a8('0x31')](db[_0xa9a8('0x32')]['rawAttributes'],function(_0x351fca){return{'name':_0x351fca['fieldName'],'type':_0x351fca[_0xa9a8('0x33')][_0xa9a8('0x34')]};});_0x4359b2[_0xa9a8('0x35')]=_[_0xa9a8('0x31')](_0x421857,_0xa9a8('0x2e'));_0x4359b2[_0xa9a8('0x36')]=_['keys'](_0xcad8d0['query']);_0x4359b2['filters']=_[_0xa9a8('0x37')](_0x4359b2[_0xa9a8('0x35')],_0x4359b2[_0xa9a8('0x36')]);_0x1dcd07[_0xa9a8('0x38')]=_[_0xa9a8('0x37')](_0x4359b2[_0xa9a8('0x35')],qs[_0xa9a8('0x39')](_0xcad8d0['query'][_0xa9a8('0x39')]));_0x1dcd07[_0xa9a8('0x38')]=_0x1dcd07['attributes']['length']?_0x1dcd07[_0xa9a8('0x38')]:_0x4359b2[_0xa9a8('0x35')];if(!_0xcad8d0[_0xa9a8('0x36')][_0xa9a8('0x3a')](_0xa9a8('0x3b'))){_0x1dcd07['limit']=qs[_0xa9a8('0x20')](_0xcad8d0[_0xa9a8('0x36')][_0xa9a8('0x20')]);_0x1dcd07[_0xa9a8('0x1f')]=qs['offset'](_0xcad8d0[_0xa9a8('0x36')][_0xa9a8('0x1f')]);}_0x1dcd07['order']=qs[_0xa9a8('0x3c')](_0xcad8d0[_0xa9a8('0x36')][_0xa9a8('0x3c')]);_0x1dcd07[_0xa9a8('0x3d')]=qs[_0xa9a8('0x3e')](_['pick'](_0xcad8d0['query'],_0x4359b2['filters']),_0x421857);if(_0xcad8d0[_0xa9a8('0x36')]['filter']){_0x1dcd07[_0xa9a8('0x3d')]=_[_0xa9a8('0x3f')](_0x1dcd07[_0xa9a8('0x3d')],{'$or':_[_0xa9a8('0x31')](_0x421857,function(_0x1101ed){if(_0x1101ed[_0xa9a8('0x33')]!=='VIRTUAL'){var _0x4b1dc9={};_0x4b1dc9[_0x1101ed[_0xa9a8('0x2e')]]={'$like':'%'+_0xcad8d0[_0xa9a8('0x36')][_0xa9a8('0x40')]+'%'};return _0x4b1dc9;}})});}_0x1dcd07=_['merge']({},_0x1dcd07,_0xcad8d0[_0xa9a8('0x41')]);var _0x228b34={'where':_0x1dcd07[_0xa9a8('0x3d')]};return db[_0xa9a8('0x32')][_0xa9a8('0x22')](_0x228b34)[_0xa9a8('0x29')](function(_0x47da58){_0x3e83f3[_0xa9a8('0x22')]=_0x47da58;if(_0xcad8d0[_0xa9a8('0x36')]['includeAll']){_0x1dcd07['include']=[{'all':!![]}];}return db[_0xa9a8('0x32')]['findAll'](_0x1dcd07);})[_0xa9a8('0x29')](function(_0x246c95){_0x3e83f3[_0xa9a8('0x42')]=_0x246c95;return _0x3e83f3;})['then'](respondWithFilteredResult(_0x560bed,_0x1dcd07))[_0xa9a8('0x43')](handleError(_0x560bed,null));};exports[_0xa9a8('0x44')]=function(_0x5e12b4,_0x4a25f7){var _0x2bb9bd={'raw':![],'where':{'id':_0x5e12b4[_0xa9a8('0x45')]['id']}},_0x380d79={};_0x380d79['model']=_['keys'](db[_0xa9a8('0x32')][_0xa9a8('0x46')]);_0x380d79[_0xa9a8('0x36')]=_[_0xa9a8('0x47')](_0x5e12b4['query']);_0x380d79[_0xa9a8('0x3e')]=_[_0xa9a8('0x37')](_0x380d79[_0xa9a8('0x35')],_0x380d79[_0xa9a8('0x36')]);_0x2bb9bd['attributes']=_[_0xa9a8('0x37')](_0x380d79[_0xa9a8('0x35')],qs[_0xa9a8('0x39')](_0x5e12b4['query'][_0xa9a8('0x39')]));_0x2bb9bd[_0xa9a8('0x38')]=_0x2bb9bd[_0xa9a8('0x38')][_0xa9a8('0x48')]?_0x2bb9bd[_0xa9a8('0x38')]:_0x380d79[_0xa9a8('0x35')];if(_0x5e12b4[_0xa9a8('0x36')][_0xa9a8('0x49')]){_0x2bb9bd[_0xa9a8('0x4a')]=[{'all':!![]}];}_0x2bb9bd=_[_0xa9a8('0x3f')]({},_0x2bb9bd,_0x5e12b4[_0xa9a8('0x41')]);return db[_0xa9a8('0x32')][_0xa9a8('0x4b')](_0x2bb9bd)['then'](handleEntityNotFound(_0x4a25f7,null))[_0xa9a8('0x29')](respondWithResult(_0x4a25f7,null))[_0xa9a8('0x43')](handleError(_0x4a25f7,null));};exports[_0xa9a8('0x4c')]=function(_0x4bea30,_0x473c8b){return db[_0xa9a8('0x32')]['create'](_0x4bea30[_0xa9a8('0x4d')],{})[_0xa9a8('0x29')](respondWithResult(_0x473c8b,0xc9))[_0xa9a8('0x43')](handleError(_0x473c8b,null));};exports[_0xa9a8('0x28')]=function(_0xa5cd13,_0x3f6d5b){if(_0xa5cd13[_0xa9a8('0x4d')]['id']){delete _0xa5cd13[_0xa9a8('0x4d')]['id'];}return db[_0xa9a8('0x32')]['find']({'where':{'id':_0xa5cd13[_0xa9a8('0x45')]['id']}})[_0xa9a8('0x29')](handleEntityNotFound(_0x3f6d5b,null))[_0xa9a8('0x29')](saveUpdates(_0xa5cd13[_0xa9a8('0x4d')],null))[_0xa9a8('0x29')](respondWithResult(_0x3f6d5b,null))[_0xa9a8('0x43')](handleError(_0x3f6d5b,null));};exports[_0xa9a8('0x2a')]=function(_0x5d2ccb,_0x35e94c){return db['DeskAccount'][_0xa9a8('0x4b')]({'where':{'id':_0x5d2ccb[_0xa9a8('0x45')]['id']}})[_0xa9a8('0x29')](handleEntityNotFound(_0x35e94c,null))[_0xa9a8('0x29')](removeEntity(_0x35e94c,null))['catch'](handleError(_0x35e94c,null));};exports[_0xa9a8('0x4e')]=function(_0x32b147,_0x1e4d2e,_0x2574c1){var _0x3fdf02={};var _0x40759b={};var _0x458199;var _0x40becb;return db[_0xa9a8('0x32')]['findOne']({'where':{'id':_0x32b147['params']['id']}})['then'](handleEntityNotFound(_0x1e4d2e,null))['then'](function(_0x199acf){if(_0x199acf){_0x458199=_0x199acf;_0x40759b[_0xa9a8('0x35')]=_['keys'](db[_0xa9a8('0x4f')][_0xa9a8('0x46')]);_0x40759b[_0xa9a8('0x36')]=_[_0xa9a8('0x47')](_0x32b147[_0xa9a8('0x36')]);_0x40759b[_0xa9a8('0x3e')]=_[_0xa9a8('0x37')](_0x40759b[_0xa9a8('0x35')],_0x40759b['query']);_0x3fdf02[_0xa9a8('0x38')]=_[_0xa9a8('0x37')](_0x40759b['model'],qs[_0xa9a8('0x39')](_0x32b147[_0xa9a8('0x36')][_0xa9a8('0x39')]));_0x3fdf02[_0xa9a8('0x38')]=_0x3fdf02[_0xa9a8('0x38')][_0xa9a8('0x48')]?_0x3fdf02['attributes']:_0x40759b[_0xa9a8('0x35')];_0x3fdf02['order']=qs['sort'](_0x32b147[_0xa9a8('0x36')][_0xa9a8('0x3c')]);_0x3fdf02['where']=qs['filters'](_[_0xa9a8('0x50')](_0x32b147['query'],_0x40759b[_0xa9a8('0x3e')]));if(_0x32b147['query'][_0xa9a8('0x40')]){_0x3fdf02[_0xa9a8('0x3d')]=_['merge'](_0x3fdf02[_0xa9a8('0x3d')],{'$or':_[_0xa9a8('0x31')](_0x3fdf02['attributes'],function(_0x1629b2){var _0x3fa84d={};_0x3fa84d[_0x1629b2]={'$like':'%'+_0x32b147[_0xa9a8('0x36')][_0xa9a8('0x40')]+'%'};return _0x3fa84d;})});}_0x3fdf02=_[_0xa9a8('0x3f')]({},_0x3fdf02,_0x32b147['options']);return _0x458199[_0xa9a8('0x4e')](_0x3fdf02);}})[_0xa9a8('0x29')](function(_0x1fe928){if(_0x1fe928){_0x40becb=_0x1fe928[_0xa9a8('0x48')];if(!_0x32b147['query'][_0xa9a8('0x3a')](_0xa9a8('0x3b'))){_0x3fdf02[_0xa9a8('0x20')]=qs['limit'](_0x32b147[_0xa9a8('0x36')][_0xa9a8('0x20')]);_0x3fdf02[_0xa9a8('0x1f')]=qs[_0xa9a8('0x1f')](_0x32b147[_0xa9a8('0x36')][_0xa9a8('0x1f')]);}return _0x458199[_0xa9a8('0x4e')](_0x3fdf02);}})[_0xa9a8('0x29')](function(_0x27af38){if(_0x27af38){return _0x27af38?{'count':_0x40becb,'rows':_0x27af38}:null;}})['then'](respondWithResult(_0x1e4d2e,null))[_0xa9a8('0x43')](handleError(_0x1e4d2e,null));};exports['addConfiguration']=function(_0x1b9e2f,_0xc3b9fb,_0x34d340){if(_0x1b9e2f[_0xa9a8('0x4d')]['id']){delete _0x1b9e2f[_0xa9a8('0x4d')]['id'];}return db[_0xa9a8('0x32')][_0xa9a8('0x51')]({'where':{'id':_0x1b9e2f['params']['id']}})[_0xa9a8('0x29')](handleEntityNotFound(_0xc3b9fb,null))['then'](function(_0x47de03){if(_0x47de03){_0x1b9e2f[_0xa9a8('0x4d')]['AccountId']=_0x47de03['id'];_0x1b9e2f[_0xa9a8('0x4d')][_0xa9a8('0x52')]=integrations['getSubjects'](_0x1b9e2f[_0xa9a8('0x4d')][_0xa9a8('0x53')],_0x1b9e2f['body'][_0xa9a8('0x33')]);_0x1b9e2f['body'][_0xa9a8('0x54')]=integrations[_0xa9a8('0x55')](_0x1b9e2f[_0xa9a8('0x4d')]['channel'],_0x1b9e2f['body']['type']);return db['DeskConfiguration'][_0xa9a8('0x4c')](_0x1b9e2f['body'],{'include':[{'model':db['DeskField'],'as':_0xa9a8('0x52')},{'model':db[_0xa9a8('0x56')],'as':_0xa9a8('0x54')}]});}return null;})['then'](respondWithResult(_0xc3b9fb,null))['catch'](handleError(_0xc3b9fb,null));};exports['getFields']=function(_0x30dc23,_0x5f51ca,_0xc29ffb){var _0x344d62=[{'name':_0xa9a8('0x57'),'label':_0xa9a8('0x57'),'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 _0x2cbae5='';return db[_0xa9a8('0x32')][_0xa9a8('0x51')]({'where':{'id':_0x30dc23[_0xa9a8('0x45')]['id']},'attributes':['id',_0xa9a8('0x58'),_0xa9a8('0x59'),_0xa9a8('0x5a'),_0xa9a8('0x5b'),_0xa9a8('0x5c'),_0xa9a8('0x5d'),_0xa9a8('0x5e'),_0xa9a8('0x5f')]})[_0xa9a8('0x29')](handleEntityNotFound(_0x5f51ca,null))[_0xa9a8('0x29')](function(_0x301fc2){if(_0x301fc2){_0x2cbae5=_0x301fc2['remoteUri'];var _0x36d901=_0x2cbae5[_0xa9a8('0x60')](-0x1);if(_0x36d901==='/'){_0x2cbae5=_0x2cbae5[_0xa9a8('0x61')](0x0,_0x2cbae5[_0xa9a8('0x62')](_0x36d901));}var _0x27e282={'method':_0xa9a8('0x63'),'uri':util[_0xa9a8('0x64')](_0xa9a8('0x65'),_0x2cbae5),'headers':{'Content-Type':'application/json','Accept':_0xa9a8('0x66')},'json':!![]};if(_0x301fc2[_0xa9a8('0x59')]==='basic'){_0x27e282[_0xa9a8('0x67')][_0xa9a8('0x68')]=util['format'](_0xa9a8('0x69'),new Buffer(util[_0xa9a8('0x64')](_0xa9a8('0x6a'),_0x301fc2[_0xa9a8('0x5a')],_0x301fc2[_0xa9a8('0x5b')]))[_0xa9a8('0x6b')]('base64'));}return rp(_0x27e282)[_0xa9a8('0x29')](function(_0x3d9583){return _0x344d62[_0xa9a8('0x6c')](_[_0xa9a8('0x31')](_0x3d9583[_0xa9a8('0x6d')][_0xa9a8('0x6e')],function(_0x1b4c8c){return{'id':_0x1b4c8c['name'],'name':_0x1b4c8c[_0xa9a8('0x2e')],'type':_0x1b4c8c['type'],'active':_0x1b4c8c['active'],'label':_0x1b4c8c['label'],'custom':!![]};}));});}})[_0xa9a8('0x29')](function(_0x21db72){return{'count':_0x21db72[_0xa9a8('0x48')],'rows':_0x21db72};})['then'](respondWithResult(_0x5f51ca,null))['catch'](function(_0x448cfc){var _0x2378fe=_0x30dc23[_0xa9a8('0x36')][_0xa9a8('0x6f')]?0x1f4:_0x448cfc[_0xa9a8('0x70')]||0x1f4;logger[_0xa9a8('0x2c')](_0xa9a8('0x71'),_0xa9a8('0x72'),_0x2378fe,JSON[_0xa9a8('0x73')](_0x448cfc));delete _0x448cfc[_0xa9a8('0x2e')];if(_0x2378fe===0x191){_0x2378fe=0x190;}_0x5f51ca[_0xa9a8('0x1d')](_0x2378fe)['send'](_0x30dc23[_0xa9a8('0x36')][_0xa9a8('0x6f')]?{'message':_0xa9a8('0x74'),'statusCode':_0x448cfc['statusCode']}:_0x448cfc);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 59e45fe..306164b 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 _0x5117=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x203a8e,_0x33358b){var _0x5b08a5=function(_0x23d287){while(--_0x23d287){_0x203a8e['push'](_0x203a8e['shift']());}};_0x5b08a5(++_0x33358b);}(_0x5117,0xab));var _0x7511=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x5117[_0x532d78];return _0x5990c4;};'use strict';var _=require(_0x7511('0x0'));var util=require(_0x7511('0x1'));var logger=require(_0x7511('0x2'))(_0x7511('0x3'));var moment=require('moment');var BPromise=require(_0x7511('0x4'));var rp=require(_0x7511('0x5'));var fs=require('fs');var path=require(_0x7511('0x6'));var rimraf=require(_0x7511('0x7'));var config=require('../../config/environment');var attributes=require(_0x7511('0x8'));var integrations=require(_0x7511('0x9'));module['exports']=function(_0x1c0381,_0x21a634){return _0x1c0381[_0x7511('0xa')](_0x7511('0xb'),attributes,{'tableName':_0x7511('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab5f=['./intDeskAccount.attributes','define','DeskAccount','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xe9fca1,_0x5ba251){var _0x55ae32=function(_0x553090){while(--_0x553090){_0xe9fca1['push'](_0xe9fca1['shift']());}};_0x55ae32(++_0x5ba251);}(_0xab5f,0x1d1));var _0xfab5=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xab5f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xfab5('0x0'));var util=require(_0xfab5('0x1'));var logger=require('../../config/logger')(_0xfab5('0x2'));var moment=require(_0xfab5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfab5('0x4'));var fs=require('fs');var path=require(_0xfab5('0x5'));var rimraf=require(_0xfab5('0x6'));var config=require(_0xfab5('0x7'));var attributes=require(_0xfab5('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40b4c4,_0xe90b6){return _0x40b4c4[_0xfab5('0x9')](_0xfab5('0xa'),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 f529540..a433176 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 _0x5bff=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2381d1,_0x56f1a9){var _0x2827b6=function(_0x25f20a){while(--_0x25f20a){_0x2381d1['push'](_0x2381d1['shift']());}};_0x2827b6(++_0x56f1a9);}(_0x5bff,0xfa));var _0xf5bf=function(_0x3c4362,_0x292e8d){_0x3c4362=_0x3c4362-0x0;var _0x368439=_0x5bff[_0x3c4362];return _0x368439;};'use strict';var _=require(_0xf5bf('0x0'));var util=require(_0xf5bf('0x1'));var moment=require(_0xf5bf('0x2'));var BPromise=require(_0xf5bf('0x3'));var rs=require(_0xf5bf('0x4'));var fs=require('fs');var Redis=require(_0xf5bf('0x5'));var db=require(_0xf5bf('0x6'))['db'];var utils=require(_0xf5bf('0x7'));var logger=require(_0xf5bf('0x8'))(_0xf5bf('0x9'));var config=require(_0xf5bf('0xa'));var jayson=require(_0xf5bf('0xb'));var client=jayson[_0xf5bf('0xc')][_0xf5bf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f86a5,_0xc071dd,_0x41bb8c){return new BPromise(function(_0x2be9f1,_0x1f909d){return client[_0xf5bf('0xe')](_0x1f86a5,_0x41bb8c)[_0xf5bf('0xf')](function(_0xb11de4){logger[_0xf5bf('0x10')](_0xf5bf('0x11'),_0xc071dd,_0xf5bf('0x12'));logger[_0xf5bf('0x13')](_0xf5bf('0x14'),_0xc071dd,_0xf5bf('0x12'),JSON['stringify'](_0xb11de4));if(_0xb11de4['error']){if(_0xb11de4['error']['code']===0x1f4){logger[_0xf5bf('0x15')]('DeskAccount,\x20%s,\x20%s',_0xc071dd,_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);return _0x1f909d(_0xb11de4[_0xf5bf('0x15')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0xc071dd,_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);return _0x2be9f1(_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);}else{logger['info'](_0xf5bf('0x11'),_0xc071dd,_0xf5bf('0x12'));_0x2be9f1(_0xb11de4['result'][_0xf5bf('0x16')]);}})[_0xf5bf('0x17')](function(_0xc0fafa){logger[_0xf5bf('0x15')](_0xf5bf('0x11'),_0xc071dd,_0xc0fafa);_0x1f909d(_0xc0fafa);});});}exports[_0xf5bf('0x18')]=function(_0x1f9d53){var _0x3ad1a1=this;return new Promise(function(_0x1b23fb,_0x667800){return db[_0xf5bf('0x19')][_0xf5bf('0x1a')]({'raw':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')]['where']||null:null,'attributes':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x1d')]||null:null,'limit':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53['options'][_0xf5bf('0x1e')]||null:null,'include':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')]['include']?_[_0xf5bf('0x1f')](_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x20')],function(_0x258e57){return{'model':db[_0x258e57[_0xf5bf('0x21')]],'as':_0x258e57['as'],'attributes':_0x258e57['attributes'],'include':_0x258e57[_0xf5bf('0x20')]?_['map'](_0x258e57[_0xf5bf('0x20')],function(_0x271f47){return{'model':db[_0x271f47[_0xf5bf('0x21')]],'as':_0x271f47['as'],'attributes':_0x271f47['attributes'],'include':_0x271f47[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0x271f47[_0xf5bf('0x20')],function(_0x2fe782){return{'model':db[_0x2fe782['model']],'as':_0x2fe782['as'],'attributes':_0x2fe782[_0xf5bf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf5bf('0xf')](function(_0x176cc2){logger[_0xf5bf('0x10')](_0xf5bf('0x18'),_0x1f9d53);logger[_0xf5bf('0x13')](_0xf5bf('0x18'),_0x1f9d53,JSON[_0xf5bf('0x22')](_0x176cc2));_0x1b23fb(_0x176cc2);})[_0xf5bf('0x17')](function(_0x497dfc){logger[_0xf5bf('0x15')]('GetDeskAccount',_0x497dfc['message'],_0x1f9d53);_0x667800(_0x3ad1a1[_0xf5bf('0x15')](0x1f4,_0x497dfc[_0xf5bf('0x16')]));});});};exports[_0xf5bf('0x23')]=function(_0x4c2538){var _0x57a7fd=this;return new Promise(function(_0x5f15e6,_0x4994de){return db[_0xf5bf('0x19')][_0xf5bf('0x24')]({'raw':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538[_0xf5bf('0x1b')][_0xf5bf('0x25')]||null:null,'attributes':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options'][_0xf5bf('0x1d')]||null:null,'include':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options']['include']?_[_0xf5bf('0x1f')](_0x4c2538[_0xf5bf('0x1b')]['include'],function(_0x49c7d5){return{'model':db[_0x49c7d5[_0xf5bf('0x21')]],'as':_0x49c7d5['as'],'attributes':_0x49c7d5[_0xf5bf('0x1d')],'include':_0x49c7d5[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0x49c7d5[_0xf5bf('0x20')],function(_0xf48b93){return{'model':db[_0xf48b93['model']],'as':_0xf48b93['as'],'attributes':_0xf48b93['attributes'],'include':_0xf48b93[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0xf48b93['include'],function(_0x1f85d3){return{'model':db[_0x1f85d3[_0xf5bf('0x21')]],'as':_0x1f85d3['as'],'attributes':_0x1f85d3[_0xf5bf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16ddce){logger[_0xf5bf('0x10')](_0xf5bf('0x23'),_0x4c2538);logger['debug'](_0xf5bf('0x23'),_0x4c2538,JSON[_0xf5bf('0x22')](_0x16ddce));_0x5f15e6(_0x16ddce);})[_0xf5bf('0x17')](function(_0x309fcc){logger[_0xf5bf('0x15')](_0xf5bf('0x23'),_0x309fcc['message'],_0x4c2538);_0x4994de(_0x57a7fd[_0xf5bf('0x15')](0x1f4,_0x309fcc[_0xf5bf('0x16')]));});});}; \ No newline at end of file +var _0x24ab=['where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','attributes','limit','include','map','model','debug','ShowDeskAccount','find','raw'];(function(_0xf7c72a,_0x4bb071){var _0x483324=function(_0x36b75e){while(--_0x36b75e){_0xf7c72a['push'](_0xf7c72a['shift']());}};_0x483324(++_0x4bb071);}(_0x24ab,0x155));var _0xb24a=function(_0x32ed89,_0x11d953){_0x32ed89=_0x32ed89-0x0;var _0x262961=_0x24ab[_0x32ed89];return _0x262961;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var moment=require(_0xb24a('0x2'));var BPromise=require('bluebird');var rs=require(_0xb24a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb24a('0x4'))['db'];var utils=require(_0xb24a('0x5'));var logger=require(_0xb24a('0x6'))('rpc');var config=require(_0xb24a('0x7'));var jayson=require(_0xb24a('0x8'));var client=jayson[_0xb24a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e661e,_0x59c94c,_0x40f555){return new BPromise(function(_0x8877e8,_0x7f476b){return client['request'](_0x5e661e,_0x40f555)[_0xb24a('0xa')](function(_0x41e512){logger['info'](_0xb24a('0xb'),_0x59c94c,_0xb24a('0xc'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x59c94c,_0xb24a('0xc'),JSON[_0xb24a('0xd')](_0x41e512));if(_0x41e512[_0xb24a('0xe')]){if(_0x41e512[_0xb24a('0xe')][_0xb24a('0xf')]===0x1f4){logger[_0xb24a('0xe')]('DeskAccount,\x20%s,\x20%s',_0x59c94c,_0x41e512[_0xb24a('0xe')][_0xb24a('0x10')]);return _0x7f476b(_0x41e512['error']['message']);}logger['error'](_0xb24a('0xb'),_0x59c94c,_0x41e512[_0xb24a('0xe')]['message']);return _0x8877e8(_0x41e512['error'][_0xb24a('0x10')]);}else{logger[_0xb24a('0x11')](_0xb24a('0xb'),_0x59c94c,_0xb24a('0xc'));_0x8877e8(_0x41e512[_0xb24a('0x12')][_0xb24a('0x10')]);}})[_0xb24a('0x13')](function(_0x75d092){logger[_0xb24a('0xe')](_0xb24a('0xb'),_0x59c94c,_0x75d092);_0x7f476b(_0x75d092);});});}exports[_0xb24a('0x14')]=function(_0x2925f1){var _0x5ce514=this;return new Promise(function(_0x314139,_0x24071d){return db[_0xb24a('0x15')][_0xb24a('0x16')]({'raw':_0x2925f1[_0xb24a('0x17')]?_0x2925f1[_0xb24a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2925f1[_0xb24a('0x17')]?_0x2925f1['options']['where']||null:null,'attributes':_0x2925f1[_0xb24a('0x17')]?_0x2925f1[_0xb24a('0x17')][_0xb24a('0x18')]||null:null,'limit':_0x2925f1['options']?_0x2925f1[_0xb24a('0x17')][_0xb24a('0x19')]||null:null,'include':_0x2925f1[_0xb24a('0x17')]?_0x2925f1[_0xb24a('0x17')][_0xb24a('0x1a')]?_['map'](_0x2925f1[_0xb24a('0x17')][_0xb24a('0x1a')],function(_0xa7cdd3){return{'model':db[_0xa7cdd3['model']],'as':_0xa7cdd3['as'],'attributes':_0xa7cdd3[_0xb24a('0x18')],'include':_0xa7cdd3[_0xb24a('0x1a')]?_[_0xb24a('0x1b')](_0xa7cdd3['include'],function(_0xe4e5f3){return{'model':db[_0xe4e5f3['model']],'as':_0xe4e5f3['as'],'attributes':_0xe4e5f3[_0xb24a('0x18')],'include':_0xe4e5f3['include']?_[_0xb24a('0x1b')](_0xe4e5f3[_0xb24a('0x1a')],function(_0xad7224){return{'model':db[_0xad7224[_0xb24a('0x1c')]],'as':_0xad7224['as'],'attributes':_0xad7224[_0xb24a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb24a('0xa')](function(_0x1ffd77){logger[_0xb24a('0x11')](_0xb24a('0x14'),_0x2925f1);logger[_0xb24a('0x1d')]('GetDeskAccount',_0x2925f1,JSON[_0xb24a('0xd')](_0x1ffd77));_0x314139(_0x1ffd77);})[_0xb24a('0x13')](function(_0x3cf925){logger['error'](_0xb24a('0x14'),_0x3cf925['message'],_0x2925f1);_0x24071d(_0x5ce514[_0xb24a('0xe')](0x1f4,_0x3cf925[_0xb24a('0x10')]));});});};exports[_0xb24a('0x1e')]=function(_0x1c9448){var _0x53b19f=this;return new Promise(function(_0x1c35ba,_0x3fbe04){return db[_0xb24a('0x15')][_0xb24a('0x1f')]({'raw':_0x1c9448[_0xb24a('0x17')]?_0x1c9448[_0xb24a('0x17')][_0xb24a('0x20')]===undefined?!![]:![]:!![],'where':_0x1c9448[_0xb24a('0x17')]?_0x1c9448[_0xb24a('0x17')][_0xb24a('0x21')]||null:null,'attributes':_0x1c9448[_0xb24a('0x17')]?_0x1c9448[_0xb24a('0x17')][_0xb24a('0x18')]||null:null,'include':_0x1c9448[_0xb24a('0x17')]?_0x1c9448[_0xb24a('0x17')]['include']?_[_0xb24a('0x1b')](_0x1c9448['options'][_0xb24a('0x1a')],function(_0x103039){return{'model':db[_0x103039[_0xb24a('0x1c')]],'as':_0x103039['as'],'attributes':_0x103039[_0xb24a('0x18')],'include':_0x103039['include']?_['map'](_0x103039[_0xb24a('0x1a')],function(_0x2fb9b3){return{'model':db[_0x2fb9b3['model']],'as':_0x2fb9b3['as'],'attributes':_0x2fb9b3[_0xb24a('0x18')],'include':_0x2fb9b3[_0xb24a('0x1a')]?_[_0xb24a('0x1b')](_0x2fb9b3['include'],function(_0x47097d){return{'model':db[_0x47097d[_0xb24a('0x1c')]],'as':_0x47097d['as'],'attributes':_0x47097d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb24a('0xa')](function(_0x4f1854){logger['info'](_0xb24a('0x1e'),_0x1c9448);logger[_0xb24a('0x1d')](_0xb24a('0x1e'),_0x1c9448,JSON['stringify'](_0x4f1854));_0x1c35ba(_0x4f1854);})[_0xb24a('0x13')](function(_0xd7eba2){logger[_0xb24a('0xe')]('ShowDeskAccount',_0xd7eba2[_0xb24a('0x10')],_0x1c9448);_0x3fbe04(_0x53b19f[_0xb24a('0xe')](0x1f4,_0xd7eba2['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 2be9bda..1444722 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 _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x5214ec,_0x58864e){var _0x40cc3c=function(_0xefa8f7){while(--_0xefa8f7){_0x5214ec['push'](_0x5214ec['shift']());}};_0x40cc3c(++_0x58864e);}(_0x7217,0x19e));var _0x7721=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7217[_0x56482c];return _0x5aae7a;};'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['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x324c67,_0x55ad24){var _0x53a261=function(_0x1f3e3a){while(--_0x1f3e3a){_0x324c67['push'](_0x324c67['shift']());}};_0x53a261(++_0x55ad24);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'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['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 0b16176..0a4b74f 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 _0xc61e=['STRING'];(function(_0x1a7cf5,_0x24c34a){var _0x39ca1f=function(_0x5217e3){while(--_0x5217e3){_0x1a7cf5['push'](_0x1a7cf5['shift']());}};_0x39ca1f(++_0x24c34a);}(_0xc61e,0x84));var _0xec61=function(_0x9aafd9,_0xd6119f){_0x9aafd9=_0x9aafd9-0x0;var _0x407103=_0xc61e[_0x9aafd9];return _0x407103;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec61('0x0')]}}; \ No newline at end of file +var _0xd6e3=['exports','STRING','sequelize'];(function(_0x33113f,_0x54bcb0){var _0x323c90=function(_0x5a28e7){while(--_0x5a28e7){_0x33113f['push'](_0x33113f['shift']());}};_0x323c90(++_0x54bcb0);}(_0xd6e3,0x92));var _0x3d6e=function(_0x40d66a,_0x32110f){_0x40d66a=_0x40d66a-0x0;var _0x818344=_0xd6e3[_0x40d66a];return _0x818344;};'use strict';var Sequelize=require(_0x3d6e('0x0'));module[_0x3d6e('0x1')]={'name':{'type':Sequelize[_0x3d6e('0x2')]},'description':{'type':Sequelize[_0x3d6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 04fca76..4d94a92 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 _0xd8f4=['getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','DeskConfiguration','findAll','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','getSubjects'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0xd8f4,0xf7));var _0x4d8f=function(_0x106941,_0x4a1182){_0x106941=_0x106941-0x0;var _0x2a99d0=_0xd8f4[_0x106941];return _0x2a99d0;};'use strict';var emlformat=require(_0x4d8f('0x0'));var rimraf=require(_0x4d8f('0x1'));var zipdir=require(_0x4d8f('0x2'));var jsonpatch=require(_0x4d8f('0x3'));var rp=require(_0x4d8f('0x4'));var moment=require(_0x4d8f('0x5'));var BPromise=require(_0x4d8f('0x6'));var Mustache=require('mustache');var util=require(_0x4d8f('0x7'));var path=require(_0x4d8f('0x8'));var sox=require(_0x4d8f('0x9'));var csv=require(_0x4d8f('0xa'));var ejs=require(_0x4d8f('0xb'));var fs=require('fs');var fs_extra=require(_0x4d8f('0xc'));var _=require(_0x4d8f('0xd'));var squel=require(_0x4d8f('0xe'));var crypto=require(_0x4d8f('0xf'));var jsforce=require(_0x4d8f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4d8f('0xa'));var querystring=require(_0x4d8f('0x11'));var Papa=require(_0x4d8f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d8f('0x13'));var hardwareService=require(_0x4d8f('0x14'));var logger=require(_0x4d8f('0x15'))(_0x4d8f('0x16'));var utils=require(_0x4d8f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d8f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3691d2,_0x454fb4){_0x454fb4=_0x454fb4||0xcc;return function(_0x439995){if(_0x439995){return _0x3691d2['sendStatus'](_0x454fb4);}return _0x3691d2[_0x4d8f('0x19')](_0x454fb4)[_0x4d8f('0x1a')]();};}function respondWithResult(_0x300739,_0x482ba7){_0x482ba7=_0x482ba7||0xc8;return function(_0x1043bb){if(_0x1043bb){return _0x300739['status'](_0x482ba7)[_0x4d8f('0x1b')](_0x1043bb);}};}function respondWithFilteredResult(_0x28dd15,_0x2aaecf){return function(_0x2fb788){if(_0x2fb788){var _0x419468=typeof _0x2aaecf[_0x4d8f('0x1c')]===_0x4d8f('0x1d')&&typeof _0x2aaecf[_0x4d8f('0x1e')]===_0x4d8f('0x1d');var _0x339383=_0x2fb788[_0x4d8f('0x1f')];var _0x5d40c3=_0x419468?0x0:_0x2aaecf[_0x4d8f('0x1c')];var _0x45ddbd=_0x419468?_0x2fb788[_0x4d8f('0x1f')]:_0x2aaecf[_0x4d8f('0x1c')]+_0x2aaecf['limit'];var _0x514004;if(_0x45ddbd>=_0x339383){_0x45ddbd=_0x339383;_0x514004=0xc8;}else{_0x514004=0xce;}_0x28dd15['status'](_0x514004);return _0x28dd15[_0x4d8f('0x20')](_0x4d8f('0x21'),_0x5d40c3+'-'+_0x45ddbd+'/'+_0x339383)[_0x4d8f('0x1b')](_0x2fb788);}return null;};}function patchUpdates(_0x447ea1){return function(_0x4522cb){try{jsonpatch[_0x4d8f('0x22')](_0x4522cb,_0x447ea1,!![]);}catch(_0x56c17d){return BPromise[_0x4d8f('0x23')](_0x56c17d);}return _0x4522cb['save']();};}function saveUpdates(_0x4d3db0,_0x55a65b){return function(_0x3ae71e){if(_0x3ae71e){return _0x3ae71e[_0x4d8f('0x24')](_0x4d3db0)[_0x4d8f('0x25')](function(_0xdf1e0a){return _0xdf1e0a;});}return null;};}function removeEntity(_0x40dd71,_0x3c9556){return function(_0x331fda){if(_0x331fda){return _0x331fda[_0x4d8f('0x26')]()[_0x4d8f('0x25')](function(){_0x40dd71[_0x4d8f('0x19')](0xcc)[_0x4d8f('0x1a')]();});}};}function handleEntityNotFound(_0x390b40,_0x370f56){return function(_0x511648){if(!_0x511648){_0x390b40[_0x4d8f('0x27')](0x194);}return _0x511648;};}function handleError(_0x16f020,_0x3d32ac){_0x3d32ac=_0x3d32ac||0x1f4;return function(_0x5e795f){logger['error'](_0x5e795f[_0x4d8f('0x28')]);if(_0x5e795f[_0x4d8f('0x29')]){delete _0x5e795f[_0x4d8f('0x29')];}_0x16f020['status'](_0x3d32ac)['send'](_0x5e795f);};}exports[_0x4d8f('0x2a')]=function(_0x30d163,_0x1ba15b){var _0x2ebedc={},_0x44e8d1={},_0x5c622c={'count':0x0,'rows':[]};var _0x1c304b=_[_0x4d8f('0x2b')](db['DeskConfiguration']['rawAttributes'],function(_0x29efb8){return{'name':_0x29efb8['fieldName'],'type':_0x29efb8[_0x4d8f('0x2c')]['key']};});_0x44e8d1[_0x4d8f('0x2d')]=_[_0x4d8f('0x2b')](_0x1c304b,_0x4d8f('0x29'));_0x44e8d1[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x30d163['query']);_0x44e8d1[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x44e8d1[_0x4d8f('0x2d')],_0x44e8d1[_0x4d8f('0x2e')]);_0x2ebedc[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x44e8d1[_0x4d8f('0x2d')],qs['fields'](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x2ebedc['attributes']=_0x2ebedc[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x2ebedc['attributes']:_0x44e8d1[_0x4d8f('0x2d')];if(!_0x30d163['query'][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x2ebedc[_0x4d8f('0x1e')]=qs[_0x4d8f('0x1e')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x2ebedc[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x1c')]);}_0x2ebedc[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x2ebedc[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_[_0x4d8f('0x3a')](_0x30d163[_0x4d8f('0x2e')],_0x44e8d1['filters']),_0x1c304b);if(_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x2ebedc[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x2ebedc[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x1c304b,function(_0x11f6be){if(_0x11f6be[_0x4d8f('0x2c')]!==_0x4d8f('0x3d')){var _0x4f9353={};_0x4f9353[_0x11f6be[_0x4d8f('0x29')]]={'$like':'%'+_0x30d163[_0x4d8f('0x2e')]['filter']+'%'};return _0x4f9353;}})});}_0x2ebedc=_['merge']({},_0x2ebedc,_0x30d163[_0x4d8f('0x3e')]);var _0x198653={'where':_0x2ebedc['where']};return db['DeskConfiguration'][_0x4d8f('0x1f')](_0x198653)[_0x4d8f('0x25')](function(_0x14c138){_0x5c622c[_0x4d8f('0x1f')]=_0x14c138;if(_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x3f')]){_0x2ebedc['include']=[{'all':!![]}];}return db[_0x4d8f('0x40')][_0x4d8f('0x41')](_0x2ebedc);})[_0x4d8f('0x25')](function(_0x3db3f2){_0x5c622c['rows']=_0x3db3f2;return _0x5c622c;})['then'](respondWithFilteredResult(_0x1ba15b,_0x2ebedc))[_0x4d8f('0x42')](handleError(_0x1ba15b,null));};exports[_0x4d8f('0x43')]=function(_0x44660b,_0x4cf0aa){var _0x4bab6a={'raw':![],'where':{'id':_0x44660b[_0x4d8f('0x44')]['id']}},_0x171104={};_0x171104[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x40')][_0x4d8f('0x45')]);_0x171104[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x44660b[_0x4d8f('0x2e')]);_0x171104['filters']=_[_0x4d8f('0x31')](_0x171104[_0x4d8f('0x2d')],_0x171104['query']);_0x4bab6a['attributes']=_['intersection'](_0x171104[_0x4d8f('0x2d')],qs[_0x4d8f('0x33')](_0x44660b['query'][_0x4d8f('0x33')]));_0x4bab6a[_0x4d8f('0x32')]=_0x4bab6a[_0x4d8f('0x32')]['length']?_0x4bab6a[_0x4d8f('0x32')]:_0x171104[_0x4d8f('0x2d')];if(_0x44660b[_0x4d8f('0x2e')]['includeAll']){_0x4bab6a['include']=[{'all':!![]}];}_0x4bab6a=_['merge']({},_0x4bab6a,_0x44660b['options']);return db['DeskConfiguration'][_0x4d8f('0x46')](_0x4bab6a)['then'](handleEntityNotFound(_0x4cf0aa,null))[_0x4d8f('0x25')](respondWithResult(_0x4cf0aa,null))['catch'](handleError(_0x4cf0aa,null));};exports[_0x4d8f('0x47')]=function(_0x5dcc81,_0x3ccecc){return db['DeskConfiguration']['create'](_0x5dcc81['body'],{})[_0x4d8f('0x25')](respondWithResult(_0x3ccecc,0xc9))[_0x4d8f('0x42')](handleError(_0x3ccecc,null));};exports['update']=function(_0x49d45f,_0x2ca158){if(_0x49d45f[_0x4d8f('0x48')]['id']){delete _0x49d45f[_0x4d8f('0x48')]['id'];}return db['DeskConfiguration'][_0x4d8f('0x46')]({'where':{'id':_0x49d45f[_0x4d8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ca158,null))[_0x4d8f('0x25')](saveUpdates(_0x49d45f[_0x4d8f('0x48')],null))[_0x4d8f('0x25')](respondWithResult(_0x2ca158,null))['catch'](handleError(_0x2ca158,null));};exports[_0x4d8f('0x26')]=function(_0x1d009c,_0x361543){return db[_0x4d8f('0x40')][_0x4d8f('0x46')]({'where':{'id':_0x1d009c[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x361543,null))[_0x4d8f('0x25')](removeEntity(_0x361543,null))[_0x4d8f('0x42')](handleError(_0x361543,null));};exports[_0x4d8f('0x49')]=function(_0x3db453,_0x51ee5e,_0x39712c){var _0x4b8698={};var _0x528062={};var _0x25099f;var _0x24f1aa;return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x3db453['params']['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x51ee5e,null))[_0x4d8f('0x25')](function(_0xf5f9bf){if(_0xf5f9bf){_0x25099f=_0xf5f9bf;_0x528062[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x528062[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x3db453[_0x4d8f('0x2e')]);_0x528062[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x528062[_0x4d8f('0x2d')],_0x528062[_0x4d8f('0x2e')]);_0x4b8698[_0x4d8f('0x32')]=_['intersection'](_0x528062['model'],qs['fields'](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x4b8698[_0x4d8f('0x32')]=_0x4b8698[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x4b8698[_0x4d8f('0x32')]:_0x528062[_0x4d8f('0x2d')];_0x4b8698[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x3db453[_0x4d8f('0x2e')]['sort']);_0x4b8698[_0x4d8f('0x39')]=qs['filters'](_[_0x4d8f('0x3a')](_0x3db453[_0x4d8f('0x2e')],_0x528062[_0x4d8f('0x30')]));if(_0x3db453[_0x4d8f('0x2e')]['filter']){_0x4b8698[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x4b8698['where'],{'$or':_[_0x4d8f('0x2b')](_0x4b8698[_0x4d8f('0x32')],function(_0x109ffc){var _0x2b7c81={};_0x2b7c81[_0x109ffc]={'$like':'%'+_0x3db453[_0x4d8f('0x2e')]['filter']+'%'};return _0x2b7c81;})});}_0x4b8698=_[_0x4d8f('0x3c')]({},_0x4b8698,_0x3db453[_0x4d8f('0x3e')]);return _0x25099f['getFields'](_0x4b8698);}})[_0x4d8f('0x25')](function(_0x1b32e8){if(_0x1b32e8){_0x24f1aa=_0x1b32e8[_0x4d8f('0x34')];if(!_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x4b8698[_0x4d8f('0x1e')]=qs[_0x4d8f('0x1e')](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x4b8698['offset']=qs[_0x4d8f('0x1c')](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x1c')]);}return _0x25099f[_0x4d8f('0x49')](_0x4b8698);}})[_0x4d8f('0x25')](function(_0x17b36a){if(_0x17b36a){return _0x17b36a?{'count':_0x24f1aa,'rows':_0x17b36a}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x51ee5e,null))[_0x4d8f('0x42')](handleError(_0x51ee5e,null));};exports[_0x4d8f('0x4c')]=function(_0x1a9a5a,_0x54fd4a,_0x419f5b){var _0x587591={};var _0x4e97f3={};var _0x57f24d;var _0x351edb;return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x1a9a5a[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x54fd4a,null))[_0x4d8f('0x25')](function(_0x255441){if(_0x255441){_0x57f24d=_0x255441;_0x4e97f3[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x4e97f3[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x1a9a5a[_0x4d8f('0x2e')]);_0x4e97f3['filters']=_[_0x4d8f('0x31')](_0x4e97f3['model'],_0x4e97f3[_0x4d8f('0x2e')]);_0x587591[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x4e97f3[_0x4d8f('0x2d')],qs['fields'](_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x587591['attributes']=_0x587591[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x587591['attributes']:_0x4e97f3['model'];_0x587591[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x1a9a5a['query'][_0x4d8f('0x38')]);_0x587591[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_['pick'](_0x1a9a5a[_0x4d8f('0x2e')],_0x4e97f3[_0x4d8f('0x30')]));if(_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x587591[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x587591[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x587591[_0x4d8f('0x32')],function(_0x3bc42c){var _0x378b18={};_0x378b18[_0x3bc42c]={'$like':'%'+_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x378b18;})});}_0x587591=_[_0x4d8f('0x3c')]({},_0x587591,_0x1a9a5a['options']);return _0x57f24d[_0x4d8f('0x4c')](_0x587591);}})[_0x4d8f('0x25')](function(_0x291328){if(_0x291328){_0x351edb=_0x291328[_0x4d8f('0x34')];if(!_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x587591['limit']=qs[_0x4d8f('0x1e')](_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x587591[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x1a9a5a[_0x4d8f('0x2e')]['offset']);}return _0x57f24d['getSubjects'](_0x587591);}})[_0x4d8f('0x25')](function(_0x4167bc){if(_0x4167bc){return _0x4167bc?{'count':_0x351edb,'rows':_0x4167bc}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x54fd4a,null))[_0x4d8f('0x42')](handleError(_0x54fd4a,null));};exports['getDescriptions']=function(_0x407824,_0x3c1ae3,_0x1aceee){var _0x260d9f={};var _0x5df431={};var _0x509a31;var _0x4cedce;return db[_0x4d8f('0x40')][_0x4d8f('0x4a')]({'where':{'id':_0x407824[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x3c1ae3,null))[_0x4d8f('0x25')](function(_0x8d159a){if(_0x8d159a){_0x509a31=_0x8d159a;_0x5df431[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x5df431[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x407824['query']);_0x5df431['filters']=_[_0x4d8f('0x31')](_0x5df431[_0x4d8f('0x2d')],_0x5df431[_0x4d8f('0x2e')]);_0x260d9f[_0x4d8f('0x32')]=_['intersection'](_0x5df431[_0x4d8f('0x2d')],qs['fields'](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x260d9f[_0x4d8f('0x32')]=_0x260d9f[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x260d9f['attributes']:_0x5df431[_0x4d8f('0x2d')];_0x260d9f['order']=qs[_0x4d8f('0x38')](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x260d9f[_0x4d8f('0x39')]=qs['filters'](_[_0x4d8f('0x3a')](_0x407824['query'],_0x5df431[_0x4d8f('0x30')]));if(_0x407824['query'][_0x4d8f('0x3b')]){_0x260d9f['where']=_['merge'](_0x260d9f[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x260d9f[_0x4d8f('0x32')],function(_0x5ef66a){var _0x142c08={};_0x142c08[_0x5ef66a]={'$like':'%'+_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x142c08;})});}_0x260d9f=_[_0x4d8f('0x3c')]({},_0x260d9f,_0x407824[_0x4d8f('0x3e')]);return _0x509a31[_0x4d8f('0x4d')](_0x260d9f);}})[_0x4d8f('0x25')](function(_0x535eb9){if(_0x535eb9){_0x4cedce=_0x535eb9[_0x4d8f('0x34')];if(!_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x260d9f['limit']=qs[_0x4d8f('0x1e')](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x260d9f[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x407824['query'][_0x4d8f('0x1c')]);}return _0x509a31[_0x4d8f('0x4d')](_0x260d9f);}})['then'](function(_0x4c7d7a){if(_0x4c7d7a){return _0x4c7d7a?{'count':_0x4cedce,'rows':_0x4c7d7a}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x3c1ae3,null))[_0x4d8f('0x42')](handleError(_0x3c1ae3,null));};exports[_0x4d8f('0x4e')]=function(_0x4683cd,_0x28c1c2,_0x5e226c){var _0x3d8285={};var _0x42ad4d={};var _0x294a49;var _0x495a7f;return db[_0x4d8f('0x40')][_0x4d8f('0x4a')]({'where':{'id':_0x4683cd[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x28c1c2,null))[_0x4d8f('0x25')](function(_0x89aaea){if(_0x89aaea){_0x294a49=_0x89aaea;_0x42ad4d[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4f')][_0x4d8f('0x45')]);_0x42ad4d[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x4683cd['query']);_0x42ad4d[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x42ad4d['model'],_0x42ad4d['query']);_0x3d8285[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x42ad4d[_0x4d8f('0x2d')],qs['fields'](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x3d8285[_0x4d8f('0x32')]=_0x3d8285[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x3d8285['attributes']:_0x42ad4d['model'];_0x3d8285['order']=qs['sort'](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x3d8285[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_[_0x4d8f('0x3a')](_0x4683cd[_0x4d8f('0x2e')],_0x42ad4d[_0x4d8f('0x30')]));if(_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x3d8285[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x3d8285[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x3d8285[_0x4d8f('0x32')],function(_0x1aa687){var _0x322a84={};_0x322a84[_0x1aa687]={'$like':'%'+_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x322a84;})});}_0x3d8285=_[_0x4d8f('0x3c')]({},_0x3d8285,_0x4683cd['options']);return _0x294a49[_0x4d8f('0x4e')](_0x3d8285);}})['then'](function(_0x444748){if(_0x444748){_0x495a7f=_0x444748[_0x4d8f('0x34')];if(!_0x4683cd[_0x4d8f('0x2e')]['hasOwnProperty'](_0x4d8f('0x36'))){_0x3d8285['limit']=qs[_0x4d8f('0x1e')](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x3d8285[_0x4d8f('0x1c')]=qs['offset'](_0x4683cd['query'][_0x4d8f('0x1c')]);}return _0x294a49['getTags'](_0x3d8285);}})[_0x4d8f('0x25')](function(_0x44ed84){if(_0x44ed84){return _0x44ed84?{'count':_0x495a7f,'rows':_0x44ed84}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x28c1c2,null))['catch'](handleError(_0x28c1c2,null));};exports['setTags']=function(_0x432a54,_0x3d0bc6,_0x334d7a){if(_0x432a54[_0x4d8f('0x48')]['id']){delete _0x432a54[_0x4d8f('0x48')]['id'];}return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x432a54[_0x4d8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d0bc6,null))[_0x4d8f('0x25')](function(_0x2120ab){if(_0x2120ab){return _0x2120ab['setTags'](_0x432a54[_0x4d8f('0x48')][_0x4d8f('0x50')]||[]);}return null;})[_0x4d8f('0x25')](respondWithResult(_0x3d0bc6,null))[_0x4d8f('0x42')](handleError(_0x3d0bc6,null));}; \ No newline at end of file +var _0xcc86=['moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','update','end','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','params','create','body','find','destroy','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','request-promise'];(function(_0x46c1d5,_0x5ca335){var _0x40fe7b=function(_0x34cb99){while(--_0x34cb99){_0x46c1d5['push'](_0x46c1d5['shift']());}};_0x40fe7b(++_0x5ca335);}(_0xcc86,0x1e9));var _0x6cc8=function(_0x79d123,_0x134a34){_0x79d123=_0x79d123-0x0;var _0x12be25=_0xcc86[_0x79d123];return _0x12be25;};'use strict';var emlformat=require(_0x6cc8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cc8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cc8('0x2'));var moment=require(_0x6cc8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6cc8('0x4'));var util=require(_0x6cc8('0x5'));var path=require('path');var sox=require(_0x6cc8('0x6'));var csv=require(_0x6cc8('0x7'));var ejs=require(_0x6cc8('0x8'));var fs=require('fs');var fs_extra=require(_0x6cc8('0x9'));var _=require(_0x6cc8('0xa'));var squel=require(_0x6cc8('0xb'));var crypto=require(_0x6cc8('0xc'));var jsforce=require(_0x6cc8('0xd'));var deskjs=require(_0x6cc8('0xe'));var toCsv=require(_0x6cc8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6cc8('0xf'));var authService=require(_0x6cc8('0x10'));var qs=require(_0x6cc8('0x11'));var as=require(_0x6cc8('0x12'));var hardwareService=require(_0x6cc8('0x13'));var logger=require(_0x6cc8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6cc8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cc8('0x16'))['db'];function respondWithStatusCode(_0x1b4d08,_0x3c3331){_0x3c3331=_0x3c3331||0xcc;return function(_0x12a5b9){if(_0x12a5b9){return _0x1b4d08[_0x6cc8('0x17')](_0x3c3331);}return _0x1b4d08[_0x6cc8('0x18')](_0x3c3331)['end']();};}function respondWithResult(_0x13abc5,_0x3f56f2){_0x3f56f2=_0x3f56f2||0xc8;return function(_0x26f6e6){if(_0x26f6e6){return _0x13abc5[_0x6cc8('0x18')](_0x3f56f2)[_0x6cc8('0x19')](_0x26f6e6);}};}function respondWithFilteredResult(_0xe1133d,_0x2c09a2){return function(_0x41181a){if(_0x41181a){var _0x254358=typeof _0x2c09a2[_0x6cc8('0x1a')]==='undefined'&&typeof _0x2c09a2['limit']==='undefined';var _0x409abb=_0x41181a[_0x6cc8('0x1b')];var _0x2f30fb=_0x254358?0x0:_0x2c09a2[_0x6cc8('0x1a')];var _0x4d91c7=_0x254358?_0x41181a[_0x6cc8('0x1b')]:_0x2c09a2['offset']+_0x2c09a2[_0x6cc8('0x1c')];var _0x3407ba;if(_0x4d91c7>=_0x409abb){_0x4d91c7=_0x409abb;_0x3407ba=0xc8;}else{_0x3407ba=0xce;}_0xe1133d['status'](_0x3407ba);return _0xe1133d[_0x6cc8('0x1d')](_0x6cc8('0x1e'),_0x2f30fb+'-'+_0x4d91c7+'/'+_0x409abb)[_0x6cc8('0x19')](_0x41181a);}return null;};}function patchUpdates(_0x2a1295){return function(_0xd6683){try{jsonpatch[_0x6cc8('0x1f')](_0xd6683,_0x2a1295,!![]);}catch(_0x188da0){return BPromise[_0x6cc8('0x20')](_0x188da0);}return _0xd6683['save']();};}function saveUpdates(_0x4c4ac8,_0x316666){return function(_0x40042c){if(_0x40042c){return _0x40042c[_0x6cc8('0x21')](_0x4c4ac8)['then'](function(_0x8667bc){return _0x8667bc;});}return null;};}function removeEntity(_0x4500bc,_0x3627c0){return function(_0x1f2f4e){if(_0x1f2f4e){return _0x1f2f4e['destroy']()['then'](function(){_0x4500bc[_0x6cc8('0x18')](0xcc)[_0x6cc8('0x22')]();});}};}function handleEntityNotFound(_0x60c149,_0x4ee319){return function(_0x4c0a2e){if(!_0x4c0a2e){_0x60c149[_0x6cc8('0x17')](0x194);}return _0x4c0a2e;};}function handleError(_0x2ce829,_0x465e4b){_0x465e4b=_0x465e4b||0x1f4;return function(_0xcab10c){logger[_0x6cc8('0x23')](_0xcab10c[_0x6cc8('0x24')]);if(_0xcab10c[_0x6cc8('0x25')]){delete _0xcab10c['name'];}_0x2ce829[_0x6cc8('0x18')](_0x465e4b)[_0x6cc8('0x26')](_0xcab10c);};}exports[_0x6cc8('0x27')]=function(_0x544c1f,_0x3e341e){var _0x3ab45a={},_0x3d6cae={},_0x39f581={'count':0x0,'rows':[]};var _0x51cb15=_[_0x6cc8('0x28')](db[_0x6cc8('0x29')][_0x6cc8('0x2a')],function(_0x321894){return{'name':_0x321894['fieldName'],'type':_0x321894['type'][_0x6cc8('0x2b')]};});_0x3d6cae[_0x6cc8('0x2c')]=_[_0x6cc8('0x28')](_0x51cb15,'name');_0x3d6cae[_0x6cc8('0x2d')]=_[_0x6cc8('0x2e')](_0x544c1f[_0x6cc8('0x2d')]);_0x3d6cae[_0x6cc8('0x2f')]=_[_0x6cc8('0x30')](_0x3d6cae[_0x6cc8('0x2c')],_0x3d6cae[_0x6cc8('0x2d')]);_0x3ab45a['attributes']=_[_0x6cc8('0x30')](_0x3d6cae[_0x6cc8('0x2c')],qs[_0x6cc8('0x31')](_0x544c1f[_0x6cc8('0x2d')][_0x6cc8('0x31')]));_0x3ab45a['attributes']=_0x3ab45a[_0x6cc8('0x32')][_0x6cc8('0x33')]?_0x3ab45a[_0x6cc8('0x32')]:_0x3d6cae[_0x6cc8('0x2c')];if(!_0x544c1f[_0x6cc8('0x2d')][_0x6cc8('0x34')](_0x6cc8('0x35'))){_0x3ab45a[_0x6cc8('0x1c')]=qs[_0x6cc8('0x1c')](_0x544c1f[_0x6cc8('0x2d')]['limit']);_0x3ab45a[_0x6cc8('0x1a')]=qs['offset'](_0x544c1f['query']['offset']);}_0x3ab45a[_0x6cc8('0x36')]=qs['sort'](_0x544c1f[_0x6cc8('0x2d')][_0x6cc8('0x37')]);_0x3ab45a[_0x6cc8('0x38')]=qs['filters'](_[_0x6cc8('0x39')](_0x544c1f[_0x6cc8('0x2d')],_0x3d6cae[_0x6cc8('0x2f')]),_0x51cb15);if(_0x544c1f[_0x6cc8('0x2d')]['filter']){_0x3ab45a[_0x6cc8('0x38')]=_['merge'](_0x3ab45a['where'],{'$or':_[_0x6cc8('0x28')](_0x51cb15,function(_0x35216f){if(_0x35216f[_0x6cc8('0x3a')]!=='VIRTUAL'){var _0x1fb113={};_0x1fb113[_0x35216f[_0x6cc8('0x25')]]={'$like':'%'+_0x544c1f[_0x6cc8('0x2d')][_0x6cc8('0x3b')]+'%'};return _0x1fb113;}})});}_0x3ab45a=_[_0x6cc8('0x3c')]({},_0x3ab45a,_0x544c1f[_0x6cc8('0x3d')]);var _0x54085a={'where':_0x3ab45a[_0x6cc8('0x38')]};return db['DeskConfiguration'][_0x6cc8('0x1b')](_0x54085a)['then'](function(_0x203043){_0x39f581[_0x6cc8('0x1b')]=_0x203043;if(_0x544c1f['query'][_0x6cc8('0x3e')]){_0x3ab45a[_0x6cc8('0x3f')]=[{'all':!![]}];}return db[_0x6cc8('0x29')][_0x6cc8('0x40')](_0x3ab45a);})[_0x6cc8('0x41')](function(_0x319c0e){_0x39f581[_0x6cc8('0x42')]=_0x319c0e;return _0x39f581;})[_0x6cc8('0x41')](respondWithFilteredResult(_0x3e341e,_0x3ab45a))[_0x6cc8('0x43')](handleError(_0x3e341e,null));};exports[_0x6cc8('0x44')]=function(_0x5ab545,_0x5b8082){var _0x121f9e={'raw':![],'where':{'id':_0x5ab545[_0x6cc8('0x45')]['id']}},_0x20c10c={};_0x20c10c[_0x6cc8('0x2c')]=_['keys'](db[_0x6cc8('0x29')][_0x6cc8('0x2a')]);_0x20c10c[_0x6cc8('0x2d')]=_[_0x6cc8('0x2e')](_0x5ab545[_0x6cc8('0x2d')]);_0x20c10c[_0x6cc8('0x2f')]=_['intersection'](_0x20c10c['model'],_0x20c10c[_0x6cc8('0x2d')]);_0x121f9e[_0x6cc8('0x32')]=_['intersection'](_0x20c10c['model'],qs['fields'](_0x5ab545['query'][_0x6cc8('0x31')]));_0x121f9e['attributes']=_0x121f9e[_0x6cc8('0x32')][_0x6cc8('0x33')]?_0x121f9e[_0x6cc8('0x32')]:_0x20c10c['model'];if(_0x5ab545['query'][_0x6cc8('0x3e')]){_0x121f9e['include']=[{'all':!![]}];}_0x121f9e=_[_0x6cc8('0x3c')]({},_0x121f9e,_0x5ab545[_0x6cc8('0x3d')]);return db['DeskConfiguration']['find'](_0x121f9e)[_0x6cc8('0x41')](handleEntityNotFound(_0x5b8082,null))['then'](respondWithResult(_0x5b8082,null))[_0x6cc8('0x43')](handleError(_0x5b8082,null));};exports[_0x6cc8('0x46')]=function(_0x5abbcc,_0xcebab){return db[_0x6cc8('0x29')][_0x6cc8('0x46')](_0x5abbcc[_0x6cc8('0x47')],{})[_0x6cc8('0x41')](respondWithResult(_0xcebab,0xc9))[_0x6cc8('0x43')](handleError(_0xcebab,null));};exports['update']=function(_0x455d06,_0x2c9e84){if(_0x455d06[_0x6cc8('0x47')]['id']){delete _0x455d06[_0x6cc8('0x47')]['id'];}return db[_0x6cc8('0x29')][_0x6cc8('0x48')]({'where':{'id':_0x455d06['params']['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x2c9e84,null))[_0x6cc8('0x41')](saveUpdates(_0x455d06[_0x6cc8('0x47')],null))['then'](respondWithResult(_0x2c9e84,null))[_0x6cc8('0x43')](handleError(_0x2c9e84,null));};exports[_0x6cc8('0x49')]=function(_0x3e2c25,_0x1896e3){return db[_0x6cc8('0x29')]['find']({'where':{'id':_0x3e2c25[_0x6cc8('0x45')]['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x1896e3,null))['then'](removeEntity(_0x1896e3,null))[_0x6cc8('0x43')](handleError(_0x1896e3,null));};exports[_0x6cc8('0x4a')]=function(_0x323cf3,_0x198109,_0x16e7b1){var _0xbd88c={};var _0x1191ad={};var _0x3f84ea;var _0x2adf21;return db[_0x6cc8('0x29')]['findOne']({'where':{'id':_0x323cf3[_0x6cc8('0x45')]['id']}})['then'](handleEntityNotFound(_0x198109,null))[_0x6cc8('0x41')](function(_0x21174d){if(_0x21174d){_0x3f84ea=_0x21174d;_0x1191ad[_0x6cc8('0x2c')]=_[_0x6cc8('0x2e')](db[_0x6cc8('0x4b')][_0x6cc8('0x2a')]);_0x1191ad[_0x6cc8('0x2d')]=_[_0x6cc8('0x2e')](_0x323cf3['query']);_0x1191ad[_0x6cc8('0x2f')]=_[_0x6cc8('0x30')](_0x1191ad[_0x6cc8('0x2c')],_0x1191ad['query']);_0xbd88c[_0x6cc8('0x32')]=_[_0x6cc8('0x30')](_0x1191ad[_0x6cc8('0x2c')],qs[_0x6cc8('0x31')](_0x323cf3['query'][_0x6cc8('0x31')]));_0xbd88c[_0x6cc8('0x32')]=_0xbd88c['attributes']['length']?_0xbd88c[_0x6cc8('0x32')]:_0x1191ad[_0x6cc8('0x2c')];_0xbd88c['order']=qs[_0x6cc8('0x37')](_0x323cf3[_0x6cc8('0x2d')][_0x6cc8('0x37')]);_0xbd88c[_0x6cc8('0x38')]=qs[_0x6cc8('0x2f')](_['pick'](_0x323cf3[_0x6cc8('0x2d')],_0x1191ad[_0x6cc8('0x2f')]));if(_0x323cf3[_0x6cc8('0x2d')]['filter']){_0xbd88c[_0x6cc8('0x38')]=_['merge'](_0xbd88c[_0x6cc8('0x38')],{'$or':_[_0x6cc8('0x28')](_0xbd88c['attributes'],function(_0x175cc6){var _0x4ee16a={};_0x4ee16a[_0x175cc6]={'$like':'%'+_0x323cf3['query'][_0x6cc8('0x3b')]+'%'};return _0x4ee16a;})});}_0xbd88c=_[_0x6cc8('0x3c')]({},_0xbd88c,_0x323cf3['options']);return _0x3f84ea['getFields'](_0xbd88c);}})['then'](function(_0x3a36af){if(_0x3a36af){_0x2adf21=_0x3a36af[_0x6cc8('0x33')];if(!_0x323cf3[_0x6cc8('0x2d')][_0x6cc8('0x34')](_0x6cc8('0x35'))){_0xbd88c['limit']=qs[_0x6cc8('0x1c')](_0x323cf3[_0x6cc8('0x2d')]['limit']);_0xbd88c[_0x6cc8('0x1a')]=qs[_0x6cc8('0x1a')](_0x323cf3['query'][_0x6cc8('0x1a')]);}return _0x3f84ea[_0x6cc8('0x4a')](_0xbd88c);}})['then'](function(_0x525e52){if(_0x525e52){return _0x525e52?{'count':_0x2adf21,'rows':_0x525e52}:null;}})['then'](respondWithResult(_0x198109,null))[_0x6cc8('0x43')](handleError(_0x198109,null));};exports[_0x6cc8('0x4c')]=function(_0x501a8a,_0x57a0be,_0x1ecf4b){var _0x308c06={};var _0x5871d9={};var _0x53d6d7;var _0x2a53e9;return db[_0x6cc8('0x29')][_0x6cc8('0x4d')]({'where':{'id':_0x501a8a[_0x6cc8('0x45')]['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x57a0be,null))[_0x6cc8('0x41')](function(_0x5ea121){if(_0x5ea121){_0x53d6d7=_0x5ea121;_0x5871d9[_0x6cc8('0x2c')]=_[_0x6cc8('0x2e')](db['DeskField'][_0x6cc8('0x2a')]);_0x5871d9[_0x6cc8('0x2d')]=_[_0x6cc8('0x2e')](_0x501a8a[_0x6cc8('0x2d')]);_0x5871d9[_0x6cc8('0x2f')]=_['intersection'](_0x5871d9['model'],_0x5871d9[_0x6cc8('0x2d')]);_0x308c06[_0x6cc8('0x32')]=_[_0x6cc8('0x30')](_0x5871d9['model'],qs[_0x6cc8('0x31')](_0x501a8a[_0x6cc8('0x2d')][_0x6cc8('0x31')]));_0x308c06[_0x6cc8('0x32')]=_0x308c06[_0x6cc8('0x32')][_0x6cc8('0x33')]?_0x308c06[_0x6cc8('0x32')]:_0x5871d9['model'];_0x308c06[_0x6cc8('0x36')]=qs[_0x6cc8('0x37')](_0x501a8a['query'][_0x6cc8('0x37')]);_0x308c06[_0x6cc8('0x38')]=qs['filters'](_[_0x6cc8('0x39')](_0x501a8a['query'],_0x5871d9[_0x6cc8('0x2f')]));if(_0x501a8a[_0x6cc8('0x2d')][_0x6cc8('0x3b')]){_0x308c06[_0x6cc8('0x38')]=_['merge'](_0x308c06['where'],{'$or':_['map'](_0x308c06[_0x6cc8('0x32')],function(_0x238581){var _0x34a6e3={};_0x34a6e3[_0x238581]={'$like':'%'+_0x501a8a[_0x6cc8('0x2d')][_0x6cc8('0x3b')]+'%'};return _0x34a6e3;})});}_0x308c06=_[_0x6cc8('0x3c')]({},_0x308c06,_0x501a8a['options']);return _0x53d6d7[_0x6cc8('0x4c')](_0x308c06);}})[_0x6cc8('0x41')](function(_0x242f79){if(_0x242f79){_0x2a53e9=_0x242f79[_0x6cc8('0x33')];if(!_0x501a8a['query'][_0x6cc8('0x34')]('nolimit')){_0x308c06['limit']=qs[_0x6cc8('0x1c')](_0x501a8a[_0x6cc8('0x2d')][_0x6cc8('0x1c')]);_0x308c06[_0x6cc8('0x1a')]=qs[_0x6cc8('0x1a')](_0x501a8a[_0x6cc8('0x2d')][_0x6cc8('0x1a')]);}return _0x53d6d7[_0x6cc8('0x4c')](_0x308c06);}})[_0x6cc8('0x41')](function(_0x3ca669){if(_0x3ca669){return _0x3ca669?{'count':_0x2a53e9,'rows':_0x3ca669}:null;}})[_0x6cc8('0x41')](respondWithResult(_0x57a0be,null))[_0x6cc8('0x43')](handleError(_0x57a0be,null));};exports[_0x6cc8('0x4e')]=function(_0x1bc979,_0x271651,_0x4b7bff){var _0x5e1d8a={};var _0x2d6acd={};var _0x3603cd;var _0x4b8204;return db[_0x6cc8('0x29')][_0x6cc8('0x4d')]({'where':{'id':_0x1bc979[_0x6cc8('0x45')]['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x271651,null))[_0x6cc8('0x41')](function(_0x2b28b5){if(_0x2b28b5){_0x3603cd=_0x2b28b5;_0x2d6acd[_0x6cc8('0x2c')]=_[_0x6cc8('0x2e')](db[_0x6cc8('0x4b')]['rawAttributes']);_0x2d6acd['query']=_[_0x6cc8('0x2e')](_0x1bc979[_0x6cc8('0x2d')]);_0x2d6acd[_0x6cc8('0x2f')]=_[_0x6cc8('0x30')](_0x2d6acd[_0x6cc8('0x2c')],_0x2d6acd[_0x6cc8('0x2d')]);_0x5e1d8a[_0x6cc8('0x32')]=_[_0x6cc8('0x30')](_0x2d6acd['model'],qs[_0x6cc8('0x31')](_0x1bc979['query'][_0x6cc8('0x31')]));_0x5e1d8a[_0x6cc8('0x32')]=_0x5e1d8a[_0x6cc8('0x32')][_0x6cc8('0x33')]?_0x5e1d8a[_0x6cc8('0x32')]:_0x2d6acd[_0x6cc8('0x2c')];_0x5e1d8a[_0x6cc8('0x36')]=qs['sort'](_0x1bc979['query']['sort']);_0x5e1d8a['where']=qs[_0x6cc8('0x2f')](_['pick'](_0x1bc979[_0x6cc8('0x2d')],_0x2d6acd[_0x6cc8('0x2f')]));if(_0x1bc979['query'][_0x6cc8('0x3b')]){_0x5e1d8a[_0x6cc8('0x38')]=_['merge'](_0x5e1d8a[_0x6cc8('0x38')],{'$or':_[_0x6cc8('0x28')](_0x5e1d8a[_0x6cc8('0x32')],function(_0xc959f9){var _0x471ec1={};_0x471ec1[_0xc959f9]={'$like':'%'+_0x1bc979[_0x6cc8('0x2d')]['filter']+'%'};return _0x471ec1;})});}_0x5e1d8a=_[_0x6cc8('0x3c')]({},_0x5e1d8a,_0x1bc979['options']);return _0x3603cd[_0x6cc8('0x4e')](_0x5e1d8a);}})['then'](function(_0x568bdb){if(_0x568bdb){_0x4b8204=_0x568bdb[_0x6cc8('0x33')];if(!_0x1bc979['query'][_0x6cc8('0x34')](_0x6cc8('0x35'))){_0x5e1d8a[_0x6cc8('0x1c')]=qs[_0x6cc8('0x1c')](_0x1bc979[_0x6cc8('0x2d')][_0x6cc8('0x1c')]);_0x5e1d8a['offset']=qs['offset'](_0x1bc979[_0x6cc8('0x2d')][_0x6cc8('0x1a')]);}return _0x3603cd[_0x6cc8('0x4e')](_0x5e1d8a);}})['then'](function(_0x426a6e){if(_0x426a6e){return _0x426a6e?{'count':_0x4b8204,'rows':_0x426a6e}:null;}})[_0x6cc8('0x41')](respondWithResult(_0x271651,null))[_0x6cc8('0x43')](handleError(_0x271651,null));};exports[_0x6cc8('0x4f')]=function(_0x3586c8,_0x518489,_0x3c0eee){var _0x4511d2={};var _0x28ccc3={};var _0x480a23;var _0x349e78;return db[_0x6cc8('0x29')][_0x6cc8('0x4d')]({'where':{'id':_0x3586c8[_0x6cc8('0x45')]['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x518489,null))[_0x6cc8('0x41')](function(_0x1fd826){if(_0x1fd826){_0x480a23=_0x1fd826;_0x28ccc3['model']=_[_0x6cc8('0x2e')](db['Tag'][_0x6cc8('0x2a')]);_0x28ccc3[_0x6cc8('0x2d')]=_['keys'](_0x3586c8['query']);_0x28ccc3[_0x6cc8('0x2f')]=_['intersection'](_0x28ccc3[_0x6cc8('0x2c')],_0x28ccc3['query']);_0x4511d2['attributes']=_[_0x6cc8('0x30')](_0x28ccc3[_0x6cc8('0x2c')],qs[_0x6cc8('0x31')](_0x3586c8[_0x6cc8('0x2d')][_0x6cc8('0x31')]));_0x4511d2[_0x6cc8('0x32')]=_0x4511d2['attributes'][_0x6cc8('0x33')]?_0x4511d2[_0x6cc8('0x32')]:_0x28ccc3[_0x6cc8('0x2c')];_0x4511d2[_0x6cc8('0x36')]=qs[_0x6cc8('0x37')](_0x3586c8[_0x6cc8('0x2d')][_0x6cc8('0x37')]);_0x4511d2['where']=qs[_0x6cc8('0x2f')](_[_0x6cc8('0x39')](_0x3586c8[_0x6cc8('0x2d')],_0x28ccc3[_0x6cc8('0x2f')]));if(_0x3586c8['query']['filter']){_0x4511d2[_0x6cc8('0x38')]=_[_0x6cc8('0x3c')](_0x4511d2['where'],{'$or':_[_0x6cc8('0x28')](_0x4511d2[_0x6cc8('0x32')],function(_0x1d134a){var _0x32f4d7={};_0x32f4d7[_0x1d134a]={'$like':'%'+_0x3586c8[_0x6cc8('0x2d')]['filter']+'%'};return _0x32f4d7;})});}_0x4511d2=_[_0x6cc8('0x3c')]({},_0x4511d2,_0x3586c8[_0x6cc8('0x3d')]);return _0x480a23[_0x6cc8('0x4f')](_0x4511d2);}})[_0x6cc8('0x41')](function(_0x2b5988){if(_0x2b5988){_0x349e78=_0x2b5988['length'];if(!_0x3586c8[_0x6cc8('0x2d')][_0x6cc8('0x34')](_0x6cc8('0x35'))){_0x4511d2[_0x6cc8('0x1c')]=qs['limit'](_0x3586c8['query']['limit']);_0x4511d2[_0x6cc8('0x1a')]=qs['offset'](_0x3586c8['query']['offset']);}return _0x480a23['getTags'](_0x4511d2);}})[_0x6cc8('0x41')](function(_0x3e540a){if(_0x3e540a){return _0x3e540a?{'count':_0x349e78,'rows':_0x3e540a}:null;}})[_0x6cc8('0x41')](respondWithResult(_0x518489,null))[_0x6cc8('0x43')](handleError(_0x518489,null));};exports[_0x6cc8('0x50')]=function(_0x505083,_0x306061,_0x33c15b){if(_0x505083[_0x6cc8('0x47')]['id']){delete _0x505083[_0x6cc8('0x47')]['id'];}return db['DeskConfiguration'][_0x6cc8('0x4d')]({'where':{'id':_0x505083[_0x6cc8('0x45')]['id']}})[_0x6cc8('0x41')](handleEntityNotFound(_0x306061,null))[_0x6cc8('0x41')](function(_0x15659c){if(_0x15659c){return _0x15659c[_0x6cc8('0x50')](_0x505083[_0x6cc8('0x47')][_0x6cc8('0x51')]||[]);}return null;})['then'](respondWithResult(_0x306061,null))[_0x6cc8('0x43')](handleError(_0x306061,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b7a7f31..18e4b1c 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 _0xa6e6=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','../../config/logger','bluebird'];(function(_0x216edc,_0x57df05){var _0x745d3e=function(_0x2b1bf8){while(--_0x2b1bf8){_0x216edc['push'](_0x216edc['shift']());}};_0x745d3e(++_0x57df05);}(_0xa6e6,0x183));var _0x6a6e=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xa6e6[_0x576170];return _0x397c70;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var logger=require(_0x6a6e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6a6e('0x2'));var rp=require(_0x6a6e('0x3'));var fs=require('fs');var path=require(_0x6a6e('0x4'));var rimraf=require(_0x6a6e('0x5'));var config=require(_0x6a6e('0x6'));var attributes=require(_0x6a6e('0x7'));module['exports']=function(_0xfc4153,_0x86f68c){return _0xfc4153[_0x6a6e('0x8')]('DeskConfiguration',attributes,{'tableName':_0x6a6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08e0=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes'];(function(_0x4869e0,_0x1ea74d){var _0x528be3=function(_0x4ee4c6){while(--_0x4ee4c6){_0x4869e0['push'](_0x4869e0['shift']());}};_0x528be3(++_0x1ea74d);}(_0x08e0,0x16a));var _0x008e=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x08e0[_0x2a0738];return _0x159679;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var logger=require(_0x008e('0x2'))(_0x008e('0x3'));var moment=require(_0x008e('0x4'));var BPromise=require(_0x008e('0x5'));var rp=require(_0x008e('0x6'));var fs=require('fs');var path=require(_0x008e('0x7'));var rimraf=require(_0x008e('0x8'));var config=require('../../config/environment');var attributes=require(_0x008e('0x9'));module['exports']=function(_0x38e6c6,_0x3e6de6){return _0x38e6c6['define'](_0x008e('0xa'),attributes,{'tableName':_0x008e('0xb'),'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 b458af6..364ef18 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 _0xb01c=['stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x371ffa,_0x2b8650){var _0x515a92=function(_0x26a714){while(--_0x26a714){_0x371ffa['push'](_0x371ffa['shift']());}};_0x515a92(++_0x2b8650);}(_0xb01c,0xbe));var _0xcb01=function(_0x395587,_0xf0b3b6){_0x395587=_0x395587-0x0;var _0x21b425=_0xb01c[_0x395587];return _0x21b425;};'use strict';var _=require(_0xcb01('0x0'));var util=require('util');var moment=require(_0xcb01('0x1'));var BPromise=require(_0xcb01('0x2'));var rs=require(_0xcb01('0x3'));var fs=require('fs');var Redis=require(_0xcb01('0x4'));var db=require(_0xcb01('0x5'))['db'];var utils=require(_0xcb01('0x6'));var logger=require(_0xcb01('0x7'))('rpc');var config=require(_0xcb01('0x8'));var jayson=require(_0xcb01('0x9'));var client=jayson[_0xcb01('0xa')][_0xcb01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357bf9,_0xc52f89,_0x370bf7){return new BPromise(function(_0x57f028,_0x3d0571){return client[_0xcb01('0xc')](_0x357bf9,_0x370bf7)[_0xcb01('0xd')](function(_0xdc4c5d){logger['info'](_0xcb01('0xe'),_0xc52f89,_0xcb01('0xf'));logger[_0xcb01('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xc52f89,_0xcb01('0xf'),JSON[_0xcb01('0x11')](_0xdc4c5d));if(_0xdc4c5d[_0xcb01('0x12')]){if(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x13')]===0x1f4){logger['error'](_0xcb01('0xe'),_0xc52f89,_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);return _0x3d0571(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);}logger[_0xcb01('0x12')](_0xcb01('0xe'),_0xc52f89,_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);return _0x57f028(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);}else{logger[_0xcb01('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0xc52f89,'request\x20sent');_0x57f028(_0xdc4c5d['result'][_0xcb01('0x14')]);}})[_0xcb01('0x16')](function(_0x50aef4){logger['error'](_0xcb01('0xe'),_0xc52f89,_0x50aef4);_0x3d0571(_0x50aef4);});});} \ No newline at end of file +var _0x8d62=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x5b2000,_0x226add){var _0x3b5a28=function(_0x4b12cb){while(--_0x4b12cb){_0x5b2000['push'](_0x5b2000['shift']());}};_0x3b5a28(++_0x226add);}(_0x8d62,0xf8));var _0x28d6=function(_0x6f1258,_0x2e311a){_0x6f1258=_0x6f1258-0x0;var _0x40020d=_0x8d62[_0x6f1258];return _0x40020d;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var moment=require(_0x28d6('0x1'));var BPromise=require(_0x28d6('0x2'));var rs=require(_0x28d6('0x3'));var fs=require('fs');var Redis=require(_0x28d6('0x4'));var db=require(_0x28d6('0x5'))['db'];var utils=require(_0x28d6('0x6'));var logger=require(_0x28d6('0x7'))(_0x28d6('0x8'));var config=require(_0x28d6('0x9'));var jayson=require(_0x28d6('0xa'));var client=jayson[_0x28d6('0xb')][_0x28d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe8aa7b,_0x5c8a27,_0x1d5399){return new BPromise(function(_0xb9dccb,_0x3f3235){return client['request'](_0xe8aa7b,_0x1d5399)[_0x28d6('0xd')](function(_0x4b564f){logger[_0x28d6('0xe')](_0x28d6('0xf'),_0x5c8a27,_0x28d6('0x10'));logger[_0x28d6('0x11')](_0x28d6('0x12'),_0x5c8a27,'request\x20sent',JSON[_0x28d6('0x13')](_0x4b564f));if(_0x4b564f[_0x28d6('0x14')]){if(_0x4b564f[_0x28d6('0x14')][_0x28d6('0x15')]===0x1f4){logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f[_0x28d6('0x14')][_0x28d6('0x16')]);return _0x3f3235(_0x4b564f['error'][_0x28d6('0x16')]);}logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f['error'][_0x28d6('0x16')]);return _0xb9dccb(_0x4b564f['error'][_0x28d6('0x16')]);}else{logger[_0x28d6('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x5c8a27,_0x28d6('0x10'));_0xb9dccb(_0x4b564f[_0x28d6('0x17')][_0x28d6('0x16')]);}})[_0x28d6('0x18')](function(_0x154c4d){logger['error'](_0x28d6('0xf'),_0x5c8a27,_0x154c4d);_0x3f3235(_0x154c4d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2035b72..3fff79e 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 _0xc033=['/:id','show','post','create','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get'];(function(_0x364db3,_0x24a4b8){var _0x65d39a=function(_0x18443a){while(--_0x18443a){_0x364db3['push'](_0x364db3['shift']());}};_0x65d39a(++_0x24a4b8);}(_0xc033,0xd3));var _0x3c03=function(_0x40a0ca,_0x1193ed){_0x40a0ca=_0x40a0ca-0x0;var _0x59da70=_0xc033[_0x40a0ca];return _0x59da70;};'use strict';var multer=require(_0x3c03('0x0'));var util=require(_0x3c03('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c03('0x2'));var router=express['Router']();var fs_extra=require(_0x3c03('0x3'));var auth=require(_0x3c03('0x4'));var interaction=require(_0x3c03('0x5'));var config=require(_0x3c03('0x6'));var controller=require(_0x3c03('0x7'));router['get']('/',auth[_0x3c03('0x8')](),controller['index']);router[_0x3c03('0x9')](_0x3c03('0xa'),auth['isAuthenticated'](),controller[_0x3c03('0xb')]);router[_0x3c03('0xc')]('/',auth[_0x3c03('0x8')](),controller[_0x3c03('0xd')]);router['put']('/:id',auth[_0x3c03('0x8')](),controller[_0x3c03('0xe')]);router['delete'](_0x3c03('0xa'),auth[_0x3c03('0x8')](),controller[_0x3c03('0xf')]);module[_0x3c03('0x10')]=router; \ No newline at end of file +var _0x640e=['util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x1d1276,_0x4b2aad){var _0x504510=function(_0x222282){while(--_0x222282){_0x1d1276['push'](_0x1d1276['shift']());}};_0x504510(++_0x4b2aad);}(_0x640e,0x65));var _0xe640=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x640e[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var path=require('path');var timeout=require(_0xe640('0x2'));var express=require(_0xe640('0x3'));var router=express[_0xe640('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe640('0x5'));var controller=require('./intDeskField.controller');router[_0xe640('0x6')]('/',auth[_0xe640('0x7')](),controller[_0xe640('0x8')]);router[_0xe640('0x6')](_0xe640('0x9'),auth[_0xe640('0x7')](),controller[_0xe640('0xa')]);router[_0xe640('0xb')]('/',auth[_0xe640('0x7')](),controller['create']);router[_0xe640('0xc')](_0xe640('0x9'),auth[_0xe640('0x7')](),controller[_0xe640('0xd')]);router[_0xe640('0xe')](_0xe640('0x9'),auth['isAuthenticated'](),controller[_0xe640('0xf')]);module[_0xe640('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 17a0631..2e32a04 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 _0x4920=['customVariable','picklist','STRING','ENUM','BOOLEAN','exports','string','variable'];(function(_0x3ba36a,_0xe50f9d){var _0x42ee88=function(_0x11da0a){while(--_0x11da0a){_0x3ba36a['push'](_0x3ba36a['shift']());}};_0x42ee88(++_0xe50f9d);}(_0x4920,0x1ed));var _0x0492=function(_0x517c9e,_0x1944b4){_0x517c9e=_0x517c9e-0x0;var _0x173257=_0x4920[_0x517c9e];return _0x173257;};'use strict';var Sequelize=require('sequelize');module[_0x0492('0x0')]={'type':{'type':Sequelize['ENUM'](_0x0492('0x1'),_0x0492('0x2'),_0x0492('0x3'),'keyValue',_0x0492('0x4')),'defaultValue':_0x0492('0x1')},'content':{'type':Sequelize[_0x0492('0x5')]},'key':{'type':Sequelize[_0x0492('0x5')]},'keyType':{'type':Sequelize[_0x0492('0x6')]('string',_0x0492('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0492('0x5')]},'idField':{'type':Sequelize[_0x0492('0x5')]},'nameField':{'type':Sequelize[_0x0492('0x5')]},'customField':{'type':Sequelize[_0x0492('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0492('0x5')]}}; \ No newline at end of file +var _0x6834=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5c3997,_0x58cba5){var _0x285f55=function(_0x39a327){while(--_0x39a327){_0x5c3997['push'](_0x5c3997['shift']());}};_0x285f55(++_0x58cba5);}(_0x6834,0x197));var _0x4683=function(_0x598bf9,_0x105c1f){_0x598bf9=_0x598bf9-0x0;var _0x44fb05=_0x6834[_0x598bf9];return _0x44fb05;};'use strict';var Sequelize=require(_0x4683('0x0'));module['exports']={'type':{'type':Sequelize[_0x4683('0x1')](_0x4683('0x2'),_0x4683('0x3'),_0x4683('0x4'),_0x4683('0x5'),_0x4683('0x6')),'defaultValue':_0x4683('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4683('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4683('0x2'),_0x4683('0x3'),_0x4683('0x4'))},'keyContent':{'type':Sequelize[_0x4683('0x7')]},'idField':{'type':Sequelize[_0x4683('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4683('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4683('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f27c509..c01bfd2 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 _0x9b97=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','DeskField','includeAll','include','findAll','rows','rawAttributes','keys','intersection','length','find','catch','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9b97,0x11e));var _0x79b9=function(_0x1ecd1a,_0x645374){_0x1ecd1a=_0x1ecd1a-0x0;var _0x2b681c=_0x9b97[_0x1ecd1a];return _0x2b681c;};'use strict';var emlformat=require(_0x79b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79b9('0x1'));var jsonpatch=require(_0x79b9('0x2'));var rp=require(_0x79b9('0x3'));var moment=require(_0x79b9('0x4'));var BPromise=require(_0x79b9('0x5'));var Mustache=require(_0x79b9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b9('0x7'));var csv=require(_0x79b9('0x8'));var ejs=require(_0x79b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79b9('0xa'));var squel=require(_0x79b9('0xb'));var crypto=require('crypto');var jsforce=require(_0x79b9('0xc'));var deskjs=require(_0x79b9('0xd'));var toCsv=require(_0x79b9('0x8'));var querystring=require(_0x79b9('0xe'));var Papa=require(_0x79b9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x79b9('0x10'));var as=require(_0x79b9('0x11'));var hardwareService=require(_0x79b9('0x12'));var logger=require(_0x79b9('0x13'))(_0x79b9('0x14'));var utils=require(_0x79b9('0x15'));var config=require(_0x79b9('0x16'));var licenseUtil=require(_0x79b9('0x17'));var db=require(_0x79b9('0x18'))['db'];function respondWithStatusCode(_0xc0f6ae,_0x3f0a9e){_0x3f0a9e=_0x3f0a9e||0xcc;return function(_0x51682c){if(_0x51682c){return _0xc0f6ae[_0x79b9('0x19')](_0x3f0a9e);}return _0xc0f6ae[_0x79b9('0x1a')](_0x3f0a9e)['end']();};}function respondWithResult(_0x548f65,_0x4f90fe){_0x4f90fe=_0x4f90fe||0xc8;return function(_0x2e175d){if(_0x2e175d){return _0x548f65[_0x79b9('0x1a')](_0x4f90fe)[_0x79b9('0x1b')](_0x2e175d);}};}function respondWithFilteredResult(_0xbf8150,_0x398977){return function(_0x4fad8e){if(_0x4fad8e){var _0x4e465a=typeof _0x398977[_0x79b9('0x1c')]===_0x79b9('0x1d')&&typeof _0x398977[_0x79b9('0x1e')]===_0x79b9('0x1d');var _0x5917ab=_0x4fad8e[_0x79b9('0x1f')];var _0x621505=_0x4e465a?0x0:_0x398977['offset'];var _0x54dc9d=_0x4e465a?_0x4fad8e[_0x79b9('0x1f')]:_0x398977['offset']+_0x398977['limit'];var _0x5e1572;if(_0x54dc9d>=_0x5917ab){_0x54dc9d=_0x5917ab;_0x5e1572=0xc8;}else{_0x5e1572=0xce;}_0xbf8150[_0x79b9('0x1a')](_0x5e1572);return _0xbf8150[_0x79b9('0x20')]('Content-Range',_0x621505+'-'+_0x54dc9d+'/'+_0x5917ab)[_0x79b9('0x1b')](_0x4fad8e);}return null;};}function patchUpdates(_0x26f60c){return function(_0x2de174){try{jsonpatch[_0x79b9('0x21')](_0x2de174,_0x26f60c,!![]);}catch(_0x58b88c){return BPromise[_0x79b9('0x22')](_0x58b88c);}return _0x2de174[_0x79b9('0x23')]();};}function saveUpdates(_0x16cb83,_0x25006f){return function(_0x2dcf13){if(_0x2dcf13){return _0x2dcf13[_0x79b9('0x24')](_0x16cb83)[_0x79b9('0x25')](function(_0x50d357){return _0x50d357;});}return null;};}function removeEntity(_0xdd133f,_0x2399fa){return function(_0x495971){if(_0x495971){return _0x495971['destroy']()[_0x79b9('0x25')](function(){_0xdd133f[_0x79b9('0x1a')](0xcc)[_0x79b9('0x26')]();});}};}function handleEntityNotFound(_0x59ae09,_0x2ee1e4){return function(_0x3fd9d2){if(!_0x3fd9d2){_0x59ae09[_0x79b9('0x19')](0x194);}return _0x3fd9d2;};}function handleError(_0xa213d3,_0x400677){_0x400677=_0x400677||0x1f4;return function(_0x186764){logger[_0x79b9('0x27')](_0x186764[_0x79b9('0x28')]);if(_0x186764[_0x79b9('0x29')]){delete _0x186764[_0x79b9('0x29')];}_0xa213d3[_0x79b9('0x1a')](_0x400677)[_0x79b9('0x2a')](_0x186764);};}exports[_0x79b9('0x2b')]=function(_0x1bfadb,_0x322d7e){var _0x8f0513={},_0x12d87e={},_0x1d307f={'count':0x0,'rows':[]};var _0x531e7f=_[_0x79b9('0x2c')](db['DeskField']['rawAttributes'],function(_0x4edc64){return{'name':_0x4edc64[_0x79b9('0x2d')],'type':_0x4edc64[_0x79b9('0x2e')][_0x79b9('0x2f')]};});_0x12d87e[_0x79b9('0x30')]=_['map'](_0x531e7f,'name');_0x12d87e[_0x79b9('0x31')]=_['keys'](_0x1bfadb['query']);_0x12d87e[_0x79b9('0x32')]=_['intersection'](_0x12d87e[_0x79b9('0x30')],_0x12d87e[_0x79b9('0x31')]);_0x8f0513['attributes']=_['intersection'](_0x12d87e[_0x79b9('0x30')],qs[_0x79b9('0x33')](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x33')]));_0x8f0513[_0x79b9('0x34')]=_0x8f0513['attributes']['length']?_0x8f0513['attributes']:_0x12d87e[_0x79b9('0x30')];if(!_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x35')](_0x79b9('0x36'))){_0x8f0513[_0x79b9('0x1e')]=qs[_0x79b9('0x1e')](_0x1bfadb[_0x79b9('0x31')]['limit']);_0x8f0513[_0x79b9('0x1c')]=qs['offset'](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x1c')]);}_0x8f0513[_0x79b9('0x37')]=qs['sort'](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x38')]);_0x8f0513[_0x79b9('0x39')]=qs[_0x79b9('0x32')](_['pick'](_0x1bfadb['query'],_0x12d87e[_0x79b9('0x32')]),_0x531e7f);if(_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x3a')]){_0x8f0513[_0x79b9('0x39')]=_['merge'](_0x8f0513[_0x79b9('0x39')],{'$or':_['map'](_0x531e7f,function(_0x5e71f2){if(_0x5e71f2[_0x79b9('0x2e')]!==_0x79b9('0x3b')){var _0x4d5187={};_0x4d5187[_0x5e71f2[_0x79b9('0x29')]]={'$like':'%'+_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x3a')]+'%'};return _0x4d5187;}})});}_0x8f0513=_[_0x79b9('0x3c')]({},_0x8f0513,_0x1bfadb[_0x79b9('0x3d')]);var _0x5bc1de={'where':_0x8f0513[_0x79b9('0x39')]};return db[_0x79b9('0x3e')]['count'](_0x5bc1de)['then'](function(_0x2eab0d){_0x1d307f[_0x79b9('0x1f')]=_0x2eab0d;if(_0x1bfadb['query'][_0x79b9('0x3f')]){_0x8f0513[_0x79b9('0x40')]=[{'all':!![]}];}return db[_0x79b9('0x3e')][_0x79b9('0x41')](_0x8f0513);})[_0x79b9('0x25')](function(_0xbabbce){_0x1d307f[_0x79b9('0x42')]=_0xbabbce;return _0x1d307f;})[_0x79b9('0x25')](respondWithFilteredResult(_0x322d7e,_0x8f0513))['catch'](handleError(_0x322d7e,null));};exports['show']=function(_0x53563c,_0xe21f32){var _0x1125ec={'raw':!![],'where':{'id':_0x53563c['params']['id']}},_0x17f05f={};_0x17f05f['model']=_['keys'](db['DeskField'][_0x79b9('0x43')]);_0x17f05f[_0x79b9('0x31')]=_[_0x79b9('0x44')](_0x53563c[_0x79b9('0x31')]);_0x17f05f[_0x79b9('0x32')]=_['intersection'](_0x17f05f[_0x79b9('0x30')],_0x17f05f[_0x79b9('0x31')]);_0x1125ec[_0x79b9('0x34')]=_[_0x79b9('0x45')](_0x17f05f[_0x79b9('0x30')],qs[_0x79b9('0x33')](_0x53563c[_0x79b9('0x31')][_0x79b9('0x33')]));_0x1125ec[_0x79b9('0x34')]=_0x1125ec[_0x79b9('0x34')][_0x79b9('0x46')]?_0x1125ec[_0x79b9('0x34')]:_0x17f05f[_0x79b9('0x30')];if(_0x53563c[_0x79b9('0x31')][_0x79b9('0x3f')]){_0x1125ec[_0x79b9('0x40')]=[{'all':!![]}];}_0x1125ec=_[_0x79b9('0x3c')]({},_0x1125ec,_0x53563c[_0x79b9('0x3d')]);return db[_0x79b9('0x3e')][_0x79b9('0x47')](_0x1125ec)[_0x79b9('0x25')](handleEntityNotFound(_0xe21f32,null))[_0x79b9('0x25')](respondWithResult(_0xe21f32,null))[_0x79b9('0x48')](handleError(_0xe21f32,null));};exports[_0x79b9('0x49')]=function(_0x3f972e,_0xca2ca8){return db[_0x79b9('0x3e')]['create'](_0x3f972e[_0x79b9('0x4a')],{})[_0x79b9('0x25')](respondWithResult(_0xca2ca8,0xc9))['catch'](handleError(_0xca2ca8,null));};exports[_0x79b9('0x24')]=function(_0x5bc93f,_0x151cb0){if(_0x5bc93f['body']['id']){delete _0x5bc93f[_0x79b9('0x4a')]['id'];}return db[_0x79b9('0x3e')]['find']({'where':{'id':_0x5bc93f[_0x79b9('0x4b')]['id']}})[_0x79b9('0x25')](handleEntityNotFound(_0x151cb0,null))[_0x79b9('0x25')](saveUpdates(_0x5bc93f[_0x79b9('0x4a')],null))['then'](respondWithResult(_0x151cb0,null))[_0x79b9('0x48')](handleError(_0x151cb0,null));};exports[_0x79b9('0x4c')]=function(_0x1b8d57,_0x3fdde0){return db[_0x79b9('0x3e')][_0x79b9('0x47')]({'where':{'id':_0x1b8d57[_0x79b9('0x4b')]['id']}})[_0x79b9('0x25')](handleEntityNotFound(_0x3fdde0,null))['then'](removeEntity(_0x3fdde0,null))[_0x79b9('0x48')](handleError(_0x3fdde0,null));}; \ No newline at end of file +var _0x2a8e=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','DeskField','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a8e,0x132));var _0xe2a8=function(_0x3b15a1,_0x3c2f2a){_0x3b15a1=_0x3b15a1-0x0;var _0x4c4839=_0x2a8e[_0x3b15a1];return _0x4c4839;};'use strict';var emlformat=require(_0xe2a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2a8('0x1'));var jsonpatch=require(_0xe2a8('0x2'));var rp=require(_0xe2a8('0x3'));var moment=require(_0xe2a8('0x4'));var BPromise=require(_0xe2a8('0x5'));var Mustache=require(_0xe2a8('0x6'));var util=require(_0xe2a8('0x7'));var path=require(_0xe2a8('0x8'));var sox=require(_0xe2a8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2a8('0xa'));var fs=require('fs');var fs_extra=require(_0xe2a8('0xb'));var _=require(_0xe2a8('0xc'));var squel=require(_0xe2a8('0xd'));var crypto=require(_0xe2a8('0xe'));var jsforce=require(_0xe2a8('0xf'));var deskjs=require(_0xe2a8('0x10'));var toCsv=require(_0xe2a8('0x11'));var querystring=require('querystring');var Papa=require(_0xe2a8('0x12'));var Redis=require(_0xe2a8('0x13'));var authService=require(_0xe2a8('0x14'));var qs=require(_0xe2a8('0x15'));var as=require(_0xe2a8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2a8('0x17'))(_0xe2a8('0x18'));var utils=require(_0xe2a8('0x19'));var config=require(_0xe2a8('0x1a'));var licenseUtil=require(_0xe2a8('0x1b'));var db=require(_0xe2a8('0x1c'))['db'];function respondWithStatusCode(_0x1721b8,_0x5691de){_0x5691de=_0x5691de||0xcc;return function(_0x3f727e){if(_0x3f727e){return _0x1721b8[_0xe2a8('0x1d')](_0x5691de);}return _0x1721b8[_0xe2a8('0x1e')](_0x5691de)[_0xe2a8('0x1f')]();};}function respondWithResult(_0x50b59c,_0x44c829){_0x44c829=_0x44c829||0xc8;return function(_0x5bea82){if(_0x5bea82){return _0x50b59c[_0xe2a8('0x1e')](_0x44c829)[_0xe2a8('0x20')](_0x5bea82);}};}function respondWithFilteredResult(_0xd035a0,_0xea9d76){return function(_0x20f230){if(_0x20f230){var _0x29cfde=typeof _0xea9d76['offset']===_0xe2a8('0x21')&&typeof _0xea9d76[_0xe2a8('0x22')]==='undefined';var _0x285a79=_0x20f230[_0xe2a8('0x23')];var _0x19dd17=_0x29cfde?0x0:_0xea9d76['offset'];var _0x1117d7=_0x29cfde?_0x20f230[_0xe2a8('0x23')]:_0xea9d76['offset']+_0xea9d76[_0xe2a8('0x22')];var _0x1ec914;if(_0x1117d7>=_0x285a79){_0x1117d7=_0x285a79;_0x1ec914=0xc8;}else{_0x1ec914=0xce;}_0xd035a0[_0xe2a8('0x1e')](_0x1ec914);return _0xd035a0['set'](_0xe2a8('0x24'),_0x19dd17+'-'+_0x1117d7+'/'+_0x285a79)['json'](_0x20f230);}return null;};}function patchUpdates(_0x26efcc){return function(_0x441d46){try{jsonpatch[_0xe2a8('0x25')](_0x441d46,_0x26efcc,!![]);}catch(_0x25d2be){return BPromise[_0xe2a8('0x26')](_0x25d2be);}return _0x441d46[_0xe2a8('0x27')]();};}function saveUpdates(_0x329bbf,_0x429a65){return function(_0x41f105){if(_0x41f105){return _0x41f105[_0xe2a8('0x28')](_0x329bbf)['then'](function(_0x22312e){return _0x22312e;});}return null;};}function removeEntity(_0x44c9b8,_0x261267){return function(_0x34426f){if(_0x34426f){return _0x34426f[_0xe2a8('0x29')]()[_0xe2a8('0x2a')](function(){_0x44c9b8[_0xe2a8('0x1e')](0xcc)[_0xe2a8('0x1f')]();});}};}function handleEntityNotFound(_0x42b5bf,_0x1fff37){return function(_0x545e05){if(!_0x545e05){_0x42b5bf[_0xe2a8('0x1d')](0x194);}return _0x545e05;};}function handleError(_0x29dd7e,_0xc5afd6){_0xc5afd6=_0xc5afd6||0x1f4;return function(_0x2c4f37){logger[_0xe2a8('0x2b')](_0x2c4f37[_0xe2a8('0x2c')]);if(_0x2c4f37[_0xe2a8('0x2d')]){delete _0x2c4f37[_0xe2a8('0x2d')];}_0x29dd7e[_0xe2a8('0x1e')](_0xc5afd6)[_0xe2a8('0x2e')](_0x2c4f37);};}exports[_0xe2a8('0x2f')]=function(_0x5216e8,_0x321969){var _0x8fda3f={},_0x30b2df={},_0x3abc96={'count':0x0,'rows':[]};var _0x3dd968=_[_0xe2a8('0x30')](db[_0xe2a8('0x31')]['rawAttributes'],function(_0x2a3e18){return{'name':_0x2a3e18[_0xe2a8('0x32')],'type':_0x2a3e18['type'][_0xe2a8('0x33')]};});_0x30b2df[_0xe2a8('0x34')]=_[_0xe2a8('0x30')](_0x3dd968,'name');_0x30b2df[_0xe2a8('0x35')]=_[_0xe2a8('0x36')](_0x5216e8[_0xe2a8('0x35')]);_0x30b2df['filters']=_[_0xe2a8('0x37')](_0x30b2df['model'],_0x30b2df[_0xe2a8('0x35')]);_0x8fda3f['attributes']=_[_0xe2a8('0x37')](_0x30b2df[_0xe2a8('0x34')],qs[_0xe2a8('0x38')](_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x38')]));_0x8fda3f[_0xe2a8('0x39')]=_0x8fda3f[_0xe2a8('0x39')][_0xe2a8('0x3a')]?_0x8fda3f[_0xe2a8('0x39')]:_0x30b2df[_0xe2a8('0x34')];if(!_0x5216e8['query'][_0xe2a8('0x3b')]('nolimit')){_0x8fda3f[_0xe2a8('0x22')]=qs[_0xe2a8('0x22')](_0x5216e8['query'][_0xe2a8('0x22')]);_0x8fda3f[_0xe2a8('0x3c')]=qs['offset'](_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x3c')]);}_0x8fda3f[_0xe2a8('0x3d')]=qs[_0xe2a8('0x3e')](_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x3e')]);_0x8fda3f[_0xe2a8('0x3f')]=qs[_0xe2a8('0x40')](_[_0xe2a8('0x41')](_0x5216e8[_0xe2a8('0x35')],_0x30b2df[_0xe2a8('0x40')]),_0x3dd968);if(_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x42')]){_0x8fda3f[_0xe2a8('0x3f')]=_['merge'](_0x8fda3f['where'],{'$or':_[_0xe2a8('0x30')](_0x3dd968,function(_0x5bbb48){if(_0x5bbb48[_0xe2a8('0x43')]!=='VIRTUAL'){var _0x21f439={};_0x21f439[_0x5bbb48['name']]={'$like':'%'+_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x42')]+'%'};return _0x21f439;}})});}_0x8fda3f=_[_0xe2a8('0x44')]({},_0x8fda3f,_0x5216e8[_0xe2a8('0x45')]);var _0x464e69={'where':_0x8fda3f[_0xe2a8('0x3f')]};return db[_0xe2a8('0x31')][_0xe2a8('0x23')](_0x464e69)['then'](function(_0x4368bd){_0x3abc96[_0xe2a8('0x23')]=_0x4368bd;if(_0x5216e8[_0xe2a8('0x35')][_0xe2a8('0x46')]){_0x8fda3f[_0xe2a8('0x47')]=[{'all':!![]}];}return db[_0xe2a8('0x31')][_0xe2a8('0x48')](_0x8fda3f);})[_0xe2a8('0x2a')](function(_0x59f0cb){_0x3abc96[_0xe2a8('0x49')]=_0x59f0cb;return _0x3abc96;})[_0xe2a8('0x2a')](respondWithFilteredResult(_0x321969,_0x8fda3f))[_0xe2a8('0x4a')](handleError(_0x321969,null));};exports[_0xe2a8('0x4b')]=function(_0x38c8b0,_0x3f716d){var _0x523d0a={'raw':!![],'where':{'id':_0x38c8b0['params']['id']}},_0x516890={};_0x516890[_0xe2a8('0x34')]=_[_0xe2a8('0x36')](db[_0xe2a8('0x31')][_0xe2a8('0x4c')]);_0x516890[_0xe2a8('0x35')]=_[_0xe2a8('0x36')](_0x38c8b0[_0xe2a8('0x35')]);_0x516890[_0xe2a8('0x40')]=_['intersection'](_0x516890[_0xe2a8('0x34')],_0x516890[_0xe2a8('0x35')]);_0x523d0a['attributes']=_['intersection'](_0x516890[_0xe2a8('0x34')],qs[_0xe2a8('0x38')](_0x38c8b0['query'][_0xe2a8('0x38')]));_0x523d0a[_0xe2a8('0x39')]=_0x523d0a[_0xe2a8('0x39')][_0xe2a8('0x3a')]?_0x523d0a[_0xe2a8('0x39')]:_0x516890['model'];if(_0x38c8b0[_0xe2a8('0x35')][_0xe2a8('0x46')]){_0x523d0a[_0xe2a8('0x47')]=[{'all':!![]}];}_0x523d0a=_[_0xe2a8('0x44')]({},_0x523d0a,_0x38c8b0['options']);return db[_0xe2a8('0x31')][_0xe2a8('0x4d')](_0x523d0a)[_0xe2a8('0x2a')](handleEntityNotFound(_0x3f716d,null))['then'](respondWithResult(_0x3f716d,null))[_0xe2a8('0x4a')](handleError(_0x3f716d,null));};exports['create']=function(_0x5b6098,_0x2ac4a8){return db['DeskField'][_0xe2a8('0x4e')](_0x5b6098[_0xe2a8('0x4f')],{})[_0xe2a8('0x2a')](respondWithResult(_0x2ac4a8,0xc9))[_0xe2a8('0x4a')](handleError(_0x2ac4a8,null));};exports[_0xe2a8('0x28')]=function(_0x2b2814,_0x5a3590){if(_0x2b2814[_0xe2a8('0x4f')]['id']){delete _0x2b2814['body']['id'];}return db[_0xe2a8('0x31')][_0xe2a8('0x4d')]({'where':{'id':_0x2b2814[_0xe2a8('0x50')]['id']}})[_0xe2a8('0x2a')](handleEntityNotFound(_0x5a3590,null))[_0xe2a8('0x2a')](saveUpdates(_0x2b2814['body'],null))[_0xe2a8('0x2a')](respondWithResult(_0x5a3590,null))[_0xe2a8('0x4a')](handleError(_0x5a3590,null));};exports[_0xe2a8('0x29')]=function(_0x5e0bd1,_0x2d75fe){return db[_0xe2a8('0x31')][_0xe2a8('0x4d')]({'where':{'id':_0x5e0bd1[_0xe2a8('0x50')]['id']}})[_0xe2a8('0x2a')](handleEntityNotFound(_0x2d75fe,null))[_0xe2a8('0x2a')](removeEntity(_0x2d75fe,null))['catch'](handleError(_0x2d75fe,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7cfc407..f5d845f 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 _0x388c=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','int_desk_fields','desk_unique_index'];(function(_0x211158,_0x5edf3c){var _0x197bef=function(_0x4da6c0){while(--_0x4da6c0){_0x211158['push'](_0x211158['shift']());}};_0x197bef(++_0x5edf3c);}(_0x388c,0xb8));var _0xc388=function(_0x3bfd91,_0x360af9){_0x3bfd91=_0x3bfd91-0x0;var _0x144324=_0x388c[_0x3bfd91];return _0x144324;};'use strict';var _=require(_0xc388('0x0'));var util=require(_0xc388('0x1'));var logger=require(_0xc388('0x2'))(_0xc388('0x3'));var moment=require('moment');var BPromise=require(_0xc388('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc388('0x5'));var rimraf=require(_0xc388('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xc388('0x7')]=function(_0x163aa6,_0x39e17d){return _0x163aa6[_0xc388('0x8')]('DeskField',attributes,{'tableName':_0xc388('0x9'),'paranoid':![],'indexes':[{'name':_0xc388('0xa'),'fields':[_0xc388('0xb'),_0xc388('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9df2=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','idField','lodash'];(function(_0x5d2473,_0x36d636){var _0x4f042d=function(_0x150fe8){while(--_0x150fe8){_0x5d2473['push'](_0x5d2473['shift']());}};_0x4f042d(++_0x36d636);}(_0x9df2,0xcf));var _0x29df=function(_0x14a227,_0x59a0d3){_0x14a227=_0x14a227-0x0;var _0x109b7f=_0x9df2[_0x14a227];return _0x109b7f;};'use strict';var _=require(_0x29df('0x0'));var util=require(_0x29df('0x1'));var logger=require(_0x29df('0x2'))(_0x29df('0x3'));var moment=require('moment');var BPromise=require(_0x29df('0x4'));var rp=require(_0x29df('0x5'));var fs=require('fs');var path=require(_0x29df('0x6'));var rimraf=require(_0x29df('0x7'));var config=require('../../config/environment');var attributes=require(_0x29df('0x8'));module['exports']=function(_0x49ed16,_0xa14483){return _0x49ed16[_0x29df('0x9')](_0x29df('0xa'),attributes,{'tableName':_0x29df('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x29df('0xc'),'FieldId'],'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 bdcd3dc..fdbd429 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 _0xec29=['http','request','then','info','request\x20sent','debug','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x57494a,_0x3d5f2f){var _0x45e30f=function(_0x1d70da){while(--_0x1d70da){_0x57494a['push'](_0x57494a['shift']());}};_0x45e30f(++_0x3d5f2f);}(_0xec29,0xad));var _0x9ec2=function(_0x502043,_0x48ecc4){_0x502043=_0x502043-0x0;var _0x2ec3f2=_0xec29[_0x502043];return _0x2ec3f2;};'use strict';var _=require(_0x9ec2('0x0'));var util=require('util');var moment=require(_0x9ec2('0x1'));var BPromise=require(_0x9ec2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ec2('0x3'));var db=require(_0x9ec2('0x4'))['db'];var utils=require(_0x9ec2('0x5'));var logger=require(_0x9ec2('0x6'))(_0x9ec2('0x7'));var config=require(_0x9ec2('0x8'));var jayson=require(_0x9ec2('0x9'));var client=jayson[_0x9ec2('0xa')][_0x9ec2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c08c,_0x4becbc,_0x149d1a){return new BPromise(function(_0x9cb02f,_0x22b0a2){return client[_0x9ec2('0xc')](_0x52c08c,_0x149d1a)[_0x9ec2('0xd')](function(_0x3af298){logger[_0x9ec2('0xe')]('DeskField,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'));logger[_0x9ec2('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'),JSON[_0x9ec2('0x11')](_0x3af298));if(_0x3af298[_0x9ec2('0x12')]){if(_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x13')]===0x1f4){logger[_0x9ec2('0x12')](_0x9ec2('0x14'),_0x4becbc,_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x15')]);return _0x22b0a2(_0x3af298[_0x9ec2('0x12')]['message']);}logger['error'](_0x9ec2('0x14'),_0x4becbc,_0x3af298['error'][_0x9ec2('0x15')]);return _0x9cb02f(_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x15')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'));_0x9cb02f(_0x3af298['result']['message']);}})[_0x9ec2('0x16')](function(_0x1e88df){logger[_0x9ec2('0x12')](_0x9ec2('0x14'),_0x4becbc,_0x1e88df);_0x22b0a2(_0x1e88df);});});} \ No newline at end of file +var _0xfbd1=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x4daf0d,_0x3aa28a){var _0x176df0=function(_0x26f65e){while(--_0x26f65e){_0x4daf0d['push'](_0x4daf0d['shift']());}};_0x176df0(++_0x3aa28a);}(_0xfbd1,0x1b5));var _0x1fbd=function(_0x5a25f6,_0x3db5cb){_0x5a25f6=_0x5a25f6-0x0;var _0x5a524d=_0xfbd1[_0x5a25f6];return _0x5a524d;};'use strict';var _=require(_0x1fbd('0x0'));var util=require(_0x1fbd('0x1'));var moment=require(_0x1fbd('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fbd('0x3'));var fs=require('fs');var Redis=require(_0x1fbd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fbd('0x5'));var logger=require(_0x1fbd('0x6'))('rpc');var config=require(_0x1fbd('0x7'));var jayson=require(_0x1fbd('0x8'));var client=jayson['client'][_0x1fbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a1f1,_0x1b8029,_0x486c3c){return new BPromise(function(_0x21c366,_0x5bac0f){return client[_0x1fbd('0xa')](_0x35a1f1,_0x486c3c)[_0x1fbd('0xb')](function(_0x4ec602){logger[_0x1fbd('0xc')](_0x1fbd('0xd'),_0x1b8029,_0x1fbd('0xe'));logger[_0x1fbd('0xf')](_0x1fbd('0x10'),_0x1b8029,_0x1fbd('0xe'),JSON[_0x1fbd('0x11')](_0x4ec602));if(_0x4ec602[_0x1fbd('0x12')]){if(_0x4ec602[_0x1fbd('0x12')]['code']===0x1f4){logger['error'](_0x1fbd('0xd'),_0x1b8029,_0x4ec602['error'][_0x1fbd('0x13')]);return _0x5bac0f(_0x4ec602[_0x1fbd('0x12')]['message']);}logger[_0x1fbd('0x12')]('DeskField,\x20%s,\x20%s',_0x1b8029,_0x4ec602[_0x1fbd('0x12')][_0x1fbd('0x13')]);return _0x21c366(_0x4ec602[_0x1fbd('0x12')][_0x1fbd('0x13')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x1b8029,_0x1fbd('0xe'));_0x21c366(_0x4ec602[_0x1fbd('0x14')][_0x1fbd('0x13')]);}})[_0x1fbd('0x15')](function(_0x5a6916){logger[_0x1fbd('0x12')](_0x1fbd('0xd'),_0x1b8029,_0x5a6916);_0x5bac0f(_0x5a6916);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 59e2ba2..2ba154c 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 _0x9fea=['addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x5edac0,_0x4140fb){var _0x194236=function(_0x209c22){while(--_0x209c22){_0x5edac0['push'](_0x5edac0['shift']());}};_0x194236(++_0x4140fb);}(_0x9fea,0xb5));var _0xa9fe=function(_0x5efb0e,_0x326332){_0x5efb0e=_0x5efb0e-0x0;var _0x3b75bb=_0x9fea[_0x5efb0e];return _0x3b75bb;};'use strict';var multer=require(_0xa9fe('0x0'));var util=require(_0xa9fe('0x1'));var path=require(_0xa9fe('0x2'));var timeout=require(_0xa9fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa9fe('0x4'));var auth=require(_0xa9fe('0x5'));var interaction=require(_0xa9fe('0x6'));var config=require('../../config/environment');var controller=require(_0xa9fe('0x7'));router[_0xa9fe('0x8')]('/',auth[_0xa9fe('0x9')](),controller[_0xa9fe('0xa')]);router[_0xa9fe('0x8')](_0xa9fe('0xb'),auth[_0xa9fe('0x9')](),controller['show']);router[_0xa9fe('0x8')](_0xa9fe('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xa9fe('0x8')](_0xa9fe('0xd'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0xe')]);router[_0xa9fe('0xf')]('/',auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x10')]);router[_0xa9fe('0xf')](_0xa9fe('0xc'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x11')]);router[_0xa9fe('0x12')](_0xa9fe('0xb'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa9fe('0x14')]);module[_0xa9fe('0x15')]=router; \ No newline at end of file +var _0x5b22=['get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30f619,_0x4e3e72){var _0x310ec8=function(_0x3b0d1c){while(--_0x3b0d1c){_0x30f619['push'](_0x30f619['shift']());}};_0x310ec8(++_0x4e3e72);}(_0x5b22,0x1d1));var _0x25b2=function(_0x5d6109,_0x54a2c7){_0x5d6109=_0x5d6109-0x0;var _0x5299f3=_0x5b22[_0x5d6109];return _0x5299f3;};'use strict';var multer=require(_0x25b2('0x0'));var util=require(_0x25b2('0x1'));var path=require(_0x25b2('0x2'));var timeout=require(_0x25b2('0x3'));var express=require(_0x25b2('0x4'));var router=express[_0x25b2('0x5')]();var fs_extra=require(_0x25b2('0x6'));var auth=require(_0x25b2('0x7'));var interaction=require(_0x25b2('0x8'));var config=require(_0x25b2('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x25b2('0xa')]('/',auth[_0x25b2('0xb')](),controller[_0x25b2('0xc')]);router[_0x25b2('0xa')](_0x25b2('0xd'),auth[_0x25b2('0xb')](),controller['show']);router['get'](_0x25b2('0xe'),auth[_0x25b2('0xb')](),controller['getConfigurations']);router[_0x25b2('0xa')](_0x25b2('0xf'),auth[_0x25b2('0xb')](),controller[_0x25b2('0x10')]);router[_0x25b2('0x11')]('/',auth[_0x25b2('0xb')](),controller[_0x25b2('0x12')]);router[_0x25b2('0x11')](_0x25b2('0xe'),auth[_0x25b2('0xb')](),controller[_0x25b2('0x13')]);router[_0x25b2('0x14')](_0x25b2('0xd'),auth[_0x25b2('0xb')](),controller[_0x25b2('0x15')]);router[_0x25b2('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x25b2('0x17')]);module[_0x25b2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 3089e4f..445f664 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 _0xd8a5=['BOOLEAN','sequelize','STRING'];(function(_0x257ff1,_0x532332){var _0xbcecff=function(_0x28f644){while(--_0x28f644){_0x257ff1['push'](_0x257ff1['shift']());}};_0xbcecff(++_0x532332);}(_0xd8a5,0x160));var _0x5d8a=function(_0x3c1c71,_0x1b3831){_0x3c1c71=_0x3c1c71-0x0;var _0x2a9570=_0xd8a5[_0x3c1c71];return _0x2a9570;};'use strict';var Sequelize=require(_0x5d8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8a('0x1')]},'username':{'type':Sequelize[_0x5d8a('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5d8a('0x1')]},'tenantId':{'type':Sequelize[_0x5d8a('0x1')]},'clientId':{'type':Sequelize[_0x5d8a('0x1')]},'clientSecret':{'type':Sequelize[_0x5d8a('0x1')]},'serverUrl':{'type':Sequelize[_0x5d8a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5d8a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x5d8a('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e8d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x35fb0b,_0x22b8df){var _0x7d4c6a=function(_0x1d0497){while(--_0x1d0497){_0x35fb0b['push'](_0x35fb0b['shift']());}};_0x7d4c6a(++_0x22b8df);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x469f08,_0x178ecb){_0x469f08=_0x469f08-0x0;var _0xf1c7b6=_0x5e8d[_0x469f08];return _0xf1c7b6;};'use strict';var Sequelize=require(_0xd5e8('0x0'));module[_0xd5e8('0x1')]={'name':{'type':Sequelize[_0xd5e8('0x2')]},'username':{'type':Sequelize[_0xd5e8('0x2')]},'password':{'type':Sequelize[_0xd5e8('0x2')]},'remoteUri':{'type':Sequelize[_0xd5e8('0x2')]},'tenantId':{'type':Sequelize[_0xd5e8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xd5e8('0x2')]},'serverUrl':{'type':Sequelize[_0xd5e8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xd5e8('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 41aa585..2aa6318 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 _0x2d58=['push','all','BooleanAttributeMetadata','MetadataId','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','Dynamics365Configuration','nolimit','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','getFields','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridtype','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','LogicalName','forEach','@odata.type','PicklistAttributeMetadata'];(function(_0x43d2ac,_0x48521a){var _0x4b4a33=function(_0xc5ffda){while(--_0xc5ffda){_0x43d2ac['push'](_0x43d2ac['shift']());}};_0x4b4a33(++_0x48521a);}(_0x2d58,0x186));var _0x82d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d58[_0xa464c9];return _0x3d73c4;};'use strict';var rp=require(_0x82d5('0x0'));var util=require(_0x82d5('0x1'));var _=require(_0x82d5('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x82d5('0x3'))('api');var db=require(_0x82d5('0x4'))['db'];var integrations=require(_0x82d5('0x5'));function respondWithResult(_0x19fd57,_0x763bbb){_0x763bbb=_0x763bbb||0xc8;return function(_0x37830c){if(_0x37830c){return _0x19fd57[_0x82d5('0x6')](_0x763bbb)[_0x82d5('0x7')](_0x37830c);}};}function respondWithFilteredResult(_0x4c95fe,_0xd636fe){return function(_0x2f5257){if(_0x2f5257){var _0x24c9cb=typeof _0xd636fe[_0x82d5('0x8')]===_0x82d5('0x9')&&typeof _0xd636fe[_0x82d5('0xa')]===_0x82d5('0x9');var _0x19d045=_0x2f5257[_0x82d5('0xb')];var _0x4744d7=_0x24c9cb?0x0:_0xd636fe['offset'];var _0x29f9e3=_0x24c9cb?_0x2f5257[_0x82d5('0xb')]:_0xd636fe[_0x82d5('0x8')]+_0xd636fe[_0x82d5('0xa')];var _0x5a3cb2;if(_0x29f9e3>=_0x19d045){_0x29f9e3=_0x19d045;_0x5a3cb2=0xc8;}else{_0x5a3cb2=0xce;}_0x4c95fe['status'](_0x5a3cb2);return _0x4c95fe[_0x82d5('0xc')](_0x82d5('0xd'),_0x4744d7+'-'+_0x29f9e3+'/'+_0x19d045)['json'](_0x2f5257);}return null;};}function saveUpdates(_0x14ccdc){return function(_0x5c2d84){if(_0x5c2d84){return _0x5c2d84[_0x82d5('0xe')](_0x14ccdc)[_0x82d5('0xf')](function(_0x3a33eb){return _0x3a33eb;});}return null;};}function removeEntity(_0x265753){return function(_0x201e56){if(_0x201e56){return _0x201e56[_0x82d5('0x10')]()[_0x82d5('0xf')](function(){_0x265753[_0x82d5('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128c42){return function(_0x26caa1){if(!_0x26caa1){_0x128c42['sendStatus'](0x194);}return _0x26caa1;};}function handleError(_0x6ad68c,_0x2194c6){_0x2194c6=_0x2194c6||0x1f4;return function(_0x421d58){logger[_0x82d5('0x11')](_0x421d58[_0x82d5('0x12')]);if(_0x421d58['name']){delete _0x421d58[_0x82d5('0x13')];}_0x6ad68c[_0x82d5('0x6')](_0x2194c6)[_0x82d5('0x14')](_0x421d58);};}exports[_0x82d5('0x15')]=function(_0xa4319c,_0x40b689){var _0x3505b8={},_0x53fef6={},_0x539d35={'count':0x0,'rows':[]};var _0x3c12d5=_[_0x82d5('0x16')](db[_0x82d5('0x17')][_0x82d5('0x18')],function(_0x32be04){return{'name':_0x32be04[_0x82d5('0x19')],'type':_0x32be04[_0x82d5('0x1a')][_0x82d5('0x1b')]};});_0x53fef6['model']=_[_0x82d5('0x16')](_0x3c12d5,_0x82d5('0x13'));_0x53fef6[_0x82d5('0x1c')]=_[_0x82d5('0x1d')](_0xa4319c['query']);_0x53fef6[_0x82d5('0x1e')]=_['intersection'](_0x53fef6[_0x82d5('0x1f')],_0x53fef6[_0x82d5('0x1c')]);_0x3505b8[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x53fef6[_0x82d5('0x1f')],qs[_0x82d5('0x22')](_0xa4319c['query'][_0x82d5('0x22')]));_0x3505b8['attributes']=_0x3505b8['attributes'][_0x82d5('0x23')]?_0x3505b8['attributes']:_0x53fef6[_0x82d5('0x1f')];if(!_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x24')]('nolimit')){_0x3505b8[_0x82d5('0xa')]=qs[_0x82d5('0xa')](_0xa4319c[_0x82d5('0x1c')]['limit']);_0x3505b8[_0x82d5('0x8')]=qs['offset'](_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x8')]);}_0x3505b8[_0x82d5('0x25')]=qs['sort'](_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x26')]);_0x3505b8[_0x82d5('0x27')]=qs[_0x82d5('0x1e')](_[_0x82d5('0x28')](_0xa4319c[_0x82d5('0x1c')],_0x53fef6[_0x82d5('0x1e')]),_0x3c12d5);if(_0xa4319c['query'][_0x82d5('0x29')]){_0x3505b8[_0x82d5('0x27')]=_[_0x82d5('0x2a')](_0x3505b8['where'],{'$or':_[_0x82d5('0x16')](_0x3c12d5,function(_0xe85e04){if(_0xe85e04['type']!==_0x82d5('0x2b')){var _0xbe0c27={};_0xbe0c27[_0xe85e04[_0x82d5('0x13')]]={'$like':'%'+_0xa4319c[_0x82d5('0x1c')]['filter']+'%'};return _0xbe0c27;}})});}_0x3505b8=_[_0x82d5('0x2a')]({},_0x3505b8,_0xa4319c[_0x82d5('0x2c')]);var _0x780deb={'where':_0x3505b8[_0x82d5('0x27')]};return db[_0x82d5('0x17')][_0x82d5('0xb')](_0x780deb)[_0x82d5('0xf')](function(_0x1d78b6){_0x539d35['count']=_0x1d78b6;if(_0xa4319c['query'][_0x82d5('0x2d')]){_0x3505b8[_0x82d5('0x2e')]=[{'all':!![]}];}return db[_0x82d5('0x17')][_0x82d5('0x2f')](_0x3505b8);})[_0x82d5('0xf')](function(_0xdb5796){_0x539d35[_0x82d5('0x30')]=_0xdb5796;return _0x539d35;})[_0x82d5('0xf')](respondWithFilteredResult(_0x40b689,_0x3505b8))[_0x82d5('0x31')](handleError(_0x40b689,null));};exports[_0x82d5('0x32')]=function(_0x33c96d,_0x243444){var _0x21fb67={'raw':![],'where':{'id':_0x33c96d['params']['id']}},_0x4cdfc5={};_0x4cdfc5[_0x82d5('0x1f')]=_[_0x82d5('0x1d')](db[_0x82d5('0x17')][_0x82d5('0x18')]);_0x4cdfc5[_0x82d5('0x1c')]=_['keys'](_0x33c96d[_0x82d5('0x1c')]);_0x4cdfc5[_0x82d5('0x1e')]=_[_0x82d5('0x21')](_0x4cdfc5['model'],_0x4cdfc5[_0x82d5('0x1c')]);_0x21fb67[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x4cdfc5[_0x82d5('0x1f')],qs[_0x82d5('0x22')](_0x33c96d[_0x82d5('0x1c')]['fields']));_0x21fb67['attributes']=_0x21fb67[_0x82d5('0x20')]['length']?_0x21fb67[_0x82d5('0x20')]:_0x4cdfc5[_0x82d5('0x1f')];if(_0x33c96d['query'][_0x82d5('0x2d')]){_0x21fb67[_0x82d5('0x2e')]=[{'all':!![]}];}_0x21fb67=_['merge']({},_0x21fb67,_0x33c96d[_0x82d5('0x2c')]);return db[_0x82d5('0x17')][_0x82d5('0x33')](_0x21fb67)[_0x82d5('0xf')](handleEntityNotFound(_0x243444,null))['then'](respondWithResult(_0x243444,null))['catch'](handleError(_0x243444,null));};exports['create']=function(_0x40a0a9,_0x3ebdbb){return db['Dynamics365Account']['create'](_0x40a0a9['body'],{})[_0x82d5('0xf')](respondWithResult(_0x3ebdbb,0xc9))[_0x82d5('0x31')](handleError(_0x3ebdbb,null));};exports[_0x82d5('0xe')]=function(_0xe063f7,_0x4d17de){if(_0xe063f7['body']['id']){delete _0xe063f7[_0x82d5('0x34')]['id'];}return db['Dynamics365Account'][_0x82d5('0x33')]({'where':{'id':_0xe063f7[_0x82d5('0x35')]['id']}})[_0x82d5('0xf')](handleEntityNotFound(_0x4d17de,null))['then'](saveUpdates(_0xe063f7[_0x82d5('0x34')],null))[_0x82d5('0xf')](respondWithResult(_0x4d17de,null))[_0x82d5('0x31')](handleError(_0x4d17de,null));};exports[_0x82d5('0x10')]=function(_0x367eb3,_0x14bc4d){return db[_0x82d5('0x17')]['find']({'where':{'id':_0x367eb3[_0x82d5('0x35')]['id']}})['then'](handleEntityNotFound(_0x14bc4d,null))[_0x82d5('0xf')](removeEntity(_0x14bc4d,null))[_0x82d5('0x31')](handleError(_0x14bc4d,null));};exports['getConfigurations']=function(_0x1973aa,_0x37c5d1){var _0x3abe36={};var _0x43584b={};var _0x1873d5;var _0x4241b4;return db[_0x82d5('0x17')]['findOne']({'where':{'id':_0x1973aa['params']['id']}})['then'](handleEntityNotFound(_0x37c5d1,null))[_0x82d5('0xf')](function(_0x2778a6){if(_0x2778a6){_0x1873d5=_0x2778a6;_0x43584b['model']=_[_0x82d5('0x1d')](db[_0x82d5('0x36')]['rawAttributes']);_0x43584b['query']=_[_0x82d5('0x1d')](_0x1973aa[_0x82d5('0x1c')]);_0x43584b['filters']=_[_0x82d5('0x21')](_0x43584b[_0x82d5('0x1f')],_0x43584b[_0x82d5('0x1c')]);_0x3abe36[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x43584b['model'],qs[_0x82d5('0x22')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x22')]));_0x3abe36['attributes']=_0x3abe36[_0x82d5('0x20')][_0x82d5('0x23')]?_0x3abe36['attributes']:_0x43584b[_0x82d5('0x1f')];_0x3abe36[_0x82d5('0x25')]=qs[_0x82d5('0x26')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x26')]);_0x3abe36[_0x82d5('0x27')]=qs[_0x82d5('0x1e')](_['pick'](_0x1973aa[_0x82d5('0x1c')],_0x43584b['filters']));if(_0x1973aa['query'][_0x82d5('0x29')]){_0x3abe36[_0x82d5('0x27')]=_[_0x82d5('0x2a')](_0x3abe36[_0x82d5('0x27')],{'$or':_[_0x82d5('0x16')](_0x3abe36['attributes'],function(_0xe70ce8){var _0x36c383={};_0x36c383[_0xe70ce8]={'$like':'%'+_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x29')]+'%'};return _0x36c383;})});}_0x3abe36=_['merge']({},_0x3abe36,_0x1973aa[_0x82d5('0x2c')]);return _0x1873d5['getConfigurations'](_0x3abe36);}})[_0x82d5('0xf')](function(_0xe8d2d9){if(_0xe8d2d9){_0x4241b4=_0xe8d2d9[_0x82d5('0x23')];if(!_0x1973aa['query'][_0x82d5('0x24')](_0x82d5('0x37'))){_0x3abe36[_0x82d5('0xa')]=qs['limit'](_0x1973aa['query']['limit']);_0x3abe36[_0x82d5('0x8')]=qs[_0x82d5('0x8')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x8')]);}return _0x1873d5[_0x82d5('0x38')](_0x3abe36);}})[_0x82d5('0xf')](function(_0x189363){if(_0x189363){return _0x189363?{'count':_0x4241b4,'rows':_0x189363}:null;}})[_0x82d5('0xf')](respondWithResult(_0x37c5d1,null))['catch'](handleError(_0x37c5d1,null));};exports[_0x82d5('0x39')]=function(_0x9b62c0,_0x1d3a13){if(_0x9b62c0[_0x82d5('0x34')]['id']){delete _0x9b62c0[_0x82d5('0x34')]['id'];}return db[_0x82d5('0x17')][_0x82d5('0x3a')]({'where':{'id':_0x9b62c0[_0x82d5('0x35')]['id']}})[_0x82d5('0xf')](handleEntityNotFound(_0x1d3a13,null))[_0x82d5('0xf')](function(_0x36573f){if(_0x36573f){_0x9b62c0['body'][_0x82d5('0x3b')]=_0x36573f['id'];_0x9b62c0[_0x82d5('0x34')][_0x82d5('0x3c')]=integrations[_0x82d5('0x3d')](_0x9b62c0['body'][_0x82d5('0x3e')],_0x9b62c0['body']['type']);_0x9b62c0['body'][_0x82d5('0x3f')]=integrations[_0x82d5('0x40')](_0x9b62c0[_0x82d5('0x34')]['channel'],_0x9b62c0[_0x82d5('0x34')]['type']);return db[_0x82d5('0x36')]['create'](_0x9b62c0[_0x82d5('0x34')],{'include':[{'model':db[_0x82d5('0x41')],'as':_0x82d5('0x3c')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x82d5('0xf')](respondWithResult(_0x1d3a13,null))[_0x82d5('0x31')](handleError(_0x1d3a13,null));};function sanitizeRemoteUri(_0x5c1d2a){var _0x5ade71=_0x5c1d2a[_0x82d5('0x42')](-0x1);if(_0x5ade71==='/')return _0x5c1d2a[_0x82d5('0x43')](0x0,_0x5c1d2a[_0x82d5('0x44')](_0x5ade71));return _0x5c1d2a;}function getWebApiUrl(_0x5cf7f3){return util['format']('%s/api/data/v9.0/',_0x5cf7f3);}exports[_0x82d5('0x45')]=function(_0x2ea849,_0x7a7a4){var _0x5dccb4=_0x2ea849[_0x82d5('0x1c')][_0x82d5('0x46')];var _0x4a226b=_0x5dccb4===_0x82d5('0x47')?_0x82d5('0x48'):_0x82d5('0x49');var _0x443675='';var _0x158918='';var _0x120f8a='';var _0x44845d='';var _0x48e9c1='';var _0x4526af='';var _0x261950='';var _0x57cb83='';var _0x46cb35=[_0x82d5('0x4a'),_0x82d5('0x4b'),'customerid',_0x82d5('0x4c'),_0x82d5('0x4d'),_0x82d5('0x4e'),'phonenumber',_0x82d5('0x4f'),'directioncode',_0x82d5('0x50')];var _0x27b42a=[_0x82d5('0x51'),_0x82d5('0x52'),'actualserviceunits',_0x82d5('0x53'),'contactidname',_0x82d5('0x54'),_0x82d5('0x55'),_0x82d5('0x56'),_0x82d5('0x57'),_0x82d5('0x58'),_0x82d5('0x59'),_0x82d5('0x5a'),_0x82d5('0x5b'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0x82d5('0x5c'),'customeridyominame',_0x82d5('0x5d'),'entitlementidname',_0x82d5('0x5e'),'entityimage_url',_0x82d5('0x5f'),_0x82d5('0x60'),_0x82d5('0x61'),_0x82d5('0x62'),_0x82d5('0x63'),_0x82d5('0x64'),'kbarticleidname',_0x82d5('0x65'),'masteridname',_0x82d5('0x66'),_0x82d5('0x67'),'modifiedbyname',_0x82d5('0x68'),'modifiedon',_0x82d5('0x69'),_0x82d5('0x6a'),'msdyn_incidenttypename',_0x82d5('0x6b'),'numberofchildincidents',_0x82d5('0x6c'),_0x82d5('0x6d'),_0x82d5('0x6e'),_0x82d5('0x6f'),'owneridyominame',_0x82d5('0x70'),_0x82d5('0x71'),_0x82d5('0x72'),_0x82d5('0x73'),'productidname',_0x82d5('0x74'),'resolveby',_0x82d5('0x75'),_0x82d5('0x76'),_0x82d5('0x77'),'responsiblecontactidyominame','sentimentvalue',_0x82d5('0x78'),_0x82d5('0x79'),_0x82d5('0x7a'),_0x82d5('0x7b'),'statuscode','subjectidname','ticketnumber','timezoneruleversionnumber',_0x82d5('0x7c'),'traversedpath',_0x82d5('0x7d'),_0x82d5('0x7e')];var _0x410367=_0x46cb35[_0x82d5('0x7f')](_0x27b42a);return db[_0x82d5('0x17')][_0x82d5('0x3a')]({'where':{'id':_0x2ea849[_0x82d5('0x35')]['id']},'attributes':['id','username',_0x82d5('0x80'),_0x82d5('0x81'),_0x82d5('0x82'),_0x82d5('0x83'),_0x82d5('0x84'),_0x82d5('0x85')],'include':[{'model':db[_0x82d5('0x86')],'as':_0x82d5('0x86'),'attributes':['id',_0x82d5('0x87'),_0x82d5('0x88')]}]})[_0x82d5('0xf')](handleEntityNotFound(_0x7a7a4,null))[_0x82d5('0xf')](function(_0x4bb5c0){if(_0x4bb5c0){if(_0x4bb5c0[_0x82d5('0x85')]){_0x4bb5c0[_0x82d5('0x89')]=_0x4bb5c0[_0x82d5('0x86')][_0x82d5('0x87')];_0x57cb83=sanitizeRemoteUri(_0x4bb5c0[_0x82d5('0x86')]['data7']);_0x261950=getWebApiUrl(_0x57cb83);return _0x4bb5c0;}_0x57cb83=sanitizeRemoteUri(_0x4bb5c0['remoteUri']);_0x261950=getWebApiUrl(_0x57cb83);var _0x439387={'method':_0x82d5('0x8a'),'uri':_0x82d5('0x8b')+_0x4bb5c0[_0x82d5('0x82')]+_0x82d5('0x8c'),'form':{'client_id':_0x4bb5c0[_0x82d5('0x83')],'resource':_0x57cb83,'username':_0x4bb5c0[_0x82d5('0x8d')],'password':_0x4bb5c0[_0x82d5('0x80')],'grant_type':_0x82d5('0x80'),'client_secret':_0x4bb5c0[_0x82d5('0x84')]},'json':!![]};return rp(_0x439387);}})[_0x82d5('0xf')](function(_0x2547c5){_0x4526af=_0x2547c5[_0x82d5('0x89')];var _0x3dc873={'method':'GET','uri':encodeURI(_0x261950+_0x82d5('0x8e')+_0x4a226b+'\x27'),'headers':{'Authorization':_0x82d5('0x8f')+_0x4526af,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x3dc873);})[_0x82d5('0xf')](function(_0xf75509){var _0x128162=_0xf75509[_0x82d5('0x91')][0x0];var _0x5925f6=_0x128162['MetadataId'];var _0x3bfeca={'method':_0x82d5('0x92'),'uri':_0x261950+_0x82d5('0x93')+_0x5925f6+_0x82d5('0x94'),'headers':{'Authorization':'Bearer\x20'+_0x4526af,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3bfeca);})[_0x82d5('0xf')](function(_0xbd40fa){_0x443675=_0xbd40fa;_0x158918=_0x443675['Attributes'];_0x158918=_['remove'](_0x158918,function(_0x412fe6){return!_0x410367['includes'](_0x412fe6[_0x82d5('0x95')]);});var _0x5250cc=[];var _0x1aee4d=[];_0x158918[_0x82d5('0x96')](function(_0x3870a6){if(_0x3870a6[_0x82d5('0x97')]){var _0x1019d4=_0x3870a6[_0x82d5('0x97')][_0x82d5('0x43')](_0x3870a6['@odata.type'][_0x82d5('0x44')]('.')+0x1);if(_0x1019d4===_0x82d5('0x98')){_0x5250cc[_0x82d5('0x99')](getSelectList(_0x261950,_0x5dccb4,_0x1aee4d,_0x443675['MetadataId'],_0x3870a6['MetadataId'],_0x4526af));}}});return Promise[_0x82d5('0x9a')](_0x5250cc);})[_0x82d5('0xf')](function(_0x1d9e0d){_0x120f8a=_0x1d9e0d[0x0];var _0x3b7e4c=[];var _0xd4134b=[];_0x158918[_0x82d5('0x96')](function(_0x2d560b){if(!_['isNil'](_0x2d560b['@odata.type'])){var _0x4e8ce3=_0x2d560b['@odata.type'][_0x82d5('0x43')](_0x2d560b[_0x82d5('0x97')]['lastIndexOf']('.')+0x1);if(_0x4e8ce3===_0x82d5('0x9b')){_0x3b7e4c[_0x82d5('0x99')](getBooleanList(_0x261950,_0x5dccb4,_0xd4134b,_0x443675[_0x82d5('0x9c')],_0x2d560b[_0x82d5('0x9c')],_0x4526af));}}});return Promise['all'](_0x3b7e4c);})['then'](function(_0x145ac0){_0x44845d=_0x145ac0[0x0];var _0x126cad=[];var _0x139c84=[];_0x158918[_0x82d5('0x96')](function(_0x68ef88){if(_0x68ef88[_0x82d5('0x97')]){var _0x444c93=_0x68ef88[_0x82d5('0x97')][_0x82d5('0x43')](_0x68ef88[_0x82d5('0x97')][_0x82d5('0x44')]('.')+0x1);if(_0x444c93==='StringAttributeMetadata'||_0x444c93===_0x82d5('0x9d')||_0x444c93===_0x82d5('0x9e')||_0x444c93===_0x82d5('0x9f')||_0x444c93===_0x82d5('0xa0')||_0x444c93===_0x82d5('0xa1')||_0x444c93===_0x82d5('0xa2')||_0x444c93===_0x82d5('0xa3')||_0x444c93===_0x82d5('0xa4')||_0x444c93==='DecimalAttributeMetadata'){_0x126cad[_0x82d5('0x99')](getInputList(_0x261950,_0x5dccb4,_0x444c93,_0x139c84,_0x443675[_0x82d5('0x9c')],_0x68ef88['MetadataId'],_0x4526af));}}});return Promise[_0x82d5('0x9a')](_0x126cad);})[_0x82d5('0xf')](function(_0x5d93f7){_0x48e9c1=_0x5d93f7[0x0];var _0x4f1a3b=_0x120f8a['concat'](_0x44845d)[_0x82d5('0x7f')](_0x48e9c1);var _0x101243={'count':_0x4f1a3b['length'],'rows':_0x4f1a3b};return _0x101243;})[_0x82d5('0xf')](respondWithResult(_0x7a7a4,null))[_0x82d5('0x31')](function(_0x1ff96e){var _0x2ed80b=_0x2ea849['query'][_0x82d5('0xa5')]?0x1f4:_0x1ff96e[_0x82d5('0xa6')]||0x1f4;logger[_0x82d5('0x11')](_0x1ff96e[_0x82d5('0x12')]);delete _0x1ff96e[_0x82d5('0x13')];if(_0x2ed80b===0x191){_0x2ed80b=0x190;}_0x7a7a4[_0x82d5('0x6')](_0x2ed80b)[_0x82d5('0x14')](_0x2ea849[_0x82d5('0x1c')][_0x82d5('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x1ff96e[_0x82d5('0xa6')]}:_0x1ff96e);});};function getSelectList(_0xf07ef9,_0x781e32,_0x82571f,_0x589ece,_0x29593b,_0x2dceca){var _0x4ef58b={'method':_0x82d5('0x92'),'uri':_0xf07ef9+_0x82d5('0x93')+_0x589ece+_0x82d5('0xa7')+_0x29593b+_0x82d5('0xa8')+_0x82d5('0xa9'),'headers':{'Authorization':_0x82d5('0x8f')+_0x2dceca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ef58b)[_0x82d5('0xf')](function(_0x25398d){var _0x3c1d21=[];var _0x251609=_0x25398d['OptionSet'][_0x82d5('0xaa')];_0x251609[_0x82d5('0x96')](function(_0x46ed75){_0x3c1d21[_0x82d5('0x99')]({'name':_0x46ed75[_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':String(_0x46ed75[_0x82d5('0xad')])});});var _0x3ad1a3={'id':_0x781e32+'_'+_0x25398d[_0x82d5('0x95')],'name':_0x25398d['DisplayName'][_0x82d5('0xac')]['Label'],'custom':![],'options':_0x3c1d21};_0x82571f['push'](_0x3ad1a3);return _0x82571f;});}function getBooleanList(_0x586d1e,_0x242db9,_0x17af8a,_0x24347d,_0x4c8dc7,_0x307c62){var _0x25a8cb={'method':_0x82d5('0x92'),'uri':_0x586d1e+_0x82d5('0x93')+_0x24347d+_0x82d5('0xa7')+_0x4c8dc7+_0x82d5('0xae'),'headers':{'Authorization':_0x82d5('0x8f')+_0x307c62,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x25a8cb)[_0x82d5('0xf')](function(_0xc0e97a){var _0x219178=[];_0x219178[_0x82d5('0x99')]({'name':_0xc0e97a[_0x82d5('0xaf')][_0x82d5('0xb0')][_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':_0x82d5('0xb1')},{'name':_0xc0e97a[_0x82d5('0xaf')]['FalseOption'][_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':'false'});var _0xc83737={'id':_0x242db9+'_'+_0xc0e97a[_0x82d5('0x95')],'name':_0xc0e97a[_0x82d5('0xb2')][_0x82d5('0xac')][_0x82d5('0xab')],'custom':![],'options':_0x219178};_0x17af8a[_0x82d5('0x99')](_0xc83737);return _0x17af8a;});}function getInputList(_0x3ec399,_0x1e682c,_0x42e120,_0x13b748,_0x2e3a0c,_0x5d5e0b,_0x2351c2){var _0x383e08={'method':_0x82d5('0x92'),'uri':_0x3ec399+_0x82d5('0x93')+_0x2e3a0c+_0x82d5('0xa7')+_0x5d5e0b+_0x82d5('0xb3')+_0x42e120+_0x82d5('0xb4'),'headers':{'Authorization':_0x82d5('0x8f')+_0x2351c2,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x383e08)[_0x82d5('0xf')](function(_0x4e5207){var _0x3cbaeb={'id':_0x1e682c+'_'+_0x4e5207['LogicalName'],'name':_0x4e5207[_0x82d5('0xb2')][_0x82d5('0xac')]?_0x4e5207[_0x82d5('0xb2')][_0x82d5('0xac')][_0x82d5('0xab')]:_0x4e5207[_0x82d5('0x95')],'custom':![],'options':[]};_0x13b748['push'](_0x3cbaeb);return _0x13b748;});} \ No newline at end of file +var _0x3f5a=['$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','status','json','offset','undefined','limit','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','count','includeAll','findAll','rows','catch','params','options','create','body','find','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','slice','substring','format','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','directioncode','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','https://login.microsoftonline.com/','tenantId','username','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x3f5a,0x17c));var _0xa3f5=function(_0x245ff8,_0x2e81f8){_0x245ff8=_0x245ff8-0x0;var _0x5a4faa=_0x3f5a[_0x245ff8];return _0x5a4faa;};'use strict';var rp=require(_0xa3f5('0x0'));var util=require(_0xa3f5('0x1'));var _=require(_0xa3f5('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xa3f5('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x182032,_0x4aa87d){_0x4aa87d=_0x4aa87d||0xc8;return function(_0x4a5fa6){if(_0x4a5fa6){return _0x182032[_0xa3f5('0x4')](_0x4aa87d)[_0xa3f5('0x5')](_0x4a5fa6);}};}function respondWithFilteredResult(_0x1d0353,_0x30a42d){return function(_0x579aab){if(_0x579aab){var _0x351124=typeof _0x30a42d[_0xa3f5('0x6')]===_0xa3f5('0x7')&&typeof _0x30a42d[_0xa3f5('0x8')]===_0xa3f5('0x7');var _0x49f8a4=_0x579aab['count'];var _0x328ce7=_0x351124?0x0:_0x30a42d[_0xa3f5('0x6')];var _0x476420=_0x351124?_0x579aab['count']:_0x30a42d[_0xa3f5('0x6')]+_0x30a42d['limit'];var _0x4d5386;if(_0x476420>=_0x49f8a4){_0x476420=_0x49f8a4;_0x4d5386=0xc8;}else{_0x4d5386=0xce;}_0x1d0353[_0xa3f5('0x4')](_0x4d5386);return _0x1d0353['set']('Content-Range',_0x328ce7+'-'+_0x476420+'/'+_0x49f8a4)[_0xa3f5('0x5')](_0x579aab);}return null;};}function saveUpdates(_0x4efa0f){return function(_0x3e445c){if(_0x3e445c){return _0x3e445c[_0xa3f5('0x9')](_0x4efa0f)[_0xa3f5('0xa')](function(_0x22759f){return _0x22759f;});}return null;};}function removeEntity(_0x538a3e){return function(_0x23de5a){if(_0x23de5a){return _0x23de5a['destroy']()[_0xa3f5('0xa')](function(){_0x538a3e['status'](0xcc)[_0xa3f5('0xb')]();});}};}function handleEntityNotFound(_0x36d4a5){return function(_0x345f60){if(!_0x345f60){_0x36d4a5[_0xa3f5('0xc')](0x194);}return _0x345f60;};}function handleError(_0x1db2ad,_0x41ab2f){_0x41ab2f=_0x41ab2f||0x1f4;return function(_0xcf2a5c){logger[_0xa3f5('0xd')](_0xcf2a5c[_0xa3f5('0xe')]);if(_0xcf2a5c['name']){delete _0xcf2a5c[_0xa3f5('0xf')];}_0x1db2ad[_0xa3f5('0x4')](_0x41ab2f)[_0xa3f5('0x10')](_0xcf2a5c);};}exports[_0xa3f5('0x11')]=function(_0x19ea59,_0x5c0884){var _0x46a9c7={},_0x5acde5={},_0x557752={'count':0x0,'rows':[]};var _0x5789c6=_[_0xa3f5('0x12')](db[_0xa3f5('0x13')][_0xa3f5('0x14')],function(_0x2f139c){return{'name':_0x2f139c[_0xa3f5('0x15')],'type':_0x2f139c[_0xa3f5('0x16')][_0xa3f5('0x17')]};});_0x5acde5[_0xa3f5('0x18')]=_[_0xa3f5('0x12')](_0x5789c6,'name');_0x5acde5[_0xa3f5('0x19')]=_[_0xa3f5('0x1a')](_0x19ea59[_0xa3f5('0x19')]);_0x5acde5[_0xa3f5('0x1b')]=_[_0xa3f5('0x1c')](_0x5acde5[_0xa3f5('0x18')],_0x5acde5['query']);_0x46a9c7[_0xa3f5('0x1d')]=_[_0xa3f5('0x1c')](_0x5acde5[_0xa3f5('0x18')],qs['fields'](_0x19ea59[_0xa3f5('0x19')][_0xa3f5('0x1e')]));_0x46a9c7[_0xa3f5('0x1d')]=_0x46a9c7[_0xa3f5('0x1d')][_0xa3f5('0x1f')]?_0x46a9c7['attributes']:_0x5acde5[_0xa3f5('0x18')];if(!_0x19ea59[_0xa3f5('0x19')][_0xa3f5('0x20')]('nolimit')){_0x46a9c7[_0xa3f5('0x8')]=qs[_0xa3f5('0x8')](_0x19ea59['query']['limit']);_0x46a9c7[_0xa3f5('0x6')]=qs[_0xa3f5('0x6')](_0x19ea59[_0xa3f5('0x19')]['offset']);}_0x46a9c7['order']=qs[_0xa3f5('0x21')](_0x19ea59['query'][_0xa3f5('0x21')]);_0x46a9c7[_0xa3f5('0x22')]=qs[_0xa3f5('0x1b')](_[_0xa3f5('0x23')](_0x19ea59[_0xa3f5('0x19')],_0x5acde5[_0xa3f5('0x1b')]),_0x5789c6);if(_0x19ea59[_0xa3f5('0x19')][_0xa3f5('0x24')]){_0x46a9c7[_0xa3f5('0x22')]=_[_0xa3f5('0x25')](_0x46a9c7[_0xa3f5('0x22')],{'$or':_['map'](_0x5789c6,function(_0xdff861){if(_0xdff861[_0xa3f5('0x16')]!=='VIRTUAL'){var _0x161e62={};_0x161e62[_0xdff861[_0xa3f5('0xf')]]={'$like':'%'+_0x19ea59['query'][_0xa3f5('0x24')]+'%'};return _0x161e62;}})});}_0x46a9c7=_[_0xa3f5('0x25')]({},_0x46a9c7,_0x19ea59['options']);var _0x5c2492={'where':_0x46a9c7['where']};return db[_0xa3f5('0x13')]['count'](_0x5c2492)[_0xa3f5('0xa')](function(_0x1c6e67){_0x557752[_0xa3f5('0x26')]=_0x1c6e67;if(_0x19ea59[_0xa3f5('0x19')][_0xa3f5('0x27')]){_0x46a9c7['include']=[{'all':!![]}];}return db[_0xa3f5('0x13')][_0xa3f5('0x28')](_0x46a9c7);})[_0xa3f5('0xa')](function(_0x2fbc21){_0x557752[_0xa3f5('0x29')]=_0x2fbc21;return _0x557752;})[_0xa3f5('0xa')](respondWithFilteredResult(_0x5c0884,_0x46a9c7))[_0xa3f5('0x2a')](handleError(_0x5c0884,null));};exports['show']=function(_0x441d3d,_0x50a5a2){var _0x5c6a97={'raw':![],'where':{'id':_0x441d3d[_0xa3f5('0x2b')]['id']}},_0x5d121c={};_0x5d121c[_0xa3f5('0x18')]=_[_0xa3f5('0x1a')](db[_0xa3f5('0x13')][_0xa3f5('0x14')]);_0x5d121c[_0xa3f5('0x19')]=_[_0xa3f5('0x1a')](_0x441d3d[_0xa3f5('0x19')]);_0x5d121c['filters']=_[_0xa3f5('0x1c')](_0x5d121c[_0xa3f5('0x18')],_0x5d121c[_0xa3f5('0x19')]);_0x5c6a97[_0xa3f5('0x1d')]=_[_0xa3f5('0x1c')](_0x5d121c[_0xa3f5('0x18')],qs[_0xa3f5('0x1e')](_0x441d3d[_0xa3f5('0x19')][_0xa3f5('0x1e')]));_0x5c6a97[_0xa3f5('0x1d')]=_0x5c6a97[_0xa3f5('0x1d')][_0xa3f5('0x1f')]?_0x5c6a97['attributes']:_0x5d121c[_0xa3f5('0x18')];if(_0x441d3d[_0xa3f5('0x19')]['includeAll']){_0x5c6a97['include']=[{'all':!![]}];}_0x5c6a97=_[_0xa3f5('0x25')]({},_0x5c6a97,_0x441d3d[_0xa3f5('0x2c')]);return db[_0xa3f5('0x13')]['find'](_0x5c6a97)[_0xa3f5('0xa')](handleEntityNotFound(_0x50a5a2,null))[_0xa3f5('0xa')](respondWithResult(_0x50a5a2,null))[_0xa3f5('0x2a')](handleError(_0x50a5a2,null));};exports[_0xa3f5('0x2d')]=function(_0x2242e6,_0x29e354){return db['Dynamics365Account'][_0xa3f5('0x2d')](_0x2242e6[_0xa3f5('0x2e')],{})['then'](respondWithResult(_0x29e354,0xc9))[_0xa3f5('0x2a')](handleError(_0x29e354,null));};exports['update']=function(_0x5f32d5,_0x408e39){if(_0x5f32d5[_0xa3f5('0x2e')]['id']){delete _0x5f32d5[_0xa3f5('0x2e')]['id'];}return db['Dynamics365Account'][_0xa3f5('0x2f')]({'where':{'id':_0x5f32d5[_0xa3f5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x408e39,null))[_0xa3f5('0xa')](saveUpdates(_0x5f32d5[_0xa3f5('0x2e')],null))['then'](respondWithResult(_0x408e39,null))[_0xa3f5('0x2a')](handleError(_0x408e39,null));};exports['destroy']=function(_0x316dab,_0x39f014){return db[_0xa3f5('0x13')][_0xa3f5('0x2f')]({'where':{'id':_0x316dab[_0xa3f5('0x2b')]['id']}})[_0xa3f5('0xa')](handleEntityNotFound(_0x39f014,null))['then'](removeEntity(_0x39f014,null))[_0xa3f5('0x2a')](handleError(_0x39f014,null));};exports[_0xa3f5('0x30')]=function(_0x192d5f,_0x2475aa){var _0x179c85={};var _0xed2f1d={};var _0x24b0ef;var _0x1d73c9;return db['Dynamics365Account'][_0xa3f5('0x31')]({'where':{'id':_0x192d5f[_0xa3f5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2475aa,null))[_0xa3f5('0xa')](function(_0x527ea3){if(_0x527ea3){_0x24b0ef=_0x527ea3;_0xed2f1d['model']=_[_0xa3f5('0x1a')](db[_0xa3f5('0x32')][_0xa3f5('0x14')]);_0xed2f1d[_0xa3f5('0x19')]=_[_0xa3f5('0x1a')](_0x192d5f[_0xa3f5('0x19')]);_0xed2f1d[_0xa3f5('0x1b')]=_[_0xa3f5('0x1c')](_0xed2f1d[_0xa3f5('0x18')],_0xed2f1d[_0xa3f5('0x19')]);_0x179c85[_0xa3f5('0x1d')]=_[_0xa3f5('0x1c')](_0xed2f1d[_0xa3f5('0x18')],qs[_0xa3f5('0x1e')](_0x192d5f[_0xa3f5('0x19')][_0xa3f5('0x1e')]));_0x179c85[_0xa3f5('0x1d')]=_0x179c85[_0xa3f5('0x1d')][_0xa3f5('0x1f')]?_0x179c85[_0xa3f5('0x1d')]:_0xed2f1d[_0xa3f5('0x18')];_0x179c85['order']=qs[_0xa3f5('0x21')](_0x192d5f[_0xa3f5('0x19')][_0xa3f5('0x21')]);_0x179c85['where']=qs['filters'](_[_0xa3f5('0x23')](_0x192d5f[_0xa3f5('0x19')],_0xed2f1d[_0xa3f5('0x1b')]));if(_0x192d5f[_0xa3f5('0x19')][_0xa3f5('0x24')]){_0x179c85[_0xa3f5('0x22')]=_[_0xa3f5('0x25')](_0x179c85[_0xa3f5('0x22')],{'$or':_[_0xa3f5('0x12')](_0x179c85[_0xa3f5('0x1d')],function(_0x20ad21){var _0x34823c={};_0x34823c[_0x20ad21]={'$like':'%'+_0x192d5f['query'][_0xa3f5('0x24')]+'%'};return _0x34823c;})});}_0x179c85=_['merge']({},_0x179c85,_0x192d5f[_0xa3f5('0x2c')]);return _0x24b0ef[_0xa3f5('0x30')](_0x179c85);}})[_0xa3f5('0xa')](function(_0x29c690){if(_0x29c690){_0x1d73c9=_0x29c690[_0xa3f5('0x1f')];if(!_0x192d5f[_0xa3f5('0x19')][_0xa3f5('0x20')](_0xa3f5('0x33'))){_0x179c85[_0xa3f5('0x8')]=qs[_0xa3f5('0x8')](_0x192d5f['query'][_0xa3f5('0x8')]);_0x179c85[_0xa3f5('0x6')]=qs[_0xa3f5('0x6')](_0x192d5f[_0xa3f5('0x19')][_0xa3f5('0x6')]);}return _0x24b0ef['getConfigurations'](_0x179c85);}})['then'](function(_0xddff73){if(_0xddff73){return _0xddff73?{'count':_0x1d73c9,'rows':_0xddff73}:null;}})[_0xa3f5('0xa')](respondWithResult(_0x2475aa,null))[_0xa3f5('0x2a')](handleError(_0x2475aa,null));};exports[_0xa3f5('0x34')]=function(_0x14f62d,_0x161928){if(_0x14f62d[_0xa3f5('0x2e')]['id']){delete _0x14f62d[_0xa3f5('0x2e')]['id'];}return db[_0xa3f5('0x13')][_0xa3f5('0x31')]({'where':{'id':_0x14f62d[_0xa3f5('0x2b')]['id']}})[_0xa3f5('0xa')](handleEntityNotFound(_0x161928,null))[_0xa3f5('0xa')](function(_0x36541d){if(_0x36541d){_0x14f62d[_0xa3f5('0x2e')][_0xa3f5('0x35')]=_0x36541d['id'];_0x14f62d['body']['Subjects']=integrations[_0xa3f5('0x36')](_0x14f62d[_0xa3f5('0x2e')][_0xa3f5('0x37')],_0x14f62d[_0xa3f5('0x2e')][_0xa3f5('0x16')]);_0x14f62d[_0xa3f5('0x2e')][_0xa3f5('0x38')]=integrations['getDescriptions'](_0x14f62d[_0xa3f5('0x2e')]['channel'],_0x14f62d['body'][_0xa3f5('0x16')]);return db[_0xa3f5('0x32')]['create'](_0x14f62d[_0xa3f5('0x2e')],{'include':[{'model':db[_0xa3f5('0x39')],'as':_0xa3f5('0x3a')},{'model':db[_0xa3f5('0x39')],'as':_0xa3f5('0x38')}]});}return null;})[_0xa3f5('0xa')](respondWithResult(_0x161928,null))[_0xa3f5('0x2a')](handleError(_0x161928,null));};function sanitizeRemoteUri(_0x51105d){var _0x2a98c7=_0x51105d[_0xa3f5('0x3b')](-0x1);if(_0x2a98c7==='/')return _0x51105d[_0xa3f5('0x3c')](0x0,_0x51105d['lastIndexOf'](_0x2a98c7));return _0x51105d;}function getWebApiUrl(_0xbd6a67){return util[_0xa3f5('0x3d')]('%s/api/data/v9.0/',_0xbd6a67);}exports[_0xa3f5('0x3e')]=function(_0x14579e,_0x33907f){var _0x21ae5a=_0x14579e[_0xa3f5('0x19')][_0xa3f5('0x3f')];var _0x42c88f=_0x21ae5a===_0xa3f5('0x40')?_0xa3f5('0x41'):_0xa3f5('0x42');var _0x4a7234='';var _0x5059c9='';var _0x5c0d26='';var _0x372ae1='';var _0x151248='';var _0x1c309f='';var _0x18a0a7='';var _0x52a2b6='';var _0x49a2ae=[_0xa3f5('0x43'),_0xa3f5('0x44'),_0xa3f5('0x45'),_0xa3f5('0x46'),'caseorigincode',_0xa3f5('0x47'),_0xa3f5('0x48'),'regardingobjectid',_0xa3f5('0x49'),'phonecall_activity_parties'];var _0x5bbc8e=[_0xa3f5('0x4a'),_0xa3f5('0x4b'),'actualserviceunits',_0xa3f5('0x4c'),_0xa3f5('0x4d'),_0xa3f5('0x4e'),_0xa3f5('0x4f'),_0xa3f5('0x50'),_0xa3f5('0x51'),_0xa3f5('0x52'),_0xa3f5('0x53'),_0xa3f5('0x54'),'createdon',_0xa3f5('0x55'),_0xa3f5('0x56'),_0xa3f5('0x57'),_0xa3f5('0x58'),'customeridyominame',_0xa3f5('0x59'),_0xa3f5('0x5a'),_0xa3f5('0x5b'),_0xa3f5('0x5c'),_0xa3f5('0x5d'),'exchangerate',_0xa3f5('0x5e'),_0xa3f5('0x5f'),'importsequencenumber',_0xa3f5('0x60'),_0xa3f5('0x61'),_0xa3f5('0x62'),_0xa3f5('0x63'),'modifiedbyexternalpartyname',_0xa3f5('0x64'),_0xa3f5('0x65'),_0xa3f5('0x66'),'modifiedon',_0xa3f5('0x67'),_0xa3f5('0x68'),_0xa3f5('0x69'),_0xa3f5('0x6a'),_0xa3f5('0x6b'),_0xa3f5('0x6c'),_0xa3f5('0x6d'),_0xa3f5('0x6e'),_0xa3f5('0x6f'),_0xa3f5('0x70'),_0xa3f5('0x71'),_0xa3f5('0x72'),'primarycontactidyominame',_0xa3f5('0x73'),_0xa3f5('0x74'),'productserialnumber',_0xa3f5('0x75'),'resolvebykpiidname',_0xa3f5('0x76'),'responsiblecontactidname',_0xa3f5('0x77'),_0xa3f5('0x78'),_0xa3f5('0x79'),_0xa3f5('0x7a'),_0xa3f5('0x7b'),'statecode',_0xa3f5('0x7c'),'subjectidname',_0xa3f5('0x7d'),'timezoneruleversionnumber',_0xa3f5('0x7e'),_0xa3f5('0x7f'),_0xa3f5('0x80'),_0xa3f5('0x81')];var _0x1939c8=_0x49a2ae[_0xa3f5('0x82')](_0x5bbc8e);return db[_0xa3f5('0x13')][_0xa3f5('0x31')]({'where':{'id':_0x14579e[_0xa3f5('0x2b')]['id']},'attributes':['id','username',_0xa3f5('0x83'),_0xa3f5('0x84'),'tenantId',_0xa3f5('0x85'),_0xa3f5('0x86'),_0xa3f5('0x87')],'include':[{'model':db[_0xa3f5('0x88')],'as':_0xa3f5('0x88'),'attributes':['id',_0xa3f5('0x89'),'data7']}]})['then'](handleEntityNotFound(_0x33907f,null))[_0xa3f5('0xa')](function(_0x91ad38){if(_0x91ad38){if(_0x91ad38['modernAuthentication']){_0x91ad38[_0xa3f5('0x8a')]=_0x91ad38[_0xa3f5('0x88')][_0xa3f5('0x89')];_0x52a2b6=sanitizeRemoteUri(_0x91ad38[_0xa3f5('0x88')]['data7']);_0x18a0a7=getWebApiUrl(_0x52a2b6);return _0x91ad38;}_0x52a2b6=sanitizeRemoteUri(_0x91ad38['remoteUri']);_0x18a0a7=getWebApiUrl(_0x52a2b6);var _0x157f54={'method':'POST','uri':_0xa3f5('0x8b')+_0x91ad38[_0xa3f5('0x8c')]+'/oauth2/token','form':{'client_id':_0x91ad38[_0xa3f5('0x85')],'resource':_0x52a2b6,'username':_0x91ad38[_0xa3f5('0x8d')],'password':_0x91ad38[_0xa3f5('0x83')],'grant_type':_0xa3f5('0x83'),'client_secret':_0x91ad38[_0xa3f5('0x86')]},'json':!![]};return rp(_0x157f54);}})[_0xa3f5('0xa')](function(_0x1584c3){_0x1c309f=_0x1584c3[_0xa3f5('0x8a')];var _0x23e462={'method':'GET','uri':encodeURI(_0x18a0a7+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x42c88f+'\x27'),'headers':{'Authorization':_0xa3f5('0x8e')+_0x1c309f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23e462);})[_0xa3f5('0xa')](function(_0x379be5){var _0x82992=_0x379be5[_0xa3f5('0x8f')][0x0];var _0x5b7694=_0x82992[_0xa3f5('0x90')];var _0x8d3869={'method':_0xa3f5('0x91'),'uri':_0x18a0a7+_0xa3f5('0x92')+_0x5b7694+_0xa3f5('0x93'),'headers':{'Authorization':_0xa3f5('0x8e')+_0x1c309f,'If-None-Match':null,'OData-Version':_0xa3f5('0x94')},'json':!![]};return rp(_0x8d3869);})['then'](function(_0x976cdc){_0x4a7234=_0x976cdc;_0x5059c9=_0x4a7234[_0xa3f5('0x95')];_0x5059c9=_['remove'](_0x5059c9,function(_0x7ea84e){return!_0x1939c8[_0xa3f5('0x96')](_0x7ea84e[_0xa3f5('0x97')]);});var _0x2b9043=[];var _0x2ee366=[];_0x5059c9[_0xa3f5('0x98')](function(_0x55d971){if(_0x55d971[_0xa3f5('0x99')]){var _0x2bcb9b=_0x55d971[_0xa3f5('0x99')][_0xa3f5('0x3c')](_0x55d971[_0xa3f5('0x99')][_0xa3f5('0x9a')]('.')+0x1);if(_0x2bcb9b===_0xa3f5('0x9b')){_0x2b9043[_0xa3f5('0x9c')](getSelectList(_0x18a0a7,_0x21ae5a,_0x2ee366,_0x4a7234[_0xa3f5('0x90')],_0x55d971[_0xa3f5('0x90')],_0x1c309f));}}});return Promise[_0xa3f5('0x9d')](_0x2b9043);})[_0xa3f5('0xa')](function(_0x57ad85){_0x5c0d26=_0x57ad85[0x0];var _0x51dad9=[];var _0x5ef7a4=[];_0x5059c9[_0xa3f5('0x98')](function(_0x454cfa){if(!_['isNil'](_0x454cfa[_0xa3f5('0x99')])){var _0xa66d63=_0x454cfa[_0xa3f5('0x99')]['substring'](_0x454cfa['@odata.type'][_0xa3f5('0x9a')]('.')+0x1);if(_0xa66d63===_0xa3f5('0x9e')){_0x51dad9[_0xa3f5('0x9c')](getBooleanList(_0x18a0a7,_0x21ae5a,_0x5ef7a4,_0x4a7234[_0xa3f5('0x90')],_0x454cfa[_0xa3f5('0x90')],_0x1c309f));}}});return Promise[_0xa3f5('0x9d')](_0x51dad9);})[_0xa3f5('0xa')](function(_0x1db462){_0x372ae1=_0x1db462[0x0];var _0x5554a1=[];var _0x4f7ec9=[];_0x5059c9['forEach'](function(_0x26d67f){if(_0x26d67f[_0xa3f5('0x99')]){var _0x3b4bab=_0x26d67f['@odata.type']['substring'](_0x26d67f[_0xa3f5('0x99')][_0xa3f5('0x9a')]('.')+0x1);if(_0x3b4bab===_0xa3f5('0x9f')||_0x3b4bab===_0xa3f5('0xa0')||_0x3b4bab===_0xa3f5('0xa1')||_0x3b4bab===_0xa3f5('0xa2')||_0x3b4bab==='MemoAttributeMetadata'||_0x3b4bab===_0xa3f5('0xa3')||_0x3b4bab===_0xa3f5('0xa4')||_0x3b4bab===_0xa3f5('0xa5')||_0x3b4bab==='StateAttributeMetadata'||_0x3b4bab===_0xa3f5('0xa6')){_0x5554a1['push'](getInputList(_0x18a0a7,_0x21ae5a,_0x3b4bab,_0x4f7ec9,_0x4a7234[_0xa3f5('0x90')],_0x26d67f['MetadataId'],_0x1c309f));}}});return Promise['all'](_0x5554a1);})[_0xa3f5('0xa')](function(_0x5bcd79){_0x151248=_0x5bcd79[0x0];var _0x2ac50b=_0x5c0d26[_0xa3f5('0x82')](_0x372ae1)[_0xa3f5('0x82')](_0x151248);var _0x4c84f9={'count':_0x2ac50b[_0xa3f5('0x1f')],'rows':_0x2ac50b};return _0x4c84f9;})[_0xa3f5('0xa')](respondWithResult(_0x33907f,null))['catch'](function(_0x66c790){var _0x34a55d=_0x14579e['query'][_0xa3f5('0xa7')]?0x1f4:_0x66c790[_0xa3f5('0xa8')]||0x1f4;logger[_0xa3f5('0xd')](_0x66c790[_0xa3f5('0xe')]);delete _0x66c790[_0xa3f5('0xf')];if(_0x34a55d===0x191){_0x34a55d=0x190;}_0x33907f[_0xa3f5('0x4')](_0x34a55d)[_0xa3f5('0x10')](_0x14579e[_0xa3f5('0x19')][_0xa3f5('0xa7')]?{'message':_0xa3f5('0xa9'),'statusCode':_0x66c790[_0xa3f5('0xa8')]}:_0x66c790);});};function getSelectList(_0x27b0b8,_0x439595,_0x251951,_0x348187,_0x957b3b,_0x80e17d){var _0x19f180={'method':_0xa3f5('0x91'),'uri':_0x27b0b8+_0xa3f5('0x92')+_0x348187+_0xa3f5('0xaa')+_0x957b3b+_0xa3f5('0xab')+_0xa3f5('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x80e17d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x19f180)['then'](function(_0x3211ea){var _0x5f44c3=[];var _0x2dccc7=_0x3211ea['OptionSet'][_0xa3f5('0xad')];_0x2dccc7[_0xa3f5('0x98')](function(_0xe34589){_0x5f44c3[_0xa3f5('0x9c')]({'name':_0xe34589[_0xa3f5('0xae')][_0xa3f5('0xaf')]['Label'],'value':String(_0xe34589[_0xa3f5('0xb0')])});});var _0x52b0ea={'id':_0x439595+'_'+_0x3211ea[_0xa3f5('0x97')],'name':_0x3211ea[_0xa3f5('0xb1')][_0xa3f5('0xaf')][_0xa3f5('0xae')],'custom':![],'options':_0x5f44c3};_0x251951[_0xa3f5('0x9c')](_0x52b0ea);return _0x251951;});}function getBooleanList(_0x183840,_0x3302a0,_0x32f75f,_0x1235c5,_0x8cd660,_0x191247){var _0x464761={'method':'GET','uri':_0x183840+_0xa3f5('0x92')+_0x1235c5+_0xa3f5('0xaa')+_0x8cd660+_0xa3f5('0xb2'),'headers':{'Authorization':_0xa3f5('0x8e')+_0x191247,'If-None-Match':null,'OData-Version':_0xa3f5('0x94')},'json':!![]};return rp(_0x464761)[_0xa3f5('0xa')](function(_0x237a2b){var _0x47f89a=[];_0x47f89a[_0xa3f5('0x9c')]({'name':_0x237a2b['OptionSet'][_0xa3f5('0xb3')][_0xa3f5('0xae')][_0xa3f5('0xaf')][_0xa3f5('0xae')],'value':_0xa3f5('0xb4')},{'name':_0x237a2b[_0xa3f5('0xb5')][_0xa3f5('0xb6')][_0xa3f5('0xae')]['UserLocalizedLabel'][_0xa3f5('0xae')],'value':'false'});var _0x122ec5={'id':_0x3302a0+'_'+_0x237a2b[_0xa3f5('0x97')],'name':_0x237a2b[_0xa3f5('0xb1')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x47f89a};_0x32f75f['push'](_0x122ec5);return _0x32f75f;});}function getInputList(_0x59ebb0,_0x279622,_0x1a7d70,_0x4d59e2,_0x452fda,_0x276b0a,_0x3aed98){var _0x18baca={'method':_0xa3f5('0x91'),'uri':_0x59ebb0+'EntityDefinitions('+_0x452fda+_0xa3f5('0xaa')+_0x276b0a+_0xa3f5('0xb7')+_0x1a7d70+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa3f5('0x8e')+_0x3aed98,'If-None-Match':null,'OData-Version':_0xa3f5('0x94')},'json':!![]};return rp(_0x18baca)[_0xa3f5('0xa')](function(_0x520b62){var _0xf87ee5={'id':_0x279622+'_'+_0x520b62[_0xa3f5('0x97')],'name':_0x520b62[_0xa3f5('0xb1')][_0xa3f5('0xaf')]?_0x520b62[_0xa3f5('0xb1')][_0xa3f5('0xaf')][_0xa3f5('0xae')]:_0x520b62[_0xa3f5('0x97')],'custom':![],'options':[]};_0x4d59e2[_0xa3f5('0x9c')](_0xf87ee5);return _0x4d59e2;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 6ac537c..1984120 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0xc264cd,_0xb3b7aa){var _0x45eb57=function(_0x39f6d3){while(--_0x39f6d3){_0xc264cd['push'](_0xc264cd['shift']());}};_0x45eb57(++_0xb3b7aa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2a4aa9,_0x3d4201){var _0x12be74=function(_0x5accc5){while(--_0x5accc5){_0x2a4aa9['push'](_0x2a4aa9['shift']());}};_0x12be74(++_0x3d4201);}(_0x757a,0xde));var _0xa757=function(_0x2f4599,_0x2bea36){_0x2f4599=_0x2f4599-0x0;var _0x33e51f=_0x757a[_0x2f4599];return _0x33e51f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 44d646d..1161f29 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 _0xb344=['../../config/utils','rpc','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','model','include','map','attributes','info','catch','find','ShowDynamics365Account','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0xb344,0x113));var _0x4b34=function(_0x40b7ec,_0x307707){_0x40b7ec=_0x40b7ec-0x0;var _0x72b976=_0xb344[_0x40b7ec];return _0x72b976;};'use strict';var _=require(_0x4b34('0x0'));var util=require('util');var moment=require(_0x4b34('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b34('0x2'));var fs=require('fs');var Redis=require(_0x4b34('0x3'));var db=require(_0x4b34('0x4'))['db'];var utils=require(_0x4b34('0x5'));var logger=require('../../config/logger')(_0x4b34('0x6'));var config=require('../../config/environment');var jayson=require(_0x4b34('0x7'));var client=jayson[_0x4b34('0x8')][_0x4b34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x325195,_0x573954,_0xa57069){return new BPromise(function(_0x35ff52,_0x1fa956){return client[_0x4b34('0xa')](_0x325195,_0xa57069)[_0x4b34('0xb')](function(_0x408c14){logger['info'](_0x4b34('0xc'),_0x573954,_0x4b34('0xd'));logger[_0x4b34('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x573954,'request\x20sent',JSON[_0x4b34('0xf')](_0x408c14));if(_0x408c14[_0x4b34('0x10')]){if(_0x408c14[_0x4b34('0x10')][_0x4b34('0x11')]===0x1f4){logger['error'](_0x4b34('0xc'),_0x573954,_0x408c14[_0x4b34('0x10')]['message']);return _0x1fa956(_0x408c14[_0x4b34('0x10')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x573954,_0x408c14['error'][_0x4b34('0x12')]);return _0x35ff52(_0x408c14['error'][_0x4b34('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x573954,_0x4b34('0xd'));_0x35ff52(_0x408c14[_0x4b34('0x13')][_0x4b34('0x12')]);}})['catch'](function(_0x3f8346){logger['error'](_0x4b34('0xc'),_0x573954,_0x3f8346);_0x1fa956(_0x3f8346);});});}exports[_0x4b34('0x14')]=function(_0x3ade19){var _0x32aeb8=this;return new Promise(function(_0x1142be,_0x19c0fe){return db[_0x4b34('0x15')][_0x4b34('0x16')]({'raw':_0x3ade19[_0x4b34('0x17')]?_0x3ade19['options'][_0x4b34('0x18')]===undefined?!![]:![]:!![],'where':_0x3ade19['options']?_0x3ade19['options'][_0x4b34('0x19')]||null:null,'attributes':_0x3ade19['options']?_0x3ade19[_0x4b34('0x17')]['attributes']||null:null,'limit':_0x3ade19[_0x4b34('0x17')]?_0x3ade19['options'][_0x4b34('0x1a')]||null:null,'include':_0x3ade19[_0x4b34('0x17')]?_0x3ade19[_0x4b34('0x17')]['include']?_['map'](_0x3ade19['options']['include'],function(_0x106c76){return{'model':db[_0x106c76[_0x4b34('0x1b')]],'as':_0x106c76['as'],'attributes':_0x106c76['attributes'],'include':_0x106c76[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x106c76['include'],function(_0x187ff6){return{'model':db[_0x187ff6[_0x4b34('0x1b')]],'as':_0x187ff6['as'],'attributes':_0x187ff6[_0x4b34('0x1e')],'include':_0x187ff6[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x187ff6[_0x4b34('0x1c')],function(_0x5cb893){return{'model':db[_0x5cb893[_0x4b34('0x1b')]],'as':_0x5cb893['as'],'attributes':_0x5cb893[_0x4b34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b34('0xb')](function(_0x1f5f94){logger[_0x4b34('0x1f')](_0x4b34('0x14'),_0x3ade19);logger['debug']('GetDynamics365Account',_0x3ade19,JSON[_0x4b34('0xf')](_0x1f5f94));_0x1142be(_0x1f5f94);})[_0x4b34('0x20')](function(_0x2d794f){logger['error'](_0x4b34('0x14'),_0x2d794f['message'],_0x3ade19);_0x19c0fe(_0x32aeb8['error'](0x1f4,_0x2d794f[_0x4b34('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x33bd00){var _0x2b7ece=this;return new Promise(function(_0x431272,_0x4cbe94){return db['Dynamics365Account'][_0x4b34('0x21')]({'raw':_0x33bd00['options']?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x18')]===undefined?!![]:![]:!![],'where':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x19')]||null:null,'attributes':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')]['attributes']||null:null,'include':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x33bd00[_0x4b34('0x17')][_0x4b34('0x1c')],function(_0x5cfc53){return{'model':db[_0x5cfc53[_0x4b34('0x1b')]],'as':_0x5cfc53['as'],'attributes':_0x5cfc53['attributes'],'include':_0x5cfc53[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x5cfc53['include'],function(_0xd39a0c){return{'model':db[_0xd39a0c[_0x4b34('0x1b')]],'as':_0xd39a0c['as'],'attributes':_0xd39a0c['attributes'],'include':_0xd39a0c[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0xd39a0c[_0x4b34('0x1c')],function(_0x588d5d){return{'model':db[_0x588d5d[_0x4b34('0x1b')]],'as':_0x588d5d['as'],'attributes':_0x588d5d[_0x4b34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b34('0xb')](function(_0x4a7aab){logger[_0x4b34('0x1f')](_0x4b34('0x22'),_0x33bd00);logger['debug'](_0x4b34('0x22'),_0x33bd00,JSON['stringify'](_0x4a7aab));_0x431272(_0x4a7aab);})[_0x4b34('0x20')](function(_0x56bfe1){logger[_0x4b34('0x10')](_0x4b34('0x22'),_0x56bfe1['message'],_0x33bd00);_0x4cbe94(_0x2b7ece[_0x4b34('0x10')](0x1f4,_0x56bfe1[_0x4b34('0x12')]));});});}; \ No newline at end of file +var _0x54c7=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','debug','ShowDynamics365Account','find','lodash','moment','bluebird'];(function(_0x3c2701,_0x119d6e){var _0x570f77=function(_0x522811){while(--_0x522811){_0x3c2701['push'](_0x3c2701['shift']());}};_0x570f77(++_0x119d6e);}(_0x54c7,0x138));var _0x754c=function(_0x17d451,_0x447b31){_0x17d451=_0x17d451-0x0;var _0x3cb4bc=_0x54c7[_0x17d451];return _0x3cb4bc;};'use strict';var _=require(_0x754c('0x0'));var util=require('util');var moment=require(_0x754c('0x1'));var BPromise=require(_0x754c('0x2'));var rs=require(_0x754c('0x3'));var fs=require('fs');var Redis=require(_0x754c('0x4'));var db=require(_0x754c('0x5'))['db'];var utils=require(_0x754c('0x6'));var logger=require('../../config/logger')(_0x754c('0x7'));var config=require('../../config/environment');var jayson=require(_0x754c('0x8'));var client=jayson[_0x754c('0x9')][_0x754c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213f8c,_0x2d7830,_0x28b6fb){return new BPromise(function(_0x126831,_0x11009b){return client[_0x754c('0xb')](_0x213f8c,_0x28b6fb)[_0x754c('0xc')](function(_0x1df897){logger[_0x754c('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x2d7830,_0x754c('0xe'));logger['debug'](_0x754c('0xf'),_0x2d7830,_0x754c('0xe'),JSON[_0x754c('0x10')](_0x1df897));if(_0x1df897[_0x754c('0x11')]){if(_0x1df897[_0x754c('0x11')][_0x754c('0x12')]===0x1f4){logger['error'](_0x754c('0x13'),_0x2d7830,_0x1df897[_0x754c('0x11')]['message']);return _0x11009b(_0x1df897[_0x754c('0x11')][_0x754c('0x14')]);}logger['error'](_0x754c('0x13'),_0x2d7830,_0x1df897[_0x754c('0x11')][_0x754c('0x14')]);return _0x126831(_0x1df897[_0x754c('0x11')][_0x754c('0x14')]);}else{logger[_0x754c('0xd')](_0x754c('0x13'),_0x2d7830,_0x754c('0xe'));_0x126831(_0x1df897[_0x754c('0x15')][_0x754c('0x14')]);}})[_0x754c('0x16')](function(_0x1e25ab){logger[_0x754c('0x11')](_0x754c('0x13'),_0x2d7830,_0x1e25ab);_0x11009b(_0x1e25ab);});});}exports[_0x754c('0x17')]=function(_0x20fe2c){var _0xd01ab6=this;return new Promise(function(_0x57a031,_0x575133){return db['Dynamics365Account'][_0x754c('0x18')]({'raw':_0x20fe2c['options']?_0x20fe2c[_0x754c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20fe2c['options']?_0x20fe2c['options'][_0x754c('0x1a')]||null:null,'attributes':_0x20fe2c[_0x754c('0x19')]?_0x20fe2c[_0x754c('0x19')][_0x754c('0x1b')]||null:null,'limit':_0x20fe2c['options']?_0x20fe2c[_0x754c('0x19')][_0x754c('0x1c')]||null:null,'include':_0x20fe2c['options']?_0x20fe2c[_0x754c('0x19')][_0x754c('0x1d')]?_[_0x754c('0x1e')](_0x20fe2c[_0x754c('0x19')][_0x754c('0x1d')],function(_0x2fea5c){return{'model':db[_0x2fea5c['model']],'as':_0x2fea5c['as'],'attributes':_0x2fea5c[_0x754c('0x1b')],'include':_0x2fea5c[_0x754c('0x1d')]?_['map'](_0x2fea5c['include'],function(_0x3a0b82){return{'model':db[_0x3a0b82[_0x754c('0x1f')]],'as':_0x3a0b82['as'],'attributes':_0x3a0b82[_0x754c('0x1b')],'include':_0x3a0b82[_0x754c('0x1d')]?_[_0x754c('0x1e')](_0x3a0b82[_0x754c('0x1d')],function(_0x1f3098){return{'model':db[_0x1f3098[_0x754c('0x1f')]],'as':_0x1f3098['as'],'attributes':_0x1f3098[_0x754c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x754c('0xc')](function(_0x5d2155){logger[_0x754c('0xd')](_0x754c('0x17'),_0x20fe2c);logger[_0x754c('0x20')](_0x754c('0x17'),_0x20fe2c,JSON['stringify'](_0x5d2155));_0x57a031(_0x5d2155);})[_0x754c('0x16')](function(_0x37648e){logger[_0x754c('0x11')]('GetDynamics365Account',_0x37648e[_0x754c('0x14')],_0x20fe2c);_0x575133(_0xd01ab6[_0x754c('0x11')](0x1f4,_0x37648e['message']));});});};exports[_0x754c('0x21')]=function(_0x380e67){var _0x361081=this;return new Promise(function(_0x3c713b,_0x18b780){return db['Dynamics365Account'][_0x754c('0x22')]({'raw':_0x380e67[_0x754c('0x19')]?_0x380e67['options']['raw']===undefined?!![]:![]:!![],'where':_0x380e67[_0x754c('0x19')]?_0x380e67[_0x754c('0x19')][_0x754c('0x1a')]||null:null,'attributes':_0x380e67[_0x754c('0x19')]?_0x380e67[_0x754c('0x19')]['attributes']||null:null,'include':_0x380e67[_0x754c('0x19')]?_0x380e67[_0x754c('0x19')][_0x754c('0x1d')]?_['map'](_0x380e67[_0x754c('0x19')][_0x754c('0x1d')],function(_0x2dc8e1){return{'model':db[_0x2dc8e1[_0x754c('0x1f')]],'as':_0x2dc8e1['as'],'attributes':_0x2dc8e1[_0x754c('0x1b')],'include':_0x2dc8e1[_0x754c('0x1d')]?_[_0x754c('0x1e')](_0x2dc8e1[_0x754c('0x1d')],function(_0x58ec68){return{'model':db[_0x58ec68[_0x754c('0x1f')]],'as':_0x58ec68['as'],'attributes':_0x58ec68[_0x754c('0x1b')],'include':_0x58ec68[_0x754c('0x1d')]?_[_0x754c('0x1e')](_0x58ec68[_0x754c('0x1d')],function(_0x29ee4c){return{'model':db[_0x29ee4c['model']],'as':_0x29ee4c['as'],'attributes':_0x29ee4c[_0x754c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1944a2){logger[_0x754c('0xd')]('ShowDynamics365Account',_0x380e67);logger[_0x754c('0x20')](_0x754c('0x21'),_0x380e67,JSON[_0x754c('0x10')](_0x1944a2));_0x3c713b(_0x1944a2);})[_0x754c('0x16')](function(_0x1d0525){logger['error'](_0x754c('0x21'),_0x1d0525['message'],_0x380e67);_0x18b780(_0x361081[_0x754c('0x11')](0x1f4,_0x1d0525['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c30c943..456b6b8 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 _0x7e74=['index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e74,0xbd));var _0x47e7=function(_0x31a62a,_0x56d90e){_0x31a62a=_0x31a62a-0x0;var _0x5d696a=_0x7e74[_0x31a62a];return _0x5d696a;};'use strict';var multer=require(_0x47e7('0x0'));var util=require('util');var path=require(_0x47e7('0x1'));var timeout=require(_0x47e7('0x2'));var express=require(_0x47e7('0x3'));var router=express[_0x47e7('0x4')]();var fs_extra=require(_0x47e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47e7('0x6'));var config=require(_0x47e7('0x7'));var controller=require(_0x47e7('0x8'));router[_0x47e7('0x9')]('/',auth[_0x47e7('0xa')](),controller[_0x47e7('0xb')]);router[_0x47e7('0x9')]('/:id',auth[_0x47e7('0xa')](),controller['show']);router[_0x47e7('0x9')](_0x47e7('0xc'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xd')]);router[_0x47e7('0x9')](_0x47e7('0xe'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xf')]);router[_0x47e7('0x9')](_0x47e7('0x10'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x11')]);router[_0x47e7('0x12')]('/',auth['isAuthenticated'](),controller[_0x47e7('0x13')]);router[_0x47e7('0x14')](_0x47e7('0x15'),auth['isAuthenticated'](),controller[_0x47e7('0x16')]);router[_0x47e7('0x17')](_0x47e7('0x15'),auth[_0x47e7('0xa')](),controller['destroy']);module[_0x47e7('0x18')]=router; \ No newline at end of file +var _0x9296=['getFields','get','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x56d110,_0x1d6665){var _0x209daf=function(_0xda50b){while(--_0xda50b){_0x56d110['push'](_0x56d110['shift']());}};_0x209daf(++_0x1d6665);}(_0x9296,0x10d));var _0x6929=function(_0x4d4db3,_0x779102){_0x4d4db3=_0x4d4db3-0x0;var _0x3989f9=_0x9296[_0x4d4db3];return _0x3989f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6929('0x0'));var timeout=require('connect-timeout');var express=require(_0x6929('0x1'));var router=express[_0x6929('0x2')]();var fs_extra=require(_0x6929('0x3'));var auth=require(_0x6929('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6929('0x5'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x6929('0x6')](),controller[_0x6929('0x7')]);router['get'](_0x6929('0x8'),auth[_0x6929('0x6')](),controller[_0x6929('0x9')]);router['get'](_0x6929('0xa'),auth[_0x6929('0x6')](),controller[_0x6929('0xb')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x6929('0xc')](_0x6929('0xd'),auth['isAuthenticated'](),controller[_0x6929('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6929('0xf')]);router['put'](_0x6929('0x8'),auth['isAuthenticated'](),controller[_0x6929('0x10')]);router[_0x6929('0x11')](_0x6929('0x8'),auth[_0x6929('0x6')](),controller[_0x6929('0x12')]);module[_0x6929('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ea2ad5c..ab0a376 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 _0x126b=['BOOLEAN','exports','STRING','incident','phonecall','nothing','contact'];(function(_0x2cdf66,_0x530f7f){var _0x5af684=function(_0x3a2d69){while(--_0x3a2d69){_0x2cdf66['push'](_0x2cdf66['shift']());}};_0x5af684(++_0x530f7f);}(_0x126b,0x94));var _0xb126=function(_0x3296d4,_0x289af3){_0x3296d4=_0x3296d4-0x0;var _0x42164d=_0x126b[_0x3296d4];return _0x42164d;};'use strict';var Sequelize=require('sequelize');module[_0xb126('0x0')]={'name':{'type':Sequelize[_0xb126('0x1')]},'description':{'type':Sequelize[_0xb126('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xb126('0x2'),_0xb126('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xb126('0x4')),'defaultValue':_0xb126('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb126('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xb126('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x782e=['exports','STRING','ENUM','phonecall','incident','contact','nothing','BOOLEAN','sequelize'];(function(_0x201cd0,_0x50f50b){var _0x1e44cb=function(_0x216aa7){while(--_0x216aa7){_0x201cd0['push'](_0x201cd0['shift']());}};_0x1e44cb(++_0x50f50b);}(_0x782e,0x1ee));var _0xe782=function(_0x49218c,_0x264921){_0x49218c=_0x49218c-0x0;var _0x5b955e=_0x782e[_0x49218c];return _0x5b955e;};'use strict';var Sequelize=require(_0xe782('0x0'));module[_0xe782('0x1')]={'name':{'type':Sequelize[_0xe782('0x2')]},'description':{'type':Sequelize[_0xe782('0x2')]},'ticketType':{'type':Sequelize[_0xe782('0x3')]('incident',_0xe782('0x4')),'defaultValue':_0xe782('0x5')},'moduleCreate':{'type':Sequelize[_0xe782('0x3')](_0xe782('0x6'),_0xe782('0x7')),'defaultValue':_0xe782('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe782('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe782('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index eb2495d..f0cb55c 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 _0x9e47=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','getFields','Dynamics365Field','filter','getSubjects','findOne','getDescriptions'];(function(_0x841f96,_0xc747f2){var _0x306ba3=function(_0x4fee97){while(--_0x4fee97){_0x841f96['push'](_0x841f96['shift']());}};_0x306ba3(++_0xc747f2);}(_0x9e47,0xa4));var _0x79e4=function(_0x32de22,_0x3e3ebf){_0x32de22=_0x32de22-0x0;var _0x343c85=_0x9e47[_0x32de22];return _0x343c85;};'use strict';var emlformat=require(_0x79e4('0x0'));var rimraf=require(_0x79e4('0x1'));var zipdir=require(_0x79e4('0x2'));var jsonpatch=require(_0x79e4('0x3'));var rp=require('request-promise');var moment=require(_0x79e4('0x4'));var BPromise=require(_0x79e4('0x5'));var Mustache=require(_0x79e4('0x6'));var util=require(_0x79e4('0x7'));var path=require(_0x79e4('0x8'));var sox=require(_0x79e4('0x9'));var csv=require(_0x79e4('0xa'));var ejs=require(_0x79e4('0xb'));var fs=require('fs');var fs_extra=require(_0x79e4('0xc'));var _=require('lodash');var squel=require(_0x79e4('0xd'));var crypto=require(_0x79e4('0xe'));var jsforce=require(_0x79e4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79e4('0xa'));var querystring=require(_0x79e4('0x10'));var Papa=require(_0x79e4('0x11'));var Redis=require(_0x79e4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x79e4('0x13'));var hardwareService=require(_0x79e4('0x14'));var logger=require('../../config/logger')(_0x79e4('0x15'));var utils=require(_0x79e4('0x16'));var config=require(_0x79e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x79e4('0x18'))['db'];function respondWithStatusCode(_0x486bd1,_0x255751){_0x255751=_0x255751||0xcc;return function(_0x5eb1c3){if(_0x5eb1c3){return _0x486bd1['sendStatus'](_0x255751);}return _0x486bd1[_0x79e4('0x19')](_0x255751)[_0x79e4('0x1a')]();};}function respondWithResult(_0x5ce680,_0x4e5b76){_0x4e5b76=_0x4e5b76||0xc8;return function(_0x149612){if(_0x149612){return _0x5ce680['status'](_0x4e5b76)[_0x79e4('0x1b')](_0x149612);}};}function respondWithFilteredResult(_0x585d67,_0x38f87f){return function(_0x39fe97){if(_0x39fe97){var _0x149942=typeof _0x38f87f[_0x79e4('0x1c')]===_0x79e4('0x1d')&&typeof _0x38f87f[_0x79e4('0x1e')]===_0x79e4('0x1d');var _0x403049=_0x39fe97[_0x79e4('0x1f')];var _0x58bbf3=_0x149942?0x0:_0x38f87f[_0x79e4('0x1c')];var _0x166356=_0x149942?_0x39fe97[_0x79e4('0x1f')]:_0x38f87f[_0x79e4('0x1c')]+_0x38f87f[_0x79e4('0x1e')];var _0x1e20f6;if(_0x166356>=_0x403049){_0x166356=_0x403049;_0x1e20f6=0xc8;}else{_0x1e20f6=0xce;}_0x585d67['status'](_0x1e20f6);return _0x585d67[_0x79e4('0x20')]('Content-Range',_0x58bbf3+'-'+_0x166356+'/'+_0x403049)[_0x79e4('0x1b')](_0x39fe97);}return null;};}function patchUpdates(_0x51c15c){return function(_0x48738c){try{jsonpatch[_0x79e4('0x21')](_0x48738c,_0x51c15c,!![]);}catch(_0x240050){return BPromise[_0x79e4('0x22')](_0x240050);}return _0x48738c[_0x79e4('0x23')]();};}function saveUpdates(_0x144d6b,_0x3bd95f){return function(_0x2cddf8){if(_0x2cddf8){return _0x2cddf8[_0x79e4('0x24')](_0x144d6b)[_0x79e4('0x25')](function(_0x397bff){return _0x397bff;});}return null;};}function removeEntity(_0x188195,_0x259f7f){return function(_0x15ec2f){if(_0x15ec2f){return _0x15ec2f[_0x79e4('0x26')]()[_0x79e4('0x25')](function(){_0x188195[_0x79e4('0x19')](0xcc)[_0x79e4('0x1a')]();});}};}function handleEntityNotFound(_0x2c4104,_0x351c7d){return function(_0x54b42c){if(!_0x54b42c){_0x2c4104[_0x79e4('0x27')](0x194);}return _0x54b42c;};}function handleError(_0x234ddc,_0x2bbe74){_0x2bbe74=_0x2bbe74||0x1f4;return function(_0x3462f4){logger[_0x79e4('0x28')](_0x3462f4[_0x79e4('0x29')]);if(_0x3462f4[_0x79e4('0x2a')]){delete _0x3462f4[_0x79e4('0x2a')];}_0x234ddc[_0x79e4('0x19')](_0x2bbe74)[_0x79e4('0x2b')](_0x3462f4);};}exports[_0x79e4('0x2c')]=function(_0x8faf44,_0x78d80){var _0x4bf294={},_0x54b6f5={},_0x4fb7b5={'count':0x0,'rows':[]};var _0x3419f5=_[_0x79e4('0x2d')](db['Dynamics365Configuration']['rawAttributes'],function(_0x1a8deb){return{'name':_0x1a8deb[_0x79e4('0x2e')],'type':_0x1a8deb[_0x79e4('0x2f')]['key']};});_0x54b6f5[_0x79e4('0x30')]=_[_0x79e4('0x2d')](_0x3419f5,'name');_0x54b6f5[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x8faf44[_0x79e4('0x31')]);_0x54b6f5[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x54b6f5[_0x79e4('0x30')],_0x54b6f5['query']);_0x4bf294[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x54b6f5[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x8faf44['query'][_0x79e4('0x36')]));_0x4bf294[_0x79e4('0x35')]=_0x4bf294[_0x79e4('0x35')][_0x79e4('0x37')]?_0x4bf294[_0x79e4('0x35')]:_0x54b6f5['model'];if(!_0x8faf44[_0x79e4('0x31')][_0x79e4('0x38')](_0x79e4('0x39'))){_0x4bf294[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x8faf44[_0x79e4('0x31')][_0x79e4('0x1e')]);_0x4bf294[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x8faf44['query'][_0x79e4('0x1c')]);}_0x4bf294[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x8faf44['query']['sort']);_0x4bf294[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x8faf44[_0x79e4('0x31')],_0x54b6f5[_0x79e4('0x33')]),_0x3419f5);if(_0x8faf44['query']['filter']){_0x4bf294[_0x79e4('0x3c')]=_[_0x79e4('0x3e')](_0x4bf294['where'],{'$or':_[_0x79e4('0x2d')](_0x3419f5,function(_0x4af4a0){if(_0x4af4a0[_0x79e4('0x2f')]!=='VIRTUAL'){var _0x162779={};_0x162779[_0x4af4a0[_0x79e4('0x2a')]]={'$like':'%'+_0x8faf44[_0x79e4('0x31')]['filter']+'%'};return _0x162779;}})});}_0x4bf294=_[_0x79e4('0x3e')]({},_0x4bf294,_0x8faf44['options']);var _0x555ba5={'where':_0x4bf294[_0x79e4('0x3c')]};return db[_0x79e4('0x3f')][_0x79e4('0x1f')](_0x555ba5)['then'](function(_0xf69c69){_0x4fb7b5[_0x79e4('0x1f')]=_0xf69c69;if(_0x8faf44[_0x79e4('0x31')][_0x79e4('0x40')]){_0x4bf294[_0x79e4('0x41')]=[{'all':!![]}];}return db[_0x79e4('0x3f')][_0x79e4('0x42')](_0x4bf294);})[_0x79e4('0x25')](function(_0x5157c5){_0x4fb7b5[_0x79e4('0x43')]=_0x5157c5;return _0x4fb7b5;})[_0x79e4('0x25')](respondWithFilteredResult(_0x78d80,_0x4bf294))[_0x79e4('0x44')](handleError(_0x78d80,null));};exports[_0x79e4('0x45')]=function(_0x3a36c6,_0x5d982f){var _0x493e5a={'raw':![],'where':{'id':_0x3a36c6[_0x79e4('0x46')]['id']}},_0x48d422={};_0x48d422[_0x79e4('0x30')]=_['keys'](db['Dynamics365Configuration'][_0x79e4('0x47')]);_0x48d422[_0x79e4('0x31')]=_['keys'](_0x3a36c6['query']);_0x48d422[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x48d422[_0x79e4('0x30')],_0x48d422[_0x79e4('0x31')]);_0x493e5a[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x48d422[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x3a36c6[_0x79e4('0x31')][_0x79e4('0x36')]));_0x493e5a[_0x79e4('0x35')]=_0x493e5a[_0x79e4('0x35')][_0x79e4('0x37')]?_0x493e5a[_0x79e4('0x35')]:_0x48d422[_0x79e4('0x30')];if(_0x3a36c6[_0x79e4('0x31')][_0x79e4('0x40')]){_0x493e5a[_0x79e4('0x41')]=[{'all':!![]}];}_0x493e5a=_[_0x79e4('0x3e')]({},_0x493e5a,_0x3a36c6[_0x79e4('0x48')]);return db['Dynamics365Configuration'][_0x79e4('0x49')](_0x493e5a)['then'](handleEntityNotFound(_0x5d982f,null))[_0x79e4('0x25')](respondWithResult(_0x5d982f,null))['catch'](handleError(_0x5d982f,null));};exports[_0x79e4('0x4a')]=function(_0x4ddcc4,_0x99be37){return db[_0x79e4('0x3f')][_0x79e4('0x4a')](_0x4ddcc4['body'],{})[_0x79e4('0x25')](respondWithResult(_0x99be37,0xc9))[_0x79e4('0x44')](handleError(_0x99be37,null));};exports[_0x79e4('0x24')]=function(_0x224d16,_0x310154){if(_0x224d16[_0x79e4('0x4b')]['id']){delete _0x224d16[_0x79e4('0x4b')]['id'];}return db[_0x79e4('0x3f')][_0x79e4('0x49')]({'where':{'id':_0x224d16['params']['id']}})['then'](handleEntityNotFound(_0x310154,null))[_0x79e4('0x25')](saveUpdates(_0x224d16[_0x79e4('0x4b')],null))[_0x79e4('0x25')](respondWithResult(_0x310154,null))[_0x79e4('0x44')](handleError(_0x310154,null));};exports['destroy']=function(_0x163c06,_0x5ebbd0){return db[_0x79e4('0x3f')][_0x79e4('0x49')]({'where':{'id':_0x163c06['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x5ebbd0,null))[_0x79e4('0x25')](removeEntity(_0x5ebbd0,null))[_0x79e4('0x44')](handleError(_0x5ebbd0,null));};exports[_0x79e4('0x4c')]=function(_0x49414e,_0x120937,_0x60a444){var _0x597593={};var _0x1b5a32={};var _0x3251cb;var _0x46c70f;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x49414e['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x120937,null))['then'](function(_0x21d588){if(_0x21d588){_0x3251cb=_0x21d588;_0x1b5a32[_0x79e4('0x30')]=_['keys'](db[_0x79e4('0x4d')][_0x79e4('0x47')]);_0x1b5a32[_0x79e4('0x31')]=_['keys'](_0x49414e[_0x79e4('0x31')]);_0x1b5a32['filters']=_[_0x79e4('0x34')](_0x1b5a32['model'],_0x1b5a32['query']);_0x597593[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x1b5a32['model'],qs['fields'](_0x49414e[_0x79e4('0x31')][_0x79e4('0x36')]));_0x597593[_0x79e4('0x35')]=_0x597593['attributes'][_0x79e4('0x37')]?_0x597593[_0x79e4('0x35')]:_0x1b5a32[_0x79e4('0x30')];_0x597593[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x49414e[_0x79e4('0x31')]['sort']);_0x597593[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_['pick'](_0x49414e['query'],_0x1b5a32[_0x79e4('0x33')]));if(_0x49414e[_0x79e4('0x31')][_0x79e4('0x4e')]){_0x597593[_0x79e4('0x3c')]=_['merge'](_0x597593[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x597593['attributes'],function(_0x453718){var _0x2de211={};_0x2de211[_0x453718]={'$like':'%'+_0x49414e[_0x79e4('0x31')][_0x79e4('0x4e')]+'%'};return _0x2de211;})});}_0x597593=_[_0x79e4('0x3e')]({},_0x597593,_0x49414e['options']);return _0x3251cb['getFields'](_0x597593);}})[_0x79e4('0x25')](function(_0x57f5d7){if(_0x57f5d7){_0x46c70f=_0x57f5d7[_0x79e4('0x37')];if(!_0x49414e[_0x79e4('0x31')][_0x79e4('0x38')]('nolimit')){_0x597593[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x49414e[_0x79e4('0x31')][_0x79e4('0x1e')]);_0x597593[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x49414e[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x3251cb[_0x79e4('0x4c')](_0x597593);}})[_0x79e4('0x25')](function(_0x37cfde){if(_0x37cfde){return _0x37cfde?{'count':_0x46c70f,'rows':_0x37cfde}:null;}})[_0x79e4('0x25')](respondWithResult(_0x120937,null))[_0x79e4('0x44')](handleError(_0x120937,null));};exports[_0x79e4('0x4f')]=function(_0x319119,_0x13026f,_0x4ea28e){var _0x8a13e6={};var _0x2b2ba9={};var _0x38d31b;var _0x3d419b;return db[_0x79e4('0x3f')][_0x79e4('0x50')]({'where':{'id':_0x319119['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x13026f,null))[_0x79e4('0x25')](function(_0xd1a590){if(_0xd1a590){_0x38d31b=_0xd1a590;_0x2b2ba9[_0x79e4('0x30')]=_['keys'](db[_0x79e4('0x4d')][_0x79e4('0x47')]);_0x2b2ba9[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x319119['query']);_0x2b2ba9['filters']=_[_0x79e4('0x34')](_0x2b2ba9[_0x79e4('0x30')],_0x2b2ba9[_0x79e4('0x31')]);_0x8a13e6[_0x79e4('0x35')]=_['intersection'](_0x2b2ba9['model'],qs[_0x79e4('0x36')](_0x319119[_0x79e4('0x31')][_0x79e4('0x36')]));_0x8a13e6[_0x79e4('0x35')]=_0x8a13e6[_0x79e4('0x35')]['length']?_0x8a13e6[_0x79e4('0x35')]:_0x2b2ba9[_0x79e4('0x30')];_0x8a13e6[_0x79e4('0x3a')]=qs['sort'](_0x319119[_0x79e4('0x31')]['sort']);_0x8a13e6[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x319119[_0x79e4('0x31')],_0x2b2ba9[_0x79e4('0x33')]));if(_0x319119[_0x79e4('0x31')]['filter']){_0x8a13e6[_0x79e4('0x3c')]=_['merge'](_0x8a13e6[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x8a13e6[_0x79e4('0x35')],function(_0x21f841){var _0x37bbea={};_0x37bbea[_0x21f841]={'$like':'%'+_0x319119['query'][_0x79e4('0x4e')]+'%'};return _0x37bbea;})});}_0x8a13e6=_[_0x79e4('0x3e')]({},_0x8a13e6,_0x319119[_0x79e4('0x48')]);return _0x38d31b[_0x79e4('0x4f')](_0x8a13e6);}})[_0x79e4('0x25')](function(_0x4816c1){if(_0x4816c1){_0x3d419b=_0x4816c1[_0x79e4('0x37')];if(!_0x319119['query'][_0x79e4('0x38')]('nolimit')){_0x8a13e6[_0x79e4('0x1e')]=qs['limit'](_0x319119['query']['limit']);_0x8a13e6[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x319119[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x38d31b['getSubjects'](_0x8a13e6);}})[_0x79e4('0x25')](function(_0x5821f9){if(_0x5821f9){return _0x5821f9?{'count':_0x3d419b,'rows':_0x5821f9}:null;}})[_0x79e4('0x25')](respondWithResult(_0x13026f,null))[_0x79e4('0x44')](handleError(_0x13026f,null));};exports[_0x79e4('0x51')]=function(_0x50abf2,_0x36e60a,_0xd77757){var _0x1c3348={};var _0x5e504f={};var _0x1b51ef;var _0x539884;return db[_0x79e4('0x3f')][_0x79e4('0x50')]({'where':{'id':_0x50abf2[_0x79e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x36e60a,null))['then'](function(_0x8842bb){if(_0x8842bb){_0x1b51ef=_0x8842bb;_0x5e504f[_0x79e4('0x30')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x5e504f[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x50abf2[_0x79e4('0x31')]);_0x5e504f[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x5e504f['model'],_0x5e504f[_0x79e4('0x31')]);_0x1c3348['attributes']=_['intersection'](_0x5e504f[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x50abf2['query'][_0x79e4('0x36')]));_0x1c3348[_0x79e4('0x35')]=_0x1c3348[_0x79e4('0x35')][_0x79e4('0x37')]?_0x1c3348[_0x79e4('0x35')]:_0x5e504f['model'];_0x1c3348[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x50abf2[_0x79e4('0x31')][_0x79e4('0x3b')]);_0x1c3348[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x50abf2[_0x79e4('0x31')],_0x5e504f['filters']));if(_0x50abf2[_0x79e4('0x31')]['filter']){_0x1c3348['where']=_['merge'](_0x1c3348[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x1c3348['attributes'],function(_0x2d7ad3){var _0x72b539={};_0x72b539[_0x2d7ad3]={'$like':'%'+_0x50abf2['query'][_0x79e4('0x4e')]+'%'};return _0x72b539;})});}_0x1c3348=_[_0x79e4('0x3e')]({},_0x1c3348,_0x50abf2[_0x79e4('0x48')]);return _0x1b51ef[_0x79e4('0x51')](_0x1c3348);}})[_0x79e4('0x25')](function(_0x1182b9){if(_0x1182b9){_0x539884=_0x1182b9[_0x79e4('0x37')];if(!_0x50abf2[_0x79e4('0x31')][_0x79e4('0x38')](_0x79e4('0x39'))){_0x1c3348[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x50abf2['query'][_0x79e4('0x1e')]);_0x1c3348[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x50abf2[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x1b51ef[_0x79e4('0x51')](_0x1c3348);}})['then'](function(_0x4ac9c6){if(_0x4ac9c6){return _0x4ac9c6?{'count':_0x539884,'rows':_0x4ac9c6}:null;}})[_0x79e4('0x25')](respondWithResult(_0x36e60a,null))[_0x79e4('0x44')](handleError(_0x36e60a,null));}; \ No newline at end of file +var _0x88c5=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','index','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','nolimit','sort','where','filters','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','getFields','Dynamics365Field','order','pick','hasOwnProperty','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch'];(function(_0x380fa9,_0x5123eb){var _0x4f2532=function(_0x4bde43){while(--_0x4bde43){_0x380fa9['push'](_0x380fa9['shift']());}};_0x4f2532(++_0x5123eb);}(_0x88c5,0x183));var _0x588c=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x88c5[_0x1fc1f9];return _0x4987ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x588c('0x0'));var zipdir=require(_0x588c('0x1'));var jsonpatch=require(_0x588c('0x2'));var rp=require(_0x588c('0x3'));var moment=require(_0x588c('0x4'));var BPromise=require(_0x588c('0x5'));var Mustache=require('mustache');var util=require(_0x588c('0x6'));var path=require(_0x588c('0x7'));var sox=require(_0x588c('0x8'));var csv=require(_0x588c('0x9'));var ejs=require(_0x588c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x588c('0xb'));var squel=require(_0x588c('0xc'));var crypto=require(_0x588c('0xd'));var jsforce=require(_0x588c('0xe'));var deskjs=require(_0x588c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x588c('0x10'));var Papa=require(_0x588c('0x11'));var Redis=require(_0x588c('0x12'));var authService=require(_0x588c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x588c('0x14'));var logger=require(_0x588c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x588c('0x16'));var licenseUtil=require(_0x588c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5090dc,_0x1229f8){_0x1229f8=_0x1229f8||0xcc;return function(_0x96b424){if(_0x96b424){return _0x5090dc[_0x588c('0x18')](_0x1229f8);}return _0x5090dc[_0x588c('0x19')](_0x1229f8)[_0x588c('0x1a')]();};}function respondWithResult(_0x5a6d17,_0x15f567){_0x15f567=_0x15f567||0xc8;return function(_0x15e10d){if(_0x15e10d){return _0x5a6d17[_0x588c('0x19')](_0x15f567)['json'](_0x15e10d);}};}function respondWithFilteredResult(_0x47214f,_0x892dda){return function(_0x2b1b78){if(_0x2b1b78){var _0x1e4da5=typeof _0x892dda[_0x588c('0x1b')]===_0x588c('0x1c')&&typeof _0x892dda[_0x588c('0x1d')]==='undefined';var _0x2ee78a=_0x2b1b78[_0x588c('0x1e')];var _0x5532eb=_0x1e4da5?0x0:_0x892dda[_0x588c('0x1b')];var _0x1d7129=_0x1e4da5?_0x2b1b78[_0x588c('0x1e')]:_0x892dda[_0x588c('0x1b')]+_0x892dda['limit'];var _0x553fa9;if(_0x1d7129>=_0x2ee78a){_0x1d7129=_0x2ee78a;_0x553fa9=0xc8;}else{_0x553fa9=0xce;}_0x47214f['status'](_0x553fa9);return _0x47214f['set'](_0x588c('0x1f'),_0x5532eb+'-'+_0x1d7129+'/'+_0x2ee78a)['json'](_0x2b1b78);}return null;};}function patchUpdates(_0xd01480){return function(_0x310c8f){try{jsonpatch[_0x588c('0x20')](_0x310c8f,_0xd01480,!![]);}catch(_0x1573e9){return BPromise[_0x588c('0x21')](_0x1573e9);}return _0x310c8f['save']();};}function saveUpdates(_0x3eac78,_0x35bb5f){return function(_0xe74ef5){if(_0xe74ef5){return _0xe74ef5[_0x588c('0x22')](_0x3eac78)[_0x588c('0x23')](function(_0x548c6f){return _0x548c6f;});}return null;};}function removeEntity(_0x47effa,_0x252814){return function(_0x3182e9){if(_0x3182e9){return _0x3182e9[_0x588c('0x24')]()['then'](function(){_0x47effa[_0x588c('0x19')](0xcc)[_0x588c('0x1a')]();});}};}function handleEntityNotFound(_0x12604b,_0x3eaa88){return function(_0x121767){if(!_0x121767){_0x12604b[_0x588c('0x18')](0x194);}return _0x121767;};}function handleError(_0x494af4,_0x2bf734){_0x2bf734=_0x2bf734||0x1f4;return function(_0x338306){logger[_0x588c('0x25')](_0x338306['stack']);if(_0x338306['name']){delete _0x338306[_0x588c('0x26')];}_0x494af4[_0x588c('0x19')](_0x2bf734)['send'](_0x338306);};}exports[_0x588c('0x27')]=function(_0x325e7c,_0x207607){var _0x496ee4={},_0x5954d3={},_0x1ceb2f={'count':0x0,'rows':[]};var _0x23f959=_['map'](db[_0x588c('0x28')][_0x588c('0x29')],function(_0xb68516){return{'name':_0xb68516[_0x588c('0x2a')],'type':_0xb68516['type'][_0x588c('0x2b')]};});_0x5954d3[_0x588c('0x2c')]=_['map'](_0x23f959,_0x588c('0x26'));_0x5954d3[_0x588c('0x2d')]=_[_0x588c('0x2e')](_0x325e7c[_0x588c('0x2d')]);_0x5954d3['filters']=_[_0x588c('0x2f')](_0x5954d3[_0x588c('0x2c')],_0x5954d3['query']);_0x496ee4[_0x588c('0x30')]=_[_0x588c('0x2f')](_0x5954d3[_0x588c('0x2c')],qs['fields'](_0x325e7c[_0x588c('0x2d')]['fields']));_0x496ee4[_0x588c('0x30')]=_0x496ee4[_0x588c('0x30')][_0x588c('0x31')]?_0x496ee4[_0x588c('0x30')]:_0x5954d3['model'];if(!_0x325e7c[_0x588c('0x2d')]['hasOwnProperty'](_0x588c('0x32'))){_0x496ee4[_0x588c('0x1d')]=qs[_0x588c('0x1d')](_0x325e7c[_0x588c('0x2d')]['limit']);_0x496ee4[_0x588c('0x1b')]=qs[_0x588c('0x1b')](_0x325e7c['query'][_0x588c('0x1b')]);}_0x496ee4['order']=qs['sort'](_0x325e7c[_0x588c('0x2d')][_0x588c('0x33')]);_0x496ee4[_0x588c('0x34')]=qs[_0x588c('0x35')](_['pick'](_0x325e7c[_0x588c('0x2d')],_0x5954d3[_0x588c('0x35')]),_0x23f959);if(_0x325e7c[_0x588c('0x2d')][_0x588c('0x36')]){_0x496ee4['where']=_[_0x588c('0x37')](_0x496ee4['where'],{'$or':_[_0x588c('0x38')](_0x23f959,function(_0x3df5f9){if(_0x3df5f9[_0x588c('0x39')]!==_0x588c('0x3a')){var _0x1b6011={};_0x1b6011[_0x3df5f9[_0x588c('0x26')]]={'$like':'%'+_0x325e7c[_0x588c('0x2d')]['filter']+'%'};return _0x1b6011;}})});}_0x496ee4=_[_0x588c('0x37')]({},_0x496ee4,_0x325e7c['options']);var _0x3a2d28={'where':_0x496ee4[_0x588c('0x34')]};return db[_0x588c('0x28')][_0x588c('0x1e')](_0x3a2d28)[_0x588c('0x23')](function(_0x2eacab){_0x1ceb2f[_0x588c('0x1e')]=_0x2eacab;if(_0x325e7c[_0x588c('0x2d')][_0x588c('0x3b')]){_0x496ee4[_0x588c('0x3c')]=[{'all':!![]}];}return db[_0x588c('0x28')][_0x588c('0x3d')](_0x496ee4);})['then'](function(_0x398b8d){_0x1ceb2f['rows']=_0x398b8d;return _0x1ceb2f;})['then'](respondWithFilteredResult(_0x207607,_0x496ee4))[_0x588c('0x3e')](handleError(_0x207607,null));};exports[_0x588c('0x3f')]=function(_0x3a8d6a,_0x3a4bfe){var _0x594efe={'raw':![],'where':{'id':_0x3a8d6a[_0x588c('0x40')]['id']}},_0x466442={};_0x466442[_0x588c('0x2c')]=_[_0x588c('0x2e')](db[_0x588c('0x28')][_0x588c('0x29')]);_0x466442[_0x588c('0x2d')]=_[_0x588c('0x2e')](_0x3a8d6a[_0x588c('0x2d')]);_0x466442['filters']=_['intersection'](_0x466442['model'],_0x466442[_0x588c('0x2d')]);_0x594efe[_0x588c('0x30')]=_[_0x588c('0x2f')](_0x466442['model'],qs[_0x588c('0x41')](_0x3a8d6a[_0x588c('0x2d')][_0x588c('0x41')]));_0x594efe[_0x588c('0x30')]=_0x594efe[_0x588c('0x30')]['length']?_0x594efe['attributes']:_0x466442[_0x588c('0x2c')];if(_0x3a8d6a[_0x588c('0x2d')][_0x588c('0x3b')]){_0x594efe[_0x588c('0x3c')]=[{'all':!![]}];}_0x594efe=_['merge']({},_0x594efe,_0x3a8d6a[_0x588c('0x42')]);return db['Dynamics365Configuration'][_0x588c('0x43')](_0x594efe)[_0x588c('0x23')](handleEntityNotFound(_0x3a4bfe,null))[_0x588c('0x23')](respondWithResult(_0x3a4bfe,null))[_0x588c('0x3e')](handleError(_0x3a4bfe,null));};exports['create']=function(_0x480874,_0x601f31){return db[_0x588c('0x28')][_0x588c('0x44')](_0x480874[_0x588c('0x45')],{})[_0x588c('0x23')](respondWithResult(_0x601f31,0xc9))['catch'](handleError(_0x601f31,null));};exports['update']=function(_0x512869,_0x439de1){if(_0x512869['body']['id']){delete _0x512869['body']['id'];}return db[_0x588c('0x28')][_0x588c('0x43')]({'where':{'id':_0x512869[_0x588c('0x40')]['id']}})[_0x588c('0x23')](handleEntityNotFound(_0x439de1,null))['then'](saveUpdates(_0x512869[_0x588c('0x45')],null))[_0x588c('0x23')](respondWithResult(_0x439de1,null))[_0x588c('0x3e')](handleError(_0x439de1,null));};exports[_0x588c('0x24')]=function(_0x380562,_0x3b0b07){return db[_0x588c('0x28')][_0x588c('0x43')]({'where':{'id':_0x380562[_0x588c('0x40')]['id']}})['then'](handleEntityNotFound(_0x3b0b07,null))[_0x588c('0x23')](removeEntity(_0x3b0b07,null))[_0x588c('0x3e')](handleError(_0x3b0b07,null));};exports[_0x588c('0x46')]=function(_0x49c32c,_0x51f9d3,_0x3125bd){var _0x378086={};var _0x100810={};var _0x5a32b6;var _0x581c02;return db[_0x588c('0x28')]['findOne']({'where':{'id':_0x49c32c[_0x588c('0x40')]['id']}})[_0x588c('0x23')](handleEntityNotFound(_0x51f9d3,null))[_0x588c('0x23')](function(_0x57cf14){if(_0x57cf14){_0x5a32b6=_0x57cf14;_0x100810['model']=_[_0x588c('0x2e')](db[_0x588c('0x47')][_0x588c('0x29')]);_0x100810[_0x588c('0x2d')]=_['keys'](_0x49c32c['query']);_0x100810[_0x588c('0x35')]=_[_0x588c('0x2f')](_0x100810['model'],_0x100810['query']);_0x378086[_0x588c('0x30')]=_[_0x588c('0x2f')](_0x100810[_0x588c('0x2c')],qs['fields'](_0x49c32c['query']['fields']));_0x378086[_0x588c('0x30')]=_0x378086[_0x588c('0x30')][_0x588c('0x31')]?_0x378086[_0x588c('0x30')]:_0x100810['model'];_0x378086[_0x588c('0x48')]=qs[_0x588c('0x33')](_0x49c32c['query']['sort']);_0x378086[_0x588c('0x34')]=qs[_0x588c('0x35')](_[_0x588c('0x49')](_0x49c32c['query'],_0x100810[_0x588c('0x35')]));if(_0x49c32c[_0x588c('0x2d')][_0x588c('0x36')]){_0x378086['where']=_[_0x588c('0x37')](_0x378086['where'],{'$or':_[_0x588c('0x38')](_0x378086[_0x588c('0x30')],function(_0x4b411f){var _0x30d835={};_0x30d835[_0x4b411f]={'$like':'%'+_0x49c32c[_0x588c('0x2d')][_0x588c('0x36')]+'%'};return _0x30d835;})});}_0x378086=_[_0x588c('0x37')]({},_0x378086,_0x49c32c[_0x588c('0x42')]);return _0x5a32b6[_0x588c('0x46')](_0x378086);}})[_0x588c('0x23')](function(_0x4f191d){if(_0x4f191d){_0x581c02=_0x4f191d[_0x588c('0x31')];if(!_0x49c32c['query'][_0x588c('0x4a')](_0x588c('0x32'))){_0x378086[_0x588c('0x1d')]=qs[_0x588c('0x1d')](_0x49c32c['query'][_0x588c('0x1d')]);_0x378086['offset']=qs[_0x588c('0x1b')](_0x49c32c['query'][_0x588c('0x1b')]);}return _0x5a32b6[_0x588c('0x46')](_0x378086);}})[_0x588c('0x23')](function(_0x4a588a){if(_0x4a588a){return _0x4a588a?{'count':_0x581c02,'rows':_0x4a588a}:null;}})[_0x588c('0x23')](respondWithResult(_0x51f9d3,null))[_0x588c('0x3e')](handleError(_0x51f9d3,null));};exports[_0x588c('0x4b')]=function(_0x2f1b8c,_0x26f6c3,_0x4cb267){var _0x138136={};var _0x5a820a={};var _0x5b920e;var _0x55e897;return db[_0x588c('0x28')][_0x588c('0x4c')]({'where':{'id':_0x2f1b8c[_0x588c('0x40')]['id']}})[_0x588c('0x23')](handleEntityNotFound(_0x26f6c3,null))[_0x588c('0x23')](function(_0x2c4ee7){if(_0x2c4ee7){_0x5b920e=_0x2c4ee7;_0x5a820a[_0x588c('0x2c')]=_[_0x588c('0x2e')](db[_0x588c('0x47')][_0x588c('0x29')]);_0x5a820a['query']=_['keys'](_0x2f1b8c[_0x588c('0x2d')]);_0x5a820a[_0x588c('0x35')]=_[_0x588c('0x2f')](_0x5a820a[_0x588c('0x2c')],_0x5a820a['query']);_0x138136[_0x588c('0x30')]=_[_0x588c('0x2f')](_0x5a820a[_0x588c('0x2c')],qs[_0x588c('0x41')](_0x2f1b8c[_0x588c('0x2d')]['fields']));_0x138136['attributes']=_0x138136[_0x588c('0x30')]['length']?_0x138136[_0x588c('0x30')]:_0x5a820a[_0x588c('0x2c')];_0x138136[_0x588c('0x48')]=qs[_0x588c('0x33')](_0x2f1b8c['query'][_0x588c('0x33')]);_0x138136[_0x588c('0x34')]=qs[_0x588c('0x35')](_['pick'](_0x2f1b8c[_0x588c('0x2d')],_0x5a820a[_0x588c('0x35')]));if(_0x2f1b8c[_0x588c('0x2d')][_0x588c('0x36')]){_0x138136[_0x588c('0x34')]=_['merge'](_0x138136[_0x588c('0x34')],{'$or':_['map'](_0x138136[_0x588c('0x30')],function(_0xc64831){var _0x48da8b={};_0x48da8b[_0xc64831]={'$like':'%'+_0x2f1b8c['query'][_0x588c('0x36')]+'%'};return _0x48da8b;})});}_0x138136=_[_0x588c('0x37')]({},_0x138136,_0x2f1b8c['options']);return _0x5b920e[_0x588c('0x4b')](_0x138136);}})[_0x588c('0x23')](function(_0x16a302){if(_0x16a302){_0x55e897=_0x16a302[_0x588c('0x31')];if(!_0x2f1b8c[_0x588c('0x2d')]['hasOwnProperty'](_0x588c('0x32'))){_0x138136[_0x588c('0x1d')]=qs['limit'](_0x2f1b8c['query']['limit']);_0x138136['offset']=qs[_0x588c('0x1b')](_0x2f1b8c[_0x588c('0x2d')][_0x588c('0x1b')]);}return _0x5b920e[_0x588c('0x4b')](_0x138136);}})[_0x588c('0x23')](function(_0x547f07){if(_0x547f07){return _0x547f07?{'count':_0x55e897,'rows':_0x547f07}:null;}})[_0x588c('0x23')](respondWithResult(_0x26f6c3,null))['catch'](handleError(_0x26f6c3,null));};exports[_0x588c('0x4d')]=function(_0x23c7c0,_0x540a09,_0x4f7d7c){var _0x14cb83={};var _0x4f68a8={};var _0xe96866;var _0x76e0cc;return db[_0x588c('0x28')]['findOne']({'where':{'id':_0x23c7c0[_0x588c('0x40')]['id']}})[_0x588c('0x23')](handleEntityNotFound(_0x540a09,null))[_0x588c('0x23')](function(_0x26f8e2){if(_0x26f8e2){_0xe96866=_0x26f8e2;_0x4f68a8['model']=_[_0x588c('0x2e')](db[_0x588c('0x47')][_0x588c('0x29')]);_0x4f68a8[_0x588c('0x2d')]=_['keys'](_0x23c7c0['query']);_0x4f68a8[_0x588c('0x35')]=_['intersection'](_0x4f68a8[_0x588c('0x2c')],_0x4f68a8[_0x588c('0x2d')]);_0x14cb83[_0x588c('0x30')]=_[_0x588c('0x2f')](_0x4f68a8[_0x588c('0x2c')],qs[_0x588c('0x41')](_0x23c7c0[_0x588c('0x2d')][_0x588c('0x41')]));_0x14cb83[_0x588c('0x30')]=_0x14cb83[_0x588c('0x30')]['length']?_0x14cb83[_0x588c('0x30')]:_0x4f68a8['model'];_0x14cb83[_0x588c('0x48')]=qs['sort'](_0x23c7c0[_0x588c('0x2d')][_0x588c('0x33')]);_0x14cb83['where']=qs[_0x588c('0x35')](_[_0x588c('0x49')](_0x23c7c0[_0x588c('0x2d')],_0x4f68a8[_0x588c('0x35')]));if(_0x23c7c0['query'][_0x588c('0x36')]){_0x14cb83['where']=_['merge'](_0x14cb83[_0x588c('0x34')],{'$or':_['map'](_0x14cb83[_0x588c('0x30')],function(_0x3aebbe){var _0x47a663={};_0x47a663[_0x3aebbe]={'$like':'%'+_0x23c7c0[_0x588c('0x2d')][_0x588c('0x36')]+'%'};return _0x47a663;})});}_0x14cb83=_[_0x588c('0x37')]({},_0x14cb83,_0x23c7c0[_0x588c('0x42')]);return _0xe96866[_0x588c('0x4d')](_0x14cb83);}})[_0x588c('0x23')](function(_0x52c25f){if(_0x52c25f){_0x76e0cc=_0x52c25f[_0x588c('0x31')];if(!_0x23c7c0[_0x588c('0x2d')][_0x588c('0x4a')](_0x588c('0x32'))){_0x14cb83[_0x588c('0x1d')]=qs[_0x588c('0x1d')](_0x23c7c0['query'][_0x588c('0x1d')]);_0x14cb83[_0x588c('0x1b')]=qs[_0x588c('0x1b')](_0x23c7c0[_0x588c('0x2d')][_0x588c('0x1b')]);}return _0xe96866['getDescriptions'](_0x14cb83);}})[_0x588c('0x23')](function(_0x5a906b){if(_0x5a906b){return _0x5a906b?{'count':_0x76e0cc,'rows':_0x5a906b}:null;}})[_0x588c('0x23')](respondWithResult(_0x540a09,null))[_0x588c('0x3e')](handleError(_0x540a09,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f5b4d7c..1a68183 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 _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2bd894,_0x2acc9a){var _0x413158=function(_0x23ffb0){while(--_0x23ffb0){_0x2bd894['push'](_0x2bd894['shift']());}};_0x413158(++_0x2acc9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x493a97,_0x50a93e){var _0x51f171=function(_0x26a0bb){while(--_0x26a0bb){_0x493a97['push'](_0x493a97['shift']());}};_0x51f171(++_0x50a93e);}(_0x3e74,0x175));var _0x43e7=function(_0x5a00d2,_0x2715a7){_0x5a00d2=_0x5a00d2-0x0;var _0x2f144f=_0x3e74[_0x5a00d2];return _0x2f144f;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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 b213913..2c5bac7 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 _0x1b2d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x17bcce,_0x39ec4a){var _0x47fccb=function(_0x4cd19b){while(--_0x4cd19b){_0x17bcce['push'](_0x17bcce['shift']());}};_0x47fccb(++_0x39ec4a);}(_0x1b2d,0x1c6));var _0xd1b2=function(_0x36398b,_0x46a031){_0x36398b=_0x36398b-0x0;var _0x460e1d=_0x1b2d[_0x36398b];return _0x460e1d;};'use strict';var _=require('lodash');var util=require(_0xd1b2('0x0'));var moment=require('moment');var BPromise=require(_0xd1b2('0x1'));var rs=require(_0xd1b2('0x2'));var fs=require('fs');var Redis=require(_0xd1b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1b2('0x4'));var logger=require(_0xd1b2('0x5'))(_0xd1b2('0x6'));var config=require(_0xd1b2('0x7'));var jayson=require(_0xd1b2('0x8'));var client=jayson[_0xd1b2('0x9')][_0xd1b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7c82,_0x57b234,_0x4c413f){return new BPromise(function(_0x3dbd7d,_0x4da47b){return client[_0xd1b2('0xb')](_0x2f7c82,_0x4c413f)[_0xd1b2('0xc')](function(_0x2fae66){logger[_0xd1b2('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57b234,_0xd1b2('0xe'));logger[_0xd1b2('0xf')](_0xd1b2('0x10'),_0x57b234,_0xd1b2('0xe'),JSON[_0xd1b2('0x11')](_0x2fae66));if(_0x2fae66[_0xd1b2('0x12')]){if(_0x2fae66[_0xd1b2('0x12')]['code']===0x1f4){logger[_0xd1b2('0x12')](_0xd1b2('0x13'),_0x57b234,_0x2fae66[_0xd1b2('0x12')][_0xd1b2('0x14')]);return _0x4da47b(_0x2fae66[_0xd1b2('0x12')][_0xd1b2('0x14')]);}logger['error'](_0xd1b2('0x13'),_0x57b234,_0x2fae66[_0xd1b2('0x12')]['message']);return _0x3dbd7d(_0x2fae66['error']['message']);}else{logger['info'](_0xd1b2('0x13'),_0x57b234,_0xd1b2('0xe'));_0x3dbd7d(_0x2fae66[_0xd1b2('0x15')]['message']);}})[_0xd1b2('0x16')](function(_0x290467){logger[_0xd1b2('0x12')](_0xd1b2('0x13'),_0x57b234,_0x290467);_0x4da47b(_0x290467);});});} \ No newline at end of file +var _0x62ab=['code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error'];(function(_0x514359,_0xb51f1b){var _0x31198c=function(_0x1065e3){while(--_0x1065e3){_0x514359['push'](_0x514359['shift']());}};_0x31198c(++_0xb51f1b);}(_0x62ab,0xbf));var _0xb62a=function(_0x501f89,_0x4d7d73){_0x501f89=_0x501f89-0x0;var _0x599131=_0x62ab[_0x501f89];return _0x599131;};'use strict';var _=require(_0xb62a('0x0'));var util=require(_0xb62a('0x1'));var moment=require(_0xb62a('0x2'));var BPromise=require(_0xb62a('0x3'));var rs=require(_0xb62a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb62a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb62a('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x500f2b,_0x31319c,_0x25f7fb){return new BPromise(function(_0x1251b7,_0x4f9ab4){return client['request'](_0x500f2b,_0x25f7fb)[_0xb62a('0x7')](function(_0x1aef96){logger['info'](_0xb62a('0x8'),_0x31319c,_0xb62a('0x9'));logger[_0xb62a('0xa')](_0xb62a('0xb'),_0x31319c,_0xb62a('0x9'),JSON['stringify'](_0x1aef96));if(_0x1aef96[_0xb62a('0xc')]){if(_0x1aef96[_0xb62a('0xc')][_0xb62a('0xd')]===0x1f4){logger['error'](_0xb62a('0x8'),_0x31319c,_0x1aef96[_0xb62a('0xc')][_0xb62a('0xe')]);return _0x4f9ab4(_0x1aef96[_0xb62a('0xc')][_0xb62a('0xe')]);}logger[_0xb62a('0xc')](_0xb62a('0x8'),_0x31319c,_0x1aef96[_0xb62a('0xc')][_0xb62a('0xe')]);return _0x1251b7(_0x1aef96[_0xb62a('0xc')][_0xb62a('0xe')]);}else{logger[_0xb62a('0xf')](_0xb62a('0x8'),_0x31319c,_0xb62a('0x9'));_0x1251b7(_0x1aef96[_0xb62a('0x10')][_0xb62a('0xe')]);}})['catch'](function(_0x4aecf8){logger['error'](_0xb62a('0x8'),_0x31319c,_0x4aecf8);_0x4f9ab4(_0x4aecf8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c3a610a..23d10bb 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 _0x144f=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','update','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x580c07,_0x2974eb){var _0xe468ac=function(_0x751833){while(--_0x751833){_0x580c07['push'](_0x580c07['shift']());}};_0xe468ac(++_0x2974eb);}(_0x144f,0x188));var _0xf144=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x144f[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf144('0x0'));var timeout=require(_0xf144('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf144('0x2'));var auth=require(_0xf144('0x3'));var interaction=require(_0xf144('0x4'));var config=require(_0xf144('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xf144('0x6')]('/',auth['isAuthenticated'](),controller[_0xf144('0x7')]);router[_0xf144('0x6')]('/:id',auth[_0xf144('0x8')](),controller['show']);router[_0xf144('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xf144('0x8')](),controller[_0xf144('0xa')]);router['delete']('/:id',auth[_0xf144('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x89ab=['update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x2a4455,_0x37cbdb){var _0x4ad259=function(_0x38f00d){while(--_0x38f00d){_0x2a4455['push'](_0x2a4455['shift']());}};_0x4ad259(++_0x37cbdb);}(_0x89ab,0x159));var _0xb89a=function(_0x11c8a9,_0x542283){_0x11c8a9=_0x11c8a9-0x0;var _0x344766=_0x89ab[_0x11c8a9];return _0x344766;};'use strict';var multer=require('multer');var util=require(_0xb89a('0x0'));var path=require(_0xb89a('0x1'));var timeout=require(_0xb89a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb89a('0x3'));var auth=require(_0xb89a('0x4'));var interaction=require(_0xb89a('0x5'));var config=require(_0xb89a('0x6'));var controller=require(_0xb89a('0x7'));router[_0xb89a('0x8')]('/',auth[_0xb89a('0x9')](),controller[_0xb89a('0xa')]);router[_0xb89a('0x8')](_0xb89a('0xb'),auth[_0xb89a('0x9')](),controller['show']);router[_0xb89a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb89a('0xd')]);router[_0xb89a('0xe')]('/:id',auth[_0xb89a('0x9')](),controller[_0xb89a('0xf')]);router[_0xb89a('0x10')](_0xb89a('0xb'),auth[_0xb89a('0x9')](),controller[_0xb89a('0x11')]);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 1ed23cb..2a915f6 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 _0xa445=['variable','keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x3b7891,_0x557a09){var _0x1d6669=function(_0x39f8a1){while(--_0x39f8a1){_0x3b7891['push'](_0x3b7891['shift']());}};_0x1d6669(++_0x557a09);}(_0xa445,0x7a));var _0x5a44=function(_0x139e34,_0x3e81b4){_0x139e34=_0x139e34-0x0;var _0xcab508=_0xa445[_0x139e34];return _0xcab508;};'use strict';var Sequelize=require(_0x5a44('0x0'));module[_0x5a44('0x1')]={'type':{'type':Sequelize[_0x5a44('0x2')](_0x5a44('0x3'),_0x5a44('0x4'),'customVariable',_0x5a44('0x5'),_0x5a44('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5a44('0x7')]},'key':{'type':Sequelize[_0x5a44('0x7')]},'keyType':{'type':Sequelize[_0x5a44('0x2')](_0x5a44('0x3'),_0x5a44('0x4'),_0x5a44('0x8'))},'keyContent':{'type':Sequelize[_0x5a44('0x7')]},'idField':{'type':Sequelize[_0x5a44('0x7')]},'nameField':{'type':Sequelize[_0x5a44('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcf39=['STRING','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcf39,0x170));var _0x9cf3=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0xcf39[_0x13fcaf];return _0x4fa631;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9cf3('0x0')](_0x9cf3('0x1'),'variable',_0x9cf3('0x2'),_0x9cf3('0x3'),'picklist'),'defaultValue':_0x9cf3('0x1')},'content':{'type':Sequelize[_0x9cf3('0x4')]},'key':{'type':Sequelize[_0x9cf3('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x9cf3('0x1'),'variable',_0x9cf3('0x2'))},'keyContent':{'type':Sequelize[_0x9cf3('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9cf3('0x4')]},'customField':{'type':Sequelize[_0x9cf3('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9cf3('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7919525..d3ffcde 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 _0xa40a=['nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x213f7e,_0x4c5d64){var _0x2f788f=function(_0x522346){while(--_0x522346){_0x213f7e['push'](_0x213f7e['shift']());}};_0x2f788f(++_0x4c5d64);}(_0xa40a,0xe3));var _0xaa40=function(_0x26ea7a,_0x35380a){_0x26ea7a=_0x26ea7a-0x0;var _0x1db05b=_0xa40a[_0x26ea7a];return _0x1db05b;};'use strict';var emlformat=require(_0xaa40('0x0'));var rimraf=require(_0xaa40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa40('0x2'));var rp=require(_0xaa40('0x3'));var moment=require(_0xaa40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa40('0x5'));var util=require(_0xaa40('0x6'));var path=require(_0xaa40('0x7'));var sox=require(_0xaa40('0x8'));var csv=require('to-csv');var ejs=require(_0xaa40('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa40('0xa'));var squel=require(_0xaa40('0xb'));var crypto=require(_0xaa40('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaa40('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa40('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa40('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa40('0x10'));var as=require(_0xaa40('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaa40('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa40('0x13'))['db'];function respondWithStatusCode(_0x40c8ea,_0x393c16){_0x393c16=_0x393c16||0xcc;return function(_0x582ef2){if(_0x582ef2){return _0x40c8ea[_0xaa40('0x14')](_0x393c16);}return _0x40c8ea[_0xaa40('0x15')](_0x393c16)[_0xaa40('0x16')]();};}function respondWithResult(_0x337683,_0x5c925e){_0x5c925e=_0x5c925e||0xc8;return function(_0x58fb8f){if(_0x58fb8f){return _0x337683[_0xaa40('0x15')](_0x5c925e)['json'](_0x58fb8f);}};}function respondWithFilteredResult(_0x5bf7a8,_0x6161f6){return function(_0x104a77){if(_0x104a77){var _0x2ebcc3=typeof _0x6161f6[_0xaa40('0x17')]==='undefined'&&typeof _0x6161f6[_0xaa40('0x18')]===_0xaa40('0x19');var _0x6385b5=_0x104a77[_0xaa40('0x1a')];var _0x3a60e0=_0x2ebcc3?0x0:_0x6161f6[_0xaa40('0x17')];var _0x4d80dd=_0x2ebcc3?_0x104a77[_0xaa40('0x1a')]:_0x6161f6[_0xaa40('0x17')]+_0x6161f6[_0xaa40('0x18')];var _0x1cf5b8;if(_0x4d80dd>=_0x6385b5){_0x4d80dd=_0x6385b5;_0x1cf5b8=0xc8;}else{_0x1cf5b8=0xce;}_0x5bf7a8[_0xaa40('0x15')](_0x1cf5b8);return _0x5bf7a8[_0xaa40('0x1b')](_0xaa40('0x1c'),_0x3a60e0+'-'+_0x4d80dd+'/'+_0x6385b5)[_0xaa40('0x1d')](_0x104a77);}return null;};}function patchUpdates(_0x290986){return function(_0x374b95){try{jsonpatch[_0xaa40('0x1e')](_0x374b95,_0x290986,!![]);}catch(_0x2035ef){return BPromise[_0xaa40('0x1f')](_0x2035ef);}return _0x374b95[_0xaa40('0x20')]();};}function saveUpdates(_0x219feb,_0x2d1ee7){return function(_0x72a7a4){if(_0x72a7a4){return _0x72a7a4['update'](_0x219feb)[_0xaa40('0x21')](function(_0x46db5f){return _0x46db5f;});}return null;};}function removeEntity(_0x2b8056,_0x1eb293){return function(_0x32f87b){if(_0x32f87b){return _0x32f87b[_0xaa40('0x22')]()['then'](function(){_0x2b8056[_0xaa40('0x15')](0xcc)[_0xaa40('0x16')]();});}};}function handleEntityNotFound(_0x107a11,_0xff0e7d){return function(_0x4e6420){if(!_0x4e6420){_0x107a11['sendStatus'](0x194);}return _0x4e6420;};}function handleError(_0x454a00,_0x26875b){_0x26875b=_0x26875b||0x1f4;return function(_0x2feb15){logger['error'](_0x2feb15[_0xaa40('0x23')]);if(_0x2feb15[_0xaa40('0x24')]){delete _0x2feb15[_0xaa40('0x24')];}_0x454a00['status'](_0x26875b)[_0xaa40('0x25')](_0x2feb15);};}exports[_0xaa40('0x26')]=function(_0xeb64c8,_0x4cb217){var _0x286db6={},_0x20f583={},_0x3bb5a5={'count':0x0,'rows':[]};var _0xb36b38=_['map'](db[_0xaa40('0x27')][_0xaa40('0x28')],function(_0x15338a){return{'name':_0x15338a[_0xaa40('0x29')],'type':_0x15338a[_0xaa40('0x2a')][_0xaa40('0x2b')]};});_0x20f583[_0xaa40('0x2c')]=_[_0xaa40('0x2d')](_0xb36b38,_0xaa40('0x24'));_0x20f583[_0xaa40('0x2e')]=_[_0xaa40('0x2f')](_0xeb64c8[_0xaa40('0x2e')]);_0x20f583[_0xaa40('0x30')]=_[_0xaa40('0x31')](_0x20f583[_0xaa40('0x2c')],_0x20f583['query']);_0x286db6[_0xaa40('0x32')]=_[_0xaa40('0x31')](_0x20f583[_0xaa40('0x2c')],qs['fields'](_0xeb64c8['query'][_0xaa40('0x33')]));_0x286db6[_0xaa40('0x32')]=_0x286db6[_0xaa40('0x32')][_0xaa40('0x34')]?_0x286db6[_0xaa40('0x32')]:_0x20f583[_0xaa40('0x2c')];if(!_0xeb64c8[_0xaa40('0x2e')]['hasOwnProperty'](_0xaa40('0x35'))){_0x286db6[_0xaa40('0x18')]=qs[_0xaa40('0x18')](_0xeb64c8['query']['limit']);_0x286db6[_0xaa40('0x17')]=qs[_0xaa40('0x17')](_0xeb64c8['query'][_0xaa40('0x17')]);}_0x286db6[_0xaa40('0x36')]=qs[_0xaa40('0x37')](_0xeb64c8[_0xaa40('0x2e')][_0xaa40('0x37')]);_0x286db6[_0xaa40('0x38')]=qs[_0xaa40('0x30')](_[_0xaa40('0x39')](_0xeb64c8[_0xaa40('0x2e')],_0x20f583[_0xaa40('0x30')]),_0xb36b38);if(_0xeb64c8['query']['filter']){_0x286db6[_0xaa40('0x38')]=_['merge'](_0x286db6[_0xaa40('0x38')],{'$or':_[_0xaa40('0x2d')](_0xb36b38,function(_0x33d0a0){if(_0x33d0a0[_0xaa40('0x2a')]!==_0xaa40('0x3a')){var _0xbeca53={};_0xbeca53[_0x33d0a0[_0xaa40('0x24')]]={'$like':'%'+_0xeb64c8[_0xaa40('0x2e')]['filter']+'%'};return _0xbeca53;}})});}_0x286db6=_[_0xaa40('0x3b')]({},_0x286db6,_0xeb64c8[_0xaa40('0x3c')]);var _0x5afb6c={'where':_0x286db6['where']};return db[_0xaa40('0x27')][_0xaa40('0x1a')](_0x5afb6c)[_0xaa40('0x21')](function(_0x3f8f1d){_0x3bb5a5[_0xaa40('0x1a')]=_0x3f8f1d;if(_0xeb64c8['query'][_0xaa40('0x3d')]){_0x286db6[_0xaa40('0x3e')]=[{'all':!![]}];}return db[_0xaa40('0x27')]['findAll'](_0x286db6);})[_0xaa40('0x21')](function(_0x1c8412){_0x3bb5a5['rows']=_0x1c8412;return _0x3bb5a5;})[_0xaa40('0x21')](respondWithFilteredResult(_0x4cb217,_0x286db6))[_0xaa40('0x3f')](handleError(_0x4cb217,null));};exports[_0xaa40('0x40')]=function(_0x42cbfb,_0x16f8da){var _0x3cba27={'raw':!![],'where':{'id':_0x42cbfb[_0xaa40('0x41')]['id']}},_0x172c94={};_0x172c94['model']=_[_0xaa40('0x2f')](db[_0xaa40('0x27')][_0xaa40('0x28')]);_0x172c94[_0xaa40('0x2e')]=_[_0xaa40('0x2f')](_0x42cbfb[_0xaa40('0x2e')]);_0x172c94[_0xaa40('0x30')]=_[_0xaa40('0x31')](_0x172c94[_0xaa40('0x2c')],_0x172c94[_0xaa40('0x2e')]);_0x3cba27[_0xaa40('0x32')]=_[_0xaa40('0x31')](_0x172c94[_0xaa40('0x2c')],qs[_0xaa40('0x33')](_0x42cbfb['query']['fields']));_0x3cba27[_0xaa40('0x32')]=_0x3cba27[_0xaa40('0x32')][_0xaa40('0x34')]?_0x3cba27[_0xaa40('0x32')]:_0x172c94['model'];if(_0x42cbfb[_0xaa40('0x2e')]['includeAll']){_0x3cba27[_0xaa40('0x3e')]=[{'all':!![]}];}_0x3cba27=_[_0xaa40('0x3b')]({},_0x3cba27,_0x42cbfb[_0xaa40('0x3c')]);return db['Dynamics365Field'][_0xaa40('0x42')](_0x3cba27)[_0xaa40('0x21')](handleEntityNotFound(_0x16f8da,null))[_0xaa40('0x21')](respondWithResult(_0x16f8da,null))[_0xaa40('0x3f')](handleError(_0x16f8da,null));};exports['create']=function(_0x433cb9,_0x3ef428){return db['Dynamics365Field'][_0xaa40('0x43')](_0x433cb9[_0xaa40('0x44')],{})[_0xaa40('0x21')](respondWithResult(_0x3ef428,0xc9))[_0xaa40('0x3f')](handleError(_0x3ef428,null));};exports[_0xaa40('0x45')]=function(_0x85d341,_0x46d162){if(_0x85d341['body']['id']){delete _0x85d341['body']['id'];}return db[_0xaa40('0x27')][_0xaa40('0x42')]({'where':{'id':_0x85d341[_0xaa40('0x41')]['id']}})[_0xaa40('0x21')](handleEntityNotFound(_0x46d162,null))[_0xaa40('0x21')](saveUpdates(_0x85d341['body'],null))[_0xaa40('0x21')](respondWithResult(_0x46d162,null))['catch'](handleError(_0x46d162,null));};exports['destroy']=function(_0x4792bd,_0x5eb9d6){return db['Dynamics365Field'][_0xaa40('0x42')]({'where':{'id':_0x4792bd[_0xaa40('0x41')]['id']}})[_0xaa40('0x21')](handleEntityNotFound(_0x5eb9d6,null))[_0xaa40('0x21')](removeEntity(_0x5eb9d6,null))[_0xaa40('0x3f')](handleError(_0x5eb9d6,null));}; \ No newline at end of file +var _0xf95e=['name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then'];(function(_0x311c69,_0x2557df){var _0x302d4d=function(_0x26e149){while(--_0x26e149){_0x311c69['push'](_0x311c69['shift']());}};_0x302d4d(++_0x2557df);}(_0xf95e,0x6a));var _0xef95=function(_0x167f9e,_0x208fe4){_0x167f9e=_0x167f9e-0x0;var _0x51d75e=_0xf95e[_0x167f9e];return _0x51d75e;};'use strict';var emlformat=require(_0xef95('0x0'));var rimraf=require(_0xef95('0x1'));var zipdir=require(_0xef95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef95('0x3'));var moment=require(_0xef95('0x4'));var BPromise=require(_0xef95('0x5'));var Mustache=require(_0xef95('0x6'));var util=require(_0xef95('0x7'));var path=require(_0xef95('0x8'));var sox=require(_0xef95('0x9'));var csv=require(_0xef95('0xa'));var ejs=require(_0xef95('0xb'));var fs=require('fs');var fs_extra=require(_0xef95('0xc'));var _=require(_0xef95('0xd'));var squel=require(_0xef95('0xe'));var crypto=require('crypto');var jsforce=require(_0xef95('0xf'));var deskjs=require(_0xef95('0x10'));var toCsv=require(_0xef95('0xa'));var querystring=require('querystring');var Papa=require(_0xef95('0x11'));var Redis=require('ioredis');var authService=require(_0xef95('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xef95('0x13'));var hardwareService=require(_0xef95('0x14'));var logger=require('../../config/logger')(_0xef95('0x15'));var utils=require(_0xef95('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xef95('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf844b6,_0x216e67){_0x216e67=_0x216e67||0xcc;return function(_0x4bc0b0){if(_0x4bc0b0){return _0xf844b6[_0xef95('0x18')](_0x216e67);}return _0xf844b6[_0xef95('0x19')](_0x216e67)[_0xef95('0x1a')]();};}function respondWithResult(_0x8a1539,_0x95d09b){_0x95d09b=_0x95d09b||0xc8;return function(_0x5e57ab){if(_0x5e57ab){return _0x8a1539['status'](_0x95d09b)['json'](_0x5e57ab);}};}function respondWithFilteredResult(_0x3f91ab,_0x30bd9a){return function(_0x6f025f){if(_0x6f025f){var _0x1468c2=typeof _0x30bd9a[_0xef95('0x1b')]===_0xef95('0x1c')&&typeof _0x30bd9a[_0xef95('0x1d')]==='undefined';var _0x5dee73=_0x6f025f[_0xef95('0x1e')];var _0x1d5c09=_0x1468c2?0x0:_0x30bd9a['offset'];var _0x10c10b=_0x1468c2?_0x6f025f[_0xef95('0x1e')]:_0x30bd9a[_0xef95('0x1b')]+_0x30bd9a[_0xef95('0x1d')];var _0xfec56c;if(_0x10c10b>=_0x5dee73){_0x10c10b=_0x5dee73;_0xfec56c=0xc8;}else{_0xfec56c=0xce;}_0x3f91ab[_0xef95('0x19')](_0xfec56c);return _0x3f91ab[_0xef95('0x1f')](_0xef95('0x20'),_0x1d5c09+'-'+_0x10c10b+'/'+_0x5dee73)[_0xef95('0x21')](_0x6f025f);}return null;};}function patchUpdates(_0x561236){return function(_0x3e7942){try{jsonpatch[_0xef95('0x22')](_0x3e7942,_0x561236,!![]);}catch(_0x5fecd2){return BPromise['reject'](_0x5fecd2);}return _0x3e7942[_0xef95('0x23')]();};}function saveUpdates(_0x55bb4d,_0x35d12c){return function(_0x446a29){if(_0x446a29){return _0x446a29[_0xef95('0x24')](_0x55bb4d)[_0xef95('0x25')](function(_0x10f0de){return _0x10f0de;});}return null;};}function removeEntity(_0x17abda,_0x525406){return function(_0x2f217c){if(_0x2f217c){return _0x2f217c['destroy']()['then'](function(){_0x17abda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c05c9,_0xbebd87){return function(_0x36ef5b){if(!_0x36ef5b){_0x3c05c9[_0xef95('0x18')](0x194);}return _0x36ef5b;};}function handleError(_0x26d2a6,_0x8db209){_0x8db209=_0x8db209||0x1f4;return function(_0x11aaa4){logger['error'](_0x11aaa4['stack']);if(_0x11aaa4[_0xef95('0x26')]){delete _0x11aaa4[_0xef95('0x26')];}_0x26d2a6[_0xef95('0x19')](_0x8db209)[_0xef95('0x27')](_0x11aaa4);};}exports[_0xef95('0x28')]=function(_0x4d6492,_0x1f0656){var _0x24c4ce={},_0x3900b6={},_0x265f4b={'count':0x0,'rows':[]};var _0xb933ba=_[_0xef95('0x29')](db[_0xef95('0x2a')][_0xef95('0x2b')],function(_0x268dde){return{'name':_0x268dde[_0xef95('0x2c')],'type':_0x268dde['type']['key']};});_0x3900b6[_0xef95('0x2d')]=_['map'](_0xb933ba,_0xef95('0x26'));_0x3900b6[_0xef95('0x2e')]=_[_0xef95('0x2f')](_0x4d6492[_0xef95('0x2e')]);_0x3900b6[_0xef95('0x30')]=_[_0xef95('0x31')](_0x3900b6['model'],_0x3900b6[_0xef95('0x2e')]);_0x24c4ce[_0xef95('0x32')]=_[_0xef95('0x31')](_0x3900b6[_0xef95('0x2d')],qs[_0xef95('0x33')](_0x4d6492[_0xef95('0x2e')]['fields']));_0x24c4ce[_0xef95('0x32')]=_0x24c4ce[_0xef95('0x32')][_0xef95('0x34')]?_0x24c4ce['attributes']:_0x3900b6[_0xef95('0x2d')];if(!_0x4d6492['query'][_0xef95('0x35')](_0xef95('0x36'))){_0x24c4ce['limit']=qs['limit'](_0x4d6492[_0xef95('0x2e')]['limit']);_0x24c4ce[_0xef95('0x1b')]=qs[_0xef95('0x1b')](_0x4d6492[_0xef95('0x2e')][_0xef95('0x1b')]);}_0x24c4ce[_0xef95('0x37')]=qs[_0xef95('0x38')](_0x4d6492['query'][_0xef95('0x38')]);_0x24c4ce[_0xef95('0x39')]=qs['filters'](_['pick'](_0x4d6492[_0xef95('0x2e')],_0x3900b6['filters']),_0xb933ba);if(_0x4d6492[_0xef95('0x2e')]['filter']){_0x24c4ce['where']=_[_0xef95('0x3a')](_0x24c4ce[_0xef95('0x39')],{'$or':_[_0xef95('0x29')](_0xb933ba,function(_0x1b427f){if(_0x1b427f[_0xef95('0x3b')]!=='VIRTUAL'){var _0x279bf0={};_0x279bf0[_0x1b427f[_0xef95('0x26')]]={'$like':'%'+_0x4d6492[_0xef95('0x2e')][_0xef95('0x3c')]+'%'};return _0x279bf0;}})});}_0x24c4ce=_['merge']({},_0x24c4ce,_0x4d6492[_0xef95('0x3d')]);var _0x59488b={'where':_0x24c4ce[_0xef95('0x39')]};return db[_0xef95('0x2a')][_0xef95('0x1e')](_0x59488b)[_0xef95('0x25')](function(_0x5e866c){_0x265f4b[_0xef95('0x1e')]=_0x5e866c;if(_0x4d6492[_0xef95('0x2e')][_0xef95('0x3e')]){_0x24c4ce[_0xef95('0x3f')]=[{'all':!![]}];}return db[_0xef95('0x2a')]['findAll'](_0x24c4ce);})[_0xef95('0x25')](function(_0x23f18a){_0x265f4b[_0xef95('0x40')]=_0x23f18a;return _0x265f4b;})['then'](respondWithFilteredResult(_0x1f0656,_0x24c4ce))[_0xef95('0x41')](handleError(_0x1f0656,null));};exports[_0xef95('0x42')]=function(_0x39504a,_0x4319f1){var _0x5363c9={'raw':!![],'where':{'id':_0x39504a[_0xef95('0x43')]['id']}},_0x5bb7c1={};_0x5bb7c1['model']=_['keys'](db[_0xef95('0x2a')][_0xef95('0x2b')]);_0x5bb7c1[_0xef95('0x2e')]=_['keys'](_0x39504a[_0xef95('0x2e')]);_0x5bb7c1[_0xef95('0x30')]=_[_0xef95('0x31')](_0x5bb7c1[_0xef95('0x2d')],_0x5bb7c1[_0xef95('0x2e')]);_0x5363c9[_0xef95('0x32')]=_[_0xef95('0x31')](_0x5bb7c1[_0xef95('0x2d')],qs[_0xef95('0x33')](_0x39504a[_0xef95('0x2e')][_0xef95('0x33')]));_0x5363c9['attributes']=_0x5363c9['attributes'][_0xef95('0x34')]?_0x5363c9[_0xef95('0x32')]:_0x5bb7c1['model'];if(_0x39504a[_0xef95('0x2e')]['includeAll']){_0x5363c9[_0xef95('0x3f')]=[{'all':!![]}];}_0x5363c9=_[_0xef95('0x3a')]({},_0x5363c9,_0x39504a[_0xef95('0x3d')]);return db[_0xef95('0x2a')][_0xef95('0x44')](_0x5363c9)[_0xef95('0x25')](handleEntityNotFound(_0x4319f1,null))[_0xef95('0x25')](respondWithResult(_0x4319f1,null))[_0xef95('0x41')](handleError(_0x4319f1,null));};exports[_0xef95('0x45')]=function(_0x133458,_0x1956af){return db['Dynamics365Field'][_0xef95('0x45')](_0x133458['body'],{})[_0xef95('0x25')](respondWithResult(_0x1956af,0xc9))[_0xef95('0x41')](handleError(_0x1956af,null));};exports[_0xef95('0x24')]=function(_0x2b6020,_0x1ae114){if(_0x2b6020[_0xef95('0x46')]['id']){delete _0x2b6020[_0xef95('0x46')]['id'];}return db['Dynamics365Field'][_0xef95('0x44')]({'where':{'id':_0x2b6020[_0xef95('0x43')]['id']}})[_0xef95('0x25')](handleEntityNotFound(_0x1ae114,null))[_0xef95('0x25')](saveUpdates(_0x2b6020[_0xef95('0x46')],null))['then'](respondWithResult(_0x1ae114,null))[_0xef95('0x41')](handleError(_0x1ae114,null));};exports[_0xef95('0x47')]=function(_0x90e597,_0x540a67){return db['Dynamics365Field'][_0xef95('0x44')]({'where':{'id':_0x90e597['params']['id']}})['then'](handleEntityNotFound(_0x540a67,null))['then'](removeEntity(_0x540a67,null))['catch'](handleError(_0x540a67,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8917ac0..eb56a3c 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 _0xc92c=['int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0xac2edb,_0x7ee06d){var _0x5eb36e=function(_0x4e9e37){while(--_0x4e9e37){_0xac2edb['push'](_0xac2edb['shift']());}};_0x5eb36e(++_0x7ee06d);}(_0xc92c,0x16f));var _0xcc92=function(_0x6bd121,_0x3963f8){_0x6bd121=_0x6bd121-0x0;var _0x1a0ec3=_0xc92c[_0x6bd121];return _0x1a0ec3;};'use strict';var _=require(_0xcc92('0x0'));var util=require(_0xcc92('0x1'));var logger=require(_0xcc92('0x2'))('api');var moment=require(_0xcc92('0x3'));var BPromise=require(_0xcc92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc92('0x5'));var rimraf=require(_0xcc92('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc92('0x7'));module[_0xcc92('0x8')]=function(_0x70b44f,_0x4cd90a){return _0x70b44f[_0xcc92('0x9')](_0xcc92('0xa'),attributes,{'tableName':_0xcc92('0xb'),'paranoid':![],'indexes':[{'name':_0xcc92('0xc'),'fields':[_0xcc92('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f5c=['int_dynamics365_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x436137,_0x1ae35d){var _0xeddc14=function(_0x4bc8ad){while(--_0x4bc8ad){_0x436137['push'](_0x436137['shift']());}};_0xeddc14(++_0x1ae35d);}(_0x3f5c,0x113));var _0xc3f5=function(_0x55cc7e,_0x3475be){_0x55cc7e=_0x55cc7e-0x0;var _0x884a75=_0x3f5c[_0x55cc7e];return _0x884a75;};'use strict';var _=require(_0xc3f5('0x0'));var util=require(_0xc3f5('0x1'));var logger=require(_0xc3f5('0x2'))(_0xc3f5('0x3'));var moment=require('moment');var BPromise=require(_0xc3f5('0x4'));var rp=require(_0xc3f5('0x5'));var fs=require('fs');var path=require(_0xc3f5('0x6'));var rimraf=require(_0xc3f5('0x7'));var config=require('../../config/environment');var attributes=require(_0xc3f5('0x8'));module[_0xc3f5('0x9')]=function(_0x37daa5,_0x51a86b){return _0x37daa5['define'](_0xc3f5('0xa'),attributes,{'tableName':_0xc3f5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0xc3f5('0xc')],'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 8de1498..d93ae67 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 _0xc21e=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash'];(function(_0x200618,_0x9cf7c2){var _0x2fe3bb=function(_0xcecdf7){while(--_0xcecdf7){_0x200618['push'](_0x200618['shift']());}};_0x2fe3bb(++_0x9cf7c2);}(_0xc21e,0x17b));var _0xec21=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc21e[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xec21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec21('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec21('0x2'));var db=require(_0xec21('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x4'))(_0xec21('0x5'));var config=require(_0xec21('0x6'));var jayson=require(_0xec21('0x7'));var client=jayson['client'][_0xec21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1438b2,_0x5d7f8c,_0x310012){return new BPromise(function(_0x3d818f,_0x17ee07){return client[_0xec21('0x9')](_0x1438b2,_0x310012)[_0xec21('0xa')](function(_0x245a60){logger['info'](_0xec21('0xb'),_0x5d7f8c,_0xec21('0xc'));logger[_0xec21('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5d7f8c,_0xec21('0xc'),JSON['stringify'](_0x245a60));if(_0x245a60[_0xec21('0xe')]){if(_0x245a60[_0xec21('0xe')][_0xec21('0xf')]===0x1f4){logger['error'](_0xec21('0xb'),_0x5d7f8c,_0x245a60[_0xec21('0xe')][_0xec21('0x10')]);return _0x17ee07(_0x245a60[_0xec21('0xe')]['message']);}logger[_0xec21('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x5d7f8c,_0x245a60['error'][_0xec21('0x10')]);return _0x3d818f(_0x245a60[_0xec21('0xe')][_0xec21('0x10')]);}else{logger[_0xec21('0x11')](_0xec21('0xb'),_0x5d7f8c,_0xec21('0xc'));_0x3d818f(_0x245a60[_0xec21('0x12')][_0xec21('0x10')]);}})[_0xec21('0x13')](function(_0x3ae3a7){logger[_0xec21('0xe')](_0xec21('0xb'),_0x5d7f8c,_0x3ae3a7);_0x17ee07(_0x3ae3a7);});});} \ No newline at end of file +var _0x045f=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','info'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x045f,0x1b7));var _0xf045=function(_0x5b445b,_0xd251da){_0x5b445b=_0x5b445b-0x0;var _0x1a40fe=_0x045f[_0x5b445b];return _0x1a40fe;};'use strict';var _=require('lodash');var util=require(_0xf045('0x0'));var moment=require(_0xf045('0x1'));var BPromise=require(_0xf045('0x2'));var rs=require(_0xf045('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf045('0x4'))['db'];var utils=require(_0xf045('0x5'));var logger=require('../../config/logger')(_0xf045('0x6'));var config=require(_0xf045('0x7'));var jayson=require(_0xf045('0x8'));var client=jayson['client'][_0xf045('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b7bbf,_0x195b6e,_0xbc9bdb){return new BPromise(function(_0x49a4ae,_0x1e6cec){return client[_0xf045('0xa')](_0x2b7bbf,_0xbc9bdb)[_0xf045('0xb')](function(_0x568d90){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x195b6e,'request\x20sent');logger[_0xf045('0xc')](_0xf045('0xd'),_0x195b6e,_0xf045('0xe'),JSON[_0xf045('0xf')](_0x568d90));if(_0x568d90[_0xf045('0x10')]){if(_0x568d90[_0xf045('0x10')][_0xf045('0x11')]===0x1f4){logger[_0xf045('0x10')](_0xf045('0x12'),_0x195b6e,_0x568d90[_0xf045('0x10')]['message']);return _0x1e6cec(_0x568d90[_0xf045('0x10')][_0xf045('0x13')]);}logger[_0xf045('0x10')](_0xf045('0x12'),_0x195b6e,_0x568d90[_0xf045('0x10')][_0xf045('0x13')]);return _0x49a4ae(_0x568d90[_0xf045('0x10')][_0xf045('0x13')]);}else{logger[_0xf045('0x14')](_0xf045('0x12'),_0x195b6e,'request\x20sent');_0x49a4ae(_0x568d90[_0xf045('0x15')][_0xf045('0x13')]);}})[_0xf045('0x16')](function(_0x19990f){logger[_0xf045('0x10')](_0xf045('0x12'),_0x195b6e,_0x19990f);_0x1e6cec(_0x19990f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d08ac0f..e0bb854 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 _0x1b6a=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','create','post','put','update'];(function(_0x1bec0d,_0x338db4){var _0x49e3e3=function(_0x372c7a){while(--_0x372c7a){_0x1bec0d['push'](_0x1bec0d['shift']());}};_0x49e3e3(++_0x338db4);}(_0x1b6a,0x11b));var _0xa1b6=function(_0x4d8857,_0x3428c0){_0x4d8857=_0x4d8857-0x0;var _0x34bf9a=_0x1b6a[_0x4d8857];return _0x34bf9a;};'use strict';var multer=require(_0xa1b6('0x0'));var util=require(_0xa1b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1b6('0x2'));var router=express[_0xa1b6('0x3')]();var fs_extra=require(_0xa1b6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa1b6('0x5'));var config=require(_0xa1b6('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x8')]);router[_0xa1b6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa1b6('0xa')]);router[_0xa1b6('0x9')](_0xa1b6('0xb'),auth['isAuthenticated'](),controller[_0xa1b6('0xc')]);router['get']('/:id/fields',auth[_0xa1b6('0x7')](),controller['getFields']);router['post']('/',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0xd')]);router[_0xa1b6('0xe')](_0xa1b6('0xb'),auth[_0xa1b6('0x7')](),controller['addConfiguration']);router[_0xa1b6('0xf')]('/:id',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x10')]);router[_0xa1b6('0x11')]('/:id',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x12')]);module[_0xa1b6('0x13')]=router; \ No newline at end of file +var _0xa050=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','multer'];(function(_0x2c50ed,_0x563374){var _0x50d07d=function(_0x5477de){while(--_0x5477de){_0x2c50ed['push'](_0x2c50ed['shift']());}};_0x50d07d(++_0x563374);}(_0xa050,0x133));var _0x0a05=function(_0x46c51b,_0x300ce7){_0x46c51b=_0x46c51b-0x0;var _0x21c550=_0xa050[_0x46c51b];return _0x21c550;};'use strict';var multer=require(_0x0a05('0x0'));var util=require(_0x0a05('0x1'));var path=require(_0x0a05('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a05('0x3'));var router=express[_0x0a05('0x4')]();var fs_extra=require(_0x0a05('0x5'));var auth=require(_0x0a05('0x6'));var interaction=require(_0x0a05('0x7'));var config=require(_0x0a05('0x8'));var controller=require(_0x0a05('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0a05('0xa')](_0x0a05('0xb'),auth[_0x0a05('0xc')](),controller['show']);router['get'](_0x0a05('0xd'),auth[_0x0a05('0xc')](),controller[_0x0a05('0xe')]);router[_0x0a05('0xa')](_0x0a05('0xf'),auth[_0x0a05('0xc')](),controller[_0x0a05('0x10')]);router[_0x0a05('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a05('0x11')](_0x0a05('0xd'),auth[_0x0a05('0xc')](),controller['addConfiguration']);router[_0x0a05('0x12')]('/:id',auth[_0x0a05('0xc')](),controller[_0x0a05('0x13')]);router[_0x0a05('0x14')](_0x0a05('0xb'),auth[_0x0a05('0xc')](),controller[_0x0a05('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8858f12..e58a7ad 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 _0x236c=['remoteUri','sequelize','STRING','username'];(function(_0x25771c,_0x4573df){var _0x68c135=function(_0x473345){while(--_0x473345){_0x25771c['push'](_0x25771c['shift']());}};_0x68c135(++_0x4573df);}(_0x236c,0x155));var _0xc236=function(_0x280afc,_0x299ac0){_0x280afc=_0x280afc-0x0;var _0x58a6ae=_0x236c[_0x280afc];return _0x58a6ae;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')]},'description':{'type':Sequelize[_0xc236('0x1')]},'username':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2')},'apiKey':{'type':Sequelize[_0xc236('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc236('0x3')},'serverUrl':{'type':Sequelize[_0xc236('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x1f0cd3,_0x1604e9){var _0x5c9f9a=function(_0x2f02b6){while(--_0x2f02b6){_0x1f0cd3['push'](_0x1f0cd3['shift']());}};_0x5c9f9a(++_0x1604e9);}(_0x5464,0x15d));var _0x4546=function(_0x556b58,_0x44ed1e){_0x556b58=_0x556b58-0x0;var _0x30d758=_0x5464[_0x556b58];return _0x30d758;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('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 a7e216f..0ddcf5b 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 _0x45c8=['requester','subject','agent','description','source','group','remove','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x45c8,0xef));var _0x845c=function(_0x5dba73,_0xba61f0){_0x5dba73=_0x5dba73-0x0;var _0x90c71d=_0x45c8[_0x5dba73];return _0x90c71d;};'use strict';var emlformat=require(_0x845c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x845c('0x1'));var jsonpatch=require(_0x845c('0x2'));var rp=require(_0x845c('0x3'));var moment=require(_0x845c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x845c('0x5'));var csv=require(_0x845c('0x6'));var ejs=require(_0x845c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x845c('0x8'));var squel=require('squel');var crypto=require(_0x845c('0x9'));var jsforce=require(_0x845c('0xa'));var deskjs=require(_0x845c('0xb'));var toCsv=require(_0x845c('0x6'));var querystring=require(_0x845c('0xc'));var Papa=require(_0x845c('0xd'));var Redis=require(_0x845c('0xe'));var authService=require(_0x845c('0xf'));var qs=require(_0x845c('0x10'));var as=require(_0x845c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x845c('0x12'));var utils=require(_0x845c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x845c('0x14'));var db=require(_0x845c('0x15'))['db'];var integrations=require(_0x845c('0x16'));function respondWithStatusCode(_0x3312bd,_0x469056){_0x469056=_0x469056||0xcc;return function(_0x246cef){if(_0x246cef){return _0x3312bd['sendStatus'](_0x469056);}return _0x3312bd[_0x845c('0x17')](_0x469056)[_0x845c('0x18')]();};}function respondWithResult(_0x5c0d9c,_0x185eb0){_0x185eb0=_0x185eb0||0xc8;return function(_0x3ca30e){if(_0x3ca30e){return _0x5c0d9c[_0x845c('0x17')](_0x185eb0)[_0x845c('0x19')](_0x3ca30e);}};}function respondWithFilteredResult(_0xf0cc1b,_0x27cedd){return function(_0x14b400){if(_0x14b400){var _0x4cbe3d=typeof _0x27cedd['offset']===_0x845c('0x1a')&&typeof _0x27cedd[_0x845c('0x1b')]===_0x845c('0x1a');var _0x4ac4d0=_0x14b400[_0x845c('0x1c')];var _0x104314=_0x4cbe3d?0x0:_0x27cedd[_0x845c('0x1d')];var _0x48e7d4=_0x4cbe3d?_0x14b400['count']:_0x27cedd['offset']+_0x27cedd[_0x845c('0x1b')];var _0x5171ed;if(_0x48e7d4>=_0x4ac4d0){_0x48e7d4=_0x4ac4d0;_0x5171ed=0xc8;}else{_0x5171ed=0xce;}_0xf0cc1b[_0x845c('0x17')](_0x5171ed);return _0xf0cc1b[_0x845c('0x1e')](_0x845c('0x1f'),_0x104314+'-'+_0x48e7d4+'/'+_0x4ac4d0)[_0x845c('0x19')](_0x14b400);}return null;};}function patchUpdates(_0x4629d4){return function(_0x55418b){try{jsonpatch[_0x845c('0x20')](_0x55418b,_0x4629d4,!![]);}catch(_0x513ba1){return BPromise[_0x845c('0x21')](_0x513ba1);}return _0x55418b['save']();};}function saveUpdates(_0x2c6bc8,_0x5767e8){return function(_0x18ed7c){if(_0x18ed7c){return _0x18ed7c['update'](_0x2c6bc8)[_0x845c('0x22')](function(_0x21dfef){return _0x21dfef;});}return null;};}function removeEntity(_0x362975,_0x129b6e){return function(_0x132516){if(_0x132516){return _0x132516[_0x845c('0x23')]()['then'](function(){_0x362975[_0x845c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26327b,_0x28f05d){return function(_0x49a2ef){if(!_0x49a2ef){_0x26327b[_0x845c('0x24')](0x194);}return _0x49a2ef;};}function handleError(_0x236529,_0x189c19){_0x189c19=_0x189c19||0x1f4;return function(_0x5ca436){logger['error'](_0x5ca436[_0x845c('0x25')]);if(_0x5ca436[_0x845c('0x26')]){delete _0x5ca436[_0x845c('0x26')];}_0x236529['status'](_0x189c19)[_0x845c('0x27')](_0x5ca436);};}exports[_0x845c('0x28')]=function(_0x447d69,_0x2ba824){var _0x5d7b58={},_0x19a44b={},_0x2003f6={'count':0x0,'rows':[]};var _0x32ba01=_['map'](db[_0x845c('0x29')][_0x845c('0x2a')],function(_0x578d3b){return{'name':_0x578d3b[_0x845c('0x2b')],'type':_0x578d3b[_0x845c('0x2c')][_0x845c('0x2d')]};});_0x19a44b[_0x845c('0x2e')]=_['map'](_0x32ba01,'name');_0x19a44b[_0x845c('0x2f')]=_[_0x845c('0x30')](_0x447d69[_0x845c('0x2f')]);_0x19a44b[_0x845c('0x31')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],_0x19a44b[_0x845c('0x2f')]);_0x5d7b58[_0x845c('0x33')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x447d69['query'][_0x845c('0x34')]));_0x5d7b58['attributes']=_0x5d7b58[_0x845c('0x33')][_0x845c('0x35')]?_0x5d7b58[_0x845c('0x33')]:_0x19a44b[_0x845c('0x2e')];if(!_0x447d69[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x5d7b58[_0x845c('0x1b')]=qs['limit'](_0x447d69['query'][_0x845c('0x1b')]);_0x5d7b58['offset']=qs[_0x845c('0x1d')](_0x447d69['query'][_0x845c('0x1d')]);}_0x5d7b58['order']=qs['sort'](_0x447d69[_0x845c('0x2f')][_0x845c('0x37')]);_0x5d7b58[_0x845c('0x38')]=qs[_0x845c('0x31')](_[_0x845c('0x39')](_0x447d69[_0x845c('0x2f')],_0x19a44b['filters']),_0x32ba01);if(_0x447d69[_0x845c('0x2f')]['filter']){_0x5d7b58[_0x845c('0x38')]=_[_0x845c('0x3a')](_0x5d7b58[_0x845c('0x38')],{'$or':_[_0x845c('0x3b')](_0x32ba01,function(_0x3563e8){if(_0x3563e8[_0x845c('0x2c')]!==_0x845c('0x3c')){var _0x3510cc={};_0x3510cc[_0x3563e8[_0x845c('0x26')]]={'$like':'%'+_0x447d69['query'][_0x845c('0x3d')]+'%'};return _0x3510cc;}})});}_0x5d7b58=_[_0x845c('0x3a')]({},_0x5d7b58,_0x447d69[_0x845c('0x3e')]);var _0x20227d={'where':_0x5d7b58[_0x845c('0x38')]};return db[_0x845c('0x29')][_0x845c('0x1c')](_0x20227d)[_0x845c('0x22')](function(_0x22b604){_0x2003f6[_0x845c('0x1c')]=_0x22b604;if(_0x447d69['query'][_0x845c('0x3f')]){_0x5d7b58[_0x845c('0x40')]=[{'all':!![]}];}return db[_0x845c('0x29')][_0x845c('0x41')](_0x5d7b58);})['then'](function(_0x12907e){_0x2003f6['rows']=_0x12907e;return _0x2003f6;})['then'](respondWithFilteredResult(_0x2ba824,_0x5d7b58))[_0x845c('0x42')](handleError(_0x2ba824,null));};exports['show']=function(_0x54d515,_0x4435b8){var _0x1022ad={'raw':![],'where':{'id':_0x54d515[_0x845c('0x43')]['id']}},_0x3d0cad={};_0x3d0cad['model']=_['keys'](db['FreshdeskAccount'][_0x845c('0x2a')]);_0x3d0cad[_0x845c('0x2f')]=_['keys'](_0x54d515['query']);_0x3d0cad[_0x845c('0x31')]=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],_0x3d0cad[_0x845c('0x2f')]);_0x1022ad['attributes']=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x54d515['query'][_0x845c('0x34')]));_0x1022ad[_0x845c('0x33')]=_0x1022ad[_0x845c('0x33')][_0x845c('0x35')]?_0x1022ad[_0x845c('0x33')]:_0x3d0cad['model'];if(_0x54d515[_0x845c('0x2f')]['includeAll']){_0x1022ad[_0x845c('0x40')]=[{'all':!![]}];}_0x1022ad=_[_0x845c('0x3a')]({},_0x1022ad,_0x54d515[_0x845c('0x3e')]);return db[_0x845c('0x29')][_0x845c('0x44')](_0x1022ad)[_0x845c('0x22')](handleEntityNotFound(_0x4435b8,null))[_0x845c('0x22')](respondWithResult(_0x4435b8,null))[_0x845c('0x42')](handleError(_0x4435b8,null));};exports[_0x845c('0x45')]=function(_0x4c706b,_0xeb86a5){return db['FreshdeskAccount'][_0x845c('0x45')](_0x4c706b[_0x845c('0x46')],{})[_0x845c('0x22')](respondWithResult(_0xeb86a5,0xc9))[_0x845c('0x42')](handleError(_0xeb86a5,null));};exports[_0x845c('0x47')]=function(_0x380b74,_0xde0287){if(_0x380b74[_0x845c('0x46')]['id']){delete _0x380b74[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x380b74[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0xde0287,null))[_0x845c('0x22')](saveUpdates(_0x380b74[_0x845c('0x46')],null))[_0x845c('0x22')](respondWithResult(_0xde0287,null))['catch'](handleError(_0xde0287,null));};exports[_0x845c('0x23')]=function(_0x1f2f80,_0x41a4c9){return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x1f2f80[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0x41a4c9,null))['then'](removeEntity(_0x41a4c9,null))['catch'](handleError(_0x41a4c9,null));};exports[_0x845c('0x48')]=function(_0x3b5059,_0x3a8a67,_0x526dba){var _0x4766f2={};var _0xed4ab2={};var _0x369ff6;var _0x4b582c;return db['FreshdeskAccount'][_0x845c('0x49')]({'where':{'id':_0x3b5059[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a8a67,null))[_0x845c('0x22')](function(_0x5f39a7){if(_0x5f39a7){_0x369ff6=_0x5f39a7;_0xed4ab2[_0x845c('0x2e')]=_[_0x845c('0x30')](db[_0x845c('0x4a')][_0x845c('0x2a')]);_0xed4ab2[_0x845c('0x2f')]=_['keys'](_0x3b5059['query']);_0xed4ab2[_0x845c('0x31')]=_['intersection'](_0xed4ab2[_0x845c('0x2e')],_0xed4ab2[_0x845c('0x2f')]);_0x4766f2[_0x845c('0x33')]=_[_0x845c('0x32')](_0xed4ab2['model'],qs[_0x845c('0x34')](_0x3b5059[_0x845c('0x2f')][_0x845c('0x34')]));_0x4766f2[_0x845c('0x33')]=_0x4766f2['attributes'][_0x845c('0x35')]?_0x4766f2[_0x845c('0x33')]:_0xed4ab2[_0x845c('0x2e')];_0x4766f2[_0x845c('0x4b')]=qs[_0x845c('0x37')](_0x3b5059[_0x845c('0x2f')]['sort']);_0x4766f2['where']=qs['filters'](_['pick'](_0x3b5059[_0x845c('0x2f')],_0xed4ab2[_0x845c('0x31')]));if(_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]){_0x4766f2['where']=_[_0x845c('0x3a')](_0x4766f2[_0x845c('0x38')],{'$or':_['map'](_0x4766f2[_0x845c('0x33')],function(_0x540dda){var _0x5e0ded={};_0x5e0ded[_0x540dda]={'$like':'%'+_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]+'%'};return _0x5e0ded;})});}_0x4766f2=_[_0x845c('0x3a')]({},_0x4766f2,_0x3b5059[_0x845c('0x3e')]);return _0x369ff6['getConfigurations'](_0x4766f2);}})['then'](function(_0x30017d){if(_0x30017d){_0x4b582c=_0x30017d[_0x845c('0x35')];if(!_0x3b5059[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x4766f2[_0x845c('0x1b')]=qs[_0x845c('0x1b')](_0x3b5059['query'][_0x845c('0x1b')]);_0x4766f2[_0x845c('0x1d')]=qs[_0x845c('0x1d')](_0x3b5059['query'][_0x845c('0x1d')]);}return _0x369ff6['getConfigurations'](_0x4766f2);}})[_0x845c('0x22')](function(_0x463f09){if(_0x463f09){return _0x463f09?{'count':_0x4b582c,'rows':_0x463f09}:null;}})[_0x845c('0x22')](respondWithResult(_0x3a8a67,null))[_0x845c('0x42')](handleError(_0x3a8a67,null));};exports[_0x845c('0x4c')]=function(_0x709945,_0x413ddc,_0xb3e7f){if(_0x709945[_0x845c('0x46')]['id']){delete _0x709945[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x709945[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x413ddc,null))[_0x845c('0x22')](function(_0x439e2c){if(_0x439e2c){_0x709945['body'][_0x845c('0x4d')]=_0x439e2c['id'];_0x709945[_0x845c('0x46')][_0x845c('0x4e')]=integrations[_0x845c('0x4f')](_0x709945['body']['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);_0x709945[_0x845c('0x46')]['Descriptions']=integrations[_0x845c('0x50')](_0x709945[_0x845c('0x46')]['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);return db[_0x845c('0x4a')][_0x845c('0x45')](_0x709945[_0x845c('0x46')],{'include':[{'model':db[_0x845c('0x51')],'as':_0x845c('0x4e')},{'model':db[_0x845c('0x51')],'as':_0x845c('0x52')}]});}return null;})[_0x845c('0x22')](respondWithResult(_0x413ddc,null))[_0x845c('0x42')](handleError(_0x413ddc,null));};exports[_0x845c('0x53')]=function(_0x2eda3e,_0x1a50f9,_0x25bcc0){var _0x41c577='';return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x2eda3e[_0x845c('0x43')]['id']},'attributes':['id',_0x845c('0x54'),'apiKey']})[_0x845c('0x22')](handleEntityNotFound(_0x1a50f9,null))[_0x845c('0x22')](function(_0x321574){if(_0x321574){_0x41c577=_0x321574[_0x845c('0x54')];var _0x248dff=_0x41c577[_0x845c('0x55')](-0x1);if(_0x248dff==='/'){_0x41c577=_0x41c577['substring'](0x0,_0x41c577['lastIndexOf'](_0x248dff));}return rp({'method':_0x845c('0x56'),'uri':util[_0x845c('0x57')](_0x845c('0x58'),_0x41c577,_0x845c('0x59')),'headers':{'Authorization':util[_0x845c('0x57')](_0x845c('0x5a'),new Buffer(util[_0x845c('0x57')](_0x845c('0x5b'),_0x321574[_0x845c('0x5c')]))['toString'](_0x845c('0x5d')))},'json':!![]});}})['then'](function(_0x457036){if(_0x457036){var _0x1f340e=[_0x845c('0x5e'),_0x845c('0x5f'),_0x845c('0x60'),_0x845c('0x61'),_0x845c('0x17'),'priority','group',_0x845c('0x62'),'ticket_type',_0x845c('0x63'),'company'];_[_0x845c('0x64')](_0x457036,function(_0x4ddde7){return _0x1f340e['includes'](_0x4ddde7['name'])||!_0x4ddde7[_0x845c('0x65')]&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x66')&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x67');});return{'count':_0x457036[_0x845c('0x35')],'rows':_[_0x845c('0x3b')](_0x457036,function(_0x2b4aab){return{'id':_0x2b4aab[_0x845c('0x26')],'name':_0x2b4aab[_0x845c('0x68')],'custom':!_0x2b4aab['default'],'options':_0x2b4aab['choices']?_['map'](_0x2b4aab[_0x845c('0x69')],function(_0x240ddb){return{'name':_['capitalize'](_0x240ddb),'value':_0x240ddb};}):[]};})};}})[_0x845c('0x22')](respondWithResult(_0x1a50f9,null))[_0x845c('0x42')](function(_0x1a4e34){var _0x10b298=_0x2eda3e['query'][_0x845c('0x6a')]?0x1f4:_0x1a4e34[_0x845c('0x6b')]||0x1f4;logger[_0x845c('0x6c')](_0x845c('0x6d'),_0x845c('0x53'),_0x10b298,JSON['stringify'](_0x1a4e34));delete _0x1a4e34['name'];if(_0x10b298===0x191){_0x10b298=0x190;}_0x1a50f9[_0x845c('0x17')](_0x10b298)[_0x845c('0x27')](_0x2eda3e[_0x845c('0x2f')][_0x845c('0x6a')]?{'message':_0x845c('0x6e'),'statusCode':_0x1a4e34[_0x845c('0x6b')]}:_0x1a4e34);});}; \ No newline at end of file +var _0x3f8c=['FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','format','%s/%s','Basic\x20%s','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','default','custom_text','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','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','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3f8c,0x104));var _0xc3f8=function(_0x1fd3f8,_0x4cdfe3){_0x1fd3f8=_0x1fd3f8-0x0;var _0x49aba9=_0x3f8c[_0x1fd3f8];return _0x49aba9;};'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'];var integrations=require(_0xc3f8('0x16'));function respondWithStatusCode(_0x155c80,_0x511763){_0x511763=_0x511763||0xcc;return function(_0x84f489){if(_0x84f489){return _0x155c80[_0xc3f8('0x17')](_0x511763);}return _0x155c80[_0xc3f8('0x18')](_0x511763)[_0xc3f8('0x19')]();};}function respondWithResult(_0x6155e9,_0x47754c){_0x47754c=_0x47754c||0xc8;return function(_0x29e2b6){if(_0x29e2b6){return _0x6155e9[_0xc3f8('0x18')](_0x47754c)[_0xc3f8('0x1a')](_0x29e2b6);}};}function respondWithFilteredResult(_0x2fd8e8,_0x3cb28a){return function(_0x2a9f64){if(_0x2a9f64){var _0x29d031=typeof _0x3cb28a['offset']===_0xc3f8('0x1b')&&typeof _0x3cb28a['limit']==='undefined';var _0x3df137=_0x2a9f64[_0xc3f8('0x1c')];var _0x35500f=_0x29d031?0x0:_0x3cb28a[_0xc3f8('0x1d')];var _0x47a185=_0x29d031?_0x2a9f64[_0xc3f8('0x1c')]:_0x3cb28a[_0xc3f8('0x1d')]+_0x3cb28a['limit'];var _0xe14074;if(_0x47a185>=_0x3df137){_0x47a185=_0x3df137;_0xe14074=0xc8;}else{_0xe14074=0xce;}_0x2fd8e8['status'](_0xe14074);return _0x2fd8e8[_0xc3f8('0x1e')](_0xc3f8('0x1f'),_0x35500f+'-'+_0x47a185+'/'+_0x3df137)[_0xc3f8('0x1a')](_0x2a9f64);}return null;};}function patchUpdates(_0x53ada5){return function(_0x543dca){try{jsonpatch[_0xc3f8('0x20')](_0x543dca,_0x53ada5,!![]);}catch(_0x2a7096){return BPromise[_0xc3f8('0x21')](_0x2a7096);}return _0x543dca[_0xc3f8('0x22')]();};}function saveUpdates(_0x6522e9,_0x251bf7){return function(_0x43b2b4){if(_0x43b2b4){return _0x43b2b4[_0xc3f8('0x23')](_0x6522e9)['then'](function(_0x571f92){return _0x571f92;});}return null;};}function removeEntity(_0x4b83f0,_0x2559a4){return function(_0x5e1d14){if(_0x5e1d14){return _0x5e1d14[_0xc3f8('0x24')]()[_0xc3f8('0x25')](function(){_0x4b83f0['status'](0xcc)[_0xc3f8('0x19')]();});}};}function handleEntityNotFound(_0x327b2d,_0x2d237e){return function(_0xb883b5){if(!_0xb883b5){_0x327b2d[_0xc3f8('0x17')](0x194);}return _0xb883b5;};}function handleError(_0x9d43b4,_0xf1d460){_0xf1d460=_0xf1d460||0x1f4;return function(_0x7f14ad){logger[_0xc3f8('0x26')](_0x7f14ad[_0xc3f8('0x27')]);if(_0x7f14ad[_0xc3f8('0x28')]){delete _0x7f14ad[_0xc3f8('0x28')];}_0x9d43b4[_0xc3f8('0x18')](_0xf1d460)[_0xc3f8('0x29')](_0x7f14ad);};}exports['index']=function(_0x58b303,_0x2909f8){var _0x218029={},_0x5bf6e2={},_0x151bba={'count':0x0,'rows':[]};var _0x4d39a0=_[_0xc3f8('0x2a')](db[_0xc3f8('0x2b')]['rawAttributes'],function(_0x48b32e){return{'name':_0x48b32e[_0xc3f8('0x2c')],'type':_0x48b32e[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x5bf6e2[_0xc3f8('0x2f')]=_[_0xc3f8('0x2a')](_0x4d39a0,_0xc3f8('0x28'));_0x5bf6e2[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x58b303[_0xc3f8('0x30')]);_0x5bf6e2[_0xc3f8('0x32')]=_['intersection'](_0x5bf6e2[_0xc3f8('0x2f')],_0x5bf6e2[_0xc3f8('0x30')]);_0x218029[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x5bf6e2[_0xc3f8('0x2f')],qs['fields'](_0x58b303['query'][_0xc3f8('0x35')]));_0x218029[_0xc3f8('0x33')]=_0x218029[_0xc3f8('0x33')][_0xc3f8('0x36')]?_0x218029[_0xc3f8('0x33')]:_0x5bf6e2['model'];if(!_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x218029['limit']=qs[_0xc3f8('0x39')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x218029['offset']=qs[_0xc3f8('0x1d')](_0x58b303[_0xc3f8('0x30')]['offset']);}_0x218029[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3b')]);_0x218029[_0xc3f8('0x3c')]=qs[_0xc3f8('0x32')](_['pick'](_0x58b303[_0xc3f8('0x30')],_0x5bf6e2[_0xc3f8('0x32')]),_0x4d39a0);if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x3d')]){_0x218029[_0xc3f8('0x3c')]=_['merge'](_0x218029[_0xc3f8('0x3c')],{'$or':_[_0xc3f8('0x2a')](_0x4d39a0,function(_0xaa4c98){if(_0xaa4c98['type']!==_0xc3f8('0x3e')){var _0x83b7ab={};_0x83b7ab[_0xaa4c98[_0xc3f8('0x28')]]={'$like':'%'+_0x58b303[_0xc3f8('0x30')]['filter']+'%'};return _0x83b7ab;}})});}_0x218029=_[_0xc3f8('0x3f')]({},_0x218029,_0x58b303[_0xc3f8('0x40')]);var _0x2df096={'where':_0x218029[_0xc3f8('0x3c')]};return db['FreshdeskAccount'][_0xc3f8('0x1c')](_0x2df096)['then'](function(_0x5d144b){_0x151bba[_0xc3f8('0x1c')]=_0x5d144b;if(_0x58b303[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x218029[_0xc3f8('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x218029);})[_0xc3f8('0x25')](function(_0x16805c){_0x151bba[_0xc3f8('0x43')]=_0x16805c;return _0x151bba;})[_0xc3f8('0x25')](respondWithFilteredResult(_0x2909f8,_0x218029))[_0xc3f8('0x44')](handleError(_0x2909f8,null));};exports[_0xc3f8('0x45')]=function(_0x3113b4,_0x45e6ea){var _0x13d8dc={'raw':![],'where':{'id':_0x3113b4[_0xc3f8('0x46')]['id']}},_0x34bccd={};_0x34bccd['model']=_[_0xc3f8('0x31')](db[_0xc3f8('0x2b')]['rawAttributes']);_0x34bccd[_0xc3f8('0x30')]=_[_0xc3f8('0x31')](_0x3113b4['query']);_0x34bccd[_0xc3f8('0x32')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],_0x34bccd[_0xc3f8('0x30')]);_0x13d8dc[_0xc3f8('0x33')]=_[_0xc3f8('0x34')](_0x34bccd[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x13d8dc[_0xc3f8('0x33')]=_0x13d8dc['attributes'][_0xc3f8('0x36')]?_0x13d8dc[_0xc3f8('0x33')]:_0x34bccd['model'];if(_0x3113b4[_0xc3f8('0x30')][_0xc3f8('0x41')]){_0x13d8dc[_0xc3f8('0x42')]=[{'all':!![]}];}_0x13d8dc=_[_0xc3f8('0x3f')]({},_0x13d8dc,_0x3113b4['options']);return db['FreshdeskAccount'][_0xc3f8('0x47')](_0x13d8dc)[_0xc3f8('0x25')](handleEntityNotFound(_0x45e6ea,null))[_0xc3f8('0x25')](respondWithResult(_0x45e6ea,null))['catch'](handleError(_0x45e6ea,null));};exports[_0xc3f8('0x48')]=function(_0x3a665e,_0x418961){return db[_0xc3f8('0x2b')][_0xc3f8('0x48')](_0x3a665e['body'],{})[_0xc3f8('0x25')](respondWithResult(_0x418961,0xc9))[_0xc3f8('0x44')](handleError(_0x418961,null));};exports['update']=function(_0x1becae,_0x3fcb6a){if(_0x1becae[_0xc3f8('0x49')]['id']){delete _0x1becae[_0xc3f8('0x49')]['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x1becae[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fcb6a,null))[_0xc3f8('0x25')](saveUpdates(_0x1becae[_0xc3f8('0x49')],null))['then'](respondWithResult(_0x3fcb6a,null))[_0xc3f8('0x44')](handleError(_0x3fcb6a,null));};exports[_0xc3f8('0x24')]=function(_0x2448bf,_0x33e5c5){return db[_0xc3f8('0x2b')][_0xc3f8('0x47')]({'where':{'id':_0x2448bf[_0xc3f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x33e5c5,null))[_0xc3f8('0x25')](removeEntity(_0x33e5c5,null))[_0xc3f8('0x44')](handleError(_0x33e5c5,null));};exports[_0xc3f8('0x4a')]=function(_0x267c95,_0x3e6c1d,_0x3d752a){var _0x97a88e={};var _0x920f4b={};var _0x4fc02c;var _0x51249a;return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x267c95['params']['id']}})['then'](handleEntityNotFound(_0x3e6c1d,null))[_0xc3f8('0x25')](function(_0x4b4adb){if(_0x4b4adb){_0x4fc02c=_0x4b4adb;_0x920f4b[_0xc3f8('0x2f')]=_[_0xc3f8('0x31')](db[_0xc3f8('0x4c')]['rawAttributes']);_0x920f4b[_0xc3f8('0x30')]=_['keys'](_0x267c95['query']);_0x920f4b[_0xc3f8('0x32')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],_0x920f4b[_0xc3f8('0x30')]);_0x97a88e[_0xc3f8('0x33')]=_['intersection'](_0x920f4b[_0xc3f8('0x2f')],qs[_0xc3f8('0x35')](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x35')]));_0x97a88e[_0xc3f8('0x33')]=_0x97a88e['attributes']['length']?_0x97a88e[_0xc3f8('0x33')]:_0x920f4b[_0xc3f8('0x2f')];_0x97a88e[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3b')](_0x267c95[_0xc3f8('0x30')]['sort']);_0x97a88e[_0xc3f8('0x3c')]=qs['filters'](_[_0xc3f8('0x4d')](_0x267c95[_0xc3f8('0x30')],_0x920f4b[_0xc3f8('0x32')]));if(_0x267c95[_0xc3f8('0x30')]['filter']){_0x97a88e[_0xc3f8('0x3c')]=_['merge'](_0x97a88e['where'],{'$or':_['map'](_0x97a88e['attributes'],function(_0x12df02){var _0x143d50={};_0x143d50[_0x12df02]={'$like':'%'+_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x3d')]+'%'};return _0x143d50;})});}_0x97a88e=_[_0xc3f8('0x3f')]({},_0x97a88e,_0x267c95[_0xc3f8('0x40')]);return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x5250df){if(_0x5250df){_0x51249a=_0x5250df[_0xc3f8('0x36')];if(!_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x37')](_0xc3f8('0x38'))){_0x97a88e[_0xc3f8('0x39')]=qs['limit'](_0x267c95[_0xc3f8('0x30')][_0xc3f8('0x39')]);_0x97a88e[_0xc3f8('0x1d')]=qs[_0xc3f8('0x1d')](_0x267c95[_0xc3f8('0x30')]['offset']);}return _0x4fc02c[_0xc3f8('0x4a')](_0x97a88e);}})[_0xc3f8('0x25')](function(_0x42b255){if(_0x42b255){return _0x42b255?{'count':_0x51249a,'rows':_0x42b255}:null;}})[_0xc3f8('0x25')](respondWithResult(_0x3e6c1d,null))[_0xc3f8('0x44')](handleError(_0x3e6c1d,null));};exports[_0xc3f8('0x4e')]=function(_0x56fd61,_0x2f199d,_0x4ca426){if(_0x56fd61[_0xc3f8('0x49')]['id']){delete _0x56fd61['body']['id'];}return db[_0xc3f8('0x2b')][_0xc3f8('0x4b')]({'where':{'id':_0x56fd61['params']['id']}})['then'](handleEntityNotFound(_0x2f199d,null))[_0xc3f8('0x25')](function(_0x2c7ab9){if(_0x2c7ab9){_0x56fd61['body'][_0xc3f8('0x4f')]=_0x2c7ab9['id'];_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x50')]=integrations[_0xc3f8('0x51')](_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x52')],_0x56fd61[_0xc3f8('0x49')][_0xc3f8('0x2d')]);_0x56fd61['body']['Descriptions']=integrations[_0xc3f8('0x53')](_0x56fd61['body']['channel'],_0x56fd61['body']['type']);return db['FreshdeskConfiguration'][_0xc3f8('0x48')](_0x56fd61[_0xc3f8('0x49')],{'include':[{'model':db[_0xc3f8('0x54')],'as':_0xc3f8('0x50')},{'model':db['FreshdeskField'],'as':_0xc3f8('0x55')}]});}return null;})[_0xc3f8('0x25')](respondWithResult(_0x2f199d,null))['catch'](handleError(_0x2f199d,null));};exports[_0xc3f8('0x56')]=function(_0x273faf,_0x104eec,_0x531de8){var _0xaedf89='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x273faf['params']['id']},'attributes':['id',_0xc3f8('0x57'),_0xc3f8('0x58')]})['then'](handleEntityNotFound(_0x104eec,null))[_0xc3f8('0x25')](function(_0x3fb47f){if(_0x3fb47f){_0xaedf89=_0x3fb47f['remoteUri'];var _0x265418=_0xaedf89[_0xc3f8('0x59')](-0x1);if(_0x265418==='/'){_0xaedf89=_0xaedf89['substring'](0x0,_0xaedf89[_0xc3f8('0x5a')](_0x265418));}return rp({'method':'GET','uri':util[_0xc3f8('0x5b')](_0xc3f8('0x5c'),_0xaedf89,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xc3f8('0x5d'),new Buffer(util[_0xc3f8('0x5b')]('%s:X',_0x3fb47f[_0xc3f8('0x58')]))['toString'](_0xc3f8('0x5e')))},'json':!![]});}})['then'](function(_0x280e74){if(_0x280e74){var _0x19adb5=[_0xc3f8('0x5f'),_0xc3f8('0x60'),_0xc3f8('0x61'),_0xc3f8('0x62'),_0xc3f8('0x18'),_0xc3f8('0x63'),_0xc3f8('0x64'),'source',_0xc3f8('0x65'),_0xc3f8('0x64'),_0xc3f8('0x66')];_[_0xc3f8('0x67')](_0x280e74,function(_0x3c321d){return _0x19adb5['includes'](_0x3c321d[_0xc3f8('0x28')])||!_0x3c321d[_0xc3f8('0x68')]&&_0x3c321d[_0xc3f8('0x2d')]!==_0xc3f8('0x69')&&_0x3c321d[_0xc3f8('0x2d')]!=='custom_dropdown';});return{'count':_0x280e74[_0xc3f8('0x36')],'rows':_[_0xc3f8('0x2a')](_0x280e74,function(_0x1001a1){return{'id':_0x1001a1['name'],'name':_0x1001a1['label'],'custom':!_0x1001a1[_0xc3f8('0x68')],'options':_0x1001a1[_0xc3f8('0x6a')]?_[_0xc3f8('0x2a')](_0x1001a1[_0xc3f8('0x6a')],function(_0x4b9b3b){return{'name':_[_0xc3f8('0x6b')](_0x4b9b3b),'value':_0x4b9b3b};}):[]};})};}})[_0xc3f8('0x25')](respondWithResult(_0x104eec,null))[_0xc3f8('0x44')](function(_0x5f1fbb){var _0x2a29fa=_0x273faf[_0xc3f8('0x30')]['test']?0x1f4:_0x5f1fbb['statusCode']||0x1f4;logger[_0xc3f8('0x26')](_0xc3f8('0x6c'),'getFields',_0x2a29fa,JSON[_0xc3f8('0x6d')](_0x5f1fbb));delete _0x5f1fbb[_0xc3f8('0x28')];if(_0x2a29fa===0x191){_0x2a29fa=0x190;}_0x104eec['status'](_0x2a29fa)[_0xc3f8('0x29')](_0x273faf['query'][_0xc3f8('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x5f1fbb[_0xc3f8('0x6f')]}:_0x5f1fbb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c70c531..25e5299 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 _0x946d=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x946d,0x154));var _0xd946=function(_0x4cd866,_0x3c92ad){_0x4cd866=_0x4cd866-0x0;var _0x268fd6=_0x946d[_0x4cd866];return _0x268fd6;};'use strict';var _=require(_0xd946('0x0'));var util=require(_0xd946('0x1'));var logger=require(_0xd946('0x2'))(_0xd946('0x3'));var moment=require('moment');var BPromise=require(_0xd946('0x4'));var rp=require(_0xd946('0x5'));var fs=require('fs');var path=require(_0xd946('0x6'));var rimraf=require(_0xd946('0x7'));var config=require('../../config/environment');var attributes=require(_0xd946('0x8'));var integrations=require(_0xd946('0x9'));module['exports']=function(_0x4fe63b,_0x1f1431){return _0x4fe63b[_0xd946('0xa')](_0xd946('0xb'),attributes,{'tableName':_0xd946('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ca0=['bluebird','../../config/environment','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x357aa6,_0x908a2f){var _0x4b29f5=function(_0x52ed53){while(--_0x52ed53){_0x357aa6['push'](_0x357aa6['shift']());}};_0x4b29f5(++_0x908a2f);}(_0x5ca0,0x177));var _0x05ca=function(_0x1ff072,_0x3e75c2){_0x1ff072=_0x1ff072-0x0;var _0x540550=_0x5ca0[_0x1ff072];return _0x540550;};'use strict';var _=require(_0x05ca('0x0'));var util=require(_0x05ca('0x1'));var logger=require(_0x05ca('0x2'))(_0x05ca('0x3'));var moment=require(_0x05ca('0x4'));var BPromise=require(_0x05ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x05ca('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x05ca('0x7')]=function(_0x1c9370,_0x175228){return _0x1c9370[_0x05ca('0x8')]('FreshdeskAccount',attributes,{'tableName':_0x05ca('0x9'),'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 ea95855..0528dff 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 _0xbcbe=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));var moment=require(_0xebcb('0x2'));var BPromise=require(_0xebcb('0x3'));var rs=require(_0xebcb('0x4'));var fs=require('fs');var Redis=require(_0xebcb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xebcb('0x6'))(_0xebcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebcb('0x8')][_0xebcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x347133,_0x25c27a,_0x2430d6){return new BPromise(function(_0x59f4b9,_0x205143){return client[_0xebcb('0xa')](_0x347133,_0x2430d6)[_0xebcb('0xb')](function(_0x1ec7b6){logger[_0xebcb('0xc')](_0xebcb('0xd'),_0x25c27a,_0xebcb('0xe'));logger[_0xebcb('0xf')](_0xebcb('0x10'),_0x25c27a,'request\x20sent',JSON[_0xebcb('0x11')](_0x1ec7b6));if(_0x1ec7b6['error']){if(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x13')]===0x1f4){logger['error'](_0xebcb('0xd'),_0x25c27a,_0x1ec7b6[_0xebcb('0x12')]['message']);return _0x205143(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);}logger[_0xebcb('0x12')](_0xebcb('0xd'),_0x25c27a,_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);return _0x59f4b9(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);}else{logger[_0xebcb('0xc')](_0xebcb('0xd'),_0x25c27a,_0xebcb('0xe'));_0x59f4b9(_0x1ec7b6[_0xebcb('0x15')][_0xebcb('0x14')]);}})[_0xebcb('0x16')](function(_0x287292){logger[_0xebcb('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x25c27a,_0x287292);_0x205143(_0x287292);});});}exports[_0xebcb('0x17')]=function(_0x1e12f0){var _0x29c256=this;return new Promise(function(_0x4e33d1,_0x17c9b6){return db[_0xebcb('0x18')][_0xebcb('0x19')]({'raw':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1c')]||null:null,'attributes':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1d')]||null:null,'limit':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1e')]||null:null,'include':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0['options'][_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x1e12f0[_0xebcb('0x1a')]['include'],function(_0x1e086c){return{'model':db[_0x1e086c[_0xebcb('0x21')]],'as':_0x1e086c['as'],'attributes':_0x1e086c[_0xebcb('0x1d')],'include':_0x1e086c[_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x1e086c[_0xebcb('0x1f')],function(_0x3804dd){return{'model':db[_0x3804dd[_0xebcb('0x21')]],'as':_0x3804dd['as'],'attributes':_0x3804dd[_0xebcb('0x1d')],'include':_0x3804dd['include']?_[_0xebcb('0x20')](_0x3804dd['include'],function(_0xd84aad){return{'model':db[_0xd84aad[_0xebcb('0x21')]],'as':_0xd84aad['as'],'attributes':_0xd84aad[_0xebcb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xebcb('0xb')](function(_0x250761){logger[_0xebcb('0xc')](_0xebcb('0x17'),_0x1e12f0);logger[_0xebcb('0xf')]('GetFreshdeskAccount',_0x1e12f0,JSON[_0xebcb('0x11')](_0x250761));_0x4e33d1(_0x250761);})[_0xebcb('0x16')](function(_0x2fe175){logger[_0xebcb('0x12')](_0xebcb('0x17'),_0x2fe175[_0xebcb('0x14')],_0x1e12f0);_0x17c9b6(_0x29c256[_0xebcb('0x12')](0x1f4,_0x2fe175[_0xebcb('0x14')]));});});};exports[_0xebcb('0x22')]=function(_0x3e8b28){var _0x5c75b2=this;return new Promise(function(_0x18e554,_0x4cf24c){return db[_0xebcb('0x18')][_0xebcb('0x23')]({'raw':_0x3e8b28[_0xebcb('0x1a')]?_0x3e8b28[_0xebcb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8b28[_0xebcb('0x1a')]?_0x3e8b28[_0xebcb('0x1a')]['where']||null:null,'attributes':_0x3e8b28['options']?_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1d')]||null:null,'include':_0x3e8b28['options']?_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1f')],function(_0x35e80f){return{'model':db[_0x35e80f['model']],'as':_0x35e80f['as'],'attributes':_0x35e80f[_0xebcb('0x1d')],'include':_0x35e80f[_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x35e80f[_0xebcb('0x1f')],function(_0x207fce){return{'model':db[_0x207fce[_0xebcb('0x21')]],'as':_0x207fce['as'],'attributes':_0x207fce[_0xebcb('0x1d')],'include':_0x207fce[_0xebcb('0x1f')]?_['map'](_0x207fce['include'],function(_0x178a80){return{'model':db[_0x178a80['model']],'as':_0x178a80['as'],'attributes':_0x178a80['attributes']};}):[]};}):[]};}):[]:[]})[_0xebcb('0xb')](function(_0x44d9c9){logger[_0xebcb('0xc')](_0xebcb('0x22'),_0x3e8b28);logger[_0xebcb('0xf')](_0xebcb('0x22'),_0x3e8b28,JSON[_0xebcb('0x11')](_0x44d9c9));_0x18e554(_0x44d9c9);})['catch'](function(_0x4b34d9){logger[_0xebcb('0x12')]('ShowFreshdeskAccount',_0x4b34d9['message'],_0x3e8b28);_0x4cf24c(_0x5c75b2[_0xebcb('0x12')](0x1f4,_0x4b34d9[_0xebcb('0x14')]));});});}; \ No newline at end of file +var _0xabfc=['attributes','include','map','model','then','debug','ShowFreshdeskAccount','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xabfc,0x194));var _0xcabf=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0xabfc[_0x328534];return _0x2796c0;};'use strict';var _=require(_0xcabf('0x0'));var util=require(_0xcabf('0x1'));var moment=require(_0xcabf('0x2'));var BPromise=require(_0xcabf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcabf('0x4'));var logger=require('../../config/logger')(_0xcabf('0x5'));var config=require(_0xcabf('0x6'));var jayson=require(_0xcabf('0x7'));var client=jayson[_0xcabf('0x8')][_0xcabf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa50cf2,_0x1e07de,_0x3c8b61){return new BPromise(function(_0x2fcca9,_0x4b39d9){return client[_0xcabf('0xa')](_0xa50cf2,_0x3c8b61)['then'](function(_0x3551d4){logger[_0xcabf('0xb')](_0xcabf('0xc'),_0x1e07de,_0xcabf('0xd'));logger['debug'](_0xcabf('0xe'),_0x1e07de,'request\x20sent',JSON[_0xcabf('0xf')](_0x3551d4));if(_0x3551d4['error']){if(_0x3551d4[_0xcabf('0x10')]['code']===0x1f4){logger[_0xcabf('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1e07de,_0x3551d4[_0xcabf('0x10')][_0xcabf('0x11')]);return _0x4b39d9(_0x3551d4[_0xcabf('0x10')][_0xcabf('0x11')]);}logger[_0xcabf('0x10')](_0xcabf('0xc'),_0x1e07de,_0x3551d4[_0xcabf('0x10')]['message']);return _0x2fcca9(_0x3551d4[_0xcabf('0x10')]['message']);}else{logger['info'](_0xcabf('0xc'),_0x1e07de,_0xcabf('0xd'));_0x2fcca9(_0x3551d4[_0xcabf('0x12')][_0xcabf('0x11')]);}})['catch'](function(_0x3d0dc9){logger[_0xcabf('0x10')](_0xcabf('0xc'),_0x1e07de,_0x3d0dc9);_0x4b39d9(_0x3d0dc9);});});}exports[_0xcabf('0x13')]=function(_0x52b50d){var _0x4b4b36=this;return new Promise(function(_0x21934a,_0x1f2b61){return db[_0xcabf('0x14')][_0xcabf('0x15')]({'raw':_0x52b50d[_0xcabf('0x16')]?_0x52b50d[_0xcabf('0x16')][_0xcabf('0x17')]===undefined?!![]:![]:!![],'where':_0x52b50d['options']?_0x52b50d[_0xcabf('0x16')][_0xcabf('0x18')]||null:null,'attributes':_0x52b50d['options']?_0x52b50d[_0xcabf('0x16')][_0xcabf('0x19')]||null:null,'limit':_0x52b50d[_0xcabf('0x16')]?_0x52b50d[_0xcabf('0x16')]['limit']||null:null,'include':_0x52b50d[_0xcabf('0x16')]?_0x52b50d[_0xcabf('0x16')][_0xcabf('0x1a')]?_[_0xcabf('0x1b')](_0x52b50d[_0xcabf('0x16')]['include'],function(_0x54c92b){return{'model':db[_0x54c92b['model']],'as':_0x54c92b['as'],'attributes':_0x54c92b[_0xcabf('0x19')],'include':_0x54c92b['include']?_[_0xcabf('0x1b')](_0x54c92b['include'],function(_0xbdc636){return{'model':db[_0xbdc636['model']],'as':_0xbdc636['as'],'attributes':_0xbdc636[_0xcabf('0x19')],'include':_0xbdc636[_0xcabf('0x1a')]?_[_0xcabf('0x1b')](_0xbdc636[_0xcabf('0x1a')],function(_0x52236f){return{'model':db[_0x52236f[_0xcabf('0x1c')]],'as':_0x52236f['as'],'attributes':_0x52236f[_0xcabf('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcabf('0x1d')](function(_0x5d7f9f){logger[_0xcabf('0xb')](_0xcabf('0x13'),_0x52b50d);logger['debug']('GetFreshdeskAccount',_0x52b50d,JSON[_0xcabf('0xf')](_0x5d7f9f));_0x21934a(_0x5d7f9f);})['catch'](function(_0x38529c){logger['error'](_0xcabf('0x13'),_0x38529c[_0xcabf('0x11')],_0x52b50d);_0x1f2b61(_0x4b4b36[_0xcabf('0x10')](0x1f4,_0x38529c[_0xcabf('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x99576c){var _0x2a3c2d=this;return new Promise(function(_0x16ccb2,_0x3191b0){return db[_0xcabf('0x14')]['find']({'raw':_0x99576c[_0xcabf('0x16')]?_0x99576c['options'][_0xcabf('0x17')]===undefined?!![]:![]:!![],'where':_0x99576c[_0xcabf('0x16')]?_0x99576c['options'][_0xcabf('0x18')]||null:null,'attributes':_0x99576c[_0xcabf('0x16')]?_0x99576c[_0xcabf('0x16')][_0xcabf('0x19')]||null:null,'include':_0x99576c[_0xcabf('0x16')]?_0x99576c[_0xcabf('0x16')][_0xcabf('0x1a')]?_['map'](_0x99576c[_0xcabf('0x16')][_0xcabf('0x1a')],function(_0x4c7190){return{'model':db[_0x4c7190[_0xcabf('0x1c')]],'as':_0x4c7190['as'],'attributes':_0x4c7190[_0xcabf('0x19')],'include':_0x4c7190[_0xcabf('0x1a')]?_['map'](_0x4c7190[_0xcabf('0x1a')],function(_0x539840){return{'model':db[_0x539840[_0xcabf('0x1c')]],'as':_0x539840['as'],'attributes':_0x539840[_0xcabf('0x19')],'include':_0x539840[_0xcabf('0x1a')]?_[_0xcabf('0x1b')](_0x539840[_0xcabf('0x1a')],function(_0x2c803f){return{'model':db[_0x2c803f[_0xcabf('0x1c')]],'as':_0x2c803f['as'],'attributes':_0x2c803f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f23fe){logger[_0xcabf('0xb')]('ShowFreshdeskAccount',_0x99576c);logger[_0xcabf('0x1e')](_0xcabf('0x1f'),_0x99576c,JSON[_0xcabf('0xf')](_0x3f23fe));_0x16ccb2(_0x3f23fe);})[_0xcabf('0x20')](function(_0x407412){logger[_0xcabf('0x10')]('ShowFreshdeskAccount',_0x407412['message'],_0x99576c);_0x3191b0(_0x2a3c2d[_0xcabf('0x10')](0x1f4,_0x407412[_0xcabf('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9a01406..576f94f 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 _0x8c0e=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/descriptions','/:id/tags','getTags','post','setTags','/:id','update'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x8c0e,0xa4));var _0xe8c0=function(_0x544bed,_0x268e03){_0x544bed=_0x544bed-0x0;var _0x392435=_0x8c0e[_0x544bed];return _0x392435;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8c0('0x0'));var timeout=require(_0xe8c0('0x1'));var express=require(_0xe8c0('0x2'));var router=express[_0xe8c0('0x3')]();var fs_extra=require(_0xe8c0('0x4'));var auth=require(_0xe8c0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe8c0('0x6'));var controller=require(_0xe8c0('0x7'));router[_0xe8c0('0x8')]('/',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0xa')]);router[_0xe8c0('0x8')]('/:id',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0xb')]);router[_0xe8c0('0x8')](_0xe8c0('0xc'),auth[_0xe8c0('0x9')](),controller['getFields']);router[_0xe8c0('0x8')]('/:id/subjects',auth[_0xe8c0('0x9')](),controller['getSubjects']);router[_0xe8c0('0x8')](_0xe8c0('0xd'),auth[_0xe8c0('0x9')](),controller['getDescriptions']);router['get'](_0xe8c0('0xe'),auth['isAuthenticated'](),controller[_0xe8c0('0xf')]);router[_0xe8c0('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8c0('0x10')]('/:id/tags',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0x11')]);router['put'](_0xe8c0('0x12'),auth[_0xe8c0('0x9')](),controller[_0xe8c0('0x13')]);router[_0xe8c0('0x14')](_0xe8c0('0x12'),auth['isAuthenticated'](),controller[_0xe8c0('0x15')]);module[_0xe8c0('0x16')]=router; \ No newline at end of file +var _0xadfa=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','/:id/fields','isAuthenticated','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x271474,_0x248441){var _0x72f117=function(_0x4ad1b9){while(--_0x4ad1b9){_0x271474['push'](_0x271474['shift']());}};_0x72f117(++_0x248441);}(_0xadfa,0x9b));var _0xaadf=function(_0x30ed85,_0x285b6b){_0x30ed85=_0x30ed85-0x0;var _0x286e8d=_0xadfa[_0x30ed85];return _0x286e8d;};'use strict';var multer=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var path=require(_0xaadf('0x2'));var timeout=require(_0xaadf('0x3'));var express=require(_0xaadf('0x4'));var router=express[_0xaadf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaadf('0x6'));var interaction=require(_0xaadf('0x7'));var config=require(_0xaadf('0x8'));var controller=require(_0xaadf('0x9'));router[_0xaadf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaadf('0xa')](_0xaadf('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xaadf('0xc'),auth[_0xaadf('0xd')](),controller[_0xaadf('0xe')]);router[_0xaadf('0xa')]('/:id/subjects',auth[_0xaadf('0xd')](),controller['getSubjects']);router[_0xaadf('0xa')](_0xaadf('0xf'),auth['isAuthenticated'](),controller[_0xaadf('0x10')]);router['get'](_0xaadf('0x11'),auth[_0xaadf('0xd')](),controller[_0xaadf('0x12')]);router[_0xaadf('0x13')]('/',auth[_0xaadf('0xd')](),controller[_0xaadf('0x14')]);router[_0xaadf('0x13')]('/:id/tags',auth['isAuthenticated'](),controller[_0xaadf('0x15')]);router[_0xaadf('0x16')]('/:id',auth[_0xaadf('0xd')](),controller[_0xaadf('0x17')]);router[_0xaadf('0x18')](_0xaadf('0xb'),auth['isAuthenticated'](),controller[_0xaadf('0x19')]);module[_0xaadf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0a6fba8..15f3b8e 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 _0x2149=['sequelize','STRING'];(function(_0x3f6df7,_0x96774d){var _0x59254e=function(_0x32d740){while(--_0x32d740){_0x3f6df7['push'](_0x3f6df7['shift']());}};_0x59254e(++_0x96774d);}(_0x2149,0x108));var _0x9214=function(_0x4be226,_0x3dbffc){_0x4be226=_0x4be226-0x0;var _0x148768=_0x2149[_0x4be226];return _0x148768;};'use strict';var Sequelize=require(_0x9214('0x0'));module['exports']={'name':{'type':Sequelize[_0x9214('0x1')]},'description':{'type':Sequelize[_0x9214('0x1')]}}; \ No newline at end of file +var _0xa237=['STRING','sequelize','exports'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa237,0xdc));var _0x7a23=function(_0x3775ac,_0x43b235){_0x3775ac=_0x3775ac-0x0;var _0x3f8f5=_0xa237[_0x3775ac];return _0x3f8f5;};'use strict';var Sequelize=require(_0x7a23('0x0'));module[_0x7a23('0x1')]={'name':{'type':Sequelize[_0x7a23('0x2')]},'description':{'type':Sequelize[_0x7a23('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 51bc899..d09261b 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 _0xea42=['getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','update','then','error','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','destroy','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions'];(function(_0x566c6d,_0x2de2bc){var _0x1e995a=function(_0x1e4c72){while(--_0x1e4c72){_0x566c6d['push'](_0x566c6d['shift']());}};_0x1e995a(++_0x2de2bc);}(_0xea42,0x150));var _0x2ea4=function(_0x162ef3,_0x1f5c07){_0x162ef3=_0x162ef3-0x0;var _0x2c8f27=_0xea42[_0x162ef3];return _0x2c8f27;};'use strict';var emlformat=require(_0x2ea4('0x0'));var rimraf=require(_0x2ea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2ea4('0x2'));var moment=require(_0x2ea4('0x3'));var BPromise=require(_0x2ea4('0x4'));var Mustache=require(_0x2ea4('0x5'));var util=require(_0x2ea4('0x6'));var path=require('path');var sox=require(_0x2ea4('0x7'));var csv=require(_0x2ea4('0x8'));var ejs=require(_0x2ea4('0x9'));var fs=require('fs');var fs_extra=require(_0x2ea4('0xa'));var _=require(_0x2ea4('0xb'));var squel=require('squel');var crypto=require(_0x2ea4('0xc'));var jsforce=require(_0x2ea4('0xd'));var deskjs=require(_0x2ea4('0xe'));var toCsv=require(_0x2ea4('0x8'));var querystring=require(_0x2ea4('0xf'));var Papa=require(_0x2ea4('0x10'));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(_0x2ea4('0x11'));var logger=require(_0x2ea4('0x12'))(_0x2ea4('0x13'));var utils=require(_0x2ea4('0x14'));var config=require(_0x2ea4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ea4('0x16'))['db'];function respondWithStatusCode(_0x282d3a,_0x4834c3){_0x4834c3=_0x4834c3||0xcc;return function(_0x160985){if(_0x160985){return _0x282d3a[_0x2ea4('0x17')](_0x4834c3);}return _0x282d3a[_0x2ea4('0x18')](_0x4834c3)[_0x2ea4('0x19')]();};}function respondWithResult(_0x25af9f,_0x5f5845){_0x5f5845=_0x5f5845||0xc8;return function(_0x130e99){if(_0x130e99){return _0x25af9f[_0x2ea4('0x18')](_0x5f5845)[_0x2ea4('0x1a')](_0x130e99);}};}function respondWithFilteredResult(_0x25003e,_0x2af2f4){return function(_0x467170){if(_0x467170){var _0x37b1c5=typeof _0x2af2f4['offset']===_0x2ea4('0x1b')&&typeof _0x2af2f4[_0x2ea4('0x1c')]===_0x2ea4('0x1b');var _0x255920=_0x467170[_0x2ea4('0x1d')];var _0x3a99f3=_0x37b1c5?0x0:_0x2af2f4['offset'];var _0xd63d12=_0x37b1c5?_0x467170[_0x2ea4('0x1d')]:_0x2af2f4['offset']+_0x2af2f4[_0x2ea4('0x1c')];var _0x276820;if(_0xd63d12>=_0x255920){_0xd63d12=_0x255920;_0x276820=0xc8;}else{_0x276820=0xce;}_0x25003e['status'](_0x276820);return _0x25003e[_0x2ea4('0x1e')]('Content-Range',_0x3a99f3+'-'+_0xd63d12+'/'+_0x255920)[_0x2ea4('0x1a')](_0x467170);}return null;};}function patchUpdates(_0x51099c){return function(_0x3e58d){try{jsonpatch[_0x2ea4('0x1f')](_0x3e58d,_0x51099c,!![]);}catch(_0x3ed077){return BPromise[_0x2ea4('0x20')](_0x3ed077);}return _0x3e58d['save']();};}function saveUpdates(_0x470dd3,_0x38c9fa){return function(_0x1fc8ed){if(_0x1fc8ed){return _0x1fc8ed[_0x2ea4('0x21')](_0x470dd3)[_0x2ea4('0x22')](function(_0x437b62){return _0x437b62;});}return null;};}function removeEntity(_0x55a92a,_0x3ed702){return function(_0x5800fb){if(_0x5800fb){return _0x5800fb['destroy']()[_0x2ea4('0x22')](function(){_0x55a92a[_0x2ea4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ca36,_0x54fb3a){return function(_0x329573){if(!_0x329573){_0x49ca36[_0x2ea4('0x17')](0x194);}return _0x329573;};}function handleError(_0x32d783,_0x49a3d8){_0x49a3d8=_0x49a3d8||0x1f4;return function(_0x5ce7a8){logger[_0x2ea4('0x23')](_0x5ce7a8['stack']);if(_0x5ce7a8[_0x2ea4('0x24')]){delete _0x5ce7a8[_0x2ea4('0x24')];}_0x32d783[_0x2ea4('0x18')](_0x49a3d8)[_0x2ea4('0x25')](_0x5ce7a8);};}exports[_0x2ea4('0x26')]=function(_0x247c7c,_0x5018a8){var _0x1ca2c6={},_0x354f5e={},_0x325628={'count':0x0,'rows':[]};var _0x261f7b=_['map'](db[_0x2ea4('0x27')][_0x2ea4('0x28')],function(_0x443147){return{'name':_0x443147[_0x2ea4('0x29')],'type':_0x443147['type'][_0x2ea4('0x2a')]};});_0x354f5e[_0x2ea4('0x2b')]=_[_0x2ea4('0x2c')](_0x261f7b,_0x2ea4('0x24'));_0x354f5e[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x247c7c['query']);_0x354f5e['filters']=_[_0x2ea4('0x2f')](_0x354f5e[_0x2ea4('0x2b')],_0x354f5e[_0x2ea4('0x2d')]);_0x1ca2c6[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x354f5e[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x247c7c['query'][_0x2ea4('0x31')]));_0x1ca2c6[_0x2ea4('0x30')]=_0x1ca2c6[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x1ca2c6[_0x2ea4('0x30')]:_0x354f5e[_0x2ea4('0x2b')];if(!_0x247c7c['query'][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x1ca2c6['limit']=qs[_0x2ea4('0x1c')](_0x247c7c['query'][_0x2ea4('0x1c')]);_0x1ca2c6[_0x2ea4('0x35')]=qs['offset'](_0x247c7c['query'][_0x2ea4('0x35')]);}_0x1ca2c6[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x247c7c[_0x2ea4('0x2d')]['sort']);_0x1ca2c6[_0x2ea4('0x38')]=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x247c7c['query'],_0x354f5e[_0x2ea4('0x39')]),_0x261f7b);if(_0x247c7c[_0x2ea4('0x2d')]['filter']){_0x1ca2c6[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x1ca2c6['where'],{'$or':_[_0x2ea4('0x2c')](_0x261f7b,function(_0x5a632c){if(_0x5a632c[_0x2ea4('0x3c')]!==_0x2ea4('0x3d')){var _0x3a2761={};_0x3a2761[_0x5a632c[_0x2ea4('0x24')]]={'$like':'%'+_0x247c7c[_0x2ea4('0x2d')]['filter']+'%'};return _0x3a2761;}})});}_0x1ca2c6=_[_0x2ea4('0x3b')]({},_0x1ca2c6,_0x247c7c[_0x2ea4('0x3e')]);var _0x17ddd1={'where':_0x1ca2c6[_0x2ea4('0x38')]};return db[_0x2ea4('0x27')][_0x2ea4('0x1d')](_0x17ddd1)['then'](function(_0x9af476){_0x325628['count']=_0x9af476;if(_0x247c7c[_0x2ea4('0x2d')][_0x2ea4('0x3f')]){_0x1ca2c6[_0x2ea4('0x40')]=[{'all':!![]}];}return db[_0x2ea4('0x27')][_0x2ea4('0x41')](_0x1ca2c6);})['then'](function(_0x48276){_0x325628[_0x2ea4('0x42')]=_0x48276;return _0x325628;})['then'](respondWithFilteredResult(_0x5018a8,_0x1ca2c6))['catch'](handleError(_0x5018a8,null));};exports[_0x2ea4('0x43')]=function(_0x23b6c9,_0x49c670){var _0x460a67={'raw':![],'where':{'id':_0x23b6c9[_0x2ea4('0x44')]['id']}},_0x13082f={};_0x13082f[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x27')]['rawAttributes']);_0x13082f[_0x2ea4('0x2d')]=_['keys'](_0x23b6c9[_0x2ea4('0x2d')]);_0x13082f['filters']=_[_0x2ea4('0x2f')](_0x13082f[_0x2ea4('0x2b')],_0x13082f[_0x2ea4('0x2d')]);_0x460a67[_0x2ea4('0x30')]=_['intersection'](_0x13082f['model'],qs[_0x2ea4('0x31')](_0x23b6c9[_0x2ea4('0x2d')][_0x2ea4('0x31')]));_0x460a67[_0x2ea4('0x30')]=_0x460a67[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x460a67['attributes']:_0x13082f[_0x2ea4('0x2b')];if(_0x23b6c9['query']['includeAll']){_0x460a67[_0x2ea4('0x40')]=[{'all':!![]}];}_0x460a67=_[_0x2ea4('0x3b')]({},_0x460a67,_0x23b6c9[_0x2ea4('0x3e')]);return db[_0x2ea4('0x27')][_0x2ea4('0x45')](_0x460a67)[_0x2ea4('0x22')](handleEntityNotFound(_0x49c670,null))['then'](respondWithResult(_0x49c670,null))[_0x2ea4('0x46')](handleError(_0x49c670,null));};exports['create']=function(_0x1397d6,_0x1cc56e){return db[_0x2ea4('0x27')]['create'](_0x1397d6[_0x2ea4('0x47')],{})['then'](respondWithResult(_0x1cc56e,0xc9))[_0x2ea4('0x46')](handleError(_0x1cc56e,null));};exports[_0x2ea4('0x21')]=function(_0x17bd14,_0x105b24){if(_0x17bd14['body']['id']){delete _0x17bd14['body']['id'];}return db[_0x2ea4('0x27')]['find']({'where':{'id':_0x17bd14[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x105b24,null))['then'](saveUpdates(_0x17bd14[_0x2ea4('0x47')],null))[_0x2ea4('0x22')](respondWithResult(_0x105b24,null))[_0x2ea4('0x46')](handleError(_0x105b24,null));};exports[_0x2ea4('0x48')]=function(_0x434da2,_0x256980){return db[_0x2ea4('0x27')]['find']({'where':{'id':_0x434da2[_0x2ea4('0x44')]['id']}})['then'](handleEntityNotFound(_0x256980,null))['then'](removeEntity(_0x256980,null))[_0x2ea4('0x46')](handleError(_0x256980,null));};exports[_0x2ea4('0x49')]=function(_0x3e8d87,_0x58b395,_0x25b11e){var _0x20fe4c={};var _0x18c7d1={};var _0x525b19;var _0x4bac1d;return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x3e8d87[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x58b395,null))[_0x2ea4('0x22')](function(_0x4a0422){if(_0x4a0422){_0x525b19=_0x4a0422;_0x18c7d1[_0x2ea4('0x2b')]=_['keys'](db[_0x2ea4('0x4b')][_0x2ea4('0x28')]);_0x18c7d1[_0x2ea4('0x2d')]=_['keys'](_0x3e8d87[_0x2ea4('0x2d')]);_0x18c7d1['filters']=_[_0x2ea4('0x2f')](_0x18c7d1[_0x2ea4('0x2b')],_0x18c7d1[_0x2ea4('0x2d')]);_0x20fe4c[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x18c7d1[_0x2ea4('0x2b')],qs['fields'](_0x3e8d87[_0x2ea4('0x2d')]['fields']));_0x20fe4c[_0x2ea4('0x30')]=_0x20fe4c[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x20fe4c['attributes']:_0x18c7d1[_0x2ea4('0x2b')];_0x20fe4c[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x3e8d87[_0x2ea4('0x2d')]['sort']);_0x20fe4c[_0x2ea4('0x38')]=qs['filters'](_[_0x2ea4('0x3a')](_0x3e8d87[_0x2ea4('0x2d')],_0x18c7d1[_0x2ea4('0x39')]));if(_0x3e8d87['query'][_0x2ea4('0x4c')]){_0x20fe4c['where']=_[_0x2ea4('0x3b')](_0x20fe4c[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x20fe4c[_0x2ea4('0x30')],function(_0x35a532){var _0x49321c={};_0x49321c[_0x35a532]={'$like':'%'+_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x49321c;})});}_0x20fe4c=_[_0x2ea4('0x3b')]({},_0x20fe4c,_0x3e8d87[_0x2ea4('0x3e')]);return _0x525b19[_0x2ea4('0x49')](_0x20fe4c);}})['then'](function(_0xfb7bb9){if(_0xfb7bb9){_0x4bac1d=_0xfb7bb9[_0x2ea4('0x32')];if(!_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x33')]('nolimit')){_0x20fe4c[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x20fe4c[_0x2ea4('0x35')]=qs['offset'](_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x525b19['getFields'](_0x20fe4c);}})[_0x2ea4('0x22')](function(_0x100323){if(_0x100323){return _0x100323?{'count':_0x4bac1d,'rows':_0x100323}:null;}})['then'](respondWithResult(_0x58b395,null))[_0x2ea4('0x46')](handleError(_0x58b395,null));};exports[_0x2ea4('0x4d')]=function(_0x493f25,_0x4406b1,_0x1c545d){var _0x39b100={};var _0x532921={};var _0x3d5398;var _0x1b129f;return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x493f25[_0x2ea4('0x44')]['id']}})['then'](handleEntityNotFound(_0x4406b1,null))[_0x2ea4('0x22')](function(_0x3c5d02){if(_0x3c5d02){_0x3d5398=_0x3c5d02;_0x532921[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x4b')][_0x2ea4('0x28')]);_0x532921['query']=_['keys'](_0x493f25['query']);_0x532921['filters']=_[_0x2ea4('0x2f')](_0x532921[_0x2ea4('0x2b')],_0x532921[_0x2ea4('0x2d')]);_0x39b100[_0x2ea4('0x30')]=_['intersection'](_0x532921[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x31')]));_0x39b100[_0x2ea4('0x30')]=_0x39b100[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x39b100[_0x2ea4('0x30')]:_0x532921['model'];_0x39b100[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x493f25[_0x2ea4('0x2d')]['sort']);_0x39b100[_0x2ea4('0x38')]=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x493f25[_0x2ea4('0x2d')],_0x532921[_0x2ea4('0x39')]));if(_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x4c')]){_0x39b100[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x39b100[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x39b100[_0x2ea4('0x30')],function(_0x41fbb5){var _0x27d700={};_0x27d700[_0x41fbb5]={'$like':'%'+_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x27d700;})});}_0x39b100=_['merge']({},_0x39b100,_0x493f25[_0x2ea4('0x3e')]);return _0x3d5398[_0x2ea4('0x4d')](_0x39b100);}})[_0x2ea4('0x22')](function(_0x3fd63c){if(_0x3fd63c){_0x1b129f=_0x3fd63c[_0x2ea4('0x32')];if(!_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x39b100[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x39b100[_0x2ea4('0x35')]=qs[_0x2ea4('0x35')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x3d5398[_0x2ea4('0x4d')](_0x39b100);}})[_0x2ea4('0x22')](function(_0xd7faae){if(_0xd7faae){return _0xd7faae?{'count':_0x1b129f,'rows':_0xd7faae}:null;}})['then'](respondWithResult(_0x4406b1,null))[_0x2ea4('0x46')](handleError(_0x4406b1,null));};exports[_0x2ea4('0x4e')]=function(_0x1ea7f3,_0x32bcdc,_0x588c52){var _0x5c8144={};var _0x1bbfb8={};var _0x28041f;var _0x75110c;return db['FreshdeskConfiguration'][_0x2ea4('0x4a')]({'where':{'id':_0x1ea7f3[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x32bcdc,null))[_0x2ea4('0x22')](function(_0x436ca5){if(_0x436ca5){_0x28041f=_0x436ca5;_0x1bbfb8[_0x2ea4('0x2b')]=_['keys'](db[_0x2ea4('0x4b')]['rawAttributes']);_0x1bbfb8[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x1ea7f3[_0x2ea4('0x2d')]);_0x1bbfb8[_0x2ea4('0x39')]=_[_0x2ea4('0x2f')](_0x1bbfb8[_0x2ea4('0x2b')],_0x1bbfb8['query']);_0x5c8144[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x1bbfb8[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x1ea7f3[_0x2ea4('0x2d')]['fields']));_0x5c8144[_0x2ea4('0x30')]=_0x5c8144[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x5c8144[_0x2ea4('0x30')]:_0x1bbfb8[_0x2ea4('0x2b')];_0x5c8144['order']=qs[_0x2ea4('0x37')](_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x37')]);_0x5c8144['where']=qs['filters'](_['pick'](_0x1ea7f3[_0x2ea4('0x2d')],_0x1bbfb8[_0x2ea4('0x39')]));if(_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x4c')]){_0x5c8144[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x5c8144[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x5c8144[_0x2ea4('0x30')],function(_0x4a6503){var _0x2a39c6={};_0x2a39c6[_0x4a6503]={'$like':'%'+_0x1ea7f3['query'][_0x2ea4('0x4c')]+'%'};return _0x2a39c6;})});}_0x5c8144=_[_0x2ea4('0x3b')]({},_0x5c8144,_0x1ea7f3[_0x2ea4('0x3e')]);return _0x28041f['getDescriptions'](_0x5c8144);}})[_0x2ea4('0x22')](function(_0x5eed95){if(_0x5eed95){_0x75110c=_0x5eed95[_0x2ea4('0x32')];if(!_0x1ea7f3['query'][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x5c8144[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x1ea7f3[_0x2ea4('0x2d')]['limit']);_0x5c8144['offset']=qs[_0x2ea4('0x35')](_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x28041f['getDescriptions'](_0x5c8144);}})['then'](function(_0x28a839){if(_0x28a839){return _0x28a839?{'count':_0x75110c,'rows':_0x28a839}:null;}})['then'](respondWithResult(_0x32bcdc,null))[_0x2ea4('0x46')](handleError(_0x32bcdc,null));};exports[_0x2ea4('0x4f')]=function(_0x59af4f,_0x19b15a,_0x12f7e6){var _0x544f9d={};var _0x30653c={};var _0x642600;var _0x35dea1;return db[_0x2ea4('0x27')]['findOne']({'where':{'id':_0x59af4f['params']['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x19b15a,null))[_0x2ea4('0x22')](function(_0x19093d){if(_0x19093d){_0x642600=_0x19093d;_0x30653c[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x50')][_0x2ea4('0x28')]);_0x30653c[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x59af4f['query']);_0x30653c['filters']=_[_0x2ea4('0x2f')](_0x30653c[_0x2ea4('0x2b')],_0x30653c[_0x2ea4('0x2d')]);_0x544f9d[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x30653c[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x59af4f['query'][_0x2ea4('0x31')]));_0x544f9d[_0x2ea4('0x30')]=_0x544f9d[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x544f9d[_0x2ea4('0x30')]:_0x30653c[_0x2ea4('0x2b')];_0x544f9d[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x59af4f['query'][_0x2ea4('0x37')]);_0x544f9d['where']=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x59af4f[_0x2ea4('0x2d')],_0x30653c[_0x2ea4('0x39')]));if(_0x59af4f[_0x2ea4('0x2d')]['filter']){_0x544f9d[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x544f9d[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x544f9d['attributes'],function(_0x2c0e5e){var _0x40958b={};_0x40958b[_0x2c0e5e]={'$like':'%'+_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x40958b;})});}_0x544f9d=_[_0x2ea4('0x3b')]({},_0x544f9d,_0x59af4f[_0x2ea4('0x3e')]);return _0x642600[_0x2ea4('0x4f')](_0x544f9d);}})[_0x2ea4('0x22')](function(_0x3831c7){if(_0x3831c7){_0x35dea1=_0x3831c7[_0x2ea4('0x32')];if(!_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x544f9d[_0x2ea4('0x1c')]=qs['limit'](_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x544f9d[_0x2ea4('0x35')]=qs[_0x2ea4('0x35')](_0x59af4f[_0x2ea4('0x2d')]['offset']);}return _0x642600[_0x2ea4('0x4f')](_0x544f9d);}})['then'](function(_0x455277){if(_0x455277){return _0x455277?{'count':_0x35dea1,'rows':_0x455277}:null;}})[_0x2ea4('0x22')](respondWithResult(_0x19b15a,null))[_0x2ea4('0x46')](handleError(_0x19b15a,null));};exports[_0x2ea4('0x51')]=function(_0x2af5b7,_0x3950c9,_0xb7ba23){if(_0x2af5b7['body']['id']){delete _0x2af5b7[_0x2ea4('0x47')]['id'];}return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x2af5b7[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x3950c9,null))[_0x2ea4('0x22')](function(_0x5830e6){if(_0x5830e6){return _0x5830e6[_0x2ea4('0x51')](_0x2af5b7[_0x2ea4('0x47')][_0x2ea4('0x52')]||[]);}return null;})[_0x2ea4('0x22')](respondWithResult(_0x3950c9,null))[_0x2ea4('0x46')](handleError(_0x3950c9,null));}; \ No newline at end of file +var _0x4ffa=['body','update','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','pick','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','end','error','stack','name','send','FreshdeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x4ffa,0x108));var _0xa4ff=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4ffa[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xa4ff('0x0'));var rimraf=require(_0xa4ff('0x1'));var zipdir=require(_0xa4ff('0x2'));var jsonpatch=require(_0xa4ff('0x3'));var rp=require(_0xa4ff('0x4'));var moment=require(_0xa4ff('0x5'));var BPromise=require(_0xa4ff('0x6'));var Mustache=require(_0xa4ff('0x7'));var util=require(_0xa4ff('0x8'));var path=require(_0xa4ff('0x9'));var sox=require(_0xa4ff('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4ff('0xb'));var _=require(_0xa4ff('0xc'));var squel=require('squel');var crypto=require(_0xa4ff('0xd'));var jsforce=require(_0xa4ff('0xe'));var deskjs=require(_0xa4ff('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa4ff('0x10'));var Papa=require(_0xa4ff('0x11'));var Redis=require(_0xa4ff('0x12'));var authService=require(_0xa4ff('0x13'));var qs=require(_0xa4ff('0x14'));var as=require(_0xa4ff('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4ff('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xa4ff('0x17'));var licenseUtil=require(_0xa4ff('0x18'));var db=require(_0xa4ff('0x19'))['db'];function respondWithStatusCode(_0x2fd317,_0x1ee1aa){_0x1ee1aa=_0x1ee1aa||0xcc;return function(_0x23a2bb){if(_0x23a2bb){return _0x2fd317[_0xa4ff('0x1a')](_0x1ee1aa);}return _0x2fd317[_0xa4ff('0x1b')](_0x1ee1aa)['end']();};}function respondWithResult(_0x2f0ef4,_0x350e8f){_0x350e8f=_0x350e8f||0xc8;return function(_0x40ea47){if(_0x40ea47){return _0x2f0ef4[_0xa4ff('0x1b')](_0x350e8f)[_0xa4ff('0x1c')](_0x40ea47);}};}function respondWithFilteredResult(_0x5e9533,_0x468bb6){return function(_0xdb7f48){if(_0xdb7f48){var _0x486b00=typeof _0x468bb6['offset']===_0xa4ff('0x1d')&&typeof _0x468bb6[_0xa4ff('0x1e')]===_0xa4ff('0x1d');var _0x57f859=_0xdb7f48[_0xa4ff('0x1f')];var _0x5be67d=_0x486b00?0x0:_0x468bb6[_0xa4ff('0x20')];var _0x48c1cc=_0x486b00?_0xdb7f48[_0xa4ff('0x1f')]:_0x468bb6[_0xa4ff('0x20')]+_0x468bb6['limit'];var _0x538cb0;if(_0x48c1cc>=_0x57f859){_0x48c1cc=_0x57f859;_0x538cb0=0xc8;}else{_0x538cb0=0xce;}_0x5e9533['status'](_0x538cb0);return _0x5e9533['set'](_0xa4ff('0x21'),_0x5be67d+'-'+_0x48c1cc+'/'+_0x57f859)[_0xa4ff('0x1c')](_0xdb7f48);}return null;};}function patchUpdates(_0x4dd5af){return function(_0x1dee95){try{jsonpatch[_0xa4ff('0x22')](_0x1dee95,_0x4dd5af,!![]);}catch(_0x1e3332){return BPromise[_0xa4ff('0x23')](_0x1e3332);}return _0x1dee95[_0xa4ff('0x24')]();};}function saveUpdates(_0x220240,_0x3ea013){return function(_0x552f48){if(_0x552f48){return _0x552f48['update'](_0x220240)[_0xa4ff('0x25')](function(_0x237593){return _0x237593;});}return null;};}function removeEntity(_0x5c7118,_0x5346c5){return function(_0x21d191){if(_0x21d191){return _0x21d191['destroy']()[_0xa4ff('0x25')](function(){_0x5c7118[_0xa4ff('0x1b')](0xcc)[_0xa4ff('0x26')]();});}};}function handleEntityNotFound(_0x57a1c6,_0x533361){return function(_0x55f09c){if(!_0x55f09c){_0x57a1c6[_0xa4ff('0x1a')](0x194);}return _0x55f09c;};}function handleError(_0x1d6ce3,_0x1a8160){_0x1a8160=_0x1a8160||0x1f4;return function(_0x99598c){logger[_0xa4ff('0x27')](_0x99598c[_0xa4ff('0x28')]);if(_0x99598c[_0xa4ff('0x29')]){delete _0x99598c[_0xa4ff('0x29')];}_0x1d6ce3[_0xa4ff('0x1b')](_0x1a8160)[_0xa4ff('0x2a')](_0x99598c);};}exports['index']=function(_0x2f07e5,_0x208730){var _0x4770d7={},_0x18eefd={},_0x176466={'count':0x0,'rows':[]};var _0x107a7b=_['map'](db[_0xa4ff('0x2b')][_0xa4ff('0x2c')],function(_0x90ccea){return{'name':_0x90ccea['fieldName'],'type':_0x90ccea[_0xa4ff('0x2d')][_0xa4ff('0x2e')]};});_0x18eefd[_0xa4ff('0x2f')]=_[_0xa4ff('0x30')](_0x107a7b,_0xa4ff('0x29'));_0x18eefd[_0xa4ff('0x31')]=_[_0xa4ff('0x32')](_0x2f07e5[_0xa4ff('0x31')]);_0x18eefd[_0xa4ff('0x33')]=_[_0xa4ff('0x34')](_0x18eefd['model'],_0x18eefd['query']);_0x4770d7[_0xa4ff('0x35')]=_[_0xa4ff('0x34')](_0x18eefd[_0xa4ff('0x2f')],qs[_0xa4ff('0x36')](_0x2f07e5['query'][_0xa4ff('0x36')]));_0x4770d7[_0xa4ff('0x35')]=_0x4770d7['attributes'][_0xa4ff('0x37')]?_0x4770d7[_0xa4ff('0x35')]:_0x18eefd['model'];if(!_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x38')](_0xa4ff('0x39'))){_0x4770d7[_0xa4ff('0x1e')]=qs['limit'](_0x2f07e5[_0xa4ff('0x31')]['limit']);_0x4770d7[_0xa4ff('0x20')]=qs[_0xa4ff('0x20')](_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x20')]);}_0x4770d7[_0xa4ff('0x3a')]=qs['sort'](_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x3b')]);_0x4770d7['where']=qs[_0xa4ff('0x33')](_['pick'](_0x2f07e5[_0xa4ff('0x31')],_0x18eefd[_0xa4ff('0x33')]),_0x107a7b);if(_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x3c')]){_0x4770d7['where']=_['merge'](_0x4770d7[_0xa4ff('0x3d')],{'$or':_[_0xa4ff('0x30')](_0x107a7b,function(_0x4699bf){if(_0x4699bf[_0xa4ff('0x2d')]!==_0xa4ff('0x3e')){var _0x426bfa={};_0x426bfa[_0x4699bf['name']]={'$like':'%'+_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x3c')]+'%'};return _0x426bfa;}})});}_0x4770d7=_[_0xa4ff('0x3f')]({},_0x4770d7,_0x2f07e5[_0xa4ff('0x40')]);var _0x5e9e3e={'where':_0x4770d7[_0xa4ff('0x3d')]};return db[_0xa4ff('0x2b')][_0xa4ff('0x1f')](_0x5e9e3e)[_0xa4ff('0x25')](function(_0x10a03c){_0x176466[_0xa4ff('0x1f')]=_0x10a03c;if(_0x2f07e5[_0xa4ff('0x31')][_0xa4ff('0x41')]){_0x4770d7[_0xa4ff('0x42')]=[{'all':!![]}];}return db[_0xa4ff('0x2b')][_0xa4ff('0x43')](_0x4770d7);})['then'](function(_0x4a8ff6){_0x176466['rows']=_0x4a8ff6;return _0x176466;})['then'](respondWithFilteredResult(_0x208730,_0x4770d7))[_0xa4ff('0x44')](handleError(_0x208730,null));};exports[_0xa4ff('0x45')]=function(_0x1b7ab8,_0x3e76f0){var _0x382909={'raw':![],'where':{'id':_0x1b7ab8[_0xa4ff('0x46')]['id']}},_0x199c74={};_0x199c74[_0xa4ff('0x2f')]=_['keys'](db[_0xa4ff('0x2b')][_0xa4ff('0x2c')]);_0x199c74[_0xa4ff('0x31')]=_[_0xa4ff('0x32')](_0x1b7ab8['query']);_0x199c74[_0xa4ff('0x33')]=_[_0xa4ff('0x34')](_0x199c74[_0xa4ff('0x2f')],_0x199c74[_0xa4ff('0x31')]);_0x382909[_0xa4ff('0x35')]=_[_0xa4ff('0x34')](_0x199c74[_0xa4ff('0x2f')],qs['fields'](_0x1b7ab8['query'][_0xa4ff('0x36')]));_0x382909[_0xa4ff('0x35')]=_0x382909[_0xa4ff('0x35')]['length']?_0x382909[_0xa4ff('0x35')]:_0x199c74[_0xa4ff('0x2f')];if(_0x1b7ab8['query']['includeAll']){_0x382909[_0xa4ff('0x42')]=[{'all':!![]}];}_0x382909=_[_0xa4ff('0x3f')]({},_0x382909,_0x1b7ab8[_0xa4ff('0x40')]);return db[_0xa4ff('0x2b')][_0xa4ff('0x47')](_0x382909)[_0xa4ff('0x25')](handleEntityNotFound(_0x3e76f0,null))['then'](respondWithResult(_0x3e76f0,null))[_0xa4ff('0x44')](handleError(_0x3e76f0,null));};exports['create']=function(_0x2ade8c,_0x345c7f){return db['FreshdeskConfiguration']['create'](_0x2ade8c[_0xa4ff('0x48')],{})[_0xa4ff('0x25')](respondWithResult(_0x345c7f,0xc9))[_0xa4ff('0x44')](handleError(_0x345c7f,null));};exports[_0xa4ff('0x49')]=function(_0xf724d7,_0xf671b8){if(_0xf724d7[_0xa4ff('0x48')]['id']){delete _0xf724d7[_0xa4ff('0x48')]['id'];}return db[_0xa4ff('0x2b')][_0xa4ff('0x47')]({'where':{'id':_0xf724d7[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x25')](handleEntityNotFound(_0xf671b8,null))[_0xa4ff('0x25')](saveUpdates(_0xf724d7[_0xa4ff('0x48')],null))[_0xa4ff('0x25')](respondWithResult(_0xf671b8,null))[_0xa4ff('0x44')](handleError(_0xf671b8,null));};exports[_0xa4ff('0x4a')]=function(_0x5732c1,_0x435cc7){return db['FreshdeskConfiguration'][_0xa4ff('0x47')]({'where':{'id':_0x5732c1['params']['id']}})[_0xa4ff('0x25')](handleEntityNotFound(_0x435cc7,null))[_0xa4ff('0x25')](removeEntity(_0x435cc7,null))[_0xa4ff('0x44')](handleError(_0x435cc7,null));};exports[_0xa4ff('0x4b')]=function(_0x1dd009,_0x3e7308,_0x4f847e){var _0x13e897={};var _0x89537c={};var _0x100a05;var _0x27e7d9;return db['FreshdeskConfiguration'][_0xa4ff('0x4c')]({'where':{'id':_0x1dd009[_0xa4ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e7308,null))[_0xa4ff('0x25')](function(_0x1ae0dc){if(_0x1ae0dc){_0x100a05=_0x1ae0dc;_0x89537c[_0xa4ff('0x2f')]=_[_0xa4ff('0x32')](db[_0xa4ff('0x4d')][_0xa4ff('0x2c')]);_0x89537c[_0xa4ff('0x31')]=_[_0xa4ff('0x32')](_0x1dd009['query']);_0x89537c[_0xa4ff('0x33')]=_[_0xa4ff('0x34')](_0x89537c['model'],_0x89537c['query']);_0x13e897[_0xa4ff('0x35')]=_['intersection'](_0x89537c[_0xa4ff('0x2f')],qs[_0xa4ff('0x36')](_0x1dd009['query'][_0xa4ff('0x36')]));_0x13e897[_0xa4ff('0x35')]=_0x13e897[_0xa4ff('0x35')][_0xa4ff('0x37')]?_0x13e897[_0xa4ff('0x35')]:_0x89537c[_0xa4ff('0x2f')];_0x13e897[_0xa4ff('0x3a')]=qs[_0xa4ff('0x3b')](_0x1dd009['query'][_0xa4ff('0x3b')]);_0x13e897[_0xa4ff('0x3d')]=qs[_0xa4ff('0x33')](_['pick'](_0x1dd009['query'],_0x89537c[_0xa4ff('0x33')]));if(_0x1dd009[_0xa4ff('0x31')]['filter']){_0x13e897[_0xa4ff('0x3d')]=_[_0xa4ff('0x3f')](_0x13e897[_0xa4ff('0x3d')],{'$or':_[_0xa4ff('0x30')](_0x13e897[_0xa4ff('0x35')],function(_0x583022){var _0x3a3e24={};_0x3a3e24[_0x583022]={'$like':'%'+_0x1dd009[_0xa4ff('0x31')][_0xa4ff('0x3c')]+'%'};return _0x3a3e24;})});}_0x13e897=_[_0xa4ff('0x3f')]({},_0x13e897,_0x1dd009[_0xa4ff('0x40')]);return _0x100a05[_0xa4ff('0x4b')](_0x13e897);}})[_0xa4ff('0x25')](function(_0x320dc8){if(_0x320dc8){_0x27e7d9=_0x320dc8[_0xa4ff('0x37')];if(!_0x1dd009['query'][_0xa4ff('0x38')](_0xa4ff('0x39'))){_0x13e897[_0xa4ff('0x1e')]=qs[_0xa4ff('0x1e')](_0x1dd009['query'][_0xa4ff('0x1e')]);_0x13e897[_0xa4ff('0x20')]=qs[_0xa4ff('0x20')](_0x1dd009[_0xa4ff('0x31')][_0xa4ff('0x20')]);}return _0x100a05[_0xa4ff('0x4b')](_0x13e897);}})[_0xa4ff('0x25')](function(_0x3930d0){if(_0x3930d0){return _0x3930d0?{'count':_0x27e7d9,'rows':_0x3930d0}:null;}})[_0xa4ff('0x25')](respondWithResult(_0x3e7308,null))[_0xa4ff('0x44')](handleError(_0x3e7308,null));};exports[_0xa4ff('0x4e')]=function(_0x46c9d3,_0x5d22b9,_0x15f671){var _0x129957={};var _0x38635f={};var _0x284d31;var _0x2135c4;return db['FreshdeskConfiguration'][_0xa4ff('0x4c')]({'where':{'id':_0x46c9d3['params']['id']}})[_0xa4ff('0x25')](handleEntityNotFound(_0x5d22b9,null))['then'](function(_0x3b82c8){if(_0x3b82c8){_0x284d31=_0x3b82c8;_0x38635f[_0xa4ff('0x2f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x38635f[_0xa4ff('0x31')]=_[_0xa4ff('0x32')](_0x46c9d3['query']);_0x38635f['filters']=_[_0xa4ff('0x34')](_0x38635f['model'],_0x38635f['query']);_0x129957[_0xa4ff('0x35')]=_[_0xa4ff('0x34')](_0x38635f[_0xa4ff('0x2f')],qs['fields'](_0x46c9d3[_0xa4ff('0x31')]['fields']));_0x129957[_0xa4ff('0x35')]=_0x129957[_0xa4ff('0x35')][_0xa4ff('0x37')]?_0x129957[_0xa4ff('0x35')]:_0x38635f['model'];_0x129957['order']=qs[_0xa4ff('0x3b')](_0x46c9d3[_0xa4ff('0x31')][_0xa4ff('0x3b')]);_0x129957[_0xa4ff('0x3d')]=qs[_0xa4ff('0x33')](_['pick'](_0x46c9d3['query'],_0x38635f[_0xa4ff('0x33')]));if(_0x46c9d3[_0xa4ff('0x31')][_0xa4ff('0x3c')]){_0x129957[_0xa4ff('0x3d')]=_[_0xa4ff('0x3f')](_0x129957['where'],{'$or':_['map'](_0x129957[_0xa4ff('0x35')],function(_0x5e3ed2){var _0x1c679b={};_0x1c679b[_0x5e3ed2]={'$like':'%'+_0x46c9d3['query'][_0xa4ff('0x3c')]+'%'};return _0x1c679b;})});}_0x129957=_[_0xa4ff('0x3f')]({},_0x129957,_0x46c9d3[_0xa4ff('0x40')]);return _0x284d31['getSubjects'](_0x129957);}})[_0xa4ff('0x25')](function(_0xf472eb){if(_0xf472eb){_0x2135c4=_0xf472eb[_0xa4ff('0x37')];if(!_0x46c9d3[_0xa4ff('0x31')]['hasOwnProperty'](_0xa4ff('0x39'))){_0x129957[_0xa4ff('0x1e')]=qs['limit'](_0x46c9d3[_0xa4ff('0x31')][_0xa4ff('0x1e')]);_0x129957[_0xa4ff('0x20')]=qs[_0xa4ff('0x20')](_0x46c9d3[_0xa4ff('0x31')][_0xa4ff('0x20')]);}return _0x284d31['getSubjects'](_0x129957);}})[_0xa4ff('0x25')](function(_0x1302b8){if(_0x1302b8){return _0x1302b8?{'count':_0x2135c4,'rows':_0x1302b8}:null;}})['then'](respondWithResult(_0x5d22b9,null))[_0xa4ff('0x44')](handleError(_0x5d22b9,null));};exports[_0xa4ff('0x4f')]=function(_0x2e643b,_0x2ab682,_0x28271a){var _0x3e888f={};var _0x3d0a5a={};var _0x681d4a;var _0x4a0ef3;return db[_0xa4ff('0x2b')][_0xa4ff('0x4c')]({'where':{'id':_0x2e643b['params']['id']}})['then'](handleEntityNotFound(_0x2ab682,null))[_0xa4ff('0x25')](function(_0x2f0e14){if(_0x2f0e14){_0x681d4a=_0x2f0e14;_0x3d0a5a[_0xa4ff('0x2f')]=_[_0xa4ff('0x32')](db[_0xa4ff('0x4d')][_0xa4ff('0x2c')]);_0x3d0a5a[_0xa4ff('0x31')]=_['keys'](_0x2e643b[_0xa4ff('0x31')]);_0x3d0a5a['filters']=_[_0xa4ff('0x34')](_0x3d0a5a[_0xa4ff('0x2f')],_0x3d0a5a[_0xa4ff('0x31')]);_0x3e888f['attributes']=_[_0xa4ff('0x34')](_0x3d0a5a[_0xa4ff('0x2f')],qs[_0xa4ff('0x36')](_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x36')]));_0x3e888f[_0xa4ff('0x35')]=_0x3e888f['attributes'][_0xa4ff('0x37')]?_0x3e888f[_0xa4ff('0x35')]:_0x3d0a5a[_0xa4ff('0x2f')];_0x3e888f[_0xa4ff('0x3a')]=qs['sort'](_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x3b')]);_0x3e888f[_0xa4ff('0x3d')]=qs[_0xa4ff('0x33')](_['pick'](_0x2e643b[_0xa4ff('0x31')],_0x3d0a5a[_0xa4ff('0x33')]));if(_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x3c')]){_0x3e888f['where']=_[_0xa4ff('0x3f')](_0x3e888f[_0xa4ff('0x3d')],{'$or':_[_0xa4ff('0x30')](_0x3e888f[_0xa4ff('0x35')],function(_0x356cf7){var _0x1fa73c={};_0x1fa73c[_0x356cf7]={'$like':'%'+_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x3c')]+'%'};return _0x1fa73c;})});}_0x3e888f=_[_0xa4ff('0x3f')]({},_0x3e888f,_0x2e643b['options']);return _0x681d4a[_0xa4ff('0x4f')](_0x3e888f);}})['then'](function(_0x2e9066){if(_0x2e9066){_0x4a0ef3=_0x2e9066['length'];if(!_0x2e643b['query'][_0xa4ff('0x38')](_0xa4ff('0x39'))){_0x3e888f['limit']=qs['limit'](_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x1e')]);_0x3e888f[_0xa4ff('0x20')]=qs[_0xa4ff('0x20')](_0x2e643b[_0xa4ff('0x31')][_0xa4ff('0x20')]);}return _0x681d4a[_0xa4ff('0x4f')](_0x3e888f);}})[_0xa4ff('0x25')](function(_0x3e3bce){if(_0x3e3bce){return _0x3e3bce?{'count':_0x4a0ef3,'rows':_0x3e3bce}:null;}})[_0xa4ff('0x25')](respondWithResult(_0x2ab682,null))['catch'](handleError(_0x2ab682,null));};exports[_0xa4ff('0x50')]=function(_0x589a02,_0x4c0c24,_0x2b5090){var _0x125e71={};var _0x5c9087={};var _0x5b490a;var _0x75faa4;return db[_0xa4ff('0x2b')]['findOne']({'where':{'id':_0x589a02[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x25')](handleEntityNotFound(_0x4c0c24,null))[_0xa4ff('0x25')](function(_0x1bb3e7){if(_0x1bb3e7){_0x5b490a=_0x1bb3e7;_0x5c9087[_0xa4ff('0x2f')]=_[_0xa4ff('0x32')](db[_0xa4ff('0x51')][_0xa4ff('0x2c')]);_0x5c9087[_0xa4ff('0x31')]=_[_0xa4ff('0x32')](_0x589a02[_0xa4ff('0x31')]);_0x5c9087[_0xa4ff('0x33')]=_['intersection'](_0x5c9087['model'],_0x5c9087[_0xa4ff('0x31')]);_0x125e71[_0xa4ff('0x35')]=_[_0xa4ff('0x34')](_0x5c9087[_0xa4ff('0x2f')],qs['fields'](_0x589a02[_0xa4ff('0x31')][_0xa4ff('0x36')]));_0x125e71['attributes']=_0x125e71['attributes'][_0xa4ff('0x37')]?_0x125e71['attributes']:_0x5c9087[_0xa4ff('0x2f')];_0x125e71[_0xa4ff('0x3a')]=qs[_0xa4ff('0x3b')](_0x589a02['query']['sort']);_0x125e71[_0xa4ff('0x3d')]=qs[_0xa4ff('0x33')](_[_0xa4ff('0x52')](_0x589a02[_0xa4ff('0x31')],_0x5c9087[_0xa4ff('0x33')]));if(_0x589a02[_0xa4ff('0x31')][_0xa4ff('0x3c')]){_0x125e71[_0xa4ff('0x3d')]=_[_0xa4ff('0x3f')](_0x125e71[_0xa4ff('0x3d')],{'$or':_[_0xa4ff('0x30')](_0x125e71[_0xa4ff('0x35')],function(_0x135a88){var _0x242a19={};_0x242a19[_0x135a88]={'$like':'%'+_0x589a02['query']['filter']+'%'};return _0x242a19;})});}_0x125e71=_[_0xa4ff('0x3f')]({},_0x125e71,_0x589a02[_0xa4ff('0x40')]);return _0x5b490a[_0xa4ff('0x50')](_0x125e71);}})[_0xa4ff('0x25')](function(_0x34a0f7){if(_0x34a0f7){_0x75faa4=_0x34a0f7[_0xa4ff('0x37')];if(!_0x589a02[_0xa4ff('0x31')]['hasOwnProperty'](_0xa4ff('0x39'))){_0x125e71['limit']=qs['limit'](_0x589a02[_0xa4ff('0x31')]['limit']);_0x125e71[_0xa4ff('0x20')]=qs[_0xa4ff('0x20')](_0x589a02[_0xa4ff('0x31')][_0xa4ff('0x20')]);}return _0x5b490a['getTags'](_0x125e71);}})[_0xa4ff('0x25')](function(_0x209fed){if(_0x209fed){return _0x209fed?{'count':_0x75faa4,'rows':_0x209fed}:null;}})['then'](respondWithResult(_0x4c0c24,null))['catch'](handleError(_0x4c0c24,null));};exports['setTags']=function(_0x50be69,_0x58dd8f,_0x32ab76){if(_0x50be69[_0xa4ff('0x48')]['id']){delete _0x50be69[_0xa4ff('0x48')]['id'];}return db[_0xa4ff('0x2b')][_0xa4ff('0x4c')]({'where':{'id':_0x50be69[_0xa4ff('0x46')]['id']}})[_0xa4ff('0x25')](handleEntityNotFound(_0x58dd8f,null))[_0xa4ff('0x25')](function(_0x405b71){if(_0x405b71){return _0x405b71['setTags'](_0x50be69[_0xa4ff('0x48')][_0xa4ff('0x53')]||[]);}return null;})[_0xa4ff('0x25')](respondWithResult(_0x58dd8f,null))['catch'](handleError(_0x58dd8f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2a512b4..5520a19 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 _0xc4e8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','FreshdeskConfiguration'];(function(_0x3e0fab,_0x285e29){var _0x36cde8=function(_0x124a10){while(--_0x124a10){_0x3e0fab['push'](_0x3e0fab['shift']());}};_0x36cde8(++_0x285e29);}(_0xc4e8,0x17c));var _0x8c4e=function(_0x5c95a2,_0xf62064){_0x5c95a2=_0x5c95a2-0x0;var _0x345fc6=_0xc4e8[_0x5c95a2];return _0x345fc6;};'use strict';var _=require('lodash');var util=require(_0x8c4e('0x0'));var logger=require(_0x8c4e('0x1'))(_0x8c4e('0x2'));var moment=require(_0x8c4e('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c4e('0x4'));var fs=require('fs');var path=require(_0x8c4e('0x5'));var rimraf=require(_0x8c4e('0x6'));var config=require(_0x8c4e('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x8c4e('0x8')]=function(_0x10fb98,_0x3f5e4c){return _0x10fb98['define'](_0x8c4e('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe355=['exports','define','FreshdeskConfiguration','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe355,0x137));var _0x5e35=function(_0x34968e,_0xbcd5a4){_0x34968e=_0x34968e-0x0;var _0x109081=_0xe355[_0x34968e];return _0x109081;};'use strict';var _=require(_0x5e35('0x0'));var util=require(_0x5e35('0x1'));var logger=require('../../config/logger')(_0x5e35('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5e35('0x3'));var fs=require('fs');var path=require(_0x5e35('0x4'));var rimraf=require(_0x5e35('0x5'));var config=require(_0x5e35('0x6'));var attributes=require(_0x5e35('0x7'));module[_0x5e35('0x8')]=function(_0x41ec22,_0x5f03ba){return _0x41ec22[_0x5e35('0x9')](_0x5e35('0xa'),attributes,{'tableName':'int_freshdesk_configurations','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 1f5983f..f8a6c98 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 _0xcde4=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x4b0a13,_0x9f30e0){var _0x4d11bf=function(_0x1cc6cc){while(--_0x1cc6cc){_0x4b0a13['push'](_0x4b0a13['shift']());}};_0x4d11bf(++_0x9f30e0);}(_0xcde4,0x1ab));var _0x4cde=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xcde4[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x4cde('0x0'));var util=require(_0x4cde('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4cde('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cde('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cde('0x4'))(_0x4cde('0x5'));var config=require(_0x4cde('0x6'));var jayson=require(_0x4cde('0x7'));var client=jayson['client'][_0x4cde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2db154,_0x15e961,_0x2ea5ed){return new BPromise(function(_0x4d658b,_0x22bff5){return client[_0x4cde('0x9')](_0x2db154,_0x2ea5ed)['then'](function(_0x33c3d0){logger[_0x4cde('0xa')](_0x4cde('0xb'),_0x15e961,_0x4cde('0xc'));logger[_0x4cde('0xd')](_0x4cde('0xe'),_0x15e961,_0x4cde('0xc'),JSON['stringify'](_0x33c3d0));if(_0x33c3d0['error']){if(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x10')]===0x1f4){logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0x33c3d0[_0x4cde('0xf')]['message']);return _0x22bff5(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x11')]);}logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0x33c3d0['error']['message']);return _0x4d658b(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x11')]);}else{logger[_0x4cde('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15e961,_0x4cde('0xc'));_0x4d658b(_0x33c3d0['result']['message']);}})[_0x4cde('0x12')](function(_0xbcb7b6){logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0xbcb7b6);_0x22bff5(_0xbcb7b6);});});} \ No newline at end of file +var _0xc7bc=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xc7bc,0x13c));var _0xcc7b=function(_0x533b40,_0x204696){_0x533b40=_0x533b40-0x0;var _0x2b0292=_0xc7bc[_0x533b40];return _0x2b0292;};'use strict';var _=require(_0xcc7b('0x0'));var util=require('util');var moment=require(_0xcc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xcc7b('0x2'));var fs=require('fs');var Redis=require(_0xcc7b('0x3'));var db=require(_0xcc7b('0x4'))['db'];var utils=require(_0xcc7b('0x5'));var logger=require(_0xcc7b('0x6'))(_0xcc7b('0x7'));var config=require(_0xcc7b('0x8'));var jayson=require(_0xcc7b('0x9'));var client=jayson['client'][_0xcc7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9b39,_0xd9fbd6,_0x35df32){return new BPromise(function(_0x300a49,_0x22c1e4){return client[_0xcc7b('0xb')](_0x1a9b39,_0x35df32)['then'](function(_0xad4159){logger[_0xcc7b('0xc')](_0xcc7b('0xd'),_0xd9fbd6,_0xcc7b('0xe'));logger[_0xcc7b('0xf')](_0xcc7b('0x10'),_0xd9fbd6,_0xcc7b('0xe'),JSON[_0xcc7b('0x11')](_0xad4159));if(_0xad4159['error']){if(_0xad4159[_0xcc7b('0x12')][_0xcc7b('0x13')]===0x1f4){logger[_0xcc7b('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xd9fbd6,_0xad4159[_0xcc7b('0x12')]['message']);return _0x22c1e4(_0xad4159[_0xcc7b('0x12')][_0xcc7b('0x14')]);}logger[_0xcc7b('0x12')](_0xcc7b('0xd'),_0xd9fbd6,_0xad4159['error'][_0xcc7b('0x14')]);return _0x300a49(_0xad4159[_0xcc7b('0x12')][_0xcc7b('0x14')]);}else{logger['info'](_0xcc7b('0xd'),_0xd9fbd6,'request\x20sent');_0x300a49(_0xad4159[_0xcc7b('0x15')][_0xcc7b('0x14')]);}})[_0xcc7b('0x16')](function(_0x419e39){logger['error'](_0xcc7b('0xd'),_0xd9fbd6,_0x419e39);_0x22c1e4(_0x419e39);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index db340b4..b729448 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 _0x4742=['/:id','show','post','create','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get'];(function(_0x2524ec,_0x1a87a9){var _0x5150e9=function(_0x4e6312){while(--_0x4e6312){_0x2524ec['push'](_0x2524ec['shift']());}};_0x5150e9(++_0x1a87a9);}(_0x4742,0xb2));var _0x2474=function(_0x29db71,_0x43a62a){_0x29db71=_0x29db71-0x0;var _0x11f102=_0x4742[_0x29db71];return _0x11f102;};'use strict';var multer=require('multer');var util=require(_0x2474('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2474('0x1')]();var fs_extra=require(_0x2474('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2474('0x3'));var config=require(_0x2474('0x4'));var controller=require(_0x2474('0x5'));router['get']('/',auth[_0x2474('0x6')](),controller[_0x2474('0x7')]);router[_0x2474('0x8')](_0x2474('0x9'),auth[_0x2474('0x6')](),controller[_0x2474('0xa')]);router[_0x2474('0xb')]('/',auth['isAuthenticated'](),controller[_0x2474('0xc')]);router['put'](_0x2474('0x9'),auth[_0x2474('0x6')](),controller[_0x2474('0xd')]);router[_0x2474('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2474('0xf')]);module[_0x2474('0x10')]=router; \ No newline at end of file +var _0x6157=['delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','isAuthenticated','/:id','show','post','put'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6157,0x179));var _0x7615=function(_0x5aa1a2,_0x466532){_0x5aa1a2=_0x5aa1a2-0x0;var _0xc5f363=_0x6157[_0x5aa1a2];return _0xc5f363;};'use strict';var multer=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var path=require(_0x7615('0x2'));var timeout=require('connect-timeout');var express=require(_0x7615('0x3'));var router=express[_0x7615('0x4')]();var fs_extra=require(_0x7615('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7615('0x6'));var controller=require(_0x7615('0x7'));router['get']('/',auth[_0x7615('0x8')](),controller['index']);router['get'](_0x7615('0x9'),auth['isAuthenticated'](),controller[_0x7615('0xa')]);router[_0x7615('0xb')]('/',auth[_0x7615('0x8')](),controller['create']);router[_0x7615('0xc')](_0x7615('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x7615('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x7615('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e5ec3a5..4ffa3b7 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 _0x1399=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x558b2d,_0x53e9f3){var _0x374c92=function(_0x337e61){while(--_0x337e61){_0x558b2d['push'](_0x558b2d['shift']());}};_0x374c92(++_0x53e9f3);}(_0x1399,0x19b));var _0x9139=function(_0x474f02,_0x44c5af){_0x474f02=_0x474f02-0x0;var _0x47321d=_0x1399[_0x474f02];return _0x47321d;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'type':{'type':Sequelize[_0x9139('0x2')](_0x9139('0x3'),_0x9139('0x4'),_0x9139('0x5'),_0x9139('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9139('0x7')]},'keyType':{'type':Sequelize[_0x9139('0x2')](_0x9139('0x3'),'variable',_0x9139('0x5'))},'keyContent':{'type':Sequelize[_0x9139('0x7')]},'idField':{'type':Sequelize[_0x9139('0x7')]},'nameField':{'type':Sequelize[_0x9139('0x7')]},'customField':{'type':Sequelize[_0x9139('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9139('0x7')]}}; \ No newline at end of file +var _0x9288=['STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x4d6c98,_0x246c39){var _0x3da6e2=function(_0x4fa04e){while(--_0x4fa04e){_0x4d6c98['push'](_0x4d6c98['shift']());}};_0x3da6e2(++_0x246c39);}(_0x9288,0x13a));var _0x8928=function(_0x58ccfe,_0x4d0c41){_0x58ccfe=_0x58ccfe-0x0;var _0x4e8273=_0x9288[_0x58ccfe];return _0x4e8273;};'use strict';var Sequelize=require(_0x8928('0x0'));module[_0x8928('0x1')]={'type':{'type':Sequelize[_0x8928('0x2')](_0x8928('0x3'),'variable','customVariable',_0x8928('0x4'),_0x8928('0x5')),'defaultValue':_0x8928('0x3')},'content':{'type':Sequelize[_0x8928('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8928('0x2')](_0x8928('0x3'),_0x8928('0x7'),_0x8928('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8928('0x6')]},'nameField':{'type':Sequelize[_0x8928('0x6')]},'customField':{'type':Sequelize[_0x8928('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8928('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 734b609..25e89a8 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 _0x878f=['key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','FreshdeskField','rows','params','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x553ef3,_0x5d608b){var _0x2f0bb4=function(_0x3aac1b){while(--_0x3aac1b){_0x553ef3['push'](_0x553ef3['shift']());}};_0x2f0bb4(++_0x5d608b);}(_0x878f,0x173));var _0xf878=function(_0x568c2a,_0x31c9e6){_0x568c2a=_0x568c2a-0x0;var _0x28ae65=_0x878f[_0x568c2a];return _0x28ae65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x22')]();});}};}function handleEntityNotFound(_0x35b3b4,_0x280036){return function(_0x20449e){if(!_0x20449e){_0x35b3b4['sendStatus'](0x194);}return _0x20449e;};}function handleError(_0x58c713,_0x59ba7b){_0x59ba7b=_0x59ba7b||0x1f4;return function(_0x242926){logger[_0xf878('0x23')](_0x242926[_0xf878('0x24')]);if(_0x242926['name']){delete _0x242926[_0xf878('0x25')];}_0x58c713[_0xf878('0x16')](_0x59ba7b)[_0xf878('0x26')](_0x242926);};}exports[_0xf878('0x27')]=function(_0x41dd55,_0x5aff46){var _0x502322={},_0x9a127d={},_0x5d9c97={'count':0x0,'rows':[]};var _0x4a0286=_[_0xf878('0x28')](db['FreshdeskField'][_0xf878('0x29')],function(_0x51afaf){return{'name':_0x51afaf[_0xf878('0x2a')],'type':_0x51afaf['type'][_0xf878('0x2b')]};});_0x9a127d['model']=_[_0xf878('0x28')](_0x4a0286,_0xf878('0x25'));_0x9a127d[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x41dd55[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2e')]=_['intersection'](_0x9a127d[_0xf878('0x2f')],_0x9a127d[_0xf878('0x2c')]);_0x502322[_0xf878('0x30')]=_[_0xf878('0x31')](_0x9a127d[_0xf878('0x2f')],qs['fields'](_0x41dd55[_0xf878('0x2c')][_0xf878('0x32')]));_0x502322['attributes']=_0x502322[_0xf878('0x30')][_0xf878('0x33')]?_0x502322[_0xf878('0x30')]:_0x9a127d[_0xf878('0x2f')];if(!_0x41dd55[_0xf878('0x2c')]['hasOwnProperty'](_0xf878('0x34'))){_0x502322[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x41dd55[_0xf878('0x2c')]['limit']);_0x502322[_0xf878('0x17')]=qs['offset'](_0x41dd55['query'][_0xf878('0x17')]);}_0x502322[_0xf878('0x35')]=qs[_0xf878('0x36')](_0x41dd55[_0xf878('0x2c')][_0xf878('0x36')]);_0x502322['where']=qs[_0xf878('0x2e')](_['pick'](_0x41dd55[_0xf878('0x2c')],_0x9a127d[_0xf878('0x2e')]),_0x4a0286);if(_0x41dd55['query'][_0xf878('0x37')]){_0x502322[_0xf878('0x38')]=_['merge'](_0x502322[_0xf878('0x38')],{'$or':_[_0xf878('0x28')](_0x4a0286,function(_0x5b4098){if(_0x5b4098[_0xf878('0x39')]!==_0xf878('0x3a')){var _0x34731d={};_0x34731d[_0x5b4098[_0xf878('0x25')]]={'$like':'%'+_0x41dd55[_0xf878('0x2c')][_0xf878('0x37')]+'%'};return _0x34731d;}})});}_0x502322=_[_0xf878('0x3b')]({},_0x502322,_0x41dd55['options']);var _0x1179fb={'where':_0x502322[_0xf878('0x38')]};return db['FreshdeskField'][_0xf878('0x1a')](_0x1179fb)['then'](function(_0x489964){_0x5d9c97[_0xf878('0x1a')]=_0x489964;if(_0x41dd55[_0xf878('0x2c')][_0xf878('0x3c')]){_0x502322[_0xf878('0x3d')]=[{'all':!![]}];}return db[_0xf878('0x3e')]['findAll'](_0x502322);})[_0xf878('0x20')](function(_0x4c4ae4){_0x5d9c97[_0xf878('0x3f')]=_0x4c4ae4;return _0x5d9c97;})[_0xf878('0x20')](respondWithFilteredResult(_0x5aff46,_0x502322))['catch'](handleError(_0x5aff46,null));};exports['show']=function(_0x180594,_0x2a66c1){var _0x13fcd3={'raw':!![],'where':{'id':_0x180594[_0xf878('0x40')]['id']}},_0x2f6ee5={};_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2d')](db[_0xf878('0x3e')][_0xf878('0x29')]);_0x2f6ee5['query']=_[_0xf878('0x2d')](_0x180594[_0xf878('0x2c')]);_0x2f6ee5[_0xf878('0x2e')]=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],_0x2f6ee5[_0xf878('0x2c')]);_0x13fcd3['attributes']=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],qs[_0xf878('0x32')](_0x180594[_0xf878('0x2c')][_0xf878('0x32')]));_0x13fcd3['attributes']=_0x13fcd3[_0xf878('0x30')][_0xf878('0x33')]?_0x13fcd3[_0xf878('0x30')]:_0x2f6ee5[_0xf878('0x2f')];if(_0x180594['query'][_0xf878('0x3c')]){_0x13fcd3[_0xf878('0x3d')]=[{'all':!![]}];}_0x13fcd3=_[_0xf878('0x3b')]({},_0x13fcd3,_0x180594['options']);return db['FreshdeskField'][_0xf878('0x41')](_0x13fcd3)['then'](handleEntityNotFound(_0x2a66c1,null))['then'](respondWithResult(_0x2a66c1,null))['catch'](handleError(_0x2a66c1,null));};exports[_0xf878('0x42')]=function(_0x49e719,_0x156fdb){return db[_0xf878('0x3e')][_0xf878('0x42')](_0x49e719[_0xf878('0x43')],{})[_0xf878('0x20')](respondWithResult(_0x156fdb,0xc9))[_0xf878('0x44')](handleError(_0x156fdb,null));};exports[_0xf878('0x1f')]=function(_0x526c89,_0xb0bf4c){if(_0x526c89[_0xf878('0x43')]['id']){delete _0x526c89[_0xf878('0x43')]['id'];}return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x526c89['params']['id']}})['then'](handleEntityNotFound(_0xb0bf4c,null))[_0xf878('0x20')](saveUpdates(_0x526c89[_0xf878('0x43')],null))['then'](respondWithResult(_0xb0bf4c,null))[_0xf878('0x44')](handleError(_0xb0bf4c,null));};exports['destroy']=function(_0x1ce6b9,_0x31adde){return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x1ce6b9['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x31adde,null))[_0xf878('0x20')](removeEntity(_0x31adde,null))[_0xf878('0x44')](handleError(_0x31adde,null));}; \ No newline at end of file +var _0x1b73=['include','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','map','FreshdeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll'];(function(_0x546ab6,_0x357f23){var _0x3952ca=function(_0x29dcfa){while(--_0x29dcfa){_0x546ab6['push'](_0x546ab6['shift']());}};_0x3952ca(++_0x357f23);}(_0x1b73,0x1d5));var _0x31b7=function(_0x2d41dd,_0x4884ac){_0x2d41dd=_0x2d41dd-0x0;var _0x1d2ffa=_0x1b73[_0x2d41dd];return _0x1d2ffa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0x2c993b,_0x4e5673){return function(_0xb8a998){if(!_0xb8a998){_0x2c993b['sendStatus'](0x194);}return _0xb8a998;};}function handleError(_0x3dd60d,_0x2da751){_0x2da751=_0x2da751||0x1f4;return function(_0x14b63f){logger[_0x31b7('0x28')](_0x14b63f[_0x31b7('0x29')]);if(_0x14b63f[_0x31b7('0x2a')]){delete _0x14b63f[_0x31b7('0x2a')];}_0x3dd60d[_0x31b7('0x1b')](_0x2da751)['send'](_0x14b63f);};}exports['index']=function(_0x503549,_0x46508a){var _0x39521d={},_0x2a7c54={},_0x4f5e1d={'count':0x0,'rows':[]};var _0x169238=_[_0x31b7('0x2b')](db[_0x31b7('0x2c')][_0x31b7('0x2d')],function(_0x58a87e){return{'name':_0x58a87e[_0x31b7('0x2e')],'type':_0x58a87e[_0x31b7('0x2f')]['key']};});_0x2a7c54['model']=_[_0x31b7('0x2b')](_0x169238,_0x31b7('0x2a'));_0x2a7c54[_0x31b7('0x30')]=_[_0x31b7('0x31')](_0x503549['query']);_0x2a7c54['filters']=_[_0x31b7('0x32')](_0x2a7c54[_0x31b7('0x33')],_0x2a7c54[_0x31b7('0x30')]);_0x39521d[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x2a7c54['model'],qs['fields'](_0x503549[_0x31b7('0x30')][_0x31b7('0x35')]));_0x39521d['attributes']=_0x39521d[_0x31b7('0x34')][_0x31b7('0x36')]?_0x39521d['attributes']:_0x2a7c54[_0x31b7('0x33')];if(!_0x503549[_0x31b7('0x30')][_0x31b7('0x37')](_0x31b7('0x38'))){_0x39521d[_0x31b7('0x1e')]=qs[_0x31b7('0x1e')](_0x503549[_0x31b7('0x30')][_0x31b7('0x1e')]);_0x39521d[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x503549[_0x31b7('0x30')][_0x31b7('0x20')]);}_0x39521d[_0x31b7('0x39')]=qs['sort'](_0x503549['query'][_0x31b7('0x3a')]);_0x39521d[_0x31b7('0x3b')]=qs[_0x31b7('0x3c')](_[_0x31b7('0x3d')](_0x503549[_0x31b7('0x30')],_0x2a7c54[_0x31b7('0x3c')]),_0x169238);if(_0x503549[_0x31b7('0x30')][_0x31b7('0x3e')]){_0x39521d[_0x31b7('0x3b')]=_[_0x31b7('0x3f')](_0x39521d['where'],{'$or':_[_0x31b7('0x2b')](_0x169238,function(_0xfd4863){if(_0xfd4863[_0x31b7('0x2f')]!==_0x31b7('0x40')){var _0x5c9cec={};_0x5c9cec[_0xfd4863[_0x31b7('0x2a')]]={'$like':'%'+_0x503549[_0x31b7('0x30')]['filter']+'%'};return _0x5c9cec;}})});}_0x39521d=_[_0x31b7('0x3f')]({},_0x39521d,_0x503549['options']);var _0x587506={'where':_0x39521d[_0x31b7('0x3b')]};return db[_0x31b7('0x2c')][_0x31b7('0x1f')](_0x587506)[_0x31b7('0x27')](function(_0x3d0413){_0x4f5e1d['count']=_0x3d0413;if(_0x503549[_0x31b7('0x30')]['includeAll']){_0x39521d['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x31b7('0x41')](_0x39521d);})[_0x31b7('0x27')](function(_0x1527b3){_0x4f5e1d[_0x31b7('0x42')]=_0x1527b3;return _0x4f5e1d;})[_0x31b7('0x27')](respondWithFilteredResult(_0x46508a,_0x39521d))['catch'](handleError(_0x46508a,null));};exports[_0x31b7('0x43')]=function(_0x5d1f25,_0xef2b18){var _0x3caab0={'raw':!![],'where':{'id':_0x5d1f25[_0x31b7('0x44')]['id']}},_0x41c92e={};_0x41c92e['model']=_[_0x31b7('0x31')](db[_0x31b7('0x2c')][_0x31b7('0x2d')]);_0x41c92e['query']=_[_0x31b7('0x31')](_0x5d1f25['query']);_0x41c92e[_0x31b7('0x3c')]=_[_0x31b7('0x32')](_0x41c92e['model'],_0x41c92e[_0x31b7('0x30')]);_0x3caab0[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x41c92e[_0x31b7('0x33')],qs['fields'](_0x5d1f25[_0x31b7('0x30')]['fields']));_0x3caab0['attributes']=_0x3caab0[_0x31b7('0x34')][_0x31b7('0x36')]?_0x3caab0[_0x31b7('0x34')]:_0x41c92e[_0x31b7('0x33')];if(_0x5d1f25['query'][_0x31b7('0x45')]){_0x3caab0[_0x31b7('0x46')]=[{'all':!![]}];}_0x3caab0=_['merge']({},_0x3caab0,_0x5d1f25[_0x31b7('0x47')]);return db[_0x31b7('0x2c')][_0x31b7('0x48')](_0x3caab0)['then'](handleEntityNotFound(_0xef2b18,null))[_0x31b7('0x27')](respondWithResult(_0xef2b18,null))[_0x31b7('0x49')](handleError(_0xef2b18,null));};exports[_0x31b7('0x4a')]=function(_0x164115,_0x345059){return db[_0x31b7('0x2c')][_0x31b7('0x4a')](_0x164115[_0x31b7('0x4b')],{})['then'](respondWithResult(_0x345059,0xc9))[_0x31b7('0x49')](handleError(_0x345059,null));};exports['update']=function(_0x5a72ee,_0x22cc77){if(_0x5a72ee[_0x31b7('0x4b')]['id']){delete _0x5a72ee[_0x31b7('0x4b')]['id'];}return db[_0x31b7('0x2c')]['find']({'where':{'id':_0x5a72ee[_0x31b7('0x44')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x22cc77,null))[_0x31b7('0x27')](saveUpdates(_0x5a72ee['body'],null))[_0x31b7('0x27')](respondWithResult(_0x22cc77,null))[_0x31b7('0x49')](handleError(_0x22cc77,null));};exports[_0x31b7('0x4c')]=function(_0x3b5868,_0x2bf59c){return db[_0x31b7('0x2c')][_0x31b7('0x48')]({'where':{'id':_0x3b5868[_0x31b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bf59c,null))['then'](removeEntity(_0x2bf59c,null))[_0x31b7('0x49')](handleError(_0x2bf59c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ab476ba..bf000e7 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 _0xe444=['bluebird','request-promise','path','rimraf','exports','define','FieldId','util','../../config/logger','api','moment'];(function(_0x14f849,_0x4d13e5){var _0xcef4c4=function(_0x5e4fbc){while(--_0x5e4fbc){_0x14f849['push'](_0x14f849['shift']());}};_0xcef4c4(++_0x4d13e5);}(_0xe444,0x1bf));var _0x4e44=function(_0x5442e0,_0x5515e2){_0x5442e0=_0x5442e0-0x0;var _0x3987aa=_0xe444[_0x5442e0];return _0x3987aa;};'use strict';var _=require('lodash');var util=require(_0x4e44('0x0'));var logger=require(_0x4e44('0x1'))(_0x4e44('0x2'));var moment=require(_0x4e44('0x3'));var BPromise=require(_0x4e44('0x4'));var rp=require(_0x4e44('0x5'));var fs=require('fs');var path=require(_0x4e44('0x6'));var rimraf=require(_0x4e44('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x4e44('0x8')]=function(_0x377323,_0x1acd2f){return _0x377323[_0x4e44('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x4e44('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21ca=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x225ffb,_0x3a7232){var _0x34089e=function(_0x5e46c9){while(--_0x5e46c9){_0x225ffb['push'](_0x225ffb['shift']());}};_0x34089e(++_0x3a7232);}(_0x21ca,0x14e));var _0xa21c=function(_0xc9873a,_0x5efdcb){_0xc9873a=_0xc9873a-0x0;var _0x2f7d84=_0x21ca[_0xc9873a];return _0x2f7d84;};'use strict';var _=require('lodash');var util=require(_0xa21c('0x0'));var logger=require(_0xa21c('0x1'))('api');var moment=require(_0xa21c('0x2'));var BPromise=require(_0xa21c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa21c('0x4'));var rimraf=require(_0xa21c('0x5'));var config=require(_0xa21c('0x6'));var attributes=require(_0xa21c('0x7'));module['exports']=function(_0x29c9f5,_0x24efd2){return _0x29c9f5['define'](_0xa21c('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa21c('0x9'),'fields':[_0xa21c('0xa'),_0xa21c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index aa53b4b..f62b091 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 _0x1ee0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1ee0,0x156));var _0x01ee=function(_0x44d545,_0x4ab65e){_0x44d545=_0x44d545-0x0;var _0x24702e=_0x1ee0[_0x44d545];return _0x24702e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x01ee('0x0'));var BPromise=require(_0x01ee('0x1'));var rs=require(_0x01ee('0x2'));var fs=require('fs');var Redis=require(_0x01ee('0x3'));var db=require(_0x01ee('0x4'))['db'];var utils=require(_0x01ee('0x5'));var logger=require(_0x01ee('0x6'))(_0x01ee('0x7'));var config=require(_0x01ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x01ee('0x9')][_0x01ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5acf84,_0x498eda,_0x5a66a4){return new BPromise(function(_0x30e58a,_0x494ade){return client[_0x01ee('0xb')](_0x5acf84,_0x5a66a4)[_0x01ee('0xc')](function(_0x11a3cf){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x498eda,_0x01ee('0xd'));logger[_0x01ee('0xe')](_0x01ee('0xf'),_0x498eda,_0x01ee('0xd'),JSON[_0x01ee('0x10')](_0x11a3cf));if(_0x11a3cf[_0x01ee('0x11')]){if(_0x11a3cf[_0x01ee('0x11')][_0x01ee('0x12')]===0x1f4){logger[_0x01ee('0x11')](_0x01ee('0x13'),_0x498eda,_0x11a3cf['error']['message']);return _0x494ade(_0x11a3cf[_0x01ee('0x11')]['message']);}logger[_0x01ee('0x11')](_0x01ee('0x13'),_0x498eda,_0x11a3cf[_0x01ee('0x11')]['message']);return _0x30e58a(_0x11a3cf['error'][_0x01ee('0x14')]);}else{logger[_0x01ee('0x15')](_0x01ee('0x13'),_0x498eda,_0x01ee('0xd'));_0x30e58a(_0x11a3cf[_0x01ee('0x16')][_0x01ee('0x14')]);}})['catch'](function(_0x321c51){logger[_0x01ee('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x498eda,_0x321c51);_0x494ade(_0x321c51);});});} \ No newline at end of file +var _0xb3d8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4729ae,_0x35a7c4){var _0x464880=function(_0x2e6d08){while(--_0x2e6d08){_0x4729ae['push'](_0x4729ae['shift']());}};_0x464880(++_0x35a7c4);}(_0xb3d8,0x191));var _0x8b3d=function(_0x2a5444,_0x49a726){_0x2a5444=_0x2a5444-0x0;var _0x1a057d=_0xb3d8[_0x2a5444];return _0x1a057d;};'use strict';var _=require(_0x8b3d('0x0'));var util=require(_0x8b3d('0x1'));var moment=require(_0x8b3d('0x2'));var BPromise=require(_0x8b3d('0x3'));var rs=require(_0x8b3d('0x4'));var fs=require('fs');var Redis=require(_0x8b3d('0x5'));var db=require(_0x8b3d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b3d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b3d('0x8'));var client=jayson[_0x8b3d('0x9')][_0x8b3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d31d9,_0x5881a0,_0x4bfe3c){return new BPromise(function(_0x9c5462,_0x20c0e4){return client['request'](_0x3d31d9,_0x4bfe3c)['then'](function(_0x5d05db){logger[_0x8b3d('0xb')](_0x8b3d('0xc'),_0x5881a0,_0x8b3d('0xd'));logger['debug'](_0x8b3d('0xe'),_0x5881a0,_0x8b3d('0xd'),JSON[_0x8b3d('0xf')](_0x5d05db));if(_0x5d05db[_0x8b3d('0x10')]){if(_0x5d05db[_0x8b3d('0x10')][_0x8b3d('0x11')]===0x1f4){logger['error'](_0x8b3d('0xc'),_0x5881a0,_0x5d05db[_0x8b3d('0x10')][_0x8b3d('0x12')]);return _0x20c0e4(_0x5d05db[_0x8b3d('0x10')][_0x8b3d('0x12')]);}logger[_0x8b3d('0x10')](_0x8b3d('0xc'),_0x5881a0,_0x5d05db[_0x8b3d('0x10')]['message']);return _0x9c5462(_0x5d05db[_0x8b3d('0x10')][_0x8b3d('0x12')]);}else{logger['info'](_0x8b3d('0xc'),_0x5881a0,_0x8b3d('0xd'));_0x9c5462(_0x5d05db['result'][_0x8b3d('0x12')]);}})[_0x8b3d('0x13')](function(_0x4425ea){logger['error'](_0x8b3d('0xc'),_0x5881a0,_0x4425ea);_0x20c0e4(_0x4425ea);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 97294dc..0735832 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 _0x750a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','put','delete','destroy','exports'];(function(_0x52ddf5,_0x865610){var _0x2e1d65=function(_0x4af34e){while(--_0x4af34e){_0x52ddf5['push'](_0x52ddf5['shift']());}};_0x2e1d65(++_0x865610);}(_0x750a,0x140));var _0xa750=function(_0x340e54,_0x5821cf){_0x340e54=_0x340e54-0x0;var _0x318d83=_0x750a[_0x340e54];return _0x318d83;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/fields',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router['post'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['addConfiguration']);router[_0xa750('0x10')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['update']);router[_0xa750('0x11')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);module[_0xa750('0x13')]=router; \ No newline at end of file +var _0x44a3=['getFields','post','addConfiguration','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations'];(function(_0x2acc06,_0x3f9dcf){var _0x18ad24=function(_0x440536){while(--_0x440536){_0x2acc06['push'](_0x2acc06['shift']());}};_0x18ad24(++_0x3f9dcf);}(_0x44a3,0x1a9));var _0x344a=function(_0x51666b,_0x48e537){_0x51666b=_0x51666b-0x0;var _0x1858fa=_0x44a3[_0x51666b];return _0x1858fa;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/fields',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),controller['create']);router[_0x344a('0x10')]('/:id/configurations',auth[_0x344a('0xb')](),controller[_0x344a('0x11')]);router['put']('/:id',auth[_0x344a('0xb')](),controller[_0x344a('0x12')]);router[_0x344a('0x13')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7be51b0..c3348c1 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 _0x3423=['username','remoteUri','STRING'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_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 _0x7096=['exports','STRING','username','remoteUri'];(function(_0x2225ff,_0x404f26){var _0x11dc70=function(_0x5c761a){while(--_0x5c761a){_0x2225ff['push'](_0x2225ff['shift']());}};_0x11dc70(++_0x404f26);}(_0x7096,0x10c));var _0x6709=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7096[_0x6131cd];return _0x47e916;};'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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 395eb6e..32969de 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 _0xc8e6=['then','end','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FreshsalesAccount','includeAll','include','findAll','catch','show','params','options','find','create','body','findOne','FreshsalesConfiguration','fields','getConfigurations','Subjects','getSubjects','channel','FreshsalesField','Descriptions','getFields','apiKey','username','remoteUri','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc8e6,0xa6));var _0x6c8e=function(_0x1745b1,_0x2e6a46){_0x1745b1=_0x1745b1-0x0;var _0x25bf24=_0xc8e6[_0x1745b1];return _0x25bf24;};'use strict';var emlformat=require(_0x6c8e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c8e('0x1'));var rp=require(_0x6c8e('0x2'));var moment=require('moment');var BPromise=require(_0x6c8e('0x3'));var Mustache=require(_0x6c8e('0x4'));var util=require('util');var path=require(_0x6c8e('0x5'));var sox=require(_0x6c8e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c8e('0x7'));var _=require('lodash');var squel=require(_0x6c8e('0x8'));var crypto=require(_0x6c8e('0x9'));var jsforce=require(_0x6c8e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6c8e('0xb'));var querystring=require(_0x6c8e('0xc'));var Papa=require(_0x6c8e('0xd'));var Redis=require(_0x6c8e('0xe'));var authService=require(_0x6c8e('0xf'));var qs=require(_0x6c8e('0x10'));var as=require(_0x6c8e('0x11'));var hardwareService=require(_0x6c8e('0x12'));var logger=require(_0x6c8e('0x13'))(_0x6c8e('0x14'));var utils=require(_0x6c8e('0x15'));var config=require(_0x6c8e('0x16'));var licenseUtil=require(_0x6c8e('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6c8e('0x18'));function respondWithStatusCode(_0x217b6a,_0x392dce){_0x392dce=_0x392dce||0xcc;return function(_0x48b989){if(_0x48b989){return _0x217b6a[_0x6c8e('0x19')](_0x392dce);}return _0x217b6a['status'](_0x392dce)['end']();};}function respondWithResult(_0x40259a,_0x143ec1){_0x143ec1=_0x143ec1||0xc8;return function(_0x30292f){if(_0x30292f){return _0x40259a[_0x6c8e('0x1a')](_0x143ec1)[_0x6c8e('0x1b')](_0x30292f);}};}function respondWithFilteredResult(_0x206781,_0x3698d5){return function(_0x591f05){if(_0x591f05){var _0x578179=typeof _0x3698d5[_0x6c8e('0x1c')]===_0x6c8e('0x1d')&&typeof _0x3698d5['limit']===_0x6c8e('0x1d');var _0x110122=_0x591f05[_0x6c8e('0x1e')];var _0x3e441b=_0x578179?0x0:_0x3698d5[_0x6c8e('0x1c')];var _0x20c854=_0x578179?_0x591f05[_0x6c8e('0x1e')]:_0x3698d5[_0x6c8e('0x1c')]+_0x3698d5[_0x6c8e('0x1f')];var _0xe085e0;if(_0x20c854>=_0x110122){_0x20c854=_0x110122;_0xe085e0=0xc8;}else{_0xe085e0=0xce;}_0x206781[_0x6c8e('0x1a')](_0xe085e0);return _0x206781['set'](_0x6c8e('0x20'),_0x3e441b+'-'+_0x20c854+'/'+_0x110122)[_0x6c8e('0x1b')](_0x591f05);}return null;};}function patchUpdates(_0x371d95){return function(_0x3f7782){try{jsonpatch[_0x6c8e('0x21')](_0x3f7782,_0x371d95,!![]);}catch(_0x19b8d6){return BPromise[_0x6c8e('0x22')](_0x19b8d6);}return _0x3f7782[_0x6c8e('0x23')]();};}function saveUpdates(_0xf91181,_0x1c89f3){return function(_0x130811){if(_0x130811){return _0x130811[_0x6c8e('0x24')](_0xf91181)['then'](function(_0x316d12){return _0x316d12;});}return null;};}function removeEntity(_0x3e23b4,_0x34fbe1){return function(_0x131b59){if(_0x131b59){return _0x131b59[_0x6c8e('0x25')]()[_0x6c8e('0x26')](function(){_0x3e23b4[_0x6c8e('0x1a')](0xcc)[_0x6c8e('0x27')]();});}};}function handleEntityNotFound(_0x3b7acf,_0x42b780){return function(_0x132719){if(!_0x132719){_0x3b7acf[_0x6c8e('0x19')](0x194);}return _0x132719;};}function handleError(_0x20ac1d,_0x49ff53){_0x49ff53=_0x49ff53||0x1f4;return function(_0x15ae8d){logger[_0x6c8e('0x28')](_0x15ae8d[_0x6c8e('0x29')]);if(_0x15ae8d[_0x6c8e('0x2a')]){delete _0x15ae8d[_0x6c8e('0x2a')];}_0x20ac1d[_0x6c8e('0x1a')](_0x49ff53)['send'](_0x15ae8d);};}exports[_0x6c8e('0x2b')]=function(_0x3c2e04,_0x18a7af){var _0x1af5b0={},_0x1c3acc={},_0x32c40d={'count':0x0,'rows':[]};var _0x1cf52d=_['map'](db['FreshsalesAccount'][_0x6c8e('0x2c')],function(_0x257bb2){return{'name':_0x257bb2['fieldName'],'type':_0x257bb2[_0x6c8e('0x2d')][_0x6c8e('0x2e')]};});_0x1c3acc[_0x6c8e('0x2f')]=_[_0x6c8e('0x30')](_0x1cf52d,'name');_0x1c3acc[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x3c2e04['query']);_0x1c3acc[_0x6c8e('0x33')]=_[_0x6c8e('0x34')](_0x1c3acc[_0x6c8e('0x2f')],_0x1c3acc[_0x6c8e('0x31')]);_0x1af5b0[_0x6c8e('0x35')]=_['intersection'](_0x1c3acc[_0x6c8e('0x2f')],qs['fields'](_0x3c2e04[_0x6c8e('0x31')]['fields']));_0x1af5b0[_0x6c8e('0x35')]=_0x1af5b0['attributes'][_0x6c8e('0x36')]?_0x1af5b0[_0x6c8e('0x35')]:_0x1c3acc[_0x6c8e('0x2f')];if(!_0x3c2e04['query']['hasOwnProperty'](_0x6c8e('0x37'))){_0x1af5b0[_0x6c8e('0x1f')]=qs['limit'](_0x3c2e04[_0x6c8e('0x31')]['limit']);_0x1af5b0[_0x6c8e('0x1c')]=qs[_0x6c8e('0x1c')](_0x3c2e04[_0x6c8e('0x31')]['offset']);}_0x1af5b0[_0x6c8e('0x38')]=qs[_0x6c8e('0x39')](_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x39')]);_0x1af5b0[_0x6c8e('0x3a')]=qs[_0x6c8e('0x33')](_[_0x6c8e('0x3b')](_0x3c2e04[_0x6c8e('0x31')],_0x1c3acc['filters']),_0x1cf52d);if(_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x3c')]){_0x1af5b0[_0x6c8e('0x3a')]=_['merge'](_0x1af5b0[_0x6c8e('0x3a')],{'$or':_[_0x6c8e('0x30')](_0x1cf52d,function(_0x9bc6bf){if(_0x9bc6bf[_0x6c8e('0x2d')]!==_0x6c8e('0x3d')){var _0x44851b={};_0x44851b[_0x9bc6bf[_0x6c8e('0x2a')]]={'$like':'%'+_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x3c')]+'%'};return _0x44851b;}})});}_0x1af5b0=_[_0x6c8e('0x3e')]({},_0x1af5b0,_0x3c2e04['options']);var _0x34c7d0={'where':_0x1af5b0[_0x6c8e('0x3a')]};return db[_0x6c8e('0x3f')][_0x6c8e('0x1e')](_0x34c7d0)[_0x6c8e('0x26')](function(_0x504c24){_0x32c40d[_0x6c8e('0x1e')]=_0x504c24;if(_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x40')]){_0x1af5b0[_0x6c8e('0x41')]=[{'all':!![]}];}return db[_0x6c8e('0x3f')][_0x6c8e('0x42')](_0x1af5b0);})['then'](function(_0x45013d){_0x32c40d['rows']=_0x45013d;return _0x32c40d;})[_0x6c8e('0x26')](respondWithFilteredResult(_0x18a7af,_0x1af5b0))[_0x6c8e('0x43')](handleError(_0x18a7af,null));};exports[_0x6c8e('0x44')]=function(_0x5dfe03,_0x1bfb1b){var _0x4c1f60={'raw':![],'where':{'id':_0x5dfe03[_0x6c8e('0x45')]['id']}},_0x1174fc={};_0x1174fc[_0x6c8e('0x2f')]=_[_0x6c8e('0x32')](db[_0x6c8e('0x3f')][_0x6c8e('0x2c')]);_0x1174fc[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x5dfe03['query']);_0x1174fc[_0x6c8e('0x33')]=_[_0x6c8e('0x34')](_0x1174fc[_0x6c8e('0x2f')],_0x1174fc[_0x6c8e('0x31')]);_0x4c1f60[_0x6c8e('0x35')]=_['intersection'](_0x1174fc[_0x6c8e('0x2f')],qs['fields'](_0x5dfe03[_0x6c8e('0x31')]['fields']));_0x4c1f60[_0x6c8e('0x35')]=_0x4c1f60[_0x6c8e('0x35')][_0x6c8e('0x36')]?_0x4c1f60[_0x6c8e('0x35')]:_0x1174fc[_0x6c8e('0x2f')];if(_0x5dfe03[_0x6c8e('0x31')][_0x6c8e('0x40')]){_0x4c1f60[_0x6c8e('0x41')]=[{'all':!![]}];}_0x4c1f60=_[_0x6c8e('0x3e')]({},_0x4c1f60,_0x5dfe03[_0x6c8e('0x46')]);return db[_0x6c8e('0x3f')][_0x6c8e('0x47')](_0x4c1f60)[_0x6c8e('0x26')](handleEntityNotFound(_0x1bfb1b,null))[_0x6c8e('0x26')](respondWithResult(_0x1bfb1b,null))[_0x6c8e('0x43')](handleError(_0x1bfb1b,null));};exports[_0x6c8e('0x48')]=function(_0xbd0eec,_0x4f79f3){return db[_0x6c8e('0x3f')]['create'](_0xbd0eec[_0x6c8e('0x49')],{})[_0x6c8e('0x26')](respondWithResult(_0x4f79f3,0xc9))['catch'](handleError(_0x4f79f3,null));};exports[_0x6c8e('0x24')]=function(_0x2c957f,_0x3b8ccd){if(_0x2c957f['body']['id']){delete _0x2c957f['body']['id'];}return db[_0x6c8e('0x3f')][_0x6c8e('0x47')]({'where':{'id':_0x2c957f[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x3b8ccd,null))[_0x6c8e('0x26')](saveUpdates(_0x2c957f[_0x6c8e('0x49')],null))['then'](respondWithResult(_0x3b8ccd,null))['catch'](handleError(_0x3b8ccd,null));};exports['destroy']=function(_0x286788,_0x322e2e){return db[_0x6c8e('0x3f')][_0x6c8e('0x47')]({'where':{'id':_0x286788[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x322e2e,null))[_0x6c8e('0x26')](removeEntity(_0x322e2e,null))['catch'](handleError(_0x322e2e,null));};exports['getConfigurations']=function(_0x3637d6,_0x2232e8,_0x287db1){var _0x4aa7f7={};var _0x6a858e={};var _0x4f768a;var _0x40bba6;return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x3637d6[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x2232e8,null))['then'](function(_0x416d02){if(_0x416d02){_0x4f768a=_0x416d02;_0x6a858e['model']=_['keys'](db[_0x6c8e('0x4b')][_0x6c8e('0x2c')]);_0x6a858e[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x3637d6[_0x6c8e('0x31')]);_0x6a858e['filters']=_['intersection'](_0x6a858e[_0x6c8e('0x2f')],_0x6a858e['query']);_0x4aa7f7[_0x6c8e('0x35')]=_[_0x6c8e('0x34')](_0x6a858e[_0x6c8e('0x2f')],qs[_0x6c8e('0x4c')](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x4c')]));_0x4aa7f7[_0x6c8e('0x35')]=_0x4aa7f7[_0x6c8e('0x35')][_0x6c8e('0x36')]?_0x4aa7f7[_0x6c8e('0x35')]:_0x6a858e[_0x6c8e('0x2f')];_0x4aa7f7[_0x6c8e('0x38')]=qs[_0x6c8e('0x39')](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x39')]);_0x4aa7f7['where']=qs['filters'](_['pick'](_0x3637d6[_0x6c8e('0x31')],_0x6a858e[_0x6c8e('0x33')]));if(_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x3c')]){_0x4aa7f7[_0x6c8e('0x3a')]=_[_0x6c8e('0x3e')](_0x4aa7f7[_0x6c8e('0x3a')],{'$or':_[_0x6c8e('0x30')](_0x4aa7f7['attributes'],function(_0x4f7719){var _0xa2eaef={};_0xa2eaef[_0x4f7719]={'$like':'%'+_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x3c')]+'%'};return _0xa2eaef;})});}_0x4aa7f7=_['merge']({},_0x4aa7f7,_0x3637d6[_0x6c8e('0x46')]);return _0x4f768a['getConfigurations'](_0x4aa7f7);}})[_0x6c8e('0x26')](function(_0x282403){if(_0x282403){_0x40bba6=_0x282403[_0x6c8e('0x36')];if(!_0x3637d6[_0x6c8e('0x31')]['hasOwnProperty']('nolimit')){_0x4aa7f7[_0x6c8e('0x1f')]=qs['limit'](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x1f')]);_0x4aa7f7[_0x6c8e('0x1c')]=qs['offset'](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x1c')]);}return _0x4f768a[_0x6c8e('0x4d')](_0x4aa7f7);}})[_0x6c8e('0x26')](function(_0x444372){if(_0x444372){return _0x444372?{'count':_0x40bba6,'rows':_0x444372}:null;}})[_0x6c8e('0x26')](respondWithResult(_0x2232e8,null))[_0x6c8e('0x43')](handleError(_0x2232e8,null));};exports['addConfiguration']=function(_0x36b042,_0x233c6d,_0x410513){if(_0x36b042[_0x6c8e('0x49')]['id']){delete _0x36b042[_0x6c8e('0x49')]['id'];}return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x36b042[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x233c6d,null))['then'](function(_0x37c55f){if(_0x37c55f){_0x36b042['body']['AccountId']=_0x37c55f['id'];_0x36b042[_0x6c8e('0x49')][_0x6c8e('0x4e')]=integrations[_0x6c8e('0x4f')](_0x36b042['body'][_0x6c8e('0x50')],_0x36b042[_0x6c8e('0x49')]['type']);_0x36b042[_0x6c8e('0x49')]['Descriptions']=integrations['getDescriptions'](_0x36b042['body'][_0x6c8e('0x50')],_0x36b042['body']['type']);return db[_0x6c8e('0x4b')][_0x6c8e('0x48')](_0x36b042[_0x6c8e('0x49')],{'include':[{'model':db[_0x6c8e('0x51')],'as':'Subjects'},{'model':db[_0x6c8e('0x51')],'as':_0x6c8e('0x52')}]});}return null;})[_0x6c8e('0x26')](respondWithResult(_0x233c6d,null))['catch'](handleError(_0x233c6d,null));};exports[_0x6c8e('0x53')]=function(_0x34955e,_0x3d0f19,_0x2d1ef2){var _0x2cad0e='';var _0x3c6e79='';return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x34955e[_0x6c8e('0x45')]['id']},'attributes':['id','username','remoteUri',_0x6c8e('0x54')]})[_0x6c8e('0x26')](handleEntityNotFound(_0x3d0f19,null))[_0x6c8e('0x26')](function(_0xfe93c4){if(_0xfe93c4){_0x3c6e79=_0xfe93c4[_0x6c8e('0x55')];_0x2cad0e=_0xfe93c4[_0x6c8e('0x56')];var _0x20c75d=_0xfe93c4[_0x6c8e('0x56')][_0x6c8e('0x57')](-0x1);if(_0x20c75d==='/'){_0x2cad0e=_0x2cad0e[_0x6c8e('0x58')](0x0,_0x2cad0e['lastIndexOf'](_0x20c75d));}return rp({'method':_0x6c8e('0x59'),'uri':util['format'](_0x6c8e('0x5a'),_0x2cad0e,_0x6c8e('0x5b')),'headers':{'Authorization':_0x6c8e('0x5c')+_0xfe93c4[_0x6c8e('0x54')]},'json':!![]});}})[_0x6c8e('0x26')](function(_0x4bcb8a){if(_0x4bcb8a){var _0x59ae46=_0x4bcb8a[_0x6c8e('0x5d')];var _0x396edd=![];var _0x20a98a=null;for(_0x20a98a=0x0;_0x20a98a<_0x59ae46[_0x6c8e('0x36')];_0x20a98a++){if(_0x59ae46[_0x20a98a][_0x6c8e('0x5e')]===_0x3c6e79){_0x396edd=!![];}}if(_0x396edd){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6c8e('0x5f')});}}})['then'](respondWithResult(_0x3d0f19,null))[_0x6c8e('0x43')](function(_0x2c4f28){var _0x1c22f4=_0x34955e[_0x6c8e('0x31')][_0x6c8e('0x60')]?0x1f4:_0x2c4f28['statusCode']||0x1f4;logger['error'](_0x6c8e('0x61'),_0x6c8e('0x53'),_0x1c22f4,JSON[_0x6c8e('0x62')](_0x2c4f28));delete _0x2c4f28[_0x6c8e('0x2a')];if(_0x1c22f4===0x191){_0x1c22f4=0x190;}_0x3d0f19[_0x6c8e('0x1a')](_0x1c22f4)[_0x6c8e('0x63')](_0x34955e[_0x6c8e('0x31')][_0x6c8e('0x60')]?{'message':_0x6c8e('0x64'),'statusCode':_0x2c4f28[_0x6c8e('0x65')]}:_0x2c4f28);});}; \ No newline at end of file +var _0x4d20=['users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','where','pick','merge','VIRTUAL','filter','includeAll','findAll','catch','params','length','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','order','sort','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token='];(function(_0x2666de,_0x41ce04){var _0x55704f=function(_0x14c0d9){while(--_0x14c0d9){_0x2666de['push'](_0x2666de['shift']());}};_0x55704f(++_0x41ce04);}(_0x4d20,0x12e));var _0x04d2=function(_0x5b173f,_0x3c71f9){_0x5b173f=_0x5b173f-0x0;var _0x1f22e6=_0x4d20[_0x5b173f];return _0x1f22e6;};'use strict';var emlformat=require(_0x04d2('0x0'));var rimraf=require(_0x04d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04d2('0x2'));var rp=require(_0x04d2('0x3'));var moment=require(_0x04d2('0x4'));var BPromise=require(_0x04d2('0x5'));var Mustache=require(_0x04d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x04d2('0x7'));var ejs=require(_0x04d2('0x8'));var fs=require('fs');var fs_extra=require(_0x04d2('0x9'));var _=require(_0x04d2('0xa'));var squel=require(_0x04d2('0xb'));var crypto=require('crypto');var jsforce=require(_0x04d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x04d2('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04d2('0xd'));var qs=require(_0x04d2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04d2('0xf'));var logger=require(_0x04d2('0x10'))(_0x04d2('0x11'));var utils=require(_0x04d2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x04d2('0x13'));var db=require(_0x04d2('0x14'))['db'];var integrations=require(_0x04d2('0x15'));function respondWithStatusCode(_0x2d2de1,_0x478488){_0x478488=_0x478488||0xcc;return function(_0xb719da){if(_0xb719da){return _0x2d2de1[_0x04d2('0x16')](_0x478488);}return _0x2d2de1['status'](_0x478488)[_0x04d2('0x17')]();};}function respondWithResult(_0xdedb54,_0x517016){_0x517016=_0x517016||0xc8;return function(_0x5051fa){if(_0x5051fa){return _0xdedb54[_0x04d2('0x18')](_0x517016)[_0x04d2('0x19')](_0x5051fa);}};}function respondWithFilteredResult(_0x62b8d4,_0x5de499){return function(_0x380a51){if(_0x380a51){var _0x34bce7=typeof _0x5de499[_0x04d2('0x1a')]===_0x04d2('0x1b')&&typeof _0x5de499[_0x04d2('0x1c')]==='undefined';var _0x39162e=_0x380a51[_0x04d2('0x1d')];var _0x5b09f6=_0x34bce7?0x0:_0x5de499[_0x04d2('0x1a')];var _0x74f2f0=_0x34bce7?_0x380a51[_0x04d2('0x1d')]:_0x5de499['offset']+_0x5de499[_0x04d2('0x1c')];var _0x170368;if(_0x74f2f0>=_0x39162e){_0x74f2f0=_0x39162e;_0x170368=0xc8;}else{_0x170368=0xce;}_0x62b8d4['status'](_0x170368);return _0x62b8d4[_0x04d2('0x1e')](_0x04d2('0x1f'),_0x5b09f6+'-'+_0x74f2f0+'/'+_0x39162e)[_0x04d2('0x19')](_0x380a51);}return null;};}function patchUpdates(_0x2117ca){return function(_0x1598b0){try{jsonpatch[_0x04d2('0x20')](_0x1598b0,_0x2117ca,!![]);}catch(_0x1ef542){return BPromise['reject'](_0x1ef542);}return _0x1598b0[_0x04d2('0x21')]();};}function saveUpdates(_0x36f0cb,_0x3623d0){return function(_0x5f1f27){if(_0x5f1f27){return _0x5f1f27[_0x04d2('0x22')](_0x36f0cb)[_0x04d2('0x23')](function(_0x4607ef){return _0x4607ef;});}return null;};}function removeEntity(_0x5ea5d6,_0x3538b9){return function(_0x1cadb2){if(_0x1cadb2){return _0x1cadb2['destroy']()[_0x04d2('0x23')](function(){_0x5ea5d6['status'](0xcc)[_0x04d2('0x17')]();});}};}function handleEntityNotFound(_0x57a224,_0x4952f3){return function(_0x5dc710){if(!_0x5dc710){_0x57a224[_0x04d2('0x16')](0x194);}return _0x5dc710;};}function handleError(_0xbede1b,_0x15b998){_0x15b998=_0x15b998||0x1f4;return function(_0x27f52d){logger['error'](_0x27f52d[_0x04d2('0x24')]);if(_0x27f52d[_0x04d2('0x25')]){delete _0x27f52d[_0x04d2('0x25')];}_0xbede1b[_0x04d2('0x18')](_0x15b998)[_0x04d2('0x26')](_0x27f52d);};}exports[_0x04d2('0x27')]=function(_0x5383f4,_0x13f0c6){var _0x50e6be={},_0x3a4a19={},_0x3a86d6={'count':0x0,'rows':[]};var _0x2df408=_['map'](db[_0x04d2('0x28')][_0x04d2('0x29')],function(_0x1446e5){return{'name':_0x1446e5[_0x04d2('0x2a')],'type':_0x1446e5[_0x04d2('0x2b')][_0x04d2('0x2c')]};});_0x3a4a19[_0x04d2('0x2d')]=_[_0x04d2('0x2e')](_0x2df408,_0x04d2('0x25'));_0x3a4a19[_0x04d2('0x2f')]=_[_0x04d2('0x30')](_0x5383f4[_0x04d2('0x2f')]);_0x3a4a19[_0x04d2('0x31')]=_[_0x04d2('0x32')](_0x3a4a19[_0x04d2('0x2d')],_0x3a4a19[_0x04d2('0x2f')]);_0x50e6be[_0x04d2('0x33')]=_[_0x04d2('0x32')](_0x3a4a19[_0x04d2('0x2d')],qs['fields'](_0x5383f4[_0x04d2('0x2f')][_0x04d2('0x34')]));_0x50e6be[_0x04d2('0x33')]=_0x50e6be[_0x04d2('0x33')]['length']?_0x50e6be[_0x04d2('0x33')]:_0x3a4a19[_0x04d2('0x2d')];if(!_0x5383f4[_0x04d2('0x2f')][_0x04d2('0x35')]('nolimit')){_0x50e6be[_0x04d2('0x1c')]=qs[_0x04d2('0x1c')](_0x5383f4['query'][_0x04d2('0x1c')]);_0x50e6be[_0x04d2('0x1a')]=qs[_0x04d2('0x1a')](_0x5383f4['query']['offset']);}_0x50e6be['order']=qs['sort'](_0x5383f4[_0x04d2('0x2f')]['sort']);_0x50e6be[_0x04d2('0x36')]=qs[_0x04d2('0x31')](_[_0x04d2('0x37')](_0x5383f4[_0x04d2('0x2f')],_0x3a4a19['filters']),_0x2df408);if(_0x5383f4['query']['filter']){_0x50e6be[_0x04d2('0x36')]=_[_0x04d2('0x38')](_0x50e6be[_0x04d2('0x36')],{'$or':_[_0x04d2('0x2e')](_0x2df408,function(_0x64134f){if(_0x64134f[_0x04d2('0x2b')]!==_0x04d2('0x39')){var _0x19a33e={};_0x19a33e[_0x64134f[_0x04d2('0x25')]]={'$like':'%'+_0x5383f4[_0x04d2('0x2f')][_0x04d2('0x3a')]+'%'};return _0x19a33e;}})});}_0x50e6be=_[_0x04d2('0x38')]({},_0x50e6be,_0x5383f4['options']);var _0xd2ec93={'where':_0x50e6be[_0x04d2('0x36')]};return db[_0x04d2('0x28')][_0x04d2('0x1d')](_0xd2ec93)[_0x04d2('0x23')](function(_0x5006d3){_0x3a86d6['count']=_0x5006d3;if(_0x5383f4[_0x04d2('0x2f')][_0x04d2('0x3b')]){_0x50e6be['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x04d2('0x3c')](_0x50e6be);})[_0x04d2('0x23')](function(_0xf8cd55){_0x3a86d6['rows']=_0xf8cd55;return _0x3a86d6;})[_0x04d2('0x23')](respondWithFilteredResult(_0x13f0c6,_0x50e6be))[_0x04d2('0x3d')](handleError(_0x13f0c6,null));};exports['show']=function(_0x165a4f,_0x5e9146){var _0x42dc87={'raw':![],'where':{'id':_0x165a4f[_0x04d2('0x3e')]['id']}},_0xd7b3ef={};_0xd7b3ef[_0x04d2('0x2d')]=_[_0x04d2('0x30')](db['FreshsalesAccount'][_0x04d2('0x29')]);_0xd7b3ef['query']=_['keys'](_0x165a4f[_0x04d2('0x2f')]);_0xd7b3ef['filters']=_['intersection'](_0xd7b3ef[_0x04d2('0x2d')],_0xd7b3ef[_0x04d2('0x2f')]);_0x42dc87['attributes']=_[_0x04d2('0x32')](_0xd7b3ef['model'],qs[_0x04d2('0x34')](_0x165a4f['query']['fields']));_0x42dc87['attributes']=_0x42dc87[_0x04d2('0x33')][_0x04d2('0x3f')]?_0x42dc87[_0x04d2('0x33')]:_0xd7b3ef[_0x04d2('0x2d')];if(_0x165a4f[_0x04d2('0x2f')][_0x04d2('0x3b')]){_0x42dc87['include']=[{'all':!![]}];}_0x42dc87=_[_0x04d2('0x38')]({},_0x42dc87,_0x165a4f['options']);return db[_0x04d2('0x28')]['find'](_0x42dc87)['then'](handleEntityNotFound(_0x5e9146,null))[_0x04d2('0x23')](respondWithResult(_0x5e9146,null))[_0x04d2('0x3d')](handleError(_0x5e9146,null));};exports[_0x04d2('0x40')]=function(_0x501aaf,_0x672f5a){return db[_0x04d2('0x28')][_0x04d2('0x40')](_0x501aaf[_0x04d2('0x41')],{})[_0x04d2('0x23')](respondWithResult(_0x672f5a,0xc9))[_0x04d2('0x3d')](handleError(_0x672f5a,null));};exports['update']=function(_0x4db9b3,_0x4f57e7){if(_0x4db9b3['body']['id']){delete _0x4db9b3[_0x04d2('0x41')]['id'];}return db['FreshsalesAccount'][_0x04d2('0x42')]({'where':{'id':_0x4db9b3[_0x04d2('0x3e')]['id']}})[_0x04d2('0x23')](handleEntityNotFound(_0x4f57e7,null))[_0x04d2('0x23')](saveUpdates(_0x4db9b3[_0x04d2('0x41')],null))[_0x04d2('0x23')](respondWithResult(_0x4f57e7,null))[_0x04d2('0x3d')](handleError(_0x4f57e7,null));};exports['destroy']=function(_0x4a305d,_0x46943e){return db[_0x04d2('0x28')][_0x04d2('0x42')]({'where':{'id':_0x4a305d[_0x04d2('0x3e')]['id']}})[_0x04d2('0x23')](handleEntityNotFound(_0x46943e,null))['then'](removeEntity(_0x46943e,null))[_0x04d2('0x3d')](handleError(_0x46943e,null));};exports[_0x04d2('0x43')]=function(_0x9f8b30,_0x1c5e08,_0x19ff19){var _0x435533={};var _0x79e6f8={};var _0x6105bd;var _0x2ad329;return db['FreshsalesAccount'][_0x04d2('0x44')]({'where':{'id':_0x9f8b30[_0x04d2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c5e08,null))[_0x04d2('0x23')](function(_0x471299){if(_0x471299){_0x6105bd=_0x471299;_0x79e6f8[_0x04d2('0x2d')]=_['keys'](db[_0x04d2('0x45')][_0x04d2('0x29')]);_0x79e6f8[_0x04d2('0x2f')]=_[_0x04d2('0x30')](_0x9f8b30['query']);_0x79e6f8['filters']=_[_0x04d2('0x32')](_0x79e6f8[_0x04d2('0x2d')],_0x79e6f8[_0x04d2('0x2f')]);_0x435533[_0x04d2('0x33')]=_[_0x04d2('0x32')](_0x79e6f8['model'],qs['fields'](_0x9f8b30[_0x04d2('0x2f')][_0x04d2('0x34')]));_0x435533[_0x04d2('0x33')]=_0x435533[_0x04d2('0x33')]['length']?_0x435533['attributes']:_0x79e6f8[_0x04d2('0x2d')];_0x435533[_0x04d2('0x46')]=qs[_0x04d2('0x47')](_0x9f8b30[_0x04d2('0x2f')][_0x04d2('0x47')]);_0x435533['where']=qs[_0x04d2('0x31')](_[_0x04d2('0x37')](_0x9f8b30[_0x04d2('0x2f')],_0x79e6f8['filters']));if(_0x9f8b30[_0x04d2('0x2f')][_0x04d2('0x3a')]){_0x435533[_0x04d2('0x36')]=_[_0x04d2('0x38')](_0x435533[_0x04d2('0x36')],{'$or':_[_0x04d2('0x2e')](_0x435533[_0x04d2('0x33')],function(_0x47ca91){var _0x610eca={};_0x610eca[_0x47ca91]={'$like':'%'+_0x9f8b30[_0x04d2('0x2f')]['filter']+'%'};return _0x610eca;})});}_0x435533=_[_0x04d2('0x38')]({},_0x435533,_0x9f8b30[_0x04d2('0x48')]);return _0x6105bd[_0x04d2('0x43')](_0x435533);}})[_0x04d2('0x23')](function(_0x13a010){if(_0x13a010){_0x2ad329=_0x13a010[_0x04d2('0x3f')];if(!_0x9f8b30['query']['hasOwnProperty']('nolimit')){_0x435533[_0x04d2('0x1c')]=qs['limit'](_0x9f8b30[_0x04d2('0x2f')][_0x04d2('0x1c')]);_0x435533[_0x04d2('0x1a')]=qs['offset'](_0x9f8b30[_0x04d2('0x2f')][_0x04d2('0x1a')]);}return _0x6105bd[_0x04d2('0x43')](_0x435533);}})[_0x04d2('0x23')](function(_0x312aef){if(_0x312aef){return _0x312aef?{'count':_0x2ad329,'rows':_0x312aef}:null;}})[_0x04d2('0x23')](respondWithResult(_0x1c5e08,null))['catch'](handleError(_0x1c5e08,null));};exports[_0x04d2('0x49')]=function(_0x238424,_0x1560c4,_0x36ac0d){if(_0x238424[_0x04d2('0x41')]['id']){delete _0x238424[_0x04d2('0x41')]['id'];}return db[_0x04d2('0x28')][_0x04d2('0x44')]({'where':{'id':_0x238424['params']['id']}})[_0x04d2('0x23')](handleEntityNotFound(_0x1560c4,null))['then'](function(_0x1e3a4a){if(_0x1e3a4a){_0x238424[_0x04d2('0x41')][_0x04d2('0x4a')]=_0x1e3a4a['id'];_0x238424[_0x04d2('0x41')][_0x04d2('0x4b')]=integrations[_0x04d2('0x4c')](_0x238424[_0x04d2('0x41')][_0x04d2('0x4d')],_0x238424['body'][_0x04d2('0x2b')]);_0x238424['body'][_0x04d2('0x4e')]=integrations[_0x04d2('0x4f')](_0x238424[_0x04d2('0x41')][_0x04d2('0x4d')],_0x238424[_0x04d2('0x41')][_0x04d2('0x2b')]);return db[_0x04d2('0x45')]['create'](_0x238424[_0x04d2('0x41')],{'include':[{'model':db['FreshsalesField'],'as':_0x04d2('0x4b')},{'model':db[_0x04d2('0x50')],'as':_0x04d2('0x4e')}]});}return null;})[_0x04d2('0x23')](respondWithResult(_0x1560c4,null))[_0x04d2('0x3d')](handleError(_0x1560c4,null));};exports[_0x04d2('0x51')]=function(_0x4925ad,_0x3f4f3c,_0x1542a1){var _0x311756='';var _0x35e344='';return db[_0x04d2('0x28')][_0x04d2('0x44')]({'where':{'id':_0x4925ad['params']['id']},'attributes':['id',_0x04d2('0x52'),'remoteUri','apiKey']})[_0x04d2('0x23')](handleEntityNotFound(_0x3f4f3c,null))[_0x04d2('0x23')](function(_0x3262ee){if(_0x3262ee){_0x35e344=_0x3262ee[_0x04d2('0x52')];_0x311756=_0x3262ee[_0x04d2('0x53')];var _0xdf5816=_0x3262ee[_0x04d2('0x53')]['slice'](-0x1);if(_0xdf5816==='/'){_0x311756=_0x311756['substring'](0x0,_0x311756[_0x04d2('0x54')](_0xdf5816));}return rp({'method':_0x04d2('0x55'),'uri':util[_0x04d2('0x56')](_0x04d2('0x57'),_0x311756,_0x04d2('0x58')),'headers':{'Authorization':_0x04d2('0x59')+_0x3262ee['apiKey']},'json':!![]});}})[_0x04d2('0x23')](function(_0x5e6bd0){if(_0x5e6bd0){var _0x1a090d=_0x5e6bd0[_0x04d2('0x5a')];var _0x3a7b15=![];var _0x2eafac=null;for(_0x2eafac=0x0;_0x2eafac<_0x1a090d[_0x04d2('0x3f')];_0x2eafac++){if(_0x1a090d[_0x2eafac][_0x04d2('0x5b')]===_0x35e344){_0x3a7b15=!![];}}if(_0x3a7b15){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x04d2('0x5c')});}}})[_0x04d2('0x23')](respondWithResult(_0x3f4f3c,null))[_0x04d2('0x3d')](function(_0x18c24e){var _0x549b6f=_0x4925ad['query'][_0x04d2('0x5d')]?0x1f4:_0x18c24e[_0x04d2('0x5e')]||0x1f4;logger[_0x04d2('0x5f')](_0x04d2('0x60'),_0x04d2('0x51'),_0x549b6f,JSON[_0x04d2('0x61')](_0x18c24e));delete _0x18c24e[_0x04d2('0x25')];if(_0x549b6f===0x191){_0x549b6f=0x190;}_0x3f4f3c[_0x04d2('0x18')](_0x549b6f)[_0x04d2('0x26')](_0x4925ad[_0x04d2('0x2f')][_0x04d2('0x5d')]?{'message':'Wrong\x20credentials','statusCode':_0x18c24e['statusCode']}:_0x18c24e);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 962d616..ab90d61 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 _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2be50b,_0x466654){var _0x2884d5=function(_0xf7ebc0){while(--_0xf7ebc0){_0x2be50b['push'](_0x2be50b['shift']());}};_0x2884d5(++_0x466654);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x43b64b,_0xb9080f){_0x43b64b=_0x43b64b-0x0;var _0x48f864=_0xa6b0[_0x43b64b];return _0x48f864;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfcf0,0x138));var _0x0fcf=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xfcf0[_0x29db36];return _0x234e87;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));var integrations=require(_0x0fcf('0x9'));module[_0x0fcf('0xa')]=function(_0x1a7b03,_0x61bbb9){return _0x1a7b03[_0x0fcf('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x0fcf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index bc5224f..9f4feaf 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 _0x5c3c=['find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowFreshsalesAccount'];(function(_0xb179b5,_0x3601bf){var _0x4088a7=function(_0x41a21f){while(--_0x41a21f){_0xb179b5['push'](_0xb179b5['shift']());}};_0x4088a7(++_0x3601bf);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x5c3c[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')]({'raw':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['attributes']||null:null,'limit':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1c')]||null:null,'include':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x2ff158['options']['include'],function(_0x45affe){return{'model':db[_0x45affe[_0xc5c3('0x1f')]],'as':_0x45affe['as'],'attributes':_0x45affe['attributes'],'include':_0x45affe['include']?_[_0xc5c3('0x1e')](_0x45affe[_0xc5c3('0x1d')],function(_0x38a3df){return{'model':db[_0x38a3df['model']],'as':_0x38a3df['as'],'attributes':_0x38a3df['attributes'],'include':_0x38a3df[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x38a3df[_0xc5c3('0x1d')],function(_0x29791c){return{'model':db[_0x29791c['model']],'as':_0x29791c['as'],'attributes':_0x29791c[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eacec){logger['info'](_0xc5c3('0x17'),_0x2ff158);logger[_0xc5c3('0x21')](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x2eacec));_0x28bae6(_0x2eacec);})[_0xc5c3('0x22')](function(_0x2d07e1){logger[_0xc5c3('0x12')]('GetFreshsalesAccount',_0x2d07e1[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2d07e1[_0xc5c3('0x14')]));});});};exports[_0xc5c3('0x23')]=function(_0x5b26e9){var _0x4daa8b=this;return new Promise(function(_0x2e648f,_0x46f149){return db[_0xc5c3('0x18')][_0xc5c3('0x24')]({'raw':_0x5b26e9['options']?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x25')]===undefined?!![]:![]:!![],'where':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x20')]||null:null,'include':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9['options'][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1d')],function(_0x330391){return{'model':db[_0x330391[_0xc5c3('0x1f')]],'as':_0x330391['as'],'attributes':_0x330391[_0xc5c3('0x20')],'include':_0x330391['include']?_['map'](_0x330391[_0xc5c3('0x1d')],function(_0x55fccf){return{'model':db[_0x55fccf[_0xc5c3('0x1f')]],'as':_0x55fccf['as'],'attributes':_0x55fccf[_0xc5c3('0x20')],'include':_0x55fccf[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x55fccf[_0xc5c3('0x1d')],function(_0x498677){return{'model':db[_0x498677[_0xc5c3('0x1f')]],'as':_0x498677['as'],'attributes':_0x498677[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f57d){logger[_0xc5c3('0x15')](_0xc5c3('0x23'),_0x5b26e9);logger[_0xc5c3('0x21')](_0xc5c3('0x23'),_0x5b26e9,JSON[_0xc5c3('0x11')](_0x29f57d));_0x2e648f(_0x29f57d);})[_0xc5c3('0x22')](function(_0x2ad440){logger[_0xc5c3('0x12')](_0xc5c3('0x23'),_0x2ad440['message'],_0x5b26e9);_0x46f149(_0x4daa8b[_0xc5c3('0x12')](0x1f4,_0x2ad440['message']));});});}; \ No newline at end of file +var _0x6d11=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FreshsalesAccount','findAll','options','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s'];(function(_0xe36749,_0x2a45c8){var _0x5d86b7=function(_0x1219e5){while(--_0x1219e5){_0xe36749['push'](_0xe36749['shift']());}};_0x5d86b7(++_0x2a45c8);}(_0x6d11,0xbf));var _0x16d1=function(_0x4a882e,_0xcfdddc){_0x4a882e=_0x4a882e-0x0;var _0x33828e=_0x6d11[_0x4a882e];return _0x33828e;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['GetFreshsalesAccount']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')]({'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'where':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')]['where']||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'limit':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x19')]||null:null,'include':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')]['include']?_[_0x16d1('0x1a')](_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x47cad4){return{'model':db[_0x47cad4[_0x16d1('0x1c')]],'as':_0x47cad4['as'],'attributes':_0x47cad4[_0x16d1('0x18')],'include':_0x47cad4[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x47cad4[_0x16d1('0x1b')],function(_0x335c24){return{'model':db[_0x335c24[_0x16d1('0x1c')]],'as':_0x335c24['as'],'attributes':_0x335c24[_0x16d1('0x18')],'include':_0x335c24[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x335c24[_0x16d1('0x1b')],function(_0x2b8403){return{'model':db[_0x2b8403['model']],'as':_0x2b8403['as'],'attributes':_0x2b8403[_0x16d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16d1('0xa')](function(_0x4257f1){logger['info'](_0x16d1('0x1d'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1d'),_0x46a25e,JSON[_0x16d1('0x10')](_0x4257f1));_0x1da1b8(_0x4257f1);})[_0x16d1('0x14')](function(_0x462e5b){logger[_0x16d1('0x11')]('GetFreshsalesAccount',_0x462e5b[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x462e5b[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1e')]=function(_0x55c021){var _0x4b27f6=this;return new Promise(function(_0x2f16ee,_0x4ab3d4){return db[_0x16d1('0x15')][_0x16d1('0x1f')]({'raw':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x20')]===undefined?!![]:![]:!![],'where':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x21')]||null:null,'attributes':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'include':_0x55c021[_0x16d1('0x17')]?_0x55c021['options'][_0x16d1('0x1b')]?_['map'](_0x55c021[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x2b9126){return{'model':db[_0x2b9126[_0x16d1('0x1c')]],'as':_0x2b9126['as'],'attributes':_0x2b9126[_0x16d1('0x18')],'include':_0x2b9126[_0x16d1('0x1b')]?_['map'](_0x2b9126['include'],function(_0x58d72d){return{'model':db[_0x58d72d[_0x16d1('0x1c')]],'as':_0x58d72d['as'],'attributes':_0x58d72d[_0x16d1('0x18')],'include':_0x58d72d[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x58d72d['include'],function(_0x885454){return{'model':db[_0x885454[_0x16d1('0x1c')]],'as':_0x885454['as'],'attributes':_0x885454['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508ed7){logger[_0x16d1('0xb')](_0x16d1('0x1e'),_0x55c021);logger[_0x16d1('0xd')]('ShowFreshsalesAccount',_0x55c021,JSON[_0x16d1('0x10')](_0x508ed7));_0x2f16ee(_0x508ed7);})[_0x16d1('0x14')](function(_0x2928ad){logger[_0x16d1('0x11')](_0x16d1('0x1e'),_0x2928ad[_0x16d1('0x13')],_0x55c021);_0x4ab3d4(_0x4b27f6[_0x16d1('0x11')](0x1f4,_0x2928ad['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index fe169f0..5c9735d 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 _0x05af=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','exports'];(function(_0x1ad2d5,_0x26ce2f){var _0x35153c=function(_0x369264){while(--_0x369264){_0x1ad2d5['push'](_0x1ad2d5['shift']());}};_0x35153c(++_0x26ce2f);}(_0x05af,0x1a2));var _0xf05a=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x05af[_0x4bb2b9];return _0x40e2a2;};'use strict';var multer=require('multer');var util=require(_0xf05a('0x0'));var path=require(_0xf05a('0x1'));var timeout=require(_0xf05a('0x2'));var express=require(_0xf05a('0x3'));var router=express[_0xf05a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf05a('0x5'));var interaction=require(_0xf05a('0x6'));var config=require('../../config/environment');var controller=require(_0xf05a('0x7'));router[_0xf05a('0x8')]('/',auth[_0xf05a('0x9')](),controller[_0xf05a('0xa')]);router[_0xf05a('0x8')](_0xf05a('0xb'),auth[_0xf05a('0x9')](),controller['show']);router[_0xf05a('0x8')](_0xf05a('0xc'),auth[_0xf05a('0x9')](),controller['getSubjects']);router['get'](_0xf05a('0xd'),auth[_0xf05a('0x9')](),controller[_0xf05a('0xe')]);router['get'](_0xf05a('0xf'),auth[_0xf05a('0x9')](),controller[_0xf05a('0x10')]);router[_0xf05a('0x11')]('/',auth[_0xf05a('0x9')](),controller[_0xf05a('0x12')]);router[_0xf05a('0x13')]('/:id',auth[_0xf05a('0x9')](),controller[_0xf05a('0x14')]);router['delete'](_0xf05a('0xb'),auth[_0xf05a('0x9')](),controller['destroy']);module[_0xf05a('0x15')]=router; \ No newline at end of file +var _0x32c6=['/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','getSubjects'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32c6,0x14c));var _0x632c=function(_0x421c96,_0x324a2b){_0x421c96=_0x421c96-0x0;var _0xbf32d6=_0x32c6[_0x421c96];return _0xbf32d6;};'use strict';var multer=require('multer');var util=require(_0x632c('0x0'));var path=require('path');var timeout=require(_0x632c('0x1'));var express=require('express');var router=express[_0x632c('0x2')]();var fs_extra=require(_0x632c('0x3'));var auth=require(_0x632c('0x4'));var interaction=require(_0x632c('0x5'));var config=require(_0x632c('0x6'));var controller=require(_0x632c('0x7'));router[_0x632c('0x8')]('/',auth[_0x632c('0x9')](),controller['index']);router[_0x632c('0x8')](_0x632c('0xa'),auth[_0x632c('0x9')](),controller[_0x632c('0xb')]);router[_0x632c('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x632c('0xc')]);router[_0x632c('0x8')](_0x632c('0xd'),auth[_0x632c('0x9')](),controller[_0x632c('0xe')]);router[_0x632c('0x8')](_0x632c('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x632c('0x10')]('/',auth['isAuthenticated'](),controller[_0x632c('0x11')]);router[_0x632c('0x12')]('/:id',auth[_0x632c('0x9')](),controller[_0x632c('0x13')]);router[_0x632c('0x14')](_0x632c('0xa'),auth[_0x632c('0x9')](),controller[_0x632c('0x15')]);module[_0x632c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 641c6fe..9d484f6 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 _0x8d14=['exports','STRING','sequelize'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x8d14,0x17c));var _0x48d1=function(_0x36d4b4,_0x26a350){_0x36d4b4=_0x36d4b4-0x0;var _0x32f134=_0x8d14[_0x36d4b4];return _0x32f134;};'use strict';var Sequelize=require(_0x48d1('0x0'));module[_0x48d1('0x1')]={'name':{'type':Sequelize[_0x48d1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a75=['exports','STRING','sequelize'];(function(_0x19ba62,_0x499de0){var _0x54fc2a=function(_0x26f084){while(--_0x26f084){_0x19ba62['push'](_0x19ba62['shift']());}};_0x54fc2a(++_0x499de0);}(_0x5a75,0xf8));var _0x55a7=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x5a75[_0x43c8b8];return _0x413be3;};'use strict';var Sequelize=require(_0x55a7('0x0'));module[_0x55a7('0x1')]={'name':{'type':Sequelize[_0x55a7('0x2')]},'description':{'type':Sequelize[_0x55a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5c2c2ec..0bdf2d2 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 _0xbee2=['keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getSubjects','findOne','FreshsalesField','rawAttributes','length','getDescriptions','getFields','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','fieldName','type','model','query'];(function(_0x5d7b92,_0x5b040c){var _0x4d6d29=function(_0x1fae07){while(--_0x1fae07){_0x5d7b92['push'](_0x5d7b92['shift']());}};_0x4d6d29(++_0x5b040c);}(_0xbee2,0x1ef));var _0x2bee=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0xbee2[_0x42e4d7];return _0x346cd8;};'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(_0x2bee('0x0'));var moment=require(_0x2bee('0x1'));var BPromise=require(_0x2bee('0x2'));var Mustache=require(_0x2bee('0x3'));var util=require(_0x2bee('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2bee('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bee('0x6'));var squel=require(_0x2bee('0x7'));var crypto=require(_0x2bee('0x8'));var jsforce=require(_0x2bee('0x9'));var deskjs=require(_0x2bee('0xa'));var toCsv=require(_0x2bee('0x5'));var querystring=require(_0x2bee('0xb'));var Papa=require(_0x2bee('0xc'));var Redis=require(_0x2bee('0xd'));var authService=require(_0x2bee('0xe'));var qs=require(_0x2bee('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bee('0x10'));var logger=require(_0x2bee('0x11'))('api');var utils=require(_0x2bee('0x12'));var config=require(_0x2bee('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2bee('0x14'))['db'];function respondWithStatusCode(_0x1cfbb8,_0xad3435){_0xad3435=_0xad3435||0xcc;return function(_0x4e0a47){if(_0x4e0a47){return _0x1cfbb8[_0x2bee('0x15')](_0xad3435);}return _0x1cfbb8['status'](_0xad3435)[_0x2bee('0x16')]();};}function respondWithResult(_0x12584e,_0x1922b0){_0x1922b0=_0x1922b0||0xc8;return function(_0x57ed43){if(_0x57ed43){return _0x12584e[_0x2bee('0x17')](_0x1922b0)[_0x2bee('0x18')](_0x57ed43);}};}function respondWithFilteredResult(_0x4db27d,_0x371ac6){return function(_0xca7b0a){if(_0xca7b0a){var _0x259151=typeof _0x371ac6[_0x2bee('0x19')]===_0x2bee('0x1a')&&typeof _0x371ac6[_0x2bee('0x1b')]===_0x2bee('0x1a');var _0x24c2a7=_0xca7b0a[_0x2bee('0x1c')];var _0x27ba9a=_0x259151?0x0:_0x371ac6[_0x2bee('0x19')];var _0x1ca11d=_0x259151?_0xca7b0a[_0x2bee('0x1c')]:_0x371ac6[_0x2bee('0x19')]+_0x371ac6[_0x2bee('0x1b')];var _0xbdf3fc;if(_0x1ca11d>=_0x24c2a7){_0x1ca11d=_0x24c2a7;_0xbdf3fc=0xc8;}else{_0xbdf3fc=0xce;}_0x4db27d['status'](_0xbdf3fc);return _0x4db27d[_0x2bee('0x1d')](_0x2bee('0x1e'),_0x27ba9a+'-'+_0x1ca11d+'/'+_0x24c2a7)[_0x2bee('0x18')](_0xca7b0a);}return null;};}function patchUpdates(_0x57cd2c){return function(_0x33915a){try{jsonpatch['apply'](_0x33915a,_0x57cd2c,!![]);}catch(_0x11b053){return BPromise[_0x2bee('0x1f')](_0x11b053);}return _0x33915a[_0x2bee('0x20')]();};}function saveUpdates(_0x54255,_0xb72599){return function(_0x5bbf34){if(_0x5bbf34){return _0x5bbf34[_0x2bee('0x21')](_0x54255)[_0x2bee('0x22')](function(_0x8d73e4){return _0x8d73e4;});}return null;};}function removeEntity(_0x4f00d5,_0x4d32fe){return function(_0x5bf677){if(_0x5bf677){return _0x5bf677[_0x2bee('0x23')]()[_0x2bee('0x22')](function(){_0x4f00d5[_0x2bee('0x17')](0xcc)[_0x2bee('0x16')]();});}};}function handleEntityNotFound(_0x33357d,_0xbff29){return function(_0x18d397){if(!_0x18d397){_0x33357d[_0x2bee('0x15')](0x194);}return _0x18d397;};}function handleError(_0x2eb177,_0x5226bd){_0x5226bd=_0x5226bd||0x1f4;return function(_0x13fec6){logger[_0x2bee('0x24')](_0x13fec6['stack']);if(_0x13fec6[_0x2bee('0x25')]){delete _0x13fec6[_0x2bee('0x25')];}_0x2eb177['status'](_0x5226bd)[_0x2bee('0x26')](_0x13fec6);};}exports['index']=function(_0x346bfc,_0x59149a){var _0x5a24a6={},_0x46ff15={},_0x3ac144={'count':0x0,'rows':[]};var _0x1d2536=_[_0x2bee('0x27')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x5760ef){return{'name':_0x5760ef[_0x2bee('0x28')],'type':_0x5760ef[_0x2bee('0x29')]['key']};});_0x46ff15[_0x2bee('0x2a')]=_[_0x2bee('0x27')](_0x1d2536,_0x2bee('0x25'));_0x46ff15[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x346bfc[_0x2bee('0x2b')]);_0x46ff15['filters']=_['intersection'](_0x46ff15[_0x2bee('0x2a')],_0x46ff15['query']);_0x5a24a6[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0x46ff15[_0x2bee('0x2a')],qs[_0x2bee('0x2f')](_0x346bfc['query'][_0x2bee('0x2f')]));_0x5a24a6[_0x2bee('0x2d')]=_0x5a24a6['attributes']['length']?_0x5a24a6['attributes']:_0x46ff15[_0x2bee('0x2a')];if(!_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x5a24a6[_0x2bee('0x1b')]=qs['limit'](_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x5a24a6[_0x2bee('0x19')]=qs[_0x2bee('0x19')](_0x346bfc['query'][_0x2bee('0x19')]);}_0x5a24a6[_0x2bee('0x32')]=qs['sort'](_0x346bfc['query'][_0x2bee('0x33')]);_0x5a24a6[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_[_0x2bee('0x36')](_0x346bfc[_0x2bee('0x2b')],_0x46ff15['filters']),_0x1d2536);if(_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x5a24a6[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x5a24a6['where'],{'$or':_[_0x2bee('0x27')](_0x1d2536,function(_0x4fd6d5){if(_0x4fd6d5[_0x2bee('0x29')]!==_0x2bee('0x39')){var _0x12918e={};_0x12918e[_0x4fd6d5['name']]={'$like':'%'+_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x37')]+'%'};return _0x12918e;}})});}_0x5a24a6=_[_0x2bee('0x38')]({},_0x5a24a6,_0x346bfc[_0x2bee('0x3a')]);var _0x164d35={'where':_0x5a24a6[_0x2bee('0x34')]};return db[_0x2bee('0x3b')]['count'](_0x164d35)[_0x2bee('0x22')](function(_0x54a35a){_0x3ac144[_0x2bee('0x1c')]=_0x54a35a;if(_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x3c')]){_0x5a24a6['include']=[{'all':!![]}];}return db[_0x2bee('0x3b')][_0x2bee('0x3d')](_0x5a24a6);})['then'](function(_0x137ef1){_0x3ac144[_0x2bee('0x3e')]=_0x137ef1;return _0x3ac144;})['then'](respondWithFilteredResult(_0x59149a,_0x5a24a6))[_0x2bee('0x3f')](handleError(_0x59149a,null));};exports[_0x2bee('0x40')]=function(_0x598ce9,_0x2eb1a8){var _0x280fcb={'raw':![],'where':{'id':_0x598ce9[_0x2bee('0x41')]['id']}},_0x26ec8c={};_0x26ec8c[_0x2bee('0x2a')]=_[_0x2bee('0x2c')](db[_0x2bee('0x3b')]['rawAttributes']);_0x26ec8c['query']=_['keys'](_0x598ce9[_0x2bee('0x2b')]);_0x26ec8c[_0x2bee('0x35')]=_['intersection'](_0x26ec8c[_0x2bee('0x2a')],_0x26ec8c[_0x2bee('0x2b')]);_0x280fcb['attributes']=_[_0x2bee('0x2e')](_0x26ec8c['model'],qs[_0x2bee('0x2f')](_0x598ce9[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x280fcb[_0x2bee('0x2d')]=_0x280fcb[_0x2bee('0x2d')]['length']?_0x280fcb['attributes']:_0x26ec8c[_0x2bee('0x2a')];if(_0x598ce9[_0x2bee('0x2b')]['includeAll']){_0x280fcb[_0x2bee('0x42')]=[{'all':!![]}];}_0x280fcb=_[_0x2bee('0x38')]({},_0x280fcb,_0x598ce9[_0x2bee('0x3a')]);return db[_0x2bee('0x3b')][_0x2bee('0x43')](_0x280fcb)[_0x2bee('0x22')](handleEntityNotFound(_0x2eb1a8,null))[_0x2bee('0x22')](respondWithResult(_0x2eb1a8,null))['catch'](handleError(_0x2eb1a8,null));};exports[_0x2bee('0x44')]=function(_0x3aaa3a,_0x3173fa){return db[_0x2bee('0x3b')][_0x2bee('0x44')](_0x3aaa3a[_0x2bee('0x45')],{})['then'](respondWithResult(_0x3173fa,0xc9))['catch'](handleError(_0x3173fa,null));};exports[_0x2bee('0x21')]=function(_0x3e5543,_0xed9c2){if(_0x3e5543[_0x2bee('0x45')]['id']){delete _0x3e5543[_0x2bee('0x45')]['id'];}return db[_0x2bee('0x3b')][_0x2bee('0x43')]({'where':{'id':_0x3e5543[_0x2bee('0x41')]['id']}})['then'](handleEntityNotFound(_0xed9c2,null))['then'](saveUpdates(_0x3e5543[_0x2bee('0x45')],null))[_0x2bee('0x22')](respondWithResult(_0xed9c2,null))[_0x2bee('0x3f')](handleError(_0xed9c2,null));};exports[_0x2bee('0x23')]=function(_0x4983e1,_0xa66feb){return db[_0x2bee('0x3b')]['find']({'where':{'id':_0x4983e1[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0xa66feb,null))['then'](removeEntity(_0xa66feb,null))[_0x2bee('0x3f')](handleError(_0xa66feb,null));};exports[_0x2bee('0x46')]=function(_0x377980,_0x3be2f9,_0x6ace50){var _0x5ee2fe={};var _0x43d2a3={};var _0x16ddfd;var _0xa8bc0e;return db[_0x2bee('0x3b')][_0x2bee('0x47')]({'where':{'id':_0x377980[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x3be2f9,null))[_0x2bee('0x22')](function(_0x54d564){if(_0x54d564){_0x16ddfd=_0x54d564;_0x43d2a3['model']=_[_0x2bee('0x2c')](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0x43d2a3[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x377980[_0x2bee('0x2b')]);_0x43d2a3[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0x43d2a3[_0x2bee('0x2a')],_0x43d2a3[_0x2bee('0x2b')]);_0x5ee2fe['attributes']=_[_0x2bee('0x2e')](_0x43d2a3['model'],qs[_0x2bee('0x2f')](_0x377980[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x5ee2fe['attributes']=_0x5ee2fe[_0x2bee('0x2d')][_0x2bee('0x4a')]?_0x5ee2fe[_0x2bee('0x2d')]:_0x43d2a3[_0x2bee('0x2a')];_0x5ee2fe[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x377980['query'][_0x2bee('0x33')]);_0x5ee2fe[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_['pick'](_0x377980['query'],_0x43d2a3['filters']));if(_0x377980[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x5ee2fe[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x5ee2fe[_0x2bee('0x34')],{'$or':_[_0x2bee('0x27')](_0x5ee2fe[_0x2bee('0x2d')],function(_0x1346d5){var _0x12d8a2={};_0x12d8a2[_0x1346d5]={'$like':'%'+_0x377980[_0x2bee('0x2b')]['filter']+'%'};return _0x12d8a2;})});}_0x5ee2fe=_[_0x2bee('0x38')]({},_0x5ee2fe,_0x377980[_0x2bee('0x3a')]);return _0x16ddfd['getSubjects'](_0x5ee2fe);}})[_0x2bee('0x22')](function(_0x12f5cb){if(_0x12f5cb){_0xa8bc0e=_0x12f5cb['length'];if(!_0x377980[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x5ee2fe[_0x2bee('0x1b')]=qs['limit'](_0x377980[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x5ee2fe[_0x2bee('0x19')]=qs[_0x2bee('0x19')](_0x377980['query'][_0x2bee('0x19')]);}return _0x16ddfd[_0x2bee('0x46')](_0x5ee2fe);}})[_0x2bee('0x22')](function(_0x38f79e){if(_0x38f79e){return _0x38f79e?{'count':_0xa8bc0e,'rows':_0x38f79e}:null;}})[_0x2bee('0x22')](respondWithResult(_0x3be2f9,null))[_0x2bee('0x3f')](handleError(_0x3be2f9,null));};exports[_0x2bee('0x4b')]=function(_0x380728,_0x14308f,_0x5be0e7){var _0x241c5d={};var _0xd836a3={};var _0x33367f;var _0x1c0032;return db[_0x2bee('0x3b')][_0x2bee('0x47')]({'where':{'id':_0x380728[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x14308f,null))[_0x2bee('0x22')](function(_0x483013){if(_0x483013){_0x33367f=_0x483013;_0xd836a3[_0x2bee('0x2a')]=_['keys'](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0xd836a3[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x380728[_0x2bee('0x2b')]);_0xd836a3[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0xd836a3[_0x2bee('0x2a')],_0xd836a3[_0x2bee('0x2b')]);_0x241c5d[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0xd836a3[_0x2bee('0x2a')],qs['fields'](_0x380728[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x241c5d[_0x2bee('0x2d')]=_0x241c5d[_0x2bee('0x2d')][_0x2bee('0x4a')]?_0x241c5d[_0x2bee('0x2d')]:_0xd836a3[_0x2bee('0x2a')];_0x241c5d[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x380728[_0x2bee('0x2b')][_0x2bee('0x33')]);_0x241c5d[_0x2bee('0x34')]=qs['filters'](_['pick'](_0x380728[_0x2bee('0x2b')],_0xd836a3[_0x2bee('0x35')]));if(_0x380728['query'][_0x2bee('0x37')]){_0x241c5d[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x241c5d[_0x2bee('0x34')],{'$or':_[_0x2bee('0x27')](_0x241c5d[_0x2bee('0x2d')],function(_0x209e69){var _0x4ff02f={};_0x4ff02f[_0x209e69]={'$like':'%'+_0x380728[_0x2bee('0x2b')]['filter']+'%'};return _0x4ff02f;})});}_0x241c5d=_[_0x2bee('0x38')]({},_0x241c5d,_0x380728[_0x2bee('0x3a')]);return _0x33367f['getDescriptions'](_0x241c5d);}})[_0x2bee('0x22')](function(_0x227ecb){if(_0x227ecb){_0x1c0032=_0x227ecb[_0x2bee('0x4a')];if(!_0x380728[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x241c5d[_0x2bee('0x1b')]=qs['limit'](_0x380728[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x241c5d[_0x2bee('0x19')]=qs['offset'](_0x380728['query'][_0x2bee('0x19')]);}return _0x33367f[_0x2bee('0x4b')](_0x241c5d);}})[_0x2bee('0x22')](function(_0x32d125){if(_0x32d125){return _0x32d125?{'count':_0x1c0032,'rows':_0x32d125}:null;}})[_0x2bee('0x22')](respondWithResult(_0x14308f,null))[_0x2bee('0x3f')](handleError(_0x14308f,null));};exports[_0x2bee('0x4c')]=function(_0x4d3a3,_0x14f15b,_0x4bf9c5){var _0x3aa72a={};var _0x2dc211={};var _0x36323a;var _0x8c786b;return db['FreshsalesConfiguration'][_0x2bee('0x47')]({'where':{'id':_0x4d3a3['params']['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x14f15b,null))['then'](function(_0x3a425f){if(_0x3a425f){_0x36323a=_0x3a425f;_0x2dc211[_0x2bee('0x2a')]=_[_0x2bee('0x2c')](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0x2dc211[_0x2bee('0x2b')]=_['keys'](_0x4d3a3['query']);_0x2dc211[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0x2dc211[_0x2bee('0x2a')],_0x2dc211[_0x2bee('0x2b')]);_0x3aa72a[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0x2dc211['model'],qs[_0x2bee('0x2f')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x3aa72a[_0x2bee('0x2d')]=_0x3aa72a['attributes'][_0x2bee('0x4a')]?_0x3aa72a[_0x2bee('0x2d')]:_0x2dc211['model'];_0x3aa72a[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x33')]);_0x3aa72a[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_[_0x2bee('0x36')](_0x4d3a3[_0x2bee('0x2b')],_0x2dc211[_0x2bee('0x35')]));if(_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x3aa72a['where']=_[_0x2bee('0x38')](_0x3aa72a['where'],{'$or':_[_0x2bee('0x27')](_0x3aa72a[_0x2bee('0x2d')],function(_0x2ac59a){var _0x24ff28={};_0x24ff28[_0x2ac59a]={'$like':'%'+_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x37')]+'%'};return _0x24ff28;})});}_0x3aa72a=_[_0x2bee('0x38')]({},_0x3aa72a,_0x4d3a3['options']);return _0x36323a[_0x2bee('0x4c')](_0x3aa72a);}})[_0x2bee('0x22')](function(_0x377175){if(_0x377175){_0x8c786b=_0x377175[_0x2bee('0x4a')];if(!_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x3aa72a[_0x2bee('0x1b')]=qs[_0x2bee('0x1b')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x3aa72a['offset']=qs[_0x2bee('0x19')](_0x4d3a3[_0x2bee('0x2b')]['offset']);}return _0x36323a[_0x2bee('0x4c')](_0x3aa72a);}})[_0x2bee('0x22')](function(_0x5da3b7){if(_0x5da3b7){return _0x5da3b7?{'count':_0x8c786b,'rows':_0x5da3b7}:null;}})[_0x2bee('0x22')](respondWithResult(_0x14f15b,null))['catch'](handleError(_0x14f15b,null));}; \ No newline at end of file +var _0x8aaa=['intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','destroy','getSubjects','findOne','FreshsalesField','pick','getDescriptions','nolimit','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','error','stack','name','map','FreshsalesConfiguration','type','key','keys','query','filters'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x8aaa,0x10c));var _0xa8aa=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0x8aaa[_0x3c5ad6];return _0x3154f2;};'use strict';var emlformat=require(_0xa8aa('0x0'));var rimraf=require(_0xa8aa('0x1'));var zipdir=require(_0xa8aa('0x2'));var jsonpatch=require(_0xa8aa('0x3'));var rp=require(_0xa8aa('0x4'));var moment=require(_0xa8aa('0x5'));var BPromise=require(_0xa8aa('0x6'));var Mustache=require('mustache');var util=require(_0xa8aa('0x7'));var path=require(_0xa8aa('0x8'));var sox=require(_0xa8aa('0x9'));var csv=require(_0xa8aa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8aa('0xb'));var squel=require(_0xa8aa('0xc'));var crypto=require(_0xa8aa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8aa('0xe'));var Papa=require('papaparse');var Redis=require(_0xa8aa('0xf'));var authService=require(_0xa8aa('0x10'));var qs=require(_0xa8aa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8aa('0x12'));var logger=require(_0xa8aa('0x13'))(_0xa8aa('0x14'));var utils=require(_0xa8aa('0x15'));var config=require(_0xa8aa('0x16'));var licenseUtil=require(_0xa8aa('0x17'));var db=require(_0xa8aa('0x18'))['db'];function respondWithStatusCode(_0x4b7833,_0xac928d){_0xac928d=_0xac928d||0xcc;return function(_0x1c26c8){if(_0x1c26c8){return _0x4b7833[_0xa8aa('0x19')](_0xac928d);}return _0x4b7833[_0xa8aa('0x1a')](_0xac928d)[_0xa8aa('0x1b')]();};}function respondWithResult(_0x10fdb4,_0x940f36){_0x940f36=_0x940f36||0xc8;return function(_0x5d8e77){if(_0x5d8e77){return _0x10fdb4[_0xa8aa('0x1a')](_0x940f36)['json'](_0x5d8e77);}};}function respondWithFilteredResult(_0x405c6d,_0x501537){return function(_0x30c448){if(_0x30c448){var _0x10b6d8=typeof _0x501537[_0xa8aa('0x1c')]===_0xa8aa('0x1d')&&typeof _0x501537[_0xa8aa('0x1e')]===_0xa8aa('0x1d');var _0x39f24a=_0x30c448[_0xa8aa('0x1f')];var _0x48bc4b=_0x10b6d8?0x0:_0x501537[_0xa8aa('0x1c')];var _0x5dab72=_0x10b6d8?_0x30c448[_0xa8aa('0x1f')]:_0x501537['offset']+_0x501537[_0xa8aa('0x1e')];var _0xa999be;if(_0x5dab72>=_0x39f24a){_0x5dab72=_0x39f24a;_0xa999be=0xc8;}else{_0xa999be=0xce;}_0x405c6d[_0xa8aa('0x1a')](_0xa999be);return _0x405c6d[_0xa8aa('0x20')](_0xa8aa('0x21'),_0x48bc4b+'-'+_0x5dab72+'/'+_0x39f24a)[_0xa8aa('0x22')](_0x30c448);}return null;};}function patchUpdates(_0x59dfa8){return function(_0x1d4353){try{jsonpatch['apply'](_0x1d4353,_0x59dfa8,!![]);}catch(_0x221bb4){return BPromise[_0xa8aa('0x23')](_0x221bb4);}return _0x1d4353['save']();};}function saveUpdates(_0x1d9a2a,_0x2c59cb){return function(_0x430866){if(_0x430866){return _0x430866[_0xa8aa('0x24')](_0x1d9a2a)[_0xa8aa('0x25')](function(_0x1812e2){return _0x1812e2;});}return null;};}function removeEntity(_0x2dc351,_0x36c913){return function(_0xa880f7){if(_0xa880f7){return _0xa880f7['destroy']()[_0xa8aa('0x25')](function(){_0x2dc351[_0xa8aa('0x1a')](0xcc)[_0xa8aa('0x1b')]();});}};}function handleEntityNotFound(_0x30eef2,_0x31a190){return function(_0x820e4){if(!_0x820e4){_0x30eef2[_0xa8aa('0x19')](0x194);}return _0x820e4;};}function handleError(_0x43f8bb,_0x23651d){_0x23651d=_0x23651d||0x1f4;return function(_0x4b7394){logger[_0xa8aa('0x26')](_0x4b7394[_0xa8aa('0x27')]);if(_0x4b7394[_0xa8aa('0x28')]){delete _0x4b7394['name'];}_0x43f8bb['status'](_0x23651d)['send'](_0x4b7394);};}exports['index']=function(_0x221196,_0x1b970f){var _0x35f0f4={},_0x3072fe={},_0x545c56={'count':0x0,'rows':[]};var _0x232913=_[_0xa8aa('0x29')](db[_0xa8aa('0x2a')]['rawAttributes'],function(_0x25a9f8){return{'name':_0x25a9f8['fieldName'],'type':_0x25a9f8[_0xa8aa('0x2b')][_0xa8aa('0x2c')]};});_0x3072fe['model']=_[_0xa8aa('0x29')](_0x232913,_0xa8aa('0x28'));_0x3072fe['query']=_[_0xa8aa('0x2d')](_0x221196[_0xa8aa('0x2e')]);_0x3072fe[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x3072fe[_0xa8aa('0x31')],_0x3072fe[_0xa8aa('0x2e')]);_0x35f0f4[_0xa8aa('0x32')]=_['intersection'](_0x3072fe[_0xa8aa('0x31')],qs[_0xa8aa('0x33')](_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x33')]));_0x35f0f4[_0xa8aa('0x32')]=_0x35f0f4[_0xa8aa('0x32')][_0xa8aa('0x34')]?_0x35f0f4[_0xa8aa('0x32')]:_0x3072fe[_0xa8aa('0x31')];if(!_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x35')]('nolimit')){_0x35f0f4[_0xa8aa('0x1e')]=qs[_0xa8aa('0x1e')](_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x1e')]);_0x35f0f4[_0xa8aa('0x1c')]=qs[_0xa8aa('0x1c')](_0x221196['query']['offset']);}_0x35f0f4[_0xa8aa('0x36')]=qs[_0xa8aa('0x37')](_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x37')]);_0x35f0f4[_0xa8aa('0x38')]=qs[_0xa8aa('0x2f')](_['pick'](_0x221196['query'],_0x3072fe[_0xa8aa('0x2f')]),_0x232913);if(_0x221196['query'][_0xa8aa('0x39')]){_0x35f0f4['where']=_[_0xa8aa('0x3a')](_0x35f0f4[_0xa8aa('0x38')],{'$or':_[_0xa8aa('0x29')](_0x232913,function(_0x345cb2){if(_0x345cb2[_0xa8aa('0x2b')]!==_0xa8aa('0x3b')){var _0x105756={};_0x105756[_0x345cb2['name']]={'$like':'%'+_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x39')]+'%'};return _0x105756;}})});}_0x35f0f4=_[_0xa8aa('0x3a')]({},_0x35f0f4,_0x221196[_0xa8aa('0x3c')]);var _0x5c9da3={'where':_0x35f0f4[_0xa8aa('0x38')]};return db['FreshsalesConfiguration'][_0xa8aa('0x1f')](_0x5c9da3)[_0xa8aa('0x25')](function(_0x39b6b4){_0x545c56[_0xa8aa('0x1f')]=_0x39b6b4;if(_0x221196[_0xa8aa('0x2e')][_0xa8aa('0x3d')]){_0x35f0f4[_0xa8aa('0x3e')]=[{'all':!![]}];}return db[_0xa8aa('0x2a')][_0xa8aa('0x3f')](_0x35f0f4);})[_0xa8aa('0x25')](function(_0xb679c5){_0x545c56[_0xa8aa('0x40')]=_0xb679c5;return _0x545c56;})[_0xa8aa('0x25')](respondWithFilteredResult(_0x1b970f,_0x35f0f4))['catch'](handleError(_0x1b970f,null));};exports[_0xa8aa('0x41')]=function(_0x496803,_0x173f6f){var _0x30a1b9={'raw':![],'where':{'id':_0x496803[_0xa8aa('0x42')]['id']}},_0x501082={};_0x501082[_0xa8aa('0x31')]=_[_0xa8aa('0x2d')](db[_0xa8aa('0x2a')][_0xa8aa('0x43')]);_0x501082[_0xa8aa('0x2e')]=_[_0xa8aa('0x2d')](_0x496803['query']);_0x501082[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x501082[_0xa8aa('0x31')],_0x501082['query']);_0x30a1b9[_0xa8aa('0x32')]=_[_0xa8aa('0x30')](_0x501082[_0xa8aa('0x31')],qs[_0xa8aa('0x33')](_0x496803['query'][_0xa8aa('0x33')]));_0x30a1b9['attributes']=_0x30a1b9[_0xa8aa('0x32')][_0xa8aa('0x34')]?_0x30a1b9[_0xa8aa('0x32')]:_0x501082[_0xa8aa('0x31')];if(_0x496803['query']['includeAll']){_0x30a1b9['include']=[{'all':!![]}];}_0x30a1b9=_[_0xa8aa('0x3a')]({},_0x30a1b9,_0x496803[_0xa8aa('0x3c')]);return db[_0xa8aa('0x2a')][_0xa8aa('0x44')](_0x30a1b9)[_0xa8aa('0x25')](handleEntityNotFound(_0x173f6f,null))['then'](respondWithResult(_0x173f6f,null))[_0xa8aa('0x45')](handleError(_0x173f6f,null));};exports['create']=function(_0x433e04,_0x64b2c4){return db[_0xa8aa('0x2a')]['create'](_0x433e04[_0xa8aa('0x46')],{})[_0xa8aa('0x25')](respondWithResult(_0x64b2c4,0xc9))[_0xa8aa('0x45')](handleError(_0x64b2c4,null));};exports[_0xa8aa('0x24')]=function(_0x193508,_0x33a2b9){if(_0x193508[_0xa8aa('0x46')]['id']){delete _0x193508['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x193508['params']['id']}})[_0xa8aa('0x25')](handleEntityNotFound(_0x33a2b9,null))[_0xa8aa('0x25')](saveUpdates(_0x193508['body'],null))[_0xa8aa('0x25')](respondWithResult(_0x33a2b9,null))[_0xa8aa('0x45')](handleError(_0x33a2b9,null));};exports[_0xa8aa('0x47')]=function(_0x1afe6d,_0x295357){return db[_0xa8aa('0x2a')][_0xa8aa('0x44')]({'where':{'id':_0x1afe6d[_0xa8aa('0x42')]['id']}})[_0xa8aa('0x25')](handleEntityNotFound(_0x295357,null))[_0xa8aa('0x25')](removeEntity(_0x295357,null))[_0xa8aa('0x45')](handleError(_0x295357,null));};exports[_0xa8aa('0x48')]=function(_0x3d8fd8,_0x23ab31,_0x1e43d6){var _0x494e19={};var _0x4e6c91={};var _0x14cd7f;var _0x4a7111;return db[_0xa8aa('0x2a')][_0xa8aa('0x49')]({'where':{'id':_0x3d8fd8['params']['id']}})[_0xa8aa('0x25')](handleEntityNotFound(_0x23ab31,null))[_0xa8aa('0x25')](function(_0x59496d){if(_0x59496d){_0x14cd7f=_0x59496d;_0x4e6c91[_0xa8aa('0x31')]=_[_0xa8aa('0x2d')](db[_0xa8aa('0x4a')]['rawAttributes']);_0x4e6c91[_0xa8aa('0x2e')]=_[_0xa8aa('0x2d')](_0x3d8fd8['query']);_0x4e6c91[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x4e6c91['model'],_0x4e6c91[_0xa8aa('0x2e')]);_0x494e19[_0xa8aa('0x32')]=_[_0xa8aa('0x30')](_0x4e6c91[_0xa8aa('0x31')],qs[_0xa8aa('0x33')](_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x33')]));_0x494e19[_0xa8aa('0x32')]=_0x494e19['attributes'][_0xa8aa('0x34')]?_0x494e19[_0xa8aa('0x32')]:_0x4e6c91[_0xa8aa('0x31')];_0x494e19[_0xa8aa('0x36')]=qs['sort'](_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x37')]);_0x494e19[_0xa8aa('0x38')]=qs['filters'](_[_0xa8aa('0x4b')](_0x3d8fd8[_0xa8aa('0x2e')],_0x4e6c91[_0xa8aa('0x2f')]));if(_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x39')]){_0x494e19['where']=_[_0xa8aa('0x3a')](_0x494e19[_0xa8aa('0x38')],{'$or':_[_0xa8aa('0x29')](_0x494e19[_0xa8aa('0x32')],function(_0x4a3ac6){var _0x142474={};_0x142474[_0x4a3ac6]={'$like':'%'+_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x39')]+'%'};return _0x142474;})});}_0x494e19=_[_0xa8aa('0x3a')]({},_0x494e19,_0x3d8fd8[_0xa8aa('0x3c')]);return _0x14cd7f[_0xa8aa('0x48')](_0x494e19);}})[_0xa8aa('0x25')](function(_0x437a9d){if(_0x437a9d){_0x4a7111=_0x437a9d['length'];if(!_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x35')]('nolimit')){_0x494e19[_0xa8aa('0x1e')]=qs[_0xa8aa('0x1e')](_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x1e')]);_0x494e19[_0xa8aa('0x1c')]=qs['offset'](_0x3d8fd8[_0xa8aa('0x2e')][_0xa8aa('0x1c')]);}return _0x14cd7f[_0xa8aa('0x48')](_0x494e19);}})[_0xa8aa('0x25')](function(_0x136845){if(_0x136845){return _0x136845?{'count':_0x4a7111,'rows':_0x136845}:null;}})['then'](respondWithResult(_0x23ab31,null))['catch'](handleError(_0x23ab31,null));};exports[_0xa8aa('0x4c')]=function(_0xfa002e,_0x125bd9,_0x9eb1a8){var _0x1147dd={};var _0x51e517={};var _0x13c9b4;var _0x87d9e4;return db[_0xa8aa('0x2a')][_0xa8aa('0x49')]({'where':{'id':_0xfa002e[_0xa8aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x125bd9,null))['then'](function(_0x30490c){if(_0x30490c){_0x13c9b4=_0x30490c;_0x51e517[_0xa8aa('0x31')]=_['keys'](db[_0xa8aa('0x4a')][_0xa8aa('0x43')]);_0x51e517[_0xa8aa('0x2e')]=_[_0xa8aa('0x2d')](_0xfa002e[_0xa8aa('0x2e')]);_0x51e517[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x51e517[_0xa8aa('0x31')],_0x51e517[_0xa8aa('0x2e')]);_0x1147dd['attributes']=_[_0xa8aa('0x30')](_0x51e517[_0xa8aa('0x31')],qs['fields'](_0xfa002e['query'][_0xa8aa('0x33')]));_0x1147dd[_0xa8aa('0x32')]=_0x1147dd['attributes'][_0xa8aa('0x34')]?_0x1147dd['attributes']:_0x51e517['model'];_0x1147dd['order']=qs[_0xa8aa('0x37')](_0xfa002e[_0xa8aa('0x2e')]['sort']);_0x1147dd[_0xa8aa('0x38')]=qs[_0xa8aa('0x2f')](_[_0xa8aa('0x4b')](_0xfa002e['query'],_0x51e517[_0xa8aa('0x2f')]));if(_0xfa002e[_0xa8aa('0x2e')][_0xa8aa('0x39')]){_0x1147dd['where']=_[_0xa8aa('0x3a')](_0x1147dd['where'],{'$or':_[_0xa8aa('0x29')](_0x1147dd[_0xa8aa('0x32')],function(_0x4b57d6){var _0x22f61d={};_0x22f61d[_0x4b57d6]={'$like':'%'+_0xfa002e[_0xa8aa('0x2e')][_0xa8aa('0x39')]+'%'};return _0x22f61d;})});}_0x1147dd=_['merge']({},_0x1147dd,_0xfa002e['options']);return _0x13c9b4[_0xa8aa('0x4c')](_0x1147dd);}})[_0xa8aa('0x25')](function(_0x6b85bb){if(_0x6b85bb){_0x87d9e4=_0x6b85bb[_0xa8aa('0x34')];if(!_0xfa002e[_0xa8aa('0x2e')][_0xa8aa('0x35')](_0xa8aa('0x4d'))){_0x1147dd[_0xa8aa('0x1e')]=qs['limit'](_0xfa002e[_0xa8aa('0x2e')][_0xa8aa('0x1e')]);_0x1147dd[_0xa8aa('0x1c')]=qs['offset'](_0xfa002e[_0xa8aa('0x2e')][_0xa8aa('0x1c')]);}return _0x13c9b4['getDescriptions'](_0x1147dd);}})[_0xa8aa('0x25')](function(_0x3d9c8b){if(_0x3d9c8b){return _0x3d9c8b?{'count':_0x87d9e4,'rows':_0x3d9c8b}:null;}})[_0xa8aa('0x25')](respondWithResult(_0x125bd9,null))['catch'](handleError(_0x125bd9,null));};exports[_0xa8aa('0x4e')]=function(_0x580391,_0x5187f1,_0x2e7887){var _0x195d73={};var _0x28c1d2={};var _0x64cf65;var _0x324b3e;return db['FreshsalesConfiguration'][_0xa8aa('0x49')]({'where':{'id':_0x580391['params']['id']}})[_0xa8aa('0x25')](handleEntityNotFound(_0x5187f1,null))[_0xa8aa('0x25')](function(_0x47f7d9){if(_0x47f7d9){_0x64cf65=_0x47f7d9;_0x28c1d2[_0xa8aa('0x31')]=_[_0xa8aa('0x2d')](db[_0xa8aa('0x4a')]['rawAttributes']);_0x28c1d2['query']=_[_0xa8aa('0x2d')](_0x580391[_0xa8aa('0x2e')]);_0x28c1d2['filters']=_['intersection'](_0x28c1d2[_0xa8aa('0x31')],_0x28c1d2[_0xa8aa('0x2e')]);_0x195d73['attributes']=_[_0xa8aa('0x30')](_0x28c1d2[_0xa8aa('0x31')],qs[_0xa8aa('0x33')](_0x580391[_0xa8aa('0x2e')][_0xa8aa('0x33')]));_0x195d73[_0xa8aa('0x32')]=_0x195d73[_0xa8aa('0x32')][_0xa8aa('0x34')]?_0x195d73[_0xa8aa('0x32')]:_0x28c1d2[_0xa8aa('0x31')];_0x195d73[_0xa8aa('0x36')]=qs[_0xa8aa('0x37')](_0x580391[_0xa8aa('0x2e')][_0xa8aa('0x37')]);_0x195d73['where']=qs['filters'](_['pick'](_0x580391[_0xa8aa('0x2e')],_0x28c1d2[_0xa8aa('0x2f')]));if(_0x580391[_0xa8aa('0x2e')][_0xa8aa('0x39')]){_0x195d73[_0xa8aa('0x38')]=_[_0xa8aa('0x3a')](_0x195d73[_0xa8aa('0x38')],{'$or':_['map'](_0x195d73[_0xa8aa('0x32')],function(_0x4af9fd){var _0x220801={};_0x220801[_0x4af9fd]={'$like':'%'+_0x580391['query']['filter']+'%'};return _0x220801;})});}_0x195d73=_[_0xa8aa('0x3a')]({},_0x195d73,_0x580391[_0xa8aa('0x3c')]);return _0x64cf65[_0xa8aa('0x4e')](_0x195d73);}})[_0xa8aa('0x25')](function(_0x39c7b9){if(_0x39c7b9){_0x324b3e=_0x39c7b9[_0xa8aa('0x34')];if(!_0x580391[_0xa8aa('0x2e')]['hasOwnProperty'](_0xa8aa('0x4d'))){_0x195d73[_0xa8aa('0x1e')]=qs['limit'](_0x580391['query'][_0xa8aa('0x1e')]);_0x195d73[_0xa8aa('0x1c')]=qs[_0xa8aa('0x1c')](_0x580391[_0xa8aa('0x2e')][_0xa8aa('0x1c')]);}return _0x64cf65[_0xa8aa('0x4e')](_0x195d73);}})['then'](function(_0x408ec2){if(_0x408ec2){return _0x408ec2?{'count':_0x324b3e,'rows':_0x408ec2}:null;}})['then'](respondWithResult(_0x5187f1,null))[_0xa8aa('0x45')](handleError(_0x5187f1,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 0d15d3f..3b8a7e7 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 _0x4b34=['request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0x4b34,0x13b));var _0x44b3=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4b34[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x44b3('0x0'));var util=require(_0x44b3('0x1'));var logger=require('../../config/logger')(_0x44b3('0x2'));var moment=require(_0x44b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x44b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44b3('0x5'));var config=require(_0x44b3('0x6'));var attributes=require(_0x44b3('0x7'));module['exports']=function(_0x28ffcb,_0x17568f){return _0x28ffcb[_0x44b3('0x8')](_0x44b3('0x9'),attributes,{'tableName':_0x44b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4193=['util','api','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x10cf5d,_0x396a02){var _0x5b9d4b=function(_0x5dd2e2){while(--_0x5dd2e2){_0x10cf5d['push'](_0x10cf5d['shift']());}};_0x5b9d4b(++_0x396a02);}(_0x4193,0x1eb));var _0x3419=function(_0x29a9b9,_0x56c047){_0x29a9b9=_0x29a9b9-0x0;var _0x3c9a52=_0x4193[_0x29a9b9];return _0x3c9a52;};'use strict';var _=require(_0x3419('0x0'));var util=require(_0x3419('0x1'));var logger=require('../../config/logger')(_0x3419('0x2'));var moment=require('moment');var BPromise=require(_0x3419('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3419('0x4'));var rimraf=require(_0x3419('0x5'));var config=require(_0x3419('0x6'));var attributes=require(_0x3419('0x7'));module[_0x3419('0x8')]=function(_0x171224,_0x3989ef){return _0x171224[_0x3419('0x9')](_0x3419('0xa'),attributes,{'tableName':_0x3419('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 8962f03..ce9a0ea 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 _0xad61=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xbdcb5e,_0x289b93){var _0x1edfd4=function(_0x133001){while(--_0x133001){_0xbdcb5e['push'](_0xbdcb5e['shift']());}};_0x1edfd4(++_0x289b93);}(_0xad61,0xce));var _0x1ad6=function(_0x54d30f,_0x50f4de){_0x54d30f=_0x54d30f-0x0;var _0x461289=_0xad61[_0x54d30f];return _0x461289;};'use strict';var _=require(_0x1ad6('0x0'));var util=require(_0x1ad6('0x1'));var moment=require(_0x1ad6('0x2'));var BPromise=require(_0x1ad6('0x3'));var rs=require(_0x1ad6('0x4'));var fs=require('fs');var Redis=require(_0x1ad6('0x5'));var db=require(_0x1ad6('0x6'))['db'];var utils=require(_0x1ad6('0x7'));var logger=require(_0x1ad6('0x8'))(_0x1ad6('0x9'));var config=require(_0x1ad6('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ad6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x333fd7,_0x722907,_0x24cf8a){return new BPromise(function(_0x283290,_0x2aa44f){return client[_0x1ad6('0xc')](_0x333fd7,_0x24cf8a)[_0x1ad6('0xd')](function(_0x596ae5){logger['info'](_0x1ad6('0xe'),_0x722907,_0x1ad6('0xf'));logger[_0x1ad6('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x722907,'request\x20sent',JSON[_0x1ad6('0x11')](_0x596ae5));if(_0x596ae5[_0x1ad6('0x12')]){if(_0x596ae5[_0x1ad6('0x12')]['code']===0x1f4){logger['error'](_0x1ad6('0xe'),_0x722907,_0x596ae5[_0x1ad6('0x12')][_0x1ad6('0x13')]);return _0x2aa44f(_0x596ae5[_0x1ad6('0x12')]['message']);}logger[_0x1ad6('0x12')](_0x1ad6('0xe'),_0x722907,_0x596ae5[_0x1ad6('0x12')][_0x1ad6('0x13')]);return _0x283290(_0x596ae5[_0x1ad6('0x12')]['message']);}else{logger['info'](_0x1ad6('0xe'),_0x722907,_0x1ad6('0xf'));_0x283290(_0x596ae5[_0x1ad6('0x14')][_0x1ad6('0x13')]);}})[_0x1ad6('0x15')](function(_0x281d3f){logger[_0x1ad6('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x722907,_0x281d3f);_0x2aa44f(_0x281d3f);});});} \ No newline at end of file +var _0xbe31=['../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x218633,_0x14cb74){var _0x3ab068=function(_0x5fc544){while(--_0x5fc544){_0x218633['push'](_0x218633['shift']());}};_0x3ab068(++_0x14cb74);}(_0xbe31,0x120));var _0x1be3=function(_0x2e9df5,_0x435984){_0x2e9df5=_0x2e9df5-0x0;var _0x224611=_0xbe31[_0x2e9df5];return _0x224611;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require('moment');var BPromise=require(_0x1be3('0x1'));var rs=require(_0x1be3('0x2'));var fs=require('fs');var Redis=require(_0x1be3('0x3'));var db=require(_0x1be3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1be3('0x5'));var config=require(_0x1be3('0x6'));var jayson=require(_0x1be3('0x7'));var client=jayson[_0x1be3('0x8')][_0x1be3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3eef18,_0x13c808,_0x5d4626){return new BPromise(function(_0x54add3,_0x11c197){return client['request'](_0x3eef18,_0x5d4626)[_0x1be3('0xa')](function(_0x328e5e){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c808,_0x1be3('0xb'));logger[_0x1be3('0xc')](_0x1be3('0xd'),_0x13c808,_0x1be3('0xb'),JSON[_0x1be3('0xe')](_0x328e5e));if(_0x328e5e[_0x1be3('0xf')]){if(_0x328e5e[_0x1be3('0xf')][_0x1be3('0x10')]===0x1f4){logger[_0x1be3('0xf')](_0x1be3('0x11'),_0x13c808,_0x328e5e[_0x1be3('0xf')]['message']);return _0x11c197(_0x328e5e[_0x1be3('0xf')][_0x1be3('0x12')]);}logger[_0x1be3('0xf')](_0x1be3('0x11'),_0x13c808,_0x328e5e[_0x1be3('0xf')][_0x1be3('0x12')]);return _0x54add3(_0x328e5e['error'][_0x1be3('0x12')]);}else{logger[_0x1be3('0x13')](_0x1be3('0x11'),_0x13c808,_0x1be3('0xb'));_0x54add3(_0x328e5e[_0x1be3('0x14')]['message']);}})['catch'](function(_0x554fe9){logger[_0x1be3('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x13c808,_0x554fe9);_0x11c197(_0x554fe9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8dd28a7..3af90c5 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 _0x6737=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','post','create','put','update'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6737,0xe2));var _0x7673=function(_0x5f15b3,_0x18df4c){_0x5f15b3=_0x5f15b3-0x0;var _0x516bc2=_0x6737[_0x5f15b3];return _0x516bc2;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7673('0xa')]('/',auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);router[_0x7673('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0xf')]);module['exports']=router; \ No newline at end of file +var _0x44d4=['exports','multer','express','Router','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x44d4,0x161));var _0x444d=function(_0x296174,_0x3e82a1){_0x296174=_0x296174-0x0;var _0x16ae68=_0x44d4[_0x296174];return _0x16ae68;};'use strict';var multer=require(_0x444d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x444d('0x1'));var router=express[_0x444d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x444d('0x3'));var controller=require(_0x444d('0x4'));router[_0x444d('0x5')]('/',auth[_0x444d('0x6')](),controller[_0x444d('0x7')]);router[_0x444d('0x5')](_0x444d('0x8'),auth['isAuthenticated'](),controller[_0x444d('0x9')]);router['post']('/',auth[_0x444d('0x6')](),controller[_0x444d('0xa')]);router[_0x444d('0xb')](_0x444d('0x8'),auth[_0x444d('0x6')](),controller[_0x444d('0xc')]);router[_0x444d('0xd')](_0x444d('0x8'),auth[_0x444d('0x6')](),controller[_0x444d('0xe')]);module[_0x444d('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a59fa24..49ba827 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 _0xd817=['STRING','variable','exports','ENUM','string','customVariable','keyValue'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xd817,0x14b));var _0x7d81=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xd817[_0x2d6197];return _0x4d0e75;};'use strict';var Sequelize=require('sequelize');module[_0x7d81('0x0')]={'type':{'type':Sequelize[_0x7d81('0x1')](_0x7d81('0x2'),'variable',_0x7d81('0x3'),_0x7d81('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7d81('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7d81('0x1')](_0x7d81('0x2'),_0x7d81('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7d81('0x5')]},'nameField':{'type':Sequelize[_0x7d81('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c34=['picklist','STRING','ENUM','string','BOOLEAN','sequelize','exports','customVariable','keyValue'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c34,0x1c7));var _0x41c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c34[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x41c3('0x0'));module[_0x41c3('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x41c3('0x2'),_0x41c3('0x3'),_0x41c3('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x41c3('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x41c3('0x6')](_0x41c3('0x7'),'variable',_0x41c3('0x2'))},'keyContent':{'type':Sequelize[_0x41c3('0x5')]},'idField':{'type':Sequelize[_0x41c3('0x5')]},'nameField':{'type':Sequelize[_0x41c3('0x5')]},'customField':{'type':Sequelize[_0x41c3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x41c3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index bce6f80..7f3869a 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 _0xf702=['body','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../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','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','create'];(function(_0x86e7e7,_0x26b91d){var _0x45284b=function(_0x457b19){while(--_0x457b19){_0x86e7e7['push'](_0x86e7e7['shift']());}};_0x45284b(++_0x26b91d);}(_0xf702,0x1b3));var _0x2f70=function(_0x5c2589,_0x346944){_0x5c2589=_0x5c2589-0x0;var _0x27669b=_0xf702[_0x5c2589];return _0x27669b;};'use strict';var emlformat=require(_0x2f70('0x0'));var rimraf=require(_0x2f70('0x1'));var zipdir=require(_0x2f70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f70('0x3'));var moment=require(_0x2f70('0x4'));var BPromise=require(_0x2f70('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2f70('0x6'));var sox=require(_0x2f70('0x7'));var csv=require(_0x2f70('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f70('0x9'));var squel=require('squel');var crypto=require(_0x2f70('0xa'));var jsforce=require(_0x2f70('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2f70('0x8'));var querystring=require(_0x2f70('0xc'));var Papa=require(_0x2f70('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f70('0xe'));var hardwareService=require(_0x2f70('0xf'));var logger=require(_0x2f70('0x10'))(_0x2f70('0x11'));var utils=require(_0x2f70('0x12'));var config=require(_0x2f70('0x13'));var licenseUtil=require(_0x2f70('0x14'));var db=require(_0x2f70('0x15'))['db'];function respondWithStatusCode(_0x89e117,_0x42d277){_0x42d277=_0x42d277||0xcc;return function(_0x5d54e8){if(_0x5d54e8){return _0x89e117[_0x2f70('0x16')](_0x42d277);}return _0x89e117[_0x2f70('0x17')](_0x42d277)[_0x2f70('0x18')]();};}function respondWithResult(_0x5364eb,_0x234d3f){_0x234d3f=_0x234d3f||0xc8;return function(_0x1a0ac6){if(_0x1a0ac6){return _0x5364eb[_0x2f70('0x17')](_0x234d3f)[_0x2f70('0x19')](_0x1a0ac6);}};}function respondWithFilteredResult(_0x5948c0,_0x260cac){return function(_0x246acb){if(_0x246acb){var _0x2a8fdf=typeof _0x260cac[_0x2f70('0x1a')]===_0x2f70('0x1b')&&typeof _0x260cac[_0x2f70('0x1c')]==='undefined';var _0x43ad46=_0x246acb[_0x2f70('0x1d')];var _0xa1cb6e=_0x2a8fdf?0x0:_0x260cac[_0x2f70('0x1a')];var _0x197af6=_0x2a8fdf?_0x246acb[_0x2f70('0x1d')]:_0x260cac[_0x2f70('0x1a')]+_0x260cac[_0x2f70('0x1c')];var _0x3b2652;if(_0x197af6>=_0x43ad46){_0x197af6=_0x43ad46;_0x3b2652=0xc8;}else{_0x3b2652=0xce;}_0x5948c0[_0x2f70('0x17')](_0x3b2652);return _0x5948c0['set'](_0x2f70('0x1e'),_0xa1cb6e+'-'+_0x197af6+'/'+_0x43ad46)[_0x2f70('0x19')](_0x246acb);}return null;};}function patchUpdates(_0x552a11){return function(_0x1331d5){try{jsonpatch[_0x2f70('0x1f')](_0x1331d5,_0x552a11,!![]);}catch(_0x1729ad){return BPromise[_0x2f70('0x20')](_0x1729ad);}return _0x1331d5[_0x2f70('0x21')]();};}function saveUpdates(_0x587afc,_0x25eaa2){return function(_0x4c5a72){if(_0x4c5a72){return _0x4c5a72[_0x2f70('0x22')](_0x587afc)[_0x2f70('0x23')](function(_0x5980ca){return _0x5980ca;});}return null;};}function removeEntity(_0x4552b8,_0x5b517b){return function(_0x1231a7){if(_0x1231a7){return _0x1231a7['destroy']()[_0x2f70('0x23')](function(){_0x4552b8[_0x2f70('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57692b,_0x366e7c){return function(_0x4a4cff){if(!_0x4a4cff){_0x57692b[_0x2f70('0x16')](0x194);}return _0x4a4cff;};}function handleError(_0x314090,_0x2e41a8){_0x2e41a8=_0x2e41a8||0x1f4;return function(_0x24220f){logger[_0x2f70('0x24')](_0x24220f[_0x2f70('0x25')]);if(_0x24220f['name']){delete _0x24220f[_0x2f70('0x26')];}_0x314090[_0x2f70('0x17')](_0x2e41a8)[_0x2f70('0x27')](_0x24220f);};}exports[_0x2f70('0x28')]=function(_0x3bda08,_0x126823){var _0x11b361={},_0x47699d={},_0x49e902={'count':0x0,'rows':[]};var _0x297d02=_[_0x2f70('0x29')](db[_0x2f70('0x2a')][_0x2f70('0x2b')],function(_0x166325){return{'name':_0x166325[_0x2f70('0x2c')],'type':_0x166325[_0x2f70('0x2d')][_0x2f70('0x2e')]};});_0x47699d[_0x2f70('0x2f')]=_['map'](_0x297d02,_0x2f70('0x26'));_0x47699d['query']=_['keys'](_0x3bda08[_0x2f70('0x30')]);_0x47699d['filters']=_[_0x2f70('0x31')](_0x47699d[_0x2f70('0x2f')],_0x47699d['query']);_0x11b361['attributes']=_[_0x2f70('0x31')](_0x47699d['model'],qs[_0x2f70('0x32')](_0x3bda08['query'][_0x2f70('0x32')]));_0x11b361[_0x2f70('0x33')]=_0x11b361[_0x2f70('0x33')][_0x2f70('0x34')]?_0x11b361[_0x2f70('0x33')]:_0x47699d['model'];if(!_0x3bda08[_0x2f70('0x30')][_0x2f70('0x35')](_0x2f70('0x36'))){_0x11b361[_0x2f70('0x1c')]=qs[_0x2f70('0x1c')](_0x3bda08[_0x2f70('0x30')]['limit']);_0x11b361[_0x2f70('0x1a')]=qs[_0x2f70('0x1a')](_0x3bda08[_0x2f70('0x30')]['offset']);}_0x11b361['order']=qs[_0x2f70('0x37')](_0x3bda08[_0x2f70('0x30')][_0x2f70('0x37')]);_0x11b361[_0x2f70('0x38')]=qs[_0x2f70('0x39')](_[_0x2f70('0x3a')](_0x3bda08['query'],_0x47699d['filters']),_0x297d02);if(_0x3bda08['query'][_0x2f70('0x3b')]){_0x11b361[_0x2f70('0x38')]=_[_0x2f70('0x3c')](_0x11b361[_0x2f70('0x38')],{'$or':_[_0x2f70('0x29')](_0x297d02,function(_0x34ec8f){if(_0x34ec8f['type']!==_0x2f70('0x3d')){var _0x4c3370={};_0x4c3370[_0x34ec8f['name']]={'$like':'%'+_0x3bda08[_0x2f70('0x30')][_0x2f70('0x3b')]+'%'};return _0x4c3370;}})});}_0x11b361=_[_0x2f70('0x3c')]({},_0x11b361,_0x3bda08[_0x2f70('0x3e')]);var _0x26ebb8={'where':_0x11b361[_0x2f70('0x38')]};return db[_0x2f70('0x2a')][_0x2f70('0x1d')](_0x26ebb8)[_0x2f70('0x23')](function(_0x3e0f37){_0x49e902[_0x2f70('0x1d')]=_0x3e0f37;if(_0x3bda08['query'][_0x2f70('0x3f')]){_0x11b361['include']=[{'all':!![]}];}return db[_0x2f70('0x2a')][_0x2f70('0x40')](_0x11b361);})[_0x2f70('0x23')](function(_0x527f00){_0x49e902['rows']=_0x527f00;return _0x49e902;})[_0x2f70('0x23')](respondWithFilteredResult(_0x126823,_0x11b361))[_0x2f70('0x41')](handleError(_0x126823,null));};exports[_0x2f70('0x42')]=function(_0x5cf6c4,_0x28f6ed){var _0x32e2d5={'raw':!![],'where':{'id':_0x5cf6c4[_0x2f70('0x43')]['id']}},_0x442308={};_0x442308['model']=_['keys'](db[_0x2f70('0x2a')][_0x2f70('0x2b')]);_0x442308[_0x2f70('0x30')]=_['keys'](_0x5cf6c4[_0x2f70('0x30')]);_0x442308[_0x2f70('0x39')]=_[_0x2f70('0x31')](_0x442308['model'],_0x442308[_0x2f70('0x30')]);_0x32e2d5[_0x2f70('0x33')]=_['intersection'](_0x442308['model'],qs[_0x2f70('0x32')](_0x5cf6c4[_0x2f70('0x30')][_0x2f70('0x32')]));_0x32e2d5[_0x2f70('0x33')]=_0x32e2d5[_0x2f70('0x33')]['length']?_0x32e2d5['attributes']:_0x442308[_0x2f70('0x2f')];if(_0x5cf6c4[_0x2f70('0x30')][_0x2f70('0x3f')]){_0x32e2d5['include']=[{'all':!![]}];}_0x32e2d5=_[_0x2f70('0x3c')]({},_0x32e2d5,_0x5cf6c4[_0x2f70('0x3e')]);return db[_0x2f70('0x2a')]['find'](_0x32e2d5)['then'](handleEntityNotFound(_0x28f6ed,null))[_0x2f70('0x23')](respondWithResult(_0x28f6ed,null))[_0x2f70('0x41')](handleError(_0x28f6ed,null));};exports[_0x2f70('0x44')]=function(_0xd1c624,_0x4aed30){return db[_0x2f70('0x2a')][_0x2f70('0x44')](_0xd1c624['body'],{})['then'](respondWithResult(_0x4aed30,0xc9))[_0x2f70('0x41')](handleError(_0x4aed30,null));};exports['update']=function(_0x4730b3,_0x53e1a9){if(_0x4730b3[_0x2f70('0x45')]['id']){delete _0x4730b3[_0x2f70('0x45')]['id'];}return db[_0x2f70('0x2a')][_0x2f70('0x46')]({'where':{'id':_0x4730b3[_0x2f70('0x43')]['id']}})[_0x2f70('0x23')](handleEntityNotFound(_0x53e1a9,null))[_0x2f70('0x23')](saveUpdates(_0x4730b3[_0x2f70('0x45')],null))[_0x2f70('0x23')](respondWithResult(_0x53e1a9,null))[_0x2f70('0x41')](handleError(_0x53e1a9,null));};exports[_0x2f70('0x47')]=function(_0x5dc3ab,_0x1c26b0){return db[_0x2f70('0x2a')]['find']({'where':{'id':_0x5dc3ab[_0x2f70('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c26b0,null))['then'](removeEntity(_0x1c26b0,null))[_0x2f70('0x41')](handleError(_0x1c26b0,null));}; \ No newline at end of file +var _0x45c8=['catch','show','params','options','find','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','error','stack','name','send','index','FreshsalesField','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows'];(function(_0x2ee5f6,_0x3fb1ad){var _0x35c100=function(_0x2f2f12){while(--_0x2f2f12){_0x2ee5f6['push'](_0x2ee5f6['shift']());}};_0x35c100(++_0x3fb1ad);}(_0x45c8,0x179));var _0x845c=function(_0x365b23,_0x5c59b0){_0x365b23=_0x365b23-0x0;var _0x9b4dc2=_0x45c8[_0x365b23];return _0x9b4dc2;};'use strict';var emlformat=require(_0x845c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x845c('0x1'));var moment=require(_0x845c('0x2'));var BPromise=require(_0x845c('0x3'));var Mustache=require(_0x845c('0x4'));var util=require(_0x845c('0x5'));var path=require(_0x845c('0x6'));var sox=require(_0x845c('0x7'));var csv=require(_0x845c('0x8'));var ejs=require(_0x845c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x845c('0xa'));var squel=require('squel');var crypto=require(_0x845c('0xb'));var jsforce=require(_0x845c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x845c('0x8'));var querystring=require(_0x845c('0xd'));var Papa=require(_0x845c('0xe'));var Redis=require('ioredis');var authService=require(_0x845c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x845c('0x10'));var hardwareService=require(_0x845c('0x11'));var logger=require(_0x845c('0x12'))(_0x845c('0x13'));var utils=require(_0x845c('0x14'));var config=require(_0x845c('0x15'));var licenseUtil=require(_0x845c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bc6c9,_0x52c86c){_0x52c86c=_0x52c86c||0xcc;return function(_0x3e6106){if(_0x3e6106){return _0x3bc6c9[_0x845c('0x17')](_0x52c86c);}return _0x3bc6c9[_0x845c('0x18')](_0x52c86c)[_0x845c('0x19')]();};}function respondWithResult(_0x210cd5,_0x13506a){_0x13506a=_0x13506a||0xc8;return function(_0x1d8ce0){if(_0x1d8ce0){return _0x210cd5[_0x845c('0x18')](_0x13506a)[_0x845c('0x1a')](_0x1d8ce0);}};}function respondWithFilteredResult(_0xeb82d3,_0x533917){return function(_0x1ba0c4){if(_0x1ba0c4){var _0x2ca518=typeof _0x533917[_0x845c('0x1b')]===_0x845c('0x1c')&&typeof _0x533917[_0x845c('0x1d')]==='undefined';var _0x4b7d04=_0x1ba0c4[_0x845c('0x1e')];var _0x4388cc=_0x2ca518?0x0:_0x533917[_0x845c('0x1b')];var _0x1bcbab=_0x2ca518?_0x1ba0c4[_0x845c('0x1e')]:_0x533917[_0x845c('0x1b')]+_0x533917[_0x845c('0x1d')];var _0x283e24;if(_0x1bcbab>=_0x4b7d04){_0x1bcbab=_0x4b7d04;_0x283e24=0xc8;}else{_0x283e24=0xce;}_0xeb82d3[_0x845c('0x18')](_0x283e24);return _0xeb82d3[_0x845c('0x1f')](_0x845c('0x20'),_0x4388cc+'-'+_0x1bcbab+'/'+_0x4b7d04)[_0x845c('0x1a')](_0x1ba0c4);}return null;};}function patchUpdates(_0x5358e2){return function(_0x1cbb31){try{jsonpatch[_0x845c('0x21')](_0x1cbb31,_0x5358e2,!![]);}catch(_0x59e93d){return BPromise[_0x845c('0x22')](_0x59e93d);}return _0x1cbb31['save']();};}function saveUpdates(_0x3b4793,_0x27fb6d){return function(_0xc62c6a){if(_0xc62c6a){return _0xc62c6a['update'](_0x3b4793)['then'](function(_0x39845f){return _0x39845f;});}return null;};}function removeEntity(_0x5a835b,_0x2ea697){return function(_0x45f523){if(_0x45f523){return _0x45f523[_0x845c('0x23')]()['then'](function(){_0x5a835b['status'](0xcc)[_0x845c('0x19')]();});}};}function handleEntityNotFound(_0x43c9dd,_0x1197c2){return function(_0x1aa4cd){if(!_0x1aa4cd){_0x43c9dd[_0x845c('0x17')](0x194);}return _0x1aa4cd;};}function handleError(_0x287a04,_0xc2a7d){_0xc2a7d=_0xc2a7d||0x1f4;return function(_0x1bed58){logger[_0x845c('0x24')](_0x1bed58[_0x845c('0x25')]);if(_0x1bed58[_0x845c('0x26')]){delete _0x1bed58[_0x845c('0x26')];}_0x287a04[_0x845c('0x18')](_0xc2a7d)[_0x845c('0x27')](_0x1bed58);};}exports[_0x845c('0x28')]=function(_0x399ee9,_0x19e1f4){var _0x5af9a6={},_0x493813={},_0x388e70={'count':0x0,'rows':[]};var _0x845438=_['map'](db[_0x845c('0x29')][_0x845c('0x2a')],function(_0x3db476){return{'name':_0x3db476['fieldName'],'type':_0x3db476[_0x845c('0x2b')][_0x845c('0x2c')]};});_0x493813[_0x845c('0x2d')]=_[_0x845c('0x2e')](_0x845438,'name');_0x493813[_0x845c('0x2f')]=_[_0x845c('0x30')](_0x399ee9[_0x845c('0x2f')]);_0x493813[_0x845c('0x31')]=_['intersection'](_0x493813[_0x845c('0x2d')],_0x493813[_0x845c('0x2f')]);_0x5af9a6[_0x845c('0x32')]=_[_0x845c('0x33')](_0x493813[_0x845c('0x2d')],qs[_0x845c('0x34')](_0x399ee9['query']['fields']));_0x5af9a6[_0x845c('0x32')]=_0x5af9a6['attributes'][_0x845c('0x35')]?_0x5af9a6[_0x845c('0x32')]:_0x493813[_0x845c('0x2d')];if(!_0x399ee9['query'][_0x845c('0x36')](_0x845c('0x37'))){_0x5af9a6[_0x845c('0x1d')]=qs[_0x845c('0x1d')](_0x399ee9[_0x845c('0x2f')][_0x845c('0x1d')]);_0x5af9a6['offset']=qs[_0x845c('0x1b')](_0x399ee9[_0x845c('0x2f')]['offset']);}_0x5af9a6[_0x845c('0x38')]=qs[_0x845c('0x39')](_0x399ee9[_0x845c('0x2f')]['sort']);_0x5af9a6[_0x845c('0x3a')]=qs[_0x845c('0x31')](_[_0x845c('0x3b')](_0x399ee9['query'],_0x493813[_0x845c('0x31')]),_0x845438);if(_0x399ee9[_0x845c('0x2f')][_0x845c('0x3c')]){_0x5af9a6[_0x845c('0x3a')]=_[_0x845c('0x3d')](_0x5af9a6[_0x845c('0x3a')],{'$or':_['map'](_0x845438,function(_0x428e60){if(_0x428e60['type']!==_0x845c('0x3e')){var _0x1caf41={};_0x1caf41[_0x428e60[_0x845c('0x26')]]={'$like':'%'+_0x399ee9[_0x845c('0x2f')][_0x845c('0x3c')]+'%'};return _0x1caf41;}})});}_0x5af9a6=_[_0x845c('0x3d')]({},_0x5af9a6,_0x399ee9['options']);var _0x31cc77={'where':_0x5af9a6[_0x845c('0x3a')]};return db[_0x845c('0x29')][_0x845c('0x1e')](_0x31cc77)[_0x845c('0x3f')](function(_0xca0b3c){_0x388e70[_0x845c('0x1e')]=_0xca0b3c;if(_0x399ee9[_0x845c('0x2f')][_0x845c('0x40')]){_0x5af9a6[_0x845c('0x41')]=[{'all':!![]}];}return db[_0x845c('0x29')]['findAll'](_0x5af9a6);})[_0x845c('0x3f')](function(_0x1a00e5){_0x388e70[_0x845c('0x42')]=_0x1a00e5;return _0x388e70;})['then'](respondWithFilteredResult(_0x19e1f4,_0x5af9a6))[_0x845c('0x43')](handleError(_0x19e1f4,null));};exports[_0x845c('0x44')]=function(_0xf9b8c8,_0x4623f5){var _0x4606e8={'raw':!![],'where':{'id':_0xf9b8c8[_0x845c('0x45')]['id']}},_0x24bed4={};_0x24bed4['model']=_[_0x845c('0x30')](db[_0x845c('0x29')][_0x845c('0x2a')]);_0x24bed4[_0x845c('0x2f')]=_['keys'](_0xf9b8c8[_0x845c('0x2f')]);_0x24bed4[_0x845c('0x31')]=_[_0x845c('0x33')](_0x24bed4['model'],_0x24bed4['query']);_0x4606e8[_0x845c('0x32')]=_['intersection'](_0x24bed4['model'],qs[_0x845c('0x34')](_0xf9b8c8[_0x845c('0x2f')][_0x845c('0x34')]));_0x4606e8[_0x845c('0x32')]=_0x4606e8['attributes'][_0x845c('0x35')]?_0x4606e8[_0x845c('0x32')]:_0x24bed4[_0x845c('0x2d')];if(_0xf9b8c8['query'][_0x845c('0x40')]){_0x4606e8[_0x845c('0x41')]=[{'all':!![]}];}_0x4606e8=_[_0x845c('0x3d')]({},_0x4606e8,_0xf9b8c8[_0x845c('0x46')]);return db[_0x845c('0x29')][_0x845c('0x47')](_0x4606e8)[_0x845c('0x3f')](handleEntityNotFound(_0x4623f5,null))[_0x845c('0x3f')](respondWithResult(_0x4623f5,null))[_0x845c('0x43')](handleError(_0x4623f5,null));};exports[_0x845c('0x48')]=function(_0x274ed8,_0x3bdc25){return db[_0x845c('0x29')][_0x845c('0x48')](_0x274ed8[_0x845c('0x49')],{})[_0x845c('0x3f')](respondWithResult(_0x3bdc25,0xc9))[_0x845c('0x43')](handleError(_0x3bdc25,null));};exports['update']=function(_0x52a5f4,_0x37dbc8){if(_0x52a5f4[_0x845c('0x49')]['id']){delete _0x52a5f4[_0x845c('0x49')]['id'];}return db['FreshsalesField'][_0x845c('0x47')]({'where':{'id':_0x52a5f4[_0x845c('0x45')]['id']}})['then'](handleEntityNotFound(_0x37dbc8,null))[_0x845c('0x3f')](saveUpdates(_0x52a5f4[_0x845c('0x49')],null))[_0x845c('0x3f')](respondWithResult(_0x37dbc8,null))[_0x845c('0x43')](handleError(_0x37dbc8,null));};exports[_0x845c('0x23')]=function(_0x3cbaaf,_0x47d57e){return db[_0x845c('0x29')]['find']({'where':{'id':_0x3cbaaf[_0x845c('0x45')]['id']}})[_0x845c('0x3f')](handleEntityNotFound(_0x47d57e,null))[_0x845c('0x3f')](removeEntity(_0x47d57e,null))['catch'](handleError(_0x47d57e,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index aadc527..fdac3bc 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 _0x34bd=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesField'];(function(_0x37ca90,_0x97f42){var _0x293428=function(_0x79b7c3){while(--_0x79b7c3){_0x37ca90['push'](_0x37ca90['shift']());}};_0x293428(++_0x97f42);}(_0x34bd,0x1d2));var _0xd34b=function(_0x8f270,_0x2f435f){_0x8f270=_0x8f270-0x0;var _0x5446cb=_0x34bd[_0x8f270];return _0x5446cb;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require(_0xd34b('0x3'));var rp=require(_0xd34b('0x4'));var fs=require('fs');var path=require(_0xd34b('0x5'));var rimraf=require(_0xd34b('0x6'));var config=require(_0xd34b('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xd34b('0x8')]=function(_0x5d161e,_0x4e6e94){return _0x5d161e['define'](_0xd34b('0x9'),attributes,{'tableName':_0xd34b('0xa'),'paranoid':![],'indexes':[{'name':_0xd34b('0xb'),'fields':[_0xd34b('0xc'),_0xd34b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdc2=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intFreshsalesField.attributes'];(function(_0x461ab0,_0x4e88ce){var _0x23227a=function(_0x2d31b8){while(--_0x2d31b8){_0x461ab0['push'](_0x461ab0['shift']());}};_0x23227a(++_0x4e88ce);}(_0xbdc2,0x148));var _0x2bdc=function(_0x584e52,_0x5443dc){_0x584e52=_0x584e52-0x0;var _0x5cf710=_0xbdc2[_0x584e52];return _0x5cf710;};'use strict';var _=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var logger=require(_0x2bdc('0x2'))(_0x2bdc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2bdc('0x4'));var fs=require('fs');var path=require(_0x2bdc('0x5'));var rimraf=require('rimraf');var config=require(_0x2bdc('0x6'));var attributes=require(_0x2bdc('0x7'));module['exports']=function(_0x1a4381,_0x4bf5cd){return _0x1a4381[_0x2bdc('0x8')](_0x2bdc('0x9'),attributes,{'tableName':_0x2bdc('0xa'),'paranoid':![],'indexes':[{'name':_0x2bdc('0xb'),'fields':[_0x2bdc('0xc'),_0x2bdc('0xd')],'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 2cb7143..17abb7f 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 _0x6f47=['request\x20sent','debug','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x6f47,0xc7));var _0x76f4=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6f47[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){return client[_0x76f4('0x9')](_0xfc2405,_0x497f99)[_0x76f4('0xa')](function(_0x101f55){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2176a7,_0x76f4('0xb'));logger[_0x76f4('0xc')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2176a7,'request\x20sent',JSON[_0x76f4('0xd')](_0x101f55));if(_0x101f55[_0x76f4('0xe')]){if(_0x101f55[_0x76f4('0xe')][_0x76f4('0xf')]===0x1f4){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55[_0x76f4('0xe')][_0x76f4('0x11')]);return _0x25656d(_0x101f55[_0x76f4('0xe')]['message']);}logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55['error']['message']);return _0x1a3172(_0x101f55['error'][_0x76f4('0x11')]);}else{logger[_0x76f4('0x12')](_0x76f4('0x10'),_0x2176a7,_0x76f4('0xb'));_0x1a3172(_0x101f55[_0x76f4('0x13')][_0x76f4('0x11')]);}})[_0x76f4('0x14')](function(_0x981a87){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x981a87);_0x25656d(_0x981a87);});});} \ No newline at end of file +var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x52bc4f,_0xfa72dc){var _0x53e887=function(_0x220e4e){while(--_0x220e4e){_0x52bc4f['push'](_0x52bc4f['shift']());}};_0x53e887(++_0xfa72dc);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d5ffc20..ce0fd80 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 _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(_0x46184e,_0x44e304){var _0x492c69=function(_0x3a865c){while(--_0x3a865c){_0x46184e['push'](_0x46184e['shift']());}};_0x492c69(++_0x44e304);}(_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['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 _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(_0x342d35,_0x14e940){var _0x31f19e=function(_0x4c6b04){while(--_0x4c6b04){_0x342d35['push'](_0x342d35['shift']());}};_0x31f19e(++_0x14e940);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 2831706..ef7e5df 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 _0x61d0=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x61d0,0x187));var _0x061d=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x61d0[_0x21b762];return _0x2ea6d4;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'name':{'type':Sequelize[_0x061d('0x1')]},'description':{'type':Sequelize[_0x061d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x061d('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x061d('0x1')]},'clientId':{'type':Sequelize[_0x061d('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x061d('0x1')]},'serverUrl':{'type':Sequelize[_0x061d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x061d('0x3')](_0x061d('0x4'),_0x061d('0x5')),'defaultValue':_0x061d('0x4')}}; \ No newline at end of file +var _0x81cb=['sequelize','exports','STRING','newTab','integrationTab'];(function(_0x4ff38c,_0x26601d){var _0x4c6edb=function(_0x16ec39){while(--_0x16ec39){_0x4ff38c['push'](_0x4ff38c['shift']());}};_0x4c6edb(++_0x26601d);}(_0x81cb,0xaa));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb81c('0x2')]},'username':{'type':Sequelize[_0xb81c('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb81c('0x2')]},'password':{'type':Sequelize[_0xb81c('0x2')]},'clientId':{'type':Sequelize[_0xb81c('0x2')]},'clientSecret':{'type':Sequelize[_0xb81c('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb81c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xb81c('0x3')),'defaultValue':_0xb81c('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 33a801f..7c91692 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 _0xde18=['pick','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','create','Subjects','Descriptions','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','type','label','custom','picklistValues','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','getConfigurations','SalesforceConfiguration'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xde18,0x1b6));var _0x8de1=function(_0x55f64c,_0x361c1e){_0x55f64c=_0x55f64c-0x0;var _0x44f551=_0xde18[_0x55f64c];return _0x44f551;};'use strict';var emlformat=require(_0x8de1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8de1('0x1'));var jsonpatch=require(_0x8de1('0x2'));var rp=require(_0x8de1('0x3'));var moment=require(_0x8de1('0x4'));var BPromise=require(_0x8de1('0x5'));var Mustache=require(_0x8de1('0x6'));var util=require(_0x8de1('0x7'));var path=require(_0x8de1('0x8'));var sox=require(_0x8de1('0x9'));var csv=require(_0x8de1('0xa'));var ejs=require(_0x8de1('0xb'));var fs=require('fs');var fs_extra=require(_0x8de1('0xc'));var _=require('lodash');var squel=require(_0x8de1('0xd'));var crypto=require(_0x8de1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8de1('0xf'));var toCsv=require(_0x8de1('0xa'));var querystring=require(_0x8de1('0x10'));var Papa=require(_0x8de1('0x11'));var Redis=require(_0x8de1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8de1('0x13'));var as=require(_0x8de1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8de1('0x15'))(_0x8de1('0x16'));var utils=require(_0x8de1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8de1('0x18'));var db=require(_0x8de1('0x19'))['db'];var integrations=require(_0x8de1('0x1a'));function respondWithStatusCode(_0x3ecb9e,_0x5db8d4){_0x5db8d4=_0x5db8d4||0xcc;return function(_0x200481){if(_0x200481){return _0x3ecb9e[_0x8de1('0x1b')](_0x5db8d4);}return _0x3ecb9e[_0x8de1('0x1c')](_0x5db8d4)[_0x8de1('0x1d')]();};}function respondWithResult(_0x6c9615,_0x198db8){_0x198db8=_0x198db8||0xc8;return function(_0x40a142){if(_0x40a142){return _0x6c9615[_0x8de1('0x1c')](_0x198db8)[_0x8de1('0x1e')](_0x40a142);}};}function respondWithFilteredResult(_0x1a7697,_0x314db4){return function(_0xb88024){if(_0xb88024){var _0x319131=typeof _0x314db4[_0x8de1('0x1f')]===_0x8de1('0x20')&&typeof _0x314db4[_0x8de1('0x21')]===_0x8de1('0x20');var _0x1ce198=_0xb88024[_0x8de1('0x22')];var _0x496cf7=_0x319131?0x0:_0x314db4[_0x8de1('0x1f')];var _0x1f90b7=_0x319131?_0xb88024['count']:_0x314db4[_0x8de1('0x1f')]+_0x314db4[_0x8de1('0x21')];var _0x1855f4;if(_0x1f90b7>=_0x1ce198){_0x1f90b7=_0x1ce198;_0x1855f4=0xc8;}else{_0x1855f4=0xce;}_0x1a7697[_0x8de1('0x1c')](_0x1855f4);return _0x1a7697[_0x8de1('0x23')](_0x8de1('0x24'),_0x496cf7+'-'+_0x1f90b7+'/'+_0x1ce198)['json'](_0xb88024);}return null;};}function patchUpdates(_0x13ce31){return function(_0x93b08c){try{jsonpatch[_0x8de1('0x25')](_0x93b08c,_0x13ce31,!![]);}catch(_0x56a042){return BPromise['reject'](_0x56a042);}return _0x93b08c[_0x8de1('0x26')]();};}function saveUpdates(_0x33ff3f,_0xbb110){return function(_0x4092b0){if(_0x4092b0){return _0x4092b0[_0x8de1('0x27')](_0x33ff3f)['then'](function(_0x769067){return _0x769067;});}return null;};}function removeEntity(_0x1909cf,_0x3e24cf){return function(_0x4cd0f1){if(_0x4cd0f1){return _0x4cd0f1[_0x8de1('0x28')]()[_0x8de1('0x29')](function(){_0x1909cf[_0x8de1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9f48,_0x43f8b7){return function(_0x1961dd){if(!_0x1961dd){_0x4c9f48[_0x8de1('0x1b')](0x194);}return _0x1961dd;};}function handleError(_0x2e72bd,_0xcbc409){_0xcbc409=_0xcbc409||0x1f4;return function(_0x4425ac){logger[_0x8de1('0x2a')](_0x4425ac[_0x8de1('0x2b')]);if(_0x4425ac[_0x8de1('0x2c')]){delete _0x4425ac[_0x8de1('0x2c')];}_0x2e72bd[_0x8de1('0x1c')](_0xcbc409)[_0x8de1('0x2d')](_0x4425ac);};}exports[_0x8de1('0x2e')]=function(_0x377192,_0x3ecdab){var _0x3b372d={},_0x1ba20e={},_0x498a73={'count':0x0,'rows':[]};var _0x1365fe=_[_0x8de1('0x2f')](db['SalesforceAccount']['rawAttributes'],function(_0x796dac){return{'name':_0x796dac['fieldName'],'type':_0x796dac['type'][_0x8de1('0x30')]};});_0x1ba20e[_0x8de1('0x31')]=_[_0x8de1('0x2f')](_0x1365fe,'name');_0x1ba20e['query']=_[_0x8de1('0x32')](_0x377192[_0x8de1('0x33')]);_0x1ba20e[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x1ba20e[_0x8de1('0x31')],_0x1ba20e[_0x8de1('0x33')]);_0x3b372d[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x1ba20e[_0x8de1('0x31')],qs[_0x8de1('0x37')](_0x377192['query'][_0x8de1('0x37')]));_0x3b372d[_0x8de1('0x36')]=_0x3b372d[_0x8de1('0x36')]['length']?_0x3b372d['attributes']:_0x1ba20e['model'];if(!_0x377192[_0x8de1('0x33')]['hasOwnProperty'](_0x8de1('0x38'))){_0x3b372d['limit']=qs['limit'](_0x377192[_0x8de1('0x33')][_0x8de1('0x21')]);_0x3b372d['offset']=qs[_0x8de1('0x1f')](_0x377192[_0x8de1('0x33')][_0x8de1('0x1f')]);}_0x3b372d[_0x8de1('0x39')]=qs[_0x8de1('0x3a')](_0x377192[_0x8de1('0x33')][_0x8de1('0x3a')]);_0x3b372d[_0x8de1('0x3b')]=qs[_0x8de1('0x34')](_['pick'](_0x377192['query'],_0x1ba20e[_0x8de1('0x34')]),_0x1365fe);if(_0x377192[_0x8de1('0x33')][_0x8de1('0x3c')]){_0x3b372d[_0x8de1('0x3b')]=_[_0x8de1('0x3d')](_0x3b372d[_0x8de1('0x3b')],{'$or':_[_0x8de1('0x2f')](_0x1365fe,function(_0x18fc47){if(_0x18fc47['type']!==_0x8de1('0x3e')){var _0x126ce8={};_0x126ce8[_0x18fc47['name']]={'$like':'%'+_0x377192[_0x8de1('0x33')][_0x8de1('0x3c')]+'%'};return _0x126ce8;}})});}_0x3b372d=_['merge']({},_0x3b372d,_0x377192[_0x8de1('0x3f')]);var _0x105518={'where':_0x3b372d['where']};return db[_0x8de1('0x40')][_0x8de1('0x22')](_0x105518)['then'](function(_0xa44397){_0x498a73[_0x8de1('0x22')]=_0xa44397;if(_0x377192['query'][_0x8de1('0x41')]){_0x3b372d[_0x8de1('0x42')]=[{'all':!![]}];}return db[_0x8de1('0x40')][_0x8de1('0x43')](_0x3b372d);})[_0x8de1('0x29')](function(_0x554680){_0x498a73[_0x8de1('0x44')]=_0x554680;return _0x498a73;})['then'](respondWithFilteredResult(_0x3ecdab,_0x3b372d))['catch'](handleError(_0x3ecdab,null));};exports[_0x8de1('0x45')]=function(_0x5c476b,_0x4f8eea){var _0x3edb78={'raw':![],'where':{'id':_0x5c476b[_0x8de1('0x46')]['id']}},_0x2e6689={};_0x2e6689[_0x8de1('0x31')]=_[_0x8de1('0x32')](db[_0x8de1('0x40')][_0x8de1('0x47')]);_0x2e6689[_0x8de1('0x33')]=_[_0x8de1('0x32')](_0x5c476b[_0x8de1('0x33')]);_0x2e6689[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x2e6689[_0x8de1('0x31')],_0x2e6689[_0x8de1('0x33')]);_0x3edb78[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x2e6689['model'],qs[_0x8de1('0x37')](_0x5c476b[_0x8de1('0x33')][_0x8de1('0x37')]));_0x3edb78[_0x8de1('0x36')]=_0x3edb78[_0x8de1('0x36')][_0x8de1('0x48')]?_0x3edb78[_0x8de1('0x36')]:_0x2e6689[_0x8de1('0x31')];if(_0x5c476b['query']['includeAll']){_0x3edb78[_0x8de1('0x42')]=[{'all':!![]}];}_0x3edb78=_[_0x8de1('0x3d')]({},_0x3edb78,_0x5c476b[_0x8de1('0x3f')]);return db[_0x8de1('0x40')]['find'](_0x3edb78)[_0x8de1('0x29')](handleEntityNotFound(_0x4f8eea,null))['then'](respondWithResult(_0x4f8eea,null))[_0x8de1('0x49')](handleError(_0x4f8eea,null));};exports['create']=function(_0x5169cf,_0x57bc81){return db[_0x8de1('0x40')]['create'](_0x5169cf[_0x8de1('0x4a')],{})[_0x8de1('0x29')](respondWithResult(_0x57bc81,0xc9))[_0x8de1('0x49')](handleError(_0x57bc81,null));};exports[_0x8de1('0x27')]=function(_0x47d1af,_0x439d54){if(_0x47d1af['body']['id']){delete _0x47d1af[_0x8de1('0x4a')]['id'];}return db[_0x8de1('0x40')][_0x8de1('0x4b')]({'where':{'id':_0x47d1af[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x439d54,null))[_0x8de1('0x29')](saveUpdates(_0x47d1af[_0x8de1('0x4a')],null))[_0x8de1('0x29')](respondWithResult(_0x439d54,null))['catch'](handleError(_0x439d54,null));};exports[_0x8de1('0x28')]=function(_0xb1af20,_0x105859){return db['SalesforceAccount'][_0x8de1('0x4b')]({'where':{'id':_0xb1af20[_0x8de1('0x46')]['id']}})['then'](handleEntityNotFound(_0x105859,null))['then'](removeEntity(_0x105859,null))[_0x8de1('0x49')](handleError(_0x105859,null));};exports[_0x8de1('0x4c')]=function(_0x6e7f67,_0x5e0ced,_0xa8fa79){var _0x44e378={};var _0x2094d0={};var _0x27c020;var _0x411fbf;return db[_0x8de1('0x40')]['findOne']({'where':{'id':_0x6e7f67[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x5e0ced,null))[_0x8de1('0x29')](function(_0x234485){if(_0x234485){_0x27c020=_0x234485;_0x2094d0[_0x8de1('0x31')]=_[_0x8de1('0x32')](db[_0x8de1('0x4d')][_0x8de1('0x47')]);_0x2094d0[_0x8de1('0x33')]=_[_0x8de1('0x32')](_0x6e7f67['query']);_0x2094d0[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x2094d0[_0x8de1('0x31')],_0x2094d0['query']);_0x44e378[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x2094d0[_0x8de1('0x31')],qs[_0x8de1('0x37')](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x37')]));_0x44e378['attributes']=_0x44e378[_0x8de1('0x36')][_0x8de1('0x48')]?_0x44e378[_0x8de1('0x36')]:_0x2094d0['model'];_0x44e378[_0x8de1('0x39')]=qs[_0x8de1('0x3a')](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3a')]);_0x44e378[_0x8de1('0x3b')]=qs['filters'](_[_0x8de1('0x4e')](_0x6e7f67[_0x8de1('0x33')],_0x2094d0['filters']));if(_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3c')]){_0x44e378[_0x8de1('0x3b')]=_['merge'](_0x44e378[_0x8de1('0x3b')],{'$or':_[_0x8de1('0x2f')](_0x44e378[_0x8de1('0x36')],function(_0x2d1881){var _0x18528d={};_0x18528d[_0x2d1881]={'$like':'%'+_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3c')]+'%'};return _0x18528d;})});}_0x44e378=_[_0x8de1('0x3d')]({},_0x44e378,_0x6e7f67[_0x8de1('0x3f')]);return _0x27c020[_0x8de1('0x4c')](_0x44e378);}})['then'](function(_0x5be04a){if(_0x5be04a){_0x411fbf=_0x5be04a[_0x8de1('0x48')];if(!_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x4f')](_0x8de1('0x38'))){_0x44e378['limit']=qs['limit'](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x21')]);_0x44e378['offset']=qs[_0x8de1('0x1f')](_0x6e7f67[_0x8de1('0x33')]['offset']);}return _0x27c020['getConfigurations'](_0x44e378);}})[_0x8de1('0x29')](function(_0x5a89b2){if(_0x5a89b2){return _0x5a89b2?{'count':_0x411fbf,'rows':_0x5a89b2}:null;}})[_0x8de1('0x29')](respondWithResult(_0x5e0ced,null))[_0x8de1('0x49')](handleError(_0x5e0ced,null));};exports[_0x8de1('0x50')]=function(_0x5eed21,_0x3da51e,_0x5101f9){if(_0x5eed21[_0x8de1('0x4a')]['id']){delete _0x5eed21['body']['id'];}return db['SalesforceAccount'][_0x8de1('0x51')]({'where':{'id':_0x5eed21[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x3da51e,null))['then'](function(_0x1855b1){if(_0x1855b1){_0x5eed21['body']['AccountId']=_0x1855b1['id'];_0x5eed21[_0x8de1('0x4a')]['Subjects']=integrations[_0x8de1('0x52')](_0x5eed21['body'][_0x8de1('0x53')],_0x5eed21[_0x8de1('0x4a')]['type']);_0x5eed21[_0x8de1('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x5eed21['body'][_0x8de1('0x53')],_0x5eed21[_0x8de1('0x4a')]['type']);return db[_0x8de1('0x4d')][_0x8de1('0x54')](_0x5eed21[_0x8de1('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0x8de1('0x55')},{'model':db['SalesforceField'],'as':_0x8de1('0x56')}]});}return null;})[_0x8de1('0x29')](respondWithResult(_0x3da51e,null))[_0x8de1('0x49')](handleError(_0x3da51e,null));};exports[_0x8de1('0x57')]=function(_0x218413,_0x42db4d,_0x1c05ff){var _0x32d6fc;var _0x43e495='';var _0xebe00b=_0x8de1('0x58');return db['SalesforceAccount'][_0x8de1('0x51')]({'where':{'id':_0x218413['params']['id']},'attributes':['id',_0x8de1('0x59'),_0x8de1('0x5a'),'clientSecret',_0x8de1('0x5b'),_0x8de1('0x5c'),_0x8de1('0x5d')]})[_0x8de1('0x29')](handleEntityNotFound(_0x42db4d,null))[_0x8de1('0x29')](function(_0x1b391a){if(_0x1b391a){_0x43e495=_0x1b391a[_0x8de1('0x59')];var _0x3a99f5=_0x43e495[_0x8de1('0x5e')](-0x1);if(_0x3a99f5==='/'){_0x43e495=_0x43e495['substring'](0x0,_0x43e495[_0x8de1('0x5f')](_0x3a99f5));}_0x32d6fc=new jsforce[(_0x8de1('0x60'))]({'oauth2':{'loginUrl':_0x43e495,'clientId':_0x1b391a[_0x8de1('0x5a')],'clientSecret':_0x1b391a[_0x8de1('0x61')]}});return _0x32d6fc[_0x8de1('0x62')](_0x1b391a[_0x8de1('0x5b')],_0x1b391a[_0x8de1('0x5c')][_0x8de1('0x63')](_0x1b391a['securityToken']));}})['then'](function(_0x1b83ad){if(_0x1b83ad){if(!_[_0x8de1('0x64')](_0x218413['query'][_0x8de1('0x65')])){_0xebe00b=_0x218413[_0x8de1('0x33')][_0x8de1('0x65')];}return _0x32d6fc[_0x8de1('0x66')](_0xebe00b)[_0x8de1('0x67')]();}})[_0x8de1('0x29')](function(_0x3f830e){var _0x599b73=[_0x8de1('0x68'),'ActivityDate',_0x8de1('0x69'),_0x8de1('0x6a'),_0x8de1('0x6b'),_0x8de1('0x6c')];var _0x31b168=[_0x8de1('0x6d'),'int',_0x8de1('0x6e'),_0x8de1('0x6f'),_0x8de1('0x70'),_0x8de1('0x71'),_0x8de1('0x72')];if(_0x3f830e){_[_0x8de1('0x73')](_0x3f830e[_0x8de1('0x37')],function(_0x1aa13f){return _0x599b73['includes'](_0x1aa13f[_0x8de1('0x2c')])||!_0x31b168[_0x8de1('0x74')](_0x1aa13f[_0x8de1('0x75')]);});return{'count':_0x3f830e[_0x8de1('0x37')][_0x8de1('0x48')],'rows':_[_0x8de1('0x2f')](_0x3f830e[_0x8de1('0x37')],function(_0x54592f){return{'id':_0x54592f[_0x8de1('0x2c')],'name':_0x54592f[_0x8de1('0x76')],'custom':_0x54592f[_0x8de1('0x77')],'options':_0x54592f['picklistValues'][_0x8de1('0x48')]>0x0?_['map'](_0x54592f[_0x8de1('0x78')],function(_0x851e98){return{'name':_0x851e98[_0x8de1('0x76')],'value':_0x851e98[_0x8de1('0x79')]};}):_0x54592f[_0x8de1('0x75')]==_0x8de1('0x6f')?[{'name':_0x8de1('0x7a'),'value':_0x8de1('0x7b')},{'name':_0x8de1('0x7c'),'value':_0x8de1('0x7d')}]:[]};})};}})['then'](respondWithResult(_0x42db4d,null))[_0x8de1('0x49')](function(_0xba4d11){var _0x940701=_0x218413[_0x8de1('0x33')][_0x8de1('0x7e')]?0x1f4:_0xba4d11[_0x8de1('0x7f')]||0x1f4;logger[_0x8de1('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x8de1('0x57'),_0x940701,JSON['stringify'](_0xba4d11));delete _0xba4d11[_0x8de1('0x2c')];if(_0x940701===0x191){_0x940701=0x190;}_0x42db4d[_0x8de1('0x1c')](_0x940701)[_0x8de1('0x2d')](_0x218413[_0x8de1('0x33')]['test']?{'message':_0x8de1('0x80'),'statusCode':_0xba4d11[_0x8de1('0x7f')]}:_0xba4d11);});}; \ No newline at end of file +var _0x7b1f=['login','username','password','concat','ticketType','sobject','describe','OwnerId','Subject','Description','int','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','False','false','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','update','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','model','keys','find','create','body','findOne','SalesforceConfiguration','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','clientId'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7b1f,0x94));var _0xf7b1=function(_0x2c7854,_0x4b665d){_0x2c7854=_0x2c7854-0x0;var _0x538345=_0x7b1f[_0x2c7854];return _0x538345;};'use strict';var emlformat=require(_0xf7b1('0x0'));var rimraf=require(_0xf7b1('0x1'));var zipdir=require(_0xf7b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7b1('0x3'));var moment=require(_0xf7b1('0x4'));var BPromise=require(_0xf7b1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf7b1('0x6'));var sox=require(_0xf7b1('0x7'));var csv=require('to-csv');var ejs=require(_0xf7b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7b1('0x9'));var squel=require(_0xf7b1('0xa'));var crypto=require('crypto');var jsforce=require(_0xf7b1('0xb'));var deskjs=require(_0xf7b1('0xc'));var toCsv=require(_0xf7b1('0xd'));var querystring=require(_0xf7b1('0xe'));var Papa=require(_0xf7b1('0xf'));var Redis=require('ioredis');var authService=require(_0xf7b1('0x10'));var qs=require(_0xf7b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7b1('0x12'));var logger=require(_0xf7b1('0x13'))(_0xf7b1('0x14'));var utils=require(_0xf7b1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf7b1('0x16'));function respondWithStatusCode(_0x2644ce,_0x558927){_0x558927=_0x558927||0xcc;return function(_0x362b11){if(_0x362b11){return _0x2644ce[_0xf7b1('0x17')](_0x558927);}return _0x2644ce['status'](_0x558927)[_0xf7b1('0x18')]();};}function respondWithResult(_0xe6cc35,_0x5183cf){_0x5183cf=_0x5183cf||0xc8;return function(_0x27c714){if(_0x27c714){return _0xe6cc35[_0xf7b1('0x19')](_0x5183cf)[_0xf7b1('0x1a')](_0x27c714);}};}function respondWithFilteredResult(_0x1f1bc5,_0x51fbd3){return function(_0x1ad781){if(_0x1ad781){var _0x426a53=typeof _0x51fbd3['offset']==='undefined'&&typeof _0x51fbd3[_0xf7b1('0x1b')]==='undefined';var _0x192671=_0x1ad781[_0xf7b1('0x1c')];var _0x2cdfb5=_0x426a53?0x0:_0x51fbd3['offset'];var _0x5a3db4=_0x426a53?_0x1ad781[_0xf7b1('0x1c')]:_0x51fbd3[_0xf7b1('0x1d')]+_0x51fbd3['limit'];var _0x390208;if(_0x5a3db4>=_0x192671){_0x5a3db4=_0x192671;_0x390208=0xc8;}else{_0x390208=0xce;}_0x1f1bc5[_0xf7b1('0x19')](_0x390208);return _0x1f1bc5[_0xf7b1('0x1e')](_0xf7b1('0x1f'),_0x2cdfb5+'-'+_0x5a3db4+'/'+_0x192671)[_0xf7b1('0x1a')](_0x1ad781);}return null;};}function patchUpdates(_0x49ea39){return function(_0x208a53){try{jsonpatch[_0xf7b1('0x20')](_0x208a53,_0x49ea39,!![]);}catch(_0x1c78a9){return BPromise['reject'](_0x1c78a9);}return _0x208a53['save']();};}function saveUpdates(_0x151686,_0x3b1090){return function(_0x2dffc3){if(_0x2dffc3){return _0x2dffc3[_0xf7b1('0x21')](_0x151686)['then'](function(_0x48256d){return _0x48256d;});}return null;};}function removeEntity(_0x8f3d3,_0x5a1361){return function(_0x5a4e85){if(_0x5a4e85){return _0x5a4e85[_0xf7b1('0x22')]()['then'](function(){_0x8f3d3['status'](0xcc)[_0xf7b1('0x18')]();});}};}function handleEntityNotFound(_0x242c06,_0x3a922f){return function(_0x542573){if(!_0x542573){_0x242c06[_0xf7b1('0x17')](0x194);}return _0x542573;};}function handleError(_0x196f38,_0x164ff7){_0x164ff7=_0x164ff7||0x1f4;return function(_0x33bee6){logger[_0xf7b1('0x23')](_0x33bee6[_0xf7b1('0x24')]);if(_0x33bee6[_0xf7b1('0x25')]){delete _0x33bee6[_0xf7b1('0x25')];}_0x196f38[_0xf7b1('0x19')](_0x164ff7)[_0xf7b1('0x26')](_0x33bee6);};}exports[_0xf7b1('0x27')]=function(_0x5c4dd4,_0x486e18){var _0x3ad925={},_0x422aa7={},_0x403926={'count':0x0,'rows':[]};var _0x42afc6=_[_0xf7b1('0x28')](db[_0xf7b1('0x29')][_0xf7b1('0x2a')],function(_0x11d7d3){return{'name':_0x11d7d3[_0xf7b1('0x2b')],'type':_0x11d7d3[_0xf7b1('0x2c')]['key']};});_0x422aa7['model']=_[_0xf7b1('0x28')](_0x42afc6,_0xf7b1('0x25'));_0x422aa7[_0xf7b1('0x2d')]=_['keys'](_0x5c4dd4[_0xf7b1('0x2d')]);_0x422aa7[_0xf7b1('0x2e')]=_[_0xf7b1('0x2f')](_0x422aa7['model'],_0x422aa7[_0xf7b1('0x2d')]);_0x3ad925[_0xf7b1('0x30')]=_[_0xf7b1('0x2f')](_0x422aa7['model'],qs[_0xf7b1('0x31')](_0x5c4dd4[_0xf7b1('0x2d')][_0xf7b1('0x31')]));_0x3ad925['attributes']=_0x3ad925[_0xf7b1('0x30')][_0xf7b1('0x32')]?_0x3ad925[_0xf7b1('0x30')]:_0x422aa7['model'];if(!_0x5c4dd4[_0xf7b1('0x2d')][_0xf7b1('0x33')]('nolimit')){_0x3ad925[_0xf7b1('0x1b')]=qs[_0xf7b1('0x1b')](_0x5c4dd4[_0xf7b1('0x2d')]['limit']);_0x3ad925[_0xf7b1('0x1d')]=qs[_0xf7b1('0x1d')](_0x5c4dd4[_0xf7b1('0x2d')][_0xf7b1('0x1d')]);}_0x3ad925['order']=qs['sort'](_0x5c4dd4[_0xf7b1('0x2d')][_0xf7b1('0x34')]);_0x3ad925[_0xf7b1('0x35')]=qs[_0xf7b1('0x2e')](_[_0xf7b1('0x36')](_0x5c4dd4[_0xf7b1('0x2d')],_0x422aa7[_0xf7b1('0x2e')]),_0x42afc6);if(_0x5c4dd4[_0xf7b1('0x2d')]['filter']){_0x3ad925[_0xf7b1('0x35')]=_[_0xf7b1('0x37')](_0x3ad925['where'],{'$or':_[_0xf7b1('0x28')](_0x42afc6,function(_0x257a99){if(_0x257a99[_0xf7b1('0x2c')]!==_0xf7b1('0x38')){var _0x698131={};_0x698131[_0x257a99['name']]={'$like':'%'+_0x5c4dd4[_0xf7b1('0x2d')][_0xf7b1('0x39')]+'%'};return _0x698131;}})});}_0x3ad925=_['merge']({},_0x3ad925,_0x5c4dd4[_0xf7b1('0x3a')]);var _0xb9702e={'where':_0x3ad925[_0xf7b1('0x35')]};return db[_0xf7b1('0x29')]['count'](_0xb9702e)[_0xf7b1('0x3b')](function(_0x5cb2f0){_0x403926[_0xf7b1('0x1c')]=_0x5cb2f0;if(_0x5c4dd4['query'][_0xf7b1('0x3c')]){_0x3ad925[_0xf7b1('0x3d')]=[{'all':!![]}];}return db[_0xf7b1('0x29')][_0xf7b1('0x3e')](_0x3ad925);})[_0xf7b1('0x3b')](function(_0x2c281d){_0x403926[_0xf7b1('0x3f')]=_0x2c281d;return _0x403926;})['then'](respondWithFilteredResult(_0x486e18,_0x3ad925))[_0xf7b1('0x40')](handleError(_0x486e18,null));};exports[_0xf7b1('0x41')]=function(_0x4a4763,_0x55fd07){var _0x38f162={'raw':![],'where':{'id':_0x4a4763[_0xf7b1('0x42')]['id']}},_0x457505={};_0x457505[_0xf7b1('0x43')]=_[_0xf7b1('0x44')](db[_0xf7b1('0x29')][_0xf7b1('0x2a')]);_0x457505['query']=_['keys'](_0x4a4763['query']);_0x457505['filters']=_[_0xf7b1('0x2f')](_0x457505[_0xf7b1('0x43')],_0x457505[_0xf7b1('0x2d')]);_0x38f162[_0xf7b1('0x30')]=_[_0xf7b1('0x2f')](_0x457505[_0xf7b1('0x43')],qs[_0xf7b1('0x31')](_0x4a4763[_0xf7b1('0x2d')][_0xf7b1('0x31')]));_0x38f162['attributes']=_0x38f162[_0xf7b1('0x30')]['length']?_0x38f162[_0xf7b1('0x30')]:_0x457505[_0xf7b1('0x43')];if(_0x4a4763[_0xf7b1('0x2d')][_0xf7b1('0x3c')]){_0x38f162[_0xf7b1('0x3d')]=[{'all':!![]}];}_0x38f162=_['merge']({},_0x38f162,_0x4a4763[_0xf7b1('0x3a')]);return db['SalesforceAccount'][_0xf7b1('0x45')](_0x38f162)[_0xf7b1('0x3b')](handleEntityNotFound(_0x55fd07,null))['then'](respondWithResult(_0x55fd07,null))[_0xf7b1('0x40')](handleError(_0x55fd07,null));};exports['create']=function(_0x5c2ddb,_0x1f7c1d){return db[_0xf7b1('0x29')][_0xf7b1('0x46')](_0x5c2ddb[_0xf7b1('0x47')],{})[_0xf7b1('0x3b')](respondWithResult(_0x1f7c1d,0xc9))[_0xf7b1('0x40')](handleError(_0x1f7c1d,null));};exports[_0xf7b1('0x21')]=function(_0x194d19,_0x5d804c){if(_0x194d19[_0xf7b1('0x47')]['id']){delete _0x194d19[_0xf7b1('0x47')]['id'];}return db[_0xf7b1('0x29')][_0xf7b1('0x45')]({'where':{'id':_0x194d19[_0xf7b1('0x42')]['id']}})[_0xf7b1('0x3b')](handleEntityNotFound(_0x5d804c,null))[_0xf7b1('0x3b')](saveUpdates(_0x194d19[_0xf7b1('0x47')],null))[_0xf7b1('0x3b')](respondWithResult(_0x5d804c,null))[_0xf7b1('0x40')](handleError(_0x5d804c,null));};exports[_0xf7b1('0x22')]=function(_0x4ad53f,_0x1715b9){return db[_0xf7b1('0x29')][_0xf7b1('0x45')]({'where':{'id':_0x4ad53f[_0xf7b1('0x42')]['id']}})[_0xf7b1('0x3b')](handleEntityNotFound(_0x1715b9,null))['then'](removeEntity(_0x1715b9,null))[_0xf7b1('0x40')](handleError(_0x1715b9,null));};exports['getConfigurations']=function(_0xb49bb0,_0x3c21c8,_0x1fae5d){var _0x53f341={};var _0x237077={};var _0x534310;var _0x2a2452;return db[_0xf7b1('0x29')][_0xf7b1('0x48')]({'where':{'id':_0xb49bb0[_0xf7b1('0x42')]['id']}})[_0xf7b1('0x3b')](handleEntityNotFound(_0x3c21c8,null))[_0xf7b1('0x3b')](function(_0x33cc7c){if(_0x33cc7c){_0x534310=_0x33cc7c;_0x237077[_0xf7b1('0x43')]=_[_0xf7b1('0x44')](db[_0xf7b1('0x49')][_0xf7b1('0x2a')]);_0x237077[_0xf7b1('0x2d')]=_[_0xf7b1('0x44')](_0xb49bb0[_0xf7b1('0x2d')]);_0x237077[_0xf7b1('0x2e')]=_['intersection'](_0x237077[_0xf7b1('0x43')],_0x237077[_0xf7b1('0x2d')]);_0x53f341['attributes']=_[_0xf7b1('0x2f')](_0x237077[_0xf7b1('0x43')],qs['fields'](_0xb49bb0[_0xf7b1('0x2d')][_0xf7b1('0x31')]));_0x53f341[_0xf7b1('0x30')]=_0x53f341[_0xf7b1('0x30')]['length']?_0x53f341['attributes']:_0x237077[_0xf7b1('0x43')];_0x53f341['order']=qs[_0xf7b1('0x34')](_0xb49bb0['query'][_0xf7b1('0x34')]);_0x53f341[_0xf7b1('0x35')]=qs[_0xf7b1('0x2e')](_[_0xf7b1('0x36')](_0xb49bb0[_0xf7b1('0x2d')],_0x237077[_0xf7b1('0x2e')]));if(_0xb49bb0[_0xf7b1('0x2d')]['filter']){_0x53f341['where']=_['merge'](_0x53f341[_0xf7b1('0x35')],{'$or':_[_0xf7b1('0x28')](_0x53f341[_0xf7b1('0x30')],function(_0x44c7d8){var _0x374c66={};_0x374c66[_0x44c7d8]={'$like':'%'+_0xb49bb0[_0xf7b1('0x2d')]['filter']+'%'};return _0x374c66;})});}_0x53f341=_[_0xf7b1('0x37')]({},_0x53f341,_0xb49bb0[_0xf7b1('0x3a')]);return _0x534310[_0xf7b1('0x4a')](_0x53f341);}})[_0xf7b1('0x3b')](function(_0x3bfad0){if(_0x3bfad0){_0x2a2452=_0x3bfad0[_0xf7b1('0x32')];if(!_0xb49bb0['query'][_0xf7b1('0x33')](_0xf7b1('0x4b'))){_0x53f341[_0xf7b1('0x1b')]=qs[_0xf7b1('0x1b')](_0xb49bb0[_0xf7b1('0x2d')][_0xf7b1('0x1b')]);_0x53f341[_0xf7b1('0x1d')]=qs['offset'](_0xb49bb0[_0xf7b1('0x2d')][_0xf7b1('0x1d')]);}return _0x534310[_0xf7b1('0x4a')](_0x53f341);}})[_0xf7b1('0x3b')](function(_0x411d9a){if(_0x411d9a){return _0x411d9a?{'count':_0x2a2452,'rows':_0x411d9a}:null;}})['then'](respondWithResult(_0x3c21c8,null))[_0xf7b1('0x40')](handleError(_0x3c21c8,null));};exports['addConfiguration']=function(_0x20f4ba,_0x4fc3ae,_0x2425e4){if(_0x20f4ba['body']['id']){delete _0x20f4ba[_0xf7b1('0x47')]['id'];}return db[_0xf7b1('0x29')][_0xf7b1('0x48')]({'where':{'id':_0x20f4ba[_0xf7b1('0x42')]['id']}})[_0xf7b1('0x3b')](handleEntityNotFound(_0x4fc3ae,null))[_0xf7b1('0x3b')](function(_0x4b63ee){if(_0x4b63ee){_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x4c')]=_0x4b63ee['id'];_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x4d')]=integrations[_0xf7b1('0x4e')](_0x20f4ba['body'][_0xf7b1('0x4f')],_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x2c')]);_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x50')]=integrations[_0xf7b1('0x51')](_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x4f')],_0x20f4ba[_0xf7b1('0x47')][_0xf7b1('0x2c')]);return db[_0xf7b1('0x49')][_0xf7b1('0x46')](_0x20f4ba[_0xf7b1('0x47')],{'include':[{'model':db['SalesforceField'],'as':_0xf7b1('0x4d')},{'model':db[_0xf7b1('0x52')],'as':_0xf7b1('0x50')}]});}return null;})[_0xf7b1('0x3b')](respondWithResult(_0x4fc3ae,null))['catch'](handleError(_0x4fc3ae,null));};exports[_0xf7b1('0x53')]=function(_0x5dd810,_0x2302eb,_0x70f49b){var _0x39a31b;var _0x5966a0='';var _0x59f03e='Task';return db[_0xf7b1('0x29')][_0xf7b1('0x48')]({'where':{'id':_0x5dd810[_0xf7b1('0x42')]['id']},'attributes':['id',_0xf7b1('0x54'),'clientId',_0xf7b1('0x55'),'username','password',_0xf7b1('0x56')]})['then'](handleEntityNotFound(_0x2302eb,null))[_0xf7b1('0x3b')](function(_0x2a43ff){if(_0x2a43ff){_0x5966a0=_0x2a43ff[_0xf7b1('0x54')];var _0x2ecb97=_0x5966a0[_0xf7b1('0x57')](-0x1);if(_0x2ecb97==='/'){_0x5966a0=_0x5966a0[_0xf7b1('0x58')](0x0,_0x5966a0[_0xf7b1('0x59')](_0x2ecb97));}_0x39a31b=new jsforce[(_0xf7b1('0x5a'))]({'oauth2':{'loginUrl':_0x5966a0,'clientId':_0x2a43ff[_0xf7b1('0x5b')],'clientSecret':_0x2a43ff[_0xf7b1('0x55')]}});return _0x39a31b[_0xf7b1('0x5c')](_0x2a43ff[_0xf7b1('0x5d')],_0x2a43ff[_0xf7b1('0x5e')][_0xf7b1('0x5f')](_0x2a43ff[_0xf7b1('0x56')]));}})[_0xf7b1('0x3b')](function(_0x1d90d6){if(_0x1d90d6){if(!_['isNil'](_0x5dd810[_0xf7b1('0x2d')][_0xf7b1('0x60')])){_0x59f03e=_0x5dd810[_0xf7b1('0x2d')][_0xf7b1('0x60')];}return _0x39a31b[_0xf7b1('0x61')](_0x59f03e)[_0xf7b1('0x62')]();}})[_0xf7b1('0x3b')](function(_0x2fb963){var _0x37aa36=[_0xf7b1('0x63'),'ActivityDate','IsReminderSet','IsRecurrence',_0xf7b1('0x64'),_0xf7b1('0x65')];var _0xb7501=['string',_0xf7b1('0x66'),'picklist','boolean',_0xf7b1('0x67'),_0xf7b1('0x68'),_0xf7b1('0x69')];if(_0x2fb963){_[_0xf7b1('0x6a')](_0x2fb963['fields'],function(_0x2d2ea5){return _0x37aa36[_0xf7b1('0x6b')](_0x2d2ea5['name'])||!_0xb7501[_0xf7b1('0x6b')](_0x2d2ea5['type']);});return{'count':_0x2fb963['fields'][_0xf7b1('0x32')],'rows':_[_0xf7b1('0x28')](_0x2fb963['fields'],function(_0x20b927){return{'id':_0x20b927[_0xf7b1('0x25')],'name':_0x20b927[_0xf7b1('0x6c')],'custom':_0x20b927[_0xf7b1('0x6d')],'options':_0x20b927[_0xf7b1('0x6e')][_0xf7b1('0x32')]>0x0?_[_0xf7b1('0x28')](_0x20b927[_0xf7b1('0x6e')],function(_0x430c89){return{'name':_0x430c89[_0xf7b1('0x6c')],'value':_0x430c89[_0xf7b1('0x6f')]};}):_0x20b927[_0xf7b1('0x2c')]==_0xf7b1('0x70')?[{'name':_0xf7b1('0x71'),'value':'true'},{'name':_0xf7b1('0x72'),'value':_0xf7b1('0x73')}]:[]};})};}})[_0xf7b1('0x3b')](respondWithResult(_0x2302eb,null))[_0xf7b1('0x40')](function(_0x1f106a){var _0x1db963=_0x5dd810[_0xf7b1('0x2d')][_0xf7b1('0x74')]?0x1f4:_0x1f106a[_0xf7b1('0x75')]||0x1f4;logger[_0xf7b1('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xf7b1('0x53'),_0x1db963,JSON[_0xf7b1('0x76')](_0x1f106a));delete _0x1f106a[_0xf7b1('0x25')];if(_0x1db963===0x191){_0x1db963=0x190;}_0x2302eb['status'](_0x1db963)[_0xf7b1('0x26')](_0x5dd810[_0xf7b1('0x2d')][_0xf7b1('0x74')]?{'message':_0xf7b1('0x77'),'statusCode':_0x1f106a['statusCode']}:_0x1f106a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 68788bb..26cc4b3 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 _0x0b21=['../../config/logger','moment','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util'];(function(_0x419825,_0x409143){var _0xde8890=function(_0x44f679){while(--_0x44f679){_0x419825['push'](_0x419825['shift']());}};_0xde8890(++_0x409143);}(_0x0b21,0x6d));var _0x10b2=function(_0x3fa93,_0x3750a1){_0x3fa93=_0x3fa93-0x0;var _0x476e37=_0x0b21[_0x3fa93];return _0x476e37;};'use strict';var _=require('lodash');var util=require(_0x10b2('0x0'));var logger=require(_0x10b2('0x1'))('api');var moment=require(_0x10b2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10b2('0x3'));var rimraf=require(_0x10b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x10b2('0x5'));var integrations=require(_0x10b2('0x6'));module[_0x10b2('0x7')]=function(_0x2cba34,_0x3137c4){return _0x2cba34[_0x10b2('0x8')](_0x10b2('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc882=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api','moment'];(function(_0x2b992d,_0x4436f5){var _0x3a30c1=function(_0x33d9be){while(--_0x33d9be){_0x2b992d['push'](_0x2b992d['shift']());}};_0x3a30c1(++_0x4436f5);}(_0xc882,0xff));var _0x2c88=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc882[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var logger=require(_0x2c88('0x2'))(_0x2c88('0x3'));var moment=require(_0x2c88('0x4'));var BPromise=require(_0x2c88('0x5'));var rp=require(_0x2c88('0x6'));var fs=require('fs');var path=require(_0x2c88('0x7'));var rimraf=require(_0x2c88('0x8'));var config=require(_0x2c88('0x9'));var attributes=require(_0x2c88('0xa'));var integrations=require(_0x2c88('0xb'));module[_0x2c88('0xc')]=function(_0x15eadc,_0x26bfea){return _0x15eadc['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 5ee181f..61af4f1 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 _0x0c6c=['then','ShowSalesforceAccount','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','map','attributes','include','model','debug','stringify','SalesforceAccount','find'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x0c6c,0x1e2));var _0xc0c6=function(_0x5871f9,_0x28ccb7){_0x5871f9=_0x5871f9-0x0;var _0x8fd1c0=_0x0c6c[_0x5871f9];return _0x8fd1c0;};'use strict';var _=require(_0xc0c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc0c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0c6('0x2'));var db=require(_0xc0c6('0x3'))['db'];var utils=require(_0xc0c6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc0c6('0x6')][_0xc0c6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12dc5f,_0x389944,_0x1ea381){return new BPromise(function(_0x13da87,_0x5e3f6c){return client['request'](_0x12dc5f,_0x1ea381)['then'](function(_0x323706){logger[_0xc0c6('0x8')](_0xc0c6('0x9'),_0x389944,_0xc0c6('0xa'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x389944,_0xc0c6('0xa'),JSON['stringify'](_0x323706));if(_0x323706[_0xc0c6('0xb')]){if(_0x323706[_0xc0c6('0xb')][_0xc0c6('0xc')]===0x1f4){logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);return _0x5e3f6c(_0x323706['error'][_0xc0c6('0xd')]);}logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);return _0x13da87(_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);}else{logger[_0xc0c6('0x8')](_0xc0c6('0x9'),_0x389944,'request\x20sent');_0x13da87(_0x323706[_0xc0c6('0xe')]['message']);}})[_0xc0c6('0xf')](function(_0x4152a2){logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x4152a2);_0x5e3f6c(_0x4152a2);});});}exports[_0xc0c6('0x10')]=function(_0x557385){var _0x74b15f=this;return new Promise(function(_0x377fef,_0xfb4afa){return db['SalesforceAccount'][_0xc0c6('0x11')]({'raw':_0x557385[_0xc0c6('0x12')]?_0x557385['options'][_0xc0c6('0x13')]===undefined?!![]:![]:!![],'where':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')][_0xc0c6('0x14')]||null:null,'attributes':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')]['attributes']||null:null,'limit':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')][_0xc0c6('0x15')]||null:null,'include':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')]['include']?_[_0xc0c6('0x16')](_0x557385[_0xc0c6('0x12')]['include'],function(_0x5e00f3){return{'model':db[_0x5e00f3['model']],'as':_0x5e00f3['as'],'attributes':_0x5e00f3[_0xc0c6('0x17')],'include':_0x5e00f3[_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x5e00f3[_0xc0c6('0x18')],function(_0x5712be){return{'model':db[_0x5712be['model']],'as':_0x5712be['as'],'attributes':_0x5712be[_0xc0c6('0x17')],'include':_0x5712be['include']?_[_0xc0c6('0x16')](_0x5712be[_0xc0c6('0x18')],function(_0x148570){return{'model':db[_0x148570[_0xc0c6('0x19')]],'as':_0x148570['as'],'attributes':_0x148570[_0xc0c6('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9996){logger[_0xc0c6('0x8')](_0xc0c6('0x10'),_0x557385);logger[_0xc0c6('0x1a')](_0xc0c6('0x10'),_0x557385,JSON[_0xc0c6('0x1b')](_0x5e9996));_0x377fef(_0x5e9996);})[_0xc0c6('0xf')](function(_0x39ea06){logger[_0xc0c6('0xb')]('GetSalesforceAccount',_0x39ea06[_0xc0c6('0xd')],_0x557385);_0xfb4afa(_0x74b15f[_0xc0c6('0xb')](0x1f4,_0x39ea06['message']));});});};exports['ShowSalesforceAccount']=function(_0x11529d){var _0x5a5a0c=this;return new Promise(function(_0x9799fa,_0x306deb){return db[_0xc0c6('0x1c')][_0xc0c6('0x1d')]({'raw':_0x11529d[_0xc0c6('0x12')]?_0x11529d[_0xc0c6('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x11529d[_0xc0c6('0x12')]?_0x11529d[_0xc0c6('0x12')][_0xc0c6('0x14')]||null:null,'attributes':_0x11529d[_0xc0c6('0x12')]?_0x11529d['options'][_0xc0c6('0x17')]||null:null,'include':_0x11529d['options']?_0x11529d['options'][_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x11529d['options'][_0xc0c6('0x18')],function(_0x5cb777){return{'model':db[_0x5cb777[_0xc0c6('0x19')]],'as':_0x5cb777['as'],'attributes':_0x5cb777[_0xc0c6('0x17')],'include':_0x5cb777['include']?_[_0xc0c6('0x16')](_0x5cb777[_0xc0c6('0x18')],function(_0x250243){return{'model':db[_0x250243[_0xc0c6('0x19')]],'as':_0x250243['as'],'attributes':_0x250243[_0xc0c6('0x17')],'include':_0x250243[_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x250243['include'],function(_0x3fcf5e){return{'model':db[_0x3fcf5e[_0xc0c6('0x19')]],'as':_0x3fcf5e['as'],'attributes':_0x3fcf5e[_0xc0c6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc0c6('0x1e')](function(_0x423fcb){logger[_0xc0c6('0x8')]('ShowSalesforceAccount',_0x11529d);logger[_0xc0c6('0x1a')](_0xc0c6('0x1f'),_0x11529d,JSON['stringify'](_0x423fcb));_0x9799fa(_0x423fcb);})[_0xc0c6('0xf')](function(_0x282707){logger['error'](_0xc0c6('0x1f'),_0x282707[_0xc0c6('0xd')],_0x11529d);_0x306deb(_0x5a5a0c[_0xc0c6('0xb')](0x1f4,_0x282707[_0xc0c6('0xd')]));});});}; \ No newline at end of file +var _0x0191=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','model','attributes','map','ShowSalesforceAccount','find','raw','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x387625,_0x2a41d8){var _0x2abf75=function(_0x4dbbea){while(--_0x4dbbea){_0x387625['push'](_0x387625['shift']());}};_0x2abf75(++_0x2a41d8);}(_0x0191,0x13f));var _0x1019=function(_0x2e1d3d,_0x719bf0){_0x2e1d3d=_0x2e1d3d-0x0;var _0x3d81df=_0x0191[_0x2e1d3d];return _0x3d81df;};'use strict';var _=require(_0x1019('0x0'));var util=require(_0x1019('0x1'));var moment=require('moment');var BPromise=require(_0x1019('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1019('0x3'));var db=require(_0x1019('0x4'))['db'];var utils=require(_0x1019('0x5'));var logger=require(_0x1019('0x6'))('rpc');var config=require(_0x1019('0x7'));var jayson=require(_0x1019('0x8'));var client=jayson[_0x1019('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c630a,_0x3b734a,_0x3bf2a3){return new BPromise(function(_0x28c561,_0x46cae4){return client[_0x1019('0xa')](_0x2c630a,_0x3bf2a3)[_0x1019('0xb')](function(_0x34592c){logger[_0x1019('0xc')](_0x1019('0xd'),_0x3b734a,_0x1019('0xe'));logger[_0x1019('0xf')](_0x1019('0x10'),_0x3b734a,_0x1019('0xe'),JSON[_0x1019('0x11')](_0x34592c));if(_0x34592c[_0x1019('0x12')]){if(_0x34592c['error'][_0x1019('0x13')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3b734a,_0x34592c[_0x1019('0x12')][_0x1019('0x14')]);return _0x46cae4(_0x34592c[_0x1019('0x12')][_0x1019('0x14')]);}logger[_0x1019('0x12')](_0x1019('0xd'),_0x3b734a,_0x34592c[_0x1019('0x12')]['message']);return _0x28c561(_0x34592c[_0x1019('0x12')][_0x1019('0x14')]);}else{logger[_0x1019('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x3b734a,_0x1019('0xe'));_0x28c561(_0x34592c[_0x1019('0x15')][_0x1019('0x14')]);}})[_0x1019('0x16')](function(_0x348568){logger['error'](_0x1019('0xd'),_0x3b734a,_0x348568);_0x46cae4(_0x348568);});});}exports[_0x1019('0x17')]=function(_0x761746){var _0x3335f8=this;return new Promise(function(_0x508fed,_0xad4e3e){return db[_0x1019('0x18')][_0x1019('0x19')]({'raw':_0x761746[_0x1019('0x1a')]?_0x761746[_0x1019('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x761746[_0x1019('0x1a')]?_0x761746[_0x1019('0x1a')][_0x1019('0x1b')]||null:null,'attributes':_0x761746[_0x1019('0x1a')]?_0x761746['options']['attributes']||null:null,'limit':_0x761746['options']?_0x761746[_0x1019('0x1a')][_0x1019('0x1c')]||null:null,'include':_0x761746['options']?_0x761746[_0x1019('0x1a')][_0x1019('0x1d')]?_['map'](_0x761746[_0x1019('0x1a')][_0x1019('0x1d')],function(_0x57d9fe){return{'model':db[_0x57d9fe[_0x1019('0x1e')]],'as':_0x57d9fe['as'],'attributes':_0x57d9fe[_0x1019('0x1f')],'include':_0x57d9fe['include']?_['map'](_0x57d9fe[_0x1019('0x1d')],function(_0x1b9202){return{'model':db[_0x1b9202[_0x1019('0x1e')]],'as':_0x1b9202['as'],'attributes':_0x1b9202[_0x1019('0x1f')],'include':_0x1b9202['include']?_[_0x1019('0x20')](_0x1b9202[_0x1019('0x1d')],function(_0x59b783){return{'model':db[_0x59b783[_0x1019('0x1e')]],'as':_0x59b783['as'],'attributes':_0x59b783[_0x1019('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1019('0xb')](function(_0x4f3ff1){logger[_0x1019('0xc')]('GetSalesforceAccount',_0x761746);logger[_0x1019('0xf')](_0x1019('0x17'),_0x761746,JSON[_0x1019('0x11')](_0x4f3ff1));_0x508fed(_0x4f3ff1);})[_0x1019('0x16')](function(_0x29772e){logger[_0x1019('0x12')](_0x1019('0x17'),_0x29772e[_0x1019('0x14')],_0x761746);_0xad4e3e(_0x3335f8['error'](0x1f4,_0x29772e[_0x1019('0x14')]));});});};exports[_0x1019('0x21')]=function(_0x3d3d46){var _0x36f219=this;return new Promise(function(_0x3fd2eb,_0x4f1450){return db[_0x1019('0x18')][_0x1019('0x22')]({'raw':_0x3d3d46[_0x1019('0x1a')]?_0x3d3d46['options'][_0x1019('0x23')]===undefined?!![]:![]:!![],'where':_0x3d3d46[_0x1019('0x1a')]?_0x3d3d46[_0x1019('0x1a')][_0x1019('0x1b')]||null:null,'attributes':_0x3d3d46[_0x1019('0x1a')]?_0x3d3d46[_0x1019('0x1a')][_0x1019('0x1f')]||null:null,'include':_0x3d3d46['options']?_0x3d3d46['options'][_0x1019('0x1d')]?_[_0x1019('0x20')](_0x3d3d46[_0x1019('0x1a')]['include'],function(_0x357cc3){return{'model':db[_0x357cc3[_0x1019('0x1e')]],'as':_0x357cc3['as'],'attributes':_0x357cc3['attributes'],'include':_0x357cc3[_0x1019('0x1d')]?_[_0x1019('0x20')](_0x357cc3[_0x1019('0x1d')],function(_0xfd56e0){return{'model':db[_0xfd56e0[_0x1019('0x1e')]],'as':_0xfd56e0['as'],'attributes':_0xfd56e0['attributes'],'include':_0xfd56e0[_0x1019('0x1d')]?_[_0x1019('0x20')](_0xfd56e0['include'],function(_0x3c7893){return{'model':db[_0x3c7893[_0x1019('0x1e')]],'as':_0x3c7893['as'],'attributes':_0x3c7893[_0x1019('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1019('0xb')](function(_0x4a4c83){logger[_0x1019('0xc')]('ShowSalesforceAccount',_0x3d3d46);logger['debug'](_0x1019('0x21'),_0x3d3d46,JSON['stringify'](_0x4a4c83));_0x3fd2eb(_0x4a4c83);})[_0x1019('0x16')](function(_0xaed5d5){logger[_0x1019('0x12')]('ShowSalesforceAccount',_0xaed5d5['message'],_0x3d3d46);_0x4f1450(_0x36f219['error'](0x1f4,_0xaed5d5[_0x1019('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 54a6012..8b0824e 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x89f1ae,_0x15cc30){var _0xc85802=function(_0x3eb8a3){while(--_0x3eb8a3){_0x89f1ae['push'](_0x89f1ae['shift']());}};_0xc85802(++_0x15cc30);}(_0x5f2f,0x73));var _0xf5f2=function(_0x582974,_0x5968cb){_0x582974=_0x582974-0x0;var _0x364d64=_0x5f2f[_0x582974];return _0x364d64;};'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('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2f4a84,_0x58b3d5){var _0x58afba=function(_0x1d0b19){while(--_0x1d0b19){_0x2f4a84['push'](_0x2f4a84['shift']());}};_0x58afba(++_0x58b3d5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x12babe,_0x13dff6){_0x12babe=_0x12babe-0x0;var _0x23e896=_0x5f2f[_0x12babe];return _0x23e896;};'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('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 52ca175..3b8eed3 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 _0xd672=['Task','contact_lead','contact','lead','account_contact_lead','nothing','STRING','ENUM','Case'];(function(_0x1b4561,_0x481c55){var _0x5d232e=function(_0x187a9c){while(--_0x187a9c){_0x1b4561['push'](_0x1b4561['shift']());}};_0x5d232e(++_0x481c55);}(_0xd672,0x96));var _0x2d67=function(_0xf60a6b,_0x3a9645){_0xf60a6b=_0xf60a6b-0x0;var _0x5a89a3=_0xd672[_0xf60a6b];return _0x5a89a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2d67('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2d67('0x1')]('Task',_0x2d67('0x2')),'defaultValue':_0x2d67('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2d67('0x4'),_0x2d67('0x5'),_0x2d67('0x6'),_0x2d67('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2d67('0x1')](_0x2d67('0x8'),_0x2d67('0x5'),_0x2d67('0x6'),'account'),'defaultValue':_0x2d67('0x6')},'leadId':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x694d=['contact','sequelize','exports','STRING','Task','Case','contact_lead','lead','account_contact_lead','account','ENUM'];(function(_0x549fb4,_0x57140c){var _0xc64c37=function(_0x40e702){while(--_0x40e702){_0x549fb4['push'](_0x549fb4['shift']());}};_0xc64c37(++_0x57140c);}(_0x694d,0x16c));var _0xd694=function(_0xc8e740,_0x399ac4){_0xc8e740=_0xc8e740-0x0;var _0x430229=_0x694d[_0xc8e740];return _0x430229;};'use strict';var Sequelize=require(_0xd694('0x0'));module[_0xd694('0x1')]={'name':{'type':Sequelize[_0xd694('0x2')]},'description':{'type':Sequelize[_0xd694('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xd694('0x3'),_0xd694('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xd694('0x5'),'contact',_0xd694('0x6'),_0xd694('0x7'),_0xd694('0x8')),'defaultValue':_0xd694('0x5')},'moduleCreate':{'type':Sequelize[_0xd694('0x9')]('nothing',_0xd694('0xa'),_0xd694('0x6'),_0xd694('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xd694('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xd694('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b67eb4f..cb866c0 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 _0x30e9=['order','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','keys','intersection','includeAll','find','create','body','catch','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','map','SalesforceConfiguration','rawAttributes','type','model','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x17d0ca,_0x4214f7){var _0x382af5=function(_0x23737f){while(--_0x23737f){_0x17d0ca['push'](_0x17d0ca['shift']());}};_0x382af5(++_0x4214f7);}(_0x30e9,0x158));var _0x930e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x30e9[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x930e('0x0'));var rimraf=require(_0x930e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x930e('0x2'));var moment=require(_0x930e('0x3'));var BPromise=require(_0x930e('0x4'));var Mustache=require(_0x930e('0x5'));var util=require(_0x930e('0x6'));var path=require(_0x930e('0x7'));var sox=require(_0x930e('0x8'));var csv=require(_0x930e('0x9'));var ejs=require(_0x930e('0xa'));var fs=require('fs');var fs_extra=require(_0x930e('0xb'));var _=require(_0x930e('0xc'));var squel=require(_0x930e('0xd'));var crypto=require(_0x930e('0xe'));var jsforce=require(_0x930e('0xf'));var deskjs=require(_0x930e('0x10'));var toCsv=require(_0x930e('0x9'));var querystring=require(_0x930e('0x11'));var Papa=require(_0x930e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x930e('0x13'));var as=require(_0x930e('0x14'));var hardwareService=require(_0x930e('0x15'));var logger=require(_0x930e('0x16'))(_0x930e('0x17'));var utils=require(_0x930e('0x18'));var config=require(_0x930e('0x19'));var licenseUtil=require(_0x930e('0x1a'));var db=require(_0x930e('0x1b'))['db'];function respondWithStatusCode(_0x37292c,_0x20fbb4){_0x20fbb4=_0x20fbb4||0xcc;return function(_0x367fe7){if(_0x367fe7){return _0x37292c['sendStatus'](_0x20fbb4);}return _0x37292c['status'](_0x20fbb4)[_0x930e('0x1c')]();};}function respondWithResult(_0x5d6c84,_0x44cb60){_0x44cb60=_0x44cb60||0xc8;return function(_0x5a5a99){if(_0x5a5a99){return _0x5d6c84[_0x930e('0x1d')](_0x44cb60)[_0x930e('0x1e')](_0x5a5a99);}};}function respondWithFilteredResult(_0x5a894c,_0x48b80d){return function(_0x44ebc0){if(_0x44ebc0){var _0x4afbbd=typeof _0x48b80d[_0x930e('0x1f')]===_0x930e('0x20')&&typeof _0x48b80d[_0x930e('0x21')]==='undefined';var _0x44d972=_0x44ebc0[_0x930e('0x22')];var _0xc1e33b=_0x4afbbd?0x0:_0x48b80d[_0x930e('0x1f')];var _0x3f9291=_0x4afbbd?_0x44ebc0[_0x930e('0x22')]:_0x48b80d[_0x930e('0x1f')]+_0x48b80d[_0x930e('0x21')];var _0x2d5614;if(_0x3f9291>=_0x44d972){_0x3f9291=_0x44d972;_0x2d5614=0xc8;}else{_0x2d5614=0xce;}_0x5a894c['status'](_0x2d5614);return _0x5a894c[_0x930e('0x23')](_0x930e('0x24'),_0xc1e33b+'-'+_0x3f9291+'/'+_0x44d972)[_0x930e('0x1e')](_0x44ebc0);}return null;};}function patchUpdates(_0x363d9a){return function(_0x44a430){try{jsonpatch['apply'](_0x44a430,_0x363d9a,!![]);}catch(_0x384178){return BPromise[_0x930e('0x25')](_0x384178);}return _0x44a430['save']();};}function saveUpdates(_0x4a19f7,_0x385ee8){return function(_0x19302c){if(_0x19302c){return _0x19302c[_0x930e('0x26')](_0x4a19f7)['then'](function(_0x1586f9){return _0x1586f9;});}return null;};}function removeEntity(_0x3c28e2,_0x2d0390){return function(_0x5ca6d2){if(_0x5ca6d2){return _0x5ca6d2[_0x930e('0x27')]()[_0x930e('0x28')](function(){_0x3c28e2[_0x930e('0x1d')](0xcc)[_0x930e('0x1c')]();});}};}function handleEntityNotFound(_0x2b26df,_0x5c804c){return function(_0x25fa2a){if(!_0x25fa2a){_0x2b26df[_0x930e('0x29')](0x194);}return _0x25fa2a;};}function handleError(_0x223d91,_0x55090f){_0x55090f=_0x55090f||0x1f4;return function(_0x75ed2a){logger[_0x930e('0x2a')](_0x75ed2a[_0x930e('0x2b')]);if(_0x75ed2a[_0x930e('0x2c')]){delete _0x75ed2a[_0x930e('0x2c')];}_0x223d91[_0x930e('0x1d')](_0x55090f)['send'](_0x75ed2a);};}exports['index']=function(_0x3ddea5,_0x19ba88){var _0x17fae8={},_0x546598={},_0x190505={'count':0x0,'rows':[]};var _0x31acc2=_[_0x930e('0x2d')](db[_0x930e('0x2e')][_0x930e('0x2f')],function(_0x1a864e){return{'name':_0x1a864e['fieldName'],'type':_0x1a864e[_0x930e('0x30')]['key']};});_0x546598[_0x930e('0x31')]=_[_0x930e('0x2d')](_0x31acc2,_0x930e('0x2c'));_0x546598['query']=_['keys'](_0x3ddea5[_0x930e('0x32')]);_0x546598['filters']=_['intersection'](_0x546598[_0x930e('0x31')],_0x546598[_0x930e('0x32')]);_0x17fae8[_0x930e('0x33')]=_['intersection'](_0x546598[_0x930e('0x31')],qs['fields'](_0x3ddea5[_0x930e('0x32')][_0x930e('0x34')]));_0x17fae8[_0x930e('0x33')]=_0x17fae8[_0x930e('0x33')][_0x930e('0x35')]?_0x17fae8[_0x930e('0x33')]:_0x546598[_0x930e('0x31')];if(!_0x3ddea5[_0x930e('0x32')][_0x930e('0x36')](_0x930e('0x37'))){_0x17fae8[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x21')]);_0x17fae8[_0x930e('0x1f')]=qs[_0x930e('0x1f')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x1f')]);}_0x17fae8[_0x930e('0x38')]=qs[_0x930e('0x39')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x39')]);_0x17fae8[_0x930e('0x3a')]=qs[_0x930e('0x3b')](_[_0x930e('0x3c')](_0x3ddea5[_0x930e('0x32')],_0x546598[_0x930e('0x3b')]),_0x31acc2);if(_0x3ddea5[_0x930e('0x32')][_0x930e('0x3d')]){_0x17fae8[_0x930e('0x3a')]=_[_0x930e('0x3e')](_0x17fae8[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x31acc2,function(_0x28ee78){if(_0x28ee78[_0x930e('0x30')]!=='VIRTUAL'){var _0x2b488b={};_0x2b488b[_0x28ee78[_0x930e('0x2c')]]={'$like':'%'+_0x3ddea5[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x2b488b;}})});}_0x17fae8=_['merge']({},_0x17fae8,_0x3ddea5[_0x930e('0x3f')]);var _0x8ed8ce={'where':_0x17fae8[_0x930e('0x3a')]};return db[_0x930e('0x2e')]['count'](_0x8ed8ce)[_0x930e('0x28')](function(_0x35cae6){_0x190505['count']=_0x35cae6;if(_0x3ddea5[_0x930e('0x32')]['includeAll']){_0x17fae8['include']=[{'all':!![]}];}return db[_0x930e('0x2e')][_0x930e('0x40')](_0x17fae8);})[_0x930e('0x28')](function(_0x44282a){_0x190505[_0x930e('0x41')]=_0x44282a;return _0x190505;})[_0x930e('0x28')](respondWithFilteredResult(_0x19ba88,_0x17fae8))['catch'](handleError(_0x19ba88,null));};exports[_0x930e('0x42')]=function(_0x4f0c85,_0xcb2881){var _0x49dce3={'raw':![],'where':{'id':_0x4f0c85[_0x930e('0x43')]['id']}},_0x3ae6ee={};_0x3ae6ee[_0x930e('0x31')]=_[_0x930e('0x44')](db['SalesforceConfiguration']['rawAttributes']);_0x3ae6ee[_0x930e('0x32')]=_[_0x930e('0x44')](_0x4f0c85['query']);_0x3ae6ee[_0x930e('0x3b')]=_[_0x930e('0x45')](_0x3ae6ee[_0x930e('0x31')],_0x3ae6ee[_0x930e('0x32')]);_0x49dce3[_0x930e('0x33')]=_[_0x930e('0x45')](_0x3ae6ee[_0x930e('0x31')],qs[_0x930e('0x34')](_0x4f0c85[_0x930e('0x32')][_0x930e('0x34')]));_0x49dce3[_0x930e('0x33')]=_0x49dce3[_0x930e('0x33')][_0x930e('0x35')]?_0x49dce3[_0x930e('0x33')]:_0x3ae6ee['model'];if(_0x4f0c85['query'][_0x930e('0x46')]){_0x49dce3['include']=[{'all':!![]}];}_0x49dce3=_[_0x930e('0x3e')]({},_0x49dce3,_0x4f0c85[_0x930e('0x3f')]);return db[_0x930e('0x2e')][_0x930e('0x47')](_0x49dce3)[_0x930e('0x28')](handleEntityNotFound(_0xcb2881,null))[_0x930e('0x28')](respondWithResult(_0xcb2881,null))['catch'](handleError(_0xcb2881,null));};exports[_0x930e('0x48')]=function(_0x39a377,_0x567dc0){return db[_0x930e('0x2e')][_0x930e('0x48')](_0x39a377[_0x930e('0x49')],{})[_0x930e('0x28')](respondWithResult(_0x567dc0,0xc9))[_0x930e('0x4a')](handleError(_0x567dc0,null));};exports[_0x930e('0x26')]=function(_0x5e9adf,_0x33869d){if(_0x5e9adf[_0x930e('0x49')]['id']){delete _0x5e9adf[_0x930e('0x49')]['id'];}return db[_0x930e('0x2e')][_0x930e('0x47')]({'where':{'id':_0x5e9adf[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x33869d,null))['then'](saveUpdates(_0x5e9adf[_0x930e('0x49')],null))['then'](respondWithResult(_0x33869d,null))[_0x930e('0x4a')](handleError(_0x33869d,null));};exports['destroy']=function(_0x5a8031,_0x36a437){return db[_0x930e('0x2e')][_0x930e('0x47')]({'where':{'id':_0x5a8031[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x36a437,null))[_0x930e('0x28')](removeEntity(_0x36a437,null))[_0x930e('0x4a')](handleError(_0x36a437,null));};exports[_0x930e('0x4b')]=function(_0xa69140,_0x905f0c,_0x2763fd){var _0x340513={};var _0x2f87dd={};var _0x3ec429;var _0x4c22a9;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0xa69140[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x905f0c,null))[_0x930e('0x28')](function(_0x302126){if(_0x302126){_0x3ec429=_0x302126;_0x2f87dd['model']=_[_0x930e('0x44')](db[_0x930e('0x4d')]['rawAttributes']);_0x2f87dd['query']=_[_0x930e('0x44')](_0xa69140[_0x930e('0x32')]);_0x2f87dd[_0x930e('0x3b')]=_[_0x930e('0x45')](_0x2f87dd[_0x930e('0x31')],_0x2f87dd['query']);_0x340513[_0x930e('0x33')]=_['intersection'](_0x2f87dd[_0x930e('0x31')],qs['fields'](_0xa69140[_0x930e('0x32')][_0x930e('0x34')]));_0x340513[_0x930e('0x33')]=_0x340513[_0x930e('0x33')]['length']?_0x340513['attributes']:_0x2f87dd[_0x930e('0x31')];_0x340513[_0x930e('0x38')]=qs[_0x930e('0x39')](_0xa69140[_0x930e('0x32')][_0x930e('0x39')]);_0x340513['where']=qs['filters'](_[_0x930e('0x3c')](_0xa69140[_0x930e('0x32')],_0x2f87dd[_0x930e('0x3b')]));if(_0xa69140[_0x930e('0x32')]['filter']){_0x340513[_0x930e('0x3a')]=_['merge'](_0x340513[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x340513[_0x930e('0x33')],function(_0x1d93f9){var _0x55503a={};_0x55503a[_0x1d93f9]={'$like':'%'+_0xa69140[_0x930e('0x32')]['filter']+'%'};return _0x55503a;})});}_0x340513=_['merge']({},_0x340513,_0xa69140[_0x930e('0x3f')]);return _0x3ec429[_0x930e('0x4b')](_0x340513);}})[_0x930e('0x28')](function(_0x5c054a){if(_0x5c054a){_0x4c22a9=_0x5c054a[_0x930e('0x35')];if(!_0xa69140['query'][_0x930e('0x36')](_0x930e('0x37'))){_0x340513[_0x930e('0x21')]=qs[_0x930e('0x21')](_0xa69140[_0x930e('0x32')][_0x930e('0x21')]);_0x340513['offset']=qs[_0x930e('0x1f')](_0xa69140['query'][_0x930e('0x1f')]);}return _0x3ec429[_0x930e('0x4b')](_0x340513);}})[_0x930e('0x28')](function(_0x442c1e){if(_0x442c1e){return _0x442c1e?{'count':_0x4c22a9,'rows':_0x442c1e}:null;}})[_0x930e('0x28')](respondWithResult(_0x905f0c,null))[_0x930e('0x4a')](handleError(_0x905f0c,null));};exports[_0x930e('0x4e')]=function(_0x12c62f,_0x3e2f7b,_0x22773f){var _0x45681b={};var _0x41f6c6={};var _0x14c9f3;var _0x469233;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0x12c62f['params']['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x3e2f7b,null))[_0x930e('0x28')](function(_0x497488){if(_0x497488){_0x14c9f3=_0x497488;_0x41f6c6[_0x930e('0x31')]=_['keys'](db[_0x930e('0x4d')][_0x930e('0x2f')]);_0x41f6c6[_0x930e('0x32')]=_[_0x930e('0x44')](_0x12c62f[_0x930e('0x32')]);_0x41f6c6['filters']=_[_0x930e('0x45')](_0x41f6c6[_0x930e('0x31')],_0x41f6c6['query']);_0x45681b['attributes']=_['intersection'](_0x41f6c6[_0x930e('0x31')],qs[_0x930e('0x34')](_0x12c62f[_0x930e('0x32')][_0x930e('0x34')]));_0x45681b[_0x930e('0x33')]=_0x45681b[_0x930e('0x33')]['length']?_0x45681b[_0x930e('0x33')]:_0x41f6c6['model'];_0x45681b[_0x930e('0x38')]=qs[_0x930e('0x39')](_0x12c62f[_0x930e('0x32')][_0x930e('0x39')]);_0x45681b['where']=qs[_0x930e('0x3b')](_[_0x930e('0x3c')](_0x12c62f[_0x930e('0x32')],_0x41f6c6['filters']));if(_0x12c62f[_0x930e('0x32')][_0x930e('0x3d')]){_0x45681b[_0x930e('0x3a')]=_[_0x930e('0x3e')](_0x45681b[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x45681b[_0x930e('0x33')],function(_0x4f9821){var _0x35378c={};_0x35378c[_0x4f9821]={'$like':'%'+_0x12c62f[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x35378c;})});}_0x45681b=_[_0x930e('0x3e')]({},_0x45681b,_0x12c62f[_0x930e('0x3f')]);return _0x14c9f3[_0x930e('0x4e')](_0x45681b);}})[_0x930e('0x28')](function(_0x1ba779){if(_0x1ba779){_0x469233=_0x1ba779[_0x930e('0x35')];if(!_0x12c62f['query'][_0x930e('0x36')]('nolimit')){_0x45681b[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x12c62f[_0x930e('0x32')][_0x930e('0x21')]);_0x45681b['offset']=qs[_0x930e('0x1f')](_0x12c62f[_0x930e('0x32')][_0x930e('0x1f')]);}return _0x14c9f3['getSubjects'](_0x45681b);}})[_0x930e('0x28')](function(_0x333fb6){if(_0x333fb6){return _0x333fb6?{'count':_0x469233,'rows':_0x333fb6}:null;}})[_0x930e('0x28')](respondWithResult(_0x3e2f7b,null))['catch'](handleError(_0x3e2f7b,null));};exports[_0x930e('0x4f')]=function(_0x352dd7,_0x2a2aba,_0x2976df){var _0x47f6b0={};var _0xb5847b={};var _0x4e3aaf;var _0x90111b;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0x352dd7['params']['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x2a2aba,null))[_0x930e('0x28')](function(_0x464b21){if(_0x464b21){_0x4e3aaf=_0x464b21;_0xb5847b[_0x930e('0x31')]=_[_0x930e('0x44')](db['SalesforceField'][_0x930e('0x2f')]);_0xb5847b[_0x930e('0x32')]=_[_0x930e('0x44')](_0x352dd7['query']);_0xb5847b['filters']=_['intersection'](_0xb5847b[_0x930e('0x31')],_0xb5847b['query']);_0x47f6b0[_0x930e('0x33')]=_[_0x930e('0x45')](_0xb5847b['model'],qs[_0x930e('0x34')](_0x352dd7['query'][_0x930e('0x34')]));_0x47f6b0['attributes']=_0x47f6b0['attributes']['length']?_0x47f6b0['attributes']:_0xb5847b[_0x930e('0x31')];_0x47f6b0[_0x930e('0x38')]=qs['sort'](_0x352dd7[_0x930e('0x32')][_0x930e('0x39')]);_0x47f6b0[_0x930e('0x3a')]=qs[_0x930e('0x3b')](_['pick'](_0x352dd7[_0x930e('0x32')],_0xb5847b[_0x930e('0x3b')]));if(_0x352dd7[_0x930e('0x32')][_0x930e('0x3d')]){_0x47f6b0['where']=_[_0x930e('0x3e')](_0x47f6b0[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x47f6b0[_0x930e('0x33')],function(_0x12e419){var _0x211969={};_0x211969[_0x12e419]={'$like':'%'+_0x352dd7[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x211969;})});}_0x47f6b0=_[_0x930e('0x3e')]({},_0x47f6b0,_0x352dd7['options']);return _0x4e3aaf[_0x930e('0x4f')](_0x47f6b0);}})['then'](function(_0x325d42){if(_0x325d42){_0x90111b=_0x325d42[_0x930e('0x35')];if(!_0x352dd7[_0x930e('0x32')]['hasOwnProperty'](_0x930e('0x37'))){_0x47f6b0[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x352dd7['query'][_0x930e('0x21')]);_0x47f6b0[_0x930e('0x1f')]=qs[_0x930e('0x1f')](_0x352dd7[_0x930e('0x32')]['offset']);}return _0x4e3aaf[_0x930e('0x4f')](_0x47f6b0);}})[_0x930e('0x28')](function(_0x140f35){if(_0x140f35){return _0x140f35?{'count':_0x90111b,'rows':_0x140f35}:null;}})[_0x930e('0x28')](respondWithResult(_0x2a2aba,null))[_0x930e('0x4a')](handleError(_0x2a2aba,null));}; \ No newline at end of file +var _0x85f1=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','SalesforceConfiguration','include','catch','create','body','find','getFields','SalesforceField','order','map','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x164055,_0x4f701b){var _0x45d955=function(_0x583306){while(--_0x583306){_0x164055['push'](_0x164055['shift']());}};_0x45d955(++_0x4f701b);}(_0x85f1,0xc4));var _0x185f=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x85f1[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0x185f('0x0'));var rimraf=require(_0x185f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x185f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x185f('0x3'));var Mustache=require(_0x185f('0x4'));var util=require('util');var path=require(_0x185f('0x5'));var sox=require('sox');var csv=require(_0x185f('0x6'));var ejs=require(_0x185f('0x7'));var fs=require('fs');var fs_extra=require(_0x185f('0x8'));var _=require(_0x185f('0x9'));var squel=require(_0x185f('0xa'));var crypto=require('crypto');var jsforce=require(_0x185f('0xb'));var deskjs=require(_0x185f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x185f('0xd'));var Papa=require(_0x185f('0xe'));var Redis=require(_0x185f('0xf'));var authService=require(_0x185f('0x10'));var qs=require(_0x185f('0x11'));var as=require(_0x185f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x185f('0x13'))(_0x185f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x185f('0x15'));var db=require(_0x185f('0x16'))['db'];function respondWithStatusCode(_0x4f163e,_0x4778c9){_0x4778c9=_0x4778c9||0xcc;return function(_0x22116f){if(_0x22116f){return _0x4f163e[_0x185f('0x17')](_0x4778c9);}return _0x4f163e[_0x185f('0x18')](_0x4778c9)[_0x185f('0x19')]();};}function respondWithResult(_0x412498,_0x11d014){_0x11d014=_0x11d014||0xc8;return function(_0x1b86bb){if(_0x1b86bb){return _0x412498[_0x185f('0x18')](_0x11d014)[_0x185f('0x1a')](_0x1b86bb);}};}function respondWithFilteredResult(_0x56eeec,_0x19ec56){return function(_0x3a3471){if(_0x3a3471){var _0x56d8e4=typeof _0x19ec56[_0x185f('0x1b')]===_0x185f('0x1c')&&typeof _0x19ec56[_0x185f('0x1d')]===_0x185f('0x1c');var _0x5e97b5=_0x3a3471[_0x185f('0x1e')];var _0x400c84=_0x56d8e4?0x0:_0x19ec56['offset'];var _0x1b6d63=_0x56d8e4?_0x3a3471['count']:_0x19ec56[_0x185f('0x1b')]+_0x19ec56[_0x185f('0x1d')];var _0x15d2b2;if(_0x1b6d63>=_0x5e97b5){_0x1b6d63=_0x5e97b5;_0x15d2b2=0xc8;}else{_0x15d2b2=0xce;}_0x56eeec[_0x185f('0x18')](_0x15d2b2);return _0x56eeec[_0x185f('0x1f')](_0x185f('0x20'),_0x400c84+'-'+_0x1b6d63+'/'+_0x5e97b5)[_0x185f('0x1a')](_0x3a3471);}return null;};}function patchUpdates(_0x5a0baf){return function(_0x4dfded){try{jsonpatch[_0x185f('0x21')](_0x4dfded,_0x5a0baf,!![]);}catch(_0x89896f){return BPromise[_0x185f('0x22')](_0x89896f);}return _0x4dfded[_0x185f('0x23')]();};}function saveUpdates(_0x5d3f59,_0x36ce13){return function(_0x4e3beb){if(_0x4e3beb){return _0x4e3beb[_0x185f('0x24')](_0x5d3f59)[_0x185f('0x25')](function(_0x242ef6){return _0x242ef6;});}return null;};}function removeEntity(_0x29818e,_0x13e66f){return function(_0x41b1a7){if(_0x41b1a7){return _0x41b1a7[_0x185f('0x26')]()[_0x185f('0x25')](function(){_0x29818e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a52b8,_0x453f7f){return function(_0x4c1c0d){if(!_0x4c1c0d){_0x3a52b8[_0x185f('0x17')](0x194);}return _0x4c1c0d;};}function handleError(_0x59aae1,_0x3b3d77){_0x3b3d77=_0x3b3d77||0x1f4;return function(_0x294ad3){logger[_0x185f('0x27')](_0x294ad3[_0x185f('0x28')]);if(_0x294ad3[_0x185f('0x29')]){delete _0x294ad3[_0x185f('0x29')];}_0x59aae1[_0x185f('0x18')](_0x3b3d77)[_0x185f('0x2a')](_0x294ad3);};}exports[_0x185f('0x2b')]=function(_0x1d6ed8,_0x154c8f){var _0x414f30={},_0x4bfeb4={},_0x49b86c={'count':0x0,'rows':[]};var _0x57d98d=_['map'](db['SalesforceConfiguration'][_0x185f('0x2c')],function(_0x2bd10b){return{'name':_0x2bd10b[_0x185f('0x2d')],'type':_0x2bd10b['type'][_0x185f('0x2e')]};});_0x4bfeb4[_0x185f('0x2f')]=_['map'](_0x57d98d,_0x185f('0x29'));_0x4bfeb4[_0x185f('0x30')]=_[_0x185f('0x31')](_0x1d6ed8[_0x185f('0x30')]);_0x4bfeb4[_0x185f('0x32')]=_[_0x185f('0x33')](_0x4bfeb4['model'],_0x4bfeb4['query']);_0x414f30[_0x185f('0x34')]=_[_0x185f('0x33')](_0x4bfeb4[_0x185f('0x2f')],qs[_0x185f('0x35')](_0x1d6ed8[_0x185f('0x30')][_0x185f('0x35')]));_0x414f30['attributes']=_0x414f30[_0x185f('0x34')][_0x185f('0x36')]?_0x414f30[_0x185f('0x34')]:_0x4bfeb4['model'];if(!_0x1d6ed8['query'][_0x185f('0x37')](_0x185f('0x38'))){_0x414f30[_0x185f('0x1d')]=qs[_0x185f('0x1d')](_0x1d6ed8[_0x185f('0x30')][_0x185f('0x1d')]);_0x414f30[_0x185f('0x1b')]=qs[_0x185f('0x1b')](_0x1d6ed8[_0x185f('0x30')][_0x185f('0x1b')]);}_0x414f30['order']=qs['sort'](_0x1d6ed8[_0x185f('0x30')][_0x185f('0x39')]);_0x414f30['where']=qs[_0x185f('0x32')](_[_0x185f('0x3a')](_0x1d6ed8[_0x185f('0x30')],_0x4bfeb4[_0x185f('0x32')]),_0x57d98d);if(_0x1d6ed8['query'][_0x185f('0x3b')]){_0x414f30[_0x185f('0x3c')]=_[_0x185f('0x3d')](_0x414f30[_0x185f('0x3c')],{'$or':_['map'](_0x57d98d,function(_0x2cc15a){if(_0x2cc15a[_0x185f('0x3e')]!==_0x185f('0x3f')){var _0x47c2d3={};_0x47c2d3[_0x2cc15a[_0x185f('0x29')]]={'$like':'%'+_0x1d6ed8[_0x185f('0x30')]['filter']+'%'};return _0x47c2d3;}})});}_0x414f30=_['merge']({},_0x414f30,_0x1d6ed8[_0x185f('0x40')]);var _0x3e8b51={'where':_0x414f30[_0x185f('0x3c')]};return db['SalesforceConfiguration'][_0x185f('0x1e')](_0x3e8b51)['then'](function(_0x4d29fa){_0x49b86c['count']=_0x4d29fa;if(_0x1d6ed8[_0x185f('0x30')][_0x185f('0x41')]){_0x414f30['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x185f('0x42')](_0x414f30);})[_0x185f('0x25')](function(_0xc44343){_0x49b86c[_0x185f('0x43')]=_0xc44343;return _0x49b86c;})[_0x185f('0x25')](respondWithFilteredResult(_0x154c8f,_0x414f30))['catch'](handleError(_0x154c8f,null));};exports[_0x185f('0x44')]=function(_0x26d775,_0x7b10f1){var _0x23f85c={'raw':![],'where':{'id':_0x26d775[_0x185f('0x45')]['id']}},_0x446593={};_0x446593[_0x185f('0x2f')]=_[_0x185f('0x31')](db[_0x185f('0x46')][_0x185f('0x2c')]);_0x446593['query']=_['keys'](_0x26d775[_0x185f('0x30')]);_0x446593[_0x185f('0x32')]=_[_0x185f('0x33')](_0x446593[_0x185f('0x2f')],_0x446593[_0x185f('0x30')]);_0x23f85c[_0x185f('0x34')]=_[_0x185f('0x33')](_0x446593[_0x185f('0x2f')],qs[_0x185f('0x35')](_0x26d775['query'][_0x185f('0x35')]));_0x23f85c[_0x185f('0x34')]=_0x23f85c['attributes']['length']?_0x23f85c[_0x185f('0x34')]:_0x446593[_0x185f('0x2f')];if(_0x26d775[_0x185f('0x30')][_0x185f('0x41')]){_0x23f85c[_0x185f('0x47')]=[{'all':!![]}];}_0x23f85c=_[_0x185f('0x3d')]({},_0x23f85c,_0x26d775['options']);return db['SalesforceConfiguration']['find'](_0x23f85c)['then'](handleEntityNotFound(_0x7b10f1,null))[_0x185f('0x25')](respondWithResult(_0x7b10f1,null))[_0x185f('0x48')](handleError(_0x7b10f1,null));};exports[_0x185f('0x49')]=function(_0x500309,_0x2f451c){return db[_0x185f('0x46')][_0x185f('0x49')](_0x500309[_0x185f('0x4a')],{})[_0x185f('0x25')](respondWithResult(_0x2f451c,0xc9))['catch'](handleError(_0x2f451c,null));};exports['update']=function(_0x372b49,_0x4886ef){if(_0x372b49['body']['id']){delete _0x372b49['body']['id'];}return db['SalesforceConfiguration'][_0x185f('0x4b')]({'where':{'id':_0x372b49['params']['id']}})[_0x185f('0x25')](handleEntityNotFound(_0x4886ef,null))[_0x185f('0x25')](saveUpdates(_0x372b49['body'],null))['then'](respondWithResult(_0x4886ef,null))[_0x185f('0x48')](handleError(_0x4886ef,null));};exports[_0x185f('0x26')]=function(_0x3607ed,_0x2dcb00){return db['SalesforceConfiguration'][_0x185f('0x4b')]({'where':{'id':_0x3607ed[_0x185f('0x45')]['id']}})[_0x185f('0x25')](handleEntityNotFound(_0x2dcb00,null))[_0x185f('0x25')](removeEntity(_0x2dcb00,null))['catch'](handleError(_0x2dcb00,null));};exports[_0x185f('0x4c')]=function(_0x31b3c8,_0x2b90d9,_0x311ec3){var _0x2d2e8b={};var _0xdfe5b0={};var _0x54b988;var _0x492bc6;return db[_0x185f('0x46')]['findOne']({'where':{'id':_0x31b3c8['params']['id']}})[_0x185f('0x25')](handleEntityNotFound(_0x2b90d9,null))['then'](function(_0x421270){if(_0x421270){_0x54b988=_0x421270;_0xdfe5b0[_0x185f('0x2f')]=_[_0x185f('0x31')](db[_0x185f('0x4d')][_0x185f('0x2c')]);_0xdfe5b0[_0x185f('0x30')]=_[_0x185f('0x31')](_0x31b3c8[_0x185f('0x30')]);_0xdfe5b0[_0x185f('0x32')]=_['intersection'](_0xdfe5b0[_0x185f('0x2f')],_0xdfe5b0[_0x185f('0x30')]);_0x2d2e8b[_0x185f('0x34')]=_[_0x185f('0x33')](_0xdfe5b0[_0x185f('0x2f')],qs['fields'](_0x31b3c8[_0x185f('0x30')][_0x185f('0x35')]));_0x2d2e8b[_0x185f('0x34')]=_0x2d2e8b[_0x185f('0x34')][_0x185f('0x36')]?_0x2d2e8b[_0x185f('0x34')]:_0xdfe5b0[_0x185f('0x2f')];_0x2d2e8b[_0x185f('0x4e')]=qs['sort'](_0x31b3c8['query'][_0x185f('0x39')]);_0x2d2e8b[_0x185f('0x3c')]=qs[_0x185f('0x32')](_[_0x185f('0x3a')](_0x31b3c8['query'],_0xdfe5b0[_0x185f('0x32')]));if(_0x31b3c8[_0x185f('0x30')][_0x185f('0x3b')]){_0x2d2e8b[_0x185f('0x3c')]=_[_0x185f('0x3d')](_0x2d2e8b[_0x185f('0x3c')],{'$or':_[_0x185f('0x4f')](_0x2d2e8b[_0x185f('0x34')],function(_0x105603){var _0x10aea1={};_0x10aea1[_0x105603]={'$like':'%'+_0x31b3c8[_0x185f('0x30')][_0x185f('0x3b')]+'%'};return _0x10aea1;})});}_0x2d2e8b=_['merge']({},_0x2d2e8b,_0x31b3c8[_0x185f('0x40')]);return _0x54b988['getFields'](_0x2d2e8b);}})['then'](function(_0x393309){if(_0x393309){_0x492bc6=_0x393309[_0x185f('0x36')];if(!_0x31b3c8[_0x185f('0x30')][_0x185f('0x37')]('nolimit')){_0x2d2e8b['limit']=qs[_0x185f('0x1d')](_0x31b3c8[_0x185f('0x30')]['limit']);_0x2d2e8b[_0x185f('0x1b')]=qs[_0x185f('0x1b')](_0x31b3c8[_0x185f('0x30')][_0x185f('0x1b')]);}return _0x54b988[_0x185f('0x4c')](_0x2d2e8b);}})[_0x185f('0x25')](function(_0xb9e6dd){if(_0xb9e6dd){return _0xb9e6dd?{'count':_0x492bc6,'rows':_0xb9e6dd}:null;}})[_0x185f('0x25')](respondWithResult(_0x2b90d9,null))[_0x185f('0x48')](handleError(_0x2b90d9,null));};exports[_0x185f('0x50')]=function(_0x255ff0,_0x42182c,_0x7c4333){var _0x1e9cb1={};var _0x3d9c97={};var _0x423223;var _0x500f93;return db[_0x185f('0x46')][_0x185f('0x51')]({'where':{'id':_0x255ff0[_0x185f('0x45')]['id']}})[_0x185f('0x25')](handleEntityNotFound(_0x42182c,null))[_0x185f('0x25')](function(_0x2fdd97){if(_0x2fdd97){_0x423223=_0x2fdd97;_0x3d9c97[_0x185f('0x2f')]=_['keys'](db[_0x185f('0x4d')][_0x185f('0x2c')]);_0x3d9c97[_0x185f('0x30')]=_[_0x185f('0x31')](_0x255ff0['query']);_0x3d9c97[_0x185f('0x32')]=_[_0x185f('0x33')](_0x3d9c97['model'],_0x3d9c97[_0x185f('0x30')]);_0x1e9cb1['attributes']=_['intersection'](_0x3d9c97[_0x185f('0x2f')],qs[_0x185f('0x35')](_0x255ff0[_0x185f('0x30')][_0x185f('0x35')]));_0x1e9cb1[_0x185f('0x34')]=_0x1e9cb1[_0x185f('0x34')][_0x185f('0x36')]?_0x1e9cb1[_0x185f('0x34')]:_0x3d9c97[_0x185f('0x2f')];_0x1e9cb1[_0x185f('0x4e')]=qs[_0x185f('0x39')](_0x255ff0[_0x185f('0x30')][_0x185f('0x39')]);_0x1e9cb1['where']=qs[_0x185f('0x32')](_[_0x185f('0x3a')](_0x255ff0[_0x185f('0x30')],_0x3d9c97[_0x185f('0x32')]));if(_0x255ff0['query'][_0x185f('0x3b')]){_0x1e9cb1[_0x185f('0x3c')]=_[_0x185f('0x3d')](_0x1e9cb1['where'],{'$or':_[_0x185f('0x4f')](_0x1e9cb1[_0x185f('0x34')],function(_0x16f66d){var _0x1cc129={};_0x1cc129[_0x16f66d]={'$like':'%'+_0x255ff0[_0x185f('0x30')][_0x185f('0x3b')]+'%'};return _0x1cc129;})});}_0x1e9cb1=_[_0x185f('0x3d')]({},_0x1e9cb1,_0x255ff0['options']);return _0x423223[_0x185f('0x50')](_0x1e9cb1);}})[_0x185f('0x25')](function(_0x528df7){if(_0x528df7){_0x500f93=_0x528df7['length'];if(!_0x255ff0[_0x185f('0x30')]['hasOwnProperty'](_0x185f('0x38'))){_0x1e9cb1[_0x185f('0x1d')]=qs['limit'](_0x255ff0[_0x185f('0x30')]['limit']);_0x1e9cb1[_0x185f('0x1b')]=qs['offset'](_0x255ff0['query'][_0x185f('0x1b')]);}return _0x423223[_0x185f('0x50')](_0x1e9cb1);}})[_0x185f('0x25')](function(_0x17b8e3){if(_0x17b8e3){return _0x17b8e3?{'count':_0x500f93,'rows':_0x17b8e3}:null;}})[_0x185f('0x25')](respondWithResult(_0x42182c,null))[_0x185f('0x48')](handleError(_0x42182c,null));};exports[_0x185f('0x52')]=function(_0x5b8cd6,_0xab39f1,_0x43ffca){var _0x41b528={};var _0x3b6307={};var _0x597f42;var _0x34b7cb;return db[_0x185f('0x46')][_0x185f('0x51')]({'where':{'id':_0x5b8cd6['params']['id']}})[_0x185f('0x25')](handleEntityNotFound(_0xab39f1,null))[_0x185f('0x25')](function(_0x22eee4){if(_0x22eee4){_0x597f42=_0x22eee4;_0x3b6307[_0x185f('0x2f')]=_['keys'](db[_0x185f('0x4d')][_0x185f('0x2c')]);_0x3b6307[_0x185f('0x30')]=_[_0x185f('0x31')](_0x5b8cd6[_0x185f('0x30')]);_0x3b6307['filters']=_[_0x185f('0x33')](_0x3b6307[_0x185f('0x2f')],_0x3b6307[_0x185f('0x30')]);_0x41b528[_0x185f('0x34')]=_['intersection'](_0x3b6307['model'],qs['fields'](_0x5b8cd6['query']['fields']));_0x41b528[_0x185f('0x34')]=_0x41b528['attributes'][_0x185f('0x36')]?_0x41b528['attributes']:_0x3b6307[_0x185f('0x2f')];_0x41b528[_0x185f('0x4e')]=qs[_0x185f('0x39')](_0x5b8cd6[_0x185f('0x30')][_0x185f('0x39')]);_0x41b528['where']=qs[_0x185f('0x32')](_['pick'](_0x5b8cd6[_0x185f('0x30')],_0x3b6307[_0x185f('0x32')]));if(_0x5b8cd6[_0x185f('0x30')][_0x185f('0x3b')]){_0x41b528[_0x185f('0x3c')]=_[_0x185f('0x3d')](_0x41b528[_0x185f('0x3c')],{'$or':_[_0x185f('0x4f')](_0x41b528[_0x185f('0x34')],function(_0x23c006){var _0x1dd44c={};_0x1dd44c[_0x23c006]={'$like':'%'+_0x5b8cd6[_0x185f('0x30')][_0x185f('0x3b')]+'%'};return _0x1dd44c;})});}_0x41b528=_['merge']({},_0x41b528,_0x5b8cd6['options']);return _0x597f42[_0x185f('0x52')](_0x41b528);}})[_0x185f('0x25')](function(_0x4cbae8){if(_0x4cbae8){_0x34b7cb=_0x4cbae8[_0x185f('0x36')];if(!_0x5b8cd6['query'][_0x185f('0x37')]('nolimit')){_0x41b528[_0x185f('0x1d')]=qs[_0x185f('0x1d')](_0x5b8cd6[_0x185f('0x30')][_0x185f('0x1d')]);_0x41b528[_0x185f('0x1b')]=qs['offset'](_0x5b8cd6[_0x185f('0x30')][_0x185f('0x1b')]);}return _0x597f42[_0x185f('0x52')](_0x41b528);}})['then'](function(_0x99f232){if(_0x99f232){return _0x99f232?{'count':_0x34b7cb,'rows':_0x99f232}:null;}})[_0x185f('0x25')](respondWithResult(_0xab39f1,null))[_0x185f('0x48')](handleError(_0xab39f1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 13e4333..aa4e267 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 _0x0a49=['int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','exports','define','SalesforceConfiguration'];(function(_0x2dd7d2,_0xe80bc1){var _0x2a234b=function(_0x40ed34){while(--_0x40ed34){_0x2dd7d2['push'](_0x2dd7d2['shift']());}};_0x2a234b(++_0xe80bc1);}(_0x0a49,0x1c4));var _0x90a4=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0a49[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0x90a4('0x0'));var util=require(_0x90a4('0x1'));var logger=require('../../config/logger')(_0x90a4('0x2'));var moment=require(_0x90a4('0x3'));var BPromise=require(_0x90a4('0x4'));var rp=require(_0x90a4('0x5'));var fs=require('fs');var path=require(_0x90a4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x90a4('0x7')]=function(_0x247ae8,_0x3a1e8c){return _0x247ae8[_0x90a4('0x8')](_0x90a4('0x9'),attributes,{'tableName':_0x90a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25b=['bluebird','request-promise','rimraf','../../config/environment','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api'];(function(_0x4edc38,_0x26867e){var _0x182c61=function(_0x39c3ed){while(--_0x39c3ed){_0x4edc38['push'](_0x4edc38['shift']());}};_0x182c61(++_0x26867e);}(_0xa25b,0x1ee));var _0xba25=function(_0x2f72a5,_0x123095){_0x2f72a5=_0x2f72a5-0x0;var _0x4a5a20=_0xa25b[_0x2f72a5];return _0x4a5a20;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba25('0x0'))(_0xba25('0x1'));var moment=require('moment');var BPromise=require(_0xba25('0x2'));var rp=require(_0xba25('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba25('0x4'));var config=require(_0xba25('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x296b73,_0x433659){return _0x296b73['define'](_0xba25('0x6'),attributes,{'tableName':_0xba25('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 13acf3b..ce3e73b 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 _0x0383=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x2ff297,_0x3554f9){var _0x104f48=function(_0xa1d95b){while(--_0xa1d95b){_0x2ff297['push'](_0x2ff297['shift']());}};_0x104f48(++_0x3554f9);}(_0x0383,0x14d));var _0x3038=function(_0x18bb67,_0x5eff3d){_0x18bb67=_0x18bb67-0x0;var _0x149f9a=_0x0383[_0x18bb67];return _0x149f9a;};'use strict';var _=require(_0x3038('0x0'));var util=require(_0x3038('0x1'));var moment=require(_0x3038('0x2'));var BPromise=require(_0x3038('0x3'));var rs=require(_0x3038('0x4'));var fs=require('fs');var Redis=require(_0x3038('0x5'));var db=require(_0x3038('0x6'))['db'];var utils=require(_0x3038('0x7'));var logger=require(_0x3038('0x8'))(_0x3038('0x9'));var config=require(_0x3038('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3038('0xb')][_0x3038('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bd611,_0x1a337f,_0x127e9a){return new BPromise(function(_0x20948b,_0x429fd6){return client[_0x3038('0xd')](_0x2bd611,_0x127e9a)[_0x3038('0xe')](function(_0x5a7517){logger[_0x3038('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1a337f,_0x3038('0x10'));logger['debug'](_0x3038('0x11'),_0x1a337f,_0x3038('0x10'),JSON[_0x3038('0x12')](_0x5a7517));if(_0x5a7517[_0x3038('0x13')]){if(_0x5a7517[_0x3038('0x13')][_0x3038('0x14')]===0x1f4){logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);return _0x429fd6(_0x5a7517['error'][_0x3038('0x16')]);}logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);return _0x20948b(_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);}else{logger[_0x3038('0xf')](_0x3038('0x15'),_0x1a337f,_0x3038('0x10'));_0x20948b(_0x5a7517['result'][_0x3038('0x16')]);}})[_0x3038('0x17')](function(_0x9d278f){logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x9d278f);_0x429fd6(_0x9d278f);});});} \ No newline at end of file +var _0x8bb8=['ioredis','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x57522d,_0x457052){var _0x5b51b5=function(_0x59e0b6){while(--_0x59e0b6){_0x57522d['push'](_0x57522d['shift']());}};_0x5b51b5(++_0x457052);}(_0x8bb8,0x1bf));var _0x88bb=function(_0x85f720,_0x813776){_0x85f720=_0x85f720-0x0;var _0x5cba2c=_0x8bb8[_0x85f720];return _0x5cba2c;};'use strict';var _=require(_0x88bb('0x0'));var util=require('util');var moment=require(_0x88bb('0x1'));var BPromise=require(_0x88bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x88bb('0x4'));var jayson=require(_0x88bb('0x5'));var client=jayson[_0x88bb('0x6')][_0x88bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3db596,_0x18be65,_0x2785bc){return new BPromise(function(_0x55f3a5,_0x39fd64){return client[_0x88bb('0x8')](_0x3db596,_0x2785bc)[_0x88bb('0x9')](function(_0x106336){logger['info'](_0x88bb('0xa'),_0x18be65,'request\x20sent');logger['debug'](_0x88bb('0xb'),_0x18be65,_0x88bb('0xc'),JSON[_0x88bb('0xd')](_0x106336));if(_0x106336[_0x88bb('0xe')]){if(_0x106336['error']['code']===0x1f4){logger[_0x88bb('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18be65,_0x106336['error']['message']);return _0x39fd64(_0x106336[_0x88bb('0xe')][_0x88bb('0xf')]);}logger[_0x88bb('0xe')](_0x88bb('0xa'),_0x18be65,_0x106336[_0x88bb('0xe')][_0x88bb('0xf')]);return _0x55f3a5(_0x106336['error'][_0x88bb('0xf')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18be65,_0x88bb('0xc'));_0x55f3a5(_0x106336[_0x88bb('0x10')][_0x88bb('0xf')]);}})[_0x88bb('0x11')](function(_0xd45176){logger[_0x88bb('0xe')](_0x88bb('0xa'),_0x18be65,_0xd45176);_0x39fd64(_0xd45176);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 027d6a6..42cd60a 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 _0x4286=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x4b744a,_0x308bef){var _0x4572fc=function(_0x53f5c4){while(--_0x53f5c4){_0x4b744a['push'](_0x4b744a['shift']());}};_0x4572fc(++_0x308bef);}(_0x4286,0xbd));var _0x6428=function(_0x4922a4,_0x49fbc2){_0x4922a4=_0x4922a4-0x0;var _0x1fef26=_0x4286[_0x4922a4];return _0x1fef26;};'use strict';var multer=require(_0x6428('0x0'));var util=require(_0x6428('0x1'));var path=require(_0x6428('0x2'));var timeout=require(_0x6428('0x3'));var express=require(_0x6428('0x4'));var router=express[_0x6428('0x5')]();var fs_extra=require(_0x6428('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6428('0x7'));var config=require(_0x6428('0x8'));var controller=require(_0x6428('0x9'));router[_0x6428('0xa')]('/',auth[_0x6428('0xb')](),controller[_0x6428('0xc')]);router[_0x6428('0xa')](_0x6428('0xd'),auth[_0x6428('0xb')](),controller[_0x6428('0xe')]);router[_0x6428('0xf')]('/',auth['isAuthenticated'](),controller[_0x6428('0x10')]);router[_0x6428('0x11')](_0x6428('0xd'),auth['isAuthenticated'](),controller[_0x6428('0x12')]);router['delete'](_0x6428('0xd'),auth['isAuthenticated'](),controller[_0x6428('0x13')]);module[_0x6428('0x14')]=router; \ No newline at end of file +var _0xe94c=['index','/:id','isAuthenticated','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xe94c,0x75));var _0xce94=function(_0x57340d,_0x441afb){_0x57340d=_0x57340d-0x0;var _0x2f9677=_0xe94c[_0x57340d];return _0x2f9677;};'use strict';var multer=require(_0xce94('0x0'));var util=require('util');var path=require(_0xce94('0x1'));var timeout=require('connect-timeout');var express=require(_0xce94('0x2'));var router=express[_0xce94('0x3')]();var fs_extra=require(_0xce94('0x4'));var auth=require(_0xce94('0x5'));var interaction=require(_0xce94('0x6'));var config=require(_0xce94('0x7'));var controller=require('./intSalesforceField.controller');router[_0xce94('0x8')]('/',auth['isAuthenticated'](),controller[_0xce94('0x9')]);router[_0xce94('0x8')](_0xce94('0xa'),auth[_0xce94('0xb')](),controller['show']);router[_0xce94('0xc')]('/',auth[_0xce94('0xb')](),controller[_0xce94('0xd')]);router[_0xce94('0xe')](_0xce94('0xa'),auth['isAuthenticated'](),controller[_0xce94('0xf')]);router['delete'](_0xce94('0xa'),auth[_0xce94('0xb')](),controller[_0xce94('0x10')]);module[_0xce94('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 42e704b..d2ae2da 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 _0x8361=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x1bd8fd,_0x526cee){var _0x36f371=function(_0x14b14e){while(--_0x14b14e){_0x1bd8fd['push'](_0x1bd8fd['shift']());}};_0x36f371(++_0x526cee);}(_0x8361,0x138));var _0x1836=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x8361[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x1836('0x0'));module[_0x1836('0x1')]={'type':{'type':Sequelize[_0x1836('0x2')](_0x1836('0x3'),_0x1836('0x4'),_0x1836('0x5'),_0x1836('0x6'),_0x1836('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1836('0x8')]},'key':{'type':Sequelize[_0x1836('0x8')]},'keyType':{'type':Sequelize[_0x1836('0x2')](_0x1836('0x3'),_0x1836('0x4'),_0x1836('0x5'))},'keyContent':{'type':Sequelize[_0x1836('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1836('0x8')]}}; \ No newline at end of file +var _0xc03e=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xc03e,0x14a));var _0xec03=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xc03e[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0xec03('0x0'));module[_0xec03('0x1')]={'type':{'type':Sequelize[_0xec03('0x2')]('string',_0xec03('0x3'),_0xec03('0x4'),_0xec03('0x5'),_0xec03('0x6')),'defaultValue':_0xec03('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xec03('0x8')]},'keyType':{'type':Sequelize[_0xec03('0x2')](_0xec03('0x7'),'variable',_0xec03('0x4'))},'keyContent':{'type':Sequelize[_0xec03('0x8')]},'idField':{'type':Sequelize[_0xec03('0x8')]},'variableName':{'type':Sequelize[_0xec03('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 164ce7a..8c7f662 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 _0x2328=['end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x387583,_0x127b08){var _0x45d2f9=function(_0x1d82ac){while(--_0x1d82ac){_0x387583['push'](_0x387583['shift']());}};_0x45d2f9(++_0x127b08);}(_0x2328,0x157));var _0x8232=function(_0x4c5b96,_0x3b5217){_0x4c5b96=_0x4c5b96-0x0;var _0x2d8d25=_0x2328[_0x4c5b96];return _0x2d8d25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8232('0x0'));var zipdir=require(_0x8232('0x1'));var jsonpatch=require(_0x8232('0x2'));var rp=require(_0x8232('0x3'));var moment=require(_0x8232('0x4'));var BPromise=require(_0x8232('0x5'));var Mustache=require('mustache');var util=require(_0x8232('0x6'));var path=require('path');var sox=require(_0x8232('0x7'));var csv=require(_0x8232('0x8'));var ejs=require(_0x8232('0x9'));var fs=require('fs');var fs_extra=require(_0x8232('0xa'));var _=require('lodash');var squel=require(_0x8232('0xb'));var crypto=require('crypto');var jsforce=require(_0x8232('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8232('0x8'));var querystring=require(_0x8232('0xd'));var Papa=require(_0x8232('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8232('0xf'));var hardwareService=require(_0x8232('0x10'));var logger=require('../../config/logger')(_0x8232('0x11'));var utils=require(_0x8232('0x12'));var config=require(_0x8232('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8232('0x14'))['db'];function respondWithStatusCode(_0x1e4d0e,_0xd1f938){_0xd1f938=_0xd1f938||0xcc;return function(_0x47d3d6){if(_0x47d3d6){return _0x1e4d0e['sendStatus'](_0xd1f938);}return _0x1e4d0e[_0x8232('0x15')](_0xd1f938)[_0x8232('0x16')]();};}function respondWithResult(_0x7e04f6,_0x1552c7){_0x1552c7=_0x1552c7||0xc8;return function(_0x40a763){if(_0x40a763){return _0x7e04f6[_0x8232('0x15')](_0x1552c7)[_0x8232('0x17')](_0x40a763);}};}function respondWithFilteredResult(_0xf399c7,_0x5a6eec){return function(_0x136474){if(_0x136474){var _0x2a26a9=typeof _0x5a6eec['offset']===_0x8232('0x18')&&typeof _0x5a6eec[_0x8232('0x19')]===_0x8232('0x18');var _0x40e204=_0x136474['count'];var _0x3769f7=_0x2a26a9?0x0:_0x5a6eec[_0x8232('0x1a')];var _0x5c3400=_0x2a26a9?_0x136474[_0x8232('0x1b')]:_0x5a6eec[_0x8232('0x1a')]+_0x5a6eec[_0x8232('0x19')];var _0x3391af;if(_0x5c3400>=_0x40e204){_0x5c3400=_0x40e204;_0x3391af=0xc8;}else{_0x3391af=0xce;}_0xf399c7[_0x8232('0x15')](_0x3391af);return _0xf399c7[_0x8232('0x1c')](_0x8232('0x1d'),_0x3769f7+'-'+_0x5c3400+'/'+_0x40e204)['json'](_0x136474);}return null;};}function patchUpdates(_0x273749){return function(_0x3d50e8){try{jsonpatch[_0x8232('0x1e')](_0x3d50e8,_0x273749,!![]);}catch(_0x244974){return BPromise[_0x8232('0x1f')](_0x244974);}return _0x3d50e8[_0x8232('0x20')]();};}function saveUpdates(_0x324525,_0x5253c6){return function(_0x13d69c){if(_0x13d69c){return _0x13d69c[_0x8232('0x21')](_0x324525)[_0x8232('0x22')](function(_0xf8db56){return _0xf8db56;});}return null;};}function removeEntity(_0x444995,_0x40d24f){return function(_0x454ef1){if(_0x454ef1){return _0x454ef1[_0x8232('0x23')]()['then'](function(){_0x444995[_0x8232('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f29e,_0x83d304){return function(_0x55ae64){if(!_0x55ae64){_0x14f29e[_0x8232('0x24')](0x194);}return _0x55ae64;};}function handleError(_0x2d980f,_0x4653c8){_0x4653c8=_0x4653c8||0x1f4;return function(_0x57c5dd){logger[_0x8232('0x25')](_0x57c5dd[_0x8232('0x26')]);if(_0x57c5dd[_0x8232('0x27')]){delete _0x57c5dd['name'];}_0x2d980f[_0x8232('0x15')](_0x4653c8)[_0x8232('0x28')](_0x57c5dd);};}exports['index']=function(_0x3f94c7,_0x14c9c3){var _0x194596={},_0x442629={},_0x27d165={'count':0x0,'rows':[]};var _0x5783c2=_[_0x8232('0x29')](db[_0x8232('0x2a')][_0x8232('0x2b')],function(_0x176650){return{'name':_0x176650[_0x8232('0x2c')],'type':_0x176650[_0x8232('0x2d')]['key']};});_0x442629[_0x8232('0x2e')]=_[_0x8232('0x29')](_0x5783c2,_0x8232('0x27'));_0x442629[_0x8232('0x2f')]=_[_0x8232('0x30')](_0x3f94c7[_0x8232('0x2f')]);_0x442629[_0x8232('0x31')]=_[_0x8232('0x32')](_0x442629[_0x8232('0x2e')],_0x442629[_0x8232('0x2f')]);_0x194596[_0x8232('0x33')]=_['intersection'](_0x442629[_0x8232('0x2e')],qs['fields'](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x34')]));_0x194596[_0x8232('0x33')]=_0x194596['attributes']['length']?_0x194596['attributes']:_0x442629[_0x8232('0x2e')];if(!_0x3f94c7[_0x8232('0x2f')][_0x8232('0x35')](_0x8232('0x36'))){_0x194596[_0x8232('0x19')]=qs['limit'](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x19')]);_0x194596[_0x8232('0x1a')]=qs[_0x8232('0x1a')](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x1a')]);}_0x194596[_0x8232('0x37')]=qs[_0x8232('0x38')](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x38')]);_0x194596[_0x8232('0x39')]=qs['filters'](_[_0x8232('0x3a')](_0x3f94c7[_0x8232('0x2f')],_0x442629[_0x8232('0x31')]),_0x5783c2);if(_0x3f94c7[_0x8232('0x2f')]['filter']){_0x194596[_0x8232('0x39')]=_[_0x8232('0x3b')](_0x194596[_0x8232('0x39')],{'$or':_[_0x8232('0x29')](_0x5783c2,function(_0x1d8a7f){if(_0x1d8a7f[_0x8232('0x2d')]!==_0x8232('0x3c')){var _0x1e2fa4={};_0x1e2fa4[_0x1d8a7f[_0x8232('0x27')]]={'$like':'%'+_0x3f94c7['query']['filter']+'%'};return _0x1e2fa4;}})});}_0x194596=_[_0x8232('0x3b')]({},_0x194596,_0x3f94c7[_0x8232('0x3d')]);var _0x582995={'where':_0x194596['where']};return db[_0x8232('0x2a')][_0x8232('0x1b')](_0x582995)[_0x8232('0x22')](function(_0x3512b7){_0x27d165['count']=_0x3512b7;if(_0x3f94c7['query']['includeAll']){_0x194596[_0x8232('0x3e')]=[{'all':!![]}];}return db[_0x8232('0x2a')][_0x8232('0x3f')](_0x194596);})[_0x8232('0x22')](function(_0x525d72){_0x27d165[_0x8232('0x40')]=_0x525d72;return _0x27d165;})[_0x8232('0x22')](respondWithFilteredResult(_0x14c9c3,_0x194596))[_0x8232('0x41')](handleError(_0x14c9c3,null));};exports[_0x8232('0x42')]=function(_0x56f19b,_0x39bfd7){var _0xf58046={'raw':!![],'where':{'id':_0x56f19b[_0x8232('0x43')]['id']}},_0x46b93f={};_0x46b93f[_0x8232('0x2e')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x46b93f[_0x8232('0x2f')]=_[_0x8232('0x30')](_0x56f19b['query']);_0x46b93f[_0x8232('0x31')]=_['intersection'](_0x46b93f[_0x8232('0x2e')],_0x46b93f['query']);_0xf58046['attributes']=_[_0x8232('0x32')](_0x46b93f[_0x8232('0x2e')],qs[_0x8232('0x34')](_0x56f19b[_0x8232('0x2f')][_0x8232('0x34')]));_0xf58046['attributes']=_0xf58046[_0x8232('0x33')][_0x8232('0x44')]?_0xf58046[_0x8232('0x33')]:_0x46b93f[_0x8232('0x2e')];if(_0x56f19b['query'][_0x8232('0x45')]){_0xf58046[_0x8232('0x3e')]=[{'all':!![]}];}_0xf58046=_[_0x8232('0x3b')]({},_0xf58046,_0x56f19b['options']);return db['SalesforceField'][_0x8232('0x46')](_0xf58046)[_0x8232('0x22')](handleEntityNotFound(_0x39bfd7,null))[_0x8232('0x22')](respondWithResult(_0x39bfd7,null))[_0x8232('0x41')](handleError(_0x39bfd7,null));};exports[_0x8232('0x47')]=function(_0x51cbf1,_0x2b1138){return db['SalesforceField']['create'](_0x51cbf1[_0x8232('0x48')],{})[_0x8232('0x22')](respondWithResult(_0x2b1138,0xc9))[_0x8232('0x41')](handleError(_0x2b1138,null));};exports[_0x8232('0x21')]=function(_0x1ccb51,_0x2cd8ae){if(_0x1ccb51[_0x8232('0x48')]['id']){delete _0x1ccb51[_0x8232('0x48')]['id'];}return db['SalesforceField'][_0x8232('0x46')]({'where':{'id':_0x1ccb51[_0x8232('0x43')]['id']}})[_0x8232('0x22')](handleEntityNotFound(_0x2cd8ae,null))['then'](saveUpdates(_0x1ccb51[_0x8232('0x48')],null))[_0x8232('0x22')](respondWithResult(_0x2cd8ae,null))['catch'](handleError(_0x2cd8ae,null));};exports[_0x8232('0x23')]=function(_0x776ddd,_0x13ccf9){return db['SalesforceField'][_0x8232('0x46')]({'where':{'id':_0x776ddd[_0x8232('0x43')]['id']}})[_0x8232('0x22')](handleEntityNotFound(_0x13ccf9,null))[_0x8232('0x22')](removeEntity(_0x13ccf9,null))[_0x8232('0x41')](handleError(_0x13ccf9,null));}; \ No newline at end of file +var _0x3833=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','save','update','then','destroy','error','stack','send','index','map','SalesforceField','rawAttributes','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3835ac,_0x3f5229){var _0x2e53d4=function(_0x2ef71f){while(--_0x2ef71f){_0x3835ac['push'](_0x3835ac['shift']());}};_0x2e53d4(++_0x3f5229);}(_0x3833,0x1b6));var _0x3383=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x3833[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x3383('0x0'));var rimraf=require(_0x3383('0x1'));var zipdir=require(_0x3383('0x2'));var jsonpatch=require(_0x3383('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3383('0x4'));var Mustache=require('mustache');var util=require(_0x3383('0x5'));var path=require(_0x3383('0x6'));var sox=require(_0x3383('0x7'));var csv=require(_0x3383('0x8'));var ejs=require(_0x3383('0x9'));var fs=require('fs');var fs_extra=require(_0x3383('0xa'));var _=require('lodash');var squel=require(_0x3383('0xb'));var crypto=require(_0x3383('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3383('0x8'));var querystring=require(_0x3383('0xd'));var Papa=require(_0x3383('0xe'));var Redis=require('ioredis');var authService=require(_0x3383('0xf'));var qs=require(_0x3383('0x10'));var as=require(_0x3383('0x11'));var hardwareService=require(_0x3383('0x12'));var logger=require(_0x3383('0x13'))('api');var utils=require(_0x3383('0x14'));var config=require(_0x3383('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3383('0x16'))['db'];function respondWithStatusCode(_0x1399e4,_0x406545){_0x406545=_0x406545||0xcc;return function(_0x24363d){if(_0x24363d){return _0x1399e4[_0x3383('0x17')](_0x406545);}return _0x1399e4[_0x3383('0x18')](_0x406545)[_0x3383('0x19')]();};}function respondWithResult(_0x3b3f4d,_0x38e4e6){_0x38e4e6=_0x38e4e6||0xc8;return function(_0x2db8b8){if(_0x2db8b8){return _0x3b3f4d[_0x3383('0x18')](_0x38e4e6)['json'](_0x2db8b8);}};}function respondWithFilteredResult(_0x5fb9ca,_0x9b673b){return function(_0x38dac9){if(_0x38dac9){var _0x119cc6=typeof _0x9b673b[_0x3383('0x1a')]===_0x3383('0x1b')&&typeof _0x9b673b[_0x3383('0x1c')]==='undefined';var _0x18665c=_0x38dac9['count'];var _0xae5bbc=_0x119cc6?0x0:_0x9b673b[_0x3383('0x1a')];var _0x4bb81c=_0x119cc6?_0x38dac9['count']:_0x9b673b[_0x3383('0x1a')]+_0x9b673b['limit'];var _0x22ea6f;if(_0x4bb81c>=_0x18665c){_0x4bb81c=_0x18665c;_0x22ea6f=0xc8;}else{_0x22ea6f=0xce;}_0x5fb9ca[_0x3383('0x18')](_0x22ea6f);return _0x5fb9ca['set'](_0x3383('0x1d'),_0xae5bbc+'-'+_0x4bb81c+'/'+_0x18665c)[_0x3383('0x1e')](_0x38dac9);}return null;};}function patchUpdates(_0x35a347){return function(_0x285218){try{jsonpatch['apply'](_0x285218,_0x35a347,!![]);}catch(_0x1bb7cc){return BPromise['reject'](_0x1bb7cc);}return _0x285218[_0x3383('0x1f')]();};}function saveUpdates(_0x4c2698,_0x3f8178){return function(_0x5cabb0){if(_0x5cabb0){return _0x5cabb0[_0x3383('0x20')](_0x4c2698)[_0x3383('0x21')](function(_0x2ddf55){return _0x2ddf55;});}return null;};}function removeEntity(_0x29343c,_0x20ac88){return function(_0x3652ed){if(_0x3652ed){return _0x3652ed[_0x3383('0x22')]()[_0x3383('0x21')](function(){_0x29343c[_0x3383('0x18')](0xcc)[_0x3383('0x19')]();});}};}function handleEntityNotFound(_0x437571,_0x469465){return function(_0x46dbdc){if(!_0x46dbdc){_0x437571[_0x3383('0x17')](0x194);}return _0x46dbdc;};}function handleError(_0x4c4435,_0x432ad5){_0x432ad5=_0x432ad5||0x1f4;return function(_0x58bdac){logger[_0x3383('0x23')](_0x58bdac[_0x3383('0x24')]);if(_0x58bdac['name']){delete _0x58bdac['name'];}_0x4c4435[_0x3383('0x18')](_0x432ad5)[_0x3383('0x25')](_0x58bdac);};}exports[_0x3383('0x26')]=function(_0xd5ce9d,_0x6c28bd){var _0x102c3c={},_0x29facd={},_0x1237e2={'count':0x0,'rows':[]};var _0x267d24=_[_0x3383('0x27')](db[_0x3383('0x28')][_0x3383('0x29')],function(_0x2133cc){return{'name':_0x2133cc['fieldName'],'type':_0x2133cc['type']['key']};});_0x29facd[_0x3383('0x2a')]=_['map'](_0x267d24,_0x3383('0x2b'));_0x29facd[_0x3383('0x2c')]=_[_0x3383('0x2d')](_0xd5ce9d['query']);_0x29facd[_0x3383('0x2e')]=_[_0x3383('0x2f')](_0x29facd[_0x3383('0x2a')],_0x29facd[_0x3383('0x2c')]);_0x102c3c[_0x3383('0x30')]=_[_0x3383('0x2f')](_0x29facd[_0x3383('0x2a')],qs[_0x3383('0x31')](_0xd5ce9d['query'][_0x3383('0x31')]));_0x102c3c[_0x3383('0x30')]=_0x102c3c[_0x3383('0x30')]['length']?_0x102c3c[_0x3383('0x30')]:_0x29facd[_0x3383('0x2a')];if(!_0xd5ce9d[_0x3383('0x2c')][_0x3383('0x32')](_0x3383('0x33'))){_0x102c3c[_0x3383('0x1c')]=qs['limit'](_0xd5ce9d[_0x3383('0x2c')][_0x3383('0x1c')]);_0x102c3c['offset']=qs[_0x3383('0x1a')](_0xd5ce9d['query'][_0x3383('0x1a')]);}_0x102c3c[_0x3383('0x34')]=qs['sort'](_0xd5ce9d[_0x3383('0x2c')][_0x3383('0x35')]);_0x102c3c[_0x3383('0x36')]=qs[_0x3383('0x2e')](_[_0x3383('0x37')](_0xd5ce9d[_0x3383('0x2c')],_0x29facd[_0x3383('0x2e')]),_0x267d24);if(_0xd5ce9d['query'][_0x3383('0x38')]){_0x102c3c['where']=_[_0x3383('0x39')](_0x102c3c[_0x3383('0x36')],{'$or':_[_0x3383('0x27')](_0x267d24,function(_0x2a3fa6){if(_0x2a3fa6[_0x3383('0x3a')]!==_0x3383('0x3b')){var _0x347dfb={};_0x347dfb[_0x2a3fa6[_0x3383('0x2b')]]={'$like':'%'+_0xd5ce9d[_0x3383('0x2c')][_0x3383('0x38')]+'%'};return _0x347dfb;}})});}_0x102c3c=_[_0x3383('0x39')]({},_0x102c3c,_0xd5ce9d[_0x3383('0x3c')]);var _0x4e7fc9={'where':_0x102c3c[_0x3383('0x36')]};return db[_0x3383('0x28')]['count'](_0x4e7fc9)['then'](function(_0x398672){_0x1237e2[_0x3383('0x3d')]=_0x398672;if(_0xd5ce9d[_0x3383('0x2c')][_0x3383('0x3e')]){_0x102c3c[_0x3383('0x3f')]=[{'all':!![]}];}return db[_0x3383('0x28')]['findAll'](_0x102c3c);})[_0x3383('0x21')](function(_0x3900f9){_0x1237e2['rows']=_0x3900f9;return _0x1237e2;})[_0x3383('0x21')](respondWithFilteredResult(_0x6c28bd,_0x102c3c))[_0x3383('0x40')](handleError(_0x6c28bd,null));};exports[_0x3383('0x41')]=function(_0x2e73f7,_0x4d19a1){var _0x2059ba={'raw':!![],'where':{'id':_0x2e73f7['params']['id']}},_0x5fae15={};_0x5fae15[_0x3383('0x2a')]=_[_0x3383('0x2d')](db[_0x3383('0x28')]['rawAttributes']);_0x5fae15['query']=_[_0x3383('0x2d')](_0x2e73f7[_0x3383('0x2c')]);_0x5fae15[_0x3383('0x2e')]=_[_0x3383('0x2f')](_0x5fae15['model'],_0x5fae15['query']);_0x2059ba['attributes']=_[_0x3383('0x2f')](_0x5fae15[_0x3383('0x2a')],qs[_0x3383('0x31')](_0x2e73f7[_0x3383('0x2c')][_0x3383('0x31')]));_0x2059ba['attributes']=_0x2059ba['attributes']['length']?_0x2059ba[_0x3383('0x30')]:_0x5fae15[_0x3383('0x2a')];if(_0x2e73f7[_0x3383('0x2c')]['includeAll']){_0x2059ba[_0x3383('0x3f')]=[{'all':!![]}];}_0x2059ba=_[_0x3383('0x39')]({},_0x2059ba,_0x2e73f7[_0x3383('0x3c')]);return db[_0x3383('0x28')][_0x3383('0x42')](_0x2059ba)[_0x3383('0x21')](handleEntityNotFound(_0x4d19a1,null))[_0x3383('0x21')](respondWithResult(_0x4d19a1,null))[_0x3383('0x40')](handleError(_0x4d19a1,null));};exports['create']=function(_0x3135d5,_0x53beef){return db[_0x3383('0x28')][_0x3383('0x43')](_0x3135d5['body'],{})[_0x3383('0x21')](respondWithResult(_0x53beef,0xc9))[_0x3383('0x40')](handleError(_0x53beef,null));};exports[_0x3383('0x20')]=function(_0x6c0c01,_0x1e379b){if(_0x6c0c01[_0x3383('0x44')]['id']){delete _0x6c0c01['body']['id'];}return db[_0x3383('0x28')]['find']({'where':{'id':_0x6c0c01[_0x3383('0x45')]['id']}})[_0x3383('0x21')](handleEntityNotFound(_0x1e379b,null))[_0x3383('0x21')](saveUpdates(_0x6c0c01[_0x3383('0x44')],null))[_0x3383('0x21')](respondWithResult(_0x1e379b,null))['catch'](handleError(_0x1e379b,null));};exports[_0x3383('0x22')]=function(_0x2baf39,_0x50c150){return db[_0x3383('0x28')][_0x3383('0x42')]({'where':{'id':_0x2baf39['params']['id']}})[_0x3383('0x21')](handleEntityNotFound(_0x50c150,null))[_0x3383('0x21')](removeEntity(_0x50c150,null))[_0x3383('0x40')](handleError(_0x50c150,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1893265..811c023 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 _0x0408=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0x0408,0xe9));var _0x8040=function(_0x1f0a91,_0x1223d4){_0x1f0a91=_0x1f0a91-0x0;var _0x157daa=_0x0408[_0x1f0a91];return _0x157daa;};'use strict';var _=require(_0x8040('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8040('0x1'));var moment=require(_0x8040('0x2'));var BPromise=require(_0x8040('0x3'));var rp=require(_0x8040('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8040('0x5'));var config=require(_0x8040('0x6'));var attributes=require(_0x8040('0x7'));module[_0x8040('0x8')]=function(_0x13a3e3,_0x877484){return _0x13a3e3[_0x8040('0x9')](_0x8040('0xa'),attributes,{'tableName':_0x8040('0xb'),'paranoid':![],'indexes':[{'name':_0x8040('0xc'),'fields':[_0x8040('0xd'),_0x8040('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x991f=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','lodash','util','../../config/logger'];(function(_0x54cfb3,_0x37303e){var _0x434eab=function(_0x202cb5){while(--_0x202cb5){_0x54cfb3['push'](_0x54cfb3['shift']());}};_0x434eab(++_0x37303e);}(_0x991f,0x171));var _0xf991=function(_0x2eb402,_0x70adf0){_0x2eb402=_0x2eb402-0x0;var _0x5d1793=_0x991f[_0x2eb402];return _0x5d1793;};'use strict';var _=require(_0xf991('0x0'));var util=require(_0xf991('0x1'));var logger=require(_0xf991('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf991('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf991('0x4'));var config=require(_0xf991('0x5'));var attributes=require(_0xf991('0x6'));module[_0xf991('0x7')]=function(_0x20e481,_0x361754){return _0x20e481[_0xf991('0x8')](_0xf991('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xf991('0xa'),'fields':[_0xf991('0xb'),'FieldId'],'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 eef3781..b7538b4 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 _0x15ca=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x50bf57,_0x4dcb09){var _0x4c9753=function(_0x403824){while(--_0x403824){_0x50bf57['push'](_0x50bf57['shift']());}};_0x4c9753(++_0x4dcb09);}(_0x15ca,0x108));var _0xa15c=function(_0x1ef0c5,_0xfbc02e){_0x1ef0c5=_0x1ef0c5-0x0;var _0x5c21d2=_0x15ca[_0x1ef0c5];return _0x5c21d2;};'use strict';var _=require(_0xa15c('0x0'));var util=require(_0xa15c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa15c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa15c('0x3'))['db'];var utils=require(_0xa15c('0x4'));var logger=require(_0xa15c('0x5'))(_0xa15c('0x6'));var config=require(_0xa15c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa15c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14eee5,_0x121403,_0x2bbaab){return new BPromise(function(_0x40d0ab,_0x37e2e7){return client['request'](_0x14eee5,_0x2bbaab)['then'](function(_0x367ec0){logger[_0xa15c('0x9')](_0xa15c('0xa'),_0x121403,_0xa15c('0xb'));logger[_0xa15c('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x121403,_0xa15c('0xb'),JSON[_0xa15c('0xd')](_0x367ec0));if(_0x367ec0[_0xa15c('0xe')]){if(_0x367ec0[_0xa15c('0xe')][_0xa15c('0xf')]===0x1f4){logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x367ec0[_0xa15c('0xe')]['message']);return _0x37e2e7(_0x367ec0[_0xa15c('0xe')][_0xa15c('0x10')]);}logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x367ec0['error'][_0xa15c('0x10')]);return _0x40d0ab(_0x367ec0['error'][_0xa15c('0x10')]);}else{logger[_0xa15c('0x9')](_0xa15c('0xa'),_0x121403,_0xa15c('0xb'));_0x40d0ab(_0x367ec0[_0xa15c('0x11')][_0xa15c('0x10')]);}})[_0xa15c('0x12')](function(_0x4c55d7){logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x4c55d7);_0x37e2e7(_0x4c55d7);});});} \ No newline at end of file +var _0x2967=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xeee344,_0x291948){var _0x2ad583=function(_0x42713e){while(--_0x42713e){_0xeee344['push'](_0xeee344['shift']());}};_0x2ad583(++_0x291948);}(_0x2967,0xf2));var _0x7296=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x2967[_0x4e90e3];return _0x295e5b;};'use strict';var _=require(_0x7296('0x0'));var util=require(_0x7296('0x1'));var moment=require(_0x7296('0x2'));var BPromise=require(_0x7296('0x3'));var rs=require(_0x7296('0x4'));var fs=require('fs');var Redis=require(_0x7296('0x5'));var db=require(_0x7296('0x6'))['db'];var utils=require(_0x7296('0x7'));var logger=require(_0x7296('0x8'))('rpc');var config=require(_0x7296('0x9'));var jayson=require(_0x7296('0xa'));var client=jayson['client'][_0x7296('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11308e,_0x22727e,_0x1a4507){return new BPromise(function(_0x12d12a,_0x2853a9){return client[_0x7296('0xc')](_0x11308e,_0x1a4507)[_0x7296('0xd')](function(_0x5e5077){logger[_0x7296('0xe')](_0x7296('0xf'),_0x22727e,_0x7296('0x10'));logger['debug'](_0x7296('0x11'),_0x22727e,_0x7296('0x10'),JSON[_0x7296('0x12')](_0x5e5077));if(_0x5e5077[_0x7296('0x13')]){if(_0x5e5077['error']['code']===0x1f4){logger[_0x7296('0x13')]('SalesforceField,\x20%s,\x20%s',_0x22727e,_0x5e5077[_0x7296('0x13')]['message']);return _0x2853a9(_0x5e5077[_0x7296('0x13')]['message']);}logger[_0x7296('0x13')]('SalesforceField,\x20%s,\x20%s',_0x22727e,_0x5e5077['error'][_0x7296('0x14')]);return _0x12d12a(_0x5e5077[_0x7296('0x13')][_0x7296('0x14')]);}else{logger[_0x7296('0xe')](_0x7296('0xf'),_0x22727e,_0x7296('0x10'));_0x12d12a(_0x5e5077[_0x7296('0x15')][_0x7296('0x14')]);}})[_0x7296('0x16')](function(_0x27c69d){logger[_0x7296('0x13')](_0x7296('0xf'),_0x22727e,_0x27c69d);_0x2853a9(_0x27c69d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 236e431..3ae21a4 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 _0xf756=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xf756,0x1ae));var _0x6f75=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf756[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x6f75('0x0'));var util=require(_0x6f75('0x1'));var path=require('path');var timeout=require(_0x6f75('0x2'));var express=require(_0x6f75('0x3'));var router=express['Router']();var fs_extra=require(_0x6f75('0x4'));var auth=require(_0x6f75('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f75('0x6'));var controller=require(_0x6f75('0x7'));router[_0x6f75('0x8')]('/',auth[_0x6f75('0x9')](),controller[_0x6f75('0xa')]);router[_0x6f75('0x8')](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0xc')]);router[_0x6f75('0x8')](_0x6f75('0xd'),auth[_0x6f75('0x9')](),controller[_0x6f75('0xe')]);router[_0x6f75('0x8')](_0x6f75('0xf'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x10')]);router[_0x6f75('0x11')]('/',auth[_0x6f75('0x9')](),controller[_0x6f75('0x12')]);router[_0x6f75('0x11')](_0x6f75('0xd'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x13')]);router['put'](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x14')]);router[_0x6f75('0x15')](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x16')]);module[_0x6f75('0x17')]=router; \ No newline at end of file +var _0x78d8=['/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0x78d8,0x15c));var _0x878d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x78d8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x878d('0x0'));var path=require(_0x878d('0x1'));var timeout=require(_0x878d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x878d('0x3'));var config=require(_0x878d('0x4'));var controller=require(_0x878d('0x5'));router[_0x878d('0x6')]('/',auth[_0x878d('0x7')](),controller[_0x878d('0x8')]);router[_0x878d('0x6')](_0x878d('0x9'),auth[_0x878d('0x7')](),controller[_0x878d('0xa')]);router['get']('/:id/configurations',auth[_0x878d('0x7')](),controller[_0x878d('0xb')]);router[_0x878d('0x6')](_0x878d('0xc'),auth[_0x878d('0x7')](),controller[_0x878d('0xd')]);router[_0x878d('0xe')]('/',auth['isAuthenticated'](),controller[_0x878d('0xf')]);router[_0x878d('0xe')]('/:id/configurations',auth[_0x878d('0x7')](),controller[_0x878d('0x10')]);router[_0x878d('0x11')]('/:id',auth[_0x878d('0x7')](),controller['update']);router[_0x878d('0x12')](_0x878d('0x9'),auth[_0x878d('0x7')](),controller['destroy']);module[_0x878d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 56abfc2..8253175 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 _0xcd68=['remoteUri','STRING'];(function(_0x22bdca,_0x4edf96){var _0xfa6309=function(_0x307633){while(--_0x307633){_0x22bdca['push'](_0x22bdca['shift']());}};_0xfa6309(++_0x4edf96);}(_0xcd68,0xbb));var _0x8cd6=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xcd68[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8cd6('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8cd6('0x0')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8cd6('0x0')]},'remoteUri':{'type':Sequelize[_0x8cd6('0x0')],'unique':_0x8cd6('0x1')},'serverUrl':{'type':Sequelize[_0x8cd6('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x0911=['remoteUri','sequelize','exports','STRING','username'];(function(_0x185a0d,_0x37d2cf){var _0x57df19=function(_0x5ee8f4){while(--_0x5ee8f4){_0x185a0d['push'](_0x185a0d['shift']());}};_0x57df19(++_0x37d2cf);}(_0x0911,0x150));var _0x1091=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x0911[_0x421cf8];return _0x145c48;};'use strict';var Sequelize=require(_0x1091('0x0'));module[_0x1091('0x1')]={'name':{'type':Sequelize[_0x1091('0x2')]},'description':{'type':Sequelize[_0x1091('0x2')]},'username':{'type':Sequelize[_0x1091('0x2')],'unique':_0x1091('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1091('0x2')]},'remoteUri':{'type':Sequelize[_0x1091('0x2')],'unique':_0x1091('0x4')},'serverUrl':{'type':Sequelize[_0x1091('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 33c2f54..928811b 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 _0x4934=['sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','boolean','True','true','false','inactive','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','ServicenowAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','create','body','find','ServicenowConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','parent_incident','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments'];(function(_0x3fd831,_0x51ae7f){var _0xe51f1e=function(_0x3f41e2){while(--_0x3f41e2){_0x3fd831['push'](_0x3fd831['shift']());}};_0xe51f1e(++_0x51ae7f);}(_0x4934,0x19b));var _0x4493=function(_0x1834eb,_0x41d5f8){_0x1834eb=_0x1834eb-0x0;var _0x50ea19=_0x4934[_0x1834eb];return _0x50ea19;};'use strict';var emlformat=require(_0x4493('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4493('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4493('0x2'));var moment=require(_0x4493('0x3'));var BPromise=require(_0x4493('0x4'));var Mustache=require(_0x4493('0x5'));var util=require(_0x4493('0x6'));var path=require('path');var sox=require(_0x4493('0x7'));var csv=require(_0x4493('0x8'));var ejs=require(_0x4493('0x9'));var fs=require('fs');var fs_extra=require(_0x4493('0xa'));var _=require(_0x4493('0xb'));var squel=require('squel');var crypto=require(_0x4493('0xc'));var jsforce=require(_0x4493('0xd'));var deskjs=require(_0x4493('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4493('0xf'));var Papa=require(_0x4493('0x10'));var Redis=require('ioredis');var authService=require(_0x4493('0x11'));var qs=require(_0x4493('0x12'));var as=require(_0x4493('0x13'));var hardwareService=require(_0x4493('0x14'));var logger=require(_0x4493('0x15'))('api');var utils=require(_0x4493('0x16'));var config=require(_0x4493('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4493('0x18'))['db'];var integrations=require(_0x4493('0x19'));function respondWithStatusCode(_0x181b08,_0x30491d){_0x30491d=_0x30491d||0xcc;return function(_0xd2018){if(_0xd2018){return _0x181b08[_0x4493('0x1a')](_0x30491d);}return _0x181b08[_0x4493('0x1b')](_0x30491d)['end']();};}function respondWithResult(_0xc7b404,_0x12285d){_0x12285d=_0x12285d||0xc8;return function(_0x8b83fb){if(_0x8b83fb){return _0xc7b404[_0x4493('0x1b')](_0x12285d)[_0x4493('0x1c')](_0x8b83fb);}};}function respondWithFilteredResult(_0x2c32e0,_0x1f9f41){return function(_0x23cd63){if(_0x23cd63){var _0x215570=typeof _0x1f9f41[_0x4493('0x1d')]===_0x4493('0x1e')&&typeof _0x1f9f41[_0x4493('0x1f')]===_0x4493('0x1e');var _0x5c81ff=_0x23cd63[_0x4493('0x20')];var _0x1c51f4=_0x215570?0x0:_0x1f9f41[_0x4493('0x1d')];var _0x28df09=_0x215570?_0x23cd63[_0x4493('0x20')]:_0x1f9f41['offset']+_0x1f9f41['limit'];var _0x4ce426;if(_0x28df09>=_0x5c81ff){_0x28df09=_0x5c81ff;_0x4ce426=0xc8;}else{_0x4ce426=0xce;}_0x2c32e0['status'](_0x4ce426);return _0x2c32e0[_0x4493('0x21')](_0x4493('0x22'),_0x1c51f4+'-'+_0x28df09+'/'+_0x5c81ff)[_0x4493('0x1c')](_0x23cd63);}return null;};}function patchUpdates(_0x2980c6){return function(_0x11c161){try{jsonpatch['apply'](_0x11c161,_0x2980c6,!![]);}catch(_0x392b6d){return BPromise[_0x4493('0x23')](_0x392b6d);}return _0x11c161[_0x4493('0x24')]();};}function saveUpdates(_0x28a84f,_0x366a11){return function(_0x2fbe08){if(_0x2fbe08){return _0x2fbe08[_0x4493('0x25')](_0x28a84f)[_0x4493('0x26')](function(_0x5545c7){return _0x5545c7;});}return null;};}function removeEntity(_0x294f09,_0x1b252a){return function(_0x20feed){if(_0x20feed){return _0x20feed[_0x4493('0x27')]()['then'](function(){_0x294f09[_0x4493('0x1b')](0xcc)[_0x4493('0x28')]();});}};}function handleEntityNotFound(_0x49e85e,_0x1673ca){return function(_0x4550da){if(!_0x4550da){_0x49e85e['sendStatus'](0x194);}return _0x4550da;};}function handleError(_0x431262,_0x49c2e2){_0x49c2e2=_0x49c2e2||0x1f4;return function(_0x434280){logger[_0x4493('0x29')](_0x434280[_0x4493('0x2a')]);if(_0x434280[_0x4493('0x2b')]){delete _0x434280[_0x4493('0x2b')];}_0x431262[_0x4493('0x1b')](_0x49c2e2)[_0x4493('0x2c')](_0x434280);};}exports['index']=function(_0x312a1d,_0x1dec4d){var _0x507fdb={},_0x3c107a={},_0x2330c0={'count':0x0,'rows':[]};var _0x14c02e=_[_0x4493('0x2d')](db[_0x4493('0x2e')]['rawAttributes'],function(_0x349ef4){return{'name':_0x349ef4[_0x4493('0x2f')],'type':_0x349ef4['type'][_0x4493('0x30')]};});_0x3c107a[_0x4493('0x31')]=_[_0x4493('0x2d')](_0x14c02e,_0x4493('0x2b'));_0x3c107a[_0x4493('0x32')]=_[_0x4493('0x33')](_0x312a1d[_0x4493('0x32')]);_0x3c107a['filters']=_[_0x4493('0x34')](_0x3c107a['model'],_0x3c107a['query']);_0x507fdb[_0x4493('0x35')]=_['intersection'](_0x3c107a[_0x4493('0x31')],qs[_0x4493('0x36')](_0x312a1d[_0x4493('0x32')]['fields']));_0x507fdb[_0x4493('0x35')]=_0x507fdb[_0x4493('0x35')][_0x4493('0x37')]?_0x507fdb[_0x4493('0x35')]:_0x3c107a['model'];if(!_0x312a1d[_0x4493('0x32')][_0x4493('0x38')](_0x4493('0x39'))){_0x507fdb['limit']=qs[_0x4493('0x1f')](_0x312a1d[_0x4493('0x32')][_0x4493('0x1f')]);_0x507fdb['offset']=qs[_0x4493('0x1d')](_0x312a1d[_0x4493('0x32')][_0x4493('0x1d')]);}_0x507fdb[_0x4493('0x3a')]=qs['sort'](_0x312a1d[_0x4493('0x32')][_0x4493('0x3b')]);_0x507fdb[_0x4493('0x3c')]=qs[_0x4493('0x3d')](_[_0x4493('0x3e')](_0x312a1d[_0x4493('0x32')],_0x3c107a[_0x4493('0x3d')]),_0x14c02e);if(_0x312a1d[_0x4493('0x32')][_0x4493('0x3f')]){_0x507fdb['where']=_[_0x4493('0x40')](_0x507fdb[_0x4493('0x3c')],{'$or':_['map'](_0x14c02e,function(_0x3d1ddb){if(_0x3d1ddb[_0x4493('0x41')]!==_0x4493('0x42')){var _0x107a6a={};_0x107a6a[_0x3d1ddb[_0x4493('0x2b')]]={'$like':'%'+_0x312a1d['query'][_0x4493('0x3f')]+'%'};return _0x107a6a;}})});}_0x507fdb=_['merge']({},_0x507fdb,_0x312a1d[_0x4493('0x43')]);var _0x18f70b={'where':_0x507fdb[_0x4493('0x3c')]};return db[_0x4493('0x2e')][_0x4493('0x20')](_0x18f70b)['then'](function(_0x186c2d){_0x2330c0[_0x4493('0x20')]=_0x186c2d;if(_0x312a1d[_0x4493('0x32')][_0x4493('0x44')]){_0x507fdb[_0x4493('0x45')]=[{'all':!![]}];}return db[_0x4493('0x2e')]['findAll'](_0x507fdb);})[_0x4493('0x26')](function(_0x1ed7e9){_0x2330c0[_0x4493('0x46')]=_0x1ed7e9;return _0x2330c0;})['then'](respondWithFilteredResult(_0x1dec4d,_0x507fdb))[_0x4493('0x47')](handleError(_0x1dec4d,null));};exports['show']=function(_0x50eb42,_0x395664){var _0x40c920={'raw':![],'where':{'id':_0x50eb42[_0x4493('0x48')]['id']}},_0x12935e={};_0x12935e['model']=_[_0x4493('0x33')](db['ServicenowAccount'][_0x4493('0x49')]);_0x12935e['query']=_[_0x4493('0x33')](_0x50eb42[_0x4493('0x32')]);_0x12935e[_0x4493('0x3d')]=_[_0x4493('0x34')](_0x12935e[_0x4493('0x31')],_0x12935e[_0x4493('0x32')]);_0x40c920['attributes']=_[_0x4493('0x34')](_0x12935e[_0x4493('0x31')],qs[_0x4493('0x36')](_0x50eb42[_0x4493('0x32')][_0x4493('0x36')]));_0x40c920['attributes']=_0x40c920[_0x4493('0x35')]['length']?_0x40c920[_0x4493('0x35')]:_0x12935e[_0x4493('0x31')];if(_0x50eb42[_0x4493('0x32')]['includeAll']){_0x40c920[_0x4493('0x45')]=[{'all':!![]}];}_0x40c920=_['merge']({},_0x40c920,_0x50eb42[_0x4493('0x43')]);return db['ServicenowAccount']['find'](_0x40c920)['then'](handleEntityNotFound(_0x395664,null))[_0x4493('0x26')](respondWithResult(_0x395664,null))[_0x4493('0x47')](handleError(_0x395664,null));};exports[_0x4493('0x4a')]=function(_0x132294,_0xb85d67){return db[_0x4493('0x2e')][_0x4493('0x4a')](_0x132294[_0x4493('0x4b')],{})['then'](respondWithResult(_0xb85d67,0xc9))[_0x4493('0x47')](handleError(_0xb85d67,null));};exports[_0x4493('0x25')]=function(_0x54b374,_0x3ebd36){if(_0x54b374['body']['id']){delete _0x54b374['body']['id'];}return db['ServicenowAccount'][_0x4493('0x4c')]({'where':{'id':_0x54b374[_0x4493('0x48')]['id']}})[_0x4493('0x26')](handleEntityNotFound(_0x3ebd36,null))[_0x4493('0x26')](saveUpdates(_0x54b374['body'],null))[_0x4493('0x26')](respondWithResult(_0x3ebd36,null))[_0x4493('0x47')](handleError(_0x3ebd36,null));};exports[_0x4493('0x27')]=function(_0x502dcc,_0x54359e){return db[_0x4493('0x2e')]['find']({'where':{'id':_0x502dcc[_0x4493('0x48')]['id']}})['then'](handleEntityNotFound(_0x54359e,null))[_0x4493('0x26')](removeEntity(_0x54359e,null))[_0x4493('0x47')](handleError(_0x54359e,null));};exports['getConfigurations']=function(_0x4a8bee,_0x2bc96c,_0x53a02e){var _0x46d9de={};var _0x15da18={};var _0x5a507e;var _0x4c97b8;return db[_0x4493('0x2e')]['findOne']({'where':{'id':_0x4a8bee[_0x4493('0x48')]['id']}})[_0x4493('0x26')](handleEntityNotFound(_0x2bc96c,null))[_0x4493('0x26')](function(_0xa248c8){if(_0xa248c8){_0x5a507e=_0xa248c8;_0x15da18[_0x4493('0x31')]=_[_0x4493('0x33')](db[_0x4493('0x4d')][_0x4493('0x49')]);_0x15da18[_0x4493('0x32')]=_['keys'](_0x4a8bee[_0x4493('0x32')]);_0x15da18[_0x4493('0x3d')]=_[_0x4493('0x34')](_0x15da18['model'],_0x15da18[_0x4493('0x32')]);_0x46d9de[_0x4493('0x35')]=_[_0x4493('0x34')](_0x15da18['model'],qs['fields'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x36')]));_0x46d9de['attributes']=_0x46d9de['attributes'][_0x4493('0x37')]?_0x46d9de[_0x4493('0x35')]:_0x15da18[_0x4493('0x31')];_0x46d9de['order']=qs[_0x4493('0x3b')](_0x4a8bee[_0x4493('0x32')][_0x4493('0x3b')]);_0x46d9de[_0x4493('0x3c')]=qs['filters'](_[_0x4493('0x3e')](_0x4a8bee[_0x4493('0x32')],_0x15da18[_0x4493('0x3d')]));if(_0x4a8bee[_0x4493('0x32')][_0x4493('0x3f')]){_0x46d9de[_0x4493('0x3c')]=_['merge'](_0x46d9de['where'],{'$or':_[_0x4493('0x2d')](_0x46d9de[_0x4493('0x35')],function(_0x43d444){var _0x972c72={};_0x972c72[_0x43d444]={'$like':'%'+_0x4a8bee[_0x4493('0x32')][_0x4493('0x3f')]+'%'};return _0x972c72;})});}_0x46d9de=_[_0x4493('0x40')]({},_0x46d9de,_0x4a8bee[_0x4493('0x43')]);return _0x5a507e[_0x4493('0x4e')](_0x46d9de);}})[_0x4493('0x26')](function(_0x5901f4){if(_0x5901f4){_0x4c97b8=_0x5901f4['length'];if(!_0x4a8bee['query'][_0x4493('0x38')]('nolimit')){_0x46d9de[_0x4493('0x1f')]=qs['limit'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x1f')]);_0x46d9de[_0x4493('0x1d')]=qs['offset'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x1d')]);}return _0x5a507e[_0x4493('0x4e')](_0x46d9de);}})[_0x4493('0x26')](function(_0x4440b1){if(_0x4440b1){return _0x4440b1?{'count':_0x4c97b8,'rows':_0x4440b1}:null;}})[_0x4493('0x26')](respondWithResult(_0x2bc96c,null))[_0x4493('0x47')](handleError(_0x2bc96c,null));};exports[_0x4493('0x4f')]=function(_0x280442,_0x3960e4,_0x27eb39){if(_0x280442[_0x4493('0x4b')]['id']){delete _0x280442[_0x4493('0x4b')]['id'];}return db[_0x4493('0x2e')][_0x4493('0x50')]({'where':{'id':_0x280442[_0x4493('0x48')]['id']}})['then'](handleEntityNotFound(_0x3960e4,null))['then'](function(_0x41b510){if(_0x41b510){_0x280442[_0x4493('0x4b')]['AccountId']=_0x41b510['id'];_0x280442[_0x4493('0x4b')][_0x4493('0x51')]=integrations[_0x4493('0x52')](_0x280442['body'][_0x4493('0x53')],_0x280442[_0x4493('0x4b')][_0x4493('0x41')]);_0x280442[_0x4493('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x280442[_0x4493('0x4b')][_0x4493('0x53')],_0x280442[_0x4493('0x4b')][_0x4493('0x41')]);return db['ServicenowConfiguration']['create'](_0x280442[_0x4493('0x4b')],{'include':[{'model':db[_0x4493('0x54')],'as':_0x4493('0x51')},{'model':db[_0x4493('0x54')],'as':'Descriptions'}]});}return null;})[_0x4493('0x26')](respondWithResult(_0x3960e4,null))[_0x4493('0x47')](handleError(_0x3960e4,null));};exports[_0x4493('0x55')]=function(_0x535900,_0x28ff99,_0xea6b85){var _0xde29f3=[_0x4493('0x56'),_0x4493('0x57'),_0x4493('0x58'),_0x4493('0x59'),_0x4493('0x5a'),_0x4493('0x5b'),_0x4493('0x5c'),_0x4493('0x5d'),'category'];var _0x3602b1=['parent',_0x4493('0x56'),_0x4493('0x5e'),_0x4493('0x5f'),_0x4493('0x60'),_0x4493('0x61'),_0x4493('0x62'),_0x4493('0x57'),_0x4493('0x63'),'number',_0x4493('0x64'),_0x4493('0x65'),'opened_by',_0x4493('0x66'),'sys_created_on',_0x4493('0x67'),'state',_0x4493('0x68'),_0x4493('0x58'),_0x4493('0x3a'),_0x4493('0x69'),_0x4493('0x6a'),_0x4493('0x6b'),'delivery_plan',_0x4493('0x6c'),_0x4493('0x6d'),_0x4493('0x6e'),_0x4493('0x6f'),'priority',_0x4493('0x70'),_0x4493('0x71'),_0x4493('0x72'),_0x4493('0x73'),_0x4493('0x74'),'business_duration',_0x4493('0x75'),_0x4493('0x76'),_0x4493('0x77'),_0x4493('0x78'),_0x4493('0x79'),_0x4493('0x7a'),_0x4493('0x59'),_0x4493('0x7b'),_0x4493('0x7c'),_0x4493('0x5a'),'correlation_display',_0x4493('0x7d'),'work_start',_0x4493('0x7e'),_0x4493('0x7f'),'additional_assignee_list',_0x4493('0x80'),'calendar_duration',_0x4493('0x5b'),_0x4493('0x81'),_0x4493('0x82'),_0x4493('0x83'),'follow_up',_0x4493('0x84'),'sys_id',_0x4493('0x85'),'reopened_by','incident_state',_0x4493('0x86'),_0x4493('0x87'),_0x4493('0x88'),_0x4493('0x89'),_0x4493('0x8a'),_0x4493('0x8b'),'severity',_0x4493('0x8c'),_0x4493('0x8d'),_0x4493('0x8e'),'comments_and_work_notes','due_date',_0x4493('0x8f'),'reopen_count',_0x4493('0x90'),_0x4493('0x91'),_0x4493('0x92'),_0x4493('0x93'),_0x4493('0x94'),_0x4493('0x95')];var _0x47872b='';var _0x21a229='';var _0x5171e4=[];var _0xe5211a='';var _0x31dcad='';var _0x50ec72=[];var _0x1f12ff='';var _0x20b19b='';var _0x366acc={};var _0x9c6a26='';return db[_0x4493('0x2e')][_0x4493('0x50')]({'where':{'id':_0x535900[_0x4493('0x48')]['id']},'attributes':['id',_0x4493('0x96'),_0x4493('0x97'),_0x4493('0x98'),'remoteUri',_0x4493('0x99')]})[_0x4493('0x26')](handleEntityNotFound(_0x28ff99,null))['then'](function(_0xc32e19){if(_0xc32e19){_0x9c6a26=_0xc32e19[_0x4493('0x9a')];var _0x118b72=_0x9c6a26[_0x4493('0x9b')](-0x1);if(_0x118b72==='/'){_0x9c6a26=_0x9c6a26[_0x4493('0x9c')](0x0,_0x9c6a26[_0x4493('0x9d')](_0x118b72));}_0x20b19b=util[_0x4493('0x9e')](_0x4493('0x9f'),_0x9c6a26);_0x1f12ff=util[_0x4493('0x9e')](_0x4493('0xa0'),_0x9c6a26);_0x366acc={'user':_0xc32e19['username'],'pass':_0xc32e19[_0x4493('0x97')]};var _0x5b39a9={'method':_0x4493('0xa1'),'uri':_0x20b19b+_0x4493('0xa2'),'auth':_0x366acc,'json':!![]};return rp(_0x5b39a9);}})[_0x4493('0x26')](function(_0x3e407c){if(_0x3e407c[_0x4493('0xa3')][_0x4493('0x37')]>0x0){_0x47872b=_0x3e407c[_0x4493('0xa3')];}console['log'](_0x4493('0xa4'),_0x47872b);_0x50ec72=[];_0x21a229=Object[_0x4493('0xa5')]([],_0x47872b);_[_0x4493('0xa6')](_0x21a229,function(_0x2552f0){return!_0xde29f3['includes'](_0x2552f0[_0x4493('0x2b')]);});_0x21a229[_0x4493('0xa7')](function(_0x342cd1){var _0x1d89d2=createFieldObject(_0x1f12ff,_0x366acc,_0x342cd1[_0x4493('0xa8')],_0x342cd1['name'],_0x342cd1[_0x4493('0xa9')],![]);_0x50ec72[_0x4493('0xaa')](_0x1d89d2);});return Promise[_0x4493('0xab')](_0x50ec72);})['then'](function(_0x19ef73){_0x5171e4=_0x19ef73;_0xe5211a=Object[_0x4493('0xa5')]([],_0x47872b);console[_0x4493('0xac')](_0x4493('0xad'),_0x47872b);_[_0x4493('0xa6')](_0xe5211a,function(_0x5c5f16){return _0x3602b1[_0x4493('0xae')](_0x5c5f16['name']);});console[_0x4493('0xac')](_0x4493('0xaf'),_0xe5211a);_0x50ec72=[];_0xe5211a[_0x4493('0xa7')](function(_0x431589){var _0x1e2274=createFieldObject(_0x1f12ff,_0x366acc,_0x431589[_0x4493('0xa8')],_0x431589[_0x4493('0x2b')],_0x431589[_0x4493('0xa9')],!![]);_0x50ec72[_0x4493('0xaa')](_0x1e2274);});return Promise[_0x4493('0xab')](_0x50ec72);})['then'](function(_0x1f75df){_0x31dcad=_0x1f75df;var _0x3d077d=_0x5171e4[_0x4493('0xb0')](_0x31dcad);return{'count':_0x3d077d[_0x4493('0x37')],'rows':_0x3d077d};})['then'](respondWithResult(_0x28ff99,null))[_0x4493('0x47')](function(_0x12b664){console['log'](_0x4493('0xb1')+_0x12b664);var _0x488e39=_0x535900[_0x4493('0x32')]['test']?0x1f4:_0x12b664['statusCode']||0x1f4;logger[_0x4493('0x29')](_0x12b664[_0x4493('0x2a')]);delete _0x12b664[_0x4493('0x2b')];if(_0x488e39===0x191){_0x488e39=0x190;}_0x28ff99[_0x4493('0x1b')](_0x488e39)[_0x4493('0x2c')](_0x535900['query'][_0x4493('0xb2')]?{'message':'Wrong\x20credentials','statusCode':_0x12b664['statusCode']}:_0x12b664);});};function createFieldObject(_0x46df99,_0x5636a3,_0x9aff64,_0x29c263,_0xcb8a,_0x3e38f0){return new Promise(function(_0x11e5ca,_0x227a5c){var _0x39c613={'id':_0x29c263,'name':_0xcb8a,'custom':_0x3e38f0};if(_0x9aff64===_0x4493('0xb3')){_0x39c613['options']=[{'name':_0x4493('0xb4'),'value':_0x4493('0xb5')},{'name':'False','value':_0x4493('0xb6')}];_0x11e5ca(_0x39c613);}else{var _0x49c19b={'method':_0x4493('0xa1'),'uri':_0x46df99+'sys_choice?sysparm_query=name=incident^element='+_0x29c263,'auth':_0x5636a3,'json':!![]};return rp(_0x49c19b)['then'](function(_0x28c4c7){var _0x2498b9=[];if(_0x28c4c7[_0x4493('0xa3')][_0x4493('0x37')]>0x0){_0x28c4c7[_0x4493('0xa3')][_0x4493('0xa7')](function(_0x15726e){if(_0x15726e[_0x4493('0xb7')]==='false'){var _0x1b59bd={'name':_0x15726e[_0x4493('0xa9')],'value':_0x15726e['value']};_0x2498b9[_0x4493('0xaa')](_0x1b59bd);}});}_0x39c613[_0x4493('0x43')]=_0x2498b9;if(_0x39c613[_0x4493('0x43')][_0x4493('0x37')]>0x0){_0x11e5ca(_0x39c613);}else{if(_0x3e38f0==![]){_0x11e5ca();}else{_0x11e5ca(_0x39c613);}}});}});} \ No newline at end of file +var _0xc3b5=['key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','reopen_count','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','inactive','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type'];(function(_0x3bf96b,_0x241008){var _0x431ced=function(_0x2fa96e){while(--_0x2fa96e){_0x3bf96b['push'](_0x3bf96b['shift']());}};_0x431ced(++_0x241008);}(_0xc3b5,0x14b));var _0x5c3b=function(_0x4bb2c8,_0x7af606){_0x4bb2c8=_0x4bb2c8-0x0;var _0x5dcb85=_0xc3b5[_0x4bb2c8];return _0x5dcb85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c3b('0x0'));var zipdir=require(_0x5c3b('0x1'));var jsonpatch=require(_0x5c3b('0x2'));var rp=require(_0x5c3b('0x3'));var moment=require('moment');var BPromise=require(_0x5c3b('0x4'));var Mustache=require(_0x5c3b('0x5'));var util=require(_0x5c3b('0x6'));var path=require(_0x5c3b('0x7'));var sox=require(_0x5c3b('0x8'));var csv=require(_0x5c3b('0x9'));var ejs=require(_0x5c3b('0xa'));var fs=require('fs');var fs_extra=require(_0x5c3b('0xb'));var _=require('lodash');var squel=require(_0x5c3b('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c3b('0xd'));var deskjs=require(_0x5c3b('0xe'));var toCsv=require(_0x5c3b('0x9'));var querystring=require(_0x5c3b('0xf'));var Papa=require(_0x5c3b('0x10'));var Redis=require(_0x5c3b('0x11'));var authService=require(_0x5c3b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c3b('0x13'));var logger=require('../../config/logger')(_0x5c3b('0x14'));var utils=require(_0x5c3b('0x15'));var config=require(_0x5c3b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c3b('0x17'))['db'];var integrations=require(_0x5c3b('0x18'));function respondWithStatusCode(_0x4648bc,_0x31bf6c){_0x31bf6c=_0x31bf6c||0xcc;return function(_0xcc096b){if(_0xcc096b){return _0x4648bc[_0x5c3b('0x19')](_0x31bf6c);}return _0x4648bc[_0x5c3b('0x1a')](_0x31bf6c)[_0x5c3b('0x1b')]();};}function respondWithResult(_0x599ab6,_0x190438){_0x190438=_0x190438||0xc8;return function(_0x2e14b5){if(_0x2e14b5){return _0x599ab6[_0x5c3b('0x1a')](_0x190438)['json'](_0x2e14b5);}};}function respondWithFilteredResult(_0x184109,_0x16a385){return function(_0x2d2adb){if(_0x2d2adb){var _0x12a4f2=typeof _0x16a385[_0x5c3b('0x1c')]===_0x5c3b('0x1d')&&typeof _0x16a385[_0x5c3b('0x1e')]===_0x5c3b('0x1d');var _0x2a8fa9=_0x2d2adb[_0x5c3b('0x1f')];var _0x1f4807=_0x12a4f2?0x0:_0x16a385[_0x5c3b('0x1c')];var _0x447ffc=_0x12a4f2?_0x2d2adb[_0x5c3b('0x1f')]:_0x16a385[_0x5c3b('0x1c')]+_0x16a385[_0x5c3b('0x1e')];var _0xfe7c1b;if(_0x447ffc>=_0x2a8fa9){_0x447ffc=_0x2a8fa9;_0xfe7c1b=0xc8;}else{_0xfe7c1b=0xce;}_0x184109['status'](_0xfe7c1b);return _0x184109[_0x5c3b('0x20')](_0x5c3b('0x21'),_0x1f4807+'-'+_0x447ffc+'/'+_0x2a8fa9)[_0x5c3b('0x22')](_0x2d2adb);}return null;};}function patchUpdates(_0x389255){return function(_0x1551a1){try{jsonpatch[_0x5c3b('0x23')](_0x1551a1,_0x389255,!![]);}catch(_0x29a8a8){return BPromise[_0x5c3b('0x24')](_0x29a8a8);}return _0x1551a1[_0x5c3b('0x25')]();};}function saveUpdates(_0x99b49a,_0x3614db){return function(_0x2f0893){if(_0x2f0893){return _0x2f0893[_0x5c3b('0x26')](_0x99b49a)[_0x5c3b('0x27')](function(_0x9b1464){return _0x9b1464;});}return null;};}function removeEntity(_0xded399,_0x331ff6){return function(_0x1e046c){if(_0x1e046c){return _0x1e046c['destroy']()['then'](function(){_0xded399[_0x5c3b('0x1a')](0xcc)[_0x5c3b('0x1b')]();});}};}function handleEntityNotFound(_0x111381,_0x4611dc){return function(_0x4fa7fb){if(!_0x4fa7fb){_0x111381[_0x5c3b('0x19')](0x194);}return _0x4fa7fb;};}function handleError(_0x20131a,_0x5819ea){_0x5819ea=_0x5819ea||0x1f4;return function(_0x21b129){logger[_0x5c3b('0x28')](_0x21b129[_0x5c3b('0x29')]);if(_0x21b129['name']){delete _0x21b129[_0x5c3b('0x2a')];}_0x20131a[_0x5c3b('0x1a')](_0x5819ea)[_0x5c3b('0x2b')](_0x21b129);};}exports[_0x5c3b('0x2c')]=function(_0x1a3021,_0xbf7bcb){var _0x3091df={},_0x5def73={},_0xff1e4f={'count':0x0,'rows':[]};var _0x4f6259=_[_0x5c3b('0x2d')](db[_0x5c3b('0x2e')][_0x5c3b('0x2f')],function(_0x3bcc49){return{'name':_0x3bcc49['fieldName'],'type':_0x3bcc49[_0x5c3b('0x30')][_0x5c3b('0x31')]};});_0x5def73['model']=_[_0x5c3b('0x2d')](_0x4f6259,'name');_0x5def73[_0x5c3b('0x32')]=_[_0x5c3b('0x33')](_0x1a3021['query']);_0x5def73['filters']=_['intersection'](_0x5def73[_0x5c3b('0x34')],_0x5def73[_0x5c3b('0x32')]);_0x3091df['attributes']=_[_0x5c3b('0x35')](_0x5def73[_0x5c3b('0x34')],qs[_0x5c3b('0x36')](_0x1a3021['query'][_0x5c3b('0x36')]));_0x3091df[_0x5c3b('0x37')]=_0x3091df['attributes']['length']?_0x3091df[_0x5c3b('0x37')]:_0x5def73[_0x5c3b('0x34')];if(!_0x1a3021[_0x5c3b('0x32')][_0x5c3b('0x38')](_0x5c3b('0x39'))){_0x3091df[_0x5c3b('0x1e')]=qs[_0x5c3b('0x1e')](_0x1a3021[_0x5c3b('0x32')][_0x5c3b('0x1e')]);_0x3091df['offset']=qs[_0x5c3b('0x1c')](_0x1a3021[_0x5c3b('0x32')]['offset']);}_0x3091df[_0x5c3b('0x3a')]=qs['sort'](_0x1a3021[_0x5c3b('0x32')][_0x5c3b('0x3b')]);_0x3091df[_0x5c3b('0x3c')]=qs[_0x5c3b('0x3d')](_[_0x5c3b('0x3e')](_0x1a3021['query'],_0x5def73[_0x5c3b('0x3d')]),_0x4f6259);if(_0x1a3021['query']['filter']){_0x3091df[_0x5c3b('0x3c')]=_['merge'](_0x3091df[_0x5c3b('0x3c')],{'$or':_[_0x5c3b('0x2d')](_0x4f6259,function(_0x45b4bd){if(_0x45b4bd[_0x5c3b('0x30')]!==_0x5c3b('0x3f')){var _0x26c962={};_0x26c962[_0x45b4bd['name']]={'$like':'%'+_0x1a3021[_0x5c3b('0x32')][_0x5c3b('0x40')]+'%'};return _0x26c962;}})});}_0x3091df=_[_0x5c3b('0x41')]({},_0x3091df,_0x1a3021[_0x5c3b('0x42')]);var _0x36c186={'where':_0x3091df[_0x5c3b('0x3c')]};return db[_0x5c3b('0x2e')]['count'](_0x36c186)[_0x5c3b('0x27')](function(_0x4956ad){_0xff1e4f['count']=_0x4956ad;if(_0x1a3021[_0x5c3b('0x32')][_0x5c3b('0x43')]){_0x3091df[_0x5c3b('0x44')]=[{'all':!![]}];}return db[_0x5c3b('0x2e')]['findAll'](_0x3091df);})[_0x5c3b('0x27')](function(_0x5ac671){_0xff1e4f[_0x5c3b('0x45')]=_0x5ac671;return _0xff1e4f;})['then'](respondWithFilteredResult(_0xbf7bcb,_0x3091df))[_0x5c3b('0x46')](handleError(_0xbf7bcb,null));};exports[_0x5c3b('0x47')]=function(_0x22f29b,_0x1cc0b1){var _0x5a24fc={'raw':![],'where':{'id':_0x22f29b[_0x5c3b('0x48')]['id']}},_0x490cee={};_0x490cee[_0x5c3b('0x34')]=_[_0x5c3b('0x33')](db['ServicenowAccount'][_0x5c3b('0x2f')]);_0x490cee[_0x5c3b('0x32')]=_[_0x5c3b('0x33')](_0x22f29b[_0x5c3b('0x32')]);_0x490cee['filters']=_['intersection'](_0x490cee[_0x5c3b('0x34')],_0x490cee[_0x5c3b('0x32')]);_0x5a24fc[_0x5c3b('0x37')]=_['intersection'](_0x490cee[_0x5c3b('0x34')],qs[_0x5c3b('0x36')](_0x22f29b[_0x5c3b('0x32')][_0x5c3b('0x36')]));_0x5a24fc[_0x5c3b('0x37')]=_0x5a24fc['attributes'][_0x5c3b('0x49')]?_0x5a24fc['attributes']:_0x490cee['model'];if(_0x22f29b[_0x5c3b('0x32')][_0x5c3b('0x43')]){_0x5a24fc['include']=[{'all':!![]}];}_0x5a24fc=_[_0x5c3b('0x41')]({},_0x5a24fc,_0x22f29b[_0x5c3b('0x42')]);return db[_0x5c3b('0x2e')][_0x5c3b('0x4a')](_0x5a24fc)[_0x5c3b('0x27')](handleEntityNotFound(_0x1cc0b1,null))[_0x5c3b('0x27')](respondWithResult(_0x1cc0b1,null))[_0x5c3b('0x46')](handleError(_0x1cc0b1,null));};exports[_0x5c3b('0x4b')]=function(_0x444adb,_0x90d077){return db[_0x5c3b('0x2e')][_0x5c3b('0x4b')](_0x444adb['body'],{})['then'](respondWithResult(_0x90d077,0xc9))[_0x5c3b('0x46')](handleError(_0x90d077,null));};exports[_0x5c3b('0x26')]=function(_0x27721a,_0x371f43){if(_0x27721a[_0x5c3b('0x4c')]['id']){delete _0x27721a[_0x5c3b('0x4c')]['id'];}return db[_0x5c3b('0x2e')]['find']({'where':{'id':_0x27721a[_0x5c3b('0x48')]['id']}})[_0x5c3b('0x27')](handleEntityNotFound(_0x371f43,null))[_0x5c3b('0x27')](saveUpdates(_0x27721a[_0x5c3b('0x4c')],null))[_0x5c3b('0x27')](respondWithResult(_0x371f43,null))[_0x5c3b('0x46')](handleError(_0x371f43,null));};exports[_0x5c3b('0x4d')]=function(_0x539035,_0x3932a7){return db[_0x5c3b('0x2e')][_0x5c3b('0x4a')]({'where':{'id':_0x539035['params']['id']}})[_0x5c3b('0x27')](handleEntityNotFound(_0x3932a7,null))['then'](removeEntity(_0x3932a7,null))[_0x5c3b('0x46')](handleError(_0x3932a7,null));};exports[_0x5c3b('0x4e')]=function(_0x49fd07,_0x16a5bd,_0x593daa){var _0x18b6ed={};var _0x428da2={};var _0x51e112;var _0x25f3a7;return db[_0x5c3b('0x2e')][_0x5c3b('0x4f')]({'where':{'id':_0x49fd07[_0x5c3b('0x48')]['id']}})[_0x5c3b('0x27')](handleEntityNotFound(_0x16a5bd,null))[_0x5c3b('0x27')](function(_0x37c9e0){if(_0x37c9e0){_0x51e112=_0x37c9e0;_0x428da2[_0x5c3b('0x34')]=_[_0x5c3b('0x33')](db[_0x5c3b('0x50')][_0x5c3b('0x2f')]);_0x428da2['query']=_[_0x5c3b('0x33')](_0x49fd07[_0x5c3b('0x32')]);_0x428da2['filters']=_[_0x5c3b('0x35')](_0x428da2[_0x5c3b('0x34')],_0x428da2[_0x5c3b('0x32')]);_0x18b6ed['attributes']=_[_0x5c3b('0x35')](_0x428da2[_0x5c3b('0x34')],qs['fields'](_0x49fd07[_0x5c3b('0x32')]['fields']));_0x18b6ed[_0x5c3b('0x37')]=_0x18b6ed['attributes'][_0x5c3b('0x49')]?_0x18b6ed[_0x5c3b('0x37')]:_0x428da2[_0x5c3b('0x34')];_0x18b6ed[_0x5c3b('0x3a')]=qs['sort'](_0x49fd07[_0x5c3b('0x32')][_0x5c3b('0x3b')]);_0x18b6ed[_0x5c3b('0x3c')]=qs[_0x5c3b('0x3d')](_[_0x5c3b('0x3e')](_0x49fd07[_0x5c3b('0x32')],_0x428da2['filters']));if(_0x49fd07[_0x5c3b('0x32')]['filter']){_0x18b6ed['where']=_['merge'](_0x18b6ed['where'],{'$or':_[_0x5c3b('0x2d')](_0x18b6ed[_0x5c3b('0x37')],function(_0x3730c4){var _0xfdb54b={};_0xfdb54b[_0x3730c4]={'$like':'%'+_0x49fd07['query'][_0x5c3b('0x40')]+'%'};return _0xfdb54b;})});}_0x18b6ed=_[_0x5c3b('0x41')]({},_0x18b6ed,_0x49fd07[_0x5c3b('0x42')]);return _0x51e112['getConfigurations'](_0x18b6ed);}})[_0x5c3b('0x27')](function(_0x36e27e){if(_0x36e27e){_0x25f3a7=_0x36e27e['length'];if(!_0x49fd07[_0x5c3b('0x32')]['hasOwnProperty'](_0x5c3b('0x39'))){_0x18b6ed[_0x5c3b('0x1e')]=qs['limit'](_0x49fd07[_0x5c3b('0x32')][_0x5c3b('0x1e')]);_0x18b6ed[_0x5c3b('0x1c')]=qs[_0x5c3b('0x1c')](_0x49fd07[_0x5c3b('0x32')][_0x5c3b('0x1c')]);}return _0x51e112['getConfigurations'](_0x18b6ed);}})[_0x5c3b('0x27')](function(_0x3ac7d3){if(_0x3ac7d3){return _0x3ac7d3?{'count':_0x25f3a7,'rows':_0x3ac7d3}:null;}})[_0x5c3b('0x27')](respondWithResult(_0x16a5bd,null))['catch'](handleError(_0x16a5bd,null));};exports['addConfiguration']=function(_0x5a303e,_0x11afa8,_0x1d4723){if(_0x5a303e[_0x5c3b('0x4c')]['id']){delete _0x5a303e[_0x5c3b('0x4c')]['id'];}return db[_0x5c3b('0x2e')][_0x5c3b('0x4f')]({'where':{'id':_0x5a303e['params']['id']}})[_0x5c3b('0x27')](handleEntityNotFound(_0x11afa8,null))[_0x5c3b('0x27')](function(_0x502f2b){if(_0x502f2b){_0x5a303e[_0x5c3b('0x4c')][_0x5c3b('0x51')]=_0x502f2b['id'];_0x5a303e[_0x5c3b('0x4c')][_0x5c3b('0x52')]=integrations['getSubjects'](_0x5a303e[_0x5c3b('0x4c')][_0x5c3b('0x53')],_0x5a303e[_0x5c3b('0x4c')][_0x5c3b('0x30')]);_0x5a303e[_0x5c3b('0x4c')][_0x5c3b('0x54')]=integrations[_0x5c3b('0x55')](_0x5a303e[_0x5c3b('0x4c')]['channel'],_0x5a303e['body'][_0x5c3b('0x30')]);return db[_0x5c3b('0x50')]['create'](_0x5a303e[_0x5c3b('0x4c')],{'include':[{'model':db[_0x5c3b('0x56')],'as':_0x5c3b('0x52')},{'model':db[_0x5c3b('0x56')],'as':_0x5c3b('0x54')}]});}return null;})['then'](respondWithResult(_0x11afa8,null))[_0x5c3b('0x46')](handleError(_0x11afa8,null));};exports[_0x5c3b('0x57')]=function(_0xfcb1a8,_0xb113a1,_0x11cdfa){var _0x2955b5=[_0x5c3b('0x58'),_0x5c3b('0x59'),'knowledge',_0x5c3b('0x5a'),_0x5c3b('0x5b'),_0x5c3b('0x5c'),_0x5c3b('0x5d'),_0x5c3b('0x5e'),_0x5c3b('0x5f')];var _0x13fd9d=[_0x5c3b('0x60'),_0x5c3b('0x58'),_0x5c3b('0x61'),_0x5c3b('0x62'),_0x5c3b('0x63'),_0x5c3b('0x64'),_0x5c3b('0x65'),_0x5c3b('0x59'),_0x5c3b('0x66'),_0x5c3b('0x67'),_0x5c3b('0x68'),_0x5c3b('0x69'),_0x5c3b('0x6a'),'user_input',_0x5c3b('0x6b'),'sys_domain',_0x5c3b('0x6c'),_0x5c3b('0x6d'),_0x5c3b('0x6e'),_0x5c3b('0x3a'),_0x5c3b('0x6f'),_0x5c3b('0x70'),_0x5c3b('0x71'),'delivery_plan','impact',_0x5c3b('0x72'),_0x5c3b('0x73'),'business_service',_0x5c3b('0x74'),_0x5c3b('0x75'),_0x5c3b('0x76'),'time_worked',_0x5c3b('0x77'),_0x5c3b('0x78'),_0x5c3b('0x79'),_0x5c3b('0x7a'),_0x5c3b('0x7b'),'reopened_time',_0x5c3b('0x7c'),_0x5c3b('0x7d'),_0x5c3b('0x7e'),_0x5c3b('0x5a'),_0x5c3b('0x7f'),'short_description',_0x5c3b('0x5b'),_0x5c3b('0x80'),'delivery_task',_0x5c3b('0x81'),_0x5c3b('0x82'),_0x5c3b('0x83'),_0x5c3b('0x84'),'description',_0x5c3b('0x85'),'notify',_0x5c3b('0x86'),_0x5c3b('0x87'),_0x5c3b('0x88'),_0x5c3b('0x89'),_0x5c3b('0x8a'),_0x5c3b('0x8b'),'contact_type',_0x5c3b('0x8c'),_0x5c3b('0x5d'),_0x5c3b('0x8d'),_0x5c3b('0x8e'),_0x5c3b('0x8f'),_0x5c3b('0x90'),_0x5c3b('0x91'),_0x5c3b('0x92'),_0x5c3b('0x5e'),_0x5c3b('0x93'),_0x5c3b('0x94'),_0x5c3b('0x95'),'comments_and_work_notes',_0x5c3b('0x96'),'sys_mod_count',_0x5c3b('0x97'),'sys_tags',_0x5c3b('0x98'),'upon_approval',_0x5c3b('0x99'),_0x5c3b('0x9a'),_0x5c3b('0x5f')];var _0x3d16e8='';var _0x39bb3e='';var _0x3a0725=[];var _0x548add='';var _0x48d8dc='';var _0xbaa1ad=[];var _0x20c9b4='';var _0xcce8f5='';var _0x1165d5={};var _0x49514b='';return db[_0x5c3b('0x2e')][_0x5c3b('0x4f')]({'where':{'id':_0xfcb1a8[_0x5c3b('0x48')]['id']},'attributes':['id',_0x5c3b('0x9b'),_0x5c3b('0x9c'),_0x5c3b('0x9d'),_0x5c3b('0x9e'),_0x5c3b('0x9f')]})[_0x5c3b('0x27')](handleEntityNotFound(_0xb113a1,null))['then'](function(_0x447930){if(_0x447930){_0x49514b=_0x447930['remoteUri'];var _0x3ca8a7=_0x49514b['slice'](-0x1);if(_0x3ca8a7==='/'){_0x49514b=_0x49514b[_0x5c3b('0xa0')](0x0,_0x49514b[_0x5c3b('0xa1')](_0x3ca8a7));}_0xcce8f5=util[_0x5c3b('0xa2')](_0x5c3b('0xa3'),_0x49514b);_0x20c9b4=util[_0x5c3b('0xa2')](_0x5c3b('0xa4'),_0x49514b);_0x1165d5={'user':_0x447930['username'],'pass':_0x447930[_0x5c3b('0x9c')]};var _0x5583a5={'method':_0x5c3b('0xa5'),'uri':_0xcce8f5+_0x5c3b('0xa6'),'auth':_0x1165d5,'json':!![]};return rp(_0x5583a5);}})['then'](function(_0x2bfadb){if(_0x2bfadb[_0x5c3b('0xa7')]['length']>0x0){_0x3d16e8=_0x2bfadb[_0x5c3b('0xa7')];}console[_0x5c3b('0xa8')](_0x5c3b('0xa9'),_0x3d16e8);_0xbaa1ad=[];_0x39bb3e=Object[_0x5c3b('0xaa')]([],_0x3d16e8);_['remove'](_0x39bb3e,function(_0x15530c){return!_0x2955b5[_0x5c3b('0xab')](_0x15530c['name']);});_0x39bb3e[_0x5c3b('0xac')](function(_0x1800d2){var _0xd46d61=createFieldObject(_0x20c9b4,_0x1165d5,_0x1800d2[_0x5c3b('0xad')],_0x1800d2[_0x5c3b('0x2a')],_0x1800d2[_0x5c3b('0xae')],![]);_0xbaa1ad[_0x5c3b('0xaf')](_0xd46d61);});return Promise[_0x5c3b('0xb0')](_0xbaa1ad);})[_0x5c3b('0x27')](function(_0x3bfe0d){_0x3a0725=_0x3bfe0d;_0x548add=Object[_0x5c3b('0xaa')]([],_0x3d16e8);console['log'](_0x5c3b('0xb1'),_0x3d16e8);_[_0x5c3b('0xb2')](_0x548add,function(_0x34a64a){return _0x13fd9d['includes'](_0x34a64a[_0x5c3b('0x2a')]);});console[_0x5c3b('0xa8')](_0x5c3b('0xb3'),_0x548add);_0xbaa1ad=[];_0x548add[_0x5c3b('0xac')](function(_0x620c9d){var _0x2b4ea3=createFieldObject(_0x20c9b4,_0x1165d5,_0x620c9d[_0x5c3b('0xad')],_0x620c9d[_0x5c3b('0x2a')],_0x620c9d[_0x5c3b('0xae')],!![]);_0xbaa1ad['push'](_0x2b4ea3);});return Promise[_0x5c3b('0xb0')](_0xbaa1ad);})[_0x5c3b('0x27')](function(_0x12b587){_0x48d8dc=_0x12b587;var _0x3c3ba5=_0x3a0725['concat'](_0x48d8dc);return{'count':_0x3c3ba5[_0x5c3b('0x49')],'rows':_0x3c3ba5};})[_0x5c3b('0x27')](respondWithResult(_0xb113a1,null))['catch'](function(_0x4ac0d0){console[_0x5c3b('0xa8')](_0x5c3b('0xb4')+_0x4ac0d0);var _0x14b322=_0xfcb1a8['query'][_0x5c3b('0xb5')]?0x1f4:_0x4ac0d0[_0x5c3b('0xb6')]||0x1f4;logger['error'](_0x4ac0d0[_0x5c3b('0x29')]);delete _0x4ac0d0[_0x5c3b('0x2a')];if(_0x14b322===0x191){_0x14b322=0x190;}_0xb113a1[_0x5c3b('0x1a')](_0x14b322)[_0x5c3b('0x2b')](_0xfcb1a8[_0x5c3b('0x32')][_0x5c3b('0xb5')]?{'message':_0x5c3b('0xb7'),'statusCode':_0x4ac0d0['statusCode']}:_0x4ac0d0);});};function createFieldObject(_0x23e14e,_0x41b759,_0x1b9915,_0x15d0c2,_0x502f3e,_0x654037){return new Promise(function(_0x5733ef,_0x3d551f){var _0x3a54e3={'id':_0x15d0c2,'name':_0x502f3e,'custom':_0x654037};if(_0x1b9915===_0x5c3b('0xb8')){_0x3a54e3[_0x5c3b('0x42')]=[{'name':_0x5c3b('0xb9'),'value':_0x5c3b('0xba')},{'name':_0x5c3b('0xbb'),'value':_0x5c3b('0xbc')}];_0x5733ef(_0x3a54e3);}else{var _0x50f860={'method':_0x5c3b('0xa5'),'uri':_0x23e14e+'sys_choice?sysparm_query=name=incident^element='+_0x15d0c2,'auth':_0x41b759,'json':!![]};return rp(_0x50f860)[_0x5c3b('0x27')](function(_0xa1d3dc){var _0x301533=[];if(_0xa1d3dc[_0x5c3b('0xa7')][_0x5c3b('0x49')]>0x0){_0xa1d3dc[_0x5c3b('0xa7')][_0x5c3b('0xac')](function(_0x5197bf){if(_0x5197bf[_0x5c3b('0xbd')]===_0x5c3b('0xbc')){var _0x50e800={'name':_0x5197bf[_0x5c3b('0xae')],'value':_0x5197bf['value']};_0x301533['push'](_0x50e800);}});}_0x3a54e3[_0x5c3b('0x42')]=_0x301533;if(_0x3a54e3[_0x5c3b('0x42')]['length']>0x0){_0x5733ef(_0x3a54e3);}else{if(_0x654037==![]){_0x5733ef();}else{_0x5733ef(_0x3a54e3);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 4429739..5cd8fbf 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 _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xdb50b8,_0x24515f){var _0x2e2c2b=function(_0x3896c7){while(--_0x3896c7){_0xdb50b8['push'](_0xdb50b8['shift']());}};_0x2e2c2b(++_0x24515f);}(_0x31f0,0xb7));var _0x031f=function(_0x53efc5,_0x480085){_0x53efc5=_0x53efc5-0x0;var _0x1f6aba=_0x31f0[_0x53efc5];return _0x1f6aba;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x4e6ae7,_0x56aa97){var _0x7aac8e=function(_0x3c826d){while(--_0x3c826d){_0x4e6ae7['push'](_0x4e6ae7['shift']());}};_0x7aac8e(++_0x56aa97);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x2eb2[_0x3a6efd];return _0x487b9a;};'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('./intServicenowAccount.attributes');var integrations=require(_0x22eb('0x7'));module[_0x22eb('0x8')]=function(_0x35dd5b,_0x2a9850){return _0x35dd5b[_0x22eb('0x9')](_0x22eb('0xa'),attributes,{'tableName':_0x22eb('0xb'),'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 efe48d8..373e712 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 _0x5ad2=['error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a50a,_0x5a8224){var _0x14b9f7=function(_0x288d78){while(--_0x288d78){_0x20a50a['push'](_0x20a50a['shift']());}};_0x14b9f7(++_0x5a8224);}(_0x5ad2,0xe2));var _0x25ad=function(_0x2ea6f5,_0x4adfc4){_0x2ea6f5=_0x2ea6f5-0x0;var _0x2a88b5=_0x5ad2[_0x2ea6f5];return _0x2a88b5;};'use strict';var _=require('lodash');var util=require(_0x25ad('0x0'));var moment=require(_0x25ad('0x1'));var BPromise=require(_0x25ad('0x2'));var rs=require(_0x25ad('0x3'));var fs=require('fs');var Redis=require(_0x25ad('0x4'));var db=require(_0x25ad('0x5'))['db'];var utils=require(_0x25ad('0x6'));var logger=require(_0x25ad('0x7'))(_0x25ad('0x8'));var config=require(_0x25ad('0x9'));var jayson=require(_0x25ad('0xa'));var client=jayson[_0x25ad('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x242e97,_0x32e518,_0x263135){return new BPromise(function(_0x27daa1,_0x41f49c){return client['request'](_0x242e97,_0x263135)[_0x25ad('0xc')](function(_0x59e353){logger[_0x25ad('0xd')](_0x25ad('0xe'),_0x32e518,_0x25ad('0xf'));logger[_0x25ad('0x10')](_0x25ad('0x11'),_0x32e518,'request\x20sent',JSON[_0x25ad('0x12')](_0x59e353));if(_0x59e353[_0x25ad('0x13')]){if(_0x59e353['error']['code']===0x1f4){logger['error'](_0x25ad('0xe'),_0x32e518,_0x59e353[_0x25ad('0x13')][_0x25ad('0x14')]);return _0x41f49c(_0x59e353['error'][_0x25ad('0x14')]);}logger[_0x25ad('0x13')](_0x25ad('0xe'),_0x32e518,_0x59e353[_0x25ad('0x13')][_0x25ad('0x14')]);return _0x27daa1(_0x59e353['error'][_0x25ad('0x14')]);}else{logger['info'](_0x25ad('0xe'),_0x32e518,_0x25ad('0xf'));_0x27daa1(_0x59e353[_0x25ad('0x15')][_0x25ad('0x14')]);}})['catch'](function(_0x5a0007){logger['error'](_0x25ad('0xe'),_0x32e518,_0x5a0007);_0x41f49c(_0x5a0007);});});}exports[_0x25ad('0x16')]=function(_0x5e4045){var _0x1f9214=this;return new Promise(function(_0x2eeda1,_0x3befa2){return db[_0x25ad('0x17')][_0x25ad('0x18')]({'raw':_0x5e4045['options']?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e4045['options']?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1b')]||null:null,'attributes':_0x5e4045[_0x25ad('0x19')]?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1c')]||null:null,'limit':_0x5e4045[_0x25ad('0x19')]?_0x5e4045['options']['limit']||null:null,'include':_0x5e4045[_0x25ad('0x19')]?_0x5e4045['options'][_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1d')],function(_0x16e3fb){return{'model':db[_0x16e3fb[_0x25ad('0x1f')]],'as':_0x16e3fb['as'],'attributes':_0x16e3fb[_0x25ad('0x1c')],'include':_0x16e3fb[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x16e3fb[_0x25ad('0x1d')],function(_0x3b94e3){return{'model':db[_0x3b94e3[_0x25ad('0x1f')]],'as':_0x3b94e3['as'],'attributes':_0x3b94e3[_0x25ad('0x1c')],'include':_0x3b94e3[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x3b94e3['include'],function(_0x35c199){return{'model':db[_0x35c199['model']],'as':_0x35c199['as'],'attributes':_0x35c199[_0x25ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25ad('0xc')](function(_0x1f5575){logger[_0x25ad('0xd')](_0x25ad('0x16'),_0x5e4045);logger[_0x25ad('0x10')](_0x25ad('0x16'),_0x5e4045,JSON[_0x25ad('0x12')](_0x1f5575));_0x2eeda1(_0x1f5575);})[_0x25ad('0x20')](function(_0x5515c1){logger['error'](_0x25ad('0x16'),_0x5515c1[_0x25ad('0x14')],_0x5e4045);_0x3befa2(_0x1f9214[_0x25ad('0x13')](0x1f4,_0x5515c1[_0x25ad('0x14')]));});});};exports[_0x25ad('0x21')]=function(_0xc05bc6){var _0x11a018=this;return new Promise(function(_0x3ab11,_0x12e08b){return db[_0x25ad('0x17')][_0x25ad('0x22')]({'raw':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1a')]===undefined?!![]:![]:!![],'where':_0xc05bc6['options']?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1b')]||null:null,'attributes':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1c')]||null:null,'include':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1d')],function(_0x320649){return{'model':db[_0x320649[_0x25ad('0x1f')]],'as':_0x320649['as'],'attributes':_0x320649[_0x25ad('0x1c')],'include':_0x320649[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x320649[_0x25ad('0x1d')],function(_0x320a69){return{'model':db[_0x320a69['model']],'as':_0x320a69['as'],'attributes':_0x320a69[_0x25ad('0x1c')],'include':_0x320a69[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x320a69[_0x25ad('0x1d')],function(_0x1ad8e3){return{'model':db[_0x1ad8e3[_0x25ad('0x1f')]],'as':_0x1ad8e3['as'],'attributes':_0x1ad8e3[_0x25ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25ad('0xc')](function(_0x1a783e){logger[_0x25ad('0xd')](_0x25ad('0x21'),_0xc05bc6);logger['debug'](_0x25ad('0x21'),_0xc05bc6,JSON[_0x25ad('0x12')](_0x1a783e));_0x3ab11(_0x1a783e);})[_0x25ad('0x20')](function(_0x5cdec8){logger[_0x25ad('0x13')](_0x25ad('0x21'),_0x5cdec8[_0x25ad('0x14')],_0xc05bc6);_0x12e08b(_0x11a018['error'](0x1f4,_0x5cdec8['message']));});});}; \ No newline at end of file +var _0x3f1a=['jayson/promise','client','http','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','ServicenowAccount','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3f1a,0x145));var _0xa3f1=function(_0x745766,_0x1a9f45){_0x745766=_0x745766-0x0;var _0xc461ad=_0x3f1a[_0x745766];return _0xc461ad;};'use strict';var _=require('lodash');var util=require(_0xa3f1('0x0'));var moment=require('moment');var BPromise=require(_0xa3f1('0x1'));var rs=require(_0xa3f1('0x2'));var fs=require('fs');var Redis=require(_0xa3f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3f1('0x4'));var logger=require(_0xa3f1('0x5'))(_0xa3f1('0x6'));var config=require(_0xa3f1('0x7'));var jayson=require(_0xa3f1('0x8'));var client=jayson[_0xa3f1('0x9')][_0xa3f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x400912,_0x39260b,_0x4e197a){return new BPromise(function(_0x39ce04,_0x482881){return client[_0xa3f1('0xb')](_0x400912,_0x4e197a)[_0xa3f1('0xc')](function(_0x531eae){logger[_0xa3f1('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x39260b,'request\x20sent');logger[_0xa3f1('0xe')](_0xa3f1('0xf'),_0x39260b,_0xa3f1('0x10'),JSON[_0xa3f1('0x11')](_0x531eae));if(_0x531eae['error']){if(_0x531eae['error'][_0xa3f1('0x12')]===0x1f4){logger[_0xa3f1('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x39260b,_0x531eae[_0xa3f1('0x13')][_0xa3f1('0x14')]);return _0x482881(_0x531eae[_0xa3f1('0x13')]['message']);}logger[_0xa3f1('0x13')](_0xa3f1('0x15'),_0x39260b,_0x531eae['error']['message']);return _0x39ce04(_0x531eae[_0xa3f1('0x13')][_0xa3f1('0x14')]);}else{logger[_0xa3f1('0xd')](_0xa3f1('0x15'),_0x39260b,_0xa3f1('0x10'));_0x39ce04(_0x531eae[_0xa3f1('0x16')]['message']);}})[_0xa3f1('0x17')](function(_0x112cff){logger['error'](_0xa3f1('0x15'),_0x39260b,_0x112cff);_0x482881(_0x112cff);});});}exports[_0xa3f1('0x18')]=function(_0x38fe75){var _0x7046c3=this;return new Promise(function(_0x4a7569,_0x50f670){return db['ServicenowAccount'][_0xa3f1('0x19')]({'raw':_0x38fe75[_0xa3f1('0x1a')]?_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x38fe75[_0xa3f1('0x1a')]?_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1c')]||null:null,'attributes':_0x38fe75['options']?_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1d')]||null:null,'limit':_0x38fe75[_0xa3f1('0x1a')]?_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1e')]||null:null,'include':_0x38fe75['options']?_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1f')]?_[_0xa3f1('0x20')](_0x38fe75[_0xa3f1('0x1a')][_0xa3f1('0x1f')],function(_0x3bacef){return{'model':db[_0x3bacef[_0xa3f1('0x21')]],'as':_0x3bacef['as'],'attributes':_0x3bacef[_0xa3f1('0x1d')],'include':_0x3bacef['include']?_[_0xa3f1('0x20')](_0x3bacef[_0xa3f1('0x1f')],function(_0x4e433f){return{'model':db[_0x4e433f[_0xa3f1('0x21')]],'as':_0x4e433f['as'],'attributes':_0x4e433f[_0xa3f1('0x1d')],'include':_0x4e433f[_0xa3f1('0x1f')]?_['map'](_0x4e433f[_0xa3f1('0x1f')],function(_0x182e57){return{'model':db[_0x182e57[_0xa3f1('0x21')]],'as':_0x182e57['as'],'attributes':_0x182e57[_0xa3f1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x531526){logger[_0xa3f1('0xd')](_0xa3f1('0x18'),_0x38fe75);logger[_0xa3f1('0xe')]('GetServicenowAccount',_0x38fe75,JSON[_0xa3f1('0x11')](_0x531526));_0x4a7569(_0x531526);})[_0xa3f1('0x17')](function(_0x20a44a){logger[_0xa3f1('0x13')](_0xa3f1('0x18'),_0x20a44a[_0xa3f1('0x14')],_0x38fe75);_0x50f670(_0x7046c3[_0xa3f1('0x13')](0x1f4,_0x20a44a[_0xa3f1('0x14')]));});});};exports[_0xa3f1('0x22')]=function(_0x444c6b){var _0x4cf5a1=this;return new Promise(function(_0xc65a12,_0xde2394){return db[_0xa3f1('0x23')][_0xa3f1('0x24')]({'raw':_0x444c6b[_0xa3f1('0x1a')]?_0x444c6b['options'][_0xa3f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x444c6b[_0xa3f1('0x1a')]?_0x444c6b[_0xa3f1('0x1a')][_0xa3f1('0x1c')]||null:null,'attributes':_0x444c6b['options']?_0x444c6b[_0xa3f1('0x1a')][_0xa3f1('0x1d')]||null:null,'include':_0x444c6b[_0xa3f1('0x1a')]?_0x444c6b[_0xa3f1('0x1a')][_0xa3f1('0x1f')]?_[_0xa3f1('0x20')](_0x444c6b['options'][_0xa3f1('0x1f')],function(_0x2de9e0){return{'model':db[_0x2de9e0[_0xa3f1('0x21')]],'as':_0x2de9e0['as'],'attributes':_0x2de9e0[_0xa3f1('0x1d')],'include':_0x2de9e0['include']?_[_0xa3f1('0x20')](_0x2de9e0['include'],function(_0x1998ca){return{'model':db[_0x1998ca[_0xa3f1('0x21')]],'as':_0x1998ca['as'],'attributes':_0x1998ca[_0xa3f1('0x1d')],'include':_0x1998ca[_0xa3f1('0x1f')]?_[_0xa3f1('0x20')](_0x1998ca[_0xa3f1('0x1f')],function(_0x38c91f){return{'model':db[_0x38c91f[_0xa3f1('0x21')]],'as':_0x38c91f['as'],'attributes':_0x38c91f[_0xa3f1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a5b38){logger[_0xa3f1('0xd')]('ShowServicenowAccount',_0x444c6b);logger[_0xa3f1('0xe')](_0xa3f1('0x22'),_0x444c6b,JSON[_0xa3f1('0x11')](_0x2a5b38));_0xc65a12(_0x2a5b38);})[_0xa3f1('0x17')](function(_0x2fc81e){logger['error'](_0xa3f1('0x22'),_0x2fc81e['message'],_0x444c6b);_0xde2394(_0x4cf5a1[_0xa3f1('0x13')](0x1f4,_0x2fc81e[_0xa3f1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 10edb6f..d5c80e8 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 _0x3fb9=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','/:id','exports','multer','util','path'];(function(_0x23c81c,_0x17311e){var _0xa77d11=function(_0x5b975b){while(--_0x5b975b){_0x23c81c['push'](_0x23c81c['shift']());}};_0xa77d11(++_0x17311e);}(_0x3fb9,0x162));var _0x93fb=function(_0x272d08,_0x13e0be){_0x272d08=_0x272d08-0x0;var _0xbb1d61=_0x3fb9[_0x272d08];return _0xbb1d61;};'use strict';var multer=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var path=require(_0x93fb('0x2'));var timeout=require(_0x93fb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x93fb('0x4'));var auth=require(_0x93fb('0x5'));var interaction=require(_0x93fb('0x6'));var config=require(_0x93fb('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x93fb('0x8')](),controller[_0x93fb('0x9')]);router[_0x93fb('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x93fb('0xb')]);router[_0x93fb('0xa')](_0x93fb('0xc'),auth[_0x93fb('0x8')](),controller[_0x93fb('0xd')]);router[_0x93fb('0xa')](_0x93fb('0xe'),auth[_0x93fb('0x8')](),controller[_0x93fb('0xf')]);router[_0x93fb('0xa')](_0x93fb('0x10'),auth[_0x93fb('0x8')](),controller[_0x93fb('0x11')]);router['post']('/',auth[_0x93fb('0x8')](),controller['create']);router[_0x93fb('0x12')](_0x93fb('0x13'),auth[_0x93fb('0x8')](),controller['update']);router['delete'](_0x93fb('0x13'),auth[_0x93fb('0x8')](),controller['destroy']);module[_0x93fb('0x14')]=router; \ No newline at end of file +var _0xc204=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xc204,0x1de));var _0x4c20=function(_0x311c51,_0x3f7c83){_0x311c51=_0x311c51-0x0;var _0x385c87=_0xc204[_0x311c51];return _0x385c87;};'use strict';var multer=require(_0x4c20('0x0'));var util=require(_0x4c20('0x1'));var path=require(_0x4c20('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c20('0x3'));var router=express[_0x4c20('0x4')]();var fs_extra=require(_0x4c20('0x5'));var auth=require(_0x4c20('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4c20('0x7'));var controller=require(_0x4c20('0x8'));router[_0x4c20('0x9')]('/',auth[_0x4c20('0xa')](),controller[_0x4c20('0xb')]);router[_0x4c20('0x9')](_0x4c20('0xc'),auth['isAuthenticated'](),controller[_0x4c20('0xd')]);router['get'](_0x4c20('0xe'),auth['isAuthenticated'](),controller[_0x4c20('0xf')]);router[_0x4c20('0x9')](_0x4c20('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4c20('0x9')](_0x4c20('0x11'),auth[_0x4c20('0xa')](),controller[_0x4c20('0x12')]);router[_0x4c20('0x13')]('/',auth[_0x4c20('0xa')](),controller[_0x4c20('0x14')]);router[_0x4c20('0x15')](_0x4c20('0xc'),auth['isAuthenticated'](),controller[_0x4c20('0x16')]);router['delete'](_0x4c20('0xc'),auth[_0x4c20('0xa')](),controller[_0x4c20('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 2a6b355..882bca3 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 _0x7c1a=['exports','STRING','sequelize'];(function(_0x40ba6c,_0x5e4c8f){var _0x2237a9=function(_0x3a438e){while(--_0x3a438e){_0x40ba6c['push'](_0x40ba6c['shift']());}};_0x2237a9(++_0x5e4c8f);}(_0x7c1a,0xbf));var _0xa7c1=function(_0x116d46,_0x572745){_0x116d46=_0x116d46-0x0;var _0x12118e=_0x7c1a[_0x116d46];return _0x12118e;};'use strict';var Sequelize=require(_0xa7c1('0x0'));module[_0xa7c1('0x1')]={'name':{'type':Sequelize[_0xa7c1('0x2')]},'description':{'type':Sequelize[_0xa7c1('0x2')]}}; \ No newline at end of file +var _0x8cad=['exports','STRING'];(function(_0x5812c3,_0x56da39){var _0x3219da=function(_0x55bc02){while(--_0x55bc02){_0x5812c3['push'](_0x5812c3['shift']());}};_0x3219da(++_0x56da39);}(_0x8cad,0x172));var _0xd8ca=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x8cad[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require('sequelize');module[_0xd8ca('0x0')]={'name':{'type':Sequelize[_0xd8ca('0x1')]},'description':{'type':Sequelize[_0xd8ca('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index be86f82..c2de860 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 _0x63d4=['json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','getFields','findOne','ServicenowField','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x3a7331,_0x9c95f8){var _0x537dce=function(_0x2589a7){while(--_0x2589a7){_0x3a7331['push'](_0x3a7331['shift']());}};_0x537dce(++_0x9c95f8);}(_0x63d4,0x126));var _0x463d=function(_0xfa67d5,_0x3c6e48){_0xfa67d5=_0xfa67d5-0x0;var _0x1c8923=_0x63d4[_0xfa67d5];return _0x1c8923;};'use strict';var emlformat=require(_0x463d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x463d('0x1'));var jsonpatch=require(_0x463d('0x2'));var rp=require(_0x463d('0x3'));var moment=require(_0x463d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x463d('0x5'));var util=require(_0x463d('0x6'));var path=require(_0x463d('0x7'));var sox=require(_0x463d('0x8'));var csv=require(_0x463d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x463d('0xa'));var _=require('lodash');var squel=require(_0x463d('0xb'));var crypto=require(_0x463d('0xc'));var jsforce=require(_0x463d('0xd'));var deskjs=require(_0x463d('0xe'));var toCsv=require(_0x463d('0x9'));var querystring=require(_0x463d('0xf'));var Papa=require(_0x463d('0x10'));var Redis=require(_0x463d('0x11'));var authService=require(_0x463d('0x12'));var qs=require(_0x463d('0x13'));var as=require(_0x463d('0x14'));var hardwareService=require(_0x463d('0x15'));var logger=require(_0x463d('0x16'))(_0x463d('0x17'));var utils=require('../../config/utils');var config=require(_0x463d('0x18'));var licenseUtil=require(_0x463d('0x19'));var db=require(_0x463d('0x1a'))['db'];function respondWithStatusCode(_0x5727a8,_0x5bbe33){_0x5bbe33=_0x5bbe33||0xcc;return function(_0x133d52){if(_0x133d52){return _0x5727a8[_0x463d('0x1b')](_0x5bbe33);}return _0x5727a8['status'](_0x5bbe33)[_0x463d('0x1c')]();};}function respondWithResult(_0x1d78ca,_0x49a364){_0x49a364=_0x49a364||0xc8;return function(_0x210095){if(_0x210095){return _0x1d78ca[_0x463d('0x1d')](_0x49a364)[_0x463d('0x1e')](_0x210095);}};}function respondWithFilteredResult(_0x10a12c,_0xbdbf9f){return function(_0x22d74c){if(_0x22d74c){var _0x1ff186=typeof _0xbdbf9f['offset']===_0x463d('0x1f')&&typeof _0xbdbf9f[_0x463d('0x20')]===_0x463d('0x1f');var _0x54a3bf=_0x22d74c[_0x463d('0x21')];var _0x57ae96=_0x1ff186?0x0:_0xbdbf9f[_0x463d('0x22')];var _0x34c931=_0x1ff186?_0x22d74c[_0x463d('0x21')]:_0xbdbf9f['offset']+_0xbdbf9f['limit'];var _0x3ac6ec;if(_0x34c931>=_0x54a3bf){_0x34c931=_0x54a3bf;_0x3ac6ec=0xc8;}else{_0x3ac6ec=0xce;}_0x10a12c[_0x463d('0x1d')](_0x3ac6ec);return _0x10a12c[_0x463d('0x23')]('Content-Range',_0x57ae96+'-'+_0x34c931+'/'+_0x54a3bf)['json'](_0x22d74c);}return null;};}function patchUpdates(_0x441daf){return function(_0x498f24){try{jsonpatch[_0x463d('0x24')](_0x498f24,_0x441daf,!![]);}catch(_0x1ff75b){return BPromise['reject'](_0x1ff75b);}return _0x498f24[_0x463d('0x25')]();};}function saveUpdates(_0x4f7f4d,_0x1bb6ff){return function(_0x37df5b){if(_0x37df5b){return _0x37df5b[_0x463d('0x26')](_0x4f7f4d)[_0x463d('0x27')](function(_0x6c133c){return _0x6c133c;});}return null;};}function removeEntity(_0x45ff3c,_0x4096fd){return function(_0xdfd45b){if(_0xdfd45b){return _0xdfd45b[_0x463d('0x28')]()[_0x463d('0x27')](function(){_0x45ff3c['status'](0xcc)[_0x463d('0x1c')]();});}};}function handleEntityNotFound(_0x45715f,_0x535930){return function(_0x5a7bdb){if(!_0x5a7bdb){_0x45715f[_0x463d('0x1b')](0x194);}return _0x5a7bdb;};}function handleError(_0x48f760,_0xf8175b){_0xf8175b=_0xf8175b||0x1f4;return function(_0x1f1181){logger[_0x463d('0x29')](_0x1f1181['stack']);if(_0x1f1181[_0x463d('0x2a')]){delete _0x1f1181['name'];}_0x48f760[_0x463d('0x1d')](_0xf8175b)['send'](_0x1f1181);};}exports['index']=function(_0x56f3f6,_0x2197af){var _0x3a9bc0={},_0x498226={},_0x41c6f6={'count':0x0,'rows':[]};var _0x2b1eaa=_[_0x463d('0x2b')](db[_0x463d('0x2c')][_0x463d('0x2d')],function(_0x1fb6b6){return{'name':_0x1fb6b6[_0x463d('0x2e')],'type':_0x1fb6b6[_0x463d('0x2f')]['key']};});_0x498226[_0x463d('0x30')]=_[_0x463d('0x2b')](_0x2b1eaa,'name');_0x498226[_0x463d('0x31')]=_[_0x463d('0x32')](_0x56f3f6['query']);_0x498226[_0x463d('0x33')]=_['intersection'](_0x498226[_0x463d('0x30')],_0x498226['query']);_0x3a9bc0[_0x463d('0x34')]=_[_0x463d('0x35')](_0x498226[_0x463d('0x30')],qs['fields'](_0x56f3f6[_0x463d('0x31')]['fields']));_0x3a9bc0[_0x463d('0x34')]=_0x3a9bc0[_0x463d('0x34')][_0x463d('0x36')]?_0x3a9bc0[_0x463d('0x34')]:_0x498226[_0x463d('0x30')];if(!_0x56f3f6['query']['hasOwnProperty'](_0x463d('0x37'))){_0x3a9bc0[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x20')]);_0x3a9bc0[_0x463d('0x22')]=qs[_0x463d('0x22')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x22')]);}_0x3a9bc0[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x39')]);_0x3a9bc0[_0x463d('0x3a')]=qs['filters'](_[_0x463d('0x3b')](_0x56f3f6[_0x463d('0x31')],_0x498226[_0x463d('0x33')]),_0x2b1eaa);if(_0x56f3f6[_0x463d('0x31')][_0x463d('0x3c')]){_0x3a9bc0[_0x463d('0x3a')]=_['merge'](_0x3a9bc0[_0x463d('0x3a')],{'$or':_[_0x463d('0x2b')](_0x2b1eaa,function(_0x3f2c58){if(_0x3f2c58['type']!==_0x463d('0x3d')){var _0x2c4f23={};_0x2c4f23[_0x3f2c58[_0x463d('0x2a')]]={'$like':'%'+_0x56f3f6[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x2c4f23;}})});}_0x3a9bc0=_['merge']({},_0x3a9bc0,_0x56f3f6[_0x463d('0x3e')]);var _0x59f0ef={'where':_0x3a9bc0[_0x463d('0x3a')]};return db[_0x463d('0x2c')][_0x463d('0x21')](_0x59f0ef)[_0x463d('0x27')](function(_0x4a3bee){_0x41c6f6[_0x463d('0x21')]=_0x4a3bee;if(_0x56f3f6[_0x463d('0x31')][_0x463d('0x3f')]){_0x3a9bc0[_0x463d('0x40')]=[{'all':!![]}];}return db[_0x463d('0x2c')][_0x463d('0x41')](_0x3a9bc0);})[_0x463d('0x27')](function(_0x9cd6a0){_0x41c6f6[_0x463d('0x42')]=_0x9cd6a0;return _0x41c6f6;})[_0x463d('0x27')](respondWithFilteredResult(_0x2197af,_0x3a9bc0))[_0x463d('0x43')](handleError(_0x2197af,null));};exports[_0x463d('0x44')]=function(_0x1aa1c5,_0x588d53){var _0x2f3950={'raw':![],'where':{'id':_0x1aa1c5[_0x463d('0x45')]['id']}},_0x1e0bad={};_0x1e0bad[_0x463d('0x30')]=_[_0x463d('0x32')](db['ServicenowConfiguration'][_0x463d('0x2d')]);_0x1e0bad[_0x463d('0x31')]=_[_0x463d('0x32')](_0x1aa1c5['query']);_0x1e0bad[_0x463d('0x33')]=_[_0x463d('0x35')](_0x1e0bad[_0x463d('0x30')],_0x1e0bad[_0x463d('0x31')]);_0x2f3950[_0x463d('0x34')]=_[_0x463d('0x35')](_0x1e0bad[_0x463d('0x30')],qs['fields'](_0x1aa1c5[_0x463d('0x31')][_0x463d('0x46')]));_0x2f3950['attributes']=_0x2f3950[_0x463d('0x34')][_0x463d('0x36')]?_0x2f3950[_0x463d('0x34')]:_0x1e0bad[_0x463d('0x30')];if(_0x1aa1c5[_0x463d('0x31')][_0x463d('0x3f')]){_0x2f3950['include']=[{'all':!![]}];}_0x2f3950=_[_0x463d('0x47')]({},_0x2f3950,_0x1aa1c5[_0x463d('0x3e')]);return db[_0x463d('0x2c')][_0x463d('0x48')](_0x2f3950)[_0x463d('0x27')](handleEntityNotFound(_0x588d53,null))['then'](respondWithResult(_0x588d53,null))[_0x463d('0x43')](handleError(_0x588d53,null));};exports['create']=function(_0x1eeeb4,_0x1a06dd){return db[_0x463d('0x2c')][_0x463d('0x49')](_0x1eeeb4[_0x463d('0x4a')],{})['then'](respondWithResult(_0x1a06dd,0xc9))[_0x463d('0x43')](handleError(_0x1a06dd,null));};exports[_0x463d('0x26')]=function(_0x348fa1,_0x362199){if(_0x348fa1[_0x463d('0x4a')]['id']){delete _0x348fa1[_0x463d('0x4a')]['id'];}return db[_0x463d('0x2c')][_0x463d('0x48')]({'where':{'id':_0x348fa1[_0x463d('0x45')]['id']}})[_0x463d('0x27')](handleEntityNotFound(_0x362199,null))[_0x463d('0x27')](saveUpdates(_0x348fa1['body'],null))[_0x463d('0x27')](respondWithResult(_0x362199,null))[_0x463d('0x43')](handleError(_0x362199,null));};exports['destroy']=function(_0x56b0e2,_0x212681){return db[_0x463d('0x2c')][_0x463d('0x48')]({'where':{'id':_0x56b0e2[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x212681,null))[_0x463d('0x27')](removeEntity(_0x212681,null))[_0x463d('0x43')](handleError(_0x212681,null));};exports[_0x463d('0x4b')]=function(_0x1c298b,_0x2f7e75,_0x46f70b){var _0x331fd6={};var _0x1f37ef={};var _0x281c28;var _0x4509eb;return db[_0x463d('0x2c')][_0x463d('0x4c')]({'where':{'id':_0x1c298b[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f7e75,null))[_0x463d('0x27')](function(_0x5e4fe8){if(_0x5e4fe8){_0x281c28=_0x5e4fe8;_0x1f37ef['model']=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x1f37ef[_0x463d('0x31')]=_['keys'](_0x1c298b[_0x463d('0x31')]);_0x1f37ef[_0x463d('0x33')]=_['intersection'](_0x1f37ef[_0x463d('0x30')],_0x1f37ef[_0x463d('0x31')]);_0x331fd6[_0x463d('0x34')]=_['intersection'](_0x1f37ef[_0x463d('0x30')],qs['fields'](_0x1c298b[_0x463d('0x31')][_0x463d('0x46')]));_0x331fd6[_0x463d('0x34')]=_0x331fd6['attributes'][_0x463d('0x36')]?_0x331fd6[_0x463d('0x34')]:_0x1f37ef['model'];_0x331fd6[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x1c298b['query'][_0x463d('0x39')]);_0x331fd6[_0x463d('0x3a')]=qs[_0x463d('0x33')](_['pick'](_0x1c298b[_0x463d('0x31')],_0x1f37ef[_0x463d('0x33')]));if(_0x1c298b[_0x463d('0x31')][_0x463d('0x3c')]){_0x331fd6[_0x463d('0x3a')]=_[_0x463d('0x47')](_0x331fd6[_0x463d('0x3a')],{'$or':_['map'](_0x331fd6['attributes'],function(_0x24c011){var _0x12a05d={};_0x12a05d[_0x24c011]={'$like':'%'+_0x1c298b[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x12a05d;})});}_0x331fd6=_['merge']({},_0x331fd6,_0x1c298b[_0x463d('0x3e')]);return _0x281c28[_0x463d('0x4b')](_0x331fd6);}})[_0x463d('0x27')](function(_0x18f6fc){if(_0x18f6fc){_0x4509eb=_0x18f6fc[_0x463d('0x36')];if(!_0x1c298b['query']['hasOwnProperty'](_0x463d('0x37'))){_0x331fd6[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x1c298b['query'][_0x463d('0x20')]);_0x331fd6[_0x463d('0x22')]=qs['offset'](_0x1c298b[_0x463d('0x31')][_0x463d('0x22')]);}return _0x281c28[_0x463d('0x4b')](_0x331fd6);}})['then'](function(_0x4c8037){if(_0x4c8037){return _0x4c8037?{'count':_0x4509eb,'rows':_0x4c8037}:null;}})[_0x463d('0x27')](respondWithResult(_0x2f7e75,null))[_0x463d('0x43')](handleError(_0x2f7e75,null));};exports[_0x463d('0x4e')]=function(_0x31eeca,_0x3b5f1a,_0xc4be42){var _0x167820={};var _0x164722={};var _0x4a7c56;var _0x205fe6;return db['ServicenowConfiguration'][_0x463d('0x4c')]({'where':{'id':_0x31eeca[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b5f1a,null))[_0x463d('0x27')](function(_0x7b298f){if(_0x7b298f){_0x4a7c56=_0x7b298f;_0x164722[_0x463d('0x30')]=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x164722[_0x463d('0x31')]=_[_0x463d('0x32')](_0x31eeca[_0x463d('0x31')]);_0x164722[_0x463d('0x33')]=_[_0x463d('0x35')](_0x164722[_0x463d('0x30')],_0x164722[_0x463d('0x31')]);_0x167820[_0x463d('0x34')]=_[_0x463d('0x35')](_0x164722[_0x463d('0x30')],qs[_0x463d('0x46')](_0x31eeca[_0x463d('0x31')][_0x463d('0x46')]));_0x167820[_0x463d('0x34')]=_0x167820[_0x463d('0x34')][_0x463d('0x36')]?_0x167820[_0x463d('0x34')]:_0x164722['model'];_0x167820[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x31eeca[_0x463d('0x31')][_0x463d('0x39')]);_0x167820[_0x463d('0x3a')]=qs[_0x463d('0x33')](_['pick'](_0x31eeca[_0x463d('0x31')],_0x164722[_0x463d('0x33')]));if(_0x31eeca[_0x463d('0x31')][_0x463d('0x3c')]){_0x167820[_0x463d('0x3a')]=_[_0x463d('0x47')](_0x167820[_0x463d('0x3a')],{'$or':_['map'](_0x167820['attributes'],function(_0x3154e4){var _0x128d0e={};_0x128d0e[_0x3154e4]={'$like':'%'+_0x31eeca['query'][_0x463d('0x3c')]+'%'};return _0x128d0e;})});}_0x167820=_[_0x463d('0x47')]({},_0x167820,_0x31eeca['options']);return _0x4a7c56['getSubjects'](_0x167820);}})[_0x463d('0x27')](function(_0x4f9cbc){if(_0x4f9cbc){_0x205fe6=_0x4f9cbc['length'];if(!_0x31eeca[_0x463d('0x31')][_0x463d('0x4f')](_0x463d('0x37'))){_0x167820[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x31eeca[_0x463d('0x31')][_0x463d('0x20')]);_0x167820['offset']=qs[_0x463d('0x22')](_0x31eeca[_0x463d('0x31')][_0x463d('0x22')]);}return _0x4a7c56[_0x463d('0x4e')](_0x167820);}})['then'](function(_0x1169bf){if(_0x1169bf){return _0x1169bf?{'count':_0x205fe6,'rows':_0x1169bf}:null;}})[_0x463d('0x27')](respondWithResult(_0x3b5f1a,null))['catch'](handleError(_0x3b5f1a,null));};exports[_0x463d('0x50')]=function(_0x3a5a37,_0x31d4fb,_0x31b85b){var _0x8b1305={};var _0x50e8c0={};var _0x4b7546;var _0x25b471;return db[_0x463d('0x2c')]['findOne']({'where':{'id':_0x3a5a37[_0x463d('0x45')]['id']}})[_0x463d('0x27')](handleEntityNotFound(_0x31d4fb,null))[_0x463d('0x27')](function(_0x5e7a19){if(_0x5e7a19){_0x4b7546=_0x5e7a19;_0x50e8c0[_0x463d('0x30')]=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x50e8c0[_0x463d('0x31')]=_[_0x463d('0x32')](_0x3a5a37[_0x463d('0x31')]);_0x50e8c0['filters']=_['intersection'](_0x50e8c0[_0x463d('0x30')],_0x50e8c0[_0x463d('0x31')]);_0x8b1305['attributes']=_['intersection'](_0x50e8c0[_0x463d('0x30')],qs[_0x463d('0x46')](_0x3a5a37[_0x463d('0x31')][_0x463d('0x46')]));_0x8b1305['attributes']=_0x8b1305['attributes'][_0x463d('0x36')]?_0x8b1305[_0x463d('0x34')]:_0x50e8c0[_0x463d('0x30')];_0x8b1305['order']=qs[_0x463d('0x39')](_0x3a5a37[_0x463d('0x31')]['sort']);_0x8b1305[_0x463d('0x3a')]=qs['filters'](_[_0x463d('0x3b')](_0x3a5a37[_0x463d('0x31')],_0x50e8c0[_0x463d('0x33')]));if(_0x3a5a37[_0x463d('0x31')][_0x463d('0x3c')]){_0x8b1305['where']=_[_0x463d('0x47')](_0x8b1305['where'],{'$or':_[_0x463d('0x2b')](_0x8b1305[_0x463d('0x34')],function(_0xc2496b){var _0x246189={};_0x246189[_0xc2496b]={'$like':'%'+_0x3a5a37[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x246189;})});}_0x8b1305=_[_0x463d('0x47')]({},_0x8b1305,_0x3a5a37[_0x463d('0x3e')]);return _0x4b7546['getDescriptions'](_0x8b1305);}})['then'](function(_0x26ec39){if(_0x26ec39){_0x25b471=_0x26ec39['length'];if(!_0x3a5a37[_0x463d('0x31')]['hasOwnProperty'](_0x463d('0x37'))){_0x8b1305[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x3a5a37['query'][_0x463d('0x20')]);_0x8b1305[_0x463d('0x22')]=qs['offset'](_0x3a5a37[_0x463d('0x31')][_0x463d('0x22')]);}return _0x4b7546[_0x463d('0x50')](_0x8b1305);}})[_0x463d('0x27')](function(_0x50d9f1){if(_0x50d9f1){return _0x50d9f1?{'count':_0x25b471,'rows':_0x50d9f1}:null;}})[_0x463d('0x27')](respondWithResult(_0x31d4fb,null))[_0x463d('0x43')](handleError(_0x31d4fb,null));}; \ No newline at end of file +var _0xb788=['findOne','ServicenowField','nolimit','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','getFields'];(function(_0x4c6fe9,_0x545ab3){var _0x4046b7=function(_0x5561a5){while(--_0x5561a5){_0x4c6fe9['push'](_0x4c6fe9['shift']());}};_0x4046b7(++_0x545ab3);}(_0xb788,0x1d9));var _0x8b78=function(_0x467e9e,_0x4a6888){_0x467e9e=_0x467e9e-0x0;var _0x10376a=_0xb788[_0x467e9e];return _0x10376a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b78('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b78('0x1'));var rp=require(_0x8b78('0x2'));var moment=require(_0x8b78('0x3'));var BPromise=require(_0x8b78('0x4'));var Mustache=require('mustache');var util=require(_0x8b78('0x5'));var path=require(_0x8b78('0x6'));var sox=require(_0x8b78('0x7'));var csv=require(_0x8b78('0x8'));var ejs=require(_0x8b78('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b78('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b78('0xb'));var toCsv=require(_0x8b78('0x8'));var querystring=require(_0x8b78('0xc'));var Papa=require(_0x8b78('0xd'));var Redis=require('ioredis');var authService=require(_0x8b78('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8b78('0xf'));var hardwareService=require(_0x8b78('0x10'));var logger=require(_0x8b78('0x11'))(_0x8b78('0x12'));var utils=require('../../config/utils');var config=require(_0x8b78('0x13'));var licenseUtil=require(_0x8b78('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1566,_0x3cbb34){_0x3cbb34=_0x3cbb34||0xcc;return function(_0xfc68c){if(_0xfc68c){return _0x1b1566[_0x8b78('0x15')](_0x3cbb34);}return _0x1b1566[_0x8b78('0x16')](_0x3cbb34)[_0x8b78('0x17')]();};}function respondWithResult(_0x5a0269,_0x24f1a8){_0x24f1a8=_0x24f1a8||0xc8;return function(_0x8427c){if(_0x8427c){return _0x5a0269[_0x8b78('0x16')](_0x24f1a8)[_0x8b78('0x18')](_0x8427c);}};}function respondWithFilteredResult(_0x506d15,_0xd7d662){return function(_0x570a6b){if(_0x570a6b){var _0x5e8593=typeof _0xd7d662[_0x8b78('0x19')]===_0x8b78('0x1a')&&typeof _0xd7d662[_0x8b78('0x1b')]===_0x8b78('0x1a');var _0x51e20c=_0x570a6b[_0x8b78('0x1c')];var _0x47dc9c=_0x5e8593?0x0:_0xd7d662[_0x8b78('0x19')];var _0x12f9c9=_0x5e8593?_0x570a6b[_0x8b78('0x1c')]:_0xd7d662['offset']+_0xd7d662[_0x8b78('0x1b')];var _0x5e48bc;if(_0x12f9c9>=_0x51e20c){_0x12f9c9=_0x51e20c;_0x5e48bc=0xc8;}else{_0x5e48bc=0xce;}_0x506d15[_0x8b78('0x16')](_0x5e48bc);return _0x506d15['set'](_0x8b78('0x1d'),_0x47dc9c+'-'+_0x12f9c9+'/'+_0x51e20c)['json'](_0x570a6b);}return null;};}function patchUpdates(_0x15567a){return function(_0x110ed7){try{jsonpatch[_0x8b78('0x1e')](_0x110ed7,_0x15567a,!![]);}catch(_0xc3d9a1){return BPromise[_0x8b78('0x1f')](_0xc3d9a1);}return _0x110ed7['save']();};}function saveUpdates(_0x524f22,_0x42773b){return function(_0x237328){if(_0x237328){return _0x237328[_0x8b78('0x20')](_0x524f22)[_0x8b78('0x21')](function(_0x42274f){return _0x42274f;});}return null;};}function removeEntity(_0x4a68f0,_0x3c3803){return function(_0x4cd851){if(_0x4cd851){return _0x4cd851['destroy']()['then'](function(){_0x4a68f0[_0x8b78('0x16')](0xcc)[_0x8b78('0x17')]();});}};}function handleEntityNotFound(_0x331f60,_0x346a19){return function(_0x45d9e0){if(!_0x45d9e0){_0x331f60[_0x8b78('0x15')](0x194);}return _0x45d9e0;};}function handleError(_0x23afcd,_0x16b23b){_0x16b23b=_0x16b23b||0x1f4;return function(_0x2681f1){logger[_0x8b78('0x22')](_0x2681f1[_0x8b78('0x23')]);if(_0x2681f1['name']){delete _0x2681f1[_0x8b78('0x24')];}_0x23afcd[_0x8b78('0x16')](_0x16b23b)[_0x8b78('0x25')](_0x2681f1);};}exports[_0x8b78('0x26')]=function(_0x1518dd,_0x2972b5){var _0x18a621={},_0x45fa0b={},_0x4e452d={'count':0x0,'rows':[]};var _0x3e7438=_['map'](db[_0x8b78('0x27')][_0x8b78('0x28')],function(_0x45967f){return{'name':_0x45967f[_0x8b78('0x29')],'type':_0x45967f[_0x8b78('0x2a')][_0x8b78('0x2b')]};});_0x45fa0b[_0x8b78('0x2c')]=_[_0x8b78('0x2d')](_0x3e7438,_0x8b78('0x24'));_0x45fa0b[_0x8b78('0x2e')]=_[_0x8b78('0x2f')](_0x1518dd[_0x8b78('0x2e')]);_0x45fa0b[_0x8b78('0x30')]=_[_0x8b78('0x31')](_0x45fa0b[_0x8b78('0x2c')],_0x45fa0b[_0x8b78('0x2e')]);_0x18a621['attributes']=_[_0x8b78('0x31')](_0x45fa0b['model'],qs[_0x8b78('0x32')](_0x1518dd['query']['fields']));_0x18a621[_0x8b78('0x33')]=_0x18a621[_0x8b78('0x33')][_0x8b78('0x34')]?_0x18a621[_0x8b78('0x33')]:_0x45fa0b[_0x8b78('0x2c')];if(!_0x1518dd[_0x8b78('0x2e')][_0x8b78('0x35')]('nolimit')){_0x18a621[_0x8b78('0x1b')]=qs[_0x8b78('0x1b')](_0x1518dd[_0x8b78('0x2e')][_0x8b78('0x1b')]);_0x18a621[_0x8b78('0x19')]=qs['offset'](_0x1518dd['query'][_0x8b78('0x19')]);}_0x18a621[_0x8b78('0x36')]=qs[_0x8b78('0x37')](_0x1518dd[_0x8b78('0x2e')]['sort']);_0x18a621['where']=qs[_0x8b78('0x30')](_[_0x8b78('0x38')](_0x1518dd[_0x8b78('0x2e')],_0x45fa0b[_0x8b78('0x30')]),_0x3e7438);if(_0x1518dd[_0x8b78('0x2e')][_0x8b78('0x39')]){_0x18a621['where']=_[_0x8b78('0x3a')](_0x18a621['where'],{'$or':_[_0x8b78('0x2d')](_0x3e7438,function(_0x22d351){if(_0x22d351[_0x8b78('0x2a')]!=='VIRTUAL'){var _0x1d33b9={};_0x1d33b9[_0x22d351[_0x8b78('0x24')]]={'$like':'%'+_0x1518dd[_0x8b78('0x2e')][_0x8b78('0x39')]+'%'};return _0x1d33b9;}})});}_0x18a621=_['merge']({},_0x18a621,_0x1518dd[_0x8b78('0x3b')]);var _0x1b7f08={'where':_0x18a621[_0x8b78('0x3c')]};return db[_0x8b78('0x27')][_0x8b78('0x1c')](_0x1b7f08)[_0x8b78('0x21')](function(_0x294725){_0x4e452d[_0x8b78('0x1c')]=_0x294725;if(_0x1518dd[_0x8b78('0x2e')][_0x8b78('0x3d')]){_0x18a621['include']=[{'all':!![]}];}return db[_0x8b78('0x27')][_0x8b78('0x3e')](_0x18a621);})[_0x8b78('0x21')](function(_0x81b833){_0x4e452d[_0x8b78('0x3f')]=_0x81b833;return _0x4e452d;})[_0x8b78('0x21')](respondWithFilteredResult(_0x2972b5,_0x18a621))['catch'](handleError(_0x2972b5,null));};exports[_0x8b78('0x40')]=function(_0x10d2ca,_0x521417){var _0x401698={'raw':![],'where':{'id':_0x10d2ca[_0x8b78('0x41')]['id']}},_0x4422d7={};_0x4422d7[_0x8b78('0x2c')]=_[_0x8b78('0x2f')](db[_0x8b78('0x27')][_0x8b78('0x28')]);_0x4422d7['query']=_[_0x8b78('0x2f')](_0x10d2ca[_0x8b78('0x2e')]);_0x4422d7[_0x8b78('0x30')]=_['intersection'](_0x4422d7[_0x8b78('0x2c')],_0x4422d7[_0x8b78('0x2e')]);_0x401698['attributes']=_[_0x8b78('0x31')](_0x4422d7[_0x8b78('0x2c')],qs[_0x8b78('0x32')](_0x10d2ca[_0x8b78('0x2e')]['fields']));_0x401698[_0x8b78('0x33')]=_0x401698[_0x8b78('0x33')][_0x8b78('0x34')]?_0x401698[_0x8b78('0x33')]:_0x4422d7['model'];if(_0x10d2ca[_0x8b78('0x2e')]['includeAll']){_0x401698[_0x8b78('0x42')]=[{'all':!![]}];}_0x401698=_[_0x8b78('0x3a')]({},_0x401698,_0x10d2ca[_0x8b78('0x3b')]);return db[_0x8b78('0x27')][_0x8b78('0x43')](_0x401698)[_0x8b78('0x21')](handleEntityNotFound(_0x521417,null))[_0x8b78('0x21')](respondWithResult(_0x521417,null))[_0x8b78('0x44')](handleError(_0x521417,null));};exports['create']=function(_0x4d6e08,_0xb85e8){return db[_0x8b78('0x27')][_0x8b78('0x45')](_0x4d6e08[_0x8b78('0x46')],{})['then'](respondWithResult(_0xb85e8,0xc9))[_0x8b78('0x44')](handleError(_0xb85e8,null));};exports[_0x8b78('0x20')]=function(_0x16a64f,_0x5f0f01){if(_0x16a64f[_0x8b78('0x46')]['id']){delete _0x16a64f[_0x8b78('0x46')]['id'];}return db[_0x8b78('0x27')][_0x8b78('0x43')]({'where':{'id':_0x16a64f[_0x8b78('0x41')]['id']}})[_0x8b78('0x21')](handleEntityNotFound(_0x5f0f01,null))[_0x8b78('0x21')](saveUpdates(_0x16a64f['body'],null))[_0x8b78('0x21')](respondWithResult(_0x5f0f01,null))[_0x8b78('0x44')](handleError(_0x5f0f01,null));};exports[_0x8b78('0x47')]=function(_0x496929,_0x266ffd){return db[_0x8b78('0x27')][_0x8b78('0x43')]({'where':{'id':_0x496929[_0x8b78('0x41')]['id']}})[_0x8b78('0x21')](handleEntityNotFound(_0x266ffd,null))[_0x8b78('0x21')](removeEntity(_0x266ffd,null))['catch'](handleError(_0x266ffd,null));};exports[_0x8b78('0x48')]=function(_0x3a4a2b,_0x438dbc,_0xfde2fc){var _0x31ee2e={};var _0x5b1e95={};var _0xac92d9;var _0x4b8959;return db[_0x8b78('0x27')][_0x8b78('0x49')]({'where':{'id':_0x3a4a2b['params']['id']}})[_0x8b78('0x21')](handleEntityNotFound(_0x438dbc,null))[_0x8b78('0x21')](function(_0x573f5e){if(_0x573f5e){_0xac92d9=_0x573f5e;_0x5b1e95['model']=_['keys'](db[_0x8b78('0x4a')][_0x8b78('0x28')]);_0x5b1e95[_0x8b78('0x2e')]=_[_0x8b78('0x2f')](_0x3a4a2b[_0x8b78('0x2e')]);_0x5b1e95['filters']=_[_0x8b78('0x31')](_0x5b1e95[_0x8b78('0x2c')],_0x5b1e95[_0x8b78('0x2e')]);_0x31ee2e[_0x8b78('0x33')]=_['intersection'](_0x5b1e95[_0x8b78('0x2c')],qs[_0x8b78('0x32')](_0x3a4a2b[_0x8b78('0x2e')][_0x8b78('0x32')]));_0x31ee2e['attributes']=_0x31ee2e['attributes'][_0x8b78('0x34')]?_0x31ee2e[_0x8b78('0x33')]:_0x5b1e95['model'];_0x31ee2e[_0x8b78('0x36')]=qs[_0x8b78('0x37')](_0x3a4a2b[_0x8b78('0x2e')][_0x8b78('0x37')]);_0x31ee2e[_0x8b78('0x3c')]=qs['filters'](_[_0x8b78('0x38')](_0x3a4a2b[_0x8b78('0x2e')],_0x5b1e95[_0x8b78('0x30')]));if(_0x3a4a2b[_0x8b78('0x2e')][_0x8b78('0x39')]){_0x31ee2e[_0x8b78('0x3c')]=_[_0x8b78('0x3a')](_0x31ee2e[_0x8b78('0x3c')],{'$or':_[_0x8b78('0x2d')](_0x31ee2e[_0x8b78('0x33')],function(_0x4d10cd){var _0x287f11={};_0x287f11[_0x4d10cd]={'$like':'%'+_0x3a4a2b[_0x8b78('0x2e')]['filter']+'%'};return _0x287f11;})});}_0x31ee2e=_[_0x8b78('0x3a')]({},_0x31ee2e,_0x3a4a2b['options']);return _0xac92d9[_0x8b78('0x48')](_0x31ee2e);}})[_0x8b78('0x21')](function(_0x32fe45){if(_0x32fe45){_0x4b8959=_0x32fe45[_0x8b78('0x34')];if(!_0x3a4a2b[_0x8b78('0x2e')][_0x8b78('0x35')](_0x8b78('0x4b'))){_0x31ee2e[_0x8b78('0x1b')]=qs[_0x8b78('0x1b')](_0x3a4a2b['query'][_0x8b78('0x1b')]);_0x31ee2e[_0x8b78('0x19')]=qs[_0x8b78('0x19')](_0x3a4a2b[_0x8b78('0x2e')]['offset']);}return _0xac92d9[_0x8b78('0x48')](_0x31ee2e);}})[_0x8b78('0x21')](function(_0x556285){if(_0x556285){return _0x556285?{'count':_0x4b8959,'rows':_0x556285}:null;}})['then'](respondWithResult(_0x438dbc,null))[_0x8b78('0x44')](handleError(_0x438dbc,null));};exports['getSubjects']=function(_0x3c33be,_0x556ce3,_0x191b62){var _0x3a9bf4={};var _0x1cea33={};var _0x1a1d43;var _0x279228;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3c33be[_0x8b78('0x41')]['id']}})['then'](handleEntityNotFound(_0x556ce3,null))[_0x8b78('0x21')](function(_0xd2712e){if(_0xd2712e){_0x1a1d43=_0xd2712e;_0x1cea33[_0x8b78('0x2c')]=_['keys'](db[_0x8b78('0x4a')]['rawAttributes']);_0x1cea33['query']=_['keys'](_0x3c33be[_0x8b78('0x2e')]);_0x1cea33['filters']=_[_0x8b78('0x31')](_0x1cea33[_0x8b78('0x2c')],_0x1cea33[_0x8b78('0x2e')]);_0x3a9bf4[_0x8b78('0x33')]=_[_0x8b78('0x31')](_0x1cea33['model'],qs['fields'](_0x3c33be[_0x8b78('0x2e')][_0x8b78('0x32')]));_0x3a9bf4[_0x8b78('0x33')]=_0x3a9bf4[_0x8b78('0x33')][_0x8b78('0x34')]?_0x3a9bf4['attributes']:_0x1cea33[_0x8b78('0x2c')];_0x3a9bf4[_0x8b78('0x36')]=qs[_0x8b78('0x37')](_0x3c33be['query'][_0x8b78('0x37')]);_0x3a9bf4[_0x8b78('0x3c')]=qs[_0x8b78('0x30')](_[_0x8b78('0x38')](_0x3c33be[_0x8b78('0x2e')],_0x1cea33[_0x8b78('0x30')]));if(_0x3c33be[_0x8b78('0x2e')][_0x8b78('0x39')]){_0x3a9bf4[_0x8b78('0x3c')]=_[_0x8b78('0x3a')](_0x3a9bf4[_0x8b78('0x3c')],{'$or':_[_0x8b78('0x2d')](_0x3a9bf4[_0x8b78('0x33')],function(_0xb6a539){var _0x340147={};_0x340147[_0xb6a539]={'$like':'%'+_0x3c33be[_0x8b78('0x2e')][_0x8b78('0x39')]+'%'};return _0x340147;})});}_0x3a9bf4=_['merge']({},_0x3a9bf4,_0x3c33be[_0x8b78('0x3b')]);return _0x1a1d43[_0x8b78('0x4c')](_0x3a9bf4);}})['then'](function(_0x4b43b7){if(_0x4b43b7){_0x279228=_0x4b43b7['length'];if(!_0x3c33be[_0x8b78('0x2e')]['hasOwnProperty'](_0x8b78('0x4b'))){_0x3a9bf4['limit']=qs[_0x8b78('0x1b')](_0x3c33be[_0x8b78('0x2e')][_0x8b78('0x1b')]);_0x3a9bf4['offset']=qs[_0x8b78('0x19')](_0x3c33be[_0x8b78('0x2e')]['offset']);}return _0x1a1d43['getSubjects'](_0x3a9bf4);}})[_0x8b78('0x21')](function(_0x3e1dce){if(_0x3e1dce){return _0x3e1dce?{'count':_0x279228,'rows':_0x3e1dce}:null;}})['then'](respondWithResult(_0x556ce3,null))[_0x8b78('0x44')](handleError(_0x556ce3,null));};exports[_0x8b78('0x4d')]=function(_0x542374,_0x421e25,_0x2064fd){var _0xf7b954={};var _0x2c0702={};var _0x95ced7;var _0x32d16d;return db[_0x8b78('0x27')]['findOne']({'where':{'id':_0x542374[_0x8b78('0x41')]['id']}})[_0x8b78('0x21')](handleEntityNotFound(_0x421e25,null))['then'](function(_0x29de36){if(_0x29de36){_0x95ced7=_0x29de36;_0x2c0702[_0x8b78('0x2c')]=_[_0x8b78('0x2f')](db[_0x8b78('0x4a')]['rawAttributes']);_0x2c0702[_0x8b78('0x2e')]=_[_0x8b78('0x2f')](_0x542374['query']);_0x2c0702[_0x8b78('0x30')]=_[_0x8b78('0x31')](_0x2c0702[_0x8b78('0x2c')],_0x2c0702[_0x8b78('0x2e')]);_0xf7b954[_0x8b78('0x33')]=_[_0x8b78('0x31')](_0x2c0702[_0x8b78('0x2c')],qs[_0x8b78('0x32')](_0x542374[_0x8b78('0x2e')]['fields']));_0xf7b954[_0x8b78('0x33')]=_0xf7b954[_0x8b78('0x33')][_0x8b78('0x34')]?_0xf7b954['attributes']:_0x2c0702[_0x8b78('0x2c')];_0xf7b954[_0x8b78('0x36')]=qs[_0x8b78('0x37')](_0x542374[_0x8b78('0x2e')]['sort']);_0xf7b954['where']=qs[_0x8b78('0x30')](_['pick'](_0x542374[_0x8b78('0x2e')],_0x2c0702[_0x8b78('0x30')]));if(_0x542374['query'][_0x8b78('0x39')]){_0xf7b954[_0x8b78('0x3c')]=_['merge'](_0xf7b954['where'],{'$or':_[_0x8b78('0x2d')](_0xf7b954[_0x8b78('0x33')],function(_0x514549){var _0x45fa57={};_0x45fa57[_0x514549]={'$like':'%'+_0x542374[_0x8b78('0x2e')][_0x8b78('0x39')]+'%'};return _0x45fa57;})});}_0xf7b954=_['merge']({},_0xf7b954,_0x542374[_0x8b78('0x3b')]);return _0x95ced7[_0x8b78('0x4d')](_0xf7b954);}})[_0x8b78('0x21')](function(_0xbc23b8){if(_0xbc23b8){_0x32d16d=_0xbc23b8[_0x8b78('0x34')];if(!_0x542374[_0x8b78('0x2e')][_0x8b78('0x35')](_0x8b78('0x4b'))){_0xf7b954['limit']=qs['limit'](_0x542374[_0x8b78('0x2e')]['limit']);_0xf7b954[_0x8b78('0x19')]=qs['offset'](_0x542374[_0x8b78('0x2e')]['offset']);}return _0x95ced7[_0x8b78('0x4d')](_0xf7b954);}})[_0x8b78('0x21')](function(_0x2b0006){if(_0x2b0006){return _0x2b0006?{'count':_0x32d16d,'rows':_0x2b0006}:null;}})[_0x8b78('0x21')](respondWithResult(_0x421e25,null))[_0x8b78('0x44')](handleError(_0x421e25,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index fe778c0..08c3a3b 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 _0x8130=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define'];(function(_0x55ec7a,_0x29f08a){var _0x589980=function(_0x2eb8b2){while(--_0x2eb8b2){_0x55ec7a['push'](_0x55ec7a['shift']());}};_0x589980(++_0x29f08a);}(_0x8130,0x146));var _0x0813=function(_0x5d9c81,_0x348326){_0x5d9c81=_0x5d9c81-0x0;var _0x46a464=_0x8130[_0x5d9c81];return _0x46a464;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var logger=require('../../config/logger')(_0x0813('0x2'));var moment=require(_0x0813('0x3'));var BPromise=require(_0x0813('0x4'));var rp=require(_0x0813('0x5'));var fs=require('fs');var path=require(_0x0813('0x6'));var rimraf=require(_0x0813('0x7'));var config=require('../../config/environment');var attributes=require(_0x0813('0x8'));module['exports']=function(_0x563ee2,_0x306454){return _0x563ee2[_0x0813('0x9')](_0x0813('0xa'),attributes,{'tableName':_0x0813('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc901=['ServicenowConfiguration','int_servicenow_configurations','lodash','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x327b6b,_0x5c61e3){var _0x41616b=function(_0x3cfd00){while(--_0x3cfd00){_0x327b6b['push'](_0x327b6b['shift']());}};_0x41616b(++_0x5c61e3);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c90('0x1'));var rp=require(_0x1c90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c90('0x3'));var config=require(_0x1c90('0x4'));var attributes=require(_0x1c90('0x5'));module[_0x1c90('0x6')]=function(_0x1c9021,_0x14eb4f){return _0x1c9021[_0x1c90('0x7')](_0x1c90('0x8'),attributes,{'tableName':_0x1c90('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 b71813c..3b85563 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 _0x5556=['client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5556,0x138));var _0x6555=function(_0x323f13,_0x5975ae){_0x323f13=_0x323f13-0x0;var _0x755a38=_0x5556[_0x323f13];return _0x755a38;};'use strict';var _=require(_0x6555('0x0'));var util=require(_0x6555('0x1'));var moment=require(_0x6555('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6555('0x3'))['db'];var utils=require(_0x6555('0x4'));var logger=require('../../config/logger')(_0x6555('0x5'));var config=require(_0x6555('0x6'));var jayson=require(_0x6555('0x7'));var client=jayson[_0x6555('0x8')][_0x6555('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc76cc,_0x126950,_0x1c4b95){return new BPromise(function(_0xc9540f,_0x56886a){return client[_0x6555('0xa')](_0xcc76cc,_0x1c4b95)[_0x6555('0xb')](function(_0xd605bc){logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,'request\x20sent');logger[_0x6555('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x126950,_0x6555('0xf'),JSON[_0x6555('0x10')](_0xd605bc));if(_0xd605bc[_0x6555('0x11')]){if(_0xd605bc['error'][_0x6555('0x12')]===0x1f4){logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc['error']['message']);return _0x56886a(_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);}logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);return _0xc9540f(_0xd605bc['error'][_0x6555('0x13')]);}else{logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,_0x6555('0xf'));_0xc9540f(_0xd605bc['result'][_0x6555('0x13')]);}})['catch'](function(_0x311e18){logger[_0x6555('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x126950,_0x311e18);_0x56886a(_0x311e18);});});} \ No newline at end of file +var _0xf715=['jayson/promise','client','http','request','info','request\x20sent','stringify','error','message','ServicenowConfiguration,\x20%s,\x20%s','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x336e61,_0xc7ccf0){var _0x32c815=function(_0x544cef){while(--_0x544cef){_0x336e61['push'](_0x336e61['shift']());}};_0x32c815(++_0xc7ccf0);}(_0xf715,0x90));var _0x5f71=function(_0x53e1fb,_0x17d039){_0x53e1fb=_0x53e1fb-0x0;var _0x70ced9=_0xf715[_0x53e1fb];return _0x70ced9;};'use strict';var _=require('lodash');var util=require(_0x5f71('0x0'));var moment=require('moment');var BPromise=require(_0x5f71('0x1'));var rs=require(_0x5f71('0x2'));var fs=require('fs');var Redis=require(_0x5f71('0x3'));var db=require(_0x5f71('0x4'))['db'];var utils=require(_0x5f71('0x5'));var logger=require(_0x5f71('0x6'))('rpc');var config=require(_0x5f71('0x7'));var jayson=require(_0x5f71('0x8'));var client=jayson[_0x5f71('0x9')][_0x5f71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4210a7,_0x5e34c0,_0x52cab5){return new BPromise(function(_0x7eec34,_0x2d0515){return client[_0x5f71('0xb')](_0x4210a7,_0x52cab5)['then'](function(_0x5d8110){logger[_0x5f71('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e34c0,_0x5f71('0xd'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5e34c0,'request\x20sent',JSON[_0x5f71('0xe')](_0x5d8110));if(_0x5d8110['error']){if(_0x5d8110['error']['code']===0x1f4){logger[_0x5f71('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e34c0,_0x5d8110[_0x5f71('0xf')][_0x5f71('0x10')]);return _0x2d0515(_0x5d8110['error'][_0x5f71('0x10')]);}logger[_0x5f71('0xf')](_0x5f71('0x11'),_0x5e34c0,_0x5d8110[_0x5f71('0xf')][_0x5f71('0x10')]);return _0x7eec34(_0x5d8110['error'][_0x5f71('0x10')]);}else{logger[_0x5f71('0xc')](_0x5f71('0x11'),_0x5e34c0,'request\x20sent');_0x7eec34(_0x5d8110[_0x5f71('0x12')][_0x5f71('0x10')]);}})['catch'](function(_0x532036){logger[_0x5f71('0xf')](_0x5f71('0x11'),_0x5e34c0,_0x532036);_0x2d0515(_0x532036);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0312c98..bfc2569 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 _0x007c=['show','post','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x2ccc86,_0x5bc5f9){var _0x2cc3d9=function(_0x3df903){while(--_0x3df903){_0x2ccc86['push'](_0x2ccc86['shift']());}};_0x2cc3d9(++_0x5bc5f9);}(_0x007c,0xb1));var _0xc007=function(_0x1e3115,_0x588a94){_0x1e3115=_0x1e3115-0x0;var _0x57dc4c=_0x007c[_0x1e3115];return _0x57dc4c;};'use strict';var multer=require('multer');var util=require(_0xc007('0x0'));var path=require(_0xc007('0x1'));var timeout=require(_0xc007('0x2'));var express=require('express');var router=express[_0xc007('0x3')]();var fs_extra=require(_0xc007('0x4'));var auth=require(_0xc007('0x5'));var interaction=require(_0xc007('0x6'));var config=require(_0xc007('0x7'));var controller=require(_0xc007('0x8'));router[_0xc007('0x9')]('/',auth['isAuthenticated'](),controller[_0xc007('0xa')]);router[_0xc007('0x9')](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0xd')]);router[_0xc007('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc007('0xf')](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0x10')]);router['delete'](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0x11')]);module[_0xc007('0x12')]=router; \ No newline at end of file +var _0x3274=['fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','express'];(function(_0xc8a598,_0x8ffd7c){var _0x2a6225=function(_0x5f2d46){while(--_0x5f2d46){_0xc8a598['push'](_0xc8a598['shift']());}};_0x2a6225(++_0x8ffd7c);}(_0x3274,0x8d));var _0x4327=function(_0x26dd99,_0x5d9029){_0x26dd99=_0x26dd99-0x0;var _0x1f7ae2=_0x3274[_0x26dd99];return _0x1f7ae2;};'use strict';var multer=require(_0x4327('0x0'));var util=require(_0x4327('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4327('0x2'));var router=express['Router']();var fs_extra=require(_0x4327('0x3'));var auth=require(_0x4327('0x4'));var interaction=require(_0x4327('0x5'));var config=require('../../config/environment');var controller=require(_0x4327('0x6'));router[_0x4327('0x7')]('/',auth[_0x4327('0x8')](),controller[_0x4327('0x9')]);router[_0x4327('0x7')](_0x4327('0xa'),auth[_0x4327('0x8')](),controller[_0x4327('0xb')]);router['post']('/',auth[_0x4327('0x8')](),controller['create']);router[_0x4327('0xc')](_0x4327('0xa'),auth['isAuthenticated'](),controller[_0x4327('0xd')]);router[_0x4327('0xe')](_0x4327('0xa'),auth[_0x4327('0x8')](),controller['destroy']);module[_0x4327('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c964f9d..5072c19 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 _0x4939=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x35d1c2,_0x1e9697){var _0x363605=function(_0x12e94a){while(--_0x12e94a){_0x35d1c2['push'](_0x35d1c2['shift']());}};_0x363605(++_0x1e9697);}(_0x4939,0x79));var _0x9493=function(_0x2dd126,_0x1b8fca){_0x2dd126=_0x2dd126-0x0;var _0x24ab18=_0x4939[_0x2dd126];return _0x24ab18;};'use strict';var Sequelize=require(_0x9493('0x0'));module[_0x9493('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9493('0x2'),_0x9493('0x3'),_0x9493('0x4'),_0x9493('0x5'),_0x9493('0x6')),'defaultValue':_0x9493('0x2')},'content':{'type':Sequelize[_0x9493('0x7')]},'key':{'type':Sequelize[_0x9493('0x7')]},'keyType':{'type':Sequelize[_0x9493('0x8')]('string',_0x9493('0x3'),_0x9493('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9493('0x7')]},'customField':{'type':Sequelize[_0x9493('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8a22=['exports','ENUM','string','picklist','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x31eb10,_0x5ac7a4){var _0x153ba8=function(_0x45f3c5){while(--_0x45f3c5){_0x31eb10['push'](_0x31eb10['shift']());}};_0x153ba8(++_0x5ac7a4);}(_0x8a22,0xa1));var _0x28a2=function(_0x2f1a6a,_0x3b004f){_0x2f1a6a=_0x2f1a6a-0x0;var _0x1d3d0e=_0x8a22[_0x2f1a6a];return _0x1d3d0e;};'use strict';var Sequelize=require(_0x28a2('0x0'));module[_0x28a2('0x1')]={'type':{'type':Sequelize[_0x28a2('0x2')](_0x28a2('0x3'),'variable','customVariable','keyValue',_0x28a2('0x4')),'defaultValue':_0x28a2('0x3')},'content':{'type':Sequelize[_0x28a2('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x28a2('0x2')]('string',_0x28a2('0x6'),_0x28a2('0x7'))},'keyContent':{'type':Sequelize[_0x28a2('0x5')]},'idField':{'type':Sequelize[_0x28a2('0x5')]},'nameField':{'type':Sequelize[_0x28a2('0x5')]},'customField':{'type':Sequelize[_0x28a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5d1c72b..a08372f 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 _0xcdaa=['findAll','rows','catch','show','params','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x57d740,_0x50be99){var _0x6607ef=function(_0x908bd0){while(--_0x908bd0){_0x57d740['push'](_0x57d740['shift']());}};_0x6607ef(++_0x50be99);}(_0xcdaa,0x93));var _0xacda=function(_0xb028ea,_0x362e7e){_0xb028ea=_0xb028ea-0x0;var _0x50899a=_0xcdaa[_0xb028ea];return _0x50899a;};'use strict';var emlformat=require(_0xacda('0x0'));var rimraf=require(_0xacda('0x1'));var zipdir=require(_0xacda('0x2'));var jsonpatch=require(_0xacda('0x3'));var rp=require(_0xacda('0x4'));var moment=require(_0xacda('0x5'));var BPromise=require(_0xacda('0x6'));var Mustache=require(_0xacda('0x7'));var util=require('util');var path=require(_0xacda('0x8'));var sox=require('sox');var csv=require(_0xacda('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacda('0xa'));var _=require(_0xacda('0xb'));var squel=require(_0xacda('0xc'));var crypto=require('crypto');var jsforce=require(_0xacda('0xd'));var deskjs=require(_0xacda('0xe'));var toCsv=require(_0xacda('0x9'));var querystring=require(_0xacda('0xf'));var Papa=require(_0xacda('0x10'));var Redis=require(_0xacda('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xacda('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacda('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xacda('0x14'));var licenseUtil=require(_0xacda('0x15'));var db=require(_0xacda('0x16'))['db'];function respondWithStatusCode(_0x493b90,_0x4e456c){_0x4e456c=_0x4e456c||0xcc;return function(_0x35129e){if(_0x35129e){return _0x493b90['sendStatus'](_0x4e456c);}return _0x493b90[_0xacda('0x17')](_0x4e456c)[_0xacda('0x18')]();};}function respondWithResult(_0x16a5ec,_0x67af5b){_0x67af5b=_0x67af5b||0xc8;return function(_0x5eef26){if(_0x5eef26){return _0x16a5ec['status'](_0x67af5b)[_0xacda('0x19')](_0x5eef26);}};}function respondWithFilteredResult(_0x4ddcd8,_0x1f2813){return function(_0x1f6ec0){if(_0x1f6ec0){var _0x1a5dda=typeof _0x1f2813[_0xacda('0x1a')]===_0xacda('0x1b')&&typeof _0x1f2813[_0xacda('0x1c')]===_0xacda('0x1b');var _0x35fe91=_0x1f6ec0[_0xacda('0x1d')];var _0x174907=_0x1a5dda?0x0:_0x1f2813[_0xacda('0x1a')];var _0x19a7b5=_0x1a5dda?_0x1f6ec0[_0xacda('0x1d')]:_0x1f2813[_0xacda('0x1a')]+_0x1f2813[_0xacda('0x1c')];var _0x38e11c;if(_0x19a7b5>=_0x35fe91){_0x19a7b5=_0x35fe91;_0x38e11c=0xc8;}else{_0x38e11c=0xce;}_0x4ddcd8[_0xacda('0x17')](_0x38e11c);return _0x4ddcd8['set']('Content-Range',_0x174907+'-'+_0x19a7b5+'/'+_0x35fe91)[_0xacda('0x19')](_0x1f6ec0);}return null;};}function patchUpdates(_0x22985a){return function(_0x46aaf7){try{jsonpatch['apply'](_0x46aaf7,_0x22985a,!![]);}catch(_0x272d12){return BPromise[_0xacda('0x1e')](_0x272d12);}return _0x46aaf7[_0xacda('0x1f')]();};}function saveUpdates(_0x207af2,_0x3a3205){return function(_0x2a27d1){if(_0x2a27d1){return _0x2a27d1[_0xacda('0x20')](_0x207af2)[_0xacda('0x21')](function(_0x2cc96d){return _0x2cc96d;});}return null;};}function removeEntity(_0x3e5a1b,_0x2f9100){return function(_0x2091d4){if(_0x2091d4){return _0x2091d4[_0xacda('0x22')]()['then'](function(){_0x3e5a1b[_0xacda('0x17')](0xcc)[_0xacda('0x18')]();});}};}function handleEntityNotFound(_0x48028e,_0x5501eb){return function(_0x414886){if(!_0x414886){_0x48028e['sendStatus'](0x194);}return _0x414886;};}function handleError(_0x391b86,_0xde129d){_0xde129d=_0xde129d||0x1f4;return function(_0x321810){logger[_0xacda('0x23')](_0x321810[_0xacda('0x24')]);if(_0x321810[_0xacda('0x25')]){delete _0x321810[_0xacda('0x25')];}_0x391b86['status'](_0xde129d)[_0xacda('0x26')](_0x321810);};}exports[_0xacda('0x27')]=function(_0x3f55c8,_0xefb0c2){var _0x1aeed6={},_0x4c0c41={},_0x133376={'count':0x0,'rows':[]};var _0x593696=_[_0xacda('0x28')](db[_0xacda('0x29')][_0xacda('0x2a')],function(_0x22d088){return{'name':_0x22d088[_0xacda('0x2b')],'type':_0x22d088['type']['key']};});_0x4c0c41[_0xacda('0x2c')]=_[_0xacda('0x28')](_0x593696,'name');_0x4c0c41[_0xacda('0x2d')]=_[_0xacda('0x2e')](_0x3f55c8[_0xacda('0x2d')]);_0x4c0c41[_0xacda('0x2f')]=_[_0xacda('0x30')](_0x4c0c41['model'],_0x4c0c41['query']);_0x1aeed6[_0xacda('0x31')]=_[_0xacda('0x30')](_0x4c0c41[_0xacda('0x2c')],qs[_0xacda('0x32')](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x32')]));_0x1aeed6[_0xacda('0x31')]=_0x1aeed6['attributes'][_0xacda('0x33')]?_0x1aeed6[_0xacda('0x31')]:_0x4c0c41[_0xacda('0x2c')];if(!_0x3f55c8[_0xacda('0x2d')][_0xacda('0x34')]('nolimit')){_0x1aeed6['limit']=qs['limit'](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x1c')]);_0x1aeed6[_0xacda('0x1a')]=qs[_0xacda('0x1a')](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x1a')]);}_0x1aeed6[_0xacda('0x35')]=qs[_0xacda('0x36')](_0x3f55c8['query'][_0xacda('0x36')]);_0x1aeed6[_0xacda('0x37')]=qs[_0xacda('0x2f')](_[_0xacda('0x38')](_0x3f55c8[_0xacda('0x2d')],_0x4c0c41[_0xacda('0x2f')]),_0x593696);if(_0x3f55c8[_0xacda('0x2d')]['filter']){_0x1aeed6[_0xacda('0x37')]=_[_0xacda('0x39')](_0x1aeed6[_0xacda('0x37')],{'$or':_[_0xacda('0x28')](_0x593696,function(_0x37b286){if(_0x37b286[_0xacda('0x3a')]!==_0xacda('0x3b')){var _0xa268bc={};_0xa268bc[_0x37b286[_0xacda('0x25')]]={'$like':'%'+_0x3f55c8[_0xacda('0x2d')]['filter']+'%'};return _0xa268bc;}})});}_0x1aeed6=_['merge']({},_0x1aeed6,_0x3f55c8[_0xacda('0x3c')]);var _0x3d8785={'where':_0x1aeed6[_0xacda('0x37')]};return db[_0xacda('0x29')][_0xacda('0x1d')](_0x3d8785)[_0xacda('0x21')](function(_0x56b873){_0x133376[_0xacda('0x1d')]=_0x56b873;if(_0x3f55c8[_0xacda('0x2d')][_0xacda('0x3d')]){_0x1aeed6[_0xacda('0x3e')]=[{'all':!![]}];}return db['ServicenowField'][_0xacda('0x3f')](_0x1aeed6);})[_0xacda('0x21')](function(_0x539641){_0x133376[_0xacda('0x40')]=_0x539641;return _0x133376;})['then'](respondWithFilteredResult(_0xefb0c2,_0x1aeed6))[_0xacda('0x41')](handleError(_0xefb0c2,null));};exports[_0xacda('0x42')]=function(_0x3ef40d,_0x170f54){var _0x2d2733={'raw':!![],'where':{'id':_0x3ef40d[_0xacda('0x43')]['id']}},_0x5c1da1={};_0x5c1da1[_0xacda('0x2c')]=_[_0xacda('0x2e')](db['ServicenowField']['rawAttributes']);_0x5c1da1[_0xacda('0x2d')]=_['keys'](_0x3ef40d[_0xacda('0x2d')]);_0x5c1da1[_0xacda('0x2f')]=_[_0xacda('0x30')](_0x5c1da1[_0xacda('0x2c')],_0x5c1da1['query']);_0x2d2733[_0xacda('0x31')]=_[_0xacda('0x30')](_0x5c1da1[_0xacda('0x2c')],qs[_0xacda('0x32')](_0x3ef40d[_0xacda('0x2d')][_0xacda('0x32')]));_0x2d2733[_0xacda('0x31')]=_0x2d2733[_0xacda('0x31')][_0xacda('0x33')]?_0x2d2733[_0xacda('0x31')]:_0x5c1da1[_0xacda('0x2c')];if(_0x3ef40d[_0xacda('0x2d')][_0xacda('0x3d')]){_0x2d2733[_0xacda('0x3e')]=[{'all':!![]}];}_0x2d2733=_['merge']({},_0x2d2733,_0x3ef40d[_0xacda('0x3c')]);return db['ServicenowField']['find'](_0x2d2733)[_0xacda('0x21')](handleEntityNotFound(_0x170f54,null))[_0xacda('0x21')](respondWithResult(_0x170f54,null))[_0xacda('0x41')](handleError(_0x170f54,null));};exports['create']=function(_0x27d75b,_0x4d324d){return db[_0xacda('0x29')]['create'](_0x27d75b[_0xacda('0x44')],{})[_0xacda('0x21')](respondWithResult(_0x4d324d,0xc9))[_0xacda('0x41')](handleError(_0x4d324d,null));};exports['update']=function(_0x1d0f9b,_0x5e9989){if(_0x1d0f9b[_0xacda('0x44')]['id']){delete _0x1d0f9b[_0xacda('0x44')]['id'];}return db[_0xacda('0x29')][_0xacda('0x45')]({'where':{'id':_0x1d0f9b[_0xacda('0x43')]['id']}})[_0xacda('0x21')](handleEntityNotFound(_0x5e9989,null))[_0xacda('0x21')](saveUpdates(_0x1d0f9b[_0xacda('0x44')],null))[_0xacda('0x21')](respondWithResult(_0x5e9989,null))[_0xacda('0x41')](handleError(_0x5e9989,null));};exports[_0xacda('0x22')]=function(_0x13e3d2,_0x5e86f8){return db[_0xacda('0x29')][_0xacda('0x45')]({'where':{'id':_0x13e3d2[_0xacda('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e86f8,null))[_0xacda('0x21')](removeEntity(_0x5e86f8,null))[_0xacda('0x41')](handleError(_0x5e86f8,null));}; \ No newline at end of file +var _0xd7ad=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','rows','catch','length','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','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/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys'];(function(_0x28411a,_0x529996){var _0x206ae6=function(_0x65a488){while(--_0x65a488){_0x28411a['push'](_0x28411a['shift']());}};_0x206ae6(++_0x529996);}(_0xd7ad,0xec));var _0xdd7a=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xd7ad[_0x1147ab];return _0x55cb5a;};'use strict';var emlformat=require(_0xdd7a('0x0'));var rimraf=require(_0xdd7a('0x1'));var zipdir=require(_0xdd7a('0x2'));var jsonpatch=require(_0xdd7a('0x3'));var rp=require('request-promise');var moment=require(_0xdd7a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd7a('0x5'));var util=require(_0xdd7a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdd7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd7a('0x8'));var _=require(_0xdd7a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdd7a('0xa'));var deskjs=require(_0xdd7a('0xb'));var toCsv=require(_0xdd7a('0x7'));var querystring=require(_0xdd7a('0xc'));var Papa=require('papaparse');var Redis=require(_0xdd7a('0xd'));var authService=require(_0xdd7a('0xe'));var qs=require(_0xdd7a('0xf'));var as=require(_0xdd7a('0x10'));var hardwareService=require(_0xdd7a('0x11'));var logger=require(_0xdd7a('0x12'))(_0xdd7a('0x13'));var utils=require(_0xdd7a('0x14'));var config=require(_0xdd7a('0x15'));var licenseUtil=require(_0xdd7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ada87,_0x2179a1){_0x2179a1=_0x2179a1||0xcc;return function(_0x270aeb){if(_0x270aeb){return _0x4ada87[_0xdd7a('0x17')](_0x2179a1);}return _0x4ada87['status'](_0x2179a1)['end']();};}function respondWithResult(_0x44062d,_0x1d62f1){_0x1d62f1=_0x1d62f1||0xc8;return function(_0x3263fb){if(_0x3263fb){return _0x44062d[_0xdd7a('0x18')](_0x1d62f1)[_0xdd7a('0x19')](_0x3263fb);}};}function respondWithFilteredResult(_0x478651,_0x2b9c46){return function(_0x2d6ed6){if(_0x2d6ed6){var _0x5028a0=typeof _0x2b9c46[_0xdd7a('0x1a')]==='undefined'&&typeof _0x2b9c46[_0xdd7a('0x1b')]===_0xdd7a('0x1c');var _0x56726f=_0x2d6ed6[_0xdd7a('0x1d')];var _0x2e8a66=_0x5028a0?0x0:_0x2b9c46['offset'];var _0x16691e=_0x5028a0?_0x2d6ed6[_0xdd7a('0x1d')]:_0x2b9c46[_0xdd7a('0x1a')]+_0x2b9c46[_0xdd7a('0x1b')];var _0x42eb1f;if(_0x16691e>=_0x56726f){_0x16691e=_0x56726f;_0x42eb1f=0xc8;}else{_0x42eb1f=0xce;}_0x478651[_0xdd7a('0x18')](_0x42eb1f);return _0x478651[_0xdd7a('0x1e')](_0xdd7a('0x1f'),_0x2e8a66+'-'+_0x16691e+'/'+_0x56726f)[_0xdd7a('0x19')](_0x2d6ed6);}return null;};}function patchUpdates(_0x35f5da){return function(_0x3e1081){try{jsonpatch['apply'](_0x3e1081,_0x35f5da,!![]);}catch(_0x288cac){return BPromise[_0xdd7a('0x20')](_0x288cac);}return _0x3e1081['save']();};}function saveUpdates(_0x4bb743,_0x13af8d){return function(_0x55c407){if(_0x55c407){return _0x55c407[_0xdd7a('0x21')](_0x4bb743)[_0xdd7a('0x22')](function(_0x17bb92){return _0x17bb92;});}return null;};}function removeEntity(_0x185f51,_0x2a5f7d){return function(_0xae98af){if(_0xae98af){return _0xae98af[_0xdd7a('0x23')]()['then'](function(){_0x185f51['status'](0xcc)[_0xdd7a('0x24')]();});}};}function handleEntityNotFound(_0x4d6eac,_0x3546f0){return function(_0x4bbae4){if(!_0x4bbae4){_0x4d6eac['sendStatus'](0x194);}return _0x4bbae4;};}function handleError(_0x58ef7d,_0x5d04c6){_0x5d04c6=_0x5d04c6||0x1f4;return function(_0x4adcd4){logger[_0xdd7a('0x25')](_0x4adcd4['stack']);if(_0x4adcd4[_0xdd7a('0x26')]){delete _0x4adcd4['name'];}_0x58ef7d['status'](_0x5d04c6)[_0xdd7a('0x27')](_0x4adcd4);};}exports[_0xdd7a('0x28')]=function(_0x495d72,_0x1c7e47){var _0x56d7ee={},_0x28b134={},_0x49bb56={'count':0x0,'rows':[]};var _0x2452fa=_[_0xdd7a('0x29')](db[_0xdd7a('0x2a')][_0xdd7a('0x2b')],function(_0x2d17ce){return{'name':_0x2d17ce[_0xdd7a('0x2c')],'type':_0x2d17ce['type']['key']};});_0x28b134[_0xdd7a('0x2d')]=_[_0xdd7a('0x29')](_0x2452fa,_0xdd7a('0x26'));_0x28b134[_0xdd7a('0x2e')]=_[_0xdd7a('0x2f')](_0x495d72[_0xdd7a('0x2e')]);_0x28b134[_0xdd7a('0x30')]=_[_0xdd7a('0x31')](_0x28b134['model'],_0x28b134[_0xdd7a('0x2e')]);_0x56d7ee[_0xdd7a('0x32')]=_[_0xdd7a('0x31')](_0x28b134[_0xdd7a('0x2d')],qs[_0xdd7a('0x33')](_0x495d72[_0xdd7a('0x2e')][_0xdd7a('0x33')]));_0x56d7ee['attributes']=_0x56d7ee['attributes']['length']?_0x56d7ee[_0xdd7a('0x32')]:_0x28b134[_0xdd7a('0x2d')];if(!_0x495d72[_0xdd7a('0x2e')][_0xdd7a('0x34')](_0xdd7a('0x35'))){_0x56d7ee[_0xdd7a('0x1b')]=qs[_0xdd7a('0x1b')](_0x495d72['query'][_0xdd7a('0x1b')]);_0x56d7ee[_0xdd7a('0x1a')]=qs[_0xdd7a('0x1a')](_0x495d72[_0xdd7a('0x2e')]['offset']);}_0x56d7ee[_0xdd7a('0x36')]=qs[_0xdd7a('0x37')](_0x495d72[_0xdd7a('0x2e')][_0xdd7a('0x37')]);_0x56d7ee['where']=qs['filters'](_[_0xdd7a('0x38')](_0x495d72[_0xdd7a('0x2e')],_0x28b134['filters']),_0x2452fa);if(_0x495d72['query'][_0xdd7a('0x39')]){_0x56d7ee[_0xdd7a('0x3a')]=_[_0xdd7a('0x3b')](_0x56d7ee[_0xdd7a('0x3a')],{'$or':_[_0xdd7a('0x29')](_0x2452fa,function(_0x1ecc0f){if(_0x1ecc0f[_0xdd7a('0x3c')]!==_0xdd7a('0x3d')){var _0xe25abf={};_0xe25abf[_0x1ecc0f[_0xdd7a('0x26')]]={'$like':'%'+_0x495d72[_0xdd7a('0x2e')][_0xdd7a('0x39')]+'%'};return _0xe25abf;}})});}_0x56d7ee=_['merge']({},_0x56d7ee,_0x495d72[_0xdd7a('0x3e')]);var _0xa77da6={'where':_0x56d7ee[_0xdd7a('0x3a')]};return db[_0xdd7a('0x2a')][_0xdd7a('0x1d')](_0xa77da6)[_0xdd7a('0x22')](function(_0x247aba){_0x49bb56[_0xdd7a('0x1d')]=_0x247aba;if(_0x495d72[_0xdd7a('0x2e')]['includeAll']){_0x56d7ee['include']=[{'all':!![]}];}return db[_0xdd7a('0x2a')]['findAll'](_0x56d7ee);})['then'](function(_0x40e429){_0x49bb56[_0xdd7a('0x3f')]=_0x40e429;return _0x49bb56;})[_0xdd7a('0x22')](respondWithFilteredResult(_0x1c7e47,_0x56d7ee))[_0xdd7a('0x40')](handleError(_0x1c7e47,null));};exports['show']=function(_0x5aab78,_0x3785ce){var _0x509ff5={'raw':!![],'where':{'id':_0x5aab78['params']['id']}},_0x39b574={};_0x39b574[_0xdd7a('0x2d')]=_[_0xdd7a('0x2f')](db[_0xdd7a('0x2a')][_0xdd7a('0x2b')]);_0x39b574['query']=_[_0xdd7a('0x2f')](_0x5aab78[_0xdd7a('0x2e')]);_0x39b574[_0xdd7a('0x30')]=_['intersection'](_0x39b574[_0xdd7a('0x2d')],_0x39b574['query']);_0x509ff5['attributes']=_[_0xdd7a('0x31')](_0x39b574[_0xdd7a('0x2d')],qs[_0xdd7a('0x33')](_0x5aab78[_0xdd7a('0x2e')][_0xdd7a('0x33')]));_0x509ff5[_0xdd7a('0x32')]=_0x509ff5['attributes'][_0xdd7a('0x41')]?_0x509ff5[_0xdd7a('0x32')]:_0x39b574['model'];if(_0x5aab78[_0xdd7a('0x2e')]['includeAll']){_0x509ff5[_0xdd7a('0x42')]=[{'all':!![]}];}_0x509ff5=_[_0xdd7a('0x3b')]({},_0x509ff5,_0x5aab78['options']);return db[_0xdd7a('0x2a')][_0xdd7a('0x43')](_0x509ff5)[_0xdd7a('0x22')](handleEntityNotFound(_0x3785ce,null))[_0xdd7a('0x22')](respondWithResult(_0x3785ce,null))[_0xdd7a('0x40')](handleError(_0x3785ce,null));};exports[_0xdd7a('0x44')]=function(_0x2ae96c,_0x542d68){return db['ServicenowField'][_0xdd7a('0x44')](_0x2ae96c[_0xdd7a('0x45')],{})['then'](respondWithResult(_0x542d68,0xc9))[_0xdd7a('0x40')](handleError(_0x542d68,null));};exports[_0xdd7a('0x21')]=function(_0x3b7353,_0x1c6d76){if(_0x3b7353['body']['id']){delete _0x3b7353[_0xdd7a('0x45')]['id'];}return db[_0xdd7a('0x2a')][_0xdd7a('0x43')]({'where':{'id':_0x3b7353[_0xdd7a('0x46')]['id']}})[_0xdd7a('0x22')](handleEntityNotFound(_0x1c6d76,null))['then'](saveUpdates(_0x3b7353[_0xdd7a('0x45')],null))[_0xdd7a('0x22')](respondWithResult(_0x1c6d76,null))['catch'](handleError(_0x1c6d76,null));};exports['destroy']=function(_0x3e79d4,_0x3892e8){return db[_0xdd7a('0x2a')][_0xdd7a('0x43')]({'where':{'id':_0x3e79d4[_0xdd7a('0x46')]['id']}})[_0xdd7a('0x22')](handleEntityNotFound(_0x3892e8,null))[_0xdd7a('0x22')](removeEntity(_0x3892e8,null))['catch'](handleError(_0x3892e8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ff475f6..a2af622 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 _0xc303=['request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api','moment','bluebird'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0xc303,0x1cd));var _0x3c30=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xc303[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var util=require(_0x3c30('0x0'));var logger=require('../../config/logger')(_0x3c30('0x1'));var moment=require(_0x3c30('0x2'));var BPromise=require(_0x3c30('0x3'));var rp=require(_0x3c30('0x4'));var fs=require('fs');var path=require(_0x3c30('0x5'));var rimraf=require(_0x3c30('0x6'));var config=require(_0x3c30('0x7'));var attributes=require('./intServicenowField.attributes');module[_0x3c30('0x8')]=function(_0x5dda58,_0x4f32e2){return _0x5dda58[_0x3c30('0x9')](_0x3c30('0xa'),attributes,{'tableName':_0x3c30('0xb'),'paranoid':![],'indexes':[{'name':_0x3c30('0xc'),'fields':[_0x3c30('0xd'),_0x3c30('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7530=['moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','../../config/logger','api'];(function(_0xe2a1aa,_0x525d7b){var _0x5a8362=function(_0x39aece){while(--_0x39aece){_0xe2a1aa['push'](_0xe2a1aa['shift']());}};_0x5a8362(++_0x525d7b);}(_0x7530,0x11a));var _0x0753=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7530[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x0753('0x0'));var util=require('util');var logger=require(_0x0753('0x1'))(_0x0753('0x2'));var moment=require(_0x0753('0x3'));var BPromise=require('bluebird');var rp=require(_0x0753('0x4'));var fs=require('fs');var path=require(_0x0753('0x5'));var rimraf=require(_0x0753('0x6'));var config=require(_0x0753('0x7'));var attributes=require(_0x0753('0x8'));module[_0x0753('0x9')]=function(_0x4f7473,_0x54f895){return _0x4f7473[_0x0753('0xa')](_0x0753('0xb'),attributes,{'tableName':_0x0753('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0753('0xd'),_0x0753('0xe')],'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 ef4b24c..e473e3f 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xac4a,0x13f));var _0xaac4=function(_0x14d107,_0x3b15a8){_0x14d107=_0x14d107-0x0;var _0x512f0e=_0xac4a[_0x14d107];return _0x512f0e;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x33af63,_0x261c83){var _0x32bb59=function(_0x422ba4){while(--_0x422ba4){_0x33af63['push'](_0x33af63['shift']());}};_0x32bb59(++_0x261c83);}(_0xe706,0xa3));var _0x6e70=function(_0x56d591,_0x3191a3){_0x56d591=_0x56d591-0x0;var _0x4bf0ff=_0xe706[_0x56d591];return _0x4bf0ff;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 00dd1e9..70670e3 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 _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(_0x3b55c4,_0x2ceb45){var _0x2b9c51=function(_0x670a96){while(--_0x670a96){_0x3b55c4['push'](_0x3b55c4['shift']());}};_0x2b9c51(++_0x2ceb45);}(_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('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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3b9e90,_0x5f017f){var _0x93cf2b=function(_0x1b45e9){while(--_0x1b45e9){_0x3b9e90['push'](_0x3b9e90['shift']());}};_0x93cf2b(++_0x5f017f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 6d7217e..d848e8a 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(_0x4f041a,_0xf43df9){var _0x521405=function(_0x30216f){while(--_0x30216f){_0x4f041a['push'](_0x4f041a['shift']());}};_0x521405(++_0xf43df9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x204bf3,_0x74c9f2){var _0x4fa38d=function(_0x5f0334){while(--_0x5f0334){_0x204bf3['push'](_0x204bf3['shift']());}};_0x4fa38d(++_0x74c9f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 c0bb244..2d62555 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 _0xde0f=['query','attributes','length','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','fields','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_name','direction','username','remoteUri','substring','POST','%s%s','login','JSON','stringify','password','PLAIN','Invalid\x20Login','format','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','test','eml-format','fast-json-patch','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','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','index','SugarcrmAccount','rawAttributes','fieldName','type','model','map','filters','intersection'];(function(_0x45f45d,_0x2f2893){var _0x2ea58d=function(_0x36c7d2){while(--_0x36c7d2){_0x45f45d['push'](_0x45f45d['shift']());}};_0x2ea58d(++_0x2f2893);}(_0xde0f,0x1ab));var _0xfde0=function(_0xae277d,_0xc1a1f4){_0xae277d=_0xae277d-0x0;var _0x39381b=_0xde0f[_0xae277d];return _0x39381b;};'use strict';var emlformat=require(_0xfde0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfde0('0x1'));var rp=require('request-promise');var moment=require(_0xfde0('0x2'));var BPromise=require(_0xfde0('0x3'));var Mustache=require(_0xfde0('0x4'));var util=require('util');var path=require(_0xfde0('0x5'));var sox=require(_0xfde0('0x6'));var csv=require(_0xfde0('0x7'));var ejs=require(_0xfde0('0x8'));var fs=require('fs');var fs_extra=require(_0xfde0('0x9'));var _=require(_0xfde0('0xa'));var squel=require(_0xfde0('0xb'));var crypto=require(_0xfde0('0xc'));var jsforce=require(_0xfde0('0xd'));var deskjs=require(_0xfde0('0xe'));var toCsv=require(_0xfde0('0x7'));var querystring=require(_0xfde0('0xf'));var Papa=require(_0xfde0('0x10'));var Redis=require(_0xfde0('0x11'));var authService=require(_0xfde0('0x12'));var qs=require(_0xfde0('0x13'));var as=require(_0xfde0('0x14'));var hardwareService=require(_0xfde0('0x15'));var logger=require(_0xfde0('0x16'))('api');var utils=require(_0xfde0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfde0('0x18'));var db=require(_0xfde0('0x19'))['db'];var integrations=require(_0xfde0('0x1a'));function respondWithStatusCode(_0x35237e,_0x28b312){_0x28b312=_0x28b312||0xcc;return function(_0x1e0c8e){if(_0x1e0c8e){return _0x35237e[_0xfde0('0x1b')](_0x28b312);}return _0x35237e['status'](_0x28b312)[_0xfde0('0x1c')]();};}function respondWithResult(_0x1a5ab9,_0x23e16c){_0x23e16c=_0x23e16c||0xc8;return function(_0x149be6){if(_0x149be6){return _0x1a5ab9['status'](_0x23e16c)[_0xfde0('0x1d')](_0x149be6);}};}function respondWithFilteredResult(_0x45661f,_0x2396fb){return function(_0x1f2619){if(_0x1f2619){var _0x2ea1f2=typeof _0x2396fb[_0xfde0('0x1e')]===_0xfde0('0x1f')&&typeof _0x2396fb[_0xfde0('0x20')]===_0xfde0('0x1f');var _0x14cc3c=_0x1f2619[_0xfde0('0x21')];var _0x6509ad=_0x2ea1f2?0x0:_0x2396fb[_0xfde0('0x1e')];var _0x57ada6=_0x2ea1f2?_0x1f2619[_0xfde0('0x21')]:_0x2396fb[_0xfde0('0x1e')]+_0x2396fb[_0xfde0('0x20')];var _0x4edac8;if(_0x57ada6>=_0x14cc3c){_0x57ada6=_0x14cc3c;_0x4edac8=0xc8;}else{_0x4edac8=0xce;}_0x45661f[_0xfde0('0x22')](_0x4edac8);return _0x45661f[_0xfde0('0x23')]('Content-Range',_0x6509ad+'-'+_0x57ada6+'/'+_0x14cc3c)[_0xfde0('0x1d')](_0x1f2619);}return null;};}function patchUpdates(_0x37b307){return function(_0x2200cc){try{jsonpatch[_0xfde0('0x24')](_0x2200cc,_0x37b307,!![]);}catch(_0x10b8d9){return BPromise[_0xfde0('0x25')](_0x10b8d9);}return _0x2200cc[_0xfde0('0x26')]();};}function saveUpdates(_0x4ccf42,_0x45e629){return function(_0x109dff){if(_0x109dff){return _0x109dff[_0xfde0('0x27')](_0x4ccf42)[_0xfde0('0x28')](function(_0x3b1dd7){return _0x3b1dd7;});}return null;};}function removeEntity(_0x19e5a0,_0x481d40){return function(_0x1da73f){if(_0x1da73f){return _0x1da73f[_0xfde0('0x29')]()[_0xfde0('0x28')](function(){_0x19e5a0[_0xfde0('0x22')](0xcc)[_0xfde0('0x1c')]();});}};}function handleEntityNotFound(_0x35fa36,_0x6906f2){return function(_0x303c23){if(!_0x303c23){_0x35fa36[_0xfde0('0x1b')](0x194);}return _0x303c23;};}function handleError(_0x40fdf5,_0x5ed9d8){_0x5ed9d8=_0x5ed9d8||0x1f4;return function(_0x2f5710){logger['error'](_0x2f5710[_0xfde0('0x2a')]);if(_0x2f5710[_0xfde0('0x2b')]){delete _0x2f5710[_0xfde0('0x2b')];}_0x40fdf5[_0xfde0('0x22')](_0x5ed9d8)['send'](_0x2f5710);};}exports[_0xfde0('0x2c')]=function(_0x2d4d1f,_0x911d11){var _0x3f683d={},_0x44f338={},_0x383a84={'count':0x0,'rows':[]};var _0x285933=_['map'](db[_0xfde0('0x2d')][_0xfde0('0x2e')],function(_0x219c11){return{'name':_0x219c11[_0xfde0('0x2f')],'type':_0x219c11[_0xfde0('0x30')]['key']};});_0x44f338[_0xfde0('0x31')]=_[_0xfde0('0x32')](_0x285933,_0xfde0('0x2b'));_0x44f338['query']=_['keys'](_0x2d4d1f['query']);_0x44f338[_0xfde0('0x33')]=_[_0xfde0('0x34')](_0x44f338['model'],_0x44f338[_0xfde0('0x35')]);_0x3f683d[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x44f338[_0xfde0('0x31')],qs['fields'](_0x2d4d1f[_0xfde0('0x35')]['fields']));_0x3f683d['attributes']=_0x3f683d[_0xfde0('0x36')][_0xfde0('0x37')]?_0x3f683d[_0xfde0('0x36')]:_0x44f338[_0xfde0('0x31')];if(!_0x2d4d1f['query']['hasOwnProperty']('nolimit')){_0x3f683d[_0xfde0('0x20')]=qs[_0xfde0('0x20')](_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x20')]);_0x3f683d[_0xfde0('0x1e')]=qs[_0xfde0('0x1e')](_0x2d4d1f[_0xfde0('0x35')]['offset']);}_0x3f683d['order']=qs['sort'](_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x38')]);_0x3f683d['where']=qs[_0xfde0('0x33')](_[_0xfde0('0x39')](_0x2d4d1f['query'],_0x44f338[_0xfde0('0x33')]),_0x285933);if(_0x2d4d1f[_0xfde0('0x35')]['filter']){_0x3f683d[_0xfde0('0x3a')]=_[_0xfde0('0x3b')](_0x3f683d['where'],{'$or':_[_0xfde0('0x32')](_0x285933,function(_0x4f0916){if(_0x4f0916[_0xfde0('0x30')]!==_0xfde0('0x3c')){var _0x2e09ac={};_0x2e09ac[_0x4f0916[_0xfde0('0x2b')]]={'$like':'%'+_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x3d')]+'%'};return _0x2e09ac;}})});}_0x3f683d=_[_0xfde0('0x3b')]({},_0x3f683d,_0x2d4d1f[_0xfde0('0x3e')]);var _0x5b35ee={'where':_0x3f683d[_0xfde0('0x3a')]};return db[_0xfde0('0x2d')]['count'](_0x5b35ee)[_0xfde0('0x28')](function(_0x32bf92){_0x383a84[_0xfde0('0x21')]=_0x32bf92;if(_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x3f')]){_0x3f683d[_0xfde0('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x3f683d);})[_0xfde0('0x28')](function(_0x568b63){_0x383a84['rows']=_0x568b63;return _0x383a84;})[_0xfde0('0x28')](respondWithFilteredResult(_0x911d11,_0x3f683d))[_0xfde0('0x41')](handleError(_0x911d11,null));};exports[_0xfde0('0x42')]=function(_0x2f0afe,_0x2804ef){var _0x3e6178={'raw':![],'where':{'id':_0x2f0afe[_0xfde0('0x43')]['id']}},_0x2ce365={};_0x2ce365[_0xfde0('0x31')]=_[_0xfde0('0x44')](db['SugarcrmAccount']['rawAttributes']);_0x2ce365[_0xfde0('0x35')]=_[_0xfde0('0x44')](_0x2f0afe[_0xfde0('0x35')]);_0x2ce365[_0xfde0('0x33')]=_[_0xfde0('0x34')](_0x2ce365[_0xfde0('0x31')],_0x2ce365['query']);_0x3e6178[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x2ce365[_0xfde0('0x31')],qs[_0xfde0('0x45')](_0x2f0afe[_0xfde0('0x35')][_0xfde0('0x45')]));_0x3e6178[_0xfde0('0x36')]=_0x3e6178[_0xfde0('0x36')][_0xfde0('0x37')]?_0x3e6178['attributes']:_0x2ce365['model'];if(_0x2f0afe['query']['includeAll']){_0x3e6178['include']=[{'all':!![]}];}_0x3e6178=_[_0xfde0('0x3b')]({},_0x3e6178,_0x2f0afe[_0xfde0('0x3e')]);return db['SugarcrmAccount']['find'](_0x3e6178)[_0xfde0('0x28')](handleEntityNotFound(_0x2804ef,null))[_0xfde0('0x28')](respondWithResult(_0x2804ef,null))[_0xfde0('0x41')](handleError(_0x2804ef,null));};exports[_0xfde0('0x46')]=function(_0x1652a7,_0x5c9fe0){return db[_0xfde0('0x2d')]['create'](_0x1652a7[_0xfde0('0x47')],{})[_0xfde0('0x28')](respondWithResult(_0x5c9fe0,0xc9))[_0xfde0('0x41')](handleError(_0x5c9fe0,null));};exports[_0xfde0('0x27')]=function(_0x3c3168,_0x3f7a31){if(_0x3c3168[_0xfde0('0x47')]['id']){delete _0x3c3168[_0xfde0('0x47')]['id'];}return db[_0xfde0('0x2d')][_0xfde0('0x48')]({'where':{'id':_0x3c3168[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x3f7a31,null))[_0xfde0('0x28')](saveUpdates(_0x3c3168[_0xfde0('0x47')],null))[_0xfde0('0x28')](respondWithResult(_0x3f7a31,null))[_0xfde0('0x41')](handleError(_0x3f7a31,null));};exports[_0xfde0('0x29')]=function(_0x34329a,_0x3edd9b){return db[_0xfde0('0x2d')][_0xfde0('0x48')]({'where':{'id':_0x34329a[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x3edd9b,null))[_0xfde0('0x28')](removeEntity(_0x3edd9b,null))[_0xfde0('0x41')](handleError(_0x3edd9b,null));};exports[_0xfde0('0x49')]=function(_0x4d4535,_0x20c6c2,_0x3aecae){var _0x4ecf49={};var _0x41c395={};var _0x63c6bc;var _0x497509;return db[_0xfde0('0x2d')][_0xfde0('0x4a')]({'where':{'id':_0x4d4535[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x20c6c2,null))[_0xfde0('0x28')](function(_0x170bb7){if(_0x170bb7){_0x63c6bc=_0x170bb7;_0x41c395[_0xfde0('0x31')]=_[_0xfde0('0x44')](db[_0xfde0('0x4b')][_0xfde0('0x2e')]);_0x41c395[_0xfde0('0x35')]=_[_0xfde0('0x44')](_0x4d4535[_0xfde0('0x35')]);_0x41c395['filters']=_[_0xfde0('0x34')](_0x41c395[_0xfde0('0x31')],_0x41c395[_0xfde0('0x35')]);_0x4ecf49[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x41c395['model'],qs['fields'](_0x4d4535[_0xfde0('0x35')][_0xfde0('0x45')]));_0x4ecf49['attributes']=_0x4ecf49[_0xfde0('0x36')][_0xfde0('0x37')]?_0x4ecf49[_0xfde0('0x36')]:_0x41c395[_0xfde0('0x31')];_0x4ecf49[_0xfde0('0x4c')]=qs[_0xfde0('0x38')](_0x4d4535[_0xfde0('0x35')][_0xfde0('0x38')]);_0x4ecf49[_0xfde0('0x3a')]=qs[_0xfde0('0x33')](_['pick'](_0x4d4535[_0xfde0('0x35')],_0x41c395['filters']));if(_0x4d4535['query'][_0xfde0('0x3d')]){_0x4ecf49[_0xfde0('0x3a')]=_['merge'](_0x4ecf49[_0xfde0('0x3a')],{'$or':_[_0xfde0('0x32')](_0x4ecf49[_0xfde0('0x36')],function(_0x1c2543){var _0x53a080={};_0x53a080[_0x1c2543]={'$like':'%'+_0x4d4535[_0xfde0('0x35')][_0xfde0('0x3d')]+'%'};return _0x53a080;})});}_0x4ecf49=_['merge']({},_0x4ecf49,_0x4d4535[_0xfde0('0x3e')]);return _0x63c6bc[_0xfde0('0x49')](_0x4ecf49);}})[_0xfde0('0x28')](function(_0x144ef6){if(_0x144ef6){_0x497509=_0x144ef6[_0xfde0('0x37')];if(!_0x4d4535[_0xfde0('0x35')][_0xfde0('0x4d')](_0xfde0('0x4e'))){_0x4ecf49['limit']=qs['limit'](_0x4d4535[_0xfde0('0x35')]['limit']);_0x4ecf49[_0xfde0('0x1e')]=qs['offset'](_0x4d4535[_0xfde0('0x35')]['offset']);}return _0x63c6bc[_0xfde0('0x49')](_0x4ecf49);}})[_0xfde0('0x28')](function(_0x43c65c){if(_0x43c65c){return _0x43c65c?{'count':_0x497509,'rows':_0x43c65c}:null;}})['then'](respondWithResult(_0x20c6c2,null))[_0xfde0('0x41')](handleError(_0x20c6c2,null));};exports['addConfiguration']=function(_0x40a968,_0x1400f5,_0x3ec93d){if(_0x40a968[_0xfde0('0x47')]['id']){delete _0x40a968[_0xfde0('0x47')]['id'];}return db[_0xfde0('0x2d')][_0xfde0('0x4a')]({'where':{'id':_0x40a968[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x1400f5,null))[_0xfde0('0x28')](function(_0x45d60e){if(_0x45d60e){_0x40a968['body'][_0xfde0('0x4f')]=_0x45d60e['id'];_0x40a968[_0xfde0('0x47')]['Subjects']=integrations[_0xfde0('0x50')](_0x40a968[_0xfde0('0x47')][_0xfde0('0x51')],_0x40a968[_0xfde0('0x47')][_0xfde0('0x30')]);_0x40a968[_0xfde0('0x47')][_0xfde0('0x52')]=integrations[_0xfde0('0x53')](_0x40a968[_0xfde0('0x47')][_0xfde0('0x51')],_0x40a968[_0xfde0('0x47')]['type']);return db['SugarcrmConfiguration'][_0xfde0('0x46')](_0x40a968['body'],{'include':[{'model':db[_0xfde0('0x54')],'as':_0xfde0('0x55')},{'model':db[_0xfde0('0x54')],'as':_0xfde0('0x52')}]});}return null;})['then'](respondWithResult(_0x1400f5,null))[_0xfde0('0x41')](handleError(_0x1400f5,null));};exports[_0xfde0('0x56')]=function(_0x44f155,_0x3c9d28,_0x50b126){var _0x597d13='';var _0x3d75e8=['id',_0xfde0('0x2b'),_0xfde0('0x57'),_0xfde0('0x58'),_0xfde0('0x59'),_0xfde0('0x5a'),'duration_hours','duration_minutes',_0xfde0('0x5b'),'parent_type',_0xfde0('0x5c'),_0xfde0('0x5d')];return db[_0xfde0('0x2d')]['findOne']({'where':{'id':_0x44f155[_0xfde0('0x43')]['id']},'attributes':['id',_0xfde0('0x5e'),'password','remoteUri']})[_0xfde0('0x28')](handleEntityNotFound(_0x3c9d28,null))[_0xfde0('0x28')](function(_0x449397){if(_0x449397){_0x597d13=_0x449397[_0xfde0('0x5f')];var _0x3ec99b=_0x597d13['slice'](-0x1);if(_0x3ec99b==='/'){_0x597d13=_0x597d13[_0xfde0('0x60')](0x0,_0x597d13['lastIndexOf'](_0x3ec99b));}return rp({'method':_0xfde0('0x61'),'uri':util['format'](_0xfde0('0x62'),_0x597d13,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfde0('0x63'),'input_type':_0xfde0('0x64'),'response_type':_0xfde0('0x64'),'rest_data':JSON[_0xfde0('0x65')]({'user_auth':{'user_name':_0x449397[_0xfde0('0x5e')],'password':_0x449397[_0xfde0('0x66')],'encryption':_0xfde0('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x15c343){if(_0x15c343&&_0x15c343[_0xfde0('0x2b')]!==_0xfde0('0x68')&&_0x15c343[_0xfde0('0x2b')]!=='Password\x20Expired'){return rp({'method':_0xfde0('0x61'),'uri':util[_0xfde0('0x69')](_0xfde0('0x62'),_0x597d13,_0xfde0('0x6a')),'json':!![],'form':{'method':_0xfde0('0x6b'),'input_type':_0xfde0('0x64'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x15c343['id'],'module_name':'Calls'})}})[_0xfde0('0x28')](function(_0x2cbf7b){if(_0x2cbf7b){var _0x2a0e57=_[_0xfde0('0x6c')](_0x2cbf7b[_0xfde0('0x6d')]);_[_0xfde0('0x6e')](_0x2a0e57,function(_0x15260e){return _0x3d75e8[_0xfde0('0x6f')](_0x15260e[_0xfde0('0x2b')]);});return{'count':_0x2a0e57['length'],'rows':_[_0xfde0('0x32')](_0x2a0e57,function(_0x30f0d3){return{'id':_0x30f0d3[_0xfde0('0x2b')],'name':_0x30f0d3[_0xfde0('0x70')],'custom':_[_0xfde0('0x71')](_0x30f0d3[_0xfde0('0x2b')],'_c')?!![]:![],'options':_0x30f0d3[_0xfde0('0x3e')]?_[_0xfde0('0x32')](_[_0xfde0('0x6c')](_0x30f0d3[_0xfde0('0x3e')]),function(_0x3c239e){return{'name':_0x3c239e[_0xfde0('0x72')],'value':_0x3c239e[_0xfde0('0x2b')]};}):[]};})};}})[_0xfde0('0x28')](respondWithResult(_0x3c9d28,null))['catch'](function(_0x5a704f){var _0x1163b6=_0x44f155['query']['test']?0x1f4:_0x5a704f[_0xfde0('0x73')]||0x1f4;logger[_0xfde0('0x74')](_0xfde0('0x75'),_0xfde0('0x56'),_0x1163b6,JSON[_0xfde0('0x65')](_0x5a704f));delete _0x5a704f[_0xfde0('0x2b')];if(_0x1163b6===0x191){_0x1163b6=0x190;}_0x3c9d28['status'](_0x1163b6)[_0xfde0('0x76')](_0x44f155['query'][_0xfde0('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x5a704f[_0xfde0('0x73')]}:_0x5a704f);});}else{var _0x48e42a=0x1f4;_0x3c9d28[_0xfde0('0x22')](_0x48e42a)[_0xfde0('0x76')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x6ec1=['test','Wrong\x20credentials','eml-format','rimraf','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','catch','show','options','find','create','body','update','params','findOne','length','sort','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','channel','SugarcrmConfiguration','SugarcrmField','Subjects','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','get_module_fields','Calls','values','module_fields','remove','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x6ec1,0x1ea));var _0x16ec=function(_0x1bc40c,_0x58bcb7){_0x1bc40c=_0x1bc40c-0x0;var _0x27a451=_0x6ec1[_0x1bc40c];return _0x27a451;};'use strict';var emlformat=require(_0x16ec('0x0'));var rimraf=require(_0x16ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16ec('0x2'));var rp=require(_0x16ec('0x3'));var moment=require(_0x16ec('0x4'));var BPromise=require(_0x16ec('0x5'));var Mustache=require(_0x16ec('0x6'));var util=require(_0x16ec('0x7'));var path=require(_0x16ec('0x8'));var sox=require(_0x16ec('0x9'));var csv=require('to-csv');var ejs=require(_0x16ec('0xa'));var fs=require('fs');var fs_extra=require(_0x16ec('0xb'));var _=require(_0x16ec('0xc'));var squel=require(_0x16ec('0xd'));var crypto=require(_0x16ec('0xe'));var jsforce=require(_0x16ec('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x16ec('0x10'));var querystring=require(_0x16ec('0x11'));var Papa=require(_0x16ec('0x12'));var Redis=require(_0x16ec('0x13'));var authService=require(_0x16ec('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x16ec('0x15'));var hardwareService=require(_0x16ec('0x16'));var logger=require(_0x16ec('0x17'))(_0x16ec('0x18'));var utils=require(_0x16ec('0x19'));var config=require(_0x16ec('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x16ec('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x38b892,_0x2cc712){_0x2cc712=_0x2cc712||0xcc;return function(_0x4cef1c){if(_0x4cef1c){return _0x38b892[_0x16ec('0x1c')](_0x2cc712);}return _0x38b892['status'](_0x2cc712)[_0x16ec('0x1d')]();};}function respondWithResult(_0x5e669c,_0x331e3d){_0x331e3d=_0x331e3d||0xc8;return function(_0x3b9c0b){if(_0x3b9c0b){return _0x5e669c[_0x16ec('0x1e')](_0x331e3d)[_0x16ec('0x1f')](_0x3b9c0b);}};}function respondWithFilteredResult(_0x5ecc85,_0x12a75d){return function(_0x1e7a3d){if(_0x1e7a3d){var _0x2c831f=typeof _0x12a75d['offset']===_0x16ec('0x20')&&typeof _0x12a75d[_0x16ec('0x21')]==='undefined';var _0x240f15=_0x1e7a3d[_0x16ec('0x22')];var _0x2fcc93=_0x2c831f?0x0:_0x12a75d['offset'];var _0x149dfe=_0x2c831f?_0x1e7a3d[_0x16ec('0x22')]:_0x12a75d[_0x16ec('0x23')]+_0x12a75d[_0x16ec('0x21')];var _0x116392;if(_0x149dfe>=_0x240f15){_0x149dfe=_0x240f15;_0x116392=0xc8;}else{_0x116392=0xce;}_0x5ecc85['status'](_0x116392);return _0x5ecc85['set'](_0x16ec('0x24'),_0x2fcc93+'-'+_0x149dfe+'/'+_0x240f15)[_0x16ec('0x1f')](_0x1e7a3d);}return null;};}function patchUpdates(_0x43b245){return function(_0x435b3e){try{jsonpatch[_0x16ec('0x25')](_0x435b3e,_0x43b245,!![]);}catch(_0x6b8e2){return BPromise['reject'](_0x6b8e2);}return _0x435b3e[_0x16ec('0x26')]();};}function saveUpdates(_0x27e373,_0x1781b2){return function(_0x35b85f){if(_0x35b85f){return _0x35b85f['update'](_0x27e373)[_0x16ec('0x27')](function(_0x3c9241){return _0x3c9241;});}return null;};}function removeEntity(_0x4dd289,_0x16706b){return function(_0x61eec5){if(_0x61eec5){return _0x61eec5[_0x16ec('0x28')]()['then'](function(){_0x4dd289[_0x16ec('0x1e')](0xcc)[_0x16ec('0x1d')]();});}};}function handleEntityNotFound(_0x53f121,_0x5d9c56){return function(_0x2251b1){if(!_0x2251b1){_0x53f121['sendStatus'](0x194);}return _0x2251b1;};}function handleError(_0x124083,_0x498d27){_0x498d27=_0x498d27||0x1f4;return function(_0x1f9506){logger[_0x16ec('0x29')](_0x1f9506['stack']);if(_0x1f9506[_0x16ec('0x2a')]){delete _0x1f9506[_0x16ec('0x2a')];}_0x124083[_0x16ec('0x1e')](_0x498d27)['send'](_0x1f9506);};}exports[_0x16ec('0x2b')]=function(_0x3bc036,_0x63d4cb){var _0x3dce37={},_0x1003d7={},_0x4254ef={'count':0x0,'rows':[]};var _0x2f627f=_[_0x16ec('0x2c')](db[_0x16ec('0x2d')][_0x16ec('0x2e')],function(_0x31b285){return{'name':_0x31b285[_0x16ec('0x2f')],'type':_0x31b285['type'][_0x16ec('0x30')]};});_0x1003d7[_0x16ec('0x31')]=_[_0x16ec('0x2c')](_0x2f627f,_0x16ec('0x2a'));_0x1003d7[_0x16ec('0x32')]=_[_0x16ec('0x33')](_0x3bc036[_0x16ec('0x32')]);_0x1003d7[_0x16ec('0x34')]=_[_0x16ec('0x35')](_0x1003d7[_0x16ec('0x31')],_0x1003d7['query']);_0x3dce37[_0x16ec('0x36')]=_[_0x16ec('0x35')](_0x1003d7['model'],qs[_0x16ec('0x37')](_0x3bc036[_0x16ec('0x32')]['fields']));_0x3dce37[_0x16ec('0x36')]=_0x3dce37[_0x16ec('0x36')]['length']?_0x3dce37[_0x16ec('0x36')]:_0x1003d7[_0x16ec('0x31')];if(!_0x3bc036['query'][_0x16ec('0x38')](_0x16ec('0x39'))){_0x3dce37[_0x16ec('0x21')]=qs[_0x16ec('0x21')](_0x3bc036['query'][_0x16ec('0x21')]);_0x3dce37['offset']=qs[_0x16ec('0x23')](_0x3bc036['query'][_0x16ec('0x23')]);}_0x3dce37[_0x16ec('0x3a')]=qs['sort'](_0x3bc036[_0x16ec('0x32')]['sort']);_0x3dce37['where']=qs['filters'](_[_0x16ec('0x3b')](_0x3bc036[_0x16ec('0x32')],_0x1003d7['filters']),_0x2f627f);if(_0x3bc036[_0x16ec('0x32')][_0x16ec('0x3c')]){_0x3dce37[_0x16ec('0x3d')]=_[_0x16ec('0x3e')](_0x3dce37[_0x16ec('0x3d')],{'$or':_['map'](_0x2f627f,function(_0x247aee){if(_0x247aee[_0x16ec('0x3f')]!==_0x16ec('0x40')){var _0x44d1b7={};_0x44d1b7[_0x247aee[_0x16ec('0x2a')]]={'$like':'%'+_0x3bc036[_0x16ec('0x32')][_0x16ec('0x3c')]+'%'};return _0x44d1b7;}})});}_0x3dce37=_[_0x16ec('0x3e')]({},_0x3dce37,_0x3bc036['options']);var _0x304e87={'where':_0x3dce37[_0x16ec('0x3d')]};return db['SugarcrmAccount'][_0x16ec('0x22')](_0x304e87)[_0x16ec('0x27')](function(_0x940e5c){_0x4254ef[_0x16ec('0x22')]=_0x940e5c;if(_0x3bc036[_0x16ec('0x32')][_0x16ec('0x41')]){_0x3dce37['include']=[{'all':!![]}];}return db[_0x16ec('0x2d')]['findAll'](_0x3dce37);})[_0x16ec('0x27')](function(_0xa86e75){_0x4254ef['rows']=_0xa86e75;return _0x4254ef;})['then'](respondWithFilteredResult(_0x63d4cb,_0x3dce37))[_0x16ec('0x42')](handleError(_0x63d4cb,null));};exports[_0x16ec('0x43')]=function(_0x2cd96b,_0x5424df){var _0x23a52b={'raw':![],'where':{'id':_0x2cd96b['params']['id']}},_0xbeb3a2={};_0xbeb3a2[_0x16ec('0x31')]=_['keys'](db[_0x16ec('0x2d')][_0x16ec('0x2e')]);_0xbeb3a2[_0x16ec('0x32')]=_[_0x16ec('0x33')](_0x2cd96b['query']);_0xbeb3a2[_0x16ec('0x34')]=_[_0x16ec('0x35')](_0xbeb3a2[_0x16ec('0x31')],_0xbeb3a2[_0x16ec('0x32')]);_0x23a52b[_0x16ec('0x36')]=_[_0x16ec('0x35')](_0xbeb3a2[_0x16ec('0x31')],qs[_0x16ec('0x37')](_0x2cd96b['query']['fields']));_0x23a52b[_0x16ec('0x36')]=_0x23a52b[_0x16ec('0x36')]['length']?_0x23a52b[_0x16ec('0x36')]:_0xbeb3a2['model'];if(_0x2cd96b[_0x16ec('0x32')]['includeAll']){_0x23a52b['include']=[{'all':!![]}];}_0x23a52b=_[_0x16ec('0x3e')]({},_0x23a52b,_0x2cd96b[_0x16ec('0x44')]);return db['SugarcrmAccount'][_0x16ec('0x45')](_0x23a52b)[_0x16ec('0x27')](handleEntityNotFound(_0x5424df,null))[_0x16ec('0x27')](respondWithResult(_0x5424df,null))[_0x16ec('0x42')](handleError(_0x5424df,null));};exports[_0x16ec('0x46')]=function(_0x30ded9,_0x5e4f07){return db[_0x16ec('0x2d')][_0x16ec('0x46')](_0x30ded9[_0x16ec('0x47')],{})['then'](respondWithResult(_0x5e4f07,0xc9))[_0x16ec('0x42')](handleError(_0x5e4f07,null));};exports[_0x16ec('0x48')]=function(_0x5e8d74,_0xce9afc){if(_0x5e8d74[_0x16ec('0x47')]['id']){delete _0x5e8d74[_0x16ec('0x47')]['id'];}return db[_0x16ec('0x2d')][_0x16ec('0x45')]({'where':{'id':_0x5e8d74[_0x16ec('0x49')]['id']}})[_0x16ec('0x27')](handleEntityNotFound(_0xce9afc,null))[_0x16ec('0x27')](saveUpdates(_0x5e8d74[_0x16ec('0x47')],null))[_0x16ec('0x27')](respondWithResult(_0xce9afc,null))[_0x16ec('0x42')](handleError(_0xce9afc,null));};exports['destroy']=function(_0x16850d,_0x576fc2){return db[_0x16ec('0x2d')][_0x16ec('0x45')]({'where':{'id':_0x16850d[_0x16ec('0x49')]['id']}})[_0x16ec('0x27')](handleEntityNotFound(_0x576fc2,null))[_0x16ec('0x27')](removeEntity(_0x576fc2,null))['catch'](handleError(_0x576fc2,null));};exports['getConfigurations']=function(_0x35ca56,_0xedb37,_0x372d6e){var _0x1fb70a={};var _0x2f2446={};var _0x19cb9f;var _0x3d1e6f;return db[_0x16ec('0x2d')][_0x16ec('0x4a')]({'where':{'id':_0x35ca56[_0x16ec('0x49')]['id']}})['then'](handleEntityNotFound(_0xedb37,null))['then'](function(_0x2e8ec5){if(_0x2e8ec5){_0x19cb9f=_0x2e8ec5;_0x2f2446[_0x16ec('0x31')]=_[_0x16ec('0x33')](db['SugarcrmConfiguration'][_0x16ec('0x2e')]);_0x2f2446[_0x16ec('0x32')]=_[_0x16ec('0x33')](_0x35ca56[_0x16ec('0x32')]);_0x2f2446[_0x16ec('0x34')]=_[_0x16ec('0x35')](_0x2f2446[_0x16ec('0x31')],_0x2f2446['query']);_0x1fb70a['attributes']=_['intersection'](_0x2f2446['model'],qs[_0x16ec('0x37')](_0x35ca56[_0x16ec('0x32')][_0x16ec('0x37')]));_0x1fb70a[_0x16ec('0x36')]=_0x1fb70a[_0x16ec('0x36')][_0x16ec('0x4b')]?_0x1fb70a[_0x16ec('0x36')]:_0x2f2446[_0x16ec('0x31')];_0x1fb70a[_0x16ec('0x3a')]=qs[_0x16ec('0x4c')](_0x35ca56[_0x16ec('0x32')][_0x16ec('0x4c')]);_0x1fb70a[_0x16ec('0x3d')]=qs[_0x16ec('0x34')](_[_0x16ec('0x3b')](_0x35ca56[_0x16ec('0x32')],_0x2f2446['filters']));if(_0x35ca56[_0x16ec('0x32')][_0x16ec('0x3c')]){_0x1fb70a[_0x16ec('0x3d')]=_['merge'](_0x1fb70a[_0x16ec('0x3d')],{'$or':_[_0x16ec('0x2c')](_0x1fb70a[_0x16ec('0x36')],function(_0x85b3c1){var _0x984e9b={};_0x984e9b[_0x85b3c1]={'$like':'%'+_0x35ca56['query'][_0x16ec('0x3c')]+'%'};return _0x984e9b;})});}_0x1fb70a=_['merge']({},_0x1fb70a,_0x35ca56[_0x16ec('0x44')]);return _0x19cb9f[_0x16ec('0x4d')](_0x1fb70a);}})[_0x16ec('0x27')](function(_0x47e36c){if(_0x47e36c){_0x3d1e6f=_0x47e36c[_0x16ec('0x4b')];if(!_0x35ca56[_0x16ec('0x32')][_0x16ec('0x38')]('nolimit')){_0x1fb70a[_0x16ec('0x21')]=qs[_0x16ec('0x21')](_0x35ca56[_0x16ec('0x32')][_0x16ec('0x21')]);_0x1fb70a[_0x16ec('0x23')]=qs['offset'](_0x35ca56['query'][_0x16ec('0x23')]);}return _0x19cb9f[_0x16ec('0x4d')](_0x1fb70a);}})[_0x16ec('0x27')](function(_0x47b459){if(_0x47b459){return _0x47b459?{'count':_0x3d1e6f,'rows':_0x47b459}:null;}})[_0x16ec('0x27')](respondWithResult(_0xedb37,null))[_0x16ec('0x42')](handleError(_0xedb37,null));};exports[_0x16ec('0x4e')]=function(_0x37a89d,_0x242fae,_0x3d654e){if(_0x37a89d[_0x16ec('0x47')]['id']){delete _0x37a89d[_0x16ec('0x47')]['id'];}return db[_0x16ec('0x2d')][_0x16ec('0x4a')]({'where':{'id':_0x37a89d[_0x16ec('0x49')]['id']}})[_0x16ec('0x27')](handleEntityNotFound(_0x242fae,null))[_0x16ec('0x27')](function(_0x5df72a){if(_0x5df72a){_0x37a89d[_0x16ec('0x47')][_0x16ec('0x4f')]=_0x5df72a['id'];_0x37a89d[_0x16ec('0x47')]['Subjects']=integrations[_0x16ec('0x50')](_0x37a89d[_0x16ec('0x47')]['channel'],_0x37a89d[_0x16ec('0x47')][_0x16ec('0x3f')]);_0x37a89d[_0x16ec('0x47')][_0x16ec('0x51')]=integrations['getDescriptions'](_0x37a89d[_0x16ec('0x47')][_0x16ec('0x52')],_0x37a89d['body']['type']);return db[_0x16ec('0x53')][_0x16ec('0x46')](_0x37a89d['body'],{'include':[{'model':db[_0x16ec('0x54')],'as':_0x16ec('0x55')},{'model':db[_0x16ec('0x54')],'as':_0x16ec('0x51')}]});}return null;})[_0x16ec('0x27')](respondWithResult(_0x242fae,null))[_0x16ec('0x42')](handleError(_0x242fae,null));};exports['getFields']=function(_0x1bce81,_0x1aa157,_0x2251fc){var _0x5f3ce9='';var _0x43255a=['id','name','assigned_user_id',_0x16ec('0x56'),_0x16ec('0x57'),_0x16ec('0x58'),_0x16ec('0x59'),_0x16ec('0x5a'),_0x16ec('0x5b'),_0x16ec('0x5c'),_0x16ec('0x5d'),_0x16ec('0x5e')];return db['SugarcrmAccount'][_0x16ec('0x4a')]({'where':{'id':_0x1bce81['params']['id']},'attributes':['id',_0x16ec('0x5f'),_0x16ec('0x60'),_0x16ec('0x61')]})[_0x16ec('0x27')](handleEntityNotFound(_0x1aa157,null))['then'](function(_0x1d5299){if(_0x1d5299){_0x5f3ce9=_0x1d5299[_0x16ec('0x61')];var _0xe4a943=_0x5f3ce9[_0x16ec('0x62')](-0x1);if(_0xe4a943==='/'){_0x5f3ce9=_0x5f3ce9[_0x16ec('0x63')](0x0,_0x5f3ce9[_0x16ec('0x64')](_0xe4a943));}return rp({'method':_0x16ec('0x65'),'uri':util['format'](_0x16ec('0x66'),_0x5f3ce9,_0x16ec('0x67')),'json':!![],'form':{'method':'login','input_type':_0x16ec('0x68'),'response_type':_0x16ec('0x68'),'rest_data':JSON[_0x16ec('0x69')]({'user_auth':{'user_name':_0x1d5299[_0x16ec('0x5f')],'password':_0x1d5299['password'],'encryption':_0x16ec('0x6a')},'application':_0x16ec('0x6b')})}});}})['then'](function(_0x3d18fc){if(_0x3d18fc&&_0x3d18fc[_0x16ec('0x2a')]!=='Invalid\x20Login'&&_0x3d18fc[_0x16ec('0x2a')]!==_0x16ec('0x6c')){return rp({'method':_0x16ec('0x65'),'uri':util[_0x16ec('0x6d')](_0x16ec('0x66'),_0x5f3ce9,_0x16ec('0x67')),'json':!![],'form':{'method':_0x16ec('0x6e'),'input_type':_0x16ec('0x68'),'response_type':_0x16ec('0x68'),'rest_data':JSON[_0x16ec('0x69')]({'session':_0x3d18fc['id'],'module_name':_0x16ec('0x6f')})}})[_0x16ec('0x27')](function(_0x14a241){if(_0x14a241){var _0xe7ab4=_[_0x16ec('0x70')](_0x14a241[_0x16ec('0x71')]);_[_0x16ec('0x72')](_0xe7ab4,function(_0x50fc9f){return _0x43255a['includes'](_0x50fc9f[_0x16ec('0x2a')]);});return{'count':_0xe7ab4['length'],'rows':_['map'](_0xe7ab4,function(_0x303cc0){return{'id':_0x303cc0['name'],'name':_0x303cc0[_0x16ec('0x73')],'custom':_['endsWith'](_0x303cc0[_0x16ec('0x2a')],'_c')?!![]:![],'options':_0x303cc0[_0x16ec('0x44')]?_[_0x16ec('0x2c')](_[_0x16ec('0x70')](_0x303cc0[_0x16ec('0x44')]),function(_0x4ad4b0){return{'name':_0x4ad4b0[_0x16ec('0x74')],'value':_0x4ad4b0[_0x16ec('0x2a')]};}):[]};})};}})[_0x16ec('0x27')](respondWithResult(_0x1aa157,null))[_0x16ec('0x42')](function(_0x12901a){var _0x432619=_0x1bce81[_0x16ec('0x32')]['test']?0x1f4:_0x12901a[_0x16ec('0x75')]||0x1f4;logger[_0x16ec('0x29')](_0x16ec('0x76'),_0x16ec('0x77'),_0x432619,JSON['stringify'](_0x12901a));delete _0x12901a[_0x16ec('0x2a')];if(_0x432619===0x191){_0x432619=0x190;}_0x1aa157[_0x16ec('0x1e')](_0x432619)['send'](_0x1bce81[_0x16ec('0x32')][_0x16ec('0x78')]?{'message':_0x16ec('0x79'),'statusCode':_0x12901a[_0x16ec('0x75')]}:_0x12901a);});}else{var _0x49ff6f=0x1f4;_0x1aa157['status'](_0x49ff6f)['send']({'message':_0x16ec('0x79'),'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 9732e16..93e0522 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 _0x9540=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x1e3b12,_0x3438b0){var _0x9fb495=function(_0x5bee10){while(--_0x5bee10){_0x1e3b12['push'](_0x1e3b12['shift']());}};_0x9fb495(++_0x3438b0);}(_0x9540,0xdb));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0954('0x0'));var util=require(_0x0954('0x1'));var logger=require(_0x0954('0x2'))(_0x0954('0x3'));var moment=require('moment');var BPromise=require(_0x0954('0x4'));var rp=require(_0x0954('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0954('0x6'));var config=require(_0x0954('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0954('0x8'));module[_0x0954('0x9')]=function(_0x5be3f7,_0x1970a5){return _0x5be3f7[_0x0954('0xa')](_0x0954('0xb'),attributes,{'tableName':_0x0954('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207a=['util','api','moment','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash'];(function(_0x3cfe01,_0xfe69e6){var _0x5b6853=function(_0x278419){while(--_0x278419){_0x3cfe01['push'](_0x3cfe01['shift']());}};_0x5b6853(++_0xfe69e6);}(_0x207a,0x83));var _0xa207=function(_0xc3299b,_0x174ae2){_0xc3299b=_0xc3299b-0x0;var _0x2bb127=_0x207a[_0xc3299b];return _0x2bb127;};'use strict';var _=require(_0xa207('0x0'));var util=require(_0xa207('0x1'));var logger=require('../../config/logger')(_0xa207('0x2'));var moment=require(_0xa207('0x3'));var BPromise=require('bluebird');var rp=require(_0xa207('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa207('0x5'));var config=require('../../config/environment');var attributes=require(_0xa207('0x6'));var integrations=require(_0xa207('0x7'));module[_0xa207('0x8')]=function(_0x59173e,_0x4c933a){return _0x59173e[_0xa207('0x9')]('SugarcrmAccount',attributes,{'tableName':_0xa207('0xa'),'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 5cc2b11..53d9f5d 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 _0xc32e=['SugarcrmAccount','options','limit','include','map','model','attributes','GetSugarcrmAccount','catch','ShowSugarcrmAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc32e,0x9c));var _0xec32=function(_0x40aac0,_0x158e55){_0x40aac0=_0x40aac0-0x0;var _0x41e568=_0xc32e[_0x40aac0];return _0x41e568;};'use strict';var _=require(_0xec32('0x0'));var util=require(_0xec32('0x1'));var moment=require('moment');var BPromise=require(_0xec32('0x2'));var rs=require(_0xec32('0x3'));var fs=require('fs');var Redis=require(_0xec32('0x4'));var db=require(_0xec32('0x5'))['db'];var utils=require(_0xec32('0x6'));var logger=require(_0xec32('0x7'))('rpc');var config=require(_0xec32('0x8'));var jayson=require(_0xec32('0x9'));var client=jayson[_0xec32('0xa')][_0xec32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32833f,_0x393558,_0x1161a3){return new BPromise(function(_0xc4df3f,_0x3538b5){return client[_0xec32('0xc')](_0x32833f,_0x1161a3)[_0xec32('0xd')](function(_0x47885e){logger[_0xec32('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x393558,_0xec32('0xf'));logger[_0xec32('0x10')](_0xec32('0x11'),_0x393558,_0xec32('0xf'),JSON[_0xec32('0x12')](_0x47885e));if(_0x47885e['error']){if(_0x47885e[_0xec32('0x13')][_0xec32('0x14')]===0x1f4){logger['error'](_0xec32('0x15'),_0x393558,_0x47885e[_0xec32('0x13')]['message']);return _0x3538b5(_0x47885e[_0xec32('0x13')][_0xec32('0x16')]);}logger[_0xec32('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x393558,_0x47885e[_0xec32('0x13')]['message']);return _0xc4df3f(_0x47885e[_0xec32('0x13')][_0xec32('0x16')]);}else{logger[_0xec32('0xe')](_0xec32('0x15'),_0x393558,_0xec32('0xf'));_0xc4df3f(_0x47885e[_0xec32('0x17')][_0xec32('0x16')]);}})['catch'](function(_0xf58b86){logger['error'](_0xec32('0x15'),_0x393558,_0xf58b86);_0x3538b5(_0xf58b86);});});}exports['GetSugarcrmAccount']=function(_0x5190b2){var _0x58e1ad=this;return new Promise(function(_0x16c865,_0x25d123){return db[_0xec32('0x18')]['findAll']({'raw':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['where']||null:null,'attributes':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['attributes']||null:null,'limit':_0x5190b2[_0xec32('0x19')]?_0x5190b2['options'][_0xec32('0x1a')]||null:null,'include':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')][_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x5190b2[_0xec32('0x19')][_0xec32('0x1b')],function(_0x4cc14f){return{'model':db[_0x4cc14f[_0xec32('0x1d')]],'as':_0x4cc14f['as'],'attributes':_0x4cc14f['attributes'],'include':_0x4cc14f[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x4cc14f[_0xec32('0x1b')],function(_0xb22998){return{'model':db[_0xb22998[_0xec32('0x1d')]],'as':_0xb22998['as'],'attributes':_0xb22998[_0xec32('0x1e')],'include':_0xb22998['include']?_['map'](_0xb22998[_0xec32('0x1b')],function(_0x58f443){return{'model':db[_0x58f443[_0xec32('0x1d')]],'as':_0x58f443['as'],'attributes':_0x58f443[_0xec32('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1798dc){logger['info'](_0xec32('0x1f'),_0x5190b2);logger[_0xec32('0x10')](_0xec32('0x1f'),_0x5190b2,JSON[_0xec32('0x12')](_0x1798dc));_0x16c865(_0x1798dc);})[_0xec32('0x20')](function(_0x16ae26){logger['error']('GetSugarcrmAccount',_0x16ae26['message'],_0x5190b2);_0x25d123(_0x58e1ad['error'](0x1f4,_0x16ae26['message']));});});};exports[_0xec32('0x21')]=function(_0x42e137){var _0x23685d=this;return new Promise(function(_0x258cf4,_0x5d9b58){return db[_0xec32('0x18')][_0xec32('0x22')]({'raw':_0x42e137[_0xec32('0x19')]?_0x42e137['options'][_0xec32('0x23')]===undefined?!![]:![]:!![],'where':_0x42e137['options']?_0x42e137['options']['where']||null:null,'attributes':_0x42e137['options']?_0x42e137[_0xec32('0x19')][_0xec32('0x1e')]||null:null,'include':_0x42e137['options']?_0x42e137[_0xec32('0x19')][_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x42e137[_0xec32('0x19')][_0xec32('0x1b')],function(_0x57e911){return{'model':db[_0x57e911['model']],'as':_0x57e911['as'],'attributes':_0x57e911[_0xec32('0x1e')],'include':_0x57e911[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x57e911[_0xec32('0x1b')],function(_0x342816){return{'model':db[_0x342816[_0xec32('0x1d')]],'as':_0x342816['as'],'attributes':_0x342816[_0xec32('0x1e')],'include':_0x342816[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x342816[_0xec32('0x1b')],function(_0x470be4){return{'model':db[_0x470be4[_0xec32('0x1d')]],'as':_0x470be4['as'],'attributes':_0x470be4[_0xec32('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec32('0xd')](function(_0xb44425){logger[_0xec32('0xe')](_0xec32('0x21'),_0x42e137);logger['debug'](_0xec32('0x21'),_0x42e137,JSON[_0xec32('0x12')](_0xb44425));_0x258cf4(_0xb44425);})['catch'](function(_0x530a37){logger[_0xec32('0x13')](_0xec32('0x21'),_0x530a37[_0xec32('0x16')],_0x42e137);_0x5d9b58(_0x23685d[_0xec32('0x13')](0x1f4,_0x530a37[_0xec32('0x16')]));});});}; \ No newline at end of file +var _0xa953=['http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','ShowSugarcrmAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xa953,0x153));var _0x3a95=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xa953[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3a95('0x0'));var util=require(_0x3a95('0x1'));var moment=require(_0x3a95('0x2'));var BPromise=require(_0x3a95('0x3'));var rs=require(_0x3a95('0x4'));var fs=require('fs');var Redis=require(_0x3a95('0x5'));var db=require(_0x3a95('0x6'))['db'];var utils=require(_0x3a95('0x7'));var logger=require(_0x3a95('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a95('0x9'));var client=jayson[_0x3a95('0xa')][_0x3a95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54788b,_0x5b219f,_0x4b1111){return new BPromise(function(_0x202f57,_0x5c5025){return client[_0x3a95('0xc')](_0x54788b,_0x4b1111)[_0x3a95('0xd')](function(_0x59c73e){logger[_0x3a95('0xe')](_0x3a95('0xf'),_0x5b219f,_0x3a95('0x10'));logger[_0x3a95('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5b219f,_0x3a95('0x10'),JSON['stringify'](_0x59c73e));if(_0x59c73e['error']){if(_0x59c73e[_0x3a95('0x12')][_0x3a95('0x13')]===0x1f4){logger[_0x3a95('0x12')](_0x3a95('0xf'),_0x5b219f,_0x59c73e['error'][_0x3a95('0x14')]);return _0x5c5025(_0x59c73e['error'][_0x3a95('0x14')]);}logger['error'](_0x3a95('0xf'),_0x5b219f,_0x59c73e['error'][_0x3a95('0x14')]);return _0x202f57(_0x59c73e[_0x3a95('0x12')][_0x3a95('0x14')]);}else{logger[_0x3a95('0xe')](_0x3a95('0xf'),_0x5b219f,_0x3a95('0x10'));_0x202f57(_0x59c73e['result']['message']);}})[_0x3a95('0x15')](function(_0x42bb6f){logger['error'](_0x3a95('0xf'),_0x5b219f,_0x42bb6f);_0x5c5025(_0x42bb6f);});});}exports[_0x3a95('0x16')]=function(_0x2ba6eb){var _0x4b6a2f=this;return new Promise(function(_0x538453,_0x232d2f){return db[_0x3a95('0x17')][_0x3a95('0x18')]({'raw':_0x2ba6eb[_0x3a95('0x19')]?_0x2ba6eb[_0x3a95('0x19')][_0x3a95('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ba6eb[_0x3a95('0x19')]?_0x2ba6eb[_0x3a95('0x19')][_0x3a95('0x1b')]||null:null,'attributes':_0x2ba6eb[_0x3a95('0x19')]?_0x2ba6eb[_0x3a95('0x19')][_0x3a95('0x1c')]||null:null,'limit':_0x2ba6eb[_0x3a95('0x19')]?_0x2ba6eb['options']['limit']||null:null,'include':_0x2ba6eb[_0x3a95('0x19')]?_0x2ba6eb[_0x3a95('0x19')][_0x3a95('0x1d')]?_[_0x3a95('0x1e')](_0x2ba6eb[_0x3a95('0x19')][_0x3a95('0x1d')],function(_0x1bb250){return{'model':db[_0x1bb250[_0x3a95('0x1f')]],'as':_0x1bb250['as'],'attributes':_0x1bb250[_0x3a95('0x1c')],'include':_0x1bb250[_0x3a95('0x1d')]?_[_0x3a95('0x1e')](_0x1bb250[_0x3a95('0x1d')],function(_0x3aa991){return{'model':db[_0x3aa991['model']],'as':_0x3aa991['as'],'attributes':_0x3aa991[_0x3a95('0x1c')],'include':_0x3aa991['include']?_[_0x3a95('0x1e')](_0x3aa991['include'],function(_0x3c6bcd){return{'model':db[_0x3c6bcd[_0x3a95('0x1f')]],'as':_0x3c6bcd['as'],'attributes':_0x3c6bcd[_0x3a95('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3a95('0xd')](function(_0x37cb7a){logger[_0x3a95('0xe')]('GetSugarcrmAccount',_0x2ba6eb);logger['debug'](_0x3a95('0x16'),_0x2ba6eb,JSON['stringify'](_0x37cb7a));_0x538453(_0x37cb7a);})[_0x3a95('0x15')](function(_0x16b31d){logger[_0x3a95('0x12')](_0x3a95('0x16'),_0x16b31d[_0x3a95('0x14')],_0x2ba6eb);_0x232d2f(_0x4b6a2f[_0x3a95('0x12')](0x1f4,_0x16b31d[_0x3a95('0x14')]));});});};exports[_0x3a95('0x20')]=function(_0x23cb22){var _0x2947ff=this;return new Promise(function(_0x553719,_0x4e2571){return db[_0x3a95('0x17')][_0x3a95('0x21')]({'raw':_0x23cb22[_0x3a95('0x19')]?_0x23cb22[_0x3a95('0x19')][_0x3a95('0x1a')]===undefined?!![]:![]:!![],'where':_0x23cb22[_0x3a95('0x19')]?_0x23cb22[_0x3a95('0x19')][_0x3a95('0x1b')]||null:null,'attributes':_0x23cb22[_0x3a95('0x19')]?_0x23cb22[_0x3a95('0x19')][_0x3a95('0x1c')]||null:null,'include':_0x23cb22['options']?_0x23cb22[_0x3a95('0x19')][_0x3a95('0x1d')]?_['map'](_0x23cb22[_0x3a95('0x19')][_0x3a95('0x1d')],function(_0x1e336f){return{'model':db[_0x1e336f[_0x3a95('0x1f')]],'as':_0x1e336f['as'],'attributes':_0x1e336f['attributes'],'include':_0x1e336f[_0x3a95('0x1d')]?_[_0x3a95('0x1e')](_0x1e336f[_0x3a95('0x1d')],function(_0x3bfef1){return{'model':db[_0x3bfef1[_0x3a95('0x1f')]],'as':_0x3bfef1['as'],'attributes':_0x3bfef1[_0x3a95('0x1c')],'include':_0x3bfef1[_0x3a95('0x1d')]?_[_0x3a95('0x1e')](_0x3bfef1[_0x3a95('0x1d')],function(_0x4496ed){return{'model':db[_0x4496ed[_0x3a95('0x1f')]],'as':_0x4496ed['as'],'attributes':_0x4496ed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x281b2a){logger['info']('ShowSugarcrmAccount',_0x23cb22);logger[_0x3a95('0x11')](_0x3a95('0x20'),_0x23cb22,JSON[_0x3a95('0x22')](_0x281b2a));_0x553719(_0x281b2a);})[_0x3a95('0x15')](function(_0x3a0b5e){logger[_0x3a95('0x12')](_0x3a95('0x20'),_0x3a0b5e[_0x3a95('0x14')],_0x23cb22);_0x4e2571(_0x2947ff[_0x3a95('0x12')](0x1f4,_0x3a0b5e['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 1f28b6b..b13d609 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 _0x6376=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create'];(function(_0x4670ab,_0x58c647){var _0x1aa3ee=function(_0x308086){while(--_0x308086){_0x4670ab['push'](_0x4670ab['shift']());}};_0x1aa3ee(++_0x58c647);}(_0x6376,0xef));var _0x6637=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6376[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x6637('0x0'));var util=require(_0x6637('0x1'));var path=require(_0x6637('0x2'));var timeout=require(_0x6637('0x3'));var express=require('express');var router=express[_0x6637('0x4')]();var fs_extra=require(_0x6637('0x5'));var auth=require(_0x6637('0x6'));var interaction=require(_0x6637('0x7'));var config=require(_0x6637('0x8'));var controller=require(_0x6637('0x9'));router[_0x6637('0xa')]('/',auth[_0x6637('0xb')](),controller[_0x6637('0xc')]);router['get'](_0x6637('0xd'),auth[_0x6637('0xb')](),controller[_0x6637('0xe')]);router[_0x6637('0xa')](_0x6637('0xf'),auth[_0x6637('0xb')](),controller[_0x6637('0x10')]);router['get'](_0x6637('0x11'),auth[_0x6637('0xb')](),controller['getSubjects']);router[_0x6637('0xa')](_0x6637('0x12'),auth[_0x6637('0xb')](),controller['getDescriptions']);router[_0x6637('0x13')]('/',auth[_0x6637('0xb')](),controller[_0x6637('0x14')]);router[_0x6637('0x15')](_0x6637('0xd'),auth[_0x6637('0xb')](),controller[_0x6637('0x16')]);router[_0x6637('0x17')](_0x6637('0xd'),auth['isAuthenticated'](),controller[_0x6637('0x18')]);module[_0x6637('0x19')]=router; \ No newline at end of file +var _0x9a34=['getSubjects','/:id/descriptions','getDescriptions','post','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','getFields','/:id/subjects'];(function(_0x232f3a,_0xcf2cd4){var _0x209889=function(_0x57318d){while(--_0x57318d){_0x232f3a['push'](_0x232f3a['shift']());}};_0x209889(++_0xcf2cd4);}(_0x9a34,0x1c6));var _0x49a3=function(_0x4bb77a,_0x310641){_0x4bb77a=_0x4bb77a-0x0;var _0x55e53e=_0x9a34[_0x4bb77a];return _0x55e53e;};'use strict';var multer=require('multer');var util=require(_0x49a3('0x0'));var path=require(_0x49a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x49a3('0x2'));var router=express[_0x49a3('0x3')]();var fs_extra=require(_0x49a3('0x4'));var auth=require(_0x49a3('0x5'));var interaction=require(_0x49a3('0x6'));var config=require('../../config/environment');var controller=require(_0x49a3('0x7'));router['get']('/',auth[_0x49a3('0x8')](),controller['index']);router[_0x49a3('0x9')](_0x49a3('0xa'),auth[_0x49a3('0x8')](),controller['show']);router[_0x49a3('0x9')](_0x49a3('0xb'),auth[_0x49a3('0x8')](),controller[_0x49a3('0xc')]);router[_0x49a3('0x9')](_0x49a3('0xd'),auth['isAuthenticated'](),controller[_0x49a3('0xe')]);router[_0x49a3('0x9')](_0x49a3('0xf'),auth[_0x49a3('0x8')](),controller[_0x49a3('0x10')]);router[_0x49a3('0x11')]('/',auth[_0x49a3('0x8')](),controller['create']);router['put'](_0x49a3('0xa'),auth[_0x49a3('0x8')](),controller['update']);router['delete'](_0x49a3('0xa'),auth[_0x49a3('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 808fd87..6581ca6 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 _0x1da5=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1da5,0x1e7));var _0x51da=function(_0x39929e,_0x5b9d76){_0x39929e=_0x39929e-0x0;var _0x2ced4b=_0x1da5[_0x39929e];return _0x2ced4b;};'use strict';var Sequelize=require(_0x51da('0x0'));module[_0x51da('0x1')]={'name':{'type':Sequelize[_0x51da('0x2')]},'description':{'type':Sequelize[_0x51da('0x2')]}}; \ No newline at end of file +var _0xf35d=['exports','STRING','sequelize'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xf35d,0x6b));var _0xdf35=function(_0x469da2,_0x418219){_0x469da2=_0x469da2-0x0;var _0x14ca72=_0xf35d[_0x469da2];return _0x14ca72;};'use strict';var Sequelize=require(_0xdf35('0x0'));module[_0xdf35('0x1')]={'name':{'type':Sequelize[_0xdf35('0x2')]},'description':{'type':Sequelize[_0xdf35('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d677d0d..0f245f4 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 _0xd760=['include','create','body','update','find','getFields','findOne','nolimit','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','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','sendStatus','status','end','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll'];(function(_0x19e02c,_0x30d130){var _0x5ebbc7=function(_0x1fd5e4){while(--_0x1fd5e4){_0x19e02c['push'](_0x19e02c['shift']());}};_0x5ebbc7(++_0x30d130);}(_0xd760,0x1df));var _0x0d76=function(_0x5e23f6,_0x30f7dd){_0x5e23f6=_0x5e23f6-0x0;var _0x15933b=_0xd760[_0x5e23f6];return _0x15933b;};'use strict';var emlformat=require(_0x0d76('0x0'));var rimraf=require(_0x0d76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d76('0x2'));var moment=require('moment');var BPromise=require(_0x0d76('0x3'));var Mustache=require(_0x0d76('0x4'));var util=require('util');var path=require(_0x0d76('0x5'));var sox=require(_0x0d76('0x6'));var csv=require(_0x0d76('0x7'));var ejs=require(_0x0d76('0x8'));var fs=require('fs');var fs_extra=require(_0x0d76('0x9'));var _=require('lodash');var squel=require(_0x0d76('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d76('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0d76('0xc'));var Papa=require(_0x0d76('0xd'));var Redis=require(_0x0d76('0xe'));var authService=require(_0x0d76('0xf'));var qs=require(_0x0d76('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d76('0x11'));var logger=require(_0x0d76('0x12'))(_0x0d76('0x13'));var utils=require(_0x0d76('0x14'));var config=require(_0x0d76('0x15'));var licenseUtil=require(_0x0d76('0x16'));var db=require(_0x0d76('0x17'))['db'];function respondWithStatusCode(_0x24154d,_0x405e7e){_0x405e7e=_0x405e7e||0xcc;return function(_0x4be77b){if(_0x4be77b){return _0x24154d[_0x0d76('0x18')](_0x405e7e);}return _0x24154d[_0x0d76('0x19')](_0x405e7e)[_0x0d76('0x1a')]();};}function respondWithResult(_0x2cd5ef,_0x54d3c1){_0x54d3c1=_0x54d3c1||0xc8;return function(_0x6a0abf){if(_0x6a0abf){return _0x2cd5ef[_0x0d76('0x19')](_0x54d3c1)['json'](_0x6a0abf);}};}function respondWithFilteredResult(_0x4b5e89,_0x5af280){return function(_0x4b74eb){if(_0x4b74eb){var _0x56190f=typeof _0x5af280[_0x0d76('0x1b')]===_0x0d76('0x1c')&&typeof _0x5af280['limit']===_0x0d76('0x1c');var _0x54c898=_0x4b74eb['count'];var _0x3c3eb5=_0x56190f?0x0:_0x5af280[_0x0d76('0x1b')];var _0x3c0c40=_0x56190f?_0x4b74eb[_0x0d76('0x1d')]:_0x5af280['offset']+_0x5af280[_0x0d76('0x1e')];var _0x3b0586;if(_0x3c0c40>=_0x54c898){_0x3c0c40=_0x54c898;_0x3b0586=0xc8;}else{_0x3b0586=0xce;}_0x4b5e89[_0x0d76('0x19')](_0x3b0586);return _0x4b5e89['set'](_0x0d76('0x1f'),_0x3c3eb5+'-'+_0x3c0c40+'/'+_0x54c898)['json'](_0x4b74eb);}return null;};}function patchUpdates(_0x1b0352){return function(_0x2893d6){try{jsonpatch['apply'](_0x2893d6,_0x1b0352,!![]);}catch(_0x151621){return BPromise[_0x0d76('0x20')](_0x151621);}return _0x2893d6[_0x0d76('0x21')]();};}function saveUpdates(_0x28eb26,_0x5c7e29){return function(_0x1e98f7){if(_0x1e98f7){return _0x1e98f7['update'](_0x28eb26)[_0x0d76('0x22')](function(_0x378b60){return _0x378b60;});}return null;};}function removeEntity(_0x124893,_0x2469a5){return function(_0x2dddf5){if(_0x2dddf5){return _0x2dddf5[_0x0d76('0x23')]()[_0x0d76('0x22')](function(){_0x124893[_0x0d76('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f4e7,_0x340f3e){return function(_0x151517){if(!_0x151517){_0x46f4e7[_0x0d76('0x18')](0x194);}return _0x151517;};}function handleError(_0x22c617,_0x2dbc22){_0x2dbc22=_0x2dbc22||0x1f4;return function(_0x3ecbad){logger[_0x0d76('0x24')](_0x3ecbad[_0x0d76('0x25')]);if(_0x3ecbad[_0x0d76('0x26')]){delete _0x3ecbad[_0x0d76('0x26')];}_0x22c617['status'](_0x2dbc22)['send'](_0x3ecbad);};}exports[_0x0d76('0x27')]=function(_0x40c291,_0x4d31a0){var _0x5a2dfd={},_0x1bfd31={},_0x5b92a2={'count':0x0,'rows':[]};var _0x4f20e0=_[_0x0d76('0x28')](db[_0x0d76('0x29')][_0x0d76('0x2a')],function(_0x5ed28e){return{'name':_0x5ed28e['fieldName'],'type':_0x5ed28e[_0x0d76('0x2b')][_0x0d76('0x2c')]};});_0x1bfd31[_0x0d76('0x2d')]=_[_0x0d76('0x28')](_0x4f20e0,_0x0d76('0x26'));_0x1bfd31['query']=_[_0x0d76('0x2e')](_0x40c291[_0x0d76('0x2f')]);_0x1bfd31[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x1bfd31[_0x0d76('0x2d')],_0x1bfd31['query']);_0x5a2dfd[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0x1bfd31['model'],qs[_0x0d76('0x33')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x33')]));_0x5a2dfd[_0x0d76('0x32')]=_0x5a2dfd[_0x0d76('0x32')][_0x0d76('0x34')]?_0x5a2dfd[_0x0d76('0x32')]:_0x1bfd31[_0x0d76('0x2d')];if(!_0x40c291[_0x0d76('0x2f')][_0x0d76('0x35')]('nolimit')){_0x5a2dfd['limit']=qs[_0x0d76('0x1e')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x5a2dfd[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x40c291['query'][_0x0d76('0x1b')]);}_0x5a2dfd[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x37')]);_0x5a2dfd[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0x40c291[_0x0d76('0x2f')],_0x1bfd31[_0x0d76('0x30')]),_0x4f20e0);if(_0x40c291['query'][_0x0d76('0x3a')]){_0x5a2dfd['where']=_[_0x0d76('0x3b')](_0x5a2dfd[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x4f20e0,function(_0x103e0d){if(_0x103e0d['type']!=='VIRTUAL'){var _0x324227={};_0x324227[_0x103e0d['name']]={'$like':'%'+_0x40c291['query'][_0x0d76('0x3a')]+'%'};return _0x324227;}})});}_0x5a2dfd=_[_0x0d76('0x3b')]({},_0x5a2dfd,_0x40c291[_0x0d76('0x3c')]);var _0x42ea03={'where':_0x5a2dfd['where']};return db[_0x0d76('0x29')]['count'](_0x42ea03)[_0x0d76('0x22')](function(_0x2bb4e8){_0x5b92a2['count']=_0x2bb4e8;if(_0x40c291[_0x0d76('0x2f')]['includeAll']){_0x5a2dfd['include']=[{'all':!![]}];}return db[_0x0d76('0x29')][_0x0d76('0x3d')](_0x5a2dfd);})[_0x0d76('0x22')](function(_0x5df513){_0x5b92a2[_0x0d76('0x3e')]=_0x5df513;return _0x5b92a2;})[_0x0d76('0x22')](respondWithFilteredResult(_0x4d31a0,_0x5a2dfd))[_0x0d76('0x3f')](handleError(_0x4d31a0,null));};exports[_0x0d76('0x40')]=function(_0x2dc840,_0x5a2b0b){var _0x1be600={'raw':![],'where':{'id':_0x2dc840[_0x0d76('0x41')]['id']}},_0x22fe3d={};_0x22fe3d[_0x0d76('0x2d')]=_[_0x0d76('0x2e')](db[_0x0d76('0x29')][_0x0d76('0x2a')]);_0x22fe3d['query']=_[_0x0d76('0x2e')](_0x2dc840[_0x0d76('0x2f')]);_0x22fe3d[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x22fe3d[_0x0d76('0x2d')],_0x22fe3d[_0x0d76('0x2f')]);_0x1be600['attributes']=_[_0x0d76('0x31')](_0x22fe3d['model'],qs['fields'](_0x2dc840[_0x0d76('0x2f')][_0x0d76('0x33')]));_0x1be600[_0x0d76('0x32')]=_0x1be600[_0x0d76('0x32')]['length']?_0x1be600['attributes']:_0x22fe3d[_0x0d76('0x2d')];if(_0x2dc840[_0x0d76('0x2f')][_0x0d76('0x42')]){_0x1be600[_0x0d76('0x43')]=[{'all':!![]}];}_0x1be600=_[_0x0d76('0x3b')]({},_0x1be600,_0x2dc840[_0x0d76('0x3c')]);return db[_0x0d76('0x29')]['find'](_0x1be600)['then'](handleEntityNotFound(_0x5a2b0b,null))[_0x0d76('0x22')](respondWithResult(_0x5a2b0b,null))[_0x0d76('0x3f')](handleError(_0x5a2b0b,null));};exports[_0x0d76('0x44')]=function(_0x54449b,_0x43acdb){return db[_0x0d76('0x29')][_0x0d76('0x44')](_0x54449b[_0x0d76('0x45')],{})[_0x0d76('0x22')](respondWithResult(_0x43acdb,0xc9))[_0x0d76('0x3f')](handleError(_0x43acdb,null));};exports[_0x0d76('0x46')]=function(_0x32ba6c,_0x4b6626){if(_0x32ba6c[_0x0d76('0x45')]['id']){delete _0x32ba6c[_0x0d76('0x45')]['id'];}return db['SugarcrmConfiguration'][_0x0d76('0x47')]({'where':{'id':_0x32ba6c[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x4b6626,null))[_0x0d76('0x22')](saveUpdates(_0x32ba6c[_0x0d76('0x45')],null))[_0x0d76('0x22')](respondWithResult(_0x4b6626,null))[_0x0d76('0x3f')](handleError(_0x4b6626,null));};exports[_0x0d76('0x23')]=function(_0x824333,_0x48e190){return db[_0x0d76('0x29')][_0x0d76('0x47')]({'where':{'id':_0x824333['params']['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x48e190,null))[_0x0d76('0x22')](removeEntity(_0x48e190,null))[_0x0d76('0x3f')](handleError(_0x48e190,null));};exports[_0x0d76('0x48')]=function(_0xdd4804,_0x5541ef,_0x20cdba){var _0x5bd467={};var _0x38e808={};var _0x467ab0;var _0x3923b5;return db['SugarcrmConfiguration'][_0x0d76('0x49')]({'where':{'id':_0xdd4804[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x5541ef,null))[_0x0d76('0x22')](function(_0x226f9e){if(_0x226f9e){_0x467ab0=_0x226f9e;_0x38e808[_0x0d76('0x2d')]=_[_0x0d76('0x2e')](db['SugarcrmField'][_0x0d76('0x2a')]);_0x38e808['query']=_['keys'](_0xdd4804[_0x0d76('0x2f')]);_0x38e808[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x38e808[_0x0d76('0x2d')],_0x38e808[_0x0d76('0x2f')]);_0x5bd467[_0x0d76('0x32')]=_['intersection'](_0x38e808[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0xdd4804[_0x0d76('0x2f')]['fields']));_0x5bd467['attributes']=_0x5bd467[_0x0d76('0x32')][_0x0d76('0x34')]?_0x5bd467[_0x0d76('0x32')]:_0x38e808['model'];_0x5bd467[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0xdd4804[_0x0d76('0x2f')][_0x0d76('0x37')]);_0x5bd467[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0xdd4804['query'],_0x38e808[_0x0d76('0x30')]));if(_0xdd4804[_0x0d76('0x2f')]['filter']){_0x5bd467[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x5bd467[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x5bd467[_0x0d76('0x32')],function(_0x2b6500){var _0x4c67a2={};_0x4c67a2[_0x2b6500]={'$like':'%'+_0xdd4804['query'][_0x0d76('0x3a')]+'%'};return _0x4c67a2;})});}_0x5bd467=_[_0x0d76('0x3b')]({},_0x5bd467,_0xdd4804[_0x0d76('0x3c')]);return _0x467ab0['getFields'](_0x5bd467);}})[_0x0d76('0x22')](function(_0x2140b6){if(_0x2140b6){_0x3923b5=_0x2140b6[_0x0d76('0x34')];if(!_0xdd4804[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x5bd467['limit']=qs[_0x0d76('0x1e')](_0xdd4804[_0x0d76('0x2f')]['limit']);_0x5bd467[_0x0d76('0x1b')]=qs['offset'](_0xdd4804['query'][_0x0d76('0x1b')]);}return _0x467ab0[_0x0d76('0x48')](_0x5bd467);}})[_0x0d76('0x22')](function(_0x45e750){if(_0x45e750){return _0x45e750?{'count':_0x3923b5,'rows':_0x45e750}:null;}})[_0x0d76('0x22')](respondWithResult(_0x5541ef,null))[_0x0d76('0x3f')](handleError(_0x5541ef,null));};exports['getSubjects']=function(_0x3c55e4,_0x26ca02,_0x482e8a){var _0x281baa={};var _0xe433={};var _0x573b89;var _0xf23132;return db[_0x0d76('0x29')][_0x0d76('0x49')]({'where':{'id':_0x3c55e4[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x26ca02,null))[_0x0d76('0x22')](function(_0x52f610){if(_0x52f610){_0x573b89=_0x52f610;_0xe433[_0x0d76('0x2d')]=_['keys'](db[_0x0d76('0x4b')]['rawAttributes']);_0xe433['query']=_['keys'](_0x3c55e4[_0x0d76('0x2f')]);_0xe433[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0xe433['model'],_0xe433[_0x0d76('0x2f')]);_0x281baa[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0xe433[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0x3c55e4[_0x0d76('0x2f')]['fields']));_0x281baa[_0x0d76('0x32')]=_0x281baa['attributes'][_0x0d76('0x34')]?_0x281baa['attributes']:_0xe433[_0x0d76('0x2d')];_0x281baa['order']=qs[_0x0d76('0x37')](_0x3c55e4[_0x0d76('0x2f')]['sort']);_0x281baa[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0x3c55e4[_0x0d76('0x2f')],_0xe433[_0x0d76('0x30')]));if(_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x3a')]){_0x281baa[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x281baa[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x281baa[_0x0d76('0x32')],function(_0x309be2){var _0x155370={};_0x155370[_0x309be2]={'$like':'%'+_0x3c55e4['query'][_0x0d76('0x3a')]+'%'};return _0x155370;})});}_0x281baa=_[_0x0d76('0x3b')]({},_0x281baa,_0x3c55e4[_0x0d76('0x3c')]);return _0x573b89[_0x0d76('0x4c')](_0x281baa);}})[_0x0d76('0x22')](function(_0x55d498){if(_0x55d498){_0xf23132=_0x55d498[_0x0d76('0x34')];if(!_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x281baa[_0x0d76('0x1e')]=qs[_0x0d76('0x1e')](_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x281baa[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x1b')]);}return _0x573b89[_0x0d76('0x4c')](_0x281baa);}})['then'](function(_0x51d0fc){if(_0x51d0fc){return _0x51d0fc?{'count':_0xf23132,'rows':_0x51d0fc}:null;}})[_0x0d76('0x22')](respondWithResult(_0x26ca02,null))[_0x0d76('0x3f')](handleError(_0x26ca02,null));};exports[_0x0d76('0x4d')]=function(_0x1cbf0f,_0xdfca5e,_0x4a4f2a){var _0x9f44d6={};var _0x47565f={};var _0x431490;var _0x1c0238;return db[_0x0d76('0x29')][_0x0d76('0x49')]({'where':{'id':_0x1cbf0f[_0x0d76('0x41')]['id']}})['then'](handleEntityNotFound(_0xdfca5e,null))['then'](function(_0x4ac553){if(_0x4ac553){_0x431490=_0x4ac553;_0x47565f['model']=_['keys'](db[_0x0d76('0x4b')]['rawAttributes']);_0x47565f[_0x0d76('0x2f')]=_['keys'](_0x1cbf0f[_0x0d76('0x2f')]);_0x47565f[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x47565f['model'],_0x47565f[_0x0d76('0x2f')]);_0x9f44d6[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0x47565f[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0x1cbf0f[_0x0d76('0x2f')]['fields']));_0x9f44d6[_0x0d76('0x32')]=_0x9f44d6[_0x0d76('0x32')][_0x0d76('0x34')]?_0x9f44d6['attributes']:_0x47565f[_0x0d76('0x2d')];_0x9f44d6[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0x1cbf0f[_0x0d76('0x2f')]['sort']);_0x9f44d6['where']=qs[_0x0d76('0x30')](_['pick'](_0x1cbf0f[_0x0d76('0x2f')],_0x47565f[_0x0d76('0x30')]));if(_0x1cbf0f[_0x0d76('0x2f')]['filter']){_0x9f44d6[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x9f44d6['where'],{'$or':_[_0x0d76('0x28')](_0x9f44d6[_0x0d76('0x32')],function(_0x4f12eb){var _0x5179e8={};_0x5179e8[_0x4f12eb]={'$like':'%'+_0x1cbf0f[_0x0d76('0x2f')]['filter']+'%'};return _0x5179e8;})});}_0x9f44d6=_[_0x0d76('0x3b')]({},_0x9f44d6,_0x1cbf0f[_0x0d76('0x3c')]);return _0x431490[_0x0d76('0x4d')](_0x9f44d6);}})[_0x0d76('0x22')](function(_0xd4c508){if(_0xd4c508){_0x1c0238=_0xd4c508[_0x0d76('0x34')];if(!_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x9f44d6[_0x0d76('0x1e')]=qs['limit'](_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x9f44d6[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x1b')]);}return _0x431490[_0x0d76('0x4d')](_0x9f44d6);}})[_0x0d76('0x22')](function(_0x22d288){if(_0x22d288){return _0x22d288?{'count':_0x1c0238,'rows':_0x22d288}:null;}})[_0x0d76('0x22')](respondWithResult(_0xdfca5e,null))[_0x0d76('0x3f')](handleError(_0xdfca5e,null));}; \ No newline at end of file +var _0x197a=['sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','name','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmConfiguration','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1f8ac1,_0xed3823){var _0xed6927=function(_0x5990fb){while(--_0x5990fb){_0x1f8ac1['push'](_0x1f8ac1['shift']());}};_0xed6927(++_0xed3823);}(_0x197a,0x85));var _0xa197=function(_0x2340e2,_0x1627f9){_0x2340e2=_0x2340e2-0x0;var _0x5ced10=_0x197a[_0x2340e2];return _0x5ced10;};'use strict';var emlformat=require(_0xa197('0x0'));var rimraf=require(_0xa197('0x1'));var zipdir=require(_0xa197('0x2'));var jsonpatch=require(_0xa197('0x3'));var rp=require(_0xa197('0x4'));var moment=require(_0xa197('0x5'));var BPromise=require(_0xa197('0x6'));var Mustache=require(_0xa197('0x7'));var util=require('util');var path=require(_0xa197('0x8'));var sox=require(_0xa197('0x9'));var csv=require(_0xa197('0xa'));var ejs=require(_0xa197('0xb'));var fs=require('fs');var fs_extra=require(_0xa197('0xc'));var _=require(_0xa197('0xd'));var squel=require('squel');var crypto=require(_0xa197('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa197('0xa'));var querystring=require(_0xa197('0xf'));var Papa=require(_0xa197('0x10'));var Redis=require(_0xa197('0x11'));var authService=require(_0xa197('0x12'));var qs=require(_0xa197('0x13'));var as=require(_0xa197('0x14'));var hardwareService=require(_0xa197('0x15'));var logger=require(_0xa197('0x16'))(_0xa197('0x17'));var utils=require(_0xa197('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa197('0x19'));var db=require(_0xa197('0x1a'))['db'];function respondWithStatusCode(_0x41c20d,_0x12a4a8){_0x12a4a8=_0x12a4a8||0xcc;return function(_0x40b4b5){if(_0x40b4b5){return _0x41c20d[_0xa197('0x1b')](_0x12a4a8);}return _0x41c20d[_0xa197('0x1c')](_0x12a4a8)['end']();};}function respondWithResult(_0x451907,_0xe30b54){_0xe30b54=_0xe30b54||0xc8;return function(_0x277d53){if(_0x277d53){return _0x451907[_0xa197('0x1c')](_0xe30b54)['json'](_0x277d53);}};}function respondWithFilteredResult(_0x1915c5,_0xbd37d6){return function(_0x2f7d3e){if(_0x2f7d3e){var _0xfffdd8=typeof _0xbd37d6[_0xa197('0x1d')]===_0xa197('0x1e')&&typeof _0xbd37d6[_0xa197('0x1f')]===_0xa197('0x1e');var _0x3d4966=_0x2f7d3e[_0xa197('0x20')];var _0xbbe5bf=_0xfffdd8?0x0:_0xbd37d6['offset'];var _0x30ec5e=_0xfffdd8?_0x2f7d3e[_0xa197('0x20')]:_0xbd37d6['offset']+_0xbd37d6[_0xa197('0x1f')];var _0xa9bd40;if(_0x30ec5e>=_0x3d4966){_0x30ec5e=_0x3d4966;_0xa9bd40=0xc8;}else{_0xa9bd40=0xce;}_0x1915c5['status'](_0xa9bd40);return _0x1915c5[_0xa197('0x21')](_0xa197('0x22'),_0xbbe5bf+'-'+_0x30ec5e+'/'+_0x3d4966)[_0xa197('0x23')](_0x2f7d3e);}return null;};}function patchUpdates(_0x39f6d6){return function(_0x22bc89){try{jsonpatch['apply'](_0x22bc89,_0x39f6d6,!![]);}catch(_0xf06f98){return BPromise[_0xa197('0x24')](_0xf06f98);}return _0x22bc89[_0xa197('0x25')]();};}function saveUpdates(_0x3445e8,_0x4ba19d){return function(_0xb59cf3){if(_0xb59cf3){return _0xb59cf3[_0xa197('0x26')](_0x3445e8)[_0xa197('0x27')](function(_0x452984){return _0x452984;});}return null;};}function removeEntity(_0x2cb1a4,_0x1c68ee){return function(_0x26f6a4){if(_0x26f6a4){return _0x26f6a4['destroy']()['then'](function(){_0x2cb1a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2030b7,_0x463ea1){return function(_0x7d8459){if(!_0x7d8459){_0x2030b7[_0xa197('0x1b')](0x194);}return _0x7d8459;};}function handleError(_0x4fad70,_0x3bea3e){_0x3bea3e=_0x3bea3e||0x1f4;return function(_0xa99d51){logger[_0xa197('0x28')](_0xa99d51['stack']);if(_0xa99d51[_0xa197('0x29')]){delete _0xa99d51[_0xa197('0x29')];}_0x4fad70['status'](_0x3bea3e)['send'](_0xa99d51);};}exports['index']=function(_0x1005a0,_0x42a109){var _0x4c7ba1={},_0x1e3099={},_0x261e10={'count':0x0,'rows':[]};var _0x3a48a2=_[_0xa197('0x2a')](db['SugarcrmConfiguration'][_0xa197('0x2b')],function(_0x5aae39){return{'name':_0x5aae39[_0xa197('0x2c')],'type':_0x5aae39[_0xa197('0x2d')][_0xa197('0x2e')]};});_0x1e3099['model']=_['map'](_0x3a48a2,_0xa197('0x29'));_0x1e3099['query']=_[_0xa197('0x2f')](_0x1005a0['query']);_0x1e3099[_0xa197('0x30')]=_[_0xa197('0x31')](_0x1e3099[_0xa197('0x32')],_0x1e3099[_0xa197('0x33')]);_0x4c7ba1[_0xa197('0x34')]=_[_0xa197('0x31')](_0x1e3099[_0xa197('0x32')],qs['fields'](_0x1005a0[_0xa197('0x33')][_0xa197('0x35')]));_0x4c7ba1[_0xa197('0x34')]=_0x4c7ba1['attributes'][_0xa197('0x36')]?_0x4c7ba1['attributes']:_0x1e3099[_0xa197('0x32')];if(!_0x1005a0['query']['hasOwnProperty'](_0xa197('0x37'))){_0x4c7ba1[_0xa197('0x1f')]=qs['limit'](_0x1005a0[_0xa197('0x33')][_0xa197('0x1f')]);_0x4c7ba1[_0xa197('0x1d')]=qs[_0xa197('0x1d')](_0x1005a0['query']['offset']);}_0x4c7ba1[_0xa197('0x38')]=qs[_0xa197('0x39')](_0x1005a0[_0xa197('0x33')][_0xa197('0x39')]);_0x4c7ba1['where']=qs[_0xa197('0x30')](_[_0xa197('0x3a')](_0x1005a0[_0xa197('0x33')],_0x1e3099[_0xa197('0x30')]),_0x3a48a2);if(_0x1005a0['query'][_0xa197('0x3b')]){_0x4c7ba1[_0xa197('0x3c')]=_[_0xa197('0x3d')](_0x4c7ba1[_0xa197('0x3c')],{'$or':_[_0xa197('0x2a')](_0x3a48a2,function(_0x38460a){if(_0x38460a['type']!==_0xa197('0x3e')){var _0x230e9f={};_0x230e9f[_0x38460a[_0xa197('0x29')]]={'$like':'%'+_0x1005a0[_0xa197('0x33')][_0xa197('0x3b')]+'%'};return _0x230e9f;}})});}_0x4c7ba1=_['merge']({},_0x4c7ba1,_0x1005a0[_0xa197('0x3f')]);var _0x5ae663={'where':_0x4c7ba1['where']};return db['SugarcrmConfiguration'][_0xa197('0x20')](_0x5ae663)[_0xa197('0x27')](function(_0x39facb){_0x261e10[_0xa197('0x20')]=_0x39facb;if(_0x1005a0['query']['includeAll']){_0x4c7ba1['include']=[{'all':!![]}];}return db[_0xa197('0x40')]['findAll'](_0x4c7ba1);})[_0xa197('0x27')](function(_0x339e60){_0x261e10[_0xa197('0x41')]=_0x339e60;return _0x261e10;})[_0xa197('0x27')](respondWithFilteredResult(_0x42a109,_0x4c7ba1))[_0xa197('0x42')](handleError(_0x42a109,null));};exports[_0xa197('0x43')]=function(_0xfbef49,_0x4cf8f1){var _0x10251d={'raw':![],'where':{'id':_0xfbef49[_0xa197('0x44')]['id']}},_0x18061f={};_0x18061f[_0xa197('0x32')]=_['keys'](db['SugarcrmConfiguration'][_0xa197('0x2b')]);_0x18061f[_0xa197('0x33')]=_[_0xa197('0x2f')](_0xfbef49['query']);_0x18061f[_0xa197('0x30')]=_['intersection'](_0x18061f['model'],_0x18061f[_0xa197('0x33')]);_0x10251d[_0xa197('0x34')]=_[_0xa197('0x31')](_0x18061f['model'],qs['fields'](_0xfbef49['query'][_0xa197('0x35')]));_0x10251d[_0xa197('0x34')]=_0x10251d[_0xa197('0x34')][_0xa197('0x36')]?_0x10251d['attributes']:_0x18061f[_0xa197('0x32')];if(_0xfbef49[_0xa197('0x33')][_0xa197('0x45')]){_0x10251d[_0xa197('0x46')]=[{'all':!![]}];}_0x10251d=_['merge']({},_0x10251d,_0xfbef49[_0xa197('0x3f')]);return db['SugarcrmConfiguration'][_0xa197('0x47')](_0x10251d)[_0xa197('0x27')](handleEntityNotFound(_0x4cf8f1,null))[_0xa197('0x27')](respondWithResult(_0x4cf8f1,null))[_0xa197('0x42')](handleError(_0x4cf8f1,null));};exports[_0xa197('0x48')]=function(_0xef7b9a,_0x3426c0){return db[_0xa197('0x40')]['create'](_0xef7b9a['body'],{})['then'](respondWithResult(_0x3426c0,0xc9))[_0xa197('0x42')](handleError(_0x3426c0,null));};exports[_0xa197('0x26')]=function(_0x125109,_0x16a583){if(_0x125109[_0xa197('0x49')]['id']){delete _0x125109[_0xa197('0x49')]['id'];}return db[_0xa197('0x40')][_0xa197('0x47')]({'where':{'id':_0x125109['params']['id']}})[_0xa197('0x27')](handleEntityNotFound(_0x16a583,null))[_0xa197('0x27')](saveUpdates(_0x125109[_0xa197('0x49')],null))[_0xa197('0x27')](respondWithResult(_0x16a583,null))[_0xa197('0x42')](handleError(_0x16a583,null));};exports['destroy']=function(_0x222a44,_0x4e603b){return db[_0xa197('0x40')][_0xa197('0x47')]({'where':{'id':_0x222a44[_0xa197('0x44')]['id']}})[_0xa197('0x27')](handleEntityNotFound(_0x4e603b,null))['then'](removeEntity(_0x4e603b,null))['catch'](handleError(_0x4e603b,null));};exports[_0xa197('0x4a')]=function(_0x3814d2,_0x4ef616,_0x2285ba){var _0x188110={};var _0x233e24={};var _0x48527f;var _0x41a20b;return db[_0xa197('0x40')][_0xa197('0x4b')]({'where':{'id':_0x3814d2[_0xa197('0x44')]['id']}})[_0xa197('0x27')](handleEntityNotFound(_0x4ef616,null))['then'](function(_0x2c8f6c){if(_0x2c8f6c){_0x48527f=_0x2c8f6c;_0x233e24[_0xa197('0x32')]=_[_0xa197('0x2f')](db[_0xa197('0x4c')]['rawAttributes']);_0x233e24['query']=_[_0xa197('0x2f')](_0x3814d2[_0xa197('0x33')]);_0x233e24[_0xa197('0x30')]=_[_0xa197('0x31')](_0x233e24[_0xa197('0x32')],_0x233e24[_0xa197('0x33')]);_0x188110[_0xa197('0x34')]=_[_0xa197('0x31')](_0x233e24['model'],qs['fields'](_0x3814d2[_0xa197('0x33')][_0xa197('0x35')]));_0x188110[_0xa197('0x34')]=_0x188110[_0xa197('0x34')]['length']?_0x188110['attributes']:_0x233e24['model'];_0x188110[_0xa197('0x38')]=qs[_0xa197('0x39')](_0x3814d2['query'][_0xa197('0x39')]);_0x188110[_0xa197('0x3c')]=qs[_0xa197('0x30')](_[_0xa197('0x3a')](_0x3814d2[_0xa197('0x33')],_0x233e24[_0xa197('0x30')]));if(_0x3814d2[_0xa197('0x33')]['filter']){_0x188110['where']=_['merge'](_0x188110[_0xa197('0x3c')],{'$or':_[_0xa197('0x2a')](_0x188110[_0xa197('0x34')],function(_0x117641){var _0x37f72c={};_0x37f72c[_0x117641]={'$like':'%'+_0x3814d2[_0xa197('0x33')]['filter']+'%'};return _0x37f72c;})});}_0x188110=_['merge']({},_0x188110,_0x3814d2['options']);return _0x48527f[_0xa197('0x4a')](_0x188110);}})[_0xa197('0x27')](function(_0x39a00a){if(_0x39a00a){_0x41a20b=_0x39a00a[_0xa197('0x36')];if(!_0x3814d2['query'][_0xa197('0x4d')]('nolimit')){_0x188110['limit']=qs[_0xa197('0x1f')](_0x3814d2[_0xa197('0x33')][_0xa197('0x1f')]);_0x188110['offset']=qs[_0xa197('0x1d')](_0x3814d2[_0xa197('0x33')]['offset']);}return _0x48527f[_0xa197('0x4a')](_0x188110);}})[_0xa197('0x27')](function(_0x2fe6e3){if(_0x2fe6e3){return _0x2fe6e3?{'count':_0x41a20b,'rows':_0x2fe6e3}:null;}})[_0xa197('0x27')](respondWithResult(_0x4ef616,null))[_0xa197('0x42')](handleError(_0x4ef616,null));};exports[_0xa197('0x4e')]=function(_0x23a160,_0x229471,_0x2f07d3){var _0x70e98c={};var _0x2998e2={};var _0x46c883;var _0x43c350;return db[_0xa197('0x40')][_0xa197('0x4b')]({'where':{'id':_0x23a160['params']['id']}})[_0xa197('0x27')](handleEntityNotFound(_0x229471,null))['then'](function(_0x3e0cb1){if(_0x3e0cb1){_0x46c883=_0x3e0cb1;_0x2998e2[_0xa197('0x32')]=_[_0xa197('0x2f')](db['SugarcrmField']['rawAttributes']);_0x2998e2[_0xa197('0x33')]=_['keys'](_0x23a160[_0xa197('0x33')]);_0x2998e2[_0xa197('0x30')]=_[_0xa197('0x31')](_0x2998e2['model'],_0x2998e2[_0xa197('0x33')]);_0x70e98c['attributes']=_['intersection'](_0x2998e2[_0xa197('0x32')],qs[_0xa197('0x35')](_0x23a160[_0xa197('0x33')][_0xa197('0x35')]));_0x70e98c[_0xa197('0x34')]=_0x70e98c['attributes'][_0xa197('0x36')]?_0x70e98c[_0xa197('0x34')]:_0x2998e2[_0xa197('0x32')];_0x70e98c[_0xa197('0x38')]=qs[_0xa197('0x39')](_0x23a160['query'][_0xa197('0x39')]);_0x70e98c[_0xa197('0x3c')]=qs[_0xa197('0x30')](_[_0xa197('0x3a')](_0x23a160['query'],_0x2998e2[_0xa197('0x30')]));if(_0x23a160[_0xa197('0x33')][_0xa197('0x3b')]){_0x70e98c[_0xa197('0x3c')]=_[_0xa197('0x3d')](_0x70e98c[_0xa197('0x3c')],{'$or':_[_0xa197('0x2a')](_0x70e98c['attributes'],function(_0x3c32ed){var _0x28fd45={};_0x28fd45[_0x3c32ed]={'$like':'%'+_0x23a160[_0xa197('0x33')][_0xa197('0x3b')]+'%'};return _0x28fd45;})});}_0x70e98c=_['merge']({},_0x70e98c,_0x23a160[_0xa197('0x3f')]);return _0x46c883['getSubjects'](_0x70e98c);}})[_0xa197('0x27')](function(_0x54d939){if(_0x54d939){_0x43c350=_0x54d939[_0xa197('0x36')];if(!_0x23a160['query'][_0xa197('0x4d')](_0xa197('0x37'))){_0x70e98c[_0xa197('0x1f')]=qs['limit'](_0x23a160[_0xa197('0x33')][_0xa197('0x1f')]);_0x70e98c['offset']=qs[_0xa197('0x1d')](_0x23a160[_0xa197('0x33')][_0xa197('0x1d')]);}return _0x46c883['getSubjects'](_0x70e98c);}})[_0xa197('0x27')](function(_0x467231){if(_0x467231){return _0x467231?{'count':_0x43c350,'rows':_0x467231}:null;}})[_0xa197('0x27')](respondWithResult(_0x229471,null))['catch'](handleError(_0x229471,null));};exports[_0xa197('0x4f')]=function(_0x296fe0,_0x53cfbd,_0xcc484c){var _0x19f84d={};var _0x20c847={};var _0x425081;var _0x229d1a;return db[_0xa197('0x40')]['findOne']({'where':{'id':_0x296fe0[_0xa197('0x44')]['id']}})[_0xa197('0x27')](handleEntityNotFound(_0x53cfbd,null))[_0xa197('0x27')](function(_0x4e2c96){if(_0x4e2c96){_0x425081=_0x4e2c96;_0x20c847[_0xa197('0x32')]=_[_0xa197('0x2f')](db[_0xa197('0x4c')][_0xa197('0x2b')]);_0x20c847[_0xa197('0x33')]=_['keys'](_0x296fe0[_0xa197('0x33')]);_0x20c847[_0xa197('0x30')]=_[_0xa197('0x31')](_0x20c847[_0xa197('0x32')],_0x20c847[_0xa197('0x33')]);_0x19f84d[_0xa197('0x34')]=_['intersection'](_0x20c847[_0xa197('0x32')],qs[_0xa197('0x35')](_0x296fe0['query'][_0xa197('0x35')]));_0x19f84d[_0xa197('0x34')]=_0x19f84d['attributes']['length']?_0x19f84d['attributes']:_0x20c847[_0xa197('0x32')];_0x19f84d[_0xa197('0x38')]=qs[_0xa197('0x39')](_0x296fe0[_0xa197('0x33')][_0xa197('0x39')]);_0x19f84d[_0xa197('0x3c')]=qs['filters'](_[_0xa197('0x3a')](_0x296fe0[_0xa197('0x33')],_0x20c847[_0xa197('0x30')]));if(_0x296fe0[_0xa197('0x33')][_0xa197('0x3b')]){_0x19f84d[_0xa197('0x3c')]=_['merge'](_0x19f84d[_0xa197('0x3c')],{'$or':_[_0xa197('0x2a')](_0x19f84d[_0xa197('0x34')],function(_0xbd6694){var _0x5c216d={};_0x5c216d[_0xbd6694]={'$like':'%'+_0x296fe0[_0xa197('0x33')][_0xa197('0x3b')]+'%'};return _0x5c216d;})});}_0x19f84d=_[_0xa197('0x3d')]({},_0x19f84d,_0x296fe0[_0xa197('0x3f')]);return _0x425081[_0xa197('0x4f')](_0x19f84d);}})[_0xa197('0x27')](function(_0x40db4e){if(_0x40db4e){_0x229d1a=_0x40db4e[_0xa197('0x36')];if(!_0x296fe0[_0xa197('0x33')][_0xa197('0x4d')](_0xa197('0x37'))){_0x19f84d['limit']=qs[_0xa197('0x1f')](_0x296fe0[_0xa197('0x33')][_0xa197('0x1f')]);_0x19f84d[_0xa197('0x1d')]=qs[_0xa197('0x1d')](_0x296fe0[_0xa197('0x33')][_0xa197('0x1d')]);}return _0x425081[_0xa197('0x4f')](_0x19f84d);}})[_0xa197('0x27')](function(_0x48586a){if(_0x48586a){return _0x48586a?{'count':_0x229d1a,'rows':_0x48586a}:null;}})[_0xa197('0x27')](respondWithResult(_0x53cfbd,null))['catch'](handleError(_0x53cfbd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 0a3c0ca..e97f97a 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 _0x4380=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4fdaba,_0x5ba5de){var _0x4ead6a=function(_0x360617){while(--_0x360617){_0x4fdaba['push'](_0x4fdaba['shift']());}};_0x4ead6a(++_0x5ba5de);}(_0x4380,0xb6));var _0x0438=function(_0x20e6ba,_0x36bea0){_0x20e6ba=_0x20e6ba-0x0;var _0x248243=_0x4380[_0x20e6ba];return _0x248243;};'use strict';var _=require(_0x0438('0x0'));var util=require('util');var logger=require(_0x0438('0x1'))(_0x0438('0x2'));var moment=require(_0x0438('0x3'));var BPromise=require('bluebird');var rp=require(_0x0438('0x4'));var fs=require('fs');var path=require(_0x0438('0x5'));var rimraf=require(_0x0438('0x6'));var config=require(_0x0438('0x7'));var attributes=require(_0x0438('0x8'));module[_0x0438('0x9')]=function(_0x439287,_0x370ac0){return _0x439287[_0x0438('0xa')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39d7=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x39d7,0x106));var _0x739d=function(_0x280c89,_0x110c4b){_0x280c89=_0x280c89-0x0;var _0x15229d=_0x39d7[_0x280c89];return _0x15229d;};'use strict';var _=require(_0x739d('0x0'));var util=require(_0x739d('0x1'));var logger=require(_0x739d('0x2'))(_0x739d('0x3'));var moment=require(_0x739d('0x4'));var BPromise=require('bluebird');var rp=require(_0x739d('0x5'));var fs=require('fs');var path=require(_0x739d('0x6'));var rimraf=require(_0x739d('0x7'));var config=require(_0x739d('0x8'));var attributes=require(_0x739d('0x9'));module[_0x739d('0xa')]=function(_0x1e9259,_0x2190d5){return _0x1e9259['define'](_0x739d('0xb'),attributes,{'tableName':_0x739d('0xc'),'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 1e9dffa..b1e2b68 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 _0x4964=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x3e56f6,_0xa7a02d){var _0x3a32f=function(_0xb83e52){while(--_0xb83e52){_0x3e56f6['push'](_0x3e56f6['shift']());}};_0x3a32f(++_0xa7a02d);}(_0x4964,0x166));var _0x4496=function(_0x250393,_0x1f7ae1){_0x250393=_0x250393-0x0;var _0x2c1dc5=_0x4964[_0x250393];return _0x2c1dc5;};'use strict';var _=require('lodash');var util=require(_0x4496('0x0'));var moment=require('moment');var BPromise=require(_0x4496('0x1'));var rs=require(_0x4496('0x2'));var fs=require('fs');var Redis=require(_0x4496('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4496('0x4'));var logger=require(_0x4496('0x5'))(_0x4496('0x6'));var config=require('../../config/environment');var jayson=require(_0x4496('0x7'));var client=jayson['client'][_0x4496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b1293,_0x438754,_0x55386c){return new BPromise(function(_0x57a8e3,_0x40f2be){return client[_0x4496('0x9')](_0x8b1293,_0x55386c)[_0x4496('0xa')](function(_0x4fa972){logger[_0x4496('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,'request\x20sent');logger[_0x4496('0xc')](_0x4496('0xd'),_0x438754,_0x4496('0xe'),JSON[_0x4496('0xf')](_0x4fa972));if(_0x4fa972[_0x4496('0x10')]){if(_0x4fa972['error'][_0x4496('0x11')]===0x1f4){logger[_0x4496('0x10')](_0x4496('0x12'),_0x438754,_0x4fa972['error'][_0x4496('0x13')]);return _0x40f2be(_0x4fa972['error']['message']);}logger[_0x4496('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,_0x4fa972[_0x4496('0x10')][_0x4496('0x13')]);return _0x57a8e3(_0x4fa972[_0x4496('0x10')][_0x4496('0x13')]);}else{logger[_0x4496('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,'request\x20sent');_0x57a8e3(_0x4fa972['result'][_0x4496('0x13')]);}})[_0x4496('0x14')](function(_0x27f196){logger['error'](_0x4496('0x12'),_0x438754,_0x27f196);_0x40f2be(_0x27f196);});});} \ No newline at end of file +var _0xf879=['error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1ce10f,_0x40cd62){var _0x321c67=function(_0x3e2b1c){while(--_0x3e2b1c){_0x1ce10f['push'](_0x1ce10f['shift']());}};_0x321c67(++_0x40cd62);}(_0xf879,0x144));var _0x9f87=function(_0x413bcb,_0x1f0c5d){_0x413bcb=_0x413bcb-0x0;var _0x2b6048=_0xf879[_0x413bcb];return _0x2b6048;};'use strict';var _=require(_0x9f87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9f87('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f87('0x2'));var db=require(_0x9f87('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f87('0x4'))(_0x9f87('0x5'));var config=require(_0x9f87('0x6'));var jayson=require(_0x9f87('0x7'));var client=jayson[_0x9f87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20ca69,_0x42167c,_0x384422){return new BPromise(function(_0x4af083,_0x802eac){return client[_0x9f87('0x9')](_0x20ca69,_0x384422)[_0x9f87('0xa')](function(_0x3e69ab){logger[_0x9f87('0xb')](_0x9f87('0xc'),_0x42167c,_0x9f87('0xd'));logger[_0x9f87('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x42167c,_0x9f87('0xd'),JSON[_0x9f87('0xf')](_0x3e69ab));if(_0x3e69ab[_0x9f87('0x10')]){if(_0x3e69ab[_0x9f87('0x10')][_0x9f87('0x11')]===0x1f4){logger[_0x9f87('0x10')](_0x9f87('0xc'),_0x42167c,_0x3e69ab['error'][_0x9f87('0x12')]);return _0x802eac(_0x3e69ab['error'][_0x9f87('0x12')]);}logger[_0x9f87('0x10')](_0x9f87('0xc'),_0x42167c,_0x3e69ab['error']['message']);return _0x4af083(_0x3e69ab[_0x9f87('0x10')][_0x9f87('0x12')]);}else{logger[_0x9f87('0xb')](_0x9f87('0xc'),_0x42167c,_0x9f87('0xd'));_0x4af083(_0x3e69ab[_0x9f87('0x13')]['message']);}})['catch'](function(_0x388417){logger[_0x9f87('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x42167c,_0x388417);_0x802eac(_0x388417);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a29062b..1e96485 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 _0x8ea9=['delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated','post','create','put','/:id'];(function(_0x4303d0,_0x39c397){var _0x46a875=function(_0x3609ae){while(--_0x3609ae){_0x4303d0['push'](_0x4303d0['shift']());}};_0x46a875(++_0x39c397);}(_0x8ea9,0x7a));var _0x98ea=function(_0x3999d6,_0x419279){_0x3999d6=_0x3999d6-0x0;var _0x3c66d5=_0x8ea9[_0x3999d6];return _0x3c66d5;};'use strict';var multer=require(_0x98ea('0x0'));var util=require(_0x98ea('0x1'));var path=require(_0x98ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ea('0x3'));var router=express[_0x98ea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ea('0x5'));var controller=require(_0x98ea('0x6'));router[_0x98ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x98ea('0x8')]);router[_0x98ea('0x7')]('/:id',auth[_0x98ea('0x9')](),controller['show']);router[_0x98ea('0xa')]('/',auth[_0x98ea('0x9')](),controller[_0x98ea('0xb')]);router[_0x98ea('0xc')](_0x98ea('0xd'),auth[_0x98ea('0x9')](),controller['update']);router[_0x98ea('0xe')](_0x98ea('0xd'),auth[_0x98ea('0x9')](),controller[_0x98ea('0xf')]);module[_0x98ea('0x10')]=router; \ No newline at end of file +var _0x6068=['update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1ad46c,_0x50dd2c){var _0x38c8b3=function(_0x519d0f){while(--_0x519d0f){_0x1ad46c['push'](_0x1ad46c['shift']());}};_0x38c8b3(++_0x50dd2c);}(_0x6068,0xec));var _0x8606=function(_0x460bc6,_0x1aa092){_0x460bc6=_0x460bc6-0x0;var _0x120b0b=_0x6068[_0x460bc6];return _0x120b0b;};'use strict';var multer=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var path=require('path');var timeout=require(_0x8606('0x2'));var express=require(_0x8606('0x3'));var router=express[_0x8606('0x4')]();var fs_extra=require(_0x8606('0x5'));var auth=require(_0x8606('0x6'));var interaction=require(_0x8606('0x7'));var config=require(_0x8606('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x8606('0x9')]('/',auth[_0x8606('0xa')](),controller[_0x8606('0xb')]);router[_0x8606('0x9')](_0x8606('0xc'),auth[_0x8606('0xa')](),controller[_0x8606('0xd')]);router[_0x8606('0xe')]('/',auth[_0x8606('0xa')](),controller[_0x8606('0xf')]);router['put'](_0x8606('0xc'),auth[_0x8606('0xa')](),controller[_0x8606('0x10')]);router['delete'](_0x8606('0xc'),auth[_0x8606('0xa')](),controller['destroy']);module[_0x8606('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 907b614..7db754f 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 _0x1657=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x1657,0x1cc));var _0x7165=function(_0x37507d,_0x378385){_0x37507d=_0x37507d-0x0;var _0x1cd9ca=_0x1657[_0x37507d];return _0x1cd9ca;};'use strict';var Sequelize=require(_0x7165('0x0'));module['exports']={'type':{'type':Sequelize[_0x7165('0x1')](_0x7165('0x2'),_0x7165('0x3'),_0x7165('0x4'),_0x7165('0x5'),_0x7165('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7165('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7165('0x2'),_0x7165('0x3'),_0x7165('0x4'))},'keyContent':{'type':Sequelize[_0x7165('0x7')]},'idField':{'type':Sequelize[_0x7165('0x7')]},'nameField':{'type':Sequelize[_0x7165('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7165('0x7')]}}; \ No newline at end of file +var _0xbb60=['sequelize','exports','ENUM','variable','customVariable','string','STRING','BOOLEAN'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xbb60,0x188));var _0x0bb6=function(_0x2261fd,_0x43b60b){_0x2261fd=_0x2261fd-0x0;var _0xcff064=_0xbb60[_0x2261fd];return _0xcff064;};'use strict';var Sequelize=require(_0x0bb6('0x0'));module[_0x0bb6('0x1')]={'type':{'type':Sequelize[_0x0bb6('0x2')]('string',_0x0bb6('0x3'),_0x0bb6('0x4'),'keyValue','picklist'),'defaultValue':_0x0bb6('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0bb6('0x6')]},'keyType':{'type':Sequelize[_0x0bb6('0x2')](_0x0bb6('0x5'),_0x0bb6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0bb6('0x6')]},'idField':{'type':Sequelize[_0x0bb6('0x6')]},'nameField':{'type':Sequelize[_0x0bb6('0x6')]},'customField':{'type':Sequelize[_0x0bb6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0bb6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index dbebfa4..9d8cd75 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 _0x05b3=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SugarcrmField','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x05b3,0x1d0));var _0x305b=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x05b3[_0x4eaa4c];return _0x15aec6;};'use strict';var emlformat=require(_0x305b('0x0'));var rimraf=require(_0x305b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x305b('0x2'));var moment=require('moment');var BPromise=require(_0x305b('0x3'));var Mustache=require(_0x305b('0x4'));var util=require(_0x305b('0x5'));var path=require(_0x305b('0x6'));var sox=require(_0x305b('0x7'));var csv=require(_0x305b('0x8'));var ejs=require(_0x305b('0x9'));var fs=require('fs');var fs_extra=require(_0x305b('0xa'));var _=require(_0x305b('0xb'));var squel=require(_0x305b('0xc'));var crypto=require(_0x305b('0xd'));var jsforce=require(_0x305b('0xe'));var deskjs=require(_0x305b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x305b('0x10'));var Redis=require(_0x305b('0x11'));var authService=require(_0x305b('0x12'));var qs=require(_0x305b('0x13'));var as=require(_0x305b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x305b('0x15'));var utils=require(_0x305b('0x16'));var config=require(_0x305b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29fd24,_0x5d0798){_0x5d0798=_0x5d0798||0xcc;return function(_0x31b1f8){if(_0x31b1f8){return _0x29fd24[_0x305b('0x18')](_0x5d0798);}return _0x29fd24[_0x305b('0x19')](_0x5d0798)['end']();};}function respondWithResult(_0x5def36,_0x153fd1){_0x153fd1=_0x153fd1||0xc8;return function(_0x14d97f){if(_0x14d97f){return _0x5def36[_0x305b('0x19')](_0x153fd1)[_0x305b('0x1a')](_0x14d97f);}};}function respondWithFilteredResult(_0x279d2a,_0x270bd8){return function(_0x3ce981){if(_0x3ce981){var _0x3f0eda=typeof _0x270bd8['offset']===_0x305b('0x1b')&&typeof _0x270bd8[_0x305b('0x1c')]==='undefined';var _0x44fb41=_0x3ce981[_0x305b('0x1d')];var _0x216a34=_0x3f0eda?0x0:_0x270bd8[_0x305b('0x1e')];var _0x5afe72=_0x3f0eda?_0x3ce981[_0x305b('0x1d')]:_0x270bd8[_0x305b('0x1e')]+_0x270bd8['limit'];var _0x3d6afc;if(_0x5afe72>=_0x44fb41){_0x5afe72=_0x44fb41;_0x3d6afc=0xc8;}else{_0x3d6afc=0xce;}_0x279d2a['status'](_0x3d6afc);return _0x279d2a['set']('Content-Range',_0x216a34+'-'+_0x5afe72+'/'+_0x44fb41)[_0x305b('0x1a')](_0x3ce981);}return null;};}function patchUpdates(_0x31ddf6){return function(_0x15af42){try{jsonpatch['apply'](_0x15af42,_0x31ddf6,!![]);}catch(_0x10d1c4){return BPromise[_0x305b('0x1f')](_0x10d1c4);}return _0x15af42[_0x305b('0x20')]();};}function saveUpdates(_0x45bf62,_0x231d96){return function(_0x4d981c){if(_0x4d981c){return _0x4d981c['update'](_0x45bf62)['then'](function(_0x5952ed){return _0x5952ed;});}return null;};}function removeEntity(_0x35820a,_0x104051){return function(_0x2bb629){if(_0x2bb629){return _0x2bb629[_0x305b('0x21')]()[_0x305b('0x22')](function(){_0x35820a[_0x305b('0x19')](0xcc)[_0x305b('0x23')]();});}};}function handleEntityNotFound(_0x3f5e62,_0xeda069){return function(_0xa47b24){if(!_0xa47b24){_0x3f5e62[_0x305b('0x18')](0x194);}return _0xa47b24;};}function handleError(_0x554c2b,_0x489c2e){_0x489c2e=_0x489c2e||0x1f4;return function(_0x2a754a){logger[_0x305b('0x24')](_0x2a754a['stack']);if(_0x2a754a[_0x305b('0x25')]){delete _0x2a754a[_0x305b('0x25')];}_0x554c2b[_0x305b('0x19')](_0x489c2e)[_0x305b('0x26')](_0x2a754a);};}exports[_0x305b('0x27')]=function(_0x190383,_0x671c6f){var _0x4fe828={},_0x4a809f={},_0x143e95={'count':0x0,'rows':[]};var _0x2b4d0d=_[_0x305b('0x28')](db['SugarcrmField'][_0x305b('0x29')],function(_0x59595a){return{'name':_0x59595a[_0x305b('0x2a')],'type':_0x59595a['type'][_0x305b('0x2b')]};});_0x4a809f[_0x305b('0x2c')]=_[_0x305b('0x28')](_0x2b4d0d,_0x305b('0x25'));_0x4a809f[_0x305b('0x2d')]=_['keys'](_0x190383[_0x305b('0x2d')]);_0x4a809f[_0x305b('0x2e')]=_[_0x305b('0x2f')](_0x4a809f[_0x305b('0x2c')],_0x4a809f['query']);_0x4fe828['attributes']=_[_0x305b('0x2f')](_0x4a809f[_0x305b('0x2c')],qs[_0x305b('0x30')](_0x190383[_0x305b('0x2d')][_0x305b('0x30')]));_0x4fe828[_0x305b('0x31')]=_0x4fe828[_0x305b('0x31')][_0x305b('0x32')]?_0x4fe828[_0x305b('0x31')]:_0x4a809f[_0x305b('0x2c')];if(!_0x190383['query']['hasOwnProperty'](_0x305b('0x33'))){_0x4fe828['limit']=qs[_0x305b('0x1c')](_0x190383[_0x305b('0x2d')]['limit']);_0x4fe828[_0x305b('0x1e')]=qs[_0x305b('0x1e')](_0x190383[_0x305b('0x2d')][_0x305b('0x1e')]);}_0x4fe828[_0x305b('0x34')]=qs[_0x305b('0x35')](_0x190383[_0x305b('0x2d')][_0x305b('0x35')]);_0x4fe828[_0x305b('0x36')]=qs[_0x305b('0x2e')](_[_0x305b('0x37')](_0x190383[_0x305b('0x2d')],_0x4a809f[_0x305b('0x2e')]),_0x2b4d0d);if(_0x190383[_0x305b('0x2d')][_0x305b('0x38')]){_0x4fe828['where']=_[_0x305b('0x39')](_0x4fe828[_0x305b('0x36')],{'$or':_[_0x305b('0x28')](_0x2b4d0d,function(_0x48c8b4){if(_0x48c8b4[_0x305b('0x3a')]!==_0x305b('0x3b')){var _0x4a2a22={};_0x4a2a22[_0x48c8b4[_0x305b('0x25')]]={'$like':'%'+_0x190383[_0x305b('0x2d')][_0x305b('0x38')]+'%'};return _0x4a2a22;}})});}_0x4fe828=_[_0x305b('0x39')]({},_0x4fe828,_0x190383['options']);var _0x125e69={'where':_0x4fe828[_0x305b('0x36')]};return db[_0x305b('0x3c')]['count'](_0x125e69)['then'](function(_0x4ea489){_0x143e95[_0x305b('0x1d')]=_0x4ea489;if(_0x190383['query']['includeAll']){_0x4fe828[_0x305b('0x3d')]=[{'all':!![]}];}return db[_0x305b('0x3c')][_0x305b('0x3e')](_0x4fe828);})[_0x305b('0x22')](function(_0x1c6dc1){_0x143e95[_0x305b('0x3f')]=_0x1c6dc1;return _0x143e95;})[_0x305b('0x22')](respondWithFilteredResult(_0x671c6f,_0x4fe828))[_0x305b('0x40')](handleError(_0x671c6f,null));};exports[_0x305b('0x41')]=function(_0x1f481b,_0x478420){var _0x52787c={'raw':!![],'where':{'id':_0x1f481b[_0x305b('0x42')]['id']}},_0x49be92={};_0x49be92['model']=_[_0x305b('0x43')](db[_0x305b('0x3c')][_0x305b('0x29')]);_0x49be92['query']=_[_0x305b('0x43')](_0x1f481b[_0x305b('0x2d')]);_0x49be92[_0x305b('0x2e')]=_[_0x305b('0x2f')](_0x49be92['model'],_0x49be92[_0x305b('0x2d')]);_0x52787c[_0x305b('0x31')]=_['intersection'](_0x49be92[_0x305b('0x2c')],qs[_0x305b('0x30')](_0x1f481b[_0x305b('0x2d')]['fields']));_0x52787c['attributes']=_0x52787c[_0x305b('0x31')][_0x305b('0x32')]?_0x52787c['attributes']:_0x49be92[_0x305b('0x2c')];if(_0x1f481b[_0x305b('0x2d')]['includeAll']){_0x52787c[_0x305b('0x3d')]=[{'all':!![]}];}_0x52787c=_[_0x305b('0x39')]({},_0x52787c,_0x1f481b[_0x305b('0x44')]);return db[_0x305b('0x3c')][_0x305b('0x45')](_0x52787c)[_0x305b('0x22')](handleEntityNotFound(_0x478420,null))['then'](respondWithResult(_0x478420,null))[_0x305b('0x40')](handleError(_0x478420,null));};exports[_0x305b('0x46')]=function(_0x438d3a,_0x103056){return db['SugarcrmField'][_0x305b('0x46')](_0x438d3a[_0x305b('0x47')],{})[_0x305b('0x22')](respondWithResult(_0x103056,0xc9))[_0x305b('0x40')](handleError(_0x103056,null));};exports[_0x305b('0x48')]=function(_0x329397,_0x393b0f){if(_0x329397[_0x305b('0x47')]['id']){delete _0x329397[_0x305b('0x47')]['id'];}return db[_0x305b('0x3c')]['find']({'where':{'id':_0x329397[_0x305b('0x42')]['id']}})[_0x305b('0x22')](handleEntityNotFound(_0x393b0f,null))[_0x305b('0x22')](saveUpdates(_0x329397['body'],null))[_0x305b('0x22')](respondWithResult(_0x393b0f,null))['catch'](handleError(_0x393b0f,null));};exports[_0x305b('0x21')]=function(_0x41b838,_0x837b31){return db[_0x305b('0x3c')][_0x305b('0x45')]({'where':{'id':_0x41b838['params']['id']}})[_0x305b('0x22')](handleEntityNotFound(_0x837b31,null))[_0x305b('0x22')](removeEntity(_0x837b31,null))[_0x305b('0x40')](handleError(_0x837b31,null));}; \ No newline at end of file +var _0xa875=['find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','params','keys','includeAll'];(function(_0x532cbd,_0x381fda){var _0x298f6a=function(_0x398325){while(--_0x398325){_0x532cbd['push'](_0x532cbd['shift']());}};_0x298f6a(++_0x381fda);}(_0xa875,0xe5));var _0x5a87=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xa875[_0x3b3210];return _0x5b5484;};'use strict';var emlformat=require(_0x5a87('0x0'));var rimraf=require(_0x5a87('0x1'));var zipdir=require(_0x5a87('0x2'));var jsonpatch=require(_0x5a87('0x3'));var rp=require(_0x5a87('0x4'));var moment=require(_0x5a87('0x5'));var BPromise=require(_0x5a87('0x6'));var Mustache=require(_0x5a87('0x7'));var util=require(_0x5a87('0x8'));var path=require(_0x5a87('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a87('0xa'));var _=require(_0x5a87('0xb'));var squel=require(_0x5a87('0xc'));var crypto=require(_0x5a87('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5a87('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5a87('0xf'));var Papa=require(_0x5a87('0x10'));var Redis=require(_0x5a87('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5a87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a87('0x13'))(_0x5a87('0x14'));var utils=require(_0x5a87('0x15'));var config=require(_0x5a87('0x16'));var licenseUtil=require(_0x5a87('0x17'));var db=require(_0x5a87('0x18'))['db'];function respondWithStatusCode(_0x184024,_0x25897c){_0x25897c=_0x25897c||0xcc;return function(_0x5a0fa6){if(_0x5a0fa6){return _0x184024[_0x5a87('0x19')](_0x25897c);}return _0x184024[_0x5a87('0x1a')](_0x25897c)[_0x5a87('0x1b')]();};}function respondWithResult(_0x45d23b,_0x43693a){_0x43693a=_0x43693a||0xc8;return function(_0x4de2fc){if(_0x4de2fc){return _0x45d23b[_0x5a87('0x1a')](_0x43693a)[_0x5a87('0x1c')](_0x4de2fc);}};}function respondWithFilteredResult(_0xe9ed9f,_0xa37c6e){return function(_0xd299){if(_0xd299){var _0x3348a9=typeof _0xa37c6e[_0x5a87('0x1d')]===_0x5a87('0x1e')&&typeof _0xa37c6e['limit']===_0x5a87('0x1e');var _0x24ecf2=_0xd299[_0x5a87('0x1f')];var _0x41f755=_0x3348a9?0x0:_0xa37c6e[_0x5a87('0x1d')];var _0x362ff7=_0x3348a9?_0xd299['count']:_0xa37c6e[_0x5a87('0x1d')]+_0xa37c6e[_0x5a87('0x20')];var _0x3795e0;if(_0x362ff7>=_0x24ecf2){_0x362ff7=_0x24ecf2;_0x3795e0=0xc8;}else{_0x3795e0=0xce;}_0xe9ed9f[_0x5a87('0x1a')](_0x3795e0);return _0xe9ed9f[_0x5a87('0x21')]('Content-Range',_0x41f755+'-'+_0x362ff7+'/'+_0x24ecf2)[_0x5a87('0x1c')](_0xd299);}return null;};}function patchUpdates(_0x1d8b42){return function(_0x7e4d24){try{jsonpatch[_0x5a87('0x22')](_0x7e4d24,_0x1d8b42,!![]);}catch(_0x22354b){return BPromise[_0x5a87('0x23')](_0x22354b);}return _0x7e4d24[_0x5a87('0x24')]();};}function saveUpdates(_0x5db35d,_0x407e0a){return function(_0x1e2b5a){if(_0x1e2b5a){return _0x1e2b5a[_0x5a87('0x25')](_0x5db35d)[_0x5a87('0x26')](function(_0x36c65f){return _0x36c65f;});}return null;};}function removeEntity(_0x3de978,_0x2e4031){return function(_0x31571c){if(_0x31571c){return _0x31571c[_0x5a87('0x27')]()[_0x5a87('0x26')](function(){_0x3de978[_0x5a87('0x1a')](0xcc)[_0x5a87('0x1b')]();});}};}function handleEntityNotFound(_0xa44537,_0x5d6af1){return function(_0x1d98b5){if(!_0x1d98b5){_0xa44537[_0x5a87('0x19')](0x194);}return _0x1d98b5;};}function handleError(_0x1bd842,_0x2dafe3){_0x2dafe3=_0x2dafe3||0x1f4;return function(_0x32b982){logger[_0x5a87('0x28')](_0x32b982[_0x5a87('0x29')]);if(_0x32b982[_0x5a87('0x2a')]){delete _0x32b982[_0x5a87('0x2a')];}_0x1bd842[_0x5a87('0x1a')](_0x2dafe3)[_0x5a87('0x2b')](_0x32b982);};}exports[_0x5a87('0x2c')]=function(_0x5cddda,_0x2f619d){var _0x2caba0={},_0x2d2e62={},_0x5943c2={'count':0x0,'rows':[]};var _0x23237c=_['map'](db[_0x5a87('0x2d')]['rawAttributes'],function(_0x41746e){return{'name':_0x41746e[_0x5a87('0x2e')],'type':_0x41746e[_0x5a87('0x2f')][_0x5a87('0x30')]};});_0x2d2e62[_0x5a87('0x31')]=_['map'](_0x23237c,_0x5a87('0x2a'));_0x2d2e62['query']=_['keys'](_0x5cddda[_0x5a87('0x32')]);_0x2d2e62[_0x5a87('0x33')]=_[_0x5a87('0x34')](_0x2d2e62[_0x5a87('0x31')],_0x2d2e62[_0x5a87('0x32')]);_0x2caba0[_0x5a87('0x35')]=_['intersection'](_0x2d2e62['model'],qs['fields'](_0x5cddda[_0x5a87('0x32')][_0x5a87('0x36')]));_0x2caba0[_0x5a87('0x35')]=_0x2caba0[_0x5a87('0x35')][_0x5a87('0x37')]?_0x2caba0[_0x5a87('0x35')]:_0x2d2e62[_0x5a87('0x31')];if(!_0x5cddda['query'][_0x5a87('0x38')](_0x5a87('0x39'))){_0x2caba0['limit']=qs['limit'](_0x5cddda[_0x5a87('0x32')][_0x5a87('0x20')]);_0x2caba0[_0x5a87('0x1d')]=qs[_0x5a87('0x1d')](_0x5cddda['query']['offset']);}_0x2caba0[_0x5a87('0x3a')]=qs[_0x5a87('0x3b')](_0x5cddda[_0x5a87('0x32')]['sort']);_0x2caba0[_0x5a87('0x3c')]=qs[_0x5a87('0x33')](_[_0x5a87('0x3d')](_0x5cddda['query'],_0x2d2e62[_0x5a87('0x33')]),_0x23237c);if(_0x5cddda['query'][_0x5a87('0x3e')]){_0x2caba0['where']=_['merge'](_0x2caba0['where'],{'$or':_[_0x5a87('0x3f')](_0x23237c,function(_0x32ea9d){if(_0x32ea9d[_0x5a87('0x2f')]!==_0x5a87('0x40')){var _0x5dcb5f={};_0x5dcb5f[_0x32ea9d[_0x5a87('0x2a')]]={'$like':'%'+_0x5cddda[_0x5a87('0x32')][_0x5a87('0x3e')]+'%'};return _0x5dcb5f;}})});}_0x2caba0=_[_0x5a87('0x41')]({},_0x2caba0,_0x5cddda[_0x5a87('0x42')]);var _0x9a889={'where':_0x2caba0[_0x5a87('0x3c')]};return db[_0x5a87('0x2d')][_0x5a87('0x1f')](_0x9a889)[_0x5a87('0x26')](function(_0x4eb4b5){_0x5943c2[_0x5a87('0x1f')]=_0x4eb4b5;if(_0x5cddda[_0x5a87('0x32')]['includeAll']){_0x2caba0[_0x5a87('0x43')]=[{'all':!![]}];}return db[_0x5a87('0x2d')]['findAll'](_0x2caba0);})[_0x5a87('0x26')](function(_0x3d5634){_0x5943c2['rows']=_0x3d5634;return _0x5943c2;})[_0x5a87('0x26')](respondWithFilteredResult(_0x2f619d,_0x2caba0))['catch'](handleError(_0x2f619d,null));};exports['show']=function(_0x1d08f8,_0x354f8b){var _0x3d119b={'raw':!![],'where':{'id':_0x1d08f8[_0x5a87('0x44')]['id']}},_0x4fd580={};_0x4fd580['model']=_[_0x5a87('0x45')](db['SugarcrmField']['rawAttributes']);_0x4fd580[_0x5a87('0x32')]=_[_0x5a87('0x45')](_0x1d08f8[_0x5a87('0x32')]);_0x4fd580[_0x5a87('0x33')]=_['intersection'](_0x4fd580['model'],_0x4fd580[_0x5a87('0x32')]);_0x3d119b[_0x5a87('0x35')]=_[_0x5a87('0x34')](_0x4fd580[_0x5a87('0x31')],qs['fields'](_0x1d08f8[_0x5a87('0x32')][_0x5a87('0x36')]));_0x3d119b[_0x5a87('0x35')]=_0x3d119b[_0x5a87('0x35')][_0x5a87('0x37')]?_0x3d119b[_0x5a87('0x35')]:_0x4fd580[_0x5a87('0x31')];if(_0x1d08f8[_0x5a87('0x32')][_0x5a87('0x46')]){_0x3d119b['include']=[{'all':!![]}];}_0x3d119b=_['merge']({},_0x3d119b,_0x1d08f8[_0x5a87('0x42')]);return db['SugarcrmField'][_0x5a87('0x47')](_0x3d119b)[_0x5a87('0x26')](handleEntityNotFound(_0x354f8b,null))[_0x5a87('0x26')](respondWithResult(_0x354f8b,null))['catch'](handleError(_0x354f8b,null));};exports[_0x5a87('0x48')]=function(_0x4d2792,_0x38b791){return db['SugarcrmField'][_0x5a87('0x48')](_0x4d2792['body'],{})['then'](respondWithResult(_0x38b791,0xc9))['catch'](handleError(_0x38b791,null));};exports[_0x5a87('0x25')]=function(_0x12456d,_0x3d00e0){if(_0x12456d[_0x5a87('0x49')]['id']){delete _0x12456d['body']['id'];}return db['SugarcrmField'][_0x5a87('0x47')]({'where':{'id':_0x12456d[_0x5a87('0x44')]['id']}})[_0x5a87('0x26')](handleEntityNotFound(_0x3d00e0,null))[_0x5a87('0x26')](saveUpdates(_0x12456d[_0x5a87('0x49')],null))[_0x5a87('0x26')](respondWithResult(_0x3d00e0,null))['catch'](handleError(_0x3d00e0,null));};exports[_0x5a87('0x27')]=function(_0x21f2a6,_0x2d7354){return db[_0x5a87('0x2d')]['find']({'where':{'id':_0x21f2a6['params']['id']}})[_0x5a87('0x26')](handleEntityNotFound(_0x2d7354,null))[_0x5a87('0x26')](removeEntity(_0x2d7354,null))[_0x5a87('0x4a')](handleError(_0x2d7354,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d897db2..eb670e7 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 _0xc31b=['idField','FieldId','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x2bb57b,_0x502999){var _0x14c763=function(_0x4c11e6){while(--_0x4c11e6){_0x2bb57b['push'](_0x2bb57b['shift']());}};_0x14c763(++_0x502999);}(_0xc31b,0x9e));var _0xbc31=function(_0x1a932a,_0x32363c){_0x1a932a=_0x1a932a-0x0;var _0x41ce15=_0xc31b[_0x1a932a];return _0x41ce15;};'use strict';var _=require(_0xbc31('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbc31('0x1'));var rp=require(_0xbc31('0x2'));var fs=require('fs');var path=require(_0xbc31('0x3'));var rimraf=require(_0xbc31('0x4'));var config=require(_0xbc31('0x5'));var attributes=require(_0xbc31('0x6'));module[_0xbc31('0x7')]=function(_0x39cb7d,_0x1c4432){return _0x39cb7d[_0xbc31('0x8')](_0xbc31('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xbc31('0xa'),_0xbc31('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72c1=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','int_sugarcrm_fields','idField','FieldId','lodash','util'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x72c1,0x98));var _0x172c=function(_0x32948f,_0x563d32){_0x32948f=_0x32948f-0x0;var _0x1b3376=_0x72c1[_0x32948f];return _0x1b3376;};'use strict';var _=require(_0x172c('0x0'));var util=require(_0x172c('0x1'));var logger=require(_0x172c('0x2'))(_0x172c('0x3'));var moment=require(_0x172c('0x4'));var BPromise=require('bluebird');var rp=require(_0x172c('0x5'));var fs=require('fs');var path=require(_0x172c('0x6'));var rimraf=require(_0x172c('0x7'));var config=require(_0x172c('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x172c('0x9')]=function(_0x3c8f2b,_0x12cbd8){return _0x3c8f2b[_0x172c('0xa')]('SugarcrmField',attributes,{'tableName':_0x172c('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x172c('0xc'),_0x172c('0xd')],'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 f5f83c8..b3add36 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 _0xc49d=['../../config/environment','jayson/promise','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0xc49d,0x1b1));var _0xdc49=function(_0x3427e8,_0xdef4b1){_0x3427e8=_0x3427e8-0x0;var _0xe29f55=_0xc49d[_0x3427e8];return _0xe29f55;};'use strict';var _=require(_0xdc49('0x0'));var util=require(_0xdc49('0x1'));var moment=require(_0xdc49('0x2'));var BPromise=require(_0xdc49('0x3'));var rs=require(_0xdc49('0x4'));var fs=require('fs');var Redis=require(_0xdc49('0x5'));var db=require(_0xdc49('0x6'))['db'];var utils=require(_0xdc49('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc49('0x8'));var jayson=require(_0xdc49('0x9'));var client=jayson['client'][_0xdc49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x546bb9,_0x90207d,_0x588fba){return new BPromise(function(_0x40bb20,_0x3ac71c){return client['request'](_0x546bb9,_0x588fba)[_0xdc49('0xb')](function(_0x28e322){logger[_0xdc49('0xc')](_0xdc49('0xd'),_0x90207d,'request\x20sent');logger[_0xdc49('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x90207d,'request\x20sent',JSON['stringify'](_0x28e322));if(_0x28e322[_0xdc49('0xf')]){if(_0x28e322[_0xdc49('0xf')][_0xdc49('0x10')]===0x1f4){logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x28e322[_0xdc49('0xf')][_0xdc49('0x11')]);return _0x3ac71c(_0x28e322['error'][_0xdc49('0x11')]);}logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x28e322['error'][_0xdc49('0x11')]);return _0x40bb20(_0x28e322[_0xdc49('0xf')]['message']);}else{logger[_0xdc49('0xc')](_0xdc49('0xd'),_0x90207d,_0xdc49('0x12'));_0x40bb20(_0x28e322[_0xdc49('0x13')][_0xdc49('0x11')]);}})[_0xdc49('0x14')](function(_0x5c3a05){logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x5c3a05);_0x3ac71c(_0x5c3a05);});});} \ No newline at end of file +var _0x6b04=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x48aeef,_0x298484){var _0x3c70d1=function(_0x2d4083){while(--_0x2d4083){_0x48aeef['push'](_0x48aeef['shift']());}};_0x3c70d1(++_0x298484);}(_0x6b04,0x1ec));var _0x46b0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6b04[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x46b0('0x0'));var util=require(_0x46b0('0x1'));var moment=require('moment');var BPromise=require(_0x46b0('0x2'));var rs=require(_0x46b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46b0('0x5'))(_0x46b0('0x6'));var config=require(_0x46b0('0x7'));var jayson=require(_0x46b0('0x8'));var client=jayson[_0x46b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26da2c,_0x2771a1,_0x1b0a43){return new BPromise(function(_0x37f195,_0x38586a){return client[_0x46b0('0xa')](_0x26da2c,_0x1b0a43)[_0x46b0('0xb')](function(_0x45724c){logger[_0x46b0('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x2771a1,'request\x20sent');logger[_0x46b0('0xd')](_0x46b0('0xe'),_0x2771a1,_0x46b0('0xf'),JSON[_0x46b0('0x10')](_0x45724c));if(_0x45724c[_0x46b0('0x11')]){if(_0x45724c[_0x46b0('0x11')][_0x46b0('0x12')]===0x1f4){logger[_0x46b0('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x2771a1,_0x45724c['error']['message']);return _0x38586a(_0x45724c[_0x46b0('0x11')][_0x46b0('0x13')]);}logger[_0x46b0('0x11')](_0x46b0('0x14'),_0x2771a1,_0x45724c['error'][_0x46b0('0x13')]);return _0x37f195(_0x45724c[_0x46b0('0x11')]['message']);}else{logger[_0x46b0('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x2771a1,_0x46b0('0xf'));_0x37f195(_0x45724c[_0x46b0('0x15')][_0x46b0('0x13')]);}})[_0x46b0('0x16')](function(_0x3c2245){logger[_0x46b0('0x11')](_0x46b0('0x14'),_0x2771a1,_0x3c2245);_0x38586a(_0x3c2245);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 51c7850..826fb6a 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 _0x4d33=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','util','connect-timeout'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x4d33,0x1cc));var _0x34d3=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x4d33[_0x4d08b8];return _0x70214a;};'use strict';var multer=require('multer');var util=require(_0x34d3('0x0'));var path=require('path');var timeout=require(_0x34d3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x34d3('0x2'));var auth=require(_0x34d3('0x3'));var interaction=require(_0x34d3('0x4'));var config=require(_0x34d3('0x5'));var controller=require(_0x34d3('0x6'));router[_0x34d3('0x7')]('/',auth[_0x34d3('0x8')](),controller['index']);router[_0x34d3('0x7')](_0x34d3('0x9'),auth[_0x34d3('0x8')](),controller[_0x34d3('0xa')]);router['get']('/:id/configurations',auth[_0x34d3('0x8')](),controller['getConfigurations']);router[_0x34d3('0x7')](_0x34d3('0xb'),auth['isAuthenticated'](),controller[_0x34d3('0xc')]);router[_0x34d3('0xd')]('/',auth[_0x34d3('0x8')](),controller[_0x34d3('0xe')]);router[_0x34d3('0xd')](_0x34d3('0xf'),auth['isAuthenticated'](),controller[_0x34d3('0x10')]);router[_0x34d3('0x11')](_0x34d3('0x9'),auth[_0x34d3('0x8')](),controller[_0x34d3('0x12')]);router[_0x34d3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x34d3('0x14')]);module['exports']=router; \ No newline at end of file +var _0x984b=['/:id/configurations','put','update','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x984b,0xee));var _0xb984=function(_0x3323d2,_0x11f7da){_0x3323d2=_0x3323d2-0x0;var _0x557de0=_0x984b[_0x3323d2];return _0x557de0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['get'](_0xb984('0x7'),auth[_0xb984('0x5')](),controller['show']);router[_0xb984('0x8')]('/:id/configurations',auth[_0xb984('0x5')](),controller[_0xb984('0x9')]);router[_0xb984('0x8')](_0xb984('0xa'),auth[_0xb984('0x5')](),controller[_0xb984('0xb')]);router[_0xb984('0xc')]('/',auth[_0xb984('0x5')](),controller[_0xb984('0xd')]);router[_0xb984('0xc')](_0xb984('0xe'),auth[_0xb984('0x5')](),controller['addConfiguration']);router[_0xb984('0xf')]('/:id',auth[_0xb984('0x5')](),controller[_0xb984('0x10')]);router['delete'](_0xb984('0x7'),auth[_0xb984('0x5')](),controller['destroy']);module[_0xb984('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 837fe92..3ecffc5 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 _0x50a4=['STRING','HelpDesk','sequelize','exports'];(function(_0x2db93c,_0x3bc582){var _0x3c3bb4=function(_0x3f66a3){while(--_0x3f66a3){_0x2db93c['push'](_0x2db93c['shift']());}};_0x3c3bb4(++_0x3bc582);}(_0x50a4,0x156));var _0x450a=function(_0xe3487d,_0x357db7){_0xe3487d=_0xe3487d-0x0;var _0x584936=_0x50a4[_0xe3487d];return _0x584936;};'use strict';var Sequelize=require(_0x450a('0x0'));module[_0x450a('0x1')]={'name':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x450a('0x2')]},'username':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x450a('0x2')],'allowNull':![],'defaultValue':_0x450a('0x3')},'remoteUri':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x16bb=['STRING','HelpDesk','sequelize'];(function(_0x459cce,_0x4753dc){var _0x2d4906=function(_0x179b7c){while(--_0x179b7c){_0x459cce['push'](_0x459cce['shift']());}};_0x2d4906(++_0x4753dc);}(_0x16bb,0x12b));var _0xb16b=function(_0x148271,_0x1ba6b0){_0x148271=_0x148271-0x0;var _0x1b4dbf=_0x16bb[_0x148271];return _0x1b4dbf;};'use strict';var Sequelize=require(_0xb16b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb16b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb16b('0x1')]},'username':{'type':Sequelize[_0xb16b('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb16b('0x1')],'allowNull':![],'defaultValue':_0xb16b('0x2')},'remoteUri':{'type':Sequelize[_0xb16b('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xb16b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 50ae43b..2ee0080 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 _0xfdf1=['destroy','end','sendStatus','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','update','find','getConfigurations','findOne','keys','VtigerConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','%s/webservice.php','getchallenge','success','login','result','token','GET','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','reject','then'];(function(_0x325539,_0x36ad8f){var _0x47401d=function(_0x7ed46c){while(--_0x7ed46c){_0x325539['push'](_0x325539['shift']());}};_0x47401d(++_0x36ad8f);}(_0xfdf1,0x14a));var _0x1fdf=function(_0x1e1411,_0x545c3a){_0x1e1411=_0x1e1411-0x0;var _0x5920f1=_0xfdf1[_0x1e1411];return _0x5920f1;};'use strict';var emlformat=require(_0x1fdf('0x0'));var rimraf=require(_0x1fdf('0x1'));var zipdir=require(_0x1fdf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fdf('0x3'));var moment=require(_0x1fdf('0x4'));var BPromise=require(_0x1fdf('0x5'));var Mustache=require(_0x1fdf('0x6'));var util=require(_0x1fdf('0x7'));var path=require(_0x1fdf('0x8'));var sox=require(_0x1fdf('0x9'));var csv=require(_0x1fdf('0xa'));var ejs=require(_0x1fdf('0xb'));var fs=require('fs');var fs_extra=require(_0x1fdf('0xc'));var _=require(_0x1fdf('0xd'));var squel=require(_0x1fdf('0xe'));var crypto=require(_0x1fdf('0xf'));var jsforce=require(_0x1fdf('0x10'));var deskjs=require(_0x1fdf('0x11'));var toCsv=require(_0x1fdf('0xa'));var querystring=require(_0x1fdf('0x12'));var Papa=require('papaparse');var Redis=require(_0x1fdf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1fdf('0x14'));var as=require(_0x1fdf('0x15'));var hardwareService=require(_0x1fdf('0x16'));var logger=require(_0x1fdf('0x17'))(_0x1fdf('0x18'));var utils=require(_0x1fdf('0x19'));var config=require(_0x1fdf('0x1a'));var licenseUtil=require(_0x1fdf('0x1b'));var db=require(_0x1fdf('0x1c'))['db'];var integrations=require(_0x1fdf('0x1d'));function respondWithStatusCode(_0xf66176,_0x2e556a){_0x2e556a=_0x2e556a||0xcc;return function(_0xc39816){if(_0xc39816){return _0xf66176['sendStatus'](_0x2e556a);}return _0xf66176[_0x1fdf('0x1e')](_0x2e556a)['end']();};}function respondWithResult(_0x3346d2,_0x2c5d3d){_0x2c5d3d=_0x2c5d3d||0xc8;return function(_0x85856a){if(_0x85856a){return _0x3346d2[_0x1fdf('0x1e')](_0x2c5d3d)[_0x1fdf('0x1f')](_0x85856a);}};}function respondWithFilteredResult(_0x254a24,_0x50f1ba){return function(_0x538383){if(_0x538383){var _0x46529a=typeof _0x50f1ba[_0x1fdf('0x20')]===_0x1fdf('0x21')&&typeof _0x50f1ba[_0x1fdf('0x22')]===_0x1fdf('0x21');var _0x32c906=_0x538383[_0x1fdf('0x23')];var _0x5d8e23=_0x46529a?0x0:_0x50f1ba[_0x1fdf('0x20')];var _0x5a791a=_0x46529a?_0x538383[_0x1fdf('0x23')]:_0x50f1ba[_0x1fdf('0x20')]+_0x50f1ba[_0x1fdf('0x22')];var _0x16d561;if(_0x5a791a>=_0x32c906){_0x5a791a=_0x32c906;_0x16d561=0xc8;}else{_0x16d561=0xce;}_0x254a24['status'](_0x16d561);return _0x254a24[_0x1fdf('0x24')]('Content-Range',_0x5d8e23+'-'+_0x5a791a+'/'+_0x32c906)[_0x1fdf('0x1f')](_0x538383);}return null;};}function patchUpdates(_0x5733d4){return function(_0x2d6df2){try{jsonpatch['apply'](_0x2d6df2,_0x5733d4,!![]);}catch(_0x1100e2){return BPromise[_0x1fdf('0x25')](_0x1100e2);}return _0x2d6df2['save']();};}function saveUpdates(_0x4f3c75,_0x471081){return function(_0x2e3ed2){if(_0x2e3ed2){return _0x2e3ed2['update'](_0x4f3c75)[_0x1fdf('0x26')](function(_0x4ec686){return _0x4ec686;});}return null;};}function removeEntity(_0xb5947b,_0x38cfa4){return function(_0xbfad16){if(_0xbfad16){return _0xbfad16[_0x1fdf('0x27')]()[_0x1fdf('0x26')](function(){_0xb5947b[_0x1fdf('0x1e')](0xcc)[_0x1fdf('0x28')]();});}};}function handleEntityNotFound(_0x3ec701,_0x2337f2){return function(_0x4d6c95){if(!_0x4d6c95){_0x3ec701[_0x1fdf('0x29')](0x194);}return _0x4d6c95;};}function handleError(_0xdff439,_0x1f7f93){_0x1f7f93=_0x1f7f93||0x1f4;return function(_0x416aee){logger['error'](_0x416aee['stack']);if(_0x416aee[_0x1fdf('0x2a')]){delete _0x416aee[_0x1fdf('0x2a')];}_0xdff439['status'](_0x1f7f93)[_0x1fdf('0x2b')](_0x416aee);};}exports[_0x1fdf('0x2c')]=function(_0x38b76a,_0x4486fb){var _0x1b70de={},_0x25f9ca={},_0x32ae45={'count':0x0,'rows':[]};var _0x3a5a35=_[_0x1fdf('0x2d')](db[_0x1fdf('0x2e')]['rawAttributes'],function(_0x31d335){return{'name':_0x31d335[_0x1fdf('0x2f')],'type':_0x31d335[_0x1fdf('0x30')][_0x1fdf('0x31')]};});_0x25f9ca[_0x1fdf('0x32')]=_['map'](_0x3a5a35,_0x1fdf('0x2a'));_0x25f9ca[_0x1fdf('0x33')]=_['keys'](_0x38b76a[_0x1fdf('0x33')]);_0x25f9ca['filters']=_[_0x1fdf('0x34')](_0x25f9ca['model'],_0x25f9ca[_0x1fdf('0x33')]);_0x1b70de[_0x1fdf('0x35')]=_[_0x1fdf('0x34')](_0x25f9ca[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x36')]));_0x1b70de[_0x1fdf('0x35')]=_0x1b70de['attributes'][_0x1fdf('0x37')]?_0x1b70de[_0x1fdf('0x35')]:_0x25f9ca[_0x1fdf('0x32')];if(!_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x38')](_0x1fdf('0x39'))){_0x1b70de[_0x1fdf('0x22')]=qs[_0x1fdf('0x22')](_0x38b76a['query'][_0x1fdf('0x22')]);_0x1b70de[_0x1fdf('0x20')]=qs['offset'](_0x38b76a[_0x1fdf('0x33')]['offset']);}_0x1b70de[_0x1fdf('0x3a')]=qs[_0x1fdf('0x3b')](_0x38b76a[_0x1fdf('0x33')]['sort']);_0x1b70de[_0x1fdf('0x3c')]=qs['filters'](_[_0x1fdf('0x3d')](_0x38b76a[_0x1fdf('0x33')],_0x25f9ca[_0x1fdf('0x3e')]),_0x3a5a35);if(_0x38b76a[_0x1fdf('0x33')]['filter']){_0x1b70de[_0x1fdf('0x3c')]=_[_0x1fdf('0x3f')](_0x1b70de[_0x1fdf('0x3c')],{'$or':_['map'](_0x3a5a35,function(_0xd27e1c){if(_0xd27e1c[_0x1fdf('0x30')]!=='VIRTUAL'){var _0x528b35={};_0x528b35[_0xd27e1c['name']]={'$like':'%'+_0x38b76a['query']['filter']+'%'};return _0x528b35;}})});}_0x1b70de=_[_0x1fdf('0x3f')]({},_0x1b70de,_0x38b76a[_0x1fdf('0x40')]);var _0x45e69f={'where':_0x1b70de[_0x1fdf('0x3c')]};return db[_0x1fdf('0x2e')][_0x1fdf('0x23')](_0x45e69f)[_0x1fdf('0x26')](function(_0x30a8ba){_0x32ae45[_0x1fdf('0x23')]=_0x30a8ba;if(_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x41')]){_0x1b70de[_0x1fdf('0x42')]=[{'all':!![]}];}return db[_0x1fdf('0x2e')][_0x1fdf('0x43')](_0x1b70de);})[_0x1fdf('0x26')](function(_0x3aa0fb){_0x32ae45[_0x1fdf('0x44')]=_0x3aa0fb;return _0x32ae45;})['then'](respondWithFilteredResult(_0x4486fb,_0x1b70de))[_0x1fdf('0x45')](handleError(_0x4486fb,null));};exports['show']=function(_0x5367ae,_0x35f176){var _0x2a7884={'raw':![],'where':{'id':_0x5367ae[_0x1fdf('0x46')]['id']}},_0x34a841={};_0x34a841['model']=_['keys'](db['VtigerAccount'][_0x1fdf('0x47')]);_0x34a841['query']=_['keys'](_0x5367ae[_0x1fdf('0x33')]);_0x34a841['filters']=_[_0x1fdf('0x34')](_0x34a841[_0x1fdf('0x32')],_0x34a841['query']);_0x2a7884[_0x1fdf('0x35')]=_['intersection'](_0x34a841[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x5367ae['query'][_0x1fdf('0x36')]));_0x2a7884[_0x1fdf('0x35')]=_0x2a7884[_0x1fdf('0x35')][_0x1fdf('0x37')]?_0x2a7884[_0x1fdf('0x35')]:_0x34a841[_0x1fdf('0x32')];if(_0x5367ae[_0x1fdf('0x33')]['includeAll']){_0x2a7884[_0x1fdf('0x42')]=[{'all':!![]}];}_0x2a7884=_['merge']({},_0x2a7884,_0x5367ae['options']);return db[_0x1fdf('0x2e')]['find'](_0x2a7884)[_0x1fdf('0x26')](handleEntityNotFound(_0x35f176,null))['then'](respondWithResult(_0x35f176,null))[_0x1fdf('0x45')](handleError(_0x35f176,null));};exports[_0x1fdf('0x48')]=function(_0x4031ed,_0x2a349c){return db[_0x1fdf('0x2e')][_0x1fdf('0x48')](_0x4031ed[_0x1fdf('0x49')],{})[_0x1fdf('0x26')](respondWithResult(_0x2a349c,0xc9))[_0x1fdf('0x45')](handleError(_0x2a349c,null));};exports[_0x1fdf('0x4a')]=function(_0x31db01,_0x281045){if(_0x31db01[_0x1fdf('0x49')]['id']){delete _0x31db01['body']['id'];}return db['VtigerAccount'][_0x1fdf('0x4b')]({'where':{'id':_0x31db01[_0x1fdf('0x46')]['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x281045,null))[_0x1fdf('0x26')](saveUpdates(_0x31db01[_0x1fdf('0x49')],null))[_0x1fdf('0x26')](respondWithResult(_0x281045,null))[_0x1fdf('0x45')](handleError(_0x281045,null));};exports['destroy']=function(_0x2f5ffd,_0x136728){return db[_0x1fdf('0x2e')][_0x1fdf('0x4b')]({'where':{'id':_0x2f5ffd['params']['id']}})['then'](handleEntityNotFound(_0x136728,null))[_0x1fdf('0x26')](removeEntity(_0x136728,null))['catch'](handleError(_0x136728,null));};exports[_0x1fdf('0x4c')]=function(_0x5085f0,_0x59eb27,_0x5f4365){var _0x1ad5a8={};var _0x404d4b={};var _0x2708a8;var _0x4cf99b;return db[_0x1fdf('0x2e')][_0x1fdf('0x4d')]({'where':{'id':_0x5085f0['params']['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x59eb27,null))[_0x1fdf('0x26')](function(_0x27f4b9){if(_0x27f4b9){_0x2708a8=_0x27f4b9;_0x404d4b['model']=_[_0x1fdf('0x4e')](db[_0x1fdf('0x4f')][_0x1fdf('0x47')]);_0x404d4b[_0x1fdf('0x33')]=_[_0x1fdf('0x4e')](_0x5085f0[_0x1fdf('0x33')]);_0x404d4b[_0x1fdf('0x3e')]=_[_0x1fdf('0x34')](_0x404d4b[_0x1fdf('0x32')],_0x404d4b[_0x1fdf('0x33')]);_0x1ad5a8[_0x1fdf('0x35')]=_[_0x1fdf('0x34')](_0x404d4b[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x36')]));_0x1ad5a8[_0x1fdf('0x35')]=_0x1ad5a8[_0x1fdf('0x35')][_0x1fdf('0x37')]?_0x1ad5a8[_0x1fdf('0x35')]:_0x404d4b[_0x1fdf('0x32')];_0x1ad5a8['order']=qs['sort'](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x3b')]);_0x1ad5a8[_0x1fdf('0x3c')]=qs[_0x1fdf('0x3e')](_[_0x1fdf('0x3d')](_0x5085f0[_0x1fdf('0x33')],_0x404d4b[_0x1fdf('0x3e')]));if(_0x5085f0['query'][_0x1fdf('0x50')]){_0x1ad5a8[_0x1fdf('0x3c')]=_[_0x1fdf('0x3f')](_0x1ad5a8['where'],{'$or':_[_0x1fdf('0x2d')](_0x1ad5a8[_0x1fdf('0x35')],function(_0x583524){var _0x397365={};_0x397365[_0x583524]={'$like':'%'+_0x5085f0['query'][_0x1fdf('0x50')]+'%'};return _0x397365;})});}_0x1ad5a8=_[_0x1fdf('0x3f')]({},_0x1ad5a8,_0x5085f0[_0x1fdf('0x40')]);return _0x2708a8[_0x1fdf('0x4c')](_0x1ad5a8);}})[_0x1fdf('0x26')](function(_0x42c469){if(_0x42c469){_0x4cf99b=_0x42c469[_0x1fdf('0x37')];if(!_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x38')]('nolimit')){_0x1ad5a8[_0x1fdf('0x22')]=qs['limit'](_0x5085f0[_0x1fdf('0x33')]['limit']);_0x1ad5a8[_0x1fdf('0x20')]=qs['offset'](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x20')]);}return _0x2708a8[_0x1fdf('0x4c')](_0x1ad5a8);}})['then'](function(_0x134f64){if(_0x134f64){return _0x134f64?{'count':_0x4cf99b,'rows':_0x134f64}:null;}})[_0x1fdf('0x26')](respondWithResult(_0x59eb27,null))[_0x1fdf('0x45')](handleError(_0x59eb27,null));};exports[_0x1fdf('0x51')]=function(_0x194281,_0x18f070,_0x592c4d){if(_0x194281['body']['id']){delete _0x194281[_0x1fdf('0x49')]['id'];}return db[_0x1fdf('0x2e')][_0x1fdf('0x4d')]({'where':{'id':_0x194281[_0x1fdf('0x46')]['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x18f070,null))[_0x1fdf('0x26')](function(_0x5ec2a3){if(_0x5ec2a3){_0x194281[_0x1fdf('0x49')][_0x1fdf('0x52')]=_0x5ec2a3['id'];_0x194281[_0x1fdf('0x49')][_0x1fdf('0x53')]=integrations[_0x1fdf('0x54')](_0x194281['body'][_0x1fdf('0x55')],_0x194281[_0x1fdf('0x49')][_0x1fdf('0x30')]);_0x194281[_0x1fdf('0x49')]['Descriptions']=integrations[_0x1fdf('0x56')](_0x194281[_0x1fdf('0x49')][_0x1fdf('0x55')],_0x194281['body'][_0x1fdf('0x30')]);return db[_0x1fdf('0x4f')][_0x1fdf('0x48')](_0x194281[_0x1fdf('0x49')],{'include':[{'model':db[_0x1fdf('0x57')],'as':_0x1fdf('0x53')},{'model':db[_0x1fdf('0x57')],'as':'Descriptions'}]});}return null;})[_0x1fdf('0x26')](respondWithResult(_0x18f070,null))[_0x1fdf('0x45')](handleError(_0x18f070,null));};var md5=require('md5');exports[_0x1fdf('0x58')]=function(_0x5954ed,_0x3ef3c8,_0x3616d7){var _0x241a9f=null;var _0x30a5d1=null;var _0x101059=null;var _0x1b6ac7=null;var _0x41afdd='';return db['VtigerAccount'][_0x1fdf('0x4d')]({'where':{'id':_0x5954ed['params']['id']},'attributes':['id','name',_0x1fdf('0x59'),_0x1fdf('0x5a'),_0x1fdf('0x5b'),'remoteUri',_0x1fdf('0x5c'),_0x1fdf('0x5d')]})['then'](handleEntityNotFound(_0x3ef3c8,null))[_0x1fdf('0x26')](function(_0x45aa5f){if(_0x45aa5f){_0x241a9f=_0x45aa5f['username'];_0x30a5d1=_0x45aa5f[_0x1fdf('0x5d')];_0x101059=_0x45aa5f[_0x1fdf('0x5b')];_0x41afdd=_0x45aa5f[_0x1fdf('0x5e')];var _0x4edacd=_0x41afdd[_0x1fdf('0x5f')](-0x1);if(_0x4edacd==='/'){_0x41afdd=_0x41afdd[_0x1fdf('0x60')](0x0,_0x41afdd['lastIndexOf'](_0x4edacd));}_0x1b6ac7=util['format'](_0x1fdf('0x61'),_0x41afdd);var _0x43965f={'method':'GET','uri':_0x1b6ac7,'qs':{'operation':_0x1fdf('0x62'),'username':_0x45aa5f[_0x1fdf('0x59')]},'json':!![]};return rp(_0x43965f);}})['then'](function(_0x187cf7){if(_0x187cf7[_0x1fdf('0x63')]){var _0x212f99={'method':'POST','uri':_0x1b6ac7,'form':{'operation':_0x1fdf('0x64'),'username':_0x241a9f,'accessKey':md5(_0x187cf7[_0x1fdf('0x65')][_0x1fdf('0x66')]+_0x30a5d1)},'json':!![]};return rp(_0x212f99);}})['then'](function(_0x42b93c){if(_0x42b93c[_0x1fdf('0x63')]){var _0x439539={'method':_0x1fdf('0x67'),'uri':_0x1b6ac7,'qs':{'operation':_0x1fdf('0x68'),'username':_0x241a9f,'sessionName':_0x42b93c['result'][_0x1fdf('0x69')],'elementType':_0x101059},'json':!![]};return rp(_0x439539);}})[_0x1fdf('0x26')](function(_0x1e29be){if(_0x1e29be[_0x1fdf('0x63')]){var _0x5b6f87=[_0x1fdf('0x6a'),_0x1fdf('0x6b'),_0x1fdf('0x6c')];_[_0x1fdf('0x6d')](_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')],function(_0x561bbd){return _0x5b6f87[_0x1fdf('0x6e')](_0x561bbd[_0x1fdf('0x30')][_0x1fdf('0x2a')]);});_[_0x1fdf('0x6d')](_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')],function(_0x178ae0){return _0x178ae0[_0x1fdf('0x6f')]===_0x1fdf('0x70');});return{'count':_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')][_0x1fdf('0x37')],'rows':_[_0x1fdf('0x2d')](_0x1e29be[_0x1fdf('0x65')]['fields'],function(_0x3c732a){return{'id':_0x3c732a[_0x1fdf('0x2a')],'name':_0x3c732a['label'],'custom':_['startsWith'](_0x3c732a['name'],'cf_')?!![]:![],'options':_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x2a')]===_0x1fdf('0x71')&&_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x72')][_0x1fdf('0x37')]>0x0?_[_0x1fdf('0x2d')](_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x72')],function(_0xe021d9){return{'name':_0xe021d9['label'],'value':_0xe021d9[_0x1fdf('0x73')]};}):[]};})};}})[_0x1fdf('0x26')](respondWithResult(_0x3ef3c8,null))[_0x1fdf('0x45')](function(_0x210310){console[_0x1fdf('0x74')](_0x1fdf('0x75')+_0x210310);var _0xc46e9f=_0x5954ed[_0x1fdf('0x33')][_0x1fdf('0x76')]?0x1f4:_0x210310[_0x1fdf('0x77')]||0x1f4;logger['error'](_0x1fdf('0x78'),_0x1fdf('0x58'),_0xc46e9f,JSON[_0x1fdf('0x79')](_0x210310));delete _0x210310['name'];if(_0xc46e9f===0x191){_0xc46e9f=0x190;}_0x3ef3c8['status'](_0xc46e9f)[_0x1fdf('0x2b')](_0x5954ed['query'][_0x1fdf('0x76')]?{'message':_0x1fdf('0x7a'),'statusCode':_0x210310[_0x1fdf('0x77')]}:_0x210310);});}; \ No newline at end of file +var _0x8a69=['Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','describe','sessionName','autogenerated','includes','remove','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8a69,0x7d));var _0x98a6=function(_0x35e93f,_0x36f082){_0x35e93f=_0x35e93f-0x0;var _0x1113fc=_0x8a69[_0x35e93f];return _0x1113fc;};'use strict';var emlformat=require(_0x98a6('0x0'));var rimraf=require(_0x98a6('0x1'));var zipdir=require(_0x98a6('0x2'));var jsonpatch=require(_0x98a6('0x3'));var rp=require(_0x98a6('0x4'));var moment=require(_0x98a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98a6('0x6'));var util=require(_0x98a6('0x7'));var path=require(_0x98a6('0x8'));var sox=require(_0x98a6('0x9'));var csv=require(_0x98a6('0xa'));var ejs=require(_0x98a6('0xb'));var fs=require('fs');var fs_extra=require(_0x98a6('0xc'));var _=require(_0x98a6('0xd'));var squel=require(_0x98a6('0xe'));var crypto=require(_0x98a6('0xf'));var jsforce=require(_0x98a6('0x10'));var deskjs=require(_0x98a6('0x11'));var toCsv=require(_0x98a6('0xa'));var querystring=require(_0x98a6('0x12'));var Papa=require(_0x98a6('0x13'));var Redis=require('ioredis');var authService=require(_0x98a6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x98a6('0x15'));var hardwareService=require(_0x98a6('0x16'));var logger=require(_0x98a6('0x17'))(_0x98a6('0x18'));var utils=require(_0x98a6('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x98a6('0x1a'));var db=require(_0x98a6('0x1b'))['db'];var integrations=require(_0x98a6('0x1c'));function respondWithStatusCode(_0x2d2cad,_0x4f7eeb){_0x4f7eeb=_0x4f7eeb||0xcc;return function(_0x4b9dbb){if(_0x4b9dbb){return _0x2d2cad[_0x98a6('0x1d')](_0x4f7eeb);}return _0x2d2cad[_0x98a6('0x1e')](_0x4f7eeb)['end']();};}function respondWithResult(_0x1f2ff3,_0x4982d4){_0x4982d4=_0x4982d4||0xc8;return function(_0x5a438a){if(_0x5a438a){return _0x1f2ff3[_0x98a6('0x1e')](_0x4982d4)[_0x98a6('0x1f')](_0x5a438a);}};}function respondWithFilteredResult(_0x7c6710,_0x3d2e6b){return function(_0x170e2b){if(_0x170e2b){var _0x50955e=typeof _0x3d2e6b['offset']===_0x98a6('0x20')&&typeof _0x3d2e6b[_0x98a6('0x21')]===_0x98a6('0x20');var _0x32df8c=_0x170e2b[_0x98a6('0x22')];var _0x1e7067=_0x50955e?0x0:_0x3d2e6b[_0x98a6('0x23')];var _0x284ba8=_0x50955e?_0x170e2b[_0x98a6('0x22')]:_0x3d2e6b[_0x98a6('0x23')]+_0x3d2e6b[_0x98a6('0x21')];var _0x16106c;if(_0x284ba8>=_0x32df8c){_0x284ba8=_0x32df8c;_0x16106c=0xc8;}else{_0x16106c=0xce;}_0x7c6710['status'](_0x16106c);return _0x7c6710[_0x98a6('0x24')](_0x98a6('0x25'),_0x1e7067+'-'+_0x284ba8+'/'+_0x32df8c)[_0x98a6('0x1f')](_0x170e2b);}return null;};}function patchUpdates(_0x2f6247){return function(_0x41a07d){try{jsonpatch[_0x98a6('0x26')](_0x41a07d,_0x2f6247,!![]);}catch(_0xe3723b){return BPromise['reject'](_0xe3723b);}return _0x41a07d['save']();};}function saveUpdates(_0x5ef71c,_0x3c0288){return function(_0x1bbe24){if(_0x1bbe24){return _0x1bbe24[_0x98a6('0x27')](_0x5ef71c)[_0x98a6('0x28')](function(_0x11a3d6){return _0x11a3d6;});}return null;};}function removeEntity(_0x30d758,_0x74bc30){return function(_0x406744){if(_0x406744){return _0x406744['destroy']()[_0x98a6('0x28')](function(){_0x30d758[_0x98a6('0x1e')](0xcc)[_0x98a6('0x29')]();});}};}function handleEntityNotFound(_0x270029,_0x424482){return function(_0x5d7157){if(!_0x5d7157){_0x270029['sendStatus'](0x194);}return _0x5d7157;};}function handleError(_0x1a076d,_0x17bfe0){_0x17bfe0=_0x17bfe0||0x1f4;return function(_0x4d38d1){logger[_0x98a6('0x2a')](_0x4d38d1[_0x98a6('0x2b')]);if(_0x4d38d1[_0x98a6('0x2c')]){delete _0x4d38d1[_0x98a6('0x2c')];}_0x1a076d[_0x98a6('0x1e')](_0x17bfe0)['send'](_0x4d38d1);};}exports[_0x98a6('0x2d')]=function(_0x4de039,_0x382fa1){var _0x3aadfb={},_0x5deec8={},_0x320c3b={'count':0x0,'rows':[]};var _0x49b2e1=_[_0x98a6('0x2e')](db['VtigerAccount'][_0x98a6('0x2f')],function(_0x2d36cc){return{'name':_0x2d36cc[_0x98a6('0x30')],'type':_0x2d36cc[_0x98a6('0x31')][_0x98a6('0x32')]};});_0x5deec8[_0x98a6('0x33')]=_['map'](_0x49b2e1,'name');_0x5deec8[_0x98a6('0x34')]=_[_0x98a6('0x35')](_0x4de039[_0x98a6('0x34')]);_0x5deec8[_0x98a6('0x36')]=_[_0x98a6('0x37')](_0x5deec8[_0x98a6('0x33')],_0x5deec8[_0x98a6('0x34')]);_0x3aadfb[_0x98a6('0x38')]=_[_0x98a6('0x37')](_0x5deec8[_0x98a6('0x33')],qs['fields'](_0x4de039[_0x98a6('0x34')][_0x98a6('0x39')]));_0x3aadfb['attributes']=_0x3aadfb['attributes'][_0x98a6('0x3a')]?_0x3aadfb[_0x98a6('0x38')]:_0x5deec8[_0x98a6('0x33')];if(!_0x4de039[_0x98a6('0x34')]['hasOwnProperty'](_0x98a6('0x3b'))){_0x3aadfb[_0x98a6('0x21')]=qs[_0x98a6('0x21')](_0x4de039[_0x98a6('0x34')][_0x98a6('0x21')]);_0x3aadfb[_0x98a6('0x23')]=qs[_0x98a6('0x23')](_0x4de039[_0x98a6('0x34')][_0x98a6('0x23')]);}_0x3aadfb[_0x98a6('0x3c')]=qs[_0x98a6('0x3d')](_0x4de039['query'][_0x98a6('0x3d')]);_0x3aadfb[_0x98a6('0x3e')]=qs[_0x98a6('0x36')](_[_0x98a6('0x3f')](_0x4de039[_0x98a6('0x34')],_0x5deec8['filters']),_0x49b2e1);if(_0x4de039['query'][_0x98a6('0x40')]){_0x3aadfb['where']=_[_0x98a6('0x41')](_0x3aadfb['where'],{'$or':_[_0x98a6('0x2e')](_0x49b2e1,function(_0x340461){if(_0x340461[_0x98a6('0x31')]!==_0x98a6('0x42')){var _0x4c2041={};_0x4c2041[_0x340461[_0x98a6('0x2c')]]={'$like':'%'+_0x4de039[_0x98a6('0x34')][_0x98a6('0x40')]+'%'};return _0x4c2041;}})});}_0x3aadfb=_[_0x98a6('0x41')]({},_0x3aadfb,_0x4de039['options']);var _0x30aa78={'where':_0x3aadfb[_0x98a6('0x3e')]};return db[_0x98a6('0x43')][_0x98a6('0x22')](_0x30aa78)['then'](function(_0x56d5a4){_0x320c3b[_0x98a6('0x22')]=_0x56d5a4;if(_0x4de039[_0x98a6('0x34')][_0x98a6('0x44')]){_0x3aadfb[_0x98a6('0x45')]=[{'all':!![]}];}return db[_0x98a6('0x43')][_0x98a6('0x46')](_0x3aadfb);})[_0x98a6('0x28')](function(_0x15bcb9){_0x320c3b[_0x98a6('0x47')]=_0x15bcb9;return _0x320c3b;})['then'](respondWithFilteredResult(_0x382fa1,_0x3aadfb))[_0x98a6('0x48')](handleError(_0x382fa1,null));};exports[_0x98a6('0x49')]=function(_0x14eea2,_0x145742){var _0x2672f4={'raw':![],'where':{'id':_0x14eea2[_0x98a6('0x4a')]['id']}},_0x261202={};_0x261202[_0x98a6('0x33')]=_[_0x98a6('0x35')](db[_0x98a6('0x43')][_0x98a6('0x2f')]);_0x261202['query']=_[_0x98a6('0x35')](_0x14eea2[_0x98a6('0x34')]);_0x261202['filters']=_[_0x98a6('0x37')](_0x261202['model'],_0x261202[_0x98a6('0x34')]);_0x2672f4[_0x98a6('0x38')]=_['intersection'](_0x261202['model'],qs[_0x98a6('0x39')](_0x14eea2[_0x98a6('0x34')]['fields']));_0x2672f4[_0x98a6('0x38')]=_0x2672f4[_0x98a6('0x38')][_0x98a6('0x3a')]?_0x2672f4[_0x98a6('0x38')]:_0x261202[_0x98a6('0x33')];if(_0x14eea2[_0x98a6('0x34')][_0x98a6('0x44')]){_0x2672f4[_0x98a6('0x45')]=[{'all':!![]}];}_0x2672f4=_[_0x98a6('0x41')]({},_0x2672f4,_0x14eea2[_0x98a6('0x4b')]);return db[_0x98a6('0x43')][_0x98a6('0x4c')](_0x2672f4)[_0x98a6('0x28')](handleEntityNotFound(_0x145742,null))['then'](respondWithResult(_0x145742,null))[_0x98a6('0x48')](handleError(_0x145742,null));};exports[_0x98a6('0x4d')]=function(_0x18c62b,_0x377e83){return db[_0x98a6('0x43')][_0x98a6('0x4d')](_0x18c62b[_0x98a6('0x4e')],{})[_0x98a6('0x28')](respondWithResult(_0x377e83,0xc9))[_0x98a6('0x48')](handleError(_0x377e83,null));};exports[_0x98a6('0x27')]=function(_0x4a052c,_0x69af33){if(_0x4a052c[_0x98a6('0x4e')]['id']){delete _0x4a052c[_0x98a6('0x4e')]['id'];}return db['VtigerAccount'][_0x98a6('0x4c')]({'where':{'id':_0x4a052c[_0x98a6('0x4a')]['id']}})[_0x98a6('0x28')](handleEntityNotFound(_0x69af33,null))[_0x98a6('0x28')](saveUpdates(_0x4a052c[_0x98a6('0x4e')],null))[_0x98a6('0x28')](respondWithResult(_0x69af33,null))['catch'](handleError(_0x69af33,null));};exports[_0x98a6('0x4f')]=function(_0xd032fa,_0x2aa9b7){return db['VtigerAccount'][_0x98a6('0x4c')]({'where':{'id':_0xd032fa['params']['id']}})[_0x98a6('0x28')](handleEntityNotFound(_0x2aa9b7,null))[_0x98a6('0x28')](removeEntity(_0x2aa9b7,null))[_0x98a6('0x48')](handleError(_0x2aa9b7,null));};exports[_0x98a6('0x50')]=function(_0x1bca66,_0xe1599b,_0x99a550){var _0xcba56f={};var _0x6a1632={};var _0x3f09f7;var _0x151fef;return db[_0x98a6('0x43')][_0x98a6('0x51')]({'where':{'id':_0x1bca66[_0x98a6('0x4a')]['id']}})[_0x98a6('0x28')](handleEntityNotFound(_0xe1599b,null))[_0x98a6('0x28')](function(_0x3158ad){if(_0x3158ad){_0x3f09f7=_0x3158ad;_0x6a1632[_0x98a6('0x33')]=_[_0x98a6('0x35')](db['VtigerConfiguration'][_0x98a6('0x2f')]);_0x6a1632[_0x98a6('0x34')]=_[_0x98a6('0x35')](_0x1bca66['query']);_0x6a1632['filters']=_['intersection'](_0x6a1632[_0x98a6('0x33')],_0x6a1632[_0x98a6('0x34')]);_0xcba56f[_0x98a6('0x38')]=_[_0x98a6('0x37')](_0x6a1632[_0x98a6('0x33')],qs[_0x98a6('0x39')](_0x1bca66[_0x98a6('0x34')]['fields']));_0xcba56f[_0x98a6('0x38')]=_0xcba56f['attributes'][_0x98a6('0x3a')]?_0xcba56f[_0x98a6('0x38')]:_0x6a1632[_0x98a6('0x33')];_0xcba56f[_0x98a6('0x3c')]=qs[_0x98a6('0x3d')](_0x1bca66['query'][_0x98a6('0x3d')]);_0xcba56f[_0x98a6('0x3e')]=qs[_0x98a6('0x36')](_[_0x98a6('0x3f')](_0x1bca66['query'],_0x6a1632[_0x98a6('0x36')]));if(_0x1bca66[_0x98a6('0x34')][_0x98a6('0x40')]){_0xcba56f[_0x98a6('0x3e')]=_[_0x98a6('0x41')](_0xcba56f['where'],{'$or':_['map'](_0xcba56f[_0x98a6('0x38')],function(_0x2a6776){var _0x54ddf2={};_0x54ddf2[_0x2a6776]={'$like':'%'+_0x1bca66[_0x98a6('0x34')]['filter']+'%'};return _0x54ddf2;})});}_0xcba56f=_['merge']({},_0xcba56f,_0x1bca66[_0x98a6('0x4b')]);return _0x3f09f7['getConfigurations'](_0xcba56f);}})[_0x98a6('0x28')](function(_0x4aa9ca){if(_0x4aa9ca){_0x151fef=_0x4aa9ca[_0x98a6('0x3a')];if(!_0x1bca66[_0x98a6('0x34')][_0x98a6('0x52')](_0x98a6('0x3b'))){_0xcba56f['limit']=qs['limit'](_0x1bca66[_0x98a6('0x34')][_0x98a6('0x21')]);_0xcba56f['offset']=qs[_0x98a6('0x23')](_0x1bca66[_0x98a6('0x34')][_0x98a6('0x23')]);}return _0x3f09f7[_0x98a6('0x50')](_0xcba56f);}})['then'](function(_0x2cfb08){if(_0x2cfb08){return _0x2cfb08?{'count':_0x151fef,'rows':_0x2cfb08}:null;}})[_0x98a6('0x28')](respondWithResult(_0xe1599b,null))[_0x98a6('0x48')](handleError(_0xe1599b,null));};exports[_0x98a6('0x53')]=function(_0x555fd0,_0x232d06,_0x569c1d){if(_0x555fd0[_0x98a6('0x4e')]['id']){delete _0x555fd0[_0x98a6('0x4e')]['id'];}return db[_0x98a6('0x43')][_0x98a6('0x51')]({'where':{'id':_0x555fd0['params']['id']}})[_0x98a6('0x28')](handleEntityNotFound(_0x232d06,null))[_0x98a6('0x28')](function(_0x32cc5b){if(_0x32cc5b){_0x555fd0[_0x98a6('0x4e')][_0x98a6('0x54')]=_0x32cc5b['id'];_0x555fd0['body'][_0x98a6('0x55')]=integrations[_0x98a6('0x56')](_0x555fd0[_0x98a6('0x4e')][_0x98a6('0x57')],_0x555fd0[_0x98a6('0x4e')][_0x98a6('0x31')]);_0x555fd0[_0x98a6('0x4e')][_0x98a6('0x58')]=integrations['getDescriptions'](_0x555fd0['body'][_0x98a6('0x57')],_0x555fd0[_0x98a6('0x4e')]['type']);return db['VtigerConfiguration'][_0x98a6('0x4d')](_0x555fd0[_0x98a6('0x4e')],{'include':[{'model':db[_0x98a6('0x59')],'as':'Subjects'},{'model':db[_0x98a6('0x59')],'as':_0x98a6('0x58')}]});}return null;})[_0x98a6('0x28')](respondWithResult(_0x232d06,null))[_0x98a6('0x48')](handleError(_0x232d06,null));};var md5=require('md5');exports[_0x98a6('0x5a')]=function(_0x1e195a,_0x5e5e05,_0x26193b){var _0x3dfeb5=null;var _0x315771=null;var _0x3e91cf=null;var _0x4922bf=null;var _0x11f47c='';return db[_0x98a6('0x43')][_0x98a6('0x51')]({'where':{'id':_0x1e195a['params']['id']},'attributes':['id',_0x98a6('0x2c'),_0x98a6('0x5b'),_0x98a6('0x5c'),_0x98a6('0x5d'),_0x98a6('0x5e'),_0x98a6('0x5f'),_0x98a6('0x60')]})['then'](handleEntityNotFound(_0x5e5e05,null))[_0x98a6('0x28')](function(_0x4f9611){if(_0x4f9611){_0x3dfeb5=_0x4f9611[_0x98a6('0x5b')];_0x315771=_0x4f9611['accessKey'];_0x3e91cf=_0x4f9611[_0x98a6('0x5d')];_0x11f47c=_0x4f9611[_0x98a6('0x5e')];var _0x5c6931=_0x11f47c[_0x98a6('0x61')](-0x1);if(_0x5c6931==='/'){_0x11f47c=_0x11f47c['substring'](0x0,_0x11f47c['lastIndexOf'](_0x5c6931));}_0x4922bf=util['format'](_0x98a6('0x62'),_0x11f47c);var _0xf74529={'method':'GET','uri':_0x4922bf,'qs':{'operation':_0x98a6('0x63'),'username':_0x4f9611[_0x98a6('0x5b')]},'json':!![]};return rp(_0xf74529);}})[_0x98a6('0x28')](function(_0x3669ba){if(_0x3669ba[_0x98a6('0x64')]){var _0x19b612={'method':_0x98a6('0x65'),'uri':_0x4922bf,'form':{'operation':_0x98a6('0x66'),'username':_0x3dfeb5,'accessKey':md5(_0x3669ba[_0x98a6('0x67')][_0x98a6('0x68')]+_0x315771)},'json':!![]};return rp(_0x19b612);}})[_0x98a6('0x28')](function(_0x3f04e3){if(_0x3f04e3[_0x98a6('0x64')]){var _0x5bad1b={'method':_0x98a6('0x69'),'uri':_0x4922bf,'qs':{'operation':_0x98a6('0x6a'),'username':_0x3dfeb5,'sessionName':_0x3f04e3[_0x98a6('0x67')][_0x98a6('0x6b')],'elementType':_0x3e91cf},'json':!![]};return rp(_0x5bad1b);}})[_0x98a6('0x28')](function(_0x4de192){if(_0x4de192[_0x98a6('0x64')]){var _0x54850=[_0x98a6('0x6c'),'reference','owner'];_['remove'](_0x4de192['result']['fields'],function(_0x2df394){return _0x54850[_0x98a6('0x6d')](_0x2df394[_0x98a6('0x31')]['name']);});_[_0x98a6('0x6e')](_0x4de192[_0x98a6('0x67')][_0x98a6('0x39')],function(_0x29f9be){return _0x29f9be['editable']===_0x98a6('0x6f');});return{'count':_0x4de192['result'][_0x98a6('0x39')][_0x98a6('0x3a')],'rows':_[_0x98a6('0x2e')](_0x4de192['result'][_0x98a6('0x39')],function(_0x3d1a77){return{'id':_0x3d1a77['name'],'name':_0x3d1a77[_0x98a6('0x70')],'custom':_[_0x98a6('0x71')](_0x3d1a77['name'],'cf_')?!![]:![],'options':_0x3d1a77[_0x98a6('0x31')][_0x98a6('0x2c')]===_0x98a6('0x72')&&_0x3d1a77[_0x98a6('0x31')][_0x98a6('0x73')]['length']>0x0?_[_0x98a6('0x2e')](_0x3d1a77[_0x98a6('0x31')][_0x98a6('0x73')],function(_0x21c0ba){return{'name':_0x21c0ba[_0x98a6('0x70')],'value':_0x21c0ba[_0x98a6('0x74')]};}):[]};})};}})[_0x98a6('0x28')](respondWithResult(_0x5e5e05,null))[_0x98a6('0x48')](function(_0xe2ac3e){console[_0x98a6('0x75')](_0x98a6('0x76')+_0xe2ac3e);var _0x5c7665=_0x1e195a[_0x98a6('0x34')][_0x98a6('0x77')]?0x1f4:_0xe2ac3e[_0x98a6('0x78')]||0x1f4;logger[_0x98a6('0x2a')](_0x98a6('0x79'),_0x98a6('0x5a'),_0x5c7665,JSON[_0x98a6('0x7a')](_0xe2ac3e));delete _0xe2ac3e['name'];if(_0x5c7665===0x191){_0x5c7665=0x190;}_0x5e5e05[_0x98a6('0x1e')](_0x5c7665)['send'](_0x1e195a[_0x98a6('0x34')][_0x98a6('0x77')]?{'message':_0x98a6('0x7b'),'statusCode':_0xe2ac3e[_0x98a6('0x78')]}:_0xe2ac3e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 822cb77..2e91693 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 _0x06a9=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define'];(function(_0x5f24d5,_0xc1ee18){var _0x21701c=function(_0x12d3ff){while(--_0x12d3ff){_0x5f24d5['push'](_0x5f24d5['shift']());}};_0x21701c(++_0xc1ee18);}(_0x06a9,0xb7));var _0x906a=function(_0x26a815,_0xcde2b9){_0x26a815=_0x26a815-0x0;var _0x539ed1=_0x06a9[_0x26a815];return _0x539ed1;};'use strict';var _=require(_0x906a('0x0'));var util=require(_0x906a('0x1'));var logger=require(_0x906a('0x2'))(_0x906a('0x3'));var moment=require('moment');var BPromise=require(_0x906a('0x4'));var rp=require(_0x906a('0x5'));var fs=require('fs');var path=require(_0x906a('0x6'));var rimraf=require(_0x906a('0x7'));var config=require(_0x906a('0x8'));var attributes=require(_0x906a('0x9'));var integrations=require(_0x906a('0xa'));module['exports']=function(_0x3bf133,_0x2c633c){return _0x3bf133[_0x906a('0xb')]('VtigerAccount',attributes,{'tableName':_0x906a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd807=['path','rimraf','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x10d24b,_0x2b0995){var _0x3e4669=function(_0x37144f){while(--_0x37144f){_0x10d24b['push'](_0x10d24b['shift']());}};_0x3e4669(++_0x2b0995);}(_0xd807,0x96));var _0x7d80=function(_0xc893e2,_0x1e5774){_0xc893e2=_0xc893e2-0x0;var _0x55da13=_0xd807[_0xc893e2];return _0x55da13;};'use strict';var _=require(_0x7d80('0x0'));var util=require(_0x7d80('0x1'));var logger=require(_0x7d80('0x2'))('api');var moment=require(_0x7d80('0x3'));var BPromise=require(_0x7d80('0x4'));var rp=require(_0x7d80('0x5'));var fs=require('fs');var path=require(_0x7d80('0x6'));var rimraf=require(_0x7d80('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x7d80('0x8'));module[_0x7d80('0x9')]=function(_0x4f60ba,_0xdf0ad8){return _0x4f60ba[_0x7d80('0xa')](_0x7d80('0xb'),attributes,{'tableName':_0x7d80('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 a61f293..81f2dde 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 _0x7af2=['ShowVtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','stringify','find','raw'];(function(_0x2c48b9,_0x5d7612){var _0x45023d=function(_0x36c2b3){while(--_0x36c2b3){_0x2c48b9['push'](_0x2c48b9['shift']());}};_0x45023d(++_0x5d7612);}(_0x7af2,0x119));var _0x27af=function(_0x60dc6f,_0x2c22a1){_0x60dc6f=_0x60dc6f-0x0;var _0x36bba0=_0x7af2[_0x60dc6f];return _0x36bba0;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});}exports[_0x27af('0x14')]=function(_0x31d702){var _0x5997ae=this;return new Promise(function(_0x4e6e2f,_0x20a6d7){return db[_0x27af('0x15')][_0x27af('0x16')]({'raw':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')][_0x27af('0x18')]||null:null,'attributes':_0x31d702['options']?_0x31d702[_0x27af('0x17')][_0x27af('0x19')]||null:null,'limit':_0x31d702[_0x27af('0x17')]?_0x31d702['options'][_0x27af('0x1a')]||null:null,'include':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')][_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x31d702[_0x27af('0x17')][_0x27af('0x1b')],function(_0x35b36d){return{'model':db[_0x35b36d[_0x27af('0x1d')]],'as':_0x35b36d['as'],'attributes':_0x35b36d['attributes'],'include':_0x35b36d['include']?_['map'](_0x35b36d[_0x27af('0x1b')],function(_0x4feaf1){return{'model':db[_0x4feaf1[_0x27af('0x1d')]],'as':_0x4feaf1['as'],'attributes':_0x4feaf1[_0x27af('0x19')],'include':_0x4feaf1['include']?_[_0x27af('0x1c')](_0x4feaf1[_0x27af('0x1b')],function(_0x463e36){return{'model':db[_0x463e36[_0x27af('0x1d')]],'as':_0x463e36['as'],'attributes':_0x463e36[_0x27af('0x19')]};}):[]};}):[]};}):[]:[]})[_0x27af('0xc')](function(_0x775d4e){logger['info'](_0x27af('0x14'),_0x31d702);logger[_0x27af('0x1e')](_0x27af('0x14'),_0x31d702,JSON[_0x27af('0x1f')](_0x775d4e));_0x4e6e2f(_0x775d4e);})[_0x27af('0x13')](function(_0xa08dd9){logger[_0x27af('0xf')](_0x27af('0x14'),_0xa08dd9[_0x27af('0x10')],_0x31d702);_0x20a6d7(_0x5997ae[_0x27af('0xf')](0x1f4,_0xa08dd9[_0x27af('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x15e867){var _0x14b2e7=this;return new Promise(function(_0x3800a1,_0x575887){return db[_0x27af('0x15')][_0x27af('0x20')]({'raw':_0x15e867['options']?_0x15e867['options'][_0x27af('0x21')]===undefined?!![]:![]:!![],'where':_0x15e867[_0x27af('0x17')]?_0x15e867['options'][_0x27af('0x18')]||null:null,'attributes':_0x15e867[_0x27af('0x17')]?_0x15e867[_0x27af('0x17')][_0x27af('0x19')]||null:null,'include':_0x15e867[_0x27af('0x17')]?_0x15e867[_0x27af('0x17')][_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x15e867[_0x27af('0x17')][_0x27af('0x1b')],function(_0x13c97d){return{'model':db[_0x13c97d['model']],'as':_0x13c97d['as'],'attributes':_0x13c97d['attributes'],'include':_0x13c97d[_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x13c97d['include'],function(_0x2dd799){return{'model':db[_0x2dd799[_0x27af('0x1d')]],'as':_0x2dd799['as'],'attributes':_0x2dd799['attributes'],'include':_0x2dd799[_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x2dd799[_0x27af('0x1b')],function(_0x329d06){return{'model':db[_0x329d06[_0x27af('0x1d')]],'as':_0x329d06['as'],'attributes':_0x329d06['attributes']};}):[]};}):[]};}):[]:[]})[_0x27af('0xc')](function(_0x468cea){logger['info']('ShowVtigerAccount',_0x15e867);logger[_0x27af('0x1e')](_0x27af('0x22'),_0x15e867,JSON[_0x27af('0x1f')](_0x468cea));_0x3800a1(_0x468cea);})[_0x27af('0x13')](function(_0x467891){logger[_0x27af('0xf')]('ShowVtigerAccount',_0x467891[_0x27af('0x10')],_0x15e867);_0x575887(_0x14b2e7['error'](0x1f4,_0x467891[_0x27af('0x10')]));});});}; \ No newline at end of file +var _0xe205=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','options','raw','where','include','map','model','attributes','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0xe205,0xa7));var _0x5e20=function(_0x5f438b,_0xf50a97){_0x5f438b=_0x5f438b-0x0;var _0x2fb15a=_0xe205[_0x5f438b];return _0x2fb15a;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['findAll']({'raw':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706['options'][_0x5e20('0x1c')]||null:null,'attributes':_0x1cc706['options']?_0x1cc706['options']['attributes']||null:null,'limit':_0x1cc706['options']?_0x1cc706[_0x5e20('0x1a')]['limit']||null:null,'include':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')],function(_0x4c5732){return{'model':db[_0x4c5732[_0x5e20('0x1f')]],'as':_0x4c5732['as'],'attributes':_0x4c5732['attributes'],'include':_0x4c5732['include']?_[_0x5e20('0x1e')](_0x4c5732[_0x5e20('0x1d')],function(_0x2bae08){return{'model':db[_0x2bae08[_0x5e20('0x1f')]],'as':_0x2bae08['as'],'attributes':_0x2bae08[_0x5e20('0x20')],'include':_0x2bae08[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2bae08['include'],function(_0x3bf4f4){return{'model':db[_0x3bf4f4[_0x5e20('0x1f')]],'as':_0x3bf4f4['as'],'attributes':_0x3bf4f4[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5e20('0xe')](function(_0x4c799d){logger[_0x5e20('0xf')](_0x5e20('0x18'),_0x1cc706);logger[_0x5e20('0x12')](_0x5e20('0x18'),_0x1cc706,JSON[_0x5e20('0x13')](_0x4c799d));_0x4d3e4a(_0x4c799d);})[_0x5e20('0x17')](function(_0x5ec45b){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x5ec45b['message'],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x5ec45b[_0x5e20('0x16')]));});});};exports[_0x5e20('0x21')]=function(_0x4196a3){var _0x1548c8=this;return new Promise(function(_0x395a27,_0x4ff715){return db[_0x5e20('0x19')][_0x5e20('0x22')]({'raw':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1c')]||null:null,'attributes':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x20')]||null:null,'include':_0x4196a3['options']?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x4196a3['options'][_0x5e20('0x1d')],function(_0x2d397b){return{'model':db[_0x2d397b[_0x5e20('0x1f')]],'as':_0x2d397b['as'],'attributes':_0x2d397b[_0x5e20('0x20')],'include':_0x2d397b[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2d397b[_0x5e20('0x1d')],function(_0x173165){return{'model':db[_0x173165[_0x5e20('0x1f')]],'as':_0x173165['as'],'attributes':_0x173165[_0x5e20('0x20')],'include':_0x173165[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x173165[_0x5e20('0x1d')],function(_0x255b67){return{'model':db[_0x255b67['model']],'as':_0x255b67['as'],'attributes':_0x255b67[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549f01){logger[_0x5e20('0xf')](_0x5e20('0x21'),_0x4196a3);logger['debug'](_0x5e20('0x21'),_0x4196a3,JSON[_0x5e20('0x13')](_0x549f01));_0x395a27(_0x549f01);})['catch'](function(_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x21'),_0x3f3908[_0x5e20('0x16')],_0x4196a3);_0x4ff715(_0x1548c8[_0x5e20('0x14')](0x1f4,_0x3f3908[_0x5e20('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 3daa2ab..56ae0c6 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 _0x47a0=['getDescriptions','post','create','/:id','update','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x47a0,0x1d4));var _0x047a=function(_0x76a521,_0x4d5fc6){_0x76a521=_0x76a521-0x0;var _0x1a2121=_0x47a0[_0x76a521];return _0x1a2121;};'use strict';var multer=require(_0x047a('0x0'));var util=require('util');var path=require(_0x047a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x047a('0x2')]();var fs_extra=require(_0x047a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x047a('0x4'));var config=require(_0x047a('0x5'));var controller=require(_0x047a('0x6'));router[_0x047a('0x7')]('/',auth[_0x047a('0x8')](),controller[_0x047a('0x9')]);router['get']('/:id',auth[_0x047a('0x8')](),controller[_0x047a('0xa')]);router['get'](_0x047a('0xb'),auth[_0x047a('0x8')](),controller[_0x047a('0xc')]);router[_0x047a('0x7')](_0x047a('0xd'),auth[_0x047a('0x8')](),controller[_0x047a('0xe')]);router[_0x047a('0x7')](_0x047a('0xf'),auth[_0x047a('0x8')](),controller[_0x047a('0x10')]);router[_0x047a('0x11')]('/',auth['isAuthenticated'](),controller[_0x047a('0x12')]);router['put'](_0x047a('0x13'),auth[_0x047a('0x8')](),controller[_0x047a('0x14')]);router['delete']('/:id',auth[_0x047a('0x8')](),controller['destroy']);module[_0x047a('0x15')]=router; \ No newline at end of file +var _0x8f3e=['put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x8f3e,0xca));var _0xe8f3=function(_0x1b3b2e,_0x3501b4){_0x1b3b2e=_0x1b3b2e-0x0;var _0x10b6dd=_0x8f3e[_0x1b3b2e];return _0x10b6dd;};'use strict';var multer=require(_0xe8f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe8f3('0x1'));var express=require(_0xe8f3('0x2'));var router=express[_0xe8f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe8f3('0x4'));var interaction=require(_0xe8f3('0x5'));var config=require(_0xe8f3('0x6'));var controller=require(_0xe8f3('0x7'));router[_0xe8f3('0x8')]('/',auth[_0xe8f3('0x9')](),controller[_0xe8f3('0xa')]);router['get'](_0xe8f3('0xb'),auth[_0xe8f3('0x9')](),controller[_0xe8f3('0xc')]);router['get']('/:id/fields',auth[_0xe8f3('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xe8f3('0x9')](),controller[_0xe8f3('0xd')]);router[_0xe8f3('0x8')](_0xe8f3('0xe'),auth[_0xe8f3('0x9')](),controller[_0xe8f3('0xf')]);router[_0xe8f3('0x10')]('/',auth[_0xe8f3('0x9')](),controller[_0xe8f3('0x11')]);router[_0xe8f3('0x12')]('/:id',auth[_0xe8f3('0x9')](),controller[_0xe8f3('0x13')]);router['delete'](_0xe8f3('0xb'),auth[_0xe8f3('0x9')](),controller[_0xe8f3('0x14')]);module[_0xe8f3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 188af9c..91ef0bb 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 _0xd725=['sequelize','exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xd725,0x1d7));var _0x5d72=function(_0x558582,_0x40faf0){_0x558582=_0x558582-0x0;var _0x32f611=_0xd725[_0x558582];return _0x32f611;};'use strict';var Sequelize=require(_0x5d72('0x0'));module[_0x5d72('0x1')]={'name':{'type':Sequelize[_0x5d72('0x2')]},'description':{'type':Sequelize[_0x5d72('0x2')]}}; \ No newline at end of file +var _0xd096=['STRING','sequelize','exports'];(function(_0xd16df9,_0x18db96){var _0x141b04=function(_0x5f44ad){while(--_0x5f44ad){_0xd16df9['push'](_0xd16df9['shift']());}};_0x141b04(++_0x18db96);}(_0xd096,0x166));var _0x6d09=function(_0x44b3fb,_0x51b59c){_0x44b3fb=_0x44b3fb-0x0;var _0x2fd070=_0xd096[_0x44b3fb];return _0x2fd070;};'use strict';var Sequelize=require(_0x6d09('0x0'));module[_0x6d09('0x1')]={'name':{'type':Sequelize[_0x6d09('0x2')]},'description':{'type':Sequelize[_0x6d09('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 766d640..ad8907b 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 _0x9946=['offset','set','Content-Range','apply','reject','update','then','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','VtigerConfiguration','count','include','rows','params','rawAttributes','includeAll','find','catch','create','body','destroy','getFields','hasOwnProperty','nolimit','getSubjects','findOne','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','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','undefined','limit'];(function(_0x228f53,_0x2622f4){var _0x3b799a=function(_0x4ae919){while(--_0x4ae919){_0x228f53['push'](_0x228f53['shift']());}};_0x3b799a(++_0x2622f4);}(_0x9946,0x82));var _0x6994=function(_0x19d751,_0x21938e){_0x19d751=_0x19d751-0x0;var _0x337c88=_0x9946[_0x19d751];return _0x337c88;};'use strict';var emlformat=require(_0x6994('0x0'));var rimraf=require(_0x6994('0x1'));var zipdir=require(_0x6994('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6994('0x3'));var moment=require(_0x6994('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6994('0x5'));var sox=require(_0x6994('0x6'));var csv=require('to-csv');var ejs=require(_0x6994('0x7'));var fs=require('fs');var fs_extra=require(_0x6994('0x8'));var _=require(_0x6994('0x9'));var squel=require(_0x6994('0xa'));var crypto=require(_0x6994('0xb'));var jsforce=require(_0x6994('0xc'));var deskjs=require(_0x6994('0xd'));var toCsv=require(_0x6994('0xe'));var querystring=require(_0x6994('0xf'));var Papa=require('papaparse');var Redis=require(_0x6994('0x10'));var authService=require(_0x6994('0x11'));var qs=require(_0x6994('0x12'));var as=require(_0x6994('0x13'));var hardwareService=require(_0x6994('0x14'));var logger=require('../../config/logger')(_0x6994('0x15'));var utils=require(_0x6994('0x16'));var config=require(_0x6994('0x17'));var licenseUtil=require(_0x6994('0x18'));var db=require(_0x6994('0x19'))['db'];function respondWithStatusCode(_0x3ef3fc,_0x403118){_0x403118=_0x403118||0xcc;return function(_0x3c5d47){if(_0x3c5d47){return _0x3ef3fc[_0x6994('0x1a')](_0x403118);}return _0x3ef3fc[_0x6994('0x1b')](_0x403118)[_0x6994('0x1c')]();};}function respondWithResult(_0x519022,_0xd717e6){_0xd717e6=_0xd717e6||0xc8;return function(_0x3cd12f){if(_0x3cd12f){return _0x519022[_0x6994('0x1b')](_0xd717e6)[_0x6994('0x1d')](_0x3cd12f);}};}function respondWithFilteredResult(_0x10093b,_0x46f498){return function(_0x26e13c){if(_0x26e13c){var _0x16e005=typeof _0x46f498['offset']===_0x6994('0x1e')&&typeof _0x46f498[_0x6994('0x1f')]==='undefined';var _0x37d4c1=_0x26e13c['count'];var _0x423c48=_0x16e005?0x0:_0x46f498[_0x6994('0x20')];var _0x356c20=_0x16e005?_0x26e13c['count']:_0x46f498['offset']+_0x46f498[_0x6994('0x1f')];var _0x59f171;if(_0x356c20>=_0x37d4c1){_0x356c20=_0x37d4c1;_0x59f171=0xc8;}else{_0x59f171=0xce;}_0x10093b['status'](_0x59f171);return _0x10093b[_0x6994('0x21')](_0x6994('0x22'),_0x423c48+'-'+_0x356c20+'/'+_0x37d4c1)[_0x6994('0x1d')](_0x26e13c);}return null;};}function patchUpdates(_0x11a5a6){return function(_0x29d2f0){try{jsonpatch[_0x6994('0x23')](_0x29d2f0,_0x11a5a6,!![]);}catch(_0x5b3dac){return BPromise[_0x6994('0x24')](_0x5b3dac);}return _0x29d2f0['save']();};}function saveUpdates(_0x2cda43,_0x239a20){return function(_0x2ed294){if(_0x2ed294){return _0x2ed294[_0x6994('0x25')](_0x2cda43)[_0x6994('0x26')](function(_0x38e869){return _0x38e869;});}return null;};}function removeEntity(_0x2ab7a5,_0x1e647c){return function(_0x2f512a){if(_0x2f512a){return _0x2f512a['destroy']()[_0x6994('0x26')](function(){_0x2ab7a5[_0x6994('0x1b')](0xcc)[_0x6994('0x1c')]();});}};}function handleEntityNotFound(_0x374006,_0x1cd07c){return function(_0x5f06cf){if(!_0x5f06cf){_0x374006[_0x6994('0x1a')](0x194);}return _0x5f06cf;};}function handleError(_0x179f60,_0x3f744c){_0x3f744c=_0x3f744c||0x1f4;return function(_0x50b7fb){logger['error'](_0x50b7fb[_0x6994('0x27')]);if(_0x50b7fb[_0x6994('0x28')]){delete _0x50b7fb['name'];}_0x179f60['status'](_0x3f744c)['send'](_0x50b7fb);};}exports[_0x6994('0x29')]=function(_0x4c7eb4,_0x550197){var _0x128da3={},_0x45c590={},_0xbd265a={'count':0x0,'rows':[]};var _0x5b714f=_[_0x6994('0x2a')](db['VtigerConfiguration']['rawAttributes'],function(_0x16891f){return{'name':_0x16891f[_0x6994('0x2b')],'type':_0x16891f[_0x6994('0x2c')][_0x6994('0x2d')]};});_0x45c590[_0x6994('0x2e')]=_['map'](_0x5b714f,_0x6994('0x28'));_0x45c590[_0x6994('0x2f')]=_[_0x6994('0x30')](_0x4c7eb4['query']);_0x45c590[_0x6994('0x31')]=_[_0x6994('0x32')](_0x45c590[_0x6994('0x2e')],_0x45c590[_0x6994('0x2f')]);_0x128da3[_0x6994('0x33')]=_[_0x6994('0x32')](_0x45c590[_0x6994('0x2e')],qs[_0x6994('0x34')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x34')]));_0x128da3[_0x6994('0x33')]=_0x128da3[_0x6994('0x33')][_0x6994('0x35')]?_0x128da3[_0x6994('0x33')]:_0x45c590[_0x6994('0x2e')];if(!_0x4c7eb4[_0x6994('0x2f')]['hasOwnProperty']('nolimit')){_0x128da3[_0x6994('0x1f')]=qs[_0x6994('0x1f')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x1f')]);_0x128da3['offset']=qs[_0x6994('0x20')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x20')]);}_0x128da3[_0x6994('0x36')]=qs['sort'](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x37')]);_0x128da3[_0x6994('0x38')]=qs[_0x6994('0x31')](_[_0x6994('0x39')](_0x4c7eb4['query'],_0x45c590[_0x6994('0x31')]),_0x5b714f);if(_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x3a')]){_0x128da3[_0x6994('0x38')]=_['merge'](_0x128da3['where'],{'$or':_['map'](_0x5b714f,function(_0xfc6a6d){if(_0xfc6a6d[_0x6994('0x2c')]!==_0x6994('0x3b')){var _0x129c41={};_0x129c41[_0xfc6a6d[_0x6994('0x28')]]={'$like':'%'+_0x4c7eb4[_0x6994('0x2f')]['filter']+'%'};return _0x129c41;}})});}_0x128da3=_[_0x6994('0x3c')]({},_0x128da3,_0x4c7eb4[_0x6994('0x3d')]);var _0x4a47f7={'where':_0x128da3['where']};return db[_0x6994('0x3e')][_0x6994('0x3f')](_0x4a47f7)[_0x6994('0x26')](function(_0x3206e0){_0xbd265a[_0x6994('0x3f')]=_0x3206e0;if(_0x4c7eb4[_0x6994('0x2f')]['includeAll']){_0x128da3[_0x6994('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x128da3);})[_0x6994('0x26')](function(_0x2d355c){_0xbd265a[_0x6994('0x41')]=_0x2d355c;return _0xbd265a;})[_0x6994('0x26')](respondWithFilteredResult(_0x550197,_0x128da3))['catch'](handleError(_0x550197,null));};exports['show']=function(_0xa70551,_0x2e0c79){var _0x24d149={'raw':![],'where':{'id':_0xa70551[_0x6994('0x42')]['id']}},_0x2c0cd={};_0x2c0cd[_0x6994('0x2e')]=_[_0x6994('0x30')](db[_0x6994('0x3e')][_0x6994('0x43')]);_0x2c0cd[_0x6994('0x2f')]=_[_0x6994('0x30')](_0xa70551[_0x6994('0x2f')]);_0x2c0cd[_0x6994('0x31')]=_[_0x6994('0x32')](_0x2c0cd['model'],_0x2c0cd[_0x6994('0x2f')]);_0x24d149[_0x6994('0x33')]=_[_0x6994('0x32')](_0x2c0cd[_0x6994('0x2e')],qs[_0x6994('0x34')](_0xa70551['query']['fields']));_0x24d149['attributes']=_0x24d149['attributes'][_0x6994('0x35')]?_0x24d149[_0x6994('0x33')]:_0x2c0cd[_0x6994('0x2e')];if(_0xa70551['query'][_0x6994('0x44')]){_0x24d149[_0x6994('0x40')]=[{'all':!![]}];}_0x24d149=_[_0x6994('0x3c')]({},_0x24d149,_0xa70551[_0x6994('0x3d')]);return db[_0x6994('0x3e')][_0x6994('0x45')](_0x24d149)[_0x6994('0x26')](handleEntityNotFound(_0x2e0c79,null))[_0x6994('0x26')](respondWithResult(_0x2e0c79,null))[_0x6994('0x46')](handleError(_0x2e0c79,null));};exports[_0x6994('0x47')]=function(_0x31fe62,_0xdde8d2){return db[_0x6994('0x3e')][_0x6994('0x47')](_0x31fe62[_0x6994('0x48')],{})['then'](respondWithResult(_0xdde8d2,0xc9))['catch'](handleError(_0xdde8d2,null));};exports[_0x6994('0x25')]=function(_0x85a9e2,_0x28dd27){if(_0x85a9e2[_0x6994('0x48')]['id']){delete _0x85a9e2[_0x6994('0x48')]['id'];}return db['VtigerConfiguration'][_0x6994('0x45')]({'where':{'id':_0x85a9e2[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x28dd27,null))[_0x6994('0x26')](saveUpdates(_0x85a9e2['body'],null))[_0x6994('0x26')](respondWithResult(_0x28dd27,null))[_0x6994('0x46')](handleError(_0x28dd27,null));};exports[_0x6994('0x49')]=function(_0x2646f3,_0x3120b3){return db[_0x6994('0x3e')][_0x6994('0x45')]({'where':{'id':_0x2646f3['params']['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x3120b3,null))[_0x6994('0x26')](removeEntity(_0x3120b3,null))[_0x6994('0x46')](handleError(_0x3120b3,null));};exports[_0x6994('0x4a')]=function(_0x30f074,_0x20d0f9,_0x8b4e3c){var _0x4346dd={};var _0x3b1ee7={};var _0x181c0d;var _0x4a3870;return db[_0x6994('0x3e')]['findOne']({'where':{'id':_0x30f074[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x20d0f9,null))[_0x6994('0x26')](function(_0x236b23){if(_0x236b23){_0x181c0d=_0x236b23;_0x3b1ee7['model']=_[_0x6994('0x30')](db['VtigerField']['rawAttributes']);_0x3b1ee7[_0x6994('0x2f')]=_['keys'](_0x30f074[_0x6994('0x2f')]);_0x3b1ee7['filters']=_['intersection'](_0x3b1ee7[_0x6994('0x2e')],_0x3b1ee7['query']);_0x4346dd[_0x6994('0x33')]=_[_0x6994('0x32')](_0x3b1ee7[_0x6994('0x2e')],qs[_0x6994('0x34')](_0x30f074[_0x6994('0x2f')][_0x6994('0x34')]));_0x4346dd[_0x6994('0x33')]=_0x4346dd[_0x6994('0x33')]['length']?_0x4346dd['attributes']:_0x3b1ee7[_0x6994('0x2e')];_0x4346dd[_0x6994('0x36')]=qs['sort'](_0x30f074[_0x6994('0x2f')][_0x6994('0x37')]);_0x4346dd['where']=qs['filters'](_[_0x6994('0x39')](_0x30f074['query'],_0x3b1ee7[_0x6994('0x31')]));if(_0x30f074[_0x6994('0x2f')][_0x6994('0x3a')]){_0x4346dd[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x4346dd[_0x6994('0x38')],{'$or':_['map'](_0x4346dd[_0x6994('0x33')],function(_0x3fed25){var _0xc2a7de={};_0xc2a7de[_0x3fed25]={'$like':'%'+_0x30f074[_0x6994('0x2f')][_0x6994('0x3a')]+'%'};return _0xc2a7de;})});}_0x4346dd=_['merge']({},_0x4346dd,_0x30f074[_0x6994('0x3d')]);return _0x181c0d[_0x6994('0x4a')](_0x4346dd);}})[_0x6994('0x26')](function(_0x48068d){if(_0x48068d){_0x4a3870=_0x48068d[_0x6994('0x35')];if(!_0x30f074['query'][_0x6994('0x4b')](_0x6994('0x4c'))){_0x4346dd['limit']=qs[_0x6994('0x1f')](_0x30f074[_0x6994('0x2f')][_0x6994('0x1f')]);_0x4346dd['offset']=qs[_0x6994('0x20')](_0x30f074[_0x6994('0x2f')]['offset']);}return _0x181c0d[_0x6994('0x4a')](_0x4346dd);}})['then'](function(_0x3afcaf){if(_0x3afcaf){return _0x3afcaf?{'count':_0x4a3870,'rows':_0x3afcaf}:null;}})[_0x6994('0x26')](respondWithResult(_0x20d0f9,null))['catch'](handleError(_0x20d0f9,null));};exports[_0x6994('0x4d')]=function(_0xcc9646,_0x76247f,_0x2fde4c){var _0x1dcd4a={};var _0x5671b8={};var _0x4fa337;var _0x439a75;return db[_0x6994('0x3e')][_0x6994('0x4e')]({'where':{'id':_0xcc9646[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x76247f,null))['then'](function(_0x2dd842){if(_0x2dd842){_0x4fa337=_0x2dd842;_0x5671b8[_0x6994('0x2e')]=_[_0x6994('0x30')](db[_0x6994('0x4f')]['rawAttributes']);_0x5671b8['query']=_[_0x6994('0x30')](_0xcc9646[_0x6994('0x2f')]);_0x5671b8['filters']=_[_0x6994('0x32')](_0x5671b8[_0x6994('0x2e')],_0x5671b8['query']);_0x1dcd4a[_0x6994('0x33')]=_['intersection'](_0x5671b8['model'],qs['fields'](_0xcc9646['query'][_0x6994('0x34')]));_0x1dcd4a['attributes']=_0x1dcd4a[_0x6994('0x33')][_0x6994('0x35')]?_0x1dcd4a[_0x6994('0x33')]:_0x5671b8['model'];_0x1dcd4a[_0x6994('0x36')]=qs[_0x6994('0x37')](_0xcc9646[_0x6994('0x2f')]['sort']);_0x1dcd4a[_0x6994('0x38')]=qs[_0x6994('0x31')](_['pick'](_0xcc9646[_0x6994('0x2f')],_0x5671b8[_0x6994('0x31')]));if(_0xcc9646['query'][_0x6994('0x3a')]){_0x1dcd4a[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x1dcd4a[_0x6994('0x38')],{'$or':_[_0x6994('0x2a')](_0x1dcd4a[_0x6994('0x33')],function(_0x4e7e6e){var _0x1a59fb={};_0x1a59fb[_0x4e7e6e]={'$like':'%'+_0xcc9646['query'][_0x6994('0x3a')]+'%'};return _0x1a59fb;})});}_0x1dcd4a=_[_0x6994('0x3c')]({},_0x1dcd4a,_0xcc9646['options']);return _0x4fa337[_0x6994('0x4d')](_0x1dcd4a);}})[_0x6994('0x26')](function(_0xa51bc2){if(_0xa51bc2){_0x439a75=_0xa51bc2[_0x6994('0x35')];if(!_0xcc9646[_0x6994('0x2f')][_0x6994('0x4b')](_0x6994('0x4c'))){_0x1dcd4a[_0x6994('0x1f')]=qs[_0x6994('0x1f')](_0xcc9646['query'][_0x6994('0x1f')]);_0x1dcd4a[_0x6994('0x20')]=qs[_0x6994('0x20')](_0xcc9646['query'][_0x6994('0x20')]);}return _0x4fa337[_0x6994('0x4d')](_0x1dcd4a);}})[_0x6994('0x26')](function(_0x35e60f){if(_0x35e60f){return _0x35e60f?{'count':_0x439a75,'rows':_0x35e60f}:null;}})[_0x6994('0x26')](respondWithResult(_0x76247f,null))[_0x6994('0x46')](handleError(_0x76247f,null));};exports[_0x6994('0x50')]=function(_0x48b6ba,_0x4587af,_0x47ed66){var _0x33ad40={};var _0x338076={};var _0x26fd16;var _0x1d3977;return db[_0x6994('0x3e')]['findOne']({'where':{'id':_0x48b6ba[_0x6994('0x42')]['id']}})['then'](handleEntityNotFound(_0x4587af,null))[_0x6994('0x26')](function(_0x1b6179){if(_0x1b6179){_0x26fd16=_0x1b6179;_0x338076[_0x6994('0x2e')]=_[_0x6994('0x30')](db['VtigerField'][_0x6994('0x43')]);_0x338076['query']=_[_0x6994('0x30')](_0x48b6ba[_0x6994('0x2f')]);_0x338076[_0x6994('0x31')]=_[_0x6994('0x32')](_0x338076[_0x6994('0x2e')],_0x338076[_0x6994('0x2f')]);_0x33ad40[_0x6994('0x33')]=_[_0x6994('0x32')](_0x338076[_0x6994('0x2e')],qs['fields'](_0x48b6ba[_0x6994('0x2f')]['fields']));_0x33ad40[_0x6994('0x33')]=_0x33ad40[_0x6994('0x33')][_0x6994('0x35')]?_0x33ad40[_0x6994('0x33')]:_0x338076['model'];_0x33ad40['order']=qs['sort'](_0x48b6ba[_0x6994('0x2f')][_0x6994('0x37')]);_0x33ad40[_0x6994('0x38')]=qs['filters'](_[_0x6994('0x39')](_0x48b6ba['query'],_0x338076[_0x6994('0x31')]));if(_0x48b6ba['query']['filter']){_0x33ad40[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x33ad40[_0x6994('0x38')],{'$or':_[_0x6994('0x2a')](_0x33ad40[_0x6994('0x33')],function(_0x58a6ba){var _0x3c908c={};_0x3c908c[_0x58a6ba]={'$like':'%'+_0x48b6ba[_0x6994('0x2f')][_0x6994('0x3a')]+'%'};return _0x3c908c;})});}_0x33ad40=_[_0x6994('0x3c')]({},_0x33ad40,_0x48b6ba[_0x6994('0x3d')]);return _0x26fd16[_0x6994('0x50')](_0x33ad40);}})[_0x6994('0x26')](function(_0x350107){if(_0x350107){_0x1d3977=_0x350107[_0x6994('0x35')];if(!_0x48b6ba[_0x6994('0x2f')][_0x6994('0x4b')](_0x6994('0x4c'))){_0x33ad40[_0x6994('0x1f')]=qs['limit'](_0x48b6ba[_0x6994('0x2f')]['limit']);_0x33ad40['offset']=qs['offset'](_0x48b6ba[_0x6994('0x2f')][_0x6994('0x20')]);}return _0x26fd16[_0x6994('0x50')](_0x33ad40);}})[_0x6994('0x26')](function(_0x47e868){if(_0x47e868){return _0x47e868?{'count':_0x1d3977,'rows':_0x47e868}:null;}})[_0x6994('0x26')](respondWithResult(_0x4587af,null))[_0x6994('0x46')](handleError(_0x4587af,null));}; \ No newline at end of file +var _0x588f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','nolimit','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x588f,0x194));var _0xf588=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x588f[_0xf26d40];return _0x50b68c;};'use strict';var emlformat=require(_0xf588('0x0'));var rimraf=require(_0xf588('0x1'));var zipdir=require(_0xf588('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf588('0x3'));var moment=require('moment');var BPromise=require(_0xf588('0x4'));var Mustache=require(_0xf588('0x5'));var util=require(_0xf588('0x6'));var path=require(_0xf588('0x7'));var sox=require(_0xf588('0x8'));var csv=require(_0xf588('0x9'));var ejs=require(_0xf588('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf588('0xb'));var squel=require(_0xf588('0xc'));var crypto=require(_0xf588('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf588('0x9'));var querystring=require(_0xf588('0xe'));var Papa=require('papaparse');var Redis=require(_0xf588('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf588('0x10'));var as=require(_0xf588('0x11'));var hardwareService=require(_0xf588('0x12'));var logger=require(_0xf588('0x13'))(_0xf588('0x14'));var utils=require(_0xf588('0x15'));var config=require(_0xf588('0x16'));var licenseUtil=require(_0xf588('0x17'));var db=require(_0xf588('0x18'))['db'];function respondWithStatusCode(_0x490786,_0x3fecd9){_0x3fecd9=_0x3fecd9||0xcc;return function(_0x60dfa0){if(_0x60dfa0){return _0x490786['sendStatus'](_0x3fecd9);}return _0x490786[_0xf588('0x19')](_0x3fecd9)[_0xf588('0x1a')]();};}function respondWithResult(_0x40bc93,_0x5a20b){_0x5a20b=_0x5a20b||0xc8;return function(_0x37eed7){if(_0x37eed7){return _0x40bc93[_0xf588('0x19')](_0x5a20b)[_0xf588('0x1b')](_0x37eed7);}};}function respondWithFilteredResult(_0x47f959,_0x4ec945){return function(_0x16dea0){if(_0x16dea0){var _0x4f7d57=typeof _0x4ec945['offset']===_0xf588('0x1c')&&typeof _0x4ec945['limit']==='undefined';var _0x3fa21f=_0x16dea0['count'];var _0x5eda34=_0x4f7d57?0x0:_0x4ec945[_0xf588('0x1d')];var _0x2f4697=_0x4f7d57?_0x16dea0[_0xf588('0x1e')]:_0x4ec945[_0xf588('0x1d')]+_0x4ec945[_0xf588('0x1f')];var _0x1144cd;if(_0x2f4697>=_0x3fa21f){_0x2f4697=_0x3fa21f;_0x1144cd=0xc8;}else{_0x1144cd=0xce;}_0x47f959[_0xf588('0x19')](_0x1144cd);return _0x47f959[_0xf588('0x20')](_0xf588('0x21'),_0x5eda34+'-'+_0x2f4697+'/'+_0x3fa21f)[_0xf588('0x1b')](_0x16dea0);}return null;};}function patchUpdates(_0x57431d){return function(_0x5619bf){try{jsonpatch[_0xf588('0x22')](_0x5619bf,_0x57431d,!![]);}catch(_0x4e27b5){return BPromise[_0xf588('0x23')](_0x4e27b5);}return _0x5619bf[_0xf588('0x24')]();};}function saveUpdates(_0xcc230c,_0x4efb55){return function(_0x3ea065){if(_0x3ea065){return _0x3ea065[_0xf588('0x25')](_0xcc230c)[_0xf588('0x26')](function(_0x3a5a7d){return _0x3a5a7d;});}return null;};}function removeEntity(_0x28ac2a,_0x1fcd7f){return function(_0x27c6fc){if(_0x27c6fc){return _0x27c6fc[_0xf588('0x27')]()[_0xf588('0x26')](function(){_0x28ac2a[_0xf588('0x19')](0xcc)[_0xf588('0x1a')]();});}};}function handleEntityNotFound(_0x48579b,_0xc77b4c){return function(_0x41eac5){if(!_0x41eac5){_0x48579b[_0xf588('0x28')](0x194);}return _0x41eac5;};}function handleError(_0x32e9be,_0x59117f){_0x59117f=_0x59117f||0x1f4;return function(_0x5d222d){logger[_0xf588('0x29')](_0x5d222d[_0xf588('0x2a')]);if(_0x5d222d[_0xf588('0x2b')]){delete _0x5d222d[_0xf588('0x2b')];}_0x32e9be['status'](_0x59117f)[_0xf588('0x2c')](_0x5d222d);};}exports[_0xf588('0x2d')]=function(_0x23c2fb,_0x2d2a55){var _0x6e5b4={},_0x17cece={},_0x2dfb10={'count':0x0,'rows':[]};var _0x181bc2=_[_0xf588('0x2e')](db[_0xf588('0x2f')][_0xf588('0x30')],function(_0x5adc34){return{'name':_0x5adc34[_0xf588('0x31')],'type':_0x5adc34[_0xf588('0x32')][_0xf588('0x33')]};});_0x17cece[_0xf588('0x34')]=_[_0xf588('0x2e')](_0x181bc2,'name');_0x17cece['query']=_[_0xf588('0x35')](_0x23c2fb['query']);_0x17cece[_0xf588('0x36')]=_[_0xf588('0x37')](_0x17cece[_0xf588('0x34')],_0x17cece[_0xf588('0x38')]);_0x6e5b4[_0xf588('0x39')]=_[_0xf588('0x37')](_0x17cece[_0xf588('0x34')],qs[_0xf588('0x3a')](_0x23c2fb[_0xf588('0x38')][_0xf588('0x3a')]));_0x6e5b4[_0xf588('0x39')]=_0x6e5b4[_0xf588('0x39')][_0xf588('0x3b')]?_0x6e5b4[_0xf588('0x39')]:_0x17cece['model'];if(!_0x23c2fb[_0xf588('0x38')]['hasOwnProperty']('nolimit')){_0x6e5b4['limit']=qs['limit'](_0x23c2fb[_0xf588('0x38')][_0xf588('0x1f')]);_0x6e5b4[_0xf588('0x1d')]=qs[_0xf588('0x1d')](_0x23c2fb[_0xf588('0x38')][_0xf588('0x1d')]);}_0x6e5b4[_0xf588('0x3c')]=qs[_0xf588('0x3d')](_0x23c2fb[_0xf588('0x38')][_0xf588('0x3d')]);_0x6e5b4['where']=qs[_0xf588('0x36')](_[_0xf588('0x3e')](_0x23c2fb[_0xf588('0x38')],_0x17cece[_0xf588('0x36')]),_0x181bc2);if(_0x23c2fb[_0xf588('0x38')][_0xf588('0x3f')]){_0x6e5b4[_0xf588('0x40')]=_[_0xf588('0x41')](_0x6e5b4[_0xf588('0x40')],{'$or':_[_0xf588('0x2e')](_0x181bc2,function(_0x1ba73a){if(_0x1ba73a['type']!==_0xf588('0x42')){var _0x2e32d6={};_0x2e32d6[_0x1ba73a[_0xf588('0x2b')]]={'$like':'%'+_0x23c2fb['query'][_0xf588('0x3f')]+'%'};return _0x2e32d6;}})});}_0x6e5b4=_['merge']({},_0x6e5b4,_0x23c2fb['options']);var _0x2a9aac={'where':_0x6e5b4['where']};return db[_0xf588('0x2f')][_0xf588('0x1e')](_0x2a9aac)[_0xf588('0x26')](function(_0x311f8a){_0x2dfb10[_0xf588('0x1e')]=_0x311f8a;if(_0x23c2fb['query']['includeAll']){_0x6e5b4[_0xf588('0x43')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xf588('0x44')](_0x6e5b4);})['then'](function(_0x443474){_0x2dfb10[_0xf588('0x45')]=_0x443474;return _0x2dfb10;})['then'](respondWithFilteredResult(_0x2d2a55,_0x6e5b4))[_0xf588('0x46')](handleError(_0x2d2a55,null));};exports['show']=function(_0x5aa3ad,_0x233a81){var _0x5ea801={'raw':![],'where':{'id':_0x5aa3ad[_0xf588('0x47')]['id']}},_0x4615c7={};_0x4615c7['model']=_['keys'](db['VtigerConfiguration'][_0xf588('0x30')]);_0x4615c7[_0xf588('0x38')]=_['keys'](_0x5aa3ad[_0xf588('0x38')]);_0x4615c7[_0xf588('0x36')]=_['intersection'](_0x4615c7[_0xf588('0x34')],_0x4615c7[_0xf588('0x38')]);_0x5ea801[_0xf588('0x39')]=_['intersection'](_0x4615c7[_0xf588('0x34')],qs['fields'](_0x5aa3ad[_0xf588('0x38')][_0xf588('0x3a')]));_0x5ea801[_0xf588('0x39')]=_0x5ea801[_0xf588('0x39')][_0xf588('0x3b')]?_0x5ea801['attributes']:_0x4615c7[_0xf588('0x34')];if(_0x5aa3ad['query'][_0xf588('0x48')]){_0x5ea801['include']=[{'all':!![]}];}_0x5ea801=_[_0xf588('0x41')]({},_0x5ea801,_0x5aa3ad[_0xf588('0x49')]);return db[_0xf588('0x2f')][_0xf588('0x4a')](_0x5ea801)[_0xf588('0x26')](handleEntityNotFound(_0x233a81,null))[_0xf588('0x26')](respondWithResult(_0x233a81,null))[_0xf588('0x46')](handleError(_0x233a81,null));};exports[_0xf588('0x4b')]=function(_0x2fc543,_0x210fb6){return db[_0xf588('0x2f')][_0xf588('0x4b')](_0x2fc543[_0xf588('0x4c')],{})[_0xf588('0x26')](respondWithResult(_0x210fb6,0xc9))[_0xf588('0x46')](handleError(_0x210fb6,null));};exports[_0xf588('0x25')]=function(_0x2ada7b,_0x3e6c38){if(_0x2ada7b[_0xf588('0x4c')]['id']){delete _0x2ada7b['body']['id'];}return db[_0xf588('0x2f')][_0xf588('0x4a')]({'where':{'id':_0x2ada7b[_0xf588('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e6c38,null))[_0xf588('0x26')](saveUpdates(_0x2ada7b['body'],null))['then'](respondWithResult(_0x3e6c38,null))[_0xf588('0x46')](handleError(_0x3e6c38,null));};exports[_0xf588('0x27')]=function(_0x3a2b34,_0x218987){return db['VtigerConfiguration'][_0xf588('0x4a')]({'where':{'id':_0x3a2b34[_0xf588('0x47')]['id']}})['then'](handleEntityNotFound(_0x218987,null))['then'](removeEntity(_0x218987,null))[_0xf588('0x46')](handleError(_0x218987,null));};exports[_0xf588('0x4d')]=function(_0x144923,_0x7da08a,_0x300156){var _0x2065a8={};var _0x3bfb7d={};var _0xca8eb9;var _0x1bd111;return db[_0xf588('0x2f')][_0xf588('0x4e')]({'where':{'id':_0x144923[_0xf588('0x47')]['id']}})['then'](handleEntityNotFound(_0x7da08a,null))['then'](function(_0x35fe50){if(_0x35fe50){_0xca8eb9=_0x35fe50;_0x3bfb7d[_0xf588('0x34')]=_['keys'](db['VtigerField'][_0xf588('0x30')]);_0x3bfb7d[_0xf588('0x38')]=_[_0xf588('0x35')](_0x144923['query']);_0x3bfb7d[_0xf588('0x36')]=_[_0xf588('0x37')](_0x3bfb7d[_0xf588('0x34')],_0x3bfb7d['query']);_0x2065a8[_0xf588('0x39')]=_[_0xf588('0x37')](_0x3bfb7d[_0xf588('0x34')],qs[_0xf588('0x3a')](_0x144923['query'][_0xf588('0x3a')]));_0x2065a8[_0xf588('0x39')]=_0x2065a8[_0xf588('0x39')]['length']?_0x2065a8[_0xf588('0x39')]:_0x3bfb7d[_0xf588('0x34')];_0x2065a8[_0xf588('0x3c')]=qs[_0xf588('0x3d')](_0x144923[_0xf588('0x38')]['sort']);_0x2065a8[_0xf588('0x40')]=qs['filters'](_[_0xf588('0x3e')](_0x144923[_0xf588('0x38')],_0x3bfb7d[_0xf588('0x36')]));if(_0x144923[_0xf588('0x38')]['filter']){_0x2065a8['where']=_['merge'](_0x2065a8[_0xf588('0x40')],{'$or':_[_0xf588('0x2e')](_0x2065a8[_0xf588('0x39')],function(_0x4bfd80){var _0x2dbce8={};_0x2dbce8[_0x4bfd80]={'$like':'%'+_0x144923[_0xf588('0x38')]['filter']+'%'};return _0x2dbce8;})});}_0x2065a8=_[_0xf588('0x41')]({},_0x2065a8,_0x144923[_0xf588('0x49')]);return _0xca8eb9[_0xf588('0x4d')](_0x2065a8);}})['then'](function(_0x18b20f){if(_0x18b20f){_0x1bd111=_0x18b20f[_0xf588('0x3b')];if(!_0x144923[_0xf588('0x38')][_0xf588('0x4f')]('nolimit')){_0x2065a8[_0xf588('0x1f')]=qs[_0xf588('0x1f')](_0x144923['query'][_0xf588('0x1f')]);_0x2065a8[_0xf588('0x1d')]=qs['offset'](_0x144923['query'][_0xf588('0x1d')]);}return _0xca8eb9[_0xf588('0x4d')](_0x2065a8);}})[_0xf588('0x26')](function(_0x202a43){if(_0x202a43){return _0x202a43?{'count':_0x1bd111,'rows':_0x202a43}:null;}})[_0xf588('0x26')](respondWithResult(_0x7da08a,null))[_0xf588('0x46')](handleError(_0x7da08a,null));};exports[_0xf588('0x50')]=function(_0x3e664a,_0x279b51,_0x7aaabc){var _0x52a463={};var _0xfdae7={};var _0x46e3d4;var _0x53462e;return db[_0xf588('0x2f')][_0xf588('0x4e')]({'where':{'id':_0x3e664a[_0xf588('0x47')]['id']}})[_0xf588('0x26')](handleEntityNotFound(_0x279b51,null))[_0xf588('0x26')](function(_0x2a48a8){if(_0x2a48a8){_0x46e3d4=_0x2a48a8;_0xfdae7[_0xf588('0x34')]=_[_0xf588('0x35')](db['VtigerField'][_0xf588('0x30')]);_0xfdae7['query']=_[_0xf588('0x35')](_0x3e664a[_0xf588('0x38')]);_0xfdae7[_0xf588('0x36')]=_['intersection'](_0xfdae7[_0xf588('0x34')],_0xfdae7['query']);_0x52a463[_0xf588('0x39')]=_[_0xf588('0x37')](_0xfdae7['model'],qs[_0xf588('0x3a')](_0x3e664a[_0xf588('0x38')][_0xf588('0x3a')]));_0x52a463[_0xf588('0x39')]=_0x52a463['attributes'][_0xf588('0x3b')]?_0x52a463[_0xf588('0x39')]:_0xfdae7[_0xf588('0x34')];_0x52a463[_0xf588('0x3c')]=qs[_0xf588('0x3d')](_0x3e664a['query']['sort']);_0x52a463['where']=qs[_0xf588('0x36')](_[_0xf588('0x3e')](_0x3e664a['query'],_0xfdae7[_0xf588('0x36')]));if(_0x3e664a[_0xf588('0x38')][_0xf588('0x3f')]){_0x52a463[_0xf588('0x40')]=_[_0xf588('0x41')](_0x52a463[_0xf588('0x40')],{'$or':_['map'](_0x52a463[_0xf588('0x39')],function(_0xe1f580){var _0x41237c={};_0x41237c[_0xe1f580]={'$like':'%'+_0x3e664a[_0xf588('0x38')][_0xf588('0x3f')]+'%'};return _0x41237c;})});}_0x52a463=_[_0xf588('0x41')]({},_0x52a463,_0x3e664a['options']);return _0x46e3d4['getSubjects'](_0x52a463);}})[_0xf588('0x26')](function(_0x420e77){if(_0x420e77){_0x53462e=_0x420e77[_0xf588('0x3b')];if(!_0x3e664a['query'][_0xf588('0x4f')](_0xf588('0x51'))){_0x52a463['limit']=qs[_0xf588('0x1f')](_0x3e664a[_0xf588('0x38')][_0xf588('0x1f')]);_0x52a463[_0xf588('0x1d')]=qs['offset'](_0x3e664a[_0xf588('0x38')][_0xf588('0x1d')]);}return _0x46e3d4[_0xf588('0x50')](_0x52a463);}})[_0xf588('0x26')](function(_0x225675){if(_0x225675){return _0x225675?{'count':_0x53462e,'rows':_0x225675}:null;}})[_0xf588('0x26')](respondWithResult(_0x279b51,null))[_0xf588('0x46')](handleError(_0x279b51,null));};exports[_0xf588('0x52')]=function(_0x36a6df,_0x29f15c,_0x16a2dc){var _0x4276b2={};var _0x37e364={};var _0xee7257;var _0x1c31df;return db[_0xf588('0x2f')]['findOne']({'where':{'id':_0x36a6df[_0xf588('0x47')]['id']}})[_0xf588('0x26')](handleEntityNotFound(_0x29f15c,null))['then'](function(_0x58a170){if(_0x58a170){_0xee7257=_0x58a170;_0x37e364['model']=_[_0xf588('0x35')](db[_0xf588('0x53')][_0xf588('0x30')]);_0x37e364['query']=_[_0xf588('0x35')](_0x36a6df[_0xf588('0x38')]);_0x37e364['filters']=_[_0xf588('0x37')](_0x37e364[_0xf588('0x34')],_0x37e364['query']);_0x4276b2['attributes']=_['intersection'](_0x37e364[_0xf588('0x34')],qs['fields'](_0x36a6df[_0xf588('0x38')][_0xf588('0x3a')]));_0x4276b2[_0xf588('0x39')]=_0x4276b2[_0xf588('0x39')]['length']?_0x4276b2[_0xf588('0x39')]:_0x37e364['model'];_0x4276b2[_0xf588('0x3c')]=qs[_0xf588('0x3d')](_0x36a6df[_0xf588('0x38')]['sort']);_0x4276b2['where']=qs[_0xf588('0x36')](_[_0xf588('0x3e')](_0x36a6df[_0xf588('0x38')],_0x37e364[_0xf588('0x36')]));if(_0x36a6df[_0xf588('0x38')][_0xf588('0x3f')]){_0x4276b2[_0xf588('0x40')]=_[_0xf588('0x41')](_0x4276b2[_0xf588('0x40')],{'$or':_[_0xf588('0x2e')](_0x4276b2['attributes'],function(_0x457185){var _0x17531d={};_0x17531d[_0x457185]={'$like':'%'+_0x36a6df[_0xf588('0x38')][_0xf588('0x3f')]+'%'};return _0x17531d;})});}_0x4276b2=_[_0xf588('0x41')]({},_0x4276b2,_0x36a6df[_0xf588('0x49')]);return _0xee7257['getDescriptions'](_0x4276b2);}})[_0xf588('0x26')](function(_0x21493a){if(_0x21493a){_0x1c31df=_0x21493a[_0xf588('0x3b')];if(!_0x36a6df[_0xf588('0x38')]['hasOwnProperty']('nolimit')){_0x4276b2[_0xf588('0x1f')]=qs['limit'](_0x36a6df[_0xf588('0x38')]['limit']);_0x4276b2[_0xf588('0x1d')]=qs[_0xf588('0x1d')](_0x36a6df[_0xf588('0x38')]['offset']);}return _0xee7257[_0xf588('0x52')](_0x4276b2);}})[_0xf588('0x26')](function(_0x465f12){if(_0x465f12){return _0x465f12?{'count':_0x1c31df,'rows':_0x465f12}:null;}})[_0xf588('0x26')](respondWithResult(_0x29f15c,null))[_0xf588('0x46')](handleError(_0x29f15c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 195c5e4..7f0a0e9 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 _0xc65a=['define','VtigerConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0xc0e2c4,_0xa4c81e){var _0x3e378c=function(_0x18bc29){while(--_0x18bc29){_0xc0e2c4['push'](_0xc0e2c4['shift']());}};_0x3e378c(++_0xa4c81e);}(_0xc65a,0x6e));var _0xac65=function(_0x483ded,_0x120b5e){_0x483ded=_0x483ded-0x0;var _0x364c4f=_0xc65a[_0x483ded];return _0x364c4f;};'use strict';var _=require(_0xac65('0x0'));var util=require(_0xac65('0x1'));var logger=require(_0xac65('0x2'))(_0xac65('0x3'));var moment=require(_0xac65('0x4'));var BPromise=require(_0xac65('0x5'));var rp=require(_0xac65('0x6'));var fs=require('fs');var path=require(_0xac65('0x7'));var rimraf=require('rimraf');var config=require(_0xac65('0x8'));var attributes=require(_0xac65('0x9'));module['exports']=function(_0x35ebf1,_0x5215d6){return _0x35ebf1[_0xac65('0xa')](_0xac65('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23ff=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0xaa7af2,_0x289bf0){var _0xbf48e3=function(_0x477729){while(--_0x477729){_0xaa7af2['push'](_0xaa7af2['shift']());}};_0xbf48e3(++_0x289bf0);}(_0x23ff,0x1b7));var _0xf23f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x23ff[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf23f('0x0'));var util=require(_0xf23f('0x1'));var logger=require(_0xf23f('0x2'))(_0xf23f('0x3'));var moment=require(_0xf23f('0x4'));var BPromise=require(_0xf23f('0x5'));var rp=require(_0xf23f('0x6'));var fs=require('fs');var path=require(_0xf23f('0x7'));var rimraf=require(_0xf23f('0x8'));var config=require(_0xf23f('0x9'));var attributes=require(_0xf23f('0xa'));module['exports']=function(_0x38865b,_0x3b5aa8){return _0x38865b[_0xf23f('0xb')](_0xf23f('0xc'),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 a9b905e..9eba32d 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 _0xb66a=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x321f13,_0x33f309){var _0x5f1dc8=function(_0x7355cb){while(--_0x7355cb){_0x321f13['push'](_0x321f13['shift']());}};_0x5f1dc8(++_0x33f309);}(_0xb66a,0xda));var _0xab66=function(_0x3aff01,_0x5c3868){_0x3aff01=_0x3aff01-0x0;var _0x5426dc=_0xb66a[_0x3aff01];return _0x5426dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab66('0x0'));var BPromise=require(_0xab66('0x1'));var rs=require(_0xab66('0x2'));var fs=require('fs');var Redis=require(_0xab66('0x3'));var db=require(_0xab66('0x4'))['db'];var utils=require(_0xab66('0x5'));var logger=require(_0xab66('0x6'))(_0xab66('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab66('0x8')][_0xab66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c222a,_0x23fe30,_0x2d6d75){return new BPromise(function(_0x3b900c,_0x21ebbc){return client['request'](_0x2c222a,_0x2d6d75)['then'](function(_0x165643){logger[_0xab66('0xa')](_0xab66('0xb'),_0x23fe30,_0xab66('0xc'));logger['debug'](_0xab66('0xd'),_0x23fe30,_0xab66('0xc'),JSON[_0xab66('0xe')](_0x165643));if(_0x165643[_0xab66('0xf')]){if(_0x165643[_0xab66('0xf')]['code']===0x1f4){logger[_0xab66('0xf')](_0xab66('0xb'),_0x23fe30,_0x165643[_0xab66('0xf')][_0xab66('0x10')]);return _0x21ebbc(_0x165643[_0xab66('0xf')][_0xab66('0x10')]);}logger['error'](_0xab66('0xb'),_0x23fe30,_0x165643['error'][_0xab66('0x10')]);return _0x3b900c(_0x165643['error'][_0xab66('0x10')]);}else{logger[_0xab66('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x23fe30,_0xab66('0xc'));_0x3b900c(_0x165643[_0xab66('0x11')][_0xab66('0x10')]);}})[_0xab66('0x12')](function(_0x18a415){logger[_0xab66('0xf')](_0xab66('0xb'),_0x23fe30,_0x18a415);_0x21ebbc(_0x18a415);});});} \ No newline at end of file +var _0x8b96=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x2bcbde,_0x1af371){var _0x365223=function(_0x353d91){while(--_0x353d91){_0x2bcbde['push'](_0x2bcbde['shift']());}};_0x365223(++_0x1af371);}(_0x8b96,0xfb));var _0x68b9=function(_0x1decf6,_0x304b7d){_0x1decf6=_0x1decf6-0x0;var _0x438f7d=_0x8b96[_0x1decf6];return _0x438f7d;};'use strict';var _=require('lodash');var util=require(_0x68b9('0x0'));var moment=require('moment');var BPromise=require(_0x68b9('0x1'));var rs=require(_0x68b9('0x2'));var fs=require('fs');var Redis=require(_0x68b9('0x3'));var db=require(_0x68b9('0x4'))['db'];var utils=require(_0x68b9('0x5'));var logger=require(_0x68b9('0x6'))(_0x68b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x68b9('0x8'));var client=jayson['client'][_0x68b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x282f27,_0x119e03,_0x34cd51){return new BPromise(function(_0x4a37c7,_0x36b177){return client[_0x68b9('0xa')](_0x282f27,_0x34cd51)[_0x68b9('0xb')](function(_0x40c5c7){logger[_0x68b9('0xc')](_0x68b9('0xd'),_0x119e03,_0x68b9('0xe'));logger[_0x68b9('0xf')](_0x68b9('0x10'),_0x119e03,_0x68b9('0xe'),JSON[_0x68b9('0x11')](_0x40c5c7));if(_0x40c5c7['error']){if(_0x40c5c7[_0x68b9('0x12')][_0x68b9('0x13')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x119e03,_0x40c5c7['error'][_0x68b9('0x14')]);return _0x36b177(_0x40c5c7[_0x68b9('0x12')][_0x68b9('0x14')]);}logger[_0x68b9('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x119e03,_0x40c5c7['error'][_0x68b9('0x14')]);return _0x4a37c7(_0x40c5c7['error'][_0x68b9('0x14')]);}else{logger[_0x68b9('0xc')](_0x68b9('0xd'),_0x119e03,_0x68b9('0xe'));_0x4a37c7(_0x40c5c7[_0x68b9('0x15')][_0x68b9('0x14')]);}})[_0x68b9('0x16')](function(_0x16356d){logger[_0x68b9('0x12')](_0x68b9('0xd'),_0x119e03,_0x16356d);_0x36b177(_0x16356d);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 3335202..4e5ffae 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 _0xcb06=['post','create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb06,0x1a4));var _0x6cb0=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xcb06[_0x52e363];return _0x3fc2b5;};'use strict';var multer=require('multer');var util=require(_0x6cb0('0x0'));var path=require('path');var timeout=require(_0x6cb0('0x1'));var express=require('express');var router=express[_0x6cb0('0x2')]();var fs_extra=require(_0x6cb0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6cb0('0x4'));var config=require(_0x6cb0('0x5'));var controller=require(_0x6cb0('0x6'));router['get']('/',auth[_0x6cb0('0x7')](),controller[_0x6cb0('0x8')]);router[_0x6cb0('0x9')](_0x6cb0('0xa'),auth['isAuthenticated'](),controller[_0x6cb0('0xb')]);router[_0x6cb0('0xc')]('/',auth['isAuthenticated'](),controller[_0x6cb0('0xd')]);router[_0x6cb0('0xe')](_0x6cb0('0xa'),auth[_0x6cb0('0x7')](),controller[_0x6cb0('0xf')]);router[_0x6cb0('0x10')]('/:id',auth[_0x6cb0('0x7')](),controller[_0x6cb0('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6f93=['Router','fs-extra','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x2aaddd,_0x551fcd){var _0x13a70c=function(_0x2e089d){while(--_0x2e089d){_0x2aaddd['push'](_0x2aaddd['shift']());}};_0x13a70c(++_0x551fcd);}(_0x6f93,0xb7));var _0x36f9=function(_0x39c832,_0x157280){_0x39c832=_0x39c832-0x0;var _0x259e23=_0x6f93[_0x39c832];return _0x259e23;};'use strict';var multer=require('multer');var util=require(_0x36f9('0x0'));var path=require(_0x36f9('0x1'));var timeout=require(_0x36f9('0x2'));var express=require(_0x36f9('0x3'));var router=express[_0x36f9('0x4')]();var fs_extra=require(_0x36f9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36f9('0x6'));var controller=require(_0x36f9('0x7'));router[_0x36f9('0x8')]('/',auth[_0x36f9('0x9')](),controller[_0x36f9('0xa')]);router['get'](_0x36f9('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x36f9('0x9')](),controller[_0x36f9('0xc')]);router['put'](_0x36f9('0xb'),auth[_0x36f9('0x9')](),controller[_0x36f9('0xd')]);router[_0x36f9('0xe')](_0x36f9('0xb'),auth['isAuthenticated'](),controller[_0x36f9('0xf')]);module[_0x36f9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 7557891..8795a0e 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 _0x9ff0=['customVariable','keyValue','STRING','string','BOOLEAN','sequelize','ENUM','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ff0,0x19d));var _0x09ff=function(_0x3febbd,_0x68809d){_0x3febbd=_0x3febbd-0x0;var _0x257320=_0x9ff0[_0x3febbd];return _0x257320;};'use strict';var Sequelize=require(_0x09ff('0x0'));module['exports']={'type':{'type':Sequelize[_0x09ff('0x1')]('string',_0x09ff('0x2'),_0x09ff('0x3'),_0x09ff('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x09ff('0x5')]},'keyType':{'type':Sequelize[_0x09ff('0x1')](_0x09ff('0x6'),_0x09ff('0x2'),_0x09ff('0x3'))},'keyContent':{'type':Sequelize[_0x09ff('0x5')]},'idField':{'type':Sequelize[_0x09ff('0x5')]},'nameField':{'type':Sequelize[_0x09ff('0x5')]},'customField':{'type':Sequelize[_0x09ff('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d66=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1870e3,_0x196c6c){var _0x2f8d11=function(_0x45832f){while(--_0x45832f){_0x1870e3['push'](_0x1870e3['shift']());}};_0x2f8d11(++_0x196c6c);}(_0x3d66,0xf4));var _0x63d6=function(_0xc96212,_0x2a2935){_0xc96212=_0xc96212-0x0;var _0x4b2679=_0x3d66[_0xc96212];return _0x4b2679;};'use strict';var Sequelize=require('sequelize');module[_0x63d6('0x0')]={'type':{'type':Sequelize[_0x63d6('0x1')](_0x63d6('0x2'),_0x63d6('0x3'),_0x63d6('0x4'),_0x63d6('0x5'),_0x63d6('0x6')),'defaultValue':_0x63d6('0x2')},'content':{'type':Sequelize[_0x63d6('0x7')]},'key':{'type':Sequelize[_0x63d6('0x7')]},'keyType':{'type':Sequelize[_0x63d6('0x1')](_0x63d6('0x2'),_0x63d6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x63d6('0x7')]},'idField':{'type':Sequelize[_0x63d6('0x7')]},'nameField':{'type':Sequelize[_0x63d6('0x7')]},'customField':{'type':Sequelize[_0x63d6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 8de84e3..8c53094 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 _0x8702=['save','update','then','destroy','error','name','send','map','VtigerField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x8702,0x134));var _0x2870=function(_0x1158cc,_0x4c0c07){_0x1158cc=_0x1158cc-0x0;var _0x4ad316=_0x8702[_0x1158cc];return _0x4ad316;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2870('0x0'));var zipdir=require(_0x2870('0x1'));var jsonpatch=require(_0x2870('0x2'));var rp=require(_0x2870('0x3'));var moment=require(_0x2870('0x4'));var BPromise=require(_0x2870('0x5'));var Mustache=require(_0x2870('0x6'));var util=require(_0x2870('0x7'));var path=require('path');var sox=require(_0x2870('0x8'));var csv=require(_0x2870('0x9'));var ejs=require(_0x2870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2870('0xb'));var crypto=require(_0x2870('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2870('0xd'));var toCsv=require(_0x2870('0x9'));var querystring=require(_0x2870('0xe'));var Papa=require(_0x2870('0xf'));var Redis=require(_0x2870('0x10'));var authService=require(_0x2870('0x11'));var qs=require(_0x2870('0x12'));var as=require(_0x2870('0x13'));var hardwareService=require(_0x2870('0x14'));var logger=require(_0x2870('0x15'))('api');var utils=require(_0x2870('0x16'));var config=require(_0x2870('0x17'));var licenseUtil=require(_0x2870('0x18'));var db=require(_0x2870('0x19'))['db'];function respondWithStatusCode(_0x379548,_0x194a60){_0x194a60=_0x194a60||0xcc;return function(_0x1657f0){if(_0x1657f0){return _0x379548[_0x2870('0x1a')](_0x194a60);}return _0x379548[_0x2870('0x1b')](_0x194a60)[_0x2870('0x1c')]();};}function respondWithResult(_0x361ad8,_0x1c16be){_0x1c16be=_0x1c16be||0xc8;return function(_0x3d28d1){if(_0x3d28d1){return _0x361ad8[_0x2870('0x1b')](_0x1c16be)[_0x2870('0x1d')](_0x3d28d1);}};}function respondWithFilteredResult(_0x2b003f,_0x568f56){return function(_0x548ed){if(_0x548ed){var _0x283300=typeof _0x568f56[_0x2870('0x1e')]===_0x2870('0x1f')&&typeof _0x568f56[_0x2870('0x20')]==='undefined';var _0x3a30b8=_0x548ed[_0x2870('0x21')];var _0x2fcbb3=_0x283300?0x0:_0x568f56['offset'];var _0x14b9fa=_0x283300?_0x548ed['count']:_0x568f56[_0x2870('0x1e')]+_0x568f56[_0x2870('0x20')];var _0x25351a;if(_0x14b9fa>=_0x3a30b8){_0x14b9fa=_0x3a30b8;_0x25351a=0xc8;}else{_0x25351a=0xce;}_0x2b003f[_0x2870('0x1b')](_0x25351a);return _0x2b003f['set'](_0x2870('0x22'),_0x2fcbb3+'-'+_0x14b9fa+'/'+_0x3a30b8)[_0x2870('0x1d')](_0x548ed);}return null;};}function patchUpdates(_0x2a842e){return function(_0x20b480){try{jsonpatch[_0x2870('0x23')](_0x20b480,_0x2a842e,!![]);}catch(_0x24bddf){return BPromise[_0x2870('0x24')](_0x24bddf);}return _0x20b480[_0x2870('0x25')]();};}function saveUpdates(_0x313fa0,_0x3ba0ce){return function(_0x5b1393){if(_0x5b1393){return _0x5b1393[_0x2870('0x26')](_0x313fa0)[_0x2870('0x27')](function(_0x1a96cc){return _0x1a96cc;});}return null;};}function removeEntity(_0x20239d,_0x4ef1f7){return function(_0xe089dd){if(_0xe089dd){return _0xe089dd[_0x2870('0x28')]()[_0x2870('0x27')](function(){_0x20239d[_0x2870('0x1b')](0xcc)[_0x2870('0x1c')]();});}};}function handleEntityNotFound(_0x1fd405,_0x334b28){return function(_0x1ad2b6){if(!_0x1ad2b6){_0x1fd405['sendStatus'](0x194);}return _0x1ad2b6;};}function handleError(_0x16c951,_0x5f4c35){_0x5f4c35=_0x5f4c35||0x1f4;return function(_0x407296){logger[_0x2870('0x29')](_0x407296['stack']);if(_0x407296[_0x2870('0x2a')]){delete _0x407296['name'];}_0x16c951[_0x2870('0x1b')](_0x5f4c35)[_0x2870('0x2b')](_0x407296);};}exports['index']=function(_0xc4368b,_0x4b6fbc){var _0x16ea93={},_0x8a0a39={},_0x34d70a={'count':0x0,'rows':[]};var _0x2a5bd6=_[_0x2870('0x2c')](db[_0x2870('0x2d')][_0x2870('0x2e')],function(_0x398d20){return{'name':_0x398d20['fieldName'],'type':_0x398d20['type']['key']};});_0x8a0a39[_0x2870('0x2f')]=_['map'](_0x2a5bd6,_0x2870('0x2a'));_0x8a0a39['query']=_[_0x2870('0x30')](_0xc4368b[_0x2870('0x31')]);_0x8a0a39[_0x2870('0x32')]=_[_0x2870('0x33')](_0x8a0a39[_0x2870('0x2f')],_0x8a0a39[_0x2870('0x31')]);_0x16ea93[_0x2870('0x34')]=_[_0x2870('0x33')](_0x8a0a39['model'],qs[_0x2870('0x35')](_0xc4368b[_0x2870('0x31')][_0x2870('0x35')]));_0x16ea93[_0x2870('0x34')]=_0x16ea93[_0x2870('0x34')]['length']?_0x16ea93[_0x2870('0x34')]:_0x8a0a39[_0x2870('0x2f')];if(!_0xc4368b[_0x2870('0x31')]['hasOwnProperty'](_0x2870('0x36'))){_0x16ea93[_0x2870('0x20')]=qs[_0x2870('0x20')](_0xc4368b['query']['limit']);_0x16ea93[_0x2870('0x1e')]=qs['offset'](_0xc4368b[_0x2870('0x31')][_0x2870('0x1e')]);}_0x16ea93[_0x2870('0x37')]=qs['sort'](_0xc4368b['query']['sort']);_0x16ea93[_0x2870('0x38')]=qs[_0x2870('0x32')](_[_0x2870('0x39')](_0xc4368b[_0x2870('0x31')],_0x8a0a39['filters']),_0x2a5bd6);if(_0xc4368b[_0x2870('0x31')]['filter']){_0x16ea93[_0x2870('0x38')]=_[_0x2870('0x3a')](_0x16ea93[_0x2870('0x38')],{'$or':_[_0x2870('0x2c')](_0x2a5bd6,function(_0xbfd624){if(_0xbfd624['type']!==_0x2870('0x3b')){var _0x29cff5={};_0x29cff5[_0xbfd624[_0x2870('0x2a')]]={'$like':'%'+_0xc4368b['query'][_0x2870('0x3c')]+'%'};return _0x29cff5;}})});}_0x16ea93=_[_0x2870('0x3a')]({},_0x16ea93,_0xc4368b['options']);var _0x1a3856={'where':_0x16ea93[_0x2870('0x38')]};return db[_0x2870('0x2d')][_0x2870('0x21')](_0x1a3856)['then'](function(_0x30fa11){_0x34d70a[_0x2870('0x21')]=_0x30fa11;if(_0xc4368b[_0x2870('0x31')]['includeAll']){_0x16ea93['include']=[{'all':!![]}];}return db[_0x2870('0x2d')][_0x2870('0x3d')](_0x16ea93);})[_0x2870('0x27')](function(_0x3009ef){_0x34d70a[_0x2870('0x3e')]=_0x3009ef;return _0x34d70a;})[_0x2870('0x27')](respondWithFilteredResult(_0x4b6fbc,_0x16ea93))[_0x2870('0x3f')](handleError(_0x4b6fbc,null));};exports['show']=function(_0x1d28ec,_0x58f63b){var _0x3b1731={'raw':!![],'where':{'id':_0x1d28ec[_0x2870('0x40')]['id']}},_0x20b6ce={};_0x20b6ce['model']=_[_0x2870('0x30')](db['VtigerField'][_0x2870('0x2e')]);_0x20b6ce['query']=_[_0x2870('0x30')](_0x1d28ec['query']);_0x20b6ce[_0x2870('0x32')]=_[_0x2870('0x33')](_0x20b6ce[_0x2870('0x2f')],_0x20b6ce['query']);_0x3b1731[_0x2870('0x34')]=_['intersection'](_0x20b6ce[_0x2870('0x2f')],qs[_0x2870('0x35')](_0x1d28ec[_0x2870('0x31')][_0x2870('0x35')]));_0x3b1731[_0x2870('0x34')]=_0x3b1731[_0x2870('0x34')]['length']?_0x3b1731['attributes']:_0x20b6ce[_0x2870('0x2f')];if(_0x1d28ec['query'][_0x2870('0x41')]){_0x3b1731['include']=[{'all':!![]}];}_0x3b1731=_[_0x2870('0x3a')]({},_0x3b1731,_0x1d28ec['options']);return db[_0x2870('0x2d')][_0x2870('0x42')](_0x3b1731)[_0x2870('0x27')](handleEntityNotFound(_0x58f63b,null))['then'](respondWithResult(_0x58f63b,null))[_0x2870('0x3f')](handleError(_0x58f63b,null));};exports['create']=function(_0x4eb451,_0x1c9031){return db[_0x2870('0x2d')][_0x2870('0x43')](_0x4eb451['body'],{})['then'](respondWithResult(_0x1c9031,0xc9))[_0x2870('0x3f')](handleError(_0x1c9031,null));};exports[_0x2870('0x26')]=function(_0x7ac813,_0x417b43){if(_0x7ac813[_0x2870('0x44')]['id']){delete _0x7ac813[_0x2870('0x44')]['id'];}return db[_0x2870('0x2d')]['find']({'where':{'id':_0x7ac813['params']['id']}})[_0x2870('0x27')](handleEntityNotFound(_0x417b43,null))['then'](saveUpdates(_0x7ac813[_0x2870('0x44')],null))['then'](respondWithResult(_0x417b43,null))['catch'](handleError(_0x417b43,null));};exports[_0x2870('0x28')]=function(_0x3bfbe0,_0x15344d){return db['VtigerField']['find']({'where':{'id':_0x3bfbe0['params']['id']}})['then'](handleEntityNotFound(_0x15344d,null))['then'](removeEntity(_0x15344d,null))[_0x2870('0x3f')](handleError(_0x15344d,null));}; \ No newline at end of file +var _0x30fa=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','VtigerField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2b94f1,_0x2e2fcd){var _0x5ccf5c=function(_0x51f303){while(--_0x51f303){_0x2b94f1['push'](_0x2b94f1['shift']());}};_0x5ccf5c(++_0x2e2fcd);}(_0x30fa,0x139));var _0xa30f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x30fa[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xa30f('0x0'));var rimraf=require(_0xa30f('0x1'));var zipdir=require(_0xa30f('0x2'));var jsonpatch=require(_0xa30f('0x3'));var rp=require(_0xa30f('0x4'));var moment=require('moment');var BPromise=require(_0xa30f('0x5'));var Mustache=require(_0xa30f('0x6'));var util=require(_0xa30f('0x7'));var path=require(_0xa30f('0x8'));var sox=require(_0xa30f('0x9'));var csv=require(_0xa30f('0xa'));var ejs=require(_0xa30f('0xb'));var fs=require('fs');var fs_extra=require(_0xa30f('0xc'));var _=require(_0xa30f('0xd'));var squel=require(_0xa30f('0xe'));var crypto=require(_0xa30f('0xf'));var jsforce=require(_0xa30f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa30f('0xa'));var querystring=require(_0xa30f('0x11'));var Papa=require('papaparse');var Redis=require(_0xa30f('0x12'));var authService=require(_0xa30f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa30f('0x14'));var logger=require(_0xa30f('0x15'))(_0xa30f('0x16'));var utils=require('../../config/utils');var config=require(_0xa30f('0x17'));var licenseUtil=require(_0xa30f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220a01,_0x2170cd){_0x2170cd=_0x2170cd||0xcc;return function(_0x4f51c6){if(_0x4f51c6){return _0x220a01[_0xa30f('0x19')](_0x2170cd);}return _0x220a01[_0xa30f('0x1a')](_0x2170cd)[_0xa30f('0x1b')]();};}function respondWithResult(_0x4b870c,_0x12ab07){_0x12ab07=_0x12ab07||0xc8;return function(_0x3b2fd9){if(_0x3b2fd9){return _0x4b870c['status'](_0x12ab07)[_0xa30f('0x1c')](_0x3b2fd9);}};}function respondWithFilteredResult(_0x30462c,_0xdd42a4){return function(_0x5089a5){if(_0x5089a5){var _0xf68f65=typeof _0xdd42a4[_0xa30f('0x1d')]===_0xa30f('0x1e')&&typeof _0xdd42a4[_0xa30f('0x1f')]===_0xa30f('0x1e');var _0x5f2cc5=_0x5089a5[_0xa30f('0x20')];var _0x57da7e=_0xf68f65?0x0:_0xdd42a4[_0xa30f('0x1d')];var _0x19c975=_0xf68f65?_0x5089a5[_0xa30f('0x20')]:_0xdd42a4[_0xa30f('0x1d')]+_0xdd42a4[_0xa30f('0x1f')];var _0x65a32e;if(_0x19c975>=_0x5f2cc5){_0x19c975=_0x5f2cc5;_0x65a32e=0xc8;}else{_0x65a32e=0xce;}_0x30462c[_0xa30f('0x1a')](_0x65a32e);return _0x30462c[_0xa30f('0x21')]('Content-Range',_0x57da7e+'-'+_0x19c975+'/'+_0x5f2cc5)['json'](_0x5089a5);}return null;};}function patchUpdates(_0x5bb2c7){return function(_0x6fcefe){try{jsonpatch[_0xa30f('0x22')](_0x6fcefe,_0x5bb2c7,!![]);}catch(_0x4711ea){return BPromise[_0xa30f('0x23')](_0x4711ea);}return _0x6fcefe[_0xa30f('0x24')]();};}function saveUpdates(_0x2b616d,_0x587992){return function(_0x2e8fc0){if(_0x2e8fc0){return _0x2e8fc0['update'](_0x2b616d)['then'](function(_0x3468f8){return _0x3468f8;});}return null;};}function removeEntity(_0x11bd4e,_0x2e2848){return function(_0x3823fb){if(_0x3823fb){return _0x3823fb['destroy']()[_0xa30f('0x25')](function(){_0x11bd4e[_0xa30f('0x1a')](0xcc)[_0xa30f('0x1b')]();});}};}function handleEntityNotFound(_0x423e45,_0x154c29){return function(_0x47707c){if(!_0x47707c){_0x423e45[_0xa30f('0x19')](0x194);}return _0x47707c;};}function handleError(_0x344e3f,_0xd4a1da){_0xd4a1da=_0xd4a1da||0x1f4;return function(_0xf89093){logger[_0xa30f('0x26')](_0xf89093['stack']);if(_0xf89093[_0xa30f('0x27')]){delete _0xf89093[_0xa30f('0x27')];}_0x344e3f[_0xa30f('0x1a')](_0xd4a1da)[_0xa30f('0x28')](_0xf89093);};}exports['index']=function(_0x24fbf0,_0x39fcab){var _0x2e3146={},_0x404068={},_0x1c2a09={'count':0x0,'rows':[]};var _0x21b6e1=_['map'](db[_0xa30f('0x29')]['rawAttributes'],function(_0x7c3a4){return{'name':_0x7c3a4[_0xa30f('0x2a')],'type':_0x7c3a4[_0xa30f('0x2b')]['key']};});_0x404068[_0xa30f('0x2c')]=_['map'](_0x21b6e1,'name');_0x404068[_0xa30f('0x2d')]=_[_0xa30f('0x2e')](_0x24fbf0[_0xa30f('0x2d')]);_0x404068[_0xa30f('0x2f')]=_['intersection'](_0x404068[_0xa30f('0x2c')],_0x404068[_0xa30f('0x2d')]);_0x2e3146[_0xa30f('0x30')]=_[_0xa30f('0x31')](_0x404068[_0xa30f('0x2c')],qs[_0xa30f('0x32')](_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x32')]));_0x2e3146['attributes']=_0x2e3146[_0xa30f('0x30')][_0xa30f('0x33')]?_0x2e3146[_0xa30f('0x30')]:_0x404068[_0xa30f('0x2c')];if(!_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x34')](_0xa30f('0x35'))){_0x2e3146[_0xa30f('0x1f')]=qs[_0xa30f('0x1f')](_0x24fbf0['query']['limit']);_0x2e3146[_0xa30f('0x1d')]=qs[_0xa30f('0x1d')](_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x1d')]);}_0x2e3146[_0xa30f('0x36')]=qs[_0xa30f('0x37')](_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x37')]);_0x2e3146[_0xa30f('0x38')]=qs[_0xa30f('0x2f')](_[_0xa30f('0x39')](_0x24fbf0[_0xa30f('0x2d')],_0x404068[_0xa30f('0x2f')]),_0x21b6e1);if(_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x3a')]){_0x2e3146[_0xa30f('0x38')]=_[_0xa30f('0x3b')](_0x2e3146[_0xa30f('0x38')],{'$or':_['map'](_0x21b6e1,function(_0x222347){if(_0x222347[_0xa30f('0x2b')]!==_0xa30f('0x3c')){var _0x5c9d2d={};_0x5c9d2d[_0x222347[_0xa30f('0x27')]]={'$like':'%'+_0x24fbf0[_0xa30f('0x2d')]['filter']+'%'};return _0x5c9d2d;}})});}_0x2e3146=_[_0xa30f('0x3b')]({},_0x2e3146,_0x24fbf0[_0xa30f('0x3d')]);var _0x1dcaec={'where':_0x2e3146[_0xa30f('0x38')]};return db['VtigerField']['count'](_0x1dcaec)[_0xa30f('0x25')](function(_0x45fea1){_0x1c2a09['count']=_0x45fea1;if(_0x24fbf0[_0xa30f('0x2d')][_0xa30f('0x3e')]){_0x2e3146[_0xa30f('0x3f')]=[{'all':!![]}];}return db[_0xa30f('0x29')]['findAll'](_0x2e3146);})[_0xa30f('0x25')](function(_0x3963a0){_0x1c2a09[_0xa30f('0x40')]=_0x3963a0;return _0x1c2a09;})[_0xa30f('0x25')](respondWithFilteredResult(_0x39fcab,_0x2e3146))[_0xa30f('0x41')](handleError(_0x39fcab,null));};exports[_0xa30f('0x42')]=function(_0x411402,_0x24ab83){var _0x105c00={'raw':!![],'where':{'id':_0x411402[_0xa30f('0x43')]['id']}},_0x3ab623={};_0x3ab623[_0xa30f('0x2c')]=_[_0xa30f('0x2e')](db[_0xa30f('0x29')][_0xa30f('0x44')]);_0x3ab623[_0xa30f('0x2d')]=_[_0xa30f('0x2e')](_0x411402[_0xa30f('0x2d')]);_0x3ab623[_0xa30f('0x2f')]=_[_0xa30f('0x31')](_0x3ab623[_0xa30f('0x2c')],_0x3ab623[_0xa30f('0x2d')]);_0x105c00['attributes']=_[_0xa30f('0x31')](_0x3ab623[_0xa30f('0x2c')],qs['fields'](_0x411402[_0xa30f('0x2d')]['fields']));_0x105c00['attributes']=_0x105c00[_0xa30f('0x30')][_0xa30f('0x33')]?_0x105c00[_0xa30f('0x30')]:_0x3ab623[_0xa30f('0x2c')];if(_0x411402[_0xa30f('0x2d')]['includeAll']){_0x105c00[_0xa30f('0x3f')]=[{'all':!![]}];}_0x105c00=_[_0xa30f('0x3b')]({},_0x105c00,_0x411402[_0xa30f('0x3d')]);return db[_0xa30f('0x29')][_0xa30f('0x45')](_0x105c00)[_0xa30f('0x25')](handleEntityNotFound(_0x24ab83,null))[_0xa30f('0x25')](respondWithResult(_0x24ab83,null))[_0xa30f('0x41')](handleError(_0x24ab83,null));};exports['create']=function(_0x227878,_0x18a5e5){return db['VtigerField'][_0xa30f('0x46')](_0x227878[_0xa30f('0x47')],{})[_0xa30f('0x25')](respondWithResult(_0x18a5e5,0xc9))[_0xa30f('0x41')](handleError(_0x18a5e5,null));};exports[_0xa30f('0x48')]=function(_0x5e9d6f,_0x339934){if(_0x5e9d6f[_0xa30f('0x47')]['id']){delete _0x5e9d6f[_0xa30f('0x47')]['id'];}return db[_0xa30f('0x29')][_0xa30f('0x45')]({'where':{'id':_0x5e9d6f[_0xa30f('0x43')]['id']}})[_0xa30f('0x25')](handleEntityNotFound(_0x339934,null))[_0xa30f('0x25')](saveUpdates(_0x5e9d6f[_0xa30f('0x47')],null))[_0xa30f('0x25')](respondWithResult(_0x339934,null))[_0xa30f('0x41')](handleError(_0x339934,null));};exports[_0xa30f('0x49')]=function(_0xb5d6fe,_0x3cf0c1){return db['VtigerField'][_0xa30f('0x45')]({'where':{'id':_0xb5d6fe['params']['id']}})[_0xa30f('0x25')](handleEntityNotFound(_0x3cf0c1,null))[_0xa30f('0x25')](removeEntity(_0x3cf0c1,null))['catch'](handleError(_0x3cf0c1,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c8ec4d0..bf29a77 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 _0x0d77=['define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x1f885e,_0x83ce8){var _0xb76bca=function(_0xca25c0){while(--_0xca25c0){_0x1f885e['push'](_0x1f885e['shift']());}};_0xb76bca(++_0x83ce8);}(_0x0d77,0x18d));var _0x70d7=function(_0x52103c,_0x2c3630){_0x52103c=_0x52103c-0x0;var _0x575c0e=_0x0d77[_0x52103c];return _0x575c0e;};'use strict';var _=require('lodash');var util=require(_0x70d7('0x0'));var logger=require(_0x70d7('0x1'))('api');var moment=require(_0x70d7('0x2'));var BPromise=require(_0x70d7('0x3'));var rp=require(_0x70d7('0x4'));var fs=require('fs');var path=require(_0x70d7('0x5'));var rimraf=require(_0x70d7('0x6'));var config=require(_0x70d7('0x7'));var attributes=require(_0x70d7('0x8'));module['exports']=function(_0x320921,_0x15d3bd){return _0x320921[_0x70d7('0x9')]('VtigerField',attributes,{'tableName':_0x70d7('0xa'),'paranoid':![],'indexes':[{'name':_0x70d7('0xb'),'fields':[_0x70d7('0xc'),_0x70d7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a03=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intVtigerField.attributes','VtigerField','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x17d4a3,_0x412974){var _0x29a932=function(_0x1b157e){while(--_0x1b157e){_0x17d4a3['push'](_0x17d4a3['shift']());}};_0x29a932(++_0x412974);}(_0x6a03,0xa8));var _0x36a0=function(_0x21618,_0x5f5d19){_0x21618=_0x21618-0x0;var _0x290d51=_0x6a03[_0x21618];return _0x290d51;};'use strict';var _=require(_0x36a0('0x0'));var util=require(_0x36a0('0x1'));var logger=require(_0x36a0('0x2'))(_0x36a0('0x3'));var moment=require(_0x36a0('0x4'));var BPromise=require(_0x36a0('0x5'));var rp=require(_0x36a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36a0('0x7'));var attributes=require(_0x36a0('0x8'));module['exports']=function(_0x3909ac,_0x56794f){return _0x3909ac['define'](_0x36a0('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x36a0('0xa'),'fields':[_0x36a0('0xb'),_0x36a0('0xc')],'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 b83ed01..ec599d7 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 _0x9897=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x490726,_0x4728a6){var _0x55d52e=function(_0x451e19){while(--_0x451e19){_0x490726['push'](_0x490726['shift']());}};_0x55d52e(++_0x4728a6);}(_0x9897,0x104));var _0x7989=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x9897[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x7989('0x0'));var util=require(_0x7989('0x1'));var moment=require(_0x7989('0x2'));var BPromise=require('bluebird');var rs=require(_0x7989('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7989('0x4'))['db'];var utils=require(_0x7989('0x5'));var logger=require(_0x7989('0x6'))(_0x7989('0x7'));var config=require(_0x7989('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a3dcb,_0x788483,_0x5b3d39){return new BPromise(function(_0x5da8f7,_0x4214ca){return client[_0x7989('0x9')](_0x1a3dcb,_0x5b3d39)[_0x7989('0xa')](function(_0x271c43){logger[_0x7989('0xb')](_0x7989('0xc'),_0x788483,_0x7989('0xd'));logger[_0x7989('0xe')](_0x7989('0xf'),_0x788483,'request\x20sent',JSON[_0x7989('0x10')](_0x271c43));if(_0x271c43['error']){if(_0x271c43[_0x7989('0x11')][_0x7989('0x12')]===0x1f4){logger[_0x7989('0x11')]('VtigerField,\x20%s,\x20%s',_0x788483,_0x271c43[_0x7989('0x11')]['message']);return _0x4214ca(_0x271c43[_0x7989('0x11')]['message']);}logger[_0x7989('0x11')]('VtigerField,\x20%s,\x20%s',_0x788483,_0x271c43[_0x7989('0x11')][_0x7989('0x13')]);return _0x5da8f7(_0x271c43[_0x7989('0x11')][_0x7989('0x13')]);}else{logger['info'](_0x7989('0xc'),_0x788483,_0x7989('0xd'));_0x5da8f7(_0x271c43[_0x7989('0x14')][_0x7989('0x13')]);}})[_0x7989('0x15')](function(_0x784424){logger['error']('VtigerField,\x20%s,\x20%s',_0x788483,_0x784424);_0x4214ca(_0x784424);});});} \ No newline at end of file +var _0x82b0=['rpc','../../config/environment','jayson/promise','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x482e6f,_0x1e73a9){var _0x205d86=function(_0x43306e){while(--_0x43306e){_0x482e6f['push'](_0x482e6f['shift']());}};_0x205d86(++_0x1e73a9);}(_0x82b0,0x1f2));var _0x082b=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x82b0[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var moment=require(_0x082b('0x2'));var BPromise=require(_0x082b('0x3'));var rs=require(_0x082b('0x4'));var fs=require('fs');var Redis=require(_0x082b('0x5'));var db=require(_0x082b('0x6'))['db'];var utils=require(_0x082b('0x7'));var logger=require('../../config/logger')(_0x082b('0x8'));var config=require(_0x082b('0x9'));var jayson=require(_0x082b('0xa'));var client=jayson['client'][_0x082b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47e1b3,_0x33c506,_0x2936a1){return new BPromise(function(_0x5f1f81,_0x4652f3){return client['request'](_0x47e1b3,_0x2936a1)[_0x082b('0xc')](function(_0x1c04a8){logger[_0x082b('0xd')](_0x082b('0xe'),_0x33c506,_0x082b('0xf'));logger[_0x082b('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x33c506,_0x082b('0xf'),JSON['stringify'](_0x1c04a8));if(_0x1c04a8[_0x082b('0x11')]){if(_0x1c04a8[_0x082b('0x11')][_0x082b('0x12')]===0x1f4){logger[_0x082b('0x11')](_0x082b('0xe'),_0x33c506,_0x1c04a8[_0x082b('0x11')]['message']);return _0x4652f3(_0x1c04a8[_0x082b('0x11')][_0x082b('0x13')]);}logger['error'](_0x082b('0xe'),_0x33c506,_0x1c04a8[_0x082b('0x11')]['message']);return _0x5f1f81(_0x1c04a8[_0x082b('0x11')][_0x082b('0x13')]);}else{logger[_0x082b('0xd')](_0x082b('0xe'),_0x33c506,_0x082b('0xf'));_0x5f1f81(_0x1c04a8[_0x082b('0x14')][_0x082b('0x13')]);}})[_0x082b('0x15')](function(_0x5ca0db){logger[_0x082b('0x11')](_0x082b('0xe'),_0x33c506,_0x5ca0db);_0x4652f3(_0x5ca0db);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 91481bb..73317e1 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 _0x8bf3=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put'];(function(_0x39c127,_0x24c1a2){var _0x37f7d7=function(_0x42fe99){while(--_0x42fe99){_0x39c127['push'](_0x39c127['shift']());}};_0x37f7d7(++_0x24c1a2);}(_0x8bf3,0x130));var _0x38bf=function(_0x2eea86,_0x121981){_0x2eea86=_0x2eea86-0x0;var _0x3fcb89=_0x8bf3[_0x2eea86];return _0x3fcb89;};'use strict';var multer=require(_0x38bf('0x0'));var util=require(_0x38bf('0x1'));var path=require(_0x38bf('0x2'));var timeout=require(_0x38bf('0x3'));var express=require(_0x38bf('0x4'));var router=express[_0x38bf('0x5')]();var fs_extra=require(_0x38bf('0x6'));var auth=require(_0x38bf('0x7'));var interaction=require(_0x38bf('0x8'));var config=require('../../config/environment');var controller=require(_0x38bf('0x9'));router[_0x38bf('0xa')]('/',auth[_0x38bf('0xb')](),controller['index']);router[_0x38bf('0xa')]('/:id',auth[_0x38bf('0xb')](),controller[_0x38bf('0xc')]);router[_0x38bf('0xa')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0xe')]);router[_0x38bf('0xa')](_0x38bf('0xf'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x38bf('0x11')]);router[_0x38bf('0x12')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x13')]);router[_0x38bf('0x14')](_0x38bf('0x15'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x16')]);router['delete'](_0x38bf('0x15'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x17')]);module[_0x38bf('0x18')]=router; \ No newline at end of file +var _0x6e71=['getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5c3cfd,_0x491545){var _0x3488f1=function(_0x3a3784){while(--_0x3a3784){_0x5c3cfd['push'](_0x5c3cfd['shift']());}};_0x3488f1(++_0x491545);}(_0x6e71,0xc2));var _0x16e7=function(_0x3a711b,_0x2c03b4){_0x3a711b=_0x3a711b-0x0;var _0x194f2a=_0x6e71[_0x3a711b];return _0x194f2a;};'use strict';var multer=require(_0x16e7('0x0'));var util=require(_0x16e7('0x1'));var path=require('path');var timeout=require(_0x16e7('0x2'));var express=require(_0x16e7('0x3'));var router=express[_0x16e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x16e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16e7('0x6'));var controller=require(_0x16e7('0x7'));router[_0x16e7('0x8')]('/',auth[_0x16e7('0x9')](),controller[_0x16e7('0xa')]);router[_0x16e7('0x8')](_0x16e7('0xb'),auth[_0x16e7('0x9')](),controller[_0x16e7('0xc')]);router[_0x16e7('0x8')]('/:id/configurations',auth[_0x16e7('0x9')](),controller[_0x16e7('0xd')]);router[_0x16e7('0x8')](_0x16e7('0xe'),auth['isAuthenticated'](),controller[_0x16e7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x16e7('0x10')]);router[_0x16e7('0x11')](_0x16e7('0x12'),auth[_0x16e7('0x9')](),controller[_0x16e7('0x13')]);router['put']('/:id',auth[_0x16e7('0x9')](),controller[_0x16e7('0x14')]);router[_0x16e7('0x15')](_0x16e7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x16e7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b9c82d5..502f9ec 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 _0x1472=['STRING','username','ENUM','password','token','newTab','integrationTab','sequelize','exports'];(function(_0x3ab75e,_0x5abf0d){var _0xc1cfce=function(_0x900176){while(--_0x900176){_0x3ab75e['push'](_0x3ab75e['shift']());}};_0xc1cfce(++_0x5abf0d);}(_0x1472,0x166));var _0x2147=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x1472[_0x4667b2];return _0x1070f2;};'use strict';var Sequelize=require(_0x2147('0x0'));module[_0x2147('0x1')]={'name':{'type':Sequelize[_0x2147('0x2')]},'description':{'type':Sequelize[_0x2147('0x2')]},'username':{'type':Sequelize[_0x2147('0x2')],'unique':_0x2147('0x3')},'password':{'type':Sequelize[_0x2147('0x2')]},'token':{'type':Sequelize[_0x2147('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x2147('0x4')](_0x2147('0x5'),_0x2147('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2147('0x4')]('integrationTab',_0x2147('0x7')),'defaultValue':_0x2147('0x8')}}; \ No newline at end of file +var _0x5d0a=['password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4fd465,_0x515456){_0x4fd465=_0x4fd465-0x0;var _0x43cbe7=_0x5d0a[_0x4fd465];return _0x43cbe7;};'use strict';var Sequelize=require(_0xa5d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa5d0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa5d0('0x1')],'unique':_0xa5d0('0x2')},'password':{'type':Sequelize[_0xa5d0('0x1')]},'token':{'type':Sequelize[_0xa5d0('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa5d0('0x3')},'authType':{'type':Sequelize[_0xa5d0('0x4')](_0xa5d0('0x5'),_0xa5d0('0x6')),'defaultValue':_0xa5d0('0x5')},'serverUrl':{'type':Sequelize[_0xa5d0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa5d0('0x4')](_0xa5d0('0x7'),_0xa5d0('0x8')),'defaultValue':_0xa5d0('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index ec08804..5565128 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 _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x5423,0xe3));var _0x3542=function(_0x4c0b90,_0xcfcec9){_0x4c0b90=_0x4c0b90-0x0;var _0x17451e=_0x5423[_0x4c0b90];return _0x17451e;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ No newline at end of file +var _0xbdb7=['rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','ZendeskAccount','include','findAll','rows','intersection','length','includeAll','options','catch','create','body','update','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','authType','remoteUri','substring','GET','format','headers','%s:%s','username','toString','base64','Basic\x20%s','%s/token:%s','token','Unknown\x20authentication\x20type','subject','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','map'];(function(_0x6cd464,_0x2378ad){var _0x40ab30=function(_0x5da98b){while(--_0x5da98b){_0x6cd464['push'](_0x6cd464['shift']());}};_0x40ab30(++_0x2378ad);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x321327,_0x4965b){_0x321327=_0x321327-0x0;var _0x33be38=_0xbdb7[_0x321327];return _0x33be38;};'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'];var integrations=require(_0x7bdb('0x17'));function respondWithStatusCode(_0x496613,_0x8d74ff){_0x8d74ff=_0x8d74ff||0xcc;return function(_0x53021d){if(_0x53021d){return _0x496613['sendStatus'](_0x8d74ff);}return _0x496613[_0x7bdb('0x18')](_0x8d74ff)[_0x7bdb('0x19')]();};}function respondWithResult(_0x4fd91a,_0x50eeca){_0x50eeca=_0x50eeca||0xc8;return function(_0x4e98f7){if(_0x4e98f7){return _0x4fd91a[_0x7bdb('0x18')](_0x50eeca)[_0x7bdb('0x1a')](_0x4e98f7);}};}function respondWithFilteredResult(_0xe9919f,_0x25d417){return function(_0x31c909){if(_0x31c909){var _0xbde12a=typeof _0x25d417[_0x7bdb('0x1b')]===_0x7bdb('0x1c')&&typeof _0x25d417['limit']===_0x7bdb('0x1c');var _0x43f352=_0x31c909[_0x7bdb('0x1d')];var _0x2aff6a=_0xbde12a?0x0:_0x25d417['offset'];var _0x41f540=_0xbde12a?_0x31c909[_0x7bdb('0x1d')]:_0x25d417['offset']+_0x25d417[_0x7bdb('0x1e')];var _0x31f78e;if(_0x41f540>=_0x43f352){_0x41f540=_0x43f352;_0x31f78e=0xc8;}else{_0x31f78e=0xce;}_0xe9919f[_0x7bdb('0x18')](_0x31f78e);return _0xe9919f[_0x7bdb('0x1f')](_0x7bdb('0x20'),_0x2aff6a+'-'+_0x41f540+'/'+_0x43f352)['json'](_0x31c909);}return null;};}function patchUpdates(_0x49f353){return function(_0x677825){try{jsonpatch[_0x7bdb('0x21')](_0x677825,_0x49f353,!![]);}catch(_0x5daea4){return BPromise[_0x7bdb('0x22')](_0x5daea4);}return _0x677825[_0x7bdb('0x23')]();};}function saveUpdates(_0x346c72,_0x3f53e7){return function(_0x3a1d0f){if(_0x3a1d0f){return _0x3a1d0f['update'](_0x346c72)[_0x7bdb('0x24')](function(_0xdad53d){return _0xdad53d;});}return null;};}function removeEntity(_0x40c447,_0x3a456f){return function(_0x481f4b){if(_0x481f4b){return _0x481f4b['destroy']()[_0x7bdb('0x24')](function(){_0x40c447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e02,_0x2abef6){return function(_0x51ab04){if(!_0x51ab04){_0x4a9e02[_0x7bdb('0x25')](0x194);}return _0x51ab04;};}function handleError(_0x72ba69,_0x3ec129){_0x3ec129=_0x3ec129||0x1f4;return function(_0x7c09cf){logger[_0x7bdb('0x26')](_0x7c09cf['stack']);if(_0x7c09cf[_0x7bdb('0x27')]){delete _0x7c09cf[_0x7bdb('0x27')];}_0x72ba69[_0x7bdb('0x18')](_0x3ec129)[_0x7bdb('0x28')](_0x7c09cf);};}exports[_0x7bdb('0x29')]=function(_0x2e8e65,_0x1e9996){var _0xd2d7be={},_0x25a1fe={},_0x365c02={'count':0x0,'rows':[]};var _0x9ec48d=_[_0x7bdb('0x2a')](db['ZendeskAccount'][_0x7bdb('0x2b')],function(_0x23fc3a){return{'name':_0x23fc3a[_0x7bdb('0x2c')],'type':_0x23fc3a[_0x7bdb('0x2d')][_0x7bdb('0x2e')]};});_0x25a1fe['model']=_[_0x7bdb('0x2a')](_0x9ec48d,_0x7bdb('0x27'));_0x25a1fe[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x2e8e65['query']);_0x25a1fe['filters']=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],_0x25a1fe['query']);_0xd2d7be[_0x7bdb('0x32')]=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x2e8e65[_0x7bdb('0x2f')]['fields']));_0xd2d7be[_0x7bdb('0x32')]=_0xd2d7be['attributes']['length']?_0xd2d7be[_0x7bdb('0x32')]:_0x25a1fe['model'];if(!_0x2e8e65[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0xd2d7be[_0x7bdb('0x1e')]=qs[_0x7bdb('0x1e')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x1e')]);_0xd2d7be[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x2e8e65['query'][_0x7bdb('0x1b')]);}_0xd2d7be[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0xd2d7be[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x2e8e65[_0x7bdb('0x2f')],_0x25a1fe['filters']),_0x9ec48d);if(_0x2e8e65['query'][_0x7bdb('0x39')]){_0xd2d7be[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0xd2d7be[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x9ec48d,function(_0x509e90){if(_0x509e90['type']!==_0x7bdb('0x3b')){var _0x5d7c1f={};_0x5d7c1f[_0x509e90[_0x7bdb('0x27')]]={'$like':'%'+_0x2e8e65['query'][_0x7bdb('0x39')]+'%'};return _0x5d7c1f;}})});}_0xd2d7be=_['merge']({},_0xd2d7be,_0x2e8e65['options']);var _0x21dae7={'where':_0xd2d7be[_0x7bdb('0x36')]};return db[_0x7bdb('0x3c')][_0x7bdb('0x1d')](_0x21dae7)[_0x7bdb('0x24')](function(_0x2b4829){_0x365c02[_0x7bdb('0x1d')]=_0x2b4829;if(_0x2e8e65['query']['includeAll']){_0xd2d7be[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x3c')][_0x7bdb('0x3e')](_0xd2d7be);})[_0x7bdb('0x24')](function(_0x39fbca){_0x365c02[_0x7bdb('0x3f')]=_0x39fbca;return _0x365c02;})[_0x7bdb('0x24')](respondWithFilteredResult(_0x1e9996,_0xd2d7be))['catch'](handleError(_0x1e9996,null));};exports['show']=function(_0x1bcbcd,_0x8e893e){var _0x4636f8={'raw':![],'where':{'id':_0x1bcbcd['params']['id']}},_0x72a81c={};_0x72a81c[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x3c')][_0x7bdb('0x2b')]);_0x72a81c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x1bcbcd[_0x7bdb('0x2f')]);_0x72a81c[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],_0x72a81c[_0x7bdb('0x2f')]);_0x4636f8['attributes']=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],qs['fields'](_0x1bcbcd[_0x7bdb('0x2f')]['fields']));_0x4636f8[_0x7bdb('0x32')]=_0x4636f8[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x4636f8[_0x7bdb('0x32')]:_0x72a81c[_0x7bdb('0x31')];if(_0x1bcbcd['query'][_0x7bdb('0x42')]){_0x4636f8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x4636f8=_[_0x7bdb('0x3a')]({},_0x4636f8,_0x1bcbcd[_0x7bdb('0x43')]);return db[_0x7bdb('0x3c')]['find'](_0x4636f8)[_0x7bdb('0x24')](handleEntityNotFound(_0x8e893e,null))[_0x7bdb('0x24')](respondWithResult(_0x8e893e,null))[_0x7bdb('0x44')](handleError(_0x8e893e,null));};exports[_0x7bdb('0x45')]=function(_0x259007,_0x25c534){return db[_0x7bdb('0x3c')][_0x7bdb('0x45')](_0x259007[_0x7bdb('0x46')],{})[_0x7bdb('0x24')](respondWithResult(_0x25c534,0xc9))['catch'](handleError(_0x25c534,null));};exports[_0x7bdb('0x47')]=function(_0x58c4bc,_0x47cccd){if(_0x58c4bc[_0x7bdb('0x46')]['id']){delete _0x58c4bc[_0x7bdb('0x46')]['id'];}return db['ZendeskAccount'][_0x7bdb('0x48')]({'where':{'id':_0x58c4bc[_0x7bdb('0x49')]['id']}})['then'](handleEntityNotFound(_0x47cccd,null))['then'](saveUpdates(_0x58c4bc['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x47cccd,null))[_0x7bdb('0x44')](handleError(_0x47cccd,null));};exports[_0x7bdb('0x4a')]=function(_0x46410c,_0x33687b){return db[_0x7bdb('0x3c')][_0x7bdb('0x48')]({'where':{'id':_0x46410c[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x33687b,null))[_0x7bdb('0x24')](removeEntity(_0x33687b,null))['catch'](handleError(_0x33687b,null));};exports[_0x7bdb('0x4b')]=function(_0x4806e0,_0x240425,_0x27358d){var _0x5d564d={};var _0x457886={};var _0x493d23;var _0x258f29;return db['ZendeskAccount']['findOne']({'where':{'id':_0x4806e0[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x240425,null))['then'](function(_0x4e17f3){if(_0x4e17f3){_0x493d23=_0x4e17f3;_0x457886['model']=_[_0x7bdb('0x30')](db['ZendeskConfiguration']['rawAttributes']);_0x457886[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x4806e0[_0x7bdb('0x2f')]);_0x457886[_0x7bdb('0x37')]=_['intersection'](_0x457886[_0x7bdb('0x31')],_0x457886['query']);_0x5d564d[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x457886[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x5d564d['attributes']=_0x5d564d[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x5d564d[_0x7bdb('0x32')]:_0x457886['model'];_0x5d564d[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x4806e0['query'][_0x7bdb('0x35')]);_0x5d564d['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x4806e0['query'],_0x457886['filters']));if(_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x5d564d['where']=_[_0x7bdb('0x3a')](_0x5d564d['where'],{'$or':_[_0x7bdb('0x2a')](_0x5d564d['attributes'],function(_0x496cc3){var _0x22ef9c={};_0x22ef9c[_0x496cc3]={'$like':'%'+_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]+'%'};return _0x22ef9c;})});}_0x5d564d=_[_0x7bdb('0x3a')]({},_0x5d564d,_0x4806e0[_0x7bdb('0x43')]);return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})[_0x7bdb('0x24')](function(_0x8cf13a){if(_0x8cf13a){_0x258f29=_0x8cf13a[_0x7bdb('0x41')];if(!_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x4c')](_0x7bdb('0x4d'))){_0x5d564d['limit']=qs[_0x7bdb('0x1e')](_0x4806e0[_0x7bdb('0x2f')]['limit']);_0x5d564d[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);}return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})['then'](function(_0xa5624f){if(_0xa5624f){return _0xa5624f?{'count':_0x258f29,'rows':_0xa5624f}:null;}})[_0x7bdb('0x24')](respondWithResult(_0x240425,null))[_0x7bdb('0x44')](handleError(_0x240425,null));};exports['addConfiguration']=function(_0x3dbcf,_0x2c2fb7,_0x33b93a){if(_0x3dbcf[_0x7bdb('0x46')]['id']){delete _0x3dbcf[_0x7bdb('0x46')]['id'];}return db[_0x7bdb('0x3c')][_0x7bdb('0x4e')]({'where':{'id':_0x3dbcf[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2c2fb7,null))['then'](function(_0x7a7c4a){if(_0x7a7c4a){_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x4f')]=_0x7a7c4a['id'];_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x50')]=integrations[_0x7bdb('0x51')](_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x52')],_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x2d')]);_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x53')]=integrations[_0x7bdb('0x54')](_0x3dbcf['body'][_0x7bdb('0x52')],_0x3dbcf['body'][_0x7bdb('0x2d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x45')](_0x3dbcf['body'],{'include':[{'model':db[_0x7bdb('0x56')],'as':_0x7bdb('0x50')},{'model':db['ZendeskField'],'as':_0x7bdb('0x53')}]});}return null;})[_0x7bdb('0x24')](respondWithResult(_0x2c2fb7,null))['catch'](handleError(_0x2c2fb7,null));};exports[_0x7bdb('0x57')]=function(_0x1a706b,_0x579caa,_0x291fd3){var _0x237688='';return db['ZendeskAccount'][_0x7bdb('0x4e')]({'where':{'id':_0x1a706b[_0x7bdb('0x49')]['id']},'attributes':['id','username',_0x7bdb('0x58'),'token',_0x7bdb('0x59'),_0x7bdb('0x5a')]})[_0x7bdb('0x24')](handleEntityNotFound(_0x579caa,null))[_0x7bdb('0x24')](function(_0x1e5063){if(_0x1e5063){_0x237688=_0x1e5063['remoteUri'];var _0x590818=_0x237688['slice'](-0x1);if(_0x590818==='/'){_0x237688=_0x237688[_0x7bdb('0x5b')](0x0,_0x237688['lastIndexOf'](_0x590818));}var _0x242a35={'method':_0x7bdb('0x5c'),'uri':util[_0x7bdb('0x5d')]('%s/%s',_0x237688,'ticket_fields'),'json':!![]};switch(_0x1e5063[_0x7bdb('0x59')]){case _0x7bdb('0x58'):_0x242a35[_0x7bdb('0x5e')]={'Authorization':util[_0x7bdb('0x5d')]('Basic\x20%s',new Buffer(util[_0x7bdb('0x5d')](_0x7bdb('0x5f'),_0x1e5063[_0x7bdb('0x60')],_0x1e5063[_0x7bdb('0x58')]))[_0x7bdb('0x61')](_0x7bdb('0x62')))};break;case'token':_0x242a35[_0x7bdb('0x5e')]={'Authorization':util['format'](_0x7bdb('0x63'),new Buffer(util['format'](_0x7bdb('0x64'),_0x1e5063[_0x7bdb('0x60')],_0x1e5063[_0x7bdb('0x65')]))[_0x7bdb('0x61')](_0x7bdb('0x62')))};break;default:throw new db['Sequelize']['ValidationError'](_0x7bdb('0x66'));}return rp(_0x242a35);}})[_0x7bdb('0x24')](function(_0x51fec5){if(_0x51fec5){var _0x415ec5=[_0x7bdb('0x67'),'description',_0x7bdb('0x68'),_0x7bdb('0x69')];_['remove'](_0x51fec5[_0x7bdb('0x6a')],function(_0x493c69){return _0x415ec5['includes'](_0x493c69[_0x7bdb('0x2d')]);});return{'count':_0x51fec5[_0x7bdb('0x6a')]['length'],'rows':_['map'](_0x51fec5[_0x7bdb('0x6a')],function(_0x566a9e){return{'id':_0x566a9e['id'],'name':_0x566a9e[_0x7bdb('0x6b')]>0x7?_0x566a9e['title']:_0x566a9e[_0x7bdb('0x2d')],'custom':_0x566a9e[_0x7bdb('0x6b')]>0x7?!![]:![],'options':_0x566a9e[_0x7bdb('0x6c')]?_0x566a9e[_0x7bdb('0x6c')]:_0x566a9e['custom_field_options']?_0x566a9e[_0x7bdb('0x6d')]:[]};})};}})[_0x7bdb('0x24')](respondWithResult(_0x579caa,null))['catch'](function(_0x2be441){var _0x3096e0=_0x1a706b['query'][_0x7bdb('0x6e')]?0x1f4:_0x2be441[_0x7bdb('0x6f')]||0x1f4;logger[_0x7bdb('0x26')](_0x7bdb('0x70'),'getFields',_0x3096e0,JSON[_0x7bdb('0x71')](_0x2be441));delete _0x2be441['name'];if(_0x3096e0===0x191){_0x3096e0=0x190;}_0x579caa[_0x7bdb('0x18')](_0x3096e0)[_0x7bdb('0x28')](_0x1a706b[_0x7bdb('0x2f')]['test']?{'message':_0x7bdb('0x72'),'statusCode':_0x2be441[_0x7bdb('0x6f')]}:_0x2be441);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 80cff3f..32e36e8 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 _0xe6da=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1478fd,_0x4bfa47){var _0x2ab0b7=function(_0x42c0b3){while(--_0x42c0b3){_0x1478fd['push'](_0x1478fd['shift']());}};_0x2ab0b7(++_0x4bfa47);}(_0xe6da,0x1ab));var _0xae6d=function(_0x36277e,_0x417b0a){_0x36277e=_0x36277e-0x0;var _0x551c2f=_0xe6da[_0x36277e];return _0x551c2f;};'use strict';var _=require(_0xae6d('0x0'));var util=require('util');var logger=require(_0xae6d('0x1'))(_0xae6d('0x2'));var moment=require('moment');var BPromise=require(_0xae6d('0x3'));var rp=require(_0xae6d('0x4'));var fs=require('fs');var path=require(_0xae6d('0x5'));var rimraf=require(_0xae6d('0x6'));var config=require(_0xae6d('0x7'));var attributes=require(_0xae6d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xae6d('0x9')]=function(_0x4606c0,_0x3e60f9){return _0x4606c0['define'](_0xae6d('0xa'),attributes,{'tableName':_0xae6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d24=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x5e370e,_0x2b2f55){var _0x4cbf6b=function(_0x4d1f0c){while(--_0x4d1f0c){_0x5e370e['push'](_0x5e370e['shift']());}};_0x4cbf6b(++_0x2b2f55);}(_0x6d24,0x166));var _0x46d2=function(_0x442b6b,_0x2856a2){_0x442b6b=_0x442b6b-0x0;var _0x7cfac0=_0x6d24[_0x442b6b];return _0x7cfac0;};'use strict';var _=require(_0x46d2('0x0'));var util=require(_0x46d2('0x1'));var logger=require(_0x46d2('0x2'))(_0x46d2('0x3'));var moment=require(_0x46d2('0x4'));var BPromise=require(_0x46d2('0x5'));var rp=require(_0x46d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46d2('0x7'));var config=require(_0x46d2('0x8'));var attributes=require(_0x46d2('0x9'));var integrations=require(_0x46d2('0xa'));module[_0x46d2('0xb')]=function(_0x2c8084,_0x1d647d){return _0x2c8084[_0x46d2('0xc')](_0x46d2('0xd'),attributes,{'tableName':_0x46d2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index d715555..bd46f4e 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 _0x6838=['find','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount'];(function(_0x56ba4c,_0x454663){var _0x2c43ce=function(_0x356105){while(--_0x356105){_0x56ba4c['push'](_0x56ba4c['shift']());}};_0x2c43ce(++_0x454663);}(_0x6838,0x67));var _0x8683=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x6838[_0x5a1cc9];return _0x471761;};'use strict';var _=require('lodash');var util=require(_0x8683('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8683('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8683('0x2'));var logger=require(_0x8683('0x3'))(_0x8683('0x4'));var config=require(_0x8683('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8683('0x6')][_0x8683('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32680b,_0x592de9,_0x1ec478){return new BPromise(function(_0x135151,_0x19f4cd){return client[_0x8683('0x8')](_0x32680b,_0x1ec478)[_0x8683('0x9')](function(_0x13f7c6){logger[_0x8683('0xa')](_0x8683('0xb'),_0x592de9,_0x8683('0xc'));logger[_0x8683('0xd')](_0x8683('0xe'),_0x592de9,'request\x20sent',JSON[_0x8683('0xf')](_0x13f7c6));if(_0x13f7c6['error']){if(_0x13f7c6[_0x8683('0x10')][_0x8683('0x11')]===0x1f4){logger['error'](_0x8683('0xb'),_0x592de9,_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);return _0x19f4cd(_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);}logger[_0x8683('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x592de9,_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);return _0x135151(_0x13f7c6['error']['message']);}else{logger[_0x8683('0xa')](_0x8683('0xb'),_0x592de9,_0x8683('0xc'));_0x135151(_0x13f7c6[_0x8683('0x13')]['message']);}})[_0x8683('0x14')](function(_0x24f81e){logger[_0x8683('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x592de9,_0x24f81e);_0x19f4cd(_0x24f81e);});});}exports[_0x8683('0x15')]=function(_0x2af054){var _0x1a7f81=this;return new Promise(function(_0x453795,_0x35abc2){return db[_0x8683('0x16')][_0x8683('0x17')]({'raw':_0x2af054[_0x8683('0x18')]?_0x2af054[_0x8683('0x18')][_0x8683('0x19')]===undefined?!![]:![]:!![],'where':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1a')]||null:null,'attributes':_0x2af054[_0x8683('0x18')]?_0x2af054[_0x8683('0x18')][_0x8683('0x1b')]||null:null,'limit':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1c')]||null:null,'include':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x2af054[_0x8683('0x18')][_0x8683('0x1d')],function(_0x8ca91a){return{'model':db[_0x8ca91a[_0x8683('0x1f')]],'as':_0x8ca91a['as'],'attributes':_0x8ca91a[_0x8683('0x1b')],'include':_0x8ca91a[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x8ca91a[_0x8683('0x1d')],function(_0x30244d){return{'model':db[_0x30244d[_0x8683('0x1f')]],'as':_0x30244d['as'],'attributes':_0x30244d[_0x8683('0x1b')],'include':_0x30244d[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x30244d['include'],function(_0x474d71){return{'model':db[_0x474d71['model']],'as':_0x474d71['as'],'attributes':_0x474d71[_0x8683('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ce588){logger[_0x8683('0xa')](_0x8683('0x15'),_0x2af054);logger[_0x8683('0xd')](_0x8683('0x15'),_0x2af054,JSON[_0x8683('0xf')](_0x4ce588));_0x453795(_0x4ce588);})[_0x8683('0x14')](function(_0x216153){logger['error'](_0x8683('0x15'),_0x216153['message'],_0x2af054);_0x35abc2(_0x1a7f81[_0x8683('0x10')](0x1f4,_0x216153[_0x8683('0x12')]));});});};exports[_0x8683('0x20')]=function(_0x19454d){var _0xb95cb6=this;return new Promise(function(_0x33e8c8,_0x55b227){return db[_0x8683('0x16')][_0x8683('0x21')]({'raw':_0x19454d['options']?_0x19454d[_0x8683('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19454d[_0x8683('0x18')]?_0x19454d[_0x8683('0x18')][_0x8683('0x1a')]||null:null,'attributes':_0x19454d[_0x8683('0x18')]?_0x19454d['options'][_0x8683('0x1b')]||null:null,'include':_0x19454d[_0x8683('0x18')]?_0x19454d[_0x8683('0x18')][_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x19454d[_0x8683('0x18')]['include'],function(_0x5db4b4){return{'model':db[_0x5db4b4[_0x8683('0x1f')]],'as':_0x5db4b4['as'],'attributes':_0x5db4b4[_0x8683('0x1b')],'include':_0x5db4b4[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x5db4b4[_0x8683('0x1d')],function(_0x56b653){return{'model':db[_0x56b653[_0x8683('0x1f')]],'as':_0x56b653['as'],'attributes':_0x56b653[_0x8683('0x1b')],'include':_0x56b653[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x56b653[_0x8683('0x1d')],function(_0xfdce7a){return{'model':db[_0xfdce7a[_0x8683('0x1f')]],'as':_0xfdce7a['as'],'attributes':_0xfdce7a[_0x8683('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8683('0x9')](function(_0x10e68e){logger[_0x8683('0xa')](_0x8683('0x20'),_0x19454d);logger[_0x8683('0xd')](_0x8683('0x20'),_0x19454d,JSON[_0x8683('0xf')](_0x10e68e));_0x33e8c8(_0x10e68e);})[_0x8683('0x14')](function(_0x46b3ce){logger[_0x8683('0x10')]('ShowZendeskAccount',_0x46b3ce['message'],_0x19454d);_0x55b227(_0xb95cb6[_0x8683('0x10')](0x1f4,_0x46b3ce['message']));});});}; \ No newline at end of file +var _0x5057=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowZendeskAccount','debug','lodash','util','moment'];(function(_0x4fbfb1,_0x4f8fc4){var _0x4f6cf4=function(_0x1a9797){while(--_0x1a9797){_0x4fbfb1['push'](_0x4fbfb1['shift']());}};_0x4f6cf4(++_0x4f8fc4);}(_0x5057,0x151));var _0x7505=function(_0x8c26f5,_0x5bd361){_0x8c26f5=_0x8c26f5-0x0;var _0x1efcab=_0x5057[_0x8c26f5];return _0x1efcab;};'use strict';var _=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var moment=require(_0x7505('0x2'));var BPromise=require('bluebird');var rs=require(_0x7505('0x3'));var fs=require('fs');var Redis=require(_0x7505('0x4'));var db=require(_0x7505('0x5'))['db'];var utils=require(_0x7505('0x6'));var logger=require('../../config/logger')(_0x7505('0x7'));var config=require(_0x7505('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7505('0x9')][_0x7505('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288914,_0x273f93,_0x254212){return new BPromise(function(_0x2f2772,_0x4e3c23){return client[_0x7505('0xb')](_0x288914,_0x254212)['then'](function(_0x350215){logger[_0x7505('0xc')](_0x7505('0xd'),_0x273f93,'request\x20sent');logger['debug'](_0x7505('0xe'),_0x273f93,_0x7505('0xf'),JSON[_0x7505('0x10')](_0x350215));if(_0x350215[_0x7505('0x11')]){if(_0x350215[_0x7505('0x11')]['code']===0x1f4){logger[_0x7505('0x11')](_0x7505('0xd'),_0x273f93,_0x350215['error'][_0x7505('0x12')]);return _0x4e3c23(_0x350215['error'][_0x7505('0x12')]);}logger[_0x7505('0x11')](_0x7505('0xd'),_0x273f93,_0x350215['error'][_0x7505('0x12')]);return _0x2f2772(_0x350215['error'][_0x7505('0x12')]);}else{logger['info'](_0x7505('0xd'),_0x273f93,'request\x20sent');_0x2f2772(_0x350215[_0x7505('0x13')]['message']);}})[_0x7505('0x14')](function(_0x1fd50a){logger[_0x7505('0x11')](_0x7505('0xd'),_0x273f93,_0x1fd50a);_0x4e3c23(_0x1fd50a);});});}exports[_0x7505('0x15')]=function(_0x4bb793){var _0x188515=this;return new Promise(function(_0x1d59d8,_0x450868){return db[_0x7505('0x16')][_0x7505('0x17')]({'raw':_0x4bb793[_0x7505('0x18')]?_0x4bb793[_0x7505('0x18')][_0x7505('0x19')]===undefined?!![]:![]:!![],'where':_0x4bb793[_0x7505('0x18')]?_0x4bb793[_0x7505('0x18')][_0x7505('0x1a')]||null:null,'attributes':_0x4bb793['options']?_0x4bb793['options'][_0x7505('0x1b')]||null:null,'limit':_0x4bb793[_0x7505('0x18')]?_0x4bb793[_0x7505('0x18')]['limit']||null:null,'include':_0x4bb793[_0x7505('0x18')]?_0x4bb793[_0x7505('0x18')][_0x7505('0x1c')]?_[_0x7505('0x1d')](_0x4bb793['options']['include'],function(_0x16fbbc){return{'model':db[_0x16fbbc[_0x7505('0x1e')]],'as':_0x16fbbc['as'],'attributes':_0x16fbbc[_0x7505('0x1b')],'include':_0x16fbbc[_0x7505('0x1c')]?_['map'](_0x16fbbc[_0x7505('0x1c')],function(_0x14fce6){return{'model':db[_0x14fce6[_0x7505('0x1e')]],'as':_0x14fce6['as'],'attributes':_0x14fce6[_0x7505('0x1b')],'include':_0x14fce6[_0x7505('0x1c')]?_['map'](_0x14fce6[_0x7505('0x1c')],function(_0x3044bb){return{'model':db[_0x3044bb['model']],'as':_0x3044bb['as'],'attributes':_0x3044bb[_0x7505('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7505('0x1f')](function(_0x5cc785){logger[_0x7505('0xc')](_0x7505('0x15'),_0x4bb793);logger['debug'](_0x7505('0x15'),_0x4bb793,JSON['stringify'](_0x5cc785));_0x1d59d8(_0x5cc785);})['catch'](function(_0x5b7f09){logger[_0x7505('0x11')]('GetZendeskAccount',_0x5b7f09[_0x7505('0x12')],_0x4bb793);_0x450868(_0x188515[_0x7505('0x11')](0x1f4,_0x5b7f09[_0x7505('0x12')]));});});};exports[_0x7505('0x20')]=function(_0x3d4dc6){var _0x27da53=this;return new Promise(function(_0x34e931,_0x44eb42){return db[_0x7505('0x16')]['find']({'raw':_0x3d4dc6['options']?_0x3d4dc6[_0x7505('0x18')][_0x7505('0x19')]===undefined?!![]:![]:!![],'where':_0x3d4dc6[_0x7505('0x18')]?_0x3d4dc6[_0x7505('0x18')][_0x7505('0x1a')]||null:null,'attributes':_0x3d4dc6['options']?_0x3d4dc6[_0x7505('0x18')][_0x7505('0x1b')]||null:null,'include':_0x3d4dc6[_0x7505('0x18')]?_0x3d4dc6['options'][_0x7505('0x1c')]?_['map'](_0x3d4dc6[_0x7505('0x18')][_0x7505('0x1c')],function(_0x13221d){return{'model':db[_0x13221d[_0x7505('0x1e')]],'as':_0x13221d['as'],'attributes':_0x13221d['attributes'],'include':_0x13221d[_0x7505('0x1c')]?_['map'](_0x13221d[_0x7505('0x1c')],function(_0x1d0c75){return{'model':db[_0x1d0c75['model']],'as':_0x1d0c75['as'],'attributes':_0x1d0c75[_0x7505('0x1b')],'include':_0x1d0c75['include']?_[_0x7505('0x1d')](_0x1d0c75[_0x7505('0x1c')],function(_0x308767){return{'model':db[_0x308767[_0x7505('0x1e')]],'as':_0x308767['as'],'attributes':_0x308767['attributes']};}):[]};}):[]};}):[]:[]})[_0x7505('0x1f')](function(_0x42df7f){logger['info'](_0x7505('0x20'),_0x3d4dc6);logger[_0x7505('0x21')]('ShowZendeskAccount',_0x3d4dc6,JSON[_0x7505('0x10')](_0x42df7f));_0x34e931(_0x42df7f);})[_0x7505('0x14')](function(_0x474435){logger[_0x7505('0x11')](_0x7505('0x20'),_0x474435['message'],_0x3d4dc6);_0x44eb42(_0x27da53[_0x7505('0x11')](0x1f4,_0x474435[_0x7505('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d9e6e56..3341fd6 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x151bb5,_0x397a52){var _0x4d8495=function(_0x4c6bdb){while(--_0x4c6bdb){_0x151bb5['push'](_0x151bb5['shift']());}};_0x4d8495(++_0x397a52);}(_0xe706,0xa3));var _0x6e70=function(_0x335e51,_0x3c63fb){_0x335e51=_0x335e51-0x0;var _0x11637f=_0xe706[_0x335e51];return _0x11637f;};'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'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x81ab8b,_0x5677be){var _0x377eba=function(_0x4eb469){while(--_0x4eb469){_0x81ab8b['push'](_0x81ab8b['shift']());}};_0x377eba(++_0x5677be);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d72d496..a19067d 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 _0xc11c=['sequelize','exports','STRING'];(function(_0xb9c266,_0x55f8ce){var _0xfef148=function(_0x3865bc){while(--_0x3865bc){_0xb9c266['push'](_0xb9c266['shift']());}};_0xfef148(++_0x55f8ce);}(_0xc11c,0x69));var _0xcc11=function(_0xd9df21,_0x2350b3){_0xd9df21=_0xd9df21-0x0;var _0x40c634=_0xc11c[_0xd9df21];return _0x40c634;};'use strict';var Sequelize=require(_0xcc11('0x0'));module[_0xcc11('0x1')]={'name':{'type':Sequelize[_0xcc11('0x2')]},'description':{'type':Sequelize[_0xcc11('0x2')]}}; \ No newline at end of file +var _0x09f0=['STRING'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0x09f0,0xdc));var _0x009f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x09f0[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x009f('0x0')]},'description':{'type':Sequelize[_0x009f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 912b480..a01f5b5 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 _0xe5d7=['where','filter','merge','includeAll','include','ZendeskConfiguration','findAll','rows','show','params','create','catch','body','find','getFields','findOne','pick','options','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x198a6c,_0x1e1175){var _0x23f19c=function(_0x4c5b30){while(--_0x4c5b30){_0x198a6c['push'](_0x198a6c['shift']());}};_0x23f19c(++_0x1e1175);}(_0xe5d7,0x67));var _0x7e5d=function(_0x2e65dc,_0x33adfa){_0x2e65dc=_0x2e65dc-0x0;var _0x4c2a94=_0xe5d7[_0x2e65dc];return _0x4c2a94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e5d('0x1'));var rp=require(_0x7e5d('0x2'));var moment=require('moment');var BPromise=require(_0x7e5d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7e5d('0x4'));var ejs=require(_0x7e5d('0x5'));var fs=require('fs');var fs_extra=require(_0x7e5d('0x6'));var _=require(_0x7e5d('0x7'));var squel=require(_0x7e5d('0x8'));var crypto=require(_0x7e5d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7e5d('0xa'));var toCsv=require(_0x7e5d('0x4'));var querystring=require(_0x7e5d('0xb'));var Papa=require(_0x7e5d('0xc'));var Redis=require('ioredis');var authService=require(_0x7e5d('0xd'));var qs=require(_0x7e5d('0xe'));var as=require(_0x7e5d('0xf'));var hardwareService=require(_0x7e5d('0x10'));var logger=require(_0x7e5d('0x11'))('api');var utils=require(_0x7e5d('0x12'));var config=require(_0x7e5d('0x13'));var licenseUtil=require(_0x7e5d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196e5d,_0x1d500f){_0x1d500f=_0x1d500f||0xcc;return function(_0x43e3da){if(_0x43e3da){return _0x196e5d[_0x7e5d('0x15')](_0x1d500f);}return _0x196e5d[_0x7e5d('0x16')](_0x1d500f)[_0x7e5d('0x17')]();};}function respondWithResult(_0x8e470a,_0x493802){_0x493802=_0x493802||0xc8;return function(_0x447117){if(_0x447117){return _0x8e470a[_0x7e5d('0x16')](_0x493802)[_0x7e5d('0x18')](_0x447117);}};}function respondWithFilteredResult(_0x37136a,_0x1cd473){return function(_0x24a87f){if(_0x24a87f){var _0xca37d8=typeof _0x1cd473[_0x7e5d('0x19')]===_0x7e5d('0x1a')&&typeof _0x1cd473[_0x7e5d('0x1b')]===_0x7e5d('0x1a');var _0x21f293=_0x24a87f[_0x7e5d('0x1c')];var _0x347324=_0xca37d8?0x0:_0x1cd473['offset'];var _0x2f75d8=_0xca37d8?_0x24a87f[_0x7e5d('0x1c')]:_0x1cd473['offset']+_0x1cd473[_0x7e5d('0x1b')];var _0x2d0df6;if(_0x2f75d8>=_0x21f293){_0x2f75d8=_0x21f293;_0x2d0df6=0xc8;}else{_0x2d0df6=0xce;}_0x37136a[_0x7e5d('0x16')](_0x2d0df6);return _0x37136a[_0x7e5d('0x1d')](_0x7e5d('0x1e'),_0x347324+'-'+_0x2f75d8+'/'+_0x21f293)[_0x7e5d('0x18')](_0x24a87f);}return null;};}function patchUpdates(_0x2e1ce4){return function(_0x516827){try{jsonpatch[_0x7e5d('0x1f')](_0x516827,_0x2e1ce4,!![]);}catch(_0x4d8079){return BPromise[_0x7e5d('0x20')](_0x4d8079);}return _0x516827['save']();};}function saveUpdates(_0x423299,_0x4a6d98){return function(_0x12ca25){if(_0x12ca25){return _0x12ca25['update'](_0x423299)[_0x7e5d('0x21')](function(_0xaec3ae){return _0xaec3ae;});}return null;};}function removeEntity(_0x2677dd,_0x5c8ae4){return function(_0x4d51a0){if(_0x4d51a0){return _0x4d51a0[_0x7e5d('0x22')]()[_0x7e5d('0x21')](function(){_0x2677dd[_0x7e5d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30614e,_0x5c8b1f){return function(_0x1ef5fd){if(!_0x1ef5fd){_0x30614e['sendStatus'](0x194);}return _0x1ef5fd;};}function handleError(_0x1b1657,_0x38bf85){_0x38bf85=_0x38bf85||0x1f4;return function(_0x2fa30f){logger[_0x7e5d('0x23')](_0x2fa30f['stack']);if(_0x2fa30f[_0x7e5d('0x24')]){delete _0x2fa30f['name'];}_0x1b1657[_0x7e5d('0x16')](_0x38bf85)['send'](_0x2fa30f);};}exports['index']=function(_0x31298a,_0x7c123e){var _0xfbe895={},_0x2c4a70={},_0x54a35e={'count':0x0,'rows':[]};var _0x32c0a1=_[_0x7e5d('0x25')](db['ZendeskConfiguration'][_0x7e5d('0x26')],function(_0x338e28){return{'name':_0x338e28[_0x7e5d('0x27')],'type':_0x338e28[_0x7e5d('0x28')]['key']};});_0x2c4a70[_0x7e5d('0x29')]=_[_0x7e5d('0x25')](_0x32c0a1,_0x7e5d('0x24'));_0x2c4a70[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x31298a[_0x7e5d('0x2a')]);_0x2c4a70[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x2c4a70['model'],_0x2c4a70['query']);_0xfbe895['attributes']=_[_0x7e5d('0x2d')](_0x2c4a70[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0xfbe895[_0x7e5d('0x2f')]=_0xfbe895['attributes'][_0x7e5d('0x30')]?_0xfbe895[_0x7e5d('0x2f')]:_0x2c4a70[_0x7e5d('0x29')];if(!_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0xfbe895[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0xfbe895[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}_0xfbe895[_0x7e5d('0x33')]=qs[_0x7e5d('0x34')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0xfbe895[_0x7e5d('0x35')]=qs['filters'](_['pick'](_0x31298a['query'],_0x2c4a70['filters']),_0x32c0a1);if(_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0xfbe895[_0x7e5d('0x35')]=_[_0x7e5d('0x37')](_0xfbe895[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x32c0a1,function(_0x294a2b){if(_0x294a2b['type']!=='VIRTUAL'){var _0x169b9c={};_0x169b9c[_0x294a2b[_0x7e5d('0x24')]]={'$like':'%'+_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x169b9c;}})});}_0xfbe895=_['merge']({},_0xfbe895,_0x31298a['options']);var _0x587c1a={'where':_0xfbe895['where']};return db['ZendeskConfiguration'][_0x7e5d('0x1c')](_0x587c1a)[_0x7e5d('0x21')](function(_0x702ab4){_0x54a35e[_0x7e5d('0x1c')]=_0x702ab4;if(_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x38')]){_0xfbe895[_0x7e5d('0x39')]=[{'all':!![]}];}return db[_0x7e5d('0x3a')][_0x7e5d('0x3b')](_0xfbe895);})[_0x7e5d('0x21')](function(_0x30e4ac){_0x54a35e[_0x7e5d('0x3c')]=_0x30e4ac;return _0x54a35e;})[_0x7e5d('0x21')](respondWithFilteredResult(_0x7c123e,_0xfbe895))['catch'](handleError(_0x7c123e,null));};exports[_0x7e5d('0x3d')]=function(_0x543181,_0x330597){var _0x17b291={'raw':![],'where':{'id':_0x543181[_0x7e5d('0x3e')]['id']}},_0x249caa={};_0x249caa['model']=_[_0x7e5d('0x2b')](db['ZendeskConfiguration']['rawAttributes']);_0x249caa[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x543181[_0x7e5d('0x2a')]);_0x249caa[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x249caa[_0x7e5d('0x29')],_0x249caa[_0x7e5d('0x2a')]);_0x17b291[_0x7e5d('0x2f')]=_['intersection'](_0x249caa[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x543181[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x17b291[_0x7e5d('0x2f')]=_0x17b291[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0x17b291[_0x7e5d('0x2f')]:_0x249caa['model'];if(_0x543181[_0x7e5d('0x2a')][_0x7e5d('0x38')]){_0x17b291['include']=[{'all':!![]}];}_0x17b291=_[_0x7e5d('0x37')]({},_0x17b291,_0x543181['options']);return db[_0x7e5d('0x3a')]['find'](_0x17b291)[_0x7e5d('0x21')](handleEntityNotFound(_0x330597,null))[_0x7e5d('0x21')](respondWithResult(_0x330597,null))['catch'](handleError(_0x330597,null));};exports[_0x7e5d('0x3f')]=function(_0x3d9ba6,_0x28ad5c){return db['ZendeskConfiguration'][_0x7e5d('0x3f')](_0x3d9ba6['body'],{})[_0x7e5d('0x21')](respondWithResult(_0x28ad5c,0xc9))[_0x7e5d('0x40')](handleError(_0x28ad5c,null));};exports['update']=function(_0xd13727,_0x429297){if(_0xd13727['body']['id']){delete _0xd13727[_0x7e5d('0x41')]['id'];}return db[_0x7e5d('0x3a')][_0x7e5d('0x42')]({'where':{'id':_0xd13727[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x429297,null))[_0x7e5d('0x21')](saveUpdates(_0xd13727[_0x7e5d('0x41')],null))[_0x7e5d('0x21')](respondWithResult(_0x429297,null))[_0x7e5d('0x40')](handleError(_0x429297,null));};exports[_0x7e5d('0x22')]=function(_0x2e080f,_0x399572){return db['ZendeskConfiguration'][_0x7e5d('0x42')]({'where':{'id':_0x2e080f[_0x7e5d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x399572,null))[_0x7e5d('0x21')](removeEntity(_0x399572,null))[_0x7e5d('0x40')](handleError(_0x399572,null));};exports[_0x7e5d('0x43')]=function(_0x111ba3,_0x5f44e1,_0x5b9c10){var _0x3b1004={};var _0x3476d1={};var _0x5aff51;var _0x21725b;return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x111ba3[_0x7e5d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5f44e1,null))['then'](function(_0x3d4f04){if(_0x3d4f04){_0x5aff51=_0x3d4f04;_0x3476d1[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db['ZendeskField'][_0x7e5d('0x26')]);_0x3476d1[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x111ba3['query']);_0x3476d1['filters']=_[_0x7e5d('0x2d')](_0x3476d1[_0x7e5d('0x29')],_0x3476d1[_0x7e5d('0x2a')]);_0x3b1004[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0x3476d1['model'],qs[_0x7e5d('0x2e')](_0x111ba3[_0x7e5d('0x2a')]['fields']));_0x3b1004[_0x7e5d('0x2f')]=_0x3b1004['attributes'][_0x7e5d('0x30')]?_0x3b1004['attributes']:_0x3476d1[_0x7e5d('0x29')];_0x3b1004[_0x7e5d('0x33')]=qs['sort'](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x3b1004['where']=qs['filters'](_[_0x7e5d('0x45')](_0x111ba3[_0x7e5d('0x2a')],_0x3476d1[_0x7e5d('0x2c')]));if(_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0x3b1004[_0x7e5d('0x35')]=_[_0x7e5d('0x37')](_0x3b1004[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x3b1004[_0x7e5d('0x2f')],function(_0x17461a){var _0x4193db={};_0x4193db[_0x17461a]={'$like':'%'+_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x4193db;})});}_0x3b1004=_[_0x7e5d('0x37')]({},_0x3b1004,_0x111ba3[_0x7e5d('0x46')]);return _0x5aff51[_0x7e5d('0x43')](_0x3b1004);}})['then'](function(_0x1d81d8){if(_0x1d81d8){_0x21725b=_0x1d81d8[_0x7e5d('0x30')];if(!_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0x3b1004[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0x3b1004['offset']=qs[_0x7e5d('0x19')](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}return _0x5aff51[_0x7e5d('0x43')](_0x3b1004);}})[_0x7e5d('0x21')](function(_0x4b5506){if(_0x4b5506){return _0x4b5506?{'count':_0x21725b,'rows':_0x4b5506}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x5f44e1,null))[_0x7e5d('0x40')](handleError(_0x5f44e1,null));};exports[_0x7e5d('0x47')]=function(_0x5148bc,_0x53fd94,_0x47444c){var _0x171258={};var _0x5b2d6b={};var _0x4ef57a;var _0x410eed;return db[_0x7e5d('0x3a')]['findOne']({'where':{'id':_0x5148bc['params']['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x53fd94,null))[_0x7e5d('0x21')](function(_0x36fa2f){if(_0x36fa2f){_0x4ef57a=_0x36fa2f;_0x5b2d6b[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x48')][_0x7e5d('0x26')]);_0x5b2d6b[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x5148bc[_0x7e5d('0x2a')]);_0x5b2d6b['filters']=_[_0x7e5d('0x2d')](_0x5b2d6b[_0x7e5d('0x29')],_0x5b2d6b[_0x7e5d('0x2a')]);_0x171258['attributes']=_[_0x7e5d('0x2d')](_0x5b2d6b[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x171258[_0x7e5d('0x2f')]=_0x171258['attributes'][_0x7e5d('0x30')]?_0x171258[_0x7e5d('0x2f')]:_0x5b2d6b[_0x7e5d('0x29')];_0x171258['order']=qs['sort'](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x171258[_0x7e5d('0x35')]=qs[_0x7e5d('0x2c')](_[_0x7e5d('0x45')](_0x5148bc['query'],_0x5b2d6b[_0x7e5d('0x2c')]));if(_0x5148bc[_0x7e5d('0x2a')]['filter']){_0x171258['where']=_[_0x7e5d('0x37')](_0x171258[_0x7e5d('0x35')],{'$or':_['map'](_0x171258['attributes'],function(_0x3673bd){var _0x5c06c1={};_0x5c06c1[_0x3673bd]={'$like':'%'+_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x5c06c1;})});}_0x171258=_[_0x7e5d('0x37')]({},_0x171258,_0x5148bc['options']);return _0x4ef57a[_0x7e5d('0x47')](_0x171258);}})[_0x7e5d('0x21')](function(_0x5d47df){if(_0x5d47df){_0x410eed=_0x5d47df[_0x7e5d('0x30')];if(!_0x5148bc['query']['hasOwnProperty'](_0x7e5d('0x32'))){_0x171258[_0x7e5d('0x1b')]=qs['limit'](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0x171258[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}return _0x4ef57a[_0x7e5d('0x47')](_0x171258);}})['then'](function(_0x614778){if(_0x614778){return _0x614778?{'count':_0x410eed,'rows':_0x614778}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x53fd94,null))[_0x7e5d('0x40')](handleError(_0x53fd94,null));};exports['getDescriptions']=function(_0x109d32,_0x2242de,_0x4a7f94){var _0xe5c9d6={};var _0xdab6db={};var _0x447fa5;var _0x42a3b8;return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x109d32[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x2242de,null))[_0x7e5d('0x21')](function(_0x41466a){if(_0x41466a){_0x447fa5=_0x41466a;_0xdab6db[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x48')][_0x7e5d('0x26')]);_0xdab6db[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x109d32[_0x7e5d('0x2a')]);_0xdab6db[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0xdab6db[_0x7e5d('0x29')],_0xdab6db[_0x7e5d('0x2a')]);_0xe5c9d6[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0xdab6db[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x109d32[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0xe5c9d6[_0x7e5d('0x2f')]=_0xe5c9d6[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0xe5c9d6[_0x7e5d('0x2f')]:_0xdab6db[_0x7e5d('0x29')];_0xe5c9d6[_0x7e5d('0x33')]=qs['sort'](_0x109d32['query']['sort']);_0xe5c9d6['where']=qs[_0x7e5d('0x2c')](_[_0x7e5d('0x45')](_0x109d32[_0x7e5d('0x2a')],_0xdab6db[_0x7e5d('0x2c')]));if(_0x109d32['query'][_0x7e5d('0x36')]){_0xe5c9d6[_0x7e5d('0x35')]=_['merge'](_0xe5c9d6[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0xe5c9d6[_0x7e5d('0x2f')],function(_0x230505){var _0x521542={};_0x521542[_0x230505]={'$like':'%'+_0x109d32['query']['filter']+'%'};return _0x521542;})});}_0xe5c9d6=_[_0x7e5d('0x37')]({},_0xe5c9d6,_0x109d32[_0x7e5d('0x46')]);return _0x447fa5[_0x7e5d('0x49')](_0xe5c9d6);}})[_0x7e5d('0x21')](function(_0xa1b680){if(_0xa1b680){_0x42a3b8=_0xa1b680['length'];if(!_0x109d32[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0xe5c9d6[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x109d32['query']['limit']);_0xe5c9d6['offset']=qs['offset'](_0x109d32[_0x7e5d('0x2a')]['offset']);}return _0x447fa5[_0x7e5d('0x49')](_0xe5c9d6);}})[_0x7e5d('0x21')](function(_0xd01665){if(_0xd01665){return _0xd01665?{'count':_0x42a3b8,'rows':_0xd01665}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x2242de,null))[_0x7e5d('0x40')](handleError(_0x2242de,null));};exports[_0x7e5d('0x4a')]=function(_0x4c3b83,_0x1e10ed,_0x4c34ab){var _0x36d6bd={};var _0x2b1f23={};var _0x5db48f;var _0x1ce0a6;return db[_0x7e5d('0x3a')]['findOne']({'where':{'id':_0x4c3b83[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x1e10ed,null))['then'](function(_0x2df309){if(_0x2df309){_0x5db48f=_0x2df309;_0x2b1f23[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x4b')][_0x7e5d('0x26')]);_0x2b1f23['query']=_['keys'](_0x4c3b83['query']);_0x2b1f23[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x2b1f23[_0x7e5d('0x29')],_0x2b1f23[_0x7e5d('0x2a')]);_0x36d6bd[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0x2b1f23[_0x7e5d('0x29')],qs['fields'](_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x36d6bd[_0x7e5d('0x2f')]=_0x36d6bd[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0x36d6bd[_0x7e5d('0x2f')]:_0x2b1f23[_0x7e5d('0x29')];_0x36d6bd['order']=qs[_0x7e5d('0x34')](_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x36d6bd[_0x7e5d('0x35')]=qs[_0x7e5d('0x2c')](_['pick'](_0x4c3b83[_0x7e5d('0x2a')],_0x2b1f23['filters']));if(_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0x36d6bd['where']=_[_0x7e5d('0x37')](_0x36d6bd[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x36d6bd['attributes'],function(_0x4a5223){var _0xfb7071={};_0xfb7071[_0x4a5223]={'$like':'%'+_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0xfb7071;})});}_0x36d6bd=_['merge']({},_0x36d6bd,_0x4c3b83['options']);return _0x5db48f[_0x7e5d('0x4a')](_0x36d6bd);}})[_0x7e5d('0x21')](function(_0x1dd5d9){if(_0x1dd5d9){_0x1ce0a6=_0x1dd5d9['length'];if(!_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0x36d6bd['limit']=qs[_0x7e5d('0x1b')](_0x4c3b83[_0x7e5d('0x2a')]['limit']);_0x36d6bd[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x4c3b83['query'][_0x7e5d('0x19')]);}return _0x5db48f['getTags'](_0x36d6bd);}})[_0x7e5d('0x21')](function(_0x399b3e){if(_0x399b3e){return _0x399b3e?{'count':_0x1ce0a6,'rows':_0x399b3e}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x1e10ed,null))[_0x7e5d('0x40')](handleError(_0x1e10ed,null));};exports[_0x7e5d('0x4c')]=function(_0x218049,_0x161fdd,_0x421b45){if(_0x218049[_0x7e5d('0x41')]['id']){delete _0x218049[_0x7e5d('0x41')]['id'];}return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x218049[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x161fdd,null))['then'](function(_0x2cb340){if(_0x2cb340){return _0x2cb340[_0x7e5d('0x4c')](_0x218049['body'][_0x7e5d('0x4d')]||[]);}return null;})[_0x7e5d('0x21')](respondWithResult(_0x161fdd,null))[_0x7e5d('0x40')](handleError(_0x161fdd,null));}; \ No newline at end of file +var _0xac55=['ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','then','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','getFields','findOne'];(function(_0x4eac00,_0x78486e){var _0x3ddfc5=function(_0x2352fd){while(--_0x2352fd){_0x4eac00['push'](_0x4eac00['shift']());}};_0x3ddfc5(++_0x78486e);}(_0xac55,0x1b1));var _0x5ac5=function(_0x35ddf6,_0x382ce8){_0x35ddf6=_0x35ddf6-0x0;var _0x4d5930=_0xac55[_0x35ddf6];return _0x4d5930;};'use strict';var emlformat=require(_0x5ac5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ac5('0x1'));var jsonpatch=require(_0x5ac5('0x2'));var rp=require('request-promise');var moment=require(_0x5ac5('0x3'));var BPromise=require(_0x5ac5('0x4'));var Mustache=require(_0x5ac5('0x5'));var util=require(_0x5ac5('0x6'));var path=require('path');var sox=require(_0x5ac5('0x7'));var csv=require(_0x5ac5('0x8'));var ejs=require(_0x5ac5('0x9'));var fs=require('fs');var fs_extra=require(_0x5ac5('0xa'));var _=require(_0x5ac5('0xb'));var squel=require(_0x5ac5('0xc'));var crypto=require(_0x5ac5('0xd'));var jsforce=require(_0x5ac5('0xe'));var deskjs=require(_0x5ac5('0xf'));var toCsv=require(_0x5ac5('0x8'));var querystring=require('querystring');var Papa=require(_0x5ac5('0x10'));var Redis=require(_0x5ac5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5ac5('0x12'));var as=require(_0x5ac5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ac5('0x14'))(_0x5ac5('0x15'));var utils=require('../../config/utils');var config=require(_0x5ac5('0x16'));var licenseUtil=require(_0x5ac5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x928b55,_0x5638a8){_0x5638a8=_0x5638a8||0xcc;return function(_0x5510e5){if(_0x5510e5){return _0x928b55[_0x5ac5('0x18')](_0x5638a8);}return _0x928b55[_0x5ac5('0x19')](_0x5638a8)[_0x5ac5('0x1a')]();};}function respondWithResult(_0x1e5ae1,_0x1965df){_0x1965df=_0x1965df||0xc8;return function(_0x550eb7){if(_0x550eb7){return _0x1e5ae1[_0x5ac5('0x19')](_0x1965df)[_0x5ac5('0x1b')](_0x550eb7);}};}function respondWithFilteredResult(_0x22b21a,_0x5cc0b0){return function(_0x883a6a){if(_0x883a6a){var _0x4a2e04=typeof _0x5cc0b0[_0x5ac5('0x1c')]==='undefined'&&typeof _0x5cc0b0[_0x5ac5('0x1d')]===_0x5ac5('0x1e');var _0x5e5971=_0x883a6a[_0x5ac5('0x1f')];var _0x5f1be3=_0x4a2e04?0x0:_0x5cc0b0[_0x5ac5('0x1c')];var _0x1fa457=_0x4a2e04?_0x883a6a[_0x5ac5('0x1f')]:_0x5cc0b0['offset']+_0x5cc0b0[_0x5ac5('0x1d')];var _0x335388;if(_0x1fa457>=_0x5e5971){_0x1fa457=_0x5e5971;_0x335388=0xc8;}else{_0x335388=0xce;}_0x22b21a[_0x5ac5('0x19')](_0x335388);return _0x22b21a[_0x5ac5('0x20')](_0x5ac5('0x21'),_0x5f1be3+'-'+_0x1fa457+'/'+_0x5e5971)[_0x5ac5('0x1b')](_0x883a6a);}return null;};}function patchUpdates(_0x522170){return function(_0xd1243e){try{jsonpatch[_0x5ac5('0x22')](_0xd1243e,_0x522170,!![]);}catch(_0x4f22e9){return BPromise[_0x5ac5('0x23')](_0x4f22e9);}return _0xd1243e['save']();};}function saveUpdates(_0x12314a,_0x289d54){return function(_0x47ae1a){if(_0x47ae1a){return _0x47ae1a[_0x5ac5('0x24')](_0x12314a)['then'](function(_0x72f038){return _0x72f038;});}return null;};}function removeEntity(_0x85d5ac,_0x3a41a3){return function(_0x3c0c7f){if(_0x3c0c7f){return _0x3c0c7f[_0x5ac5('0x25')]()['then'](function(){_0x85d5ac['status'](0xcc)[_0x5ac5('0x1a')]();});}};}function handleEntityNotFound(_0x76e858,_0x3cc90f){return function(_0x39efc8){if(!_0x39efc8){_0x76e858[_0x5ac5('0x18')](0x194);}return _0x39efc8;};}function handleError(_0x33aa58,_0x2ebb11){_0x2ebb11=_0x2ebb11||0x1f4;return function(_0x411c8a){logger[_0x5ac5('0x26')](_0x411c8a[_0x5ac5('0x27')]);if(_0x411c8a[_0x5ac5('0x28')]){delete _0x411c8a[_0x5ac5('0x28')];}_0x33aa58[_0x5ac5('0x19')](_0x2ebb11)[_0x5ac5('0x29')](_0x411c8a);};}exports[_0x5ac5('0x2a')]=function(_0x4e7f63,_0x1e591d){var _0x2c01e1={},_0x2de4f5={},_0x5c0740={'count':0x0,'rows':[]};var _0x4762b7=_[_0x5ac5('0x2b')](db[_0x5ac5('0x2c')]['rawAttributes'],function(_0x1771cb){return{'name':_0x1771cb[_0x5ac5('0x2d')],'type':_0x1771cb['type'][_0x5ac5('0x2e')]};});_0x2de4f5[_0x5ac5('0x2f')]=_[_0x5ac5('0x2b')](_0x4762b7,'name');_0x2de4f5[_0x5ac5('0x30')]=_[_0x5ac5('0x31')](_0x4e7f63[_0x5ac5('0x30')]);_0x2de4f5[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x2de4f5['model'],_0x2de4f5[_0x5ac5('0x30')]);_0x2c01e1[_0x5ac5('0x34')]=_[_0x5ac5('0x33')](_0x2de4f5[_0x5ac5('0x2f')],qs[_0x5ac5('0x35')](_0x4e7f63['query'][_0x5ac5('0x35')]));_0x2c01e1[_0x5ac5('0x34')]=_0x2c01e1[_0x5ac5('0x34')][_0x5ac5('0x36')]?_0x2c01e1['attributes']:_0x2de4f5['model'];if(!_0x4e7f63[_0x5ac5('0x30')][_0x5ac5('0x37')]('nolimit')){_0x2c01e1[_0x5ac5('0x1d')]=qs['limit'](_0x4e7f63['query'][_0x5ac5('0x1d')]);_0x2c01e1['offset']=qs[_0x5ac5('0x1c')](_0x4e7f63[_0x5ac5('0x30')][_0x5ac5('0x1c')]);}_0x2c01e1[_0x5ac5('0x38')]=qs[_0x5ac5('0x39')](_0x4e7f63['query'][_0x5ac5('0x39')]);_0x2c01e1[_0x5ac5('0x3a')]=qs[_0x5ac5('0x32')](_[_0x5ac5('0x3b')](_0x4e7f63[_0x5ac5('0x30')],_0x2de4f5[_0x5ac5('0x32')]),_0x4762b7);if(_0x4e7f63['query'][_0x5ac5('0x3c')]){_0x2c01e1[_0x5ac5('0x3a')]=_[_0x5ac5('0x3d')](_0x2c01e1[_0x5ac5('0x3a')],{'$or':_[_0x5ac5('0x2b')](_0x4762b7,function(_0x272179){if(_0x272179[_0x5ac5('0x3e')]!=='VIRTUAL'){var _0xc1046={};_0xc1046[_0x272179[_0x5ac5('0x28')]]={'$like':'%'+_0x4e7f63[_0x5ac5('0x30')]['filter']+'%'};return _0xc1046;}})});}_0x2c01e1=_[_0x5ac5('0x3d')]({},_0x2c01e1,_0x4e7f63['options']);var _0x2b748e={'where':_0x2c01e1[_0x5ac5('0x3a')]};return db[_0x5ac5('0x2c')][_0x5ac5('0x1f')](_0x2b748e)[_0x5ac5('0x3f')](function(_0x214390){_0x5c0740[_0x5ac5('0x1f')]=_0x214390;if(_0x4e7f63['query'][_0x5ac5('0x40')]){_0x2c01e1[_0x5ac5('0x41')]=[{'all':!![]}];}return db[_0x5ac5('0x2c')][_0x5ac5('0x42')](_0x2c01e1);})[_0x5ac5('0x3f')](function(_0x3e4ebc){_0x5c0740['rows']=_0x3e4ebc;return _0x5c0740;})['then'](respondWithFilteredResult(_0x1e591d,_0x2c01e1))[_0x5ac5('0x43')](handleError(_0x1e591d,null));};exports[_0x5ac5('0x44')]=function(_0x368605,_0x580e3b){var _0x8b5652={'raw':![],'where':{'id':_0x368605[_0x5ac5('0x45')]['id']}},_0x2e9f37={};_0x2e9f37[_0x5ac5('0x2f')]=_[_0x5ac5('0x31')](db[_0x5ac5('0x2c')][_0x5ac5('0x46')]);_0x2e9f37[_0x5ac5('0x30')]=_[_0x5ac5('0x31')](_0x368605['query']);_0x2e9f37[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x2e9f37[_0x5ac5('0x2f')],_0x2e9f37[_0x5ac5('0x30')]);_0x8b5652[_0x5ac5('0x34')]=_[_0x5ac5('0x33')](_0x2e9f37['model'],qs[_0x5ac5('0x35')](_0x368605[_0x5ac5('0x30')]['fields']));_0x8b5652[_0x5ac5('0x34')]=_0x8b5652[_0x5ac5('0x34')][_0x5ac5('0x36')]?_0x8b5652[_0x5ac5('0x34')]:_0x2e9f37[_0x5ac5('0x2f')];if(_0x368605[_0x5ac5('0x30')][_0x5ac5('0x40')]){_0x8b5652['include']=[{'all':!![]}];}_0x8b5652=_[_0x5ac5('0x3d')]({},_0x8b5652,_0x368605[_0x5ac5('0x47')]);return db[_0x5ac5('0x2c')][_0x5ac5('0x48')](_0x8b5652)['then'](handleEntityNotFound(_0x580e3b,null))[_0x5ac5('0x3f')](respondWithResult(_0x580e3b,null))[_0x5ac5('0x43')](handleError(_0x580e3b,null));};exports[_0x5ac5('0x49')]=function(_0x5bb28b,_0x252154){return db['ZendeskConfiguration'][_0x5ac5('0x49')](_0x5bb28b['body'],{})['then'](respondWithResult(_0x252154,0xc9))[_0x5ac5('0x43')](handleError(_0x252154,null));};exports[_0x5ac5('0x24')]=function(_0x23d093,_0x40fdee){if(_0x23d093['body']['id']){delete _0x23d093['body']['id'];}return db[_0x5ac5('0x2c')][_0x5ac5('0x48')]({'where':{'id':_0x23d093[_0x5ac5('0x45')]['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x40fdee,null))[_0x5ac5('0x3f')](saveUpdates(_0x23d093[_0x5ac5('0x4a')],null))['then'](respondWithResult(_0x40fdee,null))[_0x5ac5('0x43')](handleError(_0x40fdee,null));};exports[_0x5ac5('0x25')]=function(_0xfaec7b,_0x5c65f3){return db[_0x5ac5('0x2c')][_0x5ac5('0x48')]({'where':{'id':_0xfaec7b[_0x5ac5('0x45')]['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x5c65f3,null))[_0x5ac5('0x3f')](removeEntity(_0x5c65f3,null))[_0x5ac5('0x43')](handleError(_0x5c65f3,null));};exports[_0x5ac5('0x4b')]=function(_0x1ef20a,_0x4e0f84,_0x1c0073){var _0x5d7f4e={};var _0x2f39ee={};var _0x3798d3;var _0x7e4c93;return db[_0x5ac5('0x2c')][_0x5ac5('0x4c')]({'where':{'id':_0x1ef20a[_0x5ac5('0x45')]['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x4e0f84,null))['then'](function(_0x55b28a){if(_0x55b28a){_0x3798d3=_0x55b28a;_0x2f39ee['model']=_[_0x5ac5('0x31')](db[_0x5ac5('0x4d')]['rawAttributes']);_0x2f39ee[_0x5ac5('0x30')]=_[_0x5ac5('0x31')](_0x1ef20a[_0x5ac5('0x30')]);_0x2f39ee['filters']=_[_0x5ac5('0x33')](_0x2f39ee[_0x5ac5('0x2f')],_0x2f39ee[_0x5ac5('0x30')]);_0x5d7f4e[_0x5ac5('0x34')]=_[_0x5ac5('0x33')](_0x2f39ee[_0x5ac5('0x2f')],qs[_0x5ac5('0x35')](_0x1ef20a['query']['fields']));_0x5d7f4e[_0x5ac5('0x34')]=_0x5d7f4e[_0x5ac5('0x34')][_0x5ac5('0x36')]?_0x5d7f4e['attributes']:_0x2f39ee['model'];_0x5d7f4e['order']=qs[_0x5ac5('0x39')](_0x1ef20a[_0x5ac5('0x30')]['sort']);_0x5d7f4e[_0x5ac5('0x3a')]=qs[_0x5ac5('0x32')](_['pick'](_0x1ef20a['query'],_0x2f39ee['filters']));if(_0x1ef20a[_0x5ac5('0x30')][_0x5ac5('0x3c')]){_0x5d7f4e[_0x5ac5('0x3a')]=_[_0x5ac5('0x3d')](_0x5d7f4e[_0x5ac5('0x3a')],{'$or':_['map'](_0x5d7f4e['attributes'],function(_0x22595b){var _0x5e67fa={};_0x5e67fa[_0x22595b]={'$like':'%'+_0x1ef20a[_0x5ac5('0x30')][_0x5ac5('0x3c')]+'%'};return _0x5e67fa;})});}_0x5d7f4e=_[_0x5ac5('0x3d')]({},_0x5d7f4e,_0x1ef20a['options']);return _0x3798d3['getFields'](_0x5d7f4e);}})[_0x5ac5('0x3f')](function(_0x5c709d){if(_0x5c709d){_0x7e4c93=_0x5c709d[_0x5ac5('0x36')];if(!_0x1ef20a['query']['hasOwnProperty'](_0x5ac5('0x4e'))){_0x5d7f4e[_0x5ac5('0x1d')]=qs[_0x5ac5('0x1d')](_0x1ef20a[_0x5ac5('0x30')][_0x5ac5('0x1d')]);_0x5d7f4e[_0x5ac5('0x1c')]=qs['offset'](_0x1ef20a[_0x5ac5('0x30')][_0x5ac5('0x1c')]);}return _0x3798d3[_0x5ac5('0x4b')](_0x5d7f4e);}})[_0x5ac5('0x3f')](function(_0x6a64b4){if(_0x6a64b4){return _0x6a64b4?{'count':_0x7e4c93,'rows':_0x6a64b4}:null;}})['then'](respondWithResult(_0x4e0f84,null))['catch'](handleError(_0x4e0f84,null));};exports[_0x5ac5('0x4f')]=function(_0x2f90d5,_0x22c3b6,_0xc438b3){var _0x5bfe83={};var _0x2a11bd={};var _0x5d9935;var _0x1395cb;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2f90d5['params']['id']}})['then'](handleEntityNotFound(_0x22c3b6,null))[_0x5ac5('0x3f')](function(_0x49f67f){if(_0x49f67f){_0x5d9935=_0x49f67f;_0x2a11bd[_0x5ac5('0x2f')]=_[_0x5ac5('0x31')](db[_0x5ac5('0x4d')][_0x5ac5('0x46')]);_0x2a11bd[_0x5ac5('0x30')]=_[_0x5ac5('0x31')](_0x2f90d5[_0x5ac5('0x30')]);_0x2a11bd[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x2a11bd['model'],_0x2a11bd[_0x5ac5('0x30')]);_0x5bfe83[_0x5ac5('0x34')]=_['intersection'](_0x2a11bd[_0x5ac5('0x2f')],qs[_0x5ac5('0x35')](_0x2f90d5[_0x5ac5('0x30')][_0x5ac5('0x35')]));_0x5bfe83[_0x5ac5('0x34')]=_0x5bfe83[_0x5ac5('0x34')]['length']?_0x5bfe83[_0x5ac5('0x34')]:_0x2a11bd['model'];_0x5bfe83[_0x5ac5('0x38')]=qs['sort'](_0x2f90d5[_0x5ac5('0x30')][_0x5ac5('0x39')]);_0x5bfe83[_0x5ac5('0x3a')]=qs['filters'](_[_0x5ac5('0x3b')](_0x2f90d5[_0x5ac5('0x30')],_0x2a11bd['filters']));if(_0x2f90d5[_0x5ac5('0x30')]['filter']){_0x5bfe83[_0x5ac5('0x3a')]=_[_0x5ac5('0x3d')](_0x5bfe83[_0x5ac5('0x3a')],{'$or':_[_0x5ac5('0x2b')](_0x5bfe83['attributes'],function(_0x10d158){var _0x36df8e={};_0x36df8e[_0x10d158]={'$like':'%'+_0x2f90d5[_0x5ac5('0x30')][_0x5ac5('0x3c')]+'%'};return _0x36df8e;})});}_0x5bfe83=_[_0x5ac5('0x3d')]({},_0x5bfe83,_0x2f90d5[_0x5ac5('0x47')]);return _0x5d9935[_0x5ac5('0x4f')](_0x5bfe83);}})['then'](function(_0x6083ec){if(_0x6083ec){_0x1395cb=_0x6083ec[_0x5ac5('0x36')];if(!_0x2f90d5[_0x5ac5('0x30')]['hasOwnProperty']('nolimit')){_0x5bfe83[_0x5ac5('0x1d')]=qs[_0x5ac5('0x1d')](_0x2f90d5[_0x5ac5('0x30')][_0x5ac5('0x1d')]);_0x5bfe83['offset']=qs[_0x5ac5('0x1c')](_0x2f90d5['query']['offset']);}return _0x5d9935[_0x5ac5('0x4f')](_0x5bfe83);}})['then'](function(_0x2adbc5){if(_0x2adbc5){return _0x2adbc5?{'count':_0x1395cb,'rows':_0x2adbc5}:null;}})[_0x5ac5('0x3f')](respondWithResult(_0x22c3b6,null))[_0x5ac5('0x43')](handleError(_0x22c3b6,null));};exports[_0x5ac5('0x50')]=function(_0x5aee82,_0x17c809,_0xf01910){var _0x352291={};var _0x3f3152={};var _0x49a405;var _0x580c42;return db['ZendeskConfiguration'][_0x5ac5('0x4c')]({'where':{'id':_0x5aee82[_0x5ac5('0x45')]['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x17c809,null))['then'](function(_0x11ddcf){if(_0x11ddcf){_0x49a405=_0x11ddcf;_0x3f3152[_0x5ac5('0x2f')]=_[_0x5ac5('0x31')](db[_0x5ac5('0x4d')][_0x5ac5('0x46')]);_0x3f3152[_0x5ac5('0x30')]=_[_0x5ac5('0x31')](_0x5aee82[_0x5ac5('0x30')]);_0x3f3152[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x3f3152[_0x5ac5('0x2f')],_0x3f3152[_0x5ac5('0x30')]);_0x352291[_0x5ac5('0x34')]=_[_0x5ac5('0x33')](_0x3f3152[_0x5ac5('0x2f')],qs[_0x5ac5('0x35')](_0x5aee82['query'][_0x5ac5('0x35')]));_0x352291[_0x5ac5('0x34')]=_0x352291[_0x5ac5('0x34')][_0x5ac5('0x36')]?_0x352291[_0x5ac5('0x34')]:_0x3f3152[_0x5ac5('0x2f')];_0x352291[_0x5ac5('0x38')]=qs[_0x5ac5('0x39')](_0x5aee82[_0x5ac5('0x30')][_0x5ac5('0x39')]);_0x352291[_0x5ac5('0x3a')]=qs[_0x5ac5('0x32')](_[_0x5ac5('0x3b')](_0x5aee82[_0x5ac5('0x30')],_0x3f3152[_0x5ac5('0x32')]));if(_0x5aee82['query']['filter']){_0x352291['where']=_['merge'](_0x352291[_0x5ac5('0x3a')],{'$or':_[_0x5ac5('0x2b')](_0x352291[_0x5ac5('0x34')],function(_0x4fd607){var _0x4d4e06={};_0x4d4e06[_0x4fd607]={'$like':'%'+_0x5aee82[_0x5ac5('0x30')][_0x5ac5('0x3c')]+'%'};return _0x4d4e06;})});}_0x352291=_['merge']({},_0x352291,_0x5aee82[_0x5ac5('0x47')]);return _0x49a405['getDescriptions'](_0x352291);}})['then'](function(_0x24d668){if(_0x24d668){_0x580c42=_0x24d668[_0x5ac5('0x36')];if(!_0x5aee82[_0x5ac5('0x30')][_0x5ac5('0x37')](_0x5ac5('0x4e'))){_0x352291['limit']=qs[_0x5ac5('0x1d')](_0x5aee82[_0x5ac5('0x30')][_0x5ac5('0x1d')]);_0x352291[_0x5ac5('0x1c')]=qs[_0x5ac5('0x1c')](_0x5aee82['query'][_0x5ac5('0x1c')]);}return _0x49a405[_0x5ac5('0x50')](_0x352291);}})[_0x5ac5('0x3f')](function(_0x170b80){if(_0x170b80){return _0x170b80?{'count':_0x580c42,'rows':_0x170b80}:null;}})['then'](respondWithResult(_0x17c809,null))['catch'](handleError(_0x17c809,null));};exports[_0x5ac5('0x51')]=function(_0xc5d18,_0x1febac,_0x4057f3){var _0x106d0f={};var _0x1383a9={};var _0x3a8f0e;var _0x10805e;return db[_0x5ac5('0x2c')]['findOne']({'where':{'id':_0xc5d18['params']['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x1febac,null))[_0x5ac5('0x3f')](function(_0x1cef3b){if(_0x1cef3b){_0x3a8f0e=_0x1cef3b;_0x1383a9[_0x5ac5('0x2f')]=_[_0x5ac5('0x31')](db[_0x5ac5('0x52')][_0x5ac5('0x46')]);_0x1383a9['query']=_[_0x5ac5('0x31')](_0xc5d18['query']);_0x1383a9[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x1383a9[_0x5ac5('0x2f')],_0x1383a9[_0x5ac5('0x30')]);_0x106d0f[_0x5ac5('0x34')]=_[_0x5ac5('0x33')](_0x1383a9[_0x5ac5('0x2f')],qs[_0x5ac5('0x35')](_0xc5d18[_0x5ac5('0x30')][_0x5ac5('0x35')]));_0x106d0f['attributes']=_0x106d0f[_0x5ac5('0x34')][_0x5ac5('0x36')]?_0x106d0f[_0x5ac5('0x34')]:_0x1383a9['model'];_0x106d0f[_0x5ac5('0x38')]=qs[_0x5ac5('0x39')](_0xc5d18['query'][_0x5ac5('0x39')]);_0x106d0f[_0x5ac5('0x3a')]=qs[_0x5ac5('0x32')](_['pick'](_0xc5d18[_0x5ac5('0x30')],_0x1383a9['filters']));if(_0xc5d18[_0x5ac5('0x30')][_0x5ac5('0x3c')]){_0x106d0f[_0x5ac5('0x3a')]=_[_0x5ac5('0x3d')](_0x106d0f[_0x5ac5('0x3a')],{'$or':_[_0x5ac5('0x2b')](_0x106d0f[_0x5ac5('0x34')],function(_0x3b8509){var _0x15af9e={};_0x15af9e[_0x3b8509]={'$like':'%'+_0xc5d18[_0x5ac5('0x30')][_0x5ac5('0x3c')]+'%'};return _0x15af9e;})});}_0x106d0f=_[_0x5ac5('0x3d')]({},_0x106d0f,_0xc5d18[_0x5ac5('0x47')]);return _0x3a8f0e['getTags'](_0x106d0f);}})[_0x5ac5('0x3f')](function(_0xed4f02){if(_0xed4f02){_0x10805e=_0xed4f02[_0x5ac5('0x36')];if(!_0xc5d18[_0x5ac5('0x30')][_0x5ac5('0x37')]('nolimit')){_0x106d0f[_0x5ac5('0x1d')]=qs[_0x5ac5('0x1d')](_0xc5d18['query'][_0x5ac5('0x1d')]);_0x106d0f[_0x5ac5('0x1c')]=qs[_0x5ac5('0x1c')](_0xc5d18[_0x5ac5('0x30')][_0x5ac5('0x1c')]);}return _0x3a8f0e[_0x5ac5('0x51')](_0x106d0f);}})[_0x5ac5('0x3f')](function(_0x39bbbd){if(_0x39bbbd){return _0x39bbbd?{'count':_0x10805e,'rows':_0x39bbbd}:null;}})['then'](respondWithResult(_0x1febac,null))[_0x5ac5('0x43')](handleError(_0x1febac,null));};exports['setTags']=function(_0x11c659,_0x3d6cc3,_0x3b2f91){if(_0x11c659['body']['id']){delete _0x11c659[_0x5ac5('0x4a')]['id'];}return db[_0x5ac5('0x2c')][_0x5ac5('0x4c')]({'where':{'id':_0x11c659['params']['id']}})[_0x5ac5('0x3f')](handleEntityNotFound(_0x3d6cc3,null))[_0x5ac5('0x3f')](function(_0x3839e6){if(_0x3839e6){return _0x3839e6[_0x5ac5('0x53')](_0x11c659[_0x5ac5('0x4a')][_0x5ac5('0x54')]||[]);}return null;})[_0x5ac5('0x3f')](respondWithResult(_0x3d6cc3,null))['catch'](handleError(_0x3d6cc3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 80ea914..7db170d 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 _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3aea40,_0x3aeb6e){_0x3aea40=_0x3aea40-0x0;var _0x4f5daf=_0x4e2e[_0x3aea40];return _0x4f5daf;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f4=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xb855be,_0x2eecb7){_0xb855be=_0xb855be-0x0;var _0x308420=_0xf4f4[_0xb855be];return _0x308420;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var fs=require('fs');var path=require(_0x4f4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4f4f('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x4f4f('0x8')]=function(_0x132d5c,_0x20ee6e){return _0x132d5c[_0x4f4f('0x9')](_0x4f4f('0xa'),attributes,{'tableName':_0x4f4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 81ca3eb..8166ede 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 _0xfa15=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3b1620,_0x51a4c4){var _0x454681=function(_0x55aa83){while(--_0x55aa83){_0x3b1620['push'](_0x3b1620['shift']());}};_0x454681(++_0x51a4c4);}(_0xfa15,0xef));var _0x5fa1=function(_0xac39d3,_0x5da282){_0xac39d3=_0xac39d3-0x0;var _0x1ec7fa=_0xfa15[_0xac39d3];return _0x1ec7fa;};'use strict';var _=require('lodash');var util=require(_0x5fa1('0x0'));var moment=require(_0x5fa1('0x1'));var BPromise=require('bluebird');var rs=require(_0x5fa1('0x2'));var fs=require('fs');var Redis=require(_0x5fa1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fa1('0x4'));var logger=require(_0x5fa1('0x5'))(_0x5fa1('0x6'));var config=require(_0x5fa1('0x7'));var jayson=require(_0x5fa1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b48a9,_0x30487d,_0x1d3cff){return new BPromise(function(_0x3a0624,_0x2cf9ef){return client['request'](_0x3b48a9,_0x1d3cff)[_0x5fa1('0x9')](function(_0x575c63){logger[_0x5fa1('0xa')](_0x5fa1('0xb'),_0x30487d,_0x5fa1('0xc'));logger[_0x5fa1('0xd')](_0x5fa1('0xe'),_0x30487d,'request\x20sent',JSON[_0x5fa1('0xf')](_0x575c63));if(_0x575c63[_0x5fa1('0x10')]){if(_0x575c63['error'][_0x5fa1('0x11')]===0x1f4){logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x575c63[_0x5fa1('0x10')]['message']);return _0x2cf9ef(_0x575c63[_0x5fa1('0x10')]['message']);}logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x575c63[_0x5fa1('0x10')]['message']);return _0x3a0624(_0x575c63['error'][_0x5fa1('0x12')]);}else{logger[_0x5fa1('0xa')](_0x5fa1('0xb'),_0x30487d,_0x5fa1('0xc'));_0x3a0624(_0x575c63[_0x5fa1('0x13')][_0x5fa1('0x12')]);}})[_0x5fa1('0x14')](function(_0x4b13fc){logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x4b13fc);_0x2cf9ef(_0x4b13fc);});});} \ No newline at end of file +var _0x53e2=['message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x53e2,0xd5));var _0x253e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x53e2[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x253e('0x0'));var BPromise=require(_0x253e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x253e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x253e('0x3'));var logger=require(_0x253e('0x4'))('rpc');var config=require(_0x253e('0x5'));var jayson=require(_0x253e('0x6'));var client=jayson['client'][_0x253e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fb6c4,_0x4cd95a,_0x4ba9a2){return new BPromise(function(_0x34fce7,_0x3d8fc8){return client[_0x253e('0x8')](_0x2fb6c4,_0x4ba9a2)[_0x253e('0x9')](function(_0x128fe2){logger[_0x253e('0xa')](_0x253e('0xb'),_0x4cd95a,_0x253e('0xc'));logger[_0x253e('0xd')](_0x253e('0xe'),_0x4cd95a,_0x253e('0xc'),JSON[_0x253e('0xf')](_0x128fe2));if(_0x128fe2[_0x253e('0x10')]){if(_0x128fe2[_0x253e('0x10')][_0x253e('0x11')]===0x1f4){logger['error'](_0x253e('0xb'),_0x4cd95a,_0x128fe2[_0x253e('0x10')]['message']);return _0x3d8fc8(_0x128fe2[_0x253e('0x10')][_0x253e('0x12')]);}logger[_0x253e('0x10')](_0x253e('0xb'),_0x4cd95a,_0x128fe2['error']['message']);return _0x34fce7(_0x128fe2['error'][_0x253e('0x12')]);}else{logger[_0x253e('0xa')](_0x253e('0xb'),_0x4cd95a,_0x253e('0xc'));_0x34fce7(_0x128fe2[_0x253e('0x13')]['message']);}})[_0x253e('0x14')](function(_0x49f761){logger[_0x253e('0x10')](_0x253e('0xb'),_0x4cd95a,_0x49f761);_0x3d8fc8(_0x49f761);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c86aa3a..c71483d 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 _0xdb3e=['create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x34520d,_0x31419e){var _0x8b8eb=function(_0x406750){while(--_0x406750){_0x34520d['push'](_0x34520d['shift']());}};_0x8b8eb(++_0x31419e);}(_0xdb3e,0x65));var _0xedb3=function(_0x331ff7,_0x5d5258){_0x331ff7=_0x331ff7-0x0;var _0xc6cb36=_0xdb3e[_0x331ff7];return _0xc6cb36;};'use strict';var multer=require('multer');var util=require(_0xedb3('0x0'));var path=require('path');var timeout=require(_0xedb3('0x1'));var express=require('express');var router=express[_0xedb3('0x2')]();var fs_extra=require(_0xedb3('0x3'));var auth=require(_0xedb3('0x4'));var interaction=require(_0xedb3('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xedb3('0x6')]('/',auth[_0xedb3('0x7')](),controller[_0xedb3('0x8')]);router[_0xedb3('0x6')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller[_0xedb3('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xedb3('0xb')]);router[_0xedb3('0xc')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller[_0xedb3('0xd')]);router[_0xedb3('0xe')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller['destroy']);module[_0xedb3('0xf')]=router; \ No newline at end of file +var _0x452c=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','show','post','put'];(function(_0x314c4b,_0x377f22){var _0x3f6f4b=function(_0x3d74e2){while(--_0x3d74e2){_0x314c4b['push'](_0x314c4b['shift']());}};_0x3f6f4b(++_0x377f22);}(_0x452c,0x1f2));var _0xc452=function(_0x20cdf0,_0x5ebdd6){_0x20cdf0=_0x20cdf0-0x0;var _0x3385b6=_0x452c[_0x20cdf0];return _0x3385b6;};'use strict';var multer=require(_0xc452('0x0'));var util=require(_0xc452('0x1'));var path=require(_0xc452('0x2'));var timeout=require(_0xc452('0x3'));var express=require(_0xc452('0x4'));var router=express[_0xc452('0x5')]();var fs_extra=require(_0xc452('0x6'));var auth=require(_0xc452('0x7'));var interaction=require(_0xc452('0x8'));var config=require('../../config/environment');var controller=require(_0xc452('0x9'));router[_0xc452('0xa')]('/',auth[_0xc452('0xb')](),controller['index']);router[_0xc452('0xa')]('/:id',auth[_0xc452('0xb')](),controller[_0xc452('0xc')]);router[_0xc452('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc452('0xe')](_0xc452('0xf'),auth[_0xc452('0xb')](),controller[_0xc452('0x10')]);router['delete'](_0xc452('0xf'),auth[_0xc452('0xb')](),controller[_0xc452('0x11')]);module[_0xc452('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 55f92a2..6d38e00 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 _0x8000=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x43e1e6,_0x399da){var _0x58753d=function(_0x260aba){while(--_0x260aba){_0x43e1e6['push'](_0x43e1e6['shift']());}};_0x58753d(++_0x399da);}(_0x8000,0x8b));var _0x0800=function(_0x55dd06,_0x2dcf4b){_0x55dd06=_0x55dd06-0x0;var _0x4e8156=_0x8000[_0x55dd06];return _0x4e8156;};'use strict';var Sequelize=require('sequelize');module[_0x0800('0x0')]={'type':{'type':Sequelize[_0x0800('0x1')]('string',_0x0800('0x2'),_0x0800('0x3'),_0x0800('0x4'),_0x0800('0x5')),'defaultValue':_0x0800('0x6')},'content':{'type':Sequelize[_0x0800('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0800('0x1')](_0x0800('0x6'),_0x0800('0x2'),_0x0800('0x3'))},'keyContent':{'type':Sequelize[_0x0800('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0800('0x7')]},'customField':{'type':Sequelize[_0x0800('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0800('0x7')]}}; \ No newline at end of file +var _0x9ad7=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9ad7,0xdb));var _0x79ad=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x9ad7[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x79ad('0x0'));module[_0x79ad('0x1')]={'type':{'type':Sequelize[_0x79ad('0x2')](_0x79ad('0x3'),_0x79ad('0x4'),_0x79ad('0x5'),'keyValue',_0x79ad('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x79ad('0x7')]},'key':{'type':Sequelize[_0x79ad('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x79ad('0x3'),_0x79ad('0x4'),_0x79ad('0x5'))},'keyContent':{'type':Sequelize[_0x79ad('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x79ad('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x79ad('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b2977b7..4d604b0 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 _0x6838=['rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ZendeskField'];(function(_0x4a006a,_0x28fb65){var _0x1c7d1c=function(_0x359ec2){while(--_0x359ec2){_0x4a006a['push'](_0x4a006a['shift']());}};_0x1c7d1c(++_0x28fb65);}(_0x6838,0xa8));var _0x8683=function(_0x53d816,_0x1d1594){_0x53d816=_0x53d816-0x0;var _0x17c9ed=_0x6838[_0x53d816];return _0x17c9ed;};'use strict';var emlformat=require(_0x8683('0x0'));var rimraf=require(_0x8683('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8683('0x2'));var moment=require(_0x8683('0x3'));var BPromise=require(_0x8683('0x4'));var Mustache=require(_0x8683('0x5'));var util=require(_0x8683('0x6'));var path=require(_0x8683('0x7'));var sox=require(_0x8683('0x8'));var csv=require(_0x8683('0x9'));var ejs=require(_0x8683('0xa'));var fs=require('fs');var fs_extra=require(_0x8683('0xb'));var _=require('lodash');var squel=require(_0x8683('0xc'));var crypto=require(_0x8683('0xd'));var jsforce=require(_0x8683('0xe'));var deskjs=require(_0x8683('0xf'));var toCsv=require(_0x8683('0x9'));var querystring=require(_0x8683('0x10'));var Papa=require(_0x8683('0x11'));var Redis=require('ioredis');var authService=require(_0x8683('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8683('0x13'));var hardwareService=require(_0x8683('0x14'));var logger=require(_0x8683('0x15'))(_0x8683('0x16'));var utils=require(_0x8683('0x17'));var config=require(_0x8683('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30c57a,_0x4dbd93){_0x4dbd93=_0x4dbd93||0xcc;return function(_0x558b43){if(_0x558b43){return _0x30c57a['sendStatus'](_0x4dbd93);}return _0x30c57a[_0x8683('0x19')](_0x4dbd93)['end']();};}function respondWithResult(_0x250d92,_0x5695d1){_0x5695d1=_0x5695d1||0xc8;return function(_0x13bbbb){if(_0x13bbbb){return _0x250d92[_0x8683('0x19')](_0x5695d1)[_0x8683('0x1a')](_0x13bbbb);}};}function respondWithFilteredResult(_0x5b9b6c,_0x3cb57f){return function(_0x18da91){if(_0x18da91){var _0x4385c7=typeof _0x3cb57f[_0x8683('0x1b')]===_0x8683('0x1c')&&typeof _0x3cb57f[_0x8683('0x1d')]===_0x8683('0x1c');var _0x5de2f7=_0x18da91['count'];var _0x2669a4=_0x4385c7?0x0:_0x3cb57f[_0x8683('0x1b')];var _0x4ffaf4=_0x4385c7?_0x18da91[_0x8683('0x1e')]:_0x3cb57f[_0x8683('0x1b')]+_0x3cb57f[_0x8683('0x1d')];var _0x36bcb3;if(_0x4ffaf4>=_0x5de2f7){_0x4ffaf4=_0x5de2f7;_0x36bcb3=0xc8;}else{_0x36bcb3=0xce;}_0x5b9b6c[_0x8683('0x19')](_0x36bcb3);return _0x5b9b6c[_0x8683('0x1f')](_0x8683('0x20'),_0x2669a4+'-'+_0x4ffaf4+'/'+_0x5de2f7)[_0x8683('0x1a')](_0x18da91);}return null;};}function patchUpdates(_0x2bd2fb){return function(_0x58f49f){try{jsonpatch[_0x8683('0x21')](_0x58f49f,_0x2bd2fb,!![]);}catch(_0x48800f){return BPromise[_0x8683('0x22')](_0x48800f);}return _0x58f49f[_0x8683('0x23')]();};}function saveUpdates(_0x292699,_0x42b57a){return function(_0x14b792){if(_0x14b792){return _0x14b792[_0x8683('0x24')](_0x292699)[_0x8683('0x25')](function(_0x4b4b94){return _0x4b4b94;});}return null;};}function removeEntity(_0x112f15,_0x4a50db){return function(_0x223332){if(_0x223332){return _0x223332[_0x8683('0x26')]()[_0x8683('0x25')](function(){_0x112f15[_0x8683('0x19')](0xcc)[_0x8683('0x27')]();});}};}function handleEntityNotFound(_0x2b22fd,_0x1c228d){return function(_0x5c7cfa){if(!_0x5c7cfa){_0x2b22fd[_0x8683('0x28')](0x194);}return _0x5c7cfa;};}function handleError(_0x538359,_0x295098){_0x295098=_0x295098||0x1f4;return function(_0x7a3552){logger[_0x8683('0x29')](_0x7a3552[_0x8683('0x2a')]);if(_0x7a3552[_0x8683('0x2b')]){delete _0x7a3552[_0x8683('0x2b')];}_0x538359[_0x8683('0x19')](_0x295098)[_0x8683('0x2c')](_0x7a3552);};}exports[_0x8683('0x2d')]=function(_0x53f339,_0xae93a2){var _0x555c8f={},_0x5cd2be={},_0x4e7040={'count':0x0,'rows':[]};var _0x5e6c97=_[_0x8683('0x2e')](db[_0x8683('0x2f')][_0x8683('0x30')],function(_0x4821f3){return{'name':_0x4821f3[_0x8683('0x31')],'type':_0x4821f3['type'][_0x8683('0x32')]};});_0x5cd2be['model']=_['map'](_0x5e6c97,_0x8683('0x2b'));_0x5cd2be[_0x8683('0x33')]=_['keys'](_0x53f339[_0x8683('0x33')]);_0x5cd2be[_0x8683('0x34')]=_[_0x8683('0x35')](_0x5cd2be['model'],_0x5cd2be['query']);_0x555c8f[_0x8683('0x36')]=_[_0x8683('0x35')](_0x5cd2be[_0x8683('0x37')],qs[_0x8683('0x38')](_0x53f339[_0x8683('0x33')]['fields']));_0x555c8f[_0x8683('0x36')]=_0x555c8f[_0x8683('0x36')]['length']?_0x555c8f[_0x8683('0x36')]:_0x5cd2be[_0x8683('0x37')];if(!_0x53f339[_0x8683('0x33')]['hasOwnProperty']('nolimit')){_0x555c8f[_0x8683('0x1d')]=qs['limit'](_0x53f339['query'][_0x8683('0x1d')]);_0x555c8f['offset']=qs[_0x8683('0x1b')](_0x53f339[_0x8683('0x33')][_0x8683('0x1b')]);}_0x555c8f['order']=qs['sort'](_0x53f339[_0x8683('0x33')]['sort']);_0x555c8f[_0x8683('0x39')]=qs[_0x8683('0x34')](_['pick'](_0x53f339[_0x8683('0x33')],_0x5cd2be[_0x8683('0x34')]),_0x5e6c97);if(_0x53f339[_0x8683('0x33')][_0x8683('0x3a')]){_0x555c8f[_0x8683('0x39')]=_[_0x8683('0x3b')](_0x555c8f[_0x8683('0x39')],{'$or':_[_0x8683('0x2e')](_0x5e6c97,function(_0x20e4af){if(_0x20e4af[_0x8683('0x3c')]!==_0x8683('0x3d')){var _0xe66616={};_0xe66616[_0x20e4af[_0x8683('0x2b')]]={'$like':'%'+_0x53f339[_0x8683('0x33')][_0x8683('0x3a')]+'%'};return _0xe66616;}})});}_0x555c8f=_[_0x8683('0x3b')]({},_0x555c8f,_0x53f339[_0x8683('0x3e')]);var _0x590eb1={'where':_0x555c8f[_0x8683('0x39')]};return db[_0x8683('0x2f')][_0x8683('0x1e')](_0x590eb1)[_0x8683('0x25')](function(_0x85127c){_0x4e7040[_0x8683('0x1e')]=_0x85127c;if(_0x53f339[_0x8683('0x33')][_0x8683('0x3f')]){_0x555c8f['include']=[{'all':!![]}];}return db[_0x8683('0x2f')]['findAll'](_0x555c8f);})[_0x8683('0x25')](function(_0x347251){_0x4e7040[_0x8683('0x40')]=_0x347251;return _0x4e7040;})[_0x8683('0x25')](respondWithFilteredResult(_0xae93a2,_0x555c8f))[_0x8683('0x41')](handleError(_0xae93a2,null));};exports['show']=function(_0x344f67,_0x5c0163){var _0x2c4757={'raw':!![],'where':{'id':_0x344f67[_0x8683('0x42')]['id']}},_0xef887b={};_0xef887b['model']=_['keys'](db[_0x8683('0x2f')]['rawAttributes']);_0xef887b[_0x8683('0x33')]=_[_0x8683('0x43')](_0x344f67[_0x8683('0x33')]);_0xef887b[_0x8683('0x34')]=_['intersection'](_0xef887b[_0x8683('0x37')],_0xef887b[_0x8683('0x33')]);_0x2c4757[_0x8683('0x36')]=_['intersection'](_0xef887b[_0x8683('0x37')],qs[_0x8683('0x38')](_0x344f67[_0x8683('0x33')][_0x8683('0x38')]));_0x2c4757[_0x8683('0x36')]=_0x2c4757[_0x8683('0x36')]['length']?_0x2c4757[_0x8683('0x36')]:_0xef887b['model'];if(_0x344f67[_0x8683('0x33')][_0x8683('0x3f')]){_0x2c4757[_0x8683('0x44')]=[{'all':!![]}];}_0x2c4757=_[_0x8683('0x3b')]({},_0x2c4757,_0x344f67['options']);return db[_0x8683('0x2f')][_0x8683('0x45')](_0x2c4757)['then'](handleEntityNotFound(_0x5c0163,null))['then'](respondWithResult(_0x5c0163,null))['catch'](handleError(_0x5c0163,null));};exports[_0x8683('0x46')]=function(_0x2b7065,_0x5d755f){return db[_0x8683('0x2f')][_0x8683('0x46')](_0x2b7065['body'],{})[_0x8683('0x25')](respondWithResult(_0x5d755f,0xc9))[_0x8683('0x41')](handleError(_0x5d755f,null));};exports[_0x8683('0x24')]=function(_0x453560,_0x4bcb14){if(_0x453560[_0x8683('0x47')]['id']){delete _0x453560[_0x8683('0x47')]['id'];}return db[_0x8683('0x2f')][_0x8683('0x45')]({'where':{'id':_0x453560['params']['id']}})[_0x8683('0x25')](handleEntityNotFound(_0x4bcb14,null))[_0x8683('0x25')](saveUpdates(_0x453560[_0x8683('0x47')],null))[_0x8683('0x25')](respondWithResult(_0x4bcb14,null))[_0x8683('0x41')](handleError(_0x4bcb14,null));};exports[_0x8683('0x26')]=function(_0x46576f,_0x28fd26){return db[_0x8683('0x2f')][_0x8683('0x45')]({'where':{'id':_0x46576f[_0x8683('0x42')]['id']}})[_0x8683('0x25')](handleEntityNotFound(_0x28fd26,null))[_0x8683('0x25')](removeEntity(_0x28fd26,null))[_0x8683('0x41')](handleError(_0x28fd26,null));}; \ No newline at end of file +var _0x1c4b=['include','findAll','catch','intersection','length','options','create','body','params','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','ZendeskField','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','includeAll'];(function(_0x42cd62,_0x993a86){var _0x5650e2=function(_0x46118a){while(--_0x46118a){_0x42cd62['push'](_0x42cd62['shift']());}};_0x5650e2(++_0x993a86);}(_0x1c4b,0xdb));var _0xb1c4=function(_0x2936c2,_0x422e33){_0x2936c2=_0x2936c2-0x0;var _0x2cffdb=_0x1c4b[_0x2936c2];return _0x2cffdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1c4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1c4('0x1'));var rp=require(_0xb1c4('0x2'));var moment=require(_0xb1c4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1c4('0x4'));var util=require('util');var path=require(_0xb1c4('0x5'));var sox=require(_0xb1c4('0x6'));var csv=require('to-csv');var ejs=require(_0xb1c4('0x7'));var fs=require('fs');var fs_extra=require(_0xb1c4('0x8'));var _=require('lodash');var squel=require(_0xb1c4('0x9'));var crypto=require(_0xb1c4('0xa'));var jsforce=require(_0xb1c4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb1c4('0xc'));var querystring=require(_0xb1c4('0xd'));var Papa=require(_0xb1c4('0xe'));var Redis=require('ioredis');var authService=require(_0xb1c4('0xf'));var qs=require(_0xb1c4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c4('0x11'))('api');var utils=require(_0xb1c4('0x12'));var config=require(_0xb1c4('0x13'));var licenseUtil=require(_0xb1c4('0x14'));var db=require(_0xb1c4('0x15'))['db'];function respondWithStatusCode(_0x3257f3,_0x33eb09){_0x33eb09=_0x33eb09||0xcc;return function(_0x194a2b){if(_0x194a2b){return _0x3257f3['sendStatus'](_0x33eb09);}return _0x3257f3['status'](_0x33eb09)[_0xb1c4('0x16')]();};}function respondWithResult(_0x569792,_0x484f56){_0x484f56=_0x484f56||0xc8;return function(_0x3b09eb){if(_0x3b09eb){return _0x569792[_0xb1c4('0x17')](_0x484f56)[_0xb1c4('0x18')](_0x3b09eb);}};}function respondWithFilteredResult(_0x28eaf3,_0x51c129){return function(_0xcb0909){if(_0xcb0909){var _0x32465a=typeof _0x51c129[_0xb1c4('0x19')]==='undefined'&&typeof _0x51c129[_0xb1c4('0x1a')]===_0xb1c4('0x1b');var _0x117fba=_0xcb0909[_0xb1c4('0x1c')];var _0x4c0fd1=_0x32465a?0x0:_0x51c129[_0xb1c4('0x19')];var _0x11677=_0x32465a?_0xcb0909[_0xb1c4('0x1c')]:_0x51c129[_0xb1c4('0x19')]+_0x51c129[_0xb1c4('0x1a')];var _0x47ac53;if(_0x11677>=_0x117fba){_0x11677=_0x117fba;_0x47ac53=0xc8;}else{_0x47ac53=0xce;}_0x28eaf3[_0xb1c4('0x17')](_0x47ac53);return _0x28eaf3[_0xb1c4('0x1d')](_0xb1c4('0x1e'),_0x4c0fd1+'-'+_0x11677+'/'+_0x117fba)[_0xb1c4('0x18')](_0xcb0909);}return null;};}function patchUpdates(_0x28e56a){return function(_0x8e3272){try{jsonpatch[_0xb1c4('0x1f')](_0x8e3272,_0x28e56a,!![]);}catch(_0x5787f3){return BPromise[_0xb1c4('0x20')](_0x5787f3);}return _0x8e3272[_0xb1c4('0x21')]();};}function saveUpdates(_0x1ac270,_0x3d42c9){return function(_0x1bd383){if(_0x1bd383){return _0x1bd383[_0xb1c4('0x22')](_0x1ac270)[_0xb1c4('0x23')](function(_0x54d512){return _0x54d512;});}return null;};}function removeEntity(_0x51d343,_0x110dac){return function(_0x1a2614){if(_0x1a2614){return _0x1a2614[_0xb1c4('0x24')]()[_0xb1c4('0x23')](function(){_0x51d343[_0xb1c4('0x17')](0xcc)[_0xb1c4('0x16')]();});}};}function handleEntityNotFound(_0x30c774,_0x5bae2a){return function(_0x14f422){if(!_0x14f422){_0x30c774[_0xb1c4('0x25')](0x194);}return _0x14f422;};}function handleError(_0x3f78c3,_0x192643){_0x192643=_0x192643||0x1f4;return function(_0x34c2a5){logger[_0xb1c4('0x26')](_0x34c2a5[_0xb1c4('0x27')]);if(_0x34c2a5[_0xb1c4('0x28')]){delete _0x34c2a5[_0xb1c4('0x28')];}_0x3f78c3[_0xb1c4('0x17')](_0x192643)[_0xb1c4('0x29')](_0x34c2a5);};}exports['index']=function(_0xdd3ea5,_0xd6cda0){var _0x3020a9={},_0x4cc2c2={},_0x51ab08={'count':0x0,'rows':[]};var _0x3b1c35=_['map'](db[_0xb1c4('0x2a')][_0xb1c4('0x2b')],function(_0x20e676){return{'name':_0x20e676[_0xb1c4('0x2c')],'type':_0x20e676[_0xb1c4('0x2d')]['key']};});_0x4cc2c2[_0xb1c4('0x2e')]=_[_0xb1c4('0x2f')](_0x3b1c35,_0xb1c4('0x28'));_0x4cc2c2[_0xb1c4('0x30')]=_[_0xb1c4('0x31')](_0xdd3ea5[_0xb1c4('0x30')]);_0x4cc2c2['filters']=_['intersection'](_0x4cc2c2[_0xb1c4('0x2e')],_0x4cc2c2[_0xb1c4('0x30')]);_0x3020a9[_0xb1c4('0x32')]=_['intersection'](_0x4cc2c2['model'],qs['fields'](_0xdd3ea5['query'][_0xb1c4('0x33')]));_0x3020a9[_0xb1c4('0x32')]=_0x3020a9[_0xb1c4('0x32')]['length']?_0x3020a9[_0xb1c4('0x32')]:_0x4cc2c2[_0xb1c4('0x2e')];if(!_0xdd3ea5[_0xb1c4('0x30')][_0xb1c4('0x34')](_0xb1c4('0x35'))){_0x3020a9['limit']=qs['limit'](_0xdd3ea5[_0xb1c4('0x30')][_0xb1c4('0x1a')]);_0x3020a9[_0xb1c4('0x19')]=qs[_0xb1c4('0x19')](_0xdd3ea5[_0xb1c4('0x30')][_0xb1c4('0x19')]);}_0x3020a9['order']=qs[_0xb1c4('0x36')](_0xdd3ea5[_0xb1c4('0x30')][_0xb1c4('0x36')]);_0x3020a9[_0xb1c4('0x37')]=qs[_0xb1c4('0x38')](_[_0xb1c4('0x39')](_0xdd3ea5[_0xb1c4('0x30')],_0x4cc2c2['filters']),_0x3b1c35);if(_0xdd3ea5['query']['filter']){_0x3020a9[_0xb1c4('0x37')]=_[_0xb1c4('0x3a')](_0x3020a9[_0xb1c4('0x37')],{'$or':_[_0xb1c4('0x2f')](_0x3b1c35,function(_0x3893e8){if(_0x3893e8[_0xb1c4('0x2d')]!==_0xb1c4('0x3b')){var _0x35decd={};_0x35decd[_0x3893e8[_0xb1c4('0x28')]]={'$like':'%'+_0xdd3ea5[_0xb1c4('0x30')]['filter']+'%'};return _0x35decd;}})});}_0x3020a9=_['merge']({},_0x3020a9,_0xdd3ea5['options']);var _0x3046e4={'where':_0x3020a9[_0xb1c4('0x37')]};return db['ZendeskField']['count'](_0x3046e4)['then'](function(_0x25453b){_0x51ab08[_0xb1c4('0x1c')]=_0x25453b;if(_0xdd3ea5['query'][_0xb1c4('0x3c')]){_0x3020a9[_0xb1c4('0x3d')]=[{'all':!![]}];}return db[_0xb1c4('0x2a')][_0xb1c4('0x3e')](_0x3020a9);})['then'](function(_0xff776d){_0x51ab08['rows']=_0xff776d;return _0x51ab08;})[_0xb1c4('0x23')](respondWithFilteredResult(_0xd6cda0,_0x3020a9))[_0xb1c4('0x3f')](handleError(_0xd6cda0,null));};exports['show']=function(_0x9c6500,_0x4e6276){var _0x34f0e0={'raw':!![],'where':{'id':_0x9c6500['params']['id']}},_0x24865f={};_0x24865f[_0xb1c4('0x2e')]=_[_0xb1c4('0x31')](db[_0xb1c4('0x2a')]['rawAttributes']);_0x24865f[_0xb1c4('0x30')]=_[_0xb1c4('0x31')](_0x9c6500['query']);_0x24865f[_0xb1c4('0x38')]=_[_0xb1c4('0x40')](_0x24865f[_0xb1c4('0x2e')],_0x24865f[_0xb1c4('0x30')]);_0x34f0e0[_0xb1c4('0x32')]=_['intersection'](_0x24865f[_0xb1c4('0x2e')],qs[_0xb1c4('0x33')](_0x9c6500[_0xb1c4('0x30')][_0xb1c4('0x33')]));_0x34f0e0['attributes']=_0x34f0e0['attributes'][_0xb1c4('0x41')]?_0x34f0e0[_0xb1c4('0x32')]:_0x24865f[_0xb1c4('0x2e')];if(_0x9c6500[_0xb1c4('0x30')][_0xb1c4('0x3c')]){_0x34f0e0['include']=[{'all':!![]}];}_0x34f0e0=_[_0xb1c4('0x3a')]({},_0x34f0e0,_0x9c6500[_0xb1c4('0x42')]);return db[_0xb1c4('0x2a')]['find'](_0x34f0e0)[_0xb1c4('0x23')](handleEntityNotFound(_0x4e6276,null))[_0xb1c4('0x23')](respondWithResult(_0x4e6276,null))[_0xb1c4('0x3f')](handleError(_0x4e6276,null));};exports[_0xb1c4('0x43')]=function(_0x4cf26e,_0x516733){return db[_0xb1c4('0x2a')][_0xb1c4('0x43')](_0x4cf26e[_0xb1c4('0x44')],{})['then'](respondWithResult(_0x516733,0xc9))[_0xb1c4('0x3f')](handleError(_0x516733,null));};exports[_0xb1c4('0x22')]=function(_0x1a430c,_0x3d3395){if(_0x1a430c['body']['id']){delete _0x1a430c['body']['id'];}return db[_0xb1c4('0x2a')]['find']({'where':{'id':_0x1a430c[_0xb1c4('0x45')]['id']}})[_0xb1c4('0x23')](handleEntityNotFound(_0x3d3395,null))[_0xb1c4('0x23')](saveUpdates(_0x1a430c[_0xb1c4('0x44')],null))[_0xb1c4('0x23')](respondWithResult(_0x3d3395,null))[_0xb1c4('0x3f')](handleError(_0x3d3395,null));};exports[_0xb1c4('0x24')]=function(_0x3150a1,_0x4e20df){return db['ZendeskField']['find']({'where':{'id':_0x3150a1['params']['id']}})[_0xb1c4('0x23')](handleEntityNotFound(_0x4e20df,null))['then'](removeEntity(_0x4e20df,null))[_0xb1c4('0x3f')](handleError(_0x4e20df,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e91da8d..99fd2cd 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 _0xe72a=['exports','ZendeskField','int_zendesk_fields','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x34a346,_0x1d7d06){var _0x8a564b=function(_0x21004f){while(--_0x21004f){_0x34a346['push'](_0x34a346['shift']());}};_0x8a564b(++_0x1d7d06);}(_0xe72a,0x1e1));var _0xae72=function(_0x3ea15e,_0x12e75b){_0x3ea15e=_0x3ea15e-0x0;var _0x47285b=_0xe72a[_0x3ea15e];return _0x47285b;};'use strict';var _=require('lodash');var util=require(_0xae72('0x0'));var logger=require(_0xae72('0x1'))(_0xae72('0x2'));var moment=require('moment');var BPromise=require(_0xae72('0x3'));var rp=require(_0xae72('0x4'));var fs=require('fs');var path=require(_0xae72('0x5'));var rimraf=require(_0xae72('0x6'));var config=require(_0xae72('0x7'));var attributes=require(_0xae72('0x8'));module[_0xae72('0x9')]=function(_0x21cb96,_0xed10b5){return _0x21cb96['define'](_0xae72('0xa'),attributes,{'tableName':_0xae72('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xae72('0xc'),_0xae72('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5809=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes'];(function(_0x4b4bf5,_0x149fa8){var _0x52c793=function(_0x1d5899){while(--_0x1d5899){_0x4b4bf5['push'](_0x4b4bf5['shift']());}};_0x52c793(++_0x149fa8);}(_0x5809,0x142));var _0x9580=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5809[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9580('0x0'));var util=require(_0x9580('0x1'));var logger=require(_0x9580('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9580('0x3'));var rp=require(_0x9580('0x4'));var fs=require('fs');var path=require(_0x9580('0x5'));var rimraf=require('rimraf');var config=require(_0x9580('0x6'));var attributes=require(_0x9580('0x7'));module[_0x9580('0x8')]=function(_0x4e6a0f,_0x2d6b46){return _0x4e6a0f[_0x9580('0x9')](_0x9580('0xa'),attributes,{'tableName':_0x9580('0xb'),'paranoid':![],'indexes':[{'name':_0x9580('0xc'),'fields':[_0x9580('0xd'),_0x9580('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 7442367..08584fe 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 _0xea63=['http','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0xea63,0x14d));var _0x3ea6=function(_0x1a8f4d,_0x41d5ff){_0x1a8f4d=_0x1a8f4d-0x0;var _0x2a7b91=_0xea63[_0x1a8f4d];return _0x2a7b91;};'use strict';var _=require(_0x3ea6('0x0'));var util=require(_0x3ea6('0x1'));var moment=require(_0x3ea6('0x2'));var BPromise=require(_0x3ea6('0x3'));var rs=require(_0x3ea6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ea6('0x5'));var config=require(_0x3ea6('0x6'));var jayson=require(_0x3ea6('0x7'));var client=jayson[_0x3ea6('0x8')][_0x3ea6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e67f4,_0x57b978,_0x364fff){return new BPromise(function(_0x148228,_0x74e5f8){return client['request'](_0x3e67f4,_0x364fff)[_0x3ea6('0xa')](function(_0x179861){logger[_0x3ea6('0xb')](_0x3ea6('0xc'),_0x57b978,'request\x20sent');logger['debug'](_0x3ea6('0xd'),_0x57b978,'request\x20sent',JSON[_0x3ea6('0xe')](_0x179861));if(_0x179861[_0x3ea6('0xf')]){if(_0x179861[_0x3ea6('0xf')][_0x3ea6('0x10')]===0x1f4){logger[_0x3ea6('0xf')]('ZendeskField,\x20%s,\x20%s',_0x57b978,_0x179861[_0x3ea6('0xf')][_0x3ea6('0x11')]);return _0x74e5f8(_0x179861[_0x3ea6('0xf')]['message']);}logger[_0x3ea6('0xf')]('ZendeskField,\x20%s,\x20%s',_0x57b978,_0x179861[_0x3ea6('0xf')][_0x3ea6('0x11')]);return _0x148228(_0x179861['error'][_0x3ea6('0x11')]);}else{logger[_0x3ea6('0xb')](_0x3ea6('0xc'),_0x57b978,'request\x20sent');_0x148228(_0x179861['result'][_0x3ea6('0x11')]);}})['catch'](function(_0x447daf){logger[_0x3ea6('0xf')](_0x3ea6('0xc'),_0x57b978,_0x447daf);_0x74e5f8(_0x447daf);});});} \ No newline at end of file +var _0x8f31=['ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x295bbf,_0x2367ac){var _0x58c9db=function(_0x127258){while(--_0x127258){_0x295bbf['push'](_0x295bbf['shift']());}};_0x58c9db(++_0x2367ac);}(_0x8f31,0x8e));var _0x18f3=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x8f31[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x18f3('0x0'));var util=require(_0x18f3('0x1'));var moment=require(_0x18f3('0x2'));var BPromise=require(_0x18f3('0x3'));var rs=require(_0x18f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x18f3('0x5'));var logger=require(_0x18f3('0x6'))('rpc');var config=require(_0x18f3('0x7'));var jayson=require(_0x18f3('0x8'));var client=jayson[_0x18f3('0x9')][_0x18f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4257e1,_0x11ebdf,_0x4bab8e){return new BPromise(function(_0x1a3e3d,_0x59d820){return client[_0x18f3('0xb')](_0x4257e1,_0x4bab8e)[_0x18f3('0xc')](function(_0x478933){logger[_0x18f3('0xd')]('ZendeskField,\x20%s,\x20%s',_0x11ebdf,_0x18f3('0xe'));logger['debug'](_0x18f3('0xf'),_0x11ebdf,_0x18f3('0xe'),JSON[_0x18f3('0x10')](_0x478933));if(_0x478933[_0x18f3('0x11')]){if(_0x478933[_0x18f3('0x11')][_0x18f3('0x12')]===0x1f4){logger[_0x18f3('0x11')](_0x18f3('0x13'),_0x11ebdf,_0x478933['error'][_0x18f3('0x14')]);return _0x59d820(_0x478933[_0x18f3('0x11')][_0x18f3('0x14')]);}logger['error'](_0x18f3('0x13'),_0x11ebdf,_0x478933[_0x18f3('0x11')][_0x18f3('0x14')]);return _0x1a3e3d(_0x478933[_0x18f3('0x11')][_0x18f3('0x14')]);}else{logger[_0x18f3('0xd')]('ZendeskField,\x20%s,\x20%s',_0x11ebdf,'request\x20sent');_0x1a3e3d(_0x478933[_0x18f3('0x15')][_0x18f3('0x14')]);}})[_0x18f3('0x16')](function(_0x531c6e){logger[_0x18f3('0x11')](_0x18f3('0x13'),_0x11ebdf,_0x531c6e);_0x59d820(_0x531c6e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f382a87..46c91c7 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 _0xcca7=['/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x514daf,_0x5422d0){var _0x53a711=function(_0xc6bf62){while(--_0xc6bf62){_0x514daf['push'](_0x514daf['shift']());}};_0x53a711(++_0x5422d0);}(_0xcca7,0x15b));var _0x7cca=function(_0x194058,_0x5c6092){_0x194058=_0x194058-0x0;var _0x2c76a1=_0xcca7[_0x194058];return _0x2c76a1;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require('path');var timeout=require(_0x7cca('0x2'));var express=require(_0x7cca('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cca('0x4'));var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require('./intZohoAccount.controller');router[_0x7cca('0x7')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0x9')]);router[_0x7cca('0x7')](_0x7cca('0xa'),auth[_0x7cca('0x8')](),controller['show']);router['get'](_0x7cca('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7cca('0xc'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0xf')]);router[_0x7cca('0xe')](_0x7cca('0xb'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x10')]);router[_0x7cca('0x11')](_0x7cca('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7cca('0x12')](_0x7cca('0xa'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x13')]);module[_0x7cca('0x14')]=router; \ No newline at end of file +var _0x5327=['/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x5327,0x1bc));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7532('0x0'));var util=require(_0x7532('0x1'));var path=require(_0x7532('0x2'));var timeout=require(_0x7532('0x3'));var express=require(_0x7532('0x4'));var router=express[_0x7532('0x5')]();var fs_extra=require(_0x7532('0x6'));var auth=require(_0x7532('0x7'));var interaction=require(_0x7532('0x8'));var config=require(_0x7532('0x9'));var controller=require(_0x7532('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7532('0xb')](_0x7532('0xc'),auth['isAuthenticated'](),controller[_0x7532('0xd')]);router[_0x7532('0xb')](_0x7532('0xe'),auth[_0x7532('0xf')](),controller[_0x7532('0x10')]);router[_0x7532('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7532('0x11')]);router[_0x7532('0x12')]('/',auth[_0x7532('0xf')](),controller[_0x7532('0x13')]);router['post'](_0x7532('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x7532('0xc'),auth['isAuthenticated'](),controller[_0x7532('0x14')]);router[_0x7532('0x15')](_0x7532('0xc'),auth[_0x7532('0xf')](),controller[_0x7532('0x16')]);module[_0x7532('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9cd8544..38b66d3 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 _0x00bb=['STRING','sequelize','exports'];(function(_0x33a9ae,_0x2fa819){var _0x5e9f84=function(_0x496fe9){while(--_0x496fe9){_0x33a9ae['push'](_0x33a9ae['shift']());}};_0x5e9f84(++_0x2fa819);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb00b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb00b('0x2')]},'clientSecret':{'type':Sequelize[_0xb00b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb00b('0x2')]},'refreshToken':{'type':Sequelize[_0xb00b('0x2')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x2756d8,_0x628c22){var _0x325f61=function(_0x3981b3){while(--_0x3981b3){_0x2756d8['push'](_0x2756d8['shift']());}};_0x325f61(++_0x628c22);}(_0xdace,0xc5));var _0xedac=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xdace[_0x4687df];return _0x32eaef;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b39649d..b583731 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 _0xb060=['pick','filter','merge','ZohoAccount','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x596669,_0x3f3def){var _0x5e7cc6=function(_0x4e005a){while(--_0x4e005a){_0x596669['push'](_0x596669['shift']());}};_0x5e7cc6(++_0x3f3def);}(_0xb060,0xca));var _0x0b06=function(_0x504b29,_0x45ac3d){_0x504b29=_0x504b29-0x0;var _0x19d838=_0xb060[_0x504b29];return _0x19d838;};'use strict';var emlformat=require(_0x0b06('0x0'));var rimraf=require(_0x0b06('0x1'));var zipdir=require(_0x0b06('0x2'));var jsonpatch=require(_0x0b06('0x3'));var rp=require(_0x0b06('0x4'));var moment=require(_0x0b06('0x5'));var BPromise=require(_0x0b06('0x6'));var Mustache=require(_0x0b06('0x7'));var util=require(_0x0b06('0x8'));var path=require(_0x0b06('0x9'));var sox=require(_0x0b06('0xa'));var csv=require(_0x0b06('0xb'));var ejs=require(_0x0b06('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b06('0xd'));var squel=require(_0x0b06('0xe'));var crypto=require(_0x0b06('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0b06('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b06('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b06('0x12'));var qs=require(_0x0b06('0x13'));var as=require(_0x0b06('0x14'));var hardwareService=require(_0x0b06('0x15'));var logger=require(_0x0b06('0x16'))('api');var utils=require(_0x0b06('0x17'));var config=require(_0x0b06('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0b06('0x19'));function respondWithStatusCode(_0x59775a,_0x269d2b){_0x269d2b=_0x269d2b||0xcc;return function(_0x2ce6d6){if(_0x2ce6d6){return _0x59775a['sendStatus'](_0x269d2b);}return _0x59775a[_0x0b06('0x1a')](_0x269d2b)[_0x0b06('0x1b')]();};}function respondWithResult(_0x2c9bd7,_0x4b1da2){_0x4b1da2=_0x4b1da2||0xc8;return function(_0x18e41d){if(_0x18e41d){return _0x2c9bd7[_0x0b06('0x1a')](_0x4b1da2)['json'](_0x18e41d);}};}function respondWithFilteredResult(_0x3c84d6,_0xf698c4){return function(_0x209ce1){if(_0x209ce1){var _0x5efd59=typeof _0xf698c4[_0x0b06('0x1c')]===_0x0b06('0x1d')&&typeof _0xf698c4[_0x0b06('0x1e')]==='undefined';var _0x2f1c29=_0x209ce1[_0x0b06('0x1f')];var _0x4327a4=_0x5efd59?0x0:_0xf698c4[_0x0b06('0x1c')];var _0xe47f67=_0x5efd59?_0x209ce1[_0x0b06('0x1f')]:_0xf698c4[_0x0b06('0x1c')]+_0xf698c4['limit'];var _0x745f8b;if(_0xe47f67>=_0x2f1c29){_0xe47f67=_0x2f1c29;_0x745f8b=0xc8;}else{_0x745f8b=0xce;}_0x3c84d6[_0x0b06('0x1a')](_0x745f8b);return _0x3c84d6[_0x0b06('0x20')](_0x0b06('0x21'),_0x4327a4+'-'+_0xe47f67+'/'+_0x2f1c29)['json'](_0x209ce1);}return null;};}function patchUpdates(_0xdb408a){return function(_0xcc2326){try{jsonpatch[_0x0b06('0x22')](_0xcc2326,_0xdb408a,!![]);}catch(_0x3a3ff2){return BPromise[_0x0b06('0x23')](_0x3a3ff2);}return _0xcc2326[_0x0b06('0x24')]();};}function saveUpdates(_0xd0c2ce,_0x359c15){return function(_0x3d9db8){if(_0x3d9db8){return _0x3d9db8[_0x0b06('0x25')](_0xd0c2ce)[_0x0b06('0x26')](function(_0x21424a){return _0x21424a;});}return null;};}function removeEntity(_0x25b1ad,_0x413133){return function(_0x1df942){if(_0x1df942){return _0x1df942[_0x0b06('0x27')]()[_0x0b06('0x26')](function(){_0x25b1ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee50c,_0x11761d){return function(_0x4a96f8){if(!_0x4a96f8){_0x1ee50c[_0x0b06('0x28')](0x194);}return _0x4a96f8;};}function handleError(_0x129c3b,_0x31cd4c){_0x31cd4c=_0x31cd4c||0x1f4;return function(_0x59fbbb){logger[_0x0b06('0x29')](_0x59fbbb['stack']);if(_0x59fbbb[_0x0b06('0x2a')]){delete _0x59fbbb[_0x0b06('0x2a')];}_0x129c3b[_0x0b06('0x1a')](_0x31cd4c)[_0x0b06('0x2b')](_0x59fbbb);};}exports[_0x0b06('0x2c')]=function(_0x468e11,_0x2822ba){var _0x36d996={},_0x4b907c={},_0x3cf9f2={'count':0x0,'rows':[]};var _0x139f38=_[_0x0b06('0x2d')](db['ZohoAccount'][_0x0b06('0x2e')],function(_0x46dd5f){return{'name':_0x46dd5f[_0x0b06('0x2f')],'type':_0x46dd5f[_0x0b06('0x30')]['key']};});_0x4b907c[_0x0b06('0x31')]=_[_0x0b06('0x2d')](_0x139f38,_0x0b06('0x2a'));_0x4b907c[_0x0b06('0x32')]=_['keys'](_0x468e11[_0x0b06('0x32')]);_0x4b907c[_0x0b06('0x33')]=_[_0x0b06('0x34')](_0x4b907c[_0x0b06('0x31')],_0x4b907c[_0x0b06('0x32')]);_0x36d996[_0x0b06('0x35')]=_[_0x0b06('0x34')](_0x4b907c['model'],qs[_0x0b06('0x36')](_0x468e11[_0x0b06('0x32')][_0x0b06('0x36')]));_0x36d996[_0x0b06('0x35')]=_0x36d996[_0x0b06('0x35')][_0x0b06('0x37')]?_0x36d996[_0x0b06('0x35')]:_0x4b907c[_0x0b06('0x31')];if(!_0x468e11[_0x0b06('0x32')]['hasOwnProperty'](_0x0b06('0x38'))){_0x36d996['limit']=qs[_0x0b06('0x1e')](_0x468e11[_0x0b06('0x32')][_0x0b06('0x1e')]);_0x36d996[_0x0b06('0x1c')]=qs['offset'](_0x468e11[_0x0b06('0x32')][_0x0b06('0x1c')]);}_0x36d996[_0x0b06('0x39')]=qs['sort'](_0x468e11[_0x0b06('0x32')][_0x0b06('0x3a')]);_0x36d996[_0x0b06('0x3b')]=qs[_0x0b06('0x33')](_[_0x0b06('0x3c')](_0x468e11[_0x0b06('0x32')],_0x4b907c[_0x0b06('0x33')]),_0x139f38);if(_0x468e11[_0x0b06('0x32')][_0x0b06('0x3d')]){_0x36d996['where']=_[_0x0b06('0x3e')](_0x36d996[_0x0b06('0x3b')],{'$or':_[_0x0b06('0x2d')](_0x139f38,function(_0x2134d3){if(_0x2134d3[_0x0b06('0x30')]!=='VIRTUAL'){var _0x38c190={};_0x38c190[_0x2134d3[_0x0b06('0x2a')]]={'$like':'%'+_0x468e11[_0x0b06('0x32')][_0x0b06('0x3d')]+'%'};return _0x38c190;}})});}_0x36d996=_['merge']({},_0x36d996,_0x468e11['options']);var _0x473abc={'where':_0x36d996['where']};return db[_0x0b06('0x3f')][_0x0b06('0x1f')](_0x473abc)[_0x0b06('0x26')](function(_0x25b4e6){_0x3cf9f2[_0x0b06('0x1f')]=_0x25b4e6;if(_0x468e11[_0x0b06('0x32')][_0x0b06('0x40')]){_0x36d996['include']=[{'all':!![]}];}return db[_0x0b06('0x3f')][_0x0b06('0x41')](_0x36d996);})['then'](function(_0x45b655){_0x3cf9f2[_0x0b06('0x42')]=_0x45b655;return _0x3cf9f2;})[_0x0b06('0x26')](respondWithFilteredResult(_0x2822ba,_0x36d996))[_0x0b06('0x43')](handleError(_0x2822ba,null));};exports[_0x0b06('0x44')]=function(_0x3bda86,_0x5daf45){var _0x1c310a={'raw':![],'where':{'id':_0x3bda86[_0x0b06('0x45')]['id']}},_0x40f088={};_0x40f088[_0x0b06('0x31')]=_[_0x0b06('0x46')](db[_0x0b06('0x3f')][_0x0b06('0x2e')]);_0x40f088['query']=_[_0x0b06('0x46')](_0x3bda86[_0x0b06('0x32')]);_0x40f088[_0x0b06('0x33')]=_['intersection'](_0x40f088[_0x0b06('0x31')],_0x40f088['query']);_0x1c310a[_0x0b06('0x35')]=_[_0x0b06('0x34')](_0x40f088[_0x0b06('0x31')],qs[_0x0b06('0x36')](_0x3bda86[_0x0b06('0x32')][_0x0b06('0x36')]));_0x1c310a[_0x0b06('0x35')]=_0x1c310a[_0x0b06('0x35')][_0x0b06('0x37')]?_0x1c310a[_0x0b06('0x35')]:_0x40f088[_0x0b06('0x31')];if(_0x3bda86[_0x0b06('0x32')][_0x0b06('0x40')]){_0x1c310a['include']=[{'all':!![]}];}_0x1c310a=_[_0x0b06('0x3e')]({},_0x1c310a,_0x3bda86[_0x0b06('0x47')]);return db[_0x0b06('0x3f')][_0x0b06('0x48')](_0x1c310a)[_0x0b06('0x26')](handleEntityNotFound(_0x5daf45,null))[_0x0b06('0x26')](respondWithResult(_0x5daf45,null))[_0x0b06('0x43')](handleError(_0x5daf45,null));};exports[_0x0b06('0x49')]=function(_0xd63168,_0x5101fd){return db[_0x0b06('0x3f')][_0x0b06('0x49')](_0xd63168['body'],{})['then'](respondWithResult(_0x5101fd,0xc9))[_0x0b06('0x43')](handleError(_0x5101fd,null));};exports[_0x0b06('0x25')]=function(_0x486254,_0x5d5006){if(_0x486254['body']['id']){delete _0x486254[_0x0b06('0x4a')]['id'];}return db['ZohoAccount'][_0x0b06('0x48')]({'where':{'id':_0x486254[_0x0b06('0x45')]['id']}})[_0x0b06('0x26')](handleEntityNotFound(_0x5d5006,null))[_0x0b06('0x26')](saveUpdates(_0x486254[_0x0b06('0x4a')],null))[_0x0b06('0x26')](respondWithResult(_0x5d5006,null))[_0x0b06('0x43')](handleError(_0x5d5006,null));};exports[_0x0b06('0x27')]=function(_0x26e0dc,_0x3b8f29){return db[_0x0b06('0x3f')][_0x0b06('0x48')]({'where':{'id':_0x26e0dc[_0x0b06('0x45')]['id']}})[_0x0b06('0x26')](handleEntityNotFound(_0x3b8f29,null))[_0x0b06('0x26')](removeEntity(_0x3b8f29,null))['catch'](handleError(_0x3b8f29,null));};exports[_0x0b06('0x4b')]=function(_0x59dce1,_0x3d7aff,_0x1e9884){var _0x4f326a={};var _0x518771={};var _0x93d62d;var _0x3cf851;return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x59dce1[_0x0b06('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d7aff,null))[_0x0b06('0x26')](function(_0x5e2b86){if(_0x5e2b86){_0x93d62d=_0x5e2b86;_0x518771[_0x0b06('0x31')]=_['keys'](db[_0x0b06('0x4d')]['rawAttributes']);_0x518771[_0x0b06('0x32')]=_[_0x0b06('0x46')](_0x59dce1[_0x0b06('0x32')]);_0x518771['filters']=_[_0x0b06('0x34')](_0x518771[_0x0b06('0x31')],_0x518771[_0x0b06('0x32')]);_0x4f326a['attributes']=_[_0x0b06('0x34')](_0x518771[_0x0b06('0x31')],qs[_0x0b06('0x36')](_0x59dce1[_0x0b06('0x32')][_0x0b06('0x36')]));_0x4f326a[_0x0b06('0x35')]=_0x4f326a[_0x0b06('0x35')][_0x0b06('0x37')]?_0x4f326a[_0x0b06('0x35')]:_0x518771[_0x0b06('0x31')];_0x4f326a[_0x0b06('0x39')]=qs[_0x0b06('0x3a')](_0x59dce1[_0x0b06('0x32')]['sort']);_0x4f326a[_0x0b06('0x3b')]=qs[_0x0b06('0x33')](_['pick'](_0x59dce1[_0x0b06('0x32')],_0x518771[_0x0b06('0x33')]));if(_0x59dce1['query'][_0x0b06('0x3d')]){_0x4f326a[_0x0b06('0x3b')]=_[_0x0b06('0x3e')](_0x4f326a[_0x0b06('0x3b')],{'$or':_[_0x0b06('0x2d')](_0x4f326a[_0x0b06('0x35')],function(_0x526874){var _0x3dc13={};_0x3dc13[_0x526874]={'$like':'%'+_0x59dce1[_0x0b06('0x32')][_0x0b06('0x3d')]+'%'};return _0x3dc13;})});}_0x4f326a=_['merge']({},_0x4f326a,_0x59dce1[_0x0b06('0x47')]);return _0x93d62d[_0x0b06('0x4b')](_0x4f326a);}})[_0x0b06('0x26')](function(_0x5d15fb){if(_0x5d15fb){_0x3cf851=_0x5d15fb[_0x0b06('0x37')];if(!_0x59dce1[_0x0b06('0x32')][_0x0b06('0x4e')]('nolimit')){_0x4f326a[_0x0b06('0x1e')]=qs[_0x0b06('0x1e')](_0x59dce1[_0x0b06('0x32')][_0x0b06('0x1e')]);_0x4f326a[_0x0b06('0x1c')]=qs[_0x0b06('0x1c')](_0x59dce1[_0x0b06('0x32')]['offset']);}return _0x93d62d['getConfigurations'](_0x4f326a);}})[_0x0b06('0x26')](function(_0x21ccc3){if(_0x21ccc3){return _0x21ccc3?{'count':_0x3cf851,'rows':_0x21ccc3}:null;}})[_0x0b06('0x26')](respondWithResult(_0x3d7aff,null))[_0x0b06('0x43')](handleError(_0x3d7aff,null));};exports[_0x0b06('0x4f')]=function(_0x488b4d,_0x1a94b0,_0x4010fa){if(_0x488b4d[_0x0b06('0x4a')]['id']){delete _0x488b4d[_0x0b06('0x4a')]['id'];}return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x488b4d['params']['id']}})['then'](handleEntityNotFound(_0x1a94b0,null))[_0x0b06('0x26')](function(_0x471f57){if(_0x471f57){_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x50')]=_0x471f57['id'];_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x51')]=integrations[_0x0b06('0x52')](_0x488b4d['body'][_0x0b06('0x53')],_0x488b4d['body']['type']);_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x54')]=integrations[_0x0b06('0x55')](_0x488b4d['body'][_0x0b06('0x53')],_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x30')]);return db[_0x0b06('0x4d')]['create'](_0x488b4d[_0x0b06('0x4a')],{'include':[{'model':db[_0x0b06('0x56')],'as':_0x0b06('0x51')},{'model':db[_0x0b06('0x56')],'as':'Descriptions'}]});}return null;})[_0x0b06('0x26')](respondWithResult(_0x1a94b0,null))[_0x0b06('0x43')](handleError(_0x1a94b0,null));};function getAccessToken(_0x511211){return new Promise(function(_0x2713bd,_0x581cb1){var _0x1f49b2;switch(_0x511211[_0x0b06('0x57')]){case'US':_0x1f49b2=_0x0b06('0x58');break;case'AU':_0x1f49b2=_0x0b06('0x59');break;case'EU':_0x1f49b2=_0x0b06('0x5a');break;case'IN':_0x1f49b2='https://accounts.zoho.in';break;case'CN':_0x1f49b2=_0x0b06('0x5b');break;default:_0x1f49b2=_0x0b06('0x5a');break;}var _0x1fcf32={'method':'POST','uri':_0x1f49b2+_0x0b06('0x5c'),'qs':{'refresh_token':_0x511211['refreshToken'],'client_id':_0x511211[_0x0b06('0x5d')],'client_secret':_0x511211['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1fcf32)[_0x0b06('0x26')](function(_0x58d497){if(_0x58d497[_0x0b06('0x5e')]){_0x2713bd(_0x58d497[_0x0b06('0x5e')]);}else{_0x581cb1(_0x0b06('0x5f'));}})[_0x0b06('0x43')](function(_0x53c502){_0x581cb1(_0x53c502);});});}exports['getFields']=function(_0x79f6cb,_0x242f6b,_0x4b3572){var _0xb854a8,_0x4ebfc3,_0x4f83ad,_0x374b0f,_0xf7e564;return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x79f6cb[_0x0b06('0x45')]['id']},'attributes':['id',_0x0b06('0x60'),_0x0b06('0x57'),_0x0b06('0x5d'),_0x0b06('0x61'),_0x0b06('0x62'),_0x0b06('0x63'),_0x0b06('0x64')]})[_0x0b06('0x26')](handleEntityNotFound(_0x242f6b,null))[_0x0b06('0x26')](function(_0x175db3){_0xf7e564=_0x175db3;_0xb854a8=_0xf7e564['host'];_0x4ebfc3=_0xb854a8===_0x0b06('0x65')?'eu':_0x0b06('0x66');_0x4f83ad=_0xf7e564['serverUrl'];var _0x2cc7c6=_0x4f83ad[_0x0b06('0x67')](-0x1);if(_0x2cc7c6==='/'||_0x2cc7c6==='\x5c'||_0x2cc7c6===':'){_0x4f83ad=_0x4f83ad[_0x0b06('0x68')](0x0,_0x4f83ad[_0x0b06('0x69')](_0x2cc7c6));}if(!_0xf7e564[_0x0b06('0x64')]){throw new Error(_0x0b06('0x6a'));}return getAccessToken(_0xf7e564);})[_0x0b06('0x26')](function(_0x581228){if(_0x581228){return rp({'method':'GET','uri':util[_0x0b06('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4ebfc3),'qs':{'module':_0x0b06('0x6c')},'headers':{'Authorization':_0x0b06('0x6d')+_0x581228},'json':!![]});}})['then'](function(_0x3b01ed){if(_0x3b01ed){if(_0x3b01ed[_0x0b06('0x6e')]&&_0x3b01ed[_0x0b06('0x6e')][_0x0b06('0x29')]){throw new Error(_0x3b01ed[_0x0b06('0x6e')][_0x0b06('0x29')][_0x0b06('0x6f')]);}var _0xa3255a=[];var _0x1f66af=[];var _0x1ca96c=[_0x0b06('0x70'),'Subject',_0x0b06('0x71'),_0x0b06('0x72'),_0x0b06('0x73'),_0x0b06('0x74'),'Call_Start_Time',_0x0b06('0x75')];_0x1f66af=_[_0x0b06('0x76')](_0x3b01ed[_0x0b06('0x36')],function(_0x4caa9e){return _0x1ca96c['includes'](_0x4caa9e[_0x0b06('0x77')]);});for(var _0x559055=0x0;_0x559055<_0x1f66af['length'];_0x559055++){if(_0x1f66af[_0x559055][_0x0b06('0x78')]===![]){_0xa3255a['push']({'id':_0x1f66af[_0x559055]['id'],'name':_0x1f66af[_0x559055][_0x0b06('0x79')],'custom':_0x1f66af[_0x559055][_0x0b06('0x7a')],'options':_0x1f66af[_0x559055][_0x0b06('0x7b')]===_0x0b06('0x7c')&&_0x1f66af[_0x559055][_0x0b06('0x7d')]['length']>-0x1?_[_0x0b06('0x2d')](_0x1f66af[_0x559055][_0x0b06('0x7d')],function(_0x2d59f3){return{'name':_0x2d59f3,'value':_0x2d59f3};}):[]});}}return{'count':_0xa3255a['length'],'rows':_0xa3255a};}else{return{'count':0x0,'rows':[]};}})[_0x0b06('0x26')](respondWithResult(_0x242f6b,null))['catch'](function(_0x5b6d6d){var _0x2714bc=_0x79f6cb[_0x0b06('0x32')][_0x0b06('0x7e')]?0x1f4:_0x5b6d6d[_0x0b06('0x7f')]||0x1f4;logger[_0x0b06('0x29')](_0x0b06('0x80'),'getFields',_0x2714bc,JSON[_0x0b06('0x81')](_0x5b6d6d));delete _0x5b6d6d['name'];if(_0x2714bc===0x191){_0x2714bc=0x190;}_0x242f6b[_0x0b06('0x1a')](_0x2714bc)[_0x0b06('0x2b')](_0x79f6cb['query'][_0x0b06('0x7e')]?{'message':_0x0b06('0x82'),'statusCode':_0x5b6d6d['statusCode']}:_0x5b6d6d);});}; \ No newline at end of file +var _0x74ca=['findAll','rows','catch','show','params','keys','options','find','create','body','ZohoConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','findOne','host','serverUrl','code','zoho.eu','com','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','update','destroy','then','error','name','send','index','map','ZohoAccount','rawAttributes','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include'];(function(_0x52893b,_0x12b7da){var _0x2c3bbc=function(_0x41e383){while(--_0x41e383){_0x52893b['push'](_0x52893b['shift']());}};_0x2c3bbc(++_0x12b7da);}(_0x74ca,0x1b2));var _0xa74c=function(_0x21d2f1,_0x3c6a9d){_0x21d2f1=_0x21d2f1-0x0;var _0x145309=_0x74ca[_0x21d2f1];return _0x145309;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa74c('0x0'));var zipdir=require(_0xa74c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa74c('0x2'));var moment=require(_0xa74c('0x3'));var BPromise=require(_0xa74c('0x4'));var Mustache=require(_0xa74c('0x5'));var util=require(_0xa74c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa74c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa74c('0x8'));var _=require(_0xa74c('0x9'));var squel=require('squel');var crypto=require(_0xa74c('0xa'));var jsforce=require(_0xa74c('0xb'));var deskjs=require(_0xa74c('0xc'));var toCsv=require(_0xa74c('0x7'));var querystring=require(_0xa74c('0xd'));var Papa=require(_0xa74c('0xe'));var Redis=require(_0xa74c('0xf'));var authService=require(_0xa74c('0x10'));var qs=require(_0xa74c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa74c('0x12'));var utils=require('../../config/utils');var config=require(_0xa74c('0x13'));var licenseUtil=require(_0xa74c('0x14'));var db=require(_0xa74c('0x15'))['db'];var integrations=require(_0xa74c('0x16'));function respondWithStatusCode(_0x552200,_0x395913){_0x395913=_0x395913||0xcc;return function(_0x42cdfe){if(_0x42cdfe){return _0x552200[_0xa74c('0x17')](_0x395913);}return _0x552200[_0xa74c('0x18')](_0x395913)[_0xa74c('0x19')]();};}function respondWithResult(_0xc20d24,_0x3a3b98){_0x3a3b98=_0x3a3b98||0xc8;return function(_0x18ddf9){if(_0x18ddf9){return _0xc20d24['status'](_0x3a3b98)['json'](_0x18ddf9);}};}function respondWithFilteredResult(_0x1823ed,_0x224cbe){return function(_0x55ca4b){if(_0x55ca4b){var _0x4f4640=typeof _0x224cbe[_0xa74c('0x1a')]===_0xa74c('0x1b')&&typeof _0x224cbe[_0xa74c('0x1c')]==='undefined';var _0x8e5fe7=_0x55ca4b['count'];var _0x55c4ad=_0x4f4640?0x0:_0x224cbe[_0xa74c('0x1a')];var _0x38e879=_0x4f4640?_0x55ca4b['count']:_0x224cbe[_0xa74c('0x1a')]+_0x224cbe[_0xa74c('0x1c')];var _0x122d72;if(_0x38e879>=_0x8e5fe7){_0x38e879=_0x8e5fe7;_0x122d72=0xc8;}else{_0x122d72=0xce;}_0x1823ed[_0xa74c('0x18')](_0x122d72);return _0x1823ed[_0xa74c('0x1d')]('Content-Range',_0x55c4ad+'-'+_0x38e879+'/'+_0x8e5fe7)[_0xa74c('0x1e')](_0x55ca4b);}return null;};}function patchUpdates(_0x57c73b){return function(_0x904da1){try{jsonpatch[_0xa74c('0x1f')](_0x904da1,_0x57c73b,!![]);}catch(_0x4223f9){return BPromise[_0xa74c('0x20')](_0x4223f9);}return _0x904da1[_0xa74c('0x21')]();};}function saveUpdates(_0xbd8ff2,_0x5366ec){return function(_0x4b081e){if(_0x4b081e){return _0x4b081e[_0xa74c('0x22')](_0xbd8ff2)['then'](function(_0x55330a){return _0x55330a;});}return null;};}function removeEntity(_0x2ceec8,_0x3f0e4d){return function(_0x324752){if(_0x324752){return _0x324752[_0xa74c('0x23')]()[_0xa74c('0x24')](function(){_0x2ceec8[_0xa74c('0x18')](0xcc)[_0xa74c('0x19')]();});}};}function handleEntityNotFound(_0x61013a,_0x4bfa08){return function(_0x3f7a4a){if(!_0x3f7a4a){_0x61013a[_0xa74c('0x17')](0x194);}return _0x3f7a4a;};}function handleError(_0x8c68a1,_0x502fac){_0x502fac=_0x502fac||0x1f4;return function(_0x4ecac3){logger[_0xa74c('0x25')](_0x4ecac3['stack']);if(_0x4ecac3['name']){delete _0x4ecac3[_0xa74c('0x26')];}_0x8c68a1['status'](_0x502fac)[_0xa74c('0x27')](_0x4ecac3);};}exports[_0xa74c('0x28')]=function(_0x2ea702,_0x5021b5){var _0x4d110d={},_0x13f23e={},_0x395a71={'count':0x0,'rows':[]};var _0x561037=_[_0xa74c('0x29')](db[_0xa74c('0x2a')][_0xa74c('0x2b')],function(_0x11ada5){return{'name':_0x11ada5['fieldName'],'type':_0x11ada5[_0xa74c('0x2c')]['key']};});_0x13f23e[_0xa74c('0x2d')]=_[_0xa74c('0x29')](_0x561037,_0xa74c('0x26'));_0x13f23e[_0xa74c('0x2e')]=_['keys'](_0x2ea702[_0xa74c('0x2e')]);_0x13f23e['filters']=_[_0xa74c('0x2f')](_0x13f23e['model'],_0x13f23e[_0xa74c('0x2e')]);_0x4d110d[_0xa74c('0x30')]=_[_0xa74c('0x2f')](_0x13f23e[_0xa74c('0x2d')],qs[_0xa74c('0x31')](_0x2ea702['query']['fields']));_0x4d110d['attributes']=_0x4d110d['attributes'][_0xa74c('0x32')]?_0x4d110d[_0xa74c('0x30')]:_0x13f23e[_0xa74c('0x2d')];if(!_0x2ea702[_0xa74c('0x2e')]['hasOwnProperty'](_0xa74c('0x33'))){_0x4d110d[_0xa74c('0x1c')]=qs[_0xa74c('0x1c')](_0x2ea702[_0xa74c('0x2e')][_0xa74c('0x1c')]);_0x4d110d[_0xa74c('0x1a')]=qs['offset'](_0x2ea702[_0xa74c('0x2e')][_0xa74c('0x1a')]);}_0x4d110d[_0xa74c('0x34')]=qs[_0xa74c('0x35')](_0x2ea702[_0xa74c('0x2e')][_0xa74c('0x35')]);_0x4d110d[_0xa74c('0x36')]=qs[_0xa74c('0x37')](_['pick'](_0x2ea702[_0xa74c('0x2e')],_0x13f23e[_0xa74c('0x37')]),_0x561037);if(_0x2ea702['query'][_0xa74c('0x38')]){_0x4d110d[_0xa74c('0x36')]=_[_0xa74c('0x39')](_0x4d110d[_0xa74c('0x36')],{'$or':_[_0xa74c('0x29')](_0x561037,function(_0x217492){if(_0x217492[_0xa74c('0x2c')]!==_0xa74c('0x3a')){var _0x47c823={};_0x47c823[_0x217492[_0xa74c('0x26')]]={'$like':'%'+_0x2ea702['query'][_0xa74c('0x38')]+'%'};return _0x47c823;}})});}_0x4d110d=_[_0xa74c('0x39')]({},_0x4d110d,_0x2ea702['options']);var _0x583902={'where':_0x4d110d[_0xa74c('0x36')]};return db[_0xa74c('0x2a')][_0xa74c('0x3b')](_0x583902)[_0xa74c('0x24')](function(_0x4cacbe){_0x395a71[_0xa74c('0x3b')]=_0x4cacbe;if(_0x2ea702[_0xa74c('0x2e')][_0xa74c('0x3c')]){_0x4d110d[_0xa74c('0x3d')]=[{'all':!![]}];}return db['ZohoAccount'][_0xa74c('0x3e')](_0x4d110d);})[_0xa74c('0x24')](function(_0x2e85f5){_0x395a71[_0xa74c('0x3f')]=_0x2e85f5;return _0x395a71;})[_0xa74c('0x24')](respondWithFilteredResult(_0x5021b5,_0x4d110d))[_0xa74c('0x40')](handleError(_0x5021b5,null));};exports[_0xa74c('0x41')]=function(_0x36c593,_0x53e59d){var _0x204e85={'raw':![],'where':{'id':_0x36c593[_0xa74c('0x42')]['id']}},_0x5c11d4={};_0x5c11d4[_0xa74c('0x2d')]=_[_0xa74c('0x43')](db[_0xa74c('0x2a')][_0xa74c('0x2b')]);_0x5c11d4[_0xa74c('0x2e')]=_[_0xa74c('0x43')](_0x36c593[_0xa74c('0x2e')]);_0x5c11d4[_0xa74c('0x37')]=_['intersection'](_0x5c11d4[_0xa74c('0x2d')],_0x5c11d4[_0xa74c('0x2e')]);_0x204e85[_0xa74c('0x30')]=_[_0xa74c('0x2f')](_0x5c11d4['model'],qs['fields'](_0x36c593[_0xa74c('0x2e')][_0xa74c('0x31')]));_0x204e85[_0xa74c('0x30')]=_0x204e85[_0xa74c('0x30')]['length']?_0x204e85[_0xa74c('0x30')]:_0x5c11d4[_0xa74c('0x2d')];if(_0x36c593['query']['includeAll']){_0x204e85[_0xa74c('0x3d')]=[{'all':!![]}];}_0x204e85=_[_0xa74c('0x39')]({},_0x204e85,_0x36c593[_0xa74c('0x44')]);return db[_0xa74c('0x2a')][_0xa74c('0x45')](_0x204e85)[_0xa74c('0x24')](handleEntityNotFound(_0x53e59d,null))[_0xa74c('0x24')](respondWithResult(_0x53e59d,null))[_0xa74c('0x40')](handleError(_0x53e59d,null));};exports[_0xa74c('0x46')]=function(_0x1b6779,_0x49175f){return db['ZohoAccount'][_0xa74c('0x46')](_0x1b6779[_0xa74c('0x47')],{})[_0xa74c('0x24')](respondWithResult(_0x49175f,0xc9))['catch'](handleError(_0x49175f,null));};exports[_0xa74c('0x22')]=function(_0xca8100,_0x5e23f3){if(_0xca8100[_0xa74c('0x47')]['id']){delete _0xca8100['body']['id'];}return db[_0xa74c('0x2a')][_0xa74c('0x45')]({'where':{'id':_0xca8100[_0xa74c('0x42')]['id']}})[_0xa74c('0x24')](handleEntityNotFound(_0x5e23f3,null))[_0xa74c('0x24')](saveUpdates(_0xca8100[_0xa74c('0x47')],null))[_0xa74c('0x24')](respondWithResult(_0x5e23f3,null))['catch'](handleError(_0x5e23f3,null));};exports['destroy']=function(_0x3ab04e,_0x531ba3){return db['ZohoAccount']['find']({'where':{'id':_0x3ab04e['params']['id']}})[_0xa74c('0x24')](handleEntityNotFound(_0x531ba3,null))[_0xa74c('0x24')](removeEntity(_0x531ba3,null))['catch'](handleError(_0x531ba3,null));};exports['getConfigurations']=function(_0x1aabf7,_0x17b0da,_0x11c48b){var _0x4cde16={};var _0x49bbd2={};var _0x4e0a18;var _0x5aa174;return db[_0xa74c('0x2a')]['findOne']({'where':{'id':_0x1aabf7[_0xa74c('0x42')]['id']}})[_0xa74c('0x24')](handleEntityNotFound(_0x17b0da,null))[_0xa74c('0x24')](function(_0x1c9001){if(_0x1c9001){_0x4e0a18=_0x1c9001;_0x49bbd2[_0xa74c('0x2d')]=_['keys'](db[_0xa74c('0x48')][_0xa74c('0x2b')]);_0x49bbd2[_0xa74c('0x2e')]=_[_0xa74c('0x43')](_0x1aabf7[_0xa74c('0x2e')]);_0x49bbd2[_0xa74c('0x37')]=_[_0xa74c('0x2f')](_0x49bbd2[_0xa74c('0x2d')],_0x49bbd2[_0xa74c('0x2e')]);_0x4cde16['attributes']=_[_0xa74c('0x2f')](_0x49bbd2[_0xa74c('0x2d')],qs[_0xa74c('0x31')](_0x1aabf7[_0xa74c('0x2e')]['fields']));_0x4cde16['attributes']=_0x4cde16[_0xa74c('0x30')][_0xa74c('0x32')]?_0x4cde16[_0xa74c('0x30')]:_0x49bbd2[_0xa74c('0x2d')];_0x4cde16['order']=qs[_0xa74c('0x35')](_0x1aabf7[_0xa74c('0x2e')][_0xa74c('0x35')]);_0x4cde16[_0xa74c('0x36')]=qs['filters'](_['pick'](_0x1aabf7[_0xa74c('0x2e')],_0x49bbd2[_0xa74c('0x37')]));if(_0x1aabf7[_0xa74c('0x2e')][_0xa74c('0x38')]){_0x4cde16[_0xa74c('0x36')]=_[_0xa74c('0x39')](_0x4cde16['where'],{'$or':_['map'](_0x4cde16[_0xa74c('0x30')],function(_0x310057){var _0x483c2b={};_0x483c2b[_0x310057]={'$like':'%'+_0x1aabf7[_0xa74c('0x2e')]['filter']+'%'};return _0x483c2b;})});}_0x4cde16=_[_0xa74c('0x39')]({},_0x4cde16,_0x1aabf7[_0xa74c('0x44')]);return _0x4e0a18[_0xa74c('0x49')](_0x4cde16);}})[_0xa74c('0x24')](function(_0x55844f){if(_0x55844f){_0x5aa174=_0x55844f[_0xa74c('0x32')];if(!_0x1aabf7['query'][_0xa74c('0x4a')](_0xa74c('0x33'))){_0x4cde16[_0xa74c('0x1c')]=qs[_0xa74c('0x1c')](_0x1aabf7['query'][_0xa74c('0x1c')]);_0x4cde16['offset']=qs[_0xa74c('0x1a')](_0x1aabf7[_0xa74c('0x2e')][_0xa74c('0x1a')]);}return _0x4e0a18[_0xa74c('0x49')](_0x4cde16);}})[_0xa74c('0x24')](function(_0x2feb9c){if(_0x2feb9c){return _0x2feb9c?{'count':_0x5aa174,'rows':_0x2feb9c}:null;}})[_0xa74c('0x24')](respondWithResult(_0x17b0da,null))['catch'](handleError(_0x17b0da,null));};exports[_0xa74c('0x4b')]=function(_0x1042dc,_0x4e659c,_0x1121cb){if(_0x1042dc[_0xa74c('0x47')]['id']){delete _0x1042dc[_0xa74c('0x47')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x1042dc[_0xa74c('0x42')]['id']}})[_0xa74c('0x24')](handleEntityNotFound(_0x4e659c,null))[_0xa74c('0x24')](function(_0x3890a4){if(_0x3890a4){_0x1042dc[_0xa74c('0x47')][_0xa74c('0x4c')]=_0x3890a4['id'];_0x1042dc[_0xa74c('0x47')][_0xa74c('0x4d')]=integrations[_0xa74c('0x4e')](_0x1042dc[_0xa74c('0x47')][_0xa74c('0x4f')],_0x1042dc[_0xa74c('0x47')]['type']);_0x1042dc[_0xa74c('0x47')]['Descriptions']=integrations[_0xa74c('0x50')](_0x1042dc['body']['channel'],_0x1042dc[_0xa74c('0x47')][_0xa74c('0x2c')]);return db[_0xa74c('0x48')][_0xa74c('0x46')](_0x1042dc[_0xa74c('0x47')],{'include':[{'model':db[_0xa74c('0x51')],'as':_0xa74c('0x4d')},{'model':db[_0xa74c('0x51')],'as':_0xa74c('0x52')}]});}return null;})[_0xa74c('0x24')](respondWithResult(_0x4e659c,null))['catch'](handleError(_0x4e659c,null));};function getAccessToken(_0x1eba59){return new Promise(function(_0x5e4ca2,_0x1b41f0){var _0x18c72f;switch(_0x1eba59[_0xa74c('0x53')]){case'US':_0x18c72f=_0xa74c('0x54');break;case'AU':_0x18c72f='https://accounts.zoho.com.au';break;case'EU':_0x18c72f=_0xa74c('0x55');break;case'IN':_0x18c72f='https://accounts.zoho.in';break;case'CN':_0x18c72f='https://accounts.zoho.com.cn';break;default:_0x18c72f=_0xa74c('0x55');break;}var _0x350bea={'method':_0xa74c('0x56'),'uri':_0x18c72f+'/oauth/v2/token','qs':{'refresh_token':_0x1eba59[_0xa74c('0x57')],'client_id':_0x1eba59[_0xa74c('0x58')],'client_secret':_0x1eba59[_0xa74c('0x59')],'grant_type':_0xa74c('0x5a')},'json':!![]};return rp(_0x350bea)[_0xa74c('0x24')](function(_0x37fcb3){if(_0x37fcb3[_0xa74c('0x5b')]){_0x5e4ca2(_0x37fcb3[_0xa74c('0x5b')]);}else{_0x1b41f0('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xa74c('0x40')](function(_0x48833a){_0x1b41f0(_0x48833a);});});}exports['getFields']=function(_0x31af23,_0x505fca,_0x4134e1){var _0x4ce6f5,_0x15a344,_0x4a4e61,_0x2dc98c,_0x11b036;return db[_0xa74c('0x2a')][_0xa74c('0x5c')]({'where':{'id':_0x31af23['params']['id']},'attributes':['id',_0xa74c('0x5d'),_0xa74c('0x53'),_0xa74c('0x58'),_0xa74c('0x59'),_0xa74c('0x5e'),_0xa74c('0x5f'),_0xa74c('0x57')]})[_0xa74c('0x24')](handleEntityNotFound(_0x505fca,null))[_0xa74c('0x24')](function(_0x559104){_0x11b036=_0x559104;_0x4ce6f5=_0x11b036[_0xa74c('0x5d')];_0x15a344=_0x4ce6f5===_0xa74c('0x60')?'eu':_0xa74c('0x61');_0x4a4e61=_0x11b036['serverUrl'];var _0x3dd341=_0x4a4e61[_0xa74c('0x62')](-0x1);if(_0x3dd341==='/'||_0x3dd341==='\x5c'||_0x3dd341===':'){_0x4a4e61=_0x4a4e61['substring'](0x0,_0x4a4e61['lastIndexOf'](_0x3dd341));}if(!_0x11b036[_0xa74c('0x57')]){throw new Error(_0xa74c('0x63'));}return getAccessToken(_0x11b036);})[_0xa74c('0x24')](function(_0x3c9fb2){if(_0x3c9fb2){return rp({'method':'GET','uri':util[_0xa74c('0x64')](_0xa74c('0x65'),_0x15a344),'qs':{'module':_0xa74c('0x66')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3c9fb2},'json':!![]});}})['then'](function(_0x188313){if(_0x188313){if(_0x188313[_0xa74c('0x67')]&&_0x188313[_0xa74c('0x67')][_0xa74c('0x25')]){throw new Error(_0x188313['response'][_0xa74c('0x25')][_0xa74c('0x68')]);}var _0x550ce3=[];var _0x2db3c1=[];var _0x163902=[_0xa74c('0x69'),_0xa74c('0x6a'),_0xa74c('0x6b'),_0xa74c('0x6c'),_0xa74c('0x6d'),_0xa74c('0x6e'),_0xa74c('0x6f'),_0xa74c('0x70')];_0x2db3c1=_[_0xa74c('0x71')](_0x188313['fields'],function(_0x6f5d17){return _0x163902[_0xa74c('0x72')](_0x6f5d17[_0xa74c('0x73')]);});for(var _0x200337=0x0;_0x200337<_0x2db3c1['length'];_0x200337++){if(_0x2db3c1[_0x200337][_0xa74c('0x74')]===![]){_0x550ce3[_0xa74c('0x75')]({'id':_0x2db3c1[_0x200337]['id'],'name':_0x2db3c1[_0x200337][_0xa74c('0x76')],'custom':_0x2db3c1[_0x200337]['custom_field'],'options':_0x2db3c1[_0x200337][_0xa74c('0x77')]==='picklist'&&_0x2db3c1[_0x200337][_0xa74c('0x78')][_0xa74c('0x32')]>-0x1?_[_0xa74c('0x29')](_0x2db3c1[_0x200337]['pick_list_values'],function(_0x27505f){return{'name':_0x27505f,'value':_0x27505f};}):[]});}}return{'count':_0x550ce3['length'],'rows':_0x550ce3};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x505fca,null))[_0xa74c('0x40')](function(_0x427d4a){var _0x21cff4=_0x31af23[_0xa74c('0x2e')]['test']?0x1f4:_0x427d4a[_0xa74c('0x79')]||0x1f4;logger['error'](_0xa74c('0x7a'),'getFields',_0x21cff4,JSON[_0xa74c('0x7b')](_0x427d4a));delete _0x427d4a['name'];if(_0x21cff4===0x191){_0x21cff4=0x190;}_0x505fca[_0xa74c('0x18')](_0x21cff4)[_0xa74c('0x27')](_0x31af23[_0xa74c('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x427d4a[_0xa74c('0x79')]}:_0x427d4a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 14eedc3..5869ea7 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 _0x5618=['error','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5618,0x1ae));var _0x8561=function(_0x34804e,_0x44b678){_0x34804e=_0x34804e-0x0;var _0x3ba8a3=_0x5618[_0x34804e];return _0x3ba8a3;};'use strict';var _=require('lodash');var util=require(_0x8561('0x0'));var logger=require(_0x8561('0x1'))(_0x8561('0x2'));var moment=require(_0x8561('0x3'));var BPromise=require(_0x8561('0x4'));var rp=require(_0x8561('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8561('0x6'));var config=require(_0x8561('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8561('0x8'));module[_0x8561('0x9')]=function(_0x4dd8d1,_0x206ed6){return _0x4dd8d1['define'](_0x8561('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xca8b26,_0xdb5379,_0x3a1c46){if(_0xca8b26[_0x8561('0xb')](_0x8561('0xc'))||_0xca8b26[_0x8561('0xb')](_0x8561('0xd'))||_0xca8b26[_0x8561('0xb')]('clientId')||_0xca8b26['changed'](_0x8561('0xe'))||_0xca8b26[_0x8561('0xb')](_0x8561('0xf'))||_0xca8b26[_0x8561('0xb')](_0x8561('0x10'))){var _0xcc7b16,_0x3523ba;_0xcc7b16=_0xca8b26[_0x8561('0xd')];var _0x30d602=_0xcc7b16[_0x8561('0x11')](-0x1);if(_0x30d602==='/'||_0x30d602==='\x5c'||_0x30d602===':'){_0xcc7b16=_0xcc7b16[_0x8561('0x12')](0x0,_0xcc7b16[_0x8561('0x13')](_0x30d602));}switch(_0xca8b26[_0x8561('0xc')]){case'US':_0x3523ba=_0x8561('0x14');break;case'AU':_0x3523ba='https://accounts.zoho.com.au';break;case'IN':_0x3523ba=_0x8561('0x15');break;case'CN':_0x3523ba=_0x8561('0x16');break;default:_0x3523ba='https://accounts.zoho.eu';break;}var _0x337d67={'method':_0x8561('0x17'),'uri':_0x3523ba+_0x8561('0x18'),'form':{'grant_type':'authorization_code','client_id':_0xca8b26[_0x8561('0x19')],'client_secret':_0xca8b26['clientSecret'],'redirect_uri':_0xca8b26[_0x8561('0xd')],'code':_0xca8b26[_0x8561('0xf')]},'headers':{'Content-Type':_0x8561('0x1a')}};return rp(_0x337d67)[_0x8561('0x1b')](function(_0x36e9c8){var _0x200870=JSON[_0x8561('0x1c')](_0x36e9c8);if(_0x200870[_0x8561('0x1d')]){_0xca8b26[_0x8561('0x1e')]=_0x200870['refresh_token'];logger[_0x8561('0x1f')](util[_0x8561('0x20')](_0x8561('0x21'),_0xca8b26[_0x8561('0x22')],_0xca8b26['id']));}else{logger['error'](util[_0x8561('0x20')](_0x8561('0x23'),_0xca8b26['name'],_0xca8b26['id']),util[_0x8561('0x24')](_0x200870,{'showHidden':![],'depth':null}));}return _0x3a1c46(null,_0xdb5379);})[_0x8561('0x25')](function(_0x3836dc){logger['error'](util['format'](_0x8561('0x23'),_0xca8b26['name'],_0xca8b26['id']),util[_0x8561('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a1c46(_0x3836dc);});}else{return _0x3a1c46(null,_0xdb5379);}},'beforeUpdate':function(_0x2cad70,_0x3aa0eb,_0x3ce896){if(_0x2cad70[_0x8561('0xb')]('zone')||_0x2cad70[_0x8561('0xb')](_0x8561('0xd'))||_0x2cad70[_0x8561('0xb')](_0x8561('0x19'))||_0x2cad70[_0x8561('0xb')](_0x8561('0xe'))||_0x2cad70[_0x8561('0xb')](_0x8561('0xf'))||_0x2cad70[_0x8561('0xb')]('host')){var _0x1443f4,_0x17733f;_0x1443f4=_0x2cad70[_0x8561('0xd')];var _0x1aa791=_0x1443f4[_0x8561('0x11')](-0x1);if(_0x1aa791==='/'||_0x1aa791==='\x5c'||_0x1aa791===':'){_0x1443f4=_0x1443f4[_0x8561('0x12')](0x0,_0x1443f4[_0x8561('0x13')](_0x1aa791));}switch(_0x2cad70[_0x8561('0xc')]){case'US':_0x17733f=_0x8561('0x14');break;case'AU':_0x17733f='https://accounts.zoho.com.au';break;case'IN':_0x17733f=_0x8561('0x15');break;case'CN':_0x17733f=_0x8561('0x16');break;default:_0x17733f='https://accounts.zoho.eu';break;}var _0x48c840={'method':'POST','uri':_0x17733f+_0x8561('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2cad70[_0x8561('0x19')],'client_secret':_0x2cad70[_0x8561('0xe')],'redirect_uri':_0x2cad70[_0x8561('0xd')],'code':_0x2cad70[_0x8561('0xf')]},'headers':{'Content-Type':_0x8561('0x1a')}};return rp(_0x48c840)[_0x8561('0x1b')](function(_0x3bf4f0){var _0x1ed359=JSON[_0x8561('0x1c')](_0x3bf4f0);if(_0x1ed359[_0x8561('0x1d')]){_0x2cad70[_0x8561('0x1e')]=_0x1ed359[_0x8561('0x1d')];logger['info'](util[_0x8561('0x20')](_0x8561('0x21'),_0x2cad70[_0x8561('0x22')],_0x2cad70['id']));}else{logger[_0x8561('0x26')](util[_0x8561('0x20')](_0x8561('0x23'),_0x2cad70[_0x8561('0x22')],_0x2cad70['id']),util[_0x8561('0x24')](_0x1ed359,{'showHidden':![],'depth':null}));}return _0x3ce896(null,_0x3aa0eb);})[_0x8561('0x25')](function(_0x26849c){logger[_0x8561('0x26')](util[_0x8561('0x20')](_0x8561('0x23'),_0x2cad70['name'],_0x2cad70['id']),util[_0x8561('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ce896(_0x26849c);});}else{return _0x3ce896(null,_0x3aa0eb);}}}});}; \ No newline at end of file +var _0xbe83=['path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','code','host','slice','zone','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','inspect','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d8e84,_0x3ad5f2){var _0x4feb4e=function(_0x2b3993){while(--_0x2b3993){_0x1d8e84['push'](_0x1d8e84['shift']());}};_0x4feb4e(++_0x3ad5f2);}(_0xbe83,0x12e));var _0x3be8=function(_0x5b681e,_0x238f13){_0x5b681e=_0x5b681e-0x0;var _0x39d539=_0xbe83[_0x5b681e];return _0x39d539;};'use strict';var _=require(_0x3be8('0x0'));var util=require(_0x3be8('0x1'));var logger=require(_0x3be8('0x2'))(_0x3be8('0x3'));var moment=require(_0x3be8('0x4'));var BPromise=require(_0x3be8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3be8('0x6'));var rimraf=require('rimraf');var config=require(_0x3be8('0x7'));var attributes=require(_0x3be8('0x8'));var integrations=require(_0x3be8('0x9'));module[_0x3be8('0xa')]=function(_0xec0495,_0x1c5c3a){return _0xec0495[_0x3be8('0xb')](_0x3be8('0xc'),attributes,{'tableName':_0x3be8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a97a4,_0x37410d,_0x2ae50d){if(_0x1a97a4['changed']('zone')||_0x1a97a4[_0x3be8('0xe')](_0x3be8('0xf'))||_0x1a97a4[_0x3be8('0xe')]('clientId')||_0x1a97a4[_0x3be8('0xe')](_0x3be8('0x10'))||_0x1a97a4['changed'](_0x3be8('0x11'))||_0x1a97a4['changed'](_0x3be8('0x12'))){var _0x51c18c,_0x4c3fd6;_0x51c18c=_0x1a97a4[_0x3be8('0xf')];var _0x29afc7=_0x51c18c[_0x3be8('0x13')](-0x1);if(_0x29afc7==='/'||_0x29afc7==='\x5c'||_0x29afc7===':'){_0x51c18c=_0x51c18c['substring'](0x0,_0x51c18c['lastIndexOf'](_0x29afc7));}switch(_0x1a97a4[_0x3be8('0x14')]){case'US':_0x4c3fd6=_0x3be8('0x15');break;case'AU':_0x4c3fd6='https://accounts.zoho.com.au';break;case'IN':_0x4c3fd6='https://accounts.zoho.in';break;case'CN':_0x4c3fd6=_0x3be8('0x16');break;default:_0x4c3fd6=_0x3be8('0x17');break;}var _0x3d409e={'method':_0x3be8('0x18'),'uri':_0x4c3fd6+_0x3be8('0x19'),'form':{'grant_type':_0x3be8('0x1a'),'client_id':_0x1a97a4['clientId'],'client_secret':_0x1a97a4['clientSecret'],'redirect_uri':_0x1a97a4[_0x3be8('0xf')],'code':_0x1a97a4[_0x3be8('0x11')]},'headers':{'Content-Type':_0x3be8('0x1b')}};return rp(_0x3d409e)[_0x3be8('0x1c')](function(_0x436918){var _0x9cbd55=JSON[_0x3be8('0x1d')](_0x436918);if(_0x9cbd55[_0x3be8('0x1e')]){_0x1a97a4[_0x3be8('0x1f')]=_0x9cbd55[_0x3be8('0x1e')];logger[_0x3be8('0x20')](util[_0x3be8('0x21')](_0x3be8('0x22'),_0x1a97a4[_0x3be8('0x23')],_0x1a97a4['id']));}else{logger['error'](util[_0x3be8('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1a97a4[_0x3be8('0x23')],_0x1a97a4['id']),util['inspect'](_0x9cbd55,{'showHidden':![],'depth':null}));}return _0x2ae50d(null,_0x37410d);})[_0x3be8('0x24')](function(_0x222b2f){logger[_0x3be8('0x25')](util[_0x3be8('0x21')](_0x3be8('0x26'),_0x1a97a4[_0x3be8('0x23')],_0x1a97a4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2ae50d(_0x222b2f);});}else{return _0x2ae50d(null,_0x37410d);}},'beforeUpdate':function(_0x38596e,_0x10a816,_0x759a78){if(_0x38596e[_0x3be8('0xe')](_0x3be8('0x14'))||_0x38596e[_0x3be8('0xe')](_0x3be8('0xf'))||_0x38596e[_0x3be8('0xe')]('clientId')||_0x38596e[_0x3be8('0xe')]('clientSecret')||_0x38596e[_0x3be8('0xe')](_0x3be8('0x11'))||_0x38596e[_0x3be8('0xe')]('host')){var _0x47b689,_0x5b20b3;_0x47b689=_0x38596e[_0x3be8('0xf')];var _0x167aa8=_0x47b689[_0x3be8('0x13')](-0x1);if(_0x167aa8==='/'||_0x167aa8==='\x5c'||_0x167aa8===':'){_0x47b689=_0x47b689[_0x3be8('0x27')](0x0,_0x47b689[_0x3be8('0x28')](_0x167aa8));}switch(_0x38596e[_0x3be8('0x14')]){case'US':_0x5b20b3=_0x3be8('0x15');break;case'AU':_0x5b20b3=_0x3be8('0x29');break;case'IN':_0x5b20b3=_0x3be8('0x2a');break;case'CN':_0x5b20b3='https://accounts.zoho.com.cn';break;default:_0x5b20b3='https://accounts.zoho.eu';break;}var _0x2f18ae={'method':_0x3be8('0x18'),'uri':_0x5b20b3+_0x3be8('0x19'),'form':{'grant_type':_0x3be8('0x1a'),'client_id':_0x38596e['clientId'],'client_secret':_0x38596e['clientSecret'],'redirect_uri':_0x38596e[_0x3be8('0xf')],'code':_0x38596e[_0x3be8('0x11')]},'headers':{'Content-Type':_0x3be8('0x1b')}};return rp(_0x2f18ae)['then'](function(_0x26cef8){var _0x5c9ea2=JSON[_0x3be8('0x1d')](_0x26cef8);if(_0x5c9ea2[_0x3be8('0x1e')]){_0x38596e['refreshToken']=_0x5c9ea2[_0x3be8('0x1e')];logger['info'](util[_0x3be8('0x21')](_0x3be8('0x22'),_0x38596e['name'],_0x38596e['id']));}else{logger['error'](util[_0x3be8('0x21')](_0x3be8('0x26'),_0x38596e[_0x3be8('0x23')],_0x38596e['id']),util[_0x3be8('0x2b')](_0x5c9ea2,{'showHidden':![],'depth':null}));}return _0x759a78(null,_0x10a816);})[_0x3be8('0x24')](function(_0x115dd3){logger[_0x3be8('0x25')](util[_0x3be8('0x21')](_0x3be8('0x26'),_0x38596e[_0x3be8('0x23')],_0x38596e['id']),util[_0x3be8('0x2b')](parsedResult,{'showHidden':![],'depth':null}));return _0x759a78(_0x115dd3);});}else{return _0x759a78(null,_0x10a816);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7de9244..feef4e1 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 _0x4991=['where','attributes','limit','include','map','model','catch','ShowZohoAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetZohoAccount','findAll','options','raw'];(function(_0x4e6abf,_0x94a679){var _0x3317ad=function(_0x551b18){while(--_0x551b18){_0x4e6abf['push'](_0x4e6abf['shift']());}};_0x3317ad(++_0x94a679);}(_0x4991,0xf7));var _0x1499=function(_0x1e1504,_0x5cc64f){_0x1e1504=_0x1e1504-0x0;var _0x2575c0=_0x4991[_0x1e1504];return _0x2575c0;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['ZohoAccount'][_0x1499('0x16')]({'raw':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'limit':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1b')]||null:null,'include':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')],function(_0x2c7f57){return{'model':db[_0x2c7f57['model']],'as':_0x2c7f57['as'],'attributes':_0x2c7f57[_0x1499('0x1a')],'include':_0x2c7f57[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x2c7f57[_0x1499('0x1c')],function(_0x3968e0){return{'model':db[_0x3968e0[_0x1499('0x1e')]],'as':_0x3968e0['as'],'attributes':_0x3968e0['attributes'],'include':_0x3968e0['include']?_[_0x1499('0x1d')](_0x3968e0[_0x1499('0x1c')],function(_0x3b9259){return{'model':db[_0x3b9259[_0x1499('0x1e')]],'as':_0x3b9259['as'],'attributes':_0x3b9259[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e5ed1){logger['info']('GetZohoAccount',_0x1e45a9);logger['debug'](_0x1499('0x15'),_0x1e45a9,JSON[_0x1499('0x11')](_0x3e5ed1));_0x5b9859(_0x3e5ed1);})[_0x1499('0x1f')](function(_0x1b460b){logger[_0x1499('0x12')](_0x1499('0x15'),_0x1b460b[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533['error'](0x1f4,_0x1b460b[_0x1499('0x13')]));});});};exports[_0x1499('0x20')]=function(_0x39995b){var _0x5b59ea=this;return new Promise(function(_0x2dae84,_0x16466c){return db['ZohoAccount'][_0x1499('0x21')]({'raw':_0x39995b[_0x1499('0x17')]?_0x39995b['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'include':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x39995b[_0x1499('0x17')][_0x1499('0x1c')],function(_0x3f4c1a){return{'model':db[_0x3f4c1a[_0x1499('0x1e')]],'as':_0x3f4c1a['as'],'attributes':_0x3f4c1a[_0x1499('0x1a')],'include':_0x3f4c1a[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x3f4c1a[_0x1499('0x1c')],function(_0x29e89e){return{'model':db[_0x29e89e['model']],'as':_0x29e89e['as'],'attributes':_0x29e89e[_0x1499('0x1a')],'include':_0x29e89e[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x29e89e[_0x1499('0x1c')],function(_0x31251c){return{'model':db[_0x31251c[_0x1499('0x1e')]],'as':_0x31251c['as'],'attributes':_0x31251c[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1499('0xc')](function(_0x12cf93){logger[_0x1499('0xd')](_0x1499('0x20'),_0x39995b);logger['debug']('ShowZohoAccount',_0x39995b,JSON[_0x1499('0x11')](_0x12cf93));_0x2dae84(_0x12cf93);})['catch'](function(_0x29bb8f){logger['error'](_0x1499('0x20'),_0x29bb8f[_0x1499('0x13')],_0x39995b);_0x16466c(_0x5b59ea[_0x1499('0x12')](0x1f4,_0x29bb8f[_0x1499('0x13')]));});});}; \ No newline at end of file +var _0xb4d9=['result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowZohoAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2aef9c,_0x2f664c){var _0x172800=function(_0x36c81d){while(--_0x36c81d){_0x2aef9c['push'](_0x2aef9c['shift']());}};_0x172800(++_0x2f664c);}(_0xb4d9,0xce));var _0x9b4d=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xb4d9[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var moment=require('moment');var BPromise=require(_0x9b4d('0x2'));var rs=require(_0x9b4d('0x3'));var fs=require('fs');var Redis=require(_0x9b4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b4d('0x5'));var logger=require(_0x9b4d('0x6'))(_0x9b4d('0x7'));var config=require(_0x9b4d('0x8'));var jayson=require(_0x9b4d('0x9'));var client=jayson[_0x9b4d('0xa')][_0x9b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429cc5,_0x461cb1,_0x14cb0b){return new BPromise(function(_0x156c68,_0x48832a){return client[_0x9b4d('0xc')](_0x429cc5,_0x14cb0b)['then'](function(_0x340b21){logger['info'](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));logger[_0x9b4d('0xf')](_0x9b4d('0x10'),_0x461cb1,_0x9b4d('0xe'),JSON[_0x9b4d('0x11')](_0x340b21));if(_0x340b21[_0x9b4d('0x12')]){if(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x13')]===0x1f4){logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21[_0x9b4d('0x12')]['message']);return _0x48832a(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x14')]);}logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21['error'][_0x9b4d('0x14')]);return _0x156c68(_0x340b21['error']['message']);}else{logger[_0x9b4d('0x15')](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));_0x156c68(_0x340b21[_0x9b4d('0x16')][_0x9b4d('0x14')]);}})[_0x9b4d('0x17')](function(_0x5d23f3){logger['error'](_0x9b4d('0xd'),_0x461cb1,_0x5d23f3);_0x48832a(_0x5d23f3);});});}exports[_0x9b4d('0x18')]=function(_0x15e808){var _0x25c32d=this;return new Promise(function(_0x1c52eb,_0x20e223){return db[_0x9b4d('0x19')][_0x9b4d('0x1a')]({'raw':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'limit':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1f')]||null:null,'include':_0x15e808['options']?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x15e808['options'][_0x9b4d('0x20')],function(_0x5daeda){return{'model':db[_0x5daeda['model']],'as':_0x5daeda['as'],'attributes':_0x5daeda[_0x9b4d('0x1e')],'include':_0x5daeda['include']?_[_0x9b4d('0x21')](_0x5daeda[_0x9b4d('0x20')],function(_0x5607b7){return{'model':db[_0x5607b7[_0x9b4d('0x22')]],'as':_0x5607b7['as'],'attributes':_0x5607b7[_0x9b4d('0x1e')],'include':_0x5607b7[_0x9b4d('0x20')]?_['map'](_0x5607b7['include'],function(_0x465013){return{'model':db[_0x465013[_0x9b4d('0x22')]],'as':_0x465013['as'],'attributes':_0x465013['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0x5d639b){logger[_0x9b4d('0x15')]('GetZohoAccount',_0x15e808);logger[_0x9b4d('0xf')]('GetZohoAccount',_0x15e808,JSON[_0x9b4d('0x11')](_0x5d639b));_0x1c52eb(_0x5d639b);})[_0x9b4d('0x17')](function(_0x5e9d1b){logger[_0x9b4d('0x12')]('GetZohoAccount',_0x5e9d1b['message'],_0x15e808);_0x20e223(_0x25c32d[_0x9b4d('0x12')](0x1f4,_0x5e9d1b[_0x9b4d('0x14')]));});});};exports['ShowZohoAccount']=function(_0x51459b){var _0xe5980d=this;return new Promise(function(_0x3b1954,_0x1da4ab){return db[_0x9b4d('0x19')][_0x9b4d('0x24')]({'raw':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'include':_0x51459b[_0x9b4d('0x1b')]?_0x51459b['options'][_0x9b4d('0x20')]?_['map'](_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x20')],function(_0x141989){return{'model':db[_0x141989[_0x9b4d('0x22')]],'as':_0x141989['as'],'attributes':_0x141989[_0x9b4d('0x1e')],'include':_0x141989[_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x141989['include'],function(_0x1b99b7){return{'model':db[_0x1b99b7[_0x9b4d('0x22')]],'as':_0x1b99b7['as'],'attributes':_0x1b99b7[_0x9b4d('0x1e')],'include':_0x1b99b7['include']?_['map'](_0x1b99b7[_0x9b4d('0x20')],function(_0x47bff3){return{'model':db[_0x47bff3['model']],'as':_0x47bff3['as'],'attributes':_0x47bff3[_0x9b4d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0xb588fe){logger[_0x9b4d('0x15')](_0x9b4d('0x25'),_0x51459b);logger['debug'](_0x9b4d('0x25'),_0x51459b,JSON[_0x9b4d('0x11')](_0xb588fe));_0x3b1954(_0xb588fe);})['catch'](function(_0xf5842){logger[_0x9b4d('0x12')](_0x9b4d('0x25'),_0xf5842[_0x9b4d('0x14')],_0x51459b);_0x1da4ab(_0xe5980d[_0x9b4d('0x12')](0x1f4,_0xf5842['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index aa7009f..8f540ec 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 _0x9add=['multer','util','path','express','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports'];(function(_0x2046ee,_0x5c974d){var _0x5e447a=function(_0x4e3fce){while(--_0x4e3fce){_0x2046ee['push'](_0x2046ee['shift']());}};_0x5e447a(++_0x5c974d);}(_0x9add,0x8a));var _0xd9ad=function(_0x1444ea,_0x7ac298){_0x1444ea=_0x1444ea-0x0;var _0xb2333c=_0x9add[_0x1444ea];return _0xb2333c;};'use strict';var multer=require(_0xd9ad('0x0'));var util=require(_0xd9ad('0x1'));var path=require(_0xd9ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ad('0x3'));var router=express['Router']();var fs_extra=require(_0xd9ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd9ad('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xd9ad('0x6')]('/',auth['isAuthenticated'](),controller[_0xd9ad('0x7')]);router[_0xd9ad('0x6')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xa')]);router[_0xd9ad('0x6')]('/:id/fields',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xb')]);router['get'](_0xd9ad('0xc'),auth['isAuthenticated'](),controller[_0xd9ad('0xd')]);router[_0xd9ad('0x6')](_0xd9ad('0xe'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xf')]);router[_0xd9ad('0x10')]('/',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x11')]);router[_0xd9ad('0x12')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x13')]);router[_0xd9ad('0x14')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x15')]);module[_0xd9ad('0x16')]=router; \ No newline at end of file +var _0x46a0=['../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getSubjects','getDescriptions','post','create','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b43b1,_0x9fd762){var _0x3b480d=function(_0x5929a3){while(--_0x5929a3){_0x2b43b1['push'](_0x2b43b1['shift']());}};_0x3b480d(++_0x9fd762);}(_0x46a0,0x10b));var _0x046a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46a0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x046a('0x0'));var path=require(_0x046a('0x1'));var timeout=require(_0x046a('0x2'));var express=require(_0x046a('0x3'));var router=express[_0x046a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x046a('0x5'));var interaction=require(_0x046a('0x6'));var config=require('../../config/environment');var controller=require(_0x046a('0x7'));router[_0x046a('0x8')]('/',auth['isAuthenticated'](),controller[_0x046a('0x9')]);router[_0x046a('0x8')](_0x046a('0xa'),auth[_0x046a('0xb')](),controller[_0x046a('0xc')]);router[_0x046a('0x8')](_0x046a('0xd'),auth[_0x046a('0xb')](),controller['getFields']);router[_0x046a('0x8')]('/:id/subjects',auth[_0x046a('0xb')](),controller[_0x046a('0xe')]);router[_0x046a('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x046a('0xf')]);router[_0x046a('0x10')]('/',auth['isAuthenticated'](),controller[_0x046a('0x11')]);router[_0x046a('0x12')](_0x046a('0xa'),auth[_0x046a('0xb')](),controller[_0x046a('0x13')]);router['delete']('/:id',auth[_0x046a('0xb')](),controller['destroy']);module[_0x046a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index b1f0d6c..a30082d 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 _0x1377=['contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0x1377,0x15d));var _0x7137=function(_0x159251,_0x6b6873){_0x159251=_0x159251-0x0;var _0x4ee30c=_0x1377[_0x159251];return _0x4ee30c;};'use strict';var Sequelize=require(_0x7137('0x0'));module[_0x7137('0x1')]={'name':{'type':Sequelize[_0x7137('0x2')]},'moduleCreate':{'type':Sequelize[_0x7137('0x3')](_0x7137('0x4'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x7137('0x3')](_0x7137('0x5'),'contact','lead'),'defaultValue':_0x7137('0x5')},'description':{'type':Sequelize[_0x7137('0x2')]}}; \ No newline at end of file +var _0x4e20=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0x4e20,0x121));var _0x04e2=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x4e20[_0x5b5cde];return _0x364ad2;};'use strict';var Sequelize=require(_0x04e2('0x0'));module[_0x04e2('0x1')]={'name':{'type':Sequelize[_0x04e2('0x2')]},'moduleCreate':{'type':Sequelize[_0x04e2('0x3')](_0x04e2('0x4'),_0x04e2('0x5'),_0x04e2('0x6')),'defaultValue':_0x04e2('0x4')},'moduleSearch':{'type':Sequelize[_0x04e2('0x3')]('contact_lead','contact',_0x04e2('0x4')),'defaultValue':_0x04e2('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index a83364c..dee48a0 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 _0xebe3=['mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','map','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xebe3,0xe4));var _0x3ebe=function(_0x2b9a3a,_0x5c67f9){_0x2b9a3a=_0x2b9a3a-0x0;var _0x572644=_0xebe3[_0x2b9a3a];return _0x572644;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ebe('0x0'));var zipdir=require(_0x3ebe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3ebe('0x2'));var Mustache=require(_0x3ebe('0x3'));var util=require(_0x3ebe('0x4'));var path=require(_0x3ebe('0x5'));var sox=require(_0x3ebe('0x6'));var csv=require('to-csv');var ejs=require(_0x3ebe('0x7'));var fs=require('fs');var fs_extra=require(_0x3ebe('0x8'));var _=require(_0x3ebe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ebe('0xa'));var deskjs=require(_0x3ebe('0xb'));var toCsv=require(_0x3ebe('0xc'));var querystring=require(_0x3ebe('0xd'));var Papa=require('papaparse');var Redis=require(_0x3ebe('0xe'));var authService=require(_0x3ebe('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3ebe('0x10'));var hardwareService=require(_0x3ebe('0x11'));var logger=require('../../config/logger')(_0x3ebe('0x12'));var utils=require(_0x3ebe('0x13'));var config=require(_0x3ebe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ebe('0x15'))['db'];function respondWithStatusCode(_0x56a096,_0x4b7221){_0x4b7221=_0x4b7221||0xcc;return function(_0x903803){if(_0x903803){return _0x56a096[_0x3ebe('0x16')](_0x4b7221);}return _0x56a096[_0x3ebe('0x17')](_0x4b7221)[_0x3ebe('0x18')]();};}function respondWithResult(_0x10a442,_0x2ea8b0){_0x2ea8b0=_0x2ea8b0||0xc8;return function(_0x2da43f){if(_0x2da43f){return _0x10a442['status'](_0x2ea8b0)[_0x3ebe('0x19')](_0x2da43f);}};}function respondWithFilteredResult(_0x3792a0,_0x44548c){return function(_0x476223){if(_0x476223){var _0x3e5193=typeof _0x44548c['offset']==='undefined'&&typeof _0x44548c['limit']===_0x3ebe('0x1a');var _0x3b6292=_0x476223[_0x3ebe('0x1b')];var _0x1b1668=_0x3e5193?0x0:_0x44548c[_0x3ebe('0x1c')];var _0x27e85b=_0x3e5193?_0x476223[_0x3ebe('0x1b')]:_0x44548c['offset']+_0x44548c[_0x3ebe('0x1d')];var _0x4225fd;if(_0x27e85b>=_0x3b6292){_0x27e85b=_0x3b6292;_0x4225fd=0xc8;}else{_0x4225fd=0xce;}_0x3792a0['status'](_0x4225fd);return _0x3792a0[_0x3ebe('0x1e')](_0x3ebe('0x1f'),_0x1b1668+'-'+_0x27e85b+'/'+_0x3b6292)[_0x3ebe('0x19')](_0x476223);}return null;};}function patchUpdates(_0x4de837){return function(_0x23c6e7){try{jsonpatch[_0x3ebe('0x20')](_0x23c6e7,_0x4de837,!![]);}catch(_0x482c09){return BPromise['reject'](_0x482c09);}return _0x23c6e7['save']();};}function saveUpdates(_0x4701b2,_0x38e4bc){return function(_0x1667f8){if(_0x1667f8){return _0x1667f8[_0x3ebe('0x21')](_0x4701b2)[_0x3ebe('0x22')](function(_0x19e8cc){return _0x19e8cc;});}return null;};}function removeEntity(_0x5172c2,_0x47489d){return function(_0x65e50d){if(_0x65e50d){return _0x65e50d[_0x3ebe('0x23')]()[_0x3ebe('0x22')](function(){_0x5172c2['status'](0xcc)[_0x3ebe('0x18')]();});}};}function handleEntityNotFound(_0x2456fe,_0x3ed513){return function(_0x249ed9){if(!_0x249ed9){_0x2456fe[_0x3ebe('0x16')](0x194);}return _0x249ed9;};}function handleError(_0x136d75,_0xe4a934){_0xe4a934=_0xe4a934||0x1f4;return function(_0x43c3bc){logger[_0x3ebe('0x24')](_0x43c3bc[_0x3ebe('0x25')]);if(_0x43c3bc['name']){delete _0x43c3bc['name'];}_0x136d75[_0x3ebe('0x17')](_0xe4a934)['send'](_0x43c3bc);};}exports['index']=function(_0x4090f2,_0x4da024){var _0x42a00d={},_0x3dad29={},_0x454769={'count':0x0,'rows':[]};var _0x3e0fcf=_[_0x3ebe('0x26')](db['ZohoConfiguration'][_0x3ebe('0x27')],function(_0x4e3ae8){return{'name':_0x4e3ae8[_0x3ebe('0x28')],'type':_0x4e3ae8[_0x3ebe('0x29')][_0x3ebe('0x2a')]};});_0x3dad29[_0x3ebe('0x2b')]=_[_0x3ebe('0x26')](_0x3e0fcf,_0x3ebe('0x2c'));_0x3dad29['query']=_[_0x3ebe('0x2d')](_0x4090f2[_0x3ebe('0x2e')]);_0x3dad29['filters']=_[_0x3ebe('0x2f')](_0x3dad29['model'],_0x3dad29['query']);_0x42a00d[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x3dad29['model'],qs[_0x3ebe('0x31')](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x31')]));_0x42a00d[_0x3ebe('0x30')]=_0x42a00d[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x42a00d[_0x3ebe('0x30')]:_0x3dad29[_0x3ebe('0x2b')];if(!_0x4090f2[_0x3ebe('0x2e')]['hasOwnProperty'](_0x3ebe('0x33'))){_0x42a00d[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0x42a00d['offset']=qs['offset'](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x1c')]);}_0x42a00d[_0x3ebe('0x34')]=qs[_0x3ebe('0x35')](_0x4090f2['query'][_0x3ebe('0x35')]);_0x42a00d[_0x3ebe('0x36')]=qs[_0x3ebe('0x37')](_[_0x3ebe('0x38')](_0x4090f2[_0x3ebe('0x2e')],_0x3dad29[_0x3ebe('0x37')]),_0x3e0fcf);if(_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0x42a00d[_0x3ebe('0x36')]=_[_0x3ebe('0x3a')](_0x42a00d[_0x3ebe('0x36')],{'$or':_[_0x3ebe('0x26')](_0x3e0fcf,function(_0x10958e){if(_0x10958e['type']!==_0x3ebe('0x3b')){var _0xb9cc99={};_0xb9cc99[_0x10958e[_0x3ebe('0x2c')]]={'$like':'%'+_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0xb9cc99;}})});}_0x42a00d=_[_0x3ebe('0x3a')]({},_0x42a00d,_0x4090f2[_0x3ebe('0x3c')]);var _0x46d1b2={'where':_0x42a00d[_0x3ebe('0x36')]};return db[_0x3ebe('0x3d')][_0x3ebe('0x1b')](_0x46d1b2)[_0x3ebe('0x22')](function(_0x1a2b97){_0x454769[_0x3ebe('0x1b')]=_0x1a2b97;if(_0x4090f2['query'][_0x3ebe('0x3e')]){_0x42a00d[_0x3ebe('0x3f')]=[{'all':!![]}];}return db[_0x3ebe('0x3d')][_0x3ebe('0x40')](_0x42a00d);})[_0x3ebe('0x22')](function(_0x5c7ed4){_0x454769['rows']=_0x5c7ed4;return _0x454769;})['then'](respondWithFilteredResult(_0x4da024,_0x42a00d))[_0x3ebe('0x41')](handleError(_0x4da024,null));};exports[_0x3ebe('0x42')]=function(_0x1df7ae,_0x3be58d){var _0x4ae92b={'raw':![],'where':{'id':_0x1df7ae[_0x3ebe('0x43')]['id']}},_0x43d011={};_0x43d011[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db[_0x3ebe('0x3d')][_0x3ebe('0x27')]);_0x43d011[_0x3ebe('0x2e')]=_['keys'](_0x1df7ae[_0x3ebe('0x2e')]);_0x43d011[_0x3ebe('0x37')]=_['intersection'](_0x43d011['model'],_0x43d011[_0x3ebe('0x2e')]);_0x4ae92b[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x43d011[_0x3ebe('0x2b')],qs[_0x3ebe('0x31')](_0x1df7ae[_0x3ebe('0x2e')]['fields']));_0x4ae92b[_0x3ebe('0x30')]=_0x4ae92b[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x4ae92b['attributes']:_0x43d011[_0x3ebe('0x2b')];if(_0x1df7ae[_0x3ebe('0x2e')][_0x3ebe('0x3e')]){_0x4ae92b[_0x3ebe('0x3f')]=[{'all':!![]}];}_0x4ae92b=_[_0x3ebe('0x3a')]({},_0x4ae92b,_0x1df7ae[_0x3ebe('0x3c')]);return db[_0x3ebe('0x3d')][_0x3ebe('0x44')](_0x4ae92b)[_0x3ebe('0x22')](handleEntityNotFound(_0x3be58d,null))[_0x3ebe('0x22')](respondWithResult(_0x3be58d,null))['catch'](handleError(_0x3be58d,null));};exports[_0x3ebe('0x45')]=function(_0x21f8d9,_0xbe78e2){return db['ZohoConfiguration'][_0x3ebe('0x45')](_0x21f8d9[_0x3ebe('0x46')],{})[_0x3ebe('0x22')](respondWithResult(_0xbe78e2,0xc9))[_0x3ebe('0x41')](handleError(_0xbe78e2,null));};exports[_0x3ebe('0x21')]=function(_0x2599fe,_0x5e4978){if(_0x2599fe[_0x3ebe('0x46')]['id']){delete _0x2599fe[_0x3ebe('0x46')]['id'];}return db[_0x3ebe('0x3d')][_0x3ebe('0x44')]({'where':{'id':_0x2599fe[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x5e4978,null))[_0x3ebe('0x22')](saveUpdates(_0x2599fe[_0x3ebe('0x46')],null))[_0x3ebe('0x22')](respondWithResult(_0x5e4978,null))[_0x3ebe('0x41')](handleError(_0x5e4978,null));};exports['destroy']=function(_0xbd0117,_0x1ac982){return db['ZohoConfiguration'][_0x3ebe('0x44')]({'where':{'id':_0xbd0117['params']['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x1ac982,null))[_0x3ebe('0x22')](removeEntity(_0x1ac982,null))['catch'](handleError(_0x1ac982,null));};exports[_0x3ebe('0x47')]=function(_0xea141e,_0x235a93,_0x230d80){var _0xf3485={};var _0x94e5d5={};var _0x7a8c70;var _0x29c92a;return db[_0x3ebe('0x3d')][_0x3ebe('0x48')]({'where':{'id':_0xea141e[_0x3ebe('0x43')]['id']}})['then'](handleEntityNotFound(_0x235a93,null))[_0x3ebe('0x22')](function(_0x2118f2){if(_0x2118f2){_0x7a8c70=_0x2118f2;_0x94e5d5[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db[_0x3ebe('0x49')]['rawAttributes']);_0x94e5d5['query']=_[_0x3ebe('0x2d')](_0xea141e[_0x3ebe('0x2e')]);_0x94e5d5[_0x3ebe('0x37')]=_['intersection'](_0x94e5d5[_0x3ebe('0x2b')],_0x94e5d5[_0x3ebe('0x2e')]);_0xf3485[_0x3ebe('0x30')]=_['intersection'](_0x94e5d5[_0x3ebe('0x2b')],qs['fields'](_0xea141e[_0x3ebe('0x2e')]['fields']));_0xf3485[_0x3ebe('0x30')]=_0xf3485[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0xf3485[_0x3ebe('0x30')]:_0x94e5d5[_0x3ebe('0x2b')];_0xf3485[_0x3ebe('0x34')]=qs['sort'](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x35')]);_0xf3485[_0x3ebe('0x36')]=qs['filters'](_[_0x3ebe('0x38')](_0xea141e[_0x3ebe('0x2e')],_0x94e5d5[_0x3ebe('0x37')]));if(_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0xf3485['where']=_['merge'](_0xf3485['where'],{'$or':_[_0x3ebe('0x26')](_0xf3485[_0x3ebe('0x30')],function(_0x10cb57){var _0x2e728a={};_0x2e728a[_0x10cb57]={'$like':'%'+_0xea141e['query'][_0x3ebe('0x39')]+'%'};return _0x2e728a;})});}_0xf3485=_[_0x3ebe('0x3a')]({},_0xf3485,_0xea141e['options']);return _0x7a8c70[_0x3ebe('0x47')](_0xf3485);}})['then'](function(_0x48bd0a){if(_0x48bd0a){_0x29c92a=_0x48bd0a[_0x3ebe('0x32')];if(!_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x4a')](_0x3ebe('0x33'))){_0xf3485[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0xf3485[_0x3ebe('0x1c')]=qs['offset'](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x1c')]);}return _0x7a8c70[_0x3ebe('0x47')](_0xf3485);}})[_0x3ebe('0x22')](function(_0x5e452a){if(_0x5e452a){return _0x5e452a?{'count':_0x29c92a,'rows':_0x5e452a}:null;}})[_0x3ebe('0x22')](respondWithResult(_0x235a93,null))[_0x3ebe('0x41')](handleError(_0x235a93,null));};exports[_0x3ebe('0x4b')]=function(_0x252a33,_0xfb965d,_0x1de665){var _0x4aa154={};var _0x10a021={};var _0x11491b;var _0x3ab86d;return db[_0x3ebe('0x3d')]['findOne']({'where':{'id':_0x252a33[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0xfb965d,null))['then'](function(_0x1b7210){if(_0x1b7210){_0x11491b=_0x1b7210;_0x10a021[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db['ZohoField'][_0x3ebe('0x27')]);_0x10a021['query']=_['keys'](_0x252a33['query']);_0x10a021[_0x3ebe('0x37')]=_[_0x3ebe('0x2f')](_0x10a021[_0x3ebe('0x2b')],_0x10a021[_0x3ebe('0x2e')]);_0x4aa154[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x10a021[_0x3ebe('0x2b')],qs[_0x3ebe('0x31')](_0x252a33[_0x3ebe('0x2e')]['fields']));_0x4aa154[_0x3ebe('0x30')]=_0x4aa154['attributes'][_0x3ebe('0x32')]?_0x4aa154[_0x3ebe('0x30')]:_0x10a021[_0x3ebe('0x2b')];_0x4aa154[_0x3ebe('0x34')]=qs[_0x3ebe('0x35')](_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x35')]);_0x4aa154[_0x3ebe('0x36')]=qs[_0x3ebe('0x37')](_[_0x3ebe('0x38')](_0x252a33[_0x3ebe('0x2e')],_0x10a021[_0x3ebe('0x37')]));if(_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0x4aa154['where']=_['merge'](_0x4aa154['where'],{'$or':_['map'](_0x4aa154[_0x3ebe('0x30')],function(_0x13f85c){var _0x547538={};_0x547538[_0x13f85c]={'$like':'%'+_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0x547538;})});}_0x4aa154=_[_0x3ebe('0x3a')]({},_0x4aa154,_0x252a33['options']);return _0x11491b['getSubjects'](_0x4aa154);}})[_0x3ebe('0x22')](function(_0x32a461){if(_0x32a461){_0x3ab86d=_0x32a461[_0x3ebe('0x32')];if(!_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x4a')](_0x3ebe('0x33'))){_0x4aa154[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0x4aa154[_0x3ebe('0x1c')]=qs[_0x3ebe('0x1c')](_0x252a33[_0x3ebe('0x2e')]['offset']);}return _0x11491b[_0x3ebe('0x4b')](_0x4aa154);}})[_0x3ebe('0x22')](function(_0x10c94f){if(_0x10c94f){return _0x10c94f?{'count':_0x3ab86d,'rows':_0x10c94f}:null;}})[_0x3ebe('0x22')](respondWithResult(_0xfb965d,null))[_0x3ebe('0x41')](handleError(_0xfb965d,null));};exports[_0x3ebe('0x4c')]=function(_0xa59fa,_0x23970b,_0x5607e7){var _0x21ba28={};var _0x41c3d5={};var _0x297c70;var _0xffd702;return db[_0x3ebe('0x3d')]['findOne']({'where':{'id':_0xa59fa[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x23970b,null))[_0x3ebe('0x22')](function(_0x40fc09){if(_0x40fc09){_0x297c70=_0x40fc09;_0x41c3d5[_0x3ebe('0x2b')]=_['keys'](db[_0x3ebe('0x49')][_0x3ebe('0x27')]);_0x41c3d5[_0x3ebe('0x2e')]=_[_0x3ebe('0x2d')](_0xa59fa[_0x3ebe('0x2e')]);_0x41c3d5[_0x3ebe('0x37')]=_[_0x3ebe('0x2f')](_0x41c3d5[_0x3ebe('0x2b')],_0x41c3d5[_0x3ebe('0x2e')]);_0x21ba28[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x41c3d5['model'],qs[_0x3ebe('0x31')](_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x31')]));_0x21ba28[_0x3ebe('0x30')]=_0x21ba28[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x21ba28[_0x3ebe('0x30')]:_0x41c3d5[_0x3ebe('0x2b')];_0x21ba28[_0x3ebe('0x34')]=qs['sort'](_0xa59fa['query']['sort']);_0x21ba28[_0x3ebe('0x36')]=qs['filters'](_[_0x3ebe('0x38')](_0xa59fa[_0x3ebe('0x2e')],_0x41c3d5[_0x3ebe('0x37')]));if(_0xa59fa[_0x3ebe('0x2e')]['filter']){_0x21ba28[_0x3ebe('0x36')]=_[_0x3ebe('0x3a')](_0x21ba28[_0x3ebe('0x36')],{'$or':_['map'](_0x21ba28[_0x3ebe('0x30')],function(_0x524793){var _0x24752b={};_0x24752b[_0x524793]={'$like':'%'+_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0x24752b;})});}_0x21ba28=_[_0x3ebe('0x3a')]({},_0x21ba28,_0xa59fa[_0x3ebe('0x3c')]);return _0x297c70[_0x3ebe('0x4c')](_0x21ba28);}})['then'](function(_0x4085b3){if(_0x4085b3){_0xffd702=_0x4085b3[_0x3ebe('0x32')];if(!_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x4a')]('nolimit')){_0x21ba28[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0xa59fa['query'][_0x3ebe('0x1d')]);_0x21ba28['offset']=qs[_0x3ebe('0x1c')](_0xa59fa[_0x3ebe('0x2e')]['offset']);}return _0x297c70[_0x3ebe('0x4c')](_0x21ba28);}})['then'](function(_0x2299c8){if(_0x2299c8){return _0x2299c8?{'count':_0xffd702,'rows':_0x2299c8}:null;}})['then'](respondWithResult(_0x23970b,null))[_0x3ebe('0x41')](handleError(_0x23970b,null));}; \ No newline at end of file +var _0xf797=['length','order','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','getFields','ZohoField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf797,0x13a));var _0x7f79=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf797[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x7f79('0x0'));var rimraf=require(_0x7f79('0x1'));var zipdir=require(_0x7f79('0x2'));var jsonpatch=require(_0x7f79('0x3'));var rp=require(_0x7f79('0x4'));var moment=require(_0x7f79('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f79('0x6'));var sox=require('sox');var csv=require(_0x7f79('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f79('0x8'));var _=require(_0x7f79('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7f79('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7f79('0x7'));var querystring=require('querystring');var Papa=require(_0x7f79('0xb'));var Redis=require('ioredis');var authService=require(_0x7f79('0xc'));var qs=require(_0x7f79('0xd'));var as=require(_0x7f79('0xe'));var hardwareService=require(_0x7f79('0xf'));var logger=require(_0x7f79('0x10'))(_0x7f79('0x11'));var utils=require(_0x7f79('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7f79('0x13'));var db=require(_0x7f79('0x14'))['db'];function respondWithStatusCode(_0x3d9398,_0x446229){_0x446229=_0x446229||0xcc;return function(_0x522c47){if(_0x522c47){return _0x3d9398[_0x7f79('0x15')](_0x446229);}return _0x3d9398['status'](_0x446229)[_0x7f79('0x16')]();};}function respondWithResult(_0xcb37d0,_0x11c461){_0x11c461=_0x11c461||0xc8;return function(_0x43ca1c){if(_0x43ca1c){return _0xcb37d0['status'](_0x11c461)[_0x7f79('0x17')](_0x43ca1c);}};}function respondWithFilteredResult(_0x51d1b9,_0x5744b8){return function(_0x2250c2){if(_0x2250c2){var _0x61909=typeof _0x5744b8['offset']===_0x7f79('0x18')&&typeof _0x5744b8[_0x7f79('0x19')]===_0x7f79('0x18');var _0x4185a6=_0x2250c2[_0x7f79('0x1a')];var _0x10b572=_0x61909?0x0:_0x5744b8['offset'];var _0x549fd3=_0x61909?_0x2250c2['count']:_0x5744b8[_0x7f79('0x1b')]+_0x5744b8[_0x7f79('0x19')];var _0x2321ea;if(_0x549fd3>=_0x4185a6){_0x549fd3=_0x4185a6;_0x2321ea=0xc8;}else{_0x2321ea=0xce;}_0x51d1b9[_0x7f79('0x1c')](_0x2321ea);return _0x51d1b9[_0x7f79('0x1d')](_0x7f79('0x1e'),_0x10b572+'-'+_0x549fd3+'/'+_0x4185a6)[_0x7f79('0x17')](_0x2250c2);}return null;};}function patchUpdates(_0x55ad15){return function(_0x5bdeae){try{jsonpatch[_0x7f79('0x1f')](_0x5bdeae,_0x55ad15,!![]);}catch(_0x406b2a){return BPromise[_0x7f79('0x20')](_0x406b2a);}return _0x5bdeae[_0x7f79('0x21')]();};}function saveUpdates(_0x10c197,_0x6c3093){return function(_0x27bba3){if(_0x27bba3){return _0x27bba3['update'](_0x10c197)[_0x7f79('0x22')](function(_0x33a313){return _0x33a313;});}return null;};}function removeEntity(_0x528cee,_0x163d68){return function(_0x155518){if(_0x155518){return _0x155518[_0x7f79('0x23')]()[_0x7f79('0x22')](function(){_0x528cee[_0x7f79('0x1c')](0xcc)[_0x7f79('0x16')]();});}};}function handleEntityNotFound(_0x35a7a9,_0x5a263){return function(_0x2e63ef){if(!_0x2e63ef){_0x35a7a9[_0x7f79('0x15')](0x194);}return _0x2e63ef;};}function handleError(_0x6f52a4,_0x34bb0c){_0x34bb0c=_0x34bb0c||0x1f4;return function(_0x520ff6){logger['error'](_0x520ff6[_0x7f79('0x24')]);if(_0x520ff6[_0x7f79('0x25')]){delete _0x520ff6[_0x7f79('0x25')];}_0x6f52a4[_0x7f79('0x1c')](_0x34bb0c)[_0x7f79('0x26')](_0x520ff6);};}exports[_0x7f79('0x27')]=function(_0x1615e9,_0x221eb0){var _0x11ac00={},_0x4de365={},_0x433f5c={'count':0x0,'rows':[]};var _0x3414d4=_[_0x7f79('0x28')](db[_0x7f79('0x29')][_0x7f79('0x2a')],function(_0x13fe16){return{'name':_0x13fe16[_0x7f79('0x2b')],'type':_0x13fe16[_0x7f79('0x2c')]['key']};});_0x4de365[_0x7f79('0x2d')]=_[_0x7f79('0x28')](_0x3414d4,_0x7f79('0x25'));_0x4de365['query']=_[_0x7f79('0x2e')](_0x1615e9['query']);_0x4de365['filters']=_[_0x7f79('0x2f')](_0x4de365['model'],_0x4de365[_0x7f79('0x30')]);_0x11ac00[_0x7f79('0x31')]=_[_0x7f79('0x2f')](_0x4de365[_0x7f79('0x2d')],qs[_0x7f79('0x32')](_0x1615e9[_0x7f79('0x30')]['fields']));_0x11ac00['attributes']=_0x11ac00[_0x7f79('0x31')]['length']?_0x11ac00[_0x7f79('0x31')]:_0x4de365['model'];if(!_0x1615e9[_0x7f79('0x30')]['hasOwnProperty'](_0x7f79('0x33'))){_0x11ac00[_0x7f79('0x19')]=qs[_0x7f79('0x19')](_0x1615e9['query']['limit']);_0x11ac00['offset']=qs['offset'](_0x1615e9['query'][_0x7f79('0x1b')]);}_0x11ac00['order']=qs['sort'](_0x1615e9[_0x7f79('0x30')][_0x7f79('0x34')]);_0x11ac00[_0x7f79('0x35')]=qs[_0x7f79('0x36')](_[_0x7f79('0x37')](_0x1615e9[_0x7f79('0x30')],_0x4de365[_0x7f79('0x36')]),_0x3414d4);if(_0x1615e9[_0x7f79('0x30')][_0x7f79('0x38')]){_0x11ac00[_0x7f79('0x35')]=_[_0x7f79('0x39')](_0x11ac00[_0x7f79('0x35')],{'$or':_['map'](_0x3414d4,function(_0x58faa1){if(_0x58faa1[_0x7f79('0x2c')]!==_0x7f79('0x3a')){var _0x495170={};_0x495170[_0x58faa1[_0x7f79('0x25')]]={'$like':'%'+_0x1615e9['query'][_0x7f79('0x38')]+'%'};return _0x495170;}})});}_0x11ac00=_[_0x7f79('0x39')]({},_0x11ac00,_0x1615e9[_0x7f79('0x3b')]);var _0x5b270d={'where':_0x11ac00[_0x7f79('0x35')]};return db['ZohoConfiguration'][_0x7f79('0x1a')](_0x5b270d)['then'](function(_0x3c740d){_0x433f5c['count']=_0x3c740d;if(_0x1615e9[_0x7f79('0x30')][_0x7f79('0x3c')]){_0x11ac00[_0x7f79('0x3d')]=[{'all':!![]}];}return db[_0x7f79('0x29')][_0x7f79('0x3e')](_0x11ac00);})['then'](function(_0x1ee397){_0x433f5c[_0x7f79('0x3f')]=_0x1ee397;return _0x433f5c;})[_0x7f79('0x22')](respondWithFilteredResult(_0x221eb0,_0x11ac00))[_0x7f79('0x40')](handleError(_0x221eb0,null));};exports['show']=function(_0x4bc282,_0x32e243){var _0x3e84a8={'raw':![],'where':{'id':_0x4bc282[_0x7f79('0x41')]['id']}},_0x5a35c0={};_0x5a35c0['model']=_[_0x7f79('0x2e')](db[_0x7f79('0x29')][_0x7f79('0x2a')]);_0x5a35c0['query']=_[_0x7f79('0x2e')](_0x4bc282['query']);_0x5a35c0[_0x7f79('0x36')]=_[_0x7f79('0x2f')](_0x5a35c0[_0x7f79('0x2d')],_0x5a35c0[_0x7f79('0x30')]);_0x3e84a8[_0x7f79('0x31')]=_['intersection'](_0x5a35c0[_0x7f79('0x2d')],qs[_0x7f79('0x32')](_0x4bc282['query'][_0x7f79('0x32')]));_0x3e84a8[_0x7f79('0x31')]=_0x3e84a8[_0x7f79('0x31')]['length']?_0x3e84a8['attributes']:_0x5a35c0[_0x7f79('0x2d')];if(_0x4bc282[_0x7f79('0x30')][_0x7f79('0x3c')]){_0x3e84a8[_0x7f79('0x3d')]=[{'all':!![]}];}_0x3e84a8=_[_0x7f79('0x39')]({},_0x3e84a8,_0x4bc282[_0x7f79('0x3b')]);return db['ZohoConfiguration']['find'](_0x3e84a8)['then'](handleEntityNotFound(_0x32e243,null))[_0x7f79('0x22')](respondWithResult(_0x32e243,null))[_0x7f79('0x40')](handleError(_0x32e243,null));};exports['create']=function(_0x404380,_0x1e8e02){return db[_0x7f79('0x29')][_0x7f79('0x42')](_0x404380[_0x7f79('0x43')],{})[_0x7f79('0x22')](respondWithResult(_0x1e8e02,0xc9))[_0x7f79('0x40')](handleError(_0x1e8e02,null));};exports['update']=function(_0x20dfa1,_0x55a338){if(_0x20dfa1['body']['id']){delete _0x20dfa1[_0x7f79('0x43')]['id'];}return db[_0x7f79('0x29')][_0x7f79('0x44')]({'where':{'id':_0x20dfa1[_0x7f79('0x41')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x55a338,null))['then'](saveUpdates(_0x20dfa1[_0x7f79('0x43')],null))[_0x7f79('0x22')](respondWithResult(_0x55a338,null))['catch'](handleError(_0x55a338,null));};exports[_0x7f79('0x23')]=function(_0x29b776,_0x3ce478){return db[_0x7f79('0x29')][_0x7f79('0x44')]({'where':{'id':_0x29b776[_0x7f79('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ce478,null))[_0x7f79('0x22')](removeEntity(_0x3ce478,null))[_0x7f79('0x40')](handleError(_0x3ce478,null));};exports[_0x7f79('0x45')]=function(_0x55c3fa,_0x59f067,_0x10426e){var _0x4f9ff9={};var _0x3e8a93={};var _0x5167a1;var _0x2193ea;return db[_0x7f79('0x29')]['findOne']({'where':{'id':_0x55c3fa[_0x7f79('0x41')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x59f067,null))[_0x7f79('0x22')](function(_0x14a8b6){if(_0x14a8b6){_0x5167a1=_0x14a8b6;_0x3e8a93[_0x7f79('0x2d')]=_[_0x7f79('0x2e')](db[_0x7f79('0x46')][_0x7f79('0x2a')]);_0x3e8a93[_0x7f79('0x30')]=_[_0x7f79('0x2e')](_0x55c3fa[_0x7f79('0x30')]);_0x3e8a93[_0x7f79('0x36')]=_[_0x7f79('0x2f')](_0x3e8a93['model'],_0x3e8a93[_0x7f79('0x30')]);_0x4f9ff9['attributes']=_['intersection'](_0x3e8a93[_0x7f79('0x2d')],qs[_0x7f79('0x32')](_0x55c3fa[_0x7f79('0x30')][_0x7f79('0x32')]));_0x4f9ff9[_0x7f79('0x31')]=_0x4f9ff9[_0x7f79('0x31')][_0x7f79('0x47')]?_0x4f9ff9[_0x7f79('0x31')]:_0x3e8a93['model'];_0x4f9ff9[_0x7f79('0x48')]=qs[_0x7f79('0x34')](_0x55c3fa[_0x7f79('0x30')][_0x7f79('0x34')]);_0x4f9ff9[_0x7f79('0x35')]=qs[_0x7f79('0x36')](_[_0x7f79('0x37')](_0x55c3fa[_0x7f79('0x30')],_0x3e8a93[_0x7f79('0x36')]));if(_0x55c3fa[_0x7f79('0x30')][_0x7f79('0x38')]){_0x4f9ff9['where']=_[_0x7f79('0x39')](_0x4f9ff9[_0x7f79('0x35')],{'$or':_[_0x7f79('0x28')](_0x4f9ff9['attributes'],function(_0x2cc448){var _0xc2893c={};_0xc2893c[_0x2cc448]={'$like':'%'+_0x55c3fa[_0x7f79('0x30')][_0x7f79('0x38')]+'%'};return _0xc2893c;})});}_0x4f9ff9=_[_0x7f79('0x39')]({},_0x4f9ff9,_0x55c3fa['options']);return _0x5167a1['getFields'](_0x4f9ff9);}})[_0x7f79('0x22')](function(_0x6c10c6){if(_0x6c10c6){_0x2193ea=_0x6c10c6[_0x7f79('0x47')];if(!_0x55c3fa['query'][_0x7f79('0x49')]('nolimit')){_0x4f9ff9[_0x7f79('0x19')]=qs[_0x7f79('0x19')](_0x55c3fa[_0x7f79('0x30')][_0x7f79('0x19')]);_0x4f9ff9[_0x7f79('0x1b')]=qs[_0x7f79('0x1b')](_0x55c3fa['query'][_0x7f79('0x1b')]);}return _0x5167a1[_0x7f79('0x45')](_0x4f9ff9);}})[_0x7f79('0x22')](function(_0x413bb3){if(_0x413bb3){return _0x413bb3?{'count':_0x2193ea,'rows':_0x413bb3}:null;}})[_0x7f79('0x22')](respondWithResult(_0x59f067,null))['catch'](handleError(_0x59f067,null));};exports[_0x7f79('0x4a')]=function(_0x3db9be,_0x18336e,_0x431968){var _0x56d43f={};var _0x42e408={};var _0x5be9ef;var _0x2e65bf;return db[_0x7f79('0x29')][_0x7f79('0x4b')]({'where':{'id':_0x3db9be[_0x7f79('0x41')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x18336e,null))[_0x7f79('0x22')](function(_0x2cf130){if(_0x2cf130){_0x5be9ef=_0x2cf130;_0x42e408[_0x7f79('0x2d')]=_['keys'](db[_0x7f79('0x46')]['rawAttributes']);_0x42e408[_0x7f79('0x30')]=_[_0x7f79('0x2e')](_0x3db9be[_0x7f79('0x30')]);_0x42e408[_0x7f79('0x36')]=_[_0x7f79('0x2f')](_0x42e408['model'],_0x42e408[_0x7f79('0x30')]);_0x56d43f[_0x7f79('0x31')]=_['intersection'](_0x42e408[_0x7f79('0x2d')],qs['fields'](_0x3db9be[_0x7f79('0x30')][_0x7f79('0x32')]));_0x56d43f['attributes']=_0x56d43f['attributes'][_0x7f79('0x47')]?_0x56d43f[_0x7f79('0x31')]:_0x42e408[_0x7f79('0x2d')];_0x56d43f[_0x7f79('0x48')]=qs[_0x7f79('0x34')](_0x3db9be[_0x7f79('0x30')]['sort']);_0x56d43f['where']=qs[_0x7f79('0x36')](_['pick'](_0x3db9be['query'],_0x42e408['filters']));if(_0x3db9be[_0x7f79('0x30')][_0x7f79('0x38')]){_0x56d43f[_0x7f79('0x35')]=_[_0x7f79('0x39')](_0x56d43f['where'],{'$or':_['map'](_0x56d43f[_0x7f79('0x31')],function(_0x3119a3){var _0x29a551={};_0x29a551[_0x3119a3]={'$like':'%'+_0x3db9be[_0x7f79('0x30')][_0x7f79('0x38')]+'%'};return _0x29a551;})});}_0x56d43f=_[_0x7f79('0x39')]({},_0x56d43f,_0x3db9be['options']);return _0x5be9ef['getSubjects'](_0x56d43f);}})[_0x7f79('0x22')](function(_0x519873){if(_0x519873){_0x2e65bf=_0x519873['length'];if(!_0x3db9be[_0x7f79('0x30')][_0x7f79('0x49')](_0x7f79('0x33'))){_0x56d43f[_0x7f79('0x19')]=qs[_0x7f79('0x19')](_0x3db9be['query']['limit']);_0x56d43f['offset']=qs[_0x7f79('0x1b')](_0x3db9be[_0x7f79('0x30')][_0x7f79('0x1b')]);}return _0x5be9ef[_0x7f79('0x4a')](_0x56d43f);}})['then'](function(_0x2b5e3a){if(_0x2b5e3a){return _0x2b5e3a?{'count':_0x2e65bf,'rows':_0x2b5e3a}:null;}})[_0x7f79('0x22')](respondWithResult(_0x18336e,null))[_0x7f79('0x40')](handleError(_0x18336e,null));};exports[_0x7f79('0x4c')]=function(_0x6528b6,_0x12ec49,_0x54b667){var _0x401a1b={};var _0x558b0a={};var _0x543d75;var _0x3e14d2;return db[_0x7f79('0x29')][_0x7f79('0x4b')]({'where':{'id':_0x6528b6[_0x7f79('0x41')]['id']}})[_0x7f79('0x22')](handleEntityNotFound(_0x12ec49,null))[_0x7f79('0x22')](function(_0x3aa1a9){if(_0x3aa1a9){_0x543d75=_0x3aa1a9;_0x558b0a[_0x7f79('0x2d')]=_[_0x7f79('0x2e')](db['ZohoField'][_0x7f79('0x2a')]);_0x558b0a[_0x7f79('0x30')]=_[_0x7f79('0x2e')](_0x6528b6[_0x7f79('0x30')]);_0x558b0a[_0x7f79('0x36')]=_[_0x7f79('0x2f')](_0x558b0a[_0x7f79('0x2d')],_0x558b0a[_0x7f79('0x30')]);_0x401a1b[_0x7f79('0x31')]=_[_0x7f79('0x2f')](_0x558b0a[_0x7f79('0x2d')],qs[_0x7f79('0x32')](_0x6528b6['query']['fields']));_0x401a1b[_0x7f79('0x31')]=_0x401a1b[_0x7f79('0x31')][_0x7f79('0x47')]?_0x401a1b[_0x7f79('0x31')]:_0x558b0a['model'];_0x401a1b['order']=qs[_0x7f79('0x34')](_0x6528b6[_0x7f79('0x30')][_0x7f79('0x34')]);_0x401a1b[_0x7f79('0x35')]=qs[_0x7f79('0x36')](_[_0x7f79('0x37')](_0x6528b6[_0x7f79('0x30')],_0x558b0a[_0x7f79('0x36')]));if(_0x6528b6['query'][_0x7f79('0x38')]){_0x401a1b[_0x7f79('0x35')]=_[_0x7f79('0x39')](_0x401a1b[_0x7f79('0x35')],{'$or':_[_0x7f79('0x28')](_0x401a1b[_0x7f79('0x31')],function(_0x1fd6c9){var _0x5c66e2={};_0x5c66e2[_0x1fd6c9]={'$like':'%'+_0x6528b6[_0x7f79('0x30')]['filter']+'%'};return _0x5c66e2;})});}_0x401a1b=_[_0x7f79('0x39')]({},_0x401a1b,_0x6528b6[_0x7f79('0x3b')]);return _0x543d75[_0x7f79('0x4c')](_0x401a1b);}})[_0x7f79('0x22')](function(_0x363f56){if(_0x363f56){_0x3e14d2=_0x363f56[_0x7f79('0x47')];if(!_0x6528b6['query']['hasOwnProperty'](_0x7f79('0x33'))){_0x401a1b['limit']=qs[_0x7f79('0x19')](_0x6528b6[_0x7f79('0x30')][_0x7f79('0x19')]);_0x401a1b[_0x7f79('0x1b')]=qs[_0x7f79('0x1b')](_0x6528b6[_0x7f79('0x30')][_0x7f79('0x1b')]);}return _0x543d75[_0x7f79('0x4c')](_0x401a1b);}})[_0x7f79('0x22')](function(_0x256879){if(_0x256879){return _0x256879?{'count':_0x3e14d2,'rows':_0x256879}:null;}})[_0x7f79('0x22')](respondWithResult(_0x12ec49,null))[_0x7f79('0x40')](handleError(_0x12ec49,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6e22bca..404d369 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 _0xf04b=['./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xf04b,0x88));var _0xbf04=function(_0x4a5a9f,_0xb63223){_0x4a5a9f=_0x4a5a9f-0x0;var _0x1b086e=_0xf04b[_0x4a5a9f];return _0x1b086e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf04('0x0'))(_0xbf04('0x1'));var moment=require(_0xbf04('0x2'));var BPromise=require(_0xbf04('0x3'));var rp=require(_0xbf04('0x4'));var fs=require('fs');var path=require(_0xbf04('0x5'));var rimraf=require(_0xbf04('0x6'));var config=require(_0xbf04('0x7'));var attributes=require(_0xbf04('0x8'));module[_0xbf04('0x9')]=function(_0x308762,_0x1d2d53){return _0x308762['define'](_0xbf04('0xa'),attributes,{'tableName':_0xbf04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d6e=['api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0xc1d0f0,_0xbea429){var _0x4bc573=function(_0x4b0ba4){while(--_0x4b0ba4){_0xc1d0f0['push'](_0xc1d0f0['shift']());}};_0x4bc573(++_0xbea429);}(_0x2d6e,0x9a));var _0xe2d6=function(_0x30446a,_0x11198e){_0x30446a=_0x30446a-0x0;var _0x1a5a1c=_0x2d6e[_0x30446a];return _0x1a5a1c;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require('../../config/logger')(_0xe2d6('0x2'));var moment=require(_0xe2d6('0x3'));var BPromise=require(_0xe2d6('0x4'));var rp=require(_0xe2d6('0x5'));var fs=require('fs');var path=require(_0xe2d6('0x6'));var rimraf=require('rimraf');var config=require(_0xe2d6('0x7'));var attributes=require(_0xe2d6('0x8'));module[_0xe2d6('0x9')]=function(_0x43018a,_0x50add3){return _0x43018a['define'](_0xe2d6('0xa'),attributes,{'tableName':_0xe2d6('0xb'),'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 8117ed3..d40d8d9 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 _0xe3ac=['randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe3ac,0x1a0));var _0xce3a=function(_0x5f102e,_0x9fe29c){_0x5f102e=_0x5f102e-0x0;var _0x51d157=_0xe3ac[_0x5f102e];return _0x51d157;};'use strict';var _=require(_0xce3a('0x0'));var util=require(_0xce3a('0x1'));var moment=require(_0xce3a('0x2'));var BPromise=require(_0xce3a('0x3'));var rs=require(_0xce3a('0x4'));var fs=require('fs');var Redis=require(_0xce3a('0x5'));var db=require(_0xce3a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce3a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce3a('0x8')][_0xce3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bcd69,_0x3caf1a,_0x46fe59){return new BPromise(function(_0x468382,_0x26f5a2){return client[_0xce3a('0xa')](_0x2bcd69,_0x46fe59)[_0xce3a('0xb')](function(_0x374d26){logger[_0xce3a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3caf1a,'request\x20sent');logger['debug'](_0xce3a('0xd'),_0x3caf1a,_0xce3a('0xe'),JSON['stringify'](_0x374d26));if(_0x374d26[_0xce3a('0xf')]){if(_0x374d26[_0xce3a('0xf')]['code']===0x1f4){logger[_0xce3a('0xf')](_0xce3a('0x10'),_0x3caf1a,_0x374d26[_0xce3a('0xf')][_0xce3a('0x11')]);return _0x26f5a2(_0x374d26['error'][_0xce3a('0x11')]);}logger[_0xce3a('0xf')](_0xce3a('0x10'),_0x3caf1a,_0x374d26[_0xce3a('0xf')]['message']);return _0x468382(_0x374d26[_0xce3a('0xf')][_0xce3a('0x11')]);}else{logger[_0xce3a('0xc')](_0xce3a('0x10'),_0x3caf1a,'request\x20sent');_0x468382(_0x374d26[_0xce3a('0x12')][_0xce3a('0x11')]);}})[_0xce3a('0x13')](function(_0x5a8e34){logger['error'](_0xce3a('0x10'),_0x3caf1a,_0x5a8e34);_0x26f5a2(_0x5a8e34);});});} \ No newline at end of file +var _0x0a58=['error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x457055,_0x6eb39e){var _0x1b4842=function(_0x27c188){while(--_0x27c188){_0x457055['push'](_0x457055['shift']());}};_0x1b4842(++_0x6eb39e);}(_0x0a58,0x1cc));var _0x80a5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0a58[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x80a5('0x0'));var moment=require('moment');var BPromise=require(_0x80a5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80a5('0x2'));var db=require(_0x80a5('0x3'))['db'];var utils=require(_0x80a5('0x4'));var logger=require('../../config/logger')(_0x80a5('0x5'));var config=require(_0x80a5('0x6'));var jayson=require(_0x80a5('0x7'));var client=jayson[_0x80a5('0x8')][_0x80a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x281cab,_0x23d23a,_0x3bcc7d){return new BPromise(function(_0x1ed4b1,_0x235327){return client['request'](_0x281cab,_0x3bcc7d)['then'](function(_0x50ec9f){logger['info'](_0x80a5('0xa'),_0x23d23a,'request\x20sent');logger[_0x80a5('0xb')](_0x80a5('0xc'),_0x23d23a,_0x80a5('0xd'),JSON[_0x80a5('0xe')](_0x50ec9f));if(_0x50ec9f[_0x80a5('0xf')]){if(_0x50ec9f[_0x80a5('0xf')]['code']===0x1f4){logger[_0x80a5('0xf')](_0x80a5('0xa'),_0x23d23a,_0x50ec9f[_0x80a5('0xf')][_0x80a5('0x10')]);return _0x235327(_0x50ec9f[_0x80a5('0xf')][_0x80a5('0x10')]);}logger[_0x80a5('0xf')](_0x80a5('0xa'),_0x23d23a,_0x50ec9f['error'][_0x80a5('0x10')]);return _0x1ed4b1(_0x50ec9f[_0x80a5('0xf')][_0x80a5('0x10')]);}else{logger['info'](_0x80a5('0xa'),_0x23d23a,_0x80a5('0xd'));_0x1ed4b1(_0x50ec9f[_0x80a5('0x11')]['message']);}})[_0x80a5('0x12')](function(_0x33879c){logger[_0x80a5('0xf')](_0x80a5('0xa'),_0x23d23a,_0x33879c);_0x235327(_0x33879c);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 72ca88b..6902107 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 _0xf742=['isAuthenticated','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','show','create','put'];(function(_0x4d0918,_0x5c085e){var _0x59c6ac=function(_0x543396){while(--_0x543396){_0x4d0918['push'](_0x4d0918['shift']());}};_0x59c6ac(++_0x5c085e);}(_0xf742,0x1a6));var _0x2f74=function(_0xa90159,_0x56bb62){_0xa90159=_0xa90159-0x0;var _0x5bbe39=_0xf742[_0xa90159];return _0x5bbe39;};'use strict';var multer=require(_0x2f74('0x0'));var util=require(_0x2f74('0x1'));var path=require(_0x2f74('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f74('0x3'));var router=express[_0x2f74('0x4')]();var fs_extra=require(_0x2f74('0x5'));var auth=require(_0x2f74('0x6'));var interaction=require(_0x2f74('0x7'));var config=require(_0x2f74('0x8'));var controller=require(_0x2f74('0x9'));router[_0x2f74('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2f74('0xa')](_0x2f74('0xb'),auth['isAuthenticated'](),controller[_0x2f74('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f74('0xd')]);router[_0x2f74('0xe')]('/:id',auth[_0x2f74('0xf')](),controller['update']);router[_0x2f74('0x10')](_0x2f74('0xb'),auth[_0x2f74('0xf')](),controller[_0x2f74('0x11')]);module[_0x2f74('0x12')]=router; \ No newline at end of file +var _0x1f25=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','update','destroy','exports','multer','util','express','fs-extra'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x1f25,0x1c7));var _0x51f2=function(_0x188b5d,_0x266def){_0x188b5d=_0x188b5d-0x0;var _0x10e934=_0x1f25[_0x188b5d];return _0x10e934;};'use strict';var multer=require(_0x51f2('0x0'));var util=require(_0x51f2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x51f2('0x2'));var router=express['Router']();var fs_extra=require(_0x51f2('0x3'));var auth=require(_0x51f2('0x4'));var interaction=require(_0x51f2('0x5'));var config=require(_0x51f2('0x6'));var controller=require(_0x51f2('0x7'));router['get']('/',auth[_0x51f2('0x8')](),controller[_0x51f2('0x9')]);router[_0x51f2('0xa')](_0x51f2('0xb'),auth[_0x51f2('0x8')](),controller[_0x51f2('0xc')]);router[_0x51f2('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x51f2('0xb'),auth['isAuthenticated'](),controller[_0x51f2('0xe')]);router['delete']('/:id',auth[_0x51f2('0x8')](),controller[_0x51f2('0xf')]);module[_0x51f2('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 4ecc171..d23d0f9 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 _0xdbf4=['customVariable','BOOLEAN','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x507458,_0x1096bf){var _0x5f43ad=function(_0x36cfb1){while(--_0x36cfb1){_0x507458['push'](_0x507458['shift']());}};_0x5f43ad(++_0x1096bf);}(_0xdbf4,0xaa));var _0x4dbf=function(_0x487199,_0x2f010a){_0x487199=_0x487199-0x0;var _0x25a55c=_0xdbf4[_0x487199];return _0x25a55c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4dbf('0x0')](_0x4dbf('0x1'),_0x4dbf('0x2'),'customVariable',_0x4dbf('0x3'),_0x4dbf('0x4')),'defaultValue':_0x4dbf('0x1')},'content':{'type':Sequelize[_0x4dbf('0x5')]},'key':{'type':Sequelize[_0x4dbf('0x5')]},'keyType':{'type':Sequelize[_0x4dbf('0x0')](_0x4dbf('0x1'),_0x4dbf('0x2'),_0x4dbf('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4dbf('0x5')]},'customField':{'type':Sequelize[_0x4dbf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4dbf('0x5')]}}; \ No newline at end of file +var _0x8a68=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x8a68,0x1f4));var _0x88a6=function(_0xf63f3f,_0x8643f0){_0xf63f3f=_0xf63f3f-0x0;var _0x344f3b=_0x8a68[_0xf63f3f];return _0x344f3b;};'use strict';var Sequelize=require(_0x88a6('0x0'));module[_0x88a6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x88a6('0x2'),_0x88a6('0x3'),_0x88a6('0x4'),_0x88a6('0x5'),_0x88a6('0x6')),'defaultValue':_0x88a6('0x2')},'content':{'type':Sequelize[_0x88a6('0x7')]},'key':{'type':Sequelize[_0x88a6('0x7')]},'keyType':{'type':Sequelize[_0x88a6('0x8')](_0x88a6('0x2'),_0x88a6('0x3'),_0x88a6('0x4'))},'keyContent':{'type':Sequelize[_0x88a6('0x7')]},'idField':{'type':Sequelize[_0x88a6('0x7')]},'nameField':{'type':Sequelize[_0x88a6('0x7')]},'customField':{'type':Sequelize[_0x88a6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88a6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c627b82..b1f9af7 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 _0x16af=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','index','map','ZohoField','rawAttributes','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','options','includeAll','include','findAll','catch','show','intersection','merge','find','create','body','params','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x16af,0x121));var _0xf16a=function(_0x5d1d2,_0x1fee47){_0x5d1d2=_0x5d1d2-0x0;var _0x5558f3=_0x16af[_0x5d1d2];return _0x5558f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf16a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf16a('0x1'));var rp=require(_0xf16a('0x2'));var moment=require(_0xf16a('0x3'));var BPromise=require(_0xf16a('0x4'));var Mustache=require(_0xf16a('0x5'));var util=require(_0xf16a('0x6'));var path=require(_0xf16a('0x7'));var sox=require(_0xf16a('0x8'));var csv=require('to-csv');var ejs=require(_0xf16a('0x9'));var fs=require('fs');var fs_extra=require(_0xf16a('0xa'));var _=require(_0xf16a('0xb'));var squel=require(_0xf16a('0xc'));var crypto=require(_0xf16a('0xd'));var jsforce=require(_0xf16a('0xe'));var deskjs=require(_0xf16a('0xf'));var toCsv=require(_0xf16a('0x10'));var querystring=require(_0xf16a('0x11'));var Papa=require(_0xf16a('0x12'));var Redis=require(_0xf16a('0x13'));var authService=require(_0xf16a('0x14'));var qs=require(_0xf16a('0x15'));var as=require(_0xf16a('0x16'));var hardwareService=require(_0xf16a('0x17'));var logger=require(_0xf16a('0x18'))('api');var utils=require(_0xf16a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf16a('0x1a'));var db=require(_0xf16a('0x1b'))['db'];function respondWithStatusCode(_0x229278,_0x4a526d){_0x4a526d=_0x4a526d||0xcc;return function(_0x49c509){if(_0x49c509){return _0x229278[_0xf16a('0x1c')](_0x4a526d);}return _0x229278[_0xf16a('0x1d')](_0x4a526d)[_0xf16a('0x1e')]();};}function respondWithResult(_0x168301,_0x29bfd8){_0x29bfd8=_0x29bfd8||0xc8;return function(_0x2ffcfc){if(_0x2ffcfc){return _0x168301[_0xf16a('0x1d')](_0x29bfd8)[_0xf16a('0x1f')](_0x2ffcfc);}};}function respondWithFilteredResult(_0x456f22,_0x308a86){return function(_0x3df552){if(_0x3df552){var _0x2fb675=typeof _0x308a86[_0xf16a('0x20')]===_0xf16a('0x21')&&typeof _0x308a86[_0xf16a('0x22')]===_0xf16a('0x21');var _0x39bb5d=_0x3df552[_0xf16a('0x23')];var _0x54358c=_0x2fb675?0x0:_0x308a86[_0xf16a('0x20')];var _0x4fa94d=_0x2fb675?_0x3df552['count']:_0x308a86[_0xf16a('0x20')]+_0x308a86['limit'];var _0x11cc54;if(_0x4fa94d>=_0x39bb5d){_0x4fa94d=_0x39bb5d;_0x11cc54=0xc8;}else{_0x11cc54=0xce;}_0x456f22['status'](_0x11cc54);return _0x456f22[_0xf16a('0x24')](_0xf16a('0x25'),_0x54358c+'-'+_0x4fa94d+'/'+_0x39bb5d)['json'](_0x3df552);}return null;};}function patchUpdates(_0x2bc8ea){return function(_0x24f5db){try{jsonpatch['apply'](_0x24f5db,_0x2bc8ea,!![]);}catch(_0x5ea6b6){return BPromise['reject'](_0x5ea6b6);}return _0x24f5db[_0xf16a('0x26')]();};}function saveUpdates(_0x29df80,_0x229bce){return function(_0x166e5c){if(_0x166e5c){return _0x166e5c[_0xf16a('0x27')](_0x29df80)[_0xf16a('0x28')](function(_0x4e5b8){return _0x4e5b8;});}return null;};}function removeEntity(_0x122055,_0x4e8ece){return function(_0x2f4333){if(_0x2f4333){return _0x2f4333['destroy']()[_0xf16a('0x28')](function(){_0x122055[_0xf16a('0x1d')](0xcc)[_0xf16a('0x1e')]();});}};}function handleEntityNotFound(_0x5a3c24,_0x5e2651){return function(_0x330b2a){if(!_0x330b2a){_0x5a3c24[_0xf16a('0x1c')](0x194);}return _0x330b2a;};}function handleError(_0x2b00d0,_0x35ffdf){_0x35ffdf=_0x35ffdf||0x1f4;return function(_0x20560e){logger[_0xf16a('0x29')](_0x20560e[_0xf16a('0x2a')]);if(_0x20560e[_0xf16a('0x2b')]){delete _0x20560e[_0xf16a('0x2b')];}_0x2b00d0['status'](_0x35ffdf)['send'](_0x20560e);};}exports[_0xf16a('0x2c')]=function(_0x856055,_0x52e77c){var _0x39b422={},_0x2b959e={},_0x52e666={'count':0x0,'rows':[]};var _0x46d9ff=_[_0xf16a('0x2d')](db[_0xf16a('0x2e')][_0xf16a('0x2f')],function(_0x2c8099){return{'name':_0x2c8099['fieldName'],'type':_0x2c8099[_0xf16a('0x30')]['key']};});_0x2b959e[_0xf16a('0x31')]=_[_0xf16a('0x2d')](_0x46d9ff,_0xf16a('0x2b'));_0x2b959e['query']=_[_0xf16a('0x32')](_0x856055[_0xf16a('0x33')]);_0x2b959e['filters']=_['intersection'](_0x2b959e['model'],_0x2b959e['query']);_0x39b422[_0xf16a('0x34')]=_['intersection'](_0x2b959e[_0xf16a('0x31')],qs['fields'](_0x856055[_0xf16a('0x33')][_0xf16a('0x35')]));_0x39b422[_0xf16a('0x34')]=_0x39b422[_0xf16a('0x34')][_0xf16a('0x36')]?_0x39b422[_0xf16a('0x34')]:_0x2b959e['model'];if(!_0x856055[_0xf16a('0x33')][_0xf16a('0x37')](_0xf16a('0x38'))){_0x39b422[_0xf16a('0x22')]=qs[_0xf16a('0x22')](_0x856055[_0xf16a('0x33')][_0xf16a('0x22')]);_0x39b422[_0xf16a('0x20')]=qs[_0xf16a('0x20')](_0x856055[_0xf16a('0x33')]['offset']);}_0x39b422[_0xf16a('0x39')]=qs['sort'](_0x856055[_0xf16a('0x33')][_0xf16a('0x3a')]);_0x39b422[_0xf16a('0x3b')]=qs[_0xf16a('0x3c')](_[_0xf16a('0x3d')](_0x856055[_0xf16a('0x33')],_0x2b959e[_0xf16a('0x3c')]),_0x46d9ff);if(_0x856055[_0xf16a('0x33')]['filter']){_0x39b422[_0xf16a('0x3b')]=_['merge'](_0x39b422[_0xf16a('0x3b')],{'$or':_[_0xf16a('0x2d')](_0x46d9ff,function(_0x2b6b56){if(_0x2b6b56['type']!=='VIRTUAL'){var _0x1854fb={};_0x1854fb[_0x2b6b56['name']]={'$like':'%'+_0x856055[_0xf16a('0x33')]['filter']+'%'};return _0x1854fb;}})});}_0x39b422=_['merge']({},_0x39b422,_0x856055[_0xf16a('0x3e')]);var _0x26aac3={'where':_0x39b422[_0xf16a('0x3b')]};return db[_0xf16a('0x2e')]['count'](_0x26aac3)[_0xf16a('0x28')](function(_0x1a44af){_0x52e666[_0xf16a('0x23')]=_0x1a44af;if(_0x856055[_0xf16a('0x33')][_0xf16a('0x3f')]){_0x39b422[_0xf16a('0x40')]=[{'all':!![]}];}return db[_0xf16a('0x2e')][_0xf16a('0x41')](_0x39b422);})[_0xf16a('0x28')](function(_0x519083){_0x52e666['rows']=_0x519083;return _0x52e666;})[_0xf16a('0x28')](respondWithFilteredResult(_0x52e77c,_0x39b422))[_0xf16a('0x42')](handleError(_0x52e77c,null));};exports[_0xf16a('0x43')]=function(_0x3a506b,_0x1e5003){var _0x50cc74={'raw':!![],'where':{'id':_0x3a506b['params']['id']}},_0x3197f8={};_0x3197f8['model']=_['keys'](db[_0xf16a('0x2e')]['rawAttributes']);_0x3197f8['query']=_['keys'](_0x3a506b[_0xf16a('0x33')]);_0x3197f8['filters']=_['intersection'](_0x3197f8['model'],_0x3197f8[_0xf16a('0x33')]);_0x50cc74[_0xf16a('0x34')]=_[_0xf16a('0x44')](_0x3197f8['model'],qs[_0xf16a('0x35')](_0x3a506b[_0xf16a('0x33')][_0xf16a('0x35')]));_0x50cc74[_0xf16a('0x34')]=_0x50cc74[_0xf16a('0x34')][_0xf16a('0x36')]?_0x50cc74['attributes']:_0x3197f8[_0xf16a('0x31')];if(_0x3a506b[_0xf16a('0x33')]['includeAll']){_0x50cc74[_0xf16a('0x40')]=[{'all':!![]}];}_0x50cc74=_[_0xf16a('0x45')]({},_0x50cc74,_0x3a506b['options']);return db['ZohoField'][_0xf16a('0x46')](_0x50cc74)[_0xf16a('0x28')](handleEntityNotFound(_0x1e5003,null))['then'](respondWithResult(_0x1e5003,null))[_0xf16a('0x42')](handleError(_0x1e5003,null));};exports[_0xf16a('0x47')]=function(_0x4df4c1,_0x3a486e){return db[_0xf16a('0x2e')][_0xf16a('0x47')](_0x4df4c1[_0xf16a('0x48')],{})[_0xf16a('0x28')](respondWithResult(_0x3a486e,0xc9))[_0xf16a('0x42')](handleError(_0x3a486e,null));};exports[_0xf16a('0x27')]=function(_0x1479d2,_0x14fd44){if(_0x1479d2['body']['id']){delete _0x1479d2[_0xf16a('0x48')]['id'];}return db[_0xf16a('0x2e')][_0xf16a('0x46')]({'where':{'id':_0x1479d2[_0xf16a('0x49')]['id']}})[_0xf16a('0x28')](handleEntityNotFound(_0x14fd44,null))[_0xf16a('0x28')](saveUpdates(_0x1479d2[_0xf16a('0x48')],null))[_0xf16a('0x28')](respondWithResult(_0x14fd44,null))[_0xf16a('0x42')](handleError(_0x14fd44,null));};exports[_0xf16a('0x4a')]=function(_0x49c47d,_0x18f922){return db[_0xf16a('0x2e')]['find']({'where':{'id':_0x49c47d[_0xf16a('0x49')]['id']}})[_0xf16a('0x28')](handleEntityNotFound(_0x18f922,null))['then'](removeEntity(_0x18f922,null))['catch'](handleError(_0x18f922,null));}; \ No newline at end of file +var _0x9ec9=['catch','show','create','body','find','params','destroy','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','index','map','ZohoField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows'];(function(_0x2c3c00,_0xbe9871){var _0x212c4c=function(_0x5a65b1){while(--_0x5a65b1){_0x2c3c00['push'](_0x2c3c00['shift']());}};_0x212c4c(++_0xbe9871);}(_0x9ec9,0x8d));var _0x99ec=function(_0x4c4a01,_0x365c6f){_0x4c4a01=_0x4c4a01-0x0;var _0x303469=_0x9ec9[_0x4c4a01];return _0x303469;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99ec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99ec('0x1'));var rp=require('request-promise');var moment=require(_0x99ec('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x99ec('0x3'));var util=require(_0x99ec('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x99ec('0x5'));var ejs=require(_0x99ec('0x6'));var fs=require('fs');var fs_extra=require(_0x99ec('0x7'));var _=require('lodash');var squel=require(_0x99ec('0x8'));var crypto=require('crypto');var jsforce=require(_0x99ec('0x9'));var deskjs=require(_0x99ec('0xa'));var toCsv=require(_0x99ec('0x5'));var querystring=require(_0x99ec('0xb'));var Papa=require(_0x99ec('0xc'));var Redis=require(_0x99ec('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x99ec('0xe'));var as=require(_0x99ec('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99ec('0x10'))(_0x99ec('0x11'));var utils=require(_0x99ec('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43ef36,_0x10d50d){_0x10d50d=_0x10d50d||0xcc;return function(_0x3b699a){if(_0x3b699a){return _0x43ef36[_0x99ec('0x13')](_0x10d50d);}return _0x43ef36['status'](_0x10d50d)[_0x99ec('0x14')]();};}function respondWithResult(_0x5dcc79,_0x369909){_0x369909=_0x369909||0xc8;return function(_0x20e9ab){if(_0x20e9ab){return _0x5dcc79[_0x99ec('0x15')](_0x369909)['json'](_0x20e9ab);}};}function respondWithFilteredResult(_0x58b053,_0x4b1c42){return function(_0x4d9979){if(_0x4d9979){var _0x8e5d46=typeof _0x4b1c42[_0x99ec('0x16')]===_0x99ec('0x17')&&typeof _0x4b1c42[_0x99ec('0x18')]==='undefined';var _0x22dd2b=_0x4d9979[_0x99ec('0x19')];var _0x7b3dfd=_0x8e5d46?0x0:_0x4b1c42[_0x99ec('0x16')];var _0x263ce7=_0x8e5d46?_0x4d9979[_0x99ec('0x19')]:_0x4b1c42[_0x99ec('0x16')]+_0x4b1c42[_0x99ec('0x18')];var _0x3cb2ef;if(_0x263ce7>=_0x22dd2b){_0x263ce7=_0x22dd2b;_0x3cb2ef=0xc8;}else{_0x3cb2ef=0xce;}_0x58b053[_0x99ec('0x15')](_0x3cb2ef);return _0x58b053[_0x99ec('0x1a')](_0x99ec('0x1b'),_0x7b3dfd+'-'+_0x263ce7+'/'+_0x22dd2b)['json'](_0x4d9979);}return null;};}function patchUpdates(_0x32c5a5){return function(_0x97a9fb){try{jsonpatch['apply'](_0x97a9fb,_0x32c5a5,!![]);}catch(_0x5b50a3){return BPromise[_0x99ec('0x1c')](_0x5b50a3);}return _0x97a9fb[_0x99ec('0x1d')]();};}function saveUpdates(_0x33e64a,_0x4fba15){return function(_0xcefc9b){if(_0xcefc9b){return _0xcefc9b[_0x99ec('0x1e')](_0x33e64a)[_0x99ec('0x1f')](function(_0x16a11d){return _0x16a11d;});}return null;};}function removeEntity(_0x86bf55,_0x5e3083){return function(_0x4df2db){if(_0x4df2db){return _0x4df2db['destroy']()[_0x99ec('0x1f')](function(){_0x86bf55['status'](0xcc)[_0x99ec('0x14')]();});}};}function handleEntityNotFound(_0x1cdb1f,_0x2429e7){return function(_0x16e907){if(!_0x16e907){_0x1cdb1f[_0x99ec('0x13')](0x194);}return _0x16e907;};}function handleError(_0x3a012d,_0x3d32dc){_0x3d32dc=_0x3d32dc||0x1f4;return function(_0x290a3b){logger['error'](_0x290a3b[_0x99ec('0x20')]);if(_0x290a3b[_0x99ec('0x21')]){delete _0x290a3b[_0x99ec('0x21')];}_0x3a012d[_0x99ec('0x15')](_0x3d32dc)['send'](_0x290a3b);};}exports[_0x99ec('0x22')]=function(_0x155b04,_0x184a5c){var _0x196171={},_0x4e9615={},_0x41fa9f={'count':0x0,'rows':[]};var _0x3f3c58=_[_0x99ec('0x23')](db[_0x99ec('0x24')][_0x99ec('0x25')],function(_0x3089e7){return{'name':_0x3089e7['fieldName'],'type':_0x3089e7[_0x99ec('0x26')][_0x99ec('0x27')]};});_0x4e9615[_0x99ec('0x28')]=_[_0x99ec('0x23')](_0x3f3c58,'name');_0x4e9615[_0x99ec('0x29')]=_[_0x99ec('0x2a')](_0x155b04['query']);_0x4e9615[_0x99ec('0x2b')]=_[_0x99ec('0x2c')](_0x4e9615[_0x99ec('0x28')],_0x4e9615[_0x99ec('0x29')]);_0x196171[_0x99ec('0x2d')]=_[_0x99ec('0x2c')](_0x4e9615[_0x99ec('0x28')],qs[_0x99ec('0x2e')](_0x155b04[_0x99ec('0x29')][_0x99ec('0x2e')]));_0x196171[_0x99ec('0x2d')]=_0x196171[_0x99ec('0x2d')][_0x99ec('0x2f')]?_0x196171['attributes']:_0x4e9615['model'];if(!_0x155b04[_0x99ec('0x29')]['hasOwnProperty'](_0x99ec('0x30'))){_0x196171[_0x99ec('0x18')]=qs[_0x99ec('0x18')](_0x155b04[_0x99ec('0x29')][_0x99ec('0x18')]);_0x196171['offset']=qs[_0x99ec('0x16')](_0x155b04[_0x99ec('0x29')]['offset']);}_0x196171[_0x99ec('0x31')]=qs[_0x99ec('0x32')](_0x155b04[_0x99ec('0x29')]['sort']);_0x196171[_0x99ec('0x33')]=qs[_0x99ec('0x2b')](_[_0x99ec('0x34')](_0x155b04[_0x99ec('0x29')],_0x4e9615[_0x99ec('0x2b')]),_0x3f3c58);if(_0x155b04[_0x99ec('0x29')]['filter']){_0x196171[_0x99ec('0x33')]=_[_0x99ec('0x35')](_0x196171[_0x99ec('0x33')],{'$or':_[_0x99ec('0x23')](_0x3f3c58,function(_0x9aa224){if(_0x9aa224['type']!==_0x99ec('0x36')){var _0x17103b={};_0x17103b[_0x9aa224[_0x99ec('0x21')]]={'$like':'%'+_0x155b04[_0x99ec('0x29')][_0x99ec('0x37')]+'%'};return _0x17103b;}})});}_0x196171=_[_0x99ec('0x35')]({},_0x196171,_0x155b04[_0x99ec('0x38')]);var _0x3457eb={'where':_0x196171['where']};return db[_0x99ec('0x24')][_0x99ec('0x19')](_0x3457eb)[_0x99ec('0x1f')](function(_0x20a4e8){_0x41fa9f[_0x99ec('0x19')]=_0x20a4e8;if(_0x155b04[_0x99ec('0x29')]['includeAll']){_0x196171[_0x99ec('0x39')]=[{'all':!![]}];}return db['ZohoField'][_0x99ec('0x3a')](_0x196171);})[_0x99ec('0x1f')](function(_0x440291){_0x41fa9f[_0x99ec('0x3b')]=_0x440291;return _0x41fa9f;})[_0x99ec('0x1f')](respondWithFilteredResult(_0x184a5c,_0x196171))[_0x99ec('0x3c')](handleError(_0x184a5c,null));};exports[_0x99ec('0x3d')]=function(_0x19db96,_0x5a017d){var _0xe6b790={'raw':!![],'where':{'id':_0x19db96['params']['id']}},_0x55cb87={};_0x55cb87[_0x99ec('0x28')]=_[_0x99ec('0x2a')](db['ZohoField'][_0x99ec('0x25')]);_0x55cb87[_0x99ec('0x29')]=_[_0x99ec('0x2a')](_0x19db96[_0x99ec('0x29')]);_0x55cb87[_0x99ec('0x2b')]=_[_0x99ec('0x2c')](_0x55cb87[_0x99ec('0x28')],_0x55cb87[_0x99ec('0x29')]);_0xe6b790[_0x99ec('0x2d')]=_['intersection'](_0x55cb87[_0x99ec('0x28')],qs[_0x99ec('0x2e')](_0x19db96[_0x99ec('0x29')][_0x99ec('0x2e')]));_0xe6b790['attributes']=_0xe6b790[_0x99ec('0x2d')][_0x99ec('0x2f')]?_0xe6b790['attributes']:_0x55cb87[_0x99ec('0x28')];if(_0x19db96['query']['includeAll']){_0xe6b790['include']=[{'all':!![]}];}_0xe6b790=_[_0x99ec('0x35')]({},_0xe6b790,_0x19db96[_0x99ec('0x38')]);return db[_0x99ec('0x24')]['find'](_0xe6b790)['then'](handleEntityNotFound(_0x5a017d,null))[_0x99ec('0x1f')](respondWithResult(_0x5a017d,null))[_0x99ec('0x3c')](handleError(_0x5a017d,null));};exports[_0x99ec('0x3e')]=function(_0x5f5720,_0xd8213){return db[_0x99ec('0x24')][_0x99ec('0x3e')](_0x5f5720[_0x99ec('0x3f')],{})[_0x99ec('0x1f')](respondWithResult(_0xd8213,0xc9))[_0x99ec('0x3c')](handleError(_0xd8213,null));};exports['update']=function(_0x11f44b,_0x78ea2f){if(_0x11f44b[_0x99ec('0x3f')]['id']){delete _0x11f44b[_0x99ec('0x3f')]['id'];}return db[_0x99ec('0x24')][_0x99ec('0x40')]({'where':{'id':_0x11f44b[_0x99ec('0x41')]['id']}})['then'](handleEntityNotFound(_0x78ea2f,null))[_0x99ec('0x1f')](saveUpdates(_0x11f44b['body'],null))[_0x99ec('0x1f')](respondWithResult(_0x78ea2f,null))[_0x99ec('0x3c')](handleError(_0x78ea2f,null));};exports[_0x99ec('0x42')]=function(_0x58b555,_0x2e4f18){return db[_0x99ec('0x24')]['find']({'where':{'id':_0x58b555[_0x99ec('0x41')]['id']}})[_0x99ec('0x1f')](handleEntityNotFound(_0x2e4f18,null))['then'](removeEntity(_0x2e4f18,null))['catch'](handleError(_0x2e4f18,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index bef1fcf..7d3a902 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 _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b9007,_0x482404){var _0xfe01e7=function(_0x199ebf){while(--_0x199ebf){_0x3b9007['push'](_0x3b9007['shift']());}};_0xfe01e7(++_0x482404);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'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'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x42dafe,_0x4cfe95){var _0x1f6512=function(_0x14b53d){while(--_0x14b53d){_0x42dafe['push'](_0x42dafe['shift']());}};_0x1f6512(++_0x4cfe95);}(_0x5464,0x15d));var _0x4546=function(_0x127f0f,_0x330652){_0x127f0f=_0x127f0f-0x0;var _0x37804e=_0x5464[_0x127f0f];return _0x37804e;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index ed4d557..49a8444 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 _0x883e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x883e,0x74));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require('util');var moment=require(_0xe883('0x1'));var BPromise=require(_0xe883('0x2'));var rs=require(_0xe883('0x3'));var fs=require('fs');var Redis=require(_0xe883('0x4'));var db=require(_0xe883('0x5'))['db'];var utils=require(_0xe883('0x6'));var logger=require(_0xe883('0x7'))('rpc');var config=require(_0xe883('0x8'));var jayson=require(_0xe883('0x9'));var client=jayson[_0xe883('0xa')][_0xe883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x147e72,_0x38dc95,_0x57b651){return new BPromise(function(_0x4b80db,_0xf2be38){return client[_0xe883('0xc')](_0x147e72,_0x57b651)[_0xe883('0xd')](function(_0x5e69ff){logger[_0xe883('0xe')](_0xe883('0xf'),_0x38dc95,'request\x20sent');logger[_0xe883('0x10')](_0xe883('0x11'),_0x38dc95,_0xe883('0x12'),JSON[_0xe883('0x13')](_0x5e69ff));if(_0x5e69ff[_0xe883('0x14')]){if(_0x5e69ff['error'][_0xe883('0x15')]===0x1f4){logger['error'](_0xe883('0xf'),_0x38dc95,_0x5e69ff[_0xe883('0x14')]['message']);return _0xf2be38(_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);}logger[_0xe883('0x14')](_0xe883('0xf'),_0x38dc95,_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);return _0x4b80db(_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);}else{logger[_0xe883('0xe')]('ZohoField,\x20%s,\x20%s',_0x38dc95,_0xe883('0x12'));_0x4b80db(_0x5e69ff['result'][_0xe883('0x16')]);}})[_0xe883('0x17')](function(_0x193b4f){logger[_0xe883('0x14')](_0xe883('0xf'),_0x38dc95,_0x193b4f);_0xf2be38(_0x193b4f);});});} \ No newline at end of file +var _0x4468=['then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x4468,0xf1));var _0x8446=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x4468[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x8446('0x0'));var util=require('util');var moment=require(_0x8446('0x1'));var BPromise=require(_0x8446('0x2'));var rs=require(_0x8446('0x3'));var fs=require('fs');var Redis=require(_0x8446('0x4'));var db=require(_0x8446('0x5'))['db'];var utils=require(_0x8446('0x6'));var logger=require('../../config/logger')(_0x8446('0x7'));var config=require(_0x8446('0x8'));var jayson=require(_0x8446('0x9'));var client=jayson[_0x8446('0xa')][_0x8446('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e444b,_0x29cf9c,_0xfd6ef1){return new BPromise(function(_0x1e50e5,_0xa8f463){return client['request'](_0x2e444b,_0xfd6ef1)[_0x8446('0xc')](function(_0x1cdcab){logger['info'](_0x8446('0xd'),_0x29cf9c,_0x8446('0xe'));logger[_0x8446('0xf')](_0x8446('0x10'),_0x29cf9c,_0x8446('0xe'),JSON[_0x8446('0x11')](_0x1cdcab));if(_0x1cdcab['error']){if(_0x1cdcab[_0x8446('0x12')][_0x8446('0x13')]===0x1f4){logger[_0x8446('0x12')](_0x8446('0xd'),_0x29cf9c,_0x1cdcab['error']['message']);return _0xa8f463(_0x1cdcab['error'][_0x8446('0x14')]);}logger[_0x8446('0x12')](_0x8446('0xd'),_0x29cf9c,_0x1cdcab[_0x8446('0x12')][_0x8446('0x14')]);return _0x1e50e5(_0x1cdcab[_0x8446('0x12')]['message']);}else{logger['info'](_0x8446('0xd'),_0x29cf9c,_0x8446('0xe'));_0x1e50e5(_0x1cdcab[_0x8446('0x15')]['message']);}})[_0x8446('0x16')](function(_0x53cd85){logger['error'](_0x8446('0xd'),_0x29cf9c,_0x53cd85);_0xa8f463(_0x53cd85);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 37f871d..1e31e3b 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e7526,_0x4bcb67){var _0x95a89b=function(_0x4e0c67){while(--_0x4e0c67){_0x1e7526['push'](_0x1e7526['shift']());}};_0x95a89b(++_0x4bcb67);}(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x414166,_0x5e87f3){var _0x373505=function(_0x1cd5b1){while(--_0x1cd5b1){_0x414166['push'](_0x414166['shift']());}};_0x373505(++_0x5e87f3);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e879c7c..dd0481d 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 _0xa883=['sequelize','exports','STRING','unique_name_and_version','BOOLEAN','state'];(function(_0x4a691f,_0x1994dd){var _0xb33bb8=function(_0x45e016){while(--_0x45e016){_0x4a691f['push'](_0x4a691f['shift']());}};_0xb33bb8(++_0x1994dd);}(_0xa883,0x1f2));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a88('0x0'));module[_0x3a88('0x1')]={'name':{'type':Sequelize[_0x3a88('0x2')],'allowNull':![],'unique':_0x3a88('0x3')},'version':{'type':Sequelize[_0x3a88('0x2')],'allowNull':![],'unique':_0x3a88('0x3')},'main':{'type':Sequelize[_0x3a88('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3a88('0x2')]},'type':{'type':Sequelize[_0x3a88('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3a88('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3a88('0x2')]},'logo':{'type':Sequelize[_0x3a88('0x2')]},'state':{'type':Sequelize[_0x3a88('0x2')],'unique':_0x3a88('0x5')},'description':{'type':Sequelize[_0x3a88('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3a88('0x2')]},'link':{'type':Sequelize[_0x3a88('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x68fa=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x357398,_0x5727f9){var _0x561d9a=function(_0x5176c5){while(--_0x5176c5){_0x357398['push'](_0x357398['shift']());}};_0x561d9a(++_0x5727f9);}(_0x68fa,0x135));var _0xa68f=function(_0x466161,_0x29cc00){_0x466161=_0x466161-0x0;var _0x2f9c1d=_0x68fa[_0x466161];return _0x2f9c1d;};'use strict';var Sequelize=require(_0xa68f('0x0'));module[_0xa68f('0x1')]={'name':{'type':Sequelize[_0xa68f('0x2')],'allowNull':![],'unique':_0xa68f('0x3')},'version':{'type':Sequelize[_0xa68f('0x2')],'allowNull':![],'unique':_0xa68f('0x3')},'main':{'type':Sequelize[_0xa68f('0x2')],'defaultValue':_0xa68f('0x4')},'filename':{'type':Sequelize[_0xa68f('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa68f('0x2')]},'size':{'type':Sequelize[_0xa68f('0x5')]},'active':{'type':Sequelize[_0xa68f('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xa68f('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xa68f('0x7')},'description':{'type':Sequelize[_0xa68f('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa68f('0x2')]},'link':{'type':Sequelize[_0xa68f('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 ab394e3..619605f 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xadb5,0xad));var _0x5adb=function(_0x13d37e,_0x4ad02f){_0x13d37e=_0x13d37e-0x0;var _0x1deb39=_0xadb5[_0x13d37e];return _0x1deb39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0x1967=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Integration','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x1967,0x173));var _0x7196=function(_0x4d0129,_0x375103){_0x4d0129=_0x4d0129-0x0;var _0x36c191=_0x1967[_0x4d0129];return _0x36c191;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['Integration'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['create']=function(_0x29c7e8,_0x582884){return db['Integration'][_0x7196('0x49')](_0x29c7e8['body'],{})['then'](respondWithResult(_0x582884,0xc9))['catch'](handleError(_0x582884,null));};exports[_0x7196('0x26')]=function(_0x5052ee,_0x48e3b5){if(_0x5052ee[_0x7196('0x4a')]['id']){delete _0x5052ee[_0x7196('0x4a')]['id'];}return db[_0x7196('0x3e')][_0x7196('0x47')]({'where':{'id':_0x5052ee['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x48e3b5,null))['then'](saveUpdates(_0x5052ee[_0x7196('0x4a')],null))[_0x7196('0x27')](respondWithResult(_0x48e3b5,null))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x4b')]=function(_0x2fd056,_0x3fe092){return db['Integration'][_0x7196('0x47')]({'where':{'id':_0x2fd056['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x3fe092,null))[_0x7196('0x27')](removeEntity(_0x3fe092,null))[_0x7196('0x48')](handleError(_0x3fe092,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 2ca03a4..f67838c 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 _0xf6ad=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./integration.attributes','define','Integration'];(function(_0x30c39d,_0x4f95dc){var _0x54213e=function(_0x29d94f){while(--_0x29d94f){_0x30c39d['push'](_0x30c39d['shift']());}};_0x54213e(++_0x4f95dc);}(_0xf6ad,0xb0));var _0xdf6a=function(_0x2452ff,_0x3b8868){_0x2452ff=_0x2452ff-0x0;var _0x4111f8=_0xf6ad[_0x2452ff];return _0x4111f8;};'use strict';var _=require(_0xdf6a('0x0'));var util=require(_0xdf6a('0x1'));var logger=require(_0xdf6a('0x2'))(_0xdf6a('0x3'));var moment=require(_0xdf6a('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf6a('0x5'));var fs=require('fs');var path=require(_0xdf6a('0x6'));var rimraf=require(_0xdf6a('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf6a('0x8'));module['exports']=function(_0x3c811b,_0x3634a2){return _0x3c811b[_0xdf6a('0x9')](_0xdf6a('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8303=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','integrations','lodash','util','../../config/logger'];(function(_0xe34491,_0x325ded){var _0x51d3d1=function(_0x6961bd){while(--_0x6961bd){_0xe34491['push'](_0xe34491['shift']());}};_0x51d3d1(++_0x325ded);}(_0x8303,0x11b));var _0x3830=function(_0x10d0bb,_0x270533){_0x10d0bb=_0x10d0bb-0x0;var _0x272841=_0x8303[_0x10d0bb];return _0x272841;};'use strict';var _=require(_0x3830('0x0'));var util=require(_0x3830('0x1'));var logger=require(_0x3830('0x2'))(_0x3830('0x3'));var moment=require(_0x3830('0x4'));var BPromise=require(_0x3830('0x5'));var rp=require(_0x3830('0x6'));var fs=require('fs');var path=require(_0x3830('0x7'));var rimraf=require(_0x3830('0x8'));var config=require(_0x3830('0x9'));var attributes=require(_0x3830('0xa'));module[_0x3830('0xb')]=function(_0x4982de,_0x55e934){return _0x4982de['define']('Integration',attributes,{'tableName':_0x3830('0xc'),'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 56addeb..234764b 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 _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x44d5a2,_0x2b1a6b){_0x44d5a2=_0x44d5a2-0x0;var _0x5243e4=_0x7a54[_0x44d5a2];return _0x5243e4;};'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')]('Integration,\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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x4b2c91,_0x146e75){var _0x39dea8=function(_0x48c6d0){while(--_0x48c6d0){_0x4b2c91['push'](_0x4b2c91['shift']());}};_0x39dea8(++_0x146e75);}(_0x1a85,0x178));var _0x51a8=function(_0x5674fc,_0x2b623b){_0x5674fc=_0x5674fc-0x0;var _0x2444a5=_0x1a85[_0x5674fc];return _0x2444a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 62e6787..d5c827e 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0x4975,0x86));var _0x5497=function(_0x12af2d,_0x443f9c){_0x12af2d=_0x12af2d-0x0;var _0x44d294=_0x4975[_0x12af2d];return _0x44d294;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x310b5c,_0x1db201){var _0x396e7e=function(_0x309033){while(--_0x309033){_0x310b5c['push'](_0x310b5c['shift']());}};_0x396e7e(++_0x1db201);}(_0x4975,0x86));var _0x5497=function(_0x39536e,_0x103efc){_0x39536e=_0x39536e-0x0;var _0x3debd1=_0x4975[_0x39536e];return _0x3debd1;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index bc651af..bf8c534 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 _0x71b1=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x71b1,0x1d4));var _0x171b=function(_0x333195,_0x366608){_0x333195=_0x333195-0x0;var _0x2e44de=_0x71b1[_0x333195];return _0x2e44de;};'use strict';var Sequelize=require(_0x171b('0x0'));module[_0x171b('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x171b('0x2')]},'exitStatus':{'type':Sequelize[_0x171b('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x171b('0x3')]},'contacts':{'type':Sequelize[_0x171b('0x2')]},'uniqueid':{'type':Sequelize[_0x171b('0x2')]},'calleridnum':{'type':Sequelize[_0x171b('0x2')]},'calleridname':{'type':Sequelize[_0x171b('0x2')]},'queue':{'type':Sequelize[_0x171b('0x2')]},'interface':{'type':Sequelize[_0x171b('0x2')]},'membername':{'type':Sequelize[_0x171b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x171b('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x171b('0x3')]},'agentacw':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x171b('0x3')]},'reason':{'type':Sequelize[_0x171b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x171b('0x4')]},'lastevent':{'type':Sequelize[_0x171b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x171b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x171b('0x2')]},'connectedlinename':{'type':Sequelize[_0x171b('0x2')]},'language':{'type':Sequelize[_0x171b('0x2')]},'accountcode':{'type':Sequelize[_0x171b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x171b('0x2')]},'priority':{'type':Sequelize[_0x171b('0x2')]},'destchannel':{'type':Sequelize[_0x171b('0x2')]},'destchannelstate':{'type':Sequelize[_0x171b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x171b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x171b('0x2')]},'destcalleridname':{'type':Sequelize[_0x171b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x171b('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x171b('0x2')]},'destcontext':{'type':Sequelize[_0x171b('0x2')]},'destexten':{'type':Sequelize[_0x171b('0x2')]},'destpriority':{'type':Sequelize[_0x171b('0x2')]},'destuniqueid':{'type':Sequelize[_0x171b('0x2')]},'messageId':{'type':Sequelize[_0x171b('0x2')]},'inReplyTo':{'type':Sequelize[_0x171b('0x2')]},'subject':{'type':Sequelize[_0x171b('0x2')]},'from':{'type':Sequelize[_0x171b('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x171b('0x6')]},'html':{'type':Sequelize[_0x171b('0x6')]},'text':{'type':Sequelize[_0x171b('0x6')]},'status':{'type':Sequelize[_0x171b('0x7')](_0x171b('0x8'),_0x171b('0x9'),_0x171b('0xa'),_0x171b('0xb'))},'url':{'type':Sequelize[_0x171b('0x2')]},'app':{'type':Sequelize[_0x171b('0x2')]},'appdata':{'type':Sequelize[_0x171b('0x2')]},'projectId':{'type':Sequelize[_0x171b('0x3')]}}; \ No newline at end of file +var _0x91a9=['ENUM','SENT','SENDING','RECEIVED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x91a9,0x7c));var _0x991a=function(_0x1718ea,_0x5bef73){_0x1718ea=_0x1718ea-0x0;var _0x1e9811=_0x91a9[_0x1718ea];return _0x1e9811;};'use strict';var Sequelize=require('sequelize');module[_0x991a('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x991a('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x991a('0x1')]},'integrationId':{'type':Sequelize[_0x991a('0x2')]},'contacts':{'type':Sequelize[_0x991a('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x991a('0x1')]},'calleridname':{'type':Sequelize[_0x991a('0x1')]},'queue':{'type':Sequelize[_0x991a('0x1')]},'interface':{'type':Sequelize[_0x991a('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x991a('0x3')]},'holdtime':{'type':Sequelize[_0x991a('0x2')]},'agentcomplete':{'type':Sequelize[_0x991a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x991a('0x3')]},'talktime':{'type':Sequelize[_0x991a('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x991a('0x2')]},'reason':{'type':Sequelize[_0x991a('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x991a('0x3')]},'agentdump':{'type':Sequelize[_0x991a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x991a('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x991a('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x991a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x991a('0x1')]},'connectedlinename':{'type':Sequelize[_0x991a('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x991a('0x1')]},'context':{'type':Sequelize[_0x991a('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x991a('0x1')]},'destchannel':{'type':Sequelize[_0x991a('0x1')]},'destchannelstate':{'type':Sequelize[_0x991a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x991a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x991a('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x991a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x991a('0x1')]},'destlanguage':{'type':Sequelize[_0x991a('0x1')]},'destaccountcode':{'type':Sequelize[_0x991a('0x1')]},'destcontext':{'type':Sequelize[_0x991a('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x991a('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x991a('0x1')]},'subject':{'type':Sequelize[_0x991a('0x1')]},'from':{'type':Sequelize[_0x991a('0x1')]},'to':{'type':Sequelize[_0x991a('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x991a('0x5')]},'html':{'type':Sequelize[_0x991a('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x991a('0x6')](_0x991a('0x7'),_0x991a('0x8'),_0x991a('0x9'),'FAILED')},'url':{'type':Sequelize[_0x991a('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x991a('0x1')]},'projectId':{'type':Sequelize[_0x991a('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 68b1c62..3cad844 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 _0x5704=['filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x2cffc9,_0x5dc809){var _0x150c20=function(_0x18a609){while(--_0x18a609){_0x2cffc9['push'](_0x2cffc9['shift']());}};_0x150c20(++_0x5dc809);}(_0x5704,0x175));var _0x4570=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0x5704[_0x2b45b5];return _0x1d9c06;};'use strict';var emlformat=require(_0x4570('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4570('0x1'));var jsonpatch=require(_0x4570('0x2'));var rp=require(_0x4570('0x3'));var moment=require(_0x4570('0x4'));var BPromise=require(_0x4570('0x5'));var Mustache=require(_0x4570('0x6'));var util=require('util');var path=require(_0x4570('0x7'));var sox=require(_0x4570('0x8'));var csv=require(_0x4570('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4570('0xa'));var _=require(_0x4570('0xb'));var squel=require(_0x4570('0xc'));var crypto=require('crypto');var jsforce=require(_0x4570('0xd'));var deskjs=require(_0x4570('0xe'));var toCsv=require(_0x4570('0x9'));var querystring=require(_0x4570('0xf'));var Papa=require('papaparse');var Redis=require(_0x4570('0x10'));var authService=require(_0x4570('0x11'));var qs=require(_0x4570('0x12'));var as=require(_0x4570('0x13'));var hardwareService=require(_0x4570('0x14'));var logger=require(_0x4570('0x15'))(_0x4570('0x16'));var utils=require(_0x4570('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4570('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c22d,_0x18e9cf){_0x18e9cf=_0x18e9cf||0xcc;return function(_0x1c7f41){if(_0x1c7f41){return _0x45c22d[_0x4570('0x19')](_0x18e9cf);}return _0x45c22d['status'](_0x18e9cf)[_0x4570('0x1a')]();};}function respondWithResult(_0x57793f,_0x301daa){_0x301daa=_0x301daa||0xc8;return function(_0xd8c256){if(_0xd8c256){return _0x57793f[_0x4570('0x1b')](_0x301daa)[_0x4570('0x1c')](_0xd8c256);}};}function respondWithFilteredResult(_0x317d3b,_0x42f99b){return function(_0x456428){if(_0x456428){var _0x40fc1e=typeof _0x42f99b[_0x4570('0x1d')]===_0x4570('0x1e')&&typeof _0x42f99b['limit']===_0x4570('0x1e');var _0x32bb2f=_0x456428[_0x4570('0x1f')];var _0x14ecce=_0x40fc1e?0x0:_0x42f99b[_0x4570('0x1d')];var _0x1b0830=_0x40fc1e?_0x456428[_0x4570('0x1f')]:_0x42f99b['offset']+_0x42f99b[_0x4570('0x20')];var _0x563917;if(_0x1b0830>=_0x32bb2f){_0x1b0830=_0x32bb2f;_0x563917=0xc8;}else{_0x563917=0xce;}_0x317d3b['status'](_0x563917);return _0x317d3b[_0x4570('0x21')]('Content-Range',_0x14ecce+'-'+_0x1b0830+'/'+_0x32bb2f)['json'](_0x456428);}return null;};}function patchUpdates(_0x34751c){return function(_0x236b50){try{jsonpatch[_0x4570('0x22')](_0x236b50,_0x34751c,!![]);}catch(_0x45086b){return BPromise[_0x4570('0x23')](_0x45086b);}return _0x236b50[_0x4570('0x24')]();};}function saveUpdates(_0x4a437c,_0x1446fc){return function(_0x195f88){if(_0x195f88){return _0x195f88['update'](_0x4a437c)[_0x4570('0x25')](function(_0xfc3926){return _0xfc3926;});}return null;};}function removeEntity(_0x13ba1a,_0x380415){return function(_0x1bc982){if(_0x1bc982){return _0x1bc982[_0x4570('0x26')]()[_0x4570('0x25')](function(){_0x13ba1a[_0x4570('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f992d,_0x533b41){return function(_0x26c932){if(!_0x26c932){_0x3f992d[_0x4570('0x19')](0x194);}return _0x26c932;};}function handleError(_0x4c60cd,_0x47db61){_0x47db61=_0x47db61||0x1f4;return function(_0x52291b){logger[_0x4570('0x27')](_0x52291b['stack']);if(_0x52291b['name']){delete _0x52291b[_0x4570('0x28')];}_0x4c60cd[_0x4570('0x1b')](_0x47db61)['send'](_0x52291b);};}exports[_0x4570('0x29')]=function(_0x5c330a,_0x1dfd73){var _0x2c94c3={},_0x2b1232={},_0x13b636={'count':0x0,'rows':[]};var _0x39c7a6=_[_0x4570('0x2a')](db[_0x4570('0x2b')][_0x4570('0x2c')],function(_0x123ccc){return{'name':_0x123ccc[_0x4570('0x2d')],'type':_0x123ccc[_0x4570('0x2e')][_0x4570('0x2f')]};});_0x2b1232[_0x4570('0x30')]=_['map'](_0x39c7a6,_0x4570('0x28'));_0x2b1232[_0x4570('0x31')]=_['keys'](_0x5c330a[_0x4570('0x31')]);_0x2b1232[_0x4570('0x32')]=_['intersection'](_0x2b1232['model'],_0x2b1232[_0x4570('0x31')]);_0x2c94c3[_0x4570('0x33')]=_[_0x4570('0x34')](_0x2b1232[_0x4570('0x30')],qs[_0x4570('0x35')](_0x5c330a[_0x4570('0x31')][_0x4570('0x35')]));_0x2c94c3[_0x4570('0x33')]=_0x2c94c3[_0x4570('0x33')][_0x4570('0x36')]?_0x2c94c3[_0x4570('0x33')]:_0x2b1232[_0x4570('0x30')];if(!_0x5c330a[_0x4570('0x31')][_0x4570('0x37')]('nolimit')){_0x2c94c3[_0x4570('0x20')]=qs[_0x4570('0x20')](_0x5c330a[_0x4570('0x31')][_0x4570('0x20')]);_0x2c94c3['offset']=qs[_0x4570('0x1d')](_0x5c330a[_0x4570('0x31')][_0x4570('0x1d')]);}_0x2c94c3[_0x4570('0x38')]=qs[_0x4570('0x39')](_0x5c330a[_0x4570('0x31')][_0x4570('0x39')]);_0x2c94c3[_0x4570('0x3a')]=qs['filters'](_['pick'](_0x5c330a['query'],_0x2b1232['filters']),_0x39c7a6);if(_0x5c330a[_0x4570('0x31')][_0x4570('0x3b')]){_0x2c94c3['where']=_[_0x4570('0x3c')](_0x2c94c3['where'],{'$or':_[_0x4570('0x2a')](_0x39c7a6,function(_0x5cbccf){if(_0x5cbccf[_0x4570('0x2e')]!=='VIRTUAL'){var _0x2e3380={};_0x2e3380[_0x5cbccf['name']]={'$like':'%'+_0x5c330a[_0x4570('0x31')]['filter']+'%'};return _0x2e3380;}})});}_0x2c94c3=_[_0x4570('0x3c')]({},_0x2c94c3,_0x5c330a[_0x4570('0x3d')]);var _0x807d82={'where':_0x2c94c3[_0x4570('0x3a')]};return db['IntegrationReport'][_0x4570('0x1f')](_0x807d82)[_0x4570('0x25')](function(_0x3cfa74){_0x13b636[_0x4570('0x1f')]=_0x3cfa74;if(_0x5c330a[_0x4570('0x31')][_0x4570('0x3e')]){_0x2c94c3[_0x4570('0x3f')]=[{'all':!![]}];}return db[_0x4570('0x2b')][_0x4570('0x40')](_0x2c94c3);})[_0x4570('0x25')](function(_0x248bda){_0x13b636['rows']=_0x248bda;return _0x13b636;})[_0x4570('0x25')](respondWithFilteredResult(_0x1dfd73,_0x2c94c3))['catch'](handleError(_0x1dfd73,null));};exports['show']=function(_0x3a8171,_0x1a38b3){var _0x956409={'raw':![],'where':{'id':_0x3a8171[_0x4570('0x41')]['id']}},_0x5e9ddb={};_0x5e9ddb[_0x4570('0x30')]=_['keys'](db[_0x4570('0x2b')][_0x4570('0x2c')]);_0x5e9ddb[_0x4570('0x31')]=_['keys'](_0x3a8171[_0x4570('0x31')]);_0x5e9ddb[_0x4570('0x32')]=_[_0x4570('0x34')](_0x5e9ddb[_0x4570('0x30')],_0x5e9ddb[_0x4570('0x31')]);_0x956409[_0x4570('0x33')]=_[_0x4570('0x34')](_0x5e9ddb['model'],qs[_0x4570('0x35')](_0x3a8171['query'][_0x4570('0x35')]));_0x956409[_0x4570('0x33')]=_0x956409[_0x4570('0x33')][_0x4570('0x36')]?_0x956409[_0x4570('0x33')]:_0x5e9ddb[_0x4570('0x30')];if(_0x3a8171[_0x4570('0x31')][_0x4570('0x3e')]){_0x956409[_0x4570('0x3f')]=[{'all':!![]}];}_0x956409=_[_0x4570('0x3c')]({},_0x956409,_0x3a8171[_0x4570('0x3d')]);return db['IntegrationReport'][_0x4570('0x42')](_0x956409)['then'](handleEntityNotFound(_0x1a38b3,null))['then'](respondWithResult(_0x1a38b3,null))[_0x4570('0x43')](handleError(_0x1a38b3,null));};exports['create']=function(_0x4c7350,_0x594ebd){return db[_0x4570('0x2b')][_0x4570('0x44')](_0x4c7350[_0x4570('0x45')],{})[_0x4570('0x25')](respondWithResult(_0x594ebd,0xc9))[_0x4570('0x43')](handleError(_0x594ebd,null));};exports[_0x4570('0x46')]=function(_0x521fa0,_0x377924){if(_0x521fa0['body']['id']){delete _0x521fa0['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x521fa0['params']['id']}})['then'](handleEntityNotFound(_0x377924,null))['then'](saveUpdates(_0x521fa0[_0x4570('0x45')],null))[_0x4570('0x25')](respondWithResult(_0x377924,null))[_0x4570('0x43')](handleError(_0x377924,null));};exports['destroy']=function(_0x3ed63b,_0x1a33db){return db['IntegrationReport']['find']({'where':{'id':_0x3ed63b['params']['id']}})[_0x4570('0x25')](handleEntityNotFound(_0x1a33db,null))['then'](removeEntity(_0x1a33db,null))[_0x4570('0x43')](handleError(_0x1a33db,null));};exports[_0x4570('0x47')]=function(_0xffff5a,_0x28cf91){return db['IntegrationReport'][_0x4570('0x47')]()[_0x4570('0x25')](respondWithResult(_0x28cf91,null))[_0x4570('0x43')](handleError(_0x28cf91,null));}; \ No newline at end of file +var _0x7b9f=['Content-Range','reject','save','update','then','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','include','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0x7b9f,0x106));var _0xf7b9=function(_0x537e50,_0x1c676d){_0x537e50=_0x537e50-0x0;var _0x42f01f=_0x7b9f[_0x537e50];return _0x42f01f;};'use strict';var emlformat=require(_0xf7b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7b9('0x1'));var jsonpatch=require(_0xf7b9('0x2'));var rp=require(_0xf7b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf7b9('0x4'));var util=require(_0xf7b9('0x5'));var path=require(_0xf7b9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf7b9('0x7'));var fs=require('fs');var fs_extra=require(_0xf7b9('0x8'));var _=require(_0xf7b9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf7b9('0xa'));var deskjs=require(_0xf7b9('0xb'));var toCsv=require(_0xf7b9('0xc'));var querystring=require(_0xf7b9('0xd'));var Papa=require(_0xf7b9('0xe'));var Redis=require(_0xf7b9('0xf'));var authService=require(_0xf7b9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf7b9('0x11'));var hardwareService=require(_0xf7b9('0x12'));var logger=require(_0xf7b9('0x13'))(_0xf7b9('0x14'));var utils=require(_0xf7b9('0x15'));var config=require(_0xf7b9('0x16'));var licenseUtil=require(_0xf7b9('0x17'));var db=require(_0xf7b9('0x18'))['db'];function respondWithStatusCode(_0x53ef71,_0x7809ad){_0x7809ad=_0x7809ad||0xcc;return function(_0x30d323){if(_0x30d323){return _0x53ef71[_0xf7b9('0x19')](_0x7809ad);}return _0x53ef71[_0xf7b9('0x1a')](_0x7809ad)[_0xf7b9('0x1b')]();};}function respondWithResult(_0x290f67,_0x16f3b3){_0x16f3b3=_0x16f3b3||0xc8;return function(_0x5dec8a){if(_0x5dec8a){return _0x290f67[_0xf7b9('0x1a')](_0x16f3b3)[_0xf7b9('0x1c')](_0x5dec8a);}};}function respondWithFilteredResult(_0x92f483,_0x4ac940){return function(_0x21f8c5){if(_0x21f8c5){var _0x3e610e=typeof _0x4ac940[_0xf7b9('0x1d')]===_0xf7b9('0x1e')&&typeof _0x4ac940[_0xf7b9('0x1f')]===_0xf7b9('0x1e');var _0x2c7bfe=_0x21f8c5[_0xf7b9('0x20')];var _0x2c1978=_0x3e610e?0x0:_0x4ac940['offset'];var _0x2f2106=_0x3e610e?_0x21f8c5[_0xf7b9('0x20')]:_0x4ac940['offset']+_0x4ac940[_0xf7b9('0x1f')];var _0x518df4;if(_0x2f2106>=_0x2c7bfe){_0x2f2106=_0x2c7bfe;_0x518df4=0xc8;}else{_0x518df4=0xce;}_0x92f483[_0xf7b9('0x1a')](_0x518df4);return _0x92f483[_0xf7b9('0x21')](_0xf7b9('0x22'),_0x2c1978+'-'+_0x2f2106+'/'+_0x2c7bfe)[_0xf7b9('0x1c')](_0x21f8c5);}return null;};}function patchUpdates(_0x189f64){return function(_0x5380b3){try{jsonpatch['apply'](_0x5380b3,_0x189f64,!![]);}catch(_0x12dd14){return BPromise[_0xf7b9('0x23')](_0x12dd14);}return _0x5380b3[_0xf7b9('0x24')]();};}function saveUpdates(_0x53a8b8,_0x23feab){return function(_0x700445){if(_0x700445){return _0x700445[_0xf7b9('0x25')](_0x53a8b8)[_0xf7b9('0x26')](function(_0x2bc557){return _0x2bc557;});}return null;};}function removeEntity(_0xc367e0,_0x4b423e){return function(_0x31e421){if(_0x31e421){return _0x31e421['destroy']()[_0xf7b9('0x26')](function(){_0xc367e0[_0xf7b9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d0faf,_0x2f3d80){return function(_0x18ff8d){if(!_0x18ff8d){_0x3d0faf[_0xf7b9('0x19')](0x194);}return _0x18ff8d;};}function handleError(_0x58f174,_0x527132){_0x527132=_0x527132||0x1f4;return function(_0x2c3ff0){logger[_0xf7b9('0x27')](_0x2c3ff0[_0xf7b9('0x28')]);if(_0x2c3ff0['name']){delete _0x2c3ff0[_0xf7b9('0x29')];}_0x58f174[_0xf7b9('0x1a')](_0x527132)['send'](_0x2c3ff0);};}exports[_0xf7b9('0x2a')]=function(_0x5c69bc,_0xec3b46){var _0x1db135={},_0x1e7691={},_0x4ab849={'count':0x0,'rows':[]};var _0x4df3b5=_[_0xf7b9('0x2b')](db[_0xf7b9('0x2c')][_0xf7b9('0x2d')],function(_0x5700c2){return{'name':_0x5700c2[_0xf7b9('0x2e')],'type':_0x5700c2['type'][_0xf7b9('0x2f')]};});_0x1e7691[_0xf7b9('0x30')]=_[_0xf7b9('0x2b')](_0x4df3b5,'name');_0x1e7691[_0xf7b9('0x31')]=_[_0xf7b9('0x32')](_0x5c69bc['query']);_0x1e7691[_0xf7b9('0x33')]=_[_0xf7b9('0x34')](_0x1e7691[_0xf7b9('0x30')],_0x1e7691[_0xf7b9('0x31')]);_0x1db135[_0xf7b9('0x35')]=_['intersection'](_0x1e7691[_0xf7b9('0x30')],qs[_0xf7b9('0x36')](_0x5c69bc['query'][_0xf7b9('0x36')]));_0x1db135[_0xf7b9('0x35')]=_0x1db135['attributes'][_0xf7b9('0x37')]?_0x1db135[_0xf7b9('0x35')]:_0x1e7691[_0xf7b9('0x30')];if(!_0x5c69bc[_0xf7b9('0x31')][_0xf7b9('0x38')](_0xf7b9('0x39'))){_0x1db135[_0xf7b9('0x1f')]=qs[_0xf7b9('0x1f')](_0x5c69bc[_0xf7b9('0x31')][_0xf7b9('0x1f')]);_0x1db135[_0xf7b9('0x1d')]=qs[_0xf7b9('0x1d')](_0x5c69bc[_0xf7b9('0x31')]['offset']);}_0x1db135['order']=qs['sort'](_0x5c69bc['query']['sort']);_0x1db135[_0xf7b9('0x3a')]=qs['filters'](_[_0xf7b9('0x3b')](_0x5c69bc[_0xf7b9('0x31')],_0x1e7691[_0xf7b9('0x33')]),_0x4df3b5);if(_0x5c69bc[_0xf7b9('0x31')][_0xf7b9('0x3c')]){_0x1db135[_0xf7b9('0x3a')]=_['merge'](_0x1db135['where'],{'$or':_[_0xf7b9('0x2b')](_0x4df3b5,function(_0xa9d229){if(_0xa9d229['type']!==_0xf7b9('0x3d')){var _0x4a3bde={};_0x4a3bde[_0xa9d229[_0xf7b9('0x29')]]={'$like':'%'+_0x5c69bc[_0xf7b9('0x31')]['filter']+'%'};return _0x4a3bde;}})});}_0x1db135=_[_0xf7b9('0x3e')]({},_0x1db135,_0x5c69bc[_0xf7b9('0x3f')]);var _0xc9cda8={'where':_0x1db135[_0xf7b9('0x3a')]};return db[_0xf7b9('0x2c')][_0xf7b9('0x20')](_0xc9cda8)[_0xf7b9('0x26')](function(_0x4ed2b4){_0x4ab849['count']=_0x4ed2b4;if(_0x5c69bc[_0xf7b9('0x31')][_0xf7b9('0x40')]){_0x1db135['include']=[{'all':!![]}];}return db[_0xf7b9('0x2c')]['findAll'](_0x1db135);})[_0xf7b9('0x26')](function(_0x4f601e){_0x4ab849[_0xf7b9('0x41')]=_0x4f601e;return _0x4ab849;})['then'](respondWithFilteredResult(_0xec3b46,_0x1db135))[_0xf7b9('0x42')](handleError(_0xec3b46,null));};exports['show']=function(_0x2efd75,_0x39a87d){var _0x51b603={'raw':![],'where':{'id':_0x2efd75[_0xf7b9('0x43')]['id']}},_0x3db9f4={};_0x3db9f4[_0xf7b9('0x30')]=_['keys'](db[_0xf7b9('0x2c')][_0xf7b9('0x2d')]);_0x3db9f4[_0xf7b9('0x31')]=_['keys'](_0x2efd75[_0xf7b9('0x31')]);_0x3db9f4[_0xf7b9('0x33')]=_['intersection'](_0x3db9f4[_0xf7b9('0x30')],_0x3db9f4[_0xf7b9('0x31')]);_0x51b603[_0xf7b9('0x35')]=_[_0xf7b9('0x34')](_0x3db9f4[_0xf7b9('0x30')],qs[_0xf7b9('0x36')](_0x2efd75['query'][_0xf7b9('0x36')]));_0x51b603[_0xf7b9('0x35')]=_0x51b603[_0xf7b9('0x35')][_0xf7b9('0x37')]?_0x51b603[_0xf7b9('0x35')]:_0x3db9f4[_0xf7b9('0x30')];if(_0x2efd75[_0xf7b9('0x31')][_0xf7b9('0x40')]){_0x51b603[_0xf7b9('0x44')]=[{'all':!![]}];}_0x51b603=_[_0xf7b9('0x3e')]({},_0x51b603,_0x2efd75[_0xf7b9('0x3f')]);return db['IntegrationReport'][_0xf7b9('0x45')](_0x51b603)[_0xf7b9('0x26')](handleEntityNotFound(_0x39a87d,null))[_0xf7b9('0x26')](respondWithResult(_0x39a87d,null))[_0xf7b9('0x42')](handleError(_0x39a87d,null));};exports[_0xf7b9('0x46')]=function(_0x486759,_0x3f531a){return db['IntegrationReport'][_0xf7b9('0x46')](_0x486759[_0xf7b9('0x47')],{})[_0xf7b9('0x26')](respondWithResult(_0x3f531a,0xc9))[_0xf7b9('0x42')](handleError(_0x3f531a,null));};exports[_0xf7b9('0x25')]=function(_0x5b8506,_0x48dd1d){if(_0x5b8506[_0xf7b9('0x47')]['id']){delete _0x5b8506[_0xf7b9('0x47')]['id'];}return db['IntegrationReport'][_0xf7b9('0x45')]({'where':{'id':_0x5b8506[_0xf7b9('0x43')]['id']}})[_0xf7b9('0x26')](handleEntityNotFound(_0x48dd1d,null))['then'](saveUpdates(_0x5b8506[_0xf7b9('0x47')],null))[_0xf7b9('0x26')](respondWithResult(_0x48dd1d,null))['catch'](handleError(_0x48dd1d,null));};exports[_0xf7b9('0x48')]=function(_0x18790b,_0x1c28ea){return db[_0xf7b9('0x2c')][_0xf7b9('0x45')]({'where':{'id':_0x18790b[_0xf7b9('0x43')]['id']}})[_0xf7b9('0x26')](handleEntityNotFound(_0x1c28ea,null))[_0xf7b9('0x26')](removeEntity(_0x1c28ea,null))['catch'](handleError(_0x1c28ea,null));};exports[_0xf7b9('0x49')]=function(_0x3cfa40,_0x1ddd3e){return db['IntegrationReport'][_0xf7b9('0x49')]()[_0xf7b9('0x26')](respondWithResult(_0x1ddd3e,null))[_0xf7b9('0x42')](handleError(_0x1ddd3e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 637801b..dbab919 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 _0xedc8=['define','IntegrationReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a5549,_0x5b6508){var _0x205be7=function(_0x45d2d3){while(--_0x45d2d3){_0x2a5549['push'](_0x2a5549['shift']());}};_0x205be7(++_0x5b6508);}(_0xedc8,0xca));var _0x8edc=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xedc8[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x8edc('0x0'));var util=require('util');var logger=require(_0x8edc('0x1'))(_0x8edc('0x2'));var moment=require(_0x8edc('0x3'));var BPromise=require(_0x8edc('0x4'));var rp=require(_0x8edc('0x5'));var fs=require('fs');var path=require(_0x8edc('0x6'));var rimraf=require(_0x8edc('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0xffb8ef,_0x47caca){return _0xffb8ef[_0x8edc('0x8')](_0x8edc('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7ea=['report_integration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_0xa7ea,0x7f));var _0xaa7e=function(_0x331783,_0x239a94){_0x331783=_0x331783-0x0;var _0x42b3d3=_0xa7ea[_0x331783];return _0x42b3d3;};'use strict';var _=require(_0xaa7e('0x0'));var util=require(_0xaa7e('0x1'));var logger=require(_0xaa7e('0x2'))('api');var moment=require(_0xaa7e('0x3'));var BPromise=require(_0xaa7e('0x4'));var rp=require(_0xaa7e('0x5'));var fs=require('fs');var path=require(_0xaa7e('0x6'));var rimraf=require(_0xaa7e('0x7'));var config=require(_0xaa7e('0x8'));var attributes=require(_0xaa7e('0x9'));module[_0xaa7e('0xa')]=function(_0x4b7a98,_0x5efb7a){return _0x4b7a98[_0xaa7e('0xb')](_0xaa7e('0xc'),attributes,{'tableName':_0xaa7e('0xd'),'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 bb412b1..4df7796 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x1ad453,_0x79af8f){var _0x2f2761=function(_0x21df85){while(--_0x21df85){_0x1ad453['push'](_0x1ad453['shift']());}};_0x2f2761(++_0x79af8f);}(_0x2675,0x75));var _0x5267=function(_0x1af69b,_0x5578e4){_0x1af69b=_0x1af69b-0x0;var _0x3b37b4=_0x2675[_0x1af69b];return _0x3b37b4;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x572438,_0x1b94fe){var _0xc6e9a7=function(_0x5b25a7){while(--_0x5b25a7){_0x572438['push'](_0x572438['shift']());}};_0xc6e9a7(++_0x1b94fe);}(_0x5fab,0x177));var _0xb5fa=function(_0x3f57db,_0x10e075){_0x3f57db=_0x3f57db-0x0;var _0x8cc430=_0x5fab[_0x3f57db];return _0x8cc430;};'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']('IntegrationReport,\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')]('IntegrationReport,\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']('IntegrationReport,\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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 841d867..2cac7f4 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 _0x85d3=['put','/:id','update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x4c6bb3,_0x11fcd7){var _0x238d5d=function(_0x5f29eb){while(--_0x5f29eb){_0x4c6bb3['push'](_0x4c6bb3['shift']());}};_0x238d5d(++_0x11fcd7);}(_0x85d3,0x1a9));var _0x385d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85d3[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x385d('0x0'));var path=require(_0x385d('0x1'));var timeout=require(_0x385d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x385d('0x3'));var auth=require(_0x385d('0x4'));var interaction=require(_0x385d('0x5'));var config=require('../../config/environment');var controller=require(_0x385d('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x385d('0x7')]('/:id',auth[_0x385d('0x8')](),controller['show']);router[_0x385d('0x7')](_0x385d('0x9'),auth['isAuthenticated'](),controller[_0x385d('0xa')]);router['post']('/',auth[_0x385d('0x8')](),controller[_0x385d('0xb')]);router[_0x385d('0xc')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x385d('0xd')]);router[_0x385d('0xc')](_0x385d('0xe'),auth[_0x385d('0x8')](),controller[_0x385d('0xf')]);router[_0x385d('0x10')](_0x385d('0x11'),auth[_0x385d('0x8')](),controller[_0x385d('0x12')]);router['delete'](_0x385d('0x11'),auth[_0x385d('0x8')](),controller[_0x385d('0x13')]);module[_0x385d('0x14')]=router; \ No newline at end of file +var _0x82f8=['get','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','addInterval','post','/:id/sub_intervals/create_many','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x5afa3d,_0x54f4a3){var _0x539628=function(_0x3e5cfa){while(--_0x3e5cfa){_0x5afa3d['push'](_0x5afa3d['shift']());}};_0x539628(++_0x54f4a3);}(_0x82f8,0x157));var _0x882f=function(_0x37173e,_0x3d5a5c){_0x37173e=_0x37173e-0x0;var _0x28515f=_0x82f8[_0x37173e];return _0x28515f;};'use strict';var multer=require('multer');var util=require(_0x882f('0x0'));var path=require(_0x882f('0x1'));var timeout=require('connect-timeout');var express=require(_0x882f('0x2'));var router=express[_0x882f('0x3')]();var fs_extra=require(_0x882f('0x4'));var auth=require(_0x882f('0x5'));var interaction=require(_0x882f('0x6'));var config=require(_0x882f('0x7'));var controller=require(_0x882f('0x8'));router[_0x882f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x882f('0x9')](_0x882f('0xa'),auth[_0x882f('0xb')](),controller[_0x882f('0xc')]);router['get'](_0x882f('0xd'),auth['isAuthenticated'](),controller[_0x882f('0xe')]);router['post']('/',auth[_0x882f('0xb')](),controller['create']);router['post'](_0x882f('0xd'),auth[_0x882f('0xb')](),controller[_0x882f('0xf')]);router[_0x882f('0x10')](_0x882f('0x11'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x882f('0x12')](_0x882f('0xa'),auth[_0x882f('0xb')](),controller[_0x882f('0x13')]);router[_0x882f('0x14')](_0x882f('0xa'),auth[_0x882f('0xb')](),controller['destroy']);module[_0x882f('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a347762..ade10ae 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 _0x7032=['sequelize','exports','STRING'];(function(_0x515297,_0x84277){var _0x3c9e66=function(_0x1e1955){while(--_0x1e1955){_0x515297['push'](_0x515297['shift']());}};_0x3c9e66(++_0x84277);}(_0x7032,0x162));var _0x2703=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x7032[_0x13e758];return _0x5b53c3;};'use strict';var Sequelize=require(_0x2703('0x0'));module[_0x2703('0x1')]={'name':{'type':Sequelize[_0x2703('0x2')]},'description':{'type':Sequelize[_0x2703('0x2')]},'interval':{'type':Sequelize[_0x2703('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x1d59=['STRING'];(function(_0x3b7c9c,_0x3e09aa){var _0x5e397a=function(_0x41bd58){while(--_0x41bd58){_0x3b7c9c['push'](_0x3b7c9c['shift']());}};_0x5e397a(++_0x3e09aa);}(_0x1d59,0xa4));var _0x91d5=function(_0x1f68bb,_0x436ab5){_0x1f68bb=_0x1f68bb-0x0;var _0x3b3831=_0x1d59[_0x1f68bb];return _0x3b3831;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x91d5('0x0')]},'description':{'type':Sequelize[_0x91d5('0x0')]},'interval':{'type':Sequelize[_0x91d5('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f0570e5..c017a82 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 _0xcff0=['fields','attributes','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','rows','catch','show','params','length','includeAll','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','nolimit','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Intervals','end','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x3624e5,_0x512229){var _0x48cc24=function(_0xa89771){while(--_0xa89771){_0x3624e5['push'](_0x3624e5['shift']());}};_0x48cc24(++_0x512229);}(_0xcff0,0xd8));var _0x0cff=function(_0x4a344d,_0x2fec13){_0x4a344d=_0x4a344d-0x0;var _0x1b155c=_0xcff0[_0x4a344d];return _0x1b155c;};'use strict';var emlformat=require(_0x0cff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cff('0x1'));var jsonpatch=require(_0x0cff('0x2'));var rp=require(_0x0cff('0x3'));var moment=require(_0x0cff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0cff('0x5'));var util=require(_0x0cff('0x6'));var path=require(_0x0cff('0x7'));var sox=require(_0x0cff('0x8'));var csv=require('to-csv');var ejs=require(_0x0cff('0x9'));var fs=require('fs');var fs_extra=require(_0x0cff('0xa'));var _=require(_0x0cff('0xb'));var squel=require(_0x0cff('0xc'));var crypto=require(_0x0cff('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0cff('0xe'));var Papa=require(_0x0cff('0xf'));var Redis=require('ioredis');var authService=require(_0x0cff('0x10'));var qs=require(_0x0cff('0x11'));var as=require(_0x0cff('0x12'));var hardwareService=require(_0x0cff('0x13'));var logger=require(_0x0cff('0x14'))(_0x0cff('0x15'));var utils=require(_0x0cff('0x16'));var config=require(_0x0cff('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cff('0x18'))['db'];var extensions=require(_0x0cff('0x19'));function respondWithStatusCode(_0x14ee2a,_0x4b6e15){_0x4b6e15=_0x4b6e15||0xcc;return function(_0x17653f){if(_0x17653f){return _0x14ee2a['sendStatus'](_0x4b6e15);}return _0x14ee2a[_0x0cff('0x1a')](_0x4b6e15)['end']();};}function respondWithResult(_0x1bfe73,_0x17ac3a){_0x17ac3a=_0x17ac3a||0xc8;return function(_0x338d92){if(_0x338d92){return _0x1bfe73['status'](_0x17ac3a)[_0x0cff('0x1b')](_0x338d92);}};}function respondWithFilteredResult(_0x403baa,_0x28da6d){return function(_0x2be041){if(_0x2be041){var _0x1dce0a=typeof _0x28da6d[_0x0cff('0x1c')]===_0x0cff('0x1d')&&typeof _0x28da6d[_0x0cff('0x1e')]===_0x0cff('0x1d');var _0x338179=_0x2be041[_0x0cff('0x1f')];var _0x58686d=_0x1dce0a?0x0:_0x28da6d[_0x0cff('0x1c')];var _0x64bba4=_0x1dce0a?_0x2be041[_0x0cff('0x1f')]:_0x28da6d[_0x0cff('0x1c')]+_0x28da6d['limit'];var _0x16fb01;if(_0x64bba4>=_0x338179){_0x64bba4=_0x338179;_0x16fb01=0xc8;}else{_0x16fb01=0xce;}_0x403baa['status'](_0x16fb01);return _0x403baa[_0x0cff('0x20')](_0x0cff('0x21'),_0x58686d+'-'+_0x64bba4+'/'+_0x338179)[_0x0cff('0x1b')](_0x2be041);}return null;};}function patchUpdates(_0x5911de){return function(_0x2734d8){try{jsonpatch['apply'](_0x2734d8,_0x5911de,!![]);}catch(_0x1aad61){return BPromise[_0x0cff('0x22')](_0x1aad61);}return _0x2734d8['save']();};}function saveUpdates(_0x58c1b8,_0x4c9849){return function(_0x389497){if(_0x389497){return _0x389497[_0x0cff('0x23')](_0x58c1b8)[_0x0cff('0x24')](function(_0x355231){return _0x355231;});}return null;};}function removeEntity(_0x3f63aa,_0x5bccdd){return function(_0x117043){if(_0x117043){return _0x117043[_0x0cff('0x25')]()[_0x0cff('0x24')](function(){var _0x515c78=_0x117043[_0x0cff('0x26')]({'plain':!![]});var _0x21ce8e=_0x0cff('0x27');return db['UserProfileResource'][_0x0cff('0x25')]({'where':{'type':_0x21ce8e,'resourceId':_0x515c78['id']}})[_0x0cff('0x24')](function(){return _0x117043;});})[_0x0cff('0x24')](function(){_0x3f63aa[_0x0cff('0x1a')](0xcc)[_0x0cff('0x28')]();});}};}function handleEntityNotFound(_0x563794,_0x59cffc){return function(_0x9c45b9){if(!_0x9c45b9){_0x563794['sendStatus'](0x194);}return _0x9c45b9;};}function handleError(_0x3494bd,_0x55cbe4){_0x55cbe4=_0x55cbe4||0x1f4;return function(_0x51f934){logger[_0x0cff('0x29')](_0x51f934['stack']);if(_0x51f934[_0x0cff('0x2a')]){delete _0x51f934[_0x0cff('0x2a')];}_0x3494bd[_0x0cff('0x1a')](_0x55cbe4)['send'](_0x51f934);};}exports[_0x0cff('0x2b')]=function(_0x1e52a1,_0x23b76c){var _0x33310d={},_0x4f6b01={},_0x25b228={'count':0x0,'rows':[]};var _0x4c603b=_['map'](db['Interval'][_0x0cff('0x2c')],function(_0x9bf11e){return{'name':_0x9bf11e[_0x0cff('0x2d')],'type':_0x9bf11e[_0x0cff('0x2e')][_0x0cff('0x2f')]};});_0x4f6b01[_0x0cff('0x30')]=_[_0x0cff('0x31')](_0x4c603b,_0x0cff('0x2a'));_0x4f6b01[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x1e52a1[_0x0cff('0x32')]);_0x4f6b01[_0x0cff('0x34')]=_[_0x0cff('0x35')](_0x4f6b01[_0x0cff('0x30')],_0x4f6b01['query']);_0x33310d['attributes']=_['intersection'](_0x4f6b01['model'],qs[_0x0cff('0x36')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x36')]));_0x33310d[_0x0cff('0x37')]=_0x33310d['attributes']['length']?_0x33310d[_0x0cff('0x37')]:_0x4f6b01['model'];if(!_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x38')]('nolimit')){_0x33310d['limit']=qs[_0x0cff('0x1e')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x1e')]);_0x33310d['offset']=qs[_0x0cff('0x1c')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x1c')]);}_0x33310d[_0x0cff('0x39')]=qs[_0x0cff('0x3a')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x3a')]);_0x33310d['where']=qs[_0x0cff('0x34')](_[_0x0cff('0x3b')](_0x1e52a1[_0x0cff('0x32')],_0x4f6b01[_0x0cff('0x34')]),_0x4c603b);if(_0x1e52a1[_0x0cff('0x32')]['filter']){_0x33310d[_0x0cff('0x3c')]=_['merge'](_0x33310d['where'],{'$or':_['map'](_0x4c603b,function(_0x26b12a){if(_0x26b12a[_0x0cff('0x2e')]!==_0x0cff('0x3d')){var _0x1183d5={};_0x1183d5[_0x26b12a[_0x0cff('0x2a')]]={'$like':'%'+_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x3e')]+'%'};return _0x1183d5;}})});}_0x33310d=_[_0x0cff('0x3f')]({},_0x33310d,_0x1e52a1[_0x0cff('0x40')]);var _0x2271c1={'where':_0x33310d['where']};return db[_0x0cff('0x41')][_0x0cff('0x1f')](_0x2271c1)[_0x0cff('0x24')](function(_0x1d5a78){_0x25b228[_0x0cff('0x1f')]=_0x1d5a78;if(_0x1e52a1['query']['includeAll']){_0x33310d[_0x0cff('0x42')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x33310d);})[_0x0cff('0x24')](function(_0x37b565){_0x25b228[_0x0cff('0x43')]=_0x37b565;return _0x25b228;})[_0x0cff('0x24')](respondWithFilteredResult(_0x23b76c,_0x33310d))[_0x0cff('0x44')](handleError(_0x23b76c,null));};exports[_0x0cff('0x45')]=function(_0x406553,_0x1802e0){var _0xb7a041={'raw':!![],'where':{'id':_0x406553[_0x0cff('0x46')]['id']}},_0x69607f={};_0x69607f[_0x0cff('0x30')]=_[_0x0cff('0x33')](db['Interval'][_0x0cff('0x2c')]);_0x69607f[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x406553[_0x0cff('0x32')]);_0x69607f[_0x0cff('0x34')]=_[_0x0cff('0x35')](_0x69607f[_0x0cff('0x30')],_0x69607f[_0x0cff('0x32')]);_0xb7a041[_0x0cff('0x37')]=_[_0x0cff('0x35')](_0x69607f[_0x0cff('0x30')],qs[_0x0cff('0x36')](_0x406553[_0x0cff('0x32')][_0x0cff('0x36')]));_0xb7a041[_0x0cff('0x37')]=_0xb7a041[_0x0cff('0x37')][_0x0cff('0x47')]?_0xb7a041[_0x0cff('0x37')]:_0x69607f[_0x0cff('0x30')];if(_0x406553[_0x0cff('0x32')][_0x0cff('0x48')]){_0xb7a041['include']=[{'all':!![]}];}_0xb7a041=_['merge']({},_0xb7a041,_0x406553[_0x0cff('0x40')]);return db['Interval'][_0x0cff('0x49')](_0xb7a041)[_0x0cff('0x24')](handleEntityNotFound(_0x1802e0,null))[_0x0cff('0x24')](respondWithResult(_0x1802e0,null))[_0x0cff('0x44')](handleError(_0x1802e0,null));};exports[_0x0cff('0x4a')]=function(_0x48f965,_0x496a28){return db[_0x0cff('0x41')][_0x0cff('0x4a')](_0x48f965['body'],{})[_0x0cff('0x24')](function(_0x43976a){var _0x54aeae=_0x48f965[_0x0cff('0x4b')][_0x0cff('0x26')]({'plain':!![]});if(!_0x54aeae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54aeae['role']===_0x0cff('0x4b')){var _0x273d02=_0x43976a[_0x0cff('0x26')]({'plain':!![]});var _0x1f0aa7=_0x0cff('0x27');return db[_0x0cff('0x4c')][_0x0cff('0x49')]({'where':{'name':_0x1f0aa7,'userProfileId':_0x54aeae['userProfileId']},'raw':!![]})[_0x0cff('0x24')](function(_0x319ca9){if(_0x319ca9&&_0x319ca9[_0x0cff('0x4d')]===0x0){return db[_0x0cff('0x4e')][_0x0cff('0x4a')]({'name':_0x273d02[_0x0cff('0x2a')],'resourceId':_0x273d02['id'],'type':_0x319ca9[_0x0cff('0x2a')],'sectionId':_0x319ca9['id']},{})[_0x0cff('0x24')](function(){return _0x43976a;});}else{return _0x43976a;}})[_0x0cff('0x44')](function(_0x2638a9){logger[_0x0cff('0x29')](_0x0cff('0x4f'),_0x2638a9);throw _0x2638a9;});}return _0x43976a;})[_0x0cff('0x24')](respondWithResult(_0x496a28,0xc9))[_0x0cff('0x44')](handleError(_0x496a28,null));};exports[_0x0cff('0x23')]=function(_0x5e2d24,_0x59065c){if(_0x5e2d24[_0x0cff('0x50')]['id']){delete _0x5e2d24['body']['id'];}return db['Interval'][_0x0cff('0x49')]({'where':{'id':_0x5e2d24[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x59065c,null))[_0x0cff('0x24')](saveUpdates(_0x5e2d24[_0x0cff('0x50')],null))['then'](respondWithResult(_0x59065c,null))[_0x0cff('0x44')](handleError(_0x59065c,null));};exports[_0x0cff('0x25')]=function(_0x575a4f,_0x2ede13){return db[_0x0cff('0x41')]['find']({'where':{'id':_0x575a4f[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x2ede13,null))[_0x0cff('0x24')](removeEntity(_0x2ede13,null))[_0x0cff('0x44')](handleError(_0x2ede13,null));};exports[_0x0cff('0x51')]=function(_0x18d75a,_0x48ec07,_0x981cc6){if(_0x18d75a['body']['id']){delete _0x18d75a['body']['id'];}return db[_0x0cff('0x41')][_0x0cff('0x49')]({'where':{'id':_0x18d75a[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x48ec07,null))[_0x0cff('0x24')](function(_0x2c1c42){if(_0x2c1c42){_0x18d75a[_0x0cff('0x50')][_0x0cff('0x52')]=_0x2c1c42['id'];return db['Interval'][_0x0cff('0x4a')](_0x18d75a[_0x0cff('0x50')]);}})[_0x0cff('0x24')](respondWithResult(_0x48ec07,null))[_0x0cff('0x44')](handleError(_0x48ec07,null));};exports[_0x0cff('0x53')]=function(_0x55e39e,_0x37e9e0,_0x40ab84){var _0x3af6e3={};var _0x42a5b0={};var _0x48d3df;var _0x15ab59;return db['Interval']['findOne']({'where':{'id':_0x55e39e[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x37e9e0,null))[_0x0cff('0x24')](function(_0x3b8887){if(_0x3b8887){_0x48d3df=_0x3b8887;_0x42a5b0[_0x0cff('0x30')]=_['keys'](db[_0x0cff('0x41')]['rawAttributes']);_0x42a5b0[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x55e39e[_0x0cff('0x32')]);_0x42a5b0['filters']=_['intersection'](_0x42a5b0['model'],_0x42a5b0[_0x0cff('0x32')]);_0x3af6e3[_0x0cff('0x37')]=_[_0x0cff('0x35')](_0x42a5b0[_0x0cff('0x30')],qs[_0x0cff('0x36')](_0x55e39e['query'][_0x0cff('0x36')]));_0x3af6e3[_0x0cff('0x37')]=_0x3af6e3[_0x0cff('0x37')]['length']?_0x3af6e3[_0x0cff('0x37')]:_0x42a5b0[_0x0cff('0x30')];_0x3af6e3[_0x0cff('0x39')]=qs[_0x0cff('0x3a')](_0x55e39e['query'][_0x0cff('0x3a')]);_0x3af6e3[_0x0cff('0x3c')]=qs['filters'](_[_0x0cff('0x3b')](_0x55e39e[_0x0cff('0x32')],_0x42a5b0[_0x0cff('0x34')]));if(_0x55e39e[_0x0cff('0x32')][_0x0cff('0x3e')]){_0x3af6e3['where']=_[_0x0cff('0x3f')](_0x3af6e3[_0x0cff('0x3c')],{'$or':_['map'](_0x3af6e3[_0x0cff('0x37')],function(_0x40f145){var _0x2fb44e={};_0x2fb44e[_0x40f145]={'$like':'%'+_0x55e39e[_0x0cff('0x32')][_0x0cff('0x3e')]+'%'};return _0x2fb44e;})});}_0x3af6e3=_[_0x0cff('0x3f')]({},_0x3af6e3,_0x55e39e['options']);return _0x48d3df[_0x0cff('0x53')](_0x3af6e3);}})[_0x0cff('0x24')](function(_0x597a70){if(_0x597a70){_0x15ab59=_0x597a70['length'];if(!_0x55e39e['query'][_0x0cff('0x38')](_0x0cff('0x54'))){_0x3af6e3[_0x0cff('0x1e')]=qs['limit'](_0x55e39e[_0x0cff('0x32')][_0x0cff('0x1e')]);_0x3af6e3[_0x0cff('0x1c')]=qs[_0x0cff('0x1c')](_0x55e39e[_0x0cff('0x32')][_0x0cff('0x1c')]);}return _0x48d3df['getIntervals'](_0x3af6e3);}})[_0x0cff('0x24')](function(_0xff916d){if(_0xff916d){return _0xff916d?{'count':_0x15ab59,'rows':_0xff916d}:null;}})[_0x0cff('0x24')](respondWithResult(_0x37e9e0,null))[_0x0cff('0x44')](handleError(_0x37e9e0,null));};exports[_0x0cff('0x55')]=function(_0x59f7b8,_0x2b749e,_0x2adaf1){return db['Interval']['findOne']({'where':{'id':_0x59f7b8['params']['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x2b749e,null))[_0x0cff('0x24')](function(_0x410cf6){if(_0x410cf6){return db[_0x0cff('0x56')][_0x0cff('0x57')](function(_0x21c776){return db[_0x0cff('0x41')][_0x0cff('0x25')]({'where':{'IntervalId':_0x59f7b8[_0x0cff('0x46')]['id']},'transaction':_0x21c776})[_0x0cff('0x24')](function(_0x4fd25c){var _0x48d4a0=_[_0x0cff('0x31')](_0x59f7b8[_0x0cff('0x50')],function(_0x48554d){delete _0x48554d['id'];_0x48554d[_0x0cff('0x52')]=_0x59f7b8[_0x0cff('0x46')]['id'];return _0x48554d;});return db[_0x0cff('0x41')][_0x0cff('0x58')](_0x48d4a0,{'transaction':_0x21c776});});})['then'](function(){return db[_0x0cff('0x41')][_0x0cff('0x59')]({'where':{'IntervalId':_0x59f7b8[_0x0cff('0x46')]['id']}});});}})[_0x0cff('0x24')](respondWithResult(_0x2b749e,null))[_0x0cff('0x44')](handleError(_0x2b749e,null));}; \ No newline at end of file +var _0x1b88=['limit','set','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','Interval','rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','nolimit','addIntervals','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1b88,0x1a2));var _0x81b8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1b88[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x81b8('0x0'));var rimraf=require(_0x81b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x81b8('0x2'));var moment=require('moment');var BPromise=require(_0x81b8('0x3'));var Mustache=require('mustache');var util=require(_0x81b8('0x4'));var path=require(_0x81b8('0x5'));var sox=require(_0x81b8('0x6'));var csv=require(_0x81b8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81b8('0x8'));var _=require('lodash');var squel=require(_0x81b8('0x9'));var crypto=require(_0x81b8('0xa'));var jsforce=require(_0x81b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x81b8('0x7'));var querystring=require(_0x81b8('0xc'));var Papa=require(_0x81b8('0xd'));var Redis=require(_0x81b8('0xe'));var authService=require(_0x81b8('0xf'));var qs=require(_0x81b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81b8('0x11'));var logger=require(_0x81b8('0x12'))(_0x81b8('0x13'));var utils=require(_0x81b8('0x14'));var config=require(_0x81b8('0x15'));var licenseUtil=require(_0x81b8('0x16'));var db=require(_0x81b8('0x17'))['db'];var extensions=require(_0x81b8('0x18'));function respondWithStatusCode(_0x49b423,_0x5228ac){_0x5228ac=_0x5228ac||0xcc;return function(_0x479558){if(_0x479558){return _0x49b423[_0x81b8('0x19')](_0x5228ac);}return _0x49b423[_0x81b8('0x1a')](_0x5228ac)[_0x81b8('0x1b')]();};}function respondWithResult(_0x4e130a,_0x2e3aeb){_0x2e3aeb=_0x2e3aeb||0xc8;return function(_0x572d4a){if(_0x572d4a){return _0x4e130a[_0x81b8('0x1a')](_0x2e3aeb)[_0x81b8('0x1c')](_0x572d4a);}};}function respondWithFilteredResult(_0x2f7385,_0x32f55a){return function(_0x139b27){if(_0x139b27){var _0x554cc0=typeof _0x32f55a[_0x81b8('0x1d')]===_0x81b8('0x1e')&&typeof _0x32f55a['limit']===_0x81b8('0x1e');var _0x16ab9c=_0x139b27[_0x81b8('0x1f')];var _0x4b3e29=_0x554cc0?0x0:_0x32f55a[_0x81b8('0x1d')];var _0x428fe4=_0x554cc0?_0x139b27[_0x81b8('0x1f')]:_0x32f55a[_0x81b8('0x1d')]+_0x32f55a[_0x81b8('0x20')];var _0x38917f;if(_0x428fe4>=_0x16ab9c){_0x428fe4=_0x16ab9c;_0x38917f=0xc8;}else{_0x38917f=0xce;}_0x2f7385[_0x81b8('0x1a')](_0x38917f);return _0x2f7385[_0x81b8('0x21')]('Content-Range',_0x4b3e29+'-'+_0x428fe4+'/'+_0x16ab9c)[_0x81b8('0x1c')](_0x139b27);}return null;};}function patchUpdates(_0x2c4e4d){return function(_0x2438c6){try{jsonpatch[_0x81b8('0x22')](_0x2438c6,_0x2c4e4d,!![]);}catch(_0x102d87){return BPromise[_0x81b8('0x23')](_0x102d87);}return _0x2438c6[_0x81b8('0x24')]();};}function saveUpdates(_0x5a9aea,_0x147014){return function(_0x5bf187){if(_0x5bf187){return _0x5bf187[_0x81b8('0x25')](_0x5a9aea)['then'](function(_0x38939a){return _0x38939a;});}return null;};}function removeEntity(_0x15174b,_0xa59f59){return function(_0x114c57){if(_0x114c57){return _0x114c57[_0x81b8('0x26')]()[_0x81b8('0x27')](function(){var _0x52de24=_0x114c57[_0x81b8('0x28')]({'plain':!![]});var _0x591dc0='Intervals';return db[_0x81b8('0x29')][_0x81b8('0x26')]({'where':{'type':_0x591dc0,'resourceId':_0x52de24['id']}})[_0x81b8('0x27')](function(){return _0x114c57;});})['then'](function(){_0x15174b[_0x81b8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa986b7,_0x20137b){return function(_0x768af6){if(!_0x768af6){_0xa986b7[_0x81b8('0x19')](0x194);}return _0x768af6;};}function handleError(_0x4ccf79,_0x4e76ad){_0x4e76ad=_0x4e76ad||0x1f4;return function(_0x39f9f9){logger[_0x81b8('0x2a')](_0x39f9f9[_0x81b8('0x2b')]);if(_0x39f9f9[_0x81b8('0x2c')]){delete _0x39f9f9[_0x81b8('0x2c')];}_0x4ccf79['status'](_0x4e76ad)['send'](_0x39f9f9);};}exports['index']=function(_0x4c61c7,_0x20e4b9){var _0x3d8f02={},_0x295bdb={},_0x46a90d={'count':0x0,'rows':[]};var _0xdeb10d=_['map'](db[_0x81b8('0x2d')][_0x81b8('0x2e')],function(_0x430a11){return{'name':_0x430a11['fieldName'],'type':_0x430a11[_0x81b8('0x2f')][_0x81b8('0x30')]};});_0x295bdb[_0x81b8('0x31')]=_[_0x81b8('0x32')](_0xdeb10d,'name');_0x295bdb['query']=_[_0x81b8('0x33')](_0x4c61c7[_0x81b8('0x34')]);_0x295bdb['filters']=_[_0x81b8('0x35')](_0x295bdb['model'],_0x295bdb[_0x81b8('0x34')]);_0x3d8f02[_0x81b8('0x36')]=_[_0x81b8('0x35')](_0x295bdb[_0x81b8('0x31')],qs['fields'](_0x4c61c7[_0x81b8('0x34')][_0x81b8('0x37')]));_0x3d8f02[_0x81b8('0x36')]=_0x3d8f02[_0x81b8('0x36')][_0x81b8('0x38')]?_0x3d8f02[_0x81b8('0x36')]:_0x295bdb['model'];if(!_0x4c61c7[_0x81b8('0x34')]['hasOwnProperty']('nolimit')){_0x3d8f02[_0x81b8('0x20')]=qs[_0x81b8('0x20')](_0x4c61c7[_0x81b8('0x34')][_0x81b8('0x20')]);_0x3d8f02[_0x81b8('0x1d')]=qs[_0x81b8('0x1d')](_0x4c61c7[_0x81b8('0x34')][_0x81b8('0x1d')]);}_0x3d8f02['order']=qs[_0x81b8('0x39')](_0x4c61c7[_0x81b8('0x34')][_0x81b8('0x39')]);_0x3d8f02['where']=qs[_0x81b8('0x3a')](_[_0x81b8('0x3b')](_0x4c61c7['query'],_0x295bdb[_0x81b8('0x3a')]),_0xdeb10d);if(_0x4c61c7['query'][_0x81b8('0x3c')]){_0x3d8f02['where']=_[_0x81b8('0x3d')](_0x3d8f02['where'],{'$or':_[_0x81b8('0x32')](_0xdeb10d,function(_0x4ef021){if(_0x4ef021[_0x81b8('0x2f')]!==_0x81b8('0x3e')){var _0x5a63c5={};_0x5a63c5[_0x4ef021['name']]={'$like':'%'+_0x4c61c7[_0x81b8('0x34')]['filter']+'%'};return _0x5a63c5;}})});}_0x3d8f02=_[_0x81b8('0x3d')]({},_0x3d8f02,_0x4c61c7['options']);var _0x99023a={'where':_0x3d8f02[_0x81b8('0x3f')]};return db[_0x81b8('0x2d')][_0x81b8('0x1f')](_0x99023a)[_0x81b8('0x27')](function(_0x189ccd){_0x46a90d[_0x81b8('0x1f')]=_0x189ccd;if(_0x4c61c7[_0x81b8('0x34')][_0x81b8('0x40')]){_0x3d8f02[_0x81b8('0x41')]=[{'all':!![]}];}return db[_0x81b8('0x2d')][_0x81b8('0x42')](_0x3d8f02);})[_0x81b8('0x27')](function(_0x3c5c83){_0x46a90d[_0x81b8('0x43')]=_0x3c5c83;return _0x46a90d;})[_0x81b8('0x27')](respondWithFilteredResult(_0x20e4b9,_0x3d8f02))[_0x81b8('0x44')](handleError(_0x20e4b9,null));};exports[_0x81b8('0x45')]=function(_0x7e883e,_0x26d07e){var _0x20fac8={'raw':!![],'where':{'id':_0x7e883e[_0x81b8('0x46')]['id']}},_0x13e4fb={};_0x13e4fb[_0x81b8('0x31')]=_[_0x81b8('0x33')](db[_0x81b8('0x2d')][_0x81b8('0x2e')]);_0x13e4fb[_0x81b8('0x34')]=_[_0x81b8('0x33')](_0x7e883e['query']);_0x13e4fb[_0x81b8('0x3a')]=_[_0x81b8('0x35')](_0x13e4fb['model'],_0x13e4fb['query']);_0x20fac8[_0x81b8('0x36')]=_[_0x81b8('0x35')](_0x13e4fb[_0x81b8('0x31')],qs[_0x81b8('0x37')](_0x7e883e['query'][_0x81b8('0x37')]));_0x20fac8['attributes']=_0x20fac8['attributes'][_0x81b8('0x38')]?_0x20fac8[_0x81b8('0x36')]:_0x13e4fb[_0x81b8('0x31')];if(_0x7e883e[_0x81b8('0x34')][_0x81b8('0x40')]){_0x20fac8[_0x81b8('0x41')]=[{'all':!![]}];}_0x20fac8=_[_0x81b8('0x3d')]({},_0x20fac8,_0x7e883e[_0x81b8('0x47')]);return db[_0x81b8('0x2d')][_0x81b8('0x48')](_0x20fac8)['then'](handleEntityNotFound(_0x26d07e,null))[_0x81b8('0x27')](respondWithResult(_0x26d07e,null))[_0x81b8('0x44')](handleError(_0x26d07e,null));};exports[_0x81b8('0x49')]=function(_0xc176f9,_0x882d3a){return db[_0x81b8('0x2d')][_0x81b8('0x49')](_0xc176f9[_0x81b8('0x4a')],{})[_0x81b8('0x27')](function(_0x3ccbe5){var _0x18bca7=_0xc176f9[_0x81b8('0x4b')][_0x81b8('0x28')]({'plain':!![]});if(!_0x18bca7)throw new Error(_0x81b8('0x4c'));if(_0x18bca7[_0x81b8('0x4d')]===_0x81b8('0x4b')){var _0x1d25f3=_0x3ccbe5[_0x81b8('0x28')]({'plain':!![]});var _0x58f57c=_0x81b8('0x4e');return db[_0x81b8('0x4f')][_0x81b8('0x48')]({'where':{'name':_0x58f57c,'userProfileId':_0x18bca7[_0x81b8('0x50')]},'raw':!![]})[_0x81b8('0x27')](function(_0xefdd82){if(_0xefdd82&&_0xefdd82[_0x81b8('0x51')]===0x0){return db[_0x81b8('0x29')][_0x81b8('0x49')]({'name':_0x1d25f3['name'],'resourceId':_0x1d25f3['id'],'type':_0xefdd82['name'],'sectionId':_0xefdd82['id']},{})[_0x81b8('0x27')](function(){return _0x3ccbe5;});}else{return _0x3ccbe5;}})[_0x81b8('0x44')](function(_0xdd2f79){logger[_0x81b8('0x2a')](_0x81b8('0x52'),_0xdd2f79);throw _0xdd2f79;});}return _0x3ccbe5;})[_0x81b8('0x27')](respondWithResult(_0x882d3a,0xc9))[_0x81b8('0x44')](handleError(_0x882d3a,null));};exports[_0x81b8('0x25')]=function(_0x5e2ddc,_0x264052){if(_0x5e2ddc['body']['id']){delete _0x5e2ddc[_0x81b8('0x4a')]['id'];}return db[_0x81b8('0x2d')]['find']({'where':{'id':_0x5e2ddc['params']['id']}})[_0x81b8('0x27')](handleEntityNotFound(_0x264052,null))[_0x81b8('0x27')](saveUpdates(_0x5e2ddc[_0x81b8('0x4a')],null))[_0x81b8('0x27')](respondWithResult(_0x264052,null))[_0x81b8('0x44')](handleError(_0x264052,null));};exports[_0x81b8('0x26')]=function(_0x55f1d2,_0x2f424f){return db['Interval'][_0x81b8('0x48')]({'where':{'id':_0x55f1d2[_0x81b8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f424f,null))[_0x81b8('0x27')](removeEntity(_0x2f424f,null))['catch'](handleError(_0x2f424f,null));};exports[_0x81b8('0x53')]=function(_0x223372,_0x4a90fe,_0x5029ac){if(_0x223372['body']['id']){delete _0x223372[_0x81b8('0x4a')]['id'];}return db[_0x81b8('0x2d')][_0x81b8('0x48')]({'where':{'id':_0x223372['params']['id']}})[_0x81b8('0x27')](handleEntityNotFound(_0x4a90fe,null))[_0x81b8('0x27')](function(_0x5900c3){if(_0x5900c3){_0x223372[_0x81b8('0x4a')][_0x81b8('0x54')]=_0x5900c3['id'];return db[_0x81b8('0x2d')][_0x81b8('0x49')](_0x223372[_0x81b8('0x4a')]);}})[_0x81b8('0x27')](respondWithResult(_0x4a90fe,null))[_0x81b8('0x44')](handleError(_0x4a90fe,null));};exports[_0x81b8('0x55')]=function(_0x3ddba2,_0x457016,_0x400217){var _0x284d81={};var _0x21cb96={};var _0x5989b1;var _0x405ff4;return db['Interval'][_0x81b8('0x56')]({'where':{'id':_0x3ddba2[_0x81b8('0x46')]['id']}})[_0x81b8('0x27')](handleEntityNotFound(_0x457016,null))[_0x81b8('0x27')](function(_0x45f039){if(_0x45f039){_0x5989b1=_0x45f039;_0x21cb96[_0x81b8('0x31')]=_[_0x81b8('0x33')](db[_0x81b8('0x2d')][_0x81b8('0x2e')]);_0x21cb96[_0x81b8('0x34')]=_[_0x81b8('0x33')](_0x3ddba2[_0x81b8('0x34')]);_0x21cb96[_0x81b8('0x3a')]=_[_0x81b8('0x35')](_0x21cb96['model'],_0x21cb96[_0x81b8('0x34')]);_0x284d81[_0x81b8('0x36')]=_[_0x81b8('0x35')](_0x21cb96['model'],qs[_0x81b8('0x37')](_0x3ddba2[_0x81b8('0x34')]['fields']));_0x284d81[_0x81b8('0x36')]=_0x284d81[_0x81b8('0x36')][_0x81b8('0x38')]?_0x284d81[_0x81b8('0x36')]:_0x21cb96[_0x81b8('0x31')];_0x284d81['order']=qs[_0x81b8('0x39')](_0x3ddba2['query']['sort']);_0x284d81['where']=qs[_0x81b8('0x3a')](_[_0x81b8('0x3b')](_0x3ddba2['query'],_0x21cb96[_0x81b8('0x3a')]));if(_0x3ddba2[_0x81b8('0x34')][_0x81b8('0x3c')]){_0x284d81['where']=_[_0x81b8('0x3d')](_0x284d81['where'],{'$or':_[_0x81b8('0x32')](_0x284d81['attributes'],function(_0x2f2437){var _0x1965f7={};_0x1965f7[_0x2f2437]={'$like':'%'+_0x3ddba2[_0x81b8('0x34')]['filter']+'%'};return _0x1965f7;})});}_0x284d81=_[_0x81b8('0x3d')]({},_0x284d81,_0x3ddba2[_0x81b8('0x47')]);return _0x5989b1[_0x81b8('0x55')](_0x284d81);}})[_0x81b8('0x27')](function(_0x25c811){if(_0x25c811){_0x405ff4=_0x25c811[_0x81b8('0x38')];if(!_0x3ddba2[_0x81b8('0x34')][_0x81b8('0x57')](_0x81b8('0x58'))){_0x284d81[_0x81b8('0x20')]=qs[_0x81b8('0x20')](_0x3ddba2['query']['limit']);_0x284d81[_0x81b8('0x1d')]=qs['offset'](_0x3ddba2[_0x81b8('0x34')][_0x81b8('0x1d')]);}return _0x5989b1[_0x81b8('0x55')](_0x284d81);}})['then'](function(_0x53409e){if(_0x53409e){return _0x53409e?{'count':_0x405ff4,'rows':_0x53409e}:null;}})[_0x81b8('0x27')](respondWithResult(_0x457016,null))[_0x81b8('0x44')](handleError(_0x457016,null));};exports[_0x81b8('0x59')]=function(_0xfcb707,_0x4b45c5,_0x154cc4){return db[_0x81b8('0x2d')]['findOne']({'where':{'id':_0xfcb707[_0x81b8('0x46')]['id']}})[_0x81b8('0x27')](handleEntityNotFound(_0x4b45c5,null))[_0x81b8('0x27')](function(_0x5d0e53){if(_0x5d0e53){return db['sequelize']['transaction'](function(_0xc20f7f){return db['Interval'][_0x81b8('0x26')]({'where':{'IntervalId':_0xfcb707['params']['id']},'transaction':_0xc20f7f})[_0x81b8('0x27')](function(_0x366c07){var _0x53e3a5=_[_0x81b8('0x32')](_0xfcb707[_0x81b8('0x4a')],function(_0x20fc6a){delete _0x20fc6a['id'];_0x20fc6a[_0x81b8('0x54')]=_0xfcb707[_0x81b8('0x46')]['id'];return _0x20fc6a;});return db[_0x81b8('0x2d')]['bulkCreate'](_0x53e3a5,{'transaction':_0xc20f7f});});})['then'](function(){return db['Interval'][_0x81b8('0x42')]({'where':{'IntervalId':_0xfcb707[_0x81b8('0x46')]['id']}});});}})[_0x81b8('0x27')](respondWithResult(_0x4b45c5,null))[_0x81b8('0x44')](handleError(_0x4b45c5,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index baa5db9..bdf96a2 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 _0x05a4=['then','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','iftime','Interval','rewrite','string','interval','getIntervals'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x05a4,0x12c));var _0x405a=function(_0x222a68,_0x22090d){_0x222a68=_0x222a68-0x0;var _0x3d8bbc=_0x05a4[_0x222a68];return _0x3d8bbc;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x405a('0x0'));var iftime=require(_0x405a('0x1'))[_0x405a('0x2')];module['exports']=function(_0x2c5e50){return _0x2c5e50['define'](_0x405a('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x271772){extensions[_0x405a('0x4')](_0x2c5e50,_0x271772);},'afterBulkCreate':function(_0x15670f,_0x4f8404,_0x342f59){_0x342f59();extensions[_0x405a('0x4')](_0x2c5e50,_0x15670f[0x0]);},'afterUpdate':function(_0x5472a9){extensions[_0x405a('0x4')](_0x2c5e50,_0x5472a9);},'afterDestroy':function(_0x327c97){extensions[_0x405a('0x4')](_0x2c5e50,_0x327c97);}},'instanceMethods':{'ifTime':function(_0x43535b=undefined,_0xfc07a7=new Date()){if(typeof this['interval']===_0x405a('0x5')){return iftime(this[_0x405a('0x6')],_0x43535b,_0xfc07a7);}else{return this[_0x405a('0x7')]()[_0x405a('0x8')](function(_0x28c9f1){return Promise['all'](_0x28c9f1['map'](function(_0x31fded){return _0x31fded[_0x405a('0x9')](_0x43535b,_0xfc07a7);}));})[_0x405a('0x8')](function(_0x26946d){return _0x26946d[_0x405a('0xa')](function(_0x81a7e5,_0x56c0cb){return _0x81a7e5||_0x56c0cb;},![]);});}}}});}; \ No newline at end of file +var _0xc3e4=['then','all','map','ifTime','reduce','../../components/extensions/rewrite','iftime','define','tools_intervals','rewrite','string','interval'];(function(_0x2124be,_0x199834){var _0x5f3dad=function(_0x15d9e0){while(--_0x15d9e0){_0x2124be['push'](_0x2124be['shift']());}};_0x5f3dad(++_0x199834);}(_0xc3e4,0x179));var _0x4c3e=function(_0x571fba,_0x496bac){_0x571fba=_0x571fba-0x0;var _0x5b356b=_0xc3e4[_0x571fba];return _0x5b356b;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x4c3e('0x0'));var iftime=require('../../utils/iftime')[_0x4c3e('0x1')];module['exports']=function(_0x145455){return _0x145455[_0x4c3e('0x2')]('Interval',attributes,{'tableName':_0x4c3e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x87a751){extensions[_0x4c3e('0x4')](_0x145455,_0x87a751);},'afterBulkCreate':function(_0x3999a3,_0x32339d,_0x5d5c37){_0x5d5c37();extensions[_0x4c3e('0x4')](_0x145455,_0x3999a3[0x0]);},'afterUpdate':function(_0xa11ab3){extensions['rewrite'](_0x145455,_0xa11ab3);},'afterDestroy':function(_0x4c32eb){extensions[_0x4c3e('0x4')](_0x145455,_0x4c32eb);}},'instanceMethods':{'ifTime':function(_0x1a4602=undefined,_0x4f2f80=new Date()){if(typeof this['interval']===_0x4c3e('0x5')){return iftime(this[_0x4c3e('0x6')],_0x1a4602,_0x4f2f80);}else{return this['getIntervals']()[_0x4c3e('0x7')](function(_0x4ef3bd){return Promise[_0x4c3e('0x8')](_0x4ef3bd[_0x4c3e('0x9')](function(_0x5e6637){return _0x5e6637[_0x4c3e('0xa')](_0x1a4602,_0x4f2f80);}));})[_0x4c3e('0x7')](function(_0x50ec83){return _0x50ec83[_0x4c3e('0xb')](function(_0x5f2b75,_0xd37b4f){return _0x5f2b75||_0xd37b4f;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 10e0e76..c6c8c20 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 _0x1432=['debug','all','ifTime','reduce','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','isArray','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','attributes','limit','map','include','model','then','stringify','catch','message','error','ShowInterval','find','where','info'];(function(_0x3d075a,_0x507f04){var _0x418be1=function(_0x19c75b){while(--_0x19c75b){_0x3d075a['push'](_0x3d075a['shift']());}};_0x418be1(++_0x507f04);}(_0x1432,0xea));var _0x2143=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x1432[_0xb24a3e];return _0x4038d7;};'use strict';var _=require('lodash');var util=require(_0x2143('0x0'));var db=require(_0x2143('0x1'))['db'];var iftime=require(_0x2143('0x2'))[_0x2143('0x3')];var logger=require('../../config/logger')(_0x2143('0x4'));exports[_0x2143('0x5')]=function(_0x366b87){var _0x47d4fe=this;return new Promise(function(_0x1d7bfb,_0x92596){return db[_0x2143('0x6')][_0x2143('0x7')]({'raw':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')][_0x2143('0x9')]===undefined?!![]:![]:!![],'where':_0x366b87[_0x2143('0x8')]?_0x366b87['options']['where']||null:null,'attributes':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')][_0x2143('0xa')]||null:null,'limit':_0x366b87[_0x2143('0x8')]?_0x366b87['options'][_0x2143('0xb')]||null:null,'include':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')]['include']?_[_0x2143('0xc')](_0x366b87['options'][_0x2143('0xd')],function(_0x55e07f){return{'model':db[_0x55e07f[_0x2143('0xe')]],'as':_0x55e07f['as'],'attributes':_0x55e07f['attributes'],'include':_0x55e07f[_0x2143('0xd')]?_[_0x2143('0xc')](_0x55e07f[_0x2143('0xd')],function(_0x232d72){return{'model':db[_0x232d72[_0x2143('0xe')]],'as':_0x232d72['as'],'attributes':_0x232d72[_0x2143('0xa')],'include':_0x232d72[_0x2143('0xd')]?_[_0x2143('0xc')](_0x232d72['include'],function(_0x4ebf14){return{'model':db[_0x4ebf14[_0x2143('0xe')]],'as':_0x4ebf14['as'],'attributes':_0x4ebf14['attributes']};}):[]};}):[]};}):[]:[]})[_0x2143('0xf')](function(_0x70314c){logger['info']('GetInterval',_0x366b87);logger['debug']('GetInterval',_0x366b87,JSON[_0x2143('0x10')](_0x70314c));_0x1d7bfb(_0x70314c);})[_0x2143('0x11')](function(_0x1b5d60){logger['error'](_0x2143('0x5'),_0x1b5d60[_0x2143('0x12')],_0x366b87);_0x92596(_0x47d4fe[_0x2143('0x13')](0x1f4,_0x1b5d60[_0x2143('0x12')]));});});};exports[_0x2143('0x14')]=function(_0x16edaf){var _0xb55c22=this;return new Promise(function(_0x22152b,_0x202ed3){return db[_0x2143('0x6')][_0x2143('0x15')]({'raw':_0x16edaf[_0x2143('0x8')]?_0x16edaf[_0x2143('0x8')][_0x2143('0x9')]===undefined?!![]:![]:!![],'where':_0x16edaf['options']?_0x16edaf[_0x2143('0x8')][_0x2143('0x16')]||null:null,'attributes':_0x16edaf[_0x2143('0x8')]?_0x16edaf[_0x2143('0x8')][_0x2143('0xa')]||null:null,'include':_0x16edaf['options']?_0x16edaf[_0x2143('0x8')][_0x2143('0xd')]?_[_0x2143('0xc')](_0x16edaf[_0x2143('0x8')][_0x2143('0xd')],function(_0x2faac1){return{'model':db[_0x2faac1[_0x2143('0xe')]],'as':_0x2faac1['as'],'attributes':_0x2faac1[_0x2143('0xa')],'include':_0x2faac1[_0x2143('0xd')]?_['map'](_0x2faac1[_0x2143('0xd')],function(_0x7ddd9a){return{'model':db[_0x7ddd9a[_0x2143('0xe')]],'as':_0x7ddd9a['as'],'attributes':_0x7ddd9a[_0x2143('0xa')],'include':_0x7ddd9a['include']?_['map'](_0x7ddd9a[_0x2143('0xd')],function(_0x174803){return{'model':db[_0x174803['model']],'as':_0x174803['as'],'attributes':_0x174803[_0x2143('0xa')]};}):[]};}):[]};}):[]:[]})[_0x2143('0xf')](function(_0x2f937c){logger[_0x2143('0x17')](_0x2143('0x14'),_0x16edaf);logger[_0x2143('0x18')](_0x2143('0x14'),_0x16edaf,JSON[_0x2143('0x10')](_0x2f937c));_0x22152b(_0x2f937c);})[_0x2143('0x11')](function(_0x4d4cc9){logger[_0x2143('0x13')](_0x2143('0x14'),_0x4d4cc9[_0x2143('0x12')],_0x16edaf);_0x202ed3(_0xb55c22['error'](0x1f4,_0x4d4cc9[_0x2143('0x12')]));});});};function checkArrayOfIntervals(_0x1262f4,_0x3db03e){var _0xaac560=[];return db['Interval']['findAll']({'where':{'id':_0x1262f4}})[_0x2143('0xf')](function(_0x50c793){_0xaac560=_0x50c793;return Promise[_0x2143('0x19')](_0xaac560['map'](function(_0x34d5c9){return _0x34d5c9[_0x2143('0x1a')](_0x3db03e);}));})[_0x2143('0xf')](function(_0x56f890){var _0xc50d36=_0x56f890[_0x2143('0x1b')](function(_0x7eb7d6,_0x4f3bc9){return _0x7eb7d6||_0x4f3bc9;},![]);logger['info'](util[_0x2143('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0xaac560['map'](function(_0x1d547f){return _0x1d547f[_0x2143('0x1d')];})[_0x2143('0x1e')](',\x20'),_0xaac560[_0x2143('0xc')](function(_0x12e40b){return _0x12e40b['id'];})[_0x2143('0x1e')](',\x20')));return _0xc50d36;});}function checkSingleInterval(_0x5f503d,_0x1dd153){return db[_0x2143('0x6')][_0x2143('0x1f')](_0x5f503d)[_0x2143('0xf')](function(_0x4779a2){if(_0x4779a2){logger[_0x2143('0x17')](util['format'](_0x2143('0x20'),_0x4779a2['name'],_0x4779a2['id']));return _0x4779a2['ifTime'](_0x1dd153);}});}exports[_0x2143('0x21')]=function(_0x418807){var _0x52dba6=_0x418807[_0x2143('0x22')];var _0x5ad2d2=Array['isArray'](_0x418807['intervals'])?_0x418807['intervals']:typeof _0x418807[_0x2143('0x23')]==='string'?[_0x418807[_0x2143('0x23')]]:[];var _0xac5598=_0x418807[_0x2143('0x24')]||undefined;var _0x538d74=![];if(_0x5ad2d2[_0x2143('0x25')]){logger[_0x2143('0x17')](util['format'](_0x2143('0x26'),_0x5ad2d2[_0x2143('0x1e')](';\x20')));}if(_0xac5598){logger[_0x2143('0x17')](util[_0x2143('0x1c')](_0x2143('0x27'),_0xac5598));}logger[_0x2143('0x18')]('Iftime',_0x538d74);logger[_0x2143('0x28')](_0x2143('0x21'),_0x418807);return Promise[_0x2143('0x29')]()[_0x2143('0xf')](function(){if(Array[_0x2143('0x2a')](_0x52dba6)){return checkArrayOfIntervals(_0x52dba6,_0xac5598);}else if(_0x52dba6){return checkSingleInterval(_0x52dba6,_0xac5598);}})['then'](function(_0x3ddf91){var _0x243f9d=_0x5ad2d2[_0x2143('0x1b')](function(_0x26533a,_0x16cfff){return _0x26533a||iftime(_0x16cfff,_0xac5598);},![]);_0x538d74=_0x3ddf91||_0x243f9d;return _0x538d74;})[_0x2143('0x11')](function(_0x28132f){logger[_0x2143('0x13')](_0x2143('0x21'),_0x418807,_0x28132f);throw this[_0x2143('0x13')](0x1f4,_0x28132f[_0x2143('0x12')]);});}; \ No newline at end of file +var _0x7e57=['../../mysqldb','../../utils/iftime','../../config/logger','rpc','Interval','findAll','options','raw','where','attributes','limit','map','include','model','then','info','GetInterval','debug','stringify','error','message','ShowInterval','find','catch','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util'];(function(_0x53c261,_0x2a3529){var _0x30a857=function(_0x1d2d00){while(--_0x1d2d00){_0x53c261['push'](_0x53c261['shift']());}};_0x30a857(++_0x2a3529);}(_0x7e57,0xb2));var _0x77e5=function(_0x3be001,_0x8b69e8){_0x3be001=_0x3be001-0x0;var _0xfc610f=_0x7e57[_0x3be001];return _0xfc610f;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var db=require(_0x77e5('0x2'))['db'];var iftime=require(_0x77e5('0x3'))['iftime'];var logger=require(_0x77e5('0x4'))(_0x77e5('0x5'));exports['GetInterval']=function(_0x206603){var _0x19ca2e=this;return new Promise(function(_0x48a367,_0x33784d){return db[_0x77e5('0x6')][_0x77e5('0x7')]({'raw':_0x206603[_0x77e5('0x8')]?_0x206603['options'][_0x77e5('0x9')]===undefined?!![]:![]:!![],'where':_0x206603['options']?_0x206603[_0x77e5('0x8')][_0x77e5('0xa')]||null:null,'attributes':_0x206603[_0x77e5('0x8')]?_0x206603[_0x77e5('0x8')][_0x77e5('0xb')]||null:null,'limit':_0x206603['options']?_0x206603[_0x77e5('0x8')][_0x77e5('0xc')]||null:null,'include':_0x206603['options']?_0x206603['options']['include']?_['map'](_0x206603[_0x77e5('0x8')]['include'],function(_0x33bee7){return{'model':db[_0x33bee7['model']],'as':_0x33bee7['as'],'attributes':_0x33bee7[_0x77e5('0xb')],'include':_0x33bee7['include']?_[_0x77e5('0xd')](_0x33bee7[_0x77e5('0xe')],function(_0x5b1760){return{'model':db[_0x5b1760[_0x77e5('0xf')]],'as':_0x5b1760['as'],'attributes':_0x5b1760[_0x77e5('0xb')],'include':_0x5b1760[_0x77e5('0xe')]?_[_0x77e5('0xd')](_0x5b1760[_0x77e5('0xe')],function(_0x12ff24){return{'model':db[_0x12ff24['model']],'as':_0x12ff24['as'],'attributes':_0x12ff24[_0x77e5('0xb')]};}):[]};}):[]};}):[]:[]})[_0x77e5('0x10')](function(_0x3bb8f0){logger[_0x77e5('0x11')](_0x77e5('0x12'),_0x206603);logger[_0x77e5('0x13')](_0x77e5('0x12'),_0x206603,JSON[_0x77e5('0x14')](_0x3bb8f0));_0x48a367(_0x3bb8f0);})['catch'](function(_0x53f604){logger[_0x77e5('0x15')](_0x77e5('0x12'),_0x53f604['message'],_0x206603);_0x33784d(_0x19ca2e['error'](0x1f4,_0x53f604[_0x77e5('0x16')]));});});};exports[_0x77e5('0x17')]=function(_0x3d685b){var _0x36c270=this;return new Promise(function(_0x1283c6,_0x4fc99a){return db['Interval'][_0x77e5('0x18')]({'raw':_0x3d685b['options']?_0x3d685b[_0x77e5('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3d685b['options']?_0x3d685b[_0x77e5('0x8')]['where']||null:null,'attributes':_0x3d685b[_0x77e5('0x8')]?_0x3d685b[_0x77e5('0x8')]['attributes']||null:null,'include':_0x3d685b[_0x77e5('0x8')]?_0x3d685b[_0x77e5('0x8')]['include']?_[_0x77e5('0xd')](_0x3d685b[_0x77e5('0x8')][_0x77e5('0xe')],function(_0x546fdf){return{'model':db[_0x546fdf[_0x77e5('0xf')]],'as':_0x546fdf['as'],'attributes':_0x546fdf[_0x77e5('0xb')],'include':_0x546fdf[_0x77e5('0xe')]?_['map'](_0x546fdf[_0x77e5('0xe')],function(_0x1a834f){return{'model':db[_0x1a834f[_0x77e5('0xf')]],'as':_0x1a834f['as'],'attributes':_0x1a834f['attributes'],'include':_0x1a834f[_0x77e5('0xe')]?_[_0x77e5('0xd')](_0x1a834f[_0x77e5('0xe')],function(_0xf39912){return{'model':db[_0xf39912[_0x77e5('0xf')]],'as':_0xf39912['as'],'attributes':_0xf39912['attributes']};}):[]};}):[]};}):[]:[]})[_0x77e5('0x10')](function(_0x341b1b){logger[_0x77e5('0x11')]('ShowInterval',_0x3d685b);logger[_0x77e5('0x13')]('ShowInterval',_0x3d685b,JSON[_0x77e5('0x14')](_0x341b1b));_0x1283c6(_0x341b1b);})[_0x77e5('0x19')](function(_0x31ba9f){logger['error'](_0x77e5('0x17'),_0x31ba9f[_0x77e5('0x16')],_0x3d685b);_0x4fc99a(_0x36c270[_0x77e5('0x15')](0x1f4,_0x31ba9f[_0x77e5('0x16')]));});});};function checkArrayOfIntervals(_0x47e1d8,_0x103d16){var _0x2acfdb=[];return db[_0x77e5('0x6')]['findAll']({'where':{'id':_0x47e1d8}})[_0x77e5('0x10')](function(_0x1ae7cf){_0x2acfdb=_0x1ae7cf;return Promise['all'](_0x2acfdb[_0x77e5('0xd')](function(_0x4225de){return _0x4225de[_0x77e5('0x1a')](_0x103d16);}));})[_0x77e5('0x10')](function(_0x5738f6){var _0x194ac7=_0x5738f6[_0x77e5('0x1b')](function(_0xb9e2de,_0x5860e3){return _0xb9e2de||_0x5860e3;},![]);logger[_0x77e5('0x11')](util[_0x77e5('0x1c')](_0x77e5('0x1d'),_0x2acfdb[_0x77e5('0xd')](function(_0x25e4b3){return _0x25e4b3[_0x77e5('0x1e')];})[_0x77e5('0x1f')](',\x20'),_0x2acfdb[_0x77e5('0xd')](function(_0xe4ac39){return _0xe4ac39['id'];})[_0x77e5('0x1f')](',\x20')));return _0x194ac7;});}function checkSingleInterval(_0x5ca9f9,_0x50a28a){return db[_0x77e5('0x6')]['findById'](_0x5ca9f9)[_0x77e5('0x10')](function(_0x52427f){if(_0x52427f){logger[_0x77e5('0x11')](util[_0x77e5('0x1c')](_0x77e5('0x20'),_0x52427f[_0x77e5('0x1e')],_0x52427f['id']));return _0x52427f[_0x77e5('0x1a')](_0x50a28a);}});}exports['IntervalIftime']=function(_0x1cc1c6){var _0x1cfb31=_0x1cc1c6[_0x77e5('0x21')];var _0x48802d=Array[_0x77e5('0x22')](_0x1cc1c6[_0x77e5('0x23')])?_0x1cc1c6[_0x77e5('0x23')]:typeof _0x1cc1c6[_0x77e5('0x23')]===_0x77e5('0x24')?[_0x1cc1c6[_0x77e5('0x23')]]:[];var _0x504e32=_0x1cc1c6[_0x77e5('0x25')]||undefined;var _0x30bb24=![];if(_0x48802d[_0x77e5('0x26')]){logger[_0x77e5('0x11')](util[_0x77e5('0x1c')](_0x77e5('0x27'),_0x48802d[_0x77e5('0x1f')](';\x20')));}if(_0x504e32){logger[_0x77e5('0x11')](util[_0x77e5('0x1c')](_0x77e5('0x28'),_0x504e32));}logger['debug'](_0x77e5('0x29'),_0x30bb24);logger[_0x77e5('0x2a')](_0x77e5('0x2b'),_0x1cc1c6);return Promise[_0x77e5('0x2c')]()[_0x77e5('0x10')](function(){if(Array['isArray'](_0x1cfb31)){return checkArrayOfIntervals(_0x1cfb31,_0x504e32);}else if(_0x1cfb31){return checkSingleInterval(_0x1cfb31,_0x504e32);}})[_0x77e5('0x10')](function(_0x59911f){var _0x39955a=_0x48802d['reduce'](function(_0x61f7b7,_0x2d24df){return _0x61f7b7||iftime(_0x2d24df,_0x504e32);},![]);_0x30bb24=_0x59911f||_0x39955a;return _0x30bb24;})[_0x77e5('0x19')](function(_0x18dc70){logger['error'](_0x77e5('0x2b'),_0x1cc1c6,_0x18dc70);throw this[_0x77e5('0x15')](0x1f4,_0x18dc70['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5a17ef7..6a40df7 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x359220,_0x209673){var _0x188aa0=function(_0x5361a3){while(--_0x5361a3){_0x359220['push'](_0x359220['shift']());}};_0x188aa0(++_0x209673);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ac8f5,_0x212f8c){_0x1ac8f5=_0x1ac8f5-0x0;var _0x21a869=_0x2ef3[_0x1ac8f5];return _0x21a869;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x5a8455,_0x143269){var _0x3bf93a=function(_0x4f01ef){while(--_0x4f01ef){_0x5a8455['push'](_0x5a8455['shift']());}};_0x3bf93a(++_0x143269);}(_0x2032,0xd9));var _0x2203=function(_0x2e883c,_0x13f2cf){_0x2e883c=_0x2e883c-0x0;var _0x2dc1af=_0x2032[_0x2e883c];return _0x2dc1af;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1e18bf2..593065b 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 _0xbdd2=['json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','remoteAddress','connection','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','statusCode'];(function(_0x32fefc,_0x1700f5){var _0x70a3a7=function(_0x24954e){while(--_0x24954e){_0x32fefc['push'](_0x32fefc['shift']());}};_0x70a3a7(++_0x1700f5);}(_0xbdd2,0x150));var _0x2bdd=function(_0x175941,_0x2e476a){_0x175941=_0x175941-0x0;var _0x2f5dff=_0xbdd2[_0x175941];return _0x2f5dff;};'use strict';var BPromise=require(_0x2bdd('0x0'));var https=require('https');var logger=require(_0x2bdd('0x1'))(_0x2bdd('0x2'));var USERNAME=_0x2bdd('0x3');var PASSWORD=_0x2bdd('0x4');function openIssue(_0x424b69,_0x48e6fe){var _0x412e67={'fields':{'project':{'key':_0x424b69[_0x2bdd('0x5')]||_0x2bdd('0x6')},'summary':(_0x424b69[_0x2bdd('0x7')]||_0x2bdd('0x8'))+_0x2bdd('0x9')+_0x424b69['ip'],'description':_0x424b69[_0x2bdd('0xa')]||JSON[_0x2bdd('0xb')](_0x424b69),'issuetype':{'name':_0x424b69[_0x2bdd('0xc')]||'Bug'}}};_0x412e67[_0x2bdd('0xd')]['customfield_11500']=_0x424b69[_0x2bdd('0xe')];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0xf')]=_0x424b69[_0x2bdd('0x10')];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x11')]=_0x424b69['newToken'];_0x412e67[_0x2bdd('0xd')]['customfield_11503']=_0x424b69['name'];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x12')]=_0x424b69['reason'];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x13')]=_0x424b69['ip'];var _0x59625d={'host':_0x2bdd('0x14'),'port':0x1bb,'path':_0x2bdd('0x15'),'method':_0x2bdd('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x2bdd('0x17'),'Authorization':_0x2bdd('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x2bdd('0x19')](_0x2bdd('0x1a'))}};var _0x519629=JSON[_0x2bdd('0xb')](_0x412e67);var _0x37336a=https['request'](_0x59625d,function(_0x122cab){_0x122cab[_0x2bdd('0x1b')](_0x2bdd('0x1c'));var _0x4b4c51='';_0x122cab['on'](_0x2bdd('0x1d'),function(_0x1c53cc){_0x4b4c51+=_0x1c53cc;});_0x122cab['on'](_0x2bdd('0x1e'),function(){if(_0x48e6fe){return _0x48e6fe[_0x2bdd('0x1f')](_0x122cab[_0x2bdd('0x20')])[_0x2bdd('0x21')](JSON['parse'](_0x4b4c51));}});});_0x37336a['on'](_0x2bdd('0x22'),function(_0x3d8318){if(_0x48e6fe){return _0x48e6fe[_0x2bdd('0x1f')](0x1f4)[_0x2bdd('0x21')]({'errors':[{'message':_0x2bdd('0x23'),'type':_0x2bdd('0x24')}]});}});_0x37336a['write'](_0x519629);_0x37336a[_0x2bdd('0x1e')]();}exports[_0x2bdd('0x25')]=openIssue;exports['send']=function(_0x1b654d,_0x31a780){_0x1b654d[_0x2bdd('0x26')]['ip']=_0x1b654d['headers']['x-forwarded-for']||_0x1b654d['connection'][_0x2bdd('0x27')]||_0x1b654d['socket'][_0x2bdd('0x27')]||_0x1b654d[_0x2bdd('0x28')]['socket'][_0x2bdd('0x27')];return openIssue(_0x1b654d[_0x2bdd('0x26')],_0x31a780);}; \ No newline at end of file +var _0x21bc=['send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x55ef2b,_0x3c272d){var _0x121e9e=function(_0x3bf71f){while(--_0x3bf71f){_0x55ef2b['push'](_0x55ef2b['shift']());}};_0x121e9e(++_0x3c272d);}(_0x21bc,0xc2));var _0xc21b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x21bc[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0xc21b('0x0'));var https=require(_0xc21b('0x1'));var logger=require('../../config/logger')(_0xc21b('0x2'));var USERNAME=_0xc21b('0x3');var PASSWORD=_0xc21b('0x4');function openIssue(_0x7acf4c,_0x52625a){var _0x4bf575={'fields':{'project':{'key':_0x7acf4c[_0xc21b('0x5')]||_0xc21b('0x6')},'summary':(_0x7acf4c[_0xc21b('0x7')]||'Report')+_0xc21b('0x8')+_0x7acf4c['ip'],'description':_0x7acf4c[_0xc21b('0x9')]||JSON[_0xc21b('0xa')](_0x7acf4c),'issuetype':{'name':_0x7acf4c[_0xc21b('0xb')]||_0xc21b('0xc')}}};_0x4bf575[_0xc21b('0xd')][_0xc21b('0xe')]=_0x7acf4c[_0xc21b('0xf')];_0x4bf575['fields'][_0xc21b('0x10')]=_0x7acf4c[_0xc21b('0x11')];_0x4bf575[_0xc21b('0xd')][_0xc21b('0x12')]=_0x7acf4c[_0xc21b('0x13')];_0x4bf575[_0xc21b('0xd')][_0xc21b('0x14')]=_0x7acf4c['name'];_0x4bf575[_0xc21b('0xd')][_0xc21b('0x15')]=_0x7acf4c[_0xc21b('0x16')];_0x4bf575[_0xc21b('0xd')][_0xc21b('0x17')]=_0x7acf4c['ip'];var _0x257a4e={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc21b('0x18'),'method':_0xc21b('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xc21b('0x1a'),'Authorization':_0xc21b('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xc21b('0x1c')](_0xc21b('0x1d'))}};var _0x5c2b24=JSON[_0xc21b('0xa')](_0x4bf575);var _0x204a69=https[_0xc21b('0x1e')](_0x257a4e,function(_0x46f8fb){_0x46f8fb['setEncoding']('utf8');var _0x100b82='';_0x46f8fb['on'](_0xc21b('0x1f'),function(_0x4b8324){_0x100b82+=_0x4b8324;});_0x46f8fb['on'](_0xc21b('0x20'),function(){if(_0x52625a){return _0x52625a[_0xc21b('0x21')](_0x46f8fb[_0xc21b('0x22')])[_0xc21b('0x23')](JSON[_0xc21b('0x24')](_0x100b82));}});});_0x204a69['on']('error',function(_0x4d644c){if(_0x52625a){return _0x52625a['status'](0x1f4)['json']({'errors':[{'message':_0xc21b('0x25'),'type':_0xc21b('0x26')}]});}});_0x204a69[_0xc21b('0x27')](_0x5c2b24);_0x204a69[_0xc21b('0x20')]();}exports[_0xc21b('0x28')]=openIssue;exports[_0xc21b('0x29')]=function(_0x4a24c5,_0x24f43f){_0x4a24c5[_0xc21b('0x2a')]['ip']=_0x4a24c5['headers'][_0xc21b('0x2b')]||_0x4a24c5[_0xc21b('0x2c')][_0xc21b('0x2d')]||_0x4a24c5['socket'][_0xc21b('0x2d')]||_0x4a24c5[_0xc21b('0x2c')][_0xc21b('0x2e')][_0xc21b('0x2d')];return openIssue(_0x4a24c5['body'],_0x24f43f);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index b13e13f..3ce2383 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 _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ea339,_0x405389){var _0x3be506=function(_0x455c4a){while(--_0x455c4a){_0x4ea339['push'](_0x4ea339['shift']());}};_0x3be506(++_0x405389);}(_0xd2ea,0x15f));var _0xad2e=function(_0x39f353,_0x152e28){_0x39f353=_0x39f353-0x0;var _0x5f4feb=_0xd2ea[_0x39f353];return _0x5f4feb;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file +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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x17ba,0xab));var _0xa17b=function(_0x583af9,_0x1b51da){_0x583af9=_0x583af9-0x0;var _0xcec3aa=_0x17ba[_0x583af9];return _0xcec3aa;};'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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3833261..96146e5 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x5ed466,_0x19c023){_0x5ed466=_0x5ed466-0x0;var _0x2b8ee8=_0x7a54[_0x5ed466];return _0x2b8ee8;};'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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x462c8c,_0x3285f1){_0x462c8c=_0x462c8c-0x0;var _0x184234=_0x7a54[_0x462c8c];return _0x184234;};'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 655432c..a2e5001 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 _0xcca7=['count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','end','status','json','limit','undefined'];(function(_0xd7445f,_0x4401a4){var _0x37b719=function(_0x6e9ae2){while(--_0x6e9ae2){_0xd7445f['push'](_0xd7445f['shift']());}};_0x37b719(++_0x4401a4);}(_0xcca7,0x1aa));var _0x7cca=function(_0x19cbac,_0x4a7597){_0x19cbac=_0x19cbac-0x0;var _0x180da3=_0xcca7[_0x19cbac];return _0x180da3;};'use strict';var emlformat=require(_0x7cca('0x0'));var rimraf=require(_0x7cca('0x1'));var zipdir=require(_0x7cca('0x2'));var jsonpatch=require(_0x7cca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7cca('0x4'));var Mustache=require('mustache');var util=require(_0x7cca('0x5'));var path=require(_0x7cca('0x6'));var sox=require(_0x7cca('0x7'));var csv=require(_0x7cca('0x8'));var ejs=require(_0x7cca('0x9'));var fs=require('fs');var fs_extra=require(_0x7cca('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cca('0xb'));var jsforce=require(_0x7cca('0xc'));var deskjs=require(_0x7cca('0xd'));var toCsv=require(_0x7cca('0x8'));var querystring=require(_0x7cca('0xe'));var Papa=require(_0x7cca('0xf'));var Redis=require(_0x7cca('0x10'));var authService=require(_0x7cca('0x11'));var qs=require(_0x7cca('0x12'));var as=require(_0x7cca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cca('0x14'))(_0x7cca('0x15'));var utils=require(_0x7cca('0x16'));var config=require(_0x7cca('0x17'));var licenseUtil=require(_0x7cca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a14cc,_0x41e0a2){_0x41e0a2=_0x41e0a2||0xcc;return function(_0x2854c7){if(_0x2854c7){return _0x2a14cc['sendStatus'](_0x41e0a2);}return _0x2a14cc['status'](_0x41e0a2)[_0x7cca('0x19')]();};}function respondWithResult(_0x20c1b2,_0x27d671){_0x27d671=_0x27d671||0xc8;return function(_0x847cce){if(_0x847cce){return _0x20c1b2[_0x7cca('0x1a')](_0x27d671)[_0x7cca('0x1b')](_0x847cce);}};}function respondWithFilteredResult(_0x45143d,_0x5a357d){return function(_0x216d4b){if(_0x216d4b){var _0x533608=typeof _0x5a357d['offset']==='undefined'&&typeof _0x5a357d[_0x7cca('0x1c')]===_0x7cca('0x1d');var _0x1dd043=_0x216d4b[_0x7cca('0x1e')];var _0x44294b=_0x533608?0x0:_0x5a357d['offset'];var _0xb35e1d=_0x533608?_0x216d4b['count']:_0x5a357d['offset']+_0x5a357d['limit'];var _0x370469;if(_0xb35e1d>=_0x1dd043){_0xb35e1d=_0x1dd043;_0x370469=0xc8;}else{_0x370469=0xce;}_0x45143d[_0x7cca('0x1a')](_0x370469);return _0x45143d[_0x7cca('0x1f')](_0x7cca('0x20'),_0x44294b+'-'+_0xb35e1d+'/'+_0x1dd043)[_0x7cca('0x1b')](_0x216d4b);}return null;};}function patchUpdates(_0x45db2f){return function(_0x2e023c){try{jsonpatch[_0x7cca('0x21')](_0x2e023c,_0x45db2f,!![]);}catch(_0x4d7804){return BPromise[_0x7cca('0x22')](_0x4d7804);}return _0x2e023c[_0x7cca('0x23')]();};}function saveUpdates(_0x165d13,_0x4343a3){return function(_0x55b689){if(_0x55b689){return _0x55b689[_0x7cca('0x24')](_0x165d13)[_0x7cca('0x25')](function(_0x4367f9){return _0x4367f9;});}return null;};}function removeEntity(_0x119d76,_0x823d7d){return function(_0x3fc157){if(_0x3fc157){return _0x3fc157[_0x7cca('0x26')]()[_0x7cca('0x25')](function(){_0x119d76['status'](0xcc)[_0x7cca('0x19')]();});}};}function handleEntityNotFound(_0x1dd3b3,_0x1774fc){return function(_0xdaf07f){if(!_0xdaf07f){_0x1dd3b3[_0x7cca('0x27')](0x194);}return _0xdaf07f;};}function handleError(_0x21da68,_0x35ebe8){_0x35ebe8=_0x35ebe8||0x1f4;return function(_0x40ac86){logger['error'](_0x40ac86[_0x7cca('0x28')]);if(_0x40ac86['name']){delete _0x40ac86[_0x7cca('0x29')];}_0x21da68[_0x7cca('0x1a')](_0x35ebe8)['send'](_0x40ac86);};}exports[_0x7cca('0x2a')]=function(_0x3d91b1,_0x5533fb){var _0x249442={},_0x1cd53a={},_0x100061={'count':0x0,'rows':[]};var _0x52fb40=_['map'](db[_0x7cca('0x2b')][_0x7cca('0x2c')],function(_0x3797f4){return{'name':_0x3797f4[_0x7cca('0x2d')],'type':_0x3797f4[_0x7cca('0x2e')][_0x7cca('0x2f')]};});_0x1cd53a[_0x7cca('0x30')]=_['map'](_0x52fb40,'name');_0x1cd53a[_0x7cca('0x31')]=_[_0x7cca('0x32')](_0x3d91b1[_0x7cca('0x31')]);_0x1cd53a['filters']=_[_0x7cca('0x33')](_0x1cd53a['model'],_0x1cd53a[_0x7cca('0x31')]);_0x249442[_0x7cca('0x34')]=_[_0x7cca('0x33')](_0x1cd53a[_0x7cca('0x30')],qs['fields'](_0x3d91b1[_0x7cca('0x31')][_0x7cca('0x35')]));_0x249442[_0x7cca('0x34')]=_0x249442['attributes']['length']?_0x249442['attributes']:_0x1cd53a[_0x7cca('0x30')];if(!_0x3d91b1[_0x7cca('0x31')]['hasOwnProperty'](_0x7cca('0x36'))){_0x249442[_0x7cca('0x1c')]=qs[_0x7cca('0x1c')](_0x3d91b1[_0x7cca('0x31')][_0x7cca('0x1c')]);_0x249442[_0x7cca('0x37')]=qs[_0x7cca('0x37')](_0x3d91b1['query'][_0x7cca('0x37')]);}_0x249442[_0x7cca('0x38')]=qs[_0x7cca('0x39')](_0x3d91b1[_0x7cca('0x31')]['sort']);_0x249442[_0x7cca('0x3a')]=qs[_0x7cca('0x3b')](_[_0x7cca('0x3c')](_0x3d91b1['query'],_0x1cd53a[_0x7cca('0x3b')]),_0x52fb40);if(_0x3d91b1['query'][_0x7cca('0x3d')]){_0x249442[_0x7cca('0x3a')]=_[_0x7cca('0x3e')](_0x249442[_0x7cca('0x3a')],{'$or':_[_0x7cca('0x3f')](_0x52fb40,function(_0x25b3a9){if(_0x25b3a9[_0x7cca('0x2e')]!==_0x7cca('0x40')){var _0x3617b8={};_0x3617b8[_0x25b3a9['name']]={'$like':'%'+_0x3d91b1['query'][_0x7cca('0x3d')]+'%'};return _0x3617b8;}})});}_0x249442=_[_0x7cca('0x3e')]({},_0x249442,_0x3d91b1['options']);var _0x48d87f={'where':_0x249442[_0x7cca('0x3a')]};return db[_0x7cca('0x2b')][_0x7cca('0x1e')](_0x48d87f)[_0x7cca('0x25')](function(_0x371c67){_0x100061['count']=_0x371c67;if(_0x3d91b1[_0x7cca('0x31')]['includeAll']){_0x249442['include']=[{'all':!![]}];}return db[_0x7cca('0x2b')][_0x7cca('0x41')](_0x249442);})['then'](function(_0x3b120b){_0x100061['rows']=_0x3b120b;return _0x100061;})[_0x7cca('0x25')](respondWithFilteredResult(_0x5533fb,_0x249442))[_0x7cca('0x42')](handleError(_0x5533fb,null));};exports[_0x7cca('0x43')]=function(_0x47e2e6,_0xb966da){var _0x207250={'raw':!![],'where':{'id':_0x47e2e6[_0x7cca('0x44')]['id']}},_0x2e8d97={};_0x2e8d97['model']=_[_0x7cca('0x32')](db[_0x7cca('0x2b')][_0x7cca('0x2c')]);_0x2e8d97[_0x7cca('0x31')]=_[_0x7cca('0x32')](_0x47e2e6[_0x7cca('0x31')]);_0x2e8d97['filters']=_['intersection'](_0x2e8d97['model'],_0x2e8d97['query']);_0x207250[_0x7cca('0x34')]=_['intersection'](_0x2e8d97['model'],qs[_0x7cca('0x35')](_0x47e2e6[_0x7cca('0x31')][_0x7cca('0x35')]));_0x207250[_0x7cca('0x34')]=_0x207250[_0x7cca('0x34')]['length']?_0x207250[_0x7cca('0x34')]:_0x2e8d97[_0x7cca('0x30')];if(_0x47e2e6[_0x7cca('0x31')][_0x7cca('0x45')]){_0x207250[_0x7cca('0x46')]=[{'all':!![]}];}_0x207250=_[_0x7cca('0x3e')]({},_0x207250,_0x47e2e6[_0x7cca('0x47')]);return db[_0x7cca('0x2b')][_0x7cca('0x48')](_0x207250)[_0x7cca('0x25')](handleEntityNotFound(_0xb966da,null))[_0x7cca('0x25')](respondWithResult(_0xb966da,null))['catch'](handleError(_0xb966da,null));};exports['create']=function(_0x36f12f,_0x5913eb){return db[_0x7cca('0x2b')][_0x7cca('0x49')](_0x36f12f[_0x7cca('0x4a')],{})[_0x7cca('0x25')](respondWithResult(_0x5913eb,0xc9))[_0x7cca('0x42')](handleError(_0x5913eb,null));};exports[_0x7cca('0x24')]=function(_0x184b56,_0xe0059e){if(_0x184b56[_0x7cca('0x4a')]['id']){delete _0x184b56[_0x7cca('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0x7cca('0x48')]({'where':{'id':_0x184b56[_0x7cca('0x44')]['id']}})[_0x7cca('0x25')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x25')](saveUpdates(_0x184b56[_0x7cca('0x4a')],null))[_0x7cca('0x25')](respondWithResult(_0xe0059e,null))[_0x7cca('0x42')](handleError(_0xe0059e,null));};exports[_0x7cca('0x26')]=function(_0x218114,_0x43c581){return db[_0x7cca('0x2b')][_0x7cca('0x48')]({'where':{'id':_0x218114[_0x7cca('0x44')]['id']}})[_0x7cca('0x25')](handleEntityNotFound(_0x43c581,null))[_0x7cca('0x25')](removeEntity(_0x43c581,null))[_0x7cca('0x42')](handleError(_0x43c581,null));};exports[_0x7cca('0x4b')]=function(_0x27c527,_0x343a64){return db[_0x7cca('0x2b')][_0x7cca('0x4b')]()[_0x7cca('0x25')](respondWithResult(_0x343a64,null))[_0x7cca('0x42')](handleError(_0x343a64,null));}; \ No newline at end of file +var _0x7f05=['show','rawAttributes','attributes','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch'];(function(_0x275e04,_0x1df425){var _0x3f07c3=function(_0x341007){while(--_0x341007){_0x275e04['push'](_0x275e04['shift']());}};_0x3f07c3(++_0x1df425);}(_0x7f05,0xdc));var _0x57f0=function(_0x1bd49a,_0x50dad4){_0x1bd49a=_0x1bd49a-0x0;var _0x22f47e=_0x7f05[_0x1bd49a];return _0x22f47e;};'use strict';var emlformat=require(_0x57f0('0x0'));var rimraf=require(_0x57f0('0x1'));var zipdir=require(_0x57f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57f0('0x3'));var moment=require('moment');var BPromise=require(_0x57f0('0x4'));var Mustache=require(_0x57f0('0x5'));var util=require('util');var path=require(_0x57f0('0x6'));var sox=require(_0x57f0('0x7'));var csv=require('to-csv');var ejs=require(_0x57f0('0x8'));var fs=require('fs');var fs_extra=require(_0x57f0('0x9'));var _=require('lodash');var squel=require(_0x57f0('0xa'));var crypto=require(_0x57f0('0xb'));var jsforce=require(_0x57f0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57f0('0xd'));var Papa=require('papaparse');var Redis=require(_0x57f0('0xe'));var authService=require(_0x57f0('0xf'));var qs=require(_0x57f0('0x10'));var as=require(_0x57f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x57f0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cd266,_0x5615ff){_0x5615ff=_0x5615ff||0xcc;return function(_0x1aa9c8){if(_0x1aa9c8){return _0x5cd266[_0x57f0('0x13')](_0x5615ff);}return _0x5cd266[_0x57f0('0x14')](_0x5615ff)[_0x57f0('0x15')]();};}function respondWithResult(_0x599a6b,_0x4d8d89){_0x4d8d89=_0x4d8d89||0xc8;return function(_0x471f97){if(_0x471f97){return _0x599a6b[_0x57f0('0x14')](_0x4d8d89)[_0x57f0('0x16')](_0x471f97);}};}function respondWithFilteredResult(_0x2e57df,_0x238245){return function(_0x2130ca){if(_0x2130ca){var _0x555e18=typeof _0x238245['offset']===_0x57f0('0x17')&&typeof _0x238245['limit']==='undefined';var _0x48eadd=_0x2130ca['count'];var _0x20d0ba=_0x555e18?0x0:_0x238245[_0x57f0('0x18')];var _0x124f9e=_0x555e18?_0x2130ca['count']:_0x238245[_0x57f0('0x18')]+_0x238245[_0x57f0('0x19')];var _0x3d0cf6;if(_0x124f9e>=_0x48eadd){_0x124f9e=_0x48eadd;_0x3d0cf6=0xc8;}else{_0x3d0cf6=0xce;}_0x2e57df['status'](_0x3d0cf6);return _0x2e57df[_0x57f0('0x1a')](_0x57f0('0x1b'),_0x20d0ba+'-'+_0x124f9e+'/'+_0x48eadd)['json'](_0x2130ca);}return null;};}function patchUpdates(_0x589c18){return function(_0x1f8483){try{jsonpatch[_0x57f0('0x1c')](_0x1f8483,_0x589c18,!![]);}catch(_0x599aa2){return BPromise[_0x57f0('0x1d')](_0x599aa2);}return _0x1f8483['save']();};}function saveUpdates(_0x3a5b6f,_0x9c498){return function(_0x426a09){if(_0x426a09){return _0x426a09[_0x57f0('0x1e')](_0x3a5b6f)['then'](function(_0x5d16a6){return _0x5d16a6;});}return null;};}function removeEntity(_0x43a679,_0x56ceb5){return function(_0x1279ae){if(_0x1279ae){return _0x1279ae[_0x57f0('0x1f')]()[_0x57f0('0x20')](function(){_0x43a679[_0x57f0('0x14')](0xcc)[_0x57f0('0x15')]();});}};}function handleEntityNotFound(_0x1c2cae,_0x4de0f5){return function(_0x941a03){if(!_0x941a03){_0x1c2cae['sendStatus'](0x194);}return _0x941a03;};}function handleError(_0x44a353,_0x5a176f){_0x5a176f=_0x5a176f||0x1f4;return function(_0x563fa5){logger[_0x57f0('0x21')](_0x563fa5['stack']);if(_0x563fa5[_0x57f0('0x22')]){delete _0x563fa5['name'];}_0x44a353['status'](_0x5a176f)[_0x57f0('0x23')](_0x563fa5);};}exports[_0x57f0('0x24')]=function(_0x16c711,_0x3ac9d3){var _0x1858ea={},_0x114b1d={},_0xb3ef4e={'count':0x0,'rows':[]};var _0x43699b=_[_0x57f0('0x25')](db[_0x57f0('0x26')]['rawAttributes'],function(_0x2c61af){return{'name':_0x2c61af[_0x57f0('0x27')],'type':_0x2c61af[_0x57f0('0x28')][_0x57f0('0x29')]};});_0x114b1d[_0x57f0('0x2a')]=_[_0x57f0('0x25')](_0x43699b,_0x57f0('0x22'));_0x114b1d[_0x57f0('0x2b')]=_[_0x57f0('0x2c')](_0x16c711[_0x57f0('0x2b')]);_0x114b1d[_0x57f0('0x2d')]=_[_0x57f0('0x2e')](_0x114b1d[_0x57f0('0x2a')],_0x114b1d[_0x57f0('0x2b')]);_0x1858ea['attributes']=_[_0x57f0('0x2e')](_0x114b1d[_0x57f0('0x2a')],qs[_0x57f0('0x2f')](_0x16c711[_0x57f0('0x2b')]['fields']));_0x1858ea['attributes']=_0x1858ea['attributes'][_0x57f0('0x30')]?_0x1858ea['attributes']:_0x114b1d[_0x57f0('0x2a')];if(!_0x16c711[_0x57f0('0x2b')][_0x57f0('0x31')]('nolimit')){_0x1858ea[_0x57f0('0x19')]=qs[_0x57f0('0x19')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x19')]);_0x1858ea[_0x57f0('0x18')]=qs[_0x57f0('0x18')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x18')]);}_0x1858ea[_0x57f0('0x32')]=qs[_0x57f0('0x33')](_0x16c711[_0x57f0('0x2b')][_0x57f0('0x33')]);_0x1858ea[_0x57f0('0x34')]=qs[_0x57f0('0x2d')](_[_0x57f0('0x35')](_0x16c711[_0x57f0('0x2b')],_0x114b1d[_0x57f0('0x2d')]),_0x43699b);if(_0x16c711[_0x57f0('0x2b')][_0x57f0('0x36')]){_0x1858ea['where']=_['merge'](_0x1858ea[_0x57f0('0x34')],{'$or':_[_0x57f0('0x25')](_0x43699b,function(_0x382436){if(_0x382436['type']!==_0x57f0('0x37')){var _0x294756={};_0x294756[_0x382436[_0x57f0('0x22')]]={'$like':'%'+_0x16c711[_0x57f0('0x2b')][_0x57f0('0x36')]+'%'};return _0x294756;}})});}_0x1858ea=_[_0x57f0('0x38')]({},_0x1858ea,_0x16c711[_0x57f0('0x39')]);var _0x2cf365={'where':_0x1858ea[_0x57f0('0x34')]};return db['JscriptyAnswerReport'][_0x57f0('0x3a')](_0x2cf365)[_0x57f0('0x20')](function(_0x44d630){_0xb3ef4e[_0x57f0('0x3a')]=_0x44d630;if(_0x16c711['query'][_0x57f0('0x3b')]){_0x1858ea[_0x57f0('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x57f0('0x3d')](_0x1858ea);})[_0x57f0('0x20')](function(_0x2c3dbd){_0xb3ef4e[_0x57f0('0x3e')]=_0x2c3dbd;return _0xb3ef4e;})[_0x57f0('0x20')](respondWithFilteredResult(_0x3ac9d3,_0x1858ea))[_0x57f0('0x3f')](handleError(_0x3ac9d3,null));};exports[_0x57f0('0x40')]=function(_0x4f3271,_0x42379c){var _0x4e0abe={'raw':!![],'where':{'id':_0x4f3271['params']['id']}},_0x3dd680={};_0x3dd680[_0x57f0('0x2a')]=_[_0x57f0('0x2c')](db[_0x57f0('0x26')][_0x57f0('0x41')]);_0x3dd680[_0x57f0('0x2b')]=_[_0x57f0('0x2c')](_0x4f3271[_0x57f0('0x2b')]);_0x3dd680[_0x57f0('0x2d')]=_[_0x57f0('0x2e')](_0x3dd680[_0x57f0('0x2a')],_0x3dd680[_0x57f0('0x2b')]);_0x4e0abe['attributes']=_[_0x57f0('0x2e')](_0x3dd680[_0x57f0('0x2a')],qs['fields'](_0x4f3271['query'][_0x57f0('0x2f')]));_0x4e0abe['attributes']=_0x4e0abe[_0x57f0('0x42')][_0x57f0('0x30')]?_0x4e0abe[_0x57f0('0x42')]:_0x3dd680['model'];if(_0x4f3271[_0x57f0('0x2b')][_0x57f0('0x3b')]){_0x4e0abe['include']=[{'all':!![]}];}_0x4e0abe=_[_0x57f0('0x38')]({},_0x4e0abe,_0x4f3271[_0x57f0('0x39')]);return db[_0x57f0('0x26')][_0x57f0('0x43')](_0x4e0abe)[_0x57f0('0x20')](handleEntityNotFound(_0x42379c,null))[_0x57f0('0x20')](respondWithResult(_0x42379c,null))['catch'](handleError(_0x42379c,null));};exports[_0x57f0('0x44')]=function(_0x390119,_0x4b93e5){return db[_0x57f0('0x26')]['create'](_0x390119[_0x57f0('0x45')],{})['then'](respondWithResult(_0x4b93e5,0xc9))[_0x57f0('0x3f')](handleError(_0x4b93e5,null));};exports['update']=function(_0x4c6eb1,_0x22abb2){if(_0x4c6eb1[_0x57f0('0x45')]['id']){delete _0x4c6eb1[_0x57f0('0x45')]['id'];}return db['JscriptyAnswerReport'][_0x57f0('0x43')]({'where':{'id':_0x4c6eb1[_0x57f0('0x46')]['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0x22abb2,null))[_0x57f0('0x20')](saveUpdates(_0x4c6eb1[_0x57f0('0x45')],null))[_0x57f0('0x20')](respondWithResult(_0x22abb2,null))[_0x57f0('0x3f')](handleError(_0x22abb2,null));};exports[_0x57f0('0x1f')]=function(_0x7f6cf5,_0x5bdd21){return db[_0x57f0('0x26')][_0x57f0('0x43')]({'where':{'id':_0x7f6cf5['params']['id']}})[_0x57f0('0x20')](handleEntityNotFound(_0x5bdd21,null))[_0x57f0('0x20')](removeEntity(_0x5bdd21,null))['catch'](handleError(_0x5bdd21,null));};exports['describe']=function(_0x440fd8,_0x71081b){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x71081b,null))[_0x57f0('0x3f')](handleError(_0x71081b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6051533..81a53f6 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 _0x1667=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','path'];(function(_0x3ac0d3,_0x519874){var _0x4c1b30=function(_0x69029a){while(--_0x69029a){_0x3ac0d3['push'](_0x3ac0d3['shift']());}};_0x4c1b30(++_0x519874);}(_0x1667,0x126));var _0x7166=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x1667[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x7166('0x0'));var util=require(_0x7166('0x1'));var logger=require('../../config/logger')(_0x7166('0x2'));var moment=require('moment');var BPromise=require(_0x7166('0x3'));var rp=require(_0x7166('0x4'));var fs=require('fs');var path=require(_0x7166('0x5'));var rimraf=require(_0x7166('0x6'));var config=require(_0x7166('0x7'));var attributes=require(_0x7166('0x8'));module[_0x7166('0x9')]=function(_0x523f4c,_0x402df2){return _0x523f4c['define'](_0x7166('0xa'),attributes,{'tableName':_0x7166('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41a6=['lodash','util','../../config/logger','api','bluebird','path','exports','define','report_jscripty_answers'];(function(_0x2da59d,_0x1bf4b3){var _0x3dc322=function(_0x2c7ea8){while(--_0x2c7ea8){_0x2da59d['push'](_0x2da59d['shift']());}};_0x3dc322(++_0x1bf4b3);}(_0x41a6,0x1c2));var _0x641a=function(_0x277208,_0x57ab06){_0x277208=_0x277208-0x0;var _0x3e2c03=_0x41a6[_0x277208];return _0x3e2c03;};'use strict';var _=require(_0x641a('0x0'));var util=require(_0x641a('0x1'));var logger=require(_0x641a('0x2'))(_0x641a('0x3'));var moment=require('moment');var BPromise=require(_0x641a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x641a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x641a('0x6')]=function(_0xac4477,_0x277b75){return _0xac4477[_0x641a('0x7')]('JscriptyAnswerReport',attributes,{'tableName':_0x641a('0x8'),'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 001ba59..9ff4fc6 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 _0xabd7=['jayson/promise','client','http','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','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x53a0ce,_0x5eaa86){var _0x491112=function(_0xb4b450){while(--_0xb4b450){_0x53a0ce['push'](_0x53a0ce['shift']());}};_0x491112(++_0x5eaa86);}(_0xabd7,0x12d));var _0x7abd=function(_0x489510,_0x5dc266){_0x489510=_0x489510-0x0;var _0x5e6742=_0xabd7[_0x489510];return _0x5e6742;};'use strict';var _=require(_0x7abd('0x0'));var util=require(_0x7abd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7abd('0x2'));var fs=require('fs');var Redis=require(_0x7abd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7abd('0x4'))(_0x7abd('0x5'));var config=require(_0x7abd('0x6'));var jayson=require(_0x7abd('0x7'));var client=jayson[_0x7abd('0x8')][_0x7abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd7487b,_0x3ccb11,_0x20442a){return new BPromise(function(_0x4fd1be,_0x59cded){return client['request'](_0xd7487b,_0x20442a)[_0x7abd('0xa')](function(_0x554bb9){logger[_0x7abd('0xb')](_0x7abd('0xc'),_0x3ccb11,_0x7abd('0xd'));logger[_0x7abd('0xe')](_0x7abd('0xf'),_0x3ccb11,_0x7abd('0xd'),JSON[_0x7abd('0x10')](_0x554bb9));if(_0x554bb9[_0x7abd('0x11')]){if(_0x554bb9[_0x7abd('0x11')][_0x7abd('0x12')]===0x1f4){logger[_0x7abd('0x11')](_0x7abd('0xc'),_0x3ccb11,_0x554bb9[_0x7abd('0x11')][_0x7abd('0x13')]);return _0x59cded(_0x554bb9[_0x7abd('0x11')][_0x7abd('0x13')]);}logger[_0x7abd('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ccb11,_0x554bb9[_0x7abd('0x11')]['message']);return _0x4fd1be(_0x554bb9['error'][_0x7abd('0x13')]);}else{logger[_0x7abd('0xb')](_0x7abd('0xc'),_0x3ccb11,'request\x20sent');_0x4fd1be(_0x554bb9[_0x7abd('0x14')][_0x7abd('0x13')]);}})[_0x7abd('0x15')](function(_0x33413f){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ccb11,_0x33413f);_0x59cded(_0x33413f);});});} \ No newline at end of file +var _0xb180=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x546500,_0x44a98e){var _0x3c32a2=function(_0x33a8c3){while(--_0x33a8c3){_0x546500['push'](_0x546500['shift']());}};_0x3c32a2(++_0x44a98e);}(_0xb180,0x1aa));var _0x0b18=function(_0x2cca7e,_0x528dff){_0x2cca7e=_0x2cca7e-0x0;var _0x1d9d10=_0xb180[_0x2cca7e];return _0x1d9d10;};'use strict';var _=require(_0x0b18('0x0'));var util=require(_0x0b18('0x1'));var moment=require('moment');var BPromise=require(_0x0b18('0x2'));var rs=require(_0x0b18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b18('0x4'))['db'];var utils=require(_0x0b18('0x5'));var logger=require(_0x0b18('0x6'))(_0x0b18('0x7'));var config=require(_0x0b18('0x8'));var jayson=require(_0x0b18('0x9'));var client=jayson['client'][_0x0b18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f0a69,_0x29e3c9,_0x41a6b3){return new BPromise(function(_0x7ccca2,_0x3328a3){return client['request'](_0x3f0a69,_0x41a6b3)[_0x0b18('0xb')](function(_0x581405){logger[_0x0b18('0xc')](_0x0b18('0xd'),_0x29e3c9,_0x0b18('0xe'));logger['debug'](_0x0b18('0xf'),_0x29e3c9,_0x0b18('0xe'),JSON[_0x0b18('0x10')](_0x581405));if(_0x581405[_0x0b18('0x11')]){if(_0x581405[_0x0b18('0x11')][_0x0b18('0x12')]===0x1f4){logger[_0x0b18('0x11')](_0x0b18('0xd'),_0x29e3c9,_0x581405[_0x0b18('0x11')][_0x0b18('0x13')]);return _0x3328a3(_0x581405[_0x0b18('0x11')][_0x0b18('0x13')]);}logger[_0x0b18('0x11')](_0x0b18('0xd'),_0x29e3c9,_0x581405[_0x0b18('0x11')][_0x0b18('0x13')]);return _0x7ccca2(_0x581405['error'][_0x0b18('0x13')]);}else{logger[_0x0b18('0xc')](_0x0b18('0xd'),_0x29e3c9,_0x0b18('0xe'));_0x7ccca2(_0x581405[_0x0b18('0x14')][_0x0b18('0x13')]);}})['catch'](function(_0x340e67){logger[_0x0b18('0x11')](_0x0b18('0xd'),_0x29e3c9,_0x340e67);_0x3328a3(_0x340e67);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 83cae9b..85e632c 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 _0x0647=['clone','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getSessions','getAnswers','30s','getSummary','post','create'];(function(_0x45ea51,_0x1d49d2){var _0x55a569=function(_0x2b539b){while(--_0x2b539b){_0x45ea51['push'](_0x45ea51['shift']());}};_0x55a569(++_0x1d49d2);}(_0x0647,0x10e));var _0x7064=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0647[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0x7064('0x0'));var util=require('util');var path=require(_0x7064('0x1'));var timeout=require(_0x7064('0x2'));var express=require(_0x7064('0x3'));var router=express[_0x7064('0x4')]();var fs_extra=require(_0x7064('0x5'));var auth=require(_0x7064('0x6'));var interaction=require(_0x7064('0x7'));var config=require(_0x7064('0x8'));var controller=require('./jscriptyProject.controller');router[_0x7064('0x9')]('/',auth[_0x7064('0xa')](),controller['index']);router[_0x7064('0x9')]('/:id',auth[_0x7064('0xa')](),controller[_0x7064('0xb')]);router[_0x7064('0x9')]('/:id/sessions',auth[_0x7064('0xa')](),controller[_0x7064('0xc')]);router[_0x7064('0x9')]('/:id/answers',auth[_0x7064('0xa')](),controller[_0x7064('0xd')]);router[_0x7064('0x9')]('/:id/summary',auth[_0x7064('0xa')](),timeout(_0x7064('0xe')),controller[_0x7064('0xf')]);router[_0x7064('0x10')]('/',auth['isAuthenticated'](),controller[_0x7064('0x11')]);router[_0x7064('0x10')]('/:id/clone',auth[_0x7064('0xa')](),controller[_0x7064('0x12')]);router[_0x7064('0x13')](_0x7064('0x14'),auth['isAuthenticated'](),controller[_0x7064('0x15')]);router['delete'](_0x7064('0x14'),auth[_0x7064('0xa')](),controller[_0x7064('0x16')]);module[_0x7064('0x17')]=router; \ No newline at end of file +var _0xb17c=['/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0xae5f93,_0x1b23fa){var _0x5ee60b=function(_0x255885){while(--_0x255885){_0xae5f93['push'](_0xae5f93['shift']());}};_0x5ee60b(++_0x1b23fa);}(_0xb17c,0x1a6));var _0xcb17=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xb17c[_0x3e44fa];return _0x2a0aba;};'use strict';var multer=require(_0xcb17('0x0'));var util=require('util');var path=require(_0xcb17('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb17('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcb17('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcb17('0x4'));var controller=require('./jscriptyProject.controller');router[_0xcb17('0x5')]('/',auth[_0xcb17('0x6')](),controller[_0xcb17('0x7')]);router[_0xcb17('0x5')](_0xcb17('0x8'),auth[_0xcb17('0x6')](),controller[_0xcb17('0x9')]);router[_0xcb17('0x5')](_0xcb17('0xa'),auth[_0xcb17('0x6')](),controller['getSessions']);router[_0xcb17('0x5')](_0xcb17('0xb'),auth[_0xcb17('0x6')](),controller[_0xcb17('0xc')]);router[_0xcb17('0x5')](_0xcb17('0xd'),auth[_0xcb17('0x6')](),timeout(_0xcb17('0xe')),controller[_0xcb17('0xf')]);router[_0xcb17('0x10')]('/',auth['isAuthenticated'](),controller[_0xcb17('0x11')]);router[_0xcb17('0x10')](_0xcb17('0x12'),auth[_0xcb17('0x6')](),controller[_0xcb17('0x13')]);router[_0xcb17('0x14')](_0xcb17('0x8'),auth['isAuthenticated'](),controller[_0xcb17('0x15')]);router['delete'](_0xcb17('0x8'),auth[_0xcb17('0x6')](),controller[_0xcb17('0x16')]);module[_0xcb17('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index f036be6..c19a3e0 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 _0x3a8a=['sequelize','util','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x233bd4,_0x9235fa){var _0x5e834b=function(_0x3e12de){while(--_0x3e12de){_0x233bd4['push'](_0x233bd4['shift']());}};_0x5e834b(++_0x9235fa);}(_0x3a8a,0xff));var _0xa3a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a8a[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xa3a8('0x0'));var _=require('lodash');var util=require(_0xa3a8('0x1'));module['exports']={'name':{'type':Sequelize[_0xa3a8('0x2')],'unique':_0xa3a8('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa3a8('0x4')](_0xa3a8('0x5')),'set':function(_0x45ab46){if(_[_0xa3a8('0x6')](_0x45ab46)){this[_0xa3a8('0x7')]('formData',JSON[_0xa3a8('0x8')](_0x45ab46));}else if(_[_0xa3a8('0x9')](_0x45ab46)){this[_0xa3a8('0x7')](_0xa3a8('0xa'),_0x45ab46);}else{this[_0xa3a8('0x7')]('formData',util['format'](_0xa3a8('0xb'),this[_0xa3a8('0xc')]('name')||'',this[_0xa3a8('0xc')](_0xa3a8('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa3a8('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x305d=['formData','format','getDataValue','description','BOOLEAN','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString'];(function(_0x3d3ada,_0x1308b1){var _0xdf0059=function(_0x1a785b){while(--_0x1a785b){_0x3d3ada['push'](_0x3d3ada['shift']());}};_0xdf0059(++_0x1308b1);}(_0x305d,0x1c7));var _0xd305=function(_0x1baef2,_0x112ca3){_0x1baef2=_0x1baef2-0x0;var _0x560249=_0x305d[_0x1baef2];return _0x560249;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd305('0x0'));var util=require('util');module[_0xd305('0x1')]={'name':{'type':Sequelize[_0xd305('0x2')],'unique':_0xd305('0x3')},'description':{'type':Sequelize[_0xd305('0x2')]},'formData':{'type':Sequelize[_0xd305('0x4')](_0xd305('0x5')),'set':function(_0x5ec8ce){if(_[_0xd305('0x6')](_0x5ec8ce)){this[_0xd305('0x7')]('formData',JSON[_0xd305('0x8')](_0x5ec8ce));}else if(_[_0xd305('0x9')](_0x5ec8ce)){this['setDataValue'](_0xd305('0xa'),_0x5ec8ce);}else{this[_0xd305('0x7')](_0xd305('0xa'),util[_0xd305('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd305('0xc')](_0xd305('0x3'))||'',this[_0xd305('0xc')](_0xd305('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd305('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd305('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 8eb0002..66362cd 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 _0x82ee=['attachment;\x20filename=','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','merge','VIRTUAL','filter','where','includeAll','include','findAll','rows','catch','show','params','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','UserProfileSection','create','getSessions','findOne','pick','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','order','apply','indexOf','toString','getSummary','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition'];(function(_0x5b35ee,_0x5b142e){var _0x2bb1fa=function(_0xd58aa8){while(--_0xd58aa8){_0x5b35ee['push'](_0x5b35ee['shift']());}};_0x2bb1fa(++_0x5b142e);}(_0x82ee,0xeb));var _0xe82e=function(_0x220eba,_0x27000b){_0x220eba=_0x220eba-0x0;var _0x2fc662=_0x82ee[_0x220eba];return _0x2fc662;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe82e('0x0'));var zipdir=require(_0xe82e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe82e('0x2'));var moment=require(_0xe82e('0x3'));var BPromise=require(_0xe82e('0x4'));var Mustache=require(_0xe82e('0x5'));var util=require(_0xe82e('0x6'));var path=require(_0xe82e('0x7'));var sox=require(_0xe82e('0x8'));var csv=require(_0xe82e('0x9'));var ejs=require(_0xe82e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe82e('0xb'));var squel=require(_0xe82e('0xc'));var crypto=require(_0xe82e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe82e('0xe'));var toCsv=require(_0xe82e('0x9'));var querystring=require(_0xe82e('0xf'));var Papa=require('papaparse');var Redis=require(_0xe82e('0x10'));var authService=require(_0xe82e('0x11'));var qs=require(_0xe82e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe82e('0x13'));var logger=require('../../config/logger')(_0xe82e('0x14'));var utils=require('../../config/utils');var config=require(_0xe82e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe82e('0x16'))['db'];function respondWithStatusCode(_0x9a6a02,_0x8e23db){_0x8e23db=_0x8e23db||0xcc;return function(_0x4cc146){if(_0x4cc146){return _0x9a6a02[_0xe82e('0x17')](_0x8e23db);}return _0x9a6a02[_0xe82e('0x18')](_0x8e23db)[_0xe82e('0x19')]();};}function respondWithResult(_0xa35c58,_0x2901a1){_0x2901a1=_0x2901a1||0xc8;return function(_0x2799e4){if(_0x2799e4){return _0xa35c58[_0xe82e('0x18')](_0x2901a1)[_0xe82e('0x1a')](_0x2799e4);}};}function respondWithFilteredResult(_0xe1fefa,_0x4e7dde){return function(_0x12d640){if(_0x12d640){var _0x4ade4b=typeof _0x4e7dde[_0xe82e('0x1b')]===_0xe82e('0x1c')&&typeof _0x4e7dde[_0xe82e('0x1d')]==='undefined';var _0x4e6b3f=_0x12d640['count'];var _0x19d95d=_0x4ade4b?0x0:_0x4e7dde[_0xe82e('0x1b')];var _0x17c355=_0x4ade4b?_0x12d640[_0xe82e('0x1e')]:_0x4e7dde[_0xe82e('0x1b')]+_0x4e7dde[_0xe82e('0x1d')];var _0x3b518b;if(_0x17c355>=_0x4e6b3f){_0x17c355=_0x4e6b3f;_0x3b518b=0xc8;}else{_0x3b518b=0xce;}_0xe1fefa[_0xe82e('0x18')](_0x3b518b);return _0xe1fefa['set'](_0xe82e('0x1f'),_0x19d95d+'-'+_0x17c355+'/'+_0x4e6b3f)[_0xe82e('0x1a')](_0x12d640);}return null;};}function patchUpdates(_0x1435e1){return function(_0x529fbf){try{jsonpatch['apply'](_0x529fbf,_0x1435e1,!![]);}catch(_0x41ccb6){return BPromise[_0xe82e('0x20')](_0x41ccb6);}return _0x529fbf['save']();};}function saveUpdates(_0x3cc4be,_0x8dfd0){return function(_0x298ee6){if(_0x298ee6){return _0x298ee6['update'](_0x3cc4be)[_0xe82e('0x21')](function(_0x437f58){return _0x437f58;});}return null;};}function removeEntity(_0x58b026,_0x4f5baf){return function(_0x5694b0){if(_0x5694b0){return _0x5694b0[_0xe82e('0x22')]()[_0xe82e('0x21')](function(){var _0x47b767=_0x5694b0[_0xe82e('0x23')]({'plain':!![]});var _0x24f76b=_0xe82e('0x24');return db[_0xe82e('0x25')][_0xe82e('0x22')]({'where':{'type':_0x24f76b,'resourceId':_0x47b767['id']}})[_0xe82e('0x21')](function(){return _0x5694b0;});})[_0xe82e('0x21')](function(){_0x58b026[_0xe82e('0x18')](0xcc)[_0xe82e('0x19')]();});}};}function handleEntityNotFound(_0x4d67cc,_0x5999ba){return function(_0x2e96b8){if(!_0x2e96b8){_0x4d67cc[_0xe82e('0x17')](0x194);}return _0x2e96b8;};}function handleError(_0x2e2aa5,_0x2a6e6e){_0x2a6e6e=_0x2a6e6e||0x1f4;return function(_0x320be1){logger[_0xe82e('0x26')](_0x320be1[_0xe82e('0x27')]);if(_0x320be1[_0xe82e('0x28')]){delete _0x320be1[_0xe82e('0x28')];}_0x2e2aa5['status'](_0x2a6e6e)[_0xe82e('0x29')](_0x320be1);};}exports['index']=function(_0x514d26,_0x231436){var _0x18f629={},_0x5da25b={},_0x49e066={'count':0x0,'rows':[]};var _0x4928fd=_[_0xe82e('0x2a')](db[_0xe82e('0x2b')][_0xe82e('0x2c')],function(_0x27fcfb){return{'name':_0x27fcfb[_0xe82e('0x2d')],'type':_0x27fcfb[_0xe82e('0x2e')]['key']};});_0x5da25b['model']=_[_0xe82e('0x2a')](_0x4928fd,_0xe82e('0x28'));_0x5da25b[_0xe82e('0x2f')]=_[_0xe82e('0x30')](_0x514d26[_0xe82e('0x2f')]);_0x5da25b[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x5da25b['model'],_0x5da25b['query']);_0x18f629[_0xe82e('0x33')]=_['intersection'](_0x5da25b[_0xe82e('0x34')],qs['fields'](_0x514d26[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x18f629['attributes']=_0x18f629['attributes'][_0xe82e('0x36')]?_0x18f629[_0xe82e('0x33')]:_0x5da25b[_0xe82e('0x34')];if(!_0x514d26[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x18f629['limit']=qs[_0xe82e('0x1d')](_0x514d26[_0xe82e('0x2f')]['limit']);_0x18f629['offset']=qs[_0xe82e('0x1b')](_0x514d26[_0xe82e('0x2f')][_0xe82e('0x1b')]);}_0x18f629['order']=qs[_0xe82e('0x39')](_0x514d26['query']['sort']);_0x18f629['where']=qs[_0xe82e('0x31')](_['pick'](_0x514d26['query'],_0x5da25b[_0xe82e('0x31')]),_0x4928fd);if(_0x514d26['query']['filter']){_0x18f629['where']=_[_0xe82e('0x3a')](_0x18f629['where'],{'$or':_[_0xe82e('0x2a')](_0x4928fd,function(_0x4428f0){if(_0x4428f0['type']!==_0xe82e('0x3b')){var _0x12dbd5={};_0x12dbd5[_0x4428f0[_0xe82e('0x28')]]={'$like':'%'+_0x514d26[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x12dbd5;}})});}_0x18f629=_['merge']({},_0x18f629,_0x514d26['options']);var _0x5add74={'where':_0x18f629[_0xe82e('0x3d')]};return db[_0xe82e('0x2b')][_0xe82e('0x1e')](_0x5add74)[_0xe82e('0x21')](function(_0x8c1ee){_0x49e066[_0xe82e('0x1e')]=_0x8c1ee;if(_0x514d26[_0xe82e('0x2f')][_0xe82e('0x3e')]){_0x18f629[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x2b')][_0xe82e('0x40')](_0x18f629);})[_0xe82e('0x21')](function(_0x36e20d){_0x49e066[_0xe82e('0x41')]=_0x36e20d;return _0x49e066;})[_0xe82e('0x21')](respondWithFilteredResult(_0x231436,_0x18f629))[_0xe82e('0x42')](handleError(_0x231436,null));};exports[_0xe82e('0x43')]=function(_0x540839,_0xe0e5b7){var _0x238bbc={'raw':![],'where':{'id':_0x540839[_0xe82e('0x44')]['id']}},_0x248b23={};_0x248b23[_0xe82e('0x34')]=_['keys'](db[_0xe82e('0x2b')][_0xe82e('0x2c')]);_0x248b23[_0xe82e('0x2f')]=_['keys'](_0x540839['query']);_0x248b23[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x248b23['model'],_0x248b23[_0xe82e('0x2f')]);_0x238bbc['attributes']=_[_0xe82e('0x32')](_0x248b23[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x540839['query'][_0xe82e('0x35')]));_0x238bbc['attributes']=_0x238bbc[_0xe82e('0x33')][_0xe82e('0x36')]?_0x238bbc[_0xe82e('0x33')]:_0x248b23[_0xe82e('0x34')];if(_0x540839[_0xe82e('0x2f')]['includeAll']){_0x238bbc['include']=[{'all':!![]}];}_0x238bbc=_[_0xe82e('0x3a')]({},_0x238bbc,_0x540839[_0xe82e('0x45')]);return db['JscriptyProject'][_0xe82e('0x46')](_0x238bbc)['then'](handleEntityNotFound(_0xe0e5b7,null))['then'](respondWithResult(_0xe0e5b7,null))[_0xe82e('0x42')](handleError(_0xe0e5b7,null));};exports['create']=function(_0x1a4ee5,_0x4081b5){return db[_0xe82e('0x2b')]['create'](_0x1a4ee5[_0xe82e('0x47')],{})[_0xe82e('0x21')](function(_0x5421b6){var _0x4e3e69=_0x1a4ee5['user'][_0xe82e('0x23')]({'plain':!![]});if(!_0x4e3e69)throw new Error(_0xe82e('0x48'));if(_0x4e3e69[_0xe82e('0x49')]===_0xe82e('0x4a')){var _0x2da452=_0x5421b6['get']({'plain':!![]});var _0x133400='Projects';return db['UserProfileSection'][_0xe82e('0x46')]({'where':{'name':_0x133400,'userProfileId':_0x4e3e69[_0xe82e('0x4b')]},'raw':!![]})[_0xe82e('0x21')](function(_0x13eabd){if(_0x13eabd&&_0x13eabd[_0xe82e('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x2da452[_0xe82e('0x28')],'resourceId':_0x2da452['id'],'type':_0x13eabd[_0xe82e('0x28')],'sectionId':_0x13eabd['id']},{})[_0xe82e('0x21')](function(){return _0x5421b6;});}else{return _0x5421b6;}})[_0xe82e('0x42')](function(_0x3130a3){logger[_0xe82e('0x26')](_0xe82e('0x4d'),_0x3130a3);throw _0x3130a3;});}return _0x5421b6;})[_0xe82e('0x21')](respondWithResult(_0x4081b5,0xc9))['catch'](handleError(_0x4081b5,null));};exports[_0xe82e('0x4e')]=function(_0x4460ff,_0x2a8986){var _0x238e10={'where':{'id':_0x4460ff[_0xe82e('0x44')]['id']}},_0x524f9c={};_0x524f9c[_0xe82e('0x34')]=_[_0xe82e('0x30')](db[_0xe82e('0x2b')]['rawAttributes']);_0x238e10[_0xe82e('0x33')]=_[_0xe82e('0x32')](_0x524f9c[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x4460ff[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x238e10[_0xe82e('0x33')]=_0x238e10[_0xe82e('0x33')][_0xe82e('0x36')]?_0x238e10[_0xe82e('0x33')]:_0x524f9c[_0xe82e('0x34')];if(_0x4460ff['query']['includeAll']){_0x238e10[_0xe82e('0x3f')]=[{'all':!![]}];}_0x238e10=_['merge']({},_0x238e10,_0x4460ff[_0xe82e('0x45')]);return db[_0xe82e('0x2b')]['find'](_0x238e10)[_0xe82e('0x21')](handleEntityNotFound(_0x2a8986,null))[_0xe82e('0x21')](function(_0xc82755){if(_0xc82755){var _0x3fc0cc=_0xc82755['get']({'plain':!![]});_0x3fc0cc=qs['omit'](_0x3fc0cc,['id','createdAt',_0xe82e('0x4f')]);_0x4460ff[_0xe82e('0x47')]=_[_0xe82e('0x50')](_0x4460ff[_0xe82e('0x47')],['id',_0xe82e('0x51'),_0xe82e('0x4f')]);return db[_0xe82e('0x2b')]['create'](_['merge'](_0x3fc0cc,_0x4460ff['body']),{'include':_0x4460ff[_0xe82e('0x2f')][_0xe82e('0x3e')]?[{'all':!![]}]:undefined})[_0xe82e('0x21')](function(_0x3b86cd){var _0x1d47cf=_0x4460ff[_0xe82e('0x4a')]['get']({'plain':!![]});if(!_0x1d47cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d47cf[_0xe82e('0x49')]===_0xe82e('0x4a')){var _0x324f86=_0x3b86cd[_0xe82e('0x23')]({'plain':!![]});var _0xa3b19e=_0xe82e('0x24');return db[_0xe82e('0x52')]['find']({'where':{'name':_0xa3b19e,'userProfileId':_0x1d47cf[_0xe82e('0x4b')]},'raw':!![]})[_0xe82e('0x21')](function(_0x14dc59){if(_0x14dc59&&_0x14dc59[_0xe82e('0x4c')]===0x0){return db[_0xe82e('0x25')][_0xe82e('0x53')]({'name':_0x324f86[_0xe82e('0x28')],'resourceId':_0x324f86['id'],'type':_0x14dc59[_0xe82e('0x28')],'sectionId':_0x14dc59['id']},{})['then'](function(){return _0x3b86cd;});}else{return _0x3b86cd;}})[_0xe82e('0x42')](function(_0x103652){logger[_0xe82e('0x26')](_0xe82e('0x4d'),_0x103652);throw _0x103652;});}return _0x3b86cd;});}})['then'](respondWithResult(_0x2a8986,0xc9))['catch'](handleError(_0x2a8986,null));};exports['update']=function(_0x2b4f31,_0x2524ec){if(_0x2b4f31[_0xe82e('0x47')]['id']){delete _0x2b4f31['body']['id'];}return db[_0xe82e('0x2b')][_0xe82e('0x46')]({'where':{'id':_0x2b4f31['params']['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x2524ec,null))['then'](saveUpdates(_0x2b4f31[_0xe82e('0x47')],null))[_0xe82e('0x21')](respondWithResult(_0x2524ec,null))['catch'](handleError(_0x2524ec,null));};exports[_0xe82e('0x22')]=function(_0x299a22,_0x50df93){return db[_0xe82e('0x2b')][_0xe82e('0x46')]({'where':{'id':_0x299a22[_0xe82e('0x44')]['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x50df93,null))[_0xe82e('0x21')](removeEntity(_0x50df93,null))[_0xe82e('0x42')](handleError(_0x50df93,null));};exports[_0xe82e('0x54')]=function(_0x19eb60,_0x509ca8,_0x3de60d){var _0x5b7c6f={'raw':!![],'where':{}};var _0x5da2e0={};var _0x3d9e3a={'count':0x0,'rows':[]};return db[_0xe82e('0x2b')][_0xe82e('0x55')]({'where':{'id':_0x19eb60['params']['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x509ca8,null))[_0xe82e('0x21')](function(_0x13c923){if(_0x13c923){_0x5da2e0[_0xe82e('0x34')]=_[_0xe82e('0x30')](db['JscriptySessionReport'][_0xe82e('0x2c')]);_0x5da2e0[_0xe82e('0x2f')]=_['keys'](_0x19eb60[_0xe82e('0x2f')]);_0x5da2e0[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x5da2e0[_0xe82e('0x34')],_0x5da2e0[_0xe82e('0x2f')]);_0x5b7c6f['attributes']=_[_0xe82e('0x32')](_0x5da2e0[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x19eb60['query'][_0xe82e('0x35')]));_0x5b7c6f[_0xe82e('0x33')]=_0x5b7c6f[_0xe82e('0x33')][_0xe82e('0x36')]?_0x5b7c6f[_0xe82e('0x33')]:_0x5da2e0[_0xe82e('0x34')];if(!_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x5b7c6f[_0xe82e('0x1d')]=qs['limit'](_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x1d')]);_0x5b7c6f[_0xe82e('0x1b')]=qs[_0xe82e('0x1b')](_0x19eb60[_0xe82e('0x2f')]['offset']);}_0x5b7c6f['order']=qs['sort'](_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x39')]);_0x5b7c6f[_0xe82e('0x3d')]=qs[_0xe82e('0x31')](_[_0xe82e('0x56')](_0x19eb60['query'],_0x5da2e0[_0xe82e('0x31')]));_0x5b7c6f[_0xe82e('0x3d')][_0xe82e('0x57')]=_0x13c923['id'];if(_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3c')]){_0x5b7c6f['where']=_['merge'](_0x5b7c6f[_0xe82e('0x3d')],{'$or':_[_0xe82e('0x2a')](_0x5b7c6f[_0xe82e('0x33')],function(_0x1d8b11){var _0x52b16e={};_0x52b16e[_0x1d8b11]={'$like':'%'+_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x52b16e;})});}_0x5b7c6f=_[_0xe82e('0x3a')]({},_0x5b7c6f,_0x19eb60[_0xe82e('0x45')]);return db[_0xe82e('0x58')][_0xe82e('0x1e')]({'where':_0x5b7c6f[_0xe82e('0x3d')]})[_0xe82e('0x21')](function(_0x5db1a9){_0x3d9e3a['count']=_0x5db1a9;if(_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3e')]){_0x5b7c6f[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x58')][_0xe82e('0x40')](_0x5b7c6f);})['then'](function(_0x591c27){_0x3d9e3a[_0xe82e('0x41')]=_0x591c27;return _0x3d9e3a;});}})[_0xe82e('0x21')](respondWithFilteredResult(_0x509ca8,_0x5b7c6f))[_0xe82e('0x42')](handleError(_0x509ca8,null));};exports[_0xe82e('0x59')]=function(_0x3b79c3,_0x5ad7a7,_0x3b5404){var _0x3fc6a1={'raw':!![],'where':{}};var _0x2a1529={};var _0x555c1e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe82e('0x55')]({'where':{'id':_0x3b79c3[_0xe82e('0x44')]['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x5ad7a7,null))[_0xe82e('0x21')](function(_0x4b5699){if(_0x4b5699){_0x2a1529[_0xe82e('0x34')]=_[_0xe82e('0x30')](db[_0xe82e('0x5a')][_0xe82e('0x2c')]);_0x2a1529[_0xe82e('0x2f')]=_[_0xe82e('0x30')](_0x3b79c3['query']);_0x2a1529[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x2a1529[_0xe82e('0x34')],_0x2a1529[_0xe82e('0x2f')]);_0x3fc6a1[_0xe82e('0x33')]=_[_0xe82e('0x32')](_0x2a1529[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x3fc6a1['attributes']=_0x3fc6a1[_0xe82e('0x33')][_0xe82e('0x36')]?_0x3fc6a1[_0xe82e('0x33')]:_0x2a1529[_0xe82e('0x34')];if(!_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x3fc6a1[_0xe82e('0x1d')]=qs[_0xe82e('0x1d')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x1d')]);_0x3fc6a1[_0xe82e('0x1b')]=qs['offset'](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x1b')]);}_0x3fc6a1[_0xe82e('0x5b')]=qs[_0xe82e('0x39')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x39')]);_0x3fc6a1['where']=qs[_0xe82e('0x31')](_[_0xe82e('0x56')](_0x3b79c3[_0xe82e('0x2f')],_0x2a1529[_0xe82e('0x31')]));_0x3fc6a1[_0xe82e('0x3d')][_0xe82e('0x57')]=_0x4b5699['id'];if(_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x3c')]){_0x3fc6a1[_0xe82e('0x3d')]=_[_0xe82e('0x3a')](_0x3fc6a1['where'],{'$or':_[_0xe82e('0x2a')](_0x3fc6a1[_0xe82e('0x33')],function(_0x31eb87){var _0x3f4375={};_0x3f4375[_0x31eb87]={'$like':'%'+_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x3f4375;})});}_0x3fc6a1=_[_0xe82e('0x3a')]({},_0x3fc6a1,_0x3b79c3['options']);return db[_0xe82e('0x5a')][_0xe82e('0x1e')]({'where':_0x3fc6a1[_0xe82e('0x3d')]})[_0xe82e('0x21')](function(_0x13953f){_0x555c1e['count']=_0x13953f;if(_0x3b79c3['query']['includeAll']){_0x3fc6a1[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x5a')]['findAll'](_0x3fc6a1);})['then'](function(_0xfff4aa){_0x555c1e[_0xe82e('0x41')]=_0xfff4aa;return _0x555c1e;});}})[_0xe82e('0x21')](respondWithFilteredResult(_0x5ad7a7,_0x3fc6a1))[_0xe82e('0x42')](handleError(_0x5ad7a7,null));};function char(_0x3ee3e0){return'number'===typeof _0x3ee3e0?String['fromCharCode'][_0xe82e('0x5c')](null,arguments):_0x3ee3e0;}function needsEncapsulation(_0x54fe77){return!!_0x54fe77&&(_0x54fe77['toString']()[_0xe82e('0x5d')](char(0xd))>=0x0||_0x54fe77[_0xe82e('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x54fe77['toString']()[_0xe82e('0x5d')](char(0x2c))>=0x0||_0x54fe77[_0xe82e('0x5e')]()[_0xe82e('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x57cc07){var _0x488098=char(0x22),_0x4b00de='\x5c'+char(0x22),_0x543b27=_0x57cc07['toString']()['replace'](new RegExp(_0x488098,'g'),_0x4b00de);return _0x488098+_0x543b27+_0x488098;}exports[_0xe82e('0x5f')]=function(_0x2ef30d,_0x1baf57,_0x280cd1){var _0x13183e,_0xd6aa32;var _0x121ccf={'where':{'ProjectId':_0x2ef30d['params']['id']}};if(_0x2ef30d[_0xe82e('0x2f')]['startTime']){_0x121ccf[_0xe82e('0x3d')]['starttime']=JSON[_0xe82e('0x60')](_0x2ef30d['query']['startTime']);}return db['JscriptySessionReport'][_0xe82e('0x40')](_0x121ccf)[_0xe82e('0x21')](handleEntityNotFound(_0x1baf57,null))[_0xe82e('0x21')](function(_0x6e3bd6){if(_0x6e3bd6){_0x13183e=_0x6e3bd6;return db[_0xe82e('0x61')][_0xe82e('0x40')]({'where':{'SessionId':{'$in':_['map'](_0x13183e,'id')},'ProjectId':_0x2ef30d[_0xe82e('0x44')]['id']},'order':'-createdAt'});}})[_0xe82e('0x21')](handleEntityNotFound(_0x1baf57,null))[_0xe82e('0x21')](function(_0x58ad25){if(_0x58ad25){_0xd6aa32=_0x58ad25;var _0x2048db={};for(var _0x2725ac=0x0,_0x1ee5ab=_0xd6aa32[_0xe82e('0x36')];_0x2725ac<_0x1ee5ab;_0x2725ac++){if(!_0x2048db[_0xe82e('0x37')](_0xd6aa32[_0x2725ac][_0xe82e('0x62')])){_0x2048db[_0xd6aa32[_0x2725ac][_0xe82e('0x62')]]=needsEncapsulation(_0xd6aa32[_0x2725ac]['question'])?encapsulate(_0xd6aa32[_0x2725ac]['question']):_0xd6aa32[_0x2725ac][_0xe82e('0x63')];}}var _0x1297b6=[],_0x3231ae={};for(var _0x5657f5=0x0,_0x466295=_0x13183e[_0xe82e('0x36')];_0x5657f5<_0x466295;_0x5657f5++){_0x3231ae={'ProjectId':_0x2ef30d[_0xe82e('0x44')]['id'],'SessionId':_0x13183e[_0x5657f5]['id'],'StartTime':moment(_0x13183e[_0x5657f5]['starttime'])[_0xe82e('0x64')](_0xe82e('0x65'))};for(var _0x209d1e=0x0,_0x53adcd=_0xd6aa32[_0xe82e('0x36')];_0x209d1e<_0x53adcd;_0x209d1e++){if(_0xd6aa32[_0x209d1e][_0xe82e('0x66')]==_0x13183e[_0x5657f5]['id']&&_0x2048db[_0xe82e('0x37')](_0xd6aa32[_0x209d1e]['questionId'])){_0x3231ae[_0x2048db[_0xd6aa32[_0x209d1e][_0xe82e('0x62')]]]=_0xd6aa32[_0x209d1e][_0xe82e('0x67')];}}for(var _0x1f4680 in _0x2048db){if(!_0x3231ae['hasOwnProperty'](_0x2048db[_0x1f4680])){_0x3231ae[_0x2048db[_0x1f4680]]=null;}}_0x1297b6[_0xe82e('0x68')](_0x3231ae);}return _0x1297b6;}})[_0xe82e('0x21')](function(_0xf13131){if(!_[_0xe82e('0x69')](_0xf13131)){var _0x397efb=toCsv(_0xf13131);var _0x4ad8f0=Date[_0xe82e('0x6a')]();fs[_0xe82e('0x6b')](util[_0xe82e('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2ef30d['params']['id'],_0x4ad8f0),_0x397efb);_0x1baf57[_0xe82e('0x6c')](_0xe82e('0x6d'),_0xe82e('0x6e')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x2ef30d['params']['id'],_0x4ad8f0));_0x1baf57[_0xe82e('0x6c')](_0xe82e('0x6f'),_0xe82e('0x70'));return _0x1baf57[_0xe82e('0x71')](util[_0xe82e('0x64')](_0xe82e('0x72'),_0x2ef30d['params']['id'],_0x4ad8f0));}else{return _0x1baf57[_0xe82e('0x17')](0xcc);}})[_0xe82e('0x42')](handleError(_0x1baf57,null));}; \ No newline at end of file +var _0xc719=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','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','../../config/logger','api','../../config/license/util','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Projects','UserProfileResource','error','stack','name','map','JscriptyProject','type','key','model','query','keys','filters','fields','attributes','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','update','getSessions','findOne','hasOwnProperty','nolimit','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','-createdAt','question','SessionId','questionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','format','eml-format','rimraf'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0xc719,0x1d2));var _0x9c71=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xc719[_0x402c8f];return _0x11e809;};'use strict';var emlformat=require(_0x9c71('0x0'));var rimraf=require(_0x9c71('0x1'));var zipdir=require(_0x9c71('0x2'));var jsonpatch=require(_0x9c71('0x3'));var rp=require(_0x9c71('0x4'));var moment=require('moment');var BPromise=require(_0x9c71('0x5'));var Mustache=require('mustache');var util=require(_0x9c71('0x6'));var path=require(_0x9c71('0x7'));var sox=require(_0x9c71('0x8'));var csv=require(_0x9c71('0x9'));var ejs=require(_0x9c71('0xa'));var fs=require('fs');var fs_extra=require(_0x9c71('0xb'));var _=require(_0x9c71('0xc'));var squel=require(_0x9c71('0xd'));var crypto=require('crypto');var jsforce=require(_0x9c71('0xe'));var deskjs=require(_0x9c71('0xf'));var toCsv=require(_0x9c71('0x9'));var querystring=require(_0x9c71('0x10'));var Papa=require(_0x9c71('0x11'));var Redis=require(_0x9c71('0x12'));var authService=require(_0x9c71('0x13'));var qs=require(_0x9c71('0x14'));var as=require(_0x9c71('0x15'));var hardwareService=require(_0x9c71('0x16'));var logger=require(_0x9c71('0x17'))(_0x9c71('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c71('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ed326,_0x4c2767){_0x4c2767=_0x4c2767||0xcc;return function(_0x269fe4){if(_0x269fe4){return _0x3ed326[_0x9c71('0x1a')](_0x4c2767);}return _0x3ed326[_0x9c71('0x1b')](_0x4c2767)['end']();};}function respondWithResult(_0x2b0490,_0x4a5095){_0x4a5095=_0x4a5095||0xc8;return function(_0x28a385){if(_0x28a385){return _0x2b0490['status'](_0x4a5095)['json'](_0x28a385);}};}function respondWithFilteredResult(_0x232212,_0x27cffc){return function(_0x4c39b5){if(_0x4c39b5){var _0x53f556=typeof _0x27cffc['offset']===_0x9c71('0x1c')&&typeof _0x27cffc['limit']===_0x9c71('0x1c');var _0x1e8f7f=_0x4c39b5['count'];var _0x3941b9=_0x53f556?0x0:_0x27cffc[_0x9c71('0x1d')];var _0x550bc1=_0x53f556?_0x4c39b5[_0x9c71('0x1e')]:_0x27cffc[_0x9c71('0x1d')]+_0x27cffc[_0x9c71('0x1f')];var _0x34f171;if(_0x550bc1>=_0x1e8f7f){_0x550bc1=_0x1e8f7f;_0x34f171=0xc8;}else{_0x34f171=0xce;}_0x232212[_0x9c71('0x1b')](_0x34f171);return _0x232212[_0x9c71('0x20')](_0x9c71('0x21'),_0x3941b9+'-'+_0x550bc1+'/'+_0x1e8f7f)[_0x9c71('0x22')](_0x4c39b5);}return null;};}function patchUpdates(_0x2a50f4){return function(_0x138fb3){try{jsonpatch[_0x9c71('0x23')](_0x138fb3,_0x2a50f4,!![]);}catch(_0x1300d5){return BPromise[_0x9c71('0x24')](_0x1300d5);}return _0x138fb3[_0x9c71('0x25')]();};}function saveUpdates(_0x4bc9ac,_0x5bdddb){return function(_0x329b85){if(_0x329b85){return _0x329b85['update'](_0x4bc9ac)[_0x9c71('0x26')](function(_0x12c871){return _0x12c871;});}return null;};}function removeEntity(_0x4e34e6,_0xdfa2ed){return function(_0x23b8c1){if(_0x23b8c1){return _0x23b8c1[_0x9c71('0x27')]()[_0x9c71('0x26')](function(){var _0x377b99=_0x23b8c1[_0x9c71('0x28')]({'plain':!![]});var _0x5aa446=_0x9c71('0x29');return db[_0x9c71('0x2a')][_0x9c71('0x27')]({'where':{'type':_0x5aa446,'resourceId':_0x377b99['id']}})[_0x9c71('0x26')](function(){return _0x23b8c1;});})[_0x9c71('0x26')](function(){_0x4e34e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xca3988,_0xb568ff){return function(_0x4747d0){if(!_0x4747d0){_0xca3988[_0x9c71('0x1a')](0x194);}return _0x4747d0;};}function handleError(_0x27e2ec,_0x4836e5){_0x4836e5=_0x4836e5||0x1f4;return function(_0xd9ce71){logger[_0x9c71('0x2b')](_0xd9ce71[_0x9c71('0x2c')]);if(_0xd9ce71[_0x9c71('0x2d')]){delete _0xd9ce71[_0x9c71('0x2d')];}_0x27e2ec[_0x9c71('0x1b')](_0x4836e5)['send'](_0xd9ce71);};}exports['index']=function(_0x18a51a,_0x408b58){var _0x3179e6={},_0xf9c2f4={},_0x50525b={'count':0x0,'rows':[]};var _0x10afaf=_[_0x9c71('0x2e')](db[_0x9c71('0x2f')]['rawAttributes'],function(_0x21c374){return{'name':_0x21c374['fieldName'],'type':_0x21c374[_0x9c71('0x30')][_0x9c71('0x31')]};});_0xf9c2f4[_0x9c71('0x32')]=_[_0x9c71('0x2e')](_0x10afaf,_0x9c71('0x2d'));_0xf9c2f4[_0x9c71('0x33')]=_[_0x9c71('0x34')](_0x18a51a['query']);_0xf9c2f4[_0x9c71('0x35')]=_['intersection'](_0xf9c2f4[_0x9c71('0x32')],_0xf9c2f4[_0x9c71('0x33')]);_0x3179e6['attributes']=_['intersection'](_0xf9c2f4[_0x9c71('0x32')],qs['fields'](_0x18a51a[_0x9c71('0x33')][_0x9c71('0x36')]));_0x3179e6['attributes']=_0x3179e6[_0x9c71('0x37')][_0x9c71('0x38')]?_0x3179e6['attributes']:_0xf9c2f4['model'];if(!_0x18a51a[_0x9c71('0x33')]['hasOwnProperty']('nolimit')){_0x3179e6[_0x9c71('0x1f')]=qs['limit'](_0x18a51a['query'][_0x9c71('0x1f')]);_0x3179e6[_0x9c71('0x1d')]=qs[_0x9c71('0x1d')](_0x18a51a['query']['offset']);}_0x3179e6[_0x9c71('0x39')]=qs[_0x9c71('0x3a')](_0x18a51a['query'][_0x9c71('0x3a')]);_0x3179e6[_0x9c71('0x3b')]=qs['filters'](_[_0x9c71('0x3c')](_0x18a51a[_0x9c71('0x33')],_0xf9c2f4[_0x9c71('0x35')]),_0x10afaf);if(_0x18a51a[_0x9c71('0x33')][_0x9c71('0x3d')]){_0x3179e6[_0x9c71('0x3b')]=_[_0x9c71('0x3e')](_0x3179e6['where'],{'$or':_['map'](_0x10afaf,function(_0x4a5e69){if(_0x4a5e69[_0x9c71('0x30')]!=='VIRTUAL'){var _0x2d9123={};_0x2d9123[_0x4a5e69[_0x9c71('0x2d')]]={'$like':'%'+_0x18a51a[_0x9c71('0x33')][_0x9c71('0x3d')]+'%'};return _0x2d9123;}})});}_0x3179e6=_[_0x9c71('0x3e')]({},_0x3179e6,_0x18a51a[_0x9c71('0x3f')]);var _0x2eadc8={'where':_0x3179e6['where']};return db[_0x9c71('0x2f')][_0x9c71('0x1e')](_0x2eadc8)['then'](function(_0x2e1048){_0x50525b[_0x9c71('0x1e')]=_0x2e1048;if(_0x18a51a[_0x9c71('0x33')]['includeAll']){_0x3179e6[_0x9c71('0x40')]=[{'all':!![]}];}return db[_0x9c71('0x2f')][_0x9c71('0x41')](_0x3179e6);})['then'](function(_0x35fa06){_0x50525b[_0x9c71('0x42')]=_0x35fa06;return _0x50525b;})[_0x9c71('0x26')](respondWithFilteredResult(_0x408b58,_0x3179e6))[_0x9c71('0x43')](handleError(_0x408b58,null));};exports[_0x9c71('0x44')]=function(_0x20a911,_0x17f95d){var _0x3959d8={'raw':![],'where':{'id':_0x20a911[_0x9c71('0x45')]['id']}},_0x46517a={};_0x46517a[_0x9c71('0x32')]=_[_0x9c71('0x34')](db['JscriptyProject'][_0x9c71('0x46')]);_0x46517a[_0x9c71('0x33')]=_[_0x9c71('0x34')](_0x20a911[_0x9c71('0x33')]);_0x46517a['filters']=_[_0x9c71('0x47')](_0x46517a['model'],_0x46517a[_0x9c71('0x33')]);_0x3959d8[_0x9c71('0x37')]=_[_0x9c71('0x47')](_0x46517a[_0x9c71('0x32')],qs['fields'](_0x20a911[_0x9c71('0x33')][_0x9c71('0x36')]));_0x3959d8[_0x9c71('0x37')]=_0x3959d8['attributes']['length']?_0x3959d8[_0x9c71('0x37')]:_0x46517a[_0x9c71('0x32')];if(_0x20a911['query'][_0x9c71('0x48')]){_0x3959d8['include']=[{'all':!![]}];}_0x3959d8=_[_0x9c71('0x3e')]({},_0x3959d8,_0x20a911[_0x9c71('0x3f')]);return db['JscriptyProject'][_0x9c71('0x49')](_0x3959d8)[_0x9c71('0x26')](handleEntityNotFound(_0x17f95d,null))[_0x9c71('0x26')](respondWithResult(_0x17f95d,null))[_0x9c71('0x43')](handleError(_0x17f95d,null));};exports[_0x9c71('0x4a')]=function(_0xa37348,_0x436ef0){return db[_0x9c71('0x2f')][_0x9c71('0x4a')](_0xa37348[_0x9c71('0x4b')],{})[_0x9c71('0x26')](function(_0x40bf2d){var _0x44476d=_0xa37348[_0x9c71('0x4c')]['get']({'plain':!![]});if(!_0x44476d)throw new Error(_0x9c71('0x4d'));if(_0x44476d[_0x9c71('0x4e')]===_0x9c71('0x4c')){var _0x5e0f92=_0x40bf2d[_0x9c71('0x28')]({'plain':!![]});var _0x535a8c=_0x9c71('0x29');return db['UserProfileSection'][_0x9c71('0x49')]({'where':{'name':_0x535a8c,'userProfileId':_0x44476d['userProfileId']},'raw':!![]})['then'](function(_0x3a3dbb){if(_0x3a3dbb&&_0x3a3dbb[_0x9c71('0x4f')]===0x0){return db[_0x9c71('0x2a')]['create']({'name':_0x5e0f92[_0x9c71('0x2d')],'resourceId':_0x5e0f92['id'],'type':_0x3a3dbb['name'],'sectionId':_0x3a3dbb['id']},{})['then'](function(){return _0x40bf2d;});}else{return _0x40bf2d;}})[_0x9c71('0x43')](function(_0x11dd47){logger[_0x9c71('0x2b')](_0x9c71('0x50'),_0x11dd47);throw _0x11dd47;});}return _0x40bf2d;})[_0x9c71('0x26')](respondWithResult(_0x436ef0,0xc9))[_0x9c71('0x43')](handleError(_0x436ef0,null));};exports[_0x9c71('0x51')]=function(_0x2a2d31,_0x27ec58){var _0x157163={'where':{'id':_0x2a2d31['params']['id']}},_0x2d9718={};_0x2d9718['model']=_['keys'](db['JscriptyProject']['rawAttributes']);_0x157163[_0x9c71('0x37')]=_[_0x9c71('0x47')](_0x2d9718[_0x9c71('0x32')],qs[_0x9c71('0x36')](_0x2a2d31['query'][_0x9c71('0x36')]));_0x157163[_0x9c71('0x37')]=_0x157163[_0x9c71('0x37')][_0x9c71('0x38')]?_0x157163['attributes']:_0x2d9718[_0x9c71('0x32')];if(_0x2a2d31[_0x9c71('0x33')]['includeAll']){_0x157163[_0x9c71('0x40')]=[{'all':!![]}];}_0x157163=_[_0x9c71('0x3e')]({},_0x157163,_0x2a2d31[_0x9c71('0x3f')]);return db['JscriptyProject'][_0x9c71('0x49')](_0x157163)[_0x9c71('0x26')](handleEntityNotFound(_0x27ec58,null))['then'](function(_0xb829a1){if(_0xb829a1){var _0x8b8e0d=_0xb829a1[_0x9c71('0x28')]({'plain':!![]});_0x8b8e0d=qs[_0x9c71('0x52')](_0x8b8e0d,['id',_0x9c71('0x53'),_0x9c71('0x54')]);_0x2a2d31[_0x9c71('0x4b')]=_[_0x9c71('0x52')](_0x2a2d31['body'],['id','createdAt',_0x9c71('0x54')]);return db[_0x9c71('0x2f')][_0x9c71('0x4a')](_[_0x9c71('0x3e')](_0x8b8e0d,_0x2a2d31[_0x9c71('0x4b')]),{'include':_0x2a2d31[_0x9c71('0x33')][_0x9c71('0x48')]?[{'all':!![]}]:undefined})[_0x9c71('0x26')](function(_0x367470){var _0x3a0f03=_0x2a2d31[_0x9c71('0x4c')][_0x9c71('0x28')]({'plain':!![]});if(!_0x3a0f03)throw new Error(_0x9c71('0x4d'));if(_0x3a0f03[_0x9c71('0x4e')]==='user'){var _0x4259b3=_0x367470[_0x9c71('0x28')]({'plain':!![]});var _0x149b6f=_0x9c71('0x29');return db[_0x9c71('0x55')]['find']({'where':{'name':_0x149b6f,'userProfileId':_0x3a0f03['userProfileId']},'raw':!![]})[_0x9c71('0x26')](function(_0x2f1846){if(_0x2f1846&&_0x2f1846['autoAssociation']===0x0){return db[_0x9c71('0x2a')]['create']({'name':_0x4259b3[_0x9c71('0x2d')],'resourceId':_0x4259b3['id'],'type':_0x2f1846['name'],'sectionId':_0x2f1846['id']},{})['then'](function(){return _0x367470;});}else{return _0x367470;}})[_0x9c71('0x43')](function(_0x3f80e7){logger[_0x9c71('0x2b')](_0x9c71('0x50'),_0x3f80e7);throw _0x3f80e7;});}return _0x367470;});}})[_0x9c71('0x26')](respondWithResult(_0x27ec58,0xc9))[_0x9c71('0x43')](handleError(_0x27ec58,null));};exports[_0x9c71('0x56')]=function(_0x11c6f6,_0x4885cf){if(_0x11c6f6[_0x9c71('0x4b')]['id']){delete _0x11c6f6['body']['id'];}return db[_0x9c71('0x2f')][_0x9c71('0x49')]({'where':{'id':_0x11c6f6[_0x9c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x4885cf,null))[_0x9c71('0x26')](saveUpdates(_0x11c6f6[_0x9c71('0x4b')],null))[_0x9c71('0x26')](respondWithResult(_0x4885cf,null))['catch'](handleError(_0x4885cf,null));};exports[_0x9c71('0x27')]=function(_0x1c700,_0x399044){return db[_0x9c71('0x2f')][_0x9c71('0x49')]({'where':{'id':_0x1c700[_0x9c71('0x45')]['id']}})[_0x9c71('0x26')](handleEntityNotFound(_0x399044,null))[_0x9c71('0x26')](removeEntity(_0x399044,null))[_0x9c71('0x43')](handleError(_0x399044,null));};exports[_0x9c71('0x57')]=function(_0x1b468c,_0x3e75f3,_0x5900e9){var _0x24505c={'raw':!![],'where':{}};var _0x3f2266={};var _0x5b7bf4={'count':0x0,'rows':[]};return db[_0x9c71('0x2f')][_0x9c71('0x58')]({'where':{'id':_0x1b468c[_0x9c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e75f3,null))[_0x9c71('0x26')](function(_0x5d783c){if(_0x5d783c){_0x3f2266[_0x9c71('0x32')]=_['keys'](db['JscriptySessionReport'][_0x9c71('0x46')]);_0x3f2266[_0x9c71('0x33')]=_[_0x9c71('0x34')](_0x1b468c['query']);_0x3f2266['filters']=_[_0x9c71('0x47')](_0x3f2266[_0x9c71('0x32')],_0x3f2266[_0x9c71('0x33')]);_0x24505c['attributes']=_[_0x9c71('0x47')](_0x3f2266[_0x9c71('0x32')],qs[_0x9c71('0x36')](_0x1b468c['query'][_0x9c71('0x36')]));_0x24505c['attributes']=_0x24505c[_0x9c71('0x37')]['length']?_0x24505c[_0x9c71('0x37')]:_0x3f2266[_0x9c71('0x32')];if(!_0x1b468c['query'][_0x9c71('0x59')](_0x9c71('0x5a'))){_0x24505c[_0x9c71('0x1f')]=qs[_0x9c71('0x1f')](_0x1b468c[_0x9c71('0x33')][_0x9c71('0x1f')]);_0x24505c[_0x9c71('0x1d')]=qs[_0x9c71('0x1d')](_0x1b468c[_0x9c71('0x33')]['offset']);}_0x24505c[_0x9c71('0x39')]=qs['sort'](_0x1b468c[_0x9c71('0x33')][_0x9c71('0x3a')]);_0x24505c[_0x9c71('0x3b')]=qs[_0x9c71('0x35')](_['pick'](_0x1b468c[_0x9c71('0x33')],_0x3f2266['filters']));_0x24505c[_0x9c71('0x3b')][_0x9c71('0x5b')]=_0x5d783c['id'];if(_0x1b468c[_0x9c71('0x33')][_0x9c71('0x3d')]){_0x24505c['where']=_[_0x9c71('0x3e')](_0x24505c[_0x9c71('0x3b')],{'$or':_[_0x9c71('0x2e')](_0x24505c[_0x9c71('0x37')],function(_0x5a65a0){var _0xd94867={};_0xd94867[_0x5a65a0]={'$like':'%'+_0x1b468c['query'][_0x9c71('0x3d')]+'%'};return _0xd94867;})});}_0x24505c=_[_0x9c71('0x3e')]({},_0x24505c,_0x1b468c[_0x9c71('0x3f')]);return db[_0x9c71('0x5c')][_0x9c71('0x1e')]({'where':_0x24505c[_0x9c71('0x3b')]})[_0x9c71('0x26')](function(_0x4477af){_0x5b7bf4[_0x9c71('0x1e')]=_0x4477af;if(_0x1b468c[_0x9c71('0x33')][_0x9c71('0x48')]){_0x24505c[_0x9c71('0x40')]=[{'all':!![]}];}return db[_0x9c71('0x5c')]['findAll'](_0x24505c);})[_0x9c71('0x26')](function(_0x40bbae){_0x5b7bf4[_0x9c71('0x42')]=_0x40bbae;return _0x5b7bf4;});}})[_0x9c71('0x26')](respondWithFilteredResult(_0x3e75f3,_0x24505c))[_0x9c71('0x43')](handleError(_0x3e75f3,null));};exports[_0x9c71('0x5d')]=function(_0x44591a,_0x4875f3,_0x13b793){var _0x47c7be={'raw':!![],'where':{}};var _0x2dd90b={};var _0xe139a4={'count':0x0,'rows':[]};return db[_0x9c71('0x2f')]['findOne']({'where':{'id':_0x44591a[_0x9c71('0x45')]['id']}})[_0x9c71('0x26')](handleEntityNotFound(_0x4875f3,null))[_0x9c71('0x26')](function(_0x551b49){if(_0x551b49){_0x2dd90b[_0x9c71('0x32')]=_[_0x9c71('0x34')](db[_0x9c71('0x5e')]['rawAttributes']);_0x2dd90b['query']=_[_0x9c71('0x34')](_0x44591a[_0x9c71('0x33')]);_0x2dd90b[_0x9c71('0x35')]=_[_0x9c71('0x47')](_0x2dd90b[_0x9c71('0x32')],_0x2dd90b[_0x9c71('0x33')]);_0x47c7be[_0x9c71('0x37')]=_['intersection'](_0x2dd90b[_0x9c71('0x32')],qs[_0x9c71('0x36')](_0x44591a[_0x9c71('0x33')][_0x9c71('0x36')]));_0x47c7be[_0x9c71('0x37')]=_0x47c7be[_0x9c71('0x37')][_0x9c71('0x38')]?_0x47c7be['attributes']:_0x2dd90b[_0x9c71('0x32')];if(!_0x44591a[_0x9c71('0x33')][_0x9c71('0x59')](_0x9c71('0x5a'))){_0x47c7be[_0x9c71('0x1f')]=qs[_0x9c71('0x1f')](_0x44591a[_0x9c71('0x33')][_0x9c71('0x1f')]);_0x47c7be[_0x9c71('0x1d')]=qs[_0x9c71('0x1d')](_0x44591a[_0x9c71('0x33')][_0x9c71('0x1d')]);}_0x47c7be['order']=qs['sort'](_0x44591a[_0x9c71('0x33')]['sort']);_0x47c7be['where']=qs[_0x9c71('0x35')](_[_0x9c71('0x3c')](_0x44591a[_0x9c71('0x33')],_0x2dd90b[_0x9c71('0x35')]));_0x47c7be[_0x9c71('0x3b')]['ProjectId']=_0x551b49['id'];if(_0x44591a[_0x9c71('0x33')]['filter']){_0x47c7be[_0x9c71('0x3b')]=_[_0x9c71('0x3e')](_0x47c7be[_0x9c71('0x3b')],{'$or':_[_0x9c71('0x2e')](_0x47c7be[_0x9c71('0x37')],function(_0x2fc36c){var _0x4aef45={};_0x4aef45[_0x2fc36c]={'$like':'%'+_0x44591a[_0x9c71('0x33')][_0x9c71('0x3d')]+'%'};return _0x4aef45;})});}_0x47c7be=_['merge']({},_0x47c7be,_0x44591a[_0x9c71('0x3f')]);return db[_0x9c71('0x5e')][_0x9c71('0x1e')]({'where':_0x47c7be[_0x9c71('0x3b')]})[_0x9c71('0x26')](function(_0x1c55cc){_0xe139a4['count']=_0x1c55cc;if(_0x44591a[_0x9c71('0x33')][_0x9c71('0x48')]){_0x47c7be['include']=[{'all':!![]}];}return db[_0x9c71('0x5e')][_0x9c71('0x41')](_0x47c7be);})[_0x9c71('0x26')](function(_0x544c2c){_0xe139a4[_0x9c71('0x42')]=_0x544c2c;return _0xe139a4;});}})[_0x9c71('0x26')](respondWithFilteredResult(_0x4875f3,_0x47c7be))['catch'](handleError(_0x4875f3,null));};function char(_0x574ce5){return _0x9c71('0x5f')===typeof _0x574ce5?String[_0x9c71('0x60')][_0x9c71('0x23')](null,arguments):_0x574ce5;}function needsEncapsulation(_0x90debe){return!!_0x90debe&&(_0x90debe[_0x9c71('0x61')]()[_0x9c71('0x62')](char(0xd))>=0x0||_0x90debe[_0x9c71('0x61')]()[_0x9c71('0x62')](char(0xa))>=0x0||_0x90debe[_0x9c71('0x61')]()[_0x9c71('0x62')](char(0x2c))>=0x0||_0x90debe[_0x9c71('0x61')]()[_0x9c71('0x62')](char(0x22))>=0x0);}function encapsulate(_0x4ff974){var _0x1018d7=char(0x22),_0x5a646b='\x5c'+char(0x22),_0x1770bb=_0x4ff974['toString']()[_0x9c71('0x63')](new RegExp(_0x1018d7,'g'),_0x5a646b);return _0x1018d7+_0x1770bb+_0x1018d7;}exports[_0x9c71('0x64')]=function(_0x640b53,_0x3a4a80,_0x5b10e2){var _0x2eb6e6,_0x557c16;var _0x313be2={'where':{'ProjectId':_0x640b53[_0x9c71('0x45')]['id']}};if(_0x640b53[_0x9c71('0x33')]['startTime']){_0x313be2[_0x9c71('0x3b')][_0x9c71('0x65')]=JSON['parse'](_0x640b53[_0x9c71('0x33')]['startTime']);}return db[_0x9c71('0x5c')][_0x9c71('0x41')](_0x313be2)[_0x9c71('0x26')](handleEntityNotFound(_0x3a4a80,null))[_0x9c71('0x26')](function(_0x2d5491){if(_0x2d5491){_0x2eb6e6=_0x2d5491;return db['JscriptyQuestionReport'][_0x9c71('0x41')]({'where':{'SessionId':{'$in':_[_0x9c71('0x2e')](_0x2eb6e6,'id')},'ProjectId':_0x640b53[_0x9c71('0x45')]['id']},'order':_0x9c71('0x66')});}})[_0x9c71('0x26')](handleEntityNotFound(_0x3a4a80,null))['then'](function(_0x3d276c){if(_0x3d276c){_0x557c16=_0x3d276c;var _0x369b3b={};for(var _0x2f6c4d=0x0,_0x394bb4=_0x557c16['length'];_0x2f6c4d<_0x394bb4;_0x2f6c4d++){if(!_0x369b3b[_0x9c71('0x59')](_0x557c16[_0x2f6c4d]['questionId'])){_0x369b3b[_0x557c16[_0x2f6c4d]['questionId']]=needsEncapsulation(_0x557c16[_0x2f6c4d]['question'])?encapsulate(_0x557c16[_0x2f6c4d][_0x9c71('0x67')]):_0x557c16[_0x2f6c4d][_0x9c71('0x67')];}}var _0x36446c=[],_0x32900a={};for(var _0x1175da=0x0,_0x4d20fd=_0x2eb6e6[_0x9c71('0x38')];_0x1175da<_0x4d20fd;_0x1175da++){_0x32900a={'ProjectId':_0x640b53[_0x9c71('0x45')]['id'],'SessionId':_0x2eb6e6[_0x1175da]['id'],'StartTime':moment(_0x2eb6e6[_0x1175da][_0x9c71('0x65')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x369962=0x0,_0x2e56c5=_0x557c16[_0x9c71('0x38')];_0x369962<_0x2e56c5;_0x369962++){if(_0x557c16[_0x369962][_0x9c71('0x68')]==_0x2eb6e6[_0x1175da]['id']&&_0x369b3b[_0x9c71('0x59')](_0x557c16[_0x369962][_0x9c71('0x69')])){_0x32900a[_0x369b3b[_0x557c16[_0x369962][_0x9c71('0x69')]]]=_0x557c16[_0x369962]['answer'];}}for(var _0x49af40 in _0x369b3b){if(!_0x32900a[_0x9c71('0x59')](_0x369b3b[_0x49af40])){_0x32900a[_0x369b3b[_0x49af40]]=null;}}_0x36446c[_0x9c71('0x6a')](_0x32900a);}return _0x36446c;}})['then'](function(_0x31cfe6){if(!_['isEmpty'](_0x31cfe6)){var _0x25d0bd=toCsv(_0x31cfe6);var _0x5a5dc3=Date[_0x9c71('0x6b')]();fs[_0x9c71('0x6c')](util['format'](_0x9c71('0x6d'),_0x640b53[_0x9c71('0x45')]['id'],_0x5a5dc3),_0x25d0bd);_0x3a4a80[_0x9c71('0x6e')](_0x9c71('0x6f'),_0x9c71('0x70')+util['format'](_0x9c71('0x71'),_0x640b53['params']['id'],_0x5a5dc3));_0x3a4a80[_0x9c71('0x6e')]('Content-type',_0x9c71('0x72'));return _0x3a4a80[_0x9c71('0x73')](util[_0x9c71('0x74')](_0x9c71('0x6d'),_0x640b53[_0x9c71('0x45')]['id'],_0x5a5dc3));}else{return _0x3a4a80[_0x9c71('0x1a')](0xcc);}})[_0x9c71('0x43')](handleError(_0x3a4a80,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 047729f..bd4dfeb 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 _0x3379=['exports','JscriptyProject','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes'];(function(_0x4d185b,_0x50a597){var _0x26e7fe=function(_0x38f06f){while(--_0x38f06f){_0x4d185b['push'](_0x4d185b['shift']());}};_0x26e7fe(++_0x50a597);}(_0x3379,0x115));var _0x9337=function(_0x524f44,_0x5b64cd){_0x524f44=_0x524f44-0x0;var _0x575a66=_0x3379[_0x524f44];return _0x575a66;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var logger=require(_0x9337('0x2'))(_0x9337('0x3'));var moment=require('moment');var BPromise=require(_0x9337('0x4'));var rp=require(_0x9337('0x5'));var fs=require('fs');var path=require(_0x9337('0x6'));var rimraf=require(_0x9337('0x7'));var config=require('../../config/environment');var attributes=require(_0x9337('0x8'));module[_0x9337('0x9')]=function(_0x390772,_0x677c38){return _0x390772['define'](_0x9337('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cc=['../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1dc6b7,_0x302ecc){var _0x311f2f=function(_0x28e124){while(--_0x28e124){_0x1dc6b7['push'](_0x1dc6b7['shift']());}};_0x311f2f(++_0x302ecc);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0xf3cc[_0x210b93];return _0x2b020f;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var logger=require(_0xcf3c('0x2'))(_0xcf3c('0x3'));var moment=require('moment');var BPromise=require(_0xcf3c('0x4'));var rp=require(_0xcf3c('0x5'));var fs=require('fs');var path=require(_0xcf3c('0x6'));var rimraf=require('rimraf');var config=require(_0xcf3c('0x7'));var attributes=require(_0xcf3c('0x8'));module['exports']=function(_0x41f804,_0x2b5cae){return _0x41f804[_0xcf3c('0x9')](_0xcf3c('0xa'),attributes,{'tableName':_0xcf3c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index b82440c..7180706 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 _0xf4eb=['JscriptyProject,\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(_0x5ba9ff,_0x1a8955){var _0x415b2d=function(_0x2b67bf){while(--_0x2b67bf){_0x5ba9ff['push'](_0x5ba9ff['shift']());}};_0x415b2d(++_0x1a8955);}(_0xf4eb,0xec));var _0xbf4e=function(_0xbce318,_0x44fb96){_0xbce318=_0xbce318-0x0;var _0x4e2a00=_0xf4eb[_0xbce318];return _0x4e2a00;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ 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(_0x1f23f5,_0x30e62c){var _0x327760=function(_0x3bb368){while(--_0x3bb368){_0x1f23f5['push'](_0x1f23f5['shift']());}};_0x327760(++_0x30e62c);}(_0x70e0,0x17b));var _0x070e=function(_0x5591bc,_0x51747e){_0x5591bc=_0x5591bc-0x0;var _0x114115=_0x70e0[_0x5591bc];return _0x114115;};'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 2dafd98..4d5253a 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 _0x6d68=['express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x2fa5e5,_0x520b3f){var _0x46e512=function(_0x54303f){while(--_0x54303f){_0x2fa5e5['push'](_0x2fa5e5['shift']());}};_0x46e512(++_0x520b3f);}(_0x6d68,0xa8));var _0x86d6=function(_0x3595bf,_0x5b0a83){_0x3595bf=_0x3595bf-0x0;var _0x19c9fc=_0x6d68[_0x3595bf];return _0x19c9fc;};'use strict';var multer=require(_0x86d6('0x0'));var util=require('util');var path=require(_0x86d6('0x1'));var timeout=require(_0x86d6('0x2'));var express=require(_0x86d6('0x3'));var router=express[_0x86d6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86d6('0x5'));var interaction=require(_0x86d6('0x6'));var config=require('../../config/environment');var controller=require(_0x86d6('0x7'));router[_0x86d6('0x8')]('/',auth[_0x86d6('0x9')](),controller['index']);router[_0x86d6('0x8')]('/describe',auth[_0x86d6('0x9')](),controller[_0x86d6('0xa')]);router[_0x86d6('0x8')](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0xc')]);router[_0x86d6('0xd')]('/',auth[_0x86d6('0x9')](),controller[_0x86d6('0xe')]);router[_0x86d6('0xf')](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0x10')]);router['delete'](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0x11')]);module[_0x86d6('0x12')]=router; \ No newline at end of file +var _0xe77e=['describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2145c0,_0x549319){var _0x4c613a=function(_0x4e7350){while(--_0x4e7350){_0x2145c0['push'](_0x2145c0['shift']());}};_0x4c613a(++_0x549319);}(_0xe77e,0xe1));var _0xee77=function(_0x8d1afb,_0x1adb9b){_0x8d1afb=_0x8d1afb-0x0;var _0x2bb9b5=_0xe77e[_0x8d1afb];return _0x2bb9b5;};'use strict';var multer=require(_0xee77('0x0'));var util=require(_0xee77('0x1'));var path=require(_0xee77('0x2'));var timeout=require(_0xee77('0x3'));var express=require(_0xee77('0x4'));var router=express[_0xee77('0x5')]();var fs_extra=require(_0xee77('0x6'));var auth=require(_0xee77('0x7'));var interaction=require(_0xee77('0x8'));var config=require(_0xee77('0x9'));var controller=require(_0xee77('0xa'));router[_0xee77('0xb')]('/',auth[_0xee77('0xc')](),controller[_0xee77('0xd')]);router[_0xee77('0xb')](_0xee77('0xe'),auth[_0xee77('0xc')](),controller[_0xee77('0xf')]);router['get'](_0xee77('0x10'),auth[_0xee77('0xc')](),controller[_0xee77('0x11')]);router['post']('/',auth[_0xee77('0xc')](),controller[_0xee77('0x12')]);router[_0xee77('0x13')](_0xee77('0x10'),auth[_0xee77('0xc')](),controller[_0xee77('0x14')]);router[_0xee77('0x15')](_0xee77('0x10'),auth['isAuthenticated'](),controller[_0xee77('0x16')]);module[_0xee77('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index dc0e10f..7b49378 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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef59c,_0x2011dd){_0x4ef59c=_0x4ef59c-0x0;var _0x46b1d5=_0x7a54[_0x4ef59c];return _0x46b1d5;};'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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x8bd2ee,_0x2c0f15){_0x8bd2ee=_0x8bd2ee-0x0;var _0x4f0a9e=_0x7a54[_0x8bd2ee];return _0x4f0a9e;};'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 c9068cc..3939a28 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 _0xb818=['sox','ejs','fs-extra','lodash','squel','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','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb818,0x174));var _0x8b81=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb818[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0x8b81('0x0'));var rimraf=require(_0x8b81('0x1'));var zipdir=require(_0x8b81('0x2'));var jsonpatch=require(_0x8b81('0x3'));var rp=require(_0x8b81('0x4'));var moment=require(_0x8b81('0x5'));var BPromise=require(_0x8b81('0x6'));var Mustache=require('mustache');var util=require(_0x8b81('0x7'));var path=require('path');var sox=require(_0x8b81('0x8'));var csv=require('to-csv');var ejs=require(_0x8b81('0x9'));var fs=require('fs');var fs_extra=require(_0x8b81('0xa'));var _=require(_0x8b81('0xb'));var squel=require(_0x8b81('0xc'));var crypto=require(_0x8b81('0xd'));var jsforce=require(_0x8b81('0xe'));var deskjs=require(_0x8b81('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8b81('0x10'));var Papa=require(_0x8b81('0x11'));var Redis=require(_0x8b81('0x12'));var authService=require(_0x8b81('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b81('0x14'));var logger=require(_0x8b81('0x15'))(_0x8b81('0x16'));var utils=require(_0x8b81('0x17'));var config=require(_0x8b81('0x18'));var licenseUtil=require(_0x8b81('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xde7b9f,_0x287a79){_0x287a79=_0x287a79||0xcc;return function(_0x3c51d4){if(_0x3c51d4){return _0xde7b9f[_0x8b81('0x1a')](_0x287a79);}return _0xde7b9f[_0x8b81('0x1b')](_0x287a79)['end']();};}function respondWithResult(_0x653529,_0x21f736){_0x21f736=_0x21f736||0xc8;return function(_0x5a4d86){if(_0x5a4d86){return _0x653529[_0x8b81('0x1b')](_0x21f736)[_0x8b81('0x1c')](_0x5a4d86);}};}function respondWithFilteredResult(_0x4ef5ba,_0x50e18c){return function(_0x3f0210){if(_0x3f0210){var _0x6f368=typeof _0x50e18c[_0x8b81('0x1d')]===_0x8b81('0x1e')&&typeof _0x50e18c[_0x8b81('0x1f')]==='undefined';var _0x82b9c6=_0x3f0210[_0x8b81('0x20')];var _0x3c37b7=_0x6f368?0x0:_0x50e18c[_0x8b81('0x1d')];var _0x1e814e=_0x6f368?_0x3f0210[_0x8b81('0x20')]:_0x50e18c['offset']+_0x50e18c['limit'];var _0x34ce62;if(_0x1e814e>=_0x82b9c6){_0x1e814e=_0x82b9c6;_0x34ce62=0xc8;}else{_0x34ce62=0xce;}_0x4ef5ba['status'](_0x34ce62);return _0x4ef5ba[_0x8b81('0x21')](_0x8b81('0x22'),_0x3c37b7+'-'+_0x1e814e+'/'+_0x82b9c6)[_0x8b81('0x1c')](_0x3f0210);}return null;};}function patchUpdates(_0x2cc0cd){return function(_0x44fc6e){try{jsonpatch['apply'](_0x44fc6e,_0x2cc0cd,!![]);}catch(_0x5603c5){return BPromise['reject'](_0x5603c5);}return _0x44fc6e['save']();};}function saveUpdates(_0x47c9b7,_0x3c528e){return function(_0x2f7ad5){if(_0x2f7ad5){return _0x2f7ad5['update'](_0x47c9b7)[_0x8b81('0x23')](function(_0x13f2f8){return _0x13f2f8;});}return null;};}function removeEntity(_0x27ce6d,_0x544ba0){return function(_0x693bee){if(_0x693bee){return _0x693bee[_0x8b81('0x24')]()[_0x8b81('0x23')](function(){_0x27ce6d['status'](0xcc)[_0x8b81('0x25')]();});}};}function handleEntityNotFound(_0x39f69c,_0xb0484d){return function(_0x517ddc){if(!_0x517ddc){_0x39f69c[_0x8b81('0x1a')](0x194);}return _0x517ddc;};}function handleError(_0x34ccea,_0x5f30a9){_0x5f30a9=_0x5f30a9||0x1f4;return function(_0x4392c8){logger[_0x8b81('0x26')](_0x4392c8[_0x8b81('0x27')]);if(_0x4392c8[_0x8b81('0x28')]){delete _0x4392c8[_0x8b81('0x28')];}_0x34ccea[_0x8b81('0x1b')](_0x5f30a9)[_0x8b81('0x29')](_0x4392c8);};}exports[_0x8b81('0x2a')]=function(_0xfa3d7b,_0x48e364){var _0x3ca98c={},_0x5a3291={},_0x41a732={'count':0x0,'rows':[]};var _0x6f04b5=_[_0x8b81('0x2b')](db[_0x8b81('0x2c')]['rawAttributes'],function(_0x4ef0b5){return{'name':_0x4ef0b5['fieldName'],'type':_0x4ef0b5['type'][_0x8b81('0x2d')]};});_0x5a3291[_0x8b81('0x2e')]=_['map'](_0x6f04b5,_0x8b81('0x28'));_0x5a3291[_0x8b81('0x2f')]=_[_0x8b81('0x30')](_0xfa3d7b[_0x8b81('0x2f')]);_0x5a3291[_0x8b81('0x31')]=_['intersection'](_0x5a3291['model'],_0x5a3291[_0x8b81('0x2f')]);_0x3ca98c[_0x8b81('0x32')]=_['intersection'](_0x5a3291['model'],qs[_0x8b81('0x33')](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x33')]));_0x3ca98c[_0x8b81('0x32')]=_0x3ca98c[_0x8b81('0x32')][_0x8b81('0x34')]?_0x3ca98c[_0x8b81('0x32')]:_0x5a3291['model'];if(!_0xfa3d7b['query'][_0x8b81('0x35')](_0x8b81('0x36'))){_0x3ca98c[_0x8b81('0x1f')]=qs['limit'](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x1f')]);_0x3ca98c[_0x8b81('0x1d')]=qs['offset'](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x1d')]);}_0x3ca98c[_0x8b81('0x37')]=qs[_0x8b81('0x38')](_0xfa3d7b[_0x8b81('0x2f')]['sort']);_0x3ca98c[_0x8b81('0x39')]=qs[_0x8b81('0x31')](_[_0x8b81('0x3a')](_0xfa3d7b[_0x8b81('0x2f')],_0x5a3291[_0x8b81('0x31')]),_0x6f04b5);if(_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x3b')]){_0x3ca98c[_0x8b81('0x39')]=_[_0x8b81('0x3c')](_0x3ca98c['where'],{'$or':_[_0x8b81('0x2b')](_0x6f04b5,function(_0x1c3197){if(_0x1c3197[_0x8b81('0x3d')]!==_0x8b81('0x3e')){var _0x4ecccb={};_0x4ecccb[_0x1c3197[_0x8b81('0x28')]]={'$like':'%'+_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x3b')]+'%'};return _0x4ecccb;}})});}_0x3ca98c=_[_0x8b81('0x3c')]({},_0x3ca98c,_0xfa3d7b[_0x8b81('0x3f')]);var _0x3eaf6c={'where':_0x3ca98c[_0x8b81('0x39')]};return db[_0x8b81('0x2c')][_0x8b81('0x20')](_0x3eaf6c)[_0x8b81('0x23')](function(_0x162f99){_0x41a732[_0x8b81('0x20')]=_0x162f99;if(_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x40')]){_0x3ca98c[_0x8b81('0x41')]=[{'all':!![]}];}return db[_0x8b81('0x2c')][_0x8b81('0x42')](_0x3ca98c);})[_0x8b81('0x23')](function(_0x1775ef){_0x41a732[_0x8b81('0x43')]=_0x1775ef;return _0x41a732;})[_0x8b81('0x23')](respondWithFilteredResult(_0x48e364,_0x3ca98c))['catch'](handleError(_0x48e364,null));};exports[_0x8b81('0x44')]=function(_0x31eaea,_0x1d90db){var _0x631db3={'raw':!![],'where':{'id':_0x31eaea['params']['id']}},_0x39c273={};_0x39c273[_0x8b81('0x2e')]=_[_0x8b81('0x30')](db['JscriptyQuestionReport'][_0x8b81('0x45')]);_0x39c273[_0x8b81('0x2f')]=_[_0x8b81('0x30')](_0x31eaea[_0x8b81('0x2f')]);_0x39c273[_0x8b81('0x31')]=_[_0x8b81('0x46')](_0x39c273[_0x8b81('0x2e')],_0x39c273[_0x8b81('0x2f')]);_0x631db3[_0x8b81('0x32')]=_[_0x8b81('0x46')](_0x39c273[_0x8b81('0x2e')],qs[_0x8b81('0x33')](_0x31eaea['query'][_0x8b81('0x33')]));_0x631db3[_0x8b81('0x32')]=_0x631db3[_0x8b81('0x32')][_0x8b81('0x34')]?_0x631db3['attributes']:_0x39c273['model'];if(_0x31eaea['query']['includeAll']){_0x631db3[_0x8b81('0x41')]=[{'all':!![]}];}_0x631db3=_[_0x8b81('0x3c')]({},_0x631db3,_0x31eaea[_0x8b81('0x3f')]);return db['JscriptyQuestionReport'][_0x8b81('0x47')](_0x631db3)[_0x8b81('0x23')](handleEntityNotFound(_0x1d90db,null))['then'](respondWithResult(_0x1d90db,null))[_0x8b81('0x48')](handleError(_0x1d90db,null));};exports[_0x8b81('0x49')]=function(_0xc3d587,_0x3fe345){return db['JscriptyQuestionReport'][_0x8b81('0x49')](_0xc3d587[_0x8b81('0x4a')],{})[_0x8b81('0x23')](respondWithResult(_0x3fe345,0xc9))[_0x8b81('0x48')](handleError(_0x3fe345,null));};exports['update']=function(_0x4c9bf6,_0x1b2455){if(_0x4c9bf6[_0x8b81('0x4a')]['id']){delete _0x4c9bf6[_0x8b81('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0x8b81('0x47')]({'where':{'id':_0x4c9bf6['params']['id']}})[_0x8b81('0x23')](handleEntityNotFound(_0x1b2455,null))[_0x8b81('0x23')](saveUpdates(_0x4c9bf6[_0x8b81('0x4a')],null))[_0x8b81('0x23')](respondWithResult(_0x1b2455,null))[_0x8b81('0x48')](handleError(_0x1b2455,null));};exports[_0x8b81('0x24')]=function(_0x2e43ee,_0x630818){return db[_0x8b81('0x2c')][_0x8b81('0x47')]({'where':{'id':_0x2e43ee['params']['id']}})[_0x8b81('0x23')](handleEntityNotFound(_0x630818,null))[_0x8b81('0x23')](removeEntity(_0x630818,null))[_0x8b81('0x48')](handleError(_0x630818,null));};exports[_0x8b81('0x4b')]=function(_0x4d1eea,_0x214f52){return db[_0x8b81('0x2c')][_0x8b81('0x4b')]()[_0x8b81('0x23')](respondWithResult(_0x214f52,null))[_0x8b81('0x48')](handleError(_0x214f52,null));}; \ No newline at end of file +var _0xead6=['include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','length'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0xead6,0xa4));var _0x6ead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xead6[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6ead('0x0'));var rimraf=require(_0x6ead('0x1'));var zipdir=require(_0x6ead('0x2'));var jsonpatch=require(_0x6ead('0x3'));var rp=require('request-promise');var moment=require(_0x6ead('0x4'));var BPromise=require(_0x6ead('0x5'));var Mustache=require(_0x6ead('0x6'));var util=require(_0x6ead('0x7'));var path=require('path');var sox=require(_0x6ead('0x8'));var csv=require(_0x6ead('0x9'));var ejs=require(_0x6ead('0xa'));var fs=require('fs');var fs_extra=require(_0x6ead('0xb'));var _=require('lodash');var squel=require(_0x6ead('0xc'));var crypto=require(_0x6ead('0xd'));var jsforce=require(_0x6ead('0xe'));var deskjs=require(_0x6ead('0xf'));var toCsv=require(_0x6ead('0x9'));var querystring=require(_0x6ead('0x10'));var Papa=require(_0x6ead('0x11'));var Redis=require(_0x6ead('0x12'));var authService=require(_0x6ead('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6ead('0x14'));var hardwareService=require(_0x6ead('0x15'));var logger=require('../../config/logger')(_0x6ead('0x16'));var utils=require(_0x6ead('0x17'));var config=require(_0x6ead('0x18'));var licenseUtil=require(_0x6ead('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x451f13,_0x2dc0bb){_0x2dc0bb=_0x2dc0bb||0xcc;return function(_0x28bf9c){if(_0x28bf9c){return _0x451f13[_0x6ead('0x1a')](_0x2dc0bb);}return _0x451f13[_0x6ead('0x1b')](_0x2dc0bb)[_0x6ead('0x1c')]();};}function respondWithResult(_0x3f7e4d,_0x4c4dfa){_0x4c4dfa=_0x4c4dfa||0xc8;return function(_0x2faae1){if(_0x2faae1){return _0x3f7e4d['status'](_0x4c4dfa)[_0x6ead('0x1d')](_0x2faae1);}};}function respondWithFilteredResult(_0x1ce8fd,_0x56bec3){return function(_0x1b060a){if(_0x1b060a){var _0x3d1f23=typeof _0x56bec3[_0x6ead('0x1e')]===_0x6ead('0x1f')&&typeof _0x56bec3[_0x6ead('0x20')]===_0x6ead('0x1f');var _0x4181a9=_0x1b060a[_0x6ead('0x21')];var _0x2360f4=_0x3d1f23?0x0:_0x56bec3[_0x6ead('0x1e')];var _0x4fe265=_0x3d1f23?_0x1b060a['count']:_0x56bec3[_0x6ead('0x1e')]+_0x56bec3['limit'];var _0x364ed2;if(_0x4fe265>=_0x4181a9){_0x4fe265=_0x4181a9;_0x364ed2=0xc8;}else{_0x364ed2=0xce;}_0x1ce8fd[_0x6ead('0x1b')](_0x364ed2);return _0x1ce8fd[_0x6ead('0x22')]('Content-Range',_0x2360f4+'-'+_0x4fe265+'/'+_0x4181a9)[_0x6ead('0x1d')](_0x1b060a);}return null;};}function patchUpdates(_0x49f08b){return function(_0x1acd59){try{jsonpatch[_0x6ead('0x23')](_0x1acd59,_0x49f08b,!![]);}catch(_0x4c4bad){return BPromise[_0x6ead('0x24')](_0x4c4bad);}return _0x1acd59[_0x6ead('0x25')]();};}function saveUpdates(_0x2dc660,_0x3e9f3e){return function(_0x1a1c7c){if(_0x1a1c7c){return _0x1a1c7c[_0x6ead('0x26')](_0x2dc660)['then'](function(_0x109e82){return _0x109e82;});}return null;};}function removeEntity(_0x4216f6,_0x2a0528){return function(_0x14302d){if(_0x14302d){return _0x14302d[_0x6ead('0x27')]()[_0x6ead('0x28')](function(){_0x4216f6[_0x6ead('0x1b')](0xcc)[_0x6ead('0x1c')]();});}};}function handleEntityNotFound(_0x4e14ff,_0x112b21){return function(_0x43263e){if(!_0x43263e){_0x4e14ff['sendStatus'](0x194);}return _0x43263e;};}function handleError(_0x4a516c,_0x13e179){_0x13e179=_0x13e179||0x1f4;return function(_0x570964){logger[_0x6ead('0x29')](_0x570964[_0x6ead('0x2a')]);if(_0x570964['name']){delete _0x570964['name'];}_0x4a516c['status'](_0x13e179)[_0x6ead('0x2b')](_0x570964);};}exports[_0x6ead('0x2c')]=function(_0xf5dba1,_0x371cd9){var _0x5993c6={},_0x2cac01={},_0x286a74={'count':0x0,'rows':[]};var _0x4150b3=_[_0x6ead('0x2d')](db[_0x6ead('0x2e')][_0x6ead('0x2f')],function(_0x4d799e){return{'name':_0x4d799e[_0x6ead('0x30')],'type':_0x4d799e[_0x6ead('0x31')]['key']};});_0x2cac01[_0x6ead('0x32')]=_['map'](_0x4150b3,_0x6ead('0x33'));_0x2cac01['query']=_[_0x6ead('0x34')](_0xf5dba1[_0x6ead('0x35')]);_0x2cac01[_0x6ead('0x36')]=_[_0x6ead('0x37')](_0x2cac01['model'],_0x2cac01['query']);_0x5993c6[_0x6ead('0x38')]=_[_0x6ead('0x37')](_0x2cac01[_0x6ead('0x32')],qs[_0x6ead('0x39')](_0xf5dba1[_0x6ead('0x35')][_0x6ead('0x39')]));_0x5993c6[_0x6ead('0x38')]=_0x5993c6['attributes']['length']?_0x5993c6[_0x6ead('0x38')]:_0x2cac01['model'];if(!_0xf5dba1[_0x6ead('0x35')][_0x6ead('0x3a')](_0x6ead('0x3b'))){_0x5993c6[_0x6ead('0x20')]=qs[_0x6ead('0x20')](_0xf5dba1[_0x6ead('0x35')][_0x6ead('0x20')]);_0x5993c6[_0x6ead('0x1e')]=qs[_0x6ead('0x1e')](_0xf5dba1[_0x6ead('0x35')]['offset']);}_0x5993c6[_0x6ead('0x3c')]=qs['sort'](_0xf5dba1['query'][_0x6ead('0x3d')]);_0x5993c6['where']=qs[_0x6ead('0x36')](_[_0x6ead('0x3e')](_0xf5dba1[_0x6ead('0x35')],_0x2cac01[_0x6ead('0x36')]),_0x4150b3);if(_0xf5dba1[_0x6ead('0x35')][_0x6ead('0x3f')]){_0x5993c6[_0x6ead('0x40')]=_[_0x6ead('0x41')](_0x5993c6[_0x6ead('0x40')],{'$or':_[_0x6ead('0x2d')](_0x4150b3,function(_0x38e827){if(_0x38e827[_0x6ead('0x31')]!==_0x6ead('0x42')){var _0x466d12={};_0x466d12[_0x38e827[_0x6ead('0x33')]]={'$like':'%'+_0xf5dba1[_0x6ead('0x35')][_0x6ead('0x3f')]+'%'};return _0x466d12;}})});}_0x5993c6=_['merge']({},_0x5993c6,_0xf5dba1[_0x6ead('0x43')]);var _0xc954b1={'where':_0x5993c6[_0x6ead('0x40')]};return db[_0x6ead('0x2e')][_0x6ead('0x21')](_0xc954b1)[_0x6ead('0x28')](function(_0x78311c){_0x286a74[_0x6ead('0x21')]=_0x78311c;if(_0xf5dba1[_0x6ead('0x35')]['includeAll']){_0x5993c6['include']=[{'all':!![]}];}return db[_0x6ead('0x2e')][_0x6ead('0x44')](_0x5993c6);})[_0x6ead('0x28')](function(_0x18f019){_0x286a74[_0x6ead('0x45')]=_0x18f019;return _0x286a74;})[_0x6ead('0x28')](respondWithFilteredResult(_0x371cd9,_0x5993c6))[_0x6ead('0x46')](handleError(_0x371cd9,null));};exports[_0x6ead('0x47')]=function(_0x24aa63,_0x1561da){var _0x512883={'raw':!![],'where':{'id':_0x24aa63['params']['id']}},_0x106643={};_0x106643[_0x6ead('0x32')]=_[_0x6ead('0x34')](db[_0x6ead('0x2e')][_0x6ead('0x2f')]);_0x106643['query']=_['keys'](_0x24aa63[_0x6ead('0x35')]);_0x106643[_0x6ead('0x36')]=_[_0x6ead('0x37')](_0x106643[_0x6ead('0x32')],_0x106643[_0x6ead('0x35')]);_0x512883[_0x6ead('0x38')]=_[_0x6ead('0x37')](_0x106643[_0x6ead('0x32')],qs['fields'](_0x24aa63[_0x6ead('0x35')][_0x6ead('0x39')]));_0x512883[_0x6ead('0x38')]=_0x512883[_0x6ead('0x38')][_0x6ead('0x48')]?_0x512883[_0x6ead('0x38')]:_0x106643[_0x6ead('0x32')];if(_0x24aa63[_0x6ead('0x35')]['includeAll']){_0x512883[_0x6ead('0x49')]=[{'all':!![]}];}_0x512883=_[_0x6ead('0x41')]({},_0x512883,_0x24aa63[_0x6ead('0x43')]);return db['JscriptyQuestionReport'][_0x6ead('0x4a')](_0x512883)[_0x6ead('0x28')](handleEntityNotFound(_0x1561da,null))[_0x6ead('0x28')](respondWithResult(_0x1561da,null))[_0x6ead('0x46')](handleError(_0x1561da,null));};exports['create']=function(_0x4c95d5,_0x49102b){return db[_0x6ead('0x2e')][_0x6ead('0x4b')](_0x4c95d5[_0x6ead('0x4c')],{})[_0x6ead('0x28')](respondWithResult(_0x49102b,0xc9))[_0x6ead('0x46')](handleError(_0x49102b,null));};exports['update']=function(_0x28e1d0,_0x3ef7fe){if(_0x28e1d0[_0x6ead('0x4c')]['id']){delete _0x28e1d0[_0x6ead('0x4c')]['id'];}return db[_0x6ead('0x2e')]['find']({'where':{'id':_0x28e1d0[_0x6ead('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3ef7fe,null))[_0x6ead('0x28')](saveUpdates(_0x28e1d0[_0x6ead('0x4c')],null))[_0x6ead('0x28')](respondWithResult(_0x3ef7fe,null))['catch'](handleError(_0x3ef7fe,null));};exports[_0x6ead('0x27')]=function(_0x11f3e5,_0xc7241e){return db[_0x6ead('0x2e')][_0x6ead('0x4a')]({'where':{'id':_0x11f3e5['params']['id']}})[_0x6ead('0x28')](handleEntityNotFound(_0xc7241e,null))[_0x6ead('0x28')](removeEntity(_0xc7241e,null))[_0x6ead('0x46')](handleError(_0xc7241e,null));};exports['describe']=function(_0x4a6df4,_0x10fdeb){return db['JscriptyQuestionReport'][_0x6ead('0x4e')]()[_0x6ead('0x28')](respondWithResult(_0x10fdeb,null))[_0x6ead('0x46')](handleError(_0x10fdeb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 849b1f7..dcff8df 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 _0x43c2=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x43c2,0x169));var _0x243c=function(_0x2cef1a,_0x5e3ac4){_0x2cef1a=_0x2cef1a-0x0;var _0x360818=_0x43c2[_0x2cef1a];return _0x360818;};'use strict';var _=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var logger=require(_0x243c('0x2'))(_0x243c('0x3'));var moment=require(_0x243c('0x4'));var BPromise=require('bluebird');var rp=require(_0x243c('0x5'));var fs=require('fs');var path=require(_0x243c('0x6'));var rimraf=require(_0x243c('0x7'));var config=require(_0x243c('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x243c('0x9')]=function(_0x9a0e9a,_0x1164e2){return _0x9a0e9a[_0x243c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x243c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0944=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','./jscriptyQuestionReport.attributes','exports'];(function(_0x4dcebf,_0x3abbf1){var _0x2fbcd2=function(_0x2089bb){while(--_0x2089bb){_0x4dcebf['push'](_0x4dcebf['shift']());}};_0x2fbcd2(++_0x3abbf1);}(_0x0944,0x1dc));var _0x4094=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x0944[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0x4094('0x0'));var util=require('util');var logger=require(_0x4094('0x1'))(_0x4094('0x2'));var moment=require(_0x4094('0x3'));var BPromise=require(_0x4094('0x4'));var rp=require(_0x4094('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4094('0x6'));module[_0x4094('0x7')]=function(_0x18328d,_0x5911ae){return _0x18328d[_0x4094('0x8')](_0x4094('0x9'),attributes,{'tableName':_0x4094('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 2ecdfc8..8d1add7 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 _0x61cd=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x61cd,0x1ba));var _0xd61c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x61cd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xd61c('0x0'));var moment=require(_0xd61c('0x1'));var BPromise=require('bluebird');var rs=require(_0xd61c('0x2'));var fs=require('fs');var Redis=require(_0xd61c('0x3'));var db=require(_0xd61c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd61c('0x5'));var config=require(_0xd61c('0x6'));var jayson=require(_0xd61c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x268a74,_0x4e0d49,_0x329293){return new BPromise(function(_0x2fb891,_0x1cde8a){return client[_0xd61c('0x8')](_0x268a74,_0x329293)['then'](function(_0x30a499){logger[_0xd61c('0x9')](_0xd61c('0xa'),_0x4e0d49,_0xd61c('0xb'));logger[_0xd61c('0xc')](_0xd61c('0xd'),_0x4e0d49,_0xd61c('0xb'),JSON[_0xd61c('0xe')](_0x30a499));if(_0x30a499['error']){if(_0x30a499[_0xd61c('0xf')][_0xd61c('0x10')]===0x1f4){logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x30a499['error'][_0xd61c('0x11')]);return _0x1cde8a(_0x30a499['error'][_0xd61c('0x11')]);}logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x30a499[_0xd61c('0xf')][_0xd61c('0x11')]);return _0x2fb891(_0x30a499[_0xd61c('0xf')]['message']);}else{logger[_0xd61c('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4e0d49,'request\x20sent');_0x2fb891(_0x30a499[_0xd61c('0x12')][_0xd61c('0x11')]);}})[_0xd61c('0x13')](function(_0x3bf317){logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x3bf317);_0x1cde8a(_0x3bf317);});});} \ No newline at end of file +var _0xf77c=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x15bf6c,_0x46a53c){var _0x58d8f8=function(_0x56e8d7){while(--_0x56e8d7){_0x15bf6c['push'](_0x15bf6c['shift']());}};_0x58d8f8(++_0x46a53c);}(_0xf77c,0x197));var _0xcf77=function(_0x4da3f6,_0x536e60){_0x4da3f6=_0x4da3f6-0x0;var _0x1d63ee=_0xf77c[_0x4da3f6];return _0x1d63ee;};'use strict';var _=require('lodash');var util=require(_0xcf77('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf77('0x1'));var fs=require('fs');var Redis=require(_0xcf77('0x2'));var db=require(_0xcf77('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf77('0x4'))('rpc');var config=require(_0xcf77('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf77('0x6')][_0xcf77('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a4f80,_0xe0aaa2,_0x2a125c){return new BPromise(function(_0x34d87f,_0x50812b){return client[_0xcf77('0x8')](_0x5a4f80,_0x2a125c)[_0xcf77('0x9')](function(_0x43d23e){logger[_0xcf77('0xa')](_0xcf77('0xb'),_0xe0aaa2,_0xcf77('0xc'));logger['debug'](_0xcf77('0xd'),_0xe0aaa2,_0xcf77('0xc'),JSON[_0xcf77('0xe')](_0x43d23e));if(_0x43d23e[_0xcf77('0xf')]){if(_0x43d23e[_0xcf77('0xf')][_0xcf77('0x10')]===0x1f4){logger[_0xcf77('0xf')](_0xcf77('0xb'),_0xe0aaa2,_0x43d23e[_0xcf77('0xf')][_0xcf77('0x11')]);return _0x50812b(_0x43d23e[_0xcf77('0xf')]['message']);}logger[_0xcf77('0xf')](_0xcf77('0xb'),_0xe0aaa2,_0x43d23e[_0xcf77('0xf')][_0xcf77('0x11')]);return _0x34d87f(_0x43d23e['error'][_0xcf77('0x11')]);}else{logger[_0xcf77('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe0aaa2,'request\x20sent');_0x34d87f(_0x43d23e['result']['message']);}})[_0xcf77('0x12')](function(_0x251774){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0xe0aaa2,_0x251774);_0x50812b(_0x251774);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f2db9e0..f74750f 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 _0x0a35=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','isAuthenticated','describe','/:id','/:id/questions','getQuestions'];(function(_0x438b92,_0x15bbdd){var _0x522dad=function(_0x52baa1){while(--_0x52baa1){_0x438b92['push'](_0x438b92['shift']());}};_0x522dad(++_0x15bbdd);}(_0x0a35,0x1ab));var _0x50a3=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x0a35[_0x54ea7a];return _0x65a10d;};'use strict';var multer=require(_0x50a3('0x0'));var util=require(_0x50a3('0x1'));var path=require('path');var timeout=require(_0x50a3('0x2'));var express=require(_0x50a3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50a3('0x4'));var config=require(_0x50a3('0x5'));var controller=require(_0x50a3('0x6'));router[_0x50a3('0x7')]('/',auth['isAuthenticated'](),controller[_0x50a3('0x8')]);router[_0x50a3('0x7')]('/describe',auth[_0x50a3('0x9')](),controller[_0x50a3('0xa')]);router[_0x50a3('0x7')](_0x50a3('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x50a3('0xc'),auth[_0x50a3('0x9')](),controller[_0x50a3('0xd')]);router[_0x50a3('0xe')]('/',auth[_0x50a3('0x9')](),controller[_0x50a3('0xf')]);router[_0x50a3('0x10')]('/:id',auth[_0x50a3('0x9')](),controller[_0x50a3('0x11')]);router[_0x50a3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x50a3('0x13')]);module[_0x50a3('0x14')]=router; \ No newline at end of file +var _0x3c61=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','show','getQuestions','post','create','/:id','update','delete','destroy','exports'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x3c61,0x138));var _0x13c6=function(_0x538fff,_0xaf77bc){_0x538fff=_0x538fff-0x0;var _0x11d6e8=_0x3c61[_0x538fff];return _0x11d6e8;};'use strict';var multer=require(_0x13c6('0x0'));var util=require(_0x13c6('0x1'));var path=require(_0x13c6('0x2'));var timeout=require(_0x13c6('0x3'));var express=require(_0x13c6('0x4'));var router=express['Router']();var fs_extra=require(_0x13c6('0x5'));var auth=require(_0x13c6('0x6'));var interaction=require(_0x13c6('0x7'));var config=require(_0x13c6('0x8'));var controller=require(_0x13c6('0x9'));router['get']('/',auth[_0x13c6('0xa')](),controller[_0x13c6('0xb')]);router[_0x13c6('0xc')](_0x13c6('0xd'),auth[_0x13c6('0xa')](),controller[_0x13c6('0xe')]);router[_0x13c6('0xc')]('/:id',auth[_0x13c6('0xa')](),controller[_0x13c6('0xf')]);router[_0x13c6('0xc')]('/:id/questions',auth[_0x13c6('0xa')](),controller[_0x13c6('0x10')]);router[_0x13c6('0x11')]('/',auth[_0x13c6('0xa')](),controller[_0x13c6('0x12')]);router['put'](_0x13c6('0x13'),auth['isAuthenticated'](),controller[_0x13c6('0x14')]);router[_0x13c6('0x15')](_0x13c6('0x13'),auth['isAuthenticated'](),controller[_0x13c6('0x16')]);module[_0x13c6('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 677703e..03dfbb7 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 _0x2c24=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','starttime'];(function(_0x588639,_0x266b61){var _0x692bea=function(_0x46db86){while(--_0x46db86){_0x588639['push'](_0x588639['shift']());}};_0x692bea(++_0x266b61);}(_0x2c24,0x190));var _0x42c2=function(_0x4efe95,_0x15caee){_0x4efe95=_0x4efe95-0x0;var _0xcbc576=_0x2c24[_0x4efe95];return _0xcbc576;};'use strict';var moment=require(_0x42c2('0x0'));var Sequelize=require(_0x42c2('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x42c2('0x2')],'set':function(_0x3d7d21){this[_0x42c2('0x3')](_0x42c2('0x4'),_0x3d7d21);this['setDataValue'](_0x42c2('0x5'),moment()['format'](_0x42c2('0x6')));}},'endtime':{'type':Sequelize[_0x42c2('0x2')]},'membername':{'type':Sequelize[_0x42c2('0x7')]},'projectname':{'type':Sequelize[_0x42c2('0x7')]},'queue':{'type':Sequelize[_0x42c2('0x7')]},'uniqueid':{'type':Sequelize[_0x42c2('0x7')]},'calleridname':{'type':Sequelize[_0x42c2('0x7')]},'calleridnum':{'type':Sequelize[_0x42c2('0x7')]},'completed':{'type':Sequelize[_0x42c2('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x6538=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6538,0xbf));var _0x8653=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x6538[_0x53d172];return _0x1bd0a2;};'use strict';var moment=require(_0x8653('0x0'));var Sequelize=require(_0x8653('0x1'));module[_0x8653('0x2')]={'starttime':{'type':Sequelize[_0x8653('0x3')],'set':function(_0x528135){this[_0x8653('0x4')](_0x8653('0x5'),_0x528135);this[_0x8653('0x4')](_0x8653('0x6'),moment()['format'](_0x8653('0x7')));}},'endtime':{'type':Sequelize[_0x8653('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8653('0x8')]},'uniqueid':{'type':Sequelize[_0x8653('0x8')]},'calleridname':{'type':Sequelize[_0x8653('0x8')]},'calleridnum':{'type':Sequelize[_0x8653('0x8')]},'completed':{'type':Sequelize[_0x8653('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 46949e3..5b8ed53 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 _0x87bb=['nolimit','limit','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','JscriptyQuestionReport','hasOwnProperty','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','length','query'];(function(_0xe4e1d,_0x50a9ff){var _0x5e35f3=function(_0x17112f){while(--_0x17112f){_0xe4e1d['push'](_0xe4e1d['shift']());}};_0x5e35f3(++_0x50a9ff);}(_0x87bb,0x107));var _0xb87b=function(_0x154a40,_0x26dd2e){_0x154a40=_0x154a40-0x0;var _0x7e98d3=_0x87bb[_0x154a40];return _0x7e98d3;};'use strict';var emlformat=require(_0xb87b('0x0'));var rimraf=require(_0xb87b('0x1'));var zipdir=require(_0xb87b('0x2'));var jsonpatch=require(_0xb87b('0x3'));var rp=require('request-promise');var moment=require(_0xb87b('0x4'));var BPromise=require(_0xb87b('0x5'));var Mustache=require('mustache');var util=require(_0xb87b('0x6'));var path=require(_0xb87b('0x7'));var sox=require('sox');var csv=require(_0xb87b('0x8'));var ejs=require(_0xb87b('0x9'));var fs=require('fs');var fs_extra=require(_0xb87b('0xa'));var _=require(_0xb87b('0xb'));var squel=require(_0xb87b('0xc'));var crypto=require(_0xb87b('0xd'));var jsforce=require(_0xb87b('0xe'));var deskjs=require(_0xb87b('0xf'));var toCsv=require(_0xb87b('0x8'));var querystring=require(_0xb87b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb87b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb87b('0x12'));var logger=require(_0xb87b('0x13'))(_0xb87b('0x14'));var utils=require('../../config/utils');var config=require(_0xb87b('0x15'));var licenseUtil=require(_0xb87b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13906c,_0x3a7934){_0x3a7934=_0x3a7934||0xcc;return function(_0x452f0e){if(_0x452f0e){return _0x13906c['sendStatus'](_0x3a7934);}return _0x13906c[_0xb87b('0x17')](_0x3a7934)['end']();};}function respondWithResult(_0x1a9768,_0x3cff8f){_0x3cff8f=_0x3cff8f||0xc8;return function(_0x49669c){if(_0x49669c){return _0x1a9768[_0xb87b('0x17')](_0x3cff8f)['json'](_0x49669c);}};}function respondWithFilteredResult(_0x12ae30,_0x16950f){return function(_0x19a3f2){if(_0x19a3f2){var _0x48d6b9=typeof _0x16950f[_0xb87b('0x18')]===_0xb87b('0x19')&&typeof _0x16950f['limit']==='undefined';var _0x16fd78=_0x19a3f2[_0xb87b('0x1a')];var _0x539e60=_0x48d6b9?0x0:_0x16950f[_0xb87b('0x18')];var _0x34b1cd=_0x48d6b9?_0x19a3f2[_0xb87b('0x1a')]:_0x16950f[_0xb87b('0x18')]+_0x16950f['limit'];var _0x317a65;if(_0x34b1cd>=_0x16fd78){_0x34b1cd=_0x16fd78;_0x317a65=0xc8;}else{_0x317a65=0xce;}_0x12ae30[_0xb87b('0x17')](_0x317a65);return _0x12ae30[_0xb87b('0x1b')](_0xb87b('0x1c'),_0x539e60+'-'+_0x34b1cd+'/'+_0x16fd78)[_0xb87b('0x1d')](_0x19a3f2);}return null;};}function patchUpdates(_0x47eeba){return function(_0x33c812){try{jsonpatch[_0xb87b('0x1e')](_0x33c812,_0x47eeba,!![]);}catch(_0x1e126e){return BPromise[_0xb87b('0x1f')](_0x1e126e);}return _0x33c812['save']();};}function saveUpdates(_0x556976,_0x7d2ad0){return function(_0x55423e){if(_0x55423e){return _0x55423e[_0xb87b('0x20')](_0x556976)[_0xb87b('0x21')](function(_0x4864b9){return _0x4864b9;});}return null;};}function removeEntity(_0x14ce94,_0x3fde30){return function(_0x5b3527){if(_0x5b3527){return _0x5b3527['destroy']()[_0xb87b('0x21')](function(){_0x14ce94[_0xb87b('0x17')](0xcc)[_0xb87b('0x22')]();});}};}function handleEntityNotFound(_0x1a5fba,_0x3875a5){return function(_0xf8265f){if(!_0xf8265f){_0x1a5fba[_0xb87b('0x23')](0x194);}return _0xf8265f;};}function handleError(_0x1ea5ce,_0x55e720){_0x55e720=_0x55e720||0x1f4;return function(_0x511823){logger[_0xb87b('0x24')](_0x511823[_0xb87b('0x25')]);if(_0x511823[_0xb87b('0x26')]){delete _0x511823[_0xb87b('0x26')];}_0x1ea5ce[_0xb87b('0x17')](_0x55e720)[_0xb87b('0x27')](_0x511823);};}exports[_0xb87b('0x28')]=function(_0x36b4c0,_0x2e8834){var _0x39230a={},_0x46de62={},_0x32838d={'count':0x0,'rows':[]};var _0x55dead=_['map'](db[_0xb87b('0x29')][_0xb87b('0x2a')],function(_0x1185a3){return{'name':_0x1185a3[_0xb87b('0x2b')],'type':_0x1185a3[_0xb87b('0x2c')]['key']};});_0x46de62[_0xb87b('0x2d')]=_['map'](_0x55dead,_0xb87b('0x26'));_0x46de62['query']=_[_0xb87b('0x2e')](_0x36b4c0['query']);_0x46de62[_0xb87b('0x2f')]=_[_0xb87b('0x30')](_0x46de62['model'],_0x46de62['query']);_0x39230a[_0xb87b('0x31')]=_[_0xb87b('0x30')](_0x46de62[_0xb87b('0x2d')],qs[_0xb87b('0x32')](_0x36b4c0['query']['fields']));_0x39230a[_0xb87b('0x31')]=_0x39230a[_0xb87b('0x31')][_0xb87b('0x33')]?_0x39230a['attributes']:_0x46de62['model'];if(!_0x36b4c0[_0xb87b('0x34')]['hasOwnProperty'](_0xb87b('0x35'))){_0x39230a['limit']=qs[_0xb87b('0x36')](_0x36b4c0[_0xb87b('0x34')]['limit']);_0x39230a['offset']=qs['offset'](_0x36b4c0[_0xb87b('0x34')]['offset']);}_0x39230a['order']=qs['sort'](_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x37')]);_0x39230a['where']=qs[_0xb87b('0x2f')](_[_0xb87b('0x38')](_0x36b4c0[_0xb87b('0x34')],_0x46de62[_0xb87b('0x2f')]),_0x55dead);if(_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x39')]){_0x39230a[_0xb87b('0x3a')]=_[_0xb87b('0x3b')](_0x39230a['where'],{'$or':_[_0xb87b('0x3c')](_0x55dead,function(_0xfd1060){if(_0xfd1060[_0xb87b('0x2c')]!==_0xb87b('0x3d')){var _0x2bb141={};_0x2bb141[_0xfd1060[_0xb87b('0x26')]]={'$like':'%'+_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x39')]+'%'};return _0x2bb141;}})});}_0x39230a=_[_0xb87b('0x3b')]({},_0x39230a,_0x36b4c0['options']);var _0x617c6={'where':_0x39230a[_0xb87b('0x3a')]};return db['JscriptySessionReport'][_0xb87b('0x1a')](_0x617c6)[_0xb87b('0x21')](function(_0x38980e){_0x32838d[_0xb87b('0x1a')]=_0x38980e;if(_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x3e')]){_0x39230a['include']=[{'all':!![]}];}return db[_0xb87b('0x29')][_0xb87b('0x3f')](_0x39230a);})['then'](function(_0x1afdad){_0x32838d[_0xb87b('0x40')]=_0x1afdad;return _0x32838d;})[_0xb87b('0x21')](respondWithFilteredResult(_0x2e8834,_0x39230a))[_0xb87b('0x41')](handleError(_0x2e8834,null));};exports[_0xb87b('0x42')]=function(_0x1bb1eb,_0x5fae14){var _0x249cd8={'raw':!![],'where':{'id':_0x1bb1eb[_0xb87b('0x43')]['id']}},_0x5b9586={};_0x5b9586[_0xb87b('0x2d')]=_[_0xb87b('0x2e')](db[_0xb87b('0x29')][_0xb87b('0x2a')]);_0x5b9586['query']=_[_0xb87b('0x2e')](_0x1bb1eb[_0xb87b('0x34')]);_0x5b9586['filters']=_[_0xb87b('0x30')](_0x5b9586[_0xb87b('0x2d')],_0x5b9586[_0xb87b('0x34')]);_0x249cd8[_0xb87b('0x31')]=_['intersection'](_0x5b9586[_0xb87b('0x2d')],qs[_0xb87b('0x32')](_0x1bb1eb[_0xb87b('0x34')][_0xb87b('0x32')]));_0x249cd8[_0xb87b('0x31')]=_0x249cd8[_0xb87b('0x31')][_0xb87b('0x33')]?_0x249cd8['attributes']:_0x5b9586[_0xb87b('0x2d')];if(_0x1bb1eb[_0xb87b('0x34')][_0xb87b('0x3e')]){_0x249cd8[_0xb87b('0x44')]=[{'all':!![]}];}_0x249cd8=_[_0xb87b('0x3b')]({},_0x249cd8,_0x1bb1eb[_0xb87b('0x45')]);return db[_0xb87b('0x29')]['find'](_0x249cd8)[_0xb87b('0x21')](handleEntityNotFound(_0x5fae14,null))[_0xb87b('0x21')](respondWithResult(_0x5fae14,null))[_0xb87b('0x41')](handleError(_0x5fae14,null));};exports[_0xb87b('0x46')]=function(_0x1f0a91,_0x5dfa41){return db[_0xb87b('0x29')][_0xb87b('0x46')](_0x1f0a91['body'],{})[_0xb87b('0x21')](respondWithResult(_0x5dfa41,0xc9))[_0xb87b('0x41')](handleError(_0x5dfa41,null));};exports[_0xb87b('0x20')]=function(_0x3192f6,_0x4b3e7d){if(_0x3192f6[_0xb87b('0x47')]['id']){delete _0x3192f6[_0xb87b('0x47')]['id'];}return db[_0xb87b('0x29')][_0xb87b('0x48')]({'where':{'id':_0x3192f6[_0xb87b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b3e7d,null))[_0xb87b('0x21')](saveUpdates(_0x3192f6[_0xb87b('0x47')],null))[_0xb87b('0x21')](respondWithResult(_0x4b3e7d,null))['catch'](handleError(_0x4b3e7d,null));};exports[_0xb87b('0x49')]=function(_0x5bc792,_0x518921){return db[_0xb87b('0x29')][_0xb87b('0x48')]({'where':{'id':_0x5bc792['params']['id']}})[_0xb87b('0x21')](handleEntityNotFound(_0x518921,null))['then'](removeEntity(_0x518921,null))['catch'](handleError(_0x518921,null));};exports[_0xb87b('0x4a')]=function(_0x4d18c6,_0x953282){return db[_0xb87b('0x29')][_0xb87b('0x4a')]()[_0xb87b('0x21')](respondWithResult(_0x953282,null))['catch'](handleError(_0x953282,null));};exports['getQuestions']=function(_0x45ab88,_0x14b161,_0x307b4d){var _0xe2f2b3={'raw':!![],'where':{}};var _0x5abf7b={};var _0x22302a={'count':0x0,'rows':[]};return db[_0xb87b('0x29')]['findOne']({'where':{'id':_0x45ab88[_0xb87b('0x43')]['id']}})['then'](handleEntityNotFound(_0x14b161,null))[_0xb87b('0x21')](function(_0x4a9657){if(_0x4a9657){_0x5abf7b[_0xb87b('0x2d')]=_[_0xb87b('0x2e')](db[_0xb87b('0x4b')][_0xb87b('0x2a')]);_0x5abf7b[_0xb87b('0x34')]=_[_0xb87b('0x2e')](_0x45ab88[_0xb87b('0x34')]);_0x5abf7b[_0xb87b('0x2f')]=_['intersection'](_0x5abf7b[_0xb87b('0x2d')],_0x5abf7b[_0xb87b('0x34')]);_0xe2f2b3['attributes']=_['intersection'](_0x5abf7b['model'],qs[_0xb87b('0x32')](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x32')]));_0xe2f2b3[_0xb87b('0x31')]=_0xe2f2b3[_0xb87b('0x31')]['length']?_0xe2f2b3[_0xb87b('0x31')]:_0x5abf7b['model'];if(!_0x45ab88['query'][_0xb87b('0x4c')](_0xb87b('0x35'))){_0xe2f2b3[_0xb87b('0x36')]=qs['limit'](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x36')]);_0xe2f2b3[_0xb87b('0x18')]=qs['offset'](_0x45ab88['query'][_0xb87b('0x18')]);}_0xe2f2b3[_0xb87b('0x4d')]=qs[_0xb87b('0x37')](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x37')]);_0xe2f2b3['where']=qs[_0xb87b('0x2f')](_['pick'](_0x45ab88[_0xb87b('0x34')],_0x5abf7b['filters']));_0xe2f2b3[_0xb87b('0x3a')][_0xb87b('0x4e')]=_0x4a9657['id'];if(_0x45ab88[_0xb87b('0x34')]['filter']){_0xe2f2b3[_0xb87b('0x3a')]=_[_0xb87b('0x3b')](_0xe2f2b3[_0xb87b('0x3a')],{'$or':_['map'](_0xe2f2b3['attributes'],function(_0x274600){var _0x178521={};_0x178521[_0x274600]={'$like':'%'+_0x45ab88[_0xb87b('0x34')][_0xb87b('0x39')]+'%'};return _0x178521;})});}_0xe2f2b3=_['merge']({},_0xe2f2b3,_0x45ab88[_0xb87b('0x45')]);return db[_0xb87b('0x4b')][_0xb87b('0x1a')]({'where':_0xe2f2b3[_0xb87b('0x3a')]})[_0xb87b('0x21')](function(_0x230bed){_0x22302a['count']=_0x230bed;if(_0x45ab88[_0xb87b('0x34')][_0xb87b('0x3e')]){_0xe2f2b3[_0xb87b('0x44')]=[{'all':!![]}];}return db[_0xb87b('0x4b')][_0xb87b('0x3f')](_0xe2f2b3);})['then'](function(_0x2e2764){_0x22302a[_0xb87b('0x40')]=_0x2e2764;return _0x22302a;});}})[_0xb87b('0x21')](respondWithFilteredResult(_0x14b161,_0xe2f2b3))['catch'](handleError(_0x14b161,null));}; \ No newline at end of file +var _0x9c51=['lodash','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','sort','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x54b183,_0x14b0ba){var _0x6b8c57=function(_0x2e71c1){while(--_0x2e71c1){_0x54b183['push'](_0x54b183['shift']());}};_0x6b8c57(++_0x14b0ba);}(_0x9c51,0x139));var _0x19c5=function(_0x35989f,_0x2a8e9a){_0x35989f=_0x35989f-0x0;var _0x3aa748=_0x9c51[_0x35989f];return _0x3aa748;};'use strict';var emlformat=require(_0x19c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19c5('0x1'));var jsonpatch=require(_0x19c5('0x2'));var rp=require(_0x19c5('0x3'));var moment=require(_0x19c5('0x4'));var BPromise=require(_0x19c5('0x5'));var Mustache=require(_0x19c5('0x6'));var util=require(_0x19c5('0x7'));var path=require('path');var sox=require(_0x19c5('0x8'));var csv=require(_0x19c5('0x9'));var ejs=require(_0x19c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x19c5('0xc'));var deskjs=require(_0x19c5('0xd'));var toCsv=require(_0x19c5('0x9'));var querystring=require(_0x19c5('0xe'));var Papa=require(_0x19c5('0xf'));var Redis=require(_0x19c5('0x10'));var authService=require(_0x19c5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x19c5('0x12'))(_0x19c5('0x13'));var utils=require(_0x19c5('0x14'));var config=require(_0x19c5('0x15'));var licenseUtil=require(_0x19c5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50c821,_0x26e9fe){_0x26e9fe=_0x26e9fe||0xcc;return function(_0x2e3267){if(_0x2e3267){return _0x50c821[_0x19c5('0x17')](_0x26e9fe);}return _0x50c821[_0x19c5('0x18')](_0x26e9fe)[_0x19c5('0x19')]();};}function respondWithResult(_0x1ce66f,_0x34aed9){_0x34aed9=_0x34aed9||0xc8;return function(_0x1427ce){if(_0x1427ce){return _0x1ce66f['status'](_0x34aed9)[_0x19c5('0x1a')](_0x1427ce);}};}function respondWithFilteredResult(_0x1922df,_0x4378a9){return function(_0x1deb2f){if(_0x1deb2f){var _0x2e75ca=typeof _0x4378a9[_0x19c5('0x1b')]===_0x19c5('0x1c')&&typeof _0x4378a9['limit']===_0x19c5('0x1c');var _0x23c729=_0x1deb2f[_0x19c5('0x1d')];var _0x35080f=_0x2e75ca?0x0:_0x4378a9[_0x19c5('0x1b')];var _0x4eaf74=_0x2e75ca?_0x1deb2f['count']:_0x4378a9['offset']+_0x4378a9[_0x19c5('0x1e')];var _0x572bbe;if(_0x4eaf74>=_0x23c729){_0x4eaf74=_0x23c729;_0x572bbe=0xc8;}else{_0x572bbe=0xce;}_0x1922df['status'](_0x572bbe);return _0x1922df[_0x19c5('0x1f')](_0x19c5('0x20'),_0x35080f+'-'+_0x4eaf74+'/'+_0x23c729)[_0x19c5('0x1a')](_0x1deb2f);}return null;};}function patchUpdates(_0x4d450b){return function(_0x5e91f6){try{jsonpatch[_0x19c5('0x21')](_0x5e91f6,_0x4d450b,!![]);}catch(_0x1f9014){return BPromise[_0x19c5('0x22')](_0x1f9014);}return _0x5e91f6[_0x19c5('0x23')]();};}function saveUpdates(_0x2e67da,_0x568511){return function(_0x138a05){if(_0x138a05){return _0x138a05[_0x19c5('0x24')](_0x2e67da)[_0x19c5('0x25')](function(_0x23fb02){return _0x23fb02;});}return null;};}function removeEntity(_0x5bdc86,_0x29a2f8){return function(_0xf55885){if(_0xf55885){return _0xf55885[_0x19c5('0x26')]()[_0x19c5('0x25')](function(){_0x5bdc86['status'](0xcc)[_0x19c5('0x19')]();});}};}function handleEntityNotFound(_0x4202af,_0x5c1a85){return function(_0x20b8ea){if(!_0x20b8ea){_0x4202af['sendStatus'](0x194);}return _0x20b8ea;};}function handleError(_0x4b0080,_0x1de6ac){_0x1de6ac=_0x1de6ac||0x1f4;return function(_0x5684e6){logger[_0x19c5('0x27')](_0x5684e6[_0x19c5('0x28')]);if(_0x5684e6['name']){delete _0x5684e6[_0x19c5('0x29')];}_0x4b0080[_0x19c5('0x18')](_0x1de6ac)['send'](_0x5684e6);};}exports[_0x19c5('0x2a')]=function(_0xffbb1b,_0x4df792){var _0x3ad37a={},_0x2311db={},_0x91ae64={'count':0x0,'rows':[]};var _0x23832d=_[_0x19c5('0x2b')](db['JscriptySessionReport'][_0x19c5('0x2c')],function(_0x904d2e){return{'name':_0x904d2e[_0x19c5('0x2d')],'type':_0x904d2e[_0x19c5('0x2e')][_0x19c5('0x2f')]};});_0x2311db['model']=_[_0x19c5('0x2b')](_0x23832d,_0x19c5('0x29'));_0x2311db[_0x19c5('0x30')]=_['keys'](_0xffbb1b[_0x19c5('0x30')]);_0x2311db[_0x19c5('0x31')]=_[_0x19c5('0x32')](_0x2311db[_0x19c5('0x33')],_0x2311db['query']);_0x3ad37a[_0x19c5('0x34')]=_[_0x19c5('0x32')](_0x2311db[_0x19c5('0x33')],qs['fields'](_0xffbb1b[_0x19c5('0x30')]['fields']));_0x3ad37a[_0x19c5('0x34')]=_0x3ad37a[_0x19c5('0x34')][_0x19c5('0x35')]?_0x3ad37a[_0x19c5('0x34')]:_0x2311db[_0x19c5('0x33')];if(!_0xffbb1b[_0x19c5('0x30')][_0x19c5('0x36')](_0x19c5('0x37'))){_0x3ad37a[_0x19c5('0x1e')]=qs[_0x19c5('0x1e')](_0xffbb1b[_0x19c5('0x30')][_0x19c5('0x1e')]);_0x3ad37a['offset']=qs[_0x19c5('0x1b')](_0xffbb1b[_0x19c5('0x30')]['offset']);}_0x3ad37a[_0x19c5('0x38')]=qs['sort'](_0xffbb1b[_0x19c5('0x30')]['sort']);_0x3ad37a['where']=qs[_0x19c5('0x31')](_[_0x19c5('0x39')](_0xffbb1b[_0x19c5('0x30')],_0x2311db[_0x19c5('0x31')]),_0x23832d);if(_0xffbb1b[_0x19c5('0x30')][_0x19c5('0x3a')]){_0x3ad37a['where']=_[_0x19c5('0x3b')](_0x3ad37a[_0x19c5('0x3c')],{'$or':_[_0x19c5('0x2b')](_0x23832d,function(_0x248819){if(_0x248819[_0x19c5('0x2e')]!==_0x19c5('0x3d')){var _0x279a7b={};_0x279a7b[_0x248819[_0x19c5('0x29')]]={'$like':'%'+_0xffbb1b[_0x19c5('0x30')]['filter']+'%'};return _0x279a7b;}})});}_0x3ad37a=_[_0x19c5('0x3b')]({},_0x3ad37a,_0xffbb1b[_0x19c5('0x3e')]);var _0x39ef54={'where':_0x3ad37a[_0x19c5('0x3c')]};return db[_0x19c5('0x3f')][_0x19c5('0x1d')](_0x39ef54)[_0x19c5('0x25')](function(_0x2bd09d){_0x91ae64[_0x19c5('0x1d')]=_0x2bd09d;if(_0xffbb1b[_0x19c5('0x30')][_0x19c5('0x40')]){_0x3ad37a[_0x19c5('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x19c5('0x42')](_0x3ad37a);})[_0x19c5('0x25')](function(_0x1708cb){_0x91ae64[_0x19c5('0x43')]=_0x1708cb;return _0x91ae64;})[_0x19c5('0x25')](respondWithFilteredResult(_0x4df792,_0x3ad37a))[_0x19c5('0x44')](handleError(_0x4df792,null));};exports['show']=function(_0x59eeed,_0x223bdd){var _0x5a0774={'raw':!![],'where':{'id':_0x59eeed[_0x19c5('0x45')]['id']}},_0x3d3ab4={};_0x3d3ab4['model']=_[_0x19c5('0x46')](db[_0x19c5('0x3f')][_0x19c5('0x2c')]);_0x3d3ab4[_0x19c5('0x30')]=_[_0x19c5('0x46')](_0x59eeed[_0x19c5('0x30')]);_0x3d3ab4[_0x19c5('0x31')]=_[_0x19c5('0x32')](_0x3d3ab4[_0x19c5('0x33')],_0x3d3ab4['query']);_0x5a0774['attributes']=_[_0x19c5('0x32')](_0x3d3ab4['model'],qs[_0x19c5('0x47')](_0x59eeed[_0x19c5('0x30')]['fields']));_0x5a0774['attributes']=_0x5a0774['attributes'][_0x19c5('0x35')]?_0x5a0774['attributes']:_0x3d3ab4[_0x19c5('0x33')];if(_0x59eeed['query'][_0x19c5('0x40')]){_0x5a0774['include']=[{'all':!![]}];}_0x5a0774=_[_0x19c5('0x3b')]({},_0x5a0774,_0x59eeed[_0x19c5('0x3e')]);return db[_0x19c5('0x3f')][_0x19c5('0x48')](_0x5a0774)[_0x19c5('0x25')](handleEntityNotFound(_0x223bdd,null))['then'](respondWithResult(_0x223bdd,null))['catch'](handleError(_0x223bdd,null));};exports[_0x19c5('0x49')]=function(_0x3f672e,_0xfab30b){return db[_0x19c5('0x3f')][_0x19c5('0x49')](_0x3f672e[_0x19c5('0x4a')],{})[_0x19c5('0x25')](respondWithResult(_0xfab30b,0xc9))['catch'](handleError(_0xfab30b,null));};exports['update']=function(_0x5345ee,_0x4cb129){if(_0x5345ee[_0x19c5('0x4a')]['id']){delete _0x5345ee[_0x19c5('0x4a')]['id'];}return db[_0x19c5('0x3f')][_0x19c5('0x48')]({'where':{'id':_0x5345ee['params']['id']}})[_0x19c5('0x25')](handleEntityNotFound(_0x4cb129,null))[_0x19c5('0x25')](saveUpdates(_0x5345ee[_0x19c5('0x4a')],null))['then'](respondWithResult(_0x4cb129,null))[_0x19c5('0x44')](handleError(_0x4cb129,null));};exports['destroy']=function(_0x2c1cb4,_0x289230){return db[_0x19c5('0x3f')][_0x19c5('0x48')]({'where':{'id':_0x2c1cb4[_0x19c5('0x45')]['id']}})[_0x19c5('0x25')](handleEntityNotFound(_0x289230,null))['then'](removeEntity(_0x289230,null))['catch'](handleError(_0x289230,null));};exports[_0x19c5('0x4b')]=function(_0x2fae94,_0x4ca356){return db[_0x19c5('0x3f')][_0x19c5('0x4b')]()['then'](respondWithResult(_0x4ca356,null))[_0x19c5('0x44')](handleError(_0x4ca356,null));};exports[_0x19c5('0x4c')]=function(_0x25a840,_0x184b58,_0x305730){var _0x5cdd51={'raw':!![],'where':{}};var _0x30e4f5={};var _0x6447da={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x19c5('0x4d')]({'where':{'id':_0x25a840[_0x19c5('0x45')]['id']}})['then'](handleEntityNotFound(_0x184b58,null))[_0x19c5('0x25')](function(_0x1d3ba0){if(_0x1d3ba0){_0x30e4f5[_0x19c5('0x33')]=_[_0x19c5('0x46')](db[_0x19c5('0x4e')][_0x19c5('0x2c')]);_0x30e4f5[_0x19c5('0x30')]=_[_0x19c5('0x46')](_0x25a840[_0x19c5('0x30')]);_0x30e4f5[_0x19c5('0x31')]=_[_0x19c5('0x32')](_0x30e4f5[_0x19c5('0x33')],_0x30e4f5[_0x19c5('0x30')]);_0x5cdd51['attributes']=_[_0x19c5('0x32')](_0x30e4f5[_0x19c5('0x33')],qs[_0x19c5('0x47')](_0x25a840[_0x19c5('0x30')]['fields']));_0x5cdd51['attributes']=_0x5cdd51[_0x19c5('0x34')][_0x19c5('0x35')]?_0x5cdd51[_0x19c5('0x34')]:_0x30e4f5[_0x19c5('0x33')];if(!_0x25a840[_0x19c5('0x30')]['hasOwnProperty']('nolimit')){_0x5cdd51['limit']=qs[_0x19c5('0x1e')](_0x25a840['query']['limit']);_0x5cdd51[_0x19c5('0x1b')]=qs[_0x19c5('0x1b')](_0x25a840[_0x19c5('0x30')][_0x19c5('0x1b')]);}_0x5cdd51['order']=qs[_0x19c5('0x4f')](_0x25a840[_0x19c5('0x30')][_0x19c5('0x4f')]);_0x5cdd51[_0x19c5('0x3c')]=qs['filters'](_[_0x19c5('0x39')](_0x25a840[_0x19c5('0x30')],_0x30e4f5['filters']));_0x5cdd51[_0x19c5('0x3c')][_0x19c5('0x50')]=_0x1d3ba0['id'];if(_0x25a840[_0x19c5('0x30')][_0x19c5('0x3a')]){_0x5cdd51[_0x19c5('0x3c')]=_[_0x19c5('0x3b')](_0x5cdd51[_0x19c5('0x3c')],{'$or':_[_0x19c5('0x2b')](_0x5cdd51[_0x19c5('0x34')],function(_0x1f8d22){var _0x1dc2c7={};_0x1dc2c7[_0x1f8d22]={'$like':'%'+_0x25a840['query'][_0x19c5('0x3a')]+'%'};return _0x1dc2c7;})});}_0x5cdd51=_[_0x19c5('0x3b')]({},_0x5cdd51,_0x25a840[_0x19c5('0x3e')]);return db[_0x19c5('0x4e')]['count']({'where':_0x5cdd51[_0x19c5('0x3c')]})['then'](function(_0x104bae){_0x6447da[_0x19c5('0x1d')]=_0x104bae;if(_0x25a840['query']['includeAll']){_0x5cdd51[_0x19c5('0x41')]=[{'all':!![]}];}return db[_0x19c5('0x4e')]['findAll'](_0x5cdd51);})[_0x19c5('0x25')](function(_0x271349){_0x6447da[_0x19c5('0x43')]=_0x271349;return _0x6447da;});}})[_0x19c5('0x25')](respondWithFilteredResult(_0x184b58,_0x5cdd51))['catch'](handleError(_0x184b58,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index dfe5bf9..f260e90 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 _0x81c6=['JscriptySessionReport','util','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x43edcf,_0x21f0fa){var _0x424c24=function(_0xdd83df){while(--_0xdd83df){_0x43edcf['push'](_0x43edcf['shift']());}};_0x424c24(++_0x21f0fa);}(_0x81c6,0x1d5));var _0x681c=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x81c6[_0x511b76];return _0x5424ff;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['moment','request-promise','path','rimraf','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x1ed0ce,_0x381bf4){var _0x3978b1=function(_0x16a1e9){while(--_0x16a1e9){_0x1ed0ce['push'](_0x1ed0ce['shift']());}};_0x3978b1(++_0x381bf4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x35b05d,_0x5d7664){_0x35b05d=_0x35b05d-0x0;var _0x47b869=_0xc1c6[_0x35b05d];return _0x47b869;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index debc431..efc092f 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 _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xacf4,0xe7));var _0x4acf=function(_0x29d205,_0x4ddfb0){_0x29d205=_0x29d205-0x0;var _0x7794c1=_0xacf4[_0x29d205];return _0x7794c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file +var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xd117,0x182));var _0x7d11=function(_0x1ccb5d,_0x341da9){_0x1ccb5d=_0x1ccb5d-0x0;var _0x1fe071=_0xd117[_0x1ccb5d];return _0x1fe071;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c9459dc..f297785 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 _0x4f08=['../../components/auth/service','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x31e025,_0x2c063e){var _0x75044f=function(_0xe7b48b){while(--_0xe7b48b){_0x31e025['push'](_0x31e025['shift']());}};_0x75044f(++_0x2c063e);}(_0x4f08,0x1bc));var _0x84f0=function(_0x39c047,_0x567fc6){_0x39c047=_0x39c047-0x0;var _0x3713ce=_0x4f08[_0x39c047];return _0x3713ce;};'use strict';var multer=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var path=require('path');var timeout=require(_0x84f0('0x2'));var express=require(_0x84f0('0x3'));var router=express[_0x84f0('0x4')]();var fs_extra=require(_0x84f0('0x5'));var auth=require(_0x84f0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x84f0('0x7')]('/',controller['index']);router[_0x84f0('0x8')](_0x84f0('0x9'),auth[_0x84f0('0xa')](),controller[_0x84f0('0xb')]);router[_0x84f0('0x7')](_0x84f0('0xc'),auth['isAuthenticated'](),controller[_0x84f0('0xd')]);module[_0x84f0('0xe')]=router; \ No newline at end of file +var _0x33c6=['path','connect-timeout','express','fs-extra','../../components/auth/service','get','index','put','/:id','isAuthenticated','update','downloadLogFile','exports','util'];(function(_0x2a5dc1,_0xc58ca4){var _0x244d63=function(_0x2836c5){while(--_0x2836c5){_0x2a5dc1['push'](_0x2a5dc1['shift']());}};_0x244d63(++_0xc58ca4);}(_0x33c6,0x15d));var _0x633c=function(_0x367a96,_0x4ab6e5){_0x367a96=_0x367a96-0x0;var _0x5ec123=_0x33c6[_0x367a96];return _0x5ec123;};'use strict';var multer=require('multer');var util=require(_0x633c('0x0'));var path=require(_0x633c('0x1'));var timeout=require(_0x633c('0x2'));var express=require(_0x633c('0x3'));var router=express['Router']();var fs_extra=require(_0x633c('0x4'));var auth=require(_0x633c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x633c('0x6')]('/',controller[_0x633c('0x7')]);router[_0x633c('0x8')](_0x633c('0x9'),auth[_0x633c('0xa')](),controller[_0x633c('0xb')]);router[_0x633c('0x6')]('/download_log_file',auth[_0x633c('0xa')](),controller[_0x633c('0xc')]);module[_0x633c('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 8ecbba1..30d8ff3 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 _0x837d=['INTEGER','sequelize','exports','STRING'];(function(_0x51f1c7,_0x2f527f){var _0x4c51a5=function(_0x539ad1){while(--_0x539ad1){_0x51f1c7['push'](_0x51f1c7['shift']());}};_0x4c51a5(++_0x2f527f);}(_0x837d,0x165));var _0xd837=function(_0x563881,_0x5dacec){_0x563881=_0x563881-0x0;var _0xd565b2=_0x837d[_0x563881];return _0xd565b2;};'use strict';var Sequelize=require(_0xd837('0x0'));module[_0xd837('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd837('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd837('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfa9f=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x51c5fc,_0x335ba0){var _0x242b3b=function(_0x41ab5d){while(--_0x41ab5d){_0x51c5fc['push'](_0x51c5fc['shift']());}};_0x242b3b(++_0x335ba0);}(_0xfa9f,0x9e));var _0xffa9=function(_0xfc7019,_0x277c9e){_0xfc7019=_0xfc7019-0x0;var _0x2af8f4=_0xfa9f[_0xfc7019];return _0x2af8f4;};'use strict';var Sequelize=require(_0xffa9('0x0'));module[_0xffa9('0x1')]={'license':{'type':Sequelize[_0xffa9('0x2')]},'data1':{'type':Sequelize[_0xffa9('0x3')]},'data2':{'type':Sequelize[_0xffa9('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xffa9('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 8864061..0f4b9a4 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 _0xdc38=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','index','License','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-Type','text/plain','download','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x36a254,_0x120f26){var _0x55ac3a=function(_0x1c44cc){while(--_0x1c44cc){_0x36a254['push'](_0x36a254['shift']());}};_0x55ac3a(++_0x120f26);}(_0xdc38,0x188));var _0x8dc3=function(_0x8e3a84,_0x406e90){_0x8e3a84=_0x8e3a84-0x0;var _0x1ed36e=_0xdc38[_0x8e3a84];return _0x1ed36e;};'use strict';var emlformat=require(_0x8dc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dc3('0x2'));var moment=require('moment');var BPromise=require(_0x8dc3('0x3'));var Mustache=require(_0x8dc3('0x4'));var util=require(_0x8dc3('0x5'));var path=require('path');var sox=require(_0x8dc3('0x6'));var csv=require(_0x8dc3('0x7'));var ejs=require(_0x8dc3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8dc3('0x9'));var crypto=require(_0x8dc3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8dc3('0xb'));var toCsv=require(_0x8dc3('0x7'));var querystring=require(_0x8dc3('0xc'));var Papa=require(_0x8dc3('0xd'));var Redis=require(_0x8dc3('0xe'));var authService=require(_0x8dc3('0xf'));var qs=require(_0x8dc3('0x10'));var as=require(_0x8dc3('0x11'));var hardwareService=require(_0x8dc3('0x12'));var logger=require('../../config/logger')(_0x8dc3('0x13'));var utils=require(_0x8dc3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8dc3('0x15'));var db=require(_0x8dc3('0x16'))['db'];function respondWithStatusCode(_0x4c2366,_0x20aea0){_0x20aea0=_0x20aea0||0xcc;return function(_0x282f3a){if(_0x282f3a){return _0x4c2366[_0x8dc3('0x17')](_0x20aea0);}return _0x4c2366['status'](_0x20aea0)[_0x8dc3('0x18')]();};}function respondWithResult(_0x43e20b,_0x375fd5){_0x375fd5=_0x375fd5||0xc8;return function(_0x2f99c9){if(_0x2f99c9){return _0x43e20b[_0x8dc3('0x19')](_0x375fd5)[_0x8dc3('0x1a')](_0x2f99c9);}};}function respondWithFilteredResult(_0x2ee13b,_0x1d3a70){return function(_0x143a63){if(_0x143a63){var _0x4ce4b7=typeof _0x1d3a70[_0x8dc3('0x1b')]===_0x8dc3('0x1c')&&typeof _0x1d3a70[_0x8dc3('0x1d')]===_0x8dc3('0x1c');var _0x3b99c6=_0x143a63[_0x8dc3('0x1e')];var _0x419e45=_0x4ce4b7?0x0:_0x1d3a70[_0x8dc3('0x1b')];var _0x22b069=_0x4ce4b7?_0x143a63[_0x8dc3('0x1e')]:_0x1d3a70[_0x8dc3('0x1b')]+_0x1d3a70[_0x8dc3('0x1d')];var _0x2f5149;if(_0x22b069>=_0x3b99c6){_0x22b069=_0x3b99c6;_0x2f5149=0xc8;}else{_0x2f5149=0xce;}_0x2ee13b[_0x8dc3('0x19')](_0x2f5149);return _0x2ee13b[_0x8dc3('0x1f')](_0x8dc3('0x20'),_0x419e45+'-'+_0x22b069+'/'+_0x3b99c6)[_0x8dc3('0x1a')](_0x143a63);}return null;};}function patchUpdates(_0x3d4359){return function(_0x5373fc){try{jsonpatch['apply'](_0x5373fc,_0x3d4359,!![]);}catch(_0x540a89){return BPromise[_0x8dc3('0x21')](_0x540a89);}return _0x5373fc['save']();};}function saveUpdates(_0x2ea3c6,_0x679687){return function(_0x4a28f8){if(_0x4a28f8){return _0x4a28f8[_0x8dc3('0x22')](_0x2ea3c6)[_0x8dc3('0x23')](function(_0xcd6ee1){return _0xcd6ee1;});}return null;};}function removeEntity(_0x53f29a,_0x27391d){return function(_0x4a0dab){if(_0x4a0dab){return _0x4a0dab[_0x8dc3('0x24')]()[_0x8dc3('0x23')](function(){_0x53f29a[_0x8dc3('0x19')](0xcc)[_0x8dc3('0x18')]();});}};}function handleEntityNotFound(_0x106c72,_0x35b865){return function(_0x55ffe2){if(!_0x55ffe2){_0x106c72[_0x8dc3('0x17')](0x194);}return _0x55ffe2;};}function handleError(_0x25b076,_0x3821bb){_0x3821bb=_0x3821bb||0x1f4;return function(_0x42a58c){logger[_0x8dc3('0x25')](_0x42a58c['stack']);if(_0x42a58c[_0x8dc3('0x26')]){delete _0x42a58c['name'];}_0x25b076[_0x8dc3('0x19')](_0x3821bb)['send'](_0x42a58c);};}var utilLicense=require('../../config/license/util');exports[_0x8dc3('0x27')]=function(_0x15e90f,_0x76ec8a){var _0x1f93d2={'raw':!![],'where':{'id':0x1}},_0x40528c={};_0x40528c['model']=_['keys'](db[_0x8dc3('0x28')][_0x8dc3('0x29')]);_0x40528c[_0x8dc3('0x2a')]=_[_0x8dc3('0x2b')](_0x15e90f[_0x8dc3('0x2a')]);_0x40528c[_0x8dc3('0x2c')]=_[_0x8dc3('0x2d')](_0x40528c[_0x8dc3('0x2e')],_0x40528c[_0x8dc3('0x2a')]);_0x1f93d2[_0x8dc3('0x2f')]=_['intersection'](_0x40528c[_0x8dc3('0x2e')],qs['fields'](_0x15e90f[_0x8dc3('0x2a')][_0x8dc3('0x30')]));_0x1f93d2[_0x8dc3('0x2f')]=_0x1f93d2[_0x8dc3('0x2f')][_0x8dc3('0x31')]?_0x1f93d2[_0x8dc3('0x2f')]:_0x40528c[_0x8dc3('0x2e')];_0x1f93d2=_[_0x8dc3('0x32')]({},_0x1f93d2,_0x15e90f[_0x8dc3('0x33')]);return utilLicense[_0x8dc3('0x34')](_0x1f93d2)[_0x8dc3('0x23')](respondWithResult(_0x76ec8a,null))[_0x8dc3('0x35')](handleError(_0x76ec8a,null));};exports[_0x8dc3('0x22')]=function(_0x3d2a92,_0x3346d5){if(_0x3d2a92[_0x8dc3('0x36')]['id']){delete _0x3d2a92[_0x8dc3('0x36')]['id'];}return db[_0x8dc3('0x28')]['find']({'where':{'id':_0x3d2a92[_0x8dc3('0x37')]['id']}})['then'](handleEntityNotFound(_0x3346d5,null))[_0x8dc3('0x23')](function(_0x27a0f9){var _0x58540f=_0x27a0f9[_0x8dc3('0x38')]({'plain':!![]});return utilLicense[_0x8dc3('0x39')](_0x58540f,_0x3d2a92[_0x8dc3('0x36')][_0x8dc3('0x3a')]);})['then'](function(_0x44f6f6){if(!_0x44f6f6[_0x8dc3('0x3b')]){return saveUpdates(_0x3d2a92[_0x8dc3('0x36')],null);}return _0x44f6f6;})['then'](respondWithResult(_0x3346d5,null))['catch'](handleError(_0x3346d5,null));};exports[_0x8dc3('0x3c')]=function(_0x57b975,_0xc8a6fa){var _0x3cb0da=_0x8dc3('0x3d');var _0x23cf9a=path[_0x8dc3('0x3e')](_0x8dc3('0x3f'),_0x8dc3('0x40'),_0x8dc3('0x41'),_0x3cb0da);_0xc8a6fa[_0x8dc3('0x42')]('Content-disposition','attachment;\x20filename='+_0x3cb0da);_0xc8a6fa[_0x8dc3('0x1f')](_0x8dc3('0x43'),_0x8dc3('0x44'));_0xc8a6fa[_0x8dc3('0x45')](_0x23cf9a);}; \ No newline at end of file +var _0x662f=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','model','keys','License','query','filters','intersection','attributes','fields','length','options','getLicense','update','body','find','checkLicense','key','demo','catch','license-info.log','join','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x3e58f2,_0xb41915){var _0x3a3169=function(_0x347112){while(--_0x347112){_0x3e58f2['push'](_0x3e58f2['shift']());}};_0x3a3169(++_0xb41915);}(_0x662f,0x133));var _0xf662=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x662f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf662('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf662('0x1'));var rp=require(_0xf662('0x2'));var moment=require('moment');var BPromise=require(_0xf662('0x3'));var Mustache=require(_0xf662('0x4'));var util=require('util');var path=require(_0xf662('0x5'));var sox=require(_0xf662('0x6'));var csv=require(_0xf662('0x7'));var ejs=require(_0xf662('0x8'));var fs=require('fs');var fs_extra=require(_0xf662('0x9'));var _=require('lodash');var squel=require(_0xf662('0xa'));var crypto=require(_0xf662('0xb'));var jsforce=require(_0xf662('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf662('0xd'));var Papa=require(_0xf662('0xe'));var Redis=require(_0xf662('0xf'));var authService=require(_0xf662('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf662('0x11'));var hardwareService=require(_0xf662('0x12'));var logger=require(_0xf662('0x13'))(_0xf662('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf662('0x15'));var db=require(_0xf662('0x16'))['db'];function respondWithStatusCode(_0x311dfa,_0x20cdde){_0x20cdde=_0x20cdde||0xcc;return function(_0x278293){if(_0x278293){return _0x311dfa[_0xf662('0x17')](_0x20cdde);}return _0x311dfa[_0xf662('0x18')](_0x20cdde)[_0xf662('0x19')]();};}function respondWithResult(_0x3b03ba,_0x2cf5dd){_0x2cf5dd=_0x2cf5dd||0xc8;return function(_0x360575){if(_0x360575){return _0x3b03ba['status'](_0x2cf5dd)[_0xf662('0x1a')](_0x360575);}};}function respondWithFilteredResult(_0x5f2d2c,_0x326933){return function(_0x413f61){if(_0x413f61){var _0x39d3d0=typeof _0x326933[_0xf662('0x1b')]==='undefined'&&typeof _0x326933['limit']===_0xf662('0x1c');var _0x4725f3=_0x413f61[_0xf662('0x1d')];var _0xf0bbe=_0x39d3d0?0x0:_0x326933[_0xf662('0x1b')];var _0xec9417=_0x39d3d0?_0x413f61[_0xf662('0x1d')]:_0x326933[_0xf662('0x1b')]+_0x326933['limit'];var _0x1ec2b5;if(_0xec9417>=_0x4725f3){_0xec9417=_0x4725f3;_0x1ec2b5=0xc8;}else{_0x1ec2b5=0xce;}_0x5f2d2c[_0xf662('0x18')](_0x1ec2b5);return _0x5f2d2c[_0xf662('0x1e')](_0xf662('0x1f'),_0xf0bbe+'-'+_0xec9417+'/'+_0x4725f3)['json'](_0x413f61);}return null;};}function patchUpdates(_0x27c234){return function(_0x110fb8){try{jsonpatch['apply'](_0x110fb8,_0x27c234,!![]);}catch(_0x24b816){return BPromise[_0xf662('0x20')](_0x24b816);}return _0x110fb8[_0xf662('0x21')]();};}function saveUpdates(_0x9d5c53,_0x428c58){return function(_0x102b51){if(_0x102b51){return _0x102b51['update'](_0x9d5c53)[_0xf662('0x22')](function(_0x356428){return _0x356428;});}return null;};}function removeEntity(_0x3db5cc,_0x15580b){return function(_0x255999){if(_0x255999){return _0x255999[_0xf662('0x23')]()[_0xf662('0x22')](function(){_0x3db5cc[_0xf662('0x18')](0xcc)[_0xf662('0x19')]();});}};}function handleEntityNotFound(_0x45d96a,_0x54193f){return function(_0x350529){if(!_0x350529){_0x45d96a['sendStatus'](0x194);}return _0x350529;};}function handleError(_0x14c732,_0x5e6a16){_0x5e6a16=_0x5e6a16||0x1f4;return function(_0xa36aa0){logger[_0xf662('0x24')](_0xa36aa0[_0xf662('0x25')]);if(_0xa36aa0[_0xf662('0x26')]){delete _0xa36aa0[_0xf662('0x26')];}_0x14c732[_0xf662('0x18')](_0x5e6a16)[_0xf662('0x27')](_0xa36aa0);};}var utilLicense=require(_0xf662('0x15'));exports['index']=function(_0x406fee,_0x15360e){var _0x27ff52={'raw':!![],'where':{'id':0x1}},_0x232349={};_0x232349[_0xf662('0x28')]=_[_0xf662('0x29')](db[_0xf662('0x2a')]['rawAttributes']);_0x232349[_0xf662('0x2b')]=_[_0xf662('0x29')](_0x406fee['query']);_0x232349[_0xf662('0x2c')]=_[_0xf662('0x2d')](_0x232349[_0xf662('0x28')],_0x232349[_0xf662('0x2b')]);_0x27ff52[_0xf662('0x2e')]=_[_0xf662('0x2d')](_0x232349[_0xf662('0x28')],qs[_0xf662('0x2f')](_0x406fee['query']['fields']));_0x27ff52[_0xf662('0x2e')]=_0x27ff52[_0xf662('0x2e')][_0xf662('0x30')]?_0x27ff52[_0xf662('0x2e')]:_0x232349[_0xf662('0x28')];_0x27ff52=_['merge']({},_0x27ff52,_0x406fee[_0xf662('0x31')]);return utilLicense[_0xf662('0x32')](_0x27ff52)['then'](respondWithResult(_0x15360e,null))['catch'](handleError(_0x15360e,null));};exports[_0xf662('0x33')]=function(_0x21274d,_0x40e637){if(_0x21274d[_0xf662('0x34')]['id']){delete _0x21274d[_0xf662('0x34')]['id'];}return db['License'][_0xf662('0x35')]({'where':{'id':_0x21274d['params']['id']}})[_0xf662('0x22')](handleEntityNotFound(_0x40e637,null))[_0xf662('0x22')](function(_0x416e9d){var _0x17f19e=_0x416e9d['get']({'plain':!![]});return utilLicense[_0xf662('0x36')](_0x17f19e,_0x21274d[_0xf662('0x34')][_0xf662('0x37')]);})['then'](function(_0x3f8455){if(!_0x3f8455[_0xf662('0x38')]){return saveUpdates(_0x21274d[_0xf662('0x34')],null);}return _0x3f8455;})[_0xf662('0x22')](respondWithResult(_0x40e637,null))[_0xf662('0x39')](handleError(_0x40e637,null));};exports['downloadLogFile']=function(_0xbfe05c,_0x2fa938){var _0x137575=_0xf662('0x3a');var _0x49ef46=path[_0xf662('0x3b')]('/var','log',_0xf662('0x3c'),_0x137575);_0x2fa938['setHeader'](_0xf662('0x3d'),_0xf662('0x3e')+_0x137575);_0x2fa938[_0xf662('0x1e')](_0xf662('0x3f'),_0xf662('0x40'));_0x2fa938[_0xf662('0x41')](_0x49ef46);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fbaae25..eea0111 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 _0x4a11=['../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5252e3,_0x35c80e){var _0x5ceb44=function(_0x757362){while(--_0x757362){_0x5252e3['push'](_0x5252e3['shift']());}};_0x5ceb44(++_0x35c80e);}(_0x4a11,0xfd));var _0x14a1=function(_0x5e4e54,_0x22683c){_0x5e4e54=_0x5e4e54-0x0;var _0x20b557=_0x4a11[_0x5e4e54];return _0x20b557;};'use strict';var _=require(_0x14a1('0x0'));var util=require('util');var logger=require(_0x14a1('0x1'))('api');var moment=require(_0x14a1('0x2'));var BPromise=require(_0x14a1('0x3'));var rp=require(_0x14a1('0x4'));var fs=require('fs');var path=require(_0x14a1('0x5'));var rimraf=require(_0x14a1('0x6'));var config=require(_0x14a1('0x7'));var attributes=require(_0x14a1('0x8'));module[_0x14a1('0x9')]=function(_0x1d3bd0,_0x56c6cc){return _0x1d3bd0[_0x14a1('0xa')](_0x14a1('0xb'),attributes,{'tableName':_0x14a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fba=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','License'];(function(_0x142038,_0x34b23b){var _0x1d3a56=function(_0x93e09e){while(--_0x93e09e){_0x142038['push'](_0x142038['shift']());}};_0x1d3a56(++_0x34b23b);}(_0x8fba,0x64));var _0xa8fb=function(_0x90d3eb,_0x1c7eaa){_0x90d3eb=_0x90d3eb-0x0;var _0x5f38d0=_0x8fba[_0x90d3eb];return _0x5f38d0;};'use strict';var _=require(_0xa8fb('0x0'));var util=require(_0xa8fb('0x1'));var logger=require(_0xa8fb('0x2'))(_0xa8fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa8fb('0x4'));var fs=require('fs');var path=require(_0xa8fb('0x5'));var rimraf=require(_0xa8fb('0x6'));var config=require(_0xa8fb('0x7'));var attributes=require('./license.attributes');module[_0xa8fb('0x8')]=function(_0x32422d,_0x123a6f){return _0x32422d['define'](_0xa8fb('0x9'),attributes,{'tableName':'license','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 1706a23..5f88be1 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 _0x0a51=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x0a51,0x1aa));var _0x10a5=function(_0x1e28b6,_0x58cf17){_0x1e28b6=_0x1e28b6-0x0;var _0x22070a=_0x0a51[_0x1e28b6];return _0x22070a;};'use strict';var _=require(_0x10a5('0x0'));var util=require(_0x10a5('0x1'));var moment=require(_0x10a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x10a5('0x3'));var fs=require('fs');var Redis=require(_0x10a5('0x4'));var db=require(_0x10a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x10a5('0x6'));var config=require('../../config/environment');var jayson=require(_0x10a5('0x7'));var client=jayson[_0x10a5('0x8')][_0x10a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7bc2,_0x439198,_0x43be8d){return new BPromise(function(_0x1499ab,_0x43a249){return client['request'](_0x2e7bc2,_0x43be8d)[_0x10a5('0xa')](function(_0x3cdfb0){logger[_0x10a5('0xb')](_0x10a5('0xc'),_0x439198,_0x10a5('0xd'));logger[_0x10a5('0xe')](_0x10a5('0xf'),_0x439198,_0x10a5('0xd'),JSON[_0x10a5('0x10')](_0x3cdfb0));if(_0x3cdfb0[_0x10a5('0x11')]){if(_0x3cdfb0[_0x10a5('0x11')][_0x10a5('0x12')]===0x1f4){logger['error'](_0x10a5('0xc'),_0x439198,_0x3cdfb0['error']['message']);return _0x43a249(_0x3cdfb0['error']['message']);}logger[_0x10a5('0x11')]('License,\x20%s,\x20%s',_0x439198,_0x3cdfb0[_0x10a5('0x11')][_0x10a5('0x13')]);return _0x1499ab(_0x3cdfb0[_0x10a5('0x11')]['message']);}else{logger['info'](_0x10a5('0xc'),_0x439198,_0x10a5('0xd'));_0x1499ab(_0x3cdfb0[_0x10a5('0x14')][_0x10a5('0x13')]);}})[_0x10a5('0x15')](function(_0x14a36b){logger['error'](_0x10a5('0xc'),_0x439198,_0x14a36b);_0x43a249(_0x14a36b);});});} \ No newline at end of file +var _0x8199=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x292ec9,_0x3f304d){var _0xce9423=function(_0x3d7052){while(--_0x3d7052){_0x292ec9['push'](_0x292ec9['shift']());}};_0xce9423(++_0x3f304d);}(_0x8199,0x185));var _0x9819=function(_0x509dad,_0x1f995f){_0x509dad=_0x509dad-0x0;var _0x21e122=_0x8199[_0x509dad];return _0x21e122;};'use strict';var _=require(_0x9819('0x0'));var util=require(_0x9819('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9819('0x2'));var db=require(_0x9819('0x3'))['db'];var utils=require(_0x9819('0x4'));var logger=require(_0x9819('0x5'))('rpc');var config=require(_0x9819('0x6'));var jayson=require(_0x9819('0x7'));var client=jayson[_0x9819('0x8')][_0x9819('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c9a7b,_0x14738c,_0x6ebd89){return new BPromise(function(_0x52475c,_0x552378){return client['request'](_0x2c9a7b,_0x6ebd89)[_0x9819('0xa')](function(_0x45c9da){logger[_0x9819('0xb')](_0x9819('0xc'),_0x14738c,_0x9819('0xd'));logger[_0x9819('0xe')](_0x9819('0xf'),_0x14738c,_0x9819('0xd'),JSON[_0x9819('0x10')](_0x45c9da));if(_0x45c9da['error']){if(_0x45c9da[_0x9819('0x11')]['code']===0x1f4){logger[_0x9819('0x11')]('License,\x20%s,\x20%s',_0x14738c,_0x45c9da[_0x9819('0x11')][_0x9819('0x12')]);return _0x552378(_0x45c9da[_0x9819('0x11')]['message']);}logger['error'](_0x9819('0xc'),_0x14738c,_0x45c9da[_0x9819('0x11')][_0x9819('0x12')]);return _0x52475c(_0x45c9da[_0x9819('0x11')][_0x9819('0x12')]);}else{logger[_0x9819('0xb')]('License,\x20%s,\x20%s',_0x14738c,_0x9819('0xd'));_0x52475c(_0x45c9da[_0x9819('0x13')]['message']);}})[_0x9819('0x14')](function(_0x2b72d2){logger[_0x9819('0x11')](_0x9819('0xc'),_0x14738c,_0x2b72d2);_0x552378(_0x2b72d2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d629a54..9301d79 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 _0x5c85=['./mailAccount.controller','isAuthenticated','get','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/interactions','addInteraction','addApplications','/:id/send','send','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5c85,0x1e5));var _0x55c8=function(_0x1e715d,_0x58077a){_0x1e715d=_0x1e715d-0x0;var _0x3938d1=_0x5c85[_0x1e715d];return _0x3938d1;};'use strict';var multer=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var path=require(_0x55c8('0x2'));var timeout=require(_0x55c8('0x3'));var express=require(_0x55c8('0x4'));var router=express[_0x55c8('0x5')]();var fs_extra=require(_0x55c8('0x6'));var auth=require(_0x55c8('0x7'));var interaction=require(_0x55c8('0x8'));var config=require(_0x55c8('0x9'));var controller=require(_0x55c8('0xa'));router['get']('/',auth[_0x55c8('0xb')](),controller['index']);router[_0x55c8('0xc')]('/describe',auth[_0x55c8('0xb')](),controller[_0x55c8('0xd')]);router['get'](_0x55c8('0xe'),auth[_0x55c8('0xb')](),controller['show']);router[_0x55c8('0xc')](_0x55c8('0xf'),auth[_0x55c8('0xb')](),controller['getDispositions']);router['get'](_0x55c8('0x10'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x11')]);router['get'](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x13')]);router[_0x55c8('0xc')](_0x55c8('0x14'),auth[_0x55c8('0xb')](),controller['getSmtp']);router[_0x55c8('0xc')]('/:id/interactions',auth[_0x55c8('0xb')](),controller[_0x55c8('0x15')]);router[_0x55c8('0xc')](_0x55c8('0x16'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x17')]);router[_0x55c8('0xc')](_0x55c8('0x18'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x19')]);router[_0x55c8('0xc')]('/:id/verify',auth['isAuthenticated'](),controller[_0x55c8('0x1a')]);router[_0x55c8('0xc')](_0x55c8('0x1b'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x1c')]);router[_0x55c8('0x1d')](_0x55c8('0xf'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x1e')]);router[_0x55c8('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x55c8('0x1f')]);router[_0x55c8('0x1d')]('/',auth[_0x55c8('0xb')](),controller[_0x55c8('0x20')]);router['post'](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x21')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router[_0x55c8('0x1d')](_0x55c8('0x22'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x23')]);router[_0x55c8('0x1d')](_0x55c8('0x16'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x24')]);router['post'](_0x55c8('0x25'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x26')]);router[_0x55c8('0x1d')]('/:id/users',auth[_0x55c8('0xb')](),controller['addAgents']);router['put'](_0x55c8('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x55c8('0x27')](_0x55c8('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x55c8('0xb')](),controller['removeAnswers']);router[_0x55c8('0x27')](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x28')]);router[_0x55c8('0x27')]('/:id/out_servers',auth[_0x55c8('0xb')](),controller[_0x55c8('0x29')]);router['delete'](_0x55c8('0xe'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x2a')]);router[_0x55c8('0x27')](_0x55c8('0x1b'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x2b')]);module[_0x55c8('0x2c')]=router; \ No newline at end of file +var _0x2998=['addSmtp','addApplications','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addImap'];(function(_0x31bc55,_0x2735ad){var _0x50b2cf=function(_0x122982){while(--_0x122982){_0x31bc55['push'](_0x31bc55['shift']());}};_0x50b2cf(++_0x2735ad);}(_0x2998,0x1cf));var _0x8299=function(_0x5c0832,_0x1b480f){_0x5c0832=_0x5c0832-0x0;var _0x170641=_0x2998[_0x5c0832];return _0x170641;};'use strict';var multer=require(_0x8299('0x0'));var util=require(_0x8299('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8299('0x2'));var router=express[_0x8299('0x3')]();var fs_extra=require(_0x8299('0x4'));var auth=require(_0x8299('0x5'));var interaction=require(_0x8299('0x6'));var config=require(_0x8299('0x7'));var controller=require('./mailAccount.controller');router[_0x8299('0x8')]('/',auth['isAuthenticated'](),controller[_0x8299('0x9')]);router['get'](_0x8299('0xa'),auth[_0x8299('0xb')](),controller[_0x8299('0xc')]);router[_0x8299('0x8')](_0x8299('0xd'),auth[_0x8299('0xb')](),controller[_0x8299('0xe')]);router[_0x8299('0x8')](_0x8299('0xf'),auth[_0x8299('0xb')](),controller[_0x8299('0x10')]);router[_0x8299('0x8')](_0x8299('0x11'),auth['isAuthenticated'](),controller[_0x8299('0x12')]);router[_0x8299('0x8')](_0x8299('0x13'),auth[_0x8299('0xb')](),controller[_0x8299('0x14')]);router[_0x8299('0x8')](_0x8299('0x15'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x8299('0x8')]('/:id/interactions',auth[_0x8299('0xb')](),controller[_0x8299('0x16')]);router[_0x8299('0x8')](_0x8299('0x17'),auth[_0x8299('0xb')](),controller[_0x8299('0x18')]);router[_0x8299('0x8')]('/:id/messages',auth[_0x8299('0xb')](),controller[_0x8299('0x19')]);router[_0x8299('0x8')]('/:id/verify',auth[_0x8299('0xb')](),controller[_0x8299('0x1a')]);router[_0x8299('0x8')](_0x8299('0x1b'),auth[_0x8299('0xb')](),controller[_0x8299('0x1c')]);router[_0x8299('0x1d')]('/:id/dispositions',auth[_0x8299('0xb')](),controller[_0x8299('0x1e')]);router[_0x8299('0x1d')](_0x8299('0x11'),auth[_0x8299('0xb')](),controller['addAnswer']);router['post']('/',auth[_0x8299('0xb')](),controller['create']);router[_0x8299('0x1d')](_0x8299('0x13'),auth[_0x8299('0xb')](),controller[_0x8299('0x1f')]);router[_0x8299('0x1d')]('/:id/out_servers',auth[_0x8299('0xb')](),controller[_0x8299('0x20')]);router[_0x8299('0x1d')]('/:id/interactions',auth[_0x8299('0xb')](),controller['addInteraction']);router[_0x8299('0x1d')](_0x8299('0x17'),auth['isAuthenticated'](),controller[_0x8299('0x21')]);router[_0x8299('0x1d')](_0x8299('0x22'),auth[_0x8299('0xb')](),controller[_0x8299('0x23')]);router[_0x8299('0x1d')](_0x8299('0x1b'),auth[_0x8299('0xb')](),controller['addAgents']);router[_0x8299('0x24')](_0x8299('0xd'),auth[_0x8299('0xb')](),controller['update']);router[_0x8299('0x25')](_0x8299('0xf'),auth[_0x8299('0xb')](),controller[_0x8299('0x26')]);router[_0x8299('0x25')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8299('0x27')]);router[_0x8299('0x25')](_0x8299('0x13'),auth[_0x8299('0xb')](),controller[_0x8299('0x28')]);router[_0x8299('0x25')](_0x8299('0x15'),auth[_0x8299('0xb')](),controller[_0x8299('0x29')]);router['delete']('/:id',auth[_0x8299('0xb')](),controller[_0x8299('0x2a')]);router[_0x8299('0x25')](_0x8299('0x1b'),auth[_0x8299('0xb')](),controller[_0x8299('0x2b')]);module[_0x8299('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index db575ab..2d7af85 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 _0x1f70=['mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x151fcc,_0x3a8b62){var _0x3dc1e7=function(_0x33c208){while(--_0x33c208){_0x151fcc['push'](_0x151fcc['shift']());}};_0x3dc1e7(++_0x3a8b62);}(_0x1f70,0x1c2));var _0x01f7=function(_0x5b78ec,_0x283236){_0x5b78ec=_0x5b78ec-0x0;var _0x132564=_0x1f70[_0x5b78ec];return _0x132564;};'use strict';var Sequelize=require(_0x01f7('0x0'));module[_0x01f7('0x1')]={'description':{'type':Sequelize[_0x01f7('0x2')]},'name':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x01f7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x01f7('0x4')]},'markAsUnread':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![],'defaultValue':_0x01f7('0x5')},'fontSize':{'type':Sequelize[_0x01f7('0x6')](0x2)[_0x01f7('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x01f7('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01f7('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x01f7('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![],'comment':_0x01f7('0xa'),'set':function(_0x1f9578){if(!_0x1f9578)this[_0x01f7('0xb')](_0x01f7('0xc'),null);this[_0x01f7('0xb')](_0x01f7('0xd'),_0x1f9578);}},'provider':{'type':Sequelize[_0x01f7('0xe')](_0x01f7('0xf'),_0x01f7('0x10'),'yahoo',_0x01f7('0x11')),'defaultValue':null,'get':function(){if(!this[_0x01f7('0x12')](_0x01f7('0x13')))return _0x01f7('0x14');return this['getDataValue'](_0x01f7('0x13'));},'set':function(_0x4d29c9){if(_0x4d29c9===_0x01f7('0x14'))_0x4d29c9=null;return this['setDataValue']('provider',_0x4d29c9);}}}; \ No newline at end of file +var _0x9f64=['TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x9f64,0x13e));var _0x49f6=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x9f64[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0x49f6('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x49f6('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x49f6('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x49f6('0x2')]},'markAsUnread':{'type':Sequelize[_0x49f6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49f6('0x4')},'fontSize':{'type':Sequelize[_0x49f6('0x5')](0x2)[_0x49f6('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x49f6('0x2')],'defaultValue':function(){return _0x49f6('0x7');}},'notificationSound':{'type':Sequelize[_0x49f6('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x49f6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x49f6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x49f6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x49f6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49f6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49f6('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x49f6('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x49f6('0x3')],'defaultValue':![],'comment':_0x49f6('0x9'),'set':function(_0x314fd9){if(!_0x314fd9)this[_0x49f6('0xa')](_0x49f6('0xb'),null);this[_0x49f6('0xa')](_0x49f6('0xc'),_0x314fd9);}},'provider':{'type':Sequelize[_0x49f6('0xd')](_0x49f6('0xe'),_0x49f6('0xf'),_0x49f6('0x10'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x49f6('0x11')](_0x49f6('0x12')))return _0x49f6('0x13');return this['getDataValue'](_0x49f6('0x12'));},'set':function(_0x4c28fc){if(_0x4c28fc===_0x49f6('0x13'))_0x4c28fc=null;return this[_0x49f6('0xa')]('provider',_0x4c28fc);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 89b7b2e..a14ac73 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 _0x4029=['authentication','user','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','show','mandatoryDispositionPause','rawAttributes','include','options','find','body','provider','params','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','ids','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','getSmtpOptions','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','MailAccounts','stack','name','gmail','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x4029,0x13f));var _0x9402=function(_0x2bfdde,_0x400692){_0x2bfdde=_0x2bfdde-0x0;var _0x38c564=_0x4029[_0x2bfdde];return _0x38c564;};'use strict';var moment=require(_0x9402('0x0'));var BPromise=require('bluebird');var util=require(_0x9402('0x1'));var path=require(_0x9402('0x2'));var _=require(_0x9402('0x3'));var juice=require(_0x9402('0x4'));var Redis=require(_0x9402('0x5'));var qs=require(_0x9402('0x6'));var logger=require(_0x9402('0x7'))(_0x9402('0x8'));var config=require(_0x9402('0x9'));var db=require('../../mysqldb')['db'];config[_0x9402('0xa')]=_[_0x9402('0xb')](config[_0x9402('0xa')],{'host':_0x9402('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9402('0xa')]));require(_0x9402('0xd'))[_0x9402('0xe')](socket);var jayson=require(_0x9402('0xf'));var client=jayson[_0x9402('0x10')][_0x9402('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x4a3caf,_0x5a45aa,_0x2091ae,_0x4e82ae){return new BPromise(function(_0x549466,_0xf3f7be){var _0x3b9c88=_0x4e82ae||client;return _0x3b9c88[_0x9402('0x12')](_0x4a3caf,_0x2091ae)[_0x9402('0x13')](function(_0x1586be){logger[_0x9402('0x14')]('MailAccount,\x20%s,\x20%s',_0x5a45aa,_0x9402('0x15'));logger[_0x9402('0x16')](_0x9402('0x17'),_0x5a45aa,_0x9402('0x15'),JSON[_0x9402('0x18')](_0x1586be));if(_0x1586be[_0x9402('0x19')]){if(_0x1586be[_0x9402('0x19')]['code']===0x1f4){logger[_0x9402('0x19')](_0x9402('0x1a'),_0x5a45aa,_0x1586be['error'][_0x9402('0x1b')]);return _0xf3f7be(_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);}logger['error'](_0x9402('0x1a'),_0x5a45aa,_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);return _0x549466(_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);}else{logger[_0x9402('0x14')](_0x9402('0x1a'),_0x5a45aa,'request\x20sent');_0x549466(_0x1586be[_0x9402('0x1c')][_0x9402('0x1b')]);}})[_0x9402('0x1d')](function(_0x120a32){logger[_0x9402('0x19')]('MailAccount,\x20%s,\x20%s',_0x5a45aa,_0x120a32);_0xf3f7be(_0x120a32);});});}function respondWithStatusCode(_0x187764,_0x9101ec){_0x9101ec=_0x9101ec||0xcc;return function(_0x3cf50e){if(_0x3cf50e){return _0x187764[_0x9402('0x1e')](_0x9101ec);}return _0x187764[_0x9402('0x1f')](_0x9101ec)[_0x9402('0x20')]();};}function respondWithResult(_0x307124,_0x177b25){_0x177b25=_0x177b25||0xc8;return function(_0x810bb8){if(_0x810bb8){return _0x307124[_0x9402('0x1f')](_0x177b25)[_0x9402('0x21')](_0x810bb8);}};}function respondWithFilteredResult(_0x118495,_0x3c0366){return function(_0x730a00){if(_0x730a00){var _0x2efb0a=typeof _0x3c0366[_0x9402('0x22')]===_0x9402('0x23')&&typeof _0x3c0366[_0x9402('0x24')]===_0x9402('0x23');var _0x3b4134=_0x730a00[_0x9402('0x25')];var _0xff0bcd=_0x2efb0a?0x0:_0x3c0366[_0x9402('0x22')];var _0x1ad42d=_0x2efb0a?_0x730a00[_0x9402('0x25')]:_0x3c0366[_0x9402('0x22')]+_0x3c0366[_0x9402('0x24')];var _0x1a3c32;if(_0x1ad42d>=_0x3b4134){_0x1ad42d=_0x3b4134;_0x1a3c32=0xc8;}else{_0x1a3c32=0xce;}_0x118495['status'](_0x1a3c32);return _0x118495[_0x9402('0x26')](_0x9402('0x27'),_0xff0bcd+'-'+_0x1ad42d+'/'+_0x3b4134)[_0x9402('0x21')](_0x730a00);}return null;};}function saveUpdates(_0x2bc913){return function(_0x27a4bd){if(_0x27a4bd){return _0x27a4bd['update'](_0x2bc913)[_0x9402('0x13')](function(_0x1b26b8){return _0x1b26b8;});}return null;};}function removeEntity(_0x381a6b){return function(_0x112313){if(_0x112313){return _0x112313[_0x9402('0x28')]()['then'](function(){var _0x4a8dff=_0x112313['get']({'plain':!![]});var _0x9e82b5=_0x9402('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x9e82b5,'resourceId':_0x4a8dff['id']}})[_0x9402('0x13')](function(){return _0x112313;});})[_0x9402('0x13')](function(){_0x381a6b[_0x9402('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb9cd9){return function(_0xb7a692){if(!_0xb7a692){_0xeb9cd9[_0x9402('0x1e')](0x194);}return _0xb7a692;};}function handleError(_0x373a11,_0x5d5dbd){_0x5d5dbd=_0x5d5dbd||0x1f4;return function(_0x298c14){logger[_0x9402('0x19')](_0x298c14[_0x9402('0x2a')]);if(_0x298c14['name']){delete _0x298c14[_0x9402('0x2b')];}_0x373a11[_0x9402('0x1f')](_0x5d5dbd)['send'](_0x298c14);};}function getImapHost(_0x3ad23d){switch(_0x3ad23d){case _0x9402('0x2c'):return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case _0x9402('0x2d'):return _0x9402('0x2e');case'outlook365':return'outlook.office365.com';}throw new Error(_0x9402('0x2f'),_0x3ad23d);}function getSmtpHost(_0x2f1a56){switch(_0x2f1a56){case _0x9402('0x2c'):return _0x9402('0x30');case'yahoo':return _0x9402('0x31');case _0x9402('0x2d'):return'smtp-mail.outlook.com';case'outlook365':return _0x9402('0x32');}throw new Error(_0x9402('0x2f'),_0x2f1a56);}function getAuthenticationOptions(_0x31b1dc,_0xf1b569){var _0x162ff2={};var _0x65d705={};if(_0x31b1dc){_0x162ff2['user']=_0x65d705['user']=_0xf1b569['username'];_0x162ff2['password']=_0x65d705['pass']=_0xf1b569[_0x9402('0x33')];if(_0xf1b569[_0x9402('0x34')]){_0x162ff2[_0x9402('0x34')]=_0x65d705[_0x9402('0x34')]=!![];_0x162ff2[_0x9402('0x35')]=_0x65d705[_0x9402('0x35')]=_0xf1b569[_0x9402('0x35')];_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=null;}else{_0x162ff2[_0x9402('0x35')]=_0x65d705[_0x9402('0x35')]=null;}_0x162ff2[_0x9402('0x37')]=getImapHost(_0x31b1dc);_0x162ff2[_0x9402('0x38')]=0x3e1;_0x65d705[_0x9402('0x37')]=getSmtpHost(_0x31b1dc);_0x65d705[_0x9402('0x38')]=0x24b;_0x65d705[_0x9402('0x39')]=![];_0x162ff2[_0x9402('0x3a')]=_0x65d705[_0x9402('0x3a')]=null;}else{if(_0xf1b569[_0x9402('0x3b')]){_0x162ff2[_0x9402('0x3c')]=_0x65d705[_0x9402('0x3c')]=_0xf1b569['username'];_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=_0xf1b569['password'];}else{_0x162ff2[_0x9402('0x3b')]=_0x65d705[_0x9402('0x3b')]=![];_0x162ff2[_0x9402('0x3c')]=_0x65d705[_0x9402('0x3c')]=null;_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=null;}_0x162ff2['host']=_0xf1b569[_0x9402('0x3d')]['host'];_0x162ff2[_0x9402('0x38')]=_0xf1b569[_0x9402('0x3d')][_0x9402('0x38')];_0x65d705['host']=_0xf1b569['Smtp']['host'];_0x65d705['port']=_0xf1b569[_0x9402('0x3e')][_0x9402('0x38')];}return{'Imap':_0x162ff2,'Smtp':_0x65d705};}exports[_0x9402('0x3f')]=function(_0x21e9ea,_0x47fa44){var _0x4d427f={'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db[_0x9402('0x41')],'as':_0x9402('0x3e')},{'model':db[_0x9402('0x42')],'as':'mandatoryDispositionPause'}]},_0x298e78={},_0x482b27={'count':0x0,'rows':[]};var _0x11782b=_[_0x9402('0x43')](db[_0x9402('0x44')]['rawAttributes'],function(_0x115348){return{'name':_0x115348[_0x9402('0x45')],'type':_0x115348[_0x9402('0x46')][_0x9402('0x47')]};});_0x298e78[_0x9402('0x48')]=_[_0x9402('0x43')](_0x11782b,'name');_0x298e78[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x21e9ea[_0x9402('0x49')]);_0x298e78[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x298e78[_0x9402('0x48')],_0x298e78['query']);_0x4d427f[_0x9402('0x4d')]=_['intersection'](_0x298e78[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x4e')]));_0x4d427f[_0x9402('0x4d')]=_0x4d427f[_0x9402('0x4d')][_0x9402('0x4f')]?_0x4d427f[_0x9402('0x4d')]:_0x298e78[_0x9402('0x48')];if(!_0x21e9ea['query'][_0x9402('0x50')](_0x9402('0x51'))){_0x4d427f[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x24')]);_0x4d427f[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x21e9ea[_0x9402('0x49')]['offset']);}_0x4d427f['order']=qs[_0x9402('0x52')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x52')]);_0x4d427f[_0x9402('0x53')]=qs['filters'](_['pick'](_0x21e9ea[_0x9402('0x49')],_0x298e78[_0x9402('0x4b')]),_0x11782b);if(_0x21e9ea[_0x9402('0x49')][_0x9402('0x54')]){_0x4d427f[_0x9402('0x53')]=_['merge'](_0x4d427f[_0x9402('0x53')],{'$or':_['map'](_0x11782b,function(_0x42f2d6){if(_0x42f2d6[_0x9402('0x46')]!==_0x9402('0x55')){var _0x4c08c7={};_0x4c08c7[_0x42f2d6['name']]={'$like':'%'+_0x21e9ea['query'][_0x9402('0x54')]+'%'};return _0x4c08c7;}})});}_0x4d427f=_[_0x9402('0x56')]({},_0x4d427f,_0x21e9ea['options']);var _0x90575b={'where':_0x4d427f[_0x9402('0x53')]};return db['MailAccount']['count'](_0x90575b)[_0x9402('0x13')](function(_0x403e0e){_0x482b27[_0x9402('0x25')]=_0x403e0e;if(_0x21e9ea[_0x9402('0x49')][_0x9402('0x57')]){_0x4d427f['include']=[{'all':!![]}];}return db[_0x9402('0x44')][_0x9402('0x58')](_0x4d427f);})[_0x9402('0x13')](function(_0x5a0267){_0x482b27[_0x9402('0x59')]=_0x5a0267;return _0x482b27;})[_0x9402('0x13')](respondWithFilteredResult(_0x47fa44,_0x4d427f))['catch'](handleError(_0x47fa44,null));};exports[_0x9402('0x5a')]=function(_0x2806d6,_0x2be544){var _0x4e4b3e={'raw':![],'where':{'id':_0x2806d6['params']['id']},'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x9402('0x42')],'as':_0x9402('0x5b')}]},_0x44ee23={};_0x44ee23['model']=_[_0x9402('0x4a')](db[_0x9402('0x44')][_0x9402('0x5c')]);_0x44ee23[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x2806d6[_0x9402('0x49')]);_0x44ee23[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x44ee23[_0x9402('0x48')],_0x44ee23[_0x9402('0x49')]);_0x4e4b3e[_0x9402('0x4d')]=_['intersection'](_0x44ee23[_0x9402('0x48')],qs['fields'](_0x2806d6[_0x9402('0x49')]['fields']));_0x4e4b3e['attributes']=_0x4e4b3e[_0x9402('0x4d')][_0x9402('0x4f')]?_0x4e4b3e[_0x9402('0x4d')]:_0x44ee23[_0x9402('0x48')];if(_0x2806d6['query']['includeAll']){_0x4e4b3e[_0x9402('0x5d')]=[{'all':!![]}];}_0x4e4b3e=_[_0x9402('0x56')]({},_0x4e4b3e,_0x2806d6[_0x9402('0x5e')]);return db[_0x9402('0x44')][_0x9402('0x5f')](_0x4e4b3e)[_0x9402('0x13')](handleEntityNotFound(_0x2be544,null))[_0x9402('0x13')](respondWithResult(_0x2be544,null))[_0x9402('0x1d')](handleError(_0x2be544,null));};exports['update']=function(_0x10f437,_0xf651f9){if(_0x10f437[_0x9402('0x60')]['id']){delete _0x10f437['body']['id'];}var _0x5c1482=_0x10f437[_0x9402('0x60')][_0x9402('0x61')]==='custom'?null:_0x10f437['body']['provider'];var _0x377632=_0x10f437['body']['Imap']||{};var _0x3c114e=_0x10f437[_0x9402('0x60')]['Smtp']||{};if(_0x5c1482){_0x377632[_0x9402('0x37')]=getImapHost(_0x5c1482);_0x377632['port']=0x3e1;_0x3c114e['host']=getSmtpHost(_0x5c1482);_0x3c114e[_0x9402('0x38')]=0x24b;_0x3c114e[_0x9402('0x39')]=![];}if(_0x3c114e[_0x9402('0x34')]){_0x3c114e[_0x9402('0x39')]=![];}else{_0x3c114e[_0x9402('0x35')]=null;}if(!_0x377632['modernAuthentication'])_0x377632[_0x9402('0x35')]=null;_0x10f437[_0x9402('0x60')]['Imap']=_0x377632;_0x10f437[_0x9402('0x60')][_0x9402('0x3e')]=_0x3c114e;return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x10f437[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db[_0x9402('0x41')],'as':'Smtp'},{'model':db[_0x9402('0x42')],'as':_0x9402('0x5b')}]})[_0x9402('0x13')](handleEntityNotFound(_0xf651f9,null))[_0x9402('0x13')](function(_0x2d0a42){if(!_0x2d0a42)throw new Error('Mail\x20Account\x20not\x20found');if(_0x2d0a42[_0x9402('0x3a')])delete _0x10f437[_0x9402('0x60')][_0x9402('0x3d')];return _0x2d0a42;})[_0x9402('0x13')](saveUpdates(_0x10f437[_0x9402('0x60')],null))['then'](function(_0x24ece3){if(!_0x10f437[_0x9402('0x60')][_0x9402('0x3d')])return _0x24ece3;return db[_0x9402('0x40')]['update'](_0x10f437['body']['Imap'],{'where':{'MailAccountId':_0x24ece3['id']}})['then'](function(){return _0x24ece3;});})[_0x9402('0x13')](function(_0x576bd9){if(!_0x10f437[_0x9402('0x60')][_0x9402('0x3e')])return _0x576bd9;return db[_0x9402('0x41')]['update'](_0x10f437['body'][_0x9402('0x3e')],{'where':{'MailAccountId':_0x576bd9['id']}})['then'](function(){return _0x576bd9;});})[_0x9402('0x13')](respondWithResult(_0xf651f9,null))[_0x9402('0x1d')](handleError(_0xf651f9,null));};exports[_0x9402('0x63')]=function(_0x552b73,_0x2858c6){return db[_0x9402('0x44')][_0x9402('0x63')]()[_0x9402('0x13')](respondWithResult(_0x2858c6,null))[_0x9402('0x1d')](handleError(_0x2858c6,null));};exports['addDisposition']=function(_0x59820f,_0x15a84a){if(_0x59820f[_0x9402('0x60')]['id']){delete _0x59820f['body']['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x59820f[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x15a84a,null))[_0x9402('0x13')](function(_0xb0814a){if(_0xb0814a){_0x59820f[_0x9402('0x60')][_0x9402('0x64')]=_0xb0814a['id'];return db[_0x9402('0x65')][_0x9402('0x66')](_0x59820f[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x15a84a,null))['catch'](handleError(_0x15a84a,null));};exports[_0x9402('0x67')]=function(_0x1f71ff,_0x6b9111){var _0x3db21d={'raw':![],'where':{}};var _0x3940e3={};var _0x2e37be={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x1f71ff['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x6b9111,null))[_0x9402('0x13')](function(_0x37eca3){if(_0x37eca3){_0x3940e3[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x65')][_0x9402('0x5c')]);_0x3940e3[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x1f71ff[_0x9402('0x49')]);_0x3940e3[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x3940e3[_0x9402('0x48')],_0x3940e3['query']);_0x3db21d['attributes']=_[_0x9402('0x4c')](_0x3940e3['model'],qs[_0x9402('0x4e')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x4e')]));_0x3db21d['attributes']=_0x3db21d['attributes'][_0x9402('0x4f')]?_0x3db21d['attributes']:_0x3940e3[_0x9402('0x48')];if(!_0x1f71ff[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x3db21d[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x24')]);_0x3db21d[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x1f71ff[_0x9402('0x49')]['offset']);}_0x3db21d[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x52')]);_0x3db21d[_0x9402('0x53')]=qs['filters'](_['pick'](_0x1f71ff[_0x9402('0x49')],_0x3940e3[_0x9402('0x4b')]));_0x3db21d['where'][_0x9402('0x64')]=_0x37eca3['id'];if(_0x1f71ff[_0x9402('0x49')]['filter']){_0x3db21d['where']=_[_0x9402('0x56')](_0x3db21d[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x3db21d[_0x9402('0x4d')],function(_0xa8fbb1){var _0x481401={};_0x481401[_0xa8fbb1]={'$like':'%'+_0x1f71ff['query'][_0x9402('0x54')]+'%'};return _0x481401;})});}_0x3db21d=_[_0x9402('0x56')]({},_0x3db21d,_0x1f71ff[_0x9402('0x5e')]);return db[_0x9402('0x65')][_0x9402('0x25')]({'where':_0x3db21d[_0x9402('0x53')]})[_0x9402('0x13')](function(_0xb6afad){_0x2e37be[_0x9402('0x25')]=_0xb6afad;if(_0x1f71ff['query'][_0x9402('0x57')]){_0x3db21d[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x65')]['findAll'](_0x3db21d);})[_0x9402('0x13')](function(_0x47ef23){_0x2e37be[_0x9402('0x59')]=_0x47ef23;return _0x2e37be;});}})[_0x9402('0x13')](respondWithFilteredResult(_0x6b9111,_0x3db21d))['catch'](handleError(_0x6b9111,null));};exports[_0x9402('0x6a')]=function(_0x1cf6ef,_0x8c26c4){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x1cf6ef[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x8c26c4,null))[_0x9402('0x13')](function(_0x138453){if(_0x138453){return _0x138453[_0x9402('0x6a')](_0x1cf6ef[_0x9402('0x49')]['ids']);}})[_0x9402('0x13')](respondWithStatusCode(_0x8c26c4,null))[_0x9402('0x1d')](handleError(_0x8c26c4,null));};exports[_0x9402('0x6b')]=function(_0x2785db,_0x141901){if(_0x2785db['body']['id']){delete _0x2785db['body']['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x2785db[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x141901,null))[_0x9402('0x13')](function(_0x183f09){if(_0x183f09){_0x2785db[_0x9402('0x60')][_0x9402('0x64')]=_0x183f09['id'];return db[_0x9402('0x6c')][_0x9402('0x66')](_0x2785db[_0x9402('0x60')]);}})['then'](respondWithResult(_0x141901,null))[_0x9402('0x1d')](handleError(_0x141901,null));};exports[_0x9402('0x6d')]=function(_0x234090,_0x39e4d3){var _0x32e9b0={'raw':![],'where':{}};var _0x13a4cf={};var _0xbc38ef={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x234090[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x39e4d3,null))['then'](function(_0x19ed64){if(_0x19ed64){_0x13a4cf[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x6c')][_0x9402('0x5c')]);_0x13a4cf[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x234090['query']);_0x13a4cf['filters']=_[_0x9402('0x4c')](_0x13a4cf[_0x9402('0x48')],_0x13a4cf[_0x9402('0x49')]);_0x32e9b0[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x13a4cf[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x234090[_0x9402('0x49')][_0x9402('0x4e')]));_0x32e9b0['attributes']=_0x32e9b0[_0x9402('0x4d')][_0x9402('0x4f')]?_0x32e9b0['attributes']:_0x13a4cf['model'];if(!_0x234090['query'][_0x9402('0x50')](_0x9402('0x51'))){_0x32e9b0[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x234090['query'][_0x9402('0x24')]);_0x32e9b0['offset']=qs[_0x9402('0x22')](_0x234090['query'][_0x9402('0x22')]);}_0x32e9b0['order']=qs[_0x9402('0x52')](_0x234090['query']['sort']);_0x32e9b0[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x234090[_0x9402('0x49')],_0x13a4cf[_0x9402('0x4b')]));_0x32e9b0[_0x9402('0x53')][_0x9402('0x64')]=_0x19ed64['id'];if(_0x234090['query'][_0x9402('0x54')]){_0x32e9b0[_0x9402('0x53')]=_['merge'](_0x32e9b0[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x32e9b0[_0x9402('0x4d')],function(_0x1f47ba){var _0x4d2a7b={};_0x4d2a7b[_0x1f47ba]={'$like':'%'+_0x234090[_0x9402('0x49')]['filter']+'%'};return _0x4d2a7b;})});}_0x32e9b0=_[_0x9402('0x56')]({},_0x32e9b0,_0x234090[_0x9402('0x5e')]);return db['CannedAnswer'][_0x9402('0x25')]({'where':_0x32e9b0[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x488804){_0xbc38ef[_0x9402('0x25')]=_0x488804;if(_0x234090[_0x9402('0x49')][_0x9402('0x57')]){_0x32e9b0[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x6c')]['findAll'](_0x32e9b0);})[_0x9402('0x13')](function(_0x1e781e){_0xbc38ef[_0x9402('0x59')]=_0x1e781e;return _0xbc38ef;});}})['then'](respondWithFilteredResult(_0x39e4d3,_0x32e9b0))[_0x9402('0x1d')](handleError(_0x39e4d3,null));};exports['removeAnswers']=function(_0x255e23,_0x38b2d7){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x255e23[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x38b2d7,null))[_0x9402('0x13')](function(_0x373a1d){if(_0x373a1d){return _0x373a1d['removeAnswers'](_0x255e23['query'][_0x9402('0x6f')]);}})[_0x9402('0x13')](respondWithStatusCode(_0x38b2d7,null))[_0x9402('0x1d')](handleError(_0x38b2d7,null));};exports[_0x9402('0x66')]=function(_0xe5981f,_0xd8ac9){var _0xe1993e={'name':_0xe5981f[_0x9402('0x60')][_0x9402('0x2b')],'key':_0xe5981f[_0x9402('0x60')][_0x9402('0x47')],'provider':_0xe5981f['body']['provider']==='custom'?null:_0xe5981f['body']['provider'],'email':_0xe5981f[_0x9402('0x60')]['email'],'ListId':_0xe5981f[_0x9402('0x60')][_0x9402('0x70')],'active':!_['isNil'](_0xe5981f['body'][_0x9402('0x71')])?_0xe5981f[_0x9402('0x60')]['active']:!![],'description':_0xe5981f['body']['description']||null};var _0x45edeb=getAuthenticationOptions(_0xe1993e[_0x9402('0x61')],_0xe5981f[_0x9402('0x60')]);_0xe1993e[_0x9402('0x3d')]=_0x45edeb['Imap'];_0xe1993e[_0x9402('0x3e')]=_0x45edeb[_0x9402('0x3e')];return db[_0x9402('0x44')][_0x9402('0x66')](_0xe1993e,{'include':[{'model':db[_0x9402('0x41')],'as':_0x9402('0x3e')},{'model':db['MailServerIn'],'as':_0x9402('0x3d')}]})['then'](function(_0x3bd1c8){var _0x5274fe=_0xe5981f['user']['get']({'plain':!![]});if(!_0x5274fe)throw new Error(_0x9402('0x72'));if(_0x5274fe['role']===_0x9402('0x3c')){var _0x34fe95=_0x3bd1c8['get']({'plain':!![]});return db[_0x9402('0x73')][_0x9402('0x5f')]({'where':{'name':_0x9402('0x29'),'userProfileId':_0x5274fe[_0x9402('0x74')]},'raw':!![]})[_0x9402('0x13')](function(_0x3d0754){if(_0x3d0754&&_0x3d0754[_0x9402('0x75')]===0x0){return db['UserProfileResource']['create']({'name':_0x34fe95[_0x9402('0x2b')],'resourceId':_0x34fe95['id'],'type':_0x3d0754[_0x9402('0x2b')],'sectionId':_0x3d0754['id']},{})['then'](function(){return _0x3bd1c8;});}else{return _0x3bd1c8;}})[_0x9402('0x1d')](function(_0x29996e){logger[_0x9402('0x19')](_0x9402('0x76'),_0x29996e);throw _0x29996e;});}return _0x3bd1c8;})['then'](respondWithResult(_0xd8ac9,0xc9))[_0x9402('0x1d')](handleError(_0xd8ac9,null));};exports[_0x9402('0x77')]=function(_0x2b4f04,_0xffd4d){return db[_0x9402('0x44')]['findOne']({'where':{'id':_0x2b4f04[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0xffd4d,null))['then'](function(_0x43f494){if(_0x43f494){return _0x43f494['getImap']();}return null;})[_0x9402('0x13')](respondWithResult(_0xffd4d,null))[_0x9402('0x1d')](handleError(_0xffd4d,null));};exports['addImap']=function(_0x3d2ee1,_0x44b5f7){if(_0x3d2ee1[_0x9402('0x60')]['id']){delete _0x3d2ee1[_0x9402('0x60')]['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x3d2ee1['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x44b5f7,null))[_0x9402('0x13')](function(_0x1f0b3d){if(_0x1f0b3d){_0x3d2ee1[_0x9402('0x60')][_0x9402('0x64')]=_0x1f0b3d['id'];return db['MailServerIn']['create'](_0x3d2ee1[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x44b5f7,null))['catch'](handleError(_0x44b5f7,null));};exports[_0x9402('0x78')]=function(_0x42443c,_0x5e15a1){return db[_0x9402('0x44')]['findOne']({'where':{'id':_0x42443c[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x5e15a1,null))[_0x9402('0x13')](function(_0x129bd6){if(_0x129bd6){return _0x129bd6[_0x9402('0x79')](null);}return null;})[_0x9402('0x13')](respondWithStatusCode(_0x5e15a1,null))[_0x9402('0x1d')](handleError(_0x5e15a1,null));};exports[_0x9402('0x7a')]=function(_0x18d0fa,_0x516c92){return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x18d0fa[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x516c92,null))[_0x9402('0x13')](function(_0x2c33a3){if(_0x2c33a3){return _0x2c33a3[_0x9402('0x7a')]();}return null;})[_0x9402('0x13')](respondWithResult(_0x516c92,null))[_0x9402('0x1d')](handleError(_0x516c92,null));};exports['addSmtp']=function(_0x45788a,_0x5a351a){if(_0x45788a['body']['id']){delete _0x45788a['body']['id'];}return db['MailAccount'][_0x9402('0x5f')]({'where':{'id':_0x45788a[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x5a351a,null))[_0x9402('0x13')](function(_0x185275){if(_0x185275){_0x45788a[_0x9402('0x60')][_0x9402('0x64')]=_0x185275['id'];return db['MailServerOut'][_0x9402('0x66')](_0x45788a[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x5a351a,null))[_0x9402('0x1d')](handleError(_0x5a351a,null));};exports[_0x9402('0x7b')]=function(_0x3fef93,_0x69b1c8){return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x3fef93[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x69b1c8,null))[_0x9402('0x13')](function(_0x3fc571){if(_0x3fc571){return _0x3fc571[_0x9402('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x69b1c8,null))[_0x9402('0x1d')](handleError(_0x69b1c8,null));};exports[_0x9402('0x7d')]=function(_0x30a730,_0x31cf2d){return db[_0x9402('0x7e')][_0x9402('0x5f')]({'where':{'id':_0x30a730[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x31cf2d,null))[_0x9402('0x13')](function(_0x2ec7a1){if(_0x2ec7a1){return _0x2ec7a1[_0x9402('0x7d')](_0x30a730['body'][_0x9402('0x6f')],_[_0x9402('0x7f')](_0x30a730['body'],[_0x9402('0x6f'),'id'])||{});}})[_0x9402('0x13')](respondWithResult(_0x31cf2d,null))[_0x9402('0x1d')](handleError(_0x31cf2d,null));};exports['getInteractions']=function(_0x48d582,_0x244219){var _0x22d7ce={'raw':![],'where':{}};var _0x1fb8cd={};var _0x3cac65={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x48d582[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x244219,null))[_0x9402('0x13')](function(_0x39c592){if(_0x39c592){_0x1fb8cd['model']=_[_0x9402('0x4a')](db[_0x9402('0x7e')]['rawAttributes']);_0x1fb8cd[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x48d582[_0x9402('0x49')]);_0x1fb8cd[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x1fb8cd[_0x9402('0x48')],_0x1fb8cd[_0x9402('0x49')]);_0x22d7ce[_0x9402('0x4d')]=_['intersection'](_0x1fb8cd['model'],qs[_0x9402('0x4e')](_0x48d582['query']['fields']));_0x22d7ce[_0x9402('0x4d')]=_0x22d7ce[_0x9402('0x4d')][_0x9402('0x4f')]?_0x22d7ce[_0x9402('0x4d')]:_0x1fb8cd[_0x9402('0x48')];if(!_0x48d582[_0x9402('0x49')]['hasOwnProperty']('nolimit')){_0x22d7ce[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x48d582[_0x9402('0x49')][_0x9402('0x24')]);_0x22d7ce['offset']=qs[_0x9402('0x22')](_0x48d582['query'][_0x9402('0x22')]);}_0x22d7ce[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x48d582[_0x9402('0x49')]['sort']);_0x22d7ce['where']=qs['filters'](_[_0x9402('0x6e')](_0x48d582['query'],_0x1fb8cd[_0x9402('0x4b')]));_0x22d7ce['where'][_0x9402('0x64')]=_0x39c592['id'];if(_0x48d582[_0x9402('0x49')][_0x9402('0x54')]){_0x22d7ce['where']=_[_0x9402('0x56')](_0x22d7ce[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x22d7ce[_0x9402('0x4d')],function(_0x2acd2d){var _0x1185db={};_0x1185db[_0x2acd2d]={'$like':'%'+_0x48d582[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0x1185db;})});}_0x22d7ce=_['merge']({},_0x22d7ce,_0x48d582['options']);return db[_0x9402('0x7e')][_0x9402('0x25')]({'where':_0x22d7ce[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x5de355){_0x3cac65[_0x9402('0x25')]=_0x5de355;if(_0x48d582[_0x9402('0x49')]['includeAll']){_0x22d7ce[_0x9402('0x5d')]=[{'model':db[_0x9402('0x80')],'as':_0x9402('0x81'),'required':![]},{'model':db[_0x9402('0x82')],'as':_0x9402('0x83'),'attributes':[_0x9402('0x2b'),_0x9402('0x84'),_0x9402('0x85')],'required':![]},{'model':db['Tag'],'as':_0x9402('0x86'),'attributes':['id',_0x9402('0x2b'),_0x9402('0x87')],'where':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]?{'id':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]}:undefined,'required':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]?!![]:![]}];}return db[_0x9402('0x7e')][_0x9402('0x58')](_0x22d7ce);})[_0x9402('0x13')](function(_0x35dc53){_0x3cac65[_0x9402('0x59')]=_0x35dc53;return _0x3cac65;});}})[_0x9402('0x13')](respondWithFilteredResult(_0x244219,_0x22d7ce))[_0x9402('0x1d')](handleError(_0x244219,null));};exports[_0x9402('0x89')]=function addApplications(_0x285a67,_0x169259){var _0x155522=_0x285a67[_0x9402('0x62')]['id'];var _0x80f840=_0x285a67['body'];var _0x577e35=0xc8;var _0x72a709=null;return db[_0x9402('0x8a')][_0x9402('0x8b')]({'isolationLevel':db['sequelize'][_0x9402('0x8c')][_0x9402('0x8d')]['READ_COMMITTED']},function(_0x3bf9e3){return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x155522},'transaction':_0x3bf9e3})[_0x9402('0x13')](function(_0x5d2f9d){if(_0x5d2f9d){return db[_0x9402('0x8e')][_0x9402('0x28')]({'where':{'MailAccountId':_0x155522},'transaction':_0x3bf9e3})[_0x9402('0x13')](function(){var _0x4ef87e=_[_0x9402('0x43')](_0x80f840,function(_0x56f47c){_0x56f47c[_0x9402('0x64')]=_0x155522;return _0x56f47c;});return db[_0x9402('0x8e')]['bulkCreate'](_0x4ef87e,{'transaction':_0x3bf9e3});});}else{_0x577e35=0x194;_0x72a709=[];}});})[_0x9402('0x13')](function(){if(_0x577e35!==0x194){return db[_0x9402('0x8e')][_0x9402('0x8f')]({'where':{'MailAccountId':_0x155522},'order':_0x9402('0x90')})[_0x9402('0x13')](function(_0x4ac4e6){_0x72a709=_0x4ac4e6;});}})[_0x9402('0x1d')](function(_0x172511){_0x577e35=0x1f4;logger[_0x9402('0x19')](_0x172511[_0x9402('0x2a')]);if(_0x172511[_0x9402('0x2b')]){delete _0x172511[_0x9402('0x2b')];}_0x72a709=_0x172511;})[_0x9402('0x91')](function(){if(_0x72a709===null){_0x169259[_0x9402('0x1e')](_0x577e35);}else{if(_0x577e35===0x1f4){_0x169259['status'](_0x577e35)[_0x9402('0x92')](_0x72a709);}else{_0x169259[_0x9402('0x1f')](_0x577e35)[_0x9402('0x21')](_0x72a709);}}});};exports[_0x9402('0x93')]=function(_0x2ec874,_0x3f3b37){var _0x35164b={};var _0x11b834={};var _0x1c92d1;var _0x4c47f5;return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x2ec874[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x3f3b37,null))[_0x9402('0x13')](function(_0x341df3){if(_0x341df3){_0x1c92d1=_0x341df3;_0x11b834[_0x9402('0x48')]=_['keys'](db[_0x9402('0x8e')][_0x9402('0x5c')]);_0x11b834[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x2ec874[_0x9402('0x49')]);_0x11b834[_0x9402('0x4b')]=_['intersection'](_0x11b834[_0x9402('0x48')],_0x11b834[_0x9402('0x49')]);_0x35164b[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x11b834[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x2ec874[_0x9402('0x49')][_0x9402('0x4e')]));_0x35164b['attributes']=_0x35164b[_0x9402('0x4d')][_0x9402('0x4f')]?_0x35164b[_0x9402('0x4d')]:_0x11b834[_0x9402('0x48')];_0x35164b[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x2ec874[_0x9402('0x49')][_0x9402('0x52')]);_0x35164b[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x2ec874['query'],_0x11b834[_0x9402('0x4b')]));if(_0x2ec874[_0x9402('0x49')][_0x9402('0x54')]){_0x35164b[_0x9402('0x53')]=_[_0x9402('0x56')](_0x35164b[_0x9402('0x53')],{'$or':_['map'](_0x35164b[_0x9402('0x4d')],function(_0x2ca78){var _0xdbb9e3={};_0xdbb9e3[_0x2ca78]={'$like':'%'+_0x2ec874[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0xdbb9e3;})});}_0x35164b=_[_0x9402('0x56')]({},_0x35164b,_0x2ec874[_0x9402('0x5e')]);return _0x1c92d1[_0x9402('0x93')](_0x35164b);}})[_0x9402('0x13')](function(_0x3d9c87){if(_0x3d9c87){_0x4c47f5=_0x3d9c87[_0x9402('0x4f')];if(!_0x2ec874[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x35164b[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x2ec874[_0x9402('0x49')][_0x9402('0x24')]);_0x35164b['offset']=qs['offset'](_0x2ec874['query'][_0x9402('0x22')]);}return _0x1c92d1['getApplications'](_0x35164b);}})[_0x9402('0x13')](function(_0x4d7baa){if(_0x4d7baa){return _0x4d7baa?{'count':_0x4c47f5,'rows':_0x4d7baa}:null;}})['then'](respondWithResult(_0x3f3b37,null))['catch'](handleError(_0x3f3b37,null));};exports['getMessages']=function(_0x559898,_0xc58c69){var _0x2dc725={'raw':!![],'where':{}};var _0x303dd5={};var _0xca9702={'count':0x0,'rows':[]};return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x559898[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0xc58c69,null))[_0x9402('0x13')](function(_0x14d711){if(_0x14d711){_0x303dd5['model']=_[_0x9402('0x4a')](db[_0x9402('0x94')][_0x9402('0x5c')]);_0x303dd5['query']=_[_0x9402('0x4a')](_0x559898[_0x9402('0x49')]);_0x303dd5['filters']=_[_0x9402('0x4c')](_0x303dd5['model'],_0x303dd5[_0x9402('0x49')]);_0x2dc725[_0x9402('0x4d')]=_['intersection'](_0x303dd5[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x559898['query']['fields']));_0x2dc725[_0x9402('0x4d')]=_0x2dc725[_0x9402('0x4d')][_0x9402('0x4f')]?_0x2dc725[_0x9402('0x4d')]:_0x303dd5[_0x9402('0x48')];if(!_0x559898[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x2dc725[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x559898['query'][_0x9402('0x24')]);_0x2dc725[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x559898[_0x9402('0x49')]['offset']);}_0x2dc725[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x559898['query']['sort']);_0x2dc725['where']=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x559898[_0x9402('0x49')],_0x303dd5[_0x9402('0x4b')]));_0x2dc725['where']['MailAccountId']=_0x14d711['id'];if(_0x559898[_0x9402('0x49')][_0x9402('0x54')]){_0x2dc725[_0x9402('0x53')]=_[_0x9402('0x56')](_0x2dc725[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x2dc725[_0x9402('0x4d')],function(_0x580ea5){var _0x37c0ef={};_0x37c0ef[_0x580ea5]={'$like':'%'+_0x559898[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0x37c0ef;})});}if(_0x559898[_0x9402('0x49')][_0x9402('0x95')]){var _0x22f568=_0x559898[_0x9402('0x49')][_0x9402('0x95')][_0x9402('0x96')](',');var _0x28471f={};_0x28471f[_0x22f568[0x0]]={'$gte':moment(_0x22f568[0x1])[_0x9402('0x97')](_0x9402('0x98'))};_0x2dc725[_0x9402('0x53')]=_['merge'](_0x2dc725[_0x9402('0x53')],_0x28471f);}_0x2dc725=_['merge']({},_0x2dc725,_0x559898['options']);return db[_0x9402('0x94')][_0x9402('0x25')]({'where':_0x2dc725[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x3f6948){_0xca9702[_0x9402('0x25')]=_0x3f6948;if(_0x559898[_0x9402('0x49')][_0x9402('0x57')]){_0x2dc725[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x94')][_0x9402('0x58')](_0x2dc725);})[_0x9402('0x13')](function(_0x3b1fd4){if(_0x559898[_0x9402('0x49')][_0x9402('0x99')]===_0x9402('0x9a')){for(var _0x23eeb4=0x0;_0x23eeb4<_0x3b1fd4[_0x9402('0x4f')];_0x23eeb4++){_0x3b1fd4[_0x23eeb4][_0x9402('0x60')]=juice(_0x3b1fd4[_0x23eeb4][_0x9402('0x60')]);}}_0xca9702[_0x9402('0x59')]=_0x3b1fd4;return _0xca9702;});}})[_0x9402('0x13')](respondWithFilteredResult(_0xc58c69,_0x2dc725))[_0x9402('0x1d')](handleError(_0xc58c69,null));};exports[_0x9402('0x92')]=function(_0x3ba939,_0x11a647){var _0x438ccc,_0x1a640a={},_0x5c2ff7;if(_0x3ba939['body']['to']){_0x5c2ff7=_0x3ba939[_0x9402('0x60')]['to'][_0x9402('0x96')](',')[0x0];}return db[_0x9402('0x44')]['find']({'where':{'id':_0x3ba939[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x9b')],'as':'List','include':[{'model':db[_0x9402('0x80')],'as':_0x9402('0x9c'),'where':{'email':_0x5c2ff7},'limit':0x1,'order':[[_0x9402('0x9d'),_0x9402('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0x9402('0x3e'),'raw':!![],'include':[{'model':db[_0x9402('0x9f')],'as':_0x9402('0x9f'),'raw':!![]}]}]})[_0x9402('0x13')](handleEntityNotFound(_0x11a647,null))[_0x9402('0x13')](function(_0x288d11){if(!_0x288d11)return;_0x438ccc=_0x288d11;if(!_0x288d11[_0x9402('0x3e')])throw new Error(_0x9402('0xa0'));if(_[_0x9402('0xa1')](_0x3ba939[_0x9402('0x60')][_0x9402('0xa2')])){_0x3ba939['body'][_0x9402('0xa2')]=util['format'](_0x9402('0xa3'),_0x288d11['name'],_0x288d11[_0x9402('0xa4')]||_0x288d11[_0x9402('0x3e')][_0x9402('0x3c')]);}if(_0x3ba939[_0x9402('0x60')]['attachments']&&_0x3ba939['body'][_0x9402('0xa5')][_0x9402('0x4f')]){for(var _0x12eac9=0x0;_0x12eac9<_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')]['length'];_0x12eac9+=0x1){_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')][_0x12eac9]={'filename':_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')][_0x12eac9][_0x9402('0x2b')],'path':path[_0x9402('0xa6')](config['root'],_0x9402('0xa7'),_0x3ba939[_0x9402('0x60')]['attachments'][_0x12eac9][_0x9402('0xa8')])};}}var _0x5e0acd=_0x288d11['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x9402('0xa9'),{'account':_0x5e0acd,'message':_0x3ba939[_0x9402('0x60')]});})[_0x9402('0x13')](function(_0x37e55e){if(!_0x37e55e)return;_0x1a640a=_0x37e55e;if(!_0x438ccc['List'])throw new Error(_0x9402('0xaa'));if(_0x438ccc[_0x9402('0xab')][_0x9402('0x9c')][_0x9402('0x4f')])return _0x438ccc[_0x9402('0xab')][_0x9402('0x9c')][0x0];return db[_0x9402('0x80')][_0x9402('0x66')](_['defaults'](_0x3ba939[_0x9402('0x60')],{'firstName':_0x3ba939[_0x9402('0x60')]['to'],'email':_0x3ba939['body']['to'],'phone':_0x3ba939[_0x9402('0x60')]['to'],'ListId':_0x438ccc['ListId']}));})[_0x9402('0x13')](function(_0x2c36f4){if(!_0x2c36f4)return;var _0x1a1b30={'UserId':_0x3ba939['user']['id'],'ContactId':_0x2c36f4['id'],'MailAccountId':_0x438ccc['id'],'inReplyTo':_0x1a640a[_0x9402('0xac')],'to':_0x3ba939[_0x9402('0x60')][_0x9402('0xa2')],'cc':_0x3ba939[_0x9402('0x60')]['cc'],'subject':_0x3ba939[_0x9402('0x60')][_0x9402('0xad')],'attach':_0x3ba939['body'][_0x9402('0xae')],'firstMsgDirection':_0x9402('0xaf'),'lastMsgAt':moment()[_0x9402('0x97')](_0x9402('0x98')),'lastMsgDirection':_0x9402('0xaf'),'Messages':[_['merge'](_0x3ba939['body'],{'messageId':_0x1a640a[_0x9402('0xac')],'sentAt':moment()[_0x9402('0x97')](_0x9402('0x98')),'read':!![],'MailAccountId':_0x438ccc['id'],'UserId':_0x3ba939[_0x9402('0x3c')]['id'],'ContactId':_0x2c36f4['id']})]};if(_0x3ba939['body']['Interaction']){_0x1a1b30=_[_0x9402('0x56')](_0x1a1b30,_0x3ba939['body'][_0x9402('0xb0')]);}return db[_0x9402('0x7e')][_0x9402('0x66')](_0x1a1b30,{'include':[{'model':db[_0x9402('0x94')],'as':_0x9402('0xb1')}]});})[_0x9402('0x13')](respondWithResult(_0x11a647,null))[_0x9402('0x1d')](handleError(_0x11a647,null));};exports['verifySmtp']=function(_0x1257b4,_0x486260){return db['MailAccount'][_0x9402('0x5f')]({'where':{'id':_0x1257b4[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x41')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9402('0x9f'),'raw':!![]}]}]})[_0x9402('0x13')](handleEntityNotFound(_0x486260,null))[_0x9402('0x13')](function(_0xa79a1e){if(!_0xa79a1e['Smtp'])return;var _0x17cefa=_0xa79a1e[_0x9402('0xb2')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x17cefa});})[_0x9402('0x13')](respondWithResult(_0x486260,null))[_0x9402('0x1d')](handleError(_0x486260,null));};exports[_0x9402('0x28')]=function(_0x15a737,_0x223599){return db['MailAccount']['find']({'where':{'id':_0x15a737['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x223599,null))[_0x9402('0x13')](function(_0x3825f0){if(_0x3825f0&&_0x3825f0[_0x9402('0x3a')]){throw new db[(_0x9402('0xb3'))][(_0x9402('0xb4'))](_0x9402('0xb5'));}return _0x3825f0;})[_0x9402('0x13')](removeEntity(_0x223599,null))[_0x9402('0x1d')](handleError(_0x223599,null));};exports[_0x9402('0xb6')]=function(_0x1bd809,_0x240169){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x1bd809[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x240169,null))[_0x9402('0x13')](function(_0x46973b){if(_0x46973b){return _0x46973b['addAgents'](_0x1bd809[_0x9402('0x60')][_0x9402('0x6f')],_[_0x9402('0x7f')](_0x1bd809[_0x9402('0x60')],['ids','id'])||{})[_0x9402('0xb7')](function(_0x114d65){for(var _0x45d966=0x0;_0x45d966<_0x1bd809[_0x9402('0x60')][_0x9402('0x6f')][_0x9402('0x4f')];_0x45d966+=0x1){socket[_0x9402('0xb8')](_0x9402('0xb9'),{'UserId':Number(_0x1bd809['body'][_0x9402('0x6f')][_0x45d966]),'MailAccountId':Number(_0x1bd809[_0x9402('0x62')]['id'])});}return _0x114d65;});}})['then'](respondWithResult(_0x240169,null))[_0x9402('0x1d')](handleError(_0x240169,null));};exports[_0x9402('0xba')]=function(_0x44e64e,_0x28dc96){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x44e64e[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x28dc96,null))['then'](function(_0x5b6a9b){if(_0x5b6a9b){return _0x5b6a9b[_0x9402('0xba')](_0x44e64e['query'][_0x9402('0x6f')])['then'](function(){if(_['isArray'](_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')])){for(var _0x4cdf59=0x0;_0x4cdf59<_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')][_0x9402('0x4f')];_0x4cdf59+=0x1){socket[_0x9402('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')][_0x4cdf59]),'MailAccountId':Number(_0x44e64e['params']['id'])});}}else{socket['emit'](_0x9402('0xbb'),{'UserId':Number(_0x44e64e['query'][_0x9402('0x6f')]),'MailAccountId':Number(_0x44e64e[_0x9402('0x62')]['id'])});}});}})[_0x9402('0x13')](respondWithStatusCode(_0x28dc96,null))['catch'](handleError(_0x28dc96,null));};exports[_0x9402('0xbc')]=function(_0x3d4beb,_0x5ac8bc){var _0x395b67={};var _0x466477={};var _0x12508d;var _0x1c1988;return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x3d4beb[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x5ac8bc,null))[_0x9402('0x13')](function(_0x411eed){if(_0x411eed){_0x12508d=_0x411eed;_0x466477[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x82')]['rawAttributes']);_0x466477['query']=_['keys'](_0x3d4beb['query']);_0x466477[_0x9402('0x4b')]=_['intersection'](_0x466477[_0x9402('0x48')],_0x466477['query']);_0x395b67[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x466477[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x4e')]));_0x395b67[_0x9402('0x4d')]=_0x395b67['attributes'][_0x9402('0x4f')]?_0x395b67[_0x9402('0x4d')]:_0x466477['model'];_0x395b67[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x52')]);_0x395b67[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x3d4beb[_0x9402('0x49')],_0x466477[_0x9402('0x4b')]));if(_0x3d4beb[_0x9402('0x49')][_0x9402('0x54')]){_0x395b67['where']=_[_0x9402('0x56')](_0x395b67[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x395b67[_0x9402('0x4d')],function(_0x433209){var _0x1ad8ce={};_0x1ad8ce[_0x433209]={'$like':'%'+_0x3d4beb[_0x9402('0x49')]['filter']+'%'};return _0x1ad8ce;})});}_0x395b67=_[_0x9402('0x56')]({},_0x395b67,_0x3d4beb[_0x9402('0x5e')]);return _0x12508d[_0x9402('0xbc')](_0x395b67);}})[_0x9402('0x13')](function(_0x1b6987){if(_0x1b6987){_0x1c1988=_0x1b6987[_0x9402('0x4f')];if(!_0x3d4beb['query']['hasOwnProperty'](_0x9402('0x51'))){_0x395b67[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x3d4beb[_0x9402('0x49')]['limit']);_0x395b67[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x22')]);}return _0x12508d['getAgents'](_0x395b67);}})['then'](function(_0x6b51cc){if(_0x6b51cc){return _0x6b51cc?{'count':_0x1c1988,'rows':_0x6b51cc}:null;}})[_0x9402('0x13')](respondWithResult(_0x5ac8bc,null))['catch'](handleError(_0x5ac8bc,null));}; \ No newline at end of file +var _0x9db4=['query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','MailServerIn','mandatoryDispositionPause','intersection','find','body','custom','provider','secure','params','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','attach','out','messageId','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','end','status','offset','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','outlook365','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','username','Imap','index','MailServerOut','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x165a80,_0x5a4b87){var _0x391342=function(_0x6f5853){while(--_0x6f5853){_0x165a80['push'](_0x165a80['shift']());}};_0x391342(++_0x5a4b87);}(_0x9db4,0x1e7));var _0x49db=function(_0x3804d3,_0x44f5ce){_0x3804d3=_0x3804d3-0x0;var _0x12cf35=_0x9db4[_0x3804d3];return _0x12cf35;};'use strict';var moment=require(_0x49db('0x0'));var BPromise=require(_0x49db('0x1'));var util=require(_0x49db('0x2'));var path=require(_0x49db('0x3'));var _=require('lodash');var juice=require('juice');var Redis=require(_0x49db('0x4'));var qs=require(_0x49db('0x5'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x49db('0x6'))['db'];config[_0x49db('0x7')]=_[_0x49db('0x8')](config[_0x49db('0x7')],{'host':_0x49db('0x9'),'port':0x18eb});var socket=require(_0x49db('0xa'))(new Redis(config[_0x49db('0x7')]));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x49db('0xb')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3e047e,_0x78aa3f,_0x7dfcda,_0x2f1163){return new BPromise(function(_0x612011,_0x93d799){var _0x469ae0=_0x2f1163||client;return _0x469ae0[_0x49db('0xc')](_0x3e047e,_0x7dfcda)[_0x49db('0xd')](function(_0x4e964d){logger[_0x49db('0xe')](_0x49db('0xf'),_0x78aa3f,'request\x20sent');logger[_0x49db('0x10')](_0x49db('0x11'),_0x78aa3f,_0x49db('0x12'),JSON[_0x49db('0x13')](_0x4e964d));if(_0x4e964d['error']){if(_0x4e964d[_0x49db('0x14')][_0x49db('0x15')]===0x1f4){logger[_0x49db('0x14')](_0x49db('0xf'),_0x78aa3f,_0x4e964d[_0x49db('0x14')][_0x49db('0x16')]);return _0x93d799(_0x4e964d[_0x49db('0x14')]['message']);}logger[_0x49db('0x14')](_0x49db('0xf'),_0x78aa3f,_0x4e964d[_0x49db('0x14')]['message']);return _0x612011(_0x4e964d[_0x49db('0x14')][_0x49db('0x16')]);}else{logger['info'](_0x49db('0xf'),_0x78aa3f,_0x49db('0x12'));_0x612011(_0x4e964d['result'][_0x49db('0x16')]);}})[_0x49db('0x17')](function(_0x364ed7){logger[_0x49db('0x14')](_0x49db('0xf'),_0x78aa3f,_0x364ed7);_0x93d799(_0x364ed7);});});}function respondWithStatusCode(_0x4af553,_0x3e2a66){_0x3e2a66=_0x3e2a66||0xcc;return function(_0x290b50){if(_0x290b50){return _0x4af553['sendStatus'](_0x3e2a66);}return _0x4af553['status'](_0x3e2a66)[_0x49db('0x18')]();};}function respondWithResult(_0x2b1d43,_0x37f9ab){_0x37f9ab=_0x37f9ab||0xc8;return function(_0x4f97f0){if(_0x4f97f0){return _0x2b1d43[_0x49db('0x19')](_0x37f9ab)['json'](_0x4f97f0);}};}function respondWithFilteredResult(_0xebf746,_0x5d4362){return function(_0x403359){if(_0x403359){var _0x5ca61d=typeof _0x5d4362[_0x49db('0x1a')]===_0x49db('0x1b')&&typeof _0x5d4362['limit']===_0x49db('0x1b');var _0x5edb3b=_0x403359[_0x49db('0x1c')];var _0x29aa2b=_0x5ca61d?0x0:_0x5d4362[_0x49db('0x1a')];var _0x3ffd73=_0x5ca61d?_0x403359['count']:_0x5d4362[_0x49db('0x1a')]+_0x5d4362['limit'];var _0x3e176f;if(_0x3ffd73>=_0x5edb3b){_0x3ffd73=_0x5edb3b;_0x3e176f=0xc8;}else{_0x3e176f=0xce;}_0xebf746[_0x49db('0x19')](_0x3e176f);return _0xebf746[_0x49db('0x1d')](_0x49db('0x1e'),_0x29aa2b+'-'+_0x3ffd73+'/'+_0x5edb3b)['json'](_0x403359);}return null;};}function saveUpdates(_0x4d9c35){return function(_0x206643){if(_0x206643){return _0x206643[_0x49db('0x1f')](_0x4d9c35)['then'](function(_0x1b22f6){return _0x1b22f6;});}return null;};}function removeEntity(_0x54f658){return function(_0xe88639){if(_0xe88639){return _0xe88639[_0x49db('0x20')]()['then'](function(){var _0x231e65=_0xe88639[_0x49db('0x21')]({'plain':!![]});var _0x55c126=_0x49db('0x22');return db[_0x49db('0x23')]['destroy']({'where':{'type':_0x55c126,'resourceId':_0x231e65['id']}})[_0x49db('0xd')](function(){return _0xe88639;});})[_0x49db('0xd')](function(){_0x54f658['status'](0xcc)[_0x49db('0x18')]();});}};}function handleEntityNotFound(_0x59864c){return function(_0x15a52b){if(!_0x15a52b){_0x59864c[_0x49db('0x24')](0x194);}return _0x15a52b;};}function handleError(_0x4288a4,_0x237136){_0x237136=_0x237136||0x1f4;return function(_0x589439){logger[_0x49db('0x14')](_0x589439[_0x49db('0x25')]);if(_0x589439[_0x49db('0x26')]){delete _0x589439[_0x49db('0x26')];}_0x4288a4['status'](_0x237136)[_0x49db('0x27')](_0x589439);};}function getImapHost(_0x351b9a){switch(_0x351b9a){case _0x49db('0x28'):return _0x49db('0x29');case _0x49db('0x2a'):return _0x49db('0x2b');case _0x49db('0x2c'):return _0x49db('0x2d');case'outlook365':return _0x49db('0x2e');}throw new Error('Unknown\x20email\x20service\x20provider',_0x351b9a);}function getSmtpHost(_0xa71da5){switch(_0xa71da5){case _0x49db('0x28'):return _0x49db('0x2f');case _0x49db('0x2a'):return _0x49db('0x30');case _0x49db('0x2c'):return'smtp-mail.outlook.com';case _0x49db('0x31'):return _0x49db('0x32');}throw new Error('Unknown\x20email\x20service\x20provider',_0xa71da5);}function getAuthenticationOptions(_0x2311bb,_0xc0ee43){var _0x54947c={};var _0x3126bb={};if(_0x2311bb){_0x54947c[_0x49db('0x33')]=_0x3126bb[_0x49db('0x33')]=_0xc0ee43['username'];_0x54947c[_0x49db('0x34')]=_0x3126bb[_0x49db('0x35')]=_0xc0ee43[_0x49db('0x34')];if(_0xc0ee43[_0x49db('0x36')]){_0x54947c[_0x49db('0x36')]=_0x3126bb[_0x49db('0x36')]=!![];_0x54947c[_0x49db('0x37')]=_0x3126bb[_0x49db('0x37')]=_0xc0ee43[_0x49db('0x37')];_0x54947c['password']=_0x3126bb[_0x49db('0x35')]=null;}else{_0x54947c['CloudProviderId']=_0x3126bb[_0x49db('0x37')]=null;}_0x54947c[_0x49db('0x38')]=getImapHost(_0x2311bb);_0x54947c[_0x49db('0x39')]=0x3e1;_0x3126bb[_0x49db('0x38')]=getSmtpHost(_0x2311bb);_0x3126bb['port']=0x24b;_0x3126bb['secure']=![];_0x54947c['service']=_0x3126bb[_0x49db('0x3a')]=null;}else{if(_0xc0ee43[_0x49db('0x3b')]){_0x54947c[_0x49db('0x33')]=_0x3126bb['user']=_0xc0ee43[_0x49db('0x3c')];_0x54947c[_0x49db('0x34')]=_0x3126bb['pass']=_0xc0ee43[_0x49db('0x34')];}else{_0x54947c[_0x49db('0x3b')]=_0x3126bb[_0x49db('0x3b')]=![];_0x54947c['user']=_0x3126bb[_0x49db('0x33')]=null;_0x54947c[_0x49db('0x34')]=_0x3126bb['pass']=null;}_0x54947c[_0x49db('0x38')]=_0xc0ee43['Imap'][_0x49db('0x38')];_0x54947c['port']=_0xc0ee43[_0x49db('0x3d')][_0x49db('0x39')];_0x3126bb[_0x49db('0x38')]=_0xc0ee43['Smtp'][_0x49db('0x38')];_0x3126bb[_0x49db('0x39')]=_0xc0ee43['Smtp'][_0x49db('0x39')];}return{'Imap':_0x54947c,'Smtp':_0x3126bb};}exports[_0x49db('0x3e')]=function(_0x259e25,_0x1fa268){var _0x4ffdcd={'include':[{'model':db['MailServerIn'],'as':_0x49db('0x3d')},{'model':db[_0x49db('0x3f')],'as':_0x49db('0x40')},{'model':db[_0x49db('0x41')],'as':'mandatoryDispositionPause'}]},_0x8cb6e1={},_0x79f3df={'count':0x0,'rows':[]};var _0x23e3be=_[_0x49db('0x42')](db[_0x49db('0x43')][_0x49db('0x44')],function(_0x3801fe){return{'name':_0x3801fe[_0x49db('0x45')],'type':_0x3801fe[_0x49db('0x46')][_0x49db('0x47')]};});_0x8cb6e1[_0x49db('0x48')]=_[_0x49db('0x42')](_0x23e3be,'name');_0x8cb6e1['query']=_[_0x49db('0x49')](_0x259e25[_0x49db('0x4a')]);_0x8cb6e1['filters']=_['intersection'](_0x8cb6e1['model'],_0x8cb6e1['query']);_0x4ffdcd[_0x49db('0x4b')]=_['intersection'](_0x8cb6e1[_0x49db('0x48')],qs[_0x49db('0x4c')](_0x259e25[_0x49db('0x4a')][_0x49db('0x4c')]));_0x4ffdcd[_0x49db('0x4b')]=_0x4ffdcd[_0x49db('0x4b')][_0x49db('0x4d')]?_0x4ffdcd[_0x49db('0x4b')]:_0x8cb6e1[_0x49db('0x48')];if(!_0x259e25[_0x49db('0x4a')][_0x49db('0x4e')](_0x49db('0x4f'))){_0x4ffdcd[_0x49db('0x50')]=qs[_0x49db('0x50')](_0x259e25[_0x49db('0x4a')][_0x49db('0x50')]);_0x4ffdcd[_0x49db('0x1a')]=qs['offset'](_0x259e25[_0x49db('0x4a')][_0x49db('0x1a')]);}_0x4ffdcd[_0x49db('0x51')]=qs['sort'](_0x259e25[_0x49db('0x4a')][_0x49db('0x52')]);_0x4ffdcd[_0x49db('0x53')]=qs[_0x49db('0x54')](_[_0x49db('0x55')](_0x259e25[_0x49db('0x4a')],_0x8cb6e1['filters']),_0x23e3be);if(_0x259e25['query'][_0x49db('0x56')]){_0x4ffdcd[_0x49db('0x53')]=_[_0x49db('0x57')](_0x4ffdcd[_0x49db('0x53')],{'$or':_['map'](_0x23e3be,function(_0x2b97a0){if(_0x2b97a0['type']!==_0x49db('0x58')){var _0x236525={};_0x236525[_0x2b97a0['name']]={'$like':'%'+_0x259e25[_0x49db('0x4a')][_0x49db('0x56')]+'%'};return _0x236525;}})});}_0x4ffdcd=_[_0x49db('0x57')]({},_0x4ffdcd,_0x259e25[_0x49db('0x59')]);var _0x524f7b={'where':_0x4ffdcd[_0x49db('0x53')]};return db[_0x49db('0x43')]['count'](_0x524f7b)[_0x49db('0xd')](function(_0x677ec1){_0x79f3df['count']=_0x677ec1;if(_0x259e25['query'][_0x49db('0x5a')]){_0x4ffdcd[_0x49db('0x5b')]=[{'all':!![]}];}return db[_0x49db('0x43')][_0x49db('0x5c')](_0x4ffdcd);})['then'](function(_0x2f4a50){_0x79f3df[_0x49db('0x5d')]=_0x2f4a50;return _0x79f3df;})[_0x49db('0xd')](respondWithFilteredResult(_0x1fa268,_0x4ffdcd))['catch'](handleError(_0x1fa268,null));};exports[_0x49db('0x5e')]=function(_0x216108,_0x4cf1c9){var _0x1e2e01={'raw':![],'where':{'id':_0x216108['params']['id']},'include':[{'model':db[_0x49db('0x5f')],'as':_0x49db('0x3d')},{'model':db[_0x49db('0x3f')],'as':_0x49db('0x40')},{'model':db[_0x49db('0x41')],'as':_0x49db('0x60')}]},_0x3df2fe={};_0x3df2fe[_0x49db('0x48')]=_[_0x49db('0x49')](db[_0x49db('0x43')][_0x49db('0x44')]);_0x3df2fe[_0x49db('0x4a')]=_[_0x49db('0x49')](_0x216108[_0x49db('0x4a')]);_0x3df2fe[_0x49db('0x54')]=_['intersection'](_0x3df2fe[_0x49db('0x48')],_0x3df2fe['query']);_0x1e2e01['attributes']=_[_0x49db('0x61')](_0x3df2fe['model'],qs[_0x49db('0x4c')](_0x216108[_0x49db('0x4a')][_0x49db('0x4c')]));_0x1e2e01[_0x49db('0x4b')]=_0x1e2e01[_0x49db('0x4b')]['length']?_0x1e2e01[_0x49db('0x4b')]:_0x3df2fe[_0x49db('0x48')];if(_0x216108[_0x49db('0x4a')]['includeAll']){_0x1e2e01[_0x49db('0x5b')]=[{'all':!![]}];}_0x1e2e01=_[_0x49db('0x57')]({},_0x1e2e01,_0x216108[_0x49db('0x59')]);return db['MailAccount'][_0x49db('0x62')](_0x1e2e01)[_0x49db('0xd')](handleEntityNotFound(_0x4cf1c9,null))[_0x49db('0xd')](respondWithResult(_0x4cf1c9,null))['catch'](handleError(_0x4cf1c9,null));};exports['update']=function(_0x392568,_0x8b53aa){if(_0x392568['body']['id']){delete _0x392568[_0x49db('0x63')]['id'];}var _0x192b4e=_0x392568['body']['provider']===_0x49db('0x64')?null:_0x392568[_0x49db('0x63')][_0x49db('0x65')];var _0x49dc33=_0x392568[_0x49db('0x63')][_0x49db('0x3d')]||{};var _0x2e0981=_0x392568[_0x49db('0x63')]['Smtp']||{};if(_0x192b4e){_0x49dc33[_0x49db('0x38')]=getImapHost(_0x192b4e);_0x49dc33[_0x49db('0x39')]=0x3e1;_0x2e0981['host']=getSmtpHost(_0x192b4e);_0x2e0981[_0x49db('0x39')]=0x24b;_0x2e0981[_0x49db('0x66')]=![];}if(_0x2e0981[_0x49db('0x36')]){_0x2e0981[_0x49db('0x66')]=![];}else{_0x2e0981[_0x49db('0x37')]=null;}if(!_0x49dc33[_0x49db('0x36')])_0x49dc33[_0x49db('0x37')]=null;_0x392568['body'][_0x49db('0x3d')]=_0x49dc33;_0x392568[_0x49db('0x63')]['Smtp']=_0x2e0981;return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x392568[_0x49db('0x67')]['id']},'include':[{'model':db[_0x49db('0x5f')],'as':_0x49db('0x3d')},{'model':db[_0x49db('0x3f')],'as':'Smtp'},{'model':db['Pause'],'as':_0x49db('0x60')}]})[_0x49db('0xd')](handleEntityNotFound(_0x8b53aa,null))[_0x49db('0xd')](function(_0x30efa5){if(!_0x30efa5)throw new Error(_0x49db('0x68'));if(_0x30efa5[_0x49db('0x3a')])delete _0x392568['body'][_0x49db('0x3d')];return _0x30efa5;})[_0x49db('0xd')](saveUpdates(_0x392568['body'],null))['then'](function(_0x329ef4){if(!_0x392568[_0x49db('0x63')][_0x49db('0x3d')])return _0x329ef4;return db[_0x49db('0x5f')]['update'](_0x392568[_0x49db('0x63')][_0x49db('0x3d')],{'where':{'MailAccountId':_0x329ef4['id']}})['then'](function(){return _0x329ef4;});})[_0x49db('0xd')](function(_0xd0d634){if(!_0x392568[_0x49db('0x63')][_0x49db('0x40')])return _0xd0d634;return db[_0x49db('0x3f')][_0x49db('0x1f')](_0x392568['body'][_0x49db('0x40')],{'where':{'MailAccountId':_0xd0d634['id']}})['then'](function(){return _0xd0d634;});})[_0x49db('0xd')](respondWithResult(_0x8b53aa,null))['catch'](handleError(_0x8b53aa,null));};exports[_0x49db('0x69')]=function(_0x82d538,_0xfa1c36){return db[_0x49db('0x43')]['describe']()[_0x49db('0xd')](respondWithResult(_0xfa1c36,null))[_0x49db('0x17')](handleError(_0xfa1c36,null));};exports[_0x49db('0x6a')]=function(_0x64a211,_0xa0bfa4){if(_0x64a211[_0x49db('0x63')]['id']){delete _0x64a211[_0x49db('0x63')]['id'];}return db['MailAccount'][_0x49db('0x62')]({'where':{'id':_0x64a211[_0x49db('0x67')]['id']}})['then'](handleEntityNotFound(_0xa0bfa4,null))[_0x49db('0xd')](function(_0x10f170){if(_0x10f170){_0x64a211[_0x49db('0x63')]['MailAccountId']=_0x10f170['id'];return db['Disposition'][_0x49db('0x6b')](_0x64a211['body']);}})[_0x49db('0xd')](respondWithResult(_0xa0bfa4,null))[_0x49db('0x17')](handleError(_0xa0bfa4,null));};exports[_0x49db('0x6c')]=function(_0xccc269,_0x5c736c){var _0x5bd85f={'raw':![],'where':{}};var _0x57a7d4={};var _0xb5b59={'count':0x0,'rows':[]};return db['MailAccount'][_0x49db('0x6d')]({'where':{'id':_0xccc269[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x5c736c,null))[_0x49db('0xd')](function(_0x3131e3){if(_0x3131e3){_0x57a7d4[_0x49db('0x48')]=_[_0x49db('0x49')](db[_0x49db('0x6e')][_0x49db('0x44')]);_0x57a7d4[_0x49db('0x4a')]=_[_0x49db('0x49')](_0xccc269[_0x49db('0x4a')]);_0x57a7d4['filters']=_[_0x49db('0x61')](_0x57a7d4[_0x49db('0x48')],_0x57a7d4[_0x49db('0x4a')]);_0x5bd85f[_0x49db('0x4b')]=_[_0x49db('0x61')](_0x57a7d4[_0x49db('0x48')],qs['fields'](_0xccc269[_0x49db('0x4a')][_0x49db('0x4c')]));_0x5bd85f[_0x49db('0x4b')]=_0x5bd85f[_0x49db('0x4b')]['length']?_0x5bd85f[_0x49db('0x4b')]:_0x57a7d4['model'];if(!_0xccc269['query'][_0x49db('0x4e')](_0x49db('0x4f'))){_0x5bd85f[_0x49db('0x50')]=qs[_0x49db('0x50')](_0xccc269['query'][_0x49db('0x50')]);_0x5bd85f[_0x49db('0x1a')]=qs[_0x49db('0x1a')](_0xccc269[_0x49db('0x4a')][_0x49db('0x1a')]);}_0x5bd85f[_0x49db('0x51')]=qs['sort'](_0xccc269[_0x49db('0x4a')]['sort']);_0x5bd85f['where']=qs[_0x49db('0x54')](_[_0x49db('0x55')](_0xccc269[_0x49db('0x4a')],_0x57a7d4[_0x49db('0x54')]));_0x5bd85f[_0x49db('0x53')]['MailAccountId']=_0x3131e3['id'];if(_0xccc269[_0x49db('0x4a')][_0x49db('0x56')]){_0x5bd85f['where']=_[_0x49db('0x57')](_0x5bd85f[_0x49db('0x53')],{'$or':_[_0x49db('0x42')](_0x5bd85f[_0x49db('0x4b')],function(_0x2f05eb){var _0x30a948={};_0x30a948[_0x2f05eb]={'$like':'%'+_0xccc269[_0x49db('0x4a')][_0x49db('0x56')]+'%'};return _0x30a948;})});}_0x5bd85f=_['merge']({},_0x5bd85f,_0xccc269[_0x49db('0x59')]);return db['Disposition'][_0x49db('0x1c')]({'where':_0x5bd85f[_0x49db('0x53')]})['then'](function(_0x580e47){_0xb5b59[_0x49db('0x1c')]=_0x580e47;if(_0xccc269[_0x49db('0x4a')]['includeAll']){_0x5bd85f[_0x49db('0x5b')]=[{'all':!![]}];}return db[_0x49db('0x6e')][_0x49db('0x5c')](_0x5bd85f);})[_0x49db('0xd')](function(_0x929fc3){_0xb5b59['rows']=_0x929fc3;return _0xb5b59;});}})[_0x49db('0xd')](respondWithFilteredResult(_0x5c736c,_0x5bd85f))[_0x49db('0x17')](handleError(_0x5c736c,null));};exports[_0x49db('0x6f')]=function(_0x20e13f,_0x5a4c53){return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x20e13f[_0x49db('0x67')]['id']}})['then'](handleEntityNotFound(_0x5a4c53,null))[_0x49db('0xd')](function(_0xf1ece2){if(_0xf1ece2){return _0xf1ece2[_0x49db('0x6f')](_0x20e13f['query'][_0x49db('0x70')]);}})[_0x49db('0xd')](respondWithStatusCode(_0x5a4c53,null))[_0x49db('0x17')](handleError(_0x5a4c53,null));};exports[_0x49db('0x71')]=function(_0xc9f641,_0x756a28){if(_0xc9f641['body']['id']){delete _0xc9f641['body']['id'];}return db[_0x49db('0x43')]['find']({'where':{'id':_0xc9f641[_0x49db('0x67')]['id']}})['then'](handleEntityNotFound(_0x756a28,null))[_0x49db('0xd')](function(_0x5b3a52){if(_0x5b3a52){_0xc9f641['body'][_0x49db('0x72')]=_0x5b3a52['id'];return db[_0x49db('0x73')][_0x49db('0x6b')](_0xc9f641[_0x49db('0x63')]);}})[_0x49db('0xd')](respondWithResult(_0x756a28,null))[_0x49db('0x17')](handleError(_0x756a28,null));};exports['getAnswers']=function(_0x368bc9,_0x57b61c){var _0x192e59={'raw':![],'where':{}};var _0x43e2da={};var _0x57ac8c={'count':0x0,'rows':[]};return db[_0x49db('0x43')][_0x49db('0x6d')]({'where':{'id':_0x368bc9[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x57b61c,null))[_0x49db('0xd')](function(_0x1148cc){if(_0x1148cc){_0x43e2da[_0x49db('0x48')]=_[_0x49db('0x49')](db['CannedAnswer']['rawAttributes']);_0x43e2da['query']=_[_0x49db('0x49')](_0x368bc9['query']);_0x43e2da[_0x49db('0x54')]=_['intersection'](_0x43e2da[_0x49db('0x48')],_0x43e2da[_0x49db('0x4a')]);_0x192e59[_0x49db('0x4b')]=_['intersection'](_0x43e2da[_0x49db('0x48')],qs[_0x49db('0x4c')](_0x368bc9[_0x49db('0x4a')][_0x49db('0x4c')]));_0x192e59[_0x49db('0x4b')]=_0x192e59[_0x49db('0x4b')][_0x49db('0x4d')]?_0x192e59[_0x49db('0x4b')]:_0x43e2da[_0x49db('0x48')];if(!_0x368bc9[_0x49db('0x4a')][_0x49db('0x4e')]('nolimit')){_0x192e59[_0x49db('0x50')]=qs[_0x49db('0x50')](_0x368bc9[_0x49db('0x4a')]['limit']);_0x192e59[_0x49db('0x1a')]=qs[_0x49db('0x1a')](_0x368bc9[_0x49db('0x4a')][_0x49db('0x1a')]);}_0x192e59['order']=qs[_0x49db('0x52')](_0x368bc9[_0x49db('0x4a')][_0x49db('0x52')]);_0x192e59[_0x49db('0x53')]=qs['filters'](_[_0x49db('0x55')](_0x368bc9['query'],_0x43e2da['filters']));_0x192e59[_0x49db('0x53')][_0x49db('0x72')]=_0x1148cc['id'];if(_0x368bc9[_0x49db('0x4a')]['filter']){_0x192e59[_0x49db('0x53')]=_['merge'](_0x192e59['where'],{'$or':_[_0x49db('0x42')](_0x192e59[_0x49db('0x4b')],function(_0x413396){var _0x1f2914={};_0x1f2914[_0x413396]={'$like':'%'+_0x368bc9[_0x49db('0x4a')][_0x49db('0x56')]+'%'};return _0x1f2914;})});}_0x192e59=_['merge']({},_0x192e59,_0x368bc9[_0x49db('0x59')]);return db[_0x49db('0x73')][_0x49db('0x1c')]({'where':_0x192e59[_0x49db('0x53')]})[_0x49db('0xd')](function(_0x1555ae){_0x57ac8c[_0x49db('0x1c')]=_0x1555ae;if(_0x368bc9[_0x49db('0x4a')][_0x49db('0x5a')]){_0x192e59['include']=[{'all':!![]}];}return db[_0x49db('0x73')]['findAll'](_0x192e59);})[_0x49db('0xd')](function(_0x27161d){_0x57ac8c[_0x49db('0x5d')]=_0x27161d;return _0x57ac8c;});}})[_0x49db('0xd')](respondWithFilteredResult(_0x57b61c,_0x192e59))['catch'](handleError(_0x57b61c,null));};exports['removeAnswers']=function(_0x2ae8f7,_0x37df7d){return db[_0x49db('0x43')]['find']({'where':{'id':_0x2ae8f7[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x37df7d,null))[_0x49db('0xd')](function(_0x4e777f){if(_0x4e777f){return _0x4e777f['removeAnswers'](_0x2ae8f7['query'][_0x49db('0x70')]);}})[_0x49db('0xd')](respondWithStatusCode(_0x37df7d,null))[_0x49db('0x17')](handleError(_0x37df7d,null));};exports[_0x49db('0x6b')]=function(_0x2a3018,_0x137c02){var _0xf22d3a={'name':_0x2a3018[_0x49db('0x63')][_0x49db('0x26')],'key':_0x2a3018[_0x49db('0x63')]['key'],'provider':_0x2a3018[_0x49db('0x63')]['provider']===_0x49db('0x64')?null:_0x2a3018[_0x49db('0x63')][_0x49db('0x65')],'email':_0x2a3018[_0x49db('0x63')][_0x49db('0x74')],'ListId':_0x2a3018[_0x49db('0x63')][_0x49db('0x75')],'active':!_[_0x49db('0x76')](_0x2a3018[_0x49db('0x63')]['active'])?_0x2a3018[_0x49db('0x63')][_0x49db('0x77')]:!![],'description':_0x2a3018['body'][_0x49db('0x78')]||null};var _0x457c38=getAuthenticationOptions(_0xf22d3a[_0x49db('0x65')],_0x2a3018[_0x49db('0x63')]);_0xf22d3a[_0x49db('0x3d')]=_0x457c38[_0x49db('0x3d')];_0xf22d3a[_0x49db('0x40')]=_0x457c38['Smtp'];return db[_0x49db('0x43')][_0x49db('0x6b')](_0xf22d3a,{'include':[{'model':db[_0x49db('0x3f')],'as':_0x49db('0x40')},{'model':db[_0x49db('0x5f')],'as':_0x49db('0x3d')}]})[_0x49db('0xd')](function(_0x5b3b30){var _0xd6f751=_0x2a3018[_0x49db('0x33')][_0x49db('0x21')]({'plain':!![]});if(!_0xd6f751)throw new Error(_0x49db('0x79'));if(_0xd6f751[_0x49db('0x7a')]===_0x49db('0x33')){var _0x1bace4=_0x5b3b30[_0x49db('0x21')]({'plain':!![]});return db[_0x49db('0x7b')]['find']({'where':{'name':'MailAccounts','userProfileId':_0xd6f751['userProfileId']},'raw':!![]})[_0x49db('0xd')](function(_0x64fcc0){if(_0x64fcc0&&_0x64fcc0['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1bace4[_0x49db('0x26')],'resourceId':_0x1bace4['id'],'type':_0x64fcc0[_0x49db('0x26')],'sectionId':_0x64fcc0['id']},{})['then'](function(){return _0x5b3b30;});}else{return _0x5b3b30;}})[_0x49db('0x17')](function(_0x1b8c42){logger['error'](_0x49db('0x7c'),_0x1b8c42);throw _0x1b8c42;});}return _0x5b3b30;})[_0x49db('0xd')](respondWithResult(_0x137c02,0xc9))[_0x49db('0x17')](handleError(_0x137c02,null));};exports[_0x49db('0x7d')]=function(_0x110790,_0x25f252){return db[_0x49db('0x43')][_0x49db('0x6d')]({'where':{'id':_0x110790['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x25f252,null))[_0x49db('0xd')](function(_0x2d074f){if(_0x2d074f){return _0x2d074f[_0x49db('0x7d')]();}return null;})[_0x49db('0xd')](respondWithResult(_0x25f252,null))[_0x49db('0x17')](handleError(_0x25f252,null));};exports['addImap']=function(_0x853603,_0x43da46){if(_0x853603['body']['id']){delete _0x853603['body']['id'];}return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x853603[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x43da46,null))[_0x49db('0xd')](function(_0x5d9060){if(_0x5d9060){_0x853603[_0x49db('0x63')][_0x49db('0x72')]=_0x5d9060['id'];return db['MailServerIn']['create'](_0x853603[_0x49db('0x63')]);}})['then'](respondWithResult(_0x43da46,null))['catch'](handleError(_0x43da46,null));};exports[_0x49db('0x7e')]=function(_0x1e73ed,_0x86c094){return db['MailAccount']['findOne']({'where':{'id':_0x1e73ed[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x86c094,null))[_0x49db('0xd')](function(_0x2e6265){if(_0x2e6265){return _0x2e6265['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x86c094,null))[_0x49db('0x17')](handleError(_0x86c094,null));};exports[_0x49db('0x7f')]=function(_0x4e49d4,_0x2ede87){return db[_0x49db('0x43')][_0x49db('0x6d')]({'where':{'id':_0x4e49d4['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x2ede87,null))['then'](function(_0x443e9a){if(_0x443e9a){return _0x443e9a['getSmtp']();}return null;})[_0x49db('0xd')](respondWithResult(_0x2ede87,null))[_0x49db('0x17')](handleError(_0x2ede87,null));};exports['addSmtp']=function(_0x390e51,_0x5beb69){if(_0x390e51[_0x49db('0x63')]['id']){delete _0x390e51['body']['id'];}return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x390e51['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x5beb69,null))[_0x49db('0xd')](function(_0x65674d){if(_0x65674d){_0x390e51[_0x49db('0x63')]['MailAccountId']=_0x65674d['id'];return db[_0x49db('0x3f')]['create'](_0x390e51[_0x49db('0x63')]);}})[_0x49db('0xd')](respondWithResult(_0x5beb69,null))[_0x49db('0x17')](handleError(_0x5beb69,null));};exports['removeSmtp']=function(_0x1b1cdb,_0x3a03b6){return db[_0x49db('0x43')]['findOne']({'where':{'id':_0x1b1cdb['params']['id']}})['then'](handleEntityNotFound(_0x3a03b6,null))[_0x49db('0xd')](function(_0x3c2f73){if(_0x3c2f73){return _0x3c2f73[_0x49db('0x80')](null);}return null;})[_0x49db('0xd')](respondWithStatusCode(_0x3a03b6,null))[_0x49db('0x17')](handleError(_0x3a03b6,null));};exports[_0x49db('0x81')]=function(_0x286f81,_0x324edd){return db[_0x49db('0x82')][_0x49db('0x62')]({'where':{'id':_0x286f81[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x324edd,null))['then'](function(_0x17a488){if(_0x17a488){return _0x17a488[_0x49db('0x81')](_0x286f81[_0x49db('0x63')][_0x49db('0x70')],_[_0x49db('0x83')](_0x286f81['body'],['ids','id'])||{});}})[_0x49db('0xd')](respondWithResult(_0x324edd,null))[_0x49db('0x17')](handleError(_0x324edd,null));};exports[_0x49db('0x84')]=function(_0x2b8f81,_0x2746be){var _0xee1db={'raw':![],'where':{}};var _0x1e32ca={};var _0x4cfe17={'count':0x0,'rows':[]};return db[_0x49db('0x43')]['findOne']({'where':{'id':_0x2b8f81['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x2746be,null))[_0x49db('0xd')](function(_0x508041){if(_0x508041){_0x1e32ca[_0x49db('0x48')]=_[_0x49db('0x49')](db['MailInteraction'][_0x49db('0x44')]);_0x1e32ca[_0x49db('0x4a')]=_[_0x49db('0x49')](_0x2b8f81[_0x49db('0x4a')]);_0x1e32ca[_0x49db('0x54')]=_['intersection'](_0x1e32ca['model'],_0x1e32ca[_0x49db('0x4a')]);_0xee1db[_0x49db('0x4b')]=_['intersection'](_0x1e32ca[_0x49db('0x48')],qs[_0x49db('0x4c')](_0x2b8f81['query'][_0x49db('0x4c')]));_0xee1db[_0x49db('0x4b')]=_0xee1db[_0x49db('0x4b')]['length']?_0xee1db[_0x49db('0x4b')]:_0x1e32ca[_0x49db('0x48')];if(!_0x2b8f81[_0x49db('0x4a')]['hasOwnProperty'](_0x49db('0x4f'))){_0xee1db[_0x49db('0x50')]=qs[_0x49db('0x50')](_0x2b8f81[_0x49db('0x4a')]['limit']);_0xee1db[_0x49db('0x1a')]=qs[_0x49db('0x1a')](_0x2b8f81[_0x49db('0x4a')][_0x49db('0x1a')]);}_0xee1db[_0x49db('0x51')]=qs[_0x49db('0x52')](_0x2b8f81['query'][_0x49db('0x52')]);_0xee1db[_0x49db('0x53')]=qs[_0x49db('0x54')](_[_0x49db('0x55')](_0x2b8f81[_0x49db('0x4a')],_0x1e32ca[_0x49db('0x54')]));_0xee1db[_0x49db('0x53')][_0x49db('0x72')]=_0x508041['id'];if(_0x2b8f81[_0x49db('0x4a')]['filter']){_0xee1db['where']=_[_0x49db('0x57')](_0xee1db['where'],{'$or':_['map'](_0xee1db['attributes'],function(_0x17e92f){var _0x52af56={};_0x52af56[_0x17e92f]={'$like':'%'+_0x2b8f81[_0x49db('0x4a')][_0x49db('0x56')]+'%'};return _0x52af56;})});}_0xee1db=_[_0x49db('0x57')]({},_0xee1db,_0x2b8f81[_0x49db('0x59')]);return db['MailInteraction'][_0x49db('0x1c')]({'where':_0xee1db[_0x49db('0x53')]})[_0x49db('0xd')](function(_0x5eb850){_0x4cfe17[_0x49db('0x1c')]=_0x5eb850;if(_0x2b8f81[_0x49db('0x4a')][_0x49db('0x5a')]){_0xee1db[_0x49db('0x5b')]=[{'model':db[_0x49db('0x85')],'as':_0x49db('0x86'),'required':![]},{'model':db[_0x49db('0x87')],'as':_0x49db('0x88'),'attributes':['name','fullname',_0x49db('0x89')],'required':![]},{'model':db[_0x49db('0x8a')],'as':_0x49db('0x8b'),'attributes':['id','name',_0x49db('0x8c')],'where':_0x2b8f81[_0x49db('0x4a')][_0x49db('0x8d')]?{'id':_0x2b8f81[_0x49db('0x4a')][_0x49db('0x8d')]}:undefined,'required':_0x2b8f81[_0x49db('0x4a')][_0x49db('0x8d')]?!![]:![]}];}return db[_0x49db('0x82')][_0x49db('0x5c')](_0xee1db);})[_0x49db('0xd')](function(_0x1ac138){_0x4cfe17[_0x49db('0x5d')]=_0x1ac138;return _0x4cfe17;});}})[_0x49db('0xd')](respondWithFilteredResult(_0x2746be,_0xee1db))[_0x49db('0x17')](handleError(_0x2746be,null));};exports[_0x49db('0x8e')]=function addApplications(_0x366f94,_0xf5e6ac){var _0x39174e=_0x366f94[_0x49db('0x67')]['id'];var _0x20cd93=_0x366f94[_0x49db('0x63')];var _0x18dc62=0xc8;var _0x510646=null;return db['sequelize'][_0x49db('0x8f')]({'isolationLevel':db['sequelize'][_0x49db('0x90')][_0x49db('0x91')][_0x49db('0x92')]},function(_0x4f71fb){return db[_0x49db('0x43')][_0x49db('0x6d')]({'where':{'id':_0x39174e},'transaction':_0x4f71fb})[_0x49db('0xd')](function(_0x36aeaf){if(_0x36aeaf){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x39174e},'transaction':_0x4f71fb})['then'](function(){var _0x3296c8=_[_0x49db('0x42')](_0x20cd93,function(_0x1ad7d8){_0x1ad7d8[_0x49db('0x72')]=_0x39174e;return _0x1ad7d8;});return db[_0x49db('0x93')]['bulkCreate'](_0x3296c8,{'transaction':_0x4f71fb});});}else{_0x18dc62=0x194;_0x510646=[];}});})[_0x49db('0xd')](function(){if(_0x18dc62!==0x194){return db[_0x49db('0x93')][_0x49db('0x94')]({'where':{'MailAccountId':_0x39174e},'order':_0x49db('0x95')})[_0x49db('0xd')](function(_0x11bb10){_0x510646=_0x11bb10;});}})[_0x49db('0x17')](function(_0x33a955){_0x18dc62=0x1f4;logger[_0x49db('0x14')](_0x33a955['stack']);if(_0x33a955[_0x49db('0x26')]){delete _0x33a955[_0x49db('0x26')];}_0x510646=_0x33a955;})[_0x49db('0x96')](function(){if(_0x510646===null){_0xf5e6ac[_0x49db('0x24')](_0x18dc62);}else{if(_0x18dc62===0x1f4){_0xf5e6ac[_0x49db('0x19')](_0x18dc62)[_0x49db('0x27')](_0x510646);}else{_0xf5e6ac[_0x49db('0x19')](_0x18dc62)[_0x49db('0x97')](_0x510646);}}});};exports[_0x49db('0x98')]=function(_0x4182e8,_0xf2b75d){var _0x2a6966={};var _0x4b64e3={};var _0x15c252;var _0x5beb3;return db[_0x49db('0x43')]['findOne']({'where':{'id':_0x4182e8['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0xf2b75d,null))[_0x49db('0xd')](function(_0x3ef6fa){if(_0x3ef6fa){_0x15c252=_0x3ef6fa;_0x4b64e3[_0x49db('0x48')]=_['keys'](db[_0x49db('0x93')][_0x49db('0x44')]);_0x4b64e3[_0x49db('0x4a')]=_['keys'](_0x4182e8[_0x49db('0x4a')]);_0x4b64e3[_0x49db('0x54')]=_[_0x49db('0x61')](_0x4b64e3[_0x49db('0x48')],_0x4b64e3['query']);_0x2a6966[_0x49db('0x4b')]=_[_0x49db('0x61')](_0x4b64e3['model'],qs[_0x49db('0x4c')](_0x4182e8[_0x49db('0x4a')][_0x49db('0x4c')]));_0x2a6966[_0x49db('0x4b')]=_0x2a6966['attributes'][_0x49db('0x4d')]?_0x2a6966[_0x49db('0x4b')]:_0x4b64e3['model'];_0x2a6966[_0x49db('0x51')]=qs['sort'](_0x4182e8[_0x49db('0x4a')][_0x49db('0x52')]);_0x2a6966['where']=qs[_0x49db('0x54')](_[_0x49db('0x55')](_0x4182e8[_0x49db('0x4a')],_0x4b64e3['filters']));if(_0x4182e8[_0x49db('0x4a')][_0x49db('0x56')]){_0x2a6966['where']=_['merge'](_0x2a6966[_0x49db('0x53')],{'$or':_[_0x49db('0x42')](_0x2a6966[_0x49db('0x4b')],function(_0xe35e2){var _0x5a2702={};_0x5a2702[_0xe35e2]={'$like':'%'+_0x4182e8[_0x49db('0x4a')]['filter']+'%'};return _0x5a2702;})});}_0x2a6966=_[_0x49db('0x57')]({},_0x2a6966,_0x4182e8['options']);return _0x15c252['getApplications'](_0x2a6966);}})[_0x49db('0xd')](function(_0x4555e2){if(_0x4555e2){_0x5beb3=_0x4555e2[_0x49db('0x4d')];if(!_0x4182e8[_0x49db('0x4a')]['hasOwnProperty'](_0x49db('0x4f'))){_0x2a6966['limit']=qs['limit'](_0x4182e8[_0x49db('0x4a')][_0x49db('0x50')]);_0x2a6966[_0x49db('0x1a')]=qs[_0x49db('0x1a')](_0x4182e8[_0x49db('0x4a')]['offset']);}return _0x15c252[_0x49db('0x98')](_0x2a6966);}})[_0x49db('0xd')](function(_0x4fc172){if(_0x4fc172){return _0x4fc172?{'count':_0x5beb3,'rows':_0x4fc172}:null;}})[_0x49db('0xd')](respondWithResult(_0xf2b75d,null))[_0x49db('0x17')](handleError(_0xf2b75d,null));};exports[_0x49db('0x99')]=function(_0x1d8a70,_0x369265){var _0x439cde={'raw':!![],'where':{}};var _0x2ddb3a={};var _0x304f16={'count':0x0,'rows':[]};return db['MailAccount'][_0x49db('0x6d')]({'where':{'id':_0x1d8a70['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x369265,null))[_0x49db('0xd')](function(_0x1fdd5c){if(_0x1fdd5c){_0x2ddb3a[_0x49db('0x48')]=_[_0x49db('0x49')](db[_0x49db('0x9a')][_0x49db('0x44')]);_0x2ddb3a[_0x49db('0x4a')]=_[_0x49db('0x49')](_0x1d8a70[_0x49db('0x4a')]);_0x2ddb3a[_0x49db('0x54')]=_[_0x49db('0x61')](_0x2ddb3a[_0x49db('0x48')],_0x2ddb3a[_0x49db('0x4a')]);_0x439cde[_0x49db('0x4b')]=_['intersection'](_0x2ddb3a[_0x49db('0x48')],qs[_0x49db('0x4c')](_0x1d8a70[_0x49db('0x4a')][_0x49db('0x4c')]));_0x439cde[_0x49db('0x4b')]=_0x439cde[_0x49db('0x4b')][_0x49db('0x4d')]?_0x439cde[_0x49db('0x4b')]:_0x2ddb3a['model'];if(!_0x1d8a70[_0x49db('0x4a')][_0x49db('0x4e')](_0x49db('0x4f'))){_0x439cde['limit']=qs['limit'](_0x1d8a70[_0x49db('0x4a')][_0x49db('0x50')]);_0x439cde['offset']=qs[_0x49db('0x1a')](_0x1d8a70[_0x49db('0x4a')]['offset']);}_0x439cde[_0x49db('0x51')]=qs[_0x49db('0x52')](_0x1d8a70[_0x49db('0x4a')]['sort']);_0x439cde['where']=qs[_0x49db('0x54')](_[_0x49db('0x55')](_0x1d8a70[_0x49db('0x4a')],_0x2ddb3a['filters']));_0x439cde[_0x49db('0x53')][_0x49db('0x72')]=_0x1fdd5c['id'];if(_0x1d8a70[_0x49db('0x4a')][_0x49db('0x56')]){_0x439cde[_0x49db('0x53')]=_['merge'](_0x439cde['where'],{'$or':_[_0x49db('0x42')](_0x439cde[_0x49db('0x4b')],function(_0x1299b4){var _0x20f10d={};_0x20f10d[_0x1299b4]={'$like':'%'+_0x1d8a70['query'][_0x49db('0x56')]+'%'};return _0x20f10d;})});}if(_0x1d8a70[_0x49db('0x4a')][_0x49db('0x9b')]){var _0x11a1d2=_0x1d8a70[_0x49db('0x4a')]['$gte'][_0x49db('0x9c')](',');var _0x2fb9e9={};_0x2fb9e9[_0x11a1d2[0x0]]={'$gte':moment(_0x11a1d2[0x1])[_0x49db('0x9d')](_0x49db('0x9e'))};_0x439cde[_0x49db('0x53')]=_[_0x49db('0x57')](_0x439cde['where'],_0x2fb9e9);}_0x439cde=_['merge']({},_0x439cde,_0x1d8a70[_0x49db('0x59')]);return db[_0x49db('0x9a')]['count']({'where':_0x439cde['where']})[_0x49db('0xd')](function(_0x432a1b){_0x304f16['count']=_0x432a1b;if(_0x1d8a70[_0x49db('0x4a')][_0x49db('0x5a')]){_0x439cde[_0x49db('0x5b')]=[{'all':!![]}];}return db[_0x49db('0x9a')][_0x49db('0x5c')](_0x439cde);})[_0x49db('0xd')](function(_0x27da1e){if(_0x1d8a70[_0x49db('0x4a')][_0x49db('0x9f')]===_0x49db('0xa0')){for(var _0x593fd3=0x0;_0x593fd3<_0x27da1e['length'];_0x593fd3++){_0x27da1e[_0x593fd3][_0x49db('0x63')]=juice(_0x27da1e[_0x593fd3][_0x49db('0x63')]);}}_0x304f16[_0x49db('0x5d')]=_0x27da1e;return _0x304f16;});}})[_0x49db('0xd')](respondWithFilteredResult(_0x369265,_0x439cde))['catch'](handleError(_0x369265,null));};exports[_0x49db('0x27')]=function(_0x379dae,_0x509872){var _0x493823,_0x20b690={},_0x5acbee;if(_0x379dae['body']['to']){_0x5acbee=_0x379dae[_0x49db('0x63')]['to'][_0x49db('0x9c')](',')[0x0];}return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x379dae[_0x49db('0x67')]['id']},'include':[{'model':db['CmList'],'as':_0x49db('0xa1'),'include':[{'model':db[_0x49db('0x85')],'as':_0x49db('0xa2'),'where':{'email':_0x5acbee},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x49db('0x3f')],'as':_0x49db('0x40'),'raw':!![],'include':[{'model':db[_0x49db('0xa3')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x509872,null))[_0x49db('0xd')](function(_0x470099){if(!_0x470099)return;_0x493823=_0x470099;if(!_0x470099['Smtp'])throw new Error(_0x49db('0xa4'));if(_[_0x49db('0x76')](_0x379dae['body'][_0x49db('0xa5')])){_0x379dae[_0x49db('0x63')][_0x49db('0xa5')]=util[_0x49db('0x9d')](_0x49db('0xa6'),_0x470099[_0x49db('0x26')],_0x470099[_0x49db('0x74')]||_0x470099['Smtp'][_0x49db('0x33')]);}if(_0x379dae[_0x49db('0x63')][_0x49db('0xa7')]&&_0x379dae[_0x49db('0x63')]['attachments'][_0x49db('0x4d')]){for(var _0x9f7ca8=0x0;_0x9f7ca8<_0x379dae['body']['attachments']['length'];_0x9f7ca8+=0x1){_0x379dae[_0x49db('0x63')]['attachments'][_0x9f7ca8]={'filename':_0x379dae[_0x49db('0x63')][_0x49db('0xa7')][_0x9f7ca8]['name'],'path':path['join'](config[_0x49db('0xa8')],_0x49db('0xa9'),_0x379dae[_0x49db('0x63')][_0x49db('0xa7')][_0x9f7ca8][_0x49db('0xaa')])};}}var _0x4a8a69=_0x470099[_0x49db('0xab')]();return respondWithRpcPromise(_0x49db('0xac'),_0x49db('0xad'),{'account':_0x4a8a69,'message':_0x379dae[_0x49db('0x63')]});})['then'](function(_0x34da8c){if(!_0x34da8c)return;_0x20b690=_0x34da8c;if(!_0x493823['List'])throw new Error('List\x20not\x20found');if(_0x493823[_0x49db('0xa1')]['Contacts'][_0x49db('0x4d')])return _0x493823[_0x49db('0xa1')]['Contacts'][0x0];return db[_0x49db('0x85')][_0x49db('0x6b')](_['defaults'](_0x379dae[_0x49db('0x63')],{'firstName':_0x379dae['body']['to'],'email':_0x379dae[_0x49db('0x63')]['to'],'phone':_0x379dae[_0x49db('0x63')]['to'],'ListId':_0x493823[_0x49db('0x75')]}));})[_0x49db('0xd')](function(_0x45eb79){if(!_0x45eb79)return;var _0x581f9b={'UserId':_0x379dae[_0x49db('0x33')]['id'],'ContactId':_0x45eb79['id'],'MailAccountId':_0x493823['id'],'inReplyTo':_0x20b690['messageId'],'to':_0x379dae['body'][_0x49db('0xa5')],'cc':_0x379dae[_0x49db('0x63')]['cc'],'subject':_0x379dae[_0x49db('0x63')]['subject'],'attach':_0x379dae[_0x49db('0x63')][_0x49db('0xae')],'firstMsgDirection':_0x49db('0xaf'),'lastMsgAt':moment()[_0x49db('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x49db('0xaf'),'Messages':[_['merge'](_0x379dae[_0x49db('0x63')],{'messageId':_0x20b690[_0x49db('0xb0')],'sentAt':moment()[_0x49db('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x493823['id'],'UserId':_0x379dae[_0x49db('0x33')]['id'],'ContactId':_0x45eb79['id']})]};if(_0x379dae[_0x49db('0x63')]['Interaction']){_0x581f9b=_['merge'](_0x581f9b,_0x379dae[_0x49db('0x63')]['Interaction']);}return db['MailInteraction'][_0x49db('0x6b')](_0x581f9b,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x49db('0xd')](respondWithResult(_0x509872,null))[_0x49db('0x17')](handleError(_0x509872,null));};exports['verifySmtp']=function(_0x56e293,_0x5d258f){return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x56e293[_0x49db('0x67')]['id']},'include':[{'model':db[_0x49db('0x3f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x49db('0xa3'),'raw':!![]}]}]})[_0x49db('0xd')](handleEntityNotFound(_0x5d258f,null))['then'](function(_0x11d5d1){if(!_0x11d5d1[_0x49db('0x40')])return;var _0x11d57d=_0x11d5d1['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x49db('0xb1'),{'account':_0x11d57d});})[_0x49db('0xd')](respondWithResult(_0x5d258f,null))[_0x49db('0x17')](handleError(_0x5d258f,null));};exports[_0x49db('0x20')]=function(_0x48fc3b,_0x5238e4){return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x48fc3b[_0x49db('0x67')]['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x5238e4,null))['then'](function(_0xa34a6d){if(_0xa34a6d&&_0xa34a6d[_0x49db('0x3a')]){throw new db[(_0x49db('0xb2'))]['ValidationError'](_0x49db('0xb3'));}return _0xa34a6d;})[_0x49db('0xd')](removeEntity(_0x5238e4,null))['catch'](handleError(_0x5238e4,null));};exports['addAgents']=function(_0x4083fe,_0x117f7e){return db[_0x49db('0x43')][_0x49db('0x62')]({'where':{'id':_0x4083fe[_0x49db('0x67')]['id']}})['then'](handleEntityNotFound(_0x117f7e,null))[_0x49db('0xd')](function(_0x3d8f0f){if(_0x3d8f0f){return _0x3d8f0f[_0x49db('0xb4')](_0x4083fe[_0x49db('0x63')][_0x49db('0x70')],_[_0x49db('0x83')](_0x4083fe[_0x49db('0x63')],[_0x49db('0x70'),'id'])||{})[_0x49db('0xb5')](function(_0x2a7faf){for(var _0x333934=0x0;_0x333934<_0x4083fe[_0x49db('0x63')]['ids'][_0x49db('0x4d')];_0x333934+=0x1){socket[_0x49db('0xb6')](_0x49db('0xb7'),{'UserId':Number(_0x4083fe[_0x49db('0x63')]['ids'][_0x333934]),'MailAccountId':Number(_0x4083fe[_0x49db('0x67')]['id'])});}return _0x2a7faf;});}})[_0x49db('0xd')](respondWithResult(_0x117f7e,null))[_0x49db('0x17')](handleError(_0x117f7e,null));};exports[_0x49db('0xb8')]=function(_0x2060f5,_0x4777b5){return db[_0x49db('0x43')]['find']({'where':{'id':_0x2060f5['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x4777b5,null))[_0x49db('0xd')](function(_0x469f9b){if(_0x469f9b){return _0x469f9b['removeAgents'](_0x2060f5[_0x49db('0x4a')][_0x49db('0x70')])[_0x49db('0xd')](function(){if(_['isArray'](_0x2060f5[_0x49db('0x4a')][_0x49db('0x70')])){for(var _0x5936c8=0x0;_0x5936c8<_0x2060f5[_0x49db('0x4a')]['ids'][_0x49db('0x4d')];_0x5936c8+=0x1){socket[_0x49db('0xb6')]('userMailAccount:remove',{'UserId':Number(_0x2060f5[_0x49db('0x4a')]['ids'][_0x5936c8]),'MailAccountId':Number(_0x2060f5[_0x49db('0x67')]['id'])});}}else{socket[_0x49db('0xb6')](_0x49db('0xb9'),{'UserId':Number(_0x2060f5[_0x49db('0x4a')][_0x49db('0x70')]),'MailAccountId':Number(_0x2060f5[_0x49db('0x67')]['id'])});}});}})[_0x49db('0xd')](respondWithStatusCode(_0x4777b5,null))[_0x49db('0x17')](handleError(_0x4777b5,null));};exports[_0x49db('0xba')]=function(_0x17be16,_0x2cc6e1){var _0x533687={};var _0x4220f1={};var _0x2c0c58;var _0x144d37;return db[_0x49db('0x43')][_0x49db('0x6d')]({'where':{'id':_0x17be16['params']['id']}})[_0x49db('0xd')](handleEntityNotFound(_0x2cc6e1,null))[_0x49db('0xd')](function(_0x2aad82){if(_0x2aad82){_0x2c0c58=_0x2aad82;_0x4220f1[_0x49db('0x48')]=_[_0x49db('0x49')](db['User'][_0x49db('0x44')]);_0x4220f1[_0x49db('0x4a')]=_[_0x49db('0x49')](_0x17be16['query']);_0x4220f1[_0x49db('0x54')]=_[_0x49db('0x61')](_0x4220f1['model'],_0x4220f1['query']);_0x533687[_0x49db('0x4b')]=_[_0x49db('0x61')](_0x4220f1[_0x49db('0x48')],qs['fields'](_0x17be16[_0x49db('0x4a')][_0x49db('0x4c')]));_0x533687['attributes']=_0x533687[_0x49db('0x4b')][_0x49db('0x4d')]?_0x533687[_0x49db('0x4b')]:_0x4220f1[_0x49db('0x48')];_0x533687[_0x49db('0x51')]=qs['sort'](_0x17be16[_0x49db('0x4a')][_0x49db('0x52')]);_0x533687[_0x49db('0x53')]=qs['filters'](_[_0x49db('0x55')](_0x17be16[_0x49db('0x4a')],_0x4220f1[_0x49db('0x54')]));if(_0x17be16[_0x49db('0x4a')][_0x49db('0x56')]){_0x533687[_0x49db('0x53')]=_[_0x49db('0x57')](_0x533687[_0x49db('0x53')],{'$or':_[_0x49db('0x42')](_0x533687[_0x49db('0x4b')],function(_0x3d700c){var _0x45ed14={};_0x45ed14[_0x3d700c]={'$like':'%'+_0x17be16[_0x49db('0x4a')][_0x49db('0x56')]+'%'};return _0x45ed14;})});}_0x533687=_[_0x49db('0x57')]({},_0x533687,_0x17be16[_0x49db('0x59')]);return _0x2c0c58[_0x49db('0xba')](_0x533687);}})['then'](function(_0x984160){if(_0x984160){_0x144d37=_0x984160[_0x49db('0x4d')];if(!_0x17be16[_0x49db('0x4a')][_0x49db('0x4e')](_0x49db('0x4f'))){_0x533687[_0x49db('0x50')]=qs['limit'](_0x17be16[_0x49db('0x4a')][_0x49db('0x50')]);_0x533687[_0x49db('0x1a')]=qs[_0x49db('0x1a')](_0x17be16['query'][_0x49db('0x1a')]);}return _0x2c0c58[_0x49db('0xba')](_0x533687);}})['then'](function(_0x3d7c8f){if(_0x3d7c8f){return _0x3d7c8f?{'count':_0x144d37,'rows':_0x3d7c8f}:null;}})[_0x49db('0xd')](respondWithResult(_0x2cc6e1,null))[_0x49db('0x17')](handleError(_0x2cc6e1,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ee6bd32..55d52ad 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 _0x077e=['events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f3ce9,_0x4dcaa5){var _0x3d0be1=function(_0x56b278){while(--_0x56b278){_0x4f3ce9['push'](_0x4f3ce9['shift']());}};_0x3d0be1(++_0x4dcaa5);}(_0x077e,0x14a));var _0xe077=function(_0x2d78ef,_0xa7575b){_0x2d78ef=_0x2d78ef-0x0;var _0x39e29c=_0x077e[_0x2d78ef];return _0x39e29c;};'use strict';var EventEmitter=require(_0xe077('0x0'));var MailAccount=require(_0xe077('0x1'))['db'][_0xe077('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe077('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe077('0x4'),'afterDestroy':_0xe077('0x5')};function emitEvent(_0x434a74){return function(_0x4a203d,_0x391340,_0x333f7f){MailAccountEvents[_0xe077('0x6')](_0x434a74+':'+_0x4a203d['id'],_0x4a203d);MailAccountEvents[_0xe077('0x6')](_0x434a74,_0x4a203d);_0x333f7f(null);};}for(var e in events){if(events[_0xe077('0x7')](e)){var event=events[e];MailAccount[_0xe077('0x8')](e,emitEvent(event));}}module[_0xe077('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xd117=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x270774,_0x3863f2){var _0x21583c=function(_0x4ec71a){while(--_0x4ec71a){_0x270774['push'](_0x270774['shift']());}};_0x21583c(++_0x3863f2);}(_0xd117,0x182));var _0x7d11=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xd117[_0x47adb8];return _0x4689a8;};'use strict';var EventEmitter=require(_0x7d11('0x0'));var MailAccount=require(_0x7d11('0x1'))['db'][_0x7d11('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7d11('0x3')](0x0);var events={'afterCreate':_0x7d11('0x4'),'afterUpdate':_0x7d11('0x5'),'afterDestroy':_0x7d11('0x6')};function emitEvent(_0x254bb4){return function(_0x3c07be,_0x31fcb0,_0x589c51){MailAccountEvents[_0x7d11('0x7')](_0x254bb4+':'+_0x3c07be['id'],_0x3c07be);MailAccountEvents[_0x7d11('0x7')](_0x254bb4,_0x3c07be);_0x589c51(null);};}for(var e in events){if(events[_0x7d11('0x8')](e)){var event=events[e];MailAccount[_0x7d11('0x9')](e,emitEvent(event));}}module[_0x7d11('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5622397..90db4ac 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 _0x1896=['data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user'];(function(_0x5e2799,_0x2432bb){var _0x1aa60b=function(_0x92a0ac){while(--_0x92a0ac){_0x5e2799['push'](_0x5e2799['shift']());}};_0x1aa60b(++_0x2432bb);}(_0x1896,0xc9));var _0x6189=function(_0x4924ec,_0x1b217f){_0x4924ec=_0x4924ec-0x0;var _0x588c39=_0x1896[_0x4924ec];return _0x588c39;};'use strict';var attributes=require(_0x6189('0x0'));module[_0x6189('0x1')]=function(_0x57352a){return _0x57352a[_0x6189('0x2')](_0x6189('0x3'),attributes,{'tableName':_0x6189('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3a5391=this;var _0x376866={'id':_0x3a5391['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3a5391[_0x6189('0x5')]!==_0x6189('0x6')){_0x376866['service']=_0x3a5391[_0x6189('0x5')];}else{_0x376866[_0x6189('0x7')]=_0x3a5391[_0x6189('0x8')][_0x6189('0x7')];_0x376866[_0x6189('0x9')]=_0x3a5391[_0x6189('0x8')][_0x6189('0x9')];_0x376866[_0x6189('0xa')]=_0x3a5391['Smtp'][_0x6189('0xa')];}if(_0x3a5391[_0x6189('0x8')]['authentication']){if(_0x3a5391[_0x6189('0x8')][_0x6189('0xb')]){if(!_0x3a5391[_0x6189('0x8')][_0x6189('0xc')])throw new Error(_0x6189('0xd'));_0x376866['auth']={'type':'OAuth2','user':_0x3a5391['Smtp'][_0x6189('0xe')],'accessToken':_0x3a5391[_0x6189('0x8')]['CloudProvider'][_0x6189('0xf')]};}else{_0x376866[_0x6189('0x10')]={'user':_0x3a5391[_0x6189('0x8')][_0x6189('0xe')],'pass':_0x3a5391[_0x6189('0x8')][_0x6189('0x11')]};}}return _0x376866;}}});}; \ No newline at end of file +var _0xc825=['data5','pass','./mailAccount.attributes','exports','MailAccount','provider','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','auth','OAuth2','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc825,0x178));var _0x5c82=function(_0x478ecf,_0x463faf){_0x478ecf=_0x478ecf-0x0;var _0x39dfd6=_0xc825[_0x478ecf];return _0x39dfd6;};'use strict';var attributes=require(_0x5c82('0x0'));module[_0x5c82('0x1')]=function(_0x18b1bc){return _0x18b1bc['define'](_0x5c82('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x23446a=this;var _0x331181={'id':_0x23446a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x23446a[_0x5c82('0x3')]!==_0x5c82('0x4')){_0x331181[_0x5c82('0x5')]=_0x23446a[_0x5c82('0x3')];}else{_0x331181[_0x5c82('0x6')]=_0x23446a[_0x5c82('0x7')][_0x5c82('0x6')];_0x331181[_0x5c82('0x8')]=_0x23446a[_0x5c82('0x7')][_0x5c82('0x8')];_0x331181[_0x5c82('0x9')]=_0x23446a[_0x5c82('0x7')]['secure'];}if(_0x23446a[_0x5c82('0x7')]['authentication']){if(_0x23446a[_0x5c82('0x7')][_0x5c82('0xa')]){if(!_0x23446a[_0x5c82('0x7')][_0x5c82('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x331181[_0x5c82('0xc')]={'type':_0x5c82('0xd'),'user':_0x23446a[_0x5c82('0x7')][_0x5c82('0xe')],'accessToken':_0x23446a['Smtp'][_0x5c82('0xb')][_0x5c82('0xf')]};}else{_0x331181[_0x5c82('0xc')]={'user':_0x23446a[_0x5c82('0x7')][_0x5c82('0xe')],'pass':_0x23446a[_0x5c82('0x7')][_0x5c82('0x10')]};}}return _0x331181;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 59e98b3..87874b5 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 _0xc6ac=['update','interaction','created','contact','attachments','originTo','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x47f523,_0x14cca3){var _0x14d606=function(_0x42ebfb){while(--_0x42ebfb){_0x47f523['push'](_0x47f523['shift']());}};_0x14d606(++_0x14cca3);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x50fabe,_0x273b35){_0x50fabe=_0x50fabe-0x0;var _0x40b874=_0xc6ac[_0x50fabe];return _0x40b874;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var rs=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var db=require(_0xcc6a('0x5'))['db'];var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var jayson=require(_0xcc6a('0x9'));var client=jayson[_0xcc6a('0xa')][_0xcc6a('0xb')]({'port':0x232c});config[_0xcc6a('0xc')]=_[_0xcc6a('0xd')](config['redis'],{'host':_0xcc6a('0xe'),'port':0x18eb});var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0xc')]));require('./mailAccount.socket')[_0xcc6a('0x10')](socket);function respondWithRpcPromise(_0x210f63,_0x7806a0,_0x463ebb){return new BPromise(function(_0x3eb04a,_0x5e91a2){return client[_0xcc6a('0x11')](_0x210f63,_0x463ebb)[_0xcc6a('0x12')](function(_0x109693){logger['info'](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));logger[_0xcc6a('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x7806a0,'request\x20sent',JSON[_0xcc6a('0x16')](_0x109693));if(_0x109693[_0xcc6a('0x17')]){if(_0x109693[_0xcc6a('0x17')]['code']===0x1f4){logger['error'](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);return _0x5e91a2(_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);}logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')]['message']);return _0x3eb04a(_0x109693['error']['message']);}else{logger[_0xcc6a('0x19')](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));_0x3eb04a(_0x109693[_0xcc6a('0x1a')][_0xcc6a('0x18')]);}})[_0xcc6a('0x1b')](function(_0x2d9585){logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x2d9585);_0x5e91a2(_0x2d9585);});});}exports[_0xcc6a('0x1c')]=function(_0x1d20a3){var _0x5b657e=this;return new Promise(function(_0xfec60f,_0x3e1fda){return db[_0xcc6a('0x1d')][_0xcc6a('0x1e')]({'raw':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')]['attributes']||null:null,'limit':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x22')]||null:null,'include':_0x1d20a3['options']?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x5fc697){return{'model':db[_0x5fc697['model']],'as':_0x5fc697['as'],'attributes':_0x5fc697[_0xcc6a('0x25')],'include':_0x5fc697[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x5fc697['include'],function(_0x3afb3a){return{'model':db[_0x3afb3a[_0xcc6a('0x26')]],'as':_0x3afb3a['as'],'attributes':_0x3afb3a['attributes'],'include':_0x3afb3a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x3afb3a[_0xcc6a('0x23')],function(_0x473f88){return{'model':db[_0x473f88['model']],'as':_0x473f88['as'],'attributes':_0x473f88[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x2c6d88){logger['info'](_0xcc6a('0x1c'),_0x1d20a3);logger['debug']('GetMailAccount',_0x1d20a3,JSON[_0xcc6a('0x16')](_0x2c6d88));_0xfec60f(_0x2c6d88);})[_0xcc6a('0x1b')](function(_0x3aa315){logger[_0xcc6a('0x17')](_0xcc6a('0x1c'),_0x3aa315[_0xcc6a('0x18')],_0x1d20a3);_0x3e1fda(_0x5b657e['error'](0x1f4,_0x3aa315[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x27')]=function(_0x147aff){var _0x2faeb5=this;return new Promise(function(_0x211a8c,_0x152ebd){return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'raw':_0x147aff['options']?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')]['attributes']||null:null,'include':_0x147aff[_0xcc6a('0x1f')]?_0x147aff['options']['include']?_['map'](_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x1101ec){return{'model':db[_0x1101ec[_0xcc6a('0x26')]],'as':_0x1101ec['as'],'attributes':_0x1101ec[_0xcc6a('0x25')],'include':_0x1101ec['include']?_['map'](_0x1101ec[_0xcc6a('0x23')],function(_0x11173a){return{'model':db[_0x11173a[_0xcc6a('0x26')]],'as':_0x11173a['as'],'attributes':_0x11173a['attributes'],'include':_0x11173a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x11173a[_0xcc6a('0x23')],function(_0xa326b2){return{'model':db[_0xa326b2[_0xcc6a('0x26')]],'as':_0xa326b2['as'],'attributes':_0xa326b2[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x18a252){if(_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x29')]===!![])_0x18a252[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x18a252[_0xcc6a('0x2c')]());logger[_0xcc6a('0x19')](_0xcc6a('0x27'),_0x147aff);logger[_0xcc6a('0x15')](_0xcc6a('0x27'),_0x147aff,JSON[_0xcc6a('0x16')](_0x18a252));_0x211a8c(_0x18a252);})['catch'](function(_0x553e66){logger[_0xcc6a('0x17')](_0xcc6a('0x27'),_0x553e66[_0xcc6a('0x18')],_0x147aff);_0x152ebd(_0x2faeb5[_0xcc6a('0x17')](0x1f4,_0x553e66[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x2d')]=function(_0x3273bc){var _0x1199f1=this;return new Promise(function(_0x49b65c,_0x56bc7d){var _0x470e3b={'body':_0x3273bc['body'],'channel':'mail'};var _0x5cf1ba=_[_0xcc6a('0x2e')](_[_0xcc6a('0x2f')](db[_0xcc6a('0x30')][_0xcc6a('0x31')]),[_0xcc6a('0x32'),'updatedAt',_0xcc6a('0x33'),_0xcc6a('0x34')]);var _0x17e5a0=![];if(_0x3273bc[_0xcc6a('0x35')]['id']){delete _0x3273bc[_0xcc6a('0x35')]['id'];}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x37')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x38')));}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x35')])||_0x3273bc['body'][_0xcc6a('0x35')]===''){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x39')));}if(_['isNil'](_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cf1ba));}if(!_['includes'](_0x5cf1ba,_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x3b')+_0x5cf1ba));}var _0x345e94={};_0x345e94[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')]['from'];return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'where':{'id':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x3d')],'as':_0xcc6a('0x3e'),'include':[{'model':db[_0xcc6a('0x30')],'as':'Contacts','where':_0x345e94,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc6a('0x3f')],'as':_0xcc6a('0x40')},{'model':db[_0xcc6a('0x41')],'as':_0xcc6a('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xcc6a('0x43')}]}]})['then'](function(_0x3aa7dd){if(_0x3aa7dd&&_0x3aa7dd[_0xcc6a('0x3e')]){var _0xcfc540=_0x3aa7dd[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x3c')]=_[_0xcc6a('0x45')](_0xcfc540,['Applications',_0xcc6a('0x3e')]);_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x2b')]=_0x3aa7dd[_0xcc6a('0x2c')]();_0x470e3b[_0xcc6a('0x46')]=_0xcfc540[_0xcc6a('0x40')];_0x470e3b[_0xcc6a('0x47')]=_0xcfc540[_0xcc6a('0x3e')];_0x470e3b[_0xcc6a('0x46')]=_[_0xcc6a('0x48')](_0x470e3b['applications'],[_0xcc6a('0x49')],[_0xcc6a('0x4a')]);if(_0x470e3b[_0xcc6a('0x3c')]&&_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x4b')]){_0x470e3b[_0xcc6a('0x46')]['push']({'id':0x0,'priority':_0x470e3b['applications'][_0xcc6a('0x4c')]+0x1,'app':'close','appdata':_0xcc6a('0x4b'),'interval':_0xcc6a('0x4d')});}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')];}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')];}if(_0xcfc540[_0xcc6a('0x3e')]['Contacts'][_0xcc6a('0x4c')]){return _0xcfc540['List'][_0xcc6a('0x4e')][0x0];}var _0x1570fe=_[_0xcc6a('0xd')](_0x3273bc['body'],{'firstName':_0x3273bc[_0xcc6a('0x35')]['from'],'ListId':_0xcfc540[_0xcc6a('0x34')]});_0x1570fe[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x37')];return db[_0xcc6a('0x30')][_0xcc6a('0x4f')](_0x1570fe);}else{throw new Error(_0xcc6a('0x50'));}})[_0xcc6a('0x12')](function(_0x11459f){_0x470e3b['contact']=_0x11459f;if(_0x11459f){if(!_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x51')]){_0x3273bc['body'][_0xcc6a('0x18')][_0xcc6a('0x51')]=rs[_0xcc6a('0x52')]()+'\x20'+_0x3273bc['body'][_0xcc6a('0x18')]['from'];}var _0x5e53e4={'ContactId':_0x11459f['id'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x54')],'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'};return db[_0xcc6a('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x58')],'as':_0xcc6a('0x59'),'attributes':[_0xcc6a('0x51')],'where':{'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x5a')]}}]})[_0xcc6a('0x12')](function(_0x2686c8){if(_0x2686c8){return[_0x2686c8,![]];}return db[_0xcc6a('0x57')]['create'](_0x5e53e4)['then'](function(_0x4fe041){return[_0x4fe041,!![]];});});}else{throw new Error(_0xcc6a('0x5b'));}})[_0xcc6a('0x5c')](function(_0x9c444,_0x4a9f34){if(_0x9c444){_0x17e5a0=_0x4a9f34;if(!_0x4a9f34){return _0x9c444[_0xcc6a('0x5d')]({'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc['body']['message'][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x53')],'attach':_0x9c444[_0xcc6a('0x54')]?_0x9c444[_0xcc6a('0x54')]:_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcc6a('0x56')),'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'});}else{return _0x9c444;}}})[_0xcc6a('0x12')](function(_0x56a3a0){_0x470e3b['interaction']=_0x56a3a0[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x5f')]=_0x17e5a0;return db[_0xcc6a('0x58')]['create']({'body':_0x3273bc['body']['body'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'MailInteractionId':_0x56a3a0['id'],'direction':'in','ContactId':_0x470e3b[_0xcc6a('0x60')]['id'],'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['messageId'],'from':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['from'],'to':_0x3273bc[_0xcc6a('0x35')]['message']['to'],'cc':_0x3273bc[_0xcc6a('0x35')]['message']['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc['body'][_0xcc6a('0x18')]['attach'],'Attachments':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x61')],'originTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x62')],'originCc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originCc'],'bcc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x63')],'ChatWebsiteId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['ChatWebsiteId']||null,'originChannel':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x64')]||null},{'include':[{'model':db[_0xcc6a('0x65')],'as':_0xcc6a('0x66')}]});})[_0xcc6a('0x12')](function(_0x598833){_0x470e3b[_0xcc6a('0x18')]=_0x598833;if(_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x67')]){return db[_0xcc6a('0x68')][_0xcc6a('0x28')]({'attributes':['id',_0xcc6a('0x69')],'where':{'id':_0x470e3b['interaction']['UserId']}})[_0xcc6a('0x12')](function(_0x43cbee){if(_0x43cbee){_0x470e3b[_0xcc6a('0x46')][_0xcc6a('0x6a')]({'id':0x0,'priority':0x0,'app':_0xcc6a('0x6b'),'appdata':_0x43cbee[_0xcc6a('0x69')]+','+(_0x470e3b[_0xcc6a('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc6a('0x4d')});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);})[_0xcc6a('0x12')](function(_0x5e8e19){_0x49b65c(_0x5e8e19);})[_0xcc6a('0x1b')](function(_0x4688d3){_0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0x4688d3['message']));});});}; \ No newline at end of file +var _0x187d=['account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','list','applications','orderBy','priority','autoclose','length','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','update','interaction','created','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','include','model','map','debug','ShowMailAccount','find','where','smtp','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x12ceba,_0x59ba15){var _0x36c243=function(_0x4f44c9){while(--_0x4f44c9){_0x12ceba['push'](_0x12ceba['shift']());}};_0x36c243(++_0x59ba15);}(_0x187d,0x93));var _0xd187=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x187d[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xd187('0x0'));var moment=require('moment');var BPromise=require(_0xd187('0x1'));var rs=require(_0xd187('0x2'));var Redis=require(_0xd187('0x3'));var db=require(_0xd187('0x4'))['db'];var logger=require(_0xd187('0x5'))(_0xd187('0x6'));var config=require('../../config/environment');var jayson=require(_0xd187('0x7'));var client=jayson[_0xd187('0x8')]['http']({'port':0x232c});config[_0xd187('0x9')]=_[_0xd187('0xa')](config[_0xd187('0x9')],{'host':_0xd187('0xb'),'port':0x18eb});var socket=require(_0xd187('0xc'))(new Redis(config[_0xd187('0x9')]));require(_0xd187('0xd'))[_0xd187('0xe')](socket);function respondWithRpcPromise(_0x5b480f,_0x342539,_0x42848b){return new BPromise(function(_0x4039f6,_0x473866){return client[_0xd187('0xf')](_0x5b480f,_0x42848b)[_0xd187('0x10')](function(_0x59c194){logger[_0xd187('0x11')](_0xd187('0x12'),_0x342539,_0xd187('0x13'));logger['debug'](_0xd187('0x14'),_0x342539,_0xd187('0x13'),JSON[_0xd187('0x15')](_0x59c194));if(_0x59c194['error']){if(_0x59c194[_0xd187('0x16')][_0xd187('0x17')]===0x1f4){logger[_0xd187('0x16')](_0xd187('0x12'),_0x342539,_0x59c194['error'][_0xd187('0x18')]);return _0x473866(_0x59c194[_0xd187('0x16')][_0xd187('0x18')]);}logger[_0xd187('0x16')]('MailAccount,\x20%s,\x20%s',_0x342539,_0x59c194[_0xd187('0x16')]['message']);return _0x4039f6(_0x59c194['error'][_0xd187('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x342539,_0xd187('0x13'));_0x4039f6(_0x59c194[_0xd187('0x19')][_0xd187('0x18')]);}})[_0xd187('0x1a')](function(_0x21df74){logger[_0xd187('0x16')](_0xd187('0x12'),_0x342539,_0x21df74);_0x473866(_0x21df74);});});}exports[_0xd187('0x1b')]=function(_0x4f2f88){var _0x46fca3=this;return new Promise(function(_0x170d5c,_0x11b2a1){return db[_0xd187('0x1c')]['findAll']({'raw':_0x4f2f88[_0xd187('0x1d')]?_0x4f2f88[_0xd187('0x1d')][_0xd187('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f2f88['options']?_0x4f2f88['options']['where']||null:null,'attributes':_0x4f2f88[_0xd187('0x1d')]?_0x4f2f88[_0xd187('0x1d')][_0xd187('0x1f')]||null:null,'limit':_0x4f2f88['options']?_0x4f2f88[_0xd187('0x1d')]['limit']||null:null,'include':_0x4f2f88[_0xd187('0x1d')]?_0x4f2f88['options'][_0xd187('0x20')]?_['map'](_0x4f2f88['options'][_0xd187('0x20')],function(_0x4d992b){return{'model':db[_0x4d992b[_0xd187('0x21')]],'as':_0x4d992b['as'],'attributes':_0x4d992b[_0xd187('0x1f')],'include':_0x4d992b['include']?_['map'](_0x4d992b[_0xd187('0x20')],function(_0xeff822){return{'model':db[_0xeff822[_0xd187('0x21')]],'as':_0xeff822['as'],'attributes':_0xeff822[_0xd187('0x1f')],'include':_0xeff822['include']?_[_0xd187('0x22')](_0xeff822[_0xd187('0x20')],function(_0x5c8e52){return{'model':db[_0x5c8e52[_0xd187('0x21')]],'as':_0x5c8e52['as'],'attributes':_0x5c8e52[_0xd187('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd187('0x10')](function(_0x4c50a5){logger[_0xd187('0x11')]('GetMailAccount',_0x4f2f88);logger[_0xd187('0x23')](_0xd187('0x1b'),_0x4f2f88,JSON[_0xd187('0x15')](_0x4c50a5));_0x170d5c(_0x4c50a5);})[_0xd187('0x1a')](function(_0x489f2e){logger[_0xd187('0x16')](_0xd187('0x1b'),_0x489f2e['message'],_0x4f2f88);_0x11b2a1(_0x46fca3['error'](0x1f4,_0x489f2e[_0xd187('0x18')]));});});};exports[_0xd187('0x24')]=function(_0x13f285){var _0x481346=this;return new Promise(function(_0x2874b2,_0x2d8843){return db[_0xd187('0x1c')][_0xd187('0x25')]({'raw':_0x13f285['options']?_0x13f285[_0xd187('0x1d')][_0xd187('0x1e')]===undefined?!![]:![]:!![],'where':_0x13f285[_0xd187('0x1d')]?_0x13f285['options'][_0xd187('0x26')]||null:null,'attributes':_0x13f285['options']?_0x13f285[_0xd187('0x1d')][_0xd187('0x1f')]||null:null,'include':_0x13f285[_0xd187('0x1d')]?_0x13f285['options']['include']?_[_0xd187('0x22')](_0x13f285[_0xd187('0x1d')]['include'],function(_0x4591e0){return{'model':db[_0x4591e0[_0xd187('0x21')]],'as':_0x4591e0['as'],'attributes':_0x4591e0[_0xd187('0x1f')],'include':_0x4591e0['include']?_['map'](_0x4591e0[_0xd187('0x20')],function(_0xf32da2){return{'model':db[_0xf32da2['model']],'as':_0xf32da2['as'],'attributes':_0xf32da2['attributes'],'include':_0xf32da2['include']?_[_0xd187('0x22')](_0xf32da2['include'],function(_0x28c252){return{'model':db[_0x28c252[_0xd187('0x21')]],'as':_0x28c252['as'],'attributes':_0x28c252['attributes']};}):[]};}):[]};}):[]:[]})[_0xd187('0x10')](function(_0x5674ca){if(_0x13f285[_0xd187('0x1d')][_0xd187('0x27')]===!![])_0x5674ca['setDataValue'](_0xd187('0x28'),_0x5674ca[_0xd187('0x29')]());logger['info'](_0xd187('0x24'),_0x13f285);logger['debug']('ShowMailAccount',_0x13f285,JSON[_0xd187('0x15')](_0x5674ca));_0x2874b2(_0x5674ca);})[_0xd187('0x1a')](function(_0xdecb24){logger[_0xd187('0x16')](_0xd187('0x24'),_0xdecb24['message'],_0x13f285);_0x2d8843(_0x481346[_0xd187('0x16')](0x1f4,_0xdecb24[_0xd187('0x18')]));});});};exports[_0xd187('0x2a')]=function(_0x4f3139){var _0x4b121c=this;return new Promise(function(_0x538c05,_0x595195){var _0x21bb3c={'body':_0x4f3139[_0xd187('0x2b')],'channel':_0xd187('0x2c')};var _0x367303=_[_0xd187('0x2d')](_[_0xd187('0x2e')](db[_0xd187('0x2f')][_0xd187('0x30')]),['createdAt',_0xd187('0x31'),_0xd187('0x32'),_0xd187('0x33')]);var _0x51c7fc=![];if(_0x4f3139[_0xd187('0x2b')]['id']){delete _0x4f3139['body']['id'];}if(_[_0xd187('0x34')](_0x4f3139[_0xd187('0x2b')][_0xd187('0x35')])){return _0x595195(_0x4b121c[_0xd187('0x16')](0x1f4,_0xd187('0x36')));}if(_['isNil'](_0x4f3139[_0xd187('0x2b')][_0xd187('0x2b')])||_0x4f3139[_0xd187('0x2b')][_0xd187('0x2b')]===''){return _0x595195(_0x4b121c['error'](0x1f4,_0xd187('0x37')));}if(_[_0xd187('0x34')](_0x4f3139['body'][_0xd187('0x38')])){return _0x595195(_0x4b121c[_0xd187('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x367303));}if(!_['includes'](_0x367303,_0x4f3139[_0xd187('0x2b')][_0xd187('0x38')])){return _0x595195(_0x4b121c['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x367303));}var _0x4f616d={};_0x4f616d[_0x4f3139[_0xd187('0x2b')][_0xd187('0x38')]]=_0x4f3139[_0xd187('0x2b')][_0xd187('0x35')];return db[_0xd187('0x1c')][_0xd187('0x25')]({'where':{'id':_0x4f3139[_0xd187('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xd187('0x3a'),'include':[{'model':db[_0xd187('0x2f')],'as':_0xd187('0x3b'),'where':_0x4f616d,'limit':0x1,'order':[[_0xd187('0x31'),_0xd187('0x3c')]]}]},{'model':db[_0xd187('0x3d')],'as':_0xd187('0x3e')},{'model':db[_0xd187('0x3f')],'as':'Smtp','include':[{'model':db[_0xd187('0x40')],'as':_0xd187('0x40')}]}]})[_0xd187('0x10')](function(_0x1449d7){if(_0x1449d7&&_0x1449d7[_0xd187('0x3a')]){var _0x5ad646=_0x1449d7[_0xd187('0x41')]({'plain':!![]});_0x21bb3c[_0xd187('0x39')]=_['omit'](_0x5ad646,[_0xd187('0x3e'),_0xd187('0x3a')]);_0x21bb3c['account']['smtpOptions']=_0x1449d7['getSmtpOptions']();_0x21bb3c['applications']=_0x5ad646[_0xd187('0x3e')];_0x21bb3c[_0xd187('0x42')]=_0x5ad646[_0xd187('0x3a')];_0x21bb3c[_0xd187('0x43')]=_[_0xd187('0x44')](_0x21bb3c[_0xd187('0x43')],[_0xd187('0x45')],['asc']);if(_0x21bb3c[_0xd187('0x39')]&&_0x21bb3c[_0xd187('0x39')][_0xd187('0x46')]){_0x21bb3c[_0xd187('0x43')]['push']({'id':0x0,'priority':_0x21bb3c[_0xd187('0x43')]['length']+0x1,'app':'close','appdata':_0xd187('0x46'),'interval':'*,*,*,*'});}if(_0x21bb3c[_0xd187('0x39')][_0xd187('0x3e')]){delete _0x21bb3c[_0xd187('0x39')][_0xd187('0x3e')];}if(_0x21bb3c[_0xd187('0x39')][_0xd187('0x3a')]){delete _0x21bb3c[_0xd187('0x39')][_0xd187('0x3a')];}if(_0x5ad646[_0xd187('0x3a')]['Contacts'][_0xd187('0x47')]){return _0x5ad646[_0xd187('0x3a')]['Contacts'][0x0];}var _0x471f11=_[_0xd187('0xa')](_0x4f3139[_0xd187('0x2b')],{'firstName':_0x4f3139['body'][_0xd187('0x35')],'ListId':_0x5ad646[_0xd187('0x33')]});_0x471f11[_0x4f3139['body'][_0xd187('0x38')]]=_0x4f3139[_0xd187('0x2b')]['from'];return db[_0xd187('0x2f')]['create'](_0x471f11);}else{throw new Error(_0xd187('0x48'));}})[_0xd187('0x10')](function(_0x3a2a00){_0x21bb3c[_0xd187('0x49')]=_0x3a2a00;if(_0x3a2a00){if(!_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4a')]){_0x4f3139['body'][_0xd187('0x18')][_0xd187('0x4a')]=rs[_0xd187('0x4b')]()+'\x20'+_0x4f3139['body'][_0xd187('0x18')][_0xd187('0x35')];}var _0x945810={'ContactId':_0x3a2a00['id'],'MailAccountId':_0x4f3139[_0xd187('0x39')]['id'],'inReplyTo':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4a')],'to':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x35')],'cc':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')]['cc'],'subject':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4c')],'attach':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4d')],'lastMsgAt':moment()[_0xd187('0x4e')](_0xd187('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xd187('0x25')]({'where':{'closed':![],'MailAccountId':_0x4f3139['account']['id']},'include':[{'model':db[_0xd187('0x50')],'as':_0xd187('0x51'),'attributes':[_0xd187('0x4a')],'where':{'messageId':_0x4f3139[_0xd187('0x2b')]['message'][_0xd187('0x52')]}}]})[_0xd187('0x10')](function(_0x4f89a6){if(_0x4f89a6){return[_0x4f89a6,![]];}return db['MailInteraction'][_0xd187('0x53')](_0x945810)[_0xd187('0x10')](function(_0x2870ad){return[_0x2870ad,!![]];});});}else{throw new Error(_0xd187('0x54'));}})['spread'](function(_0x2c1df4,_0x49543f){if(_0x2c1df4){_0x51c7fc=_0x49543f;if(!_0x49543f){return _0x2c1df4[_0xd187('0x55')]({'inReplyTo':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4a')],'to':_0x4f3139['body'][_0xd187('0x18')][_0xd187('0x35')],'cc':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')]['cc'],'subject':_0x4f3139[_0xd187('0x2b')]['message']['subject'],'attach':_0x2c1df4[_0xd187('0x4d')]?_0x2c1df4[_0xd187('0x4d')]:_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4d')],'substatus':null,'substatusAt':moment()[_0xd187('0x4e')](_0xd187('0x4f')),'lastMsgAt':moment()[_0xd187('0x4e')](_0xd187('0x4f')),'lastMsgDirection':'in'});}else{return _0x2c1df4;}}})[_0xd187('0x10')](function(_0x379e89){_0x21bb3c[_0xd187('0x56')]=_0x379e89['get']({'plain':!![]});_0x21bb3c[_0xd187('0x56')][_0xd187('0x57')]=_0x51c7fc;return db['MailMessage'][_0xd187('0x53')]({'body':_0x4f3139[_0xd187('0x2b')]['body'],'MailAccountId':_0x4f3139['account']['id'],'MailInteractionId':_0x379e89['id'],'direction':'in','ContactId':_0x21bb3c[_0xd187('0x49')]['id'],'messageId':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x4a')],'from':_0x4f3139['body'][_0xd187('0x18')][_0xd187('0x35')],'to':_0x4f3139['body']['message']['to'],'cc':_0x4f3139[_0xd187('0x2b')]['message']['cc'],'subject':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')]['subject'],'attach':_0x4f3139[_0xd187('0x2b')]['message'][_0xd187('0x4d')],'Attachments':_0x4f3139['body']['message']['attachments'],'originTo':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x58')],'originCc':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x59')],'bcc':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')]['bcc'],'ChatWebsiteId':_0x4f3139[_0xd187('0x2b')][_0xd187('0x18')][_0xd187('0x5a')]||null,'originChannel':_0x4f3139['body'][_0xd187('0x18')][_0xd187('0x5b')]||_0xd187('0x5c'),'ChatOfflineMessageId':_0x4f3139[_0xd187('0x2b')]['message'][_0xd187('0x5d')]||null},{'include':[{'model':db[_0xd187('0x5e')],'as':'Attachments'}]});})[_0xd187('0x10')](function(_0x3afdd9){_0x21bb3c[_0xd187('0x18')]=_0x3afdd9;if(_0x21bb3c[_0xd187('0x56')]['UserId']){return db[_0xd187('0x5f')][_0xd187('0x25')]({'attributes':['id','name'],'where':{'id':_0x21bb3c[_0xd187('0x56')]['UserId']}})['then'](function(_0x506c53){if(_0x506c53){_0x21bb3c[_0xd187('0x43')][_0xd187('0x60')]({'id':0x0,'priority':0x0,'app':_0xd187('0x61'),'appdata':_0x506c53[_0xd187('0x62')]+','+(_0x21bb3c[_0xd187('0x39')][_0xd187('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd187('0x64'),_0xd187('0x65'),_0x21bb3c);});}return respondWithRpcPromise('Start','startRouting',_0x21bb3c);})[_0xd187('0x10')](function(_0x3e1c19){_0x538c05(_0x3e1c19);})[_0xd187('0x1a')](function(_0x1f163a){_0x595195(_0x4b121c[_0xd187('0x16')](0x1f4,_0x1f163a[_0xd187('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 05be3a0..8147228 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 _0x2d18=['update','emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove'];(function(_0x20463f,_0x4cc37a){var _0x143ee4=function(_0x30bc31){while(--_0x30bc31){_0x20463f['push'](_0x20463f['shift']());}};_0x143ee4(++_0x4cc37a);}(_0x2d18,0xd5));var _0x82d1=function(_0x562123,_0x6a113b){_0x562123=_0x562123-0x0;var _0x349925=_0x2d18[_0x562123];return _0x349925;};'use strict';var MailAccountEvents=require(_0x82d1('0x0'));var events=[_0x82d1('0x1'),_0x82d1('0x2'),_0x82d1('0x3')];function createListener(_0x5d1b04,_0x4a5c61){return function(_0x358b33){_0x4a5c61[_0x82d1('0x4')](_0x5d1b04,_0x358b33);};}function removeListener(_0x3a552e,_0x4667a0){return function(){MailAccountEvents[_0x82d1('0x5')](_0x3a552e,_0x4667a0);};}exports[_0x82d1('0x6')]=function(_0x32b9c8){for(var _0x3e36a0=0x0,_0x295cd5=events['length'];_0x3e36a0<_0x295cd5;_0x3e36a0++){var _0x5b8f24=events[_0x3e36a0];var _0x2d5eca=createListener(_0x82d1('0x7')+_0x5b8f24,_0x32b9c8);MailAccountEvents['on'](_0x5b8f24,_0x2d5eca);}}; \ No newline at end of file +var _0x48ac=['register','mailAccount:','save','update','emit','removeListener'];(function(_0x5b018f,_0x114704){var _0x5a231b=function(_0x661551){while(--_0x661551){_0x5b018f['push'](_0x5b018f['shift']());}};_0x5a231b(++_0x114704);}(_0x48ac,0xe0));var _0xc48a=function(_0x2681ab,_0x111ea5){_0x2681ab=_0x2681ab-0x0;var _0x590175=_0x48ac[_0x2681ab];return _0x590175;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xc48a('0x0'),'remove',_0xc48a('0x1')];function createListener(_0xbfd8aa,_0x3b8221){return function(_0x585c5c){_0x3b8221[_0xc48a('0x2')](_0xbfd8aa,_0x585c5c);};}function removeListener(_0x11a4da,_0xcd83ab){return function(){MailAccountEvents[_0xc48a('0x3')](_0x11a4da,_0xcd83ab);};}exports[_0xc48a('0x4')]=function(_0x499749){for(var _0x48205f=0x0,_0x5df462=events['length'];_0x48205f<_0x5df462;_0x48205f++){var _0x1e1e1a=events[_0x48205f];var _0xf0c31b=createListener(_0xc48a('0x5')+_0x1e1e1a,_0x499749);MailAccountEvents['on'](_0x1e1e1a,_0xf0c31b);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9e5a7e2..c9116ce 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 _0x2a57=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x19904b,_0x4c79f5){var _0x2726ad=function(_0x3477d4){while(--_0x3477d4){_0x19904b['push'](_0x19904b['shift']());}};_0x2726ad(++_0x4c79f5);}(_0x2a57,0x1ae));var _0x72a5=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x2a57[_0x545b71];return _0x26e587;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x72a5('0x0'));var express=require(_0x72a5('0x1'));var router=express[_0x72a5('0x2')]();var fs_extra=require(_0x72a5('0x3'));var auth=require(_0x72a5('0x4'));var interaction=require(_0x72a5('0x5'));var config=require(_0x72a5('0x6'));var controller=require(_0x72a5('0x7'));router[_0x72a5('0x8')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xb')]);router[_0x72a5('0xc')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xd')]);router[_0x72a5('0xe')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xf')]);module[_0x72a5('0x10')]=router; \ No newline at end of file +var _0x9edc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3e7c33,_0x3bf3ef){var _0x3f2c18=function(_0x114439){while(--_0x114439){_0x3e7c33['push'](_0x3e7c33['shift']());}};_0x3f2c18(++_0x3bf3ef);}(_0x9edc,0x150));var _0xc9ed=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x9edc[_0x3b16e1];return _0x311d1b;};'use strict';var multer=require(_0xc9ed('0x0'));var util=require(_0xc9ed('0x1'));var path=require(_0xc9ed('0x2'));var timeout=require(_0xc9ed('0x3'));var express=require(_0xc9ed('0x4'));var router=express[_0xc9ed('0x5')]();var fs_extra=require(_0xc9ed('0x6'));var auth=require(_0xc9ed('0x7'));var interaction=require(_0xc9ed('0x8'));var config=require(_0xc9ed('0x9'));var controller=require('./mailApplication.controller');router[_0xc9ed('0xa')]('/:id',auth[_0xc9ed('0xb')](),controller[_0xc9ed('0xc')]);router[_0xc9ed('0xd')](_0xc9ed('0xe'),auth[_0xc9ed('0xb')](),controller[_0xc9ed('0xf')]);router[_0xc9ed('0x10')](_0xc9ed('0xe'),auth[_0xc9ed('0xb')](),controller[_0xc9ed('0x11')]);module[_0xc9ed('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 7392e50..9225c08 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 _0xc9e0=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0xdeffe6,_0x198150){var _0x5baeb=function(_0x51e1c5){while(--_0x51e1c5){_0xdeffe6['push'](_0xdeffe6['shift']());}};_0x5baeb(++_0x198150);}(_0xc9e0,0x172));var _0x0c9e=function(_0x11c6a1,_0x3ae8ab){_0x11c6a1=_0x11c6a1-0x0;var _0x27d5cf=_0xc9e0[_0x11c6a1];return _0x27d5cf;};'use strict';var Sequelize=require(_0x0c9e('0x0'));module[_0x0c9e('0x1')]={'priority':{'type':Sequelize[_0x0c9e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0c9e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0c9e('0x3')],'defaultValue':_0x0c9e('0x4')}}; \ No newline at end of file +var _0x2746=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x50b660,_0x2f5328){var _0x5118c4=function(_0x162506){while(--_0x162506){_0x50b660['push'](_0x50b660['shift']());}};_0x5118c4(++_0x2f5328);}(_0x2746,0x75));var _0x6274=function(_0x7aae4,_0x379629){_0x7aae4=_0x7aae4-0x0;var _0x1ce74e=_0x2746[_0x7aae4];return _0x1ce74e;};'use strict';var Sequelize=require(_0x6274('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6274('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6274('0x2')],'allowNull':![],'defaultValue':_0x6274('0x3')},'appdata':{'type':Sequelize[_0x6274('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6274('0x2')],'defaultValue':_0x6274('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e31b737..833088d 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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x459391,_0x5c702a){var _0x528c39=function(_0x31fbeb){while(--_0x31fbeb){_0x459391['push'](_0x459391['shift']());}};_0x528c39(++_0x5c702a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2dc70d,_0x26e805){_0x2dc70d=_0x2dc70d-0x0;var _0x3b9ecc=_0xbdb7[_0x2dc70d];return _0x3b9ecc;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 222e853..5b3f6bf 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 _0x22fd=['./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x24ae72,_0x1442cc){var _0x29423e=function(_0x1b833a){while(--_0x1b833a){_0x24ae72['push'](_0x24ae72['shift']());}};_0x29423e(++_0x1442cc);}(_0x22fd,0x1a7));var _0xd22f=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x22fd[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0xd22f('0x0'));var logger=require(_0xd22f('0x1'))(_0xd22f('0x2'));var moment=require(_0xd22f('0x3'));var BPromise=require(_0xd22f('0x4'));var rp=require(_0xd22f('0x5'));var fs=require('fs');var path=require(_0xd22f('0x6'));var rimraf=require(_0xd22f('0x7'));var config=require(_0xd22f('0x8'));var attributes=require(_0xd22f('0x9'));module[_0xd22f('0xa')]=function(_0x2db232,_0x4643e0){return _0x2db232[_0xd22f('0xb')](_0xd22f('0xc'),attributes,{'tableName':_0xd22f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd22f('0xe'),'collate':_0xd22f('0xf')});}; \ No newline at end of file +var _0x8cc1=['exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x8cc1,0x1e6));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18cc('0x0'));var util=require(_0x18cc('0x1'));var logger=require(_0x18cc('0x2'))(_0x18cc('0x3'));var moment=require(_0x18cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x18cc('0x5'));var fs=require('fs');var path=require(_0x18cc('0x6'));var rimraf=require(_0x18cc('0x7'));var config=require(_0x18cc('0x8'));var attributes=require(_0x18cc('0x9'));module[_0x18cc('0xa')]=function(_0x2a868c,_0x1ca32d){return _0x2a868c[_0x18cc('0xb')](_0x18cc('0xc'),attributes,{'tableName':_0x18cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x18cc('0xe'),'collate':_0x18cc('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f15bbd5..9b4159d 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 _0x05b1=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','body','options','raw','attributes','UpdateMailApplication','debug'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x05b1,0x188));var _0x105b=function(_0x11e02d,_0x5d4f13){_0x11e02d=_0x11e02d-0x0;var _0x23722d=_0x05b1[_0x11e02d];return _0x23722d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x105b('0x0'));var BPromise=require(_0x105b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x105b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x105b('0x3'));var logger=require(_0x105b('0x4'))(_0x105b('0x5'));var config=require(_0x105b('0x6'));var jayson=require(_0x105b('0x7'));var client=jayson[_0x105b('0x8')][_0x105b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c078a,_0x55315c,_0xd4e437){return new BPromise(function(_0xd0ca10,_0x5b8d92){return client['request'](_0x4c078a,_0xd4e437)[_0x105b('0xa')](function(_0x1a0f75){logger[_0x105b('0xb')](_0x105b('0xc'),_0x55315c,_0x105b('0xd'));logger['debug'](_0x105b('0xe'),_0x55315c,_0x105b('0xd'),JSON[_0x105b('0xf')](_0x1a0f75));if(_0x1a0f75[_0x105b('0x10')]){if(_0x1a0f75[_0x105b('0x10')][_0x105b('0x11')]===0x1f4){logger[_0x105b('0x10')](_0x105b('0xc'),_0x55315c,_0x1a0f75['error'][_0x105b('0x12')]);return _0x5b8d92(_0x1a0f75[_0x105b('0x10')][_0x105b('0x12')]);}logger[_0x105b('0x10')]('MailApplication,\x20%s,\x20%s',_0x55315c,_0x1a0f75['error'][_0x105b('0x12')]);return _0xd0ca10(_0x1a0f75[_0x105b('0x10')][_0x105b('0x12')]);}else{logger['info'](_0x105b('0xc'),_0x55315c,_0x105b('0xd'));_0xd0ca10(_0x1a0f75[_0x105b('0x13')][_0x105b('0x12')]);}})[_0x105b('0x14')](function(_0x43a46f){logger[_0x105b('0x10')](_0x105b('0xc'),_0x55315c,_0x43a46f);_0x5b8d92(_0x43a46f);});});}exports['UpdateMailApplication']=function(_0x41ca53){var _0x197bf2=this;return new Promise(function(_0x423e4f,_0x5e555c){return db[_0x105b('0x15')]['update'](_0x41ca53[_0x105b('0x16')],{'raw':_0x41ca53[_0x105b('0x17')]?_0x41ca53['options'][_0x105b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41ca53[_0x105b('0x17')]?_0x41ca53['options']['where']||null:null,'attributes':_0x41ca53[_0x105b('0x17')]?_0x41ca53[_0x105b('0x17')][_0x105b('0x19')]||null:null,'limit':_0x41ca53['options']?_0x41ca53[_0x105b('0x17')]['limit']||null:null})[_0x105b('0xa')](function(_0x2ab97f){logger[_0x105b('0xb')](_0x105b('0x1a'),_0x41ca53);logger[_0x105b('0x1b')](_0x105b('0x1a'),_0x41ca53,JSON[_0x105b('0xf')](_0x2ab97f));_0x423e4f(_0x2ab97f);})['catch'](function(_0x256219){logger[_0x105b('0x10')](_0x105b('0x1a'),_0x256219[_0x105b('0x12')],_0x41ca53);_0x5e555c(_0x197bf2[_0x105b('0x10')](0x1f4,_0x256219[_0x105b('0x12')]));});});}; \ No newline at end of file +var _0xade9=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3caf1e,_0x2c3aae){var _0x61cbe9=function(_0x14c997){while(--_0x14c997){_0x3caf1e['push'](_0x3caf1e['shift']());}};_0x61cbe9(++_0x2c3aae);}(_0xade9,0x1e7));var _0x9ade=function(_0x20952d,_0x4eddd5){_0x20952d=_0x20952d-0x0;var _0x3b24d5=_0xade9[_0x20952d];return _0x3b24d5;};'use strict';var _=require('lodash');var util=require(_0x9ade('0x0'));var moment=require(_0x9ade('0x1'));var BPromise=require(_0x9ade('0x2'));var rs=require(_0x9ade('0x3'));var fs=require('fs');var Redis=require(_0x9ade('0x4'));var db=require(_0x9ade('0x5'))['db'];var utils=require(_0x9ade('0x6'));var logger=require(_0x9ade('0x7'))('rpc');var config=require(_0x9ade('0x8'));var jayson=require(_0x9ade('0x9'));var client=jayson['client'][_0x9ade('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3840d,_0x48974f,_0x37f58a){return new BPromise(function(_0x38bbe5,_0x3c00ba){return client['request'](_0xc3840d,_0x37f58a)[_0x9ade('0xb')](function(_0x579ac5){logger[_0x9ade('0xc')]('MailApplication,\x20%s,\x20%s',_0x48974f,_0x9ade('0xd'));logger[_0x9ade('0xe')](_0x9ade('0xf'),_0x48974f,'request\x20sent',JSON[_0x9ade('0x10')](_0x579ac5));if(_0x579ac5[_0x9ade('0x11')]){if(_0x579ac5[_0x9ade('0x11')][_0x9ade('0x12')]===0x1f4){logger['error'](_0x9ade('0x13'),_0x48974f,_0x579ac5[_0x9ade('0x11')][_0x9ade('0x14')]);return _0x3c00ba(_0x579ac5[_0x9ade('0x11')][_0x9ade('0x14')]);}logger['error'](_0x9ade('0x13'),_0x48974f,_0x579ac5['error'][_0x9ade('0x14')]);return _0x38bbe5(_0x579ac5[_0x9ade('0x11')]['message']);}else{logger[_0x9ade('0xc')](_0x9ade('0x13'),_0x48974f,_0x9ade('0xd'));_0x38bbe5(_0x579ac5['result'][_0x9ade('0x14')]);}})[_0x9ade('0x15')](function(_0x1dd072){logger['error'](_0x9ade('0x13'),_0x48974f,_0x1dd072);_0x3c00ba(_0x1dd072);});});}exports[_0x9ade('0x16')]=function(_0x266d6f){var _0x5b29b8=this;return new Promise(function(_0x363156,_0x3b6aa6){return db[_0x9ade('0x17')][_0x9ade('0x18')](_0x266d6f[_0x9ade('0x19')],{'raw':_0x266d6f[_0x9ade('0x1a')]?_0x266d6f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x266d6f['options']?_0x266d6f[_0x9ade('0x1a')][_0x9ade('0x1b')]||null:null,'attributes':_0x266d6f[_0x9ade('0x1a')]?_0x266d6f[_0x9ade('0x1a')][_0x9ade('0x1c')]||null:null,'limit':_0x266d6f[_0x9ade('0x1a')]?_0x266d6f[_0x9ade('0x1a')]['limit']||null:null})['then'](function(_0xcb32be){logger['info'](_0x9ade('0x16'),_0x266d6f);logger[_0x9ade('0xe')](_0x9ade('0x16'),_0x266d6f,JSON['stringify'](_0xcb32be));_0x363156(_0xcb32be);})[_0x9ade('0x15')](function(_0xda4ff8){logger['error'](_0x9ade('0x16'),_0xda4ff8[_0x9ade('0x14')],_0x266d6f);_0x3b6aa6(_0x5b29b8[_0x9ade('0x11')](0x1f4,_0xda4ff8[_0x9ade('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9f26d75..5b527a4 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 _0x2599=['destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','mailinteraction:addtags','addTags','put','tracked','mail','update','delete'];(function(_0x4663cf,_0x4045b2){var _0x5e7f76=function(_0x1e01ae){while(--_0x1e01ae){_0x4663cf['push'](_0x4663cf['shift']());}};_0x5e7f76(++_0x4045b2);}(_0x2599,0xc7));var _0x9259=function(_0x163530,_0x50c8a7){_0x163530=_0x163530-0x0;var _0x15df78=_0x2599[_0x163530];return _0x15df78;};'use strict';var express=require(_0x9259('0x0'));var router=express[_0x9259('0x1')]();var auth=require(_0x9259('0x2'));var interaction=require(_0x9259('0x3'));var controller=require(_0x9259('0x4'));router[_0x9259('0x5')]('/',auth[_0x9259('0x6')](),controller[_0x9259('0x7')]);router['get'](_0x9259('0x8'),auth[_0x9259('0x6')](),controller[_0x9259('0x9')]);router[_0x9259('0x5')](_0x9259('0xa'),auth[_0x9259('0x6')](),controller[_0x9259('0xb')]);router['get'](_0x9259('0xc'),auth[_0x9259('0x6')](),controller[_0x9259('0xd')]);router[_0x9259('0x5')](_0x9259('0xe'),auth[_0x9259('0x6')](),controller['download']);router[_0x9259('0xf')]('/',auth[_0x9259('0x6')](),controller[_0x9259('0x10')]);router[_0x9259('0xf')](_0x9259('0xc'),auth[_0x9259('0x6')](),controller[_0x9259('0x11')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('mail',_0x9259('0x12')),controller[_0x9259('0x13')]);router[_0x9259('0x14')](_0x9259('0xa'),auth['isAuthenticated'](),interaction[_0x9259('0x15')](_0x9259('0x16'),'mailinteraction:update'),controller[_0x9259('0x17')]);router[_0x9259('0x18')](_0x9259('0xa'),auth['isAuthenticated'](),interaction[_0x9259('0x15')](_0x9259('0x16'),'mailinteraction:destroy'),controller[_0x9259('0x19')]);router[_0x9259('0x18')]('/:id/tags',auth[_0x9259('0x6')](),controller[_0x9259('0x1a')]);module[_0x9259('0x1b')]=router; \ No newline at end of file +var _0x7c68=['show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','./mailInteraction.controller','isAuthenticated','index','get','describe'];(function(_0x29b5ce,_0x15d3e1){var _0x2d8cfb=function(_0x29ca38){while(--_0x29ca38){_0x29b5ce['push'](_0x29b5ce['shift']());}};_0x2d8cfb(++_0x15d3e1);}(_0x7c68,0x189));var _0x87c6=function(_0x358c14,_0x180d69){_0x358c14=_0x358c14-0x0;var _0x207415=_0x7c68[_0x358c14];return _0x207415;};'use strict';var express=require(_0x87c6('0x0'));var router=express[_0x87c6('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x87c6('0x2'));router['get']('/',auth[_0x87c6('0x3')](),controller[_0x87c6('0x4')]);router[_0x87c6('0x5')]('/describe',auth[_0x87c6('0x3')](),controller[_0x87c6('0x6')]);router[_0x87c6('0x5')]('/:id',auth[_0x87c6('0x3')](),controller[_0x87c6('0x7')]);router[_0x87c6('0x5')](_0x87c6('0x8'),auth[_0x87c6('0x3')](),controller[_0x87c6('0x9')]);router[_0x87c6('0x5')](_0x87c6('0xa'),auth[_0x87c6('0x3')](),controller[_0x87c6('0xb')]);router[_0x87c6('0xc')]('/',auth[_0x87c6('0x3')](),controller[_0x87c6('0xd')]);router['post'](_0x87c6('0x8'),auth[_0x87c6('0x3')](),controller[_0x87c6('0xe')]);router['post'](_0x87c6('0xf'),auth[_0x87c6('0x3')](),interaction[_0x87c6('0x10')](_0x87c6('0x11'),'mailinteraction:addtags'),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x87c6('0x11'),_0x87c6('0x12')),controller[_0x87c6('0x13')]);router[_0x87c6('0x14')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x87c6('0x11'),_0x87c6('0x15')),controller[_0x87c6('0x16')]);router[_0x87c6('0x14')](_0x87c6('0xf'),auth[_0x87c6('0x3')](),controller[_0x87c6('0x17')]);module[_0x87c6('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 c97756f..65dab7c 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 _0x65ff=['STRING','long','DATE','ENUM','out','iconv','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65ff,0x1dd));var _0xf65f=function(_0x24c178,_0x2e588b){_0x24c178=_0x24c178-0x0;var _0x35a2d8=_0x65ff[_0x24c178];return _0x35a2d8;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf65f('0x0'));module[_0xf65f('0x1')]={'closed':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf65f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf65f('0x3')]},'note':{'type':Sequelize[_0xf65f('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf65f('0x3')]},'cc':{'type':Sequelize['TEXT'](_0xf65f('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf65f('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf65f('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xf65f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf65f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf65f('0x6')]('in',_0xf65f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x163b=['DATE','ENUM','out','BOOLEAN','sequelize','iconv','exports','STRING','TEXT'];(function(_0x2bc8b4,_0x35cc1b){var _0x24c2bb=function(_0x2bea18){while(--_0x2bea18){_0x2bc8b4['push'](_0x2bc8b4['shift']());}};_0x24c2bb(++_0x35cc1b);}(_0x163b,0x175));var _0xb163=function(_0x27835f,_0x43d12c){_0x27835f=_0x27835f-0x0;var _0x497014=_0x163b[_0x27835f];return _0x497014;};'use strict';var Sequelize=require(_0xb163('0x0'));var iconv=require(_0xb163('0x1'));module[_0xb163('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb163('0x3')]},'secondDisposition':{'type':Sequelize[_0xb163('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb163('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xb163('0x3')]},'cc':{'type':Sequelize[_0xb163('0x4')]('long')},'subject':{'type':Sequelize[_0xb163('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb163('0x5')]},'substatus':{'type':Sequelize[_0xb163('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xb163('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xb163('0x6')]('in',_0xb163('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb163('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xb163('0x6')]('in',_0xb163('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb163('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 24892c1..2998b60 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 _0x12d3=['destroy','error','stack','name','send','fieldName','type','key','getOptions','mail','query','user','catch','show','params','model','keys','MailInteraction','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','filters','intersection','nolimit','order','sort','where','pick','MailInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','root','server','tmp','join','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','from','bcc','subject','createdAt','Messages','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','writeFileSync','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','update','then'];(function(_0x4f7103,_0xb22e71){var _0x269a36=function(_0x450117){while(--_0x450117){_0x4f7103['push'](_0x4f7103['shift']());}};_0x269a36(++_0xb22e71);}(_0x12d3,0xca));var _0x312d=function(_0x2111f5,_0x1e707a){_0x2111f5=_0x2111f5-0x0;var _0x5c0bdc=_0x12d3[_0x2111f5];return _0x5c0bdc;};'use strict';var emlformat=require(_0x312d('0x0'));var rimraf=require(_0x312d('0x1'));var zipdir=require(_0x312d('0x2'));var moment=require(_0x312d('0x3'));var BPromise=require(_0x312d('0x4'));var util=require(_0x312d('0x5'));var path=require(_0x312d('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x312d('0x7'));var Redis=require(_0x312d('0x8'));var interaction=require(_0x312d('0x9'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x312d('0xa'));var db=require(_0x312d('0xb'))['db'];var htmlEntities=require(_0x312d('0xc'));config[_0x312d('0xd')]=_[_0x312d('0xe')](config[_0x312d('0xd')],{'host':_0x312d('0xf'),'port':0x18eb});var socket=require(_0x312d('0x10'))(new Redis(config[_0x312d('0xd')]));require(_0x312d('0x11'))['register'](socket);function respondWithStatusCode(_0x24c8c4,_0x28c974){_0x28c974=_0x28c974||0xcc;return function(_0x191084){if(_0x191084){return _0x24c8c4[_0x312d('0x12')](_0x28c974);}return _0x24c8c4['status'](_0x28c974)[_0x312d('0x13')]();};}function respondWithResult(_0x4959f3,_0x4f1cf1){_0x4f1cf1=_0x4f1cf1||0xc8;return function(_0x39c935){if(_0x39c935){return _0x4959f3['status'](_0x4f1cf1)[_0x312d('0x14')](_0x39c935);}};}function respondWithFilteredResult(_0x37b126,_0x1d2c7d){return function(_0xc66400){if(_0xc66400){var _0xaa83e2=typeof _0x1d2c7d[_0x312d('0x15')]==='undefined'&&typeof _0x1d2c7d[_0x312d('0x16')]===_0x312d('0x17');var _0x562f19=_0xc66400[_0x312d('0x18')];var _0x12ce76=_0xaa83e2?0x0:_0x1d2c7d['offset'];var _0x47ceea=_0xaa83e2?_0xc66400['count']:_0x1d2c7d[_0x312d('0x15')]+_0x1d2c7d[_0x312d('0x16')];var _0x474118;if(_0x47ceea>=_0x562f19){_0x47ceea=_0x562f19;_0x474118=0xc8;}else{_0x474118=0xce;}_0x37b126[_0x312d('0x19')](_0x474118);return _0x37b126[_0x312d('0x1a')](_0x312d('0x1b'),_0x12ce76+'-'+_0x47ceea+'/'+_0x562f19)['json'](_0xc66400);}return null;};}function saveUpdates(_0x5569ed){return function(_0x34eef3){if(_0x34eef3){return _0x34eef3[_0x312d('0x1c')](_0x5569ed)[_0x312d('0x1d')](function(_0x42d418){return _0x42d418;});}return null;};}function removeEntity(_0x180c28){return function(_0x256253){if(_0x256253){return _0x256253[_0x312d('0x1e')]()[_0x312d('0x1d')](function(){_0x180c28['status'](0xcc)[_0x312d('0x13')]();});}};}function handleEntityNotFound(_0x4a1d82){return function(_0x24081a){if(!_0x24081a){_0x4a1d82[_0x312d('0x12')](0x194);}return _0x24081a;};}function handleError(_0x20fa79,_0x3febac){_0x3febac=_0x3febac||0x1f4;return function(_0x549f7f){logger[_0x312d('0x1f')](_0x549f7f[_0x312d('0x20')]);if(_0x549f7f[_0x312d('0x21')]){delete _0x549f7f[_0x312d('0x21')];}_0x20fa79[_0x312d('0x19')](_0x3febac)[_0x312d('0x22')](_0x549f7f);};}exports['index']=function(_0xc2cde9,_0xf97a9a){var _0x1cbdf6={};var _0x1fff8b=_['map'](db['MailInteraction']['rawAttributes'],function(_0x1090ff){return{'name':_0x1090ff[_0x312d('0x23')],'type':_0x1090ff[_0x312d('0x24')][_0x312d('0x25')]};});_0x1cbdf6=qs[_0x312d('0x26')](_0x1fff8b,_0xc2cde9);return interaction['findAll'](_0x312d('0x27'),_0xc2cde9[_0x312d('0x28')],_0xc2cde9[_0x312d('0x29')],_0x1cbdf6,_0x1fff8b)['then'](respondWithFilteredResult(_0xf97a9a,_0x1cbdf6))[_0x312d('0x2a')](handleError(_0xf97a9a,null));};exports[_0x312d('0x2b')]=function(_0x452a5c,_0x9c9796){var _0x1ed3fc={'raw':![],'where':{'id':_0x452a5c[_0x312d('0x2c')]['id']}},_0xb74adb={};_0xb74adb[_0x312d('0x2d')]=_[_0x312d('0x2e')](db[_0x312d('0x2f')]['rawAttributes']);_0xb74adb[_0x312d('0x28')]=_[_0x312d('0x2e')](_0x452a5c[_0x312d('0x28')]);_0xb74adb['filters']=_['intersection'](_0xb74adb[_0x312d('0x2d')],_0xb74adb[_0x312d('0x28')]);_0x1ed3fc[_0x312d('0x30')]=_['intersection'](_0xb74adb[_0x312d('0x2d')],qs[_0x312d('0x31')](_0x452a5c['query'][_0x312d('0x31')]));_0x1ed3fc[_0x312d('0x30')]=_0x1ed3fc[_0x312d('0x30')][_0x312d('0x32')]?_0x1ed3fc[_0x312d('0x30')]:_0xb74adb[_0x312d('0x2d')];if(_0x452a5c[_0x312d('0x28')][_0x312d('0x33')]){_0x1ed3fc[_0x312d('0x34')]=[{'all':!![]}];}_0x1ed3fc=_[_0x312d('0x35')]({},_0x1ed3fc,_0x452a5c[_0x312d('0x36')]);return db[_0x312d('0x2f')][_0x312d('0x37')](_0x1ed3fc)[_0x312d('0x1d')](handleEntityNotFound(_0x9c9796,null))['then'](respondWithResult(_0x9c9796,null))[_0x312d('0x2a')](handleError(_0x9c9796,null));};exports[_0x312d('0x38')]=function(_0x23f85b,_0x102f07){return db['MailInteraction'][_0x312d('0x38')](_0x23f85b['body'],{})['then'](respondWithResult(_0x102f07,0xc9))[_0x312d('0x2a')](handleError(_0x102f07,null));};exports['update']=function(_0x3f7aef,_0x4533fc){if(_0x3f7aef[_0x312d('0x39')]['id']){delete _0x3f7aef[_0x312d('0x39')]['id'];}return db['MailInteraction'][_0x312d('0x37')]({'where':{'id':_0x3f7aef[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x4533fc,null))[_0x312d('0x1d')](saveUpdates(_0x3f7aef['body'],null))[_0x312d('0x1d')](respondWithResult(_0x4533fc,null))['catch'](handleError(_0x4533fc,null));};exports[_0x312d('0x1e')]=function(_0x4448fe,_0x2ab1a5){return db[_0x312d('0x2f')]['find']({'where':{'id':_0x4448fe['params']['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x2ab1a5,null))[_0x312d('0x1d')](removeEntity(_0x2ab1a5,null))[_0x312d('0x2a')](handleError(_0x2ab1a5,null));};exports[_0x312d('0x3a')]=function(_0x369155,_0x1958aa){return db[_0x312d('0x2f')][_0x312d('0x3a')]()['then'](respondWithResult(_0x1958aa,null))[_0x312d('0x2a')](handleError(_0x1958aa,null));};exports[_0x312d('0x3b')]=function(_0x2b9a0b,_0x54ec96){return db[_0x312d('0x3c')][_0x312d('0x37')]({'where':{'id':_0x2b9a0b[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x54ec96,null))['then'](function(_0xba69ec){if(_0xba69ec){return _0xba69ec['addMessage'](_0x2b9a0b[_0x312d('0x39')]['ids'],_[_0x312d('0x3d')](_0x2b9a0b[_0x312d('0x39')],[_0x312d('0x3e'),'id'])||{});}})[_0x312d('0x1d')](respondWithResult(_0x54ec96,null))[_0x312d('0x2a')](handleError(_0x54ec96,null));};exports[_0x312d('0x3f')]=function(_0x55cc42,_0x3013c0){var _0x52869c={'raw':![],'where':{}};var _0x1e3542={};var _0x495c29={'count':0x0,'rows':[]};return db['MailInteraction'][_0x312d('0x40')]({'where':{'id':_0x55cc42[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x3013c0,null))[_0x312d('0x1d')](function(_0xeb7f6){if(_0xeb7f6){_0x1e3542[_0x312d('0x2d')]=_['keys'](db[_0x312d('0x3c')]['rawAttributes']);_0x1e3542[_0x312d('0x28')]=_[_0x312d('0x2e')](_0x55cc42[_0x312d('0x28')]);_0x1e3542[_0x312d('0x41')]=_[_0x312d('0x42')](_0x1e3542[_0x312d('0x2d')],_0x1e3542[_0x312d('0x28')]);_0x52869c[_0x312d('0x30')]=_[_0x312d('0x42')](_0x1e3542[_0x312d('0x2d')],qs[_0x312d('0x31')](_0x55cc42[_0x312d('0x28')][_0x312d('0x31')]));_0x52869c[_0x312d('0x30')]=_0x52869c[_0x312d('0x30')][_0x312d('0x32')]?_0x52869c[_0x312d('0x30')]:_0x1e3542[_0x312d('0x2d')];if(!_0x55cc42[_0x312d('0x28')]['hasOwnProperty'](_0x312d('0x43'))){_0x52869c[_0x312d('0x16')]=qs['limit'](_0x55cc42[_0x312d('0x28')]['limit']);_0x52869c[_0x312d('0x15')]=qs[_0x312d('0x15')](_0x55cc42[_0x312d('0x28')]['offset']);}_0x52869c[_0x312d('0x44')]=qs[_0x312d('0x45')](_0x55cc42[_0x312d('0x28')][_0x312d('0x45')]);_0x52869c[_0x312d('0x46')]=qs['filters'](_[_0x312d('0x47')](_0x55cc42[_0x312d('0x28')],_0x1e3542['filters']));_0x52869c[_0x312d('0x46')][_0x312d('0x48')]=_0xeb7f6['id'];if(_0x55cc42[_0x312d('0x28')][_0x312d('0x49')]){_0x52869c[_0x312d('0x46')]=_['merge'](_0x52869c[_0x312d('0x46')],{'$or':_['map'](_0x52869c[_0x312d('0x30')],function(_0x4eb5b6){var _0x5da70a={};_0x5da70a[_0x4eb5b6]={'$like':'%'+_0x55cc42[_0x312d('0x28')][_0x312d('0x49')]+'%'};return _0x5da70a;})});}if(_0x55cc42[_0x312d('0x28')]['$gte']){var _0x310e33=_0x55cc42[_0x312d('0x28')]['$gte'][_0x312d('0x4a')](',');var _0x586474={};_0x586474[_0x310e33[0x0]]={'$gte':moment(_0x310e33[0x1])['format'](_0x312d('0x4b'))};_0x52869c[_0x312d('0x46')]=_[_0x312d('0x35')](_0x52869c[_0x312d('0x46')],_0x586474);}_0x52869c=_[_0x312d('0x35')]({},_0x52869c,_0x55cc42[_0x312d('0x36')]);return db[_0x312d('0x3c')][_0x312d('0x18')]({'where':_0x52869c[_0x312d('0x46')]})[_0x312d('0x1d')](function(_0xcd58e6){_0x495c29['count']=_0xcd58e6;if(_0x55cc42['query'][_0x312d('0x33')]){_0x52869c['include']=[{'all':!![]}];}return db[_0x312d('0x3c')][_0x312d('0x4c')](_0x52869c);})[_0x312d('0x1d')](function(_0x48c179){if(_0x55cc42[_0x312d('0x28')][_0x312d('0x4d')]===_0x312d('0x4e')){for(var _0x2d4aab=0x0;_0x2d4aab<_0x48c179[_0x312d('0x32')];_0x2d4aab++){_0x48c179[_0x2d4aab]['body']=juice(_0x48c179[_0x2d4aab][_0x312d('0x39')]);}}_0x495c29[_0x312d('0x4f')]=_0x48c179;return _0x495c29;});}})[_0x312d('0x1d')](respondWithFilteredResult(_0x3013c0,_0x52869c))[_0x312d('0x2a')](handleError(_0x3013c0,null));};exports[_0x312d('0x50')]=function(_0x3feee1,_0x4e99ac){return db[_0x312d('0x2f')][_0x312d('0x37')]({'where':{'id':_0x3feee1[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x4e99ac,null))[_0x312d('0x1d')](function(_0x8c17e1){if(_0x8c17e1){return _0x8c17e1[_0x312d('0x51')](_0x3feee1[_0x312d('0x39')][_0x312d('0x3e')],_['omit'](_0x3feee1[_0x312d('0x39')],[_0x312d('0x3e'),'id'])||{})[_0x312d('0x52')](function(){return db[_0x312d('0x53')]['findAll']({'attributes':['id','name',_0x312d('0x54')],'where':{'id':_0x3feee1[_0x312d('0x39')]['ids']}});})[_0x312d('0x1d')](function(_0xbad5b3){socket[_0x312d('0x55')](_0x312d('0x56'),{'id':Number(_0x3feee1[_0x312d('0x2c')]['id']),'tags':_0xbad5b3||[]});return{'id':Number(_0x3feee1['params']['id']),'tags':_0xbad5b3||[]};});}})['then'](respondWithResult(_0x4e99ac,null))[_0x312d('0x2a')](handleError(_0x4e99ac,null));};exports[_0x312d('0x57')]=function(_0x56a4c1,_0x23ae19){return db[_0x312d('0x2f')][_0x312d('0x37')]({'where':{'id':_0x56a4c1['params']['id']}})['then'](handleEntityNotFound(_0x23ae19,null))[_0x312d('0x1d')](function(_0x15883e){if(_0x15883e){return _0x15883e[_0x312d('0x57')](_0x56a4c1[_0x312d('0x28')][_0x312d('0x3e')]);}})[_0x312d('0x1d')](respondWithStatusCode(_0x23ae19,null))[_0x312d('0x2a')](handleError(_0x23ae19,null));};exports['download']=function(_0xe4b968,_0x1d46f4){var _0x37cf45=moment()[_0x312d('0x58')]()[_0x312d('0x59')]();var _0x34b768=path['join'](config[_0x312d('0x5a')],_0x312d('0x5b'),'files',_0x312d('0x5c'));var _0xd2a695=path[_0x312d('0x5d')](config[_0x312d('0x5a')],_0x312d('0x5b'),_0x312d('0x5e'),_0x312d('0x5f'));var _0x4d559b=path[_0x312d('0x5d')](_0x34b768,_0x37cf45);var _0x243ffc=util[_0x312d('0x60')](_0x312d('0x61'),_0xe4b968[_0x312d('0x2c')]['id'],_0x37cf45);var _0x3d4864=path[_0x312d('0x5d')](_0x34b768,_0x243ffc);var _0x4b6cb6=[];if(_0xe4b968[_0x312d('0x28')][_0x312d('0x5f')]){_0x4b6cb6['push']({'model':db[_0x312d('0x62')],'as':_0x312d('0x63'),'raw':!![]});}var _0x18bb1f=[{'model':db[_0x312d('0x3c')],'as':'Messages','attributes':['id',_0x312d('0x39'),_0x312d('0x64'),'to','cc',_0x312d('0x65'),_0x312d('0x66'),_0x312d('0x67')],'where':{'secret':![]},'order':qs[_0x312d('0x45')]('id'),'include':_0x4b6cb6}];return db['MailInteraction'][_0x312d('0x37')]({'where':{'id':_0xe4b968[_0x312d('0x2c')]['id']},'include':_0x18bb1f})[_0x312d('0x1d')](handleEntityNotFound(_0x1d46f4,null))[_0x312d('0x1d')](function(_0x32d983){if(_0x32d983&&_0x32d983[_0x312d('0x68')]){var _0x1ac414=_0x32d983[_0x312d('0x69')]({'plain':!![]});fs['mkdirSync'](_0x4d559b);return BPromise[_0x312d('0x6a')](_0x1ac414[_0x312d('0x68')],function(_0x2054c5,_0x1a0fac){var _0x483f36={'from':_0x2054c5[_0x312d('0x64')],'to':_0x2054c5['to']||'missing.recipient@your.company.com','subject':_0x2054c5[_0x312d('0x66')],'html':htmlEntities[_0x312d('0x6b')](_0x2054c5['body']),'headers':{'Date':moment(_0x2054c5['createdAt'])[_0x312d('0x60')](_0x312d('0x6c'))},'attachments':[]};if(_0x2054c5['cc']){_0x483f36[_0x312d('0x6d')]['Cc']=_0x2054c5['cc'];}if(_0x2054c5[_0x312d('0x65')]){_0x483f36[_0x312d('0x6d')][_0x312d('0x6e')]=_0x2054c5['bcc'];}return new BPromise(function(_0x289fb3,_0x26970d){if(_0x2054c5[_0x312d('0x63')]){for(var _0x4ce131=0x0;_0x4ce131<_0x2054c5[_0x312d('0x63')][_0x312d('0x32')];_0x4ce131++){var _0x559d81=_0x2054c5[_0x312d('0x63')][_0x4ce131];var _0x240171=path[_0x312d('0x5d')](_0xd2a695,_0x559d81[_0x312d('0x6f')]);if(fs[_0x312d('0x70')](_0x240171)){_0x483f36[_0x312d('0x5f')]['push']({'name':_0x559d81[_0x312d('0x21')],'contentType':_0x559d81['type'],'data':fs['readFileSync'](_0x240171)});}}}emlformat['build'](_0x483f36,function(_0x1831fc,_0x2ec9f0){if(_0x1831fc)return _0x26970d(_0x1831fc);fs[_0x312d('0x71')](path[_0x312d('0x5d')](_0x4d559b,util[_0x312d('0x60')]('message%d.eml',_0x1a0fac)),_0x2ec9f0);return _0x289fb3(_0x2ec9f0);});});})[_0x312d('0x1d')](function(){return new BPromise(function(_0x2190f4,_0x1253f9){zipdir(_0x4d559b,{'saveTo':_0x3d4864},function(_0x29048d,_0x231ce3){if(_0x29048d)return _0x1253f9(_0x29048d);return _0x2190f4(_0x231ce3);});})[_0x312d('0x1d')](function(){return new BPromise(function(_0x41e06f,_0x2291d5){rimraf(_0x4d559b,function(_0x504d96){if(_0x504d96)_0x2291d5(_0x504d96);return _0x41e06f();});});})['then'](function(){return _0x1d46f4[_0x312d('0x72')](_0x3d4864,_0x243ffc,function(_0x1ff52b){if(!_0x1ff52b)fs[_0x312d('0x73')](_0x3d4864);});});});}else{return _0x1d46f4[_0x312d('0x12')](0xc8);}})[_0x312d('0x2a')](handleError(_0x1d46f4,null));}; \ No newline at end of file +var _0x9ad7=['html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','then','destroy','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','include','merge','options','find','catch','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','Attachments','from','bcc','subject','createdAt','get','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb'];(function(_0x5ebad3,_0x1fad92){var _0x3719e6=function(_0x398a9){while(--_0x398a9){_0x5ebad3['push'](_0x5ebad3['shift']());}};_0x3719e6(++_0x1fad92);}(_0x9ad7,0x153));var _0x79ad=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9ad7[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x79ad('0x0'));var rimraf=require(_0x79ad('0x1'));var zipdir=require('zip-dir');var moment=require(_0x79ad('0x2'));var BPromise=require(_0x79ad('0x3'));var util=require(_0x79ad('0x4'));var path=require(_0x79ad('0x5'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x79ad('0x6'));var interaction=require(_0x79ad('0x7'));var qs=require(_0x79ad('0x8'));var logger=require(_0x79ad('0x9'))(_0x79ad('0xa'));var config=require('../../config/environment');var db=require(_0x79ad('0xb'))['db'];var htmlEntities=require(_0x79ad('0xc'));config[_0x79ad('0xd')]=_[_0x79ad('0xe')](config['redis'],{'host':_0x79ad('0xf'),'port':0x18eb});var socket=require(_0x79ad('0x10'))(new Redis(config[_0x79ad('0xd')]));require('./mailInteraction.socket')[_0x79ad('0x11')](socket);function respondWithStatusCode(_0x5c24ec,_0x4d2090){_0x4d2090=_0x4d2090||0xcc;return function(_0x3d6d45){if(_0x3d6d45){return _0x5c24ec[_0x79ad('0x12')](_0x4d2090);}return _0x5c24ec[_0x79ad('0x13')](_0x4d2090)[_0x79ad('0x14')]();};}function respondWithResult(_0x3664b0,_0x1b8037){_0x1b8037=_0x1b8037||0xc8;return function(_0x570541){if(_0x570541){return _0x3664b0[_0x79ad('0x13')](_0x1b8037)[_0x79ad('0x15')](_0x570541);}};}function respondWithFilteredResult(_0x3e7644,_0x3cee91){return function(_0x22e734){if(_0x22e734){var _0x3b0f96=typeof _0x3cee91[_0x79ad('0x16')]===_0x79ad('0x17')&&typeof _0x3cee91[_0x79ad('0x18')]===_0x79ad('0x17');var _0xc71289=_0x22e734['count'];var _0x3b1d1d=_0x3b0f96?0x0:_0x3cee91[_0x79ad('0x16')];var _0x37be69=_0x3b0f96?_0x22e734[_0x79ad('0x19')]:_0x3cee91[_0x79ad('0x16')]+_0x3cee91[_0x79ad('0x18')];var _0x41c718;if(_0x37be69>=_0xc71289){_0x37be69=_0xc71289;_0x41c718=0xc8;}else{_0x41c718=0xce;}_0x3e7644[_0x79ad('0x13')](_0x41c718);return _0x3e7644[_0x79ad('0x1a')]('Content-Range',_0x3b1d1d+'-'+_0x37be69+'/'+_0xc71289)[_0x79ad('0x15')](_0x22e734);}return null;};}function saveUpdates(_0x35a873){return function(_0xf929b8){if(_0xf929b8){return _0xf929b8['update'](_0x35a873)[_0x79ad('0x1b')](function(_0x4a6490){return _0x4a6490;});}return null;};}function removeEntity(_0x3ac508){return function(_0x3b0a05){if(_0x3b0a05){return _0x3b0a05[_0x79ad('0x1c')]()[_0x79ad('0x1b')](function(){_0x3ac508[_0x79ad('0x13')](0xcc)[_0x79ad('0x14')]();});}};}function handleEntityNotFound(_0x3daed1){return function(_0x15f2c8){if(!_0x15f2c8){_0x3daed1[_0x79ad('0x12')](0x194);}return _0x15f2c8;};}function handleError(_0x52f55c,_0x32e746){_0x32e746=_0x32e746||0x1f4;return function(_0xf32f73){logger[_0x79ad('0x1d')](_0xf32f73[_0x79ad('0x1e')]);if(_0xf32f73[_0x79ad('0x1f')]){delete _0xf32f73[_0x79ad('0x1f')];}_0x52f55c['status'](_0x32e746)[_0x79ad('0x20')](_0xf32f73);};}exports[_0x79ad('0x21')]=function(_0x58cbf2,_0x44b60c){var _0x43d3c2={};var _0x125e8e=_[_0x79ad('0x22')](db[_0x79ad('0x23')][_0x79ad('0x24')],function(_0x47e807){return{'name':_0x47e807[_0x79ad('0x25')],'type':_0x47e807[_0x79ad('0x26')][_0x79ad('0x27')]};});_0x43d3c2=qs[_0x79ad('0x28')](_0x125e8e,_0x58cbf2);return interaction[_0x79ad('0x29')](_0x79ad('0x2a'),_0x58cbf2[_0x79ad('0x2b')],_0x58cbf2[_0x79ad('0x2c')],_0x43d3c2,_0x125e8e)[_0x79ad('0x1b')](respondWithFilteredResult(_0x44b60c,_0x43d3c2))['catch'](handleError(_0x44b60c,null));};exports[_0x79ad('0x2d')]=function(_0x4d182f,_0x28d130){var _0xdcee08={'raw':![],'where':{'id':_0x4d182f[_0x79ad('0x2e')]['id']}},_0x49e306={};_0x49e306['model']=_[_0x79ad('0x2f')](db[_0x79ad('0x23')]['rawAttributes']);_0x49e306[_0x79ad('0x2b')]=_['keys'](_0x4d182f[_0x79ad('0x2b')]);_0x49e306[_0x79ad('0x30')]=_[_0x79ad('0x31')](_0x49e306[_0x79ad('0x32')],_0x49e306['query']);_0xdcee08[_0x79ad('0x33')]=_[_0x79ad('0x31')](_0x49e306[_0x79ad('0x32')],qs[_0x79ad('0x34')](_0x4d182f[_0x79ad('0x2b')]['fields']));_0xdcee08[_0x79ad('0x33')]=_0xdcee08[_0x79ad('0x33')][_0x79ad('0x35')]?_0xdcee08[_0x79ad('0x33')]:_0x49e306['model'];if(_0x4d182f['query']['includeAll']){_0xdcee08[_0x79ad('0x36')]=[{'all':!![]}];}_0xdcee08=_[_0x79ad('0x37')]({},_0xdcee08,_0x4d182f[_0x79ad('0x38')]);return db[_0x79ad('0x23')][_0x79ad('0x39')](_0xdcee08)['then'](handleEntityNotFound(_0x28d130,null))[_0x79ad('0x1b')](respondWithResult(_0x28d130,null))[_0x79ad('0x3a')](handleError(_0x28d130,null));};exports[_0x79ad('0x3b')]=function(_0x27c631,_0x4a9ba8){return db['MailInteraction'][_0x79ad('0x3b')](_0x27c631['body'],{})['then'](respondWithResult(_0x4a9ba8,0xc9))[_0x79ad('0x3a')](handleError(_0x4a9ba8,null));};exports['update']=function(_0x2088fa,_0x20bbf9){if(_0x2088fa[_0x79ad('0x3c')]['id']){delete _0x2088fa['body']['id'];}return db[_0x79ad('0x23')][_0x79ad('0x39')]({'where':{'id':_0x2088fa[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x20bbf9,null))[_0x79ad('0x1b')](saveUpdates(_0x2088fa[_0x79ad('0x3c')],null))[_0x79ad('0x1b')](respondWithResult(_0x20bbf9,null))[_0x79ad('0x3a')](handleError(_0x20bbf9,null));};exports[_0x79ad('0x1c')]=function(_0x451406,_0x36a9b5){return db[_0x79ad('0x23')][_0x79ad('0x39')]({'where':{'id':_0x451406[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x36a9b5,null))[_0x79ad('0x1b')](removeEntity(_0x36a9b5,null))['catch'](handleError(_0x36a9b5,null));};exports[_0x79ad('0x3d')]=function(_0x1505be,_0x3265a0){return db[_0x79ad('0x23')][_0x79ad('0x3d')]()[_0x79ad('0x1b')](respondWithResult(_0x3265a0,null))['catch'](handleError(_0x3265a0,null));};exports[_0x79ad('0x3e')]=function(_0x43bdc0,_0x29dc39){return db[_0x79ad('0x3f')][_0x79ad('0x39')]({'where':{'id':_0x43bdc0[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x29dc39,null))[_0x79ad('0x1b')](function(_0x4b859b){if(_0x4b859b){return _0x4b859b['addMessage'](_0x43bdc0[_0x79ad('0x3c')][_0x79ad('0x40')],_[_0x79ad('0x41')](_0x43bdc0[_0x79ad('0x3c')],[_0x79ad('0x40'),'id'])||{});}})['then'](respondWithResult(_0x29dc39,null))[_0x79ad('0x3a')](handleError(_0x29dc39,null));};exports[_0x79ad('0x42')]=function(_0x57f2da,_0x342877){var _0x1a8962={'raw':![],'where':{}};var _0x5ba179={};var _0x518b7a={'count':0x0,'rows':[]};return db[_0x79ad('0x23')]['findOne']({'where':{'id':_0x57f2da[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x342877,null))[_0x79ad('0x1b')](function(_0x2e41b2){if(_0x2e41b2){_0x5ba179['model']=_[_0x79ad('0x2f')](db[_0x79ad('0x3f')][_0x79ad('0x24')]);_0x5ba179['query']=_[_0x79ad('0x2f')](_0x57f2da[_0x79ad('0x2b')]);_0x5ba179[_0x79ad('0x30')]=_[_0x79ad('0x31')](_0x5ba179[_0x79ad('0x32')],_0x5ba179[_0x79ad('0x2b')]);_0x1a8962[_0x79ad('0x33')]=_[_0x79ad('0x31')](_0x5ba179[_0x79ad('0x32')],qs[_0x79ad('0x34')](_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x34')]));_0x1a8962[_0x79ad('0x33')]=_0x1a8962[_0x79ad('0x33')][_0x79ad('0x35')]?_0x1a8962[_0x79ad('0x33')]:_0x5ba179['model'];if(!_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x43')](_0x79ad('0x44'))){_0x1a8962['limit']=qs[_0x79ad('0x18')](_0x57f2da[_0x79ad('0x2b')]['limit']);_0x1a8962[_0x79ad('0x16')]=qs[_0x79ad('0x16')](_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x16')]);}_0x1a8962[_0x79ad('0x45')]=qs[_0x79ad('0x46')](_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x46')]);_0x1a8962[_0x79ad('0x47')]=qs[_0x79ad('0x30')](_[_0x79ad('0x48')](_0x57f2da[_0x79ad('0x2b')],_0x5ba179['filters']));_0x1a8962['where'][_0x79ad('0x49')]=_0x2e41b2['id'];if(_0x57f2da[_0x79ad('0x2b')]['filter']){_0x1a8962['where']=_[_0x79ad('0x37')](_0x1a8962['where'],{'$or':_[_0x79ad('0x22')](_0x1a8962[_0x79ad('0x33')],function(_0x59e048){var _0x308d86={};_0x308d86[_0x59e048]={'$like':'%'+_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x4a')]+'%'};return _0x308d86;})});}if(_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x4b')]){var _0x4df99c=_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x4b')][_0x79ad('0x4c')](',');var _0x41bfdc={};_0x41bfdc[_0x4df99c[0x0]]={'$gte':moment(_0x4df99c[0x1])[_0x79ad('0x4d')](_0x79ad('0x4e'))};_0x1a8962[_0x79ad('0x47')]=_[_0x79ad('0x37')](_0x1a8962[_0x79ad('0x47')],_0x41bfdc);}_0x1a8962=_[_0x79ad('0x37')]({},_0x1a8962,_0x57f2da[_0x79ad('0x38')]);return db[_0x79ad('0x3f')][_0x79ad('0x19')]({'where':_0x1a8962[_0x79ad('0x47')]})[_0x79ad('0x1b')](function(_0x3e083a){_0x518b7a['count']=_0x3e083a;if(_0x57f2da[_0x79ad('0x2b')][_0x79ad('0x4f')]){_0x1a8962['include']=[{'all':!![]}];}return db[_0x79ad('0x3f')][_0x79ad('0x29')](_0x1a8962);})['then'](function(_0x10cbb9){if(_0x57f2da['query'][_0x79ad('0x50')]===_0x79ad('0x51')){for(var _0x2fb652=0x0;_0x2fb652<_0x10cbb9[_0x79ad('0x35')];_0x2fb652++){_0x10cbb9[_0x2fb652][_0x79ad('0x3c')]=juice(_0x10cbb9[_0x2fb652][_0x79ad('0x3c')]);}}_0x518b7a[_0x79ad('0x52')]=_0x10cbb9;return _0x518b7a;});}})[_0x79ad('0x1b')](respondWithFilteredResult(_0x342877,_0x1a8962))[_0x79ad('0x3a')](handleError(_0x342877,null));};exports[_0x79ad('0x53')]=function(_0x590366,_0x2d9f37){return db[_0x79ad('0x23')][_0x79ad('0x39')]({'where':{'id':_0x590366[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x2d9f37,null))[_0x79ad('0x1b')](function(_0x50c6d3){if(_0x50c6d3){return _0x50c6d3[_0x79ad('0x54')](_0x590366['body'][_0x79ad('0x40')],_[_0x79ad('0x41')](_0x590366['body'],['ids','id'])||{})[_0x79ad('0x55')](function(){return db[_0x79ad('0x56')]['findAll']({'attributes':['id',_0x79ad('0x1f'),_0x79ad('0x57')],'where':{'id':_0x590366['body'][_0x79ad('0x40')]}});})[_0x79ad('0x1b')](function(_0x534091){socket[_0x79ad('0x58')](_0x79ad('0x59'),{'id':Number(_0x590366[_0x79ad('0x2e')]['id']),'tags':_0x534091||[]});return{'id':Number(_0x590366[_0x79ad('0x2e')]['id']),'tags':_0x534091||[]};});}})['then'](respondWithResult(_0x2d9f37,null))[_0x79ad('0x3a')](handleError(_0x2d9f37,null));};exports[_0x79ad('0x5a')]=function(_0x5e5a3e,_0x3d6896){return db['MailInteraction'][_0x79ad('0x39')]({'where':{'id':_0x5e5a3e[_0x79ad('0x2e')]['id']}})[_0x79ad('0x1b')](handleEntityNotFound(_0x3d6896,null))[_0x79ad('0x1b')](function(_0x5a98ed){if(_0x5a98ed){return _0x5a98ed[_0x79ad('0x5a')](_0x5e5a3e[_0x79ad('0x2b')][_0x79ad('0x40')]);}})[_0x79ad('0x1b')](respondWithStatusCode(_0x3d6896,null))[_0x79ad('0x3a')](handleError(_0x3d6896,null));};exports['download']=function(_0x209974,_0xf791a6){var _0x2d0607=moment()['unix']()[_0x79ad('0x5b')]();var _0x5e0820=path['join'](config[_0x79ad('0x5c')],'server',_0x79ad('0x5d'),_0x79ad('0x5e'));var _0xaecc00=path[_0x79ad('0x5f')](config['root'],_0x79ad('0x60'),_0x79ad('0x5d'),_0x79ad('0x61'));var _0x5ad0e4=path[_0x79ad('0x5f')](_0x5e0820,_0x2d0607);var _0x1424cc=util['format'](_0x79ad('0x62'),_0x209974[_0x79ad('0x2e')]['id'],_0x2d0607);var _0x1f5601=path['join'](_0x5e0820,_0x1424cc);var _0x29a928=[];if(_0x209974[_0x79ad('0x2b')][_0x79ad('0x61')]){_0x29a928[_0x79ad('0x63')]({'model':db['Attachment'],'as':_0x79ad('0x64'),'raw':!![]});}var _0x386369=[{'model':db[_0x79ad('0x3f')],'as':'Messages','attributes':['id',_0x79ad('0x3c'),_0x79ad('0x65'),'to','cc',_0x79ad('0x66'),_0x79ad('0x67'),_0x79ad('0x68')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x29a928}];return db[_0x79ad('0x23')]['find']({'where':{'id':_0x209974[_0x79ad('0x2e')]['id']},'include':_0x386369})['then'](handleEntityNotFound(_0xf791a6,null))[_0x79ad('0x1b')](function(_0x558205){if(_0x558205&&_0x558205['Messages']){var _0x2f7d97=_0x558205[_0x79ad('0x69')]({'plain':!![]});fs['mkdirSync'](_0x5ad0e4);return BPromise['each'](_0x2f7d97['Messages'],function(_0x115705,_0x4b28d0){var _0x23269f={'from':_0x115705['from'],'to':_0x115705['to']||_0x79ad('0x6a'),'subject':_0x115705['subject'],'html':htmlEntities['decode'](_0x115705['body']),'headers':{'Date':moment(_0x115705[_0x79ad('0x68')])[_0x79ad('0x4d')](_0x79ad('0x6b'))},'attachments':[]};if(_0x115705['cc']){_0x23269f[_0x79ad('0x6c')]['Cc']=_0x115705['cc'];}if(_0x115705[_0x79ad('0x66')]){_0x23269f[_0x79ad('0x6c')][_0x79ad('0x6d')]=_0x115705[_0x79ad('0x66')];}return new BPromise(function(_0x57330b,_0x18caa3){if(_0x115705['Attachments']){for(var _0x1c6455=0x0;_0x1c6455<_0x115705[_0x79ad('0x64')][_0x79ad('0x35')];_0x1c6455++){var _0x3dc440=_0x115705[_0x79ad('0x64')][_0x1c6455];var _0xdaba2c=path[_0x79ad('0x5f')](_0xaecc00,_0x3dc440['basename']);if(fs[_0x79ad('0x6e')](_0xdaba2c)){_0x23269f[_0x79ad('0x61')][_0x79ad('0x63')]({'name':_0x3dc440[_0x79ad('0x1f')],'contentType':_0x3dc440[_0x79ad('0x26')],'data':fs[_0x79ad('0x6f')](_0xdaba2c)});}}}emlformat[_0x79ad('0x70')](_0x23269f,function(_0x2755f4,_0x49ab97){if(_0x2755f4)return _0x18caa3(_0x2755f4);fs[_0x79ad('0x71')](path[_0x79ad('0x5f')](_0x5ad0e4,util[_0x79ad('0x4d')](_0x79ad('0x72'),_0x4b28d0)),_0x49ab97);return _0x57330b(_0x49ab97);});});})[_0x79ad('0x1b')](function(){return new BPromise(function(_0x3eb91,_0x32ba15){zipdir(_0x5ad0e4,{'saveTo':_0x1f5601},function(_0x4cd16b,_0xf85c18){if(_0x4cd16b)return _0x32ba15(_0x4cd16b);return _0x3eb91(_0xf85c18);});})['then'](function(){return new BPromise(function(_0x82bfd0,_0x5a21fb){rimraf(_0x5ad0e4,function(_0x22d943){if(_0x22d943)_0x5a21fb(_0x22d943);return _0x82bfd0();});});})[_0x79ad('0x1b')](function(){return _0xf791a6[_0x79ad('0x73')](_0x1f5601,_0x1424cc,function(_0x320c58){if(!_0x320c58)fs[_0x79ad('0x74')](_0x1f5601);});});});}else{return _0xf791a6['sendStatus'](0xc8);}})[_0x79ad('0x3a')](handleError(_0xf791a6,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4d191a3..a2d6463 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 _0x35b6=['MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1ab1bf,_0x144262){var _0x2a00a5=function(_0x42f0bd){while(--_0x42f0bd){_0x1ab1bf['push'](_0x1ab1bf['shift']());}};_0x2a00a5(++_0x144262);}(_0x35b6,0x8e));var _0x635b=function(_0x5bb588,_0x3b6df4){_0x5bb588=_0x5bb588-0x0;var _0x5c5d55=_0x35b6[_0x5bb588];return _0x5c5d55;};'use strict';var EventEmitter=require(_0x635b('0x0'));var MailInteraction=require(_0x635b('0x1'))['db'][_0x635b('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x635b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x635b('0x4')](0x0);var events={'afterCreate':_0x635b('0x5'),'afterUpdate':_0x635b('0x6'),'afterDestroy':'remove'};function emitEvent(_0x48237e){return function(_0x502d36,_0x96c69f,_0x5091fd){_0x502d36[_0x635b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2ce5de){_0x502d36['setDataValue']('Users',_0x2ce5de['map'](function(_0x195008){return{'id':_0x195008['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x502d36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x635b('0x8')](function(_0xebaff0){_0x502d36[_0x635b('0x9')](_0x635b('0xa'),_0xebaff0[_0x635b('0xb')]);MailInteractionEvents[_0x635b('0xc')](_0x48237e+':'+_0x502d36['id'],_0x502d36);MailInteractionEvents[_0x635b('0xc')](_0x48237e,_0x502d36);_0x5091fd(null);})[_0x635b('0xd')](_0x5091fd(null));};}for(var e in events){if(events[_0x635b('0xe')](e)){var event=events[e];MailInteraction[_0x635b('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xe3fb=['catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit'];(function(_0x5645fa,_0x29d4c3){var _0x43b6f5=function(_0x177741){while(--_0x177741){_0x5645fa['push'](_0x5645fa['shift']());}};_0x43b6f5(++_0x29d4c3);}(_0xe3fb,0x9c));var _0xbe3f=function(_0x150cc4,_0x15e9f1){_0x150cc4=_0x150cc4-0x0;var _0x22a995=_0xe3fb[_0x150cc4];return _0x22a995;};'use strict';var EventEmitter=require(_0xbe3f('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xbe3f('0x1')];var MailMessage=require(_0xbe3f('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbe3f('0x3')](0x0);var events={'afterCreate':_0xbe3f('0x4'),'afterUpdate':_0xbe3f('0x5'),'afterDestroy':_0xbe3f('0x6')};function emitEvent(_0x1269a1){return function(_0x47cf20,_0x1be8b7,_0x331574){_0x47cf20[_0xbe3f('0x7')]({'attributes':['id'],'raw':!![]})[_0xbe3f('0x8')](function(_0x457ba2){_0x47cf20[_0xbe3f('0x9')](_0xbe3f('0xa'),_0x457ba2[_0xbe3f('0xb')](function(_0x149b01){return{'id':_0x149b01['id']};}));return MailMessage[_0xbe3f('0xc')]({'where':{'MailInteractionId':_0x47cf20['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbe3f('0x8')](function(_0x110510){_0x47cf20['setDataValue']('unreadMessages',_0x110510[_0xbe3f('0xd')]);MailInteractionEvents['emit'](_0x1269a1+':'+_0x47cf20['id'],_0x47cf20);MailInteractionEvents[_0xbe3f('0xe')](_0x1269a1,_0x47cf20);_0x331574(null);})[_0xbe3f('0xf')](_0x331574(null));};}for(var e in events){if(events[_0xbe3f('0x10')](e)){var event=events[e];MailInteraction[_0xbe3f('0x11')](e,emitEvent(event));}}module[_0xbe3f('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 82943f8..cfe44ca 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 _0xdd5e=['rimraf','../../config/environment','exports','define','MailInteraction','FULLTEXT','substatus','substatusAt','format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','then','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xdd5e,0x157));var _0xedd5=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xdd5e[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xedd5('0x0'));var util=require(_0xedd5('0x1'));var logger=require('../../config/logger')(_0xedd5('0x2'));var moment=require(_0xedd5('0x3'));var BPromise=require(_0xedd5('0x4'));var rp=require(_0xedd5('0x5'));var fs=require('fs');var path=require(_0xedd5('0x6'));var rimraf=require(_0xedd5('0x7'));var config=require(_0xedd5('0x8'));var attributes=require('./mailInteraction.attributes');module[_0xedd5('0x9')]=function(_0x2d3052,_0x50a331){return _0x2d3052[_0xedd5('0xa')](_0xedd5('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xedd5('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b9eb3,_0x3f3792,_0x15e9e5){if(_0x2b9eb3[_0xedd5('0xd')]){_0x2b9eb3[_0xedd5('0xe')]=moment()[_0xedd5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2b9eb3[_0xedd5('0x10')]){_0x2b9eb3[_0xedd5('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x15e9e5(null,_0x3f3792);},'beforeUpdate':function(_0x32b2bb,_0x52a2a4,_0x46d29){if(_0x32b2bb[_0xedd5('0x12')]('substatus')){_0x32b2bb[_0xedd5('0xe')]=_0x32b2bb[_0xedd5('0xd')]?moment()[_0xedd5('0xf')](_0xedd5('0x13')):null;}if(_0x32b2bb[_0xedd5('0x12')]('closed')){_0x32b2bb[_0xedd5('0x11')]=moment()['format'](_0xedd5('0x13'));_0x32b2bb[_0xedd5('0xd')]=null;_0x32b2bb[_0xedd5('0xe')]=null;}_0x46d29(null,_0x32b2bb);},'afterUpdate':function(_0x4cc292,_0xaefe79,_0x47177d){var _0x2a8664=_0x2d3052[_0xedd5('0x14')];var _0x17648a=_0x4cc292[_0xedd5('0x15')]({'plain':!![]});if(_0x17648a[_0xedd5('0x10')]){return _0x2a8664['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x17648a['id']}})[_0xedd5('0x16')](function(){_0x47177d();})[_0xedd5('0x17')](function(_0x584c2c){_0x47177d(_0x584c2c);});}else{_0x47177d();}}},'charset':'utf8mb4','collate':_0xedd5('0x18')});}; \ No newline at end of file +var _0xcb84=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','models','update','then','catch'];(function(_0x53aa19,_0x160986){var _0x3dad7d=function(_0x1a6db5){while(--_0x1a6db5){_0x53aa19['push'](_0x53aa19['shift']());}};_0x3dad7d(++_0x160986);}(_0xcb84,0x199));var _0x4cb8=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xcb84[_0x258fb0];return _0x4d1afe;};'use strict';var _=require(_0x4cb8('0x0'));var util=require(_0x4cb8('0x1'));var logger=require('../../config/logger')(_0x4cb8('0x2'));var moment=require(_0x4cb8('0x3'));var BPromise=require(_0x4cb8('0x4'));var rp=require(_0x4cb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cb8('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cb8('0x7'));module[_0x4cb8('0x8')]=function(_0x44ef14,_0x1488a6){return _0x44ef14[_0x4cb8('0x9')](_0x4cb8('0xa'),attributes,{'tableName':_0x4cb8('0xb'),'paranoid':![],'indexes':[{'name':_0x4cb8('0xc'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x160029,_0x34e8f3,_0x2f3abe){if(_0x160029[_0x4cb8('0xd')]){_0x160029[_0x4cb8('0xe')]=moment()['format'](_0x4cb8('0xf'));}if(_0x160029[_0x4cb8('0x10')]){_0x160029[_0x4cb8('0x11')]=moment()[_0x4cb8('0x12')](_0x4cb8('0xf'));}_0x2f3abe(null,_0x34e8f3);},'beforeUpdate':function(_0x29a37c,_0x2fac8a,_0x4e9f93){if(_0x29a37c['changed'](_0x4cb8('0xd'))){_0x29a37c[_0x4cb8('0xe')]=_0x29a37c[_0x4cb8('0xd')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x29a37c['changed']('closed')){_0x29a37c[_0x4cb8('0x11')]=moment()['format'](_0x4cb8('0xf'));_0x29a37c['substatus']=null;_0x29a37c[_0x4cb8('0xe')]=null;}_0x4e9f93(null,_0x29a37c);},'afterUpdate':function(_0x97984b,_0x180bb8,_0x595d67){var _0x6f3c3b=_0x44ef14[_0x4cb8('0x13')];var _0x1e142d=_0x97984b['get']({'plain':!![]});if(_0x1e142d[_0x4cb8('0x10')]){return _0x6f3c3b['MailMessage'][_0x4cb8('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x1e142d['id']}})[_0x4cb8('0x15')](function(){_0x595d67();})[_0x4cb8('0x16')](function(_0xce30fa){_0x595d67(_0xce30fa);});}else{_0x595d67();}}},'charset':'utf8mb4','collate':_0x4cb8('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 20ced18..5b27b22 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 _0x0b78=['defaults','localhost','socket.io-emitter','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2acb37,_0xfc8066){var _0x4809d6=function(_0x2219b0){while(--_0x2219b0){_0x2acb37['push'](_0x2acb37['shift']());}};_0x4809d6(++_0xfc8066);}(_0x0b78,0x1d6));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x80b7('0x0'));var moment=require(_0x80b7('0x1'));var BPromise=require(_0x80b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80b7('0x3'));var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x80b7('0x5'));var jayson=require(_0x80b7('0x6'));var client=jayson[_0x80b7('0x7')][_0x80b7('0x8')]({'port':0x232a});config[_0x80b7('0x9')]=_[_0x80b7('0xa')](config['redis'],{'host':_0x80b7('0xb'),'port':0x18eb});var socket=require(_0x80b7('0xc'))(new Redis(config[_0x80b7('0x9')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xf705da,_0x5169e9,_0x475976){return new BPromise(function(_0x273f5a,_0x47910c){return client[_0x80b7('0xd')](_0xf705da,_0x475976)[_0x80b7('0xe')](function(_0x1e8046){logger[_0x80b7('0xf')]('MailInteraction,\x20%s,\x20%s',_0x5169e9,'request\x20sent');logger[_0x80b7('0x10')](_0x80b7('0x11'),_0x5169e9,_0x80b7('0x12'),JSON[_0x80b7('0x13')](_0x1e8046));if(_0x1e8046[_0x80b7('0x14')]){if(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x15')]===0x1f4){logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046['error']['message']);return _0x47910c(_0x1e8046['error']['message']);}logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);return _0x273f5a(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);}else{logger[_0x80b7('0xf')](_0x80b7('0x16'),_0x5169e9,_0x80b7('0x12'));_0x273f5a(_0x1e8046[_0x80b7('0x18')][_0x80b7('0x17')]);}})[_0x80b7('0x19')](function(_0x196948){logger['error'](_0x80b7('0x16'),_0x5169e9,_0x196948);_0x47910c(_0x196948);});});}exports[_0x80b7('0x1a')]=function(_0x1c6e24){var _0x5d816c=this;return new Promise(function(_0x1524be,_0x3ebdd6){return db[_0x80b7('0x1b')][_0x80b7('0x1c')](_0x1c6e24[_0x80b7('0x1d')],{'raw':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')][_0x80b7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c6e24['options']?_0x1c6e24['options'][_0x80b7('0x20')]||null:null,'attributes':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')]['attributes']||null:null,'limit':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')][_0x80b7('0x21')]||null:null})[_0x80b7('0xe')](function(_0x45d558){logger[_0x80b7('0xf')](_0x80b7('0x1a'),_0x1c6e24);logger[_0x80b7('0x10')](_0x80b7('0x1a'),_0x1c6e24,JSON[_0x80b7('0x13')](_0x45d558));_0x1524be(_0x45d558);})[_0x80b7('0x19')](function(_0x4cb8c9){logger[_0x80b7('0x14')](_0x80b7('0x1a'),_0x4cb8c9[_0x80b7('0x17')],_0x1c6e24);_0x3ebdd6(_0x5d816c[_0x80b7('0x14')](0x1f4,_0x4cb8c9[_0x80b7('0x17')]));});});};exports[_0x80b7('0x22')]=function(_0x3a5f27){return new Promise(function(_0x14044d,_0x479335){return db[_0x80b7('0x1b')][_0x80b7('0x23')]({'where':_0x3a5f27[_0x80b7('0x1e')]?_0x3a5f27[_0x80b7('0x1e')][_0x80b7('0x20')]||null:null})['then'](function(_0x472090){if(_0x472090){return _0x472090[_0x80b7('0x24')](_0x3a5f27[_0x80b7('0x1d')][_0x80b7('0x25')],_[_0x80b7('0x26')](_0x3a5f27[_0x80b7('0x1d')],[_0x80b7('0x25'),'id'])||{});}})['spread'](function(_0x977d25){logger[_0x80b7('0xf')]('AddTags',_0x3a5f27);logger[_0x80b7('0x10')](_0x80b7('0x27'),_0x3a5f27,JSON[_0x80b7('0x13')](_0x977d25));_0x14044d(_0x977d25);})[_0x80b7('0x19')](function(_0x6f23ef){logger[_0x80b7('0x14')]('AddTags',_0x6f23ef[_0x80b7('0x17')],_0x3a5f27);_0x479335(_this[_0x80b7('0x14')](0x1f4,_0x6f23ef[_0x80b7('0x17')]));});});}; \ No newline at end of file +var _0xc319=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToMailInteraction','MailInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0xc319,0x12e));var _0x9c31=function(_0x64692f,_0x666650){_0x64692f=_0x64692f-0x0;var _0x3c9f4f=_0xc319[_0x64692f];return _0x3c9f4f;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var moment=require(_0x9c31('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c31('0x3'));var fs=require('fs');var Redis=require(_0x9c31('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c31('0x5'));var logger=require(_0x9c31('0x6'))(_0x9c31('0x7'));var config=require(_0x9c31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c31('0x9')][_0x9c31('0xa')]({'port':0x232a});config[_0x9c31('0xb')]=_[_0x9c31('0xc')](config[_0x9c31('0xb')],{'host':_0x9c31('0xd'),'port':0x18eb});var socket=require(_0x9c31('0xe'))(new Redis(config[_0x9c31('0xb')]));require(_0x9c31('0xf'))['register'](socket);function respondWithRpcPromise(_0x57a0b3,_0x5de62b,_0x1d8b8b){return new BPromise(function(_0x2c026b,_0x14a649){return client[_0x9c31('0x10')](_0x57a0b3,_0x1d8b8b)[_0x9c31('0x11')](function(_0x5eff74){logger[_0x9c31('0x12')](_0x9c31('0x13'),_0x5de62b,_0x9c31('0x14'));logger['debug'](_0x9c31('0x15'),_0x5de62b,_0x9c31('0x14'),JSON[_0x9c31('0x16')](_0x5eff74));if(_0x5eff74[_0x9c31('0x17')]){if(_0x5eff74[_0x9c31('0x17')]['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5de62b,_0x5eff74['error']['message']);return _0x14a649(_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);}logger['error'](_0x9c31('0x13'),_0x5de62b,_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);return _0x2c026b(_0x5eff74[_0x9c31('0x17')][_0x9c31('0x18')]);}else{logger['info'](_0x9c31('0x13'),_0x5de62b,'request\x20sent');_0x2c026b(_0x5eff74[_0x9c31('0x19')]['message']);}})[_0x9c31('0x1a')](function(_0x54c08a){logger[_0x9c31('0x17')](_0x9c31('0x13'),_0x5de62b,_0x54c08a);_0x14a649(_0x54c08a);});});}exports[_0x9c31('0x1b')]=function(_0x59c053){var _0x1b12d8=this;return new Promise(function(_0x15323e,_0x417360){return db['MailInteraction'][_0x9c31('0x1c')](_0x59c053[_0x9c31('0x1d')],{'raw':_0x59c053['options']?_0x59c053[_0x9c31('0x1e')][_0x9c31('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59c053[_0x9c31('0x1e')]?_0x59c053[_0x9c31('0x1e')]['where']||null:null,'attributes':_0x59c053[_0x9c31('0x1e')]?_0x59c053[_0x9c31('0x1e')][_0x9c31('0x20')]||null:null,'limit':_0x59c053[_0x9c31('0x1e')]?_0x59c053[_0x9c31('0x1e')][_0x9c31('0x21')]||null:null})[_0x9c31('0x11')](function(_0x47f388){logger[_0x9c31('0x12')](_0x9c31('0x1b'),_0x59c053);logger[_0x9c31('0x22')](_0x9c31('0x1b'),_0x59c053,JSON[_0x9c31('0x16')](_0x47f388));_0x15323e(_0x47f388);})[_0x9c31('0x1a')](function(_0x5206c2){logger[_0x9c31('0x17')]('UpdateMailInteraction',_0x5206c2['message'],_0x59c053);_0x417360(_0x1b12d8[_0x9c31('0x17')](0x1f4,_0x5206c2[_0x9c31('0x18')]));});});};exports[_0x9c31('0x23')]=function(_0x3288e0){return new Promise(function(_0x4aab82,_0xa43ac0){return db[_0x9c31('0x24')][_0x9c31('0x25')]({'where':_0x3288e0[_0x9c31('0x1e')]?_0x3288e0[_0x9c31('0x1e')][_0x9c31('0x26')]||null:null})[_0x9c31('0x11')](function(_0x5ae607){if(_0x5ae607){return _0x5ae607[_0x9c31('0x27')](_0x3288e0[_0x9c31('0x1d')][_0x9c31('0x28')],_[_0x9c31('0x29')](_0x3288e0[_0x9c31('0x1d')],[_0x9c31('0x28'),'id'])||{});}})[_0x9c31('0x2a')](function(_0x18e2f3){logger[_0x9c31('0x12')](_0x9c31('0x2b'),_0x3288e0);logger[_0x9c31('0x22')](_0x9c31('0x2b'),_0x3288e0,JSON[_0x9c31('0x16')](_0x18e2f3));_0x4aab82(_0x18e2f3);})['catch'](function(_0x58a7b0){logger[_0x9c31('0x17')](_0x9c31('0x2b'),_0x58a7b0[_0x9c31('0x18')],_0x3288e0);_0xa43ac0(_this[_0x9c31('0x17')](0x1f4,_0x58a7b0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b151948..bd3d405 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 _0x0df7=['mailInteraction:','./mailInteraction.events','save','remove','removeListener','register','length'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0x0df7,0x16d));var _0x70df=function(_0x4bb1a0,_0x532425){_0x4bb1a0=_0x4bb1a0-0x0;var _0xff27b1=_0x0df7[_0x4bb1a0];return _0xff27b1;};'use strict';var MailInteractionEvents=require(_0x70df('0x0'));var events=[_0x70df('0x1'),_0x70df('0x2'),'update'];function createListener(_0x26e89c,_0x521b1b){return function(_0x51553f){_0x521b1b['emit'](_0x26e89c,_0x51553f);};}function removeListener(_0x408bc4,_0x310b03){return function(){MailInteractionEvents[_0x70df('0x3')](_0x408bc4,_0x310b03);};}exports[_0x70df('0x4')]=function(_0x1d9d7d){for(var _0x3f10f7=0x0,_0x3365b8=events[_0x70df('0x5')];_0x3f10f7<_0x3365b8;_0x3f10f7++){var _0x127b79=events[_0x3f10f7];var _0x55eff0=createListener(_0x70df('0x6')+_0x127b79,_0x1d9d7d);MailInteractionEvents['on'](_0x127b79,_0x55eff0);}}; \ No newline at end of file +var _0x53c7=['removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x4d4696,_0x1ab3a2){var _0x455048=function(_0x1548d4){while(--_0x1548d4){_0x4d4696['push'](_0x4d4696['shift']());}};_0x455048(++_0x1ab3a2);}(_0x53c7,0xb3));var _0x753c=function(_0x2dd544,_0x5be67f){_0x2dd544=_0x2dd544-0x0;var _0x5f1b65=_0x53c7[_0x2dd544];return _0x5f1b65;};'use strict';var MailInteractionEvents=require(_0x753c('0x0'));var events=['save','remove','update'];function createListener(_0x1cfb58,_0x3c5aa5){return function(_0x981aa5){_0x3c5aa5['emit'](_0x1cfb58,_0x981aa5);};}function removeListener(_0x2bb4b3,_0x44e874){return function(){MailInteractionEvents[_0x753c('0x1')](_0x2bb4b3,_0x44e874);};}exports[_0x753c('0x2')]=function(_0x377deb){for(var _0x17cf41=0x0,_0x5271c7=events[_0x753c('0x3')];_0x17cf41<_0x5271c7;_0x17cf41++){var _0x3d885b=events[_0x17cf41];var _0xc1a1db=createListener(_0x753c('0x4')+_0x3d885b,_0x377deb);MailInteractionEvents['on'](_0x3d885b,_0xc1a1db);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 9a7b515..bfd708d 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 _0x5d40=['/:id/reject','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','/:id/download','tracked','mailmessage:create','create','put','/:id/accept','accept'];(function(_0x292dd1,_0x1495e7){var _0x5536cb=function(_0x3a43b5){while(--_0x3a43b5){_0x292dd1['push'](_0x292dd1['shift']());}};_0x5536cb(++_0x1495e7);}(_0x5d40,0x1a2));var _0x05d4=function(_0x59fea3,_0x418bb6){_0x59fea3=_0x59fea3-0x0;var _0x1cdc53=_0x5d40[_0x59fea3];return _0x1cdc53;};'use strict';var multer=require(_0x05d4('0x0'));var util=require(_0x05d4('0x1'));var path=require('path');var timeout=require(_0x05d4('0x2'));var express=require('express');var router=express[_0x05d4('0x3')]();var fs_extra=require(_0x05d4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x05d4('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x05d4('0x6')]('/',auth['isAuthenticated'](),controller[_0x05d4('0x7')]);router['get']('/describe',auth[_0x05d4('0x8')](),controller[_0x05d4('0x9')]);router[_0x05d4('0x6')](_0x05d4('0xa'),auth['isAuthenticated'](),controller[_0x05d4('0xb')]);router[_0x05d4('0x6')](_0x05d4('0xc'),auth[_0x05d4('0x8')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction[_0x05d4('0xd')]('mail',_0x05d4('0xe')),controller[_0x05d4('0xf')]);router[_0x05d4('0x10')](_0x05d4('0xa'),auth[_0x05d4('0x8')](),controller['update']);router[_0x05d4('0x10')](_0x05d4('0x11'),auth['isAuthenticated'](),controller[_0x05d4('0x12')]);router[_0x05d4('0x10')](_0x05d4('0x13'),auth[_0x05d4('0x8')](),controller[_0x05d4('0x14')]);router[_0x05d4('0x15')]('/:id',auth[_0x05d4('0x8')](),controller[_0x05d4('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8caf=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xf9bbca,_0x56c628){var _0x720f5=function(_0x3e08f9){while(--_0x3e08f9){_0xf9bbca['push'](_0xf9bbca['shift']());}};_0x720f5(++_0x56c628);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x8caf[_0x22cd0c];return _0x439eba;};'use strict';var multer=require('multer');var util=require(_0xf8ca('0x0'));var path=require(_0xf8ca('0x1'));var timeout=require(_0xf8ca('0x2'));var express=require(_0xf8ca('0x3'));var router=express[_0xf8ca('0x4')]();var fs_extra=require(_0xf8ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8ca('0x6'));var config=require(_0xf8ca('0x7'));var controller=require(_0xf8ca('0x8'));router[_0xf8ca('0x9')]('/',auth[_0xf8ca('0xa')](),controller[_0xf8ca('0xb')]);router['get'](_0xf8ca('0xc'),auth[_0xf8ca('0xa')](),controller[_0xf8ca('0xd')]);router[_0xf8ca('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf8ca('0xe')]);router['get'](_0xf8ca('0xf'),auth[_0xf8ca('0xa')](),controller[_0xf8ca('0x10')]);router[_0xf8ca('0x11')]('/',auth['isAuthenticated'](),interaction[_0xf8ca('0x12')](_0xf8ca('0x13'),_0xf8ca('0x14')),controller[_0xf8ca('0x15')]);router['put'](_0xf8ca('0x16'),auth[_0xf8ca('0xa')](),controller['update']);router[_0xf8ca('0x17')](_0xf8ca('0x18'),auth[_0xf8ca('0xa')](),controller[_0xf8ca('0x19')]);router[_0xf8ca('0x17')](_0xf8ca('0x1a'),auth[_0xf8ca('0xa')](),controller[_0xf8ca('0x1b')]);router[_0xf8ca('0x1c')](_0xf8ca('0x16'),auth['isAuthenticated'](),controller[_0xf8ca('0x1d')]);module[_0xf8ca('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6124675..ea808d1 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 _0x1003=['TEXT','long','medium','BOOLEAN','ENUM','STRING','INTEGER','Email','Chat','sequelize','lodash','exports'];(function(_0x352e75,_0x169660){var _0x2c0af6=function(_0x5dae7f){while(--_0x5dae7f){_0x352e75['push'](_0x352e75['shift']());}};_0x2c0af6(++_0x169660);}(_0x1003,0x81));var _0x3100=function(_0x3fe65b,_0x13ac2e){_0x3fe65b=_0x3fe65b-0x0;var _0x32de12=_0x1003[_0x3fe65b];return _0x32de12;};'use strict';var Sequelize=require(_0x3100('0x0'));var _=require(_0x3100('0x1'));module[_0x3100('0x2')]={'body':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x5'))},'read':{'type':Sequelize[_0x3100('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3100('0x7')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3100('0x8')](0x1fe)},'from':{'type':Sequelize[_0x3100('0x8')]},'to':{'type':Sequelize[_0x3100('0x3')]('long')},'cc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'bcc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'subject':{'type':Sequelize[_0x3100('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x3100('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3100('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'originChannel':{'type':Sequelize[_0x3100('0x7')](_0x3100('0xa'),_0x3100('0xb')),'defaultValue':_0x3100('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x84d2=['TEXT','medium','ENUM','out','STRING','long','DATE','Email','sequelize','lodash'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x84d2,0x102));var _0x284d=function(_0x3d4085,_0x7558d5){_0x3d4085=_0x3d4085-0x0;var _0x27a386=_0x84d2[_0x3d4085];return _0x27a386;};'use strict';var Sequelize=require(_0x284d('0x0'));var _=require(_0x284d('0x1'));module['exports']={'body':{'type':Sequelize[_0x284d('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x284d('0x2')](_0x284d('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x284d('0x4')]('in','out'),'defaultValue':_0x284d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x284d('0x6')]},'to':{'type':Sequelize[_0x284d('0x2')]('long')},'cc':{'type':Sequelize[_0x284d('0x2')]('long')},'bcc':{'type':Sequelize[_0x284d('0x2')](_0x284d('0x7'))},'subject':{'type':Sequelize[_0x284d('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x284d('0x8')]},'originTo':{'type':Sequelize[_0x284d('0x2')](_0x284d('0x7'))},'originCc':{'type':Sequelize[_0x284d('0x2')]('long')},'originChannel':{'type':Sequelize[_0x284d('0x4')](_0x284d('0x9'),'Chat'),'defaultValue':_0x284d('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2d18ccd..b0893ee 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 _0x31f8=['fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','reject','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachments','headers','Bcc','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','moment','path','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','offset','undefined','limit','Content-Range','json','update','end','sendStatus','stack','name','send','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','show','params','find','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x31f8,0x153));var _0x831f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31f8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x831f('0x0'));var moment=require(_0x831f('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x831f('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x831f('0x3'));var htmlToText=require(_0x831f('0x4'));var qs=require(_0x831f('0x5'));var logger=require('../../config/logger')(_0x831f('0x6'));var interaction_log=require(_0x831f('0x7'))(_0x831f('0x8'));var config=require('../../config/environment');var db=require(_0x831f('0x9'))['db'];config['redis']=_[_0x831f('0xa')](config[_0x831f('0xb')],{'host':_0x831f('0xc'),'port':0x18eb});var socket=require(_0x831f('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0x831f('0xe'));require(_0x831f('0xf'))[_0x831f('0x10')](socket);var jayson=require(_0x831f('0x11'));var client=jayson[_0x831f('0x12')][_0x831f('0x13')]({'port':0x232c});var client9003=jayson[_0x831f('0x12')][_0x831f('0x13')]({'port':0x232b});var client9002=jayson[_0x831f('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a770e,_0x654722,_0x3ba5f9,_0x39a640){return new BPromise(function(_0x32e344,_0x119b8e){var _0x20313b=_0x39a640||client;return _0x20313b['request'](_0x4a770e,_0x3ba5f9)[_0x831f('0x14')](function(_0x5be06a){logger['info'](_0x831f('0x15'),_0x654722,_0x831f('0x16'));logger[_0x831f('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x654722,'request\x20sent',JSON['stringify'](_0x5be06a));if(_0x5be06a[_0x831f('0x18')]){if(_0x5be06a[_0x831f('0x18')]['code']===0x1f4){logger[_0x831f('0x18')](_0x831f('0x15'),_0x654722,_0x5be06a[_0x831f('0x18')][_0x831f('0x19')]);return _0x119b8e(_0x5be06a[_0x831f('0x18')]['message']);}logger['error'](_0x831f('0x15'),_0x654722,_0x5be06a[_0x831f('0x18')]['message']);return _0x32e344(_0x5be06a[_0x831f('0x18')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x654722,'request\x20sent');_0x32e344(_0x5be06a[_0x831f('0x1a')][_0x831f('0x19')]);}})[_0x831f('0x1b')](function(_0x27cbe9){logger[_0x831f('0x18')]('MailMessage,\x20%s,\x20%s',_0x654722,_0x27cbe9);_0x119b8e(_0x27cbe9);});});}function respondWithResult(_0x2a1c9f,_0xf9cc87){_0xf9cc87=_0xf9cc87||0xc8;return function(_0x264d19){if(_0x264d19){return _0x2a1c9f[_0x831f('0x1c')](_0xf9cc87)['json'](_0x264d19);}};}function respondWithFilteredResult(_0x48d2a3,_0x5d733e){return function(_0x2cb3ff){if(_0x2cb3ff){var _0x52959f=typeof _0x5d733e[_0x831f('0x1d')]===_0x831f('0x1e')&&typeof _0x5d733e[_0x831f('0x1f')]===_0x831f('0x1e');var _0x31552f=_0x2cb3ff['count'];var _0x5731f1=_0x52959f?0x0:_0x5d733e['offset'];var _0x5f09fb=_0x52959f?_0x2cb3ff['count']:_0x5d733e[_0x831f('0x1d')]+_0x5d733e['limit'];var _0x34f252;if(_0x5f09fb>=_0x31552f){_0x5f09fb=_0x31552f;_0x34f252=0xc8;}else{_0x34f252=0xce;}_0x48d2a3[_0x831f('0x1c')](_0x34f252);return _0x48d2a3['set'](_0x831f('0x20'),_0x5731f1+'-'+_0x5f09fb+'/'+_0x31552f)[_0x831f('0x21')](_0x2cb3ff);}return null;};}function saveUpdates(_0x355022){return function(_0x106737){if(_0x106737){return _0x106737[_0x831f('0x22')](_0x355022)[_0x831f('0x14')](function(_0x5cfde0){return _0x5cfde0;});}return null;};}function removeEntity(_0x4add65){return function(_0x4e9847){if(_0x4e9847){return _0x4e9847['destroy']()[_0x831f('0x14')](function(){_0x4add65['status'](0xcc)[_0x831f('0x23')]();});}};}function handleEntityNotFound(_0x22d20c){return function(_0x2cdeeb){if(!_0x2cdeeb){_0x22d20c[_0x831f('0x24')](0x194);}return _0x2cdeeb;};}function handleError(_0x3f168a,_0x39130d){_0x39130d=_0x39130d||0x1f4;return function(_0xe2beb0){logger['error'](_0xe2beb0[_0x831f('0x25')]);if(_0xe2beb0[_0x831f('0x26')]){delete _0xe2beb0[_0x831f('0x26')];}_0x3f168a['status'](_0x39130d)[_0x831f('0x27')](_0xe2beb0);};}exports['index']=function(_0x38f2d8,_0x32e743){var _0x1f869b={},_0x28d4ab={},_0x132f1f={'count':0x0,'rows':[]};var _0x2f0d72=_['map'](db[_0x831f('0x28')][_0x831f('0x29')],function(_0x5780f8){return{'name':_0x5780f8['fieldName'],'type':_0x5780f8[_0x831f('0x2a')][_0x831f('0x2b')]};});_0x28d4ab[_0x831f('0x2c')]=_[_0x831f('0x2d')](_0x2f0d72,'name');_0x28d4ab[_0x831f('0x2e')]=_[_0x831f('0x2f')](_0x38f2d8[_0x831f('0x2e')]);_0x28d4ab[_0x831f('0x30')]=_[_0x831f('0x31')](_0x28d4ab['model'],_0x28d4ab[_0x831f('0x2e')]);_0x1f869b[_0x831f('0x32')]=_[_0x831f('0x31')](_0x28d4ab['model'],qs[_0x831f('0x33')](_0x38f2d8[_0x831f('0x2e')][_0x831f('0x33')]));_0x1f869b[_0x831f('0x32')]=_0x1f869b[_0x831f('0x32')][_0x831f('0x34')]?_0x1f869b['attributes']:_0x28d4ab[_0x831f('0x2c')];if(!_0x38f2d8[_0x831f('0x2e')]['hasOwnProperty'](_0x831f('0x35'))){_0x1f869b['limit']=qs[_0x831f('0x1f')](_0x38f2d8[_0x831f('0x2e')][_0x831f('0x1f')]);_0x1f869b[_0x831f('0x1d')]=qs[_0x831f('0x1d')](_0x38f2d8['query']['offset']);}_0x1f869b[_0x831f('0x36')]=qs[_0x831f('0x37')](_0x38f2d8[_0x831f('0x2e')]['sort']);_0x1f869b[_0x831f('0x38')]=qs[_0x831f('0x30')](_[_0x831f('0x39')](_0x38f2d8['query'],_0x28d4ab[_0x831f('0x30')]),_0x2f0d72);if(_0x38f2d8['query'][_0x831f('0x3a')]){_0x1f869b[_0x831f('0x38')]=_[_0x831f('0x3b')](_0x1f869b[_0x831f('0x38')],{'$or':_[_0x831f('0x2d')](_0x2f0d72,function(_0x4ee9f5){if(_0x4ee9f5[_0x831f('0x2a')]!==_0x831f('0x3c')){var _0x433f7a={};_0x433f7a[_0x4ee9f5[_0x831f('0x26')]]={'$like':'%'+_0x38f2d8[_0x831f('0x2e')][_0x831f('0x3a')]+'%'};return _0x433f7a;}})});}_0x1f869b=_[_0x831f('0x3b')]({},_0x1f869b,_0x38f2d8[_0x831f('0x3d')]);var _0xd0d1ae={'where':_0x1f869b[_0x831f('0x38')]};return db[_0x831f('0x28')][_0x831f('0x3e')](_0xd0d1ae)['then'](function(_0x13ddf1){_0x132f1f[_0x831f('0x3e')]=_0x13ddf1;if(_0x38f2d8[_0x831f('0x2e')][_0x831f('0x3f')]){_0x1f869b['include']=[{'all':!![]}];}return db[_0x831f('0x28')][_0x831f('0x40')](_0x1f869b);})['then'](function(_0x37f2e9){_0x132f1f['rows']=_0x37f2e9;return _0x132f1f;})['then'](respondWithFilteredResult(_0x32e743,_0x1f869b))[_0x831f('0x1b')](handleError(_0x32e743,null));};exports[_0x831f('0x41')]=function(_0x1586c2,_0x487cde){var _0x57c9e0={'raw':!![],'where':{'id':_0x1586c2[_0x831f('0x42')]['id']}},_0x365198={};_0x365198[_0x831f('0x2c')]=_[_0x831f('0x2f')](db['MailMessage']['rawAttributes']);_0x365198['query']=_[_0x831f('0x2f')](_0x1586c2[_0x831f('0x2e')]);_0x365198[_0x831f('0x30')]=_[_0x831f('0x31')](_0x365198[_0x831f('0x2c')],_0x365198[_0x831f('0x2e')]);_0x57c9e0[_0x831f('0x32')]=_[_0x831f('0x31')](_0x365198[_0x831f('0x2c')],qs['fields'](_0x1586c2[_0x831f('0x2e')]['fields']));_0x57c9e0['attributes']=_0x57c9e0[_0x831f('0x32')]['length']?_0x57c9e0[_0x831f('0x32')]:_0x365198[_0x831f('0x2c')];if(_0x1586c2['query'][_0x831f('0x3f')]){_0x57c9e0['include']=[{'all':!![]}];}_0x57c9e0=_[_0x831f('0x3b')]({},_0x57c9e0,_0x1586c2[_0x831f('0x3d')]);return db[_0x831f('0x28')][_0x831f('0x43')](_0x57c9e0)[_0x831f('0x14')](handleEntityNotFound(_0x487cde,null))[_0x831f('0x14')](respondWithResult(_0x487cde,null))[_0x831f('0x1b')](handleError(_0x487cde,null));};exports['update']=function(_0x4b9622,_0xc40ef4){if(_0x4b9622[_0x831f('0x44')]['id']){delete _0x4b9622[_0x831f('0x44')]['id'];}return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x4b9622[_0x831f('0x42')]['id']}})['then'](handleEntityNotFound(_0xc40ef4,null))[_0x831f('0x14')](saveUpdates(_0x4b9622[_0x831f('0x44')],null))['then'](respondWithResult(_0xc40ef4,null))[_0x831f('0x1b')](handleError(_0xc40ef4,null));};exports['destroy']=function(_0x1372fb,_0x375843){return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x1372fb[_0x831f('0x42')]['id']}})['then'](handleEntityNotFound(_0x375843,null))[_0x831f('0x14')](removeEntity(_0x375843,null))[_0x831f('0x1b')](handleError(_0x375843,null));};exports[_0x831f('0x45')]=function(_0x362439,_0x45778d){return db['MailMessage'][_0x831f('0x45')]()['then'](respondWithResult(_0x45778d,null))[_0x831f('0x1b')](handleError(_0x45778d,null));};exports[_0x831f('0x46')]=function(_0x45ce27,_0x478218){return db[_0x831f('0x28')][_0x831f('0x46')](_0x45ce27[_0x831f('0x44')])[_0x831f('0x14')](function(_0xb96b2c){if(_0xb96b2c){if(_0xb96b2c[_0x831f('0x47')]===_0x831f('0x48')&&!_0xb96b2c[_0x831f('0x49')]){var _0x1c8de2,_0x5252b5,_0x513e3f;if(_0x45ce27[_0x831f('0x44')]['to']){_0x5252b5=_0x45ce27[_0x831f('0x44')]['to'][_0x831f('0x4a')](',')[0x0];}return db[_0x831f('0x4b')]['findOne']({'where':{'id':_0xb96b2c[_0x831f('0x4c')]},'include':[{'model':db[_0x831f('0x4d')],'as':_0x831f('0x4e'),'include':[{'model':db[_0x831f('0x4f')],'as':_0x831f('0x50'),'where':{'email':_0x5252b5},'limit':0x1,'order':[[_0x831f('0x51'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x831f('0x52'),'raw':!![]}]}]})[_0x831f('0x14')](function(_0x34e64f){_0x1c8de2=_0x34e64f;if(!_0x1c8de2||!_0x1c8de2[_0x831f('0x53')])return;var _0x23e8ea=_0x1c8de2[_0x831f('0x54')]();if(_0x45ce27[_0x831f('0x44')][_0x831f('0x55')]&&_0x45ce27[_0x831f('0x44')]['attachments']['length']){for(var _0x4def2c=0x0;_0x4def2c<_0x45ce27[_0x831f('0x44')][_0x831f('0x55')][_0x831f('0x34')];_0x4def2c+=0x1){_0x45ce27['body'][_0x831f('0x55')][_0x4def2c]={'filename':_0x45ce27[_0x831f('0x44')]['attachments'][_0x4def2c][_0x831f('0x26')],'path':path[_0x831f('0x56')](config['root'],_0x831f('0x57'),_0x45ce27[_0x831f('0x44')][_0x831f('0x55')][_0x4def2c][_0x831f('0x58')])};}}_0x513e3f={'account':_0x23e8ea,'message':_0x45ce27[_0x831f('0x44')]};return;})['then'](function(){if(_0x1c8de2[_0x831f('0x4e')]){if(_0x1c8de2[_0x831f('0x4e')][_0x831f('0x50')][_0x831f('0x34')]){return _0x1c8de2[_0x831f('0x4e')]['Contacts'][0x0];}else{return db[_0x831f('0x4f')][_0x831f('0x46')](_[_0x831f('0xa')](_0x45ce27['body'],{'firstName':_0x45ce27[_0x831f('0x44')]['to'],'email':_0x45ce27[_0x831f('0x44')]['to'],'phone':_0x45ce27[_0x831f('0x44')]['to'],'ListId':_0x1c8de2['ListId']}));}}else{throw new Error(_0x831f('0x59'));}})[_0x831f('0x14')](function(){if(_0x513e3f){return respondWithRpcPromise('SendMail',_0x831f('0x5a'),_0x513e3f,client9003)[_0x831f('0x14')](function(_0xec1966){return _0xb96b2c[_0x831f('0x22')]({'read':!![],'messageId':_0xec1966[_0x831f('0x5b')],'sentAt':moment()[_0x831f('0x5c')](_0x831f('0x5d'))});})[_0x831f('0x1b')](function(_0x14502a){logger[_0x831f('0x18')]('%s',JSON[_0x831f('0x5e')](_0x14502a));return _0xb96b2c;});}return _0xb96b2c;});}return _0xb96b2c;}})[_0x831f('0x14')](respondWithResult(_0x478218,0xc9))['catch'](handleError(_0x478218,null));};exports[_0x831f('0x5f')]=function(_0x34f781,_0x1229d4){var _0x16ed67={'agent':{},'channel':_0x831f('0x60')};if(_0x34f781['body']['id']){delete _0x34f781[_0x831f('0x44')]['id'];}_0x34f781[_0x831f('0x44')][_0x831f('0x61')]=!![];_0x34f781[_0x831f('0x44')][_0x831f('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x34f781['body'][_0x831f('0x63')]=_0x34f781[_0x831f('0x44')]['UserId']||_0x34f781[_0x831f('0x64')]['id'];_0x16ed67['agent']['id']=_0x34f781[_0x831f('0x44')][_0x831f('0x63')];return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x34f781[_0x831f('0x42')]['id'],'UserId':null}})[_0x831f('0x14')](handleEntityNotFound(_0x1229d4,null))[_0x831f('0x14')](saveUpdates(_0x34f781[_0x831f('0x44')],null))['then'](function(_0x519845){if(_0x519845){_0x16ed67[_0x831f('0x19')]=_0x519845[_0x831f('0x65')]({'plain':!![]});return db[_0x831f('0x66')][_0x831f('0x43')]({'where':{'id':_0x519845[_0x831f('0x67')]}});}return null;})[_0x831f('0x14')](handleEntityNotFound(_0x1229d4,null))[_0x831f('0x14')](function(_0x3ad555){if(_0x3ad555){return _0x3ad555[_0x831f('0x22')]({'UserId':_0x34f781['body'][_0x831f('0x63')],'read1stAt':_[_0x831f('0x68')](_0x3ad555[_0x831f('0x69')])?moment()[_0x831f('0x5c')](_0x831f('0x5d')):undefined});}return null;})[_0x831f('0x14')](function(_0x28ea4c){if(_0x28ea4c){_0x16ed67[_0x831f('0x6a')]=_0x28ea4c[_0x831f('0x65')]({'plain':!![]});interaction_log[_0x831f('0x6b')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34f781[_0x831f('0x64')]['id'],_0x34f781[_0x831f('0x64')][_0x831f('0x26')],_0x34f781[_0x831f('0x64')][_0x831f('0x6c')],_0x16ed67['interaction']['id'],_0x34f781[_0x831f('0x44')]?JSON[_0x831f('0x5e')](_0x34f781[_0x831f('0x44')]):_0x831f('0x6d'));return respondWithRpcPromise(_0x831f('0x6e'),_0x831f('0x6f'),_0x16ed67);}return null;})[_0x831f('0x14')](function(_0x4eca90){var _0x85547e=_0x831f('0x70')+_0x4eca90['message'][_0x831f('0x71')];return db[_0x831f('0x72')][_0x831f('0x2e')](_0x85547e,{'type':db[_0x831f('0x73')][_0x831f('0x74')][_0x831f('0x75')],'raw':!![]})[_0x831f('0x14')](function(_0x5eb230){return _0x5eb230;});})[_0x831f('0x14')](function(_0x1e15a2){if(_0x1e15a2){_0x16ed67[_0x831f('0x19')]['contact']=_0x1e15a2[0x0];if(!_0x34f781[_0x831f('0x44')][_0x831f('0x63')])return;return db[_0x831f('0x76')][_0x831f('0x43')]({'where':{'id':_0x34f781[_0x831f('0x44')][_0x831f('0x63')],'role':_0x831f('0x77')},'attributes':['id',_0x831f('0x26'),_0x831f('0x78'),_0x831f('0x79'),_0x831f('0x7a')],'raw':!![]});}return null;})[_0x831f('0x14')](function(_0x105dcc){if(!_0x105dcc)return null;_0x16ed67[_0x831f('0x19')][_0x831f('0x77')]=_0x105dcc;return _0x16ed67;})[_0x831f('0x14')](function(_0x4a747f){if(_0x4a747f){if(_0x34f781['body'][_0x831f('0x7b')]){_0x16ed67[_0x831f('0x19')][_0x831f('0x7c')]=util['format'](_0x831f('0x7d'),_0x34f781[_0x831f('0x64')][_0x831f('0x26')]);_0x16ed67[_0x831f('0x19')][_0x831f('0x7e')]=_0x16ed67[_0x831f('0x7e')];_0x16ed67['message'][_0x831f('0x7f')]=_0x16ed67[_0x831f('0x7e')];_0x16ed67[_0x831f('0x19')][_0x831f('0x80')]=_0x831f('0x5f');_0x16ed67['message'][_0x831f('0x44')]=htmlToText[_0x831f('0x81')](_0x16ed67['message'][_0x831f('0x44')]);return respondWithRpcPromise(_0x831f('0x82'),'EventManager',{'event':_0x831f('0x83'),'message':_0x16ed67['message']},client9002)[_0x831f('0x14')](function(){return _0x16ed67;});}return _0x16ed67;}return null;})['then'](respondWithResult(_0x1229d4,null))['catch'](handleError(_0x1229d4,null));};exports['reject']=function(_0x1ac80c,_0x25011d){var _0x55bcda={'agent':{},'channel':_0x831f('0x60')};if(_0x1ac80c[_0x831f('0x44')]['id']){delete _0x1ac80c['body']['id'];}_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')]=_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')]||_0x1ac80c['user']['id'];_0x55bcda[_0x831f('0x77')]['id']=_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')];return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x1ac80c[_0x831f('0x42')]['id'],'UserId':null}})[_0x831f('0x14')](handleEntityNotFound(_0x25011d,null))[_0x831f('0x14')](function(_0x4602c3){if(_0x4602c3){_0x55bcda[_0x831f('0x19')]=_0x4602c3[_0x831f('0x65')]({'plain':!![]});return db[_0x831f('0x66')][_0x831f('0x43')]({'where':{'id':_0x4602c3[_0x831f('0x67')]}});}return null;})[_0x831f('0x14')](handleEntityNotFound(_0x25011d,null))['then'](function(_0x5c8247){if(_0x5c8247){_0x55bcda[_0x831f('0x6a')]=_0x5c8247[_0x831f('0x65')]({'plain':!![]});interaction_log[_0x831f('0x6b')](_0x831f('0x84'),_0x1ac80c[_0x831f('0x64')]['id'],_0x1ac80c['user'][_0x831f('0x26')],_0x1ac80c[_0x831f('0x64')][_0x831f('0x6c')],_0x55bcda[_0x831f('0x6a')]['id'],_0x1ac80c[_0x831f('0x44')]?JSON[_0x831f('0x5e')](_0x1ac80c[_0x831f('0x44')]):_0x831f('0x6d'));return respondWithRpcPromise(_0x831f('0x85'),_0x831f('0x86'),_0x55bcda);}return null;})['then'](function(_0x3df2a3){var _0x408e1d=_0x831f('0x70')+_0x3df2a3['message'][_0x831f('0x71')];return db[_0x831f('0x72')][_0x831f('0x2e')](_0x408e1d,{'type':db[_0x831f('0x73')]['QueryTypes'][_0x831f('0x75')],'raw':!![]})[_0x831f('0x14')](function(_0x3c4fea){return _0x3c4fea;});})[_0x831f('0x14')](function(_0x28a1e5){if(_0x28a1e5){_0x55bcda[_0x831f('0x19')][_0x831f('0x87')]=_0x28a1e5[0x0];if(!_0x1ac80c['body'][_0x831f('0x63')])return;return db[_0x831f('0x76')][_0x831f('0x43')]({'where':{'id':_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')],'role':_0x831f('0x77')},'attributes':['id',_0x831f('0x26'),'fullname',_0x831f('0x79'),_0x831f('0x7a')],'raw':!![]});}return null;})[_0x831f('0x14')](function(_0x1d1d82){if(!_0x1d1d82)return null;_0x55bcda['message'][_0x831f('0x77')]=_0x1d1d82;return _0x55bcda;})[_0x831f('0x14')](function(_0x510686){if(_0x510686){_0x510686[_0x831f('0x19')]['interface']=util['format'](_0x831f('0x7d'),_0x1ac80c[_0x831f('0x64')]['name']);_0x510686[_0x831f('0x19')][_0x831f('0x7e')]=_0x55bcda[_0x831f('0x7e')];_0x510686[_0x831f('0x19')][_0x831f('0x7f')]=_0x55bcda['channel'];_0x510686[_0x831f('0x19')][_0x831f('0x80')]=_0x831f('0x88');_0x510686[_0x831f('0x19')]['body']=htmlToText[_0x831f('0x81')](_0x55bcda[_0x831f('0x19')]['body']);respondWithRpcPromise(_0x831f('0x82'),'EventManager',{'event':_0x831f('0x89'),'message':_0x510686[_0x831f('0x19')]},client9002);return _0x55bcda;}return null;})['then'](respondWithResult(_0x25011d,null))[_0x831f('0x1b')](handleError(_0x25011d,null));};exports['download']=function(_0x34acf2,_0x17f9be){var _0x1179a8=moment()[_0x831f('0x8a')]()[_0x831f('0x8b')]();var _0x15a0e3=path[_0x831f('0x56')](config[_0x831f('0x8c')],_0x831f('0x8d'),_0x831f('0x8e'),_0x831f('0x8f'));var _0x39d043=path[_0x831f('0x56')](config[_0x831f('0x8c')],_0x831f('0x8d'),'files',_0x831f('0x55'));var _0x44a9ef=util[_0x831f('0x5c')](_0x831f('0x90'),_0x1179a8);return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x34acf2[_0x831f('0x42')]['id']},'attributes':['id',_0x831f('0x44'),'from','to','cc',_0x831f('0x91'),_0x831f('0x92'),_0x831f('0x93')],'include':_0x34acf2[_0x831f('0x2e')]['attachments']?[{'model':db['Attachment'],'as':_0x831f('0x94')}]:undefined})[_0x831f('0x14')](handleEntityNotFound(_0x17f9be,null))[_0x831f('0x14')](function(_0x2b9c28){if(_0x2b9c28){var _0x8920fa=_0x2b9c28;var _0x27df64={'from':_0x8920fa['from'],'to':_0x8920fa['to'],'subject':_0x8920fa[_0x831f('0x92')],'html':htmlEntities['decode'](_0x8920fa['body']),'headers':{'Date':moment(_0x8920fa['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2b9c28['cc']){_0x27df64[_0x831f('0x95')]['Cc']=_0x2b9c28['cc'];}if(_0x2b9c28[_0x831f('0x91')]){_0x27df64['headers'][_0x831f('0x96')]=_0x2b9c28[_0x831f('0x91')];}return new BPromise(function(_0x4b6056,_0x355238){if(_0x2b9c28[_0x831f('0x94')]){for(var _0x4467d7=0x0;_0x4467d7<_0x2b9c28['Attachments'][_0x831f('0x34')];_0x4467d7++){var _0x3471ec=_0x2b9c28[_0x831f('0x94')][_0x4467d7];var _0x316d60=path[_0x831f('0x56')](_0x39d043,_0x3471ec['basename']);if(fs['existsSync'](_0x316d60)){_0x27df64[_0x831f('0x55')][_0x831f('0x97')]({'name':_0x3471ec['name'],'contentType':_0x3471ec[_0x831f('0x2a')],'data':fs[_0x831f('0x98')](_0x316d60)});}}}emlformat['build'](_0x27df64,function(_0x1a6b60,_0x484562){if(_0x1a6b60)return _0x355238(_0x1a6b60);fs[_0x831f('0x99')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef),_0x484562);return _0x4b6056(_0x484562);});});}})['then'](function(_0x5c6a77){if(_0x5c6a77){return _0x17f9be[_0x831f('0x9a')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef),_0x44a9ef,function(_0xad019f){if(!_0xad019f)fs[_0x831f('0x9b')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef));});}})[_0x831f('0x1b')](handleError(_0x17f9be,null));}; \ No newline at end of file +var _0x6672=['stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','SELECT','internal','interface','download','toString','files','server','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','type','build','unlinkSync','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','json','undefined','limit','count','offset','status','Content-Range','update','destroy','end','sendStatus','stack','name','map','MailMessage','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','params','rawAttributes','intersection','options','find','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','DESC','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','MailInteraction','MailInteractionId','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction'];(function(_0x1ddcd0,_0x35557d){var _0x23f108=function(_0x574dac){while(--_0x574dac){_0x1ddcd0['push'](_0x1ddcd0['shift']());}};_0x23f108(++_0x35557d);}(_0x6672,0xcd));var _0x2667=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6672[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var moment=require(_0x2667('0x0'));var BPromise=require(_0x2667('0x1'));var util=require(_0x2667('0x2'));var path=require(_0x2667('0x3'));var fs=require('fs');var _=require(_0x2667('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x2667('0x5'));var qs=require(_0x2667('0x6'));var logger=require(_0x2667('0x7'))(_0x2667('0x8'));var interaction_log=require(_0x2667('0x7'))(_0x2667('0x9'));var config=require(_0x2667('0xa'));var db=require(_0x2667('0xb'))['db'];config[_0x2667('0xc')]=_[_0x2667('0xd')](config[_0x2667('0xc')],{'host':_0x2667('0xe'),'port':0x18eb});var socket=require(_0x2667('0xf'))(new Redis(config[_0x2667('0xc')]));var htmlEntities=require(_0x2667('0x10'));require('./mailMessage.socket')[_0x2667('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2667('0x12')]['http']({'port':0x232c});var client9003=jayson[_0x2667('0x12')][_0x2667('0x13')]({'port':0x232b});var client9002=jayson[_0x2667('0x12')][_0x2667('0x13')]({'port':0x232a});function respondWithRpcPromise(_0xc15b62,_0x3bfa69,_0x5efa78,_0x2780d6){return new BPromise(function(_0xe9deec,_0x25f564){var _0x26322f=_0x2780d6||client;return _0x26322f[_0x2667('0x14')](_0xc15b62,_0x5efa78)[_0x2667('0x15')](function(_0x34a95a){logger[_0x2667('0x16')](_0x2667('0x17'),_0x3bfa69,_0x2667('0x18'));logger[_0x2667('0x19')](_0x2667('0x1a'),_0x3bfa69,_0x2667('0x18'),JSON['stringify'](_0x34a95a));if(_0x34a95a[_0x2667('0x1b')]){if(_0x34a95a['error'][_0x2667('0x1c')]===0x1f4){logger[_0x2667('0x1b')](_0x2667('0x17'),_0x3bfa69,_0x34a95a[_0x2667('0x1b')]['message']);return _0x25f564(_0x34a95a[_0x2667('0x1b')][_0x2667('0x1d')]);}logger[_0x2667('0x1b')]('MailMessage,\x20%s,\x20%s',_0x3bfa69,_0x34a95a[_0x2667('0x1b')][_0x2667('0x1d')]);return _0xe9deec(_0x34a95a['error']['message']);}else{logger[_0x2667('0x16')]('MailMessage,\x20%s,\x20%s',_0x3bfa69,_0x2667('0x18'));_0xe9deec(_0x34a95a[_0x2667('0x1e')]['message']);}})[_0x2667('0x1f')](function(_0xbe1c){logger[_0x2667('0x1b')](_0x2667('0x17'),_0x3bfa69,_0xbe1c);_0x25f564(_0xbe1c);});});}function respondWithResult(_0x4c73aa,_0x52afa7){_0x52afa7=_0x52afa7||0xc8;return function(_0x61a575){if(_0x61a575){return _0x4c73aa['status'](_0x52afa7)[_0x2667('0x20')](_0x61a575);}};}function respondWithFilteredResult(_0x354839,_0x360079){return function(_0xed5440){if(_0xed5440){var _0x2c00c1=typeof _0x360079['offset']===_0x2667('0x21')&&typeof _0x360079[_0x2667('0x22')]===_0x2667('0x21');var _0xf94163=_0xed5440[_0x2667('0x23')];var _0x164921=_0x2c00c1?0x0:_0x360079[_0x2667('0x24')];var _0x2f8356=_0x2c00c1?_0xed5440[_0x2667('0x23')]:_0x360079[_0x2667('0x24')]+_0x360079[_0x2667('0x22')];var _0x158110;if(_0x2f8356>=_0xf94163){_0x2f8356=_0xf94163;_0x158110=0xc8;}else{_0x158110=0xce;}_0x354839[_0x2667('0x25')](_0x158110);return _0x354839['set'](_0x2667('0x26'),_0x164921+'-'+_0x2f8356+'/'+_0xf94163)['json'](_0xed5440);}return null;};}function saveUpdates(_0x132981){return function(_0x1e4565){if(_0x1e4565){return _0x1e4565[_0x2667('0x27')](_0x132981)[_0x2667('0x15')](function(_0x258054){return _0x258054;});}return null;};}function removeEntity(_0x54a482){return function(_0x4fb09f){if(_0x4fb09f){return _0x4fb09f[_0x2667('0x28')]()['then'](function(){_0x54a482[_0x2667('0x25')](0xcc)[_0x2667('0x29')]();});}};}function handleEntityNotFound(_0x315a86){return function(_0x240458){if(!_0x240458){_0x315a86[_0x2667('0x2a')](0x194);}return _0x240458;};}function handleError(_0x17bd92,_0x2a951c){_0x2a951c=_0x2a951c||0x1f4;return function(_0x2c06ad){logger[_0x2667('0x1b')](_0x2c06ad[_0x2667('0x2b')]);if(_0x2c06ad[_0x2667('0x2c')]){delete _0x2c06ad[_0x2667('0x2c')];}_0x17bd92[_0x2667('0x25')](_0x2a951c)['send'](_0x2c06ad);};}exports['index']=function(_0x393a53,_0x205c11){var _0x51c2c4={},_0x160d06={},_0x1a4e6c={'count':0x0,'rows':[]};var _0x4bb963=_[_0x2667('0x2d')](db[_0x2667('0x2e')]['rawAttributes'],function(_0x2a9834){return{'name':_0x2a9834[_0x2667('0x2f')],'type':_0x2a9834['type'][_0x2667('0x30')]};});_0x160d06[_0x2667('0x31')]=_[_0x2667('0x2d')](_0x4bb963,_0x2667('0x2c'));_0x160d06['query']=_[_0x2667('0x32')](_0x393a53[_0x2667('0x33')]);_0x160d06[_0x2667('0x34')]=_['intersection'](_0x160d06[_0x2667('0x31')],_0x160d06[_0x2667('0x33')]);_0x51c2c4[_0x2667('0x35')]=_['intersection'](_0x160d06[_0x2667('0x31')],qs['fields'](_0x393a53[_0x2667('0x33')][_0x2667('0x36')]));_0x51c2c4['attributes']=_0x51c2c4[_0x2667('0x35')][_0x2667('0x37')]?_0x51c2c4[_0x2667('0x35')]:_0x160d06[_0x2667('0x31')];if(!_0x393a53['query'][_0x2667('0x38')]('nolimit')){_0x51c2c4[_0x2667('0x22')]=qs[_0x2667('0x22')](_0x393a53[_0x2667('0x33')]['limit']);_0x51c2c4[_0x2667('0x24')]=qs[_0x2667('0x24')](_0x393a53[_0x2667('0x33')][_0x2667('0x24')]);}_0x51c2c4['order']=qs[_0x2667('0x39')](_0x393a53[_0x2667('0x33')]['sort']);_0x51c2c4[_0x2667('0x3a')]=qs[_0x2667('0x34')](_[_0x2667('0x3b')](_0x393a53[_0x2667('0x33')],_0x160d06[_0x2667('0x34')]),_0x4bb963);if(_0x393a53[_0x2667('0x33')][_0x2667('0x3c')]){_0x51c2c4['where']=_['merge'](_0x51c2c4['where'],{'$or':_[_0x2667('0x2d')](_0x4bb963,function(_0x29ce5e){if(_0x29ce5e['type']!==_0x2667('0x3d')){var _0x129a6c={};_0x129a6c[_0x29ce5e[_0x2667('0x2c')]]={'$like':'%'+_0x393a53['query'][_0x2667('0x3c')]+'%'};return _0x129a6c;}})});}_0x51c2c4=_[_0x2667('0x3e')]({},_0x51c2c4,_0x393a53['options']);var _0x197881={'where':_0x51c2c4[_0x2667('0x3a')]};return db[_0x2667('0x2e')][_0x2667('0x23')](_0x197881)[_0x2667('0x15')](function(_0x582256){_0x1a4e6c[_0x2667('0x23')]=_0x582256;if(_0x393a53[_0x2667('0x33')][_0x2667('0x3f')]){_0x51c2c4[_0x2667('0x40')]=[{'all':!![]}];}return db[_0x2667('0x2e')][_0x2667('0x41')](_0x51c2c4);})[_0x2667('0x15')](function(_0x174e1d){_0x1a4e6c[_0x2667('0x42')]=_0x174e1d;return _0x1a4e6c;})[_0x2667('0x15')](respondWithFilteredResult(_0x205c11,_0x51c2c4))['catch'](handleError(_0x205c11,null));};exports['show']=function(_0xb7a384,_0x5a3fdd){var _0x3c89f6={'raw':!![],'where':{'id':_0xb7a384[_0x2667('0x43')]['id']}},_0x108e4e={};_0x108e4e['model']=_[_0x2667('0x32')](db[_0x2667('0x2e')][_0x2667('0x44')]);_0x108e4e[_0x2667('0x33')]=_[_0x2667('0x32')](_0xb7a384[_0x2667('0x33')]);_0x108e4e[_0x2667('0x34')]=_[_0x2667('0x45')](_0x108e4e[_0x2667('0x31')],_0x108e4e[_0x2667('0x33')]);_0x3c89f6[_0x2667('0x35')]=_[_0x2667('0x45')](_0x108e4e[_0x2667('0x31')],qs[_0x2667('0x36')](_0xb7a384[_0x2667('0x33')][_0x2667('0x36')]));_0x3c89f6[_0x2667('0x35')]=_0x3c89f6[_0x2667('0x35')][_0x2667('0x37')]?_0x3c89f6[_0x2667('0x35')]:_0x108e4e[_0x2667('0x31')];if(_0xb7a384['query']['includeAll']){_0x3c89f6[_0x2667('0x40')]=[{'all':!![]}];}_0x3c89f6=_[_0x2667('0x3e')]({},_0x3c89f6,_0xb7a384[_0x2667('0x46')]);return db[_0x2667('0x2e')][_0x2667('0x47')](_0x3c89f6)['then'](handleEntityNotFound(_0x5a3fdd,null))[_0x2667('0x15')](respondWithResult(_0x5a3fdd,null))[_0x2667('0x1f')](handleError(_0x5a3fdd,null));};exports[_0x2667('0x27')]=function(_0x44afe9,_0x467942){if(_0x44afe9['body']['id']){delete _0x44afe9[_0x2667('0x48')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x44afe9[_0x2667('0x43')]['id']}})[_0x2667('0x15')](handleEntityNotFound(_0x467942,null))[_0x2667('0x15')](saveUpdates(_0x44afe9[_0x2667('0x48')],null))[_0x2667('0x15')](respondWithResult(_0x467942,null))[_0x2667('0x1f')](handleError(_0x467942,null));};exports[_0x2667('0x28')]=function(_0x4a4eb7,_0x12689f){return db[_0x2667('0x2e')][_0x2667('0x47')]({'where':{'id':_0x4a4eb7[_0x2667('0x43')]['id']}})[_0x2667('0x15')](handleEntityNotFound(_0x12689f,null))[_0x2667('0x15')](removeEntity(_0x12689f,null))[_0x2667('0x1f')](handleError(_0x12689f,null));};exports[_0x2667('0x49')]=function(_0x4b6ef6,_0x461afe){return db['MailMessage']['describe']()[_0x2667('0x15')](respondWithResult(_0x461afe,null))[_0x2667('0x1f')](handleError(_0x461afe,null));};exports['create']=function(_0x418bc5,_0x4847ea){return db[_0x2667('0x2e')][_0x2667('0x4a')](_0x418bc5[_0x2667('0x48')])[_0x2667('0x15')](function(_0x768644){if(_0x768644){if(_0x768644[_0x2667('0x4b')]===_0x2667('0x4c')&&!_0x768644[_0x2667('0x4d')]){var _0x519533,_0x4755f6,_0x17526a;if(_0x418bc5['body']['to']){_0x4755f6=_0x418bc5[_0x2667('0x48')]['to'][_0x2667('0x4e')](',')[0x0];}return db[_0x2667('0x4f')]['findOne']({'where':{'id':_0x768644[_0x2667('0x50')]},'include':[{'model':db[_0x2667('0x51')],'as':_0x2667('0x52'),'include':[{'model':db['CmContact'],'as':_0x2667('0x53'),'where':{'email':_0x4755f6},'limit':0x1,'order':[[_0x2667('0x54'),_0x2667('0x55')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2667('0x56')],'as':_0x2667('0x56'),'raw':!![]}]}]})['then'](function(_0x38611b){_0x519533=_0x38611b;if(!_0x519533||!_0x519533['Smtp'])return;var _0x2941a5=_0x519533[_0x2667('0x57')]();if(_0x418bc5['body']['attachments']&&_0x418bc5[_0x2667('0x48')][_0x2667('0x58')][_0x2667('0x37')]){for(var _0x4b8f83=0x0;_0x4b8f83<_0x418bc5['body'][_0x2667('0x58')][_0x2667('0x37')];_0x4b8f83+=0x1){_0x418bc5['body'][_0x2667('0x58')][_0x4b8f83]={'filename':_0x418bc5[_0x2667('0x48')][_0x2667('0x58')][_0x4b8f83][_0x2667('0x2c')],'path':path[_0x2667('0x59')](config[_0x2667('0x5a')],_0x2667('0x5b'),_0x418bc5[_0x2667('0x48')][_0x2667('0x58')][_0x4b8f83][_0x2667('0x5c')])};}}_0x17526a={'account':_0x2941a5,'message':_0x418bc5[_0x2667('0x48')]};return;})[_0x2667('0x15')](function(){if(_0x519533[_0x2667('0x52')]){if(_0x519533[_0x2667('0x52')][_0x2667('0x53')][_0x2667('0x37')]){return _0x519533[_0x2667('0x52')]['Contacts'][0x0];}else{return db[_0x2667('0x5d')][_0x2667('0x4a')](_['defaults'](_0x418bc5['body'],{'firstName':_0x418bc5[_0x2667('0x48')]['to'],'email':_0x418bc5[_0x2667('0x48')]['to'],'phone':_0x418bc5[_0x2667('0x48')]['to'],'ListId':_0x519533[_0x2667('0x5e')]}));}}else{throw new Error(_0x2667('0x5f'));}})['then'](function(){if(_0x17526a){return respondWithRpcPromise(_0x2667('0x60'),_0x2667('0x61'),_0x17526a,client9003)[_0x2667('0x15')](function(_0x28bd4c){return _0x768644[_0x2667('0x27')]({'read':!![],'messageId':_0x28bd4c[_0x2667('0x62')],'sentAt':moment()[_0x2667('0x63')](_0x2667('0x64'))});})[_0x2667('0x1f')](function(_0x870e22){logger[_0x2667('0x1b')]('%s',JSON['stringify'](_0x870e22));return _0x768644;});}return _0x768644;});}return _0x768644;}})[_0x2667('0x15')](respondWithResult(_0x4847ea,0xc9))['catch'](handleError(_0x4847ea,null));};exports[_0x2667('0x65')]=function(_0x31e927,_0x5c46f3){var _0x1c3946={'agent':{},'channel':_0x2667('0x66')};if(_0x31e927[_0x2667('0x48')]['id']){delete _0x31e927[_0x2667('0x48')]['id'];}_0x31e927[_0x2667('0x48')][_0x2667('0x67')]=!![];_0x31e927[_0x2667('0x48')]['readAt']=moment()['format'](_0x2667('0x64'));_0x31e927[_0x2667('0x48')][_0x2667('0x68')]=_0x31e927[_0x2667('0x48')][_0x2667('0x68')]||_0x31e927[_0x2667('0x69')]['id'];_0x1c3946[_0x2667('0x6a')]['id']=_0x31e927[_0x2667('0x48')]['UserId'];return db[_0x2667('0x2e')][_0x2667('0x47')]({'where':{'id':_0x31e927[_0x2667('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c46f3,null))['then'](saveUpdates(_0x31e927['body'],null))['then'](function(_0x1c8a67){if(_0x1c8a67){_0x1c3946[_0x2667('0x1d')]=_0x1c8a67['get']({'plain':!![]});return db[_0x2667('0x6b')]['find']({'where':{'id':_0x1c8a67[_0x2667('0x6c')]}});}return null;})[_0x2667('0x15')](handleEntityNotFound(_0x5c46f3,null))['then'](function(_0x5df799){if(_0x5df799){return _0x5df799['update']({'UserId':_0x31e927[_0x2667('0x48')][_0x2667('0x68')],'read1stAt':_['isNil'](_0x5df799[_0x2667('0x6d')])?moment()[_0x2667('0x63')](_0x2667('0x64')):undefined});}return null;})[_0x2667('0x15')](function(_0x39971a){if(_0x39971a){_0x1c3946['interaction']=_0x39971a[_0x2667('0x6e')]({'plain':!![]});interaction_log[_0x2667('0x16')](_0x2667('0x6f'),_0x31e927['user']['id'],_0x31e927[_0x2667('0x69')][_0x2667('0x2c')],_0x31e927[_0x2667('0x69')]['role'],_0x1c3946[_0x2667('0x70')]['id'],_0x31e927[_0x2667('0x48')]?JSON[_0x2667('0x71')](_0x31e927[_0x2667('0x48')]):_0x2667('0x72'));return respondWithRpcPromise(_0x2667('0x73'),_0x2667('0x74'),_0x1c3946);}return null;})[_0x2667('0x15')](function(_0x221c6e){var _0x193939=_0x2667('0x75')+_0x221c6e[_0x2667('0x1d')]['ContactId'];return db[_0x2667('0x76')]['query'](_0x193939,{'type':db[_0x2667('0x77')][_0x2667('0x78')]['SELECT'],'raw':!![]})[_0x2667('0x15')](function(_0x44b7e5){return _0x44b7e5;});})['then'](function(_0x510d04){if(_0x510d04){_0x1c3946['message'][_0x2667('0x79')]=_0x510d04[0x0];if(!_0x31e927['body'][_0x2667('0x68')])return;return db[_0x2667('0x7a')][_0x2667('0x47')]({'where':{'id':_0x31e927[_0x2667('0x48')][_0x2667('0x68')],'role':'agent'},'attributes':['id',_0x2667('0x2c'),_0x2667('0x7b'),_0x2667('0x7c'),'internal'],'raw':!![]});}return null;})[_0x2667('0x15')](function(_0x23b8dd){if(!_0x23b8dd)return null;_0x1c3946[_0x2667('0x1d')][_0x2667('0x6a')]=_0x23b8dd;return _0x1c3946;})[_0x2667('0x15')](function(_0x5432f8){if(_0x5432f8){if(_0x31e927[_0x2667('0x48')][_0x2667('0x7d')]){_0x1c3946[_0x2667('0x1d')]['interface']=util[_0x2667('0x63')](_0x2667('0x7e'),_0x31e927[_0x2667('0x69')][_0x2667('0x2c')]);_0x1c3946[_0x2667('0x1d')][_0x2667('0x7f')]=_0x1c3946[_0x2667('0x7f')];_0x1c3946[_0x2667('0x1d')][_0x2667('0x80')]=_0x1c3946[_0x2667('0x7f')];_0x1c3946[_0x2667('0x1d')][_0x2667('0x81')]=_0x2667('0x65');_0x1c3946[_0x2667('0x1d')]['body']=htmlToText[_0x2667('0x82')](_0x1c3946['message'][_0x2667('0x48')]);return respondWithRpcPromise('EventManager',_0x2667('0x83'),{'event':'acceptmessage','message':_0x1c3946[_0x2667('0x1d')]},client9002)[_0x2667('0x15')](function(){return _0x1c3946;});}return _0x1c3946;}return null;})[_0x2667('0x15')](respondWithResult(_0x5c46f3,null))['catch'](handleError(_0x5c46f3,null));};exports[_0x2667('0x84')]=function(_0x4c6dab,_0x996db3){var _0x15f83b={'agent':{},'channel':_0x2667('0x66')};if(_0x4c6dab['body']['id']){delete _0x4c6dab['body']['id'];}_0x4c6dab[_0x2667('0x48')]['UserId']=_0x4c6dab[_0x2667('0x48')][_0x2667('0x68')]||_0x4c6dab[_0x2667('0x69')]['id'];_0x15f83b[_0x2667('0x6a')]['id']=_0x4c6dab[_0x2667('0x48')][_0x2667('0x68')];return db[_0x2667('0x2e')][_0x2667('0x47')]({'where':{'id':_0x4c6dab[_0x2667('0x43')]['id'],'UserId':null}})[_0x2667('0x15')](handleEntityNotFound(_0x996db3,null))['then'](function(_0x2f337e){if(_0x2f337e){_0x15f83b[_0x2667('0x1d')]=_0x2f337e[_0x2667('0x6e')]({'plain':!![]});return db['MailInteraction'][_0x2667('0x47')]({'where':{'id':_0x2f337e[_0x2667('0x6c')]}});}return null;})[_0x2667('0x15')](handleEntityNotFound(_0x996db3,null))[_0x2667('0x15')](function(_0x59bc4e){if(_0x59bc4e){_0x15f83b['interaction']=_0x59bc4e['get']({'plain':!![]});interaction_log[_0x2667('0x16')](_0x2667('0x85'),_0x4c6dab[_0x2667('0x69')]['id'],_0x4c6dab[_0x2667('0x69')][_0x2667('0x2c')],_0x4c6dab[_0x2667('0x69')][_0x2667('0x86')],_0x15f83b[_0x2667('0x70')]['id'],_0x4c6dab['body']?JSON[_0x2667('0x71')](_0x4c6dab['body']):_0x2667('0x72'));return respondWithRpcPromise(_0x2667('0x87'),'rejectMessage',_0x15f83b);}return null;})[_0x2667('0x15')](function(_0x40e98f){var _0x5f2c8e=_0x2667('0x75')+_0x40e98f[_0x2667('0x1d')][_0x2667('0x88')];return db[_0x2667('0x76')][_0x2667('0x33')](_0x5f2c8e,{'type':db[_0x2667('0x77')][_0x2667('0x78')][_0x2667('0x89')],'raw':!![]})[_0x2667('0x15')](function(_0x5e09c7){return _0x5e09c7;});})['then'](function(_0x5c5089){if(_0x5c5089){_0x15f83b[_0x2667('0x1d')][_0x2667('0x79')]=_0x5c5089[0x0];if(!_0x4c6dab['body'][_0x2667('0x68')])return;return db[_0x2667('0x7a')][_0x2667('0x47')]({'where':{'id':_0x4c6dab[_0x2667('0x48')]['UserId'],'role':_0x2667('0x6a')},'attributes':['id',_0x2667('0x2c'),_0x2667('0x7b'),_0x2667('0x7c'),_0x2667('0x8a')],'raw':!![]});}return null;})['then'](function(_0x4e5e59){if(!_0x4e5e59)return null;_0x15f83b[_0x2667('0x1d')]['agent']=_0x4e5e59;return _0x15f83b;})[_0x2667('0x15')](function(_0x449672){if(_0x449672){_0x449672[_0x2667('0x1d')][_0x2667('0x8b')]=util[_0x2667('0x63')](_0x2667('0x7e'),_0x4c6dab[_0x2667('0x69')][_0x2667('0x2c')]);_0x449672[_0x2667('0x1d')]['channel']=_0x15f83b['channel'];_0x449672['message']['motionChannel']=_0x15f83b['channel'];_0x449672[_0x2667('0x1d')][_0x2667('0x81')]='reject';_0x449672[_0x2667('0x1d')]['body']=htmlToText[_0x2667('0x82')](_0x15f83b['message'][_0x2667('0x48')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x449672['message']},client9002);return _0x15f83b;}return null;})[_0x2667('0x15')](respondWithResult(_0x996db3,null))['catch'](handleError(_0x996db3,null));};exports[_0x2667('0x8c')]=function(_0x52e7f5,_0x52b841){var _0x50c916=moment()['unix']()[_0x2667('0x8d')]();var _0x4f69de=path[_0x2667('0x59')](config[_0x2667('0x5a')],'server',_0x2667('0x8e'),'tmp');var _0x456e68=path[_0x2667('0x59')](config['root'],_0x2667('0x8f'),_0x2667('0x8e'),'attachments');var _0xda4811=util[_0x2667('0x63')]('message-%s.eml',_0x50c916);return db[_0x2667('0x2e')][_0x2667('0x47')]({'where':{'id':_0x52e7f5[_0x2667('0x43')]['id']},'attributes':['id','body',_0x2667('0x90'),'to','cc',_0x2667('0x91'),_0x2667('0x92'),_0x2667('0x93')],'include':_0x52e7f5[_0x2667('0x33')][_0x2667('0x58')]?[{'model':db[_0x2667('0x94')],'as':_0x2667('0x95')}]:undefined})[_0x2667('0x15')](handleEntityNotFound(_0x52b841,null))[_0x2667('0x15')](function(_0x7836a1){if(_0x7836a1){var _0x1eb2fe=_0x7836a1;var _0x4bab3c={'from':_0x1eb2fe[_0x2667('0x90')],'to':_0x1eb2fe['to'],'subject':_0x1eb2fe['subject'],'html':htmlEntities[_0x2667('0x96')](_0x1eb2fe[_0x2667('0x48')]),'headers':{'Date':moment(_0x1eb2fe[_0x2667('0x93')])[_0x2667('0x63')](_0x2667('0x97'))},'attachments':[]};if(_0x7836a1['cc']){_0x4bab3c[_0x2667('0x98')]['Cc']=_0x7836a1['cc'];}if(_0x7836a1[_0x2667('0x91')]){_0x4bab3c['headers'][_0x2667('0x99')]=_0x7836a1[_0x2667('0x91')];}return new BPromise(function(_0x44218c,_0x3d2ca6){if(_0x7836a1['Attachments']){for(var _0x429cab=0x0;_0x429cab<_0x7836a1[_0x2667('0x95')][_0x2667('0x37')];_0x429cab++){var _0xcb5f2d=_0x7836a1[_0x2667('0x95')][_0x429cab];var _0x3ecd81=path[_0x2667('0x59')](_0x456e68,_0xcb5f2d[_0x2667('0x5c')]);if(fs[_0x2667('0x9a')](_0x3ecd81)){_0x4bab3c['attachments'][_0x2667('0x9b')]({'name':_0xcb5f2d[_0x2667('0x2c')],'contentType':_0xcb5f2d[_0x2667('0x9c')],'data':fs['readFileSync'](_0x3ecd81)});}}}emlformat[_0x2667('0x9d')](_0x4bab3c,function(_0x3d9aa1,_0x463bc2){if(_0x3d9aa1)return _0x3d2ca6(_0x3d9aa1);fs['writeFileSync'](path[_0x2667('0x59')](_0x4f69de,_0xda4811),_0x463bc2);return _0x44218c(_0x463bc2);});});}})[_0x2667('0x15')](function(_0x4ca8b9){if(_0x4ca8b9){return _0x52b841[_0x2667('0x8c')](path['join'](_0x4f69de,_0xda4811),_0xda4811,function(_0x30109c){if(!_0x30109c)fs[_0x2667('0x9e')](path[_0x2667('0x59')](_0x4f69de,_0xda4811));});}})['catch'](handleError(_0x52b841,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bf80bac..abf0d17 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 _0x75e8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2f4e8a,_0x114fd8){var _0x45eb5e=function(_0x209f28){while(--_0x209f28){_0x2f4e8a['push'](_0x2f4e8a['shift']());}};_0x45eb5e(++_0x114fd8);}(_0x75e8,0xff));var _0x875e=function(_0x3ffc55,_0x46e18f){_0x3ffc55=_0x3ffc55-0x0;var _0x1f8a93=_0x75e8[_0x3ffc55];return _0x1f8a93;};'use strict';var EventEmitter=require(_0x875e('0x0'));var MailMessage=require(_0x875e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x875e('0x2')](0x0);var events={'afterCreate':_0x875e('0x3'),'afterUpdate':'update','afterDestroy':_0x875e('0x4')};function emitEvent(_0x13362e){return function(_0x47707b,_0x19dfc3,_0x5a338e){MailMessageEvents['emit'](_0x13362e+':'+_0x47707b['id'],_0x47707b);MailMessageEvents[_0x875e('0x5')](_0x13362e,_0x47707b);_0x5a338e(null);};}for(var e in events){if(events[_0x875e('0x6')](e)){var event=events[e];MailMessage[_0x875e('0x7')](e,emitEvent(event));}}module[_0x875e('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x2058=['events','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5759eb,_0x38f708){var _0x531e7a=function(_0x4dffb3){while(--_0x4dffb3){_0x5759eb['push'](_0x5759eb['shift']());}};_0x531e7a(++_0x38f708);}(_0x2058,0x140));var _0x8205=function(_0x42c069,_0xdfa0f9){_0x42c069=_0x42c069-0x0;var _0x4f0740=_0x2058[_0x42c069];return _0x4f0740;};'use strict';var EventEmitter=require(_0x8205('0x0'));var MailMessage=require(_0x8205('0x1'))['db'][_0x8205('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8205('0x3')](0x0);var events={'afterCreate':_0x8205('0x4'),'afterUpdate':'update','afterDestroy':_0x8205('0x5')};function emitEvent(_0x2d5c2b){return function(_0x5784fe,_0x20f82d,_0x5cfe5e){MailMessageEvents[_0x8205('0x6')](_0x2d5c2b+':'+_0x5784fe['id'],_0x5784fe);MailMessageEvents['emit'](_0x2d5c2b,_0x5784fe);_0x5cfe5e(null);};}for(var e in events){if(events[_0x8205('0x7')](e)){var event=events[e];MailMessage[_0x8205('0x8')](e,emitEvent(event));}}module[_0x8205('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 445b6e4..e957b80 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 _0x47fd=['toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction'];(function(_0x5932b3,_0x20e226){var _0x8168ac=function(_0x120c5f){while(--_0x120c5f){_0x5932b3['push'](_0x5932b3['shift']());}};_0x8168ac(++_0x20e226);}(_0x47fd,0xe5));var _0xd47f=function(_0x2a6596,_0x8eb727){_0x2a6596=_0x2a6596-0x0;var _0x5778bb=_0x47fd[_0x2a6596];return _0x5778bb;};'use strict';var _=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var logger=require(_0xd47f('0x2'))('api');var moment=require(_0xd47f('0x3'));var BPromise=require('bluebird');var rp=require(_0xd47f('0x4'));var htmlToText=require(_0xd47f('0x5'));var fs=require('fs');var path=require(_0xd47f('0x6'));var rimraf=require('rimraf');var config=require(_0xd47f('0x7'));var attributes=require(_0xd47f('0x8'));module[_0xd47f('0x9')]=function(_0x53a11b,_0xc68be){return _0x53a11b[_0xd47f('0xa')](_0xd47f('0xb'),attributes,{'tableName':_0xd47f('0xc'),'paranoid':![],'indexes':[{'name':_0xd47f('0xd'),'fields':[_0xd47f('0xd')]},{'name':_0xd47f('0xe'),'fields':['plainBody',_0xd47f('0xf')],'type':_0xd47f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x147135,_0x218653,_0x8b3901){if(_0x147135[_0xd47f('0x11')]){_0x147135[_0xd47f('0x12')]=htmlToText[_0xd47f('0x13')](_0x147135[_0xd47f('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8b3901(null,_0x218653);},'afterCreate':function(_0xdac25b,_0x52c2d1,_0x100109){var _0x451fbc=_0x53a11b[_0xd47f('0x14')];var _0x2d30cc=_0xdac25b[_0xd47f('0x15')]({'plain':!![]});if(_0x2d30cc[_0xd47f('0x16')][_0xd47f('0x17')]()==='in'||_0x2d30cc[_0xd47f('0x16')]['toLowerCase']()===_0xd47f('0x18')&&!_0x2d30cc[_0xd47f('0x19')]&&!_['isNil'](_0x2d30cc[_0xd47f('0x1a')])){_0x451fbc[_0xd47f('0x1b')][_0xd47f('0x1c')]({'where':{'id':_0x2d30cc[_0xd47f('0x1d')]}})['then'](function(_0x19143e){if(_0x19143e){_0x19143e[_0xd47f('0x1e')]({'lastMsgAt':_0x2d30cc[_0xd47f('0x1f')],'lastMsgDirection':_0x2d30cc[_0xd47f('0x16')][_0xd47f('0x17')]()});}})[_0xd47f('0x20')](function(_0x5831ba){console[_0xd47f('0x21')](_0x5831ba);});}_0x100109();}},'charset':_0xd47f('0x22'),'collate':_0xd47f('0x23')});}; \ No newline at end of file +var _0xd848=['MailMessage','mail_messages','messageId','plainBody','fromString','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd848,0xb4));var _0x8d84=function(_0x2387c5,_0xfcc74c){_0x2387c5=_0x2387c5-0x0;var _0x2c414c=_0xd848[_0x2387c5];return _0x2c414c;};'use strict';var _=require(_0x8d84('0x0'));var util=require(_0x8d84('0x1'));var logger=require(_0x8d84('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8d84('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x8d84('0x4'));var rimraf=require(_0x8d84('0x5'));var config=require(_0x8d84('0x6'));var attributes=require('./mailMessage.attributes');module[_0x8d84('0x7')]=function(_0x32085c,_0x4c49ee){return _0x32085c[_0x8d84('0x8')](_0x8d84('0x9'),attributes,{'tableName':_0x8d84('0xa'),'paranoid':![],'indexes':[{'name':_0x8d84('0xb'),'fields':[_0x8d84('0xb')]},{'name':'fti_mail_messages','fields':[_0x8d84('0xc'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4912da,_0x10155f,_0x3fffa6){if(_0x4912da['body']){_0x4912da[_0x8d84('0xc')]=htmlToText[_0x8d84('0xd')](_0x4912da['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3fffa6(null,_0x10155f);},'afterCreate':function(_0x1de93f,_0x5aec39,_0x22210d){var _0x13bedf=_0x32085c['models'];var _0x5bd57d=_0x1de93f['get']({'plain':!![]});if(_0x5bd57d[_0x8d84('0xe')]['toLowerCase']()==='in'||_0x5bd57d[_0x8d84('0xe')][_0x8d84('0xf')]()===_0x8d84('0x10')&&!_0x5bd57d[_0x8d84('0x11')]&&!_[_0x8d84('0x12')](_0x5bd57d[_0x8d84('0x13')])){_0x13bedf[_0x8d84('0x14')][_0x8d84('0x15')]({'where':{'id':_0x5bd57d[_0x8d84('0x16')]}})[_0x8d84('0x17')](function(_0xbea767){if(_0xbea767){_0xbea767['update']({'lastMsgAt':_0x5bd57d[_0x8d84('0x18')],'lastMsgDirection':_0x5bd57d[_0x8d84('0xe')][_0x8d84('0xf')]()});}})['catch'](function(_0x3a901b){console[_0x8d84('0x19')](_0x3a901b);});}_0x22210d();}},'charset':'utf8mb4','collate':_0x8d84('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 72de3de..ec82b06 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 _0x8603=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./mailMessage.socket','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','util','moment','bluebird'];(function(_0x4b3aed,_0x36baba){var _0x5cf88b=function(_0x58da6e){while(--_0x58da6e){_0x4b3aed['push'](_0x4b3aed['shift']());}};_0x5cf88b(++_0x36baba);}(_0x8603,0x190));var _0x3860=function(_0x1690f9,_0x2a9858){_0x1690f9=_0x1690f9-0x0;var _0x460e19=_0x8603[_0x1690f9];return _0x460e19;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});config[_0x3860('0x9')]=_[_0x3860('0xa')](config[_0x3860('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3860('0xb'))[_0x3860('0xc')](socket);function respondWithRpcPromise(_0x52c277,_0x2fb169,_0x38737e){return new BPromise(function(_0x5909b8,_0x101263){return client[_0x3860('0xd')](_0x52c277,_0x38737e)['then'](function(_0x365579){logger[_0x3860('0xe')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x3860('0xf'));logger[_0x3860('0x10')](_0x3860('0x11'),_0x2fb169,_0x3860('0xf'),JSON[_0x3860('0x12')](_0x365579));if(_0x365579[_0x3860('0x13')]){if(_0x365579[_0x3860('0x13')][_0x3860('0x14')]===0x1f4){logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579['error'][_0x3860('0x16')]);return _0x101263(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579[_0x3860('0x13')][_0x3860('0x16')]);return _0x5909b8(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}else{logger[_0x3860('0xe')](_0x3860('0x15'),_0x2fb169,_0x3860('0xf'));_0x5909b8(_0x365579['result']['message']);}})[_0x3860('0x17')](function(_0x41ce59){logger[_0x3860('0x13')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x41ce59);_0x101263(_0x41ce59);});});}exports[_0x3860('0x18')]=function(_0x145b26){var _0x22e873=this;return new Promise(function(_0x3af33a,_0x20a5b0){return db[_0x3860('0x19')][_0x3860('0x1a')](_0x145b26[_0x3860('0x1b')],{'raw':_0x145b26[_0x3860('0x1c')]?_0x145b26[_0x3860('0x1c')][_0x3860('0x1d')]===undefined?!![]:![]:!![]})[_0x3860('0x1e')](function(_0x280ea9){logger[_0x3860('0xe')](_0x3860('0x18'),_0x145b26);logger['debug'](_0x3860('0x18'),_0x145b26,JSON[_0x3860('0x12')](_0x280ea9));_0x3af33a(_0x280ea9);})[_0x3860('0x17')](function(_0x301e03){logger[_0x3860('0x13')]('CreateMailMessage',_0x301e03[_0x3860('0x16')],_0x145b26);_0x20a5b0(_0x22e873['error'](0x1f4,_0x301e03['message']));});});}; \ No newline at end of file +var _0x896e=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s'];(function(_0xf85781,_0x443952){var _0x57a21f=function(_0xa30d6b){while(--_0xa30d6b){_0xf85781['push'](_0xf85781['shift']());}};_0x57a21f(++_0x443952);}(_0x896e,0x1e9));var _0xe896=function(_0x350d7c,_0x308719){_0x350d7c=_0x350d7c-0x0;var _0x532e95=_0x896e[_0x350d7c];return _0x532e95;};'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});config[_0xe896('0xd')]=_[_0xe896('0xe')](config[_0xe896('0xd')],{'host':_0xe896('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0xd')]));require(_0xe896('0x10'))[_0xe896('0x11')](socket);function respondWithRpcPromise(_0x4afd3f,_0x305616,_0x48251e){return new BPromise(function(_0x45b15b,_0x5be679){return client[_0xe896('0x12')](_0x4afd3f,_0x48251e)[_0xe896('0x13')](function(_0xa00ae9){logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));logger[_0xe896('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x305616,_0xe896('0x15'),JSON[_0xe896('0x17')](_0xa00ae9));if(_0xa00ae9[_0xe896('0x18')]){if(_0xa00ae9['error'][_0xe896('0x19')]===0x1f4){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0xa00ae9['error']['message']);return _0x5be679(_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x305616,_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);return _0x45b15b(_0xa00ae9['error'][_0xe896('0x1a')]);}else{logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));_0x45b15b(_0xa00ae9[_0xe896('0x1b')]['message']);}})[_0xe896('0x1c')](function(_0x9714f1){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0x9714f1);_0x5be679(_0x9714f1);});});}exports[_0xe896('0x1d')]=function(_0x3ac8b8){var _0x388c2e=this;return new Promise(function(_0x32d3d3,_0x49547b){return db[_0xe896('0x1e')]['create'](_0x3ac8b8['body'],{'raw':_0x3ac8b8[_0xe896('0x1f')]?_0x3ac8b8[_0xe896('0x1f')][_0xe896('0x20')]===undefined?!![]:![]:!![]})[_0xe896('0x13')](function(_0x498469){logger[_0xe896('0x21')]('CreateMailMessage',_0x3ac8b8);logger['debug'](_0xe896('0x1d'),_0x3ac8b8,JSON[_0xe896('0x17')](_0x498469));_0x32d3d3(_0x498469);})[_0xe896('0x1c')](function(_0x2e2c10){logger[_0xe896('0x18')](_0xe896('0x1d'),_0x2e2c10[_0xe896('0x1a')],_0x3ac8b8);_0x49547b(_0x388c2e['error'](0x1f4,_0x2e2c10[_0xe896('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index efd9042..03d3bd0 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 _0xb717=['removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb717,0x1b4));var _0x7b71=function(_0x334bc7,_0x45c813){_0x334bc7=_0x334bc7-0x0;var _0x433e15=_0xb717[_0x334bc7];return _0x433e15;};'use strict';var MailMessageEvents=require(_0x7b71('0x0'));var events=['save',_0x7b71('0x1'),'update'];function createListener(_0x42a694,_0xf3e061){return function(_0x42d36c){_0xf3e061['emit'](_0x42a694,_0x42d36c);};}function removeListener(_0x238319,_0x2e583f){return function(){MailMessageEvents[_0x7b71('0x2')](_0x238319,_0x2e583f);};}exports[_0x7b71('0x3')]=function(_0x3d3643){for(var _0x593c15=0x0,_0x217efe=events[_0x7b71('0x4')];_0x593c15<_0x217efe;_0x593c15++){var _0xd81a5c=events[_0x593c15];var _0x4238f6=createListener(_0x7b71('0x5')+_0xd81a5c,_0x3d3643);MailMessageEvents['on'](_0xd81a5c,_0x4238f6);}}; \ No newline at end of file +var _0xd420=['emit','removeListener','register','length','./mailMessage.events','save','update'];(function(_0x473a76,_0x57d391){var _0x5e4440=function(_0x505a97){while(--_0x505a97){_0x473a76['push'](_0x473a76['shift']());}};_0x5e4440(++_0x57d391);}(_0xd420,0x1d9));var _0x0d42=function(_0x32f6f1,_0x1b7974){_0x32f6f1=_0x32f6f1-0x0;var _0x1d316c=_0xd420[_0x32f6f1];return _0x1d316c;};'use strict';var MailMessageEvents=require(_0x0d42('0x0'));var events=[_0x0d42('0x1'),'remove',_0x0d42('0x2')];function createListener(_0x269128,_0x2460f8){return function(_0x47c018){_0x2460f8[_0x0d42('0x3')](_0x269128,_0x47c018);};}function removeListener(_0x4661fd,_0xfbd987){return function(){MailMessageEvents[_0x0d42('0x4')](_0x4661fd,_0xfbd987);};}exports[_0x0d42('0x5')]=function(_0x31804f){for(var _0x1b3425=0x0,_0x46be19=events[_0x0d42('0x6')];_0x1b3425<_0x46be19;_0x1b3425++){var _0x494507=events[_0x1b3425];var _0x3fa332=createListener('mailMessage:'+_0x494507,_0x31804f);MailMessageEvents['on'](_0x494507,_0x3fa332);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a2f6ffb..c508dca 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 _0xf923=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout'];(function(_0x3cf56f,_0x528a41){var _0x3f6703=function(_0x3e6d44){while(--_0x3e6d44){_0x3cf56f['push'](_0x3cf56f['shift']());}};_0x3f6703(++_0x528a41);}(_0xf923,0xbc));var _0x3f92=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xf923[_0x39f34f];return _0x59fee1;};'use strict';var multer=require(_0x3f92('0x0'));var util=require(_0x3f92('0x1'));var path=require(_0x3f92('0x2'));var timeout=require(_0x3f92('0x3'));var express=require(_0x3f92('0x4'));var router=express[_0x3f92('0x5')]();var fs_extra=require(_0x3f92('0x6'));var auth=require(_0x3f92('0x7'));var interaction=require(_0x3f92('0x8'));var config=require(_0x3f92('0x9'));var controller=require(_0x3f92('0xa'));router[_0x3f92('0xb')]('/',auth[_0x3f92('0xc')](),controller[_0x3f92('0xd')]);router[_0x3f92('0xb')]('/describe',auth[_0x3f92('0xc')](),controller[_0x3f92('0xe')]);router[_0x3f92('0xb')](_0x3f92('0xf'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x10')]);router[_0x3f92('0xb')](_0x3f92('0x11'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x12')]);router[_0x3f92('0xb')](_0x3f92('0x13'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x14')]);router[_0x3f92('0xb')](_0x3f92('0x15'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x16')]);router['post']('/',auth[_0x3f92('0xc')](),controller[_0x3f92('0x17')]);router[_0x3f92('0x18')](_0x3f92('0x13'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x19')]);router[_0x3f92('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x3f92('0x1a')]);router[_0x3f92('0x1b')](_0x3f92('0xf'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x1c')]);router[_0x3f92('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3f92('0x1d')](_0x3f92('0x13'),auth['isAuthenticated'](),controller[_0x3f92('0x1e')]);router[_0x3f92('0x1d')](_0x3f92('0x15'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xaaae=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/users','/:id','update','delete','destroy','/:id/teams','removeTeams','multer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xaaae,0x151));var _0xeaaa=function(_0x6315a2,_0x20e7c2){_0x6315a2=_0x6315a2-0x0;var _0x117e3b=_0xaaae[_0x6315a2];return _0x117e3b;};'use strict';var multer=require(_0xeaaa('0x0'));var util=require('util');var path=require(_0xeaaa('0x1'));var timeout=require(_0xeaaa('0x2'));var express=require('express');var router=express[_0xeaaa('0x3')]();var fs_extra=require(_0xeaaa('0x4'));var auth=require(_0xeaaa('0x5'));var interaction=require(_0xeaaa('0x6'));var config=require('../../config/environment');var controller=require(_0xeaaa('0x7'));router[_0xeaaa('0x8')]('/',auth[_0xeaaa('0x9')](),controller[_0xeaaa('0xa')]);router[_0xeaaa('0x8')](_0xeaaa('0xb'),auth[_0xeaaa('0x9')](),controller['describe']);router[_0xeaaa('0x8')]('/:id',auth[_0xeaaa('0x9')](),controller[_0xeaaa('0xc')]);router[_0xeaaa('0x8')](_0xeaaa('0xd'),auth[_0xeaaa('0x9')](),controller[_0xeaaa('0xe')]);router[_0xeaaa('0x8')]('/:id/teams',auth[_0xeaaa('0x9')](),controller[_0xeaaa('0xf')]);router[_0xeaaa('0x8')]('/:id/users',auth[_0xeaaa('0x9')](),controller[_0xeaaa('0x10')]);router[_0xeaaa('0x11')]('/',auth['isAuthenticated'](),controller[_0xeaaa('0x12')]);router['post']('/:id/teams',auth[_0xeaaa('0x9')](),controller['addTeams']);router[_0xeaaa('0x11')](_0xeaaa('0x13'),auth[_0xeaaa('0x9')](),controller['addAgents']);router['put'](_0xeaaa('0x14'),auth[_0xeaaa('0x9')](),controller[_0xeaaa('0x15')]);router[_0xeaaa('0x16')]('/:id',auth[_0xeaaa('0x9')](),controller[_0xeaaa('0x17')]);router['delete'](_0xeaaa('0x18'),auth[_0xeaaa('0x9')](),controller[_0xeaaa('0x19')]);router[_0xeaaa('0x16')](_0xeaaa('0x13'),auth[_0xeaaa('0x9')](),controller['removeAgents']);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 c4be0a0..86b68c8 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 _0x558e=['beepall','roundrobin','INTEGER','ENUM','rrmemory'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x558e,0x19c));var _0xe558=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x558e[_0x4cd21c];return _0x5d8e5e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe558('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe558('0x1')](_0xe558('0x2'),_0xe558('0x3'),_0xe558('0x4'))}}; \ No newline at end of file +var _0x2031=['INTEGER','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x4781e5,_0x48d5f4){var _0x3f00b0=function(_0x4753cc){while(--_0x4753cc){_0x4781e5['push'](_0x4781e5['shift']());}};_0x3f00b0(++_0x48d5f4);}(_0x2031,0x12a));var _0x1203=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2031[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x1203('0x0')]={'name':{'type':Sequelize[_0x1203('0x1')],'unique':_0x1203('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1203('0x1')]},'timeout':{'type':Sequelize[_0x1203('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1203('0x4'),_0x1203('0x5'),_0x1203('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 5f4f3fa..b12363b 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 _0xb2b3=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','rows','catch','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findAll','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','UserMailQueue','findOrCreate','forEach','emit','userMailQueue:save','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0xb2b3,0x71));var _0x3b2b=function(_0x4aaee1,_0x3a2b0d){_0x4aaee1=_0x4aaee1-0x0;var _0x406e34=_0xb2b3[_0x4aaee1];return _0x406e34;};'use strict';var emlformat=require(_0x3b2b('0x0'));var rimraf=require(_0x3b2b('0x1'));var zipdir=require(_0x3b2b('0x2'));var jsonpatch=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var moment=require(_0x3b2b('0x5'));var BPromise=require(_0x3b2b('0x6'));var Mustache=require('mustache');var util=require(_0x3b2b('0x7'));var path=require(_0x3b2b('0x8'));var sox=require(_0x3b2b('0x9'));var csv=require(_0x3b2b('0xa'));var ejs=require(_0x3b2b('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2b('0xc'));var _=require(_0x3b2b('0xd'));var squel=require(_0x3b2b('0xe'));var crypto=require(_0x3b2b('0xf'));var jsforce=require(_0x3b2b('0x10'));var deskjs=require(_0x3b2b('0x11'));var toCsv=require(_0x3b2b('0xa'));var querystring=require('querystring');var Papa=require(_0x3b2b('0x12'));var Redis=require(_0x3b2b('0x13'));var authService=require(_0x3b2b('0x14'));var qs=require(_0x3b2b('0x15'));var as=require(_0x3b2b('0x16'));var hardwareService=require(_0x3b2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3b2b('0x18'));var config=require(_0x3b2b('0x19'));var licenseUtil=require(_0x3b2b('0x1a'));var db=require(_0x3b2b('0x1b'))['db'];config['redis']=_[_0x3b2b('0x1c')](config[_0x3b2b('0x1d')],{'host':_0x3b2b('0x1e'),'port':0x18eb});var socket=require(_0x3b2b('0x1f'))(new Redis(config[_0x3b2b('0x1d')]));require(_0x3b2b('0x20'))['register'](socket);function respondWithStatusCode(_0x1dad6d,_0x1787cc){_0x1787cc=_0x1787cc||0xcc;return function(_0x5130fd){if(_0x5130fd){return _0x1dad6d[_0x3b2b('0x21')](_0x1787cc);}return _0x1dad6d[_0x3b2b('0x22')](_0x1787cc)[_0x3b2b('0x23')]();};}function respondWithResult(_0x5593e4,_0x2ab175){_0x2ab175=_0x2ab175||0xc8;return function(_0x4d17c5){if(_0x4d17c5){return _0x5593e4[_0x3b2b('0x22')](_0x2ab175)[_0x3b2b('0x24')](_0x4d17c5);}};}function respondWithFilteredResult(_0x57a2b4,_0x4a04e4){return function(_0x1a3bfb){if(_0x1a3bfb){var _0x52bba5=typeof _0x4a04e4[_0x3b2b('0x25')]===_0x3b2b('0x26')&&typeof _0x4a04e4['limit']===_0x3b2b('0x26');var _0x4ff5e3=_0x1a3bfb[_0x3b2b('0x27')];var _0x2e1db5=_0x52bba5?0x0:_0x4a04e4['offset'];var _0x59abc3=_0x52bba5?_0x1a3bfb[_0x3b2b('0x27')]:_0x4a04e4[_0x3b2b('0x25')]+_0x4a04e4[_0x3b2b('0x28')];var _0x46db63;if(_0x59abc3>=_0x4ff5e3){_0x59abc3=_0x4ff5e3;_0x46db63=0xc8;}else{_0x46db63=0xce;}_0x57a2b4[_0x3b2b('0x22')](_0x46db63);return _0x57a2b4[_0x3b2b('0x29')](_0x3b2b('0x2a'),_0x2e1db5+'-'+_0x59abc3+'/'+_0x4ff5e3)[_0x3b2b('0x24')](_0x1a3bfb);}return null;};}function patchUpdates(_0x1273e7){return function(_0x36a9d2){try{jsonpatch[_0x3b2b('0x2b')](_0x36a9d2,_0x1273e7,!![]);}catch(_0x4d5f70){return BPromise[_0x3b2b('0x2c')](_0x4d5f70);}return _0x36a9d2[_0x3b2b('0x2d')]();};}function saveUpdates(_0x252e36,_0x50e95c){return function(_0x306739){if(_0x306739){return _0x306739['update'](_0x252e36)[_0x3b2b('0x2e')](function(_0x50d2e5){return _0x50d2e5;});}return null;};}function removeEntity(_0x3ec4f0,_0x5df93e){return function(_0x52da06){if(_0x52da06){return _0x52da06[_0x3b2b('0x2f')]()[_0x3b2b('0x2e')](function(){var _0x11313d=_0x52da06[_0x3b2b('0x30')]({'plain':!![]});var _0x73967=_0x3b2b('0x31');return db[_0x3b2b('0x32')][_0x3b2b('0x2f')]({'where':{'type':_0x73967,'resourceId':_0x11313d['id']}})[_0x3b2b('0x2e')](function(){return _0x52da06;});})['then'](function(){_0x3ec4f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca78b,_0x3e2177){return function(_0x2e4bc7){if(!_0x2e4bc7){_0x5ca78b[_0x3b2b('0x21')](0x194);}return _0x2e4bc7;};}function handleError(_0x4656df,_0x3b7e45){_0x3b7e45=_0x3b7e45||0x1f4;return function(_0x34fc22){logger[_0x3b2b('0x33')](_0x34fc22['stack']);if(_0x34fc22[_0x3b2b('0x34')]){delete _0x34fc22['name'];}_0x4656df['status'](_0x3b7e45)[_0x3b2b('0x35')](_0x34fc22);};}exports[_0x3b2b('0x36')]=function(_0x281f1a,_0x107285){var _0x5040e2={},_0x5f32d0={},_0x2e63c1={'count':0x0,'rows':[]};var _0x3a7b4b=_[_0x3b2b('0x37')](db[_0x3b2b('0x38')][_0x3b2b('0x39')],function(_0x4b4d9c){return{'name':_0x4b4d9c[_0x3b2b('0x3a')],'type':_0x4b4d9c['type'][_0x3b2b('0x3b')]};});_0x5f32d0[_0x3b2b('0x3c')]=_[_0x3b2b('0x37')](_0x3a7b4b,_0x3b2b('0x34'));_0x5f32d0[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0x281f1a[_0x3b2b('0x3d')]);_0x5f32d0[_0x3b2b('0x3f')]=_['intersection'](_0x5f32d0['model'],_0x5f32d0[_0x3b2b('0x3d')]);_0x5040e2['attributes']=_[_0x3b2b('0x40')](_0x5f32d0[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x5040e2[_0x3b2b('0x42')]=_0x5040e2[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0x5040e2[_0x3b2b('0x42')]:_0x5f32d0[_0x3b2b('0x3c')];if(!_0x281f1a['query'][_0x3b2b('0x44')](_0x3b2b('0x45'))){_0x5040e2[_0x3b2b('0x28')]=qs[_0x3b2b('0x28')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0x5040e2[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x25')]);}_0x5040e2[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0x5040e2['where']=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0x281f1a[_0x3b2b('0x3d')],_0x5f32d0[_0x3b2b('0x3f')]),_0x3a7b4b);if(_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0x5040e2[_0x3b2b('0x4a')]=_['merge'](_0x5040e2['where'],{'$or':_[_0x3b2b('0x37')](_0x3a7b4b,function(_0x5f1a8d){if(_0x5f1a8d[_0x3b2b('0x4b')]!==_0x3b2b('0x4c')){var _0x2a9fb4={};_0x2a9fb4[_0x5f1a8d[_0x3b2b('0x34')]]={'$like':'%'+_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x2a9fb4;}})});}_0x5040e2=_[_0x3b2b('0x4d')]({},_0x5040e2,_0x281f1a[_0x3b2b('0x4e')]);var _0x580177={'where':_0x5040e2['where']};return db['MailQueue'][_0x3b2b('0x27')](_0x580177)[_0x3b2b('0x2e')](function(_0x3d3ccd){_0x2e63c1[_0x3b2b('0x27')]=_0x3d3ccd;if(_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x4f')]){_0x5040e2['include']=[{'all':!![]}];}return db[_0x3b2b('0x38')]['findAll'](_0x5040e2);})[_0x3b2b('0x2e')](function(_0xece0c7){_0x2e63c1[_0x3b2b('0x50')]=_0xece0c7;return _0x2e63c1;})[_0x3b2b('0x2e')](respondWithFilteredResult(_0x107285,_0x5040e2))[_0x3b2b('0x51')](handleError(_0x107285,null));};exports['show']=function(_0xc4820c,_0x4aa2ee){var _0x1b214e={'raw':!![],'where':{'id':_0xc4820c[_0x3b2b('0x52')]['id']}},_0x4bb775={};_0x4bb775[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x38')]['rawAttributes']);_0x4bb775['query']=_[_0x3b2b('0x3e')](_0xc4820c['query']);_0x4bb775[_0x3b2b('0x3f')]=_[_0x3b2b('0x40')](_0x4bb775['model'],_0x4bb775[_0x3b2b('0x3d')]);_0x1b214e['attributes']=_[_0x3b2b('0x40')](_0x4bb775[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0xc4820c[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x1b214e['attributes']=_0x1b214e['attributes'][_0x3b2b('0x43')]?_0x1b214e[_0x3b2b('0x42')]:_0x4bb775['model'];if(_0xc4820c[_0x3b2b('0x3d')][_0x3b2b('0x4f')]){_0x1b214e[_0x3b2b('0x53')]=[{'all':!![]}];}_0x1b214e=_[_0x3b2b('0x4d')]({},_0x1b214e,_0xc4820c[_0x3b2b('0x4e')]);return db[_0x3b2b('0x38')][_0x3b2b('0x54')](_0x1b214e)[_0x3b2b('0x2e')](handleEntityNotFound(_0x4aa2ee,null))[_0x3b2b('0x2e')](respondWithResult(_0x4aa2ee,null))[_0x3b2b('0x51')](handleError(_0x4aa2ee,null));};exports[_0x3b2b('0x55')]=function(_0x3ab42d,_0x2573ef){return db['MailQueue'][_0x3b2b('0x55')](_0x3ab42d[_0x3b2b('0x56')],{})[_0x3b2b('0x2e')](function(_0xc6d4c7){var _0x1ba532=_0x3ab42d[_0x3b2b('0x57')][_0x3b2b('0x30')]({'plain':!![]});if(!_0x1ba532)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ba532[_0x3b2b('0x58')]===_0x3b2b('0x57')){var _0x413654=_0xc6d4c7[_0x3b2b('0x30')]({'plain':!![]});var _0x26214f=_0x3b2b('0x31');return db[_0x3b2b('0x59')][_0x3b2b('0x54')]({'where':{'name':_0x26214f,'userProfileId':_0x1ba532[_0x3b2b('0x5a')]},'raw':!![]})[_0x3b2b('0x2e')](function(_0x1c7f08){if(_0x1c7f08&&_0x1c7f08[_0x3b2b('0x5b')]===0x0){return db[_0x3b2b('0x32')]['create']({'name':_0x413654[_0x3b2b('0x34')],'resourceId':_0x413654['id'],'type':_0x1c7f08[_0x3b2b('0x34')],'sectionId':_0x1c7f08['id']},{})['then'](function(){return _0xc6d4c7;});}else{return _0xc6d4c7;}})[_0x3b2b('0x51')](function(_0xde259a){logger[_0x3b2b('0x33')](_0x3b2b('0x5c'),_0xde259a);throw _0xde259a;});}return _0xc6d4c7;})[_0x3b2b('0x2e')](respondWithResult(_0x2573ef,0xc9))[_0x3b2b('0x51')](handleError(_0x2573ef,null));};exports['update']=function(_0x535816,_0x3210ae){if(_0x535816[_0x3b2b('0x56')]['id']){delete _0x535816[_0x3b2b('0x56')]['id'];}return db['MailQueue'][_0x3b2b('0x54')]({'where':{'id':_0x535816[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x3210ae,null))[_0x3b2b('0x2e')](saveUpdates(_0x535816['body'],null))[_0x3b2b('0x2e')](respondWithResult(_0x3210ae,null))[_0x3b2b('0x51')](handleError(_0x3210ae,null));};exports[_0x3b2b('0x2f')]=function(_0x33a12b,_0x17b1bd){return db[_0x3b2b('0x38')]['find']({'where':{'id':_0x33a12b[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x17b1bd,null))['then'](removeEntity(_0x17b1bd,null))['catch'](handleError(_0x17b1bd,null));};exports[_0x3b2b('0x5d')]=function(_0x5d5dce,_0x2e63ae){return db[_0x3b2b('0x38')][_0x3b2b('0x5d')]()[_0x3b2b('0x2e')](respondWithResult(_0x2e63ae,null))[_0x3b2b('0x51')](handleError(_0x2e63ae,null));};exports[_0x3b2b('0x5e')]=function(_0xe98449,_0x1ca7c2,_0x4e0626){var _0xe5d455={'raw':!![],'where':{}},_0x5bb885={},_0x21dc26;return db[_0x3b2b('0x38')]['findOne']({'where':{'id':_0xe98449['params']['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x1ca7c2,null))['then'](function(_0x4ba79b){if(_0x4ba79b){_0x21dc26=_0x4ba79b[_0x3b2b('0x30')]({'plain':!![]});_0x5bb885['model']=_[_0x3b2b('0x3e')](db['UserMailQueue'][_0x3b2b('0x39')]);_0x5bb885[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0xe98449[_0x3b2b('0x3d')]);_0x5bb885['filters']=_['intersection'](_0x5bb885[_0x3b2b('0x3c')],_0x5bb885[_0x3b2b('0x3d')]);_0xe5d455['attributes']=_[_0x3b2b('0x40')](_0x5bb885[_0x3b2b('0x3c')],qs['fields'](_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0xe5d455['attributes']=_0xe5d455[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0xe5d455[_0x3b2b('0x42')]:_0x5bb885[_0x3b2b('0x3c')];if(!_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x44')](_0x3b2b('0x45'))){_0xe5d455['limit']=qs[_0x3b2b('0x28')](_0xe98449[_0x3b2b('0x3d')]['limit']);_0xe5d455['offset']=qs[_0x3b2b('0x25')](_0xe98449['query'][_0x3b2b('0x25')]);}_0xe5d455[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0xe5d455[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0xe98449[_0x3b2b('0x3d')],_0x5bb885[_0x3b2b('0x3f')]));_0xe5d455[_0x3b2b('0x4a')]['MailQueueId']=_0x4ba79b['id'];if(_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0xe5d455[_0x3b2b('0x4a')]=_[_0x3b2b('0x4d')](_0xe5d455[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0xe5d455[_0x3b2b('0x42')],function(_0x4c3bce){var _0x26131f={};_0x26131f[_0x4c3bce]={'$like':'%'+_0xe98449[_0x3b2b('0x3d')]['filter']+'%'};return _0x26131f;})});}_0xe5d455=_[_0x3b2b('0x4d')]({},_0xe5d455,_0xe98449[_0x3b2b('0x4e')]);return db['UserMailQueue'][_0x3b2b('0x5f')](_0xe5d455);}})[_0x3b2b('0x2e')](function(_0xa2659b){if(_0xa2659b){return db['User'][_0x3b2b('0x60')]({'where':{'id':_[_0x3b2b('0x37')](_0xa2659b,_0x3b2b('0x61')),'role':_0x3b2b('0x62')},'attributes':['id',_0x3b2b('0x34'),_0x3b2b('0x63'),'updatedAt',_0x3b2b('0x64')]});}})[_0x3b2b('0x2e')](function(_0x52e00c){if(_0x52e00c){return{'count':_0x52e00c[_0x3b2b('0x27')],'rows':_[_0x3b2b('0x37')](_0x52e00c[_0x3b2b('0x50')],function(_0x3a8317){return{'membername':_0x3a8317[_0x3b2b('0x34')],'UserId':_0x3a8317['id'],'queue_name':_0x21dc26[_0x3b2b('0x34')],'MailQueueId':_0x21dc26['id'],'interface':util[_0x3b2b('0x65')](_0x3b2b('0x66'),_0x3b2b('0x67'),_0x3a8317['name']),'penalty':0x0,'paused':_0x3a8317[_0x3b2b('0x63')],'createdAt':_0x3a8317[_0x3b2b('0x64')],'updatedAt':_0x3a8317['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ca7c2,_0xe5d455))[_0x3b2b('0x51')](handleError(_0x1ca7c2,null));};exports['getTeams']=function(_0x44a951,_0x9eb4c6,_0x5604c9){var _0x235418={};var _0x21eac6={};var _0x5094c9;var _0x199d6c;return db[_0x3b2b('0x38')][_0x3b2b('0x68')]({'where':{'id':_0x44a951['params']['id']}})['then'](handleEntityNotFound(_0x9eb4c6,null))[_0x3b2b('0x2e')](function(_0x1f9507){if(_0x1f9507){_0x5094c9=_0x1f9507;_0x21eac6[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x69')]['rawAttributes']);_0x21eac6[_0x3b2b('0x3d')]=_['keys'](_0x44a951[_0x3b2b('0x3d')]);_0x21eac6[_0x3b2b('0x3f')]=_['intersection'](_0x21eac6[_0x3b2b('0x3c')],_0x21eac6['query']);_0x235418[_0x3b2b('0x42')]=_[_0x3b2b('0x40')](_0x21eac6[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x235418[_0x3b2b('0x42')]=_0x235418[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0x235418[_0x3b2b('0x42')]:_0x21eac6[_0x3b2b('0x3c')];_0x235418[_0x3b2b('0x46')]=qs['sort'](_0x44a951[_0x3b2b('0x3d')]['sort']);_0x235418[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0x44a951[_0x3b2b('0x3d')],_0x21eac6[_0x3b2b('0x3f')]));if(_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0x235418[_0x3b2b('0x4a')]=_[_0x3b2b('0x4d')](_0x235418[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0x235418[_0x3b2b('0x42')],function(_0x57e161){var _0x47485c={};_0x47485c[_0x57e161]={'$like':'%'+_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x47485c;})});}_0x235418=_[_0x3b2b('0x4d')]({},_0x235418,_0x44a951['options']);return _0x5094c9[_0x3b2b('0x6a')](_0x235418);}})[_0x3b2b('0x2e')](function(_0x6333c7){if(_0x6333c7){_0x199d6c=_0x6333c7[_0x3b2b('0x43')];if(!_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x44')]('nolimit')){_0x235418[_0x3b2b('0x28')]=qs['limit'](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0x235418[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x25')]);}return _0x5094c9[_0x3b2b('0x6a')](_0x235418);}})[_0x3b2b('0x2e')](function(_0x1cc9ec){if(_0x1cc9ec){return _0x1cc9ec?{'count':_0x199d6c,'rows':_0x1cc9ec}:null;}})[_0x3b2b('0x2e')](respondWithResult(_0x9eb4c6,null))[_0x3b2b('0x51')](handleError(_0x9eb4c6,null));};exports[_0x3b2b('0x6b')]=function(_0x532483,_0x9ed6f6,_0x145b5e){var _0x254631=_0x532483[_0x3b2b('0x56')][_0x3b2b('0x6c')];return db[_0x3b2b('0x69')][_0x3b2b('0x5f')]({'where':{'id':_0x254631},'attributes':['id'],'include':[{'model':db[_0x3b2b('0x6d')],'as':'Agents','attributes':['id',_0x3b2b('0x34'),_0x3b2b('0x6e'),_0x3b2b('0x6f'),_0x3b2b('0x70')],'raw':!![]}]})['then'](function(_0x53a134){if(_0x53a134){var _0x3ce401=_[_0x3b2b('0x71')](_0x53a134,function(_0x1b4ae5){var _0x361ceb=_0x1b4ae5['get']({'plain':!![]});return _0x361ceb[_0x3b2b('0x72')];});return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x532483['params']['id']}})[_0x3b2b('0x2e')](function(_0x42d344){return db[_0x3b2b('0x73')][_0x3b2b('0x74')](function(_0x14689e){return _0x42d344[_0x3b2b('0x6b')](_0x254631,{'transaction':_0x14689e})['then'](function(){return BPromise[_0x3b2b('0x75')](_0x3ce401,function(_0x2aeaed){return db[_0x3b2b('0x76')][_0x3b2b('0x77')]({'where':{'UserId':_0x2aeaed['id'],'MailQueueId':_0x532483['params']['id']},'transaction':_0x14689e});});})['then'](function(){_0x3ce401[_0x3b2b('0x78')](function(_0xd566d9){socket[_0x3b2b('0x79')](_0x3b2b('0x7a'),{'UserId':_0xd566d9['id'],'MailQueueId':_0x42d344['id']});});});});});}})['then'](respondWithStatusCode(_0x9ed6f6,null))[_0x3b2b('0x51')](handleError(_0x9ed6f6,null));};exports['removeTeams']=function(_0x484540,_0x2d649a,_0x2e438e){return db[_0x3b2b('0x69')]['findAll']({'where':{'id':_0x484540['query'][_0x3b2b('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d649a,null))[_0x3b2b('0x2e')](function(_0x550dd5){var _0x26db20=_['map'](_0x550dd5,'id');var _0x35cd80=[];var _0xe4cb8b=[];var _0x34e61e=squel[_0x3b2b('0x7b')]();_0x34e61e['field'](_0x3b2b('0x7c'))[_0x3b2b('0x7d')](_0x3b2b('0x7e'),'tq')[_0x3b2b('0x7f')](_0x3b2b('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3b2b('0x81'),_0x484540['params']['id']);for(var _0x286ba2=0x0;_0x286ba2<_0x550dd5[_0x3b2b('0x43')];_0x286ba2+=0x1){let _0x8fa31c=_0x550dd5[_0x286ba2];for(var _0xb163d2=0x0;_0xb163d2<_0x8fa31c[_0x3b2b('0x72')][_0x3b2b('0x43')];_0xb163d2+=0x1){let _0x1e884a=_0x8fa31c['Agents'][_0xb163d2];var _0x34ac3c=_0x34e61e[_0x3b2b('0x82')]();_0x34ac3c['where']('ut.UserId\x20=\x20?',_0x1e884a['id']);_0xe4cb8b[_0x3b2b('0x83')](db[_0x3b2b('0x73')][_0x3b2b('0x3d')](_0x34ac3c['toString'](),{'type':db[_0x3b2b('0x73')][_0x3b2b('0x84')][_0x3b2b('0x85')]})[_0x3b2b('0x2e')](function(_0x1a07f2){if(_0x1a07f2[_0x3b2b('0x43')]===0x1){return _0x1e884a['id'];}else{var _0x28897a=_[_0x3b2b('0x86')](_['map'](_0x1a07f2,'TeamId'),function(_0x595789){return _[_0x3b2b('0x87')](_0x26db20,_0x595789);});if(_0x28897a){return _0x1e884a['id'];}}}));}}return BPromise['all'](_0xe4cb8b)[_0x3b2b('0x2e')](function(_0x598c2c){_0x35cd80=_(_0x35cd80)[_0x3b2b('0x88')](_0x598c2c)[_0x3b2b('0x89')]()[_0x3b2b('0x8a')]();return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x484540[_0x3b2b('0x52')]['id']}})['then'](function(_0x4fd4bb){return db[_0x3b2b('0x73')][_0x3b2b('0x74')](function(_0x3d3901){return _0x4fd4bb[_0x3b2b('0x8b')](_0x484540['query']['ids'],{'transaction':_0x3d3901})[_0x3b2b('0x2e')](function(){if(!_[_0x3b2b('0x8c')](_0x35cd80)){return _0x4fd4bb[_0x3b2b('0x8d')](_0x35cd80,{'transaction':_0x3d3901});}})[_0x3b2b('0x2e')](function(){_0x35cd80[_0x3b2b('0x78')](function(_0x361521){socket['emit'](_0x3b2b('0x8e'),{'UserId':_0x361521,'MailQueueId':_0x4fd4bb['id']});});});});});});})['then'](respondWithStatusCode(_0x2d649a,null))[_0x3b2b('0x51')](handleError(_0x2d649a,null));};exports[_0x3b2b('0x8f')]=function(_0x3bd580,_0x4ef3d3,_0x4b72d8){return db['MailQueue'][_0x3b2b('0x54')]({'where':{'id':_0x3bd580[_0x3b2b('0x52')]['id']}})['then'](handleEntityNotFound(_0x4ef3d3,null))[_0x3b2b('0x2e')](function(_0x392b6b){if(_0x392b6b){return _0x392b6b[_0x3b2b('0x8f')](_0x3bd580[_0x3b2b('0x56')]['ids'],_[_0x3b2b('0x90')](_0x3bd580[_0x3b2b('0x56')],[_0x3b2b('0x6c'),'id'])||{})[_0x3b2b('0x91')](function(_0x2b7812){for(var _0x2ab4a4=0x0;_0x2ab4a4<_0x3bd580[_0x3b2b('0x56')][_0x3b2b('0x6c')][_0x3b2b('0x43')];_0x2ab4a4+=0x1){socket[_0x3b2b('0x79')](_0x3b2b('0x7a'),{'UserId':Number(_0x3bd580[_0x3b2b('0x56')][_0x3b2b('0x6c')][_0x2ab4a4]),'MailQueueId':Number(_0x3bd580[_0x3b2b('0x52')]['id'])});}return _0x2b7812;});}})[_0x3b2b('0x2e')](respondWithResult(_0x4ef3d3,null))[_0x3b2b('0x51')](handleError(_0x4ef3d3,null));};exports[_0x3b2b('0x8d')]=function(_0x13873c,_0x5a2658,_0x419c43){return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x13873c[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x5a2658,null))[_0x3b2b('0x2e')](function(_0x11f3b7){if(_0x11f3b7){return _0x11f3b7[_0x3b2b('0x8d')](_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')])[_0x3b2b('0x2e')](function(){if(_[_0x3b2b('0x92')](_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')])){for(var _0x312b08=0x0;_0x312b08<_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')]['length'];_0x312b08+=0x1){socket[_0x3b2b('0x79')](_0x3b2b('0x8e'),{'UserId':Number(_0x13873c['query'][_0x3b2b('0x6c')][_0x312b08]),'MailQueueId':Number(_0x13873c[_0x3b2b('0x52')]['id'])});}}else{socket[_0x3b2b('0x79')](_0x3b2b('0x8e'),{'UserId':Number(_0x13873c[_0x3b2b('0x3d')]['ids']),'MailQueueId':Number(_0x13873c[_0x3b2b('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a2658,null))['catch'](handleError(_0x5a2658,null));};exports['getAgents']=function(_0xebc3e0,_0x5d3417,_0x449b85){var _0xfbbef6={};var _0x30733b={};var _0x24c790;var _0x3ab805;return db[_0x3b2b('0x38')][_0x3b2b('0x68')]({'where':{'id':_0xebc3e0[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x5d3417,null))[_0x3b2b('0x2e')](function(_0x490b0a){if(_0x490b0a){_0x24c790=_0x490b0a;_0x30733b[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x6d')][_0x3b2b('0x39')]);_0x30733b[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0xebc3e0[_0x3b2b('0x3d')]);_0x30733b['filters']=_[_0x3b2b('0x40')](_0x30733b['model'],_0x30733b[_0x3b2b('0x3d')]);_0xfbbef6[_0x3b2b('0x42')]=_['intersection'](_0x30733b[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0xfbbef6[_0x3b2b('0x42')]=_0xfbbef6['attributes']['length']?_0xfbbef6['attributes']:_0x30733b['model'];_0xfbbef6[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0xfbbef6[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_['pick'](_0xebc3e0['query'],_0x30733b[_0x3b2b('0x3f')]));if(_0xebc3e0['query'][_0x3b2b('0x49')]){_0xfbbef6[_0x3b2b('0x4a')]=_['merge'](_0xfbbef6[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0xfbbef6[_0x3b2b('0x42')],function(_0x59caaa){var _0x4427e9={};_0x4427e9[_0x59caaa]={'$like':'%'+_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x4427e9;})});}_0xfbbef6=_[_0x3b2b('0x4d')]({},_0xfbbef6,_0xebc3e0[_0x3b2b('0x4e')]);return _0x24c790['getAgents'](_0xfbbef6);}})[_0x3b2b('0x2e')](function(_0x4f0b87){if(_0x4f0b87){_0x3ab805=_0x4f0b87['length'];if(!_0xebc3e0[_0x3b2b('0x3d')]['hasOwnProperty'](_0x3b2b('0x45'))){_0xfbbef6[_0x3b2b('0x28')]=qs[_0x3b2b('0x28')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0xfbbef6[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0xebc3e0[_0x3b2b('0x3d')]['offset']);}return _0x24c790['getAgents'](_0xfbbef6);}})[_0x3b2b('0x2e')](function(_0x346a0f){if(_0x346a0f){return _0x346a0f?{'count':_0x3ab805,'rows':_0x346a0f}:null;}})[_0x3b2b('0x2e')](respondWithResult(_0x5d3417,null))[_0x3b2b('0x51')](handleError(_0x5d3417,null));}; \ No newline at end of file +var _0xe207=['UserMailQueue','pick','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','end','stack','name','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','show','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne'];(function(_0x1599bf,_0x3cc1fb){var _0x2470f2=function(_0x555023){while(--_0x555023){_0x1599bf['push'](_0x1599bf['shift']());}};_0x2470f2(++_0x3cc1fb);}(_0xe207,0x154));var _0x7e20=function(_0x4de7b6,_0x3aef91){_0x4de7b6=_0x4de7b6-0x0;var _0x4c62b2=_0xe207[_0x4de7b6];return _0x4c62b2;};'use strict';var emlformat=require(_0x7e20('0x0'));var rimraf=require(_0x7e20('0x1'));var zipdir=require(_0x7e20('0x2'));var jsonpatch=require(_0x7e20('0x3'));var rp=require(_0x7e20('0x4'));var moment=require(_0x7e20('0x5'));var BPromise=require(_0x7e20('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e20('0x7'));var fs=require('fs');var fs_extra=require(_0x7e20('0x8'));var _=require(_0x7e20('0x9'));var squel=require(_0x7e20('0xa'));var crypto=require(_0x7e20('0xb'));var jsforce=require(_0x7e20('0xc'));var deskjs=require(_0x7e20('0xd'));var toCsv=require(_0x7e20('0xe'));var querystring=require(_0x7e20('0xf'));var Papa=require(_0x7e20('0x10'));var Redis=require(_0x7e20('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7e20('0x12'));var as=require(_0x7e20('0x13'));var hardwareService=require(_0x7e20('0x14'));var logger=require('../../config/logger')(_0x7e20('0x15'));var utils=require(_0x7e20('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e20('0x17'));var db=require(_0x7e20('0x18'))['db'];config['redis']=_[_0x7e20('0x19')](config[_0x7e20('0x1a')],{'host':_0x7e20('0x1b'),'port':0x18eb});var socket=require(_0x7e20('0x1c'))(new Redis(config[_0x7e20('0x1a')]));require(_0x7e20('0x1d'))[_0x7e20('0x1e')](socket);function respondWithStatusCode(_0x29da2c,_0x59177c){_0x59177c=_0x59177c||0xcc;return function(_0x47327f){if(_0x47327f){return _0x29da2c[_0x7e20('0x1f')](_0x59177c);}return _0x29da2c[_0x7e20('0x20')](_0x59177c)['end']();};}function respondWithResult(_0x4313f8,_0x212b99){_0x212b99=_0x212b99||0xc8;return function(_0x355527){if(_0x355527){return _0x4313f8[_0x7e20('0x20')](_0x212b99)['json'](_0x355527);}};}function respondWithFilteredResult(_0x1c8314,_0x5c84a4){return function(_0x1438ec){if(_0x1438ec){var _0x446fca=typeof _0x5c84a4[_0x7e20('0x21')]===_0x7e20('0x22')&&typeof _0x5c84a4[_0x7e20('0x23')]===_0x7e20('0x22');var _0x3cd39c=_0x1438ec[_0x7e20('0x24')];var _0x529075=_0x446fca?0x0:_0x5c84a4[_0x7e20('0x21')];var _0x4f4af3=_0x446fca?_0x1438ec['count']:_0x5c84a4[_0x7e20('0x21')]+_0x5c84a4[_0x7e20('0x23')];var _0x54db0d;if(_0x4f4af3>=_0x3cd39c){_0x4f4af3=_0x3cd39c;_0x54db0d=0xc8;}else{_0x54db0d=0xce;}_0x1c8314[_0x7e20('0x20')](_0x54db0d);return _0x1c8314[_0x7e20('0x25')](_0x7e20('0x26'),_0x529075+'-'+_0x4f4af3+'/'+_0x3cd39c)['json'](_0x1438ec);}return null;};}function patchUpdates(_0x1429e9){return function(_0x308ef2){try{jsonpatch[_0x7e20('0x27')](_0x308ef2,_0x1429e9,!![]);}catch(_0x540b34){return BPromise['reject'](_0x540b34);}return _0x308ef2[_0x7e20('0x28')]();};}function saveUpdates(_0x98baba,_0x5e8fff){return function(_0x587025){if(_0x587025){return _0x587025[_0x7e20('0x29')](_0x98baba)[_0x7e20('0x2a')](function(_0x4a9959){return _0x4a9959;});}return null;};}function removeEntity(_0x48cfbf,_0x23cdc5){return function(_0x5700c0){if(_0x5700c0){return _0x5700c0[_0x7e20('0x2b')]()[_0x7e20('0x2a')](function(){var _0x24348a=_0x5700c0[_0x7e20('0x2c')]({'plain':!![]});var _0x1c5b3a=_0x7e20('0x2d');return db[_0x7e20('0x2e')][_0x7e20('0x2b')]({'where':{'type':_0x1c5b3a,'resourceId':_0x24348a['id']}})['then'](function(){return _0x5700c0;});})['then'](function(){_0x48cfbf['status'](0xcc)[_0x7e20('0x2f')]();});}};}function handleEntityNotFound(_0x343e71,_0x35208f){return function(_0xdc9d19){if(!_0xdc9d19){_0x343e71[_0x7e20('0x1f')](0x194);}return _0xdc9d19;};}function handleError(_0x3d3a67,_0x3ad43e){_0x3ad43e=_0x3ad43e||0x1f4;return function(_0x44cf46){logger['error'](_0x44cf46[_0x7e20('0x30')]);if(_0x44cf46[_0x7e20('0x31')]){delete _0x44cf46[_0x7e20('0x31')];}_0x3d3a67[_0x7e20('0x20')](_0x3ad43e)['send'](_0x44cf46);};}exports[_0x7e20('0x32')]=function(_0x4e8323,_0x1ecba7){var _0x102bc0={},_0x12c2c6={},_0x297cc2={'count':0x0,'rows':[]};var _0x5a2475=_[_0x7e20('0x33')](db[_0x7e20('0x34')][_0x7e20('0x35')],function(_0x420591){return{'name':_0x420591[_0x7e20('0x36')],'type':_0x420591['type'][_0x7e20('0x37')]};});_0x12c2c6[_0x7e20('0x38')]=_[_0x7e20('0x33')](_0x5a2475,_0x7e20('0x31'));_0x12c2c6[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x4e8323[_0x7e20('0x39')]);_0x12c2c6[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x12c2c6[_0x7e20('0x38')],_0x12c2c6['query']);_0x102bc0[_0x7e20('0x3d')]=_[_0x7e20('0x3c')](_0x12c2c6[_0x7e20('0x38')],qs[_0x7e20('0x3e')](_0x4e8323[_0x7e20('0x39')][_0x7e20('0x3e')]));_0x102bc0[_0x7e20('0x3d')]=_0x102bc0['attributes']['length']?_0x102bc0[_0x7e20('0x3d')]:_0x12c2c6[_0x7e20('0x38')];if(!_0x4e8323[_0x7e20('0x39')][_0x7e20('0x3f')](_0x7e20('0x40'))){_0x102bc0[_0x7e20('0x23')]=qs[_0x7e20('0x23')](_0x4e8323[_0x7e20('0x39')][_0x7e20('0x23')]);_0x102bc0[_0x7e20('0x21')]=qs['offset'](_0x4e8323[_0x7e20('0x39')][_0x7e20('0x21')]);}_0x102bc0[_0x7e20('0x41')]=qs[_0x7e20('0x42')](_0x4e8323[_0x7e20('0x39')][_0x7e20('0x42')]);_0x102bc0[_0x7e20('0x43')]=qs[_0x7e20('0x3b')](_['pick'](_0x4e8323[_0x7e20('0x39')],_0x12c2c6[_0x7e20('0x3b')]),_0x5a2475);if(_0x4e8323[_0x7e20('0x39')][_0x7e20('0x44')]){_0x102bc0[_0x7e20('0x43')]=_['merge'](_0x102bc0[_0x7e20('0x43')],{'$or':_[_0x7e20('0x33')](_0x5a2475,function(_0x90f6bf){if(_0x90f6bf['type']!==_0x7e20('0x45')){var _0x308f95={};_0x308f95[_0x90f6bf[_0x7e20('0x31')]]={'$like':'%'+_0x4e8323[_0x7e20('0x39')][_0x7e20('0x44')]+'%'};return _0x308f95;}})});}_0x102bc0=_[_0x7e20('0x46')]({},_0x102bc0,_0x4e8323[_0x7e20('0x47')]);var _0x2ac40a={'where':_0x102bc0[_0x7e20('0x43')]};return db[_0x7e20('0x34')][_0x7e20('0x24')](_0x2ac40a)['then'](function(_0x4968ba){_0x297cc2[_0x7e20('0x24')]=_0x4968ba;if(_0x4e8323[_0x7e20('0x39')]['includeAll']){_0x102bc0[_0x7e20('0x48')]=[{'all':!![]}];}return db[_0x7e20('0x34')]['findAll'](_0x102bc0);})[_0x7e20('0x2a')](function(_0x3d4cdc){_0x297cc2[_0x7e20('0x49')]=_0x3d4cdc;return _0x297cc2;})[_0x7e20('0x2a')](respondWithFilteredResult(_0x1ecba7,_0x102bc0))[_0x7e20('0x4a')](handleError(_0x1ecba7,null));};exports[_0x7e20('0x4b')]=function(_0x275a76,_0x25dcd3){var _0x7af5af={'raw':!![],'where':{'id':_0x275a76['params']['id']}},_0xeb39fd={};_0xeb39fd['model']=_['keys'](db['MailQueue'][_0x7e20('0x35')]);_0xeb39fd['query']=_['keys'](_0x275a76[_0x7e20('0x39')]);_0xeb39fd[_0x7e20('0x3b')]=_['intersection'](_0xeb39fd['model'],_0xeb39fd['query']);_0x7af5af['attributes']=_[_0x7e20('0x3c')](_0xeb39fd[_0x7e20('0x38')],qs['fields'](_0x275a76[_0x7e20('0x39')]['fields']));_0x7af5af[_0x7e20('0x3d')]=_0x7af5af[_0x7e20('0x3d')][_0x7e20('0x4c')]?_0x7af5af[_0x7e20('0x3d')]:_0xeb39fd[_0x7e20('0x38')];if(_0x275a76[_0x7e20('0x39')][_0x7e20('0x4d')]){_0x7af5af['include']=[{'all':!![]}];}_0x7af5af=_[_0x7e20('0x46')]({},_0x7af5af,_0x275a76[_0x7e20('0x47')]);return db[_0x7e20('0x34')][_0x7e20('0x4e')](_0x7af5af)[_0x7e20('0x2a')](handleEntityNotFound(_0x25dcd3,null))[_0x7e20('0x2a')](respondWithResult(_0x25dcd3,null))[_0x7e20('0x4a')](handleError(_0x25dcd3,null));};exports[_0x7e20('0x4f')]=function(_0xa1552e,_0x536506){return db[_0x7e20('0x34')][_0x7e20('0x4f')](_0xa1552e[_0x7e20('0x50')],{})[_0x7e20('0x2a')](function(_0xc6b339){var _0x3375ae=_0xa1552e[_0x7e20('0x51')]['get']({'plain':!![]});if(!_0x3375ae)throw new Error(_0x7e20('0x52'));if(_0x3375ae['role']===_0x7e20('0x51')){var _0x18302b=_0xc6b339['get']({'plain':!![]});var _0x21898b=_0x7e20('0x2d');return db[_0x7e20('0x53')][_0x7e20('0x4e')]({'where':{'name':_0x21898b,'userProfileId':_0x3375ae[_0x7e20('0x54')]},'raw':!![]})['then'](function(_0x12f131){if(_0x12f131&&_0x12f131[_0x7e20('0x55')]===0x0){return db[_0x7e20('0x2e')][_0x7e20('0x4f')]({'name':_0x18302b['name'],'resourceId':_0x18302b['id'],'type':_0x12f131[_0x7e20('0x31')],'sectionId':_0x12f131['id']},{})['then'](function(){return _0xc6b339;});}else{return _0xc6b339;}})[_0x7e20('0x4a')](function(_0x4f7749){logger[_0x7e20('0x56')](_0x7e20('0x57'),_0x4f7749);throw _0x4f7749;});}return _0xc6b339;})[_0x7e20('0x2a')](respondWithResult(_0x536506,0xc9))['catch'](handleError(_0x536506,null));};exports['update']=function(_0x58eefe,_0x4cfb26){if(_0x58eefe[_0x7e20('0x50')]['id']){delete _0x58eefe['body']['id'];}return db[_0x7e20('0x34')][_0x7e20('0x4e')]({'where':{'id':_0x58eefe[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0x4cfb26,null))[_0x7e20('0x2a')](saveUpdates(_0x58eefe[_0x7e20('0x50')],null))[_0x7e20('0x2a')](respondWithResult(_0x4cfb26,null))[_0x7e20('0x4a')](handleError(_0x4cfb26,null));};exports[_0x7e20('0x2b')]=function(_0x298223,_0x274875){return db[_0x7e20('0x34')][_0x7e20('0x4e')]({'where':{'id':_0x298223[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0x274875,null))[_0x7e20('0x2a')](removeEntity(_0x274875,null))[_0x7e20('0x4a')](handleError(_0x274875,null));};exports[_0x7e20('0x59')]=function(_0x1f2825,_0x2d125){return db['MailQueue'][_0x7e20('0x59')]()[_0x7e20('0x2a')](respondWithResult(_0x2d125,null))['catch'](handleError(_0x2d125,null));};exports[_0x7e20('0x5a')]=function(_0x556ed7,_0x5931a4,_0x530a50){var _0x5b8701={'raw':!![],'where':{}},_0x106b34={},_0x4cc730;return db['MailQueue'][_0x7e20('0x5b')]({'where':{'id':_0x556ed7[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0x5931a4,null))[_0x7e20('0x2a')](function(_0x531958){if(_0x531958){_0x4cc730=_0x531958[_0x7e20('0x2c')]({'plain':!![]});_0x106b34[_0x7e20('0x38')]=_['keys'](db[_0x7e20('0x5c')][_0x7e20('0x35')]);_0x106b34[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x556ed7[_0x7e20('0x39')]);_0x106b34[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x106b34[_0x7e20('0x38')],_0x106b34[_0x7e20('0x39')]);_0x5b8701['attributes']=_['intersection'](_0x106b34[_0x7e20('0x38')],qs[_0x7e20('0x3e')](_0x556ed7['query'][_0x7e20('0x3e')]));_0x5b8701[_0x7e20('0x3d')]=_0x5b8701[_0x7e20('0x3d')][_0x7e20('0x4c')]?_0x5b8701[_0x7e20('0x3d')]:_0x106b34[_0x7e20('0x38')];if(!_0x556ed7[_0x7e20('0x39')][_0x7e20('0x3f')](_0x7e20('0x40'))){_0x5b8701[_0x7e20('0x23')]=qs[_0x7e20('0x23')](_0x556ed7[_0x7e20('0x39')][_0x7e20('0x23')]);_0x5b8701[_0x7e20('0x21')]=qs[_0x7e20('0x21')](_0x556ed7[_0x7e20('0x39')][_0x7e20('0x21')]);}_0x5b8701[_0x7e20('0x41')]=qs[_0x7e20('0x42')](_0x556ed7[_0x7e20('0x39')][_0x7e20('0x42')]);_0x5b8701['where']=qs[_0x7e20('0x3b')](_[_0x7e20('0x5d')](_0x556ed7[_0x7e20('0x39')],_0x106b34['filters']));_0x5b8701[_0x7e20('0x43')][_0x7e20('0x5e')]=_0x531958['id'];if(_0x556ed7[_0x7e20('0x39')][_0x7e20('0x44')]){_0x5b8701[_0x7e20('0x43')]=_[_0x7e20('0x46')](_0x5b8701['where'],{'$or':_[_0x7e20('0x33')](_0x5b8701[_0x7e20('0x3d')],function(_0x5d929a){var _0xbb1e22={};_0xbb1e22[_0x5d929a]={'$like':'%'+_0x556ed7[_0x7e20('0x39')][_0x7e20('0x44')]+'%'};return _0xbb1e22;})});}_0x5b8701=_[_0x7e20('0x46')]({},_0x5b8701,_0x556ed7[_0x7e20('0x47')]);return db[_0x7e20('0x5c')]['findAll'](_0x5b8701);}})['then'](function(_0x2b61c2){if(_0x2b61c2){return db[_0x7e20('0x5f')][_0x7e20('0x60')]({'where':{'id':_['map'](_0x2b61c2,'UserId'),'role':_0x7e20('0x61')},'attributes':['id',_0x7e20('0x31'),_0x7e20('0x62'),_0x7e20('0x63'),_0x7e20('0x64')]});}})[_0x7e20('0x2a')](function(_0x25983d){if(_0x25983d){return{'count':_0x25983d[_0x7e20('0x24')],'rows':_['map'](_0x25983d['rows'],function(_0x2b92b7){return{'membername':_0x2b92b7[_0x7e20('0x31')],'UserId':_0x2b92b7['id'],'queue_name':_0x4cc730['name'],'MailQueueId':_0x4cc730['id'],'interface':util[_0x7e20('0x65')]('%s/%s',_0x7e20('0x66'),_0x2b92b7[_0x7e20('0x31')]),'penalty':0x0,'paused':_0x2b92b7[_0x7e20('0x62')],'createdAt':_0x2b92b7[_0x7e20('0x64')],'updatedAt':_0x2b92b7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e20('0x2a')](respondWithFilteredResult(_0x5931a4,_0x5b8701))[_0x7e20('0x4a')](handleError(_0x5931a4,null));};exports[_0x7e20('0x67')]=function(_0x4c5259,_0x453c64,_0x5d4d58){var _0x2a4529={};var _0x2c3bce={};var _0x21be9c;var _0x59663d;return db[_0x7e20('0x34')][_0x7e20('0x5b')]({'where':{'id':_0x4c5259[_0x7e20('0x58')]['id']}})['then'](handleEntityNotFound(_0x453c64,null))[_0x7e20('0x2a')](function(_0xcd9300){if(_0xcd9300){_0x21be9c=_0xcd9300;_0x2c3bce[_0x7e20('0x38')]=_[_0x7e20('0x3a')](db[_0x7e20('0x68')][_0x7e20('0x35')]);_0x2c3bce[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x4c5259[_0x7e20('0x39')]);_0x2c3bce[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x2c3bce['model'],_0x2c3bce[_0x7e20('0x39')]);_0x2a4529[_0x7e20('0x3d')]=_[_0x7e20('0x3c')](_0x2c3bce[_0x7e20('0x38')],qs['fields'](_0x4c5259[_0x7e20('0x39')][_0x7e20('0x3e')]));_0x2a4529[_0x7e20('0x3d')]=_0x2a4529[_0x7e20('0x3d')]['length']?_0x2a4529['attributes']:_0x2c3bce[_0x7e20('0x38')];_0x2a4529['order']=qs[_0x7e20('0x42')](_0x4c5259[_0x7e20('0x39')][_0x7e20('0x42')]);_0x2a4529['where']=qs[_0x7e20('0x3b')](_[_0x7e20('0x5d')](_0x4c5259[_0x7e20('0x39')],_0x2c3bce['filters']));if(_0x4c5259[_0x7e20('0x39')]['filter']){_0x2a4529['where']=_['merge'](_0x2a4529[_0x7e20('0x43')],{'$or':_['map'](_0x2a4529[_0x7e20('0x3d')],function(_0x321525){var _0x497e1e={};_0x497e1e[_0x321525]={'$like':'%'+_0x4c5259[_0x7e20('0x39')]['filter']+'%'};return _0x497e1e;})});}_0x2a4529=_[_0x7e20('0x46')]({},_0x2a4529,_0x4c5259['options']);return _0x21be9c[_0x7e20('0x67')](_0x2a4529);}})['then'](function(_0x358fc7){if(_0x358fc7){_0x59663d=_0x358fc7[_0x7e20('0x4c')];if(!_0x4c5259[_0x7e20('0x39')][_0x7e20('0x3f')](_0x7e20('0x40'))){_0x2a4529[_0x7e20('0x23')]=qs[_0x7e20('0x23')](_0x4c5259['query'][_0x7e20('0x23')]);_0x2a4529[_0x7e20('0x21')]=qs['offset'](_0x4c5259[_0x7e20('0x39')][_0x7e20('0x21')]);}return _0x21be9c[_0x7e20('0x67')](_0x2a4529);}})[_0x7e20('0x2a')](function(_0x12a57b){if(_0x12a57b){return _0x12a57b?{'count':_0x59663d,'rows':_0x12a57b}:null;}})[_0x7e20('0x2a')](respondWithResult(_0x453c64,null))[_0x7e20('0x4a')](handleError(_0x453c64,null));};exports[_0x7e20('0x69')]=function(_0x21c94f,_0x58da04,_0x4989c4){var _0x3b3109=_0x21c94f[_0x7e20('0x50')][_0x7e20('0x6a')];return db[_0x7e20('0x68')][_0x7e20('0x6b')]({'where':{'id':_0x3b3109},'attributes':['id'],'include':[{'model':db[_0x7e20('0x5f')],'as':_0x7e20('0x6c'),'attributes':['id',_0x7e20('0x31'),_0x7e20('0x6d'),_0x7e20('0x6e'),_0x7e20('0x6f')],'raw':!![]}]})[_0x7e20('0x2a')](function(_0x12fe0d){if(_0x12fe0d){var _0x27c544=_['flatMap'](_0x12fe0d,function(_0x5d5e42){var _0x357aa5=_0x5d5e42[_0x7e20('0x2c')]({'plain':!![]});return _0x357aa5[_0x7e20('0x6c')];});return db[_0x7e20('0x34')]['find']({'where':{'id':_0x21c94f[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](function(_0x58d9be){return db[_0x7e20('0x70')][_0x7e20('0x71')](function(_0x255659){return _0x58d9be[_0x7e20('0x69')](_0x3b3109,{'transaction':_0x255659})[_0x7e20('0x2a')](function(){return BPromise['each'](_0x27c544,function(_0x14caa7){return db[_0x7e20('0x5c')][_0x7e20('0x72')]({'where':{'UserId':_0x14caa7['id'],'MailQueueId':_0x21c94f[_0x7e20('0x58')]['id']},'transaction':_0x255659});});})[_0x7e20('0x2a')](function(){_0x27c544[_0x7e20('0x73')](function(_0x260305){socket[_0x7e20('0x74')]('userMailQueue:save',{'UserId':_0x260305['id'],'MailQueueId':_0x58d9be['id']});});});});});}})[_0x7e20('0x2a')](respondWithStatusCode(_0x58da04,null))[_0x7e20('0x4a')](handleError(_0x58da04,null));};exports['removeTeams']=function(_0x3b1a4a,_0x5e3e29,_0x5e68ae){return db[_0x7e20('0x68')]['findAll']({'where':{'id':_0x3b1a4a[_0x7e20('0x39')][_0x7e20('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7e20('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e3e29,null))[_0x7e20('0x2a')](function(_0x3d77ce){var _0x5ba2df=_[_0x7e20('0x33')](_0x3d77ce,'id');var _0x132d1a=[];var _0x2edc20=[];var _0x437cfb=squel[_0x7e20('0x75')]();_0x437cfb[_0x7e20('0x76')](_0x7e20('0x77'))['from']('team_has_mail_queues','tq')[_0x7e20('0x78')](_0x7e20('0x79'),'ut',_0x7e20('0x7a'))['where'](_0x7e20('0x7b'),_0x3b1a4a[_0x7e20('0x58')]['id']);for(var _0x3b1cd1=0x0;_0x3b1cd1<_0x3d77ce[_0x7e20('0x4c')];_0x3b1cd1+=0x1){let _0x364293=_0x3d77ce[_0x3b1cd1];for(var _0x481360=0x0;_0x481360<_0x364293[_0x7e20('0x6c')][_0x7e20('0x4c')];_0x481360+=0x1){let _0x2d6d49=_0x364293[_0x7e20('0x6c')][_0x481360];var _0x2b6326=_0x437cfb[_0x7e20('0x7c')]();_0x2b6326[_0x7e20('0x43')](_0x7e20('0x7d'),_0x2d6d49['id']);_0x2edc20[_0x7e20('0x7e')](db[_0x7e20('0x70')][_0x7e20('0x39')](_0x2b6326['toString'](),{'type':db['sequelize'][_0x7e20('0x7f')][_0x7e20('0x80')]})[_0x7e20('0x2a')](function(_0x258854){if(_0x258854[_0x7e20('0x4c')]===0x1){return _0x2d6d49['id'];}else{var _0x1fb8ce=_['every'](_[_0x7e20('0x33')](_0x258854,_0x7e20('0x81')),function(_0x4e1806){return _[_0x7e20('0x82')](_0x5ba2df,_0x4e1806);});if(_0x1fb8ce){return _0x2d6d49['id'];}}}));}}return BPromise['all'](_0x2edc20)[_0x7e20('0x2a')](function(_0xa8a49e){_0x132d1a=_(_0x132d1a)[_0x7e20('0x83')](_0xa8a49e)[_0x7e20('0x84')]()[_0x7e20('0x85')]();return db[_0x7e20('0x34')][_0x7e20('0x4e')]({'where':{'id':_0x3b1a4a[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](function(_0x5762df){return db[_0x7e20('0x70')][_0x7e20('0x71')](function(_0x3e4b5f){return _0x5762df[_0x7e20('0x86')](_0x3b1a4a[_0x7e20('0x39')]['ids'],{'transaction':_0x3e4b5f})[_0x7e20('0x2a')](function(){if(!_[_0x7e20('0x87')](_0x132d1a)){return _0x5762df['removeAgents'](_0x132d1a,{'transaction':_0x3e4b5f});}})[_0x7e20('0x2a')](function(){_0x132d1a[_0x7e20('0x73')](function(_0xe03ebe){socket['emit'](_0x7e20('0x88'),{'UserId':_0xe03ebe,'MailQueueId':_0x5762df['id']});});});});});});})[_0x7e20('0x2a')](respondWithStatusCode(_0x5e3e29,null))[_0x7e20('0x4a')](handleError(_0x5e3e29,null));};exports[_0x7e20('0x89')]=function(_0x62e7a7,_0x22b2bf,_0x5e13db){return db[_0x7e20('0x34')][_0x7e20('0x4e')]({'where':{'id':_0x62e7a7[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0x22b2bf,null))[_0x7e20('0x2a')](function(_0x530e97){if(_0x530e97){return _0x530e97[_0x7e20('0x89')](_0x62e7a7[_0x7e20('0x50')]['ids'],_[_0x7e20('0x8a')](_0x62e7a7[_0x7e20('0x50')],['ids','id'])||{})[_0x7e20('0x8b')](function(_0x45fcf6){for(var _0x24cc6a=0x0;_0x24cc6a<_0x62e7a7['body'][_0x7e20('0x6a')][_0x7e20('0x4c')];_0x24cc6a+=0x1){socket[_0x7e20('0x74')](_0x7e20('0x8c'),{'UserId':Number(_0x62e7a7[_0x7e20('0x50')][_0x7e20('0x6a')][_0x24cc6a]),'MailQueueId':Number(_0x62e7a7['params']['id'])});}return _0x45fcf6;});}})['then'](respondWithResult(_0x22b2bf,null))['catch'](handleError(_0x22b2bf,null));};exports[_0x7e20('0x8d')]=function(_0x4e8f4f,_0x329d8e,_0xb98721){return db['MailQueue'][_0x7e20('0x4e')]({'where':{'id':_0x4e8f4f[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0x329d8e,null))[_0x7e20('0x2a')](function(_0x4eae2d){if(_0x4eae2d){return _0x4eae2d['removeAgents'](_0x4e8f4f[_0x7e20('0x39')][_0x7e20('0x6a')])[_0x7e20('0x2a')](function(){if(_[_0x7e20('0x8e')](_0x4e8f4f[_0x7e20('0x39')][_0x7e20('0x6a')])){for(var _0x514166=0x0;_0x514166<_0x4e8f4f[_0x7e20('0x39')]['ids']['length'];_0x514166+=0x1){socket['emit'](_0x7e20('0x88'),{'UserId':Number(_0x4e8f4f[_0x7e20('0x39')][_0x7e20('0x6a')][_0x514166]),'MailQueueId':Number(_0x4e8f4f[_0x7e20('0x58')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4e8f4f['query']['ids']),'MailQueueId':Number(_0x4e8f4f[_0x7e20('0x58')]['id'])});}});}})[_0x7e20('0x2a')](respondWithStatusCode(_0x329d8e,null))['catch'](handleError(_0x329d8e,null));};exports[_0x7e20('0x8f')]=function(_0x40e25a,_0xc1aaf9,_0x38f537){var _0x1d49de={};var _0x5988a4={};var _0x446f8c;var _0x4704d8;return db['MailQueue'][_0x7e20('0x5b')]({'where':{'id':_0x40e25a[_0x7e20('0x58')]['id']}})[_0x7e20('0x2a')](handleEntityNotFound(_0xc1aaf9,null))['then'](function(_0x32755d){if(_0x32755d){_0x446f8c=_0x32755d;_0x5988a4[_0x7e20('0x38')]=_[_0x7e20('0x3a')](db[_0x7e20('0x5f')][_0x7e20('0x35')]);_0x5988a4[_0x7e20('0x39')]=_[_0x7e20('0x3a')](_0x40e25a[_0x7e20('0x39')]);_0x5988a4[_0x7e20('0x3b')]=_[_0x7e20('0x3c')](_0x5988a4[_0x7e20('0x38')],_0x5988a4[_0x7e20('0x39')]);_0x1d49de['attributes']=_['intersection'](_0x5988a4[_0x7e20('0x38')],qs[_0x7e20('0x3e')](_0x40e25a[_0x7e20('0x39')][_0x7e20('0x3e')]));_0x1d49de[_0x7e20('0x3d')]=_0x1d49de[_0x7e20('0x3d')][_0x7e20('0x4c')]?_0x1d49de['attributes']:_0x5988a4[_0x7e20('0x38')];_0x1d49de[_0x7e20('0x41')]=qs[_0x7e20('0x42')](_0x40e25a[_0x7e20('0x39')][_0x7e20('0x42')]);_0x1d49de[_0x7e20('0x43')]=qs[_0x7e20('0x3b')](_[_0x7e20('0x5d')](_0x40e25a[_0x7e20('0x39')],_0x5988a4[_0x7e20('0x3b')]));if(_0x40e25a[_0x7e20('0x39')][_0x7e20('0x44')]){_0x1d49de[_0x7e20('0x43')]=_[_0x7e20('0x46')](_0x1d49de['where'],{'$or':_[_0x7e20('0x33')](_0x1d49de[_0x7e20('0x3d')],function(_0x26117b){var _0x1b9a1a={};_0x1b9a1a[_0x26117b]={'$like':'%'+_0x40e25a['query'][_0x7e20('0x44')]+'%'};return _0x1b9a1a;})});}_0x1d49de=_[_0x7e20('0x46')]({},_0x1d49de,_0x40e25a[_0x7e20('0x47')]);return _0x446f8c[_0x7e20('0x8f')](_0x1d49de);}})[_0x7e20('0x2a')](function(_0x3a16a3){if(_0x3a16a3){_0x4704d8=_0x3a16a3[_0x7e20('0x4c')];if(!_0x40e25a[_0x7e20('0x39')]['hasOwnProperty'](_0x7e20('0x40'))){_0x1d49de['limit']=qs[_0x7e20('0x23')](_0x40e25a[_0x7e20('0x39')]['limit']);_0x1d49de[_0x7e20('0x21')]=qs['offset'](_0x40e25a[_0x7e20('0x39')][_0x7e20('0x21')]);}return _0x446f8c[_0x7e20('0x8f')](_0x1d49de);}})[_0x7e20('0x2a')](function(_0x8cfab4){if(_0x8cfab4){return _0x8cfab4?{'count':_0x4704d8,'rows':_0x8cfab4}:null;}})[_0x7e20('0x2a')](respondWithResult(_0xc1aaf9,null))[_0x7e20('0x4a')](handleError(_0xc1aaf9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index cb4e576..d7b9457 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 _0x25b2=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x1ce9ea,_0x32e6f4){var _0x2a95b9=function(_0x1a0496){while(--_0x1a0496){_0x1ce9ea['push'](_0x1ce9ea['shift']());}};_0x2a95b9(++_0x32e6f4);}(_0x25b2,0x184));var _0x225b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x25b2[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x225b('0x0'));var MailQueue=require(_0x225b('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x225b('0x2')](0x0);var events={'afterCreate':_0x225b('0x3'),'afterUpdate':_0x225b('0x4'),'afterDestroy':_0x225b('0x5')};function emitEvent(_0x438343){return function(_0x386023,_0x447756,_0x23815b){MailQueueEvents['emit'](_0x438343+':'+_0x386023['id'],_0x386023);MailQueueEvents[_0x225b('0x6')](_0x438343,_0x386023);_0x23815b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x225b('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x7fed=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit'];(function(_0x4edaa8,_0x5512d7){var _0x21590e=function(_0x3d125a){while(--_0x3d125a){_0x4edaa8['push'](_0x4edaa8['shift']());}};_0x21590e(++_0x5512d7);}(_0x7fed,0xaa));var _0xd7fe=function(_0xc09216,_0x3e65cf){_0xc09216=_0xc09216-0x0;var _0x37a09c=_0x7fed[_0xc09216];return _0x37a09c;};'use strict';var EventEmitter=require(_0xd7fe('0x0'));var MailQueue=require(_0xd7fe('0x1'))['db'][_0xd7fe('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd7fe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd7fe('0x4')};function emitEvent(_0x4ce161){return function(_0x3a6723,_0x2f4ec9,_0x38731a){MailQueueEvents['emit'](_0x4ce161+':'+_0x3a6723['id'],_0x3a6723);MailQueueEvents[_0xd7fe('0x5')](_0x4ce161,_0x3a6723);_0x38731a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xd7fe('0x6')](e,emitEvent(event));}}module[_0xd7fe('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 4153530..4e66d83 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 _0x0e19=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./mailQueue.attributes','exports'];(function(_0x36e74c,_0x2bb5c9){var _0x1362c3=function(_0x3c4676){while(--_0x3c4676){_0x36e74c['push'](_0x36e74c['shift']());}};_0x1362c3(++_0x2bb5c9);}(_0x0e19,0x79));var _0x90e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x90e1('0x0'));var util=require(_0x90e1('0x1'));var logger=require(_0x90e1('0x2'))('api');var moment=require(_0x90e1('0x3'));var BPromise=require(_0x90e1('0x4'));var rp=require(_0x90e1('0x5'));var fs=require('fs');var path=require(_0x90e1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90e1('0x7'));module[_0x90e1('0x8')]=function(_0x18ffbf,_0x2bd50f){return _0x18ffbf[_0x90e1('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea8d=['api','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea8d,0x1af));var _0xdea8=function(_0x23a061,_0x1a8569){_0x23a061=_0x23a061-0x0;var _0x41fe47=_0xea8d[_0x23a061];return _0x41fe47;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdea8('0x0'))(_0xdea8('0x1'));var moment=require('moment');var BPromise=require(_0xdea8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdea8('0x3'));var rimraf=require(_0xdea8('0x4'));var config=require(_0xdea8('0x5'));var attributes=require(_0xdea8('0x6'));module[_0xdea8('0x7')]=function(_0x4132ab,_0x1d497d){return _0x4132ab['define'](_0xdea8('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 7ef47d1..5e33ef8 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 _0xe563=['map','model','ShowMailQueue','MailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','options','raw','attributes','include'];(function(_0x3e5e03,_0x2fac27){var _0x45279e=function(_0xb0f1c8){while(--_0xb0f1c8){_0x3e5e03['push'](_0x3e5e03['shift']());}};_0x45279e(++_0x2fac27);}(_0xe563,0x125));var _0x3e56=function(_0x4b310e,_0x2079b3){_0x4b310e=_0x4b310e-0x0;var _0x2836be=_0xe563[_0x4b310e];return _0x2836be;};'use strict';var _=require(_0x3e56('0x0'));var util=require(_0x3e56('0x1'));var moment=require(_0x3e56('0x2'));var BPromise=require(_0x3e56('0x3'));var rs=require(_0x3e56('0x4'));var fs=require('fs');var Redis=require(_0x3e56('0x5'));var db=require(_0x3e56('0x6'))['db'];var utils=require(_0x3e56('0x7'));var logger=require(_0x3e56('0x8'))(_0x3e56('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e56('0xa'));var client=jayson['client'][_0x3e56('0xb')]({'port':0x232a});config[_0x3e56('0xc')]=_[_0x3e56('0xd')](config[_0x3e56('0xc')],{'host':_0x3e56('0xe'),'port':0x18eb});var socket=require(_0x3e56('0xf'))(new Redis(config[_0x3e56('0xc')]));require(_0x3e56('0x10'))[_0x3e56('0x11')](socket);function respondWithRpcPromise(_0xf6db69,_0xac076d,_0x4b3a69){return new BPromise(function(_0x3d5dfc,_0x43d0c1){return client[_0x3e56('0x12')](_0xf6db69,_0x4b3a69)[_0x3e56('0x13')](function(_0x35e7d6){logger[_0x3e56('0x14')](_0x3e56('0x15'),_0xac076d,_0x3e56('0x16'));logger[_0x3e56('0x17')](_0x3e56('0x18'),_0xac076d,_0x3e56('0x16'),JSON[_0x3e56('0x19')](_0x35e7d6));if(_0x35e7d6['error']){if(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1b')]===0x1f4){logger['error'](_0x3e56('0x15'),_0xac076d,_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);return _0x43d0c1(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);}logger[_0x3e56('0x1a')](_0x3e56('0x15'),_0xac076d,_0x35e7d6[_0x3e56('0x1a')]['message']);return _0x3d5dfc(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);}else{logger['info'](_0x3e56('0x15'),_0xac076d,_0x3e56('0x16'));_0x3d5dfc(_0x35e7d6['result'][_0x3e56('0x1c')]);}})[_0x3e56('0x1d')](function(_0x5984e4){logger[_0x3e56('0x1a')](_0x3e56('0x15'),_0xac076d,_0x5984e4);_0x43d0c1(_0x5984e4);});});}exports[_0x3e56('0x1e')]=function(_0x27893f){var _0x15fe0c=this;return new Promise(function(_0x42c6d4,_0x1d2ec7){return db['MailQueue']['findAll']({'raw':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x20')]===undefined?!![]:![]:!![],'where':_0x27893f['options']?_0x27893f[_0x3e56('0x1f')]['where']||null:null,'attributes':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x21')]||null:null,'limit':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')]['limit']||null:null,'include':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x22')]?_[_0x3e56('0x23')](_0x27893f[_0x3e56('0x1f')][_0x3e56('0x22')],function(_0x3bfdcc){return{'model':db[_0x3bfdcc[_0x3e56('0x24')]],'as':_0x3bfdcc['as'],'attributes':_0x3bfdcc[_0x3e56('0x21')],'include':_0x3bfdcc[_0x3e56('0x22')]?_['map'](_0x3bfdcc['include'],function(_0x3614c9){return{'model':db[_0x3614c9[_0x3e56('0x24')]],'as':_0x3614c9['as'],'attributes':_0x3614c9['attributes'],'include':_0x3614c9[_0x3e56('0x22')]?_['map'](_0x3614c9[_0x3e56('0x22')],function(_0x2aafab){return{'model':db[_0x2aafab[_0x3e56('0x24')]],'as':_0x2aafab['as'],'attributes':_0x2aafab[_0x3e56('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e56('0x13')](function(_0x1dd9f1){logger['info'](_0x3e56('0x1e'),_0x27893f);logger[_0x3e56('0x17')](_0x3e56('0x1e'),_0x27893f,JSON['stringify'](_0x1dd9f1));_0x42c6d4(_0x1dd9f1);})[_0x3e56('0x1d')](function(_0x54587b){logger[_0x3e56('0x1a')](_0x3e56('0x1e'),_0x54587b[_0x3e56('0x1c')],_0x27893f);_0x1d2ec7(_0x15fe0c[_0x3e56('0x1a')](0x1f4,_0x54587b[_0x3e56('0x1c')]));});});};exports[_0x3e56('0x25')]=function(_0x49a77c){var _0x479b2b=this;return new Promise(function(_0x5b85bf,_0x44ee41){return db[_0x3e56('0x26')][_0x3e56('0x27')]({'raw':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c['options'][_0x3e56('0x20')]===undefined?!![]:![]:!![],'where':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x28')]||null:null,'attributes':_0x49a77c['options']?_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x21')]||null:null,'include':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c[_0x3e56('0x1f')]['include']?_[_0x3e56('0x23')](_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x22')],function(_0x3bb84c){return{'model':db[_0x3bb84c[_0x3e56('0x24')]],'as':_0x3bb84c['as'],'attributes':_0x3bb84c[_0x3e56('0x21')],'include':_0x3bb84c['include']?_[_0x3e56('0x23')](_0x3bb84c['include'],function(_0xeacc06){return{'model':db[_0xeacc06[_0x3e56('0x24')]],'as':_0xeacc06['as'],'attributes':_0xeacc06[_0x3e56('0x21')],'include':_0xeacc06[_0x3e56('0x22')]?_[_0x3e56('0x23')](_0xeacc06[_0x3e56('0x22')],function(_0x4f71c1){return{'model':db[_0x4f71c1[_0x3e56('0x24')]],'as':_0x4f71c1['as'],'attributes':_0x4f71c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e56('0x13')](function(_0x4675bf){logger[_0x3e56('0x14')](_0x3e56('0x25'),_0x49a77c);logger[_0x3e56('0x17')](_0x3e56('0x25'),_0x49a77c,JSON[_0x3e56('0x19')](_0x4675bf));_0x5b85bf(_0x4675bf);})[_0x3e56('0x1d')](function(_0x51d207){logger[_0x3e56('0x1a')](_0x3e56('0x25'),_0x51d207[_0x3e56('0x1c')],_0x49a77c);_0x44ee41(_0x479b2b['error'](0x1f4,_0x51d207['message']));});});}; \ No newline at end of file +var _0x3505=['result','catch','GetMailQueue','findAll','options','where','attributes','map','include','model','ShowMailQueue','find','raw','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','code','error','message'];(function(_0x2fddb3,_0x4d3999){var _0x312988=function(_0x402178){while(--_0x402178){_0x2fddb3['push'](_0x2fddb3['shift']());}};_0x312988(++_0x4d3999);}(_0x3505,0x10a));var _0x5350=function(_0x3abeeb,_0x488129){_0x3abeeb=_0x3abeeb-0x0;var _0x35131d=_0x3505[_0x3abeeb];return _0x35131d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5350('0x0'));var BPromise=require('bluebird');var rs=require(_0x5350('0x1'));var fs=require('fs');var Redis=require(_0x5350('0x2'));var db=require(_0x5350('0x3'))['db'];var utils=require(_0x5350('0x4'));var logger=require(_0x5350('0x5'))(_0x5350('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5350('0x7')]=_[_0x5350('0x8')](config[_0x5350('0x7')],{'host':_0x5350('0x9'),'port':0x18eb});var socket=require(_0x5350('0xa'))(new Redis(config['redis']));require(_0x5350('0xb'))[_0x5350('0xc')](socket);function respondWithRpcPromise(_0x3476b0,_0x3af858,_0x7d3542){return new BPromise(function(_0x4e11b1,_0x5cb986){return client[_0x5350('0xd')](_0x3476b0,_0x7d3542)[_0x5350('0xe')](function(_0x37031){logger[_0x5350('0xf')](_0x5350('0x10'),_0x3af858,_0x5350('0x11'));logger[_0x5350('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3af858,_0x5350('0x11'),JSON['stringify'](_0x37031));if(_0x37031['error']){if(_0x37031['error'][_0x5350('0x13')]===0x1f4){logger[_0x5350('0x14')](_0x5350('0x10'),_0x3af858,_0x37031[_0x5350('0x14')][_0x5350('0x15')]);return _0x5cb986(_0x37031[_0x5350('0x14')][_0x5350('0x15')]);}logger[_0x5350('0x14')]('MailQueue,\x20%s,\x20%s',_0x3af858,_0x37031['error'][_0x5350('0x15')]);return _0x4e11b1(_0x37031[_0x5350('0x14')]['message']);}else{logger[_0x5350('0xf')](_0x5350('0x10'),_0x3af858,'request\x20sent');_0x4e11b1(_0x37031[_0x5350('0x16')][_0x5350('0x15')]);}})[_0x5350('0x17')](function(_0x3377db){logger[_0x5350('0x14')](_0x5350('0x10'),_0x3af858,_0x3377db);_0x5cb986(_0x3377db);});});}exports[_0x5350('0x18')]=function(_0x396508){var _0x571392=this;return new Promise(function(_0x433b9d,_0x50da83){return db['MailQueue'][_0x5350('0x19')]({'raw':_0x396508['options']?_0x396508[_0x5350('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x396508[_0x5350('0x1a')]?_0x396508['options'][_0x5350('0x1b')]||null:null,'attributes':_0x396508[_0x5350('0x1a')]?_0x396508[_0x5350('0x1a')][_0x5350('0x1c')]||null:null,'limit':_0x396508[_0x5350('0x1a')]?_0x396508[_0x5350('0x1a')]['limit']||null:null,'include':_0x396508[_0x5350('0x1a')]?_0x396508[_0x5350('0x1a')]['include']?_[_0x5350('0x1d')](_0x396508[_0x5350('0x1a')][_0x5350('0x1e')],function(_0x32b40a){return{'model':db[_0x32b40a['model']],'as':_0x32b40a['as'],'attributes':_0x32b40a[_0x5350('0x1c')],'include':_0x32b40a[_0x5350('0x1e')]?_['map'](_0x32b40a[_0x5350('0x1e')],function(_0x14a4cb){return{'model':db[_0x14a4cb[_0x5350('0x1f')]],'as':_0x14a4cb['as'],'attributes':_0x14a4cb[_0x5350('0x1c')],'include':_0x14a4cb[_0x5350('0x1e')]?_[_0x5350('0x1d')](_0x14a4cb[_0x5350('0x1e')],function(_0x4684a4){return{'model':db[_0x4684a4[_0x5350('0x1f')]],'as':_0x4684a4['as'],'attributes':_0x4684a4[_0x5350('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5350('0xe')](function(_0x356153){logger[_0x5350('0xf')](_0x5350('0x18'),_0x396508);logger[_0x5350('0x12')](_0x5350('0x18'),_0x396508,JSON['stringify'](_0x356153));_0x433b9d(_0x356153);})[_0x5350('0x17')](function(_0xc780fb){logger[_0x5350('0x14')](_0x5350('0x18'),_0xc780fb[_0x5350('0x15')],_0x396508);_0x50da83(_0x571392[_0x5350('0x14')](0x1f4,_0xc780fb[_0x5350('0x15')]));});});};exports[_0x5350('0x20')]=function(_0x3386a2){var _0x150fed=this;return new Promise(function(_0x5eb971,_0x86dd78){return db['MailQueue'][_0x5350('0x21')]({'raw':_0x3386a2[_0x5350('0x1a')]?_0x3386a2[_0x5350('0x1a')][_0x5350('0x22')]===undefined?!![]:![]:!![],'where':_0x3386a2[_0x5350('0x1a')]?_0x3386a2['options']['where']||null:null,'attributes':_0x3386a2[_0x5350('0x1a')]?_0x3386a2['options'][_0x5350('0x1c')]||null:null,'include':_0x3386a2[_0x5350('0x1a')]?_0x3386a2[_0x5350('0x1a')][_0x5350('0x1e')]?_[_0x5350('0x1d')](_0x3386a2['options']['include'],function(_0xca2bbe){return{'model':db[_0xca2bbe['model']],'as':_0xca2bbe['as'],'attributes':_0xca2bbe[_0x5350('0x1c')],'include':_0xca2bbe['include']?_[_0x5350('0x1d')](_0xca2bbe['include'],function(_0x1cd80f){return{'model':db[_0x1cd80f[_0x5350('0x1f')]],'as':_0x1cd80f['as'],'attributes':_0x1cd80f[_0x5350('0x1c')],'include':_0x1cd80f[_0x5350('0x1e')]?_[_0x5350('0x1d')](_0x1cd80f[_0x5350('0x1e')],function(_0x53ba2c){return{'model':db[_0x53ba2c[_0x5350('0x1f')]],'as':_0x53ba2c['as'],'attributes':_0x53ba2c[_0x5350('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1588be){logger[_0x5350('0xf')](_0x5350('0x20'),_0x3386a2);logger[_0x5350('0x12')](_0x5350('0x20'),_0x3386a2,JSON[_0x5350('0x23')](_0x1588be));_0x5eb971(_0x1588be);})[_0x5350('0x17')](function(_0x169c3c){logger['error'](_0x5350('0x20'),_0x169c3c[_0x5350('0x15')],_0x3386a2);_0x86dd78(_0x150fed[_0x5350('0x14')](0x1f4,_0x169c3c[_0x5350('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index f4964eb..b8ad9b2 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 _0x2357=['./mailQueue.events','save','update','emit','removeListener','register','length','mailQueue:'];(function(_0xb61562,_0x1c8d99){var _0x4f73c0=function(_0x2445bd){while(--_0x2445bd){_0xb61562['push'](_0xb61562['shift']());}};_0x4f73c0(++_0x1c8d99);}(_0x2357,0x68));var _0x7235=function(_0x2b7c3c,_0x5cb659){_0x2b7c3c=_0x2b7c3c-0x0;var _0x59166c=_0x2357[_0x2b7c3c];return _0x59166c;};'use strict';var MailQueueEvents=require(_0x7235('0x0'));var events=[_0x7235('0x1'),'remove',_0x7235('0x2')];function createListener(_0x218b79,_0xdff686){return function(_0x5e3532){_0xdff686[_0x7235('0x3')](_0x218b79,_0x5e3532);};}function removeListener(_0x5be8ce,_0x3b710f){return function(){MailQueueEvents[_0x7235('0x4')](_0x5be8ce,_0x3b710f);};}exports[_0x7235('0x5')]=function(_0x34202b){for(var _0x3d601c=0x0,_0x31aecb=events[_0x7235('0x6')];_0x3d601c<_0x31aecb;_0x3d601c++){var _0xa9e1a8=events[_0x3d601c];var _0x9c6989=createListener(_0x7235('0x7')+_0xa9e1a8,_0x34202b);MailQueueEvents['on'](_0xa9e1a8,_0x9c6989);}}; \ No newline at end of file +var _0x6611=['remove','removeListener','mailQueue:','save'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6611,0x1bb));var _0x1661=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6611[_0x14add3];return _0x4a174f;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x1661('0x0'),_0x1661('0x1'),'update'];function createListener(_0xb6261e,_0x3bcb63){return function(_0x151f98){_0x3bcb63['emit'](_0xb6261e,_0x151f98);};}function removeListener(_0x2d1290,_0x618412){return function(){MailQueueEvents[_0x1661('0x2')](_0x2d1290,_0x618412);};}exports['register']=function(_0xa15a7f){for(var _0x48f930=0x0,_0x1b1485=events['length'];_0x48f930<_0x1b1485;_0x48f930++){var _0x3c873b=events[_0x48f930];var _0x45084d=createListener(_0x1661('0x3')+_0x3c873b,_0xa15a7f);MailQueueEvents['on'](_0x3c873b,_0x45084d);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 6b5aa0a..2ac9fd6 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 _0xd61b=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x502a1c,_0x3c8a0f){var _0xf4aef7=function(_0x5a15f7){while(--_0x5a15f7){_0x502a1c['push'](_0x502a1c['shift']());}};_0xf4aef7(++_0x3c8a0f);}(_0xd61b,0x13d));var _0xbd61=function(_0x6b23f3,_0x4189c9){_0x6b23f3=_0x6b23f3-0x0;var _0x473e8f=_0xd61b[_0x6b23f3];return _0x473e8f;};'use strict';var multer=require(_0xbd61('0x0'));var util=require(_0xbd61('0x1'));var path=require(_0xbd61('0x2'));var timeout=require(_0xbd61('0x3'));var express=require(_0xbd61('0x4'));var router=express[_0xbd61('0x5')]();var fs_extra=require(_0xbd61('0x6'));var auth=require(_0xbd61('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbd61('0x8'));var controller=require('./mailQueueReport.controller');router[_0xbd61('0x9')]('/',auth[_0xbd61('0xa')](),controller[_0xbd61('0xb')]);router[_0xbd61('0x9')](_0xbd61('0xc'),auth[_0xbd61('0xa')](),controller[_0xbd61('0xd')]);router[_0xbd61('0x9')]('/:id',auth[_0xbd61('0xa')](),controller[_0xbd61('0xe')]);router[_0xbd61('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd61('0x10')]);router[_0xbd61('0x11')](_0xbd61('0x12'),auth[_0xbd61('0xa')](),controller[_0xbd61('0x13')]);router[_0xbd61('0x14')](_0xbd61('0x12'),auth[_0xbd61('0xa')](),controller[_0xbd61('0x15')]);module[_0xbd61('0x16')]=router; \ No newline at end of file +var _0xeded=['put','/:id','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0x28989d,_0x5a83da){var _0x23f588=function(_0x3b52a7){while(--_0x3b52a7){_0x28989d['push'](_0x28989d['shift']());}};_0x23f588(++_0x5a83da);}(_0xeded,0x137));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdede('0x0'));var util=require('util');var path=require(_0xdede('0x1'));var timeout=require(_0xdede('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdede('0x3'));var auth=require(_0xdede('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdede('0x5'));var controller=require(_0xdede('0x6'));router[_0xdede('0x7')]('/',auth[_0xdede('0x8')](),controller[_0xdede('0x9')]);router[_0xdede('0x7')](_0xdede('0xa'),auth[_0xdede('0x8')](),controller[_0xdede('0xb')]);router[_0xdede('0x7')]('/:id',auth[_0xdede('0x8')](),controller['show']);router[_0xdede('0xc')]('/',auth[_0xdede('0x8')](),controller['create']);router[_0xdede('0xd')](_0xdede('0xe'),auth[_0xdede('0x8')](),controller[_0xdede('0xf')]);router[_0xdede('0x10')](_0xdede('0xe'),auth['isAuthenticated'](),controller[_0xdede('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index e3119cb..a01f109 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 _0x7627=['DATE','exports','STRING'];(function(_0x55ba5b,_0x18ca7e){var _0x2fe85f=function(_0x33fdd3){while(--_0x33fdd3){_0x55ba5b['push'](_0x55ba5b['shift']());}};_0x2fe85f(++_0x18ca7e);}(_0x7627,0x172));var _0x7762=function(_0x9e368,_0x5c4a23){_0x9e368=_0x9e368-0x0;var _0x360b8c=_0x7627[_0x9e368];return _0x360b8c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7762('0x0')]={'uniqueid':{'type':Sequelize[_0x7762('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7762('0x1')]},'joinAt':{'type':Sequelize[_0x7762('0x2')]},'leaveAt':{'type':Sequelize[_0x7762('0x2')]},'acceptAt':{'type':Sequelize[_0x7762('0x2')]},'exitAt':{'type':Sequelize[_0x7762('0x2')]},'reason':{'type':Sequelize[_0x7762('0x1')]}}; \ No newline at end of file +var _0x2e8e=['STRING','DATE','moment','sequelize'];(function(_0x5ade35,_0x35cec6){var _0x21d317=function(_0x4369b1){while(--_0x4369b1){_0x5ade35['push'](_0x5ade35['shift']());}};_0x21d317(++_0x35cec6);}(_0x2e8e,0x7e));var _0xe2e8=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x2e8e[_0x31295c];return _0x2c150e;};'use strict';var moment=require(_0xe2e8('0x0'));var Sequelize=require(_0xe2e8('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe2e8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe2e8('0x2')]},'joinAt':{'type':Sequelize[_0xe2e8('0x3')]},'leaveAt':{'type':Sequelize[_0xe2e8('0x3')]},'acceptAt':{'type':Sequelize[_0xe2e8('0x3')]},'exitAt':{'type':Sequelize[_0xe2e8('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b4f4167..6cd74dd 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 _0x4325=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','MailQueueReport','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];function respondWithStatusCode(_0x5366a0,_0x10a289){_0x10a289=_0x10a289||0xcc;return function(_0x111c54){if(_0x111c54){return _0x5366a0[_0x5432('0x17')](_0x10a289);}return _0x5366a0[_0x5432('0x18')](_0x10a289)[_0x5432('0x19')]();};}function respondWithResult(_0x1a084d,_0x54f41a){_0x54f41a=_0x54f41a||0xc8;return function(_0x5617ce){if(_0x5617ce){return _0x1a084d[_0x5432('0x18')](_0x54f41a)[_0x5432('0x1a')](_0x5617ce);}};}function respondWithFilteredResult(_0x3859d1,_0x364152){return function(_0x9d2023){if(_0x9d2023){var _0x11db3c=typeof _0x364152['offset']===_0x5432('0x1b')&&typeof _0x364152['limit']===_0x5432('0x1b');var _0x3de07a=_0x9d2023[_0x5432('0x1c')];var _0x32fe60=_0x11db3c?0x0:_0x364152[_0x5432('0x1d')];var _0x5f011f=_0x11db3c?_0x9d2023[_0x5432('0x1c')]:_0x364152[_0x5432('0x1d')]+_0x364152[_0x5432('0x1e')];var _0x2bfe04;if(_0x5f011f>=_0x3de07a){_0x5f011f=_0x3de07a;_0x2bfe04=0xc8;}else{_0x2bfe04=0xce;}_0x3859d1[_0x5432('0x18')](_0x2bfe04);return _0x3859d1[_0x5432('0x1f')](_0x5432('0x20'),_0x32fe60+'-'+_0x5f011f+'/'+_0x3de07a)['json'](_0x9d2023);}return null;};}function patchUpdates(_0x66911a){return function(_0x29cde7){try{jsonpatch[_0x5432('0x21')](_0x29cde7,_0x66911a,!![]);}catch(_0xa6c864){return BPromise[_0x5432('0x22')](_0xa6c864);}return _0x29cde7['save']();};}function saveUpdates(_0x5901e2,_0x4d09cd){return function(_0x61827e){if(_0x61827e){return _0x61827e[_0x5432('0x23')](_0x5901e2)[_0x5432('0x24')](function(_0x1f4870){return _0x1f4870;});}return null;};}function removeEntity(_0x4af9f6,_0x4af5f4){return function(_0x3e0b66){if(_0x3e0b66){return _0x3e0b66[_0x5432('0x25')]()['then'](function(){_0x4af9f6[_0x5432('0x18')](0xcc)[_0x5432('0x19')]();});}};}function handleEntityNotFound(_0x637582,_0x4b6ea5){return function(_0xd9928a){if(!_0xd9928a){_0x637582[_0x5432('0x17')](0x194);}return _0xd9928a;};}function handleError(_0xe7eda2,_0x520da1){_0x520da1=_0x520da1||0x1f4;return function(_0x4ab09d){logger[_0x5432('0x26')](_0x4ab09d[_0x5432('0x27')]);if(_0x4ab09d['name']){delete _0x4ab09d[_0x5432('0x28')];}_0xe7eda2[_0x5432('0x18')](_0x520da1)[_0x5432('0x29')](_0x4ab09d);};}exports['index']=function(_0x29dc15,_0x5be867){var _0x4821be={},_0x6fc7f5={},_0x4a52ba={'count':0x0,'rows':[]};var _0x428141=_['map'](db['MailQueueReport'][_0x5432('0x2a')],function(_0x21735e){return{'name':_0x21735e[_0x5432('0x2b')],'type':_0x21735e['type'][_0x5432('0x2c')]};});_0x6fc7f5[_0x5432('0x2d')]=_[_0x5432('0x2e')](_0x428141,_0x5432('0x28'));_0x6fc7f5[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x29dc15[_0x5432('0x2f')]);_0x6fc7f5[_0x5432('0x31')]=_[_0x5432('0x32')](_0x6fc7f5['model'],_0x6fc7f5['query']);_0x4821be[_0x5432('0x33')]=_[_0x5432('0x32')](_0x6fc7f5[_0x5432('0x2d')],qs[_0x5432('0x34')](_0x29dc15[_0x5432('0x2f')]['fields']));_0x4821be[_0x5432('0x33')]=_0x4821be['attributes'][_0x5432('0x35')]?_0x4821be[_0x5432('0x33')]:_0x6fc7f5[_0x5432('0x2d')];if(!_0x29dc15[_0x5432('0x2f')][_0x5432('0x36')](_0x5432('0x37'))){_0x4821be['limit']=qs[_0x5432('0x1e')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1e')]);_0x4821be[_0x5432('0x1d')]=qs['offset'](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1d')]);}_0x4821be[_0x5432('0x38')]=qs[_0x5432('0x39')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x39')]);_0x4821be[_0x5432('0x3a')]=qs[_0x5432('0x31')](_[_0x5432('0x3b')](_0x29dc15[_0x5432('0x2f')],_0x6fc7f5[_0x5432('0x31')]),_0x428141);if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x3c')]){_0x4821be[_0x5432('0x3a')]=_['merge'](_0x4821be[_0x5432('0x3a')],{'$or':_['map'](_0x428141,function(_0x6f5006){if(_0x6f5006[_0x5432('0x3d')]!==_0x5432('0x3e')){var _0x1a5561={};_0x1a5561[_0x6f5006['name']]={'$like':'%'+_0x29dc15['query']['filter']+'%'};return _0x1a5561;}})});}_0x4821be=_[_0x5432('0x3f')]({},_0x4821be,_0x29dc15[_0x5432('0x40')]);var _0x139d0a={'where':_0x4821be[_0x5432('0x3a')]};return db['MailQueueReport'][_0x5432('0x1c')](_0x139d0a)[_0x5432('0x24')](function(_0x3cd343){_0x4a52ba['count']=_0x3cd343;if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x41')]){_0x4821be['include']=[{'all':!![]}];}return db[_0x5432('0x42')][_0x5432('0x43')](_0x4821be);})['then'](function(_0x23f8f4){_0x4a52ba['rows']=_0x23f8f4;return _0x4a52ba;})[_0x5432('0x24')](respondWithFilteredResult(_0x5be867,_0x4821be))[_0x5432('0x44')](handleError(_0x5be867,null));};exports[_0x5432('0x45')]=function(_0x11c7f2,_0x5cf59a){var _0x9cfb8b={'raw':!![],'where':{'id':_0x11c7f2[_0x5432('0x46')]['id']}},_0x4b93b4={};_0x4b93b4[_0x5432('0x2d')]=_[_0x5432('0x30')](db[_0x5432('0x42')][_0x5432('0x2a')]);_0x4b93b4[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x11c7f2['query']);_0x4b93b4[_0x5432('0x31')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],_0x4b93b4[_0x5432('0x2f')]);_0x9cfb8b[_0x5432('0x33')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],qs['fields'](_0x11c7f2[_0x5432('0x2f')][_0x5432('0x34')]));_0x9cfb8b[_0x5432('0x33')]=_0x9cfb8b[_0x5432('0x33')][_0x5432('0x35')]?_0x9cfb8b['attributes']:_0x4b93b4[_0x5432('0x2d')];if(_0x11c7f2['query'][_0x5432('0x41')]){_0x9cfb8b[_0x5432('0x47')]=[{'all':!![]}];}_0x9cfb8b=_['merge']({},_0x9cfb8b,_0x11c7f2[_0x5432('0x40')]);return db['MailQueueReport'][_0x5432('0x48')](_0x9cfb8b)[_0x5432('0x24')](handleEntityNotFound(_0x5cf59a,null))['then'](respondWithResult(_0x5cf59a,null))['catch'](handleError(_0x5cf59a,null));};exports[_0x5432('0x49')]=function(_0xa971bd,_0x3718be){return db[_0x5432('0x42')][_0x5432('0x49')](_0xa971bd[_0x5432('0x4a')],{})[_0x5432('0x24')](respondWithResult(_0x3718be,0xc9))['catch'](handleError(_0x3718be,null));};exports[_0x5432('0x23')]=function(_0x14763c,_0x429da8){if(_0x14763c['body']['id']){delete _0x14763c['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x14763c[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x429da8,null))[_0x5432('0x24')](saveUpdates(_0x14763c[_0x5432('0x4a')],null))[_0x5432('0x24')](respondWithResult(_0x429da8,null))['catch'](handleError(_0x429da8,null));};exports[_0x5432('0x25')]=function(_0xce691b,_0x7937f9){return db['MailQueueReport'][_0x5432('0x48')]({'where':{'id':_0xce691b[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x7937f9,null))[_0x5432('0x24')](removeEntity(_0x7937f9,null))[_0x5432('0x44')](handleError(_0x7937f9,null));};exports['describe']=function(_0xbcf523,_0x5bbedb){return db[_0x5432('0x42')]['describe']()[_0x5432('0x24')](respondWithResult(_0x5bbedb,null))[_0x5432('0x44')](handleError(_0x5bbedb,null));}; \ No newline at end of file +var _0x4e2e=['name','send','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','stack'];(function(_0x272eda,_0x1c35ec){var _0x174130=function(_0x44b0b5){while(--_0x44b0b5){_0x272eda['push'](_0x272eda['shift']());}};_0x174130(++_0x1c35ec);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x2c2544,_0x2cc950){_0x2c2544=_0x2c2544-0x0;var _0x5ea450=_0x4e2e[_0x2c2544];return _0x5ea450;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];function respondWithStatusCode(_0x20d34e,_0x19c6ef){_0x19c6ef=_0x19c6ef||0xcc;return function(_0x13657c){if(_0x13657c){return _0x20d34e['sendStatus'](_0x19c6ef);}return _0x20d34e[_0xe4e2('0x1a')](_0x19c6ef)[_0xe4e2('0x1b')]();};}function respondWithResult(_0xb45217,_0x4e0bc2){_0x4e0bc2=_0x4e0bc2||0xc8;return function(_0x202486){if(_0x202486){return _0xb45217['status'](_0x4e0bc2)['json'](_0x202486);}};}function respondWithFilteredResult(_0x117a2a,_0x2d2018){return function(_0x1f9b2d){if(_0x1f9b2d){var _0x28ee12=typeof _0x2d2018[_0xe4e2('0x1c')]==='undefined'&&typeof _0x2d2018[_0xe4e2('0x1d')]===_0xe4e2('0x1e');var _0x340935=_0x1f9b2d['count'];var _0x196f16=_0x28ee12?0x0:_0x2d2018['offset'];var _0x1d5e9d=_0x28ee12?_0x1f9b2d[_0xe4e2('0x1f')]:_0x2d2018[_0xe4e2('0x1c')]+_0x2d2018[_0xe4e2('0x1d')];var _0x3dfbdf;if(_0x1d5e9d>=_0x340935){_0x1d5e9d=_0x340935;_0x3dfbdf=0xc8;}else{_0x3dfbdf=0xce;}_0x117a2a[_0xe4e2('0x1a')](_0x3dfbdf);return _0x117a2a[_0xe4e2('0x20')](_0xe4e2('0x21'),_0x196f16+'-'+_0x1d5e9d+'/'+_0x340935)[_0xe4e2('0x22')](_0x1f9b2d);}return null;};}function patchUpdates(_0x362741){return function(_0x5a84c5){try{jsonpatch[_0xe4e2('0x23')](_0x5a84c5,_0x362741,!![]);}catch(_0x2e7ecd){return BPromise[_0xe4e2('0x24')](_0x2e7ecd);}return _0x5a84c5[_0xe4e2('0x25')]();};}function saveUpdates(_0xbdf1ad,_0x23b466){return function(_0x16f14b){if(_0x16f14b){return _0x16f14b['update'](_0xbdf1ad)[_0xe4e2('0x26')](function(_0x2ab435){return _0x2ab435;});}return null;};}function removeEntity(_0x2088b9,_0x5373c0){return function(_0x353030){if(_0x353030){return _0x353030[_0xe4e2('0x27')]()['then'](function(){_0x2088b9[_0xe4e2('0x1a')](0xcc)[_0xe4e2('0x1b')]();});}};}function handleEntityNotFound(_0x29143c,_0x3f5265){return function(_0x249b7e){if(!_0x249b7e){_0x29143c['sendStatus'](0x194);}return _0x249b7e;};}function handleError(_0x166610,_0x357903){_0x357903=_0x357903||0x1f4;return function(_0x1f6d1f){logger['error'](_0x1f6d1f[_0xe4e2('0x28')]);if(_0x1f6d1f[_0xe4e2('0x29')]){delete _0x1f6d1f[_0xe4e2('0x29')];}_0x166610['status'](_0x357903)[_0xe4e2('0x2a')](_0x1f6d1f);};}exports['index']=function(_0x477b5c,_0x1e21c0){var _0x52c849={},_0x46926a={},_0x18e2e5={'count':0x0,'rows':[]};var _0x135116=_[_0xe4e2('0x2b')](db[_0xe4e2('0x2c')]['rawAttributes'],function(_0x5f30dc){return{'name':_0x5f30dc[_0xe4e2('0x2d')],'type':_0x5f30dc[_0xe4e2('0x2e')][_0xe4e2('0x2f')]};});_0x46926a[_0xe4e2('0x30')]=_[_0xe4e2('0x2b')](_0x135116,_0xe4e2('0x29'));_0x46926a[_0xe4e2('0x31')]=_[_0xe4e2('0x32')](_0x477b5c[_0xe4e2('0x31')]);_0x46926a[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x46926a[_0xe4e2('0x30')],_0x46926a['query']);_0x52c849[_0xe4e2('0x35')]=_[_0xe4e2('0x34')](_0x46926a[_0xe4e2('0x30')],qs[_0xe4e2('0x36')](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x36')]));_0x52c849['attributes']=_0x52c849[_0xe4e2('0x35')][_0xe4e2('0x37')]?_0x52c849[_0xe4e2('0x35')]:_0x46926a[_0xe4e2('0x30')];if(!_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x38')](_0xe4e2('0x39'))){_0x52c849[_0xe4e2('0x1d')]=qs[_0xe4e2('0x1d')](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x1d')]);_0x52c849['offset']=qs[_0xe4e2('0x1c')](_0x477b5c['query'][_0xe4e2('0x1c')]);}_0x52c849[_0xe4e2('0x3a')]=qs['sort'](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x3b')]);_0x52c849[_0xe4e2('0x3c')]=qs[_0xe4e2('0x33')](_['pick'](_0x477b5c[_0xe4e2('0x31')],_0x46926a['filters']),_0x135116);if(_0x477b5c[_0xe4e2('0x31')]['filter']){_0x52c849[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x52c849[_0xe4e2('0x3c')],{'$or':_['map'](_0x135116,function(_0x2f5576){if(_0x2f5576[_0xe4e2('0x2e')]!=='VIRTUAL'){var _0x2b0f61={};_0x2b0f61[_0x2f5576[_0xe4e2('0x29')]]={'$like':'%'+_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x3e')]+'%'};return _0x2b0f61;}})});}_0x52c849=_[_0xe4e2('0x3d')]({},_0x52c849,_0x477b5c[_0xe4e2('0x3f')]);var _0x18fa94={'where':_0x52c849[_0xe4e2('0x3c')]};return db[_0xe4e2('0x2c')]['count'](_0x18fa94)['then'](function(_0xf4f15f){_0x18e2e5[_0xe4e2('0x1f')]=_0xf4f15f;if(_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x40')]){_0x52c849['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xe4e2('0x41')](_0x52c849);})[_0xe4e2('0x26')](function(_0x3080d5){_0x18e2e5[_0xe4e2('0x42')]=_0x3080d5;return _0x18e2e5;})['then'](respondWithFilteredResult(_0x1e21c0,_0x52c849))[_0xe4e2('0x43')](handleError(_0x1e21c0,null));};exports[_0xe4e2('0x44')]=function(_0x385572,_0x577d4c){var _0x1b54f6={'raw':!![],'where':{'id':_0x385572[_0xe4e2('0x45')]['id']}},_0x4789cf={};_0x4789cf[_0xe4e2('0x30')]=_['keys'](db['MailQueueReport'][_0xe4e2('0x46')]);_0x4789cf[_0xe4e2('0x31')]=_[_0xe4e2('0x32')](_0x385572['query']);_0x4789cf[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x4789cf['model'],_0x4789cf[_0xe4e2('0x31')]);_0x1b54f6[_0xe4e2('0x35')]=_[_0xe4e2('0x34')](_0x4789cf[_0xe4e2('0x30')],qs[_0xe4e2('0x36')](_0x385572[_0xe4e2('0x31')][_0xe4e2('0x36')]));_0x1b54f6[_0xe4e2('0x35')]=_0x1b54f6['attributes'][_0xe4e2('0x37')]?_0x1b54f6[_0xe4e2('0x35')]:_0x4789cf['model'];if(_0x385572['query'][_0xe4e2('0x40')]){_0x1b54f6[_0xe4e2('0x47')]=[{'all':!![]}];}_0x1b54f6=_[_0xe4e2('0x3d')]({},_0x1b54f6,_0x385572['options']);return db[_0xe4e2('0x2c')][_0xe4e2('0x48')](_0x1b54f6)[_0xe4e2('0x26')](handleEntityNotFound(_0x577d4c,null))[_0xe4e2('0x26')](respondWithResult(_0x577d4c,null))['catch'](handleError(_0x577d4c,null));};exports[_0xe4e2('0x49')]=function(_0x918c17,_0x32a7c6){return db[_0xe4e2('0x2c')]['create'](_0x918c17[_0xe4e2('0x4a')],{})[_0xe4e2('0x26')](respondWithResult(_0x32a7c6,0xc9))['catch'](handleError(_0x32a7c6,null));};exports[_0xe4e2('0x4b')]=function(_0xedcd86,_0x21e5d7){if(_0xedcd86['body']['id']){delete _0xedcd86[_0xe4e2('0x4a')]['id'];}return db[_0xe4e2('0x2c')][_0xe4e2('0x48')]({'where':{'id':_0xedcd86['params']['id']}})['then'](handleEntityNotFound(_0x21e5d7,null))[_0xe4e2('0x26')](saveUpdates(_0xedcd86['body'],null))[_0xe4e2('0x26')](respondWithResult(_0x21e5d7,null))['catch'](handleError(_0x21e5d7,null));};exports[_0xe4e2('0x27')]=function(_0x2125df,_0x2a2e76){return db['MailQueueReport'][_0xe4e2('0x48')]({'where':{'id':_0x2125df['params']['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x2a2e76,null))[_0xe4e2('0x26')](removeEntity(_0x2a2e76,null))['catch'](handleError(_0x2a2e76,null));};exports[_0xe4e2('0x4c')]=function(_0x582674,_0x169251){return db[_0xe4e2('0x2c')]['describe']()[_0xe4e2('0x26')](respondWithResult(_0x169251,null))[_0xe4e2('0x43')](handleError(_0x169251,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b670062..1f966c9 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 _0x5914=['report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x5914,0x198));var _0x4591=function(_0x1f0805,_0x913381){_0x1f0805=_0x1f0805-0x0;var _0x530750=_0x5914[_0x1f0805];return _0x530750;};'use strict';var _=require(_0x4591('0x0'));var util=require('util');var logger=require(_0x4591('0x1'))(_0x4591('0x2'));var moment=require(_0x4591('0x3'));var BPromise=require(_0x4591('0x4'));var rp=require(_0x4591('0x5'));var fs=require('fs');var path=require(_0x4591('0x6'));var rimraf=require(_0x4591('0x7'));var config=require('../../config/environment');var attributes=require(_0x4591('0x8'));module[_0x4591('0x9')]=function(_0x558d8d,_0x1e6bed){return _0x558d8d[_0x4591('0xa')](_0x4591('0xb'),attributes,{'tableName':_0x4591('0xc'),'paranoid':![],'indexes':[{'name':_0x4591('0xd'),'fields':[_0x4591('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6522=['exports','define','MailQueueReport','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes'];(function(_0x12c766,_0x56c122){var _0x115acf=function(_0x423e5e){while(--_0x423e5e){_0x12c766['push'](_0x12c766['shift']());}};_0x115acf(++_0x56c122);}(_0x6522,0x1f0));var _0x2652=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6522[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2652('0x0'))(_0x2652('0x1'));var moment=require(_0x2652('0x2'));var BPromise=require(_0x2652('0x3'));var rp=require(_0x2652('0x4'));var fs=require('fs');var path=require(_0x2652('0x5'));var rimraf=require('rimraf');var config=require(_0x2652('0x6'));var attributes=require(_0x2652('0x7'));module[_0x2652('0x8')]=function(_0x4910dd,_0x45492e){return _0x4910dd[_0x2652('0x9')](_0x2652('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x2652('0xb'),'fields':[_0x2652('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 954c450..d0f95b8 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x15fab0,_0x416c7d){var _0x1b41a8=function(_0x30d165){while(--_0x30d165){_0x15fab0['push'](_0x15fab0['shift']());}};_0x1b41a8(++_0x416c7d);}(_0x2ef3,0xba));var _0x32ef=function(_0x590aaa,_0x4c22b3){_0x590aaa=_0x590aaa-0x0;var _0x1c6a84=_0x2ef3[_0x590aaa];return _0x1c6a84;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x2ef3,0xba));var _0x32ef=function(_0x505a90,_0x4a3d2a){_0x505a90=_0x505a90-0x0;var _0x3c1012=_0x2ef3[_0x505a90];return _0x3c1012;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f5e9726..fa6687e 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x122633,_0x22057b){var _0x2d02e5=function(_0x420024){while(--_0x420024){_0x122633['push'](_0x122633['shift']());}};_0x2d02e5(++_0x22057b);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1382bb,_0x24cbcb){var _0x3a209c=function(_0x4c9e43){while(--_0x4c9e43){_0x1382bb['push'](_0x1382bb['shift']());}};_0x3a209c(++_0x24cbcb);}(_0xedd9,0xfc));var _0x9edd=function(_0x2292dc,_0x51bdc6){_0x2292dc=_0x2292dc-0x0;var _0x4eaa57=_0xedd9[_0x2292dc];return _0x4eaa57;};'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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 379dc2a..3f952ba 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 _0xbeec=['STRING','INTEGER','BOOLEAN','INBOX','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbeec,0xa6));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xcbee('0x0'));module[_0xcbee('0x1')]={'description':{'type':Sequelize[_0xcbee('0x2')]},'host':{'type':Sequelize[_0xcbee('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xcbee('0x2')]},'password':{'type':Sequelize[_0xcbee('0x2')]},'port':{'type':Sequelize[_0xcbee('0x3')]},'tls':{'type':Sequelize[_0xcbee('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xcbee('0x2')],'defaultValue':_0xcbee('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xcbee('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xcbee('0x2')]},'modernAuthentication':{'type':Sequelize[_0xcbee('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9126=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9126,0x66));var _0x6912=function(_0x3a0fcf,_0x5d7e49){_0x3a0fcf=_0x3a0fcf-0x0;var _0x467bb6=_0x9126[_0x3a0fcf];return _0x467bb6;};'use strict';var Sequelize=require(_0x6912('0x0'));module[_0x6912('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6912('0x2')]},'authentication':{'type':Sequelize[_0x6912('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6912('0x2')]},'password':{'type':Sequelize[_0x6912('0x2')]},'port':{'type':Sequelize[_0x6912('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6912('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x6912('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6912('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x6912('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d92e549..58fd60f 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 _0x663a=['exports','define','MailServerIn','mail_servers_in','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x663a,0x16c));var _0xa663=function(_0x377c36,_0x44d617){_0x377c36=_0x377c36-0x0;var _0x2300d0=_0x663a[_0x377c36];return _0x2300d0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa663('0x0'))(_0xa663('0x1'));var moment=require(_0xa663('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa663('0x3'));var rimraf=require(_0xa663('0x4'));var config=require(_0xa663('0x5'));var attributes=require('./mailServerIn.attributes');module[_0xa663('0x6')]=function(_0x3cd073,_0x583b19){return _0x3cd073[_0xa663('0x7')](_0xa663('0x8'),attributes,{'tableName':_0xa663('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbe1=['api','moment','bluebird','path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0xad61b5,_0x48e93c){var _0x1852ff=function(_0x22ef81){while(--_0x22ef81){_0xad61b5['push'](_0xad61b5['shift']());}};_0x1852ff(++_0x48e93c);}(_0xfbe1,0xf4));var _0x1fbe=function(_0x282734,_0x123c5c){_0x282734=_0x282734-0x0;var _0x7e1e9a=_0xfbe1[_0x282734];return _0x7e1e9a;};'use strict';var _=require(_0x1fbe('0x0'));var util=require(_0x1fbe('0x1'));var logger=require(_0x1fbe('0x2'))(_0x1fbe('0x3'));var moment=require(_0x1fbe('0x4'));var BPromise=require(_0x1fbe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fbe('0x6'));var rimraf=require(_0x1fbe('0x7'));var config=require('../../config/environment');var attributes=require(_0x1fbe('0x8'));module[_0x1fbe('0x9')]=function(_0x1d4701,_0x39fec7){return _0x1d4701[_0x1fbe('0xa')](_0x1fbe('0xb'),attributes,{'tableName':_0x1fbe('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 525fa1a..ffffc7a 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 _0xec1c=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailServerIn','findAll','options','where','attributes','include','map','model','GetMailServerIn','stringify','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x2f4926,_0x1b1087){var _0x5aefaf=function(_0x2819c2){while(--_0x2819c2){_0x2f4926['push'](_0x2f4926['shift']());}};_0x5aefaf(++_0x1b1087);}(_0xec1c,0x1c3));var _0xcec1=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0xec1c[_0x115621];return _0x5ef5ce;};'use strict';var _=require('lodash');var util=require(_0xcec1('0x0'));var moment=require(_0xcec1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcec1('0x2'));var db=require(_0xcec1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcec1('0x4'))('rpc');var config=require(_0xcec1('0x5'));var jayson=require(_0xcec1('0x6'));var client=jayson['client'][_0xcec1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40682b,_0x2dac8e,_0x40c3dd){return new BPromise(function(_0x139832,_0x112347){return client[_0xcec1('0x8')](_0x40682b,_0x40c3dd)[_0xcec1('0x9')](function(_0x549f4a){logger[_0xcec1('0xa')](_0xcec1('0xb'),_0x2dac8e,_0xcec1('0xc'));logger[_0xcec1('0xd')](_0xcec1('0xe'),_0x2dac8e,'request\x20sent',JSON['stringify'](_0x549f4a));if(_0x549f4a[_0xcec1('0xf')]){if(_0x549f4a['error'][_0xcec1('0x10')]===0x1f4){logger['error'](_0xcec1('0xb'),_0x2dac8e,_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);return _0x112347(_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);}logger[_0xcec1('0xf')](_0xcec1('0xb'),_0x2dac8e,_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);return _0x139832(_0x549f4a['error'][_0xcec1('0x11')]);}else{logger['info'](_0xcec1('0xb'),_0x2dac8e,_0xcec1('0xc'));_0x139832(_0x549f4a['result']['message']);}})[_0xcec1('0x12')](function(_0x24ce7d){logger[_0xcec1('0xf')]('MailServerIn,\x20%s,\x20%s',_0x2dac8e,_0x24ce7d);_0x112347(_0x24ce7d);});});}exports['GetMailServerIn']=function(_0x2b741f){var _0x436fb9=this;return new Promise(function(_0x1f523c,_0x344a9b){return db[_0xcec1('0x13')][_0xcec1('0x14')]({'raw':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2b741f['options']?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x16')]||null:null,'attributes':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x17')]||null:null,'limit':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')]['limit']||null:null,'include':_0x2b741f['options']?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x18')]?_[_0xcec1('0x19')](_0x2b741f['options'][_0xcec1('0x18')],function(_0x1e5528){return{'model':db[_0x1e5528[_0xcec1('0x1a')]],'as':_0x1e5528['as'],'attributes':_0x1e5528[_0xcec1('0x17')],'include':_0x1e5528['include']?_[_0xcec1('0x19')](_0x1e5528['include'],function(_0x21d6fb){return{'model':db[_0x21d6fb['model']],'as':_0x21d6fb['as'],'attributes':_0x21d6fb[_0xcec1('0x17')],'include':_0x21d6fb[_0xcec1('0x18')]?_['map'](_0x21d6fb[_0xcec1('0x18')],function(_0x5329b4){return{'model':db[_0x5329b4[_0xcec1('0x1a')]],'as':_0x5329b4['as'],'attributes':_0x5329b4[_0xcec1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcec1('0x9')](function(_0x48717a){logger[_0xcec1('0xa')](_0xcec1('0x1b'),_0x2b741f);logger['debug'](_0xcec1('0x1b'),_0x2b741f,JSON[_0xcec1('0x1c')](_0x48717a));_0x1f523c(_0x48717a);})['catch'](function(_0x171c05){logger[_0xcec1('0xf')](_0xcec1('0x1b'),_0x171c05['message'],_0x2b741f);_0x344a9b(_0x436fb9[_0xcec1('0xf')](0x1f4,_0x171c05['message']));});});}; \ No newline at end of file +var _0x6c38=['GetMailServerIn','options','where','map','model','attributes','include','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','request','then','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch'];(function(_0x343ebf,_0xb2087a){var _0x5cb860=function(_0x18563e){while(--_0x18563e){_0x343ebf['push'](_0x343ebf['shift']());}};_0x5cb860(++_0xb2087a);}(_0x6c38,0x8f));var _0x86c3=function(_0xb9abb9,_0x327bad){_0xb9abb9=_0xb9abb9-0x0;var _0x458278=_0x6c38[_0xb9abb9];return _0x458278;};'use strict';var _=require(_0x86c3('0x0'));var util=require(_0x86c3('0x1'));var moment=require(_0x86c3('0x2'));var BPromise=require(_0x86c3('0x3'));var rs=require(_0x86c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x86c3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86c3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ff58,_0x3a8924,_0xbde89c){return new BPromise(function(_0x224109,_0x5e6afe){return client[_0x86c3('0x8')](_0x49ff58,_0xbde89c)[_0x86c3('0x9')](function(_0x4df76e){logger['info']('MailServerIn,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'));logger[_0x86c3('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'),JSON['stringify'](_0x4df76e));if(_0x4df76e[_0x86c3('0xc')]){if(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xd')]===0x1f4){logger[_0x86c3('0xc')](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x5e6afe(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xf')]);}logger['error'](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x224109(_0x4df76e[_0x86c3('0xc')]['message']);}else{logger[_0x86c3('0x10')](_0x86c3('0xe'),_0x3a8924,_0x86c3('0xa'));_0x224109(_0x4df76e[_0x86c3('0x11')][_0x86c3('0xf')]);}})[_0x86c3('0x12')](function(_0x2153dc){logger['error'](_0x86c3('0xe'),_0x3a8924,_0x2153dc);_0x5e6afe(_0x2153dc);});});}exports[_0x86c3('0x13')]=function(_0x277c0e){var _0x1da025=this;return new Promise(function(_0x505453,_0x14f63f){return db['MailServerIn']['findAll']({'raw':_0x277c0e[_0x86c3('0x14')]?_0x277c0e[_0x86c3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x277c0e[_0x86c3('0x14')]?_0x277c0e[_0x86c3('0x14')][_0x86c3('0x15')]||null:null,'attributes':_0x277c0e[_0x86c3('0x14')]?_0x277c0e[_0x86c3('0x14')]['attributes']||null:null,'limit':_0x277c0e[_0x86c3('0x14')]?_0x277c0e[_0x86c3('0x14')]['limit']||null:null,'include':_0x277c0e[_0x86c3('0x14')]?_0x277c0e[_0x86c3('0x14')]['include']?_[_0x86c3('0x16')](_0x277c0e['options']['include'],function(_0x2d3f98){return{'model':db[_0x2d3f98[_0x86c3('0x17')]],'as':_0x2d3f98['as'],'attributes':_0x2d3f98[_0x86c3('0x18')],'include':_0x2d3f98[_0x86c3('0x19')]?_[_0x86c3('0x16')](_0x2d3f98['include'],function(_0x3b4f66){return{'model':db[_0x3b4f66[_0x86c3('0x17')]],'as':_0x3b4f66['as'],'attributes':_0x3b4f66['attributes'],'include':_0x3b4f66[_0x86c3('0x19')]?_[_0x86c3('0x16')](_0x3b4f66[_0x86c3('0x19')],function(_0x415483){return{'model':db[_0x415483[_0x86c3('0x17')]],'as':_0x415483['as'],'attributes':_0x415483['attributes']};}):[]};}):[]};}):[]:[]})[_0x86c3('0x9')](function(_0x2c5802){logger[_0x86c3('0x10')](_0x86c3('0x13'),_0x277c0e);logger[_0x86c3('0xb')](_0x86c3('0x13'),_0x277c0e,JSON[_0x86c3('0x1a')](_0x2c5802));_0x505453(_0x2c5802);})['catch'](function(_0x38cf3c){logger[_0x86c3('0xc')](_0x86c3('0x13'),_0x38cf3c[_0x86c3('0xf')],_0x277c0e);_0x14f63f(_0x1da025[_0x86c3('0xc')](0x1f4,_0x38cf3c[_0x86c3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d808653..051e86e 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x6ee1cc,_0x476a8c){_0x6ee1cc=_0x6ee1cc-0x0;var _0x890792=_0x7a54[_0x6ee1cc];return _0x890792;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e11ed,_0xd2e1c3){_0x4e11ed=_0x4e11ed-0x0;var _0x4b8a67=_0x7a54[_0x4e11ed];return _0x4b8a67;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 5967030..5420404 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 _0xda3f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x3cbe3a,_0x78bfce){var _0x24ffc1=function(_0x103ae4){while(--_0x103ae4){_0x3cbe3a['push'](_0x3cbe3a['shift']());}};_0x24ffc1(++_0x78bfce);}(_0xda3f,0xec));var _0xfda3=function(_0xbdb315,_0x45d19e){_0xbdb315=_0xbdb315-0x0;var _0x36b339=_0xda3f[_0xbdb315];return _0x36b339;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'description':{'type':Sequelize[_0xfda3('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfda3('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xfda3('0x1')]},'authentication':{'type':Sequelize[_0xfda3('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7916=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0xdbbdc2,_0x16a3be){var _0x20f387=function(_0x215f7d){while(--_0x215f7d){_0xdbbdc2['push'](_0xdbbdc2['shift']());}};_0x20f387(++_0x16a3be);}(_0x7916,0x128));var _0x6791=function(_0x5f18ff,_0x28c4d1){_0x5f18ff=_0x5f18ff-0x0;var _0x34a6b4=_0x7916[_0x5f18ff];return _0x34a6b4;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'description':{'type':Sequelize[_0x6791('0x1')]},'host':{'type':Sequelize[_0x6791('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x6791('0x1')]},'port':{'type':Sequelize[_0x6791('0x2')]},'secure':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x6791('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d4e3f05..6bc7552 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 _0x5951=['error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3203c9,_0x1a3086){var _0x446beb=function(_0x3afb5e){while(--_0x3afb5e){_0x3203c9['push'](_0x3203c9['shift']());}};_0x446beb(++_0x1a3086);}(_0x5951,0x1b0));var _0x1595=function(_0x2bd1a7,_0x473d24){_0x2bd1a7=_0x2bd1a7-0x0;var _0x526bb4=_0x5951[_0x2bd1a7];return _0x526bb4;};'use strict';var emlformat=require(_0x1595('0x0'));var rimraf=require(_0x1595('0x1'));var zipdir=require(_0x1595('0x2'));var jsonpatch=require(_0x1595('0x3'));var rp=require('request-promise');var moment=require(_0x1595('0x4'));var BPromise=require(_0x1595('0x5'));var Mustache=require(_0x1595('0x6'));var util=require(_0x1595('0x7'));var path=require(_0x1595('0x8'));var sox=require('sox');var csv=require(_0x1595('0x9'));var ejs=require(_0x1595('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1595('0xb'));var squel=require(_0x1595('0xc'));var crypto=require(_0x1595('0xd'));var jsforce=require(_0x1595('0xe'));var deskjs=require(_0x1595('0xf'));var toCsv=require(_0x1595('0x9'));var querystring=require(_0x1595('0x10'));var Papa=require(_0x1595('0x11'));var Redis=require('ioredis');var authService=require(_0x1595('0x12'));var qs=require(_0x1595('0x13'));var as=require(_0x1595('0x14'));var hardwareService=require(_0x1595('0x15'));var logger=require(_0x1595('0x16'))(_0x1595('0x17'));var utils=require(_0x1595('0x18'));var config=require(_0x1595('0x19'));var licenseUtil=require(_0x1595('0x1a'));var db=require(_0x1595('0x1b'))['db'];function respondWithStatusCode(_0x3ef5fc,_0x425d78){_0x425d78=_0x425d78||0xcc;return function(_0x395107){if(_0x395107){return _0x3ef5fc['sendStatus'](_0x425d78);}return _0x3ef5fc[_0x1595('0x1c')](_0x425d78)[_0x1595('0x1d')]();};}function respondWithResult(_0x415f65,_0x144889){_0x144889=_0x144889||0xc8;return function(_0x33cc07){if(_0x33cc07){return _0x415f65[_0x1595('0x1c')](_0x144889)[_0x1595('0x1e')](_0x33cc07);}};}function respondWithFilteredResult(_0xd70777,_0x103fce){return function(_0x1804cb){if(_0x1804cb){var _0x4d9653=typeof _0x103fce[_0x1595('0x1f')]===_0x1595('0x20')&&typeof _0x103fce[_0x1595('0x21')]==='undefined';var _0x30c8cc=_0x1804cb[_0x1595('0x22')];var _0x2f5ead=_0x4d9653?0x0:_0x103fce[_0x1595('0x1f')];var _0x4f242c=_0x4d9653?_0x1804cb[_0x1595('0x22')]:_0x103fce[_0x1595('0x1f')]+_0x103fce[_0x1595('0x21')];var _0xe6492f;if(_0x4f242c>=_0x30c8cc){_0x4f242c=_0x30c8cc;_0xe6492f=0xc8;}else{_0xe6492f=0xce;}_0xd70777[_0x1595('0x1c')](_0xe6492f);return _0xd70777['set'](_0x1595('0x23'),_0x2f5ead+'-'+_0x4f242c+'/'+_0x30c8cc)[_0x1595('0x1e')](_0x1804cb);}return null;};}function patchUpdates(_0x31f1db){return function(_0x227db3){try{jsonpatch[_0x1595('0x24')](_0x227db3,_0x31f1db,!![]);}catch(_0x2de79d){return BPromise[_0x1595('0x25')](_0x2de79d);}return _0x227db3[_0x1595('0x26')]();};}function saveUpdates(_0x3d91d6,_0x53cffe){return function(_0x27a753){if(_0x27a753){return _0x27a753[_0x1595('0x27')](_0x3d91d6)[_0x1595('0x28')](function(_0x1bbbc6){return _0x1bbbc6;});}return null;};}function removeEntity(_0x5ee860,_0x30bd30){return function(_0x1e9695){if(_0x1e9695){return _0x1e9695[_0x1595('0x29')]()[_0x1595('0x28')](function(){_0x5ee860[_0x1595('0x1c')](0xcc)[_0x1595('0x1d')]();});}};}function handleEntityNotFound(_0x2901d8,_0x324bd2){return function(_0x58c3c9){if(!_0x58c3c9){_0x2901d8['sendStatus'](0x194);}return _0x58c3c9;};}function handleError(_0x5d2647,_0x4bf3ff){_0x4bf3ff=_0x4bf3ff||0x1f4;return function(_0x48a8de){logger[_0x1595('0x2a')](_0x48a8de[_0x1595('0x2b')]);if(_0x48a8de[_0x1595('0x2c')]){delete _0x48a8de[_0x1595('0x2c')];}_0x5d2647[_0x1595('0x1c')](_0x4bf3ff)[_0x1595('0x2d')](_0x48a8de);};}exports[_0x1595('0x2e')]=function(_0x2f7041,_0x21d83d){var _0x22fe18={},_0x4a0b5d={},_0x356da3={'count':0x0,'rows':[]};var _0x32757e=_['map'](db[_0x1595('0x2f')][_0x1595('0x30')],function(_0x1ba66f){return{'name':_0x1ba66f[_0x1595('0x31')],'type':_0x1ba66f[_0x1595('0x32')]['key']};});_0x4a0b5d[_0x1595('0x33')]=_[_0x1595('0x34')](_0x32757e,_0x1595('0x2c'));_0x4a0b5d[_0x1595('0x35')]=_[_0x1595('0x36')](_0x2f7041[_0x1595('0x35')]);_0x4a0b5d[_0x1595('0x37')]=_['intersection'](_0x4a0b5d[_0x1595('0x33')],_0x4a0b5d[_0x1595('0x35')]);_0x22fe18[_0x1595('0x38')]=_[_0x1595('0x39')](_0x4a0b5d[_0x1595('0x33')],qs[_0x1595('0x3a')](_0x2f7041[_0x1595('0x35')][_0x1595('0x3a')]));_0x22fe18['attributes']=_0x22fe18['attributes'][_0x1595('0x3b')]?_0x22fe18[_0x1595('0x38')]:_0x4a0b5d['model'];if(!_0x2f7041[_0x1595('0x35')][_0x1595('0x3c')](_0x1595('0x3d'))){_0x22fe18[_0x1595('0x21')]=qs[_0x1595('0x21')](_0x2f7041[_0x1595('0x35')][_0x1595('0x21')]);_0x22fe18[_0x1595('0x1f')]=qs[_0x1595('0x1f')](_0x2f7041[_0x1595('0x35')]['offset']);}_0x22fe18[_0x1595('0x3e')]=qs[_0x1595('0x3f')](_0x2f7041[_0x1595('0x35')]['sort']);_0x22fe18[_0x1595('0x40')]=qs['filters'](_[_0x1595('0x41')](_0x2f7041[_0x1595('0x35')],_0x4a0b5d[_0x1595('0x37')]),_0x32757e);if(_0x2f7041[_0x1595('0x35')]['filter']){_0x22fe18['where']=_[_0x1595('0x42')](_0x22fe18['where'],{'$or':_[_0x1595('0x34')](_0x32757e,function(_0x307654){if(_0x307654[_0x1595('0x32')]!==_0x1595('0x43')){var _0x4f8a13={};_0x4f8a13[_0x307654[_0x1595('0x2c')]]={'$like':'%'+_0x2f7041[_0x1595('0x35')][_0x1595('0x44')]+'%'};return _0x4f8a13;}})});}_0x22fe18=_[_0x1595('0x42')]({},_0x22fe18,_0x2f7041['options']);var _0x3b4294={'where':_0x22fe18[_0x1595('0x40')]};return db[_0x1595('0x2f')]['count'](_0x3b4294)['then'](function(_0x55c9e7){_0x356da3[_0x1595('0x22')]=_0x55c9e7;if(_0x2f7041[_0x1595('0x35')][_0x1595('0x45')]){_0x22fe18[_0x1595('0x46')]=[{'all':!![]}];}return db[_0x1595('0x2f')]['findAll'](_0x22fe18);})[_0x1595('0x28')](function(_0x2dc079){_0x356da3[_0x1595('0x47')]=_0x2dc079;return _0x356da3;})['then'](respondWithFilteredResult(_0x21d83d,_0x22fe18))[_0x1595('0x48')](handleError(_0x21d83d,null));};exports[_0x1595('0x49')]=function(_0xfebdb9,_0x3f4aa5){var _0x33c409={'raw':!![],'where':{'id':_0xfebdb9[_0x1595('0x4a')]['id']}},_0x5e1bd5={};_0x5e1bd5['model']=_[_0x1595('0x36')](db['MailServerOut'][_0x1595('0x30')]);_0x5e1bd5[_0x1595('0x35')]=_[_0x1595('0x36')](_0xfebdb9['query']);_0x5e1bd5['filters']=_[_0x1595('0x39')](_0x5e1bd5['model'],_0x5e1bd5[_0x1595('0x35')]);_0x33c409[_0x1595('0x38')]=_[_0x1595('0x39')](_0x5e1bd5['model'],qs[_0x1595('0x3a')](_0xfebdb9['query'][_0x1595('0x3a')]));_0x33c409[_0x1595('0x38')]=_0x33c409[_0x1595('0x38')]['length']?_0x33c409[_0x1595('0x38')]:_0x5e1bd5[_0x1595('0x33')];if(_0xfebdb9[_0x1595('0x35')][_0x1595('0x45')]){_0x33c409[_0x1595('0x46')]=[{'all':!![]}];}_0x33c409=_[_0x1595('0x42')]({},_0x33c409,_0xfebdb9[_0x1595('0x4b')]);return db['MailServerOut']['find'](_0x33c409)['then'](handleEntityNotFound(_0x3f4aa5,null))['then'](respondWithResult(_0x3f4aa5,null))[_0x1595('0x48')](handleError(_0x3f4aa5,null));};exports['create']=function(_0xab0135,_0x189014){return db[_0x1595('0x2f')][_0x1595('0x4c')](_0xab0135[_0x1595('0x4d')],{})[_0x1595('0x28')](respondWithResult(_0x189014,0xc9))[_0x1595('0x48')](handleError(_0x189014,null));};exports['update']=function(_0x3f8c58,_0x596625){if(_0x3f8c58[_0x1595('0x4d')]['id']){delete _0x3f8c58[_0x1595('0x4d')]['id'];}return db[_0x1595('0x2f')][_0x1595('0x4e')]({'where':{'id':_0x3f8c58[_0x1595('0x4a')]['id']}})[_0x1595('0x28')](handleEntityNotFound(_0x596625,null))[_0x1595('0x28')](saveUpdates(_0x3f8c58[_0x1595('0x4d')],null))[_0x1595('0x28')](respondWithResult(_0x596625,null))[_0x1595('0x48')](handleError(_0x596625,null));};exports['destroy']=function(_0x15e4b4,_0x2fdbd2){return db[_0x1595('0x2f')][_0x1595('0x4e')]({'where':{'id':_0x15e4b4[_0x1595('0x4a')]['id']}})[_0x1595('0x28')](handleEntityNotFound(_0x2fdbd2,null))[_0x1595('0x28')](removeEntity(_0x2fdbd2,null))['catch'](handleError(_0x2fdbd2,null));}; \ No newline at end of file +var _0x5cf8=['map','MailServerOut','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','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/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','save','then','sendStatus','error','stack','name','send'];(function(_0x3e6c74,_0x1e5e16){var _0x46f3fc=function(_0x17d9ab){while(--_0x17d9ab){_0x3e6c74['push'](_0x3e6c74['shift']());}};_0x46f3fc(++_0x1e5e16);}(_0x5cf8,0x14c));var _0x85cf=function(_0x50e89b,_0x4bded8){_0x50e89b=_0x50e89b-0x0;var _0x4b9202=_0x5cf8[_0x50e89b];return _0x4b9202;};'use strict';var emlformat=require(_0x85cf('0x0'));var rimraf=require(_0x85cf('0x1'));var zipdir=require(_0x85cf('0x2'));var jsonpatch=require(_0x85cf('0x3'));var rp=require(_0x85cf('0x4'));var moment=require(_0x85cf('0x5'));var BPromise=require(_0x85cf('0x6'));var Mustache=require('mustache');var util=require(_0x85cf('0x7'));var path=require(_0x85cf('0x8'));var sox=require(_0x85cf('0x9'));var csv=require(_0x85cf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85cf('0xb'));var _=require(_0x85cf('0xc'));var squel=require(_0x85cf('0xd'));var crypto=require(_0x85cf('0xe'));var jsforce=require(_0x85cf('0xf'));var deskjs=require(_0x85cf('0x10'));var toCsv=require(_0x85cf('0xa'));var querystring=require(_0x85cf('0x11'));var Papa=require(_0x85cf('0x12'));var Redis=require(_0x85cf('0x13'));var authService=require(_0x85cf('0x14'));var qs=require(_0x85cf('0x15'));var as=require(_0x85cf('0x16'));var hardwareService=require(_0x85cf('0x17'));var logger=require(_0x85cf('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x85cf('0x19'));var licenseUtil=require(_0x85cf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe5de76,_0x58efc2){_0x58efc2=_0x58efc2||0xcc;return function(_0x353159){if(_0x353159){return _0xe5de76['sendStatus'](_0x58efc2);}return _0xe5de76[_0x85cf('0x1b')](_0x58efc2)[_0x85cf('0x1c')]();};}function respondWithResult(_0x14e8c1,_0x19c3fc){_0x19c3fc=_0x19c3fc||0xc8;return function(_0x1c3c0f){if(_0x1c3c0f){return _0x14e8c1[_0x85cf('0x1b')](_0x19c3fc)['json'](_0x1c3c0f);}};}function respondWithFilteredResult(_0x2e0bb5,_0x27d5a6){return function(_0xdeb1e4){if(_0xdeb1e4){var _0x536f37=typeof _0x27d5a6[_0x85cf('0x1d')]===_0x85cf('0x1e')&&typeof _0x27d5a6[_0x85cf('0x1f')]==='undefined';var _0x23afaf=_0xdeb1e4['count'];var _0x2d2e99=_0x536f37?0x0:_0x27d5a6[_0x85cf('0x1d')];var _0x946d44=_0x536f37?_0xdeb1e4[_0x85cf('0x20')]:_0x27d5a6[_0x85cf('0x1d')]+_0x27d5a6[_0x85cf('0x1f')];var _0x5a29a2;if(_0x946d44>=_0x23afaf){_0x946d44=_0x23afaf;_0x5a29a2=0xc8;}else{_0x5a29a2=0xce;}_0x2e0bb5['status'](_0x5a29a2);return _0x2e0bb5[_0x85cf('0x21')]('Content-Range',_0x2d2e99+'-'+_0x946d44+'/'+_0x23afaf)[_0x85cf('0x22')](_0xdeb1e4);}return null;};}function patchUpdates(_0x5579c4){return function(_0x36d4ec){try{jsonpatch[_0x85cf('0x23')](_0x36d4ec,_0x5579c4,!![]);}catch(_0x169dbc){return BPromise['reject'](_0x169dbc);}return _0x36d4ec[_0x85cf('0x24')]();};}function saveUpdates(_0x8c1b1b,_0x30d493){return function(_0x1e0c62){if(_0x1e0c62){return _0x1e0c62['update'](_0x8c1b1b)[_0x85cf('0x25')](function(_0x436234){return _0x436234;});}return null;};}function removeEntity(_0x5b8eec,_0x20f84f){return function(_0x26da4a){if(_0x26da4a){return _0x26da4a['destroy']()[_0x85cf('0x25')](function(){_0x5b8eec[_0x85cf('0x1b')](0xcc)[_0x85cf('0x1c')]();});}};}function handleEntityNotFound(_0x1f23e0,_0x5df5bc){return function(_0x32f587){if(!_0x32f587){_0x1f23e0[_0x85cf('0x26')](0x194);}return _0x32f587;};}function handleError(_0x5ef32f,_0x1f2987){_0x1f2987=_0x1f2987||0x1f4;return function(_0x5193f6){logger[_0x85cf('0x27')](_0x5193f6[_0x85cf('0x28')]);if(_0x5193f6[_0x85cf('0x29')]){delete _0x5193f6['name'];}_0x5ef32f[_0x85cf('0x1b')](_0x1f2987)[_0x85cf('0x2a')](_0x5193f6);};}exports['index']=function(_0x96b242,_0xdc64fb){var _0x5a48c3={},_0xb99a88={},_0x5bda90={'count':0x0,'rows':[]};var _0x5c5699=_[_0x85cf('0x2b')](db[_0x85cf('0x2c')][_0x85cf('0x2d')],function(_0x50a62e){return{'name':_0x50a62e['fieldName'],'type':_0x50a62e['type'][_0x85cf('0x2e')]};});_0xb99a88['model']=_[_0x85cf('0x2b')](_0x5c5699,_0x85cf('0x29'));_0xb99a88[_0x85cf('0x2f')]=_[_0x85cf('0x30')](_0x96b242[_0x85cf('0x2f')]);_0xb99a88[_0x85cf('0x31')]=_[_0x85cf('0x32')](_0xb99a88['model'],_0xb99a88[_0x85cf('0x2f')]);_0x5a48c3[_0x85cf('0x33')]=_[_0x85cf('0x32')](_0xb99a88[_0x85cf('0x34')],qs[_0x85cf('0x35')](_0x96b242[_0x85cf('0x2f')]['fields']));_0x5a48c3[_0x85cf('0x33')]=_0x5a48c3[_0x85cf('0x33')]['length']?_0x5a48c3[_0x85cf('0x33')]:_0xb99a88[_0x85cf('0x34')];if(!_0x96b242['query']['hasOwnProperty'](_0x85cf('0x36'))){_0x5a48c3[_0x85cf('0x1f')]=qs[_0x85cf('0x1f')](_0x96b242['query']['limit']);_0x5a48c3[_0x85cf('0x1d')]=qs[_0x85cf('0x1d')](_0x96b242['query'][_0x85cf('0x1d')]);}_0x5a48c3[_0x85cf('0x37')]=qs[_0x85cf('0x38')](_0x96b242['query'][_0x85cf('0x38')]);_0x5a48c3[_0x85cf('0x39')]=qs[_0x85cf('0x31')](_[_0x85cf('0x3a')](_0x96b242[_0x85cf('0x2f')],_0xb99a88['filters']),_0x5c5699);if(_0x96b242['query']['filter']){_0x5a48c3[_0x85cf('0x39')]=_['merge'](_0x5a48c3[_0x85cf('0x39')],{'$or':_['map'](_0x5c5699,function(_0x4d37aa){if(_0x4d37aa['type']!==_0x85cf('0x3b')){var _0x51c678={};_0x51c678[_0x4d37aa[_0x85cf('0x29')]]={'$like':'%'+_0x96b242[_0x85cf('0x2f')][_0x85cf('0x3c')]+'%'};return _0x51c678;}})});}_0x5a48c3=_[_0x85cf('0x3d')]({},_0x5a48c3,_0x96b242[_0x85cf('0x3e')]);var _0x26510f={'where':_0x5a48c3[_0x85cf('0x39')]};return db[_0x85cf('0x2c')][_0x85cf('0x20')](_0x26510f)['then'](function(_0x2d2828){_0x5bda90[_0x85cf('0x20')]=_0x2d2828;if(_0x96b242[_0x85cf('0x2f')][_0x85cf('0x3f')]){_0x5a48c3[_0x85cf('0x40')]=[{'all':!![]}];}return db[_0x85cf('0x2c')][_0x85cf('0x41')](_0x5a48c3);})['then'](function(_0x297337){_0x5bda90[_0x85cf('0x42')]=_0x297337;return _0x5bda90;})['then'](respondWithFilteredResult(_0xdc64fb,_0x5a48c3))[_0x85cf('0x43')](handleError(_0xdc64fb,null));};exports[_0x85cf('0x44')]=function(_0x3dfb94,_0x260502){var _0x26084e={'raw':!![],'where':{'id':_0x3dfb94[_0x85cf('0x45')]['id']}},_0x4381ac={};_0x4381ac[_0x85cf('0x34')]=_[_0x85cf('0x30')](db[_0x85cf('0x2c')][_0x85cf('0x2d')]);_0x4381ac[_0x85cf('0x2f')]=_['keys'](_0x3dfb94[_0x85cf('0x2f')]);_0x4381ac[_0x85cf('0x31')]=_[_0x85cf('0x32')](_0x4381ac[_0x85cf('0x34')],_0x4381ac['query']);_0x26084e[_0x85cf('0x33')]=_[_0x85cf('0x32')](_0x4381ac[_0x85cf('0x34')],qs[_0x85cf('0x35')](_0x3dfb94['query'][_0x85cf('0x35')]));_0x26084e[_0x85cf('0x33')]=_0x26084e[_0x85cf('0x33')]['length']?_0x26084e[_0x85cf('0x33')]:_0x4381ac[_0x85cf('0x34')];if(_0x3dfb94['query'][_0x85cf('0x3f')]){_0x26084e[_0x85cf('0x40')]=[{'all':!![]}];}_0x26084e=_[_0x85cf('0x3d')]({},_0x26084e,_0x3dfb94['options']);return db[_0x85cf('0x2c')][_0x85cf('0x46')](_0x26084e)[_0x85cf('0x25')](handleEntityNotFound(_0x260502,null))['then'](respondWithResult(_0x260502,null))[_0x85cf('0x43')](handleError(_0x260502,null));};exports[_0x85cf('0x47')]=function(_0x3ca494,_0x367a9e){return db[_0x85cf('0x2c')][_0x85cf('0x47')](_0x3ca494[_0x85cf('0x48')],{})[_0x85cf('0x25')](respondWithResult(_0x367a9e,0xc9))[_0x85cf('0x43')](handleError(_0x367a9e,null));};exports[_0x85cf('0x49')]=function(_0x198b6d,_0x382e6b){if(_0x198b6d[_0x85cf('0x48')]['id']){delete _0x198b6d['body']['id'];}return db[_0x85cf('0x2c')]['find']({'where':{'id':_0x198b6d[_0x85cf('0x45')]['id']}})[_0x85cf('0x25')](handleEntityNotFound(_0x382e6b,null))[_0x85cf('0x25')](saveUpdates(_0x198b6d[_0x85cf('0x48')],null))[_0x85cf('0x25')](respondWithResult(_0x382e6b,null))[_0x85cf('0x43')](handleError(_0x382e6b,null));};exports[_0x85cf('0x4a')]=function(_0x380863,_0x1b1f43){return db[_0x85cf('0x2c')][_0x85cf('0x46')]({'where':{'id':_0x380863[_0x85cf('0x45')]['id']}})[_0x85cf('0x25')](handleEntityNotFound(_0x1b1f43,null))['then'](removeEntity(_0x1b1f43,null))[_0x85cf('0x43')](handleError(_0x1b1f43,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 4903cf1..dad5212 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 _0x06d0=['MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x06d0,0x1ef));var _0x006d=function(_0x16722c,_0x4b554c){_0x16722c=_0x16722c-0x0;var _0x20f59c=_0x06d0[_0x16722c];return _0x20f59c;};'use strict';var _=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var logger=require(_0x006d('0x2'))(_0x006d('0x3'));var moment=require(_0x006d('0x4'));var BPromise=require(_0x006d('0x5'));var rp=require(_0x006d('0x6'));var fs=require('fs');var path=require(_0x006d('0x7'));var rimraf=require(_0x006d('0x8'));var config=require(_0x006d('0x9'));var attributes=require(_0x006d('0xa'));module['exports']=function(_0x1b1645,_0x413ddb){return _0x1b1645[_0x006d('0xb')](_0x006d('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4f1=['./mailServerOut.attributes','define','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x290acc,_0x390e04){var _0x1f82a5=function(_0x5d4837){while(--_0x5d4837){_0x290acc['push'](_0x290acc['shift']());}};_0x1f82a5(++_0x390e04);}(_0xa4f1,0x1a6));var _0x1a4f=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xa4f1[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x1a4f('0x0'));var util=require(_0x1a4f('0x1'));var logger=require(_0x1a4f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a4f('0x3'));var rp=require(_0x1a4f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1a4f('0x5'));module['exports']=function(_0x16f381,_0x408127){return _0x16f381[_0x1a4f('0x6')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index cffb136..d6ae531 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5249b6,_0x2f9fb8){_0x5249b6=_0x5249b6-0x0;var _0x4bffe3=_0x7a54[_0x5249b6];return _0x4bffe3;};'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')]('MailServerOut,\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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2ace71,_0xac8058){var _0x815c1b=function(_0x474b48){while(--_0x474b48){_0x2ace71['push'](_0x2ace71['shift']());}};_0x815c1b(++_0xac8058);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44e984,_0x45e8ff){_0x44e984=_0x44e984-0x0;var _0x450b68=_0x5f2f[_0x44e984];return _0x450b68;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 62bae3e..3110dfb 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 _0x07bd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x5f0a64,_0x11207b){var _0x1aae31=function(_0x5a6d51){while(--_0x5a6d51){_0x5f0a64['push'](_0x5f0a64['shift']());}};_0x1aae31(++_0x11207b);}(_0x07bd,0x13c));var _0xd07b=function(_0x2fe0b9,_0x1a62fc){_0x2fe0b9=_0x2fe0b9-0x0;var _0x494c7a=_0x07bd[_0x2fe0b9];return _0x494c7a;};'use strict';var multer=require(_0xd07b('0x0'));var util=require(_0xd07b('0x1'));var path=require(_0xd07b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd07b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd07b('0x4'));var interaction=require(_0xd07b('0x5'));var config=require(_0xd07b('0x6'));var controller=require(_0xd07b('0x7'));router[_0xd07b('0x8')]('/',auth[_0xd07b('0x9')](),controller[_0xd07b('0xa')]);router[_0xd07b('0x8')]('/describe',auth[_0xd07b('0x9')](),controller[_0xd07b('0xb')]);router['get'](_0xd07b('0xc'),auth[_0xd07b('0x9')](),controller['show']);router[_0xd07b('0xd')]('/',auth[_0xd07b('0x9')](),controller[_0xd07b('0xe')]);router[_0xd07b('0xf')](_0xd07b('0xc'),auth[_0xd07b('0x9')](),controller[_0xd07b('0x10')]);router[_0xd07b('0x11')]('/:id',auth[_0xd07b('0x9')](),controller[_0xd07b('0x12')]);module[_0xd07b('0x13')]=router; \ No newline at end of file +var _0x6b38=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./mailSubstatus.controller','get'];(function(_0x2cfd98,_0x464ec5){var _0x1856a0=function(_0x1350ea){while(--_0x1350ea){_0x2cfd98['push'](_0x2cfd98['shift']());}};_0x1856a0(++_0x464ec5);}(_0x6b38,0x110));var _0x86b3=function(_0x23c4b0,_0x2209f1){_0x23c4b0=_0x23c4b0-0x0;var _0x56692c=_0x6b38[_0x23c4b0];return _0x56692c;};'use strict';var multer=require('multer');var util=require(_0x86b3('0x0'));var path=require(_0x86b3('0x1'));var timeout=require(_0x86b3('0x2'));var express=require(_0x86b3('0x3'));var router=express[_0x86b3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x86b3('0x5'));var controller=require(_0x86b3('0x6'));router[_0x86b3('0x7')]('/',auth[_0x86b3('0x8')](),controller[_0x86b3('0x9')]);router[_0x86b3('0x7')](_0x86b3('0xa'),auth[_0x86b3('0x8')](),controller[_0x86b3('0xb')]);router[_0x86b3('0x7')](_0x86b3('0xc'),auth[_0x86b3('0x8')](),controller[_0x86b3('0xd')]);router[_0x86b3('0xe')]('/',auth[_0x86b3('0x8')](),controller['create']);router[_0x86b3('0xf')](_0x86b3('0xc'),auth[_0x86b3('0x8')](),controller[_0x86b3('0x10')]);router[_0x86b3('0x11')](_0x86b3('0xc'),auth['isAuthenticated'](),controller[_0x86b3('0x12')]);module[_0x86b3('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 56f7904..0d51389 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 _0x8ace=['sequelize','exports','STRING','name'];(function(_0x5b32e4,_0x3572ae){var _0x5ced34=function(_0x16dda1){while(--_0x16dda1){_0x5b32e4['push'](_0x5b32e4['shift']());}};_0x5ced34(++_0x3572ae);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0x8ace[_0x3937b6];return _0x1ba356;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8ac('0x2')]}}; \ No newline at end of file +var _0x4317=['name','exports','STRING'];(function(_0x24f6d2,_0x15b459){var _0x21bb73=function(_0x132a9f){while(--_0x132a9f){_0x24f6d2['push'](_0x24f6d2['shift']());}};_0x21bb73(++_0x15b459);}(_0x4317,0x7c));var _0x7431=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4317[_0x2f5ac5];return _0x37c9a8;};'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 55a448a..07999bf 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 _0x2444=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x2444,0x153));var _0x4244=function(_0x304487,_0x58f5ea){_0x304487=_0x304487-0x0;var _0xfd14db=_0x2444[_0x304487];return _0xfd14db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4244('0x0'));var zipdir=require(_0x4244('0x1'));var jsonpatch=require(_0x4244('0x2'));var rp=require(_0x4244('0x3'));var moment=require(_0x4244('0x4'));var BPromise=require(_0x4244('0x5'));var Mustache=require(_0x4244('0x6'));var util=require('util');var path=require(_0x4244('0x7'));var sox=require(_0x4244('0x8'));var csv=require(_0x4244('0x9'));var ejs=require(_0x4244('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4244('0xb'));var squel=require(_0x4244('0xc'));var crypto=require(_0x4244('0xd'));var jsforce=require(_0x4244('0xe'));var deskjs=require(_0x4244('0xf'));var toCsv=require(_0x4244('0x9'));var querystring=require(_0x4244('0x10'));var Papa=require(_0x4244('0x11'));var Redis=require(_0x4244('0x12'));var authService=require(_0x4244('0x13'));var qs=require(_0x4244('0x14'));var as=require(_0x4244('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4244('0x16'))(_0x4244('0x17'));var utils=require(_0x4244('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4244('0x19'));var db=require(_0x4244('0x1a'))['db'];function respondWithStatusCode(_0x401b79,_0x1af793){_0x1af793=_0x1af793||0xcc;return function(_0x2a5e3b){if(_0x2a5e3b){return _0x401b79['sendStatus'](_0x1af793);}return _0x401b79[_0x4244('0x1b')](_0x1af793)['end']();};}function respondWithResult(_0xb34aad,_0x5d86ae){_0x5d86ae=_0x5d86ae||0xc8;return function(_0x3b6f09){if(_0x3b6f09){return _0xb34aad['status'](_0x5d86ae)[_0x4244('0x1c')](_0x3b6f09);}};}function respondWithFilteredResult(_0x3749c3,_0x16b1f0){return function(_0x2de618){if(_0x2de618){var _0x4379f2=typeof _0x16b1f0[_0x4244('0x1d')]===_0x4244('0x1e')&&typeof _0x16b1f0['limit']===_0x4244('0x1e');var _0x127744=_0x2de618[_0x4244('0x1f')];var _0x5625ed=_0x4379f2?0x0:_0x16b1f0['offset'];var _0x2f0b10=_0x4379f2?_0x2de618[_0x4244('0x1f')]:_0x16b1f0[_0x4244('0x1d')]+_0x16b1f0[_0x4244('0x20')];var _0x49fdf1;if(_0x2f0b10>=_0x127744){_0x2f0b10=_0x127744;_0x49fdf1=0xc8;}else{_0x49fdf1=0xce;}_0x3749c3[_0x4244('0x1b')](_0x49fdf1);return _0x3749c3[_0x4244('0x21')]('Content-Range',_0x5625ed+'-'+_0x2f0b10+'/'+_0x127744)['json'](_0x2de618);}return null;};}function patchUpdates(_0xfc2587){return function(_0x5edfd2){try{jsonpatch[_0x4244('0x22')](_0x5edfd2,_0xfc2587,!![]);}catch(_0x1a2685){return BPromise[_0x4244('0x23')](_0x1a2685);}return _0x5edfd2[_0x4244('0x24')]();};}function saveUpdates(_0x5ec463,_0x6539cf){return function(_0x201f06){if(_0x201f06){return _0x201f06[_0x4244('0x25')](_0x5ec463)['then'](function(_0x386e83){return _0x386e83;});}return null;};}function removeEntity(_0x390f46,_0x12801f){return function(_0x45271a){if(_0x45271a){return _0x45271a[_0x4244('0x26')]()['then'](function(){_0x390f46[_0x4244('0x1b')](0xcc)[_0x4244('0x27')]();});}};}function handleEntityNotFound(_0x136c6c,_0x1a0b34){return function(_0x4f79d1){if(!_0x4f79d1){_0x136c6c[_0x4244('0x28')](0x194);}return _0x4f79d1;};}function handleError(_0x29db24,_0x2e14d1){_0x2e14d1=_0x2e14d1||0x1f4;return function(_0x4b358f){logger['error'](_0x4b358f[_0x4244('0x29')]);if(_0x4b358f['name']){delete _0x4b358f[_0x4244('0x2a')];}_0x29db24[_0x4244('0x1b')](_0x2e14d1)[_0x4244('0x2b')](_0x4b358f);};}exports[_0x4244('0x2c')]=function(_0x35f139,_0x2c66c7){var _0x1b9b6f={},_0x22d2b1={},_0x559545={'count':0x0,'rows':[]};var _0x4f06e7=_[_0x4244('0x2d')](db[_0x4244('0x2e')][_0x4244('0x2f')],function(_0x318d21){return{'name':_0x318d21[_0x4244('0x30')],'type':_0x318d21[_0x4244('0x31')]['key']};});_0x22d2b1['model']=_['map'](_0x4f06e7,_0x4244('0x2a'));_0x22d2b1[_0x4244('0x32')]=_[_0x4244('0x33')](_0x35f139['query']);_0x22d2b1[_0x4244('0x34')]=_[_0x4244('0x35')](_0x22d2b1[_0x4244('0x36')],_0x22d2b1[_0x4244('0x32')]);_0x1b9b6f['attributes']=_[_0x4244('0x35')](_0x22d2b1[_0x4244('0x36')],qs[_0x4244('0x37')](_0x35f139[_0x4244('0x32')][_0x4244('0x37')]));_0x1b9b6f[_0x4244('0x38')]=_0x1b9b6f[_0x4244('0x38')][_0x4244('0x39')]?_0x1b9b6f[_0x4244('0x38')]:_0x22d2b1['model'];if(!_0x35f139[_0x4244('0x32')][_0x4244('0x3a')](_0x4244('0x3b'))){_0x1b9b6f[_0x4244('0x20')]=qs[_0x4244('0x20')](_0x35f139[_0x4244('0x32')][_0x4244('0x20')]);_0x1b9b6f[_0x4244('0x1d')]=qs[_0x4244('0x1d')](_0x35f139[_0x4244('0x32')][_0x4244('0x1d')]);}_0x1b9b6f[_0x4244('0x3c')]=qs[_0x4244('0x3d')](_0x35f139['query'][_0x4244('0x3d')]);_0x1b9b6f[_0x4244('0x3e')]=qs[_0x4244('0x34')](_[_0x4244('0x3f')](_0x35f139[_0x4244('0x32')],_0x22d2b1['filters']),_0x4f06e7);if(_0x35f139[_0x4244('0x32')][_0x4244('0x40')]){_0x1b9b6f[_0x4244('0x3e')]=_['merge'](_0x1b9b6f[_0x4244('0x3e')],{'$or':_[_0x4244('0x2d')](_0x4f06e7,function(_0x439b00){if(_0x439b00['type']!==_0x4244('0x41')){var _0x1dad55={};_0x1dad55[_0x439b00['name']]={'$like':'%'+_0x35f139[_0x4244('0x32')][_0x4244('0x40')]+'%'};return _0x1dad55;}})});}_0x1b9b6f=_['merge']({},_0x1b9b6f,_0x35f139[_0x4244('0x42')]);var _0x23d9c9={'where':_0x1b9b6f[_0x4244('0x3e')]};return db['MailSubstatus'][_0x4244('0x1f')](_0x23d9c9)[_0x4244('0x43')](function(_0x2bd32c){_0x559545[_0x4244('0x1f')]=_0x2bd32c;if(_0x35f139['query'][_0x4244('0x44')]){_0x1b9b6f[_0x4244('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4244('0x46')](_0x1b9b6f);})[_0x4244('0x43')](function(_0x3ef801){_0x559545[_0x4244('0x47')]=_0x3ef801;return _0x559545;})[_0x4244('0x43')](respondWithFilteredResult(_0x2c66c7,_0x1b9b6f))['catch'](handleError(_0x2c66c7,null));};exports[_0x4244('0x48')]=function(_0x3bc38f,_0x1b6bbb){var _0x17f962={'raw':!![],'where':{'id':_0x3bc38f[_0x4244('0x49')]['id']}},_0x44c3ed={};_0x44c3ed[_0x4244('0x36')]=_[_0x4244('0x33')](db[_0x4244('0x2e')][_0x4244('0x2f')]);_0x44c3ed['query']=_[_0x4244('0x33')](_0x3bc38f['query']);_0x44c3ed[_0x4244('0x34')]=_[_0x4244('0x35')](_0x44c3ed[_0x4244('0x36')],_0x44c3ed['query']);_0x17f962[_0x4244('0x38')]=_['intersection'](_0x44c3ed[_0x4244('0x36')],qs['fields'](_0x3bc38f[_0x4244('0x32')][_0x4244('0x37')]));_0x17f962[_0x4244('0x38')]=_0x17f962[_0x4244('0x38')][_0x4244('0x39')]?_0x17f962[_0x4244('0x38')]:_0x44c3ed[_0x4244('0x36')];if(_0x3bc38f['query'][_0x4244('0x44')]){_0x17f962[_0x4244('0x45')]=[{'all':!![]}];}_0x17f962=_[_0x4244('0x4a')]({},_0x17f962,_0x3bc38f[_0x4244('0x42')]);return db[_0x4244('0x2e')][_0x4244('0x4b')](_0x17f962)[_0x4244('0x43')](handleEntityNotFound(_0x1b6bbb,null))[_0x4244('0x43')](respondWithResult(_0x1b6bbb,null))[_0x4244('0x4c')](handleError(_0x1b6bbb,null));};exports[_0x4244('0x4d')]=function(_0x300f02,_0x2caa21){return db[_0x4244('0x2e')][_0x4244('0x4d')](_0x300f02[_0x4244('0x4e')],{})[_0x4244('0x43')](respondWithResult(_0x2caa21,0xc9))['catch'](handleError(_0x2caa21,null));};exports[_0x4244('0x25')]=function(_0x2b4251,_0x38462c){if(_0x2b4251['body']['id']){delete _0x2b4251[_0x4244('0x4e')]['id'];}return db[_0x4244('0x2e')][_0x4244('0x4b')]({'where':{'id':_0x2b4251['params']['id']}})[_0x4244('0x43')](handleEntityNotFound(_0x38462c,null))[_0x4244('0x43')](saveUpdates(_0x2b4251[_0x4244('0x4e')],null))[_0x4244('0x43')](respondWithResult(_0x38462c,null))['catch'](handleError(_0x38462c,null));};exports['destroy']=function(_0x18150e,_0x43863e){return db['MailSubstatus'][_0x4244('0x4b')]({'where':{'id':_0x18150e[_0x4244('0x49')]['id']}})[_0x4244('0x43')](handleEntityNotFound(_0x43863e,null))[_0x4244('0x43')](removeEntity(_0x43863e,null))[_0x4244('0x4c')](handleError(_0x43863e,null));};exports['describe']=function(_0x32442e,_0x3bdeae){return db[_0x4244('0x2e')]['describe']()['then'](respondWithResult(_0x3bdeae,null))[_0x4244('0x4c')](handleError(_0x3bdeae,null));}; \ No newline at end of file +var _0x4a3d=['merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','rawAttributes','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL'];(function(_0x4557c4,_0xa52527){var _0x11c14a=function(_0x120a7c){while(--_0x120a7c){_0x4557c4['push'](_0x4557c4['shift']());}};_0x11c14a(++_0xa52527);}(_0x4a3d,0x12e));var _0xd4a3=function(_0x16a545,_0x389d6e){_0x16a545=_0x16a545-0x0;var _0x1c8ece=_0x4a3d[_0x16a545];return _0x1c8ece;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4a3('0x0'));var rp=require(_0xd4a3('0x1'));var moment=require(_0xd4a3('0x2'));var BPromise=require(_0xd4a3('0x3'));var Mustache=require(_0xd4a3('0x4'));var util=require(_0xd4a3('0x5'));var path=require('path');var sox=require(_0xd4a3('0x6'));var csv=require(_0xd4a3('0x7'));var ejs=require(_0xd4a3('0x8'));var fs=require('fs');var fs_extra=require(_0xd4a3('0x9'));var _=require(_0xd4a3('0xa'));var squel=require(_0xd4a3('0xb'));var crypto=require('crypto');var jsforce=require(_0xd4a3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd4a3('0x7'));var querystring=require(_0xd4a3('0xd'));var Papa=require(_0xd4a3('0xe'));var Redis=require(_0xd4a3('0xf'));var authService=require(_0xd4a3('0x10'));var qs=require(_0xd4a3('0x11'));var as=require(_0xd4a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4a3('0x13'))(_0xd4a3('0x14'));var utils=require('../../config/utils');var config=require(_0xd4a3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd4a3('0x16'))['db'];function respondWithStatusCode(_0x5a7cfd,_0x33384a){_0x33384a=_0x33384a||0xcc;return function(_0x42b3b1){if(_0x42b3b1){return _0x5a7cfd[_0xd4a3('0x17')](_0x33384a);}return _0x5a7cfd[_0xd4a3('0x18')](_0x33384a)[_0xd4a3('0x19')]();};}function respondWithResult(_0xfedf7d,_0x366485){_0x366485=_0x366485||0xc8;return function(_0x3ffe85){if(_0x3ffe85){return _0xfedf7d[_0xd4a3('0x18')](_0x366485)[_0xd4a3('0x1a')](_0x3ffe85);}};}function respondWithFilteredResult(_0x51c691,_0x21eae5){return function(_0x33d18b){if(_0x33d18b){var _0x49b233=typeof _0x21eae5[_0xd4a3('0x1b')]===_0xd4a3('0x1c')&&typeof _0x21eae5[_0xd4a3('0x1d')]===_0xd4a3('0x1c');var _0x3b5f26=_0x33d18b['count'];var _0x502116=_0x49b233?0x0:_0x21eae5[_0xd4a3('0x1b')];var _0x51b462=_0x49b233?_0x33d18b[_0xd4a3('0x1e')]:_0x21eae5[_0xd4a3('0x1b')]+_0x21eae5[_0xd4a3('0x1d')];var _0x28b851;if(_0x51b462>=_0x3b5f26){_0x51b462=_0x3b5f26;_0x28b851=0xc8;}else{_0x28b851=0xce;}_0x51c691[_0xd4a3('0x18')](_0x28b851);return _0x51c691['set'](_0xd4a3('0x1f'),_0x502116+'-'+_0x51b462+'/'+_0x3b5f26)[_0xd4a3('0x1a')](_0x33d18b);}return null;};}function patchUpdates(_0x3c8fc8){return function(_0x300417){try{jsonpatch[_0xd4a3('0x20')](_0x300417,_0x3c8fc8,!![]);}catch(_0x10ed64){return BPromise[_0xd4a3('0x21')](_0x10ed64);}return _0x300417['save']();};}function saveUpdates(_0x310a55,_0x13f817){return function(_0x2deb12){if(_0x2deb12){return _0x2deb12[_0xd4a3('0x22')](_0x310a55)[_0xd4a3('0x23')](function(_0x3fb257){return _0x3fb257;});}return null;};}function removeEntity(_0x4de544,_0x2ce07f){return function(_0x12a439){if(_0x12a439){return _0x12a439[_0xd4a3('0x24')]()['then'](function(){_0x4de544['status'](0xcc)[_0xd4a3('0x19')]();});}};}function handleEntityNotFound(_0x5a8f23,_0x97b526){return function(_0x27c7ee){if(!_0x27c7ee){_0x5a8f23[_0xd4a3('0x17')](0x194);}return _0x27c7ee;};}function handleError(_0x56ca4a,_0x4e88e4){_0x4e88e4=_0x4e88e4||0x1f4;return function(_0x23256e){logger[_0xd4a3('0x25')](_0x23256e['stack']);if(_0x23256e['name']){delete _0x23256e[_0xd4a3('0x26')];}_0x56ca4a[_0xd4a3('0x18')](_0x4e88e4)[_0xd4a3('0x27')](_0x23256e);};}exports['index']=function(_0x42d7ec,_0x227573){var _0x2baaa1={},_0x4cf4cc={},_0x2c69cf={'count':0x0,'rows':[]};var _0x51fe66=_['map'](db['MailSubstatus'][_0xd4a3('0x28')],function(_0x1bc33c){return{'name':_0x1bc33c['fieldName'],'type':_0x1bc33c[_0xd4a3('0x29')]['key']};});_0x4cf4cc['model']=_['map'](_0x51fe66,_0xd4a3('0x26'));_0x4cf4cc[_0xd4a3('0x2a')]=_[_0xd4a3('0x2b')](_0x42d7ec['query']);_0x4cf4cc['filters']=_['intersection'](_0x4cf4cc[_0xd4a3('0x2c')],_0x4cf4cc[_0xd4a3('0x2a')]);_0x2baaa1['attributes']=_[_0xd4a3('0x2d')](_0x4cf4cc[_0xd4a3('0x2c')],qs[_0xd4a3('0x2e')](_0x42d7ec[_0xd4a3('0x2a')][_0xd4a3('0x2e')]));_0x2baaa1[_0xd4a3('0x2f')]=_0x2baaa1[_0xd4a3('0x2f')][_0xd4a3('0x30')]?_0x2baaa1['attributes']:_0x4cf4cc[_0xd4a3('0x2c')];if(!_0x42d7ec[_0xd4a3('0x2a')][_0xd4a3('0x31')](_0xd4a3('0x32'))){_0x2baaa1['limit']=qs[_0xd4a3('0x1d')](_0x42d7ec[_0xd4a3('0x2a')][_0xd4a3('0x1d')]);_0x2baaa1[_0xd4a3('0x1b')]=qs[_0xd4a3('0x1b')](_0x42d7ec[_0xd4a3('0x2a')]['offset']);}_0x2baaa1['order']=qs[_0xd4a3('0x33')](_0x42d7ec['query'][_0xd4a3('0x33')]);_0x2baaa1[_0xd4a3('0x34')]=qs[_0xd4a3('0x35')](_[_0xd4a3('0x36')](_0x42d7ec[_0xd4a3('0x2a')],_0x4cf4cc[_0xd4a3('0x35')]),_0x51fe66);if(_0x42d7ec['query'][_0xd4a3('0x37')]){_0x2baaa1[_0xd4a3('0x34')]=_['merge'](_0x2baaa1[_0xd4a3('0x34')],{'$or':_[_0xd4a3('0x38')](_0x51fe66,function(_0x290245){if(_0x290245['type']!==_0xd4a3('0x39')){var _0x39063a={};_0x39063a[_0x290245['name']]={'$like':'%'+_0x42d7ec[_0xd4a3('0x2a')][_0xd4a3('0x37')]+'%'};return _0x39063a;}})});}_0x2baaa1=_[_0xd4a3('0x3a')]({},_0x2baaa1,_0x42d7ec[_0xd4a3('0x3b')]);var _0x34e54f={'where':_0x2baaa1['where']};return db[_0xd4a3('0x3c')][_0xd4a3('0x1e')](_0x34e54f)['then'](function(_0x299973){_0x2c69cf['count']=_0x299973;if(_0x42d7ec[_0xd4a3('0x2a')][_0xd4a3('0x3d')]){_0x2baaa1[_0xd4a3('0x3e')]=[{'all':!![]}];}return db[_0xd4a3('0x3c')][_0xd4a3('0x3f')](_0x2baaa1);})[_0xd4a3('0x23')](function(_0x2539d3){_0x2c69cf[_0xd4a3('0x40')]=_0x2539d3;return _0x2c69cf;})['then'](respondWithFilteredResult(_0x227573,_0x2baaa1))[_0xd4a3('0x41')](handleError(_0x227573,null));};exports[_0xd4a3('0x42')]=function(_0x5a9e95,_0x18b683){var _0x38fded={'raw':!![],'where':{'id':_0x5a9e95[_0xd4a3('0x43')]['id']}},_0x5ba031={};_0x5ba031[_0xd4a3('0x2c')]=_[_0xd4a3('0x2b')](db[_0xd4a3('0x3c')][_0xd4a3('0x28')]);_0x5ba031[_0xd4a3('0x2a')]=_[_0xd4a3('0x2b')](_0x5a9e95['query']);_0x5ba031[_0xd4a3('0x35')]=_[_0xd4a3('0x2d')](_0x5ba031[_0xd4a3('0x2c')],_0x5ba031[_0xd4a3('0x2a')]);_0x38fded[_0xd4a3('0x2f')]=_[_0xd4a3('0x2d')](_0x5ba031[_0xd4a3('0x2c')],qs[_0xd4a3('0x2e')](_0x5a9e95[_0xd4a3('0x2a')][_0xd4a3('0x2e')]));_0x38fded[_0xd4a3('0x2f')]=_0x38fded[_0xd4a3('0x2f')]['length']?_0x38fded['attributes']:_0x5ba031['model'];if(_0x5a9e95[_0xd4a3('0x2a')][_0xd4a3('0x3d')]){_0x38fded[_0xd4a3('0x3e')]=[{'all':!![]}];}_0x38fded=_['merge']({},_0x38fded,_0x5a9e95[_0xd4a3('0x3b')]);return db[_0xd4a3('0x3c')][_0xd4a3('0x44')](_0x38fded)[_0xd4a3('0x23')](handleEntityNotFound(_0x18b683,null))['then'](respondWithResult(_0x18b683,null))[_0xd4a3('0x41')](handleError(_0x18b683,null));};exports[_0xd4a3('0x45')]=function(_0x213a85,_0x52135d){return db[_0xd4a3('0x3c')][_0xd4a3('0x45')](_0x213a85[_0xd4a3('0x46')],{})[_0xd4a3('0x23')](respondWithResult(_0x52135d,0xc9))[_0xd4a3('0x41')](handleError(_0x52135d,null));};exports['update']=function(_0x86ccef,_0x5d450d){if(_0x86ccef[_0xd4a3('0x46')]['id']){delete _0x86ccef['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x86ccef[_0xd4a3('0x43')]['id']}})[_0xd4a3('0x23')](handleEntityNotFound(_0x5d450d,null))[_0xd4a3('0x23')](saveUpdates(_0x86ccef[_0xd4a3('0x46')],null))[_0xd4a3('0x23')](respondWithResult(_0x5d450d,null))['catch'](handleError(_0x5d450d,null));};exports[_0xd4a3('0x24')]=function(_0x5dc8ac,_0xccceaa){return db[_0xd4a3('0x3c')]['find']({'where':{'id':_0x5dc8ac[_0xd4a3('0x43')]['id']}})['then'](handleEntityNotFound(_0xccceaa,null))[_0xd4a3('0x23')](removeEntity(_0xccceaa,null))['catch'](handleError(_0xccceaa,null));};exports['describe']=function(_0x15efa2,_0x26f1ac){return db['MailSubstatus'][_0xd4a3('0x47')]()[_0xd4a3('0x23')](respondWithResult(_0x26f1ac,null))[_0xd4a3('0x41')](handleError(_0x26f1ac,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 475d8e6..a740275 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 _0x435e=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x435e,0x1b5));var _0xe435=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x435e[_0x51c819];return _0x15c5d2;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xe435('0x0'))['db'][_0xe435('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe435('0x2')](0x0);var events={'afterUpdate':_0xe435('0x3')};function emitEvent(_0x1caf01){return function(_0x1b4f9b,_0x273e7b,_0x88616e){MailSubstatusEvents[_0xe435('0x4')](_0x1caf01+':'+_0x1b4f9b['id'],_0x1b4f9b);MailSubstatusEvents[_0xe435('0x4')](_0x1caf01,_0x1b4f9b);_0x88616e(null);};}for(var e in events){if(events[_0xe435('0x5')](e)){var event=events[e];MailSubstatus[_0xe435('0x6')](e,emitEvent(event));}}module[_0xe435('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x1087=['hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x1087,0x1ce));var _0x7108=function(_0x32f199,_0x5da034){_0x32f199=_0x32f199-0x0;var _0x40a717=_0x1087[_0x32f199];return _0x40a717;};'use strict';var EventEmitter=require(_0x7108('0x0'));var MailSubstatus=require(_0x7108('0x1'))['db'][_0x7108('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x7108('0x3')](0x0);var events={'afterUpdate':_0x7108('0x4')};function emitEvent(_0x8f9252){return function(_0x5ca570,_0x2e0346,_0x3e2957){MailSubstatusEvents['emit'](_0x8f9252+':'+_0x5ca570['id'],_0x5ca570);MailSubstatusEvents[_0x7108('0x5')](_0x8f9252,_0x5ca570);_0x3e2957(null);};}for(var e in events){if(events[_0x7108('0x6')](e)){var event=events[e];MailSubstatus[_0x7108('0x7')](e,emitEvent(event));}}module[_0x7108('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 26c67b6..ae0a1d2 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 _0x3110=['name','mailSubstatus','_previousDataValues','then','catch','exports','define','mail_substatuses','Condition','update'];(function(_0x2bbce4,_0x3fd360){var _0x25aab8=function(_0x187925){while(--_0x187925){_0x2bbce4['push'](_0x2bbce4['shift']());}};_0x25aab8(++_0x3fd360);}(_0x3110,0xf5));var _0x0311=function(_0x3cfd2a,_0x18f938){_0x3cfd2a=_0x3cfd2a-0x0;var _0x19f061=_0x3110[_0x3cfd2a];return _0x19f061;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x0311('0x0')]=function(_0x76cf94){var _0x231c41=_0x76cf94['models'];return _0x76cf94[_0x0311('0x1')]('MailSubstatus',attributes,{'tableName':_0x0311('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x347d06,_0x147038,_0x198b53){return _0x231c41[_0x0311('0x3')][_0x0311('0x4')]({'value':_0x347d06[_0x0311('0x5')]},{'where':{'field':_0x0311('0x6'),'value':_0x347d06[_0x0311('0x7')][_0x0311('0x5')]}})[_0x0311('0x8')](function(){_0x198b53();})[_0x0311('0x9')](function(_0x2a9681){_0x198b53(_0x2a9681);});}}});}; \ No newline at end of file +var _0x7a53=['Condition','name','mailSubstatus','_previousDataValues','./mailSubstatus.attributes','exports','models','define','mail_substatuses'];(function(_0x2a196c,_0x6fc415){var _0x1abdb5=function(_0x1cb722){while(--_0x1cb722){_0x2a196c['push'](_0x2a196c['shift']());}};_0x1abdb5(++_0x6fc415);}(_0x7a53,0x79));var _0x37a5=function(_0x3c7a3e,_0x8b9be5){_0x3c7a3e=_0x3c7a3e-0x0;var _0x46b063=_0x7a53[_0x3c7a3e];return _0x46b063;};'use strict';var attributes=require(_0x37a5('0x0'));module[_0x37a5('0x1')]=function(_0x3ca12e){var _0x1dd242=_0x3ca12e[_0x37a5('0x2')];return _0x3ca12e[_0x37a5('0x3')]('MailSubstatus',attributes,{'tableName':_0x37a5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xcf8d89,_0x2424eb,_0x1e3d99){return _0x1dd242[_0x37a5('0x5')]['update']({'value':_0xcf8d89[_0x37a5('0x6')]},{'where':{'field':_0x37a5('0x7'),'value':_0xcf8d89[_0x37a5('0x8')]['name']}})['then'](function(){_0x1e3d99();})['catch'](function(_0x41ec3c){_0x1e3d99(_0x41ec3c);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7708eba..816d35d 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 _0xe806=['code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4b1e60,_0x4a2e1c){var _0x27f958=function(_0x3570d2){while(--_0x3570d2){_0x4b1e60['push'](_0x4b1e60['shift']());}};_0x27f958(++_0x4a2e1c);}(_0xe806,0x15c));var _0x6e80=function(_0x2aa062,_0x246881){_0x2aa062=_0x2aa062-0x0;var _0x1e352e=_0xe806[_0x2aa062];return _0x1e352e;};'use strict';var _=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var moment=require(_0x6e80('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e80('0x3'))['db'];var utils=require(_0x6e80('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e80('0x5'));var jayson=require(_0x6e80('0x6'));var client=jayson[_0x6e80('0x7')][_0x6e80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856d8,_0x1c1940,_0x2e622c){return new BPromise(function(_0x292351,_0x1d5f52){return client[_0x6e80('0x9')](_0x1856d8,_0x2e622c)['then'](function(_0x2a0853){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x1c1940,'request\x20sent');logger['debug'](_0x6e80('0xa'),_0x1c1940,'request\x20sent',JSON[_0x6e80('0xb')](_0x2a0853));if(_0x2a0853['error']){if(_0x2a0853[_0x6e80('0xc')][_0x6e80('0xd')]===0x1f4){logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x2a0853['error'][_0x6e80('0xf')]);return _0x1d5f52(_0x2a0853[_0x6e80('0xc')][_0x6e80('0xf')]);}logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x2a0853[_0x6e80('0xc')]['message']);return _0x292351(_0x2a0853['error'][_0x6e80('0xf')]);}else{logger[_0x6e80('0x10')](_0x6e80('0xe'),_0x1c1940,'request\x20sent');_0x292351(_0x2a0853[_0x6e80('0x11')][_0x6e80('0xf')]);}})[_0x6e80('0x12')](function(_0x45d57f){logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x45d57f);_0x1d5f52(_0x45d57f);});});} \ No newline at end of file +var _0xcc3c=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4723de,_0x4b339c){var _0x27ff91=function(_0x84bbc8){while(--_0x84bbc8){_0x4723de['push'](_0x4723de['shift']());}};_0x27ff91(++_0x4b339c);}(_0xcc3c,0x92));var _0xccc3=function(_0x2b3396,_0x109c27){_0x2b3396=_0x2b3396-0x0;var _0x2d9812=_0xcc3c[_0x2b3396];return _0x2d9812;};'use strict';var _=require(_0xccc3('0x0'));var util=require(_0xccc3('0x1'));var moment=require('moment');var BPromise=require(_0xccc3('0x2'));var rs=require(_0xccc3('0x3'));var fs=require('fs');var Redis=require(_0xccc3('0x4'));var db=require(_0xccc3('0x5'))['db'];var utils=require(_0xccc3('0x6'));var logger=require('../../config/logger')(_0xccc3('0x7'));var config=require('../../config/environment');var jayson=require(_0xccc3('0x8'));var client=jayson[_0xccc3('0x9')][_0xccc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x423684,_0x5eb00c,_0x39d86b){return new BPromise(function(_0x5b53df,_0x317d37){return client[_0xccc3('0xb')](_0x423684,_0x39d86b)[_0xccc3('0xc')](function(_0x221c9c){logger[_0xccc3('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x5eb00c,_0xccc3('0xe'));logger['debug'](_0xccc3('0xf'),_0x5eb00c,'request\x20sent',JSON[_0xccc3('0x10')](_0x221c9c));if(_0x221c9c[_0xccc3('0x11')]){if(_0x221c9c[_0xccc3('0x11')][_0xccc3('0x12')]===0x1f4){logger[_0xccc3('0x11')](_0xccc3('0x13'),_0x5eb00c,_0x221c9c[_0xccc3('0x11')]['message']);return _0x317d37(_0x221c9c[_0xccc3('0x11')][_0xccc3('0x14')]);}logger[_0xccc3('0x11')](_0xccc3('0x13'),_0x5eb00c,_0x221c9c[_0xccc3('0x11')][_0xccc3('0x14')]);return _0x5b53df(_0x221c9c[_0xccc3('0x11')][_0xccc3('0x14')]);}else{logger[_0xccc3('0xd')](_0xccc3('0x13'),_0x5eb00c,_0xccc3('0xe'));_0x5b53df(_0x221c9c[_0xccc3('0x15')][_0xccc3('0x14')]);}})[_0xccc3('0x16')](function(_0xf0b8be){logger['error'](_0xccc3('0x13'),_0x5eb00c,_0xf0b8be);_0x317d37(_0xf0b8be);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 62b1afd..4332a9a 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 _0x5604=['/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x167984,_0x32db58){var _0x4ab4f6=function(_0x3cc892){while(--_0x3cc892){_0x167984['push'](_0x167984['shift']());}};_0x4ab4f6(++_0x32db58);}(_0x5604,0x93));var _0x4560=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x5604[_0x251d9c];return _0x16ae64;};'use strict';var multer=require(_0x4560('0x0'));var util=require(_0x4560('0x1'));var path=require(_0x4560('0x2'));var timeout=require(_0x4560('0x3'));var express=require(_0x4560('0x4'));var router=express['Router']();var fs_extra=require(_0x4560('0x5'));var auth=require(_0x4560('0x6'));var interaction=require(_0x4560('0x7'));var config=require(_0x4560('0x8'));var controller=require('./mailTransferReport.controller');router[_0x4560('0x9')]('/',auth[_0x4560('0xa')](),controller[_0x4560('0xb')]);router[_0x4560('0x9')]('/describe',auth[_0x4560('0xa')](),controller[_0x4560('0xc')]);router[_0x4560('0x9')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller['show']);router[_0x4560('0xe')]('/',auth[_0x4560('0xa')](),controller[_0x4560('0xf')]);router[_0x4560('0x10')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller['update']);router[_0x4560('0x11')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller[_0x4560('0x12')]);module[_0x4560('0x13')]=router; \ No newline at end of file +var _0x110e=['../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f156d,_0x1dde3e){var _0x25f22e=function(_0x5d74b6){while(--_0x5d74b6){_0x4f156d['push'](_0x4f156d['shift']());}};_0x25f22e(++_0x1dde3e);}(_0x110e,0x91));var _0xe110=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x110e[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var path=require(_0xe110('0x2'));var timeout=require(_0xe110('0x3'));var express=require(_0xe110('0x4'));var router=express[_0xe110('0x5')]();var fs_extra=require(_0xe110('0x6'));var auth=require(_0xe110('0x7'));var interaction=require(_0xe110('0x8'));var config=require(_0xe110('0x9'));var controller=require(_0xe110('0xa'));router['get']('/',auth[_0xe110('0xb')](),controller[_0xe110('0xc')]);router[_0xe110('0xd')](_0xe110('0xe'),auth[_0xe110('0xb')](),controller['describe']);router[_0xe110('0xd')]('/:id',auth[_0xe110('0xb')](),controller[_0xe110('0xf')]);router[_0xe110('0x10')]('/',auth[_0xe110('0xb')](),controller['create']);router['put'](_0xe110('0x11'),auth[_0xe110('0xb')](),controller[_0xe110('0x12')]);router[_0xe110('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe110('0x14')]);module[_0xe110('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 326ebf5..7144458 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3e25d4,_0x1333ba){var _0x26d077=function(_0x2dcd59){while(--_0x2dcd59){_0x3e25d4['push'](_0x3e25d4['shift']());}};_0x26d077(++_0x1333ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f4139,_0x115369){_0x2f4139=_0x2f4139-0x0;var _0x4f5aa9=_0xedd9[_0x2f4139];return _0x4f5aa9;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x54ef,0x112));var _0xf54e=function(_0x157d56,_0xfbd72b){_0x157d56=_0x157d56-0x0;var _0x588c92=_0x54ef[_0x157d56];return _0x588c92;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 087cb8e..55527d0 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 _0xeceb=['count','Content-Range','reject','save','update','then','end','sendStatus','error','name','send','index','rawAttributes','fieldName','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailTransferReport','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit'];(function(_0x3ed335,_0x38eabd){var _0x54f7fa=function(_0x32e0d8){while(--_0x32e0d8){_0x3ed335['push'](_0x3ed335['shift']());}};_0x54f7fa(++_0x38eabd);}(_0xeceb,0x10c));var _0xbece=function(_0x58b6b9,_0x49baad){_0x58b6b9=_0x58b6b9-0x0;var _0x1a5c8c=_0xeceb[_0x58b6b9];return _0x1a5c8c;};'use strict';var emlformat=require(_0xbece('0x0'));var rimraf=require(_0xbece('0x1'));var zipdir=require(_0xbece('0x2'));var jsonpatch=require(_0xbece('0x3'));var rp=require(_0xbece('0x4'));var moment=require('moment');var BPromise=require(_0xbece('0x5'));var Mustache=require(_0xbece('0x6'));var util=require('util');var path=require(_0xbece('0x7'));var sox=require(_0xbece('0x8'));var csv=require(_0xbece('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbece('0xa'));var squel=require(_0xbece('0xb'));var crypto=require(_0xbece('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbece('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbece('0xe'));var Papa=require('papaparse');var Redis=require(_0xbece('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbece('0x10'));var as=require(_0xbece('0x11'));var hardwareService=require(_0xbece('0x12'));var logger=require(_0xbece('0x13'))(_0xbece('0x14'));var utils=require('../../config/utils');var config=require(_0xbece('0x15'));var licenseUtil=require(_0xbece('0x16'));var db=require(_0xbece('0x17'))['db'];function respondWithStatusCode(_0x38d62f,_0x5609de){_0x5609de=_0x5609de||0xcc;return function(_0x1e8a3b){if(_0x1e8a3b){return _0x38d62f['sendStatus'](_0x5609de);}return _0x38d62f[_0xbece('0x18')](_0x5609de)['end']();};}function respondWithResult(_0x58c106,_0x25386d){_0x25386d=_0x25386d||0xc8;return function(_0x33635e){if(_0x33635e){return _0x58c106[_0xbece('0x18')](_0x25386d)[_0xbece('0x19')](_0x33635e);}};}function respondWithFilteredResult(_0x27c91e,_0x57d420){return function(_0x2344e4){if(_0x2344e4){var _0x52875a=typeof _0x57d420[_0xbece('0x1a')]==='undefined'&&typeof _0x57d420[_0xbece('0x1b')]==='undefined';var _0x85b262=_0x2344e4[_0xbece('0x1c')];var _0x281074=_0x52875a?0x0:_0x57d420[_0xbece('0x1a')];var _0x5c8e21=_0x52875a?_0x2344e4[_0xbece('0x1c')]:_0x57d420['offset']+_0x57d420['limit'];var _0x324425;if(_0x5c8e21>=_0x85b262){_0x5c8e21=_0x85b262;_0x324425=0xc8;}else{_0x324425=0xce;}_0x27c91e[_0xbece('0x18')](_0x324425);return _0x27c91e['set'](_0xbece('0x1d'),_0x281074+'-'+_0x5c8e21+'/'+_0x85b262)['json'](_0x2344e4);}return null;};}function patchUpdates(_0xe9677a){return function(_0xd162c9){try{jsonpatch['apply'](_0xd162c9,_0xe9677a,!![]);}catch(_0x4c83b0){return BPromise[_0xbece('0x1e')](_0x4c83b0);}return _0xd162c9[_0xbece('0x1f')]();};}function saveUpdates(_0x5ec8c0,_0x2f0e1a){return function(_0x300f7c){if(_0x300f7c){return _0x300f7c[_0xbece('0x20')](_0x5ec8c0)[_0xbece('0x21')](function(_0x516544){return _0x516544;});}return null;};}function removeEntity(_0x5b3355,_0x400eda){return function(_0x64a35d){if(_0x64a35d){return _0x64a35d['destroy']()[_0xbece('0x21')](function(){_0x5b3355['status'](0xcc)[_0xbece('0x22')]();});}};}function handleEntityNotFound(_0x3bf7f4,_0x26707e){return function(_0x5634ec){if(!_0x5634ec){_0x3bf7f4[_0xbece('0x23')](0x194);}return _0x5634ec;};}function handleError(_0x4c1f1e,_0x1cb9af){_0x1cb9af=_0x1cb9af||0x1f4;return function(_0x4e569c){logger[_0xbece('0x24')](_0x4e569c['stack']);if(_0x4e569c['name']){delete _0x4e569c[_0xbece('0x25')];}_0x4c1f1e['status'](_0x1cb9af)[_0xbece('0x26')](_0x4e569c);};}exports[_0xbece('0x27')]=function(_0x378f5a,_0x1e10d9){var _0x376aec={},_0x3076d5={},_0x7f2d43={'count':0x0,'rows':[]};var _0x408fae=_['map'](db['MailTransferReport'][_0xbece('0x28')],function(_0x4e7ed2){return{'name':_0x4e7ed2[_0xbece('0x29')],'type':_0x4e7ed2['type']['key']};});_0x3076d5['model']=_[_0xbece('0x2a')](_0x408fae,_0xbece('0x25'));_0x3076d5['query']=_[_0xbece('0x2b')](_0x378f5a[_0xbece('0x2c')]);_0x3076d5[_0xbece('0x2d')]=_[_0xbece('0x2e')](_0x3076d5[_0xbece('0x2f')],_0x3076d5[_0xbece('0x2c')]);_0x376aec['attributes']=_[_0xbece('0x2e')](_0x3076d5[_0xbece('0x2f')],qs[_0xbece('0x30')](_0x378f5a[_0xbece('0x2c')][_0xbece('0x30')]));_0x376aec[_0xbece('0x31')]=_0x376aec[_0xbece('0x31')][_0xbece('0x32')]?_0x376aec[_0xbece('0x31')]:_0x3076d5['model'];if(!_0x378f5a[_0xbece('0x2c')][_0xbece('0x33')](_0xbece('0x34'))){_0x376aec[_0xbece('0x1b')]=qs[_0xbece('0x1b')](_0x378f5a[_0xbece('0x2c')][_0xbece('0x1b')]);_0x376aec[_0xbece('0x1a')]=qs['offset'](_0x378f5a[_0xbece('0x2c')][_0xbece('0x1a')]);}_0x376aec[_0xbece('0x35')]=qs['sort'](_0x378f5a[_0xbece('0x2c')][_0xbece('0x36')]);_0x376aec[_0xbece('0x37')]=qs[_0xbece('0x2d')](_[_0xbece('0x38')](_0x378f5a['query'],_0x3076d5[_0xbece('0x2d')]),_0x408fae);if(_0x378f5a[_0xbece('0x2c')]['filter']){_0x376aec[_0xbece('0x37')]=_['merge'](_0x376aec[_0xbece('0x37')],{'$or':_['map'](_0x408fae,function(_0xf25440){if(_0xf25440[_0xbece('0x39')]!==_0xbece('0x3a')){var _0x427e12={};_0x427e12[_0xf25440['name']]={'$like':'%'+_0x378f5a[_0xbece('0x2c')][_0xbece('0x3b')]+'%'};return _0x427e12;}})});}_0x376aec=_[_0xbece('0x3c')]({},_0x376aec,_0x378f5a[_0xbece('0x3d')]);var _0x246a41={'where':_0x376aec[_0xbece('0x37')]};return db[_0xbece('0x3e')]['count'](_0x246a41)[_0xbece('0x21')](function(_0x5052a2){_0x7f2d43[_0xbece('0x1c')]=_0x5052a2;if(_0x378f5a[_0xbece('0x2c')]['includeAll']){_0x376aec[_0xbece('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0xbece('0x40')](_0x376aec);})['then'](function(_0xda0038){_0x7f2d43[_0xbece('0x41')]=_0xda0038;return _0x7f2d43;})[_0xbece('0x21')](respondWithFilteredResult(_0x1e10d9,_0x376aec))[_0xbece('0x42')](handleError(_0x1e10d9,null));};exports[_0xbece('0x43')]=function(_0x4c7e44,_0x2d7a66){var _0x3218c4={'raw':!![],'where':{'id':_0x4c7e44[_0xbece('0x44')]['id']}},_0x5a8bbc={};_0x5a8bbc[_0xbece('0x2f')]=_[_0xbece('0x2b')](db['MailTransferReport']['rawAttributes']);_0x5a8bbc[_0xbece('0x2c')]=_[_0xbece('0x2b')](_0x4c7e44[_0xbece('0x2c')]);_0x5a8bbc['filters']=_[_0xbece('0x2e')](_0x5a8bbc[_0xbece('0x2f')],_0x5a8bbc[_0xbece('0x2c')]);_0x3218c4[_0xbece('0x31')]=_[_0xbece('0x2e')](_0x5a8bbc[_0xbece('0x2f')],qs['fields'](_0x4c7e44[_0xbece('0x2c')]['fields']));_0x3218c4[_0xbece('0x31')]=_0x3218c4[_0xbece('0x31')]['length']?_0x3218c4[_0xbece('0x31')]:_0x5a8bbc[_0xbece('0x2f')];if(_0x4c7e44['query']['includeAll']){_0x3218c4[_0xbece('0x3f')]=[{'all':!![]}];}_0x3218c4=_[_0xbece('0x3c')]({},_0x3218c4,_0x4c7e44[_0xbece('0x3d')]);return db[_0xbece('0x3e')][_0xbece('0x45')](_0x3218c4)[_0xbece('0x21')](handleEntityNotFound(_0x2d7a66,null))['then'](respondWithResult(_0x2d7a66,null))[_0xbece('0x42')](handleError(_0x2d7a66,null));};exports[_0xbece('0x46')]=function(_0x5d9748,_0x1aed17){return db[_0xbece('0x3e')][_0xbece('0x46')](_0x5d9748[_0xbece('0x47')],{})['then'](respondWithResult(_0x1aed17,0xc9))[_0xbece('0x42')](handleError(_0x1aed17,null));};exports[_0xbece('0x20')]=function(_0x1d9d28,_0x3b54a5){if(_0x1d9d28[_0xbece('0x47')]['id']){delete _0x1d9d28[_0xbece('0x47')]['id'];}return db[_0xbece('0x3e')]['find']({'where':{'id':_0x1d9d28[_0xbece('0x44')]['id']}})[_0xbece('0x21')](handleEntityNotFound(_0x3b54a5,null))[_0xbece('0x21')](saveUpdates(_0x1d9d28[_0xbece('0x47')],null))['then'](respondWithResult(_0x3b54a5,null))[_0xbece('0x42')](handleError(_0x3b54a5,null));};exports[_0xbece('0x48')]=function(_0x1bf2a3,_0x1e4781){return db[_0xbece('0x3e')][_0xbece('0x45')]({'where':{'id':_0x1bf2a3[_0xbece('0x44')]['id']}})[_0xbece('0x21')](handleEntityNotFound(_0x1e4781,null))[_0xbece('0x21')](removeEntity(_0x1e4781,null))['catch'](handleError(_0x1e4781,null));};exports[_0xbece('0x49')]=function(_0x1389ca,_0xa75355){return db[_0xbece('0x3e')][_0xbece('0x49')]()[_0xbece('0x21')](respondWithResult(_0xa75355,null))['catch'](handleError(_0xa75355,null));}; \ No newline at end of file +var _0x4a1d=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','rows','show','find','create','catch','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4a1d,0x79));var _0xd4a1=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x4a1d[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0xd4a1('0x0'));var rimraf=require(_0xd4a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4a1('0x2'));var rp=require(_0xd4a1('0x3'));var moment=require(_0xd4a1('0x4'));var BPromise=require(_0xd4a1('0x5'));var Mustache=require('mustache');var util=require(_0xd4a1('0x6'));var path=require(_0xd4a1('0x7'));var sox=require(_0xd4a1('0x8'));var csv=require(_0xd4a1('0x9'));var ejs=require(_0xd4a1('0xa'));var fs=require('fs');var fs_extra=require(_0xd4a1('0xb'));var _=require(_0xd4a1('0xc'));var squel=require('squel');var crypto=require(_0xd4a1('0xd'));var jsforce=require(_0xd4a1('0xe'));var deskjs=require(_0xd4a1('0xf'));var toCsv=require(_0xd4a1('0x9'));var querystring=require(_0xd4a1('0x10'));var Papa=require(_0xd4a1('0x11'));var Redis=require(_0xd4a1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd4a1('0x13'));var as=require(_0xd4a1('0x14'));var hardwareService=require(_0xd4a1('0x15'));var logger=require('../../config/logger')(_0xd4a1('0x16'));var utils=require(_0xd4a1('0x17'));var config=require(_0xd4a1('0x18'));var licenseUtil=require(_0xd4a1('0x19'));var db=require(_0xd4a1('0x1a'))['db'];function respondWithStatusCode(_0x5002ef,_0x56662b){_0x56662b=_0x56662b||0xcc;return function(_0x20417a){if(_0x20417a){return _0x5002ef['sendStatus'](_0x56662b);}return _0x5002ef[_0xd4a1('0x1b')](_0x56662b)[_0xd4a1('0x1c')]();};}function respondWithResult(_0x9841ce,_0x2739c5){_0x2739c5=_0x2739c5||0xc8;return function(_0x14f335){if(_0x14f335){return _0x9841ce['status'](_0x2739c5)[_0xd4a1('0x1d')](_0x14f335);}};}function respondWithFilteredResult(_0x9a75f6,_0x59d477){return function(_0x72af9c){if(_0x72af9c){var _0x118d73=typeof _0x59d477[_0xd4a1('0x1e')]==='undefined'&&typeof _0x59d477['limit']===_0xd4a1('0x1f');var _0x575c0f=_0x72af9c['count'];var _0x5abe74=_0x118d73?0x0:_0x59d477[_0xd4a1('0x1e')];var _0x53bcad=_0x118d73?_0x72af9c[_0xd4a1('0x20')]:_0x59d477[_0xd4a1('0x1e')]+_0x59d477[_0xd4a1('0x21')];var _0x302638;if(_0x53bcad>=_0x575c0f){_0x53bcad=_0x575c0f;_0x302638=0xc8;}else{_0x302638=0xce;}_0x9a75f6[_0xd4a1('0x1b')](_0x302638);return _0x9a75f6[_0xd4a1('0x22')](_0xd4a1('0x23'),_0x5abe74+'-'+_0x53bcad+'/'+_0x575c0f)[_0xd4a1('0x1d')](_0x72af9c);}return null;};}function patchUpdates(_0x58bb06){return function(_0x4b426c){try{jsonpatch[_0xd4a1('0x24')](_0x4b426c,_0x58bb06,!![]);}catch(_0x1bafd8){return BPromise[_0xd4a1('0x25')](_0x1bafd8);}return _0x4b426c['save']();};}function saveUpdates(_0x7741d0,_0x53c97b){return function(_0x17e359){if(_0x17e359){return _0x17e359[_0xd4a1('0x26')](_0x7741d0)['then'](function(_0x4909e9){return _0x4909e9;});}return null;};}function removeEntity(_0x591518,_0x10eb22){return function(_0x4904e2){if(_0x4904e2){return _0x4904e2[_0xd4a1('0x27')]()[_0xd4a1('0x28')](function(){_0x591518[_0xd4a1('0x1b')](0xcc)[_0xd4a1('0x1c')]();});}};}function handleEntityNotFound(_0x907cba,_0xa66c43){return function(_0x240e45){if(!_0x240e45){_0x907cba['sendStatus'](0x194);}return _0x240e45;};}function handleError(_0x520c0f,_0xed7849){_0xed7849=_0xed7849||0x1f4;return function(_0x350147){logger[_0xd4a1('0x29')](_0x350147['stack']);if(_0x350147[_0xd4a1('0x2a')]){delete _0x350147[_0xd4a1('0x2a')];}_0x520c0f['status'](_0xed7849)[_0xd4a1('0x2b')](_0x350147);};}exports[_0xd4a1('0x2c')]=function(_0x4da4b3,_0x11cbc1){var _0x40effa={},_0x45cb0e={},_0x575c78={'count':0x0,'rows':[]};var _0x22d71a=_[_0xd4a1('0x2d')](db[_0xd4a1('0x2e')][_0xd4a1('0x2f')],function(_0x21736e){return{'name':_0x21736e[_0xd4a1('0x30')],'type':_0x21736e[_0xd4a1('0x31')]['key']};});_0x45cb0e[_0xd4a1('0x32')]=_['map'](_0x22d71a,_0xd4a1('0x2a'));_0x45cb0e[_0xd4a1('0x33')]=_[_0xd4a1('0x34')](_0x4da4b3['query']);_0x45cb0e[_0xd4a1('0x35')]=_[_0xd4a1('0x36')](_0x45cb0e['model'],_0x45cb0e[_0xd4a1('0x33')]);_0x40effa[_0xd4a1('0x37')]=_[_0xd4a1('0x36')](_0x45cb0e[_0xd4a1('0x32')],qs['fields'](_0x4da4b3['query'][_0xd4a1('0x38')]));_0x40effa['attributes']=_0x40effa['attributes'][_0xd4a1('0x39')]?_0x40effa['attributes']:_0x45cb0e[_0xd4a1('0x32')];if(!_0x4da4b3[_0xd4a1('0x33')][_0xd4a1('0x3a')](_0xd4a1('0x3b'))){_0x40effa[_0xd4a1('0x21')]=qs[_0xd4a1('0x21')](_0x4da4b3[_0xd4a1('0x33')]['limit']);_0x40effa[_0xd4a1('0x1e')]=qs['offset'](_0x4da4b3[_0xd4a1('0x33')][_0xd4a1('0x1e')]);}_0x40effa[_0xd4a1('0x3c')]=qs[_0xd4a1('0x3d')](_0x4da4b3[_0xd4a1('0x33')][_0xd4a1('0x3d')]);_0x40effa[_0xd4a1('0x3e')]=qs[_0xd4a1('0x35')](_[_0xd4a1('0x3f')](_0x4da4b3[_0xd4a1('0x33')],_0x45cb0e[_0xd4a1('0x35')]),_0x22d71a);if(_0x4da4b3[_0xd4a1('0x33')]['filter']){_0x40effa[_0xd4a1('0x3e')]=_['merge'](_0x40effa['where'],{'$or':_['map'](_0x22d71a,function(_0x1769c7){if(_0x1769c7['type']!==_0xd4a1('0x40')){var _0x51017f={};_0x51017f[_0x1769c7[_0xd4a1('0x2a')]]={'$like':'%'+_0x4da4b3[_0xd4a1('0x33')]['filter']+'%'};return _0x51017f;}})});}_0x40effa=_['merge']({},_0x40effa,_0x4da4b3[_0xd4a1('0x41')]);var _0x154b11={'where':_0x40effa[_0xd4a1('0x3e')]};return db['MailTransferReport'][_0xd4a1('0x20')](_0x154b11)[_0xd4a1('0x28')](function(_0xbabe96){_0x575c78[_0xd4a1('0x20')]=_0xbabe96;if(_0x4da4b3[_0xd4a1('0x33')][_0xd4a1('0x42')]){_0x40effa['include']=[{'all':!![]}];}return db[_0xd4a1('0x2e')]['findAll'](_0x40effa);})[_0xd4a1('0x28')](function(_0x40935c){_0x575c78[_0xd4a1('0x43')]=_0x40935c;return _0x575c78;})['then'](respondWithFilteredResult(_0x11cbc1,_0x40effa))['catch'](handleError(_0x11cbc1,null));};exports[_0xd4a1('0x44')]=function(_0x57ef74,_0xe2a97c){var _0x1fb81f={'raw':!![],'where':{'id':_0x57ef74['params']['id']}},_0x1d7ea6={};_0x1d7ea6['model']=_[_0xd4a1('0x34')](db[_0xd4a1('0x2e')][_0xd4a1('0x2f')]);_0x1d7ea6['query']=_['keys'](_0x57ef74[_0xd4a1('0x33')]);_0x1d7ea6[_0xd4a1('0x35')]=_[_0xd4a1('0x36')](_0x1d7ea6['model'],_0x1d7ea6['query']);_0x1fb81f[_0xd4a1('0x37')]=_[_0xd4a1('0x36')](_0x1d7ea6[_0xd4a1('0x32')],qs[_0xd4a1('0x38')](_0x57ef74[_0xd4a1('0x33')][_0xd4a1('0x38')]));_0x1fb81f[_0xd4a1('0x37')]=_0x1fb81f[_0xd4a1('0x37')]['length']?_0x1fb81f[_0xd4a1('0x37')]:_0x1d7ea6[_0xd4a1('0x32')];if(_0x57ef74[_0xd4a1('0x33')][_0xd4a1('0x42')]){_0x1fb81f['include']=[{'all':!![]}];}_0x1fb81f=_['merge']({},_0x1fb81f,_0x57ef74[_0xd4a1('0x41')]);return db[_0xd4a1('0x2e')][_0xd4a1('0x45')](_0x1fb81f)[_0xd4a1('0x28')](handleEntityNotFound(_0xe2a97c,null))[_0xd4a1('0x28')](respondWithResult(_0xe2a97c,null))['catch'](handleError(_0xe2a97c,null));};exports[_0xd4a1('0x46')]=function(_0x962ba4,_0x58f809){return db[_0xd4a1('0x2e')][_0xd4a1('0x46')](_0x962ba4['body'],{})[_0xd4a1('0x28')](respondWithResult(_0x58f809,0xc9))[_0xd4a1('0x47')](handleError(_0x58f809,null));};exports[_0xd4a1('0x26')]=function(_0x46538b,_0x3e97c3){if(_0x46538b['body']['id']){delete _0x46538b[_0xd4a1('0x48')]['id'];}return db[_0xd4a1('0x2e')][_0xd4a1('0x45')]({'where':{'id':_0x46538b[_0xd4a1('0x49')]['id']}})[_0xd4a1('0x28')](handleEntityNotFound(_0x3e97c3,null))['then'](saveUpdates(_0x46538b[_0xd4a1('0x48')],null))[_0xd4a1('0x28')](respondWithResult(_0x3e97c3,null))[_0xd4a1('0x47')](handleError(_0x3e97c3,null));};exports['destroy']=function(_0x2cdccf,_0x5a5600){return db[_0xd4a1('0x2e')]['find']({'where':{'id':_0x2cdccf[_0xd4a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a5600,null))[_0xd4a1('0x28')](removeEntity(_0x5a5600,null))[_0xd4a1('0x47')](handleError(_0x5a5600,null));};exports[_0xd4a1('0x4a')]=function(_0x3e65ce,_0x5d4e51){return db[_0xd4a1('0x2e')][_0xd4a1('0x4a')]()[_0xd4a1('0x28')](respondWithResult(_0x5d4e51,null))['catch'](handleError(_0x5d4e51,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4ea42d6..3dd420f 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 _0x57cf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x46a31b,_0x11be27){var _0x386557=function(_0x6b1e64){while(--_0x6b1e64){_0x46a31b['push'](_0x46a31b['shift']());}};_0x386557(++_0x11be27);}(_0x57cf,0x11b));var _0xf57c=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x57cf[_0x43371b];return _0x19cd26;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var logger=require(_0xf57c('0x2'))(_0xf57c('0x3'));var moment=require(_0xf57c('0x4'));var BPromise=require(_0xf57c('0x5'));var rp=require(_0xf57c('0x6'));var fs=require('fs');var path=require(_0xf57c('0x7'));var rimraf=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var attributes=require('./mailTransferReport.attributes');module[_0xf57c('0xa')]=function(_0x4a5d1d,_0x12b00f){return _0x4a5d1d['define']('MailTransferReport',attributes,{'tableName':_0xf57c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf57c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8558=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util'];(function(_0x3135fd,_0x2a5c4b){var _0x1b5d7f=function(_0x55663d){while(--_0x55663d){_0x3135fd['push'](_0x3135fd['shift']());}};_0x1b5d7f(++_0x2a5c4b);}(_0x8558,0x103));var _0x8855=function(_0x1b3780,_0x43c82f){_0x1b3780=_0x1b3780-0x0;var _0x5ecab1=_0x8558[_0x1b3780];return _0x5ecab1;};'use strict';var _=require('lodash');var util=require(_0x8855('0x0'));var logger=require(_0x8855('0x1'))(_0x8855('0x2'));var moment=require(_0x8855('0x3'));var BPromise=require(_0x8855('0x4'));var rp=require(_0x8855('0x5'));var fs=require('fs');var path=require(_0x8855('0x6'));var rimraf=require('rimraf');var config=require(_0x8855('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x8855('0x8')]=function(_0x4ed0e8,_0x276ee5){return _0x4ed0e8[_0x8855('0x9')](_0x8855('0xa'),attributes,{'tableName':_0x8855('0xb'),'paranoid':![],'indexes':[{'name':_0x8855('0xc'),'fields':[_0x8855('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 64a7752..92523e9 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 _0x3d86=['http','request','then','info','debug','request\x20sent','stringify','code','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5b0675,_0x21cf5b){var _0x5ae435=function(_0xd67cc0){while(--_0xd67cc0){_0x5b0675['push'](_0x5b0675['shift']());}};_0x5ae435(++_0x21cf5b);}(_0x3d86,0x1a5));var _0x63d8=function(_0x29905b,_0x43b256){_0x29905b=_0x29905b-0x0;var _0xf73f6d=_0x3d86[_0x29905b];return _0xf73f6d;};'use strict';var _=require(_0x63d8('0x0'));var util=require(_0x63d8('0x1'));var moment=require(_0x63d8('0x2'));var BPromise=require(_0x63d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63d8('0x4'));var db=require(_0x63d8('0x5'))['db'];var utils=require(_0x63d8('0x6'));var logger=require(_0x63d8('0x7'))(_0x63d8('0x8'));var config=require(_0x63d8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x63d8('0xa')][_0x63d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d66e0,_0x1dfa0c,_0x4435b7){return new BPromise(function(_0x5907bc,_0x250f17){return client[_0x63d8('0xc')](_0x2d66e0,_0x4435b7)[_0x63d8('0xd')](function(_0x44cc9e){logger[_0x63d8('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1dfa0c,'request\x20sent');logger[_0x63d8('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1dfa0c,_0x63d8('0x10'),JSON[_0x63d8('0x11')](_0x44cc9e));if(_0x44cc9e['error']){if(_0x44cc9e['error'][_0x63d8('0x12')]===0x1f4){logger[_0x63d8('0x13')](_0x63d8('0x14'),_0x1dfa0c,_0x44cc9e[_0x63d8('0x13')][_0x63d8('0x15')]);return _0x250f17(_0x44cc9e['error'][_0x63d8('0x15')]);}logger['error'](_0x63d8('0x14'),_0x1dfa0c,_0x44cc9e['error'][_0x63d8('0x15')]);return _0x5907bc(_0x44cc9e[_0x63d8('0x13')]['message']);}else{logger[_0x63d8('0xe')](_0x63d8('0x14'),_0x1dfa0c,_0x63d8('0x10'));_0x5907bc(_0x44cc9e[_0x63d8('0x16')][_0x63d8('0x15')]);}})[_0x63d8('0x17')](function(_0xfe892e){logger[_0x63d8('0x13')](_0x63d8('0x14'),_0x1dfa0c,_0xfe892e);_0x250f17(_0xfe892e);});});} \ No newline at end of file +var _0xa297=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xa297,0x154));var _0x7a29=function(_0xc516e8,_0x53a172){_0xc516e8=_0xc516e8-0x0;var _0xf1ef11=_0xa297[_0xc516e8];return _0xf1ef11;};'use strict';var _=require(_0x7a29('0x0'));var util=require(_0x7a29('0x1'));var moment=require(_0x7a29('0x2'));var BPromise=require(_0x7a29('0x3'));var rs=require(_0x7a29('0x4'));var fs=require('fs');var Redis=require(_0x7a29('0x5'));var db=require(_0x7a29('0x6'))['db'];var utils=require(_0x7a29('0x7'));var logger=require(_0x7a29('0x8'))(_0x7a29('0x9'));var config=require(_0x7a29('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27bf0e,_0x40dde8,_0x1df551){return new BPromise(function(_0x37868f,_0x370256){return client[_0x7a29('0xc')](_0x27bf0e,_0x1df551)[_0x7a29('0xd')](function(_0x3c83d5){logger[_0x7a29('0xe')](_0x7a29('0xf'),_0x40dde8,'request\x20sent');logger['debug'](_0x7a29('0x10'),_0x40dde8,_0x7a29('0x11'),JSON['stringify'](_0x3c83d5));if(_0x3c83d5[_0x7a29('0x12')]){if(_0x3c83d5[_0x7a29('0x12')][_0x7a29('0x13')]===0x1f4){logger[_0x7a29('0x12')](_0x7a29('0xf'),_0x40dde8,_0x3c83d5[_0x7a29('0x12')][_0x7a29('0x14')]);return _0x370256(_0x3c83d5[_0x7a29('0x12')][_0x7a29('0x14')]);}logger[_0x7a29('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x40dde8,_0x3c83d5['error'][_0x7a29('0x14')]);return _0x37868f(_0x3c83d5[_0x7a29('0x12')][_0x7a29('0x14')]);}else{logger[_0x7a29('0xe')](_0x7a29('0xf'),_0x40dde8,'request\x20sent');_0x37868f(_0x3c83d5[_0x7a29('0x15')]['message']);}})[_0x7a29('0x16')](function(_0xa057d9){logger['error'](_0x7a29('0xf'),_0x40dde8,_0xa057d9);_0x370256(_0xa057d9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 516816c..29bc1a1 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 _0x9d43=['./memberReport.controller','get','index','/describe','describe','show','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x155442,_0xda4bf3){var _0x4ff73b=function(_0x168001){while(--_0x168001){_0x155442['push'](_0x155442['shift']());}};_0x4ff73b(++_0xda4bf3);}(_0x9d43,0x15d));var _0x39d4=function(_0x265a84,_0x271161){_0x265a84=_0x265a84-0x0;var _0x15df74=_0x9d43[_0x265a84];return _0x15df74;};'use strict';var multer=require(_0x39d4('0x0'));var util=require(_0x39d4('0x1'));var path=require(_0x39d4('0x2'));var timeout=require(_0x39d4('0x3'));var express=require(_0x39d4('0x4'));var router=express[_0x39d4('0x5')]();var fs_extra=require(_0x39d4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x39d4('0x7'));var controller=require(_0x39d4('0x8'));router[_0x39d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x39d4('0xa')]);router[_0x39d4('0x9')](_0x39d4('0xb'),auth['isAuthenticated'](),controller[_0x39d4('0xc')]);router[_0x39d4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x39d4('0xd')]);router['post']('/',auth[_0x39d4('0xe')](),controller[_0x39d4('0xf')]);router[_0x39d4('0x10')](_0x39d4('0x11'),auth[_0x39d4('0xe')](),controller[_0x39d4('0x12')]);router[_0x39d4('0x13')](_0x39d4('0x11'),auth[_0x39d4('0xe')](),controller['destroy']);module[_0x39d4('0x14')]=router; \ No newline at end of file +var _0x75e0=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','update','delete'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x75e0,0x67));var _0x075e=function(_0x3cf98f,_0x404ce1){_0x3cf98f=_0x3cf98f-0x0;var _0x2a09a8=_0x75e0[_0x3cf98f];return _0x2a09a8;};'use strict';var multer=require(_0x075e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x075e('0x1'));var express=require(_0x075e('0x2'));var router=express[_0x075e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x075e('0x4'));var config=require(_0x075e('0x5'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x075e('0x6')](),controller[_0x075e('0x7')]);router['get'](_0x075e('0x8'),auth[_0x075e('0x6')](),controller[_0x075e('0x9')]);router[_0x075e('0xa')](_0x075e('0xb'),auth['isAuthenticated'](),controller[_0x075e('0xc')]);router[_0x075e('0xd')]('/',auth[_0x075e('0x6')](),controller['create']);router['put'](_0x075e('0xb'),auth['isAuthenticated'](),controller[_0x075e('0xe')]);router[_0x075e('0xf')](_0x075e('0xb'),auth[_0x075e('0x6')](),controller['destroy']);module[_0x075e('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 503d7aa..3d36e12 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 _0xfa30=['setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xfa30,0x117));var _0x0fa3=function(_0x16e3b2,_0x1d4dac){_0x16e3b2=_0x16e3b2-0x0;var _0x560034=_0xfa30[_0x16e3b2];return _0x560034;};'use strict';var Sequelize=require(_0x0fa3('0x0'));var moment=require('moment');module[_0x0fa3('0x1')]={'channel':{'type':Sequelize[_0x0fa3('0x2')]},'membername':{'type':Sequelize[_0x0fa3('0x2')]},'interface':{'type':Sequelize[_0x0fa3('0x2')]},'type':{'type':Sequelize[_0x0fa3('0x2')],'defaultValue':_0x0fa3('0x3'),'comment':_0x0fa3('0x4')},'duration':{'type':Sequelize[_0x0fa3('0x5')]},'enterAt':{'type':Sequelize[_0x0fa3('0x6')]},'exitAt':{'type':Sequelize[_0x0fa3('0x6')],'set':function(_0x185109){var _0x5a5688=moment(_0x185109);var _0x3b4e09=moment(this[_0x0fa3('0x7')](_0x0fa3('0x8')));var _0x1eb318=_0x5a5688['diff'](_0x3b4e09,'seconds');this[_0x0fa3('0x9')](_0x0fa3('0xa'),_0x185109);this[_0x0fa3('0x9')](_0x0fa3('0xb'),_0x1eb318>=0x0?_0x1eb318:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xc')},'data3':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xd')},'data4':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xe')},'data5':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xf')},'role':{'type':Sequelize[_0x0fa3('0x2')]},'internal':{'type':Sequelize[_0x0fa3('0x5')]},'uniqueid':{'type':Sequelize[_0x0fa3('0x2')]}}; \ No newline at end of file +var _0xf171=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','seconds','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','exports'];(function(_0x1111f9,_0x158f29){var _0x16cc1f=function(_0x1b1a09){while(--_0x1b1a09){_0x1111f9['push'](_0x1111f9['shift']());}};_0x16cc1f(++_0x158f29);}(_0xf171,0x116));var _0x1f17=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0xf171[_0x1551af];return _0xd8eb82;};'use strict';var Sequelize=require(_0x1f17('0x0'));var moment=require('moment');module[_0x1f17('0x1')]={'channel':{'type':Sequelize[_0x1f17('0x2')]},'membername':{'type':Sequelize[_0x1f17('0x2')]},'interface':{'type':Sequelize[_0x1f17('0x2')]},'type':{'type':Sequelize[_0x1f17('0x2')],'defaultValue':_0x1f17('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x1f17('0x4')]},'enterAt':{'type':Sequelize[_0x1f17('0x5')]},'exitAt':{'type':Sequelize[_0x1f17('0x5')],'set':function(_0x237735){var _0x18f568=moment(_0x237735);var _0x3fca6d=moment(this[_0x1f17('0x6')]('enterAt'));var _0x29cf8a=_0x18f568['diff'](_0x3fca6d,_0x1f17('0x7'));this['setDataValue'](_0x1f17('0x8'),_0x237735);this[_0x1f17('0x9')]('duration',_0x29cf8a>=0x0?_0x29cf8a:null);}},'data1':{'type':Sequelize[_0x1f17('0x2')],'comment':_0x1f17('0xa')},'data2':{'type':Sequelize[_0x1f17('0x2')],'comment':_0x1f17('0xb')},'data3':{'type':Sequelize[_0x1f17('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x1f17('0xc')},'data5':{'type':Sequelize[_0x1f17('0x2')],'comment':_0x1f17('0xd')},'role':{'type':Sequelize[_0x1f17('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x1f17('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index cf4c4ac..28cd2a1 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4941ab,_0x2380a9){var _0x2658c0=function(_0x1cca1f){while(--_0x1cca1f){_0x4941ab['push'](_0x4941ab['shift']());}};_0x2658c0(++_0x2380a9);}(_0x9c44,0x178));var _0x49c4=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x9c44[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x425ecd,_0x1e1bed){var _0xddc406=function(_0x179638){while(--_0x179638){_0x425ecd['push'](_0x425ecd['shift']());}};_0xddc406(++_0x1e1bed);}(_0x008c,0x188));var _0xc008=function(_0x398437,_0x382e5f){_0x398437=_0x398437-0x0;var _0x539597=_0x008c[_0x398437];return _0x539597;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 394b816..a1d3b00 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 _0xe2ea=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','define','MemberReport','report_member','membername_interface','interface'];(function(_0x18472e,_0x3076d9){var _0x18e16d=function(_0x4a4ec7){while(--_0x4a4ec7){_0x18472e['push'](_0x18472e['shift']());}};_0x18e16d(++_0x3076d9);}(_0xe2ea,0xc3));var _0xae2e=function(_0xac5a33,_0x32272a){_0xac5a33=_0xac5a33-0x0;var _0x41d78c=_0xe2ea[_0xac5a33];return _0x41d78c;};'use strict';var _=require(_0xae2e('0x0'));var util=require(_0xae2e('0x1'));var logger=require(_0xae2e('0x2'))(_0xae2e('0x3'));var moment=require(_0xae2e('0x4'));var BPromise=require(_0xae2e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae2e('0x6'));var rimraf=require(_0xae2e('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x228fcb,_0x646000){return _0x228fcb[_0xae2e('0x8')](_0xae2e('0x9'),attributes,{'tableName':_0xae2e('0xa'),'paranoid':![],'indexes':[{'name':_0xae2e('0xb'),'fields':['membername',_0xae2e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51ed=['membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x51ed,0x12f));var _0xd51e=function(_0x46647b,_0x4e8678){_0x46647b=_0x46647b-0x0;var _0x2bef5d=_0x51ed[_0x46647b];return _0x2bef5d;};'use strict';var _=require(_0xd51e('0x0'));var util=require(_0xd51e('0x1'));var logger=require(_0xd51e('0x2'))(_0xd51e('0x3'));var moment=require(_0xd51e('0x4'));var BPromise=require(_0xd51e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd51e('0x6'));var rimraf=require('rimraf');var config=require(_0xd51e('0x7'));var attributes=require(_0xd51e('0x8'));module[_0xd51e('0x9')]=function(_0x541798,_0x437618){return _0x541798[_0xd51e('0xa')](_0xd51e('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xd51e('0xc'),'fields':[_0xd51e('0xd'),_0xd51e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 20a092a..9fadedc 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 _0xb091=['CreateMemberReport','create','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb091,0x16e));var _0x1b09=function(_0x14a0aa,_0x513190){_0x14a0aa=_0x14a0aa-0x0;var _0x20052a=_0xb091[_0x14a0aa];return _0x20052a;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('MemberReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});}exports[_0x1b09('0x15')]=function(_0x646575){var _0x4c64e1=this;return new Promise(function(_0x214c6b,_0x1c1ef9){return db['MemberReport']['findAll']({'raw':_0x646575[_0x1b09('0x16')]?_0x646575['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![],'where':_0x646575['options']?_0x646575[_0x1b09('0x16')][_0x1b09('0x18')]||null:null,'attributes':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null,'include':_0x646575['options']?_0x646575['options'][_0x1b09('0x1b')]?_[_0x1b09('0x1c')](_0x646575['options'][_0x1b09('0x1b')],function(_0x11d0d5){return{'model':db[_0x11d0d5[_0x1b09('0x1d')]],'as':_0x11d0d5['as'],'attributes':_0x11d0d5[_0x1b09('0x19')],'include':_0x11d0d5['include']?_[_0x1b09('0x1c')](_0x11d0d5[_0x1b09('0x1b')],function(_0x4936d0){return{'model':db[_0x4936d0[_0x1b09('0x1d')]],'as':_0x4936d0['as'],'attributes':_0x4936d0[_0x1b09('0x19')],'include':_0x4936d0['include']?_[_0x1b09('0x1c')](_0x4936d0[_0x1b09('0x1b')],function(_0xa71272){return{'model':db[_0xa71272[_0x1b09('0x1d')]],'as':_0xa71272['as'],'attributes':_0xa71272['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b09('0xa')](function(_0x3cdbc5){logger['info'](_0x1b09('0x15'),_0x646575);logger[_0x1b09('0xe')](_0x1b09('0x15'),_0x646575,JSON[_0x1b09('0x10')](_0x3cdbc5));_0x214c6b(_0x3cdbc5);})[_0x1b09('0x14')](function(_0x1aa179){logger[_0x1b09('0x11')]('GetMemberReport',_0x1aa179[_0x1b09('0x12')],_0x646575);_0x1c1ef9(_0x4c64e1[_0x1b09('0x11')](0x1f4,_0x1aa179['message']));});});};exports[_0x1b09('0x1e')]=function(_0x1a6130){var _0x1b98da=this;return new Promise(function(_0x122b1c,_0x62a96b){return db['MemberReport'][_0x1b09('0x1f')](_0x1a6130['body'],{'raw':_0x1a6130[_0x1b09('0x16')]?_0x1a6130['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![]})[_0x1b09('0xa')](function(_0x381e76){logger[_0x1b09('0xb')](_0x1b09('0x1e'),_0x1a6130);logger[_0x1b09('0xe')](_0x1b09('0x1e'),_0x1a6130,JSON[_0x1b09('0x10')](_0x381e76));_0x122b1c(_0x381e76);})[_0x1b09('0x14')](function(_0x33bca2){logger['error'](_0x1b09('0x1e'),_0x33bca2[_0x1b09('0x12')],_0x1a6130);_0x62a96b(_0x1b98da[_0x1b09('0x11')](0x1f4,_0x33bca2['message']));});});};exports[_0x1b09('0x20')]=function(_0x339b66){var _0x4662d6=this;return new Promise(function(_0x3ce2a9,_0x12a720){return db[_0x1b09('0x21')][_0x1b09('0x22')](_0x339b66[_0x1b09('0x23')],{'raw':_0x339b66['options']?_0x339b66[_0x1b09('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339b66[_0x1b09('0x16')]?_0x339b66['options'][_0x1b09('0x18')]||null:null,'attributes':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null})[_0x1b09('0xa')](function(_0x43032f){logger[_0x1b09('0xb')](_0x1b09('0x20'),_0x339b66);logger[_0x1b09('0xe')](_0x1b09('0x20'),_0x339b66,JSON['stringify'](_0x43032f));_0x3ce2a9(_0x43032f);})['catch'](function(_0x23ce9a){logger[_0x1b09('0x11')](_0x1b09('0x20'),_0x23ce9a[_0x1b09('0x12')],_0x339b66);_0x12a720(_0x4662d6[_0x1b09('0x11')](0x1f4,_0x23ce9a[_0x1b09('0x12')]));});});}; \ No newline at end of file +var _0x9bb8=['../../config/environment','jayson/promise','http','then','MemberReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f33b7,_0x566b11){var _0x4e097b=function(_0x2b84b9){while(--_0x2b84b9){_0x5f33b7['push'](_0x5f33b7['shift']());}};_0x4e097b(++_0x566b11);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x89bb('0x0'));var util=require(_0x89bb('0x1'));var moment=require(_0x89bb('0x2'));var BPromise=require(_0x89bb('0x3'));var rs=require(_0x89bb('0x4'));var fs=require('fs');var Redis=require(_0x89bb('0x5'));var db=require(_0x89bb('0x6'))['db'];var utils=require(_0x89bb('0x7'));var logger=require(_0x89bb('0x8'))(_0x89bb('0x9'));var config=require(_0x89bb('0xa'));var jayson=require(_0x89bb('0xb'));var client=jayson['client'][_0x89bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b9e11,_0x3d85a5,_0x39c0eb){return new BPromise(function(_0x288ad3,_0x392260){return client['request'](_0x1b9e11,_0x39c0eb)[_0x89bb('0xd')](function(_0x19a3fd){logger['info'](_0x89bb('0xe'),_0x3d85a5,'request\x20sent');logger[_0x89bb('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3d85a5,_0x89bb('0x10'),JSON['stringify'](_0x19a3fd));if(_0x19a3fd[_0x89bb('0x11')]){if(_0x19a3fd[_0x89bb('0x11')][_0x89bb('0x12')]===0x1f4){logger[_0x89bb('0x11')]('MemberReport,\x20%s,\x20%s',_0x3d85a5,_0x19a3fd[_0x89bb('0x11')][_0x89bb('0x13')]);return _0x392260(_0x19a3fd[_0x89bb('0x11')][_0x89bb('0x13')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3d85a5,_0x19a3fd[_0x89bb('0x11')][_0x89bb('0x13')]);return _0x288ad3(_0x19a3fd[_0x89bb('0x11')][_0x89bb('0x13')]);}else{logger[_0x89bb('0x14')](_0x89bb('0xe'),_0x3d85a5,'request\x20sent');_0x288ad3(_0x19a3fd[_0x89bb('0x15')][_0x89bb('0x13')]);}})['catch'](function(_0x1c7666){logger[_0x89bb('0x11')](_0x89bb('0xe'),_0x3d85a5,_0x1c7666);_0x392260(_0x1c7666);});});}exports[_0x89bb('0x16')]=function(_0x310e3d){var _0x58f826=this;return new Promise(function(_0x1693cc,_0xfef96d){return db[_0x89bb('0x17')][_0x89bb('0x18')]({'raw':_0x310e3d[_0x89bb('0x19')]?_0x310e3d[_0x89bb('0x19')][_0x89bb('0x1a')]===undefined?!![]:![]:!![],'where':_0x310e3d[_0x89bb('0x19')]?_0x310e3d[_0x89bb('0x19')][_0x89bb('0x1b')]||null:null,'attributes':_0x310e3d['options']?_0x310e3d[_0x89bb('0x19')][_0x89bb('0x1c')]||null:null,'limit':_0x310e3d[_0x89bb('0x19')]?_0x310e3d[_0x89bb('0x19')][_0x89bb('0x1d')]||null:null,'include':_0x310e3d[_0x89bb('0x19')]?_0x310e3d['options'][_0x89bb('0x1e')]?_[_0x89bb('0x1f')](_0x310e3d[_0x89bb('0x19')][_0x89bb('0x1e')],function(_0x3c173b){return{'model':db[_0x3c173b[_0x89bb('0x20')]],'as':_0x3c173b['as'],'attributes':_0x3c173b[_0x89bb('0x1c')],'include':_0x3c173b[_0x89bb('0x1e')]?_[_0x89bb('0x1f')](_0x3c173b[_0x89bb('0x1e')],function(_0x4c25f6){return{'model':db[_0x4c25f6['model']],'as':_0x4c25f6['as'],'attributes':_0x4c25f6[_0x89bb('0x1c')],'include':_0x4c25f6[_0x89bb('0x1e')]?_[_0x89bb('0x1f')](_0x4c25f6[_0x89bb('0x1e')],function(_0xfaf778){return{'model':db[_0xfaf778[_0x89bb('0x20')]],'as':_0xfaf778['as'],'attributes':_0xfaf778[_0x89bb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x89bb('0xd')](function(_0x34b852){logger[_0x89bb('0x14')](_0x89bb('0x16'),_0x310e3d);logger[_0x89bb('0xf')]('GetMemberReport',_0x310e3d,JSON[_0x89bb('0x21')](_0x34b852));_0x1693cc(_0x34b852);})[_0x89bb('0x22')](function(_0x3757e1){logger['error'](_0x89bb('0x16'),_0x3757e1[_0x89bb('0x13')],_0x310e3d);_0xfef96d(_0x58f826[_0x89bb('0x11')](0x1f4,_0x3757e1[_0x89bb('0x13')]));});});};exports['CreateMemberReport']=function(_0x40c0d2){var _0x577515=this;return new Promise(function(_0x7f9529,_0x3b9a13){return db['MemberReport'][_0x89bb('0x23')](_0x40c0d2[_0x89bb('0x24')],{'raw':_0x40c0d2[_0x89bb('0x19')]?_0x40c0d2[_0x89bb('0x19')][_0x89bb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x378ba1){logger[_0x89bb('0x14')](_0x89bb('0x25'),_0x40c0d2);logger[_0x89bb('0xf')]('CreateMemberReport',_0x40c0d2,JSON[_0x89bb('0x21')](_0x378ba1));_0x7f9529(_0x378ba1);})[_0x89bb('0x22')](function(_0x39e5d8){logger['error'](_0x89bb('0x25'),_0x39e5d8[_0x89bb('0x13')],_0x40c0d2);_0x3b9a13(_0x577515[_0x89bb('0x11')](0x1f4,_0x39e5d8[_0x89bb('0x13')]));});});};exports[_0x89bb('0x26')]=function(_0x3bee56){var _0x3c4eff=this;return new Promise(function(_0x149828,_0xf70e23){return db[_0x89bb('0x17')][_0x89bb('0x27')](_0x3bee56['body'],{'raw':_0x3bee56[_0x89bb('0x19')]?_0x3bee56[_0x89bb('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bee56[_0x89bb('0x19')]?_0x3bee56[_0x89bb('0x19')]['where']||null:null,'attributes':_0x3bee56['options']?_0x3bee56['options'][_0x89bb('0x1c')]||null:null,'limit':_0x3bee56['options']?_0x3bee56['options']['limit']||null:null})[_0x89bb('0xd')](function(_0x1b0562){logger[_0x89bb('0x14')]('UpdateMemberReport',_0x3bee56);logger[_0x89bb('0xf')](_0x89bb('0x26'),_0x3bee56,JSON[_0x89bb('0x21')](_0x1b0562));_0x149828(_0x1b0562);})[_0x89bb('0x22')](function(_0x24e4a3){logger[_0x89bb('0x11')]('UpdateMemberReport',_0x24e4a3[_0x89bb('0x13')],_0x3bee56);_0xf70e23(_0x3c4eff[_0x89bb('0x11')](0x1f4,_0x24e4a3['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3919a51..cb91aea 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 _0x7ef7=['../../config/environment','./migration.controller','get','index','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x7ef7,0x91));var _0x77ef=function(_0x335b20,_0x317d09){_0x335b20=_0x335b20-0x0;var _0x3f8ac6=_0x7ef7[_0x335b20];return _0x3f8ac6;};'use strict';var multer=require('multer');var util=require(_0x77ef('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ef('0x1'));var router=express['Router']();var fs_extra=require(_0x77ef('0x2'));var auth=require(_0x77ef('0x3'));var interaction=require(_0x77ef('0x4'));var config=require(_0x77ef('0x5'));var controller=require(_0x77ef('0x6'));router[_0x77ef('0x7')]('/',controller[_0x77ef('0x8')]);module[_0x77ef('0x9')]=router; \ No newline at end of file +var _0xd2a3=['fs-extra','../../config/environment','index','exports','multer','util','connect-timeout','express','Router'];(function(_0x175696,_0x1b5b89){var _0xd46f05=function(_0xfa562f){while(--_0xfa562f){_0x175696['push'](_0x175696['shift']());}};_0xd46f05(++_0x1b5b89);}(_0xd2a3,0x12d));var _0x3d2a=function(_0x29dd1c,_0x6f8a18){_0x29dd1c=_0x29dd1c-0x0;var _0x2aca13=_0xd2a3[_0x29dd1c];return _0x2aca13;};'use strict';var multer=require(_0x3d2a('0x0'));var util=require(_0x3d2a('0x1'));var path=require('path');var timeout=require(_0x3d2a('0x2'));var express=require(_0x3d2a('0x3'));var router=express[_0x3d2a('0x4')]();var fs_extra=require(_0x3d2a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3d2a('0x6'));var controller=require('./migration.controller');router['get']('/',controller[_0x3d2a('0x7')]);module[_0x3d2a('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 6d051d7..0cf8ee2 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 _0xbbfe=['exports','version'];(function(_0x4e8db9,_0x15ff81){var _0x1fc3be=function(_0x1cc230){while(--_0x1cc230){_0x4e8db9['push'](_0x4e8db9['shift']());}};_0x1fc3be(++_0x15ff81);}(_0xbbfe,0x76));var _0xebbf=function(_0x675da0,_0x2d6823){_0x675da0=_0x675da0-0x0;var _0x2eeb20=_0xbbfe[_0x675da0];return _0x2eeb20;};'use strict';var Sequelize=require('sequelize');module[_0xebbf('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xebbf('0x1')}}; \ No newline at end of file +var _0xc840=['sequelize'];(function(_0x496818,_0x1f9889){var _0x19b7f2=function(_0x1c4624){while(--_0x1c4624){_0x496818['push'](_0x496818['shift']());}};_0x19b7f2(++_0x1f9889);}(_0xc840,0x189));var _0x0c84=function(_0x44a80f,_0x159447){_0x44a80f=_0x44a80f-0x0;var _0x3bc114=_0xc840[_0x44a80f];return _0x3bc114;};'use strict';var Sequelize=require(_0x0c84('0x0'));module['exports']={'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 6705467..de47b57 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 _0xc02d=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','include','rows','catch'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xc02d,0x1f0));var _0xdc02=function(_0x597d5d,_0x35ed74){_0x597d5d=_0x597d5d-0x0;var _0x336289=_0xc02d[_0x597d5d];return _0x336289;};'use strict';var emlformat=require(_0xdc02('0x0'));var rimraf=require(_0xdc02('0x1'));var zipdir=require(_0xdc02('0x2'));var jsonpatch=require(_0xdc02('0x3'));var rp=require(_0xdc02('0x4'));var moment=require('moment');var BPromise=require(_0xdc02('0x5'));var Mustache=require(_0xdc02('0x6'));var util=require(_0xdc02('0x7'));var path=require(_0xdc02('0x8'));var sox=require(_0xdc02('0x9'));var csv=require(_0xdc02('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc02('0xb'));var squel=require(_0xdc02('0xc'));var crypto=require(_0xdc02('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc02('0xa'));var querystring=require(_0xdc02('0xe'));var Papa=require(_0xdc02('0xf'));var Redis=require(_0xdc02('0x10'));var authService=require(_0xdc02('0x11'));var qs=require(_0xdc02('0x12'));var as=require(_0xdc02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc02('0x14'))(_0xdc02('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17266f,_0x30ff99){_0x30ff99=_0x30ff99||0xcc;return function(_0x17dbb2){if(_0x17dbb2){return _0x17266f['sendStatus'](_0x30ff99);}return _0x17266f[_0xdc02('0x16')](_0x30ff99)[_0xdc02('0x17')]();};}function respondWithResult(_0x140b6f,_0x3c41b0){_0x3c41b0=_0x3c41b0||0xc8;return function(_0x3eddad){if(_0x3eddad){return _0x140b6f[_0xdc02('0x16')](_0x3c41b0)[_0xdc02('0x18')](_0x3eddad);}};}function respondWithFilteredResult(_0x55a285,_0x25a229){return function(_0x3900e4){if(_0x3900e4){var _0x4faa5c=typeof _0x25a229[_0xdc02('0x19')]===_0xdc02('0x1a')&&typeof _0x25a229[_0xdc02('0x1b')]==='undefined';var _0x564d01=_0x3900e4[_0xdc02('0x1c')];var _0x2d166f=_0x4faa5c?0x0:_0x25a229['offset'];var _0x55df1d=_0x4faa5c?_0x3900e4[_0xdc02('0x1c')]:_0x25a229['offset']+_0x25a229['limit'];var _0x1ae94f;if(_0x55df1d>=_0x564d01){_0x55df1d=_0x564d01;_0x1ae94f=0xc8;}else{_0x1ae94f=0xce;}_0x55a285[_0xdc02('0x16')](_0x1ae94f);return _0x55a285[_0xdc02('0x1d')](_0xdc02('0x1e'),_0x2d166f+'-'+_0x55df1d+'/'+_0x564d01)['json'](_0x3900e4);}return null;};}function patchUpdates(_0x5609ce){return function(_0x4fa07b){try{jsonpatch['apply'](_0x4fa07b,_0x5609ce,!![]);}catch(_0x23f947){return BPromise[_0xdc02('0x1f')](_0x23f947);}return _0x4fa07b[_0xdc02('0x20')]();};}function saveUpdates(_0x1d6cc5,_0x55522c){return function(_0x6cf636){if(_0x6cf636){return _0x6cf636['update'](_0x1d6cc5)[_0xdc02('0x21')](function(_0x1c5c76){return _0x1c5c76;});}return null;};}function removeEntity(_0xbe144c,_0x5eb8fe){return function(_0xfd1a0e){if(_0xfd1a0e){return _0xfd1a0e[_0xdc02('0x22')]()[_0xdc02('0x21')](function(){_0xbe144c[_0xdc02('0x16')](0xcc)[_0xdc02('0x17')]();});}};}function handleEntityNotFound(_0x53d920,_0x2f7071){return function(_0x103bb9){if(!_0x103bb9){_0x53d920[_0xdc02('0x23')](0x194);}return _0x103bb9;};}function handleError(_0x40985d,_0x1cd0bd){_0x1cd0bd=_0x1cd0bd||0x1f4;return function(_0x3adf3d){logger[_0xdc02('0x24')](_0x3adf3d[_0xdc02('0x25')]);if(_0x3adf3d[_0xdc02('0x26')]){delete _0x3adf3d[_0xdc02('0x26')];}_0x40985d[_0xdc02('0x16')](_0x1cd0bd)[_0xdc02('0x27')](_0x3adf3d);};}exports['index']=function(_0x476331,_0x98f8e5){var _0x73cccc={},_0x57be4b={},_0x5ebb56={'count':0x0,'rows':[]};var _0x352972=_[_0xdc02('0x28')](db[_0xdc02('0x29')][_0xdc02('0x2a')],function(_0x1eb4de){return{'name':_0x1eb4de[_0xdc02('0x2b')],'type':_0x1eb4de[_0xdc02('0x2c')][_0xdc02('0x2d')]};});_0x57be4b[_0xdc02('0x2e')]=_[_0xdc02('0x28')](_0x352972,_0xdc02('0x26'));_0x57be4b[_0xdc02('0x2f')]=_['keys'](_0x476331[_0xdc02('0x2f')]);_0x57be4b[_0xdc02('0x30')]=_['intersection'](_0x57be4b[_0xdc02('0x2e')],_0x57be4b[_0xdc02('0x2f')]);_0x73cccc['attributes']=_[_0xdc02('0x31')](_0x57be4b[_0xdc02('0x2e')],qs[_0xdc02('0x32')](_0x476331[_0xdc02('0x2f')][_0xdc02('0x32')]));_0x73cccc[_0xdc02('0x33')]=_0x73cccc[_0xdc02('0x33')][_0xdc02('0x34')]?_0x73cccc[_0xdc02('0x33')]:_0x57be4b['model'];if(!_0x476331[_0xdc02('0x2f')][_0xdc02('0x35')]('nolimit')){_0x73cccc[_0xdc02('0x1b')]=qs['limit'](_0x476331[_0xdc02('0x2f')][_0xdc02('0x1b')]);_0x73cccc[_0xdc02('0x19')]=qs['offset'](_0x476331[_0xdc02('0x2f')][_0xdc02('0x19')]);}_0x73cccc['order']=qs[_0xdc02('0x36')](_0x476331[_0xdc02('0x2f')][_0xdc02('0x36')]);_0x73cccc[_0xdc02('0x37')]=qs[_0xdc02('0x30')](_[_0xdc02('0x38')](_0x476331[_0xdc02('0x2f')],_0x57be4b[_0xdc02('0x30')]),_0x352972);if(_0x476331[_0xdc02('0x2f')][_0xdc02('0x39')]){_0x73cccc[_0xdc02('0x37')]=_[_0xdc02('0x3a')](_0x73cccc[_0xdc02('0x37')],{'$or':_[_0xdc02('0x28')](_0x352972,function(_0x1963fd){if(_0x1963fd[_0xdc02('0x2c')]!=='VIRTUAL'){var _0x424d2e={};_0x424d2e[_0x1963fd['name']]={'$like':'%'+_0x476331[_0xdc02('0x2f')][_0xdc02('0x39')]+'%'};return _0x424d2e;}})});}_0x73cccc=_[_0xdc02('0x3a')]({},_0x73cccc,_0x476331['options']);var _0x421338={'where':_0x73cccc[_0xdc02('0x37')]};return db[_0xdc02('0x29')][_0xdc02('0x1c')](_0x421338)[_0xdc02('0x21')](function(_0x19f950){_0x5ebb56[_0xdc02('0x1c')]=_0x19f950;if(_0x476331['query']['includeAll']){_0x73cccc[_0xdc02('0x3b')]=[{'all':!![]}];}return db[_0xdc02('0x29')]['findAll'](_0x73cccc);})[_0xdc02('0x21')](function(_0x1fa14f){_0x5ebb56[_0xdc02('0x3c')]=_0x1fa14f;return _0x5ebb56;})[_0xdc02('0x21')](respondWithFilteredResult(_0x98f8e5,_0x73cccc))[_0xdc02('0x3d')](handleError(_0x98f8e5,null));}; \ No newline at end of file +var _0xaf6a=['type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','Migration'];(function(_0x227cfb,_0x4f42cf){var _0x131407=function(_0x37ddbb){while(--_0x37ddbb){_0x227cfb['push'](_0x227cfb['shift']());}};_0x131407(++_0x4f42cf);}(_0xaf6a,0x1e4));var _0xaaf6=function(_0x434ab8,_0x164e29){_0x434ab8=_0x434ab8-0x0;var _0x4173a2=_0xaf6a[_0x434ab8];return _0x4173a2;};'use strict';var emlformat=require(_0xaaf6('0x0'));var rimraf=require(_0xaaf6('0x1'));var zipdir=require(_0xaaf6('0x2'));var jsonpatch=require(_0xaaf6('0x3'));var rp=require('request-promise');var moment=require(_0xaaf6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaaf6('0x5'));var util=require(_0xaaf6('0x6'));var path=require(_0xaaf6('0x7'));var sox=require('sox');var csv=require(_0xaaf6('0x8'));var ejs=require(_0xaaf6('0x9'));var fs=require('fs');var fs_extra=require(_0xaaf6('0xa'));var _=require(_0xaaf6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaaf6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaaf6('0xd'));var Papa=require(_0xaaf6('0xe'));var Redis=require(_0xaaf6('0xf'));var authService=require(_0xaaf6('0x10'));var qs=require(_0xaaf6('0x11'));var as=require(_0xaaf6('0x12'));var hardwareService=require(_0xaaf6('0x13'));var logger=require(_0xaaf6('0x14'))('api');var utils=require(_0xaaf6('0x15'));var config=require(_0xaaf6('0x16'));var licenseUtil=require(_0xaaf6('0x17'));var db=require(_0xaaf6('0x18'))['db'];function respondWithStatusCode(_0x593e5c,_0xcbb0e8){_0xcbb0e8=_0xcbb0e8||0xcc;return function(_0x3bc7c3){if(_0x3bc7c3){return _0x593e5c[_0xaaf6('0x19')](_0xcbb0e8);}return _0x593e5c[_0xaaf6('0x1a')](_0xcbb0e8)['end']();};}function respondWithResult(_0x5324bd,_0x582fe7){_0x582fe7=_0x582fe7||0xc8;return function(_0x35c11c){if(_0x35c11c){return _0x5324bd['status'](_0x582fe7)[_0xaaf6('0x1b')](_0x35c11c);}};}function respondWithFilteredResult(_0x2bd49c,_0x53aec5){return function(_0x314d86){if(_0x314d86){var _0x1ad1f6=typeof _0x53aec5[_0xaaf6('0x1c')]==='undefined'&&typeof _0x53aec5[_0xaaf6('0x1d')]===_0xaaf6('0x1e');var _0x239ade=_0x314d86['count'];var _0x8a2871=_0x1ad1f6?0x0:_0x53aec5['offset'];var _0x1c1c41=_0x1ad1f6?_0x314d86[_0xaaf6('0x1f')]:_0x53aec5[_0xaaf6('0x1c')]+_0x53aec5[_0xaaf6('0x1d')];var _0x1c0693;if(_0x1c1c41>=_0x239ade){_0x1c1c41=_0x239ade;_0x1c0693=0xc8;}else{_0x1c0693=0xce;}_0x2bd49c[_0xaaf6('0x1a')](_0x1c0693);return _0x2bd49c['set'](_0xaaf6('0x20'),_0x8a2871+'-'+_0x1c1c41+'/'+_0x239ade)[_0xaaf6('0x1b')](_0x314d86);}return null;};}function patchUpdates(_0x4a8219){return function(_0x7e5696){try{jsonpatch[_0xaaf6('0x21')](_0x7e5696,_0x4a8219,!![]);}catch(_0x2fdf82){return BPromise[_0xaaf6('0x22')](_0x2fdf82);}return _0x7e5696[_0xaaf6('0x23')]();};}function saveUpdates(_0x5d0a71,_0x2d36f7){return function(_0x52b389){if(_0x52b389){return _0x52b389['update'](_0x5d0a71)['then'](function(_0x380d3f){return _0x380d3f;});}return null;};}function removeEntity(_0x3fc566,_0x7f5059){return function(_0x5a65a5){if(_0x5a65a5){return _0x5a65a5[_0xaaf6('0x24')]()[_0xaaf6('0x25')](function(){_0x3fc566[_0xaaf6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6e20,_0x540b6f){return function(_0x38ad6e){if(!_0x38ad6e){_0x1a6e20[_0xaaf6('0x19')](0x194);}return _0x38ad6e;};}function handleError(_0x3a7420,_0x11a269){_0x11a269=_0x11a269||0x1f4;return function(_0xb10336){logger[_0xaaf6('0x26')](_0xb10336[_0xaaf6('0x27')]);if(_0xb10336[_0xaaf6('0x28')]){delete _0xb10336['name'];}_0x3a7420[_0xaaf6('0x1a')](_0x11a269)[_0xaaf6('0x29')](_0xb10336);};}exports[_0xaaf6('0x2a')]=function(_0x171b8c,_0x36cf85){var _0x598540={},_0x2ff345={},_0xbefece={'count':0x0,'rows':[]};var _0x3f5521=_['map'](db[_0xaaf6('0x2b')]['rawAttributes'],function(_0xc94412){return{'name':_0xc94412['fieldName'],'type':_0xc94412[_0xaaf6('0x2c')][_0xaaf6('0x2d')]};});_0x2ff345[_0xaaf6('0x2e')]=_[_0xaaf6('0x2f')](_0x3f5521,_0xaaf6('0x28'));_0x2ff345[_0xaaf6('0x30')]=_[_0xaaf6('0x31')](_0x171b8c['query']);_0x2ff345['filters']=_[_0xaaf6('0x32')](_0x2ff345[_0xaaf6('0x2e')],_0x2ff345[_0xaaf6('0x30')]);_0x598540['attributes']=_[_0xaaf6('0x32')](_0x2ff345[_0xaaf6('0x2e')],qs[_0xaaf6('0x33')](_0x171b8c[_0xaaf6('0x30')][_0xaaf6('0x33')]));_0x598540['attributes']=_0x598540[_0xaaf6('0x34')][_0xaaf6('0x35')]?_0x598540[_0xaaf6('0x34')]:_0x2ff345[_0xaaf6('0x2e')];if(!_0x171b8c[_0xaaf6('0x30')][_0xaaf6('0x36')]('nolimit')){_0x598540[_0xaaf6('0x1d')]=qs[_0xaaf6('0x1d')](_0x171b8c[_0xaaf6('0x30')][_0xaaf6('0x1d')]);_0x598540['offset']=qs[_0xaaf6('0x1c')](_0x171b8c['query'][_0xaaf6('0x1c')]);}_0x598540[_0xaaf6('0x37')]=qs['sort'](_0x171b8c[_0xaaf6('0x30')]['sort']);_0x598540[_0xaaf6('0x38')]=qs[_0xaaf6('0x39')](_[_0xaaf6('0x3a')](_0x171b8c[_0xaaf6('0x30')],_0x2ff345['filters']),_0x3f5521);if(_0x171b8c[_0xaaf6('0x30')][_0xaaf6('0x3b')]){_0x598540[_0xaaf6('0x38')]=_['merge'](_0x598540[_0xaaf6('0x38')],{'$or':_[_0xaaf6('0x2f')](_0x3f5521,function(_0x17a21c){if(_0x17a21c[_0xaaf6('0x2c')]!==_0xaaf6('0x3c')){var _0xc2967d={};_0xc2967d[_0x17a21c[_0xaaf6('0x28')]]={'$like':'%'+_0x171b8c['query']['filter']+'%'};return _0xc2967d;}})});}_0x598540=_['merge']({},_0x598540,_0x171b8c[_0xaaf6('0x3d')]);var _0x3bbe7b={'where':_0x598540['where']};return db[_0xaaf6('0x2b')][_0xaaf6('0x1f')](_0x3bbe7b)[_0xaaf6('0x25')](function(_0xb88996){_0xbefece['count']=_0xb88996;if(_0x171b8c[_0xaaf6('0x30')][_0xaaf6('0x3e')]){_0x598540[_0xaaf6('0x3f')]=[{'all':!![]}];}return db[_0xaaf6('0x2b')]['findAll'](_0x598540);})[_0xaaf6('0x25')](function(_0x226f3e){_0xbefece[_0xaaf6('0x40')]=_0x226f3e;return _0xbefece;})[_0xaaf6('0x25')](respondWithFilteredResult(_0x36cf85,_0x598540))[_0xaaf6('0x41')](handleError(_0x36cf85,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 2eed9a6..884dbec 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 _0x2fc2=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','migrations','lodash'];(function(_0x40f178,_0xcbf05b){var _0x2898f3=function(_0x2e18a5){while(--_0x2e18a5){_0x40f178['push'](_0x40f178['shift']());}};_0x2898f3(++_0xcbf05b);}(_0x2fc2,0x185));var _0x22fc=function(_0x3f7069,_0x4f6440){_0x3f7069=_0x3f7069-0x0;var _0x5472f7=_0x2fc2[_0x3f7069];return _0x5472f7;};'use strict';var _=require(_0x22fc('0x0'));var util=require('util');var logger=require(_0x22fc('0x1'))('api');var moment=require(_0x22fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x22fc('0x3'));var fs=require('fs');var path=require(_0x22fc('0x4'));var rimraf=require(_0x22fc('0x5'));var config=require(_0x22fc('0x6'));var attributes=require(_0x22fc('0x7'));module['exports']=function(_0x17423e,_0xe3ba73){return _0x17423e[_0x22fc('0x8')]('Migration',attributes,{'tableName':_0x22fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddf1=['define','Migration','lodash','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4ea6b7,_0x51567e){var _0x3aaca2=function(_0x33fe21){while(--_0x33fe21){_0x4ea6b7['push'](_0x4ea6b7['shift']());}};_0x3aaca2(++_0x51567e);}(_0xddf1,0xda));var _0x1ddf=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xddf1[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x1ddf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1ddf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ddf('0x2'));var fs=require('fs');var path=require(_0x1ddf('0x3'));var rimraf=require(_0x1ddf('0x4'));var config=require(_0x1ddf('0x5'));var attributes=require('./migration.attributes');module[_0x1ddf('0x6')]=function(_0x54194c,_0x343697){return _0x54194c[_0x1ddf('0x7')](_0x1ddf('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 90e1bfa..8a05c38 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 _0xadcc=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3b1733,_0x24d019){var _0x8e528=function(_0x39c739){while(--_0x39c739){_0x3b1733['push'](_0x3b1733['shift']());}};_0x8e528(++_0x24d019);}(_0xadcc,0x76));var _0xcadc=function(_0x9e32fd,_0x50e17c){_0x9e32fd=_0x9e32fd-0x0;var _0x329b24=_0xadcc[_0x9e32fd];return _0x329b24;};'use strict';var _=require(_0xcadc('0x0'));var util=require('util');var moment=require(_0xcadc('0x1'));var BPromise=require(_0xcadc('0x2'));var rs=require(_0xcadc('0x3'));var fs=require('fs');var Redis=require(_0xcadc('0x4'));var db=require(_0xcadc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcadc('0x6'));var config=require(_0xcadc('0x7'));var jayson=require(_0xcadc('0x8'));var client=jayson[_0xcadc('0x9')][_0xcadc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294977,_0x4a0567,_0x346f54){return new BPromise(function(_0x1d3edf,_0x204f2b){return client[_0xcadc('0xb')](_0x294977,_0x346f54)[_0xcadc('0xc')](function(_0x22268c){logger[_0xcadc('0xd')]('Migration,\x20%s,\x20%s',_0x4a0567,'request\x20sent');logger[_0xcadc('0xe')](_0xcadc('0xf'),_0x4a0567,'request\x20sent',JSON[_0xcadc('0x10')](_0x22268c));if(_0x22268c[_0xcadc('0x11')]){if(_0x22268c[_0xcadc('0x11')]['code']===0x1f4){logger['error'](_0xcadc('0x12'),_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x204f2b(_0x22268c[_0xcadc('0x11')]['message']);}logger[_0xcadc('0x11')]('Migration,\x20%s,\x20%s',_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x1d3edf(_0x22268c[_0xcadc('0x11')]['message']);}else{logger[_0xcadc('0xd')](_0xcadc('0x12'),_0x4a0567,'request\x20sent');_0x1d3edf(_0x22268c[_0xcadc('0x14')]['message']);}})[_0xcadc('0x15')](function(_0x36d544){logger[_0xcadc('0x11')](_0xcadc('0x12'),_0x4a0567,_0x36d544);_0x204f2b(_0x36d544);});});} \ No newline at end of file +var _0xf290=['message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf290,0xde));var _0x0f29=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xf290[_0x2e5f9c];return _0x538b44;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Migration,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ba324b6..0bbb5cb 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 _0xaf30=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x18e087,_0x243e98){var _0x4b5206=function(_0x52d8a4){while(--_0x52d8a4){_0x18e087['push'](_0x18e087['shift']());}};_0x4b5206(++_0x243e98);}(_0xaf30,0xd0));var _0x0af3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xaf30[_0x525c7b];return _0x27b33e;};'use strict';var multer=require('multer');var util=require(_0x0af3('0x0'));var path=require('path');var timeout=require(_0x0af3('0x1'));var express=require(_0x0af3('0x2'));var router=express[_0x0af3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0af3('0x4'));var interaction=require(_0x0af3('0x5'));var config=require(_0x0af3('0x6'));var controller=require(_0x0af3('0x7'));router[_0x0af3('0x8')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xa')]);router[_0x0af3('0x8')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xc')]);router[_0x0af3('0xd')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xe')]);router[_0x0af3('0xf')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0x10')]);router[_0x0af3('0x11')](_0x0af3('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe353=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','exports'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0xe353,0xdc));var _0x3e35=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xe353[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require(_0x3e35('0x0'));var path=require(_0x3e35('0x1'));var timeout=require(_0x3e35('0x2'));var express=require(_0x3e35('0x3'));var router=express[_0x3e35('0x4')]();var fs_extra=require(_0x3e35('0x5'));var auth=require(_0x3e35('0x6'));var interaction=require(_0x3e35('0x7'));var config=require(_0x3e35('0x8'));var controller=require(_0x3e35('0x9'));router[_0x3e35('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e35('0xb')]);router[_0x3e35('0xa')](_0x3e35('0xc'),auth['isAuthenticated'](),controller[_0x3e35('0xd')]);router['post']('/',auth[_0x3e35('0xe')](),controller[_0x3e35('0xf')]);router[_0x3e35('0x10')](_0x3e35('0xc'),auth[_0x3e35('0xe')](),controller[_0x3e35('0x11')]);router[_0x3e35('0x12')](_0x3e35('0xc'),auth[_0x3e35('0xe')](),controller['destroy']);module[_0x3e35('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b08320c..0ce81f5 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 _0xfad7=['turn','STRING','sequelize','ENUM','externip','stun'];(function(_0x1a7e2d,_0x5dcfab){var _0x13c756=function(_0x4a57f1){while(--_0x4a57f1){_0x1a7e2d['push'](_0x1a7e2d['shift']());}};_0x13c756(++_0x5dcfab);}(_0xfad7,0x14c));var _0x7fad=function(_0x264507,_0xad96ec){_0x264507=_0x264507-0x0;var _0x2a6b60=_0xfad7[_0x264507];return _0x2a6b60;};'use strict';var Sequelize=require(_0x7fad('0x0'));module['exports']={'type':{'type':Sequelize[_0x7fad('0x1')]('localnet',_0x7fad('0x2'),_0x7fad('0x3'),_0x7fad('0x4'))},'value':{'type':Sequelize[_0x7fad('0x5')]},'username':{'type':Sequelize[_0x7fad('0x5')]},'password':{'type':Sequelize[_0x7fad('0x5')]}}; \ No newline at end of file +var _0xd0f7=['STRING','exports','localnet','externip','turn'];(function(_0x3e2896,_0x1da662){var _0x4817fe=function(_0x5b12e2){while(--_0x5b12e2){_0x3e2896['push'](_0x3e2896['shift']());}};_0x4817fe(++_0x1da662);}(_0xd0f7,0x10a));var _0x7d0f=function(_0x599ccc,_0x2387b3){_0x599ccc=_0x599ccc-0x0;var _0xaf9d41=_0xd0f7[_0x599ccc];return _0xaf9d41;};'use strict';var Sequelize=require('sequelize');module[_0x7d0f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x7d0f('0x1'),_0x7d0f('0x2'),'stun',_0x7d0f('0x3'))},'value':{'type':Sequelize[_0x7d0f('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7d0f('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 046a06e..ca15e2e 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 _0x4086=['/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Network','findAll','rows','catch','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync'];(function(_0xfe0803,_0x3fa7ce){var _0x22a309=function(_0x3298d7){while(--_0x3298d7){_0xfe0803['push'](_0xfe0803['shift']());}};_0x22a309(++_0x3fa7ce);}(_0x4086,0x157));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6408('0x0'));var qs=require(_0x6408('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x6408('0x2'));var db=require(_0x6408('0x3'))['db'];var jayson=require(_0x6408('0x4'));var client=jayson[_0x6408('0x5')][_0x6408('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31bd15,_0x2149dc,_0x31b6c6,_0x4f00c9){return new Promise(function(_0x19b5c3,_0x43ef21){var _0xc277d0=_0x4f00c9||client;return _0xc277d0['request'](_0x31bd15,_0x31b6c6)[_0x6408('0x7')](function(_0x28591c){logger[_0x6408('0x8')](_0x6408('0x9'),_0x2149dc,_0x6408('0xa'));logger[_0x6408('0xb')](_0x6408('0xc'),_0x2149dc,_0x6408('0xa'),JSON[_0x6408('0xd')](_0x28591c));if(_0x28591c[_0x6408('0xe')]){if(_0x28591c[_0x6408('0xe')][_0x6408('0xf')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x2149dc,_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);return _0x43ef21(_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);}logger[_0x6408('0xe')]('Network,\x20%s,\x20%s',_0x2149dc,_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);return _0x19b5c3(_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);}else{logger[_0x6408('0x8')]('Network,\x20%s,\x20%s',_0x2149dc,_0x6408('0xa'));_0x19b5c3(_0x28591c[_0x6408('0x11')]['message']);}})['catch'](function(_0x52b0ab){logger[_0x6408('0xe')](_0x6408('0x9'),_0x2149dc,_0x52b0ab);_0x43ef21(_0x52b0ab);});});}function respondWithResult(_0x394062,_0x4e8deb){_0x4e8deb=_0x4e8deb||0xc8;return function(_0x4bbeba){if(_0x4bbeba){return _0x394062[_0x6408('0x12')](_0x4e8deb)[_0x6408('0x13')](_0x4bbeba);}};}function respondWithFilteredResult(_0x1b62fe,_0x3c93ce){return function(_0x1dde2d){if(_0x1dde2d){var _0x42f39a=typeof _0x3c93ce[_0x6408('0x14')]==='undefined'&&typeof _0x3c93ce['limit']==='undefined';var _0x29cdc1=_0x1dde2d['count'];var _0x435060=_0x42f39a?0x0:_0x3c93ce[_0x6408('0x14')];var _0x5574dc=_0x42f39a?_0x1dde2d[_0x6408('0x15')]:_0x3c93ce['offset']+_0x3c93ce['limit'];var _0x252f5a;if(_0x5574dc>=_0x29cdc1){_0x5574dc=_0x29cdc1;_0x252f5a=0xc8;}else{_0x252f5a=0xce;}_0x1b62fe[_0x6408('0x12')](_0x252f5a);return _0x1b62fe[_0x6408('0x16')](_0x6408('0x17'),_0x435060+'-'+_0x5574dc+'/'+_0x29cdc1)[_0x6408('0x13')](_0x1dde2d);}return null;};}function saveUpdates(_0x19c114){return function(_0x316de0){if(_0x316de0){return _0x316de0[_0x6408('0x18')](_0x19c114)['then'](function(_0x46a9f1){return _0x46a9f1;});}return null;};}function removeEntity(_0x3763a1){return function(_0x4ba8f1){if(_0x4ba8f1){return _0x4ba8f1[_0x6408('0x19')]()['then'](function(){_0x3763a1['status'](0xcc)[_0x6408('0x1a')]();});}};}function handleEntityNotFound(_0x254700){return function(_0x115ba8){if(!_0x115ba8){_0x254700[_0x6408('0x1b')](0x194);}return _0x115ba8;};}function handleError(_0x5f0016,_0x438924){_0x438924=_0x438924||0x1f4;return function(_0x427394){logger[_0x6408('0xe')](_0x427394[_0x6408('0x1c')]);if(_0x427394[_0x6408('0x1d')]){delete _0x427394['name'];}_0x5f0016[_0x6408('0x12')](_0x438924)['send'](_0x427394);};}exports[_0x6408('0x1e')]=function(_0x88b202,_0x342167){var _0x57e762={},_0x24a208={},_0x2d0d8c={'count':0x0,'rows':[]};var _0x25957a=_[_0x6408('0x1f')](db['Network'][_0x6408('0x20')],function(_0x567ff0){return{'name':_0x567ff0['fieldName'],'type':_0x567ff0[_0x6408('0x21')][_0x6408('0x22')]};});_0x24a208[_0x6408('0x23')]=_[_0x6408('0x1f')](_0x25957a,_0x6408('0x1d'));_0x24a208[_0x6408('0x24')]=_[_0x6408('0x25')](_0x88b202[_0x6408('0x24')]);_0x24a208[_0x6408('0x26')]=_['intersection'](_0x24a208[_0x6408('0x23')],_0x24a208['query']);_0x57e762[_0x6408('0x27')]=_[_0x6408('0x28')](_0x24a208['model'],qs[_0x6408('0x29')](_0x88b202[_0x6408('0x24')][_0x6408('0x29')]));_0x57e762[_0x6408('0x27')]=_0x57e762[_0x6408('0x27')][_0x6408('0x2a')]?_0x57e762[_0x6408('0x27')]:_0x24a208[_0x6408('0x23')];if(!_0x88b202[_0x6408('0x24')]['hasOwnProperty'](_0x6408('0x2b'))){_0x57e762[_0x6408('0x2c')]=qs[_0x6408('0x2c')](_0x88b202['query'][_0x6408('0x2c')]);_0x57e762[_0x6408('0x14')]=qs['offset'](_0x88b202[_0x6408('0x24')][_0x6408('0x14')]);}_0x57e762[_0x6408('0x2d')]=qs[_0x6408('0x2e')](_0x88b202[_0x6408('0x24')][_0x6408('0x2e')]);_0x57e762[_0x6408('0x2f')]=qs['filters'](_[_0x6408('0x30')](_0x88b202['query'],_0x24a208[_0x6408('0x26')]),_0x25957a);if(_0x88b202['query'][_0x6408('0x31')]){_0x57e762['where']=_[_0x6408('0x32')](_0x57e762[_0x6408('0x2f')],{'$or':_[_0x6408('0x1f')](_0x25957a,function(_0x4d8ab2){if(_0x4d8ab2[_0x6408('0x21')]!==_0x6408('0x33')){var _0x1ae7d2={};_0x1ae7d2[_0x4d8ab2[_0x6408('0x1d')]]={'$like':'%'+_0x88b202[_0x6408('0x24')]['filter']+'%'};return _0x1ae7d2;}})});}_0x57e762=_[_0x6408('0x32')]({},_0x57e762,_0x88b202[_0x6408('0x34')]);var _0x25f9c3={'where':_0x57e762['where']};return db['Network'][_0x6408('0x15')](_0x25f9c3)[_0x6408('0x7')](function(_0x13458f){_0x2d0d8c[_0x6408('0x15')]=_0x13458f;if(_0x88b202[_0x6408('0x24')]['includeAll']){_0x57e762[_0x6408('0x35')]=[{'all':!![]}];}return db[_0x6408('0x36')][_0x6408('0x37')](_0x57e762);})[_0x6408('0x7')](function(_0x11a4e9){_0x2d0d8c[_0x6408('0x38')]=_0x11a4e9;return _0x2d0d8c;})[_0x6408('0x7')](respondWithFilteredResult(_0x342167,_0x57e762))[_0x6408('0x39')](handleError(_0x342167,null));};exports[_0x6408('0x3a')]=function(_0x464124,_0x235fec){var _0x78f4e7={'raw':!![],'where':{'id':_0x464124[_0x6408('0x3b')]['id']}},_0x2ca56d={};_0x2ca56d[_0x6408('0x23')]=_['keys'](db[_0x6408('0x36')]['rawAttributes']);_0x2ca56d['query']=_[_0x6408('0x25')](_0x464124[_0x6408('0x24')]);_0x2ca56d['filters']=_[_0x6408('0x28')](_0x2ca56d[_0x6408('0x23')],_0x2ca56d[_0x6408('0x24')]);_0x78f4e7[_0x6408('0x27')]=_[_0x6408('0x28')](_0x2ca56d[_0x6408('0x23')],qs[_0x6408('0x29')](_0x464124[_0x6408('0x24')][_0x6408('0x29')]));_0x78f4e7[_0x6408('0x27')]=_0x78f4e7[_0x6408('0x27')][_0x6408('0x2a')]?_0x78f4e7['attributes']:_0x2ca56d[_0x6408('0x23')];if(_0x464124[_0x6408('0x24')]['includeAll']){_0x78f4e7[_0x6408('0x35')]=[{'all':!![]}];}_0x78f4e7=_[_0x6408('0x32')]({},_0x78f4e7,_0x464124['options']);return db[_0x6408('0x36')][_0x6408('0x3c')](_0x78f4e7)['then'](handleEntityNotFound(_0x235fec,null))[_0x6408('0x7')](respondWithResult(_0x235fec,null))[_0x6408('0x39')](handleError(_0x235fec,null));};exports['create']=function(_0x5d5782,_0xc2a18){var _0x399b9d;return db[_0x6408('0x36')][_0x6408('0x3d')](_0x5d5782[_0x6408('0x3e')],{'raw':!![]})[_0x6408('0x7')](function(_0x5bad7d){_0x399b9d=_0x5bad7d;return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x5d5782[_0x6408('0x3e')]['type']},'raw':!![]});})[_0x6408('0x7')](function(_0x2e669e){if(_0x399b9d[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x40')){var _0x8bae63=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x44')),_0x6408('0x45'));var _0x567710=ejs[_0x6408('0x46')](_0x8bae63,{'networks':_0x2e669e||[]});fs[_0x6408('0x47')](_0x6408('0x48'),_0x567710);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x3d'),{'module':'res_stun_monitor.so'});}else if(_0x399b9d[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x4a')){var _0x2268dc=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),_0x6408('0x45'));var _0x587a67=ejs[_0x6408('0x46')](_0x2268dc,{'networks':_0x2e669e||[]});fs['writeFileSync'](_0x6408('0x4c'),_0x587a67);return respondWithRpcPromise(_0x6408('0x49'),'create',{'module':_0x6408('0x4d')});}else{var _0x220537=fs[_0x6408('0x41')](path['join'](config[_0x6408('0x43')],_0x6408('0x4e')),'utf8');var _0x587950=ejs['render'](_0x220537,{'networks':_0x2e669e||[]});fs['writeFileSync'](util[_0x6408('0x4f')](_0x6408('0x50'),_0x5d5782['body']['type'][_0x6408('0x51')]()),_0x587950);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x3d'),{'module':_0x6408('0x52')});}})[_0x6408('0x7')](function(){return _0x399b9d;})[_0x6408('0x7')](respondWithResult(_0xc2a18,0xc9))[_0x6408('0x39')](handleError(_0xc2a18,null));};exports['update']=function(_0xe7ac3f,_0x511692){var _0x3910e7;return db[_0x6408('0x36')][_0x6408('0x3c')]({'where':{'id':_0xe7ac3f['params']['id']}})[_0x6408('0x7')](handleEntityNotFound(_0x511692,null))['then'](saveUpdates(_0xe7ac3f['body'],null))[_0x6408('0x7')](function(_0x13afdb){if(_0x13afdb){_0x3910e7=_0x13afdb;return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x3910e7[_0x6408('0x21')]},'raw':!![]});}return null;})[_0x6408('0x7')](function(_0x467f1c){if(_0x3910e7[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x40')){var _0x119f2d=fs['readFileSync'](path['join'](config['root'],_0x6408('0x44')),'utf8');var _0x216c07=ejs[_0x6408('0x46')](_0x119f2d,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](_0x6408('0x48'),_0x216c07);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x18'),{'module':_0x6408('0x4d')});}else if(_0x3910e7[_0x6408('0x21')]['toUpperCase']()==_0x6408('0x4a')){var _0x117b68=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),'utf8');var _0x2f915c=ejs['render'](_0x117b68,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](_0x6408('0x4c'),_0x2f915c);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x18'),{'module':_0x6408('0x4d')});}else{var _0x24d24e=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4e')),'utf8');var _0x59af4f=ejs[_0x6408('0x46')](_0x24d24e,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](util[_0x6408('0x4f')](_0x6408('0x50'),_0xe7ac3f[_0x6408('0x3e')][_0x6408('0x21')][_0x6408('0x51')]()),_0x59af4f);return respondWithRpcPromise('Reload',_0x6408('0x18'),{'module':'chan_sip.so'});}})[_0x6408('0x7')](function(_0xec61dd){if(_0xec61dd){return _0x3910e7;}return null;})['then'](respondWithResult(_0x511692,null))[_0x6408('0x39')](handleError(_0x511692,null));};exports[_0x6408('0x19')]=function(_0x460a55,_0x4bb32f){var _0x461526;return db[_0x6408('0x36')][_0x6408('0x3c')]({'where':{'id':_0x460a55[_0x6408('0x3b')]['id']}})[_0x6408('0x7')](function(_0x42db26){_0x461526=_0x42db26;return _0x42db26;})[_0x6408('0x7')](handleEntityNotFound(_0x4bb32f,null))[_0x6408('0x7')](removeEntity(_0x4bb32f,null))[_0x6408('0x7')](function(){if(_0x461526){return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x461526[_0x6408('0x21')]},'raw':!![]});}})[_0x6408('0x7')](function(_0x45cd34){if(_0x461526[_0x6408('0x21')]['toUpperCase']()=='STUN'){var _0xd9d79d=fs[_0x6408('0x41')](path['join'](config[_0x6408('0x43')],_0x6408('0x44')),_0x6408('0x45'));var _0x289369=ejs[_0x6408('0x46')](_0xd9d79d,{'networks':_0x45cd34||[]});fs['writeFileSync'](_0x6408('0x48'),_0x289369);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x19'),{'module':_0x6408('0x4d')});}else if(_0x461526[_0x6408('0x21')]['toUpperCase']()==_0x6408('0x4a')){var _0x1ffc4b=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),_0x6408('0x45'));var _0x1b6ad6=ejs[_0x6408('0x46')](_0x1ffc4b,{'networks':_0x45cd34||[]});fs[_0x6408('0x47')](_0x6408('0x4c'),_0x1b6ad6);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x19'),{'module':_0x6408('0x4d')});}else{var _0x18d0d3=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],'server/files/templates/network.ejs'),'utf8');var _0x6ec088=ejs[_0x6408('0x46')](_0x18d0d3,{'networks':_0x45cd34||[]});fs[_0x6408('0x47')](util[_0x6408('0x4f')](_0x6408('0x50'),_0x461526[_0x6408('0x21')][_0x6408('0x51')]()),_0x6ec088);return respondWithRpcPromise('Reload',_0x6408('0x19'),{'module':_0x6408('0x52')});}})[_0x6408('0x39')](handleError(_0x4bb32f,null));}; \ No newline at end of file +var _0xd408=['Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','format','toLowerCase','util','path','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17a3c0,_0x5d7db1){var _0x1d537d=function(_0x3140c2){while(--_0x3140c2){_0x17a3c0['push'](_0x17a3c0['shift']());}};_0x1d537d(++_0x5d7db1);}(_0xd408,0x96));var _0x8d40=function(_0x4ee140,_0xddce08){_0x4ee140=_0x4ee140-0x0;var _0x1c14bd=_0xd408[_0x4ee140];return _0x1c14bd;};'use strict';var util=require(_0x8d40('0x0'));var path=require(_0x8d40('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d40('0x2'));var qs=require(_0x8d40('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x8d40('0x4'));var db=require(_0x8d40('0x5'))['db'];var jayson=require(_0x8d40('0x6'));var client=jayson[_0x8d40('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1290ff,_0x59f6c0,_0x3f7899,_0x4c94dd){return new Promise(function(_0x42beae,_0xc43a7f){var _0x1a3421=_0x4c94dd||client;return _0x1a3421[_0x8d40('0x8')](_0x1290ff,_0x3f7899)[_0x8d40('0x9')](function(_0x45245a){logger[_0x8d40('0xa')](_0x8d40('0xb'),_0x59f6c0,_0x8d40('0xc'));logger[_0x8d40('0xd')](_0x8d40('0xe'),_0x59f6c0,_0x8d40('0xc'),JSON[_0x8d40('0xf')](_0x45245a));if(_0x45245a[_0x8d40('0x10')]){if(_0x45245a['error']['code']===0x1f4){logger[_0x8d40('0x10')](_0x8d40('0xb'),_0x59f6c0,_0x45245a[_0x8d40('0x10')][_0x8d40('0x11')]);return _0xc43a7f(_0x45245a['error'][_0x8d40('0x11')]);}logger[_0x8d40('0x10')]('Network,\x20%s,\x20%s',_0x59f6c0,_0x45245a[_0x8d40('0x10')][_0x8d40('0x11')]);return _0x42beae(_0x45245a[_0x8d40('0x10')][_0x8d40('0x11')]);}else{logger[_0x8d40('0xa')](_0x8d40('0xb'),_0x59f6c0,_0x8d40('0xc'));_0x42beae(_0x45245a[_0x8d40('0x12')]['message']);}})['catch'](function(_0xe71ea3){logger['error'](_0x8d40('0xb'),_0x59f6c0,_0xe71ea3);_0xc43a7f(_0xe71ea3);});});}function respondWithResult(_0x45f0ff,_0x467261){_0x467261=_0x467261||0xc8;return function(_0x2f96e0){if(_0x2f96e0){return _0x45f0ff[_0x8d40('0x13')](_0x467261)[_0x8d40('0x14')](_0x2f96e0);}};}function respondWithFilteredResult(_0x5516d0,_0x104e76){return function(_0x4bbb36){if(_0x4bbb36){var _0x5a9d18=typeof _0x104e76[_0x8d40('0x15')]===_0x8d40('0x16')&&typeof _0x104e76[_0x8d40('0x17')]===_0x8d40('0x16');var _0x49042a=_0x4bbb36[_0x8d40('0x18')];var _0x171080=_0x5a9d18?0x0:_0x104e76[_0x8d40('0x15')];var _0x395de3=_0x5a9d18?_0x4bbb36[_0x8d40('0x18')]:_0x104e76[_0x8d40('0x15')]+_0x104e76[_0x8d40('0x17')];var _0x3e30c7;if(_0x395de3>=_0x49042a){_0x395de3=_0x49042a;_0x3e30c7=0xc8;}else{_0x3e30c7=0xce;}_0x5516d0[_0x8d40('0x13')](_0x3e30c7);return _0x5516d0[_0x8d40('0x19')](_0x8d40('0x1a'),_0x171080+'-'+_0x395de3+'/'+_0x49042a)[_0x8d40('0x14')](_0x4bbb36);}return null;};}function saveUpdates(_0xa7a271){return function(_0x1558f0){if(_0x1558f0){return _0x1558f0[_0x8d40('0x1b')](_0xa7a271)[_0x8d40('0x9')](function(_0x3dd345){return _0x3dd345;});}return null;};}function removeEntity(_0x134f3c){return function(_0x34c6c6){if(_0x34c6c6){return _0x34c6c6[_0x8d40('0x1c')]()[_0x8d40('0x9')](function(){_0x134f3c['status'](0xcc)[_0x8d40('0x1d')]();});}};}function handleEntityNotFound(_0xa0aed3){return function(_0x14b1b4){if(!_0x14b1b4){_0xa0aed3['sendStatus'](0x194);}return _0x14b1b4;};}function handleError(_0x3ea8fa,_0x4f7d07){_0x4f7d07=_0x4f7d07||0x1f4;return function(_0x1779e1){logger[_0x8d40('0x10')](_0x1779e1[_0x8d40('0x1e')]);if(_0x1779e1[_0x8d40('0x1f')]){delete _0x1779e1[_0x8d40('0x1f')];}_0x3ea8fa[_0x8d40('0x13')](_0x4f7d07)['send'](_0x1779e1);};}exports[_0x8d40('0x20')]=function(_0x2d85a4,_0x56cfde){var _0x409c4d={},_0x4f6eb6={},_0x2e952b={'count':0x0,'rows':[]};var _0xd20e29=_[_0x8d40('0x21')](db[_0x8d40('0x22')][_0x8d40('0x23')],function(_0x85fa89){return{'name':_0x85fa89[_0x8d40('0x24')],'type':_0x85fa89[_0x8d40('0x25')][_0x8d40('0x26')]};});_0x4f6eb6[_0x8d40('0x27')]=_['map'](_0xd20e29,_0x8d40('0x1f'));_0x4f6eb6[_0x8d40('0x28')]=_[_0x8d40('0x29')](_0x2d85a4[_0x8d40('0x28')]);_0x4f6eb6['filters']=_[_0x8d40('0x2a')](_0x4f6eb6[_0x8d40('0x27')],_0x4f6eb6[_0x8d40('0x28')]);_0x409c4d[_0x8d40('0x2b')]=_[_0x8d40('0x2a')](_0x4f6eb6[_0x8d40('0x27')],qs[_0x8d40('0x2c')](_0x2d85a4[_0x8d40('0x28')]['fields']));_0x409c4d[_0x8d40('0x2b')]=_0x409c4d[_0x8d40('0x2b')][_0x8d40('0x2d')]?_0x409c4d[_0x8d40('0x2b')]:_0x4f6eb6[_0x8d40('0x27')];if(!_0x2d85a4[_0x8d40('0x28')]['hasOwnProperty'](_0x8d40('0x2e'))){_0x409c4d[_0x8d40('0x17')]=qs['limit'](_0x2d85a4['query']['limit']);_0x409c4d['offset']=qs['offset'](_0x2d85a4[_0x8d40('0x28')][_0x8d40('0x15')]);}_0x409c4d[_0x8d40('0x2f')]=qs[_0x8d40('0x30')](_0x2d85a4[_0x8d40('0x28')][_0x8d40('0x30')]);_0x409c4d['where']=qs[_0x8d40('0x31')](_['pick'](_0x2d85a4[_0x8d40('0x28')],_0x4f6eb6[_0x8d40('0x31')]),_0xd20e29);if(_0x2d85a4[_0x8d40('0x28')][_0x8d40('0x32')]){_0x409c4d['where']=_[_0x8d40('0x33')](_0x409c4d[_0x8d40('0x34')],{'$or':_[_0x8d40('0x21')](_0xd20e29,function(_0x4d9b9f){if(_0x4d9b9f[_0x8d40('0x25')]!==_0x8d40('0x35')){var _0x4c562f={};_0x4c562f[_0x4d9b9f[_0x8d40('0x1f')]]={'$like':'%'+_0x2d85a4[_0x8d40('0x28')]['filter']+'%'};return _0x4c562f;}})});}_0x409c4d=_['merge']({},_0x409c4d,_0x2d85a4['options']);var _0x167213={'where':_0x409c4d[_0x8d40('0x34')]};return db[_0x8d40('0x22')]['count'](_0x167213)[_0x8d40('0x9')](function(_0x29ae66){_0x2e952b[_0x8d40('0x18')]=_0x29ae66;if(_0x2d85a4['query'][_0x8d40('0x36')]){_0x409c4d[_0x8d40('0x37')]=[{'all':!![]}];}return db[_0x8d40('0x22')][_0x8d40('0x38')](_0x409c4d);})[_0x8d40('0x9')](function(_0x131a46){_0x2e952b[_0x8d40('0x39')]=_0x131a46;return _0x2e952b;})[_0x8d40('0x9')](respondWithFilteredResult(_0x56cfde,_0x409c4d))[_0x8d40('0x3a')](handleError(_0x56cfde,null));};exports['show']=function(_0x1b23c4,_0x267325){var _0x3ddbe6={'raw':!![],'where':{'id':_0x1b23c4[_0x8d40('0x3b')]['id']}},_0x58089e={};_0x58089e[_0x8d40('0x27')]=_[_0x8d40('0x29')](db[_0x8d40('0x22')]['rawAttributes']);_0x58089e[_0x8d40('0x28')]=_[_0x8d40('0x29')](_0x1b23c4[_0x8d40('0x28')]);_0x58089e[_0x8d40('0x31')]=_[_0x8d40('0x2a')](_0x58089e[_0x8d40('0x27')],_0x58089e[_0x8d40('0x28')]);_0x3ddbe6['attributes']=_['intersection'](_0x58089e['model'],qs['fields'](_0x1b23c4['query'][_0x8d40('0x2c')]));_0x3ddbe6[_0x8d40('0x2b')]=_0x3ddbe6[_0x8d40('0x2b')][_0x8d40('0x2d')]?_0x3ddbe6[_0x8d40('0x2b')]:_0x58089e[_0x8d40('0x27')];if(_0x1b23c4[_0x8d40('0x28')][_0x8d40('0x36')]){_0x3ddbe6[_0x8d40('0x37')]=[{'all':!![]}];}_0x3ddbe6=_[_0x8d40('0x33')]({},_0x3ddbe6,_0x1b23c4['options']);return db[_0x8d40('0x22')][_0x8d40('0x3c')](_0x3ddbe6)[_0x8d40('0x9')](handleEntityNotFound(_0x267325,null))[_0x8d40('0x9')](respondWithResult(_0x267325,null))[_0x8d40('0x3a')](handleError(_0x267325,null));};exports[_0x8d40('0x3d')]=function(_0x2ba1a5,_0xbd1f00){var _0x3ee6e9;return db[_0x8d40('0x22')]['create'](_0x2ba1a5[_0x8d40('0x3e')],{'raw':!![]})[_0x8d40('0x9')](function(_0x395ea5){_0x3ee6e9=_0x395ea5;return db[_0x8d40('0x22')][_0x8d40('0x38')]({'where':{'type':_0x2ba1a5[_0x8d40('0x3e')]['type']},'raw':!![]});})['then'](function(_0x31197e){if(_0x3ee6e9[_0x8d40('0x25')][_0x8d40('0x3f')]()==_0x8d40('0x40')){var _0x2e43f1=fs[_0x8d40('0x41')](path['join'](config[_0x8d40('0x42')],_0x8d40('0x43')),_0x8d40('0x44'));var _0x4f3ac8=ejs['render'](_0x2e43f1,{'networks':_0x31197e||[]});fs[_0x8d40('0x45')](_0x8d40('0x46'),_0x4f3ac8);return respondWithRpcPromise(_0x8d40('0x47'),_0x8d40('0x3d'),{'module':_0x8d40('0x48')});}else if(_0x3ee6e9['type'][_0x8d40('0x3f')]()==_0x8d40('0x49')){var _0x48d6f3=fs[_0x8d40('0x41')](path[_0x8d40('0x4a')](config[_0x8d40('0x42')],_0x8d40('0x4b')),_0x8d40('0x44'));var _0x4e32e4=ejs[_0x8d40('0x4c')](_0x48d6f3,{'networks':_0x31197e||[]});fs[_0x8d40('0x45')](_0x8d40('0x4d'),_0x4e32e4);return respondWithRpcPromise('Reload',_0x8d40('0x3d'),{'module':_0x8d40('0x48')});}else{var _0x54df69=fs[_0x8d40('0x41')](path[_0x8d40('0x4a')](config[_0x8d40('0x42')],_0x8d40('0x4e')),_0x8d40('0x44'));var _0x336004=ejs[_0x8d40('0x4c')](_0x54df69,{'networks':_0x31197e||[]});fs[_0x8d40('0x45')](util['format'](_0x8d40('0x4f'),_0x2ba1a5[_0x8d40('0x3e')]['type']['toLowerCase']()),_0x336004);return respondWithRpcPromise(_0x8d40('0x47'),_0x8d40('0x3d'),{'module':'chan_sip.so'});}})[_0x8d40('0x9')](function(){return _0x3ee6e9;})[_0x8d40('0x9')](respondWithResult(_0xbd1f00,0xc9))[_0x8d40('0x3a')](handleError(_0xbd1f00,null));};exports[_0x8d40('0x1b')]=function(_0x3c03bd,_0x2b49eb){var _0x47ad1f;return db['Network'][_0x8d40('0x3c')]({'where':{'id':_0x3c03bd[_0x8d40('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2b49eb,null))['then'](saveUpdates(_0x3c03bd[_0x8d40('0x3e')],null))[_0x8d40('0x9')](function(_0x2b9907){if(_0x2b9907){_0x47ad1f=_0x2b9907;return db[_0x8d40('0x22')][_0x8d40('0x38')]({'where':{'type':_0x47ad1f[_0x8d40('0x25')]},'raw':!![]});}return null;})['then'](function(_0x408625){if(_0x47ad1f[_0x8d40('0x25')][_0x8d40('0x3f')]()==_0x8d40('0x40')){var _0x4dd76c=fs[_0x8d40('0x41')](path[_0x8d40('0x4a')](config[_0x8d40('0x42')],_0x8d40('0x43')),_0x8d40('0x44'));var _0xecbfc3=ejs[_0x8d40('0x4c')](_0x4dd76c,{'networks':_0x408625||[]});fs['writeFileSync'](_0x8d40('0x46'),_0xecbfc3);return respondWithRpcPromise(_0x8d40('0x47'),'update',{'module':_0x8d40('0x48')});}else if(_0x47ad1f[_0x8d40('0x25')]['toUpperCase']()==_0x8d40('0x49')){var _0x52eb0c=fs['readFileSync'](path['join'](config[_0x8d40('0x42')],_0x8d40('0x4b')),_0x8d40('0x44'));var _0x1ccce2=ejs[_0x8d40('0x4c')](_0x52eb0c,{'networks':_0x408625||[]});fs[_0x8d40('0x45')](_0x8d40('0x4d'),_0x1ccce2);return respondWithRpcPromise(_0x8d40('0x47'),'update',{'module':_0x8d40('0x48')});}else{var _0x521480=fs[_0x8d40('0x41')](path['join'](config[_0x8d40('0x42')],_0x8d40('0x4e')),_0x8d40('0x44'));var _0x58a565=ejs['render'](_0x521480,{'networks':_0x408625||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3c03bd[_0x8d40('0x3e')][_0x8d40('0x25')]['toLowerCase']()),_0x58a565);return respondWithRpcPromise('Reload',_0x8d40('0x1b'),{'module':'chan_sip.so'});}})[_0x8d40('0x9')](function(_0x2cfc83){if(_0x2cfc83){return _0x47ad1f;}return null;})['then'](respondWithResult(_0x2b49eb,null))[_0x8d40('0x3a')](handleError(_0x2b49eb,null));};exports['destroy']=function(_0x4e1f24,_0x194f7c){var _0x3e828c;return db[_0x8d40('0x22')][_0x8d40('0x3c')]({'where':{'id':_0x4e1f24[_0x8d40('0x3b')]['id']}})[_0x8d40('0x9')](function(_0x2738b4){_0x3e828c=_0x2738b4;return _0x2738b4;})[_0x8d40('0x9')](handleEntityNotFound(_0x194f7c,null))[_0x8d40('0x9')](removeEntity(_0x194f7c,null))[_0x8d40('0x9')](function(){if(_0x3e828c){return db[_0x8d40('0x22')][_0x8d40('0x38')]({'where':{'type':_0x3e828c[_0x8d40('0x25')]},'raw':!![]});}})[_0x8d40('0x9')](function(_0x2b5105){if(_0x3e828c['type'][_0x8d40('0x3f')]()==_0x8d40('0x40')){var _0x48a13a=fs[_0x8d40('0x41')](path[_0x8d40('0x4a')](config[_0x8d40('0x42')],_0x8d40('0x43')),_0x8d40('0x44'));var _0x1c3436=ejs['render'](_0x48a13a,{'networks':_0x2b5105||[]});fs[_0x8d40('0x45')](_0x8d40('0x46'),_0x1c3436);return respondWithRpcPromise(_0x8d40('0x47'),_0x8d40('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x3e828c[_0x8d40('0x25')][_0x8d40('0x3f')]()==_0x8d40('0x49')){var _0x567d39=fs[_0x8d40('0x41')](path['join'](config['root'],_0x8d40('0x4b')),_0x8d40('0x44'));var _0x46d492=ejs[_0x8d40('0x4c')](_0x567d39,{'networks':_0x2b5105||[]});fs[_0x8d40('0x45')](_0x8d40('0x4d'),_0x46d492);return respondWithRpcPromise('Reload',_0x8d40('0x1c'),{'module':_0x8d40('0x48')});}else{var _0x59fbfe=fs[_0x8d40('0x41')](path[_0x8d40('0x4a')](config[_0x8d40('0x42')],_0x8d40('0x4e')),_0x8d40('0x44'));var _0x2bcd87=ejs[_0x8d40('0x4c')](_0x59fbfe,{'networks':_0x2b5105||[]});fs[_0x8d40('0x45')](util[_0x8d40('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0x3e828c[_0x8d40('0x25')][_0x8d40('0x51')]()),_0x2bcd87);return respondWithRpcPromise(_0x8d40('0x47'),'destroy',{'module':'chan_sip.so'});}})[_0x8d40('0x3a')](handleError(_0x194f7c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 49c3e7f..722e55d 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 _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./network.attributes','define','Network','network','lodash'];(function(_0x48eb30,_0x3cc6a8){var _0x353653=function(_0x41cfab){while(--_0x41cfab){_0x48eb30['push'](_0x48eb30['shift']());}};_0x353653(++_0x3cc6a8);}(_0xda55,0x6d));var _0x5da5=function(_0xb3bbc8,_0x2a3635){_0xb3bbc8=_0xb3bbc8-0x0;var _0x3254b7=_0xda55[_0xb3bbc8];return _0x3254b7;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./network.attributes','exports','define','network','../../config/logger','api','moment','bluebird','path'];(function(_0x343721,_0x14b67a){var _0x398326=function(_0x5e8cb1){while(--_0x5e8cb1){_0x343721['push'](_0x343721['shift']());}};_0x398326(++_0x14b67a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xcb91[_0x249e96];return _0x17444c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('Network',attributes,{'tableName':_0x1cb9('0x9'),'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 d55aa49..970701a 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x34b1d6,_0x5ccbca){_0x34b1d6=_0x34b1d6-0x0;var _0x27ad8f=_0x7a54[_0x34b1d6];return _0x27ad8f;};'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 _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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x4487a8,_0x177f31){_0x4487a8=_0x4487a8-0x0;var _0x4da3d1=_0x7a54[_0x4487a8];return _0x4da3d1;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 097e8f0..d5ae80e 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 _0xdd97=['destroy','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','getDispositions','getApplications','getInteractions','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update'];(function(_0x336dbd,_0x21b342){var _0x5bcb06=function(_0xb46113){while(--_0xb46113){_0x336dbd['push'](_0x336dbd['shift']());}};_0x5bcb06(++_0x21b342);}(_0xdd97,0x1ef));var _0x7dd9=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xdd97[_0x3a0ebd];return _0x51a660;};'use strict';var multer=require(_0x7dd9('0x0'));var util=require(_0x7dd9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7dd9('0x2'));var router=express[_0x7dd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7dd9('0x4'));var interaction=require(_0x7dd9('0x5'));var config=require(_0x7dd9('0x6'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x8')]);router[_0x7dd9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7dd9('0xa')]);router[_0x7dd9('0x9')](_0x7dd9('0xb'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xc')]);router[_0x7dd9('0x9')]('/:id/dispositions',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xd')]);router[_0x7dd9('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x7dd9('0x9')]('/:id/applications',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xe')]);router[_0x7dd9('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7dd9('0xf')]);router[_0x7dd9('0x9')](_0x7dd9('0x10'),auth[_0x7dd9('0x7')](),controller['getAgents']);router[_0x7dd9('0x11')]('/',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x12')]);router[_0x7dd9('0x11')](_0x7dd9('0x13'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x14')]);router[_0x7dd9('0x11')](_0x7dd9('0x15'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x16')]);router[_0x7dd9('0x11')](_0x7dd9('0x17'),controller[_0x7dd9('0x18')]);router[_0x7dd9('0x11')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7dd9('0x19')]);router[_0x7dd9('0x11')](_0x7dd9('0x10'),auth['isAuthenticated'](),controller[_0x7dd9('0x1a')]);router[_0x7dd9('0x11')](_0x7dd9('0x1b'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1c')]);router['put']('/:id',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1d')]);router['delete'](_0x7dd9('0xb'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1e')]);router[_0x7dd9('0x1f')](_0x7dd9('0x13'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x7dd9('0x15'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x20')]);router[_0x7dd9('0x1f')](_0x7dd9('0x10'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x21')]);module[_0x7dd9('0x22')]=router; \ No newline at end of file +var _0x295f=['update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','/describe','describe','/:id','show','get','getDispositions','getApplications','/:id/interactions','getInteractions','getAgents','post','/:id/dispositions','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','send','put'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x295f,0x1db));var _0xf295=function(_0x5ecb7c,_0x11e342){_0x5ecb7c=_0x5ecb7c-0x0;var _0x2006e5=_0x295f[_0x5ecb7c];return _0x2006e5;};'use strict';var multer=require(_0xf295('0x0'));var util=require(_0xf295('0x1'));var path=require(_0xf295('0x2'));var timeout=require('connect-timeout');var express=require(_0xf295('0x3'));var router=express['Router']();var fs_extra=require(_0xf295('0x4'));var auth=require(_0xf295('0x5'));var interaction=require(_0xf295('0x6'));var config=require(_0xf295('0x7'));var controller=require(_0xf295('0x8'));router['get']('/',auth[_0xf295('0x9')](),controller['index']);router['get'](_0xf295('0xa'),auth[_0xf295('0x9')](),controller[_0xf295('0xb')]);router['get'](_0xf295('0xc'),auth[_0xf295('0x9')](),controller[_0xf295('0xd')]);router[_0xf295('0xe')]('/:id/dispositions',auth[_0xf295('0x9')](),controller[_0xf295('0xf')]);router[_0xf295('0xe')]('/:id/canned_answers',auth[_0xf295('0x9')](),controller['getAnswers']);router[_0xf295('0xe')]('/:id/applications',auth[_0xf295('0x9')](),controller[_0xf295('0x10')]);router[_0xf295('0xe')](_0xf295('0x11'),auth[_0xf295('0x9')](),controller[_0xf295('0x12')]);router[_0xf295('0xe')]('/:id/users',auth[_0xf295('0x9')](),controller[_0xf295('0x13')]);router[_0xf295('0x14')]('/',auth[_0xf295('0x9')](),controller['create']);router[_0xf295('0x14')](_0xf295('0x15'),auth[_0xf295('0x9')](),controller['addDisposition']);router[_0xf295('0x14')]('/:id/canned_answers',auth[_0xf295('0x9')](),controller[_0xf295('0x16')]);router[_0xf295('0x14')](_0xf295('0x17'),controller[_0xf295('0x18')]);router['post'](_0xf295('0x19'),auth['isAuthenticated'](),controller[_0xf295('0x1a')]);router['post'](_0xf295('0x1b'),auth[_0xf295('0x9')](),controller[_0xf295('0x1c')]);router[_0xf295('0x14')](_0xf295('0x1d'),auth[_0xf295('0x9')](),controller[_0xf295('0x1e')]);router[_0xf295('0x1f')]('/:id',auth[_0xf295('0x9')](),controller[_0xf295('0x20')]);router['delete'](_0xf295('0xc'),auth['isAuthenticated'](),controller[_0xf295('0x21')]);router[_0xf295('0x22')](_0xf295('0x15'),auth[_0xf295('0x9')](),controller[_0xf295('0x23')]);router[_0xf295('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf295('0x24')]);router['delete'](_0xf295('0x1b'),auth['isAuthenticated'](),controller[_0xf295('0x25')]);module[_0xf295('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9446cfe..0dcf7bf 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 _0xe184=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x583db1,_0xa9af30){var _0xa6b378=function(_0x1c0421){while(--_0x1c0421){_0x583db1['push'](_0x583db1['shift']());}};_0xa6b378(++_0xa9af30);}(_0xe184,0x1cc));var _0x4e18=function(_0x54aba0,_0x403d1f){_0x54aba0=_0x54aba0-0x0;var _0x17686c=_0xe184[_0x54aba0];return _0x17686c;};'use strict';var Sequelize=require(_0x4e18('0x0'));var rs=require(_0x4e18('0x1'));module['exports']={'name':{'type':Sequelize[_0x4e18('0x2')],'unique':_0x4e18('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4e18('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4e18('0x4')]();}},'replyUri':{'type':Sequelize[_0x4e18('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4e18('0x5')],'defaultValue':function(){return _0x4e18('0x6');}},'notificationSound':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4e18('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4e18('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4e18('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![],'comment':_0x4e18('0x9'),'set':function(_0x13f768){if(!_0x13f768)this[_0x4e18('0xa')]('mandatoryDispositionPauseId',null);this[_0x4e18('0xa')](_0x4e18('0xb'),_0x13f768);}}}; \ No newline at end of file +var _0x3f35=['STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f35,0x1ac));var _0x53f3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3f35[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x53f3('0x0'));var rs=require(_0x53f3('0x1'));module[_0x53f3('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x53f3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x53f3('0x4')]},'token':{'type':Sequelize[_0x53f3('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x53f3('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x53f3('0x5')],'defaultValue':function(){return _0x53f3('0x6');}},'notificationSound':{'type':Sequelize[_0x53f3('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x53f3('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x53f3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x53f3('0x4')]},'queueTransfer':{'type':Sequelize[_0x53f3('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x53f3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x53f3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x53f3('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x53f3('0x7')],'defaultValue':![],'comment':_0x53f3('0x9'),'set':function(_0x37eaa3){if(!_0x37eaa3)this[_0x53f3('0xa')](_0x53f3('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x37eaa3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index a915bf5..6b75548 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 _0xaa7c=['includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','filter','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Tag','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','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','./openchannelAccount.socket','register','http','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','stack','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x1c4325,_0x51d2c4){_0x1c4325=_0x1c4325-0x0;var _0x1416b8=_0xaa7c[_0x1c4325];return _0x1416b8;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];config['redis']=_[_0xcaa7('0x16')](config[_0xcaa7('0x17')],{'host':_0xcaa7('0x18'),'port':0x18eb});var socket=require(_0xcaa7('0x19'))(new Redis(config[_0xcaa7('0x17')]));require(_0xcaa7('0x1a'))[_0xcaa7('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcaa7('0x1c')]({'port':0x232c});var client9002=jayson[_0xcaa7('0x1d')][_0xcaa7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b2c4f,_0x49a218,_0x98c3e2,_0x13f970){return new BPromise(function(_0x23c8f3,_0x32b8af){var _0x46d9b4=_0x13f970||client;return _0x46d9b4[_0xcaa7('0x1e')](_0x1b2c4f,_0x98c3e2)[_0xcaa7('0x1f')](function(_0x5c2a74){logger['info'](_0xcaa7('0x20'),_0x49a218,_0xcaa7('0x21'));logger[_0xcaa7('0x22')](_0xcaa7('0x23'),_0x49a218,_0xcaa7('0x21'),JSON[_0xcaa7('0x24')](_0x5c2a74));if(_0x5c2a74[_0xcaa7('0x25')]){if(_0x5c2a74['error'][_0xcaa7('0x26')]===0x1f4){logger[_0xcaa7('0x25')](_0xcaa7('0x20'),_0x49a218,_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);return _0x32b8af(_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);}logger[_0xcaa7('0x25')](_0xcaa7('0x20'),_0x49a218,_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);return _0x23c8f3(_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);}else{logger['info'](_0xcaa7('0x20'),_0x49a218,_0xcaa7('0x21'));_0x23c8f3(_0x5c2a74['result'][_0xcaa7('0x27')]);}})[_0xcaa7('0x28')](function(_0x146e6f){logger[_0xcaa7('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x49a218,_0x146e6f);_0x32b8af(_0x146e6f);});});}function respondWithStatusCode(_0x5d4e7e,_0x3c0b15){_0x3c0b15=_0x3c0b15||0xcc;return function(_0x3e1f78){if(_0x3e1f78){return _0x5d4e7e[_0xcaa7('0x29')](_0x3c0b15);}return _0x5d4e7e[_0xcaa7('0x2a')](_0x3c0b15)[_0xcaa7('0x2b')]();};}function respondWithResult(_0x4ec9e9,_0x1a2577){_0x1a2577=_0x1a2577||0xc8;return function(_0x4c6e87){if(_0x4c6e87){return _0x4ec9e9['status'](_0x1a2577)[_0xcaa7('0x2c')](_0x4c6e87);}};}function respondWithFilteredResult(_0x492362,_0x34a30d){return function(_0x623f17){if(_0x623f17){var _0x748bda=typeof _0x34a30d[_0xcaa7('0x2d')]===_0xcaa7('0x2e')&&typeof _0x34a30d[_0xcaa7('0x2f')]===_0xcaa7('0x2e');var _0x3b9cea=_0x623f17['count'];var _0x19d02c=_0x748bda?0x0:_0x34a30d[_0xcaa7('0x2d')];var _0x24b192=_0x748bda?_0x623f17[_0xcaa7('0x30')]:_0x34a30d[_0xcaa7('0x2d')]+_0x34a30d['limit'];var _0x25c847;if(_0x24b192>=_0x3b9cea){_0x24b192=_0x3b9cea;_0x25c847=0xc8;}else{_0x25c847=0xce;}_0x492362[_0xcaa7('0x2a')](_0x25c847);return _0x492362[_0xcaa7('0x31')](_0xcaa7('0x32'),_0x19d02c+'-'+_0x24b192+'/'+_0x3b9cea)[_0xcaa7('0x2c')](_0x623f17);}return null;};}function patchUpdates(_0x483b44){return function(_0x149e02){try{jsonpatch['apply'](_0x149e02,_0x483b44,!![]);}catch(_0xea24c0){return BPromise[_0xcaa7('0x33')](_0xea24c0);}return _0x149e02[_0xcaa7('0x34')]();};}function saveUpdates(_0x59f2c7,_0x289e29){return function(_0xf67857){if(_0xf67857){return _0xf67857[_0xcaa7('0x35')](_0x59f2c7)[_0xcaa7('0x1f')](function(_0x473aee){return _0x473aee;});}return null;};}function removeEntity(_0x27be59,_0x49ccb8){return function(_0x24695f){if(_0x24695f){return _0x24695f[_0xcaa7('0x36')]()['then'](function(){var _0x455f6e=_0x24695f[_0xcaa7('0x37')]({'plain':!![]});var _0x444add=_0xcaa7('0x38');return db['UserProfileResource'][_0xcaa7('0x36')]({'where':{'type':_0x444add,'resourceId':_0x455f6e['id']}})[_0xcaa7('0x1f')](function(){return _0x24695f;});})[_0xcaa7('0x1f')](function(){_0x27be59[_0xcaa7('0x2a')](0xcc)[_0xcaa7('0x2b')]();});}};}function handleEntityNotFound(_0x42d5fb,_0xcb5439){return function(_0x1a5cda){if(!_0x1a5cda){_0x42d5fb[_0xcaa7('0x29')](0x194);}return _0x1a5cda;};}function handleError(_0x45c8f8,_0xf55432){_0xf55432=_0xf55432||0x1f4;return function(_0x266d5f){logger['error'](_0x266d5f[_0xcaa7('0x39')]);if(_0x266d5f[_0xcaa7('0x3a')]){delete _0x266d5f[_0xcaa7('0x3a')];}_0x45c8f8[_0xcaa7('0x2a')](_0xf55432)[_0xcaa7('0x3b')](_0x266d5f);};}exports['index']=function(_0x3d3c13,_0x32637a){var _0x387b12={'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]},_0x49fa92={},_0x10f8c7={'count':0x0,'rows':[]};var _0x1138a6=_['map'](db[_0xcaa7('0x3e')]['rawAttributes'],function(_0x2f6d18){return{'name':_0x2f6d18['fieldName'],'type':_0x2f6d18[_0xcaa7('0x3f')]['key']};});_0x49fa92['model']=_[_0xcaa7('0x40')](_0x1138a6,_0xcaa7('0x3a'));_0x49fa92['query']=_[_0xcaa7('0x41')](_0x3d3c13[_0xcaa7('0x42')]);_0x49fa92[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x49fa92[_0xcaa7('0x45')],_0x49fa92[_0xcaa7('0x42')]);_0x387b12[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x49fa92['model'],qs[_0xcaa7('0x47')](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x387b12[_0xcaa7('0x46')]=_0x387b12[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x387b12['attributes']:_0x49fa92[_0xcaa7('0x45')];if(!_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x387b12[_0xcaa7('0x2f')]=qs['limit'](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x387b12[_0xcaa7('0x2d')]=qs['offset'](_0x3d3c13[_0xcaa7('0x42')]['offset']);}_0x387b12[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x387b12[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x3d3c13['query'],_0x49fa92['filters']),_0x1138a6);if(_0x3d3c13[_0xcaa7('0x42')]['filter']){_0x387b12[_0xcaa7('0x4d')]=_['merge'](_0x387b12[_0xcaa7('0x4d')],{'$or':_['map'](_0x1138a6,function(_0x3ef608){if(_0x3ef608[_0xcaa7('0x3f')]!==_0xcaa7('0x4f')){var _0x32ec2d={};_0x32ec2d[_0x3ef608[_0xcaa7('0x3a')]]={'$like':'%'+_0x3d3c13[_0xcaa7('0x42')]['filter']+'%'};return _0x32ec2d;}})});}_0x387b12=_['merge']({},_0x387b12,_0x3d3c13[_0xcaa7('0x50')]);var _0x3a5f1f={'where':_0x387b12['where']};return db[_0xcaa7('0x3e')][_0xcaa7('0x30')](_0x3a5f1f)[_0xcaa7('0x1f')](function(_0x4237ee){_0x10f8c7[_0xcaa7('0x30')]=_0x4237ee;if(_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x387b12[_0xcaa7('0x52')]=[{'all':!![]}];}return db[_0xcaa7('0x3e')][_0xcaa7('0x53')](_0x387b12);})[_0xcaa7('0x1f')](function(_0x3cc7ae){_0x10f8c7[_0xcaa7('0x54')]=_0x3cc7ae;return _0x10f8c7;})[_0xcaa7('0x1f')](respondWithFilteredResult(_0x32637a,_0x387b12))[_0xcaa7('0x28')](handleError(_0x32637a,null));};exports[_0xcaa7('0x55')]=function(_0x5dcc42,_0x19e91b){var _0x47b88e={'raw':![],'where':{'id':_0x5dcc42[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]},_0x3e1828={};_0x3e1828[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x3e')][_0xcaa7('0x57')]);_0x3e1828[_0xcaa7('0x42')]=_[_0xcaa7('0x41')](_0x5dcc42[_0xcaa7('0x42')]);_0x3e1828['filters']=_[_0xcaa7('0x44')](_0x3e1828[_0xcaa7('0x45')],_0x3e1828[_0xcaa7('0x42')]);_0x47b88e['attributes']=_[_0xcaa7('0x44')](_0x3e1828['model'],qs[_0xcaa7('0x47')](_0x5dcc42[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x47b88e[_0xcaa7('0x46')]=_0x47b88e['attributes'][_0xcaa7('0x48')]?_0x47b88e[_0xcaa7('0x46')]:_0x3e1828[_0xcaa7('0x45')];if(_0x5dcc42[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x47b88e[_0xcaa7('0x52')]=[{'all':!![]}];}_0x47b88e=_[_0xcaa7('0x58')]({},_0x47b88e,_0x5dcc42[_0xcaa7('0x50')]);return db['OpenchannelAccount'][_0xcaa7('0x59')](_0x47b88e)[_0xcaa7('0x1f')](handleEntityNotFound(_0x19e91b,null))[_0xcaa7('0x1f')](respondWithResult(_0x19e91b,null))[_0xcaa7('0x28')](handleError(_0x19e91b,null));};exports[_0xcaa7('0x5a')]=function(_0xb7a21b,_0x4fde27){return db[_0xcaa7('0x3e')][_0xcaa7('0x5a')](_0xb7a21b['body'],{})[_0xcaa7('0x1f')](function(_0x1a4a4c){var _0x39558c=_0xb7a21b['user'][_0xcaa7('0x37')]({'plain':!![]});if(!_0x39558c)throw new Error(_0xcaa7('0x5b'));if(_0x39558c['role']===_0xcaa7('0x5c')){var _0x1a7959=_0x1a4a4c[_0xcaa7('0x37')]({'plain':!![]});var _0x172cd7=_0xcaa7('0x38');return db[_0xcaa7('0x5d')][_0xcaa7('0x59')]({'where':{'name':_0x172cd7,'userProfileId':_0x39558c[_0xcaa7('0x5e')]},'raw':!![]})[_0xcaa7('0x1f')](function(_0x143bcf){if(_0x143bcf&&_0x143bcf[_0xcaa7('0x5f')]===0x0){return db[_0xcaa7('0x60')][_0xcaa7('0x5a')]({'name':_0x1a7959[_0xcaa7('0x3a')],'resourceId':_0x1a7959['id'],'type':_0x143bcf[_0xcaa7('0x3a')],'sectionId':_0x143bcf['id']},{})[_0xcaa7('0x1f')](function(){return _0x1a4a4c;});}else{return _0x1a4a4c;}})[_0xcaa7('0x28')](function(_0x145444){logger['error'](_0xcaa7('0x61'),_0x145444);throw _0x145444;});}return _0x1a4a4c;})['then'](respondWithResult(_0x4fde27,0xc9))[_0xcaa7('0x28')](handleError(_0x4fde27,null));};exports[_0xcaa7('0x35')]=function(_0xae7ce3,_0x5accbd){if(_0xae7ce3[_0xcaa7('0x62')]['id']){delete _0xae7ce3[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0xae7ce3[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]})[_0xcaa7('0x1f')](handleEntityNotFound(_0x5accbd,null))[_0xcaa7('0x1f')](saveUpdates(_0xae7ce3[_0xcaa7('0x62')],null))['then'](respondWithResult(_0x5accbd,null))[_0xcaa7('0x28')](handleError(_0x5accbd,null));};exports[_0xcaa7('0x36')]=function(_0x545708,_0x5ce1e9){return db[_0xcaa7('0x3e')]['find']({'where':{'id':_0x545708[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ce1e9,null))[_0xcaa7('0x1f')](removeEntity(_0x5ce1e9,null))['catch'](handleError(_0x5ce1e9,null));};exports[_0xcaa7('0x63')]=function(_0x143d06,_0x1645f2){return db[_0xcaa7('0x3e')][_0xcaa7('0x63')]()[_0xcaa7('0x1f')](respondWithResult(_0x1645f2,null))[_0xcaa7('0x28')](handleError(_0x1645f2,null));};exports[_0xcaa7('0x64')]=function(_0x129d45,_0x34d5df,_0x54c4a4){if(_0x129d45[_0xcaa7('0x62')]['id']){delete _0x129d45[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x129d45[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x34d5df,null))[_0xcaa7('0x1f')](function(_0x5825d9){if(_0x5825d9){_0x129d45[_0xcaa7('0x62')][_0xcaa7('0x65')]=_0x5825d9['id'];return db[_0xcaa7('0x66')][_0xcaa7('0x5a')](_0x129d45[_0xcaa7('0x62')]);}})['then'](respondWithResult(_0x34d5df,null))[_0xcaa7('0x28')](handleError(_0x34d5df,null));};exports['getDispositions']=function(_0x4df5ab,_0xd62907,_0xd7a048){var _0x2d32da={'raw':![],'where':{}};var _0x5889f7={};var _0xdc6a83={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xcaa7('0x67')]({'where':{'id':_0x4df5ab[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0xd62907,null))[_0xcaa7('0x1f')](function(_0x1a55c9){if(_0x1a55c9){_0x5889f7[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x66')]['rawAttributes']);_0x5889f7['query']=_[_0xcaa7('0x41')](_0x4df5ab[_0xcaa7('0x42')]);_0x5889f7[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x5889f7[_0xcaa7('0x45')],_0x5889f7['query']);_0x2d32da[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x5889f7['model'],qs[_0xcaa7('0x47')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x2d32da[_0xcaa7('0x46')]=_0x2d32da[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x2d32da['attributes']:_0x5889f7[_0xcaa7('0x45')];if(!_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x2d32da[_0xcaa7('0x2f')]=qs['limit'](_0x4df5ab['query'][_0xcaa7('0x2f')]);_0x2d32da[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}_0x2d32da['order']=qs[_0xcaa7('0x4c')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x2d32da[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0x4df5ab[_0xcaa7('0x42')],_0x5889f7[_0xcaa7('0x43')]));_0x2d32da['where'][_0xcaa7('0x65')]=_0x1a55c9['id'];if(_0x4df5ab['query']['filter']){_0x2d32da[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0x2d32da[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x2d32da['attributes'],function(_0x8cff93){var _0x2de7b7={};_0x2de7b7[_0x8cff93]={'$like':'%'+_0x4df5ab['query'][_0xcaa7('0x68')]+'%'};return _0x2de7b7;})});}_0x2d32da=_[_0xcaa7('0x58')]({},_0x2d32da,_0x4df5ab[_0xcaa7('0x50')]);return db['Disposition'][_0xcaa7('0x30')]({'where':_0x2d32da[_0xcaa7('0x4d')]})['then'](function(_0x3307c5){_0xdc6a83['count']=_0x3307c5;if(_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x2d32da['include']=[{'all':!![]}];}return db[_0xcaa7('0x66')][_0xcaa7('0x53')](_0x2d32da);})[_0xcaa7('0x1f')](function(_0x5b7d87){_0xdc6a83[_0xcaa7('0x54')]=_0x5b7d87;return _0xdc6a83;});}})[_0xcaa7('0x1f')](respondWithFilteredResult(_0xd62907,_0x2d32da))[_0xcaa7('0x28')](handleError(_0xd62907,null));};exports[_0xcaa7('0x69')]=function(_0x550f28,_0x28a295,_0x209341){return db[_0xcaa7('0x3e')]['find']({'where':{'id':_0x550f28[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x28a295,null))[_0xcaa7('0x1f')](function(_0xaaf82c){if(_0xaaf82c){return _0xaaf82c[_0xcaa7('0x69')](_0x550f28[_0xcaa7('0x42')]['ids']);}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x28a295,null))[_0xcaa7('0x28')](handleError(_0x28a295,null));};exports[_0xcaa7('0x6a')]=function(_0x3f65de,_0x58249a,_0x3e74be){if(_0x3f65de[_0xcaa7('0x62')]['id']){delete _0x3f65de[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x3f65de[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x58249a,null))['then'](function(_0x212f63){if(_0x212f63){_0x3f65de[_0xcaa7('0x62')]['OpenchannelAccountId']=_0x212f63['id'];return db['CannedAnswer'][_0xcaa7('0x5a')](_0x3f65de[_0xcaa7('0x62')]);}})[_0xcaa7('0x1f')](respondWithResult(_0x58249a,null))['catch'](handleError(_0x58249a,null));};exports[_0xcaa7('0x6b')]=function(_0x2e07c1,_0x28cfa4,_0x239130){var _0x1fc298={'raw':![],'where':{}};var _0x2ff351={};var _0x1ef4f1={'count':0x0,'rows':[]};return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x2e07c1['params']['id']}})['then'](handleEntityNotFound(_0x28cfa4,null))[_0xcaa7('0x1f')](function(_0x48ebcb){if(_0x48ebcb){_0x2ff351[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x6c')][_0xcaa7('0x57')]);_0x2ff351['query']=_[_0xcaa7('0x41')](_0x2e07c1['query']);_0x2ff351[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2ff351[_0xcaa7('0x45')],_0x2ff351[_0xcaa7('0x42')]);_0x1fc298[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2ff351[_0xcaa7('0x45')],qs['fields'](_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x1fc298['attributes']=_0x1fc298[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x1fc298['attributes']:_0x2ff351['model'];if(!_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x1fc298[_0xcaa7('0x2f')]=qs['limit'](_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x1fc298[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0x2e07c1[_0xcaa7('0x42')]['offset']);}_0x1fc298[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x2e07c1['query'][_0xcaa7('0x4c')]);_0x1fc298[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x2e07c1[_0xcaa7('0x42')],_0x2ff351[_0xcaa7('0x43')]));_0x1fc298[_0xcaa7('0x4d')][_0xcaa7('0x65')]=_0x48ebcb['id'];if(_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x1fc298[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0x1fc298[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x1fc298[_0xcaa7('0x46')],function(_0x49ee2e){var _0x5bd482={};_0x5bd482[_0x49ee2e]={'$like':'%'+_0x2e07c1['query'][_0xcaa7('0x68')]+'%'};return _0x5bd482;})});}_0x1fc298=_[_0xcaa7('0x58')]({},_0x1fc298,_0x2e07c1[_0xcaa7('0x50')]);return db[_0xcaa7('0x6c')][_0xcaa7('0x30')]({'where':_0x1fc298[_0xcaa7('0x4d')]})[_0xcaa7('0x1f')](function(_0x3ae09c){_0x1ef4f1['count']=_0x3ae09c;if(_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x1fc298[_0xcaa7('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcaa7('0x53')](_0x1fc298);})[_0xcaa7('0x1f')](function(_0x4031a2){_0x1ef4f1[_0xcaa7('0x54')]=_0x4031a2;return _0x1ef4f1;});}})['then'](respondWithFilteredResult(_0x28cfa4,_0x1fc298))[_0xcaa7('0x28')](handleError(_0x28cfa4,null));};exports[_0xcaa7('0x6d')]=function(_0x2e3832,_0x2a87e9,_0x32c833){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x2e3832['params']['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x2a87e9,null))[_0xcaa7('0x1f')](function(_0x46135a){if(_0x46135a){return _0x46135a[_0xcaa7('0x6d')](_0x2e3832[_0xcaa7('0x42')]['ids']);}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x2a87e9,null))['catch'](handleError(_0x2a87e9,null));};exports[_0xcaa7('0x6e')]=function(_0x1ef7d0,_0xaea727,_0x39e80e){var _0x304412={'body':_0x1ef7d0[_0xcaa7('0x62')],'channel':_0xcaa7('0x6f')};var _0x22691f=[];var _0x2a169d=[];var _0x4c91b1={};var _0xdbf722=![];return db[_0xcaa7('0x70')][_0xcaa7('0x63')]()[_0xcaa7('0x1f')](function(_0x4d24a0){if(!_0x4d24a0){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x73'));}_0x22691f=_[_0xcaa7('0x74')](_['keys'](_0x4d24a0),[_0xcaa7('0x75'),_0xcaa7('0x76')]);_0x2a169d=_['difference'](_[_0xcaa7('0x41')](_0x4d24a0),[_0xcaa7('0x75'),_0xcaa7('0x76'),'CompanyId',_0xcaa7('0x77')]);if(_0x1ef7d0['body']['id']){delete _0x1ef7d0[_0xcaa7('0x62')]['id'];}if(_[_0xcaa7('0x78')](_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x79')])){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))]('from\x20is\x20mandatory');}if(_[_0xcaa7('0x78')](_0x1ef7d0['body'][_0xcaa7('0x62')])||_0x1ef7d0['body'][_0xcaa7('0x62')]===''){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7a'));}if(_[_0xcaa7('0x78')](_0x1ef7d0['body'][_0xcaa7('0x7b')])){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7c')+_0x2a169d);}if(!_[_0xcaa7('0x7d')](_0x2a169d,_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x7b')])){throw new db['Sequelize'][(_0xcaa7('0x72'))](_0xcaa7('0x7e')+_0x2a169d);}_0x4c91b1[_0x1ef7d0[_0xcaa7('0x62')]['mapKey']]=_0x1ef7d0['body'][_0xcaa7('0x79')];})[_0xcaa7('0x1f')](function(){return db['OpenchannelAccount'][_0xcaa7('0x59')]({'where':{'id':_0x1ef7d0[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x7f')],'as':_0xcaa7('0x80'),'include':[{'model':db['CmContact'],'as':_0xcaa7('0x81'),'where':_0x4c91b1,'limit':0x1,'order':[[_0xcaa7('0x76'),_0xcaa7('0x82')]]}]},{'model':db[_0xcaa7('0x83')],'as':_0xcaa7('0x84')}]});})[_0xcaa7('0x1f')](handleEntityNotFound(_0xaea727,null))[_0xcaa7('0x1f')](function(_0x8a57d4){if(_0x8a57d4&&_0x8a57d4[_0xcaa7('0x80')]){_0x304412[_0xcaa7('0x85')]=_0x8a57d4;_0x304412[_0xcaa7('0x86')]=_0x8a57d4[_0xcaa7('0x84')];_0x304412['list']=_0x8a57d4['List'];_0x304412['applications']=_[_0xcaa7('0x87')](_0x304412[_0xcaa7('0x86')],[_0xcaa7('0x88')],['asc']);if(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x84')]){delete _0x304412[_0xcaa7('0x85')][_0xcaa7('0x84')];}if(_0x304412['account'][_0xcaa7('0x80')]&&_0x304412[_0xcaa7('0x85')][_0xcaa7('0x80')][_0xcaa7('0x81')]['length']){return _0x304412['account'][_0xcaa7('0x80')][_0xcaa7('0x81')][0x0];}var _0x49c4b1=_['defaults'](_0x1ef7d0[_0xcaa7('0x62')],{'firstName':_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x79')],'ListId':_0x8a57d4[_0xcaa7('0x77')]});_0x49c4b1[_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x7b')]]=_0x1ef7d0[_0xcaa7('0x62')]['from'];return db[_0xcaa7('0x70')][_0xcaa7('0x5a')](_0x49c4b1,{'fields':_0x22691f,'raw':!![]});}})['then'](handleEntityNotFound(_0xaea727,null))[_0xcaa7('0x1f')](function(_0x2e96d2){_0x304412[_0xcaa7('0x89')]=_0x2e96d2;if(_0x2e96d2){var _0x36691a={'ContactId':_0x2e96d2['id'],'OpenchannelAccountId':_0x1ef7d0[_0xcaa7('0x56')]['id'],'from':(_0x2e96d2[_0xcaa7('0x8a')]||'')+'\x20'+(_0x2e96d2[_0xcaa7('0x8b')]||'')};var _0x5eb838={'OpenchannelAccountId':_0x1ef7d0[_0xcaa7('0x56')]['id'],'closed':![]};if(_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]){_0x5eb838[_0xcaa7('0x8c')]=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')];return db['OpenchannelInteraction'][_0xcaa7('0x59')]({'where':_0x5eb838})[_0xcaa7('0x1f')](function(_0x1e736b){if(_0x1e736b){return[_0x1e736b,![]];}_0x36691a['threadId']=_0x1ef7d0['body']['threadId'];_0x36691a[_0xcaa7('0x8d')]=_0x1ef7d0[_0xcaa7('0x62')]['externalUrl'];return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')](_0x36691a)[_0xcaa7('0x1f')](function(_0x3ee7f2){return[_0x3ee7f2,!![]];});});}else{_0x5eb838[_0xcaa7('0x8c')]=null;}_0x5eb838[_0xcaa7('0x8f')]=_0x2e96d2['id'];return db['OpenchannelInteraction'][_0xcaa7('0x59')]({'where':_0x5eb838})['then'](function(_0x4c7e28){if(_0x4c7e28){return[_0x4c7e28,![]];}return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')](_0x36691a)['then'](function(_0x18bc1a){return[_0x18bc1a,!![]];});});}})[_0xcaa7('0x90')](function(_0x14cdcc,_0x44c251){if(_0x14cdcc){_0xdbf722=_0x44c251;if(!_0x44c251){var _0x14bb56={'from':(_0x304412[_0xcaa7('0x89')][_0xcaa7('0x8a')]||'')+'\x20'+(_0x304412[_0xcaa7('0x89')][_0xcaa7('0x8b')]||'')};if(_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]&&_0x1ef7d0['body'][_0xcaa7('0x91')]&&_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]!=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x91')]){_0x14bb56['threadId']=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x91')];}return _0x14cdcc[_0xcaa7('0x35')](_0x14bb56);}else{return _0x14cdcc;}}})['then'](function(_0x589771){_0x304412[_0xcaa7('0x92')]=_0x589771['get']({'plain':!![]});_0x304412[_0xcaa7('0x92')][_0xcaa7('0x93')]=_0xdbf722;if(_0x304412[_0xcaa7('0x92')]['created']){if(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x94')]){_0x304412[_0xcaa7('0x86')][_0xcaa7('0x95')]({'id':0x0,'priority':_0x304412[_0xcaa7('0x86')][_0xcaa7('0x48')]+0x1,'app':_0xcaa7('0x96'),'appdata':_0xcaa7('0x97'),'interval':_0xcaa7('0x98')});}}return db[_0xcaa7('0x99')][_0xcaa7('0x5a')]({'body':_0x1ef7d0['body'][_0xcaa7('0x62')],'OpenchannelAccountId':_0x1ef7d0['params']['id'],'OpenchannelInteractionId':_0x589771['id'],'direction':'in','ContactId':_0x304412['contact']['id'],'AttachmentId':_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x9a')]});})[_0xcaa7('0x1f')](function(_0x59fdd6){_0x304412['message']=_0x59fdd6;if(_0x304412[_0xcaa7('0x92')][_0xcaa7('0x9b')]){return db[_0xcaa7('0x9c')][_0xcaa7('0x59')]({'attributes':['id',_0xcaa7('0x3a')],'where':{'id':_0x304412[_0xcaa7('0x92')][_0xcaa7('0x9b')]}})[_0xcaa7('0x1f')](function(_0x429ffb){if(_0x429ffb){_0x304412[_0xcaa7('0x86')][_0xcaa7('0x9d')]({'id':0x0,'priority':0x0,'app':_0xcaa7('0x9e'),'appdata':_0x429ffb[_0xcaa7('0x3a')]+','+(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x9f')]||0xa),'interval':_0xcaa7('0x98')});_0x304412[_0xcaa7('0xa0')]=![];}return respondWithRpcPromise(_0xcaa7('0xa1'),'startRouting',_0x304412);});}return respondWithRpcPromise(_0xcaa7('0xa1'),_0xcaa7('0xa2'),_0x304412);})[_0xcaa7('0x1f')](function(_0x294e55){respondWithRpcPromise(_0xcaa7('0xa3'),'EventManager',{'event':_0xcaa7('0x6e'),'message':_0x294e55},client9002);return _0x294e55;})[_0xcaa7('0x1f')](respondWithResult(_0xaea727,null))[_0xcaa7('0x28')](handleError(_0xaea727,null));};exports[_0xcaa7('0xa4')]=function(_0x53a51f,_0x4fae70){var _0x28c347=_0x53a51f[_0xcaa7('0x56')]['id'];var _0x3f7a3d=_0x53a51f['body'];var _0x2102bc=0xc8;var _0x1c3eda=null;return db[_0xcaa7('0xa5')][_0xcaa7('0xa6')]({'isolationLevel':db['sequelize'][_0xcaa7('0xa7')][_0xcaa7('0xa8')][_0xcaa7('0xa9')]},function(_0x2985c4){return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x28c347},'transaction':_0x2985c4})[_0xcaa7('0x1f')](function(_0x39d225){if(_0x39d225){return db[_0xcaa7('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x28c347},'transaction':_0x2985c4})[_0xcaa7('0x1f')](function(){var _0x1ad140=_[_0xcaa7('0x40')](_0x3f7a3d,function(_0xb400c5){_0xb400c5['OpenchannelAccountId']=_0x28c347;return _0xb400c5;});return db[_0xcaa7('0x83')][_0xcaa7('0xaa')](_0x1ad140,{'transaction':_0x2985c4});});}else{_0x2102bc=0x194;_0x1c3eda=[];}});})[_0xcaa7('0x1f')](function(){if(_0x2102bc!==0x194){return db[_0xcaa7('0x83')][_0xcaa7('0xab')]({'where':{'OpenchannelAccountId':_0x28c347},'order':_0xcaa7('0x88')})['then'](function(_0x3f428a){_0x1c3eda=_0x3f428a;});}})['catch'](function(_0x2ed2fb){_0x2102bc=0x1f4;logger[_0xcaa7('0x25')](_0x2ed2fb[_0xcaa7('0x39')]);if(_0x2ed2fb[_0xcaa7('0x3a')]){delete _0x2ed2fb['name'];}_0x1c3eda=_0x2ed2fb;})[_0xcaa7('0xac')](function(){if(_0x1c3eda===null){_0x4fae70['sendStatus'](_0x2102bc);}else{if(_0x2102bc===0x1f4){_0x4fae70[_0xcaa7('0x2a')](_0x2102bc)[_0xcaa7('0x3b')](_0x1c3eda);}else{_0x4fae70['status'](_0x2102bc)[_0xcaa7('0x2c')](_0x1c3eda);}}});};exports['getApplications']=function(_0xa5e98f,_0x19efbe,_0x413c3a){var _0xdc415a={};var _0x2a433c={};var _0x49afc5;var _0x206567;return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0xa5e98f[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x19efbe,null))[_0xcaa7('0x1f')](function(_0x4d62e3){if(_0x4d62e3){_0x49afc5=_0x4d62e3;_0x2a433c['model']=_[_0xcaa7('0x41')](db['OpenchannelApplication'][_0xcaa7('0x57')]);_0x2a433c[_0xcaa7('0x42')]=_[_0xcaa7('0x41')](_0xa5e98f['query']);_0x2a433c[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2a433c[_0xcaa7('0x45')],_0x2a433c['query']);_0xdc415a['attributes']=_[_0xcaa7('0x44')](_0x2a433c['model'],qs['fields'](_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0xdc415a[_0xcaa7('0x46')]=_0xdc415a[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0xdc415a['attributes']:_0x2a433c['model'];_0xdc415a[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0xa5e98f['query']['sort']);_0xdc415a[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0xa5e98f[_0xcaa7('0x42')],_0x2a433c[_0xcaa7('0x43')]));if(_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0xdc415a[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0xdc415a[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0xdc415a[_0xcaa7('0x46')],function(_0x1855a5){var _0x2ac627={};_0x2ac627[_0x1855a5]={'$like':'%'+_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x2ac627;})});}_0xdc415a=_[_0xcaa7('0x58')]({},_0xdc415a,_0xa5e98f[_0xcaa7('0x50')]);return _0x49afc5[_0xcaa7('0xad')](_0xdc415a);}})['then'](function(_0x3e86fd){if(_0x3e86fd){_0x206567=_0x3e86fd[_0xcaa7('0x48')];if(!_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0xdc415a[_0xcaa7('0x2f')]=qs[_0xcaa7('0x2f')](_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0xdc415a[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0xa5e98f[_0xcaa7('0x42')]['offset']);}return _0x49afc5['getApplications'](_0xdc415a);}})[_0xcaa7('0x1f')](function(_0x323934){if(_0x323934){return _0x323934?{'count':_0x206567,'rows':_0x323934}:null;}})[_0xcaa7('0x1f')](respondWithResult(_0x19efbe,null))[_0xcaa7('0x28')](handleError(_0x19efbe,null));};exports[_0xcaa7('0xae')]=function(_0x362ecf,_0x23705d,_0x11621a){var _0x9c701f={'raw':![],'where':{}};var _0x2675b1={};var _0x297157={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x362ecf[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x23705d,null))[_0xcaa7('0x1f')](function(_0x120074){if(_0x120074){_0x2675b1[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x8e')][_0xcaa7('0x57')]);_0x2675b1['query']=_['keys'](_0x362ecf[_0xcaa7('0x42')]);_0x2675b1[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2675b1[_0xcaa7('0x45')],_0x2675b1[_0xcaa7('0x42')]);_0x9c701f[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2675b1[_0xcaa7('0x45')],qs[_0xcaa7('0x47')](_0x362ecf['query'][_0xcaa7('0x47')]));_0x9c701f[_0xcaa7('0x46')]=_0x9c701f[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x9c701f['attributes']:_0x2675b1[_0xcaa7('0x45')];if(!_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x9c701f['limit']=qs[_0xcaa7('0x2f')](_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x9c701f[_0xcaa7('0x2d')]=qs['offset'](_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}_0x9c701f[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x362ecf['query'][_0xcaa7('0x4c')]);_0x9c701f[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0x362ecf[_0xcaa7('0x42')],_0x2675b1[_0xcaa7('0x43')]));_0x9c701f[_0xcaa7('0x4d')][_0xcaa7('0x65')]=_0x120074['id'];if(_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x9c701f['where']=_['merge'](_0x9c701f[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x9c701f[_0xcaa7('0x46')],function(_0x4405d7){var _0x2a0d6e={};_0x2a0d6e[_0x4405d7]={'$like':'%'+_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x2a0d6e;})});}_0x9c701f=_[_0xcaa7('0x58')]({},_0x9c701f,_0x362ecf['options']);return db[_0xcaa7('0x8e')][_0xcaa7('0x30')]({'where':_0x9c701f[_0xcaa7('0x4d')]})['then'](function(_0x1d4701){_0x297157[_0xcaa7('0x30')]=_0x1d4701;if(_0x362ecf[_0xcaa7('0x42')]['includeAll']){_0x9c701f['include']=[{'model':db[_0xcaa7('0x70')],'as':_0xcaa7('0xaf'),'required':![]},{'model':db[_0xcaa7('0x9c')],'as':'Owner','attributes':[_0xcaa7('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xcaa7('0xb0')],'as':'Tags','attributes':['id',_0xcaa7('0x3a'),_0xcaa7('0xb1')],'where':_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0xb2')]?{'id':_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0xb2')]}:undefined,'required':_0x362ecf['query'][_0xcaa7('0xb2')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xcaa7('0x53')](_0x9c701f);})[_0xcaa7('0x1f')](function(_0x464d01){_0x297157['rows']=_0x464d01;return _0x297157;});}})['then'](respondWithFilteredResult(_0x23705d,_0x9c701f))[_0xcaa7('0x28')](handleError(_0x23705d,null));};exports['addAgents']=function(_0xd98c8d,_0x3fab53,_0x4722ec){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0xd98c8d[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x3fab53,null))['then'](function(_0x5bd7f6){if(_0x5bd7f6){return _0x5bd7f6[_0xcaa7('0xb3')](_0xd98c8d[_0xcaa7('0x62')][_0xcaa7('0xb4')],_[_0xcaa7('0xb5')](_0xd98c8d[_0xcaa7('0x62')],[_0xcaa7('0xb4'),'id'])||{})[_0xcaa7('0x90')](function(_0x433ac7){for(var _0x58f0a7=0x0;_0x58f0a7<_0xd98c8d[_0xcaa7('0x62')]['ids'][_0xcaa7('0x48')];_0x58f0a7+=0x1){socket[_0xcaa7('0xb6')](_0xcaa7('0xb7'),{'UserId':Number(_0xd98c8d[_0xcaa7('0x62')]['ids'][_0x58f0a7]),'OpenchannelAccountId':Number(_0xd98c8d[_0xcaa7('0x56')]['id'])});}return _0x433ac7;});}})[_0xcaa7('0x1f')](respondWithResult(_0x3fab53,null))[_0xcaa7('0x28')](handleError(_0x3fab53,null));};exports[_0xcaa7('0xb8')]=function(_0x29b9f1,_0x3ac859,_0x31a57c){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x29b9f1[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ac859,null))['then'](function(_0x2e9cf8){if(_0x2e9cf8){return _0x2e9cf8[_0xcaa7('0xb8')](_0x29b9f1[_0xcaa7('0x42')][_0xcaa7('0xb4')])[_0xcaa7('0x1f')](function(){if(_[_0xcaa7('0xb9')](_0x29b9f1[_0xcaa7('0x42')][_0xcaa7('0xb4')])){for(var _0x9d8a8f=0x0;_0x9d8a8f<_0x29b9f1[_0xcaa7('0x42')]['ids'][_0xcaa7('0x48')];_0x9d8a8f+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x29b9f1['query'][_0xcaa7('0xb4')][_0x9d8a8f]),'OpenchannelAccountId':Number(_0x29b9f1[_0xcaa7('0x56')]['id'])});}}else{socket[_0xcaa7('0xb6')](_0xcaa7('0xba'),{'UserId':Number(_0x29b9f1['query'][_0xcaa7('0xb4')]),'OpenchannelAccountId':Number(_0x29b9f1[_0xcaa7('0x56')]['id'])});}});}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x3ac859,null))[_0xcaa7('0x28')](handleError(_0x3ac859,null));};exports['getAgents']=function(_0x456fb5,_0x2add4b,_0x440638){var _0x2d0fab={};var _0x2c82b5={};var _0x40664f;var _0x318c5b;return db[_0xcaa7('0x3e')]['findOne']({'where':{'id':_0x456fb5['params']['id']}})['then'](handleEntityNotFound(_0x2add4b,null))[_0xcaa7('0x1f')](function(_0x3f11de){if(_0x3f11de){_0x40664f=_0x3f11de;_0x2c82b5[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x9c')][_0xcaa7('0x57')]);_0x2c82b5[_0xcaa7('0x42')]=_['keys'](_0x456fb5[_0xcaa7('0x42')]);_0x2c82b5[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2c82b5['model'],_0x2c82b5[_0xcaa7('0x42')]);_0x2d0fab[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2c82b5[_0xcaa7('0x45')],qs['fields'](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x2d0fab[_0xcaa7('0x46')]=_0x2d0fab[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x2d0fab[_0xcaa7('0x46')]:_0x2c82b5[_0xcaa7('0x45')];_0x2d0fab[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x2d0fab[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x456fb5['query'],_0x2c82b5[_0xcaa7('0x43')]));if(_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x2d0fab[_0xcaa7('0x4d')]=_['merge'](_0x2d0fab[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x2d0fab[_0xcaa7('0x46')],function(_0x2bb8b7){var _0x5601bc={};_0x5601bc[_0x2bb8b7]={'$like':'%'+_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x5601bc;})});}_0x2d0fab=_['merge']({},_0x2d0fab,_0x456fb5[_0xcaa7('0x50')]);return _0x40664f[_0xcaa7('0xbb')](_0x2d0fab);}})[_0xcaa7('0x1f')](function(_0x25737b){if(_0x25737b){_0x318c5b=_0x25737b[_0xcaa7('0x48')];if(!_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x2d0fab[_0xcaa7('0x2f')]=qs[_0xcaa7('0x2f')](_0x456fb5[_0xcaa7('0x42')]['limit']);_0x2d0fab['offset']=qs[_0xcaa7('0x2d')](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}return _0x40664f['getAgents'](_0x2d0fab);}})[_0xcaa7('0x1f')](function(_0x1bbc97){if(_0x1bbc97){return _0x1bbc97?{'count':_0x318c5b,'rows':_0x1bbc97}:null;}})[_0xcaa7('0x1f')](respondWithResult(_0x2add4b,null))[_0xcaa7('0x28')](handleError(_0x2add4b,null));};exports[_0xcaa7('0x3b')]=function(_0x3e5ad3,_0x5a5da9,_0x5ca1a7){var _0x33dcd9,_0x8c4e20,_0x3d70c3;if(_[_0xcaa7('0x78')](_0x3e5ad3[_0xcaa7('0x62')][_0xcaa7('0x62')])||_0x3e5ad3['body'][_0xcaa7('0x62')]===''){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7a'));}if(_[_0xcaa7('0x78')](_0x3e5ad3[_0xcaa7('0x62')]['to'])){}_0x33dcd9=_0x3e5ad3[_0xcaa7('0x62')]['to'];return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x3e5ad3[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a5da9,null))[_0xcaa7('0x1f')](function(_0x5d4d29){if(_0x5d4d29){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x5d4d29['id']},'include':[{'model':db[_0xcaa7('0x7f')],'as':_0xcaa7('0x80'),'include':[{'model':db[_0xcaa7('0x70')],'as':_0xcaa7('0x81'),'where':{[_0x5d4d29[_0xcaa7('0x7b')]]:_0x33dcd9},'limit':0x1,'order':[[_0xcaa7('0x76'),_0xcaa7('0x82')]]}]}]})['then'](handleEntityNotFound(_0x5a5da9,null))['then'](function(_0x51607b){if(_0x51607b&&_0x51607b[_0xcaa7('0x80')]){_0x8c4e20=_0x51607b[_0xcaa7('0x37')]({'plain':!![]});if(_0x8c4e20['List']&&_0x8c4e20[_0xcaa7('0x80')]['Contacts']['length']){return _0x8c4e20[_0xcaa7('0x80')]['Contacts'][0x0];}return db[_0xcaa7('0x70')][_0xcaa7('0x5a')](_[_0xcaa7('0x16')](_0x3e5ad3[_0xcaa7('0x62')],{'firstName':_0x33dcd9,[_0x51607b[_0xcaa7('0x7b')]]:_0x33dcd9,'phone':_0x33dcd9,'ListId':_0x8c4e20[_0xcaa7('0x77')]}));}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x5a5da9,null))[_0xcaa7('0x1f')](function(_0x58c58e){if(_0x58c58e){_0x3d70c3=_0x58c58e;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x3d70c3['id'],'closed':![],'OpenchannelAccountId':_0x8c4e20['id']}})[_0xcaa7('0x1f')](function(_0x39715c){if(_0x39715c){return[_0x39715c,![]];}return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')]({'UserId':_0x3e5ad3[_0xcaa7('0x5c')]['id'],'ContactId':_0x3d70c3['id'],'OpenchannelAccountId':_0x8c4e20['id'],'lastMsgDirection':_0xcaa7('0xbc'),'firstMsgDirection':'out','Messages':[_[_0xcaa7('0x58')](_0x3e5ad3[_0xcaa7('0x62')],{'read':![],'body':_0x3e5ad3[_0xcaa7('0x62')][_0xcaa7('0x62')],'OpenchannelAccountId':_0x8c4e20['id'],'UserId':_0x3e5ad3['user']['id'],'ContactId':_0x3d70c3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xcaa7('0xbd')}]})[_0xcaa7('0x1f')](function(_0x5d6cc1){return[_0x5d6cc1,!![]];});});}})[_0xcaa7('0x90')](function(_0x4e7c4b,_0x1e33b2){if(_0x1e33b2){return _0x4e7c4b;}return db[_0xcaa7('0x99')][_0xcaa7('0x5a')](_[_0xcaa7('0x58')](_0x3e5ad3[_0xcaa7('0x62')],{'read':![],'body':_0x3e5ad3['body'][_0xcaa7('0x62')],'OpenchannelAccountId':_0x8c4e20['id'],'OpenchannelInteractionId':_0x4e7c4b['id'],'UserId':_0x3e5ad3[_0xcaa7('0x5c')]['id'],'ContactId':_0x3d70c3['id']}))[_0xcaa7('0x1f')](function(_0x2bb239){_0x4e7c4b[_0xcaa7('0xbe')][_0xcaa7('0xbd')]=[];_0x4e7c4b[_0xcaa7('0xbe')]['Messages'][_0xcaa7('0x95')](_0x2bb239[_0xcaa7('0xbe')]);return _0x4e7c4b;});});}})['then'](respondWithResult(_0x5a5da9,null))[_0xcaa7('0x28')](handleError(_0x5a5da9,null));}; \ No newline at end of file +var _0x27c7=['no\x20available\x20attributes','difference','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','List','Contacts','DESC','OpenchannelApplication','account','Applications','list','applications','priority','asc','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','OpenchannelMessage','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','set','apply','reject','save','then','get','OpenchannelAccounts','UserProfileResource','end','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','name','options','include','findAll','rows','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','destroy','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','notify','openchannel','CmContact','Sequelize','ValidationError'];(function(_0x2d6330,_0x2e2ea0){var _0x202683=function(_0x28ccb9){while(--_0x28ccb9){_0x2d6330['push'](_0x2d6330['shift']());}};_0x202683(++_0x2e2ea0);}(_0x27c7,0x10d));var _0x727c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x27c7[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x727c('0x0'));var rimraf=require(_0x727c('0x1'));var zipdir=require(_0x727c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x727c('0x3'));var moment=require(_0x727c('0x4'));var BPromise=require(_0x727c('0x5'));var Mustache=require('mustache');var util=require(_0x727c('0x6'));var path=require(_0x727c('0x7'));var sox=require(_0x727c('0x8'));var csv=require(_0x727c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x727c('0xa'));var _=require(_0x727c('0xb'));var squel=require(_0x727c('0xc'));var crypto=require(_0x727c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x727c('0xe'));var toCsv=require(_0x727c('0x9'));var querystring=require(_0x727c('0xf'));var Papa=require('papaparse');var Redis=require(_0x727c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x727c('0x11'));var as=require(_0x727c('0x12'));var hardwareService=require(_0x727c('0x13'));var logger=require('../../config/logger')(_0x727c('0x14'));var utils=require(_0x727c('0x15'));var config=require(_0x727c('0x16'));var licenseUtil=require(_0x727c('0x17'));var db=require('../../mysqldb')['db'];config[_0x727c('0x18')]=_[_0x727c('0x19')](config['redis'],{'host':_0x727c('0x1a'),'port':0x18eb});var socket=require(_0x727c('0x1b'))(new Redis(config[_0x727c('0x18')]));require('./openchannelAccount.socket')[_0x727c('0x1c')](socket);var jayson=require(_0x727c('0x1d'));var client=jayson[_0x727c('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x727c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x91a581,_0x52e9f0,_0xf8729d,_0x88d8a7){return new BPromise(function(_0x1633e8,_0x41d96a){var _0x473998=_0x88d8a7||client;return _0x473998[_0x727c('0x20')](_0x91a581,_0xf8729d)['then'](function(_0x3a68bd){logger[_0x727c('0x21')](_0x727c('0x22'),_0x52e9f0,_0x727c('0x23'));logger[_0x727c('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x52e9f0,_0x727c('0x23'),JSON['stringify'](_0x3a68bd));if(_0x3a68bd[_0x727c('0x25')]){if(_0x3a68bd[_0x727c('0x25')][_0x727c('0x26')]===0x1f4){logger[_0x727c('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x52e9f0,_0x3a68bd[_0x727c('0x25')][_0x727c('0x27')]);return _0x41d96a(_0x3a68bd['error'][_0x727c('0x27')]);}logger['error'](_0x727c('0x22'),_0x52e9f0,_0x3a68bd[_0x727c('0x25')][_0x727c('0x27')]);return _0x1633e8(_0x3a68bd[_0x727c('0x25')][_0x727c('0x27')]);}else{logger[_0x727c('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x52e9f0,_0x727c('0x23'));_0x1633e8(_0x3a68bd[_0x727c('0x28')][_0x727c('0x27')]);}})[_0x727c('0x29')](function(_0x32c5d5){logger[_0x727c('0x25')](_0x727c('0x22'),_0x52e9f0,_0x32c5d5);_0x41d96a(_0x32c5d5);});});}function respondWithStatusCode(_0x1c78a6,_0x1ca28c){_0x1ca28c=_0x1ca28c||0xcc;return function(_0x38a65d){if(_0x38a65d){return _0x1c78a6[_0x727c('0x2a')](_0x1ca28c);}return _0x1c78a6[_0x727c('0x2b')](_0x1ca28c)['end']();};}function respondWithResult(_0x4da3e6,_0x413685){_0x413685=_0x413685||0xc8;return function(_0x57e975){if(_0x57e975){return _0x4da3e6['status'](_0x413685)[_0x727c('0x2c')](_0x57e975);}};}function respondWithFilteredResult(_0x55e6af,_0x3609b0){return function(_0x38d7d7){if(_0x38d7d7){var _0x29f8db=typeof _0x3609b0['offset']==='undefined'&&typeof _0x3609b0['limit']===_0x727c('0x2d');var _0x38f0a7=_0x38d7d7[_0x727c('0x2e')];var _0x50b999=_0x29f8db?0x0:_0x3609b0[_0x727c('0x2f')];var _0xc17b0c=_0x29f8db?_0x38d7d7[_0x727c('0x2e')]:_0x3609b0[_0x727c('0x2f')]+_0x3609b0['limit'];var _0x4eb55c;if(_0xc17b0c>=_0x38f0a7){_0xc17b0c=_0x38f0a7;_0x4eb55c=0xc8;}else{_0x4eb55c=0xce;}_0x55e6af[_0x727c('0x2b')](_0x4eb55c);return _0x55e6af[_0x727c('0x30')]('Content-Range',_0x50b999+'-'+_0xc17b0c+'/'+_0x38f0a7)[_0x727c('0x2c')](_0x38d7d7);}return null;};}function patchUpdates(_0x46a14a){return function(_0x171834){try{jsonpatch[_0x727c('0x31')](_0x171834,_0x46a14a,!![]);}catch(_0x153b3a){return BPromise[_0x727c('0x32')](_0x153b3a);}return _0x171834[_0x727c('0x33')]();};}function saveUpdates(_0x3a0a0a,_0x2734b2){return function(_0x5d815f){if(_0x5d815f){return _0x5d815f['update'](_0x3a0a0a)[_0x727c('0x34')](function(_0x324421){return _0x324421;});}return null;};}function removeEntity(_0x1de344,_0x75c867){return function(_0x5a9cf0){if(_0x5a9cf0){return _0x5a9cf0['destroy']()[_0x727c('0x34')](function(){var _0x113679=_0x5a9cf0[_0x727c('0x35')]({'plain':!![]});var _0x5911bd=_0x727c('0x36');return db[_0x727c('0x37')]['destroy']({'where':{'type':_0x5911bd,'resourceId':_0x113679['id']}})[_0x727c('0x34')](function(){return _0x5a9cf0;});})[_0x727c('0x34')](function(){_0x1de344[_0x727c('0x2b')](0xcc)[_0x727c('0x38')]();});}};}function handleEntityNotFound(_0x27de7a,_0x89174e){return function(_0x283f24){if(!_0x283f24){_0x27de7a['sendStatus'](0x194);}return _0x283f24;};}function handleError(_0x3f5671,_0x5429b7){_0x5429b7=_0x5429b7||0x1f4;return function(_0x357ad9){logger[_0x727c('0x25')](_0x357ad9[_0x727c('0x39')]);if(_0x357ad9['name']){delete _0x357ad9['name'];}_0x3f5671[_0x727c('0x2b')](_0x5429b7)[_0x727c('0x3a')](_0x357ad9);};}exports[_0x727c('0x3b')]=function(_0x5b959a,_0x5d4f55){var _0xc0ca41={'include':[{'model':db[_0x727c('0x3c')],'as':_0x727c('0x3d')}]},_0x398f5d={},_0x4a6739={'count':0x0,'rows':[]};var _0x3309d3=_[_0x727c('0x3e')](db[_0x727c('0x3f')][_0x727c('0x40')],function(_0x5b6f9d){return{'name':_0x5b6f9d[_0x727c('0x41')],'type':_0x5b6f9d[_0x727c('0x42')]['key']};});_0x398f5d[_0x727c('0x43')]=_['map'](_0x3309d3,'name');_0x398f5d[_0x727c('0x44')]=_[_0x727c('0x45')](_0x5b959a[_0x727c('0x44')]);_0x398f5d[_0x727c('0x46')]=_['intersection'](_0x398f5d['model'],_0x398f5d[_0x727c('0x44')]);_0xc0ca41[_0x727c('0x47')]=_[_0x727c('0x48')](_0x398f5d[_0x727c('0x43')],qs[_0x727c('0x49')](_0x5b959a[_0x727c('0x44')][_0x727c('0x49')]));_0xc0ca41[_0x727c('0x47')]=_0xc0ca41[_0x727c('0x47')][_0x727c('0x4a')]?_0xc0ca41['attributes']:_0x398f5d[_0x727c('0x43')];if(!_0x5b959a['query'][_0x727c('0x4b')](_0x727c('0x4c'))){_0xc0ca41[_0x727c('0x4d')]=qs['limit'](_0x5b959a[_0x727c('0x44')][_0x727c('0x4d')]);_0xc0ca41['offset']=qs['offset'](_0x5b959a[_0x727c('0x44')][_0x727c('0x2f')]);}_0xc0ca41[_0x727c('0x4e')]=qs[_0x727c('0x4f')](_0x5b959a[_0x727c('0x44')][_0x727c('0x4f')]);_0xc0ca41[_0x727c('0x50')]=qs[_0x727c('0x46')](_['pick'](_0x5b959a['query'],_0x398f5d[_0x727c('0x46')]),_0x3309d3);if(_0x5b959a[_0x727c('0x44')][_0x727c('0x51')]){_0xc0ca41[_0x727c('0x50')]=_[_0x727c('0x52')](_0xc0ca41['where'],{'$or':_['map'](_0x3309d3,function(_0x20bf4e){if(_0x20bf4e[_0x727c('0x42')]!==_0x727c('0x53')){var _0x455292={};_0x455292[_0x20bf4e[_0x727c('0x54')]]={'$like':'%'+_0x5b959a[_0x727c('0x44')]['filter']+'%'};return _0x455292;}})});}_0xc0ca41=_[_0x727c('0x52')]({},_0xc0ca41,_0x5b959a[_0x727c('0x55')]);var _0x49b294={'where':_0xc0ca41['where']};return db[_0x727c('0x3f')]['count'](_0x49b294)[_0x727c('0x34')](function(_0x323e72){_0x4a6739[_0x727c('0x2e')]=_0x323e72;if(_0x5b959a[_0x727c('0x44')]['includeAll']){_0xc0ca41[_0x727c('0x56')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x727c('0x57')](_0xc0ca41);})[_0x727c('0x34')](function(_0x2c62f0){_0x4a6739[_0x727c('0x58')]=_0x2c62f0;return _0x4a6739;})['then'](respondWithFilteredResult(_0x5d4f55,_0xc0ca41))[_0x727c('0x29')](handleError(_0x5d4f55,null));};exports[_0x727c('0x59')]=function(_0x2b0ae6,_0x4420f3){var _0x42f8c1={'raw':![],'where':{'id':_0x2b0ae6[_0x727c('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x727c('0x3d')}]},_0x3ec73b={};_0x3ec73b[_0x727c('0x43')]=_[_0x727c('0x45')](db[_0x727c('0x3f')][_0x727c('0x40')]);_0x3ec73b['query']=_[_0x727c('0x45')](_0x2b0ae6[_0x727c('0x44')]);_0x3ec73b[_0x727c('0x46')]=_['intersection'](_0x3ec73b[_0x727c('0x43')],_0x3ec73b[_0x727c('0x44')]);_0x42f8c1['attributes']=_[_0x727c('0x48')](_0x3ec73b[_0x727c('0x43')],qs[_0x727c('0x49')](_0x2b0ae6[_0x727c('0x44')]['fields']));_0x42f8c1['attributes']=_0x42f8c1[_0x727c('0x47')]['length']?_0x42f8c1[_0x727c('0x47')]:_0x3ec73b[_0x727c('0x43')];if(_0x2b0ae6[_0x727c('0x44')][_0x727c('0x5b')]){_0x42f8c1[_0x727c('0x56')]=[{'all':!![]}];}_0x42f8c1=_[_0x727c('0x52')]({},_0x42f8c1,_0x2b0ae6[_0x727c('0x55')]);return db[_0x727c('0x3f')][_0x727c('0x5c')](_0x42f8c1)['then'](handleEntityNotFound(_0x4420f3,null))['then'](respondWithResult(_0x4420f3,null))[_0x727c('0x29')](handleError(_0x4420f3,null));};exports['create']=function(_0x1889d1,_0x494898){return db['OpenchannelAccount'][_0x727c('0x5d')](_0x1889d1['body'],{})[_0x727c('0x34')](function(_0x2e9ff0){var _0xa68f0e=_0x1889d1[_0x727c('0x5e')][_0x727c('0x35')]({'plain':!![]});if(!_0xa68f0e)throw new Error(_0x727c('0x5f'));if(_0xa68f0e[_0x727c('0x60')]==='user'){var _0x776690=_0x2e9ff0['get']({'plain':!![]});var _0x4223f0=_0x727c('0x36');return db[_0x727c('0x61')]['find']({'where':{'name':_0x4223f0,'userProfileId':_0xa68f0e[_0x727c('0x62')]},'raw':!![]})[_0x727c('0x34')](function(_0x422df2){if(_0x422df2&&_0x422df2[_0x727c('0x63')]===0x0){return db[_0x727c('0x37')][_0x727c('0x5d')]({'name':_0x776690['name'],'resourceId':_0x776690['id'],'type':_0x422df2[_0x727c('0x54')],'sectionId':_0x422df2['id']},{})['then'](function(){return _0x2e9ff0;});}else{return _0x2e9ff0;}})[_0x727c('0x29')](function(_0x4a63a4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a63a4);throw _0x4a63a4;});}return _0x2e9ff0;})[_0x727c('0x34')](respondWithResult(_0x494898,0xc9))[_0x727c('0x29')](handleError(_0x494898,null));};exports[_0x727c('0x64')]=function(_0x3bf31b,_0x3b4cad){if(_0x3bf31b[_0x727c('0x65')]['id']){delete _0x3bf31b[_0x727c('0x65')]['id'];}return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x3bf31b[_0x727c('0x5a')]['id']},'include':[{'model':db[_0x727c('0x3c')],'as':_0x727c('0x3d')}]})[_0x727c('0x34')](handleEntityNotFound(_0x3b4cad,null))[_0x727c('0x34')](saveUpdates(_0x3bf31b[_0x727c('0x65')],null))['then'](respondWithResult(_0x3b4cad,null))[_0x727c('0x29')](handleError(_0x3b4cad,null));};exports[_0x727c('0x66')]=function(_0x1a3bc4,_0x253584){return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x1a3bc4[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x253584,null))[_0x727c('0x34')](removeEntity(_0x253584,null))[_0x727c('0x29')](handleError(_0x253584,null));};exports[_0x727c('0x67')]=function(_0x467591,_0xbb8d5e){return db[_0x727c('0x3f')][_0x727c('0x67')]()['then'](respondWithResult(_0xbb8d5e,null))['catch'](handleError(_0xbb8d5e,null));};exports['addDisposition']=function(_0x383575,_0x1a559c,_0x1072df){if(_0x383575['body']['id']){delete _0x383575[_0x727c('0x65')]['id'];}return db['OpenchannelAccount'][_0x727c('0x5c')]({'where':{'id':_0x383575[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x1a559c,null))['then'](function(_0x350ec6){if(_0x350ec6){_0x383575[_0x727c('0x65')][_0x727c('0x68')]=_0x350ec6['id'];return db[_0x727c('0x69')][_0x727c('0x5d')](_0x383575[_0x727c('0x65')]);}})[_0x727c('0x34')](respondWithResult(_0x1a559c,null))[_0x727c('0x29')](handleError(_0x1a559c,null));};exports[_0x727c('0x6a')]=function(_0x40ab54,_0x4809d8,_0x46dac6){var _0x25218a={'raw':![],'where':{}};var _0x42a31d={};var _0xfadcee={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x727c('0x6b')]({'where':{'id':_0x40ab54[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x4809d8,null))[_0x727c('0x34')](function(_0x3760e1){if(_0x3760e1){_0x42a31d[_0x727c('0x43')]=_['keys'](db[_0x727c('0x69')][_0x727c('0x40')]);_0x42a31d[_0x727c('0x44')]=_[_0x727c('0x45')](_0x40ab54[_0x727c('0x44')]);_0x42a31d['filters']=_[_0x727c('0x48')](_0x42a31d[_0x727c('0x43')],_0x42a31d['query']);_0x25218a[_0x727c('0x47')]=_[_0x727c('0x48')](_0x42a31d[_0x727c('0x43')],qs['fields'](_0x40ab54[_0x727c('0x44')][_0x727c('0x49')]));_0x25218a[_0x727c('0x47')]=_0x25218a[_0x727c('0x47')][_0x727c('0x4a')]?_0x25218a['attributes']:_0x42a31d[_0x727c('0x43')];if(!_0x40ab54['query'][_0x727c('0x4b')]('nolimit')){_0x25218a[_0x727c('0x4d')]=qs[_0x727c('0x4d')](_0x40ab54[_0x727c('0x44')][_0x727c('0x4d')]);_0x25218a[_0x727c('0x2f')]=qs[_0x727c('0x2f')](_0x40ab54[_0x727c('0x44')]['offset']);}_0x25218a[_0x727c('0x4e')]=qs[_0x727c('0x4f')](_0x40ab54[_0x727c('0x44')]['sort']);_0x25218a[_0x727c('0x50')]=qs[_0x727c('0x46')](_['pick'](_0x40ab54[_0x727c('0x44')],_0x42a31d[_0x727c('0x46')]));_0x25218a[_0x727c('0x50')][_0x727c('0x68')]=_0x3760e1['id'];if(_0x40ab54[_0x727c('0x44')][_0x727c('0x51')]){_0x25218a[_0x727c('0x50')]=_['merge'](_0x25218a[_0x727c('0x50')],{'$or':_[_0x727c('0x3e')](_0x25218a['attributes'],function(_0xd5d550){var _0x537171={};_0x537171[_0xd5d550]={'$like':'%'+_0x40ab54[_0x727c('0x44')][_0x727c('0x51')]+'%'};return _0x537171;})});}_0x25218a=_[_0x727c('0x52')]({},_0x25218a,_0x40ab54[_0x727c('0x55')]);return db['Disposition'][_0x727c('0x2e')]({'where':_0x25218a['where']})[_0x727c('0x34')](function(_0x508470){_0xfadcee[_0x727c('0x2e')]=_0x508470;if(_0x40ab54[_0x727c('0x44')]['includeAll']){_0x25218a[_0x727c('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x727c('0x57')](_0x25218a);})[_0x727c('0x34')](function(_0x2dc2b0){_0xfadcee[_0x727c('0x58')]=_0x2dc2b0;return _0xfadcee;});}})['then'](respondWithFilteredResult(_0x4809d8,_0x25218a))['catch'](handleError(_0x4809d8,null));};exports[_0x727c('0x6c')]=function(_0x59d940,_0x136855,_0x21eea3){return db['OpenchannelAccount']['find']({'where':{'id':_0x59d940[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x136855,null))[_0x727c('0x34')](function(_0x25d5f8){if(_0x25d5f8){return _0x25d5f8[_0x727c('0x6c')](_0x59d940[_0x727c('0x44')][_0x727c('0x6d')]);}})['then'](respondWithStatusCode(_0x136855,null))[_0x727c('0x29')](handleError(_0x136855,null));};exports[_0x727c('0x6e')]=function(_0x5b7f48,_0x3ef287,_0x331cd8){if(_0x5b7f48['body']['id']){delete _0x5b7f48['body']['id'];}return db[_0x727c('0x3f')]['find']({'where':{'id':_0x5b7f48[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x3ef287,null))[_0x727c('0x34')](function(_0x1daf73){if(_0x1daf73){_0x5b7f48['body'][_0x727c('0x68')]=_0x1daf73['id'];return db[_0x727c('0x6f')][_0x727c('0x5d')](_0x5b7f48[_0x727c('0x65')]);}})[_0x727c('0x34')](respondWithResult(_0x3ef287,null))['catch'](handleError(_0x3ef287,null));};exports[_0x727c('0x70')]=function(_0x77dcfa,_0x4d3427,_0x46ea7d){var _0x3e1662={'raw':![],'where':{}};var _0x29ea5b={};var _0x15ca91={'count':0x0,'rows':[]};return db[_0x727c('0x3f')][_0x727c('0x6b')]({'where':{'id':_0x77dcfa['params']['id']}})['then'](handleEntityNotFound(_0x4d3427,null))[_0x727c('0x34')](function(_0x5d9b83){if(_0x5d9b83){_0x29ea5b[_0x727c('0x43')]=_['keys'](db[_0x727c('0x6f')][_0x727c('0x40')]);_0x29ea5b[_0x727c('0x44')]=_[_0x727c('0x45')](_0x77dcfa['query']);_0x29ea5b[_0x727c('0x46')]=_[_0x727c('0x48')](_0x29ea5b[_0x727c('0x43')],_0x29ea5b['query']);_0x3e1662[_0x727c('0x47')]=_['intersection'](_0x29ea5b['model'],qs['fields'](_0x77dcfa[_0x727c('0x44')][_0x727c('0x49')]));_0x3e1662[_0x727c('0x47')]=_0x3e1662[_0x727c('0x47')]['length']?_0x3e1662[_0x727c('0x47')]:_0x29ea5b[_0x727c('0x43')];if(!_0x77dcfa[_0x727c('0x44')][_0x727c('0x4b')]('nolimit')){_0x3e1662[_0x727c('0x4d')]=qs[_0x727c('0x4d')](_0x77dcfa[_0x727c('0x44')]['limit']);_0x3e1662[_0x727c('0x2f')]=qs[_0x727c('0x2f')](_0x77dcfa[_0x727c('0x44')]['offset']);}_0x3e1662[_0x727c('0x4e')]=qs['sort'](_0x77dcfa['query'][_0x727c('0x4f')]);_0x3e1662['where']=qs[_0x727c('0x46')](_[_0x727c('0x71')](_0x77dcfa['query'],_0x29ea5b[_0x727c('0x46')]));_0x3e1662[_0x727c('0x50')][_0x727c('0x68')]=_0x5d9b83['id'];if(_0x77dcfa[_0x727c('0x44')]['filter']){_0x3e1662[_0x727c('0x50')]=_['merge'](_0x3e1662[_0x727c('0x50')],{'$or':_['map'](_0x3e1662[_0x727c('0x47')],function(_0x13b19a){var _0x59debd={};_0x59debd[_0x13b19a]={'$like':'%'+_0x77dcfa[_0x727c('0x44')]['filter']+'%'};return _0x59debd;})});}_0x3e1662=_[_0x727c('0x52')]({},_0x3e1662,_0x77dcfa[_0x727c('0x55')]);return db['CannedAnswer'][_0x727c('0x2e')]({'where':_0x3e1662[_0x727c('0x50')]})['then'](function(_0x24ea7a){_0x15ca91[_0x727c('0x2e')]=_0x24ea7a;if(_0x77dcfa['query']['includeAll']){_0x3e1662[_0x727c('0x56')]=[{'all':!![]}];}return db[_0x727c('0x6f')][_0x727c('0x57')](_0x3e1662);})[_0x727c('0x34')](function(_0x5ce070){_0x15ca91[_0x727c('0x58')]=_0x5ce070;return _0x15ca91;});}})[_0x727c('0x34')](respondWithFilteredResult(_0x4d3427,_0x3e1662))[_0x727c('0x29')](handleError(_0x4d3427,null));};exports['removeAnswers']=function(_0x7b0e5f,_0x544a6e,_0x4c486a){return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x7b0e5f[_0x727c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x544a6e,null))[_0x727c('0x34')](function(_0x3b0175){if(_0x3b0175){return _0x3b0175['removeAnswers'](_0x7b0e5f[_0x727c('0x44')][_0x727c('0x6d')]);}})['then'](respondWithStatusCode(_0x544a6e,null))[_0x727c('0x29')](handleError(_0x544a6e,null));};exports[_0x727c('0x72')]=function(_0x13e284,_0x23dbcf,_0x106211){var _0x306c76={'body':_0x13e284['body'],'channel':_0x727c('0x73')};var _0x1aeeb1=[];var _0x2c941e=[];var _0x4fa334={};var _0x3432f9=![];return db[_0x727c('0x74')][_0x727c('0x67')]()[_0x727c('0x34')](function(_0x2e933e){if(!_0x2e933e){throw new db[(_0x727c('0x75'))][(_0x727c('0x76'))](_0x727c('0x77'));}_0x1aeeb1=_[_0x727c('0x78')](_[_0x727c('0x45')](_0x2e933e),[_0x727c('0x79'),_0x727c('0x7a')]);_0x2c941e=_[_0x727c('0x78')](_['keys'](_0x2e933e),[_0x727c('0x79'),_0x727c('0x7a'),_0x727c('0x7b'),_0x727c('0x7c')]);if(_0x13e284[_0x727c('0x65')]['id']){delete _0x13e284[_0x727c('0x65')]['id'];}if(_[_0x727c('0x7d')](_0x13e284[_0x727c('0x65')][_0x727c('0x7e')])){throw new db[(_0x727c('0x75'))]['ValidationError'](_0x727c('0x7f'));}if(_['isNil'](_0x13e284[_0x727c('0x65')][_0x727c('0x65')])||_0x13e284['body'][_0x727c('0x65')]===''){throw new db[(_0x727c('0x75'))][(_0x727c('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x727c('0x7d')](_0x13e284[_0x727c('0x65')][_0x727c('0x80')])){throw new db[(_0x727c('0x75'))][(_0x727c('0x76'))](_0x727c('0x81')+_0x2c941e);}if(!_[_0x727c('0x82')](_0x2c941e,_0x13e284[_0x727c('0x65')][_0x727c('0x80')])){throw new db['Sequelize'][(_0x727c('0x76'))](_0x727c('0x83')+_0x2c941e);}_0x4fa334[_0x13e284[_0x727c('0x65')]['mapKey']]=_0x13e284[_0x727c('0x65')][_0x727c('0x7e')];})['then'](function(){return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x13e284[_0x727c('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x727c('0x84'),'include':[{'model':db['CmContact'],'as':_0x727c('0x85'),'where':_0x4fa334,'limit':0x1,'order':[['updatedAt',_0x727c('0x86')]]}]},{'model':db[_0x727c('0x87')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x23dbcf,null))[_0x727c('0x34')](function(_0x4439cc){if(_0x4439cc&&_0x4439cc[_0x727c('0x84')]){_0x306c76[_0x727c('0x88')]=_0x4439cc;_0x306c76['applications']=_0x4439cc[_0x727c('0x89')];_0x306c76[_0x727c('0x8a')]=_0x4439cc[_0x727c('0x84')];_0x306c76[_0x727c('0x8b')]=_['orderBy'](_0x306c76['applications'],[_0x727c('0x8c')],[_0x727c('0x8d')]);if(_0x306c76[_0x727c('0x88')][_0x727c('0x89')]){delete _0x306c76[_0x727c('0x88')]['Applications'];}if(_0x306c76[_0x727c('0x88')][_0x727c('0x84')]&&_0x306c76[_0x727c('0x88')]['List']['Contacts']['length']){return _0x306c76[_0x727c('0x88')][_0x727c('0x84')][_0x727c('0x85')][0x0];}var _0x228148=_[_0x727c('0x19')](_0x13e284[_0x727c('0x65')],{'firstName':_0x13e284[_0x727c('0x65')]['from'],'ListId':_0x4439cc['ListId']});_0x228148[_0x13e284['body']['mapKey']]=_0x13e284[_0x727c('0x65')][_0x727c('0x7e')];return db[_0x727c('0x74')][_0x727c('0x5d')](_0x228148,{'fields':_0x1aeeb1,'raw':!![]});}})[_0x727c('0x34')](handleEntityNotFound(_0x23dbcf,null))[_0x727c('0x34')](function(_0x32d338){_0x306c76[_0x727c('0x8e')]=_0x32d338;if(_0x32d338){var _0x466286={'ContactId':_0x32d338['id'],'OpenchannelAccountId':_0x13e284['params']['id'],'from':(_0x32d338[_0x727c('0x8f')]||'')+'\x20'+(_0x32d338[_0x727c('0x90')]||'')};var _0x4900af={'OpenchannelAccountId':_0x13e284[_0x727c('0x5a')]['id'],'closed':![]};if(_0x13e284[_0x727c('0x65')][_0x727c('0x91')]){_0x4900af['threadId']=_0x13e284[_0x727c('0x65')][_0x727c('0x91')];return db['OpenchannelInteraction'][_0x727c('0x5c')]({'where':_0x4900af})['then'](function(_0x46eb1d){if(_0x46eb1d){return[_0x46eb1d,![]];}_0x466286['threadId']=_0x13e284[_0x727c('0x65')][_0x727c('0x91')];_0x466286[_0x727c('0x92')]=_0x13e284['body'][_0x727c('0x92')];return db['OpenchannelInteraction']['create'](_0x466286)[_0x727c('0x34')](function(_0x4dfd44){return[_0x4dfd44,!![]];});});}else{_0x4900af[_0x727c('0x91')]=null;}_0x4900af[_0x727c('0x93')]=_0x32d338['id'];return db[_0x727c('0x94')][_0x727c('0x5c')]({'where':_0x4900af})['then'](function(_0x1ba194){if(_0x1ba194){return[_0x1ba194,![]];}return db[_0x727c('0x94')][_0x727c('0x5d')](_0x466286)[_0x727c('0x34')](function(_0x465447){return[_0x465447,!![]];});});}})[_0x727c('0x95')](function(_0x5b4668,_0x1e4bc0){if(_0x5b4668){_0x3432f9=_0x1e4bc0;if(!_0x1e4bc0){var _0x4871d6={'from':(_0x306c76[_0x727c('0x8e')][_0x727c('0x8f')]||'')+'\x20'+(_0x306c76[_0x727c('0x8e')]['lastName']||'')};if(_0x13e284[_0x727c('0x65')][_0x727c('0x91')]&&_0x13e284['body'][_0x727c('0x96')]&&_0x13e284[_0x727c('0x65')][_0x727c('0x91')]!=_0x13e284[_0x727c('0x65')]['messageId']){_0x4871d6[_0x727c('0x91')]=_0x13e284['body']['messageId'];}return _0x5b4668['update'](_0x4871d6);}else{return _0x5b4668;}}})[_0x727c('0x34')](function(_0x2a7bb5){_0x306c76[_0x727c('0x97')]=_0x2a7bb5['get']({'plain':!![]});_0x306c76[_0x727c('0x97')][_0x727c('0x98')]=_0x3432f9;if(_0x306c76[_0x727c('0x97')][_0x727c('0x98')]){if(_0x306c76[_0x727c('0x88')][_0x727c('0x99')]){_0x306c76[_0x727c('0x8b')][_0x727c('0x9a')]({'id':0x0,'priority':_0x306c76['applications'][_0x727c('0x4a')]+0x1,'app':_0x727c('0x9b'),'appdata':_0x727c('0x9c'),'interval':_0x727c('0x9d')});}}return db['OpenchannelMessage']['create']({'body':_0x13e284['body'][_0x727c('0x65')],'OpenchannelAccountId':_0x13e284[_0x727c('0x5a')]['id'],'OpenchannelInteractionId':_0x2a7bb5['id'],'direction':'in','ContactId':_0x306c76[_0x727c('0x8e')]['id'],'AttachmentId':_0x13e284[_0x727c('0x65')][_0x727c('0x9e')]});})[_0x727c('0x34')](function(_0x26873c){_0x306c76['message']=_0x26873c;if(_0x306c76[_0x727c('0x97')]['UserId']){return db['User'][_0x727c('0x5c')]({'attributes':['id','name'],'where':{'id':_0x306c76['interaction'][_0x727c('0x9f')]}})[_0x727c('0x34')](function(_0x327078){if(_0x327078){_0x306c76[_0x727c('0x8b')][_0x727c('0xa0')]({'id':0x0,'priority':0x0,'app':_0x727c('0xa1'),'appdata':_0x327078[_0x727c('0x54')]+','+(_0x306c76[_0x727c('0x88')][_0x727c('0xa2')]||0xa),'interval':_0x727c('0x9d')});_0x306c76['forcedOwnership']=![];}return respondWithRpcPromise(_0x727c('0xa3'),'startRouting',_0x306c76);});}return respondWithRpcPromise(_0x727c('0xa3'),'startRouting',_0x306c76);})[_0x727c('0x34')](function(_0x6f35df){respondWithRpcPromise(_0x727c('0xa4'),_0x727c('0xa4'),{'event':'notify','message':_0x6f35df},client9002);return _0x6f35df;})[_0x727c('0x34')](respondWithResult(_0x23dbcf,null))[_0x727c('0x29')](handleError(_0x23dbcf,null));};exports[_0x727c('0xa5')]=function(_0x40b1bf,_0x2b3d66){var _0x54db6e=_0x40b1bf[_0x727c('0x5a')]['id'];var _0x2e4ac9=_0x40b1bf['body'];var _0x50692c=0xc8;var _0x1df505=null;return db[_0x727c('0xa6')][_0x727c('0xa7')]({'isolationLevel':db['sequelize'][_0x727c('0xa8')][_0x727c('0xa9')][_0x727c('0xaa')]},function(_0x545edd){return db[_0x727c('0x3f')]['findOne']({'where':{'id':_0x54db6e},'transaction':_0x545edd})[_0x727c('0x34')](function(_0x274ea4){if(_0x274ea4){return db[_0x727c('0x87')][_0x727c('0x66')]({'where':{'OpenchannelAccountId':_0x54db6e},'transaction':_0x545edd})[_0x727c('0x34')](function(){var _0x6cb090=_[_0x727c('0x3e')](_0x2e4ac9,function(_0xd42cd9){_0xd42cd9[_0x727c('0x68')]=_0x54db6e;return _0xd42cd9;});return db['OpenchannelApplication'][_0x727c('0xab')](_0x6cb090,{'transaction':_0x545edd});});}else{_0x50692c=0x194;_0x1df505=[];}});})[_0x727c('0x34')](function(){if(_0x50692c!==0x194){return db[_0x727c('0x87')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x54db6e},'order':_0x727c('0x8c')})[_0x727c('0x34')](function(_0x341264){_0x1df505=_0x341264;});}})[_0x727c('0x29')](function(_0x506b43){_0x50692c=0x1f4;logger[_0x727c('0x25')](_0x506b43[_0x727c('0x39')]);if(_0x506b43[_0x727c('0x54')]){delete _0x506b43[_0x727c('0x54')];}_0x1df505=_0x506b43;})[_0x727c('0xac')](function(){if(_0x1df505===null){_0x2b3d66[_0x727c('0x2a')](_0x50692c);}else{if(_0x50692c===0x1f4){_0x2b3d66[_0x727c('0x2b')](_0x50692c)[_0x727c('0x3a')](_0x1df505);}else{_0x2b3d66[_0x727c('0x2b')](_0x50692c)['json'](_0x1df505);}}});};exports['getApplications']=function(_0x4b648c,_0x419781,_0x2c8ce4){var _0x4ee0db={};var _0x2e736c={};var _0x206070;var _0x327add;return db['OpenchannelAccount'][_0x727c('0x6b')]({'where':{'id':_0x4b648c[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x419781,null))[_0x727c('0x34')](function(_0xac2019){if(_0xac2019){_0x206070=_0xac2019;_0x2e736c[_0x727c('0x43')]=_['keys'](db[_0x727c('0x87')]['rawAttributes']);_0x2e736c[_0x727c('0x44')]=_[_0x727c('0x45')](_0x4b648c[_0x727c('0x44')]);_0x2e736c[_0x727c('0x46')]=_[_0x727c('0x48')](_0x2e736c[_0x727c('0x43')],_0x2e736c[_0x727c('0x44')]);_0x4ee0db[_0x727c('0x47')]=_[_0x727c('0x48')](_0x2e736c[_0x727c('0x43')],qs[_0x727c('0x49')](_0x4b648c[_0x727c('0x44')][_0x727c('0x49')]));_0x4ee0db[_0x727c('0x47')]=_0x4ee0db[_0x727c('0x47')][_0x727c('0x4a')]?_0x4ee0db['attributes']:_0x2e736c[_0x727c('0x43')];_0x4ee0db['order']=qs['sort'](_0x4b648c[_0x727c('0x44')][_0x727c('0x4f')]);_0x4ee0db['where']=qs[_0x727c('0x46')](_[_0x727c('0x71')](_0x4b648c[_0x727c('0x44')],_0x2e736c[_0x727c('0x46')]));if(_0x4b648c['query']['filter']){_0x4ee0db[_0x727c('0x50')]=_[_0x727c('0x52')](_0x4ee0db[_0x727c('0x50')],{'$or':_[_0x727c('0x3e')](_0x4ee0db[_0x727c('0x47')],function(_0x2a3e7e){var _0x1c1783={};_0x1c1783[_0x2a3e7e]={'$like':'%'+_0x4b648c['query'][_0x727c('0x51')]+'%'};return _0x1c1783;})});}_0x4ee0db=_['merge']({},_0x4ee0db,_0x4b648c['options']);return _0x206070[_0x727c('0xad')](_0x4ee0db);}})['then'](function(_0x582a98){if(_0x582a98){_0x327add=_0x582a98[_0x727c('0x4a')];if(!_0x4b648c[_0x727c('0x44')][_0x727c('0x4b')](_0x727c('0x4c'))){_0x4ee0db[_0x727c('0x4d')]=qs[_0x727c('0x4d')](_0x4b648c[_0x727c('0x44')][_0x727c('0x4d')]);_0x4ee0db['offset']=qs[_0x727c('0x2f')](_0x4b648c[_0x727c('0x44')]['offset']);}return _0x206070['getApplications'](_0x4ee0db);}})[_0x727c('0x34')](function(_0x360b86){if(_0x360b86){return _0x360b86?{'count':_0x327add,'rows':_0x360b86}:null;}})[_0x727c('0x34')](respondWithResult(_0x419781,null))['catch'](handleError(_0x419781,null));};exports[_0x727c('0xae')]=function(_0x160577,_0x5d7ad0,_0x5099a8){var _0x2a3253={'raw':![],'where':{}};var _0x408571={};var _0x1ccaa8={'count':0x0,'rows':[]};return db[_0x727c('0x3f')][_0x727c('0x6b')]({'where':{'id':_0x160577[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x5d7ad0,null))[_0x727c('0x34')](function(_0x4f17b5){if(_0x4f17b5){_0x408571[_0x727c('0x43')]=_[_0x727c('0x45')](db['OpenchannelInteraction']['rawAttributes']);_0x408571[_0x727c('0x44')]=_[_0x727c('0x45')](_0x160577[_0x727c('0x44')]);_0x408571[_0x727c('0x46')]=_[_0x727c('0x48')](_0x408571['model'],_0x408571['query']);_0x2a3253[_0x727c('0x47')]=_[_0x727c('0x48')](_0x408571[_0x727c('0x43')],qs[_0x727c('0x49')](_0x160577[_0x727c('0x44')][_0x727c('0x49')]));_0x2a3253['attributes']=_0x2a3253[_0x727c('0x47')]['length']?_0x2a3253[_0x727c('0x47')]:_0x408571[_0x727c('0x43')];if(!_0x160577[_0x727c('0x44')][_0x727c('0x4b')](_0x727c('0x4c'))){_0x2a3253[_0x727c('0x4d')]=qs[_0x727c('0x4d')](_0x160577[_0x727c('0x44')][_0x727c('0x4d')]);_0x2a3253[_0x727c('0x2f')]=qs[_0x727c('0x2f')](_0x160577['query']['offset']);}_0x2a3253[_0x727c('0x4e')]=qs[_0x727c('0x4f')](_0x160577[_0x727c('0x44')][_0x727c('0x4f')]);_0x2a3253[_0x727c('0x50')]=qs[_0x727c('0x46')](_['pick'](_0x160577['query'],_0x408571[_0x727c('0x46')]));_0x2a3253[_0x727c('0x50')]['OpenchannelAccountId']=_0x4f17b5['id'];if(_0x160577['query'][_0x727c('0x51')]){_0x2a3253[_0x727c('0x50')]=_[_0x727c('0x52')](_0x2a3253['where'],{'$or':_['map'](_0x2a3253['attributes'],function(_0x562bda){var _0x55249a={};_0x55249a[_0x562bda]={'$like':'%'+_0x160577[_0x727c('0x44')]['filter']+'%'};return _0x55249a;})});}_0x2a3253=_[_0x727c('0x52')]({},_0x2a3253,_0x160577[_0x727c('0x55')]);return db['OpenchannelInteraction'][_0x727c('0x2e')]({'where':_0x2a3253[_0x727c('0x50')]})['then'](function(_0x1c3a1f){_0x1ccaa8[_0x727c('0x2e')]=_0x1c3a1f;if(_0x160577[_0x727c('0x44')][_0x727c('0x5b')]){_0x2a3253['include']=[{'model':db[_0x727c('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x727c('0xaf'),'attributes':['name',_0x727c('0xb0'),_0x727c('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x727c('0xb2'),'attributes':['id',_0x727c('0x54'),_0x727c('0xb3')],'where':_0x160577['query'][_0x727c('0xb4')]?{'id':_0x160577[_0x727c('0x44')]['tag']}:undefined,'required':_0x160577[_0x727c('0x44')][_0x727c('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x727c('0x57')](_0x2a3253);})[_0x727c('0x34')](function(_0x47e219){_0x1ccaa8['rows']=_0x47e219;return _0x1ccaa8;});}})[_0x727c('0x34')](respondWithFilteredResult(_0x5d7ad0,_0x2a3253))[_0x727c('0x29')](handleError(_0x5d7ad0,null));};exports['addAgents']=function(_0x27ae95,_0xef7b29,_0x434fea){return db['OpenchannelAccount'][_0x727c('0x5c')]({'where':{'id':_0x27ae95[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0xef7b29,null))['then'](function(_0x47c179){if(_0x47c179){return _0x47c179['addAgents'](_0x27ae95[_0x727c('0x65')][_0x727c('0x6d')],_[_0x727c('0xb5')](_0x27ae95[_0x727c('0x65')],[_0x727c('0x6d'),'id'])||{})[_0x727c('0x95')](function(_0x36ce9e){for(var _0x557376=0x0;_0x557376<_0x27ae95['body']['ids'][_0x727c('0x4a')];_0x557376+=0x1){socket[_0x727c('0xb6')](_0x727c('0xb7'),{'UserId':Number(_0x27ae95[_0x727c('0x65')]['ids'][_0x557376]),'OpenchannelAccountId':Number(_0x27ae95[_0x727c('0x5a')]['id'])});}return _0x36ce9e;});}})[_0x727c('0x34')](respondWithResult(_0xef7b29,null))[_0x727c('0x29')](handleError(_0xef7b29,null));};exports['removeAgents']=function(_0x53f571,_0x4f55db,_0x55b24e){return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x53f571[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x4f55db,null))[_0x727c('0x34')](function(_0x396f6c){if(_0x396f6c){return _0x396f6c[_0x727c('0xb8')](_0x53f571[_0x727c('0x44')][_0x727c('0x6d')])[_0x727c('0x34')](function(){if(_[_0x727c('0xb9')](_0x53f571['query'][_0x727c('0x6d')])){for(var _0x3f21b4=0x0;_0x3f21b4<_0x53f571[_0x727c('0x44')]['ids'][_0x727c('0x4a')];_0x3f21b4+=0x1){socket[_0x727c('0xb6')](_0x727c('0xba'),{'UserId':Number(_0x53f571['query'][_0x727c('0x6d')][_0x3f21b4]),'OpenchannelAccountId':Number(_0x53f571[_0x727c('0x5a')]['id'])});}}else{socket[_0x727c('0xb6')](_0x727c('0xba'),{'UserId':Number(_0x53f571[_0x727c('0x44')][_0x727c('0x6d')]),'OpenchannelAccountId':Number(_0x53f571[_0x727c('0x5a')]['id'])});}});}})[_0x727c('0x34')](respondWithStatusCode(_0x4f55db,null))[_0x727c('0x29')](handleError(_0x4f55db,null));};exports[_0x727c('0xbb')]=function(_0x599e14,_0x31260e,_0x513262){var _0x2fd100={};var _0x5bb00d={};var _0x2bf51c;var _0x38c999;return db[_0x727c('0x3f')][_0x727c('0x6b')]({'where':{'id':_0x599e14['params']['id']}})['then'](handleEntityNotFound(_0x31260e,null))[_0x727c('0x34')](function(_0x28c43b){if(_0x28c43b){_0x2bf51c=_0x28c43b;_0x5bb00d[_0x727c('0x43')]=_[_0x727c('0x45')](db[_0x727c('0xbc')][_0x727c('0x40')]);_0x5bb00d[_0x727c('0x44')]=_['keys'](_0x599e14['query']);_0x5bb00d[_0x727c('0x46')]=_[_0x727c('0x48')](_0x5bb00d[_0x727c('0x43')],_0x5bb00d[_0x727c('0x44')]);_0x2fd100[_0x727c('0x47')]=_[_0x727c('0x48')](_0x5bb00d[_0x727c('0x43')],qs['fields'](_0x599e14[_0x727c('0x44')][_0x727c('0x49')]));_0x2fd100['attributes']=_0x2fd100['attributes'][_0x727c('0x4a')]?_0x2fd100['attributes']:_0x5bb00d['model'];_0x2fd100[_0x727c('0x4e')]=qs[_0x727c('0x4f')](_0x599e14[_0x727c('0x44')][_0x727c('0x4f')]);_0x2fd100[_0x727c('0x50')]=qs[_0x727c('0x46')](_[_0x727c('0x71')](_0x599e14[_0x727c('0x44')],_0x5bb00d[_0x727c('0x46')]));if(_0x599e14[_0x727c('0x44')][_0x727c('0x51')]){_0x2fd100[_0x727c('0x50')]=_['merge'](_0x2fd100[_0x727c('0x50')],{'$or':_[_0x727c('0x3e')](_0x2fd100[_0x727c('0x47')],function(_0x4d1296){var _0x3bff0b={};_0x3bff0b[_0x4d1296]={'$like':'%'+_0x599e14[_0x727c('0x44')][_0x727c('0x51')]+'%'};return _0x3bff0b;})});}_0x2fd100=_[_0x727c('0x52')]({},_0x2fd100,_0x599e14[_0x727c('0x55')]);return _0x2bf51c[_0x727c('0xbb')](_0x2fd100);}})[_0x727c('0x34')](function(_0x2841cf){if(_0x2841cf){_0x38c999=_0x2841cf[_0x727c('0x4a')];if(!_0x599e14[_0x727c('0x44')][_0x727c('0x4b')](_0x727c('0x4c'))){_0x2fd100[_0x727c('0x4d')]=qs[_0x727c('0x4d')](_0x599e14[_0x727c('0x44')]['limit']);_0x2fd100[_0x727c('0x2f')]=qs[_0x727c('0x2f')](_0x599e14['query'][_0x727c('0x2f')]);}return _0x2bf51c[_0x727c('0xbb')](_0x2fd100);}})['then'](function(_0x1f68df){if(_0x1f68df){return _0x1f68df?{'count':_0x38c999,'rows':_0x1f68df}:null;}})[_0x727c('0x34')](respondWithResult(_0x31260e,null))['catch'](handleError(_0x31260e,null));};exports[_0x727c('0x3a')]=function(_0x520d2d,_0x26cb80,_0x2af0b5){var _0x9fc20a,_0x3655e6,_0x2846f3;if(_[_0x727c('0x7d')](_0x520d2d[_0x727c('0x65')][_0x727c('0x65')])||_0x520d2d[_0x727c('0x65')][_0x727c('0x65')]===''){throw new db[(_0x727c('0x75'))][(_0x727c('0x76'))](_0x727c('0xbd'));}if(_['isNil'](_0x520d2d[_0x727c('0x65')]['to'])){}_0x9fc20a=_0x520d2d['body']['to'];return db[_0x727c('0x3f')][_0x727c('0x6b')]({'where':{'id':_0x520d2d[_0x727c('0x5a')]['id']}})[_0x727c('0x34')](handleEntityNotFound(_0x26cb80,null))[_0x727c('0x34')](function(_0x1cb63b){if(_0x1cb63b){return db[_0x727c('0x3f')][_0x727c('0x5c')]({'where':{'id':_0x1cb63b['id']},'include':[{'model':db[_0x727c('0xbe')],'as':_0x727c('0x84'),'include':[{'model':db[_0x727c('0x74')],'as':'Contacts','where':{[_0x1cb63b[_0x727c('0x80')]]:_0x9fc20a},'limit':0x1,'order':[[_0x727c('0x7a'),_0x727c('0x86')]]}]}]})['then'](handleEntityNotFound(_0x26cb80,null))[_0x727c('0x34')](function(_0x1536c4){if(_0x1536c4&&_0x1536c4['List']){_0x3655e6=_0x1536c4[_0x727c('0x35')]({'plain':!![]});if(_0x3655e6['List']&&_0x3655e6[_0x727c('0x84')][_0x727c('0x85')][_0x727c('0x4a')]){return _0x3655e6[_0x727c('0x84')]['Contacts'][0x0];}return db[_0x727c('0x74')][_0x727c('0x5d')](_[_0x727c('0x19')](_0x520d2d[_0x727c('0x65')],{'firstName':_0x9fc20a,[_0x1536c4['mapKey']]:_0x9fc20a,'phone':_0x9fc20a,'ListId':_0x3655e6[_0x727c('0x7c')]}));}})[_0x727c('0x34')](handleEntityNotFound(_0x26cb80,null))['then'](function(_0x32d49a){if(_0x32d49a){_0x2846f3=_0x32d49a;return db['OpenchannelInteraction'][_0x727c('0x5c')]({'where':{'ContactId':_0x2846f3['id'],'closed':![],'OpenchannelAccountId':_0x3655e6['id']}})[_0x727c('0x34')](function(_0x1d0bfd){if(_0x1d0bfd){return[_0x1d0bfd,![]];}return db[_0x727c('0x94')][_0x727c('0x5d')]({'UserId':_0x520d2d['user']['id'],'ContactId':_0x2846f3['id'],'OpenchannelAccountId':_0x3655e6['id'],'lastMsgDirection':_0x727c('0xbf'),'firstMsgDirection':'out','Messages':[_[_0x727c('0x52')](_0x520d2d[_0x727c('0x65')],{'read':![],'body':_0x520d2d['body'][_0x727c('0x65')],'OpenchannelAccountId':_0x3655e6['id'],'UserId':_0x520d2d[_0x727c('0x5e')]['id'],'ContactId':_0x2846f3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x727c('0x34')](function(_0x2d4c66){return[_0x2d4c66,!![]];});});}})['spread'](function(_0x5e29ff,_0x82c4fd){if(_0x82c4fd){return _0x5e29ff;}return db[_0x727c('0xc0')][_0x727c('0x5d')](_[_0x727c('0x52')](_0x520d2d[_0x727c('0x65')],{'read':![],'body':_0x520d2d[_0x727c('0x65')][_0x727c('0x65')],'OpenchannelAccountId':_0x3655e6['id'],'OpenchannelInteractionId':_0x5e29ff['id'],'UserId':_0x520d2d[_0x727c('0x5e')]['id'],'ContactId':_0x2846f3['id']}))[_0x727c('0x34')](function(_0x1c438f){_0x5e29ff[_0x727c('0xc1')]['Messages']=[];_0x5e29ff[_0x727c('0xc1')]['Messages'][_0x727c('0x9a')](_0x1c438f[_0x727c('0xc1')]);return _0x5e29ff;});});}})['then'](respondWithResult(_0x26cb80,null))[_0x727c('0x29')](handleError(_0x26cb80,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1a6f7d0..549b484 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 _0xb43b=['events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0xeb9468,_0xf86ef1){var _0x4cfb58=function(_0xf2a286){while(--_0xf2a286){_0xeb9468['push'](_0xeb9468['shift']());}};_0x4cfb58(++_0xf86ef1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x7a51b6,_0x242ade){_0x7a51b6=_0x7a51b6-0x0;var _0x592b39=_0xb43b[_0x7a51b6];return _0x592b39;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var OpenchannelAccount=require(_0xbb43('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb43('0x2')](0x0);var events={'afterCreate':_0xbb43('0x3'),'afterUpdate':_0xbb43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x131e9e){return function(_0x41aff6,_0x351254,_0x16432a){OpenchannelAccountEvents['emit'](_0x131e9e+':'+_0x41aff6['id'],_0x41aff6);OpenchannelAccountEvents['emit'](_0x131e9e,_0x41aff6);_0x16432a(null);};}for(var e in events){if(events[_0xbb43('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xbb43('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0x668b,0x140));var _0xb668=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0x668b[_0x3b085];return _0x476a57;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 917c2c5..17297cb 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(_0x4a5c2a,_0x80a9b6){var _0x58bd9e=function(_0xd3dda5){while(--_0xd3dda5){_0x4a5c2a['push'](_0x4a5c2a['shift']());}};_0x58bd9e(++_0x80a9b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x283227,_0xdb754){var _0x5a62d5=function(_0x5ac6b9){while(--_0x5ac6b9){_0x283227['push'](_0x283227['shift']());}};_0x5a62d5(++_0xdb754);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 3c7cfa6..db9f365 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 _0x57f8=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23704d,_0x255322){var _0x85c06e=function(_0x308723){while(--_0x308723){_0x23704d['push'](_0x23704d['shift']());}};_0x85c06e(++_0x255322);}(_0x57f8,0x198));var _0x857f=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0x57f8[_0x5c0232];return _0x589366;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});config[_0x857f('0xc')]=_[_0x857f('0xd')](config[_0x857f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x857f('0xe'))(new Redis(config[_0x857f('0xc')]));require(_0x857f('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e306e,_0x2ef315,_0x370126){return new BPromise(function(_0x5cc993,_0xefee53){return client[_0x857f('0x10')](_0x1e306e,_0x370126)[_0x857f('0x11')](function(_0x11adfd){logger[_0x857f('0x12')](_0x857f('0x13'),_0x2ef315,_0x857f('0x14'));logger['debug'](_0x857f('0x15'),_0x2ef315,_0x857f('0x14'),JSON[_0x857f('0x16')](_0x11adfd));if(_0x11adfd[_0x857f('0x17')]){if(_0x11adfd[_0x857f('0x17')]['code']===0x1f4){logger['error'](_0x857f('0x13'),_0x2ef315,_0x11adfd['error'][_0x857f('0x18')]);return _0xefee53(_0x11adfd['error'][_0x857f('0x18')]);}logger[_0x857f('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2ef315,_0x11adfd[_0x857f('0x17')][_0x857f('0x18')]);return _0x5cc993(_0x11adfd[_0x857f('0x17')][_0x857f('0x18')]);}else{logger[_0x857f('0x12')](_0x857f('0x13'),_0x2ef315,_0x857f('0x14'));_0x5cc993(_0x11adfd[_0x857f('0x19')][_0x857f('0x18')]);}})[_0x857f('0x1a')](function(_0x8e11f1){logger['error'](_0x857f('0x13'),_0x2ef315,_0x8e11f1);_0xefee53(_0x8e11f1);});});} \ No newline at end of file +var _0xe1e3=['catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x2bf3dc,_0x5b5f19){var _0x944dcb=function(_0x233456){while(--_0x233456){_0x2bf3dc['push'](_0x2bf3dc['shift']());}};_0x944dcb(++_0x5b5f19);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x301e40,_0x1e3afe){_0x301e40=_0x301e40-0x0;var _0x54f39c=_0xe1e3[_0x301e40];return _0x54f39c;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});config['redis']=_[_0x3e1e('0xa')](config[_0x3e1e('0xb')],{'host':_0x3e1e('0xc'),'port':0x18eb});var socket=require(_0x3e1e('0xd'))(new Redis(config[_0x3e1e('0xb')]));require(_0x3e1e('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c4c25,_0x5060e8,_0x31d205){return new BPromise(function(_0x5b0df8,_0x349460){return client[_0x3e1e('0xf')](_0x5c4c25,_0x31d205)[_0x3e1e('0x10')](function(_0x594c59){logger[_0x3e1e('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x5060e8,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5060e8,'request\x20sent',JSON[_0x3e1e('0x12')](_0x594c59));if(_0x594c59['error']){if(_0x594c59['error'][_0x3e1e('0x13')]===0x1f4){logger[_0x3e1e('0x14')](_0x3e1e('0x15'),_0x5060e8,_0x594c59['error']['message']);return _0x349460(_0x594c59[_0x3e1e('0x14')][_0x3e1e('0x16')]);}logger['error'](_0x3e1e('0x15'),_0x5060e8,_0x594c59[_0x3e1e('0x14')]['message']);return _0x5b0df8(_0x594c59[_0x3e1e('0x14')]['message']);}else{logger[_0x3e1e('0x11')](_0x3e1e('0x15'),_0x5060e8,_0x3e1e('0x17'));_0x5b0df8(_0x594c59[_0x3e1e('0x18')][_0x3e1e('0x16')]);}})[_0x3e1e('0x19')](function(_0x569f49){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5060e8,_0x569f49);_0x349460(_0x569f49);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 21568b2..726189b 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 _0xc831=['save','remove','update','emit','removeListener','length','openchannelAccount:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc831,0x103));var _0x1c83=function(_0x2fcfff,_0x268477){_0x2fcfff=_0x2fcfff-0x0;var _0x278ad1=_0xc831[_0x2fcfff];return _0x278ad1;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x1c83('0x0'),_0x1c83('0x1'),_0x1c83('0x2')];function createListener(_0x3049be,_0x444adc){return function(_0x4204fe){_0x444adc[_0x1c83('0x3')](_0x3049be,_0x4204fe);};}function removeListener(_0x28441e,_0x1a2a48){return function(){OpenchannelAccountEvents[_0x1c83('0x4')](_0x28441e,_0x1a2a48);};}exports['register']=function(_0x5682fb){for(var _0x2f52ea=0x0,_0x52ec70=events[_0x1c83('0x5')];_0x2f52ea<_0x52ec70;_0x2f52ea++){var _0x1953e5=events[_0x2f52ea];var _0x29ceee=createListener(_0x1c83('0x6')+_0x1953e5,_0x5682fb);OpenchannelAccountEvents['on'](_0x1953e5,_0x29ceee);}}; \ No newline at end of file +var _0x2ceb=['save','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x3408a5,_0x5889e7){var _0x2c04ab=function(_0x83be62){while(--_0x83be62){_0x3408a5['push'](_0x3408a5['shift']());}};_0x2c04ab(++_0x5889e7);}(_0x2ceb,0x110));var _0xb2ce=function(_0x8915c9,_0x37f666){_0x8915c9=_0x8915c9-0x0;var _0x1b1468=_0x2ceb[_0x8915c9];return _0x1b1468;};'use strict';var OpenchannelAccountEvents=require(_0xb2ce('0x0'));var events=[_0xb2ce('0x1'),'remove',_0xb2ce('0x2')];function createListener(_0x1bca5d,_0xc03973){return function(_0x1dbb1e){_0xc03973[_0xb2ce('0x3')](_0x1bca5d,_0x1dbb1e);};}function removeListener(_0x35242f,_0x58daad){return function(){OpenchannelAccountEvents[_0xb2ce('0x4')](_0x35242f,_0x58daad);};}exports[_0xb2ce('0x5')]=function(_0x550455){for(var _0x479153=0x0,_0x3dfaee=events['length'];_0x479153<_0x3dfaee;_0x479153++){var _0x39120a=events[_0x479153];var _0x9fb07c=createListener(_0xb2ce('0x6')+_0x39120a,_0x550455);OpenchannelAccountEvents['on'](_0x39120a,_0x9fb07c);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 167c60c..1870fc2 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 _0xe325=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','get','show','post','create','update','/:id','exports','multer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe325,0xcb));var _0x5e32=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0xe325[_0x151553];return _0x1a0ad6;};'use strict';var multer=require(_0x5e32('0x0'));var util=require(_0x5e32('0x1'));var path=require(_0x5e32('0x2'));var timeout=require(_0x5e32('0x3'));var express=require('express');var router=express[_0x5e32('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5e32('0x5'));var interaction=require(_0x5e32('0x6'));var config=require('../../config/environment');var controller=require(_0x5e32('0x7'));router['get']('/',auth[_0x5e32('0x8')](),controller[_0x5e32('0x9')]);router[_0x5e32('0xa')]('/:id',auth[_0x5e32('0x8')](),controller[_0x5e32('0xb')]);router[_0x5e32('0xc')]('/',auth[_0x5e32('0x8')](),controller[_0x5e32('0xd')]);router['put']('/:id',auth[_0x5e32('0x8')](),controller[_0x5e32('0xe')]);router['delete'](_0x5e32('0xf'),auth[_0x5e32('0x8')](),controller['destroy']);module[_0x5e32('0x10')]=router; \ No newline at end of file +var _0x2f40=['exports','multer','util','express','Router','./openchannelApplication.controller','get','index','/:id','isAuthenticated','post','create','update','delete'];(function(_0x3f43,_0xd670da){var _0x35800f=function(_0x3a85c8){while(--_0x3a85c8){_0x3f43['push'](_0x3f43['shift']());}};_0x35800f(++_0xd670da);}(_0x2f40,0xc5));var _0x02f4=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2f40[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x02f4('0x0'));var util=require(_0x02f4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02f4('0x2'));var router=express[_0x02f4('0x3')]();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(_0x02f4('0x4'));router[_0x02f4('0x5')]('/',auth['isAuthenticated'](),controller[_0x02f4('0x6')]);router['get'](_0x02f4('0x7'),auth[_0x02f4('0x8')](),controller['show']);router[_0x02f4('0x9')]('/',auth[_0x02f4('0x8')](),controller[_0x02f4('0xa')]);router['put']('/:id',auth[_0x02f4('0x8')](),controller[_0x02f4('0xb')]);router[_0x02f4('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x02f4('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index a5b1c8a..34d3714 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 _0x174d=['TEXT','STRING','sequelize','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x174d,0x14a));var _0xd174=function(_0x5b37c7,_0x5cf44f){_0x5b37c7=_0x5b37c7-0x0;var _0x489c08=_0x174d[_0x5b37c7];return _0x489c08;};'use strict';var Sequelize=require(_0xd174('0x0'));module[_0xd174('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd174('0x2')]()},'description':{'type':Sequelize[_0xd174('0x3')]},'interval':{'type':Sequelize[_0xd174('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4c4f=['exports','INTEGER','STRING','TEXT'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x4c4f,0xb8));var _0xf4c4=function(_0x451a3d,_0x23363c){_0x451a3d=_0x451a3d-0x0;var _0x87cded=_0x4c4f[_0x451a3d];return _0x87cded;};'use strict';var Sequelize=require('sequelize');module[_0xf4c4('0x0')]={'priority':{'type':Sequelize[_0xf4c4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf4c4('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf4c4('0x3')]()},'description':{'type':Sequelize[_0xf4c4('0x2')]},'interval':{'type':Sequelize[_0xf4c4('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index cd9a8fb..0545397 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 _0x3042=['body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','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','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','rows','params','fields','find','catch','create'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x3042,0x97));var _0x2304=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x3042[_0x71b765];return _0x34cb24;};'use strict';var emlformat=require(_0x2304('0x0'));var rimraf=require(_0x2304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2304('0x2'));var moment=require('moment');var BPromise=require(_0x2304('0x3'));var Mustache=require(_0x2304('0x4'));var util=require(_0x2304('0x5'));var path=require(_0x2304('0x6'));var sox=require(_0x2304('0x7'));var csv=require('to-csv');var ejs=require(_0x2304('0x8'));var fs=require('fs');var fs_extra=require(_0x2304('0x9'));var _=require(_0x2304('0xa'));var squel=require(_0x2304('0xb'));var crypto=require(_0x2304('0xc'));var jsforce=require(_0x2304('0xd'));var deskjs=require(_0x2304('0xe'));var toCsv=require(_0x2304('0xf'));var querystring=require(_0x2304('0x10'));var Papa=require('papaparse');var Redis=require(_0x2304('0x11'));var authService=require(_0x2304('0x12'));var qs=require(_0x2304('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2304('0x14'));var logger=require(_0x2304('0x15'))(_0x2304('0x16'));var utils=require(_0x2304('0x17'));var config=require(_0x2304('0x18'));var licenseUtil=require(_0x2304('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e16d5,_0x4a632c){_0x4a632c=_0x4a632c||0xcc;return function(_0x243b3c){if(_0x243b3c){return _0x2e16d5[_0x2304('0x1a')](_0x4a632c);}return _0x2e16d5[_0x2304('0x1b')](_0x4a632c)[_0x2304('0x1c')]();};}function respondWithResult(_0x9f216f,_0x3ab69b){_0x3ab69b=_0x3ab69b||0xc8;return function(_0x47feec){if(_0x47feec){return _0x9f216f[_0x2304('0x1b')](_0x3ab69b)[_0x2304('0x1d')](_0x47feec);}};}function respondWithFilteredResult(_0x507c40,_0x1b04a0){return function(_0xbb3f6c){if(_0xbb3f6c){var _0x2ef281=typeof _0x1b04a0[_0x2304('0x1e')]===_0x2304('0x1f')&&typeof _0x1b04a0[_0x2304('0x20')]==='undefined';var _0x5833d7=_0xbb3f6c[_0x2304('0x21')];var _0x51b3b6=_0x2ef281?0x0:_0x1b04a0[_0x2304('0x1e')];var _0x2f8546=_0x2ef281?_0xbb3f6c['count']:_0x1b04a0[_0x2304('0x1e')]+_0x1b04a0[_0x2304('0x20')];var _0x54b631;if(_0x2f8546>=_0x5833d7){_0x2f8546=_0x5833d7;_0x54b631=0xc8;}else{_0x54b631=0xce;}_0x507c40['status'](_0x54b631);return _0x507c40[_0x2304('0x22')]('Content-Range',_0x51b3b6+'-'+_0x2f8546+'/'+_0x5833d7)[_0x2304('0x1d')](_0xbb3f6c);}return null;};}function patchUpdates(_0x543a4d){return function(_0xb7a21b){try{jsonpatch[_0x2304('0x23')](_0xb7a21b,_0x543a4d,!![]);}catch(_0x4c02a7){return BPromise[_0x2304('0x24')](_0x4c02a7);}return _0xb7a21b[_0x2304('0x25')]();};}function saveUpdates(_0x3f61cf,_0x51726c){return function(_0xfdc127){if(_0xfdc127){return _0xfdc127[_0x2304('0x26')](_0x3f61cf)[_0x2304('0x27')](function(_0x286dce){return _0x286dce;});}return null;};}function removeEntity(_0x55117a,_0x3f52e8){return function(_0x219a46){if(_0x219a46){return _0x219a46[_0x2304('0x28')]()[_0x2304('0x27')](function(){_0x55117a[_0x2304('0x1b')](0xcc)[_0x2304('0x1c')]();});}};}function handleEntityNotFound(_0x42b1fd,_0x4536c9){return function(_0x3e1b35){if(!_0x3e1b35){_0x42b1fd[_0x2304('0x1a')](0x194);}return _0x3e1b35;};}function handleError(_0x641532,_0x9fd78c){_0x9fd78c=_0x9fd78c||0x1f4;return function(_0x3538cc){logger[_0x2304('0x29')](_0x3538cc['stack']);if(_0x3538cc[_0x2304('0x2a')]){delete _0x3538cc[_0x2304('0x2a')];}_0x641532[_0x2304('0x1b')](_0x9fd78c)[_0x2304('0x2b')](_0x3538cc);};}exports[_0x2304('0x2c')]=function(_0x34899d,_0x4041a0){var _0x50dd98={},_0x29cc3={},_0x4583a9={'count':0x0,'rows':[]};var _0x5aecaf=_[_0x2304('0x2d')](db['OpenchannelApplication'][_0x2304('0x2e')],function(_0x2e1036){return{'name':_0x2e1036[_0x2304('0x2f')],'type':_0x2e1036['type'][_0x2304('0x30')]};});_0x29cc3[_0x2304('0x31')]=_[_0x2304('0x2d')](_0x5aecaf,_0x2304('0x2a'));_0x29cc3['query']=_[_0x2304('0x32')](_0x34899d[_0x2304('0x33')]);_0x29cc3[_0x2304('0x34')]=_[_0x2304('0x35')](_0x29cc3[_0x2304('0x31')],_0x29cc3[_0x2304('0x33')]);_0x50dd98[_0x2304('0x36')]=_[_0x2304('0x35')](_0x29cc3[_0x2304('0x31')],qs['fields'](_0x34899d[_0x2304('0x33')]['fields']));_0x50dd98[_0x2304('0x36')]=_0x50dd98[_0x2304('0x36')][_0x2304('0x37')]?_0x50dd98[_0x2304('0x36')]:_0x29cc3[_0x2304('0x31')];if(!_0x34899d[_0x2304('0x33')][_0x2304('0x38')](_0x2304('0x39'))){_0x50dd98['limit']=qs['limit'](_0x34899d[_0x2304('0x33')]['limit']);_0x50dd98[_0x2304('0x1e')]=qs[_0x2304('0x1e')](_0x34899d['query'][_0x2304('0x1e')]);}_0x50dd98[_0x2304('0x3a')]=qs[_0x2304('0x3b')](_0x34899d[_0x2304('0x33')][_0x2304('0x3b')]);_0x50dd98['where']=qs[_0x2304('0x34')](_[_0x2304('0x3c')](_0x34899d[_0x2304('0x33')],_0x29cc3['filters']),_0x5aecaf);if(_0x34899d[_0x2304('0x33')][_0x2304('0x3d')]){_0x50dd98['where']=_[_0x2304('0x3e')](_0x50dd98['where'],{'$or':_[_0x2304('0x2d')](_0x5aecaf,function(_0x1a59e9){if(_0x1a59e9['type']!==_0x2304('0x3f')){var _0x1bdd9b={};_0x1bdd9b[_0x1a59e9['name']]={'$like':'%'+_0x34899d[_0x2304('0x33')][_0x2304('0x3d')]+'%'};return _0x1bdd9b;}})});}_0x50dd98=_[_0x2304('0x3e')]({},_0x50dd98,_0x34899d[_0x2304('0x40')]);var _0x269944={'where':_0x50dd98['where']};return db[_0x2304('0x41')]['count'](_0x269944)['then'](function(_0x3c8413){_0x4583a9['count']=_0x3c8413;if(_0x34899d[_0x2304('0x33')][_0x2304('0x42')]){_0x50dd98[_0x2304('0x43')]=[{'all':!![]}];}return db[_0x2304('0x41')]['findAll'](_0x50dd98);})[_0x2304('0x27')](function(_0x2dab8f){_0x4583a9[_0x2304('0x44')]=_0x2dab8f;return _0x4583a9;})[_0x2304('0x27')](respondWithFilteredResult(_0x4041a0,_0x50dd98))['catch'](handleError(_0x4041a0,null));};exports['show']=function(_0x1356b5,_0x4af42d){var _0x66a9d9={'raw':!![],'where':{'id':_0x1356b5[_0x2304('0x45')]['id']}},_0x46c9cd={};_0x46c9cd['model']=_['keys'](db[_0x2304('0x41')][_0x2304('0x2e')]);_0x46c9cd[_0x2304('0x33')]=_[_0x2304('0x32')](_0x1356b5[_0x2304('0x33')]);_0x46c9cd[_0x2304('0x34')]=_[_0x2304('0x35')](_0x46c9cd['model'],_0x46c9cd['query']);_0x66a9d9[_0x2304('0x36')]=_[_0x2304('0x35')](_0x46c9cd[_0x2304('0x31')],qs['fields'](_0x1356b5[_0x2304('0x33')][_0x2304('0x46')]));_0x66a9d9[_0x2304('0x36')]=_0x66a9d9[_0x2304('0x36')]['length']?_0x66a9d9['attributes']:_0x46c9cd['model'];if(_0x1356b5['query']['includeAll']){_0x66a9d9['include']=[{'all':!![]}];}_0x66a9d9=_[_0x2304('0x3e')]({},_0x66a9d9,_0x1356b5[_0x2304('0x40')]);return db[_0x2304('0x41')][_0x2304('0x47')](_0x66a9d9)['then'](handleEntityNotFound(_0x4af42d,null))[_0x2304('0x27')](respondWithResult(_0x4af42d,null))[_0x2304('0x48')](handleError(_0x4af42d,null));};exports[_0x2304('0x49')]=function(_0x1fc392,_0xcc6309){return db[_0x2304('0x41')][_0x2304('0x49')](_0x1fc392[_0x2304('0x4a')],{})['then'](respondWithResult(_0xcc6309,0xc9))[_0x2304('0x48')](handleError(_0xcc6309,null));};exports[_0x2304('0x26')]=function(_0x55a2d6,_0x450fa4){if(_0x55a2d6['body']['id']){delete _0x55a2d6[_0x2304('0x4a')]['id'];}return db[_0x2304('0x41')]['find']({'where':{'id':_0x55a2d6['params']['id']}})[_0x2304('0x27')](handleEntityNotFound(_0x450fa4,null))[_0x2304('0x27')](saveUpdates(_0x55a2d6[_0x2304('0x4a')],null))[_0x2304('0x27')](respondWithResult(_0x450fa4,null))['catch'](handleError(_0x450fa4,null));};exports[_0x2304('0x28')]=function(_0x4973f0,_0x969674){return db['OpenchannelApplication']['find']({'where':{'id':_0x4973f0[_0x2304('0x45')]['id']}})[_0x2304('0x27')](handleEntityNotFound(_0x969674,null))[_0x2304('0x27')](removeEntity(_0x969674,null))[_0x2304('0x48')](handleError(_0x969674,null));}; \ No newline at end of file +var _0x6ea4=['sox','ejs','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x1a3d77,_0x5e04aa){var _0x22fc49=function(_0x3c0f39){while(--_0x3c0f39){_0x1a3d77['push'](_0x1a3d77['shift']());}};_0x22fc49(++_0x5e04aa);}(_0x6ea4,0x1f1));var _0x46ea=function(_0x407318,_0x194bcf){_0x407318=_0x407318-0x0;var _0x591de6=_0x6ea4[_0x407318];return _0x591de6;};'use strict';var emlformat=require(_0x46ea('0x0'));var rimraf=require(_0x46ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46ea('0x2'));var rp=require('request-promise');var moment=require(_0x46ea('0x3'));var BPromise=require(_0x46ea('0x4'));var Mustache=require(_0x46ea('0x5'));var util=require('util');var path=require(_0x46ea('0x6'));var sox=require(_0x46ea('0x7'));var csv=require('to-csv');var ejs=require(_0x46ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46ea('0x9'));var crypto=require('crypto');var jsforce=require(_0x46ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x46ea('0xb'));var querystring=require(_0x46ea('0xc'));var Papa=require('papaparse');var Redis=require(_0x46ea('0xd'));var authService=require(_0x46ea('0xe'));var qs=require(_0x46ea('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46ea('0x10'));var logger=require('../../config/logger')(_0x46ea('0x11'));var utils=require(_0x46ea('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46ea('0x13'))['db'];function respondWithStatusCode(_0x4de36c,_0x497c81){_0x497c81=_0x497c81||0xcc;return function(_0x2612df){if(_0x2612df){return _0x4de36c['sendStatus'](_0x497c81);}return _0x4de36c[_0x46ea('0x14')](_0x497c81)[_0x46ea('0x15')]();};}function respondWithResult(_0x538577,_0x2498ba){_0x2498ba=_0x2498ba||0xc8;return function(_0x1e7401){if(_0x1e7401){return _0x538577[_0x46ea('0x14')](_0x2498ba)[_0x46ea('0x16')](_0x1e7401);}};}function respondWithFilteredResult(_0x1b5852,_0x1435b3){return function(_0x7570fe){if(_0x7570fe){var _0x16d1c1=typeof _0x1435b3[_0x46ea('0x17')]===_0x46ea('0x18')&&typeof _0x1435b3[_0x46ea('0x19')]==='undefined';var _0x4dd03=_0x7570fe[_0x46ea('0x1a')];var _0x5094af=_0x16d1c1?0x0:_0x1435b3['offset'];var _0xe372dc=_0x16d1c1?_0x7570fe[_0x46ea('0x1a')]:_0x1435b3[_0x46ea('0x17')]+_0x1435b3[_0x46ea('0x19')];var _0x535bf5;if(_0xe372dc>=_0x4dd03){_0xe372dc=_0x4dd03;_0x535bf5=0xc8;}else{_0x535bf5=0xce;}_0x1b5852[_0x46ea('0x14')](_0x535bf5);return _0x1b5852[_0x46ea('0x1b')]('Content-Range',_0x5094af+'-'+_0xe372dc+'/'+_0x4dd03)[_0x46ea('0x16')](_0x7570fe);}return null;};}function patchUpdates(_0x4e6a66){return function(_0x41f01b){try{jsonpatch[_0x46ea('0x1c')](_0x41f01b,_0x4e6a66,!![]);}catch(_0xbe4d8){return BPromise[_0x46ea('0x1d')](_0xbe4d8);}return _0x41f01b[_0x46ea('0x1e')]();};}function saveUpdates(_0x152fbc,_0x4eda40){return function(_0x50f1d6){if(_0x50f1d6){return _0x50f1d6[_0x46ea('0x1f')](_0x152fbc)[_0x46ea('0x20')](function(_0x1894bd){return _0x1894bd;});}return null;};}function removeEntity(_0x344978,_0x3751c0){return function(_0x300b00){if(_0x300b00){return _0x300b00[_0x46ea('0x21')]()[_0x46ea('0x20')](function(){_0x344978[_0x46ea('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a6215,_0x2bb45b){return function(_0x481d96){if(!_0x481d96){_0x2a6215[_0x46ea('0x22')](0x194);}return _0x481d96;};}function handleError(_0x252ae1,_0x3468b2){_0x3468b2=_0x3468b2||0x1f4;return function(_0x2f346e){logger['error'](_0x2f346e[_0x46ea('0x23')]);if(_0x2f346e[_0x46ea('0x24')]){delete _0x2f346e['name'];}_0x252ae1['status'](_0x3468b2)[_0x46ea('0x25')](_0x2f346e);};}exports[_0x46ea('0x26')]=function(_0x2d77ef,_0x3420ea){var _0x11321d={},_0xa2cefe={},_0x3bbf90={'count':0x0,'rows':[]};var _0x1d6453=_[_0x46ea('0x27')](db[_0x46ea('0x28')][_0x46ea('0x29')],function(_0x54604d){return{'name':_0x54604d['fieldName'],'type':_0x54604d[_0x46ea('0x2a')][_0x46ea('0x2b')]};});_0xa2cefe[_0x46ea('0x2c')]=_['map'](_0x1d6453,_0x46ea('0x24'));_0xa2cefe[_0x46ea('0x2d')]=_['keys'](_0x2d77ef['query']);_0xa2cefe[_0x46ea('0x2e')]=_[_0x46ea('0x2f')](_0xa2cefe[_0x46ea('0x2c')],_0xa2cefe['query']);_0x11321d[_0x46ea('0x30')]=_[_0x46ea('0x2f')](_0xa2cefe[_0x46ea('0x2c')],qs[_0x46ea('0x31')](_0x2d77ef['query'][_0x46ea('0x31')]));_0x11321d[_0x46ea('0x30')]=_0x11321d[_0x46ea('0x30')][_0x46ea('0x32')]?_0x11321d['attributes']:_0xa2cefe[_0x46ea('0x2c')];if(!_0x2d77ef['query'][_0x46ea('0x33')](_0x46ea('0x34'))){_0x11321d[_0x46ea('0x19')]=qs[_0x46ea('0x19')](_0x2d77ef[_0x46ea('0x2d')][_0x46ea('0x19')]);_0x11321d['offset']=qs[_0x46ea('0x17')](_0x2d77ef['query'][_0x46ea('0x17')]);}_0x11321d[_0x46ea('0x35')]=qs[_0x46ea('0x36')](_0x2d77ef[_0x46ea('0x2d')]['sort']);_0x11321d[_0x46ea('0x37')]=qs[_0x46ea('0x2e')](_[_0x46ea('0x38')](_0x2d77ef[_0x46ea('0x2d')],_0xa2cefe[_0x46ea('0x2e')]),_0x1d6453);if(_0x2d77ef[_0x46ea('0x2d')][_0x46ea('0x39')]){_0x11321d['where']=_[_0x46ea('0x3a')](_0x11321d[_0x46ea('0x37')],{'$or':_['map'](_0x1d6453,function(_0x441f06){if(_0x441f06[_0x46ea('0x2a')]!==_0x46ea('0x3b')){var _0xbcc548={};_0xbcc548[_0x441f06[_0x46ea('0x24')]]={'$like':'%'+_0x2d77ef[_0x46ea('0x2d')]['filter']+'%'};return _0xbcc548;}})});}_0x11321d=_[_0x46ea('0x3a')]({},_0x11321d,_0x2d77ef[_0x46ea('0x3c')]);var _0x55b42c={'where':_0x11321d[_0x46ea('0x37')]};return db[_0x46ea('0x28')][_0x46ea('0x1a')](_0x55b42c)[_0x46ea('0x20')](function(_0x45a86a){_0x3bbf90[_0x46ea('0x1a')]=_0x45a86a;if(_0x2d77ef[_0x46ea('0x2d')][_0x46ea('0x3d')]){_0x11321d['include']=[{'all':!![]}];}return db[_0x46ea('0x28')][_0x46ea('0x3e')](_0x11321d);})[_0x46ea('0x20')](function(_0x4f1dcf){_0x3bbf90[_0x46ea('0x3f')]=_0x4f1dcf;return _0x3bbf90;})[_0x46ea('0x20')](respondWithFilteredResult(_0x3420ea,_0x11321d))[_0x46ea('0x40')](handleError(_0x3420ea,null));};exports[_0x46ea('0x41')]=function(_0x16c54c,_0x51df71){var _0x123f2d={'raw':!![],'where':{'id':_0x16c54c[_0x46ea('0x42')]['id']}},_0x4d21d5={};_0x4d21d5[_0x46ea('0x2c')]=_[_0x46ea('0x43')](db[_0x46ea('0x28')][_0x46ea('0x29')]);_0x4d21d5[_0x46ea('0x2d')]=_['keys'](_0x16c54c['query']);_0x4d21d5['filters']=_[_0x46ea('0x2f')](_0x4d21d5[_0x46ea('0x2c')],_0x4d21d5[_0x46ea('0x2d')]);_0x123f2d[_0x46ea('0x30')]=_[_0x46ea('0x2f')](_0x4d21d5['model'],qs[_0x46ea('0x31')](_0x16c54c[_0x46ea('0x2d')][_0x46ea('0x31')]));_0x123f2d['attributes']=_0x123f2d['attributes'][_0x46ea('0x32')]?_0x123f2d[_0x46ea('0x30')]:_0x4d21d5[_0x46ea('0x2c')];if(_0x16c54c[_0x46ea('0x2d')][_0x46ea('0x3d')]){_0x123f2d[_0x46ea('0x44')]=[{'all':!![]}];}_0x123f2d=_[_0x46ea('0x3a')]({},_0x123f2d,_0x16c54c[_0x46ea('0x3c')]);return db[_0x46ea('0x28')][_0x46ea('0x45')](_0x123f2d)[_0x46ea('0x20')](handleEntityNotFound(_0x51df71,null))[_0x46ea('0x20')](respondWithResult(_0x51df71,null))['catch'](handleError(_0x51df71,null));};exports[_0x46ea('0x46')]=function(_0x5d3b37,_0x2f7735){return db[_0x46ea('0x28')][_0x46ea('0x46')](_0x5d3b37['body'],{})['then'](respondWithResult(_0x2f7735,0xc9))[_0x46ea('0x40')](handleError(_0x2f7735,null));};exports[_0x46ea('0x1f')]=function(_0x469ed3,_0x161b6a){if(_0x469ed3[_0x46ea('0x47')]['id']){delete _0x469ed3[_0x46ea('0x47')]['id'];}return db['OpenchannelApplication'][_0x46ea('0x45')]({'where':{'id':_0x469ed3[_0x46ea('0x42')]['id']}})['then'](handleEntityNotFound(_0x161b6a,null))['then'](saveUpdates(_0x469ed3[_0x46ea('0x47')],null))[_0x46ea('0x20')](respondWithResult(_0x161b6a,null))['catch'](handleError(_0x161b6a,null));};exports[_0x46ea('0x21')]=function(_0x331eec,_0x20ce3e){return db[_0x46ea('0x28')][_0x46ea('0x45')]({'where':{'id':_0x331eec['params']['id']}})['then'](handleEntityNotFound(_0x20ce3e,null))[_0x46ea('0x20')](removeEntity(_0x20ce3e,null))['catch'](handleError(_0x20ce3e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d214620..5934faa 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 _0x6b7b=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x4a2273,_0x270198){var _0x1bf4e3=function(_0x1613f3){while(--_0x1613f3){_0x4a2273['push'](_0x4a2273['shift']());}};_0x1bf4e3(++_0x270198);}(_0x6b7b,0xe4));var _0xb6b7=function(_0x130ad8,_0x972d43){_0x130ad8=_0x130ad8-0x0;var _0x247f62=_0x6b7b[_0x130ad8];return _0x247f62;};'use strict';var _=require(_0xb6b7('0x0'));var util=require(_0xb6b7('0x1'));var logger=require(_0xb6b7('0x2'))(_0xb6b7('0x3'));var moment=require(_0xb6b7('0x4'));var BPromise=require(_0xb6b7('0x5'));var rp=require(_0xb6b7('0x6'));var fs=require('fs');var path=require(_0xb6b7('0x7'));var rimraf=require('rimraf');var config=require(_0xb6b7('0x8'));var attributes=require(_0xb6b7('0x9'));module['exports']=function(_0x4618cb,_0x4829e6){return _0x4618cb[_0xb6b7('0xa')](_0xb6b7('0xb'),attributes,{'tableName':_0xb6b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6b7('0xd'),'collate':_0xb6b7('0xe')});}; \ No newline at end of file +var _0x7f0f=['./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5eaed5,_0x492a7a){var _0x4bd9dd=function(_0xc9e084){while(--_0xc9e084){_0x5eaed5['push'](_0x5eaed5['shift']());}};_0x4bd9dd(++_0x492a7a);}(_0x7f0f,0xad));var _0xf7f0=function(_0x5cf0bc,_0x5318f0){_0x5cf0bc=_0x5cf0bc-0x0;var _0x375d99=_0x7f0f[_0x5cf0bc];return _0x375d99;};'use strict';var _=require(_0xf7f0('0x0'));var util=require(_0xf7f0('0x1'));var logger=require(_0xf7f0('0x2'))(_0xf7f0('0x3'));var moment=require(_0xf7f0('0x4'));var BPromise=require(_0xf7f0('0x5'));var rp=require(_0xf7f0('0x6'));var fs=require('fs');var path=require(_0xf7f0('0x7'));var rimraf=require(_0xf7f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xf7f0('0x9'));module[_0xf7f0('0xa')]=function(_0x1aab10,_0x95c43a){return _0x1aab10['define']('OpenchannelApplication',attributes,{'tableName':_0xf7f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7f0('0xc'),'collate':_0xf7f0('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fdb29fd..3619bd8 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 _0xd08d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util'];(function(_0x3473c8,_0x2fe226){var _0x5ef960=function(_0x48ba30){while(--_0x48ba30){_0x3473c8['push'](_0x3473c8['shift']());}};_0x5ef960(++_0x2fe226);}(_0xd08d,0x130));var _0xdd08=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0xd08d[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0xdd08('0x0'));var util=require(_0xdd08('0x1'));var moment=require(_0xdd08('0x2'));var BPromise=require(_0xdd08('0x3'));var rs=require(_0xdd08('0x4'));var fs=require('fs');var Redis=require(_0xdd08('0x5'));var db=require(_0xdd08('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x7'))(_0xdd08('0x8'));var config=require(_0xdd08('0x9'));var jayson=require(_0xdd08('0xa'));var client=jayson[_0xdd08('0xb')][_0xdd08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x478c78,_0x1351c2,_0x3f3ec6){return new BPromise(function(_0x2e42c7,_0x2208c3){return client[_0xdd08('0xd')](_0x478c78,_0x3f3ec6)[_0xdd08('0xe')](function(_0x3918f8){logger[_0xdd08('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x1351c2,_0xdd08('0x10'));logger[_0xdd08('0x11')](_0xdd08('0x12'),_0x1351c2,'request\x20sent',JSON[_0xdd08('0x13')](_0x3918f8));if(_0x3918f8['error']){if(_0x3918f8[_0xdd08('0x14')][_0xdd08('0x15')]===0x1f4){logger['error'](_0xdd08('0x16'),_0x1351c2,_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);return _0x2208c3(_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);}logger[_0xdd08('0x14')](_0xdd08('0x16'),_0x1351c2,_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);return _0x2e42c7(_0x3918f8[_0xdd08('0x14')]['message']);}else{logger['info'](_0xdd08('0x16'),_0x1351c2,_0xdd08('0x10'));_0x2e42c7(_0x3918f8[_0xdd08('0x18')][_0xdd08('0x17')]);}})['catch'](function(_0x4efb2d){logger[_0xdd08('0x14')](_0xdd08('0x16'),_0x1351c2,_0x4efb2d);_0x2208c3(_0x4efb2d);});});}exports['UpdateOpenchannelApplication']=function(_0x4917bb){var _0x588ae8=this;return new Promise(function(_0x38ef61,_0x5c2b94){return db['OpenchannelApplication'][_0xdd08('0x19')](_0x4917bb[_0xdd08('0x1a')],{'raw':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1d')]||null:null,'attributes':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1e')]||null:null,'limit':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1f')]||null:null})[_0xdd08('0xe')](function(_0x41a2fd){logger[_0xdd08('0xf')](_0xdd08('0x20'),_0x4917bb);logger[_0xdd08('0x11')](_0xdd08('0x20'),_0x4917bb,JSON[_0xdd08('0x13')](_0x41a2fd));_0x38ef61(_0x41a2fd);})[_0xdd08('0x21')](function(_0x34af15){logger[_0xdd08('0x14')](_0xdd08('0x20'),_0x34af15[_0xdd08('0x17')],_0x4917bb);_0x5c2b94(_0x588ae8[_0xdd08('0x14')](0x1f4,_0x34af15[_0xdd08('0x17')]));});});}; \ No newline at end of file +var _0x1149=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','moment','ioredis'];(function(_0x5b144f,_0x2871e2){var _0x4e3bf7=function(_0x29a892){while(--_0x29a892){_0x5b144f['push'](_0x5b144f['shift']());}};_0x4e3bf7(++_0x2871e2);}(_0x1149,0xb7));var _0x9114=function(_0xb91f94,_0x1c0bc1){_0xb91f94=_0xb91f94-0x0;var _0x46badb=_0x1149[_0xb91f94];return _0x46badb;};'use strict';var _=require(_0x9114('0x0'));var util=require('util');var moment=require(_0x9114('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9114('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9114('0x3'));var logger=require(_0x9114('0x4'))(_0x9114('0x5'));var config=require(_0x9114('0x6'));var jayson=require(_0x9114('0x7'));var client=jayson[_0x9114('0x8')][_0x9114('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45303e,_0x4a84a3,_0x3803f1){return new BPromise(function(_0x383861,_0x1545e3){return client[_0x9114('0xa')](_0x45303e,_0x3803f1)[_0x9114('0xb')](function(_0x2085f5){logger[_0x9114('0xc')](_0x9114('0xd'),_0x4a84a3,'request\x20sent');logger[_0x9114('0xe')](_0x9114('0xf'),_0x4a84a3,_0x9114('0x10'),JSON[_0x9114('0x11')](_0x2085f5));if(_0x2085f5[_0x9114('0x12')]){if(_0x2085f5[_0x9114('0x12')][_0x9114('0x13')]===0x1f4){logger[_0x9114('0x12')](_0x9114('0xd'),_0x4a84a3,_0x2085f5[_0x9114('0x12')]['message']);return _0x1545e3(_0x2085f5[_0x9114('0x12')][_0x9114('0x14')]);}logger[_0x9114('0x12')](_0x9114('0xd'),_0x4a84a3,_0x2085f5[_0x9114('0x12')]['message']);return _0x383861(_0x2085f5[_0x9114('0x12')][_0x9114('0x14')]);}else{logger[_0x9114('0xc')](_0x9114('0xd'),_0x4a84a3,_0x9114('0x10'));_0x383861(_0x2085f5['result'][_0x9114('0x14')]);}})[_0x9114('0x15')](function(_0x51d6d6){logger[_0x9114('0x12')](_0x9114('0xd'),_0x4a84a3,_0x51d6d6);_0x1545e3(_0x51d6d6);});});}exports[_0x9114('0x16')]=function(_0x10f203){var _0x3401e6=this;return new Promise(function(_0x2a3c8d,_0x49c4f7){return db[_0x9114('0x17')][_0x9114('0x18')](_0x10f203[_0x9114('0x19')],{'raw':_0x10f203[_0x9114('0x1a')]?_0x10f203['options'][_0x9114('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10f203['options']?_0x10f203[_0x9114('0x1a')][_0x9114('0x1c')]||null:null,'attributes':_0x10f203[_0x9114('0x1a')]?_0x10f203[_0x9114('0x1a')][_0x9114('0x1d')]||null:null,'limit':_0x10f203[_0x9114('0x1a')]?_0x10f203[_0x9114('0x1a')][_0x9114('0x1e')]||null:null})[_0x9114('0xb')](function(_0x3d6238){logger['info']('UpdateOpenchannelApplication',_0x10f203);logger[_0x9114('0xe')](_0x9114('0x16'),_0x10f203,JSON[_0x9114('0x11')](_0x3d6238));_0x2a3c8d(_0x3d6238);})[_0x9114('0x15')](function(_0x4cbff1){logger[_0x9114('0x12')]('UpdateOpenchannelApplication',_0x4cbff1[_0x9114('0x14')],_0x10f203);_0x49c4f7(_0x3401e6[_0x9114('0x12')](0x1f4,_0x4cbff1[_0x9114('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 43903e6..93279f9 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 _0x86f7=['index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xf016d6,_0x28b45e){var _0x588fcb=function(_0x4f7d50){while(--_0x4f7d50){_0xf016d6['push'](_0xf016d6['shift']());}};_0x588fcb(++_0x28b45e);}(_0x86f7,0x1c6));var _0x786f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x86f7[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x786f('0x0'));var util=require(_0x786f('0x1'));var path=require(_0x786f('0x2'));var timeout=require('connect-timeout');var express=require(_0x786f('0x3'));var router=express[_0x786f('0x4')]();var fs_extra=require(_0x786f('0x5'));var auth=require(_0x786f('0x6'));var interaction=require(_0x786f('0x7'));var config=require(_0x786f('0x8'));var controller=require('./openchannelInteraction.controller');router[_0x786f('0x9')]('/',auth[_0x786f('0xa')](),controller[_0x786f('0xb')]);router[_0x786f('0x9')](_0x786f('0xc'),auth[_0x786f('0xa')](),controller['describe']);router[_0x786f('0x9')](_0x786f('0xd'),auth[_0x786f('0xa')](),controller[_0x786f('0xe')]);router[_0x786f('0x9')](_0x786f('0xf'),auth[_0x786f('0xa')](),controller[_0x786f('0x10')]);router[_0x786f('0x9')](_0x786f('0x11'),auth[_0x786f('0xa')](),controller[_0x786f('0x12')]);router[_0x786f('0x13')]('/',auth[_0x786f('0xa')](),controller['create']);router['post'](_0x786f('0xf'),auth[_0x786f('0xa')](),controller[_0x786f('0x14')]);router[_0x786f('0x13')](_0x786f('0x15'),auth[_0x786f('0xa')](),interaction[_0x786f('0x16')](_0x786f('0x17'),_0x786f('0x18')),controller['addTags']);router[_0x786f('0x19')]('/:id',auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x786f('0x1a')),controller[_0x786f('0x1b')]);router[_0x786f('0x1c')](_0x786f('0xd'),auth[_0x786f('0xa')](),interaction[_0x786f('0x16')](_0x786f('0x17'),'openchannelinteraction:destroy'),controller[_0x786f('0x1d')]);router[_0x786f('0x1c')]('/:id/tags',auth[_0x786f('0xa')](),controller['removeTags']);module[_0x786f('0x1e')]=router; \ No newline at end of file +var _0xec5d=['delete','openchannelinteraction:destroy','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update'];(function(_0x503103,_0x54af60){var _0x4ef8f3=function(_0x213e3d){while(--_0x213e3d){_0x503103['push'](_0x503103['shift']());}};_0x4ef8f3(++_0x54af60);}(_0xec5d,0x1a7));var _0xdec5=function(_0x6d04fb,_0x57fc9e){_0x6d04fb=_0x6d04fb-0x0;var _0x3bd644=_0xec5d[_0x6d04fb];return _0x3bd644;};'use strict';var multer=require('multer');var util=require(_0xdec5('0x0'));var path=require(_0xdec5('0x1'));var timeout=require(_0xdec5('0x2'));var express=require('express');var router=express[_0xdec5('0x3')]();var fs_extra=require(_0xdec5('0x4'));var auth=require(_0xdec5('0x5'));var interaction=require(_0xdec5('0x6'));var config=require(_0xdec5('0x7'));var controller=require(_0xdec5('0x8'));router[_0xdec5('0x9')]('/',auth[_0xdec5('0xa')](),controller['index']);router['get']('/describe',auth[_0xdec5('0xa')](),controller['describe']);router[_0xdec5('0x9')](_0xdec5('0xb'),auth[_0xdec5('0xa')](),controller[_0xdec5('0xc')]);router[_0xdec5('0x9')](_0xdec5('0xd'),auth['isAuthenticated'](),controller[_0xdec5('0xe')]);router[_0xdec5('0x9')](_0xdec5('0xf'),auth['isAuthenticated'](),controller[_0xdec5('0x10')]);router[_0xdec5('0x11')]('/',auth[_0xdec5('0xa')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xdec5('0x12')]);router[_0xdec5('0x11')](_0xdec5('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0xdec5('0x14'),_0xdec5('0x15')),controller['addTags']);router[_0xdec5('0x16')](_0xdec5('0xb'),auth[_0xdec5('0xa')](),interaction[_0xdec5('0x17')](_0xdec5('0x14'),_0xdec5('0x18')),controller['update']);router[_0xdec5('0x19')]('/:id',auth[_0xdec5('0xa')](),interaction['tracked'](_0xdec5('0x14'),_0xdec5('0x1a')),controller[_0xdec5('0x1b')]);router['delete'](_0xdec5('0x13'),auth[_0xdec5('0xa')](),controller['removeTags']);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 3f28246..f7ec698 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 _0xab5b=['out','BOOLEAN','sequelize','exports','DATE','STRING','ENUM'];(function(_0x21cd26,_0x5b2940){var _0x4b751b=function(_0x14484f){while(--_0x14484f){_0x21cd26['push'](_0x21cd26['shift']());}};_0x4b751b(++_0x5b2940);}(_0xab5b,0x11a));var _0xbab5=function(_0x428fec,_0x2e718e){_0x428fec=_0x428fec-0x0;var _0x1d1efd=_0xab5b[_0x428fec];return _0x1d1efd;};'use strict';var Sequelize=require(_0xbab5('0x0'));module[_0xbab5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbab5('0x2')]},'disposition':{'type':Sequelize[_0xbab5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbab5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xbab5('0x3')]},'externalUrl':{'type':Sequelize[_0xbab5('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbab5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbab5('0x4')]('in',_0xbab5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbab5('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbab5('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xbab5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd28=['STRING','DATE','ENUM','out','exports','BOOLEAN'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xfd28,0x148));var _0x8fd2=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0xfd28[_0x35fabd];return _0x61a8ee;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'closed':{'type':Sequelize[_0x8fd2('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8fd2('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8fd2('0x2')]},'note':{'type':Sequelize[_0x8fd2('0x2')]},'read1stAt':{'type':Sequelize[_0x8fd2('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x8fd2('0x2')]},'lastMsgAt':{'type':Sequelize[_0x8fd2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8fd2('0x4')]('in',_0x8fd2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x8fd2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x8fd2('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3401d0e..1858630 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 _0xc07d=['emit','openchannelInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','push','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','createdAt','closed','threadId','Public','Private','basename','createReadStream','createWriteStream','out','System','read','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','show','from','model','keys','attributes','fields','includeAll','include','options','find','create','body','params','describe','OpenchannelMessage','ids','getMessages','findOne','filters','intersection','length','hasOwnProperty','order','sort','where','OpenchannelInteractionId','merge','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','findAll','color'];(function(_0x416c20,_0x93585d){var _0x2ca7ec=function(_0x1d64a7){while(--_0x1d64a7){_0x416c20['push'](_0x416c20['shift']());}};_0x2ca7ec(++_0x93585d);}(_0xc07d,0xb4));var _0xdc07=function(_0x496343,_0x1cd4cc){_0x496343=_0x496343-0x0;var _0x245e20=_0xc07d[_0x496343];return _0x245e20;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xdc07('0x0'));var moment=require(_0xdc07('0x1'));var util=require(_0xdc07('0x2'));var path=require(_0xdc07('0x3'));var ejs=require(_0xdc07('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xdc07('0x5'));var interaction=require(_0xdc07('0x6'));var qs=require(_0xdc07('0x7'));var pdf=require(_0xdc07('0x8'));var logger=require(_0xdc07('0x9'))(_0xdc07('0xa'));var config=require(_0xdc07('0xb'));var db=require(_0xdc07('0xc'))['db'];config['redis']=_[_0xdc07('0xd')](config[_0xdc07('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc07('0xf'))(new Redis(config['redis']));require(_0xdc07('0x10'))['register'](socket);function respondWithStatusCode(_0x388fbb,_0x3daa89){_0x3daa89=_0x3daa89||0xcc;return function(_0x5117ae){if(_0x5117ae){return _0x388fbb[_0xdc07('0x11')](_0x3daa89);}return _0x388fbb[_0xdc07('0x12')](_0x3daa89)[_0xdc07('0x13')]();};}function respondWithResult(_0x2ab50c,_0x381764){_0x381764=_0x381764||0xc8;return function(_0x42c8d2){if(_0x42c8d2){return _0x2ab50c[_0xdc07('0x12')](_0x381764)[_0xdc07('0x14')](_0x42c8d2);}};}function respondWithFilteredResult(_0x35a788,_0x4e6fc5){return function(_0x160262){if(_0x160262){var _0x2a9f56=typeof _0x4e6fc5[_0xdc07('0x15')]===_0xdc07('0x16')&&typeof _0x4e6fc5[_0xdc07('0x17')]===_0xdc07('0x16');var _0x201dc6=_0x160262[_0xdc07('0x18')];var _0x3dd71b=_0x2a9f56?0x0:_0x4e6fc5[_0xdc07('0x15')];var _0x5941a2=_0x2a9f56?_0x160262['count']:_0x4e6fc5[_0xdc07('0x15')]+_0x4e6fc5[_0xdc07('0x17')];var _0x5478b7;if(_0x5941a2>=_0x201dc6){_0x5941a2=_0x201dc6;_0x5478b7=0xc8;}else{_0x5478b7=0xce;}_0x35a788[_0xdc07('0x12')](_0x5478b7);return _0x35a788['set'](_0xdc07('0x19'),_0x3dd71b+'-'+_0x5941a2+'/'+_0x201dc6)[_0xdc07('0x14')](_0x160262);}return null;};}function saveUpdates(_0x52cd16){return function(_0x1f8788){if(_0x1f8788){return _0x1f8788[_0xdc07('0x1a')](_0x52cd16)[_0xdc07('0x1b')](function(_0x79882b){return _0x79882b;});}return null;};}function removeEntity(_0x4110d2){return function(_0x16e2e2){if(_0x16e2e2){return _0x16e2e2[_0xdc07('0x1c')]()[_0xdc07('0x1b')](function(){_0x4110d2[_0xdc07('0x12')](0xcc)[_0xdc07('0x13')]();});}};}function handleEntityNotFound(_0x1a560c){return function(_0x1338f8){if(!_0x1338f8){_0x1a560c['sendStatus'](0x194);}return _0x1338f8;};}function handleError(_0x51d104,_0x216f46){_0x216f46=_0x216f46||0x1f4;return function(_0x101de4){logger[_0xdc07('0x1d')](_0x101de4[_0xdc07('0x1e')]);if(_0x101de4[_0xdc07('0x1f')]){delete _0x101de4[_0xdc07('0x1f')];}_0x51d104[_0xdc07('0x12')](_0x216f46)[_0xdc07('0x20')](_0x101de4);};}exports[_0xdc07('0x21')]=function(_0x4be767,_0x1cc0f3){var _0x46e1a1={};var _0x25d43f=_[_0xdc07('0x22')](db[_0xdc07('0x23')][_0xdc07('0x24')],function(_0x5a948a){return{'name':_0x5a948a[_0xdc07('0x25')],'type':_0x5a948a[_0xdc07('0x26')][_0xdc07('0x27')]};});_0x46e1a1=qs[_0xdc07('0x28')](_0x25d43f,_0x4be767);return interaction['findAll'](_0xdc07('0x29'),_0x4be767[_0xdc07('0x2a')],_0x4be767[_0xdc07('0x2b')],_0x46e1a1,_0x25d43f)[_0xdc07('0x1b')](respondWithFilteredResult(_0x1cc0f3,_0x46e1a1))[_0xdc07('0x2c')](handleError(_0x1cc0f3,null));};exports[_0xdc07('0x2d')]=function(_0x331cd6,_0x30c6f7){var _0x4df80b={};if(_0x331cd6[_0xdc07('0x2a')]['type']&&_0x331cd6[_0xdc07('0x2a')]['type']===_0xdc07('0x2e')){_0x4df80b[_0xdc07('0x2e')]=_0x331cd6['params']['id'];}else{_0x4df80b['id']=_0x331cd6['params']['id'];}var _0xc41fd9={'raw':![],'where':_0x4df80b},_0xf372cd={};_0xf372cd[_0xdc07('0x2f')]=_[_0xdc07('0x30')](db[_0xdc07('0x23')]['rawAttributes']);_0xf372cd[_0xdc07('0x2a')]=_[_0xdc07('0x30')](_0x331cd6[_0xdc07('0x2a')]);_0xf372cd['filters']=_['intersection'](_0xf372cd[_0xdc07('0x2f')],_0xf372cd[_0xdc07('0x2a')]);_0xc41fd9[_0xdc07('0x31')]=_['intersection'](_0xf372cd['model'],qs[_0xdc07('0x32')](_0x331cd6['query'][_0xdc07('0x32')]));_0xc41fd9[_0xdc07('0x31')]=_0xc41fd9[_0xdc07('0x31')]['length']?_0xc41fd9['attributes']:_0xf372cd[_0xdc07('0x2f')];if(_0x331cd6[_0xdc07('0x2a')][_0xdc07('0x33')]){_0xc41fd9[_0xdc07('0x34')]=[{'all':!![]}];}_0xc41fd9=_['merge']({},_0xc41fd9,_0x331cd6[_0xdc07('0x35')]);return db[_0xdc07('0x23')][_0xdc07('0x36')](_0xc41fd9)[_0xdc07('0x1b')](handleEntityNotFound(_0x30c6f7,null))['then'](respondWithResult(_0x30c6f7,null))[_0xdc07('0x2c')](handleError(_0x30c6f7,null));};exports[_0xdc07('0x37')]=function(_0x281a78,_0x4b2dd6){return db['OpenchannelInteraction']['create'](_0x281a78[_0xdc07('0x38')],{})['then'](respondWithResult(_0x4b2dd6,0xc9))[_0xdc07('0x2c')](handleError(_0x4b2dd6,null));};exports['update']=function(_0xc270bc,_0x1ee880){if(_0xc270bc[_0xdc07('0x38')]['id']){delete _0xc270bc[_0xdc07('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0xc270bc[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x1ee880,null))['then'](saveUpdates(_0xc270bc[_0xdc07('0x38')],null))[_0xdc07('0x1b')](respondWithResult(_0x1ee880,null))[_0xdc07('0x2c')](handleError(_0x1ee880,null));};exports['destroy']=function(_0x59e8df,_0x153bb1){return db[_0xdc07('0x23')]['find']({'where':{'id':_0x59e8df[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x153bb1,null))[_0xdc07('0x1b')](removeEntity(_0x153bb1,null))[_0xdc07('0x2c')](handleError(_0x153bb1,null));};exports[_0xdc07('0x3a')]=function(_0x391c1f,_0x2d072c){return db[_0xdc07('0x23')][_0xdc07('0x3a')]()[_0xdc07('0x1b')](respondWithResult(_0x2d072c,null))[_0xdc07('0x2c')](handleError(_0x2d072c,null));};exports['addMessage']=function(_0x3a939d,_0x314ef8){return db[_0xdc07('0x3b')]['find']({'where':{'id':_0x3a939d[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x314ef8,null))[_0xdc07('0x1b')](function(_0xc959f){if(_0xc959f){return _0xc959f['addMessage'](_0x3a939d[_0xdc07('0x38')][_0xdc07('0x3c')],_['omit'](_0x3a939d[_0xdc07('0x38')],[_0xdc07('0x3c'),'id'])||{});}})[_0xdc07('0x1b')](respondWithResult(_0x314ef8,null))[_0xdc07('0x2c')](handleError(_0x314ef8,null));};exports[_0xdc07('0x3d')]=function(_0x1f8d25,_0x3b7cf4){var _0x1cb7cd={'raw':![],'where':{}};var _0x275f02={};var _0x3810f8={'count':0x0,'rows':[]};return db[_0xdc07('0x23')][_0xdc07('0x3e')]({'where':{'id':_0x1f8d25[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x3b7cf4,null))['then'](function(_0x1e6f2e){if(_0x1e6f2e){_0x275f02[_0xdc07('0x2f')]=_[_0xdc07('0x30')](db['OpenchannelMessage'][_0xdc07('0x24')]);_0x275f02[_0xdc07('0x2a')]=_[_0xdc07('0x30')](_0x1f8d25[_0xdc07('0x2a')]);_0x275f02[_0xdc07('0x3f')]=_[_0xdc07('0x40')](_0x275f02['model'],_0x275f02[_0xdc07('0x2a')]);_0x1cb7cd[_0xdc07('0x31')]=_['intersection'](_0x275f02['model'],qs[_0xdc07('0x32')](_0x1f8d25['query']['fields']));_0x1cb7cd[_0xdc07('0x31')]=_0x1cb7cd[_0xdc07('0x31')][_0xdc07('0x41')]?_0x1cb7cd[_0xdc07('0x31')]:_0x275f02[_0xdc07('0x2f')];if(!_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x42')]('nolimit')){_0x1cb7cd['limit']=qs[_0xdc07('0x17')](_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x17')]);_0x1cb7cd[_0xdc07('0x15')]=qs[_0xdc07('0x15')](_0x1f8d25[_0xdc07('0x2a')]['offset']);}_0x1cb7cd[_0xdc07('0x43')]=qs[_0xdc07('0x44')](_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x44')]);_0x1cb7cd[_0xdc07('0x45')]=qs[_0xdc07('0x3f')](_['pick'](_0x1f8d25[_0xdc07('0x2a')],_0x275f02[_0xdc07('0x3f')]));_0x1cb7cd[_0xdc07('0x45')][_0xdc07('0x46')]=_0x1e6f2e['id'];if(_0x1f8d25['query']['filter']){_0x1cb7cd[_0xdc07('0x45')]=_[_0xdc07('0x47')](_0x1cb7cd[_0xdc07('0x45')],{'$or':_[_0xdc07('0x22')](_0x1cb7cd[_0xdc07('0x31')],function(_0x23638d){var _0x534d77={};_0x534d77[_0x23638d]={'$like':'%'+_0x1f8d25['query'][_0xdc07('0x48')]+'%'};return _0x534d77;})});}if(_0x1f8d25['query'][_0xdc07('0x49')]){var _0x5bd651=_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x49')][_0xdc07('0x4a')](',');var _0x89d8f9={};_0x89d8f9[_0x5bd651[0x0]]={'$gte':moment(_0x5bd651[0x1])['format'](_0xdc07('0x4b'))};_0x1cb7cd[_0xdc07('0x45')]=_['merge'](_0x1cb7cd[_0xdc07('0x45')],_0x89d8f9);}_0x1cb7cd=_[_0xdc07('0x47')]({},_0x1cb7cd,_0x1f8d25[_0xdc07('0x35')]);return db[_0xdc07('0x3b')][_0xdc07('0x18')]({'where':_0x1cb7cd['where']})[_0xdc07('0x1b')](function(_0x3b1a67){_0x3810f8[_0xdc07('0x18')]=_0x3b1a67;if(_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x33')]){_0x1cb7cd[_0xdc07('0x34')]=[{'all':!![]}];}return db[_0xdc07('0x3b')]['findAll'](_0x1cb7cd);})['then'](function(_0x565d5d){_0x3810f8[_0xdc07('0x4c')]=_0x565d5d;return _0x3810f8;});}})[_0xdc07('0x1b')](respondWithFilteredResult(_0x3b7cf4,_0x1cb7cd))[_0xdc07('0x2c')](handleError(_0x3b7cf4,null));};exports[_0xdc07('0x4d')]=function(_0x9efe36,_0x163740){return db['OpenchannelInteraction'][_0xdc07('0x36')]({'where':{'id':_0x9efe36[_0xdc07('0x39')]['id']}})['then'](handleEntityNotFound(_0x163740,null))[_0xdc07('0x1b')](function(_0x491565){if(_0x491565){return _0x491565[_0xdc07('0x4e')](_0x9efe36[_0xdc07('0x38')][_0xdc07('0x3c')],_[_0xdc07('0x4f')](_0x9efe36['body'],[_0xdc07('0x3c'),'id'])||{})[_0xdc07('0x50')](function(){return db[_0xdc07('0x51')][_0xdc07('0x52')]({'attributes':['id',_0xdc07('0x1f'),_0xdc07('0x53')],'where':{'id':_0x9efe36[_0xdc07('0x38')]['ids']}});})[_0xdc07('0x1b')](function(_0x3114e1){socket[_0xdc07('0x54')](_0xdc07('0x55'),{'id':Number(_0x9efe36[_0xdc07('0x39')]['id']),'tags':_0x3114e1||[]});return{'id':Number(_0x9efe36[_0xdc07('0x39')]['id']),'tags':_0x3114e1||[]};});}})['then'](respondWithResult(_0x163740,null))[_0xdc07('0x2c')](handleError(_0x163740,null));};exports[_0xdc07('0x56')]=function(_0x3ff8c4,_0x42bf32){return db[_0xdc07('0x23')][_0xdc07('0x36')]({'where':{'id':_0x3ff8c4['params']['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x42bf32,null))[_0xdc07('0x1b')](function(_0x12aced){if(_0x12aced){return _0x12aced[_0xdc07('0x56')](_0x3ff8c4[_0xdc07('0x2a')]['ids']);}})['then'](respondWithStatusCode(_0x42bf32,null))[_0xdc07('0x2c')](handleError(_0x42bf32,null));};exports['download']=function(_0x56acf3,_0xe6a00a){var _0x22667c=moment()[_0xdc07('0x57')]()[_0xdc07('0x58')]();var _0x5a5a8e=path['join'](config['root'],_0xdc07('0x59'),_0xdc07('0x5a'),_0xdc07('0x5b'));var _0xb03e74=path[_0xdc07('0x5c')](config[_0xdc07('0x5d')],_0xdc07('0x59'),_0xdc07('0x5a'),_0xdc07('0x5e'));var _0x1d0647=path['join'](_0x5a5a8e,_0x22667c);var _0x57dfd9=util[_0xdc07('0x5f')](_0xdc07('0x60'),_0x56acf3[_0xdc07('0x39')]['id'],_0x22667c);var _0xa67eb9=path['join'](_0x5a5a8e,_0x57dfd9);var _0x4f4be0=[];_0x4f4be0['push']({'model':db[_0xdc07('0x61')],'as':_0xdc07('0x61'),'attributes':['id',_0xdc07('0x62')],'raw':!![]});_0x4f4be0['push']({'model':db[_0xdc07('0x63')],'as':_0xdc07('0x64'),'attributes':['id',_0xdc07('0x65'),_0xdc07('0x66')],'raw':!![]});if(_0x56acf3[_0xdc07('0x2a')][_0xdc07('0x5e')]){_0x4f4be0['push']({'model':db[_0xdc07('0x67')],'as':_0xdc07('0x67'),'raw':!![]});}var _0x48e87a=[{'model':db['OpenchannelMessage'],'as':_0xdc07('0x68'),'attributes':['id',_0xdc07('0x38'),'createdAt',_0xdc07('0x69'),_0xdc07('0x6a'),'read'],'include':_0x4f4be0}];_0x48e87a[_0xdc07('0x6b')]({'model':db[_0xdc07('0x6c')],'as':_0xdc07('0x6d'),'attributes':['id',_0xdc07('0x1f')]});_0x48e87a[_0xdc07('0x6b')]({'model':db[_0xdc07('0x61')],'as':'Owner','attributes':['id',_0xdc07('0x62')]});return db['OpenchannelInteraction'][_0xdc07('0x36')]({'where':{'id':_0x56acf3[_0xdc07('0x39')]['id']},'include':_0x48e87a})['then'](handleEntityNotFound(_0xe6a00a,null))[_0xdc07('0x1b')](function(_0x174b9f){if(_0x174b9f){var _0x169f91=_0x174b9f[_0xdc07('0x6e')]({'plain':!![]});fs['mkdirSync'](_0x1d0647);var _0x5205be={'channel':_0xdc07('0x6f'),'account':_0x169f91[_0xdc07('0x6d')]['name'],'agent':_0x169f91[_0xdc07('0x70')]?_0x169f91[_0xdc07('0x70')][_0xdc07('0x62')]:_0xdc07('0x71'),'createdAt':moment(_0x169f91[_0xdc07('0x72')])[_0xdc07('0x5f')](_0xdc07('0x4b'))[_0xdc07('0x58')](),'closedAt':_0x169f91[_0xdc07('0x73')]?moment(_0x169f91['closedAt'])[_0xdc07('0x5f')](_0xdc07('0x4b'))[_0xdc07('0x58')]():'','disposition':_0x169f91['disposition'],'visibility':_0x169f91[_0xdc07('0x74')]?_0xdc07('0x75'):_0xdc07('0x76'),'messages':_(_0x169f91[_0xdc07('0x68')])[_0xdc07('0x48')]({'secret':![]})[_0xdc07('0x22')](function(_0x44e515){if(_0x44e515[_0xdc07('0x67')]){var _0x36cccd=path[_0xdc07('0x5c')](_0xb03e74,_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')]);if(fs['existsSync'](_0x36cccd)){fs[_0xdc07('0x78')](_0x36cccd)['pipe'](fs[_0xdc07('0x79')](path[_0xdc07('0x5c')](_0x1d0647,_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')])));}}return{'date':moment(_0x44e515[_0xdc07('0x72')])[_0xdc07('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdc07('0x58')](),'sender':_0x44e515[_0xdc07('0x69')]===_0xdc07('0x7a')?_0x44e515['User']?_0x44e515[_0xdc07('0x61')][_0xdc07('0x62')]:_0xdc07('0x7b'):_0x44e515['Contact'][_0xdc07('0x65')]+(_0x44e515[_0xdc07('0x64')][_0xdc07('0x66')]?'\x20'+_0x44e515[_0xdc07('0x64')]['lastName']:''),'body':_0x44e515['Attachment']?_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')]:_0x44e515[_0xdc07('0x38')],'direction':_0x44e515['direction']===_0xdc07('0x7a')?'A':'C','secret':_0x44e515[_0xdc07('0x6a')],'read':_0x44e515[_0xdc07('0x7c')],'attachment':_0x44e515[_0xdc07('0x67')]};})['value']()};return ejs[_0xdc07('0x7d')](path[_0xdc07('0x5c')](config[_0xdc07('0x5d')],_0xdc07('0x59'),'views',_0xdc07('0x7e')),{'interaction':_0x5205be})['then'](function(_0xce37b8){var _0x44bd8a=path[_0xdc07('0x5c')](_0x1d0647,'transcript-'+_0x169f91['id']+'-'+_0x22667c+_0xdc07('0x7f'));var _0x96dcfe={'path':_0x44bd8a,'channel':_0xdc07('0x6f'),'interactionId':_0x169f91['id']};return pdf[_0xdc07('0x80')](_0xce37b8,_0x96dcfe);})['then'](function(){return new Promise(function(_0x5a0b44,_0x17f212){zipdir(_0x1d0647,{'saveTo':_0xa67eb9},function(_0x304b99,_0x1c53f3){if(_0x304b99)return _0x17f212(_0x304b99);return _0x5a0b44(_0x1c53f3);});})[_0xdc07('0x1b')](function(){return new Promise(function(_0x51f9a1,_0x513e04){rimraf(_0x1d0647,function(_0x5c0573){if(_0x5c0573)_0x513e04(_0x5c0573);return _0x51f9a1();});});})[_0xdc07('0x1b')](function(){return _0xe6a00a[_0xdc07('0x81')](_0xa67eb9,_0x57dfd9,function(_0x83b842){if(_0x83b842){logger[_0xdc07('0x1d')](_0xdc07('0x82'),_0x83b842);}else{fs[_0xdc07('0x83')](_0xa67eb9);}});});});}else{return _0xe6a00a[_0xdc07('0x11')](0xc8);}})[_0xdc07('0x2c')](handleError(_0xe6a00a,null));}; \ No newline at end of file +var _0x4747=['options','findAll','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','files','root','server','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','openchannel','query','show','from','params','model','OpenchannelInteraction','filters','attributes','fields','length','includeAll','include','merge','find','create','body','catch','describe','addMessage','ids','omit','findOne','keys','OpenchannelMessage','intersection','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format'];(function(_0x2a6afe,_0x430775){var _0x499551=function(_0x45fb2a){while(--_0x45fb2a){_0x2a6afe['push'](_0x2a6afe['shift']());}};_0x499551(++_0x430775);}(_0x4747,0xb8));var _0x7474=function(_0x4c7ee1,_0xdd33ba){_0x4c7ee1=_0x4c7ee1-0x0;var _0x3576fb=_0x4747[_0x4c7ee1];return _0x3576fb;};'use strict';var rimraf=require(_0x7474('0x0'));var zipdir=require(_0x7474('0x1'));var moment=require(_0x7474('0x2'));var util=require('util');var path=require(_0x7474('0x3'));var ejs=require(_0x7474('0x4'));var fs=require('fs');var _=require(_0x7474('0x5'));var Redis=require(_0x7474('0x6'));var interaction=require(_0x7474('0x7'));var qs=require(_0x7474('0x8'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x7474('0x9'))['db'];config[_0x7474('0xa')]=_[_0x7474('0xb')](config['redis'],{'host':_0x7474('0xc'),'port':0x18eb});var socket=require(_0x7474('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x7474('0xe')](socket);function respondWithStatusCode(_0x514844,_0x527850){_0x527850=_0x527850||0xcc;return function(_0x4deb0e){if(_0x4deb0e){return _0x514844[_0x7474('0xf')](_0x527850);}return _0x514844[_0x7474('0x10')](_0x527850)[_0x7474('0x11')]();};}function respondWithResult(_0x8b12b7,_0x1dc68d){_0x1dc68d=_0x1dc68d||0xc8;return function(_0x24b2bd){if(_0x24b2bd){return _0x8b12b7[_0x7474('0x10')](_0x1dc68d)[_0x7474('0x12')](_0x24b2bd);}};}function respondWithFilteredResult(_0x8c3d79,_0x45636b){return function(_0x2d147e){if(_0x2d147e){var _0x547087=typeof _0x45636b['offset']===_0x7474('0x13')&&typeof _0x45636b[_0x7474('0x14')]==='undefined';var _0x40e466=_0x2d147e['count'];var _0x46d110=_0x547087?0x0:_0x45636b['offset'];var _0x5b3e39=_0x547087?_0x2d147e[_0x7474('0x15')]:_0x45636b[_0x7474('0x16')]+_0x45636b[_0x7474('0x14')];var _0x3c705b;if(_0x5b3e39>=_0x40e466){_0x5b3e39=_0x40e466;_0x3c705b=0xc8;}else{_0x3c705b=0xce;}_0x8c3d79[_0x7474('0x10')](_0x3c705b);return _0x8c3d79[_0x7474('0x17')]('Content-Range',_0x46d110+'-'+_0x5b3e39+'/'+_0x40e466)[_0x7474('0x12')](_0x2d147e);}return null;};}function saveUpdates(_0x875d0f){return function(_0x2cdfd2){if(_0x2cdfd2){return _0x2cdfd2[_0x7474('0x18')](_0x875d0f)[_0x7474('0x19')](function(_0x37214c){return _0x37214c;});}return null;};}function removeEntity(_0x3122db){return function(_0x1b9613){if(_0x1b9613){return _0x1b9613[_0x7474('0x1a')]()[_0x7474('0x19')](function(){_0x3122db['status'](0xcc)[_0x7474('0x11')]();});}};}function handleEntityNotFound(_0x569214){return function(_0x2b6f52){if(!_0x2b6f52){_0x569214['sendStatus'](0x194);}return _0x2b6f52;};}function handleError(_0x10bc79,_0x43cf74){_0x43cf74=_0x43cf74||0x1f4;return function(_0x3019c4){logger['error'](_0x3019c4[_0x7474('0x1b')]);if(_0x3019c4[_0x7474('0x1c')]){delete _0x3019c4[_0x7474('0x1c')];}_0x10bc79[_0x7474('0x10')](_0x43cf74)['send'](_0x3019c4);};}exports[_0x7474('0x1d')]=function(_0x5bc7ad,_0xd85a92){var _0x2a7948={};var _0x19924a=_[_0x7474('0x1e')](db['OpenchannelInteraction'][_0x7474('0x1f')],function(_0x344b73){return{'name':_0x344b73[_0x7474('0x20')],'type':_0x344b73[_0x7474('0x21')][_0x7474('0x22')]};});_0x2a7948=qs[_0x7474('0x23')](_0x19924a,_0x5bc7ad);return interaction['findAll'](_0x7474('0x24'),_0x5bc7ad[_0x7474('0x25')],_0x5bc7ad['user'],_0x2a7948,_0x19924a)[_0x7474('0x19')](respondWithFilteredResult(_0xd85a92,_0x2a7948))['catch'](handleError(_0xd85a92,null));};exports[_0x7474('0x26')]=function(_0x597a96,_0x34c4cc){var _0x4e232f={};if(_0x597a96[_0x7474('0x25')][_0x7474('0x21')]&&_0x597a96[_0x7474('0x25')][_0x7474('0x21')]===_0x7474('0x27')){_0x4e232f[_0x7474('0x27')]=_0x597a96[_0x7474('0x28')]['id'];}else{_0x4e232f['id']=_0x597a96['params']['id'];}var _0x445aa6={'raw':![],'where':_0x4e232f},_0x94bcbd={};_0x94bcbd[_0x7474('0x29')]=_['keys'](db[_0x7474('0x2a')][_0x7474('0x1f')]);_0x94bcbd['query']=_['keys'](_0x597a96[_0x7474('0x25')]);_0x94bcbd[_0x7474('0x2b')]=_['intersection'](_0x94bcbd[_0x7474('0x29')],_0x94bcbd['query']);_0x445aa6[_0x7474('0x2c')]=_['intersection'](_0x94bcbd[_0x7474('0x29')],qs[_0x7474('0x2d')](_0x597a96['query'][_0x7474('0x2d')]));_0x445aa6['attributes']=_0x445aa6[_0x7474('0x2c')][_0x7474('0x2e')]?_0x445aa6[_0x7474('0x2c')]:_0x94bcbd['model'];if(_0x597a96[_0x7474('0x25')][_0x7474('0x2f')]){_0x445aa6[_0x7474('0x30')]=[{'all':!![]}];}_0x445aa6=_[_0x7474('0x31')]({},_0x445aa6,_0x597a96['options']);return db['OpenchannelInteraction'][_0x7474('0x32')](_0x445aa6)[_0x7474('0x19')](handleEntityNotFound(_0x34c4cc,null))[_0x7474('0x19')](respondWithResult(_0x34c4cc,null))['catch'](handleError(_0x34c4cc,null));};exports[_0x7474('0x33')]=function(_0x2f6200,_0x192a9b){return db[_0x7474('0x2a')][_0x7474('0x33')](_0x2f6200[_0x7474('0x34')],{})['then'](respondWithResult(_0x192a9b,0xc9))[_0x7474('0x35')](handleError(_0x192a9b,null));};exports[_0x7474('0x18')]=function(_0x23f4b1,_0x49fe50){if(_0x23f4b1[_0x7474('0x34')]['id']){delete _0x23f4b1[_0x7474('0x34')]['id'];}return db[_0x7474('0x2a')][_0x7474('0x32')]({'where':{'id':_0x23f4b1[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0x49fe50,null))['then'](saveUpdates(_0x23f4b1[_0x7474('0x34')],null))[_0x7474('0x19')](respondWithResult(_0x49fe50,null))[_0x7474('0x35')](handleError(_0x49fe50,null));};exports['destroy']=function(_0x591072,_0x555669){return db['OpenchannelInteraction'][_0x7474('0x32')]({'where':{'id':_0x591072[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0x555669,null))[_0x7474('0x19')](removeEntity(_0x555669,null))[_0x7474('0x35')](handleError(_0x555669,null));};exports[_0x7474('0x36')]=function(_0xd6624b,_0x31fe80){return db[_0x7474('0x2a')][_0x7474('0x36')]()[_0x7474('0x19')](respondWithResult(_0x31fe80,null))[_0x7474('0x35')](handleError(_0x31fe80,null));};exports[_0x7474('0x37')]=function(_0x4ca97f,_0x196c6c){return db['OpenchannelMessage'][_0x7474('0x32')]({'where':{'id':_0x4ca97f[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0x196c6c,null))[_0x7474('0x19')](function(_0x4d7a96){if(_0x4d7a96){return _0x4d7a96[_0x7474('0x37')](_0x4ca97f['body'][_0x7474('0x38')],_[_0x7474('0x39')](_0x4ca97f[_0x7474('0x34')],[_0x7474('0x38'),'id'])||{});}})['then'](respondWithResult(_0x196c6c,null))[_0x7474('0x35')](handleError(_0x196c6c,null));};exports['getMessages']=function(_0x14773f,_0x403c2d){var _0x4595b0={'raw':![],'where':{}};var _0x259e20={};var _0x2d6e99={'count':0x0,'rows':[]};return db[_0x7474('0x2a')][_0x7474('0x3a')]({'where':{'id':_0x14773f[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0x403c2d,null))[_0x7474('0x19')](function(_0x471352){if(_0x471352){_0x259e20['model']=_[_0x7474('0x3b')](db[_0x7474('0x3c')][_0x7474('0x1f')]);_0x259e20[_0x7474('0x25')]=_['keys'](_0x14773f['query']);_0x259e20[_0x7474('0x2b')]=_[_0x7474('0x3d')](_0x259e20[_0x7474('0x29')],_0x259e20[_0x7474('0x25')]);_0x4595b0['attributes']=_[_0x7474('0x3d')](_0x259e20[_0x7474('0x29')],qs[_0x7474('0x2d')](_0x14773f[_0x7474('0x25')][_0x7474('0x2d')]));_0x4595b0[_0x7474('0x2c')]=_0x4595b0[_0x7474('0x2c')][_0x7474('0x2e')]?_0x4595b0['attributes']:_0x259e20[_0x7474('0x29')];if(!_0x14773f[_0x7474('0x25')][_0x7474('0x3e')](_0x7474('0x3f'))){_0x4595b0[_0x7474('0x14')]=qs[_0x7474('0x14')](_0x14773f['query'][_0x7474('0x14')]);_0x4595b0['offset']=qs[_0x7474('0x16')](_0x14773f[_0x7474('0x25')][_0x7474('0x16')]);}_0x4595b0['order']=qs[_0x7474('0x40')](_0x14773f['query'][_0x7474('0x40')]);_0x4595b0[_0x7474('0x41')]=qs[_0x7474('0x2b')](_[_0x7474('0x42')](_0x14773f[_0x7474('0x25')],_0x259e20['filters']));_0x4595b0[_0x7474('0x41')][_0x7474('0x43')]=_0x471352['id'];if(_0x14773f[_0x7474('0x25')][_0x7474('0x44')]){_0x4595b0[_0x7474('0x41')]=_[_0x7474('0x31')](_0x4595b0[_0x7474('0x41')],{'$or':_[_0x7474('0x1e')](_0x4595b0[_0x7474('0x2c')],function(_0x403115){var _0x494c={};_0x494c[_0x403115]={'$like':'%'+_0x14773f[_0x7474('0x25')][_0x7474('0x44')]+'%'};return _0x494c;})});}if(_0x14773f[_0x7474('0x25')][_0x7474('0x45')]){var _0xc9bacb=_0x14773f[_0x7474('0x25')][_0x7474('0x45')][_0x7474('0x46')](',');var _0x48bfaa={};_0x48bfaa[_0xc9bacb[0x0]]={'$gte':moment(_0xc9bacb[0x1])[_0x7474('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4595b0[_0x7474('0x41')]=_[_0x7474('0x31')](_0x4595b0['where'],_0x48bfaa);}_0x4595b0=_[_0x7474('0x31')]({},_0x4595b0,_0x14773f[_0x7474('0x48')]);return db[_0x7474('0x3c')]['count']({'where':_0x4595b0[_0x7474('0x41')]})[_0x7474('0x19')](function(_0x55235d){_0x2d6e99['count']=_0x55235d;if(_0x14773f[_0x7474('0x25')][_0x7474('0x2f')]){_0x4595b0['include']=[{'all':!![]}];}return db[_0x7474('0x3c')][_0x7474('0x49')](_0x4595b0);})[_0x7474('0x19')](function(_0x3ace05){_0x2d6e99['rows']=_0x3ace05;return _0x2d6e99;});}})[_0x7474('0x19')](respondWithFilteredResult(_0x403c2d,_0x4595b0))[_0x7474('0x35')](handleError(_0x403c2d,null));};exports[_0x7474('0x4a')]=function(_0x2b904a,_0xa01cd9){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2b904a[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0xa01cd9,null))['then'](function(_0x472a47){if(_0x472a47){return _0x472a47['setTags'](_0x2b904a[_0x7474('0x34')][_0x7474('0x38')],_['omit'](_0x2b904a[_0x7474('0x34')],[_0x7474('0x38'),'id'])||{})[_0x7474('0x4b')](function(){return db[_0x7474('0x4c')][_0x7474('0x49')]({'attributes':['id','name',_0x7474('0x4d')],'where':{'id':_0x2b904a[_0x7474('0x34')]['ids']}});})[_0x7474('0x19')](function(_0x3fd102){socket[_0x7474('0x4e')](_0x7474('0x4f'),{'id':Number(_0x2b904a[_0x7474('0x28')]['id']),'tags':_0x3fd102||[]});return{'id':Number(_0x2b904a['params']['id']),'tags':_0x3fd102||[]};});}})[_0x7474('0x19')](respondWithResult(_0xa01cd9,null))[_0x7474('0x35')](handleError(_0xa01cd9,null));};exports[_0x7474('0x50')]=function(_0x35299f,_0x53842a){return db[_0x7474('0x2a')][_0x7474('0x32')]({'where':{'id':_0x35299f[_0x7474('0x28')]['id']}})[_0x7474('0x19')](handleEntityNotFound(_0x53842a,null))[_0x7474('0x19')](function(_0x5aaf09){if(_0x5aaf09){return _0x5aaf09[_0x7474('0x50')](_0x35299f[_0x7474('0x25')]['ids']);}})['then'](respondWithStatusCode(_0x53842a,null))['catch'](handleError(_0x53842a,null));};exports[_0x7474('0x51')]=function(_0x131a9e,_0x41f082){var _0x549163=moment()[_0x7474('0x52')]()[_0x7474('0x53')]();var _0x14671b=path[_0x7474('0x54')](config['root'],'server',_0x7474('0x55'),'tmp');var _0x41d4fb=path[_0x7474('0x54')](config[_0x7474('0x56')],_0x7474('0x57'),'files','attachments');var _0x183f11=path[_0x7474('0x54')](_0x14671b,_0x549163);var _0x528ac8=util[_0x7474('0x47')](_0x7474('0x58'),_0x131a9e[_0x7474('0x28')]['id'],_0x549163);var _0x1475bf=path['join'](_0x14671b,_0x528ac8);var _0x5cb253=[];_0x5cb253[_0x7474('0x59')]({'model':db[_0x7474('0x5a')],'as':'User','attributes':['id',_0x7474('0x5b')],'raw':!![]});_0x5cb253[_0x7474('0x59')]({'model':db[_0x7474('0x5c')],'as':_0x7474('0x5d'),'attributes':['id',_0x7474('0x5e'),'lastName'],'raw':!![]});if(_0x131a9e[_0x7474('0x25')][_0x7474('0x5f')]){_0x5cb253[_0x7474('0x59')]({'model':db[_0x7474('0x60')],'as':_0x7474('0x60'),'raw':!![]});}var _0x16decf=[{'model':db[_0x7474('0x3c')],'as':'Messages','attributes':['id',_0x7474('0x34'),_0x7474('0x61'),_0x7474('0x62'),_0x7474('0x63'),_0x7474('0x64')],'include':_0x5cb253}];_0x16decf['push']({'model':db['OpenchannelAccount'],'as':_0x7474('0x65'),'attributes':['id','name']});_0x16decf[_0x7474('0x59')]({'model':db['User'],'as':_0x7474('0x66'),'attributes':['id',_0x7474('0x5b')]});return db[_0x7474('0x2a')][_0x7474('0x32')]({'where':{'id':_0x131a9e[_0x7474('0x28')]['id']},'include':_0x16decf})[_0x7474('0x19')](handleEntityNotFound(_0x41f082,null))[_0x7474('0x19')](function(_0x4d1924){if(_0x4d1924){var _0x1cfe48=_0x4d1924[_0x7474('0x67')]({'plain':!![]});fs[_0x7474('0x68')](_0x183f11);var _0x4af74d={'channel':_0x7474('0x69'),'account':_0x1cfe48[_0x7474('0x65')][_0x7474('0x1c')],'agent':_0x1cfe48[_0x7474('0x66')]?_0x1cfe48[_0x7474('0x66')][_0x7474('0x5b')]:'N.A.','createdAt':moment(_0x1cfe48[_0x7474('0x61')])['format'](_0x7474('0x6a'))[_0x7474('0x53')](),'closedAt':_0x1cfe48[_0x7474('0x6b')]?moment(_0x1cfe48[_0x7474('0x6c')])['format'](_0x7474('0x6a'))[_0x7474('0x53')]():'','disposition':_0x1cfe48[_0x7474('0x6d')],'visibility':_0x1cfe48[_0x7474('0x6e')]?_0x7474('0x6f'):_0x7474('0x70'),'messages':_(_0x1cfe48[_0x7474('0x71')])['filter']({'secret':![]})[_0x7474('0x1e')](function(_0x1748da){if(_0x1748da[_0x7474('0x60')]){var _0x49592c=path[_0x7474('0x54')](_0x41d4fb,_0x1748da[_0x7474('0x60')][_0x7474('0x72')]);if(fs['existsSync'](_0x49592c)){fs[_0x7474('0x73')](_0x49592c)[_0x7474('0x74')](fs[_0x7474('0x75')](path['join'](_0x183f11,_0x1748da[_0x7474('0x60')][_0x7474('0x72')])));}}return{'date':moment(_0x1748da[_0x7474('0x61')])['format'](_0x7474('0x6a'))[_0x7474('0x53')](),'sender':_0x1748da[_0x7474('0x62')]===_0x7474('0x76')?_0x1748da[_0x7474('0x5a')]?_0x1748da[_0x7474('0x5a')][_0x7474('0x5b')]:_0x7474('0x77'):_0x1748da[_0x7474('0x5d')][_0x7474('0x5e')]+(_0x1748da['Contact'][_0x7474('0x78')]?'\x20'+_0x1748da[_0x7474('0x5d')]['lastName']:''),'body':_0x1748da[_0x7474('0x60')]?_0x1748da['Attachment']['basename']:_0x1748da[_0x7474('0x34')],'direction':_0x1748da['direction']===_0x7474('0x76')?'A':'C','secret':_0x1748da[_0x7474('0x63')],'read':_0x1748da[_0x7474('0x64')],'attachment':_0x1748da['Attachment']};})['value']()};return ejs[_0x7474('0x79')](path['join'](config['root'],'server',_0x7474('0x7a'),_0x7474('0x7b')),{'interaction':_0x4af74d})[_0x7474('0x19')](function(_0x4342bd){var _0x1a68f0=path[_0x7474('0x54')](_0x183f11,'transcript-'+_0x1cfe48['id']+'-'+_0x549163+'.pdf');var _0x4c8f7e={'path':_0x1a68f0,'channel':_0x7474('0x69'),'interactionId':_0x1cfe48['id']};return pdf[_0x7474('0x7c')](_0x4342bd,_0x4c8f7e);})['then'](function(){return new Promise(function(_0x5dfcaf,_0x4135b0){zipdir(_0x183f11,{'saveTo':_0x1475bf},function(_0x495250,_0x40f3df){if(_0x495250)return _0x4135b0(_0x495250);return _0x5dfcaf(_0x40f3df);});})[_0x7474('0x19')](function(){return new Promise(function(_0x796a00,_0x395251){rimraf(_0x183f11,function(_0x5e7c2e){if(_0x5e7c2e)_0x395251(_0x5e7c2e);return _0x796a00();});});})[_0x7474('0x19')](function(){return _0x41f082[_0x7474('0x51')](_0x1475bf,_0x528ac8,function(_0x9b7b4d){if(_0x9b7b4d){logger[_0x7474('0x7d')](_0x7474('0x7e'),_0x9b7b4d);}else{fs[_0x7474('0x7f')](_0x1475bf);}});});});}else{return _0x41f082[_0x7474('0xf')](0xc8);}})[_0x7474('0x35')](handleError(_0x41f082,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e7af9ec..5b3c874 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 _0x1153=['OpenchannelInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue','map','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x3f97d8,_0x4cd760){var _0x1b5aae=function(_0xfe3849){while(--_0xfe3849){_0x3f97d8['push'](_0x3f97d8['shift']());}};_0x1b5aae(++_0x4cd760);}(_0x1153,0xfd));var _0x3115=function(_0x1bc0de,_0x427edc){_0x1bc0de=_0x1bc0de-0x0;var _0x1abb21=_0x1153[_0x1bc0de];return _0x1abb21;};'use strict';var EventEmitter=require(_0x3115('0x0'));var OpenchannelInteraction=require(_0x3115('0x1'))['db'][_0x3115('0x2')];var OpenchannelMessage=require(_0x3115('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3115('0x3')](0x0);var events={'afterCreate':_0x3115('0x4'),'afterUpdate':'update','afterDestroy':_0x3115('0x5')};function emitEvent(_0x6318cb){return function(_0x1dceed,_0x1352ea,_0x1b0e17){_0x1dceed[_0x3115('0x6')]({'attributes':['id'],'raw':!![]})[_0x3115('0x7')](function(_0x25efd4){_0x1dceed[_0x3115('0x8')]('Users',_0x25efd4[_0x3115('0x9')](function(_0x3576f2){return{'id':_0x3576f2['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1dceed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3115('0x7')](function(_0x11a7b2){_0x1dceed[_0x3115('0x8')]('unreadMessages',_0x11a7b2[_0x3115('0xa')]);OpenchannelInteractionEvents[_0x3115('0xb')](_0x6318cb+':'+_0x1dceed['id'],_0x1dceed);OpenchannelInteractionEvents[_0x3115('0xb')](_0x6318cb,_0x1dceed);_0x1b0e17(null);})[_0x3115('0xc')](_0x1b0e17(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x3115('0xd')](e,emitEvent(event));}}module[_0x3115('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1256=['save','update','remove','getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0x10e57d,_0x223327){var _0x499611=function(_0x181a23){while(--_0x181a23){_0x10e57d['push'](_0x10e57d['shift']());}};_0x499611(++_0x223327);}(_0x1256,0xe6));var _0x6125=function(_0x4ab4ef,_0xcde4fa){_0x4ab4ef=_0x4ab4ef-0x0;var _0x333751=_0x1256[_0x4ab4ef];return _0x333751;};'use strict';var EventEmitter=require(_0x6125('0x0'));var OpenchannelInteraction=require(_0x6125('0x1'))['db'][_0x6125('0x2')];var OpenchannelMessage=require(_0x6125('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6125('0x3')](0x0);var events={'afterCreate':_0x6125('0x4'),'afterUpdate':_0x6125('0x5'),'afterDestroy':_0x6125('0x6')};function emitEvent(_0x2b6f39){return function(_0x189fa8,_0x452d3e,_0x3558cb){_0x189fa8[_0x6125('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2a0aa2){_0x189fa8[_0x6125('0x8')](_0x6125('0x9'),_0x2a0aa2['map'](function(_0x3c327f){return{'id':_0x3c327f['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x189fa8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6125('0xa')](function(_0x365da5){_0x189fa8[_0x6125('0x8')](_0x6125('0xb'),_0x365da5[_0x6125('0xc')]);OpenchannelInteractionEvents[_0x6125('0xd')](_0x2b6f39+':'+_0x189fa8['id'],_0x189fa8);OpenchannelInteractionEvents['emit'](_0x2b6f39,_0x189fa8);_0x3558cb(null);})[_0x6125('0xe')](_0x3558cb(null));};}for(var e in events){if(events[_0x6125('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x6125('0x10')](e,emitEvent(event));}}module[_0x6125('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 78b0fb1..ac0b1f7 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 _0x2ed7=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x2609b0,_0xb15a19){var _0x454a98=function(_0x5f3abd){while(--_0x5f3abd){_0x2609b0['push'](_0x2609b0['shift']());}};_0x454a98(++_0xb15a19);}(_0x2ed7,0xdf));var _0x72ed=function(_0x267455,_0x25c3bf){_0x267455=_0x267455-0x0;var _0x20a188=_0x2ed7[_0x267455];return _0x20a188;};'use strict';var _=require(_0x72ed('0x0'));var util=require(_0x72ed('0x1'));var logger=require(_0x72ed('0x2'))(_0x72ed('0x3'));var moment=require(_0x72ed('0x4'));var BPromise=require(_0x72ed('0x5'));var rp=require(_0x72ed('0x6'));var fs=require('fs');var path=require(_0x72ed('0x7'));var rimraf=require(_0x72ed('0x8'));var config=require(_0x72ed('0x9'));var attributes=require(_0x72ed('0xa'));module['exports']=function(_0x361c78,_0x11b2a8){return _0x361c78[_0x72ed('0xb')](_0x72ed('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x72ed('0xd'),'collate':_0x72ed('0xe'),'hooks':{'beforeUpdate':function(_0x573a8d,_0x55c20d,_0x54cf7a){if(_0x573a8d[_0x72ed('0xf')](_0x72ed('0x10'))){_0x573a8d[_0x72ed('0x11')]=moment()[_0x72ed('0x12')](_0x72ed('0x13'));}_0x54cf7a(null,_0x573a8d);}}});}; \ No newline at end of file +var _0xe41f=['moment','bluebird','request-promise','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xe41f,0xb7));var _0xfe41=function(_0x1d009a,_0x2f4405){_0x1d009a=_0x1d009a-0x0;var _0x59a7b5=_0xe41f[_0x1d009a];return _0x59a7b5;};'use strict';var _=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var logger=require(_0xfe41('0x2'))(_0xfe41('0x3'));var moment=require(_0xfe41('0x4'));var BPromise=require(_0xfe41('0x5'));var rp=require(_0xfe41('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe41('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xfe41('0x8')]=function(_0x1cfaf3,_0x3e8086){return _0x1cfaf3[_0xfe41('0x9')](_0xfe41('0xa'),attributes,{'tableName':_0xfe41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x1cb5ab,_0x45dcb7,_0x1f1d8b){if(_0x1cb5ab[_0xfe41('0xc')](_0xfe41('0xd'))){_0x1cb5ab[_0xfe41('0xe')]=moment()[_0xfe41('0xf')](_0xfe41('0x10'));}_0x1f1d8b(null,_0x1cb5ab);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 3f7c25f..75e3d70 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 _0x7d5b=['then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./openchannelInteraction.socket','register','request'];(function(_0x3dda91,_0x5c7d75){var _0x413eab=function(_0x527a53){while(--_0x527a53){_0x3dda91['push'](_0x3dda91['shift']());}};_0x413eab(++_0x5c7d75);}(_0x7d5b,0xf0));var _0xb7d5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7d5b[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xb7d5('0x0'));var util=require(_0xb7d5('0x1'));var moment=require(_0xb7d5('0x2'));var BPromise=require(_0xb7d5('0x3'));var rs=require(_0xb7d5('0x4'));var fs=require('fs');var Redis=require(_0xb7d5('0x5'));var db=require(_0xb7d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7d5('0x7'))(_0xb7d5('0x8'));var config=require(_0xb7d5('0x9'));var jayson=require(_0xb7d5('0xa'));var client=jayson[_0xb7d5('0xb')][_0xb7d5('0xc')]({'port':0x232a});config[_0xb7d5('0xd')]=_['defaults'](config['redis'],{'host':_0xb7d5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7d5('0xd')]));require(_0xb7d5('0xf'))[_0xb7d5('0x10')](socket);function respondWithRpcPromise(_0x1d534a,_0x356055,_0x5ccc19){return new BPromise(function(_0x280d5a,_0x204de4){return client[_0xb7d5('0x11')](_0x1d534a,_0x5ccc19)[_0xb7d5('0x12')](function(_0x4af14b){logger[_0xb7d5('0x13')](_0xb7d5('0x14'),_0x356055,_0xb7d5('0x15'));logger[_0xb7d5('0x16')](_0xb7d5('0x17'),_0x356055,_0xb7d5('0x15'),JSON['stringify'](_0x4af14b));if(_0x4af14b[_0xb7d5('0x18')]){if(_0x4af14b['error'][_0xb7d5('0x19')]===0x1f4){logger[_0xb7d5('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0x4af14b[_0xb7d5('0x18')]['message']);return _0x204de4(_0x4af14b[_0xb7d5('0x18')][_0xb7d5('0x1a')]);}logger[_0xb7d5('0x18')](_0xb7d5('0x14'),_0x356055,_0x4af14b['error'][_0xb7d5('0x1a')]);return _0x280d5a(_0x4af14b['error'][_0xb7d5('0x1a')]);}else{logger[_0xb7d5('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0xb7d5('0x15'));_0x280d5a(_0x4af14b[_0xb7d5('0x1b')][_0xb7d5('0x1a')]);}})['catch'](function(_0x3a264a){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0x3a264a);_0x204de4(_0x3a264a);});});}exports[_0xb7d5('0x1c')]=function(_0x4cdc67){var _0x1cc875=this;return new Promise(function(_0x2661fc,_0x3c586c){return db[_0xb7d5('0x1d')]['update'](_0x4cdc67[_0xb7d5('0x1e')],{'raw':_0x4cdc67['options']?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x21')]||null:null,'attributes':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x22')]||null:null,'limit':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x23')]||null:null})['then'](function(_0x16b60a){logger[_0xb7d5('0x13')](_0xb7d5('0x1c'),_0x4cdc67);logger[_0xb7d5('0x16')](_0xb7d5('0x1c'),_0x4cdc67,JSON['stringify'](_0x16b60a));_0x2661fc(_0x16b60a);})[_0xb7d5('0x24')](function(_0x3b869f){logger[_0xb7d5('0x18')](_0xb7d5('0x1c'),_0x3b869f['message'],_0x4cdc67);_0x3c586c(_0x1cc875[_0xb7d5('0x18')](0x1f4,_0x3b869f[_0xb7d5('0x1a')]));});});};exports[_0xb7d5('0x25')]=function(_0x446fe5){return new Promise(function(_0x59c2f8,_0x54a838){return db[_0xb7d5('0x1d')]['find']({'where':_0x446fe5['options']?_0x446fe5['options'][_0xb7d5('0x21')]||null:null})['then'](function(_0x47838d){if(_0x47838d){return _0x47838d[_0xb7d5('0x26')](_0x446fe5[_0xb7d5('0x1e')][_0xb7d5('0x27')],_[_0xb7d5('0x28')](_0x446fe5[_0xb7d5('0x1e')],['ids','id'])||{});}})[_0xb7d5('0x29')](function(_0x29414d){logger[_0xb7d5('0x13')](_0xb7d5('0x2a'),_0x446fe5);logger[_0xb7d5('0x16')](_0xb7d5('0x2a'),_0x446fe5,JSON['stringify'](_0x29414d));_0x59c2f8(_0x29414d);})[_0xb7d5('0x24')](function(_0x28f672){logger[_0xb7d5('0x18')](_0xb7d5('0x2a'),_0x28f672['message'],_0x446fe5);_0x54a838(_this[_0xb7d5('0x18')](0x1f4,_0x28f672[_0xb7d5('0x1a')]));});});}; \ No newline at end of file +var _0x842d=['http','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateOpenchannelInteraction','update','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x287524,_0x1c2211){var _0x205827=function(_0x43e5aa){while(--_0x43e5aa){_0x287524['push'](_0x287524['shift']());}};_0x205827(++_0x1c2211);}(_0x842d,0xc8));var _0xd842=function(_0x2376d1,_0x38eec4){_0x2376d1=_0x2376d1-0x0;var _0x443759=_0x842d[_0x2376d1];return _0x443759;};'use strict';var _=require(_0xd842('0x0'));var util=require(_0xd842('0x1'));var moment=require(_0xd842('0x2'));var BPromise=require('bluebird');var rs=require(_0xd842('0x3'));var fs=require('fs');var Redis=require(_0xd842('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd842('0x5'));var logger=require(_0xd842('0x6'))(_0xd842('0x7'));var config=require('../../config/environment');var jayson=require(_0xd842('0x8'));var client=jayson[_0xd842('0x9')][_0xd842('0xa')]({'port':0x232a});config['redis']=_[_0xd842('0xb')](config['redis'],{'host':_0xd842('0xc'),'port':0x18eb});var socket=require(_0xd842('0xd'))(new Redis(config['redis']));require(_0xd842('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c6133,_0x3d136c,_0x932dc5){return new BPromise(function(_0x245a9f,_0x400841){return client[_0xd842('0xf')](_0x5c6133,_0x932dc5)[_0xd842('0x10')](function(_0xae90b7){logger['info'](_0xd842('0x11'),_0x3d136c,_0xd842('0x12'));logger[_0xd842('0x13')](_0xd842('0x14'),_0x3d136c,_0xd842('0x12'),JSON[_0xd842('0x15')](_0xae90b7));if(_0xae90b7[_0xd842('0x16')]){if(_0xae90b7[_0xd842('0x16')][_0xd842('0x17')]===0x1f4){logger[_0xd842('0x16')](_0xd842('0x11'),_0x3d136c,_0xae90b7['error'][_0xd842('0x18')]);return _0x400841(_0xae90b7[_0xd842('0x16')]['message']);}logger[_0xd842('0x16')](_0xd842('0x11'),_0x3d136c,_0xae90b7['error'][_0xd842('0x18')]);return _0x245a9f(_0xae90b7[_0xd842('0x16')][_0xd842('0x18')]);}else{logger[_0xd842('0x19')](_0xd842('0x11'),_0x3d136c,_0xd842('0x12'));_0x245a9f(_0xae90b7[_0xd842('0x1a')][_0xd842('0x18')]);}})['catch'](function(_0x55e8e8){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3d136c,_0x55e8e8);_0x400841(_0x55e8e8);});});}exports[_0xd842('0x1b')]=function(_0x151519){var _0x38b623=this;return new Promise(function(_0x31325d,_0x2526b5){return db['OpenchannelInteraction'][_0xd842('0x1c')](_0x151519[_0xd842('0x1d')],{'raw':_0x151519['options']?_0x151519[_0xd842('0x1e')][_0xd842('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151519['options']?_0x151519[_0xd842('0x1e')][_0xd842('0x20')]||null:null,'attributes':_0x151519[_0xd842('0x1e')]?_0x151519[_0xd842('0x1e')]['attributes']||null:null,'limit':_0x151519[_0xd842('0x1e')]?_0x151519['options'][_0xd842('0x21')]||null:null})[_0xd842('0x10')](function(_0x3e8a97){logger[_0xd842('0x19')](_0xd842('0x1b'),_0x151519);logger[_0xd842('0x13')](_0xd842('0x1b'),_0x151519,JSON[_0xd842('0x15')](_0x3e8a97));_0x31325d(_0x3e8a97);})['catch'](function(_0x7d86f9){logger[_0xd842('0x16')](_0xd842('0x1b'),_0x7d86f9['message'],_0x151519);_0x2526b5(_0x38b623[_0xd842('0x16')](0x1f4,_0x7d86f9[_0xd842('0x18')]));});});};exports[_0xd842('0x22')]=function(_0x1b1e2c){return new Promise(function(_0x2d320,_0x23aecc){return db[_0xd842('0x23')][_0xd842('0x24')]({'where':_0x1b1e2c['options']?_0x1b1e2c[_0xd842('0x1e')][_0xd842('0x20')]||null:null})[_0xd842('0x10')](function(_0xa89ad3){if(_0xa89ad3){return _0xa89ad3[_0xd842('0x25')](_0x1b1e2c[_0xd842('0x1d')][_0xd842('0x26')],_['omit'](_0x1b1e2c[_0xd842('0x1d')],[_0xd842('0x26'),'id'])||{});}})[_0xd842('0x27')](function(_0x27aacc){logger['info'](_0xd842('0x28'),_0x1b1e2c);logger[_0xd842('0x13')](_0xd842('0x28'),_0x1b1e2c,JSON[_0xd842('0x15')](_0x27aacc));_0x2d320(_0x27aacc);})[_0xd842('0x29')](function(_0x4f6a5b){logger[_0xd842('0x16')](_0xd842('0x28'),_0x4f6a5b['message'],_0x1b1e2c);_0x23aecc(_this['error'](0x1f4,_0x4f6a5b[_0xd842('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 4140b4a..59520bb 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 _0x648c=['remove','update','removeListener','register','length','./openchannelInteraction.events','save'];(function(_0x21465b,_0x258ee2){var _0x56a515=function(_0x87d5c3){while(--_0x87d5c3){_0x21465b['push'](_0x21465b['shift']());}};_0x56a515(++_0x258ee2);}(_0x648c,0x194));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0xc648('0x0'));var events=[_0xc648('0x1'),_0xc648('0x2'),_0xc648('0x3')];function createListener(_0x792599,_0x5ed1ce){return function(_0x2b0120){_0x5ed1ce['emit'](_0x792599,_0x2b0120);};}function removeListener(_0xd7e887,_0x3b724b){return function(){OpenchannelInteractionEvents[_0xc648('0x4')](_0xd7e887,_0x3b724b);};}exports[_0xc648('0x5')]=function(_0xb57a80){for(var _0x5184a2=0x0,_0x5259d3=events[_0xc648('0x6')];_0x5184a2<_0x5259d3;_0x5184a2++){var _0x15cf3b=events[_0x5184a2];var _0x554a0d=createListener('openchannelInteraction:'+_0x15cf3b,_0xb57a80);OpenchannelInteractionEvents['on'](_0x15cf3b,_0x554a0d);}}; \ No newline at end of file +var _0x8946=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','length'];(function(_0x16c50c,_0x1256df){var _0x50575f=function(_0x3d55c9){while(--_0x3d55c9){_0x16c50c['push'](_0x16c50c['shift']());}};_0x50575f(++_0x1256df);}(_0x8946,0x8b));var _0x6894=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x8946[_0x1d24eb];return _0x1dc576;};'use strict';var OpenchannelInteractionEvents=require(_0x6894('0x0'));var events=['save',_0x6894('0x1'),_0x6894('0x2')];function createListener(_0x501af9,_0x2b0763){return function(_0x5292cf){_0x2b0763[_0x6894('0x3')](_0x501af9,_0x5292cf);};}function removeListener(_0x1bd873,_0x57925d){return function(){OpenchannelInteractionEvents['removeListener'](_0x1bd873,_0x57925d);};}exports['register']=function(_0x2aa655){for(var _0x4c98b9=0x0,_0x3466a9=events[_0x6894('0x4')];_0x4c98b9<_0x3466a9;_0x4c98b9++){var _0x543647=events[_0x4c98b9];var _0x5b4ed0=createListener(_0x6894('0x5')+_0x543647,_0x2aa655);OpenchannelInteractionEvents['on'](_0x543647,_0x5b4ed0);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a779a93..6f70d7d 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(_0x1d9187,_0x494ad6){var _0x25d4b0=function(_0x59a1a1){while(--_0x59a1a1){_0x1d9187['push'](_0x1d9187['shift']());}};_0x25d4b0(++_0x494ad6);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x1f0d91,_0x24b032){var _0xafee7a=function(_0x2d1295){while(--_0x2d1295){_0x1f0d91['push'](_0x1f0d91['shift']());}};_0xafee7a(++_0x24b032);}(_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'));var controller=require('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('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 72ff96c..c304e78 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 _0x7117=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x214cde,_0x4d18f2){var _0x5aa4ef=function(_0x221e33){while(--_0x221e33){_0x214cde['push'](_0x214cde['shift']());}};_0x5aa4ef(++_0x4d18f2);}(_0x7117,0x1ec));var _0x7711=function(_0x31e702,_0x1cac4e){_0x31e702=_0x31e702-0x0;var _0x1d10bd=_0x7117[_0x31e702];return _0x1d10bd;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'body':{'type':Sequelize[_0x7711('0x2')](_0x7711('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7711('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7711('0x5')]('in','out'),'defaultValue':_0x7711('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x7711('0x7')]},'providerResponse':{'type':Sequelize[_0x7711('0x2')]}}; \ No newline at end of file +var _0x6b20=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2c2dff,_0x302e28){var _0x1177a4=function(_0x2fa930){while(--_0x2fa930){_0x2c2dff['push'](_0x2c2dff['shift']());}};_0x1177a4(++_0x302e28);}(_0x6b20,0xd1));var _0x06b2=function(_0x1df577,_0xc48cf7){_0x1df577=_0x1df577-0x0;var _0x643ff=_0x6b20[_0x1df577];return _0x643ff;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x06b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06b2('0x4')]('in',_0x06b2('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x06b2('0x6')]},'providerName':{'type':Sequelize[_0x06b2('0x7')]},'providerResponse':{'type':Sequelize[_0x06b2('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8cc3c85..8ba7e5b 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 _0xd20a=['end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','../../config/logger','openchannel-interactions','accept','openchannel','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','rejectMessage','QueryTypes','SELECT','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update'];(function(_0xcba4b6,_0x1ecf6a){var _0x2bd8bf=function(_0x46812a){while(--_0x46812a){_0xcba4b6['push'](_0xcba4b6['shift']());}};_0x2bd8bf(++_0x1ecf6a);}(_0xd20a,0xcb));var _0xad20=function(_0x3984e4,_0x412653){_0x3984e4=_0x3984e4-0x0;var _0x2eede7=_0xd20a[_0x3984e4];return _0x2eede7;};'use strict';var emlformat=require(_0xad20('0x0'));var rimraf=require(_0xad20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad20('0x2'));var rp=require(_0xad20('0x3'));var moment=require(_0xad20('0x4'));var BPromise=require(_0xad20('0x5'));var Mustache=require(_0xad20('0x6'));var util=require(_0xad20('0x7'));var path=require('path');var sox=require(_0xad20('0x8'));var csv=require(_0xad20('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad20('0xa'));var _=require(_0xad20('0xb'));var squel=require('squel');var crypto=require(_0xad20('0xc'));var jsforce=require(_0xad20('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad20('0x9'));var querystring=require(_0xad20('0xe'));var Papa=require(_0xad20('0xf'));var Redis=require(_0xad20('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xad20('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xad20('0x12'));var utils=require(_0xad20('0x13'));var config=require(_0xad20('0x14'));var licenseUtil=require(_0xad20('0x15'));var db=require(_0xad20('0x16'))['db'];config['redis']=_[_0xad20('0x17')](config[_0xad20('0x18')],{'host':_0xad20('0x19'),'port':0x18eb});var socket=require(_0xad20('0x1a'))(new Redis(config[_0xad20('0x18')]));require(_0xad20('0x1b'))[_0xad20('0x1c')](socket);var jayson=require(_0xad20('0x1d'));var client=jayson[_0xad20('0x1e')][_0xad20('0x1f')]({'port':0x232c});var client9002=jayson[_0xad20('0x1e')][_0xad20('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x54cf55,_0x35f514,_0x2d4cb2,_0x5b90e0){return new BPromise(function(_0x195c3c,_0x2caa08){var _0x37e2d9=_0x5b90e0||client;return _0x37e2d9['request'](_0x54cf55,_0x2d4cb2)[_0xad20('0x20')](function(_0x50f38c){logger[_0xad20('0x21')](_0xad20('0x22'),_0x35f514,_0xad20('0x23'));logger[_0xad20('0x24')](_0xad20('0x25'),_0x35f514,'request\x20sent',JSON[_0xad20('0x26')](_0x50f38c));if(_0x50f38c[_0xad20('0x27')]){if(_0x50f38c[_0xad20('0x27')][_0xad20('0x28')]===0x1f4){logger[_0xad20('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x35f514,_0x50f38c['error'][_0xad20('0x29')]);return _0x2caa08(_0x50f38c[_0xad20('0x27')]['message']);}logger[_0xad20('0x27')](_0xad20('0x22'),_0x35f514,_0x50f38c['error'][_0xad20('0x29')]);return _0x195c3c(_0x50f38c['error'][_0xad20('0x29')]);}else{logger[_0xad20('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x35f514,_0xad20('0x23'));_0x195c3c(_0x50f38c['result'][_0xad20('0x29')]);}})[_0xad20('0x2a')](function(_0x4a1d86){logger[_0xad20('0x27')](_0xad20('0x22'),_0x35f514,_0x4a1d86);_0x2caa08(_0x4a1d86);});});}function respondWithStatusCode(_0x5c6265,_0x4db7a3){_0x4db7a3=_0x4db7a3||0xcc;return function(_0x42dcc3){if(_0x42dcc3){return _0x5c6265[_0xad20('0x2b')](_0x4db7a3);}return _0x5c6265[_0xad20('0x2c')](_0x4db7a3)['end']();};}function respondWithResult(_0x4186e0,_0x5b53df){_0x5b53df=_0x5b53df||0xc8;return function(_0x795166){if(_0x795166){return _0x4186e0[_0xad20('0x2c')](_0x5b53df)[_0xad20('0x2d')](_0x795166);}};}function respondWithFilteredResult(_0xe2118a,_0x860552){return function(_0xf30db4){if(_0xf30db4){var _0x5a9bed=typeof _0x860552[_0xad20('0x2e')]==='undefined'&&typeof _0x860552[_0xad20('0x2f')]===_0xad20('0x30');var _0x181513=_0xf30db4[_0xad20('0x31')];var _0x2b1b50=_0x5a9bed?0x0:_0x860552[_0xad20('0x2e')];var _0x12b368=_0x5a9bed?_0xf30db4[_0xad20('0x31')]:_0x860552[_0xad20('0x2e')]+_0x860552[_0xad20('0x2f')];var _0x2b8cdf;if(_0x12b368>=_0x181513){_0x12b368=_0x181513;_0x2b8cdf=0xc8;}else{_0x2b8cdf=0xce;}_0xe2118a[_0xad20('0x2c')](_0x2b8cdf);return _0xe2118a[_0xad20('0x32')](_0xad20('0x33'),_0x2b1b50+'-'+_0x12b368+'/'+_0x181513)[_0xad20('0x2d')](_0xf30db4);}return null;};}function patchUpdates(_0x2b4622){return function(_0x4db64e){try{jsonpatch['apply'](_0x4db64e,_0x2b4622,!![]);}catch(_0x1b0156){return BPromise[_0xad20('0x34')](_0x1b0156);}return _0x4db64e[_0xad20('0x35')]();};}function saveUpdates(_0x9fa352,_0x4eb29c){return function(_0xb719bc){if(_0xb719bc){return _0xb719bc[_0xad20('0x36')](_0x9fa352)[_0xad20('0x20')](function(_0x1a5002){return _0x1a5002;});}return null;};}function removeEntity(_0x90bd97,_0x11083e){return function(_0x5a0b8b){if(_0x5a0b8b){return _0x5a0b8b['destroy']()[_0xad20('0x20')](function(){_0x90bd97[_0xad20('0x2c')](0xcc)[_0xad20('0x37')]();});}};}function handleEntityNotFound(_0x448a71,_0x544bd6){return function(_0x1bcc56){if(!_0x1bcc56){_0x448a71['sendStatus'](0x194);}return _0x1bcc56;};}function handleError(_0x291143,_0x5f3370){_0x5f3370=_0x5f3370||0x1f4;return function(_0x27aef9){logger[_0xad20('0x27')](_0x27aef9['stack']);if(_0x27aef9['name']){delete _0x27aef9[_0xad20('0x38')];}_0x291143['status'](_0x5f3370)[_0xad20('0x39')](_0x27aef9);};}exports[_0xad20('0x3a')]=function(_0x49005a,_0x347aa0){var _0x233bae={},_0x3dff29={},_0xbccfab={'count':0x0,'rows':[]};var _0x31c3cd=_[_0xad20('0x3b')](db[_0xad20('0x3c')][_0xad20('0x3d')],function(_0xf509ce){return{'name':_0xf509ce[_0xad20('0x3e')],'type':_0xf509ce[_0xad20('0x3f')][_0xad20('0x40')]};});_0x3dff29[_0xad20('0x41')]=_[_0xad20('0x3b')](_0x31c3cd,_0xad20('0x38'));_0x3dff29[_0xad20('0x42')]=_[_0xad20('0x43')](_0x49005a[_0xad20('0x42')]);_0x3dff29[_0xad20('0x44')]=_[_0xad20('0x45')](_0x3dff29[_0xad20('0x41')],_0x3dff29['query']);_0x233bae['attributes']=_[_0xad20('0x45')](_0x3dff29['model'],qs['fields'](_0x49005a[_0xad20('0x42')][_0xad20('0x46')]));_0x233bae[_0xad20('0x47')]=_0x233bae[_0xad20('0x47')][_0xad20('0x48')]?_0x233bae['attributes']:_0x3dff29[_0xad20('0x41')];if(!_0x49005a[_0xad20('0x42')][_0xad20('0x49')]('nolimit')){_0x233bae[_0xad20('0x2f')]=qs['limit'](_0x49005a['query'][_0xad20('0x2f')]);_0x233bae[_0xad20('0x2e')]=qs[_0xad20('0x2e')](_0x49005a[_0xad20('0x42')][_0xad20('0x2e')]);}_0x233bae[_0xad20('0x4a')]=qs[_0xad20('0x4b')](_0x49005a['query'][_0xad20('0x4b')]);_0x233bae[_0xad20('0x4c')]=qs[_0xad20('0x44')](_['pick'](_0x49005a[_0xad20('0x42')],_0x3dff29[_0xad20('0x44')]),_0x31c3cd);if(_0x49005a[_0xad20('0x42')][_0xad20('0x4d')]){_0x233bae[_0xad20('0x4c')]=_[_0xad20('0x4e')](_0x233bae['where'],{'$or':_[_0xad20('0x3b')](_0x31c3cd,function(_0x47c5a3){if(_0x47c5a3['type']!==_0xad20('0x4f')){var _0x51e69e={};_0x51e69e[_0x47c5a3[_0xad20('0x38')]]={'$like':'%'+_0x49005a['query'][_0xad20('0x4d')]+'%'};return _0x51e69e;}})});}_0x233bae=_[_0xad20('0x4e')]({},_0x233bae,_0x49005a['options']);var _0x4013cd={'where':_0x233bae['where']};return db[_0xad20('0x3c')][_0xad20('0x31')](_0x4013cd)[_0xad20('0x20')](function(_0x2d401a){_0xbccfab['count']=_0x2d401a;if(_0x49005a[_0xad20('0x42')][_0xad20('0x50')]){_0x233bae[_0xad20('0x51')]=[{'all':!![]}];}return db[_0xad20('0x3c')][_0xad20('0x52')](_0x233bae);})[_0xad20('0x20')](function(_0x3d7e0c){_0xbccfab[_0xad20('0x53')]=_0x3d7e0c;return _0xbccfab;})[_0xad20('0x20')](respondWithFilteredResult(_0x347aa0,_0x233bae))[_0xad20('0x2a')](handleError(_0x347aa0,null));};exports[_0xad20('0x54')]=function(_0x28ef05,_0x45c260){var _0xf4fe51={'raw':!![],'where':{'id':_0x28ef05[_0xad20('0x55')]['id']}},_0x421a52={};_0x421a52['model']=_[_0xad20('0x43')](db[_0xad20('0x3c')][_0xad20('0x3d')]);_0x421a52[_0xad20('0x42')]=_[_0xad20('0x43')](_0x28ef05['query']);_0x421a52[_0xad20('0x44')]=_[_0xad20('0x45')](_0x421a52[_0xad20('0x41')],_0x421a52['query']);_0xf4fe51[_0xad20('0x47')]=_[_0xad20('0x45')](_0x421a52[_0xad20('0x41')],qs[_0xad20('0x46')](_0x28ef05[_0xad20('0x42')][_0xad20('0x46')]));_0xf4fe51[_0xad20('0x47')]=_0xf4fe51['attributes'][_0xad20('0x48')]?_0xf4fe51[_0xad20('0x47')]:_0x421a52[_0xad20('0x41')];if(_0x28ef05[_0xad20('0x42')][_0xad20('0x50')]){_0xf4fe51[_0xad20('0x51')]=[{'all':!![]}];}_0xf4fe51=_[_0xad20('0x4e')]({},_0xf4fe51,_0x28ef05['options']);return db[_0xad20('0x3c')][_0xad20('0x56')](_0xf4fe51)['then'](handleEntityNotFound(_0x45c260,null))[_0xad20('0x20')](respondWithResult(_0x45c260,null))[_0xad20('0x2a')](handleError(_0x45c260,null));};exports[_0xad20('0x57')]=function(_0x424e12,_0x18dc32){return db[_0xad20('0x3c')]['create'](_0x424e12['body'],{})[_0xad20('0x20')](respondWithResult(_0x18dc32,0xc9))[_0xad20('0x2a')](handleError(_0x18dc32,null));};exports[_0xad20('0x36')]=function(_0xb3d44d,_0x2baece){if(_0xb3d44d[_0xad20('0x58')]['id']){delete _0xb3d44d[_0xad20('0x58')]['id'];}return db[_0xad20('0x3c')]['find']({'where':{'id':_0xb3d44d[_0xad20('0x55')]['id']}})['then'](handleEntityNotFound(_0x2baece,null))[_0xad20('0x20')](saveUpdates(_0xb3d44d['body'],null))[_0xad20('0x20')](respondWithResult(_0x2baece,null))['catch'](handleError(_0x2baece,null));};exports[_0xad20('0x59')]=function(_0x2b8042,_0x2f0536){return db[_0xad20('0x3c')][_0xad20('0x56')]({'where':{'id':_0x2b8042[_0xad20('0x55')]['id']}})[_0xad20('0x20')](handleEntityNotFound(_0x2f0536,null))['then'](removeEntity(_0x2f0536,null))[_0xad20('0x2a')](handleError(_0x2f0536,null));};exports['describe']=function(_0x179f33,_0x516788){return db[_0xad20('0x3c')][_0xad20('0x5a')]()['then'](respondWithResult(_0x516788,null))[_0xad20('0x2a')](handleError(_0x516788,null));};var interaction_log=require(_0xad20('0x5b'))(_0xad20('0x5c'));exports[_0xad20('0x5d')]=function(_0x4317e1,_0x40dd80,_0x43826a){var _0x425ce4={'agent':{},'channel':_0xad20('0x5e')};if(_0x4317e1[_0xad20('0x58')]['id']){delete _0x4317e1['body']['id'];}_0x4317e1['body']['read']=!![];_0x4317e1[_0xad20('0x58')][_0xad20('0x5f')]=moment()['format'](_0xad20('0x60'));_0x4317e1[_0xad20('0x58')][_0xad20('0x61')]=_0x4317e1[_0xad20('0x58')][_0xad20('0x61')]||_0x4317e1[_0xad20('0x62')]['id'];_0x425ce4['agent']['id']=_0x4317e1[_0xad20('0x58')][_0xad20('0x61')];return db['OpenchannelMessage'][_0xad20('0x56')]({'where':{'id':_0x4317e1[_0xad20('0x55')]['id'],'UserId':null}})[_0xad20('0x20')](handleEntityNotFound(_0x40dd80,null))[_0xad20('0x20')](saveUpdates(_0x4317e1[_0xad20('0x58')],null))[_0xad20('0x20')](function(_0x28ed49){if(_0x28ed49){_0x425ce4[_0xad20('0x29')]=_0x28ed49[_0xad20('0x63')]({'plain':!![]});return db[_0xad20('0x64')][_0xad20('0x56')]({'where':{'id':_0x28ed49['OpenchannelInteractionId']}});}return null;})[_0xad20('0x20')](handleEntityNotFound(_0x40dd80,null))['then'](function(_0xc8e201){if(_0xc8e201){return _0xc8e201['update']({'UserId':_0x4317e1[_0xad20('0x58')][_0xad20('0x61')],'read1stAt':_[_0xad20('0x65')](_0xc8e201['read1stAt'])?moment()['format'](_0xad20('0x60')):undefined});}return null;})[_0xad20('0x20')](function(_0x28a6cf){if(_0x28a6cf){_0x425ce4['interaction']=_0x28a6cf['get']({'plain':!![]});interaction_log[_0xad20('0x21')](_0xad20('0x66'),_0x4317e1[_0xad20('0x62')]['id'],_0x4317e1[_0xad20('0x62')][_0xad20('0x38')],_0x4317e1[_0xad20('0x62')][_0xad20('0x67')],_0x425ce4['interaction']['id'],_0x4317e1[_0xad20('0x58')]?JSON[_0xad20('0x26')](_0x4317e1[_0xad20('0x58')]):_0xad20('0x68'));return respondWithRpcPromise('AcceptMessage',_0xad20('0x69'),_0x425ce4);}return null;})[_0xad20('0x20')](function(_0x55593b){var _0xe7f947=_0xad20('0x6a')+_0x55593b[_0xad20('0x29')][_0xad20('0x6b')];return db[_0xad20('0x6c')][_0xad20('0x42')](_0xe7f947,{'type':db[_0xad20('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x22c702){return _0x22c702;});})[_0xad20('0x20')](function(_0x10489e){if(_0x10489e){_0x425ce4[_0xad20('0x29')][_0xad20('0x6e')]=_0x10489e[0x0];if(!_0x4317e1[_0xad20('0x58')]['UserId'])return;return db[_0xad20('0x6f')]['find']({'where':{'id':_0x4317e1[_0xad20('0x58')][_0xad20('0x61')],'role':_0xad20('0x70')},'attributes':['id','name',_0xad20('0x71'),_0xad20('0x72'),_0xad20('0x73')],'raw':!![]});}return null;})['then'](function(_0x461474){if(!_0x461474)return null;_0x425ce4[_0xad20('0x29')]['agent']=_0x461474;return _0x425ce4;})[_0xad20('0x20')](function(_0x3ffefa){if(_0x3ffefa){if(_0x4317e1[_0xad20('0x58')][_0xad20('0x74')]){_0x425ce4[_0xad20('0x29')][_0xad20('0x75')]=util['format'](_0xad20('0x76'),_0x4317e1['user'][_0xad20('0x38')]);_0x425ce4[_0xad20('0x29')][_0xad20('0x77')]=_0x425ce4['channel'];_0x425ce4[_0xad20('0x29')][_0xad20('0x78')]=_0x425ce4[_0xad20('0x77')];_0x425ce4[_0xad20('0x29')][_0xad20('0x79')]=_0xad20('0x5d');return respondWithRpcPromise(_0xad20('0x7a'),_0xad20('0x7a'),{'event':_0xad20('0x7b'),'message':_0x425ce4['message']},client9002)[_0xad20('0x20')](function(){return _0x425ce4;});}return _0x425ce4;}return null;})[_0xad20('0x20')](respondWithResult(_0x40dd80,null))[_0xad20('0x2a')](handleError(_0x40dd80,null));};var interaction_log=require(_0xad20('0x5b'))(_0xad20('0x5c'));exports[_0xad20('0x34')]=function(_0x1946fd,_0x2d914d,_0xc059ea){var _0x5021e2={'agent':{},'channel':_0xad20('0x5e')};if(_0x1946fd[_0xad20('0x58')]['id']){delete _0x1946fd[_0xad20('0x58')]['id'];}_0x1946fd[_0xad20('0x58')]['UserId']=_0x1946fd[_0xad20('0x58')]['UserId']||_0x1946fd[_0xad20('0x62')]['id'];_0x5021e2[_0xad20('0x70')]['id']=_0x1946fd[_0xad20('0x58')]['UserId'];return db[_0xad20('0x3c')][_0xad20('0x56')]({'where':{'id':_0x1946fd[_0xad20('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d914d,null))['then'](function(_0xe19b69){if(_0xe19b69){_0x5021e2[_0xad20('0x29')]=_0xe19b69[_0xad20('0x63')]({'plain':!![]});return db[_0xad20('0x64')][_0xad20('0x56')]({'where':{'id':_0xe19b69['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2d914d,null))[_0xad20('0x20')](function(_0x19812a){if(_0x19812a){_0x5021e2['interaction']=_0x19812a['get']({'plain':!![]});interaction_log[_0xad20('0x21')](_0xad20('0x7c'),_0x1946fd['user']['id'],_0x1946fd[_0xad20('0x62')]['name'],_0x1946fd[_0xad20('0x62')][_0xad20('0x67')],_0x5021e2[_0xad20('0x7d')]['id'],_0x1946fd[_0xad20('0x58')]?JSON[_0xad20('0x26')](_0x1946fd[_0xad20('0x58')]):_0xad20('0x68'));return respondWithRpcPromise('RejectMessage',_0xad20('0x7e'),_0x5021e2);}return null;})[_0xad20('0x20')](function(_0x540dd3){var _0x275aaa=_0xad20('0x6a')+_0x540dd3[_0xad20('0x29')]['ContactId'];return db[_0xad20('0x6c')][_0xad20('0x42')](_0x275aaa,{'type':db[_0xad20('0x6d')][_0xad20('0x7f')][_0xad20('0x80')],'raw':!![]})['then'](function(_0x240cc3){return _0x240cc3;});})[_0xad20('0x20')](function(_0x20e2d2){if(_0x20e2d2){_0x5021e2['message'][_0xad20('0x6e')]=_0x20e2d2[0x0];if(!_0x1946fd[_0xad20('0x58')][_0xad20('0x61')])return;return db['User'][_0xad20('0x56')]({'where':{'id':_0x1946fd[_0xad20('0x58')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xad20('0x72'),'internal'],'raw':!![]});}return null;})[_0xad20('0x20')](function(_0x23b7e1){if(!_0x23b7e1)return null;_0x5021e2[_0xad20('0x29')]['agent']=_0x23b7e1;return _0x5021e2;})[_0xad20('0x20')](function(_0x5c506a){if(_0x5c506a){_0x5c506a['message'][_0xad20('0x75')]=util['format'](_0xad20('0x76'),_0x1946fd[_0xad20('0x62')]['name']);_0x5c506a[_0xad20('0x29')][_0xad20('0x77')]=_0x5021e2[_0xad20('0x77')];_0x5c506a['message'][_0xad20('0x78')]=_0x5021e2[_0xad20('0x77')];_0x5c506a['message']['event']=_0xad20('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x5c506a[_0xad20('0x29')]},client9002);return _0x5021e2;}return null;})[_0xad20('0x20')](respondWithResult(_0x2d914d,null))[_0xad20('0x2a')](handleError(_0x2d914d,null));}; \ No newline at end of file +var _0x952a=['stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','email','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./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','catch','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','sendStatus','stack','send','index','rawAttributes','fieldName','type','key','map','name','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','OpenchannelMessage','includeAll','include','show','fields','options','create','body','params','find','../../config/logger','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user'];(function(_0x448a3e,_0x345728){var _0x18c887=function(_0x2c7d32){while(--_0x2c7d32){_0x448a3e['push'](_0x448a3e['shift']());}};_0x18c887(++_0x345728);}(_0x952a,0x1b1));var _0xa952=function(_0x1f8e1c,_0x1f17a4){_0x1f8e1c=_0x1f8e1c-0x0;var _0x1d9a4b=_0x952a[_0x1f8e1c];return _0x1d9a4b;};'use strict';var emlformat=require(_0xa952('0x0'));var rimraf=require(_0xa952('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa952('0x2'));var rp=require(_0xa952('0x3'));var moment=require(_0xa952('0x4'));var BPromise=require(_0xa952('0x5'));var Mustache=require(_0xa952('0x6'));var util=require('util');var path=require(_0xa952('0x7'));var sox=require(_0xa952('0x8'));var csv=require(_0xa952('0x9'));var ejs=require(_0xa952('0xa'));var fs=require('fs');var fs_extra=require(_0xa952('0xb'));var _=require(_0xa952('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa952('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa952('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa952('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa952('0x10'));var logger=require('../../config/logger')(_0xa952('0x11'));var utils=require(_0xa952('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa952('0x13'));var db=require(_0xa952('0x14'))['db'];config[_0xa952('0x15')]=_[_0xa952('0x16')](config['redis'],{'host':_0xa952('0x17'),'port':0x18eb});var socket=require(_0xa952('0x18'))(new Redis(config[_0xa952('0x15')]));require(_0xa952('0x19'))[_0xa952('0x1a')](socket);var jayson=require(_0xa952('0x1b'));var client=jayson[_0xa952('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xa952('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xa89509,_0x2cc488,_0x3e7a7a,_0x50d733){return new BPromise(function(_0x31e997,_0x4d72e3){var _0x34d5e0=_0x50d733||client;return _0x34d5e0[_0xa952('0x1e')](_0xa89509,_0x3e7a7a)[_0xa952('0x1f')](function(_0x47fb31){logger[_0xa952('0x20')](_0xa952('0x21'),_0x2cc488,_0xa952('0x22'));logger[_0xa952('0x23')](_0xa952('0x24'),_0x2cc488,'request\x20sent',JSON['stringify'](_0x47fb31));if(_0x47fb31[_0xa952('0x25')]){if(_0x47fb31[_0xa952('0x25')][_0xa952('0x26')]===0x1f4){logger[_0xa952('0x25')](_0xa952('0x21'),_0x2cc488,_0x47fb31[_0xa952('0x25')]['message']);return _0x4d72e3(_0x47fb31[_0xa952('0x25')][_0xa952('0x27')]);}logger['error'](_0xa952('0x21'),_0x2cc488,_0x47fb31['error'][_0xa952('0x27')]);return _0x31e997(_0x47fb31['error'][_0xa952('0x27')]);}else{logger[_0xa952('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x2cc488,_0xa952('0x22'));_0x31e997(_0x47fb31[_0xa952('0x28')][_0xa952('0x27')]);}})[_0xa952('0x29')](function(_0x173d44){logger[_0xa952('0x25')](_0xa952('0x21'),_0x2cc488,_0x173d44);_0x4d72e3(_0x173d44);});});}function respondWithStatusCode(_0x160644,_0x50be74){_0x50be74=_0x50be74||0xcc;return function(_0x383d0b){if(_0x383d0b){return _0x160644['sendStatus'](_0x50be74);}return _0x160644[_0xa952('0x2a')](_0x50be74)[_0xa952('0x2b')]();};}function respondWithResult(_0x268e69,_0x3af682){_0x3af682=_0x3af682||0xc8;return function(_0x540fd2){if(_0x540fd2){return _0x268e69[_0xa952('0x2a')](_0x3af682)[_0xa952('0x2c')](_0x540fd2);}};}function respondWithFilteredResult(_0x36ea86,_0x17b5e1){return function(_0x122711){if(_0x122711){var _0x53a2eb=typeof _0x17b5e1[_0xa952('0x2d')]==='undefined'&&typeof _0x17b5e1[_0xa952('0x2e')]===_0xa952('0x2f');var _0x1f7057=_0x122711[_0xa952('0x30')];var _0x547a18=_0x53a2eb?0x0:_0x17b5e1['offset'];var _0x189f55=_0x53a2eb?_0x122711[_0xa952('0x30')]:_0x17b5e1[_0xa952('0x2d')]+_0x17b5e1[_0xa952('0x2e')];var _0x2663db;if(_0x189f55>=_0x1f7057){_0x189f55=_0x1f7057;_0x2663db=0xc8;}else{_0x2663db=0xce;}_0x36ea86[_0xa952('0x2a')](_0x2663db);return _0x36ea86[_0xa952('0x31')]('Content-Range',_0x547a18+'-'+_0x189f55+'/'+_0x1f7057)[_0xa952('0x2c')](_0x122711);}return null;};}function patchUpdates(_0x1c51a7){return function(_0x159f03){try{jsonpatch[_0xa952('0x32')](_0x159f03,_0x1c51a7,!![]);}catch(_0x18a043){return BPromise[_0xa952('0x33')](_0x18a043);}return _0x159f03[_0xa952('0x34')]();};}function saveUpdates(_0x3cce90,_0x2f88e5){return function(_0x1766d9){if(_0x1766d9){return _0x1766d9[_0xa952('0x35')](_0x3cce90)[_0xa952('0x1f')](function(_0x46d44a){return _0x46d44a;});}return null;};}function removeEntity(_0x5d13d,_0x85660e){return function(_0x364d12){if(_0x364d12){return _0x364d12[_0xa952('0x36')]()['then'](function(){_0x5d13d[_0xa952('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7e16,_0x3f9e68){return function(_0x2be73f){if(!_0x2be73f){_0x5e7e16[_0xa952('0x37')](0x194);}return _0x2be73f;};}function handleError(_0x14e918,_0x4238f5){_0x4238f5=_0x4238f5||0x1f4;return function(_0x42f11f){logger['error'](_0x42f11f[_0xa952('0x38')]);if(_0x42f11f['name']){delete _0x42f11f['name'];}_0x14e918[_0xa952('0x2a')](_0x4238f5)[_0xa952('0x39')](_0x42f11f);};}exports[_0xa952('0x3a')]=function(_0x125210,_0x665e42){var _0x565b54={},_0x3531fc={},_0x57fa66={'count':0x0,'rows':[]};var _0x558513=_['map'](db['OpenchannelMessage'][_0xa952('0x3b')],function(_0x53167a){return{'name':_0x53167a[_0xa952('0x3c')],'type':_0x53167a[_0xa952('0x3d')][_0xa952('0x3e')]};});_0x3531fc['model']=_[_0xa952('0x3f')](_0x558513,_0xa952('0x40'));_0x3531fc[_0xa952('0x41')]=_[_0xa952('0x42')](_0x125210[_0xa952('0x41')]);_0x3531fc['filters']=_[_0xa952('0x43')](_0x3531fc[_0xa952('0x44')],_0x3531fc[_0xa952('0x41')]);_0x565b54[_0xa952('0x45')]=_[_0xa952('0x43')](_0x3531fc[_0xa952('0x44')],qs['fields'](_0x125210[_0xa952('0x41')]['fields']));_0x565b54[_0xa952('0x45')]=_0x565b54[_0xa952('0x45')][_0xa952('0x46')]?_0x565b54[_0xa952('0x45')]:_0x3531fc[_0xa952('0x44')];if(!_0x125210['query'][_0xa952('0x47')](_0xa952('0x48'))){_0x565b54[_0xa952('0x2e')]=qs['limit'](_0x125210['query']['limit']);_0x565b54[_0xa952('0x2d')]=qs[_0xa952('0x2d')](_0x125210[_0xa952('0x41')][_0xa952('0x2d')]);}_0x565b54[_0xa952('0x49')]=qs[_0xa952('0x4a')](_0x125210['query'][_0xa952('0x4a')]);_0x565b54['where']=qs[_0xa952('0x4b')](_['pick'](_0x125210[_0xa952('0x41')],_0x3531fc[_0xa952('0x4b')]),_0x558513);if(_0x125210[_0xa952('0x41')][_0xa952('0x4c')]){_0x565b54[_0xa952('0x4d')]=_['merge'](_0x565b54[_0xa952('0x4d')],{'$or':_[_0xa952('0x3f')](_0x558513,function(_0x59ffdb){if(_0x59ffdb['type']!==_0xa952('0x4e')){var _0x29db9c={};_0x29db9c[_0x59ffdb[_0xa952('0x40')]]={'$like':'%'+_0x125210['query'][_0xa952('0x4c')]+'%'};return _0x29db9c;}})});}_0x565b54=_[_0xa952('0x4f')]({},_0x565b54,_0x125210['options']);var _0x43fe20={'where':_0x565b54[_0xa952('0x4d')]};return db[_0xa952('0x50')][_0xa952('0x30')](_0x43fe20)[_0xa952('0x1f')](function(_0x21a37f){_0x57fa66[_0xa952('0x30')]=_0x21a37f;if(_0x125210[_0xa952('0x41')][_0xa952('0x51')]){_0x565b54[_0xa952('0x52')]=[{'all':!![]}];}return db[_0xa952('0x50')]['findAll'](_0x565b54);})['then'](function(_0x2a6f58){_0x57fa66['rows']=_0x2a6f58;return _0x57fa66;})[_0xa952('0x1f')](respondWithFilteredResult(_0x665e42,_0x565b54))[_0xa952('0x29')](handleError(_0x665e42,null));};exports[_0xa952('0x53')]=function(_0x294687,_0x391e97){var _0x1c8580={'raw':!![],'where':{'id':_0x294687['params']['id']}},_0x489fb7={};_0x489fb7['model']=_[_0xa952('0x42')](db[_0xa952('0x50')]['rawAttributes']);_0x489fb7['query']=_[_0xa952('0x42')](_0x294687[_0xa952('0x41')]);_0x489fb7[_0xa952('0x4b')]=_[_0xa952('0x43')](_0x489fb7[_0xa952('0x44')],_0x489fb7['query']);_0x1c8580['attributes']=_[_0xa952('0x43')](_0x489fb7['model'],qs[_0xa952('0x54')](_0x294687[_0xa952('0x41')]['fields']));_0x1c8580[_0xa952('0x45')]=_0x1c8580['attributes'][_0xa952('0x46')]?_0x1c8580[_0xa952('0x45')]:_0x489fb7[_0xa952('0x44')];if(_0x294687[_0xa952('0x41')]['includeAll']){_0x1c8580[_0xa952('0x52')]=[{'all':!![]}];}_0x1c8580=_[_0xa952('0x4f')]({},_0x1c8580,_0x294687[_0xa952('0x55')]);return db[_0xa952('0x50')]['find'](_0x1c8580)['then'](handleEntityNotFound(_0x391e97,null))[_0xa952('0x1f')](respondWithResult(_0x391e97,null))[_0xa952('0x29')](handleError(_0x391e97,null));};exports[_0xa952('0x56')]=function(_0x44796d,_0x25ac8c){return db[_0xa952('0x50')]['create'](_0x44796d[_0xa952('0x57')],{})['then'](respondWithResult(_0x25ac8c,0xc9))[_0xa952('0x29')](handleError(_0x25ac8c,null));};exports[_0xa952('0x35')]=function(_0x308d70,_0x423215){if(_0x308d70[_0xa952('0x57')]['id']){delete _0x308d70[_0xa952('0x57')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x308d70[_0xa952('0x58')]['id']}})['then'](handleEntityNotFound(_0x423215,null))[_0xa952('0x1f')](saveUpdates(_0x308d70[_0xa952('0x57')],null))[_0xa952('0x1f')](respondWithResult(_0x423215,null))['catch'](handleError(_0x423215,null));};exports[_0xa952('0x36')]=function(_0x2e37a1,_0x1a19bd){return db[_0xa952('0x50')][_0xa952('0x59')]({'where':{'id':_0x2e37a1[_0xa952('0x58')]['id']}})[_0xa952('0x1f')](handleEntityNotFound(_0x1a19bd,null))['then'](removeEntity(_0x1a19bd,null))[_0xa952('0x29')](handleError(_0x1a19bd,null));};exports['describe']=function(_0x45bc84,_0x348ec9){return db[_0xa952('0x50')]['describe']()[_0xa952('0x1f')](respondWithResult(_0x348ec9,null))[_0xa952('0x29')](handleError(_0x348ec9,null));};var interaction_log=require(_0xa952('0x5a'))(_0xa952('0x5b'));exports['accept']=function(_0x1ed4c2,_0x1c3bdb,_0x3a94f8){var _0x146588={'agent':{},'channel':_0xa952('0x5c')};if(_0x1ed4c2['body']['id']){delete _0x1ed4c2[_0xa952('0x57')]['id'];}_0x1ed4c2['body'][_0xa952('0x5d')]=!![];_0x1ed4c2[_0xa952('0x57')][_0xa952('0x5e')]=moment()['format'](_0xa952('0x5f'));_0x1ed4c2[_0xa952('0x57')][_0xa952('0x60')]=_0x1ed4c2[_0xa952('0x57')][_0xa952('0x60')]||_0x1ed4c2['user']['id'];_0x146588[_0xa952('0x61')]['id']=_0x1ed4c2['body'][_0xa952('0x60')];return db[_0xa952('0x50')][_0xa952('0x59')]({'where':{'id':_0x1ed4c2[_0xa952('0x58')]['id'],'UserId':null}})[_0xa952('0x1f')](handleEntityNotFound(_0x1c3bdb,null))[_0xa952('0x1f')](saveUpdates(_0x1ed4c2[_0xa952('0x57')],null))[_0xa952('0x1f')](function(_0x494f41){if(_0x494f41){_0x146588[_0xa952('0x27')]=_0x494f41[_0xa952('0x62')]({'plain':!![]});return db[_0xa952('0x63')][_0xa952('0x59')]({'where':{'id':_0x494f41[_0xa952('0x64')]}});}return null;})[_0xa952('0x1f')](handleEntityNotFound(_0x1c3bdb,null))[_0xa952('0x1f')](function(_0x2569d4){if(_0x2569d4){return _0x2569d4[_0xa952('0x35')]({'UserId':_0x1ed4c2[_0xa952('0x57')]['UserId'],'read1stAt':_[_0xa952('0x65')](_0x2569d4[_0xa952('0x66')])?moment()[_0xa952('0x67')](_0xa952('0x5f')):undefined});}return null;})[_0xa952('0x1f')](function(_0x204563){if(_0x204563){_0x146588[_0xa952('0x68')]=_0x204563[_0xa952('0x62')]({'plain':!![]});interaction_log[_0xa952('0x20')](_0xa952('0x69'),_0x1ed4c2[_0xa952('0x6a')]['id'],_0x1ed4c2[_0xa952('0x6a')][_0xa952('0x40')],_0x1ed4c2[_0xa952('0x6a')]['role'],_0x146588[_0xa952('0x68')]['id'],_0x1ed4c2[_0xa952('0x57')]?JSON[_0xa952('0x6b')](_0x1ed4c2['body']):_0xa952('0x6c'));return respondWithRpcPromise(_0xa952('0x6d'),_0xa952('0x6e'),_0x146588);}return null;})[_0xa952('0x1f')](function(_0x59a47c){var _0x454c5d=_0xa952('0x6f')+_0x59a47c[_0xa952('0x27')]['ContactId'];return db['sequelize'][_0xa952('0x41')](_0x454c5d,{'type':db[_0xa952('0x70')][_0xa952('0x71')][_0xa952('0x72')],'raw':!![]})[_0xa952('0x1f')](function(_0x4bb9ab){return _0x4bb9ab;});})[_0xa952('0x1f')](function(_0x96158c){if(_0x96158c){_0x146588['message'][_0xa952('0x73')]=_0x96158c[0x0];if(!_0x1ed4c2[_0xa952('0x57')][_0xa952('0x60')])return;return db[_0xa952('0x74')][_0xa952('0x59')]({'where':{'id':_0x1ed4c2[_0xa952('0x57')][_0xa952('0x60')],'role':_0xa952('0x61')},'attributes':['id',_0xa952('0x40'),_0xa952('0x75'),'email',_0xa952('0x76')],'raw':!![]});}return null;})[_0xa952('0x1f')](function(_0x5a1c92){if(!_0x5a1c92)return null;_0x146588[_0xa952('0x27')][_0xa952('0x61')]=_0x5a1c92;return _0x146588;})[_0xa952('0x1f')](function(_0x12ddc7){if(_0x12ddc7){if(_0x1ed4c2[_0xa952('0x57')][_0xa952('0x77')]){_0x146588[_0xa952('0x27')][_0xa952('0x78')]=util[_0xa952('0x67')](_0xa952('0x79'),_0x1ed4c2[_0xa952('0x6a')][_0xa952('0x40')]);_0x146588[_0xa952('0x27')][_0xa952('0x7a')]=_0x146588['channel'];_0x146588[_0xa952('0x27')][_0xa952('0x7b')]=_0x146588[_0xa952('0x7a')];_0x146588[_0xa952('0x27')]['event']=_0xa952('0x7c');return respondWithRpcPromise(_0xa952('0x7d'),_0xa952('0x7d'),{'event':_0xa952('0x7e'),'message':_0x146588[_0xa952('0x27')]},client9002)[_0xa952('0x1f')](function(){return _0x146588;});}return _0x146588;}return null;})[_0xa952('0x1f')](respondWithResult(_0x1c3bdb,null))[_0xa952('0x29')](handleError(_0x1c3bdb,null));};var interaction_log=require('../../config/logger')(_0xa952('0x5b'));exports[_0xa952('0x33')]=function(_0x4bf003,_0x5b0284,_0xda5779){var _0x430bfd={'agent':{},'channel':_0xa952('0x5c')};if(_0x4bf003[_0xa952('0x57')]['id']){delete _0x4bf003[_0xa952('0x57')]['id'];}_0x4bf003['body'][_0xa952('0x60')]=_0x4bf003[_0xa952('0x57')][_0xa952('0x60')]||_0x4bf003['user']['id'];_0x430bfd[_0xa952('0x61')]['id']=_0x4bf003[_0xa952('0x57')][_0xa952('0x60')];return db[_0xa952('0x50')][_0xa952('0x59')]({'where':{'id':_0x4bf003['params']['id'],'UserId':null}})[_0xa952('0x1f')](handleEntityNotFound(_0x5b0284,null))[_0xa952('0x1f')](function(_0x3ab4f8){if(_0x3ab4f8){_0x430bfd[_0xa952('0x27')]=_0x3ab4f8[_0xa952('0x62')]({'plain':!![]});return db[_0xa952('0x63')][_0xa952('0x59')]({'where':{'id':_0x3ab4f8[_0xa952('0x64')]}});}return null;})[_0xa952('0x1f')](handleEntityNotFound(_0x5b0284,null))[_0xa952('0x1f')](function(_0x42cb6c){if(_0x42cb6c){_0x430bfd[_0xa952('0x68')]=_0x42cb6c[_0xa952('0x62')]({'plain':!![]});interaction_log['info'](_0xa952('0x7f'),_0x4bf003[_0xa952('0x6a')]['id'],_0x4bf003[_0xa952('0x6a')][_0xa952('0x40')],_0x4bf003[_0xa952('0x6a')][_0xa952('0x80')],_0x430bfd[_0xa952('0x68')]['id'],_0x4bf003[_0xa952('0x57')]?JSON[_0xa952('0x6b')](_0x4bf003[_0xa952('0x57')]):_0xa952('0x6c'));return respondWithRpcPromise(_0xa952('0x81'),_0xa952('0x82'),_0x430bfd);}return null;})[_0xa952('0x1f')](function(_0x32cde1){var _0x41d962='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32cde1[_0xa952('0x27')][_0xa952('0x83')];return db[_0xa952('0x84')][_0xa952('0x41')](_0x41d962,{'type':db[_0xa952('0x70')]['QueryTypes'][_0xa952('0x72')],'raw':!![]})[_0xa952('0x1f')](function(_0x315564){return _0x315564;});})[_0xa952('0x1f')](function(_0x445e37){if(_0x445e37){_0x430bfd[_0xa952('0x27')][_0xa952('0x73')]=_0x445e37[0x0];if(!_0x4bf003['body'][_0xa952('0x60')])return;return db[_0xa952('0x74')][_0xa952('0x59')]({'where':{'id':_0x4bf003[_0xa952('0x57')][_0xa952('0x60')],'role':_0xa952('0x61')},'attributes':['id',_0xa952('0x40'),'fullname',_0xa952('0x85'),'internal'],'raw':!![]});}return null;})['then'](function(_0x48d02c){if(!_0x48d02c)return null;_0x430bfd[_0xa952('0x27')][_0xa952('0x61')]=_0x48d02c;return _0x430bfd;})[_0xa952('0x1f')](function(_0x17fdb4){if(_0x17fdb4){_0x17fdb4['message']['interface']=util[_0xa952('0x67')]('SIP/%s',_0x4bf003[_0xa952('0x6a')]['name']);_0x17fdb4[_0xa952('0x27')][_0xa952('0x7a')]=_0x430bfd[_0xa952('0x7a')];_0x17fdb4[_0xa952('0x27')]['motionChannel']=_0x430bfd[_0xa952('0x7a')];_0x17fdb4[_0xa952('0x27')]['event']='reject';respondWithRpcPromise('EventManager',_0xa952('0x7d'),{'event':_0xa952('0x86'),'message':_0x17fdb4[_0xa952('0x27')]},client9002);return _0x430bfd;}return null;})['then'](respondWithResult(_0x5b0284,null))[_0xa952('0x29')](handleError(_0x5b0284,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ba4a2d0..4431739 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 _0x0e40=['../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e40,0x159));var _0x00e4=function(_0x25ec33,_0x27a53f){_0x25ec33=_0x25ec33-0x0;var _0xf7fd08=_0x0e40[_0x25ec33];return _0xf7fd08;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x00e4('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x00e4('0x1'),'afterDestroy':'remove'};function emitEvent(_0x46f004){return function(_0x317d55,_0x34867c,_0x3e3813){OpenchannelMessageEvents[_0x00e4('0x2')](_0x46f004+':'+_0x317d55['id'],_0x317d55);OpenchannelMessageEvents['emit'](_0x46f004,_0x317d55);_0x3e3813(null);};}for(var e in events){if(events[_0x00e4('0x3')](e)){var event=events[e];OpenchannelMessage[_0x00e4('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x7d15=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7d15,0x1d5));var _0x57d1=function(_0x22b02a,_0x5ce747){_0x22b02a=_0x22b02a-0x0;var _0x9572b3=_0x7d15[_0x22b02a];return _0x9572b3;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x57d1('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x57d1('0x1')](0x0);var events={'afterCreate':_0x57d1('0x2'),'afterUpdate':_0x57d1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e22b0){return function(_0x28ff94,_0x38f9fd,_0x33a6ef){OpenchannelMessageEvents[_0x57d1('0x4')](_0x1e22b0+':'+_0x28ff94['id'],_0x28ff94);OpenchannelMessageEvents[_0x57d1('0x4')](_0x1e22b0,_0x28ff94);_0x33a6ef(null);};}for(var e in events){if(events[_0x57d1('0x5')](e)){var event=events[e];OpenchannelMessage[_0x57d1('0x6')](e,emitEvent(event));}}module[_0x57d1('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 057982b..6f51449 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 _0x75f0=['catch','error','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','replyUri','threadId','Interaction','OpenchannelInteraction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','then','update','createdAt'];(function(_0x564fd5,_0x4362ab){var _0xef1bec=function(_0x27237e){while(--_0x27237e){_0x564fd5['push'](_0x564fd5['shift']());}};_0xef1bec(++_0x4362ab);}(_0x75f0,0xb4));var _0x075f=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x75f0[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x075f('0x0'));var logger=require(_0x075f('0x1'))(_0x075f('0x2'));var moment=require(_0x075f('0x3'));var BPromise=require(_0x075f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x075f('0x5'));var config=require(_0x075f('0x6'));var attributes=require(_0x075f('0x7'));module[_0x075f('0x8')]=function(_0x5f25c2,_0x3f2ae6){return _0x5f25c2[_0x075f('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x075f('0xa'),'paranoid':![],'indexes':[{'name':_0x075f('0xb'),'fields':[_0x075f('0xc')],'type':_0x075f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c697c,_0x5df203,_0x8040f7){var _0x5ea7ff=_0x5f25c2[_0x075f('0xe')];var _0x5d3500=_0x4c697c[_0x075f('0xf')]({'plain':!![]});if(_0x5d3500[_0x075f('0x10')]['toLowerCase']()==='in'||_0x5d3500['direction'][_0x075f('0x11')]()===_0x075f('0x12')&&!_0x5d3500[_0x075f('0x13')]&&!_['isNil'](_0x5d3500[_0x075f('0x14')])){_0x5ea7ff['OpenchannelInteraction']['findOne']({'where':{'id':_0x5d3500['OpenchannelInteractionId']}})[_0x075f('0x15')](function(_0x49ae53){if(_0x49ae53){_0x49ae53[_0x075f('0x16')]({'lastMsgAt':_0x5d3500[_0x075f('0x17')],'lastMsgDirection':_0x5d3500[_0x075f('0x10')]['toLowerCase']()});}})[_0x075f('0x18')](function(_0x9a3017){console[_0x075f('0x19')](_0x9a3017);});}if(_0x5d3500['direction']===_0x075f('0x12')&&!_0x5d3500['secret']){var _0x39d20d;_0x5ea7ff[_0x075f('0x1a')][_0x075f('0x1b')]()[_0x075f('0x15')](function(_0x381f56){return _0x5ea7ff['OpenchannelAccount'][_0x075f('0x1c')]({'where':{'id':_0x5d3500[_0x075f('0x1d')]},'include':[{'model':_0x5ea7ff['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x5d3500[_0x075f('0x1e')]},'limit':0x1,'include':[{'model':_0x5ea7ff['CmContact'],'as':_0x075f('0x1f'),'attributes':_['keys'](_0x381f56)}]}]});})[_0x075f('0x15')](function(_0x40d43f){_0x39d20d=_0x40d43f[_0x075f('0xf')]({'plain':!![]});if(_0x39d20d&&_0x39d20d['replyUri']){logger[_0x075f('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x075f('0x21'),util[_0x075f('0x22')](_0x075f('0x23'),_0x5d3500['id'],_0x39d20d['replyUri']));if(_0x39d20d['Interactions']&&_0x39d20d[_0x075f('0x24')]['length']){_0x5d3500['Interaction']=_[_0x075f('0x25')](_0x39d20d[_0x075f('0x24')][0x0],_0x075f('0x1f'));_0x5d3500[_0x075f('0x1f')]=_0x39d20d[_0x075f('0x24')][0x0][_0x075f('0x1f')];}var _0x5df203={'method':_0x075f('0x26'),'uri':encodeURI(_0x39d20d['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5df203[_0x075f('0x27')]){case _0x075f('0x28'):_0x5df203['qs']=_0x5d3500;break;case _0x075f('0x26'):_0x5df203[_0x075f('0xc')]=_0x5d3500;break;}return rp(_0x5df203)[_0x075f('0x15')](function(_0x6c4f86){logger[_0x075f('0x20')](_0x075f('0x29'),_0x075f('0x21'),util[_0x075f('0x22')](_0x075f('0x2a'),_0x5d3500['id'],_0x39d20d[_0x075f('0x2b')]));if(_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]&&_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]!=_0x5d3500[_0x075f('0x2d')][_0x075f('0x2c')]){return _0x5ea7ff[_0x075f('0x2e')]['update']({'threadId':_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]},{'where':{'id':_0x5d3500[_0x075f('0x2d')]['id']}});}else{return;}})[_0x075f('0x15')](function(){return _0x4c697c[_0x075f('0x16')]({'read':!![]});})['catch'](function(_0x52b047){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x075f('0x21'),util[_0x075f('0x2f')](_0x52b047,{'showHidden':![],'depth':null}));_0x8040f7();});}else{_0x8040f7();}})[_0x075f('0x30')](function(){_0x8040f7();});}else{_0x8040f7();}}},'charset':_0x075f('0x31'),'collate':_0x075f('0x32')});}; \ No newline at end of file +var _0x1370=['OpenchannelInteraction','findOne','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','method','GET','POST','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','get','direction','toLowerCase','out','isNil','UserId'];(function(_0x260e07,_0x2dd0e4){var _0x28ba4e=function(_0x237146){while(--_0x237146){_0x260e07['push'](_0x260e07['shift']());}};_0x28ba4e(++_0x2dd0e4);}(_0x1370,0x81));var _0x0137=function(_0x2b365f,_0x17aa37){_0x2b365f=_0x2b365f-0x0;var _0x26b060=_0x1370[_0x2b365f];return _0x26b060;};'use strict';var _=require('lodash');var util=require(_0x0137('0x0'));var logger=require(_0x0137('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0137('0x2'));var rp=require(_0x0137('0x3'));var fs=require('fs');var path=require(_0x0137('0x4'));var rimraf=require(_0x0137('0x5'));var config=require(_0x0137('0x6'));var attributes=require(_0x0137('0x7'));module[_0x0137('0x8')]=function(_0x296181,_0x23a46e){return _0x296181[_0x0137('0x9')](_0x0137('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x0137('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d5a74,_0x50d33d,_0x769e02){var _0xf81001=_0x296181['models'];var _0x577645=_0x4d5a74[_0x0137('0xc')]({'plain':!![]});if(_0x577645[_0x0137('0xd')][_0x0137('0xe')]()==='in'||_0x577645['direction'][_0x0137('0xe')]()===_0x0137('0xf')&&!_0x577645['secret']&&!_[_0x0137('0x10')](_0x577645[_0x0137('0x11')])){_0xf81001[_0x0137('0x12')][_0x0137('0x13')]({'where':{'id':_0x577645['OpenchannelInteractionId']}})[_0x0137('0x14')](function(_0x50563b){if(_0x50563b){_0x50563b['update']({'lastMsgAt':_0x577645[_0x0137('0x15')],'lastMsgDirection':_0x577645[_0x0137('0xd')][_0x0137('0xe')]()});}})[_0x0137('0x16')](function(_0x21c32f){console[_0x0137('0x17')](_0x21c32f);});}if(_0x577645[_0x0137('0xd')]===_0x0137('0xf')&&!_0x577645['secret']){var _0x3db7ed;_0xf81001[_0x0137('0x18')][_0x0137('0x19')]()['then'](function(_0xc1ac08){return _0xf81001[_0x0137('0x1a')][_0x0137('0x1b')]({'where':{'id':_0x577645['OpenchannelAccountId']},'include':[{'model':_0xf81001['OpenchannelInteraction'],'as':_0x0137('0x1c'),'where':{'id':_0x577645['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xf81001[_0x0137('0x18')],'as':_0x0137('0x1d'),'attributes':_[_0x0137('0x1e')](_0xc1ac08)}]}]});})['then'](function(_0x374e77){_0x3db7ed=_0x374e77[_0x0137('0xc')]({'plain':!![]});if(_0x3db7ed&&_0x3db7ed[_0x0137('0x1f')]){logger[_0x0137('0x20')](_0x0137('0x21'),_0x0137('0x22'),util[_0x0137('0x23')](_0x0137('0x24'),_0x577645['id'],_0x3db7ed[_0x0137('0x1f')]));if(_0x3db7ed[_0x0137('0x1c')]&&_0x3db7ed[_0x0137('0x1c')]['length']){_0x577645['Interaction']=_[_0x0137('0x25')](_0x3db7ed['Interactions'][0x0],_0x0137('0x1d'));_0x577645['Contact']=_0x3db7ed[_0x0137('0x1c')][0x0][_0x0137('0x1d')];}var _0x50d33d={'method':'POST','uri':encodeURI(_0x3db7ed['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x50d33d[_0x0137('0x26')]){case _0x0137('0x27'):_0x50d33d['qs']=_0x577645;break;case _0x0137('0x28'):_0x50d33d[_0x0137('0x29')]=_0x577645;break;}return rp(_0x50d33d)['then'](function(_0x316632){logger[_0x0137('0x20')](_0x0137('0x21'),'afterCreate',util[_0x0137('0x23')](_0x0137('0x2a'),_0x577645['id'],_0x3db7ed[_0x0137('0x1f')]));if(_0x316632[_0x0137('0x29')]['threadId']&&_0x316632[_0x0137('0x29')]['threadId']!=_0x577645['Interaction'][_0x0137('0x2b')]){return _0xf81001[_0x0137('0x12')]['update']({'threadId':_0x316632[_0x0137('0x29')][_0x0137('0x2b')]},{'where':{'id':_0x577645[_0x0137('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x4d5a74[_0x0137('0x2d')]({'read':!![]});})[_0x0137('0x16')](function(_0x5a80da){logger[_0x0137('0x17')](_0x0137('0x21'),'afterCreate',util['inspect'](_0x5a80da,{'showHidden':![],'depth':null}));_0x769e02();});}else{_0x769e02();}})[_0x0137('0x2e')](function(){_0x769e02();});}else{_0x769e02();}}},'charset':_0x0137('0x2f'),'collate':_0x0137('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a8a7210..d697877 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 _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(_0x3f9e48,_0xe329b){var _0x280edd=function(_0x4a9e5d){while(--_0x4a9e5d){_0x3f9e48['push'](_0x3f9e48['shift']());}};_0x280edd(++_0xe329b);}(_0x2ef3,0xba));var _0x32ef=function(_0x2088bb,_0x30ff7b){_0x2088bb=_0x2088bb-0x0;var _0xcd7d9=_0x2ef3[_0x2088bb];return _0xcd7d9;};'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 +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x4a94b1,_0x4f2518){var _0x20949f=function(_0x1c4aa6){while(--_0x1c4aa6){_0x4a94b1['push'](_0x4a94b1['shift']());}};_0x20949f(++_0x4f2518);}(_0xdb28,0x106));var _0x8db2=function(_0x503cbd,_0x1b02b3){_0x503cbd=_0x503cbd-0x0;var _0x5974c5=_0xdb28[_0x503cbd];return _0x5974c5;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a8be851..561338c 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 _0xa1aa=['register','length','openchannelMessage:','remove','update','emit','removeListener'];(function(_0x2777ee,_0x470e85){var _0x1e9891=function(_0x1fc4c1){while(--_0x1fc4c1){_0x2777ee['push'](_0x2777ee['shift']());}};_0x1e9891(++_0x470e85);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3ad1fa,_0x29cf81){_0x3ad1fa=_0x3ad1fa-0x0;var _0x4a25c4=_0xa1aa[_0x3ad1fa];return _0x4a25c4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xaa1a('0x0'),_0xaa1a('0x1')];function createListener(_0x39e955,_0x132066){return function(_0x1b5247){_0x132066[_0xaa1a('0x2')](_0x39e955,_0x1b5247);};}function removeListener(_0x34f7d0,_0x4e7869){return function(){OpenchannelMessageEvents[_0xaa1a('0x3')](_0x34f7d0,_0x4e7869);};}exports[_0xaa1a('0x4')]=function(_0x4934e6){for(var _0x3500c9=0x0,_0x15b767=events[_0xaa1a('0x5')];_0x3500c9<_0x15b767;_0x3500c9++){var _0x1a289d=events[_0x3500c9];var _0x253dc7=createListener(_0xaa1a('0x6')+_0x1a289d,_0x4934e6);OpenchannelMessageEvents['on'](_0x1a289d,_0x253dc7);}}; \ No newline at end of file +var _0x9d5c=['update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d5c,0x98));var _0xc9d5=function(_0x262521,_0x296e11){_0x262521=_0x262521-0x0;var _0xcd2b53=_0x9d5c[_0x262521];return _0xcd2b53;};'use strict';var OpenchannelMessageEvents=require(_0xc9d5('0x0'));var events=['save',_0xc9d5('0x1'),_0xc9d5('0x2')];function createListener(_0x5d161b,_0x1f1d2f){return function(_0x30cb5b){_0x1f1d2f[_0xc9d5('0x3')](_0x5d161b,_0x30cb5b);};}function removeListener(_0x5535d9,_0x44a6eb){return function(){OpenchannelMessageEvents[_0xc9d5('0x4')](_0x5535d9,_0x44a6eb);};}exports['register']=function(_0x207097){for(var _0x26bd2f=0x0,_0x1a91f5=events[_0xc9d5('0x5')];_0x26bd2f<_0x1a91f5;_0x26bd2f++){var _0x2edfbc=events[_0x26bd2f];var _0x3a5810=createListener(_0xc9d5('0x6')+_0x2edfbc,_0x207097);OpenchannelMessageEvents['on'](_0x2edfbc,_0x3a5810);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3b8a1af..f002dc5 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 _0x59a7=['isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x59e607,_0x2cd7b4){var _0x11f906=function(_0x466b2a){while(--_0x466b2a){_0x59e607['push'](_0x59e607['shift']());}};_0x11f906(++_0x2cd7b4);}(_0x59a7,0x1d3));var _0x759a=function(_0x1269dc,_0x5cc0bc){_0x1269dc=_0x1269dc-0x0;var _0x2a93fb=_0x59a7[_0x1269dc];return _0x2a93fb;};'use strict';var multer=require('multer');var util=require(_0x759a('0x0'));var path=require(_0x759a('0x1'));var timeout=require(_0x759a('0x2'));var express=require(_0x759a('0x3'));var router=express['Router']();var fs_extra=require(_0x759a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x759a('0x5'));var config=require(_0x759a('0x6'));var controller=require('./openchannelQueue.controller');router[_0x759a('0x7')]('/',auth[_0x759a('0x8')](),controller[_0x759a('0x9')]);router[_0x759a('0x7')](_0x759a('0xa'),auth[_0x759a('0x8')](),controller['describe']);router['get'](_0x759a('0xb'),auth[_0x759a('0x8')](),controller['show']);router[_0x759a('0x7')](_0x759a('0xc'),auth[_0x759a('0x8')](),controller[_0x759a('0xd')]);router[_0x759a('0x7')](_0x759a('0xe'),auth[_0x759a('0x8')](),controller['getTeams']);router[_0x759a('0x7')](_0x759a('0xf'),auth[_0x759a('0x8')](),controller['getAgents']);router[_0x759a('0x10')]('/',auth[_0x759a('0x8')](),controller[_0x759a('0x11')]);router[_0x759a('0x10')](_0x759a('0xe'),auth['isAuthenticated'](),controller[_0x759a('0x12')]);router[_0x759a('0x10')]('/:id/users',auth[_0x759a('0x8')](),controller[_0x759a('0x13')]);router['put']('/:id',auth[_0x759a('0x8')](),controller[_0x759a('0x14')]);router[_0x759a('0x15')](_0x759a('0xb'),auth[_0x759a('0x8')](),controller['destroy']);router[_0x759a('0x15')](_0x759a('0xe'),auth[_0x759a('0x8')](),controller[_0x759a('0x16')]);router[_0x759a('0x15')](_0x759a('0xf'),auth['isAuthenticated'](),controller[_0x759a('0x17')]);module[_0x759a('0x18')]=router; \ No newline at end of file +var _0x2899=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4aca29,_0x3e5c5c){var _0x55cc44=function(_0x517014){while(--_0x517014){_0x4aca29['push'](_0x4aca29['shift']());}};_0x55cc44(++_0x3e5c5c);}(_0x2899,0x144));var _0x9289=function(_0x2d8805,_0x58ed42){_0x2d8805=_0x2d8805-0x0;var _0x51458b=_0x2899[_0x2d8805];return _0x51458b;};'use strict';var multer=require(_0x9289('0x0'));var util=require(_0x9289('0x1'));var path=require('path');var timeout=require(_0x9289('0x2'));var express=require(_0x9289('0x3'));var router=express[_0x9289('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9289('0x5'));var interaction=require(_0x9289('0x6'));var config=require(_0x9289('0x7'));var controller=require(_0x9289('0x8'));router[_0x9289('0x9')]('/',auth[_0x9289('0xa')](),controller[_0x9289('0xb')]);router[_0x9289('0x9')]('/describe',auth[_0x9289('0xa')](),controller[_0x9289('0xc')]);router['get']('/:id',auth[_0x9289('0xa')](),controller[_0x9289('0xd')]);router[_0x9289('0x9')]('/:id/members',auth[_0x9289('0xa')](),controller[_0x9289('0xe')]);router['get'](_0x9289('0xf'),auth[_0x9289('0xa')](),controller[_0x9289('0x10')]);router['get']('/:id/users',auth[_0x9289('0xa')](),controller[_0x9289('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9289('0x12')](_0x9289('0xf'),auth[_0x9289('0xa')](),controller[_0x9289('0x13')]);router[_0x9289('0x12')](_0x9289('0x14'),auth['isAuthenticated'](),controller[_0x9289('0x15')]);router[_0x9289('0x16')](_0x9289('0x17'),auth[_0x9289('0xa')](),controller[_0x9289('0x18')]);router[_0x9289('0x19')](_0x9289('0x17'),auth[_0x9289('0xa')](),controller[_0x9289('0x1a')]);router['delete'](_0x9289('0xf'),auth[_0x9289('0xa')](),controller[_0x9289('0x1b')]);router[_0x9289('0x19')](_0x9289('0x14'),auth['isAuthenticated'](),controller[_0x9289('0x1c')]);module[_0x9289('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 51811e9..590084f 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 _0x961c=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x3f1990,_0x595e36){var _0x7ddaca=function(_0x3ada87){while(--_0x3ada87){_0x3f1990['push'](_0x3f1990['shift']());}};_0x7ddaca(++_0x595e36);}(_0x961c,0x1a2));var _0xc961=function(_0x2104bc,_0x59fc62){_0x2104bc=_0x2104bc-0x0;var _0x5b7c69=_0x961c[_0x2104bc];return _0x5b7c69;};'use strict';var Sequelize=require(_0xc961('0x0'));module[_0xc961('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc961('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc961('0x3')]},'timeout':{'type':Sequelize[_0xc961('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc961('0x5')](_0xc961('0x6'),_0xc961('0x7'),_0xc961('0x8'))}}; \ No newline at end of file +var _0xf519=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x46ce14,_0x4f7796){var _0x1f15f0=function(_0x314f19){while(--_0x314f19){_0x46ce14['push'](_0x46ce14['shift']());}};_0x1f15f0(++_0x4f7796);}(_0xf519,0x1e3));var _0x9f51=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xf519[_0x3da832];return _0xe602f2;};'use strict';var Sequelize=require(_0x9f51('0x0'));module[_0x9f51('0x1')]={'name':{'type':Sequelize[_0x9f51('0x2')],'unique':_0x9f51('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9f51('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9f51('0x5'),_0x9f51('0x6'),_0x9f51('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c5b08bd..f41334a 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 _0x2475=['includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','findOne','Team','pick','filter','online','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','emit','userOpenchannelQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','OpenchannelQueue'];(function(_0x582e68,_0xda0a42){var _0x63bf99=function(_0x1c7173){while(--_0x1c7173){_0x582e68['push'](_0x582e68['shift']());}};_0x63bf99(++_0xda0a42);}(_0x2475,0xc6));var _0x5247=function(_0x5d4204,_0x332377){_0x5d4204=_0x5d4204-0x0;var _0x5f526a=_0x2475[_0x5d4204];return _0x5f526a;};'use strict';var emlformat=require(_0x5247('0x0'));var rimraf=require(_0x5247('0x1'));var zipdir=require(_0x5247('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5247('0x3'));var moment=require(_0x5247('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5247('0x5'));var csv=require(_0x5247('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5247('0x7'));var crypto=require(_0x5247('0x8'));var jsforce=require(_0x5247('0x9'));var deskjs=require(_0x5247('0xa'));var toCsv=require(_0x5247('0x6'));var querystring=require(_0x5247('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5247('0xc'));var qs=require(_0x5247('0xd'));var as=require(_0x5247('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5247('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5247('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5247('0x11')](config[_0x5247('0x12')],{'host':_0x5247('0x13'),'port':0x18eb});var socket=require(_0x5247('0x14'))(new Redis(config[_0x5247('0x12')]));require('./openchannelQueue.socket')[_0x5247('0x15')](socket);function respondWithStatusCode(_0x1248b5,_0x1f85be){_0x1f85be=_0x1f85be||0xcc;return function(_0x3ea7a2){if(_0x3ea7a2){return _0x1248b5[_0x5247('0x16')](_0x1f85be);}return _0x1248b5[_0x5247('0x17')](_0x1f85be)[_0x5247('0x18')]();};}function respondWithResult(_0x14599b,_0x11c752){_0x11c752=_0x11c752||0xc8;return function(_0x271a2e){if(_0x271a2e){return _0x14599b[_0x5247('0x17')](_0x11c752)[_0x5247('0x19')](_0x271a2e);}};}function respondWithFilteredResult(_0x49f57d,_0x24a22b){return function(_0x26d8e5){if(_0x26d8e5){var _0x5b9bf0=typeof _0x24a22b[_0x5247('0x1a')]===_0x5247('0x1b')&&typeof _0x24a22b[_0x5247('0x1c')]===_0x5247('0x1b');var _0x50d152=_0x26d8e5['count'];var _0x11de71=_0x5b9bf0?0x0:_0x24a22b['offset'];var _0x3537a1=_0x5b9bf0?_0x26d8e5[_0x5247('0x1d')]:_0x24a22b[_0x5247('0x1a')]+_0x24a22b[_0x5247('0x1c')];var _0x21ab2f;if(_0x3537a1>=_0x50d152){_0x3537a1=_0x50d152;_0x21ab2f=0xc8;}else{_0x21ab2f=0xce;}_0x49f57d[_0x5247('0x17')](_0x21ab2f);return _0x49f57d['set'](_0x5247('0x1e'),_0x11de71+'-'+_0x3537a1+'/'+_0x50d152)[_0x5247('0x19')](_0x26d8e5);}return null;};}function patchUpdates(_0x38292a){return function(_0x62caf1){try{jsonpatch[_0x5247('0x1f')](_0x62caf1,_0x38292a,!![]);}catch(_0x198e05){return BPromise[_0x5247('0x20')](_0x198e05);}return _0x62caf1['save']();};}function saveUpdates(_0x48f9c7,_0x1e6b64){return function(_0x2c8b07){if(_0x2c8b07){return _0x2c8b07[_0x5247('0x21')](_0x48f9c7)[_0x5247('0x22')](function(_0x1a99cb){return _0x1a99cb;});}return null;};}function removeEntity(_0x47f2fd,_0x16c0a6){return function(_0x408bac){if(_0x408bac){return _0x408bac[_0x5247('0x23')]()[_0x5247('0x22')](function(){var _0x557153=_0x408bac[_0x5247('0x24')]({'plain':!![]});var _0x3a8157=_0x5247('0x25');return db[_0x5247('0x26')][_0x5247('0x23')]({'where':{'type':_0x3a8157,'resourceId':_0x557153['id']}})[_0x5247('0x22')](function(){return _0x408bac;});})[_0x5247('0x22')](function(){_0x47f2fd[_0x5247('0x17')](0xcc)[_0x5247('0x18')]();});}};}function handleEntityNotFound(_0xec42e6,_0x1ba5bb){return function(_0x2f00de){if(!_0x2f00de){_0xec42e6[_0x5247('0x16')](0x194);}return _0x2f00de;};}function handleError(_0x57a716,_0x3de7d3){_0x3de7d3=_0x3de7d3||0x1f4;return function(_0x29736d){logger[_0x5247('0x27')](_0x29736d[_0x5247('0x28')]);if(_0x29736d[_0x5247('0x29')]){delete _0x29736d['name'];}_0x57a716[_0x5247('0x17')](_0x3de7d3)[_0x5247('0x2a')](_0x29736d);};}exports[_0x5247('0x2b')]=function(_0x4999f6,_0x20a907){var _0x3aa635={},_0x37957d={},_0x4d5f41={'count':0x0,'rows':[]};var _0x1fac74=_[_0x5247('0x2c')](db['OpenchannelQueue'][_0x5247('0x2d')],function(_0xac2ec8){return{'name':_0xac2ec8['fieldName'],'type':_0xac2ec8[_0x5247('0x2e')]['key']};});_0x37957d[_0x5247('0x2f')]=_['map'](_0x1fac74,'name');_0x37957d[_0x5247('0x30')]=_[_0x5247('0x31')](_0x4999f6[_0x5247('0x30')]);_0x37957d[_0x5247('0x32')]=_[_0x5247('0x33')](_0x37957d[_0x5247('0x2f')],_0x37957d[_0x5247('0x30')]);_0x3aa635[_0x5247('0x34')]=_[_0x5247('0x33')](_0x37957d['model'],qs[_0x5247('0x35')](_0x4999f6['query'][_0x5247('0x35')]));_0x3aa635['attributes']=_0x3aa635['attributes'][_0x5247('0x36')]?_0x3aa635[_0x5247('0x34')]:_0x37957d[_0x5247('0x2f')];if(!_0x4999f6['query']['hasOwnProperty'](_0x5247('0x37'))){_0x3aa635['limit']=qs[_0x5247('0x1c')](_0x4999f6[_0x5247('0x30')][_0x5247('0x1c')]);_0x3aa635[_0x5247('0x1a')]=qs['offset'](_0x4999f6[_0x5247('0x30')][_0x5247('0x1a')]);}_0x3aa635['order']=qs['sort'](_0x4999f6[_0x5247('0x30')][_0x5247('0x38')]);_0x3aa635[_0x5247('0x39')]=qs[_0x5247('0x32')](_['pick'](_0x4999f6['query'],_0x37957d[_0x5247('0x32')]),_0x1fac74);if(_0x4999f6[_0x5247('0x30')]['filter']){_0x3aa635[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x3aa635['where'],{'$or':_[_0x5247('0x2c')](_0x1fac74,function(_0x4e9542){if(_0x4e9542[_0x5247('0x2e')]!==_0x5247('0x3b')){var _0x8c7a88={};_0x8c7a88[_0x4e9542[_0x5247('0x29')]]={'$like':'%'+_0x4999f6[_0x5247('0x30')]['filter']+'%'};return _0x8c7a88;}})});}_0x3aa635=_[_0x5247('0x3a')]({},_0x3aa635,_0x4999f6[_0x5247('0x3c')]);var _0xa5af32={'where':_0x3aa635[_0x5247('0x39')]};return db[_0x5247('0x3d')][_0x5247('0x1d')](_0xa5af32)['then'](function(_0x1ed9e7){_0x4d5f41[_0x5247('0x1d')]=_0x1ed9e7;if(_0x4999f6[_0x5247('0x30')][_0x5247('0x3e')]){_0x3aa635[_0x5247('0x3f')]=[{'all':!![]}];}return db[_0x5247('0x3d')][_0x5247('0x40')](_0x3aa635);})[_0x5247('0x22')](function(_0x24d0b8){_0x4d5f41[_0x5247('0x41')]=_0x24d0b8;return _0x4d5f41;})[_0x5247('0x22')](respondWithFilteredResult(_0x20a907,_0x3aa635))[_0x5247('0x42')](handleError(_0x20a907,null));};exports['show']=function(_0x56fe70,_0x519751){var _0x8d2b24={'raw':!![],'where':{'id':_0x56fe70[_0x5247('0x43')]['id']}},_0xaa279a={};_0xaa279a[_0x5247('0x2f')]=_[_0x5247('0x31')](db[_0x5247('0x3d')]['rawAttributes']);_0xaa279a[_0x5247('0x30')]=_[_0x5247('0x31')](_0x56fe70[_0x5247('0x30')]);_0xaa279a[_0x5247('0x32')]=_['intersection'](_0xaa279a[_0x5247('0x2f')],_0xaa279a['query']);_0x8d2b24[_0x5247('0x34')]=_['intersection'](_0xaa279a[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x56fe70['query']['fields']));_0x8d2b24[_0x5247('0x34')]=_0x8d2b24[_0x5247('0x34')][_0x5247('0x36')]?_0x8d2b24['attributes']:_0xaa279a[_0x5247('0x2f')];if(_0x56fe70[_0x5247('0x30')][_0x5247('0x3e')]){_0x8d2b24[_0x5247('0x3f')]=[{'all':!![]}];}_0x8d2b24=_[_0x5247('0x3a')]({},_0x8d2b24,_0x56fe70[_0x5247('0x3c')]);return db[_0x5247('0x3d')][_0x5247('0x44')](_0x8d2b24)[_0x5247('0x22')](handleEntityNotFound(_0x519751,null))[_0x5247('0x22')](respondWithResult(_0x519751,null))[_0x5247('0x42')](handleError(_0x519751,null));};exports[_0x5247('0x45')]=function(_0x1728ea,_0x3403ba){return db[_0x5247('0x3d')][_0x5247('0x45')](_0x1728ea[_0x5247('0x46')],{})[_0x5247('0x22')](function(_0x24b065){var _0xa6c2ab=_0x1728ea['user'][_0x5247('0x24')]({'plain':!![]});if(!_0xa6c2ab)throw new Error(_0x5247('0x47'));if(_0xa6c2ab['role']===_0x5247('0x48')){var _0x40562e=_0x24b065[_0x5247('0x24')]({'plain':!![]});var _0x555191='OpenchannelQueues';return db[_0x5247('0x49')]['find']({'where':{'name':_0x555191,'userProfileId':_0xa6c2ab[_0x5247('0x4a')]},'raw':!![]})[_0x5247('0x22')](function(_0x1e200e){if(_0x1e200e&&_0x1e200e[_0x5247('0x4b')]===0x0){return db[_0x5247('0x26')]['create']({'name':_0x40562e[_0x5247('0x29')],'resourceId':_0x40562e['id'],'type':_0x1e200e['name'],'sectionId':_0x1e200e['id']},{})['then'](function(){return _0x24b065;});}else{return _0x24b065;}})[_0x5247('0x42')](function(_0x2e9d19){logger[_0x5247('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e9d19);throw _0x2e9d19;});}return _0x24b065;})[_0x5247('0x22')](respondWithResult(_0x3403ba,0xc9))[_0x5247('0x42')](handleError(_0x3403ba,null));};exports[_0x5247('0x21')]=function(_0x416f43,_0x2db365){if(_0x416f43['body']['id']){delete _0x416f43[_0x5247('0x46')]['id'];}return db[_0x5247('0x3d')]['find']({'where':{'id':_0x416f43[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x2db365,null))['then'](saveUpdates(_0x416f43[_0x5247('0x46')],null))[_0x5247('0x22')](respondWithResult(_0x2db365,null))[_0x5247('0x42')](handleError(_0x2db365,null));};exports[_0x5247('0x23')]=function(_0xc57403,_0x589a3a){return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0xc57403[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x589a3a,null))[_0x5247('0x22')](removeEntity(_0x589a3a,null))[_0x5247('0x42')](handleError(_0x589a3a,null));};exports[_0x5247('0x4c')]=function(_0x423da9,_0x1fbc3b){return db[_0x5247('0x3d')]['describe']()['then'](respondWithResult(_0x1fbc3b,null))['catch'](handleError(_0x1fbc3b,null));};exports[_0x5247('0x4d')]=function(_0x1cc2e5,_0x324b87,_0xf26c17){var _0x159611={'raw':!![],'where':{}},_0x67db67={},_0x39cbef;return db[_0x5247('0x3d')]['findOne']({'where':{'id':_0x1cc2e5['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x324b87,null))['then'](function(_0x5eca96){if(_0x5eca96){_0x39cbef=_0x5eca96[_0x5247('0x24')]({'plain':!![]});_0x67db67[_0x5247('0x2f')]=_[_0x5247('0x31')](db[_0x5247('0x4e')][_0x5247('0x2d')]);_0x67db67['query']=_[_0x5247('0x31')](_0x1cc2e5[_0x5247('0x30')]);_0x67db67[_0x5247('0x32')]=_[_0x5247('0x33')](_0x67db67[_0x5247('0x2f')],_0x67db67['query']);_0x159611[_0x5247('0x34')]=_['intersection'](_0x67db67[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x1cc2e5['query'][_0x5247('0x35')]));_0x159611['attributes']=_0x159611[_0x5247('0x34')][_0x5247('0x36')]?_0x159611[_0x5247('0x34')]:_0x67db67[_0x5247('0x2f')];if(!_0x1cc2e5[_0x5247('0x30')][_0x5247('0x4f')](_0x5247('0x37'))){_0x159611['limit']=qs[_0x5247('0x1c')](_0x1cc2e5[_0x5247('0x30')][_0x5247('0x1c')]);_0x159611[_0x5247('0x1a')]=qs[_0x5247('0x1a')](_0x1cc2e5['query']['offset']);}_0x159611[_0x5247('0x50')]=qs['sort'](_0x1cc2e5[_0x5247('0x30')]['sort']);_0x159611[_0x5247('0x39')]=qs[_0x5247('0x32')](_['pick'](_0x1cc2e5['query'],_0x67db67['filters']));_0x159611[_0x5247('0x39')][_0x5247('0x51')]=_0x5eca96['id'];if(_0x1cc2e5[_0x5247('0x30')]['filter']){_0x159611[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x159611['where'],{'$or':_[_0x5247('0x2c')](_0x159611[_0x5247('0x34')],function(_0x4b8c44){var _0x21b82e={};_0x21b82e[_0x4b8c44]={'$like':'%'+_0x1cc2e5[_0x5247('0x30')]['filter']+'%'};return _0x21b82e;})});}_0x159611=_['merge']({},_0x159611,_0x1cc2e5[_0x5247('0x3c')]);return db[_0x5247('0x4e')][_0x5247('0x40')](_0x159611);}})[_0x5247('0x22')](function(_0x5ea4bb){if(_0x5ea4bb){return db[_0x5247('0x52')][_0x5247('0x53')]({'where':{'id':_[_0x5247('0x2c')](_0x5ea4bb,_0x5247('0x54')),'role':_0x5247('0x55')},'attributes':['id','name','openchannelPause','updatedAt',_0x5247('0x56')]});}})[_0x5247('0x22')](function(_0x197c82){if(_0x197c82){return{'count':_0x197c82[_0x5247('0x1d')],'rows':_[_0x5247('0x2c')](_0x197c82[_0x5247('0x41')],function(_0x677d03){return{'membername':_0x677d03[_0x5247('0x29')],'UserId':_0x677d03['id'],'queue_name':_0x39cbef[_0x5247('0x29')],'OpenchannelQueueId':_0x39cbef['id'],'interface':util[_0x5247('0x57')](_0x5247('0x58'),_0x5247('0x59'),_0x677d03[_0x5247('0x29')]),'penalty':0x0,'paused':_0x677d03[_0x5247('0x5a')],'createdAt':_0x677d03['createdAt'],'updatedAt':_0x677d03['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5247('0x22')](respondWithFilteredResult(_0x324b87,_0x159611))[_0x5247('0x42')](handleError(_0x324b87,null));};exports[_0x5247('0x5b')]=function(_0x20549f,_0x1b58c9,_0x42e9eb){var _0x4b5225={};var _0x4c8ab5={};var _0x559807;var _0x4c9b34;return db['OpenchannelQueue'][_0x5247('0x5c')]({'where':{'id':_0x20549f[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x1b58c9,null))[_0x5247('0x22')](function(_0x422b26){if(_0x422b26){_0x559807=_0x422b26;_0x4c8ab5['model']=_[_0x5247('0x31')](db[_0x5247('0x5d')][_0x5247('0x2d')]);_0x4c8ab5[_0x5247('0x30')]=_['keys'](_0x20549f['query']);_0x4c8ab5['filters']=_[_0x5247('0x33')](_0x4c8ab5[_0x5247('0x2f')],_0x4c8ab5[_0x5247('0x30')]);_0x4b5225['attributes']=_[_0x5247('0x33')](_0x4c8ab5[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x20549f[_0x5247('0x30')][_0x5247('0x35')]));_0x4b5225[_0x5247('0x34')]=_0x4b5225[_0x5247('0x34')]['length']?_0x4b5225[_0x5247('0x34')]:_0x4c8ab5[_0x5247('0x2f')];_0x4b5225[_0x5247('0x50')]=qs[_0x5247('0x38')](_0x20549f[_0x5247('0x30')][_0x5247('0x38')]);_0x4b5225[_0x5247('0x39')]=qs['filters'](_[_0x5247('0x5e')](_0x20549f[_0x5247('0x30')],_0x4c8ab5['filters']));if(_0x20549f[_0x5247('0x30')][_0x5247('0x5f')]){_0x4b5225[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x4b5225[_0x5247('0x39')],{'$or':_[_0x5247('0x2c')](_0x4b5225[_0x5247('0x34')],function(_0x4765a0){var _0x1f73e1={};_0x1f73e1[_0x4765a0]={'$like':'%'+_0x20549f['query'][_0x5247('0x5f')]+'%'};return _0x1f73e1;})});}_0x4b5225=_['merge']({},_0x4b5225,_0x20549f[_0x5247('0x3c')]);return _0x559807[_0x5247('0x5b')](_0x4b5225);}})[_0x5247('0x22')](function(_0x1cc50c){if(_0x1cc50c){_0x4c9b34=_0x1cc50c[_0x5247('0x36')];if(!_0x20549f[_0x5247('0x30')]['hasOwnProperty'](_0x5247('0x37'))){_0x4b5225[_0x5247('0x1c')]=qs[_0x5247('0x1c')](_0x20549f[_0x5247('0x30')][_0x5247('0x1c')]);_0x4b5225['offset']=qs[_0x5247('0x1a')](_0x20549f[_0x5247('0x30')]['offset']);}return _0x559807[_0x5247('0x5b')](_0x4b5225);}})[_0x5247('0x22')](function(_0x5e9285){if(_0x5e9285){return _0x5e9285?{'count':_0x4c9b34,'rows':_0x5e9285}:null;}})['then'](respondWithResult(_0x1b58c9,null))['catch'](handleError(_0x1b58c9,null));};exports['addTeams']=function(_0x1184d0,_0x33f630,_0x33b350){var _0x28030a=_0x1184d0[_0x5247('0x46')]['ids'];return db['Team'][_0x5247('0x40')]({'where':{'id':_0x28030a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5247('0x29'),_0x5247('0x60'),'voicePause','interface'],'raw':!![]}]})[_0x5247('0x22')](function(_0x7cfe49){if(_0x7cfe49){var _0x554c61=_[_0x5247('0x61')](_0x7cfe49,function(_0x14d2b7){var _0x4dc42a=_0x14d2b7[_0x5247('0x24')]({'plain':!![]});return _0x4dc42a[_0x5247('0x62')];});return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0x1184d0[_0x5247('0x43')]['id']}})[_0x5247('0x22')](function(_0x14247d){return db[_0x5247('0x63')][_0x5247('0x64')](function(_0x5314f6){return _0x14247d[_0x5247('0x65')](_0x28030a,{'transaction':_0x5314f6})['then'](function(){return BPromise[_0x5247('0x66')](_0x554c61,function(_0x439628){return db[_0x5247('0x4e')][_0x5247('0x67')]({'where':{'UserId':_0x439628['id'],'OpenchannelQueueId':_0x1184d0[_0x5247('0x43')]['id']},'transaction':_0x5314f6});});})['then'](function(){_0x554c61[_0x5247('0x68')](function(_0x2bd53e){socket['emit'](_0x5247('0x69'),{'UserId':_0x2bd53e['id'],'OpenchannelQueueId':_0x14247d['id']});});});});});}})[_0x5247('0x22')](respondWithStatusCode(_0x33f630,null))[_0x5247('0x42')](handleError(_0x33f630,null));};exports[_0x5247('0x6a')]=function(_0x4758a9,_0x1683f2,_0x386b0e){return db[_0x5247('0x5d')]['findAll']({'where':{'id':_0x4758a9[_0x5247('0x30')][_0x5247('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x5247('0x52')],'as':_0x5247('0x62'),'attributes':['id'],'raw':!![]}]})[_0x5247('0x22')](handleEntityNotFound(_0x1683f2,null))[_0x5247('0x22')](function(_0x389d13){var _0x2edda8=_['map'](_0x389d13,'id');var _0x55681a=[];var _0x164c38=[];var _0x152127=squel['select']();_0x152127[_0x5247('0x6c')](_0x5247('0x6d'))[_0x5247('0x6e')](_0x5247('0x6f'),'tq')[_0x5247('0x70')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5247('0x39')](_0x5247('0x71'),_0x4758a9[_0x5247('0x43')]['id']);for(var _0x5d4e6d=0x0;_0x5d4e6d<_0x389d13['length'];_0x5d4e6d+=0x1){let _0x26466d=_0x389d13[_0x5d4e6d];for(var _0x7ef2e9=0x0;_0x7ef2e9<_0x26466d[_0x5247('0x62')][_0x5247('0x36')];_0x7ef2e9+=0x1){let _0x49bec0=_0x26466d[_0x5247('0x62')][_0x7ef2e9];var _0x474504=_0x152127[_0x5247('0x72')]();_0x474504['where'](_0x5247('0x73'),_0x49bec0['id']);_0x164c38[_0x5247('0x74')](db['sequelize']['query'](_0x474504[_0x5247('0x75')](),{'type':db[_0x5247('0x63')][_0x5247('0x76')][_0x5247('0x77')]})[_0x5247('0x22')](function(_0x2482bf){if(_0x2482bf['length']===0x1){return _0x49bec0['id'];}else{var _0x21bced=_['every'](_[_0x5247('0x2c')](_0x2482bf,_0x5247('0x78')),function(_0x100037){return _[_0x5247('0x79')](_0x2edda8,_0x100037);});if(_0x21bced){return _0x49bec0['id'];}}}));}}return BPromise['all'](_0x164c38)[_0x5247('0x22')](function(_0x25d553){_0x55681a=_(_0x55681a)['union'](_0x25d553)[_0x5247('0x7a')]()[_0x5247('0x7b')]();return db[_0x5247('0x3d')]['find']({'where':{'id':_0x4758a9['params']['id']}})[_0x5247('0x22')](function(_0x16e2e7){return db[_0x5247('0x63')]['transaction'](function(_0x545f96){return _0x16e2e7['removeTeams'](_0x4758a9['query'][_0x5247('0x6b')],{'transaction':_0x545f96})[_0x5247('0x22')](function(){if(!_['isEmpty'](_0x55681a)){return _0x16e2e7['removeAgents'](_0x55681a,{'transaction':_0x545f96});}})[_0x5247('0x22')](function(){_0x55681a[_0x5247('0x68')](function(_0x2ca1b4){socket[_0x5247('0x7c')](_0x5247('0x7d'),{'UserId':_0x2ca1b4,'OpenchannelQueueId':_0x16e2e7['id']});});});});});});})[_0x5247('0x22')](respondWithStatusCode(_0x1683f2,null))['catch'](handleError(_0x1683f2,null));};exports[_0x5247('0x7e')]=function(_0x306130,_0x591d01,_0x5e185a){return db[_0x5247('0x3d')]['find']({'where':{'id':_0x306130['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x591d01,null))['then'](function(_0x3a85a1){if(_0x3a85a1){return _0x3a85a1[_0x5247('0x7e')](_0x306130['body']['ids'],_['omit'](_0x306130[_0x5247('0x46')],[_0x5247('0x6b'),'id'])||{})[_0x5247('0x7f')](function(_0x4b654f){for(var _0x3062c9=0x0;_0x3062c9<_0x306130[_0x5247('0x46')][_0x5247('0x6b')]['length'];_0x3062c9+=0x1){socket['emit'](_0x5247('0x69'),{'UserId':Number(_0x306130['body'][_0x5247('0x6b')][_0x3062c9]),'OpenchannelQueueId':Number(_0x306130[_0x5247('0x43')]['id'])});}return _0x4b654f;});}})[_0x5247('0x22')](respondWithResult(_0x591d01,null))['catch'](handleError(_0x591d01,null));};exports[_0x5247('0x80')]=function(_0x26d5e6,_0x349bd7,_0x2b8e1b){return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0x26d5e6[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x349bd7,null))[_0x5247('0x22')](function(_0x213a75){if(_0x213a75){return _0x213a75['removeAgents'](_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')])[_0x5247('0x22')](function(){if(_['isArray'](_0x26d5e6[_0x5247('0x30')]['ids'])){for(var _0x4e000b=0x0;_0x4e000b<_0x26d5e6[_0x5247('0x30')]['ids'][_0x5247('0x36')];_0x4e000b+=0x1){socket[_0x5247('0x7c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')][_0x4e000b]),'OpenchannelQueueId':Number(_0x26d5e6[_0x5247('0x43')]['id'])});}}else{socket[_0x5247('0x7c')](_0x5247('0x7d'),{'UserId':Number(_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')]),'OpenchannelQueueId':Number(_0x26d5e6[_0x5247('0x43')]['id'])});}});}})[_0x5247('0x22')](respondWithStatusCode(_0x349bd7,null))[_0x5247('0x42')](handleError(_0x349bd7,null));};exports[_0x5247('0x81')]=function(_0x37e2b0,_0x63ab8b,_0x8a0e92){var _0x38fc41={};var _0x93b948={};var _0x433349;var _0x1035d0;return db[_0x5247('0x3d')][_0x5247('0x5c')]({'where':{'id':_0x37e2b0['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x63ab8b,null))[_0x5247('0x22')](function(_0x50e8fd){if(_0x50e8fd){_0x433349=_0x50e8fd;_0x93b948[_0x5247('0x2f')]=_['keys'](db[_0x5247('0x52')]['rawAttributes']);_0x93b948[_0x5247('0x30')]=_[_0x5247('0x31')](_0x37e2b0['query']);_0x93b948['filters']=_['intersection'](_0x93b948[_0x5247('0x2f')],_0x93b948[_0x5247('0x30')]);_0x38fc41[_0x5247('0x34')]=_[_0x5247('0x33')](_0x93b948[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x35')]));_0x38fc41[_0x5247('0x34')]=_0x38fc41[_0x5247('0x34')][_0x5247('0x36')]?_0x38fc41[_0x5247('0x34')]:_0x93b948[_0x5247('0x2f')];_0x38fc41[_0x5247('0x50')]=qs[_0x5247('0x38')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x38')]);_0x38fc41[_0x5247('0x39')]=qs[_0x5247('0x32')](_[_0x5247('0x5e')](_0x37e2b0[_0x5247('0x30')],_0x93b948['filters']));if(_0x37e2b0[_0x5247('0x30')]['filter']){_0x38fc41[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x38fc41[_0x5247('0x39')],{'$or':_['map'](_0x38fc41[_0x5247('0x34')],function(_0x2b399e){var _0x1e27da={};_0x1e27da[_0x2b399e]={'$like':'%'+_0x37e2b0[_0x5247('0x30')][_0x5247('0x5f')]+'%'};return _0x1e27da;})});}_0x38fc41=_[_0x5247('0x3a')]({},_0x38fc41,_0x37e2b0['options']);return _0x433349[_0x5247('0x81')](_0x38fc41);}})[_0x5247('0x22')](function(_0xb4cc08){if(_0xb4cc08){_0x1035d0=_0xb4cc08[_0x5247('0x36')];if(!_0x37e2b0[_0x5247('0x30')]['hasOwnProperty'](_0x5247('0x37'))){_0x38fc41[_0x5247('0x1c')]=qs['limit'](_0x37e2b0[_0x5247('0x30')][_0x5247('0x1c')]);_0x38fc41[_0x5247('0x1a')]=qs[_0x5247('0x1a')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x1a')]);}return _0x433349[_0x5247('0x81')](_0x38fc41);}})[_0x5247('0x22')](function(_0x495190){if(_0x495190){return _0x495190?{'count':_0x1035d0,'rows':_0x495190}:null;}})[_0x5247('0x22')](respondWithResult(_0x63ab8b,null))['catch'](handleError(_0x63ab8b,null));}; \ No newline at end of file +var _0x5cbf=['format','SIP','Team','getTeams','hasOwnProperty','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','count','apply','reject','save','then','destroy','OpenchannelQueues','UserProfileResource','error','name','send','index','OpenchannelQueue','type','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt'];(function(_0x70822d,_0x5b21d4){var _0x1062dc=function(_0x8ee055){while(--_0x8ee055){_0x70822d['push'](_0x70822d['shift']());}};_0x1062dc(++_0x5b21d4);}(_0x5cbf,0x145));var _0xf5cb=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5cbf[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xf5cb('0x0'));var rimraf=require(_0xf5cb('0x1'));var zipdir=require(_0xf5cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5cb('0x3'));var moment=require(_0xf5cb('0x4'));var BPromise=require(_0xf5cb('0x5'));var Mustache=require(_0xf5cb('0x6'));var util=require(_0xf5cb('0x7'));var path=require('path');var sox=require(_0xf5cb('0x8'));var csv=require(_0xf5cb('0x9'));var ejs=require(_0xf5cb('0xa'));var fs=require('fs');var fs_extra=require(_0xf5cb('0xb'));var _=require('lodash');var squel=require(_0xf5cb('0xc'));var crypto=require(_0xf5cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf5cb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf5cb('0xf'));var Papa=require(_0xf5cb('0x10'));var Redis=require(_0xf5cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf5cb('0x12'));var as=require(_0xf5cb('0x13'));var hardwareService=require(_0xf5cb('0x14'));var logger=require(_0xf5cb('0x15'))(_0xf5cb('0x16'));var utils=require(_0xf5cb('0x17'));var config=require(_0xf5cb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5cb('0x19'))['db'];config[_0xf5cb('0x1a')]=_[_0xf5cb('0x1b')](config[_0xf5cb('0x1a')],{'host':_0xf5cb('0x1c'),'port':0x18eb});var socket=require(_0xf5cb('0x1d'))(new Redis(config[_0xf5cb('0x1a')]));require(_0xf5cb('0x1e'))[_0xf5cb('0x1f')](socket);function respondWithStatusCode(_0x638339,_0x5088e8){_0x5088e8=_0x5088e8||0xcc;return function(_0x309585){if(_0x309585){return _0x638339[_0xf5cb('0x20')](_0x5088e8);}return _0x638339[_0xf5cb('0x21')](_0x5088e8)[_0xf5cb('0x22')]();};}function respondWithResult(_0x5b314c,_0x2b1ade){_0x2b1ade=_0x2b1ade||0xc8;return function(_0xa493a6){if(_0xa493a6){return _0x5b314c[_0xf5cb('0x21')](_0x2b1ade)[_0xf5cb('0x23')](_0xa493a6);}};}function respondWithFilteredResult(_0x4daf2a,_0x549f97){return function(_0x3a13c8){if(_0x3a13c8){var _0x331c41=typeof _0x549f97[_0xf5cb('0x24')]==='undefined'&&typeof _0x549f97[_0xf5cb('0x25')]==='undefined';var _0x3c4038=_0x3a13c8[_0xf5cb('0x26')];var _0x2217e2=_0x331c41?0x0:_0x549f97[_0xf5cb('0x24')];var _0x25a583=_0x331c41?_0x3a13c8[_0xf5cb('0x26')]:_0x549f97[_0xf5cb('0x24')]+_0x549f97[_0xf5cb('0x25')];var _0x1f50db;if(_0x25a583>=_0x3c4038){_0x25a583=_0x3c4038;_0x1f50db=0xc8;}else{_0x1f50db=0xce;}_0x4daf2a[_0xf5cb('0x21')](_0x1f50db);return _0x4daf2a['set']('Content-Range',_0x2217e2+'-'+_0x25a583+'/'+_0x3c4038)[_0xf5cb('0x23')](_0x3a13c8);}return null;};}function patchUpdates(_0x48dbb1){return function(_0x3df14e){try{jsonpatch[_0xf5cb('0x27')](_0x3df14e,_0x48dbb1,!![]);}catch(_0xb736c5){return BPromise[_0xf5cb('0x28')](_0xb736c5);}return _0x3df14e[_0xf5cb('0x29')]();};}function saveUpdates(_0x31591b,_0x210f3a){return function(_0x2cb56d){if(_0x2cb56d){return _0x2cb56d['update'](_0x31591b)[_0xf5cb('0x2a')](function(_0x19375a){return _0x19375a;});}return null;};}function removeEntity(_0x29855a,_0x4a7416){return function(_0x50f419){if(_0x50f419){return _0x50f419[_0xf5cb('0x2b')]()[_0xf5cb('0x2a')](function(){var _0x286b45=_0x50f419['get']({'plain':!![]});var _0x4bffa0=_0xf5cb('0x2c');return db[_0xf5cb('0x2d')][_0xf5cb('0x2b')]({'where':{'type':_0x4bffa0,'resourceId':_0x286b45['id']}})[_0xf5cb('0x2a')](function(){return _0x50f419;});})['then'](function(){_0x29855a[_0xf5cb('0x21')](0xcc)[_0xf5cb('0x22')]();});}};}function handleEntityNotFound(_0x4f69b0,_0x34a664){return function(_0x3f5460){if(!_0x3f5460){_0x4f69b0[_0xf5cb('0x20')](0x194);}return _0x3f5460;};}function handleError(_0x50e19b,_0x38812c){_0x38812c=_0x38812c||0x1f4;return function(_0x585040){logger[_0xf5cb('0x2e')](_0x585040['stack']);if(_0x585040[_0xf5cb('0x2f')]){delete _0x585040[_0xf5cb('0x2f')];}_0x50e19b[_0xf5cb('0x21')](_0x38812c)[_0xf5cb('0x30')](_0x585040);};}exports[_0xf5cb('0x31')]=function(_0xa52dec,_0x5203b9){var _0x287190={},_0x307245={},_0x53c2c9={'count':0x0,'rows':[]};var _0x334349=_['map'](db[_0xf5cb('0x32')]['rawAttributes'],function(_0x2f6b98){return{'name':_0x2f6b98['fieldName'],'type':_0x2f6b98[_0xf5cb('0x33')]['key']};});_0x307245['model']=_[_0xf5cb('0x34')](_0x334349,_0xf5cb('0x2f'));_0x307245[_0xf5cb('0x35')]=_[_0xf5cb('0x36')](_0xa52dec[_0xf5cb('0x35')]);_0x307245[_0xf5cb('0x37')]=_[_0xf5cb('0x38')](_0x307245[_0xf5cb('0x39')],_0x307245['query']);_0x287190[_0xf5cb('0x3a')]=_['intersection'](_0x307245[_0xf5cb('0x39')],qs[_0xf5cb('0x3b')](_0xa52dec[_0xf5cb('0x35')]['fields']));_0x287190[_0xf5cb('0x3a')]=_0x287190['attributes']['length']?_0x287190['attributes']:_0x307245[_0xf5cb('0x39')];if(!_0xa52dec[_0xf5cb('0x35')]['hasOwnProperty'](_0xf5cb('0x3c'))){_0x287190[_0xf5cb('0x25')]=qs[_0xf5cb('0x25')](_0xa52dec[_0xf5cb('0x35')][_0xf5cb('0x25')]);_0x287190[_0xf5cb('0x24')]=qs[_0xf5cb('0x24')](_0xa52dec[_0xf5cb('0x35')][_0xf5cb('0x24')]);}_0x287190[_0xf5cb('0x3d')]=qs[_0xf5cb('0x3e')](_0xa52dec['query'][_0xf5cb('0x3e')]);_0x287190[_0xf5cb('0x3f')]=qs[_0xf5cb('0x37')](_[_0xf5cb('0x40')](_0xa52dec['query'],_0x307245[_0xf5cb('0x37')]),_0x334349);if(_0xa52dec['query']['filter']){_0x287190[_0xf5cb('0x3f')]=_[_0xf5cb('0x41')](_0x287190['where'],{'$or':_['map'](_0x334349,function(_0x4ec69d){if(_0x4ec69d[_0xf5cb('0x33')]!==_0xf5cb('0x42')){var _0x419f68={};_0x419f68[_0x4ec69d[_0xf5cb('0x2f')]]={'$like':'%'+_0xa52dec['query'][_0xf5cb('0x43')]+'%'};return _0x419f68;}})});}_0x287190=_[_0xf5cb('0x41')]({},_0x287190,_0xa52dec[_0xf5cb('0x44')]);var _0x501f88={'where':_0x287190[_0xf5cb('0x3f')]};return db[_0xf5cb('0x32')][_0xf5cb('0x26')](_0x501f88)[_0xf5cb('0x2a')](function(_0x1aa259){_0x53c2c9['count']=_0x1aa259;if(_0xa52dec[_0xf5cb('0x35')]['includeAll']){_0x287190[_0xf5cb('0x45')]=[{'all':!![]}];}return db[_0xf5cb('0x32')][_0xf5cb('0x46')](_0x287190);})[_0xf5cb('0x2a')](function(_0x5d6637){_0x53c2c9[_0xf5cb('0x47')]=_0x5d6637;return _0x53c2c9;})[_0xf5cb('0x2a')](respondWithFilteredResult(_0x5203b9,_0x287190))[_0xf5cb('0x48')](handleError(_0x5203b9,null));};exports[_0xf5cb('0x49')]=function(_0x3c83f2,_0x151433){var _0x477fff={'raw':!![],'where':{'id':_0x3c83f2[_0xf5cb('0x4a')]['id']}},_0x1e3f99={};_0x1e3f99['model']=_['keys'](db['OpenchannelQueue'][_0xf5cb('0x4b')]);_0x1e3f99['query']=_[_0xf5cb('0x36')](_0x3c83f2[_0xf5cb('0x35')]);_0x1e3f99[_0xf5cb('0x37')]=_[_0xf5cb('0x38')](_0x1e3f99[_0xf5cb('0x39')],_0x1e3f99[_0xf5cb('0x35')]);_0x477fff[_0xf5cb('0x3a')]=_[_0xf5cb('0x38')](_0x1e3f99[_0xf5cb('0x39')],qs[_0xf5cb('0x3b')](_0x3c83f2[_0xf5cb('0x35')][_0xf5cb('0x3b')]));_0x477fff['attributes']=_0x477fff[_0xf5cb('0x3a')][_0xf5cb('0x4c')]?_0x477fff[_0xf5cb('0x3a')]:_0x1e3f99['model'];if(_0x3c83f2[_0xf5cb('0x35')][_0xf5cb('0x4d')]){_0x477fff[_0xf5cb('0x45')]=[{'all':!![]}];}_0x477fff=_[_0xf5cb('0x41')]({},_0x477fff,_0x3c83f2[_0xf5cb('0x44')]);return db[_0xf5cb('0x32')][_0xf5cb('0x4e')](_0x477fff)[_0xf5cb('0x2a')](handleEntityNotFound(_0x151433,null))['then'](respondWithResult(_0x151433,null))['catch'](handleError(_0x151433,null));};exports['create']=function(_0x3f548b,_0x3c9e60){return db[_0xf5cb('0x32')][_0xf5cb('0x4f')](_0x3f548b['body'],{})[_0xf5cb('0x2a')](function(_0x54f1b8){var _0x1cc11d=_0x3f548b['user'][_0xf5cb('0x50')]({'plain':!![]});if(!_0x1cc11d)throw new Error(_0xf5cb('0x51'));if(_0x1cc11d[_0xf5cb('0x52')]===_0xf5cb('0x53')){var _0x13cf49=_0x54f1b8[_0xf5cb('0x50')]({'plain':!![]});var _0x28db99=_0xf5cb('0x2c');return db['UserProfileSection'][_0xf5cb('0x4e')]({'where':{'name':_0x28db99,'userProfileId':_0x1cc11d['userProfileId']},'raw':!![]})[_0xf5cb('0x2a')](function(_0x48065d){if(_0x48065d&&_0x48065d[_0xf5cb('0x54')]===0x0){return db[_0xf5cb('0x2d')]['create']({'name':_0x13cf49['name'],'resourceId':_0x13cf49['id'],'type':_0x48065d[_0xf5cb('0x2f')],'sectionId':_0x48065d['id']},{})[_0xf5cb('0x2a')](function(){return _0x54f1b8;});}else{return _0x54f1b8;}})[_0xf5cb('0x48')](function(_0x376a08){logger[_0xf5cb('0x2e')](_0xf5cb('0x55'),_0x376a08);throw _0x376a08;});}return _0x54f1b8;})['then'](respondWithResult(_0x3c9e60,0xc9))['catch'](handleError(_0x3c9e60,null));};exports[_0xf5cb('0x56')]=function(_0x35c556,_0x52cfdc){if(_0x35c556[_0xf5cb('0x57')]['id']){delete _0x35c556[_0xf5cb('0x57')]['id'];}return db[_0xf5cb('0x32')][_0xf5cb('0x4e')]({'where':{'id':_0x35c556[_0xf5cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52cfdc,null))[_0xf5cb('0x2a')](saveUpdates(_0x35c556['body'],null))[_0xf5cb('0x2a')](respondWithResult(_0x52cfdc,null))[_0xf5cb('0x48')](handleError(_0x52cfdc,null));};exports[_0xf5cb('0x2b')]=function(_0x5c5ce4,_0x5aa268){return db[_0xf5cb('0x32')][_0xf5cb('0x4e')]({'where':{'id':_0x5c5ce4[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](handleEntityNotFound(_0x5aa268,null))['then'](removeEntity(_0x5aa268,null))[_0xf5cb('0x48')](handleError(_0x5aa268,null));};exports[_0xf5cb('0x58')]=function(_0x7ddfc6,_0x77feb7){return db['OpenchannelQueue'][_0xf5cb('0x58')]()[_0xf5cb('0x2a')](respondWithResult(_0x77feb7,null))[_0xf5cb('0x48')](handleError(_0x77feb7,null));};exports[_0xf5cb('0x59')]=function(_0x42cf5d,_0x530934,_0x2319f8){var _0x387ffe={'raw':!![],'where':{}},_0x3a8f1e={},_0x3d2aba;return db[_0xf5cb('0x32')][_0xf5cb('0x5a')]({'where':{'id':_0x42cf5d[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](handleEntityNotFound(_0x530934,null))[_0xf5cb('0x2a')](function(_0x454bf3){if(_0x454bf3){_0x3d2aba=_0x454bf3[_0xf5cb('0x50')]({'plain':!![]});_0x3a8f1e[_0xf5cb('0x39')]=_[_0xf5cb('0x36')](db[_0xf5cb('0x5b')][_0xf5cb('0x4b')]);_0x3a8f1e['query']=_['keys'](_0x42cf5d[_0xf5cb('0x35')]);_0x3a8f1e[_0xf5cb('0x37')]=_[_0xf5cb('0x38')](_0x3a8f1e['model'],_0x3a8f1e[_0xf5cb('0x35')]);_0x387ffe[_0xf5cb('0x3a')]=_[_0xf5cb('0x38')](_0x3a8f1e['model'],qs['fields'](_0x42cf5d[_0xf5cb('0x35')][_0xf5cb('0x3b')]));_0x387ffe[_0xf5cb('0x3a')]=_0x387ffe[_0xf5cb('0x3a')][_0xf5cb('0x4c')]?_0x387ffe[_0xf5cb('0x3a')]:_0x3a8f1e[_0xf5cb('0x39')];if(!_0x42cf5d[_0xf5cb('0x35')]['hasOwnProperty'](_0xf5cb('0x3c'))){_0x387ffe[_0xf5cb('0x25')]=qs[_0xf5cb('0x25')](_0x42cf5d[_0xf5cb('0x35')][_0xf5cb('0x25')]);_0x387ffe['offset']=qs['offset'](_0x42cf5d[_0xf5cb('0x35')][_0xf5cb('0x24')]);}_0x387ffe[_0xf5cb('0x3d')]=qs[_0xf5cb('0x3e')](_0x42cf5d['query'][_0xf5cb('0x3e')]);_0x387ffe[_0xf5cb('0x3f')]=qs[_0xf5cb('0x37')](_[_0xf5cb('0x40')](_0x42cf5d[_0xf5cb('0x35')],_0x3a8f1e['filters']));_0x387ffe[_0xf5cb('0x3f')]['OpenchannelQueueId']=_0x454bf3['id'];if(_0x42cf5d[_0xf5cb('0x35')]['filter']){_0x387ffe[_0xf5cb('0x3f')]=_[_0xf5cb('0x41')](_0x387ffe[_0xf5cb('0x3f')],{'$or':_[_0xf5cb('0x34')](_0x387ffe[_0xf5cb('0x3a')],function(_0xd4a8ee){var _0x2562d8={};_0x2562d8[_0xd4a8ee]={'$like':'%'+_0x42cf5d['query'][_0xf5cb('0x43')]+'%'};return _0x2562d8;})});}_0x387ffe=_['merge']({},_0x387ffe,_0x42cf5d['options']);return db[_0xf5cb('0x5b')][_0xf5cb('0x46')](_0x387ffe);}})[_0xf5cb('0x2a')](function(_0x2f33f6){if(_0x2f33f6){return db['User'][_0xf5cb('0x5c')]({'where':{'id':_[_0xf5cb('0x34')](_0x2f33f6,_0xf5cb('0x5d')),'role':_0xf5cb('0x5e')},'attributes':['id',_0xf5cb('0x2f'),_0xf5cb('0x5f'),_0xf5cb('0x60'),_0xf5cb('0x61')]});}})['then'](function(_0x279c6a){if(_0x279c6a){return{'count':_0x279c6a['count'],'rows':_[_0xf5cb('0x34')](_0x279c6a[_0xf5cb('0x47')],function(_0x5bcef6){return{'membername':_0x5bcef6[_0xf5cb('0x2f')],'UserId':_0x5bcef6['id'],'queue_name':_0x3d2aba[_0xf5cb('0x2f')],'OpenchannelQueueId':_0x3d2aba['id'],'interface':util[_0xf5cb('0x62')]('%s/%s',_0xf5cb('0x63'),_0x5bcef6['name']),'penalty':0x0,'paused':_0x5bcef6[_0xf5cb('0x5f')],'createdAt':_0x5bcef6[_0xf5cb('0x61')],'updatedAt':_0x5bcef6[_0xf5cb('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5cb('0x2a')](respondWithFilteredResult(_0x530934,_0x387ffe))[_0xf5cb('0x48')](handleError(_0x530934,null));};exports['getTeams']=function(_0x4797c5,_0x3ba539,_0x27623c){var _0x544615={};var _0x5b467f={};var _0x2adc96;var _0x499536;return db['OpenchannelQueue'][_0xf5cb('0x5a')]({'where':{'id':_0x4797c5['params']['id']}})['then'](handleEntityNotFound(_0x3ba539,null))[_0xf5cb('0x2a')](function(_0x4ac7e6){if(_0x4ac7e6){_0x2adc96=_0x4ac7e6;_0x5b467f[_0xf5cb('0x39')]=_['keys'](db[_0xf5cb('0x64')][_0xf5cb('0x4b')]);_0x5b467f[_0xf5cb('0x35')]=_[_0xf5cb('0x36')](_0x4797c5[_0xf5cb('0x35')]);_0x5b467f['filters']=_[_0xf5cb('0x38')](_0x5b467f[_0xf5cb('0x39')],_0x5b467f['query']);_0x544615[_0xf5cb('0x3a')]=_[_0xf5cb('0x38')](_0x5b467f['model'],qs['fields'](_0x4797c5[_0xf5cb('0x35')][_0xf5cb('0x3b')]));_0x544615[_0xf5cb('0x3a')]=_0x544615[_0xf5cb('0x3a')][_0xf5cb('0x4c')]?_0x544615['attributes']:_0x5b467f[_0xf5cb('0x39')];_0x544615[_0xf5cb('0x3d')]=qs[_0xf5cb('0x3e')](_0x4797c5['query'][_0xf5cb('0x3e')]);_0x544615[_0xf5cb('0x3f')]=qs['filters'](_[_0xf5cb('0x40')](_0x4797c5[_0xf5cb('0x35')],_0x5b467f[_0xf5cb('0x37')]));if(_0x4797c5[_0xf5cb('0x35')]['filter']){_0x544615[_0xf5cb('0x3f')]=_[_0xf5cb('0x41')](_0x544615[_0xf5cb('0x3f')],{'$or':_['map'](_0x544615[_0xf5cb('0x3a')],function(_0x3a2bec){var _0x190f2c={};_0x190f2c[_0x3a2bec]={'$like':'%'+_0x4797c5[_0xf5cb('0x35')]['filter']+'%'};return _0x190f2c;})});}_0x544615=_[_0xf5cb('0x41')]({},_0x544615,_0x4797c5[_0xf5cb('0x44')]);return _0x2adc96[_0xf5cb('0x65')](_0x544615);}})[_0xf5cb('0x2a')](function(_0x5e07d9){if(_0x5e07d9){_0x499536=_0x5e07d9[_0xf5cb('0x4c')];if(!_0x4797c5[_0xf5cb('0x35')][_0xf5cb('0x66')](_0xf5cb('0x3c'))){_0x544615[_0xf5cb('0x25')]=qs['limit'](_0x4797c5[_0xf5cb('0x35')][_0xf5cb('0x25')]);_0x544615[_0xf5cb('0x24')]=qs[_0xf5cb('0x24')](_0x4797c5['query'][_0xf5cb('0x24')]);}return _0x2adc96[_0xf5cb('0x65')](_0x544615);}})[_0xf5cb('0x2a')](function(_0x241621){if(_0x241621){return _0x241621?{'count':_0x499536,'rows':_0x241621}:null;}})['then'](respondWithResult(_0x3ba539,null))[_0xf5cb('0x48')](handleError(_0x3ba539,null));};exports[_0xf5cb('0x67')]=function(_0x4a91aa,_0x15398c,_0x1b9e03){var _0x167f70=_0x4a91aa[_0xf5cb('0x57')][_0xf5cb('0x68')];return db[_0xf5cb('0x64')][_0xf5cb('0x46')]({'where':{'id':_0x167f70},'attributes':['id'],'include':[{'model':db[_0xf5cb('0x69')],'as':_0xf5cb('0x6a'),'attributes':['id','name',_0xf5cb('0x6b'),'voicePause',_0xf5cb('0x6c')],'raw':!![]}]})[_0xf5cb('0x2a')](function(_0xf5e34c){if(_0xf5e34c){var _0x4b81f1=_[_0xf5cb('0x6d')](_0xf5e34c,function(_0x3752aa){var _0x13bcd8=_0x3752aa['get']({'plain':!![]});return _0x13bcd8[_0xf5cb('0x6a')];});return db[_0xf5cb('0x32')]['find']({'where':{'id':_0x4a91aa[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](function(_0x11f0d9){return db[_0xf5cb('0x6e')][_0xf5cb('0x6f')](function(_0x50cbaf){return _0x11f0d9[_0xf5cb('0x67')](_0x167f70,{'transaction':_0x50cbaf})[_0xf5cb('0x2a')](function(){return BPromise[_0xf5cb('0x70')](_0x4b81f1,function(_0x5d1dce){return db[_0xf5cb('0x5b')][_0xf5cb('0x71')]({'where':{'UserId':_0x5d1dce['id'],'OpenchannelQueueId':_0x4a91aa[_0xf5cb('0x4a')]['id']},'transaction':_0x50cbaf});});})[_0xf5cb('0x2a')](function(){_0x4b81f1[_0xf5cb('0x72')](function(_0x2e0c8e){socket['emit'](_0xf5cb('0x73'),{'UserId':_0x2e0c8e['id'],'OpenchannelQueueId':_0x11f0d9['id']});});});});});}})[_0xf5cb('0x2a')](respondWithStatusCode(_0x15398c,null))[_0xf5cb('0x48')](handleError(_0x15398c,null));};exports[_0xf5cb('0x74')]=function(_0x1b11dd,_0x417d23,_0x243b1a){return db[_0xf5cb('0x64')][_0xf5cb('0x46')]({'where':{'id':_0x1b11dd['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xf5cb('0x69')],'as':_0xf5cb('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf5cb('0x2a')](handleEntityNotFound(_0x417d23,null))[_0xf5cb('0x2a')](function(_0x2c1fb9){var _0x5af497=_['map'](_0x2c1fb9,'id');var _0x27aa76=[];var _0xb6da91=[];var _0x1171b4=squel[_0xf5cb('0x75')]();_0x1171b4['field']('tq.TeamId')[_0xf5cb('0x76')](_0xf5cb('0x77'),'tq')[_0xf5cb('0x78')](_0xf5cb('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5cb('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x1b11dd['params']['id']);for(var _0x1bbcaf=0x0;_0x1bbcaf<_0x2c1fb9[_0xf5cb('0x4c')];_0x1bbcaf+=0x1){let _0x421ff8=_0x2c1fb9[_0x1bbcaf];for(var _0x2be506=0x0;_0x2be506<_0x421ff8[_0xf5cb('0x6a')]['length'];_0x2be506+=0x1){let _0x1c6162=_0x421ff8['Agents'][_0x2be506];var _0x27dc95=_0x1171b4[_0xf5cb('0x7a')]();_0x27dc95[_0xf5cb('0x3f')](_0xf5cb('0x7b'),_0x1c6162['id']);_0xb6da91[_0xf5cb('0x7c')](db[_0xf5cb('0x6e')][_0xf5cb('0x35')](_0x27dc95['toString'](),{'type':db['sequelize'][_0xf5cb('0x7d')][_0xf5cb('0x7e')]})[_0xf5cb('0x2a')](function(_0x130a8b){if(_0x130a8b[_0xf5cb('0x4c')]===0x1){return _0x1c6162['id'];}else{var _0x3f205b=_[_0xf5cb('0x7f')](_[_0xf5cb('0x34')](_0x130a8b,_0xf5cb('0x80')),function(_0x232650){return _[_0xf5cb('0x81')](_0x5af497,_0x232650);});if(_0x3f205b){return _0x1c6162['id'];}}}));}}return BPromise['all'](_0xb6da91)[_0xf5cb('0x2a')](function(_0x4f3cc4){_0x27aa76=_(_0x27aa76)[_0xf5cb('0x82')](_0x4f3cc4)[_0xf5cb('0x83')]()[_0xf5cb('0x84')]();return db[_0xf5cb('0x32')][_0xf5cb('0x4e')]({'where':{'id':_0x1b11dd['params']['id']}})[_0xf5cb('0x2a')](function(_0x469a39){return db[_0xf5cb('0x6e')][_0xf5cb('0x6f')](function(_0xb141b){return _0x469a39[_0xf5cb('0x74')](_0x1b11dd[_0xf5cb('0x35')][_0xf5cb('0x68')],{'transaction':_0xb141b})['then'](function(){if(!_[_0xf5cb('0x85')](_0x27aa76)){return _0x469a39[_0xf5cb('0x86')](_0x27aa76,{'transaction':_0xb141b});}})[_0xf5cb('0x2a')](function(){_0x27aa76[_0xf5cb('0x72')](function(_0x12bdfe){socket[_0xf5cb('0x87')](_0xf5cb('0x88'),{'UserId':_0x12bdfe,'OpenchannelQueueId':_0x469a39['id']});});});});});});})[_0xf5cb('0x2a')](respondWithStatusCode(_0x417d23,null))[_0xf5cb('0x48')](handleError(_0x417d23,null));};exports['addAgents']=function(_0x5d1732,_0x4e9050,_0x42b77c){return db[_0xf5cb('0x32')][_0xf5cb('0x4e')]({'where':{'id':_0x5d1732[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](handleEntityNotFound(_0x4e9050,null))[_0xf5cb('0x2a')](function(_0x5ecc7d){if(_0x5ecc7d){return _0x5ecc7d[_0xf5cb('0x89')](_0x5d1732[_0xf5cb('0x57')][_0xf5cb('0x68')],_['omit'](_0x5d1732[_0xf5cb('0x57')],[_0xf5cb('0x68'),'id'])||{})[_0xf5cb('0x8a')](function(_0x41326b){for(var _0xcf0035=0x0;_0xcf0035<_0x5d1732[_0xf5cb('0x57')][_0xf5cb('0x68')][_0xf5cb('0x4c')];_0xcf0035+=0x1){socket[_0xf5cb('0x87')](_0xf5cb('0x73'),{'UserId':Number(_0x5d1732['body'][_0xf5cb('0x68')][_0xcf0035]),'OpenchannelQueueId':Number(_0x5d1732[_0xf5cb('0x4a')]['id'])});}return _0x41326b;});}})[_0xf5cb('0x2a')](respondWithResult(_0x4e9050,null))[_0xf5cb('0x48')](handleError(_0x4e9050,null));};exports[_0xf5cb('0x86')]=function(_0x5d6d71,_0xce7652,_0x1822cf){return db[_0xf5cb('0x32')][_0xf5cb('0x4e')]({'where':{'id':_0x5d6d71[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](handleEntityNotFound(_0xce7652,null))[_0xf5cb('0x2a')](function(_0x28b17b){if(_0x28b17b){return _0x28b17b[_0xf5cb('0x86')](_0x5d6d71['query'][_0xf5cb('0x68')])[_0xf5cb('0x2a')](function(){if(_[_0xf5cb('0x8b')](_0x5d6d71['query'][_0xf5cb('0x68')])){for(var _0x47b9a9=0x0;_0x47b9a9<_0x5d6d71['query'][_0xf5cb('0x68')]['length'];_0x47b9a9+=0x1){socket[_0xf5cb('0x87')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5d6d71[_0xf5cb('0x35')][_0xf5cb('0x68')][_0x47b9a9]),'OpenchannelQueueId':Number(_0x5d6d71['params']['id'])});}}else{socket[_0xf5cb('0x87')](_0xf5cb('0x88'),{'UserId':Number(_0x5d6d71[_0xf5cb('0x35')]['ids']),'OpenchannelQueueId':Number(_0x5d6d71[_0xf5cb('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0xce7652,null))[_0xf5cb('0x48')](handleError(_0xce7652,null));};exports['getAgents']=function(_0x19208e,_0x1347cf,_0x34ae82){var _0x2855be={};var _0x277e36={};var _0x38ace2;var _0x5be04b;return db[_0xf5cb('0x32')][_0xf5cb('0x5a')]({'where':{'id':_0x19208e[_0xf5cb('0x4a')]['id']}})[_0xf5cb('0x2a')](handleEntityNotFound(_0x1347cf,null))[_0xf5cb('0x2a')](function(_0x4cd243){if(_0x4cd243){_0x38ace2=_0x4cd243;_0x277e36[_0xf5cb('0x39')]=_[_0xf5cb('0x36')](db[_0xf5cb('0x69')][_0xf5cb('0x4b')]);_0x277e36['query']=_[_0xf5cb('0x36')](_0x19208e[_0xf5cb('0x35')]);_0x277e36[_0xf5cb('0x37')]=_[_0xf5cb('0x38')](_0x277e36['model'],_0x277e36['query']);_0x2855be[_0xf5cb('0x3a')]=_[_0xf5cb('0x38')](_0x277e36[_0xf5cb('0x39')],qs[_0xf5cb('0x3b')](_0x19208e[_0xf5cb('0x35')]['fields']));_0x2855be[_0xf5cb('0x3a')]=_0x2855be[_0xf5cb('0x3a')][_0xf5cb('0x4c')]?_0x2855be['attributes']:_0x277e36[_0xf5cb('0x39')];_0x2855be['order']=qs[_0xf5cb('0x3e')](_0x19208e[_0xf5cb('0x35')]['sort']);_0x2855be[_0xf5cb('0x3f')]=qs[_0xf5cb('0x37')](_[_0xf5cb('0x40')](_0x19208e[_0xf5cb('0x35')],_0x277e36[_0xf5cb('0x37')]));if(_0x19208e['query']['filter']){_0x2855be[_0xf5cb('0x3f')]=_[_0xf5cb('0x41')](_0x2855be[_0xf5cb('0x3f')],{'$or':_[_0xf5cb('0x34')](_0x2855be[_0xf5cb('0x3a')],function(_0x2973d0){var _0x5292f4={};_0x5292f4[_0x2973d0]={'$like':'%'+_0x19208e[_0xf5cb('0x35')]['filter']+'%'};return _0x5292f4;})});}_0x2855be=_['merge']({},_0x2855be,_0x19208e[_0xf5cb('0x44')]);return _0x38ace2[_0xf5cb('0x8c')](_0x2855be);}})[_0xf5cb('0x2a')](function(_0x507b1c){if(_0x507b1c){_0x5be04b=_0x507b1c[_0xf5cb('0x4c')];if(!_0x19208e[_0xf5cb('0x35')][_0xf5cb('0x66')](_0xf5cb('0x3c'))){_0x2855be[_0xf5cb('0x25')]=qs[_0xf5cb('0x25')](_0x19208e[_0xf5cb('0x35')]['limit']);_0x2855be[_0xf5cb('0x24')]=qs[_0xf5cb('0x24')](_0x19208e['query'][_0xf5cb('0x24')]);}return _0x38ace2['getAgents'](_0x2855be);}})['then'](function(_0x439991){if(_0x439991){return _0x439991?{'count':_0x5be04b,'rows':_0x439991}:null;}})[_0xf5cb('0x2a')](respondWithResult(_0x1347cf,null))['catch'](handleError(_0x1347cf,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b90ea55..2370de6 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 _0x2079=['hook','exports','../../mysqldb','OpenchannelQueue','save','remove','emit','hasOwnProperty'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x2079,0x92));var _0x9207=function(_0x441954,_0xfca410){_0x441954=_0x441954-0x0;var _0x43e739=_0x2079[_0x441954];return _0x43e739;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9207('0x0'))['db'][_0x9207('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9207('0x2'),'afterUpdate':'update','afterDestroy':_0x9207('0x3')};function emitEvent(_0x4d3f53){return function(_0x5cbbbd,_0x4dc939,_0x18d127){OpenchannelQueueEvents[_0x9207('0x4')](_0x4d3f53+':'+_0x5cbbbd['id'],_0x5cbbbd);OpenchannelQueueEvents[_0x9207('0x4')](_0x4d3f53,_0x5cbbbd);_0x18d127(null);};}for(var e in events){if(events[_0x9207('0x5')](e)){var event=events[e];OpenchannelQueue[_0x9207('0x6')](e,emitEvent(event));}}module[_0x9207('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x725b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x585634,_0x1cfd45){var _0x57afa0=function(_0x6a755b){while(--_0x6a755b){_0x585634['push'](_0x585634['shift']());}};_0x57afa0(++_0x1cfd45);}(_0x725b,0x19b));var _0xb725=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0x725b[_0x5a452e];return _0x2c4c43;};'use strict';var EventEmitter=require(_0xb725('0x0'));var OpenchannelQueue=require(_0xb725('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb725('0x2'),'afterDestroy':'remove'};function emitEvent(_0xeb1a3b){return function(_0x703792,_0x27e36e,_0x190791){OpenchannelQueueEvents['emit'](_0xeb1a3b+':'+_0x703792['id'],_0x703792);OpenchannelQueueEvents[_0xb725('0x3')](_0xeb1a3b,_0x703792);_0x190791(null);};}for(var e in events){if(events[_0xb725('0x4')](e)){var event=events[e];OpenchannelQueue[_0xb725('0x5')](e,emitEvent(event));}}module[_0xb725('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 dd07021..4e0b1ad 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 _0x7caf=['request-promise','path','rimraf','../../config/environment','OpenchannelQueue','util','../../config/logger','moment','bluebird'];(function(_0x26b86b,_0x496d90){var _0x499ad1=function(_0x222ebe){while(--_0x222ebe){_0x26b86b['push'](_0x26b86b['shift']());}};_0x499ad1(++_0x496d90);}(_0x7caf,0x10a));var _0xf7ca=function(_0x572ce1,_0xa27ca4){_0x572ce1=_0x572ce1-0x0;var _0x57e794=_0x7caf[_0x572ce1];return _0x57e794;};'use strict';var _=require('lodash');var util=require(_0xf7ca('0x0'));var logger=require(_0xf7ca('0x1'))('api');var moment=require(_0xf7ca('0x2'));var BPromise=require(_0xf7ca('0x3'));var rp=require(_0xf7ca('0x4'));var fs=require('fs');var path=require(_0xf7ca('0x5'));var rimraf=require(_0xf7ca('0x6'));var config=require(_0xf7ca('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x37974c,_0x36d769){return _0x37974c['define'](_0xf7ca('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b9=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x2188e2,_0xfdd768){var _0x43393a=function(_0x2a50c5){while(--_0x2a50c5){_0x2188e2['push'](_0x2188e2['shift']());}};_0x43393a(++_0xfdd768);}(_0xc9b9,0x1ce));var _0x9c9b=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xc9b9[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x9c9b('0x0'));var util=require(_0x9c9b('0x1'));var logger=require(_0x9c9b('0x2'))(_0x9c9b('0x3'));var moment=require('moment');var BPromise=require(_0x9c9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c9b('0x5'));var rimraf=require(_0x9c9b('0x6'));var config=require(_0x9c9b('0x7'));var attributes=require(_0x9c9b('0x8'));module[_0x9c9b('0x9')]=function(_0x5824b0,_0x2414bd){return _0x5824b0['define'](_0x9c9b('0xa'),attributes,{'tableName':_0x9c9b('0xb'),'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 fcf5a27..850b947 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 _0xe413=['localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetOpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','info','catch','find','ShowOpenchannelQueue','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x409f3a,_0x1840be){var _0xd376d2=function(_0x1c64b2){while(--_0x1c64b2){_0x409f3a['push'](_0x409f3a['shift']());}};_0xd376d2(++_0x1840be);}(_0xe413,0x1d6));var _0x3e41=function(_0x1d3824,_0x5a85da){_0x1d3824=_0x1d3824-0x0;var _0x218c7e=_0xe413[_0x1d3824];return _0x218c7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3e41('0x0'));var BPromise=require(_0x3e41('0x1'));var rs=require(_0x3e41('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e41('0x3'));var logger=require(_0x3e41('0x4'))(_0x3e41('0x5'));var config=require(_0x3e41('0x6'));var jayson=require(_0x3e41('0x7'));var client=jayson[_0x3e41('0x8')][_0x3e41('0x9')]({'port':0x232a});config[_0x3e41('0xa')]=_['defaults'](config[_0x3e41('0xa')],{'host':_0x3e41('0xb'),'port':0x18eb});var socket=require(_0x3e41('0xc'))(new Redis(config[_0x3e41('0xa')]));require(_0x3e41('0xd'))['register'](socket);function respondWithRpcPromise(_0x2bf274,_0x4e7703,_0x207714){return new BPromise(function(_0x4cbf9d,_0xbf00dd){return client[_0x3e41('0xe')](_0x2bf274,_0x207714)[_0x3e41('0xf')](function(_0xc2f5ea){logger['info'](_0x3e41('0x10'),_0x4e7703,_0x3e41('0x11'));logger[_0x3e41('0x12')](_0x3e41('0x13'),_0x4e7703,_0x3e41('0x11'),JSON[_0x3e41('0x14')](_0xc2f5ea));if(_0xc2f5ea['error']){if(_0xc2f5ea['error'][_0x3e41('0x15')]===0x1f4){logger['error'](_0x3e41('0x10'),_0x4e7703,_0xc2f5ea[_0x3e41('0x16')][_0x3e41('0x17')]);return _0xbf00dd(_0xc2f5ea['error']['message']);}logger[_0x3e41('0x16')](_0x3e41('0x10'),_0x4e7703,_0xc2f5ea['error'][_0x3e41('0x17')]);return _0x4cbf9d(_0xc2f5ea[_0x3e41('0x16')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4e7703,_0x3e41('0x11'));_0x4cbf9d(_0xc2f5ea['result'][_0x3e41('0x17')]);}})['catch'](function(_0x4cd91a){logger[_0x3e41('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4e7703,_0x4cd91a);_0xbf00dd(_0x4cd91a);});});}exports[_0x3e41('0x18')]=function(_0x2899c6){var _0x2acfcc=this;return new Promise(function(_0x272449,_0x1107d1){return db['OpenchannelQueue'][_0x3e41('0x19')]({'raw':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1b')]===undefined?!![]:![]:!![],'where':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6['options'][_0x3e41('0x1c')]||null:null,'attributes':_0x2899c6['options']?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1d')]||null:null,'limit':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')]['limit']||null:null,'include':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1e')],function(_0x5333d6){return{'model':db[_0x5333d6[_0x3e41('0x20')]],'as':_0x5333d6['as'],'attributes':_0x5333d6[_0x3e41('0x1d')],'include':_0x5333d6['include']?_[_0x3e41('0x1f')](_0x5333d6[_0x3e41('0x1e')],function(_0x39f864){return{'model':db[_0x39f864[_0x3e41('0x20')]],'as':_0x39f864['as'],'attributes':_0x39f864[_0x3e41('0x1d')],'include':_0x39f864[_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x39f864[_0x3e41('0x1e')],function(_0x4cd227){return{'model':db[_0x4cd227[_0x3e41('0x20')]],'as':_0x4cd227['as'],'attributes':_0x4cd227[_0x3e41('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e41('0xf')](function(_0x4c44b8){logger[_0x3e41('0x21')]('GetOpenchannelQueue',_0x2899c6);logger[_0x3e41('0x12')](_0x3e41('0x18'),_0x2899c6,JSON['stringify'](_0x4c44b8));_0x272449(_0x4c44b8);})[_0x3e41('0x22')](function(_0x22d7f3){logger[_0x3e41('0x16')](_0x3e41('0x18'),_0x22d7f3[_0x3e41('0x17')],_0x2899c6);_0x1107d1(_0x2acfcc[_0x3e41('0x16')](0x1f4,_0x22d7f3[_0x3e41('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x258624){var _0x33c7f4=this;return new Promise(function(_0x5fb149,_0x54aace){return db['OpenchannelQueue'][_0x3e41('0x23')]({'raw':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1c')]||null:null,'attributes':_0x258624['options']?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1d')]||null:null,'include':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x258624['options'][_0x3e41('0x1e')],function(_0x2c01ba){return{'model':db[_0x2c01ba[_0x3e41('0x20')]],'as':_0x2c01ba['as'],'attributes':_0x2c01ba[_0x3e41('0x1d')],'include':_0x2c01ba[_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x2c01ba['include'],function(_0x26c2c9){return{'model':db[_0x26c2c9[_0x3e41('0x20')]],'as':_0x26c2c9['as'],'attributes':_0x26c2c9['attributes'],'include':_0x26c2c9[_0x3e41('0x1e')]?_['map'](_0x26c2c9[_0x3e41('0x1e')],function(_0xf7279f){return{'model':db[_0xf7279f[_0x3e41('0x20')]],'as':_0xf7279f['as'],'attributes':_0xf7279f[_0x3e41('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e41('0xf')](function(_0x2f3837){logger[_0x3e41('0x21')](_0x3e41('0x24'),_0x258624);logger['debug']('ShowOpenchannelQueue',_0x258624,JSON[_0x3e41('0x14')](_0x2f3837));_0x5fb149(_0x2f3837);})[_0x3e41('0x22')](function(_0x28573f){logger[_0x3e41('0x16')](_0x3e41('0x24'),_0x28573f[_0x3e41('0x17')],_0x258624);_0x54aace(_0x33c7f4[_0x3e41('0x16')](0x1f4,_0x28573f[_0x3e41('0x17')]));});});}; \ No newline at end of file +var _0x800e=['register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelQueue','options','where','attributes','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0x800e,0x101));var _0xe800=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x800e[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xe800('0x0'));var util=require(_0xe800('0x1'));var moment=require(_0xe800('0x2'));var BPromise=require(_0xe800('0x3'));var rs=require(_0xe800('0x4'));var fs=require('fs');var Redis=require(_0xe800('0x5'));var db=require(_0xe800('0x6'))['db'];var utils=require(_0xe800('0x7'));var logger=require('../../config/logger')(_0xe800('0x8'));var config=require(_0xe800('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe800('0xa')][_0xe800('0xb')]({'port':0x232a});config[_0xe800('0xc')]=_[_0xe800('0xd')](config[_0xe800('0xc')],{'host':_0xe800('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe800('0xc')]));require(_0xe800('0xf'))[_0xe800('0x10')](socket);function respondWithRpcPromise(_0x3ce688,_0x15fa85,_0x2c6441){return new BPromise(function(_0x52c373,_0x9f210f){return client[_0xe800('0x11')](_0x3ce688,_0x2c6441)[_0xe800('0x12')](function(_0x1f1aee){logger[_0xe800('0x13')](_0xe800('0x14'),_0x15fa85,'request\x20sent');logger[_0xe800('0x15')](_0xe800('0x16'),_0x15fa85,_0xe800('0x17'),JSON[_0xe800('0x18')](_0x1f1aee));if(_0x1f1aee[_0xe800('0x19')]){if(_0x1f1aee[_0xe800('0x19')][_0xe800('0x1a')]===0x1f4){logger[_0xe800('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x15fa85,_0x1f1aee[_0xe800('0x19')][_0xe800('0x1b')]);return _0x9f210f(_0x1f1aee[_0xe800('0x19')][_0xe800('0x1b')]);}logger[_0xe800('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x15fa85,_0x1f1aee[_0xe800('0x19')][_0xe800('0x1b')]);return _0x52c373(_0x1f1aee[_0xe800('0x19')][_0xe800('0x1b')]);}else{logger[_0xe800('0x13')](_0xe800('0x14'),_0x15fa85,_0xe800('0x17'));_0x52c373(_0x1f1aee[_0xe800('0x1c')][_0xe800('0x1b')]);}})[_0xe800('0x1d')](function(_0x7c12d0){logger[_0xe800('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x15fa85,_0x7c12d0);_0x9f210f(_0x7c12d0);});});}exports['GetOpenchannelQueue']=function(_0x17f6f0){var _0x1cc046=this;return new Promise(function(_0xe9d186,_0x58186a){return db[_0xe800('0x1e')]['findAll']({'raw':_0x17f6f0[_0xe800('0x1f')]?_0x17f6f0[_0xe800('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x17f6f0[_0xe800('0x1f')]?_0x17f6f0[_0xe800('0x1f')][_0xe800('0x20')]||null:null,'attributes':_0x17f6f0[_0xe800('0x1f')]?_0x17f6f0[_0xe800('0x1f')][_0xe800('0x21')]||null:null,'limit':_0x17f6f0[_0xe800('0x1f')]?_0x17f6f0[_0xe800('0x1f')]['limit']||null:null,'include':_0x17f6f0['options']?_0x17f6f0[_0xe800('0x1f')][_0xe800('0x22')]?_[_0xe800('0x23')](_0x17f6f0['options'][_0xe800('0x22')],function(_0xb821bc){return{'model':db[_0xb821bc[_0xe800('0x24')]],'as':_0xb821bc['as'],'attributes':_0xb821bc[_0xe800('0x21')],'include':_0xb821bc[_0xe800('0x22')]?_[_0xe800('0x23')](_0xb821bc[_0xe800('0x22')],function(_0x1a0abd){return{'model':db[_0x1a0abd[_0xe800('0x24')]],'as':_0x1a0abd['as'],'attributes':_0x1a0abd[_0xe800('0x21')],'include':_0x1a0abd['include']?_['map'](_0x1a0abd[_0xe800('0x22')],function(_0x12e9b2){return{'model':db[_0x12e9b2[_0xe800('0x24')]],'as':_0x12e9b2['as'],'attributes':_0x12e9b2['attributes']};}):[]};}):[]};}):[]:[]})[_0xe800('0x12')](function(_0x102873){logger[_0xe800('0x13')]('GetOpenchannelQueue',_0x17f6f0);logger[_0xe800('0x15')](_0xe800('0x25'),_0x17f6f0,JSON[_0xe800('0x18')](_0x102873));_0xe9d186(_0x102873);})[_0xe800('0x1d')](function(_0x39c043){logger[_0xe800('0x19')]('GetOpenchannelQueue',_0x39c043[_0xe800('0x1b')],_0x17f6f0);_0x58186a(_0x1cc046['error'](0x1f4,_0x39c043[_0xe800('0x1b')]));});});};exports[_0xe800('0x26')]=function(_0x37b946){var _0x2e77f9=this;return new Promise(function(_0x5b82f8,_0x2e6df8){return db[_0xe800('0x1e')]['find']({'raw':_0x37b946['options']?_0x37b946['options']['raw']===undefined?!![]:![]:!![],'where':_0x37b946[_0xe800('0x1f')]?_0x37b946[_0xe800('0x1f')]['where']||null:null,'attributes':_0x37b946['options']?_0x37b946[_0xe800('0x1f')][_0xe800('0x21')]||null:null,'include':_0x37b946[_0xe800('0x1f')]?_0x37b946[_0xe800('0x1f')][_0xe800('0x22')]?_['map'](_0x37b946['options'][_0xe800('0x22')],function(_0x18014a){return{'model':db[_0x18014a[_0xe800('0x24')]],'as':_0x18014a['as'],'attributes':_0x18014a['attributes'],'include':_0x18014a[_0xe800('0x22')]?_[_0xe800('0x23')](_0x18014a[_0xe800('0x22')],function(_0x1654b8){return{'model':db[_0x1654b8['model']],'as':_0x1654b8['as'],'attributes':_0x1654b8[_0xe800('0x21')],'include':_0x1654b8[_0xe800('0x22')]?_['map'](_0x1654b8['include'],function(_0x4b7acb){return{'model':db[_0x4b7acb['model']],'as':_0x4b7acb['as'],'attributes':_0x4b7acb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d5fe2){logger[_0xe800('0x13')](_0xe800('0x26'),_0x37b946);logger['debug']('ShowOpenchannelQueue',_0x37b946,JSON[_0xe800('0x18')](_0x5d5fe2));_0x5b82f8(_0x5d5fe2);})[_0xe800('0x1d')](function(_0xd90744){logger['error']('ShowOpenchannelQueue',_0xd90744[_0xe800('0x1b')],_0x37b946);_0x2e6df8(_0x2e77f9[_0xe800('0x19')](0x1f4,_0xd90744[_0xe800('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7bdf2b4..488cf36 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 _0x8a5f=['emit','length','openchannelQueue:','save','remove','update'];(function(_0x45a325,_0x2ab2a8){var _0x8c6379=function(_0x461b76){while(--_0x461b76){_0x45a325['push'](_0x45a325['shift']());}};_0x8c6379(++_0x2ab2a8);}(_0x8a5f,0x1ef));var _0xf8a5=function(_0x39fe47,_0x58e103){_0x39fe47=_0x39fe47-0x0;var _0x1f236e=_0x8a5f[_0x39fe47];return _0x1f236e;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xf8a5('0x0'),_0xf8a5('0x1'),_0xf8a5('0x2')];function createListener(_0x4ec746,_0x9dddda){return function(_0x14070b){_0x9dddda[_0xf8a5('0x3')](_0x4ec746,_0x14070b);};}function removeListener(_0x357a6a,_0x5cedf4){return function(){OpenchannelQueueEvents['removeListener'](_0x357a6a,_0x5cedf4);};}exports['register']=function(_0x252555){for(var _0x57b329=0x0,_0x2e3923=events[_0xf8a5('0x4')];_0x57b329<_0x2e3923;_0x57b329++){var _0x1e78b3=events[_0x57b329];var _0xdb44a3=createListener(_0xf8a5('0x5')+_0x1e78b3,_0x252555);OpenchannelQueueEvents['on'](_0x1e78b3,_0xdb44a3);}}; \ No newline at end of file +var _0x25cf=['emit','removeListener','register','openchannelQueue:'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x25cf,0x138));var _0xf25c=function(_0x5cb977,_0x13c79c){_0x5cb977=_0x5cb977-0x0;var _0x40c203=_0x25cf[_0x5cb977];return _0x40c203;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove','update'];function createListener(_0x4781d6,_0x36b972){return function(_0x5be5a3){_0x36b972[_0xf25c('0x0')](_0x4781d6,_0x5be5a3);};}function removeListener(_0x50c312,_0x1252e6){return function(){OpenchannelQueueEvents[_0xf25c('0x1')](_0x50c312,_0x1252e6);};}exports[_0xf25c('0x2')]=function(_0x339b11){for(var _0x26e604=0x0,_0x46f2a2=events['length'];_0x26e604<_0x46f2a2;_0x26e604++){var _0x88438e=events[_0x26e604];var _0x5ba877=createListener(_0xf25c('0x3')+_0x88438e,_0x339b11);OpenchannelQueueEvents['on'](_0x88438e,_0x5ba877);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index e7ea6b6..4f05e1a 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 _0xff73=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','update','delete'];(function(_0x2fc1f6,_0x51543e){var _0x7a3346=function(_0x589b08){while(--_0x589b08){_0x2fc1f6['push'](_0x2fc1f6['shift']());}};_0x7a3346(++_0x51543e);}(_0xff73,0x127));var _0x3ff7=function(_0x39df6e,_0x548a5a){_0x39df6e=_0x39df6e-0x0;var _0xcbceb6=_0xff73[_0x39df6e];return _0xcbceb6;};'use strict';var multer=require(_0x3ff7('0x0'));var util=require(_0x3ff7('0x1'));var path=require(_0x3ff7('0x2'));var timeout=require(_0x3ff7('0x3'));var express=require(_0x3ff7('0x4'));var router=express[_0x3ff7('0x5')]();var fs_extra=require(_0x3ff7('0x6'));var auth=require(_0x3ff7('0x7'));var interaction=require(_0x3ff7('0x8'));var config=require(_0x3ff7('0x9'));var controller=require('./openchannelQueueReport.controller');router[_0x3ff7('0xa')]('/',auth['isAuthenticated'](),controller[_0x3ff7('0xb')]);router[_0x3ff7('0xa')](_0x3ff7('0xc'),auth[_0x3ff7('0xd')](),controller[_0x3ff7('0xe')]);router['get'](_0x3ff7('0xf'),auth[_0x3ff7('0xd')](),controller['show']);router[_0x3ff7('0x10')]('/',auth[_0x3ff7('0xd')](),controller[_0x3ff7('0x11')]);router['put'](_0x3ff7('0xf'),auth[_0x3ff7('0xd')](),controller[_0x3ff7('0x12')]);router[_0x3ff7('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3ff7('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf16c=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf16c,0x154));var _0xcf16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf16c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xcf16('0x0'));var util=require('util');var path=require(_0xcf16('0x1'));var timeout=require(_0xcf16('0x2'));var express=require(_0xcf16('0x3'));var router=express[_0xcf16('0x4')]();var fs_extra=require(_0xcf16('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcf16('0x6'));var config=require(_0xcf16('0x7'));var controller=require(_0xcf16('0x8'));router[_0xcf16('0x9')]('/',auth[_0xcf16('0xa')](),controller['index']);router[_0xcf16('0x9')](_0xcf16('0xb'),auth[_0xcf16('0xa')](),controller[_0xcf16('0xc')]);router[_0xcf16('0x9')](_0xcf16('0xd'),auth[_0xcf16('0xa')](),controller[_0xcf16('0xe')]);router[_0xcf16('0xf')]('/',auth[_0xcf16('0xa')](),controller['create']);router[_0xcf16('0x10')](_0xcf16('0xd'),auth['isAuthenticated'](),controller[_0xcf16('0x11')]);router[_0xcf16('0x12')](_0xcf16('0xd'),auth['isAuthenticated'](),controller[_0xcf16('0x13')]);module[_0xcf16('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 66d45d6..84fbe56 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 _0x8743=['exports','STRING','DATE','moment','sequelize'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x8743,0xa3));var _0x3874=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8743[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0x3874('0x0'));var Sequelize=require(_0x3874('0x1'));module[_0x3874('0x2')]={'uniqueid':{'type':Sequelize[_0x3874('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3874('0x3')]},'joinAt':{'type':Sequelize[_0x3874('0x4')]},'leaveAt':{'type':Sequelize[_0x3874('0x4')]},'acceptAt':{'type':Sequelize[_0x3874('0x4')]},'exitAt':{'type':Sequelize[_0x3874('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2c37=['DATE','sequelize','STRING'];(function(_0x3492c5,_0x268e94){var _0x349a38=function(_0x5e9644){while(--_0x5e9644){_0x3492c5['push'](_0x3492c5['shift']());}};_0x349a38(++_0x268e94);}(_0x2c37,0x175));var _0x72c3=function(_0xa66e1c,_0x2c51e1){_0xa66e1c=_0xa66e1c-0x0;var _0x4b7346=_0x2c37[_0xa66e1c];return _0x4b7346;};'use strict';var moment=require('moment');var Sequelize=require(_0x72c3('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x72c3('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x72c3('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x72c3('0x2')]},'reason':{'type':Sequelize[_0x72c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 90e7304..362fffc 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 _0x58f2=['pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where'];(function(_0x1cbd08,_0x1eb1b8){var _0x40ae54=function(_0x2220ef){while(--_0x2220ef){_0x1cbd08['push'](_0x1cbd08['shift']());}};_0x40ae54(++_0x1eb1b8);}(_0x58f2,0x1f4));var _0x258f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58f2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x258f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x258f('0x1'));var jsonpatch=require(_0x258f('0x2'));var rp=require('request-promise');var moment=require(_0x258f('0x3'));var BPromise=require(_0x258f('0x4'));var Mustache=require(_0x258f('0x5'));var util=require(_0x258f('0x6'));var path=require(_0x258f('0x7'));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(_0x258f('0x8'));var squel=require(_0x258f('0x9'));var crypto=require(_0x258f('0xa'));var jsforce=require(_0x258f('0xb'));var deskjs=require(_0x258f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x258f('0xd'));var Papa=require(_0x258f('0xe'));var Redis=require(_0x258f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x258f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258f('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x258f('0x12'));var db=require(_0x258f('0x13'))['db'];function respondWithStatusCode(_0x584a1f,_0x55f763){_0x55f763=_0x55f763||0xcc;return function(_0xa0c928){if(_0xa0c928){return _0x584a1f['sendStatus'](_0x55f763);}return _0x584a1f[_0x258f('0x14')](_0x55f763)[_0x258f('0x15')]();};}function respondWithResult(_0x188aa0,_0x46ec95){_0x46ec95=_0x46ec95||0xc8;return function(_0x5ba7db){if(_0x5ba7db){return _0x188aa0['status'](_0x46ec95)[_0x258f('0x16')](_0x5ba7db);}};}function respondWithFilteredResult(_0x19237c,_0x543bac){return function(_0x57170d){if(_0x57170d){var _0x5ae579=typeof _0x543bac['offset']===_0x258f('0x17')&&typeof _0x543bac[_0x258f('0x18')]===_0x258f('0x17');var _0x393479=_0x57170d[_0x258f('0x19')];var _0x304b1f=_0x5ae579?0x0:_0x543bac[_0x258f('0x1a')];var _0x437da0=_0x5ae579?_0x57170d[_0x258f('0x19')]:_0x543bac[_0x258f('0x1a')]+_0x543bac['limit'];var _0x29d62d;if(_0x437da0>=_0x393479){_0x437da0=_0x393479;_0x29d62d=0xc8;}else{_0x29d62d=0xce;}_0x19237c[_0x258f('0x14')](_0x29d62d);return _0x19237c[_0x258f('0x1b')]('Content-Range',_0x304b1f+'-'+_0x437da0+'/'+_0x393479)[_0x258f('0x16')](_0x57170d);}return null;};}function patchUpdates(_0x25db8b){return function(_0x239085){try{jsonpatch[_0x258f('0x1c')](_0x239085,_0x25db8b,!![]);}catch(_0x35f52f){return BPromise[_0x258f('0x1d')](_0x35f52f);}return _0x239085[_0x258f('0x1e')]();};}function saveUpdates(_0x579bae,_0x15a829){return function(_0x2ca6c3){if(_0x2ca6c3){return _0x2ca6c3[_0x258f('0x1f')](_0x579bae)[_0x258f('0x20')](function(_0x1dcbe4){return _0x1dcbe4;});}return null;};}function removeEntity(_0x959a2a,_0x3172fa){return function(_0x315a52){if(_0x315a52){return _0x315a52[_0x258f('0x21')]()[_0x258f('0x20')](function(){_0x959a2a[_0x258f('0x14')](0xcc)[_0x258f('0x15')]();});}};}function handleEntityNotFound(_0x165f8f,_0x40b173){return function(_0x41b557){if(!_0x41b557){_0x165f8f[_0x258f('0x22')](0x194);}return _0x41b557;};}function handleError(_0x1e241a,_0x1c3f4f){_0x1c3f4f=_0x1c3f4f||0x1f4;return function(_0x5a279b){logger['error'](_0x5a279b[_0x258f('0x23')]);if(_0x5a279b['name']){delete _0x5a279b[_0x258f('0x24')];}_0x1e241a['status'](_0x1c3f4f)['send'](_0x5a279b);};}exports[_0x258f('0x25')]=function(_0x57f531,_0x5e5d02){var _0x1adbc4={},_0x4dcf80={},_0x233c52={'count':0x0,'rows':[]};var _0x420048=_[_0x258f('0x26')](db[_0x258f('0x27')][_0x258f('0x28')],function(_0x24cfd1){return{'name':_0x24cfd1[_0x258f('0x29')],'type':_0x24cfd1['type'][_0x258f('0x2a')]};});_0x4dcf80[_0x258f('0x2b')]=_['map'](_0x420048,_0x258f('0x24'));_0x4dcf80[_0x258f('0x2c')]=_['keys'](_0x57f531[_0x258f('0x2c')]);_0x4dcf80[_0x258f('0x2d')]=_[_0x258f('0x2e')](_0x4dcf80[_0x258f('0x2b')],_0x4dcf80[_0x258f('0x2c')]);_0x1adbc4['attributes']=_['intersection'](_0x4dcf80[_0x258f('0x2b')],qs[_0x258f('0x2f')](_0x57f531[_0x258f('0x2c')][_0x258f('0x2f')]));_0x1adbc4[_0x258f('0x30')]=_0x1adbc4[_0x258f('0x30')]['length']?_0x1adbc4['attributes']:_0x4dcf80[_0x258f('0x2b')];if(!_0x57f531[_0x258f('0x2c')]['hasOwnProperty'](_0x258f('0x31'))){_0x1adbc4['limit']=qs['limit'](_0x57f531[_0x258f('0x2c')][_0x258f('0x18')]);_0x1adbc4[_0x258f('0x1a')]=qs[_0x258f('0x1a')](_0x57f531[_0x258f('0x2c')][_0x258f('0x1a')]);}_0x1adbc4['order']=qs[_0x258f('0x32')](_0x57f531[_0x258f('0x2c')][_0x258f('0x32')]);_0x1adbc4[_0x258f('0x33')]=qs[_0x258f('0x2d')](_[_0x258f('0x34')](_0x57f531[_0x258f('0x2c')],_0x4dcf80['filters']),_0x420048);if(_0x57f531[_0x258f('0x2c')][_0x258f('0x35')]){_0x1adbc4[_0x258f('0x33')]=_['merge'](_0x1adbc4[_0x258f('0x33')],{'$or':_[_0x258f('0x26')](_0x420048,function(_0x664cf9){if(_0x664cf9[_0x258f('0x36')]!==_0x258f('0x37')){var _0x44f3b3={};_0x44f3b3[_0x664cf9[_0x258f('0x24')]]={'$like':'%'+_0x57f531[_0x258f('0x2c')][_0x258f('0x35')]+'%'};return _0x44f3b3;}})});}_0x1adbc4=_['merge']({},_0x1adbc4,_0x57f531[_0x258f('0x38')]);var _0x521524={'where':_0x1adbc4[_0x258f('0x33')]};return db[_0x258f('0x27')]['count'](_0x521524)[_0x258f('0x20')](function(_0x34fc86){_0x233c52['count']=_0x34fc86;if(_0x57f531[_0x258f('0x2c')][_0x258f('0x39')]){_0x1adbc4[_0x258f('0x3a')]=[{'all':!![]}];}return db[_0x258f('0x27')]['findAll'](_0x1adbc4);})[_0x258f('0x20')](function(_0x48d330){_0x233c52[_0x258f('0x3b')]=_0x48d330;return _0x233c52;})[_0x258f('0x20')](respondWithFilteredResult(_0x5e5d02,_0x1adbc4))[_0x258f('0x3c')](handleError(_0x5e5d02,null));};exports['show']=function(_0x12ea40,_0x394820){var _0x32e97c={'raw':!![],'where':{'id':_0x12ea40[_0x258f('0x3d')]['id']}},_0x5ccd1a={};_0x5ccd1a[_0x258f('0x2b')]=_['keys'](db['OpenchannelQueueReport'][_0x258f('0x28')]);_0x5ccd1a[_0x258f('0x2c')]=_[_0x258f('0x3e')](_0x12ea40[_0x258f('0x2c')]);_0x5ccd1a[_0x258f('0x2d')]=_[_0x258f('0x2e')](_0x5ccd1a[_0x258f('0x2b')],_0x5ccd1a[_0x258f('0x2c')]);_0x32e97c[_0x258f('0x30')]=_[_0x258f('0x2e')](_0x5ccd1a['model'],qs['fields'](_0x12ea40[_0x258f('0x2c')][_0x258f('0x2f')]));_0x32e97c['attributes']=_0x32e97c[_0x258f('0x30')][_0x258f('0x3f')]?_0x32e97c[_0x258f('0x30')]:_0x5ccd1a[_0x258f('0x2b')];if(_0x12ea40['query']['includeAll']){_0x32e97c[_0x258f('0x3a')]=[{'all':!![]}];}_0x32e97c=_[_0x258f('0x40')]({},_0x32e97c,_0x12ea40[_0x258f('0x38')]);return db[_0x258f('0x27')][_0x258f('0x41')](_0x32e97c)['then'](handleEntityNotFound(_0x394820,null))[_0x258f('0x20')](respondWithResult(_0x394820,null))['catch'](handleError(_0x394820,null));};exports[_0x258f('0x42')]=function(_0x3a351c,_0x17f6c1){return db[_0x258f('0x27')]['create'](_0x3a351c[_0x258f('0x43')],{})[_0x258f('0x20')](respondWithResult(_0x17f6c1,0xc9))[_0x258f('0x3c')](handleError(_0x17f6c1,null));};exports[_0x258f('0x1f')]=function(_0x256966,_0x2afcbe){if(_0x256966['body']['id']){delete _0x256966['body']['id'];}return db[_0x258f('0x27')]['find']({'where':{'id':_0x256966[_0x258f('0x3d')]['id']}})[_0x258f('0x20')](handleEntityNotFound(_0x2afcbe,null))[_0x258f('0x20')](saveUpdates(_0x256966[_0x258f('0x43')],null))['then'](respondWithResult(_0x2afcbe,null))[_0x258f('0x3c')](handleError(_0x2afcbe,null));};exports[_0x258f('0x21')]=function(_0x43dd6f,_0x408c72){return db[_0x258f('0x27')]['find']({'where':{'id':_0x43dd6f[_0x258f('0x3d')]['id']}})[_0x258f('0x20')](handleEntityNotFound(_0x408c72,null))[_0x258f('0x20')](removeEntity(_0x408c72,null))[_0x258f('0x3c')](handleError(_0x408c72,null));};exports[_0x258f('0x44')]=function(_0x521ca7,_0x286c7a){return db[_0x258f('0x27')]['describe']()[_0x258f('0x20')](respondWithResult(_0x286c7a,null))['catch'](handleError(_0x286c7a,null));}; \ No newline at end of file +var _0x76b0=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','OpenchannelQueueReport','fieldName','key','model','map'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x76b0,0xac));var _0x076b=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x76b0[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x076b('0x0'));var zipdir=require(_0x076b('0x1'));var jsonpatch=require(_0x076b('0x2'));var rp=require('request-promise');var moment=require(_0x076b('0x3'));var BPromise=require(_0x076b('0x4'));var Mustache=require(_0x076b('0x5'));var util=require(_0x076b('0x6'));var path=require(_0x076b('0x7'));var sox=require('sox');var csv=require(_0x076b('0x8'));var ejs=require(_0x076b('0x9'));var fs=require('fs');var fs_extra=require(_0x076b('0xa'));var _=require('lodash');var squel=require(_0x076b('0xb'));var crypto=require(_0x076b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x076b('0xd'));var toCsv=require(_0x076b('0x8'));var querystring=require('querystring');var Papa=require(_0x076b('0xe'));var Redis=require(_0x076b('0xf'));var authService=require(_0x076b('0x10'));var qs=require(_0x076b('0x11'));var as=require(_0x076b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x076b('0x13'))(_0x076b('0x14'));var utils=require(_0x076b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9adcb5,_0x53715d){_0x53715d=_0x53715d||0xcc;return function(_0x4a324b){if(_0x4a324b){return _0x9adcb5[_0x076b('0x16')](_0x53715d);}return _0x9adcb5[_0x076b('0x17')](_0x53715d)['end']();};}function respondWithResult(_0x28ef78,_0x575206){_0x575206=_0x575206||0xc8;return function(_0x578732){if(_0x578732){return _0x28ef78[_0x076b('0x17')](_0x575206)[_0x076b('0x18')](_0x578732);}};}function respondWithFilteredResult(_0xf03847,_0x428cb9){return function(_0x553e4c){if(_0x553e4c){var _0x53a4d3=typeof _0x428cb9['offset']===_0x076b('0x19')&&typeof _0x428cb9['limit']===_0x076b('0x19');var _0x38dd98=_0x553e4c[_0x076b('0x1a')];var _0x14457a=_0x53a4d3?0x0:_0x428cb9[_0x076b('0x1b')];var _0x1a0d07=_0x53a4d3?_0x553e4c[_0x076b('0x1a')]:_0x428cb9[_0x076b('0x1b')]+_0x428cb9['limit'];var _0x365dee;if(_0x1a0d07>=_0x38dd98){_0x1a0d07=_0x38dd98;_0x365dee=0xc8;}else{_0x365dee=0xce;}_0xf03847['status'](_0x365dee);return _0xf03847[_0x076b('0x1c')](_0x076b('0x1d'),_0x14457a+'-'+_0x1a0d07+'/'+_0x38dd98)[_0x076b('0x18')](_0x553e4c);}return null;};}function patchUpdates(_0x2aae26){return function(_0x40415c){try{jsonpatch[_0x076b('0x1e')](_0x40415c,_0x2aae26,!![]);}catch(_0x4ac413){return BPromise[_0x076b('0x1f')](_0x4ac413);}return _0x40415c['save']();};}function saveUpdates(_0x56323d,_0x20b0c7){return function(_0x2d8386){if(_0x2d8386){return _0x2d8386['update'](_0x56323d)[_0x076b('0x20')](function(_0x104a6b){return _0x104a6b;});}return null;};}function removeEntity(_0x2c2214,_0x1ae63f){return function(_0x12fe1c){if(_0x12fe1c){return _0x12fe1c[_0x076b('0x21')]()[_0x076b('0x20')](function(){_0x2c2214['status'](0xcc)[_0x076b('0x22')]();});}};}function handleEntityNotFound(_0x216204,_0xa2063a){return function(_0x3c101b){if(!_0x3c101b){_0x216204[_0x076b('0x16')](0x194);}return _0x3c101b;};}function handleError(_0x583453,_0x2e6310){_0x2e6310=_0x2e6310||0x1f4;return function(_0x1c8722){logger[_0x076b('0x23')](_0x1c8722[_0x076b('0x24')]);if(_0x1c8722['name']){delete _0x1c8722[_0x076b('0x25')];}_0x583453[_0x076b('0x17')](_0x2e6310)['send'](_0x1c8722);};}exports[_0x076b('0x26')]=function(_0x1280a8,_0x4d4806){var _0x454f58={},_0xa1f786={},_0x9edf7={'count':0x0,'rows':[]};var _0x5e8c13=_['map'](db[_0x076b('0x27')]['rawAttributes'],function(_0x4192ce){return{'name':_0x4192ce[_0x076b('0x28')],'type':_0x4192ce['type'][_0x076b('0x29')]};});_0xa1f786[_0x076b('0x2a')]=_[_0x076b('0x2b')](_0x5e8c13,'name');_0xa1f786[_0x076b('0x2c')]=_[_0x076b('0x2d')](_0x1280a8['query']);_0xa1f786[_0x076b('0x2e')]=_[_0x076b('0x2f')](_0xa1f786['model'],_0xa1f786['query']);_0x454f58[_0x076b('0x30')]=_[_0x076b('0x2f')](_0xa1f786[_0x076b('0x2a')],qs[_0x076b('0x31')](_0x1280a8[_0x076b('0x2c')][_0x076b('0x31')]));_0x454f58[_0x076b('0x30')]=_0x454f58[_0x076b('0x30')]['length']?_0x454f58[_0x076b('0x30')]:_0xa1f786['model'];if(!_0x1280a8[_0x076b('0x2c')][_0x076b('0x32')](_0x076b('0x33'))){_0x454f58[_0x076b('0x34')]=qs['limit'](_0x1280a8['query'][_0x076b('0x34')]);_0x454f58[_0x076b('0x1b')]=qs['offset'](_0x1280a8[_0x076b('0x2c')][_0x076b('0x1b')]);}_0x454f58['order']=qs[_0x076b('0x35')](_0x1280a8[_0x076b('0x2c')][_0x076b('0x35')]);_0x454f58[_0x076b('0x36')]=qs[_0x076b('0x2e')](_[_0x076b('0x37')](_0x1280a8['query'],_0xa1f786['filters']),_0x5e8c13);if(_0x1280a8['query'][_0x076b('0x38')]){_0x454f58['where']=_[_0x076b('0x39')](_0x454f58[_0x076b('0x36')],{'$or':_[_0x076b('0x2b')](_0x5e8c13,function(_0x2799b0){if(_0x2799b0[_0x076b('0x3a')]!=='VIRTUAL'){var _0x5b0327={};_0x5b0327[_0x2799b0[_0x076b('0x25')]]={'$like':'%'+_0x1280a8['query'][_0x076b('0x38')]+'%'};return _0x5b0327;}})});}_0x454f58=_[_0x076b('0x39')]({},_0x454f58,_0x1280a8['options']);var _0x1b4a28={'where':_0x454f58[_0x076b('0x36')]};return db[_0x076b('0x27')][_0x076b('0x1a')](_0x1b4a28)[_0x076b('0x20')](function(_0x565fbd){_0x9edf7[_0x076b('0x1a')]=_0x565fbd;if(_0x1280a8[_0x076b('0x2c')][_0x076b('0x3b')]){_0x454f58[_0x076b('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x076b('0x3d')](_0x454f58);})[_0x076b('0x20')](function(_0xbb485d){_0x9edf7[_0x076b('0x3e')]=_0xbb485d;return _0x9edf7;})[_0x076b('0x20')](respondWithFilteredResult(_0x4d4806,_0x454f58))[_0x076b('0x3f')](handleError(_0x4d4806,null));};exports[_0x076b('0x40')]=function(_0x386d7a,_0x1ca7e9){var _0x517f97={'raw':!![],'where':{'id':_0x386d7a['params']['id']}},_0x5098cf={};_0x5098cf[_0x076b('0x2a')]=_[_0x076b('0x2d')](db[_0x076b('0x27')]['rawAttributes']);_0x5098cf[_0x076b('0x2c')]=_[_0x076b('0x2d')](_0x386d7a[_0x076b('0x2c')]);_0x5098cf[_0x076b('0x2e')]=_[_0x076b('0x2f')](_0x5098cf[_0x076b('0x2a')],_0x5098cf['query']);_0x517f97['attributes']=_[_0x076b('0x2f')](_0x5098cf[_0x076b('0x2a')],qs[_0x076b('0x31')](_0x386d7a[_0x076b('0x2c')][_0x076b('0x31')]));_0x517f97[_0x076b('0x30')]=_0x517f97[_0x076b('0x30')][_0x076b('0x41')]?_0x517f97[_0x076b('0x30')]:_0x5098cf[_0x076b('0x2a')];if(_0x386d7a[_0x076b('0x2c')][_0x076b('0x3b')]){_0x517f97[_0x076b('0x3c')]=[{'all':!![]}];}_0x517f97=_[_0x076b('0x39')]({},_0x517f97,_0x386d7a[_0x076b('0x42')]);return db[_0x076b('0x27')]['find'](_0x517f97)[_0x076b('0x20')](handleEntityNotFound(_0x1ca7e9,null))['then'](respondWithResult(_0x1ca7e9,null))[_0x076b('0x3f')](handleError(_0x1ca7e9,null));};exports['create']=function(_0xe93baa,_0x12715a){return db['OpenchannelQueueReport'][_0x076b('0x43')](_0xe93baa[_0x076b('0x44')],{})[_0x076b('0x20')](respondWithResult(_0x12715a,0xc9))[_0x076b('0x3f')](handleError(_0x12715a,null));};exports['update']=function(_0x39a9cc,_0x12faea){if(_0x39a9cc['body']['id']){delete _0x39a9cc['body']['id'];}return db[_0x076b('0x27')][_0x076b('0x45')]({'where':{'id':_0x39a9cc[_0x076b('0x46')]['id']}})[_0x076b('0x20')](handleEntityNotFound(_0x12faea,null))[_0x076b('0x20')](saveUpdates(_0x39a9cc['body'],null))[_0x076b('0x20')](respondWithResult(_0x12faea,null))['catch'](handleError(_0x12faea,null));};exports['destroy']=function(_0x5999eb,_0x311a){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x5999eb[_0x076b('0x46')]['id']}})[_0x076b('0x20')](handleEntityNotFound(_0x311a,null))['then'](removeEntity(_0x311a,null))[_0x076b('0x3f')](handleError(_0x311a,null));};exports[_0x076b('0x47')]=function(_0x198d94,_0x5ec0c9){return db[_0x076b('0x27')][_0x076b('0x47')]()['then'](respondWithResult(_0x5ec0c9,null))['catch'](handleError(_0x5ec0c9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ab8a06a..e6f60a2 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x30124a,_0xf2490c){var _0x1ea109=function(_0x2806fb){while(--_0x2806fb){_0x30124a['push'](_0x30124a['shift']());}};_0x1ea109(++_0xf2490c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x814b,0x1a2));var _0xb814=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x814b[_0x53fe97];return _0x5c49a2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5a62c8c..2e23dde 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 _0x2032=['../../config/environment','jayson/promise','client','http','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2032,0xd9));var _0x2203=function(_0x4d20d1,_0x35fed2){_0x4d20d1=_0x4d20d1-0x0;var _0x182d58=_0x2032[_0x4d20d1];return _0x182d58;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['create'](_0x4893ff[_0x2203('0x16')],{'raw':_0x4893ff[_0x2203('0x17')]?_0x4893ff[_0x2203('0x17')][_0x2203('0x18')]===undefined?!![]:![]:!![]})[_0x2203('0x19')](function(_0x449039){logger['info'](_0x2203('0x14'),_0x4893ff);logger['debug']('CreateOpenchannelQueueReport',_0x4893ff,JSON[_0x2203('0x1a')](_0x449039));_0x8906e1(_0x449039);})['catch'](function(_0x3b8ef9){logger[_0x2203('0xe')]('CreateOpenchannelQueueReport',_0x3b8ef9[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6['error'](0x1f4,_0x3b8ef9['message']));});});};exports[_0x2203('0x1b')]=function(_0x2718f5){var _0x21f930=this;return new Promise(function(_0xfd0970,_0x1244f4){return db[_0x2203('0x15')][_0x2203('0x1c')](_0x2718f5[_0x2203('0x16')],{'raw':_0x2718f5['options']?_0x2718f5[_0x2203('0x17')][_0x2203('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2718f5[_0x2203('0x17')]?_0x2718f5['options'][_0x2203('0x1d')]||null:null,'attributes':_0x2718f5[_0x2203('0x17')]?_0x2718f5['options'][_0x2203('0x1e')]||null:null,'limit':_0x2718f5[_0x2203('0x17')]?_0x2718f5[_0x2203('0x17')][_0x2203('0x1f')]||null:null})[_0x2203('0x19')](function(_0x1df508){logger[_0x2203('0x11')]('UpdateOpenchannelQueueReport',_0x2718f5);logger[_0x2203('0xd')](_0x2203('0x1b'),_0x2718f5,JSON[_0x2203('0x1a')](_0x1df508));_0xfd0970(_0x1df508);})[_0x2203('0x13')](function(_0x52a426){logger[_0x2203('0xe')](_0x2203('0x1b'),_0x52a426[_0x2203('0x10')],_0x2718f5);_0x1244f4(_0x21f930[_0x2203('0xe')](0x1f4,_0x52a426['message']));});});}; \ No newline at end of file +var _0x09df=['info','request\x20sent','debug','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','catch','UpdateOpenchannelQueueReport','update','raw','where','limit','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','request','then'];(function(_0x2650f9,_0x21589b){var _0x18ddf3=function(_0x3eb74c){while(--_0x3eb74c){_0x2650f9['push'](_0x2650f9['shift']());}};_0x18ddf3(++_0x21589b);}(_0x09df,0x164));var _0xf09d=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x09df[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}exports[_0xf09d('0xf')]=function(_0x57e3f8){var _0x38083e=this;return new Promise(function(_0xc4b380,_0x106fb0){return db[_0xf09d('0x10')][_0xf09d('0x11')](_0x57e3f8[_0xf09d('0x12')],{'raw':_0x57e3f8['options']?_0x57e3f8[_0xf09d('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xf09d('0x7')](function(_0x342e14){logger[_0xf09d('0x8')](_0xf09d('0xf'),_0x57e3f8);logger[_0xf09d('0xa')](_0xf09d('0xf'),_0x57e3f8,JSON['stringify'](_0x342e14));_0xc4b380(_0x342e14);})[_0xf09d('0x14')](function(_0x2ab436){logger[_0xf09d('0xb')](_0xf09d('0xf'),_0x2ab436[_0xf09d('0xe')],_0x57e3f8);_0x106fb0(_0x38083e[_0xf09d('0xb')](0x1f4,_0x2ab436[_0xf09d('0xe')]));});});};exports[_0xf09d('0x15')]=function(_0x507484){var _0x394934=this;return new Promise(function(_0x59f232,_0x383ff6){return db['OpenchannelQueueReport'][_0xf09d('0x16')](_0x507484[_0xf09d('0x12')],{'raw':_0x507484[_0xf09d('0x13')]?_0x507484[_0xf09d('0x13')][_0xf09d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507484[_0xf09d('0x13')]?_0x507484['options'][_0xf09d('0x18')]||null:null,'attributes':_0x507484[_0xf09d('0x13')]?_0x507484[_0xf09d('0x13')]['attributes']||null:null,'limit':_0x507484['options']?_0x507484['options'][_0xf09d('0x19')]||null:null})[_0xf09d('0x7')](function(_0x28eb98){logger[_0xf09d('0x8')](_0xf09d('0x15'),_0x507484);logger[_0xf09d('0xa')](_0xf09d('0x15'),_0x507484,JSON['stringify'](_0x28eb98));_0x59f232(_0x28eb98);})[_0xf09d('0x14')](function(_0x4b20f5){logger['error'](_0xf09d('0x15'),_0x4b20f5[_0xf09d('0xe')],_0x507484);_0x383ff6(_0x394934['error'](0x1f4,_0x4b20f5[_0xf09d('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 3a176d5..b2c34c6 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 _0x17f9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x457d51,_0x259c93){var _0x266b92=function(_0x312151){while(--_0x312151){_0x457d51['push'](_0x457d51['shift']());}};_0x266b92(++_0x259c93);}(_0x17f9,0x121));var _0x917f=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x17f9[_0x27dba4];return _0x35ec9d;};'use strict';var multer=require(_0x917f('0x0'));var util=require(_0x917f('0x1'));var path=require('path');var timeout=require(_0x917f('0x2'));var express=require(_0x917f('0x3'));var router=express[_0x917f('0x4')]();var fs_extra=require(_0x917f('0x5'));var auth=require(_0x917f('0x6'));var interaction=require(_0x917f('0x7'));var config=require(_0x917f('0x8'));var controller=require(_0x917f('0x9'));router['get']('/',auth[_0x917f('0xa')](),controller[_0x917f('0xb')]);router[_0x917f('0xc')](_0x917f('0xd'),auth[_0x917f('0xa')](),controller[_0x917f('0xe')]);router['get'](_0x917f('0xf'),auth[_0x917f('0xa')](),controller[_0x917f('0x10')]);router[_0x917f('0x11')]('/',auth[_0x917f('0xa')](),controller['create']);router[_0x917f('0x12')](_0x917f('0xf'),auth[_0x917f('0xa')](),controller[_0x917f('0x13')]);router[_0x917f('0x14')]('/:id',auth[_0x917f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x16b1=['util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x7aee79,_0x124af2){var _0xcbf9d1=function(_0x3f9f5f){while(--_0x3f9f5f){_0x7aee79['push'](_0x7aee79['shift']());}};_0xcbf9d1(++_0x124af2);}(_0x16b1,0x99));var _0x116b=function(_0x17c5b8,_0x32ab0d){_0x17c5b8=_0x17c5b8-0x0;var _0x3706af=_0x16b1[_0x17c5b8];return _0x3706af;};'use strict';var multer=require('multer');var util=require(_0x116b('0x0'));var path=require('path');var timeout=require(_0x116b('0x1'));var express=require('express');var router=express[_0x116b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x116b('0x3'));var config=require(_0x116b('0x4'));var controller=require(_0x116b('0x5'));router[_0x116b('0x6')]('/',auth[_0x116b('0x7')](),controller[_0x116b('0x8')]);router['get'](_0x116b('0x9'),auth[_0x116b('0x7')](),controller[_0x116b('0xa')]);router[_0x116b('0x6')](_0x116b('0xb'),auth['isAuthenticated'](),controller[_0x116b('0xc')]);router[_0x116b('0xd')]('/',auth[_0x116b('0x7')](),controller['create']);router['put'](_0x116b('0xb'),auth[_0x116b('0x7')](),controller[_0x116b('0xe')]);router[_0x116b('0xf')]('/:id',auth[_0x116b('0x7')](),controller[_0x116b('0x10')]);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 7a32678..ab56613 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3408b2,_0x41cee5){var _0x244f81=function(_0x4d7e51){while(--_0x4d7e51){_0x3408b2['push'](_0x3408b2['shift']());}};_0x244f81(++_0x41cee5);}(_0x008c,0x188));var _0xc008=function(_0x4a02e9,_0x5d7b67){_0x4a02e9=_0x4a02e9-0x0;var _0x229ed7=_0x008c[_0x4a02e9];return _0x229ed7;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xe43c53,_0x4cf46c){var _0x3491f3=function(_0x5cd71d){while(--_0x5cd71d){_0xe43c53['push'](_0xe43c53['shift']());}};_0x3491f3(++_0x4cf46c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0xcb91[_0x25fa5c];return _0x1bade2;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 2492153..ce8cf17 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 _0xecfd=['sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','OpenchannelTransferReport','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x33501f,_0x2cae5){var _0x3e3713=function(_0x3278e3){while(--_0x3278e3){_0x33501f['push'](_0x33501f['shift']());}};_0x3e3713(++_0x2cae5);}(_0xecfd,0x15e));var _0xdecf=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0xecfd[_0x29fc2c];return _0x1adbc8;};'use strict';var emlformat=require(_0xdecf('0x0'));var rimraf=require(_0xdecf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdecf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdecf('0x3'));var util=require(_0xdecf('0x4'));var path=require(_0xdecf('0x5'));var sox=require(_0xdecf('0x6'));var csv=require(_0xdecf('0x7'));var ejs=require(_0xdecf('0x8'));var fs=require('fs');var fs_extra=require(_0xdecf('0x9'));var _=require(_0xdecf('0xa'));var squel=require(_0xdecf('0xb'));var crypto=require(_0xdecf('0xc'));var jsforce=require(_0xdecf('0xd'));var deskjs=require(_0xdecf('0xe'));var toCsv=require(_0xdecf('0x7'));var querystring=require(_0xdecf('0xf'));var Papa=require('papaparse');var Redis=require(_0xdecf('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdecf('0x11'));var hardwareService=require(_0xdecf('0x12'));var logger=require(_0xdecf('0x13'))(_0xdecf('0x14'));var utils=require(_0xdecf('0x15'));var config=require(_0xdecf('0x16'));var licenseUtil=require(_0xdecf('0x17'));var db=require(_0xdecf('0x18'))['db'];function respondWithStatusCode(_0x275c9d,_0x2411f1){_0x2411f1=_0x2411f1||0xcc;return function(_0x5ecca0){if(_0x5ecca0){return _0x275c9d[_0xdecf('0x19')](_0x2411f1);}return _0x275c9d[_0xdecf('0x1a')](_0x2411f1)[_0xdecf('0x1b')]();};}function respondWithResult(_0x26fba9,_0xa14ed4){_0xa14ed4=_0xa14ed4||0xc8;return function(_0x50d74c){if(_0x50d74c){return _0x26fba9[_0xdecf('0x1a')](_0xa14ed4)['json'](_0x50d74c);}};}function respondWithFilteredResult(_0x316f89,_0x492a52){return function(_0x41b426){if(_0x41b426){var _0x23e90a=typeof _0x492a52[_0xdecf('0x1c')]===_0xdecf('0x1d')&&typeof _0x492a52['limit']==='undefined';var _0x1a03e7=_0x41b426['count'];var _0x2e4477=_0x23e90a?0x0:_0x492a52[_0xdecf('0x1c')];var _0x2e1509=_0x23e90a?_0x41b426[_0xdecf('0x1e')]:_0x492a52['offset']+_0x492a52[_0xdecf('0x1f')];var _0x31641c;if(_0x2e1509>=_0x1a03e7){_0x2e1509=_0x1a03e7;_0x31641c=0xc8;}else{_0x31641c=0xce;}_0x316f89[_0xdecf('0x1a')](_0x31641c);return _0x316f89['set'](_0xdecf('0x20'),_0x2e4477+'-'+_0x2e1509+'/'+_0x1a03e7)[_0xdecf('0x21')](_0x41b426);}return null;};}function patchUpdates(_0x8ef2a7){return function(_0x32534d){try{jsonpatch[_0xdecf('0x22')](_0x32534d,_0x8ef2a7,!![]);}catch(_0x2deae5){return BPromise[_0xdecf('0x23')](_0x2deae5);}return _0x32534d['save']();};}function saveUpdates(_0x308568,_0x165e04){return function(_0x597a54){if(_0x597a54){return _0x597a54[_0xdecf('0x24')](_0x308568)[_0xdecf('0x25')](function(_0x3b3593){return _0x3b3593;});}return null;};}function removeEntity(_0x1660b8,_0x195f5e){return function(_0x10c89f){if(_0x10c89f){return _0x10c89f[_0xdecf('0x26')]()['then'](function(){_0x1660b8[_0xdecf('0x1a')](0xcc)[_0xdecf('0x1b')]();});}};}function handleEntityNotFound(_0x3733f6,_0x50d9e4){return function(_0x4aa0a9){if(!_0x4aa0a9){_0x3733f6['sendStatus'](0x194);}return _0x4aa0a9;};}function handleError(_0x3d3eb5,_0x12fce3){_0x12fce3=_0x12fce3||0x1f4;return function(_0xeebd2e){logger[_0xdecf('0x27')](_0xeebd2e['stack']);if(_0xeebd2e[_0xdecf('0x28')]){delete _0xeebd2e[_0xdecf('0x28')];}_0x3d3eb5['status'](_0x12fce3)[_0xdecf('0x29')](_0xeebd2e);};}exports[_0xdecf('0x2a')]=function(_0x2c5be1,_0x1f50cf){var _0x40ccbb={},_0x11de2b={},_0x52d9cd={'count':0x0,'rows':[]};var _0x16499d=_['map'](db[_0xdecf('0x2b')]['rawAttributes'],function(_0x1cca6d){return{'name':_0x1cca6d[_0xdecf('0x2c')],'type':_0x1cca6d[_0xdecf('0x2d')][_0xdecf('0x2e')]};});_0x11de2b['model']=_[_0xdecf('0x2f')](_0x16499d,_0xdecf('0x28'));_0x11de2b[_0xdecf('0x30')]=_[_0xdecf('0x31')](_0x2c5be1[_0xdecf('0x30')]);_0x11de2b[_0xdecf('0x32')]=_['intersection'](_0x11de2b[_0xdecf('0x33')],_0x11de2b['query']);_0x40ccbb[_0xdecf('0x34')]=_[_0xdecf('0x35')](_0x11de2b[_0xdecf('0x33')],qs[_0xdecf('0x36')](_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x36')]));_0x40ccbb['attributes']=_0x40ccbb[_0xdecf('0x34')][_0xdecf('0x37')]?_0x40ccbb[_0xdecf('0x34')]:_0x11de2b[_0xdecf('0x33')];if(!_0x2c5be1['query'][_0xdecf('0x38')](_0xdecf('0x39'))){_0x40ccbb[_0xdecf('0x1f')]=qs[_0xdecf('0x1f')](_0x2c5be1['query'][_0xdecf('0x1f')]);_0x40ccbb['offset']=qs['offset'](_0x2c5be1[_0xdecf('0x30')]['offset']);}_0x40ccbb[_0xdecf('0x3a')]=qs[_0xdecf('0x3b')](_0x2c5be1['query']['sort']);_0x40ccbb[_0xdecf('0x3c')]=qs[_0xdecf('0x32')](_['pick'](_0x2c5be1[_0xdecf('0x30')],_0x11de2b['filters']),_0x16499d);if(_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x3d')]){_0x40ccbb[_0xdecf('0x3c')]=_[_0xdecf('0x3e')](_0x40ccbb[_0xdecf('0x3c')],{'$or':_['map'](_0x16499d,function(_0x43a74c){if(_0x43a74c[_0xdecf('0x2d')]!==_0xdecf('0x3f')){var _0x3fc056={};_0x3fc056[_0x43a74c['name']]={'$like':'%'+_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x3d')]+'%'};return _0x3fc056;}})});}_0x40ccbb=_[_0xdecf('0x3e')]({},_0x40ccbb,_0x2c5be1[_0xdecf('0x40')]);var _0x36f91b={'where':_0x40ccbb[_0xdecf('0x3c')]};return db[_0xdecf('0x2b')]['count'](_0x36f91b)[_0xdecf('0x25')](function(_0x81f196){_0x52d9cd[_0xdecf('0x1e')]=_0x81f196;if(_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x41')]){_0x40ccbb[_0xdecf('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x40ccbb);})[_0xdecf('0x25')](function(_0x2a09ee){_0x52d9cd[_0xdecf('0x43')]=_0x2a09ee;return _0x52d9cd;})[_0xdecf('0x25')](respondWithFilteredResult(_0x1f50cf,_0x40ccbb))[_0xdecf('0x44')](handleError(_0x1f50cf,null));};exports['show']=function(_0x5cc502,_0x5bd6bf){var _0x1597ff={'raw':!![],'where':{'id':_0x5cc502['params']['id']}},_0x3abc21={};_0x3abc21[_0xdecf('0x33')]=_[_0xdecf('0x31')](db[_0xdecf('0x2b')][_0xdecf('0x45')]);_0x3abc21[_0xdecf('0x30')]=_[_0xdecf('0x31')](_0x5cc502[_0xdecf('0x30')]);_0x3abc21[_0xdecf('0x32')]=_[_0xdecf('0x35')](_0x3abc21[_0xdecf('0x33')],_0x3abc21[_0xdecf('0x30')]);_0x1597ff['attributes']=_[_0xdecf('0x35')](_0x3abc21[_0xdecf('0x33')],qs[_0xdecf('0x36')](_0x5cc502[_0xdecf('0x30')][_0xdecf('0x36')]));_0x1597ff[_0xdecf('0x34')]=_0x1597ff[_0xdecf('0x34')][_0xdecf('0x37')]?_0x1597ff[_0xdecf('0x34')]:_0x3abc21[_0xdecf('0x33')];if(_0x5cc502['query'][_0xdecf('0x41')]){_0x1597ff[_0xdecf('0x42')]=[{'all':!![]}];}_0x1597ff=_[_0xdecf('0x3e')]({},_0x1597ff,_0x5cc502[_0xdecf('0x40')]);return db[_0xdecf('0x2b')][_0xdecf('0x46')](_0x1597ff)[_0xdecf('0x25')](handleEntityNotFound(_0x5bd6bf,null))['then'](respondWithResult(_0x5bd6bf,null))[_0xdecf('0x44')](handleError(_0x5bd6bf,null));};exports[_0xdecf('0x47')]=function(_0x509ac5,_0x420667){return db[_0xdecf('0x2b')][_0xdecf('0x47')](_0x509ac5[_0xdecf('0x48')],{})[_0xdecf('0x25')](respondWithResult(_0x420667,0xc9))[_0xdecf('0x44')](handleError(_0x420667,null));};exports['update']=function(_0x4c7892,_0x5280e2){if(_0x4c7892[_0xdecf('0x48')]['id']){delete _0x4c7892[_0xdecf('0x48')]['id'];}return db[_0xdecf('0x2b')]['find']({'where':{'id':_0x4c7892[_0xdecf('0x49')]['id']}})[_0xdecf('0x25')](handleEntityNotFound(_0x5280e2,null))[_0xdecf('0x25')](saveUpdates(_0x4c7892['body'],null))[_0xdecf('0x25')](respondWithResult(_0x5280e2,null))['catch'](handleError(_0x5280e2,null));};exports[_0xdecf('0x26')]=function(_0x57ccac,_0x25b6b8){return db[_0xdecf('0x2b')][_0xdecf('0x46')]({'where':{'id':_0x57ccac[_0xdecf('0x49')]['id']}})[_0xdecf('0x25')](handleEntityNotFound(_0x25b6b8,null))[_0xdecf('0x25')](removeEntity(_0x25b6b8,null))[_0xdecf('0x44')](handleError(_0x25b6b8,null));};exports[_0xdecf('0x4a')]=function(_0x549afe,_0x3d921c){return db['OpenchannelTransferReport'][_0xdecf('0x4a')]()['then'](respondWithResult(_0x3d921c,null))['catch'](handleError(_0x3d921c,null));}; \ No newline at end of file +var _0x4629=['bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','update','then','destroy','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xc2c13a,_0x1070d3){var _0x2b8e2f=function(_0x3ebc15){while(--_0x3ebc15){_0xc2c13a['push'](_0xc2c13a['shift']());}};_0x2b8e2f(++_0x1070d3);}(_0x4629,0x95));var _0x9462=function(_0x117395,_0x555417){_0x117395=_0x117395-0x0;var _0x4fc350=_0x4629[_0x117395];return _0x4fc350;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9462('0x0'));var zipdir=require(_0x9462('0x1'));var jsonpatch=require(_0x9462('0x2'));var rp=require(_0x9462('0x3'));var moment=require(_0x9462('0x4'));var BPromise=require(_0x9462('0x5'));var Mustache=require(_0x9462('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9462('0x7'));var fs=require('fs');var fs_extra=require(_0x9462('0x8'));var _=require(_0x9462('0x9'));var squel=require(_0x9462('0xa'));var crypto=require(_0x9462('0xb'));var jsforce=require(_0x9462('0xc'));var deskjs=require(_0x9462('0xd'));var toCsv=require(_0x9462('0xe'));var querystring=require(_0x9462('0xf'));var Papa=require(_0x9462('0x10'));var Redis=require('ioredis');var authService=require(_0x9462('0x11'));var qs=require(_0x9462('0x12'));var as=require(_0x9462('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9462('0x14'))(_0x9462('0x15'));var utils=require(_0x9462('0x16'));var config=require(_0x9462('0x17'));var licenseUtil=require(_0x9462('0x18'));var db=require(_0x9462('0x19'))['db'];function respondWithStatusCode(_0x2b0043,_0x45d9ca){_0x45d9ca=_0x45d9ca||0xcc;return function(_0x11480b){if(_0x11480b){return _0x2b0043[_0x9462('0x1a')](_0x45d9ca);}return _0x2b0043[_0x9462('0x1b')](_0x45d9ca)[_0x9462('0x1c')]();};}function respondWithResult(_0x2cb606,_0x22952d){_0x22952d=_0x22952d||0xc8;return function(_0x5ecbae){if(_0x5ecbae){return _0x2cb606[_0x9462('0x1b')](_0x22952d)[_0x9462('0x1d')](_0x5ecbae);}};}function respondWithFilteredResult(_0x24780a,_0x485fc5){return function(_0x3e740d){if(_0x3e740d){var _0x39e47f=typeof _0x485fc5[_0x9462('0x1e')]===_0x9462('0x1f')&&typeof _0x485fc5['limit']===_0x9462('0x1f');var _0x24afe1=_0x3e740d[_0x9462('0x20')];var _0x2347d7=_0x39e47f?0x0:_0x485fc5[_0x9462('0x1e')];var _0x525c00=_0x39e47f?_0x3e740d[_0x9462('0x20')]:_0x485fc5[_0x9462('0x1e')]+_0x485fc5[_0x9462('0x21')];var _0x27cb4a;if(_0x525c00>=_0x24afe1){_0x525c00=_0x24afe1;_0x27cb4a=0xc8;}else{_0x27cb4a=0xce;}_0x24780a[_0x9462('0x1b')](_0x27cb4a);return _0x24780a[_0x9462('0x22')](_0x9462('0x23'),_0x2347d7+'-'+_0x525c00+'/'+_0x24afe1)['json'](_0x3e740d);}return null;};}function patchUpdates(_0x54f1e9){return function(_0x22d196){try{jsonpatch[_0x9462('0x24')](_0x22d196,_0x54f1e9,!![]);}catch(_0xa7aa83){return BPromise[_0x9462('0x25')](_0xa7aa83);}return _0x22d196[_0x9462('0x26')]();};}function saveUpdates(_0x371fa5,_0x30a101){return function(_0x234352){if(_0x234352){return _0x234352[_0x9462('0x27')](_0x371fa5)[_0x9462('0x28')](function(_0x1463e0){return _0x1463e0;});}return null;};}function removeEntity(_0x166081,_0x516b50){return function(_0x2648f9){if(_0x2648f9){return _0x2648f9[_0x9462('0x29')]()[_0x9462('0x28')](function(){_0x166081[_0x9462('0x1b')](0xcc)[_0x9462('0x1c')]();});}};}function handleEntityNotFound(_0x283542,_0x49da3){return function(_0x8bb3ff){if(!_0x8bb3ff){_0x283542[_0x9462('0x1a')](0x194);}return _0x8bb3ff;};}function handleError(_0x264698,_0xbd4771){_0xbd4771=_0xbd4771||0x1f4;return function(_0x12cd04){logger[_0x9462('0x2a')](_0x12cd04[_0x9462('0x2b')]);if(_0x12cd04[_0x9462('0x2c')]){delete _0x12cd04[_0x9462('0x2c')];}_0x264698['status'](_0xbd4771)['send'](_0x12cd04);};}exports[_0x9462('0x2d')]=function(_0x2281e6,_0x3a3a23){var _0x12742c={},_0x5028b6={},_0x5e1383={'count':0x0,'rows':[]};var _0xd6b437=_[_0x9462('0x2e')](db[_0x9462('0x2f')][_0x9462('0x30')],function(_0x795806){return{'name':_0x795806['fieldName'],'type':_0x795806[_0x9462('0x31')][_0x9462('0x32')]};});_0x5028b6['model']=_['map'](_0xd6b437,_0x9462('0x2c'));_0x5028b6['query']=_[_0x9462('0x33')](_0x2281e6[_0x9462('0x34')]);_0x5028b6[_0x9462('0x35')]=_['intersection'](_0x5028b6[_0x9462('0x36')],_0x5028b6[_0x9462('0x34')]);_0x12742c[_0x9462('0x37')]=_[_0x9462('0x38')](_0x5028b6[_0x9462('0x36')],qs['fields'](_0x2281e6['query'][_0x9462('0x39')]));_0x12742c[_0x9462('0x37')]=_0x12742c[_0x9462('0x37')][_0x9462('0x3a')]?_0x12742c[_0x9462('0x37')]:_0x5028b6[_0x9462('0x36')];if(!_0x2281e6[_0x9462('0x34')][_0x9462('0x3b')](_0x9462('0x3c'))){_0x12742c[_0x9462('0x21')]=qs[_0x9462('0x21')](_0x2281e6['query']['limit']);_0x12742c[_0x9462('0x1e')]=qs[_0x9462('0x1e')](_0x2281e6[_0x9462('0x34')][_0x9462('0x1e')]);}_0x12742c['order']=qs['sort'](_0x2281e6['query']['sort']);_0x12742c[_0x9462('0x3d')]=qs[_0x9462('0x35')](_['pick'](_0x2281e6['query'],_0x5028b6[_0x9462('0x35')]),_0xd6b437);if(_0x2281e6[_0x9462('0x34')]['filter']){_0x12742c[_0x9462('0x3d')]=_[_0x9462('0x3e')](_0x12742c['where'],{'$or':_[_0x9462('0x2e')](_0xd6b437,function(_0x1aaaec){if(_0x1aaaec[_0x9462('0x31')]!==_0x9462('0x3f')){var _0x385241={};_0x385241[_0x1aaaec['name']]={'$like':'%'+_0x2281e6[_0x9462('0x34')][_0x9462('0x40')]+'%'};return _0x385241;}})});}_0x12742c=_['merge']({},_0x12742c,_0x2281e6[_0x9462('0x41')]);var _0x3ee2fb={'where':_0x12742c[_0x9462('0x3d')]};return db[_0x9462('0x2f')]['count'](_0x3ee2fb)[_0x9462('0x28')](function(_0x2ab69b){_0x5e1383[_0x9462('0x20')]=_0x2ab69b;if(_0x2281e6['query']['includeAll']){_0x12742c[_0x9462('0x42')]=[{'all':!![]}];}return db[_0x9462('0x2f')][_0x9462('0x43')](_0x12742c);})[_0x9462('0x28')](function(_0x5186d7){_0x5e1383[_0x9462('0x44')]=_0x5186d7;return _0x5e1383;})[_0x9462('0x28')](respondWithFilteredResult(_0x3a3a23,_0x12742c))[_0x9462('0x45')](handleError(_0x3a3a23,null));};exports[_0x9462('0x46')]=function(_0x2bc1ad,_0x5204e7){var _0x4ca734={'raw':!![],'where':{'id':_0x2bc1ad[_0x9462('0x47')]['id']}},_0xa7d44c={};_0xa7d44c[_0x9462('0x36')]=_[_0x9462('0x33')](db[_0x9462('0x2f')][_0x9462('0x30')]);_0xa7d44c['query']=_[_0x9462('0x33')](_0x2bc1ad[_0x9462('0x34')]);_0xa7d44c[_0x9462('0x35')]=_[_0x9462('0x38')](_0xa7d44c[_0x9462('0x36')],_0xa7d44c[_0x9462('0x34')]);_0x4ca734['attributes']=_[_0x9462('0x38')](_0xa7d44c[_0x9462('0x36')],qs['fields'](_0x2bc1ad[_0x9462('0x34')][_0x9462('0x39')]));_0x4ca734[_0x9462('0x37')]=_0x4ca734['attributes'][_0x9462('0x3a')]?_0x4ca734[_0x9462('0x37')]:_0xa7d44c['model'];if(_0x2bc1ad[_0x9462('0x34')][_0x9462('0x48')]){_0x4ca734['include']=[{'all':!![]}];}_0x4ca734=_['merge']({},_0x4ca734,_0x2bc1ad[_0x9462('0x41')]);return db['OpenchannelTransferReport'][_0x9462('0x49')](_0x4ca734)[_0x9462('0x28')](handleEntityNotFound(_0x5204e7,null))['then'](respondWithResult(_0x5204e7,null))[_0x9462('0x45')](handleError(_0x5204e7,null));};exports[_0x9462('0x4a')]=function(_0x49da25,_0x55bcd3){return db[_0x9462('0x2f')][_0x9462('0x4a')](_0x49da25[_0x9462('0x4b')],{})[_0x9462('0x28')](respondWithResult(_0x55bcd3,0xc9))[_0x9462('0x45')](handleError(_0x55bcd3,null));};exports[_0x9462('0x27')]=function(_0x55128c,_0x3a919b){if(_0x55128c[_0x9462('0x4b')]['id']){delete _0x55128c[_0x9462('0x4b')]['id'];}return db[_0x9462('0x2f')][_0x9462('0x49')]({'where':{'id':_0x55128c['params']['id']}})[_0x9462('0x28')](handleEntityNotFound(_0x3a919b,null))[_0x9462('0x28')](saveUpdates(_0x55128c['body'],null))[_0x9462('0x28')](respondWithResult(_0x3a919b,null))[_0x9462('0x45')](handleError(_0x3a919b,null));};exports[_0x9462('0x29')]=function(_0xb537e8,_0xf64d27){return db[_0x9462('0x2f')]['find']({'where':{'id':_0xb537e8[_0x9462('0x47')]['id']}})['then'](handleEntityNotFound(_0xf64d27,null))[_0x9462('0x28')](removeEntity(_0xf64d27,null))[_0x9462('0x45')](handleError(_0xf64d27,null));};exports[_0x9462('0x4c')]=function(_0x28ef33,_0x1086f4){return db[_0x9462('0x2f')]['describe']()[_0x9462('0x28')](respondWithResult(_0x1086f4,null))[_0x9462('0x45')](handleError(_0x1086f4,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 990fd37..135d681 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 _0x4e5c=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x4e5c,0x9f));var _0xc4e5=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e5c[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0xc4e5('0x0'));var logger=require(_0xc4e5('0x1'))(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var rp=require(_0xc4e5('0x5'));var fs=require('fs');var path=require(_0xc4e5('0x6'));var rimraf=require(_0xc4e5('0x7'));var config=require('../../config/environment');var attributes=require(_0xc4e5('0x8'));module[_0xc4e5('0x9')]=function(_0x1c777d,_0x1cfd06){return _0x1c777d[_0xc4e5('0xa')](_0xc4e5('0xb'),attributes,{'tableName':_0xc4e5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc4e5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86c0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x352443,_0x5be76c){var _0xd8fd68=function(_0x631cf0){while(--_0x631cf0){_0x352443['push'](_0x352443['shift']());}};_0xd8fd68(++_0x5be76c);}(_0x86c0,0x1a4));var _0x086c=function(_0x30165a,_0x11cb30){_0x30165a=_0x30165a-0x0;var _0x3e44eb=_0x86c0[_0x30165a];return _0x3e44eb;};'use strict';var _=require('lodash');var util=require(_0x086c('0x0'));var logger=require(_0x086c('0x1'))(_0x086c('0x2'));var moment=require(_0x086c('0x3'));var BPromise=require(_0x086c('0x4'));var rp=require(_0x086c('0x5'));var fs=require('fs');var path=require(_0x086c('0x6'));var rimraf=require(_0x086c('0x7'));var config=require('../../config/environment');var attributes=require(_0x086c('0x8'));module['exports']=function(_0x2d7dda,_0x5d2aa3){return _0x2d7dda['define'](_0x086c('0x9'),attributes,{'tableName':_0x086c('0xa'),'paranoid':![],'indexes':[{'name':_0x086c('0xb'),'fields':[_0x086c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 79300f6..62353d9 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 _0x7b27=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x7b27,0x186));var _0x77b2=function(_0x4eb44d,_0x487d97){_0x4eb44d=_0x4eb44d-0x0;var _0x3c5226=_0x7b27[_0x4eb44d];return _0x3c5226;};'use strict';var _=require(_0x77b2('0x0'));var util=require('util');var moment=require(_0x77b2('0x1'));var BPromise=require(_0x77b2('0x2'));var rs=require(_0x77b2('0x3'));var fs=require('fs');var Redis=require(_0x77b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b2('0x5'));var logger=require(_0x77b2('0x6'))('rpc');var config=require(_0x77b2('0x7'));var jayson=require(_0x77b2('0x8'));var client=jayson[_0x77b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bdcf,_0x2a97d8,_0x2f01a2){return new BPromise(function(_0x1308f7,_0x5139eb){return client[_0x77b2('0xa')](_0x22bdcf,_0x2f01a2)[_0x77b2('0xb')](function(_0x734122){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x2a97d8,_0x77b2('0xe'));logger[_0x77b2('0xf')](_0x77b2('0x10'),_0x2a97d8,'request\x20sent',JSON[_0x77b2('0x11')](_0x734122));if(_0x734122[_0x77b2('0x12')]){if(_0x734122['error'][_0x77b2('0x13')]===0x1f4){logger['error'](_0x77b2('0xd'),_0x2a97d8,_0x734122[_0x77b2('0x12')]['message']);return _0x5139eb(_0x734122[_0x77b2('0x12')]['message']);}logger[_0x77b2('0x12')](_0x77b2('0xd'),_0x2a97d8,_0x734122[_0x77b2('0x12')][_0x77b2('0x14')]);return _0x1308f7(_0x734122[_0x77b2('0x12')][_0x77b2('0x14')]);}else{logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x2a97d8,_0x77b2('0xe'));_0x1308f7(_0x734122['result']['message']);}})[_0x77b2('0x15')](function(_0x2a85a3){logger[_0x77b2('0x12')](_0x77b2('0xd'),_0x2a97d8,_0x2a85a3);_0x5139eb(_0x2a85a3);});});} \ No newline at end of file +var _0x2494=['../../config/utils','../../config/environment','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x489639,_0x1da4f6){var _0x481ed8=function(_0x13f8ca){while(--_0x13f8ca){_0x489639['push'](_0x489639['shift']());}};_0x481ed8(++_0x1da4f6);}(_0x2494,0x82));var _0x4249=function(_0x2d5131,_0x13e3c5){_0x2d5131=_0x2d5131-0x0;var _0x115dd6=_0x2494[_0x2d5131];return _0x115dd6;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3b30d59..0c99717 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 _0x4252=['../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4252,0x89));var _0x2425=function(_0x2adbe6,_0x50e5f2){_0x2adbe6=_0x2adbe6-0x0;var _0x25e22a=_0x4252[_0x2adbe6];return _0x25e22a;};'use strict';var multer=require(_0x2425('0x0'));var util=require(_0x2425('0x1'));var path=require(_0x2425('0x2'));var timeout=require(_0x2425('0x3'));var express=require(_0x2425('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2425('0x5'));var interaction=require(_0x2425('0x6'));var config=require(_0x2425('0x7'));var controller=require(_0x2425('0x8'));router[_0x2425('0x9')]('/',auth['isAuthenticated'](),controller[_0x2425('0xa')]);router[_0x2425('0x9')](_0x2425('0xb'),auth[_0x2425('0xc')](),controller['show']);router['post']('/',auth[_0x2425('0xc')](),controller[_0x2425('0xd')]);router[_0x2425('0xe')]('/:id',auth[_0x2425('0xc')](),controller['update']);router[_0x2425('0xf')](_0x2425('0xb'),auth[_0x2425('0xc')](),controller[_0x2425('0x10')]);module[_0x2425('0x11')]=router; \ No newline at end of file +var _0xe864=['/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe864,0x1ac));var _0x4e86=function(_0x485984,_0x5842d4){_0x485984=_0x485984-0x0;var _0x2586cb=_0xe864[_0x485984];return _0x2586cb;};'use strict';var multer=require(_0x4e86('0x0'));var util=require(_0x4e86('0x1'));var path=require(_0x4e86('0x2'));var timeout=require(_0x4e86('0x3'));var express=require(_0x4e86('0x4'));var router=express[_0x4e86('0x5')]();var fs_extra=require(_0x4e86('0x6'));var auth=require(_0x4e86('0x7'));var interaction=require(_0x4e86('0x8'));var config=require(_0x4e86('0x9'));var controller=require('./pause.controller');router[_0x4e86('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e86('0xb')]);router[_0x4e86('0xa')](_0x4e86('0xc'),auth['isAuthenticated'](),controller[_0x4e86('0xd')]);router[_0x4e86('0xe')]('/',auth['isAuthenticated'](),controller[_0x4e86('0xf')]);router[_0x4e86('0x10')](_0x4e86('0xc'),auth[_0x4e86('0x11')](),controller[_0x4e86('0x12')]);router[_0x4e86('0x13')]('/:id',auth[_0x4e86('0x11')](),controller[_0x4e86('0x14')]);module[_0x4e86('0x15')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f5b50c4..9fcf785 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 _0x8640=['STRING','exports'];(function(_0x217685,_0x469d3a){var _0x6729f5=function(_0x2ef9d5){while(--_0x2ef9d5){_0x217685['push'](_0x217685['shift']());}};_0x6729f5(++_0x469d3a);}(_0x8640,0x173));var _0x0864=function(_0x4b70a1,_0xd46827){_0x4b70a1=_0x4b70a1-0x0;var _0x2583b9=_0x8640[_0x4b70a1];return _0x2583b9;};'use strict';var Sequelize=require('sequelize');module[_0x0864('0x0')]={'name':{'type':Sequelize[_0x0864('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0864('0x1')]}}; \ No newline at end of file +var _0x0944=['sequelize','exports','STRING','name'];(function(_0x3b9a4b,_0xec3ca2){var _0x46cada=function(_0x2b2865){while(--_0x2b2865){_0x3b9a4b['push'](_0x3b9a4b['shift']());}};_0x46cada(++_0xec3ca2);}(_0x0944,0xcc));var _0x4094=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x0944[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require(_0x4094('0x0'));module[_0x4094('0x1')]={'name':{'type':Sequelize[_0x4094('0x2')],'unique':_0x4094('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4094('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 22dfd04..8014bc2 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 _0xc69b=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Pause','findAll','rows','show','params','catch','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x705d4d,_0x18ca88){var _0x46b820=function(_0x446d45){while(--_0x446d45){_0x705d4d['push'](_0x705d4d['shift']());}};_0x46b820(++_0x18ca88);}(_0xc69b,0xc5));var _0xbc69=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xc69b[_0x4b4d43];return _0x5706ba;};'use strict';var emlformat=require(_0xbc69('0x0'));var rimraf=require(_0xbc69('0x1'));var zipdir=require(_0xbc69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc69('0x3'));var moment=require(_0xbc69('0x4'));var BPromise=require(_0xbc69('0x5'));var Mustache=require(_0xbc69('0x6'));var util=require(_0xbc69('0x7'));var path=require(_0xbc69('0x8'));var sox=require('sox');var csv=require(_0xbc69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc69('0xa'));var _=require(_0xbc69('0xb'));var squel=require(_0xbc69('0xc'));var crypto=require(_0xbc69('0xd'));var jsforce=require(_0xbc69('0xe'));var deskjs=require(_0xbc69('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbc69('0x10'));var Redis=require(_0xbc69('0x11'));var authService=require(_0xbc69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc69('0x13'));var hardwareService=require(_0xbc69('0x14'));var logger=require(_0xbc69('0x15'))(_0xbc69('0x16'));var utils=require(_0xbc69('0x17'));var config=require(_0xbc69('0x18'));var licenseUtil=require(_0xbc69('0x19'));var db=require(_0xbc69('0x1a'))['db'];function respondWithStatusCode(_0x338a19,_0x4e78ec){_0x4e78ec=_0x4e78ec||0xcc;return function(_0x5c6f8f){if(_0x5c6f8f){return _0x338a19[_0xbc69('0x1b')](_0x4e78ec);}return _0x338a19[_0xbc69('0x1c')](_0x4e78ec)[_0xbc69('0x1d')]();};}function respondWithResult(_0x514528,_0x2a18f6){_0x2a18f6=_0x2a18f6||0xc8;return function(_0x3685b8){if(_0x3685b8){return _0x514528[_0xbc69('0x1c')](_0x2a18f6)[_0xbc69('0x1e')](_0x3685b8);}};}function respondWithFilteredResult(_0x45a115,_0xe421bb){return function(_0x377b6a){if(_0x377b6a){var _0x301d73=typeof _0xe421bb[_0xbc69('0x1f')]===_0xbc69('0x20')&&typeof _0xe421bb[_0xbc69('0x21')]==='undefined';var _0x319e1d=_0x377b6a[_0xbc69('0x22')];var _0x4de3c7=_0x301d73?0x0:_0xe421bb['offset'];var _0x302f27=_0x301d73?_0x377b6a[_0xbc69('0x22')]:_0xe421bb[_0xbc69('0x1f')]+_0xe421bb[_0xbc69('0x21')];var _0x2481a7;if(_0x302f27>=_0x319e1d){_0x302f27=_0x319e1d;_0x2481a7=0xc8;}else{_0x2481a7=0xce;}_0x45a115[_0xbc69('0x1c')](_0x2481a7);return _0x45a115[_0xbc69('0x23')](_0xbc69('0x24'),_0x4de3c7+'-'+_0x302f27+'/'+_0x319e1d)[_0xbc69('0x1e')](_0x377b6a);}return null;};}function patchUpdates(_0x5dcb00){return function(_0x13e5a6){try{jsonpatch[_0xbc69('0x25')](_0x13e5a6,_0x5dcb00,!![]);}catch(_0x2711e2){return BPromise['reject'](_0x2711e2);}return _0x13e5a6[_0xbc69('0x26')]();};}function saveUpdates(_0x4e7efa,_0x1efa2f){return function(_0x26e934){if(_0x26e934){return _0x26e934[_0xbc69('0x27')](_0x4e7efa)[_0xbc69('0x28')](function(_0x4111d4){return _0x4111d4;});}return null;};}function removeEntity(_0x3e8b60,_0x1f27da){return function(_0x73aac0){if(_0x73aac0){return _0x73aac0[_0xbc69('0x29')]()[_0xbc69('0x28')](function(){var _0x4a3d07=_0x73aac0[_0xbc69('0x2a')]({'plain':!![]});var _0x302742=_0xbc69('0x2b');return db[_0xbc69('0x2c')][_0xbc69('0x29')]({'where':{'type':_0x302742,'resourceId':_0x4a3d07['id']}})[_0xbc69('0x28')](function(){return _0x73aac0;});})[_0xbc69('0x28')](function(){_0x3e8b60['status'](0xcc)[_0xbc69('0x1d')]();});}};}function handleEntityNotFound(_0x3ac656,_0x275913){return function(_0x598740){if(!_0x598740){_0x3ac656[_0xbc69('0x1b')](0x194);}return _0x598740;};}function handleError(_0x2bf11b,_0x37ec67){_0x37ec67=_0x37ec67||0x1f4;return function(_0x59263f){logger[_0xbc69('0x2d')](_0x59263f['stack']);if(_0x59263f[_0xbc69('0x2e')]){delete _0x59263f[_0xbc69('0x2e')];}_0x2bf11b[_0xbc69('0x1c')](_0x37ec67)['send'](_0x59263f);};}exports[_0xbc69('0x2f')]=function(_0x3d39ee,_0x41af3d){var _0x2ffcc7={},_0x376525={},_0x292e11={'count':0x0,'rows':[]};var _0x51c2cb=_[_0xbc69('0x30')](db['Pause'][_0xbc69('0x31')],function(_0x26df51){return{'name':_0x26df51[_0xbc69('0x32')],'type':_0x26df51[_0xbc69('0x33')][_0xbc69('0x34')]};});_0x376525[_0xbc69('0x35')]=_[_0xbc69('0x30')](_0x51c2cb,_0xbc69('0x2e'));_0x376525[_0xbc69('0x36')]=_[_0xbc69('0x37')](_0x3d39ee[_0xbc69('0x36')]);_0x376525[_0xbc69('0x38')]=_[_0xbc69('0x39')](_0x376525[_0xbc69('0x35')],_0x376525['query']);_0x2ffcc7[_0xbc69('0x3a')]=_[_0xbc69('0x39')](_0x376525[_0xbc69('0x35')],qs[_0xbc69('0x3b')](_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x3b')]));_0x2ffcc7[_0xbc69('0x3a')]=_0x2ffcc7[_0xbc69('0x3a')][_0xbc69('0x3c')]?_0x2ffcc7['attributes']:_0x376525[_0xbc69('0x35')];if(!_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x3d')](_0xbc69('0x3e'))){_0x2ffcc7[_0xbc69('0x21')]=qs[_0xbc69('0x21')](_0x3d39ee[_0xbc69('0x36')]['limit']);_0x2ffcc7['offset']=qs[_0xbc69('0x1f')](_0x3d39ee['query'][_0xbc69('0x1f')]);}_0x2ffcc7[_0xbc69('0x3f')]=qs[_0xbc69('0x40')](_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x40')]);_0x2ffcc7[_0xbc69('0x41')]=qs['filters'](_[_0xbc69('0x42')](_0x3d39ee['query'],_0x376525[_0xbc69('0x38')]),_0x51c2cb);if(_0x3d39ee['query']['filter']){_0x2ffcc7[_0xbc69('0x41')]=_[_0xbc69('0x43')](_0x2ffcc7[_0xbc69('0x41')],{'$or':_[_0xbc69('0x30')](_0x51c2cb,function(_0x1fde35){if(_0x1fde35[_0xbc69('0x33')]!==_0xbc69('0x44')){var _0x10680c={};_0x10680c[_0x1fde35[_0xbc69('0x2e')]]={'$like':'%'+_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x45')]+'%'};return _0x10680c;}})});}_0x2ffcc7=_['merge']({},_0x2ffcc7,_0x3d39ee[_0xbc69('0x46')]);var _0x557299={'where':_0x2ffcc7[_0xbc69('0x41')]};return db['Pause'][_0xbc69('0x22')](_0x557299)[_0xbc69('0x28')](function(_0x2743b1){_0x292e11[_0xbc69('0x22')]=_0x2743b1;if(_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x47')]){_0x2ffcc7[_0xbc69('0x48')]=[{'all':!![]}];}return db[_0xbc69('0x49')][_0xbc69('0x4a')](_0x2ffcc7);})[_0xbc69('0x28')](function(_0x2f6136){_0x292e11[_0xbc69('0x4b')]=_0x2f6136;return _0x292e11;})['then'](respondWithFilteredResult(_0x41af3d,_0x2ffcc7))['catch'](handleError(_0x41af3d,null));};exports[_0xbc69('0x4c')]=function(_0x173961,_0xb792a4){var _0x38c811={'raw':!![],'where':{'id':_0x173961[_0xbc69('0x4d')]['id']}},_0x44d52d={};_0x44d52d[_0xbc69('0x35')]=_['keys'](db[_0xbc69('0x49')]['rawAttributes']);_0x44d52d[_0xbc69('0x36')]=_['keys'](_0x173961[_0xbc69('0x36')]);_0x44d52d['filters']=_[_0xbc69('0x39')](_0x44d52d[_0xbc69('0x35')],_0x44d52d[_0xbc69('0x36')]);_0x38c811[_0xbc69('0x3a')]=_['intersection'](_0x44d52d[_0xbc69('0x35')],qs[_0xbc69('0x3b')](_0x173961['query'][_0xbc69('0x3b')]));_0x38c811[_0xbc69('0x3a')]=_0x38c811[_0xbc69('0x3a')][_0xbc69('0x3c')]?_0x38c811[_0xbc69('0x3a')]:_0x44d52d[_0xbc69('0x35')];if(_0x173961[_0xbc69('0x36')][_0xbc69('0x47')]){_0x38c811[_0xbc69('0x48')]=[{'all':!![]}];}_0x38c811=_[_0xbc69('0x43')]({},_0x38c811,_0x173961['options']);return db[_0xbc69('0x49')]['find'](_0x38c811)[_0xbc69('0x28')](handleEntityNotFound(_0xb792a4,null))[_0xbc69('0x28')](respondWithResult(_0xb792a4,null))[_0xbc69('0x4e')](handleError(_0xb792a4,null));};exports[_0xbc69('0x4f')]=function(_0x24112e,_0x31217c){return db[_0xbc69('0x49')]['create'](_0x24112e['body'],{})[_0xbc69('0x28')](function(_0x21f7ab){var _0xbc6b95=_0x24112e[_0xbc69('0x50')][_0xbc69('0x2a')]({'plain':!![]});if(!_0xbc6b95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbc6b95[_0xbc69('0x51')]===_0xbc69('0x50')){var _0x20be14=_0x21f7ab['get']({'plain':!![]});var _0x5d081d=_0xbc69('0x2b');return db[_0xbc69('0x52')][_0xbc69('0x53')]({'where':{'name':_0x5d081d,'userProfileId':_0xbc6b95[_0xbc69('0x54')]},'raw':!![]})[_0xbc69('0x28')](function(_0x4a60cc){if(_0x4a60cc&&_0x4a60cc['autoAssociation']===0x0){return db[_0xbc69('0x2c')][_0xbc69('0x4f')]({'name':_0x20be14['name'],'resourceId':_0x20be14['id'],'type':_0x4a60cc['name'],'sectionId':_0x4a60cc['id']},{})['then'](function(){return _0x21f7ab;});}else{return _0x21f7ab;}})[_0xbc69('0x4e')](function(_0x38d4b2){logger[_0xbc69('0x2d')](_0xbc69('0x55'),_0x38d4b2);throw _0x38d4b2;});}return _0x21f7ab;})[_0xbc69('0x28')](respondWithResult(_0x31217c,0xc9))[_0xbc69('0x4e')](handleError(_0x31217c,null));};exports[_0xbc69('0x27')]=function(_0x55cb46,_0x210e9f){if(_0x55cb46[_0xbc69('0x56')]['id']){delete _0x55cb46[_0xbc69('0x56')]['id'];}return db['Pause'][_0xbc69('0x53')]({'where':{'id':_0x55cb46[_0xbc69('0x4d')]['id']}})['then'](handleEntityNotFound(_0x210e9f,null))[_0xbc69('0x28')](saveUpdates(_0x55cb46[_0xbc69('0x56')],null))[_0xbc69('0x28')](respondWithResult(_0x210e9f,null))[_0xbc69('0x4e')](handleError(_0x210e9f,null));};exports[_0xbc69('0x29')]=function(_0x526843,_0x56ca6e){return db['Pause'][_0xbc69('0x53')]({'where':{'id':_0x526843[_0xbc69('0x4d')]['id']}})[_0xbc69('0x28')](handleEntityNotFound(_0x56ca6e,null))[_0xbc69('0x28')](removeEntity(_0x56ca6e,null))[_0xbc69('0x4e')](handleError(_0x56ca6e,null));}; \ No newline at end of file +var _0xca15=['Pauses','UserProfileResource','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','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','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','then','destroy'];(function(_0x278646,_0x25736a){var _0x1bba75=function(_0x5ca68a){while(--_0x5ca68a){_0x278646['push'](_0x278646['shift']());}};_0x1bba75(++_0x25736a);}(_0xca15,0x81));var _0x5ca1=function(_0x181aa4,_0x59aaca){_0x181aa4=_0x181aa4-0x0;var _0x3ac631=_0xca15[_0x181aa4];return _0x3ac631;};'use strict';var emlformat=require(_0x5ca1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ca1('0x1'));var jsonpatch=require(_0x5ca1('0x2'));var rp=require(_0x5ca1('0x3'));var moment=require(_0x5ca1('0x4'));var BPromise=require(_0x5ca1('0x5'));var Mustache=require(_0x5ca1('0x6'));var util=require(_0x5ca1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5ca1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ca1('0x9'));var _=require(_0x5ca1('0xa'));var squel=require(_0x5ca1('0xb'));var crypto=require(_0x5ca1('0xc'));var jsforce=require(_0x5ca1('0xd'));var deskjs=require(_0x5ca1('0xe'));var toCsv=require(_0x5ca1('0x8'));var querystring=require('querystring');var Papa=require(_0x5ca1('0xf'));var Redis=require(_0x5ca1('0x10'));var authService=require(_0x5ca1('0x11'));var qs=require(_0x5ca1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ca1('0x13'));var logger=require(_0x5ca1('0x14'))(_0x5ca1('0x15'));var utils=require(_0x5ca1('0x16'));var config=require(_0x5ca1('0x17'));var licenseUtil=require(_0x5ca1('0x18'));var db=require(_0x5ca1('0x19'))['db'];function respondWithStatusCode(_0x1ad692,_0x286a27){_0x286a27=_0x286a27||0xcc;return function(_0x505951){if(_0x505951){return _0x1ad692[_0x5ca1('0x1a')](_0x286a27);}return _0x1ad692['status'](_0x286a27)[_0x5ca1('0x1b')]();};}function respondWithResult(_0x3ab522,_0x1ee24e){_0x1ee24e=_0x1ee24e||0xc8;return function(_0x28f5c3){if(_0x28f5c3){return _0x3ab522['status'](_0x1ee24e)[_0x5ca1('0x1c')](_0x28f5c3);}};}function respondWithFilteredResult(_0x54bac0,_0x49708e){return function(_0x4ebe74){if(_0x4ebe74){var _0x45f240=typeof _0x49708e[_0x5ca1('0x1d')]===_0x5ca1('0x1e')&&typeof _0x49708e[_0x5ca1('0x1f')]===_0x5ca1('0x1e');var _0x2c91ad=_0x4ebe74[_0x5ca1('0x20')];var _0x4c417c=_0x45f240?0x0:_0x49708e[_0x5ca1('0x1d')];var _0x3c34d2=_0x45f240?_0x4ebe74[_0x5ca1('0x20')]:_0x49708e[_0x5ca1('0x1d')]+_0x49708e[_0x5ca1('0x1f')];var _0x144b15;if(_0x3c34d2>=_0x2c91ad){_0x3c34d2=_0x2c91ad;_0x144b15=0xc8;}else{_0x144b15=0xce;}_0x54bac0[_0x5ca1('0x21')](_0x144b15);return _0x54bac0['set'](_0x5ca1('0x22'),_0x4c417c+'-'+_0x3c34d2+'/'+_0x2c91ad)[_0x5ca1('0x1c')](_0x4ebe74);}return null;};}function patchUpdates(_0x525252){return function(_0x53b38b){try{jsonpatch[_0x5ca1('0x23')](_0x53b38b,_0x525252,!![]);}catch(_0x32ff6d){return BPromise[_0x5ca1('0x24')](_0x32ff6d);}return _0x53b38b['save']();};}function saveUpdates(_0x2c8987,_0x891064){return function(_0x2f84b7){if(_0x2f84b7){return _0x2f84b7['update'](_0x2c8987)[_0x5ca1('0x25')](function(_0x24162d){return _0x24162d;});}return null;};}function removeEntity(_0x348d87,_0x103813){return function(_0x50a36c){if(_0x50a36c){return _0x50a36c[_0x5ca1('0x26')]()[_0x5ca1('0x25')](function(){var _0x3089ea=_0x50a36c['get']({'plain':!![]});var _0x46a5aa=_0x5ca1('0x27');return db[_0x5ca1('0x28')][_0x5ca1('0x26')]({'where':{'type':_0x46a5aa,'resourceId':_0x3089ea['id']}})[_0x5ca1('0x25')](function(){return _0x50a36c;});})[_0x5ca1('0x25')](function(){_0x348d87[_0x5ca1('0x21')](0xcc)[_0x5ca1('0x1b')]();});}};}function handleEntityNotFound(_0x43c541,_0x3fc2ac){return function(_0x165cad){if(!_0x165cad){_0x43c541['sendStatus'](0x194);}return _0x165cad;};}function handleError(_0x228298,_0x1e4d0c){_0x1e4d0c=_0x1e4d0c||0x1f4;return function(_0x2ff4f2){logger['error'](_0x2ff4f2['stack']);if(_0x2ff4f2[_0x5ca1('0x29')]){delete _0x2ff4f2[_0x5ca1('0x29')];}_0x228298[_0x5ca1('0x21')](_0x1e4d0c)[_0x5ca1('0x2a')](_0x2ff4f2);};}exports[_0x5ca1('0x2b')]=function(_0x418fd7,_0x1b707e){var _0x45124e={},_0x1012f7={},_0x1ccfce={'count':0x0,'rows':[]};var _0x340515=_[_0x5ca1('0x2c')](db[_0x5ca1('0x2d')][_0x5ca1('0x2e')],function(_0x33e8e2){return{'name':_0x33e8e2[_0x5ca1('0x2f')],'type':_0x33e8e2[_0x5ca1('0x30')][_0x5ca1('0x31')]};});_0x1012f7[_0x5ca1('0x32')]=_[_0x5ca1('0x2c')](_0x340515,'name');_0x1012f7[_0x5ca1('0x33')]=_[_0x5ca1('0x34')](_0x418fd7[_0x5ca1('0x33')]);_0x1012f7[_0x5ca1('0x35')]=_['intersection'](_0x1012f7[_0x5ca1('0x32')],_0x1012f7['query']);_0x45124e[_0x5ca1('0x36')]=_[_0x5ca1('0x37')](_0x1012f7[_0x5ca1('0x32')],qs['fields'](_0x418fd7[_0x5ca1('0x33')][_0x5ca1('0x38')]));_0x45124e[_0x5ca1('0x36')]=_0x45124e[_0x5ca1('0x36')][_0x5ca1('0x39')]?_0x45124e[_0x5ca1('0x36')]:_0x1012f7['model'];if(!_0x418fd7[_0x5ca1('0x33')][_0x5ca1('0x3a')](_0x5ca1('0x3b'))){_0x45124e[_0x5ca1('0x1f')]=qs['limit'](_0x418fd7['query'][_0x5ca1('0x1f')]);_0x45124e[_0x5ca1('0x1d')]=qs[_0x5ca1('0x1d')](_0x418fd7[_0x5ca1('0x33')][_0x5ca1('0x1d')]);}_0x45124e['order']=qs['sort'](_0x418fd7[_0x5ca1('0x33')][_0x5ca1('0x3c')]);_0x45124e[_0x5ca1('0x3d')]=qs[_0x5ca1('0x35')](_['pick'](_0x418fd7[_0x5ca1('0x33')],_0x1012f7['filters']),_0x340515);if(_0x418fd7[_0x5ca1('0x33')][_0x5ca1('0x3e')]){_0x45124e[_0x5ca1('0x3d')]=_[_0x5ca1('0x3f')](_0x45124e[_0x5ca1('0x3d')],{'$or':_[_0x5ca1('0x2c')](_0x340515,function(_0x3f46a2){if(_0x3f46a2[_0x5ca1('0x30')]!==_0x5ca1('0x40')){var _0x8fd84d={};_0x8fd84d[_0x3f46a2[_0x5ca1('0x29')]]={'$like':'%'+_0x418fd7[_0x5ca1('0x33')]['filter']+'%'};return _0x8fd84d;}})});}_0x45124e=_[_0x5ca1('0x3f')]({},_0x45124e,_0x418fd7[_0x5ca1('0x41')]);var _0x38dd7e={'where':_0x45124e[_0x5ca1('0x3d')]};return db[_0x5ca1('0x2d')][_0x5ca1('0x20')](_0x38dd7e)[_0x5ca1('0x25')](function(_0x3c8fed){_0x1ccfce[_0x5ca1('0x20')]=_0x3c8fed;if(_0x418fd7[_0x5ca1('0x33')]['includeAll']){_0x45124e['include']=[{'all':!![]}];}return db[_0x5ca1('0x2d')][_0x5ca1('0x42')](_0x45124e);})[_0x5ca1('0x25')](function(_0x1e4fe2){_0x1ccfce[_0x5ca1('0x43')]=_0x1e4fe2;return _0x1ccfce;})[_0x5ca1('0x25')](respondWithFilteredResult(_0x1b707e,_0x45124e))[_0x5ca1('0x44')](handleError(_0x1b707e,null));};exports[_0x5ca1('0x45')]=function(_0x3157d1,_0x56f962){var _0xf59fe2={'raw':!![],'where':{'id':_0x3157d1[_0x5ca1('0x46')]['id']}},_0x54b813={};_0x54b813[_0x5ca1('0x32')]=_[_0x5ca1('0x34')](db['Pause'][_0x5ca1('0x2e')]);_0x54b813[_0x5ca1('0x33')]=_[_0x5ca1('0x34')](_0x3157d1['query']);_0x54b813[_0x5ca1('0x35')]=_['intersection'](_0x54b813[_0x5ca1('0x32')],_0x54b813[_0x5ca1('0x33')]);_0xf59fe2[_0x5ca1('0x36')]=_[_0x5ca1('0x37')](_0x54b813[_0x5ca1('0x32')],qs['fields'](_0x3157d1[_0x5ca1('0x33')]['fields']));_0xf59fe2[_0x5ca1('0x36')]=_0xf59fe2[_0x5ca1('0x36')]['length']?_0xf59fe2[_0x5ca1('0x36')]:_0x54b813[_0x5ca1('0x32')];if(_0x3157d1[_0x5ca1('0x33')][_0x5ca1('0x47')]){_0xf59fe2[_0x5ca1('0x48')]=[{'all':!![]}];}_0xf59fe2=_[_0x5ca1('0x3f')]({},_0xf59fe2,_0x3157d1[_0x5ca1('0x41')]);return db[_0x5ca1('0x2d')]['find'](_0xf59fe2)[_0x5ca1('0x25')](handleEntityNotFound(_0x56f962,null))[_0x5ca1('0x25')](respondWithResult(_0x56f962,null))['catch'](handleError(_0x56f962,null));};exports[_0x5ca1('0x49')]=function(_0x5dc58d,_0x16d734){return db['Pause'][_0x5ca1('0x49')](_0x5dc58d[_0x5ca1('0x4a')],{})[_0x5ca1('0x25')](function(_0x35bb2b){var _0x882ee8=_0x5dc58d[_0x5ca1('0x4b')]['get']({'plain':!![]});if(!_0x882ee8)throw new Error(_0x5ca1('0x4c'));if(_0x882ee8[_0x5ca1('0x4d')]===_0x5ca1('0x4b')){var _0x59357e=_0x35bb2b[_0x5ca1('0x4e')]({'plain':!![]});var _0x518916=_0x5ca1('0x27');return db['UserProfileSection'][_0x5ca1('0x4f')]({'where':{'name':_0x518916,'userProfileId':_0x882ee8[_0x5ca1('0x50')]},'raw':!![]})['then'](function(_0x5d7bbc){if(_0x5d7bbc&&_0x5d7bbc['autoAssociation']===0x0){return db[_0x5ca1('0x28')][_0x5ca1('0x49')]({'name':_0x59357e['name'],'resourceId':_0x59357e['id'],'type':_0x5d7bbc[_0x5ca1('0x29')],'sectionId':_0x5d7bbc['id']},{})['then'](function(){return _0x35bb2b;});}else{return _0x35bb2b;}})['catch'](function(_0xe4a0f4){logger[_0x5ca1('0x51')](_0x5ca1('0x52'),_0xe4a0f4);throw _0xe4a0f4;});}return _0x35bb2b;})[_0x5ca1('0x25')](respondWithResult(_0x16d734,0xc9))['catch'](handleError(_0x16d734,null));};exports[_0x5ca1('0x53')]=function(_0x3610e0,_0x4005e1){if(_0x3610e0[_0x5ca1('0x4a')]['id']){delete _0x3610e0[_0x5ca1('0x4a')]['id'];}return db[_0x5ca1('0x2d')][_0x5ca1('0x4f')]({'where':{'id':_0x3610e0[_0x5ca1('0x46')]['id']}})[_0x5ca1('0x25')](handleEntityNotFound(_0x4005e1,null))['then'](saveUpdates(_0x3610e0[_0x5ca1('0x4a')],null))['then'](respondWithResult(_0x4005e1,null))[_0x5ca1('0x44')](handleError(_0x4005e1,null));};exports[_0x5ca1('0x26')]=function(_0x590c1e,_0x74ea70){return db[_0x5ca1('0x2d')][_0x5ca1('0x4f')]({'where':{'id':_0x590c1e['params']['id']}})[_0x5ca1('0x25')](handleEntityNotFound(_0x74ea70,null))[_0x5ca1('0x25')](removeEntity(_0x74ea70,null))['catch'](handleError(_0x74ea70,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9d714eb..e346b4c 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 _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x47643c,_0x184b8e){var _0x3b8c81=function(_0x315d93){while(--_0x315d93){_0x47643c['push'](_0x47643c['shift']());}};_0x3b8c81(++_0x184b8e);}(_0x814b,0x1a2));var _0xb814=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x814b[_0xc20f22];return _0x1535d5;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'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 aac932a..c204dd4 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(_0x593c77,_0x3d2402){var _0x3a251f=function(_0x3ebbcf){while(--_0x3ebbcf){_0x593c77['push'](_0x593c77['shift']());}};_0x3a251f(++_0x3d2402);}(_0x7a54,0x106));var _0x47a5=function(_0x3a628e,_0x55e6a2){_0x3a628e=_0x3a628e-0x0;var _0x50cd40=_0x7a54[_0x3a628e];return _0x50cd40;};'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 _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(_0x1a4d07,_0x391cb3){var _0x5c605a=function(_0x16d3a6){while(--_0x16d3a6){_0x1a4d07['push'](_0x1a4d07['shift']());}};_0x5c605a(++_0x391cb3);}(_0x7a54,0x106));var _0x47a5=function(_0x1550eb,_0x21e62f){_0x1550eb=_0x1550eb-0x0;var _0x32f592=_0x7a54[_0x1550eb];return _0x32f592;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index efc1f94..9185b18 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 _0xd13e=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','extname','post','single','file','upload','webhookPost','put','update','delete'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xd13e,0x193));var _0xed13=function(_0xc8fedd,_0xa27384){_0xc8fedd=_0xc8fedd-0x0;var _0x36f617=_0xd13e[_0xc8fedd];return _0x36f617;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),controller[_0xed13('0xa')]);router[_0xed13('0x8')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0xd')]);router[_0xed13('0x8')](_0xed13('0xe'),auth['isAuthenticated'](),controller[_0xed13('0xf')]);var upload=multer({'storage':multer[_0xed13('0x10')]({'destination':function(_0x11adaf,_0x39575c,_0x2b290c){_0x2b290c(null,path['join'](config[_0xed13('0x11')],_0xed13('0x12')));},'filename':function(_0x2c68db,_0x3c0b22,_0x936103){_0x3c0b22[_0xed13('0x13')]=_0x3c0b22['originalname'][_0xed13('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x936103(null,util['format'](_0xed13('0x15'),path['basename'](_0x3c0b22[_0xed13('0x13')],path['extname'](_0x3c0b22[_0xed13('0x13')])),Date['now'](),path[_0xed13('0x16')](_0x3c0b22[_0xed13('0x13')])));}})});router[_0xed13('0x17')]('/',upload[_0xed13('0x18')](_0xed13('0x19')),controller[_0xed13('0x1a')]);router[_0xed13('0x17')](_0xed13('0x9'),controller[_0xed13('0x1b')]);router[_0xed13('0x1c')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0x1d')]);router[_0xed13('0x1e')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x0b78=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','isAuthenticated','update','delete','exports'];(function(_0x80ad87,_0x1a90be){var _0x1dbbe0=function(_0x28600b){while(--_0x28600b){_0x80ad87['push'](_0x80ad87['shift']());}};_0x1dbbe0(++_0x1a90be);}(_0x0b78,0x1ad));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var path=require('path');var timeout=require(_0x80b7('0x2'));var express=require(_0x80b7('0x3'));var router=express['Router']();var fs_extra=require(_0x80b7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var controller=require(_0x80b7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x80b7('0x8')]);router['get'](_0x80b7('0x9'),controller[_0x80b7('0xa')]);router[_0x80b7('0xb')](_0x80b7('0xc'),auth['isAuthenticated'](),controller[_0x80b7('0xd')]);router[_0x80b7('0xb')](_0x80b7('0xe'),auth['isAuthenticated'](),controller[_0x80b7('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b1a00,_0x4599c1,_0x3b19da){_0x3b19da(null,path[_0x80b7('0x10')](config[_0x80b7('0x11')],_0x80b7('0x12')));},'filename':function(_0x3f8c16,_0x145241,_0x323d06){_0x145241[_0x80b7('0x13')]=_0x145241[_0x80b7('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d06(null,util[_0x80b7('0x14')](_0x80b7('0x15'),path['basename'](_0x145241[_0x80b7('0x13')],path[_0x80b7('0x16')](_0x145241['originalname'])),Date[_0x80b7('0x17')](),path[_0x80b7('0x16')](_0x145241[_0x80b7('0x13')])));}})});router[_0x80b7('0x18')]('/',upload[_0x80b7('0x19')](_0x80b7('0x1a')),controller[_0x80b7('0x1b')]);router[_0x80b7('0x18')](_0x80b7('0x9'),controller[_0x80b7('0x1c')]);router['put'](_0x80b7('0xc'),auth[_0x80b7('0x1d')](),controller[_0x80b7('0x1e')]);router[_0x80b7('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x80b7('0x1f')]);module[_0x80b7('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 92eb47d..c6af4aa 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 _0x479f=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','BOOLEAN','adminOnly','always'];(function(_0x2c383c,_0x4eeb61){var _0x24055e=function(_0x5aeee4){while(--_0x5aeee4){_0x2c383c['push'](_0x2c383c['shift']());}};_0x24055e(++_0x4eeb61);}(_0x479f,0x1a5));var _0xf479=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x479f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf479('0x0'));module[_0xf479('0x1')]={'name':{'type':Sequelize[_0xf479('0x2')]},'type':{'type':Sequelize[_0xf479('0x3')](_0xf479('0x4'),_0xf479('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xf479('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xf479('0x7'),'agentOnly',_0xf479('0x8'),'never'),'defaultValue':'always','comment':_0xf479('0x9')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xf479('0x2')]},'agentUrl':{'type':Sequelize[_0xf479('0x2')]},'scriptName':{'type':Sequelize[_0xf479('0x2')]},'scriptPath':{'type':Sequelize[_0xf479('0x2')]}}; \ No newline at end of file +var _0x984a=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x984a,0x184));var _0xa984=function(_0x31c779,_0x42de3f){_0x31c779=_0x31c779-0x0;var _0x37a305=_0x984a[_0x31c779];return _0x37a305;};'use strict';var Sequelize=require(_0xa984('0x0'));module['exports']={'name':{'type':Sequelize[_0xa984('0x1')]},'type':{'type':Sequelize[_0xa984('0x2')](_0xa984('0x3'),_0xa984('0x4'))},'description':{'type':Sequelize[_0xa984('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xa984('0x6')},'active':{'type':Sequelize[_0xa984('0x7')],'defaultValue':0x0,'comment':_0xa984('0x8')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xa984('0x9'),_0xa984('0xa'),_0xa984('0xb')),'defaultValue':_0xa984('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xa984('0x1')]},'adminUrl':{'type':Sequelize[_0xa984('0x1')]},'agentUrl':{'type':Sequelize[_0xa984('0x1')]},'scriptName':{'type':Sequelize[_0xa984('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 13e43f5..a456245 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 _0x2e0f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','../../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','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','keys','include','find','catch','download','params','join','root','format','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','agent','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','statusCode','eml-format','request-promise'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x2e0f,0x160));var _0xf2e0=function(_0x40b745,_0x150414){_0x40b745=_0x40b745-0x0;var _0x41fb83=_0x2e0f[_0x40b745];return _0x41fb83;};'use strict';var emlformat=require(_0xf2e0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2e0('0x1'));var moment=require(_0xf2e0('0x2'));var BPromise=require(_0xf2e0('0x3'));var Mustache=require(_0xf2e0('0x4'));var util=require(_0xf2e0('0x5'));var path=require(_0xf2e0('0x6'));var sox=require(_0xf2e0('0x7'));var csv=require(_0xf2e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf2e0('0x9'));var squel=require(_0xf2e0('0xa'));var crypto=require(_0xf2e0('0xb'));var jsforce=require(_0xf2e0('0xc'));var deskjs=require(_0xf2e0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf2e0('0xe'));var Papa=require('papaparse');var extract=require(_0xf2e0('0xf'));var rimraf=require(_0xf2e0('0x10'));var archiver=require(_0xf2e0('0x11'));var Redis=require('ioredis');var authService=require(_0xf2e0('0x12'));var qs=require(_0xf2e0('0x13'));var as=require(_0xf2e0('0x14'));var hardwareService=require(_0xf2e0('0x15'));var logger=require(_0xf2e0('0x16'))(_0xf2e0('0x17'));var utils=require(_0xf2e0('0x18'));var config=require(_0xf2e0('0x19'));var licenseUtil=require(_0xf2e0('0x1a'));var db=require(_0xf2e0('0x1b'))['db'];config[_0xf2e0('0x1c')]=_[_0xf2e0('0x1d')](config['redis'],{'host':_0xf2e0('0x1e'),'port':0x18eb});var socket=require(_0xf2e0('0x1f'))(new Redis(config['redis']));require(_0xf2e0('0x20'))['register'](socket);function respondWithStatusCode(_0x437e34,_0x365d2b){_0x365d2b=_0x365d2b||0xcc;return function(_0x53ae8e){if(_0x53ae8e){return _0x437e34[_0xf2e0('0x21')](_0x365d2b);}return _0x437e34[_0xf2e0('0x22')](_0x365d2b)[_0xf2e0('0x23')]();};}function respondWithResult(_0x458f6b,_0xc669c3){_0xc669c3=_0xc669c3||0xc8;return function(_0x226f39){if(_0x226f39){return _0x458f6b['status'](_0xc669c3)[_0xf2e0('0x24')](_0x226f39);}};}function respondWithFilteredResult(_0x570c6c,_0x10219d){return function(_0x169805){if(_0x169805){var _0x225a33=typeof _0x10219d[_0xf2e0('0x25')]===_0xf2e0('0x26')&&typeof _0x10219d['limit']===_0xf2e0('0x26');var _0x57c3cd=_0x169805[_0xf2e0('0x27')];var _0x19a877=_0x225a33?0x0:_0x10219d[_0xf2e0('0x25')];var _0x284372=_0x225a33?_0x169805[_0xf2e0('0x27')]:_0x10219d['offset']+_0x10219d[_0xf2e0('0x28')];var _0x536395;if(_0x284372>=_0x57c3cd){_0x284372=_0x57c3cd;_0x536395=0xc8;}else{_0x536395=0xce;}_0x570c6c[_0xf2e0('0x22')](_0x536395);return _0x570c6c[_0xf2e0('0x29')](_0xf2e0('0x2a'),_0x19a877+'-'+_0x284372+'/'+_0x57c3cd)[_0xf2e0('0x24')](_0x169805);}return null;};}function patchUpdates(_0x45ad60){return function(_0x22fe9f){try{jsonpatch['apply'](_0x22fe9f,_0x45ad60,!![]);}catch(_0xf9db24){return BPromise[_0xf2e0('0x2b')](_0xf9db24);}return _0x22fe9f['save']();};}function saveUpdates(_0x2a89a0,_0x20f279){return function(_0x495657){if(_0x495657){return _0x495657[_0xf2e0('0x2c')](_0x2a89a0)[_0xf2e0('0x2d')](function(_0x2f962b){return _0x2f962b;});}return null;};}function removeEntity(_0x49b965,_0x1cbee3){return function(_0x765a02){if(_0x765a02){return _0x765a02[_0xf2e0('0x2e')]()[_0xf2e0('0x2d')](function(){var _0x4e58ea=_0x765a02[_0xf2e0('0x2f')]({'plain':!![]});var _0x3fcdab='Plugins';return db[_0xf2e0('0x30')][_0xf2e0('0x2e')]({'where':{'type':_0x3fcdab,'resourceId':_0x4e58ea['id']}})['then'](function(){return _0x765a02;});})['then'](function(){_0x49b965[_0xf2e0('0x22')](0xcc)[_0xf2e0('0x23')]();});}};}function handleEntityNotFound(_0x564e21,_0x5739b5){return function(_0xc0f65a){if(!_0xc0f65a){_0x564e21[_0xf2e0('0x21')](0x194);}return _0xc0f65a;};}function handleError(_0x484ddf,_0x4c2156){_0x4c2156=_0x4c2156||0x1f4;return function(_0x2a412f){logger[_0xf2e0('0x31')](_0x2a412f[_0xf2e0('0x32')]);if(_0x2a412f[_0xf2e0('0x33')]){delete _0x2a412f['name'];}_0x484ddf[_0xf2e0('0x22')](_0x4c2156)[_0xf2e0('0x34')](_0x2a412f);};}exports['index']=function(_0x32a2ff,_0x11bd2b){var _0x3c7513={},_0x3eb55d={},_0x38d361={'count':0x0,'rows':[]};var _0x42d2e6=_[_0xf2e0('0x35')](db[_0xf2e0('0x36')][_0xf2e0('0x37')],function(_0x339855){return{'name':_0x339855[_0xf2e0('0x38')],'type':_0x339855[_0xf2e0('0x39')][_0xf2e0('0x3a')]};});_0x3eb55d['model']=_['map'](_0x42d2e6,_0xf2e0('0x33'));_0x3eb55d[_0xf2e0('0x3b')]=_['keys'](_0x32a2ff[_0xf2e0('0x3b')]);_0x3eb55d[_0xf2e0('0x3c')]=_[_0xf2e0('0x3d')](_0x3eb55d['model'],_0x3eb55d['query']);_0x3c7513[_0xf2e0('0x3e')]=_[_0xf2e0('0x3d')](_0x3eb55d[_0xf2e0('0x3f')],qs[_0xf2e0('0x40')](_0x32a2ff[_0xf2e0('0x3b')]['fields']));_0x3c7513['attributes']=_0x3c7513[_0xf2e0('0x3e')][_0xf2e0('0x41')]?_0x3c7513[_0xf2e0('0x3e')]:_0x3eb55d['model'];if(!_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x42')](_0xf2e0('0x43'))){_0x3c7513[_0xf2e0('0x28')]=qs['limit'](_0x32a2ff['query'][_0xf2e0('0x28')]);_0x3c7513[_0xf2e0('0x25')]=qs[_0xf2e0('0x25')](_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x25')]);}_0x3c7513[_0xf2e0('0x44')]=qs[_0xf2e0('0x45')](_0x32a2ff['query'][_0xf2e0('0x45')]);_0x3c7513[_0xf2e0('0x46')]=qs[_0xf2e0('0x3c')](_[_0xf2e0('0x47')](_0x32a2ff['query'],_0x3eb55d[_0xf2e0('0x3c')]),_0x42d2e6);if(_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x48')]){_0x3c7513[_0xf2e0('0x46')]=_[_0xf2e0('0x49')](_0x3c7513[_0xf2e0('0x46')],{'$or':_['map'](_0x42d2e6,function(_0x330270){if(_0x330270[_0xf2e0('0x39')]!==_0xf2e0('0x4a')){var _0x2e76ab={};_0x2e76ab[_0x330270['name']]={'$like':'%'+_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x48')]+'%'};return _0x2e76ab;}})});}_0x3c7513=_[_0xf2e0('0x49')]({},_0x3c7513,_0x32a2ff[_0xf2e0('0x4b')]);var _0x129337={'where':_0x3c7513[_0xf2e0('0x46')]};return db[_0xf2e0('0x36')][_0xf2e0('0x27')](_0x129337)[_0xf2e0('0x2d')](function(_0x5a904e){_0x38d361[_0xf2e0('0x27')]=_0x5a904e;if(_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x4c')]){_0x3c7513['include']=[{'all':!![]}];}return db['Plugin'][_0xf2e0('0x4d')](_0x3c7513);})[_0xf2e0('0x2d')](function(_0x288aff){_0x38d361['rows']=_0x288aff;return _0x38d361;})['then'](respondWithFilteredResult(_0x11bd2b,_0x3c7513))['catch'](handleError(_0x11bd2b,null));};exports[_0xf2e0('0x4e')]=function(_0x230667,_0x21fed6){var _0x491a55={'raw':!![],'where':{'id':_0x230667['params']['id']}},_0xccda64={};_0xccda64['model']=_['keys'](db[_0xf2e0('0x36')][_0xf2e0('0x37')]);_0xccda64[_0xf2e0('0x3b')]=_[_0xf2e0('0x4f')](_0x230667[_0xf2e0('0x3b')]);_0xccda64[_0xf2e0('0x3c')]=_[_0xf2e0('0x3d')](_0xccda64[_0xf2e0('0x3f')],_0xccda64[_0xf2e0('0x3b')]);_0x491a55[_0xf2e0('0x3e')]=_['intersection'](_0xccda64[_0xf2e0('0x3f')],qs[_0xf2e0('0x40')](_0x230667[_0xf2e0('0x3b')]['fields']));_0x491a55[_0xf2e0('0x3e')]=_0x491a55[_0xf2e0('0x3e')][_0xf2e0('0x41')]?_0x491a55[_0xf2e0('0x3e')]:_0xccda64[_0xf2e0('0x3f')];if(_0x230667[_0xf2e0('0x3b')][_0xf2e0('0x4c')]){_0x491a55[_0xf2e0('0x50')]=[{'all':!![]}];}_0x491a55=_[_0xf2e0('0x49')]({},_0x491a55,_0x230667['options']);return db['Plugin'][_0xf2e0('0x51')](_0x491a55)['then'](handleEntityNotFound(_0x21fed6,null))[_0xf2e0('0x2d')](respondWithResult(_0x21fed6,null))[_0xf2e0('0x52')](handleError(_0x21fed6,null));};exports[_0xf2e0('0x53')]=function(_0x16fef3,_0x161294,_0x7d1008){return db[_0xf2e0('0x36')][_0xf2e0('0x51')]({'where':{'id':_0x16fef3[_0xf2e0('0x54')]['id']},'attributes':[_0xf2e0('0x33'),_0xf2e0('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x161294,null))[_0xf2e0('0x2d')](function(_0xcb7d30){if(_0xcb7d30){var _0x3d8cb8=path[_0xf2e0('0x55')](config[_0xf2e0('0x56')],'server/files/plugins',util[_0xf2e0('0x57')]('%s.zip',path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')])));var _0x5aa790=fs['createWriteStream'](_0x3d8cb8);var _0x411e95=archiver('zip',{'zlib':{'level':0x9}});_0x411e95['on'](_0xf2e0('0x59'),function(_0x5dcca1){if(_0x5dcca1[_0xf2e0('0x5a')]===_0xf2e0('0x5b')){logger[_0xf2e0('0x31')](_0x5dcca1);}else{throw new db[(_0xf2e0('0x5c'))][(_0xf2e0('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x411e95['on'](_0xf2e0('0x31'),function(_0x5ee325){throw new db[(_0xf2e0('0x5c'))][(_0xf2e0('0x5d'))](_0xf2e0('0x5e'));});_0x411e95[_0xf2e0('0x5f')](_0x5aa790);_0x411e95[_0xf2e0('0x60')](_0xf2e0('0x61'),{'cwd':path[_0xf2e0('0x55')](config['root'],'server/files/plugins',path['dirname'](_0xcb7d30[_0xf2e0('0x6')])),'ignore':[path['join'](path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')]),_0xf2e0('0x62')),path[_0xf2e0('0x55')](path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')]),_0xf2e0('0x63'))],'nodir':!![]})[_0xf2e0('0x64')]();_0x5aa790['on'](_0xf2e0('0x65'),function(){if(!fs[_0xf2e0('0x66')](_0x3d8cb8)){throw new db[(_0xf2e0('0x5c'))]['Error']('Plugin\x20not\x20found');}return _0x161294[_0xf2e0('0x53')](_0x3d8cb8,util['format'](_0xf2e0('0x67'),path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')])),function(_0x4c7c81){if(_0x4c7c81){throw new db[(_0xf2e0('0x5c'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x3d8cb8);logger[_0xf2e0('0x68')](_0xf2e0('0x69'));logger[_0xf2e0('0x68')](_0xf2e0('0x6a'));});});}return null;})[_0xf2e0('0x52')](handleError(_0x161294,null));};exports['upload']=function(_0x4d730d,_0x3f98ac,_0x50e069){var _0x22f632=path['basename'](_0x4d730d[_0xf2e0('0x6b')]['filename'],path[_0xf2e0('0x6c')](_0x4d730d[_0xf2e0('0x6b')][_0xf2e0('0x6d')]));var _0x913fa9=path[_0xf2e0('0x55')](config[_0xf2e0('0x56')],'server/files/plugins',_0x4d730d[_0xf2e0('0x6b')][_0xf2e0('0x6d')]);var _0x310318=path['join'](config['root'],_0xf2e0('0x6e'),_0x22f632);logger[_0xf2e0('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x913fa9);logger[_0xf2e0('0x68')](_0xf2e0('0x6f'),_0x310318);try{fs[_0xf2e0('0x70')](_0x913fa9,parseInt(_0xf2e0('0x71'),0x8));extract(_0x913fa9,{'dir':_0x310318},function(_0x14050f){if(_0x14050f){logger['error'](_0x14050f);handleError(_0x14050f,!![]);};var _0x40d043=fs[_0xf2e0('0x72')](_0x310318);if(_0x40d043[_0xf2e0('0x41')]>0x1){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')](_0xf2e0('0x73'));return _0x50e069(new Error(_0xf2e0('0x73')));}var _0x326f58=fs[_0xf2e0('0x74')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0]));if(_0x326f58['isFile']()){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')]('Invalid\x20plugin\x20structure');return _0x50e069(new Error(_0xf2e0('0x73')));}if(_0x326f58[_0xf2e0('0x75')]()){var _0x2104a5=fs[_0xf2e0('0x72')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0]));if(_0x2104a5[_0xf2e0('0x41')]===0x0){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')]('Invalid\x20plugin\x20structure');return _0x50e069(new Error(_0xf2e0('0x73')));}var _0x2ea905=_0x2104a5[_0xf2e0('0x76')](function(_0x28b120){return _0x28b120===_0xf2e0('0x77');});if(!_0x2ea905){return _0x50e069(new Error(_0xf2e0('0x78')));}var _0x45dbd7=fs[_0xf2e0('0x79')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0],'manifest.json'));var _0x13133a=JSON[_0xf2e0('0x7a')](_0x45dbd7);if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x33')]){return _0x50e069(new Error(_0xf2e0('0x7b')));}if(_0xf2e0('0x26')==typeof _0x13133a['type']){return _0x50e069(new Error(_0xf2e0('0x7c')));}if(_0xf2e0('0x26')==typeof _0x13133a['version']){return _0x50e069(new Error(_0xf2e0('0x7d')));}if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')]){return _0x50e069(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x13133a[_0xf2e0('0x39')]===_0xf2e0('0x7f')){if(_0xf2e0('0x26')==typeof _0x13133a['parameters'][_0xf2e0('0x80')]){return _0x50e069(new Error(_0xf2e0('0x81')));}if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]['admin']&&_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')]['views']['agent']){return _0x50e069(new Error(_0xf2e0('0x82')));}}else if(_0x13133a[_0xf2e0('0x39')]===_0xf2e0('0x83')){if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x84')]){return _0x50e069(new Error(_0xf2e0('0x85')));}if('undefined'==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x86')]){return _0x50e069(new Error(_0xf2e0('0x87')));}}else{return _0x50e069(new Error(_0xf2e0('0x88')));}var _0x145676=_0x13133a[_0xf2e0('0x33')];var _0x2d5dc6=_0x13133a['description'];var _0x5792c4=_0x13133a[_0xf2e0('0x39')];var _0xe4d6f8=_0x13133a['sidebar']?_0x13133a[_0xf2e0('0x89')]:_0xf2e0('0x8a');var _0x58891a=_0x13133a[_0xf2e0('0x8b')]?_0x13133a['icon']:_0xf2e0('0x8c');var _0x5621f1='';var _0x3d25d9='';var _0x3e359b='';var _0x570174='';var _0x3ae004=_0x13133a['version'];if(_0x5792c4==='html'){if(_0xf2e0('0x26')!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]['admin']){var _0x121625=_0x13133a['parameters'][_0xf2e0('0x80')][_0xf2e0('0x8d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x121625)){_0x5621f1=path['join']('plugins',_0x22f632,_0x40d043[0x0],_0x121625);}else{_0x5621f1=_0x121625;}}else{logger[_0xf2e0('0x68')](_0xf2e0('0x8e'));}if(_0xf2e0('0x26')!=typeof _0x13133a[_0xf2e0('0x7e')]['views']['agent']){var _0x3ddc22=_0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x3ddc22)){_0x3d25d9=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x3ddc22);}else{_0x3d25d9=_0x3ddc22;}}else{logger[_0xf2e0('0x68')](_0xf2e0('0x92'));}}else if(_0x5792c4===_0xf2e0('0x83')){_0x3e359b=_0x13133a[_0xf2e0('0x7e')]['scriptName'];_0x570174=_0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x86')];if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]){if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8d')]){var _0x121625=_0x13133a[_0xf2e0('0x7e')]['views'][_0xf2e0('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x121625)){_0x5621f1=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x121625);}else{_0x5621f1=_0x121625;}}if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8f')]){var _0x3ddc22=_0x13133a[_0xf2e0('0x7e')]['views'][_0xf2e0('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x3ddc22)){_0x3d25d9=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x3ddc22);}else{_0x3d25d9=_0x3ddc22;}}}}var _0x52ed86={'name':_0x145676,'description':_0x2d5dc6,'path':path['join'](_0x22f632,_0x40d043[0x0]),'type':_0x5792c4,'sidebar':_0xe4d6f8,'icon':_0x58891a,'adminUrl':_0x5621f1,'agentUrl':_0x3d25d9,'scriptName':_0x3e359b,'scriptPath':_0x570174,'version':_0x3ae004};removeReferences(_0x913fa9,null);return db[_0xf2e0('0x36')]['create'](_0x52ed86)['then'](function(_0x29cc59){var _0x41716c={'role':_0x4d730d[_0xf2e0('0x93')][_0xf2e0('0x94')],'userProfileId':_0x4d730d[_0xf2e0('0x93')][_0xf2e0('0x95')]};if(!_0x41716c)throw new Error(_0xf2e0('0x96'));if(_0x41716c[_0xf2e0('0x94')]===_0xf2e0('0x97')){var _0x28a1a4=_0x29cc59[_0xf2e0('0x2f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf2e0('0x98'),'userProfileId':_0x41716c['userProfileId']},'raw':!![]})[_0xf2e0('0x2d')](function(_0x31ec8f){if(_0x31ec8f&&_0x31ec8f[_0xf2e0('0x99')]===0x0){return db[_0xf2e0('0x30')][_0xf2e0('0x9a')]({'name':_0x28a1a4[_0xf2e0('0x33')],'resourceId':_0x28a1a4['id'],'type':_0x31ec8f['name'],'sectionId':_0x31ec8f['id']},{})[_0xf2e0('0x2d')](function(){return _0x29cc59;});}else{return _0x29cc59;}})[_0xf2e0('0x52')](function(_0x23fe76){logger[_0xf2e0('0x31')](_0xf2e0('0x9b'),_0x23fe76);throw _0x23fe76;});}return _0x29cc59;})[_0xf2e0('0x2d')](respondWithResult(_0x3f98ac,null))[_0xf2e0('0x52')](handleError(_0x3f98ac,null));}});}catch(_0x5debb6){_0x3f98ac[_0xf2e0('0x22')](0x1f4)['send'](_0x5debb6);}};function removeReferences(_0x2c61af,_0x54dd1d){try{if(_0x2c61af){fs[_0xf2e0('0x9c')](_0x2c61af);logger[_0xf2e0('0x68')](_0xf2e0('0x9d'));}if(_0x54dd1d){rimraf(_0x54dd1d,function(){});logger[_0xf2e0('0x68')](_0xf2e0('0x9e'));}}catch(_0x1c0815){logger[_0xf2e0('0x31')](_0x1c0815);}}exports['update']=function(_0x5e03ab,_0x4a9d47,_0x59e732){return db['Plugin'][_0xf2e0('0x51')]({'where':{'id':_0x5e03ab[_0xf2e0('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a9d47,null))[_0xf2e0('0x2d')](saveUpdates(_0x5e03ab[_0xf2e0('0x93')],null))[_0xf2e0('0x2d')](respondWithResult(_0x4a9d47,null))[_0xf2e0('0x52')](handleError(_0x4a9d47,null));};exports[_0xf2e0('0x9f')]=function(_0x447db2,_0x3951e4,_0x159549){return db[_0xf2e0('0x36')][_0xf2e0('0x51')]({'where':{'id':_0x447db2[_0xf2e0('0x54')]['id']}})[_0xf2e0('0x2d')](function(_0x53fc87){if(_0x53fc87){return _0x53fc87[_0xf2e0('0x2e')]();}})[_0xf2e0('0x2d')](function(_0x7cc138){rimraf(path[_0xf2e0('0x55')](config['root'],'server/files/plugins',path[_0xf2e0('0xa0')](_0x7cc138[_0xf2e0('0x6')])),function(){});return _0x7cc138;})[_0xf2e0('0x2d')](handleEntityNotFound(_0x3951e4,null))[_0xf2e0('0x2d')](respondWithStatusCode(_0x3951e4,null))['catch'](handleError(_0x3951e4,null));};exports[_0xf2e0('0xa1')]=function(_0x26148f,_0xa36e44,_0x9f12ab){return BPromise[_0xf2e0('0xa2')]()[_0xf2e0('0x2d')](function(){if(!_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26148f['query'][_0xf2e0('0xa3')]){throw new Error(_0xf2e0('0xa4'));}var _0x3e23a5=_0x26148f['query'][_0xf2e0('0xa5')]?_0x26148f['query']['hostname']+':'+_0x26148f[_0xf2e0('0x3b')]['port']:_0xf2e0('0xa6')+_0x26148f[_0xf2e0('0x3b')]['port'];var _0x2a9a26=_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x24')]?_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x24')]:!![];var _0x1e77ae=_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0xa7')]?_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0xa7')]:null;var _0x592386={'method':_0x26148f['method'],'uri':util[_0xf2e0('0x57')](_0xf2e0('0xa8'),_0x3e23a5,_0x26148f[_0xf2e0('0x3b')]['path']),'json':_0x2a9a26,'resolveWithFullResponse':!![],'encoding':_0x1e77ae,'qs':_0x26148f['query']};if(_0x26148f['headers']){_0x592386[_0xf2e0('0xa9')]=_0x26148f[_0xf2e0('0xa9')];if(_0x592386['headers'][_0xf2e0('0xaa')]){delete _0x592386[_0xf2e0('0xa9')][_0xf2e0('0xaa')];}}if(_0x592386[_0xf2e0('0xa9')][_0xf2e0('0xab')]){delete _0x592386[_0xf2e0('0xa9')][_0xf2e0('0xab')];}return rp(_0x592386);})[_0xf2e0('0x2d')](function(_0x59f071){if(_0x59f071){_0xa36e44[_0xf2e0('0x29')](_0x59f071[_0xf2e0('0xa9')]);logger[_0xf2e0('0x68')](_0x59f071[_0xf2e0('0x93')]);if(_[_0xf2e0('0xac')](_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x6')],'download')&&_0x59f071['statusCode']==0x1f4){return _0xa36e44[_0xf2e0('0x21')](_0x59f071['statusCode']);}else{return _0xa36e44[_0xf2e0('0x22')](_0x59f071['statusCode'])[_0xf2e0('0x34')](_0x59f071[_0xf2e0('0x93')]);}}else{return _0xa36e44[_0xf2e0('0x21')](0xc8);}})[_0xf2e0('0x52')](handleError(_0xa36e44,null));};exports[_0xf2e0('0xad')]=function(_0x3787ac,_0xb6e658,_0x9045e1){return BPromise[_0xf2e0('0xa2')]()[_0xf2e0('0x2d')](function(){if(!_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x6')]){throw new Error(_0xf2e0('0xae'));}if(!_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa3')]){throw new Error(_0xf2e0('0xa4'));}var _0x28a536=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa5')]?_0x3787ac['query']['hostname']+':'+_0x3787ac['query'][_0xf2e0('0xa3')]:_0xf2e0('0xa6')+_0x3787ac['query']['port'];var _0x517fdb=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x24')]?_0x3787ac['query'][_0xf2e0('0x24')]:!![];var _0x29b1ce=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa7')]?_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa7')]:null;var _0x421878={'method':_0x3787ac[_0xf2e0('0xaf')],'uri':util[_0xf2e0('0x57')](_0xf2e0('0xa8'),_0x28a536,_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x6')]),'json':_0x517fdb,'resolveWithFullResponse':!![],'encoding':_0x29b1ce,'body':_0x3787ac[_0xf2e0('0x93')]};if(_0x3787ac[_0xf2e0('0xa9')]){_0x421878[_0xf2e0('0xa9')]=_0x3787ac[_0xf2e0('0xa9')];if(_0x421878[_0xf2e0('0xa9')][_0xf2e0('0xaa')]){delete _0x421878[_0xf2e0('0xa9')][_0xf2e0('0xaa')];}}if(_0x421878[_0xf2e0('0xa9')][_0xf2e0('0xab')]){delete _0x421878[_0xf2e0('0xa9')][_0xf2e0('0xab')];}return rp(_0x421878);})[_0xf2e0('0x2d')](function(_0x5dd94b){if(_0x5dd94b){_0xb6e658['set'](_0x5dd94b['headers']);logger[_0xf2e0('0x68')](_0x5dd94b[_0xf2e0('0x93')]);return _0xb6e658['status'](_0x5dd94b[_0xf2e0('0xb0')])['send'](_0x5dd94b[_0xf2e0('0x93')]);}else{return _0xb6e658['sendStatus'](0xc8);}})['catch'](handleError(_0xb6e658,null));}; \ No newline at end of file +var _0x9f58=['catch','download','join','root','server/files/plugins','format','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','views','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','headers','content-length','content-type','endsWith','statusCode','sendStatus','webhookPost','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','extract-zip','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','./plugin.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','params','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f58,0x1ba));var _0x89f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f58[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x89f5('0x0'));var rimraf=require(_0x89f5('0x1'));var zipdir=require(_0x89f5('0x2'));var jsonpatch=require(_0x89f5('0x3'));var rp=require(_0x89f5('0x4'));var moment=require('moment');var BPromise=require(_0x89f5('0x5'));var Mustache=require(_0x89f5('0x6'));var util=require(_0x89f5('0x7'));var path=require(_0x89f5('0x8'));var sox=require(_0x89f5('0x9'));var csv=require(_0x89f5('0xa'));var ejs=require(_0x89f5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89f5('0xc'));var squel=require(_0x89f5('0xd'));var crypto=require(_0x89f5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x89f5('0xf'));var toCsv=require(_0x89f5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x89f5('0x10'));var rimraf=require(_0x89f5('0x1'));var archiver=require('archiver');var Redis=require(_0x89f5('0x11'));var authService=require(_0x89f5('0x12'));var qs=require(_0x89f5('0x13'));var as=require(_0x89f5('0x14'));var hardwareService=require(_0x89f5('0x15'));var logger=require(_0x89f5('0x16'))(_0x89f5('0x17'));var utils=require(_0x89f5('0x18'));var config=require(_0x89f5('0x19'));var licenseUtil=require(_0x89f5('0x1a'));var db=require(_0x89f5('0x1b'))['db'];config[_0x89f5('0x1c')]=_['defaults'](config['redis'],{'host':_0x89f5('0x1d'),'port':0x18eb});var socket=require(_0x89f5('0x1e'))(new Redis(config['redis']));require(_0x89f5('0x1f'))[_0x89f5('0x20')](socket);function respondWithStatusCode(_0x2a803f,_0x274e9a){_0x274e9a=_0x274e9a||0xcc;return function(_0x2b1af6){if(_0x2b1af6){return _0x2a803f['sendStatus'](_0x274e9a);}return _0x2a803f[_0x89f5('0x21')](_0x274e9a)[_0x89f5('0x22')]();};}function respondWithResult(_0x479a82,_0x3d514e){_0x3d514e=_0x3d514e||0xc8;return function(_0xd04a3d){if(_0xd04a3d){return _0x479a82[_0x89f5('0x21')](_0x3d514e)['json'](_0xd04a3d);}};}function respondWithFilteredResult(_0x471611,_0x20aac3){return function(_0x2e16da){if(_0x2e16da){var _0x5e33b5=typeof _0x20aac3[_0x89f5('0x23')]===_0x89f5('0x24')&&typeof _0x20aac3['limit']===_0x89f5('0x24');var _0x116ed0=_0x2e16da[_0x89f5('0x25')];var _0x35a29b=_0x5e33b5?0x0:_0x20aac3[_0x89f5('0x23')];var _0x11a02d=_0x5e33b5?_0x2e16da[_0x89f5('0x25')]:_0x20aac3[_0x89f5('0x23')]+_0x20aac3[_0x89f5('0x26')];var _0x4fc175;if(_0x11a02d>=_0x116ed0){_0x11a02d=_0x116ed0;_0x4fc175=0xc8;}else{_0x4fc175=0xce;}_0x471611[_0x89f5('0x21')](_0x4fc175);return _0x471611[_0x89f5('0x27')](_0x89f5('0x28'),_0x35a29b+'-'+_0x11a02d+'/'+_0x116ed0)['json'](_0x2e16da);}return null;};}function patchUpdates(_0x416deb){return function(_0x2448e6){try{jsonpatch[_0x89f5('0x29')](_0x2448e6,_0x416deb,!![]);}catch(_0x45eb25){return BPromise[_0x89f5('0x2a')](_0x45eb25);}return _0x2448e6[_0x89f5('0x2b')]();};}function saveUpdates(_0x3ac91a,_0x2f295d){return function(_0xaa05a4){if(_0xaa05a4){return _0xaa05a4[_0x89f5('0x2c')](_0x3ac91a)[_0x89f5('0x2d')](function(_0x3edccc){return _0x3edccc;});}return null;};}function removeEntity(_0x17bccf,_0xa4d51a){return function(_0xe827a6){if(_0xe827a6){return _0xe827a6['destroy']()[_0x89f5('0x2d')](function(){var _0x464ab8=_0xe827a6[_0x89f5('0x2e')]({'plain':!![]});var _0x47f3a5='Plugins';return db[_0x89f5('0x2f')][_0x89f5('0x30')]({'where':{'type':_0x47f3a5,'resourceId':_0x464ab8['id']}})['then'](function(){return _0xe827a6;});})[_0x89f5('0x2d')](function(){_0x17bccf[_0x89f5('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x427597,_0x3ea182){return function(_0x4b0c6c){if(!_0x4b0c6c){_0x427597['sendStatus'](0x194);}return _0x4b0c6c;};}function handleError(_0x177cc9,_0x564787){_0x564787=_0x564787||0x1f4;return function(_0x2eca34){logger[_0x89f5('0x31')](_0x2eca34[_0x89f5('0x32')]);if(_0x2eca34[_0x89f5('0x33')]){delete _0x2eca34[_0x89f5('0x33')];}_0x177cc9[_0x89f5('0x21')](_0x564787)['send'](_0x2eca34);};}exports[_0x89f5('0x34')]=function(_0x10df94,_0x530270){var _0xb08c79={},_0x5db5a0={},_0x393002={'count':0x0,'rows':[]};var _0x1b5f0e=_[_0x89f5('0x35')](db[_0x89f5('0x36')][_0x89f5('0x37')],function(_0x6a1c63){return{'name':_0x6a1c63[_0x89f5('0x38')],'type':_0x6a1c63[_0x89f5('0x39')][_0x89f5('0x3a')]};});_0x5db5a0[_0x89f5('0x3b')]=_[_0x89f5('0x35')](_0x1b5f0e,'name');_0x5db5a0[_0x89f5('0x3c')]=_[_0x89f5('0x3d')](_0x10df94[_0x89f5('0x3c')]);_0x5db5a0['filters']=_[_0x89f5('0x3e')](_0x5db5a0[_0x89f5('0x3b')],_0x5db5a0[_0x89f5('0x3c')]);_0xb08c79[_0x89f5('0x3f')]=_[_0x89f5('0x3e')](_0x5db5a0[_0x89f5('0x3b')],qs['fields'](_0x10df94['query'][_0x89f5('0x40')]));_0xb08c79[_0x89f5('0x3f')]=_0xb08c79[_0x89f5('0x3f')][_0x89f5('0x41')]?_0xb08c79[_0x89f5('0x3f')]:_0x5db5a0[_0x89f5('0x3b')];if(!_0x10df94[_0x89f5('0x3c')][_0x89f5('0x42')]('nolimit')){_0xb08c79['limit']=qs[_0x89f5('0x26')](_0x10df94[_0x89f5('0x3c')][_0x89f5('0x26')]);_0xb08c79['offset']=qs[_0x89f5('0x23')](_0x10df94[_0x89f5('0x3c')][_0x89f5('0x23')]);}_0xb08c79['order']=qs[_0x89f5('0x43')](_0x10df94[_0x89f5('0x3c')][_0x89f5('0x43')]);_0xb08c79[_0x89f5('0x44')]=qs[_0x89f5('0x45')](_[_0x89f5('0x46')](_0x10df94[_0x89f5('0x3c')],_0x5db5a0[_0x89f5('0x45')]),_0x1b5f0e);if(_0x10df94[_0x89f5('0x3c')][_0x89f5('0x47')]){_0xb08c79[_0x89f5('0x44')]=_['merge'](_0xb08c79['where'],{'$or':_[_0x89f5('0x35')](_0x1b5f0e,function(_0xb3b48c){if(_0xb3b48c[_0x89f5('0x39')]!==_0x89f5('0x48')){var _0x30452b={};_0x30452b[_0xb3b48c[_0x89f5('0x33')]]={'$like':'%'+_0x10df94[_0x89f5('0x3c')][_0x89f5('0x47')]+'%'};return _0x30452b;}})});}_0xb08c79=_[_0x89f5('0x49')]({},_0xb08c79,_0x10df94[_0x89f5('0x4a')]);var _0x1c5630={'where':_0xb08c79[_0x89f5('0x44')]};return db[_0x89f5('0x36')][_0x89f5('0x25')](_0x1c5630)[_0x89f5('0x2d')](function(_0x5ea15c){_0x393002[_0x89f5('0x25')]=_0x5ea15c;if(_0x10df94[_0x89f5('0x3c')]['includeAll']){_0xb08c79[_0x89f5('0x4b')]=[{'all':!![]}];}return db[_0x89f5('0x36')][_0x89f5('0x4c')](_0xb08c79);})[_0x89f5('0x2d')](function(_0x2a3ade){_0x393002[_0x89f5('0x4d')]=_0x2a3ade;return _0x393002;})[_0x89f5('0x2d')](respondWithFilteredResult(_0x530270,_0xb08c79))['catch'](handleError(_0x530270,null));};exports['show']=function(_0x28077a,_0x377e63){var _0x358160={'raw':!![],'where':{'id':_0x28077a[_0x89f5('0x4e')]['id']}},_0x401629={};_0x401629[_0x89f5('0x3b')]=_[_0x89f5('0x3d')](db[_0x89f5('0x36')][_0x89f5('0x37')]);_0x401629[_0x89f5('0x3c')]=_['keys'](_0x28077a[_0x89f5('0x3c')]);_0x401629['filters']=_[_0x89f5('0x3e')](_0x401629[_0x89f5('0x3b')],_0x401629['query']);_0x358160[_0x89f5('0x3f')]=_['intersection'](_0x401629[_0x89f5('0x3b')],qs[_0x89f5('0x40')](_0x28077a[_0x89f5('0x3c')][_0x89f5('0x40')]));_0x358160[_0x89f5('0x3f')]=_0x358160[_0x89f5('0x3f')][_0x89f5('0x41')]?_0x358160['attributes']:_0x401629[_0x89f5('0x3b')];if(_0x28077a[_0x89f5('0x3c')]['includeAll']){_0x358160['include']=[{'all':!![]}];}_0x358160=_['merge']({},_0x358160,_0x28077a[_0x89f5('0x4a')]);return db[_0x89f5('0x36')][_0x89f5('0x4f')](_0x358160)['then'](handleEntityNotFound(_0x377e63,null))[_0x89f5('0x2d')](respondWithResult(_0x377e63,null))[_0x89f5('0x50')](handleError(_0x377e63,null));};exports[_0x89f5('0x51')]=function(_0x1ee238,_0x471d88,_0x253f26){return db['Plugin'][_0x89f5('0x4f')]({'where':{'id':_0x1ee238['params']['id']},'attributes':[_0x89f5('0x33'),'path'],'raw':!![]})[_0x89f5('0x2d')](handleEntityNotFound(_0x471d88,null))['then'](function(_0x35ba51){if(_0x35ba51){var _0x2d47e9=path[_0x89f5('0x52')](config[_0x89f5('0x53')],_0x89f5('0x54'),util[_0x89f5('0x55')]('%s.zip',path[_0x89f5('0x56')](_0x35ba51[_0x89f5('0x8')])));var _0x54562a=fs[_0x89f5('0x57')](_0x2d47e9);var _0x1cb037=archiver(_0x89f5('0x58'),{'zlib':{'level':0x9}});_0x1cb037['on']('warning',function(_0x363c63){if(_0x363c63[_0x89f5('0x59')]===_0x89f5('0x5a')){logger[_0x89f5('0x31')](_0x363c63);}else{throw new db[(_0x89f5('0x5b'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1cb037['on']('error',function(_0xa193e4){throw new db[(_0x89f5('0x5b'))][(_0x89f5('0x5c'))](_0x89f5('0x5d'));});_0x1cb037['pipe'](_0x54562a);_0x1cb037['glob'](_0x89f5('0x5e'),{'cwd':path[_0x89f5('0x52')](config[_0x89f5('0x53')],_0x89f5('0x54'),path[_0x89f5('0x5f')](_0x35ba51[_0x89f5('0x8')])),'ignore':[path[_0x89f5('0x52')](path[_0x89f5('0x56')](_0x35ba51[_0x89f5('0x8')]),'node_modules/**/*'),path[_0x89f5('0x52')](path[_0x89f5('0x56')](_0x35ba51[_0x89f5('0x8')]),_0x89f5('0x60'))],'nodir':!![]})[_0x89f5('0x61')]();_0x54562a['on']('close',function(){if(!fs[_0x89f5('0x62')](_0x2d47e9)){throw new db[(_0x89f5('0x5b'))][(_0x89f5('0x5c'))](_0x89f5('0x63'));}return _0x471d88[_0x89f5('0x51')](_0x2d47e9,util[_0x89f5('0x55')](_0x89f5('0x64'),path[_0x89f5('0x56')](_0x35ba51['path'])),function(_0x100e89){if(_0x100e89){throw new db[(_0x89f5('0x5b'))]['Error'](_0x89f5('0x65'));}fs[_0x89f5('0x66')](_0x2d47e9);logger[_0x89f5('0x67')]('Download\x20completed');logger[_0x89f5('0x67')](_0x89f5('0x68'));});});}return null;})[_0x89f5('0x50')](handleError(_0x471d88,null));};exports[_0x89f5('0x69')]=function(_0x37e90d,_0x573476,_0x13d6c3){var _0x5ea5e4=path[_0x89f5('0x56')](_0x37e90d[_0x89f5('0x6a')][_0x89f5('0x6b')],path['extname'](_0x37e90d[_0x89f5('0x6a')][_0x89f5('0x6b')]));var _0x7d75eb=path[_0x89f5('0x52')](config[_0x89f5('0x53')],_0x89f5('0x54'),_0x37e90d[_0x89f5('0x6a')]['filename']);var _0x2ce644=path[_0x89f5('0x52')](config[_0x89f5('0x53')],_0x89f5('0x54'),_0x5ea5e4);logger[_0x89f5('0x67')](_0x89f5('0x6c'),_0x7d75eb);logger[_0x89f5('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x2ce644);try{fs[_0x89f5('0x6d')](_0x7d75eb,parseInt(_0x89f5('0x6e'),0x8));extract(_0x7d75eb,{'dir':_0x2ce644},function(_0x371472){if(_0x371472){logger[_0x89f5('0x31')](_0x371472);handleError(_0x371472,!![]);};var _0x20694e=fs['readdirSync'](_0x2ce644);if(_0x20694e[_0x89f5('0x41')]>0x1){removeReferences(_0x7d75eb,_0x2ce644);logger[_0x89f5('0x31')](_0x89f5('0x6f'));return _0x13d6c3(new Error('Invalid\x20plugin\x20structure'));}var _0x416718=fs[_0x89f5('0x70')](path[_0x89f5('0x52')](_0x2ce644,_0x20694e[0x0]));if(_0x416718[_0x89f5('0x71')]()){removeReferences(_0x7d75eb,_0x2ce644);logger[_0x89f5('0x31')]('Invalid\x20plugin\x20structure');return _0x13d6c3(new Error('Invalid\x20plugin\x20structure'));}if(_0x416718[_0x89f5('0x72')]()){var _0x572f0c=fs[_0x89f5('0x73')](path[_0x89f5('0x52')](_0x2ce644,_0x20694e[0x0]));if(_0x572f0c[_0x89f5('0x41')]===0x0){removeReferences(_0x7d75eb,_0x2ce644);logger['error'](_0x89f5('0x6f'));return _0x13d6c3(new Error(_0x89f5('0x6f')));}var _0xd84fec=_0x572f0c[_0x89f5('0x74')](function(_0x1c8749){return _0x1c8749===_0x89f5('0x75');});if(!_0xd84fec){return _0x13d6c3(new Error(_0x89f5('0x76')));}var _0xa3d2a5=fs[_0x89f5('0x77')](path[_0x89f5('0x52')](_0x2ce644,_0x20694e[0x0],_0x89f5('0x75')));var _0x1273fe=JSON['parse'](_0xa3d2a5);if('undefined'==typeof _0x1273fe[_0x89f5('0x33')]){return _0x13d6c3(new Error(_0x89f5('0x78')));}if('undefined'==typeof _0x1273fe['type']){return _0x13d6c3(new Error(_0x89f5('0x79')));}if(_0x89f5('0x24')==typeof _0x1273fe[_0x89f5('0x7a')]){return _0x13d6c3(new Error(_0x89f5('0x7b')));}if(_0x89f5('0x24')==typeof _0x1273fe['parameters']){return _0x13d6c3(new Error(_0x89f5('0x7c')));}if(_0x1273fe['type']==='html'){if(_0x89f5('0x24')==typeof _0x1273fe['parameters'][_0x89f5('0x7d')]){return _0x13d6c3(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x1273fe[_0x89f5('0x7e')]['views'][_0x89f5('0x7f')]&&_0x89f5('0x24')==typeof _0x1273fe['parameters'][_0x89f5('0x7d')][_0x89f5('0x80')]){return _0x13d6c3(new Error(_0x89f5('0x81')));}}else if(_0x1273fe['type']===_0x89f5('0x82')){if('undefined'==typeof _0x1273fe[_0x89f5('0x7e')][_0x89f5('0x83')]){return _0x13d6c3(new Error(_0x89f5('0x84')));}if(_0x89f5('0x24')==typeof _0x1273fe[_0x89f5('0x7e')][_0x89f5('0x85')]){return _0x13d6c3(new Error(_0x89f5('0x86')));}}else{return _0x13d6c3(new Error(_0x89f5('0x87')));}var _0x5dc88d=_0x1273fe['name'];var _0x579447=_0x1273fe[_0x89f5('0x88')];var _0x514dc7=_0x1273fe[_0x89f5('0x39')];var _0x2e1c97=_0x1273fe[_0x89f5('0x89')]?_0x1273fe['sidebar']:_0x89f5('0x8a');var _0x42dc44=_0x1273fe[_0x89f5('0x8b')]?_0x1273fe['icon']:_0x89f5('0x8c');var _0x5c2ad7='';var _0x5dea68='';var _0x168bf2='';var _0x41df24='';var _0x358230=_0x1273fe[_0x89f5('0x7a')];if(_0x514dc7===_0x89f5('0x8d')){if(_0x89f5('0x24')!=typeof _0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')][_0x89f5('0x7f')]){var _0x26e257=_0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x89f5('0x8e')](_0x26e257)){_0x5c2ad7=path[_0x89f5('0x52')](_0x89f5('0x8f'),_0x5ea5e4,_0x20694e[0x0],_0x26e257);}else{_0x5c2ad7=_0x26e257;}}else{logger[_0x89f5('0x67')](_0x89f5('0x90'));}if('undefined'!=typeof _0x1273fe['parameters']['views'][_0x89f5('0x80')]){var _0x188e7a=_0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')][_0x89f5('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x89f5('0x8e')](_0x188e7a)){_0x5dea68=path[_0x89f5('0x52')]('plugins',_0x5ea5e4,_0x20694e[0x0],_0x188e7a);}else{_0x5dea68=_0x188e7a;}}else{logger[_0x89f5('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x514dc7===_0x89f5('0x82')){_0x168bf2=_0x1273fe[_0x89f5('0x7e')][_0x89f5('0x83')];_0x41df24=_0x1273fe[_0x89f5('0x7e')]['scriptPath'];if(_0x89f5('0x24')!=typeof _0x1273fe[_0x89f5('0x7e')]['views']){if(_0x89f5('0x24')!=typeof _0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')]['admin']){var _0x26e257=_0x1273fe[_0x89f5('0x7e')]['views'][_0x89f5('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x26e257)){_0x5c2ad7=path[_0x89f5('0x52')](_0x89f5('0x8f'),_0x5ea5e4,_0x20694e[0x0],_0x26e257);}else{_0x5c2ad7=_0x26e257;}}if(_0x89f5('0x24')!=typeof _0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')][_0x89f5('0x80')]){var _0x188e7a=_0x1273fe[_0x89f5('0x7e')][_0x89f5('0x7d')][_0x89f5('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x89f5('0x8e')](_0x188e7a)){_0x5dea68=path[_0x89f5('0x52')](_0x89f5('0x8f'),_0x5ea5e4,_0x20694e[0x0],_0x188e7a);}else{_0x5dea68=_0x188e7a;}}}}var _0x4f0c2d={'name':_0x5dc88d,'description':_0x579447,'path':path[_0x89f5('0x52')](_0x5ea5e4,_0x20694e[0x0]),'type':_0x514dc7,'sidebar':_0x2e1c97,'icon':_0x42dc44,'adminUrl':_0x5c2ad7,'agentUrl':_0x5dea68,'scriptName':_0x168bf2,'scriptPath':_0x41df24,'version':_0x358230};removeReferences(_0x7d75eb,null);return db[_0x89f5('0x36')][_0x89f5('0x91')](_0x4f0c2d)[_0x89f5('0x2d')](function(_0x30d512){var _0x4c5f39={'role':_0x37e90d[_0x89f5('0x92')][_0x89f5('0x93')],'userProfileId':_0x37e90d[_0x89f5('0x92')]['userProfileId']};if(!_0x4c5f39)throw new Error(_0x89f5('0x94'));if(_0x4c5f39['role']===_0x89f5('0x95')){var _0x28d2ac=_0x30d512['get']({'plain':!![]});return db['UserProfileSection'][_0x89f5('0x4f')]({'where':{'name':_0x89f5('0x96'),'userProfileId':_0x4c5f39[_0x89f5('0x97')]},'raw':!![]})[_0x89f5('0x2d')](function(_0x50e74c){if(_0x50e74c&&_0x50e74c[_0x89f5('0x98')]===0x0){return db['UserProfileResource'][_0x89f5('0x91')]({'name':_0x28d2ac['name'],'resourceId':_0x28d2ac['id'],'type':_0x50e74c[_0x89f5('0x33')],'sectionId':_0x50e74c['id']},{})[_0x89f5('0x2d')](function(){return _0x30d512;});}else{return _0x30d512;}})[_0x89f5('0x50')](function(_0x3e90c4){logger['error'](_0x89f5('0x99'),_0x3e90c4);throw _0x3e90c4;});}return _0x30d512;})[_0x89f5('0x2d')](respondWithResult(_0x573476,null))[_0x89f5('0x50')](handleError(_0x573476,null));}});}catch(_0x26e17c){_0x573476[_0x89f5('0x21')](0x1f4)[_0x89f5('0x9a')](_0x26e17c);}};function removeReferences(_0x1f2e99,_0x546bdb){try{if(_0x1f2e99){fs[_0x89f5('0x66')](_0x1f2e99);logger[_0x89f5('0x67')]('Zip\x20archive\x20removed');}if(_0x546bdb){rimraf(_0x546bdb,function(){});logger[_0x89f5('0x67')](_0x89f5('0x9b'));}}catch(_0x5c8eaf){logger[_0x89f5('0x31')](_0x5c8eaf);}}exports[_0x89f5('0x2c')]=function(_0xeab817,_0x31eb6d,_0x2187d4){return db[_0x89f5('0x36')][_0x89f5('0x4f')]({'where':{'id':_0xeab817['params']['id']}})[_0x89f5('0x2d')](handleEntityNotFound(_0x31eb6d,null))[_0x89f5('0x2d')](saveUpdates(_0xeab817[_0x89f5('0x92')],null))['then'](respondWithResult(_0x31eb6d,null))['catch'](handleError(_0x31eb6d,null));};exports['delete']=function(_0x53e967,_0x5e4312,_0x595b22){return db[_0x89f5('0x36')][_0x89f5('0x4f')]({'where':{'id':_0x53e967['params']['id']}})[_0x89f5('0x2d')](function(_0x1be0e5){if(_0x1be0e5){return _0x1be0e5[_0x89f5('0x30')]();}})[_0x89f5('0x2d')](function(_0x1d0971){rimraf(path[_0x89f5('0x52')](config['root'],_0x89f5('0x54'),path[_0x89f5('0x5f')](_0x1d0971[_0x89f5('0x8')])),function(){});return _0x1d0971;})['then'](handleEntityNotFound(_0x5e4312,null))['then'](respondWithStatusCode(_0x5e4312,null))[_0x89f5('0x50')](handleError(_0x5e4312,null));};exports[_0x89f5('0x9c')]=function(_0x100ce9,_0xca154c,_0x34e908){return BPromise[_0x89f5('0x9d')]()[_0x89f5('0x2d')](function(){if(!_0x100ce9[_0x89f5('0x3c')]['path']){throw new Error(_0x89f5('0x9e'));}if(!_0x100ce9['query'][_0x89f5('0x9f')]){throw new Error(_0x89f5('0xa0'));}var _0x4bc10f=_0x100ce9[_0x89f5('0x3c')][_0x89f5('0xa1')]?_0x100ce9[_0x89f5('0x3c')]['hostname']+':'+_0x100ce9[_0x89f5('0x3c')][_0x89f5('0x9f')]:_0x89f5('0xa2')+_0x100ce9[_0x89f5('0x3c')][_0x89f5('0x9f')];var _0x1e36d3=_0x100ce9[_0x89f5('0x3c')][_0x89f5('0xa3')]?_0x100ce9['query'][_0x89f5('0xa3')]:!![];var _0x53e888=_0x100ce9[_0x89f5('0x3c')][_0x89f5('0xa4')]?_0x100ce9[_0x89f5('0x3c')][_0x89f5('0xa4')]:null;var _0x1efcdc={'method':_0x100ce9[_0x89f5('0xa5')],'uri':util[_0x89f5('0x55')]('%s%s',_0x4bc10f,_0x100ce9[_0x89f5('0x3c')][_0x89f5('0x8')]),'json':_0x1e36d3,'resolveWithFullResponse':!![],'encoding':_0x53e888,'qs':_0x100ce9[_0x89f5('0x3c')]};if(_0x100ce9['headers']){_0x1efcdc[_0x89f5('0xa6')]=_0x100ce9['headers'];if(_0x1efcdc[_0x89f5('0xa6')]['content-length']){delete _0x1efcdc[_0x89f5('0xa6')][_0x89f5('0xa7')];}}if(_0x1efcdc[_0x89f5('0xa6')][_0x89f5('0xa8')]){delete _0x1efcdc[_0x89f5('0xa6')][_0x89f5('0xa8')];}return rp(_0x1efcdc);})[_0x89f5('0x2d')](function(_0xf6c2f4){if(_0xf6c2f4){_0xca154c['set'](_0xf6c2f4[_0x89f5('0xa6')]);logger[_0x89f5('0x67')](_0xf6c2f4[_0x89f5('0x92')]);if(_[_0x89f5('0xa9')](_0x100ce9[_0x89f5('0x3c')][_0x89f5('0x8')],_0x89f5('0x51'))&&_0xf6c2f4[_0x89f5('0xaa')]==0x1f4){return _0xca154c[_0x89f5('0xab')](_0xf6c2f4[_0x89f5('0xaa')]);}else{return _0xca154c[_0x89f5('0x21')](_0xf6c2f4[_0x89f5('0xaa')])[_0x89f5('0x9a')](_0xf6c2f4['body']);}}else{return _0xca154c[_0x89f5('0xab')](0xc8);}})[_0x89f5('0x50')](handleError(_0xca154c,null));};exports[_0x89f5('0xac')]=function(_0x5d8e05,_0x283d4d,_0x35bea0){return BPromise[_0x89f5('0x9d')]()[_0x89f5('0x2d')](function(){if(!_0x5d8e05[_0x89f5('0x3c')]['path']){throw new Error(_0x89f5('0x9e'));}if(!_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4cef97=_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0xa1')]?_0x5d8e05[_0x89f5('0x3c')]['hostname']+':'+_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0x9f')]:'http://localhost:'+_0x5d8e05['query']['port'];var _0x2c927c=_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0xa3')]?_0x5d8e05[_0x89f5('0x3c')]['json']:!![];var _0x57c4ab=_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0xa4')]?_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0xa4')]:null;var _0x875160={'method':_0x5d8e05[_0x89f5('0xa5')],'uri':util[_0x89f5('0x55')](_0x89f5('0xad'),_0x4cef97,_0x5d8e05[_0x89f5('0x3c')][_0x89f5('0x8')]),'json':_0x2c927c,'resolveWithFullResponse':!![],'encoding':_0x57c4ab,'body':_0x5d8e05['body']};if(_0x5d8e05[_0x89f5('0xa6')]){_0x875160[_0x89f5('0xa6')]=_0x5d8e05[_0x89f5('0xa6')];if(_0x875160[_0x89f5('0xa6')]['content-length']){delete _0x875160['headers'][_0x89f5('0xa7')];}}if(_0x875160[_0x89f5('0xa6')][_0x89f5('0xa8')]){delete _0x875160[_0x89f5('0xa6')][_0x89f5('0xa8')];}return rp(_0x875160);})[_0x89f5('0x2d')](function(_0x1d134e){if(_0x1d134e){_0x283d4d[_0x89f5('0x27')](_0x1d134e['headers']);logger[_0x89f5('0x67')](_0x1d134e['body']);return _0x283d4d[_0x89f5('0x21')](_0x1d134e[_0x89f5('0xaa')])[_0x89f5('0x9a')](_0x1d134e[_0x89f5('0x92')]);}else{return _0x283d4d[_0x89f5('0xab')](0xc8);}})[_0x89f5('0x50')](handleError(_0x283d4d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 6b635a0..d942102 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 _0xdbf5=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x35951b,_0x29a225){_0x35951b=_0x35951b-0x0;var _0x5d2ddd=_0xdbf5[_0x35951b];return _0x5d2ddd;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5dbf('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dbf('0x1'),'afterUpdate':_0x5dbf('0x2'),'afterDestroy':_0x5dbf('0x3')};function emitEvent(_0x3afe14){return function(_0x38b629,_0x1a1ea9,_0x776036){PluginEvents[_0x5dbf('0x4')](_0x3afe14+':'+_0x38b629['id'],_0x38b629);PluginEvents[_0x5dbf('0x4')](_0x3afe14,_0x38b629);_0x776036(null);};}for(var e in events){if(events[_0x5dbf('0x5')](e)){var event=events[e];Plugin[_0x5dbf('0x6')](e,emitEvent(event));}}module[_0x5dbf('0x7')]=PluginEvents; \ No newline at end of file +var _0x22ed=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x44b534,_0x6be022){var _0x2e7b00=function(_0x40912f){while(--_0x40912f){_0x44b534['push'](_0x44b534['shift']());}};_0x2e7b00(++_0x6be022);}(_0x22ed,0x1a9));var _0xd22e=function(_0x47681b,_0x3ca200){_0x47681b=_0x47681b-0x0;var _0x2793b1=_0x22ed[_0x47681b];return _0x2793b1;};'use strict';var EventEmitter=require(_0xd22e('0x0'));var Plugin=require(_0xd22e('0x1'))['db'][_0xd22e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd22e('0x3')](0x0);var events={'afterCreate':_0xd22e('0x4'),'afterUpdate':_0xd22e('0x5'),'afterDestroy':_0xd22e('0x6')};function emitEvent(_0x10244b){return function(_0x3a1306,_0x214c17,_0x3c4894){PluginEvents[_0xd22e('0x7')](_0x10244b+':'+_0x3a1306['id'],_0x3a1306);PluginEvents['emit'](_0x10244b,_0x3a1306);_0x3c4894(null);};}for(var e in events){if(events[_0xd22e('0x8')](e)){var event=events[e];Plugin[_0xd22e('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c1b0e42..d4473e7 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 _0x50a7=['exports','define','Plugin','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x4a289e,_0x50241f){var _0x3071dc=function(_0x40abea){while(--_0x40abea){_0x4a289e['push'](_0x4a289e['shift']());}};_0x3071dc(++_0x50241f);}(_0x50a7,0x155));var _0x750a=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0x50a7[_0x50148e];return _0x446e9d;};'use strict';var _=require('lodash');var util=require(_0x750a('0x0'));var logger=require(_0x750a('0x1'))(_0x750a('0x2'));var moment=require(_0x750a('0x3'));var BPromise=require(_0x750a('0x4'));var rp=require(_0x750a('0x5'));var fs=require('fs');var path=require(_0x750a('0x6'));var rimraf=require(_0x750a('0x7'));var config=require(_0x750a('0x8'));var attributes=require(_0x750a('0x9'));module[_0x750a('0xa')]=function(_0x15f6bf,_0x527e3a){return _0x15f6bf[_0x750a('0xb')](_0x750a('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92ea=['rimraf','../../config/environment','./plugin.attributes','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e576a,_0x18b159){var _0x145007=function(_0x9fc3d1){while(--_0x9fc3d1){_0x2e576a['push'](_0x2e576a['shift']());}};_0x145007(++_0x18b159);}(_0x92ea,0xcc));var _0xa92e=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0x92ea[_0x1ed034];return _0x4a82b7;};'use strict';var _=require(_0xa92e('0x0'));var util=require('util');var logger=require(_0xa92e('0x1'))(_0xa92e('0x2'));var moment=require(_0xa92e('0x3'));var BPromise=require(_0xa92e('0x4'));var rp=require(_0xa92e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa92e('0x6'));var config=require(_0xa92e('0x7'));var attributes=require(_0xa92e('0x8'));module['exports']=function(_0x4c4493,_0x42e7ce){return _0x4c4493[_0xa92e('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 0123b6a..7520af1 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 _0xed3a=['localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x4f3056,_0xe685f6){var _0x2b8af0=function(_0x3e04c2){while(--_0x3e04c2){_0x4f3056['push'](_0x4f3056['shift']());}};_0x2b8af0(++_0xe685f6);}(_0xed3a,0x175));var _0xaed3=function(_0x236961,_0x204ec5){_0x236961=_0x236961-0x0;var _0x1f9a93=_0xed3a[_0x236961];return _0x1f9a93;};'use strict';var _=require(_0xaed3('0x0'));var util=require(_0xaed3('0x1'));var moment=require(_0xaed3('0x2'));var BPromise=require(_0xaed3('0x3'));var rs=require(_0xaed3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaed3('0x5'));var logger=require(_0xaed3('0x6'))(_0xaed3('0x7'));var config=require(_0xaed3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaed3('0x9')]['http']({'port':0x232a});config[_0xaed3('0xa')]=_[_0xaed3('0xb')](config[_0xaed3('0xa')],{'host':_0xaed3('0xc'),'port':0x18eb});var socket=require(_0xaed3('0xd'))(new Redis(config[_0xaed3('0xa')]));require(_0xaed3('0xe'))[_0xaed3('0xf')](socket);function respondWithRpcPromise(_0x4c17e0,_0x40098d,_0x25e1ed){return new BPromise(function(_0x3beee0,_0x4db6cc){return client[_0xaed3('0x10')](_0x4c17e0,_0x25e1ed)[_0xaed3('0x11')](function(_0x1169ef){logger[_0xaed3('0x12')](_0xaed3('0x13'),_0x40098d,_0xaed3('0x14'));logger[_0xaed3('0x15')](_0xaed3('0x16'),_0x40098d,_0xaed3('0x14'),JSON[_0xaed3('0x17')](_0x1169ef));if(_0x1169ef[_0xaed3('0x18')]){if(_0x1169ef[_0xaed3('0x18')][_0xaed3('0x19')]===0x1f4){logger[_0xaed3('0x18')](_0xaed3('0x13'),_0x40098d,_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);return _0x4db6cc(_0x1169ef['error'][_0xaed3('0x1a')]);}logger[_0xaed3('0x18')](_0xaed3('0x13'),_0x40098d,_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);return _0x3beee0(_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);}else{logger[_0xaed3('0x12')](_0xaed3('0x13'),_0x40098d,_0xaed3('0x14'));_0x3beee0(_0x1169ef[_0xaed3('0x1b')][_0xaed3('0x1a')]);}})[_0xaed3('0x1c')](function(_0x22be78){logger['error'](_0xaed3('0x13'),_0x40098d,_0x22be78);_0x4db6cc(_0x22be78);});});}exports['CreatePlugin']=function(_0x3b47bd){var _0x54b2db=this;return new Promise(function(_0x370eae,_0x164dba){return db[_0xaed3('0x1d')][_0xaed3('0x1e')](_0x3b47bd[_0xaed3('0x1f')],{'raw':_0x3b47bd[_0xaed3('0x20')]?_0x3b47bd['options'][_0xaed3('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x133c0b){logger[_0xaed3('0x12')](_0xaed3('0x22'),_0x3b47bd);logger[_0xaed3('0x15')](_0xaed3('0x22'),_0x3b47bd,JSON[_0xaed3('0x17')](_0x133c0b));_0x370eae(_0x133c0b);})['catch'](function(_0x29cc56){logger[_0xaed3('0x18')](_0xaed3('0x22'),_0x29cc56[_0xaed3('0x1a')],_0x3b47bd);_0x164dba(_0x54b2db[_0xaed3('0x18')](0x1f4,_0x29cc56[_0xaed3('0x1a')]));});});}; \ No newline at end of file +var _0x01f5=['./plugin.socket','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','body','options','then','info','CreatePlugin','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x01f5,0x1f1));var _0x501f=function(_0x284772,_0x4f8dcc){_0x284772=_0x284772-0x0;var _0x4a41ec=_0x01f5[_0x284772];return _0x4a41ec;};'use strict';var _=require('lodash');var util=require(_0x501f('0x0'));var moment=require(_0x501f('0x1'));var BPromise=require(_0x501f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x501f('0x3'));var db=require(_0x501f('0x4'))['db'];var utils=require(_0x501f('0x5'));var logger=require(_0x501f('0x6'))(_0x501f('0x7'));var config=require(_0x501f('0x8'));var jayson=require(_0x501f('0x9'));var client=jayson[_0x501f('0xa')][_0x501f('0xb')]({'port':0x232a});config[_0x501f('0xc')]=_[_0x501f('0xd')](config['redis'],{'host':_0x501f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x501f('0xc')]));require(_0x501f('0xf'))[_0x501f('0x10')](socket);function respondWithRpcPromise(_0x5e7ad3,_0x5e646b,_0x5098ba){return new BPromise(function(_0x33fdd2,_0x2d7ad1){return client[_0x501f('0x11')](_0x5e7ad3,_0x5098ba)['then'](function(_0x35ff0e){logger['info'](_0x501f('0x12'),_0x5e646b,_0x501f('0x13'));logger[_0x501f('0x14')](_0x501f('0x15'),_0x5e646b,_0x501f('0x13'),JSON[_0x501f('0x16')](_0x35ff0e));if(_0x35ff0e[_0x501f('0x17')]){if(_0x35ff0e[_0x501f('0x17')]['code']===0x1f4){logger[_0x501f('0x17')]('Plugin,\x20%s,\x20%s',_0x5e646b,_0x35ff0e[_0x501f('0x17')][_0x501f('0x18')]);return _0x2d7ad1(_0x35ff0e[_0x501f('0x17')]['message']);}logger[_0x501f('0x17')]('Plugin,\x20%s,\x20%s',_0x5e646b,_0x35ff0e[_0x501f('0x17')]['message']);return _0x33fdd2(_0x35ff0e['error'][_0x501f('0x18')]);}else{logger['info'](_0x501f('0x12'),_0x5e646b,_0x501f('0x13'));_0x33fdd2(_0x35ff0e[_0x501f('0x19')]['message']);}})['catch'](function(_0x5ae8a4){logger[_0x501f('0x17')](_0x501f('0x12'),_0x5e646b,_0x5ae8a4);_0x2d7ad1(_0x5ae8a4);});});}exports['CreatePlugin']=function(_0x2441fb){var _0x457e76=this;return new Promise(function(_0xac7d51,_0x18fa17){return db['Plugin'][_0x501f('0x1a')](_0x2441fb[_0x501f('0x1b')],{'raw':_0x2441fb[_0x501f('0x1c')]?_0x2441fb[_0x501f('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x501f('0x1d')](function(_0x5939fa){logger[_0x501f('0x1e')](_0x501f('0x1f'),_0x2441fb);logger[_0x501f('0x14')](_0x501f('0x1f'),_0x2441fb,JSON[_0x501f('0x16')](_0x5939fa));_0xac7d51(_0x5939fa);})['catch'](function(_0x6c4f4e){logger[_0x501f('0x17')]('CreatePlugin',_0x6c4f4e['message'],_0x2441fb);_0x18fa17(_0x457e76[_0x501f('0x17')](0x1f4,_0x6c4f4e[_0x501f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1a5558d..3e61128 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 _0xd8f8=['removeListener','register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x404d9c,_0x596b0f){var _0x289bb5=function(_0x1e41c1){while(--_0x1e41c1){_0x404d9c['push'](_0x404d9c['shift']());}};_0x289bb5(++_0x596b0f);}(_0xd8f8,0x1eb));var _0x8d8f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd8f8[_0x46e363];return _0x3fb059;};'use strict';var PluginEvents=require(_0x8d8f('0x0'));var events=[_0x8d8f('0x1'),_0x8d8f('0x2'),_0x8d8f('0x3')];function createListener(_0x3734c9,_0x28c35d){return function(_0x4616ad){_0x28c35d[_0x8d8f('0x4')](_0x3734c9,_0x4616ad);};}function removeListener(_0x4c54d4,_0x2d4344){return function(){PluginEvents[_0x8d8f('0x5')](_0x4c54d4,_0x2d4344);};}exports[_0x8d8f('0x6')]=function(_0x2b6abf){for(var _0x39f56e=0x0,_0xe2c9d9=events['length'];_0x39f56e<_0xe2c9d9;_0x39f56e++){var _0x2b9495=events[_0x39f56e];var _0x396f70=createListener(_0x8d8f('0x7')+_0x2b9495,_0x2b6abf);PluginEvents['on'](_0x2b9495,_0x396f70);}}; \ No newline at end of file +var _0xfae0=['removeListener','plugin:','save','remove','update'];(function(_0x25261f,_0x127664){var _0x485219=function(_0xdcd262){while(--_0xdcd262){_0x25261f['push'](_0x25261f['shift']());}};_0x485219(++_0x127664);}(_0xfae0,0x188));var _0x0fae=function(_0x4ddc0e,_0x349cab){_0x4ddc0e=_0x4ddc0e-0x0;var _0x17a6a4=_0xfae0[_0x4ddc0e];return _0x17a6a4;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x0fae('0x0'),_0x0fae('0x1'),_0x0fae('0x2')];function createListener(_0xb87fa8,_0x3571ed){return function(_0x450edb){_0x3571ed['emit'](_0xb87fa8,_0x450edb);};}function removeListener(_0x3f907e,_0x7a0f47){return function(){PluginEvents[_0x0fae('0x3')](_0x3f907e,_0x7a0f47);};}exports['register']=function(_0x24194){for(var _0xf54e5d=0x0,_0x3b1ca5=events['length'];_0xf54e5d<_0x3b1ca5;_0xf54e5d++){var _0x219704=events[_0xf54e5d];var _0x47322c=createListener(_0x0fae('0x4')+_0x219704,_0x24194);PluginEvents['on'](_0x219704,_0x47322c);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d5dd941..ffcc1fa 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(_0x5339bd,_0x2b40ff){var _0x43a81e=function(_0x358306){while(--_0x358306){_0x5339bd['push'](_0x5339bd['shift']());}};_0x43a81e(++_0x2b40ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x21da9d,_0x3c4d4a){var _0x4f3efe=function(_0x444d75){while(--_0x444d75){_0x21da9d['push'](_0x21da9d['shift']());}};_0x4f3efe(++_0x3c4d4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 bdb9b39..e9d1609 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 _0x9aea=['join','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','params','create','body','script'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9aea,0xdd));var _0xa9ae=function(_0xa9b079,_0x231dca){_0xa9b079=_0xa9b079-0x0;var _0x20a579=_0x9aea[_0xa9b079];return _0x20a579;};'use strict';var _=require(_0xa9ae('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xa9ae('0x1'))('api');var path=require(_0xa9ae('0x2'));var exec=require(_0xa9ae('0x3'))['exec'];var BPromise=require(_0xa9ae('0x4'));function handleEntityNotFound(_0x115593,_0x41fb71){return function(_0x10f91d){if(!_0x10f91d){_0x115593[_0xa9ae('0x5')](0x194);;}return _0x10f91d;};}function respondWithResult(_0x56f942,_0x1aa3b9){_0x1aa3b9=_0x1aa3b9||0xc8;return function(_0x22734b){if(_0x22734b){return _0x56f942[_0xa9ae('0x6')](_0x1aa3b9)['json'](_0x22734b);}return null;};}function handleError(_0x1f2e4b,_0x3917f0){_0x3917f0=_0x3917f0||0x1f4;return function(_0x465bd2){logger[_0xa9ae('0x7')](_0x465bd2[_0xa9ae('0x8')]);if(_0x465bd2[_0xa9ae('0x9')]){delete _0x465bd2[_0xa9ae('0x9')];}_0x1f2e4b[_0xa9ae('0x6')](_0x3917f0)[_0xa9ae('0xa')](_0x465bd2);};}function execChildProcess(){return new BPromise(function(_0x5a8178,_0x3d400c){exec('npm\x20install',function(_0x2addd2,_0x226cf7,_0x112ab5){logger[_0xa9ae('0xb')](_0x226cf7);logger[_0xa9ae('0xb')](_0x112ab5);if(_0x2addd2){logger[_0xa9ae('0x7')](_0x2addd2);return _0x3d400c(_0x2addd2);}return _0x5a8178(_0x226cf7);});});}exports[_0xa9ae('0xc')]=function(_0x2b511a,_0x56de45){return pm2[_0xa9ae('0xd')]()[_0xa9ae('0xe')](function(_0x10882e){if(_0x10882e){var _0x3f7f61=_['reject'](_0x10882e,function(_0x28ce2d){return _0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0xf')||_0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0x10');});return{'rows':_0x3f7f61,'count':_0x3f7f61[_0xa9ae('0x11')]};}return null;})['then'](respondWithResult(_0x56de45,null))[_0xa9ae('0x12')](handleError(_0x56de45,null));};exports[_0xa9ae('0x13')]=function(_0x3e31d9,_0x4ac5a6){return pm2['describe'](_0x3e31d9[_0xa9ae('0x14')]['id'])['then'](respondWithResult(_0x4ac5a6,null))['then'](handleEntityNotFound(_0x4ac5a6,null))[_0xa9ae('0x12')](handleError(_0x4ac5a6,null));};exports[_0xa9ae('0x15')]=function(_0xbfd2ff,_0x42f961){if(_0xbfd2ff['body'][_0xa9ae('0x9')]&&_0xbfd2ff[_0xa9ae('0x16')][_0xa9ae('0x17')]){var _0x688153=path[_0xa9ae('0x18')](__dirname,_0xa9ae('0x19'),_0xbfd2ff[_0xa9ae('0x16')]['script']);var _0xc021cf=process['cwd']();process['chdir'](path['dirname'](_0x688153));return execChildProcess()['then'](function(_0x1afd07){process['chdir'](_0xc021cf);return pm2[_0xa9ae('0x1a')]({'name':_0xbfd2ff['body'][_0xa9ae('0x9')],'script':_0x688153});})[_0xa9ae('0xe')](function(_0x93d637){pm2[_0xa9ae('0x1b')]();return _0x93d637[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x42f961,0xc9))[_0xa9ae('0x12')](handleError(_0x42f961,null));}else{return _0x42f961[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x1c')});}};exports[_0xa9ae('0x1d')]=function(_0x2aac9e,_0xfe9ef1){if(_0x2aac9e[_0xa9ae('0x16')]['id']){delete _0x2aac9e[_0xa9ae('0x16')]['id'];}var _0xb12fa8={'online':'restart','stopped':'stop'};if(_0xb12fa8[_0xa9ae('0x1e')](_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')])){return pm2[_0xb12fa8[_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')]]](_0x2aac9e['params']['id'])['then'](respondWithResult(_0xfe9ef1,0xc8))[_0xa9ae('0x12')](handleError(_0xfe9ef1,null));}else{return _0xfe9ef1[_0xa9ae('0x6')](0x1f4)[_0xa9ae('0xa')]({'message':_0xa9ae('0x1f')});}};exports[_0xa9ae('0x20')]=function(_0x36bc28,_0x5d0c84){if(_0x36bc28['body']['id']){delete _0x36bc28[_0xa9ae('0x16')]['id'];}if(_0x36bc28[_0xa9ae('0x14')]['id']){return pm2[_0xa9ae('0x21')](_0x36bc28[_0xa9ae('0x14')]['id'])[_0xa9ae('0xe')](function(_0x231152){pm2[_0xa9ae('0x1b')]();return _0x231152[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x5d0c84,null))['catch'](handleError(_0x5d0c84,null));}else{return _0x5d0c84[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x22')});}}; \ No newline at end of file +var _0xcea2=['then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','update','restart','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','status','json','stack','name','send','npm\x20install','info','index','list'];(function(_0x3331f8,_0x492685){var _0x422f06=function(_0x1f950f){while(--_0x1f950f){_0x3331f8['push'](_0x3331f8['shift']());}};_0x422f06(++_0x492685);}(_0xcea2,0x15a));var _0x2cea=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xcea2[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x2cea('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2cea('0x1'))('api');var path=require(_0x2cea('0x2'));var exec=require(_0x2cea('0x3'))[_0x2cea('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3ff73f,_0x46060b){return function(_0x11596e){if(!_0x11596e){_0x3ff73f['sendStatus'](0x194);;}return _0x11596e;};}function respondWithResult(_0x34f0f2,_0x485c26){_0x485c26=_0x485c26||0xc8;return function(_0x2d69ff){if(_0x2d69ff){return _0x34f0f2[_0x2cea('0x5')](_0x485c26)[_0x2cea('0x6')](_0x2d69ff);}return null;};}function handleError(_0x160cca,_0x11c5c0){_0x11c5c0=_0x11c5c0||0x1f4;return function(_0x1519f6){logger['error'](_0x1519f6[_0x2cea('0x7')]);if(_0x1519f6[_0x2cea('0x8')]){delete _0x1519f6[_0x2cea('0x8')];}_0x160cca[_0x2cea('0x5')](_0x11c5c0)[_0x2cea('0x9')](_0x1519f6);};}function execChildProcess(){return new BPromise(function(_0x439c4d,_0x4298a4){exec(_0x2cea('0xa'),function(_0x58a102,_0x5724b0,_0x2fe9cd){logger[_0x2cea('0xb')](_0x5724b0);logger['info'](_0x2fe9cd);if(_0x58a102){logger['error'](_0x58a102);return _0x4298a4(_0x58a102);}return _0x439c4d(_0x5724b0);});});}exports[_0x2cea('0xc')]=function(_0x4e0da7,_0xa4ce3d){return pm2[_0x2cea('0xd')]()[_0x2cea('0xe')](function(_0x5cf805){if(_0x5cf805){var _0x4d7f8b=_['reject'](_0x5cf805,function(_0x369c72){return _0x369c72['name']===_0x2cea('0xf')||_0x369c72[_0x2cea('0x8')]===_0x2cea('0x10');});return{'rows':_0x4d7f8b,'count':_0x4d7f8b[_0x2cea('0x11')]};}return null;})[_0x2cea('0xe')](respondWithResult(_0xa4ce3d,null))[_0x2cea('0x12')](handleError(_0xa4ce3d,null));};exports[_0x2cea('0x13')]=function(_0x1ead4c,_0x5eee09){return pm2[_0x2cea('0x14')](_0x1ead4c[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x5eee09,null))[_0x2cea('0xe')](handleEntityNotFound(_0x5eee09,null))[_0x2cea('0x12')](handleError(_0x5eee09,null));};exports[_0x2cea('0x16')]=function(_0x5d75c4,_0x27375b){if(_0x5d75c4['body'][_0x2cea('0x8')]&&_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]){var _0x4fd3d5=path[_0x2cea('0x19')](__dirname,_0x2cea('0x1a'),_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]);var _0x3246bc=process[_0x2cea('0x1b')]();process[_0x2cea('0x1c')](path['dirname'](_0x4fd3d5));return execChildProcess()[_0x2cea('0xe')](function(_0x5e5b46){process[_0x2cea('0x1c')](_0x3246bc);return pm2['start']({'name':_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x8')],'script':_0x4fd3d5});})['then'](function(_0x41d272){pm2[_0x2cea('0x1d')]();return _0x41d272[0x0];})[_0x2cea('0xe')](respondWithResult(_0x27375b,0xc9))[_0x2cea('0x12')](handleError(_0x27375b,null));}else{return _0x27375b[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2cea('0x1e')]=function(_0x32b6a3,_0x2bbe9b){if(_0x32b6a3[_0x2cea('0x17')]['id']){delete _0x32b6a3[_0x2cea('0x17')]['id'];}var _0x3ea40c={'online':_0x2cea('0x1f'),'stopped':_0x2cea('0x20')};if(_0x3ea40c['hasOwnProperty'](_0x32b6a3[_0x2cea('0x17')][_0x2cea('0x5')])){return pm2[_0x3ea40c[_0x32b6a3['body'][_0x2cea('0x5')]]](_0x32b6a3[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x2bbe9b,0xc8))[_0x2cea('0x12')](handleError(_0x2bbe9b,null));}else{return _0x2bbe9b['status'](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x21')});}};exports['destroy']=function(_0x2bf4e9,_0x2e3d44){if(_0x2bf4e9[_0x2cea('0x17')]['id']){delete _0x2bf4e9[_0x2cea('0x17')]['id'];}if(_0x2bf4e9[_0x2cea('0x15')]['id']){return pm2[_0x2cea('0x22')](_0x2bf4e9[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](function(_0x2e1cd6){pm2[_0x2cea('0x1d')]();return _0x2e1cd6[0x0];})[_0x2cea('0xe')](respondWithResult(_0x2e3d44,null))['catch'](handleError(_0x2e3d44,null));}else{return _0x2e3d44[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 88b5b4f..cce2004 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 _0xdc6a=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdc6a,0x107));var _0xadc6=function(_0x45cb3a,_0x1c902e){_0x45cb3a=_0x45cb3a-0x0;var _0x4902a5=_0xdc6a[_0x45cb3a];return _0x4902a5;};'use strict';var express=require(_0xadc6('0x0'));var router=express[_0xadc6('0x1')]();var auth=require(_0xadc6('0x2'));var controller=require(_0xadc6('0x3'));router[_0xadc6('0x4')](_0xadc6('0x5'),auth[_0xadc6('0x6')](),controller['getAgents']);router[_0xadc6('0x4')]('/queues',auth['isAuthenticated'](),controller[_0xadc6('0x7')]);module[_0xadc6('0x8')]=router; \ No newline at end of file +var _0x081d=['Router','../../components/auth/service','./realtime.controller','get','/agents','getAgents','/queues','isAuthenticated','getQueues','express'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x081d,0x15d));var _0xd081=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0x081d[_0x144b30];return _0x1bb7bc;};'use strict';var express=require(_0xd081('0x0'));var router=express[_0xd081('0x1')]();var auth=require(_0xd081('0x2'));var controller=require(_0xd081('0x3'));router[_0xd081('0x4')](_0xd081('0x5'),auth['isAuthenticated'](),controller[_0xd081('0x6')]);router[_0xd081('0x4')](_0xd081('0x7'),auth[_0xd081('0x8')](),controller[_0xd081('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index ecffd0b..1aefa8d 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 _0x6aa8=['initializeQueues','lodash','util','../../components/realtime/agents','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','getAgents','getChannels','globalQueueFilter','globalStatusFilter','query','pauseTypeFilter','pause','*pause','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','then','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','type','key','role','agent','online','getOptions','raw','sequelize','literal','FIELD(id,','Pause','push','forEach','where','merge','user','userProfileId','Agents','extraQueryConditions','find','getAgentStatus','includes','sortAgentsByStatus','pick','catch','getQueues','resolve','isValidChannel','startCase','Queue','voice','outbound','dialActive','dialMethod','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','getRealtimeQueues'];(function(_0x32a2b7,_0x2bbc53){var _0x35cf16=function(_0x19cc96){while(--_0x19cc96){_0x32a2b7['push'](_0x32a2b7['shift']());}};_0x35cf16(++_0x2bbc53);}(_0x6aa8,0x19b));var _0x86aa=function(_0x333eaa,_0x3be00e){_0x333eaa=_0x333eaa-0x0;var _0x4091b4=_0x6aa8[_0x333eaa];return _0x4091b4;};'use strict';var _=require(_0x86aa('0x0'));var util=require(_0x86aa('0x1'));var rta=require(_0x86aa('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0x86aa('0x3'))['db'];var APIBadRequestError=require(_0x86aa('0x4'))[_0x86aa('0x5')];var APIHandleError=require(_0x86aa('0x4'))[_0x86aa('0x6')];function respondWithFilteredResult(_0x766866,_0x194566){return function(_0x448ef7){if(_0x448ef7){var _0x744f57=typeof _0x194566[_0x86aa('0x7')]===_0x86aa('0x8')&&typeof _0x194566[_0x86aa('0x9')]===_0x86aa('0x8');var _0x42c484=_0x448ef7[_0x86aa('0xa')];var _0x1efd17=_0x744f57?0x0:_0x194566['offset'];var _0x2e217c=_0x744f57?_0x448ef7[_0x86aa('0xa')]:_0x194566[_0x86aa('0x7')]+_0x194566[_0x86aa('0x9')];var _0x54180b;if(_0x2e217c>=_0x42c484){_0x2e217c=_0x42c484;_0x54180b=0xc8;}else{_0x54180b=0xce;}_0x766866[_0x86aa('0xb')](_0x54180b);return _0x766866[_0x86aa('0xc')](_0x86aa('0xd'),_0x1efd17+'-'+_0x2e217c+'/'+_0x42c484)['json'](_0x448ef7);}return null;};}exports[_0x86aa('0xe')]=function(_0x2347d2,_0x40793c){var _0xfac5fe={'count':0x0,'rows':[]};var _0x14cc17={};var _0x56fe13;var _0x43f0e2=utils[_0x86aa('0xf')]();var _0x526708;var _0x1200b9;var _0x2626f7=_0x2347d2['query'][_0x86aa('0x10')];var _0x146b2e=_0x2347d2['query'][_0x86aa('0x11')];var _0x24c0c2=_0x2347d2[_0x86aa('0x12')][_0x86aa('0x13')];var _0x157b89=_0x146b2e===_0x86aa('0x14')||_0x146b2e===_0x86aa('0x15')?!![]:![];var _0x1ee9e0=[];var _0x314c1c;var _0xcecb42;Promise['resolve']()['then'](function(){if(_0x2347d2[_0x86aa('0x12')]['channel']){if(!utils['isValidChannel'](_0x2347d2[_0x86aa('0x12')][_0x86aa('0x16')])){throw new APIBadRequestError(util[_0x86aa('0x17')](_0x86aa('0x18'),_0x2347d2[_0x86aa('0x12')][_0x86aa('0x16')]));}_0x56fe13=_0x2347d2['query']['channel'][_0x86aa('0x19')]();}if(!_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]||!_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]['includes'](_0x86aa('0x1b'))){_0x2347d2[_0x86aa('0x12')]['sort']=rta[_0x86aa('0x1c')](_0x2347d2[_0x86aa('0x12')]['sort']);return;}var _0x4b879d=rta[_0x86aa('0x1d')](_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]);_0x2347d2['query'][_0x86aa('0x1a')]=_0x4b879d[_0x86aa('0x1e')]['join'](',');_0x314c1c=_0x4b879d[_0x86aa('0x1f')];})[_0x86aa('0x20')](function(){if(!_0x2626f7){return[];}return rta[_0x86aa('0x21')](_0x2626f7,_0x56fe13);})[_0x86aa('0x20')](function(_0x236fc1){_0x1ee9e0=_0x236fc1;return rta['getRealtimeAgents']();})[_0x86aa('0x20')](function(_0x1337db){_0x1200b9=_0x1337db[_0x86aa('0x22')];if((!_0x146b2e||_0x157b89)&&!_0x314c1c){return _0x1ee9e0;}if(_0x314c1c&&!_0x146b2e){return rta[_0x86aa('0x23')](_0x1200b9,_0x1ee9e0,_0x314c1c);}else{return rta[_0x86aa('0x24')](_0x1200b9,_0x1ee9e0,_0x146b2e);}})['then'](function(_0xa9bc62){_0x1ee9e0=_0xa9bc62;var _0x388f25=![];if(_0x1ee9e0[_0x86aa('0x25')]===0x0){if(_0x2626f7||_0x146b2e){_0x388f25=!![];}if(_0x157b89){_0x388f25=![];}}if(_0x388f25){return _0xfac5fe;}var _0x2343a4=_[_0x86aa('0x26')](db[_0x86aa('0x27')][_0x86aa('0x28')],function(_0x1b95b9){return{'name':_0x1b95b9['fieldName'],'type':_0x1b95b9[_0x86aa('0x29')][_0x86aa('0x2a')]};});_0x2347d2[_0x86aa('0x12')][_0x86aa('0x2b')]=_0x86aa('0x2c');_0x2347d2[_0x86aa('0x12')][_0x86aa('0x2d')]=!![];_0x14cc17=qs[_0x86aa('0x2e')](_0x2343a4,_0x2347d2);_0x14cc17[_0x86aa('0x2f')]=!![];var _0x1e42e=[];if(_0x1ee9e0[_0x86aa('0x25')]>0x0){_0x1e42e['push']({'id':{'$in':_0x1ee9e0}});if(_0x314c1c&&!_0x146b2e){_0xcecb42=[db[_0x86aa('0x30')][_0x86aa('0x31')](_0x86aa('0x32')+_0x1ee9e0+')')];_0x14cc17[_0x86aa('0x1f')]=_0xcecb42;}}if(_0x157b89){_0x43f0e2['forEach'](function(_0x22b2be){var _0x154a35=!![];if(_0x146b2e===_0x86aa('0x15')&&_0x56fe13!==_0x22b2be){_0x154a35=![];}_0x1e42e['push']({[_0x22b2be+_0x86aa('0x33')]:_0x154a35});});if(_0x24c0c2){_0x1e42e[_0x86aa('0x34')]({'pauseType':_0x24c0c2});}}else if(_0x146b2e){_0x43f0e2[_0x86aa('0x35')](function(_0x497d84){_0x1e42e['push']({[_0x497d84+'Pause']:![]});});}_0x14cc17[_0x86aa('0x36')]=_[_0x86aa('0x37')](_0x14cc17[_0x86aa('0x36')],{'$and':_0x1e42e});if(_0x2347d2['user'][_0x86aa('0x2b')]===_0x86aa('0x38')){var _0x4bcc13={'params':{'id':_0x2347d2[_0x86aa('0x38')][_0x86aa('0x39')]},'query':{'section':_0x86aa('0x3a'),'role':_0x86aa('0x2c'),'online':!![],'raw':!![],'ids':_0x1ee9e0,'customSorting':_0xcecb42}};if(_0x157b89){_0x4bcc13[_0x86aa('0x12')][_0x86aa('0x3b')]=_0x1e42e;}_0x4bcc13[_0x86aa('0x12')]=Object['assign'](_0x4bcc13['query'],_0x2347d2['query']);delete _0x4bcc13[_0x86aa('0x12')]['id'];return db['UserProfile']['getResources'](_0x4bcc13);}return db[_0x86aa('0x27')]['findAndCountAll'](_0x14cc17);})[_0x86aa('0x20')](function(_0xe57bd0){_0xfac5fe['count']=_0xe57bd0[_0x86aa('0xa')];_0x526708=_0xe57bd0[_0x86aa('0x22')];return _0x526708[_0x86aa('0x26')](function(_0x487a6b){var _0x517771=_[_0x86aa('0x3c')](_0x1200b9,['id',_0x487a6b['id']]);if(_0x517771){var _0x524109=rta['filterAgentAttributes'](_0x517771);_[_0x86aa('0x37')](_0x487a6b,_0x524109);}_0x487a6b['globalStatus']=rta[_0x86aa('0x3d')](_0x487a6b);if(_0x487a6b['globalStatus'][_0x86aa('0x3e')]('pause')){_0x43f0e2[_0x86aa('0x35')](function(_0x764975){if(_0x487a6b[_0x764975+'Pause']){_0x487a6b[_0x764975+'Status']=_0x86aa('0x14');}});}return _0x487a6b;});})[_0x86aa('0x20')](function(_0x2ed9d0){if(!_0x314c1c||_0xcecb42){return _0x2ed9d0;}return rta[_0x86aa('0x3f')](_0x2ed9d0,_0x314c1c);})[_0x86aa('0x20')](function(_0x43f119){var _0x4f3e33=null;if(_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1e')]){var _0x1d075b=_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1e')]['split'](',');_0x4f3e33=_0x43f119['map'](function(_0x466df0){return _[_0x86aa('0x40')](_0x466df0,_0x1d075b);});}_0xfac5fe['rows']=_0x4f3e33||_0x43f119;return _0xfac5fe;})['then'](respondWithFilteredResult(_0x40793c,_0x14cc17))[_0x86aa('0x41')](APIHandleError(_0x40793c));};exports[_0x86aa('0x42')]=function(_0x30937d,_0x2ed954){var _0x29f02f={'count':0x0,'rows':[]};var _0x49587e={};var _0x36174c;var _0x48c733;var _0x3301e5;Promise[_0x86aa('0x43')]()['then'](function(){if(_0x30937d[_0x86aa('0x12')][_0x86aa('0x16')]){if(!utils[_0x86aa('0x44')](_0x30937d['query'][_0x86aa('0x16')])){throw new APIBadRequestError(util[_0x86aa('0x17')](_0x86aa('0x18'),_0x30937d[_0x86aa('0x12')][_0x86aa('0x16')]));}_0x36174c=_0x30937d[_0x86aa('0x12')]['channel'][_0x86aa('0x19')]();}var _0x532c90=_[_0x86aa('0x45')](_0x36174c)+_0x86aa('0x46');var _0x187a47=_['map'](db[_0x532c90][_0x86aa('0x28')],function(_0x4e0a2e){return{'name':_0x4e0a2e['fieldName'],'type':_0x4e0a2e[_0x86aa('0x29')]['key']};});if(!_0x30937d['query'][_0x86aa('0x1e')]){var _0x2f45f6=['id','name'];if(_0x36174c===_0x86aa('0x47')){_0x2f45f6[_0x86aa('0x34')]('type');if(_0x30937d['query']['type']===_0x86aa('0x48')){_0x2f45f6[_0x86aa('0x34')]([_0x86aa('0x49'),_0x86aa('0x4a')]);}}_0x30937d['query'][_0x86aa('0x1e')]=_0x2f45f6['join'](',');}_0x49587e=qs[_0x86aa('0x2e')](_0x187a47,_0x30937d);if(_0x30937d[_0x86aa('0x38')][_0x86aa('0x2b')]===_0x86aa('0x38')){var _0x246bd2={'params':{'id':_0x30937d[_0x86aa('0x38')][_0x86aa('0x39')]},'query':{'section':_0x36174c===_0x86aa('0x47')&&_0x30937d[_0x86aa('0x12')][_0x86aa('0x29')]==='outbound'?_0x86aa('0x4b'):_[_0x86aa('0x45')](_0x36174c)+'Queues','type':_0x30937d[_0x86aa('0x12')][_0x86aa('0x29')],'nolimit':!![],'sort':'name','filter':_0x30937d[_0x86aa('0x12')][_0x86aa('0x4c')]}};return db[_0x86aa('0x4d')][_0x86aa('0x4e')](_0x246bd2);}return db[_0x532c90][_0x86aa('0x4f')](_0x49587e);})[_0x86aa('0x20')](function(_0x289591){_0x29f02f[_0x86aa('0xa')]=_0x289591[_0x86aa('0xa')];_0x48c733=_0x289591[_0x86aa('0x22')];return rtq[_0x86aa('0x50')](_0x30937d,_0x36174c);})['then'](function(_0x4d9593){_0x3301e5=_0x4d9593[_0x86aa('0x22')];return rtq[_0x86aa('0x51')](_0x48c733,_0x3301e5,_0x36174c,_0x30937d[_0x86aa('0x12')]['type']);})[_0x86aa('0x20')](function(_0x454e32){_0x29f02f['rows']=_0x454e32;return _0x29f02f;})['then'](respondWithFilteredResult(_0x2ed954,_0x49587e))[_0x86aa('0x41')](APIHandleError(_0x2ed954));}; \ No newline at end of file +var _0x0a09=['undefined','limit','set','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','*pause','then','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','extraQueryConditions','UserProfile','getResources','findAndCountAll','count','find','merge','globalStatus','getAgentStatus','Status','fields','split','pick','catch','resolve','isValidChannel','toLowerCase','startCase','Queue','voice','outbound','dialMethod','QueueCampaigns','Queues','name','getRealtimeQueues','initializeQueues','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x0a09,0x140));var _0x90a0=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x0a09[_0x3e961c];return _0x474f9c;};'use strict';var _=require('lodash');var util=require('util');var rta=require(_0x90a0('0x0'));var rtq=require(_0x90a0('0x1'));var qs=require(_0x90a0('0x2'));var utils=require(_0x90a0('0x3'));var db=require(_0x90a0('0x4'))['db'];var APIBadRequestError=require(_0x90a0('0x5'))['APIBadRequestError'];var APIHandleError=require(_0x90a0('0x5'))[_0x90a0('0x6')];function respondWithFilteredResult(_0x22aae9,_0x315b07){return function(_0x5d5b5b){if(_0x5d5b5b){var _0x2de6cb=typeof _0x315b07[_0x90a0('0x7')]===_0x90a0('0x8')&&typeof _0x315b07[_0x90a0('0x9')]===_0x90a0('0x8');var _0x34acaf=_0x5d5b5b['count'];var _0x1fc275=_0x2de6cb?0x0:_0x315b07[_0x90a0('0x7')];var _0x24dc79=_0x2de6cb?_0x5d5b5b['count']:_0x315b07[_0x90a0('0x7')]+_0x315b07[_0x90a0('0x9')];var _0x586de8;if(_0x24dc79>=_0x34acaf){_0x24dc79=_0x34acaf;_0x586de8=0xc8;}else{_0x586de8=0xce;}_0x22aae9['status'](_0x586de8);return _0x22aae9[_0x90a0('0xa')](_0x90a0('0xb'),_0x1fc275+'-'+_0x24dc79+'/'+_0x34acaf)[_0x90a0('0xc')](_0x5d5b5b);}return null;};}exports['getAgents']=function(_0x4f275a,_0x14dbcc){var _0x4dd4e6={'count':0x0,'rows':[]};var _0x201cee={};var _0x1ac382;var _0x172ee5=utils[_0x90a0('0xd')]();var _0x2ee1ea;var _0x2ab094;var _0x26ad3e=_0x4f275a[_0x90a0('0xe')][_0x90a0('0xf')];var _0x57fb36=_0x4f275a[_0x90a0('0xe')][_0x90a0('0x10')];var _0x44e1fb=_0x4f275a[_0x90a0('0xe')]['pauseTypeFilter'];var _0x49cd7a=_0x57fb36==='pause'||_0x57fb36===_0x90a0('0x11')?!![]:![];var _0x469f29=[];var _0x591068;var _0x258363;Promise['resolve']()[_0x90a0('0x12')](function(){if(_0x4f275a[_0x90a0('0xe')]['channel']){if(!utils['isValidChannel'](_0x4f275a[_0x90a0('0xe')]['channel'])){throw new APIBadRequestError(util[_0x90a0('0x13')](_0x90a0('0x14'),_0x4f275a['query'][_0x90a0('0x15')]));}_0x1ac382=_0x4f275a['query']['channel']['toLowerCase']();}if(!_0x4f275a[_0x90a0('0xe')][_0x90a0('0x16')]||!_0x4f275a[_0x90a0('0xe')][_0x90a0('0x16')][_0x90a0('0x17')]('globalStatus')){_0x4f275a[_0x90a0('0xe')][_0x90a0('0x16')]=rta[_0x90a0('0x18')](_0x4f275a[_0x90a0('0xe')][_0x90a0('0x16')]);return;}var _0x1fd42f=rta[_0x90a0('0x19')](_0x4f275a[_0x90a0('0xe')]['sort']);_0x4f275a['query'][_0x90a0('0x16')]=_0x1fd42f['fields'][_0x90a0('0x1a')](',');_0x591068=_0x1fd42f[_0x90a0('0x1b')];})['then'](function(){if(!_0x26ad3e){return[];}return rta[_0x90a0('0x1c')](_0x26ad3e,_0x1ac382);})[_0x90a0('0x12')](function(_0x5e729b){_0x469f29=_0x5e729b;return rta[_0x90a0('0x1d')]();})['then'](function(_0x44ba8c){_0x2ab094=_0x44ba8c[_0x90a0('0x1e')];if((!_0x57fb36||_0x49cd7a)&&!_0x591068){return _0x469f29;}if(_0x591068&&!_0x57fb36){return rta[_0x90a0('0x1f')](_0x2ab094,_0x469f29,_0x591068);}else{return rta[_0x90a0('0x20')](_0x2ab094,_0x469f29,_0x57fb36);}})['then'](function(_0x5e8ab7){_0x469f29=_0x5e8ab7;var _0x321bcf=![];if(_0x469f29[_0x90a0('0x21')]===0x0){if(_0x26ad3e||_0x57fb36){_0x321bcf=!![];}if(_0x49cd7a){_0x321bcf=![];}}if(_0x321bcf){return _0x4dd4e6;}var _0x2dcea=_[_0x90a0('0x22')](db[_0x90a0('0x23')][_0x90a0('0x24')],function(_0x924c1a){return{'name':_0x924c1a[_0x90a0('0x25')],'type':_0x924c1a[_0x90a0('0x26')][_0x90a0('0x27')]};});_0x4f275a[_0x90a0('0xe')][_0x90a0('0x28')]=_0x90a0('0x29');_0x4f275a[_0x90a0('0xe')][_0x90a0('0x2a')]=!![];_0x201cee=qs[_0x90a0('0x2b')](_0x2dcea,_0x4f275a);_0x201cee[_0x90a0('0x2c')]=!![];var _0x34302d=[];if(_0x469f29[_0x90a0('0x21')]>0x0){_0x34302d[_0x90a0('0x2d')]({'id':{'$in':_0x469f29}});if(_0x591068&&!_0x57fb36){_0x258363=[db[_0x90a0('0x2e')][_0x90a0('0x2f')](_0x90a0('0x30')+_0x469f29+')')];_0x201cee[_0x90a0('0x1b')]=_0x258363;}}if(_0x49cd7a){_0x172ee5[_0x90a0('0x31')](function(_0x3143c8){var _0x51a0a4=!![];if(_0x57fb36===_0x90a0('0x11')&&_0x1ac382!==_0x3143c8){_0x51a0a4=![];}_0x34302d[_0x90a0('0x2d')]({[_0x3143c8+'Pause']:_0x51a0a4});});if(_0x44e1fb){_0x34302d[_0x90a0('0x2d')]({'pauseType':_0x44e1fb});}}else if(_0x57fb36){_0x172ee5[_0x90a0('0x31')](function(_0x583caf){_0x34302d['push']({[_0x583caf+_0x90a0('0x32')]:![]});});}_0x201cee['where']=_['merge'](_0x201cee[_0x90a0('0x33')],{'$and':_0x34302d});if(_0x4f275a[_0x90a0('0x34')][_0x90a0('0x28')]===_0x90a0('0x34')){var _0x3e262d={'params':{'id':_0x4f275a[_0x90a0('0x34')][_0x90a0('0x35')]},'query':{'section':_0x90a0('0x36'),'role':_0x90a0('0x29'),'online':!![],'raw':!![],'ids':_0x469f29,'customSorting':_0x258363}};if(_0x49cd7a){_0x3e262d[_0x90a0('0xe')][_0x90a0('0x37')]=_0x34302d;}_0x3e262d['query']=Object['assign'](_0x3e262d[_0x90a0('0xe')],_0x4f275a[_0x90a0('0xe')]);delete _0x3e262d[_0x90a0('0xe')]['id'];return db[_0x90a0('0x38')][_0x90a0('0x39')](_0x3e262d);}return db[_0x90a0('0x23')][_0x90a0('0x3a')](_0x201cee);})['then'](function(_0x335c4b){_0x4dd4e6[_0x90a0('0x3b')]=_0x335c4b[_0x90a0('0x3b')];_0x2ee1ea=_0x335c4b[_0x90a0('0x1e')];return _0x2ee1ea[_0x90a0('0x22')](function(_0x50c3c0){var _0x27d4b0=_[_0x90a0('0x3c')](_0x2ab094,['id',_0x50c3c0['id']]);if(_0x27d4b0){var _0x24bbaa=rta['filterAgentAttributes'](_0x27d4b0);_[_0x90a0('0x3d')](_0x50c3c0,_0x24bbaa);}_0x50c3c0[_0x90a0('0x3e')]=rta[_0x90a0('0x3f')](_0x50c3c0);if(_0x50c3c0[_0x90a0('0x3e')][_0x90a0('0x17')]('pause')){_0x172ee5['forEach'](function(_0x3015be){if(_0x50c3c0[_0x3015be+_0x90a0('0x32')]){_0x50c3c0[_0x3015be+_0x90a0('0x40')]='pause';}});}return _0x50c3c0;});})[_0x90a0('0x12')](function(_0x5cfb6f){if(!_0x591068||_0x258363){return _0x5cfb6f;}return rta['sortAgentsByStatus'](_0x5cfb6f,_0x591068);})[_0x90a0('0x12')](function(_0x1c86dd){var _0x3e011f=null;if(_0x4f275a['query'][_0x90a0('0x41')]){var _0x6d03a9=_0x4f275a[_0x90a0('0xe')][_0x90a0('0x41')][_0x90a0('0x42')](',');_0x3e011f=_0x1c86dd[_0x90a0('0x22')](function(_0x57bd68){return _[_0x90a0('0x43')](_0x57bd68,_0x6d03a9);});}_0x4dd4e6[_0x90a0('0x1e')]=_0x3e011f||_0x1c86dd;return _0x4dd4e6;})[_0x90a0('0x12')](respondWithFilteredResult(_0x14dbcc,_0x201cee))[_0x90a0('0x44')](APIHandleError(_0x14dbcc));};exports['getQueues']=function(_0x5c24c4,_0x5748a6){var _0x337df4={'count':0x0,'rows':[]};var _0x315055={};var _0x2fec6b;var _0x4b718a;var _0x43a3a4;Promise[_0x90a0('0x45')]()['then'](function(){if(_0x5c24c4[_0x90a0('0xe')]['channel']){if(!utils[_0x90a0('0x46')](_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x15')])){throw new APIBadRequestError(util[_0x90a0('0x13')](_0x90a0('0x14'),_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x15')]));}_0x2fec6b=_0x5c24c4['query'][_0x90a0('0x15')][_0x90a0('0x47')]();}var _0x46e81d=_[_0x90a0('0x48')](_0x2fec6b)+_0x90a0('0x49');var _0x2f7665=_[_0x90a0('0x22')](db[_0x46e81d][_0x90a0('0x24')],function(_0x18f2cc){return{'name':_0x18f2cc[_0x90a0('0x25')],'type':_0x18f2cc['type']['key']};});if(!_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x41')]){var _0x3c9a8c=['id','name'];if(_0x2fec6b===_0x90a0('0x4a')){_0x3c9a8c[_0x90a0('0x2d')]('type');if(_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x26')]===_0x90a0('0x4b')){_0x3c9a8c[_0x90a0('0x2d')](['dialActive',_0x90a0('0x4c')]);}}_0x5c24c4['query'][_0x90a0('0x41')]=_0x3c9a8c[_0x90a0('0x1a')](',');}_0x315055=qs[_0x90a0('0x2b')](_0x2f7665,_0x5c24c4);if(_0x5c24c4['user'][_0x90a0('0x28')]==='user'){var _0x54e634={'params':{'id':_0x5c24c4[_0x90a0('0x34')][_0x90a0('0x35')]},'query':{'section':_0x2fec6b===_0x90a0('0x4a')&&_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x26')]===_0x90a0('0x4b')?_0x90a0('0x4d'):_[_0x90a0('0x48')](_0x2fec6b)+_0x90a0('0x4e'),'type':_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x26')],'nolimit':!![],'sort':_0x90a0('0x4f'),'filter':_0x5c24c4[_0x90a0('0xe')]['filter']}};return db[_0x90a0('0x38')][_0x90a0('0x39')](_0x54e634);}return db[_0x46e81d]['findAndCountAll'](_0x315055);})[_0x90a0('0x12')](function(_0x89b229){_0x337df4[_0x90a0('0x3b')]=_0x89b229['count'];_0x4b718a=_0x89b229['rows'];return rtq[_0x90a0('0x50')](_0x5c24c4,_0x2fec6b);})['then'](function(_0x21c3e9){_0x43a3a4=_0x21c3e9[_0x90a0('0x1e')];return rtq[_0x90a0('0x51')](_0x4b718a,_0x43a3a4,_0x2fec6b,_0x5c24c4[_0x90a0('0xe')][_0x90a0('0x26')]);})['then'](function(_0x44e8aa){_0x337df4[_0x90a0('0x1e')]=_0x44e8aa;return _0x337df4;})[_0x90a0('0x12')](respondWithFilteredResult(_0x5748a6,_0x315055))[_0x90a0('0x44')](APIHandleError(_0x5748a6));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 82aa4bf..50f92d2 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x926354,_0x1552e7){var _0x1a9ec6=function(_0x318aa0){while(--_0x318aa0){_0x926354['push'](_0x926354['shift']());}};_0x1a9ec6(++_0x1552e7);}(_0xedd9,0xfc));var _0x9edd=function(_0x11324b,_0x2ab344){_0x11324b=_0x11324b-0x0;var _0x176ec1=_0xedd9[_0x11324b];return _0x176ec1;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x374ed1,_0x1d728c){var _0x12bc51=function(_0x41b3c3){while(--_0x41b3c3){_0x374ed1['push'](_0x374ed1['shift']());}};_0x12bc51(++_0x1d728c);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f997c70..8e2c955 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 _0xb242=['INTEGER','STRING','DATE','exports'];(function(_0x40571f,_0x4552d3){var _0x3fb2f9=function(_0x110d7b){while(--_0x110d7b){_0x40571f['push'](_0x40571f['shift']());}};_0x3fb2f9(++_0x4552d3);}(_0xb242,0x1f3));var _0x2b24=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xb242[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require('sequelize');module[_0x2b24('0x0')]={'state':{'type':Sequelize[_0x2b24('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2b24('0x2')]},'scheduledat':{'type':Sequelize[_0x2b24('0x3')]},'uniqueid':{'type':Sequelize[_0x2b24('0x2')]},'starttime':{'type':Sequelize[_0x2b24('0x3')]},'responsetime':{'type':Sequelize[_0x2b24('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2b24('0x2')]},'membername':{'type':Sequelize[_0x2b24('0x2')]}}; \ No newline at end of file +var _0x6c7b=['DATE','INTEGER','STRING','sequelize'];(function(_0x5881e9,_0x5c19ba){var _0x1c6fdd=function(_0x1ca471){while(--_0x1ca471){_0x5881e9['push'](_0x5881e9['shift']());}};_0x1c6fdd(++_0x5c19ba);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x684ef1,_0x5887f7){_0x684ef1=_0x684ef1-0x0;var _0xa80b7a=_0x6c7b[_0x684ef1];return _0xa80b7a;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb6c7('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb6c7('0x1')]},'responsetime':{'type':Sequelize[_0xb6c7('0x1')]},'ringtime':{'type':Sequelize[_0xb6c7('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb6c7('0x3')]},'membername':{'type':Sequelize[_0xb6c7('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0191a7c..8857b3f 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 _0xf1fd=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','lodash','util','api','moment','bluebird'];(function(_0x2986de,_0x156443){var _0x3ffe9b=function(_0x45222c){while(--_0x45222c){_0x2986de['push'](_0x2986de['shift']());}};_0x3ffe9b(++_0x156443);}(_0xf1fd,0x163));var _0xdf1f=function(_0x5371d7,_0x1f197e){_0x5371d7=_0x5371d7-0x0;var _0x46bc0c=_0xf1fd[_0x5371d7];return _0x46bc0c;};'use strict';var _=require(_0xdf1f('0x0'));var util=require(_0xdf1f('0x1'));var logger=require('../../config/logger')(_0xdf1f('0x2'));var moment=require(_0xdf1f('0x3'));var BPromise=require(_0xdf1f('0x4'));var rp=require(_0xdf1f('0x5'));var fs=require('fs');var path=require(_0xdf1f('0x6'));var rimraf=require(_0xdf1f('0x7'));var config=require(_0xdf1f('0x8'));var attributes=require(_0xdf1f('0x9'));module['exports']=function(_0x14b179,_0x5b0b98){return _0x14b179[_0xdf1f('0xa')](_0xdf1f('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21e7=['ReportAgentPreview','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x5cfd70,_0x123847){var _0x5dfe03=function(_0x22f74b){while(--_0x22f74b){_0x5cfd70['push'](_0x5cfd70['shift']());}};_0x5dfe03(++_0x123847);}(_0x21e7,0xb7));var _0x721e=function(_0x5c50f7,_0x312a25){_0x5c50f7=_0x5c50f7-0x0;var _0x41aa2d=_0x21e7[_0x5c50f7];return _0x41aa2d;};'use strict';var _=require(_0x721e('0x0'));var util=require(_0x721e('0x1'));var logger=require(_0x721e('0x2'))(_0x721e('0x3'));var moment=require(_0x721e('0x4'));var BPromise=require(_0x721e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x721e('0x6'));var rimraf=require(_0x721e('0x7'));var config=require(_0x721e('0x8'));var attributes=require(_0x721e('0x9'));module[_0x721e('0xa')]=function(_0x2f2ffa,_0x267cb0){return _0x2f2ffa[_0x721e('0xb')](_0x721e('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 7b5d1ae..9ece182 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 _0x2d32=['debug','stringify','error','code','message','info','result','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x25dd24,_0x1ed9e1){var _0x2f13eb=function(_0x4fa0d5){while(--_0x4fa0d5){_0x25dd24['push'](_0x25dd24['shift']());}};_0x2f13eb(++_0x1ed9e1);}(_0x2d32,0xf5));var _0x22d3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x2d32[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x22d3('0x0'));var util=require(_0x22d3('0x1'));var moment=require(_0x22d3('0x2'));var BPromise=require(_0x22d3('0x3'));var rs=require(_0x22d3('0x4'));var fs=require('fs');var Redis=require(_0x22d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x22d3('0x6'));var logger=require(_0x22d3('0x7'))('rpc');var config=require(_0x22d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x22d3('0x9')][_0x22d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20d7d1,_0x279a2b,_0x463800){return new BPromise(function(_0x25f94b,_0x120a12){return client[_0x22d3('0xb')](_0x20d7d1,_0x463800)[_0x22d3('0xc')](function(_0x5bfdfa){logger['info'](_0x22d3('0xd'),_0x279a2b,_0x22d3('0xe'));logger[_0x22d3('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x279a2b,_0x22d3('0xe'),JSON[_0x22d3('0x10')](_0x5bfdfa));if(_0x5bfdfa[_0x22d3('0x11')]){if(_0x5bfdfa['error'][_0x22d3('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x5bfdfa[_0x22d3('0x11')][_0x22d3('0x13')]);return _0x120a12(_0x5bfdfa[_0x22d3('0x11')]['message']);}logger[_0x22d3('0x11')](_0x22d3('0xd'),_0x279a2b,_0x5bfdfa['error'][_0x22d3('0x13')]);return _0x25f94b(_0x5bfdfa[_0x22d3('0x11')]['message']);}else{logger[_0x22d3('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x22d3('0xe'));_0x25f94b(_0x5bfdfa[_0x22d3('0x15')][_0x22d3('0x13')]);}})['catch'](function(_0x18648f){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x18648f);_0x120a12(_0x18648f);});});}exports['CreateReportAgentPreview']=function(_0x23edbf){var _0x47639d=this;return new Promise(function(_0x2db0f9,_0x48fb5f){return db['ReportAgentPreview'][_0x22d3('0x16')](_0x23edbf['body'],{'raw':_0x23edbf[_0x22d3('0x17')]?_0x23edbf['options'][_0x22d3('0x18')]===undefined?!![]:![]:!![]})[_0x22d3('0xc')](function(_0x328a9a){logger[_0x22d3('0x14')]('CreateReportAgentPreview',_0x23edbf);logger[_0x22d3('0xf')]('CreateReportAgentPreview',_0x23edbf,JSON[_0x22d3('0x10')](_0x328a9a));_0x2db0f9(_0x328a9a);})[_0x22d3('0x19')](function(_0x6e3993){logger['error']('CreateReportAgentPreview',_0x6e3993['message'],_0x23edbf);_0x48fb5f(_0x47639d[_0x22d3('0x11')](0x1f4,_0x6e3993['message']));});});}; \ No newline at end of file +var _0x4fb3=['util','../../config/utils','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4fb3,0xbd));var _0x34fb=function(_0x13e8c8,_0x291240){_0x13e8c8=_0x13e8c8-0x0;var _0x34156b=_0x4fb3[_0x13e8c8];return _0x34156b;};'use strict';var _=require('lodash');var util=require(_0x34fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34fb('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x34fb('0x2'));var jayson=require(_0x34fb('0x3'));var client=jayson['client'][_0x34fb('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x555ecd,_0x407150,_0x4ac14e){return new BPromise(function(_0x5a1766,_0x40b6b8){return client['request'](_0x555ecd,_0x4ac14e)[_0x34fb('0x5')](function(_0x2a9a7a){logger[_0x34fb('0x6')]('ReportAgentPreview,\x20%s,\x20%s',_0x407150,'request\x20sent');logger[_0x34fb('0x7')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x407150,_0x34fb('0x8'),JSON['stringify'](_0x2a9a7a));if(_0x2a9a7a['error']){if(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xa')]===0x1f4){logger[_0x34fb('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x407150,_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);return _0x40b6b8(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);}logger['error'](_0x34fb('0xc'),_0x407150,_0x2a9a7a[_0x34fb('0x9')]['message']);return _0x5a1766(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);}else{logger[_0x34fb('0x6')]('ReportAgentPreview,\x20%s,\x20%s',_0x407150,_0x34fb('0x8'));_0x5a1766(_0x2a9a7a[_0x34fb('0xd')][_0x34fb('0xb')]);}})[_0x34fb('0xe')](function(_0x3c10c1){logger[_0x34fb('0x9')](_0x34fb('0xc'),_0x407150,_0x3c10c1);_0x40b6b8(_0x3c10c1);});});}exports[_0x34fb('0xf')]=function(_0x13dd9d){var _0x5f5034=this;return new Promise(function(_0x499abe,_0x5e58e){return db[_0x34fb('0x10')][_0x34fb('0x11')](_0x13dd9d[_0x34fb('0x12')],{'raw':_0x13dd9d[_0x34fb('0x13')]?_0x13dd9d[_0x34fb('0x13')][_0x34fb('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x244bd5){logger[_0x34fb('0x6')]('CreateReportAgentPreview',_0x13dd9d);logger[_0x34fb('0x7')](_0x34fb('0xf'),_0x13dd9d,JSON['stringify'](_0x244bd5));_0x499abe(_0x244bd5);})[_0x34fb('0xe')](function(_0x1ff9d9){logger[_0x34fb('0x9')](_0x34fb('0xf'),_0x1ff9d9[_0x34fb('0xb')],_0x13dd9d);_0x5e58e(_0x5f5034['error'](0x1f4,_0x1ff9d9[_0x34fb('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0f1a82b..5b57a47 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 _0x7ae6=['/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put','/voice/queues/:id','/outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','telephones','/trunks','trunks','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','post','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','util','express','Router','../../components/auth/service','./rpc.controller','get'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7ae6,0x94));var _0x67ae=function(_0x5ed485,_0x442036){_0x5ed485=_0x5ed485-0x0;var _0x35ff78=_0x7ae6[_0x5ed485];return _0x35ff78;};'use strict';var multer=require('multer');var util=require(_0x67ae('0x0'));var path=require('path');var express=require(_0x67ae('0x1'));var router=express[_0x67ae('0x2')]();var auth=require(_0x67ae('0x3'));var controller=require(_0x67ae('0x4'));router[_0x67ae('0x5')](_0x67ae('0x6'),auth['isAuthenticated'](),controller[_0x67ae('0x7')]);router[_0x67ae('0x5')](_0x67ae('0x8'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xa')]);router['get'](_0x67ae('0xb'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xc')]);router[_0x67ae('0x5')](_0x67ae('0xd'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xe')]);router[_0x67ae('0x5')](_0x67ae('0xf'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x10')]);router[_0x67ae('0x5')](_0x67ae('0x11'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x12')]);router[_0x67ae('0x5')](_0x67ae('0x13'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x14')]);router[_0x67ae('0x5')](_0x67ae('0x15'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x16')]);router[_0x67ae('0x5')]('/sms/queues',auth[_0x67ae('0x9')](),controller[_0x67ae('0x17')]);router[_0x67ae('0x5')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x67ae('0x18')]);router['get']('/fax/queues',auth[_0x67ae('0x9')](),controller[_0x67ae('0x19')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x67ae('0x1a')]);router['get'](_0x67ae('0x1b'),auth['isAuthenticated'](),controller[_0x67ae('0x1c')]);router[_0x67ae('0x5')](_0x67ae('0x1d'),auth['isAuthenticated'](),controller[_0x67ae('0x1e')]);router[_0x67ae('0x5')](_0x67ae('0x1f'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x20')]);router[_0x67ae('0x5')](_0x67ae('0x21'),auth['isAuthenticated'](),controller[_0x67ae('0x22')]);router[_0x67ae('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x67ae('0x23')](_0x67ae('0x24'),auth[_0x67ae('0x9')](),controller['updateVoiceQueue']);router[_0x67ae('0x5')](_0x67ae('0x25'),auth['isAuthenticated'](),controller['outbound']);router[_0x67ae('0x5')](_0x67ae('0x26'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x27')]);router[_0x67ae('0x5')](_0x67ae('0x28'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x29')]);router[_0x67ae('0x23')]('/agents/:id/capacity',auth[_0x67ae('0x9')](),controller['agentCapacity']);router[_0x67ae('0x5')](_0x67ae('0x2a'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x2b')]);router[_0x67ae('0x5')](_0x67ae('0x2c'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x2d')]);router['get']('/campaigns',auth['isAuthenticated'](),controller['campaigns']);router[_0x67ae('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x67ae('0x2e')]);router['get'](_0x67ae('0x2f'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x67ae('0x5')](_0x67ae('0x30'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x67ae('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x67ae('0x9')](),controller[_0x67ae('0x31')]);router[_0x67ae('0x5')](_0x67ae('0x32'),auth[_0x67ae('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x67ae('0x5')](_0x67ae('0x33'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x34')]);router[_0x67ae('0x5')](_0x67ae('0x35'),auth['isAuthenticated'](),controller[_0x67ae('0x36')]);router['get'](_0x67ae('0x37'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x38')]);router['post'](_0x67ae('0x39'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')](_0x67ae('0x3b')));router[_0x67ae('0x5')](_0x67ae('0x3c'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3d')]);router['post'](_0x67ae('0x3e'),auth['isAuthenticated'](),controller[_0x67ae('0x3a')](_0x67ae('0x3f')));router[_0x67ae('0x5')](_0x67ae('0x40'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x67ae('0x41'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')]('fax'));router['get'](_0x67ae('0x42'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x43')]);router['post'](_0x67ae('0x44'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')]('openchannel'));router['get'](_0x67ae('0x45'),auth[_0x67ae('0x9')](),controller['showOpenchannelQueues']);router[_0x67ae('0x46')]('/sms/queues/:id/notify',auth[_0x67ae('0x9')](),controller['queueNotify'](_0x67ae('0x47')));router['post']('/whatsapp/queues/:id/notify',auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')](_0x67ae('0x48')));router[_0x67ae('0x5')](_0x67ae('0x49'),auth['isAuthenticated'](),controller[_0x67ae('0x4a')]);router[_0x67ae('0x5')]('/whatsapp/queues/:id',auth[_0x67ae('0x9')](),controller[_0x67ae('0x4b')]);router['post'](_0x67ae('0x4c'),auth[_0x67ae('0x9')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x33eb=['faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions'];(function(_0x39e54f,_0x1c1f59){var _0x4a6b4f=function(_0x2cad3c){while(--_0x2cad3c){_0x39e54f['push'](_0x39e54f['shift']());}};_0x4a6b4f(++_0x1c1f59);}(_0x33eb,0x6d));var _0xb33e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33eb[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xb33e('0x0'));var util=require(_0xb33e('0x1'));var path=require('path');var express=require('express');var router=express[_0xb33e('0x2')]();var auth=require(_0xb33e('0x3'));var controller=require(_0xb33e('0x4'));router[_0xb33e('0x5')](_0xb33e('0x6'),auth['isAuthenticated'](),controller[_0xb33e('0x7')]);router[_0xb33e('0x5')](_0xb33e('0x8'),auth[_0xb33e('0x9')](),controller[_0xb33e('0xa')]);router[_0xb33e('0x5')](_0xb33e('0xb'),auth[_0xb33e('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0xb33e('0x5')]('/voice/queues',auth[_0xb33e('0x9')](),controller['voiceQueues']);router[_0xb33e('0x5')](_0xb33e('0xc'),auth['isAuthenticated'](),controller[_0xb33e('0xd')]);router[_0xb33e('0x5')](_0xb33e('0xe'),auth[_0xb33e('0x9')](),controller[_0xb33e('0xf')]);router['get'](_0xb33e('0x10'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x11')]);router[_0xb33e('0x5')](_0xb33e('0x12'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x13')]);router[_0xb33e('0x5')](_0xb33e('0x14'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x15')]);router[_0xb33e('0x5')](_0xb33e('0x16'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x17')]);router[_0xb33e('0x5')](_0xb33e('0x18'),auth[_0xb33e('0x9')](),controller['faxQueues']);router[_0xb33e('0x5')](_0xb33e('0x19'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x1a')]);router[_0xb33e('0x5')](_0xb33e('0x1b'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x1c')]);router[_0xb33e('0x5')](_0xb33e('0x1d'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x1e')]);router[_0xb33e('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0xb33e('0x1f')]);router[_0xb33e('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0xb33e('0x20')]);router['get'](_0xb33e('0x21'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x22')]);router[_0xb33e('0x23')](_0xb33e('0x21'),auth['isAuthenticated'](),controller[_0xb33e('0x24')]);router[_0xb33e('0x5')](_0xb33e('0x25'),auth[_0xb33e('0x9')](),controller['outbound']);router[_0xb33e('0x5')](_0xb33e('0x26'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x27')]);router[_0xb33e('0x5')](_0xb33e('0x28'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x29')]);router[_0xb33e('0x23')](_0xb33e('0x2a'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x2b')]);router[_0xb33e('0x5')](_0xb33e('0x2c'),auth[_0xb33e('0x9')](),controller['telephones']);router['get'](_0xb33e('0x2d'),auth['isAuthenticated'](),controller[_0xb33e('0x2e')]);router['get'](_0xb33e('0x2f'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x30')]);router[_0xb33e('0x5')]('/fax/accounts',auth[_0xb33e('0x9')](),controller[_0xb33e('0x31')]);router['get'](_0xb33e('0x32'),auth[_0xb33e('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xb33e('0x5')](_0xb33e('0x33'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x34')]);router[_0xb33e('0x5')](_0xb33e('0x35'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x36')]);router['get'](_0xb33e('0x37'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x38')]);router[_0xb33e('0x5')]('/sms/queues/waitinginteractions',auth[_0xb33e('0x9')](),controller[_0xb33e('0x39')]);router['get'](_0xb33e('0x3a'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x3b')]);router[_0xb33e('0x5')](_0xb33e('0x3c'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x3d')]);router[_0xb33e('0x3e')](_0xb33e('0x3f'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x40')](_0xb33e('0x41')));router[_0xb33e('0x5')](_0xb33e('0x42'),auth['isAuthenticated'](),controller[_0xb33e('0x43')]);router[_0xb33e('0x3e')](_0xb33e('0x44'),auth['isAuthenticated'](),controller['queueNotify'](_0xb33e('0x45')));router['get'](_0xb33e('0x46'),auth[_0xb33e('0x9')](),controller['showChatQueues']);router['post'](_0xb33e('0x47'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x40')](_0xb33e('0x48')));router[_0xb33e('0x5')](_0xb33e('0x49'),auth[_0xb33e('0x9')](),controller['showFaxQueues']);router[_0xb33e('0x3e')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xb33e('0x40')](_0xb33e('0x4a')));router[_0xb33e('0x5')](_0xb33e('0x4b'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x4c')]);router[_0xb33e('0x3e')](_0xb33e('0x4d'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x40')]('sms'));router['post'](_0xb33e('0x4e'),auth[_0xb33e('0x9')](),controller[_0xb33e('0x40')](_0xb33e('0x4f')));router[_0xb33e('0x5')]('/sms/queues/:id',auth[_0xb33e('0x9')](),controller[_0xb33e('0x50')]);router[_0xb33e('0x5')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0xb33e('0x51')]);router[_0xb33e('0x3e')](_0xb33e('0x52'),auth['isAuthenticated'](),controller[_0xb33e('0x53')]);module[_0xb33e('0x54')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 3c4602e..da62ed7 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 _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x211440,_0x4af2bc){var _0x14522b=function(_0xc16dd){while(--_0xc16dd){_0x211440['push'](_0x211440['shift']());}};_0x14522b(++_0x4af2bc);}(_0x55ca,0x126));var _0xa55c=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x55ca[_0x999b85];return _0x1d7124;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));}; \ No newline at end of file +var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x52c5f0,_0x2a1b61){var _0x596d1f=function(_0x22c24f){while(--_0x22c24f){_0x52c5f0['push'](_0x52c5f0['shift']());}};_0x596d1f(++_0x2a1b61);}(_0x2d17,0x17e));var _0x72d1=function(_0x4e0fbc,_0x3323d8){_0x4e0fbc=_0x4e0fbc-0x0;var _0x404283=_0x2d17[_0x4e0fbc];return _0x404283;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 741c3f4..83c802b 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 _0x7ab3=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','show','/:id/run','isAuthenticated','post','put','update','delete','destroy','exports'];(function(_0x1ff7f9,_0x7f4e5d){var _0x42f261=function(_0xa4451a){while(--_0xa4451a){_0x1ff7f9['push'](_0x1ff7f9['shift']());}};_0x42f261(++_0x7f4e5d);}(_0x7ab3,0x1ee));var _0x37ab=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0x7ab3[_0x4a563b];return _0x2935ef;};'use strict';var multer=require(_0x37ab('0x0'));var util=require('util');var path=require(_0x37ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x37ab('0x2'));var router=express[_0x37ab('0x3')]();var fs_extra=require(_0x37ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37ab('0x5'));var config=require(_0x37ab('0x6'));var controller=require(_0x37ab('0x7'));router[_0x37ab('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x37ab('0x8')](_0x37ab('0x9'),auth['isAuthenticated'](),controller[_0x37ab('0xa')]);router['get'](_0x37ab('0xb'),auth[_0x37ab('0xc')](),controller['run']);router[_0x37ab('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x37ab('0xe')](_0x37ab('0x9'),auth['isAuthenticated'](),controller[_0x37ab('0xf')]);router[_0x37ab('0x10')](_0x37ab('0x9'),auth[_0x37ab('0xc')](),controller[_0x37ab('0x11')]);module[_0x37ab('0x12')]=router; \ No newline at end of file +var _0x94f8=['get','index','/:id','isAuthenticated','/:id/run','run','post','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','./schedule.controller'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x94f8,0x1b9));var _0x894f=function(_0x2b84d5,_0x428914){_0x2b84d5=_0x2b84d5-0x0;var _0x51452a=_0x94f8[_0x2b84d5];return _0x51452a;};'use strict';var multer=require(_0x894f('0x0'));var util=require(_0x894f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x894f('0x2'));var router=express[_0x894f('0x3')]();var fs_extra=require(_0x894f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x894f('0x5'));var config=require('../../config/environment');var controller=require(_0x894f('0x6'));router[_0x894f('0x7')]('/',auth['isAuthenticated'](),controller[_0x894f('0x8')]);router[_0x894f('0x7')](_0x894f('0x9'),auth[_0x894f('0xa')](),controller['show']);router['get'](_0x894f('0xb'),auth[_0x894f('0xa')](),controller[_0x894f('0xc')]);router[_0x894f('0xd')]('/',auth[_0x894f('0xa')](),controller['create']);router['put']('/:id',auth[_0x894f('0xa')](),controller['update']);router[_0x894f('0xe')](_0x894f('0x9'),auth['isAuthenticated'](),controller[_0x894f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6d11bb7..c900bb5 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 _0xb03d=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','days','hours','csv','pdf','ENUM'];(function(_0x4598de,_0x3db5b5){var _0x2b9b8b=function(_0x5a7059){while(--_0x5a7059){_0x4598de['push'](_0x4598de['shift']());}};_0x2b9b8b(++_0x3db5b5);}(_0xb03d,0x1f0));var _0xdb03=function(_0x3ee916,_0x2aa2ed){_0x3ee916=_0x3ee916-0x0;var _0x301658=_0xb03d[_0x3ee916];return _0x301658;};'use strict';var Sequelize=require(_0xdb03('0x0'));module[_0xdb03('0x1')]={'name':{'type':Sequelize[_0xdb03('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdb03('0x2')]},'active':{'type':Sequelize[_0xdb03('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdb03('0x2')],'allowNull':![],'defaultValue':_0xdb03('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xdb03('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdb03('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xdb03('0x7'),_0xdb03('0x8'),'weeks',_0xdb03('0x9'),_0xdb03('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xdb03('0x9')},'output':{'type':Sequelize['ENUM'](_0xdb03('0xb'),_0xdb03('0xc'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xdb03('0xd')](_0xdb03('0xe'),_0xdb03('0xf')),'allowNull':![],'defaultValue':_0xdb03('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xdb03('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xdb03('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xdb03('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xeb4a=['csv','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','minutes','days','xlsx'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeb4a,0x16b));var _0xaeb4=function(_0x343cd7,_0x24c5eb){_0x343cd7=_0x343cd7-0x0;var _0x37c4f3=_0xeb4a[_0x343cd7];return _0x37c4f3;};'use strict';var Sequelize=require(_0xaeb4('0x0'));module['exports']={'name':{'type':Sequelize[_0xaeb4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xaeb4('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xaeb4('0x1')],'allowNull':![],'defaultValue':_0xaeb4('0x3')},'startAt':{'type':Sequelize[_0xaeb4('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xaeb4('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xaeb4('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xaeb4('0x6')](_0xaeb4('0x7'),'quarters',_0xaeb4('0x8'),'weeks','days','hours',_0xaeb4('0x9')),'allowNull':![],'defaultValue':_0xaeb4('0xa')},'output':{'type':Sequelize[_0xaeb4('0x6')]('csv','pdf',_0xaeb4('0xb')),'allowNull':![],'defaultValue':_0xaeb4('0xc')},'type':{'type':Sequelize[_0xaeb4('0x6')]('custom',_0xaeb4('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xaeb4('0x1')]},'cc':{'type':Sequelize[_0xaeb4('0xe')]},'bcc':{'type':Sequelize[_0xaeb4('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xaeb4('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index aef76c6..d0245d7 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 _0xa7c3=['model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','Schedule','includeAll','findAll','catch','show','params','keys','fields','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','filters','intersection'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa7c3,0x113));var _0x3a7c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa7c3[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x3a7c('0x0'));var rimraf=require(_0x3a7c('0x1'));var zipdir=require(_0x3a7c('0x2'));var jsonpatch=require(_0x3a7c('0x3'));var rp=require(_0x3a7c('0x4'));var moment=require(_0x3a7c('0x5'));var BPromise=require(_0x3a7c('0x6'));var Mustache=require(_0x3a7c('0x7'));var util=require(_0x3a7c('0x8'));var path=require(_0x3a7c('0x9'));var sox=require(_0x3a7c('0xa'));var csv=require(_0x3a7c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a7c('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a7c('0xb'));var querystring=require(_0x3a7c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3a7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3a7c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a7c('0x11'));var logger=require(_0x3a7c('0x12'))(_0x3a7c('0x13'));var utils=require('../../config/utils');var config=require(_0x3a7c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfb4a4,_0x513e08){_0x513e08=_0x513e08||0xcc;return function(_0x35f80b){if(_0x35f80b){return _0xfb4a4[_0x3a7c('0x15')](_0x513e08);}return _0xfb4a4[_0x3a7c('0x16')](_0x513e08)[_0x3a7c('0x17')]();};}function respondWithResult(_0x129660,_0x5d3d51){_0x5d3d51=_0x5d3d51||0xc8;return function(_0x52ead3){if(_0x52ead3){return _0x129660[_0x3a7c('0x16')](_0x5d3d51)[_0x3a7c('0x18')](_0x52ead3);}};}function respondWithFilteredResult(_0x1d8bb6,_0x1fa321){return function(_0x1d3ed5){if(_0x1d3ed5){var _0x20f24b=typeof _0x1fa321[_0x3a7c('0x19')]===_0x3a7c('0x1a')&&typeof _0x1fa321['limit']==='undefined';var _0x49305c=_0x1d3ed5['count'];var _0x1b7b33=_0x20f24b?0x0:_0x1fa321['offset'];var _0x239f11=_0x20f24b?_0x1d3ed5[_0x3a7c('0x1b')]:_0x1fa321[_0x3a7c('0x19')]+_0x1fa321[_0x3a7c('0x1c')];var _0x574697;if(_0x239f11>=_0x49305c){_0x239f11=_0x49305c;_0x574697=0xc8;}else{_0x574697=0xce;}_0x1d8bb6['status'](_0x574697);return _0x1d8bb6[_0x3a7c('0x1d')](_0x3a7c('0x1e'),_0x1b7b33+'-'+_0x239f11+'/'+_0x49305c)[_0x3a7c('0x18')](_0x1d3ed5);}return null;};}function patchUpdates(_0x45ba0f){return function(_0x2a2194){try{jsonpatch['apply'](_0x2a2194,_0x45ba0f,!![]);}catch(_0x579f4b){return BPromise['reject'](_0x579f4b);}return _0x2a2194[_0x3a7c('0x1f')]();};}function saveUpdates(_0x15eaad,_0x2c3c86){return function(_0x34697c){if(_0x34697c){return _0x34697c[_0x3a7c('0x20')](_0x15eaad)[_0x3a7c('0x21')](function(_0x39c932){return _0x39c932;});}return null;};}function removeEntity(_0x101b6c,_0x5a5b9d){return function(_0x137a68){if(_0x137a68){return _0x137a68['destroy']()[_0x3a7c('0x21')](function(){var _0xb7a0c1=_0x137a68[_0x3a7c('0x22')]({'plain':!![]});var _0x328f63=_0x3a7c('0x23');return db[_0x3a7c('0x24')][_0x3a7c('0x25')]({'where':{'type':_0x328f63,'resourceId':_0xb7a0c1['id']}})['then'](function(){return _0x137a68;});})['then'](function(){_0x101b6c[_0x3a7c('0x16')](0xcc)[_0x3a7c('0x17')]();});}};}function handleEntityNotFound(_0x2ad487,_0x378161){return function(_0x35c9cf){if(!_0x35c9cf){_0x2ad487[_0x3a7c('0x15')](0x194);}return _0x35c9cf;};}function handleError(_0x368dec,_0x35a01c){_0x35a01c=_0x35a01c||0x1f4;return function(_0x375a3a){logger[_0x3a7c('0x26')](_0x375a3a[_0x3a7c('0x27')]);if(_0x375a3a[_0x3a7c('0x28')]){delete _0x375a3a[_0x3a7c('0x28')];}_0x368dec[_0x3a7c('0x16')](_0x35a01c)[_0x3a7c('0x29')](_0x375a3a);};}exports['index']=function(_0x341338,_0x3fbf87){var _0x67bce0={},_0x21f0a2={},_0x55cd18={'count':0x0,'rows':[]};var _0x217e55=_[_0x3a7c('0x2a')](db['Schedule'][_0x3a7c('0x2b')],function(_0x353d44){return{'name':_0x353d44['fieldName'],'type':_0x353d44[_0x3a7c('0x2c')][_0x3a7c('0x2d')]};});_0x21f0a2['model']=_['map'](_0x217e55,_0x3a7c('0x28'));_0x21f0a2[_0x3a7c('0x2e')]=_['keys'](_0x341338[_0x3a7c('0x2e')]);_0x21f0a2[_0x3a7c('0x2f')]=_[_0x3a7c('0x30')](_0x21f0a2[_0x3a7c('0x31')],_0x21f0a2[_0x3a7c('0x2e')]);_0x67bce0[_0x3a7c('0x32')]=_['intersection'](_0x21f0a2[_0x3a7c('0x31')],qs['fields'](_0x341338[_0x3a7c('0x2e')]['fields']));_0x67bce0[_0x3a7c('0x32')]=_0x67bce0[_0x3a7c('0x32')][_0x3a7c('0x33')]?_0x67bce0['attributes']:_0x21f0a2[_0x3a7c('0x31')];if(!_0x341338['query'][_0x3a7c('0x34')](_0x3a7c('0x35'))){_0x67bce0[_0x3a7c('0x1c')]=qs[_0x3a7c('0x1c')](_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x1c')]);_0x67bce0[_0x3a7c('0x19')]=qs[_0x3a7c('0x19')](_0x341338[_0x3a7c('0x2e')]['offset']);}_0x67bce0[_0x3a7c('0x36')]=qs[_0x3a7c('0x37')](_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x37')]);_0x67bce0[_0x3a7c('0x38')]=qs['filters'](_[_0x3a7c('0x39')](_0x341338[_0x3a7c('0x2e')],_0x21f0a2[_0x3a7c('0x2f')]),_0x217e55);if(_0x341338['query']['filter']){_0x67bce0['where']=_['merge'](_0x67bce0[_0x3a7c('0x38')],{'$or':_[_0x3a7c('0x2a')](_0x217e55,function(_0x139500){if(_0x139500[_0x3a7c('0x2c')]!==_0x3a7c('0x3a')){var _0x3503da={};_0x3503da[_0x139500[_0x3a7c('0x28')]]={'$like':'%'+_0x341338[_0x3a7c('0x2e')]['filter']+'%'};return _0x3503da;}})});}_0x67bce0=_[_0x3a7c('0x3b')]({},_0x67bce0,_0x341338['options']);var _0x26c89f={'where':_0x67bce0[_0x3a7c('0x38')]};return db[_0x3a7c('0x3c')][_0x3a7c('0x1b')](_0x26c89f)[_0x3a7c('0x21')](function(_0x350c94){_0x55cd18[_0x3a7c('0x1b')]=_0x350c94;if(_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x3d')]){_0x67bce0['include']=[{'all':!![]}];}return db[_0x3a7c('0x3c')][_0x3a7c('0x3e')](_0x67bce0);})[_0x3a7c('0x21')](function(_0x1eca9d){_0x55cd18['rows']=_0x1eca9d;return _0x55cd18;})[_0x3a7c('0x21')](respondWithFilteredResult(_0x3fbf87,_0x67bce0))[_0x3a7c('0x3f')](handleError(_0x3fbf87,null));};exports[_0x3a7c('0x40')]=function(_0x511ec2,_0x2153c6){var _0x4cf608={'raw':![],'where':{'id':_0x511ec2[_0x3a7c('0x41')]['id']}},_0x4e5fa5={};_0x4e5fa5['model']=_['keys'](db['Schedule']['rawAttributes']);_0x4e5fa5[_0x3a7c('0x2e')]=_[_0x3a7c('0x42')](_0x511ec2[_0x3a7c('0x2e')]);_0x4e5fa5[_0x3a7c('0x2f')]=_[_0x3a7c('0x30')](_0x4e5fa5['model'],_0x4e5fa5[_0x3a7c('0x2e')]);_0x4cf608[_0x3a7c('0x32')]=_[_0x3a7c('0x30')](_0x4e5fa5['model'],qs['fields'](_0x511ec2[_0x3a7c('0x2e')][_0x3a7c('0x43')]));_0x4cf608[_0x3a7c('0x32')]=_0x4cf608[_0x3a7c('0x32')]['length']?_0x4cf608['attributes']:_0x4e5fa5[_0x3a7c('0x31')];if(_0x511ec2[_0x3a7c('0x2e')][_0x3a7c('0x3d')]){_0x4cf608[_0x3a7c('0x44')]=[{'all':!![]}];}_0x4cf608=_['merge']({},_0x4cf608,_0x511ec2[_0x3a7c('0x45')]);return db['Schedule'][_0x3a7c('0x46')](_0x4cf608)[_0x3a7c('0x21')](handleEntityNotFound(_0x2153c6,null))[_0x3a7c('0x21')](respondWithResult(_0x2153c6,null))[_0x3a7c('0x3f')](handleError(_0x2153c6,null));};exports[_0x3a7c('0x47')]=function(_0x5ded66,_0x1f9f26){return db['Schedule'][_0x3a7c('0x47')](_0x5ded66[_0x3a7c('0x48')],{})[_0x3a7c('0x21')](function(_0x50232a){var _0xd9820=_0x5ded66[_0x3a7c('0x49')][_0x3a7c('0x22')]({'plain':!![]});if(!_0xd9820)throw new Error(_0x3a7c('0x4a'));if(_0xd9820[_0x3a7c('0x4b')]==='user'){var _0x27d64b=_0x50232a[_0x3a7c('0x22')]({'plain':!![]});var _0x9d13a1=_0x3a7c('0x23');return db[_0x3a7c('0x4c')][_0x3a7c('0x46')]({'where':{'name':_0x9d13a1,'userProfileId':_0xd9820[_0x3a7c('0x4d')]},'raw':!![]})[_0x3a7c('0x21')](function(_0x4b4f64){if(_0x4b4f64&&_0x4b4f64['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x27d64b['name'],'resourceId':_0x27d64b['id'],'type':_0x4b4f64[_0x3a7c('0x28')],'sectionId':_0x4b4f64['id']},{})[_0x3a7c('0x21')](function(){return _0x50232a;});}else{return _0x50232a;}})[_0x3a7c('0x3f')](function(_0x270024){logger['error'](_0x3a7c('0x4e'),_0x270024);throw _0x270024;});}return _0x50232a;})[_0x3a7c('0x21')](respondWithResult(_0x1f9f26,0xc9))[_0x3a7c('0x3f')](handleError(_0x1f9f26,null));};exports[_0x3a7c('0x20')]=function(_0x55168b,_0x379a26){if(_0x55168b['body']['id']){delete _0x55168b[_0x3a7c('0x48')]['id'];}return db['Schedule']['find']({'where':{'id':_0x55168b['params']['id']}})[_0x3a7c('0x21')](handleEntityNotFound(_0x379a26,null))[_0x3a7c('0x21')](saveUpdates(_0x55168b[_0x3a7c('0x48')],null))[_0x3a7c('0x21')](respondWithResult(_0x379a26,null))[_0x3a7c('0x3f')](handleError(_0x379a26,null));};exports[_0x3a7c('0x25')]=function(_0x291042,_0x2baa63){return db[_0x3a7c('0x3c')][_0x3a7c('0x46')]({'where':{'id':_0x291042[_0x3a7c('0x41')]['id']}})['then'](handleEntityNotFound(_0x2baa63,null))[_0x3a7c('0x21')](removeEntity(_0x2baa63,null))[_0x3a7c('0x3f')](handleError(_0x2baa63,null));};exports[_0x3a7c('0x4f')]=function(_0x660b50,_0x5a4238,_0x54e27a){var _0x292639=require(_0x3a7c('0x50'));return db['Schedule'][_0x3a7c('0x46')]({'where':{'id':_0x660b50[_0x3a7c('0x41')]['id']},'raw':!![]})[_0x3a7c('0x21')](handleEntityNotFound(_0x5a4238,null))[_0x3a7c('0x21')](function(){_0x292639['run'](_0x660b50[_0x3a7c('0x41')]['id']);})['then'](respondWithStatusCode(_0x5a4238,null))[_0x3a7c('0x3f')](handleError(_0x5a4238,null));}; \ No newline at end of file +var _0xc9b3=['map','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','params','keys','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','get','then','error','stack','name','send','Schedule','rawAttributes','fieldName','type','key','model'];(function(_0x30ab9d,_0x33df2d){var _0x507ac6=function(_0x3c401a){while(--_0x3c401a){_0x30ab9d['push'](_0x30ab9d['shift']());}};_0x507ac6(++_0x33df2d);}(_0xc9b3,0x7f));var _0x3c9b=function(_0x35ad2c,_0x18b597){_0x35ad2c=_0x35ad2c-0x0;var _0x34b81c=_0xc9b3[_0x35ad2c];return _0x34b81c;};'use strict';var emlformat=require(_0x3c9b('0x0'));var rimraf=require(_0x3c9b('0x1'));var zipdir=require(_0x3c9b('0x2'));var jsonpatch=require(_0x3c9b('0x3'));var rp=require(_0x3c9b('0x4'));var moment=require(_0x3c9b('0x5'));var BPromise=require(_0x3c9b('0x6'));var Mustache=require(_0x3c9b('0x7'));var util=require(_0x3c9b('0x8'));var path=require(_0x3c9b('0x9'));var sox=require(_0x3c9b('0xa'));var csv=require('to-csv');var ejs=require(_0x3c9b('0xb'));var fs=require('fs');var fs_extra=require(_0x3c9b('0xc'));var _=require('lodash');var squel=require(_0x3c9b('0xd'));var crypto=require(_0x3c9b('0xe'));var jsforce=require(_0x3c9b('0xf'));var deskjs=require(_0x3c9b('0x10'));var toCsv=require(_0x3c9b('0x11'));var querystring=require(_0x3c9b('0x12'));var Papa=require(_0x3c9b('0x13'));var Redis=require(_0x3c9b('0x14'));var authService=require(_0x3c9b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9b('0x16'));var hardwareService=require(_0x3c9b('0x17'));var logger=require(_0x3c9b('0x18'))(_0x3c9b('0x19'));var utils=require(_0x3c9b('0x1a'));var config=require(_0x3c9b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c9b('0x1c'))['db'];function respondWithStatusCode(_0x33786a,_0x2755c1){_0x2755c1=_0x2755c1||0xcc;return function(_0x53ddf2){if(_0x53ddf2){return _0x33786a[_0x3c9b('0x1d')](_0x2755c1);}return _0x33786a['status'](_0x2755c1)[_0x3c9b('0x1e')]();};}function respondWithResult(_0x1aaaf9,_0x3448d6){_0x3448d6=_0x3448d6||0xc8;return function(_0x42c690){if(_0x42c690){return _0x1aaaf9[_0x3c9b('0x1f')](_0x3448d6)['json'](_0x42c690);}};}function respondWithFilteredResult(_0xec52c2,_0xfd48b8){return function(_0x26da30){if(_0x26da30){var _0x2182d4=typeof _0xfd48b8[_0x3c9b('0x20')]===_0x3c9b('0x21')&&typeof _0xfd48b8['limit']===_0x3c9b('0x21');var _0x5f5b7a=_0x26da30[_0x3c9b('0x22')];var _0x10043e=_0x2182d4?0x0:_0xfd48b8[_0x3c9b('0x20')];var _0x54073e=_0x2182d4?_0x26da30[_0x3c9b('0x22')]:_0xfd48b8[_0x3c9b('0x20')]+_0xfd48b8[_0x3c9b('0x23')];var _0x517726;if(_0x54073e>=_0x5f5b7a){_0x54073e=_0x5f5b7a;_0x517726=0xc8;}else{_0x517726=0xce;}_0xec52c2[_0x3c9b('0x1f')](_0x517726);return _0xec52c2[_0x3c9b('0x24')](_0x3c9b('0x25'),_0x10043e+'-'+_0x54073e+'/'+_0x5f5b7a)[_0x3c9b('0x26')](_0x26da30);}return null;};}function patchUpdates(_0x1a0284){return function(_0x40541d){try{jsonpatch[_0x3c9b('0x27')](_0x40541d,_0x1a0284,!![]);}catch(_0x2bc159){return BPromise[_0x3c9b('0x28')](_0x2bc159);}return _0x40541d[_0x3c9b('0x29')]();};}function saveUpdates(_0x4a1cb6,_0x245bff){return function(_0x43b9f9){if(_0x43b9f9){return _0x43b9f9['update'](_0x4a1cb6)['then'](function(_0x563793){return _0x563793;});}return null;};}function removeEntity(_0x24857b,_0x5eeb84){return function(_0x1c8f5d){if(_0x1c8f5d){return _0x1c8f5d[_0x3c9b('0x2a')]()['then'](function(){var _0x422a97=_0x1c8f5d[_0x3c9b('0x2b')]({'plain':!![]});var _0x13d0c5='Scheduler';return db['UserProfileResource'][_0x3c9b('0x2a')]({'where':{'type':_0x13d0c5,'resourceId':_0x422a97['id']}})[_0x3c9b('0x2c')](function(){return _0x1c8f5d;});})['then'](function(){_0x24857b[_0x3c9b('0x1f')](0xcc)[_0x3c9b('0x1e')]();});}};}function handleEntityNotFound(_0x269416,_0x36369f){return function(_0x3d8a50){if(!_0x3d8a50){_0x269416[_0x3c9b('0x1d')](0x194);}return _0x3d8a50;};}function handleError(_0x42fba3,_0x2a6d96){_0x2a6d96=_0x2a6d96||0x1f4;return function(_0x21f5ba){logger[_0x3c9b('0x2d')](_0x21f5ba[_0x3c9b('0x2e')]);if(_0x21f5ba[_0x3c9b('0x2f')]){delete _0x21f5ba[_0x3c9b('0x2f')];}_0x42fba3[_0x3c9b('0x1f')](_0x2a6d96)[_0x3c9b('0x30')](_0x21f5ba);};}exports['index']=function(_0x3409ad,_0x5378c9){var _0x3a0f76={},_0xb7709c={},_0x1affce={'count':0x0,'rows':[]};var _0x501a4b=_['map'](db[_0x3c9b('0x31')][_0x3c9b('0x32')],function(_0x3c3248){return{'name':_0x3c3248[_0x3c9b('0x33')],'type':_0x3c3248[_0x3c9b('0x34')][_0x3c9b('0x35')]};});_0xb7709c[_0x3c9b('0x36')]=_[_0x3c9b('0x37')](_0x501a4b,_0x3c9b('0x2f'));_0xb7709c['query']=_['keys'](_0x3409ad['query']);_0xb7709c[_0x3c9b('0x38')]=_[_0x3c9b('0x39')](_0xb7709c[_0x3c9b('0x36')],_0xb7709c['query']);_0x3a0f76['attributes']=_[_0x3c9b('0x39')](_0xb7709c['model'],qs['fields'](_0x3409ad['query'][_0x3c9b('0x3a')]));_0x3a0f76[_0x3c9b('0x3b')]=_0x3a0f76['attributes'][_0x3c9b('0x3c')]?_0x3a0f76[_0x3c9b('0x3b')]:_0xb7709c['model'];if(!_0x3409ad[_0x3c9b('0x3d')][_0x3c9b('0x3e')](_0x3c9b('0x3f'))){_0x3a0f76[_0x3c9b('0x23')]=qs[_0x3c9b('0x23')](_0x3409ad[_0x3c9b('0x3d')][_0x3c9b('0x23')]);_0x3a0f76[_0x3c9b('0x20')]=qs[_0x3c9b('0x20')](_0x3409ad[_0x3c9b('0x3d')][_0x3c9b('0x20')]);}_0x3a0f76[_0x3c9b('0x40')]=qs[_0x3c9b('0x41')](_0x3409ad[_0x3c9b('0x3d')]['sort']);_0x3a0f76['where']=qs[_0x3c9b('0x38')](_[_0x3c9b('0x42')](_0x3409ad[_0x3c9b('0x3d')],_0xb7709c[_0x3c9b('0x38')]),_0x501a4b);if(_0x3409ad['query'][_0x3c9b('0x43')]){_0x3a0f76[_0x3c9b('0x44')]=_[_0x3c9b('0x45')](_0x3a0f76[_0x3c9b('0x44')],{'$or':_[_0x3c9b('0x37')](_0x501a4b,function(_0x4a0551){if(_0x4a0551[_0x3c9b('0x34')]!=='VIRTUAL'){var _0x201473={};_0x201473[_0x4a0551[_0x3c9b('0x2f')]]={'$like':'%'+_0x3409ad[_0x3c9b('0x3d')]['filter']+'%'};return _0x201473;}})});}_0x3a0f76=_[_0x3c9b('0x45')]({},_0x3a0f76,_0x3409ad[_0x3c9b('0x46')]);var _0x149895={'where':_0x3a0f76[_0x3c9b('0x44')]};return db[_0x3c9b('0x31')][_0x3c9b('0x22')](_0x149895)[_0x3c9b('0x2c')](function(_0x4469f4){_0x1affce[_0x3c9b('0x22')]=_0x4469f4;if(_0x3409ad[_0x3c9b('0x3d')][_0x3c9b('0x47')]){_0x3a0f76[_0x3c9b('0x48')]=[{'all':!![]}];}return db['Schedule'][_0x3c9b('0x49')](_0x3a0f76);})['then'](function(_0x3b064f){_0x1affce['rows']=_0x3b064f;return _0x1affce;})[_0x3c9b('0x2c')](respondWithFilteredResult(_0x5378c9,_0x3a0f76))['catch'](handleError(_0x5378c9,null));};exports['show']=function(_0xa0dbcf,_0xfb8d03){var _0x6f1445={'raw':![],'where':{'id':_0xa0dbcf[_0x3c9b('0x4a')]['id']}},_0x292fe6={};_0x292fe6[_0x3c9b('0x36')]=_['keys'](db[_0x3c9b('0x31')][_0x3c9b('0x32')]);_0x292fe6[_0x3c9b('0x3d')]=_[_0x3c9b('0x4b')](_0xa0dbcf['query']);_0x292fe6[_0x3c9b('0x38')]=_[_0x3c9b('0x39')](_0x292fe6[_0x3c9b('0x36')],_0x292fe6[_0x3c9b('0x3d')]);_0x6f1445[_0x3c9b('0x3b')]=_[_0x3c9b('0x39')](_0x292fe6['model'],qs['fields'](_0xa0dbcf[_0x3c9b('0x3d')][_0x3c9b('0x3a')]));_0x6f1445['attributes']=_0x6f1445[_0x3c9b('0x3b')][_0x3c9b('0x3c')]?_0x6f1445[_0x3c9b('0x3b')]:_0x292fe6[_0x3c9b('0x36')];if(_0xa0dbcf[_0x3c9b('0x3d')][_0x3c9b('0x47')]){_0x6f1445[_0x3c9b('0x48')]=[{'all':!![]}];}_0x6f1445=_[_0x3c9b('0x45')]({},_0x6f1445,_0xa0dbcf['options']);return db[_0x3c9b('0x31')][_0x3c9b('0x4c')](_0x6f1445)['then'](handleEntityNotFound(_0xfb8d03,null))[_0x3c9b('0x2c')](respondWithResult(_0xfb8d03,null))['catch'](handleError(_0xfb8d03,null));};exports['create']=function(_0xc2c863,_0x53161f){return db[_0x3c9b('0x31')]['create'](_0xc2c863['body'],{})[_0x3c9b('0x2c')](function(_0x1b66f3){var _0x4caed1=_0xc2c863[_0x3c9b('0x4d')][_0x3c9b('0x2b')]({'plain':!![]});if(!_0x4caed1)throw new Error(_0x3c9b('0x4e'));if(_0x4caed1['role']===_0x3c9b('0x4d')){var _0xb49495=_0x1b66f3[_0x3c9b('0x2b')]({'plain':!![]});var _0x385be3=_0x3c9b('0x4f');return db[_0x3c9b('0x50')][_0x3c9b('0x4c')]({'where':{'name':_0x385be3,'userProfileId':_0x4caed1[_0x3c9b('0x51')]},'raw':!![]})[_0x3c9b('0x2c')](function(_0x43e6b0){if(_0x43e6b0&&_0x43e6b0[_0x3c9b('0x52')]===0x0){return db[_0x3c9b('0x53')][_0x3c9b('0x54')]({'name':_0xb49495[_0x3c9b('0x2f')],'resourceId':_0xb49495['id'],'type':_0x43e6b0[_0x3c9b('0x2f')],'sectionId':_0x43e6b0['id']},{})[_0x3c9b('0x2c')](function(){return _0x1b66f3;});}else{return _0x1b66f3;}})[_0x3c9b('0x55')](function(_0x3b8c3d){logger[_0x3c9b('0x2d')](_0x3c9b('0x56'),_0x3b8c3d);throw _0x3b8c3d;});}return _0x1b66f3;})[_0x3c9b('0x2c')](respondWithResult(_0x53161f,0xc9))[_0x3c9b('0x55')](handleError(_0x53161f,null));};exports[_0x3c9b('0x57')]=function(_0x300242,_0x562363){if(_0x300242[_0x3c9b('0x58')]['id']){delete _0x300242[_0x3c9b('0x58')]['id'];}return db['Schedule'][_0x3c9b('0x4c')]({'where':{'id':_0x300242['params']['id']}})[_0x3c9b('0x2c')](handleEntityNotFound(_0x562363,null))[_0x3c9b('0x2c')](saveUpdates(_0x300242[_0x3c9b('0x58')],null))[_0x3c9b('0x2c')](respondWithResult(_0x562363,null))[_0x3c9b('0x55')](handleError(_0x562363,null));};exports['destroy']=function(_0x472056,_0x24c2b3){return db[_0x3c9b('0x31')][_0x3c9b('0x4c')]({'where':{'id':_0x472056['params']['id']}})[_0x3c9b('0x2c')](handleEntityNotFound(_0x24c2b3,null))[_0x3c9b('0x2c')](removeEntity(_0x24c2b3,null))[_0x3c9b('0x55')](handleError(_0x24c2b3,null));};exports['run']=function(_0x1c1bd6,_0x264d5b,_0x263685){var _0x1ede0e=require(_0x3c9b('0x59'));return db[_0x3c9b('0x31')]['find']({'where':{'id':_0x1c1bd6['params']['id']},'raw':!![]})[_0x3c9b('0x2c')](handleEntityNotFound(_0x264d5b,null))[_0x3c9b('0x2c')](function(){_0x1ede0e[_0x3c9b('0x5a')](_0x1c1bd6[_0x3c9b('0x4a')]['id']);})[_0x3c9b('0x2c')](respondWithStatusCode(_0x264d5b,null))['catch'](handleError(_0x264d5b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 02eba58..1abe094 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 _0x96ec=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./schedule.attributes'];(function(_0x288efd,_0x86ff6b){var _0x7466bb=function(_0x36d83c){while(--_0x36d83c){_0x288efd['push'](_0x288efd['shift']());}};_0x7466bb(++_0x86ff6b);}(_0x96ec,0xc4));var _0xc96e=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x96ec[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xc96e('0x0'));var util=require(_0xc96e('0x1'));var logger=require(_0xc96e('0x2'))('api');var moment=require(_0xc96e('0x3'));var BPromise=require(_0xc96e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc96e('0x5'));var rimraf=require('rimraf');var config=require(_0xc96e('0x6'));var attributes=require(_0xc96e('0x7'));module[_0xc96e('0x8')]=function(_0x211a56,_0x203ecf){return _0x211a56[_0xc96e('0x9')](_0xc96e('0xa'),attributes,{'tableName':_0xc96e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc9b=['path','exports','define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe99eb1,_0x2ce0db){var _0xd4f51a=function(_0x51a644){while(--_0x51a644){_0xe99eb1['push'](_0xe99eb1['shift']());}};_0xd4f51a(++_0x2ce0db);}(_0xbc9b,0xe1));var _0xbbc9=function(_0x4d87cb,_0x2991e6){_0x4d87cb=_0x4d87cb-0x0;var _0xdac206=_0xbc9b[_0x4d87cb];return _0xdac206;};'use strict';var _=require('lodash');var util=require(_0xbbc9('0x0'));var logger=require(_0xbbc9('0x1'))(_0xbbc9('0x2'));var moment=require(_0xbbc9('0x3'));var BPromise=require(_0xbbc9('0x4'));var rp=require(_0xbbc9('0x5'));var fs=require('fs');var path=require(_0xbbc9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0xbbc9('0x7')]=function(_0x4dff2e,_0x4982d2){return _0x4dff2e[_0xbbc9('0x8')](_0xbbc9('0x9'),attributes,{'tableName':_0xbbc9('0xa'),'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 92b8d69..335b476 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 _0xa974=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','message','Schedule,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1222ac,_0x10efcc){var _0x147e72=function(_0x26f2dc){while(--_0x26f2dc){_0x1222ac['push'](_0x1222ac['shift']());}};_0x147e72(++_0x10efcc);}(_0xa974,0x186));var _0x4a97=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xa974[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0x4a97('0x0'));var util=require('util');var moment=require(_0x4a97('0x1'));var BPromise=require(_0x4a97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a97('0x3'));var db=require(_0x4a97('0x4'))['db'];var utils=require(_0x4a97('0x5'));var logger=require(_0x4a97('0x6'))(_0x4a97('0x7'));var config=require(_0x4a97('0x8'));var jayson=require(_0x4a97('0x9'));var client=jayson[_0x4a97('0xa')][_0x4a97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e379,_0x45b266,_0x1ff824){return new BPromise(function(_0x3720fc,_0x543112){return client[_0x4a97('0xc')](_0x12e379,_0x1ff824)[_0x4a97('0xd')](function(_0x525f51){logger[_0x4a97('0xe')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'));logger[_0x4a97('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'),JSON['stringify'](_0x525f51));if(_0x525f51[_0x4a97('0x11')]){if(_0x525f51[_0x4a97('0x11')]['code']===0x1f4){logger[_0x4a97('0x11')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);return _0x543112(_0x525f51[_0x4a97('0x11')]['message']);}logger['error'](_0x4a97('0x13'),_0x45b266,_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);return _0x3720fc(_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);}else{logger[_0x4a97('0xe')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'));_0x3720fc(_0x525f51[_0x4a97('0x14')]['message']);}})[_0x4a97('0x15')](function(_0xdbd0c9){logger[_0x4a97('0x11')]('Schedule,\x20%s,\x20%s',_0x45b266,_0xdbd0c9);_0x543112(_0xdbd0c9);});});} \ No newline at end of file +var _0x4a67=['stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x4a67,0x10e));var _0x74a6=function(_0x434f39,_0x219e13){_0x434f39=_0x434f39-0x0;var _0x1b2718=_0x4a67[_0x434f39];return _0x1b2718;};'use strict';var _=require(_0x74a6('0x0'));var util=require(_0x74a6('0x1'));var moment=require(_0x74a6('0x2'));var BPromise=require(_0x74a6('0x3'));var rs=require(_0x74a6('0x4'));var fs=require('fs');var Redis=require(_0x74a6('0x5'));var db=require(_0x74a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x74a6('0x8'));var client=jayson[_0x74a6('0x9')][_0x74a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fde1,_0x55d0c2,_0x5cdd03){return new BPromise(function(_0x25ddbc,_0xcce59e){return client['request'](_0x44fde1,_0x5cdd03)[_0x74a6('0xb')](function(_0x51a2ed){logger[_0x74a6('0xc')]('Schedule,\x20%s,\x20%s',_0x55d0c2,'request\x20sent');logger[_0x74a6('0xd')](_0x74a6('0xe'),_0x55d0c2,_0x74a6('0xf'),JSON[_0x74a6('0x10')](_0x51a2ed));if(_0x51a2ed[_0x74a6('0x11')]){if(_0x51a2ed[_0x74a6('0x11')]['code']===0x1f4){logger[_0x74a6('0x11')](_0x74a6('0x12'),_0x55d0c2,_0x51a2ed['error'][_0x74a6('0x13')]);return _0xcce59e(_0x51a2ed[_0x74a6('0x11')][_0x74a6('0x13')]);}logger[_0x74a6('0x11')](_0x74a6('0x12'),_0x55d0c2,_0x51a2ed[_0x74a6('0x11')][_0x74a6('0x13')]);return _0x25ddbc(_0x51a2ed['error'][_0x74a6('0x13')]);}else{logger[_0x74a6('0xc')]('Schedule,\x20%s,\x20%s',_0x55d0c2,_0x74a6('0xf'));_0x25ddbc(_0x51a2ed[_0x74a6('0x14')][_0x74a6('0x13')]);}})[_0x74a6('0x15')](function(_0x491f03){logger[_0x74a6('0x11')](_0x74a6('0x12'),_0x55d0c2,_0x491f03);_0xcce59e(_0x491f03);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 93e0707..2b166ea 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 _0x6e7d=['/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x6e7d,0x1a0));var _0xd6e7=function(_0x3126a7,_0xeab7ee){_0x3126a7=_0x3126a7-0x0;var _0x359314=_0x6e7d[_0x3126a7];return _0x359314;};'use strict';var multer=require(_0xd6e7('0x0'));var util=require(_0xd6e7('0x1'));var path=require(_0xd6e7('0x2'));var timeout=require(_0xd6e7('0x3'));var express=require(_0xd6e7('0x4'));var router=express[_0xd6e7('0x5')]();var fs_extra=require(_0xd6e7('0x6'));var auth=require(_0xd6e7('0x7'));var interaction=require(_0xd6e7('0x8'));var config=require(_0xd6e7('0x9'));var controller=require(_0xd6e7('0xa'));router[_0xd6e7('0xb')]('/',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0xd')]);router[_0xd6e7('0xb')]('/describe',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0xe')]);router[_0xd6e7('0xb')](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller['show']);router[_0xd6e7('0xb')](_0xd6e7('0x10'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x11')]);router[_0xd6e7('0x12')]('/',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x13')]);router[_0xd6e7('0x14')](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x15')]);router['delete'](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x16')]);module[_0xd6e7('0x17')]=router; \ No newline at end of file +var _0x4225=['exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','describe','/:id','/:id/download','isAuthenticated','download','post','create','update','destroy'];(function(_0x1ca838,_0xf482b2){var _0x1cd108=function(_0x361601){while(--_0x361601){_0x1ca838['push'](_0x1ca838['shift']());}};_0x1cd108(++_0xf482b2);}(_0x4225,0xfd));var _0x5422=function(_0x822bcc,_0x29d5e1){_0x822bcc=_0x822bcc-0x0;var _0x440a75=_0x4225[_0x822bcc];return _0x440a75;};'use strict';var multer=require(_0x5422('0x0'));var util=require(_0x5422('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5422('0x2')]();var fs_extra=require(_0x5422('0x3'));var auth=require(_0x5422('0x4'));var interaction=require(_0x5422('0x5'));var config=require(_0x5422('0x6'));var controller=require(_0x5422('0x7'));router[_0x5422('0x8')]('/',auth['isAuthenticated'](),controller[_0x5422('0x9')]);router[_0x5422('0x8')](_0x5422('0xa'),auth['isAuthenticated'](),controller[_0x5422('0xb')]);router[_0x5422('0x8')](_0x5422('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5422('0x8')](_0x5422('0xd'),auth[_0x5422('0xe')](),controller[_0x5422('0xf')]);router[_0x5422('0x10')]('/',auth[_0x5422('0xe')](),controller[_0x5422('0x11')]);router['put'](_0x5422('0xc'),auth[_0x5422('0xe')](),controller[_0x5422('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5422('0x13')]);module[_0x5422('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b9470d5..15631ce 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 _0xa03c=['closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract'];(function(_0x246cba,_0x202a2d){var _0x23ff07=function(_0x1281c3){while(--_0x1281c3){_0x246cba['push'](_0x246cba['shift']());}};_0x23ff07(++_0x202a2d);}(_0xa03c,0x94));var _0xca03=function(_0x559d23,_0x525251){_0x559d23=_0x559d23-0x0;var _0x4af75b=_0xa03c[_0x559d23];return _0x4af75b;};'use strict';var Sequelize=require(_0xca03('0x0'));var moment=require('moment');var path=require(_0xca03('0x1'));var config=require(_0xca03('0x2'));module[_0xca03('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xca03('0x4')](_0xca03('0x5'))?path[_0xca03('0x6')](this['getDataValue'](_0xca03('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xca03('0x7')]},'channel':{'type':Sequelize[_0xca03('0x7')]},'value':{'type':Sequelize[_0xca03('0x7')],'set':function(_0x27aac6){var _0x9d2b3d=_0x27aac6['replace'](/\\/g,'/');this[_0xca03('0x8')](_0xca03('0x5'),_0x9d2b3d);}},'rating':{'type':Sequelize[_0xca03('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xca03('0x9')],'set':function(_0x31e7be){this[_0xca03('0x8')](_0xca03('0xa'),moment()[_0xca03('0xb')](_0x31e7be,'ms'));this[_0xca03('0x8')](_0xca03('0xc'),moment());this['setDataValue'](_0xca03('0xd'),_0x31e7be);}},'startedAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0xa')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'closedAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0xc')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'createdAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0x12')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0x13')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}}}; \ No newline at end of file +var _0x9b0d=['extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x1bcd6f,_0x22aaf8){var _0x502397=function(_0x3e2cd0){while(--_0x3e2cd0){_0x1bcd6f['push'](_0x1bcd6f['shift']());}};_0x502397(++_0x22aaf8);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x36066e,_0x5b8e59){_0x36066e=_0x36066e-0x0;var _0x46ea88=_0x9b0d[_0x36066e];return _0x46ea88;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd9b0('0x0'));var path=require(_0xd9b0('0x1'));var config=require(_0xd9b0('0x2'));module[_0xd9b0('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd9b0('0x4')](_0xd9b0('0x5'))?path[_0xd9b0('0x6')](this[_0xd9b0('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xd9b0('0x7')]},'channel':{'type':Sequelize[_0xd9b0('0x7')]},'value':{'type':Sequelize[_0xd9b0('0x7')],'set':function(_0x31c012){var _0x58bd64=_0x31c012[_0xd9b0('0x8')](/\\/g,'/');this[_0xd9b0('0x9')]('value',_0x58bd64);}},'rating':{'type':Sequelize[_0xd9b0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd9b0('0xa')],'set':function(_0x48181a){this[_0xd9b0('0x9')]('startedAt',moment()[_0xd9b0('0xb')](_0x48181a,'ms'));this['setDataValue'](_0xd9b0('0xc'),moment());this[_0xd9b0('0x9')](_0xd9b0('0xd'),_0x48181a);}},'startedAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0xf')))['format'](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0xc')))[_0xd9b0('0x12')](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'createdAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this['getDataValue'](_0xd9b0('0x13')))['format'](_0xd9b0('0x10'))[_0xd9b0('0x11')]();}},'updatedAt':{'type':Sequelize[_0xd9b0('0xe')],'get':function(){return moment(this[_0xd9b0('0x4')](_0xd9b0('0x14')))[_0xd9b0('0x12')](_0xd9b0('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 16344e5..2dc5472 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 _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x425d,0x1e0));var _0xd425=function(_0x266df3,_0x310f44){_0x266df3=_0x266df3-0x0;var _0x36684b=_0x425d[_0x266df3];return _0x36684b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file +var _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x45a376,_0x57e27a){var _0x5a9da3=function(_0x3fbca7){while(--_0x3fbca7){_0x45a376['push'](_0x45a376['shift']());}};_0x5a9da3(++_0x57e27a);}(_0x33c5,0xe6));var _0x533c=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x33c5[_0x1fa381];return _0x47eefe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 404e1be..15b50cb 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 _0xd44a=['define','screen_recordings','interactionid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x90651d,_0x39e4c2){var _0x44a0ae=function(_0x1b3ead){while(--_0x1b3ead){_0x90651d['push'](_0x90651d['shift']());}};_0x44a0ae(++_0x39e4c2);}(_0xd44a,0xff));var _0xad44=function(_0xe89d3c,_0x3abe52){_0xe89d3c=_0xe89d3c-0x0;var _0x180de9=_0xd44a[_0xe89d3c];return _0x180de9;};'use strict';var _=require('lodash');var util=require(_0xad44('0x0'));var logger=require(_0xad44('0x1'))('api');var moment=require(_0xad44('0x2'));var BPromise=require(_0xad44('0x3'));var rp=require(_0xad44('0x4'));var fs=require('fs');var path=require(_0xad44('0x5'));var rimraf=require(_0xad44('0x6'));var config=require(_0xad44('0x7'));var attributes=require(_0xad44('0x8'));module['exports']=function(_0xc75fe7,_0x468441){return _0xc75fe7[_0xad44('0x9')]('ScreenRecording',attributes,{'tableName':_0xad44('0xa'),'paranoid':![],'indexes':[{'name':_0xad44('0xb'),'fields':[_0xad44('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeb3f=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid','lodash','util','../../config/logger'];(function(_0x14436a,_0x122417){var _0xac8e9b=function(_0x38c45c){while(--_0x38c45c){_0x14436a['push'](_0x14436a['shift']());}};_0xac8e9b(++_0x122417);}(_0xeb3f,0x128));var _0xfeb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeb3f[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xfeb3('0x0'));var util=require(_0xfeb3('0x1'));var logger=require(_0xfeb3('0x2'))(_0xfeb3('0x3'));var moment=require(_0xfeb3('0x4'));var BPromise=require('bluebird');var rp=require(_0xfeb3('0x5'));var fs=require('fs');var path=require(_0xfeb3('0x6'));var rimraf=require(_0xfeb3('0x7'));var config=require(_0xfeb3('0x8'));var attributes=require('./screenRecording.attributes');module[_0xfeb3('0x9')]=function(_0x31988f,_0x1e1052){return _0x31988f[_0xfeb3('0xa')]('ScreenRecording',attributes,{'tableName':_0xfeb3('0xb'),'paranoid':![],'indexes':[{'name':_0xfeb3('0xc'),'fields':[_0xfeb3('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 c8d412e..52a9090 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 _0xa2b6=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch'];(function(_0x5e29c7,_0xc2f44e){var _0x5ba897=function(_0x650b47){while(--_0x650b47){_0x5e29c7['push'](_0x5e29c7['shift']());}};_0x5ba897(++_0xc2f44e);}(_0xa2b6,0x190));var _0x6a2b=function(_0x43a251,_0x200ab8){_0x43a251=_0x43a251-0x0;var _0x5f8789=_0xa2b6[_0x43a251];return _0x5f8789;};'use strict';var _=require(_0x6a2b('0x0'));var util=require(_0x6a2b('0x1'));var moment=require(_0x6a2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a2b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a2b('0x4'));var logger=require(_0x6a2b('0x5'))(_0x6a2b('0x6'));var config=require(_0x6a2b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6a2b('0x8')][_0x6a2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x571a79,_0x53d8e4,_0x13ab89){return new BPromise(function(_0x5e23e3,_0x3c258d){return client[_0x6a2b('0xa')](_0x571a79,_0x13ab89)['then'](function(_0x25ad1e){logger['info'](_0x6a2b('0xb'),_0x53d8e4,'request\x20sent');logger[_0x6a2b('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x53d8e4,_0x6a2b('0xd'),JSON[_0x6a2b('0xe')](_0x25ad1e));if(_0x25ad1e['error']){if(_0x25ad1e['error'][_0x6a2b('0xf')]===0x1f4){logger[_0x6a2b('0x10')](_0x6a2b('0xb'),_0x53d8e4,_0x25ad1e['error'][_0x6a2b('0x11')]);return _0x3c258d(_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x53d8e4,_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);return _0x5e23e3(_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x53d8e4,_0x6a2b('0xd'));_0x5e23e3(_0x25ad1e[_0x6a2b('0x12')][_0x6a2b('0x11')]);}})[_0x6a2b('0x13')](function(_0x5820fc){logger[_0x6a2b('0x10')](_0x6a2b('0xb'),_0x53d8e4,_0x5820fc);_0x3c258d(_0x5820fc);});});} \ No newline at end of file +var _0xba89=['http','request','then','info','debug','request\x20sent','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba89,0x10f));var _0x9ba8=function(_0x24d91e,_0x5f0df4){_0x24d91e=_0x24d91e-0x0;var _0x34d6f6=_0xba89[_0x24d91e];return _0x34d6f6;};'use strict';var _=require(_0x9ba8('0x0'));var util=require(_0x9ba8('0x1'));var moment=require('moment');var BPromise=require(_0x9ba8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ba8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9ba8('0x4'))(_0x9ba8('0x5'));var config=require(_0x9ba8('0x6'));var jayson=require(_0x9ba8('0x7'));var client=jayson[_0x9ba8('0x8')][_0x9ba8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10019e,_0x222f79,_0x31c0f0){return new BPromise(function(_0x19fc1b,_0x18473c){return client[_0x9ba8('0xa')](_0x10019e,_0x31c0f0)[_0x9ba8('0xb')](function(_0x482cc7){logger[_0x9ba8('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x222f79,'request\x20sent');logger[_0x9ba8('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x222f79,_0x9ba8('0xe'),JSON['stringify'](_0x482cc7));if(_0x482cc7[_0x9ba8('0xf')]){if(_0x482cc7[_0x9ba8('0xf')][_0x9ba8('0x10')]===0x1f4){logger['error'](_0x9ba8('0x11'),_0x222f79,_0x482cc7['error'][_0x9ba8('0x12')]);return _0x18473c(_0x482cc7['error'][_0x9ba8('0x12')]);}logger[_0x9ba8('0xf')](_0x9ba8('0x11'),_0x222f79,_0x482cc7[_0x9ba8('0xf')][_0x9ba8('0x12')]);return _0x19fc1b(_0x482cc7[_0x9ba8('0xf')][_0x9ba8('0x12')]);}else{logger['info'](_0x9ba8('0x11'),_0x222f79,'request\x20sent');_0x19fc1b(_0x482cc7[_0x9ba8('0x13')][_0x9ba8('0x12')]);}})['catch'](function(_0x315533){logger[_0x9ba8('0xf')](_0x9ba8('0x11'),_0x222f79,_0x315533);_0x18473c(_0x315533);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 58aca7d..fad5959 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 _0xa24e=['Router','../../components/auth/service','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','util','path','connect-timeout'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0xa24e,0x145));var _0xea24=function(_0x5a5bf9,_0x1179f1){_0x5a5bf9=_0x5a5bf9-0x0;var _0x221813=_0xa24e[_0x5a5bf9];return _0x221813;};'use strict';var multer=require('multer');var util=require(_0xea24('0x0'));var path=require(_0xea24('0x1'));var timeout=require(_0xea24('0x2'));var express=require('express');var router=express[_0xea24('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea24('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea24('0x5'));router[_0xea24('0x6')]('/',auth[_0xea24('0x7')](),controller[_0xea24('0x8')]);router[_0xea24('0x6')](_0xea24('0x9'),controller['getDate']);router[_0xea24('0x6')](_0xea24('0xa'),controller[_0xea24('0xb')]);router[_0xea24('0x6')](_0xea24('0xc'),controller[_0xea24('0xd')]);router[_0xea24('0x6')](_0xea24('0xe'),controller[_0xea24('0xf')]);router[_0xea24('0x6')]('/:id/gdpr',controller[_0xea24('0x10')]);router[_0xea24('0x6')](_0xea24('0x11'),controller[_0xea24('0x12')]);router[_0xea24('0x6')](_0xea24('0x13'),controller[_0xea24('0x14')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0x16f2b5,_0x3f58b1,_0x168762){_0x168762(null,path[_0xea24('0x16')](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0x15821f,_0x46de3c,_0x14d624){_0x14d624(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x1b'),path[_0xea24('0x1c')](_0x46de3c[_0xea24('0x1d')])));}})});router[_0xea24('0x1e')](_0xea24('0xc'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a449f,_0x4d0e0d,_0x2ae4c8){_0x2ae4c8(null,path['join'](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0xb3f906,_0x385791,_0x526d76){_0x526d76(null,util[_0xea24('0x19')](_0xea24('0x1a'),'logologin',path['extname'](_0x385791['originalname'])));}})});router['post']('/:id/logo_login',upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x22')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0x4a06cb,_0x361caf,_0x685478){_0x685478(null,path[_0xea24('0x16')](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0x33d237,_0x16a081,_0x5ac399){_0x5ac399(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x23'),path['extname'](_0x16a081[_0xea24('0x1d')])));}})});router[_0xea24('0x1e')](_0xea24('0x11'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x24')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0xf513d9,_0x25c62c,_0x592ca7){_0x592ca7(null,path[_0xea24('0x16')](config['root'],_0xea24('0x18')));},'filename':function(_0x1a2480,_0x1e0dea,_0x226854){_0x226854(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x25'),path['extname'](_0x1e0dea['originalname'])));}})});router[_0xea24('0x1e')](_0xea24('0x13'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x26')]);router[_0xea24('0x27')](_0xea24('0xa'),auth['isAuthenticated'](),controller[_0xea24('0x28')]);module['exports']=router; \ No newline at end of file +var _0xb251=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','getPreferred','join','root','format','extname','originalname','post','single','diskStorage','logologin','/:id/logo_login','file','addLogoLogin','server/files/images/logos/','%s%s','addPreferred','favicon','/:id/favicon','addFavicon','put','multer','util','connect-timeout','express'];(function(_0x136df0,_0x735f27){var _0x43e342=function(_0x508af9){while(--_0x508af9){_0x136df0['push'](_0x136df0['shift']());}};_0x43e342(++_0x735f27);}(_0xb251,0x1a9));var _0x1b25=function(_0x58f87b,_0x36bb6d){_0x58f87b=_0x58f87b-0x0;var _0x2b9c4b=_0xb251[_0x58f87b];return _0x2b9c4b;};'use strict';var multer=require(_0x1b25('0x0'));var util=require(_0x1b25('0x1'));var path=require('path');var timeout=require(_0x1b25('0x2'));var express=require(_0x1b25('0x3'));var router=express[_0x1b25('0x4')]();var fs_extra=require(_0x1b25('0x5'));var auth=require(_0x1b25('0x6'));var interaction=require(_0x1b25('0x7'));var config=require(_0x1b25('0x8'));var controller=require(_0x1b25('0x9'));router[_0x1b25('0xa')]('/',auth[_0x1b25('0xb')](),controller[_0x1b25('0xc')]);router[_0x1b25('0xa')](_0x1b25('0xd'),controller['getDate']);router[_0x1b25('0xa')](_0x1b25('0xe'),controller['show']);router[_0x1b25('0xa')](_0x1b25('0xf'),controller[_0x1b25('0x10')]);router[_0x1b25('0xa')]('/:id/logo_login',controller[_0x1b25('0x11')]);router['get'](_0x1b25('0x12'),controller['gdpr']);router[_0x1b25('0xa')]('/:id/preferred',controller[_0x1b25('0x13')]);router[_0x1b25('0xa')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57dd8c,_0xdca887,_0xe9c4a){_0xe9c4a(null,path[_0x1b25('0x14')](config[_0x1b25('0x15')],'server/files/images/logos/'));},'filename':function(_0x2067e5,_0x286c38,_0x42e096){_0x42e096(null,util[_0x1b25('0x16')]('%s%s','logo',path[_0x1b25('0x17')](_0x286c38[_0x1b25('0x18')])));}})});router[_0x1b25('0x19')](_0x1b25('0xf'),upload[_0x1b25('0x1a')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x1b25('0x1b')]({'destination':function(_0x6899fb,_0x53a998,_0x5ecffe){_0x5ecffe(null,path[_0x1b25('0x14')](config[_0x1b25('0x15')],'server/files/images/logos/'));},'filename':function(_0x59d4af,_0x5e698d,_0x449e34){_0x449e34(null,util[_0x1b25('0x16')]('%s%s',_0x1b25('0x1c'),path[_0x1b25('0x17')](_0x5e698d[_0x1b25('0x18')])));}})});router['post'](_0x1b25('0x1d'),upload[_0x1b25('0x1a')](_0x1b25('0x1e')),controller[_0x1b25('0x1f')]);var upload=multer({'storage':multer[_0x1b25('0x1b')]({'destination':function(_0x4ac843,_0x2f34da,_0x49756f){_0x49756f(null,path['join'](config[_0x1b25('0x15')],_0x1b25('0x20')));},'filename':function(_0x5abdff,_0x1be859,_0x4f4b81){_0x4f4b81(null,util[_0x1b25('0x16')](_0x1b25('0x21'),'preferred',path['extname'](_0x1be859[_0x1b25('0x18')])));}})});router[_0x1b25('0x19')]('/:id/preferred',upload[_0x1b25('0x1a')](_0x1b25('0x1e')),controller[_0x1b25('0x22')]);var upload=multer({'storage':multer[_0x1b25('0x1b')]({'destination':function(_0x3ae44c,_0x3c0ab3,_0x34d817){_0x34d817(null,path[_0x1b25('0x14')](config[_0x1b25('0x15')],_0x1b25('0x20')));},'filename':function(_0x356efa,_0x5f4fdd,_0x54142e){_0x54142e(null,util['format'](_0x1b25('0x21'),_0x1b25('0x23'),path[_0x1b25('0x17')](_0x5f4fdd[_0x1b25('0x18')])));}})});router[_0x1b25('0x19')](_0x1b25('0x24'),upload[_0x1b25('0x1a')](_0x1b25('0x1e')),controller[_0x1b25('0x25')]);router[_0x1b25('0x26')](_0x1b25('0xe'),auth[_0x1b25('0xb')](),controller['update']);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 de8d8ae..3570f95 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(_0x6747d0,_0x49cb8f){var _0x5d9ba9=function(_0x46c6cf){while(--_0x46c6cf){_0x6747d0['push'](_0x6747d0['shift']());}};_0x5d9ba9(++_0x49cb8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x537e50,_0x7bfa4a){var _0x35b6bf=function(_0x596679){while(--_0x596679){_0x537e50['push'](_0x537e50['shift']());}};_0x35b6bf(++_0x7bfa4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 570b12a..757cd82 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 _0xe50a=['path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','end','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','Setting','include','findAll','rows','show','params','keys','includeAll','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','custom','gdpr','securePassword','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe50a,0xf0));var _0xae50=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xe50a[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xae50('0x0'));var rimraf=require(_0xae50('0x1'));var zipdir=require(_0xae50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae50('0x3'));var moment=require('moment');var BPromise=require(_0xae50('0x4'));var Mustache=require(_0xae50('0x5'));var util=require('util');var path=require(_0xae50('0x6'));var sox=require(_0xae50('0x7'));var csv=require(_0xae50('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae50('0x9'));var _=require('lodash');var squel=require(_0xae50('0xa'));var crypto=require('crypto');var jsforce=require(_0xae50('0xb'));var deskjs=require(_0xae50('0xc'));var toCsv=require(_0xae50('0x8'));var querystring=require(_0xae50('0xd'));var Papa=require(_0xae50('0xe'));var Redis=require(_0xae50('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xae50('0x10'));var as=require(_0xae50('0x11'));var hardwareService=require(_0xae50('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xae50('0x13'));var config=require(_0xae50('0x14'));var licenseUtil=require(_0xae50('0x15'));var db=require(_0xae50('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xae50('0x17')][_0xae50('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5a6b7e,_0x360814,_0x5622fd,_0x2ac1eb){return new BPromise(function(_0x251a2b,_0x22530d){var _0x1bc426=_0x2ac1eb||client;return _0x1bc426[_0xae50('0x19')](_0x5a6b7e,_0x5622fd)[_0xae50('0x1a')](function(_0x29b0a1){logger[_0xae50('0x1b')]('Setting,\x20%s,\x20%s',_0x360814,_0xae50('0x1c'));logger[_0xae50('0x1d')](_0xae50('0x1e'),_0x360814,_0xae50('0x1c'),JSON[_0xae50('0x1f')](_0x29b0a1));if(_0x29b0a1['error']){if(_0x29b0a1[_0xae50('0x20')][_0xae50('0x21')]===0x1f4){logger[_0xae50('0x20')]('Setting,\x20%s,\x20%s',_0x360814,_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);return _0x22530d(_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);}logger[_0xae50('0x20')](_0xae50('0x23'),_0x360814,_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);return _0x251a2b(_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);}else{logger[_0xae50('0x1b')](_0xae50('0x23'),_0x360814,_0xae50('0x1c'));_0x251a2b(_0x29b0a1[_0xae50('0x24')][_0xae50('0x22')]);}})[_0xae50('0x25')](function(_0x24956f){logger[_0xae50('0x20')](_0xae50('0x23'),_0x360814,_0x24956f);_0x22530d(_0x24956f);});});}function respondWithStatusCode(_0x24970b,_0x2699c4){_0x2699c4=_0x2699c4||0xcc;return function(_0x18bcc9){if(_0x18bcc9){return _0x24970b[_0xae50('0x26')](_0x2699c4);}return _0x24970b[_0xae50('0x27')](_0x2699c4)['end']();};}function respondWithResult(_0x570126,_0x2930ac){_0x2930ac=_0x2930ac||0xc8;return function(_0x41033c){if(_0x41033c){return _0x570126['status'](_0x2930ac)[_0xae50('0x28')](_0x41033c);}};}function respondWithFilteredResult(_0x592d7f,_0x49a435){return function(_0x4b358d){if(_0x4b358d){var _0x573b2e=typeof _0x49a435[_0xae50('0x29')]===_0xae50('0x2a')&&typeof _0x49a435[_0xae50('0x2b')]===_0xae50('0x2a');var _0x4bfeb5=_0x4b358d[_0xae50('0x2c')];var _0x34b600=_0x573b2e?0x0:_0x49a435['offset'];var _0x1a9a82=_0x573b2e?_0x4b358d[_0xae50('0x2c')]:_0x49a435[_0xae50('0x29')]+_0x49a435[_0xae50('0x2b')];var _0x2d519b;if(_0x1a9a82>=_0x4bfeb5){_0x1a9a82=_0x4bfeb5;_0x2d519b=0xc8;}else{_0x2d519b=0xce;}_0x592d7f[_0xae50('0x27')](_0x2d519b);return _0x592d7f[_0xae50('0x2d')](_0xae50('0x2e'),_0x34b600+'-'+_0x1a9a82+'/'+_0x4bfeb5)[_0xae50('0x28')](_0x4b358d);}return null;};}function patchUpdates(_0x53186a){return function(_0x8d5516){try{jsonpatch[_0xae50('0x2f')](_0x8d5516,_0x53186a,!![]);}catch(_0x4dcbb4){return BPromise['reject'](_0x4dcbb4);}return _0x8d5516[_0xae50('0x30')]();};}function saveUpdates(_0x3af57d,_0x5609b5){return function(_0x21c159){if(_0x21c159){return _0x21c159['update'](_0x3af57d)[_0xae50('0x1a')](function(_0x48b709){return _0x48b709;});}return null;};}function removeEntity(_0x3cf52d,_0x48c484){return function(_0x42aec5){if(_0x42aec5){return _0x42aec5[_0xae50('0x31')]()['then'](function(){_0x3cf52d['status'](0xcc)[_0xae50('0x32')]();});}};}function handleEntityNotFound(_0x5d845d,_0x4e8d27){return function(_0x1cc441){if(!_0x1cc441){_0x5d845d[_0xae50('0x26')](0x194);}return _0x1cc441;};}function handleError(_0x21c530,_0x511146){_0x511146=_0x511146||0x1f4;return function(_0x113113){logger[_0xae50('0x20')](_0x113113[_0xae50('0x33')]);if(_0x113113[_0xae50('0x34')]){delete _0x113113[_0xae50('0x34')];}_0x21c530[_0xae50('0x27')](_0x511146)[_0xae50('0x35')](_0x113113);};}exports[_0xae50('0x36')]=function(_0x4a3f9f,_0x16f21b){var _0x52eb51={},_0x744026={},_0x2d6f46={'count':0x0,'rows':[]};var _0x562f6e=_['map'](db['Setting'][_0xae50('0x37')],function(_0xa31143){return{'name':_0xa31143[_0xae50('0x38')],'type':_0xa31143[_0xae50('0x39')]['key']};});_0x744026[_0xae50('0x3a')]=_[_0xae50('0x3b')](_0x562f6e,_0xae50('0x34'));_0x744026[_0xae50('0x3c')]=_['keys'](_0x4a3f9f[_0xae50('0x3c')]);_0x744026[_0xae50('0x3d')]=_['intersection'](_0x744026['model'],_0x744026['query']);_0x52eb51[_0xae50('0x3e')]=_[_0xae50('0x3f')](_0x744026[_0xae50('0x3a')],qs['fields'](_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x40')]));_0x52eb51[_0xae50('0x3e')]=_0x52eb51[_0xae50('0x3e')][_0xae50('0x41')]?_0x52eb51[_0xae50('0x3e')]:_0x744026[_0xae50('0x3a')];if(!_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x42')]('nolimit')){_0x52eb51['limit']=qs[_0xae50('0x2b')](_0x4a3f9f['query']['limit']);_0x52eb51['offset']=qs['offset'](_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x29')]);}_0x52eb51['order']=qs['sort'](_0x4a3f9f['query'][_0xae50('0x43')]);_0x52eb51[_0xae50('0x44')]=qs[_0xae50('0x3d')](_[_0xae50('0x45')](_0x4a3f9f[_0xae50('0x3c')],_0x744026['filters']),_0x562f6e);if(_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x46')]){_0x52eb51[_0xae50('0x44')]=_['merge'](_0x52eb51[_0xae50('0x44')],{'$or':_['map'](_0x562f6e,function(_0x4426b1){if(_0x4426b1[_0xae50('0x39')]!==_0xae50('0x47')){var _0x3de3c1={};_0x3de3c1[_0x4426b1[_0xae50('0x34')]]={'$like':'%'+_0x4a3f9f['query'][_0xae50('0x46')]+'%'};return _0x3de3c1;}})});}_0x52eb51=_[_0xae50('0x48')]({},_0x52eb51,_0x4a3f9f[_0xae50('0x49')]);var _0x36a419={'where':_0x52eb51[_0xae50('0x44')]};return db[_0xae50('0x4a')]['count'](_0x36a419)['then'](function(_0xef9590){_0x2d6f46[_0xae50('0x2c')]=_0xef9590;if(_0x4a3f9f['query']['includeAll']){_0x52eb51[_0xae50('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xae50('0x4c')](_0x52eb51);})[_0xae50('0x1a')](function(_0x26fac3){_0x2d6f46[_0xae50('0x4d')]=_0x26fac3;return _0x2d6f46;})['then'](respondWithFilteredResult(_0x16f21b,_0x52eb51))[_0xae50('0x25')](handleError(_0x16f21b,null));};exports[_0xae50('0x4e')]=function(_0x3c06d4,_0xd23c47){var _0x4b8f14={'raw':![],'where':{'id':_0x3c06d4[_0xae50('0x4f')]['id']}},_0x1fa748={};_0x1fa748[_0xae50('0x3a')]=_[_0xae50('0x50')](db[_0xae50('0x4a')][_0xae50('0x37')]);_0x1fa748[_0xae50('0x3c')]=_['keys'](_0x3c06d4[_0xae50('0x3c')]);_0x1fa748[_0xae50('0x3d')]=_['intersection'](_0x1fa748[_0xae50('0x3a')],_0x1fa748[_0xae50('0x3c')]);_0x4b8f14[_0xae50('0x3e')]=_[_0xae50('0x3f')](_0x1fa748[_0xae50('0x3a')],qs[_0xae50('0x40')](_0x3c06d4[_0xae50('0x3c')]['fields']));_0x4b8f14[_0xae50('0x3e')]=_0x4b8f14[_0xae50('0x3e')]['length']?_0x4b8f14[_0xae50('0x3e')]:_0x1fa748[_0xae50('0x3a')];if(_0x3c06d4[_0xae50('0x3c')][_0xae50('0x51')]){_0x4b8f14[_0xae50('0x4b')]=[{'all':!![]}];}_0x4b8f14=_[_0xae50('0x48')]({},_0x4b8f14,_0x3c06d4['options']);return db[_0xae50('0x4a')][_0xae50('0x52')](_0x4b8f14)[_0xae50('0x1a')](handleEntityNotFound(_0xd23c47,null))[_0xae50('0x1a')](respondWithResult(_0xd23c47,null))[_0xae50('0x25')](handleError(_0xd23c47,null));};exports[_0xae50('0x53')]=function(_0x2a65c4,_0x5cbda4){if(_0x2a65c4[_0xae50('0x54')]['id']){delete _0x2a65c4[_0xae50('0x54')]['id'];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x2a65c4[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x5cbda4,null))[_0xae50('0x1a')](saveUpdates(_0x2a65c4[_0xae50('0x54')],null))[_0xae50('0x1a')](respondWithResult(_0x5cbda4,null))[_0xae50('0x25')](handleError(_0x5cbda4,null));};exports[_0xae50('0x55')]=function(_0x113d5c,_0x1f7855,_0xdcd26f){if(_0x113d5c[_0xae50('0x56')]&&_0x113d5c[_0xae50('0x56')][_0xae50('0x57')]){_0x113d5c[_0xae50('0x54')][_0xae50('0x58')]=_0x113d5c['file'][_0xae50('0x57')];}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x113d5c['params']['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x1f7855,null))[_0xae50('0x1a')](saveUpdates(_0x113d5c['body'],null))[_0xae50('0x1a')](respondWithResult(_0x1f7855,null))[_0xae50('0x25')](handleError(_0x1f7855,null));};exports[_0xae50('0x59')]=function(_0x38782f,_0x4b9edc,_0x1c09de){if(_0x38782f[_0xae50('0x56')]&&_0x38782f[_0xae50('0x56')][_0xae50('0x57')]){_0x38782f[_0xae50('0x54')][_0xae50('0x5a')]=_0x38782f['file'][_0xae50('0x57')];}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x38782f[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x4b9edc,null))[_0xae50('0x1a')](saveUpdates(_0x38782f['body'],null))[_0xae50('0x1a')](respondWithResult(_0x4b9edc,null))[_0xae50('0x25')](handleError(_0x4b9edc,null));};var utilLicense=require(_0xae50('0x15'));exports['getLogo']=function(_0x186abc,_0x2cd2b0,_0x42255b){var _0xe0b690=_0xae50('0x5b');var _0x365079={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x49a550){if(_0x49a550){_0x365079=_0x49a550;}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x186abc[_0xae50('0x4f')]['id']},'attributes':['logo',_0xae50('0x5a'),_0xae50('0x5d'),_0xae50('0x5e'),'defaultLogo',_0xae50('0x5f'),_0xae50('0x60'),'defaultFavicon'],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x2cd2b0,null))['then'](function(_0x485071){if(_0x485071){var _0x3d0126=_0x485071[_0xae50('0x58')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config['root'],_0xe0b690,_['toLower'](_0x485071[_0xae50('0x58')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0x485071[_0xae50('0x58')])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0xae50('0x65')));var _0x369d0c=_0xae50('0x66')+_[_0xae50('0x67')]('logo');if(_0x485071[_0x369d0c]||!_0x365079['custom']){_0x3d0126=path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0xae50('0x65')));}if(!fs[_0xae50('0x61')](_0x3d0126)){throw new db[(_0xae50('0x68'))][(_0xae50('0x69'))](_[_0xae50('0x67')](_0xae50('0x58'))+_0xae50('0x6a'));}return _0x2cd2b0[_0xae50('0x6b')](_0x3d0126);}})[_0xae50('0x25')](handleError(_0x2cd2b0,null));};var utilLicense=require(_0xae50('0x15'));exports[_0xae50('0x6c')]=function(_0x1f2793,_0x4ac9f5,_0x3ef787){var _0x26a4e9=_0xae50('0x5b');var _0x33a8c2={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x50e7b5){if(_0x50e7b5){_0x33a8c2=_0x50e7b5;}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x1f2793['params']['id']},'attributes':['logo','loginLogo',_0xae50('0x5d'),'favicon',_0xae50('0x6d'),_0xae50('0x5f'),'defaultPreferred',_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x4ac9f5,null))[_0xae50('0x1a')](function(_0x1e4f82){if(_0x1e4f82){var _0x62b33f=_0x1e4f82[_0xae50('0x5a')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config[_0xae50('0x63')],_0x26a4e9,_['toLower'](_0x1e4f82[_0xae50('0x5a')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x26a4e9,_[_0xae50('0x64')](_0x1e4f82[_0xae50('0x5a')])):path['join'](config[_0xae50('0x63')],_0x26a4e9,_[_0xae50('0x64')](_0xae50('0x6f')));var _0x4841f3=_0xae50('0x66')+_[_0xae50('0x67')]('loginLogo');if(_0x1e4f82[_0x4841f3]||!_0x33a8c2[_0xae50('0x70')]){_0x62b33f=path[_0xae50('0x62')](config['root'],_0x26a4e9,_[_0xae50('0x64')]('default_loginLogo.svg'));}if(!fs[_0xae50('0x61')](_0x62b33f)){throw new db[(_0xae50('0x68'))][(_0xae50('0x69'))](_[_0xae50('0x67')](_0xae50('0x5a'))+_0xae50('0x6a'));}return _0x4ac9f5[_0xae50('0x6b')](_0x62b33f);}})[_0xae50('0x25')](handleError(_0x4ac9f5,null));};exports[_0xae50('0x71')]=function(_0x2ccef7,_0x578bcb){return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x2ccef7[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x72')]})[_0xae50('0x1a')](respondWithResult(_0x578bcb,null))[_0xae50('0x25')](handleError(_0x578bcb,null));};exports['addPreferred']=function(_0x5565a6,_0x420a1b,_0xd9280e){if(_0x5565a6['file']&&_0x5565a6['file'][_0xae50('0x57')]){_0x5565a6['body'][_0xae50('0x5d')]=_0x5565a6[_0xae50('0x56')][_0xae50('0x57')];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x5565a6[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x420a1b,null))[_0xae50('0x1a')](saveUpdates(_0x5565a6['body'],null))[_0xae50('0x1a')](respondWithResult(_0x420a1b,null))[_0xae50('0x25')](handleError(_0x420a1b,null));};var utilLicense=require(_0xae50('0x15'));exports['getPreferred']=function(_0x3a832d,_0x53f18f,_0x74517a){var _0x3c4b7b=_0xae50('0x5b');var _0xc09942={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x220c5b){if(_0x220c5b){_0xc09942=_0x220c5b;}return db['Setting'][_0xae50('0x52')]({'where':{'id':_0x3a832d[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x58'),_0xae50('0x5a'),_0xae50('0x5d'),_0xae50('0x5e'),_0xae50('0x6d'),_0xae50('0x5f'),_0xae50('0x60'),_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x53f18f,null))[_0xae50('0x1a')](function(_0x37523b){if(_0x37523b){var _0x137ec6=_0x37523b['preferred']&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0x37523b['preferred'])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0x37523b[_0xae50('0x5d')])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')]('default_preferred.png'));var _0x20af3f='default'+_[_0xae50('0x67')](_0xae50('0x5d'));if(_0x37523b[_0x20af3f]||!_0xc09942['custom']||!_0xc09942['preferred']){_0x137ec6=path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0xae50('0x73')));}if(!fs[_0xae50('0x61')](_0x137ec6)){throw new db[(_0xae50('0x68'))]['ValidationError'](_[_0xae50('0x67')](_0xae50('0x5d'))+'\x20not\x20found');}return _0x53f18f['download'](_0x137ec6);}})['catch'](handleError(_0x53f18f,null));};exports['addFavicon']=function(_0x550616,_0x1b13ba,_0xf8347){if(_0x550616[_0xae50('0x56')]&&_0x550616[_0xae50('0x56')][_0xae50('0x57')]){_0x550616[_0xae50('0x54')][_0xae50('0x5e')]=_0x550616[_0xae50('0x56')][_0xae50('0x57')];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x550616[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x1b13ba,null))[_0xae50('0x1a')](saveUpdates(_0x550616[_0xae50('0x54')],null))[_0xae50('0x1a')](respondWithResult(_0x1b13ba,null))[_0xae50('0x25')](handleError(_0x1b13ba,null));};var utilLicense=require(_0xae50('0x15'));exports[_0xae50('0x74')]=function(_0x1161a2,_0x44f7a5,_0x4a89b9){var _0x2538f1=_0xae50('0x5b');var _0x31300d={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x2b07f4){if(_0x2b07f4){_0x31300d=_0x2b07f4;}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x1161a2[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x58'),'loginLogo',_0xae50('0x5d'),'favicon','defaultLogo',_0xae50('0x5f'),'defaultPreferred',_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x44f7a5,null))[_0xae50('0x1a')](function(_0x3db9d5){if(_0x3db9d5){var _0x5d8501=_0x3db9d5[_0xae50('0x5e')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config['root'],_0x2538f1,_[_0xae50('0x64')](_0x3db9d5[_0xae50('0x5e')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x2538f1,_[_0xae50('0x64')](_0x3db9d5['favicon'])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0x2538f1,_[_0xae50('0x64')](_0xae50('0x75')));var _0x1c2bd5=_0xae50('0x66')+_['upperFirst'](_0xae50('0x5e'));if(_0x3db9d5[_0x1c2bd5]||!_0x31300d[_0xae50('0x70')]){_0x5d8501=path[_0xae50('0x62')](config['root'],_0x2538f1,_[_0xae50('0x64')](_0xae50('0x75')));}if(!fs[_0xae50('0x61')](_0x5d8501)){throw new db['Sequelize'][(_0xae50('0x69'))](_[_0xae50('0x67')]('favicon')+_0xae50('0x6a'));}return _0x44f7a5[_0xae50('0x6b')](_0x5d8501);}})[_0xae50('0x25')](handleError(_0x44f7a5,null));};exports[_0xae50('0x76')]=function(_0x7bf745,_0x5321ca){var _0xea085a={'offset':moment()['utcOffset']()};_0xea085a[_0xae50('0x77')]=moment()[_0xae50('0x78')](_0xea085a[_0xae50('0x29')])[_0xae50('0x79')](_0xae50('0x7a'));return _0x5321ca[_0xae50('0x27')](0xc8)[_0xae50('0x35')](_0xea085a);}; \ No newline at end of file +var _0xf7df=['download','getLogoLogin','defaultLogo','defaultPreferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getLicense','default_preferred.png','custom','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','body','find','addLogo','filename','logo','file','addLogoLogin','loginLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','\x20not\x20found'];(function(_0x2c4666,_0x5468c2){var _0x28777b=function(_0x3a679){while(--_0x3a679){_0x2c4666['push'](_0x2c4666['shift']());}};_0x28777b(++_0x5468c2);}(_0xf7df,0x10e));var _0xff7d=function(_0x426565,_0xfee6ca){_0x426565=_0x426565-0x0;var _0x1db253=_0xf7df[_0x426565];return _0x1db253;};'use strict';var emlformat=require(_0xff7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff7d('0x1'));var jsonpatch=require(_0xff7d('0x2'));var rp=require(_0xff7d('0x3'));var moment=require(_0xff7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff7d('0x5'));var util=require('util');var path=require(_0xff7d('0x6'));var sox=require(_0xff7d('0x7'));var csv=require('to-csv');var ejs=require(_0xff7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff7d('0x9'));var crypto=require(_0xff7d('0xa'));var jsforce=require(_0xff7d('0xb'));var deskjs=require(_0xff7d('0xc'));var toCsv=require(_0xff7d('0xd'));var querystring=require(_0xff7d('0xe'));var Papa=require('papaparse');var Redis=require(_0xff7d('0xf'));var authService=require(_0xff7d('0x10'));var qs=require(_0xff7d('0x11'));var as=require(_0xff7d('0x12'));var hardwareService=require(_0xff7d('0x13'));var logger=require(_0xff7d('0x14'))(_0xff7d('0x15'));var utils=require(_0xff7d('0x16'));var config=require(_0xff7d('0x17'));var licenseUtil=require(_0xff7d('0x18'));var db=require(_0xff7d('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xff7d('0x1a')][_0xff7d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ceb43,_0x1174c5,_0x19124c,_0x2965e2){return new BPromise(function(_0x3886f5,_0x1d6a4c){var _0x2ea760=_0x2965e2||client;return _0x2ea760['request'](_0x5ceb43,_0x19124c)[_0xff7d('0x1c')](function(_0x10e4ae){logger[_0xff7d('0x1d')](_0xff7d('0x1e'),_0x1174c5,_0xff7d('0x1f'));logger[_0xff7d('0x20')](_0xff7d('0x21'),_0x1174c5,_0xff7d('0x1f'),JSON[_0xff7d('0x22')](_0x10e4ae));if(_0x10e4ae['error']){if(_0x10e4ae[_0xff7d('0x23')][_0xff7d('0x24')]===0x1f4){logger[_0xff7d('0x23')]('Setting,\x20%s,\x20%s',_0x1174c5,_0x10e4ae[_0xff7d('0x23')][_0xff7d('0x25')]);return _0x1d6a4c(_0x10e4ae[_0xff7d('0x23')][_0xff7d('0x25')]);}logger[_0xff7d('0x23')](_0xff7d('0x1e'),_0x1174c5,_0x10e4ae[_0xff7d('0x23')][_0xff7d('0x25')]);return _0x3886f5(_0x10e4ae[_0xff7d('0x23')]['message']);}else{logger[_0xff7d('0x1d')](_0xff7d('0x1e'),_0x1174c5,_0xff7d('0x1f'));_0x3886f5(_0x10e4ae['result'][_0xff7d('0x25')]);}})[_0xff7d('0x26')](function(_0x455ac7){logger['error'](_0xff7d('0x1e'),_0x1174c5,_0x455ac7);_0x1d6a4c(_0x455ac7);});});}function respondWithStatusCode(_0x14e4b4,_0xf42f3c){_0xf42f3c=_0xf42f3c||0xcc;return function(_0x1a6506){if(_0x1a6506){return _0x14e4b4[_0xff7d('0x27')](_0xf42f3c);}return _0x14e4b4[_0xff7d('0x28')](_0xf42f3c)[_0xff7d('0x29')]();};}function respondWithResult(_0x15bbe6,_0x5ef97e){_0x5ef97e=_0x5ef97e||0xc8;return function(_0x457adf){if(_0x457adf){return _0x15bbe6[_0xff7d('0x28')](_0x5ef97e)[_0xff7d('0x2a')](_0x457adf);}};}function respondWithFilteredResult(_0x5a7997,_0x5eb41e){return function(_0x55708a){if(_0x55708a){var _0x24e962=typeof _0x5eb41e['offset']==='undefined'&&typeof _0x5eb41e['limit']===_0xff7d('0x2b');var _0x3642a9=_0x55708a[_0xff7d('0x2c')];var _0x479184=_0x24e962?0x0:_0x5eb41e['offset'];var _0x18bbaa=_0x24e962?_0x55708a[_0xff7d('0x2c')]:_0x5eb41e['offset']+_0x5eb41e['limit'];var _0x4ef328;if(_0x18bbaa>=_0x3642a9){_0x18bbaa=_0x3642a9;_0x4ef328=0xc8;}else{_0x4ef328=0xce;}_0x5a7997[_0xff7d('0x28')](_0x4ef328);return _0x5a7997[_0xff7d('0x2d')](_0xff7d('0x2e'),_0x479184+'-'+_0x18bbaa+'/'+_0x3642a9)[_0xff7d('0x2a')](_0x55708a);}return null;};}function patchUpdates(_0x39ccde){return function(_0x6127ef){try{jsonpatch[_0xff7d('0x2f')](_0x6127ef,_0x39ccde,!![]);}catch(_0xbcb02f){return BPromise['reject'](_0xbcb02f);}return _0x6127ef[_0xff7d('0x30')]();};}function saveUpdates(_0x5d532d,_0xb1dd88){return function(_0x279866){if(_0x279866){return _0x279866[_0xff7d('0x31')](_0x5d532d)['then'](function(_0x5092c4){return _0x5092c4;});}return null;};}function removeEntity(_0x2c8227,_0xccd74f){return function(_0x112dfa){if(_0x112dfa){return _0x112dfa[_0xff7d('0x32')]()[_0xff7d('0x1c')](function(){_0x2c8227[_0xff7d('0x28')](0xcc)[_0xff7d('0x29')]();});}};}function handleEntityNotFound(_0x349c8d,_0xf98cc6){return function(_0x4250eb){if(!_0x4250eb){_0x349c8d['sendStatus'](0x194);}return _0x4250eb;};}function handleError(_0x436f53,_0x38a8d){_0x38a8d=_0x38a8d||0x1f4;return function(_0x3e9f9c){logger['error'](_0x3e9f9c[_0xff7d('0x33')]);if(_0x3e9f9c[_0xff7d('0x34')]){delete _0x3e9f9c['name'];}_0x436f53[_0xff7d('0x28')](_0x38a8d)[_0xff7d('0x35')](_0x3e9f9c);};}exports['index']=function(_0x454042,_0x114508){var _0x42dfce={},_0x4debed={},_0x48f078={'count':0x0,'rows':[]};var _0x3a2a00=_[_0xff7d('0x36')](db[_0xff7d('0x37')][_0xff7d('0x38')],function(_0x3b5a85){return{'name':_0x3b5a85[_0xff7d('0x39')],'type':_0x3b5a85[_0xff7d('0x3a')][_0xff7d('0x3b')]};});_0x4debed[_0xff7d('0x3c')]=_['map'](_0x3a2a00,_0xff7d('0x34'));_0x4debed[_0xff7d('0x3d')]=_[_0xff7d('0x3e')](_0x454042[_0xff7d('0x3d')]);_0x4debed['filters']=_[_0xff7d('0x3f')](_0x4debed[_0xff7d('0x3c')],_0x4debed[_0xff7d('0x3d')]);_0x42dfce[_0xff7d('0x40')]=_['intersection'](_0x4debed[_0xff7d('0x3c')],qs[_0xff7d('0x41')](_0x454042[_0xff7d('0x3d')][_0xff7d('0x41')]));_0x42dfce[_0xff7d('0x40')]=_0x42dfce['attributes'][_0xff7d('0x42')]?_0x42dfce[_0xff7d('0x40')]:_0x4debed[_0xff7d('0x3c')];if(!_0x454042['query'][_0xff7d('0x43')](_0xff7d('0x44'))){_0x42dfce[_0xff7d('0x45')]=qs[_0xff7d('0x45')](_0x454042[_0xff7d('0x3d')][_0xff7d('0x45')]);_0x42dfce[_0xff7d('0x46')]=qs[_0xff7d('0x46')](_0x454042['query'][_0xff7d('0x46')]);}_0x42dfce[_0xff7d('0x47')]=qs[_0xff7d('0x48')](_0x454042[_0xff7d('0x3d')][_0xff7d('0x48')]);_0x42dfce[_0xff7d('0x49')]=qs[_0xff7d('0x4a')](_[_0xff7d('0x4b')](_0x454042[_0xff7d('0x3d')],_0x4debed[_0xff7d('0x4a')]),_0x3a2a00);if(_0x454042['query'][_0xff7d('0x4c')]){_0x42dfce['where']=_[_0xff7d('0x4d')](_0x42dfce['where'],{'$or':_['map'](_0x3a2a00,function(_0x4fa723){if(_0x4fa723['type']!==_0xff7d('0x4e')){var _0x28e747={};_0x28e747[_0x4fa723[_0xff7d('0x34')]]={'$like':'%'+_0x454042[_0xff7d('0x3d')][_0xff7d('0x4c')]+'%'};return _0x28e747;}})});}_0x42dfce=_[_0xff7d('0x4d')]({},_0x42dfce,_0x454042[_0xff7d('0x4f')]);var _0x19620c={'where':_0x42dfce['where']};return db[_0xff7d('0x37')][_0xff7d('0x2c')](_0x19620c)['then'](function(_0xcdc2df){_0x48f078[_0xff7d('0x2c')]=_0xcdc2df;if(_0x454042['query'][_0xff7d('0x50')]){_0x42dfce[_0xff7d('0x51')]=[{'all':!![]}];}return db[_0xff7d('0x37')][_0xff7d('0x52')](_0x42dfce);})[_0xff7d('0x1c')](function(_0x373806){_0x48f078[_0xff7d('0x53')]=_0x373806;return _0x48f078;})[_0xff7d('0x1c')](respondWithFilteredResult(_0x114508,_0x42dfce))['catch'](handleError(_0x114508,null));};exports[_0xff7d('0x54')]=function(_0x313d31,_0xbba471){var _0x469a9d={'raw':![],'where':{'id':_0x313d31[_0xff7d('0x55')]['id']}},_0x107270={};_0x107270[_0xff7d('0x3c')]=_[_0xff7d('0x3e')](db['Setting'][_0xff7d('0x38')]);_0x107270[_0xff7d('0x3d')]=_[_0xff7d('0x3e')](_0x313d31[_0xff7d('0x3d')]);_0x107270[_0xff7d('0x4a')]=_[_0xff7d('0x3f')](_0x107270[_0xff7d('0x3c')],_0x107270[_0xff7d('0x3d')]);_0x469a9d[_0xff7d('0x40')]=_['intersection'](_0x107270[_0xff7d('0x3c')],qs[_0xff7d('0x41')](_0x313d31[_0xff7d('0x3d')][_0xff7d('0x41')]));_0x469a9d[_0xff7d('0x40')]=_0x469a9d[_0xff7d('0x40')][_0xff7d('0x42')]?_0x469a9d[_0xff7d('0x40')]:_0x107270[_0xff7d('0x3c')];if(_0x313d31[_0xff7d('0x3d')][_0xff7d('0x50')]){_0x469a9d[_0xff7d('0x51')]=[{'all':!![]}];}_0x469a9d=_[_0xff7d('0x4d')]({},_0x469a9d,_0x313d31['options']);return db[_0xff7d('0x37')]['find'](_0x469a9d)[_0xff7d('0x1c')](handleEntityNotFound(_0xbba471,null))[_0xff7d('0x1c')](respondWithResult(_0xbba471,null))[_0xff7d('0x26')](handleError(_0xbba471,null));};exports['update']=function(_0x5c2258,_0x43982b){if(_0x5c2258[_0xff7d('0x56')]['id']){delete _0x5c2258['body']['id'];}return db[_0xff7d('0x37')][_0xff7d('0x57')]({'where':{'id':_0x5c2258[_0xff7d('0x55')]['id']}})[_0xff7d('0x1c')](handleEntityNotFound(_0x43982b,null))[_0xff7d('0x1c')](saveUpdates(_0x5c2258['body'],null))[_0xff7d('0x1c')](respondWithResult(_0x43982b,null))[_0xff7d('0x26')](handleError(_0x43982b,null));};exports[_0xff7d('0x58')]=function(_0x1abe91,_0x576421,_0x1beb2b){if(_0x1abe91['file']&&_0x1abe91['file'][_0xff7d('0x59')]){_0x1abe91[_0xff7d('0x56')][_0xff7d('0x5a')]=_0x1abe91[_0xff7d('0x5b')]['filename'];}return db[_0xff7d('0x37')][_0xff7d('0x57')]({'where':{'id':_0x1abe91['params']['id']}})[_0xff7d('0x1c')](handleEntityNotFound(_0x576421,null))[_0xff7d('0x1c')](saveUpdates(_0x1abe91[_0xff7d('0x56')],null))['then'](respondWithResult(_0x576421,null))[_0xff7d('0x26')](handleError(_0x576421,null));};exports[_0xff7d('0x5c')]=function(_0x48b4a1,_0x438d23,_0x26bc6e){if(_0x48b4a1[_0xff7d('0x5b')]&&_0x48b4a1['file'][_0xff7d('0x59')]){_0x48b4a1[_0xff7d('0x56')][_0xff7d('0x5d')]=_0x48b4a1['file'][_0xff7d('0x59')];}return db[_0xff7d('0x37')]['find']({'where':{'id':_0x48b4a1[_0xff7d('0x55')]['id']}})[_0xff7d('0x1c')](handleEntityNotFound(_0x438d23,null))['then'](saveUpdates(_0x48b4a1[_0xff7d('0x56')],null))['then'](respondWithResult(_0x438d23,null))[_0xff7d('0x26')](handleError(_0x438d23,null));};var utilLicense=require(_0xff7d('0x18'));exports['getLogo']=function(_0x4bc561,_0x4c53f5,_0x351772){var _0x47fa32=_0xff7d('0x5e');var _0x551cba={'custom':![]};return utilLicense['getLicense']()[_0xff7d('0x1c')](function(_0x2fdcb5){if(_0x2fdcb5){_0x551cba=_0x2fdcb5;}return db[_0xff7d('0x37')]['find']({'where':{'id':_0x4bc561[_0xff7d('0x55')]['id']},'attributes':[_0xff7d('0x5a'),_0xff7d('0x5d'),_0xff7d('0x5f'),_0xff7d('0x60'),'defaultLogo',_0xff7d('0x61'),'defaultPreferred',_0xff7d('0x62')],'raw':!![]});})[_0xff7d('0x1c')](handleEntityNotFound(_0x4c53f5,null))['then'](function(_0x42f67a){if(_0x42f67a){var _0x2fb34c=_0x42f67a['logo']&&fs[_0xff7d('0x63')](path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x47fa32,_[_0xff7d('0x66')](_0x42f67a[_0xff7d('0x5a')])))?path['join'](config[_0xff7d('0x65')],_0x47fa32,_[_0xff7d('0x66')](_0x42f67a[_0xff7d('0x5a')])):path['join'](config[_0xff7d('0x65')],_0x47fa32,_[_0xff7d('0x66')]('default_logo.svg'));var _0x2dcbe1=_0xff7d('0x67')+_[_0xff7d('0x68')](_0xff7d('0x5a'));if(_0x42f67a[_0x2dcbe1]||!_0x551cba['custom']){_0x2fb34c=path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x47fa32,_[_0xff7d('0x66')](_0xff7d('0x69')));}if(!fs['existsSync'](_0x2fb34c)){throw new db[(_0xff7d('0x6a'))]['ValidationError'](_['upperFirst']('logo')+_0xff7d('0x6b'));}return _0x4c53f5[_0xff7d('0x6c')](_0x2fb34c);}})[_0xff7d('0x26')](handleError(_0x4c53f5,null));};var utilLicense=require('../../config/license/util');exports[_0xff7d('0x6d')]=function(_0x258890,_0x130e16,_0xfb26dd){var _0x2549d3='server/files/images/logos';var _0x1ef0a2={'custom':![]};return utilLicense['getLicense']()[_0xff7d('0x1c')](function(_0x14a209){if(_0x14a209){_0x1ef0a2=_0x14a209;}return db[_0xff7d('0x37')]['find']({'where':{'id':_0x258890[_0xff7d('0x55')]['id']},'attributes':['logo',_0xff7d('0x5d'),_0xff7d('0x5f'),_0xff7d('0x60'),_0xff7d('0x6e'),'defaultLoginLogo',_0xff7d('0x6f'),_0xff7d('0x62')],'raw':!![]});})[_0xff7d('0x1c')](handleEntityNotFound(_0x130e16,null))['then'](function(_0x114865){if(_0x114865){var _0x282999=_0x114865[_0xff7d('0x5d')]&&fs['existsSync'](path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x2549d3,_['toLower'](_0x114865['loginLogo'])))?path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x2549d3,_[_0xff7d('0x66')](_0x114865['loginLogo'])):path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x2549d3,_[_0xff7d('0x66')](_0xff7d('0x70')));var _0x2a070f=_0xff7d('0x67')+_['upperFirst'](_0xff7d('0x5d'));if(_0x114865[_0x2a070f]||!_0x1ef0a2['custom']){_0x282999=path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x2549d3,_[_0xff7d('0x66')](_0xff7d('0x70')));}if(!fs[_0xff7d('0x63')](_0x282999)){throw new db[(_0xff7d('0x6a'))][(_0xff7d('0x71'))](_[_0xff7d('0x68')](_0xff7d('0x5d'))+'\x20not\x20found');}return _0x130e16[_0xff7d('0x6c')](_0x282999);}})['catch'](handleError(_0x130e16,null));};exports[_0xff7d('0x72')]=function(_0x1ba859,_0x5dba31){return db[_0xff7d('0x37')]['find']({'where':{'id':_0x1ba859['params']['id']},'attributes':[_0xff7d('0x73')]})['then'](respondWithResult(_0x5dba31,null))[_0xff7d('0x26')](handleError(_0x5dba31,null));};exports[_0xff7d('0x74')]=function(_0x3e0278,_0x322a84,_0x14c44f){if(_0x3e0278['file']&&_0x3e0278[_0xff7d('0x5b')]['filename']){_0x3e0278[_0xff7d('0x56')][_0xff7d('0x5f')]=_0x3e0278[_0xff7d('0x5b')][_0xff7d('0x59')];}return db[_0xff7d('0x37')][_0xff7d('0x57')]({'where':{'id':_0x3e0278[_0xff7d('0x55')]['id']}})[_0xff7d('0x1c')](handleEntityNotFound(_0x322a84,null))[_0xff7d('0x1c')](saveUpdates(_0x3e0278[_0xff7d('0x56')],null))[_0xff7d('0x1c')](respondWithResult(_0x322a84,null))[_0xff7d('0x26')](handleError(_0x322a84,null));};var utilLicense=require(_0xff7d('0x18'));exports['getPreferred']=function(_0x4685c7,_0x55d40d,_0xc53f53){var _0x1d256a='server/files/images/logos';var _0x1bc030={'custom':![]};return utilLicense[_0xff7d('0x75')]()['then'](function(_0x4b6b99){if(_0x4b6b99){_0x1bc030=_0x4b6b99;}return db['Setting'][_0xff7d('0x57')]({'where':{'id':_0x4685c7['params']['id']},'attributes':[_0xff7d('0x5a'),_0xff7d('0x5d'),_0xff7d('0x5f'),_0xff7d('0x60'),_0xff7d('0x6e'),_0xff7d('0x61'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xff7d('0x1c')](handleEntityNotFound(_0x55d40d,null))[_0xff7d('0x1c')](function(_0x38daf2){if(_0x38daf2){var _0x180820=_0x38daf2[_0xff7d('0x5f')]&&fs[_0xff7d('0x63')](path['join'](config[_0xff7d('0x65')],_0x1d256a,_[_0xff7d('0x66')](_0x38daf2['preferred'])))?path['join'](config[_0xff7d('0x65')],_0x1d256a,_[_0xff7d('0x66')](_0x38daf2[_0xff7d('0x5f')])):path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0x1d256a,_[_0xff7d('0x66')](_0xff7d('0x76')));var _0xbed75b=_0xff7d('0x67')+_['upperFirst'](_0xff7d('0x5f'));if(_0x38daf2[_0xbed75b]||!_0x1bc030[_0xff7d('0x77')]||!_0x1bc030[_0xff7d('0x5f')]){_0x180820=path['join'](config['root'],_0x1d256a,_[_0xff7d('0x66')]('default_preferred.png'));}if(!fs[_0xff7d('0x63')](_0x180820)){throw new db[(_0xff7d('0x6a'))]['ValidationError'](_[_0xff7d('0x68')](_0xff7d('0x5f'))+'\x20not\x20found');}return _0x55d40d['download'](_0x180820);}})[_0xff7d('0x26')](handleError(_0x55d40d,null));};exports['addFavicon']=function(_0x5a090a,_0x3ccc29,_0x28cb8c){if(_0x5a090a[_0xff7d('0x5b')]&&_0x5a090a[_0xff7d('0x5b')]['filename']){_0x5a090a[_0xff7d('0x56')]['favicon']=_0x5a090a[_0xff7d('0x5b')][_0xff7d('0x59')];}return db['Setting'][_0xff7d('0x57')]({'where':{'id':_0x5a090a[_0xff7d('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ccc29,null))['then'](saveUpdates(_0x5a090a['body'],null))[_0xff7d('0x1c')](respondWithResult(_0x3ccc29,null))['catch'](handleError(_0x3ccc29,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x2b8739,_0x54fb1b,_0x41d1e7){var _0xd3210d='server/files/images/logos';var _0x12bd2b={'custom':![]};return utilLicense[_0xff7d('0x75')]()[_0xff7d('0x1c')](function(_0x498c60){if(_0x498c60){_0x12bd2b=_0x498c60;}return db[_0xff7d('0x37')]['find']({'where':{'id':_0x2b8739[_0xff7d('0x55')]['id']},'attributes':[_0xff7d('0x5a'),_0xff7d('0x5d'),_0xff7d('0x5f'),'favicon',_0xff7d('0x6e'),_0xff7d('0x61'),_0xff7d('0x6f'),_0xff7d('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x54fb1b,null))[_0xff7d('0x1c')](function(_0x574e3c){if(_0x574e3c){var _0x3fa175=_0x574e3c['favicon']&&fs['existsSync'](path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0xd3210d,_[_0xff7d('0x66')](_0x574e3c[_0xff7d('0x60')])))?path[_0xff7d('0x64')](config['root'],_0xd3210d,_[_0xff7d('0x66')](_0x574e3c[_0xff7d('0x60')])):path[_0xff7d('0x64')](config['root'],_0xd3210d,_[_0xff7d('0x66')](_0xff7d('0x78')));var _0x40f74f=_0xff7d('0x67')+_[_0xff7d('0x68')](_0xff7d('0x60'));if(_0x574e3c[_0x40f74f]||!_0x12bd2b[_0xff7d('0x77')]){_0x3fa175=path[_0xff7d('0x64')](config[_0xff7d('0x65')],_0xd3210d,_[_0xff7d('0x66')](_0xff7d('0x78')));}if(!fs[_0xff7d('0x63')](_0x3fa175)){throw new db[(_0xff7d('0x6a'))][(_0xff7d('0x71'))](_[_0xff7d('0x68')](_0xff7d('0x60'))+_0xff7d('0x6b'));}return _0x54fb1b[_0xff7d('0x6c')](_0x3fa175);}})[_0xff7d('0x26')](handleError(_0x54fb1b,null));};exports[_0xff7d('0x79')]=function(_0x4fd1b2,_0x20087d){var _0x342adf={'offset':moment()[_0xff7d('0x7a')]()};_0x342adf[_0xff7d('0x7b')]=moment()[_0xff7d('0x7a')](_0x342adf[_0xff7d('0x46')])[_0xff7d('0x7c')](_0xff7d('0x7d'));return _0x20087d[_0xff7d('0x28')](0xc8)[_0xff7d('0x35')](_0x342adf);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 850aeb1..756d6f1 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x7217,0x19e));var _0x7721=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7217[_0x491a7f];return _0x3d8f44;};'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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 453ecd1..7f88451 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 _0x732f=['options','raw','attributes','include','model','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSetting','Setting'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x732f,0xf8));var _0xf732=function(_0x260097,_0xfd77f9){_0x260097=_0x260097-0x0;var _0x4380de=_0x732f[_0x260097];return _0x4380de;};'use strict';var _=require(_0xf732('0x0'));var util=require(_0xf732('0x1'));var moment=require(_0xf732('0x2'));var BPromise=require(_0xf732('0x3'));var rs=require(_0xf732('0x4'));var fs=require('fs');var Redis=require(_0xf732('0x5'));var db=require(_0xf732('0x6'))['db'];var utils=require(_0xf732('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf732('0x8'));var client=jayson['client'][_0xf732('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3305fd,_0x19fcd0,_0x5dd671){return new BPromise(function(_0x383880,_0x12f89d){return client['request'](_0x3305fd,_0x5dd671)[_0xf732('0xa')](function(_0x454087){logger[_0xf732('0xb')](_0xf732('0xc'),_0x19fcd0,'request\x20sent');logger['debug'](_0xf732('0xd'),_0x19fcd0,_0xf732('0xe'),JSON[_0xf732('0xf')](_0x454087));if(_0x454087[_0xf732('0x10')]){if(_0x454087[_0xf732('0x10')][_0xf732('0x11')]===0x1f4){logger[_0xf732('0x10')](_0xf732('0xc'),_0x19fcd0,_0x454087[_0xf732('0x10')][_0xf732('0x12')]);return _0x12f89d(_0x454087['error'][_0xf732('0x12')]);}logger[_0xf732('0x10')](_0xf732('0xc'),_0x19fcd0,_0x454087[_0xf732('0x10')][_0xf732('0x12')]);return _0x383880(_0x454087['error'][_0xf732('0x12')]);}else{logger[_0xf732('0xb')](_0xf732('0xc'),_0x19fcd0,_0xf732('0xe'));_0x383880(_0x454087[_0xf732('0x13')][_0xf732('0x12')]);}})['catch'](function(_0x3daea9){logger[_0xf732('0x10')]('Setting,\x20%s,\x20%s',_0x19fcd0,_0x3daea9);_0x12f89d(_0x3daea9);});});}exports[_0xf732('0x14')]=function(_0x4204ce){var _0xdba95c=this;return new Promise(function(_0x2a5990,_0x35bf35){return db[_0xf732('0x15')]['find']({'raw':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')][_0xf732('0x17')]===undefined?!![]:![]:!![],'where':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')]['where']||null:null,'attributes':_0x4204ce['options']?_0x4204ce[_0xf732('0x16')][_0xf732('0x18')]||null:null,'include':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')][_0xf732('0x19')]?_['map'](_0x4204ce[_0xf732('0x16')][_0xf732('0x19')],function(_0x486268){return{'model':db[_0x486268[_0xf732('0x1a')]],'as':_0x486268['as'],'attributes':_0x486268['attributes'],'include':_0x486268[_0xf732('0x19')]?_[_0xf732('0x1b')](_0x486268['include'],function(_0x114e18){return{'model':db[_0x114e18[_0xf732('0x1a')]],'as':_0x114e18['as'],'attributes':_0x114e18[_0xf732('0x18')],'include':_0x114e18[_0xf732('0x19')]?_[_0xf732('0x1b')](_0x114e18[_0xf732('0x19')],function(_0x225ad6){return{'model':db[_0x225ad6['model']],'as':_0x225ad6['as'],'attributes':_0x225ad6[_0xf732('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf732('0xa')](function(_0x29817b){logger[_0xf732('0xb')](_0xf732('0x14'),_0x4204ce);logger[_0xf732('0x1c')](_0xf732('0x14'),_0x4204ce,JSON['stringify'](_0x29817b));_0x2a5990(_0x29817b);})[_0xf732('0x1d')](function(_0xa4d5a1){logger[_0xf732('0x10')](_0xf732('0x14'),_0xa4d5a1['message'],_0x4204ce);_0x35bf35(_0xdba95c['error'](0x1f4,_0xa4d5a1[_0xf732('0x12')]));});});}; \ No newline at end of file +var _0xf64d=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','ShowSetting','find','options','raw','include','map','model','attributes'];(function(_0x8a0140,_0x4a1b16){var _0x1be8a8=function(_0x3f18a9){while(--_0x3f18a9){_0x8a0140['push'](_0x8a0140['shift']());}};_0x1be8a8(++_0x4a1b16);}(_0xf64d,0x1d1));var _0xdf64=function(_0x40c5e0,_0x3b77ad){_0x40c5e0=_0x40c5e0-0x0;var _0x47ee12=_0xf64d[_0x40c5e0];return _0x47ee12;};'use strict';var _=require(_0xdf64('0x0'));var util=require(_0xdf64('0x1'));var moment=require(_0xdf64('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf64('0x3'));var db=require(_0xdf64('0x4'))['db'];var utils=require(_0xdf64('0x5'));var logger=require(_0xdf64('0x6'))(_0xdf64('0x7'));var config=require(_0xdf64('0x8'));var jayson=require(_0xdf64('0x9'));var client=jayson[_0xdf64('0xa')][_0xdf64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33b59,_0x22d898,_0x40ebfe){return new BPromise(function(_0x339a32,_0x3c710d){return client[_0xdf64('0xc')](_0x33b59,_0x40ebfe)[_0xdf64('0xd')](function(_0x3fdf52){logger['info'](_0xdf64('0xe'),_0x22d898,_0xdf64('0xf'));logger[_0xdf64('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x22d898,'request\x20sent',JSON[_0xdf64('0x11')](_0x3fdf52));if(_0x3fdf52[_0xdf64('0x12')]){if(_0x3fdf52[_0xdf64('0x12')][_0xdf64('0x13')]===0x1f4){logger[_0xdf64('0x12')](_0xdf64('0xe'),_0x22d898,_0x3fdf52[_0xdf64('0x12')][_0xdf64('0x14')]);return _0x3c710d(_0x3fdf52[_0xdf64('0x12')][_0xdf64('0x14')]);}logger[_0xdf64('0x12')](_0xdf64('0xe'),_0x22d898,_0x3fdf52[_0xdf64('0x12')]['message']);return _0x339a32(_0x3fdf52[_0xdf64('0x12')][_0xdf64('0x14')]);}else{logger[_0xdf64('0x15')](_0xdf64('0xe'),_0x22d898,'request\x20sent');_0x339a32(_0x3fdf52['result']['message']);}})[_0xdf64('0x16')](function(_0x422747){logger[_0xdf64('0x12')]('Setting,\x20%s,\x20%s',_0x22d898,_0x422747);_0x3c710d(_0x422747);});});}exports[_0xdf64('0x17')]=function(_0x4317a1){var _0x2b4db9=this;return new Promise(function(_0x39440f,_0x407fa6){return db['Setting'][_0xdf64('0x18')]({'raw':_0x4317a1[_0xdf64('0x19')]?_0x4317a1[_0xdf64('0x19')][_0xdf64('0x1a')]===undefined?!![]:![]:!![],'where':_0x4317a1['options']?_0x4317a1['options']['where']||null:null,'attributes':_0x4317a1[_0xdf64('0x19')]?_0x4317a1[_0xdf64('0x19')]['attributes']||null:null,'include':_0x4317a1['options']?_0x4317a1[_0xdf64('0x19')][_0xdf64('0x1b')]?_[_0xdf64('0x1c')](_0x4317a1[_0xdf64('0x19')][_0xdf64('0x1b')],function(_0x3dcb41){return{'model':db[_0x3dcb41[_0xdf64('0x1d')]],'as':_0x3dcb41['as'],'attributes':_0x3dcb41[_0xdf64('0x1e')],'include':_0x3dcb41['include']?_[_0xdf64('0x1c')](_0x3dcb41[_0xdf64('0x1b')],function(_0x344d7e){return{'model':db[_0x344d7e[_0xdf64('0x1d')]],'as':_0x344d7e['as'],'attributes':_0x344d7e[_0xdf64('0x1e')],'include':_0x344d7e['include']?_[_0xdf64('0x1c')](_0x344d7e[_0xdf64('0x1b')],function(_0x4d9e8e){return{'model':db[_0x4d9e8e[_0xdf64('0x1d')]],'as':_0x4d9e8e['as'],'attributes':_0x4d9e8e[_0xdf64('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf64('0xd')](function(_0x2f930a){logger['info'](_0xdf64('0x17'),_0x4317a1);logger[_0xdf64('0x10')](_0xdf64('0x17'),_0x4317a1,JSON[_0xdf64('0x11')](_0x2f930a));_0x39440f(_0x2f930a);})[_0xdf64('0x16')](function(_0x28b074){logger[_0xdf64('0x12')](_0xdf64('0x17'),_0x28b074[_0xdf64('0x14')],_0x4317a1);_0x407fa6(_0x2b4db9[_0xdf64('0x12')](0x1f4,_0x28b074['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e2c05f0..09678df 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0x814b,0x1a2));var _0xb814=function(_0x101ccf,_0x37e172){_0x101ccf=_0x101ccf-0x0;var _0x99b0f1=_0x814b[_0x101ccf];return _0x99b0f1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7217,0x19e));var _0x7721=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7217[_0x311c35];return _0x5cc50c;};'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['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 22d0e09..a2383e2 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 _0xce05=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','skebby','clicksend','plivo','clickatell','csc','infobip'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xce05,0x77));var _0x5ce0=function(_0x4020eb,_0x585639){_0x4020eb=_0x4020eb-0x0;var _0x5d8d75=_0xce05[_0x4020eb];return _0x5d8d75;};'use strict';var Sequelize=require(_0x5ce0('0x0'));var rs=require(_0x5ce0('0x1'));module[_0x5ce0('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5ce0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5ce0('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x5ce0('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x5ce0('0x4')],'defaultValue':function(){return rs[_0x5ce0('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5ce0('0x6')]('twilio',_0x5ce0('0x7'),'connectel',_0x5ce0('0x8'),_0x5ce0('0x9'),_0x5ce0('0xa'),'bandwidth',_0x5ce0('0xb'),_0x5ce0('0xc'),_0x5ce0('0xd'))},'accountSid':{'type':Sequelize[_0x5ce0('0x4')]},'authId':{'type':Sequelize[_0x5ce0('0x4')]},'authToken':{'type':Sequelize[_0x5ce0('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x5ce0('0x4')]},'apiKey':{'type':Sequelize[_0x5ce0('0x4')]},'applicationId':{'type':Sequelize[_0x5ce0('0x4')]},'accountId':{'type':Sequelize[_0x5ce0('0x4')]},'senderString':{'type':Sequelize[_0x5ce0('0x4')]},'deliveryReport':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x5ce0('0x4')]},'notificationTemplate':{'type':Sequelize[_0x5ce0('0xf')],'defaultValue':function(){return _0x5ce0('0x10');}},'notificationSound':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5ce0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5ce0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5ce0('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![],'comment':_0x5ce0('0x12'),'set':function(_0x1628f1){if(!_0x1628f1)this[_0x5ce0('0x13')](_0x5ce0('0x14'),null);this[_0x5ce0('0x13')](_0x5ce0('0x15'),_0x1628f1);}}}; \ No newline at end of file +var _0xcea2=['clickatell','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','ENUM','skebby','clicksend','plivo'];(function(_0x4eed5e,_0x30b1c4){var _0xc42f2a=function(_0x34d4aa){while(--_0x34d4aa){_0x4eed5e['push'](_0x4eed5e['shift']());}};_0xc42f2a(++_0x30b1c4);}(_0xcea2,0x1b9));var _0x2cea=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcea2[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x2cea('0x0'));var rs=require(_0x2cea('0x1'));module[_0x2cea('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2cea('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2cea('0x3')],'defaultValue':function(){return rs[_0x2cea('0x4')]();}},'phone':{'type':Sequelize[_0x2cea('0x3')]},'type':{'type':Sequelize[_0x2cea('0x5')]('twilio',_0x2cea('0x6'),'connectel',_0x2cea('0x7'),_0x2cea('0x8'),_0x2cea('0x9'),'bandwidth','csc',_0x2cea('0xa'),_0x2cea('0xb'))},'accountSid':{'type':Sequelize[_0x2cea('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x2cea('0x3')]},'smsMethod':{'type':Sequelize[_0x2cea('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x2cea('0x3')]},'password':{'type':Sequelize[_0x2cea('0x3')]},'apiKey':{'type':Sequelize[_0x2cea('0x3')]},'applicationId':{'type':Sequelize[_0x2cea('0x3')]},'accountId':{'type':Sequelize[_0x2cea('0x3')]},'senderString':{'type':Sequelize[_0x2cea('0x3')]},'deliveryReport':{'type':Sequelize[_0x2cea('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x2cea('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2cea('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2cea('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2cea('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2cea('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2cea('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2cea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2cea('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2cea('0xe')],'comment':_0x2cea('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11247f){if(!_0x11247f)this[_0x2cea('0x10')](_0x2cea('0x11'),null);this[_0x2cea('0x10')]('mandatoryDisposition',_0x11247f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ac2a358..2e0c45c 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 _0xea5f=['findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','SmsMessage','statusInt','requestid','status_code','DELIVERED','groupName','clickatell','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','statusGet','csc','message-id','state','omit','removeAgents','emit','userSmsAccount:remove','getAgents','rimraf','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','SmsAccount,\x20%s,\x20%s','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','SmsAccount','findAll','rows','catch','Pause','mandatoryDispositionPause','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','SmsAccountId','getDispositions','Disposition','nolimit','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','Contacts','DESC','list','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','send','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate'];(function(_0x6978c0,_0x1f6765){var _0x361377=function(_0x2d6cfd){while(--_0x2d6cfd){_0x6978c0['push'](_0x6978c0['shift']());}};_0x361377(++_0x1f6765);}(_0xea5f,0x1ee));var _0xfea5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xea5f[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfea5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfea5('0x1'));var moment=require(_0xfea5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfea5('0x3'));var path=require('path');var sox=require(_0xfea5('0x4'));var csv=require(_0xfea5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfea5('0x6'));var _=require(_0xfea5('0x7'));var squel=require(_0xfea5('0x8'));var crypto=require(_0xfea5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfea5('0xa'));var toCsv=require(_0xfea5('0x5'));var querystring=require(_0xfea5('0xb'));var Papa=require(_0xfea5('0xc'));var Redis=require('ioredis');var authService=require(_0xfea5('0xd'));var qs=require(_0xfea5('0xe'));var as=require(_0xfea5('0xf'));var hardwareService=require(_0xfea5('0x10'));var logger=require(_0xfea5('0x11'))(_0xfea5('0x12'));var utils=require(_0xfea5('0x13'));var config=require(_0xfea5('0x14'));var licenseUtil=require(_0xfea5('0x15'));var db=require('../../mysqldb')['db'];config[_0xfea5('0x16')]=_[_0xfea5('0x17')](config[_0xfea5('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfea5('0x18'))(new Redis(config[_0xfea5('0x16')]));require(_0xfea5('0x19'))[_0xfea5('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfea5('0x1b')][_0xfea5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x566d84,_0x509568,_0x4fea23,_0x3a2d39){return new BPromise(function(_0x351f84,_0x44ca82){var _0x2e552c=_0x3a2d39||client;return _0x2e552c[_0xfea5('0x1d')](_0x566d84,_0x4fea23)[_0xfea5('0x1e')](function(_0x2d58fb){logger[_0xfea5('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x509568,'request\x20sent');logger[_0xfea5('0x20')](_0xfea5('0x21'),_0x509568,'request\x20sent',JSON['stringify'](_0x2d58fb));if(_0x2d58fb['error']){if(_0x2d58fb[_0xfea5('0x22')]['code']===0x1f4){logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s',_0x509568,_0x2d58fb[_0xfea5('0x22')][_0xfea5('0x23')]);return _0x44ca82(_0x2d58fb[_0xfea5('0x22')][_0xfea5('0x23')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x509568,_0x2d58fb['error'][_0xfea5('0x23')]);return _0x351f84(_0x2d58fb['error']['message']);}else{logger[_0xfea5('0x1f')](_0xfea5('0x24'),_0x509568,'request\x20sent');_0x351f84(_0x2d58fb[_0xfea5('0x25')][_0xfea5('0x23')]);}})['catch'](function(_0x17e3cc){logger['error'](_0xfea5('0x24'),_0x509568,_0x17e3cc);_0x44ca82(_0x17e3cc);});});}function respondWithStatusCode(_0x5cbd10,_0x19baf2){_0x19baf2=_0x19baf2||0xcc;return function(_0xf35ef){if(_0xf35ef){return _0x5cbd10[_0xfea5('0x26')](_0x19baf2);}return _0x5cbd10['status'](_0x19baf2)[_0xfea5('0x27')]();};}function respondWithResult(_0x4db3cc,_0x539e2d){_0x539e2d=_0x539e2d||0xc8;return function(_0x448dda){if(_0x448dda){return _0x4db3cc[_0xfea5('0x28')](_0x539e2d)[_0xfea5('0x29')](_0x448dda);}};}function respondWithFilteredResult(_0x58b037,_0x2d6fcf){return function(_0x19c253){if(_0x19c253){var _0x225ad8=typeof _0x2d6fcf[_0xfea5('0x2a')]===_0xfea5('0x2b')&&typeof _0x2d6fcf[_0xfea5('0x2c')]===_0xfea5('0x2b');var _0x59408b=_0x19c253[_0xfea5('0x2d')];var _0x2b1bcf=_0x225ad8?0x0:_0x2d6fcf[_0xfea5('0x2a')];var _0x3cf230=_0x225ad8?_0x19c253[_0xfea5('0x2d')]:_0x2d6fcf['offset']+_0x2d6fcf['limit'];var _0x870f6d;if(_0x3cf230>=_0x59408b){_0x3cf230=_0x59408b;_0x870f6d=0xc8;}else{_0x870f6d=0xce;}_0x58b037['status'](_0x870f6d);return _0x58b037[_0xfea5('0x2e')](_0xfea5('0x2f'),_0x2b1bcf+'-'+_0x3cf230+'/'+_0x59408b)[_0xfea5('0x29')](_0x19c253);}return null;};}function patchUpdates(_0x8e855c){return function(_0x86791c){try{jsonpatch[_0xfea5('0x30')](_0x86791c,_0x8e855c,!![]);}catch(_0xd422da){return BPromise['reject'](_0xd422da);}return _0x86791c[_0xfea5('0x31')]();};}function saveUpdates(_0x11be00,_0x5d0b73){return function(_0x404235){if(_0x404235){return _0x404235[_0xfea5('0x32')](_0x11be00)['then'](function(_0x5cca6a){return _0x5cca6a;});}return null;};}function removeEntity(_0x1f6ef0,_0x19b963){return function(_0x203892){if(_0x203892){return _0x203892[_0xfea5('0x33')]()[_0xfea5('0x1e')](function(){var _0x83138a=_0x203892[_0xfea5('0x34')]({'plain':!![]});var _0x451a14=_0xfea5('0x35');return db[_0xfea5('0x36')][_0xfea5('0x33')]({'where':{'type':_0x451a14,'resourceId':_0x83138a['id']}})[_0xfea5('0x1e')](function(){return _0x203892;});})[_0xfea5('0x1e')](function(){_0x1f6ef0[_0xfea5('0x28')](0xcc)[_0xfea5('0x27')]();});}};}function handleEntityNotFound(_0x534f58,_0x1192a0){return function(_0x2be718){if(!_0x2be718){_0x534f58[_0xfea5('0x26')](0x194);}return _0x2be718;};}function handleError(_0x549762,_0x474555){_0x474555=_0x474555||0x1f4;return function(_0x3aa448){logger[_0xfea5('0x22')](_0x3aa448[_0xfea5('0x37')]);if(_0x3aa448[_0xfea5('0x38')]){delete _0x3aa448[_0xfea5('0x38')];}_0x549762['status'](_0x474555)['send'](_0x3aa448);};}exports[_0xfea5('0x39')]=function(_0x255618,_0x515fa3){var _0xe97a81={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1c93e3={},_0x2a7d64={'count':0x0,'rows':[]};var _0x5c2017=_[_0xfea5('0x3a')](db['SmsAccount'][_0xfea5('0x3b')],function(_0x5328ab){return{'name':_0x5328ab[_0xfea5('0x3c')],'type':_0x5328ab[_0xfea5('0x3d')][_0xfea5('0x3e')]};});_0x1c93e3[_0xfea5('0x3f')]=_[_0xfea5('0x3a')](_0x5c2017,_0xfea5('0x38'));_0x1c93e3[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x255618['query']);_0x1c93e3[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x1c93e3['model'],_0x1c93e3['query']);_0xe97a81[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x1c93e3[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x255618[_0xfea5('0x40')][_0xfea5('0x45')]));_0xe97a81[_0xfea5('0x44')]=_0xe97a81[_0xfea5('0x44')][_0xfea5('0x46')]?_0xe97a81[_0xfea5('0x44')]:_0x1c93e3[_0xfea5('0x3f')];if(!_0x255618[_0xfea5('0x40')][_0xfea5('0x47')]('nolimit')){_0xe97a81[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x255618['query'][_0xfea5('0x2c')]);_0xe97a81['offset']=qs['offset'](_0x255618[_0xfea5('0x40')][_0xfea5('0x2a')]);}_0xe97a81[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x255618[_0xfea5('0x40')][_0xfea5('0x49')]);_0xe97a81['where']=qs['filters'](_[_0xfea5('0x4a')](_0x255618[_0xfea5('0x40')],_0x1c93e3[_0xfea5('0x42')]),_0x5c2017);if(_0x255618[_0xfea5('0x40')][_0xfea5('0x4b')]){_0xe97a81[_0xfea5('0x4c')]=_['merge'](_0xe97a81['where'],{'$or':_[_0xfea5('0x3a')](_0x5c2017,function(_0x592081){if(_0x592081[_0xfea5('0x3d')]!=='VIRTUAL'){var _0x1010b5={};_0x1010b5[_0x592081[_0xfea5('0x38')]]={'$like':'%'+_0x255618[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x1010b5;}})});}_0xe97a81=_[_0xfea5('0x4d')]({},_0xe97a81,_0x255618[_0xfea5('0x4e')]);var _0x13732a={'where':_0xe97a81['where']};return db[_0xfea5('0x4f')]['count'](_0x13732a)[_0xfea5('0x1e')](function(_0x117bfb){_0x2a7d64[_0xfea5('0x2d')]=_0x117bfb;if(_0x255618['query']['includeAll']){_0xe97a81['include']=[{'all':!![]}];}return db[_0xfea5('0x4f')][_0xfea5('0x50')](_0xe97a81);})[_0xfea5('0x1e')](function(_0x5d8e71){_0x2a7d64[_0xfea5('0x51')]=_0x5d8e71;return _0x2a7d64;})[_0xfea5('0x1e')](respondWithFilteredResult(_0x515fa3,_0xe97a81))[_0xfea5('0x52')](handleError(_0x515fa3,null));};exports['show']=function(_0x51c9de,_0x283eac){var _0x1397b0={'raw':![],'where':{'id':_0x51c9de['params']['id']},'include':[{'model':db[_0xfea5('0x53')],'as':_0xfea5('0x54')}]},_0x2be011={};_0x2be011[_0xfea5('0x3f')]=_['keys'](db[_0xfea5('0x4f')]['rawAttributes']);_0x2be011[_0xfea5('0x40')]=_['keys'](_0x51c9de[_0xfea5('0x40')]);_0x2be011[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x2be011[_0xfea5('0x3f')],_0x2be011[_0xfea5('0x40')]);_0x1397b0[_0xfea5('0x44')]=_['intersection'](_0x2be011['model'],qs[_0xfea5('0x45')](_0x51c9de[_0xfea5('0x40')][_0xfea5('0x45')]));_0x1397b0[_0xfea5('0x44')]=_0x1397b0[_0xfea5('0x44')][_0xfea5('0x46')]?_0x1397b0[_0xfea5('0x44')]:_0x2be011[_0xfea5('0x3f')];if(_0x51c9de[_0xfea5('0x40')][_0xfea5('0x55')]){_0x1397b0['include']=[{'all':!![]}];}_0x1397b0=_[_0xfea5('0x4d')]({},_0x1397b0,_0x51c9de[_0xfea5('0x4e')]);return db[_0xfea5('0x4f')]['find'](_0x1397b0)[_0xfea5('0x1e')](handleEntityNotFound(_0x283eac,null))[_0xfea5('0x1e')](respondWithResult(_0x283eac,null))['catch'](handleError(_0x283eac,null));};exports[_0xfea5('0x56')]=function(_0x7e962c,_0x1750dd){return db[_0xfea5('0x4f')][_0xfea5('0x56')](_0x7e962c[_0xfea5('0x57')],{})[_0xfea5('0x1e')](function(_0x319666){var _0x1b7c27=_0x7e962c[_0xfea5('0x58')][_0xfea5('0x34')]({'plain':!![]});if(!_0x1b7c27)throw new Error(_0xfea5('0x59'));if(_0x1b7c27[_0xfea5('0x5a')]===_0xfea5('0x58')){var _0x337596=_0x319666['get']({'plain':!![]});var _0x28c621=_0xfea5('0x35');return db[_0xfea5('0x5b')]['find']({'where':{'name':_0x28c621,'userProfileId':_0x1b7c27[_0xfea5('0x5c')]},'raw':!![]})['then'](function(_0x8a7df){if(_0x8a7df&&_0x8a7df[_0xfea5('0x5d')]===0x0){return db[_0xfea5('0x36')]['create']({'name':_0x337596[_0xfea5('0x38')],'resourceId':_0x337596['id'],'type':_0x8a7df[_0xfea5('0x38')],'sectionId':_0x8a7df['id']},{})[_0xfea5('0x1e')](function(){return _0x319666;});}else{return _0x319666;}})[_0xfea5('0x52')](function(_0x4726c6){logger[_0xfea5('0x22')](_0xfea5('0x5e'),_0x4726c6);throw _0x4726c6;});}return _0x319666;})[_0xfea5('0x1e')](respondWithResult(_0x1750dd,0xc9))[_0xfea5('0x52')](handleError(_0x1750dd,null));};exports[_0xfea5('0x32')]=function(_0x4d17a3,_0x395964){if(_0x4d17a3[_0xfea5('0x57')]['id']){delete _0x4d17a3[_0xfea5('0x57')]['id'];}return db['SmsAccount'][_0xfea5('0x5f')]({'where':{'id':_0x4d17a3['params']['id']},'include':[{'model':db[_0xfea5('0x53')],'as':_0xfea5('0x54')}]})[_0xfea5('0x1e')](handleEntityNotFound(_0x395964,null))['then'](saveUpdates(_0x4d17a3['body'],null))['then'](respondWithResult(_0x395964,null))['catch'](handleError(_0x395964,null));};exports[_0xfea5('0x33')]=function(_0x487c75,_0x5b8239){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x487c75[_0xfea5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5b8239,null))[_0xfea5('0x1e')](removeEntity(_0x5b8239,null))[_0xfea5('0x52')](handleError(_0x5b8239,null));};exports[_0xfea5('0x61')]=function(_0x3115c3,_0x43d631){return db[_0xfea5('0x4f')][_0xfea5('0x61')]()['then'](respondWithResult(_0x43d631,null))[_0xfea5('0x52')](handleError(_0x43d631,null));};exports[_0xfea5('0x62')]=function(_0x2b25f5,_0x357dde,_0x1b2d3a){if(_0x2b25f5['body']['id']){delete _0x2b25f5['body']['id'];}return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x2b25f5[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x357dde,null))[_0xfea5('0x1e')](function(_0x20b25e){if(_0x20b25e){_0x2b25f5[_0xfea5('0x57')][_0xfea5('0x63')]=_0x20b25e['id'];return db['Disposition'][_0xfea5('0x56')](_0x2b25f5['body']);}})[_0xfea5('0x1e')](respondWithResult(_0x357dde,null))[_0xfea5('0x52')](handleError(_0x357dde,null));};exports[_0xfea5('0x64')]=function(_0x38bc31,_0x1330ae,_0x37b631){var _0x299ed1={'raw':![],'where':{}};var _0x2117c4={};var _0x2f9e16={'count':0x0,'rows':[]};return db[_0xfea5('0x4f')]['findOne']({'where':{'id':_0x38bc31[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x1330ae,null))[_0xfea5('0x1e')](function(_0x277bdc){if(_0x277bdc){_0x2117c4[_0xfea5('0x3f')]=_[_0xfea5('0x41')](db[_0xfea5('0x65')]['rawAttributes']);_0x2117c4[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x38bc31[_0xfea5('0x40')]);_0x2117c4[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x2117c4[_0xfea5('0x3f')],_0x2117c4['query']);_0x299ed1[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x2117c4[_0xfea5('0x3f')],qs['fields'](_0x38bc31['query'][_0xfea5('0x45')]));_0x299ed1[_0xfea5('0x44')]=_0x299ed1[_0xfea5('0x44')][_0xfea5('0x46')]?_0x299ed1[_0xfea5('0x44')]:_0x2117c4[_0xfea5('0x3f')];if(!_0x38bc31[_0xfea5('0x40')][_0xfea5('0x47')](_0xfea5('0x66'))){_0x299ed1['limit']=qs[_0xfea5('0x2c')](_0x38bc31[_0xfea5('0x40')][_0xfea5('0x2c')]);_0x299ed1['offset']=qs[_0xfea5('0x2a')](_0x38bc31['query'][_0xfea5('0x2a')]);}_0x299ed1[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x38bc31[_0xfea5('0x40')][_0xfea5('0x49')]);_0x299ed1[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x38bc31['query'],_0x2117c4['filters']));_0x299ed1['where'][_0xfea5('0x63')]=_0x277bdc['id'];if(_0x38bc31[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x299ed1[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x299ed1[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x299ed1[_0xfea5('0x44')],function(_0x30159a){var _0x2816ef={};_0x2816ef[_0x30159a]={'$like':'%'+_0x38bc31[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x2816ef;})});}_0x299ed1=_['merge']({},_0x299ed1,_0x38bc31[_0xfea5('0x4e')]);return db[_0xfea5('0x65')][_0xfea5('0x2d')]({'where':_0x299ed1['where']})[_0xfea5('0x1e')](function(_0x1d6c24){_0x2f9e16[_0xfea5('0x2d')]=_0x1d6c24;if(_0x38bc31['query'][_0xfea5('0x55')]){_0x299ed1[_0xfea5('0x67')]=[{'all':!![]}];}return db['Disposition'][_0xfea5('0x50')](_0x299ed1);})['then'](function(_0x4b4597){_0x2f9e16[_0xfea5('0x51')]=_0x4b4597;return _0x2f9e16;});}})[_0xfea5('0x1e')](respondWithFilteredResult(_0x1330ae,_0x299ed1))[_0xfea5('0x52')](handleError(_0x1330ae,null));};exports[_0xfea5('0x68')]=function(_0x3f1739,_0x2040d6,_0x28d53d){return db[_0xfea5('0x4f')]['find']({'where':{'id':_0x3f1739['params']['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2040d6,null))[_0xfea5('0x1e')](function(_0x267857){if(_0x267857){return _0x267857[_0xfea5('0x68')](_0x3f1739[_0xfea5('0x40')][_0xfea5('0x69')]);}})['then'](respondWithStatusCode(_0x2040d6,null))['catch'](handleError(_0x2040d6,null));};exports[_0xfea5('0x6a')]=function(_0x2fdb8b,_0x1350b8,_0x4e6304){if(_0x2fdb8b['body']['id']){delete _0x2fdb8b['body']['id'];}return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x2fdb8b[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x1350b8,null))['then'](function(_0x46fb69){if(_0x46fb69){_0x2fdb8b[_0xfea5('0x57')]['SmsAccountId']=_0x46fb69['id'];return db[_0xfea5('0x6b')][_0xfea5('0x56')](_0x2fdb8b[_0xfea5('0x57')]);}})[_0xfea5('0x1e')](respondWithResult(_0x1350b8,null))['catch'](handleError(_0x1350b8,null));};exports[_0xfea5('0x6c')]=function(_0x35cc79,_0x14bd33,_0x49559f){var _0x45a9a3={'raw':![],'where':{}};var _0x195785={};var _0x158604={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfea5('0x6d')]({'where':{'id':_0x35cc79[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x14bd33,null))[_0xfea5('0x1e')](function(_0x30c342){if(_0x30c342){_0x195785['model']=_[_0xfea5('0x41')](db[_0xfea5('0x6b')][_0xfea5('0x3b')]);_0x195785['query']=_[_0xfea5('0x41')](_0x35cc79[_0xfea5('0x40')]);_0x195785[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x195785[_0xfea5('0x3f')],_0x195785[_0xfea5('0x40')]);_0x45a9a3[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x195785[_0xfea5('0x3f')],qs['fields'](_0x35cc79[_0xfea5('0x40')][_0xfea5('0x45')]));_0x45a9a3[_0xfea5('0x44')]=_0x45a9a3[_0xfea5('0x44')]['length']?_0x45a9a3[_0xfea5('0x44')]:_0x195785[_0xfea5('0x3f')];if(!_0x35cc79['query'][_0xfea5('0x47')]('nolimit')){_0x45a9a3[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x35cc79['query'][_0xfea5('0x2c')]);_0x45a9a3[_0xfea5('0x2a')]=qs['offset'](_0x35cc79['query'][_0xfea5('0x2a')]);}_0x45a9a3[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x35cc79['query'][_0xfea5('0x49')]);_0x45a9a3['where']=qs['filters'](_[_0xfea5('0x4a')](_0x35cc79[_0xfea5('0x40')],_0x195785[_0xfea5('0x42')]));_0x45a9a3['where'][_0xfea5('0x63')]=_0x30c342['id'];if(_0x35cc79[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x45a9a3[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x45a9a3[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x45a9a3[_0xfea5('0x44')],function(_0x48a700){var _0x19b2bc={};_0x19b2bc[_0x48a700]={'$like':'%'+_0x35cc79['query']['filter']+'%'};return _0x19b2bc;})});}_0x45a9a3=_[_0xfea5('0x4d')]({},_0x45a9a3,_0x35cc79[_0xfea5('0x4e')]);return db['CannedAnswer']['count']({'where':_0x45a9a3[_0xfea5('0x4c')]})[_0xfea5('0x1e')](function(_0xbf24fc){_0x158604[_0xfea5('0x2d')]=_0xbf24fc;if(_0x35cc79[_0xfea5('0x40')][_0xfea5('0x55')]){_0x45a9a3[_0xfea5('0x67')]=[{'all':!![]}];}return db[_0xfea5('0x6b')][_0xfea5('0x50')](_0x45a9a3);})[_0xfea5('0x1e')](function(_0x17f658){_0x158604[_0xfea5('0x51')]=_0x17f658;return _0x158604;});}})['then'](respondWithFilteredResult(_0x14bd33,_0x45a9a3))[_0xfea5('0x52')](handleError(_0x14bd33,null));};exports[_0xfea5('0x6e')]=function(_0x3e24b1,_0x8beef9,_0x4698ca){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x3e24b1[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x8beef9,null))[_0xfea5('0x1e')](function(_0xca5990){if(_0xca5990){return _0xca5990[_0xfea5('0x6e')](_0x3e24b1['query'][_0xfea5('0x69')]);}})[_0xfea5('0x1e')](respondWithStatusCode(_0x8beef9,null))[_0xfea5('0x52')](handleError(_0x8beef9,null));};exports[_0xfea5('0x6f')]=function(_0x926747,_0x6dae41,_0x4121de){var _0x548e8f={'channel':'sms'};var _0x525218=[];var _0x3d4c64=[];var _0x164718={};return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x926747[_0xfea5('0x60')]['id']},'include':[{'model':db[_0xfea5('0x70')],'as':_0xfea5('0x71')}]})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x56277e){_0x548e8f[_0xfea5('0x72')]=_0x56277e;_0x548e8f[_0xfea5('0x73')]=_[_0xfea5('0x74')](_0x56277e[_0xfea5('0x71')],[_0xfea5('0x75')],['asc']);if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x71')]){delete _0x548e8f[_0xfea5('0x72')][_0xfea5('0x71')];}return db['CmContact'][_0xfea5('0x61')]();})[_0xfea5('0x1e')](function(_0x34a7ff){if(!_0x34a7ff){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))](_0xfea5('0x78'));}_0x525218=_[_0xfea5('0x79')](_[_0xfea5('0x41')](_0x34a7ff),[_0xfea5('0x7a'),_0xfea5('0x7b')]);_0x3d4c64=_[_0xfea5('0x79')](_[_0xfea5('0x41')](_0x34a7ff),[_0xfea5('0x7a'),_0xfea5('0x7b'),'CompanyId',_0xfea5('0x7c')]);_0x548e8f['body']={'mapKey':_0xfea5('0x7d')};if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x3d')]){switch(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x3d')]){case _0xfea5('0x7e'):_0x548e8f['body']['from']=_0x926747[_0xfea5('0x57')][_0xfea5('0x7f')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x80')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747['body'][_0xfea5('0x82')];break;case _0xfea5('0x83'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]='+'+_0x926747[_0xfea5('0x57')][_0xfea5('0x85')];_0x548e8f[_0xfea5('0x57')]['body']=_0x926747[_0xfea5('0x57')][_0xfea5('0x86')];break;case _0xfea5('0x87'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')]['from'];_0x548e8f['body'][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x23')];break;case _0xfea5('0x88'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x84')];_0x548e8f['body']['body']=_0x926747['body']['body'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x89')];break;case _0xfea5('0x8a'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')]['From'];_0x548e8f['body'][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8b')];_0x548e8f['body'][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8c')];break;case _0xfea5('0x8d'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]='+'+_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0]['from'];_0x548e8f['body']['body']=_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0][_0xfea5('0x86')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0]['messageId'];break;case'csc':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8f')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x90')][_0xfea5('0x23')];break;case'clickatell':_0x548e8f['body'][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x91')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')]['text'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747['body'][_0xfea5('0x92')];break;case _0xfea5('0x93'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][0x0]['message']['id'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][0x0][_0xfea5('0x23')][_0xfea5('0x84')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][0x0][_0xfea5('0x23')][_0xfea5('0x86')];break;case _0xfea5('0x94'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x84')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')]['message'];_0x548e8f['body'][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')]['refid'];break;}}if(_0x548e8f[_0xfea5('0x57')]['id']){delete _0x548e8f[_0xfea5('0x57')]['id'];}if(_['isNil'](_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')])){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))](_0xfea5('0x95'));}if(_['isNil'](_0x548e8f[_0xfea5('0x57')]['body'])||_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]===''){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfea5('0x96')](_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')])){throw new db[(_0xfea5('0x76'))]['ValidationError'](_0xfea5('0x98')+_0x3d4c64);}if(!_[_0xfea5('0x99')](_0x3d4c64,_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')])){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d4c64);}_0x164718[_0x548e8f[_0xfea5('0x57')]['mapKey']]=_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')];return db[_0xfea5('0x9a')][_0xfea5('0x5f')]({'where':{'id':_0x548e8f[_0xfea5('0x72')][_0xfea5('0x7c')]},'include':[{'model':db[_0xfea5('0x9b')],'as':_0xfea5('0x9c'),'where':_0x164718,'limit':0x1,'order':[[_0xfea5('0x7b'),_0xfea5('0x9d')]]}]});})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x56bc8d){if(_0x56bc8d){_0x548e8f[_0xfea5('0x9e')]=_['omit'](_0x56bc8d,['Contacts']);if(_0x56bc8d['Contacts']['length']){return _0x56bc8d[_0xfea5('0x9c')][0x0];}var _0x4ca58f=_[_0xfea5('0x17')](_0x548e8f['body'],{'firstName':_0x548e8f['body'][_0xfea5('0x84')],'ListId':_0x56bc8d['id']});_0x4ca58f[_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')]]=_0x548e8f[_0xfea5('0x57')]['from'];return db[_0xfea5('0x9b')][_0xfea5('0x56')](_0x4ca58f,{'fields':_0x525218,'raw':!![]});}})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x3a12ee){if(_0x3a12ee){_0x548e8f[_0xfea5('0x9f')]=_0x3a12ee;var _0x3dc7c6={'ContactId':_0x3a12ee['id'],'phone':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id']};var _0x1e7b9c={'ContactId':_0x3a12ee['id'],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id'],'closed':![]};return db[_0xfea5('0xa0')]['find']({'where':_0x1e7b9c})[_0xfea5('0x1e')](function(_0x520b44){if(_0x520b44){return[_0x520b44,![]];}return db[_0xfea5('0xa0')][_0xfea5('0x56')](_0x3dc7c6)[_0xfea5('0x1e')](function(_0x57ecd9){return[_0x57ecd9,!![]];});});}})['spread'](function(_0x563f3c,_0x1a4367){_0x548e8f['interaction']=_0x563f3c[_0xfea5('0x34')]({'plain':!![]});_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa2')]=![];if(_0x1a4367){if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0xa3')]){_0x548e8f[_0xfea5('0x73')]['push']({'id':0x0,'priority':_0x548e8f[_0xfea5('0x73')][_0xfea5('0x46')]+0x1,'app':_0xfea5('0xa4'),'appdata':_0xfea5('0xa5'),'interval':_0xfea5('0xa6')});}_0x548e8f[_0xfea5('0xa1')]['created']=!![];}return db['SmsMessage']['create']({'phone':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')],'messageId':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')],'body':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id'],'SmsInteractionId':_0x563f3c['id'],'direction':'in','ContactId':_0x563f3c[_0xfea5('0xa7')],'AttachmentId':_0x548e8f[_0xfea5('0x57')][_0xfea5('0xa8')]});})[_0xfea5('0x1e')](function(_0x1ed338){_0x548e8f[_0xfea5('0x23')]=_0x1ed338;if(_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa9')]){return db['User'][_0xfea5('0x5f')]({'attributes':['id','name'],'where':{'id':_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa9')]}})[_0xfea5('0x1e')](function(_0x51606b){if(_0x51606b){_0x548e8f[_0xfea5('0x73')][_0xfea5('0xaa')]({'id':0x0,'priority':0x0,'app':_0xfea5('0xab'),'appdata':_0x51606b[_0xfea5('0x38')]+','+(_0x548e8f['account'][_0xfea5('0xac')]||0xa),'interval':_0xfea5('0xa6')});}return respondWithRpcPromise('Start','startRouting',_0x548e8f);});}return respondWithRpcPromise(_0xfea5('0xad'),_0xfea5('0xae'),_0x548e8f);})[_0xfea5('0x1e')](function(_0x5a6bc7){if(_0x5a6bc7){var _0x77ffff=0xc8;var _0x13e777='receiveMessage';logger[_0xfea5('0x1f')](_0xfea5('0x21'),_0x13e777,_0x77ffff,'entity\x20found');logger[_0xfea5('0x20')](_0xfea5('0xaf'),_0x13e777,_0x77ffff,_0xfea5('0xb0'),JSON[_0xfea5('0xb1')](_0x5a6bc7));if(_0x548e8f['account'][_0xfea5('0x3d')]===_0xfea5('0x7e')){return _0x6dae41['status'](_0x77ffff)[_0xfea5('0x2e')](_0xfea5('0xb2'),_0xfea5('0xb3'))[_0xfea5('0xb4')](_0xfea5('0xb5'));}else{return _0x6dae41[_0xfea5('0x28')](_0x77ffff)['json'](_0x5a6bc7);}}})['catch'](handleError(_0x6dae41,null));};exports[_0xfea5('0xb6')]=function(_0xd2ae8,_0x11399a){var _0x56e74c=_0xd2ae8['params']['id'];var _0x44a98b=_0xd2ae8[_0xfea5('0x57')];var _0xfd7922=0xc8;var _0x586142=null;return db[_0xfea5('0xb7')]['transaction']({'isolationLevel':db[_0xfea5('0xb7')][_0xfea5('0xb8')][_0xfea5('0xb9')]['READ_COMMITTED']},function(_0x4537bf){return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x56e74c},'transaction':_0x4537bf})[_0xfea5('0x1e')](function(_0x3dac5a){if(_0x3dac5a){return db[_0xfea5('0x70')][_0xfea5('0x33')]({'where':{'SmsAccountId':_0x56e74c},'transaction':_0x4537bf})[_0xfea5('0x1e')](function(){var _0x4c603f=_[_0xfea5('0x3a')](_0x44a98b,function(_0x403a15){_0x403a15[_0xfea5('0x63')]=_0x56e74c;return _0x403a15;});return db[_0xfea5('0x70')][_0xfea5('0xba')](_0x4c603f,{'transaction':_0x4537bf});});}else{_0xfd7922=0x194;_0x586142=[];}});})[_0xfea5('0x1e')](function(){if(_0xfd7922!==0x194){return db[_0xfea5('0x70')][_0xfea5('0xbb')]({'where':{'SmsAccountId':_0x56e74c},'order':_0xfea5('0x75')})[_0xfea5('0x1e')](function(_0x1bea5f){_0x586142=_0x1bea5f;});}})[_0xfea5('0x52')](function(_0x1e5eca){_0xfd7922=0x1f4;logger['error'](_0x1e5eca[_0xfea5('0x37')]);if(_0x1e5eca['name']){delete _0x1e5eca[_0xfea5('0x38')];}_0x586142=_0x1e5eca;})['finally'](function(){if(_0x586142===null){_0x11399a[_0xfea5('0x26')](_0xfd7922);}else{if(_0xfd7922===0x1f4){_0x11399a[_0xfea5('0x28')](_0xfd7922)[_0xfea5('0xb4')](_0x586142);}else{_0x11399a[_0xfea5('0x28')](_0xfd7922)[_0xfea5('0x29')](_0x586142);}}});};exports[_0xfea5('0xbc')]=function(_0x5b1e16,_0x4981a0,_0x38668c){var _0x7da3c7={};var _0xd1c19b={};var _0x2111f8;var _0x3c3e8b;return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x5b1e16[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x4981a0,null))['then'](function(_0x3c3817){if(_0x3c3817){_0x2111f8=_0x3c3817;_0xd1c19b['model']=_[_0xfea5('0x41')](db['SmsApplication']['rawAttributes']);_0xd1c19b[_0xfea5('0x40')]=_['keys'](_0x5b1e16['query']);_0xd1c19b[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0xd1c19b[_0xfea5('0x3f')],_0xd1c19b[_0xfea5('0x40')]);_0x7da3c7['attributes']=_[_0xfea5('0x43')](_0xd1c19b[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x45')]));_0x7da3c7['attributes']=_0x7da3c7[_0xfea5('0x44')]['length']?_0x7da3c7[_0xfea5('0x44')]:_0xd1c19b[_0xfea5('0x3f')];_0x7da3c7[_0xfea5('0x48')]=qs['sort'](_0x5b1e16[_0xfea5('0x40')]['sort']);_0x7da3c7[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_['pick'](_0x5b1e16[_0xfea5('0x40')],_0xd1c19b[_0xfea5('0x42')]));if(_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x7da3c7[_0xfea5('0x4c')]=_['merge'](_0x7da3c7['where'],{'$or':_[_0xfea5('0x3a')](_0x7da3c7[_0xfea5('0x44')],function(_0x248c17){var _0x33293c={};_0x33293c[_0x248c17]={'$like':'%'+_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x33293c;})});}_0x7da3c7=_[_0xfea5('0x4d')]({},_0x7da3c7,_0x5b1e16[_0xfea5('0x4e')]);return _0x2111f8[_0xfea5('0xbc')](_0x7da3c7);}})[_0xfea5('0x1e')](function(_0xe1b435){if(_0xe1b435){_0x3c3e8b=_0xe1b435[_0xfea5('0x46')];if(!_0x5b1e16[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x7da3c7[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x5b1e16['query'][_0xfea5('0x2c')]);_0x7da3c7[_0xfea5('0x2a')]=qs['offset'](_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x2a')]);}return _0x2111f8['getApplications'](_0x7da3c7);}})[_0xfea5('0x1e')](function(_0x411ce2){if(_0x411ce2){return _0x411ce2?{'count':_0x3c3e8b,'rows':_0x411ce2}:null;}})['then'](respondWithResult(_0x4981a0,null))[_0xfea5('0x52')](handleError(_0x4981a0,null));};exports[_0xfea5('0xbd')]=function(_0x2c31c1,_0x259ffb,_0x13592d){var _0x25a033={'raw':![],'where':{}};var _0x166d54={};var _0x234174={'count':0x0,'rows':[]};return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x2c31c1[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x259ffb,null))[_0xfea5('0x1e')](function(_0x22fff1){if(_0x22fff1){_0x166d54['model']=_[_0xfea5('0x41')](db[_0xfea5('0xa0')]['rawAttributes']);_0x166d54['query']=_['keys'](_0x2c31c1[_0xfea5('0x40')]);_0x166d54[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x166d54[_0xfea5('0x3f')],_0x166d54[_0xfea5('0x40')]);_0x25a033['attributes']=_[_0xfea5('0x43')](_0x166d54['model'],qs['fields'](_0x2c31c1['query'][_0xfea5('0x45')]));_0x25a033[_0xfea5('0x44')]=_0x25a033[_0xfea5('0x44')][_0xfea5('0x46')]?_0x25a033[_0xfea5('0x44')]:_0x166d54[_0xfea5('0x3f')];if(!_0x2c31c1[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x25a033[_0xfea5('0x2c')]=qs['limit'](_0x2c31c1['query'][_0xfea5('0x2c')]);_0x25a033['offset']=qs[_0xfea5('0x2a')](_0x2c31c1[_0xfea5('0x40')]['offset']);}_0x25a033['order']=qs[_0xfea5('0x49')](_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x49')]);_0x25a033[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x2c31c1[_0xfea5('0x40')],_0x166d54[_0xfea5('0x42')]));_0x25a033[_0xfea5('0x4c')][_0xfea5('0x63')]=_0x22fff1['id'];if(_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x25a033['where']=_[_0xfea5('0x4d')](_0x25a033[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x25a033[_0xfea5('0x44')],function(_0x39dbf1){var _0x4b3c54={};_0x4b3c54[_0x39dbf1]={'$like':'%'+_0x2c31c1[_0xfea5('0x40')]['filter']+'%'};return _0x4b3c54;})});}_0x25a033=_['merge']({},_0x25a033,_0x2c31c1[_0xfea5('0x4e')]);return db['SmsInteraction'][_0xfea5('0x2d')]({'where':_0x25a033[_0xfea5('0x4c')]})[_0xfea5('0x1e')](function(_0x50ba11){_0x234174['count']=_0x50ba11;if(_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x55')]){_0x25a033[_0xfea5('0x67')]=[{'model':db[_0xfea5('0x9b')],'as':_0xfea5('0xbe'),'required':![]},{'model':db[_0xfea5('0xbf')],'as':_0xfea5('0xc0'),'attributes':['name',_0xfea5('0xc1'),'internal'],'required':![]},{'model':db[_0xfea5('0xc2')],'as':_0xfea5('0xc3'),'attributes':['id','name',_0xfea5('0xc4')],'where':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]?{'id':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]}:undefined,'required':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]?!![]:![]}];}return db[_0xfea5('0xa0')]['findAll'](_0x25a033);})[_0xfea5('0x1e')](function(_0x4cb162){_0x234174['rows']=_0x4cb162;return _0x234174;});}})[_0xfea5('0x1e')](respondWithFilteredResult(_0x259ffb,_0x25a033))[_0xfea5('0x52')](handleError(_0x259ffb,null));};exports[_0xfea5('0xb4')]=function(_0x589a2d,_0x2b0c28,_0x201519){var _0x17d494,_0x51194b,_0x2502bd;if(_[_0xfea5('0x96')](_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')])||_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')]===''){throw new db[(_0xfea5('0x76'))]['ValidationError'](_0xfea5('0xc6'));}if(_[_0xfea5('0x96')](_0x589a2d['body']['to'])){throw new db['Sequelize'][(_0xfea5('0x77'))](_0xfea5('0xc7'));}_0x17d494=_0x589a2d[_0xfea5('0x57')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x589a2d[_0xfea5('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xfea5('0xc8'),'include':[{'model':db[_0xfea5('0x9b')],'as':'Contacts','where':{'mobile':_0x17d494},'limit':0x1,'order':[['updatedAt',_0xfea5('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x2b0c28,null))[_0xfea5('0x1e')](function(_0x1f68ce){if(_0x1f68ce&&_0x1f68ce[_0xfea5('0xc8')]){_0x51194b=_0x1f68ce[_0xfea5('0x34')]({'plain':!![]});if(_0x51194b[_0xfea5('0xc8')]&&_0x51194b[_0xfea5('0xc8')][_0xfea5('0x9c')]['length']){return _0x51194b[_0xfea5('0xc8')]['Contacts'][0x0];}return db[_0xfea5('0x9b')][_0xfea5('0x56')](_[_0xfea5('0x17')](_0x589a2d[_0xfea5('0x57')],{'firstName':_0x17d494,'mobile':_0x17d494,'phone':_0x17d494,'ListId':_0x51194b[_0xfea5('0x7c')]}));}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2b0c28,null))[_0xfea5('0x1e')](function(_0x1adaeb){if(_0x1adaeb){_0x2502bd=_0x1adaeb;return db[_0xfea5('0xa0')][_0xfea5('0x5f')]({'where':{'ContactId':_0x2502bd['id'],'closed':![],'SmsAccountId':_0x51194b['id']}})['then'](function(_0x464a70){if(_0x464a70){return[_0x464a70,![]];}return db[_0xfea5('0xa0')][_0xfea5('0x56')]({'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id'],'SmsAccountId':_0x51194b['id'],'phone':_0x17d494,'firstMsgDirection':'out','Messages':[_[_0xfea5('0x4d')](_0x589a2d[_0xfea5('0x57')],{'read':![],'body':_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')],'phone':_0x17d494,'SmsAccountId':_0x51194b['id'],'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xfea5('0xc9')}]})[_0xfea5('0x1e')](function(_0x131e31){return[_0x131e31,!![]];});});}})[_0xfea5('0xca')](function(_0x22613c,_0x4c6efb){if(_0x4c6efb){return _0x22613c;}return db['SmsMessage']['create'](_[_0xfea5('0x4d')](_0x589a2d[_0xfea5('0x57')],{'read':![],'body':_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')],'phone':_0x17d494,'SmsAccountId':_0x51194b['id'],'SmsInteractionId':_0x22613c['id'],'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id']}))['then'](function(_0x1ec0b2){_0x22613c['dataValues'][_0xfea5('0xc9')]=[];_0x22613c[_0xfea5('0xcb')][_0xfea5('0xc9')]['push'](_0x1ec0b2[_0xfea5('0xcb')]);return _0x22613c;});})[_0xfea5('0x1e')](respondWithResult(_0x2b0c28,null))[_0xfea5('0x52')](handleError(_0x2b0c28,null));};exports[_0xfea5('0x28')]=function(_0x1bfe9d,_0x5e5e4c,_0x833db5){if(_0x1bfe9d['body']['id']){delete _0x1bfe9d[_0xfea5('0x57')]['id'];}var _0x40637f,_0x529ab1,_0x4cafc1;return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x1bfe9d[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x5e5e4c,null))[_0xfea5('0x1e')](function(_0x4bf91a){if(_0x4bf91a){_0x4cafc1=_0x4bf91a;logger['debug'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xcc'),_0x4bf91a[_0xfea5('0x3d')],util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));switch(_0x4bf91a[_0xfea5('0x3d')]){case _0xfea5('0x83'):if(_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xce')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xce')]}});}break;case _0xfea5('0x87'):if(_0x1bfe9d['body']['requestid']&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd0')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd0')];return db['SmsMessage'][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd1')]}});}break;case'clicksend':if(_0x1bfe9d['body']['message_id']&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd2')]){_0x529ab1=_0x1bfe9d['body'][_0xfea5('0xd2')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x89')]}});}break;case _0xfea5('0x8d'):var _0x2babfd=_0x1bfe9d[_0xfea5('0x57')]['results'][0x0];if(_0x2babfd[_0xfea5('0x81')]&&_0x2babfd[_0xfea5('0x28')]['groupName']===_0xfea5('0xd3')){_0x529ab1=_0x2babfd['status'][_0xfea5('0xd4')];return db['SmsMessage']['find']({'where':{'messageId':_0x2babfd[_0xfea5('0x81')]}});}break;case _0xfea5('0xd5'):if(_0x1bfe9d['body'][_0xfea5('0x81')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d['body'][_0xfea5('0x28')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d['body'][_0xfea5('0x81')]}});}break;case'bandwidth':if(_0x1bfe9d[_0xfea5('0x57')][0x0][_0xfea5('0x23')]['id']){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][0x0]['type'];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][0x0][_0xfea5('0x23')]['id']}});}break;case _0xfea5('0x94'):if(_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd6')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')]['status'];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd6')]}});}break;}}})[_0xfea5('0x1e')](handleEntityNotFound(_0x5e5e4c,null))[_0xfea5('0x1e')](function(_0x19b73e){if(_0x19b73e){_0x40637f=_0x19b73e;switch(_0x4cafc1['type']){case _0xfea5('0x83'):if(_0x529ab1===_0xfea5('0xd3')){return _0x40637f['update']({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),'status',_0xfea5('0x83'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x87'):if(_0x529ab1==='1'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x28'),_0xfea5('0x83'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x88'):if(!_0x1bfe9d[_0xfea5('0x57')]['error_code']&&_0x529ab1>=0xc8&&_0x529ab1<=0xce){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfea5('0x88'),util[_0xfea5('0xcd')](_0x1bfe9d['body'],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x8d'):var _0x210065=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x8e')][0x0];if(_0x210065[_0xfea5('0x28')][_0xfea5('0xd4')]==='DELIVERED'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x28'),_0xfea5('0x8d'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0xd5'):if(_0x529ab1==_0xfea5('0xd7')||_0x529ab1=='RECEIVED_BY_RECIPIENT'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xd5'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x93'):if(_0x529ab1==_0xfea5('0xd8')){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0x93'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x94'):if(_0x529ab1===_0xfea5('0xd9')||_0x529ab1==='ACCEPTD'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger['error'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0x94'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x40637f;}})['then'](respondWithResult(_0x5e5e4c,null))[_0xfea5('0x52')](handleError(_0x5e5e4c,null));};exports[_0xfea5('0xda')]=function(_0x38f96d,_0x33ed19,_0x97a26f){var _0x223be8,_0x571d04,_0x17d67c;return db[_0xfea5('0x4f')]['find']({'where':{'id':_0x38f96d[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x33ed19,null))[_0xfea5('0x1e')](function(_0x16abc2){if(_0x16abc2){_0x17d67c=_0x16abc2;logger[_0xfea5('0x20')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xcc'),_0x16abc2[_0xfea5('0x3d')],util[_0xfea5('0xcd')](_0x38f96d[_0xfea5('0x40')],{'showHidden':![],'depth':null}));switch(_0x16abc2[_0xfea5('0x3d')]){case _0xfea5('0xdb'):if(_0x38f96d['query'][_0xfea5('0xdc')]&&_0x38f96d[_0xfea5('0x40')][_0xfea5('0xdd')]){_0x571d04=_0x38f96d[_0xfea5('0x40')][_0xfea5('0xdd')];return db[_0xfea5('0xcf')]['find']({'where':{'messageId':_0x38f96d[_0xfea5('0x40')]['message-id']}});}break;}}})[_0xfea5('0x1e')](handleEntityNotFound(_0x33ed19,null))[_0xfea5('0x1e')](function(_0x35c026){if(_0x35c026){_0x223be8=_0x35c026;switch(_0x17d67c[_0xfea5('0x3d')]){case _0xfea5('0xdb'):if(_0x571d04==='2'||_0x571d04==='6'){return _0x223be8[_0xfea5('0x32')]({'read':!![]});}else{logger['error'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xdb'),util[_0xfea5('0xcd')](_0x38f96d[_0xfea5('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x223be8;}})[_0xfea5('0x1e')](respondWithResult(_0x33ed19,null))[_0xfea5('0x52')](handleError(_0x33ed19,null));};exports['addAgents']=function(_0x124d82,_0x4b023f,_0x12e279){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x124d82[_0xfea5('0x60')]['id']}})['then'](handleEntityNotFound(_0x4b023f,null))['then'](function(_0x1d9d3f){if(_0x1d9d3f){return _0x1d9d3f['addAgents'](_0x124d82['body']['ids'],_[_0xfea5('0xde')](_0x124d82[_0xfea5('0x57')],[_0xfea5('0x69'),'id'])||{})[_0xfea5('0xca')](function(_0x4bc52b){for(var _0x43194a=0x0;_0x43194a<_0x124d82[_0xfea5('0x57')]['ids'][_0xfea5('0x46')];_0x43194a+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x124d82[_0xfea5('0x57')]['ids'][_0x43194a]),'SmsAccountId':Number(_0x124d82[_0xfea5('0x60')]['id'])});}return _0x4bc52b;});}})[_0xfea5('0x1e')](respondWithResult(_0x4b023f,null))['catch'](handleError(_0x4b023f,null));};exports['removeAgents']=function(_0x1225eb,_0x477b56,_0x24966c){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x1225eb[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x477b56,null))['then'](function(_0x2fd0a6){if(_0x2fd0a6){return _0x2fd0a6[_0xfea5('0xdf')](_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')])[_0xfea5('0x1e')](function(){if(_['isArray'](_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')])){for(var _0x19ae23=0x0;_0x19ae23<_0x1225eb[_0xfea5('0x40')]['ids']['length'];_0x19ae23+=0x1){socket[_0xfea5('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')][_0x19ae23]),'SmsAccountId':Number(_0x1225eb[_0xfea5('0x60')]['id'])});}}else{socket['emit'](_0xfea5('0xe1'),{'UserId':Number(_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')]),'SmsAccountId':Number(_0x1225eb[_0xfea5('0x60')]['id'])});}});}})[_0xfea5('0x1e')](respondWithStatusCode(_0x477b56,null))['catch'](handleError(_0x477b56,null));};exports[_0xfea5('0xe2')]=function(_0x960053,_0x2b7183,_0xdf53dd){var _0x53021a={};var _0x417236={};var _0x2782cb;var _0x2e7cc2;return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x960053[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2b7183,null))[_0xfea5('0x1e')](function(_0xe8ded1){if(_0xe8ded1){_0x2782cb=_0xe8ded1;_0x417236['model']=_[_0xfea5('0x41')](db[_0xfea5('0xbf')][_0xfea5('0x3b')]);_0x417236[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x960053[_0xfea5('0x40')]);_0x417236['filters']=_[_0xfea5('0x43')](_0x417236[_0xfea5('0x3f')],_0x417236[_0xfea5('0x40')]);_0x53021a['attributes']=_[_0xfea5('0x43')](_0x417236[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x960053[_0xfea5('0x40')][_0xfea5('0x45')]));_0x53021a[_0xfea5('0x44')]=_0x53021a[_0xfea5('0x44')]['length']?_0x53021a[_0xfea5('0x44')]:_0x417236[_0xfea5('0x3f')];_0x53021a[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x960053[_0xfea5('0x40')][_0xfea5('0x49')]);_0x53021a[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x960053[_0xfea5('0x40')],_0x417236[_0xfea5('0x42')]));if(_0x960053[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x53021a[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x53021a[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x53021a[_0xfea5('0x44')],function(_0x261dfe){var _0x157f59={};_0x157f59[_0x261dfe]={'$like':'%'+_0x960053[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x157f59;})});}_0x53021a=_['merge']({},_0x53021a,_0x960053['options']);return _0x2782cb['getAgents'](_0x53021a);}})['then'](function(_0x23440b){if(_0x23440b){_0x2e7cc2=_0x23440b['length'];if(!_0x960053[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x53021a[_0xfea5('0x2c')]=qs['limit'](_0x960053[_0xfea5('0x40')][_0xfea5('0x2c')]);_0x53021a['offset']=qs[_0xfea5('0x2a')](_0x960053['query'][_0xfea5('0x2a')]);}return _0x2782cb[_0xfea5('0xe2')](_0x53021a);}})[_0xfea5('0x1e')](function(_0x437908){if(_0x437908){return _0x437908?{'count':_0x2e7cc2,'rows':_0x437908}:null;}})['then'](respondWithResult(_0x2b7183,null))[_0xfea5('0x52')](handleError(_0x2b7183,null));}; \ No newline at end of file +var _0x5e46=['DESC','defaults','out','user','Messages','spread','dataValues','push','inspect','skebby','skebby_dispatch_id','requestid','statusInt','groupName','clickatell','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../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','./smsAccount.socket','register','jayson/promise','http','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','SmsAccountId','Disposition','getDispositions','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','twilio','from','From','MessageSid','connectel','clicksend','messageId','message_id','Text','MessageUUID','infobip','results','text','csc','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','CmContact','Contacts','omit','contact','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','*,*,*,*','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','List'];(function(_0x55d245,_0xd72a83){var _0x2644e1=function(_0x463876){while(--_0x463876){_0x55d245['push'](_0x55d245['shift']());}};_0x2644e1(++_0xd72a83);}(_0x5e46,0x100));var _0x65e4=function(_0x26e58d,_0x7b9393){_0x26e58d=_0x26e58d-0x0;var _0x3b8a6e=_0x5e46[_0x26e58d];return _0x3b8a6e;};'use strict';var emlformat=require(_0x65e4('0x0'));var rimraf=require(_0x65e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65e4('0x2'));var moment=require(_0x65e4('0x3'));var BPromise=require(_0x65e4('0x4'));var Mustache=require('mustache');var util=require(_0x65e4('0x5'));var path=require('path');var sox=require(_0x65e4('0x6'));var csv=require(_0x65e4('0x7'));var ejs=require(_0x65e4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65e4('0x9'));var squel=require(_0x65e4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x65e4('0x7'));var querystring=require(_0x65e4('0xb'));var Papa=require(_0x65e4('0xc'));var Redis=require(_0x65e4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x65e4('0xe'));var as=require(_0x65e4('0xf'));var hardwareService=require(_0x65e4('0x10'));var logger=require(_0x65e4('0x11'))(_0x65e4('0x12'));var utils=require(_0x65e4('0x13'));var config=require(_0x65e4('0x14'));var licenseUtil=require(_0x65e4('0x15'));var db=require(_0x65e4('0x16'))['db'];config[_0x65e4('0x17')]=_['defaults'](config[_0x65e4('0x17')],{'host':_0x65e4('0x18'),'port':0x18eb});var socket=require(_0x65e4('0x19'))(new Redis(config['redis']));require(_0x65e4('0x1a'))[_0x65e4('0x1b')](socket);var jayson=require(_0x65e4('0x1c'));var client=jayson['client'][_0x65e4('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1cb9ca,_0x1423f9,_0x467dba,_0x496553){return new BPromise(function(_0x5dc106,_0x41aeeb){var _0x2b91f8=_0x496553||client;return _0x2b91f8[_0x65e4('0x1e')](_0x1cb9ca,_0x467dba)['then'](function(_0x4e7177){logger[_0x65e4('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1423f9,_0x65e4('0x20'));logger[_0x65e4('0x21')](_0x65e4('0x22'),_0x1423f9,_0x65e4('0x20'),JSON[_0x65e4('0x23')](_0x4e7177));if(_0x4e7177[_0x65e4('0x24')]){if(_0x4e7177[_0x65e4('0x24')][_0x65e4('0x25')]===0x1f4){logger[_0x65e4('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1423f9,_0x4e7177[_0x65e4('0x24')][_0x65e4('0x26')]);return _0x41aeeb(_0x4e7177[_0x65e4('0x24')][_0x65e4('0x26')]);}logger['error'](_0x65e4('0x27'),_0x1423f9,_0x4e7177[_0x65e4('0x24')][_0x65e4('0x26')]);return _0x5dc106(_0x4e7177['error']['message']);}else{logger[_0x65e4('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1423f9,_0x65e4('0x20'));_0x5dc106(_0x4e7177[_0x65e4('0x28')][_0x65e4('0x26')]);}})[_0x65e4('0x29')](function(_0xc5f35b){logger[_0x65e4('0x24')](_0x65e4('0x27'),_0x1423f9,_0xc5f35b);_0x41aeeb(_0xc5f35b);});});}function respondWithStatusCode(_0x484c48,_0x5af072){_0x5af072=_0x5af072||0xcc;return function(_0x142360){if(_0x142360){return _0x484c48[_0x65e4('0x2a')](_0x5af072);}return _0x484c48[_0x65e4('0x2b')](_0x5af072)[_0x65e4('0x2c')]();};}function respondWithResult(_0x475848,_0x4559a2){_0x4559a2=_0x4559a2||0xc8;return function(_0x25cd0c){if(_0x25cd0c){return _0x475848[_0x65e4('0x2b')](_0x4559a2)['json'](_0x25cd0c);}};}function respondWithFilteredResult(_0x4b2845,_0x4b7849){return function(_0x4fc09d){if(_0x4fc09d){var _0x22a80b=typeof _0x4b7849[_0x65e4('0x2d')]===_0x65e4('0x2e')&&typeof _0x4b7849['limit']===_0x65e4('0x2e');var _0x504813=_0x4fc09d[_0x65e4('0x2f')];var _0x1f1a56=_0x22a80b?0x0:_0x4b7849[_0x65e4('0x2d')];var _0x1be1ac=_0x22a80b?_0x4fc09d[_0x65e4('0x2f')]:_0x4b7849[_0x65e4('0x2d')]+_0x4b7849[_0x65e4('0x30')];var _0x3f66e5;if(_0x1be1ac>=_0x504813){_0x1be1ac=_0x504813;_0x3f66e5=0xc8;}else{_0x3f66e5=0xce;}_0x4b2845[_0x65e4('0x2b')](_0x3f66e5);return _0x4b2845[_0x65e4('0x31')](_0x65e4('0x32'),_0x1f1a56+'-'+_0x1be1ac+'/'+_0x504813)[_0x65e4('0x33')](_0x4fc09d);}return null;};}function patchUpdates(_0x1290b6){return function(_0x144f3b){try{jsonpatch[_0x65e4('0x34')](_0x144f3b,_0x1290b6,!![]);}catch(_0x5797cd){return BPromise[_0x65e4('0x35')](_0x5797cd);}return _0x144f3b[_0x65e4('0x36')]();};}function saveUpdates(_0xa277f2,_0x3eb867){return function(_0x4b50f4){if(_0x4b50f4){return _0x4b50f4['update'](_0xa277f2)[_0x65e4('0x37')](function(_0x4b5233){return _0x4b5233;});}return null;};}function removeEntity(_0x11ae4c,_0xb97738){return function(_0x2c8b41){if(_0x2c8b41){return _0x2c8b41[_0x65e4('0x38')]()[_0x65e4('0x37')](function(){var _0x19194e=_0x2c8b41[_0x65e4('0x39')]({'plain':!![]});var _0xa2fd46=_0x65e4('0x3a');return db[_0x65e4('0x3b')][_0x65e4('0x38')]({'where':{'type':_0xa2fd46,'resourceId':_0x19194e['id']}})[_0x65e4('0x37')](function(){return _0x2c8b41;});})[_0x65e4('0x37')](function(){_0x11ae4c[_0x65e4('0x2b')](0xcc)[_0x65e4('0x2c')]();});}};}function handleEntityNotFound(_0x406699,_0x189572){return function(_0x3d0a3d){if(!_0x3d0a3d){_0x406699['sendStatus'](0x194);}return _0x3d0a3d;};}function handleError(_0x2fca3b,_0x629e39){_0x629e39=_0x629e39||0x1f4;return function(_0xf8ec7f){logger[_0x65e4('0x24')](_0xf8ec7f[_0x65e4('0x3c')]);if(_0xf8ec7f[_0x65e4('0x3d')]){delete _0xf8ec7f['name'];}_0x2fca3b['status'](_0x629e39)[_0x65e4('0x3e')](_0xf8ec7f);};}exports[_0x65e4('0x3f')]=function(_0x23c405,_0x370175){var _0x2c8711={'include':[{'model':db[_0x65e4('0x40')],'as':_0x65e4('0x41')}]},_0x145cc8={},_0x44b910={'count':0x0,'rows':[]};var _0x169b68=_[_0x65e4('0x42')](db[_0x65e4('0x43')][_0x65e4('0x44')],function(_0x42fab5){return{'name':_0x42fab5[_0x65e4('0x45')],'type':_0x42fab5[_0x65e4('0x46')][_0x65e4('0x47')]};});_0x145cc8[_0x65e4('0x48')]=_[_0x65e4('0x42')](_0x169b68,'name');_0x145cc8[_0x65e4('0x49')]=_['keys'](_0x23c405[_0x65e4('0x49')]);_0x145cc8[_0x65e4('0x4a')]=_[_0x65e4('0x4b')](_0x145cc8['model'],_0x145cc8[_0x65e4('0x49')]);_0x2c8711['attributes']=_[_0x65e4('0x4b')](_0x145cc8[_0x65e4('0x48')],qs[_0x65e4('0x4c')](_0x23c405[_0x65e4('0x49')][_0x65e4('0x4c')]));_0x2c8711['attributes']=_0x2c8711[_0x65e4('0x4d')][_0x65e4('0x4e')]?_0x2c8711['attributes']:_0x145cc8[_0x65e4('0x48')];if(!_0x23c405[_0x65e4('0x49')]['hasOwnProperty'](_0x65e4('0x4f'))){_0x2c8711[_0x65e4('0x30')]=qs[_0x65e4('0x30')](_0x23c405[_0x65e4('0x49')][_0x65e4('0x30')]);_0x2c8711[_0x65e4('0x2d')]=qs['offset'](_0x23c405[_0x65e4('0x49')][_0x65e4('0x2d')]);}_0x2c8711['order']=qs[_0x65e4('0x50')](_0x23c405[_0x65e4('0x49')][_0x65e4('0x50')]);_0x2c8711[_0x65e4('0x51')]=qs['filters'](_[_0x65e4('0x52')](_0x23c405[_0x65e4('0x49')],_0x145cc8[_0x65e4('0x4a')]),_0x169b68);if(_0x23c405[_0x65e4('0x49')]['filter']){_0x2c8711[_0x65e4('0x51')]=_[_0x65e4('0x53')](_0x2c8711[_0x65e4('0x51')],{'$or':_[_0x65e4('0x42')](_0x169b68,function(_0xc1cd72){if(_0xc1cd72[_0x65e4('0x46')]!==_0x65e4('0x54')){var _0x52352f={};_0x52352f[_0xc1cd72[_0x65e4('0x3d')]]={'$like':'%'+_0x23c405[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0x52352f;}})});}_0x2c8711=_[_0x65e4('0x53')]({},_0x2c8711,_0x23c405[_0x65e4('0x56')]);var _0x4858f7={'where':_0x2c8711[_0x65e4('0x51')]};return db[_0x65e4('0x43')][_0x65e4('0x2f')](_0x4858f7)['then'](function(_0xca4e88){_0x44b910[_0x65e4('0x2f')]=_0xca4e88;if(_0x23c405[_0x65e4('0x49')][_0x65e4('0x57')]){_0x2c8711[_0x65e4('0x58')]=[{'all':!![]}];}return db[_0x65e4('0x43')]['findAll'](_0x2c8711);})[_0x65e4('0x37')](function(_0x40f6de){_0x44b910[_0x65e4('0x59')]=_0x40f6de;return _0x44b910;})['then'](respondWithFilteredResult(_0x370175,_0x2c8711))[_0x65e4('0x29')](handleError(_0x370175,null));};exports['show']=function(_0x3925bd,_0x450842){var _0x7875cd={'raw':![],'where':{'id':_0x3925bd[_0x65e4('0x5a')]['id']},'include':[{'model':db[_0x65e4('0x40')],'as':'mandatoryDispositionPause'}]},_0x164c4f={};_0x164c4f[_0x65e4('0x48')]=_['keys'](db[_0x65e4('0x43')][_0x65e4('0x44')]);_0x164c4f[_0x65e4('0x49')]=_[_0x65e4('0x5b')](_0x3925bd['query']);_0x164c4f[_0x65e4('0x4a')]=_['intersection'](_0x164c4f[_0x65e4('0x48')],_0x164c4f[_0x65e4('0x49')]);_0x7875cd[_0x65e4('0x4d')]=_['intersection'](_0x164c4f[_0x65e4('0x48')],qs[_0x65e4('0x4c')](_0x3925bd[_0x65e4('0x49')][_0x65e4('0x4c')]));_0x7875cd[_0x65e4('0x4d')]=_0x7875cd[_0x65e4('0x4d')][_0x65e4('0x4e')]?_0x7875cd[_0x65e4('0x4d')]:_0x164c4f[_0x65e4('0x48')];if(_0x3925bd[_0x65e4('0x49')][_0x65e4('0x57')]){_0x7875cd[_0x65e4('0x58')]=[{'all':!![]}];}_0x7875cd=_[_0x65e4('0x53')]({},_0x7875cd,_0x3925bd[_0x65e4('0x56')]);return db[_0x65e4('0x43')]['find'](_0x7875cd)[_0x65e4('0x37')](handleEntityNotFound(_0x450842,null))[_0x65e4('0x37')](respondWithResult(_0x450842,null))['catch'](handleError(_0x450842,null));};exports[_0x65e4('0x5c')]=function(_0x1e2dbb,_0x30b068){return db[_0x65e4('0x43')][_0x65e4('0x5c')](_0x1e2dbb[_0x65e4('0x5d')],{})[_0x65e4('0x37')](function(_0x2f3abc){var _0x26f95e=_0x1e2dbb['user'][_0x65e4('0x39')]({'plain':!![]});if(!_0x26f95e)throw new Error(_0x65e4('0x5e'));if(_0x26f95e['role']==='user'){var _0x2c3e37=_0x2f3abc[_0x65e4('0x39')]({'plain':!![]});var _0x50d6f4='SmsAccounts';return db[_0x65e4('0x5f')]['find']({'where':{'name':_0x50d6f4,'userProfileId':_0x26f95e['userProfileId']},'raw':!![]})[_0x65e4('0x37')](function(_0x10ba0c){if(_0x10ba0c&&_0x10ba0c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2c3e37['name'],'resourceId':_0x2c3e37['id'],'type':_0x10ba0c[_0x65e4('0x3d')],'sectionId':_0x10ba0c['id']},{})[_0x65e4('0x37')](function(){return _0x2f3abc;});}else{return _0x2f3abc;}})[_0x65e4('0x29')](function(_0x14e8b9){logger[_0x65e4('0x24')](_0x65e4('0x60'),_0x14e8b9);throw _0x14e8b9;});}return _0x2f3abc;})[_0x65e4('0x37')](respondWithResult(_0x30b068,0xc9))['catch'](handleError(_0x30b068,null));};exports[_0x65e4('0x61')]=function(_0x427955,_0xb70d1f){if(_0x427955[_0x65e4('0x5d')]['id']){delete _0x427955[_0x65e4('0x5d')]['id'];}return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x427955['params']['id']},'include':[{'model':db[_0x65e4('0x40')],'as':_0x65e4('0x41')}]})[_0x65e4('0x37')](handleEntityNotFound(_0xb70d1f,null))[_0x65e4('0x37')](saveUpdates(_0x427955[_0x65e4('0x5d')],null))[_0x65e4('0x37')](respondWithResult(_0xb70d1f,null))['catch'](handleError(_0xb70d1f,null));};exports[_0x65e4('0x38')]=function(_0x31f94f,_0x2677b8){return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x31f94f[_0x65e4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2677b8,null))[_0x65e4('0x37')](removeEntity(_0x2677b8,null))[_0x65e4('0x29')](handleError(_0x2677b8,null));};exports[_0x65e4('0x63')]=function(_0x57162e,_0x17d36d){return db[_0x65e4('0x43')]['describe']()['then'](respondWithResult(_0x17d36d,null))[_0x65e4('0x29')](handleError(_0x17d36d,null));};exports['addDisposition']=function(_0x310213,_0x2ffd68,_0x1494af){if(_0x310213[_0x65e4('0x5d')]['id']){delete _0x310213['body']['id'];}return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x310213['params']['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x2ffd68,null))[_0x65e4('0x37')](function(_0x7df3b1){if(_0x7df3b1){_0x310213[_0x65e4('0x5d')][_0x65e4('0x64')]=_0x7df3b1['id'];return db[_0x65e4('0x65')][_0x65e4('0x5c')](_0x310213[_0x65e4('0x5d')]);}})[_0x65e4('0x37')](respondWithResult(_0x2ffd68,null))[_0x65e4('0x29')](handleError(_0x2ffd68,null));};exports[_0x65e4('0x66')]=function(_0x45ecb9,_0x248fb4,_0x1da632){var _0x33fc0c={'raw':![],'where':{}};var _0x340232={};var _0x6d7c1f={'count':0x0,'rows':[]};return db[_0x65e4('0x43')][_0x65e4('0x67')]({'where':{'id':_0x45ecb9[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x248fb4,null))[_0x65e4('0x37')](function(_0x287f41){if(_0x287f41){_0x340232[_0x65e4('0x48')]=_['keys'](db[_0x65e4('0x65')][_0x65e4('0x44')]);_0x340232[_0x65e4('0x49')]=_[_0x65e4('0x5b')](_0x45ecb9[_0x65e4('0x49')]);_0x340232['filters']=_['intersection'](_0x340232['model'],_0x340232[_0x65e4('0x49')]);_0x33fc0c['attributes']=_[_0x65e4('0x4b')](_0x340232[_0x65e4('0x48')],qs[_0x65e4('0x4c')](_0x45ecb9['query']['fields']));_0x33fc0c['attributes']=_0x33fc0c[_0x65e4('0x4d')][_0x65e4('0x4e')]?_0x33fc0c['attributes']:_0x340232[_0x65e4('0x48')];if(!_0x45ecb9[_0x65e4('0x49')]['hasOwnProperty'](_0x65e4('0x4f'))){_0x33fc0c[_0x65e4('0x30')]=qs[_0x65e4('0x30')](_0x45ecb9[_0x65e4('0x49')][_0x65e4('0x30')]);_0x33fc0c[_0x65e4('0x2d')]=qs[_0x65e4('0x2d')](_0x45ecb9[_0x65e4('0x49')][_0x65e4('0x2d')]);}_0x33fc0c[_0x65e4('0x68')]=qs['sort'](_0x45ecb9['query'][_0x65e4('0x50')]);_0x33fc0c[_0x65e4('0x51')]=qs[_0x65e4('0x4a')](_[_0x65e4('0x52')](_0x45ecb9[_0x65e4('0x49')],_0x340232[_0x65e4('0x4a')]));_0x33fc0c[_0x65e4('0x51')][_0x65e4('0x64')]=_0x287f41['id'];if(_0x45ecb9[_0x65e4('0x49')]['filter']){_0x33fc0c[_0x65e4('0x51')]=_[_0x65e4('0x53')](_0x33fc0c[_0x65e4('0x51')],{'$or':_[_0x65e4('0x42')](_0x33fc0c['attributes'],function(_0x52e81b){var _0x85ad75={};_0x85ad75[_0x52e81b]={'$like':'%'+_0x45ecb9[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0x85ad75;})});}_0x33fc0c=_[_0x65e4('0x53')]({},_0x33fc0c,_0x45ecb9[_0x65e4('0x56')]);return db['Disposition'][_0x65e4('0x2f')]({'where':_0x33fc0c[_0x65e4('0x51')]})[_0x65e4('0x37')](function(_0x2be17c){_0x6d7c1f[_0x65e4('0x2f')]=_0x2be17c;if(_0x45ecb9[_0x65e4('0x49')][_0x65e4('0x57')]){_0x33fc0c['include']=[{'all':!![]}];}return db[_0x65e4('0x65')][_0x65e4('0x69')](_0x33fc0c);})['then'](function(_0x4b9e61){_0x6d7c1f[_0x65e4('0x59')]=_0x4b9e61;return _0x6d7c1f;});}})[_0x65e4('0x37')](respondWithFilteredResult(_0x248fb4,_0x33fc0c))['catch'](handleError(_0x248fb4,null));};exports['removeDispositions']=function(_0x495af6,_0x190acd,_0x548c17){return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x495af6[_0x65e4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x190acd,null))['then'](function(_0x251f0b){if(_0x251f0b){return _0x251f0b[_0x65e4('0x6a')](_0x495af6['query'][_0x65e4('0x6b')]);}})[_0x65e4('0x37')](respondWithStatusCode(_0x190acd,null))[_0x65e4('0x29')](handleError(_0x190acd,null));};exports[_0x65e4('0x6c')]=function(_0x186c6e,_0x2fa486,_0x47f463){if(_0x186c6e[_0x65e4('0x5d')]['id']){delete _0x186c6e['body']['id'];}return db[_0x65e4('0x43')]['find']({'where':{'id':_0x186c6e['params']['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x2fa486,null))[_0x65e4('0x37')](function(_0x2503ef){if(_0x2503ef){_0x186c6e[_0x65e4('0x5d')][_0x65e4('0x64')]=_0x2503ef['id'];return db[_0x65e4('0x6d')][_0x65e4('0x5c')](_0x186c6e['body']);}})[_0x65e4('0x37')](respondWithResult(_0x2fa486,null))['catch'](handleError(_0x2fa486,null));};exports[_0x65e4('0x6e')]=function(_0x1b97ff,_0x32532e,_0x3371ac){var _0x31ca36={'raw':![],'where':{}};var _0x2f102d={};var _0x5764de={'count':0x0,'rows':[]};return db['SmsAccount'][_0x65e4('0x67')]({'where':{'id':_0x1b97ff[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x32532e,null))[_0x65e4('0x37')](function(_0x1c06c0){if(_0x1c06c0){_0x2f102d[_0x65e4('0x48')]=_[_0x65e4('0x5b')](db['CannedAnswer'][_0x65e4('0x44')]);_0x2f102d[_0x65e4('0x49')]=_['keys'](_0x1b97ff['query']);_0x2f102d[_0x65e4('0x4a')]=_[_0x65e4('0x4b')](_0x2f102d['model'],_0x2f102d[_0x65e4('0x49')]);_0x31ca36[_0x65e4('0x4d')]=_[_0x65e4('0x4b')](_0x2f102d['model'],qs[_0x65e4('0x4c')](_0x1b97ff['query'][_0x65e4('0x4c')]));_0x31ca36['attributes']=_0x31ca36['attributes'][_0x65e4('0x4e')]?_0x31ca36[_0x65e4('0x4d')]:_0x2f102d[_0x65e4('0x48')];if(!_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x6f')](_0x65e4('0x4f'))){_0x31ca36[_0x65e4('0x30')]=qs['limit'](_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x30')]);_0x31ca36[_0x65e4('0x2d')]=qs[_0x65e4('0x2d')](_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x2d')]);}_0x31ca36[_0x65e4('0x68')]=qs[_0x65e4('0x50')](_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x50')]);_0x31ca36[_0x65e4('0x51')]=qs[_0x65e4('0x4a')](_[_0x65e4('0x52')](_0x1b97ff[_0x65e4('0x49')],_0x2f102d[_0x65e4('0x4a')]));_0x31ca36[_0x65e4('0x51')][_0x65e4('0x64')]=_0x1c06c0['id'];if(_0x1b97ff['query'][_0x65e4('0x55')]){_0x31ca36[_0x65e4('0x51')]=_[_0x65e4('0x53')](_0x31ca36[_0x65e4('0x51')],{'$or':_[_0x65e4('0x42')](_0x31ca36[_0x65e4('0x4d')],function(_0x23d790){var _0x60bfe4={};_0x60bfe4[_0x23d790]={'$like':'%'+_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0x60bfe4;})});}_0x31ca36=_[_0x65e4('0x53')]({},_0x31ca36,_0x1b97ff[_0x65e4('0x56')]);return db[_0x65e4('0x6d')][_0x65e4('0x2f')]({'where':_0x31ca36['where']})[_0x65e4('0x37')](function(_0x2e5120){_0x5764de[_0x65e4('0x2f')]=_0x2e5120;if(_0x1b97ff[_0x65e4('0x49')][_0x65e4('0x57')]){_0x31ca36[_0x65e4('0x58')]=[{'all':!![]}];}return db[_0x65e4('0x6d')]['findAll'](_0x31ca36);})[_0x65e4('0x37')](function(_0x3d5e7f){_0x5764de['rows']=_0x3d5e7f;return _0x5764de;});}})[_0x65e4('0x37')](respondWithFilteredResult(_0x32532e,_0x31ca36))['catch'](handleError(_0x32532e,null));};exports[_0x65e4('0x70')]=function(_0xa94394,_0x33aad2,_0x54c1fe){return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0xa94394[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x33aad2,null))[_0x65e4('0x37')](function(_0x515091){if(_0x515091){return _0x515091[_0x65e4('0x70')](_0xa94394[_0x65e4('0x49')][_0x65e4('0x6b')]);}})[_0x65e4('0x37')](respondWithStatusCode(_0x33aad2,null))[_0x65e4('0x29')](handleError(_0x33aad2,null));};exports[_0x65e4('0x71')]=function(_0x2f048a,_0x5c09d4,_0x1b7dbf){var _0x1898ec={'channel':_0x65e4('0x72')};var _0x53b2b4=[];var _0x934ba0=[];var _0x1e6059={};return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x2f048a['params']['id']},'include':[{'model':db[_0x65e4('0x73')],'as':_0x65e4('0x74')}]})['then'](handleEntityNotFound(_0x5c09d4,null))[_0x65e4('0x37')](function(_0x52a442){_0x1898ec[_0x65e4('0x75')]=_0x52a442;_0x1898ec['applications']=_[_0x65e4('0x76')](_0x52a442[_0x65e4('0x74')],[_0x65e4('0x77')],[_0x65e4('0x78')]);if(_0x1898ec['account'][_0x65e4('0x74')]){delete _0x1898ec[_0x65e4('0x75')]['Applications'];}return db['CmContact'][_0x65e4('0x63')]();})[_0x65e4('0x37')](function(_0x11ba43){if(!_0x11ba43){throw new db[(_0x65e4('0x79'))][(_0x65e4('0x7a'))](_0x65e4('0x7b'));}_0x53b2b4=_['difference'](_[_0x65e4('0x5b')](_0x11ba43),[_0x65e4('0x7c'),_0x65e4('0x7d')]);_0x934ba0=_[_0x65e4('0x7e')](_[_0x65e4('0x5b')](_0x11ba43),[_0x65e4('0x7c'),_0x65e4('0x7d'),'CompanyId','ListId']);_0x1898ec[_0x65e4('0x5d')]={'mapKey':'mobile'};if(_0x1898ec['account'][_0x65e4('0x46')]){switch(_0x1898ec[_0x65e4('0x75')]['type']){case _0x65e4('0x7f'):_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x81')];_0x1898ec['body'][_0x65e4('0x5d')]=_0x2f048a[_0x65e4('0x5d')]['Body'];_0x1898ec[_0x65e4('0x5d')]['messageId']=_0x2f048a['body'][_0x65e4('0x82')];break;case'skebby':_0x1898ec['body'][_0x65e4('0x80')]='+'+_0x2f048a[_0x65e4('0x5d')]['sender'];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x5d')]=_0x2f048a[_0x65e4('0x5d')]['text'];break;case _0x65e4('0x83'):_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x80')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x5d')]=_0x2f048a[_0x65e4('0x5d')]['message'];break;case _0x65e4('0x84'):_0x1898ec['body'][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x80')];_0x1898ec[_0x65e4('0x5d')]['body']=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x5d')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x86')];break;case'plivo':_0x1898ec['body'][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x81')];_0x1898ec[_0x65e4('0x5d')]['body']=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x87')];_0x1898ec['body'][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x88')];break;case _0x65e4('0x89'):_0x1898ec['body']['from']='+'+_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x8a')][0x0]['from'];_0x1898ec['body'][_0x65e4('0x5d')]=_0x2f048a['body']['results'][0x0][_0x65e4('0x8b')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')]['results'][0x0][_0x65e4('0x85')];break;case _0x65e4('0x8c'):_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')]['originatingAddress'];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x5d')]=_0x2f048a[_0x65e4('0x5d')]['segmentedMessage'][_0x65e4('0x26')];break;case'clickatell':_0x1898ec['body'][_0x65e4('0x80')]=_0x2f048a['body'][_0x65e4('0x8d')];_0x1898ec['body']['body']=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x8b')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x8e')];break;case _0x65e4('0x8f'):_0x1898ec['body'][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')][0x0][_0x65e4('0x26')]['id'];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][0x0]['message'][_0x65e4('0x80')];_0x1898ec['body'][_0x65e4('0x5d')]=_0x2f048a['body'][0x0][_0x65e4('0x26')]['text'];break;case _0x65e4('0x90'):_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x80')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x5d')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x26')];_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x85')]=_0x2f048a[_0x65e4('0x5d')][_0x65e4('0x91')];break;}}if(_0x1898ec[_0x65e4('0x5d')]['id']){delete _0x1898ec['body']['id'];}if(_[_0x65e4('0x92')](_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')])){throw new db['Sequelize'][(_0x65e4('0x7a'))](_0x65e4('0x93'));}if(_[_0x65e4('0x92')](_0x1898ec[_0x65e4('0x5d')]['body'])||_0x1898ec['body'][_0x65e4('0x5d')]===''){throw new db[(_0x65e4('0x79'))][(_0x65e4('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x65e4('0x92')](_0x1898ec[_0x65e4('0x5d')]['mapKey'])){throw new db[(_0x65e4('0x79'))][(_0x65e4('0x7a'))](_0x65e4('0x94')+_0x934ba0);}if(!_[_0x65e4('0x95')](_0x934ba0,_0x1898ec['body'][_0x65e4('0x96')])){throw new db[(_0x65e4('0x79'))][(_0x65e4('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x934ba0);}_0x1e6059[_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x96')]]=_0x1898ec['body'][_0x65e4('0x80')];return db[_0x65e4('0x97')][_0x65e4('0x62')]({'where':{'id':_0x1898ec['account']['ListId']},'include':[{'model':db[_0x65e4('0x98')],'as':_0x65e4('0x99'),'where':_0x1e6059,'limit':0x1,'order':[[_0x65e4('0x7d'),'DESC']]}]});})[_0x65e4('0x37')](handleEntityNotFound(_0x5c09d4,null))[_0x65e4('0x37')](function(_0x37909e){if(_0x37909e){_0x1898ec['list']=_[_0x65e4('0x9a')](_0x37909e,[_0x65e4('0x99')]);if(_0x37909e[_0x65e4('0x99')]['length']){return _0x37909e[_0x65e4('0x99')][0x0];}var _0x3824d0=_['defaults'](_0x1898ec[_0x65e4('0x5d')],{'firstName':_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')],'ListId':_0x37909e['id']});_0x3824d0[_0x1898ec['body']['mapKey']]=_0x1898ec[_0x65e4('0x5d')]['from'];return db[_0x65e4('0x98')][_0x65e4('0x5c')](_0x3824d0,{'fields':_0x53b2b4,'raw':!![]});}})[_0x65e4('0x37')](handleEntityNotFound(_0x5c09d4,null))[_0x65e4('0x37')](function(_0xa0aab2){if(_0xa0aab2){_0x1898ec[_0x65e4('0x9b')]=_0xa0aab2;var _0x21ddaa={'ContactId':_0xa0aab2['id'],'phone':_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')],'SmsAccountId':_0x2f048a['params']['id']};var _0x41b3d1={'ContactId':_0xa0aab2['id'],'SmsAccountId':_0x2f048a['params']['id'],'closed':![]};return db[_0x65e4('0x9c')][_0x65e4('0x62')]({'where':_0x41b3d1})[_0x65e4('0x37')](function(_0x634a77){if(_0x634a77){return[_0x634a77,![]];}return db[_0x65e4('0x9c')][_0x65e4('0x5c')](_0x21ddaa)['then'](function(_0x1354a6){return[_0x1354a6,!![]];});});}})['spread'](function(_0x4982b3,_0x65b216){_0x1898ec[_0x65e4('0x9d')]=_0x4982b3[_0x65e4('0x39')]({'plain':!![]});_0x1898ec[_0x65e4('0x9d')][_0x65e4('0x9e')]=![];if(_0x65b216){if(_0x1898ec[_0x65e4('0x75')][_0x65e4('0x9f')]){_0x1898ec['applications']['push']({'id':0x0,'priority':_0x1898ec[_0x65e4('0xa0')][_0x65e4('0x4e')]+0x1,'app':_0x65e4('0xa1'),'appdata':_0x65e4('0xa2'),'interval':'*,*,*,*'});}_0x1898ec['interaction'][_0x65e4('0x9e')]=!![];}return db[_0x65e4('0xa3')][_0x65e4('0x5c')]({'phone':_0x1898ec[_0x65e4('0x5d')][_0x65e4('0x80')],'messageId':_0x1898ec['body'][_0x65e4('0x85')],'body':_0x1898ec['body']['body'],'SmsAccountId':_0x2f048a[_0x65e4('0x5a')]['id'],'SmsInteractionId':_0x4982b3['id'],'direction':'in','ContactId':_0x4982b3[_0x65e4('0xa4')],'AttachmentId':_0x1898ec[_0x65e4('0x5d')]['AttachmentId']});})['then'](function(_0x596b1a){_0x1898ec['message']=_0x596b1a;if(_0x1898ec['interaction'][_0x65e4('0xa5')]){return db[_0x65e4('0xa6')]['find']({'attributes':['id',_0x65e4('0x3d')],'where':{'id':_0x1898ec[_0x65e4('0x9d')][_0x65e4('0xa5')]}})[_0x65e4('0x37')](function(_0x1743d1){if(_0x1743d1){_0x1898ec[_0x65e4('0xa0')][_0x65e4('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1743d1[_0x65e4('0x3d')]+','+(_0x1898ec[_0x65e4('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x65e4('0xa8')});}return respondWithRpcPromise(_0x65e4('0xa9'),_0x65e4('0xaa'),_0x1898ec);});}return respondWithRpcPromise(_0x65e4('0xa9'),_0x65e4('0xaa'),_0x1898ec);})[_0x65e4('0x37')](function(_0x5dba52){if(_0x5dba52){var _0x2368de=0xc8;var _0x20b6ab='receiveMessage';logger['info'](_0x65e4('0x22'),_0x20b6ab,_0x2368de,_0x65e4('0xab'));logger[_0x65e4('0x21')](_0x65e4('0xac'),_0x20b6ab,_0x2368de,_0x65e4('0xab'),JSON[_0x65e4('0x23')](_0x5dba52));if(_0x1898ec[_0x65e4('0x75')]['type']===_0x65e4('0x7f')){return _0x5c09d4[_0x65e4('0x2b')](_0x2368de)[_0x65e4('0x31')]('Content-Type',_0x65e4('0xad'))['send']('\x0a');}else{return _0x5c09d4['status'](_0x2368de)[_0x65e4('0x33')](_0x5dba52);}}})[_0x65e4('0x29')](handleError(_0x5c09d4,null));};exports[_0x65e4('0xae')]=function(_0x3eb401,_0x5ea43d){var _0x168690=_0x3eb401['params']['id'];var _0x240345=_0x3eb401[_0x65e4('0x5d')];var _0x4bc8c6=0xc8;var _0x1884aa=null;return db[_0x65e4('0xaf')][_0x65e4('0xb0')]({'isolationLevel':db[_0x65e4('0xaf')][_0x65e4('0xb1')][_0x65e4('0xb2')][_0x65e4('0xb3')]},function(_0x45d192){return db[_0x65e4('0x43')][_0x65e4('0x67')]({'where':{'id':_0x168690},'transaction':_0x45d192})[_0x65e4('0x37')](function(_0x5752de){if(_0x5752de){return db[_0x65e4('0x73')][_0x65e4('0x38')]({'where':{'SmsAccountId':_0x168690},'transaction':_0x45d192})[_0x65e4('0x37')](function(){var _0x21543d=_[_0x65e4('0x42')](_0x240345,function(_0x9cebc8){_0x9cebc8[_0x65e4('0x64')]=_0x168690;return _0x9cebc8;});return db['SmsApplication'][_0x65e4('0xb4')](_0x21543d,{'transaction':_0x45d192});});}else{_0x4bc8c6=0x194;_0x1884aa=[];}});})['then'](function(){if(_0x4bc8c6!==0x194){return db[_0x65e4('0x73')][_0x65e4('0xb5')]({'where':{'SmsAccountId':_0x168690},'order':_0x65e4('0x77')})[_0x65e4('0x37')](function(_0xafcb84){_0x1884aa=_0xafcb84;});}})[_0x65e4('0x29')](function(_0x3c6c5e){_0x4bc8c6=0x1f4;logger[_0x65e4('0x24')](_0x3c6c5e['stack']);if(_0x3c6c5e[_0x65e4('0x3d')]){delete _0x3c6c5e[_0x65e4('0x3d')];}_0x1884aa=_0x3c6c5e;})[_0x65e4('0xb6')](function(){if(_0x1884aa===null){_0x5ea43d['sendStatus'](_0x4bc8c6);}else{if(_0x4bc8c6===0x1f4){_0x5ea43d[_0x65e4('0x2b')](_0x4bc8c6)[_0x65e4('0x3e')](_0x1884aa);}else{_0x5ea43d[_0x65e4('0x2b')](_0x4bc8c6)[_0x65e4('0x33')](_0x1884aa);}}});};exports[_0x65e4('0xb7')]=function(_0x5794ca,_0x304f65,_0x11d39b){var _0x43b4b6={};var _0x4547fe={};var _0x4b8484;var _0x5dc65e;return db[_0x65e4('0x43')][_0x65e4('0x67')]({'where':{'id':_0x5794ca[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x304f65,null))[_0x65e4('0x37')](function(_0x50abfb){if(_0x50abfb){_0x4b8484=_0x50abfb;_0x4547fe[_0x65e4('0x48')]=_[_0x65e4('0x5b')](db[_0x65e4('0x73')][_0x65e4('0x44')]);_0x4547fe[_0x65e4('0x49')]=_['keys'](_0x5794ca[_0x65e4('0x49')]);_0x4547fe[_0x65e4('0x4a')]=_['intersection'](_0x4547fe[_0x65e4('0x48')],_0x4547fe[_0x65e4('0x49')]);_0x43b4b6[_0x65e4('0x4d')]=_['intersection'](_0x4547fe[_0x65e4('0x48')],qs[_0x65e4('0x4c')](_0x5794ca[_0x65e4('0x49')][_0x65e4('0x4c')]));_0x43b4b6[_0x65e4('0x4d')]=_0x43b4b6['attributes'][_0x65e4('0x4e')]?_0x43b4b6[_0x65e4('0x4d')]:_0x4547fe['model'];_0x43b4b6[_0x65e4('0x68')]=qs[_0x65e4('0x50')](_0x5794ca[_0x65e4('0x49')][_0x65e4('0x50')]);_0x43b4b6[_0x65e4('0x51')]=qs[_0x65e4('0x4a')](_['pick'](_0x5794ca[_0x65e4('0x49')],_0x4547fe[_0x65e4('0x4a')]));if(_0x5794ca[_0x65e4('0x49')][_0x65e4('0x55')]){_0x43b4b6[_0x65e4('0x51')]=_['merge'](_0x43b4b6['where'],{'$or':_['map'](_0x43b4b6[_0x65e4('0x4d')],function(_0x4dd717){var _0xc74015={};_0xc74015[_0x4dd717]={'$like':'%'+_0x5794ca[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0xc74015;})});}_0x43b4b6=_[_0x65e4('0x53')]({},_0x43b4b6,_0x5794ca['options']);return _0x4b8484[_0x65e4('0xb7')](_0x43b4b6);}})[_0x65e4('0x37')](function(_0x767c23){if(_0x767c23){_0x5dc65e=_0x767c23[_0x65e4('0x4e')];if(!_0x5794ca[_0x65e4('0x49')][_0x65e4('0x6f')]('nolimit')){_0x43b4b6[_0x65e4('0x30')]=qs[_0x65e4('0x30')](_0x5794ca[_0x65e4('0x49')][_0x65e4('0x30')]);_0x43b4b6[_0x65e4('0x2d')]=qs[_0x65e4('0x2d')](_0x5794ca[_0x65e4('0x49')]['offset']);}return _0x4b8484[_0x65e4('0xb7')](_0x43b4b6);}})[_0x65e4('0x37')](function(_0xbe3c1b){if(_0xbe3c1b){return _0xbe3c1b?{'count':_0x5dc65e,'rows':_0xbe3c1b}:null;}})[_0x65e4('0x37')](respondWithResult(_0x304f65,null))['catch'](handleError(_0x304f65,null));};exports[_0x65e4('0xb8')]=function(_0x65f343,_0x56b2b6,_0x383e3d){var _0x1dece6={'raw':![],'where':{}};var _0x5c47a5={};var _0x11c683={'count':0x0,'rows':[]};return db[_0x65e4('0x43')][_0x65e4('0x67')]({'where':{'id':_0x65f343['params']['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x56b2b6,null))['then'](function(_0x48f9e1){if(_0x48f9e1){_0x5c47a5['model']=_['keys'](db['SmsInteraction']['rawAttributes']);_0x5c47a5[_0x65e4('0x49')]=_[_0x65e4('0x5b')](_0x65f343['query']);_0x5c47a5[_0x65e4('0x4a')]=_[_0x65e4('0x4b')](_0x5c47a5[_0x65e4('0x48')],_0x5c47a5[_0x65e4('0x49')]);_0x1dece6[_0x65e4('0x4d')]=_[_0x65e4('0x4b')](_0x5c47a5['model'],qs[_0x65e4('0x4c')](_0x65f343['query'][_0x65e4('0x4c')]));_0x1dece6[_0x65e4('0x4d')]=_0x1dece6['attributes'][_0x65e4('0x4e')]?_0x1dece6[_0x65e4('0x4d')]:_0x5c47a5[_0x65e4('0x48')];if(!_0x65f343[_0x65e4('0x49')][_0x65e4('0x6f')](_0x65e4('0x4f'))){_0x1dece6[_0x65e4('0x30')]=qs[_0x65e4('0x30')](_0x65f343[_0x65e4('0x49')]['limit']);_0x1dece6[_0x65e4('0x2d')]=qs[_0x65e4('0x2d')](_0x65f343[_0x65e4('0x49')][_0x65e4('0x2d')]);}_0x1dece6[_0x65e4('0x68')]=qs[_0x65e4('0x50')](_0x65f343[_0x65e4('0x49')]['sort']);_0x1dece6['where']=qs[_0x65e4('0x4a')](_[_0x65e4('0x52')](_0x65f343[_0x65e4('0x49')],_0x5c47a5['filters']));_0x1dece6['where'][_0x65e4('0x64')]=_0x48f9e1['id'];if(_0x65f343[_0x65e4('0x49')][_0x65e4('0x55')]){_0x1dece6[_0x65e4('0x51')]=_[_0x65e4('0x53')](_0x1dece6[_0x65e4('0x51')],{'$or':_['map'](_0x1dece6[_0x65e4('0x4d')],function(_0x1987ff){var _0x5f44cd={};_0x5f44cd[_0x1987ff]={'$like':'%'+_0x65f343[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0x5f44cd;})});}_0x1dece6=_['merge']({},_0x1dece6,_0x65f343['options']);return db[_0x65e4('0x9c')][_0x65e4('0x2f')]({'where':_0x1dece6[_0x65e4('0x51')]})[_0x65e4('0x37')](function(_0x528f32){_0x11c683[_0x65e4('0x2f')]=_0x528f32;if(_0x65f343[_0x65e4('0x49')][_0x65e4('0x57')]){_0x1dece6[_0x65e4('0x58')]=[{'model':db[_0x65e4('0x98')],'as':_0x65e4('0xb9'),'required':![]},{'model':db[_0x65e4('0xa6')],'as':_0x65e4('0xba'),'attributes':['name',_0x65e4('0xbb'),'internal'],'required':![]},{'model':db[_0x65e4('0xbc')],'as':_0x65e4('0xbd'),'attributes':['id',_0x65e4('0x3d'),'color'],'where':_0x65f343[_0x65e4('0x49')]['tag']?{'id':_0x65f343[_0x65e4('0x49')][_0x65e4('0xbe')]}:undefined,'required':_0x65f343['query'][_0x65e4('0xbe')]?!![]:![]}];}return db[_0x65e4('0x9c')][_0x65e4('0x69')](_0x1dece6);})[_0x65e4('0x37')](function(_0x45aeff){_0x11c683[_0x65e4('0x59')]=_0x45aeff;return _0x11c683;});}})[_0x65e4('0x37')](respondWithFilteredResult(_0x56b2b6,_0x1dece6))['catch'](handleError(_0x56b2b6,null));};exports['send']=function(_0x44dacc,_0x370364,_0x2118bb){var _0x1c8e2d,_0x1447b8,_0x329e0a;if(_[_0x65e4('0x92')](_0x44dacc['body'][_0x65e4('0x5d')])||_0x44dacc[_0x65e4('0x5d')][_0x65e4('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x44dacc[_0x65e4('0x5d')]['to'])){throw new db['Sequelize'][(_0x65e4('0x7a'))]('to\x20is\x20mandatory');}_0x1c8e2d=_0x44dacc['body']['to'];return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x44dacc[_0x65e4('0x5a')]['id']},'include':[{'model':db[_0x65e4('0x97')],'as':_0x65e4('0xbf'),'include':[{'model':db['CmContact'],'as':_0x65e4('0x99'),'where':{'mobile':_0x1c8e2d},'limit':0x1,'order':[[_0x65e4('0x7d'),_0x65e4('0xc0')]]}]}]})[_0x65e4('0x37')](handleEntityNotFound(_0x370364,null))[_0x65e4('0x37')](function(_0x2bd6aa){if(_0x2bd6aa&&_0x2bd6aa[_0x65e4('0xbf')]){_0x1447b8=_0x2bd6aa[_0x65e4('0x39')]({'plain':!![]});if(_0x1447b8[_0x65e4('0xbf')]&&_0x1447b8[_0x65e4('0xbf')][_0x65e4('0x99')][_0x65e4('0x4e')]){return _0x1447b8[_0x65e4('0xbf')][_0x65e4('0x99')][0x0];}return db['CmContact'][_0x65e4('0x5c')](_[_0x65e4('0xc1')](_0x44dacc['body'],{'firstName':_0x1c8e2d,'mobile':_0x1c8e2d,'phone':_0x1c8e2d,'ListId':_0x1447b8['ListId']}));}})[_0x65e4('0x37')](handleEntityNotFound(_0x370364,null))[_0x65e4('0x37')](function(_0x2e58c6){if(_0x2e58c6){_0x329e0a=_0x2e58c6;return db[_0x65e4('0x9c')][_0x65e4('0x62')]({'where':{'ContactId':_0x329e0a['id'],'closed':![],'SmsAccountId':_0x1447b8['id']}})[_0x65e4('0x37')](function(_0xcb3b3d){if(_0xcb3b3d){return[_0xcb3b3d,![]];}return db['SmsInteraction'][_0x65e4('0x5c')]({'UserId':_0x44dacc['user']['id'],'ContactId':_0x329e0a['id'],'SmsAccountId':_0x1447b8['id'],'phone':_0x1c8e2d,'firstMsgDirection':_0x65e4('0xc2'),'Messages':[_[_0x65e4('0x53')](_0x44dacc[_0x65e4('0x5d')],{'read':![],'body':_0x44dacc[_0x65e4('0x5d')]['body'],'phone':_0x1c8e2d,'SmsAccountId':_0x1447b8['id'],'UserId':_0x44dacc[_0x65e4('0xc3')]['id'],'ContactId':_0x329e0a['id']})]},{'include':[{'model':db[_0x65e4('0xa3')],'as':_0x65e4('0xc4')}]})[_0x65e4('0x37')](function(_0x4875ad){return[_0x4875ad,!![]];});});}})[_0x65e4('0xc5')](function(_0x3df0e2,_0x48cedc){if(_0x48cedc){return _0x3df0e2;}return db['SmsMessage'][_0x65e4('0x5c')](_[_0x65e4('0x53')](_0x44dacc['body'],{'read':![],'body':_0x44dacc[_0x65e4('0x5d')][_0x65e4('0x5d')],'phone':_0x1c8e2d,'SmsAccountId':_0x1447b8['id'],'SmsInteractionId':_0x3df0e2['id'],'UserId':_0x44dacc[_0x65e4('0xc3')]['id'],'ContactId':_0x329e0a['id']}))[_0x65e4('0x37')](function(_0x20b6b2){_0x3df0e2['dataValues'][_0x65e4('0xc4')]=[];_0x3df0e2[_0x65e4('0xc6')][_0x65e4('0xc4')][_0x65e4('0xc7')](_0x20b6b2[_0x65e4('0xc6')]);return _0x3df0e2;});})[_0x65e4('0x37')](respondWithResult(_0x370364,null))['catch'](handleError(_0x370364,null));};exports[_0x65e4('0x2b')]=function(_0x94755,_0x3c0988,_0x168eb2){if(_0x94755[_0x65e4('0x5d')]['id']){delete _0x94755[_0x65e4('0x5d')]['id'];}var _0x4e046f,_0x57f811,_0x16f836;return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x94755[_0x65e4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c0988,null))['then'](function(_0xfeaf){if(_0xfeaf){_0x16f836=_0xfeaf;logger[_0x65e4('0x21')](_0x65e4('0x22'),_0x65e4('0x2b'),'received\x20delivery\x20report\x20from',_0xfeaf[_0x65e4('0x46')],util[_0x65e4('0xc8')](_0x94755['body'],{'showHidden':![],'depth':null}));switch(_0xfeaf[_0x65e4('0x46')]){case _0x65e4('0xc9'):if(_0x94755[_0x65e4('0x5d')][_0x65e4('0xca')]&&_0x94755[_0x65e4('0x5d')]['status']){_0x57f811=_0x94755['body'][_0x65e4('0x2b')];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x94755[_0x65e4('0x5d')][_0x65e4('0xca')]}});}break;case _0x65e4('0x83'):if(_0x94755['body'][_0x65e4('0xcb')]&&_0x94755[_0x65e4('0x5d')][_0x65e4('0xcc')]){_0x57f811=_0x94755[_0x65e4('0x5d')][_0x65e4('0xcc')];return db[_0x65e4('0xa3')]['find']({'where':{'messageId':_0x94755['body'][_0x65e4('0xcb')]}});}break;case'clicksend':if(_0x94755[_0x65e4('0x5d')][_0x65e4('0x86')]&&_0x94755['body']['status_code']){_0x57f811=_0x94755[_0x65e4('0x5d')]['status_code'];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x94755['body']['message_id']}});}break;case'infobip':var _0x41c39d=_0x94755[_0x65e4('0x5d')][_0x65e4('0x8a')][0x0];if(_0x41c39d[_0x65e4('0x85')]&&_0x41c39d['status']['groupName']==='DELIVERED'){_0x57f811=_0x41c39d['status'][_0x65e4('0xcd')];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x41c39d[_0x65e4('0x85')]}});}break;case _0x65e4('0xce'):if(_0x94755['body'][_0x65e4('0x85')]&&_0x94755[_0x65e4('0x5d')][_0x65e4('0x2b')]){_0x57f811=_0x94755['body'][_0x65e4('0x2b')];return db['SmsMessage'][_0x65e4('0x62')]({'where':{'messageId':_0x94755[_0x65e4('0x5d')][_0x65e4('0x85')]}});}break;case _0x65e4('0x8f'):if(_0x94755[_0x65e4('0x5d')][0x0][_0x65e4('0x26')]['id']){_0x57f811=_0x94755[_0x65e4('0x5d')][0x0][_0x65e4('0x46')];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x94755['body'][0x0][_0x65e4('0x26')]['id']}});}break;case _0x65e4('0x90'):if(_0x94755[_0x65e4('0x5d')][_0x65e4('0xcf')]&&_0x94755['body'][_0x65e4('0x2b')]){_0x57f811=_0x94755[_0x65e4('0x5d')][_0x65e4('0x2b')];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x94755['body'][_0x65e4('0xcf')]}});}break;}}})[_0x65e4('0x37')](handleEntityNotFound(_0x3c0988,null))[_0x65e4('0x37')](function(_0x357982){if(_0x357982){_0x4e046f=_0x357982;switch(_0x16f836[_0x65e4('0x46')]){case _0x65e4('0xc9'):if(_0x57f811===_0x65e4('0xd0')){return _0x4e046f[_0x65e4('0x61')]({'read':!![]});}else{logger['error'](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0xc9'),util['inspect'](_0x94755[_0x65e4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x65e4('0x83'):if(_0x57f811==='1'){return _0x4e046f['update']({'read':!![]});}else{logger[_0x65e4('0x24')](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0xc9'),util[_0x65e4('0xc8')](_0x94755['body'],{'showHidden':![],'depth':null}));}break;case _0x65e4('0x84'):if(!_0x94755[_0x65e4('0x5d')][_0x65e4('0xd1')]&&_0x57f811>=0xc8&&_0x57f811<=0xce){return _0x4e046f['update']({'read':!![]});}else{logger[_0x65e4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x65e4('0x2b'),_0x65e4('0x84'),util[_0x65e4('0xc8')](_0x94755[_0x65e4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x65e4('0x89'):var _0xa59f30=_0x94755['body'][_0x65e4('0x8a')][0x0];if(_0xa59f30[_0x65e4('0x2b')][_0x65e4('0xcd')]==='DELIVERED'){return _0x4e046f[_0x65e4('0x61')]({'read':!![]});}else{logger[_0x65e4('0x24')](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0x89'),util[_0x65e4('0xc8')](_0x94755[_0x65e4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x65e4('0xce'):if(_0x57f811==_0x65e4('0xd2')||_0x57f811==_0x65e4('0xd3')){return _0x4e046f['update']({'read':!![]});}else{logger[_0x65e4('0x24')](_0x65e4('0x22'),'status',_0x65e4('0xce'),util[_0x65e4('0xc8')](_0x94755['body'],{'showHidden':![],'depth':null}));}break;case _0x65e4('0x8f'):if(_0x57f811=='message-delivered'){return _0x4e046f[_0x65e4('0x61')]({'read':!![]});}else{logger[_0x65e4('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x65e4('0x8f'),util[_0x65e4('0xc8')](_0x94755[_0x65e4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x65e4('0x90'):if(_0x57f811==='DELIVRD'||_0x57f811===_0x65e4('0xd4')){return _0x4e046f['update']({'read':!![]});}else{logger[_0x65e4('0x24')](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0x90'),util[_0x65e4('0xc8')](_0x94755['body'],{'showHidden':![],'depth':null}));}break;}return _0x4e046f;}})[_0x65e4('0x37')](respondWithResult(_0x3c0988,null))['catch'](handleError(_0x3c0988,null));};exports[_0x65e4('0xd5')]=function(_0x51fe9b,_0x10b316,_0x4912ba){var _0x18f897,_0x1fa35d,_0x13e6c6;return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x51fe9b[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x10b316,null))['then'](function(_0x3d694c){if(_0x3d694c){_0x13e6c6=_0x3d694c;logger['debug'](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0xd6'),_0x3d694c[_0x65e4('0x46')],util[_0x65e4('0xc8')](_0x51fe9b[_0x65e4('0x49')],{'showHidden':![],'depth':null}));switch(_0x3d694c[_0x65e4('0x46')]){case _0x65e4('0x8c'):if(_0x51fe9b[_0x65e4('0x49')][_0x65e4('0xd7')]&&_0x51fe9b[_0x65e4('0x49')][_0x65e4('0xd8')]){_0x1fa35d=_0x51fe9b['query'][_0x65e4('0xd8')];return db[_0x65e4('0xa3')][_0x65e4('0x62')]({'where':{'messageId':_0x51fe9b['query'][_0x65e4('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x10b316,null))[_0x65e4('0x37')](function(_0x57e524){if(_0x57e524){_0x18f897=_0x57e524;switch(_0x13e6c6['type']){case'csc':if(_0x1fa35d==='2'||_0x1fa35d==='6'){return _0x18f897['update']({'read':!![]});}else{logger['error'](_0x65e4('0x22'),_0x65e4('0x2b'),_0x65e4('0x8c'),util['inspect'](_0x51fe9b[_0x65e4('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x18f897;}})[_0x65e4('0x37')](respondWithResult(_0x10b316,null))['catch'](handleError(_0x10b316,null));};exports[_0x65e4('0xd9')]=function(_0x1d819e,_0x61afe8,_0x10c305){return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x1d819e[_0x65e4('0x5a')]['id']}})[_0x65e4('0x37')](handleEntityNotFound(_0x61afe8,null))[_0x65e4('0x37')](function(_0xeaa49d){if(_0xeaa49d){return _0xeaa49d['addAgents'](_0x1d819e[_0x65e4('0x5d')]['ids'],_[_0x65e4('0x9a')](_0x1d819e[_0x65e4('0x5d')],['ids','id'])||{})[_0x65e4('0xc5')](function(_0x2b522a){for(var _0xbaf138=0x0;_0xbaf138<_0x1d819e[_0x65e4('0x5d')][_0x65e4('0x6b')]['length'];_0xbaf138+=0x1){socket[_0x65e4('0xda')](_0x65e4('0xdb'),{'UserId':Number(_0x1d819e[_0x65e4('0x5d')]['ids'][_0xbaf138]),'SmsAccountId':Number(_0x1d819e[_0x65e4('0x5a')]['id'])});}return _0x2b522a;});}})['then'](respondWithResult(_0x61afe8,null))[_0x65e4('0x29')](handleError(_0x61afe8,null));};exports[_0x65e4('0xdc')]=function(_0x2bf799,_0x505e36,_0x5662d0){return db[_0x65e4('0x43')][_0x65e4('0x62')]({'where':{'id':_0x2bf799[_0x65e4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x505e36,null))[_0x65e4('0x37')](function(_0x7b5f9f){if(_0x7b5f9f){return _0x7b5f9f['removeAgents'](_0x2bf799[_0x65e4('0x49')][_0x65e4('0x6b')])[_0x65e4('0x37')](function(){if(_[_0x65e4('0xdd')](_0x2bf799[_0x65e4('0x49')][_0x65e4('0x6b')])){for(var _0xb5a2ba=0x0;_0xb5a2ba<_0x2bf799['query'][_0x65e4('0x6b')][_0x65e4('0x4e')];_0xb5a2ba+=0x1){socket['emit'](_0x65e4('0xde'),{'UserId':Number(_0x2bf799['query'][_0x65e4('0x6b')][_0xb5a2ba]),'SmsAccountId':Number(_0x2bf799[_0x65e4('0x5a')]['id'])});}}else{socket[_0x65e4('0xda')](_0x65e4('0xde'),{'UserId':Number(_0x2bf799[_0x65e4('0x49')]['ids']),'SmsAccountId':Number(_0x2bf799['params']['id'])});}});}})['then'](respondWithStatusCode(_0x505e36,null))[_0x65e4('0x29')](handleError(_0x505e36,null));};exports[_0x65e4('0xdf')]=function(_0x3c39b0,_0x1c154e,_0x2edaf3){var _0x39eca3={};var _0x48ed49={};var _0x37a029;var _0x3ae13b;return db['SmsAccount'][_0x65e4('0x67')]({'where':{'id':_0x3c39b0[_0x65e4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c154e,null))[_0x65e4('0x37')](function(_0xfaf9a0){if(_0xfaf9a0){_0x37a029=_0xfaf9a0;_0x48ed49[_0x65e4('0x48')]=_[_0x65e4('0x5b')](db[_0x65e4('0xa6')]['rawAttributes']);_0x48ed49[_0x65e4('0x49')]=_[_0x65e4('0x5b')](_0x3c39b0['query']);_0x48ed49['filters']=_[_0x65e4('0x4b')](_0x48ed49[_0x65e4('0x48')],_0x48ed49[_0x65e4('0x49')]);_0x39eca3['attributes']=_['intersection'](_0x48ed49[_0x65e4('0x48')],qs[_0x65e4('0x4c')](_0x3c39b0['query'][_0x65e4('0x4c')]));_0x39eca3[_0x65e4('0x4d')]=_0x39eca3[_0x65e4('0x4d')]['length']?_0x39eca3['attributes']:_0x48ed49['model'];_0x39eca3[_0x65e4('0x68')]=qs[_0x65e4('0x50')](_0x3c39b0[_0x65e4('0x49')][_0x65e4('0x50')]);_0x39eca3[_0x65e4('0x51')]=qs['filters'](_[_0x65e4('0x52')](_0x3c39b0[_0x65e4('0x49')],_0x48ed49[_0x65e4('0x4a')]));if(_0x3c39b0[_0x65e4('0x49')][_0x65e4('0x55')]){_0x39eca3[_0x65e4('0x51')]=_[_0x65e4('0x53')](_0x39eca3['where'],{'$or':_[_0x65e4('0x42')](_0x39eca3[_0x65e4('0x4d')],function(_0x21461f){var _0xf129a4={};_0xf129a4[_0x21461f]={'$like':'%'+_0x3c39b0[_0x65e4('0x49')][_0x65e4('0x55')]+'%'};return _0xf129a4;})});}_0x39eca3=_['merge']({},_0x39eca3,_0x3c39b0[_0x65e4('0x56')]);return _0x37a029[_0x65e4('0xdf')](_0x39eca3);}})[_0x65e4('0x37')](function(_0xbd025){if(_0xbd025){_0x3ae13b=_0xbd025['length'];if(!_0x3c39b0[_0x65e4('0x49')][_0x65e4('0x6f')](_0x65e4('0x4f'))){_0x39eca3['limit']=qs[_0x65e4('0x30')](_0x3c39b0[_0x65e4('0x49')][_0x65e4('0x30')]);_0x39eca3['offset']=qs['offset'](_0x3c39b0[_0x65e4('0x49')]['offset']);}return _0x37a029[_0x65e4('0xdf')](_0x39eca3);}})['then'](function(_0x1cb343){if(_0x1cb343){return _0x1cb343?{'count':_0x3ae13b,'rows':_0x1cb343}:null;}})[_0x65e4('0x37')](respondWithResult(_0x1c154e,null))[_0x65e4('0x29')](handleError(_0x1c154e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 7539b6b..5200d10 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 _0x2ee6=['emit','hook','exports','events','../../mysqldb','update'];(function(_0x458f6a,_0x36796f){var _0x1b9776=function(_0x1388e4){while(--_0x1388e4){_0x458f6a['push'](_0x458f6a['shift']());}};_0x1b9776(++_0x36796f);}(_0x2ee6,0xcf));var _0x62ee=function(_0x362b6d,_0x20e7e9){_0x362b6d=_0x362b6d-0x0;var _0x11f9f1=_0x2ee6[_0x362b6d];return _0x11f9f1;};'use strict';var EventEmitter=require(_0x62ee('0x0'));var SmsAccount=require(_0x62ee('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x62ee('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3a7b1c){return function(_0x3e997d,_0x5a8b1d,_0x1b3d4c){SmsAccountEvents['emit'](_0x3a7b1c+':'+_0x3e997d['id'],_0x3e997d);SmsAccountEvents[_0x62ee('0x3')](_0x3a7b1c,_0x3e997d);_0x1b3d4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x62ee('0x4')](e,emitEvent(event));}}module[_0x62ee('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0xf856=['hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x473df6,_0x1ab1cf){var _0x5064d2=function(_0x1b9c82){while(--_0x1b9c82){_0x473df6['push'](_0x473df6['shift']());}};_0x5064d2(++_0x1ab1cf);}(_0xf856,0xb2));var _0x6f85=function(_0x48c9cf,_0x7406c){_0x48c9cf=_0x48c9cf-0x0;var _0x5735cb=_0xf856[_0x48c9cf];return _0x5735cb;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x6f85('0x0'))['db'][_0x6f85('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6f85('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f85('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40c5d0){return function(_0x2e19d6,_0xa89753,_0x57e7de){SmsAccountEvents[_0x6f85('0x4')](_0x40c5d0+':'+_0x2e19d6['id'],_0x2e19d6);SmsAccountEvents[_0x6f85('0x4')](_0x40c5d0,_0x2e19d6);_0x57e7de(null);};}for(var e in events){if(events[_0x6f85('0x5')](e)){var event=events[e];SmsAccount[_0x6f85('0x6')](e,emitEvent(event));}}module[_0x6f85('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index ce074fd..1879def 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 _0x13f7=['define','util','moment','bluebird','path','rimraf','./smsAccount.attributes','exports'];(function(_0x512d22,_0x1a525c){var _0x25e881=function(_0x4e3cf8){while(--_0x4e3cf8){_0x512d22['push'](_0x512d22['shift']());}};_0x25e881(++_0x1a525c);}(_0x13f7,0x1d1));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x713f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x713f('0x1'));var BPromise=require(_0x713f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x713f('0x3'));var rimraf=require(_0x713f('0x4'));var config=require('../../config/environment');var attributes=require(_0x713f('0x5'));module[_0x713f('0x6')]=function(_0xffc953,_0x266927){return _0xffc953[_0x713f('0x7')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e5a=['path','../../config/environment','./smsAccount.attributes','define','sms_accounts','util','../../config/logger','moment','request-promise'];(function(_0x4979ce,_0x4ff8fc){var _0x20536f=function(_0x466847){while(--_0x466847){_0x4979ce['push'](_0x4979ce['shift']());}};_0x20536f(++_0x4ff8fc);}(_0x5e5a,0x188));var _0xa5e5=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5e5a[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0xa5e5('0x0'));var logger=require(_0xa5e5('0x1'))('api');var moment=require(_0xa5e5('0x2'));var BPromise=require('bluebird');var rp=require(_0xa5e5('0x3'));var fs=require('fs');var path=require(_0xa5e5('0x4'));var rimraf=require('rimraf');var config=require(_0xa5e5('0x5'));var attributes=require(_0xa5e5('0x6'));module['exports']=function(_0x430bbc,_0x2f2e7b){return _0x430bbc[_0xa5e5('0x7')]('SmsAccount',attributes,{'tableName':_0xa5e5('0x8'),'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 a856cd8..9ac9c74 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 _0x194f=['debug','request\x20sent','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','then','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s'];(function(_0x16b54f,_0x462d05){var _0x44062d=function(_0x58d05f){while(--_0x58d05f){_0x16b54f['push'](_0x16b54f['shift']());}};_0x44062d(++_0x462d05);}(_0x194f,0x1f1));var _0xf194=function(_0x284857,_0x236ca6){_0x284857=_0x284857-0x0;var _0x442c47=_0x194f[_0x284857];return _0x442c47;};'use strict';var _=require('lodash');var util=require(_0xf194('0x0'));var moment=require(_0xf194('0x1'));var BPromise=require('bluebird');var rs=require(_0xf194('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf194('0x3'))['db'];var utils=require(_0xf194('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf194('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf194('0x6')]['http']({'port':0x232a});config[_0xf194('0x7')]=_[_0xf194('0x8')](config[_0xf194('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf194('0x7')]));require(_0xf194('0x9'))[_0xf194('0xa')](socket);function respondWithRpcPromise(_0x385bdb,_0x5610e3,_0xfae44f){return new BPromise(function(_0x1ec902,_0x4e6fef){return client['request'](_0x385bdb,_0xfae44f)['then'](function(_0x52b875){logger[_0xf194('0xb')](_0xf194('0xc'),_0x5610e3,'request\x20sent');logger[_0xf194('0xd')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5610e3,_0xf194('0xe'),JSON[_0xf194('0xf')](_0x52b875));if(_0x52b875[_0xf194('0x10')]){if(_0x52b875[_0xf194('0x10')][_0xf194('0x11')]===0x1f4){logger[_0xf194('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5610e3,_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);return _0x4e6fef(_0x52b875[_0xf194('0x10')]['message']);}logger[_0xf194('0x10')](_0xf194('0xc'),_0x5610e3,_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);return _0x1ec902(_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);}else{logger[_0xf194('0xb')](_0xf194('0xc'),_0x5610e3,'request\x20sent');_0x1ec902(_0x52b875['result'][_0xf194('0x12')]);}})[_0xf194('0x13')](function(_0x2ab3d7){logger[_0xf194('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5610e3,_0x2ab3d7);_0x4e6fef(_0x2ab3d7);});});}exports[_0xf194('0x14')]=function(_0x13fc9d){var _0x2e4f2=this;return new Promise(function(_0x5a01aa,_0x5ee153){return db[_0xf194('0x15')][_0xf194('0x16')]({'raw':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d[_0xf194('0x17')][_0xf194('0x18')]===undefined?!![]:![]:!![],'where':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d['options']['where']||null:null,'attributes':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d[_0xf194('0x17')][_0xf194('0x19')]||null:null,'include':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d['options'][_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x13fc9d[_0xf194('0x17')][_0xf194('0x1a')],function(_0x1b4c1b){return{'model':db[_0x1b4c1b[_0xf194('0x1c')]],'as':_0x1b4c1b['as'],'attributes':_0x1b4c1b[_0xf194('0x19')],'include':_0x1b4c1b[_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x1b4c1b['include'],function(_0x542214){return{'model':db[_0x542214['model']],'as':_0x542214['as'],'attributes':_0x542214[_0xf194('0x19')],'include':_0x542214[_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x542214[_0xf194('0x1a')],function(_0x4ecc22){return{'model':db[_0x4ecc22[_0xf194('0x1c')]],'as':_0x4ecc22['as'],'attributes':_0x4ecc22['attributes']};}):[]};}):[]};}):[]:[]})[_0xf194('0x1d')](function(_0x3a5256){logger[_0xf194('0xb')]('ShowSmsAccount',_0x13fc9d);logger[_0xf194('0xd')](_0xf194('0x14'),_0x13fc9d,JSON[_0xf194('0xf')](_0x3a5256));_0x5a01aa(_0x3a5256);})[_0xf194('0x13')](function(_0x30b68a){logger[_0xf194('0x10')](_0xf194('0x14'),_0x30b68a[_0xf194('0x12')],_0x13fc9d);_0x5ee153(_0x2e4f2[_0xf194('0x10')](0x1f4,_0x30b68a['message']));});});}; \ No newline at end of file +var _0x3fb9=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','lodash'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x3fb9,0xcb));var _0x93fb=function(_0x5e1104,_0x53695d){_0x5e1104=_0x5e1104-0x0;var _0x474e43=_0x3fb9[_0x5e1104];return _0x474e43;};'use strict';var _=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var moment=require(_0x93fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x93fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93fb('0x4'))['db'];var utils=require(_0x93fb('0x5'));var logger=require(_0x93fb('0x6'))(_0x93fb('0x7'));var config=require(_0x93fb('0x8'));var jayson=require(_0x93fb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x93fb('0xa')]=_[_0x93fb('0xb')](config[_0x93fb('0xa')],{'host':_0x93fb('0xc'),'port':0x18eb});var socket=require(_0x93fb('0xd'))(new Redis(config[_0x93fb('0xa')]));require(_0x93fb('0xe'))['register'](socket);function respondWithRpcPromise(_0x2beafd,_0x417a9d,_0x26a17c){return new BPromise(function(_0x3a2e23,_0x56a652){return client[_0x93fb('0xf')](_0x2beafd,_0x26a17c)[_0x93fb('0x10')](function(_0x29f66f){logger[_0x93fb('0x11')](_0x93fb('0x12'),_0x417a9d,_0x93fb('0x13'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x417a9d,_0x93fb('0x13'),JSON[_0x93fb('0x14')](_0x29f66f));if(_0x29f66f[_0x93fb('0x15')]){if(_0x29f66f[_0x93fb('0x15')][_0x93fb('0x16')]===0x1f4){logger[_0x93fb('0x15')]('SmsAccount,\x20%s,\x20%s',_0x417a9d,_0x29f66f[_0x93fb('0x15')][_0x93fb('0x17')]);return _0x56a652(_0x29f66f[_0x93fb('0x15')][_0x93fb('0x17')]);}logger[_0x93fb('0x15')](_0x93fb('0x12'),_0x417a9d,_0x29f66f[_0x93fb('0x15')]['message']);return _0x3a2e23(_0x29f66f[_0x93fb('0x15')][_0x93fb('0x17')]);}else{logger[_0x93fb('0x11')](_0x93fb('0x12'),_0x417a9d,'request\x20sent');_0x3a2e23(_0x29f66f['result']['message']);}})[_0x93fb('0x18')](function(_0x239424){logger[_0x93fb('0x15')]('SmsAccount,\x20%s,\x20%s',_0x417a9d,_0x239424);_0x56a652(_0x239424);});});}exports[_0x93fb('0x19')]=function(_0x210e4d){var _0x4a09d6=this;return new Promise(function(_0x1b963d,_0x4271b8){return db[_0x93fb('0x1a')][_0x93fb('0x1b')]({'raw':_0x210e4d[_0x93fb('0x1c')]?_0x210e4d['options']['raw']===undefined?!![]:![]:!![],'where':_0x210e4d[_0x93fb('0x1c')]?_0x210e4d['options'][_0x93fb('0x1d')]||null:null,'attributes':_0x210e4d['options']?_0x210e4d[_0x93fb('0x1c')][_0x93fb('0x1e')]||null:null,'include':_0x210e4d[_0x93fb('0x1c')]?_0x210e4d[_0x93fb('0x1c')][_0x93fb('0x1f')]?_[_0x93fb('0x20')](_0x210e4d[_0x93fb('0x1c')][_0x93fb('0x1f')],function(_0x24331c){return{'model':db[_0x24331c[_0x93fb('0x21')]],'as':_0x24331c['as'],'attributes':_0x24331c[_0x93fb('0x1e')],'include':_0x24331c[_0x93fb('0x1f')]?_[_0x93fb('0x20')](_0x24331c['include'],function(_0x3e8387){return{'model':db[_0x3e8387[_0x93fb('0x21')]],'as':_0x3e8387['as'],'attributes':_0x3e8387[_0x93fb('0x1e')],'include':_0x3e8387[_0x93fb('0x1f')]?_[_0x93fb('0x20')](_0x3e8387[_0x93fb('0x1f')],function(_0x14dc7f){return{'model':db[_0x14dc7f[_0x93fb('0x21')]],'as':_0x14dc7f['as'],'attributes':_0x14dc7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x93fb('0x10')](function(_0x27c797){logger[_0x93fb('0x11')](_0x93fb('0x19'),_0x210e4d);logger['debug'](_0x93fb('0x19'),_0x210e4d,JSON[_0x93fb('0x14')](_0x27c797));_0x1b963d(_0x27c797);})['catch'](function(_0x2cbddf){logger['error'](_0x93fb('0x19'),_0x2cbddf[_0x93fb('0x17')],_0x210e4d);_0x4271b8(_0x4a09d6[_0x93fb('0x15')](0x1f4,_0x2cbddf[_0x93fb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d88cb8b..3becf20 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 f79cafb..79de89f 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(_0x4c901d,_0x3733e4){var _0x4b7ae2=function(_0x685dfb){while(--_0x685dfb){_0x4c901d['push'](_0x4c901d['shift']());}};_0x4b7ae2(++_0x3733e4);}(_0x34e8,0x12c));var _0x834e=function(_0x12cbd8,_0x4eed4f){_0x12cbd8=_0x12cbd8-0x0;var _0x5cac1c=_0x34e8[_0x12cbd8];return _0x5cac1c;};'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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x1ebe78,_0x1d0d24){var _0x51783b=function(_0xd3d75a){while(--_0xd3d75a){_0x1ebe78['push'](_0x1ebe78['shift']());}};_0x51783b(++_0x1d0d24);}(_0x008c,0x188));var _0xc008=function(_0x74c6c6,_0x54d54e){_0x74c6c6=_0x74c6c6-0x0;var _0x56ba8b=_0x008c[_0x74c6c6];return _0x56ba8b;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a1a25a4..aa69adb 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 _0x10d0=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x4dbe9c,_0x1625bf){var _0x59e3d4=function(_0x219020){while(--_0x219020){_0x4dbe9c['push'](_0x4dbe9c['shift']());}};_0x59e3d4(++_0x1625bf);}(_0x10d0,0x13c));var _0x010d=function(_0x3457de,_0x19ecc5){_0x3457de=_0x3457de-0x0;var _0x30278f=_0x10d0[_0x3457de];return _0x30278f;};'use strict';var Sequelize=require(_0x010d('0x0'));module[_0x010d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x010d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x010d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x010d('0x2')],'defaultValue':_0x010d('0x4')}}; \ No newline at end of file +var _0x2138=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x39846e,_0x730172){var _0x349df9=function(_0x185eab){while(--_0x185eab){_0x39846e['push'](_0x39846e['shift']());}};_0x349df9(++_0x730172);}(_0x2138,0x18b));var _0x8213=function(_0x102ac2,_0x1eaca5){_0x102ac2=_0x102ac2-0x0;var _0x54b175=_0x2138[_0x102ac2];return _0x54b175;};'use strict';var Sequelize=require('sequelize');module[_0x8213('0x0')]={'priority':{'type':Sequelize[_0x8213('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8213('0x2')],'allowNull':![],'defaultValue':_0x8213('0x3')},'appdata':{'type':Sequelize[_0x8213('0x4')]()},'description':{'type':Sequelize[_0x8213('0x2')]},'interval':{'type':Sequelize[_0x8213('0x2')],'defaultValue':_0x8213('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f0f6e40..402a460 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 _0xfdc7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SmsApplication','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','length','create','body','update','find','params','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x200a7d,_0x431067){var _0x2227b2=function(_0x444eb7){while(--_0x444eb7){_0x200a7d['push'](_0x200a7d['shift']());}};_0x2227b2(++_0x431067);}(_0xfdc7,0x196));var _0x7fdc=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0xfdc7[_0x51af96];return _0x2bb16b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fdc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fdc('0x1'));var rp=require('request-promise');var moment=require(_0x7fdc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7fdc('0x3'));var util=require(_0x7fdc('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7fdc('0x5'));var ejs=require(_0x7fdc('0x6'));var fs=require('fs');var fs_extra=require(_0x7fdc('0x7'));var _=require(_0x7fdc('0x8'));var squel=require(_0x7fdc('0x9'));var crypto=require('crypto');var jsforce=require(_0x7fdc('0xa'));var deskjs=require(_0x7fdc('0xb'));var toCsv=require(_0x7fdc('0x5'));var querystring=require(_0x7fdc('0xc'));var Papa=require(_0x7fdc('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7fdc('0xe'));var as=require(_0x7fdc('0xf'));var hardwareService=require(_0x7fdc('0x10'));var logger=require('../../config/logger')(_0x7fdc('0x11'));var utils=require(_0x7fdc('0x12'));var config=require(_0x7fdc('0x13'));var licenseUtil=require(_0x7fdc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55bf06,_0x139478){_0x139478=_0x139478||0xcc;return function(_0x3933ab){if(_0x3933ab){return _0x55bf06[_0x7fdc('0x15')](_0x139478);}return _0x55bf06['status'](_0x139478)['end']();};}function respondWithResult(_0x572072,_0x7cea19){_0x7cea19=_0x7cea19||0xc8;return function(_0x19bf07){if(_0x19bf07){return _0x572072[_0x7fdc('0x16')](_0x7cea19)[_0x7fdc('0x17')](_0x19bf07);}};}function respondWithFilteredResult(_0x38829d,_0x3d7551){return function(_0x4ae97b){if(_0x4ae97b){var _0x563858=typeof _0x3d7551[_0x7fdc('0x18')]===_0x7fdc('0x19')&&typeof _0x3d7551[_0x7fdc('0x1a')]===_0x7fdc('0x19');var _0x584e87=_0x4ae97b[_0x7fdc('0x1b')];var _0x5e13e8=_0x563858?0x0:_0x3d7551['offset'];var _0x4fb115=_0x563858?_0x4ae97b[_0x7fdc('0x1b')]:_0x3d7551[_0x7fdc('0x18')]+_0x3d7551[_0x7fdc('0x1a')];var _0x4daceb;if(_0x4fb115>=_0x584e87){_0x4fb115=_0x584e87;_0x4daceb=0xc8;}else{_0x4daceb=0xce;}_0x38829d['status'](_0x4daceb);return _0x38829d['set']('Content-Range',_0x5e13e8+'-'+_0x4fb115+'/'+_0x584e87)[_0x7fdc('0x17')](_0x4ae97b);}return null;};}function patchUpdates(_0x345236){return function(_0x115088){try{jsonpatch[_0x7fdc('0x1c')](_0x115088,_0x345236,!![]);}catch(_0x4eec07){return BPromise[_0x7fdc('0x1d')](_0x4eec07);}return _0x115088[_0x7fdc('0x1e')]();};}function saveUpdates(_0x489d31,_0x488b98){return function(_0x584025){if(_0x584025){return _0x584025['update'](_0x489d31)[_0x7fdc('0x1f')](function(_0x895822){return _0x895822;});}return null;};}function removeEntity(_0x510b46,_0x868ca1){return function(_0x19d935){if(_0x19d935){return _0x19d935[_0x7fdc('0x20')]()[_0x7fdc('0x1f')](function(){_0x510b46[_0x7fdc('0x16')](0xcc)[_0x7fdc('0x21')]();});}};}function handleEntityNotFound(_0x19a688,_0x739496){return function(_0x563070){if(!_0x563070){_0x19a688[_0x7fdc('0x15')](0x194);}return _0x563070;};}function handleError(_0x4699b1,_0xe544cf){_0xe544cf=_0xe544cf||0x1f4;return function(_0x3fa469){logger[_0x7fdc('0x22')](_0x3fa469[_0x7fdc('0x23')]);if(_0x3fa469[_0x7fdc('0x24')]){delete _0x3fa469[_0x7fdc('0x24')];}_0x4699b1['status'](_0xe544cf)[_0x7fdc('0x25')](_0x3fa469);};}exports[_0x7fdc('0x26')]=function(_0xe6e832,_0x37d042){var _0x2e382d={},_0x39e7ed={},_0x1d12f9={'count':0x0,'rows':[]};var _0x52a581=_[_0x7fdc('0x27')](db[_0x7fdc('0x28')]['rawAttributes'],function(_0x347f5e){return{'name':_0x347f5e['fieldName'],'type':_0x347f5e[_0x7fdc('0x29')][_0x7fdc('0x2a')]};});_0x39e7ed[_0x7fdc('0x2b')]=_['map'](_0x52a581,_0x7fdc('0x24'));_0x39e7ed[_0x7fdc('0x2c')]=_[_0x7fdc('0x2d')](_0xe6e832[_0x7fdc('0x2c')]);_0x39e7ed[_0x7fdc('0x2e')]=_['intersection'](_0x39e7ed[_0x7fdc('0x2b')],_0x39e7ed[_0x7fdc('0x2c')]);_0x2e382d[_0x7fdc('0x2f')]=_[_0x7fdc('0x30')](_0x39e7ed[_0x7fdc('0x2b')],qs[_0x7fdc('0x31')](_0xe6e832[_0x7fdc('0x2c')]['fields']));_0x2e382d[_0x7fdc('0x2f')]=_0x2e382d[_0x7fdc('0x2f')]['length']?_0x2e382d[_0x7fdc('0x2f')]:_0x39e7ed[_0x7fdc('0x2b')];if(!_0xe6e832[_0x7fdc('0x2c')]['hasOwnProperty'](_0x7fdc('0x32'))){_0x2e382d[_0x7fdc('0x1a')]=qs['limit'](_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x1a')]);_0x2e382d['offset']=qs['offset'](_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x18')]);}_0x2e382d[_0x7fdc('0x33')]=qs[_0x7fdc('0x34')](_0xe6e832['query'][_0x7fdc('0x34')]);_0x2e382d[_0x7fdc('0x35')]=qs['filters'](_[_0x7fdc('0x36')](_0xe6e832['query'],_0x39e7ed[_0x7fdc('0x2e')]),_0x52a581);if(_0xe6e832['query'][_0x7fdc('0x37')]){_0x2e382d[_0x7fdc('0x35')]=_[_0x7fdc('0x38')](_0x2e382d['where'],{'$or':_[_0x7fdc('0x27')](_0x52a581,function(_0x41a3b3){if(_0x41a3b3[_0x7fdc('0x29')]!==_0x7fdc('0x39')){var _0x345263={};_0x345263[_0x41a3b3[_0x7fdc('0x24')]]={'$like':'%'+_0xe6e832['query'][_0x7fdc('0x37')]+'%'};return _0x345263;}})});}_0x2e382d=_['merge']({},_0x2e382d,_0xe6e832[_0x7fdc('0x3a')]);var _0x574df4={'where':_0x2e382d['where']};return db['SmsApplication'][_0x7fdc('0x1b')](_0x574df4)[_0x7fdc('0x1f')](function(_0x482699){_0x1d12f9[_0x7fdc('0x1b')]=_0x482699;if(_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x3b')]){_0x2e382d[_0x7fdc('0x3c')]=[{'all':!![]}];}return db[_0x7fdc('0x28')]['findAll'](_0x2e382d);})[_0x7fdc('0x1f')](function(_0x5cbdd4){_0x1d12f9[_0x7fdc('0x3d')]=_0x5cbdd4;return _0x1d12f9;})['then'](respondWithFilteredResult(_0x37d042,_0x2e382d))[_0x7fdc('0x3e')](handleError(_0x37d042,null));};exports['show']=function(_0x4224df,_0x3c7c0b){var _0x2e7d21={'raw':!![],'where':{'id':_0x4224df['params']['id']}},_0x70917c={};_0x70917c['model']=_[_0x7fdc('0x2d')](db['SmsApplication'][_0x7fdc('0x3f')]);_0x70917c[_0x7fdc('0x2c')]=_[_0x7fdc('0x2d')](_0x4224df[_0x7fdc('0x2c')]);_0x70917c['filters']=_['intersection'](_0x70917c['model'],_0x70917c[_0x7fdc('0x2c')]);_0x2e7d21[_0x7fdc('0x2f')]=_['intersection'](_0x70917c['model'],qs['fields'](_0x4224df[_0x7fdc('0x2c')]['fields']));_0x2e7d21[_0x7fdc('0x2f')]=_0x2e7d21[_0x7fdc('0x2f')][_0x7fdc('0x40')]?_0x2e7d21[_0x7fdc('0x2f')]:_0x70917c[_0x7fdc('0x2b')];if(_0x4224df[_0x7fdc('0x2c')][_0x7fdc('0x3b')]){_0x2e7d21[_0x7fdc('0x3c')]=[{'all':!![]}];}_0x2e7d21=_[_0x7fdc('0x38')]({},_0x2e7d21,_0x4224df[_0x7fdc('0x3a')]);return db[_0x7fdc('0x28')]['find'](_0x2e7d21)[_0x7fdc('0x1f')](handleEntityNotFound(_0x3c7c0b,null))[_0x7fdc('0x1f')](respondWithResult(_0x3c7c0b,null))[_0x7fdc('0x3e')](handleError(_0x3c7c0b,null));};exports[_0x7fdc('0x41')]=function(_0x3ba7eb,_0x1632aa){return db[_0x7fdc('0x28')]['create'](_0x3ba7eb[_0x7fdc('0x42')],{})[_0x7fdc('0x1f')](respondWithResult(_0x1632aa,0xc9))[_0x7fdc('0x3e')](handleError(_0x1632aa,null));};exports[_0x7fdc('0x43')]=function(_0x5b0994,_0x530941){if(_0x5b0994[_0x7fdc('0x42')]['id']){delete _0x5b0994[_0x7fdc('0x42')]['id'];}return db[_0x7fdc('0x28')][_0x7fdc('0x44')]({'where':{'id':_0x5b0994[_0x7fdc('0x45')]['id']}})[_0x7fdc('0x1f')](handleEntityNotFound(_0x530941,null))['then'](saveUpdates(_0x5b0994[_0x7fdc('0x42')],null))[_0x7fdc('0x1f')](respondWithResult(_0x530941,null))['catch'](handleError(_0x530941,null));};exports[_0x7fdc('0x20')]=function(_0x316d8c,_0x455236){return db[_0x7fdc('0x28')][_0x7fdc('0x44')]({'where':{'id':_0x316d8c[_0x7fdc('0x45')]['id']}})[_0x7fdc('0x1f')](handleEntityNotFound(_0x455236,null))[_0x7fdc('0x1f')](removeEntity(_0x455236,null))[_0x7fdc('0x3e')](handleError(_0x455236,null));}; \ No newline at end of file +var _0x6f49=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','destroy','then','stack','name','index','map','SmsApplication','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x6f49,0x113));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x96f4('0x0'));var rimraf=require(_0x96f4('0x1'));var zipdir=require(_0x96f4('0x2'));var jsonpatch=require(_0x96f4('0x3'));var rp=require(_0x96f4('0x4'));var moment=require(_0x96f4('0x5'));var BPromise=require(_0x96f4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x96f4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x96f4('0x8'));var fs=require('fs');var fs_extra=require(_0x96f4('0x9'));var _=require(_0x96f4('0xa'));var squel=require(_0x96f4('0xb'));var crypto=require('crypto');var jsforce=require(_0x96f4('0xc'));var deskjs=require(_0x96f4('0xd'));var toCsv=require(_0x96f4('0xe'));var querystring=require('querystring');var Papa=require(_0x96f4('0xf'));var Redis=require(_0x96f4('0x10'));var authService=require(_0x96f4('0x11'));var qs=require(_0x96f4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96f4('0x13'));var logger=require(_0x96f4('0x14'))('api');var utils=require(_0x96f4('0x15'));var config=require(_0x96f4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x96f4('0x17'))['db'];function respondWithStatusCode(_0x4e4570,_0xc29c0e){_0xc29c0e=_0xc29c0e||0xcc;return function(_0x3fb4d1){if(_0x3fb4d1){return _0x4e4570[_0x96f4('0x18')](_0xc29c0e);}return _0x4e4570['status'](_0xc29c0e)['end']();};}function respondWithResult(_0x4516b4,_0x3e3435){_0x3e3435=_0x3e3435||0xc8;return function(_0x2f2c3a){if(_0x2f2c3a){return _0x4516b4['status'](_0x3e3435)[_0x96f4('0x19')](_0x2f2c3a);}};}function respondWithFilteredResult(_0x5d82b1,_0x29bab1){return function(_0x2b170c){if(_0x2b170c){var _0x21af8c=typeof _0x29bab1[_0x96f4('0x1a')]===_0x96f4('0x1b')&&typeof _0x29bab1['limit']==='undefined';var _0x387f46=_0x2b170c[_0x96f4('0x1c')];var _0x394d16=_0x21af8c?0x0:_0x29bab1['offset'];var _0x113981=_0x21af8c?_0x2b170c[_0x96f4('0x1c')]:_0x29bab1[_0x96f4('0x1a')]+_0x29bab1[_0x96f4('0x1d')];var _0x571b59;if(_0x113981>=_0x387f46){_0x113981=_0x387f46;_0x571b59=0xc8;}else{_0x571b59=0xce;}_0x5d82b1[_0x96f4('0x1e')](_0x571b59);return _0x5d82b1[_0x96f4('0x1f')](_0x96f4('0x20'),_0x394d16+'-'+_0x113981+'/'+_0x387f46)[_0x96f4('0x19')](_0x2b170c);}return null;};}function patchUpdates(_0x19c132){return function(_0x20c164){try{jsonpatch['apply'](_0x20c164,_0x19c132,!![]);}catch(_0x112fc0){return BPromise[_0x96f4('0x21')](_0x112fc0);}return _0x20c164['save']();};}function saveUpdates(_0x4f68d5,_0x30de1a){return function(_0x3911c6){if(_0x3911c6){return _0x3911c6[_0x96f4('0x22')](_0x4f68d5)['then'](function(_0x185567){return _0x185567;});}return null;};}function removeEntity(_0xdc7d88,_0x5a2462){return function(_0x3f7661){if(_0x3f7661){return _0x3f7661[_0x96f4('0x23')]()[_0x96f4('0x24')](function(){_0xdc7d88[_0x96f4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1995e1,_0x594941){return function(_0x1f2db5){if(!_0x1f2db5){_0x1995e1[_0x96f4('0x18')](0x194);}return _0x1f2db5;};}function handleError(_0x34128d,_0x164fbf){_0x164fbf=_0x164fbf||0x1f4;return function(_0x1e2911){logger['error'](_0x1e2911[_0x96f4('0x25')]);if(_0x1e2911[_0x96f4('0x26')]){delete _0x1e2911[_0x96f4('0x26')];}_0x34128d['status'](_0x164fbf)['send'](_0x1e2911);};}exports[_0x96f4('0x27')]=function(_0x5a1c3b,_0x3903bc){var _0x2f81be={},_0x951baa={},_0x12167a={'count':0x0,'rows':[]};var _0x57cec0=_[_0x96f4('0x28')](db[_0x96f4('0x29')][_0x96f4('0x2a')],function(_0x21801d){return{'name':_0x21801d[_0x96f4('0x2b')],'type':_0x21801d['type'][_0x96f4('0x2c')]};});_0x951baa[_0x96f4('0x2d')]=_[_0x96f4('0x28')](_0x57cec0,_0x96f4('0x26'));_0x951baa['query']=_[_0x96f4('0x2e')](_0x5a1c3b['query']);_0x951baa[_0x96f4('0x2f')]=_[_0x96f4('0x30')](_0x951baa['model'],_0x951baa[_0x96f4('0x31')]);_0x2f81be[_0x96f4('0x32')]=_[_0x96f4('0x30')](_0x951baa[_0x96f4('0x2d')],qs[_0x96f4('0x33')](_0x5a1c3b[_0x96f4('0x31')][_0x96f4('0x33')]));_0x2f81be['attributes']=_0x2f81be['attributes'][_0x96f4('0x34')]?_0x2f81be['attributes']:_0x951baa[_0x96f4('0x2d')];if(!_0x5a1c3b[_0x96f4('0x31')]['hasOwnProperty'](_0x96f4('0x35'))){_0x2f81be[_0x96f4('0x1d')]=qs[_0x96f4('0x1d')](_0x5a1c3b[_0x96f4('0x31')][_0x96f4('0x1d')]);_0x2f81be['offset']=qs[_0x96f4('0x1a')](_0x5a1c3b[_0x96f4('0x31')][_0x96f4('0x1a')]);}_0x2f81be[_0x96f4('0x36')]=qs[_0x96f4('0x37')](_0x5a1c3b[_0x96f4('0x31')][_0x96f4('0x37')]);_0x2f81be[_0x96f4('0x38')]=qs[_0x96f4('0x2f')](_[_0x96f4('0x39')](_0x5a1c3b[_0x96f4('0x31')],_0x951baa[_0x96f4('0x2f')]),_0x57cec0);if(_0x5a1c3b[_0x96f4('0x31')][_0x96f4('0x3a')]){_0x2f81be[_0x96f4('0x38')]=_['merge'](_0x2f81be['where'],{'$or':_[_0x96f4('0x28')](_0x57cec0,function(_0x2176b1){if(_0x2176b1['type']!=='VIRTUAL'){var _0x38939a={};_0x38939a[_0x2176b1[_0x96f4('0x26')]]={'$like':'%'+_0x5a1c3b['query'][_0x96f4('0x3a')]+'%'};return _0x38939a;}})});}_0x2f81be=_[_0x96f4('0x3b')]({},_0x2f81be,_0x5a1c3b[_0x96f4('0x3c')]);var _0x417832={'where':_0x2f81be[_0x96f4('0x38')]};return db[_0x96f4('0x29')][_0x96f4('0x1c')](_0x417832)['then'](function(_0x5dd116){_0x12167a['count']=_0x5dd116;if(_0x5a1c3b['query'][_0x96f4('0x3d')]){_0x2f81be[_0x96f4('0x3e')]=[{'all':!![]}];}return db[_0x96f4('0x29')][_0x96f4('0x3f')](_0x2f81be);})[_0x96f4('0x24')](function(_0x393d9b){_0x12167a[_0x96f4('0x40')]=_0x393d9b;return _0x12167a;})['then'](respondWithFilteredResult(_0x3903bc,_0x2f81be))[_0x96f4('0x41')](handleError(_0x3903bc,null));};exports[_0x96f4('0x42')]=function(_0x972d9d,_0x529755){var _0x543b9e={'raw':!![],'where':{'id':_0x972d9d['params']['id']}},_0x195d28={};_0x195d28[_0x96f4('0x2d')]=_[_0x96f4('0x2e')](db[_0x96f4('0x29')][_0x96f4('0x2a')]);_0x195d28[_0x96f4('0x31')]=_[_0x96f4('0x2e')](_0x972d9d[_0x96f4('0x31')]);_0x195d28['filters']=_['intersection'](_0x195d28[_0x96f4('0x2d')],_0x195d28['query']);_0x543b9e[_0x96f4('0x32')]=_[_0x96f4('0x30')](_0x195d28[_0x96f4('0x2d')],qs['fields'](_0x972d9d[_0x96f4('0x31')][_0x96f4('0x33')]));_0x543b9e['attributes']=_0x543b9e[_0x96f4('0x32')][_0x96f4('0x34')]?_0x543b9e[_0x96f4('0x32')]:_0x195d28['model'];if(_0x972d9d['query'][_0x96f4('0x3d')]){_0x543b9e[_0x96f4('0x3e')]=[{'all':!![]}];}_0x543b9e=_[_0x96f4('0x3b')]({},_0x543b9e,_0x972d9d[_0x96f4('0x3c')]);return db[_0x96f4('0x29')][_0x96f4('0x43')](_0x543b9e)['then'](handleEntityNotFound(_0x529755,null))[_0x96f4('0x24')](respondWithResult(_0x529755,null))['catch'](handleError(_0x529755,null));};exports[_0x96f4('0x44')]=function(_0x4dd3c9,_0x5542f3){return db[_0x96f4('0x29')][_0x96f4('0x44')](_0x4dd3c9[_0x96f4('0x45')],{})[_0x96f4('0x24')](respondWithResult(_0x5542f3,0xc9))[_0x96f4('0x41')](handleError(_0x5542f3,null));};exports['update']=function(_0x48a910,_0x308572){if(_0x48a910[_0x96f4('0x45')]['id']){delete _0x48a910[_0x96f4('0x45')]['id'];}return db[_0x96f4('0x29')]['find']({'where':{'id':_0x48a910[_0x96f4('0x46')]['id']}})[_0x96f4('0x24')](handleEntityNotFound(_0x308572,null))[_0x96f4('0x24')](saveUpdates(_0x48a910[_0x96f4('0x45')],null))[_0x96f4('0x24')](respondWithResult(_0x308572,null))[_0x96f4('0x41')](handleError(_0x308572,null));};exports[_0x96f4('0x23')]=function(_0x2c078d,_0x5c952c){return db[_0x96f4('0x29')][_0x96f4('0x43')]({'where':{'id':_0x2c078d[_0x96f4('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c952c,null))[_0x96f4('0x24')](removeEntity(_0x5c952c,null))[_0x96f4('0x41')](handleError(_0x5c952c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ff503f8..aab8deb 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 _0x8f18=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','utf8mb4'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8f18,0x1ea));var _0x88f1=function(_0x3845bb,_0x2d432c){_0x3845bb=_0x3845bb-0x0;var _0x43d93b=_0x8f18[_0x3845bb];return _0x43d93b;};'use strict';var _=require(_0x88f1('0x0'));var util=require(_0x88f1('0x1'));var logger=require(_0x88f1('0x2'))(_0x88f1('0x3'));var moment=require(_0x88f1('0x4'));var BPromise=require(_0x88f1('0x5'));var rp=require(_0x88f1('0x6'));var fs=require('fs');var path=require(_0x88f1('0x7'));var rimraf=require(_0x88f1('0x8'));var config=require(_0x88f1('0x9'));var attributes=require('./smsApplication.attributes');module[_0x88f1('0xa')]=function(_0x55d3c6,_0x3a38ae){return _0x55d3c6[_0x88f1('0xb')](_0x88f1('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88f1('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7061=['SmsApplication','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x204e7d,_0x12e58d){var _0x3c62cf=function(_0x335e2e){while(--_0x335e2e){_0x204e7d['push'](_0x204e7d['shift']());}};_0x3c62cf(++_0x12e58d);}(_0x7061,0x12e));var _0x1706=function(_0xd1680,_0x319ba2){_0xd1680=_0xd1680-0x0;var _0x209a04=_0x7061[_0xd1680];return _0x209a04;};'use strict';var _=require(_0x1706('0x0'));var util=require(_0x1706('0x1'));var logger=require('../../config/logger')(_0x1706('0x2'));var moment=require(_0x1706('0x3'));var BPromise=require(_0x1706('0x4'));var rp=require(_0x1706('0x5'));var fs=require('fs');var path=require(_0x1706('0x6'));var rimraf=require(_0x1706('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x1706('0x8')]=function(_0x3423e3,_0x1b00ad){return _0x3423e3[_0x1706('0x9')](_0x1706('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1706('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 7673c20..fb058fa 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 _0x7804=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x1b7915,_0x2d6a3f){var _0x480d41=function(_0xd4f568){while(--_0xd4f568){_0x1b7915['push'](_0x1b7915['shift']());}};_0x480d41(++_0x2d6a3f);}(_0x7804,0xc3));var _0x4780=function(_0x10885d,_0x5baa0a){_0x10885d=_0x10885d-0x0;var _0x99235c=_0x7804[_0x10885d];return _0x99235c;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36df6b,_0x9cd1a1,_0x19356d){return new BPromise(function(_0x5dbc26,_0x2ba140){return client['request'](_0x36df6b,_0x19356d)['then'](function(_0x299992){logger[_0x4780('0x8')](_0x4780('0x9'),_0x9cd1a1,_0x4780('0xa'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'),JSON[_0x4780('0xb')](_0x299992));if(_0x299992[_0x4780('0xc')]){if(_0x299992['error']['code']===0x1f4){logger[_0x4780('0xc')](_0x4780('0x9'),_0x9cd1a1,_0x299992[_0x4780('0xc')][_0x4780('0xd')]);return _0x2ba140(_0x299992[_0x4780('0xc')]['message']);}logger['error'](_0x4780('0x9'),_0x9cd1a1,_0x299992['error'][_0x4780('0xd')]);return _0x5dbc26(_0x299992[_0x4780('0xc')][_0x4780('0xd')]);}else{logger[_0x4780('0x8')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'));_0x5dbc26(_0x299992['result'][_0x4780('0xd')]);}})[_0x4780('0xe')](function(_0x522b0f){logger[_0x4780('0xc')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x522b0f);_0x2ba140(_0x522b0f);});});} \ No newline at end of file +var _0x20d8=['stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0xd09248,_0x256d66){var _0x416fbe=function(_0x12f8c0){while(--_0x12f8c0){_0xd09248['push'](_0xd09248['shift']());}};_0x416fbe(++_0x256d66);}(_0x20d8,0xee));var _0x820d=function(_0x4ce3a4,_0x3d5950){_0x4ce3a4=_0x4ce3a4-0x0;var _0x199899=_0x20d8[_0x4ce3a4];return _0x199899;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('SmsApplication,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c4b99c7..380cc23 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 _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x5b5a8b,_0xbc5edc){var _0x33e7ce=function(_0x2d5a87){while(--_0x2d5a87){_0x5b5a8b['push'](_0x5b5a8b['shift']());}};_0x33e7ce(++_0xbc5edc);}(_0x0972,0x64));var _0x2097=function(_0x36b6b3,_0x576d07){_0x36b6b3=_0x36b6b3-0x0;var _0x53bc89=_0x0972[_0x36b6b3];return _0x53bc89;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file +var _0xb7e7=['download','post','create','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb7e7[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router[_0x7b7e('0x12')]('/:id/messages',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x17')),controller[_0x7b7e('0x18')]);router[_0x7b7e('0x19')](_0x7b7e('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x7b7e('0x16'),_0x7b7e('0x1a')),controller[_0x7b7e('0x1b')]);router[_0x7b7e('0x1c')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),interaction[_0x7b7e('0x1d')](_0x7b7e('0x16'),_0x7b7e('0x1e')),controller[_0x7b7e('0x1f')]);router[_0x7b7e('0x1c')](_0x7b7e('0x15'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x20')]);module[_0x7b7e('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 47ec9c7..57b68a8 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 _0x972c=['ENUM','out','exports','BOOLEAN','STRING','DATE'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x972c,0xf2));var _0xc972=function(_0x26eab2,_0xf2f9db){_0x26eab2=_0x26eab2-0x0;var _0x5953b9=_0x972c[_0x26eab2];return _0x5953b9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc972('0x0')]={'closed':{'type':Sequelize[_0xc972('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc972('0x2')]},'secondDisposition':{'type':Sequelize[_0xc972('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc972('0x2')]},'read1stAt':{'type':Sequelize[_0xc972('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc972('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc972('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc972('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc972('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xf2ca=['out','BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x45e7ca,_0x18a786){var _0x306d06=function(_0x355d91){while(--_0x355d91){_0x45e7ca['push'](_0x45e7ca['shift']());}};_0x306d06(++_0x18a786);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0xf2ca[_0x1c3370];return _0xa9b358;};'use strict';var Sequelize=require(_0xaf2c('0x0'));var moment=require(_0xaf2c('0x1'));module[_0xaf2c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaf2c('0x3')]},'disposition':{'type':Sequelize[_0xaf2c('0x4')]},'secondDisposition':{'type':Sequelize[_0xaf2c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xaf2c('0x4')]},'note':{'type':Sequelize[_0xaf2c('0x4')]},'phone':{'type':Sequelize[_0xaf2c('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xaf2c('0x5')]('in',_0xaf2c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaf2c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xaf2c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xaf2c('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 49f4e4b..1bd8065 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 _0x88dc=['filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','catch','body','describe','addMessage','ids','omit','getMessages','findOne','keys','SmsMessage','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','map','$gte','split','format','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closed','YYYY-MM-DD\x20HH:mm:ss','out','Contact','firstName','lastName','value','root','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','getOptions','findAll','sms','query','show','params','model','SmsInteraction'];(function(_0x498af6,_0x3e0604){var _0x24a2b0=function(_0x5051ce){while(--_0x5051ce){_0x498af6['push'](_0x498af6['shift']());}};_0x24a2b0(++_0x3e0604);}(_0x88dc,0x140));var _0xc88d=function(_0x4380e0,_0x5db637){_0x4380e0=_0x4380e0-0x0;var _0x5baf3a=_0x88dc[_0x4380e0];return _0x5baf3a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc88d('0x0'));var moment=require(_0xc88d('0x1'));var BPromise=require(_0xc88d('0x2'));var util=require('util');var path=require(_0xc88d('0x3'));var ejs=require(_0xc88d('0x4'));var fs=require('fs');var _=require(_0xc88d('0x5'));var Redis=require(_0xc88d('0x6'));var interaction=require(_0xc88d('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc88d('0x8'));var logger=require('../../config/logger')(_0xc88d('0x9'));var config=require(_0xc88d('0xa'));var db=require(_0xc88d('0xb'))['db'];config[_0xc88d('0xc')]=_[_0xc88d('0xd')](config[_0xc88d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc88d('0xc')]));require(_0xc88d('0xe'))[_0xc88d('0xf')](socket);function respondWithStatusCode(_0x1b5a44,_0x9d81d7){_0x9d81d7=_0x9d81d7||0xcc;return function(_0x554a84){if(_0x554a84){return _0x1b5a44[_0xc88d('0x10')](_0x9d81d7);}return _0x1b5a44[_0xc88d('0x11')](_0x9d81d7)['end']();};}function respondWithResult(_0x5f39c9,_0x314827){_0x314827=_0x314827||0xc8;return function(_0x3f06b1){if(_0x3f06b1){return _0x5f39c9[_0xc88d('0x11')](_0x314827)[_0xc88d('0x12')](_0x3f06b1);}};}function respondWithFilteredResult(_0x597a0f,_0x404512){return function(_0x1fcc79){if(_0x1fcc79){var _0x3898af=typeof _0x404512[_0xc88d('0x13')]===_0xc88d('0x14')&&typeof _0x404512['limit']===_0xc88d('0x14');var _0x2668b5=_0x1fcc79[_0xc88d('0x15')];var _0x597c83=_0x3898af?0x0:_0x404512[_0xc88d('0x13')];var _0xddbb94=_0x3898af?_0x1fcc79[_0xc88d('0x15')]:_0x404512['offset']+_0x404512[_0xc88d('0x16')];var _0x4e3df7;if(_0xddbb94>=_0x2668b5){_0xddbb94=_0x2668b5;_0x4e3df7=0xc8;}else{_0x4e3df7=0xce;}_0x597a0f[_0xc88d('0x11')](_0x4e3df7);return _0x597a0f[_0xc88d('0x17')](_0xc88d('0x18'),_0x597c83+'-'+_0xddbb94+'/'+_0x2668b5)['json'](_0x1fcc79);}return null;};}function saveUpdates(_0x5c9249){return function(_0xd8c74b){if(_0xd8c74b){return _0xd8c74b[_0xc88d('0x19')](_0x5c9249)[_0xc88d('0x1a')](function(_0x303dae){return _0x303dae;});}return null;};}function removeEntity(_0x519813){return function(_0x13feb0){if(_0x13feb0){return _0x13feb0[_0xc88d('0x1b')]()['then'](function(){_0x519813[_0xc88d('0x11')](0xcc)[_0xc88d('0x1c')]();});}};}function handleEntityNotFound(_0x20eef1){return function(_0x484459){if(!_0x484459){_0x20eef1[_0xc88d('0x10')](0x194);}return _0x484459;};}function handleError(_0x36c7f0,_0x448fb6){_0x448fb6=_0x448fb6||0x1f4;return function(_0x4a581c){logger[_0xc88d('0x1d')](_0x4a581c[_0xc88d('0x1e')]);if(_0x4a581c[_0xc88d('0x1f')]){delete _0x4a581c[_0xc88d('0x1f')];}_0x36c7f0['status'](_0x448fb6)[_0xc88d('0x20')](_0x4a581c);};}exports['index']=function(_0x2dbc0d,_0x55c7ab){var _0x424c84={};var _0x41b7f2=_['map'](db['SmsInteraction'][_0xc88d('0x21')],function(_0x3749db){return{'name':_0x3749db[_0xc88d('0x22')],'type':_0x3749db['type']['key']};});_0x424c84=qs[_0xc88d('0x23')](_0x41b7f2,_0x2dbc0d);return interaction[_0xc88d('0x24')](_0xc88d('0x25'),_0x2dbc0d[_0xc88d('0x26')],_0x2dbc0d['user'],_0x424c84,_0x41b7f2)[_0xc88d('0x1a')](respondWithFilteredResult(_0x55c7ab,_0x424c84))['catch'](handleError(_0x55c7ab,null));};exports[_0xc88d('0x27')]=function(_0x513a81,_0x41ee6f){var _0x435e61={'raw':![],'where':{'id':_0x513a81[_0xc88d('0x28')]['id']}},_0xa6d164={};_0xa6d164[_0xc88d('0x29')]=_['keys'](db[_0xc88d('0x2a')][_0xc88d('0x21')]);_0xa6d164[_0xc88d('0x26')]=_['keys'](_0x513a81[_0xc88d('0x26')]);_0xa6d164[_0xc88d('0x2b')]=_[_0xc88d('0x2c')](_0xa6d164[_0xc88d('0x29')],_0xa6d164['query']);_0x435e61[_0xc88d('0x2d')]=_[_0xc88d('0x2c')](_0xa6d164[_0xc88d('0x29')],qs['fields'](_0x513a81['query'][_0xc88d('0x2e')]));_0x435e61[_0xc88d('0x2d')]=_0x435e61[_0xc88d('0x2d')][_0xc88d('0x2f')]?_0x435e61['attributes']:_0xa6d164['model'];if(_0x513a81[_0xc88d('0x26')][_0xc88d('0x30')]){_0x435e61[_0xc88d('0x31')]=[{'all':!![]}];}_0x435e61=_[_0xc88d('0x32')]({},_0x435e61,_0x513a81[_0xc88d('0x33')]);return db['SmsInteraction'][_0xc88d('0x34')](_0x435e61)[_0xc88d('0x1a')](handleEntityNotFound(_0x41ee6f,null))[_0xc88d('0x1a')](respondWithResult(_0x41ee6f,null))['catch'](handleError(_0x41ee6f,null));};exports[_0xc88d('0x35')]=function(_0x44bec6,_0x430bba){return db['SmsInteraction'][_0xc88d('0x35')](_0x44bec6['body'],{})['then'](respondWithResult(_0x430bba,0xc9))[_0xc88d('0x36')](handleError(_0x430bba,null));};exports[_0xc88d('0x19')]=function(_0xca67e9,_0x5efe06){if(_0xca67e9[_0xc88d('0x37')]['id']){delete _0xca67e9[_0xc88d('0x37')]['id'];}return db[_0xc88d('0x2a')][_0xc88d('0x34')]({'where':{'id':_0xca67e9['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x5efe06,null))[_0xc88d('0x1a')](saveUpdates(_0xca67e9[_0xc88d('0x37')],null))[_0xc88d('0x1a')](respondWithResult(_0x5efe06,null))[_0xc88d('0x36')](handleError(_0x5efe06,null));};exports['destroy']=function(_0x421bce,_0x3f7515){return db[_0xc88d('0x2a')][_0xc88d('0x34')]({'where':{'id':_0x421bce[_0xc88d('0x28')]['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x3f7515,null))['then'](removeEntity(_0x3f7515,null))[_0xc88d('0x36')](handleError(_0x3f7515,null));};exports[_0xc88d('0x38')]=function(_0x21403a,_0x5a050a){return db[_0xc88d('0x2a')][_0xc88d('0x38')]()[_0xc88d('0x1a')](respondWithResult(_0x5a050a,null))[_0xc88d('0x36')](handleError(_0x5a050a,null));};exports['addMessage']=function(_0x556b3d,_0x1a775c){return db['SmsMessage'][_0xc88d('0x34')]({'where':{'id':_0x556b3d[_0xc88d('0x28')]['id']}})['then'](handleEntityNotFound(_0x1a775c,null))[_0xc88d('0x1a')](function(_0x21cccd){if(_0x21cccd){return _0x21cccd[_0xc88d('0x39')](_0x556b3d[_0xc88d('0x37')][_0xc88d('0x3a')],_[_0xc88d('0x3b')](_0x556b3d[_0xc88d('0x37')],[_0xc88d('0x3a'),'id'])||{});}})[_0xc88d('0x1a')](respondWithResult(_0x1a775c,null))['catch'](handleError(_0x1a775c,null));};exports[_0xc88d('0x3c')]=function(_0x1cbef0,_0x4c7b8c){var _0x404cab={'raw':![],'where':{}};var _0x2649d9={};var _0x4e0653={'count':0x0,'rows':[]};return db[_0xc88d('0x2a')][_0xc88d('0x3d')]({'where':{'id':_0x1cbef0[_0xc88d('0x28')]['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x4c7b8c,null))[_0xc88d('0x1a')](function(_0x2e0a5d){if(_0x2e0a5d){_0x2649d9[_0xc88d('0x29')]=_[_0xc88d('0x3e')](db[_0xc88d('0x3f')][_0xc88d('0x21')]);_0x2649d9[_0xc88d('0x26')]=_['keys'](_0x1cbef0['query']);_0x2649d9[_0xc88d('0x2b')]=_[_0xc88d('0x2c')](_0x2649d9[_0xc88d('0x29')],_0x2649d9[_0xc88d('0x26')]);_0x404cab[_0xc88d('0x2d')]=_[_0xc88d('0x2c')](_0x2649d9[_0xc88d('0x29')],qs[_0xc88d('0x2e')](_0x1cbef0[_0xc88d('0x26')]['fields']));_0x404cab['attributes']=_0x404cab['attributes'][_0xc88d('0x2f')]?_0x404cab[_0xc88d('0x2d')]:_0x2649d9[_0xc88d('0x29')];if(!_0x1cbef0['query'][_0xc88d('0x40')]('nolimit')){_0x404cab[_0xc88d('0x16')]=qs['limit'](_0x1cbef0[_0xc88d('0x26')]['limit']);_0x404cab[_0xc88d('0x13')]=qs['offset'](_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x13')]);}_0x404cab[_0xc88d('0x41')]=qs[_0xc88d('0x42')](_0x1cbef0['query'][_0xc88d('0x42')]);_0x404cab[_0xc88d('0x43')]=qs[_0xc88d('0x2b')](_[_0xc88d('0x44')](_0x1cbef0[_0xc88d('0x26')],_0x2649d9['filters']));_0x404cab[_0xc88d('0x43')][_0xc88d('0x45')]=_0x2e0a5d['id'];if(_0x1cbef0['query'][_0xc88d('0x46')]){_0x404cab['where']=_[_0xc88d('0x32')](_0x404cab[_0xc88d('0x43')],{'$or':_[_0xc88d('0x47')](_0x404cab['attributes'],function(_0x403f21){var _0x1ee011={};_0x1ee011[_0x403f21]={'$like':'%'+_0x1cbef0[_0xc88d('0x26')]['filter']+'%'};return _0x1ee011;})});}if(_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x48')]){var _0x5f3f8b=_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x48')][_0xc88d('0x49')](',');var _0xf3e86d={};_0xf3e86d[_0x5f3f8b[0x0]]={'$gte':moment(_0x5f3f8b[0x1])[_0xc88d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x404cab[_0xc88d('0x43')]=_['merge'](_0x404cab[_0xc88d('0x43')],_0xf3e86d);}_0x404cab=_[_0xc88d('0x32')]({},_0x404cab,_0x1cbef0[_0xc88d('0x33')]);return db[_0xc88d('0x3f')]['count']({'where':_0x404cab[_0xc88d('0x43')]})['then'](function(_0x38a6c8){_0x4e0653['count']=_0x38a6c8;if(_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x30')]){_0x404cab['include']=[{'all':!![]}];}return db['SmsMessage'][_0xc88d('0x24')](_0x404cab);})['then'](function(_0x1060c6){_0x4e0653['rows']=_0x1060c6;return _0x4e0653;});}})['then'](respondWithFilteredResult(_0x4c7b8c,_0x404cab))['catch'](handleError(_0x4c7b8c,null));};exports[_0xc88d('0x4b')]=function(_0x45c717,_0x40aa00){return db[_0xc88d('0x2a')]['find']({'where':{'id':_0x45c717['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x40aa00,null))[_0xc88d('0x1a')](function(_0xf520ea){if(_0xf520ea){return _0xf520ea[_0xc88d('0x4c')](_0x45c717[_0xc88d('0x37')][_0xc88d('0x3a')],_[_0xc88d('0x3b')](_0x45c717['body'],[_0xc88d('0x3a'),'id'])||{})[_0xc88d('0x4d')](function(){return db[_0xc88d('0x4e')]['findAll']({'attributes':['id',_0xc88d('0x1f'),_0xc88d('0x4f')],'where':{'id':_0x45c717['body'][_0xc88d('0x3a')]}});})[_0xc88d('0x1a')](function(_0x3bc098){socket[_0xc88d('0x50')](_0xc88d('0x51'),{'id':Number(_0x45c717['params']['id']),'tags':_0x3bc098||[]});return{'id':Number(_0x45c717[_0xc88d('0x28')]['id']),'tags':_0x3bc098||[]};});}})[_0xc88d('0x1a')](respondWithResult(_0x40aa00,null))[_0xc88d('0x36')](handleError(_0x40aa00,null));};exports[_0xc88d('0x52')]=function(_0x4c64fe,_0x3b5ece){return db['SmsInteraction'][_0xc88d('0x34')]({'where':{'id':_0x4c64fe['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x3b5ece,null))[_0xc88d('0x1a')](function(_0x51071a){if(_0x51071a){return _0x51071a[_0xc88d('0x52')](_0x4c64fe[_0xc88d('0x26')]['ids']);}})[_0xc88d('0x1a')](respondWithStatusCode(_0x3b5ece,null))[_0xc88d('0x36')](handleError(_0x3b5ece,null));};exports[_0xc88d('0x53')]=function(_0x49e4df,_0x454fdf){var _0x78a782=moment()[_0xc88d('0x54')]()[_0xc88d('0x55')]();var _0x210232=path[_0xc88d('0x56')](config['root'],_0xc88d('0x57'),'files',_0xc88d('0x58'));var _0x2f5ff7=path[_0xc88d('0x56')](_0x210232,_0x78a782);var _0xf7aa5f=util['format'](_0xc88d('0x59'),_0x49e4df[_0xc88d('0x28')]['id'],_0x78a782);var _0x14866f=path[_0xc88d('0x56')](_0x210232,_0xf7aa5f);var _0x2b0d5e=[];_0x2b0d5e[_0xc88d('0x5a')]({'model':db[_0xc88d('0x5b')],'as':_0xc88d('0x5b'),'attributes':['id',_0xc88d('0x5c')],'raw':!![]});_0x2b0d5e['push']({'model':db[_0xc88d('0x5d')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x5f92ba=[{'model':db[_0xc88d('0x3f')],'as':_0xc88d('0x5e'),'attributes':['id',_0xc88d('0x37'),_0xc88d('0x5f'),_0xc88d('0x60'),_0xc88d('0x61'),_0xc88d('0x62')],'include':_0x2b0d5e}];_0x5f92ba[_0xc88d('0x5a')]({'model':db[_0xc88d('0x63')],'as':'Account','attributes':['id',_0xc88d('0x1f')]});_0x5f92ba[_0xc88d('0x5a')]({'model':db[_0xc88d('0x5b')],'as':_0xc88d('0x64'),'attributes':['id','fullname']});return db[_0xc88d('0x2a')]['find']({'where':{'id':_0x49e4df[_0xc88d('0x28')]['id']},'include':_0x5f92ba})[_0xc88d('0x1a')](handleEntityNotFound(_0x454fdf,null))[_0xc88d('0x1a')](function(_0x590da3){if(_0x590da3){var _0x3ad20f=_0x590da3[_0xc88d('0x65')]({'plain':!![]});fs[_0xc88d('0x66')](_0x2f5ff7);var _0x2fb6bc={'channel':'Sms','account':_0x3ad20f[_0xc88d('0x67')]['name'],'agent':_0x3ad20f[_0xc88d('0x64')]?_0x3ad20f[_0xc88d('0x64')][_0xc88d('0x5c')]:_0xc88d('0x68'),'createdAt':moment(_0x3ad20f[_0xc88d('0x5f')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc88d('0x55')](),'closedAt':_0x3ad20f[_0xc88d('0x69')]?moment(_0x3ad20f['closedAt'])[_0xc88d('0x4a')](_0xc88d('0x6a'))[_0xc88d('0x55')]():'','disposition':_0x3ad20f['disposition'],'messages':_(_0x3ad20f[_0xc88d('0x5e')])[_0xc88d('0x46')]({'secret':![]})[_0xc88d('0x47')](function(_0x3b6a20){return{'date':moment(_0x3b6a20[_0xc88d('0x5f')])[_0xc88d('0x4a')](_0xc88d('0x6a'))[_0xc88d('0x55')](),'sender':_0x3b6a20[_0xc88d('0x60')]===_0xc88d('0x6b')?_0x3b6a20[_0xc88d('0x5b')]?_0x3b6a20[_0xc88d('0x5b')][_0xc88d('0x5c')]:'System':_0x3b6a20[_0xc88d('0x6c')][_0xc88d('0x6d')]+(_0x3b6a20['Contact'][_0xc88d('0x6e')]?'\x20'+_0x3b6a20[_0xc88d('0x6c')][_0xc88d('0x6e')]:''),'body':_0x3b6a20[_0xc88d('0x37')],'direction':_0x3b6a20[_0xc88d('0x60')]===_0xc88d('0x6b')?'A':'C','secret':_0x3b6a20[_0xc88d('0x61')],'read':_0x3b6a20['read']};})[_0xc88d('0x6f')]()};return ejs['renderFile'](path[_0xc88d('0x56')](config[_0xc88d('0x70')],_0xc88d('0x57'),'views',_0xc88d('0x71')),{'interaction':_0x2fb6bc})['then'](function(_0x1d3822){var _0x5ac8d6=path[_0xc88d('0x56')](_0x2f5ff7,_0xc88d('0x72')+_0x3ad20f['id']+'-'+_0x78a782+_0xc88d('0x73'));var _0x1d95fa={'path':_0x5ac8d6,'channel':_0xc88d('0x74'),'interactionId':_0x3ad20f['id']};return pdf[_0xc88d('0x75')](_0x1d3822,_0x1d95fa);})['then'](function(){return new BPromise(function(_0x12eda3,_0x54f562){zipdir(_0x2f5ff7,{'saveTo':_0x14866f},function(_0xd590d4,_0x15ce4e){if(_0xd590d4)return _0x54f562(_0xd590d4);return _0x12eda3(_0x15ce4e);});})[_0xc88d('0x1a')](function(){return new BPromise(function(_0x49b26a,_0x2809d8){rimraf(_0x2f5ff7,function(_0x5991b4){if(_0x5991b4)_0x2809d8(_0x5991b4);return _0x49b26a();});});})[_0xc88d('0x1a')](function(){return _0x454fdf[_0xc88d('0x53')](_0x14866f,_0xf7aa5f,function(_0x4cb51e){if(_0x4cb51e){console[_0xc88d('0x76')](_0xc88d('0x77'),_0x4cb51e);}else{fs[_0xc88d('0x78')](_0x14866f);}});});});}else{return _0x454fdf[_0xc88d('0x10')](0xc8);}})['catch'](handleError(_0x454fdf,null));}; \ No newline at end of file +var _0x720e=['download','toString','join','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','direction','secret','read','Account','Owner','get','Sms','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','out','System','Contact','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','map','SmsInteraction','fieldName','type','key','findAll','sms','catch','show','params','model','keys','rawAttributes','query','filters','intersection','fields','length','include','merge','options','find','create','body','describe','SmsMessage','addMessage','attributes','order','sort','where','SmsInteractionId','filter','$gte','format','rows','setTags','omit','ids','spread','Tag','color','emit','smsInteractionTags:save','removeTags'];(function(_0x50e650,_0xc514f5){var _0x3af3be=function(_0x19f2c6){while(--_0x19f2c6){_0x50e650['push'](_0x50e650['shift']());}};_0x3af3be(++_0xc514f5);}(_0x720e,0x18c));var _0xe720=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x720e[_0x21b74b];return _0x518cc6;};'use strict';var rimraf=require(_0xe720('0x0'));var zipdir=require(_0xe720('0x1'));var moment=require(_0xe720('0x2'));var BPromise=require(_0xe720('0x3'));var util=require(_0xe720('0x4'));var path=require(_0xe720('0x5'));var ejs=require(_0xe720('0x6'));var fs=require('fs');var _=require(_0xe720('0x7'));var Redis=require(_0xe720('0x8'));var interaction=require(_0xe720('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0xe720('0xa'));var logger=require(_0xe720('0xb'))('api');var config=require(_0xe720('0xc'));var db=require('../../mysqldb')['db'];config[_0xe720('0xd')]=_[_0xe720('0xe')](config[_0xe720('0xd')],{'host':_0xe720('0xf'),'port':0x18eb});var socket=require(_0xe720('0x10'))(new Redis(config['redis']));require(_0xe720('0x11'))[_0xe720('0x12')](socket);function respondWithStatusCode(_0x9d2a8c,_0x31c2da){_0x31c2da=_0x31c2da||0xcc;return function(_0x5cf3ec){if(_0x5cf3ec){return _0x9d2a8c['sendStatus'](_0x31c2da);}return _0x9d2a8c[_0xe720('0x13')](_0x31c2da)[_0xe720('0x14')]();};}function respondWithResult(_0x441232,_0x4fef87){_0x4fef87=_0x4fef87||0xc8;return function(_0x4dacc9){if(_0x4dacc9){return _0x441232[_0xe720('0x13')](_0x4fef87)[_0xe720('0x15')](_0x4dacc9);}};}function respondWithFilteredResult(_0x1c2022,_0x49f4d8){return function(_0x5ef42b){if(_0x5ef42b){var _0x2999ec=typeof _0x49f4d8[_0xe720('0x16')]===_0xe720('0x17')&&typeof _0x49f4d8[_0xe720('0x18')]===_0xe720('0x17');var _0x24ea59=_0x5ef42b[_0xe720('0x19')];var _0x4f9340=_0x2999ec?0x0:_0x49f4d8[_0xe720('0x16')];var _0x55a3ab=_0x2999ec?_0x5ef42b[_0xe720('0x19')]:_0x49f4d8[_0xe720('0x16')]+_0x49f4d8[_0xe720('0x18')];var _0x4e4c90;if(_0x55a3ab>=_0x24ea59){_0x55a3ab=_0x24ea59;_0x4e4c90=0xc8;}else{_0x4e4c90=0xce;}_0x1c2022[_0xe720('0x13')](_0x4e4c90);return _0x1c2022['set'](_0xe720('0x1a'),_0x4f9340+'-'+_0x55a3ab+'/'+_0x24ea59)[_0xe720('0x15')](_0x5ef42b);}return null;};}function saveUpdates(_0x199567){return function(_0x29ee94){if(_0x29ee94){return _0x29ee94[_0xe720('0x1b')](_0x199567)[_0xe720('0x1c')](function(_0x46cbc6){return _0x46cbc6;});}return null;};}function removeEntity(_0x1b9f84){return function(_0x3b3ead){if(_0x3b3ead){return _0x3b3ead[_0xe720('0x1d')]()[_0xe720('0x1c')](function(){_0x1b9f84['status'](0xcc)[_0xe720('0x14')]();});}};}function handleEntityNotFound(_0x1a81d2){return function(_0xbdbb05){if(!_0xbdbb05){_0x1a81d2[_0xe720('0x1e')](0x194);}return _0xbdbb05;};}function handleError(_0x478d8b,_0x423a75){_0x423a75=_0x423a75||0x1f4;return function(_0x29b3c7){logger[_0xe720('0x1f')](_0x29b3c7[_0xe720('0x20')]);if(_0x29b3c7['name']){delete _0x29b3c7[_0xe720('0x21')];}_0x478d8b[_0xe720('0x13')](_0x423a75)[_0xe720('0x22')](_0x29b3c7);};}exports['index']=function(_0x3f5a8c,_0x22c8c1){var _0x2eabb6={};var _0x39b925=_[_0xe720('0x23')](db[_0xe720('0x24')]['rawAttributes'],function(_0xc501bf){return{'name':_0xc501bf[_0xe720('0x25')],'type':_0xc501bf[_0xe720('0x26')][_0xe720('0x27')]};});_0x2eabb6=qs['getOptions'](_0x39b925,_0x3f5a8c);return interaction[_0xe720('0x28')](_0xe720('0x29'),_0x3f5a8c['query'],_0x3f5a8c['user'],_0x2eabb6,_0x39b925)[_0xe720('0x1c')](respondWithFilteredResult(_0x22c8c1,_0x2eabb6))[_0xe720('0x2a')](handleError(_0x22c8c1,null));};exports[_0xe720('0x2b')]=function(_0x5513d1,_0x1fbdaf){var _0x323547={'raw':![],'where':{'id':_0x5513d1[_0xe720('0x2c')]['id']}},_0x42111b={};_0x42111b[_0xe720('0x2d')]=_[_0xe720('0x2e')](db[_0xe720('0x24')][_0xe720('0x2f')]);_0x42111b['query']=_[_0xe720('0x2e')](_0x5513d1[_0xe720('0x30')]);_0x42111b[_0xe720('0x31')]=_[_0xe720('0x32')](_0x42111b[_0xe720('0x2d')],_0x42111b[_0xe720('0x30')]);_0x323547['attributes']=_[_0xe720('0x32')](_0x42111b[_0xe720('0x2d')],qs[_0xe720('0x33')](_0x5513d1[_0xe720('0x30')]['fields']));_0x323547['attributes']=_0x323547['attributes'][_0xe720('0x34')]?_0x323547['attributes']:_0x42111b['model'];if(_0x5513d1[_0xe720('0x30')]['includeAll']){_0x323547[_0xe720('0x35')]=[{'all':!![]}];}_0x323547=_[_0xe720('0x36')]({},_0x323547,_0x5513d1[_0xe720('0x37')]);return db[_0xe720('0x24')][_0xe720('0x38')](_0x323547)[_0xe720('0x1c')](handleEntityNotFound(_0x1fbdaf,null))[_0xe720('0x1c')](respondWithResult(_0x1fbdaf,null))[_0xe720('0x2a')](handleError(_0x1fbdaf,null));};exports[_0xe720('0x39')]=function(_0xba5f47,_0x3a40fd){return db['SmsInteraction'][_0xe720('0x39')](_0xba5f47[_0xe720('0x3a')],{})[_0xe720('0x1c')](respondWithResult(_0x3a40fd,0xc9))[_0xe720('0x2a')](handleError(_0x3a40fd,null));};exports['update']=function(_0x324d2d,_0xa5493c){if(_0x324d2d['body']['id']){delete _0x324d2d[_0xe720('0x3a')]['id'];}return db[_0xe720('0x24')][_0xe720('0x38')]({'where':{'id':_0x324d2d[_0xe720('0x2c')]['id']}})[_0xe720('0x1c')](handleEntityNotFound(_0xa5493c,null))[_0xe720('0x1c')](saveUpdates(_0x324d2d[_0xe720('0x3a')],null))[_0xe720('0x1c')](respondWithResult(_0xa5493c,null))[_0xe720('0x2a')](handleError(_0xa5493c,null));};exports[_0xe720('0x1d')]=function(_0x136f39,_0x27f6ae){return db[_0xe720('0x24')][_0xe720('0x38')]({'where':{'id':_0x136f39[_0xe720('0x2c')]['id']}})[_0xe720('0x1c')](handleEntityNotFound(_0x27f6ae,null))['then'](removeEntity(_0x27f6ae,null))[_0xe720('0x2a')](handleError(_0x27f6ae,null));};exports[_0xe720('0x3b')]=function(_0x16163f,_0x2816b6){return db[_0xe720('0x24')]['describe']()[_0xe720('0x1c')](respondWithResult(_0x2816b6,null))[_0xe720('0x2a')](handleError(_0x2816b6,null));};exports['addMessage']=function(_0x3ca6e1,_0xba8a7f){return db[_0xe720('0x3c')][_0xe720('0x38')]({'where':{'id':_0x3ca6e1[_0xe720('0x2c')]['id']}})[_0xe720('0x1c')](handleEntityNotFound(_0xba8a7f,null))[_0xe720('0x1c')](function(_0x219610){if(_0x219610){return _0x219610[_0xe720('0x3d')](_0x3ca6e1[_0xe720('0x3a')]['ids'],_['omit'](_0x3ca6e1[_0xe720('0x3a')],['ids','id'])||{});}})[_0xe720('0x1c')](respondWithResult(_0xba8a7f,null))['catch'](handleError(_0xba8a7f,null));};exports['getMessages']=function(_0x38815b,_0x2a1df4){var _0x25d836={'raw':![],'where':{}};var _0x2bc1c7={};var _0xe971d4={'count':0x0,'rows':[]};return db[_0xe720('0x24')]['findOne']({'where':{'id':_0x38815b[_0xe720('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2a1df4,null))[_0xe720('0x1c')](function(_0x27fc0f){if(_0x27fc0f){_0x2bc1c7['model']=_[_0xe720('0x2e')](db['SmsMessage'][_0xe720('0x2f')]);_0x2bc1c7[_0xe720('0x30')]=_['keys'](_0x38815b['query']);_0x2bc1c7[_0xe720('0x31')]=_[_0xe720('0x32')](_0x2bc1c7['model'],_0x2bc1c7[_0xe720('0x30')]);_0x25d836[_0xe720('0x3e')]=_[_0xe720('0x32')](_0x2bc1c7[_0xe720('0x2d')],qs[_0xe720('0x33')](_0x38815b['query'][_0xe720('0x33')]));_0x25d836[_0xe720('0x3e')]=_0x25d836[_0xe720('0x3e')][_0xe720('0x34')]?_0x25d836[_0xe720('0x3e')]:_0x2bc1c7[_0xe720('0x2d')];if(!_0x38815b[_0xe720('0x30')]['hasOwnProperty']('nolimit')){_0x25d836[_0xe720('0x18')]=qs[_0xe720('0x18')](_0x38815b['query'][_0xe720('0x18')]);_0x25d836[_0xe720('0x16')]=qs['offset'](_0x38815b[_0xe720('0x30')][_0xe720('0x16')]);}_0x25d836[_0xe720('0x3f')]=qs[_0xe720('0x40')](_0x38815b[_0xe720('0x30')][_0xe720('0x40')]);_0x25d836[_0xe720('0x41')]=qs['filters'](_['pick'](_0x38815b[_0xe720('0x30')],_0x2bc1c7['filters']));_0x25d836[_0xe720('0x41')][_0xe720('0x42')]=_0x27fc0f['id'];if(_0x38815b[_0xe720('0x30')][_0xe720('0x43')]){_0x25d836['where']=_[_0xe720('0x36')](_0x25d836[_0xe720('0x41')],{'$or':_[_0xe720('0x23')](_0x25d836[_0xe720('0x3e')],function(_0x22fe2c){var _0x3fa038={};_0x3fa038[_0x22fe2c]={'$like':'%'+_0x38815b[_0xe720('0x30')][_0xe720('0x43')]+'%'};return _0x3fa038;})});}if(_0x38815b['query'][_0xe720('0x44')]){var _0x233ba3=_0x38815b[_0xe720('0x30')][_0xe720('0x44')]['split'](',');var _0x40055a={};_0x40055a[_0x233ba3[0x0]]={'$gte':moment(_0x233ba3[0x1])[_0xe720('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x25d836[_0xe720('0x41')]=_[_0xe720('0x36')](_0x25d836[_0xe720('0x41')],_0x40055a);}_0x25d836=_[_0xe720('0x36')]({},_0x25d836,_0x38815b[_0xe720('0x37')]);return db[_0xe720('0x3c')]['count']({'where':_0x25d836[_0xe720('0x41')]})[_0xe720('0x1c')](function(_0x5a8b44){_0xe971d4['count']=_0x5a8b44;if(_0x38815b[_0xe720('0x30')]['includeAll']){_0x25d836[_0xe720('0x35')]=[{'all':!![]}];}return db[_0xe720('0x3c')][_0xe720('0x28')](_0x25d836);})[_0xe720('0x1c')](function(_0x34e165){_0xe971d4[_0xe720('0x46')]=_0x34e165;return _0xe971d4;});}})[_0xe720('0x1c')](respondWithFilteredResult(_0x2a1df4,_0x25d836))['catch'](handleError(_0x2a1df4,null));};exports['addTags']=function(_0x1104f3,_0x23f6b0){return db[_0xe720('0x24')][_0xe720('0x38')]({'where':{'id':_0x1104f3['params']['id']}})['then'](handleEntityNotFound(_0x23f6b0,null))['then'](function(_0x463d6f){if(_0x463d6f){return _0x463d6f[_0xe720('0x47')](_0x1104f3[_0xe720('0x3a')]['ids'],_[_0xe720('0x48')](_0x1104f3[_0xe720('0x3a')],[_0xe720('0x49'),'id'])||{})[_0xe720('0x4a')](function(){return db[_0xe720('0x4b')][_0xe720('0x28')]({'attributes':['id',_0xe720('0x21'),_0xe720('0x4c')],'where':{'id':_0x1104f3[_0xe720('0x3a')]['ids']}});})[_0xe720('0x1c')](function(_0x35b56c){socket[_0xe720('0x4d')](_0xe720('0x4e'),{'id':Number(_0x1104f3[_0xe720('0x2c')]['id']),'tags':_0x35b56c||[]});return{'id':Number(_0x1104f3[_0xe720('0x2c')]['id']),'tags':_0x35b56c||[]};});}})[_0xe720('0x1c')](respondWithResult(_0x23f6b0,null))['catch'](handleError(_0x23f6b0,null));};exports[_0xe720('0x4f')]=function(_0x367615,_0x188f9d){return db[_0xe720('0x24')][_0xe720('0x38')]({'where':{'id':_0x367615[_0xe720('0x2c')]['id']}})[_0xe720('0x1c')](handleEntityNotFound(_0x188f9d,null))[_0xe720('0x1c')](function(_0x42b426){if(_0x42b426){return _0x42b426[_0xe720('0x4f')](_0x367615[_0xe720('0x30')][_0xe720('0x49')]);}})[_0xe720('0x1c')](respondWithStatusCode(_0x188f9d,null))[_0xe720('0x2a')](handleError(_0x188f9d,null));};exports[_0xe720('0x50')]=function(_0x44c28e,_0x28aa44){var _0x4c78b2=moment()['unix']()[_0xe720('0x51')]();var _0x21bae1=path[_0xe720('0x52')](config['root'],_0xe720('0x53'),_0xe720('0x54'),_0xe720('0x55'));var _0x3e3064=path[_0xe720('0x52')](_0x21bae1,_0x4c78b2);var _0x4c4376=util['format'](_0xe720('0x56'),_0x44c28e['params']['id'],_0x4c78b2);var _0x167d4d=path[_0xe720('0x52')](_0x21bae1,_0x4c4376);var _0x553edf=[];_0x553edf[_0xe720('0x57')]({'model':db[_0xe720('0x58')],'as':_0xe720('0x58'),'attributes':['id',_0xe720('0x59')],'raw':!![]});_0x553edf[_0xe720('0x57')]({'model':db[_0xe720('0x5a')],'as':'Contact','attributes':['id',_0xe720('0x5b'),_0xe720('0x5c')],'raw':!![]});var _0x308f85=[{'model':db[_0xe720('0x3c')],'as':'Messages','attributes':['id',_0xe720('0x3a'),'createdAt',_0xe720('0x5d'),_0xe720('0x5e'),_0xe720('0x5f')],'include':_0x553edf}];_0x308f85[_0xe720('0x57')]({'model':db['SmsAccount'],'as':_0xe720('0x60'),'attributes':['id',_0xe720('0x21')]});_0x308f85[_0xe720('0x57')]({'model':db[_0xe720('0x58')],'as':_0xe720('0x61'),'attributes':['id',_0xe720('0x59')]});return db['SmsInteraction'][_0xe720('0x38')]({'where':{'id':_0x44c28e[_0xe720('0x2c')]['id']},'include':_0x308f85})['then'](handleEntityNotFound(_0x28aa44,null))[_0xe720('0x1c')](function(_0x29aac5){if(_0x29aac5){var _0xd6e444=_0x29aac5[_0xe720('0x62')]({'plain':!![]});fs['mkdirSync'](_0x3e3064);var _0x4ddc7e={'channel':_0xe720('0x63'),'account':_0xd6e444[_0xe720('0x60')][_0xe720('0x21')],'agent':_0xd6e444[_0xe720('0x61')]?_0xd6e444['Owner'][_0xe720('0x59')]:_0xe720('0x64'),'createdAt':moment(_0xd6e444[_0xe720('0x65')])[_0xe720('0x45')](_0xe720('0x66'))[_0xe720('0x51')](),'closedAt':_0xd6e444['closed']?moment(_0xd6e444[_0xe720('0x67')])[_0xe720('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe720('0x51')]():'','disposition':_0xd6e444[_0xe720('0x68')],'messages':_(_0xd6e444[_0xe720('0x69')])[_0xe720('0x43')]({'secret':![]})[_0xe720('0x23')](function(_0x5b2892){return{'date':moment(_0x5b2892[_0xe720('0x65')])[_0xe720('0x45')](_0xe720('0x66'))['toString'](),'sender':_0x5b2892['direction']===_0xe720('0x6a')?_0x5b2892[_0xe720('0x58')]?_0x5b2892[_0xe720('0x58')][_0xe720('0x59')]:_0xe720('0x6b'):_0x5b2892[_0xe720('0x6c')][_0xe720('0x5b')]+(_0x5b2892['Contact'][_0xe720('0x5c')]?'\x20'+_0x5b2892[_0xe720('0x6c')][_0xe720('0x5c')]:''),'body':_0x5b2892[_0xe720('0x3a')],'direction':_0x5b2892[_0xe720('0x5d')]==='out'?'A':'C','secret':_0x5b2892[_0xe720('0x5e')],'read':_0x5b2892['read']};})[_0xe720('0x6d')]()};return ejs[_0xe720('0x6e')](path['join'](config[_0xe720('0x6f')],_0xe720('0x53'),_0xe720('0x70'),_0xe720('0x71')),{'interaction':_0x4ddc7e})['then'](function(_0x43cdba){var _0x3ff21c=path[_0xe720('0x52')](_0x3e3064,_0xe720('0x72')+_0xd6e444['id']+'-'+_0x4c78b2+_0xe720('0x73'));var _0x5f47c6={'path':_0x3ff21c,'channel':_0xe720('0x63'),'interactionId':_0xd6e444['id']};return pdf['createPdfFromHTML'](_0x43cdba,_0x5f47c6);})['then'](function(){return new BPromise(function(_0x2bd1b2,_0x163cbe){zipdir(_0x3e3064,{'saveTo':_0x167d4d},function(_0x4c88a9,_0x2f1638){if(_0x4c88a9)return _0x163cbe(_0x4c88a9);return _0x2bd1b2(_0x2f1638);});})[_0xe720('0x1c')](function(){return new BPromise(function(_0x3c78be,_0x3fb694){rimraf(_0x3e3064,function(_0x3d5b94){if(_0x3d5b94)_0x3fb694(_0x3d5b94);return _0x3c78be();});});})[_0xe720('0x1c')](function(){return _0x28aa44[_0xe720('0x50')](_0x167d4d,_0x4c4376,function(_0x4bf832){if(_0x4bf832){console[_0xe720('0x74')](_0xe720('0x75'),_0x4bf832);}else{fs[_0xe720('0x76')](_0x167d4d);}});});});}else{return _0x28aa44[_0xe720('0x1e')](0xc8);}})['catch'](handleError(_0x28aa44,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 24bb375..466a082 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 _0x7d25=['SmsMessage','setMaxListeners','save','update','then','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0x33945f,_0x3366e6){var _0x22fc99=function(_0x11640a){while(--_0x11640a){_0x33945f['push'](_0x33945f['shift']());}};_0x22fc99(++_0x3366e6);}(_0x7d25,0x8a));var _0x57d2=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7d25[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x57d2('0x0'))['db'][_0x57d2('0x1')];var SmsMessage=require(_0x57d2('0x0'))['db'][_0x57d2('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x57d2('0x3')](0x0);var events={'afterCreate':_0x57d2('0x4'),'afterUpdate':_0x57d2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5337ca){return function(_0x52a4f4,_0x5dea84,_0x3c5511){_0x52a4f4['getUsers']({'attributes':['id'],'raw':!![]})[_0x57d2('0x6')](function(_0x263d35){_0x52a4f4[_0x57d2('0x7')]('Users',_0x263d35['map'](function(_0xeb8b91){return{'id':_0xeb8b91['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x52a4f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57d2('0x6')](function(_0x5153c2){_0x52a4f4[_0x57d2('0x7')]('unreadMessages',_0x5153c2[_0x57d2('0x8')]);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca+':'+_0x52a4f4['id'],_0x52a4f4);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca,_0x52a4f4);_0x3c5511(null);})[_0x57d2('0xa')](_0x3c5511(null));};}for(var e in events){if(events[_0x57d2('0xb')](e)){var event=events[e];SmsInteraction[_0x57d2('0xc')](e,emitEvent(event));}}module[_0x57d2('0xd')]=SmsInteractionEvents; \ No newline at end of file +var _0x47c5=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x47c5,0x165));var _0x547c=function(_0x261153,_0x174df0){_0x261153=_0x261153-0x0;var _0x5402f9=_0x47c5[_0x261153];return _0x5402f9;};'use strict';var EventEmitter=require(_0x547c('0x0'));var SmsInteraction=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var SmsMessage=require(_0x547c('0x1'))['db'][_0x547c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x547c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x547c('0x5'),'afterDestroy':_0x547c('0x6')};function emitEvent(_0x5b48c9){return function(_0x3e827e,_0x468220,_0x51ab7f){_0x3e827e[_0x547c('0x7')]({'attributes':['id'],'raw':!![]})[_0x547c('0x8')](function(_0x381f2e){_0x3e827e[_0x547c('0x9')](_0x547c('0xa'),_0x381f2e[_0x547c('0xb')](function(_0x3e2279){return{'id':_0x3e2279['id']};}));return SmsMessage[_0x547c('0xc')]({'where':{'SmsInteractionId':_0x3e827e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x547c('0x8')](function(_0x44a581){_0x3e827e[_0x547c('0x9')](_0x547c('0xd'),_0x44a581[_0x547c('0xe')]);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9+':'+_0x3e827e['id'],_0x3e827e);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9,_0x3e827e);_0x51ab7f(null);})[_0x547c('0x10')](_0x51ab7f(null));};}for(var e in events){if(events[_0x547c('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x547c('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fb296fe..01e4c03 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 _0xb764=['bluebird','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment'];(function(_0x5552f5,_0x358a01){var _0x4249fc=function(_0x4b37bc){while(--_0x4b37bc){_0x5552f5['push'](_0x5552f5['shift']());}};_0x4249fc(++_0x358a01);}(_0xb764,0xc0));var _0x4b76=function(_0x5b2af3,_0x191b90){_0x5b2af3=_0x5b2af3-0x0;var _0x36e575=_0xb764[_0x5b2af3];return _0x36e575;};'use strict';var _=require(_0x4b76('0x0'));var util=require('util');var logger=require(_0x4b76('0x1'))(_0x4b76('0x2'));var moment=require(_0x4b76('0x3'));var BPromise=require(_0x4b76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b76('0x5'));var attributes=require(_0x4b76('0x6'));module[_0x4b76('0x7')]=function(_0x455887,_0x1a4da0){return _0x455887[_0x4b76('0x8')]('SmsInteraction',attributes,{'tableName':_0x4b76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x100519,_0x4534dd,_0x3c32d2){if(_0x100519[_0x4b76('0xa')](_0x4b76('0xb'))){_0x100519[_0x4b76('0xc')]=moment()[_0x4b76('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c32d2(null,_0x100519);}}});}; \ No newline at end of file +var _0xb162=['path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x644f39,_0x29de5a){var _0x153f00=function(_0x5505ef){while(--_0x5505ef){_0x644f39['push'](_0x644f39['shift']());}};_0x153f00(++_0x29de5a);}(_0xb162,0x14b));var _0x2b16=function(_0x17eeb9,_0x3b8685){_0x17eeb9=_0x17eeb9-0x0;var _0x24f777=_0xb162[_0x17eeb9];return _0x24f777;};'use strict';var _=require(_0x2b16('0x0'));var util=require(_0x2b16('0x1'));var logger=require(_0x2b16('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2b16('0x3'));var rp=require(_0x2b16('0x4'));var fs=require('fs');var path=require(_0x2b16('0x5'));var rimraf=require(_0x2b16('0x6'));var config=require(_0x2b16('0x7'));var attributes=require(_0x2b16('0x8'));module['exports']=function(_0x51f33d,_0x3f217f){return _0x51f33d[_0x2b16('0x9')](_0x2b16('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e7a0a,_0x158e64,_0x2095f2){if(_0x5e7a0a[_0x2b16('0xb')](_0x2b16('0xc'))){_0x5e7a0a[_0x2b16('0xd')]=moment()[_0x2b16('0xe')](_0x2b16('0xf'));}_0x2095f2(null,_0x5e7a0a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 96164d7..6058f7a 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 _0x1920=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1920,0x1c6));var _0x0192=function(_0x417e4c,_0x4f3094){_0x417e4c=_0x417e4c-0x0;var _0x2bb065=_0x1920[_0x417e4c];return _0x2bb065;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0192('0x0'));var fs=require('fs');var Redis=require(_0x0192('0x1'));var db=require(_0x0192('0x2'))['db'];var utils=require(_0x0192('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x0192('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0192('0x5')][_0x0192('0x6')]({'port':0x232a});config[_0x0192('0x7')]=_[_0x0192('0x8')](config[_0x0192('0x7')],{'host':_0x0192('0x9'),'port':0x18eb});var socket=require(_0x0192('0xa'))(new Redis(config[_0x0192('0x7')]));require('./smsInteraction.socket')[_0x0192('0xb')](socket);function respondWithRpcPromise(_0xb77b4c,_0x3ce723,_0x575804){return new BPromise(function(_0x176ae6,_0x2914f3){return client[_0x0192('0xc')](_0xb77b4c,_0x575804)[_0x0192('0xd')](function(_0x3ee79b){logger[_0x0192('0xe')](_0x0192('0xf'),_0x3ce723,_0x0192('0x10'));logger[_0x0192('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3ce723,_0x0192('0x10'),JSON[_0x0192('0x12')](_0x3ee79b));if(_0x3ee79b[_0x0192('0x13')]){if(_0x3ee79b[_0x0192('0x13')][_0x0192('0x14')]===0x1f4){logger['error'](_0x0192('0xf'),_0x3ce723,_0x3ee79b[_0x0192('0x13')][_0x0192('0x15')]);return _0x2914f3(_0x3ee79b[_0x0192('0x13')][_0x0192('0x15')]);}logger['error'](_0x0192('0xf'),_0x3ce723,_0x3ee79b['error']['message']);return _0x176ae6(_0x3ee79b[_0x0192('0x13')]['message']);}else{logger[_0x0192('0xe')](_0x0192('0xf'),_0x3ce723,_0x0192('0x10'));_0x176ae6(_0x3ee79b[_0x0192('0x16')]['message']);}})[_0x0192('0x17')](function(_0x54f294){logger['error'](_0x0192('0xf'),_0x3ce723,_0x54f294);_0x2914f3(_0x54f294);});});}exports[_0x0192('0x18')]=function(_0x410dc2){var _0x46c43d=this;return new Promise(function(_0xe8a880,_0x32cf91){return db[_0x0192('0x19')][_0x0192('0x1a')](_0x410dc2[_0x0192('0x1b')],{'raw':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1e')]||null:null,'attributes':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1f')]||null:null,'limit':_0x410dc2[_0x0192('0x1c')]?_0x410dc2['options'][_0x0192('0x20')]||null:null})[_0x0192('0xd')](function(_0x2a2db0){logger[_0x0192('0xe')]('UpdateSmsInteraction',_0x410dc2);logger[_0x0192('0x11')](_0x0192('0x18'),_0x410dc2,JSON[_0x0192('0x12')](_0x2a2db0));_0xe8a880(_0x2a2db0);})[_0x0192('0x17')](function(_0x560d75){logger['error'](_0x0192('0x18'),_0x560d75[_0x0192('0x15')],_0x410dc2);_0x32cf91(_0x46c43d[_0x0192('0x13')](0x1f4,_0x560d75[_0x0192('0x15')]));});});};exports[_0x0192('0x21')]=function(_0x442aa8){return new Promise(function(_0x1ce79b,_0x20ab14){return db[_0x0192('0x19')][_0x0192('0x22')]({'where':_0x442aa8[_0x0192('0x1c')]?_0x442aa8[_0x0192('0x1c')][_0x0192('0x1e')]||null:null})['then'](function(_0x29ebda){if(_0x29ebda){return _0x29ebda['addTags'](_0x442aa8[_0x0192('0x1b')][_0x0192('0x23')],_[_0x0192('0x24')](_0x442aa8[_0x0192('0x1b')],[_0x0192('0x23'),'id'])||{});}})[_0x0192('0x25')](function(_0x144d19){logger[_0x0192('0xe')](_0x0192('0x26'),_0x442aa8);logger[_0x0192('0x11')](_0x0192('0x26'),_0x442aa8,JSON['stringify'](_0x144d19));_0x1ce79b(_0x144d19);})['catch'](function(_0x48813b){logger[_0x0192('0x13')](_0x0192('0x26'),_0x48813b['message'],_0x442aa8);_0x20ab14(_this[_0x0192('0x13')](0x1f4,_0x48813b[_0x0192('0x15')]));});});}; \ No newline at end of file +var _0xb28b=['redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','socket.io-emitter'];(function(_0x244a59,_0x7a45bc){var _0x488f8a=function(_0x261105){while(--_0x261105){_0x244a59['push'](_0x244a59['shift']());}};_0x488f8a(++_0x7a45bc);}(_0xb28b,0x11a));var _0xbb28=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb28b[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xbb28('0x0'));var util=require(_0xbb28('0x1'));var moment=require(_0xbb28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb28('0x3'))['db'];var utils=require(_0xbb28('0x4'));var logger=require(_0xbb28('0x5'))(_0xbb28('0x6'));var config=require(_0xbb28('0x7'));var jayson=require(_0xbb28('0x8'));var client=jayson[_0xbb28('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbb28('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb28('0xb'))(new Redis(config[_0xbb28('0xc')]));require(_0xbb28('0xd'))[_0xbb28('0xe')](socket);function respondWithRpcPromise(_0x3bda7e,_0x1d9664,_0x16530c){return new BPromise(function(_0x4b6ae3,_0x4c21e3){return client[_0xbb28('0xf')](_0x3bda7e,_0x16530c)[_0xbb28('0x10')](function(_0xa8ece){logger[_0xbb28('0x11')](_0xbb28('0x12'),_0x1d9664,_0xbb28('0x13'));logger['debug'](_0xbb28('0x14'),_0x1d9664,_0xbb28('0x13'),JSON['stringify'](_0xa8ece));if(_0xa8ece['error']){if(_0xa8ece['error'][_0xbb28('0x15')]===0x1f4){logger[_0xbb28('0x16')](_0xbb28('0x12'),_0x1d9664,_0xa8ece['error'][_0xbb28('0x17')]);return _0x4c21e3(_0xa8ece[_0xbb28('0x16')][_0xbb28('0x17')]);}logger[_0xbb28('0x16')](_0xbb28('0x12'),_0x1d9664,_0xa8ece[_0xbb28('0x16')][_0xbb28('0x17')]);return _0x4b6ae3(_0xa8ece['error'][_0xbb28('0x17')]);}else{logger[_0xbb28('0x11')](_0xbb28('0x12'),_0x1d9664,_0xbb28('0x13'));_0x4b6ae3(_0xa8ece[_0xbb28('0x18')][_0xbb28('0x17')]);}})[_0xbb28('0x19')](function(_0x4374e2){logger[_0xbb28('0x16')](_0xbb28('0x12'),_0x1d9664,_0x4374e2);_0x4c21e3(_0x4374e2);});});}exports[_0xbb28('0x1a')]=function(_0x64fdb1){var _0x133406=this;return new Promise(function(_0x48b434,_0x1d3c59){return db[_0xbb28('0x1b')]['update'](_0x64fdb1[_0xbb28('0x1c')],{'raw':_0x64fdb1[_0xbb28('0x1d')]?_0x64fdb1[_0xbb28('0x1d')][_0xbb28('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x64fdb1[_0xbb28('0x1d')]?_0x64fdb1[_0xbb28('0x1d')][_0xbb28('0x1f')]||null:null,'attributes':_0x64fdb1['options']?_0x64fdb1['options'][_0xbb28('0x20')]||null:null,'limit':_0x64fdb1[_0xbb28('0x1d')]?_0x64fdb1[_0xbb28('0x1d')][_0xbb28('0x21')]||null:null})[_0xbb28('0x10')](function(_0x58dd0b){logger[_0xbb28('0x11')](_0xbb28('0x1a'),_0x64fdb1);logger['debug'](_0xbb28('0x1a'),_0x64fdb1,JSON[_0xbb28('0x22')](_0x58dd0b));_0x48b434(_0x58dd0b);})['catch'](function(_0x2e9801){logger[_0xbb28('0x16')](_0xbb28('0x1a'),_0x2e9801[_0xbb28('0x17')],_0x64fdb1);_0x1d3c59(_0x133406[_0xbb28('0x16')](0x1f4,_0x2e9801[_0xbb28('0x17')]));});});};exports[_0xbb28('0x23')]=function(_0x1ef170){return new Promise(function(_0x367dbd,_0x137a15){return db[_0xbb28('0x1b')][_0xbb28('0x24')]({'where':_0x1ef170[_0xbb28('0x1d')]?_0x1ef170[_0xbb28('0x1d')][_0xbb28('0x1f')]||null:null})[_0xbb28('0x10')](function(_0x5495c1){if(_0x5495c1){return _0x5495c1[_0xbb28('0x25')](_0x1ef170[_0xbb28('0x1c')][_0xbb28('0x26')],_[_0xbb28('0x27')](_0x1ef170[_0xbb28('0x1c')],['ids','id'])||{});}})[_0xbb28('0x28')](function(_0x165517){logger[_0xbb28('0x11')](_0xbb28('0x29'),_0x1ef170);logger['debug']('AddTags',_0x1ef170,JSON['stringify'](_0x165517));_0x367dbd(_0x165517);})[_0xbb28('0x19')](function(_0x1bc7ab){logger[_0xbb28('0x16')](_0xbb28('0x29'),_0x1bc7ab[_0xbb28('0x17')],_0x1ef170);_0x137a15(_this[_0xbb28('0x16')](0x1f4,_0x1bc7ab[_0xbb28('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4298239..59d6d94 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 _0x61fd=['length','smsInteraction:','remove','removeListener','register'];(function(_0x375a54,_0x248965){var _0x2fb141=function(_0x3d0761){while(--_0x3d0761){_0x375a54['push'](_0x375a54['shift']());}};_0x2fb141(++_0x248965);}(_0x61fd,0xbb));var _0xd61f=function(_0x36fd6c,_0x49cb79){_0x36fd6c=_0x36fd6c-0x0;var _0x544c9f=_0x61fd[_0x36fd6c];return _0x544c9f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xd61f('0x0'),'update'];function createListener(_0x3db059,_0x4ebff7){return function(_0x494ad3){_0x4ebff7['emit'](_0x3db059,_0x494ad3);};}function removeListener(_0x53b499,_0x370201){return function(){SmsInteractionEvents[_0xd61f('0x1')](_0x53b499,_0x370201);};}exports[_0xd61f('0x2')]=function(_0x1845c1){for(var _0x53d868=0x0,_0x2ea5e7=events[_0xd61f('0x3')];_0x53d868<_0x2ea5e7;_0x53d868++){var _0x4be6e9=events[_0x53d868];var _0x36ef3c=createListener(_0xd61f('0x4')+_0x4be6e9,_0x1845c1);SmsInteractionEvents['on'](_0x4be6e9,_0x36ef3c);}}; \ No newline at end of file +var _0xea52=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x54ccfb,_0x42dd2e){var _0x414dcc=function(_0x55981e){while(--_0x55981e){_0x54ccfb['push'](_0x54ccfb['shift']());}};_0x414dcc(++_0x42dd2e);}(_0xea52,0x1ec));var _0x2ea5=function(_0x382d7e,_0x16798c){_0x382d7e=_0x382d7e-0x0;var _0x33c721=_0xea52[_0x382d7e];return _0x33c721;};'use strict';var SmsInteractionEvents=require(_0x2ea5('0x0'));var events=[_0x2ea5('0x1'),_0x2ea5('0x2'),_0x2ea5('0x3')];function createListener(_0x894092,_0x528604){return function(_0x401e42){_0x528604[_0x2ea5('0x4')](_0x894092,_0x401e42);};}function removeListener(_0x13ee33,_0x518c37){return function(){SmsInteractionEvents[_0x2ea5('0x5')](_0x13ee33,_0x518c37);};}exports[_0x2ea5('0x6')]=function(_0x510bb3){for(var _0x315ca7=0x0,_0x1e5ce2=events[_0x2ea5('0x7')];_0x315ca7<_0x1e5ce2;_0x315ca7++){var _0x1521fb=events[_0x315ca7];var _0x43c329=createListener(_0x2ea5('0x8')+_0x1521fb,_0x510bb3);SmsInteractionEvents['on'](_0x1521fb,_0x43c329);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c6c18f8..aba3357 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 _0x5226=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','put','update','accept','/:id/reject','destroy','exports'];(function(_0xbfb7c,_0x1c3f5d){var _0x2727cb=function(_0x1f49fa){while(--_0x1f49fa){_0xbfb7c['push'](_0xbfb7c['shift']());}};_0x2727cb(++_0x1c3f5d);}(_0x5226,0x16c));var _0x6522=function(_0xe15919,_0x4c1fbd){_0xe15919=_0xe15919-0x0;var _0x372688=_0x5226[_0xe15919];return _0x372688;};'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[_0x6522('0x9')]('/',auth[_0x6522('0xa')](),controller[_0x6522('0xb')]);router[_0x6522('0x9')](_0x6522('0xc'),auth[_0x6522('0xa')](),controller[_0x6522('0xd')]);router['get'](_0x6522('0xe'),auth['isAuthenticated'](),controller[_0x6522('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x6522('0x10')](_0x6522('0x11'),_0x6522('0x12')),controller[_0x6522('0x13')]);router[_0x6522('0x14')](_0x6522('0x15'),controller['status']);router[_0x6522('0x16')]('/:id',auth[_0x6522('0xa')](),controller[_0x6522('0x17')]);router[_0x6522('0x16')]('/:id/accept',auth[_0x6522('0xa')](),controller[_0x6522('0x18')]);router['put'](_0x6522('0x19'),auth[_0x6522('0xa')](),controller['reject']);router['delete']('/:id',auth[_0x6522('0xa')](),controller[_0x6522('0x1a')]);module[_0x6522('0x1b')]=router; \ No newline at end of file +var _0xac8e=['/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','post','sms','smsmessage:create','create'];(function(_0xe1eeda,_0x5ddf0d){var _0x1488f6=function(_0x535dfa){while(--_0x535dfa){_0xe1eeda['push'](_0xe1eeda['shift']());}};_0x1488f6(++_0x5ddf0d);}(_0xac8e,0x19f));var _0xeac8=function(_0x41bb70,_0x1fdcd9){_0x41bb70=_0x41bb70-0x0;var _0xd49b9b=_0xac8e[_0x41bb70];return _0xd49b9b;};'use strict';var multer=require(_0xeac8('0x0'));var util=require(_0xeac8('0x1'));var path=require(_0xeac8('0x2'));var timeout=require(_0xeac8('0x3'));var express=require(_0xeac8('0x4'));var router=express[_0xeac8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeac8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeac8('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0xeac8('0x8')](),controller[_0xeac8('0x9')]);router[_0xeac8('0xa')]('/describe',auth[_0xeac8('0x8')](),controller[_0xeac8('0xb')]);router[_0xeac8('0xa')](_0xeac8('0xc'),auth[_0xeac8('0x8')](),controller['show']);router[_0xeac8('0xd')]('/',auth[_0xeac8('0x8')](),interaction['tracked'](_0xeac8('0xe'),_0xeac8('0xf')),controller[_0xeac8('0x10')]);router[_0xeac8('0xd')](_0xeac8('0x11'),controller[_0xeac8('0x12')]);router[_0xeac8('0x13')](_0xeac8('0xc'),auth[_0xeac8('0x8')](),controller[_0xeac8('0x14')]);router['put'](_0xeac8('0x15'),auth[_0xeac8('0x8')](),controller[_0xeac8('0x16')]);router[_0xeac8('0x13')](_0xeac8('0x17'),auth[_0xeac8('0x8')](),controller[_0xeac8('0x18')]);router[_0xeac8('0x19')]('/:id',auth[_0xeac8('0x8')](),controller['destroy']);module[_0xeac8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 8d55257..963294f 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 _0x3b18=['ENUM','out','STRING','DATE','exports','medium','BOOLEAN'];(function(_0x25c7fb,_0x2e4e86){var _0x214b77=function(_0x36b7c0){while(--_0x36b7c0){_0x25c7fb['push'](_0x25c7fb['shift']());}};_0x214b77(++_0x2e4e86);}(_0x3b18,0xe4));var _0x83b1=function(_0xa66538,_0x2218c4){_0xa66538=_0xa66538-0x0;var _0x5244be=_0x3b18[_0xa66538];return _0x5244be;};'use strict';var Sequelize=require('sequelize');module[_0x83b1('0x0')]={'body':{'type':Sequelize['TEXT'](_0x83b1('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x83b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x83b1('0x3')]('in',_0x83b1('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x83b1('0x5')]},'readAt':{'type':Sequelize[_0x83b1('0x6')]},'secret':{'type':Sequelize[_0x83b1('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x83b1('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x865e=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x153cc3,_0x23bd76){var _0x1ee8e3=function(_0x405d3f){while(--_0x405d3f){_0x153cc3['push'](_0x153cc3['shift']());}};_0x1ee8e3(++_0x23bd76);}(_0x865e,0x6d));var _0xe865=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x865e[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0xe865('0x0'));module[_0xe865('0x1')]={'body':{'type':Sequelize[_0xe865('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe865('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xe865('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe865('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe865('0x5')]},'readAt':{'type':Sequelize[_0xe865('0x6')]},'secret':{'type':Sequelize[_0xe865('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe865('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index dd388a5..a75152d 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 _0x4d07=['register','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','undefined','limit','offset','set','apply','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','count','includeAll','include','findAll','show','params','keys','intersection','fields','find','create','body','sms-interactions','sms','read','UserId','user','agent','get','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','accept','EventManager','acceptmessage','SmsInteraction','RejectMessage','rejectMessage','Sequelize','event','reject','SmsAccount','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','DELIVERED','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','redis','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x139716,_0x789d39){var _0x524698=function(_0x49724d){while(--_0x49724d){_0x139716['push'](_0x139716['shift']());}};_0x524698(++_0x789d39);}(_0x4d07,0x18e));var _0x74d0=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x4d07[_0x52c4e9];return _0x252a03;};'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'];config[_0x74d0('0x18')]=_['defaults'](config[_0x74d0('0x18')],{'host':_0x74d0('0x19'),'port':0x18eb});var socket=require(_0x74d0('0x1a'))(new Redis(config[_0x74d0('0x18')]));require(_0x74d0('0x1b'))[_0x74d0('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x74d0('0x1d')][_0x74d0('0x1e')]({'port':0x232c});var client9002=jayson[_0x74d0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1601d5,_0x3e3dee,_0x289266,_0x5bcde9){return new BPromise(function(_0x15b452,_0x3644cb){var _0x30f605=_0x5bcde9||client;return _0x30f605[_0x74d0('0x1f')](_0x1601d5,_0x289266)[_0x74d0('0x20')](function(_0x58ba46){logger[_0x74d0('0x21')]('SmsMessage,\x20%s,\x20%s',_0x3e3dee,_0x74d0('0x22'));logger[_0x74d0('0x23')](_0x74d0('0x24'),_0x3e3dee,_0x74d0('0x22'),JSON[_0x74d0('0x25')](_0x58ba46));if(_0x58ba46[_0x74d0('0x26')]){if(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x27')]===0x1f4){logger[_0x74d0('0x26')]('SmsMessage,\x20%s,\x20%s',_0x3e3dee,_0x58ba46[_0x74d0('0x26')]['message']);return _0x3644cb(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);}logger[_0x74d0('0x26')](_0x74d0('0x29'),_0x3e3dee,_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);return _0x15b452(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);}else{logger[_0x74d0('0x21')](_0x74d0('0x29'),_0x3e3dee,_0x74d0('0x22'));_0x15b452(_0x58ba46[_0x74d0('0x2a')][_0x74d0('0x28')]);}})[_0x74d0('0x2b')](function(_0x4ed251){logger[_0x74d0('0x26')](_0x74d0('0x29'),_0x3e3dee,_0x4ed251);_0x3644cb(_0x4ed251);});});}function respondWithStatusCode(_0x2e0379,_0x319156){_0x319156=_0x319156||0xcc;return function(_0x6fbcba){if(_0x6fbcba){return _0x2e0379[_0x74d0('0x2c')](_0x319156);}return _0x2e0379[_0x74d0('0x2d')](_0x319156)[_0x74d0('0x2e')]();};}function respondWithResult(_0x34df7a,_0x5a3406){_0x5a3406=_0x5a3406||0xc8;return function(_0x48c495){if(_0x48c495){return _0x34df7a[_0x74d0('0x2d')](_0x5a3406)['json'](_0x48c495);}};}function respondWithFilteredResult(_0x18b4fd,_0x261fc6){return function(_0x2d9880){if(_0x2d9880){var _0x4c18d9=typeof _0x261fc6['offset']===_0x74d0('0x2f')&&typeof _0x261fc6[_0x74d0('0x30')]===_0x74d0('0x2f');var _0x5eda40=_0x2d9880['count'];var _0x9c0ee4=_0x4c18d9?0x0:_0x261fc6[_0x74d0('0x31')];var _0x38c7f0=_0x4c18d9?_0x2d9880['count']:_0x261fc6[_0x74d0('0x31')]+_0x261fc6[_0x74d0('0x30')];var _0x39b0dd;if(_0x38c7f0>=_0x5eda40){_0x38c7f0=_0x5eda40;_0x39b0dd=0xc8;}else{_0x39b0dd=0xce;}_0x18b4fd[_0x74d0('0x2d')](_0x39b0dd);return _0x18b4fd[_0x74d0('0x32')]('Content-Range',_0x9c0ee4+'-'+_0x38c7f0+'/'+_0x5eda40)['json'](_0x2d9880);}return null;};}function patchUpdates(_0x1bb302){return function(_0x2081da){try{jsonpatch[_0x74d0('0x33')](_0x2081da,_0x1bb302,!![]);}catch(_0x1beeb1){return BPromise['reject'](_0x1beeb1);}return _0x2081da[_0x74d0('0x34')]();};}function saveUpdates(_0x4864fe,_0x1959d8){return function(_0x31f662){if(_0x31f662){return _0x31f662[_0x74d0('0x35')](_0x4864fe)[_0x74d0('0x20')](function(_0x1ecea5){return _0x1ecea5;});}return null;};}function removeEntity(_0x38e706,_0x1cec93){return function(_0x18df4b){if(_0x18df4b){return _0x18df4b[_0x74d0('0x36')]()[_0x74d0('0x20')](function(){_0x38e706[_0x74d0('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ac7a,_0x15dc9d){return function(_0x3b2944){if(!_0x3b2944){_0x29ac7a[_0x74d0('0x2c')](0x194);}return _0x3b2944;};}function handleError(_0x4684a5,_0x30a67e){_0x30a67e=_0x30a67e||0x1f4;return function(_0x876cd2){logger[_0x74d0('0x26')](_0x876cd2[_0x74d0('0x37')]);if(_0x876cd2[_0x74d0('0x38')]){delete _0x876cd2['name'];}_0x4684a5[_0x74d0('0x2d')](_0x30a67e)[_0x74d0('0x39')](_0x876cd2);};}exports[_0x74d0('0x3a')]=function(_0x4a95a4,_0x561480){var _0x274077={},_0x1bf588={},_0x59e91c={'count':0x0,'rows':[]};var _0x463a0e=_['map'](db[_0x74d0('0x3b')][_0x74d0('0x3c')],function(_0x43c894){return{'name':_0x43c894[_0x74d0('0x3d')],'type':_0x43c894[_0x74d0('0x3e')][_0x74d0('0x3f')]};});_0x1bf588[_0x74d0('0x40')]=_[_0x74d0('0x41')](_0x463a0e,_0x74d0('0x38'));_0x1bf588[_0x74d0('0x42')]=_['keys'](_0x4a95a4[_0x74d0('0x42')]);_0x1bf588[_0x74d0('0x43')]=_['intersection'](_0x1bf588['model'],_0x1bf588['query']);_0x274077[_0x74d0('0x44')]=_['intersection'](_0x1bf588[_0x74d0('0x40')],qs['fields'](_0x4a95a4[_0x74d0('0x42')]['fields']));_0x274077[_0x74d0('0x44')]=_0x274077['attributes'][_0x74d0('0x45')]?_0x274077['attributes']:_0x1bf588[_0x74d0('0x40')];if(!_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x46')](_0x74d0('0x47'))){_0x274077['limit']=qs['limit'](_0x4a95a4[_0x74d0('0x42')]['limit']);_0x274077[_0x74d0('0x31')]=qs[_0x74d0('0x31')](_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x31')]);}_0x274077[_0x74d0('0x48')]=qs['sort'](_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x49')]);_0x274077['where']=qs[_0x74d0('0x43')](_[_0x74d0('0x4a')](_0x4a95a4[_0x74d0('0x42')],_0x1bf588[_0x74d0('0x43')]),_0x463a0e);if(_0x4a95a4[_0x74d0('0x42')]['filter']){_0x274077['where']=_['merge'](_0x274077[_0x74d0('0x4b')],{'$or':_[_0x74d0('0x41')](_0x463a0e,function(_0x41fade){if(_0x41fade[_0x74d0('0x3e')]!=='VIRTUAL'){var _0x5f3bd8={};_0x5f3bd8[_0x41fade[_0x74d0('0x38')]]={'$like':'%'+_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x4c')]+'%'};return _0x5f3bd8;}})});}_0x274077=_[_0x74d0('0x4d')]({},_0x274077,_0x4a95a4[_0x74d0('0x4e')]);var _0x3b05c9={'where':_0x274077[_0x74d0('0x4b')]};return db['SmsMessage'][_0x74d0('0x4f')](_0x3b05c9)['then'](function(_0x4f279c){_0x59e91c[_0x74d0('0x4f')]=_0x4f279c;if(_0x4a95a4['query'][_0x74d0('0x50')]){_0x274077[_0x74d0('0x51')]=[{'all':!![]}];}return db[_0x74d0('0x3b')][_0x74d0('0x52')](_0x274077);})[_0x74d0('0x20')](function(_0x47ccce){_0x59e91c['rows']=_0x47ccce;return _0x59e91c;})['then'](respondWithFilteredResult(_0x561480,_0x274077))[_0x74d0('0x2b')](handleError(_0x561480,null));};exports[_0x74d0('0x53')]=function(_0x26975e,_0x3fdd62){var _0x507f79={'raw':!![],'where':{'id':_0x26975e[_0x74d0('0x54')]['id']}},_0x1374e4={};_0x1374e4[_0x74d0('0x40')]=_[_0x74d0('0x55')](db[_0x74d0('0x3b')]['rawAttributes']);_0x1374e4[_0x74d0('0x42')]=_[_0x74d0('0x55')](_0x26975e['query']);_0x1374e4[_0x74d0('0x43')]=_[_0x74d0('0x56')](_0x1374e4[_0x74d0('0x40')],_0x1374e4[_0x74d0('0x42')]);_0x507f79[_0x74d0('0x44')]=_['intersection'](_0x1374e4[_0x74d0('0x40')],qs[_0x74d0('0x57')](_0x26975e[_0x74d0('0x42')][_0x74d0('0x57')]));_0x507f79[_0x74d0('0x44')]=_0x507f79[_0x74d0('0x44')][_0x74d0('0x45')]?_0x507f79[_0x74d0('0x44')]:_0x1374e4['model'];if(_0x26975e[_0x74d0('0x42')][_0x74d0('0x50')]){_0x507f79['include']=[{'all':!![]}];}_0x507f79=_['merge']({},_0x507f79,_0x26975e['options']);return db['SmsMessage'][_0x74d0('0x58')](_0x507f79)[_0x74d0('0x20')](handleEntityNotFound(_0x3fdd62,null))[_0x74d0('0x20')](respondWithResult(_0x3fdd62,null))[_0x74d0('0x2b')](handleError(_0x3fdd62,null));};exports[_0x74d0('0x59')]=function(_0x14584a,_0x38a767){return db['SmsMessage'][_0x74d0('0x59')](_0x14584a['body'],{})[_0x74d0('0x20')](respondWithResult(_0x38a767,0xc9))['catch'](handleError(_0x38a767,null));};exports[_0x74d0('0x35')]=function(_0x3e2baf,_0x29d836){if(_0x3e2baf[_0x74d0('0x5a')]['id']){delete _0x3e2baf[_0x74d0('0x5a')]['id'];}return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x3e2baf[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x29d836,null))[_0x74d0('0x20')](saveUpdates(_0x3e2baf[_0x74d0('0x5a')],null))[_0x74d0('0x20')](respondWithResult(_0x29d836,null))[_0x74d0('0x2b')](handleError(_0x29d836,null));};exports[_0x74d0('0x36')]=function(_0x3f440f,_0x539b20){return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x3f440f[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x539b20,null))[_0x74d0('0x20')](removeEntity(_0x539b20,null))[_0x74d0('0x2b')](handleError(_0x539b20,null));};exports['describe']=function(_0x1204be,_0x518ab3){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x518ab3,null))['catch'](handleError(_0x518ab3,null));};var interaction_log=require(_0x74d0('0x13'))(_0x74d0('0x5b'));exports['accept']=function(_0xe2d6f9,_0x2161b3,_0x434dae){var _0x59034f={'agent':{},'channel':_0x74d0('0x5c')};if(_0xe2d6f9['body']['id']){delete _0xe2d6f9[_0x74d0('0x5a')]['id'];}_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5d')]=!![];_0xe2d6f9['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')]=_0xe2d6f9[_0x74d0('0x5a')]['UserId']||_0xe2d6f9[_0x74d0('0x5f')]['id'];_0x59034f[_0x74d0('0x60')]['id']=_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')];return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0xe2d6f9[_0x74d0('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2161b3,null))[_0x74d0('0x20')](saveUpdates(_0xe2d6f9[_0x74d0('0x5a')],null))[_0x74d0('0x20')](function(_0x212d44){if(_0x212d44){_0x59034f[_0x74d0('0x28')]=_0x212d44[_0x74d0('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x74d0('0x58')]({'where':{'id':_0x212d44[_0x74d0('0x62')]}});}return null;})[_0x74d0('0x20')](handleEntityNotFound(_0x2161b3,null))[_0x74d0('0x20')](function(_0x5c2b6b){if(_0x5c2b6b){return _0x5c2b6b[_0x74d0('0x35')]({'UserId':_0xe2d6f9[_0x74d0('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x5c2b6b[_0x74d0('0x63')])?moment()['format'](_0x74d0('0x64')):undefined});}return null;})['then'](function(_0x254c6f){if(_0x254c6f){_0x59034f[_0x74d0('0x65')]=_0x254c6f[_0x74d0('0x61')]({'plain':!![]});interaction_log['info'](_0x74d0('0x66'),_0xe2d6f9[_0x74d0('0x5f')]['id'],_0xe2d6f9[_0x74d0('0x5f')]['name'],_0xe2d6f9[_0x74d0('0x5f')]['role'],_0x59034f['interaction']['id'],_0xe2d6f9['body']?JSON[_0x74d0('0x25')](_0xe2d6f9[_0x74d0('0x5a')]):_0x74d0('0x67'));return respondWithRpcPromise(_0x74d0('0x68'),_0x74d0('0x69'),_0x59034f);}return null;})[_0x74d0('0x20')](function(_0x2d556c){var _0xed17bd=_0x74d0('0x6a')+_0x2d556c[_0x74d0('0x28')][_0x74d0('0x6b')];return db['sequelize'][_0x74d0('0x42')](_0xed17bd,{'type':db['Sequelize'][_0x74d0('0x6c')][_0x74d0('0x6d')],'raw':!![]})[_0x74d0('0x20')](function(_0x57f110){return _0x57f110;});})['then'](function(_0x369cf8){if(_0x369cf8){_0x59034f['message'][_0x74d0('0x6e')]=_0x369cf8[0x0];if(!_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')])return;return db[_0x74d0('0x6f')][_0x74d0('0x58')]({'where':{'id':_0xe2d6f9[_0x74d0('0x5a')]['UserId'],'role':_0x74d0('0x60')},'attributes':['id','name',_0x74d0('0x70'),_0x74d0('0x71'),_0x74d0('0x72')],'raw':!![]});}return null;})[_0x74d0('0x20')](function(_0x4aa908){if(!_0x4aa908)return null;_0x59034f[_0x74d0('0x28')]['agent']=_0x4aa908;return _0x59034f;})['then'](function(_0xccadbd){if(_0xccadbd){if(_0xe2d6f9['body'][_0x74d0('0x73')]){_0x59034f[_0x74d0('0x28')][_0x74d0('0x74')]=util['format']('SIP/%s',_0xe2d6f9[_0x74d0('0x5f')][_0x74d0('0x38')]);_0x59034f[_0x74d0('0x28')][_0x74d0('0x75')]=_0x59034f[_0x74d0('0x75')];_0x59034f['message']['motionChannel']=_0x59034f[_0x74d0('0x75')];_0x59034f[_0x74d0('0x28')]['event']=_0x74d0('0x76');return respondWithRpcPromise(_0x74d0('0x77'),'EventManager',{'event':_0x74d0('0x78'),'message':_0x59034f[_0x74d0('0x28')]},client9002)['then'](function(){return _0x59034f;});}return _0x59034f;}return null;})[_0x74d0('0x20')](respondWithResult(_0x2161b3,null))[_0x74d0('0x2b')](handleError(_0x2161b3,null));};var interaction_log=require(_0x74d0('0x13'))(_0x74d0('0x5b'));exports['reject']=function(_0x135703,_0x51b221,_0xc317b2){var _0x1fbf60={'agent':{},'channel':_0x74d0('0x5c')};if(_0x135703['body']['id']){delete _0x135703[_0x74d0('0x5a')]['id'];}_0x135703['body'][_0x74d0('0x5e')]=_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')]||_0x135703[_0x74d0('0x5f')]['id'];_0x1fbf60[_0x74d0('0x60')]['id']=_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')];return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x135703[_0x74d0('0x54')]['id'],'UserId':null}})[_0x74d0('0x20')](handleEntityNotFound(_0x51b221,null))['then'](function(_0x27496a){if(_0x27496a){_0x1fbf60[_0x74d0('0x28')]=_0x27496a[_0x74d0('0x61')]({'plain':!![]});return db[_0x74d0('0x79')][_0x74d0('0x58')]({'where':{'id':_0x27496a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x51b221,null))[_0x74d0('0x20')](function(_0x416dd4){if(_0x416dd4){_0x1fbf60[_0x74d0('0x65')]=_0x416dd4[_0x74d0('0x61')]({'plain':!![]});interaction_log[_0x74d0('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x135703['user']['id'],_0x135703[_0x74d0('0x5f')][_0x74d0('0x38')],_0x135703[_0x74d0('0x5f')]['role'],_0x1fbf60['interaction']['id'],_0x135703[_0x74d0('0x5a')]?JSON[_0x74d0('0x25')](_0x135703[_0x74d0('0x5a')]):'null');return respondWithRpcPromise(_0x74d0('0x7a'),_0x74d0('0x7b'),_0x1fbf60);}return null;})['then'](function(_0x27c944){var _0x7a33c5=_0x74d0('0x6a')+_0x27c944[_0x74d0('0x28')]['ContactId'];return db['sequelize'][_0x74d0('0x42')](_0x7a33c5,{'type':db[_0x74d0('0x7c')]['QueryTypes'][_0x74d0('0x6d')],'raw':!![]})[_0x74d0('0x20')](function(_0x35469a){return _0x35469a;});})[_0x74d0('0x20')](function(_0x16c553){if(_0x16c553){_0x1fbf60[_0x74d0('0x28')][_0x74d0('0x6e')]=_0x16c553[0x0];if(!_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')])return;return db[_0x74d0('0x6f')][_0x74d0('0x58')]({'where':{'id':_0x135703['body'][_0x74d0('0x5e')],'role':_0x74d0('0x60')},'attributes':['id',_0x74d0('0x38'),_0x74d0('0x70'),_0x74d0('0x71'),_0x74d0('0x72')],'raw':!![]});}return null;})[_0x74d0('0x20')](function(_0x2ec125){if(!_0x2ec125)return null;_0x1fbf60[_0x74d0('0x28')]['agent']=_0x2ec125;return _0x1fbf60;})['then'](function(_0x48b3ba){if(_0x48b3ba){_0x48b3ba['message'][_0x74d0('0x74')]=util['format']('SIP/%s',_0x135703[_0x74d0('0x5f')]['name']);_0x48b3ba['message'][_0x74d0('0x75')]=_0x1fbf60[_0x74d0('0x75')];_0x48b3ba['message']['motionChannel']=_0x1fbf60['channel'];_0x48b3ba[_0x74d0('0x28')][_0x74d0('0x7d')]=_0x74d0('0x7e');respondWithRpcPromise('EventManager',_0x74d0('0x77'),{'event':'rejectmessage','message':_0x48b3ba[_0x74d0('0x28')]},client9002);return _0x1fbf60;}return null;})[_0x74d0('0x20')](respondWithResult(_0x51b221,null))[_0x74d0('0x2b')](handleError(_0x51b221,null));};exports['status']=function(_0x33bd80,_0x177be9,_0x21654e){if(_0x33bd80[_0x74d0('0x5a')]['id']){delete _0x33bd80['body']['id'];}var _0x4d5961;return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x33bd80[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x177be9,null))[_0x74d0('0x20')](function(_0x51f6e8){if(_0x51f6e8){_0x4d5961=_0x51f6e8;return db[_0x74d0('0x7f')][_0x74d0('0x58')]({'where':{'id':_0x51f6e8['SmsAccountId']}});}})[_0x74d0('0x20')](handleEntityNotFound(_0x177be9,null))[_0x74d0('0x20')](function(_0x54e594){if(_0x54e594){logger[_0x74d0('0x23')](_0x74d0('0x24'),_0x74d0('0x2d'),'received\x20delivery\x20report\x20from',_0x54e594[_0x74d0('0x3e')],util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));switch(_0x54e594[_0x74d0('0x3e')]){case _0x74d0('0x81'):if(_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x82')]&&_0x33bd80[_0x74d0('0x5a')]['MessageSid']===_0x4d5961[_0x74d0('0x83')]){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger[_0x74d0('0x26')](_0x74d0('0x84'),'status',_0x74d0('0x81'),util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x74d0('0x85'):if(_0x33bd80['body'][_0x74d0('0x86')]&&_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x86')]===_0x4d5961[_0x74d0('0x83')]&&_[_0x74d0('0x87')]([_0x74d0('0x88'),_0x74d0('0x89')],_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x8a')])>=0x0){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x74d0('0x8b'),util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x13118a=_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x8c')][0x0];if(_0x13118a[_0x74d0('0x2d')]['groupName']===_0x74d0('0x8d')){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger[_0x74d0('0x26')](_0x74d0('0x84'),_0x74d0('0x2d'),'infobip',util[_0x74d0('0x80')](_0x33bd80['body'],{'showHidden':![],'depth':null}));}break;}return _0x4d5961;}})[_0x74d0('0x20')](respondWithResult(_0x177be9,null))['catch'](handleError(_0x177be9,null));}; \ No newline at end of file +var _0x17bb=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','stack','send','index','map','rawAttributes','model','name','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','include','findAll','rows','params','fields','find','create','body','describe','../../config/logger','sms-interactions','accept','readAt','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','QueryTypes','SELECT','internal','interface','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x17bb,0x188));var _0xb17b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17bb[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb17b('0x0'));var rimraf=require(_0xb17b('0x1'));var zipdir=require(_0xb17b('0x2'));var jsonpatch=require(_0xb17b('0x3'));var rp=require(_0xb17b('0x4'));var moment=require(_0xb17b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb17b('0x6'));var util=require(_0xb17b('0x7'));var path=require(_0xb17b('0x8'));var sox=require(_0xb17b('0x9'));var csv=require('to-csv');var ejs=require(_0xb17b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb17b('0xb'));var squel=require(_0xb17b('0xc'));var crypto=require(_0xb17b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb17b('0xe'));var toCsv=require(_0xb17b('0xf'));var querystring=require(_0xb17b('0x10'));var Papa=require(_0xb17b('0x11'));var Redis=require(_0xb17b('0x12'));var authService=require(_0xb17b('0x13'));var qs=require(_0xb17b('0x14'));var as=require(_0xb17b('0x15'));var hardwareService=require(_0xb17b('0x16'));var logger=require('../../config/logger')(_0xb17b('0x17'));var utils=require('../../config/utils');var config=require(_0xb17b('0x18'));var licenseUtil=require(_0xb17b('0x19'));var db=require(_0xb17b('0x1a'))['db'];config['redis']=_['defaults'](config[_0xb17b('0x1b')],{'host':_0xb17b('0x1c'),'port':0x18eb});var socket=require(_0xb17b('0x1d'))(new Redis(config[_0xb17b('0x1b')]));require(_0xb17b('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xb17b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x518482,_0x428426,_0x56b821,_0x40c600){return new BPromise(function(_0x46bfaf,_0x27b9b6){var _0x2ffc42=_0x40c600||client;return _0x2ffc42['request'](_0x518482,_0x56b821)[_0xb17b('0x20')](function(_0x20853d){logger[_0xb17b('0x21')](_0xb17b('0x22'),_0x428426,_0xb17b('0x23'));logger[_0xb17b('0x24')](_0xb17b('0x25'),_0x428426,_0xb17b('0x23'),JSON[_0xb17b('0x26')](_0x20853d));if(_0x20853d[_0xb17b('0x27')]){if(_0x20853d[_0xb17b('0x27')][_0xb17b('0x28')]===0x1f4){logger['error'](_0xb17b('0x22'),_0x428426,_0x20853d['error'][_0xb17b('0x29')]);return _0x27b9b6(_0x20853d['error'][_0xb17b('0x29')]);}logger[_0xb17b('0x27')](_0xb17b('0x22'),_0x428426,_0x20853d[_0xb17b('0x27')]['message']);return _0x46bfaf(_0x20853d[_0xb17b('0x27')][_0xb17b('0x29')]);}else{logger[_0xb17b('0x21')](_0xb17b('0x22'),_0x428426,_0xb17b('0x23'));_0x46bfaf(_0x20853d[_0xb17b('0x2a')][_0xb17b('0x29')]);}})[_0xb17b('0x2b')](function(_0x35f25b){logger[_0xb17b('0x27')](_0xb17b('0x22'),_0x428426,_0x35f25b);_0x27b9b6(_0x35f25b);});});}function respondWithStatusCode(_0x48533c,_0x3879fb){_0x3879fb=_0x3879fb||0xcc;return function(_0x2387ea){if(_0x2387ea){return _0x48533c['sendStatus'](_0x3879fb);}return _0x48533c[_0xb17b('0x2c')](_0x3879fb)[_0xb17b('0x2d')]();};}function respondWithResult(_0x4f6c96,_0x32a3b6){_0x32a3b6=_0x32a3b6||0xc8;return function(_0x49b4e4){if(_0x49b4e4){return _0x4f6c96[_0xb17b('0x2c')](_0x32a3b6)['json'](_0x49b4e4);}};}function respondWithFilteredResult(_0x425fb4,_0x33d0b2){return function(_0x50ec97){if(_0x50ec97){var _0xf45626=typeof _0x33d0b2[_0xb17b('0x2e')]===_0xb17b('0x2f')&&typeof _0x33d0b2[_0xb17b('0x30')]===_0xb17b('0x2f');var _0x3d0d58=_0x50ec97[_0xb17b('0x31')];var _0x306548=_0xf45626?0x0:_0x33d0b2[_0xb17b('0x2e')];var _0x223998=_0xf45626?_0x50ec97[_0xb17b('0x31')]:_0x33d0b2['offset']+_0x33d0b2[_0xb17b('0x30')];var _0x597e49;if(_0x223998>=_0x3d0d58){_0x223998=_0x3d0d58;_0x597e49=0xc8;}else{_0x597e49=0xce;}_0x425fb4[_0xb17b('0x2c')](_0x597e49);return _0x425fb4['set'](_0xb17b('0x32'),_0x306548+'-'+_0x223998+'/'+_0x3d0d58)[_0xb17b('0x33')](_0x50ec97);}return null;};}function patchUpdates(_0x88c4f1){return function(_0xbce175){try{jsonpatch['apply'](_0xbce175,_0x88c4f1,!![]);}catch(_0x54eb95){return BPromise[_0xb17b('0x34')](_0x54eb95);}return _0xbce175[_0xb17b('0x35')]();};}function saveUpdates(_0x5e2532,_0x39d102){return function(_0x471381){if(_0x471381){return _0x471381[_0xb17b('0x36')](_0x5e2532)[_0xb17b('0x20')](function(_0x2b090e){return _0x2b090e;});}return null;};}function removeEntity(_0x4002f5,_0x505b3b){return function(_0x4e94bb){if(_0x4e94bb){return _0x4e94bb[_0xb17b('0x37')]()[_0xb17b('0x20')](function(){_0x4002f5['status'](0xcc)[_0xb17b('0x2d')]();});}};}function handleEntityNotFound(_0x545c0d,_0x3c7d7d){return function(_0x2b44ec){if(!_0x2b44ec){_0x545c0d['sendStatus'](0x194);}return _0x2b44ec;};}function handleError(_0x18aac1,_0x4b8934){_0x4b8934=_0x4b8934||0x1f4;return function(_0x2bc2d1){logger[_0xb17b('0x27')](_0x2bc2d1[_0xb17b('0x38')]);if(_0x2bc2d1['name']){delete _0x2bc2d1['name'];}_0x18aac1[_0xb17b('0x2c')](_0x4b8934)[_0xb17b('0x39')](_0x2bc2d1);};}exports[_0xb17b('0x3a')]=function(_0x3d9407,_0x3eaa43){var _0x5af286={},_0x6a1e4d={},_0x1e6954={'count':0x0,'rows':[]};var _0xa109dc=_[_0xb17b('0x3b')](db['SmsMessage'][_0xb17b('0x3c')],function(_0x1bf04c){return{'name':_0x1bf04c['fieldName'],'type':_0x1bf04c['type']['key']};});_0x6a1e4d[_0xb17b('0x3d')]=_[_0xb17b('0x3b')](_0xa109dc,_0xb17b('0x3e'));_0x6a1e4d[_0xb17b('0x3f')]=_[_0xb17b('0x40')](_0x3d9407[_0xb17b('0x3f')]);_0x6a1e4d[_0xb17b('0x41')]=_[_0xb17b('0x42')](_0x6a1e4d['model'],_0x6a1e4d['query']);_0x5af286[_0xb17b('0x43')]=_['intersection'](_0x6a1e4d[_0xb17b('0x3d')],qs['fields'](_0x3d9407[_0xb17b('0x3f')]['fields']));_0x5af286[_0xb17b('0x43')]=_0x5af286[_0xb17b('0x43')][_0xb17b('0x44')]?_0x5af286['attributes']:_0x6a1e4d[_0xb17b('0x3d')];if(!_0x3d9407['query']['hasOwnProperty'](_0xb17b('0x45'))){_0x5af286['limit']=qs['limit'](_0x3d9407[_0xb17b('0x3f')][_0xb17b('0x30')]);_0x5af286[_0xb17b('0x2e')]=qs[_0xb17b('0x2e')](_0x3d9407[_0xb17b('0x3f')][_0xb17b('0x2e')]);}_0x5af286['order']=qs[_0xb17b('0x46')](_0x3d9407['query'][_0xb17b('0x46')]);_0x5af286[_0xb17b('0x47')]=qs['filters'](_[_0xb17b('0x48')](_0x3d9407[_0xb17b('0x3f')],_0x6a1e4d[_0xb17b('0x41')]),_0xa109dc);if(_0x3d9407[_0xb17b('0x3f')][_0xb17b('0x49')]){_0x5af286['where']=_[_0xb17b('0x4a')](_0x5af286['where'],{'$or':_[_0xb17b('0x3b')](_0xa109dc,function(_0x186596){if(_0x186596[_0xb17b('0x4b')]!==_0xb17b('0x4c')){var _0x545dee={};_0x545dee[_0x186596['name']]={'$like':'%'+_0x3d9407[_0xb17b('0x3f')][_0xb17b('0x49')]+'%'};return _0x545dee;}})});}_0x5af286=_['merge']({},_0x5af286,_0x3d9407[_0xb17b('0x4d')]);var _0x2412ac={'where':_0x5af286[_0xb17b('0x47')]};return db[_0xb17b('0x4e')]['count'](_0x2412ac)['then'](function(_0x522102){_0x1e6954[_0xb17b('0x31')]=_0x522102;if(_0x3d9407[_0xb17b('0x3f')]['includeAll']){_0x5af286[_0xb17b('0x4f')]=[{'all':!![]}];}return db[_0xb17b('0x4e')][_0xb17b('0x50')](_0x5af286);})[_0xb17b('0x20')](function(_0x210237){_0x1e6954[_0xb17b('0x51')]=_0x210237;return _0x1e6954;})[_0xb17b('0x20')](respondWithFilteredResult(_0x3eaa43,_0x5af286))[_0xb17b('0x2b')](handleError(_0x3eaa43,null));};exports['show']=function(_0x5171f1,_0x285f45){var _0x53b308={'raw':!![],'where':{'id':_0x5171f1[_0xb17b('0x52')]['id']}},_0x347c64={};_0x347c64[_0xb17b('0x3d')]=_['keys'](db[_0xb17b('0x4e')][_0xb17b('0x3c')]);_0x347c64['query']=_[_0xb17b('0x40')](_0x5171f1[_0xb17b('0x3f')]);_0x347c64[_0xb17b('0x41')]=_[_0xb17b('0x42')](_0x347c64['model'],_0x347c64[_0xb17b('0x3f')]);_0x53b308[_0xb17b('0x43')]=_['intersection'](_0x347c64['model'],qs[_0xb17b('0x53')](_0x5171f1[_0xb17b('0x3f')][_0xb17b('0x53')]));_0x53b308['attributes']=_0x53b308[_0xb17b('0x43')][_0xb17b('0x44')]?_0x53b308[_0xb17b('0x43')]:_0x347c64[_0xb17b('0x3d')];if(_0x5171f1['query']['includeAll']){_0x53b308[_0xb17b('0x4f')]=[{'all':!![]}];}_0x53b308=_[_0xb17b('0x4a')]({},_0x53b308,_0x5171f1['options']);return db[_0xb17b('0x4e')][_0xb17b('0x54')](_0x53b308)[_0xb17b('0x20')](handleEntityNotFound(_0x285f45,null))[_0xb17b('0x20')](respondWithResult(_0x285f45,null))[_0xb17b('0x2b')](handleError(_0x285f45,null));};exports[_0xb17b('0x55')]=function(_0x51427b,_0x32a022){return db['SmsMessage']['create'](_0x51427b[_0xb17b('0x56')],{})['then'](respondWithResult(_0x32a022,0xc9))['catch'](handleError(_0x32a022,null));};exports[_0xb17b('0x36')]=function(_0xbc27fe,_0x200161){if(_0xbc27fe[_0xb17b('0x56')]['id']){delete _0xbc27fe[_0xb17b('0x56')]['id'];}return db[_0xb17b('0x4e')][_0xb17b('0x54')]({'where':{'id':_0xbc27fe[_0xb17b('0x52')]['id']}})[_0xb17b('0x20')](handleEntityNotFound(_0x200161,null))[_0xb17b('0x20')](saveUpdates(_0xbc27fe['body'],null))['then'](respondWithResult(_0x200161,null))[_0xb17b('0x2b')](handleError(_0x200161,null));};exports['destroy']=function(_0x46929f,_0x24d181){return db[_0xb17b('0x4e')][_0xb17b('0x54')]({'where':{'id':_0x46929f[_0xb17b('0x52')]['id']}})[_0xb17b('0x20')](handleEntityNotFound(_0x24d181,null))[_0xb17b('0x20')](removeEntity(_0x24d181,null))[_0xb17b('0x2b')](handleError(_0x24d181,null));};exports[_0xb17b('0x57')]=function(_0x214299,_0xbddd73){return db[_0xb17b('0x4e')][_0xb17b('0x57')]()[_0xb17b('0x20')](respondWithResult(_0xbddd73,null))[_0xb17b('0x2b')](handleError(_0xbddd73,null));};var interaction_log=require(_0xb17b('0x58'))(_0xb17b('0x59'));exports[_0xb17b('0x5a')]=function(_0x1db897,_0x4b4fcc,_0x32466b){var _0x2f4c62={'agent':{},'channel':'sms'};if(_0x1db897[_0xb17b('0x56')]['id']){delete _0x1db897[_0xb17b('0x56')]['id'];}_0x1db897[_0xb17b('0x56')]['read']=!![];_0x1db897[_0xb17b('0x56')][_0xb17b('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1db897['body'][_0xb17b('0x5c')]=_0x1db897[_0xb17b('0x56')][_0xb17b('0x5c')]||_0x1db897[_0xb17b('0x5d')]['id'];_0x2f4c62[_0xb17b('0x5e')]['id']=_0x1db897[_0xb17b('0x56')][_0xb17b('0x5c')];return db['SmsMessage'][_0xb17b('0x54')]({'where':{'id':_0x1db897[_0xb17b('0x52')]['id'],'UserId':null}})[_0xb17b('0x20')](handleEntityNotFound(_0x4b4fcc,null))['then'](saveUpdates(_0x1db897[_0xb17b('0x56')],null))[_0xb17b('0x20')](function(_0x20f613){if(_0x20f613){_0x2f4c62[_0xb17b('0x29')]=_0x20f613[_0xb17b('0x5f')]({'plain':!![]});return db[_0xb17b('0x60')]['find']({'where':{'id':_0x20f613[_0xb17b('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x4b4fcc,null))[_0xb17b('0x20')](function(_0x4a653a){if(_0x4a653a){return _0x4a653a['update']({'UserId':_0x1db897[_0xb17b('0x56')][_0xb17b('0x5c')],'read1stAt':_[_0xb17b('0x62')](_0x4a653a[_0xb17b('0x63')])?moment()[_0xb17b('0x64')](_0xb17b('0x65')):undefined});}return null;})['then'](function(_0x380533){if(_0x380533){_0x2f4c62[_0xb17b('0x66')]=_0x380533['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1db897[_0xb17b('0x5d')]['id'],_0x1db897['user'][_0xb17b('0x3e')],_0x1db897[_0xb17b('0x5d')]['role'],_0x2f4c62[_0xb17b('0x66')]['id'],_0x1db897[_0xb17b('0x56')]?JSON[_0xb17b('0x26')](_0x1db897[_0xb17b('0x56')]):_0xb17b('0x67'));return respondWithRpcPromise(_0xb17b('0x68'),'acceptMessage',_0x2f4c62);}return null;})[_0xb17b('0x20')](function(_0x51bb6c){var _0x1c6bf2=_0xb17b('0x69')+_0x51bb6c['message'][_0xb17b('0x6a')];return db['sequelize'][_0xb17b('0x3f')](_0x1c6bf2,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2a9d07){return _0x2a9d07;});})[_0xb17b('0x20')](function(_0x4b3158){if(_0x4b3158){_0x2f4c62[_0xb17b('0x29')][_0xb17b('0x6b')]=_0x4b3158[0x0];if(!_0x1db897[_0xb17b('0x56')][_0xb17b('0x5c')])return;return db[_0xb17b('0x6c')][_0xb17b('0x54')]({'where':{'id':_0x1db897['body'][_0xb17b('0x5c')],'role':_0xb17b('0x5e')},'attributes':['id',_0xb17b('0x3e'),_0xb17b('0x6d'),_0xb17b('0x6e'),'internal'],'raw':!![]});}return null;})[_0xb17b('0x20')](function(_0x143606){if(!_0x143606)return null;_0x2f4c62[_0xb17b('0x29')][_0xb17b('0x5e')]=_0x143606;return _0x2f4c62;})[_0xb17b('0x20')](function(_0x322ee7){if(_0x322ee7){if(_0x1db897[_0xb17b('0x56')]['manual']){_0x2f4c62[_0xb17b('0x29')]['interface']=util[_0xb17b('0x64')](_0xb17b('0x6f'),_0x1db897[_0xb17b('0x5d')][_0xb17b('0x3e')]);_0x2f4c62[_0xb17b('0x29')][_0xb17b('0x70')]=_0x2f4c62['channel'];_0x2f4c62['message'][_0xb17b('0x71')]=_0x2f4c62['channel'];_0x2f4c62[_0xb17b('0x29')][_0xb17b('0x72')]=_0xb17b('0x5a');return respondWithRpcPromise(_0xb17b('0x73'),_0xb17b('0x73'),{'event':'acceptmessage','message':_0x2f4c62[_0xb17b('0x29')]},client9002)[_0xb17b('0x20')](function(){return _0x2f4c62;});}return _0x2f4c62;}return null;})[_0xb17b('0x20')](respondWithResult(_0x4b4fcc,null))['catch'](handleError(_0x4b4fcc,null));};var interaction_log=require('../../config/logger')(_0xb17b('0x59'));exports[_0xb17b('0x34')]=function(_0x4e4e54,_0x3eaa41,_0x21f331){var _0x24a8de={'agent':{},'channel':_0xb17b('0x74')};if(_0x4e4e54['body']['id']){delete _0x4e4e54['body']['id'];}_0x4e4e54[_0xb17b('0x56')][_0xb17b('0x5c')]=_0x4e4e54[_0xb17b('0x56')]['UserId']||_0x4e4e54[_0xb17b('0x5d')]['id'];_0x24a8de[_0xb17b('0x5e')]['id']=_0x4e4e54[_0xb17b('0x56')]['UserId'];return db[_0xb17b('0x4e')][_0xb17b('0x54')]({'where':{'id':_0x4e4e54[_0xb17b('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3eaa41,null))[_0xb17b('0x20')](function(_0x8b15ea){if(_0x8b15ea){_0x24a8de['message']=_0x8b15ea['get']({'plain':!![]});return db[_0xb17b('0x60')][_0xb17b('0x54')]({'where':{'id':_0x8b15ea[_0xb17b('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x3eaa41,null))['then'](function(_0x5eb39f){if(_0x5eb39f){_0x24a8de[_0xb17b('0x66')]=_0x5eb39f[_0xb17b('0x5f')]({'plain':!![]});interaction_log[_0xb17b('0x21')](_0xb17b('0x75'),_0x4e4e54['user']['id'],_0x4e4e54[_0xb17b('0x5d')]['name'],_0x4e4e54[_0xb17b('0x5d')]['role'],_0x24a8de[_0xb17b('0x66')]['id'],_0x4e4e54[_0xb17b('0x56')]?JSON[_0xb17b('0x26')](_0x4e4e54['body']):_0xb17b('0x67'));return respondWithRpcPromise(_0xb17b('0x76'),_0xb17b('0x77'),_0x24a8de);}return null;})[_0xb17b('0x20')](function(_0x119838){var _0x479b80=_0xb17b('0x69')+_0x119838['message'][_0xb17b('0x6a')];return db[_0xb17b('0x78')][_0xb17b('0x3f')](_0x479b80,{'type':db[_0xb17b('0x79')][_0xb17b('0x7a')][_0xb17b('0x7b')],'raw':!![]})['then'](function(_0x3de604){return _0x3de604;});})[_0xb17b('0x20')](function(_0x291ff0){if(_0x291ff0){_0x24a8de[_0xb17b('0x29')]['contact']=_0x291ff0[0x0];if(!_0x4e4e54[_0xb17b('0x56')]['UserId'])return;return db[_0xb17b('0x6c')]['find']({'where':{'id':_0x4e4e54[_0xb17b('0x56')][_0xb17b('0x5c')],'role':_0xb17b('0x5e')},'attributes':['id',_0xb17b('0x3e'),_0xb17b('0x6d'),'email',_0xb17b('0x7c')],'raw':!![]});}return null;})['then'](function(_0x2bd699){if(!_0x2bd699)return null;_0x24a8de[_0xb17b('0x29')][_0xb17b('0x5e')]=_0x2bd699;return _0x24a8de;})[_0xb17b('0x20')](function(_0x303b15){if(_0x303b15){_0x303b15[_0xb17b('0x29')][_0xb17b('0x7d')]=util[_0xb17b('0x64')]('SIP/%s',_0x4e4e54[_0xb17b('0x5d')][_0xb17b('0x3e')]);_0x303b15[_0xb17b('0x29')][_0xb17b('0x70')]=_0x24a8de[_0xb17b('0x70')];_0x303b15['message'][_0xb17b('0x71')]=_0x24a8de[_0xb17b('0x70')];_0x303b15[_0xb17b('0x29')][_0xb17b('0x72')]='reject';respondWithRpcPromise(_0xb17b('0x73'),_0xb17b('0x73'),{'event':'rejectmessage','message':_0x303b15['message']},client9002);return _0x24a8de;}return null;})[_0xb17b('0x20')](respondWithResult(_0x3eaa41,null))[_0xb17b('0x2b')](handleError(_0x3eaa41,null));};exports[_0xb17b('0x2c')]=function(_0x281bce,_0x37d711,_0x418acd){if(_0x281bce[_0xb17b('0x56')]['id']){delete _0x281bce[_0xb17b('0x56')]['id'];}var _0x453b4e;return db['SmsMessage'][_0xb17b('0x54')]({'where':{'id':_0x281bce[_0xb17b('0x52')]['id']}})[_0xb17b('0x20')](handleEntityNotFound(_0x37d711,null))[_0xb17b('0x20')](function(_0x320232){if(_0x320232){_0x453b4e=_0x320232;return db[_0xb17b('0x7e')][_0xb17b('0x54')]({'where':{'id':_0x320232[_0xb17b('0x7f')]}});}})[_0xb17b('0x20')](handleEntityNotFound(_0x37d711,null))[_0xb17b('0x20')](function(_0x2aa9e8){if(_0x2aa9e8){logger['debug'](_0xb17b('0x25'),_0xb17b('0x2c'),_0xb17b('0x80'),_0x2aa9e8[_0xb17b('0x4b')],util[_0xb17b('0x81')](_0x281bce[_0xb17b('0x56')],{'showHidden':![],'depth':null}));switch(_0x2aa9e8[_0xb17b('0x4b')]){case _0xb17b('0x82'):if(_0x281bce[_0xb17b('0x56')][_0xb17b('0x83')]&&_0x281bce[_0xb17b('0x56')][_0xb17b('0x83')]===_0x453b4e[_0xb17b('0x84')]){return _0x453b4e[_0xb17b('0x36')]({'read':!![]});}else{logger[_0xb17b('0x27')](_0xb17b('0x85'),_0xb17b('0x2c'),'twilio',util[_0xb17b('0x81')](_0x281bce[_0xb17b('0x56')],{'showHidden':![],'depth':null}));}break;case _0xb17b('0x86'):if(_0x281bce['body'][_0xb17b('0x87')]&&_0x281bce['body'][_0xb17b('0x87')]===_0x453b4e[_0xb17b('0x84')]&&_[_0xb17b('0x88')]([_0xb17b('0x89'),_0xb17b('0x8a')],_0x281bce[_0xb17b('0x56')][_0xb17b('0x8b')])>=0x0){return _0x453b4e[_0xb17b('0x36')]({'read':!![]});}else{logger[_0xb17b('0x27')](_0xb17b('0x85'),_0xb17b('0x2c'),_0xb17b('0x8c'),util['inspect'](_0x281bce[_0xb17b('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x493a98=_0x281bce['body'][_0xb17b('0x8d')][0x0];if(_0x493a98[_0xb17b('0x2c')]['groupName']===_0xb17b('0x8e')){return _0x453b4e[_0xb17b('0x36')]({'read':!![]});}else{logger[_0xb17b('0x27')](_0xb17b('0x85'),'status','infobip',util[_0xb17b('0x81')](_0x281bce['body'],{'showHidden':![],'depth':null}));}break;}return _0x453b4e;}})[_0xb17b('0x20')](respondWithResult(_0x37d711,null))[_0xb17b('0x2b')](handleError(_0x37d711,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 125c2f3..137bad7 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 _0xf22b=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x25bcf5,_0x2ee817){var _0x5c22af=function(_0x6316){while(--_0x6316){_0x25bcf5['push'](_0x25bcf5['shift']());}};_0x5c22af(++_0x2ee817);}(_0xf22b,0x174));var _0xbf22=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xf22b[_0x3fa37f];return _0x5a01d5;};'use strict';var EventEmitter=require(_0xbf22('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbf22('0x1')](0x0);var events={'afterCreate':_0xbf22('0x2'),'afterUpdate':'update','afterDestroy':_0xbf22('0x3')};function emitEvent(_0x4cdf6e){return function(_0x3bc148,_0x99aa25,_0x544ebe){SmsMessageEvents[_0xbf22('0x4')](_0x4cdf6e+':'+_0x3bc148['id'],_0x3bc148);SmsMessageEvents['emit'](_0x4cdf6e,_0x3bc148);_0x544ebe(null);};}for(var e in events){if(events[_0xbf22('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xbf22('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0xad69=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x37185d,_0x5cf5c3){var _0x3bd1b4=function(_0x1e4bbd){while(--_0x1e4bbd){_0x37185d['push'](_0x37185d['shift']());}};_0x3bd1b4(++_0x5cf5c3);}(_0xad69,0x1af));var _0x9ad6=function(_0x5e2bed,_0x1ecf57){_0x5e2bed=_0x5e2bed-0x0;var _0x1ef264=_0xad69[_0x5e2bed];return _0x1ef264;};'use strict';var EventEmitter=require(_0x9ad6('0x0'));var SmsMessage=require(_0x9ad6('0x1'))['db'][_0x9ad6('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9ad6('0x3')](0x0);var events={'afterCreate':_0x9ad6('0x4'),'afterUpdate':_0x9ad6('0x5'),'afterDestroy':_0x9ad6('0x6')};function emitEvent(_0x4e9dd6){return function(_0x77849e,_0x21df82,_0x50ef8f){SmsMessageEvents[_0x9ad6('0x7')](_0x4e9dd6+':'+_0x77849e['id'],_0x77849e);SmsMessageEvents[_0x9ad6('0x7')](_0x4e9dd6,_0x77849e);_0x50ef8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x9ad6('0x8')](e,emitEvent(event));}}module[_0x9ad6('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 8d6db43..d6ad695 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 _0xa25e=['hex','signature=','/external/get/send.php?','csc','clickatell','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','catch','error','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','inspect','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','base64','http_code','data','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','createHash','md5'];(function(_0x1a582e,_0x567fce){var _0x704b00=function(_0x4b50be){while(--_0x4b50be){_0x1a582e['push'](_0x1a582e['shift']());}};_0x704b00(++_0x567fce);}(_0xa25e,0x1e9));var _0xea25=function(_0x1471db,_0x3c0238){_0x1471db=_0x1471db-0x0;var _0x54d6ee=_0xa25e[_0x1471db];return _0x54d6ee;};'use strict';var _=require(_0xea25('0x0'));var util=require(_0xea25('0x1'));var logger=require(_0xea25('0x2'))(_0xea25('0x3'));var moment=require(_0xea25('0x4'));var BPromise=require(_0xea25('0x5'));var rp=require(_0xea25('0x6'));var fs=require('fs');var path=require(_0xea25('0x7'));var rimraf=require(_0xea25('0x8'));var config=require(_0xea25('0x9'));var attributes=require(_0xea25('0xa'));module['exports']=function(_0x2d5457,_0x44dbc0){return _0x2d5457['define']('SmsMessage',attributes,{'tableName':_0xea25('0xb'),'paranoid':![],'indexes':[{'name':_0xea25('0xc'),'fields':[_0xea25('0xc')]},{'name':'fti_sms_messages','fields':[_0xea25('0xd')],'type':_0xea25('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26fb6a,_0x262524,_0x5d59c4){var _0x58f5b4=_0x2d5457[_0xea25('0xf')];var _0x24145c=_0x26fb6a[_0xea25('0x10')]({'plain':!![]});if(_0x24145c['direction'][_0xea25('0x11')]()==='in'||_0x24145c[_0xea25('0x12')][_0xea25('0x11')]()===_0xea25('0x13')&&!_0x24145c[_0xea25('0x14')]&&!_[_0xea25('0x15')](_0x24145c[_0xea25('0x16')])&&!_['isNil'](_0x24145c[_0xea25('0x17')])){_0x58f5b4[_0xea25('0x18')][_0xea25('0x19')]({'where':{'id':_0x24145c[_0xea25('0x17')]}})[_0xea25('0x1a')](function(_0x29665d){if(_0x29665d){_0x29665d['update']({'lastMsgAt':_0x24145c['createdAt'],'lastMsgDirection':_0x24145c['direction']['toLowerCase']()});}})[_0xea25('0x1b')](function(_0x18565f){console[_0xea25('0x1c')](_0x18565f);});}if(_0x24145c['direction']==='out'&&!_0x24145c['secret']){var _0x2e3803;_0x58f5b4['SmsAccount']['find']({'where':{'id':_0x24145c[_0xea25('0x1d')]},'raw':!![]})['then'](function(_0x3a8344){_0x2e3803=_0x3a8344;if(_0x2e3803&&_0x2e3803[_0xea25('0x1e')]){switch(_0x2e3803[_0xea25('0x1e')]){case _0xea25('0x1f'):var _0x3ce6cb=require(_0xea25('0x1f'));if(_0x2e3803[_0xea25('0x20')]&&_0x2e3803['authToken']&&_0x2e3803[_0xea25('0x21')]){var _0x2374d4=new _0x3ce6cb(_0x2e3803[_0xea25('0x20')],_0x2e3803['authToken']);_0x2374d4[_0xea25('0x22')][_0xea25('0x23')]({'body':_0x24145c['body'],'to':_0x24145c['phone'],'from':_0x2e3803['phone'],'statusCallback':_0x2e3803[_0xea25('0x24')]+_0xea25('0x25')+_0x24145c['id']+_0xea25('0x26')+_0x2e3803[_0xea25('0x27')]})[_0xea25('0x1a')](function(_0x4927c4){if(_0x4927c4[_0xea25('0x28')]){return _0x26fb6a[_0xea25('0x29')]({'messageId':_0x4927c4[_0xea25('0x28')]});}})[_0xea25('0x1b')](function(_0x300e7e){logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x1f'),util['inspect'](_0x300e7e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xea25('0x2a'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xea25('0x2c'):var _0x100247=_0xea25('0x2d');if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){var _0x5c4bb3={'recipient':[_0x24145c[_0xea25('0x21')]],'message':_0x24145c['body'],'message_type':_0x2e3803[_0xea25('0x30')]};if(_0x2e3803[_0xea25('0x30')]&&_0x2e3803['smsMethod']!=='SI'){_0x5c4bb3[_0xea25('0x31')]=_0x2e3803[_0xea25('0x21')];}var _0x5ee688={'url':_0x100247+'login?username='+_0x2e3803[_0xea25('0x2e')]+'&password='+_0x2e3803['password'],'method':_0xea25('0x32')};rp(_0x5ee688)[_0xea25('0x1a')](function(_0x27f861){var _0x311636=_0x27f861[_0xea25('0x33')](';');var _0x3dda58={'user_key':_0x311636[0x0],'session_key':_0x311636[0x1]};_0x5ee688={'url':_0x100247+_0xea25('0x34'),'method':_0xea25('0x35'),'headers':{'user_key':_0x3dda58[_0xea25('0x36')],'Session_key':_0x3dda58['session_key']},'json':!![],'body':_0x5c4bb3};return rp(_0x5ee688);})[_0xea25('0x1a')](function(_0x46423e){if(_0x46423e[_0xea25('0x37')]>=0x1){var _0x874aab={'messageId':_0x46423e[_0xea25('0x38')]};if(_0x2e3803[_0xea25('0x30')]!=='GP'||!_0x2e3803[_0xea25('0x39')]){_0x874aab['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x874aab);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'skebby',util[_0xea25('0x3a')](_0x46423e,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x303574){return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate','skebby',util[_0xea25('0x3a')](_0x303574,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xea25('0x3b'):if(_0x2e3803[_0xea25('0x3c')]){var _0x240d7c={'recipient':_0x24145c[_0xea25('0x21')],'message':_0x24145c[_0xea25('0xd')],'sender':_0x2e3803[_0xea25('0x3d')]||_0x2e3803['phone'],'authorization':_0x2e3803['authToken']};var _0x262524={'method':_0xea25('0x35'),'uri':_0xea25('0x3e'),'body':_0x240d7c,'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x58d6b5){var _0x28ec78={'messageId':_0x58d6b5[_0xea25('0x3f')]};if(!_0x2e3803['deliveryReport']){_0x28ec78[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x28ec78);})[_0xea25('0x1b')](function(_0x2be806){logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'connectel',util[_0xea25('0x3a')](_0x2be806,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x3b'),_0xea25('0x41'));}break;case _0xea25('0x42'):if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){var _0x240d7c={'messages':[{'source':_0xea25('0x43'),'to':_0x24145c[_0xea25('0x21')],'body':_0x24145c[_0xea25('0xd')],'from':_0x2e3803[_0xea25('0x3d')]||_0x2e3803[_0xea25('0x21')]}]};var _0x3949b6=util[_0xea25('0x44')](_0xea25('0x45'),_0x2e3803[_0xea25('0x2e')],_0x2e3803[_0xea25('0x2f')]);var _0x262524={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x240d7c,'headers':{'Authorization':util[_0xea25('0x44')]('Basic\x20%s',new Buffer(_0x3949b6)[_0xea25('0x46')](_0xea25('0x47')))},'json':!![]};rp(_0x262524)['then'](function(_0x5006cb){if(_0x5006cb[_0xea25('0x48')]>=0xc8&&_0x5006cb[_0xea25('0x48')]<=0xce){if(_0x5006cb[_0xea25('0x49')]&&_0x5006cb['data']['queued_count']>0x0){var _0x21f296=_[_0xea25('0x4a')](_0x5006cb['data'][_0xea25('0x22')]);var _0x53361a={'messageId':_0x21f296['message_id']};if(!_0x2e3803[_0xea25('0x39')]){_0x53361a[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x53361a);}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x4b'),util[_0xea25('0x3a')](_0x5006cb,{'showHidden':![],'depth':null}));}}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'clickSend',util[_0xea25('0x3a')](_0x5006cb,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x519d13){logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x4b'),util[_0xea25('0x3a')](_0x519d13,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x4b'),_0xea25('0x4c'));}break;case _0xea25('0x4d'):if(_0x2e3803[_0xea25('0x4e')]&&_0x2e3803[_0xea25('0x3c')]){var _0x240d7c={'dst':_0x24145c[_0xea25('0x21')],'text':_0x24145c[_0xea25('0xd')],'src':_0x2e3803[_0xea25('0x3d')]||_0x2e3803[_0xea25('0x21')],'url':_0x2e3803[_0xea25('0x24')]+_0xea25('0x25')+_0x24145c['id']+'/status?token='+_0x2e3803[_0xea25('0x27')]};var _0x3949b6=util['format'](_0xea25('0x45'),_0x2e3803['authId'],_0x2e3803['authToken']);var _0x262524={'method':'POST','uri':util['format'](_0xea25('0x4f'),_0x2e3803['authId']),'body':_0x240d7c,'headers':{'Authorization':util['format'](_0xea25('0x50'),new Buffer(_0x3949b6)[_0xea25('0x46')](_0xea25('0x47')))},'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x3c16a1){var _0x34bae2={'messageId':_0x3c16a1[_0xea25('0x51')][0x0]};return _0x26fb6a[_0xea25('0x29')](_0x34bae2);})[_0xea25('0x1b')](function(_0x36bc5c){logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),'plivo',util['inspect'](_0x36bc5c,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x4d'),_0xea25('0x52'));}break;case'infobip':if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){if(_0x2e3803[_0xea25('0x53')]){var _0x42401a={'method':'POST','uri':_0x2e3803[_0xea25('0x53')]+_0xea25('0x54'),'body':{'username':_0x2e3803['username'],'password':_0x2e3803['password']},'json':!![]};return rp(_0x42401a)[_0xea25('0x1a')](function(_0x4927ec){var _0x2ea9e9={'method':_0xea25('0x35'),'uri':_0x2e3803[_0xea25('0x53')]+_0xea25('0x55'),'body':{'messages':[{'from':_0x2e3803[_0xea25('0x21')],'destinations':[{'to':_0x24145c[_0xea25('0x21')]}],'text':_0x24145c[_0xea25('0xd')],'notifyUrl':_0x2e3803['remote']+_0xea25('0x25')+_0x24145c['id']+_0xea25('0x26')+_0x2e3803[_0xea25('0x27')],'notifyContentType':'application/json','callbackData':_0x2e3803[_0xea25('0x21')]+';'+_0x24145c[_0xea25('0xd')]}]},'headers':{'Authorization':_0xea25('0x56')+_0x4927ec[_0xea25('0x27')]},'json':!![]};return rp(_0x2ea9e9)[_0xea25('0x1a')](function(_0x14ee18){if(_0x14ee18['messages']){var _0x4a8270={'messageId':_0x14ee18[_0xea25('0x22')][0x0][_0xea25('0xc')]};if(!_0x2e3803[_0xea25('0x39')]){_0x4a8270['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x4a8270);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x57'),util['inspect'](_0x14ee18,{'showHidden':![],'depth':null}));}});})[_0xea25('0x1b')](function(_0x28b9a9){return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'infobip',util['inspect'](_0x28b9a9,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x57'),_0xea25('0x58'));}}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x4be76b=require(_0xea25('0x59'));if(_0x2e3803[_0xea25('0x5a')]){var _0x2a51f5={};_0x2a51f5[_0xea25('0x5b')]=_0x2e3803[_0xea25('0x2e')];_0x2a51f5['phone']=_0x24145c[_0xea25('0x21')];_0x2a51f5[_0xea25('0x31')]=_0x2e3803[_0xea25('0x21')];_0x2a51f5[_0xea25('0x5c')]=_0x24145c[_0xea25('0xd')];_0x2a51f5['timestamp']=+new Date();var _0x47fc27='';var _0x571a5a='';var _0x528fce=Object[_0xea25('0x5d')](_0x2a51f5);_0x528fce['sort']();for(var _0x203da3=0x0;_0x203da3<_0x528fce['length'];_0x203da3++){if(_0x47fc27!=''){_0x47fc27+='&';}_0x47fc27+=_0x528fce[_0x203da3]+'='+encodeURIComponent(_0x2a51f5[_0x528fce[_0x203da3]]);_0x571a5a+=_0x2a51f5[_0x528fce[_0x203da3]];}_0x571a5a+=_0x2e3803[_0xea25('0x5a')];_0x571a5a=_0x4be76b[_0xea25('0x5e')](_0xea25('0x5f'))['update'](_0x571a5a)['digest'](_0xea25('0x60'));if(_0x47fc27!==''){_0x47fc27+='&';}_0x47fc27+=_0xea25('0x61')+_0x571a5a;var _0x5ee688={'method':'GET','uri':_0x2e3803['baseUrl']+_0xea25('0x62')+_0x47fc27,'json':!![]};return rp(_0x5ee688)['then'](function(_0x139c71){var _0x100f5c=Object[_0xea25('0x5d')](_0x139c71);if(_0x139c71[_0x100f5c[0x0]][_0xea25('0x1c')]&&parseInt(_0x139c71[_0x100f5c[0x0]][_0xea25('0x1c')])===0x0){var _0x52b0ce={'messageId':_0x139c71[_0x100f5c[0x0]]['id_sms']};if(!_0x2e3803[_0xea25('0x39')]){_0x52b0ce['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x52b0ce);}else{return logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x63'),util['inspect'](_0x139c71['error'],{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x4a3036){return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate','csc',util[_0xea25('0x3a')](_0x4a3036,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0xea25('0x64'):if(_0x2e3803[_0xea25('0x5a')]){var _0x3f63e3={'method':_0xea25('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2e3803[_0xea25('0x5a')]},'body':{'content':_0x24145c['body'],'to':[_0x24145c['phone']],'from':_0x2e3803[_0xea25('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xea25('0x65')},'json':!![]};rp(_0x3f63e3)[_0xea25('0x1a')](function(_0x3b0c24){if(!_0x3b0c24['error']){var _0x4fcf97={'messageId':_0x3b0c24[_0xea25('0x22')][0x0][_0xea25('0x66')]};if(!_0x2e3803[_0xea25('0x39')]){_0x4fcf97[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x4fcf97);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x64'),util[_0xea25('0x3a')](_0x3b0c24[_0xea25('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x33f403){return logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),'clickatell',util['inspect'](_0x33f403,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x64'),'Missing\x20parameters:\x20apiKey');}break;case _0xea25('0x67'):if(_0x2e3803['username']&&_0x2e3803[_0xea25('0x2f')]){var _0x3949b6=util[_0xea25('0x44')]('%s:%s',_0x2e3803[_0xea25('0x2e')],_0x2e3803[_0xea25('0x2f')]);var _0x262524={'method':_0xea25('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x2e3803[_0xea25('0x68')]+_0xea25('0x69'),'body':{'to':[_0x24145c[_0xea25('0x21')]],'text':_0x24145c[_0xea25('0xd')],'from':_0x2e3803[_0xea25('0x21')],'applicationId':_0x2e3803[_0xea25('0x6a')]},'headers':{'Authorization':util['format'](_0xea25('0x50'),new Buffer(_0x3949b6)[_0xea25('0x46')]('base64'))},'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x305e97){if(_0x305e97['id']){var _0x299ae5={'messageId':_0x305e97['id']};return _0x26fb6a[_0xea25('0x29')](_0x299ae5);}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x67'),util['inspect'](_0x305e97,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x292008){logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x67'),util[_0xea25('0x3a')](_0x292008,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x67'),_0xea25('0x4c'));}break;case _0xea25('0x6b'):if(_0x2e3803[_0xea25('0x5a')]){var _0x138146={};var _0x5ee688={'method':'POST','uri':_0xea25('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x2e3803[_0xea25('0x5a')],'Content-Type':_0xea25('0x6d')},'body':{'from':_0x2e3803[_0xea25('0x21')],'to':_0x24145c['phone'],'text':_0x24145c[_0xea25('0xd')]},'json':!![]};return rp(_0x5ee688)['then'](function(_0x34d32a){if(_0x34d32a[_0xea25('0x6e')]==0xca){_0x138146['message']=_0x34d32a;var _0x2e48ef={'method':_0xea25('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xea25('0x6f')+_0x2e3803[_0xea25('0x5a')],'Content-Type':_0xea25('0x6d')},'body':{'refid':_0x138146['message']['refid']},'json':!![]};return rp(_0x2e48ef)[_0xea25('0x1a')](function(_0x274b1e){_0x138146['status']=_0x274b1e;var _0x2adb5e={'messageId':_0x138146['message'][_0xea25('0x70')],'read':!![]};return _0x26fb6a[_0xea25('0x29')](_0x2adb5e);});}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x6b'),util[_0xea25('0x3a')](_0x34d32a,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x411ca7){return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x6b'),util['inspect'](_0x411ca7,{'showHidden':![],'depth':null}));});}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x6b'),_0xea25('0x71'));}break;}}})[_0xea25('0x72')](function(){_0x5d59c4();});}else{_0x5d59c4();}}},'charset':_0xea25('0x73'),'collate':_0xea25('0x74')});}; \ No newline at end of file +var _0x8564=['update','createdAt','direction','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','POST','user_key','total_sent','internal_order_id','deliveryReport','read','error','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/api/sms/messages/','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','sort','length','createHash','hex','signature=','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','then'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x8564,0x1e3));var _0x4856=function(_0xa4b9bf,_0x4a612e){_0xa4b9bf=_0xa4b9bf-0x0;var _0x103455=_0x8564[_0xa4b9bf];return _0x103455;};'use strict';var _=require(_0x4856('0x0'));var util=require(_0x4856('0x1'));var logger=require('../../config/logger')(_0x4856('0x2'));var moment=require(_0x4856('0x3'));var BPromise=require(_0x4856('0x4'));var rp=require(_0x4856('0x5'));var fs=require('fs');var path=require(_0x4856('0x6'));var rimraf=require(_0x4856('0x7'));var config=require(_0x4856('0x8'));var attributes=require(_0x4856('0x9'));module[_0x4856('0xa')]=function(_0x339a0d,_0x4792b3){return _0x339a0d[_0x4856('0xb')](_0x4856('0xc'),attributes,{'tableName':_0x4856('0xd'),'paranoid':![],'indexes':[{'name':_0x4856('0xe'),'fields':[_0x4856('0xe')]},{'name':_0x4856('0xf'),'fields':[_0x4856('0x10')],'type':_0x4856('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d8612,_0x569448,_0x50fe45){var _0x574783=_0x339a0d[_0x4856('0x12')];var _0x3ba53b=_0x5d8612[_0x4856('0x13')]({'plain':!![]});if(_0x3ba53b['direction'][_0x4856('0x14')]()==='in'||_0x3ba53b['direction'][_0x4856('0x14')]()===_0x4856('0x15')&&!_0x3ba53b[_0x4856('0x16')]&&!_['isNil'](_0x3ba53b[_0x4856('0x17')])&&!_[_0x4856('0x18')](_0x3ba53b[_0x4856('0x19')])){_0x574783[_0x4856('0x1a')][_0x4856('0x1b')]({'where':{'id':_0x3ba53b['SmsInteractionId']}})[_0x4856('0x1c')](function(_0x3e584f){if(_0x3e584f){_0x3e584f[_0x4856('0x1d')]({'lastMsgAt':_0x3ba53b[_0x4856('0x1e')],'lastMsgDirection':_0x3ba53b[_0x4856('0x1f')][_0x4856('0x14')]()});}})[_0x4856('0x20')](function(_0x43bac9){console['error'](_0x43bac9);});}if(_0x3ba53b[_0x4856('0x1f')]===_0x4856('0x15')&&!_0x3ba53b['secret']){var _0x1ffdb3;_0x574783[_0x4856('0x21')][_0x4856('0x22')]({'where':{'id':_0x3ba53b[_0x4856('0x23')]},'raw':!![]})[_0x4856('0x1c')](function(_0x1b85bd){_0x1ffdb3=_0x1b85bd;if(_0x1ffdb3&&_0x1ffdb3[_0x4856('0x24')]){switch(_0x1ffdb3[_0x4856('0x24')]){case _0x4856('0x25'):var _0x17f895=require('twilio');if(_0x1ffdb3[_0x4856('0x26')]&&_0x1ffdb3[_0x4856('0x27')]&&_0x1ffdb3[_0x4856('0x28')]){var _0x42b7f1=new _0x17f895(_0x1ffdb3[_0x4856('0x26')],_0x1ffdb3[_0x4856('0x27')]);_0x42b7f1['messages'][_0x4856('0x29')]({'body':_0x3ba53b[_0x4856('0x10')],'to':_0x3ba53b[_0x4856('0x28')],'from':_0x1ffdb3['phone'],'statusCallback':_0x1ffdb3[_0x4856('0x2a')]+'/api/sms/messages/'+_0x3ba53b['id']+'/status?token='+_0x1ffdb3[_0x4856('0x2b')]})[_0x4856('0x1c')](function(_0x134634){if(_0x134634['sid']){return _0x5d8612[_0x4856('0x1d')]({'messageId':_0x134634[_0x4856('0x2c')]});}})[_0x4856('0x20')](function(_0x378ad5){logger['error'](_0x4856('0x2d'),'afterCreate',_0x4856('0x25'),util[_0x4856('0x2e')](_0x378ad5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x25'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4856('0x30'):var _0x5d12b2=_0x4856('0x31');if(_0x1ffdb3[_0x4856('0x32')]&&_0x1ffdb3[_0x4856('0x33')]){var _0x522507={'recipient':[_0x3ba53b['phone']],'message':_0x3ba53b[_0x4856('0x10')],'message_type':_0x1ffdb3[_0x4856('0x34')]};if(_0x1ffdb3[_0x4856('0x34')]&&_0x1ffdb3[_0x4856('0x34')]!=='SI'){_0x522507[_0x4856('0x35')]=_0x1ffdb3['phone'];}var _0x1fc853={'url':_0x5d12b2+_0x4856('0x36')+_0x1ffdb3['username']+_0x4856('0x37')+_0x1ffdb3[_0x4856('0x33')],'method':_0x4856('0x38')};rp(_0x1fc853)[_0x4856('0x1c')](function(_0x261045){var _0x12cf9e=_0x261045[_0x4856('0x39')](';');var _0x1752aa={'user_key':_0x12cf9e[0x0],'session_key':_0x12cf9e[0x1]};_0x1fc853={'url':_0x5d12b2+'sms','method':_0x4856('0x3a'),'headers':{'user_key':_0x1752aa[_0x4856('0x3b')],'Session_key':_0x1752aa['session_key']},'json':!![],'body':_0x522507};return rp(_0x1fc853);})['then'](function(_0x5d8bb6){if(_0x5d8bb6[_0x4856('0x3c')]>=0x1){var _0x3a59db={'messageId':_0x5d8bb6[_0x4856('0x3d')]};if(_0x1ffdb3[_0x4856('0x34')]!=='GP'||!_0x1ffdb3[_0x4856('0x3e')]){_0x3a59db[_0x4856('0x3f')]=!![];}return _0x5d8612['update'](_0x3a59db);}else{return logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x30'),util[_0x4856('0x2e')](_0x5d8bb6,{'showHidden':![],'depth':null}));}})[_0x4856('0x20')](function(_0x1522b6){return logger['error'](_0x4856('0x2d'),'afterCreate',_0x4856('0x30'),util[_0x4856('0x2e')](_0x1522b6,{'showHidden':![],'depth':null}));});}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x30'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4856('0x41'):if(_0x1ffdb3[_0x4856('0x27')]){var _0x408e59={'recipient':_0x3ba53b[_0x4856('0x28')],'message':_0x3ba53b[_0x4856('0x10')],'sender':_0x1ffdb3['senderString']||_0x1ffdb3['phone'],'authorization':_0x1ffdb3[_0x4856('0x27')]};var _0x569448={'method':_0x4856('0x3a'),'uri':_0x4856('0x42'),'body':_0x408e59,'json':!![]};rp(_0x569448)[_0x4856('0x1c')](function(_0x5ab454){var _0x155a11={'messageId':_0x5ab454[_0x4856('0x43')]};if(!_0x1ffdb3[_0x4856('0x3e')]){_0x155a11[_0x4856('0x3f')]=!![];}return _0x5d8612[_0x4856('0x1d')](_0x155a11);})['catch'](function(_0x5e4329){logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4856('0x2f'),_0x4856('0x41'),util['inspect'](_0x5e4329,{'showHidden':![],'depth':null}));});}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x41'),_0x4856('0x44'));}break;case _0x4856('0x45'):if(_0x1ffdb3[_0x4856('0x32')]&&_0x1ffdb3[_0x4856('0x33')]){var _0x408e59={'messages':[{'source':_0x4856('0x46'),'to':_0x3ba53b[_0x4856('0x28')],'body':_0x3ba53b[_0x4856('0x10')],'from':_0x1ffdb3[_0x4856('0x47')]||_0x1ffdb3[_0x4856('0x28')]}]};var _0x3263fc=util[_0x4856('0x48')](_0x4856('0x49'),_0x1ffdb3[_0x4856('0x32')],_0x1ffdb3[_0x4856('0x33')]);var _0x569448={'method':_0x4856('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x408e59,'headers':{'Authorization':util[_0x4856('0x48')](_0x4856('0x4a'),new Buffer(_0x3263fc)[_0x4856('0x4b')](_0x4856('0x4c')))},'json':!![]};rp(_0x569448)[_0x4856('0x1c')](function(_0x9dc589){if(_0x9dc589[_0x4856('0x4d')]>=0xc8&&_0x9dc589[_0x4856('0x4d')]<=0xce){if(_0x9dc589['data']&&_0x9dc589[_0x4856('0x4e')][_0x4856('0x4f')]>0x0){var _0x12d703=_[_0x4856('0x50')](_0x9dc589[_0x4856('0x4e')][_0x4856('0x51')]);var _0x9708dc={'messageId':_0x12d703[_0x4856('0x52')]};if(!_0x1ffdb3[_0x4856('0x3e')]){_0x9708dc[_0x4856('0x3f')]=!![];}return _0x5d8612[_0x4856('0x1d')](_0x9708dc);}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x53'),util[_0x4856('0x2e')](_0x9dc589,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0x9dc589,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2e331e){logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4856('0x53'),util['inspect'](_0x2e331e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x53'),_0x4856('0x54'));}break;case _0x4856('0x55'):if(_0x1ffdb3[_0x4856('0x56')]&&_0x1ffdb3[_0x4856('0x27')]){var _0x408e59={'dst':_0x3ba53b[_0x4856('0x28')],'text':_0x3ba53b[_0x4856('0x10')],'src':_0x1ffdb3[_0x4856('0x47')]||_0x1ffdb3[_0x4856('0x28')],'url':_0x1ffdb3[_0x4856('0x2a')]+'/api/sms/messages/'+_0x3ba53b['id']+_0x4856('0x57')+_0x1ffdb3[_0x4856('0x2b')]};var _0x3263fc=util[_0x4856('0x48')]('%s:%s',_0x1ffdb3[_0x4856('0x56')],_0x1ffdb3[_0x4856('0x27')]);var _0x569448={'method':'POST','uri':util['format'](_0x4856('0x58'),_0x1ffdb3[_0x4856('0x56')]),'body':_0x408e59,'headers':{'Authorization':util[_0x4856('0x48')](_0x4856('0x4a'),new Buffer(_0x3263fc)['toString']('base64'))},'json':!![]};rp(_0x569448)[_0x4856('0x1c')](function(_0x13a8c0){var _0x6e637b={'messageId':_0x13a8c0['message_uuid'][0x0]};return _0x5d8612[_0x4856('0x1d')](_0x6e637b);})[_0x4856('0x20')](function(_0x268c0b){logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x55'),util['inspect'](_0x268c0b,{'showHidden':![],'depth':null}));});}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x55'),_0x4856('0x59'));}break;case _0x4856('0x5a'):if(_0x1ffdb3[_0x4856('0x32')]&&_0x1ffdb3['password']){if(_0x1ffdb3[_0x4856('0x5b')]){var _0x17e6e3={'method':_0x4856('0x3a'),'uri':_0x1ffdb3[_0x4856('0x5b')]+_0x4856('0x5c'),'body':{'username':_0x1ffdb3[_0x4856('0x32')],'password':_0x1ffdb3[_0x4856('0x33')]},'json':!![]};return rp(_0x17e6e3)[_0x4856('0x1c')](function(_0x330b9b){var _0x3e105b={'method':'POST','uri':_0x1ffdb3[_0x4856('0x5b')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1ffdb3[_0x4856('0x28')],'destinations':[{'to':_0x3ba53b[_0x4856('0x28')]}],'text':_0x3ba53b['body'],'notifyUrl':_0x1ffdb3[_0x4856('0x2a')]+_0x4856('0x5d')+_0x3ba53b['id']+_0x4856('0x57')+_0x1ffdb3[_0x4856('0x2b')],'notifyContentType':_0x4856('0x5e'),'callbackData':_0x1ffdb3[_0x4856('0x28')]+';'+_0x3ba53b[_0x4856('0x10')]}]},'headers':{'Authorization':_0x4856('0x5f')+_0x330b9b[_0x4856('0x2b')]},'json':!![]};return rp(_0x3e105b)[_0x4856('0x1c')](function(_0x41e990){if(_0x41e990['messages']){var _0x550550={'messageId':_0x41e990['messages'][0x0]['messageId']};if(!_0x1ffdb3['deliveryReport']){_0x550550[_0x4856('0x3f')]=!![];}return _0x5d8612[_0x4856('0x1d')](_0x550550);}else{return logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4856('0x2f'),_0x4856('0x5a'),util[_0x4856('0x2e')](_0x41e990,{'showHidden':![],'depth':null}));}});})[_0x4856('0x20')](function(_0x305052){return logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),'infobip',util['inspect'](_0x305052,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4856('0x2d'),'afterCreate','infobip',_0x4856('0x60'));}}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x5a'),_0x4856('0x54'));}break;case'csc':var _0x534f8a=require(_0x4856('0x61'));if(_0x1ffdb3[_0x4856('0x62')]){var _0x457cc2={};_0x457cc2[_0x4856('0x63')]=_0x1ffdb3[_0x4856('0x32')];_0x457cc2[_0x4856('0x28')]=_0x3ba53b[_0x4856('0x28')];_0x457cc2[_0x4856('0x35')]=_0x1ffdb3[_0x4856('0x28')];_0x457cc2[_0x4856('0x64')]=_0x3ba53b[_0x4856('0x10')];_0x457cc2['timestamp']=+new Date();var _0x476149='';var _0x9b1d0='';var _0x5a7413=Object[_0x4856('0x65')](_0x457cc2);_0x5a7413[_0x4856('0x66')]();for(var _0xb05d5e=0x0;_0xb05d5e<_0x5a7413[_0x4856('0x67')];_0xb05d5e++){if(_0x476149!=''){_0x476149+='&';}_0x476149+=_0x5a7413[_0xb05d5e]+'='+encodeURIComponent(_0x457cc2[_0x5a7413[_0xb05d5e]]);_0x9b1d0+=_0x457cc2[_0x5a7413[_0xb05d5e]];}_0x9b1d0+=_0x1ffdb3[_0x4856('0x62')];_0x9b1d0=_0x534f8a[_0x4856('0x68')]('md5')[_0x4856('0x1d')](_0x9b1d0)['digest'](_0x4856('0x69'));if(_0x476149!==''){_0x476149+='&';}_0x476149+=_0x4856('0x6a')+_0x9b1d0;var _0x1fc853={'method':_0x4856('0x38'),'uri':_0x1ffdb3['baseUrl']+_0x4856('0x6b')+_0x476149,'json':!![]};return rp(_0x1fc853)[_0x4856('0x1c')](function(_0x39b1a2){var _0x3eb3cc=Object[_0x4856('0x65')](_0x39b1a2);if(_0x39b1a2[_0x3eb3cc[0x0]][_0x4856('0x40')]&&parseInt(_0x39b1a2[_0x3eb3cc[0x0]]['error'])===0x0){var _0x53b9ed={'messageId':_0x39b1a2[_0x3eb3cc[0x0]][_0x4856('0x6c')]};if(!_0x1ffdb3[_0x4856('0x3e')]){_0x53b9ed[_0x4856('0x3f')]=!![];}return _0x5d8612['update'](_0x53b9ed);}else{return logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x4856('0x2e')](_0x39b1a2['error'],{'showHidden':![],'depth':null}));}})[_0x4856('0x20')](function(_0x41d2ca){return logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x6d'),util['inspect'](_0x41d2ca,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4856('0x2d'),_0x4856('0x2f'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0x4856('0x6e'):if(_0x1ffdb3[_0x4856('0x62')]){var _0x2ca2c7={'method':'POST','uri':_0x4856('0x6f'),'headers':{'Authorization':_0x1ffdb3[_0x4856('0x62')]},'body':{'content':_0x3ba53b[_0x4856('0x10')],'to':[_0x3ba53b[_0x4856('0x28')]],'from':_0x1ffdb3[_0x4856('0x28')],'binary':![],'clientMessageId':_0x4856('0x70'),'charset':_0x4856('0x71')},'json':!![]};rp(_0x2ca2c7)[_0x4856('0x1c')](function(_0x56b82d){if(!_0x56b82d[_0x4856('0x40')]){var _0x4b2ec5={'messageId':_0x56b82d[_0x4856('0x51')][0x0][_0x4856('0x72')]};if(!_0x1ffdb3[_0x4856('0x3e')]){_0x4b2ec5['read']=!![];}return _0x5d8612[_0x4856('0x1d')](_0x4b2ec5);}else{return logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x6e'),util[_0x4856('0x2e')](_0x56b82d[_0x4856('0x40')],{'showHidden':![],'depth':null}));}})[_0x4856('0x20')](function(_0x52cae1){return logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x6e'),util[_0x4856('0x2e')](_0x52cae1,{'showHidden':![],'depth':null}));});}else{logger[_0x4856('0x40')](_0x4856('0x2d'),'afterCreate','clickatell',_0x4856('0x73'));}break;case'bandwidth':if(_0x1ffdb3[_0x4856('0x32')]&&_0x1ffdb3[_0x4856('0x33')]){var _0x3263fc=util[_0x4856('0x48')](_0x4856('0x49'),_0x1ffdb3[_0x4856('0x32')],_0x1ffdb3[_0x4856('0x33')]);var _0x569448={'method':_0x4856('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1ffdb3['accountId']+_0x4856('0x74'),'body':{'to':[_0x3ba53b['phone']],'text':_0x3ba53b[_0x4856('0x10')],'from':_0x1ffdb3[_0x4856('0x28')],'applicationId':_0x1ffdb3[_0x4856('0x75')]},'headers':{'Authorization':util['format'](_0x4856('0x4a'),new Buffer(_0x3263fc)[_0x4856('0x4b')](_0x4856('0x4c')))},'json':!![]};rp(_0x569448)[_0x4856('0x1c')](function(_0x4b6d98){if(_0x4b6d98['id']){var _0x24e6f2={'messageId':_0x4b6d98['id']};return _0x5d8612[_0x4856('0x1d')](_0x24e6f2);}else{logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x76'),util[_0x4856('0x2e')](_0x4b6d98,{'showHidden':![],'depth':null}));}})[_0x4856('0x20')](function(_0x204039){logger[_0x4856('0x40')](_0x4856('0x2d'),_0x4856('0x2f'),_0x4856('0x76'),util[_0x4856('0x2e')](_0x204039,{'showHidden':![],'depth':null}));});}else{logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4856('0x2f'),_0x4856('0x76'),_0x4856('0x54'));}break;case'intelepeer':if(_0x1ffdb3[_0x4856('0x62')]){var _0x58fc3b={};var _0x1fc853={'method':_0x4856('0x3a'),'uri':_0x4856('0x77'),'headers':{'Authorization':_0x4856('0x78')+_0x1ffdb3[_0x4856('0x62')],'Content-Type':'application/json'},'body':{'from':_0x1ffdb3[_0x4856('0x28')],'to':_0x3ba53b['phone'],'text':_0x3ba53b[_0x4856('0x10')]},'json':!![]};return rp(_0x1fc853)[_0x4856('0x1c')](function(_0x51719a){if(_0x51719a[_0x4856('0x79')]==0xca){_0x58fc3b['message']=_0x51719a;var _0x4148a3={'method':_0x4856('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4856('0x78')+_0x1ffdb3['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x58fc3b[_0x4856('0x7a')]['refid']},'json':!![]};return rp(_0x4148a3)[_0x4856('0x1c')](function(_0x413383){_0x58fc3b['status']=_0x413383;var _0x5d5c08={'messageId':_0x58fc3b[_0x4856('0x7a')][_0x4856('0x7b')],'read':!![]};return _0x5d8612[_0x4856('0x1d')](_0x5d5c08);});}else{return logger[_0x4856('0x40')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4856('0x2f'),'intelepeer',util['inspect'](_0x51719a,{'showHidden':![],'depth':null}));}})[_0x4856('0x20')](function(_0x27cbed){return logger['error'](_0x4856('0x2d'),'afterCreate',_0x4856('0x7c'),util[_0x4856('0x2e')](_0x27cbed,{'showHidden':![],'depth':null}));});}else{return logger[_0x4856('0x40')](_0x4856('0x2d'),'afterCreate',_0x4856('0x7c'),_0x4856('0x7d'));}break;}}})['finally'](function(){_0x50fe45();});}else{_0x50fe45();}}},'charset':_0x4856('0x7e'),'collate':_0x4856('0x7f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7e6ff23..bae433e 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 _0x2e2f=['localhost','socket.io-emitter','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','create','body','options','then','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x524e2b,_0x19d442){var _0x26da31=function(_0x5aec61){while(--_0x5aec61){_0x524e2b['push'](_0x524e2b['shift']());}};_0x26da31(++_0x19d442);}(_0x2e2f,0x169));var _0xf2e2=function(_0x36daf3,_0x2ea0dd){_0x36daf3=_0x36daf3-0x0;var _0x3e4e26=_0x2e2f[_0x36daf3];return _0x3e4e26;};'use strict';var _=require(_0xf2e2('0x0'));var util=require(_0xf2e2('0x1'));var moment=require(_0xf2e2('0x2'));var BPromise=require(_0xf2e2('0x3'));var rs=require(_0xf2e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2e2('0x5'))['db'];var utils=require(_0xf2e2('0x6'));var logger=require('../../config/logger')(_0xf2e2('0x7'));var config=require(_0xf2e2('0x8'));var jayson=require(_0xf2e2('0x9'));var client=jayson[_0xf2e2('0xa')][_0xf2e2('0xb')]({'port':0x232a});config[_0xf2e2('0xc')]=_['defaults'](config['redis'],{'host':_0xf2e2('0xd'),'port':0x18eb});var socket=require(_0xf2e2('0xe'))(new Redis(config[_0xf2e2('0xc')]));require('./smsMessage.socket')[_0xf2e2('0xf')](socket);function respondWithRpcPromise(_0x5da43c,_0x2bd2db,_0x266c6d){return new BPromise(function(_0x2c65e7,_0xc70e55){return client[_0xf2e2('0x10')](_0x5da43c,_0x266c6d)['then'](function(_0x143fb4){logger[_0xf2e2('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2bd2db,_0xf2e2('0x12'));logger[_0xf2e2('0x13')](_0xf2e2('0x14'),_0x2bd2db,_0xf2e2('0x12'),JSON[_0xf2e2('0x15')](_0x143fb4));if(_0x143fb4[_0xf2e2('0x16')]){if(_0x143fb4[_0xf2e2('0x16')][_0xf2e2('0x17')]===0x1f4){logger[_0xf2e2('0x16')](_0xf2e2('0x18'),_0x2bd2db,_0x143fb4[_0xf2e2('0x16')][_0xf2e2('0x19')]);return _0xc70e55(_0x143fb4[_0xf2e2('0x16')]['message']);}logger['error'](_0xf2e2('0x18'),_0x2bd2db,_0x143fb4[_0xf2e2('0x16')]['message']);return _0x2c65e7(_0x143fb4['error']['message']);}else{logger[_0xf2e2('0x11')](_0xf2e2('0x18'),_0x2bd2db,_0xf2e2('0x12'));_0x2c65e7(_0x143fb4[_0xf2e2('0x1a')][_0xf2e2('0x19')]);}})[_0xf2e2('0x1b')](function(_0x31ff4e){logger[_0xf2e2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2bd2db,_0x31ff4e);_0xc70e55(_0x31ff4e);});});}exports['CreateSmsMessage']=function(_0x2663b3){var _0x7e6994=this;return new Promise(function(_0x11ed4d,_0x271910){return db[_0xf2e2('0x1c')][_0xf2e2('0x1d')](_0x2663b3[_0xf2e2('0x1e')],{'raw':_0x2663b3[_0xf2e2('0x1f')]?_0x2663b3[_0xf2e2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xf2e2('0x20')](function(_0x31e456){logger[_0xf2e2('0x11')](_0xf2e2('0x21'),_0x2663b3);logger['debug']('CreateSmsMessage',_0x2663b3,JSON[_0xf2e2('0x15')](_0x31e456));_0x11ed4d(_0x31e456);})[_0xf2e2('0x1b')](function(_0x3a975c){logger[_0xf2e2('0x16')]('CreateSmsMessage',_0x3a975c[_0xf2e2('0x19')],_0x2663b3);_0x271910(_0x7e6994[_0xf2e2('0x16')](0x1f4,_0x3a975c[_0xf2e2('0x19')]));});});}; \ No newline at end of file +var _0x3b10=['SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info'];(function(_0x57228b,_0x1fc843){var _0x2e5cc5=function(_0x6f058a){while(--_0x6f058a){_0x57228b['push'](_0x57228b['shift']());}};_0x2e5cc5(++_0x1fc843);}(_0x3b10,0x181));var _0x03b1=function(_0x1003c5,_0x12ac5b){_0x1003c5=_0x1003c5-0x0;var _0x3a8ac1=_0x3b10[_0x1003c5];return _0x3a8ac1;};'use strict';var _=require(_0x03b1('0x0'));var util=require(_0x03b1('0x1'));var moment=require(_0x03b1('0x2'));var BPromise=require(_0x03b1('0x3'));var rs=require(_0x03b1('0x4'));var fs=require('fs');var Redis=require(_0x03b1('0x5'));var db=require(_0x03b1('0x6'))['db'];var utils=require(_0x03b1('0x7'));var logger=require(_0x03b1('0x8'))(_0x03b1('0x9'));var config=require(_0x03b1('0xa'));var jayson=require(_0x03b1('0xb'));var client=jayson[_0x03b1('0xc')][_0x03b1('0xd')]({'port':0x232a});config[_0x03b1('0xe')]=_[_0x03b1('0xf')](config[_0x03b1('0xe')],{'host':_0x03b1('0x10'),'port':0x18eb});var socket=require(_0x03b1('0x11'))(new Redis(config[_0x03b1('0xe')]));require(_0x03b1('0x12'))['register'](socket);function respondWithRpcPromise(_0x274398,_0x306e8d,_0x1e9d57){return new BPromise(function(_0xdadd13,_0x5585f4){return client[_0x03b1('0x13')](_0x274398,_0x1e9d57)[_0x03b1('0x14')](function(_0x269581){logger[_0x03b1('0x15')](_0x03b1('0x16'),_0x306e8d,_0x03b1('0x17'));logger['debug'](_0x03b1('0x18'),_0x306e8d,'request\x20sent',JSON[_0x03b1('0x19')](_0x269581));if(_0x269581[_0x03b1('0x1a')]){if(_0x269581[_0x03b1('0x1a')][_0x03b1('0x1b')]===0x1f4){logger['error'](_0x03b1('0x16'),_0x306e8d,_0x269581['error'][_0x03b1('0x1c')]);return _0x5585f4(_0x269581[_0x03b1('0x1a')][_0x03b1('0x1c')]);}logger['error'](_0x03b1('0x16'),_0x306e8d,_0x269581['error']['message']);return _0xdadd13(_0x269581[_0x03b1('0x1a')][_0x03b1('0x1c')]);}else{logger['info'](_0x03b1('0x16'),_0x306e8d,_0x03b1('0x17'));_0xdadd13(_0x269581[_0x03b1('0x1d')][_0x03b1('0x1c')]);}})[_0x03b1('0x1e')](function(_0x494413){logger[_0x03b1('0x1a')](_0x03b1('0x16'),_0x306e8d,_0x494413);_0x5585f4(_0x494413);});});}exports[_0x03b1('0x1f')]=function(_0x5928f3){var _0x2a5d41=this;return new Promise(function(_0x3545b9,_0x4aab96){return db[_0x03b1('0x20')][_0x03b1('0x21')](_0x5928f3[_0x03b1('0x22')],{'raw':_0x5928f3[_0x03b1('0x23')]?_0x5928f3[_0x03b1('0x23')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4721b0){logger[_0x03b1('0x15')](_0x03b1('0x1f'),_0x5928f3);logger[_0x03b1('0x24')](_0x03b1('0x1f'),_0x5928f3,JSON['stringify'](_0x4721b0));_0x3545b9(_0x4721b0);})['catch'](function(_0xc38db1){logger[_0x03b1('0x1a')]('CreateSmsMessage',_0xc38db1[_0x03b1('0x1c')],_0x5928f3);_0x4aab96(_0x2a5d41['error'](0x1f4,_0xc38db1[_0x03b1('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 56b7fca..87ab629 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 _0x5816=['remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events','save'];(function(_0x148a49,_0xc9f79f){var _0x1c2051=function(_0x4902fa){while(--_0x4902fa){_0x148a49['push'](_0x148a49['shift']());}};_0x1c2051(++_0xc9f79f);}(_0x5816,0x10e));var _0x6581=function(_0x16d73e,_0x56f741){_0x16d73e=_0x16d73e-0x0;var _0x167c4d=_0x5816[_0x16d73e];return _0x167c4d;};'use strict';var SmsMessageEvents=require(_0x6581('0x0'));var events=[_0x6581('0x1'),_0x6581('0x2'),_0x6581('0x3')];function createListener(_0x3bf216,_0xf40652){return function(_0xc8abdd){_0xf40652[_0x6581('0x4')](_0x3bf216,_0xc8abdd);};}function removeListener(_0x5b1654,_0x4a7b46){return function(){SmsMessageEvents[_0x6581('0x5')](_0x5b1654,_0x4a7b46);};}exports['register']=function(_0x3109ca){for(var _0x5d95e0=0x0,_0x364cb6=events[_0x6581('0x6')];_0x5d95e0<_0x364cb6;_0x5d95e0++){var _0xd97342=events[_0x5d95e0];var _0x5c75f0=createListener(_0x6581('0x7')+_0xd97342,_0x3109ca);SmsMessageEvents['on'](_0xd97342,_0x5c75f0);}}; \ No newline at end of file +var _0x2bb9=['length','smsMessage:','update','emit','removeListener','register'];(function(_0x2562c6,_0x5e6df4){var _0x50f5e6=function(_0x20a555){while(--_0x20a555){_0x2562c6['push'](_0x2562c6['shift']());}};_0x50f5e6(++_0x5e6df4);}(_0x2bb9,0x170));var _0x92bb=function(_0x52b0a9,_0x29da5f){_0x52b0a9=_0x52b0a9-0x0;var _0x270232=_0x2bb9[_0x52b0a9];return _0x270232;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0x92bb('0x0')];function createListener(_0x4aba19,_0x31c11d){return function(_0x8129b2){_0x31c11d[_0x92bb('0x1')](_0x4aba19,_0x8129b2);};}function removeListener(_0x27d987,_0x203502){return function(){SmsMessageEvents[_0x92bb('0x2')](_0x27d987,_0x203502);};}exports[_0x92bb('0x3')]=function(_0x1189be){for(var _0x39efcf=0x0,_0x4de869=events[_0x92bb('0x4')];_0x39efcf<_0x4de869;_0x39efcf++){var _0x3d632d=events[_0x39efcf];var _0x2ae10f=createListener(_0x92bb('0x5')+_0x3d632d,_0x1189be);SmsMessageEvents['on'](_0x3d632d,_0x2ae10f);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 19b14a6..1b7bd99 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 _0xc923=['removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id','destroy','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc923,0xb7));var _0x3c92=function(_0x186d6d,_0x3e74bc){_0x186d6d=_0x186d6d-0x0;var _0x5d41c1=_0xc923[_0x186d6d];return _0x5d41c1;};'use strict';var multer=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var path=require(_0x3c92('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c92('0x3'));var router=express[_0x3c92('0x4')]();var fs_extra=require(_0x3c92('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x6'));var config=require(_0x3c92('0x7'));var controller=require(_0x3c92('0x8'));router[_0x3c92('0x9')]('/',auth[_0x3c92('0xa')](),controller[_0x3c92('0xb')]);router['get'](_0x3c92('0xc'),auth[_0x3c92('0xa')](),controller['describe']);router[_0x3c92('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3c92('0xd')]);router['get'](_0x3c92('0xe'),auth['isAuthenticated'](),controller[_0x3c92('0xf')]);router[_0x3c92('0x9')](_0x3c92('0x10'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x11')]);router[_0x3c92('0x9')](_0x3c92('0x12'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x13')]);router[_0x3c92('0x14')]('/',auth[_0x3c92('0xa')](),controller[_0x3c92('0x15')]);router['post'](_0x3c92('0x10'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x16')]);router[_0x3c92('0x14')](_0x3c92('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x3c92('0x17')](_0x3c92('0x18'),auth[_0x3c92('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3c92('0xa')](),controller[_0x3c92('0x19')]);router[_0x3c92('0x1a')]('/:id/teams',auth[_0x3c92('0xa')](),controller[_0x3c92('0x1b')]);router[_0x3c92('0x1a')](_0x3c92('0x12'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x1c')]);module[_0x3c92('0x1d')]=router; \ No newline at end of file +var _0x33f6=['post','create','addTeams','put','/:id','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x16f6fd,_0x1afabf){var _0x54af5b=function(_0x545104){while(--_0x545104){_0x16f6fd['push'](_0x16f6fd['shift']());}};_0x54af5b(++_0x1afabf);}(_0x33f6,0x1ae));var _0x633f=function(_0x45c675,_0x22ee5e){_0x45c675=_0x45c675-0x0;var _0x5cc444=_0x33f6[_0x45c675];return _0x5cc444;};'use strict';var multer=require('multer');var util=require(_0x633f('0x0'));var path=require(_0x633f('0x1'));var timeout=require(_0x633f('0x2'));var express=require(_0x633f('0x3'));var router=express[_0x633f('0x4')]();var fs_extra=require(_0x633f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x633f('0x6'));var config=require(_0x633f('0x7'));var controller=require('./smsQueue.controller');router[_0x633f('0x8')]('/',auth[_0x633f('0x9')](),controller[_0x633f('0xa')]);router[_0x633f('0x8')](_0x633f('0xb'),auth['isAuthenticated'](),controller[_0x633f('0xc')]);router[_0x633f('0x8')]('/:id',auth[_0x633f('0x9')](),controller[_0x633f('0xd')]);router[_0x633f('0x8')](_0x633f('0xe'),auth[_0x633f('0x9')](),controller['getMembers']);router['get'](_0x633f('0xf'),auth[_0x633f('0x9')](),controller[_0x633f('0x10')]);router[_0x633f('0x8')](_0x633f('0x11'),auth[_0x633f('0x9')](),controller['getAgents']);router[_0x633f('0x12')]('/',auth['isAuthenticated'](),controller[_0x633f('0x13')]);router[_0x633f('0x12')](_0x633f('0xf'),auth[_0x633f('0x9')](),controller[_0x633f('0x14')]);router[_0x633f('0x12')](_0x633f('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x633f('0x15')](_0x633f('0x16'),auth[_0x633f('0x9')](),controller[_0x633f('0x17')]);router[_0x633f('0x18')](_0x633f('0x16'),auth['isAuthenticated'](),controller[_0x633f('0x19')]);router[_0x633f('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x633f('0x1a')]);router[_0x633f('0x18')](_0x633f('0x11'),auth[_0x633f('0x9')](),controller[_0x633f('0x1b')]);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 d4b3d6d..c5bbd34 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 _0x8b76=['STRING','name','INTEGER','rrmemory','roundrobin','exports'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x8b76,0x95));var _0x68b7=function(_0x29b6d0,_0x492462){_0x29b6d0=_0x29b6d0-0x0;var _0x15110b=_0x8b76[_0x29b6d0];return _0x15110b;};'use strict';var Sequelize=require('sequelize');module[_0x68b7('0x0')]={'name':{'type':Sequelize[_0x68b7('0x1')],'unique':_0x68b7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x68b7('0x1')]},'timeout':{'type':Sequelize[_0x68b7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x68b7('0x4'),'beepall',_0x68b7('0x5'))}}; \ No newline at end of file +var _0x872f=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0xac0468,_0x5790e9){var _0x49a1d5=function(_0x4910f5){while(--_0x4910f5){_0xac0468['push'](_0xac0468['shift']());}};_0x49a1d5(++_0x5790e9);}(_0x872f,0xdb));var _0xf872=function(_0x467ef6,_0x932cef){_0x467ef6=_0x467ef6-0x0;var _0x3e4aa2=_0x872f[_0x467ef6];return _0x3e4aa2;};'use strict';var Sequelize=require(_0xf872('0x0'));module[_0xf872('0x1')]={'name':{'type':Sequelize[_0xf872('0x2')],'unique':_0xf872('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf872('0x2')]},'timeout':{'type':Sequelize[_0xf872('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf872('0x5')](_0xf872('0x6'),_0xf872('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 12484a3..fe25369 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 _0x0598=['value','isEmpty','emit','userSmsQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','get','SmsQueues','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','count','includeAll','include','SmsQueue','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact'];(function(_0x77b868,_0x45ea4b){var _0x1f54ea=function(_0x3cb8a6){while(--_0x3cb8a6){_0x77b868['push'](_0x77b868['shift']());}};_0x1f54ea(++_0x45ea4b);}(_0x0598,0x92));var _0x8059=function(_0x307cf8,_0x1f144a){_0x307cf8=_0x307cf8-0x0;var _0x1c5d9d=_0x0598[_0x307cf8];return _0x1c5d9d;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8059('0x12')]=_[_0x8059('0x13')](config[_0x8059('0x12')],{'host':_0x8059('0x14'),'port':0x18eb});var socket=require(_0x8059('0x15'))(new Redis(config['redis']));require(_0x8059('0x16'))['register'](socket);function respondWithStatusCode(_0x346b23,_0x5c916e){_0x5c916e=_0x5c916e||0xcc;return function(_0x3e4f08){if(_0x3e4f08){return _0x346b23[_0x8059('0x17')](_0x5c916e);}return _0x346b23[_0x8059('0x18')](_0x5c916e)['end']();};}function respondWithResult(_0x516c1f,_0x5cda43){_0x5cda43=_0x5cda43||0xc8;return function(_0x3b8f18){if(_0x3b8f18){return _0x516c1f[_0x8059('0x18')](_0x5cda43)[_0x8059('0x19')](_0x3b8f18);}};}function respondWithFilteredResult(_0x246c9d,_0x3abfe8){return function(_0x4b6d55){if(_0x4b6d55){var _0x10ad98=typeof _0x3abfe8[_0x8059('0x1a')]===_0x8059('0x1b')&&typeof _0x3abfe8[_0x8059('0x1c')]==='undefined';var _0x5456a9=_0x4b6d55['count'];var _0x113f42=_0x10ad98?0x0:_0x3abfe8['offset'];var _0x1857c1=_0x10ad98?_0x4b6d55['count']:_0x3abfe8[_0x8059('0x1a')]+_0x3abfe8[_0x8059('0x1c')];var _0x1e9ac5;if(_0x1857c1>=_0x5456a9){_0x1857c1=_0x5456a9;_0x1e9ac5=0xc8;}else{_0x1e9ac5=0xce;}_0x246c9d['status'](_0x1e9ac5);return _0x246c9d['set'](_0x8059('0x1d'),_0x113f42+'-'+_0x1857c1+'/'+_0x5456a9)[_0x8059('0x19')](_0x4b6d55);}return null;};}function patchUpdates(_0x32aeda){return function(_0x1585a3){try{jsonpatch['apply'](_0x1585a3,_0x32aeda,!![]);}catch(_0x3bc226){return BPromise[_0x8059('0x1e')](_0x3bc226);}return _0x1585a3[_0x8059('0x1f')]();};}function saveUpdates(_0x5449d9,_0xe9a72d){return function(_0x2256b1){if(_0x2256b1){return _0x2256b1[_0x8059('0x20')](_0x5449d9)[_0x8059('0x21')](function(_0x59d3a6){return _0x59d3a6;});}return null;};}function removeEntity(_0x140f64,_0x2cd179){return function(_0x4781e2){if(_0x4781e2){return _0x4781e2[_0x8059('0x22')]()[_0x8059('0x21')](function(){var _0x54b88b=_0x4781e2[_0x8059('0x23')]({'plain':!![]});var _0x19b95a=_0x8059('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x19b95a,'resourceId':_0x54b88b['id']}})['then'](function(){return _0x4781e2;});})[_0x8059('0x21')](function(){_0x140f64[_0x8059('0x18')](0xcc)[_0x8059('0x25')]();});}};}function handleEntityNotFound(_0x1009af,_0x59abe9){return function(_0x1eb71b){if(!_0x1eb71b){_0x1009af['sendStatus'](0x194);}return _0x1eb71b;};}function handleError(_0x2f887c,_0x35c73e){_0x35c73e=_0x35c73e||0x1f4;return function(_0x5ecf7f){logger[_0x8059('0x26')](_0x5ecf7f[_0x8059('0x27')]);if(_0x5ecf7f[_0x8059('0x28')]){delete _0x5ecf7f[_0x8059('0x28')];}_0x2f887c[_0x8059('0x18')](_0x35c73e)[_0x8059('0x29')](_0x5ecf7f);};}exports[_0x8059('0x2a')]=function(_0x2016ea,_0x505756){var _0xb3c36e={},_0x40b39e={},_0x1f8983={'count':0x0,'rows':[]};var _0x15f843=_[_0x8059('0x2b')](db['SmsQueue'][_0x8059('0x2c')],function(_0x22c492){return{'name':_0x22c492[_0x8059('0x2d')],'type':_0x22c492[_0x8059('0x2e')][_0x8059('0x2f')]};});_0x40b39e[_0x8059('0x30')]=_[_0x8059('0x2b')](_0x15f843,_0x8059('0x28'));_0x40b39e[_0x8059('0x31')]=_[_0x8059('0x32')](_0x2016ea['query']);_0x40b39e[_0x8059('0x33')]=_['intersection'](_0x40b39e[_0x8059('0x30')],_0x40b39e['query']);_0xb3c36e['attributes']=_[_0x8059('0x34')](_0x40b39e['model'],qs[_0x8059('0x35')](_0x2016ea['query'][_0x8059('0x35')]));_0xb3c36e['attributes']=_0xb3c36e[_0x8059('0x36')][_0x8059('0x37')]?_0xb3c36e['attributes']:_0x40b39e[_0x8059('0x30')];if(!_0x2016ea[_0x8059('0x31')][_0x8059('0x38')]('nolimit')){_0xb3c36e[_0x8059('0x1c')]=qs['limit'](_0x2016ea[_0x8059('0x31')]['limit']);_0xb3c36e[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x2016ea[_0x8059('0x31')][_0x8059('0x1a')]);}_0xb3c36e['order']=qs[_0x8059('0x39')](_0x2016ea['query']['sort']);_0xb3c36e[_0x8059('0x3a')]=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x2016ea[_0x8059('0x31')],_0x40b39e[_0x8059('0x33')]),_0x15f843);if(_0x2016ea['query']['filter']){_0xb3c36e['where']=_['merge'](_0xb3c36e[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x15f843,function(_0xc84f04){if(_0xc84f04['type']!==_0x8059('0x3c')){var _0x406ec3={};_0x406ec3[_0xc84f04['name']]={'$like':'%'+_0x2016ea[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x406ec3;}})});}_0xb3c36e=_[_0x8059('0x3e')]({},_0xb3c36e,_0x2016ea['options']);var _0x2c48cf={'where':_0xb3c36e[_0x8059('0x3a')]};return db['SmsQueue'][_0x8059('0x3f')](_0x2c48cf)[_0x8059('0x21')](function(_0x3f00de){_0x1f8983[_0x8059('0x3f')]=_0x3f00de;if(_0x2016ea[_0x8059('0x31')][_0x8059('0x40')]){_0xb3c36e[_0x8059('0x41')]=[{'all':!![]}];}return db[_0x8059('0x42')][_0x8059('0x43')](_0xb3c36e);})[_0x8059('0x21')](function(_0x1d64db){_0x1f8983[_0x8059('0x44')]=_0x1d64db;return _0x1f8983;})[_0x8059('0x21')](respondWithFilteredResult(_0x505756,_0xb3c36e))[_0x8059('0x45')](handleError(_0x505756,null));};exports[_0x8059('0x46')]=function(_0x93ee2f,_0x35c94a){var _0x25f542={'raw':!![],'where':{'id':_0x93ee2f[_0x8059('0x47')]['id']}},_0x1b613f={};_0x1b613f[_0x8059('0x30')]=_[_0x8059('0x32')](db[_0x8059('0x42')]['rawAttributes']);_0x1b613f[_0x8059('0x31')]=_['keys'](_0x93ee2f['query']);_0x1b613f[_0x8059('0x33')]=_['intersection'](_0x1b613f[_0x8059('0x30')],_0x1b613f['query']);_0x25f542[_0x8059('0x36')]=_[_0x8059('0x34')](_0x1b613f[_0x8059('0x30')],qs[_0x8059('0x35')](_0x93ee2f[_0x8059('0x31')][_0x8059('0x35')]));_0x25f542['attributes']=_0x25f542[_0x8059('0x36')]['length']?_0x25f542[_0x8059('0x36')]:_0x1b613f[_0x8059('0x30')];if(_0x93ee2f[_0x8059('0x31')]['includeAll']){_0x25f542[_0x8059('0x41')]=[{'all':!![]}];}_0x25f542=_[_0x8059('0x3e')]({},_0x25f542,_0x93ee2f[_0x8059('0x48')]);return db[_0x8059('0x42')]['find'](_0x25f542)[_0x8059('0x21')](handleEntityNotFound(_0x35c94a,null))[_0x8059('0x21')](respondWithResult(_0x35c94a,null))[_0x8059('0x45')](handleError(_0x35c94a,null));};exports['create']=function(_0x2ba3f1,_0x5d9458){return db['SmsQueue'][_0x8059('0x49')](_0x2ba3f1['body'],{})[_0x8059('0x21')](function(_0x54d2d2){var _0x261967=_0x2ba3f1[_0x8059('0x4a')]['get']({'plain':!![]});if(!_0x261967)throw new Error(_0x8059('0x4b'));if(_0x261967['role']===_0x8059('0x4a')){var _0x7a844b=_0x54d2d2[_0x8059('0x23')]({'plain':!![]});var _0x5d5f16=_0x8059('0x24');return db['UserProfileSection'][_0x8059('0x4c')]({'where':{'name':_0x5d5f16,'userProfileId':_0x261967[_0x8059('0x4d')]},'raw':!![]})[_0x8059('0x21')](function(_0xb63fee){if(_0xb63fee&&_0xb63fee['autoAssociation']===0x0){return db[_0x8059('0x4e')][_0x8059('0x49')]({'name':_0x7a844b['name'],'resourceId':_0x7a844b['id'],'type':_0xb63fee[_0x8059('0x28')],'sectionId':_0xb63fee['id']},{})['then'](function(){return _0x54d2d2;});}else{return _0x54d2d2;}})[_0x8059('0x45')](function(_0x547ffb){logger['error'](_0x8059('0x4f'),_0x547ffb);throw _0x547ffb;});}return _0x54d2d2;})[_0x8059('0x21')](respondWithResult(_0x5d9458,0xc9))[_0x8059('0x45')](handleError(_0x5d9458,null));};exports[_0x8059('0x20')]=function(_0x3e1a6f,_0x153c4a){if(_0x3e1a6f[_0x8059('0x50')]['id']){delete _0x3e1a6f['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x3e1a6f['params']['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x153c4a,null))[_0x8059('0x21')](saveUpdates(_0x3e1a6f['body'],null))[_0x8059('0x21')](respondWithResult(_0x153c4a,null))['catch'](handleError(_0x153c4a,null));};exports['destroy']=function(_0x1add7c,_0x55cb8d){return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x1add7c[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x55cb8d,null))['then'](removeEntity(_0x55cb8d,null))[_0x8059('0x45')](handleError(_0x55cb8d,null));};exports[_0x8059('0x51')]=function(_0x182637,_0x5056e6){return db['SmsQueue'][_0x8059('0x51')]()['then'](respondWithResult(_0x5056e6,null))['catch'](handleError(_0x5056e6,null));};exports[_0x8059('0x52')]=function(_0x51927e,_0x391687,_0x1c4015){var _0x4c5387={'raw':!![],'where':{}},_0x4927bf={},_0x1c8193;return db[_0x8059('0x42')][_0x8059('0x53')]({'where':{'id':_0x51927e['params']['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x391687,null))[_0x8059('0x21')](function(_0xc6b6d8){if(_0xc6b6d8){_0x1c8193=_0xc6b6d8[_0x8059('0x23')]({'plain':!![]});_0x4927bf['model']=_[_0x8059('0x32')](db['UserSmsQueue'][_0x8059('0x2c')]);_0x4927bf[_0x8059('0x31')]=_['keys'](_0x51927e[_0x8059('0x31')]);_0x4927bf['filters']=_[_0x8059('0x34')](_0x4927bf[_0x8059('0x30')],_0x4927bf[_0x8059('0x31')]);_0x4c5387[_0x8059('0x36')]=_[_0x8059('0x34')](_0x4927bf[_0x8059('0x30')],qs[_0x8059('0x35')](_0x51927e[_0x8059('0x31')][_0x8059('0x35')]));_0x4c5387[_0x8059('0x36')]=_0x4c5387[_0x8059('0x36')][_0x8059('0x37')]?_0x4c5387[_0x8059('0x36')]:_0x4927bf['model'];if(!_0x51927e[_0x8059('0x31')][_0x8059('0x38')](_0x8059('0x54'))){_0x4c5387[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x51927e['query'][_0x8059('0x1c')]);_0x4c5387[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x51927e[_0x8059('0x31')][_0x8059('0x1a')]);}_0x4c5387[_0x8059('0x55')]=qs[_0x8059('0x39')](_0x51927e[_0x8059('0x31')][_0x8059('0x39')]);_0x4c5387['where']=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x51927e[_0x8059('0x31')],_0x4927bf['filters']));_0x4c5387['where'][_0x8059('0x56')]=_0xc6b6d8['id'];if(_0x51927e[_0x8059('0x31')][_0x8059('0x3d')]){_0x4c5387[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x4c5387[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x4c5387['attributes'],function(_0x35ec63){var _0x39c5d9={};_0x39c5d9[_0x35ec63]={'$like':'%'+_0x51927e[_0x8059('0x31')]['filter']+'%'};return _0x39c5d9;})});}_0x4c5387=_[_0x8059('0x3e')]({},_0x4c5387,_0x51927e[_0x8059('0x48')]);return db[_0x8059('0x57')][_0x8059('0x43')](_0x4c5387);}})['then'](function(_0x4d806c){if(_0x4d806c){return db[_0x8059('0x58')][_0x8059('0x59')]({'where':{'id':_['map'](_0x4d806c,_0x8059('0x5a')),'role':_0x8059('0x5b')},'attributes':['id',_0x8059('0x28'),_0x8059('0x5c'),_0x8059('0x5d'),_0x8059('0x5e')]});}})['then'](function(_0x3e6600){if(_0x3e6600){return{'count':_0x3e6600[_0x8059('0x3f')],'rows':_[_0x8059('0x2b')](_0x3e6600['rows'],function(_0x5143c8){return{'membername':_0x5143c8[_0x8059('0x28')],'UserId':_0x5143c8['id'],'queue_name':_0x1c8193[_0x8059('0x28')],'SmsQueueId':_0x1c8193['id'],'interface':util['format'](_0x8059('0x5f'),_0x8059('0x60'),_0x5143c8[_0x8059('0x28')]),'penalty':0x0,'paused':_0x5143c8[_0x8059('0x5c')],'createdAt':_0x5143c8[_0x8059('0x5e')],'updatedAt':_0x5143c8[_0x8059('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8059('0x21')](respondWithFilteredResult(_0x391687,_0x4c5387))[_0x8059('0x45')](handleError(_0x391687,null));};exports[_0x8059('0x61')]=function(_0x1a6f36,_0x175802,_0x2bd6a8){var _0x598596={};var _0x407a7d={};var _0x1cec27;var _0x31a0af;return db['SmsQueue']['findOne']({'where':{'id':_0x1a6f36[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x175802,null))['then'](function(_0x1554ca){if(_0x1554ca){_0x1cec27=_0x1554ca;_0x407a7d[_0x8059('0x30')]=_['keys'](db[_0x8059('0x62')][_0x8059('0x2c')]);_0x407a7d['query']=_['keys'](_0x1a6f36[_0x8059('0x31')]);_0x407a7d['filters']=_['intersection'](_0x407a7d[_0x8059('0x30')],_0x407a7d[_0x8059('0x31')]);_0x598596[_0x8059('0x36')]=_[_0x8059('0x34')](_0x407a7d['model'],qs['fields'](_0x1a6f36[_0x8059('0x31')][_0x8059('0x35')]));_0x598596[_0x8059('0x36')]=_0x598596[_0x8059('0x36')][_0x8059('0x37')]?_0x598596[_0x8059('0x36')]:_0x407a7d['model'];_0x598596['order']=qs[_0x8059('0x39')](_0x1a6f36[_0x8059('0x31')][_0x8059('0x39')]);_0x598596['where']=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x1a6f36['query'],_0x407a7d[_0x8059('0x33')]));if(_0x1a6f36[_0x8059('0x31')]['filter']){_0x598596[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x598596[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x598596[_0x8059('0x36')],function(_0x42bd9f){var _0x38ea39={};_0x38ea39[_0x42bd9f]={'$like':'%'+_0x1a6f36[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x38ea39;})});}_0x598596=_['merge']({},_0x598596,_0x1a6f36['options']);return _0x1cec27[_0x8059('0x61')](_0x598596);}})[_0x8059('0x21')](function(_0x3fbdbe){if(_0x3fbdbe){_0x31a0af=_0x3fbdbe[_0x8059('0x37')];if(!_0x1a6f36[_0x8059('0x31')][_0x8059('0x38')]('nolimit')){_0x598596[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x1a6f36[_0x8059('0x31')]['limit']);_0x598596[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x1a6f36[_0x8059('0x31')][_0x8059('0x1a')]);}return _0x1cec27[_0x8059('0x61')](_0x598596);}})[_0x8059('0x21')](function(_0x902642){if(_0x902642){return _0x902642?{'count':_0x31a0af,'rows':_0x902642}:null;}})[_0x8059('0x21')](respondWithResult(_0x175802,null))[_0x8059('0x45')](handleError(_0x175802,null));};exports[_0x8059('0x63')]=function(_0x43893f,_0x23d558,_0xc56961){var _0x3297b7=_0x43893f[_0x8059('0x50')]['ids'];return db[_0x8059('0x62')][_0x8059('0x43')]({'where':{'id':_0x3297b7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8059('0x64'),'attributes':['id','name',_0x8059('0x65'),_0x8059('0x66'),_0x8059('0x67')],'raw':!![]}]})[_0x8059('0x21')](function(_0x1e2b15){if(_0x1e2b15){var _0x416c93=_[_0x8059('0x68')](_0x1e2b15,function(_0x3e595c){var _0x589222=_0x3e595c[_0x8059('0x23')]({'plain':!![]});return _0x589222[_0x8059('0x64')];});return db[_0x8059('0x42')]['find']({'where':{'id':_0x43893f['params']['id']}})[_0x8059('0x21')](function(_0x276c67){return db['sequelize'][_0x8059('0x69')](function(_0x4ae0ca){return _0x276c67[_0x8059('0x63')](_0x3297b7,{'transaction':_0x4ae0ca})[_0x8059('0x21')](function(){return BPromise[_0x8059('0x6a')](_0x416c93,function(_0x274ef6){return db[_0x8059('0x57')][_0x8059('0x6b')]({'where':{'UserId':_0x274ef6['id'],'SmsQueueId':_0x43893f[_0x8059('0x47')]['id']},'transaction':_0x4ae0ca});});})[_0x8059('0x21')](function(){_0x416c93[_0x8059('0x6c')](function(_0xe6fdc4){socket['emit'](_0x8059('0x6d'),{'UserId':_0xe6fdc4['id'],'SmsQueueId':_0x276c67['id']});});});});});}})[_0x8059('0x21')](respondWithStatusCode(_0x23d558,null))['catch'](handleError(_0x23d558,null));};exports[_0x8059('0x6e')]=function(_0x24d7cb,_0x41ac30,_0x2e0a9e){return db[_0x8059('0x62')]['findAll']({'where':{'id':_0x24d7cb[_0x8059('0x31')][_0x8059('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x8059('0x58')],'as':_0x8059('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x41ac30,null))[_0x8059('0x21')](function(_0x371762){var _0x6356ed=_[_0x8059('0x2b')](_0x371762,'id');var _0x299b67=[];var _0x43388b=[];var _0x29e863=squel[_0x8059('0x70')]();_0x29e863[_0x8059('0x71')](_0x8059('0x72'))['from'](_0x8059('0x73'),'tq')[_0x8059('0x74')](_0x8059('0x75'),'ut',_0x8059('0x76'))[_0x8059('0x3a')](_0x8059('0x77'),_0x24d7cb[_0x8059('0x47')]['id']);for(var _0x21f9d1=0x0;_0x21f9d1<_0x371762[_0x8059('0x37')];_0x21f9d1+=0x1){let _0x10817f=_0x371762[_0x21f9d1];for(var _0x5db9a7=0x0;_0x5db9a7<_0x10817f[_0x8059('0x64')][_0x8059('0x37')];_0x5db9a7+=0x1){let _0x2b65c0=_0x10817f[_0x8059('0x64')][_0x5db9a7];var _0x161265=_0x29e863[_0x8059('0x78')]();_0x161265['where']('ut.UserId\x20=\x20?',_0x2b65c0['id']);_0x43388b[_0x8059('0x79')](db['sequelize']['query'](_0x161265['toString'](),{'type':db[_0x8059('0x7a')][_0x8059('0x7b')][_0x8059('0x7c')]})[_0x8059('0x21')](function(_0x51a570){if(_0x51a570[_0x8059('0x37')]===0x1){return _0x2b65c0['id'];}else{var _0x3fbf03=_[_0x8059('0x7d')](_[_0x8059('0x2b')](_0x51a570,_0x8059('0x7e')),function(_0xcde601){return _['includes'](_0x6356ed,_0xcde601);});if(_0x3fbf03){return _0x2b65c0['id'];}}}));}}return BPromise[_0x8059('0x7f')](_0x43388b)[_0x8059('0x21')](function(_0x3aa43b){_0x299b67=_(_0x299b67)[_0x8059('0x80')](_0x3aa43b)[_0x8059('0x81')]()[_0x8059('0x82')]();return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x24d7cb[_0x8059('0x47')]['id']}})[_0x8059('0x21')](function(_0x609788){return db[_0x8059('0x7a')][_0x8059('0x69')](function(_0x100e00){return _0x609788['removeTeams'](_0x24d7cb[_0x8059('0x31')][_0x8059('0x6f')],{'transaction':_0x100e00})[_0x8059('0x21')](function(){if(!_[_0x8059('0x83')](_0x299b67)){return _0x609788['removeAgents'](_0x299b67,{'transaction':_0x100e00});}})['then'](function(){_0x299b67['forEach'](function(_0x4a58b8){socket[_0x8059('0x84')](_0x8059('0x85'),{'UserId':_0x4a58b8,'SmsQueueId':_0x609788['id']});});});});});});})[_0x8059('0x21')](respondWithStatusCode(_0x41ac30,null))[_0x8059('0x45')](handleError(_0x41ac30,null));};exports[_0x8059('0x86')]=function(_0x375942,_0x16cd09,_0x2ec671){return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x375942[_0x8059('0x47')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x16cd09,null))['then'](function(_0x11462a){if(_0x11462a){return _0x11462a[_0x8059('0x86')](_0x375942[_0x8059('0x50')][_0x8059('0x6f')],_['omit'](_0x375942[_0x8059('0x50')],[_0x8059('0x6f'),'id'])||{})['spread'](function(_0x30bfb3){for(var _0x4e564b=0x0;_0x4e564b<_0x375942[_0x8059('0x50')][_0x8059('0x6f')][_0x8059('0x37')];_0x4e564b+=0x1){socket[_0x8059('0x84')](_0x8059('0x6d'),{'UserId':Number(_0x375942[_0x8059('0x50')][_0x8059('0x6f')][_0x4e564b]),'SmsQueueId':Number(_0x375942[_0x8059('0x47')]['id'])});}return _0x30bfb3;});}})[_0x8059('0x21')](respondWithResult(_0x16cd09,null))[_0x8059('0x45')](handleError(_0x16cd09,null));};exports[_0x8059('0x87')]=function(_0x662d3d,_0xb92f27,_0xa35595){return db[_0x8059('0x42')]['find']({'where':{'id':_0x662d3d[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0xb92f27,null))[_0x8059('0x21')](function(_0x3976e7){if(_0x3976e7){return _0x3976e7[_0x8059('0x87')](_0x662d3d[_0x8059('0x31')]['ids'])[_0x8059('0x21')](function(){if(_[_0x8059('0x88')](_0x662d3d['query']['ids'])){for(var _0x1312b6=0x0;_0x1312b6<_0x662d3d['query'][_0x8059('0x6f')][_0x8059('0x37')];_0x1312b6+=0x1){socket[_0x8059('0x84')](_0x8059('0x85'),{'UserId':Number(_0x662d3d[_0x8059('0x31')]['ids'][_0x1312b6]),'SmsQueueId':Number(_0x662d3d['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x662d3d[_0x8059('0x31')][_0x8059('0x6f')]),'SmsQueueId':Number(_0x662d3d[_0x8059('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xb92f27,null))[_0x8059('0x45')](handleError(_0xb92f27,null));};exports[_0x8059('0x89')]=function(_0x307eca,_0x17df12,_0x39dd43){var _0x57633f={};var _0x4dec29={};var _0x4d6a1b;var _0x13f867;return db[_0x8059('0x42')][_0x8059('0x53')]({'where':{'id':_0x307eca[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x17df12,null))['then'](function(_0x5282b2){if(_0x5282b2){_0x4d6a1b=_0x5282b2;_0x4dec29[_0x8059('0x30')]=_[_0x8059('0x32')](db['User'][_0x8059('0x2c')]);_0x4dec29[_0x8059('0x31')]=_[_0x8059('0x32')](_0x307eca[_0x8059('0x31')]);_0x4dec29['filters']=_[_0x8059('0x34')](_0x4dec29[_0x8059('0x30')],_0x4dec29[_0x8059('0x31')]);_0x57633f[_0x8059('0x36')]=_[_0x8059('0x34')](_0x4dec29[_0x8059('0x30')],qs[_0x8059('0x35')](_0x307eca[_0x8059('0x31')][_0x8059('0x35')]));_0x57633f[_0x8059('0x36')]=_0x57633f[_0x8059('0x36')][_0x8059('0x37')]?_0x57633f[_0x8059('0x36')]:_0x4dec29['model'];_0x57633f['order']=qs['sort'](_0x307eca[_0x8059('0x31')][_0x8059('0x39')]);_0x57633f[_0x8059('0x3a')]=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x307eca[_0x8059('0x31')],_0x4dec29[_0x8059('0x33')]));if(_0x307eca[_0x8059('0x31')][_0x8059('0x3d')]){_0x57633f[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x57633f['where'],{'$or':_['map'](_0x57633f[_0x8059('0x36')],function(_0x4c1595){var _0x439b5c={};_0x439b5c[_0x4c1595]={'$like':'%'+_0x307eca[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x439b5c;})});}_0x57633f=_[_0x8059('0x3e')]({},_0x57633f,_0x307eca[_0x8059('0x48')]);return _0x4d6a1b[_0x8059('0x89')](_0x57633f);}})['then'](function(_0x23a4c9){if(_0x23a4c9){_0x13f867=_0x23a4c9[_0x8059('0x37')];if(!_0x307eca[_0x8059('0x31')][_0x8059('0x38')](_0x8059('0x54'))){_0x57633f[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x307eca[_0x8059('0x31')][_0x8059('0x1c')]);_0x57633f[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x307eca[_0x8059('0x31')][_0x8059('0x1a')]);}return _0x4d6a1b[_0x8059('0x89')](_0x57633f);}})['then'](function(_0x3be218){if(_0x3be218){return _0x3be218?{'count':_0x13f867,'rows':_0x3be218}:null;}})['then'](respondWithResult(_0x17df12,null))['catch'](handleError(_0x17df12,null));}; \ No newline at end of file +var _0x1b64=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','then','get','SmsQueues','error','stack','name','send','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','SmsQueue','length','includeAll','options','find','catch','body','user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','ids','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x569abc,_0x5ae096){var _0x274622=function(_0x33f07d){while(--_0x33f07d){_0x569abc['push'](_0x569abc['shift']());}};_0x274622(++_0x5ae096);}(_0x1b64,0x76));var _0x41b6=function(_0xd24358,_0x1a3b6e){_0xd24358=_0xd24358-0x0;var _0x59144d=_0x1b64[_0xd24358];return _0x59144d;};'use strict';var emlformat=require(_0x41b6('0x0'));var rimraf=require(_0x41b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x41b6('0x3'));var util=require(_0x41b6('0x4'));var path=require(_0x41b6('0x5'));var sox=require(_0x41b6('0x6'));var csv=require('to-csv');var ejs=require(_0x41b6('0x7'));var fs=require('fs');var fs_extra=require(_0x41b6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x41b6('0x9'));var deskjs=require(_0x41b6('0xa'));var toCsv=require(_0x41b6('0xb'));var querystring=require(_0x41b6('0xc'));var Papa=require(_0x41b6('0xd'));var Redis=require(_0x41b6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x41b6('0xf'));var as=require(_0x41b6('0x10'));var hardwareService=require(_0x41b6('0x11'));var logger=require(_0x41b6('0x12'))(_0x41b6('0x13'));var utils=require(_0x41b6('0x14'));var config=require(_0x41b6('0x15'));var licenseUtil=require(_0x41b6('0x16'));var db=require(_0x41b6('0x17'))['db'];config[_0x41b6('0x18')]=_[_0x41b6('0x19')](config[_0x41b6('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x41b6('0x1a'))(new Redis(config[_0x41b6('0x18')]));require(_0x41b6('0x1b'))[_0x41b6('0x1c')](socket);function respondWithStatusCode(_0x549976,_0x1d41e3){_0x1d41e3=_0x1d41e3||0xcc;return function(_0xed7e7f){if(_0xed7e7f){return _0x549976[_0x41b6('0x1d')](_0x1d41e3);}return _0x549976[_0x41b6('0x1e')](_0x1d41e3)[_0x41b6('0x1f')]();};}function respondWithResult(_0x1bd0b0,_0x30f076){_0x30f076=_0x30f076||0xc8;return function(_0x4805de){if(_0x4805de){return _0x1bd0b0[_0x41b6('0x1e')](_0x30f076)[_0x41b6('0x20')](_0x4805de);}};}function respondWithFilteredResult(_0x1b2500,_0x3b5e9e){return function(_0x14a786){if(_0x14a786){var _0x47feb9=typeof _0x3b5e9e['offset']==='undefined'&&typeof _0x3b5e9e['limit']===_0x41b6('0x21');var _0x5a427a=_0x14a786[_0x41b6('0x22')];var _0xbd99c5=_0x47feb9?0x0:_0x3b5e9e[_0x41b6('0x23')];var _0x3da7de=_0x47feb9?_0x14a786[_0x41b6('0x22')]:_0x3b5e9e[_0x41b6('0x23')]+_0x3b5e9e['limit'];var _0x59948c;if(_0x3da7de>=_0x5a427a){_0x3da7de=_0x5a427a;_0x59948c=0xc8;}else{_0x59948c=0xce;}_0x1b2500[_0x41b6('0x1e')](_0x59948c);return _0x1b2500['set'](_0x41b6('0x24'),_0xbd99c5+'-'+_0x3da7de+'/'+_0x5a427a)[_0x41b6('0x20')](_0x14a786);}return null;};}function patchUpdates(_0x309eba){return function(_0x371fff){try{jsonpatch[_0x41b6('0x25')](_0x371fff,_0x309eba,!![]);}catch(_0x1c8e7a){return BPromise[_0x41b6('0x26')](_0x1c8e7a);}return _0x371fff[_0x41b6('0x27')]();};}function saveUpdates(_0x2f8e9c,_0x3e47bf){return function(_0x137942){if(_0x137942){return _0x137942['update'](_0x2f8e9c)[_0x41b6('0x28')](function(_0x2c1290){return _0x2c1290;});}return null;};}function removeEntity(_0x5a984b,_0x7e3269){return function(_0x358872){if(_0x358872){return _0x358872['destroy']()[_0x41b6('0x28')](function(){var _0x454b5f=_0x358872[_0x41b6('0x29')]({'plain':!![]});var _0x5a9624=_0x41b6('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a9624,'resourceId':_0x454b5f['id']}})['then'](function(){return _0x358872;});})[_0x41b6('0x28')](function(){_0x5a984b[_0x41b6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dee1f,_0x45f9e2){return function(_0x102345){if(!_0x102345){_0x2dee1f[_0x41b6('0x1d')](0x194);}return _0x102345;};}function handleError(_0x3fc486,_0x52d37e){_0x52d37e=_0x52d37e||0x1f4;return function(_0x5a0554){logger[_0x41b6('0x2b')](_0x5a0554[_0x41b6('0x2c')]);if(_0x5a0554[_0x41b6('0x2d')]){delete _0x5a0554['name'];}_0x3fc486[_0x41b6('0x1e')](_0x52d37e)[_0x41b6('0x2e')](_0x5a0554);};}exports['index']=function(_0x27a737,_0x55f9bd){var _0x452c28={},_0x45b2c4={},_0x30542e={'count':0x0,'rows':[]};var _0x2ac3a7=_[_0x41b6('0x2f')](db['SmsQueue'][_0x41b6('0x30')],function(_0x57a206){return{'name':_0x57a206['fieldName'],'type':_0x57a206[_0x41b6('0x31')]['key']};});_0x45b2c4[_0x41b6('0x32')]=_[_0x41b6('0x2f')](_0x2ac3a7,_0x41b6('0x2d'));_0x45b2c4[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x27a737[_0x41b6('0x33')]);_0x45b2c4[_0x41b6('0x35')]=_[_0x41b6('0x36')](_0x45b2c4['model'],_0x45b2c4[_0x41b6('0x33')]);_0x452c28[_0x41b6('0x37')]=_[_0x41b6('0x36')](_0x45b2c4[_0x41b6('0x32')],qs[_0x41b6('0x38')](_0x27a737[_0x41b6('0x33')][_0x41b6('0x38')]));_0x452c28['attributes']=_0x452c28[_0x41b6('0x37')]['length']?_0x452c28['attributes']:_0x45b2c4[_0x41b6('0x32')];if(!_0x27a737[_0x41b6('0x33')][_0x41b6('0x39')](_0x41b6('0x3a'))){_0x452c28[_0x41b6('0x3b')]=qs[_0x41b6('0x3b')](_0x27a737['query'][_0x41b6('0x3b')]);_0x452c28[_0x41b6('0x23')]=qs[_0x41b6('0x23')](_0x27a737[_0x41b6('0x33')][_0x41b6('0x23')]);}_0x452c28[_0x41b6('0x3c')]=qs[_0x41b6('0x3d')](_0x27a737['query'][_0x41b6('0x3d')]);_0x452c28[_0x41b6('0x3e')]=qs[_0x41b6('0x35')](_[_0x41b6('0x3f')](_0x27a737[_0x41b6('0x33')],_0x45b2c4[_0x41b6('0x35')]),_0x2ac3a7);if(_0x27a737[_0x41b6('0x33')][_0x41b6('0x40')]){_0x452c28[_0x41b6('0x3e')]=_[_0x41b6('0x41')](_0x452c28[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x2f')](_0x2ac3a7,function(_0x5de194){if(_0x5de194[_0x41b6('0x31')]!==_0x41b6('0x42')){var _0x146de4={};_0x146de4[_0x5de194[_0x41b6('0x2d')]]={'$like':'%'+_0x27a737[_0x41b6('0x33')][_0x41b6('0x40')]+'%'};return _0x146de4;}})});}_0x452c28=_['merge']({},_0x452c28,_0x27a737['options']);var _0x146f73={'where':_0x452c28[_0x41b6('0x3e')]};return db['SmsQueue']['count'](_0x146f73)[_0x41b6('0x28')](function(_0x2e72ae){_0x30542e[_0x41b6('0x22')]=_0x2e72ae;if(_0x27a737['query']['includeAll']){_0x452c28[_0x41b6('0x43')]=[{'all':!![]}];}return db['SmsQueue'][_0x41b6('0x44')](_0x452c28);})[_0x41b6('0x28')](function(_0x2cee5e){_0x30542e[_0x41b6('0x45')]=_0x2cee5e;return _0x30542e;})[_0x41b6('0x28')](respondWithFilteredResult(_0x55f9bd,_0x452c28))['catch'](handleError(_0x55f9bd,null));};exports[_0x41b6('0x46')]=function(_0x22103e,_0x1c4a3e){var _0x10efd4={'raw':!![],'where':{'id':_0x22103e[_0x41b6('0x47')]['id']}},_0x5f0e3b={};_0x5f0e3b[_0x41b6('0x32')]=_[_0x41b6('0x34')](db[_0x41b6('0x48')][_0x41b6('0x30')]);_0x5f0e3b[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x22103e['query']);_0x5f0e3b[_0x41b6('0x35')]=_['intersection'](_0x5f0e3b[_0x41b6('0x32')],_0x5f0e3b[_0x41b6('0x33')]);_0x10efd4['attributes']=_[_0x41b6('0x36')](_0x5f0e3b[_0x41b6('0x32')],qs['fields'](_0x22103e[_0x41b6('0x33')][_0x41b6('0x38')]));_0x10efd4[_0x41b6('0x37')]=_0x10efd4[_0x41b6('0x37')][_0x41b6('0x49')]?_0x10efd4['attributes']:_0x5f0e3b[_0x41b6('0x32')];if(_0x22103e[_0x41b6('0x33')][_0x41b6('0x4a')]){_0x10efd4['include']=[{'all':!![]}];}_0x10efd4=_[_0x41b6('0x41')]({},_0x10efd4,_0x22103e[_0x41b6('0x4b')]);return db[_0x41b6('0x48')][_0x41b6('0x4c')](_0x10efd4)[_0x41b6('0x28')](handleEntityNotFound(_0x1c4a3e,null))[_0x41b6('0x28')](respondWithResult(_0x1c4a3e,null))[_0x41b6('0x4d')](handleError(_0x1c4a3e,null));};exports['create']=function(_0x565d5d,_0x2384bb){return db['SmsQueue']['create'](_0x565d5d[_0x41b6('0x4e')],{})[_0x41b6('0x28')](function(_0x39d4a0){var _0x21b6c1=_0x565d5d[_0x41b6('0x4f')][_0x41b6('0x29')]({'plain':!![]});if(!_0x21b6c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21b6c1[_0x41b6('0x50')]==='user'){var _0x439833=_0x39d4a0['get']({'plain':!![]});var _0x1d11f5=_0x41b6('0x2a');return db['UserProfileSection'][_0x41b6('0x4c')]({'where':{'name':_0x1d11f5,'userProfileId':_0x21b6c1[_0x41b6('0x51')]},'raw':!![]})[_0x41b6('0x28')](function(_0x26e0e1){if(_0x26e0e1&&_0x26e0e1[_0x41b6('0x52')]===0x0){return db[_0x41b6('0x53')][_0x41b6('0x54')]({'name':_0x439833[_0x41b6('0x2d')],'resourceId':_0x439833['id'],'type':_0x26e0e1[_0x41b6('0x2d')],'sectionId':_0x26e0e1['id']},{})[_0x41b6('0x28')](function(){return _0x39d4a0;});}else{return _0x39d4a0;}})[_0x41b6('0x4d')](function(_0x7d3cfd){logger[_0x41b6('0x2b')](_0x41b6('0x55'),_0x7d3cfd);throw _0x7d3cfd;});}return _0x39d4a0;})[_0x41b6('0x28')](respondWithResult(_0x2384bb,0xc9))[_0x41b6('0x4d')](handleError(_0x2384bb,null));};exports['update']=function(_0x4fe369,_0x5cbb13){if(_0x4fe369[_0x41b6('0x4e')]['id']){delete _0x4fe369[_0x41b6('0x4e')]['id'];}return db[_0x41b6('0x48')][_0x41b6('0x4c')]({'where':{'id':_0x4fe369[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x5cbb13,null))[_0x41b6('0x28')](saveUpdates(_0x4fe369[_0x41b6('0x4e')],null))[_0x41b6('0x28')](respondWithResult(_0x5cbb13,null))[_0x41b6('0x4d')](handleError(_0x5cbb13,null));};exports['destroy']=function(_0x5df302,_0x15dcf1){return db[_0x41b6('0x48')][_0x41b6('0x4c')]({'where':{'id':_0x5df302[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x15dcf1,null))[_0x41b6('0x28')](removeEntity(_0x15dcf1,null))[_0x41b6('0x4d')](handleError(_0x15dcf1,null));};exports[_0x41b6('0x56')]=function(_0x3db501,_0x4252d5){return db[_0x41b6('0x48')][_0x41b6('0x56')]()['then'](respondWithResult(_0x4252d5,null))[_0x41b6('0x4d')](handleError(_0x4252d5,null));};exports[_0x41b6('0x57')]=function(_0x178089,_0x10fa2d,_0x4e916a){var _0x4f7a14={'raw':!![],'where':{}},_0x1e8ddb={},_0x575806;return db['SmsQueue'][_0x41b6('0x58')]({'where':{'id':_0x178089[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x10fa2d,null))[_0x41b6('0x28')](function(_0x2ea2cd){if(_0x2ea2cd){_0x575806=_0x2ea2cd[_0x41b6('0x29')]({'plain':!![]});_0x1e8ddb['model']=_[_0x41b6('0x34')](db[_0x41b6('0x59')]['rawAttributes']);_0x1e8ddb[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x178089['query']);_0x1e8ddb[_0x41b6('0x35')]=_[_0x41b6('0x36')](_0x1e8ddb[_0x41b6('0x32')],_0x1e8ddb[_0x41b6('0x33')]);_0x4f7a14[_0x41b6('0x37')]=_[_0x41b6('0x36')](_0x1e8ddb[_0x41b6('0x32')],qs[_0x41b6('0x38')](_0x178089[_0x41b6('0x33')][_0x41b6('0x38')]));_0x4f7a14['attributes']=_0x4f7a14[_0x41b6('0x37')][_0x41b6('0x49')]?_0x4f7a14[_0x41b6('0x37')]:_0x1e8ddb[_0x41b6('0x32')];if(!_0x178089[_0x41b6('0x33')][_0x41b6('0x39')]('nolimit')){_0x4f7a14[_0x41b6('0x3b')]=qs[_0x41b6('0x3b')](_0x178089[_0x41b6('0x33')]['limit']);_0x4f7a14['offset']=qs[_0x41b6('0x23')](_0x178089[_0x41b6('0x33')]['offset']);}_0x4f7a14['order']=qs[_0x41b6('0x3d')](_0x178089['query'][_0x41b6('0x3d')]);_0x4f7a14[_0x41b6('0x3e')]=qs[_0x41b6('0x35')](_['pick'](_0x178089[_0x41b6('0x33')],_0x1e8ddb[_0x41b6('0x35')]));_0x4f7a14['where'][_0x41b6('0x5a')]=_0x2ea2cd['id'];if(_0x178089['query'][_0x41b6('0x40')]){_0x4f7a14[_0x41b6('0x3e')]=_[_0x41b6('0x41')](_0x4f7a14[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x2f')](_0x4f7a14[_0x41b6('0x37')],function(_0x55013b){var _0x51ba97={};_0x51ba97[_0x55013b]={'$like':'%'+_0x178089[_0x41b6('0x33')]['filter']+'%'};return _0x51ba97;})});}_0x4f7a14=_[_0x41b6('0x41')]({},_0x4f7a14,_0x178089[_0x41b6('0x4b')]);return db[_0x41b6('0x59')][_0x41b6('0x44')](_0x4f7a14);}})['then'](function(_0x590194){if(_0x590194){return db[_0x41b6('0x5b')][_0x41b6('0x5c')]({'where':{'id':_['map'](_0x590194,_0x41b6('0x5d')),'role':_0x41b6('0x5e')},'attributes':['id','name',_0x41b6('0x5f'),_0x41b6('0x60'),_0x41b6('0x61')]});}})[_0x41b6('0x28')](function(_0x252347){if(_0x252347){return{'count':_0x252347[_0x41b6('0x22')],'rows':_[_0x41b6('0x2f')](_0x252347['rows'],function(_0x419ca0){return{'membername':_0x419ca0[_0x41b6('0x2d')],'UserId':_0x419ca0['id'],'queue_name':_0x575806[_0x41b6('0x2d')],'SmsQueueId':_0x575806['id'],'interface':util[_0x41b6('0x62')](_0x41b6('0x63'),'SIP',_0x419ca0[_0x41b6('0x2d')]),'penalty':0x0,'paused':_0x419ca0[_0x41b6('0x5f')],'createdAt':_0x419ca0[_0x41b6('0x61')],'updatedAt':_0x419ca0[_0x41b6('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x41b6('0x28')](respondWithFilteredResult(_0x10fa2d,_0x4f7a14))[_0x41b6('0x4d')](handleError(_0x10fa2d,null));};exports[_0x41b6('0x64')]=function(_0x1a1a8a,_0x1c57bb,_0x3048bf){var _0x139c80={};var _0x231a0f={};var _0xbcf800;var _0x976f9b;return db['SmsQueue'][_0x41b6('0x58')]({'where':{'id':_0x1a1a8a[_0x41b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c57bb,null))[_0x41b6('0x28')](function(_0x200e00){if(_0x200e00){_0xbcf800=_0x200e00;_0x231a0f[_0x41b6('0x32')]=_['keys'](db[_0x41b6('0x65')]['rawAttributes']);_0x231a0f[_0x41b6('0x33')]=_['keys'](_0x1a1a8a[_0x41b6('0x33')]);_0x231a0f[_0x41b6('0x35')]=_[_0x41b6('0x36')](_0x231a0f['model'],_0x231a0f[_0x41b6('0x33')]);_0x139c80['attributes']=_[_0x41b6('0x36')](_0x231a0f[_0x41b6('0x32')],qs['fields'](_0x1a1a8a[_0x41b6('0x33')][_0x41b6('0x38')]));_0x139c80[_0x41b6('0x37')]=_0x139c80[_0x41b6('0x37')][_0x41b6('0x49')]?_0x139c80[_0x41b6('0x37')]:_0x231a0f['model'];_0x139c80['order']=qs[_0x41b6('0x3d')](_0x1a1a8a['query']['sort']);_0x139c80[_0x41b6('0x3e')]=qs[_0x41b6('0x35')](_['pick'](_0x1a1a8a[_0x41b6('0x33')],_0x231a0f[_0x41b6('0x35')]));if(_0x1a1a8a[_0x41b6('0x33')][_0x41b6('0x40')]){_0x139c80[_0x41b6('0x3e')]=_['merge'](_0x139c80['where'],{'$or':_[_0x41b6('0x2f')](_0x139c80[_0x41b6('0x37')],function(_0x18cff3){var _0xd12aa4={};_0xd12aa4[_0x18cff3]={'$like':'%'+_0x1a1a8a['query']['filter']+'%'};return _0xd12aa4;})});}_0x139c80=_[_0x41b6('0x41')]({},_0x139c80,_0x1a1a8a[_0x41b6('0x4b')]);return _0xbcf800[_0x41b6('0x64')](_0x139c80);}})[_0x41b6('0x28')](function(_0x55afd3){if(_0x55afd3){_0x976f9b=_0x55afd3['length'];if(!_0x1a1a8a[_0x41b6('0x33')][_0x41b6('0x39')](_0x41b6('0x3a'))){_0x139c80[_0x41b6('0x3b')]=qs[_0x41b6('0x3b')](_0x1a1a8a['query'][_0x41b6('0x3b')]);_0x139c80['offset']=qs[_0x41b6('0x23')](_0x1a1a8a[_0x41b6('0x33')][_0x41b6('0x23')]);}return _0xbcf800['getTeams'](_0x139c80);}})['then'](function(_0x18dfd3){if(_0x18dfd3){return _0x18dfd3?{'count':_0x976f9b,'rows':_0x18dfd3}:null;}})['then'](respondWithResult(_0x1c57bb,null))[_0x41b6('0x4d')](handleError(_0x1c57bb,null));};exports[_0x41b6('0x66')]=function(_0x5e3cfe,_0xd16eb7,_0x3d213a){var _0x2919b2=_0x5e3cfe[_0x41b6('0x4e')]['ids'];return db[_0x41b6('0x65')][_0x41b6('0x44')]({'where':{'id':_0x2919b2},'attributes':['id'],'include':[{'model':db[_0x41b6('0x5b')],'as':_0x41b6('0x67'),'attributes':['id',_0x41b6('0x2d'),_0x41b6('0x68'),_0x41b6('0x69'),'interface'],'raw':!![]}]})[_0x41b6('0x28')](function(_0x30283a){if(_0x30283a){var _0x6afdc3=_['flatMap'](_0x30283a,function(_0x11858){var _0x594a57=_0x11858[_0x41b6('0x29')]({'plain':!![]});return _0x594a57[_0x41b6('0x67')];});return db[_0x41b6('0x48')]['find']({'where':{'id':_0x5e3cfe['params']['id']}})[_0x41b6('0x28')](function(_0x48f083){return db[_0x41b6('0x6a')][_0x41b6('0x6b')](function(_0x9e743d){return _0x48f083['addTeams'](_0x2919b2,{'transaction':_0x9e743d})['then'](function(){return BPromise[_0x41b6('0x6c')](_0x6afdc3,function(_0x57dca5){return db[_0x41b6('0x59')][_0x41b6('0x6d')]({'where':{'UserId':_0x57dca5['id'],'SmsQueueId':_0x5e3cfe[_0x41b6('0x47')]['id']},'transaction':_0x9e743d});});})['then'](function(){_0x6afdc3[_0x41b6('0x6e')](function(_0x5efc75){socket[_0x41b6('0x6f')](_0x41b6('0x70'),{'UserId':_0x5efc75['id'],'SmsQueueId':_0x48f083['id']});});});});});}})[_0x41b6('0x28')](respondWithStatusCode(_0xd16eb7,null))[_0x41b6('0x4d')](handleError(_0xd16eb7,null));};exports['removeTeams']=function(_0x377091,_0x44dac2,_0x6e97dc){return db[_0x41b6('0x65')][_0x41b6('0x44')]({'where':{'id':_0x377091['query'][_0x41b6('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x41b6('0x67'),'attributes':['id'],'raw':!![]}]})[_0x41b6('0x28')](handleEntityNotFound(_0x44dac2,null))[_0x41b6('0x28')](function(_0x4230ce){var _0x4df30d=_[_0x41b6('0x2f')](_0x4230ce,'id');var _0x4ae731=[];var _0x2d24c0=[];var _0x18476c=squel['select']();_0x18476c[_0x41b6('0x72')](_0x41b6('0x73'))[_0x41b6('0x74')](_0x41b6('0x75'),'tq')[_0x41b6('0x76')](_0x41b6('0x77'),'ut',_0x41b6('0x78'))['where'](_0x41b6('0x79'),_0x377091[_0x41b6('0x47')]['id']);for(var _0x30e04c=0x0;_0x30e04c<_0x4230ce[_0x41b6('0x49')];_0x30e04c+=0x1){let _0x1675f8=_0x4230ce[_0x30e04c];for(var _0x509913=0x0;_0x509913<_0x1675f8[_0x41b6('0x67')][_0x41b6('0x49')];_0x509913+=0x1){let _0x476c31=_0x1675f8[_0x41b6('0x67')][_0x509913];var _0x19b547=_0x18476c[_0x41b6('0x7a')]();_0x19b547[_0x41b6('0x3e')](_0x41b6('0x7b'),_0x476c31['id']);_0x2d24c0[_0x41b6('0x7c')](db[_0x41b6('0x6a')][_0x41b6('0x33')](_0x19b547[_0x41b6('0x7d')](),{'type':db['sequelize']['QueryTypes'][_0x41b6('0x7e')]})[_0x41b6('0x28')](function(_0x231453){if(_0x231453['length']===0x1){return _0x476c31['id'];}else{var _0x183a14=_[_0x41b6('0x7f')](_[_0x41b6('0x2f')](_0x231453,_0x41b6('0x80')),function(_0x4c709c){return _[_0x41b6('0x81')](_0x4df30d,_0x4c709c);});if(_0x183a14){return _0x476c31['id'];}}}));}}return BPromise[_0x41b6('0x82')](_0x2d24c0)[_0x41b6('0x28')](function(_0x49753f){_0x4ae731=_(_0x4ae731)['union'](_0x49753f)['compact']()[_0x41b6('0x83')]();return db[_0x41b6('0x48')]['find']({'where':{'id':_0x377091[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](function(_0x2225d8){return db['sequelize'][_0x41b6('0x6b')](function(_0x345378){return _0x2225d8['removeTeams'](_0x377091[_0x41b6('0x33')]['ids'],{'transaction':_0x345378})[_0x41b6('0x28')](function(){if(!_[_0x41b6('0x84')](_0x4ae731)){return _0x2225d8[_0x41b6('0x85')](_0x4ae731,{'transaction':_0x345378});}})[_0x41b6('0x28')](function(){_0x4ae731['forEach'](function(_0x49ea6a){socket[_0x41b6('0x6f')]('userSmsQueue:remove',{'UserId':_0x49ea6a,'SmsQueueId':_0x2225d8['id']});});});});});});})['then'](respondWithStatusCode(_0x44dac2,null))['catch'](handleError(_0x44dac2,null));};exports[_0x41b6('0x86')]=function(_0x1c9e83,_0x2a5a7d,_0x499078){return db[_0x41b6('0x48')][_0x41b6('0x4c')]({'where':{'id':_0x1c9e83['params']['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x2a5a7d,null))[_0x41b6('0x28')](function(_0x5bba47){if(_0x5bba47){return _0x5bba47[_0x41b6('0x86')](_0x1c9e83[_0x41b6('0x4e')][_0x41b6('0x71')],_[_0x41b6('0x87')](_0x1c9e83[_0x41b6('0x4e')],[_0x41b6('0x71'),'id'])||{})[_0x41b6('0x88')](function(_0x69d479){for(var _0x29a2a4=0x0;_0x29a2a4<_0x1c9e83[_0x41b6('0x4e')]['ids']['length'];_0x29a2a4+=0x1){socket[_0x41b6('0x6f')](_0x41b6('0x70'),{'UserId':Number(_0x1c9e83[_0x41b6('0x4e')][_0x41b6('0x71')][_0x29a2a4]),'SmsQueueId':Number(_0x1c9e83[_0x41b6('0x47')]['id'])});}return _0x69d479;});}})['then'](respondWithResult(_0x2a5a7d,null))[_0x41b6('0x4d')](handleError(_0x2a5a7d,null));};exports['removeAgents']=function(_0x4faa17,_0x1c8f1d,_0x439930){return db['SmsQueue'][_0x41b6('0x4c')]({'where':{'id':_0x4faa17[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x1c8f1d,null))['then'](function(_0x43dfe1){if(_0x43dfe1){return _0x43dfe1['removeAgents'](_0x4faa17['query']['ids'])[_0x41b6('0x28')](function(){if(_[_0x41b6('0x89')](_0x4faa17[_0x41b6('0x33')][_0x41b6('0x71')])){for(var _0x399b60=0x0;_0x399b60<_0x4faa17['query']['ids'][_0x41b6('0x49')];_0x399b60+=0x1){socket[_0x41b6('0x6f')](_0x41b6('0x8a'),{'UserId':Number(_0x4faa17[_0x41b6('0x33')][_0x41b6('0x71')][_0x399b60]),'SmsQueueId':Number(_0x4faa17['params']['id'])});}}else{socket[_0x41b6('0x6f')](_0x41b6('0x8a'),{'UserId':Number(_0x4faa17[_0x41b6('0x33')][_0x41b6('0x71')]),'SmsQueueId':Number(_0x4faa17['params']['id'])});}});}})[_0x41b6('0x28')](respondWithStatusCode(_0x1c8f1d,null))[_0x41b6('0x4d')](handleError(_0x1c8f1d,null));};exports['getAgents']=function(_0x1af08b,_0x2a73db,_0x20ee3f){var _0x244949={};var _0x4798b2={};var _0x41f45a;var _0x5a9f97;return db[_0x41b6('0x48')][_0x41b6('0x58')]({'where':{'id':_0x1af08b[_0x41b6('0x47')]['id']}})[_0x41b6('0x28')](handleEntityNotFound(_0x2a73db,null))[_0x41b6('0x28')](function(_0x1610dc){if(_0x1610dc){_0x41f45a=_0x1610dc;_0x4798b2[_0x41b6('0x32')]=_[_0x41b6('0x34')](db[_0x41b6('0x5b')][_0x41b6('0x30')]);_0x4798b2[_0x41b6('0x33')]=_['keys'](_0x1af08b[_0x41b6('0x33')]);_0x4798b2[_0x41b6('0x35')]=_[_0x41b6('0x36')](_0x4798b2[_0x41b6('0x32')],_0x4798b2[_0x41b6('0x33')]);_0x244949['attributes']=_[_0x41b6('0x36')](_0x4798b2[_0x41b6('0x32')],qs['fields'](_0x1af08b['query'][_0x41b6('0x38')]));_0x244949[_0x41b6('0x37')]=_0x244949['attributes'][_0x41b6('0x49')]?_0x244949[_0x41b6('0x37')]:_0x4798b2['model'];_0x244949[_0x41b6('0x3c')]=qs[_0x41b6('0x3d')](_0x1af08b['query']['sort']);_0x244949['where']=qs[_0x41b6('0x35')](_[_0x41b6('0x3f')](_0x1af08b[_0x41b6('0x33')],_0x4798b2[_0x41b6('0x35')]));if(_0x1af08b[_0x41b6('0x33')][_0x41b6('0x40')]){_0x244949['where']=_['merge'](_0x244949[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x2f')](_0x244949[_0x41b6('0x37')],function(_0x22243a){var _0x2c1fcf={};_0x2c1fcf[_0x22243a]={'$like':'%'+_0x1af08b[_0x41b6('0x33')][_0x41b6('0x40')]+'%'};return _0x2c1fcf;})});}_0x244949=_['merge']({},_0x244949,_0x1af08b[_0x41b6('0x4b')]);return _0x41f45a['getAgents'](_0x244949);}})['then'](function(_0x2c6946){if(_0x2c6946){_0x5a9f97=_0x2c6946[_0x41b6('0x49')];if(!_0x1af08b['query'][_0x41b6('0x39')](_0x41b6('0x3a'))){_0x244949[_0x41b6('0x3b')]=qs['limit'](_0x1af08b[_0x41b6('0x33')][_0x41b6('0x3b')]);_0x244949[_0x41b6('0x23')]=qs[_0x41b6('0x23')](_0x1af08b[_0x41b6('0x33')][_0x41b6('0x23')]);}return _0x41f45a[_0x41b6('0x8b')](_0x244949);}})[_0x41b6('0x28')](function(_0xf4daba){if(_0xf4daba){return _0xf4daba?{'count':_0x5a9f97,'rows':_0xf4daba}:null;}})[_0x41b6('0x28')](respondWithResult(_0x2a73db,null))['catch'](handleError(_0x2a73db,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 7aa3e8b..dd3f52f 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 _0xdc60=['update','remove','emit','hook','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x3ae5be,_0x582174){var _0x1b122b=function(_0x3ac0f4){while(--_0x3ac0f4){_0x3ae5be['push'](_0x3ae5be['shift']());}};_0x1b122b(++_0x582174);}(_0xdc60,0xe4));var _0x0dc6=function(_0x32dbcd,_0x463cd2){_0x32dbcd=_0x32dbcd-0x0;var _0x303818=_0xdc60[_0x32dbcd];return _0x303818;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x0dc6('0x0'))['db'][_0x0dc6('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0dc6('0x2')](0x0);var events={'afterCreate':_0x0dc6('0x3'),'afterUpdate':_0x0dc6('0x4'),'afterDestroy':_0x0dc6('0x5')};function emitEvent(_0x118ab9){return function(_0x1051d0,_0x5ca56e,_0x1657ab){SmsQueueEvents[_0x0dc6('0x6')](_0x118ab9+':'+_0x1051d0['id'],_0x1051d0);SmsQueueEvents[_0x0dc6('0x6')](_0x118ab9,_0x1051d0);_0x1657ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x0dc6('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x8111=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','save'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8111,0x146));var _0x1811=function(_0x1c752f,_0x5e3bbd){_0x1c752f=_0x1c752f-0x0;var _0x118ff9=_0x8111[_0x1c752f];return _0x118ff9;};'use strict';var EventEmitter=require(_0x1811('0x0'));var SmsQueue=require(_0x1811('0x1'))['db'][_0x1811('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1811('0x3'),'afterUpdate':_0x1811('0x4'),'afterDestroy':_0x1811('0x5')};function emitEvent(_0x2bcd4e){return function(_0x61eb24,_0x2d15b5,_0x4da077){SmsQueueEvents[_0x1811('0x6')](_0x2bcd4e+':'+_0x61eb24['id'],_0x61eb24);SmsQueueEvents[_0x1811('0x6')](_0x2bcd4e,_0x61eb24);_0x4da077(null);};}for(var e in events){if(events[_0x1811('0x7')](e)){var event=events[e];SmsQueue[_0x1811('0x8')](e,emitEvent(event));}}module[_0x1811('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 9dd9397..d32bc13 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 _0x74f0=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x74f0,0x18d));var _0x074f=function(_0x3bc82d,_0x59187f){_0x3bc82d=_0x3bc82d-0x0;var _0x2cfb3d=_0x74f0[_0x3bc82d];return _0x2cfb3d;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require(_0x074f('0x1'))(_0x074f('0x2'));var moment=require(_0x074f('0x3'));var BPromise=require(_0x074f('0x4'));var rp=require(_0x074f('0x5'));var fs=require('fs');var path=require(_0x074f('0x6'));var rimraf=require(_0x074f('0x7'));var config=require(_0x074f('0x8'));var attributes=require(_0x074f('0x9'));module[_0x074f('0xa')]=function(_0xd2d4d0,_0x1b6019){return _0xd2d4d0[_0x074f('0xb')](_0x074f('0xc'),attributes,{'tableName':_0x074f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6568=['exports','SmsQueue','sms_queues','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6568,0x10b));var _0x8656=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6568[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x8656('0x0'));var logger=require(_0x8656('0x1'))(_0x8656('0x2'));var moment=require(_0x8656('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8656('0x4'));var rimraf=require(_0x8656('0x5'));var config=require(_0x8656('0x6'));var attributes=require(_0x8656('0x7'));module[_0x8656('0x8')]=function(_0xd82d6f,_0x592703){return _0xd82d6f['define'](_0x8656('0x9'),attributes,{'tableName':_0x8656('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 8cba795..6f998a6 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 _0xe789=['stringify','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','info','GetSmsQueue'];(function(_0x58c1ad,_0x349e71){var _0x22bddf=function(_0x2a6bb5){while(--_0x2a6bb5){_0x58c1ad['push'](_0x58c1ad['shift']());}};_0x22bddf(++_0x349e71);}(_0xe789,0x1af));var _0x9e78=function(_0xea30d3,_0x3be3be){_0xea30d3=_0xea30d3-0x0;var _0x35ab90=_0xe789[_0xea30d3];return _0x35ab90;};'use strict';var _=require(_0x9e78('0x0'));var util=require(_0x9e78('0x1'));var moment=require(_0x9e78('0x2'));var BPromise=require(_0x9e78('0x3'));var rs=require(_0x9e78('0x4'));var fs=require('fs');var Redis=require(_0x9e78('0x5'));var db=require(_0x9e78('0x6'))['db'];var utils=require(_0x9e78('0x7'));var logger=require('../../config/logger')(_0x9e78('0x8'));var config=require(_0x9e78('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e78('0xa')]({'port':0x232a});config[_0x9e78('0xb')]=_[_0x9e78('0xc')](config[_0x9e78('0xb')],{'host':_0x9e78('0xd'),'port':0x18eb});var socket=require(_0x9e78('0xe'))(new Redis(config[_0x9e78('0xb')]));require(_0x9e78('0xf'))['register'](socket);function respondWithRpcPromise(_0x19b6d9,_0x54dddb,_0x29cd13){return new BPromise(function(_0x14d7d9,_0x234c21){return client[_0x9e78('0x10')](_0x19b6d9,_0x29cd13)['then'](function(_0x12401e){logger['info'](_0x9e78('0x11'),_0x54dddb,_0x9e78('0x12'));logger[_0x9e78('0x13')](_0x9e78('0x14'),_0x54dddb,_0x9e78('0x12'),JSON['stringify'](_0x12401e));if(_0x12401e[_0x9e78('0x15')]){if(_0x12401e[_0x9e78('0x15')]['code']===0x1f4){logger[_0x9e78('0x15')](_0x9e78('0x11'),_0x54dddb,_0x12401e['error'][_0x9e78('0x16')]);return _0x234c21(_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);}logger[_0x9e78('0x15')](_0x9e78('0x11'),_0x54dddb,_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);return _0x14d7d9(_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);}else{logger['info'](_0x9e78('0x11'),_0x54dddb,'request\x20sent');_0x14d7d9(_0x12401e['result']['message']);}})[_0x9e78('0x17')](function(_0x3ea9f1){logger[_0x9e78('0x15')]('SmsQueue,\x20%s,\x20%s',_0x54dddb,_0x3ea9f1);_0x234c21(_0x3ea9f1);});});}exports['GetSmsQueue']=function(_0x232fee){var _0x285cb2=this;return new Promise(function(_0x467a7,_0x5ca3f7){return db[_0x9e78('0x18')][_0x9e78('0x19')]({'raw':_0x232fee[_0x9e78('0x1a')]?_0x232fee['options'][_0x9e78('0x1b')]===undefined?!![]:![]:!![],'where':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1c')]||null:null,'attributes':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1d')]||null:null,'limit':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1e')]||null:null,'include':_0x232fee['options']?_0x232fee['options']['include']?_[_0x9e78('0x1f')](_0x232fee['options'][_0x9e78('0x20')],function(_0x579d01){return{'model':db[_0x579d01[_0x9e78('0x21')]],'as':_0x579d01['as'],'attributes':_0x579d01[_0x9e78('0x1d')],'include':_0x579d01[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x579d01['include'],function(_0x26c52a){return{'model':db[_0x26c52a[_0x9e78('0x21')]],'as':_0x26c52a['as'],'attributes':_0x26c52a[_0x9e78('0x1d')],'include':_0x26c52a[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x26c52a['include'],function(_0x12b06b){return{'model':db[_0x12b06b[_0x9e78('0x21')]],'as':_0x12b06b['as'],'attributes':_0x12b06b[_0x9e78('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9e78('0x22')](function(_0x27c81b){logger[_0x9e78('0x23')]('GetSmsQueue',_0x232fee);logger[_0x9e78('0x13')](_0x9e78('0x24'),_0x232fee,JSON[_0x9e78('0x25')](_0x27c81b));_0x467a7(_0x27c81b);})[_0x9e78('0x17')](function(_0xa7e573){logger[_0x9e78('0x15')](_0x9e78('0x24'),_0xa7e573[_0x9e78('0x16')],_0x232fee);_0x5ca3f7(_0x285cb2[_0x9e78('0x15')](0x1f4,_0xa7e573['message']));});});};exports[_0x9e78('0x26')]=function(_0x3fca4a){var _0xd18952=this;return new Promise(function(_0x2a35d5,_0x5ca6fd){return db[_0x9e78('0x18')]['find']({'raw':_0x3fca4a['options']?_0x3fca4a[_0x9e78('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3fca4a['options']?_0x3fca4a[_0x9e78('0x1a')]['where']||null:null,'attributes':_0x3fca4a[_0x9e78('0x1a')]?_0x3fca4a['options'][_0x9e78('0x1d')]||null:null,'include':_0x3fca4a[_0x9e78('0x1a')]?_0x3fca4a[_0x9e78('0x1a')][_0x9e78('0x20')]?_['map'](_0x3fca4a[_0x9e78('0x1a')][_0x9e78('0x20')],function(_0x155700){return{'model':db[_0x155700[_0x9e78('0x21')]],'as':_0x155700['as'],'attributes':_0x155700[_0x9e78('0x1d')],'include':_0x155700['include']?_[_0x9e78('0x1f')](_0x155700[_0x9e78('0x20')],function(_0x146660){return{'model':db[_0x146660['model']],'as':_0x146660['as'],'attributes':_0x146660['attributes'],'include':_0x146660[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x146660[_0x9e78('0x20')],function(_0x5b90f1){return{'model':db[_0x5b90f1['model']],'as':_0x5b90f1['as'],'attributes':_0x5b90f1[_0x9e78('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9e78('0x22')](function(_0x387645){logger['info'](_0x9e78('0x26'),_0x3fca4a);logger['debug'](_0x9e78('0x26'),_0x3fca4a,JSON['stringify'](_0x387645));_0x2a35d5(_0x387645);})[_0x9e78('0x17')](function(_0x1995e1){logger['error'](_0x9e78('0x26'),_0x1995e1['message'],_0x3fca4a);_0x5ca6fd(_0xd18952[_0x9e78('0x15')](0x1f4,_0x1995e1[_0x9e78('0x16')]));});});}; \ No newline at end of file +var _0x858a=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsQueue.socket','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','then','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x858a,0x17d));var _0xa858=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x858a[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xa858('0x0'));var util=require(_0xa858('0x1'));var moment=require(_0xa858('0x2'));var BPromise=require(_0xa858('0x3'));var rs=require(_0xa858('0x4'));var fs=require('fs');var Redis=require(_0xa858('0x5'));var db=require(_0xa858('0x6'))['db'];var utils=require(_0xa858('0x7'));var logger=require(_0xa858('0x8'))(_0xa858('0x9'));var config=require(_0xa858('0xa'));var jayson=require(_0xa858('0xb'));var client=jayson['client'][_0xa858('0xc')]({'port':0x232a});config[_0xa858('0xd')]=_[_0xa858('0xe')](config[_0xa858('0xd')],{'host':_0xa858('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa858('0xd')]));require(_0xa858('0x10'))['register'](socket);function respondWithRpcPromise(_0x1db117,_0x16744d,_0x1d420b){return new BPromise(function(_0x39f53f,_0x14b544){return client['request'](_0x1db117,_0x1d420b)['then'](function(_0x33a994){logger[_0xa858('0x11')](_0xa858('0x12'),_0x16744d,_0xa858('0x13'));logger[_0xa858('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x16744d,'request\x20sent',JSON[_0xa858('0x15')](_0x33a994));if(_0x33a994['error']){if(_0x33a994[_0xa858('0x16')][_0xa858('0x17')]===0x1f4){logger[_0xa858('0x16')](_0xa858('0x12'),_0x16744d,_0x33a994['error'][_0xa858('0x18')]);return _0x14b544(_0x33a994[_0xa858('0x16')][_0xa858('0x18')]);}logger[_0xa858('0x16')](_0xa858('0x12'),_0x16744d,_0x33a994['error'][_0xa858('0x18')]);return _0x39f53f(_0x33a994[_0xa858('0x16')][_0xa858('0x18')]);}else{logger[_0xa858('0x11')](_0xa858('0x12'),_0x16744d,_0xa858('0x13'));_0x39f53f(_0x33a994['result'][_0xa858('0x18')]);}})[_0xa858('0x19')](function(_0x4d6075){logger[_0xa858('0x16')](_0xa858('0x12'),_0x16744d,_0x4d6075);_0x14b544(_0x4d6075);});});}exports[_0xa858('0x1a')]=function(_0x3184d6){var _0x218d0f=this;return new Promise(function(_0x379966,_0x1b269f){return db[_0xa858('0x1b')]['findAll']({'raw':_0x3184d6[_0xa858('0x1c')]?_0x3184d6[_0xa858('0x1c')][_0xa858('0x1d')]===undefined?!![]:![]:!![],'where':_0x3184d6[_0xa858('0x1c')]?_0x3184d6['options'][_0xa858('0x1e')]||null:null,'attributes':_0x3184d6[_0xa858('0x1c')]?_0x3184d6[_0xa858('0x1c')][_0xa858('0x1f')]||null:null,'limit':_0x3184d6[_0xa858('0x1c')]?_0x3184d6[_0xa858('0x1c')][_0xa858('0x20')]||null:null,'include':_0x3184d6[_0xa858('0x1c')]?_0x3184d6[_0xa858('0x1c')][_0xa858('0x21')]?_[_0xa858('0x22')](_0x3184d6['options']['include'],function(_0x63c39f){return{'model':db[_0x63c39f[_0xa858('0x23')]],'as':_0x63c39f['as'],'attributes':_0x63c39f[_0xa858('0x1f')],'include':_0x63c39f['include']?_[_0xa858('0x22')](_0x63c39f[_0xa858('0x21')],function(_0x4543c3){return{'model':db[_0x4543c3[_0xa858('0x23')]],'as':_0x4543c3['as'],'attributes':_0x4543c3['attributes'],'include':_0x4543c3[_0xa858('0x21')]?_[_0xa858('0x22')](_0x4543c3[_0xa858('0x21')],function(_0x352c31){return{'model':db[_0x352c31[_0xa858('0x23')]],'as':_0x352c31['as'],'attributes':_0x352c31[_0xa858('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa858('0x24')](function(_0x706c61){logger[_0xa858('0x11')](_0xa858('0x1a'),_0x3184d6);logger[_0xa858('0x14')](_0xa858('0x1a'),_0x3184d6,JSON[_0xa858('0x15')](_0x706c61));_0x379966(_0x706c61);})[_0xa858('0x19')](function(_0x5ea2b0){logger[_0xa858('0x16')](_0xa858('0x1a'),_0x5ea2b0[_0xa858('0x18')],_0x3184d6);_0x1b269f(_0x218d0f[_0xa858('0x16')](0x1f4,_0x5ea2b0[_0xa858('0x18')]));});});};exports[_0xa858('0x25')]=function(_0x54edae){var _0x191cd5=this;return new Promise(function(_0x1657b6,_0x1e0f92){return db[_0xa858('0x1b')][_0xa858('0x26')]({'raw':_0x54edae['options']?_0x54edae[_0xa858('0x1c')][_0xa858('0x1d')]===undefined?!![]:![]:!![],'where':_0x54edae[_0xa858('0x1c')]?_0x54edae['options'][_0xa858('0x1e')]||null:null,'attributes':_0x54edae[_0xa858('0x1c')]?_0x54edae['options']['attributes']||null:null,'include':_0x54edae[_0xa858('0x1c')]?_0x54edae[_0xa858('0x1c')][_0xa858('0x21')]?_[_0xa858('0x22')](_0x54edae[_0xa858('0x1c')][_0xa858('0x21')],function(_0x2d5795){return{'model':db[_0x2d5795[_0xa858('0x23')]],'as':_0x2d5795['as'],'attributes':_0x2d5795['attributes'],'include':_0x2d5795[_0xa858('0x21')]?_[_0xa858('0x22')](_0x2d5795['include'],function(_0x1447c0){return{'model':db[_0x1447c0[_0xa858('0x23')]],'as':_0x1447c0['as'],'attributes':_0x1447c0[_0xa858('0x1f')],'include':_0x1447c0['include']?_[_0xa858('0x22')](_0x1447c0[_0xa858('0x21')],function(_0xd7d435){return{'model':db[_0xd7d435[_0xa858('0x23')]],'as':_0xd7d435['as'],'attributes':_0xd7d435[_0xa858('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa858('0x24')](function(_0x43bd02){logger[_0xa858('0x11')]('ShowSmsQueue',_0x54edae);logger['debug'](_0xa858('0x25'),_0x54edae,JSON[_0xa858('0x15')](_0x43bd02));_0x1657b6(_0x43bd02);})[_0xa858('0x19')](function(_0x28853f){logger[_0xa858('0x16')](_0xa858('0x25'),_0x28853f[_0xa858('0x18')],_0x54edae);_0x1e0f92(_0x191cd5['error'](0x1f4,_0x28853f[_0xa858('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f6777ac..f8d381a 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 _0xfea2=['save','emit','removeListener','register','./smsQueue.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfea2,0x1a8));var _0x2fea=function(_0x40894e,_0x3fc95a){_0x40894e=_0x40894e-0x0;var _0x119c25=_0xfea2[_0x40894e];return _0x119c25;};'use strict';var SmsQueueEvents=require(_0x2fea('0x0'));var events=[_0x2fea('0x1'),'remove','update'];function createListener(_0x34088d,_0x7528f9){return function(_0x20101a){_0x7528f9[_0x2fea('0x2')](_0x34088d,_0x20101a);};}function removeListener(_0x1f94d2,_0x5582fd){return function(){SmsQueueEvents[_0x2fea('0x3')](_0x1f94d2,_0x5582fd);};}exports[_0x2fea('0x4')]=function(_0x8d6d59){for(var _0x13e318=0x0,_0x1e5b55=events['length'];_0x13e318<_0x1e5b55;_0x13e318++){var _0x29231e=events[_0x13e318];var _0x227ebb=createListener('smsQueue:'+_0x29231e,_0x8d6d59);SmsQueueEvents['on'](_0x29231e,_0x227ebb);}}; \ No newline at end of file +var _0xf251=['remove','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xf251,0x13e));var _0x1f25=function(_0x105b20,_0x388d13){_0x105b20=_0x105b20-0x0;var _0x357455=_0xf251[_0x105b20];return _0x357455;};'use strict';var SmsQueueEvents=require(_0x1f25('0x0'));var events=[_0x1f25('0x1'),_0x1f25('0x2'),'update'];function createListener(_0x53c14a,_0x46fbb0){return function(_0x254afe){_0x46fbb0[_0x1f25('0x3')](_0x53c14a,_0x254afe);};}function removeListener(_0x5129b6,_0x546d38){return function(){SmsQueueEvents[_0x1f25('0x4')](_0x5129b6,_0x546d38);};}exports[_0x1f25('0x5')]=function(_0x7c2d9c){for(var _0x4dd9d8=0x0,_0x103301=events[_0x1f25('0x6')];_0x4dd9d8<_0x103301;_0x4dd9d8++){var _0x217bca=events[_0x4dd9d8];var _0x37d403=createListener(_0x1f25('0x7')+_0x217bca,_0x7c2d9c);SmsQueueEvents['on'](_0x217bca,_0x37d403);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 495eeca..a01dad9 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 _0xcb57=['/describe','describe','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x3acc19,_0x1835de){var _0x5256a2=function(_0xbd72a0){while(--_0xbd72a0){_0x3acc19['push'](_0x3acc19['shift']());}};_0x5256a2(++_0x1835de);}(_0xcb57,0xa1));var _0x7cb5=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcb57[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var path=require('path');var timeout=require(_0x7cb5('0x2'));var express=require('express');var router=express[_0x7cb5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7cb5('0x4'));var interaction=require(_0x7cb5('0x5'));var config=require('../../config/environment');var controller=require(_0x7cb5('0x6'));router[_0x7cb5('0x7')]('/',auth[_0x7cb5('0x8')](),controller['index']);router[_0x7cb5('0x7')](_0x7cb5('0x9'),auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xa')]);router[_0x7cb5('0x7')](_0x7cb5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7cb5('0x8')](),controller['create']);router[_0x7cb5('0xc')]('/:id',auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xd')]);router[_0x7cb5('0xe')](_0x7cb5('0xb'),auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xf')]);module[_0x7cb5('0x10')]=router; \ No newline at end of file +var _0x6cae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x2a89f9,_0x14a34a){var _0x14e0aa=function(_0xdb5e46){while(--_0xdb5e46){_0x2a89f9['push'](_0x2a89f9['shift']());}};_0x14e0aa(++_0x14a34a);}(_0x6cae,0xf0));var _0xe6ca=function(_0x54d44b,_0x3589ce){_0x54d44b=_0x54d44b-0x0;var _0x1f6f9d=_0x6cae[_0x54d44b];return _0x1f6f9d;};'use strict';var multer=require(_0xe6ca('0x0'));var util=require(_0xe6ca('0x1'));var path=require('path');var timeout=require(_0xe6ca('0x2'));var express=require(_0xe6ca('0x3'));var router=express[_0xe6ca('0x4')]();var fs_extra=require(_0xe6ca('0x5'));var auth=require(_0xe6ca('0x6'));var interaction=require(_0xe6ca('0x7'));var config=require(_0xe6ca('0x8'));var controller=require('./smsQueueReport.controller');router[_0xe6ca('0x9')]('/',auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xb')]);router[_0xe6ca('0x9')](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xd')]);router[_0xe6ca('0x9')](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xf')]);router[_0xe6ca('0x10')]('/',auth['isAuthenticated'](),controller[_0xe6ca('0x11')]);router['put'](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x12')]);router[_0xe6ca('0x13')](_0xe6ca('0xe'),auth['isAuthenticated'](),controller[_0xe6ca('0x14')]);module[_0xe6ca('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 8a27226..2043849 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 _0x04bc=['sequelize','exports','STRING','DATE'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x04bc,0x188));var _0xc04b=function(_0x2fb597,_0x1278f1){_0x2fb597=_0x2fb597-0x0;var _0x28c923=_0x04bc[_0x2fb597];return _0x28c923;};'use strict';var moment=require('moment');var Sequelize=require(_0xc04b('0x0'));module[_0xc04b('0x1')]={'uniqueid':{'type':Sequelize[_0xc04b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc04b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc04b('0x3')]},'exitAt':{'type':Sequelize[_0xc04b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3bbf=['sequelize','exports','STRING','DATE'];(function(_0xa69509,_0x2822e5){var _0x2f5296=function(_0x392f3a){while(--_0x392f3a){_0xa69509['push'](_0xa69509['shift']());}};_0x2f5296(++_0x2822e5);}(_0x3bbf,0x130));var _0xf3bb=function(_0x1b95a9,_0x571b50){_0x1b95a9=_0x1b95a9-0x0;var _0x18441b=_0x3bbf[_0x1b95a9];return _0x18441b;};'use strict';var moment=require('moment');var Sequelize=require(_0xf3bb('0x0'));module[_0xf3bb('0x1')]={'uniqueid':{'type':Sequelize[_0xf3bb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf3bb('0x2')]},'joinAt':{'type':Sequelize[_0xf3bb('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf3bb('0x3')]},'exitAt':{'type':Sequelize[_0xf3bb('0x3')]},'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 23d19a5..f7d57da 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 _0xdebb=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','status','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdebb,0x1d2));var _0xbdeb=function(_0x444c2b,_0x1d9920){_0x444c2b=_0x444c2b-0x0;var _0x333ed0=_0xdebb[_0x444c2b];return _0x333ed0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdeb('0x0'));var zipdir=require(_0xbdeb('0x1'));var jsonpatch=require(_0xbdeb('0x2'));var rp=require(_0xbdeb('0x3'));var moment=require(_0xbdeb('0x4'));var BPromise=require(_0xbdeb('0x5'));var Mustache=require(_0xbdeb('0x6'));var util=require(_0xbdeb('0x7'));var path=require(_0xbdeb('0x8'));var sox=require(_0xbdeb('0x9'));var csv=require(_0xbdeb('0xa'));var ejs=require(_0xbdeb('0xb'));var fs=require('fs');var fs_extra=require(_0xbdeb('0xc'));var _=require(_0xbdeb('0xd'));var squel=require(_0xbdeb('0xe'));var crypto=require(_0xbdeb('0xf'));var jsforce=require(_0xbdeb('0x10'));var deskjs=require(_0xbdeb('0x11'));var toCsv=require(_0xbdeb('0xa'));var querystring=require(_0xbdeb('0x12'));var Papa=require(_0xbdeb('0x13'));var Redis=require(_0xbdeb('0x14'));var authService=require(_0xbdeb('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xbdeb('0x16'));var hardwareService=require(_0xbdeb('0x17'));var logger=require(_0xbdeb('0x18'))(_0xbdeb('0x19'));var utils=require('../../config/utils');var config=require(_0xbdeb('0x1a'));var licenseUtil=require(_0xbdeb('0x1b'));var db=require(_0xbdeb('0x1c'))['db'];function respondWithStatusCode(_0x38686e,_0xa11b71){_0xa11b71=_0xa11b71||0xcc;return function(_0x1690fe){if(_0x1690fe){return _0x38686e[_0xbdeb('0x1d')](_0xa11b71);}return _0x38686e['status'](_0xa11b71)['end']();};}function respondWithResult(_0x19977d,_0x266725){_0x266725=_0x266725||0xc8;return function(_0x3d88be){if(_0x3d88be){return _0x19977d['status'](_0x266725)['json'](_0x3d88be);}};}function respondWithFilteredResult(_0xe92c3f,_0x781d27){return function(_0x43ee5a){if(_0x43ee5a){var _0x1d4f48=typeof _0x781d27[_0xbdeb('0x1e')]===_0xbdeb('0x1f')&&typeof _0x781d27['limit']==='undefined';var _0x193ca2=_0x43ee5a['count'];var _0x4872fb=_0x1d4f48?0x0:_0x781d27[_0xbdeb('0x1e')];var _0x6b4f97=_0x1d4f48?_0x43ee5a[_0xbdeb('0x20')]:_0x781d27[_0xbdeb('0x1e')]+_0x781d27[_0xbdeb('0x21')];var _0x35f0ba;if(_0x6b4f97>=_0x193ca2){_0x6b4f97=_0x193ca2;_0x35f0ba=0xc8;}else{_0x35f0ba=0xce;}_0xe92c3f['status'](_0x35f0ba);return _0xe92c3f[_0xbdeb('0x22')](_0xbdeb('0x23'),_0x4872fb+'-'+_0x6b4f97+'/'+_0x193ca2)[_0xbdeb('0x24')](_0x43ee5a);}return null;};}function patchUpdates(_0x33408b){return function(_0x2e39a0){try{jsonpatch[_0xbdeb('0x25')](_0x2e39a0,_0x33408b,!![]);}catch(_0x45f99b){return BPromise[_0xbdeb('0x26')](_0x45f99b);}return _0x2e39a0[_0xbdeb('0x27')]();};}function saveUpdates(_0x458110,_0x388769){return function(_0x4517fe){if(_0x4517fe){return _0x4517fe[_0xbdeb('0x28')](_0x458110)[_0xbdeb('0x29')](function(_0x2d2759){return _0x2d2759;});}return null;};}function removeEntity(_0x5c715f,_0x10f8d0){return function(_0x4f8d2f){if(_0x4f8d2f){return _0x4f8d2f['destroy']()[_0xbdeb('0x29')](function(){_0x5c715f[_0xbdeb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382555,_0x11c38e){return function(_0x548265){if(!_0x548265){_0x382555[_0xbdeb('0x1d')](0x194);}return _0x548265;};}function handleError(_0x387833,_0x289f55){_0x289f55=_0x289f55||0x1f4;return function(_0x47f063){logger['error'](_0x47f063[_0xbdeb('0x2b')]);if(_0x47f063[_0xbdeb('0x2c')]){delete _0x47f063[_0xbdeb('0x2c')];}_0x387833[_0xbdeb('0x2a')](_0x289f55)[_0xbdeb('0x2d')](_0x47f063);};}exports[_0xbdeb('0x2e')]=function(_0x57e454,_0x5e60cb){var _0x342867={},_0x2807c2={},_0x310669={'count':0x0,'rows':[]};var _0x5abdb0=_['map'](db[_0xbdeb('0x2f')][_0xbdeb('0x30')],function(_0x162d0b){return{'name':_0x162d0b[_0xbdeb('0x31')],'type':_0x162d0b[_0xbdeb('0x32')][_0xbdeb('0x33')]};});_0x2807c2[_0xbdeb('0x34')]=_[_0xbdeb('0x35')](_0x5abdb0,_0xbdeb('0x2c'));_0x2807c2[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0x57e454['query']);_0x2807c2[_0xbdeb('0x38')]=_[_0xbdeb('0x39')](_0x2807c2[_0xbdeb('0x34')],_0x2807c2[_0xbdeb('0x36')]);_0x342867['attributes']=_[_0xbdeb('0x39')](_0x2807c2[_0xbdeb('0x34')],qs[_0xbdeb('0x3a')](_0x57e454['query']['fields']));_0x342867[_0xbdeb('0x3b')]=_0x342867['attributes'][_0xbdeb('0x3c')]?_0x342867['attributes']:_0x2807c2[_0xbdeb('0x34')];if(!_0x57e454[_0xbdeb('0x36')]['hasOwnProperty'](_0xbdeb('0x3d'))){_0x342867[_0xbdeb('0x21')]=qs['limit'](_0x57e454[_0xbdeb('0x36')]['limit']);_0x342867[_0xbdeb('0x1e')]=qs[_0xbdeb('0x1e')](_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x1e')]);}_0x342867['order']=qs['sort'](_0x57e454[_0xbdeb('0x36')]['sort']);_0x342867[_0xbdeb('0x3e')]=qs[_0xbdeb('0x38')](_[_0xbdeb('0x3f')](_0x57e454[_0xbdeb('0x36')],_0x2807c2[_0xbdeb('0x38')]),_0x5abdb0);if(_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x40')]){_0x342867['where']=_[_0xbdeb('0x41')](_0x342867['where'],{'$or':_[_0xbdeb('0x35')](_0x5abdb0,function(_0x17af72){if(_0x17af72[_0xbdeb('0x32')]!==_0xbdeb('0x42')){var _0x727eed={};_0x727eed[_0x17af72[_0xbdeb('0x2c')]]={'$like':'%'+_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x40')]+'%'};return _0x727eed;}})});}_0x342867=_[_0xbdeb('0x41')]({},_0x342867,_0x57e454['options']);var _0x3bbfe6={'where':_0x342867[_0xbdeb('0x3e')]};return db[_0xbdeb('0x2f')][_0xbdeb('0x20')](_0x3bbfe6)['then'](function(_0x3ebba4){_0x310669[_0xbdeb('0x20')]=_0x3ebba4;if(_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x43')]){_0x342867[_0xbdeb('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xbdeb('0x45')](_0x342867);})[_0xbdeb('0x29')](function(_0x1288f9){_0x310669[_0xbdeb('0x46')]=_0x1288f9;return _0x310669;})[_0xbdeb('0x29')](respondWithFilteredResult(_0x5e60cb,_0x342867))[_0xbdeb('0x47')](handleError(_0x5e60cb,null));};exports[_0xbdeb('0x48')]=function(_0x4c65b8,_0x456c26){var _0x311be3={'raw':!![],'where':{'id':_0x4c65b8[_0xbdeb('0x49')]['id']}},_0x2c06a0={};_0x2c06a0[_0xbdeb('0x34')]=_[_0xbdeb('0x37')](db[_0xbdeb('0x2f')][_0xbdeb('0x30')]);_0x2c06a0[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0x4c65b8[_0xbdeb('0x36')]);_0x2c06a0[_0xbdeb('0x38')]=_[_0xbdeb('0x39')](_0x2c06a0[_0xbdeb('0x34')],_0x2c06a0[_0xbdeb('0x36')]);_0x311be3[_0xbdeb('0x3b')]=_[_0xbdeb('0x39')](_0x2c06a0[_0xbdeb('0x34')],qs[_0xbdeb('0x3a')](_0x4c65b8[_0xbdeb('0x36')][_0xbdeb('0x3a')]));_0x311be3['attributes']=_0x311be3[_0xbdeb('0x3b')][_0xbdeb('0x3c')]?_0x311be3[_0xbdeb('0x3b')]:_0x2c06a0[_0xbdeb('0x34')];if(_0x4c65b8['query']['includeAll']){_0x311be3[_0xbdeb('0x44')]=[{'all':!![]}];}_0x311be3=_[_0xbdeb('0x41')]({},_0x311be3,_0x4c65b8[_0xbdeb('0x4a')]);return db['SmsQueueReport']['find'](_0x311be3)[_0xbdeb('0x29')](handleEntityNotFound(_0x456c26,null))[_0xbdeb('0x29')](respondWithResult(_0x456c26,null))[_0xbdeb('0x47')](handleError(_0x456c26,null));};exports[_0xbdeb('0x4b')]=function(_0x498c7f,_0x3ede28){return db[_0xbdeb('0x2f')][_0xbdeb('0x4b')](_0x498c7f['body'],{})['then'](respondWithResult(_0x3ede28,0xc9))[_0xbdeb('0x47')](handleError(_0x3ede28,null));};exports['update']=function(_0x49eb45,_0x7f5825){if(_0x49eb45[_0xbdeb('0x4c')]['id']){delete _0x49eb45[_0xbdeb('0x4c')]['id'];}return db['SmsQueueReport'][_0xbdeb('0x4d')]({'where':{'id':_0x49eb45[_0xbdeb('0x49')]['id']}})[_0xbdeb('0x29')](handleEntityNotFound(_0x7f5825,null))[_0xbdeb('0x29')](saveUpdates(_0x49eb45[_0xbdeb('0x4c')],null))['then'](respondWithResult(_0x7f5825,null))['catch'](handleError(_0x7f5825,null));};exports[_0xbdeb('0x4e')]=function(_0x234d2b,_0x283ce6){return db['SmsQueueReport']['find']({'where':{'id':_0x234d2b[_0xbdeb('0x49')]['id']}})[_0xbdeb('0x29')](handleEntityNotFound(_0x283ce6,null))['then'](removeEntity(_0x283ce6,null))['catch'](handleError(_0x283ce6,null));};exports[_0xbdeb('0x4f')]=function(_0x124a47,_0x32388c){return db[_0xbdeb('0x2f')][_0xbdeb('0x4f')]()[_0xbdeb('0x29')](respondWithResult(_0x32388c,null))[_0xbdeb('0x47')](handleError(_0x32388c,null));}; \ No newline at end of file +var _0x88c9=['include','findAll','catch','params','keys','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','offset','count','status','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsQueueReport','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','where','merge','filter','options','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x88c9,0x177));var _0x988c=function(_0x22a971,_0x564874){_0x22a971=_0x22a971-0x0;var _0x701c62=_0x88c9[_0x22a971];return _0x701c62;};'use strict';var emlformat=require(_0x988c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x988c('0x1'));var jsonpatch=require(_0x988c('0x2'));var rp=require(_0x988c('0x3'));var moment=require(_0x988c('0x4'));var BPromise=require(_0x988c('0x5'));var Mustache=require(_0x988c('0x6'));var util=require(_0x988c('0x7'));var path=require(_0x988c('0x8'));var sox=require(_0x988c('0x9'));var csv=require('to-csv');var ejs=require(_0x988c('0xa'));var fs=require('fs');var fs_extra=require(_0x988c('0xb'));var _=require(_0x988c('0xc'));var squel=require(_0x988c('0xd'));var crypto=require(_0x988c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x988c('0xf'));var toCsv=require(_0x988c('0x10'));var querystring=require('querystring');var Papa=require(_0x988c('0x11'));var Redis=require('ioredis');var authService=require(_0x988c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x988c('0x13'));var hardwareService=require(_0x988c('0x14'));var logger=require('../../config/logger')(_0x988c('0x15'));var utils=require(_0x988c('0x16'));var config=require(_0x988c('0x17'));var licenseUtil=require(_0x988c('0x18'));var db=require(_0x988c('0x19'))['db'];function respondWithStatusCode(_0x91f3f7,_0x2062d7){_0x2062d7=_0x2062d7||0xcc;return function(_0x20c641){if(_0x20c641){return _0x91f3f7[_0x988c('0x1a')](_0x2062d7);}return _0x91f3f7['status'](_0x2062d7)[_0x988c('0x1b')]();};}function respondWithResult(_0x769ddb,_0x112818){_0x112818=_0x112818||0xc8;return function(_0x5e9fb6){if(_0x5e9fb6){return _0x769ddb['status'](_0x112818)['json'](_0x5e9fb6);}};}function respondWithFilteredResult(_0xa7c5c2,_0x1ae0e5){return function(_0x14f4e8){if(_0x14f4e8){var _0x518042=typeof _0x1ae0e5['offset']===_0x988c('0x1c')&&typeof _0x1ae0e5[_0x988c('0x1d')]===_0x988c('0x1c');var _0x5d28e8=_0x14f4e8['count'];var _0x2e9ec6=_0x518042?0x0:_0x1ae0e5[_0x988c('0x1e')];var _0x10e727=_0x518042?_0x14f4e8[_0x988c('0x1f')]:_0x1ae0e5[_0x988c('0x1e')]+_0x1ae0e5[_0x988c('0x1d')];var _0x500bd5;if(_0x10e727>=_0x5d28e8){_0x10e727=_0x5d28e8;_0x500bd5=0xc8;}else{_0x500bd5=0xce;}_0xa7c5c2[_0x988c('0x20')](_0x500bd5);return _0xa7c5c2['set'](_0x988c('0x21'),_0x2e9ec6+'-'+_0x10e727+'/'+_0x5d28e8)[_0x988c('0x22')](_0x14f4e8);}return null;};}function patchUpdates(_0x27c0d4){return function(_0x23aef6){try{jsonpatch[_0x988c('0x23')](_0x23aef6,_0x27c0d4,!![]);}catch(_0x5009e6){return BPromise[_0x988c('0x24')](_0x5009e6);}return _0x23aef6[_0x988c('0x25')]();};}function saveUpdates(_0x3161dc,_0x4abfa7){return function(_0x5b25d9){if(_0x5b25d9){return _0x5b25d9[_0x988c('0x26')](_0x3161dc)['then'](function(_0x29eae4){return _0x29eae4;});}return null;};}function removeEntity(_0x24beb5,_0x175323){return function(_0x3120ca){if(_0x3120ca){return _0x3120ca[_0x988c('0x27')]()[_0x988c('0x28')](function(){_0x24beb5[_0x988c('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x143ef5,_0x1e52c9){return function(_0x1110ec){if(!_0x1110ec){_0x143ef5[_0x988c('0x1a')](0x194);}return _0x1110ec;};}function handleError(_0x1c74e7,_0x531d85){_0x531d85=_0x531d85||0x1f4;return function(_0x594f30){logger[_0x988c('0x29')](_0x594f30[_0x988c('0x2a')]);if(_0x594f30[_0x988c('0x2b')]){delete _0x594f30['name'];}_0x1c74e7['status'](_0x531d85)[_0x988c('0x2c')](_0x594f30);};}exports[_0x988c('0x2d')]=function(_0x31831d,_0x4857ff){var _0x1d8318={},_0x18f6de={},_0x1378f0={'count':0x0,'rows':[]};var _0x2e250f=_[_0x988c('0x2e')](db[_0x988c('0x2f')]['rawAttributes'],function(_0x88c740){return{'name':_0x88c740['fieldName'],'type':_0x88c740[_0x988c('0x30')][_0x988c('0x31')]};});_0x18f6de[_0x988c('0x32')]=_[_0x988c('0x2e')](_0x2e250f,_0x988c('0x2b'));_0x18f6de[_0x988c('0x33')]=_['keys'](_0x31831d['query']);_0x18f6de[_0x988c('0x34')]=_['intersection'](_0x18f6de['model'],_0x18f6de['query']);_0x1d8318[_0x988c('0x35')]=_[_0x988c('0x36')](_0x18f6de[_0x988c('0x32')],qs[_0x988c('0x37')](_0x31831d[_0x988c('0x33')][_0x988c('0x37')]));_0x1d8318[_0x988c('0x35')]=_0x1d8318[_0x988c('0x35')]['length']?_0x1d8318[_0x988c('0x35')]:_0x18f6de[_0x988c('0x32')];if(!_0x31831d[_0x988c('0x33')][_0x988c('0x38')]('nolimit')){_0x1d8318['limit']=qs[_0x988c('0x1d')](_0x31831d[_0x988c('0x33')][_0x988c('0x1d')]);_0x1d8318[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x31831d[_0x988c('0x33')][_0x988c('0x1e')]);}_0x1d8318[_0x988c('0x39')]=qs['sort'](_0x31831d[_0x988c('0x33')]['sort']);_0x1d8318[_0x988c('0x3a')]=qs[_0x988c('0x34')](_['pick'](_0x31831d[_0x988c('0x33')],_0x18f6de[_0x988c('0x34')]),_0x2e250f);if(_0x31831d[_0x988c('0x33')]['filter']){_0x1d8318[_0x988c('0x3a')]=_[_0x988c('0x3b')](_0x1d8318[_0x988c('0x3a')],{'$or':_[_0x988c('0x2e')](_0x2e250f,function(_0x4f427e){if(_0x4f427e[_0x988c('0x30')]!=='VIRTUAL'){var _0x39d65e={};_0x39d65e[_0x4f427e[_0x988c('0x2b')]]={'$like':'%'+_0x31831d[_0x988c('0x33')][_0x988c('0x3c')]+'%'};return _0x39d65e;}})});}_0x1d8318=_['merge']({},_0x1d8318,_0x31831d[_0x988c('0x3d')]);var _0x298b53={'where':_0x1d8318[_0x988c('0x3a')]};return db['SmsQueueReport'][_0x988c('0x1f')](_0x298b53)['then'](function(_0x2ae926){_0x1378f0[_0x988c('0x1f')]=_0x2ae926;if(_0x31831d['query'][_0x988c('0x3e')]){_0x1d8318[_0x988c('0x3f')]=[{'all':!![]}];}return db[_0x988c('0x2f')][_0x988c('0x40')](_0x1d8318);})['then'](function(_0x11872f){_0x1378f0['rows']=_0x11872f;return _0x1378f0;})[_0x988c('0x28')](respondWithFilteredResult(_0x4857ff,_0x1d8318))[_0x988c('0x41')](handleError(_0x4857ff,null));};exports['show']=function(_0x3b04eb,_0x2f0e73){var _0x1517bb={'raw':!![],'where':{'id':_0x3b04eb[_0x988c('0x42')]['id']}},_0x2961c3={};_0x2961c3['model']=_['keys'](db[_0x988c('0x2f')]['rawAttributes']);_0x2961c3[_0x988c('0x33')]=_[_0x988c('0x43')](_0x3b04eb[_0x988c('0x33')]);_0x2961c3[_0x988c('0x34')]=_[_0x988c('0x36')](_0x2961c3['model'],_0x2961c3[_0x988c('0x33')]);_0x1517bb[_0x988c('0x35')]=_['intersection'](_0x2961c3[_0x988c('0x32')],qs[_0x988c('0x37')](_0x3b04eb['query'][_0x988c('0x37')]));_0x1517bb[_0x988c('0x35')]=_0x1517bb['attributes'][_0x988c('0x44')]?_0x1517bb[_0x988c('0x35')]:_0x2961c3[_0x988c('0x32')];if(_0x3b04eb['query'][_0x988c('0x3e')]){_0x1517bb[_0x988c('0x3f')]=[{'all':!![]}];}_0x1517bb=_[_0x988c('0x3b')]({},_0x1517bb,_0x3b04eb[_0x988c('0x3d')]);return db['SmsQueueReport'][_0x988c('0x45')](_0x1517bb)[_0x988c('0x28')](handleEntityNotFound(_0x2f0e73,null))['then'](respondWithResult(_0x2f0e73,null))['catch'](handleError(_0x2f0e73,null));};exports[_0x988c('0x46')]=function(_0x249e59,_0x1374aa){return db[_0x988c('0x2f')][_0x988c('0x46')](_0x249e59[_0x988c('0x47')],{})[_0x988c('0x28')](respondWithResult(_0x1374aa,0xc9))[_0x988c('0x41')](handleError(_0x1374aa,null));};exports[_0x988c('0x26')]=function(_0xd2676,_0x28d7a6){if(_0xd2676[_0x988c('0x47')]['id']){delete _0xd2676['body']['id'];}return db[_0x988c('0x2f')][_0x988c('0x45')]({'where':{'id':_0xd2676[_0x988c('0x42')]['id']}})[_0x988c('0x28')](handleEntityNotFound(_0x28d7a6,null))[_0x988c('0x28')](saveUpdates(_0xd2676['body'],null))[_0x988c('0x28')](respondWithResult(_0x28d7a6,null))[_0x988c('0x41')](handleError(_0x28d7a6,null));};exports[_0x988c('0x27')]=function(_0x22e496,_0x20c513){return db['SmsQueueReport'][_0x988c('0x45')]({'where':{'id':_0x22e496[_0x988c('0x42')]['id']}})[_0x988c('0x28')](handleEntityNotFound(_0x20c513,null))[_0x988c('0x28')](removeEntity(_0x20c513,null))[_0x988c('0x41')](handleError(_0x20c513,null));};exports[_0x988c('0x48')]=function(_0x1d836e,_0xb4ff5a){return db['SmsQueueReport'][_0x988c('0x48')]()['then'](respondWithResult(_0xb4ff5a,null))[_0x988c('0x41')](handleError(_0xb4ff5a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index ceca8be..7f7b145 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4d209b,_0x1a05e8){var _0xc5e693=function(_0x109c6e){while(--_0x109c6e){_0x4d209b['push'](_0x4d209b['shift']());}};_0xc5e693(++_0x1a05e8);}(_0xe706,0xa3));var _0x6e70=function(_0xa90718,_0x2fd952){_0xa90718=_0xa90718-0x0;var _0x56ed79=_0xe706[_0xa90718];return _0x56ed79;};'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 +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x5cce26,_0x35aa54){var _0x29f1e0=function(_0xca16ed){while(--_0xca16ed){_0x5cce26['push'](_0x5cce26['shift']());}};_0x29f1e0(++_0x35aa54);}(_0x70e0,0x17b));var _0x070e=function(_0x232b5c,_0x307862){_0x232b5c=_0x232b5c-0x0;var _0x5ac5df=_0x70e0[_0x232b5c];return _0x5ac5df;};'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']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index d07c6db..8b50d5a 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 _0xe984=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','update','attributes','limit','UpdateSmsQueueReport'];(function(_0x51500b,_0x48aba5){var _0x3f2648=function(_0x1a4c89){while(--_0x1a4c89){_0x51500b['push'](_0x51500b['shift']());}};_0x3f2648(++_0x48aba5);}(_0xe984,0xcc));var _0x4e98=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xe984[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0x4e98('0x0'));var util=require(_0x4e98('0x1'));var moment=require(_0x4e98('0x2'));var BPromise=require(_0x4e98('0x3'));var rs=require(_0x4e98('0x4'));var fs=require('fs');var Redis=require(_0x4e98('0x5'));var db=require(_0x4e98('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e98('0x7'))(_0x4e98('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e98('0x9'));var client=jayson[_0x4e98('0xa')][_0x4e98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c8df,_0x461260,_0x283006){return new BPromise(function(_0x4216aa,_0x2ebc96){return client[_0x4e98('0xc')](_0x55c8df,_0x283006)[_0x4e98('0xd')](function(_0x9937b6){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x461260,'request\x20sent');logger[_0x4e98('0xe')](_0x4e98('0xf'),_0x461260,_0x4e98('0x10'),JSON[_0x4e98('0x11')](_0x9937b6));if(_0x9937b6[_0x4e98('0x12')]){if(_0x9937b6[_0x4e98('0x12')][_0x4e98('0x13')]===0x1f4){logger[_0x4e98('0x12')](_0x4e98('0x14'),_0x461260,_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);return _0x2ebc96(_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);}logger[_0x4e98('0x12')](_0x4e98('0x14'),_0x461260,_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);return _0x4216aa(_0x9937b6[_0x4e98('0x12')]['message']);}else{logger[_0x4e98('0x16')](_0x4e98('0x14'),_0x461260,_0x4e98('0x10'));_0x4216aa(_0x9937b6[_0x4e98('0x17')]['message']);}})[_0x4e98('0x18')](function(_0x6e542d){logger['error'](_0x4e98('0x14'),_0x461260,_0x6e542d);_0x2ebc96(_0x6e542d);});});}exports[_0x4e98('0x19')]=function(_0x58f02e){var _0x20a6e2=this;return new Promise(function(_0x3d87f8,_0x10dd9b){return db[_0x4e98('0x1a')][_0x4e98('0x1b')](_0x58f02e[_0x4e98('0x1c')],{'raw':_0x58f02e[_0x4e98('0x1d')]?_0x58f02e[_0x4e98('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x4e98('0xd')](function(_0x38e511){logger[_0x4e98('0x16')](_0x4e98('0x19'),_0x58f02e);logger['debug'](_0x4e98('0x19'),_0x58f02e,JSON[_0x4e98('0x11')](_0x38e511));_0x3d87f8(_0x38e511);})[_0x4e98('0x18')](function(_0x5100b4){logger['error'](_0x4e98('0x19'),_0x5100b4[_0x4e98('0x15')],_0x58f02e);_0x10dd9b(_0x20a6e2[_0x4e98('0x12')](0x1f4,_0x5100b4[_0x4e98('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x250f3c){var _0x382018=this;return new Promise(function(_0x11ab19,_0x3c69cf){return db['SmsQueueReport'][_0x4e98('0x1e')](_0x250f3c[_0x4e98('0x1c')],{'raw':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')]['where']||null:null,'attributes':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')][_0x4e98('0x1f')]||null:null,'limit':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')][_0x4e98('0x20')]||null:null})[_0x4e98('0xd')](function(_0x404d9f){logger[_0x4e98('0x16')](_0x4e98('0x21'),_0x250f3c);logger[_0x4e98('0xe')]('UpdateSmsQueueReport',_0x250f3c,JSON[_0x4e98('0x11')](_0x404d9f));_0x11ab19(_0x404d9f);})[_0x4e98('0x18')](function(_0x499712){logger['error']('UpdateSmsQueueReport',_0x499712['message'],_0x250f3c);_0x3c69cf(_0x382018[_0x4e98('0x12')](0x1f4,_0x499712[_0x4e98('0x15')]));});});}; \ No newline at end of file +var _0x66c6=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1ad0e3,_0x38bd34){var _0xda89c7=function(_0x233e4e){while(--_0x233e4e){_0x1ad0e3['push'](_0x1ad0e3['shift']());}};_0xda89c7(++_0x38bd34);}(_0x66c6,0x131));var _0x666c=function(_0x1403b0,_0x52b0fe){_0x1403b0=_0x1403b0-0x0;var _0x25541c=_0x66c6[_0x1403b0];return _0x25541c;};'use strict';var _=require(_0x666c('0x0'));var util=require(_0x666c('0x1'));var moment=require(_0x666c('0x2'));var BPromise=require(_0x666c('0x3'));var rs=require(_0x666c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x666c('0x5'));var logger=require(_0x666c('0x6'))('rpc');var config=require(_0x666c('0x7'));var jayson=require(_0x666c('0x8'));var client=jayson[_0x666c('0x9')][_0x666c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ecf7,_0x400c4d,_0x3b3ebc){return new BPromise(function(_0x1a95ff,_0x67cd2a){return client[_0x666c('0xb')](_0x37ecf7,_0x3b3ebc)[_0x666c('0xc')](function(_0x23741e){logger[_0x666c('0xd')](_0x666c('0xe'),_0x400c4d,_0x666c('0xf'));logger[_0x666c('0x10')](_0x666c('0x11'),_0x400c4d,_0x666c('0xf'),JSON['stringify'](_0x23741e));if(_0x23741e[_0x666c('0x12')]){if(_0x23741e['error'][_0x666c('0x13')]===0x1f4){logger[_0x666c('0x12')](_0x666c('0xe'),_0x400c4d,_0x23741e[_0x666c('0x12')]['message']);return _0x67cd2a(_0x23741e[_0x666c('0x12')][_0x666c('0x14')]);}logger['error'](_0x666c('0xe'),_0x400c4d,_0x23741e[_0x666c('0x12')]['message']);return _0x1a95ff(_0x23741e['error'][_0x666c('0x14')]);}else{logger[_0x666c('0xd')](_0x666c('0xe'),_0x400c4d,'request\x20sent');_0x1a95ff(_0x23741e[_0x666c('0x15')][_0x666c('0x14')]);}})[_0x666c('0x16')](function(_0x324a40){logger[_0x666c('0x12')](_0x666c('0xe'),_0x400c4d,_0x324a40);_0x67cd2a(_0x324a40);});});}exports['CreateSmsQueueReport']=function(_0x209fd1){var _0x121a23=this;return new Promise(function(_0x949df0,_0x47effd){return db[_0x666c('0x17')][_0x666c('0x18')](_0x209fd1[_0x666c('0x19')],{'raw':_0x209fd1[_0x666c('0x1a')]?_0x209fd1['options'][_0x666c('0x1b')]===undefined?!![]:![]:!![]})[_0x666c('0xc')](function(_0xdda736){logger[_0x666c('0xd')](_0x666c('0x1c'),_0x209fd1);logger[_0x666c('0x10')]('CreateSmsQueueReport',_0x209fd1,JSON[_0x666c('0x1d')](_0xdda736));_0x949df0(_0xdda736);})[_0x666c('0x16')](function(_0x1f095c){logger['error'](_0x666c('0x1c'),_0x1f095c[_0x666c('0x14')],_0x209fd1);_0x47effd(_0x121a23[_0x666c('0x12')](0x1f4,_0x1f095c[_0x666c('0x14')]));});});};exports[_0x666c('0x1e')]=function(_0x9c8609){var _0x58e0a0=this;return new Promise(function(_0x2400cd,_0x1e0e2b){return db[_0x666c('0x17')][_0x666c('0x1f')](_0x9c8609[_0x666c('0x19')],{'raw':_0x9c8609['options']?_0x9c8609[_0x666c('0x1a')][_0x666c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c8609['options']?_0x9c8609[_0x666c('0x1a')][_0x666c('0x20')]||null:null,'attributes':_0x9c8609['options']?_0x9c8609['options'][_0x666c('0x21')]||null:null,'limit':_0x9c8609[_0x666c('0x1a')]?_0x9c8609[_0x666c('0x1a')][_0x666c('0x22')]||null:null})[_0x666c('0xc')](function(_0x2d3878){logger['info']('UpdateSmsQueueReport',_0x9c8609);logger['debug'](_0x666c('0x1e'),_0x9c8609,JSON[_0x666c('0x1d')](_0x2d3878));_0x2400cd(_0x2d3878);})['catch'](function(_0x1bf0f4){logger['error'](_0x666c('0x1e'),_0x1bf0f4[_0x666c('0x14')],_0x9c8609);_0x1e0e2b(_0x58e0a0[_0x666c('0x12')](0x1f4,_0x1bf0f4[_0x666c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ba32510..d530043 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 _0x0fda=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x44cf20,_0x3b6faf){var _0x3bb7c5=function(_0x516c01){while(--_0x516c01){_0x44cf20['push'](_0x44cf20['shift']());}};_0x3bb7c5(++_0x3b6faf);}(_0x0fda,0x1a0));var _0xa0fd=function(_0xa4e9c8,_0x2676f3){_0xa4e9c8=_0xa4e9c8-0x0;var _0x45d4e1=_0x0fda[_0xa4e9c8];return _0x45d4e1;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var timeout=require(_0xa0fd('0x2'));var express=require(_0xa0fd('0x3'));var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0xa0fd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0fd('0x8')](_0xa0fd('0x9'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xb')]);router['get'](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xd')]);router[_0xa0fd('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0fd('0xf')]);router[_0xa0fd('0x10')](_0xa0fd('0xc'),auth['isAuthenticated'](),controller[_0xa0fd('0x11')]);router[_0xa0fd('0x12')](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbfe8=['describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x262e53,_0x5a9acd){_0x262e53=_0x262e53-0x0;var _0x5bcca7=_0xbfe8[_0x262e53];return _0x5bcca7;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);router['delete'](_0x8bfe('0xa'),auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);module[_0x8bfe('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 1b90095..375da4b 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x82c6ae,_0x166560){var _0x41a4fa=function(_0x461ed8){while(--_0x461ed8){_0x82c6ae['push'](_0x82c6ae['shift']());}};_0x41a4fa(++_0x166560);}(_0x70e0,0x17b));var _0x070e=function(_0x3a67d2,_0x4a0cad){_0x3a67d2=_0x3a67d2-0x0;var _0x286153=_0x70e0[_0x3a67d2];return _0x286153;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4d8790,_0x521730){var _0x5e99c4=function(_0x3c34af){while(--_0x3c34af){_0x4d8790['push'](_0x4d8790['shift']());}};_0x5e99c4(++_0x521730);}(_0x54ef,0x112));var _0xf54e=function(_0x5f18d7,_0x3f3953){_0x5f18d7=_0x5f18d7-0x0;var _0xff43dd=_0x54ef[_0x5f18d7];return _0xff43dd;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 911c1b0..392d8b5 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 _0x4e4d=['../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','apply','save','update','then','end','sendStatus','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4e4d,0x188));var _0xd4e4=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x4e4d[_0x59d0cc];return _0x2ae79f;};'use strict';var emlformat=require(_0xd4e4('0x0'));var rimraf=require(_0xd4e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4e4('0x2'));var rp=require(_0xd4e4('0x3'));var moment=require(_0xd4e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd4e4('0x5'));var util=require(_0xd4e4('0x6'));var path=require('path');var sox=require(_0xd4e4('0x7'));var csv=require(_0xd4e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd4e4('0x9'));var crypto=require(_0xd4e4('0xa'));var jsforce=require(_0xd4e4('0xb'));var deskjs=require(_0xd4e4('0xc'));var toCsv=require(_0xd4e4('0x8'));var querystring=require(_0xd4e4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4e4('0xe'));var qs=require(_0xd4e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4e4('0x10'));var logger=require(_0xd4e4('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd4e4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd4e4('0x13'))['db'];function respondWithStatusCode(_0x6a141a,_0x5980e6){_0x5980e6=_0x5980e6||0xcc;return function(_0x5264d1){if(_0x5264d1){return _0x6a141a['sendStatus'](_0x5980e6);}return _0x6a141a[_0xd4e4('0x14')](_0x5980e6)['end']();};}function respondWithResult(_0xf51c2f,_0x560e84){_0x560e84=_0x560e84||0xc8;return function(_0x1e9435){if(_0x1e9435){return _0xf51c2f[_0xd4e4('0x14')](_0x560e84)['json'](_0x1e9435);}};}function respondWithFilteredResult(_0x3d70af,_0x272f56){return function(_0x3b9308){if(_0x3b9308){var _0x58b28d=typeof _0x272f56[_0xd4e4('0x15')]===_0xd4e4('0x16')&&typeof _0x272f56[_0xd4e4('0x17')]===_0xd4e4('0x16');var _0x1114fc=_0x3b9308[_0xd4e4('0x18')];var _0x4e9c2b=_0x58b28d?0x0:_0x272f56['offset'];var _0x4ff5c2=_0x58b28d?_0x3b9308[_0xd4e4('0x18')]:_0x272f56[_0xd4e4('0x15')]+_0x272f56[_0xd4e4('0x17')];var _0x242da3;if(_0x4ff5c2>=_0x1114fc){_0x4ff5c2=_0x1114fc;_0x242da3=0xc8;}else{_0x242da3=0xce;}_0x3d70af['status'](_0x242da3);return _0x3d70af['set']('Content-Range',_0x4e9c2b+'-'+_0x4ff5c2+'/'+_0x1114fc)['json'](_0x3b9308);}return null;};}function patchUpdates(_0x5b2d06){return function(_0x388e94){try{jsonpatch[_0xd4e4('0x19')](_0x388e94,_0x5b2d06,!![]);}catch(_0x544725){return BPromise['reject'](_0x544725);}return _0x388e94[_0xd4e4('0x1a')]();};}function saveUpdates(_0x46fa1f,_0x5b18ac){return function(_0x37db51){if(_0x37db51){return _0x37db51[_0xd4e4('0x1b')](_0x46fa1f)[_0xd4e4('0x1c')](function(_0x56f285){return _0x56f285;});}return null;};}function removeEntity(_0x5ca26b,_0x8ccd74){return function(_0xed8392){if(_0xed8392){return _0xed8392['destroy']()[_0xd4e4('0x1c')](function(){_0x5ca26b[_0xd4e4('0x14')](0xcc)[_0xd4e4('0x1d')]();});}};}function handleEntityNotFound(_0xc987b2,_0x3fab1c){return function(_0x955634){if(!_0x955634){_0xc987b2[_0xd4e4('0x1e')](0x194);}return _0x955634;};}function handleError(_0x4875a6,_0x1c675f){_0x1c675f=_0x1c675f||0x1f4;return function(_0x32d1cc){logger[_0xd4e4('0x1f')](_0x32d1cc[_0xd4e4('0x20')]);if(_0x32d1cc[_0xd4e4('0x21')]){delete _0x32d1cc[_0xd4e4('0x21')];}_0x4875a6[_0xd4e4('0x14')](_0x1c675f)[_0xd4e4('0x22')](_0x32d1cc);};}exports['index']=function(_0x426ec0,_0x58c632){var _0x25f8d0={},_0x98c5ef={},_0x5b1c2e={'count':0x0,'rows':[]};var _0x22e2cd=_[_0xd4e4('0x23')](db[_0xd4e4('0x24')][_0xd4e4('0x25')],function(_0x470466){return{'name':_0x470466[_0xd4e4('0x26')],'type':_0x470466[_0xd4e4('0x27')][_0xd4e4('0x28')]};});_0x98c5ef[_0xd4e4('0x29')]=_[_0xd4e4('0x23')](_0x22e2cd,_0xd4e4('0x21'));_0x98c5ef[_0xd4e4('0x2a')]=_[_0xd4e4('0x2b')](_0x426ec0[_0xd4e4('0x2a')]);_0x98c5ef[_0xd4e4('0x2c')]=_[_0xd4e4('0x2d')](_0x98c5ef[_0xd4e4('0x29')],_0x98c5ef['query']);_0x25f8d0[_0xd4e4('0x2e')]=_[_0xd4e4('0x2d')](_0x98c5ef[_0xd4e4('0x29')],qs[_0xd4e4('0x2f')](_0x426ec0['query'][_0xd4e4('0x2f')]));_0x25f8d0[_0xd4e4('0x2e')]=_0x25f8d0[_0xd4e4('0x2e')][_0xd4e4('0x30')]?_0x25f8d0[_0xd4e4('0x2e')]:_0x98c5ef[_0xd4e4('0x29')];if(!_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x31')](_0xd4e4('0x32'))){_0x25f8d0[_0xd4e4('0x17')]=qs[_0xd4e4('0x17')](_0x426ec0['query'][_0xd4e4('0x17')]);_0x25f8d0['offset']=qs['offset'](_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x15')]);}_0x25f8d0['order']=qs[_0xd4e4('0x33')](_0x426ec0[_0xd4e4('0x2a')]['sort']);_0x25f8d0[_0xd4e4('0x34')]=qs[_0xd4e4('0x2c')](_[_0xd4e4('0x35')](_0x426ec0[_0xd4e4('0x2a')],_0x98c5ef['filters']),_0x22e2cd);if(_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x36')]){_0x25f8d0['where']=_[_0xd4e4('0x37')](_0x25f8d0[_0xd4e4('0x34')],{'$or':_[_0xd4e4('0x23')](_0x22e2cd,function(_0x4ac377){if(_0x4ac377[_0xd4e4('0x27')]!=='VIRTUAL'){var _0x398162={};_0x398162[_0x4ac377[_0xd4e4('0x21')]]={'$like':'%'+_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x36')]+'%'};return _0x398162;}})});}_0x25f8d0=_[_0xd4e4('0x37')]({},_0x25f8d0,_0x426ec0[_0xd4e4('0x38')]);var _0x55ba87={'where':_0x25f8d0['where']};return db[_0xd4e4('0x24')][_0xd4e4('0x18')](_0x55ba87)['then'](function(_0x46b006){_0x5b1c2e[_0xd4e4('0x18')]=_0x46b006;if(_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x39')]){_0x25f8d0[_0xd4e4('0x3a')]=[{'all':!![]}];}return db[_0xd4e4('0x24')][_0xd4e4('0x3b')](_0x25f8d0);})['then'](function(_0x1987e1){_0x5b1c2e[_0xd4e4('0x3c')]=_0x1987e1;return _0x5b1c2e;})[_0xd4e4('0x1c')](respondWithFilteredResult(_0x58c632,_0x25f8d0))['catch'](handleError(_0x58c632,null));};exports[_0xd4e4('0x3d')]=function(_0x57ba8c,_0x4f9ad2){var _0x3166c8={'raw':!![],'where':{'id':_0x57ba8c[_0xd4e4('0x3e')]['id']}},_0x2ef4cb={};_0x2ef4cb[_0xd4e4('0x29')]=_[_0xd4e4('0x2b')](db[_0xd4e4('0x24')][_0xd4e4('0x25')]);_0x2ef4cb['query']=_[_0xd4e4('0x2b')](_0x57ba8c[_0xd4e4('0x2a')]);_0x2ef4cb['filters']=_[_0xd4e4('0x2d')](_0x2ef4cb[_0xd4e4('0x29')],_0x2ef4cb[_0xd4e4('0x2a')]);_0x3166c8[_0xd4e4('0x2e')]=_[_0xd4e4('0x2d')](_0x2ef4cb[_0xd4e4('0x29')],qs[_0xd4e4('0x2f')](_0x57ba8c['query'][_0xd4e4('0x2f')]));_0x3166c8[_0xd4e4('0x2e')]=_0x3166c8[_0xd4e4('0x2e')][_0xd4e4('0x30')]?_0x3166c8[_0xd4e4('0x2e')]:_0x2ef4cb['model'];if(_0x57ba8c[_0xd4e4('0x2a')]['includeAll']){_0x3166c8[_0xd4e4('0x3a')]=[{'all':!![]}];}_0x3166c8=_[_0xd4e4('0x37')]({},_0x3166c8,_0x57ba8c[_0xd4e4('0x38')]);return db[_0xd4e4('0x24')][_0xd4e4('0x3f')](_0x3166c8)['then'](handleEntityNotFound(_0x4f9ad2,null))['then'](respondWithResult(_0x4f9ad2,null))['catch'](handleError(_0x4f9ad2,null));};exports[_0xd4e4('0x40')]=function(_0x3ad6b7,_0x5396d3){return db[_0xd4e4('0x24')][_0xd4e4('0x40')](_0x3ad6b7[_0xd4e4('0x41')],{})[_0xd4e4('0x1c')](respondWithResult(_0x5396d3,0xc9))[_0xd4e4('0x42')](handleError(_0x5396d3,null));};exports[_0xd4e4('0x1b')]=function(_0x2e1feb,_0x3c1905){if(_0x2e1feb[_0xd4e4('0x41')]['id']){delete _0x2e1feb[_0xd4e4('0x41')]['id'];}return db['SmsTransferReport'][_0xd4e4('0x3f')]({'where':{'id':_0x2e1feb[_0xd4e4('0x3e')]['id']}})[_0xd4e4('0x1c')](handleEntityNotFound(_0x3c1905,null))[_0xd4e4('0x1c')](saveUpdates(_0x2e1feb[_0xd4e4('0x41')],null))[_0xd4e4('0x1c')](respondWithResult(_0x3c1905,null))[_0xd4e4('0x42')](handleError(_0x3c1905,null));};exports['destroy']=function(_0x2728a0,_0x55fd3b){return db['SmsTransferReport']['find']({'where':{'id':_0x2728a0[_0xd4e4('0x3e')]['id']}})[_0xd4e4('0x1c')](handleEntityNotFound(_0x55fd3b,null))['then'](removeEntity(_0x55fd3b,null))[_0xd4e4('0x42')](handleError(_0x55fd3b,null));};exports[_0xd4e4('0x43')]=function(_0x4c1933,_0x441b4f){return db[_0xd4e4('0x24')][_0xd4e4('0x43')]()[_0xd4e4('0x1c')](respondWithResult(_0x441b4f,null))['catch'](handleError(_0x441b4f,null));}; \ No newline at end of file +var _0x9703=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto'];(function(_0x398494,_0x535c06){var _0x5019fa=function(_0x1da351){while(--_0x1da351){_0x398494['push'](_0x398494['shift']());}};_0x5019fa(++_0x535c06);}(_0x9703,0x16c));var _0x3970=function(_0x155fca,_0xbad4f2){_0x155fca=_0x155fca-0x0;var _0x2320da=_0x9703[_0x155fca];return _0x2320da;};'use strict';var emlformat=require(_0x3970('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3970('0x1'));var rp=require(_0x3970('0x2'));var moment=require('moment');var BPromise=require(_0x3970('0x3'));var Mustache=require(_0x3970('0x4'));var util=require(_0x3970('0x5'));var path=require(_0x3970('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3970('0x7'));var _=require(_0x3970('0x8'));var squel=require(_0x3970('0x9'));var crypto=require(_0x3970('0xa'));var jsforce=require(_0x3970('0xb'));var deskjs=require(_0x3970('0xc'));var toCsv=require(_0x3970('0xd'));var querystring=require(_0x3970('0xe'));var Papa=require(_0x3970('0xf'));var Redis=require(_0x3970('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3970('0x11'));var as=require(_0x3970('0x12'));var hardwareService=require(_0x3970('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3970('0x14'));var config=require(_0x3970('0x15'));var licenseUtil=require(_0x3970('0x16'));var db=require(_0x3970('0x17'))['db'];function respondWithStatusCode(_0x3e7a52,_0x404542){_0x404542=_0x404542||0xcc;return function(_0x5aa2b6){if(_0x5aa2b6){return _0x3e7a52[_0x3970('0x18')](_0x404542);}return _0x3e7a52[_0x3970('0x19')](_0x404542)[_0x3970('0x1a')]();};}function respondWithResult(_0x20bdd0,_0x2cd03c){_0x2cd03c=_0x2cd03c||0xc8;return function(_0x1a81ab){if(_0x1a81ab){return _0x20bdd0[_0x3970('0x19')](_0x2cd03c)[_0x3970('0x1b')](_0x1a81ab);}};}function respondWithFilteredResult(_0x5bc498,_0x1362af){return function(_0x123550){if(_0x123550){var _0x3ce17d=typeof _0x1362af[_0x3970('0x1c')]==='undefined'&&typeof _0x1362af[_0x3970('0x1d')]===_0x3970('0x1e');var _0x2df225=_0x123550['count'];var _0x2467f4=_0x3ce17d?0x0:_0x1362af[_0x3970('0x1c')];var _0x3f0aa6=_0x3ce17d?_0x123550[_0x3970('0x1f')]:_0x1362af[_0x3970('0x1c')]+_0x1362af[_0x3970('0x1d')];var _0x2b4b82;if(_0x3f0aa6>=_0x2df225){_0x3f0aa6=_0x2df225;_0x2b4b82=0xc8;}else{_0x2b4b82=0xce;}_0x5bc498['status'](_0x2b4b82);return _0x5bc498[_0x3970('0x20')]('Content-Range',_0x2467f4+'-'+_0x3f0aa6+'/'+_0x2df225)[_0x3970('0x1b')](_0x123550);}return null;};}function patchUpdates(_0x413ec5){return function(_0xa366a9){try{jsonpatch[_0x3970('0x21')](_0xa366a9,_0x413ec5,!![]);}catch(_0x5cecdd){return BPromise[_0x3970('0x22')](_0x5cecdd);}return _0xa366a9[_0x3970('0x23')]();};}function saveUpdates(_0x1218c4,_0x57dcfb){return function(_0x57505a){if(_0x57505a){return _0x57505a[_0x3970('0x24')](_0x1218c4)[_0x3970('0x25')](function(_0x564592){return _0x564592;});}return null;};}function removeEntity(_0x44f653,_0x1096e7){return function(_0x3a2b80){if(_0x3a2b80){return _0x3a2b80[_0x3970('0x26')]()[_0x3970('0x25')](function(){_0x44f653[_0x3970('0x19')](0xcc)[_0x3970('0x1a')]();});}};}function handleEntityNotFound(_0x3d7327,_0x49b128){return function(_0x5a660f){if(!_0x5a660f){_0x3d7327[_0x3970('0x18')](0x194);}return _0x5a660f;};}function handleError(_0x225667,_0x4efed8){_0x4efed8=_0x4efed8||0x1f4;return function(_0x2e9c5c){logger[_0x3970('0x27')](_0x2e9c5c[_0x3970('0x28')]);if(_0x2e9c5c[_0x3970('0x29')]){delete _0x2e9c5c[_0x3970('0x29')];}_0x225667[_0x3970('0x19')](_0x4efed8)['send'](_0x2e9c5c);};}exports['index']=function(_0x48adeb,_0x1bedee){var _0x1d4a76={},_0x494a37={},_0x198890={'count':0x0,'rows':[]};var _0x381150=_[_0x3970('0x2a')](db[_0x3970('0x2b')][_0x3970('0x2c')],function(_0x35dc69){return{'name':_0x35dc69[_0x3970('0x2d')],'type':_0x35dc69['type'][_0x3970('0x2e')]};});_0x494a37[_0x3970('0x2f')]=_[_0x3970('0x2a')](_0x381150,_0x3970('0x29'));_0x494a37[_0x3970('0x30')]=_[_0x3970('0x31')](_0x48adeb[_0x3970('0x30')]);_0x494a37[_0x3970('0x32')]=_['intersection'](_0x494a37['model'],_0x494a37[_0x3970('0x30')]);_0x1d4a76[_0x3970('0x33')]=_[_0x3970('0x34')](_0x494a37[_0x3970('0x2f')],qs['fields'](_0x48adeb[_0x3970('0x30')][_0x3970('0x35')]));_0x1d4a76[_0x3970('0x33')]=_0x1d4a76[_0x3970('0x33')][_0x3970('0x36')]?_0x1d4a76['attributes']:_0x494a37[_0x3970('0x2f')];if(!_0x48adeb[_0x3970('0x30')][_0x3970('0x37')](_0x3970('0x38'))){_0x1d4a76[_0x3970('0x1d')]=qs['limit'](_0x48adeb[_0x3970('0x30')]['limit']);_0x1d4a76[_0x3970('0x1c')]=qs[_0x3970('0x1c')](_0x48adeb['query'][_0x3970('0x1c')]);}_0x1d4a76[_0x3970('0x39')]=qs[_0x3970('0x3a')](_0x48adeb[_0x3970('0x30')]['sort']);_0x1d4a76[_0x3970('0x3b')]=qs[_0x3970('0x32')](_['pick'](_0x48adeb[_0x3970('0x30')],_0x494a37[_0x3970('0x32')]),_0x381150);if(_0x48adeb[_0x3970('0x30')][_0x3970('0x3c')]){_0x1d4a76['where']=_[_0x3970('0x3d')](_0x1d4a76['where'],{'$or':_['map'](_0x381150,function(_0x454257){if(_0x454257[_0x3970('0x3e')]!=='VIRTUAL'){var _0x4f209f={};_0x4f209f[_0x454257[_0x3970('0x29')]]={'$like':'%'+_0x48adeb[_0x3970('0x30')][_0x3970('0x3c')]+'%'};return _0x4f209f;}})});}_0x1d4a76=_[_0x3970('0x3d')]({},_0x1d4a76,_0x48adeb[_0x3970('0x3f')]);var _0x356395={'where':_0x1d4a76[_0x3970('0x3b')]};return db['SmsTransferReport'][_0x3970('0x1f')](_0x356395)[_0x3970('0x25')](function(_0x2eb72d){_0x198890[_0x3970('0x1f')]=_0x2eb72d;if(_0x48adeb[_0x3970('0x30')][_0x3970('0x40')]){_0x1d4a76[_0x3970('0x41')]=[{'all':!![]}];}return db[_0x3970('0x2b')][_0x3970('0x42')](_0x1d4a76);})[_0x3970('0x25')](function(_0x49e26f){_0x198890[_0x3970('0x43')]=_0x49e26f;return _0x198890;})[_0x3970('0x25')](respondWithFilteredResult(_0x1bedee,_0x1d4a76))[_0x3970('0x44')](handleError(_0x1bedee,null));};exports[_0x3970('0x45')]=function(_0x3bb7a7,_0x3eb54c){var _0x5af7f9={'raw':!![],'where':{'id':_0x3bb7a7['params']['id']}},_0x5c8c7b={};_0x5c8c7b[_0x3970('0x2f')]=_[_0x3970('0x31')](db[_0x3970('0x2b')]['rawAttributes']);_0x5c8c7b[_0x3970('0x30')]=_[_0x3970('0x31')](_0x3bb7a7[_0x3970('0x30')]);_0x5c8c7b[_0x3970('0x32')]=_[_0x3970('0x34')](_0x5c8c7b[_0x3970('0x2f')],_0x5c8c7b[_0x3970('0x30')]);_0x5af7f9[_0x3970('0x33')]=_[_0x3970('0x34')](_0x5c8c7b[_0x3970('0x2f')],qs[_0x3970('0x35')](_0x3bb7a7['query'][_0x3970('0x35')]));_0x5af7f9[_0x3970('0x33')]=_0x5af7f9[_0x3970('0x33')][_0x3970('0x36')]?_0x5af7f9[_0x3970('0x33')]:_0x5c8c7b[_0x3970('0x2f')];if(_0x3bb7a7[_0x3970('0x30')][_0x3970('0x40')]){_0x5af7f9[_0x3970('0x41')]=[{'all':!![]}];}_0x5af7f9=_[_0x3970('0x3d')]({},_0x5af7f9,_0x3bb7a7[_0x3970('0x3f')]);return db[_0x3970('0x2b')][_0x3970('0x46')](_0x5af7f9)[_0x3970('0x25')](handleEntityNotFound(_0x3eb54c,null))[_0x3970('0x25')](respondWithResult(_0x3eb54c,null))[_0x3970('0x44')](handleError(_0x3eb54c,null));};exports[_0x3970('0x47')]=function(_0x2dc459,_0x11b67c){return db['SmsTransferReport'][_0x3970('0x47')](_0x2dc459['body'],{})['then'](respondWithResult(_0x11b67c,0xc9))[_0x3970('0x44')](handleError(_0x11b67c,null));};exports[_0x3970('0x24')]=function(_0x9b90bc,_0x5aa254){if(_0x9b90bc[_0x3970('0x48')]['id']){delete _0x9b90bc['body']['id'];}return db[_0x3970('0x2b')][_0x3970('0x46')]({'where':{'id':_0x9b90bc[_0x3970('0x49')]['id']}})[_0x3970('0x25')](handleEntityNotFound(_0x5aa254,null))['then'](saveUpdates(_0x9b90bc[_0x3970('0x48')],null))['then'](respondWithResult(_0x5aa254,null))[_0x3970('0x44')](handleError(_0x5aa254,null));};exports[_0x3970('0x26')]=function(_0x2dfdde,_0x25f2a6){return db[_0x3970('0x2b')][_0x3970('0x46')]({'where':{'id':_0x2dfdde[_0x3970('0x49')]['id']}})[_0x3970('0x25')](handleEntityNotFound(_0x25f2a6,null))[_0x3970('0x25')](removeEntity(_0x25f2a6,null))['catch'](handleError(_0x25f2a6,null));};exports[_0x3970('0x4a')]=function(_0x3d2442,_0xd3c1dc){return db[_0x3970('0x2b')]['describe']()[_0x3970('0x25')](respondWithResult(_0xd3c1dc,null))[_0x3970('0x44')](handleError(_0xd3c1dc,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0855d55..8f851cb 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 _0x82a7=['define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x82a7,0x1c4));var _0x782a=function(_0x3adf17,_0x520913){_0x3adf17=_0x3adf17-0x0;var _0x580073=_0x82a7[_0x3adf17];return _0x580073;};'use strict';var _=require('lodash');var util=require(_0x782a('0x0'));var logger=require(_0x782a('0x1'))(_0x782a('0x2'));var moment=require(_0x782a('0x3'));var BPromise=require(_0x782a('0x4'));var rp=require(_0x782a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x782a('0x6'));var config=require(_0x782a('0x7'));var attributes=require(_0x782a('0x8'));module[_0x782a('0x9')]=function(_0x2fc0df,_0x2c5ea1){return _0x2fc0df[_0x782a('0xa')](_0x782a('0xb'),attributes,{'tableName':_0x782a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x782a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x498a=['exports','define','report_sms_transfer','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5b800e,_0x32e114){var _0x1ca4b7=function(_0x5c0aea){while(--_0x5c0aea){_0x5b800e['push'](_0x5b800e['shift']());}};_0x1ca4b7(++_0x32e114);}(_0x498a,0x1bc));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa498('0x0'));var util=require(_0xa498('0x1'));var logger=require('../../config/logger')(_0xa498('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa498('0x3'));var fs=require('fs');var path=require(_0xa498('0x4'));var rimraf=require(_0xa498('0x5'));var config=require(_0xa498('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xa498('0x7')]=function(_0x4a8acb,_0x7d2d8b){return _0x4a8acb[_0xa498('0x8')]('SmsTransferReport',attributes,{'tableName':_0xa498('0x9'),'paranoid':![],'indexes':[{'name':_0xa498('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 8543801..7a7357d 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 _0xeb5d=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xeb5d[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var moment=require(_0xdeb5('0x1'));var BPromise=require(_0xdeb5('0x2'));var rs=require(_0xdeb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdeb5('0x4'));var logger=require(_0xdeb5('0x5'))('rpc');var config=require(_0xdeb5('0x6'));var jayson=require(_0xdeb5('0x7'));var client=jayson[_0xdeb5('0x8')][_0xdeb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120329,_0x12484b,_0x328d6b){return new BPromise(function(_0x35c086,_0x2c8509){return client[_0xdeb5('0xa')](_0x120329,_0x328d6b)[_0xdeb5('0xb')](function(_0x2114ba){logger[_0xdeb5('0xc')](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));logger[_0xdeb5('0xf')](_0xdeb5('0x10'),_0x12484b,'request\x20sent',JSON[_0xdeb5('0x11')](_0x2114ba));if(_0x2114ba[_0xdeb5('0x12')]){if(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x13')]===0x1f4){logger[_0xdeb5('0x12')](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x2c8509(_0x2114ba['error'][_0xdeb5('0x14')]);}logger['error'](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x35c086(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);}else{logger['info'](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));_0x35c086(_0x2114ba['result'][_0xdeb5('0x14')]);}})[_0xdeb5('0x15')](function(_0x3521b2){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x12484b,_0x3521b2);_0x2c8509(_0x3521b2);});});} \ No newline at end of file +var _0x2dd3=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x28fbd6,_0x3ff48f){var _0x267f1b=function(_0x2da9b0){while(--_0x2da9b0){_0x28fbd6['push'](_0x28fbd6['shift']());}};_0x267f1b(++_0x3ff48f);}(_0x2dd3,0x6e));var _0x32dd=function(_0x5bf468,_0x512130){_0x5bf468=_0x5bf468-0x0;var _0x40b3bb=_0x2dd3[_0x5bf468];return _0x40b3bb;};'use strict';var _=require('lodash');var util=require(_0x32dd('0x0'));var moment=require(_0x32dd('0x1'));var BPromise=require(_0x32dd('0x2'));var rs=require(_0x32dd('0x3'));var fs=require('fs');var Redis=require(_0x32dd('0x4'));var db=require(_0x32dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x32dd('0x6'))(_0x32dd('0x7'));var config=require(_0x32dd('0x8'));var jayson=require(_0x32dd('0x9'));var client=jayson[_0x32dd('0xa')][_0x32dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f65d9,_0x26f2df,_0xbee4fe){return new BPromise(function(_0x174720,_0x4b1801){return client[_0x32dd('0xc')](_0x3f65d9,_0xbee4fe)['then'](function(_0x37b4c1){logger[_0x32dd('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x26f2df,_0x32dd('0xe'));logger[_0x32dd('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x26f2df,_0x32dd('0xe'),JSON[_0x32dd('0x10')](_0x37b4c1));if(_0x37b4c1[_0x32dd('0x11')]){if(_0x37b4c1[_0x32dd('0x11')]['code']===0x1f4){logger[_0x32dd('0x11')](_0x32dd('0x12'),_0x26f2df,_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);return _0x4b1801(_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);}logger[_0x32dd('0x11')](_0x32dd('0x12'),_0x26f2df,_0x37b4c1['error'][_0x32dd('0x13')]);return _0x174720(_0x37b4c1[_0x32dd('0x11')][_0x32dd('0x13')]);}else{logger[_0x32dd('0xd')](_0x32dd('0x12'),_0x26f2df,'request\x20sent');_0x174720(_0x37b4c1[_0x32dd('0x14')][_0x32dd('0x13')]);}})[_0x32dd('0x15')](function(_0x4edac4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x26f2df,_0x4edac4);_0x4b1801(_0x4edac4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index bddaee4..b3f4ed4 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 _0xc94e=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id/download','diskStorage','join','root','originalname','%s-%s%s','basename','extname','now','single','file','create','/:id','update','delete'];(function(_0x52bd82,_0x1d70a2){var _0x35135e=function(_0x27b907){while(--_0x27b907){_0x52bd82['push'](_0x52bd82['shift']());}};_0x35135e(++_0x1d70a2);}(_0xc94e,0x196));var _0xec94=function(_0x37fb9d,_0x3f92d6){_0x37fb9d=_0x37fb9d-0x0;var _0x13ed7f=_0xc94e[_0x37fb9d];return _0x13ed7f;};'use strict';var multer=require(_0xec94('0x0'));var util=require(_0xec94('0x1'));var path=require(_0xec94('0x2'));var timeout=require('connect-timeout');var express=require(_0xec94('0x3'));var router=express[_0xec94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xec94('0x5'));var interaction=require(_0xec94('0x6'));var config=require(_0xec94('0x7'));var controller=require(_0xec94('0x8'));router['get']('/',auth[_0xec94('0x9')](),controller['index']);router[_0xec94('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xec94('0xb'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xec94('0xc')]({'destination':function(_0xc5ecaf,_0x3231bc,_0x45c0e5){_0x45c0e5(null,path[_0xec94('0xd')](config[_0xec94('0xe')],'server/files/sounds/original/'));},'filename':function(_0x50febb,_0x21e34c,_0x364ec1){_0x21e34c[_0xec94('0xf')]=_0x21e34c[_0xec94('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x364ec1(null,util['format'](_0xec94('0x10'),path[_0xec94('0x11')](_0x21e34c[_0xec94('0xf')],path[_0xec94('0x12')](_0x21e34c[_0xec94('0xf')])),Date[_0xec94('0x13')](),path[_0xec94('0x12')](_0x21e34c[_0xec94('0xf')])));}})});router['post']('/',upload[_0xec94('0x14')](_0xec94('0x15')),controller[_0xec94('0x16')]);router['put'](_0xec94('0x17'),auth['isAuthenticated'](),controller[_0xec94('0x18')]);router[_0xec94('0x19')](_0xec94('0x17'),auth['isAuthenticated'](),controller[_0xec94('0x19')]);module[_0xec94('0x1a')]=router; \ No newline at end of file +var _0x90ed=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','diskStorage','join','root','server/files/sounds/original/'];(function(_0x42a5ac,_0x7a6823){var _0x404ae1=function(_0x412820){while(--_0x412820){_0x42a5ac['push'](_0x42a5ac['shift']());}};_0x404ae1(++_0x7a6823);}(_0x90ed,0x97));var _0xd90e=function(_0x3bc9aa,_0x13a0e1){_0x3bc9aa=_0x3bc9aa-0x0;var _0x475579=_0x90ed[_0x3bc9aa];return _0x475579;};'use strict';var multer=require(_0xd90e('0x0'));var util=require(_0xd90e('0x1'));var path=require(_0xd90e('0x2'));var timeout=require(_0xd90e('0x3'));var express=require(_0xd90e('0x4'));var router=express[_0xd90e('0x5')]();var fs_extra=require(_0xd90e('0x6'));var auth=require(_0xd90e('0x7'));var interaction=require(_0xd90e('0x8'));var config=require(_0xd90e('0x9'));var controller=require('./sound.controller');router[_0xd90e('0xa')]('/',auth[_0xd90e('0xb')](),controller[_0xd90e('0xc')]);router[_0xd90e('0xa')](_0xd90e('0xd'),auth[_0xd90e('0xb')](),controller['show']);router[_0xd90e('0xa')]('/:id/download',auth[_0xd90e('0xb')](),controller[_0xd90e('0xe')]);var upload=multer({'storage':multer[_0xd90e('0xf')]({'destination':function(_0x432abe,_0x103ba9,_0x558204){_0x558204(null,path[_0xd90e('0x10')](config[_0xd90e('0x11')],_0xd90e('0x12')));},'filename':function(_0x33190c,_0x940c78,_0x526fa4){_0x940c78[_0xd90e('0x13')]=_0x940c78[_0xd90e('0x13')][_0xd90e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x526fa4(null,util[_0xd90e('0x15')](_0xd90e('0x16'),path[_0xd90e('0x17')](_0x940c78[_0xd90e('0x13')],path[_0xd90e('0x18')](_0x940c78['originalname'])),Date[_0xd90e('0x19')](),path[_0xd90e('0x18')](_0x940c78[_0xd90e('0x13')])));}})});router[_0xd90e('0x1a')]('/',upload[_0xd90e('0x1b')](_0xd90e('0x1c')),controller[_0xd90e('0x1d')]);router[_0xd90e('0x1e')](_0xd90e('0xd'),auth['isAuthenticated'](),controller[_0xd90e('0x1f')]);router[_0xd90e('0x20')](_0xd90e('0xd'),auth[_0xd90e('0xb')](),controller[_0xd90e('0x20')]);module[_0xd90e('0x21')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index df1096f..64f5319 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 _0x9b51=['name','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x409830,_0x34b582){var _0xe04484=function(_0x1d573c){while(--_0x1d573c){_0x409830['push'](_0x409830['shift']());}};_0xe04484(++_0x34b582);}(_0x9b51,0x1d7));var _0x19b5=function(_0x1e486a,_0x10047e){_0x1e486a=_0x1e486a-0x0;var _0x22d8ca=_0x9b51[_0x1e486a];return _0x22d8ca;};'use strict';var Sequelize=require(_0x19b5('0x0'));module[_0x19b5('0x1')]={'name':{'type':Sequelize[_0x19b5('0x2')],'unique':_0x19b5('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x19b5('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x19b5('0x2')]},'original_format':{'type':Sequelize[_0x19b5('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x19b5('0x4')]},'original_bitRate':{'type':Sequelize[_0x19b5('0x5')]},'original_sampleRate':{'type':Sequelize[_0x19b5('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x19b5('0x5')]},'converted_channelCount':{'type':Sequelize[_0x19b5('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x19b5('0x4')]}}; \ No newline at end of file +var _0x346e=['BIGINT','INTEGER','FLOAT','exports','STRING','name'];(function(_0x284430,_0x48818e){var _0x527a0a=function(_0x35c609){while(--_0x35c609){_0x284430['push'](_0x284430['shift']());}};_0x527a0a(++_0x48818e);}(_0x346e,0x69));var _0xe346=function(_0xdc66e7,_0x13a216){_0xdc66e7=_0xdc66e7-0x0;var _0x1a46af=_0x346e[_0xdc66e7];return _0x1a46af;};'use strict';var Sequelize=require('sequelize');module[_0xe346('0x0')]={'name':{'type':Sequelize[_0xe346('0x1')],'unique':_0xe346('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe346('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xe346('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe346('0x3')]},'original_channelCount':{'type':Sequelize[_0xe346('0x4')]},'original_bitRate':{'type':Sequelize[_0xe346('0x3')]},'original_sampleRate':{'type':Sequelize[_0xe346('0x4')]},'converted_format':{'type':Sequelize[_0xe346('0x1')]},'converted_duration':{'type':Sequelize[_0xe346('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xe346('0x3')]},'converted_channelCount':{'type':Sequelize[_0xe346('0x4')]},'converted_bitRate':{'type':Sequelize[_0xe346('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 921a757..d547a3d 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 _0x327c=['undefined','count','set','Content-Range','apply','reject','then','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','where','pick','filter','merge','type','VIRTUAL','options','Sound','includeAll','include','catch','params','length','download','find','save_name','existsSync','join','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','start','update','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit'];(function(_0x506996,_0x375344){var _0xc74569=function(_0x1ac244){while(--_0x1ac244){_0x506996['push'](_0x506996['shift']());}};_0xc74569(++_0x375344);}(_0x327c,0x1d2));var _0xc327=function(_0x3dd457,_0x5a04b5){_0x3dd457=_0x3dd457-0x0;var _0x2b5698=_0x327c[_0x3dd457];return _0x2b5698;};'use strict';var emlformat=require(_0xc327('0x0'));var rimraf=require(_0xc327('0x1'));var zipdir=require(_0xc327('0x2'));var jsonpatch=require(_0xc327('0x3'));var rp=require(_0xc327('0x4'));var moment=require(_0xc327('0x5'));var BPromise=require(_0xc327('0x6'));var Mustache=require('mustache');var util=require(_0xc327('0x7'));var path=require(_0xc327('0x8'));var sox=require(_0xc327('0x9'));var csv=require(_0xc327('0xa'));var ejs=require(_0xc327('0xb'));var fs=require('fs');var fs_extra=require(_0xc327('0xc'));var _=require('lodash');var squel=require(_0xc327('0xd'));var crypto=require(_0xc327('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc327('0xf'));var toCsv=require(_0xc327('0xa'));var querystring=require(_0xc327('0x10'));var Papa=require(_0xc327('0x11'));var Redis=require(_0xc327('0x12'));var authService=require(_0xc327('0x13'));var qs=require(_0xc327('0x14'));var as=require(_0xc327('0x15'));var hardwareService=require(_0xc327('0x16'));var logger=require(_0xc327('0x17'))(_0xc327('0x18'));var utils=require(_0xc327('0x19'));var config=require(_0xc327('0x1a'));var licenseUtil=require(_0xc327('0x1b'));var db=require(_0xc327('0x1c'))['db'];function respondWithStatusCode(_0x40e6ad,_0xf3cfd9){_0xf3cfd9=_0xf3cfd9||0xcc;return function(_0x518113){if(_0x518113){return _0x40e6ad['sendStatus'](_0xf3cfd9);}return _0x40e6ad[_0xc327('0x1d')](_0xf3cfd9)[_0xc327('0x1e')]();};}function respondWithResult(_0x2a09b4,_0x73c284){_0x73c284=_0x73c284||0xc8;return function(_0x4b02bc){if(_0x4b02bc){return _0x2a09b4['status'](_0x73c284)[_0xc327('0x1f')](_0x4b02bc);}};}function respondWithFilteredResult(_0x633a9,_0xe778b5){return function(_0x58bd9f){if(_0x58bd9f){var _0x482e36=typeof _0xe778b5[_0xc327('0x20')]==='undefined'&&typeof _0xe778b5[_0xc327('0x21')]===_0xc327('0x22');var _0x29291d=_0x58bd9f[_0xc327('0x23')];var _0xf971ba=_0x482e36?0x0:_0xe778b5['offset'];var _0x3ee587=_0x482e36?_0x58bd9f[_0xc327('0x23')]:_0xe778b5[_0xc327('0x20')]+_0xe778b5[_0xc327('0x21')];var _0x171804;if(_0x3ee587>=_0x29291d){_0x3ee587=_0x29291d;_0x171804=0xc8;}else{_0x171804=0xce;}_0x633a9['status'](_0x171804);return _0x633a9[_0xc327('0x24')](_0xc327('0x25'),_0xf971ba+'-'+_0x3ee587+'/'+_0x29291d)[_0xc327('0x1f')](_0x58bd9f);}return null;};}function patchUpdates(_0xafb74e){return function(_0x5bbd81){try{jsonpatch[_0xc327('0x26')](_0x5bbd81,_0xafb74e,!![]);}catch(_0x3bc4ac){return BPromise[_0xc327('0x27')](_0x3bc4ac);}return _0x5bbd81['save']();};}function saveUpdates(_0x24fcc4,_0x113138){return function(_0x304e5c){if(_0x304e5c){return _0x304e5c['update'](_0x24fcc4)[_0xc327('0x28')](function(_0x1ed99a){return _0x1ed99a;});}return null;};}function removeEntity(_0x3652ea,_0xd3c6e9){return function(_0x218c67){if(_0x218c67){return _0x218c67['destroy']()[_0xc327('0x28')](function(){var _0x16ac0f=_0x218c67[_0xc327('0x29')]({'plain':!![]});var _0x249e6a=_0xc327('0x2a');return db[_0xc327('0x2b')]['destroy']({'where':{'type':_0x249e6a,'resourceId':_0x16ac0f['id']}})['then'](function(){return _0x218c67;});})[_0xc327('0x28')](function(){_0x3652ea[_0xc327('0x1d')](0xcc)[_0xc327('0x1e')]();});}};}function handleEntityNotFound(_0x5e5a5e,_0x42aa5b){return function(_0x223727){if(!_0x223727){_0x5e5a5e[_0xc327('0x2c')](0x194);}return _0x223727;};}function handleError(_0x5592fb,_0x1a9e00){_0x1a9e00=_0x1a9e00||0x1f4;return function(_0x15da0e){logger[_0xc327('0x2d')](_0x15da0e[_0xc327('0x2e')]);if(_0x15da0e[_0xc327('0x2f')]){delete _0x15da0e['name'];}_0x5592fb[_0xc327('0x1d')](_0x1a9e00)[_0xc327('0x30')](_0x15da0e);};}exports['index']=function(_0x362287,_0x2096e7){var _0x39c459={},_0x33885={},_0x2c5411={'count':0x0,'rows':[]};var _0x404960=_['map'](db['Sound'][_0xc327('0x31')],function(_0x756fbe){return{'name':_0x756fbe[_0xc327('0x32')],'type':_0x756fbe['type'][_0xc327('0x33')]};});_0x33885[_0xc327('0x34')]=_[_0xc327('0x35')](_0x404960,_0xc327('0x2f'));_0x33885[_0xc327('0x36')]=_[_0xc327('0x37')](_0x362287['query']);_0x33885[_0xc327('0x38')]=_[_0xc327('0x39')](_0x33885[_0xc327('0x34')],_0x33885[_0xc327('0x36')]);_0x39c459[_0xc327('0x3a')]=_['intersection'](_0x33885[_0xc327('0x34')],qs[_0xc327('0x3b')](_0x362287[_0xc327('0x36')][_0xc327('0x3b')]));_0x39c459[_0xc327('0x3a')]=_0x39c459[_0xc327('0x3a')]['length']?_0x39c459[_0xc327('0x3a')]:_0x33885[_0xc327('0x34')];if(!_0x362287[_0xc327('0x36')]['hasOwnProperty'](_0xc327('0x3c'))){_0x39c459[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x362287['query']['limit']);_0x39c459[_0xc327('0x20')]=qs[_0xc327('0x20')](_0x362287[_0xc327('0x36')][_0xc327('0x20')]);}_0x39c459['order']=qs['sort'](_0x362287[_0xc327('0x36')]['sort']);_0x39c459[_0xc327('0x3d')]=qs[_0xc327('0x38')](_[_0xc327('0x3e')](_0x362287[_0xc327('0x36')],_0x33885[_0xc327('0x38')]),_0x404960);if(_0x362287[_0xc327('0x36')][_0xc327('0x3f')]){_0x39c459[_0xc327('0x3d')]=_[_0xc327('0x40')](_0x39c459[_0xc327('0x3d')],{'$or':_[_0xc327('0x35')](_0x404960,function(_0xca7d98){if(_0xca7d98[_0xc327('0x41')]!==_0xc327('0x42')){var _0x464b78={};_0x464b78[_0xca7d98[_0xc327('0x2f')]]={'$like':'%'+_0x362287[_0xc327('0x36')][_0xc327('0x3f')]+'%'};return _0x464b78;}})});}_0x39c459=_['merge']({},_0x39c459,_0x362287[_0xc327('0x43')]);var _0x4c2332={'where':_0x39c459['where']};return db[_0xc327('0x44')][_0xc327('0x23')](_0x4c2332)[_0xc327('0x28')](function(_0x457e56){_0x2c5411[_0xc327('0x23')]=_0x457e56;if(_0x362287[_0xc327('0x36')][_0xc327('0x45')]){_0x39c459[_0xc327('0x46')]=[{'all':!![]}];}return db[_0xc327('0x44')]['findAll'](_0x39c459);})[_0xc327('0x28')](function(_0x452c49){_0x2c5411['rows']=_0x452c49;return _0x2c5411;})[_0xc327('0x28')](respondWithFilteredResult(_0x2096e7,_0x39c459))[_0xc327('0x47')](handleError(_0x2096e7,null));};exports['show']=function(_0x5e2b05,_0x2af6bd){var _0x36c2cd={'raw':!![],'where':{'id':_0x5e2b05[_0xc327('0x48')]['id']}},_0x1ef030={};_0x1ef030[_0xc327('0x34')]=_[_0xc327('0x37')](db[_0xc327('0x44')][_0xc327('0x31')]);_0x1ef030['query']=_['keys'](_0x5e2b05['query']);_0x1ef030[_0xc327('0x38')]=_['intersection'](_0x1ef030[_0xc327('0x34')],_0x1ef030['query']);_0x36c2cd[_0xc327('0x3a')]=_[_0xc327('0x39')](_0x1ef030[_0xc327('0x34')],qs[_0xc327('0x3b')](_0x5e2b05['query']['fields']));_0x36c2cd[_0xc327('0x3a')]=_0x36c2cd['attributes'][_0xc327('0x49')]?_0x36c2cd['attributes']:_0x1ef030['model'];if(_0x5e2b05[_0xc327('0x36')]['includeAll']){_0x36c2cd[_0xc327('0x46')]=[{'all':!![]}];}_0x36c2cd=_[_0xc327('0x40')]({},_0x36c2cd,_0x5e2b05['options']);return db[_0xc327('0x44')]['find'](_0x36c2cd)[_0xc327('0x28')](handleEntityNotFound(_0x2af6bd,null))[_0xc327('0x28')](respondWithResult(_0x2af6bd,null))['catch'](handleError(_0x2af6bd,null));};exports[_0xc327('0x4a')]=function(_0x225172,_0x897fa4,_0x370de5){return db['Sound'][_0xc327('0x4b')]({'where':{'id':_0x225172['params']['id']},'attributes':[_0xc327('0x2f'),_0xc327('0x4c'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x897fa4,null))['then'](function(_0x3cfa11){if(_0x3cfa11){if(!fs[_0xc327('0x4d')](path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',_0x3cfa11[_0xc327('0x4c')]+'.'+_0x3cfa11[_0xc327('0x50')]))){throw new db[(_0xc327('0x51'))][(_0xc327('0x52'))](_0xc327('0x53'));}return _0x897fa4['download'](path[_0xc327('0x4e')](config['root'],_0xc327('0x54'),util[_0xc327('0x55')]('%s.%s',_0x3cfa11[_0xc327('0x4c')],_0x3cfa11[_0xc327('0x50')])),util[_0xc327('0x55')](_0xc327('0x56'),_0x3cfa11[_0xc327('0x2f')],_0x3cfa11[_0xc327('0x50')]));}return null;})[_0xc327('0x47')](handleError(_0x897fa4,null));};exports[_0xc327('0x57')]=function(_0x254264,_0x36e950,_0x1e341e){var _0xe2ae0a={'name':path[_0xc327('0x58')](_0x254264[_0xc327('0x59')][_0xc327('0x5a')],path[_0xc327('0x5b')](_0x254264['file'][_0xc327('0x5a')])),'save_name':path[_0xc327('0x58')](_0x254264['file'][_0xc327('0x5c')],path[_0xc327('0x5b')](_0x254264[_0xc327('0x59')][_0xc327('0x5c')])),'original_format':path[_0xc327('0x5b')](_0x254264['file'][_0xc327('0x5a')])['substring'](0x1),'converted_format':'wav'};var _0x469e2a=path[_0xc327('0x4e')](config[_0xc327('0x4f')],_0xc327('0x5d'),_0x254264[_0xc327('0x59')][_0xc327('0x5c')]);var _0x1c5b19=path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',util[_0xc327('0x55')](_0xc327('0x56'),path[_0xc327('0x58')](_0x254264[_0xc327('0x59')][_0xc327('0x5c')],path[_0xc327('0x5b')](_0x254264['file']['filename'])),_0xe2ae0a[_0xc327('0x50')]));logger[_0xc327('0x5e')](_0xc327('0x5f'),_0x469e2a);logger['info'](_0xc327('0x60'),_0x1c5b19);try{fs[_0xc327('0x61')](_0x469e2a,parseInt(_0xc327('0x62'),0x8));var _0x5e00eb=sox[_0xc327('0x63')](_0x469e2a,_0x1c5b19,{'sampleRate':0x1f40,'format':_0xc327('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5e00eb['on'](_0xc327('0x2d'),function(_0x35fc58){fs[_0xc327('0x65')](_0x469e2a);_0x36e950[_0xc327('0x1d')](0x1f4)[_0xc327('0x30')](_0x35fc58);});_0x5e00eb['on'](_0xc327('0x66'),function(_0x210f1d){_0xe2ae0a[_0xc327('0x67')]=isNaN(_0x210f1d['duration'])?null:_0x210f1d[_0xc327('0x68')]*0x3e8;_0xe2ae0a[_0xc327('0x69')]=isNaN(_0x210f1d[_0xc327('0x6a')])?null:_0x210f1d[_0xc327('0x6a')];_0xe2ae0a['original_channelCount']=isNaN(_0x210f1d[_0xc327('0x6b')])?null:_0x210f1d[_0xc327('0x6b')];_0xe2ae0a[_0xc327('0x6c')]=isNaN(_0x210f1d[_0xc327('0x6d')])?null:_0x210f1d[_0xc327('0x6d')];_0xe2ae0a['original_sampleRate']=isNaN(_0x210f1d[_0xc327('0x6e')])?null:_0x210f1d[_0xc327('0x6e')];});_0x5e00eb['on']('dest',function(_0x45c623){_0xe2ae0a['converted_duration']=isNaN(_0x45c623[_0xc327('0x68')])?null:_0x45c623['duration']*0x3e8;_0xe2ae0a[_0xc327('0x6f')]=isNaN(_0x45c623[_0xc327('0x6a')])?null:_0x45c623[_0xc327('0x6a')];_0xe2ae0a[_0xc327('0x70')]=isNaN(_0x45c623['channelCount'])?null:_0x45c623[_0xc327('0x6b')];_0xe2ae0a['converted_bitRate']=isNaN(_0x45c623['bitRate'])?null:_0x45c623[_0xc327('0x6d')];_0xe2ae0a[_0xc327('0x71')]=isNaN(_0x45c623['sampleRate'])?null:_0x45c623[_0xc327('0x6e')];});_0x5e00eb['on']('end',function(){fs['chmodSync'](_0x1c5b19,parseInt('0777',0x8));return db['Sound'][_0xc327('0x57')](_0xe2ae0a)[_0xc327('0x28')](function(_0x14b288){var _0x2a93c8={'role':_0x254264[_0xc327('0x72')][_0xc327('0x73')],'userProfileId':_0x254264['body'][_0xc327('0x74')]};if(!_0x2a93c8)throw new Error(_0xc327('0x75'));if(_0x2a93c8[_0xc327('0x73')]===_0xc327('0x76')){var _0x107c8d=_0x14b288['get']({'plain':!![]});return db[_0xc327('0x77')][_0xc327('0x4b')]({'where':{'name':_0xc327('0x2a'),'userProfileId':_0x2a93c8[_0xc327('0x74')]},'raw':!![]})[_0xc327('0x28')](function(_0x29f69f){if(_0x29f69f&&_0x29f69f['autoAssociation']===0x0){return db['UserProfileResource'][_0xc327('0x57')]({'name':_0x107c8d[_0xc327('0x2f')],'resourceId':_0x107c8d['id'],'type':_0x29f69f[_0xc327('0x2f')],'sectionId':_0x29f69f['id']},{})['then'](function(){return _0x14b288;});}else{return _0x14b288;}})[_0xc327('0x47')](function(_0x3c01b6){logger[_0xc327('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c01b6);throw _0x3c01b6;});}return _0x14b288;})[_0xc327('0x28')](respondWithResult(_0x36e950,null))[_0xc327('0x47')](handleError(_0x36e950,null));});_0x5e00eb[_0xc327('0x78')]();}catch(_0x5e7726){_0x36e950['status'](0x1f4)[_0xc327('0x30')](_0x5e7726);}};exports[_0xc327('0x79')]=function(_0xf6a52c,_0x5e359a,_0x1a3f9b){return db[_0xc327('0x44')][_0xc327('0x4b')]({'where':{'id':_0xf6a52c[_0xc327('0x48')]['id']}})[_0xc327('0x28')](handleEntityNotFound(_0x5e359a,null))['then'](saveUpdates(_[_0xc327('0x3e')](_0xf6a52c[_0xc327('0x72')],[_0xc327('0x2f'),_0xc327('0x7a')]),null))[_0xc327('0x28')](respondWithResult(_0x5e359a,null))[_0xc327('0x47')](handleError(_0x5e359a,null));};exports[_0xc327('0x7b')]=function(_0x6d451a,_0x11f167,_0x37c0a7){return db[_0xc327('0x44')][_0xc327('0x4b')]({'where':{'id':_0x6d451a[_0xc327('0x48')]['id']}})['then'](function(_0x407d9c){if(_0x407d9c){return _0x407d9c['destroy']();}})[_0xc327('0x28')](function(_0x14439f){var _0x2de41a=path[_0xc327('0x4e')](config[_0xc327('0x4f')],_0xc327('0x5d'),util[_0xc327('0x55')](_0xc327('0x56'),_0x14439f['save_name'],_0x14439f[_0xc327('0x7c')]));var _0x58aa05=path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',util[_0xc327('0x55')](_0xc327('0x56'),_0x14439f[_0xc327('0x4c')],_0x14439f[_0xc327('0x50')]));fs['unlinkSync'](_0x2de41a);fs['unlinkSync'](_0x58aa05);return _0x14439f;})['then'](function(_0x3ffe08){if(_0x3ffe08){return _0x11f167[_0xc327('0x1d')](0xcc)[_0xc327('0x1e')]();}})[_0xc327('0x28')](handleEntityNotFound(_0x11f167,null))[_0xc327('0x47')](handleError(_0x11f167,null));}; \ No newline at end of file +var _0x00e2=['../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','save','update','then','get','Sounds','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Sound','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','catch','download','save_name','existsSync','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','join','root','format','%s.%s','converted_format','create','file','originalname','basename','filename','extname','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','end','chmodSync','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x30c662,_0xb48b52){var _0x2428a2=function(_0x48404e){while(--_0x48404e){_0x30c662['push'](_0x30c662['shift']());}};_0x2428a2(++_0xb48b52);}(_0x00e2,0x69));var _0x200e=function(_0x26b9cb,_0x12bc4c){_0x26b9cb=_0x26b9cb-0x0;var _0x3f44e6=_0x00e2[_0x26b9cb];return _0x3f44e6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x200e('0x0'));var rp=require(_0x200e('0x1'));var moment=require('moment');var BPromise=require(_0x200e('0x2'));var Mustache=require(_0x200e('0x3'));var util=require('util');var path=require('path');var sox=require(_0x200e('0x4'));var csv=require(_0x200e('0x5'));var ejs=require(_0x200e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x200e('0x7'));var squel=require(_0x200e('0x8'));var crypto=require(_0x200e('0x9'));var jsforce=require(_0x200e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x200e('0x5'));var querystring=require(_0x200e('0xb'));var Papa=require('papaparse');var Redis=require(_0x200e('0xc'));var authService=require(_0x200e('0xd'));var qs=require(_0x200e('0xe'));var as=require(_0x200e('0xf'));var hardwareService=require(_0x200e('0x10'));var logger=require(_0x200e('0x11'))('api');var utils=require(_0x200e('0x12'));var config=require(_0x200e('0x13'));var licenseUtil=require(_0x200e('0x14'));var db=require(_0x200e('0x15'))['db'];function respondWithStatusCode(_0x77fe5c,_0x1bc8c2){_0x1bc8c2=_0x1bc8c2||0xcc;return function(_0x470440){if(_0x470440){return _0x77fe5c['sendStatus'](_0x1bc8c2);}return _0x77fe5c[_0x200e('0x16')](_0x1bc8c2)['end']();};}function respondWithResult(_0x12c205,_0x10a805){_0x10a805=_0x10a805||0xc8;return function(_0x11b284){if(_0x11b284){return _0x12c205[_0x200e('0x16')](_0x10a805)['json'](_0x11b284);}};}function respondWithFilteredResult(_0x726b66,_0x496e3e){return function(_0x9afbc4){if(_0x9afbc4){var _0x354e6a=typeof _0x496e3e[_0x200e('0x17')]===_0x200e('0x18')&&typeof _0x496e3e[_0x200e('0x19')]===_0x200e('0x18');var _0x5cf5f4=_0x9afbc4['count'];var _0x1af069=_0x354e6a?0x0:_0x496e3e[_0x200e('0x17')];var _0x346045=_0x354e6a?_0x9afbc4[_0x200e('0x1a')]:_0x496e3e[_0x200e('0x17')]+_0x496e3e['limit'];var _0x236f61;if(_0x346045>=_0x5cf5f4){_0x346045=_0x5cf5f4;_0x236f61=0xc8;}else{_0x236f61=0xce;}_0x726b66[_0x200e('0x16')](_0x236f61);return _0x726b66[_0x200e('0x1b')]('Content-Range',_0x1af069+'-'+_0x346045+'/'+_0x5cf5f4)[_0x200e('0x1c')](_0x9afbc4);}return null;};}function patchUpdates(_0x24a274){return function(_0x479359){try{jsonpatch['apply'](_0x479359,_0x24a274,!![]);}catch(_0x1d77fb){return BPromise['reject'](_0x1d77fb);}return _0x479359[_0x200e('0x1d')]();};}function saveUpdates(_0x497cd3,_0x3e605f){return function(_0xa930a4){if(_0xa930a4){return _0xa930a4[_0x200e('0x1e')](_0x497cd3)[_0x200e('0x1f')](function(_0x31d8de){return _0x31d8de;});}return null;};}function removeEntity(_0x345729,_0x1c1c63){return function(_0x6a3df0){if(_0x6a3df0){return _0x6a3df0['destroy']()['then'](function(){var _0x5d99ea=_0x6a3df0[_0x200e('0x20')]({'plain':!![]});var _0x4796c1=_0x200e('0x21');return db[_0x200e('0x22')][_0x200e('0x23')]({'where':{'type':_0x4796c1,'resourceId':_0x5d99ea['id']}})[_0x200e('0x1f')](function(){return _0x6a3df0;});})[_0x200e('0x1f')](function(){_0x345729[_0x200e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x278faf,_0x5f195a){return function(_0x277231){if(!_0x277231){_0x278faf[_0x200e('0x24')](0x194);}return _0x277231;};}function handleError(_0xc2303f,_0x2b12f1){_0x2b12f1=_0x2b12f1||0x1f4;return function(_0xb339a6){logger[_0x200e('0x25')](_0xb339a6[_0x200e('0x26')]);if(_0xb339a6[_0x200e('0x27')]){delete _0xb339a6[_0x200e('0x27')];}_0xc2303f[_0x200e('0x16')](_0x2b12f1)[_0x200e('0x28')](_0xb339a6);};}exports[_0x200e('0x29')]=function(_0x4a097d,_0x1e5bbc){var _0x193bc9={},_0x1c1460={},_0x34fc55={'count':0x0,'rows':[]};var _0x43c0db=_['map'](db['Sound']['rawAttributes'],function(_0x1fe479){return{'name':_0x1fe479[_0x200e('0x2a')],'type':_0x1fe479[_0x200e('0x2b')][_0x200e('0x2c')]};});_0x1c1460[_0x200e('0x2d')]=_[_0x200e('0x2e')](_0x43c0db,'name');_0x1c1460[_0x200e('0x2f')]=_[_0x200e('0x30')](_0x4a097d[_0x200e('0x2f')]);_0x1c1460[_0x200e('0x31')]=_[_0x200e('0x32')](_0x1c1460['model'],_0x1c1460['query']);_0x193bc9[_0x200e('0x33')]=_[_0x200e('0x32')](_0x1c1460[_0x200e('0x2d')],qs[_0x200e('0x34')](_0x4a097d[_0x200e('0x2f')][_0x200e('0x34')]));_0x193bc9[_0x200e('0x33')]=_0x193bc9['attributes']['length']?_0x193bc9['attributes']:_0x1c1460[_0x200e('0x2d')];if(!_0x4a097d['query'][_0x200e('0x35')](_0x200e('0x36'))){_0x193bc9[_0x200e('0x19')]=qs[_0x200e('0x19')](_0x4a097d[_0x200e('0x2f')][_0x200e('0x19')]);_0x193bc9[_0x200e('0x17')]=qs[_0x200e('0x17')](_0x4a097d[_0x200e('0x2f')][_0x200e('0x17')]);}_0x193bc9[_0x200e('0x37')]=qs[_0x200e('0x38')](_0x4a097d[_0x200e('0x2f')]['sort']);_0x193bc9[_0x200e('0x39')]=qs[_0x200e('0x31')](_[_0x200e('0x3a')](_0x4a097d[_0x200e('0x2f')],_0x1c1460['filters']),_0x43c0db);if(_0x4a097d[_0x200e('0x2f')][_0x200e('0x3b')]){_0x193bc9[_0x200e('0x39')]=_[_0x200e('0x3c')](_0x193bc9['where'],{'$or':_['map'](_0x43c0db,function(_0x28c6e7){if(_0x28c6e7[_0x200e('0x2b')]!==_0x200e('0x3d')){var _0xcf6941={};_0xcf6941[_0x28c6e7['name']]={'$like':'%'+_0x4a097d[_0x200e('0x2f')][_0x200e('0x3b')]+'%'};return _0xcf6941;}})});}_0x193bc9=_[_0x200e('0x3c')]({},_0x193bc9,_0x4a097d[_0x200e('0x3e')]);var _0x14c261={'where':_0x193bc9[_0x200e('0x39')]};return db[_0x200e('0x3f')]['count'](_0x14c261)[_0x200e('0x1f')](function(_0x402026){_0x34fc55['count']=_0x402026;if(_0x4a097d['query'][_0x200e('0x40')]){_0x193bc9['include']=[{'all':!![]}];}return db[_0x200e('0x3f')][_0x200e('0x41')](_0x193bc9);})['then'](function(_0x127558){_0x34fc55[_0x200e('0x42')]=_0x127558;return _0x34fc55;})[_0x200e('0x1f')](respondWithFilteredResult(_0x1e5bbc,_0x193bc9))['catch'](handleError(_0x1e5bbc,null));};exports[_0x200e('0x43')]=function(_0x1a9ac3,_0x5dfb5d){var _0x1966d5={'raw':!![],'where':{'id':_0x1a9ac3[_0x200e('0x44')]['id']}},_0x19578a={};_0x19578a['model']=_[_0x200e('0x30')](db[_0x200e('0x3f')][_0x200e('0x45')]);_0x19578a['query']=_[_0x200e('0x30')](_0x1a9ac3[_0x200e('0x2f')]);_0x19578a[_0x200e('0x31')]=_[_0x200e('0x32')](_0x19578a[_0x200e('0x2d')],_0x19578a['query']);_0x1966d5[_0x200e('0x33')]=_[_0x200e('0x32')](_0x19578a[_0x200e('0x2d')],qs[_0x200e('0x34')](_0x1a9ac3[_0x200e('0x2f')]['fields']));_0x1966d5[_0x200e('0x33')]=_0x1966d5[_0x200e('0x33')][_0x200e('0x46')]?_0x1966d5[_0x200e('0x33')]:_0x19578a[_0x200e('0x2d')];if(_0x1a9ac3[_0x200e('0x2f')][_0x200e('0x40')]){_0x1966d5[_0x200e('0x47')]=[{'all':!![]}];}_0x1966d5=_['merge']({},_0x1966d5,_0x1a9ac3[_0x200e('0x3e')]);return db[_0x200e('0x3f')][_0x200e('0x48')](_0x1966d5)[_0x200e('0x1f')](handleEntityNotFound(_0x5dfb5d,null))[_0x200e('0x1f')](respondWithResult(_0x5dfb5d,null))[_0x200e('0x49')](handleError(_0x5dfb5d,null));};exports[_0x200e('0x4a')]=function(_0x14e82a,_0x45311a,_0x48b478){return db[_0x200e('0x3f')][_0x200e('0x48')]({'where':{'id':_0x14e82a[_0x200e('0x44')]['id']},'attributes':['name',_0x200e('0x4b'),'converted_format'],'raw':!![]})[_0x200e('0x1f')](handleEntityNotFound(_0x45311a,null))[_0x200e('0x1f')](function(_0x282683){if(_0x282683){if(!fs[_0x200e('0x4c')](path['join'](config['root'],_0x200e('0x4d'),_0x282683['save_name']+'.'+_0x282683['converted_format']))){throw new db[(_0x200e('0x4e'))]['ValidationError'](_0x200e('0x4f'));}return _0x45311a[_0x200e('0x4a')](path[_0x200e('0x50')](config[_0x200e('0x51')],_0x200e('0x4d'),util[_0x200e('0x52')](_0x200e('0x53'),_0x282683[_0x200e('0x4b')],_0x282683[_0x200e('0x54')])),util[_0x200e('0x52')](_0x200e('0x53'),_0x282683[_0x200e('0x27')],_0x282683['converted_format']));}return null;})[_0x200e('0x49')](handleError(_0x45311a,null));};exports[_0x200e('0x55')]=function(_0x1da667,_0x86534f,_0x44ddf3){var _0x5e95af={'name':path['basename'](_0x1da667['file']['originalname'],path['extname'](_0x1da667[_0x200e('0x56')][_0x200e('0x57')])),'save_name':path[_0x200e('0x58')](_0x1da667['file'][_0x200e('0x59')],path[_0x200e('0x5a')](_0x1da667[_0x200e('0x56')]['filename'])),'original_format':path[_0x200e('0x5a')](_0x1da667[_0x200e('0x56')]['originalname'])['substring'](0x1),'converted_format':'wav'};var _0x47a0e2=path['join'](config['root'],_0x200e('0x5b'),_0x1da667['file'][_0x200e('0x59')]);var _0x348947=path[_0x200e('0x50')](config['root'],_0x200e('0x4d'),util[_0x200e('0x52')](_0x200e('0x53'),path['basename'](_0x1da667[_0x200e('0x56')][_0x200e('0x59')],path[_0x200e('0x5a')](_0x1da667[_0x200e('0x56')][_0x200e('0x59')])),_0x5e95af[_0x200e('0x54')]));logger[_0x200e('0x5c')](_0x200e('0x5d'),_0x47a0e2);logger[_0x200e('0x5c')](_0x200e('0x5e'),_0x348947);try{fs['chmodSync'](_0x47a0e2,parseInt('0777',0x8));var _0x2c85ae=sox[_0x200e('0x5f')](_0x47a0e2,_0x348947,{'sampleRate':0x1f40,'format':_0x200e('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2c85ae['on'](_0x200e('0x25'),function(_0x572546){fs[_0x200e('0x61')](_0x47a0e2);_0x86534f[_0x200e('0x16')](0x1f4)['send'](_0x572546);});_0x2c85ae['on'](_0x200e('0x62'),function(_0x47479c){_0x5e95af[_0x200e('0x63')]=isNaN(_0x47479c[_0x200e('0x64')])?null:_0x47479c[_0x200e('0x64')]*0x3e8;_0x5e95af[_0x200e('0x65')]=isNaN(_0x47479c[_0x200e('0x66')])?null:_0x47479c[_0x200e('0x66')];_0x5e95af[_0x200e('0x67')]=isNaN(_0x47479c['channelCount'])?null:_0x47479c[_0x200e('0x68')];_0x5e95af[_0x200e('0x69')]=isNaN(_0x47479c[_0x200e('0x6a')])?null:_0x47479c[_0x200e('0x6a')];_0x5e95af['original_sampleRate']=isNaN(_0x47479c[_0x200e('0x6b')])?null:_0x47479c[_0x200e('0x6b')];});_0x2c85ae['on'](_0x200e('0x6c'),function(_0x37e5b7){_0x5e95af[_0x200e('0x6d')]=isNaN(_0x37e5b7[_0x200e('0x64')])?null:_0x37e5b7[_0x200e('0x64')]*0x3e8;_0x5e95af[_0x200e('0x6e')]=isNaN(_0x37e5b7[_0x200e('0x66')])?null:_0x37e5b7[_0x200e('0x66')];_0x5e95af[_0x200e('0x6f')]=isNaN(_0x37e5b7['channelCount'])?null:_0x37e5b7[_0x200e('0x68')];_0x5e95af[_0x200e('0x70')]=isNaN(_0x37e5b7[_0x200e('0x6a')])?null:_0x37e5b7[_0x200e('0x6a')];_0x5e95af[_0x200e('0x71')]=isNaN(_0x37e5b7[_0x200e('0x6b')])?null:_0x37e5b7['sampleRate'];});_0x2c85ae['on'](_0x200e('0x72'),function(){fs[_0x200e('0x73')](_0x348947,parseInt(_0x200e('0x74'),0x8));return db[_0x200e('0x3f')][_0x200e('0x55')](_0x5e95af)[_0x200e('0x1f')](function(_0x4142a2){var _0x525ae1={'role':_0x1da667['body']['role'],'userProfileId':_0x1da667[_0x200e('0x75')][_0x200e('0x76')]};if(!_0x525ae1)throw new Error(_0x200e('0x77'));if(_0x525ae1[_0x200e('0x78')]==='user'){var _0x56de0f=_0x4142a2[_0x200e('0x20')]({'plain':!![]});return db['UserProfileSection'][_0x200e('0x48')]({'where':{'name':'Sounds','userProfileId':_0x525ae1[_0x200e('0x76')]},'raw':!![]})['then'](function(_0x5c2c35){if(_0x5c2c35&&_0x5c2c35['autoAssociation']===0x0){return db[_0x200e('0x22')][_0x200e('0x55')]({'name':_0x56de0f[_0x200e('0x27')],'resourceId':_0x56de0f['id'],'type':_0x5c2c35[_0x200e('0x27')],'sectionId':_0x5c2c35['id']},{})[_0x200e('0x1f')](function(){return _0x4142a2;});}else{return _0x4142a2;}})[_0x200e('0x49')](function(_0x8b5838){logger[_0x200e('0x25')](_0x200e('0x79'),_0x8b5838);throw _0x8b5838;});}return _0x4142a2;})[_0x200e('0x1f')](respondWithResult(_0x86534f,null))[_0x200e('0x49')](handleError(_0x86534f,null));});_0x2c85ae[_0x200e('0x7a')]();}catch(_0x311e2f){_0x86534f[_0x200e('0x16')](0x1f4)[_0x200e('0x28')](_0x311e2f);}};exports[_0x200e('0x1e')]=function(_0x3759ac,_0x21ffd8,_0x1473f5){return db[_0x200e('0x3f')]['find']({'where':{'id':_0x3759ac['params']['id']}})[_0x200e('0x1f')](handleEntityNotFound(_0x21ffd8,null))[_0x200e('0x1f')](saveUpdates(_['pick'](_0x3759ac[_0x200e('0x75')],[_0x200e('0x27'),_0x200e('0x7b')]),null))[_0x200e('0x1f')](respondWithResult(_0x21ffd8,null))[_0x200e('0x49')](handleError(_0x21ffd8,null));};exports[_0x200e('0x7c')]=function(_0x349d3c,_0x225e13,_0x427000){return db['Sound'][_0x200e('0x48')]({'where':{'id':_0x349d3c['params']['id']}})['then'](function(_0x49bc35){if(_0x49bc35){return _0x49bc35['destroy']();}})[_0x200e('0x1f')](function(_0x2285b5){var _0x39e9d9=path[_0x200e('0x50')](config['root'],_0x200e('0x5b'),util[_0x200e('0x52')](_0x200e('0x53'),_0x2285b5[_0x200e('0x4b')],_0x2285b5['original_format']));var _0x2550a2=path[_0x200e('0x50')](config[_0x200e('0x51')],_0x200e('0x4d'),util[_0x200e('0x52')](_0x200e('0x53'),_0x2285b5['save_name'],_0x2285b5[_0x200e('0x54')]));fs['unlinkSync'](_0x39e9d9);fs['unlinkSync'](_0x2550a2);return _0x2285b5;})['then'](function(_0x838f6c){if(_0x838f6c){return _0x225e13[_0x200e('0x16')](0xcc)[_0x200e('0x72')]();}})[_0x200e('0x1f')](handleEntityNotFound(_0x225e13,null))[_0x200e('0x49')](handleError(_0x225e13,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index bf9dd9b..1684427 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 _0x3a15=['path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','request-promise'];(function(_0x539d8e,_0x4025d6){var _0x36ff10=function(_0x39e12d){while(--_0x39e12d){_0x539d8e['push'](_0x539d8e['shift']());}};_0x36ff10(++_0x4025d6);}(_0x3a15,0x1b7));var _0x53a1=function(_0x313cb5,_0x14e880){_0x313cb5=_0x313cb5-0x0;var _0x28dc82=_0x3a15[_0x313cb5];return _0x28dc82;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require('bluebird');var rp=require(_0x53a1('0x4'));var fs=require('fs');var path=require(_0x53a1('0x5'));var rimraf=require(_0x53a1('0x6'));var config=require('../../config/environment');var attributes=require(_0x53a1('0x7'));module[_0x53a1('0x8')]=function(_0x10ac1f,_0x49f1a4){return _0x10ac1f[_0x53a1('0x9')](_0x53a1('0xa'),attributes,{'tableName':_0x53a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca0a=['../../config/logger','moment','request-promise','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util'];(function(_0x338442,_0x1974d1){var _0x11179b=function(_0x5bd177){while(--_0x5bd177){_0x338442['push'](_0x338442['shift']());}};_0x11179b(++_0x1974d1);}(_0xca0a,0x77));var _0xaca0=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xca0a[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xaca0('0x0'));var util=require(_0xaca0('0x1'));var logger=require(_0xaca0('0x2'))('api');var moment=require(_0xaca0('0x3'));var BPromise=require('bluebird');var rp=require(_0xaca0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaca0('0x5'));var config=require('../../config/environment');var attributes=require(_0xaca0('0x6'));module[_0xaca0('0x7')]=function(_0x22c5f5,_0x130974){return _0x22c5f5[_0xaca0('0x8')](_0xaca0('0x9'),attributes,{'tableName':_0xaca0('0xa'),'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 33dfd0c..ee0e184 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 _0x5215=['map','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSound','find','options','raw','where','attributes','include'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5215,0x1c3));var _0x5521=function(_0x23c150,_0x15281b){_0x23c150=_0x23c150-0x0;var _0x3418af=_0x5215[_0x23c150];return _0x3418af;};'use strict';var _=require('lodash');var util=require(_0x5521('0x0'));var moment=require(_0x5521('0x1'));var BPromise=require(_0x5521('0x2'));var rs=require(_0x5521('0x3'));var fs=require('fs');var Redis=require(_0x5521('0x4'));var db=require(_0x5521('0x5'))['db'];var utils=require(_0x5521('0x6'));var logger=require(_0x5521('0x7'))(_0x5521('0x8'));var config=require(_0x5521('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5521('0xa')][_0x5521('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54adbc,_0x1b3e90,_0x118087){return new BPromise(function(_0x6cc84f,_0x346e4e){return client['request'](_0x54adbc,_0x118087)[_0x5521('0xc')](function(_0x3e0752){logger[_0x5521('0xd')](_0x5521('0xe'),_0x1b3e90,_0x5521('0xf'));logger[_0x5521('0x10')](_0x5521('0x11'),_0x1b3e90,'request\x20sent',JSON['stringify'](_0x3e0752));if(_0x3e0752[_0x5521('0x12')]){if(_0x3e0752['error'][_0x5521('0x13')]===0x1f4){logger[_0x5521('0x12')](_0x5521('0xe'),_0x1b3e90,_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);return _0x346e4e(_0x3e0752['error'][_0x5521('0x14')]);}logger[_0x5521('0x12')](_0x5521('0xe'),_0x1b3e90,_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);return _0x6cc84f(_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);}else{logger[_0x5521('0xd')](_0x5521('0xe'),_0x1b3e90,'request\x20sent');_0x6cc84f(_0x3e0752[_0x5521('0x15')][_0x5521('0x14')]);}})['catch'](function(_0x57e100){logger['error'](_0x5521('0xe'),_0x1b3e90,_0x57e100);_0x346e4e(_0x57e100);});});}exports[_0x5521('0x16')]=function(_0x2eb293){var _0x223fbb=this;return new Promise(function(_0x34bb1c,_0x41dce2){return db['Sound'][_0x5521('0x17')]({'raw':_0x2eb293['options']?_0x2eb293[_0x5521('0x18')][_0x5521('0x19')]===undefined?!![]:![]:!![],'where':_0x2eb293[_0x5521('0x18')]?_0x2eb293['options'][_0x5521('0x1a')]||null:null,'attributes':_0x2eb293[_0x5521('0x18')]?_0x2eb293['options'][_0x5521('0x1b')]||null:null,'include':_0x2eb293[_0x5521('0x18')]?_0x2eb293[_0x5521('0x18')][_0x5521('0x1c')]?_[_0x5521('0x1d')](_0x2eb293[_0x5521('0x18')][_0x5521('0x1c')],function(_0x2cada0){return{'model':db[_0x2cada0[_0x5521('0x1e')]],'as':_0x2cada0['as'],'attributes':_0x2cada0[_0x5521('0x1b')],'include':_0x2cada0[_0x5521('0x1c')]?_['map'](_0x2cada0[_0x5521('0x1c')],function(_0x2101ab){return{'model':db[_0x2101ab['model']],'as':_0x2101ab['as'],'attributes':_0x2101ab[_0x5521('0x1b')],'include':_0x2101ab[_0x5521('0x1c')]?_['map'](_0x2101ab['include'],function(_0x42e12c){return{'model':db[_0x42e12c[_0x5521('0x1e')]],'as':_0x42e12c['as'],'attributes':_0x42e12c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ecc75){logger[_0x5521('0xd')]('ShowSound',_0x2eb293);logger['debug'](_0x5521('0x16'),_0x2eb293,JSON['stringify'](_0x3ecc75));_0x34bb1c(_0x3ecc75);})[_0x5521('0x1f')](function(_0x546ca1){logger['error'](_0x5521('0x16'),_0x546ca1[_0x5521('0x14')],_0x2eb293);_0x41dce2(_0x223fbb[_0x5521('0x12')](0x1f4,_0x546ca1[_0x5521('0x14')]));});});}; \ No newline at end of file +var _0x09b8=['map','model','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','include'];(function(_0x178d6d,_0x393b86){var _0x1eef31=function(_0x1cf715){while(--_0x1cf715){_0x178d6d['push'](_0x178d6d['shift']());}};_0x1eef31(++_0x393b86);}(_0x09b8,0xa3));var _0x809b=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x09b8[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x809b('0x0'));var BPromise=require(_0x809b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x809b('0x2'));var db=require(_0x809b('0x3'))['db'];var utils=require(_0x809b('0x4'));var logger=require(_0x809b('0x5'))(_0x809b('0x6'));var config=require(_0x809b('0x7'));var jayson=require(_0x809b('0x8'));var client=jayson[_0x809b('0x9')][_0x809b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c916c,_0x1bbd91,_0x584199){return new BPromise(function(_0x2474a2,_0xfd4746){return client[_0x809b('0xb')](_0x4c916c,_0x584199)['then'](function(_0xc3eb49){logger[_0x809b('0xc')](_0x809b('0xd'),_0x1bbd91,_0x809b('0xe'));logger[_0x809b('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x1bbd91,'request\x20sent',JSON[_0x809b('0x10')](_0xc3eb49));if(_0xc3eb49['error']){if(_0xc3eb49[_0x809b('0x11')][_0x809b('0x12')]===0x1f4){logger[_0x809b('0x11')]('Sound,\x20%s,\x20%s',_0x1bbd91,_0xc3eb49[_0x809b('0x11')][_0x809b('0x13')]);return _0xfd4746(_0xc3eb49['error'][_0x809b('0x13')]);}logger['error']('Sound,\x20%s,\x20%s',_0x1bbd91,_0xc3eb49[_0x809b('0x11')][_0x809b('0x13')]);return _0x2474a2(_0xc3eb49[_0x809b('0x11')][_0x809b('0x13')]);}else{logger[_0x809b('0xc')](_0x809b('0xd'),_0x1bbd91,_0x809b('0xe'));_0x2474a2(_0xc3eb49[_0x809b('0x14')]['message']);}})[_0x809b('0x15')](function(_0x36e355){logger[_0x809b('0x11')]('Sound,\x20%s,\x20%s',_0x1bbd91,_0x36e355);_0xfd4746(_0x36e355);});});}exports[_0x809b('0x16')]=function(_0x25923a){var _0x24f779=this;return new Promise(function(_0x425f12,_0x32cc9f){return db[_0x809b('0x17')][_0x809b('0x18')]({'raw':_0x25923a[_0x809b('0x19')]?_0x25923a[_0x809b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x25923a[_0x809b('0x19')]?_0x25923a['options'][_0x809b('0x1a')]||null:null,'attributes':_0x25923a[_0x809b('0x19')]?_0x25923a[_0x809b('0x19')][_0x809b('0x1b')]||null:null,'include':_0x25923a['options']?_0x25923a[_0x809b('0x19')][_0x809b('0x1c')]?_[_0x809b('0x1d')](_0x25923a['options'][_0x809b('0x1c')],function(_0x2f00d6){return{'model':db[_0x2f00d6[_0x809b('0x1e')]],'as':_0x2f00d6['as'],'attributes':_0x2f00d6['attributes'],'include':_0x2f00d6['include']?_[_0x809b('0x1d')](_0x2f00d6[_0x809b('0x1c')],function(_0x214e04){return{'model':db[_0x214e04[_0x809b('0x1e')]],'as':_0x214e04['as'],'attributes':_0x214e04[_0x809b('0x1b')],'include':_0x214e04[_0x809b('0x1c')]?_[_0x809b('0x1d')](_0x214e04[_0x809b('0x1c')],function(_0x1c2206){return{'model':db[_0x1c2206[_0x809b('0x1e')]],'as':_0x1c2206['as'],'attributes':_0x1c2206['attributes']};}):[]};}):[]};}):[]:[]})[_0x809b('0x1f')](function(_0x4ed5f5){logger[_0x809b('0xc')](_0x809b('0x16'),_0x25923a);logger[_0x809b('0xf')]('ShowSound',_0x25923a,JSON['stringify'](_0x4ed5f5));_0x425f12(_0x4ed5f5);})[_0x809b('0x15')](function(_0x2e80bb){logger[_0x809b('0x11')](_0x809b('0x16'),_0x2e80bb['message'],_0x25923a);_0x32cc9f(_0x24f779[_0x809b('0x11')](0x1f4,_0x2e80bb[_0x809b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 5408266..c8a21f1 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x587a92,_0x50345c){var _0x35b0f2=function(_0x5a1357){while(--_0x5a1357){_0x587a92['push'](_0x587a92['shift']());}};_0x35b0f2(++_0x50345c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x301c77,_0x19c3d4){var _0x591a71=function(_0x54d436){while(--_0x54d436){_0x301c77['push'](_0x301c77['shift']());}};_0x591a71(++_0x19c3d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0xb10b[_0x53080e];return _0x1a0c14;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c69b8f6..0e3e29c 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 _0xa130=['TEXT','sequelize','exports','STRING','medium','out'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa130,0x169));var _0x0a13=function(_0x3d8b1b,_0x4bbd28){_0x3d8b1b=_0x3d8b1b-0x0;var _0x42d2c7=_0xa130[_0x3d8b1b];return _0x42d2c7;};'use strict';var Sequelize=require(_0x0a13('0x0'));module[_0x0a13('0x1')]={'uniqueid':{'type':Sequelize[_0x0a13('0x2')]},'body':{'type':Sequelize['TEXT'](_0x0a13('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0a13('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x0a13('0x2')]},'providerResponse':{'type':Sequelize[_0x0a13('0x5')]}}; \ No newline at end of file +var _0xaedc=['out','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaedc,0x70));var _0xcaed=function(_0x454162,_0x4ecb89){_0x454162=_0x454162-0x0;var _0x245bbc=_0xaedc[_0x454162];return _0x245bbc;};'use strict';var Sequelize=require('sequelize');module[_0xcaed('0x0')]={'uniqueid':{'type':Sequelize[_0xcaed('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcaed('0x2')),'defaultValue':_0xcaed('0x2'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ad7c053..1f6cb14 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 _0x316a=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','send','index','SquareMessage','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x1d1e1f,_0xdd44f6){var _0x51a9f7=function(_0x2873aa){while(--_0x2873aa){_0x1d1e1f['push'](_0x1d1e1f['shift']());}};_0x51a9f7(++_0xdd44f6);}(_0x316a,0xdb));var _0xa316=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x316a[_0x13c70c];return _0x50f0f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa316('0x0'));var zipdir=require(_0xa316('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa316('0x2'));var moment=require(_0xa316('0x3'));var BPromise=require(_0xa316('0x4'));var Mustache=require(_0xa316('0x5'));var util=require(_0xa316('0x6'));var path=require('path');var sox=require(_0xa316('0x7'));var csv=require(_0xa316('0x8'));var ejs=require(_0xa316('0x9'));var fs=require('fs');var fs_extra=require(_0xa316('0xa'));var _=require(_0xa316('0xb'));var squel=require(_0xa316('0xc'));var crypto=require(_0xa316('0xd'));var jsforce=require(_0xa316('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa316('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa316('0x10'));var qs=require(_0xa316('0x11'));var as=require(_0xa316('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa316('0x13'))(_0xa316('0x14'));var utils=require('../../config/utils');var config=require(_0xa316('0x15'));var licenseUtil=require(_0xa316('0x16'));var db=require(_0xa316('0x17'))['db'];function respondWithStatusCode(_0x5dfcd2,_0x3c7559){_0x3c7559=_0x3c7559||0xcc;return function(_0x49b105){if(_0x49b105){return _0x5dfcd2['sendStatus'](_0x3c7559);}return _0x5dfcd2[_0xa316('0x18')](_0x3c7559)[_0xa316('0x19')]();};}function respondWithResult(_0x54fd65,_0x5c5289){_0x5c5289=_0x5c5289||0xc8;return function(_0x1211c9){if(_0x1211c9){return _0x54fd65['status'](_0x5c5289)[_0xa316('0x1a')](_0x1211c9);}};}function respondWithFilteredResult(_0x473aa9,_0xc18bb3){return function(_0x3b8a4e){if(_0x3b8a4e){var _0x52833b=typeof _0xc18bb3[_0xa316('0x1b')]===_0xa316('0x1c')&&typeof _0xc18bb3[_0xa316('0x1d')]===_0xa316('0x1c');var _0xdeb0b7=_0x3b8a4e['count'];var _0x5cf7d6=_0x52833b?0x0:_0xc18bb3['offset'];var _0x33e508=_0x52833b?_0x3b8a4e['count']:_0xc18bb3['offset']+_0xc18bb3[_0xa316('0x1d')];var _0x48e57a;if(_0x33e508>=_0xdeb0b7){_0x33e508=_0xdeb0b7;_0x48e57a=0xc8;}else{_0x48e57a=0xce;}_0x473aa9[_0xa316('0x18')](_0x48e57a);return _0x473aa9[_0xa316('0x1e')]('Content-Range',_0x5cf7d6+'-'+_0x33e508+'/'+_0xdeb0b7)[_0xa316('0x1a')](_0x3b8a4e);}return null;};}function patchUpdates(_0x25b599){return function(_0x1d0668){try{jsonpatch[_0xa316('0x1f')](_0x1d0668,_0x25b599,!![]);}catch(_0x5787c9){return BPromise[_0xa316('0x20')](_0x5787c9);}return _0x1d0668[_0xa316('0x21')]();};}function saveUpdates(_0x140c3f,_0x493f56){return function(_0x23cbf9){if(_0x23cbf9){return _0x23cbf9[_0xa316('0x22')](_0x140c3f)[_0xa316('0x23')](function(_0x2550dc){return _0x2550dc;});}return null;};}function removeEntity(_0x4ccfa8,_0x36ed5a){return function(_0x5e405a){if(_0x5e405a){return _0x5e405a[_0xa316('0x24')]()[_0xa316('0x23')](function(){_0x4ccfa8[_0xa316('0x18')](0xcc)[_0xa316('0x19')]();});}};}function handleEntityNotFound(_0x423d2c,_0x874eb8){return function(_0x1e780c){if(!_0x1e780c){_0x423d2c['sendStatus'](0x194);}return _0x1e780c;};}function handleError(_0xaaff55,_0x27bee3){_0x27bee3=_0x27bee3||0x1f4;return function(_0x3c23c1){logger[_0xa316('0x25')](_0x3c23c1[_0xa316('0x26')]);if(_0x3c23c1['name']){delete _0x3c23c1['name'];}_0xaaff55[_0xa316('0x18')](_0x27bee3)[_0xa316('0x27')](_0x3c23c1);};}exports[_0xa316('0x28')]=function(_0x536361,_0x534d39){var _0x3d9581={},_0xc2151b={},_0x11ac7f={'count':0x0,'rows':[]};var _0x29cc7d=_['map'](db[_0xa316('0x29')][_0xa316('0x2a')],function(_0x19879b){return{'name':_0x19879b[_0xa316('0x2b')],'type':_0x19879b[_0xa316('0x2c')][_0xa316('0x2d')]};});_0xc2151b['model']=_[_0xa316('0x2e')](_0x29cc7d,_0xa316('0x2f'));_0xc2151b[_0xa316('0x30')]=_[_0xa316('0x31')](_0x536361[_0xa316('0x30')]);_0xc2151b[_0xa316('0x32')]=_[_0xa316('0x33')](_0xc2151b[_0xa316('0x34')],_0xc2151b[_0xa316('0x30')]);_0x3d9581[_0xa316('0x35')]=_[_0xa316('0x33')](_0xc2151b[_0xa316('0x34')],qs['fields'](_0x536361['query'][_0xa316('0x36')]));_0x3d9581[_0xa316('0x35')]=_0x3d9581[_0xa316('0x35')][_0xa316('0x37')]?_0x3d9581[_0xa316('0x35')]:_0xc2151b[_0xa316('0x34')];if(!_0x536361[_0xa316('0x30')][_0xa316('0x38')](_0xa316('0x39'))){_0x3d9581[_0xa316('0x1d')]=qs['limit'](_0x536361['query'][_0xa316('0x1d')]);_0x3d9581['offset']=qs[_0xa316('0x1b')](_0x536361[_0xa316('0x30')][_0xa316('0x1b')]);}_0x3d9581[_0xa316('0x3a')]=qs[_0xa316('0x3b')](_0x536361[_0xa316('0x30')][_0xa316('0x3b')]);_0x3d9581[_0xa316('0x3c')]=qs[_0xa316('0x32')](_[_0xa316('0x3d')](_0x536361['query'],_0xc2151b[_0xa316('0x32')]),_0x29cc7d);if(_0x536361[_0xa316('0x30')][_0xa316('0x3e')]){_0x3d9581['where']=_[_0xa316('0x3f')](_0x3d9581[_0xa316('0x3c')],{'$or':_['map'](_0x29cc7d,function(_0xbd6976){if(_0xbd6976[_0xa316('0x2c')]!=='VIRTUAL'){var _0x287499={};_0x287499[_0xbd6976['name']]={'$like':'%'+_0x536361[_0xa316('0x30')][_0xa316('0x3e')]+'%'};return _0x287499;}})});}_0x3d9581=_['merge']({},_0x3d9581,_0x536361[_0xa316('0x40')]);var _0x5726fc={'where':_0x3d9581[_0xa316('0x3c')]};return db['SquareMessage'][_0xa316('0x41')](_0x5726fc)[_0xa316('0x23')](function(_0x1f77b1){_0x11ac7f['count']=_0x1f77b1;if(_0x536361[_0xa316('0x30')][_0xa316('0x42')]){_0x3d9581['include']=[{'all':!![]}];}return db['SquareMessage'][_0xa316('0x43')](_0x3d9581);})[_0xa316('0x23')](function(_0x4ca28c){_0x11ac7f[_0xa316('0x44')]=_0x4ca28c;return _0x11ac7f;})['then'](respondWithFilteredResult(_0x534d39,_0x3d9581))[_0xa316('0x45')](handleError(_0x534d39,null));};exports[_0xa316('0x46')]=function(_0x546402,_0x312252){var _0x3441d8={'raw':!![],'where':{'id':_0x546402['params']['id']}},_0x34951e={};_0x34951e[_0xa316('0x34')]=_['keys'](db[_0xa316('0x29')][_0xa316('0x2a')]);_0x34951e[_0xa316('0x30')]=_[_0xa316('0x31')](_0x546402[_0xa316('0x30')]);_0x34951e[_0xa316('0x32')]=_[_0xa316('0x33')](_0x34951e[_0xa316('0x34')],_0x34951e[_0xa316('0x30')]);_0x3441d8[_0xa316('0x35')]=_[_0xa316('0x33')](_0x34951e[_0xa316('0x34')],qs['fields'](_0x546402[_0xa316('0x30')][_0xa316('0x36')]));_0x3441d8['attributes']=_0x3441d8[_0xa316('0x35')][_0xa316('0x37')]?_0x3441d8['attributes']:_0x34951e[_0xa316('0x34')];if(_0x546402[_0xa316('0x30')][_0xa316('0x42')]){_0x3441d8[_0xa316('0x47')]=[{'all':!![]}];}_0x3441d8=_['merge']({},_0x3441d8,_0x546402['options']);return db['SquareMessage'][_0xa316('0x48')](_0x3441d8)[_0xa316('0x23')](handleEntityNotFound(_0x312252,null))[_0xa316('0x23')](respondWithResult(_0x312252,null))[_0xa316('0x45')](handleError(_0x312252,null));};exports[_0xa316('0x49')]=function(_0x4bde40,_0x4f9b88){return db['SquareMessage']['create'](_0x4bde40[_0xa316('0x4a')],{})[_0xa316('0x23')](respondWithResult(_0x4f9b88,0xc9))[_0xa316('0x45')](handleError(_0x4f9b88,null));};exports[_0xa316('0x22')]=function(_0x51e870,_0x17f46c){if(_0x51e870[_0xa316('0x4a')]['id']){delete _0x51e870[_0xa316('0x4a')]['id'];}return db['SquareMessage'][_0xa316('0x48')]({'where':{'id':_0x51e870['params']['id']}})[_0xa316('0x23')](handleEntityNotFound(_0x17f46c,null))[_0xa316('0x23')](saveUpdates(_0x51e870['body'],null))['then'](respondWithResult(_0x17f46c,null))[_0xa316('0x45')](handleError(_0x17f46c,null));};exports[_0xa316('0x24')]=function(_0x426b9b,_0x1ed5f3){return db[_0xa316('0x29')]['find']({'where':{'id':_0x426b9b['params']['id']}})[_0xa316('0x23')](handleEntityNotFound(_0x1ed5f3,null))[_0xa316('0x23')](removeEntity(_0x1ed5f3,null))['catch'](handleError(_0x1ed5f3,null));}; \ No newline at end of file +var _0xe02a=['findAll','rows','catch','show','options','find','create','body','params','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe02a,0xa3));var _0xae02=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe02a[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xae02('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae02('0x1'));var BPromise=require(_0xae02('0x2'));var Mustache=require(_0xae02('0x3'));var util=require(_0xae02('0x4'));var path=require(_0xae02('0x5'));var sox=require(_0xae02('0x6'));var csv=require(_0xae02('0x7'));var ejs=require(_0xae02('0x8'));var fs=require('fs');var fs_extra=require(_0xae02('0x9'));var _=require(_0xae02('0xa'));var squel=require(_0xae02('0xb'));var crypto=require(_0xae02('0xc'));var jsforce=require(_0xae02('0xd'));var deskjs=require(_0xae02('0xe'));var toCsv=require(_0xae02('0x7'));var querystring=require(_0xae02('0xf'));var Papa=require(_0xae02('0x10'));var Redis=require(_0xae02('0x11'));var authService=require(_0xae02('0x12'));var qs=require(_0xae02('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae02('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xae02('0x15'));var config=require(_0xae02('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xae02('0x17'))['db'];function respondWithStatusCode(_0x94990c,_0xbb3cea){_0xbb3cea=_0xbb3cea||0xcc;return function(_0x5b6618){if(_0x5b6618){return _0x94990c[_0xae02('0x18')](_0xbb3cea);}return _0x94990c['status'](_0xbb3cea)[_0xae02('0x19')]();};}function respondWithResult(_0x277588,_0xecd25b){_0xecd25b=_0xecd25b||0xc8;return function(_0x526928){if(_0x526928){return _0x277588[_0xae02('0x1a')](_0xecd25b)['json'](_0x526928);}};}function respondWithFilteredResult(_0x597d6e,_0xf1ef23){return function(_0x29d574){if(_0x29d574){var _0x110ccb=typeof _0xf1ef23[_0xae02('0x1b')]===_0xae02('0x1c')&&typeof _0xf1ef23[_0xae02('0x1d')]===_0xae02('0x1c');var _0x1bfa33=_0x29d574['count'];var _0x560114=_0x110ccb?0x0:_0xf1ef23[_0xae02('0x1b')];var _0x4369c9=_0x110ccb?_0x29d574[_0xae02('0x1e')]:_0xf1ef23['offset']+_0xf1ef23['limit'];var _0x57753b;if(_0x4369c9>=_0x1bfa33){_0x4369c9=_0x1bfa33;_0x57753b=0xc8;}else{_0x57753b=0xce;}_0x597d6e['status'](_0x57753b);return _0x597d6e[_0xae02('0x1f')](_0xae02('0x20'),_0x560114+'-'+_0x4369c9+'/'+_0x1bfa33)[_0xae02('0x21')](_0x29d574);}return null;};}function patchUpdates(_0xe22675){return function(_0x1f594a){try{jsonpatch[_0xae02('0x22')](_0x1f594a,_0xe22675,!![]);}catch(_0x177b83){return BPromise[_0xae02('0x23')](_0x177b83);}return _0x1f594a[_0xae02('0x24')]();};}function saveUpdates(_0x2d905e,_0x1fbff5){return function(_0x79917c){if(_0x79917c){return _0x79917c[_0xae02('0x25')](_0x2d905e)[_0xae02('0x26')](function(_0x5a738d){return _0x5a738d;});}return null;};}function removeEntity(_0x557c54,_0x10f4b9){return function(_0x13e2a){if(_0x13e2a){return _0x13e2a[_0xae02('0x27')]()[_0xae02('0x26')](function(){_0x557c54[_0xae02('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x261851,_0x319456){return function(_0x6bcee8){if(!_0x6bcee8){_0x261851[_0xae02('0x18')](0x194);}return _0x6bcee8;};}function handleError(_0x23a32b,_0x374576){_0x374576=_0x374576||0x1f4;return function(_0x2d6fe6){logger[_0xae02('0x28')](_0x2d6fe6[_0xae02('0x29')]);if(_0x2d6fe6[_0xae02('0x2a')]){delete _0x2d6fe6[_0xae02('0x2a')];}_0x23a32b[_0xae02('0x1a')](_0x374576)['send'](_0x2d6fe6);};}exports[_0xae02('0x2b')]=function(_0xe8b9a4,_0x111af2){var _0x50c35e={},_0x536694={},_0x2b3b08={'count':0x0,'rows':[]};var _0x10a8ad=_[_0xae02('0x2c')](db[_0xae02('0x2d')][_0xae02('0x2e')],function(_0x3dd29b){return{'name':_0x3dd29b['fieldName'],'type':_0x3dd29b[_0xae02('0x2f')][_0xae02('0x30')]};});_0x536694['model']=_[_0xae02('0x2c')](_0x10a8ad,_0xae02('0x2a'));_0x536694[_0xae02('0x31')]=_[_0xae02('0x32')](_0xe8b9a4[_0xae02('0x31')]);_0x536694['filters']=_[_0xae02('0x33')](_0x536694[_0xae02('0x34')],_0x536694[_0xae02('0x31')]);_0x50c35e[_0xae02('0x35')]=_[_0xae02('0x33')](_0x536694[_0xae02('0x34')],qs[_0xae02('0x36')](_0xe8b9a4[_0xae02('0x31')][_0xae02('0x36')]));_0x50c35e[_0xae02('0x35')]=_0x50c35e['attributes'][_0xae02('0x37')]?_0x50c35e['attributes']:_0x536694['model'];if(!_0xe8b9a4[_0xae02('0x31')][_0xae02('0x38')](_0xae02('0x39'))){_0x50c35e[_0xae02('0x1d')]=qs[_0xae02('0x1d')](_0xe8b9a4[_0xae02('0x31')]['limit']);_0x50c35e[_0xae02('0x1b')]=qs[_0xae02('0x1b')](_0xe8b9a4[_0xae02('0x31')][_0xae02('0x1b')]);}_0x50c35e[_0xae02('0x3a')]=qs[_0xae02('0x3b')](_0xe8b9a4['query'][_0xae02('0x3b')]);_0x50c35e[_0xae02('0x3c')]=qs[_0xae02('0x3d')](_[_0xae02('0x3e')](_0xe8b9a4[_0xae02('0x31')],_0x536694[_0xae02('0x3d')]),_0x10a8ad);if(_0xe8b9a4[_0xae02('0x31')][_0xae02('0x3f')]){_0x50c35e[_0xae02('0x3c')]=_['merge'](_0x50c35e[_0xae02('0x3c')],{'$or':_[_0xae02('0x2c')](_0x10a8ad,function(_0x2141d0){if(_0x2141d0[_0xae02('0x2f')]!==_0xae02('0x40')){var _0x440972={};_0x440972[_0x2141d0['name']]={'$like':'%'+_0xe8b9a4[_0xae02('0x31')][_0xae02('0x3f')]+'%'};return _0x440972;}})});}_0x50c35e=_[_0xae02('0x41')]({},_0x50c35e,_0xe8b9a4['options']);var _0x3685f1={'where':_0x50c35e[_0xae02('0x3c')]};return db['SquareMessage'][_0xae02('0x1e')](_0x3685f1)[_0xae02('0x26')](function(_0x273eba){_0x2b3b08['count']=_0x273eba;if(_0xe8b9a4[_0xae02('0x31')][_0xae02('0x42')]){_0x50c35e[_0xae02('0x43')]=[{'all':!![]}];}return db[_0xae02('0x2d')][_0xae02('0x44')](_0x50c35e);})['then'](function(_0x5db078){_0x2b3b08[_0xae02('0x45')]=_0x5db078;return _0x2b3b08;})[_0xae02('0x26')](respondWithFilteredResult(_0x111af2,_0x50c35e))[_0xae02('0x46')](handleError(_0x111af2,null));};exports[_0xae02('0x47')]=function(_0x40ed68,_0x207895){var _0x59448a={'raw':!![],'where':{'id':_0x40ed68['params']['id']}},_0x3ddeca={};_0x3ddeca[_0xae02('0x34')]=_[_0xae02('0x32')](db[_0xae02('0x2d')][_0xae02('0x2e')]);_0x3ddeca[_0xae02('0x31')]=_[_0xae02('0x32')](_0x40ed68[_0xae02('0x31')]);_0x3ddeca[_0xae02('0x3d')]=_[_0xae02('0x33')](_0x3ddeca[_0xae02('0x34')],_0x3ddeca['query']);_0x59448a['attributes']=_[_0xae02('0x33')](_0x3ddeca[_0xae02('0x34')],qs['fields'](_0x40ed68[_0xae02('0x31')][_0xae02('0x36')]));_0x59448a[_0xae02('0x35')]=_0x59448a[_0xae02('0x35')][_0xae02('0x37')]?_0x59448a[_0xae02('0x35')]:_0x3ddeca[_0xae02('0x34')];if(_0x40ed68[_0xae02('0x31')][_0xae02('0x42')]){_0x59448a[_0xae02('0x43')]=[{'all':!![]}];}_0x59448a=_[_0xae02('0x41')]({},_0x59448a,_0x40ed68[_0xae02('0x48')]);return db['SquareMessage'][_0xae02('0x49')](_0x59448a)[_0xae02('0x26')](handleEntityNotFound(_0x207895,null))['then'](respondWithResult(_0x207895,null))[_0xae02('0x46')](handleError(_0x207895,null));};exports[_0xae02('0x4a')]=function(_0x74ecc7,_0x3a6a88){return db[_0xae02('0x2d')][_0xae02('0x4a')](_0x74ecc7['body'],{})[_0xae02('0x26')](respondWithResult(_0x3a6a88,0xc9))[_0xae02('0x46')](handleError(_0x3a6a88,null));};exports[_0xae02('0x25')]=function(_0x13fbc2,_0x4aab2b){if(_0x13fbc2[_0xae02('0x4b')]['id']){delete _0x13fbc2['body']['id'];}return db[_0xae02('0x2d')][_0xae02('0x49')]({'where':{'id':_0x13fbc2[_0xae02('0x4c')]['id']}})[_0xae02('0x26')](handleEntityNotFound(_0x4aab2b,null))[_0xae02('0x26')](saveUpdates(_0x13fbc2['body'],null))[_0xae02('0x26')](respondWithResult(_0x4aab2b,null))[_0xae02('0x46')](handleError(_0x4aab2b,null));};exports[_0xae02('0x27')]=function(_0x219cf1,_0x32bd01){return db['SquareMessage'][_0xae02('0x49')]({'where':{'id':_0x219cf1[_0xae02('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32bd01,null))[_0xae02('0x26')](removeEntity(_0x32bd01,null))[_0xae02('0x46')](handleError(_0x32bd01,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 4541685..26339df 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 _0xc794=['define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x172a3e,_0xdf84fa){var _0xf154ad=function(_0x233a26){while(--_0x233a26){_0x172a3e['push'](_0x172a3e['shift']());}};_0xf154ad(++_0xdf84fa);}(_0xc794,0x10f));var _0x4c79=function(_0x3b9270,_0x4c5bb8){_0x3b9270=_0x3b9270-0x0;var _0x1bac08=_0xc794[_0x3b9270];return _0x1bac08;};'use strict';var _=require('lodash');var util=require(_0x4c79('0x0'));var logger=require(_0x4c79('0x1'))(_0x4c79('0x2'));var moment=require('moment');var BPromise=require(_0x4c79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c79('0x4'));var rimraf=require(_0x4c79('0x5'));var config=require(_0x4c79('0x6'));var attributes=require('./squareMessage.attributes');module[_0x4c79('0x7')]=function(_0xec838a,_0xaad6d){return _0xec838a[_0x4c79('0x8')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc25a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash'];(function(_0x915101,_0x3e389b){var _0x3c9651=function(_0x92a7be){while(--_0x92a7be){_0x915101['push'](_0x915101['shift']());}};_0x3c9651(++_0x3e389b);}(_0xc25a,0xb5));var _0xac25=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc25a[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xac25('0x0'));var util=require('util');var logger=require(_0xac25('0x1'))(_0xac25('0x2'));var moment=require(_0xac25('0x3'));var BPromise=require(_0xac25('0x4'));var rp=require(_0xac25('0x5'));var fs=require('fs');var path=require(_0xac25('0x6'));var rimraf=require(_0xac25('0x7'));var config=require(_0xac25('0x8'));var attributes=require('./squareMessage.attributes');module[_0xac25('0x9')]=function(_0x4a5880,_0x7b854){return _0x4a5880[_0xac25('0xa')](_0xac25('0xb'),attributes,{'tableName':_0xac25('0xc'),'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 99b4c53..078c876 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 _0x7043=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareMessage','create','body','options','raw','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7043,0x167));var _0x3704=function(_0x35611a,_0x59bb6c){_0x35611a=_0x35611a-0x0;var _0x57490a=_0x7043[_0x35611a];return _0x57490a;};'use strict';var _=require(_0x3704('0x0'));var util=require(_0x3704('0x1'));var moment=require(_0x3704('0x2'));var BPromise=require(_0x3704('0x3'));var rs=require(_0x3704('0x4'));var fs=require('fs');var Redis=require(_0x3704('0x5'));var db=require(_0x3704('0x6'))['db'];var utils=require(_0x3704('0x7'));var logger=require(_0x3704('0x8'))(_0x3704('0x9'));var config=require(_0x3704('0xa'));var jayson=require(_0x3704('0xb'));var client=jayson[_0x3704('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f32c,_0x39e0c2,_0x575ae4){return new BPromise(function(_0x1da401,_0x28b7a5){return client[_0x3704('0xd')](_0x54f32c,_0x575ae4)[_0x3704('0xe')](function(_0x27797a){logger[_0x3704('0xf')](_0x3704('0x10'),_0x39e0c2,'request\x20sent');logger[_0x3704('0x11')](_0x3704('0x12'),_0x39e0c2,'request\x20sent',JSON[_0x3704('0x13')](_0x27797a));if(_0x27797a[_0x3704('0x14')]){if(_0x27797a[_0x3704('0x14')]['code']===0x1f4){logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0x27797a['error'][_0x3704('0x15')]);return _0x28b7a5(_0x27797a[_0x3704('0x14')][_0x3704('0x15')]);}logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0x27797a[_0x3704('0x14')][_0x3704('0x15')]);return _0x1da401(_0x27797a[_0x3704('0x14')]['message']);}else{logger['info'](_0x3704('0x10'),_0x39e0c2,_0x3704('0x16'));_0x1da401(_0x27797a[_0x3704('0x17')][_0x3704('0x15')]);}})[_0x3704('0x18')](function(_0xb3834f){logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0xb3834f);_0x28b7a5(_0xb3834f);});});}exports[_0x3704('0x19')]=function(_0x234ccd){var _0x277b9c=this;return new Promise(function(_0x48cbbc,_0xfafb63){return db['SquareMessage'][_0x3704('0x1a')](_0x234ccd[_0x3704('0x1b')],{'raw':_0x234ccd[_0x3704('0x1c')]?_0x234ccd[_0x3704('0x1c')][_0x3704('0x1d')]===undefined?!![]:![]:!![]})[_0x3704('0xe')](function(_0xf4a5b0){logger[_0x3704('0xf')]('CreateSquareMessage',_0x234ccd);logger['debug'](_0x3704('0x19'),_0x234ccd,JSON['stringify'](_0xf4a5b0));_0x48cbbc(_0xf4a5b0);})[_0x3704('0x18')](function(_0x10ae7d){logger[_0x3704('0x14')](_0x3704('0x19'),_0x10ae7d[_0x3704('0x15')],_0x234ccd);_0xfafb63(_0x277b9c[_0x3704('0x14')](0x1f4,_0x10ae7d[_0x3704('0x15')]));});});}; \ No newline at end of file +var _0x29f3=['create','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage'];(function(_0x4998e4,_0x47a4ed){var _0x1bef53=function(_0x458797){while(--_0x458797){_0x4998e4['push'](_0x4998e4['shift']());}};_0x1bef53(++_0x47a4ed);}(_0x29f3,0x9a));var _0x329f=function(_0x14b9b3,_0x1c952c){_0x14b9b3=_0x14b9b3-0x0;var _0x3095ba=_0x29f3[_0x14b9b3];return _0x3095ba;};'use strict';var _=require(_0x329f('0x0'));var util=require(_0x329f('0x1'));var moment=require(_0x329f('0x2'));var BPromise=require(_0x329f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x329f('0x4'));var db=require(_0x329f('0x5'))['db'];var utils=require(_0x329f('0x6'));var logger=require('../../config/logger')(_0x329f('0x7'));var config=require(_0x329f('0x8'));var jayson=require(_0x329f('0x9'));var client=jayson[_0x329f('0xa')][_0x329f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bf6e,_0x350370,_0x8609f7){return new BPromise(function(_0x5919f5,_0x3b5b33){return client[_0x329f('0xc')](_0x54bf6e,_0x8609f7)[_0x329f('0xd')](function(_0x585a24){logger[_0x329f('0xe')]('SquareMessage,\x20%s,\x20%s',_0x350370,'request\x20sent');logger[_0x329f('0xf')](_0x329f('0x10'),_0x350370,_0x329f('0x11'),JSON[_0x329f('0x12')](_0x585a24));if(_0x585a24[_0x329f('0x13')]){if(_0x585a24[_0x329f('0x13')][_0x329f('0x14')]===0x1f4){logger['error'](_0x329f('0x15'),_0x350370,_0x585a24[_0x329f('0x13')][_0x329f('0x16')]);return _0x3b5b33(_0x585a24[_0x329f('0x13')][_0x329f('0x16')]);}logger[_0x329f('0x13')](_0x329f('0x15'),_0x350370,_0x585a24[_0x329f('0x13')]['message']);return _0x5919f5(_0x585a24[_0x329f('0x13')][_0x329f('0x16')]);}else{logger[_0x329f('0xe')](_0x329f('0x15'),_0x350370,'request\x20sent');_0x5919f5(_0x585a24[_0x329f('0x17')][_0x329f('0x16')]);}})['catch'](function(_0x209898){logger['error'](_0x329f('0x15'),_0x350370,_0x209898);_0x3b5b33(_0x209898);});});}exports[_0x329f('0x18')]=function(_0x1a070a){var _0x257918=this;return new Promise(function(_0xb3c5b0,_0x45e1e5){return db[_0x329f('0x19')][_0x329f('0x1a')](_0x1a070a['body'],{'raw':_0x1a070a[_0x329f('0x1b')]?_0x1a070a[_0x329f('0x1b')][_0x329f('0x1c')]===undefined?!![]:![]:!![]})[_0x329f('0xd')](function(_0x4a3745){logger['info'](_0x329f('0x18'),_0x1a070a);logger[_0x329f('0xf')](_0x329f('0x18'),_0x1a070a,JSON[_0x329f('0x12')](_0x4a3745));_0xb3c5b0(_0x4a3745);})[_0x329f('0x1d')](function(_0x4f8df8){logger[_0x329f('0x13')]('CreateSquareMessage',_0x4f8df8['message'],_0x1a070a);_0x45e1e5(_0x257918[_0x329f('0x13')](0x1f4,_0x4f8df8[_0x329f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8ed3e31..8353c24 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 _0x4531=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/test','test','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x4b8526,_0x2771ec){var _0x3394b4=function(_0xd1fc26){while(--_0xd1fc26){_0x4b8526['push'](_0x4b8526['shift']());}};_0x3394b4(++_0x2771ec);}(_0x4531,0x1e1));var _0x1453=function(_0x5ea0ab,_0x3c0aec){_0x5ea0ab=_0x5ea0ab-0x0;var _0x3716bb=_0x4531[_0x5ea0ab];return _0x3716bb;};'use strict';var multer=require(_0x1453('0x0'));var util=require(_0x1453('0x1'));var path=require(_0x1453('0x2'));var timeout=require(_0x1453('0x3'));var express=require(_0x1453('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1453('0x5'));var interaction=require(_0x1453('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x1453('0x7')]('/',auth[_0x1453('0x8')](),controller['index']);router[_0x1453('0x7')](_0x1453('0x9'),auth[_0x1453('0x8')](),controller[_0x1453('0xa')]);router['get'](_0x1453('0xb'),auth['isAuthenticated'](),timeout('15s'),controller[_0x1453('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1453('0xd')]);router[_0x1453('0xe')](_0x1453('0x9'),auth['isAuthenticated'](),controller[_0x1453('0xf')]);router[_0x1453('0x10')](_0x1453('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x1453('0x11')]=router; \ No newline at end of file +var _0x1abf=['isAuthenticated','index','/:id','/:id/test','15s','test','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get'];(function(_0x19ecd0,_0x5e2a2d){var _0x212fbb=function(_0x5ad553){while(--_0x5ad553){_0x19ecd0['push'](_0x19ecd0['shift']());}};_0x212fbb(++_0x5e2a2d);}(_0x1abf,0x1cc));var _0xf1ab=function(_0x121a0f,_0x1539eb){_0x121a0f=_0x121a0f-0x0;var _0x18d0f0=_0x1abf[_0x121a0f];return _0x18d0f0;};'use strict';var multer=require('multer');var util=require(_0xf1ab('0x0'));var path=require(_0xf1ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1ab('0x2'));var router=express[_0xf1ab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1ab('0x4'));var interaction=require(_0xf1ab('0x5'));var config=require('../../config/environment');var controller=require(_0xf1ab('0x6'));router[_0xf1ab('0x7')]('/',auth[_0xf1ab('0x8')](),controller[_0xf1ab('0x9')]);router[_0xf1ab('0x7')](_0xf1ab('0xa'),auth[_0xf1ab('0x8')](),controller['show']);router['get'](_0xf1ab('0xb'),auth[_0xf1ab('0x8')](),timeout(_0xf1ab('0xc')),controller[_0xf1ab('0xd')]);router['post']('/',auth[_0xf1ab('0x8')](),controller['create']);router[_0xf1ab('0xe')]('/:id',auth[_0xf1ab('0x8')](),controller[_0xf1ab('0xf')]);router[_0xf1ab('0x10')]('/:id',auth[_0xf1ab('0x8')](),controller[_0xf1ab('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 30a40b9..e2fd717 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 _0x7ace=['sequelize','exports','STRING','name'];(function(_0x3eefc6,_0x1852db){var _0x943b68=function(_0x333ac1){while(--_0x333ac1){_0x3eefc6['push'](_0x3eefc6['shift']());}};_0x943b68(++_0x1852db);}(_0x7ace,0x16c));var _0xe7ac=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7ace[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xe7ac('0x0'));module[_0xe7ac('0x1')]={'name':{'type':Sequelize[_0xe7ac('0x2')],'unique':_0xe7ac('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7ac('0x2')]}}; \ No newline at end of file +var _0x7632=['exports','STRING','name'];(function(_0xdaf3d1,_0x4d7ed5){var _0x1b25ce=function(_0x1d7d34){while(--_0x1d7d34){_0xdaf3d1['push'](_0xdaf3d1['shift']());}};_0x1b25ce(++_0x4d7ed5);}(_0x7632,0x11a));var _0x2763=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x7632[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require('sequelize');module[_0x2763('0x0')]={'name':{'type':Sequelize[_0x2763('0x1')],'unique':_0x2763('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2763('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 775606e..38dbe50 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 _0x212a=['filter','merge','type','VIRTUAL','SquareOdbc','includeAll','include','rows','show','params','options','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','get','ODBC','UserProfileResource','destroy','then','error','stack','name','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x377b6d,_0x1f0d6d){var _0x4f3fd9=function(_0x1580d5){while(--_0x1580d5){_0x377b6d['push'](_0x377b6d['shift']());}};_0x4f3fd9(++_0x1f0d6d);}(_0x212a,0x1b6));var _0xa212=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x212a[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xa212('0x0'));var rimraf=require(_0xa212('0x1'));var zipdir=require(_0xa212('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa212('0x3'));var moment=require(_0xa212('0x4'));var BPromise=require(_0xa212('0x5'));var Mustache=require(_0xa212('0x6'));var util=require(_0xa212('0x7'));var path=require(_0xa212('0x8'));var sox=require('sox');var csv=require(_0xa212('0x9'));var ejs=require(_0xa212('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa212('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa212('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa212('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa212('0xe'));var qs=require(_0xa212('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa212('0x10'))(_0xa212('0x11'));var utils=require(_0xa212('0x12'));var config=require(_0xa212('0x13'));var licenseUtil=require(_0xa212('0x14'));var db=require(_0xa212('0x15'))['db'];function respondWithStatusCode(_0x52042e,_0x3aa27e){_0x3aa27e=_0x3aa27e||0xcc;return function(_0x484d43){if(_0x484d43){return _0x52042e[_0xa212('0x16')](_0x3aa27e);}return _0x52042e[_0xa212('0x17')](_0x3aa27e)[_0xa212('0x18')]();};}function respondWithResult(_0x578602,_0x321f68){_0x321f68=_0x321f68||0xc8;return function(_0x24260d){if(_0x24260d){return _0x578602[_0xa212('0x17')](_0x321f68)[_0xa212('0x19')](_0x24260d);}};}function respondWithFilteredResult(_0x87ce83,_0x530b5b){return function(_0x573a16){if(_0x573a16){var _0x2423ec=typeof _0x530b5b[_0xa212('0x1a')]===_0xa212('0x1b')&&typeof _0x530b5b['limit']==='undefined';var _0x5b2b9b=_0x573a16[_0xa212('0x1c')];var _0xbc5b8a=_0x2423ec?0x0:_0x530b5b[_0xa212('0x1a')];var _0x39e281=_0x2423ec?_0x573a16[_0xa212('0x1c')]:_0x530b5b[_0xa212('0x1a')]+_0x530b5b[_0xa212('0x1d')];var _0x35b012;if(_0x39e281>=_0x5b2b9b){_0x39e281=_0x5b2b9b;_0x35b012=0xc8;}else{_0x35b012=0xce;}_0x87ce83['status'](_0x35b012);return _0x87ce83[_0xa212('0x1e')](_0xa212('0x1f'),_0xbc5b8a+'-'+_0x39e281+'/'+_0x5b2b9b)[_0xa212('0x19')](_0x573a16);}return null;};}function patchUpdates(_0x2db0c0){return function(_0x1ba10b){try{jsonpatch[_0xa212('0x20')](_0x1ba10b,_0x2db0c0,!![]);}catch(_0x29add8){return BPromise['reject'](_0x29add8);}return _0x1ba10b[_0xa212('0x21')]();};}function saveUpdates(_0x668c19,_0x56d7f3){return function(_0x57d766){if(_0x57d766){return _0x57d766['update'](_0x668c19)['then'](function(_0xab0491){return _0xab0491;});}return null;};}function removeEntity(_0x56d949,_0x599f38){return function(_0x16e0c6){if(_0x16e0c6){return _0x16e0c6['destroy']()['then'](function(){var _0x2c5cd7=_0x16e0c6[_0xa212('0x22')]({'plain':!![]});var _0x19374a=_0xa212('0x23');return db[_0xa212('0x24')][_0xa212('0x25')]({'where':{'type':_0x19374a,'resourceId':_0x2c5cd7['id']}})[_0xa212('0x26')](function(){return _0x16e0c6;});})[_0xa212('0x26')](function(){_0x56d949['status'](0xcc)[_0xa212('0x18')]();});}};}function handleEntityNotFound(_0x211744,_0x2f411e){return function(_0x5b1267){if(!_0x5b1267){_0x211744[_0xa212('0x16')](0x194);}return _0x5b1267;};}function handleError(_0x1bc058,_0x35703c){_0x35703c=_0x35703c||0x1f4;return function(_0xea1f1d){logger[_0xa212('0x27')](_0xea1f1d[_0xa212('0x28')]);if(_0xea1f1d[_0xa212('0x29')]){delete _0xea1f1d[_0xa212('0x29')];}_0x1bc058['status'](_0x35703c)['send'](_0xea1f1d);};}exports['index']=function(_0x53758a,_0x24afb0){var _0x375b26={},_0x1c1998={},_0x25d10={'count':0x0,'rows':[]};var _0x2b50ca=_[_0xa212('0x2a')](db['SquareOdbc'][_0xa212('0x2b')],function(_0x54c7e9){return{'name':_0x54c7e9[_0xa212('0x2c')],'type':_0x54c7e9['type'][_0xa212('0x2d')]};});_0x1c1998['model']=_['map'](_0x2b50ca,_0xa212('0x29'));_0x1c1998[_0xa212('0x2e')]=_[_0xa212('0x2f')](_0x53758a[_0xa212('0x2e')]);_0x1c1998[_0xa212('0x30')]=_[_0xa212('0x31')](_0x1c1998[_0xa212('0x32')],_0x1c1998[_0xa212('0x2e')]);_0x375b26[_0xa212('0x33')]=_['intersection'](_0x1c1998['model'],qs[_0xa212('0x34')](_0x53758a['query'][_0xa212('0x34')]));_0x375b26[_0xa212('0x33')]=_0x375b26[_0xa212('0x33')][_0xa212('0x35')]?_0x375b26[_0xa212('0x33')]:_0x1c1998[_0xa212('0x32')];if(!_0x53758a[_0xa212('0x2e')][_0xa212('0x36')](_0xa212('0x37'))){_0x375b26[_0xa212('0x1d')]=qs[_0xa212('0x1d')](_0x53758a[_0xa212('0x2e')][_0xa212('0x1d')]);_0x375b26['offset']=qs[_0xa212('0x1a')](_0x53758a[_0xa212('0x2e')][_0xa212('0x1a')]);}_0x375b26[_0xa212('0x38')]=qs['sort'](_0x53758a[_0xa212('0x2e')][_0xa212('0x39')]);_0x375b26[_0xa212('0x3a')]=qs[_0xa212('0x30')](_[_0xa212('0x3b')](_0x53758a[_0xa212('0x2e')],_0x1c1998['filters']),_0x2b50ca);if(_0x53758a[_0xa212('0x2e')][_0xa212('0x3c')]){_0x375b26[_0xa212('0x3a')]=_[_0xa212('0x3d')](_0x375b26[_0xa212('0x3a')],{'$or':_[_0xa212('0x2a')](_0x2b50ca,function(_0x334de7){if(_0x334de7[_0xa212('0x3e')]!==_0xa212('0x3f')){var _0x373396={};_0x373396[_0x334de7[_0xa212('0x29')]]={'$like':'%'+_0x53758a[_0xa212('0x2e')][_0xa212('0x3c')]+'%'};return _0x373396;}})});}_0x375b26=_[_0xa212('0x3d')]({},_0x375b26,_0x53758a['options']);var _0x17db84={'where':_0x375b26[_0xa212('0x3a')]};return db[_0xa212('0x40')][_0xa212('0x1c')](_0x17db84)[_0xa212('0x26')](function(_0x321e52){_0x25d10[_0xa212('0x1c')]=_0x321e52;if(_0x53758a[_0xa212('0x2e')][_0xa212('0x41')]){_0x375b26[_0xa212('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x375b26);})[_0xa212('0x26')](function(_0x15db73){_0x25d10[_0xa212('0x43')]=_0x15db73;return _0x25d10;})[_0xa212('0x26')](respondWithFilteredResult(_0x24afb0,_0x375b26))['catch'](handleError(_0x24afb0,null));};exports[_0xa212('0x44')]=function(_0xf1ec2d,_0x4b669f){var _0x57135c={'raw':!![],'where':{'id':_0xf1ec2d[_0xa212('0x45')]['id']}},_0x1fedb9={};_0x1fedb9[_0xa212('0x32')]=_[_0xa212('0x2f')](db[_0xa212('0x40')][_0xa212('0x2b')]);_0x1fedb9[_0xa212('0x2e')]=_[_0xa212('0x2f')](_0xf1ec2d[_0xa212('0x2e')]);_0x1fedb9['filters']=_[_0xa212('0x31')](_0x1fedb9[_0xa212('0x32')],_0x1fedb9[_0xa212('0x2e')]);_0x57135c[_0xa212('0x33')]=_[_0xa212('0x31')](_0x1fedb9['model'],qs[_0xa212('0x34')](_0xf1ec2d[_0xa212('0x2e')]['fields']));_0x57135c[_0xa212('0x33')]=_0x57135c['attributes']['length']?_0x57135c[_0xa212('0x33')]:_0x1fedb9[_0xa212('0x32')];if(_0xf1ec2d[_0xa212('0x2e')][_0xa212('0x41')]){_0x57135c[_0xa212('0x42')]=[{'all':!![]}];}_0x57135c=_[_0xa212('0x3d')]({},_0x57135c,_0xf1ec2d[_0xa212('0x46')]);return db['SquareOdbc'][_0xa212('0x47')](_0x57135c)[_0xa212('0x26')](handleEntityNotFound(_0x4b669f,null))['then'](respondWithResult(_0x4b669f,null))['catch'](handleError(_0x4b669f,null));};exports[_0xa212('0x48')]=function(_0x513786,_0x1c6307){return db[_0xa212('0x40')][_0xa212('0x48')](_0x513786[_0xa212('0x49')],{})[_0xa212('0x26')](function(_0x3333a5){var _0x3d1a0b=_0x513786[_0xa212('0x4a')]['get']({'plain':!![]});if(!_0x3d1a0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d1a0b['role']===_0xa212('0x4a')){var _0x14a524=_0x3333a5[_0xa212('0x22')]({'plain':!![]});var _0x2ac75d=_0xa212('0x23');return db['UserProfileSection'][_0xa212('0x47')]({'where':{'name':_0x2ac75d,'userProfileId':_0x3d1a0b[_0xa212('0x4b')]},'raw':!![]})[_0xa212('0x26')](function(_0x14c753){if(_0x14c753&&_0x14c753['autoAssociation']===0x0){return db[_0xa212('0x24')][_0xa212('0x48')]({'name':_0x14a524[_0xa212('0x29')],'resourceId':_0x14a524['id'],'type':_0x14c753['name'],'sectionId':_0x14c753['id']},{})['then'](function(){return _0x3333a5;});}else{return _0x3333a5;}})['catch'](function(_0x58a6ba){logger[_0xa212('0x27')](_0xa212('0x4c'),_0x58a6ba);throw _0x58a6ba;});}return _0x3333a5;})[_0xa212('0x26')](respondWithResult(_0x1c6307,0xc9))['catch'](handleError(_0x1c6307,null));};exports[_0xa212('0x4d')]=function(_0x4bb161,_0x40176f){if(_0x4bb161[_0xa212('0x49')]['id']){delete _0x4bb161[_0xa212('0x49')]['id'];}return db['SquareOdbc'][_0xa212('0x47')]({'where':{'id':_0x4bb161[_0xa212('0x45')]['id']}})[_0xa212('0x26')](handleEntityNotFound(_0x40176f,null))[_0xa212('0x26')](saveUpdates(_0x4bb161[_0xa212('0x49')],null))[_0xa212('0x26')](respondWithResult(_0x40176f,null))[_0xa212('0x4e')](handleError(_0x40176f,null));};exports[_0xa212('0x25')]=function(_0x1d0997,_0x52ee28){return db[_0xa212('0x40')][_0xa212('0x47')]({'where':{'id':_0x1d0997[_0xa212('0x45')]['id']}})[_0xa212('0x26')](handleEntityNotFound(_0x52ee28,null))[_0xa212('0x26')](removeEntity(_0x52ee28,null))['catch'](handleError(_0x52ee28,null));};exports[_0xa212('0x4f')]=function(_0xf5757f,_0x2a1faa,_0x21f788){var _0x540d33;return db[_0xa212('0x40')][_0xa212('0x47')]({'where':{'id':_0xf5757f[_0xa212('0x45')]['id']},'attributes':['id',_0xa212('0x50')]})[_0xa212('0x26')](handleEntityNotFound(_0x2a1faa,null))[_0xa212('0x26')](function(_0x2d818b){if(_0x2d818b){var _0x6cbed0=require(_0xa212('0x51'))();_0x6cbed0[_0xa212('0x52')](_0x2d818b['dsn']);_0x6cbed0['closeSync']();return _0x2d818b;}})[_0xa212('0x26')](respondWithResult(_0x2a1faa,null))[_0xa212('0x4e')](handleError(_0x2a1faa,null));}; \ No newline at end of file +var _0x8b15=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x8b15,0x1a3));var _0x58b1=function(_0x48efbd,_0x10398f){_0x48efbd=_0x48efbd-0x0;var _0x57fe53=_0x8b15[_0x48efbd];return _0x57fe53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x58b1('0x0'));var rp=require('request-promise');var moment=require(_0x58b1('0x1'));var BPromise=require(_0x58b1('0x2'));var Mustache=require(_0x58b1('0x3'));var util=require(_0x58b1('0x4'));var path=require(_0x58b1('0x5'));var sox=require('sox');var csv=require(_0x58b1('0x6'));var ejs=require(_0x58b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x58b1('0x8'));var crypto=require(_0x58b1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x58b1('0xa'));var toCsv=require(_0x58b1('0x6'));var querystring=require(_0x58b1('0xb'));var Papa=require(_0x58b1('0xc'));var Redis=require('ioredis');var authService=require(_0x58b1('0xd'));var qs=require(_0x58b1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58b1('0xf'))('api');var utils=require(_0x58b1('0x10'));var config=require(_0x58b1('0x11'));var licenseUtil=require(_0x58b1('0x12'));var db=require(_0x58b1('0x13'))['db'];function respondWithStatusCode(_0x1022b9,_0x13a142){_0x13a142=_0x13a142||0xcc;return function(_0x4f8160){if(_0x4f8160){return _0x1022b9['sendStatus'](_0x13a142);}return _0x1022b9['status'](_0x13a142)[_0x58b1('0x14')]();};}function respondWithResult(_0x39f4e6,_0xdfea67){_0xdfea67=_0xdfea67||0xc8;return function(_0x502609){if(_0x502609){return _0x39f4e6[_0x58b1('0x15')](_0xdfea67)['json'](_0x502609);}};}function respondWithFilteredResult(_0x75daf,_0x2172db){return function(_0x532185){if(_0x532185){var _0x13a274=typeof _0x2172db[_0x58b1('0x16')]===_0x58b1('0x17')&&typeof _0x2172db[_0x58b1('0x18')]===_0x58b1('0x17');var _0x3ff366=_0x532185[_0x58b1('0x19')];var _0x2add58=_0x13a274?0x0:_0x2172db[_0x58b1('0x16')];var _0x3ce463=_0x13a274?_0x532185[_0x58b1('0x19')]:_0x2172db[_0x58b1('0x16')]+_0x2172db['limit'];var _0x553327;if(_0x3ce463>=_0x3ff366){_0x3ce463=_0x3ff366;_0x553327=0xc8;}else{_0x553327=0xce;}_0x75daf[_0x58b1('0x15')](_0x553327);return _0x75daf['set'](_0x58b1('0x1a'),_0x2add58+'-'+_0x3ce463+'/'+_0x3ff366)[_0x58b1('0x1b')](_0x532185);}return null;};}function patchUpdates(_0x580f36){return function(_0x76ff8b){try{jsonpatch['apply'](_0x76ff8b,_0x580f36,!![]);}catch(_0x381413){return BPromise[_0x58b1('0x1c')](_0x381413);}return _0x76ff8b[_0x58b1('0x1d')]();};}function saveUpdates(_0x5cd61d,_0x25d9ac){return function(_0x30ee8b){if(_0x30ee8b){return _0x30ee8b[_0x58b1('0x1e')](_0x5cd61d)[_0x58b1('0x1f')](function(_0x3370cb){return _0x3370cb;});}return null;};}function removeEntity(_0x17a863,_0x16b533){return function(_0x55863b){if(_0x55863b){return _0x55863b[_0x58b1('0x20')]()[_0x58b1('0x1f')](function(){var _0x4da24a=_0x55863b[_0x58b1('0x21')]({'plain':!![]});var _0x128f49=_0x58b1('0x22');return db[_0x58b1('0x23')][_0x58b1('0x20')]({'where':{'type':_0x128f49,'resourceId':_0x4da24a['id']}})['then'](function(){return _0x55863b;});})['then'](function(){_0x17a863[_0x58b1('0x15')](0xcc)[_0x58b1('0x14')]();});}};}function handleEntityNotFound(_0x3f1469,_0x37782c){return function(_0x2327ce){if(!_0x2327ce){_0x3f1469['sendStatus'](0x194);}return _0x2327ce;};}function handleError(_0x124cde,_0xcdf3e1){_0xcdf3e1=_0xcdf3e1||0x1f4;return function(_0x33ccb2){logger[_0x58b1('0x24')](_0x33ccb2[_0x58b1('0x25')]);if(_0x33ccb2[_0x58b1('0x26')]){delete _0x33ccb2[_0x58b1('0x26')];}_0x124cde[_0x58b1('0x15')](_0xcdf3e1)[_0x58b1('0x27')](_0x33ccb2);};}exports['index']=function(_0x47b3bc,_0x15cb02){var _0x3e19d2={},_0x1de173={},_0x195ec1={'count':0x0,'rows':[]};var _0x4f271e=_[_0x58b1('0x28')](db[_0x58b1('0x29')][_0x58b1('0x2a')],function(_0x411ce1){return{'name':_0x411ce1[_0x58b1('0x2b')],'type':_0x411ce1[_0x58b1('0x2c')][_0x58b1('0x2d')]};});_0x1de173[_0x58b1('0x2e')]=_[_0x58b1('0x28')](_0x4f271e,_0x58b1('0x26'));_0x1de173['query']=_[_0x58b1('0x2f')](_0x47b3bc[_0x58b1('0x30')]);_0x1de173[_0x58b1('0x31')]=_[_0x58b1('0x32')](_0x1de173['model'],_0x1de173[_0x58b1('0x30')]);_0x3e19d2[_0x58b1('0x33')]=_['intersection'](_0x1de173['model'],qs['fields'](_0x47b3bc['query'][_0x58b1('0x34')]));_0x3e19d2[_0x58b1('0x33')]=_0x3e19d2[_0x58b1('0x33')]['length']?_0x3e19d2['attributes']:_0x1de173['model'];if(!_0x47b3bc[_0x58b1('0x30')][_0x58b1('0x35')](_0x58b1('0x36'))){_0x3e19d2[_0x58b1('0x18')]=qs[_0x58b1('0x18')](_0x47b3bc['query'][_0x58b1('0x18')]);_0x3e19d2['offset']=qs[_0x58b1('0x16')](_0x47b3bc[_0x58b1('0x30')][_0x58b1('0x16')]);}_0x3e19d2[_0x58b1('0x37')]=qs[_0x58b1('0x38')](_0x47b3bc[_0x58b1('0x30')][_0x58b1('0x38')]);_0x3e19d2['where']=qs['filters'](_[_0x58b1('0x39')](_0x47b3bc[_0x58b1('0x30')],_0x1de173[_0x58b1('0x31')]),_0x4f271e);if(_0x47b3bc[_0x58b1('0x30')][_0x58b1('0x3a')]){_0x3e19d2[_0x58b1('0x3b')]=_[_0x58b1('0x3c')](_0x3e19d2[_0x58b1('0x3b')],{'$or':_[_0x58b1('0x28')](_0x4f271e,function(_0x53be14){if(_0x53be14[_0x58b1('0x2c')]!=='VIRTUAL'){var _0x1ea870={};_0x1ea870[_0x53be14[_0x58b1('0x26')]]={'$like':'%'+_0x47b3bc[_0x58b1('0x30')][_0x58b1('0x3a')]+'%'};return _0x1ea870;}})});}_0x3e19d2=_[_0x58b1('0x3c')]({},_0x3e19d2,_0x47b3bc[_0x58b1('0x3d')]);var _0x1435da={'where':_0x3e19d2[_0x58b1('0x3b')]};return db[_0x58b1('0x29')][_0x58b1('0x19')](_0x1435da)['then'](function(_0x398d9c){_0x195ec1[_0x58b1('0x19')]=_0x398d9c;if(_0x47b3bc['query'][_0x58b1('0x3e')]){_0x3e19d2[_0x58b1('0x3f')]=[{'all':!![]}];}return db[_0x58b1('0x29')][_0x58b1('0x40')](_0x3e19d2);})[_0x58b1('0x1f')](function(_0x2ed2d1){_0x195ec1['rows']=_0x2ed2d1;return _0x195ec1;})[_0x58b1('0x1f')](respondWithFilteredResult(_0x15cb02,_0x3e19d2))[_0x58b1('0x41')](handleError(_0x15cb02,null));};exports[_0x58b1('0x42')]=function(_0x550751,_0x201170){var _0x1afc6f={'raw':!![],'where':{'id':_0x550751[_0x58b1('0x43')]['id']}},_0x128028={};_0x128028[_0x58b1('0x2e')]=_['keys'](db[_0x58b1('0x29')]['rawAttributes']);_0x128028[_0x58b1('0x30')]=_['keys'](_0x550751['query']);_0x128028['filters']=_[_0x58b1('0x32')](_0x128028[_0x58b1('0x2e')],_0x128028[_0x58b1('0x30')]);_0x1afc6f['attributes']=_[_0x58b1('0x32')](_0x128028[_0x58b1('0x2e')],qs[_0x58b1('0x34')](_0x550751['query'][_0x58b1('0x34')]));_0x1afc6f['attributes']=_0x1afc6f[_0x58b1('0x33')][_0x58b1('0x44')]?_0x1afc6f['attributes']:_0x128028[_0x58b1('0x2e')];if(_0x550751[_0x58b1('0x30')][_0x58b1('0x3e')]){_0x1afc6f['include']=[{'all':!![]}];}_0x1afc6f=_[_0x58b1('0x3c')]({},_0x1afc6f,_0x550751[_0x58b1('0x3d')]);return db[_0x58b1('0x29')][_0x58b1('0x45')](_0x1afc6f)[_0x58b1('0x1f')](handleEntityNotFound(_0x201170,null))[_0x58b1('0x1f')](respondWithResult(_0x201170,null))[_0x58b1('0x41')](handleError(_0x201170,null));};exports['create']=function(_0x25ce2e,_0x51432f){return db[_0x58b1('0x29')][_0x58b1('0x46')](_0x25ce2e[_0x58b1('0x47')],{})[_0x58b1('0x1f')](function(_0xbcdcdc){var _0x20908f=_0x25ce2e[_0x58b1('0x48')][_0x58b1('0x21')]({'plain':!![]});if(!_0x20908f)throw new Error(_0x58b1('0x49'));if(_0x20908f[_0x58b1('0x4a')]===_0x58b1('0x48')){var _0x5b1a5f=_0xbcdcdc[_0x58b1('0x21')]({'plain':!![]});var _0x4dc3d2=_0x58b1('0x22');return db[_0x58b1('0x4b')][_0x58b1('0x45')]({'where':{'name':_0x4dc3d2,'userProfileId':_0x20908f[_0x58b1('0x4c')]},'raw':!![]})[_0x58b1('0x1f')](function(_0x558c11){if(_0x558c11&&_0x558c11['autoAssociation']===0x0){return db[_0x58b1('0x23')][_0x58b1('0x46')]({'name':_0x5b1a5f['name'],'resourceId':_0x5b1a5f['id'],'type':_0x558c11[_0x58b1('0x26')],'sectionId':_0x558c11['id']},{})[_0x58b1('0x1f')](function(){return _0xbcdcdc;});}else{return _0xbcdcdc;}})[_0x58b1('0x41')](function(_0x208681){logger[_0x58b1('0x24')](_0x58b1('0x4d'),_0x208681);throw _0x208681;});}return _0xbcdcdc;})[_0x58b1('0x1f')](respondWithResult(_0x51432f,0xc9))['catch'](handleError(_0x51432f,null));};exports[_0x58b1('0x1e')]=function(_0x1326a1,_0xe05143){if(_0x1326a1[_0x58b1('0x47')]['id']){delete _0x1326a1['body']['id'];}return db[_0x58b1('0x29')]['find']({'where':{'id':_0x1326a1[_0x58b1('0x43')]['id']}})['then'](handleEntityNotFound(_0xe05143,null))[_0x58b1('0x1f')](saveUpdates(_0x1326a1[_0x58b1('0x47')],null))[_0x58b1('0x1f')](respondWithResult(_0xe05143,null))[_0x58b1('0x41')](handleError(_0xe05143,null));};exports['destroy']=function(_0x51fca6,_0xa235){return db['SquareOdbc'][_0x58b1('0x45')]({'where':{'id':_0x51fca6[_0x58b1('0x43')]['id']}})[_0x58b1('0x1f')](handleEntityNotFound(_0xa235,null))[_0x58b1('0x1f')](removeEntity(_0xa235,null))[_0x58b1('0x41')](handleError(_0xa235,null));};exports[_0x58b1('0x4e')]=function(_0x35b2d9,_0x1b1670,_0x4a8130){var _0x2a373f;return db['SquareOdbc'][_0x58b1('0x45')]({'where':{'id':_0x35b2d9[_0x58b1('0x43')]['id']},'attributes':['id',_0x58b1('0x4f')]})[_0x58b1('0x1f')](handleEntityNotFound(_0x1b1670,null))[_0x58b1('0x1f')](function(_0x4e1397){if(_0x4e1397){var _0x376dba=require(_0x58b1('0x50'))();_0x376dba['openSync'](_0x4e1397['dsn']);_0x376dba[_0x58b1('0x51')]();return _0x4e1397;}})[_0x58b1('0x1f')](respondWithResult(_0x1b1670,null))['catch'](handleError(_0x1b1670,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 929b54e..5c258ad 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 _0x29c3=['../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x29c3,0x100));var _0x329c=function(_0x2332f3,_0x2eff9a){_0x2332f3=_0x2332f3-0x0;var _0x353330=_0x29c3[_0x2332f3];return _0x353330;};'use strict';var _=require(_0x329c('0x0'));var util=require(_0x329c('0x1'));var logger=require(_0x329c('0x2'))(_0x329c('0x3'));var moment=require(_0x329c('0x4'));var BPromise=require('bluebird');var rp=require(_0x329c('0x5'));var fs=require('fs');var path=require(_0x329c('0x6'));var rimraf=require(_0x329c('0x7'));var config=require(_0x329c('0x8'));var attributes=require(_0x329c('0x9'));module['exports']=function(_0x5d2ff8,_0x5ff3a6){return _0x5d2ff8['define'](_0x329c('0xa'),attributes,{'tableName':_0x329c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb21f=['rimraf','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util','../../config/logger','moment','bluebird','path'];(function(_0x16dcf2,_0x401aea){var _0x50b300=function(_0x29389e){while(--_0x29389e){_0x16dcf2['push'](_0x16dcf2['shift']());}};_0x50b300(++_0x401aea);}(_0xb21f,0x13b));var _0xfb21=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb21f[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0xfb21('0x0'));var logger=require(_0xfb21('0x1'))('api');var moment=require(_0xfb21('0x2'));var BPromise=require(_0xfb21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb21('0x4'));var rimraf=require(_0xfb21('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb21('0x6'));module['exports']=function(_0x1ee835,_0x3912e8){return _0x1ee835[_0xfb21('0x7')](_0xfb21('0x8'),attributes,{'tableName':_0xfb21('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index ccc6c58..293d219 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 _0x070b=['options','raw','where','attributes','include','model','map','then','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x070b,0x18e));var _0xb070=function(_0x4cc2c5,_0x1aa91f){_0x4cc2c5=_0x4cc2c5-0x0;var _0x478c39=_0x070b[_0x4cc2c5];return _0x478c39;};'use strict';var _=require(_0xb070('0x0'));var util=require(_0xb070('0x1'));var moment=require(_0xb070('0x2'));var BPromise=require('bluebird');var rs=require(_0xb070('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb070('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb070('0x5'))(_0xb070('0x6'));var config=require(_0xb070('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb070('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e3fb,_0x3b209c,_0x367e1b){return new BPromise(function(_0x2e8712,_0x596d43){return client[_0xb070('0x9')](_0x37e3fb,_0x367e1b)['then'](function(_0x318227){logger[_0xb070('0xa')](_0xb070('0xb'),_0x3b209c,_0xb070('0xc'));logger[_0xb070('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3b209c,_0xb070('0xc'),JSON[_0xb070('0xe')](_0x318227));if(_0x318227[_0xb070('0xf')]){if(_0x318227[_0xb070('0xf')][_0xb070('0x10')]===0x1f4){logger[_0xb070('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x3b209c,_0x318227[_0xb070('0xf')]['message']);return _0x596d43(_0x318227[_0xb070('0xf')][_0xb070('0x11')]);}logger[_0xb070('0xf')](_0xb070('0xb'),_0x3b209c,_0x318227[_0xb070('0xf')][_0xb070('0x11')]);return _0x2e8712(_0x318227[_0xb070('0xf')][_0xb070('0x11')]);}else{logger[_0xb070('0xa')](_0xb070('0xb'),_0x3b209c,'request\x20sent');_0x2e8712(_0x318227[_0xb070('0x12')][_0xb070('0x11')]);}})[_0xb070('0x13')](function(_0x5bce7e){logger[_0xb070('0xf')](_0xb070('0xb'),_0x3b209c,_0x5bce7e);_0x596d43(_0x5bce7e);});});}exports[_0xb070('0x14')]=function(_0x15550f){var _0x5b0c21=this;return new Promise(function(_0x1a4c29,_0x3601dc){return db[_0xb070('0x15')]['find']({'raw':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x17')]===undefined?!![]:![]:!![],'where':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x18')]||null:null,'attributes':_0x15550f[_0xb070('0x16')]?_0x15550f[_0xb070('0x16')][_0xb070('0x19')]||null:null,'include':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x1a')]?_['map'](_0x15550f[_0xb070('0x16')]['include'],function(_0x20e716){return{'model':db[_0x20e716[_0xb070('0x1b')]],'as':_0x20e716['as'],'attributes':_0x20e716[_0xb070('0x19')],'include':_0x20e716[_0xb070('0x1a')]?_[_0xb070('0x1c')](_0x20e716[_0xb070('0x1a')],function(_0x575a98){return{'model':db[_0x575a98[_0xb070('0x1b')]],'as':_0x575a98['as'],'attributes':_0x575a98[_0xb070('0x19')],'include':_0x575a98['include']?_[_0xb070('0x1c')](_0x575a98[_0xb070('0x1a')],function(_0x46c353){return{'model':db[_0x46c353[_0xb070('0x1b')]],'as':_0x46c353['as'],'attributes':_0x46c353['attributes']};}):[]};}):[]};}):[]:[]})[_0xb070('0x1d')](function(_0x350453){logger[_0xb070('0xa')](_0xb070('0x14'),_0x15550f);logger['debug'](_0xb070('0x14'),_0x15550f,JSON['stringify'](_0x350453));_0x1a4c29(_0x350453);})[_0xb070('0x13')](function(_0xe93f79){logger[_0xb070('0xf')](_0xb070('0x14'),_0xe93f79[_0xb070('0x11')],_0x15550f);_0x3601dc(_0x5b0c21[_0xb070('0xf')](0x1f4,_0xe93f79[_0xb070('0x11')]));});});}; \ No newline at end of file +var _0x6033=['stringify','error','code','message','request\x20sent','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x91a150,_0x50a17b){var _0x48de6c=function(_0x452d8a){while(--_0x452d8a){_0x91a150['push'](_0x91a150['shift']());}};_0x48de6c(++_0x50a17b);}(_0x6033,0xd7));var _0x3603=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6033[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3603('0x0'));var util=require(_0x3603('0x1'));var moment=require(_0x3603('0x2'));var BPromise=require(_0x3603('0x3'));var rs=require(_0x3603('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3603('0x5'))['db'];var utils=require(_0x3603('0x6'));var logger=require('../../config/logger')(_0x3603('0x7'));var config=require('../../config/environment');var jayson=require(_0x3603('0x8'));var client=jayson[_0x3603('0x9')][_0x3603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26cb80,_0xd6d5d7,_0x1fc7e3){return new BPromise(function(_0x10660d,_0x35f7ec){return client[_0x3603('0xb')](_0x26cb80,_0x1fc7e3)[_0x3603('0xc')](function(_0x559ff2){logger['info'](_0x3603('0xd'),_0xd6d5d7,'request\x20sent');logger[_0x3603('0xe')](_0x3603('0xf'),_0xd6d5d7,'request\x20sent',JSON[_0x3603('0x10')](_0x559ff2));if(_0x559ff2[_0x3603('0x11')]){if(_0x559ff2[_0x3603('0x11')][_0x3603('0x12')]===0x1f4){logger[_0x3603('0x11')](_0x3603('0xd'),_0xd6d5d7,_0x559ff2[_0x3603('0x11')][_0x3603('0x13')]);return _0x35f7ec(_0x559ff2[_0x3603('0x11')]['message']);}logger['error'](_0x3603('0xd'),_0xd6d5d7,_0x559ff2[_0x3603('0x11')]['message']);return _0x10660d(_0x559ff2[_0x3603('0x11')][_0x3603('0x13')]);}else{logger['info'](_0x3603('0xd'),_0xd6d5d7,_0x3603('0x14'));_0x10660d(_0x559ff2[_0x3603('0x15')]['message']);}})[_0x3603('0x16')](function(_0x1f4fcb){logger[_0x3603('0x11')](_0x3603('0xd'),_0xd6d5d7,_0x1f4fcb);_0x35f7ec(_0x1f4fcb);});});}exports[_0x3603('0x17')]=function(_0x532741){var _0x52f083=this;return new Promise(function(_0x24e4af,_0x47f67a){return db['SquareOdbc'][_0x3603('0x18')]({'raw':_0x532741[_0x3603('0x19')]?_0x532741['options'][_0x3603('0x1a')]===undefined?!![]:![]:!![],'where':_0x532741[_0x3603('0x19')]?_0x532741[_0x3603('0x19')][_0x3603('0x1b')]||null:null,'attributes':_0x532741[_0x3603('0x19')]?_0x532741[_0x3603('0x19')][_0x3603('0x1c')]||null:null,'include':_0x532741[_0x3603('0x19')]?_0x532741[_0x3603('0x19')][_0x3603('0x1d')]?_[_0x3603('0x1e')](_0x532741[_0x3603('0x19')][_0x3603('0x1d')],function(_0x456861){return{'model':db[_0x456861[_0x3603('0x1f')]],'as':_0x456861['as'],'attributes':_0x456861[_0x3603('0x1c')],'include':_0x456861['include']?_[_0x3603('0x1e')](_0x456861[_0x3603('0x1d')],function(_0xc20444){return{'model':db[_0xc20444[_0x3603('0x1f')]],'as':_0xc20444['as'],'attributes':_0xc20444[_0x3603('0x1c')],'include':_0xc20444[_0x3603('0x1d')]?_[_0x3603('0x1e')](_0xc20444[_0x3603('0x1d')],function(_0x759d1f){return{'model':db[_0x759d1f[_0x3603('0x1f')]],'as':_0x759d1f['as'],'attributes':_0x759d1f[_0x3603('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3603('0xc')](function(_0x1ec868){logger[_0x3603('0x20')](_0x3603('0x17'),_0x532741);logger[_0x3603('0xe')](_0x3603('0x17'),_0x532741,JSON[_0x3603('0x10')](_0x1ec868));_0x24e4af(_0x1ec868);})[_0x3603('0x16')](function(_0x4ce3d0){logger[_0x3603('0x11')](_0x3603('0x17'),_0x4ce3d0[_0x3603('0x13')],_0x532741);_0x47f67a(_0x52f083['error'](0x1f4,_0x4ce3d0[_0x3603('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 44790b8..a91bdb4 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 _0xd617=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','path'];(function(_0x405aea,_0x21cb59){var _0x5585e0=function(_0x51bc49){while(--_0x51bc49){_0x405aea['push'](_0x405aea['shift']());}};_0x5585e0(++_0x21cb59);}(_0xd617,0x197));var _0x7d61=function(_0x23eaf7,_0x314847){_0x23eaf7=_0x23eaf7-0x0;var _0x448018=_0xd617[_0x23eaf7];return _0x448018;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d61('0x0'));var timeout=require(_0x7d61('0x1'));var express=require(_0x7d61('0x2'));var router=express[_0x7d61('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d61('0x4'));var interaction=require(_0x7d61('0x5'));var config=require('../../config/environment');var controller=require(_0x7d61('0x6'));router[_0x7d61('0x7')]('/',auth[_0x7d61('0x8')](),controller[_0x7d61('0x9')]);router[_0x7d61('0x7')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller[_0x7d61('0xb')]);router[_0x7d61('0xc')]('/',auth[_0x7d61('0x8')](),controller['create']);router[_0x7d61('0xd')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller[_0x7d61('0xe')]);router[_0x7d61('0xf')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller['destroy']);module[_0x7d61('0x10')]=router; \ No newline at end of file +var _0x6f25=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x6f25,0x199));var _0x56f2=function(_0x1a0568,_0x16e5bc){_0x1a0568=_0x1a0568-0x0;var _0x593d78=_0x6f25[_0x1a0568];return _0x593d78;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x56f2('0x0'));var timeout=require(_0x56f2('0x1'));var express=require(_0x56f2('0x2'));var router=express[_0x56f2('0x3')]();var fs_extra=require(_0x56f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x56f2('0x5'));var config=require(_0x56f2('0x6'));var controller=require('./squareProject.controller');router[_0x56f2('0x7')]('/',auth[_0x56f2('0x8')](),controller[_0x56f2('0x9')]);router[_0x56f2('0x7')](_0x56f2('0xa'),auth[_0x56f2('0x8')](),controller[_0x56f2('0xb')]);router['post']('/',auth[_0x56f2('0x8')](),controller[_0x56f2('0xc')]);router[_0x56f2('0xd')]('/:id',auth[_0x56f2('0x8')](),controller[_0x56f2('0xe')]);router[_0x56f2('0xf')](_0x56f2('0xa'),auth[_0x56f2('0x8')](),controller[_0x56f2('0x10')]);module[_0x56f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8b49674..819ee58 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 _0xc1ec=['preproduction','utf8','production','toString','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x980531,_0x2667ad){var _0x447e42=function(_0x221792){while(--_0x221792){_0x980531['push'](_0x980531['shift']());}};_0x447e42(++_0x2667ad);}(_0xc1ec,0x13d));var _0xcc1e=function(_0x29621f,_0x59e7e1){_0x29621f=_0x29621f-0x0;var _0x54e0e5=_0xc1ec[_0x29621f];return _0x54e0e5;};'use strict';var Sequelize=require(_0xcc1e('0x0'));module[_0xcc1e('0x1')]={'name':{'type':Sequelize[_0xcc1e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcc1e('0x2')]},'notes':{'type':Sequelize[_0xcc1e('0x3')]},'preproduction':{'type':Sequelize[_0xcc1e('0x4')](_0xcc1e('0x5')),'get':function(){if(this[_0xcc1e('0x6')]('preproduction')){return this['getDataValue'](_0xcc1e('0x7'))['toString'](_0xcc1e('0x8'));}}},'production':{'type':Sequelize[_0xcc1e('0x4')](_0xcc1e('0x5')),'get':function(){if(this[_0xcc1e('0x6')](_0xcc1e('0x9'))){return this[_0xcc1e('0x6')](_0xcc1e('0x9'))[_0xcc1e('0xa')](_0xcc1e('0x8'));}}},'savedAt':{'type':Sequelize[_0xcc1e('0xb')]},'publishedAt':{'type':Sequelize[_0xcc1e('0xb')]}}; \ No newline at end of file +var _0x6ba7=['toString','production','utf8','DATE','exports','name','STRING','TEXT','BLOB','long','preproduction','getDataValue'];(function(_0x4e3b5e,_0x2548e6){var _0x10a8ce=function(_0x4f409c){while(--_0x4f409c){_0x4e3b5e['push'](_0x4e3b5e['shift']());}};_0x10a8ce(++_0x2548e6);}(_0x6ba7,0x94));var _0x76ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ba7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x76ba('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x76ba('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x76ba('0x2')]},'notes':{'type':Sequelize[_0x76ba('0x3')]},'preproduction':{'type':Sequelize[_0x76ba('0x4')](_0x76ba('0x5')),'get':function(){if(this['getDataValue'](_0x76ba('0x6'))){return this[_0x76ba('0x7')](_0x76ba('0x6'))[_0x76ba('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x76ba('0x4')](_0x76ba('0x5')),'get':function(){if(this[_0x76ba('0x7')](_0x76ba('0x9'))){return this[_0x76ba('0x7')](_0x76ba('0x9'))[_0x76ba('0x8')](_0x76ba('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x76ba('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 5731515..b4d3ac0 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 _0x3564=['production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','destroy','publish','agi','stringify','sendStatus','error','name','send','index','map','SquareProject','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1d54c4,_0x1fb650){var _0x51539c=function(_0x491438){while(--_0x491438){_0x1d54c4['push'](_0x1d54c4['shift']());}};_0x51539c(++_0x1fb650);}(_0x3564,0x87));var _0x4356=function(_0x24b571,_0x35517a){_0x24b571=_0x24b571-0x0;var _0x2da88f=_0x3564[_0x24b571];return _0x2da88f;};'use strict';var _=require(_0x4356('0x0'));var Redis=require(_0x4356('0x1'));var qs=require(_0x4356('0x2'));var logger=require(_0x4356('0x3'))(_0x4356('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4356('0x5')]=_[_0x4356('0x6')](config[_0x4356('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x4356('0x7'))(new Redis(config[_0x4356('0x5')]));require(_0x4356('0x8'))['register'](socket);function respondWithResult(_0x51f3db,_0x11a851){_0x11a851=_0x11a851||0xc8;return function(_0x3c37b4){if(_0x3c37b4){return _0x51f3db[_0x4356('0x9')](_0x11a851)[_0x4356('0xa')](_0x3c37b4);}};}function respondWithFilteredResult(_0x2354c0,_0x3cc77c){return function(_0x3fc95f){if(_0x3fc95f){var _0x6b5906=typeof _0x3cc77c[_0x4356('0xb')]===_0x4356('0xc')&&typeof _0x3cc77c[_0x4356('0xd')]===_0x4356('0xc');var _0x2e2b71=_0x3fc95f['count'];var _0x5561ba=_0x6b5906?0x0:_0x3cc77c[_0x4356('0xb')];var _0x3f7058=_0x6b5906?_0x3fc95f[_0x4356('0xe')]:_0x3cc77c[_0x4356('0xb')]+_0x3cc77c['limit'];var _0x2c3de5;if(_0x3f7058>=_0x2e2b71){_0x3f7058=_0x2e2b71;_0x2c3de5=0xc8;}else{_0x2c3de5=0xce;}_0x2354c0['status'](_0x2c3de5);return _0x2354c0[_0x4356('0xf')](_0x4356('0x10'),_0x5561ba+'-'+_0x3f7058+'/'+_0x2e2b71)[_0x4356('0xa')](_0x3fc95f);}return null;};}function saveUpdates(_0x1c136a){return function(_0xd817ab){if(_0xd817ab){return _0xd817ab[_0x4356('0x11')](_0x1c136a)[_0x4356('0x12')](function(_0x41a8c4){return _0x41a8c4;});}return null;};}function removeEntity(_0x3ad1ae){return function(_0x2317ae){if(_0x2317ae){return _0x2317ae['destroy']()[_0x4356('0x12')](function(){var _0x3f9a4b=_0x2317ae[_0x4356('0x13')]({'plain':!![]});var _0x3181da=_0x4356('0x14');return db['UserProfileResource'][_0x4356('0x15')]({'where':{'type':_0x3181da,'resourceId':_0x3f9a4b['id']}})[_0x4356('0x12')](function(){return _0x2317ae;});})['then'](function(){var _0x343d4a=new Redis(config[_0x4356('0x5')]);_0x343d4a[_0x4356('0x16')](_0x4356('0x17'),JSON[_0x4356('0x18')]({'id':_0x2317ae['id'],'deleted':!![]}));})[_0x4356('0x12')](function(){_0x3ad1ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d602){return function(_0x4bcb91){if(!_0x4bcb91){_0x57d602[_0x4356('0x19')](0x194);}return _0x4bcb91;};}function handleError(_0x1ed0de,_0x994c76){_0x994c76=_0x994c76||0x1f4;return function(_0x462806){logger[_0x4356('0x1a')](_0x462806['stack']);if(_0x462806[_0x4356('0x1b')]){delete _0x462806[_0x4356('0x1b')];}_0x1ed0de[_0x4356('0x9')](_0x994c76)[_0x4356('0x1c')](_0x462806);};}exports[_0x4356('0x1d')]=function(_0xe05f00,_0x442657){var _0x40dfb6={},_0x341acd={},_0x680e48={'count':0x0,'rows':[]};var _0x5654ac=_[_0x4356('0x1e')](db[_0x4356('0x1f')]['rawAttributes'],function(_0x2170f7){return{'name':_0x2170f7[_0x4356('0x20')],'type':_0x2170f7[_0x4356('0x21')][_0x4356('0x22')]};});_0x341acd['model']=_[_0x4356('0x1e')](_0x5654ac,'name');_0x341acd[_0x4356('0x23')]=_[_0x4356('0x24')](_0xe05f00['query']);_0x341acd[_0x4356('0x25')]=_[_0x4356('0x26')](_0x341acd['model'],_0x341acd[_0x4356('0x23')]);_0x40dfb6[_0x4356('0x27')]=_[_0x4356('0x26')](_0x341acd[_0x4356('0x28')],qs[_0x4356('0x29')](_0xe05f00['query']['fields']));_0x40dfb6['attributes']=_0x40dfb6['attributes'][_0x4356('0x2a')]?_0x40dfb6[_0x4356('0x27')]:_0x341acd['model'];if(!_0xe05f00['query'][_0x4356('0x2b')]('nolimit')){_0x40dfb6[_0x4356('0xd')]=qs[_0x4356('0xd')](_0xe05f00['query']['limit']);_0x40dfb6[_0x4356('0xb')]=qs[_0x4356('0xb')](_0xe05f00[_0x4356('0x23')]['offset']);}_0x40dfb6['order']=qs[_0x4356('0x2c')](_0xe05f00[_0x4356('0x23')][_0x4356('0x2c')]);_0x40dfb6[_0x4356('0x2d')]=qs['filters'](_[_0x4356('0x2e')](_0xe05f00[_0x4356('0x23')],_0x341acd[_0x4356('0x25')]),_0x5654ac);if(_0xe05f00['query'][_0x4356('0x2f')]){_0x40dfb6[_0x4356('0x2d')]=_[_0x4356('0x30')](_0x40dfb6[_0x4356('0x2d')],{'$or':_['map'](_0x5654ac,function(_0x3efc00){if(_0x3efc00[_0x4356('0x21')]!==_0x4356('0x31')){var _0x508d79={};_0x508d79[_0x3efc00[_0x4356('0x1b')]]={'$like':'%'+_0xe05f00[_0x4356('0x23')][_0x4356('0x2f')]+'%'};return _0x508d79;}})});}_0x40dfb6=_['merge']({},_0x40dfb6,_0xe05f00[_0x4356('0x32')]);var _0x3cc276={'where':_0x40dfb6[_0x4356('0x2d')]};return db[_0x4356('0x1f')][_0x4356('0xe')](_0x3cc276)['then'](function(_0x3ea48a){_0x680e48[_0x4356('0xe')]=_0x3ea48a;if(_0xe05f00[_0x4356('0x23')][_0x4356('0x33')]){_0x40dfb6[_0x4356('0x34')]=[{'all':!![]}];}return db[_0x4356('0x1f')]['findAll'](_0x40dfb6);})[_0x4356('0x12')](function(_0x4303a7){_0x680e48['rows']=_0x4303a7;return _0x680e48;})[_0x4356('0x12')](respondWithFilteredResult(_0x442657,_0x40dfb6))[_0x4356('0x35')](handleError(_0x442657,null));};exports['show']=function(_0x3bb7dc,_0x3626b0){var _0x4d3be4={'raw':![],'where':{'id':_0x3bb7dc[_0x4356('0x36')]['id']}},_0x403ff4={};_0x403ff4[_0x4356('0x28')]=_[_0x4356('0x24')](db[_0x4356('0x1f')][_0x4356('0x37')]);_0x403ff4['query']=_[_0x4356('0x24')](_0x3bb7dc[_0x4356('0x23')]);_0x403ff4[_0x4356('0x25')]=_['intersection'](_0x403ff4[_0x4356('0x28')],_0x403ff4[_0x4356('0x23')]);_0x4d3be4[_0x4356('0x27')]=_[_0x4356('0x26')](_0x403ff4['model'],qs[_0x4356('0x29')](_0x3bb7dc['query'][_0x4356('0x29')]));_0x4d3be4[_0x4356('0x27')]=_0x4d3be4['attributes'][_0x4356('0x2a')]?_0x4d3be4[_0x4356('0x27')]:_0x403ff4[_0x4356('0x28')];if(_0x3bb7dc[_0x4356('0x23')][_0x4356('0x33')]){_0x4d3be4[_0x4356('0x34')]=[{'all':!![]}];}_0x4d3be4=_[_0x4356('0x30')]({},_0x4d3be4,_0x3bb7dc[_0x4356('0x32')]);return db[_0x4356('0x1f')][_0x4356('0x38')](_0x4d3be4)[_0x4356('0x12')](handleEntityNotFound(_0x3626b0,null))['then'](respondWithResult(_0x3626b0,null))[_0x4356('0x35')](handleError(_0x3626b0,null));};exports['create']=function(_0x4ee983,_0x5d512d){return db['SquareProject'][_0x4356('0x39')](_0x4ee983[_0x4356('0x3a')],{})[_0x4356('0x12')](function(_0x4c5bad){var _0x5221c8=_0x4ee983['user'][_0x4356('0x13')]({'plain':!![]});if(!_0x5221c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5221c8[_0x4356('0x3b')]===_0x4356('0x3c')){var _0x234ea1=_0x4c5bad['get']({'plain':!![]});var _0x40566d=_0x4356('0x14');return db[_0x4356('0x3d')]['find']({'where':{'name':_0x40566d,'userProfileId':_0x5221c8[_0x4356('0x3e')]},'raw':!![]})['then'](function(_0x25cacb){if(_0x25cacb&&_0x25cacb[_0x4356('0x3f')]===0x0){return db[_0x4356('0x40')]['create']({'name':_0x234ea1['name'],'resourceId':_0x234ea1['id'],'type':_0x25cacb[_0x4356('0x1b')],'sectionId':_0x25cacb['id']},{})[_0x4356('0x12')](function(){return _0x4c5bad;});}else{return _0x4c5bad;}})['catch'](function(_0x3c6a4e){logger['error'](_0x4356('0x41'),_0x3c6a4e);throw _0x3c6a4e;});}return _0x4c5bad;})[_0x4356('0x12')](respondWithResult(_0x5d512d,0xc9))[_0x4356('0x35')](handleError(_0x5d512d,null));};exports[_0x4356('0x11')]=function(_0x42a27d,_0x574559){if(_0x42a27d[_0x4356('0x3a')]['id']){delete _0x42a27d[_0x4356('0x3a')]['id'];}return db[_0x4356('0x1f')][_0x4356('0x38')]({'where':{'id':_0x42a27d[_0x4356('0x36')]['id']}})['then'](handleEntityNotFound(_0x574559,null))[_0x4356('0x12')](saveUpdates(_0x42a27d[_0x4356('0x3a')],null))[_0x4356('0x12')](function(_0x524f41){if(!_0x524f41)return;var _0x541e05=_0x524f41[_0x4356('0x13')]({'plain':!![]});return _0x541e05;})[_0x4356('0x12')](function(_0xa134a1){var _0x4c35d9=new Redis(config['redis']);_0x4c35d9['publish'](_0x4356('0x17'),JSON[_0x4356('0x18')](_[_0x4356('0x2e')](_0xa134a1,['id',_0x4356('0x1b'),_0x4356('0x42')])));return _0xa134a1;})[_0x4356('0x12')](respondWithResult(_0x574559,null))[_0x4356('0x35')](handleError(_0x574559,null));};exports[_0x4356('0x15')]=function(_0x453fc9,_0x209aa8){return db[_0x4356('0x1f')][_0x4356('0x38')]({'where':{'id':_0x453fc9[_0x4356('0x36')]['id']}})[_0x4356('0x12')](handleEntityNotFound(_0x209aa8,null))[_0x4356('0x12')](removeEntity(_0x209aa8,null))[_0x4356('0x35')](handleError(_0x209aa8,null));}; \ No newline at end of file +var _0xc3ed=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','pick','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','SquareProject','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0xc3ed,0x16f));var _0xdc3e=function(_0x6cfbf7,_0x374cbb){_0x6cfbf7=_0x6cfbf7-0x0;var _0x407dd1=_0xc3ed[_0x6cfbf7];return _0x407dd1;};'use strict';var _=require(_0xdc3e('0x0'));var Redis=require(_0xdc3e('0x1'));var qs=require(_0xdc3e('0x2'));var logger=require(_0xdc3e('0x3'))(_0xdc3e('0x4'));var config=require(_0xdc3e('0x5'));var db=require('../../mysqldb')['db'];config[_0xdc3e('0x6')]=_['defaults'](config[_0xdc3e('0x6')],{'host':_0xdc3e('0x7'),'port':0x18eb});var socket=require(_0xdc3e('0x8'))(new Redis(config[_0xdc3e('0x6')]));require(_0xdc3e('0x9'))['register'](socket);function respondWithResult(_0x232072,_0xbaa910){_0xbaa910=_0xbaa910||0xc8;return function(_0x1730ef){if(_0x1730ef){return _0x232072[_0xdc3e('0xa')](_0xbaa910)[_0xdc3e('0xb')](_0x1730ef);}};}function respondWithFilteredResult(_0x13e1a2,_0x501d19){return function(_0xf7bfb7){if(_0xf7bfb7){var _0x2d7220=typeof _0x501d19[_0xdc3e('0xc')]===_0xdc3e('0xd')&&typeof _0x501d19['limit']==='undefined';var _0x1ae507=_0xf7bfb7['count'];var _0x2ae542=_0x2d7220?0x0:_0x501d19[_0xdc3e('0xc')];var _0x41c6f5=_0x2d7220?_0xf7bfb7[_0xdc3e('0xe')]:_0x501d19[_0xdc3e('0xc')]+_0x501d19[_0xdc3e('0xf')];var _0x516e3d;if(_0x41c6f5>=_0x1ae507){_0x41c6f5=_0x1ae507;_0x516e3d=0xc8;}else{_0x516e3d=0xce;}_0x13e1a2['status'](_0x516e3d);return _0x13e1a2[_0xdc3e('0x10')](_0xdc3e('0x11'),_0x2ae542+'-'+_0x41c6f5+'/'+_0x1ae507)[_0xdc3e('0xb')](_0xf7bfb7);}return null;};}function saveUpdates(_0x430ea2){return function(_0x42d0e5){if(_0x42d0e5){return _0x42d0e5[_0xdc3e('0x12')](_0x430ea2)[_0xdc3e('0x13')](function(_0x143532){return _0x143532;});}return null;};}function removeEntity(_0x3a74b2){return function(_0x988f1){if(_0x988f1){return _0x988f1['destroy']()[_0xdc3e('0x13')](function(){var _0x3d0b14=_0x988f1[_0xdc3e('0x14')]({'plain':!![]});var _0xcd7c17='SquareProjects';return db[_0xdc3e('0x15')][_0xdc3e('0x16')]({'where':{'type':_0xcd7c17,'resourceId':_0x3d0b14['id']}})['then'](function(){return _0x988f1;});})[_0xdc3e('0x13')](function(){var _0x456518=new Redis(config[_0xdc3e('0x6')]);_0x456518[_0xdc3e('0x17')](_0xdc3e('0x18'),JSON[_0xdc3e('0x19')]({'id':_0x988f1['id'],'deleted':!![]}));})['then'](function(){_0x3a74b2['status'](0xcc)[_0xdc3e('0x1a')]();});}};}function handleEntityNotFound(_0x5f49ca){return function(_0x2424ac){if(!_0x2424ac){_0x5f49ca[_0xdc3e('0x1b')](0x194);}return _0x2424ac;};}function handleError(_0x2b5895,_0xd8402b){_0xd8402b=_0xd8402b||0x1f4;return function(_0x47e1e7){logger[_0xdc3e('0x1c')](_0x47e1e7[_0xdc3e('0x1d')]);if(_0x47e1e7['name']){delete _0x47e1e7[_0xdc3e('0x1e')];}_0x2b5895[_0xdc3e('0xa')](_0xd8402b)['send'](_0x47e1e7);};}exports[_0xdc3e('0x1f')]=function(_0x26e65f,_0x5d76cc){var _0x3ca11d={},_0x16d3b0={},_0x3c93d7={'count':0x0,'rows':[]};var _0x28e65c=_[_0xdc3e('0x20')](db['SquareProject'][_0xdc3e('0x21')],function(_0x1feefd){return{'name':_0x1feefd['fieldName'],'type':_0x1feefd[_0xdc3e('0x22')][_0xdc3e('0x23')]};});_0x16d3b0[_0xdc3e('0x24')]=_[_0xdc3e('0x20')](_0x28e65c,_0xdc3e('0x1e'));_0x16d3b0[_0xdc3e('0x25')]=_[_0xdc3e('0x26')](_0x26e65f['query']);_0x16d3b0[_0xdc3e('0x27')]=_[_0xdc3e('0x28')](_0x16d3b0[_0xdc3e('0x24')],_0x16d3b0['query']);_0x3ca11d[_0xdc3e('0x29')]=_['intersection'](_0x16d3b0[_0xdc3e('0x24')],qs[_0xdc3e('0x2a')](_0x26e65f[_0xdc3e('0x25')][_0xdc3e('0x2a')]));_0x3ca11d['attributes']=_0x3ca11d[_0xdc3e('0x29')][_0xdc3e('0x2b')]?_0x3ca11d['attributes']:_0x16d3b0[_0xdc3e('0x24')];if(!_0x26e65f[_0xdc3e('0x25')]['hasOwnProperty'](_0xdc3e('0x2c'))){_0x3ca11d[_0xdc3e('0xf')]=qs['limit'](_0x26e65f['query'][_0xdc3e('0xf')]);_0x3ca11d[_0xdc3e('0xc')]=qs['offset'](_0x26e65f[_0xdc3e('0x25')]['offset']);}_0x3ca11d['order']=qs[_0xdc3e('0x2d')](_0x26e65f['query']['sort']);_0x3ca11d[_0xdc3e('0x2e')]=qs['filters'](_['pick'](_0x26e65f[_0xdc3e('0x25')],_0x16d3b0[_0xdc3e('0x27')]),_0x28e65c);if(_0x26e65f['query'][_0xdc3e('0x2f')]){_0x3ca11d[_0xdc3e('0x2e')]=_[_0xdc3e('0x30')](_0x3ca11d[_0xdc3e('0x2e')],{'$or':_[_0xdc3e('0x20')](_0x28e65c,function(_0x5090da){if(_0x5090da['type']!==_0xdc3e('0x31')){var _0x50595a={};_0x50595a[_0x5090da['name']]={'$like':'%'+_0x26e65f[_0xdc3e('0x25')]['filter']+'%'};return _0x50595a;}})});}_0x3ca11d=_['merge']({},_0x3ca11d,_0x26e65f[_0xdc3e('0x32')]);var _0x3ceed9={'where':_0x3ca11d[_0xdc3e('0x2e')]};return db[_0xdc3e('0x33')][_0xdc3e('0xe')](_0x3ceed9)[_0xdc3e('0x13')](function(_0xa44134){_0x3c93d7[_0xdc3e('0xe')]=_0xa44134;if(_0x26e65f[_0xdc3e('0x25')][_0xdc3e('0x34')]){_0x3ca11d['include']=[{'all':!![]}];}return db['SquareProject'][_0xdc3e('0x35')](_0x3ca11d);})[_0xdc3e('0x13')](function(_0x2b735f){_0x3c93d7[_0xdc3e('0x36')]=_0x2b735f;return _0x3c93d7;})['then'](respondWithFilteredResult(_0x5d76cc,_0x3ca11d))[_0xdc3e('0x37')](handleError(_0x5d76cc,null));};exports[_0xdc3e('0x38')]=function(_0x153e85,_0x1f5b06){var _0x506766={'raw':![],'where':{'id':_0x153e85[_0xdc3e('0x39')]['id']}},_0x3704d6={};_0x3704d6[_0xdc3e('0x24')]=_['keys'](db['SquareProject']['rawAttributes']);_0x3704d6[_0xdc3e('0x25')]=_[_0xdc3e('0x26')](_0x153e85[_0xdc3e('0x25')]);_0x3704d6[_0xdc3e('0x27')]=_[_0xdc3e('0x28')](_0x3704d6[_0xdc3e('0x24')],_0x3704d6[_0xdc3e('0x25')]);_0x506766['attributes']=_[_0xdc3e('0x28')](_0x3704d6[_0xdc3e('0x24')],qs[_0xdc3e('0x2a')](_0x153e85['query'][_0xdc3e('0x2a')]));_0x506766[_0xdc3e('0x29')]=_0x506766[_0xdc3e('0x29')]['length']?_0x506766[_0xdc3e('0x29')]:_0x3704d6[_0xdc3e('0x24')];if(_0x153e85['query'][_0xdc3e('0x34')]){_0x506766[_0xdc3e('0x3a')]=[{'all':!![]}];}_0x506766=_[_0xdc3e('0x30')]({},_0x506766,_0x153e85[_0xdc3e('0x32')]);return db[_0xdc3e('0x33')][_0xdc3e('0x3b')](_0x506766)[_0xdc3e('0x13')](handleEntityNotFound(_0x1f5b06,null))[_0xdc3e('0x13')](respondWithResult(_0x1f5b06,null))['catch'](handleError(_0x1f5b06,null));};exports[_0xdc3e('0x3c')]=function(_0x2ca5c6,_0x208dfa){return db['SquareProject'][_0xdc3e('0x3c')](_0x2ca5c6['body'],{})[_0xdc3e('0x13')](function(_0x25bbdb){var _0x5eb0a6=_0x2ca5c6[_0xdc3e('0x3d')]['get']({'plain':!![]});if(!_0x5eb0a6)throw new Error(_0xdc3e('0x3e'));if(_0x5eb0a6[_0xdc3e('0x3f')]===_0xdc3e('0x3d')){var _0x486389=_0x25bbdb[_0xdc3e('0x14')]({'plain':!![]});var _0x50eb0e=_0xdc3e('0x40');return db[_0xdc3e('0x41')][_0xdc3e('0x3b')]({'where':{'name':_0x50eb0e,'userProfileId':_0x5eb0a6[_0xdc3e('0x42')]},'raw':!![]})[_0xdc3e('0x13')](function(_0x3421d2){if(_0x3421d2&&_0x3421d2[_0xdc3e('0x43')]===0x0){return db[_0xdc3e('0x15')][_0xdc3e('0x3c')]({'name':_0x486389['name'],'resourceId':_0x486389['id'],'type':_0x3421d2[_0xdc3e('0x1e')],'sectionId':_0x3421d2['id']},{})['then'](function(){return _0x25bbdb;});}else{return _0x25bbdb;}})[_0xdc3e('0x37')](function(_0x66eba7){logger['error'](_0xdc3e('0x44'),_0x66eba7);throw _0x66eba7;});}return _0x25bbdb;})[_0xdc3e('0x13')](respondWithResult(_0x208dfa,0xc9))['catch'](handleError(_0x208dfa,null));};exports[_0xdc3e('0x12')]=function(_0x2877af,_0x2e9493){if(_0x2877af[_0xdc3e('0x45')]['id']){delete _0x2877af[_0xdc3e('0x45')]['id'];}return db[_0xdc3e('0x33')][_0xdc3e('0x3b')]({'where':{'id':_0x2877af[_0xdc3e('0x39')]['id']}})[_0xdc3e('0x13')](handleEntityNotFound(_0x2e9493,null))[_0xdc3e('0x13')](saveUpdates(_0x2877af[_0xdc3e('0x45')],null))[_0xdc3e('0x13')](function(_0x40c1e7){if(!_0x40c1e7)return;var _0x48c5ce=_0x40c1e7[_0xdc3e('0x14')]({'plain':!![]});return _0x48c5ce;})[_0xdc3e('0x13')](function(_0x2d79b6){var _0xc70991=new Redis(config['redis']);_0xc70991['publish'](_0xdc3e('0x18'),JSON['stringify'](_[_0xdc3e('0x46')](_0x2d79b6,['id',_0xdc3e('0x1e'),_0xdc3e('0x47')])));return _0x2d79b6;})['then'](respondWithResult(_0x2e9493,null))[_0xdc3e('0x37')](handleError(_0x2e9493,null));};exports['destroy']=function(_0x595767,_0x4eb461){return db[_0xdc3e('0x33')][_0xdc3e('0x3b')]({'where':{'id':_0x595767[_0xdc3e('0x39')]['id']}})['then'](handleEntityNotFound(_0x4eb461,null))['then'](removeEntity(_0x4eb461,null))[_0xdc3e('0x37')](handleError(_0x4eb461,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5a7fb5f..a3a348d 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 _0x03b1=['SquareProject','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3a18f3,_0xa6b079){var _0x431120=function(_0x3ce96e){while(--_0x3ce96e){_0x3a18f3['push'](_0x3a18f3['shift']());}};_0x431120(++_0xa6b079);}(_0x03b1,0xdf));var _0x103b=function(_0x6d9060,_0x2e7efb){_0x6d9060=_0x6d9060-0x0;var _0xd9145=_0x03b1[_0x6d9060];return _0xd9145;};'use strict';var EventEmitter=require(_0x103b('0x0'));var SquareProject=require(_0x103b('0x1'))['db'][_0x103b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x103b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x103b('0x4'),'afterDestroy':_0x103b('0x5')};function emitEvent(_0x2be8fd){return function(_0x47ff41,_0x38722a,_0x2627dd){SquareProjectEvents['emit'](_0x2be8fd+':'+_0x47ff41['id'],_0x47ff41);SquareProjectEvents[_0x103b('0x6')](_0x2be8fd,_0x47ff41);_0x2627dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x103b('0x7')](e,emitEvent(event));}}module[_0x103b('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x9a76=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','SquareProject'];(function(_0x3f5e6e,_0x274084){var _0x30fdfb=function(_0x1c745b){while(--_0x1c745b){_0x3f5e6e['push'](_0x3f5e6e['shift']());}};_0x30fdfb(++_0x274084);}(_0x9a76,0x180));var _0x69a7=function(_0x437fcb,_0x584ef0){_0x437fcb=_0x437fcb-0x0;var _0x10e0b1=_0x9a76[_0x437fcb];return _0x10e0b1;};'use strict';var EventEmitter=require(_0x69a7('0x0'));var SquareProject=require(_0x69a7('0x1'))['db'][_0x69a7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x69a7('0x3')](0x0);var events={'afterCreate':_0x69a7('0x4'),'afterUpdate':_0x69a7('0x5'),'afterDestroy':_0x69a7('0x6')};function emitEvent(_0x34f7c9){return function(_0x4a6fc3,_0x5ef4f8,_0x49e17e){SquareProjectEvents[_0x69a7('0x7')](_0x34f7c9+':'+_0x4a6fc3['id'],_0x4a6fc3);SquareProjectEvents[_0x69a7('0x7')](_0x34f7c9,_0x4a6fc3);_0x49e17e(null);};}for(var e in events){if(events[_0x69a7('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 47e6208..b596228 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 _0x1a7a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util'];(function(_0x182339,_0x275d88){var _0x7b27d=function(_0x54a080){while(--_0x54a080){_0x182339['push'](_0x182339['shift']());}};_0x7b27d(++_0x275d88);}(_0x1a7a,0x1ca));var _0xa1a7=function(_0x51f40e,_0x14e8ea){_0x51f40e=_0x51f40e-0x0;var _0xb37761=_0x1a7a[_0x51f40e];return _0xb37761;};'use strict';var _=require('lodash');var util=require(_0xa1a7('0x0'));var logger=require('../../config/logger')(_0xa1a7('0x1'));var moment=require(_0xa1a7('0x2'));var BPromise=require(_0xa1a7('0x3'));var rp=require(_0xa1a7('0x4'));var fs=require('fs');var path=require(_0xa1a7('0x5'));var rimraf=require(_0xa1a7('0x6'));var config=require(_0xa1a7('0x7'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x232eb4,_0x1a7021){return _0x232eb4[_0xa1a7('0x8')](_0xa1a7('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4603ed,_0x12e9f5,_0x5d8284){if(_0x4603ed[_0xa1a7('0xa')](_0xa1a7('0xb'))){_0x4603ed[_0xa1a7('0xc')]=moment()['format'](_0xa1a7('0xd'));}if(_0x4603ed['changed'](_0xa1a7('0xe'))){_0x4603ed[_0xa1a7('0xf')]=moment()[_0xa1a7('0x10')](_0xa1a7('0xd'));}_0x5d8284(null,_0x4603ed);}}});}; \ No newline at end of file +var _0xe062=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','savedAt','changed','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x17742b,_0x353a22){var _0x42e121=function(_0x3bcd16){while(--_0x3bcd16){_0x17742b['push'](_0x17742b['shift']());}};_0x42e121(++_0x353a22);}(_0xe062,0x17b));var _0x2e06=function(_0x7c232,_0x2f8405){_0x7c232=_0x7c232-0x0;var _0x169bd2=_0xe062[_0x7c232];return _0x169bd2;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var logger=require(_0x2e06('0x2'))('api');var moment=require(_0x2e06('0x3'));var BPromise=require(_0x2e06('0x4'));var rp=require(_0x2e06('0x5'));var fs=require('fs');var path=require(_0x2e06('0x6'));var rimraf=require(_0x2e06('0x7'));var config=require(_0x2e06('0x8'));var attributes=require(_0x2e06('0x9'));module[_0x2e06('0xa')]=function(_0x22f776,_0x292fe9){return _0x22f776['define'](_0x2e06('0xb'),attributes,{'tableName':_0x2e06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf46a9e,_0xd68e3b,_0x48c25b){if(_0xf46a9e['changed']('preproduction')){_0xf46a9e[_0x2e06('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0xf46a9e[_0x2e06('0xe')](_0x2e06('0xf'))){_0xf46a9e[_0x2e06('0x10')]=moment()[_0x2e06('0x11')](_0x2e06('0x12'));}_0x48c25b(null,_0xf46a9e);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index cccc6ee..d0da10f 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 _0xc8d6=['limit','include','map','model','then','info','GetSquareProjects','catch','error','ShowSquareProject','find','raw','debug','stringify','message','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','findAll','options','where','attributes'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xc8d6,0x87));var _0x6c8d=function(_0xbc1ba5,_0x4d119d){_0xbc1ba5=_0xbc1ba5-0x0;var _0x58e822=_0xc8d6[_0xbc1ba5];return _0x58e822;};'use strict';var _=require('lodash');var Redis=require(_0x6c8d('0x0'));var db=require(_0x6c8d('0x1'))['db'];var logger=require(_0x6c8d('0x2'))(_0x6c8d('0x3'));var config=require(_0x6c8d('0x4'));config['redis']=_[_0x6c8d('0x5')](config['redis'],{'host':_0x6c8d('0x6'),'port':0x18eb});var socket=require(_0x6c8d('0x7'))(new Redis(config[_0x6c8d('0x8')]));require(_0x6c8d('0x9'))[_0x6c8d('0xa')](socket);exports['GetSquareProjects']=function(_0x52b288){var _0x382668=this;return new Promise(function(_0x1c0390,_0xb22288){return db['SquareProject'][_0x6c8d('0xb')]({'raw':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0xd')]||null:null,'attributes':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0xe')]||null:null,'limit':_0x52b288[_0x6c8d('0xc')]?_0x52b288['options'][_0x6c8d('0xf')]||null:null,'include':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0x52b288['options'][_0x6c8d('0x10')],function(_0xf2bec1){return{'model':db[_0xf2bec1[_0x6c8d('0x12')]],'as':_0xf2bec1['as'],'attributes':_0xf2bec1[_0x6c8d('0xe')],'include':_0xf2bec1[_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0xf2bec1[_0x6c8d('0x10')],function(_0x73319f){return{'model':db[_0x73319f[_0x6c8d('0x12')]],'as':_0x73319f['as'],'attributes':_0x73319f[_0x6c8d('0xe')],'include':_0x73319f[_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0x73319f[_0x6c8d('0x10')],function(_0x2774c8){return{'model':db[_0x2774c8[_0x6c8d('0x12')]],'as':_0x2774c8['as'],'attributes':_0x2774c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c8d('0x13')](function(_0x351d10){logger[_0x6c8d('0x14')](_0x6c8d('0x15'),_0x52b288);logger['debug'](_0x6c8d('0x15'),_0x52b288,JSON['stringify'](_0x351d10));_0x1c0390(_0x351d10);})[_0x6c8d('0x16')](function(_0x430081){logger[_0x6c8d('0x17')](_0x6c8d('0x15'),_0x430081['message'],_0x52b288);_0xb22288(_0x382668[_0x6c8d('0x17')](0x1f4,_0x430081['message']));});});};exports[_0x6c8d('0x18')]=function(_0x47320c){var _0x1025dd=this;return new Promise(function(_0x4bb339,_0x3d3b47){return db['SquareProject'][_0x6c8d('0x19')]({'raw':_0x47320c[_0x6c8d('0xc')]?_0x47320c['options'][_0x6c8d('0x1a')]===undefined?!![]:![]:!![],'where':_0x47320c[_0x6c8d('0xc')]?_0x47320c['options'][_0x6c8d('0xd')]||null:null,'attributes':_0x47320c[_0x6c8d('0xc')]?_0x47320c[_0x6c8d('0xc')][_0x6c8d('0xe')]||null:null,'include':_0x47320c[_0x6c8d('0xc')]?_0x47320c[_0x6c8d('0xc')]['include']?_['map'](_0x47320c[_0x6c8d('0xc')]['include'],function(_0x324885){return{'model':db[_0x324885[_0x6c8d('0x12')]],'as':_0x324885['as'],'attributes':_0x324885['attributes'],'include':_0x324885['include']?_[_0x6c8d('0x11')](_0x324885[_0x6c8d('0x10')],function(_0x5b3ae6){return{'model':db[_0x5b3ae6[_0x6c8d('0x12')]],'as':_0x5b3ae6['as'],'attributes':_0x5b3ae6[_0x6c8d('0xe')],'include':_0x5b3ae6[_0x6c8d('0x10')]?_['map'](_0x5b3ae6[_0x6c8d('0x10')],function(_0x1d4673){return{'model':db[_0x1d4673[_0x6c8d('0x12')]],'as':_0x1d4673['as'],'attributes':_0x1d4673[_0x6c8d('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x129c4c){logger['info']('ShowSquareProject',_0x47320c);logger[_0x6c8d('0x1b')](_0x6c8d('0x18'),_0x47320c,JSON[_0x6c8d('0x1c')](_0x129c4c));_0x4bb339(_0x129c4c);})[_0x6c8d('0x16')](function(_0x541378){logger[_0x6c8d('0x17')](_0x6c8d('0x18'),_0x541378[_0x6c8d('0x1d')],_0x47320c);_0x3d3b47(_0x1025dd['error'](0x1f4,_0x541378['message']));});});}; \ No newline at end of file +var _0xbfd4=['include','map','model','then','info','error','message','ShowSquareProject','SquareProject','find','raw','debug','stringify','catch','../../mysqldb','redis','./squareProject.socket','GetSquareProjects','findAll','options','where','attributes'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xbfd4,0x116));var _0x4bfd=function(_0x165b11,_0x13a822){_0x165b11=_0x165b11-0x0;var _0x2f71ec=_0xbfd4[_0x165b11];return _0x2f71ec;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0x4bfd('0x0'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config['redis']=_['defaults'](config[_0x4bfd('0x1')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4bfd('0x1')]));require(_0x4bfd('0x2'))['register'](socket);exports[_0x4bfd('0x3')]=function(_0x2b40e3){var _0x2289d7=this;return new Promise(function(_0x33dfcd,_0xa974cd){return db['SquareProject'][_0x4bfd('0x4')]({'raw':_0x2b40e3['options']?_0x2b40e3[_0x4bfd('0x5')]['raw']===undefined?!![]:![]:!![],'where':_0x2b40e3['options']?_0x2b40e3[_0x4bfd('0x5')][_0x4bfd('0x6')]||null:null,'attributes':_0x2b40e3[_0x4bfd('0x5')]?_0x2b40e3[_0x4bfd('0x5')][_0x4bfd('0x7')]||null:null,'limit':_0x2b40e3[_0x4bfd('0x5')]?_0x2b40e3[_0x4bfd('0x5')]['limit']||null:null,'include':_0x2b40e3['options']?_0x2b40e3['options'][_0x4bfd('0x8')]?_[_0x4bfd('0x9')](_0x2b40e3[_0x4bfd('0x5')][_0x4bfd('0x8')],function(_0x4ba3fe){return{'model':db[_0x4ba3fe[_0x4bfd('0xa')]],'as':_0x4ba3fe['as'],'attributes':_0x4ba3fe[_0x4bfd('0x7')],'include':_0x4ba3fe[_0x4bfd('0x8')]?_[_0x4bfd('0x9')](_0x4ba3fe['include'],function(_0x200d02){return{'model':db[_0x200d02[_0x4bfd('0xa')]],'as':_0x200d02['as'],'attributes':_0x200d02[_0x4bfd('0x7')],'include':_0x200d02[_0x4bfd('0x8')]?_[_0x4bfd('0x9')](_0x200d02[_0x4bfd('0x8')],function(_0xabbb06){return{'model':db[_0xabbb06['model']],'as':_0xabbb06['as'],'attributes':_0xabbb06[_0x4bfd('0x7')]};}):[]};}):[]};}):[]:[]})[_0x4bfd('0xb')](function(_0x14e164){logger[_0x4bfd('0xc')](_0x4bfd('0x3'),_0x2b40e3);logger['debug'](_0x4bfd('0x3'),_0x2b40e3,JSON['stringify'](_0x14e164));_0x33dfcd(_0x14e164);})['catch'](function(_0x1fe9c2){logger[_0x4bfd('0xd')](_0x4bfd('0x3'),_0x1fe9c2['message'],_0x2b40e3);_0xa974cd(_0x2289d7[_0x4bfd('0xd')](0x1f4,_0x1fe9c2[_0x4bfd('0xe')]));});});};exports[_0x4bfd('0xf')]=function(_0x226dca){var _0x8d16b6=this;return new Promise(function(_0x3a7c3b,_0x113f56){return db[_0x4bfd('0x10')][_0x4bfd('0x11')]({'raw':_0x226dca[_0x4bfd('0x5')]?_0x226dca[_0x4bfd('0x5')][_0x4bfd('0x12')]===undefined?!![]:![]:!![],'where':_0x226dca[_0x4bfd('0x5')]?_0x226dca[_0x4bfd('0x5')][_0x4bfd('0x6')]||null:null,'attributes':_0x226dca[_0x4bfd('0x5')]?_0x226dca[_0x4bfd('0x5')][_0x4bfd('0x7')]||null:null,'include':_0x226dca[_0x4bfd('0x5')]?_0x226dca['options']['include']?_[_0x4bfd('0x9')](_0x226dca[_0x4bfd('0x5')]['include'],function(_0x3120e5){return{'model':db[_0x3120e5[_0x4bfd('0xa')]],'as':_0x3120e5['as'],'attributes':_0x3120e5['attributes'],'include':_0x3120e5[_0x4bfd('0x8')]?_['map'](_0x3120e5[_0x4bfd('0x8')],function(_0x1f3da8){return{'model':db[_0x1f3da8[_0x4bfd('0xa')]],'as':_0x1f3da8['as'],'attributes':_0x1f3da8['attributes'],'include':_0x1f3da8[_0x4bfd('0x8')]?_[_0x4bfd('0x9')](_0x1f3da8['include'],function(_0x36cf64){return{'model':db[_0x36cf64[_0x4bfd('0xa')]],'as':_0x36cf64['as'],'attributes':_0x36cf64[_0x4bfd('0x7')]};}):[]};}):[]};}):[]:[]})[_0x4bfd('0xb')](function(_0xe3fda3){logger['info'](_0x4bfd('0xf'),_0x226dca);logger[_0x4bfd('0x13')]('ShowSquareProject',_0x226dca,JSON[_0x4bfd('0x14')](_0xe3fda3));_0x3a7c3b(_0xe3fda3);})[_0x4bfd('0x15')](function(_0x5be19a){logger[_0x4bfd('0xd')](_0x4bfd('0xf'),_0x5be19a['message'],_0x226dca);_0x113f56(_0x8d16b6[_0x4bfd('0xd')](0x1f4,_0x5be19a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index c5e951e..0f2c533 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 _0x8949=['length','squareProject:','update','emit','removeListener','register'];(function(_0x45c2ea,_0x3d157c){var _0x37886a=function(_0x8572d9){while(--_0x8572d9){_0x45c2ea['push'](_0x45c2ea['shift']());}};_0x37886a(++_0x3d157c);}(_0x8949,0x92));var _0x9894=function(_0x1adb5d,_0x1e36cc){_0x1adb5d=_0x1adb5d-0x0;var _0x3acc58=_0x8949[_0x1adb5d];return _0x3acc58;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x9894('0x0')];function createListener(_0x126926,_0x4fb90e){return function(_0x4463c8){_0x4fb90e[_0x9894('0x1')](_0x126926,_0x4463c8);};}function removeListener(_0x22911c,_0x353541){return function(){SquareProjectEvents[_0x9894('0x2')](_0x22911c,_0x353541);};}exports[_0x9894('0x3')]=function(_0x380218){for(var _0x1520e9=0x0,_0x59b7ad=events[_0x9894('0x4')];_0x1520e9<_0x59b7ad;_0x1520e9++){var _0xb6ca8e=events[_0x1520e9];var _0x226d56=createListener(_0x9894('0x5')+_0xb6ca8e,_0x380218);SquareProjectEvents['on'](_0xb6ca8e,_0x226d56);}}; \ No newline at end of file +var _0x5795=['./squareProject.events','removeListener','length','squareProject:'];(function(_0x3e8d09,_0x5c8cd1){var _0x413bbc=function(_0x2c9f73){while(--_0x2c9f73){_0x3e8d09['push'](_0x3e8d09['shift']());}};_0x413bbc(++_0x5c8cd1);}(_0x5795,0xc4));var _0x5579=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x5795[_0x23e7c1];return _0x1add43;};'use strict';var SquareProjectEvents=require(_0x5579('0x0'));var events=['save','remove','update'];function createListener(_0x46d3eb,_0x1a4a18){return function(_0x4c3bdf){_0x1a4a18['emit'](_0x46d3eb,_0x4c3bdf);};}function removeListener(_0x8a1fad,_0x21fdc0){return function(){SquareProjectEvents[_0x5579('0x1')](_0x8a1fad,_0x21fdc0);};}exports['register']=function(_0x40b23d){for(var _0x2db7c6=0x0,_0xb3a056=events[_0x5579('0x2')];_0x2db7c6<_0xb3a056;_0x2db7c6++){var _0x21490c=events[_0x2db7c6];var _0x3e2780=createListener(_0x5579('0x3')+_0x21490c,_0x40b23d);SquareProjectEvents['on'](_0x21490c,_0x3e2780);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 874d156..c04622b 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x428f1a,_0x23b323){var _0xf9165c=function(_0x42be66){while(--_0x42be66){_0x428f1a['push'](_0x428f1a['shift']());}};_0xf9165c(++_0x23b323);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x25d273,_0x573026){var _0x222c5a=function(_0x5606f8){while(--_0x5606f8){_0x25d273['push'](_0x25d273['shift']());}};_0x222c5a(++_0x573026);}(_0x814b,0x1a2));var _0xb814=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x814b[_0x34d346];return _0x122d76;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f3df8cc..44f736f 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 _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x30fc63,_0x456284){var _0x43d2ce=function(_0x1800a8){while(--_0x1800a8){_0x30fc63['push'](_0x30fc63['shift']());}};_0x43d2ce(++_0x456284);}(_0xac31,0xca));var _0x1ac3=function(_0x5a3416,_0x52e028){_0x5a3416=_0x5a3416-0x0;var _0x36fe00=_0xac31[_0x5a3416];return _0x36fe00;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xabce,0x103));var _0xeabc=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xabce[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 62aae65..32c0d7f 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 _0x47c9=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','save','update','then','end','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','count','includeAll','include','rows','show','find','catch','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x111068,_0x4e1daf){var _0x1670c4=function(_0x55d110){while(--_0x55d110){_0x111068['push'](_0x111068['shift']());}};_0x1670c4(++_0x4e1daf);}(_0x47c9,0x1d1));var _0x947c=function(_0x4cf19f,_0x593a2e){_0x4cf19f=_0x4cf19f-0x0;var _0x1224ce=_0x47c9[_0x4cf19f];return _0x1224ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x947c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x947c('0x1'));var rp=require('request-promise');var moment=require(_0x947c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x947c('0x3'));var util=require(_0x947c('0x4'));var path=require(_0x947c('0x5'));var sox=require(_0x947c('0x6'));var csv=require(_0x947c('0x7'));var ejs=require(_0x947c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x947c('0x9'));var squel=require(_0x947c('0xa'));var crypto=require(_0x947c('0xb'));var jsforce=require(_0x947c('0xc'));var deskjs=require(_0x947c('0xd'));var toCsv=require(_0x947c('0x7'));var querystring=require(_0x947c('0xe'));var Papa=require(_0x947c('0xf'));var Redis=require(_0x947c('0x10'));var authService=require(_0x947c('0x11'));var qs=require(_0x947c('0x12'));var as=require(_0x947c('0x13'));var hardwareService=require(_0x947c('0x14'));var logger=require('../../config/logger')(_0x947c('0x15'));var utils=require(_0x947c('0x16'));var config=require(_0x947c('0x17'));var licenseUtil=require(_0x947c('0x18'));var db=require(_0x947c('0x19'))['db'];function respondWithStatusCode(_0x2b26c1,_0x500392){_0x500392=_0x500392||0xcc;return function(_0x457c1e){if(_0x457c1e){return _0x2b26c1[_0x947c('0x1a')](_0x500392);}return _0x2b26c1[_0x947c('0x1b')](_0x500392)['end']();};}function respondWithResult(_0x4564b6,_0x383e87){_0x383e87=_0x383e87||0xc8;return function(_0x29c5d0){if(_0x29c5d0){return _0x4564b6[_0x947c('0x1b')](_0x383e87)[_0x947c('0x1c')](_0x29c5d0);}};}function respondWithFilteredResult(_0x594985,_0x253756){return function(_0x4d52b6){if(_0x4d52b6){var _0xf12dcd=typeof _0x253756[_0x947c('0x1d')]===_0x947c('0x1e')&&typeof _0x253756[_0x947c('0x1f')]===_0x947c('0x1e');var _0x56b87f=_0x4d52b6['count'];var _0x5cd9a5=_0xf12dcd?0x0:_0x253756['offset'];var _0x1c04d1=_0xf12dcd?_0x4d52b6['count']:_0x253756[_0x947c('0x1d')]+_0x253756[_0x947c('0x1f')];var _0x34f322;if(_0x1c04d1>=_0x56b87f){_0x1c04d1=_0x56b87f;_0x34f322=0xc8;}else{_0x34f322=0xce;}_0x594985[_0x947c('0x1b')](_0x34f322);return _0x594985['set']('Content-Range',_0x5cd9a5+'-'+_0x1c04d1+'/'+_0x56b87f)['json'](_0x4d52b6);}return null;};}function patchUpdates(_0x1f9b76){return function(_0x40eefe){try{jsonpatch['apply'](_0x40eefe,_0x1f9b76,!![]);}catch(_0x32bf19){return BPromise['reject'](_0x32bf19);}return _0x40eefe[_0x947c('0x20')]();};}function saveUpdates(_0x57928b,_0x4ab2cb){return function(_0x2a3ddf){if(_0x2a3ddf){return _0x2a3ddf[_0x947c('0x21')](_0x57928b)[_0x947c('0x22')](function(_0x56205b){return _0x56205b;});}return null;};}function removeEntity(_0xb4231f,_0x1abda5){return function(_0x44e879){if(_0x44e879){return _0x44e879['destroy']()['then'](function(){_0xb4231f[_0x947c('0x1b')](0xcc)[_0x947c('0x23')]();});}};}function handleEntityNotFound(_0x2e57c4,_0x1e9c21){return function(_0x4862f9){if(!_0x4862f9){_0x2e57c4[_0x947c('0x1a')](0x194);}return _0x4862f9;};}function handleError(_0xef99b9,_0x578dc2){_0x578dc2=_0x578dc2||0x1f4;return function(_0xb16cfc){logger[_0x947c('0x24')](_0xb16cfc[_0x947c('0x25')]);if(_0xb16cfc[_0x947c('0x26')]){delete _0xb16cfc[_0x947c('0x26')];}_0xef99b9[_0x947c('0x1b')](_0x578dc2)[_0x947c('0x27')](_0xb16cfc);};}exports[_0x947c('0x28')]=function(_0x41c382,_0x2d873b){var _0x45cdaa={},_0x2682cf={},_0x7c9a7c={'count':0x0,'rows':[]};var _0x420874=_['map'](db[_0x947c('0x29')][_0x947c('0x2a')],function(_0xe5d1bb){return{'name':_0xe5d1bb[_0x947c('0x2b')],'type':_0xe5d1bb['type'][_0x947c('0x2c')]};});_0x2682cf[_0x947c('0x2d')]=_[_0x947c('0x2e')](_0x420874,_0x947c('0x26'));_0x2682cf['query']=_[_0x947c('0x2f')](_0x41c382[_0x947c('0x30')]);_0x2682cf[_0x947c('0x31')]=_[_0x947c('0x32')](_0x2682cf[_0x947c('0x2d')],_0x2682cf[_0x947c('0x30')]);_0x45cdaa[_0x947c('0x33')]=_['intersection'](_0x2682cf[_0x947c('0x2d')],qs[_0x947c('0x34')](_0x41c382[_0x947c('0x30')]['fields']));_0x45cdaa[_0x947c('0x33')]=_0x45cdaa[_0x947c('0x33')][_0x947c('0x35')]?_0x45cdaa[_0x947c('0x33')]:_0x2682cf[_0x947c('0x2d')];if(!_0x41c382[_0x947c('0x30')][_0x947c('0x36')](_0x947c('0x37'))){_0x45cdaa[_0x947c('0x1f')]=qs[_0x947c('0x1f')](_0x41c382[_0x947c('0x30')][_0x947c('0x1f')]);_0x45cdaa[_0x947c('0x1d')]=qs[_0x947c('0x1d')](_0x41c382[_0x947c('0x30')][_0x947c('0x1d')]);}_0x45cdaa[_0x947c('0x38')]=qs['sort'](_0x41c382['query'][_0x947c('0x39')]);_0x45cdaa['where']=qs['filters'](_[_0x947c('0x3a')](_0x41c382[_0x947c('0x30')],_0x2682cf['filters']),_0x420874);if(_0x41c382[_0x947c('0x30')]['filter']){_0x45cdaa[_0x947c('0x3b')]=_['merge'](_0x45cdaa['where'],{'$or':_['map'](_0x420874,function(_0x4ebfad){if(_0x4ebfad[_0x947c('0x3c')]!==_0x947c('0x3d')){var _0x5e1a5c={};_0x5e1a5c[_0x4ebfad[_0x947c('0x26')]]={'$like':'%'+_0x41c382[_0x947c('0x30')][_0x947c('0x3e')]+'%'};return _0x5e1a5c;}})});}_0x45cdaa=_[_0x947c('0x3f')]({},_0x45cdaa,_0x41c382[_0x947c('0x40')]);var _0x4297b0={'where':_0x45cdaa['where']};return db[_0x947c('0x29')]['count'](_0x4297b0)[_0x947c('0x22')](function(_0x2879e8){_0x7c9a7c[_0x947c('0x41')]=_0x2879e8;if(_0x41c382[_0x947c('0x30')][_0x947c('0x42')]){_0x45cdaa[_0x947c('0x43')]=[{'all':!![]}];}return db[_0x947c('0x29')]['findAll'](_0x45cdaa);})[_0x947c('0x22')](function(_0x10576d){_0x7c9a7c[_0x947c('0x44')]=_0x10576d;return _0x7c9a7c;})[_0x947c('0x22')](respondWithFilteredResult(_0x2d873b,_0x45cdaa))['catch'](handleError(_0x2d873b,null));};exports[_0x947c('0x45')]=function(_0x3a42dc,_0x5de369){var _0x39913c={'raw':!![],'where':{'id':_0x3a42dc['params']['id']}},_0x4b3d39={};_0x4b3d39['model']=_[_0x947c('0x2f')](db['SquareRecording'][_0x947c('0x2a')]);_0x4b3d39[_0x947c('0x30')]=_[_0x947c('0x2f')](_0x3a42dc[_0x947c('0x30')]);_0x4b3d39[_0x947c('0x31')]=_[_0x947c('0x32')](_0x4b3d39[_0x947c('0x2d')],_0x4b3d39[_0x947c('0x30')]);_0x39913c['attributes']=_[_0x947c('0x32')](_0x4b3d39['model'],qs[_0x947c('0x34')](_0x3a42dc[_0x947c('0x30')][_0x947c('0x34')]));_0x39913c[_0x947c('0x33')]=_0x39913c[_0x947c('0x33')]['length']?_0x39913c[_0x947c('0x33')]:_0x4b3d39['model'];if(_0x3a42dc['query']['includeAll']){_0x39913c[_0x947c('0x43')]=[{'all':!![]}];}_0x39913c=_[_0x947c('0x3f')]({},_0x39913c,_0x3a42dc[_0x947c('0x40')]);return db[_0x947c('0x29')][_0x947c('0x46')](_0x39913c)['then'](handleEntityNotFound(_0x5de369,null))[_0x947c('0x22')](respondWithResult(_0x5de369,null))[_0x947c('0x47')](handleError(_0x5de369,null));};exports[_0x947c('0x48')]=function(_0x4cd297,_0x4eb37a){return db['SquareRecording'][_0x947c('0x48')](_0x4cd297[_0x947c('0x49')],{})['then'](respondWithResult(_0x4eb37a,0xc9))[_0x947c('0x47')](handleError(_0x4eb37a,null));};exports[_0x947c('0x21')]=function(_0x393369,_0x3d366b){if(_0x393369[_0x947c('0x49')]['id']){delete _0x393369['body']['id'];}return db['SquareRecording'][_0x947c('0x46')]({'where':{'id':_0x393369[_0x947c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d366b,null))[_0x947c('0x22')](saveUpdates(_0x393369['body'],null))[_0x947c('0x22')](respondWithResult(_0x3d366b,null))[_0x947c('0x47')](handleError(_0x3d366b,null));};exports[_0x947c('0x4b')]=function(_0x5040c6,_0x32ab6a,_0x639633){var _0x2ae49d=require(_0x947c('0x4c'));var _0x40d2cf=![];var _0x1ee0d5={};if(_0x5040c6['query'][_0x947c('0x3c')]&&_0x5040c6[_0x947c('0x30')][_0x947c('0x3c')]===_0x947c('0x4d')){_0x1ee0d5[_0x947c('0x4d')]=_0x5040c6[_0x947c('0x4a')]['id'];}else{_0x1ee0d5['id']=_0x5040c6[_0x947c('0x4a')]['id'];}return db[_0x947c('0x29')][_0x947c('0x46')]({'where':_0x1ee0d5,'attributes':['id',_0x947c('0x4e'),_0x947c('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x32ab6a,null))[_0x947c('0x22')](function(_0x505147){if(_0x505147){var _0x28fcf4=_0x505147[_0x947c('0x4e')];var _0x1bbeba=util[_0x947c('0x50')]('%s.cypher',_0x28fcf4);if(fs[_0x947c('0x51')](_0x1bbeba)){_0x40d2cf=!![];return _0x2ae49d['decryptFile'](_0x1bbeba,_0x28fcf4,config[_0x947c('0x52')][_0x947c('0x53')])[_0x947c('0x22')](function(){return _0x505147;});}return _0x505147;}})[_0x947c('0x22')](function(_0x2e0fbe){if(_0x2e0fbe){var _0x53c56a=_0x2e0fbe[_0x947c('0x4e')];if(!fs['existsSync'](_0x53c56a)){throw new db['Sequelize'][(_0x947c('0x54'))](_0x947c('0x55'));}if(_0x2e0fbe[_0x947c('0x4f')]){return _0x32ab6a[_0x947c('0x4b')](_0x53c56a,_0x2e0fbe['filename']+path[_0x947c('0x56')](_0x53c56a),function(){if(_0x40d2cf){fs[_0x947c('0x57')](_0x53c56a);}});}else{return _0x32ab6a[_0x947c('0x4b')](_0x53c56a,function(_0x306cd3){if(_0x40d2cf){fs[_0x947c('0x57')](_0x53c56a);}});}}})[_0x947c('0x47')](function(_0x2d4a85){if(_0x2d4a85['message']===_0x947c('0x55')){_0x32ab6a[_0x947c('0x1b')](0x194)[_0x947c('0x27')]('Not\x20found');}else{return handleError(_0x32ab6a,null);}});};exports[_0x947c('0x58')]=function(_0x3e8870,_0xab695){return db[_0x947c('0x29')][_0x947c('0x46')]({'where':{'id':_0x3e8870[_0x947c('0x4a')]['id']}})[_0x947c('0x22')](function(_0x44c3bc){if(_[_0x947c('0x59')](_0x44c3bc)){throw new ReferenceError(_0x947c('0x5a'));}return _0x44c3bc;})[_0x947c('0x22')](function(_0xfbebb4){var _0x5a3923=_0xfbebb4[_0x947c('0x4e')];logger['info'](_0x947c('0x5b'),_0x5a3923);if(!_['isNil'](_0xfbebb4[_0x947c('0x4e')])&&fs[_0x947c('0x51')](_0x5a3923)){logger[_0x947c('0x5c')](_0x947c('0x5d')+_0x5a3923+_0x947c('0x5e'));fs[_0x947c('0x5f')](_0x5a3923);}_0x5a3923=_0x5a3923+_0x947c('0x60');if(!_[_0x947c('0x59')](_0xfbebb4[_0x947c('0x4e')])&&fs[_0x947c('0x51')](_0x5a3923)){logger[_0x947c('0x5c')](_0x947c('0x5d')+_0x5a3923+_0x947c('0x5e'));fs[_0x947c('0x5f')](_0x5a3923);}return _0xfbebb4;})[_0x947c('0x22')](function(_0x3e124b){if(!_0x3e124b)throw new InternalError();return _0x3e124b[_0x947c('0x58')]();})['then'](function(){_0xab695[_0x947c('0x1b')](0xcc)[_0x947c('0x23')]();})[_0x947c('0x47')](handleError(_0xab695,null));}; \ No newline at end of file +var _0x47fd=['undefined','limit','count','set','Content-Range','apply','save','then','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','create','update','body','find','download','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','message','SquareRecording\x20not\x20found','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x5d9732,_0x5dc85e){var _0x3a5c39=function(_0x1c66ed){while(--_0x1c66ed){_0x5d9732['push'](_0x5d9732['shift']());}};_0x3a5c39(++_0x5dc85e);}(_0x47fd,0x1a9));var _0xd47f=function(_0x40acca,_0x497442){_0x40acca=_0x40acca-0x0;var _0x3b0ce3=_0x47fd[_0x40acca];return _0x3b0ce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd47f('0x0'));var zipdir=require(_0xd47f('0x1'));var jsonpatch=require(_0xd47f('0x2'));var rp=require(_0xd47f('0x3'));var moment=require(_0xd47f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd47f('0x5'));var util=require('util');var path=require(_0xd47f('0x6'));var sox=require(_0xd47f('0x7'));var csv=require(_0xd47f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd47f('0x9'));var crypto=require(_0xd47f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd47f('0xb'));var Papa=require(_0xd47f('0xc'));var Redis=require(_0xd47f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd47f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd47f('0xf'));var logger=require(_0xd47f('0x10'))(_0xd47f('0x11'));var utils=require('../../config/utils');var config=require(_0xd47f('0x12'));var licenseUtil=require(_0xd47f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2657f2,_0x319986){_0x319986=_0x319986||0xcc;return function(_0xd86fb6){if(_0xd86fb6){return _0x2657f2[_0xd47f('0x14')](_0x319986);}return _0x2657f2[_0xd47f('0x15')](_0x319986)[_0xd47f('0x16')]();};}function respondWithResult(_0x942259,_0x429fd9){_0x429fd9=_0x429fd9||0xc8;return function(_0x459d06){if(_0x459d06){return _0x942259['status'](_0x429fd9)[_0xd47f('0x17')](_0x459d06);}};}function respondWithFilteredResult(_0x50432e,_0x2c2f0c){return function(_0x73fc04){if(_0x73fc04){var _0x49b595=typeof _0x2c2f0c[_0xd47f('0x18')]===_0xd47f('0x19')&&typeof _0x2c2f0c[_0xd47f('0x1a')]===_0xd47f('0x19');var _0x1c723c=_0x73fc04[_0xd47f('0x1b')];var _0x55ea99=_0x49b595?0x0:_0x2c2f0c[_0xd47f('0x18')];var _0x14e304=_0x49b595?_0x73fc04[_0xd47f('0x1b')]:_0x2c2f0c[_0xd47f('0x18')]+_0x2c2f0c[_0xd47f('0x1a')];var _0x1b76e7;if(_0x14e304>=_0x1c723c){_0x14e304=_0x1c723c;_0x1b76e7=0xc8;}else{_0x1b76e7=0xce;}_0x50432e[_0xd47f('0x15')](_0x1b76e7);return _0x50432e[_0xd47f('0x1c')](_0xd47f('0x1d'),_0x55ea99+'-'+_0x14e304+'/'+_0x1c723c)[_0xd47f('0x17')](_0x73fc04);}return null;};}function patchUpdates(_0x23d205){return function(_0x4a77bf){try{jsonpatch[_0xd47f('0x1e')](_0x4a77bf,_0x23d205,!![]);}catch(_0x5420a5){return BPromise['reject'](_0x5420a5);}return _0x4a77bf[_0xd47f('0x1f')]();};}function saveUpdates(_0x3d3635,_0x22f4f2){return function(_0x5d137d){if(_0x5d137d){return _0x5d137d['update'](_0x3d3635)[_0xd47f('0x20')](function(_0x4dc215){return _0x4dc215;});}return null;};}function removeEntity(_0x5ae8ed,_0xeb7d37){return function(_0x44d535){if(_0x44d535){return _0x44d535['destroy']()[_0xd47f('0x20')](function(){_0x5ae8ed[_0xd47f('0x15')](0xcc)[_0xd47f('0x16')]();});}};}function handleEntityNotFound(_0x3fe010,_0x4d4582){return function(_0x158ea3){if(!_0x158ea3){_0x3fe010[_0xd47f('0x14')](0x194);}return _0x158ea3;};}function handleError(_0x4a1386,_0x1ffb00){_0x1ffb00=_0x1ffb00||0x1f4;return function(_0x266046){logger[_0xd47f('0x21')](_0x266046['stack']);if(_0x266046[_0xd47f('0x22')]){delete _0x266046[_0xd47f('0x22')];}_0x4a1386[_0xd47f('0x15')](_0x1ffb00)[_0xd47f('0x23')](_0x266046);};}exports[_0xd47f('0x24')]=function(_0x2490e9,_0x4d3aff){var _0x55e861={},_0x4c2a9f={},_0x4ae643={'count':0x0,'rows':[]};var _0x32ca82=_[_0xd47f('0x25')](db[_0xd47f('0x26')][_0xd47f('0x27')],function(_0x4702b1){return{'name':_0x4702b1[_0xd47f('0x28')],'type':_0x4702b1[_0xd47f('0x29')][_0xd47f('0x2a')]};});_0x4c2a9f[_0xd47f('0x2b')]=_[_0xd47f('0x25')](_0x32ca82,'name');_0x4c2a9f[_0xd47f('0x2c')]=_[_0xd47f('0x2d')](_0x2490e9[_0xd47f('0x2c')]);_0x4c2a9f[_0xd47f('0x2e')]=_[_0xd47f('0x2f')](_0x4c2a9f[_0xd47f('0x2b')],_0x4c2a9f[_0xd47f('0x2c')]);_0x55e861[_0xd47f('0x30')]=_[_0xd47f('0x2f')](_0x4c2a9f['model'],qs[_0xd47f('0x31')](_0x2490e9[_0xd47f('0x2c')]['fields']));_0x55e861[_0xd47f('0x30')]=_0x55e861[_0xd47f('0x30')][_0xd47f('0x32')]?_0x55e861[_0xd47f('0x30')]:_0x4c2a9f[_0xd47f('0x2b')];if(!_0x2490e9[_0xd47f('0x2c')]['hasOwnProperty'](_0xd47f('0x33'))){_0x55e861[_0xd47f('0x1a')]=qs['limit'](_0x2490e9[_0xd47f('0x2c')][_0xd47f('0x1a')]);_0x55e861[_0xd47f('0x18')]=qs['offset'](_0x2490e9['query'][_0xd47f('0x18')]);}_0x55e861['order']=qs[_0xd47f('0x34')](_0x2490e9['query'][_0xd47f('0x34')]);_0x55e861[_0xd47f('0x35')]=qs[_0xd47f('0x2e')](_[_0xd47f('0x36')](_0x2490e9[_0xd47f('0x2c')],_0x4c2a9f[_0xd47f('0x2e')]),_0x32ca82);if(_0x2490e9[_0xd47f('0x2c')][_0xd47f('0x37')]){_0x55e861['where']=_[_0xd47f('0x38')](_0x55e861[_0xd47f('0x35')],{'$or':_[_0xd47f('0x25')](_0x32ca82,function(_0xc913c){if(_0xc913c[_0xd47f('0x29')]!=='VIRTUAL'){var _0x3f271f={};_0x3f271f[_0xc913c[_0xd47f('0x22')]]={'$like':'%'+_0x2490e9[_0xd47f('0x2c')][_0xd47f('0x37')]+'%'};return _0x3f271f;}})});}_0x55e861=_['merge']({},_0x55e861,_0x2490e9['options']);var _0xfbb6d3={'where':_0x55e861[_0xd47f('0x35')]};return db[_0xd47f('0x26')][_0xd47f('0x1b')](_0xfbb6d3)[_0xd47f('0x20')](function(_0x4c7059){_0x4ae643['count']=_0x4c7059;if(_0x2490e9['query'][_0xd47f('0x39')]){_0x55e861[_0xd47f('0x3a')]=[{'all':!![]}];}return db[_0xd47f('0x26')]['findAll'](_0x55e861);})['then'](function(_0x4d2286){_0x4ae643[_0xd47f('0x3b')]=_0x4d2286;return _0x4ae643;})[_0xd47f('0x20')](respondWithFilteredResult(_0x4d3aff,_0x55e861))[_0xd47f('0x3c')](handleError(_0x4d3aff,null));};exports[_0xd47f('0x3d')]=function(_0x1099d3,_0x106078){var _0x201fcf={'raw':!![],'where':{'id':_0x1099d3[_0xd47f('0x3e')]['id']}},_0x3c0776={};_0x3c0776['model']=_['keys'](db[_0xd47f('0x26')][_0xd47f('0x27')]);_0x3c0776['query']=_[_0xd47f('0x2d')](_0x1099d3['query']);_0x3c0776['filters']=_[_0xd47f('0x2f')](_0x3c0776[_0xd47f('0x2b')],_0x3c0776[_0xd47f('0x2c')]);_0x201fcf[_0xd47f('0x30')]=_[_0xd47f('0x2f')](_0x3c0776[_0xd47f('0x2b')],qs[_0xd47f('0x31')](_0x1099d3[_0xd47f('0x2c')][_0xd47f('0x31')]));_0x201fcf[_0xd47f('0x30')]=_0x201fcf[_0xd47f('0x30')][_0xd47f('0x32')]?_0x201fcf[_0xd47f('0x30')]:_0x3c0776['model'];if(_0x1099d3[_0xd47f('0x2c')][_0xd47f('0x39')]){_0x201fcf[_0xd47f('0x3a')]=[{'all':!![]}];}_0x201fcf=_[_0xd47f('0x38')]({},_0x201fcf,_0x1099d3['options']);return db[_0xd47f('0x26')]['find'](_0x201fcf)['then'](handleEntityNotFound(_0x106078,null))[_0xd47f('0x20')](respondWithResult(_0x106078,null))[_0xd47f('0x3c')](handleError(_0x106078,null));};exports[_0xd47f('0x3f')]=function(_0x241579,_0xc40de8){return db[_0xd47f('0x26')]['create'](_0x241579['body'],{})['then'](respondWithResult(_0xc40de8,0xc9))[_0xd47f('0x3c')](handleError(_0xc40de8,null));};exports[_0xd47f('0x40')]=function(_0x1395b4,_0x2e13a4){if(_0x1395b4[_0xd47f('0x41')]['id']){delete _0x1395b4[_0xd47f('0x41')]['id'];}return db[_0xd47f('0x26')][_0xd47f('0x42')]({'where':{'id':_0x1395b4[_0xd47f('0x3e')]['id']}})[_0xd47f('0x20')](handleEntityNotFound(_0x2e13a4,null))[_0xd47f('0x20')](saveUpdates(_0x1395b4['body'],null))[_0xd47f('0x20')](respondWithResult(_0x2e13a4,null))[_0xd47f('0x3c')](handleError(_0x2e13a4,null));};exports[_0xd47f('0x43')]=function(_0x4f8606,_0x5c9db2,_0x21aab2){var _0x5cad9d=require(_0xd47f('0x44'));var _0x5a2483=![];var _0x15ea09={};if(_0x4f8606[_0xd47f('0x2c')][_0xd47f('0x29')]&&_0x4f8606[_0xd47f('0x2c')][_0xd47f('0x29')]===_0xd47f('0x45')){_0x15ea09[_0xd47f('0x45')]=_0x4f8606['params']['id'];}else{_0x15ea09['id']=_0x4f8606[_0xd47f('0x3e')]['id'];}return db['SquareRecording'][_0xd47f('0x42')]({'where':_0x15ea09,'attributes':['id',_0xd47f('0x46'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x5c9db2,null))[_0xd47f('0x20')](function(_0x5b4d5e){if(_0x5b4d5e){var _0x406f6b=_0x5b4d5e['savePath'];var _0x3bed13=util[_0xd47f('0x47')]('%s.cypher',_0x406f6b);if(fs[_0xd47f('0x48')](_0x3bed13)){_0x5a2483=!![];return _0x5cad9d[_0xd47f('0x49')](_0x3bed13,_0x406f6b,config[_0xd47f('0x4a')]['recording'])['then'](function(){return _0x5b4d5e;});}return _0x5b4d5e;}})[_0xd47f('0x20')](function(_0x1fd9fa){if(_0x1fd9fa){var _0x17c296=_0x1fd9fa[_0xd47f('0x46')];if(!fs['existsSync'](_0x17c296)){throw new db[(_0xd47f('0x4b'))][(_0xd47f('0x4c'))]('SquareRecording\x20not\x20found');}if(_0x1fd9fa[_0xd47f('0x4d')]){return _0x5c9db2[_0xd47f('0x43')](_0x17c296,_0x1fd9fa['filename']+path[_0xd47f('0x4e')](_0x17c296),function(){if(_0x5a2483){fs[_0xd47f('0x4f')](_0x17c296);}});}else{return _0x5c9db2[_0xd47f('0x43')](_0x17c296,function(_0x1b30a5){if(_0x5a2483){fs[_0xd47f('0x4f')](_0x17c296);}});}}})[_0xd47f('0x3c')](function(_0xf1496a){if(_0xf1496a[_0xd47f('0x50')]===_0xd47f('0x51')){_0x5c9db2[_0xd47f('0x15')](0x194)[_0xd47f('0x23')]('Not\x20found');}else{return handleError(_0x5c9db2,null);}});};exports[_0xd47f('0x52')]=function(_0x76a2d9,_0x127ec9){return db['SquareRecording']['find']({'where':{'id':_0x76a2d9[_0xd47f('0x3e')]['id']}})[_0xd47f('0x20')](function(_0x5a4596){if(_[_0xd47f('0x53')](_0x5a4596)){throw new ReferenceError(_0xd47f('0x54'));}return _0x5a4596;})[_0xd47f('0x20')](function(_0x4344c6){var _0x10c974=_0x4344c6[_0xd47f('0x46')];logger[_0xd47f('0x55')]('cancellazione\x20fisica\x20documento\x20%s',_0x10c974);if(!_['isNil'](_0x4344c6[_0xd47f('0x46')])&&fs[_0xd47f('0x48')](_0x10c974)){logger[_0xd47f('0x55')](_0xd47f('0x56')+_0x10c974+_0xd47f('0x57'));fs[_0xd47f('0x58')](_0x10c974);}_0x10c974=_0x10c974+_0xd47f('0x59');if(!_['isNil'](_0x4344c6['savePath'])&&fs[_0xd47f('0x48')](_0x10c974)){logger[_0xd47f('0x55')](_0xd47f('0x56')+_0x10c974+_0xd47f('0x57'));fs[_0xd47f('0x58')](_0x10c974);}return _0x4344c6;})[_0xd47f('0x20')](function(_0x2777d8){if(!_0x2777d8)throw new InternalError();return _0x2777d8[_0xd47f('0x52')]();})[_0xd47f('0x20')](function(){_0x127ec9[_0xd47f('0x15')](0xcc)[_0xd47f('0x16')]();})[_0xd47f('0x3c')](handleError(_0x127ec9,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 97c7a73..b492c33 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 _0xc7b3=['api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','lodash','util'];(function(_0x18065f,_0x2d731d){var _0x80d378=function(_0x19eedf){while(--_0x19eedf){_0x18065f['push'](_0x18065f['shift']());}};_0x80d378(++_0x2d731d);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3c7b('0x0'));var util=require(_0x3c7b('0x1'));var logger=require('../../config/logger')(_0x3c7b('0x2'));var moment=require(_0x3c7b('0x3'));var BPromise=require(_0x3c7b('0x4'));var rp=require(_0x3c7b('0x5'));var fs=require('fs');var path=require(_0x3c7b('0x6'));var rimraf=require(_0x3c7b('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c7b('0x8'));module[_0x3c7b('0x9')]=function(_0x1fa371,_0x55975f){return _0x1fa371[_0x3c7b('0xa')](_0x3c7b('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5532=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./squareRecording.attributes','define','square_recordings'];(function(_0x2a20e2,_0x4e9231){var _0x18b408=function(_0x4f38a2){while(--_0x4f38a2){_0x2a20e2['push'](_0x2a20e2['shift']());}};_0x18b408(++_0x4e9231);}(_0x5532,0x19a));var _0x2553=function(_0x272c15,_0x4d3bc5){_0x272c15=_0x272c15-0x0;var _0x46af26=_0x5532[_0x272c15];return _0x46af26;};'use strict';var _=require(_0x2553('0x0'));var util=require(_0x2553('0x1'));var logger=require(_0x2553('0x2'))('api');var moment=require(_0x2553('0x3'));var BPromise=require('bluebird');var rp=require(_0x2553('0x4'));var fs=require('fs');var path=require(_0x2553('0x5'));var rimraf=require(_0x2553('0x6'));var config=require('../../config/environment');var attributes=require(_0x2553('0x7'));module['exports']=function(_0x506c9a,_0x45358c){return _0x506c9a[_0x2553('0x8')]('SquareRecording',attributes,{'tableName':_0x2553('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index bab0d5e..cbd49e5 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 _0x10c0=['options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x10c0,0x12a));var _0x010c=function(_0x352713,_0x737610){_0x352713=_0x352713-0x0;var _0x46a4ea=_0x10c0[_0x352713];return _0x46a4ea;};'use strict';var _=require(_0x010c('0x0'));var util=require(_0x010c('0x1'));var moment=require(_0x010c('0x2'));var BPromise=require(_0x010c('0x3'));var rs=require(_0x010c('0x4'));var fs=require('fs');var Redis=require(_0x010c('0x5'));var db=require(_0x010c('0x6'))['db'];var utils=require(_0x010c('0x7'));var logger=require(_0x010c('0x8'))(_0x010c('0x9'));var config=require(_0x010c('0xa'));var jayson=require(_0x010c('0xb'));var client=jayson[_0x010c('0xc')][_0x010c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5c2df2,_0x257b43,_0x49fec9){return new BPromise(function(_0x4fc308,_0x5f42dc){return client['request'](_0x5c2df2,_0x49fec9)[_0x010c('0xe')](function(_0x421a38){logger[_0x010c('0xf')]('SquareRecording,\x20%s,\x20%s',_0x257b43,_0x010c('0x10'));logger[_0x010c('0x11')](_0x010c('0x12'),_0x257b43,'request\x20sent',JSON['stringify'](_0x421a38));if(_0x421a38['error']){if(_0x421a38[_0x010c('0x13')][_0x010c('0x14')]===0x1f4){logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);return _0x5f42dc(_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);}logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);return _0x4fc308(_0x421a38['error'][_0x010c('0x16')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x257b43,_0x010c('0x10'));_0x4fc308(_0x421a38[_0x010c('0x17')]['message']);}})[_0x010c('0x18')](function(_0x5211c6){logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x5211c6);_0x5f42dc(_0x5211c6);});});}exports[_0x010c('0x19')]=function(_0x2ec8){var _0x4fcc9d=this;return new Promise(function(_0x315245,_0x565d54){return db['SquareRecording']['create'](_0x2ec8['body'],{'raw':_0x2ec8[_0x010c('0x1a')]?_0x2ec8[_0x010c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x010c('0xe')](function(_0x4d7567){logger[_0x010c('0xf')](_0x010c('0x19'),_0x2ec8);logger[_0x010c('0x11')](_0x010c('0x19'),_0x2ec8,JSON['stringify'](_0x4d7567));_0x315245(_0x4d7567);})[_0x010c('0x18')](function(_0x44e25e){logger[_0x010c('0x13')](_0x010c('0x19'),_0x44e25e['message'],_0x2ec8);_0x565d54(_0x4fcc9d[_0x010c('0x13')](0x1f4,_0x44e25e['message']));});});}; \ No newline at end of file +var _0x4484=['SquareRecording','create','body','options','raw','debug','CreateSquareRecording','moment','bluebird','ioredis','../../config/logger','rpc','client','http','request','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4484,0x1b7));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4448('0x0'));var BPromise=require(_0x4448('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4448('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4448('0x3'))(_0x4448('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4448('0x5')][_0x4448('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2b5239,_0x45530e,_0xcb1bab){return new BPromise(function(_0x2c6e68,_0x2af903){return client[_0x4448('0x7')](_0x2b5239,_0xcb1bab)['then'](function(_0x4721b5){logger[_0x4448('0x8')]('SquareRecording,\x20%s,\x20%s',_0x45530e,_0x4448('0x9'));logger['debug'](_0x4448('0xa'),_0x45530e,_0x4448('0x9'),JSON[_0x4448('0xb')](_0x4721b5));if(_0x4721b5[_0x4448('0xc')]){if(_0x4721b5['error'][_0x4448('0xd')]===0x1f4){logger[_0x4448('0xc')]('SquareRecording,\x20%s,\x20%s',_0x45530e,_0x4721b5[_0x4448('0xc')]['message']);return _0x2af903(_0x4721b5[_0x4448('0xc')][_0x4448('0xe')]);}logger['error'](_0x4448('0xf'),_0x45530e,_0x4721b5[_0x4448('0xc')][_0x4448('0xe')]);return _0x2c6e68(_0x4721b5['error'][_0x4448('0xe')]);}else{logger[_0x4448('0x8')](_0x4448('0xf'),_0x45530e,'request\x20sent');_0x2c6e68(_0x4721b5['result'][_0x4448('0xe')]);}})[_0x4448('0x10')](function(_0x22070f){logger[_0x4448('0xc')](_0x4448('0xf'),_0x45530e,_0x22070f);_0x2af903(_0x22070f);});});}exports['CreateSquareRecording']=function(_0x34ab41){var _0x5b1ff5=this;return new Promise(function(_0x37a1d2,_0x400ac0){return db[_0x4448('0x11')][_0x4448('0x12')](_0x34ab41[_0x4448('0x13')],{'raw':_0x34ab41[_0x4448('0x14')]?_0x34ab41[_0x4448('0x14')][_0x4448('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x40bf3a){logger['info']('CreateSquareRecording',_0x34ab41);logger[_0x4448('0x16')](_0x4448('0x17'),_0x34ab41,JSON[_0x4448('0xb')](_0x40bf3a));_0x37a1d2(_0x40bf3a);})[_0x4448('0x10')](function(_0x475aee){logger[_0x4448('0xc')]('CreateSquareRecording',_0x475aee[_0x4448('0xe')],_0x34ab41);_0x400ac0(_0x5b1ff5[_0x4448('0xc')](0x1f4,_0x475aee[_0x4448('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d62c0e0..7980ae5 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 _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(_0x158358,_0x125fa5){var _0x450745=function(_0x4e5324){while(--_0x4e5324){_0x158358['push'](_0x158358['shift']());}};_0x450745(++_0x125fa5);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var 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 +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(_0x248451,_0xb75598){var _0x3732a5=function(_0x269731){while(--_0x269731){_0x248451['push'](_0x248451['shift']());}};_0x3732a5(++_0xb75598);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 5d498b5..e0edbab 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 _0x3e04=['exports','STRING','DATE','sequelize'];(function(_0x51ce3e,_0x4a1ed5){var _0x175562=function(_0x2e739d){while(--_0x2e739d){_0x51ce3e['push'](_0x51ce3e['shift']());}};_0x175562(++_0x4a1ed5);}(_0x3e04,0x16f));var _0x43e0=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x3e04[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x43e0('0x0'));module[_0x43e0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x43e0('0x2')]},'request':{'type':Sequelize[_0x43e0('0x2')]},'channel':{'type':Sequelize[_0x43e0('0x2')]},'language':{'type':Sequelize[_0x43e0('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x43e0('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x43e0('0x2')]},'callingani2':{'type':Sequelize[_0x43e0('0x2')]},'callington':{'type':Sequelize[_0x43e0('0x2')]},'callingtns':{'type':Sequelize[_0x43e0('0x2')]},'dnid':{'type':Sequelize[_0x43e0('0x2')]},'rdnis':{'type':Sequelize[_0x43e0('0x2')]},'context':{'type':Sequelize[_0x43e0('0x2')]},'extension':{'type':Sequelize[_0x43e0('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x43e0('0x2')]},'accountcode':{'type':Sequelize[_0x43e0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x43e0('0x2')]},'joinAt':{'type':Sequelize[_0x43e0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x09af=['STRING','DATE','sequelize','exports'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x09af,0x1ba));var _0xf09a=function(_0x1a367d,_0x2fa8af){_0x1a367d=_0x1a367d-0x0;var _0x50ff92=_0x09af[_0x1a367d];return _0x50ff92;};'use strict';var Sequelize=require(_0xf09a('0x0'));module[_0xf09a('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xf09a('0x2')]},'channel':{'type':Sequelize[_0xf09a('0x2')]},'language':{'type':Sequelize[_0xf09a('0x2')]},'type':{'type':Sequelize[_0xf09a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xf09a('0x2')]},'callerid':{'type':Sequelize[_0xf09a('0x2')]},'calleridname':{'type':Sequelize[_0xf09a('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xf09a('0x2')]},'callington':{'type':Sequelize[_0xf09a('0x2')]},'callingtns':{'type':Sequelize[_0xf09a('0x2')]},'dnid':{'type':Sequelize[_0xf09a('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf09a('0x2')]},'enhanced':{'type':Sequelize[_0xf09a('0x2')]},'accountcode':{'type':Sequelize[_0xf09a('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xf09a('0x2')]},'joinAt':{'type':Sequelize[_0xf09a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'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 07b6c58..5e5b7e3 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 _0xb788=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','SquareReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','rawAttributes','find','catch','create'];(function(_0x1ffd1b,_0x20e496){var _0x35640a=function(_0x345deb){while(--_0x345deb){_0x1ffd1b['push'](_0x1ffd1b['shift']());}};_0x35640a(++_0x20e496);}(_0xb788,0xe6));var _0x8b78=function(_0x2b9c0c,_0x4678a3){_0x2b9c0c=_0x2b9c0c-0x0;var _0xd8577b=_0xb788[_0x2b9c0c];return _0xd8577b;};'use strict';var emlformat=require(_0x8b78('0x0'));var rimraf=require(_0x8b78('0x1'));var zipdir=require(_0x8b78('0x2'));var jsonpatch=require(_0x8b78('0x3'));var rp=require(_0x8b78('0x4'));var moment=require('moment');var BPromise=require(_0x8b78('0x5'));var Mustache=require(_0x8b78('0x6'));var util=require(_0x8b78('0x7'));var path=require(_0x8b78('0x8'));var sox=require(_0x8b78('0x9'));var csv=require(_0x8b78('0xa'));var ejs=require(_0x8b78('0xb'));var fs=require('fs');var fs_extra=require(_0x8b78('0xc'));var _=require(_0x8b78('0xd'));var squel=require(_0x8b78('0xe'));var crypto=require(_0x8b78('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8b78('0x10'));var toCsv=require(_0x8b78('0xa'));var querystring=require(_0x8b78('0x11'));var Papa=require(_0x8b78('0x12'));var Redis=require(_0x8b78('0x13'));var authService=require(_0x8b78('0x14'));var qs=require(_0x8b78('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b78('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x8b78('0x17'));var config=require(_0x8b78('0x18'));var licenseUtil=require(_0x8b78('0x19'));var db=require(_0x8b78('0x1a'))['db'];function respondWithStatusCode(_0x1c8f70,_0x62fb36){_0x62fb36=_0x62fb36||0xcc;return function(_0x4dc61d){if(_0x4dc61d){return _0x1c8f70[_0x8b78('0x1b')](_0x62fb36);}return _0x1c8f70[_0x8b78('0x1c')](_0x62fb36)[_0x8b78('0x1d')]();};}function respondWithResult(_0x1044ba,_0x32ffcc){_0x32ffcc=_0x32ffcc||0xc8;return function(_0x254235){if(_0x254235){return _0x1044ba['status'](_0x32ffcc)[_0x8b78('0x1e')](_0x254235);}};}function respondWithFilteredResult(_0x119f6b,_0x31635d){return function(_0xe635ba){if(_0xe635ba){var _0x5a96cc=typeof _0x31635d[_0x8b78('0x1f')]===_0x8b78('0x20')&&typeof _0x31635d['limit']===_0x8b78('0x20');var _0x3948b9=_0xe635ba['count'];var _0x459369=_0x5a96cc?0x0:_0x31635d['offset'];var _0x4151b1=_0x5a96cc?_0xe635ba[_0x8b78('0x21')]:_0x31635d['offset']+_0x31635d[_0x8b78('0x22')];var _0x51ae63;if(_0x4151b1>=_0x3948b9){_0x4151b1=_0x3948b9;_0x51ae63=0xc8;}else{_0x51ae63=0xce;}_0x119f6b['status'](_0x51ae63);return _0x119f6b[_0x8b78('0x23')](_0x8b78('0x24'),_0x459369+'-'+_0x4151b1+'/'+_0x3948b9)[_0x8b78('0x1e')](_0xe635ba);}return null;};}function patchUpdates(_0x2240c4){return function(_0x16552a){try{jsonpatch[_0x8b78('0x25')](_0x16552a,_0x2240c4,!![]);}catch(_0x2bbd6f){return BPromise[_0x8b78('0x26')](_0x2bbd6f);}return _0x16552a[_0x8b78('0x27')]();};}function saveUpdates(_0x162c78,_0x3a5d67){return function(_0x110b6f){if(_0x110b6f){return _0x110b6f[_0x8b78('0x28')](_0x162c78)['then'](function(_0x1a485a){return _0x1a485a;});}return null;};}function removeEntity(_0x27b618,_0x494626){return function(_0x3f4e90){if(_0x3f4e90){return _0x3f4e90[_0x8b78('0x29')]()[_0x8b78('0x2a')](function(){_0x27b618['status'](0xcc)[_0x8b78('0x1d')]();});}};}function handleEntityNotFound(_0x2c0b18,_0x4d58f7){return function(_0x340aad){if(!_0x340aad){_0x2c0b18['sendStatus'](0x194);}return _0x340aad;};}function handleError(_0x41ca61,_0x1d6db5){_0x1d6db5=_0x1d6db5||0x1f4;return function(_0x584e76){logger[_0x8b78('0x2b')](_0x584e76['stack']);if(_0x584e76['name']){delete _0x584e76[_0x8b78('0x2c')];}_0x41ca61['status'](_0x1d6db5)['send'](_0x584e76);};}exports[_0x8b78('0x2d')]=function(_0x200e57,_0x244c46){var _0x274982={},_0x3b654d={},_0x101dcc={'count':0x0,'rows':[]};var _0x20f87b=_[_0x8b78('0x2e')](db[_0x8b78('0x2f')]['rawAttributes'],function(_0x36637b){return{'name':_0x36637b['fieldName'],'type':_0x36637b[_0x8b78('0x30')][_0x8b78('0x31')]};});_0x3b654d[_0x8b78('0x32')]=_['map'](_0x20f87b,_0x8b78('0x2c'));_0x3b654d[_0x8b78('0x33')]=_['keys'](_0x200e57[_0x8b78('0x33')]);_0x3b654d[_0x8b78('0x34')]=_[_0x8b78('0x35')](_0x3b654d[_0x8b78('0x32')],_0x3b654d[_0x8b78('0x33')]);_0x274982[_0x8b78('0x36')]=_[_0x8b78('0x35')](_0x3b654d[_0x8b78('0x32')],qs[_0x8b78('0x37')](_0x200e57[_0x8b78('0x33')]['fields']));_0x274982['attributes']=_0x274982[_0x8b78('0x36')][_0x8b78('0x38')]?_0x274982[_0x8b78('0x36')]:_0x3b654d[_0x8b78('0x32')];if(!_0x200e57[_0x8b78('0x33')]['hasOwnProperty'](_0x8b78('0x39'))){_0x274982['limit']=qs['limit'](_0x200e57[_0x8b78('0x33')][_0x8b78('0x22')]);_0x274982[_0x8b78('0x1f')]=qs[_0x8b78('0x1f')](_0x200e57[_0x8b78('0x33')][_0x8b78('0x1f')]);}_0x274982[_0x8b78('0x3a')]=qs['sort'](_0x200e57['query']['sort']);_0x274982[_0x8b78('0x3b')]=qs[_0x8b78('0x34')](_[_0x8b78('0x3c')](_0x200e57['query'],_0x3b654d[_0x8b78('0x34')]),_0x20f87b);if(_0x200e57[_0x8b78('0x33')][_0x8b78('0x3d')]){_0x274982[_0x8b78('0x3b')]=_[_0x8b78('0x3e')](_0x274982[_0x8b78('0x3b')],{'$or':_[_0x8b78('0x2e')](_0x20f87b,function(_0x3fe4f7){if(_0x3fe4f7[_0x8b78('0x30')]!==_0x8b78('0x3f')){var _0x2839bb={};_0x2839bb[_0x3fe4f7['name']]={'$like':'%'+_0x200e57[_0x8b78('0x33')]['filter']+'%'};return _0x2839bb;}})});}_0x274982=_[_0x8b78('0x3e')]({},_0x274982,_0x200e57[_0x8b78('0x40')]);var _0x2d652c={'where':_0x274982[_0x8b78('0x3b')]};return db[_0x8b78('0x2f')][_0x8b78('0x21')](_0x2d652c)['then'](function(_0x5b3aea){_0x101dcc[_0x8b78('0x21')]=_0x5b3aea;if(_0x200e57[_0x8b78('0x33')][_0x8b78('0x41')]){_0x274982[_0x8b78('0x42')]=[{'all':!![]}];}return db[_0x8b78('0x2f')][_0x8b78('0x43')](_0x274982);})['then'](function(_0x125a2d){_0x101dcc['rows']=_0x125a2d;return _0x101dcc;})[_0x8b78('0x2a')](respondWithFilteredResult(_0x244c46,_0x274982))['catch'](handleError(_0x244c46,null));};exports['show']=function(_0x167ca3,_0x51ca18){var _0x12f1ef={'raw':!![],'where':{'id':_0x167ca3[_0x8b78('0x44')]['id']}},_0x210f23={};_0x210f23[_0x8b78('0x32')]=_[_0x8b78('0x45')](db[_0x8b78('0x2f')][_0x8b78('0x46')]);_0x210f23[_0x8b78('0x33')]=_[_0x8b78('0x45')](_0x167ca3[_0x8b78('0x33')]);_0x210f23[_0x8b78('0x34')]=_[_0x8b78('0x35')](_0x210f23[_0x8b78('0x32')],_0x210f23['query']);_0x12f1ef[_0x8b78('0x36')]=_[_0x8b78('0x35')](_0x210f23[_0x8b78('0x32')],qs[_0x8b78('0x37')](_0x167ca3[_0x8b78('0x33')][_0x8b78('0x37')]));_0x12f1ef['attributes']=_0x12f1ef['attributes'][_0x8b78('0x38')]?_0x12f1ef[_0x8b78('0x36')]:_0x210f23[_0x8b78('0x32')];if(_0x167ca3[_0x8b78('0x33')]['includeAll']){_0x12f1ef[_0x8b78('0x42')]=[{'all':!![]}];}_0x12f1ef=_[_0x8b78('0x3e')]({},_0x12f1ef,_0x167ca3['options']);return db[_0x8b78('0x2f')][_0x8b78('0x47')](_0x12f1ef)[_0x8b78('0x2a')](handleEntityNotFound(_0x51ca18,null))[_0x8b78('0x2a')](respondWithResult(_0x51ca18,null))[_0x8b78('0x48')](handleError(_0x51ca18,null));};exports[_0x8b78('0x49')]=function(_0x28a451,_0x1a29f6){return db[_0x8b78('0x2f')][_0x8b78('0x49')](_0x28a451[_0x8b78('0x4a')],{})[_0x8b78('0x2a')](respondWithResult(_0x1a29f6,0xc9))[_0x8b78('0x48')](handleError(_0x1a29f6,null));};exports[_0x8b78('0x28')]=function(_0x5b5140,_0x54e42d){if(_0x5b5140['body']['id']){delete _0x5b5140[_0x8b78('0x4a')]['id'];}return db['SquareReport'][_0x8b78('0x47')]({'where':{'id':_0x5b5140[_0x8b78('0x44')]['id']}})[_0x8b78('0x2a')](handleEntityNotFound(_0x54e42d,null))[_0x8b78('0x2a')](saveUpdates(_0x5b5140[_0x8b78('0x4a')],null))[_0x8b78('0x2a')](respondWithResult(_0x54e42d,null))[_0x8b78('0x48')](handleError(_0x54e42d,null));};exports[_0x8b78('0x29')]=function(_0x50fe7a,_0x53e86b){return db['SquareReport'][_0x8b78('0x47')]({'where':{'id':_0x50fe7a[_0x8b78('0x44')]['id']}})[_0x8b78('0x2a')](handleEntityNotFound(_0x53e86b,null))[_0x8b78('0x2a')](removeEntity(_0x53e86b,null))[_0x8b78('0x48')](handleError(_0x53e86b,null));};exports[_0x8b78('0x4b')]=function(_0x5bfdda,_0x6675a6){return db[_0x8b78('0x2f')][_0x8b78('0x4b')]()[_0x8b78('0x2a')](respondWithResult(_0x6675a6,null))[_0x8b78('0x48')](handleError(_0x6675a6,null));}; \ No newline at end of file +var _0xd7ad=['name','send','index','map','SquareReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack'];(function(_0x3971e6,_0x3ecbc5){var _0x283781=function(_0x3d78d1){while(--_0x3d78d1){_0x3971e6['push'](_0x3971e6['shift']());}};_0x283781(++_0x3ecbc5);}(_0xd7ad,0x144));var _0xdd7a=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xd7ad[_0xbf8ebe];return _0x1e25e8;};'use strict';var emlformat=require(_0xdd7a('0x0'));var rimraf=require(_0xdd7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd7a('0x2'));var rp=require(_0xdd7a('0x3'));var moment=require('moment');var BPromise=require(_0xdd7a('0x4'));var Mustache=require('mustache');var util=require(_0xdd7a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdd7a('0x6'));var ejs=require(_0xdd7a('0x7'));var fs=require('fs');var fs_extra=require(_0xdd7a('0x8'));var _=require('lodash');var squel=require(_0xdd7a('0x9'));var crypto=require('crypto');var jsforce=require(_0xdd7a('0xa'));var deskjs=require(_0xdd7a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdd7a('0xc'));var Papa=require(_0xdd7a('0xd'));var Redis=require(_0xdd7a('0xe'));var authService=require(_0xdd7a('0xf'));var qs=require(_0xdd7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd7a('0x11'));var logger=require(_0xdd7a('0x12'))('api');var utils=require(_0xdd7a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdd7a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54cdb1,_0x515afb){_0x515afb=_0x515afb||0xcc;return function(_0x3ae447){if(_0x3ae447){return _0x54cdb1[_0xdd7a('0x15')](_0x515afb);}return _0x54cdb1['status'](_0x515afb)['end']();};}function respondWithResult(_0x57062a,_0xc5c29b){_0xc5c29b=_0xc5c29b||0xc8;return function(_0x5b0eb6){if(_0x5b0eb6){return _0x57062a[_0xdd7a('0x16')](_0xc5c29b)['json'](_0x5b0eb6);}};}function respondWithFilteredResult(_0x1c4ae7,_0x459cdd){return function(_0x3f6218){if(_0x3f6218){var _0x272410=typeof _0x459cdd[_0xdd7a('0x17')]===_0xdd7a('0x18')&&typeof _0x459cdd['limit']===_0xdd7a('0x18');var _0x36868e=_0x3f6218[_0xdd7a('0x19')];var _0x35fa83=_0x272410?0x0:_0x459cdd[_0xdd7a('0x17')];var _0x3b9850=_0x272410?_0x3f6218[_0xdd7a('0x19')]:_0x459cdd[_0xdd7a('0x17')]+_0x459cdd['limit'];var _0x2d527a;if(_0x3b9850>=_0x36868e){_0x3b9850=_0x36868e;_0x2d527a=0xc8;}else{_0x2d527a=0xce;}_0x1c4ae7[_0xdd7a('0x16')](_0x2d527a);return _0x1c4ae7['set'](_0xdd7a('0x1a'),_0x35fa83+'-'+_0x3b9850+'/'+_0x36868e)['json'](_0x3f6218);}return null;};}function patchUpdates(_0x162f96){return function(_0x391c7a){try{jsonpatch[_0xdd7a('0x1b')](_0x391c7a,_0x162f96,!![]);}catch(_0x31887c){return BPromise[_0xdd7a('0x1c')](_0x31887c);}return _0x391c7a[_0xdd7a('0x1d')]();};}function saveUpdates(_0x352dd3,_0x45c17b){return function(_0x2b540d){if(_0x2b540d){return _0x2b540d[_0xdd7a('0x1e')](_0x352dd3)['then'](function(_0x5719dd){return _0x5719dd;});}return null;};}function removeEntity(_0xf3bbe7,_0xb0541b){return function(_0x7ade56){if(_0x7ade56){return _0x7ade56[_0xdd7a('0x1f')]()[_0xdd7a('0x20')](function(){_0xf3bbe7[_0xdd7a('0x16')](0xcc)[_0xdd7a('0x21')]();});}};}function handleEntityNotFound(_0x2538ba,_0x1320cf){return function(_0x548004){if(!_0x548004){_0x2538ba[_0xdd7a('0x15')](0x194);}return _0x548004;};}function handleError(_0x254e52,_0x298ea5){_0x298ea5=_0x298ea5||0x1f4;return function(_0xaa76c9){logger[_0xdd7a('0x22')](_0xaa76c9[_0xdd7a('0x23')]);if(_0xaa76c9[_0xdd7a('0x24')]){delete _0xaa76c9['name'];}_0x254e52['status'](_0x298ea5)[_0xdd7a('0x25')](_0xaa76c9);};}exports[_0xdd7a('0x26')]=function(_0x3ce6c0,_0x53943a){var _0x34f338={},_0x4fb236={},_0x4e5c49={'count':0x0,'rows':[]};var _0x5d9c8f=_[_0xdd7a('0x27')](db[_0xdd7a('0x28')][_0xdd7a('0x29')],function(_0x2c67e9){return{'name':_0x2c67e9['fieldName'],'type':_0x2c67e9[_0xdd7a('0x2a')][_0xdd7a('0x2b')]};});_0x4fb236[_0xdd7a('0x2c')]=_[_0xdd7a('0x27')](_0x5d9c8f,_0xdd7a('0x24'));_0x4fb236['query']=_[_0xdd7a('0x2d')](_0x3ce6c0[_0xdd7a('0x2e')]);_0x4fb236[_0xdd7a('0x2f')]=_[_0xdd7a('0x30')](_0x4fb236['model'],_0x4fb236[_0xdd7a('0x2e')]);_0x34f338[_0xdd7a('0x31')]=_[_0xdd7a('0x30')](_0x4fb236[_0xdd7a('0x2c')],qs['fields'](_0x3ce6c0[_0xdd7a('0x2e')]['fields']));_0x34f338['attributes']=_0x34f338[_0xdd7a('0x31')][_0xdd7a('0x32')]?_0x34f338[_0xdd7a('0x31')]:_0x4fb236[_0xdd7a('0x2c')];if(!_0x3ce6c0[_0xdd7a('0x2e')]['hasOwnProperty'](_0xdd7a('0x33'))){_0x34f338[_0xdd7a('0x34')]=qs['limit'](_0x3ce6c0[_0xdd7a('0x2e')][_0xdd7a('0x34')]);_0x34f338[_0xdd7a('0x17')]=qs[_0xdd7a('0x17')](_0x3ce6c0[_0xdd7a('0x2e')][_0xdd7a('0x17')]);}_0x34f338[_0xdd7a('0x35')]=qs['sort'](_0x3ce6c0[_0xdd7a('0x2e')][_0xdd7a('0x36')]);_0x34f338['where']=qs[_0xdd7a('0x2f')](_[_0xdd7a('0x37')](_0x3ce6c0[_0xdd7a('0x2e')],_0x4fb236[_0xdd7a('0x2f')]),_0x5d9c8f);if(_0x3ce6c0[_0xdd7a('0x2e')][_0xdd7a('0x38')]){_0x34f338['where']=_[_0xdd7a('0x39')](_0x34f338['where'],{'$or':_[_0xdd7a('0x27')](_0x5d9c8f,function(_0x37abc0){if(_0x37abc0[_0xdd7a('0x2a')]!==_0xdd7a('0x3a')){var _0x198b21={};_0x198b21[_0x37abc0['name']]={'$like':'%'+_0x3ce6c0[_0xdd7a('0x2e')][_0xdd7a('0x38')]+'%'};return _0x198b21;}})});}_0x34f338=_[_0xdd7a('0x39')]({},_0x34f338,_0x3ce6c0['options']);var _0x40e62f={'where':_0x34f338['where']};return db[_0xdd7a('0x28')]['count'](_0x40e62f)[_0xdd7a('0x20')](function(_0x8861fd){_0x4e5c49['count']=_0x8861fd;if(_0x3ce6c0['query'][_0xdd7a('0x3b')]){_0x34f338[_0xdd7a('0x3c')]=[{'all':!![]}];}return db[_0xdd7a('0x28')][_0xdd7a('0x3d')](_0x34f338);})[_0xdd7a('0x20')](function(_0xda48f5){_0x4e5c49[_0xdd7a('0x3e')]=_0xda48f5;return _0x4e5c49;})['then'](respondWithFilteredResult(_0x53943a,_0x34f338))[_0xdd7a('0x3f')](handleError(_0x53943a,null));};exports[_0xdd7a('0x40')]=function(_0x4233a8,_0x2232a6){var _0x353943={'raw':!![],'where':{'id':_0x4233a8['params']['id']}},_0x47db4f={};_0x47db4f[_0xdd7a('0x2c')]=_[_0xdd7a('0x2d')](db[_0xdd7a('0x28')]['rawAttributes']);_0x47db4f[_0xdd7a('0x2e')]=_[_0xdd7a('0x2d')](_0x4233a8['query']);_0x47db4f[_0xdd7a('0x2f')]=_[_0xdd7a('0x30')](_0x47db4f[_0xdd7a('0x2c')],_0x47db4f['query']);_0x353943[_0xdd7a('0x31')]=_['intersection'](_0x47db4f[_0xdd7a('0x2c')],qs[_0xdd7a('0x41')](_0x4233a8[_0xdd7a('0x2e')][_0xdd7a('0x41')]));_0x353943[_0xdd7a('0x31')]=_0x353943[_0xdd7a('0x31')]['length']?_0x353943[_0xdd7a('0x31')]:_0x47db4f['model'];if(_0x4233a8[_0xdd7a('0x2e')]['includeAll']){_0x353943['include']=[{'all':!![]}];}_0x353943=_['merge']({},_0x353943,_0x4233a8[_0xdd7a('0x42')]);return db[_0xdd7a('0x28')]['find'](_0x353943)[_0xdd7a('0x20')](handleEntityNotFound(_0x2232a6,null))[_0xdd7a('0x20')](respondWithResult(_0x2232a6,null))[_0xdd7a('0x3f')](handleError(_0x2232a6,null));};exports['create']=function(_0xb0724a,_0x147e23){return db[_0xdd7a('0x28')][_0xdd7a('0x43')](_0xb0724a['body'],{})[_0xdd7a('0x20')](respondWithResult(_0x147e23,0xc9))[_0xdd7a('0x3f')](handleError(_0x147e23,null));};exports[_0xdd7a('0x1e')]=function(_0x32e25a,_0x22059f){if(_0x32e25a[_0xdd7a('0x44')]['id']){delete _0x32e25a['body']['id'];}return db[_0xdd7a('0x28')][_0xdd7a('0x45')]({'where':{'id':_0x32e25a[_0xdd7a('0x46')]['id']}})[_0xdd7a('0x20')](handleEntityNotFound(_0x22059f,null))['then'](saveUpdates(_0x32e25a['body'],null))[_0xdd7a('0x20')](respondWithResult(_0x22059f,null))[_0xdd7a('0x3f')](handleError(_0x22059f,null));};exports[_0xdd7a('0x1f')]=function(_0x16442c,_0x3ddf34){return db[_0xdd7a('0x28')][_0xdd7a('0x45')]({'where':{'id':_0x16442c[_0xdd7a('0x46')]['id']}})[_0xdd7a('0x20')](handleEntityNotFound(_0x3ddf34,null))[_0xdd7a('0x20')](removeEntity(_0x3ddf34,null))[_0xdd7a('0x3f')](handleError(_0x3ddf34,null));};exports[_0xdd7a('0x47')]=function(_0x5dc7ff,_0x4c3e4b){return db[_0xdd7a('0x28')][_0xdd7a('0x47')]()[_0xdd7a('0x20')](respondWithResult(_0x4c3e4b,null))[_0xdd7a('0x3f')](handleError(_0x4c3e4b,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ef2a297..c572cf2 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 _0x73a7=['define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x1f153a,_0x4a5e67){var _0x54c5ae=function(_0x577cda){while(--_0x577cda){_0x1f153a['push'](_0x1f153a['shift']());}};_0x54c5ae(++_0x4a5e67);}(_0x73a7,0x149));var _0x773a=function(_0x4b9cfe,_0x10415b){_0x4b9cfe=_0x4b9cfe-0x0;var _0x455e7c=_0x73a7[_0x4b9cfe];return _0x455e7c;};'use strict';var _=require(_0x773a('0x0'));var util=require(_0x773a('0x1'));var logger=require(_0x773a('0x2'))(_0x773a('0x3'));var moment=require(_0x773a('0x4'));var BPromise=require(_0x773a('0x5'));var rp=require(_0x773a('0x6'));var fs=require('fs');var path=require(_0x773a('0x7'));var rimraf=require(_0x773a('0x8'));var config=require(_0x773a('0x9'));var attributes=require(_0x773a('0xa'));module['exports']=function(_0xcdac86,_0x75752b){return _0xcdac86[_0x773a('0xb')](_0x773a('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x773a('0xd'),'fields':[_0x773a('0xe'),_0x773a('0xf')]},{'name':_0x773a('0x10'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x680f=['SquareReport','report_square','uniqueid','leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x680f,0x11c));var _0xf680=function(_0xc315de,_0x5dc877){_0xc315de=_0xc315de-0x0;var _0x11a627=_0x680f[_0xc315de];return _0x11a627;};'use strict';var _=require(_0xf680('0x0'));var util=require(_0xf680('0x1'));var logger=require(_0xf680('0x2'))('api');var moment=require(_0xf680('0x3'));var BPromise=require(_0xf680('0x4'));var rp=require(_0xf680('0x5'));var fs=require('fs');var path=require(_0xf680('0x6'));var rimraf=require(_0xf680('0x7'));var config=require(_0xf680('0x8'));var attributes=require('./squareReport.attributes');module[_0xf680('0x9')]=function(_0xca150b,_0x2b5b2e){return _0xca150b['define'](_0xf680('0xa'),attributes,{'tableName':_0xf680('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xf680('0xc'),'project_name']},{'name':'leaveAt','fields':[_0xf680('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 345a965..a5fc376 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 _0x760f=['client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport','create','options','raw','then','CreateSquareReport','catch','UpdateSquareReport','update','attributes','lodash','util','../../mysqldb','../../config/logger','rpc'];(function(_0x5f51d2,_0x4f0133){var _0x24bf08=function(_0x25e6b5){while(--_0x25e6b5){_0x5f51d2['push'](_0x5f51d2['shift']());}};_0x24bf08(++_0x4f0133);}(_0x760f,0x133));var _0xf760=function(_0x45bf7d,_0x395393){_0x45bf7d=_0x45bf7d-0x0;var _0x351c5b=_0x760f[_0x45bf7d];return _0x351c5b;};'use strict';var _=require(_0xf760('0x0'));var util=require(_0xf760('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf760('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf760('0x3'))(_0xf760('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf760('0x5')][_0xf760('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x588f39,_0x424f82,_0x442878){return new BPromise(function(_0x2b0e1c,_0x3d34d0){return client['request'](_0x588f39,_0x442878)['then'](function(_0x1ff4c8){logger[_0xf760('0x7')](_0xf760('0x8'),_0x424f82,_0xf760('0x9'));logger[_0xf760('0xa')](_0xf760('0xb'),_0x424f82,_0xf760('0x9'),JSON[_0xf760('0xc')](_0x1ff4c8));if(_0x1ff4c8[_0xf760('0xd')]){if(_0x1ff4c8['error'][_0xf760('0xe')]===0x1f4){logger[_0xf760('0xd')](_0xf760('0x8'),_0x424f82,_0x1ff4c8[_0xf760('0xd')][_0xf760('0xf')]);return _0x3d34d0(_0x1ff4c8[_0xf760('0xd')][_0xf760('0xf')]);}logger[_0xf760('0xd')](_0xf760('0x8'),_0x424f82,_0x1ff4c8['error'][_0xf760('0xf')]);return _0x2b0e1c(_0x1ff4c8[_0xf760('0xd')]['message']);}else{logger['info'](_0xf760('0x8'),_0x424f82,_0xf760('0x9'));_0x2b0e1c(_0x1ff4c8['result'][_0xf760('0xf')]);}})['catch'](function(_0xa1c39e){logger['error'](_0xf760('0x8'),_0x424f82,_0xa1c39e);_0x3d34d0(_0xa1c39e);});});}exports['CreateSquareReport']=function(_0x646847){var _0xaaf1e9=this;return new Promise(function(_0x229c5c,_0x106cfb){return db[_0xf760('0x10')][_0xf760('0x11')](_0x646847['body'],{'raw':_0x646847['options']?_0x646847[_0xf760('0x12')][_0xf760('0x13')]===undefined?!![]:![]:!![]})[_0xf760('0x14')](function(_0x455d5f){logger['info'](_0xf760('0x15'),_0x646847);logger['debug'](_0xf760('0x15'),_0x646847,JSON[_0xf760('0xc')](_0x455d5f));_0x229c5c(_0x455d5f);})[_0xf760('0x16')](function(_0x13c36b){logger[_0xf760('0xd')](_0xf760('0x15'),_0x13c36b['message'],_0x646847);_0x106cfb(_0xaaf1e9['error'](0x1f4,_0x13c36b[_0xf760('0xf')]));});});};exports[_0xf760('0x17')]=function(_0x5a628f){var _0x4c5941=this;return new Promise(function(_0x265e1f,_0x1cd185){return db[_0xf760('0x10')][_0xf760('0x18')](_0x5a628f['body'],{'raw':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')][_0xf760('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a628f['options']?_0x5a628f[_0xf760('0x12')]['where']||null:null,'attributes':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')][_0xf760('0x19')]||null:null,'limit':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')]['limit']||null:null})[_0xf760('0x14')](function(_0x4052ee){logger['info'](_0xf760('0x17'),_0x5a628f);logger[_0xf760('0xa')](_0xf760('0x17'),_0x5a628f,JSON[_0xf760('0xc')](_0x4052ee));_0x265e1f(_0x4052ee);})[_0xf760('0x16')](function(_0x59f020){logger[_0xf760('0xd')]('UpdateSquareReport',_0x59f020[_0xf760('0xf')],_0x5a628f);_0x1cd185(_0x4c5941[_0xf760('0xd')](0x1f4,_0x59f020['message']));});});}; \ No newline at end of file +var _0x3987=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareReport','SquareReport','body','options','raw','then','debug','stringify','UpdateSquareReport','update','attributes','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x3987,0x9b));var _0x7398=function(_0xb6b33a,_0x1427c5){_0xb6b33a=_0xb6b33a-0x0;var _0x2f747f=_0x3987[_0xb6b33a];return _0x2f747f;};'use strict';var _=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var moment=require('moment');var BPromise=require(_0x7398('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7398('0x3'));var db=require(_0x7398('0x4'))['db'];var utils=require(_0x7398('0x5'));var logger=require(_0x7398('0x6'))(_0x7398('0x7'));var config=require('../../config/environment');var jayson=require(_0x7398('0x8'));var client=jayson[_0x7398('0x9')][_0x7398('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22458e,_0xb5094,_0x1297e9){return new BPromise(function(_0x13de25,_0xa46629){return client[_0x7398('0xb')](_0x22458e,_0x1297e9)['then'](function(_0x5e3bae){logger['info'](_0x7398('0xc'),_0xb5094,_0x7398('0xd'));logger['debug'](_0x7398('0xe'),_0xb5094,_0x7398('0xd'),JSON['stringify'](_0x5e3bae));if(_0x5e3bae['error']){if(_0x5e3bae[_0x7398('0xf')][_0x7398('0x10')]===0x1f4){logger[_0x7398('0xf')](_0x7398('0xc'),_0xb5094,_0x5e3bae['error'][_0x7398('0x11')]);return _0xa46629(_0x5e3bae[_0x7398('0xf')]['message']);}logger[_0x7398('0xf')]('SquareReport,\x20%s,\x20%s',_0xb5094,_0x5e3bae[_0x7398('0xf')][_0x7398('0x11')]);return _0x13de25(_0x5e3bae['error'][_0x7398('0x11')]);}else{logger[_0x7398('0x12')](_0x7398('0xc'),_0xb5094,_0x7398('0xd'));_0x13de25(_0x5e3bae[_0x7398('0x13')]['message']);}})[_0x7398('0x14')](function(_0x1106a1){logger[_0x7398('0xf')]('SquareReport,\x20%s,\x20%s',_0xb5094,_0x1106a1);_0xa46629(_0x1106a1);});});}exports[_0x7398('0x15')]=function(_0x515931){var _0x46e6a1=this;return new Promise(function(_0x1f888f,_0x46d85f){return db[_0x7398('0x16')]['create'](_0x515931[_0x7398('0x17')],{'raw':_0x515931[_0x7398('0x18')]?_0x515931[_0x7398('0x18')][_0x7398('0x19')]===undefined?!![]:![]:!![]})[_0x7398('0x1a')](function(_0x5135ab){logger[_0x7398('0x12')]('CreateSquareReport',_0x515931);logger[_0x7398('0x1b')](_0x7398('0x15'),_0x515931,JSON[_0x7398('0x1c')](_0x5135ab));_0x1f888f(_0x5135ab);})['catch'](function(_0x356002){logger['error']('CreateSquareReport',_0x356002['message'],_0x515931);_0x46d85f(_0x46e6a1[_0x7398('0xf')](0x1f4,_0x356002[_0x7398('0x11')]));});});};exports[_0x7398('0x1d')]=function(_0x3d093c){var _0x3a82e4=this;return new Promise(function(_0x464ef5,_0x8219d0){return db[_0x7398('0x16')][_0x7398('0x1e')](_0x3d093c[_0x7398('0x17')],{'raw':_0x3d093c[_0x7398('0x18')]?_0x3d093c[_0x7398('0x18')][_0x7398('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d093c[_0x7398('0x18')]?_0x3d093c['options']['where']||null:null,'attributes':_0x3d093c[_0x7398('0x18')]?_0x3d093c[_0x7398('0x18')][_0x7398('0x1f')]||null:null,'limit':_0x3d093c[_0x7398('0x18')]?_0x3d093c[_0x7398('0x18')]['limit']||null:null})[_0x7398('0x1a')](function(_0x23f0dc){logger[_0x7398('0x12')]('UpdateSquareReport',_0x3d093c);logger[_0x7398('0x1b')]('UpdateSquareReport',_0x3d093c,JSON['stringify'](_0x23f0dc));_0x464ef5(_0x23f0dc);})[_0x7398('0x14')](function(_0x204b1b){logger[_0x7398('0xf')]('UpdateSquareReport',_0x204b1b[_0x7398('0x11')],_0x3d093c);_0x8219d0(_0x3a82e4[_0x7398('0xf')](0x1f4,_0x204b1b[_0x7398('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 715467e..be15b84 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 _0xd8c7=['Router','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x4c9faf,_0x1f480b){var _0x31860a=function(_0x230e46){while(--_0x230e46){_0x4c9faf['push'](_0x4c9faf['shift']());}};_0x31860a(++_0x1f480b);}(_0xd8c7,0x14b));var _0x7d8c=function(_0x491d85,_0x32599a){_0x491d85=_0x491d85-0x0;var _0x4a4609=_0xd8c7[_0x491d85];return _0x4a4609;};'use strict';var multer=require(_0x7d8c('0x0'));var util=require(_0x7d8c('0x1'));var path=require(_0x7d8c('0x2'));var timeout=require(_0x7d8c('0x3'));var express=require(_0x7d8c('0x4'));var router=express[_0x7d8c('0x5')]();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(_0x7d8c('0x6'));router[_0x7d8c('0x7')]('/',auth[_0x7d8c('0x8')](),controller[_0x7d8c('0x9')]);router[_0x7d8c('0x7')](_0x7d8c('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7d8c('0xb'),auth[_0x7d8c('0x8')](),controller['show']);router[_0x7d8c('0xc')]('/',auth[_0x7d8c('0x8')](),controller[_0x7d8c('0xd')]);router['put']('/:id',auth[_0x7d8c('0x8')](),controller['update']);router[_0x7d8c('0xe')](_0x7d8c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d8c('0xf')]=router; \ No newline at end of file +var _0xf5eb=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf5eb,0x1ce));var _0xbf5e=function(_0xab326c,_0x4c0bd8){_0xab326c=_0xab326c-0x0;var _0x3a4648=_0xf5eb[_0xab326c];return _0x3a4648;};'use strict';var multer=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var path=require('path');var timeout=require(_0xbf5e('0x2'));var express=require(_0xbf5e('0x3'));var router=express[_0xbf5e('0x4')]();var fs_extra=require(_0xbf5e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf5e('0x6'));var controller=require(_0xbf5e('0x7'));router[_0xbf5e('0x8')]('/',auth['isAuthenticated'](),controller[_0xbf5e('0x9')]);router['get'](_0xbf5e('0xa'),auth['isAuthenticated'](),controller[_0xbf5e('0xb')]);router[_0xbf5e('0x8')]('/:id',auth[_0xbf5e('0xc')](),controller[_0xbf5e('0xd')]);router[_0xbf5e('0xe')]('/',auth[_0xbf5e('0xc')](),controller['create']);router[_0xbf5e('0xf')](_0xbf5e('0x10'),auth[_0xbf5e('0xc')](),controller[_0xbf5e('0x11')]);router['delete'](_0xbf5e('0x10'),auth['isAuthenticated'](),controller[_0xbf5e('0x12')]);module[_0xbf5e('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 10cb282..d0cdfc7 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 _0x8634=['STRING','TEXT','sequelize','exports'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x8634,0xa2));var _0x4863=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x8634[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require(_0x4863('0x0'));module[_0x4863('0x1')]={'uniqueid':{'type':Sequelize[_0x4863('0x2')]},'node':{'type':Sequelize[_0x4863('0x2')]},'application':{'type':Sequelize[_0x4863('0x2')]},'data':{'type':Sequelize[_0x4863('0x3')]},'project_name':{'type':Sequelize[_0x4863('0x2')]},'callerid':{'type':Sequelize[_0x4863('0x2')]}}; \ No newline at end of file +var _0x2cb6=['STRING','TEXT','exports'];(function(_0x24d474,_0x5ee0fe){var _0x46dab2=function(_0x216510){while(--_0x216510){_0x24d474['push'](_0x24d474['shift']());}};_0x46dab2(++_0x5ee0fe);}(_0x2cb6,0xe6));var _0x62cb=function(_0x445dd8,_0x58ef88){_0x445dd8=_0x445dd8-0x0;var _0x583930=_0x2cb6[_0x445dd8];return _0x583930;};'use strict';var Sequelize=require('sequelize');module[_0x62cb('0x0')]={'uniqueid':{'type':Sequelize[_0x62cb('0x1')]},'node':{'type':Sequelize[_0x62cb('0x1')]},'application':{'type':Sequelize[_0x62cb('0x1')]},'data':{'type':Sequelize[_0x62cb('0x2')]},'project_name':{'type':Sequelize[_0x62cb('0x1')]},'callerid':{'type':Sequelize[_0x62cb('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 7fbd5fc..2dd4cd4 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 _0x3142=['catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','SquareDetailsReport','findAll','rows','show','params','find'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x3142,0x1e3));var _0x2314=function(_0x4f15d2,_0x2086cb){_0x4f15d2=_0x4f15d2-0x0;var _0x2522b6=_0x3142[_0x4f15d2];return _0x2522b6;};'use strict';var emlformat=require(_0x2314('0x0'));var rimraf=require(_0x2314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2314('0x2'));var rp=require(_0x2314('0x3'));var moment=require(_0x2314('0x4'));var BPromise=require(_0x2314('0x5'));var Mustache=require(_0x2314('0x6'));var util=require(_0x2314('0x7'));var path=require(_0x2314('0x8'));var sox=require(_0x2314('0x9'));var csv=require(_0x2314('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2314('0xb'));var _=require(_0x2314('0xc'));var squel=require(_0x2314('0xd'));var crypto=require(_0x2314('0xe'));var jsforce=require(_0x2314('0xf'));var deskjs=require(_0x2314('0x10'));var toCsv=require(_0x2314('0xa'));var querystring=require(_0x2314('0x11'));var Papa=require('papaparse');var Redis=require(_0x2314('0x12'));var authService=require(_0x2314('0x13'));var qs=require(_0x2314('0x14'));var as=require(_0x2314('0x15'));var hardwareService=require(_0x2314('0x16'));var logger=require(_0x2314('0x17'))(_0x2314('0x18'));var utils=require(_0x2314('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2314('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4062d9,_0x308521){_0x308521=_0x308521||0xcc;return function(_0x35beb2){if(_0x35beb2){return _0x4062d9[_0x2314('0x1b')](_0x308521);}return _0x4062d9[_0x2314('0x1c')](_0x308521)['end']();};}function respondWithResult(_0x49d40d,_0x5d40ef){_0x5d40ef=_0x5d40ef||0xc8;return function(_0x1a7957){if(_0x1a7957){return _0x49d40d[_0x2314('0x1c')](_0x5d40ef)[_0x2314('0x1d')](_0x1a7957);}};}function respondWithFilteredResult(_0x169800,_0x4626bb){return function(_0x502598){if(_0x502598){var _0x4a5c92=typeof _0x4626bb[_0x2314('0x1e')]===_0x2314('0x1f')&&typeof _0x4626bb[_0x2314('0x20')]===_0x2314('0x1f');var _0x5b2064=_0x502598[_0x2314('0x21')];var _0x1c9167=_0x4a5c92?0x0:_0x4626bb[_0x2314('0x1e')];var _0x104324=_0x4a5c92?_0x502598['count']:_0x4626bb[_0x2314('0x1e')]+_0x4626bb['limit'];var _0x10495f;if(_0x104324>=_0x5b2064){_0x104324=_0x5b2064;_0x10495f=0xc8;}else{_0x10495f=0xce;}_0x169800[_0x2314('0x1c')](_0x10495f);return _0x169800[_0x2314('0x22')](_0x2314('0x23'),_0x1c9167+'-'+_0x104324+'/'+_0x5b2064)['json'](_0x502598);}return null;};}function patchUpdates(_0x30ff4e){return function(_0xbf9285){try{jsonpatch[_0x2314('0x24')](_0xbf9285,_0x30ff4e,!![]);}catch(_0x140a83){return BPromise['reject'](_0x140a83);}return _0xbf9285[_0x2314('0x25')]();};}function saveUpdates(_0x15eca0,_0x443787){return function(_0x383e18){if(_0x383e18){return _0x383e18[_0x2314('0x26')](_0x15eca0)[_0x2314('0x27')](function(_0x383d7f){return _0x383d7f;});}return null;};}function removeEntity(_0x21eeec,_0xa9c736){return function(_0x653141){if(_0x653141){return _0x653141[_0x2314('0x28')]()['then'](function(){_0x21eeec[_0x2314('0x1c')](0xcc)[_0x2314('0x29')]();});}};}function handleEntityNotFound(_0x1ebc59,_0x466e2f){return function(_0x22c467){if(!_0x22c467){_0x1ebc59[_0x2314('0x1b')](0x194);}return _0x22c467;};}function handleError(_0x4b5887,_0x1e844d){_0x1e844d=_0x1e844d||0x1f4;return function(_0x4d502e){logger[_0x2314('0x2a')](_0x4d502e['stack']);if(_0x4d502e[_0x2314('0x2b')]){delete _0x4d502e[_0x2314('0x2b')];}_0x4b5887[_0x2314('0x1c')](_0x1e844d)[_0x2314('0x2c')](_0x4d502e);};}exports[_0x2314('0x2d')]=function(_0x27cea7,_0x2dae75){var _0x48e0f0={},_0x410327={},_0x25d77c={'count':0x0,'rows':[]};var _0x188c10=_[_0x2314('0x2e')](db['SquareDetailsReport'][_0x2314('0x2f')],function(_0x4c0fea){return{'name':_0x4c0fea[_0x2314('0x30')],'type':_0x4c0fea['type'][_0x2314('0x31')]};});_0x410327[_0x2314('0x32')]=_[_0x2314('0x2e')](_0x188c10,_0x2314('0x2b'));_0x410327['query']=_[_0x2314('0x33')](_0x27cea7[_0x2314('0x34')]);_0x410327[_0x2314('0x35')]=_[_0x2314('0x36')](_0x410327[_0x2314('0x32')],_0x410327[_0x2314('0x34')]);_0x48e0f0[_0x2314('0x37')]=_['intersection'](_0x410327['model'],qs['fields'](_0x27cea7[_0x2314('0x34')][_0x2314('0x38')]));_0x48e0f0[_0x2314('0x37')]=_0x48e0f0[_0x2314('0x37')][_0x2314('0x39')]?_0x48e0f0['attributes']:_0x410327[_0x2314('0x32')];if(!_0x27cea7['query'][_0x2314('0x3a')](_0x2314('0x3b'))){_0x48e0f0['limit']=qs['limit'](_0x27cea7[_0x2314('0x34')]['limit']);_0x48e0f0[_0x2314('0x1e')]=qs[_0x2314('0x1e')](_0x27cea7[_0x2314('0x34')]['offset']);}_0x48e0f0[_0x2314('0x3c')]=qs[_0x2314('0x3d')](_0x27cea7['query'][_0x2314('0x3d')]);_0x48e0f0[_0x2314('0x3e')]=qs[_0x2314('0x35')](_[_0x2314('0x3f')](_0x27cea7[_0x2314('0x34')],_0x410327[_0x2314('0x35')]),_0x188c10);if(_0x27cea7[_0x2314('0x34')][_0x2314('0x40')]){_0x48e0f0['where']=_[_0x2314('0x41')](_0x48e0f0[_0x2314('0x3e')],{'$or':_[_0x2314('0x2e')](_0x188c10,function(_0x1db52d){if(_0x1db52d[_0x2314('0x42')]!==_0x2314('0x43')){var _0x805407={};_0x805407[_0x1db52d['name']]={'$like':'%'+_0x27cea7[_0x2314('0x34')][_0x2314('0x40')]+'%'};return _0x805407;}})});}_0x48e0f0=_[_0x2314('0x41')]({},_0x48e0f0,_0x27cea7[_0x2314('0x44')]);var _0x2c0dbd={'where':_0x48e0f0[_0x2314('0x3e')]};return db['SquareDetailsReport'][_0x2314('0x21')](_0x2c0dbd)[_0x2314('0x27')](function(_0x3e0ae3){_0x25d77c[_0x2314('0x21')]=_0x3e0ae3;if(_0x27cea7['query'][_0x2314('0x45')]){_0x48e0f0[_0x2314('0x46')]=[{'all':!![]}];}return db[_0x2314('0x47')][_0x2314('0x48')](_0x48e0f0);})['then'](function(_0x4b3dd3){_0x25d77c[_0x2314('0x49')]=_0x4b3dd3;return _0x25d77c;})[_0x2314('0x27')](respondWithFilteredResult(_0x2dae75,_0x48e0f0))['catch'](handleError(_0x2dae75,null));};exports[_0x2314('0x4a')]=function(_0x4f1466,_0x20e6d2){var _0xf74fcb={'raw':!![],'where':{'id':_0x4f1466[_0x2314('0x4b')]['id']}},_0xe73044={};_0xe73044['model']=_[_0x2314('0x33')](db[_0x2314('0x47')][_0x2314('0x2f')]);_0xe73044[_0x2314('0x34')]=_[_0x2314('0x33')](_0x4f1466[_0x2314('0x34')]);_0xe73044[_0x2314('0x35')]=_[_0x2314('0x36')](_0xe73044[_0x2314('0x32')],_0xe73044[_0x2314('0x34')]);_0xf74fcb[_0x2314('0x37')]=_[_0x2314('0x36')](_0xe73044[_0x2314('0x32')],qs[_0x2314('0x38')](_0x4f1466[_0x2314('0x34')][_0x2314('0x38')]));_0xf74fcb['attributes']=_0xf74fcb['attributes'][_0x2314('0x39')]?_0xf74fcb[_0x2314('0x37')]:_0xe73044[_0x2314('0x32')];if(_0x4f1466[_0x2314('0x34')]['includeAll']){_0xf74fcb['include']=[{'all':!![]}];}_0xf74fcb=_[_0x2314('0x41')]({},_0xf74fcb,_0x4f1466[_0x2314('0x44')]);return db['SquareDetailsReport'][_0x2314('0x4c')](_0xf74fcb)[_0x2314('0x27')](handleEntityNotFound(_0x20e6d2,null))['then'](respondWithResult(_0x20e6d2,null))[_0x2314('0x4d')](handleError(_0x20e6d2,null));};exports['create']=function(_0x29a56f,_0x4106b6){return db[_0x2314('0x47')]['create'](_0x29a56f['body'],{})[_0x2314('0x27')](respondWithResult(_0x4106b6,0xc9))[_0x2314('0x4d')](handleError(_0x4106b6,null));};exports[_0x2314('0x26')]=function(_0x184f62,_0x119c1e){if(_0x184f62['body']['id']){delete _0x184f62[_0x2314('0x4e')]['id'];}return db[_0x2314('0x47')][_0x2314('0x4c')]({'where':{'id':_0x184f62[_0x2314('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119c1e,null))[_0x2314('0x27')](saveUpdates(_0x184f62[_0x2314('0x4e')],null))[_0x2314('0x27')](respondWithResult(_0x119c1e,null))[_0x2314('0x4d')](handleError(_0x119c1e,null));};exports['destroy']=function(_0x228df3,_0x2cc37c){return db[_0x2314('0x47')][_0x2314('0x4c')]({'where':{'id':_0x228df3[_0x2314('0x4b')]['id']}})[_0x2314('0x27')](handleEntityNotFound(_0x2cc37c,null))[_0x2314('0x27')](removeEntity(_0x2cc37c,null))[_0x2314('0x4d')](handleError(_0x2cc37c,null));};exports['describe']=function(_0x5df1b4,_0xeed9c3){return db['SquareDetailsReport'][_0x2314('0x4f')]()[_0x2314('0x27')](respondWithResult(_0xeed9c3,null))[_0x2314('0x4d')](handleError(_0xeed9c3,null));}; \ No newline at end of file +var _0xbe15=['attributes','fields','length','nolimit','order','sort','where','filter','merge','options','include','rows','show','params','includeAll','create','body','find','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x1be1e2,_0x18ab4f){var _0x3c125d=function(_0x577ba8){while(--_0x577ba8){_0x1be1e2['push'](_0x1be1e2['shift']());}};_0x3c125d(++_0x18ab4f);}(_0xbe15,0xaa));var _0x5be1=function(_0x568358,_0x55bda0){_0x568358=_0x568358-0x0;var _0x2c0bbd=_0xbe15[_0x568358];return _0x2c0bbd;};'use strict';var emlformat=require(_0x5be1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5be1('0x1'));var jsonpatch=require(_0x5be1('0x2'));var rp=require(_0x5be1('0x3'));var moment=require(_0x5be1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5be1('0x5'));var util=require(_0x5be1('0x6'));var path=require(_0x5be1('0x7'));var sox=require(_0x5be1('0x8'));var csv=require(_0x5be1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5be1('0xa'));var _=require(_0x5be1('0xb'));var squel=require('squel');var crypto=require(_0x5be1('0xc'));var jsforce=require(_0x5be1('0xd'));var deskjs=require(_0x5be1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5be1('0xf'));var Papa=require(_0x5be1('0x10'));var Redis=require('ioredis');var authService=require(_0x5be1('0x11'));var qs=require(_0x5be1('0x12'));var as=require(_0x5be1('0x13'));var hardwareService=require(_0x5be1('0x14'));var logger=require(_0x5be1('0x15'))(_0x5be1('0x16'));var utils=require(_0x5be1('0x17'));var config=require(_0x5be1('0x18'));var licenseUtil=require(_0x5be1('0x19'));var db=require(_0x5be1('0x1a'))['db'];function respondWithStatusCode(_0x1d595f,_0xb73a1d){_0xb73a1d=_0xb73a1d||0xcc;return function(_0x515e0f){if(_0x515e0f){return _0x1d595f[_0x5be1('0x1b')](_0xb73a1d);}return _0x1d595f[_0x5be1('0x1c')](_0xb73a1d)[_0x5be1('0x1d')]();};}function respondWithResult(_0x59055a,_0x26921e){_0x26921e=_0x26921e||0xc8;return function(_0x5db6d1){if(_0x5db6d1){return _0x59055a[_0x5be1('0x1c')](_0x26921e)[_0x5be1('0x1e')](_0x5db6d1);}};}function respondWithFilteredResult(_0x39c51f,_0x389b23){return function(_0x272dd6){if(_0x272dd6){var _0x3ee7a1=typeof _0x389b23['offset']===_0x5be1('0x1f')&&typeof _0x389b23[_0x5be1('0x20')]==='undefined';var _0x992b57=_0x272dd6[_0x5be1('0x21')];var _0x53f627=_0x3ee7a1?0x0:_0x389b23[_0x5be1('0x22')];var _0x1076e8=_0x3ee7a1?_0x272dd6[_0x5be1('0x21')]:_0x389b23['offset']+_0x389b23[_0x5be1('0x20')];var _0x26766f;if(_0x1076e8>=_0x992b57){_0x1076e8=_0x992b57;_0x26766f=0xc8;}else{_0x26766f=0xce;}_0x39c51f[_0x5be1('0x1c')](_0x26766f);return _0x39c51f['set'](_0x5be1('0x23'),_0x53f627+'-'+_0x1076e8+'/'+_0x992b57)['json'](_0x272dd6);}return null;};}function patchUpdates(_0x166088){return function(_0x561388){try{jsonpatch[_0x5be1('0x24')](_0x561388,_0x166088,!![]);}catch(_0x49dcd6){return BPromise[_0x5be1('0x25')](_0x49dcd6);}return _0x561388['save']();};}function saveUpdates(_0x44867b,_0x25c030){return function(_0x3662f6){if(_0x3662f6){return _0x3662f6[_0x5be1('0x26')](_0x44867b)[_0x5be1('0x27')](function(_0x3f0d68){return _0x3f0d68;});}return null;};}function removeEntity(_0x1ca4f4,_0x3330f4){return function(_0x462859){if(_0x462859){return _0x462859[_0x5be1('0x28')]()[_0x5be1('0x27')](function(){_0x1ca4f4[_0x5be1('0x1c')](0xcc)[_0x5be1('0x1d')]();});}};}function handleEntityNotFound(_0x4695dd,_0x3ae48e){return function(_0x51f506){if(!_0x51f506){_0x4695dd['sendStatus'](0x194);}return _0x51f506;};}function handleError(_0x14b0a3,_0x1befd2){_0x1befd2=_0x1befd2||0x1f4;return function(_0x5da41a){logger[_0x5be1('0x29')](_0x5da41a[_0x5be1('0x2a')]);if(_0x5da41a[_0x5be1('0x2b')]){delete _0x5da41a['name'];}_0x14b0a3[_0x5be1('0x1c')](_0x1befd2)['send'](_0x5da41a);};}exports[_0x5be1('0x2c')]=function(_0xf37ad7,_0x2c408c){var _0x24ff45={},_0x429ac5={},_0x2c4278={'count':0x0,'rows':[]};var _0x20acd5=_[_0x5be1('0x2d')](db[_0x5be1('0x2e')][_0x5be1('0x2f')],function(_0xd4c43e){return{'name':_0xd4c43e[_0x5be1('0x30')],'type':_0xd4c43e[_0x5be1('0x31')][_0x5be1('0x32')]};});_0x429ac5[_0x5be1('0x33')]=_[_0x5be1('0x2d')](_0x20acd5,_0x5be1('0x2b'));_0x429ac5[_0x5be1('0x34')]=_[_0x5be1('0x35')](_0xf37ad7['query']);_0x429ac5['filters']=_[_0x5be1('0x36')](_0x429ac5[_0x5be1('0x33')],_0x429ac5[_0x5be1('0x34')]);_0x24ff45[_0x5be1('0x37')]=_[_0x5be1('0x36')](_0x429ac5[_0x5be1('0x33')],qs[_0x5be1('0x38')](_0xf37ad7['query'][_0x5be1('0x38')]));_0x24ff45[_0x5be1('0x37')]=_0x24ff45[_0x5be1('0x37')][_0x5be1('0x39')]?_0x24ff45[_0x5be1('0x37')]:_0x429ac5[_0x5be1('0x33')];if(!_0xf37ad7['query']['hasOwnProperty'](_0x5be1('0x3a'))){_0x24ff45[_0x5be1('0x20')]=qs[_0x5be1('0x20')](_0xf37ad7[_0x5be1('0x34')]['limit']);_0x24ff45[_0x5be1('0x22')]=qs[_0x5be1('0x22')](_0xf37ad7['query'][_0x5be1('0x22')]);}_0x24ff45[_0x5be1('0x3b')]=qs[_0x5be1('0x3c')](_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3c')]);_0x24ff45[_0x5be1('0x3d')]=qs['filters'](_['pick'](_0xf37ad7[_0x5be1('0x34')],_0x429ac5['filters']),_0x20acd5);if(_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3e')]){_0x24ff45[_0x5be1('0x3d')]=_['merge'](_0x24ff45[_0x5be1('0x3d')],{'$or':_[_0x5be1('0x2d')](_0x20acd5,function(_0x1c2654){if(_0x1c2654[_0x5be1('0x31')]!=='VIRTUAL'){var _0x2d67d7={};_0x2d67d7[_0x1c2654[_0x5be1('0x2b')]]={'$like':'%'+_0xf37ad7[_0x5be1('0x34')][_0x5be1('0x3e')]+'%'};return _0x2d67d7;}})});}_0x24ff45=_[_0x5be1('0x3f')]({},_0x24ff45,_0xf37ad7[_0x5be1('0x40')]);var _0x345b54={'where':_0x24ff45[_0x5be1('0x3d')]};return db['SquareDetailsReport']['count'](_0x345b54)[_0x5be1('0x27')](function(_0x16f1ca){_0x2c4278[_0x5be1('0x21')]=_0x16f1ca;if(_0xf37ad7['query']['includeAll']){_0x24ff45[_0x5be1('0x41')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x24ff45);})[_0x5be1('0x27')](function(_0x275241){_0x2c4278[_0x5be1('0x42')]=_0x275241;return _0x2c4278;})['then'](respondWithFilteredResult(_0x2c408c,_0x24ff45))['catch'](handleError(_0x2c408c,null));};exports[_0x5be1('0x43')]=function(_0x190249,_0x418b61){var _0x3ea026={'raw':!![],'where':{'id':_0x190249[_0x5be1('0x44')]['id']}},_0x871091={};_0x871091[_0x5be1('0x33')]=_[_0x5be1('0x35')](db[_0x5be1('0x2e')][_0x5be1('0x2f')]);_0x871091[_0x5be1('0x34')]=_['keys'](_0x190249[_0x5be1('0x34')]);_0x871091['filters']=_[_0x5be1('0x36')](_0x871091[_0x5be1('0x33')],_0x871091['query']);_0x3ea026[_0x5be1('0x37')]=_[_0x5be1('0x36')](_0x871091[_0x5be1('0x33')],qs[_0x5be1('0x38')](_0x190249[_0x5be1('0x34')][_0x5be1('0x38')]));_0x3ea026[_0x5be1('0x37')]=_0x3ea026['attributes']['length']?_0x3ea026[_0x5be1('0x37')]:_0x871091[_0x5be1('0x33')];if(_0x190249['query'][_0x5be1('0x45')]){_0x3ea026[_0x5be1('0x41')]=[{'all':!![]}];}_0x3ea026=_[_0x5be1('0x3f')]({},_0x3ea026,_0x190249[_0x5be1('0x40')]);return db[_0x5be1('0x2e')]['find'](_0x3ea026)[_0x5be1('0x27')](handleEntityNotFound(_0x418b61,null))['then'](respondWithResult(_0x418b61,null))['catch'](handleError(_0x418b61,null));};exports[_0x5be1('0x46')]=function(_0x1a10e7,_0x42f0b6){return db['SquareDetailsReport'][_0x5be1('0x46')](_0x1a10e7['body'],{})[_0x5be1('0x27')](respondWithResult(_0x42f0b6,0xc9))['catch'](handleError(_0x42f0b6,null));};exports[_0x5be1('0x26')]=function(_0x416a3f,_0x4d2b01){if(_0x416a3f[_0x5be1('0x47')]['id']){delete _0x416a3f[_0x5be1('0x47')]['id'];}return db[_0x5be1('0x2e')][_0x5be1('0x48')]({'where':{'id':_0x416a3f[_0x5be1('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d2b01,null))['then'](saveUpdates(_0x416a3f[_0x5be1('0x47')],null))['then'](respondWithResult(_0x4d2b01,null))[_0x5be1('0x49')](handleError(_0x4d2b01,null));};exports[_0x5be1('0x28')]=function(_0x245f26,_0x5e64a5){return db[_0x5be1('0x2e')][_0x5be1('0x48')]({'where':{'id':_0x245f26['params']['id']}})['then'](handleEntityNotFound(_0x5e64a5,null))[_0x5be1('0x27')](removeEntity(_0x5e64a5,null))[_0x5be1('0x49')](handleError(_0x5e64a5,null));};exports[_0x5be1('0x4a')]=function(_0x1d9c9f,_0xc6cc06){return db[_0x5be1('0x2e')][_0x5be1('0x4a')]()[_0x5be1('0x27')](respondWithResult(_0xc6cc06,null))[_0x5be1('0x49')](handleError(_0xc6cc06,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 06e5960..8bd7743 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 _0xbb72=['exports','report_square_details','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x3627f4,_0x513a27){var _0x351a03=function(_0x573ef2){while(--_0x573ef2){_0x3627f4['push'](_0x3627f4['shift']());}};_0x351a03(++_0x513a27);}(_0xbb72,0x197));var _0x2bb7=function(_0x37d87d,_0x2dc914){_0x37d87d=_0x37d87d-0x0;var _0x10f6f0=_0xbb72[_0x37d87d];return _0x10f6f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2bb7('0x0'))('api');var moment=require('moment');var BPromise=require(_0x2bb7('0x1'));var rp=require(_0x2bb7('0x2'));var fs=require('fs');var path=require(_0x2bb7('0x3'));var rimraf=require(_0x2bb7('0x4'));var config=require(_0x2bb7('0x5'));var attributes=require(_0x2bb7('0x6'));module[_0x2bb7('0x7')]=function(_0x2f897c,_0x1777e8){return _0x2f897c['define']('SquareDetailsReport',attributes,{'tableName':_0x2bb7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0caf=['exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','./squareReportDetail.attributes'];(function(_0x59de4f,_0x43e02a){var _0x32fc14=function(_0x39464d){while(--_0x39464d){_0x59de4f['push'](_0x59de4f['shift']());}};_0x32fc14(++_0x43e02a);}(_0x0caf,0x159));var _0xf0ca=function(_0x5e681d,_0x182b4b){_0x5e681d=_0x5e681d-0x0;var _0x32f634=_0x0caf[_0x5e681d];return _0x32f634;};'use strict';var _=require(_0xf0ca('0x0'));var util=require('util');var logger=require(_0xf0ca('0x1'))(_0xf0ca('0x2'));var moment=require(_0xf0ca('0x3'));var BPromise=require(_0xf0ca('0x4'));var rp=require(_0xf0ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf0ca('0x6'));module[_0xf0ca('0x7')]=function(_0x247fb5,_0x4b9f7f){return _0x247fb5[_0xf0ca('0x8')](_0xf0ca('0x9'),attributes,{'tableName':_0xf0ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index f53ee64..0d7120c 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 _0x087b=['debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','create','body','options','CreateSquareDetailsReport','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x19b6af,_0x570032){var _0x4b6fd9=function(_0x21fcdb){while(--_0x21fcdb){_0x19b6af['push'](_0x19b6af['shift']());}};_0x4b6fd9(++_0x570032);}(_0x087b,0x11a));var _0xb087=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x087b[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['CreateSquareDetailsReport']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['SquareDetailsReport'][_0xb087('0x16')](_0x330005[_0xb087('0x17')],{'raw':_0x330005[_0xb087('0x18')]?_0x330005[_0xb087('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ea3dc){logger['info'](_0xb087('0x19'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x19'),_0x330005,JSON[_0xb087('0x11')](_0x5ea3dc));_0x17200d(_0x5ea3dc);})[_0xb087('0x1a')](function(_0x258b4c){logger[_0xb087('0x12')]('CreateSquareDetailsReport',_0x258b4c[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x258b4c[_0xb087('0x14')]));});});}; \ No newline at end of file +var _0xef0f=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xef0f,0x168));var _0xfef0=function(_0x4d7764,_0x6b033c){_0x4d7764=_0x4d7764-0x0;var _0x133542=_0xef0f[_0x4d7764];return _0x133542;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')](_0x581459['body'],{'raw':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1c')]===undefined?!![]:![]:!![]})[_0xfef0('0xc')](function(_0x28dee1){logger['info'](_0xfef0('0x18'),_0x581459);logger['debug'](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x28dee1));_0x1642cd(_0x28dee1);})['catch'](function(_0x4897af){logger['error'](_0xfef0('0x18'),_0x4897af['message'],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0x4897af[_0xfef0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b1fb691..1c604f0 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 _0xc55b=['/process/:pid/kill','exports','express','Router','./system.controller','isAuthenticated','index'];(function(_0x4f7c9b,_0x1b83b6){var _0x5149f3=function(_0xef5f6e){while(--_0xef5f6e){_0x4f7c9b['push'](_0x4f7c9b['shift']());}};_0x5149f3(++_0x1b83b6);}(_0xc55b,0x121));var _0xbc55=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc55b[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0xbc55('0x0'));var router=express[_0xbc55('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbc55('0x2'));router['get']('/',auth[_0xbc55('0x3')](),controller[_0xbc55('0x4')]);router['get'](_0xbc55('0x5'),auth['isAuthenticated'](),controller['killProcess']);module[_0xbc55('0x6')]=router; \ No newline at end of file +var _0x405f=['express','Router','../../components/auth/service','./system.controller','isAuthenticated','index','/process/:pid/kill'];(function(_0x533c04,_0x6bb2da){var _0x2d3098=function(_0x33cd97){while(--_0x33cd97){_0x533c04['push'](_0x533c04['shift']());}};_0x2d3098(++_0x6bb2da);}(_0x405f,0x1f1));var _0xf405=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x405f[_0x5834bc];return _0x3e183a;};'use strict';var express=require(_0xf405('0x0'));var router=express[_0xf405('0x1')]();var auth=require(_0xf405('0x2'));var controller=require(_0xf405('0x3'));router['get']('/',auth[_0xf405('0x4')](),controller[_0xf405('0x5')]);router['get'](_0xf405('0x6'),auth['isAuthenticated'](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index bda254a..3f05e8c 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 _0x8727=['catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','then','json','status','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x418379,_0xf69c17){var _0x1267d8=function(_0x144810){while(--_0x144810){_0x418379['push'](_0x418379['shift']());}};_0x1267d8(++_0xf69c17);}(_0x8727,0x1aa));var _0x7872=function(_0x18f9e1,_0x2763b3){_0x18f9e1=_0x18f9e1-0x0;var _0x61a32d=_0x8727[_0x18f9e1];return _0x61a32d;};'use strict';var info=require(_0x7872('0x0'));var exec=require(_0x7872('0x1'))[_0x7872('0x2')];var logger=require(_0x7872('0x3'))(_0x7872('0x4'));var util=require('util');var BPromise=require(_0x7872('0x5'));var _=require('lodash');function handleError(_0x5bef7b,_0x4a4a71,_0x2de8d9){_0x4a4a71=_0x4a4a71||0x1f4;return function(_0x4aaf1c){logger['error'](_0x7872('0x6'),_0x2de8d9,_0x4a4a71,util['inspect'](_0x4aaf1c,{'showHidden':![],'depth':null}));delete _0x4aaf1c[_0x7872('0x7')];_0x5bef7b['status'](_0x4a4a71)[_0x7872('0x8')](_0x4aaf1c);};}exports['index']=function(_0x183802,_0x431a03){return info[_0x7872('0x9')]()[_0x7872('0xa')](function(_0x5da66d){return _0x431a03['status'](0xc8)[_0x7872('0xb')](_0x5da66d);})['catch'](function(_0x1b988c){return _0x431a03[_0x7872('0xc')](0x1f4)[_0x7872('0xb')](_0x1b988c);});};exports[_0x7872('0xd')]=function(_0x543cf6,_0x35a35a){var _0x2044d9=['components/import/cm'];return new BPromise(function(_0x2199ca,_0x3ec23b){return exec(util[_0x7872('0xe')](_0x7872('0xf'),_0x543cf6[_0x7872('0x10')]['pid']),function(_0x320371,_0x110281,_0x2c83e2){if(_0x320371){return _0x3ec23b(_0x320371);}return _0x2199ca(_0x110281);});})[_0x7872('0xa')](function(_0x5ccf15){var _0x41cf7b=![];var _0x170fe0=_0x5ccf15[_0x7872('0x11')](/\n/);for(var _0x40c64b=0x0,_0x56e351=_0x2044d9[_0x7872('0x12')];_0x40c64b<_0x56e351,_0x41cf7b===![];_0x40c64b+=0x1){if(_0x5ccf15['indexOf'](_0x2044d9[_0x40c64b])>=0x0){_0x41cf7b=!![];}}if(!_0x41cf7b){throw new Error(util[_0x7872('0xe')](_0x7872('0x13'),_0x543cf6['params'][_0x7872('0x14')]));}process[_0x7872('0x15')](_0x543cf6[_0x7872('0x10')][_0x7872('0x14')],_0x7872('0x16'));return _0x35a35a[_0x7872('0xc')](0xc8)[_0x7872('0xb')]({'message':util[_0x7872('0xe')](_0x7872('0x17'),_0x543cf6[_0x7872('0x10')][_0x7872('0x14')])});})[_0x7872('0x18')](handleError(_0x35a35a,null,'killProcess'));}; \ No newline at end of file +var _0x5678=['killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','json','catch'];(function(_0x355f33,_0xa51db9){var _0x3221bf=function(_0x57e27c){while(--_0x57e27c){_0x355f33['push'](_0x355f33['shift']());}};_0x3221bf(++_0xa51db9);}(_0x5678,0x1b5));var _0x8567=function(_0x3306d7,_0x399a95){_0x3306d7=_0x3306d7-0x0;var _0x177aa7=_0x5678[_0x3306d7];return _0x177aa7;};'use strict';var info=require(_0x8567('0x0'));var exec=require(_0x8567('0x1'))[_0x8567('0x2')];var logger=require(_0x8567('0x3'))(_0x8567('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x8567('0x5'));function handleError(_0x2def05,_0x148c45,_0x43f54a){_0x148c45=_0x148c45||0x1f4;return function(_0x1e0bbd){logger['error'](_0x8567('0x6'),_0x43f54a,_0x148c45,util['inspect'](_0x1e0bbd,{'showHidden':![],'depth':null}));delete _0x1e0bbd[_0x8567('0x7')];_0x2def05[_0x8567('0x8')](_0x148c45)['send'](_0x1e0bbd);};}exports[_0x8567('0x9')]=function(_0x32f773,_0x50ba01){return info[_0x8567('0xa')]()['then'](function(_0x56c6b5){return _0x50ba01[_0x8567('0x8')](0xc8)[_0x8567('0xb')](_0x56c6b5);})[_0x8567('0xc')](function(_0x5141a0){return _0x50ba01['status'](0x1f4)[_0x8567('0xb')](_0x5141a0);});};exports[_0x8567('0xd')]=function(_0x4f651a,_0x56570d){var _0x5df62c=[_0x8567('0xe')];return new BPromise(function(_0x94797f,_0x44fffd){return exec(util['format'](_0x8567('0xf'),_0x4f651a[_0x8567('0x10')][_0x8567('0x11')]),function(_0x12c466,_0x29c2d0,_0x505220){if(_0x12c466){return _0x44fffd(_0x12c466);}return _0x94797f(_0x29c2d0);});})[_0x8567('0x12')](function(_0x2a7fcf){var _0x39f89e=![];var _0x342bcc=_0x2a7fcf['split'](/\n/);for(var _0x2c27e9=0x0,_0x45bfc3=_0x5df62c[_0x8567('0x13')];_0x2c27e9<_0x45bfc3,_0x39f89e===![];_0x2c27e9+=0x1){if(_0x2a7fcf[_0x8567('0x14')](_0x5df62c[_0x2c27e9])>=0x0){_0x39f89e=!![];}}if(!_0x39f89e){throw new Error(util[_0x8567('0x15')](_0x8567('0x16'),_0x4f651a[_0x8567('0x10')]['pid']));}process['kill'](_0x4f651a['params']['pid'],_0x8567('0x17'));return _0x56570d[_0x8567('0x8')](0xc8)[_0x8567('0xb')]({'message':util[_0x8567('0x15')](_0x8567('0x18'),_0x4f651a[_0x8567('0x10')][_0x8567('0x11')])});})['catch'](handleError(_0x56570d,null,_0x8567('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 235857e..872a3d9 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 _0x605b=['create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./tag.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5f48ec,_0xef972d){var _0xf3bbbb=function(_0x22feaf){while(--_0x22feaf){_0x5f48ec['push'](_0x5f48ec['shift']());}};_0xf3bbbb(++_0xef972d);}(_0x605b,0xf4));var _0xb605=function(_0xb461fa,_0x10204d){_0xb461fa=_0xb461fa-0x0;var _0x5839cf=_0x605b[_0xb461fa];return _0x5839cf;};'use strict';var multer=require(_0xb605('0x0'));var util=require(_0xb605('0x1'));var path=require(_0xb605('0x2'));var timeout=require(_0xb605('0x3'));var express=require('express');var router=express[_0xb605('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb605('0x5'));var config=require('../../config/environment');var controller=require(_0xb605('0x6'));router[_0xb605('0x7')]('/',auth[_0xb605('0x8')](),controller['index']);router[_0xb605('0x7')](_0xb605('0x9'),auth[_0xb605('0x8')](),controller[_0xb605('0xa')]);router[_0xb605('0xb')]('/',auth[_0xb605('0x8')](),controller[_0xb605('0xc')]);router[_0xb605('0xd')](_0xb605('0x9'),auth[_0xb605('0x8')](),controller[_0xb605('0xe')]);router['delete'](_0xb605('0x9'),auth[_0xb605('0x8')](),controller['destroy']);module[_0xb605('0xf')]=router; \ No newline at end of file +var _0x2f25=['Router','fs-extra','../../components/auth/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','multer','util','path','connect-timeout','express'];(function(_0x4a9666,_0x3e6c86){var _0x322fa8=function(_0x4d4833){while(--_0x4d4833){_0x4a9666['push'](_0x4a9666['shift']());}};_0x322fa8(++_0x3e6c86);}(_0x2f25,0x15b));var _0x52f2=function(_0x5a8d6c,_0x3c0ea0){_0x5a8d6c=_0x5a8d6c-0x0;var _0x13b85c=_0x2f25[_0x5a8d6c];return _0x13b85c;};'use strict';var multer=require(_0x52f2('0x0'));var util=require(_0x52f2('0x1'));var path=require(_0x52f2('0x2'));var timeout=require(_0x52f2('0x3'));var express=require(_0x52f2('0x4'));var router=express[_0x52f2('0x5')]();var fs_extra=require(_0x52f2('0x6'));var auth=require(_0x52f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x52f2('0x8'));router[_0x52f2('0x9')]('/',auth[_0x52f2('0xa')](),controller[_0x52f2('0xb')]);router['get'](_0x52f2('0xc'),auth[_0x52f2('0xa')](),controller[_0x52f2('0xd')]);router[_0x52f2('0xe')]('/',auth[_0x52f2('0xa')](),controller[_0x52f2('0xf')]);router['put'](_0x52f2('0xc'),auth[_0x52f2('0xa')](),controller['update']);router['delete'](_0x52f2('0xc'),auth[_0x52f2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index cef56ec..192a574 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 _0x6f18=['#0091EA','sequelize','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x6f18,0x1b4));var _0x86f1=function(_0x507af7,_0x5cfb83){_0x507af7=_0x507af7-0x0;var _0x496d57=_0x6f18[_0x507af7];return _0x496d57;};'use strict';var Sequelize=require(_0x86f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x86f1('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x86f1('0x1')],'defaultValue':_0x86f1('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3264=['name','exports','STRING'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0x3264,0x7f));var _0x4326=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3264[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module[_0x4326('0x0')]={'name':{'type':Sequelize[_0x4326('0x1')],'unique':_0x4326('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4326('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 0bbe02c..130e84f 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 _0xc368=['error','name','map','Tag','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource'];(function(_0x3cad1a,_0x4a92c5){var _0x4b768d=function(_0x2b9e6f){while(--_0x2b9e6f){_0x3cad1a['push'](_0x3cad1a['shift']());}};_0x4b768d(++_0x4a92c5);}(_0xc368,0x7b));var _0x8c36=function(_0x17d595,_0x470934){_0x17d595=_0x17d595-0x0;var _0x54535a=_0xc368[_0x17d595];return _0x54535a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c36('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c36('0x1'));var rp=require(_0x8c36('0x2'));var moment=require(_0x8c36('0x3'));var BPromise=require(_0x8c36('0x4'));var Mustache=require(_0x8c36('0x5'));var util=require('util');var path=require(_0x8c36('0x6'));var sox=require(_0x8c36('0x7'));var csv=require(_0x8c36('0x8'));var ejs=require(_0x8c36('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x8'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var as=require(_0x8c36('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c36('0x11'))(_0x8c36('0x12'));var utils=require(_0x8c36('0x13'));var config=require(_0x8c36('0x14'));var licenseUtil=require(_0x8c36('0x15'));var db=require(_0x8c36('0x16'))['db'];function respondWithStatusCode(_0xa09884,_0x23eb71){_0x23eb71=_0x23eb71||0xcc;return function(_0x205d5c){if(_0x205d5c){return _0xa09884[_0x8c36('0x17')](_0x23eb71);}return _0xa09884[_0x8c36('0x18')](_0x23eb71)[_0x8c36('0x19')]();};}function respondWithResult(_0x3c824b,_0x220f18){_0x220f18=_0x220f18||0xc8;return function(_0x5dfcd5){if(_0x5dfcd5){return _0x3c824b[_0x8c36('0x18')](_0x220f18)['json'](_0x5dfcd5);}};}function respondWithFilteredResult(_0xea7509,_0x3f83aa){return function(_0x29e791){if(_0x29e791){var _0x1fc68e=typeof _0x3f83aa[_0x8c36('0x1a')]===_0x8c36('0x1b')&&typeof _0x3f83aa[_0x8c36('0x1c')]===_0x8c36('0x1b');var _0x30229e=_0x29e791['count'];var _0x2be9b0=_0x1fc68e?0x0:_0x3f83aa[_0x8c36('0x1a')];var _0x47832a=_0x1fc68e?_0x29e791[_0x8c36('0x1d')]:_0x3f83aa[_0x8c36('0x1a')]+_0x3f83aa['limit'];var _0x15100f;if(_0x47832a>=_0x30229e){_0x47832a=_0x30229e;_0x15100f=0xc8;}else{_0x15100f=0xce;}_0xea7509[_0x8c36('0x18')](_0x15100f);return _0xea7509[_0x8c36('0x1e')](_0x8c36('0x1f'),_0x2be9b0+'-'+_0x47832a+'/'+_0x30229e)[_0x8c36('0x20')](_0x29e791);}return null;};}function patchUpdates(_0x2b07ad){return function(_0xfb9763){try{jsonpatch[_0x8c36('0x21')](_0xfb9763,_0x2b07ad,!![]);}catch(_0x153735){return BPromise[_0x8c36('0x22')](_0x153735);}return _0xfb9763[_0x8c36('0x23')]();};}function saveUpdates(_0x14ee6b,_0x46645d){return function(_0x51fd6c){if(_0x51fd6c){return _0x51fd6c['update'](_0x14ee6b)['then'](function(_0x55b844){return _0x55b844;});}return null;};}function removeEntity(_0x2269f5,_0x7effb8){return function(_0x2088aa){if(_0x2088aa){return _0x2088aa[_0x8c36('0x24')]()[_0x8c36('0x25')](function(){var _0x27c0df=_0x2088aa['get']({'plain':!![]});var _0x1d39ca='Tags';return db[_0x8c36('0x26')]['destroy']({'where':{'type':_0x1d39ca,'resourceId':_0x27c0df['id']}})[_0x8c36('0x25')](function(){return _0x2088aa;});})[_0x8c36('0x25')](function(){_0x2269f5[_0x8c36('0x18')](0xcc)[_0x8c36('0x19')]();});}};}function handleEntityNotFound(_0x50aa48,_0x55cbfb){return function(_0x7e7e56){if(!_0x7e7e56){_0x50aa48[_0x8c36('0x17')](0x194);}return _0x7e7e56;};}function handleError(_0x5ad933,_0x4fc3ba){_0x4fc3ba=_0x4fc3ba||0x1f4;return function(_0x418663){logger[_0x8c36('0x27')](_0x418663['stack']);if(_0x418663[_0x8c36('0x28')]){delete _0x418663[_0x8c36('0x28')];}_0x5ad933[_0x8c36('0x18')](_0x4fc3ba)['send'](_0x418663);};}exports['index']=function(_0x46b72f,_0x1531fc){var _0x3d7056={},_0x192ce3={},_0x3ae970={'count':0x0,'rows':[]};var _0x2e8855=_[_0x8c36('0x29')](db[_0x8c36('0x2a')][_0x8c36('0x2b')],function(_0x2d6476){return{'name':_0x2d6476[_0x8c36('0x2c')],'type':_0x2d6476[_0x8c36('0x2d')][_0x8c36('0x2e')]};});_0x192ce3[_0x8c36('0x2f')]=_[_0x8c36('0x29')](_0x2e8855,_0x8c36('0x28'));_0x192ce3[_0x8c36('0x30')]=_['keys'](_0x46b72f['query']);_0x192ce3['filters']=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],_0x192ce3[_0x8c36('0x30')]);_0x3d7056[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0x46b72f['query'][_0x8c36('0x33')]));_0x3d7056['attributes']=_0x3d7056[_0x8c36('0x32')]['length']?_0x3d7056[_0x8c36('0x32')]:_0x192ce3[_0x8c36('0x2f')];if(!_0x46b72f[_0x8c36('0x30')]['hasOwnProperty'](_0x8c36('0x34'))){_0x3d7056[_0x8c36('0x1c')]=qs[_0x8c36('0x1c')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1c')]);_0x3d7056[_0x8c36('0x1a')]=qs[_0x8c36('0x1a')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1a')]);}_0x3d7056[_0x8c36('0x35')]=qs[_0x8c36('0x36')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x36')]);_0x3d7056[_0x8c36('0x37')]=qs[_0x8c36('0x38')](_[_0x8c36('0x39')](_0x46b72f[_0x8c36('0x30')],_0x192ce3['filters']),_0x2e8855);if(_0x46b72f[_0x8c36('0x30')]['filter']){_0x3d7056[_0x8c36('0x37')]=_[_0x8c36('0x3a')](_0x3d7056[_0x8c36('0x37')],{'$or':_[_0x8c36('0x29')](_0x2e8855,function(_0x4da574){if(_0x4da574['type']!==_0x8c36('0x3b')){var _0x15a553={};_0x15a553[_0x4da574[_0x8c36('0x28')]]={'$like':'%'+_0x46b72f['query']['filter']+'%'};return _0x15a553;}})});}_0x3d7056=_[_0x8c36('0x3a')]({},_0x3d7056,_0x46b72f['options']);var _0x568290={'where':_0x3d7056[_0x8c36('0x37')]};return db[_0x8c36('0x2a')][_0x8c36('0x1d')](_0x568290)[_0x8c36('0x25')](function(_0x2a0272){_0x3ae970[_0x8c36('0x1d')]=_0x2a0272;if(_0x46b72f[_0x8c36('0x30')][_0x8c36('0x3c')]){_0x3d7056[_0x8c36('0x3d')]=[{'all':!![]}];}return db[_0x8c36('0x2a')]['findAll'](_0x3d7056);})[_0x8c36('0x25')](function(_0x24505c){_0x3ae970[_0x8c36('0x3e')]=_0x24505c;return _0x3ae970;})[_0x8c36('0x25')](respondWithFilteredResult(_0x1531fc,_0x3d7056))[_0x8c36('0x3f')](handleError(_0x1531fc,null));};exports['show']=function(_0xb1f8ac,_0x3dde7b){var _0x31699c={'raw':!![],'where':{'id':_0xb1f8ac[_0x8c36('0x40')]['id']}},_0x18e28e={};_0x18e28e[_0x8c36('0x2f')]=_['keys'](db[_0x8c36('0x2a')][_0x8c36('0x2b')]);_0x18e28e[_0x8c36('0x30')]=_[_0x8c36('0x41')](_0xb1f8ac[_0x8c36('0x30')]);_0x18e28e[_0x8c36('0x38')]=_[_0x8c36('0x31')](_0x18e28e['model'],_0x18e28e[_0x8c36('0x30')]);_0x31699c[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x18e28e[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0xb1f8ac[_0x8c36('0x30')][_0x8c36('0x33')]));_0x31699c[_0x8c36('0x32')]=_0x31699c[_0x8c36('0x32')][_0x8c36('0x42')]?_0x31699c[_0x8c36('0x32')]:_0x18e28e[_0x8c36('0x2f')];if(_0xb1f8ac['query']['includeAll']){_0x31699c[_0x8c36('0x3d')]=[{'all':!![]}];}_0x31699c=_[_0x8c36('0x3a')]({},_0x31699c,_0xb1f8ac[_0x8c36('0x43')]);return db[_0x8c36('0x2a')]['find'](_0x31699c)[_0x8c36('0x25')](handleEntityNotFound(_0x3dde7b,null))[_0x8c36('0x25')](respondWithResult(_0x3dde7b,null))['catch'](handleError(_0x3dde7b,null));};exports['create']=function(_0x4edf8e,_0xb4ebae){return db[_0x8c36('0x2a')][_0x8c36('0x44')](_0x4edf8e[_0x8c36('0x45')],{})[_0x8c36('0x25')](function(_0x2778b3){var _0x4dd393=_0x4edf8e[_0x8c36('0x46')][_0x8c36('0x47')]({'plain':!![]});if(!_0x4dd393)throw new Error(_0x8c36('0x48'));if(_0x4dd393[_0x8c36('0x49')]==='user'){var _0x5e668d=_0x2778b3['get']({'plain':!![]});var _0x3887e4=_0x8c36('0x4a');return db[_0x8c36('0x4b')][_0x8c36('0x4c')]({'where':{'name':_0x3887e4,'userProfileId':_0x4dd393[_0x8c36('0x4d')]},'raw':!![]})[_0x8c36('0x25')](function(_0x43b5e2){if(_0x43b5e2&&_0x43b5e2[_0x8c36('0x4e')]===0x0){return db[_0x8c36('0x26')]['create']({'name':_0x5e668d['name'],'resourceId':_0x5e668d['id'],'type':_0x43b5e2[_0x8c36('0x28')],'sectionId':_0x43b5e2['id']},{})['then'](function(){return _0x2778b3;});}else{return _0x2778b3;}})['catch'](function(_0x9955bc){logger['error'](_0x8c36('0x4f'),_0x9955bc);throw _0x9955bc;});}return _0x2778b3;})[_0x8c36('0x25')](respondWithResult(_0xb4ebae,0xc9))['catch'](handleError(_0xb4ebae,null));};exports[_0x8c36('0x50')]=function(_0x5af860,_0x31fbde){if(_0x5af860[_0x8c36('0x45')]['id']){delete _0x5af860[_0x8c36('0x45')]['id'];}return db['Tag'][_0x8c36('0x4c')]({'where':{'id':_0x5af860[_0x8c36('0x40')]['id']}})[_0x8c36('0x25')](handleEntityNotFound(_0x31fbde,null))[_0x8c36('0x25')](saveUpdates(_0x5af860[_0x8c36('0x45')],null))[_0x8c36('0x25')](respondWithResult(_0x31fbde,null))[_0x8c36('0x3f')](handleError(_0x31fbde,null));};exports[_0x8c36('0x24')]=function(_0x20f1d9,_0x4cd57c){return db['Tag']['find']({'where':{'id':_0x20f1d9[_0x8c36('0x40')]['id']}})['then'](handleEntityNotFound(_0x4cd57c,null))['then'](removeEntity(_0x4cd57c,null))[_0x8c36('0x3f')](handleError(_0x4cd57c,null));}; \ No newline at end of file +var _0xe14d=['status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Tag','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus'];(function(_0x2fccfd,_0x3fd136){var _0x278ea6=function(_0x1eadc3){while(--_0x1eadc3){_0x2fccfd['push'](_0x2fccfd['shift']());}};_0x278ea6(++_0x3fd136);}(_0xe14d,0x1ee));var _0xde14=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xe14d[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];function respondWithStatusCode(_0x34e28f,_0x29e3ca){_0x29e3ca=_0x29e3ca||0xcc;return function(_0x105f96){if(_0x105f96){return _0x34e28f[_0xde14('0x1b')](_0x29e3ca);}return _0x34e28f[_0xde14('0x1c')](_0x29e3ca)[_0xde14('0x1d')]();};}function respondWithResult(_0x1489e9,_0x54c58b){_0x54c58b=_0x54c58b||0xc8;return function(_0x584959){if(_0x584959){return _0x1489e9[_0xde14('0x1c')](_0x54c58b)[_0xde14('0x1e')](_0x584959);}};}function respondWithFilteredResult(_0x26c1ec,_0x4c86ff){return function(_0x16aa55){if(_0x16aa55){var _0x31adb3=typeof _0x4c86ff[_0xde14('0x1f')]===_0xde14('0x20')&&typeof _0x4c86ff[_0xde14('0x21')]===_0xde14('0x20');var _0x29e243=_0x16aa55[_0xde14('0x22')];var _0x3cc317=_0x31adb3?0x0:_0x4c86ff[_0xde14('0x1f')];var _0x590a8b=_0x31adb3?_0x16aa55[_0xde14('0x22')]:_0x4c86ff[_0xde14('0x1f')]+_0x4c86ff[_0xde14('0x21')];var _0x44ce4c;if(_0x590a8b>=_0x29e243){_0x590a8b=_0x29e243;_0x44ce4c=0xc8;}else{_0x44ce4c=0xce;}_0x26c1ec['status'](_0x44ce4c);return _0x26c1ec[_0xde14('0x23')]('Content-Range',_0x3cc317+'-'+_0x590a8b+'/'+_0x29e243)[_0xde14('0x1e')](_0x16aa55);}return null;};}function patchUpdates(_0x4c24a8){return function(_0xa50687){try{jsonpatch[_0xde14('0x24')](_0xa50687,_0x4c24a8,!![]);}catch(_0x51ee8d){return BPromise[_0xde14('0x25')](_0x51ee8d);}return _0xa50687[_0xde14('0x26')]();};}function saveUpdates(_0x11a4d9,_0x40b648){return function(_0x2dd9e7){if(_0x2dd9e7){return _0x2dd9e7[_0xde14('0x27')](_0x11a4d9)[_0xde14('0x28')](function(_0x475f2f){return _0x475f2f;});}return null;};}function removeEntity(_0xbaa078,_0x8f8033){return function(_0x5ae4c1){if(_0x5ae4c1){return _0x5ae4c1[_0xde14('0x29')]()[_0xde14('0x28')](function(){var _0x24a390=_0x5ae4c1[_0xde14('0x2a')]({'plain':!![]});var _0x1bb7be=_0xde14('0x2b');return db[_0xde14('0x2c')][_0xde14('0x29')]({'where':{'type':_0x1bb7be,'resourceId':_0x24a390['id']}})[_0xde14('0x28')](function(){return _0x5ae4c1;});})[_0xde14('0x28')](function(){_0xbaa078['status'](0xcc)[_0xde14('0x1d')]();});}};}function handleEntityNotFound(_0x1696ee,_0x3eaee5){return function(_0xf8279a){if(!_0xf8279a){_0x1696ee['sendStatus'](0x194);}return _0xf8279a;};}function handleError(_0x3fc2a4,_0x2c9822){_0x2c9822=_0x2c9822||0x1f4;return function(_0x30c4a8){logger['error'](_0x30c4a8[_0xde14('0x2d')]);if(_0x30c4a8['name']){delete _0x30c4a8[_0xde14('0x2e')];}_0x3fc2a4[_0xde14('0x1c')](_0x2c9822)[_0xde14('0x2f')](_0x30c4a8);};}exports[_0xde14('0x30')]=function(_0x2aca96,_0x237d3f){var _0xae9dca={},_0x464666={},_0x4e7c5b={'count':0x0,'rows':[]};var _0xbfc01b=_[_0xde14('0x31')](db['Tag'][_0xde14('0x32')],function(_0x4c9b15){return{'name':_0x4c9b15[_0xde14('0x33')],'type':_0x4c9b15[_0xde14('0x34')][_0xde14('0x35')]};});_0x464666[_0xde14('0x36')]=_[_0xde14('0x31')](_0xbfc01b,'name');_0x464666[_0xde14('0x37')]=_[_0xde14('0x38')](_0x2aca96['query']);_0x464666[_0xde14('0x39')]=_[_0xde14('0x3a')](_0x464666[_0xde14('0x36')],_0x464666[_0xde14('0x37')]);_0xae9dca[_0xde14('0x3b')]=_[_0xde14('0x3a')](_0x464666[_0xde14('0x36')],qs[_0xde14('0x3c')](_0x2aca96[_0xde14('0x37')]['fields']));_0xae9dca['attributes']=_0xae9dca[_0xde14('0x3b')][_0xde14('0x3d')]?_0xae9dca[_0xde14('0x3b')]:_0x464666[_0xde14('0x36')];if(!_0x2aca96[_0xde14('0x37')][_0xde14('0x3e')](_0xde14('0x3f'))){_0xae9dca[_0xde14('0x21')]=qs[_0xde14('0x21')](_0x2aca96['query'][_0xde14('0x21')]);_0xae9dca['offset']=qs['offset'](_0x2aca96['query'][_0xde14('0x1f')]);}_0xae9dca[_0xde14('0x40')]=qs[_0xde14('0x41')](_0x2aca96[_0xde14('0x37')][_0xde14('0x41')]);_0xae9dca[_0xde14('0x42')]=qs[_0xde14('0x39')](_[_0xde14('0x43')](_0x2aca96['query'],_0x464666[_0xde14('0x39')]),_0xbfc01b);if(_0x2aca96[_0xde14('0x37')][_0xde14('0x44')]){_0xae9dca[_0xde14('0x42')]=_[_0xde14('0x45')](_0xae9dca[_0xde14('0x42')],{'$or':_[_0xde14('0x31')](_0xbfc01b,function(_0xf6443e){if(_0xf6443e['type']!==_0xde14('0x46')){var _0xb6b2ee={};_0xb6b2ee[_0xf6443e[_0xde14('0x2e')]]={'$like':'%'+_0x2aca96[_0xde14('0x37')]['filter']+'%'};return _0xb6b2ee;}})});}_0xae9dca=_['merge']({},_0xae9dca,_0x2aca96[_0xde14('0x47')]);var _0x16e7d1={'where':_0xae9dca[_0xde14('0x42')]};return db[_0xde14('0x48')][_0xde14('0x22')](_0x16e7d1)['then'](function(_0x24b02c){_0x4e7c5b[_0xde14('0x22')]=_0x24b02c;if(_0x2aca96[_0xde14('0x37')]['includeAll']){_0xae9dca[_0xde14('0x49')]=[{'all':!![]}];}return db['Tag'][_0xde14('0x4a')](_0xae9dca);})['then'](function(_0x102770){_0x4e7c5b[_0xde14('0x4b')]=_0x102770;return _0x4e7c5b;})[_0xde14('0x28')](respondWithFilteredResult(_0x237d3f,_0xae9dca))[_0xde14('0x4c')](handleError(_0x237d3f,null));};exports[_0xde14('0x4d')]=function(_0x22f75a,_0x253bc8){var _0xbc951e={'raw':!![],'where':{'id':_0x22f75a[_0xde14('0x4e')]['id']}},_0x5b18b0={};_0x5b18b0['model']=_[_0xde14('0x38')](db['Tag'][_0xde14('0x32')]);_0x5b18b0[_0xde14('0x37')]=_[_0xde14('0x38')](_0x22f75a[_0xde14('0x37')]);_0x5b18b0[_0xde14('0x39')]=_[_0xde14('0x3a')](_0x5b18b0[_0xde14('0x36')],_0x5b18b0[_0xde14('0x37')]);_0xbc951e['attributes']=_[_0xde14('0x3a')](_0x5b18b0[_0xde14('0x36')],qs[_0xde14('0x3c')](_0x22f75a[_0xde14('0x37')]['fields']));_0xbc951e[_0xde14('0x3b')]=_0xbc951e[_0xde14('0x3b')][_0xde14('0x3d')]?_0xbc951e[_0xde14('0x3b')]:_0x5b18b0[_0xde14('0x36')];if(_0x22f75a[_0xde14('0x37')]['includeAll']){_0xbc951e[_0xde14('0x49')]=[{'all':!![]}];}_0xbc951e=_['merge']({},_0xbc951e,_0x22f75a[_0xde14('0x47')]);return db[_0xde14('0x48')]['find'](_0xbc951e)[_0xde14('0x28')](handleEntityNotFound(_0x253bc8,null))[_0xde14('0x28')](respondWithResult(_0x253bc8,null))[_0xde14('0x4c')](handleError(_0x253bc8,null));};exports[_0xde14('0x4f')]=function(_0x2d05c7,_0x1c87e1){return db[_0xde14('0x48')]['create'](_0x2d05c7[_0xde14('0x50')],{})['then'](function(_0xfa80c8){var _0x6aa9ab=_0x2d05c7[_0xde14('0x51')][_0xde14('0x2a')]({'plain':!![]});if(!_0x6aa9ab)throw new Error(_0xde14('0x52'));if(_0x6aa9ab[_0xde14('0x53')]===_0xde14('0x51')){var _0x1f7316=_0xfa80c8[_0xde14('0x2a')]({'plain':!![]});var _0x14bf78='Tags';return db[_0xde14('0x54')][_0xde14('0x55')]({'where':{'name':_0x14bf78,'userProfileId':_0x6aa9ab[_0xde14('0x56')]},'raw':!![]})[_0xde14('0x28')](function(_0x14b781){if(_0x14b781&&_0x14b781['autoAssociation']===0x0){return db[_0xde14('0x2c')]['create']({'name':_0x1f7316[_0xde14('0x2e')],'resourceId':_0x1f7316['id'],'type':_0x14b781[_0xde14('0x2e')],'sectionId':_0x14b781['id']},{})[_0xde14('0x28')](function(){return _0xfa80c8;});}else{return _0xfa80c8;}})[_0xde14('0x4c')](function(_0x30d230){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d230);throw _0x30d230;});}return _0xfa80c8;})[_0xde14('0x28')](respondWithResult(_0x1c87e1,0xc9))['catch'](handleError(_0x1c87e1,null));};exports[_0xde14('0x27')]=function(_0x31111d,_0x15e2fb){if(_0x31111d[_0xde14('0x50')]['id']){delete _0x31111d[_0xde14('0x50')]['id'];}return db[_0xde14('0x48')][_0xde14('0x55')]({'where':{'id':_0x31111d[_0xde14('0x4e')]['id']}})[_0xde14('0x28')](handleEntityNotFound(_0x15e2fb,null))['then'](saveUpdates(_0x31111d[_0xde14('0x50')],null))[_0xde14('0x28')](respondWithResult(_0x15e2fb,null))[_0xde14('0x4c')](handleError(_0x15e2fb,null));};exports[_0xde14('0x29')]=function(_0x249ccc,_0x5965e1){return db[_0xde14('0x48')]['find']({'where':{'id':_0x249ccc[_0xde14('0x4e')]['id']}})[_0xde14('0x28')](handleEntityNotFound(_0x5965e1,null))[_0xde14('0x28')](removeEntity(_0x5965e1,null))[_0xde14('0x4c')](handleError(_0x5965e1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ab16d41..019597f 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 _0x6364=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Tag'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x6364,0x8f));var _0x4636=function(_0x15b20b,_0x398fff){_0x15b20b=_0x15b20b-0x0;var _0x2b24bc=_0x6364[_0x15b20b];return _0x2b24bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4636('0x0'))(_0x4636('0x1'));var moment=require(_0x4636('0x2'));var BPromise=require(_0x4636('0x3'));var rp=require(_0x4636('0x4'));var fs=require('fs');var path=require(_0x4636('0x5'));var rimraf=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var attributes=require('./tag.attributes');module[_0x4636('0x8')]=function(_0x30201f,_0x3e0ed6){return _0x30201f[_0x4636('0x9')](_0x4636('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85b7=['../../config/environment','./tag.attributes','exports','define','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3520d0,_0x32b2cf){var _0x1d2118=function(_0x548d7d){while(--_0x548d7d){_0x3520d0['push'](_0x3520d0['shift']());}};_0x1d2118(++_0x32b2cf);}(_0x85b7,0x1f1));var _0x785b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x85b7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x785b('0x0'));var logger=require(_0x785b('0x1'))(_0x785b('0x2'));var moment=require(_0x785b('0x3'));var BPromise=require(_0x785b('0x4'));var rp=require(_0x785b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x785b('0x6'));var config=require(_0x785b('0x7'));var attributes=require(_0x785b('0x8'));module[_0x785b('0x9')]=function(_0x472831,_0x2fdd3f){return _0x472831[_0x785b('0xa')]('Tag',attributes,{'tableName':_0x785b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 25c3940..4c8a621 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(_0x163c61,_0x1685b4){var _0x5a6c80=function(_0x155bd0){while(--_0x155bd0){_0x163c61['push'](_0x163c61['shift']());}};_0x5a6c80(++_0x1685b4);}(_0xe13a,0x178));var _0xae13=function(_0x2270be,_0x14321f){_0x2270be=_0x2270be-0x0;var _0x418a19=_0xe13a[_0x2270be];return _0x418a19;};'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 _0x6f0d=['Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x1c5c9b,_0x599547){var _0x5790e9=function(_0x5e1d8f){while(--_0x5e1d8f){_0x1c5c9b['push'](_0x1c5c9b['shift']());}};_0x5790e9(++_0x599547);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4dbdd4,_0x4e3141){_0x4dbdd4=_0x4dbdd4-0x0;var _0x5ceede=_0x6f0d[_0x4dbdd4];return _0x5ceede;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('Tag,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1c0caf2..a67dd84 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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'));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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 b071c84..8e0ecbd 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 _0x0713=['STRING','name'];(function(_0x2e4cf9,_0x515fd9){var _0x39f63a=function(_0x33ef49){while(--_0x33ef49){_0x2e4cf9['push'](_0x2e4cf9['shift']());}};_0x39f63a(++_0x515fd9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xb7e7,0x121));var _0x7b7e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb7e7[_0x465028];return _0xb783d4;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7695c49..6729c02 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 _0xfed8=['model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','intersection','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','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','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','add','Queues','ids','removeQueues','findOne','addAgents','isArray','Voice','Mail','Sms','Fax','Whatsapp','through','penalty','defaults','TeamVoiceQueue','User','Queue','emit','Queue:save','voicePause','upsert','isNil','format','all','UserVoicePrefix','spread','removeAgents','Chat','Openchannel','Queue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','Team','rawAttributes','type'];(function(_0x29f1e2,_0x53f688){var _0x2aef40=function(_0x4d47a1){while(--_0x4d47a1){_0x29f1e2['push'](_0x29f1e2['shift']());}};_0x2aef40(++_0x53f688);}(_0xfed8,0xfe));var _0x8fed=function(_0x5f20b3,_0x557a07){_0x5f20b3=_0x5f20b3-0x0;var _0x2aa6e2=_0xfed8[_0x5f20b3];return _0x2aa6e2;};'use strict';var emlformat=require(_0x8fed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fed('0x2'));var moment=require(_0x8fed('0x3'));var BPromise=require(_0x8fed('0x4'));var Mustache=require('mustache');var util=require(_0x8fed('0x5'));var path=require(_0x8fed('0x6'));var sox=require(_0x8fed('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fed('0x8'));var _=require(_0x8fed('0x9'));var squel=require(_0x8fed('0xa'));var crypto=require(_0x8fed('0xb'));var jsforce=require(_0x8fed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8fed('0xd'));var querystring=require(_0x8fed('0xe'));var Papa=require('papaparse');var Redis=require(_0x8fed('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8fed('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fed('0x11'))(_0x8fed('0x12'));var utils=require(_0x8fed('0x13'));var config=require(_0x8fed('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fed('0x15'))['db'];config[_0x8fed('0x16')]=_['defaults'](config[_0x8fed('0x16')],{'host':_0x8fed('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8fed('0x18'))[_0x8fed('0x19')](socket);function respondWithStatusCode(_0x28a3e8,_0x933e5){_0x933e5=_0x933e5||0xcc;return function(_0x34a25f){if(_0x34a25f){return _0x28a3e8[_0x8fed('0x1a')](_0x933e5);}return _0x28a3e8[_0x8fed('0x1b')](_0x933e5)[_0x8fed('0x1c')]();};}function respondWithResult(_0x1dee66,_0x35430e){_0x35430e=_0x35430e||0xc8;return function(_0x3eb9f2){if(_0x3eb9f2){return _0x1dee66[_0x8fed('0x1b')](_0x35430e)[_0x8fed('0x1d')](_0x3eb9f2);}};}function respondWithFilteredResult(_0x227c48,_0x1e30a0){return function(_0xe0d5a7){if(_0xe0d5a7){var _0x49d247=typeof _0x1e30a0[_0x8fed('0x1e')]===_0x8fed('0x1f')&&typeof _0x1e30a0[_0x8fed('0x20')]===_0x8fed('0x1f');var _0x16d405=_0xe0d5a7['count'];var _0x501759=_0x49d247?0x0:_0x1e30a0['offset'];var _0x98f643=_0x49d247?_0xe0d5a7[_0x8fed('0x21')]:_0x1e30a0['offset']+_0x1e30a0[_0x8fed('0x20')];var _0x5e17ec;if(_0x98f643>=_0x16d405){_0x98f643=_0x16d405;_0x5e17ec=0xc8;}else{_0x5e17ec=0xce;}_0x227c48[_0x8fed('0x1b')](_0x5e17ec);return _0x227c48[_0x8fed('0x22')](_0x8fed('0x23'),_0x501759+'-'+_0x98f643+'/'+_0x16d405)['json'](_0xe0d5a7);}return null;};}function patchUpdates(_0x4700fa){return function(_0x131b5a){try{jsonpatch[_0x8fed('0x24')](_0x131b5a,_0x4700fa,!![]);}catch(_0x4f2d5e){return BPromise[_0x8fed('0x25')](_0x4f2d5e);}return _0x131b5a[_0x8fed('0x26')]();};}function saveUpdates(_0x18cea3,_0x22764f){return function(_0x4b07b3){if(_0x4b07b3){return _0x4b07b3[_0x8fed('0x27')](_0x18cea3)[_0x8fed('0x28')](function(_0x23effe){return _0x23effe;});}return null;};}function handleEntityNotFound(_0xba9654,_0x4c933e){return function(_0x4d003a){if(!_0x4d003a){_0xba9654[_0x8fed('0x1a')](0x194);}return _0x4d003a;};}function handleError(_0x3320d9,_0xfdd97a){_0xfdd97a=_0xfdd97a||0x1f4;return function(_0x11334f){logger['error'](_0x11334f['stack']);if(_0x11334f[_0x8fed('0x29')]){delete _0x11334f[_0x8fed('0x29')];}_0x3320d9[_0x8fed('0x1b')](_0xfdd97a)[_0x8fed('0x2a')](_0x11334f);};}exports[_0x8fed('0x2b')]=function(_0x4563ca,_0x39a61d){var _0x12462b={},_0x2fae39={},_0x36952b={'count':0x0,'rows':[]};var _0x11e5d9=_[_0x8fed('0x2c')](db[_0x8fed('0x2d')][_0x8fed('0x2e')],function(_0x1c1560){return{'name':_0x1c1560['fieldName'],'type':_0x1c1560[_0x8fed('0x2f')]['key']};});_0x2fae39[_0x8fed('0x30')]=_[_0x8fed('0x2c')](_0x11e5d9,_0x8fed('0x29'));_0x2fae39[_0x8fed('0x31')]=_[_0x8fed('0x32')](_0x4563ca[_0x8fed('0x31')]);_0x2fae39[_0x8fed('0x33')]=_['intersection'](_0x2fae39[_0x8fed('0x30')],_0x2fae39[_0x8fed('0x31')]);_0x12462b[_0x8fed('0x34')]=_['intersection'](_0x2fae39[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x4563ca['query'][_0x8fed('0x35')]));_0x12462b[_0x8fed('0x34')]=_0x12462b[_0x8fed('0x34')][_0x8fed('0x36')]?_0x12462b['attributes']:_0x2fae39[_0x8fed('0x30')];if(!_0x4563ca[_0x8fed('0x31')][_0x8fed('0x37')](_0x8fed('0x38'))){_0x12462b[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x4563ca['query'][_0x8fed('0x20')]);_0x12462b[_0x8fed('0x1e')]=qs[_0x8fed('0x1e')](_0x4563ca[_0x8fed('0x31')][_0x8fed('0x1e')]);}_0x12462b[_0x8fed('0x39')]=qs[_0x8fed('0x3a')](_0x4563ca[_0x8fed('0x31')][_0x8fed('0x3a')]);_0x12462b[_0x8fed('0x3b')]=qs['filters'](_[_0x8fed('0x3c')](_0x4563ca[_0x8fed('0x31')],_0x2fae39[_0x8fed('0x33')]),_0x11e5d9);if(_0x4563ca['query']['filter']){_0x12462b[_0x8fed('0x3b')]=_[_0x8fed('0x3d')](_0x12462b[_0x8fed('0x3b')],{'$or':_['map'](_0x11e5d9,function(_0xd487a6){if(_0xd487a6[_0x8fed('0x2f')]!==_0x8fed('0x3e')){var _0x2720c2={};_0x2720c2[_0xd487a6[_0x8fed('0x29')]]={'$like':'%'+_0x4563ca[_0x8fed('0x31')][_0x8fed('0x3f')]+'%'};return _0x2720c2;}})});}_0x12462b=_['merge']({},_0x12462b,_0x4563ca[_0x8fed('0x40')]);var _0x1ef5be={'where':_0x12462b[_0x8fed('0x3b')]};return db['Team']['count'](_0x1ef5be)['then'](function(_0x494645){_0x36952b[_0x8fed('0x21')]=_0x494645;if(_0x4563ca[_0x8fed('0x31')][_0x8fed('0x41')]){_0x12462b[_0x8fed('0x42')]=[{'all':!![]}];}return db[_0x8fed('0x2d')][_0x8fed('0x43')](_0x12462b);})[_0x8fed('0x28')](function(_0xc97df7){_0x36952b['rows']=_0xc97df7;return _0x36952b;})[_0x8fed('0x28')](respondWithFilteredResult(_0x39a61d,_0x12462b))['catch'](handleError(_0x39a61d,null));};exports[_0x8fed('0x44')]=function(_0x16eda5,_0x28f92f){var _0x328384={'raw':![],'where':{'id':_0x16eda5[_0x8fed('0x45')]['id']}},_0x38f290={};_0x38f290[_0x8fed('0x30')]=_[_0x8fed('0x32')](db[_0x8fed('0x2d')][_0x8fed('0x2e')]);_0x38f290['query']=_['keys'](_0x16eda5[_0x8fed('0x31')]);_0x38f290[_0x8fed('0x33')]=_['intersection'](_0x38f290['model'],_0x38f290['query']);_0x328384[_0x8fed('0x34')]=_[_0x8fed('0x46')](_0x38f290[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x16eda5[_0x8fed('0x31')][_0x8fed('0x35')]));_0x328384['attributes']=_0x328384[_0x8fed('0x34')][_0x8fed('0x36')]?_0x328384[_0x8fed('0x34')]:_0x38f290[_0x8fed('0x30')];if(_0x16eda5[_0x8fed('0x31')][_0x8fed('0x41')]){_0x328384[_0x8fed('0x42')]=[{'all':!![]}];}_0x328384=_[_0x8fed('0x3d')]({},_0x328384,_0x16eda5['options']);return db[_0x8fed('0x2d')][_0x8fed('0x47')](_0x328384)['then'](handleEntityNotFound(_0x28f92f,null))['then'](respondWithResult(_0x28f92f,null))[_0x8fed('0x48')](handleError(_0x28f92f,null));};exports[_0x8fed('0x49')]=function(_0x508a5d,_0x4efbc1){return db[_0x8fed('0x2d')][_0x8fed('0x49')](_0x508a5d[_0x8fed('0x4a')],{})[_0x8fed('0x28')](function(_0x501beb){var _0x295b38=_0x508a5d[_0x8fed('0x4b')][_0x8fed('0x4c')]({'plain':!![]});if(!_0x295b38)throw new Error(_0x8fed('0x4d'));if(_0x295b38[_0x8fed('0x4e')]===_0x8fed('0x4b')){var _0x5085f6=_0x501beb['get']({'plain':!![]});var _0x4ca23a=_0x8fed('0x4f');return db[_0x8fed('0x50')]['find']({'where':{'name':_0x4ca23a,'userProfileId':_0x295b38[_0x8fed('0x51')]},'raw':!![]})[_0x8fed('0x28')](function(_0x532dac){if(_0x532dac&&_0x532dac[_0x8fed('0x52')]===0x0){return db[_0x8fed('0x53')][_0x8fed('0x49')]({'name':_0x5085f6[_0x8fed('0x29')],'resourceId':_0x5085f6['id'],'type':_0x532dac[_0x8fed('0x29')],'sectionId':_0x532dac['id']},{})['then'](function(){return _0x501beb;});}else{return _0x501beb;}})[_0x8fed('0x48')](function(_0x8eb1fd){logger[_0x8fed('0x54')](_0x8fed('0x55'),_0x8eb1fd);throw _0x8eb1fd;});}return _0x501beb;})['then'](respondWithResult(_0x4efbc1,0xc9))[_0x8fed('0x48')](handleError(_0x4efbc1,null));};exports['update']=function(_0x39cab9,_0x42be8a){if(_0x39cab9[_0x8fed('0x4a')]['id']){delete _0x39cab9[_0x8fed('0x4a')]['id'];}return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x39cab9[_0x8fed('0x45')]['id']}})['then'](handleEntityNotFound(_0x42be8a,null))[_0x8fed('0x28')](saveUpdates(_0x39cab9[_0x8fed('0x4a')],null))[_0x8fed('0x28')](respondWithResult(_0x42be8a,null))[_0x8fed('0x48')](handleError(_0x42be8a,null));};exports['destroy']=function(_0x263e22,_0x1342ad){var _0x5b36b6=_0x263e22[_0x8fed('0x45')]['id'];var _0x54f46f=[];return db[_0x8fed('0x56')][_0x8fed('0x57')](function(_0x24e4f0){var _0x18212b=_0x8fed('0x58')+_0x5b36b6;return db[_0x8fed('0x56')]['query'](_0x18212b,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0})[_0x8fed('0x28')](function(_0x48517a){_0x54f46f=_[_0x8fed('0x2c')](_0x48517a,function(_0x4418b5){return Number(_0x4418b5[_0x8fed('0x5a')]);});})[_0x8fed('0x28')](function(){var _0x33834e='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x33834e,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})['then'](function(_0x5a2bd1){var _0x3c8c21=_[_0x8fed('0x2c')](_0x5a2bd1,function(_0x56002b){return Number(_0x56002b[_0x8fed('0x5b')]);});return db[_0x8fed('0x5c')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'VoiceQueueId':{'$in':_0x3c8c21}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x2f1566=_0x8fed('0x5e')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x2f1566,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x2376d0){var _0xf08a22=_[_0x8fed('0x2c')](_0x2376d0,function(_0x5ed8c5){return Number(_0x5ed8c5[_0x8fed('0x61')]);});return db['UserMailQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'MailQueueId':{'$in':_0xf08a22}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x41614c=_0x8fed('0x62')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x41614c,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x1ab8a2){var _0x5757f2=_[_0x8fed('0x2c')](_0x1ab8a2,function(_0x1c51fb){return Number(_0x1c51fb[_0x8fed('0x63')]);});return db['UserSmsQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'SmsQueueId':{'$in':_0x5757f2}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x3dd3bc=_0x8fed('0x64')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x3dd3bc,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x456abf){var _0x2229d3=_['map'](_0x456abf,function(_0x3b4390){return Number(_0x3b4390[_0x8fed('0x65')]);});return db['UserChatQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'ChatQueueId':{'$in':_0x2229d3}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x572e89=_0x8fed('0x66')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x572e89,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})['then'](function(_0x1a3147){var _0x1c2a05=_['map'](_0x1a3147,function(_0x54b1a2){return Number(_0x54b1a2[_0x8fed('0x67')]);});return db['UserFaxQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'FaxQueueId':{'$in':_0x1c2a05}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x3d6930=_0x8fed('0x68')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x3d6930,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x9f2c81){var _0xe1d480=_[_0x8fed('0x2c')](_0x9f2c81,function(_0x37c7c9){return Number(_0x37c7c9[_0x8fed('0x69')]);});return db[_0x8fed('0x6a')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'OpenchannelQueueId':{'$in':_0xe1d480}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x31f31c=_0x8fed('0x6b')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x31f31c,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x433083){var _0x232d86=_['map'](_0x433083,function(_0xf80d7){return Number(_0xf80d7[_0x8fed('0x6c')]);});return db[_0x8fed('0x6d')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'WhatsappQueueId':{'$in':_0x232d86}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){return db[_0x8fed('0x6e')]['find']({'where':{'TeamId':_0x5b36b6}});})[_0x8fed('0x28')](function(_0x145dc0){if(_0x145dc0===null){return;}return db['UserVoicePrefix'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'VoicePrefixId':_0x145dc0[_0x8fed('0x6f')]},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){return db[_0x8fed('0x2d')][_0x8fed('0x5d')]({'where':{'id':_0x5b36b6},'cascade':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x469768){if(_0x469768===0x0){_0x1342ad['sendStatus'](0x194);}else{return db[_0x8fed('0x53')][_0x8fed('0x5d')]({'where':{'type':'Teams','resourceId':_0x5b36b6},'cascade':!![],'transaction':_0x24e4f0})[_0x8fed('0x28')](function(){_0x1342ad[_0x8fed('0x1b')](0xcc)[_0x8fed('0x1c')]();});}})['catch'](function(_0x3bb0a2){_0x1342ad['status'](0x1f4)['send'](_0x3bb0a2);});});};exports[_0x8fed('0x70')]=function(_0x422de0,_0x227e4b,_0x7cbc40){return db[_0x8fed('0x2d')]['findOne']({'where':{'id':_0x422de0[_0x8fed('0x45')]['id']}})[_0x8fed('0x28')](handleEntityNotFound(_0x227e4b,null))[_0x8fed('0x28')](function(_0x1e75d8){if(!_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')]||!utils[_0x8fed('0x72')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')])){throw new db[(_0x8fed('0x59'))][(_0x8fed('0x73'))](_0x8fed('0x74'));}var _0x1237bd={};var _0x3e6d30={};_0x3e6d30[_0x8fed('0x30')]=_[_0x8fed('0x32')](db[_[_0x8fed('0x75')](_0x422de0['query'][_0x8fed('0x71')][_0x8fed('0x76')]())+'Queue'][_0x8fed('0x2e')]);_0x3e6d30['query']=_['keys'](_0x422de0[_0x8fed('0x31')]);_0x3e6d30[_0x8fed('0x33')]=_[_0x8fed('0x46')](_0x3e6d30[_0x8fed('0x30')],_0x3e6d30[_0x8fed('0x31')]);_0x1237bd[_0x8fed('0x34')]=_[_0x8fed('0x46')](_0x3e6d30['model'],qs[_0x8fed('0x35')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x35')]));_0x1237bd[_0x8fed('0x34')]=_0x1237bd[_0x8fed('0x34')][_0x8fed('0x36')]?_0x1237bd['attributes']:_0x3e6d30[_0x8fed('0x30')];_0x1237bd[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x20')]);_0x1237bd['offset']=qs[_0x8fed('0x1e')](_0x422de0['query'][_0x8fed('0x1e')]);_0x1237bd[_0x8fed('0x39')]=qs[_0x8fed('0x3a')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x3a')]);_0x1237bd[_0x8fed('0x3b')]=qs[_0x8fed('0x33')](_[_0x8fed('0x3c')](_0x422de0['query'],_0x3e6d30[_0x8fed('0x33')]));_0x1237bd=_['merge']({},_0x1237bd,_0x422de0[_0x8fed('0x40')]);return _0x1e75d8['get'+_[_0x8fed('0x75')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')][_0x8fed('0x76')]())+'Queues'](_0x1237bd);})[_0x8fed('0x28')](respondWithResult(_0x227e4b,null))[_0x8fed('0x48')](handleError(_0x227e4b,null));};exports['addQueues']=function(_0x2795b1,_0x2a060f,_0x430414){return db['Team']['findOne']({'where':{'id':_0x2795b1[_0x8fed('0x45')]['id']}})['then'](function(_0xfec68){if(_0xfec68){if(!_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x71')]||!utils[_0x8fed('0x72')](_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x71')])){throw new db['Sequelize'][(_0x8fed('0x73'))](_0x8fed('0x74'));}return _0xfec68[_0x8fed('0x77')+_['capitalize'](_0x2795b1['body'][_0x8fed('0x71')][_0x8fed('0x76')]())+_0x8fed('0x78')](_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x79')]);}return null;})[_0x8fed('0x28')](handleEntityNotFound(_0x2a060f,null))[_0x8fed('0x28')](respondWithStatusCode(_0x2a060f,null))['catch'](handleError(_0x2a060f,null));};exports[_0x8fed('0x7a')]=function(_0x35abb7,_0x271478,_0x43a6b9){return db[_0x8fed('0x2d')][_0x8fed('0x7b')]({'where':{'id':_0x35abb7['params']['id']}})['then'](function(_0x386f7c){if(_0x386f7c){if(!_0x35abb7[_0x8fed('0x31')][_0x8fed('0x71')]||!utils['isValidChannel'](_0x35abb7['query'][_0x8fed('0x71')])){throw new db[(_0x8fed('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x386f7c['remove'+_[_0x8fed('0x75')](_0x35abb7['query'][_0x8fed('0x71')][_0x8fed('0x76')]())+_0x8fed('0x78')](_0x35abb7[_0x8fed('0x31')]['ids']);}return null;})[_0x8fed('0x28')](handleEntityNotFound(_0x271478,null))[_0x8fed('0x28')](respondWithStatusCode(_0x271478,null))[_0x8fed('0x48')](handleError(_0x271478,null));};exports[_0x8fed('0x7c')]=function(_0x3c6523,_0x23416d){var _0x593646=_[_0x8fed('0x7d')](_0x3c6523['body'][_0x8fed('0x79')])?_0x3c6523[_0x8fed('0x4a')]['ids']:[_0x3c6523[_0x8fed('0x4a')][_0x8fed('0x79')]];var _0x483ac6=_0x3c6523[_0x8fed('0x45')]['id'];return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x483ac6}})['then'](handleEntityNotFound(_0x23416d,null))[_0x8fed('0x28')](function(_0x48b18a){if(_0x48b18a){var _0x5da3d1=[_0x8fed('0x7e'),'Chat',_0x8fed('0x7f'),_0x8fed('0x80'),_0x8fed('0x81'),'Openchannel',_0x8fed('0x82')];return db[_0x8fed('0x56')][_0x8fed('0x57')](function(_0x31e169){var _0x4cd0f2=_[_0x8fed('0x2c')](_0x5da3d1,function(_0x202063){var _0x17def0={'attributes':['id',_0x8fed('0x29')]};if(_0x202063===_0x8fed('0x7e')){_0x17def0[_0x8fed('0x83')]={'attributes':[_0x8fed('0x84')]};}return _0x48b18a[_0x8fed('0x4c')+_0x202063+_0x8fed('0x78')](_0x17def0)[_0x8fed('0x28')](function(_0x30d457){var _0x15f48d=_[_0x8fed('0x2c')](_0x30d457,function(_0x2bea1f){var _0x39e499=_[_0x8fed('0x2c')](_0x593646,function(_0x2cf0a5){var _0x31b124={'where':{'UserId':_0x2cf0a5,[_0x202063+'QueueId']:_0x2bea1f['id']},'transaction':_0x31e169};if(_0x202063===_0x8fed('0x7e')){_0x31b124[_0x8fed('0x85')]={'penalty':_0x2bea1f[_0x8fed('0x86')]['penalty']};}return db[_0x8fed('0x87')+_0x202063+_0x8fed('0x88')]['findOrCreate'](_0x31b124)[_0x8fed('0x28')](function(){socket[_0x8fed('0x89')]('user'+_0x202063+_0x8fed('0x8a'),{'UserId':_0x2cf0a5,[_0x202063+'QueueId']:_0x2bea1f['id']});if(_0x202063!==_0x8fed('0x7e')){return;}return db[_0x8fed('0x87')][_0x8fed('0x43')]({'where':{'id':_0x593646,'online':0x1},'attributes':['id',_0x8fed('0x29'),'online',_0x8fed('0x8b'),'interface'],'raw':!![]})['then'](function(_0x3ab8de){var _0x3f1236=_['map'](_0x3ab8de,function(_0x5405bf){return db['UserVoiceQueueRt'][_0x8fed('0x8c')]({'membername':_0x5405bf[_0x8fed('0x29')],'UserId':_0x5405bf['id'],'queue_name':_0x2bea1f[_0x8fed('0x29')],'VoiceQueueId':_0x2bea1f['id'],'interface':_[_0x8fed('0x8d')](_0x5405bf['interface'])?util[_0x8fed('0x8e')]('SIP/%s',_0x5405bf[_0x8fed('0x29')]):_0x5405bf['interface'],'paused':_0x5405bf[_0x8fed('0x8b')]||![],'penalty':_0x2bea1f[_0x8fed('0x86')][_0x8fed('0x84')]},{'transaction':_0x31e169});});return Promise[_0x8fed('0x8f')](_0x3f1236);});});});return Promise[_0x8fed('0x8f')](_0x39e499);});return Promise['all'](_0x15f48d);})[_0x8fed('0x28')](function(){return db['TeamVoicePrefix'][_0x8fed('0x7b')]({'where':{'teamId':_0x483ac6}})[_0x8fed('0x28')](function(_0x4e0dd7){if(_0x4e0dd7){var _0x4ffebd=_['map'](_0x593646,function(_0x4b9298){db[_0x8fed('0x90')][_0x8fed('0x8c')]({'UserId':_0x4b9298,'VoicePrefixId':_0x4e0dd7[_0x8fed('0x6f')]});});return Promise[_0x8fed('0x8f')](_0x4ffebd);}});});});return Promise[_0x8fed('0x8f')](_0x4cd0f2)[_0x8fed('0x28')](function(){return _0x48b18a['addAgents'](_0x593646,{'transaction':_0x31e169})[_0x8fed('0x91')](function(_0x45122c){return _0x45122c;});});});}})[_0x8fed('0x28')](respondWithResult(_0x23416d,null))[_0x8fed('0x48')](handleError(_0x23416d,null));};exports[_0x8fed('0x92')]=function(_0x586720,_0x41bb43){var _0x20e03c=_[_0x8fed('0x7d')](_0x586720[_0x8fed('0x31')][_0x8fed('0x79')])?_0x586720[_0x8fed('0x31')][_0x8fed('0x79')]:[_0x586720[_0x8fed('0x31')][_0x8fed('0x79')]];var _0x3d38a2=_0x586720[_0x8fed('0x45')]['id'];return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x3d38a2}})[_0x8fed('0x28')](handleEntityNotFound(_0x41bb43,null))['then'](function(_0x5602a8){if(_0x5602a8){var _0x8f78aa=[_0x8fed('0x7e'),_0x8fed('0x93'),'Mail',_0x8fed('0x80'),_0x8fed('0x81'),_0x8fed('0x94'),'Whatsapp'];return db[_0x8fed('0x56')]['transaction'](function(_0x433942){var _0x1aaff4=_['map'](_0x8f78aa,function(_0x519baa){var _0x338f35={'attributes':['id',_0x8fed('0x29')]};return _0x5602a8[_0x8fed('0x4c')+_0x519baa+_0x8fed('0x78')](_0x338f35)[_0x8fed('0x28')](function(_0x421d3e){var _0xb44c18=_[_0x8fed('0x2c')](_0x421d3e,function(_0xf17767){return _0xf17767[_0x8fed('0x92')](_0x20e03c,{'transaction':_0x433942})[_0x8fed('0x28')](function(){var _0xd16342=_['map'](_0x20e03c,function(_0x10755b){socket['emit'](_0x8fed('0x4b')+_0x519baa+_0x8fed('0x95'),{'UserId':Number(_0x10755b),[_0x519baa+'QueueId']:_0xf17767['id']});if(_0x519baa!==_0x8fed('0x7e')){return;}return db['UserVoiceQueueRt'][_0x8fed('0x5d')]({'where':{'VoiceQueueId':_0xf17767['id'],'UserId':_0x10755b},'transaction':_0x433942});});return Promise[_0x8fed('0x8f')](_0xd16342);});});return Promise['all'](_0xb44c18);});});return Promise[_0x8fed('0x8f')](_0x1aaff4)[_0x8fed('0x28')](function(){return _0x5602a8[_0x8fed('0x92')](_0x20e03c,{'transaction':_0x433942});})[_0x8fed('0x28')](function(){return db['TeamVoicePrefix'][_0x8fed('0x7b')]({'where':{'teamId':_0x3d38a2}})['then'](function(_0x5b9fbf){if(_0x5b9fbf){var _0x510344=_[_0x8fed('0x2c')](_0x20e03c,function(_0x25bac7){db[_0x8fed('0x90')]['destroy']({'where':{'UserId':_0x25bac7,'VoicePrefixId':_0x5b9fbf[_0x8fed('0x6f')]}});});return Promise['all'](_0x510344);}});});});}})['then'](respondWithStatusCode(_0x41bb43,null))[_0x8fed('0x48')](handleError(_0x41bb43,null));};exports[_0x8fed('0x96')]=function(_0x1e7469,_0x35c525,_0x5720ad){var _0x4a1c01={};var _0x348273={};var _0x349604;var _0x34c7d9;return db[_0x8fed('0x2d')][_0x8fed('0x7b')]({'where':{'id':_0x1e7469[_0x8fed('0x45')]['id']}})[_0x8fed('0x28')](handleEntityNotFound(_0x35c525,null))['then'](function(_0x43c0ce){if(_0x43c0ce){_0x349604=_0x43c0ce;_0x348273[_0x8fed('0x30')]=_['keys'](db['User'][_0x8fed('0x2e')]);_0x348273[_0x8fed('0x31')]=_[_0x8fed('0x32')](_0x1e7469[_0x8fed('0x31')]);_0x348273['filters']=_[_0x8fed('0x46')](_0x348273['model'],_0x348273[_0x8fed('0x31')]);_0x4a1c01[_0x8fed('0x34')]=_['intersection'](_0x348273[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x1e7469['query'][_0x8fed('0x35')]));_0x4a1c01[_0x8fed('0x34')]=_0x4a1c01[_0x8fed('0x34')][_0x8fed('0x36')]?_0x4a1c01[_0x8fed('0x34')]:_0x348273['model'];_0x4a1c01['order']=qs[_0x8fed('0x3a')](_0x1e7469['query'][_0x8fed('0x3a')]);_0x4a1c01[_0x8fed('0x3b')]=qs[_0x8fed('0x33')](_[_0x8fed('0x3c')](_0x1e7469[_0x8fed('0x31')],_0x348273[_0x8fed('0x33')]));if(_0x1e7469[_0x8fed('0x31')][_0x8fed('0x3f')]){_0x4a1c01[_0x8fed('0x3b')]=_['merge'](_0x4a1c01[_0x8fed('0x3b')],{'$or':_[_0x8fed('0x2c')](_0x4a1c01[_0x8fed('0x34')],function(_0x19e751){var _0x37b454={};_0x37b454[_0x19e751]={'$like':'%'+_0x1e7469['query'][_0x8fed('0x3f')]+'%'};return _0x37b454;})});}_0x4a1c01=_[_0x8fed('0x3d')]({},_0x4a1c01,_0x1e7469['options']);return _0x349604[_0x8fed('0x96')](_0x4a1c01);}})[_0x8fed('0x28')](function(_0x491c96){if(_0x491c96){_0x34c7d9=_0x491c96[_0x8fed('0x36')];if(!_0x1e7469[_0x8fed('0x31')]['hasOwnProperty'](_0x8fed('0x38'))){_0x4a1c01[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x1e7469[_0x8fed('0x31')][_0x8fed('0x20')]);_0x4a1c01[_0x8fed('0x1e')]=qs[_0x8fed('0x1e')](_0x1e7469[_0x8fed('0x31')][_0x8fed('0x1e')]);}return _0x349604[_0x8fed('0x96')](_0x4a1c01);}})[_0x8fed('0x28')](function(_0x1a317f){if(_0x1a317f){return _0x1a317f?{'count':_0x34c7d9,'rows':_0x1a317f}:null;}})[_0x8fed('0x28')](respondWithResult(_0x35c525,null))[_0x8fed('0x48')](handleError(_0x35c525,null));}; \ No newline at end of file +var _0x004e=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','Team','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','fields','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','Teams','getQueues','channel','Unknown\x20channel','toLowerCase','Queue','order','capitalize','Queues','findOne','ValidationError','add','ids','isValidChannel','remove','isArray','Voice','Chat','Mail','Sms','Openchannel','through','penalty','User','findOrCreate','emit','user','Queue:save','QueueId','voicePause','interface','upsert','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','Fax','Whatsapp','removeAgents','Queue:remove','UserVoiceQueueRt','VoicePrefixId','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x48a8d3,_0xb4890b){var _0x547b58=function(_0x2937b2){while(--_0x2937b2){_0x48a8d3['push'](_0x48a8d3['shift']());}};_0x547b58(++_0xb4890b);}(_0x004e,0x82));var _0xe004=function(_0x4e9365,_0x3268e8){_0x4e9365=_0x4e9365-0x0;var _0x533711=_0x004e[_0x4e9365];return _0x533711;};'use strict';var emlformat=require(_0xe004('0x0'));var rimraf=require(_0xe004('0x1'));var zipdir=require(_0xe004('0x2'));var jsonpatch=require(_0xe004('0x3'));var rp=require(_0xe004('0x4'));var moment=require(_0xe004('0x5'));var BPromise=require(_0xe004('0x6'));var Mustache=require(_0xe004('0x7'));var util=require('util');var path=require(_0xe004('0x8'));var sox=require('sox');var csv=require(_0xe004('0x9'));var ejs=require(_0xe004('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe004('0xb'));var squel=require(_0xe004('0xc'));var crypto=require(_0xe004('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe004('0xe'));var toCsv=require(_0xe004('0x9'));var querystring=require(_0xe004('0xf'));var Papa=require('papaparse');var Redis=require(_0xe004('0x10'));var authService=require(_0xe004('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe004('0x12'));var hardwareService=require(_0xe004('0x13'));var logger=require(_0xe004('0x14'))(_0xe004('0x15'));var utils=require(_0xe004('0x16'));var config=require(_0xe004('0x17'));var licenseUtil=require(_0xe004('0x18'));var db=require(_0xe004('0x19'))['db'];config[_0xe004('0x1a')]=_[_0xe004('0x1b')](config[_0xe004('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe004('0x1c'))(new Redis(config[_0xe004('0x1a')]));require(_0xe004('0x1d'))[_0xe004('0x1e')](socket);function respondWithStatusCode(_0x1a29ac,_0x37861b){_0x37861b=_0x37861b||0xcc;return function(_0x517f8e){if(_0x517f8e){return _0x1a29ac['sendStatus'](_0x37861b);}return _0x1a29ac[_0xe004('0x1f')](_0x37861b)[_0xe004('0x20')]();};}function respondWithResult(_0x476c56,_0x596738){_0x596738=_0x596738||0xc8;return function(_0xfa9e16){if(_0xfa9e16){return _0x476c56[_0xe004('0x1f')](_0x596738)[_0xe004('0x21')](_0xfa9e16);}};}function respondWithFilteredResult(_0x349a9f,_0x10e0cb){return function(_0x1dcf29){if(_0x1dcf29){var _0x443967=typeof _0x10e0cb[_0xe004('0x22')]==='undefined'&&typeof _0x10e0cb['limit']===_0xe004('0x23');var _0x406e1c=_0x1dcf29[_0xe004('0x24')];var _0x4393e3=_0x443967?0x0:_0x10e0cb[_0xe004('0x22')];var _0x42cdab=_0x443967?_0x1dcf29['count']:_0x10e0cb[_0xe004('0x22')]+_0x10e0cb[_0xe004('0x25')];var _0x36f92a;if(_0x42cdab>=_0x406e1c){_0x42cdab=_0x406e1c;_0x36f92a=0xc8;}else{_0x36f92a=0xce;}_0x349a9f[_0xe004('0x1f')](_0x36f92a);return _0x349a9f[_0xe004('0x26')](_0xe004('0x27'),_0x4393e3+'-'+_0x42cdab+'/'+_0x406e1c)[_0xe004('0x21')](_0x1dcf29);}return null;};}function patchUpdates(_0x283824){return function(_0x40169c){try{jsonpatch[_0xe004('0x28')](_0x40169c,_0x283824,!![]);}catch(_0x1e467b){return BPromise[_0xe004('0x29')](_0x1e467b);}return _0x40169c[_0xe004('0x2a')]();};}function saveUpdates(_0x20006e,_0x5e5e65){return function(_0x48ff7a){if(_0x48ff7a){return _0x48ff7a[_0xe004('0x2b')](_0x20006e)[_0xe004('0x2c')](function(_0x2eed9a){return _0x2eed9a;});}return null;};}function handleEntityNotFound(_0x13a856,_0x2fa658){return function(_0x5f3fe2){if(!_0x5f3fe2){_0x13a856['sendStatus'](0x194);}return _0x5f3fe2;};}function handleError(_0x48d66a,_0xfed2ae){_0xfed2ae=_0xfed2ae||0x1f4;return function(_0x482786){logger[_0xe004('0x2d')](_0x482786['stack']);if(_0x482786['name']){delete _0x482786[_0xe004('0x2e')];}_0x48d66a[_0xe004('0x1f')](_0xfed2ae)[_0xe004('0x2f')](_0x482786);};}exports['index']=function(_0x3a7c08,_0xcb9bc1){var _0x51f1be={},_0x1a4b50={},_0x507704={'count':0x0,'rows':[]};var _0x7d37a4=_[_0xe004('0x30')](db[_0xe004('0x31')][_0xe004('0x32')],function(_0x860211){return{'name':_0x860211[_0xe004('0x33')],'type':_0x860211[_0xe004('0x34')][_0xe004('0x35')]};});_0x1a4b50[_0xe004('0x36')]=_[_0xe004('0x30')](_0x7d37a4,_0xe004('0x2e'));_0x1a4b50[_0xe004('0x37')]=_[_0xe004('0x38')](_0x3a7c08[_0xe004('0x37')]);_0x1a4b50['filters']=_[_0xe004('0x39')](_0x1a4b50['model'],_0x1a4b50[_0xe004('0x37')]);_0x51f1be[_0xe004('0x3a')]=_[_0xe004('0x39')](_0x1a4b50[_0xe004('0x36')],qs['fields'](_0x3a7c08[_0xe004('0x37')]['fields']));_0x51f1be[_0xe004('0x3a')]=_0x51f1be[_0xe004('0x3a')][_0xe004('0x3b')]?_0x51f1be['attributes']:_0x1a4b50[_0xe004('0x36')];if(!_0x3a7c08['query'][_0xe004('0x3c')](_0xe004('0x3d'))){_0x51f1be[_0xe004('0x25')]=qs['limit'](_0x3a7c08[_0xe004('0x37')]['limit']);_0x51f1be[_0xe004('0x22')]=qs[_0xe004('0x22')](_0x3a7c08[_0xe004('0x37')]['offset']);}_0x51f1be['order']=qs[_0xe004('0x3e')](_0x3a7c08[_0xe004('0x37')][_0xe004('0x3e')]);_0x51f1be[_0xe004('0x3f')]=qs[_0xe004('0x40')](_[_0xe004('0x41')](_0x3a7c08[_0xe004('0x37')],_0x1a4b50['filters']),_0x7d37a4);if(_0x3a7c08['query'][_0xe004('0x42')]){_0x51f1be[_0xe004('0x3f')]=_[_0xe004('0x43')](_0x51f1be[_0xe004('0x3f')],{'$or':_[_0xe004('0x30')](_0x7d37a4,function(_0x4989b2){if(_0x4989b2['type']!==_0xe004('0x44')){var _0x5e99da={};_0x5e99da[_0x4989b2[_0xe004('0x2e')]]={'$like':'%'+_0x3a7c08[_0xe004('0x37')][_0xe004('0x42')]+'%'};return _0x5e99da;}})});}_0x51f1be=_[_0xe004('0x43')]({},_0x51f1be,_0x3a7c08[_0xe004('0x45')]);var _0x306795={'where':_0x51f1be[_0xe004('0x3f')]};return db[_0xe004('0x31')][_0xe004('0x24')](_0x306795)[_0xe004('0x2c')](function(_0x27281b){_0x507704[_0xe004('0x24')]=_0x27281b;if(_0x3a7c08['query']['includeAll']){_0x51f1be['include']=[{'all':!![]}];}return db[_0xe004('0x31')][_0xe004('0x46')](_0x51f1be);})[_0xe004('0x2c')](function(_0x5c55b8){_0x507704[_0xe004('0x47')]=_0x5c55b8;return _0x507704;})[_0xe004('0x2c')](respondWithFilteredResult(_0xcb9bc1,_0x51f1be))[_0xe004('0x48')](handleError(_0xcb9bc1,null));};exports['show']=function(_0x4f90a6,_0x370cd6){var _0x29e698={'raw':![],'where':{'id':_0x4f90a6[_0xe004('0x49')]['id']}},_0x108b49={};_0x108b49['model']=_[_0xe004('0x38')](db['Team'][_0xe004('0x32')]);_0x108b49['query']=_[_0xe004('0x38')](_0x4f90a6['query']);_0x108b49['filters']=_['intersection'](_0x108b49[_0xe004('0x36')],_0x108b49[_0xe004('0x37')]);_0x29e698['attributes']=_['intersection'](_0x108b49[_0xe004('0x36')],qs[_0xe004('0x4a')](_0x4f90a6[_0xe004('0x37')][_0xe004('0x4a')]));_0x29e698[_0xe004('0x3a')]=_0x29e698['attributes']['length']?_0x29e698[_0xe004('0x3a')]:_0x108b49[_0xe004('0x36')];if(_0x4f90a6[_0xe004('0x37')]['includeAll']){_0x29e698[_0xe004('0x4b')]=[{'all':!![]}];}_0x29e698=_[_0xe004('0x43')]({},_0x29e698,_0x4f90a6[_0xe004('0x45')]);return db['Team'][_0xe004('0x4c')](_0x29e698)['then'](handleEntityNotFound(_0x370cd6,null))[_0xe004('0x2c')](respondWithResult(_0x370cd6,null))[_0xe004('0x48')](handleError(_0x370cd6,null));};exports[_0xe004('0x4d')]=function(_0x9ec6c,_0x5102f4){return db[_0xe004('0x31')][_0xe004('0x4d')](_0x9ec6c[_0xe004('0x4e')],{})[_0xe004('0x2c')](function(_0x5a34a6){var _0x51f288=_0x9ec6c['user'][_0xe004('0x4f')]({'plain':!![]});if(!_0x51f288)throw new Error(_0xe004('0x50'));if(_0x51f288[_0xe004('0x51')]==='user'){var _0x58f7cc=_0x5a34a6['get']({'plain':!![]});var _0x122ddb='Teams';return db[_0xe004('0x52')][_0xe004('0x4c')]({'where':{'name':_0x122ddb,'userProfileId':_0x51f288[_0xe004('0x53')]},'raw':!![]})[_0xe004('0x2c')](function(_0x2bd3af){if(_0x2bd3af&&_0x2bd3af[_0xe004('0x54')]===0x0){return db[_0xe004('0x55')][_0xe004('0x4d')]({'name':_0x58f7cc['name'],'resourceId':_0x58f7cc['id'],'type':_0x2bd3af['name'],'sectionId':_0x2bd3af['id']},{})[_0xe004('0x2c')](function(){return _0x5a34a6;});}else{return _0x5a34a6;}})[_0xe004('0x48')](function(_0x1bf95c){logger['error'](_0xe004('0x56'),_0x1bf95c);throw _0x1bf95c;});}return _0x5a34a6;})['then'](respondWithResult(_0x5102f4,0xc9))[_0xe004('0x48')](handleError(_0x5102f4,null));};exports[_0xe004('0x2b')]=function(_0x10d800,_0x9bcf62){if(_0x10d800['body']['id']){delete _0x10d800['body']['id'];}return db[_0xe004('0x31')][_0xe004('0x4c')]({'where':{'id':_0x10d800['params']['id']}})[_0xe004('0x2c')](handleEntityNotFound(_0x9bcf62,null))[_0xe004('0x2c')](saveUpdates(_0x10d800[_0xe004('0x4e')],null))[_0xe004('0x2c')](respondWithResult(_0x9bcf62,null))['catch'](handleError(_0x9bcf62,null));};exports['destroy']=function(_0x5f15ab,_0x4f5b44){var _0x376f35=_0x5f15ab[_0xe004('0x49')]['id'];var _0x5d7685=[];return db[_0xe004('0x57')][_0xe004('0x58')](function(_0x29c208){var _0x22e87c=_0xe004('0x59')+_0x376f35;return db['sequelize'][_0xe004('0x37')](_0x22e87c,{'type':db['Sequelize'][_0xe004('0x5a')][_0xe004('0x5b')],'raw':!![],'transaction':_0x29c208})['then'](function(_0x54ff21){_0x5d7685=_[_0xe004('0x30')](_0x54ff21,function(_0x144f9f){return Number(_0x144f9f[_0xe004('0x5c')]);});})['then'](function(){var _0x13e593='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x376f35;return db[_0xe004('0x57')][_0xe004('0x37')](_0x13e593,{'type':db['Sequelize'][_0xe004('0x5a')]['SELECT'],'raw':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x5cb1f8){var _0x3ac413=_[_0xe004('0x30')](_0x5cb1f8,function(_0x4a359d){return Number(_0x4a359d[_0xe004('0x5d')]);});return db['UserVoiceQueue'][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'VoiceQueueId':{'$in':_0x3ac413}},'transaction':_0x29c208});})['then'](function(){var _0xdf0d01=_0xe004('0x5f')+_0x376f35;return db['sequelize']['query'](_0xdf0d01,{'type':db[_0xe004('0x60')][_0xe004('0x5a')][_0xe004('0x5b')],'raw':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x2c36e0){var _0x422c48=_[_0xe004('0x30')](_0x2c36e0,function(_0x35128d){return Number(_0x35128d['MailQueueId']);});return db[_0xe004('0x61')][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'MailQueueId':{'$in':_0x422c48}},'transaction':_0x29c208});})['then'](function(){var _0x4c406d=_0xe004('0x62')+_0x376f35;return db['sequelize'][_0xe004('0x37')](_0x4c406d,{'type':db[_0xe004('0x60')]['QueryTypes'][_0xe004('0x5b')],'raw':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x6614b1){var _0x2da292=_[_0xe004('0x30')](_0x6614b1,function(_0x47afa5){return Number(_0x47afa5[_0xe004('0x63')]);});return db['UserSmsQueue'][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'SmsQueueId':{'$in':_0x2da292}},'transaction':_0x29c208});})[_0xe004('0x2c')](function(){var _0x53b8f5='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x376f35;return db[_0xe004('0x57')][_0xe004('0x37')](_0x53b8f5,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x45bb0a){var _0x195d61=_[_0xe004('0x30')](_0x45bb0a,function(_0x386af5){return Number(_0x386af5[_0xe004('0x64')]);});return db[_0xe004('0x65')][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'ChatQueueId':{'$in':_0x195d61}},'transaction':_0x29c208});})[_0xe004('0x2c')](function(){var _0x1e2ba7='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x376f35;return db[_0xe004('0x57')][_0xe004('0x37')](_0x1e2ba7,{'type':db[_0xe004('0x60')][_0xe004('0x5a')][_0xe004('0x5b')],'raw':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x1f3443){var _0x7e0b82=_[_0xe004('0x30')](_0x1f3443,function(_0x1a6cde){return Number(_0x1a6cde[_0xe004('0x66')]);});return db['UserFaxQueue'][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'FaxQueueId':{'$in':_0x7e0b82}},'transaction':_0x29c208});})['then'](function(){var _0x16165e=_0xe004('0x67')+_0x376f35;return db[_0xe004('0x57')][_0xe004('0x37')](_0x16165e,{'type':db[_0xe004('0x60')][_0xe004('0x5a')][_0xe004('0x5b')],'raw':!![],'transaction':_0x29c208});})['then'](function(_0x390694){var _0x581568=_[_0xe004('0x30')](_0x390694,function(_0x4918af){return Number(_0x4918af[_0xe004('0x68')]);});return db[_0xe004('0x69')][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'OpenchannelQueueId':{'$in':_0x581568}},'transaction':_0x29c208});})[_0xe004('0x2c')](function(){var _0x40cfe5=_0xe004('0x6a')+_0x376f35;return db[_0xe004('0x57')][_0xe004('0x37')](_0x40cfe5,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x29c208});})['then'](function(_0x122e6){var _0x259233=_[_0xe004('0x30')](_0x122e6,function(_0x4170b4){return Number(_0x4170b4['WhatsappQueueId']);});return db[_0xe004('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x5d7685},'WhatsappQueueId':{'$in':_0x259233}},'transaction':_0x29c208});})['then'](function(){return db['TeamVoicePrefix'][_0xe004('0x4c')]({'where':{'TeamId':_0x376f35}});})[_0xe004('0x2c')](function(_0x120dce){if(_0x120dce===null){return;}return db[_0xe004('0x6c')][_0xe004('0x5e')]({'where':{'UserId':{'$in':_0x5d7685},'VoicePrefixId':_0x120dce['VoicePrefixId']},'transaction':_0x29c208});})[_0xe004('0x2c')](function(){return db[_0xe004('0x31')]['destroy']({'where':{'id':_0x376f35},'cascade':!![],'transaction':_0x29c208});})[_0xe004('0x2c')](function(_0x2c906a){if(_0x2c906a===0x0){_0x4f5b44['sendStatus'](0x194);}else{return db[_0xe004('0x55')][_0xe004('0x5e')]({'where':{'type':_0xe004('0x6d'),'resourceId':_0x376f35},'cascade':!![],'transaction':_0x29c208})[_0xe004('0x2c')](function(){_0x4f5b44['status'](0xcc)[_0xe004('0x20')]();});}})[_0xe004('0x48')](function(_0xa08647){_0x4f5b44[_0xe004('0x1f')](0x1f4)[_0xe004('0x2f')](_0xa08647);});});};exports[_0xe004('0x6e')]=function(_0x527ac9,_0xff739,_0x452e43){return db[_0xe004('0x31')]['findOne']({'where':{'id':_0x527ac9[_0xe004('0x49')]['id']}})[_0xe004('0x2c')](handleEntityNotFound(_0xff739,null))[_0xe004('0x2c')](function(_0x337285){if(!_0x527ac9[_0xe004('0x37')][_0xe004('0x6f')]||!utils['isValidChannel'](_0x527ac9[_0xe004('0x37')][_0xe004('0x6f')])){throw new db['Sequelize']['ValidationError'](_0xe004('0x70'));}var _0x481eb0={};var _0x4b33ca={};_0x4b33ca[_0xe004('0x36')]=_[_0xe004('0x38')](db[_['capitalize'](_0x527ac9[_0xe004('0x37')][_0xe004('0x6f')][_0xe004('0x71')]())+_0xe004('0x72')][_0xe004('0x32')]);_0x4b33ca[_0xe004('0x37')]=_['keys'](_0x527ac9[_0xe004('0x37')]);_0x4b33ca[_0xe004('0x40')]=_[_0xe004('0x39')](_0x4b33ca['model'],_0x4b33ca['query']);_0x481eb0['attributes']=_[_0xe004('0x39')](_0x4b33ca[_0xe004('0x36')],qs[_0xe004('0x4a')](_0x527ac9[_0xe004('0x37')][_0xe004('0x4a')]));_0x481eb0[_0xe004('0x3a')]=_0x481eb0[_0xe004('0x3a')][_0xe004('0x3b')]?_0x481eb0[_0xe004('0x3a')]:_0x4b33ca['model'];_0x481eb0[_0xe004('0x25')]=qs[_0xe004('0x25')](_0x527ac9[_0xe004('0x37')]['limit']);_0x481eb0['offset']=qs[_0xe004('0x22')](_0x527ac9[_0xe004('0x37')]['offset']);_0x481eb0[_0xe004('0x73')]=qs[_0xe004('0x3e')](_0x527ac9[_0xe004('0x37')][_0xe004('0x3e')]);_0x481eb0['where']=qs['filters'](_[_0xe004('0x41')](_0x527ac9['query'],_0x4b33ca['filters']));_0x481eb0=_[_0xe004('0x43')]({},_0x481eb0,_0x527ac9['options']);return _0x337285['get'+_[_0xe004('0x74')](_0x527ac9['query']['channel']['toLowerCase']())+_0xe004('0x75')](_0x481eb0);})[_0xe004('0x2c')](respondWithResult(_0xff739,null))[_0xe004('0x48')](handleError(_0xff739,null));};exports['addQueues']=function(_0x4ac750,_0x207f4c,_0x19ed21){return db[_0xe004('0x31')][_0xe004('0x76')]({'where':{'id':_0x4ac750[_0xe004('0x49')]['id']}})[_0xe004('0x2c')](function(_0x5418ae){if(_0x5418ae){if(!_0x4ac750[_0xe004('0x4e')][_0xe004('0x6f')]||!utils['isValidChannel'](_0x4ac750[_0xe004('0x4e')][_0xe004('0x6f')])){throw new db[(_0xe004('0x60'))][(_0xe004('0x77'))](_0xe004('0x70'));}return _0x5418ae[_0xe004('0x78')+_[_0xe004('0x74')](_0x4ac750[_0xe004('0x4e')][_0xe004('0x6f')][_0xe004('0x71')]())+_0xe004('0x75')](_0x4ac750[_0xe004('0x4e')][_0xe004('0x79')]);}return null;})[_0xe004('0x2c')](handleEntityNotFound(_0x207f4c,null))[_0xe004('0x2c')](respondWithStatusCode(_0x207f4c,null))['catch'](handleError(_0x207f4c,null));};exports['removeQueues']=function(_0x488eb9,_0x240ef2,_0x38ad18){return db[_0xe004('0x31')][_0xe004('0x76')]({'where':{'id':_0x488eb9[_0xe004('0x49')]['id']}})[_0xe004('0x2c')](function(_0x56f0ff){if(_0x56f0ff){if(!_0x488eb9[_0xe004('0x37')]['channel']||!utils[_0xe004('0x7a')](_0x488eb9[_0xe004('0x37')][_0xe004('0x6f')])){throw new db[(_0xe004('0x60'))][(_0xe004('0x77'))](_0xe004('0x70'));}return _0x56f0ff[_0xe004('0x7b')+_[_0xe004('0x74')](_0x488eb9['query']['channel'][_0xe004('0x71')]())+_0xe004('0x75')](_0x488eb9[_0xe004('0x37')][_0xe004('0x79')]);}return null;})['then'](handleEntityNotFound(_0x240ef2,null))[_0xe004('0x2c')](respondWithStatusCode(_0x240ef2,null))[_0xe004('0x48')](handleError(_0x240ef2,null));};exports['addAgents']=function(_0x43d2f2,_0x27e098){var _0x10a72e=_[_0xe004('0x7c')](_0x43d2f2['body'][_0xe004('0x79')])?_0x43d2f2[_0xe004('0x4e')][_0xe004('0x79')]:[_0x43d2f2[_0xe004('0x4e')][_0xe004('0x79')]];var _0x5e6c3a=_0x43d2f2[_0xe004('0x49')]['id'];return db[_0xe004('0x31')][_0xe004('0x4c')]({'where':{'id':_0x5e6c3a}})[_0xe004('0x2c')](handleEntityNotFound(_0x27e098,null))[_0xe004('0x2c')](function(_0x22268e){if(_0x22268e){var _0x5821fa=[_0xe004('0x7d'),_0xe004('0x7e'),_0xe004('0x7f'),_0xe004('0x80'),'Fax',_0xe004('0x81'),'Whatsapp'];return db[_0xe004('0x57')][_0xe004('0x58')](function(_0x36c68c){var _0x30d35e=_[_0xe004('0x30')](_0x5821fa,function(_0x3cf265){var _0x1710b3={'attributes':['id','name']};if(_0x3cf265===_0xe004('0x7d')){_0x1710b3[_0xe004('0x82')]={'attributes':['penalty']};}return _0x22268e[_0xe004('0x4f')+_0x3cf265+_0xe004('0x75')](_0x1710b3)[_0xe004('0x2c')](function(_0x596994){var _0x4ab975=_[_0xe004('0x30')](_0x596994,function(_0x2016c9){var _0x4b1d4a=_[_0xe004('0x30')](_0x10a72e,function(_0x193c1c){var _0x5c7bdf={'where':{'UserId':_0x193c1c,[_0x3cf265+'QueueId']:_0x2016c9['id']},'transaction':_0x36c68c};if(_0x3cf265===_0xe004('0x7d')){_0x5c7bdf[_0xe004('0x1b')]={'penalty':_0x2016c9['TeamVoiceQueue'][_0xe004('0x83')]};}return db[_0xe004('0x84')+_0x3cf265+_0xe004('0x72')][_0xe004('0x85')](_0x5c7bdf)[_0xe004('0x2c')](function(){socket[_0xe004('0x86')](_0xe004('0x87')+_0x3cf265+_0xe004('0x88'),{'UserId':_0x193c1c,[_0x3cf265+_0xe004('0x89')]:_0x2016c9['id']});if(_0x3cf265!=='Voice'){return;}return db['User']['findAll']({'where':{'id':_0x10a72e,'online':0x1},'attributes':['id',_0xe004('0x2e'),'online',_0xe004('0x8a'),_0xe004('0x8b')],'raw':!![]})[_0xe004('0x2c')](function(_0x645c6f){var _0x52802b=_[_0xe004('0x30')](_0x645c6f,function(_0x5c22e2){return db['UserVoiceQueueRt'][_0xe004('0x8c')]({'membername':_0x5c22e2['name'],'UserId':_0x5c22e2['id'],'queue_name':_0x2016c9[_0xe004('0x2e')],'VoiceQueueId':_0x2016c9['id'],'interface':_['isNil'](_0x5c22e2[_0xe004('0x8b')])?util['format'](_0xe004('0x8d'),_0x5c22e2[_0xe004('0x2e')]):_0x5c22e2[_0xe004('0x8b')],'paused':_0x5c22e2[_0xe004('0x8a')]||![],'penalty':_0x2016c9[_0xe004('0x8e')]['penalty']},{'transaction':_0x36c68c});});return Promise[_0xe004('0x8f')](_0x52802b);});});});return Promise['all'](_0x4b1d4a);});return Promise[_0xe004('0x8f')](_0x4ab975);})[_0xe004('0x2c')](function(){return db[_0xe004('0x90')]['findOne']({'where':{'teamId':_0x5e6c3a}})['then'](function(_0x262846){if(_0x262846){var _0x15ef25=_['map'](_0x10a72e,function(_0x3957ba){db[_0xe004('0x6c')][_0xe004('0x8c')]({'UserId':_0x3957ba,'VoicePrefixId':_0x262846['VoicePrefixId']});});return Promise[_0xe004('0x8f')](_0x15ef25);}});});});return Promise[_0xe004('0x8f')](_0x30d35e)[_0xe004('0x2c')](function(){return _0x22268e['addAgents'](_0x10a72e,{'transaction':_0x36c68c})['spread'](function(_0x2ce26d){return _0x2ce26d;});});});}})[_0xe004('0x2c')](respondWithResult(_0x27e098,null))[_0xe004('0x48')](handleError(_0x27e098,null));};exports['removeAgents']=function(_0x48ba3e,_0x241c23){var _0x2caac2=_[_0xe004('0x7c')](_0x48ba3e[_0xe004('0x37')][_0xe004('0x79')])?_0x48ba3e[_0xe004('0x37')][_0xe004('0x79')]:[_0x48ba3e['query']['ids']];var _0x13cf99=_0x48ba3e[_0xe004('0x49')]['id'];return db[_0xe004('0x31')][_0xe004('0x4c')]({'where':{'id':_0x13cf99}})[_0xe004('0x2c')](handleEntityNotFound(_0x241c23,null))[_0xe004('0x2c')](function(_0x1c333b){if(_0x1c333b){var _0x55e439=[_0xe004('0x7d'),'Chat',_0xe004('0x7f'),_0xe004('0x80'),_0xe004('0x91'),'Openchannel',_0xe004('0x92')];return db[_0xe004('0x57')]['transaction'](function(_0x2fc113){var _0x103c73=_[_0xe004('0x30')](_0x55e439,function(_0x1a1e94){var _0x49d178={'attributes':['id',_0xe004('0x2e')]};return _0x1c333b[_0xe004('0x4f')+_0x1a1e94+_0xe004('0x75')](_0x49d178)[_0xe004('0x2c')](function(_0x5bf5a1){var _0x5a966c=_[_0xe004('0x30')](_0x5bf5a1,function(_0x3c23ae){return _0x3c23ae[_0xe004('0x93')](_0x2caac2,{'transaction':_0x2fc113})[_0xe004('0x2c')](function(){var _0x24417d=_[_0xe004('0x30')](_0x2caac2,function(_0x189f85){socket['emit'](_0xe004('0x87')+_0x1a1e94+_0xe004('0x94'),{'UserId':Number(_0x189f85),[_0x1a1e94+_0xe004('0x89')]:_0x3c23ae['id']});if(_0x1a1e94!==_0xe004('0x7d')){return;}return db[_0xe004('0x95')][_0xe004('0x5e')]({'where':{'VoiceQueueId':_0x3c23ae['id'],'UserId':_0x189f85},'transaction':_0x2fc113});});return Promise[_0xe004('0x8f')](_0x24417d);});});return Promise['all'](_0x5a966c);});});return Promise[_0xe004('0x8f')](_0x103c73)[_0xe004('0x2c')](function(){return _0x1c333b[_0xe004('0x93')](_0x2caac2,{'transaction':_0x2fc113});})[_0xe004('0x2c')](function(){return db['TeamVoicePrefix'][_0xe004('0x76')]({'where':{'teamId':_0x13cf99}})['then'](function(_0xb437e){if(_0xb437e){var _0x392a72=_[_0xe004('0x30')](_0x2caac2,function(_0x2d41cb){db[_0xe004('0x6c')][_0xe004('0x5e')]({'where':{'UserId':_0x2d41cb,'VoicePrefixId':_0xb437e[_0xe004('0x96')]}});});return Promise[_0xe004('0x8f')](_0x392a72);}});});});}})['then'](respondWithStatusCode(_0x241c23,null))[_0xe004('0x48')](handleError(_0x241c23,null));};exports['getAgents']=function(_0xb87ecf,_0x476a1c,_0x2427f4){var _0x27960e={};var _0x140798={};var _0x6613d6;var _0x566e6f;return db[_0xe004('0x31')][_0xe004('0x76')]({'where':{'id':_0xb87ecf[_0xe004('0x49')]['id']}})[_0xe004('0x2c')](handleEntityNotFound(_0x476a1c,null))[_0xe004('0x2c')](function(_0xc77dc0){if(_0xc77dc0){_0x6613d6=_0xc77dc0;_0x140798[_0xe004('0x36')]=_[_0xe004('0x38')](db[_0xe004('0x84')][_0xe004('0x32')]);_0x140798['query']=_[_0xe004('0x38')](_0xb87ecf[_0xe004('0x37')]);_0x140798['filters']=_[_0xe004('0x39')](_0x140798['model'],_0x140798['query']);_0x27960e[_0xe004('0x3a')]=_['intersection'](_0x140798[_0xe004('0x36')],qs[_0xe004('0x4a')](_0xb87ecf[_0xe004('0x37')][_0xe004('0x4a')]));_0x27960e[_0xe004('0x3a')]=_0x27960e[_0xe004('0x3a')]['length']?_0x27960e[_0xe004('0x3a')]:_0x140798[_0xe004('0x36')];_0x27960e[_0xe004('0x73')]=qs[_0xe004('0x3e')](_0xb87ecf[_0xe004('0x37')][_0xe004('0x3e')]);_0x27960e[_0xe004('0x3f')]=qs['filters'](_['pick'](_0xb87ecf[_0xe004('0x37')],_0x140798[_0xe004('0x40')]));if(_0xb87ecf['query']['filter']){_0x27960e[_0xe004('0x3f')]=_[_0xe004('0x43')](_0x27960e['where'],{'$or':_[_0xe004('0x30')](_0x27960e[_0xe004('0x3a')],function(_0x2fc4f2){var _0x4377f4={};_0x4377f4[_0x2fc4f2]={'$like':'%'+_0xb87ecf[_0xe004('0x37')][_0xe004('0x42')]+'%'};return _0x4377f4;})});}_0x27960e=_[_0xe004('0x43')]({},_0x27960e,_0xb87ecf[_0xe004('0x45')]);return _0x6613d6[_0xe004('0x97')](_0x27960e);}})[_0xe004('0x2c')](function(_0x159729){if(_0x159729){_0x566e6f=_0x159729[_0xe004('0x3b')];if(!_0xb87ecf[_0xe004('0x37')][_0xe004('0x3c')](_0xe004('0x3d'))){_0x27960e[_0xe004('0x25')]=qs[_0xe004('0x25')](_0xb87ecf['query'][_0xe004('0x25')]);_0x27960e[_0xe004('0x22')]=qs[_0xe004('0x22')](_0xb87ecf['query']['offset']);}return _0x6613d6['getAgents'](_0x27960e);}})[_0xe004('0x2c')](function(_0x578068){if(_0x578068){return _0x578068?{'count':_0x566e6f,'rows':_0x578068}:null;}})[_0xe004('0x2c')](respondWithResult(_0x476a1c,null))[_0xe004('0x48')](handleError(_0x476a1c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f8c2719..83e6275 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 _0x93b4=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x533b95,_0x20351a){var _0xc5bf07=function(_0x5cd8f2){while(--_0x5cd8f2){_0x533b95['push'](_0x533b95['shift']());}};_0xc5bf07(++_0x20351a);}(_0x93b4,0x9e));var _0x493b=function(_0x22839f,_0xf73eef){_0x22839f=_0x22839f-0x0;var _0x120a46=_0x93b4[_0x22839f];return _0x120a46;};'use strict';var EventEmitter=require(_0x493b('0x0'));var Team=require(_0x493b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x493b('0x2')](0x0);var events={'afterCreate':_0x493b('0x3'),'afterUpdate':_0x493b('0x4'),'afterDestroy':_0x493b('0x5')};function emitEvent(_0x243c62){return function(_0x11a0eb,_0x222e4f,_0x572c18){TeamEvents[_0x493b('0x6')](_0x243c62+':'+_0x11a0eb['id'],_0x11a0eb);TeamEvents[_0x493b('0x6')](_0x243c62,_0x11a0eb);_0x572c18(null);};}for(var e in events){if(events[_0x493b('0x7')](e)){var event=events[e];Team[_0x493b('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x34d2=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4abe2d,_0x1a5460){var _0x5ce871=function(_0x460a4c){while(--_0x460a4c){_0x4abe2d['push'](_0x4abe2d['shift']());}};_0x5ce871(++_0x1a5460);}(_0x34d2,0x16d));var _0x234d=function(_0x481ee4,_0x4f2aa3){_0x481ee4=_0x481ee4-0x0;var _0x442628=_0x34d2[_0x481ee4];return _0x442628;};'use strict';var EventEmitter=require(_0x234d('0x0'));var Team=require(_0x234d('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x234d('0x2')](0x0);var events={'afterCreate':_0x234d('0x3'),'afterUpdate':_0x234d('0x4'),'afterDestroy':_0x234d('0x5')};function emitEvent(_0x2e24f9){return function(_0x3970ef,_0x446105,_0x8870e1){TeamEvents['emit'](_0x2e24f9+':'+_0x3970ef['id'],_0x3970ef);TeamEvents[_0x234d('0x6')](_0x2e24f9,_0x3970ef);_0x8870e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x234d('0x7')](e,emitEvent(event));}}module[_0x234d('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 68aec5f..5a553f8 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 _0x40d6=['lodash','./team.attributes','get','Queues','map','setDataValue','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40d6,0xf7));var _0x640d=function(_0x2b085a,_0x139172){_0x2b085a=_0x2b085a-0x0;var _0x1c4067=_0x40d6[_0x2b085a];return _0x1c4067;};'use strict';var _=require(_0x640d('0x0'));var attributes=require(_0x640d('0x1'));function getQueuesByChannel(_0x43ea7e,_0x1fc661){var _0x409a6d=_0x640d('0x2')+_0x1fc661+_0x640d('0x3');return _0x43ea7e[_0x409a6d]()['then'](function(_0x40d5af){return _[_0x640d('0x4')](_0x40d5af,function(_0x18be06){_0x18be06[_0x640d('0x5')]('channel',_0x1fc661);return _0x18be06;});})[_0x640d('0x6')](function(_0x4d3b76){throw _0x4d3b76;});}module[_0x640d('0x7')]=function(_0xc16c70){return _0xc16c70[_0x640d('0x8')](_0x640d('0x9'),attributes,{'tableName':_0x640d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2dd9aa=this;var _0x4c5c75=['Chat',_0x640d('0xb'),_0x640d('0xc'),_0x640d('0xd'),_0x640d('0xe'),_0x640d('0xf'),_0x640d('0x10')];return Promise[_0x640d('0x11')]()['then'](function(){var _0x376091=_[_0x640d('0x4')](_0x4c5c75,function(_0x41f6e0){return getQueuesByChannel(_0x2dd9aa,_0x41f6e0);});return Promise[_0x640d('0x12')](_0x376091);})[_0x640d('0x6')](function(_0x2d8320){throw _0x2d8320;});}}});}; \ No newline at end of file +var _0x0c22=['all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c22,0x13c));var _0x20c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0c22[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x20c2('0x0'));var attributes=require(_0x20c2('0x1'));function getQueuesByChannel(_0x1eae29,_0x36de0c){var _0x5a3207=_0x20c2('0x2')+_0x36de0c+_0x20c2('0x3');return _0x1eae29[_0x5a3207]()[_0x20c2('0x4')](function(_0x27be87){return _[_0x20c2('0x5')](_0x27be87,function(_0x2693f7){_0x2693f7[_0x20c2('0x6')](_0x20c2('0x7'),_0x36de0c);return _0x2693f7;});})[_0x20c2('0x8')](function(_0x1ba04e){throw _0x1ba04e;});}module[_0x20c2('0x9')]=function(_0x348894){return _0x348894[_0x20c2('0xa')](_0x20c2('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5cb007=this;var _0x24f1ae=[_0x20c2('0xc'),_0x20c2('0xd'),_0x20c2('0xe'),_0x20c2('0xf'),_0x20c2('0x10'),_0x20c2('0x11'),_0x20c2('0x12')];return Promise[_0x20c2('0x13')]()[_0x20c2('0x4')](function(){var _0x4762e7=_[_0x20c2('0x5')](_0x24f1ae,function(_0x58e4d8){return getQueuesByChannel(_0x5cb007,_0x58e4d8);});return Promise[_0x20c2('0x14')](_0x4762e7);})['catch'](function(_0x134df3){throw _0x134df3;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 8bd1611..55989c1 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 _0x3b64=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4ac00f,_0x356690){var _0x535bef=function(_0x496c7a){while(--_0x496c7a){_0x4ac00f['push'](_0x4ac00f['shift']());}};_0x535bef(++_0x356690);}(_0x3b64,0x71));var _0x43b6=function(_0x46af82,_0x5c6ce2){_0x46af82=_0x46af82-0x0;var _0x5e392a=_0x3b64[_0x46af82];return _0x5e392a;};'use strict';var _=require(_0x43b6('0x0'));var util=require(_0x43b6('0x1'));var moment=require(_0x43b6('0x2'));var BPromise=require(_0x43b6('0x3'));var rs=require(_0x43b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43b6('0x5'))['db'];var utils=require(_0x43b6('0x6'));var logger=require(_0x43b6('0x7'))(_0x43b6('0x8'));var config=require(_0x43b6('0x9'));var jayson=require(_0x43b6('0xa'));var client=jayson[_0x43b6('0xb')][_0x43b6('0xc')]({'port':0x232a});config[_0x43b6('0xd')]=_[_0x43b6('0xe')](config[_0x43b6('0xd')],{'host':_0x43b6('0xf'),'port':0x18eb});var socket=require(_0x43b6('0x10'))(new Redis(config[_0x43b6('0xd')]));require(_0x43b6('0x11'))['register'](socket);function respondWithRpcPromise(_0x4b5e5a,_0xfd724a,_0x4f47b6){return new BPromise(function(_0x30c122,_0x486d1d){return client['request'](_0x4b5e5a,_0x4f47b6)[_0x43b6('0x12')](function(_0x5cdbb3){logger[_0x43b6('0x13')](_0x43b6('0x14'),_0xfd724a,_0x43b6('0x15'));logger[_0x43b6('0x16')](_0x43b6('0x17'),_0xfd724a,_0x43b6('0x15'),JSON[_0x43b6('0x18')](_0x5cdbb3));if(_0x5cdbb3[_0x43b6('0x19')]){if(_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1a')]===0x1f4){logger[_0x43b6('0x19')]('Team,\x20%s,\x20%s',_0xfd724a,_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1b')]);return _0x486d1d(_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1b')]);}logger[_0x43b6('0x19')]('Team,\x20%s,\x20%s',_0xfd724a,_0x5cdbb3[_0x43b6('0x19')]['message']);return _0x30c122(_0x5cdbb3['error'][_0x43b6('0x1b')]);}else{logger[_0x43b6('0x13')]('Team,\x20%s,\x20%s',_0xfd724a,'request\x20sent');_0x30c122(_0x5cdbb3['result'][_0x43b6('0x1b')]);}})[_0x43b6('0x1c')](function(_0x15b4e9){logger['error'](_0x43b6('0x14'),_0xfd724a,_0x15b4e9);_0x486d1d(_0x15b4e9);});});} \ No newline at end of file +var _0x0a5f=['message','Team,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error'];(function(_0x5e98e1,_0x435754){var _0x34d167=function(_0x45531d){while(--_0x45531d){_0x5e98e1['push'](_0x5e98e1['shift']());}};_0x34d167(++_0x435754);}(_0x0a5f,0x155));var _0xf0a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a5f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf0a5('0x0'));var util=require(_0xf0a5('0x1'));var moment=require(_0xf0a5('0x2'));var BPromise=require(_0xf0a5('0x3'));var rs=require(_0xf0a5('0x4'));var fs=require('fs');var Redis=require(_0xf0a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0a5('0x6'))('rpc');var config=require(_0xf0a5('0x7'));var jayson=require(_0xf0a5('0x8'));var client=jayson[_0xf0a5('0x9')][_0xf0a5('0xa')]({'port':0x232a});config[_0xf0a5('0xb')]=_[_0xf0a5('0xc')](config[_0xf0a5('0xb')],{'host':_0xf0a5('0xd'),'port':0x18eb});var socket=require(_0xf0a5('0xe'))(new Redis(config['redis']));require('./team.socket')[_0xf0a5('0xf')](socket);function respondWithRpcPromise(_0x57c75b,_0x8f7a83,_0x226e99){return new BPromise(function(_0x12c606,_0xe81968){return client[_0xf0a5('0x10')](_0x57c75b,_0x226e99)[_0xf0a5('0x11')](function(_0x5978c3){logger[_0xf0a5('0x12')]('Team,\x20%s,\x20%s',_0x8f7a83,_0xf0a5('0x13'));logger[_0xf0a5('0x14')](_0xf0a5('0x15'),_0x8f7a83,_0xf0a5('0x13'),JSON['stringify'](_0x5978c3));if(_0x5978c3[_0xf0a5('0x16')]){if(_0x5978c3[_0xf0a5('0x16')]['code']===0x1f4){logger[_0xf0a5('0x16')]('Team,\x20%s,\x20%s',_0x8f7a83,_0x5978c3['error']['message']);return _0xe81968(_0x5978c3['error'][_0xf0a5('0x17')]);}logger[_0xf0a5('0x16')](_0xf0a5('0x18'),_0x8f7a83,_0x5978c3['error'][_0xf0a5('0x17')]);return _0x12c606(_0x5978c3[_0xf0a5('0x16')][_0xf0a5('0x17')]);}else{logger[_0xf0a5('0x12')]('Team,\x20%s,\x20%s',_0x8f7a83,'request\x20sent');_0x12c606(_0x5978c3['result'][_0xf0a5('0x17')]);}})[_0xf0a5('0x19')](function(_0x31fd37){logger[_0xf0a5('0x16')](_0xf0a5('0x18'),_0x8f7a83,_0x31fd37);_0xe81968(_0x31fd37);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f13e588..d0552b5 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 _0xdcf9=['team:','./team.events','save','remove','update','emit','removeListener','register'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xdcf9,0x101));var _0x9dcf=function(_0xe6c138,_0x4f69f4){_0xe6c138=_0xe6c138-0x0;var _0x3fb496=_0xdcf9[_0xe6c138];return _0x3fb496;};'use strict';var TeamEvents=require(_0x9dcf('0x0'));var events=[_0x9dcf('0x1'),_0x9dcf('0x2'),_0x9dcf('0x3')];function createListener(_0xfa66c4,_0x3d3bdd){return function(_0x1c04ad){_0x3d3bdd[_0x9dcf('0x4')](_0xfa66c4,_0x1c04ad);};}function removeListener(_0x142eda,_0x3a1aaa){return function(){TeamEvents[_0x9dcf('0x5')](_0x142eda,_0x3a1aaa);};}exports[_0x9dcf('0x6')]=function(_0x46b7bb){for(var _0x544404=0x0,_0x4c6588=events['length'];_0x544404<_0x4c6588;_0x544404++){var _0x19567a=events[_0x544404];var _0x16d36d=createListener(_0x9dcf('0x7')+_0x19567a,_0x46b7bb);TeamEvents['on'](_0x19567a,_0x16d36d);}}; \ No newline at end of file +var _0x4a83=['remove','update','emit','register','team:','save'];(function(_0x5d1d55,_0x101459){var _0x5e3c4e=function(_0x5f2b02){while(--_0x5f2b02){_0x5d1d55['push'](_0x5d1d55['shift']());}};_0x5e3c4e(++_0x101459);}(_0x4a83,0x125));var _0x34a8=function(_0x2f9eb9,_0x210440){_0x2f9eb9=_0x2f9eb9-0x0;var _0x23662f=_0x4a83[_0x2f9eb9];return _0x23662f;};'use strict';var TeamEvents=require('./team.events');var events=[_0x34a8('0x0'),_0x34a8('0x1'),_0x34a8('0x2')];function createListener(_0x46ee74,_0x59dc42){return function(_0x4c8c97){_0x59dc42[_0x34a8('0x3')](_0x46ee74,_0x4c8c97);};}function removeListener(_0xb811f8,_0xb6b7cc){return function(){TeamEvents['removeListener'](_0xb811f8,_0xb6b7cc);};}exports[_0x34a8('0x4')]=function(_0x33bc73){for(var _0xa51ac4=0x0,_0x2405a6=events['length'];_0xa51ac4<_0x2405a6;_0xa51ac4++){var _0x47b304=events[_0xa51ac4];var _0x4e4c99=createListener(_0x34a8('0x5')+_0x47b304,_0x33bc73);TeamEvents['on'](_0x47b304,_0x4e4c99);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 4b8cc31..1a73c57 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 _0x8f7d=['exports','INTEGER','sequelize'];(function(_0x51b8d7,_0x2c6d69){var _0x3cc35e=function(_0x493549){while(--_0x493549){_0x51b8d7['push'](_0x51b8d7['shift']());}};_0x3cc35e(++_0x2c6d69);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x524657,_0x424944){_0x524657=_0x524657-0x0;var _0x4c8f35=_0x8f7d[_0x524657];return _0x4c8f35;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd8f7('0x2')]}}; \ No newline at end of file +var _0x38d0=['INTEGER','exports'];(function(_0x477c0c,_0x48b400){var _0x37d540=function(_0x2d95e2){while(--_0x2d95e2){_0x477c0c['push'](_0x477c0c['shift']());}};_0x37d540(++_0x48b400);}(_0x38d0,0x123));var _0x038d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x38d0[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'TeamId':{'type':Sequelize[_0x038d('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x038d('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 681fa4e..47ee027 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 _0x0102=['api','moment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','util','../../config/logger'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x0102,0x186));var _0x2010=function(_0x173bb9,_0x144a51){_0x173bb9=_0x173bb9-0x0;var _0x370fe0=_0x0102[_0x173bb9];return _0x370fe0;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be0=['moment','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x2be0,0x128));var _0x02be=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x2be0[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x02be('0x0'));var util=require(_0x02be('0x1'));var logger=require(_0x02be('0x2'))(_0x02be('0x3'));var moment=require(_0x02be('0x4'));var BPromise=require('bluebird');var rp=require(_0x02be('0x5'));var fs=require('fs');var path=require(_0x02be('0x6'));var rimraf=require(_0x02be('0x7'));var config=require('../../config/environment');var attributes=require(_0x02be('0x8'));module[_0x02be('0x9')]=function(_0x46392d,_0x184bf6){return _0x46392d['define'](_0x02be('0xa'),attributes,{'tableName':_0x02be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b6ea32e..050e07b 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x58322a,_0x73595b){var _0x13dc6e=function(_0xe85441){while(--_0xe85441){_0x58322a['push'](_0x58322a['shift']());}};_0x13dc6e(++_0x73595b);}(_0x70e0,0x17b));var _0x070e=function(_0x1d6fe4,_0xd042ad){_0x1d6fe4=_0x1d6fe4-0x0;var _0xa56d4a=_0x70e0[_0x1d6fe4];return _0xa56d4a;};'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 +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1ebc1e,_0x26dc8b){var _0x5ec4dc=function(_0x27a8d9){while(--_0x27a8d9){_0x1ebc1e['push'](_0x1ebc1e['shift']());}};_0x5ec4dc(++_0x26dc8b);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 32d294a..e9a145c 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 _0xb922=['INTEGER','sequelize','exports'];(function(_0x4d5d91,_0x3b0799){var _0x269da4=function(_0x19a42a){while(--_0x19a42a){_0x4d5d91['push'](_0x4d5d91['shift']());}};_0x269da4(++_0x3b0799);}(_0xb922,0x7c));var _0x2b92=function(_0x5950e7,_0x43a5bb){_0x5950e7=_0x5950e7-0x0;var _0x47494d=_0xb922[_0x5950e7];return _0x47494d;};'use strict';var Sequelize=require(_0x2b92('0x0'));module[_0x2b92('0x1')]={'penalty':{'type':Sequelize[_0x2b92('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d4d=['sequelize','INTEGER'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x6d4d,0x86));var _0xd6d4=function(_0x25cde9,_0x37919d){_0x25cde9=_0x25cde9-0x0;var _0x5a4b6a=_0x6d4d[_0x25cde9];return _0x5a4b6a;};'use strict';var Sequelize=require(_0xd6d4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd6d4('0x1')],'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 a488491..8bdc63b 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 _0xc73e=['exports','define','team_has_voice_queues','lodash','util','api','moment','rimraf','../../config/environment'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xc73e,0x1e9));var _0xec73=function(_0x50f6f1,_0x3536f6){_0x50f6f1=_0x50f6f1-0x0;var _0x46bb98=_0xc73e[_0x50f6f1];return _0x46bb98;};'use strict';var _=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var logger=require('../../config/logger')(_0xec73('0x2'));var moment=require(_0xec73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec73('0x4'));var config=require(_0xec73('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0xec73('0x6')]=function(_0x26598a,_0x3bd154){return _0x26598a[_0xec73('0x7')]('TeamVoiceQueue',attributes,{'tableName':_0xec73('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc964=['../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','util','api','moment','bluebird','path'];(function(_0x5ebacb,_0x375ce9){var _0xe0fb8e=function(_0x30abb0){while(--_0x30abb0){_0x5ebacb['push'](_0x5ebacb['shift']());}};_0xe0fb8e(++_0x375ce9);}(_0xc964,0x7e));var _0x4c96=function(_0x47587a,_0x736f9c){_0x47587a=_0x47587a-0x0;var _0x37a0be=_0xc964[_0x47587a];return _0x37a0be;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var logger=require('../../config/logger')(_0x4c96('0x2'));var moment=require(_0x4c96('0x3'));var BPromise=require(_0x4c96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c96('0x5'));var rimraf=require('rimraf');var config=require(_0x4c96('0x6'));var attributes=require(_0x4c96('0x7'));module[_0x4c96('0x8')]=function(_0x2f6461,_0x45bb27){return _0x2f6461[_0x4c96('0x9')](_0x4c96('0xa'),attributes,{'tableName':'team_has_voice_queues','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 d75689a..392c07f 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 _0x876c=['then','request\x20sent','debug','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47c838,_0x1d79ec){var _0x3279ad=function(_0x4867db){while(--_0x4867db){_0x47c838['push'](_0x47c838['shift']());}};_0x3279ad(++_0x1d79ec);}(_0x876c,0x12f));var _0xc876=function(_0x41fe2d,_0x1d758c){_0x41fe2d=_0x41fe2d-0x0;var _0x1c3b86=_0x876c[_0x41fe2d];return _0x1c3b86;};'use strict';var _=require(_0xc876('0x0'));var util=require(_0xc876('0x1'));var moment=require(_0xc876('0x2'));var BPromise=require(_0xc876('0x3'));var rs=require(_0xc876('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc876('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc876('0x6'))(_0xc876('0x7'));var config=require(_0xc876('0x8'));var jayson=require(_0xc876('0x9'));var client=jayson[_0xc876('0xa')][_0xc876('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x195e3e,_0x3f6d9e,_0x2b3e09){return new BPromise(function(_0x5c0c6a,_0x5a823b){return client['request'](_0x195e3e,_0x2b3e09)[_0xc876('0xc')](function(_0x2a65cc){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3f6d9e,_0xc876('0xd'));logger[_0xc876('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3f6d9e,_0xc876('0xd'),JSON[_0xc876('0xf')](_0x2a65cc));if(_0x2a65cc[_0xc876('0x10')]){if(_0x2a65cc['error']['code']===0x1f4){logger[_0xc876('0x10')](_0xc876('0x11'),_0x3f6d9e,_0x2a65cc['error']['message']);return _0x5a823b(_0x2a65cc[_0xc876('0x10')][_0xc876('0x12')]);}logger['error'](_0xc876('0x11'),_0x3f6d9e,_0x2a65cc['error'][_0xc876('0x12')]);return _0x5c0c6a(_0x2a65cc[_0xc876('0x10')][_0xc876('0x12')]);}else{logger['info'](_0xc876('0x11'),_0x3f6d9e,_0xc876('0xd'));_0x5c0c6a(_0x2a65cc[_0xc876('0x13')][_0xc876('0x12')]);}})[_0xc876('0x14')](function(_0x51e40f){logger['error'](_0xc876('0x11'),_0x3f6d9e,_0x51e40f);_0x5a823b(_0x51e40f);});});} \ No newline at end of file +var _0x406e=['code','message','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d2d16,_0x1af613){var _0x4d2180=function(_0x12c0f6){while(--_0x12c0f6){_0x4d2d16['push'](_0x4d2d16['shift']());}};_0x4d2180(++_0x1af613);}(_0x406e,0x16b));var _0xe406=function(_0x20cdd2,_0x24da9b){_0x20cdd2=_0x20cdd2-0x0;var _0x8bd09e=_0x406e[_0x20cdd2];return _0x8bd09e;};'use strict';var _=require(_0xe406('0x0'));var util=require('util');var moment=require(_0xe406('0x1'));var BPromise=require('bluebird');var rs=require(_0xe406('0x2'));var fs=require('fs');var Redis=require(_0xe406('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe406('0x4'));var logger=require('../../config/logger')(_0xe406('0x5'));var config=require(_0xe406('0x6'));var jayson=require(_0xe406('0x7'));var client=jayson[_0xe406('0x8')][_0xe406('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x528f1f,_0x3c7f52,_0x106aee){return new BPromise(function(_0x3bfed3,_0x177458){return client[_0xe406('0xa')](_0x528f1f,_0x106aee)['then'](function(_0x4181bd){logger[_0xe406('0xb')](_0xe406('0xc'),_0x3c7f52,_0xe406('0xd'));logger['debug'](_0xe406('0xe'),_0x3c7f52,_0xe406('0xd'),JSON[_0xe406('0xf')](_0x4181bd));if(_0x4181bd[_0xe406('0x10')]){if(_0x4181bd[_0xe406('0x10')][_0xe406('0x11')]===0x1f4){logger[_0xe406('0x10')](_0xe406('0xc'),_0x3c7f52,_0x4181bd[_0xe406('0x10')]['message']);return _0x177458(_0x4181bd[_0xe406('0x10')][_0xe406('0x12')]);}logger[_0xe406('0x10')](_0xe406('0xc'),_0x3c7f52,_0x4181bd[_0xe406('0x10')][_0xe406('0x12')]);return _0x3bfed3(_0x4181bd[_0xe406('0x10')]['message']);}else{logger['info'](_0xe406('0xc'),_0x3c7f52,'request\x20sent');_0x3bfed3(_0x4181bd['result'][_0xe406('0x12')]);}})['catch'](function(_0x2bb3ad){logger[_0xe406('0x10')](_0xe406('0xc'),_0x3c7f52,_0x2bb3ad);_0x177458(_0x2bb3ad);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 899ea52..fa5142b 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 _0x5464=['get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x12d6cc,_0x155c63){var _0x4af7d3=function(_0x3d4c5a){while(--_0x3d4c5a){_0x12d6cc['push'](_0x12d6cc['shift']());}};_0x4af7d3(++_0x155c63);}(_0x5464,0x15d));var _0x4546=function(_0x2d294f,_0x4a142a){_0x2d294f=_0x2d294f-0x0;var _0x1dce43=_0x5464[_0x2d294f];return _0x1dce43;};'use strict';var multer=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var path=require(_0x4546('0x2'));var timeout=require('connect-timeout');var express=require(_0x4546('0x3'));var router=express['Router']();var fs_extra=require(_0x4546('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var controller=require(_0x4546('0x7'));router[_0x4546('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4546('0x9'),auth[_0x4546('0xa')](),controller[_0x4546('0xb')]);router[_0x4546('0xc')]('/',auth[_0x4546('0xa')](),controller[_0x4546('0xd')]);router[_0x4546('0xe')](_0x4546('0x9'),auth[_0x4546('0xa')](),controller['update']);router[_0x4546('0xf')](_0x4546('0x9'),auth[_0x4546('0xa')](),controller['destroy']);module[_0x4546('0x10')]=router; \ No newline at end of file +var _0x419f=['express','Router','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x581667,_0x2c6d8a){var _0xe47e58=function(_0x3baa0b){while(--_0x3baa0b){_0x581667['push'](_0x581667['shift']());}};_0xe47e58(++_0x2c6d8a);}(_0x419f,0x176));var _0xf419=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x419f[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var path=require(_0xf419('0x2'));var timeout=require(_0xf419('0x3'));var express=require(_0xf419('0x4'));var router=express[_0xf419('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf419('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf419('0x7'));var controller=require(_0xf419('0x8'));router[_0xf419('0x9')]('/',auth[_0xf419('0xa')](),controller[_0xf419('0xb')]);router[_0xf419('0x9')](_0xf419('0xc'),auth[_0xf419('0xa')](),controller[_0xf419('0xd')]);router['post']('/',auth[_0xf419('0xa')](),controller[_0xf419('0xe')]);router['put'](_0xf419('0xc'),auth[_0xf419('0xa')](),controller[_0xf419('0xf')]);router['delete'](_0xf419('0xc'),auth[_0xf419('0xa')](),controller[_0xf419('0x10')]);module[_0xf419('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 5980c63..ecd1cb1 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 _0x4310=['STRING','TEXT','sequelize','exports'];(function(_0x571eb2,_0x597ac4){var _0x59249a=function(_0x3552bd){while(--_0x3552bd){_0x571eb2['push'](_0x571eb2['shift']());}};_0x59249a(++_0x597ac4);}(_0x4310,0x112));var _0x0431=function(_0x40b66c,_0x578758){_0x40b66c=_0x40b66c-0x0;var _0x2fd22b=_0x4310[_0x40b66c];return _0x2fd22b;};'use strict';var Sequelize=require(_0x0431('0x0'));module[_0x0431('0x1')]={'name':{'type':Sequelize[_0x0431('0x2')]},'description':{'type':Sequelize[_0x0431('0x2')]},'html':{'type':Sequelize[_0x0431('0x3')]}}; \ No newline at end of file +var _0x13d0=['exports','STRING','TEXT','sequelize'];(function(_0xbb2c02,_0x35b5d2){var _0x472d52=function(_0x5e458b){while(--_0x5e458b){_0xbb2c02['push'](_0xbb2c02['shift']());}};_0x472d52(++_0x35b5d2);}(_0x13d0,0x97));var _0x013d=function(_0x2744e4,_0x2dbb98){_0x2744e4=_0x2744e4-0x0;var _0x1c5cb3=_0x13d0[_0x2744e4];return _0x1c5cb3;};'use strict';var Sequelize=require(_0x013d('0x0'));module[_0x013d('0x1')]={'name':{'type':Sequelize[_0x013d('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x013d('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a9a5271..db917be 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 _0x0133=['offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','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','sendStatus','end','status','json'];(function(_0x4ec313,_0x2b8639){var _0x57e679=function(_0x20fbef){while(--_0x20fbef){_0x4ec313['push'](_0x4ec313['shift']());}};_0x57e679(++_0x2b8639);}(_0x0133,0x1cb));var _0x3013=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0133[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x3013('0x0'));var rimraf=require(_0x3013('0x1'));var zipdir=require(_0x3013('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3013('0x3'));var BPromise=require(_0x3013('0x4'));var Mustache=require('mustache');var util=require(_0x3013('0x5'));var path=require('path');var sox=require(_0x3013('0x6'));var csv=require(_0x3013('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3013('0x8'));var _=require(_0x3013('0x9'));var squel=require(_0x3013('0xa'));var crypto=require(_0x3013('0xb'));var jsforce=require(_0x3013('0xc'));var deskjs=require(_0x3013('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3013('0xe'));var Papa=require(_0x3013('0xf'));var Redis=require(_0x3013('0x10'));var authService=require(_0x3013('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3013('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3013('0x13'))(_0x3013('0x14'));var utils=require('../../config/utils');var config=require(_0x3013('0x15'));var licenseUtil=require(_0x3013('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44236d,_0x2ea3f5){_0x2ea3f5=_0x2ea3f5||0xcc;return function(_0x594ff9){if(_0x594ff9){return _0x44236d[_0x3013('0x17')](_0x2ea3f5);}return _0x44236d['status'](_0x2ea3f5)[_0x3013('0x18')]();};}function respondWithResult(_0xac4680,_0x3d5c2d){_0x3d5c2d=_0x3d5c2d||0xc8;return function(_0x418988){if(_0x418988){return _0xac4680[_0x3013('0x19')](_0x3d5c2d)[_0x3013('0x1a')](_0x418988);}};}function respondWithFilteredResult(_0x4b6483,_0x4347dd){return function(_0x3987c9){if(_0x3987c9){var _0x596a0f=typeof _0x4347dd[_0x3013('0x1b')]===_0x3013('0x1c')&&typeof _0x4347dd[_0x3013('0x1d')]===_0x3013('0x1c');var _0x4ac4ae=_0x3987c9[_0x3013('0x1e')];var _0x5b9fac=_0x596a0f?0x0:_0x4347dd[_0x3013('0x1b')];var _0x169a06=_0x596a0f?_0x3987c9[_0x3013('0x1e')]:_0x4347dd[_0x3013('0x1b')]+_0x4347dd[_0x3013('0x1d')];var _0x18fa4b;if(_0x169a06>=_0x4ac4ae){_0x169a06=_0x4ac4ae;_0x18fa4b=0xc8;}else{_0x18fa4b=0xce;}_0x4b6483['status'](_0x18fa4b);return _0x4b6483[_0x3013('0x1f')]('Content-Range',_0x5b9fac+'-'+_0x169a06+'/'+_0x4ac4ae)['json'](_0x3987c9);}return null;};}function patchUpdates(_0x47ea3f){return function(_0xaae437){try{jsonpatch[_0x3013('0x20')](_0xaae437,_0x47ea3f,!![]);}catch(_0x156b70){return BPromise['reject'](_0x156b70);}return _0xaae437[_0x3013('0x21')]();};}function saveUpdates(_0x33423c,_0x145310){return function(_0x5c6665){if(_0x5c6665){return _0x5c6665[_0x3013('0x22')](_0x33423c)[_0x3013('0x23')](function(_0x1eb34d){return _0x1eb34d;});}return null;};}function removeEntity(_0x3b4e9c,_0x9a6b21){return function(_0x38e0ee){if(_0x38e0ee){return _0x38e0ee[_0x3013('0x24')]()[_0x3013('0x23')](function(){var _0x1fbadd=_0x38e0ee[_0x3013('0x25')]({'plain':!![]});var _0x4ca4aa=_0x3013('0x26');return db[_0x3013('0x27')][_0x3013('0x24')]({'where':{'type':_0x4ca4aa,'resourceId':_0x1fbadd['id']}})['then'](function(){return _0x38e0ee;});})[_0x3013('0x23')](function(){_0x3b4e9c[_0x3013('0x19')](0xcc)[_0x3013('0x18')]();});}};}function handleEntityNotFound(_0x54e07f,_0x314370){return function(_0x240ad4){if(!_0x240ad4){_0x54e07f[_0x3013('0x17')](0x194);}return _0x240ad4;};}function handleError(_0x4d820d,_0xf74a55){_0xf74a55=_0xf74a55||0x1f4;return function(_0x16c950){logger[_0x3013('0x28')](_0x16c950[_0x3013('0x29')]);if(_0x16c950[_0x3013('0x2a')]){delete _0x16c950[_0x3013('0x2a')];}_0x4d820d['status'](_0xf74a55)[_0x3013('0x2b')](_0x16c950);};}exports[_0x3013('0x2c')]=function(_0x5d116f,_0x37e74f){var _0x1f704d={},_0x351deb={},_0x31b5ee={'count':0x0,'rows':[]};var _0x361438=_[_0x3013('0x2d')](db[_0x3013('0x2e')]['rawAttributes'],function(_0x12e60b){return{'name':_0x12e60b['fieldName'],'type':_0x12e60b[_0x3013('0x2f')][_0x3013('0x30')]};});_0x351deb['model']=_['map'](_0x361438,_0x3013('0x2a'));_0x351deb['query']=_['keys'](_0x5d116f[_0x3013('0x31')]);_0x351deb['filters']=_[_0x3013('0x32')](_0x351deb['model'],_0x351deb[_0x3013('0x31')]);_0x1f704d['attributes']=_[_0x3013('0x32')](_0x351deb[_0x3013('0x33')],qs[_0x3013('0x34')](_0x5d116f['query']['fields']));_0x1f704d[_0x3013('0x35')]=_0x1f704d[_0x3013('0x35')][_0x3013('0x36')]?_0x1f704d['attributes']:_0x351deb['model'];if(!_0x5d116f['query'][_0x3013('0x37')](_0x3013('0x38'))){_0x1f704d[_0x3013('0x1d')]=qs['limit'](_0x5d116f['query']['limit']);_0x1f704d[_0x3013('0x1b')]=qs[_0x3013('0x1b')](_0x5d116f[_0x3013('0x31')][_0x3013('0x1b')]);}_0x1f704d[_0x3013('0x39')]=qs[_0x3013('0x3a')](_0x5d116f['query'][_0x3013('0x3a')]);_0x1f704d[_0x3013('0x3b')]=qs[_0x3013('0x3c')](_['pick'](_0x5d116f[_0x3013('0x31')],_0x351deb[_0x3013('0x3c')]),_0x361438);if(_0x5d116f[_0x3013('0x31')][_0x3013('0x3d')]){_0x1f704d[_0x3013('0x3b')]=_[_0x3013('0x3e')](_0x1f704d[_0x3013('0x3b')],{'$or':_[_0x3013('0x2d')](_0x361438,function(_0x103968){if(_0x103968[_0x3013('0x2f')]!==_0x3013('0x3f')){var _0x49b74b={};_0x49b74b[_0x103968[_0x3013('0x2a')]]={'$like':'%'+_0x5d116f['query'][_0x3013('0x3d')]+'%'};return _0x49b74b;}})});}_0x1f704d=_['merge']({},_0x1f704d,_0x5d116f[_0x3013('0x40')]);var _0x3e29a3={'where':_0x1f704d[_0x3013('0x3b')]};return db[_0x3013('0x2e')][_0x3013('0x1e')](_0x3e29a3)[_0x3013('0x23')](function(_0x3641b4){_0x31b5ee[_0x3013('0x1e')]=_0x3641b4;if(_0x5d116f[_0x3013('0x31')][_0x3013('0x41')]){_0x1f704d[_0x3013('0x42')]=[{'all':!![]}];}return db[_0x3013('0x2e')][_0x3013('0x43')](_0x1f704d);})[_0x3013('0x23')](function(_0x500b4c){_0x31b5ee[_0x3013('0x44')]=_0x500b4c;return _0x31b5ee;})['then'](respondWithFilteredResult(_0x37e74f,_0x1f704d))[_0x3013('0x45')](handleError(_0x37e74f,null));};exports['show']=function(_0x404a0c,_0x47c483){var _0x10d98c={'raw':!![],'where':{'id':_0x404a0c[_0x3013('0x46')]['id']}},_0x374a35={};_0x374a35[_0x3013('0x33')]=_[_0x3013('0x47')](db[_0x3013('0x2e')][_0x3013('0x48')]);_0x374a35[_0x3013('0x31')]=_[_0x3013('0x47')](_0x404a0c['query']);_0x374a35[_0x3013('0x3c')]=_[_0x3013('0x32')](_0x374a35[_0x3013('0x33')],_0x374a35[_0x3013('0x31')]);_0x10d98c[_0x3013('0x35')]=_[_0x3013('0x32')](_0x374a35[_0x3013('0x33')],qs[_0x3013('0x34')](_0x404a0c[_0x3013('0x31')][_0x3013('0x34')]));_0x10d98c[_0x3013('0x35')]=_0x10d98c[_0x3013('0x35')][_0x3013('0x36')]?_0x10d98c[_0x3013('0x35')]:_0x374a35['model'];if(_0x404a0c['query'][_0x3013('0x41')]){_0x10d98c[_0x3013('0x42')]=[{'all':!![]}];}_0x10d98c=_[_0x3013('0x3e')]({},_0x10d98c,_0x404a0c[_0x3013('0x40')]);return db[_0x3013('0x2e')][_0x3013('0x49')](_0x10d98c)[_0x3013('0x23')](handleEntityNotFound(_0x47c483,null))['then'](respondWithResult(_0x47c483,null))[_0x3013('0x45')](handleError(_0x47c483,null));};exports[_0x3013('0x4a')]=function(_0x521787,_0x4801ed){return db[_0x3013('0x2e')][_0x3013('0x4a')](_0x521787[_0x3013('0x4b')],{})['then'](function(_0x4e6cb4){var _0x1104a8=_0x521787[_0x3013('0x4c')][_0x3013('0x25')]({'plain':!![]});if(!_0x1104a8)throw new Error(_0x3013('0x4d'));if(_0x1104a8[_0x3013('0x4e')]==='user'){var _0x3b06f9=_0x4e6cb4[_0x3013('0x25')]({'plain':!![]});var _0x3c4dfc=_0x3013('0x26');return db['UserProfileSection'][_0x3013('0x49')]({'where':{'name':_0x3c4dfc,'userProfileId':_0x1104a8[_0x3013('0x4f')]},'raw':!![]})[_0x3013('0x23')](function(_0x3fdfd3){if(_0x3fdfd3&&_0x3fdfd3[_0x3013('0x50')]===0x0){return db[_0x3013('0x27')][_0x3013('0x4a')]({'name':_0x3b06f9[_0x3013('0x2a')],'resourceId':_0x3b06f9['id'],'type':_0x3fdfd3[_0x3013('0x2a')],'sectionId':_0x3fdfd3['id']},{})[_0x3013('0x23')](function(){return _0x4e6cb4;});}else{return _0x4e6cb4;}})[_0x3013('0x45')](function(_0x14429e){logger[_0x3013('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14429e);throw _0x14429e;});}return _0x4e6cb4;})[_0x3013('0x23')](respondWithResult(_0x4801ed,0xc9))[_0x3013('0x45')](handleError(_0x4801ed,null));};exports[_0x3013('0x22')]=function(_0x422ea4,_0x3844b0){if(_0x422ea4[_0x3013('0x4b')]['id']){delete _0x422ea4['body']['id'];}return db['Template'][_0x3013('0x49')]({'where':{'id':_0x422ea4[_0x3013('0x46')]['id']}})[_0x3013('0x23')](handleEntityNotFound(_0x3844b0,null))[_0x3013('0x23')](saveUpdates(_0x422ea4[_0x3013('0x4b')],null))[_0x3013('0x23')](respondWithResult(_0x3844b0,null))['catch'](handleError(_0x3844b0,null));};exports[_0x3013('0x24')]=function(_0x1e0156,_0x304d65){return db['Template'][_0x3013('0x49')]({'where':{'id':_0x1e0156['params']['id']}})[_0x3013('0x23')](handleEntityNotFound(_0x304d65,null))[_0x3013('0x23')](removeEntity(_0x304d65,null))['catch'](handleError(_0x304d65,null));}; \ No newline at end of file +var _0x443c=['reject','save','update','then','get','Templates','sendStatus','error','stack','name','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply'];(function(_0x1251b6,_0x1246e7){var _0x309627=function(_0x44c098){while(--_0x44c098){_0x1251b6['push'](_0x1251b6['shift']());}};_0x309627(++_0x1246e7);}(_0x443c,0x89));var _0xc443=function(_0x5a5d55,_0x1bef36){_0x5a5d55=_0x5a5d55-0x0;var _0x35e31e=_0x443c[_0x5a5d55];return _0x35e31e;};'use strict';var emlformat=require(_0xc443('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc443('0x1'));var moment=require(_0xc443('0x2'));var BPromise=require(_0xc443('0x3'));var Mustache=require(_0xc443('0x4'));var util=require(_0xc443('0x5'));var path=require(_0xc443('0x6'));var sox=require(_0xc443('0x7'));var csv=require(_0xc443('0x8'));var ejs=require(_0xc443('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc443('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc443('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc443('0xc'));var Papa=require('papaparse');var Redis=require(_0xc443('0xd'));var authService=require(_0xc443('0xe'));var qs=require(_0xc443('0xf'));var as=require(_0xc443('0x10'));var hardwareService=require(_0xc443('0x11'));var logger=require(_0xc443('0x12'))(_0xc443('0x13'));var utils=require(_0xc443('0x14'));var config=require(_0xc443('0x15'));var licenseUtil=require(_0xc443('0x16'));var db=require(_0xc443('0x17'))['db'];function respondWithStatusCode(_0x9bd1ca,_0x12e736){_0x12e736=_0x12e736||0xcc;return function(_0x21b80b){if(_0x21b80b){return _0x9bd1ca['sendStatus'](_0x12e736);}return _0x9bd1ca[_0xc443('0x18')](_0x12e736)[_0xc443('0x19')]();};}function respondWithResult(_0x9c3b5f,_0x4ef8ea){_0x4ef8ea=_0x4ef8ea||0xc8;return function(_0x5efceb){if(_0x5efceb){return _0x9c3b5f['status'](_0x4ef8ea)[_0xc443('0x1a')](_0x5efceb);}};}function respondWithFilteredResult(_0x1c7724,_0x3ed40d){return function(_0x337c12){if(_0x337c12){var _0x4e0e2c=typeof _0x3ed40d['offset']==='undefined'&&typeof _0x3ed40d['limit']===_0xc443('0x1b');var _0x416f39=_0x337c12[_0xc443('0x1c')];var _0x4057c8=_0x4e0e2c?0x0:_0x3ed40d[_0xc443('0x1d')];var _0x2ad445=_0x4e0e2c?_0x337c12[_0xc443('0x1c')]:_0x3ed40d[_0xc443('0x1d')]+_0x3ed40d['limit'];var _0x43dcb3;if(_0x2ad445>=_0x416f39){_0x2ad445=_0x416f39;_0x43dcb3=0xc8;}else{_0x43dcb3=0xce;}_0x1c7724[_0xc443('0x18')](_0x43dcb3);return _0x1c7724[_0xc443('0x1e')](_0xc443('0x1f'),_0x4057c8+'-'+_0x2ad445+'/'+_0x416f39)['json'](_0x337c12);}return null;};}function patchUpdates(_0x3605e9){return function(_0x526274){try{jsonpatch[_0xc443('0x20')](_0x526274,_0x3605e9,!![]);}catch(_0x5e17a1){return BPromise[_0xc443('0x21')](_0x5e17a1);}return _0x526274[_0xc443('0x22')]();};}function saveUpdates(_0x42b89a,_0x2b732a){return function(_0x1d1c0d){if(_0x1d1c0d){return _0x1d1c0d[_0xc443('0x23')](_0x42b89a)[_0xc443('0x24')](function(_0x4e1062){return _0x4e1062;});}return null;};}function removeEntity(_0x3b5c08,_0x2e00cc){return function(_0x224917){if(_0x224917){return _0x224917['destroy']()[_0xc443('0x24')](function(){var _0x5b7180=_0x224917[_0xc443('0x25')]({'plain':!![]});var _0x385b57=_0xc443('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x385b57,'resourceId':_0x5b7180['id']}})['then'](function(){return _0x224917;});})[_0xc443('0x24')](function(){_0x3b5c08[_0xc443('0x18')](0xcc)[_0xc443('0x19')]();});}};}function handleEntityNotFound(_0x3b5ec6,_0x31d488){return function(_0x5e02d){if(!_0x5e02d){_0x3b5ec6[_0xc443('0x27')](0x194);}return _0x5e02d;};}function handleError(_0x5aa1e1,_0x588ef0){_0x588ef0=_0x588ef0||0x1f4;return function(_0x3a3247){logger[_0xc443('0x28')](_0x3a3247[_0xc443('0x29')]);if(_0x3a3247[_0xc443('0x2a')]){delete _0x3a3247[_0xc443('0x2a')];}_0x5aa1e1[_0xc443('0x18')](_0x588ef0)['send'](_0x3a3247);};}exports['index']=function(_0x2f059c,_0x53b6f1){var _0x250b37={},_0xcd3cc5={},_0x1fe5c0={'count':0x0,'rows':[]};var _0x5611a9=_[_0xc443('0x2b')](db[_0xc443('0x2c')][_0xc443('0x2d')],function(_0x2242b8){return{'name':_0x2242b8[_0xc443('0x2e')],'type':_0x2242b8['type'][_0xc443('0x2f')]};});_0xcd3cc5[_0xc443('0x30')]=_[_0xc443('0x2b')](_0x5611a9,'name');_0xcd3cc5[_0xc443('0x31')]=_[_0xc443('0x32')](_0x2f059c[_0xc443('0x31')]);_0xcd3cc5[_0xc443('0x33')]=_['intersection'](_0xcd3cc5[_0xc443('0x30')],_0xcd3cc5['query']);_0x250b37[_0xc443('0x34')]=_[_0xc443('0x35')](_0xcd3cc5[_0xc443('0x30')],qs[_0xc443('0x36')](_0x2f059c[_0xc443('0x31')][_0xc443('0x36')]));_0x250b37[_0xc443('0x34')]=_0x250b37[_0xc443('0x34')][_0xc443('0x37')]?_0x250b37['attributes']:_0xcd3cc5[_0xc443('0x30')];if(!_0x2f059c['query'][_0xc443('0x38')]('nolimit')){_0x250b37[_0xc443('0x39')]=qs['limit'](_0x2f059c[_0xc443('0x31')][_0xc443('0x39')]);_0x250b37[_0xc443('0x1d')]=qs[_0xc443('0x1d')](_0x2f059c[_0xc443('0x31')][_0xc443('0x1d')]);}_0x250b37[_0xc443('0x3a')]=qs[_0xc443('0x3b')](_0x2f059c[_0xc443('0x31')][_0xc443('0x3b')]);_0x250b37[_0xc443('0x3c')]=qs[_0xc443('0x33')](_[_0xc443('0x3d')](_0x2f059c[_0xc443('0x31')],_0xcd3cc5[_0xc443('0x33')]),_0x5611a9);if(_0x2f059c[_0xc443('0x31')][_0xc443('0x3e')]){_0x250b37[_0xc443('0x3c')]=_[_0xc443('0x3f')](_0x250b37['where'],{'$or':_[_0xc443('0x2b')](_0x5611a9,function(_0x2bcd31){if(_0x2bcd31[_0xc443('0x40')]!==_0xc443('0x41')){var _0x350b50={};_0x350b50[_0x2bcd31['name']]={'$like':'%'+_0x2f059c[_0xc443('0x31')][_0xc443('0x3e')]+'%'};return _0x350b50;}})});}_0x250b37=_[_0xc443('0x3f')]({},_0x250b37,_0x2f059c['options']);var _0x5c28ef={'where':_0x250b37[_0xc443('0x3c')]};return db[_0xc443('0x2c')][_0xc443('0x1c')](_0x5c28ef)[_0xc443('0x24')](function(_0x29f9dc){_0x1fe5c0[_0xc443('0x1c')]=_0x29f9dc;if(_0x2f059c[_0xc443('0x31')][_0xc443('0x42')]){_0x250b37['include']=[{'all':!![]}];}return db[_0xc443('0x2c')][_0xc443('0x43')](_0x250b37);})[_0xc443('0x24')](function(_0x9a1cb9){_0x1fe5c0[_0xc443('0x44')]=_0x9a1cb9;return _0x1fe5c0;})[_0xc443('0x24')](respondWithFilteredResult(_0x53b6f1,_0x250b37))['catch'](handleError(_0x53b6f1,null));};exports[_0xc443('0x45')]=function(_0xad3f80,_0x35294a){var _0x3255e0={'raw':!![],'where':{'id':_0xad3f80['params']['id']}},_0x4e9687={};_0x4e9687[_0xc443('0x30')]=_[_0xc443('0x32')](db[_0xc443('0x2c')][_0xc443('0x2d')]);_0x4e9687[_0xc443('0x31')]=_['keys'](_0xad3f80[_0xc443('0x31')]);_0x4e9687[_0xc443('0x33')]=_['intersection'](_0x4e9687[_0xc443('0x30')],_0x4e9687[_0xc443('0x31')]);_0x3255e0['attributes']=_[_0xc443('0x35')](_0x4e9687[_0xc443('0x30')],qs[_0xc443('0x36')](_0xad3f80[_0xc443('0x31')][_0xc443('0x36')]));_0x3255e0[_0xc443('0x34')]=_0x3255e0['attributes'][_0xc443('0x37')]?_0x3255e0[_0xc443('0x34')]:_0x4e9687[_0xc443('0x30')];if(_0xad3f80[_0xc443('0x31')][_0xc443('0x42')]){_0x3255e0[_0xc443('0x46')]=[{'all':!![]}];}_0x3255e0=_[_0xc443('0x3f')]({},_0x3255e0,_0xad3f80['options']);return db[_0xc443('0x2c')][_0xc443('0x47')](_0x3255e0)[_0xc443('0x24')](handleEntityNotFound(_0x35294a,null))[_0xc443('0x24')](respondWithResult(_0x35294a,null))[_0xc443('0x48')](handleError(_0x35294a,null));};exports[_0xc443('0x49')]=function(_0x1bf83d,_0x88e89b){return db['Template'][_0xc443('0x49')](_0x1bf83d[_0xc443('0x4a')],{})[_0xc443('0x24')](function(_0x2dc7b0){var _0x1a4c57=_0x1bf83d[_0xc443('0x4b')][_0xc443('0x25')]({'plain':!![]});if(!_0x1a4c57)throw new Error(_0xc443('0x4c'));if(_0x1a4c57[_0xc443('0x4d')]===_0xc443('0x4b')){var _0x3afbf3=_0x2dc7b0[_0xc443('0x25')]({'plain':!![]});var _0x3bf98b=_0xc443('0x26');return db[_0xc443('0x4e')]['find']({'where':{'name':_0x3bf98b,'userProfileId':_0x1a4c57[_0xc443('0x4f')]},'raw':!![]})['then'](function(_0x53d58e){if(_0x53d58e&&_0x53d58e[_0xc443('0x50')]===0x0){return db[_0xc443('0x51')][_0xc443('0x49')]({'name':_0x3afbf3[_0xc443('0x2a')],'resourceId':_0x3afbf3['id'],'type':_0x53d58e[_0xc443('0x2a')],'sectionId':_0x53d58e['id']},{})[_0xc443('0x24')](function(){return _0x2dc7b0;});}else{return _0x2dc7b0;}})[_0xc443('0x48')](function(_0xa791c8){logger['error'](_0xc443('0x52'),_0xa791c8);throw _0xa791c8;});}return _0x2dc7b0;})['then'](respondWithResult(_0x88e89b,0xc9))['catch'](handleError(_0x88e89b,null));};exports['update']=function(_0x223555,_0x269a5e){if(_0x223555['body']['id']){delete _0x223555[_0xc443('0x4a')]['id'];}return db[_0xc443('0x2c')][_0xc443('0x47')]({'where':{'id':_0x223555[_0xc443('0x53')]['id']}})[_0xc443('0x24')](handleEntityNotFound(_0x269a5e,null))[_0xc443('0x24')](saveUpdates(_0x223555['body'],null))[_0xc443('0x24')](respondWithResult(_0x269a5e,null))[_0xc443('0x48')](handleError(_0x269a5e,null));};exports[_0xc443('0x54')]=function(_0x1e5670,_0x4691fd){return db[_0xc443('0x2c')][_0xc443('0x47')]({'where':{'id':_0x1e5670[_0xc443('0x53')]['id']}})[_0xc443('0x24')](handleEntityNotFound(_0x4691fd,null))['then'](removeEntity(_0x4691fd,null))[_0xc443('0x48')](handleError(_0x4691fd,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6ab93d4..28a9863 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 _0x7580=['path','rimraf','./template.attributes','define','tools_templates','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3de3f3,_0x22704d){var _0x455541=function(_0x55878d){while(--_0x55878d){_0x3de3f3['push'](_0x3de3f3['shift']());}};_0x455541(++_0x22704d);}(_0x7580,0x94));var _0x0758=function(_0x659c20,_0x3df818){_0x659c20=_0x659c20-0x0;var _0x1bbb92=_0x7580[_0x659c20];return _0x1bbb92;};'use strict';var _=require(_0x0758('0x0'));var util=require(_0x0758('0x1'));var logger=require('../../config/logger')(_0x0758('0x2'));var moment=require(_0x0758('0x3'));var BPromise=require(_0x0758('0x4'));var rp=require(_0x0758('0x5'));var fs=require('fs');var path=require(_0x0758('0x6'));var rimraf=require(_0x0758('0x7'));var config=require('../../config/environment');var attributes=require(_0x0758('0x8'));module['exports']=function(_0x574b1c,_0x5b2e94){return _0x574b1c[_0x0758('0x9')]('Template',attributes,{'tableName':_0x0758('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49cf=['../../config/logger','api','moment','request-promise','path','rimraf','./template.attributes','tools_templates','lodash','util'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x49cf,0xd0));var _0xf49c=function(_0x653eab,_0x2b48b6){_0x653eab=_0x653eab-0x0;var _0x4e86fc=_0x49cf[_0x653eab];return _0x4e86fc;};'use strict';var _=require(_0xf49c('0x0'));var util=require(_0xf49c('0x1'));var logger=require(_0xf49c('0x2'))(_0xf49c('0x3'));var moment=require(_0xf49c('0x4'));var BPromise=require('bluebird');var rp=require(_0xf49c('0x5'));var fs=require('fs');var path=require(_0xf49c('0x6'));var rimraf=require(_0xf49c('0x7'));var config=require('../../config/environment');var attributes=require(_0xf49c('0x8'));module['exports']=function(_0x32d90d,_0x474297){return _0x32d90d['define']('Template',attributes,{'tableName':_0xf49c('0x9'),'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 9e3aaef..d2f5f92 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 _0x50fb=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x552682,_0x28007e){var _0x3ad328=function(_0x20bb66){while(--_0x20bb66){_0x552682['push'](_0x552682['shift']());}};_0x3ad328(++_0x28007e);}(_0x50fb,0x1f4));var _0xb50f=function(_0x3462de,_0x313b5b){_0x3462de=_0x3462de-0x0;var _0x51ce2f=_0x50fb[_0x3462de];return _0x51ce2f;};'use strict';var _=require(_0xb50f('0x0'));var util=require(_0xb50f('0x1'));var moment=require(_0xb50f('0x2'));var BPromise=require(_0xb50f('0x3'));var rs=require(_0xb50f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb50f('0x5'));var jayson=require(_0xb50f('0x6'));var client=jayson[_0xb50f('0x7')][_0xb50f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f43d5,_0x182cd9,_0x36fe0a){return new BPromise(function(_0x33c1d6,_0x44f575){return client[_0xb50f('0x9')](_0x5f43d5,_0x36fe0a)[_0xb50f('0xa')](function(_0x384fa4){logger[_0xb50f('0xb')](_0xb50f('0xc'),_0x182cd9,_0xb50f('0xd'));logger[_0xb50f('0xe')](_0xb50f('0xf'),_0x182cd9,'request\x20sent',JSON[_0xb50f('0x10')](_0x384fa4));if(_0x384fa4[_0xb50f('0x11')]){if(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x12')]===0x1f4){logger[_0xb50f('0x11')](_0xb50f('0xc'),_0x182cd9,_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);return _0x44f575(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);}logger['error'](_0xb50f('0xc'),_0x182cd9,_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);return _0x33c1d6(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);}else{logger['info'](_0xb50f('0xc'),_0x182cd9,'request\x20sent');_0x33c1d6(_0x384fa4[_0xb50f('0x14')][_0xb50f('0x13')]);}})[_0xb50f('0x15')](function(_0x362782){logger[_0xb50f('0x11')](_0xb50f('0xc'),_0x182cd9,_0x362782);_0x44f575(_0x362782);});});}exports[_0xb50f('0x16')]=function(_0x43d11b){var _0x3aef0b=this;return new Promise(function(_0x2f6421,_0x3c0a57){return db[_0xb50f('0x17')][_0xb50f('0x18')]({'raw':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1a')]===undefined?!![]:![]:!![],'where':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1b')]||null:null,'attributes':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1c')]||null:null,'limit':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')]['limit']||null:null,'include':_0x43d11b['options']?_0x43d11b['options'][_0xb50f('0x1d')]?_['map'](_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1d')],function(_0x1ff1f9){return{'model':db[_0x1ff1f9[_0xb50f('0x1e')]],'as':_0x1ff1f9['as'],'attributes':_0x1ff1f9[_0xb50f('0x1c')],'include':_0x1ff1f9['include']?_[_0xb50f('0x1f')](_0x1ff1f9[_0xb50f('0x1d')],function(_0xf669c7){return{'model':db[_0xf669c7[_0xb50f('0x1e')]],'as':_0xf669c7['as'],'attributes':_0xf669c7[_0xb50f('0x1c')],'include':_0xf669c7[_0xb50f('0x1d')]?_[_0xb50f('0x1f')](_0xf669c7[_0xb50f('0x1d')],function(_0x17dafc){return{'model':db[_0x17dafc['model']],'as':_0x17dafc['as'],'attributes':_0x17dafc[_0xb50f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb50f('0xa')](function(_0x439888){logger['info'](_0xb50f('0x16'),_0x43d11b);logger[_0xb50f('0xe')]('GetTemplate',_0x43d11b,JSON[_0xb50f('0x10')](_0x439888));_0x2f6421(_0x439888);})[_0xb50f('0x15')](function(_0x4d66af){logger['error'](_0xb50f('0x16'),_0x4d66af[_0xb50f('0x13')],_0x43d11b);_0x3c0a57(_0x3aef0b['error'](0x1f4,_0x4d66af[_0xb50f('0x13')]));});});}; \ No newline at end of file +var _0x0dfd=['info','result','catch','GetTemplate','Template','options','raw','where','attributes','include','model','map','then','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x184d86,_0x180b98){var _0x4f3c4e=function(_0x39ff24){while(--_0x39ff24){_0x184d86['push'](_0x184d86['shift']());}};_0x4f3c4e(++_0x180b98);}(_0x0dfd,0x6e));var _0xd0df=function(_0x1c6bc7,_0x5af521){_0x1c6bc7=_0x1c6bc7-0x0;var _0x3fb172=_0x0dfd[_0x1c6bc7];return _0x3fb172;};'use strict';var _=require(_0xd0df('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd0df('0x1'));var rs=require(_0xd0df('0x2'));var fs=require('fs');var Redis=require(_0xd0df('0x3'));var db=require(_0xd0df('0x4'))['db'];var utils=require(_0xd0df('0x5'));var logger=require('../../config/logger')(_0xd0df('0x6'));var config=require(_0xd0df('0x7'));var jayson=require(_0xd0df('0x8'));var client=jayson[_0xd0df('0x9')][_0xd0df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ff7ab,_0x17bc36,_0x544625){return new BPromise(function(_0x23cab1,_0x151a5f){return client['request'](_0x4ff7ab,_0x544625)['then'](function(_0x45bb80){logger['info'](_0xd0df('0xb'),_0x17bc36,'request\x20sent');logger['debug'](_0xd0df('0xc'),_0x17bc36,_0xd0df('0xd'),JSON[_0xd0df('0xe')](_0x45bb80));if(_0x45bb80[_0xd0df('0xf')]){if(_0x45bb80[_0xd0df('0xf')][_0xd0df('0x10')]===0x1f4){logger['error'](_0xd0df('0xb'),_0x17bc36,_0x45bb80[_0xd0df('0xf')][_0xd0df('0x11')]);return _0x151a5f(_0x45bb80[_0xd0df('0xf')][_0xd0df('0x11')]);}logger[_0xd0df('0xf')](_0xd0df('0xb'),_0x17bc36,_0x45bb80[_0xd0df('0xf')][_0xd0df('0x11')]);return _0x23cab1(_0x45bb80[_0xd0df('0xf')]['message']);}else{logger[_0xd0df('0x12')](_0xd0df('0xb'),_0x17bc36,_0xd0df('0xd'));_0x23cab1(_0x45bb80[_0xd0df('0x13')][_0xd0df('0x11')]);}})[_0xd0df('0x14')](function(_0x467a26){logger['error'](_0xd0df('0xb'),_0x17bc36,_0x467a26);_0x151a5f(_0x467a26);});});}exports[_0xd0df('0x15')]=function(_0x5f4e2d){var _0x13c9df=this;return new Promise(function(_0xb5bc54,_0x916188){return db[_0xd0df('0x16')]['findAll']({'raw':_0x5f4e2d[_0xd0df('0x17')]?_0x5f4e2d[_0xd0df('0x17')][_0xd0df('0x18')]===undefined?!![]:![]:!![],'where':_0x5f4e2d[_0xd0df('0x17')]?_0x5f4e2d[_0xd0df('0x17')][_0xd0df('0x19')]||null:null,'attributes':_0x5f4e2d[_0xd0df('0x17')]?_0x5f4e2d[_0xd0df('0x17')][_0xd0df('0x1a')]||null:null,'limit':_0x5f4e2d[_0xd0df('0x17')]?_0x5f4e2d[_0xd0df('0x17')]['limit']||null:null,'include':_0x5f4e2d[_0xd0df('0x17')]?_0x5f4e2d['options'][_0xd0df('0x1b')]?_['map'](_0x5f4e2d[_0xd0df('0x17')][_0xd0df('0x1b')],function(_0x46ab23){return{'model':db[_0x46ab23[_0xd0df('0x1c')]],'as':_0x46ab23['as'],'attributes':_0x46ab23[_0xd0df('0x1a')],'include':_0x46ab23[_0xd0df('0x1b')]?_['map'](_0x46ab23[_0xd0df('0x1b')],function(_0x55098f){return{'model':db[_0x55098f[_0xd0df('0x1c')]],'as':_0x55098f['as'],'attributes':_0x55098f[_0xd0df('0x1a')],'include':_0x55098f[_0xd0df('0x1b')]?_[_0xd0df('0x1d')](_0x55098f[_0xd0df('0x1b')],function(_0x3c759e){return{'model':db[_0x3c759e['model']],'as':_0x3c759e['as'],'attributes':_0x3c759e[_0xd0df('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd0df('0x1e')](function(_0x181f79){logger[_0xd0df('0x12')](_0xd0df('0x15'),_0x5f4e2d);logger[_0xd0df('0x1f')](_0xd0df('0x15'),_0x5f4e2d,JSON[_0xd0df('0xe')](_0x181f79));_0xb5bc54(_0x181f79);})[_0xd0df('0x14')](function(_0x5892d6){logger[_0xd0df('0xf')](_0xd0df('0x15'),_0x5892d6[_0xd0df('0x11')],_0x5f4e2d);_0x916188(_0x13c9df[_0xd0df('0xf')](0x1f4,_0x5892d6[_0xd0df('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index fcc41e8..f6d9cb7 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 _0x5d8a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','delete','multer'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x5d8a,0x16b));var _0xa5d8=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0x5d8a[_0x30bdff];return _0x1e7ca9;};'use strict';var multer=require(_0xa5d8('0x0'));var util=require(_0xa5d8('0x1'));var path=require(_0xa5d8('0x2'));var timeout=require(_0xa5d8('0x3'));var express=require(_0xa5d8('0x4'));var router=express['Router']();var fs_extra=require(_0xa5d8('0x5'));var auth=require(_0xa5d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5d8('0x7'));var controller=require(_0xa5d8('0x8'));router[_0xa5d8('0x9')]('/',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xb')]);router[_0xa5d8('0x9')](_0xa5d8('0xc'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xd')]);router[_0xa5d8('0x9')]('/:id/all_conditions',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xe')]);router[_0xa5d8('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xa5d8('0xf')]);router[_0xa5d8('0x9')](_0xa5d8('0x10'),auth['isAuthenticated'](),controller[_0xa5d8('0x11')]);router['post']('/',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x12')]);router[_0xa5d8('0x13')](_0xa5d8('0x14'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x15')]);router[_0xa5d8('0x13')](_0xa5d8('0x16'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x17')]);router[_0xa5d8('0x13')](_0xa5d8('0x10'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x18')]);router[_0xa5d8('0x19')](_0xa5d8('0xc'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x1a')]);router[_0xa5d8('0x1b')](_0xa5d8('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0db9=['addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post'];(function(_0x1ba88b,_0x279d8c){var _0x20c1ad=function(_0x2883d4){while(--_0x2883d4){_0x1ba88b['push'](_0x1ba88b['shift']());}};_0x20c1ad(++_0x279d8c);}(_0x0db9,0xa3));var _0x90db=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x0db9[_0x3a2118];return _0x1d181d;};'use strict';var multer=require(_0x90db('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90db('0x1'));var router=express[_0x90db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x90db('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x90db('0x4'));var controller=require(_0x90db('0x5'));router['get']('/',auth[_0x90db('0x6')](),controller[_0x90db('0x7')]);router[_0x90db('0x8')](_0x90db('0x9'),auth[_0x90db('0x6')](),controller[_0x90db('0xa')]);router['get'](_0x90db('0xb'),auth[_0x90db('0x6')](),controller[_0x90db('0xc')]);router[_0x90db('0x8')](_0x90db('0xd'),auth[_0x90db('0x6')](),controller[_0x90db('0xe')]);router[_0x90db('0x8')](_0x90db('0xf'),auth[_0x90db('0x6')](),controller[_0x90db('0x10')]);router['post']('/',auth[_0x90db('0x6')](),controller[_0x90db('0x11')]);router[_0x90db('0x12')](_0x90db('0xb'),auth[_0x90db('0x6')](),controller[_0x90db('0x13')]);router[_0x90db('0x12')](_0x90db('0xd'),auth[_0x90db('0x6')](),controller[_0x90db('0x14')]);router[_0x90db('0x12')](_0x90db('0xf'),auth[_0x90db('0x6')](),controller[_0x90db('0x15')]);router['put'](_0x90db('0x9'),auth['isAuthenticated'](),controller[_0x90db('0x16')]);router[_0x90db('0x17')](_0x90db('0x9'),auth[_0x90db('0x6')](),controller[_0x90db('0x18')]);module[_0x90db('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e29b30e..9a1628e 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 _0x43e7=['sequelize','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x43e7,0xda));var _0x743e=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x43e7[_0x4be8ba];return _0x1af822;};'use strict';var Sequelize=require(_0x743e('0x0'));module['exports']={'name':{'type':Sequelize[_0x743e('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3536=['BOOLEAN','exports'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x3536,0x157));var _0x6353=function(_0x2ea2b1,_0x581c43){_0x2ea2b1=_0x2ea2b1-0x0;var _0x32eff9=_0x3536[_0x2ea2b1];return _0x32eff9;};'use strict';var Sequelize=require('sequelize');module[_0x6353('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6353('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f824f0a..5e0f472 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 _0xf484=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','getActions','zip-dir','fast-json-patch','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','get','Triggers','UserProfileResource','destroy','then','sendStatus','error','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','includeAll','include','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xf484,0x18e));var _0x4f48=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf484[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f48('0x0'));var jsonpatch=require(_0x4f48('0x1'));var rp=require('request-promise');var moment=require(_0x4f48('0x2'));var BPromise=require(_0x4f48('0x3'));var Mustache=require(_0x4f48('0x4'));var util=require('util');var path=require(_0x4f48('0x5'));var sox=require(_0x4f48('0x6'));var csv=require(_0x4f48('0x7'));var ejs=require(_0x4f48('0x8'));var fs=require('fs');var fs_extra=require(_0x4f48('0x9'));var _=require('lodash');var squel=require(_0x4f48('0xa'));var crypto=require(_0x4f48('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4f48('0xc'));var toCsv=require(_0x4f48('0x7'));var querystring=require(_0x4f48('0xd'));var Papa=require(_0x4f48('0xe'));var Redis=require(_0x4f48('0xf'));var authService=require(_0x4f48('0x10'));var qs=require(_0x4f48('0x11'));var as=require(_0x4f48('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f48('0x13'));var utils=require(_0x4f48('0x14'));var config=require(_0x4f48('0x15'));var licenseUtil=require(_0x4f48('0x16'));var db=require(_0x4f48('0x17'))['db'];function respondWithStatusCode(_0x1d4e01,_0x5c41cf){_0x5c41cf=_0x5c41cf||0xcc;return function(_0x1a6f2c){if(_0x1a6f2c){return _0x1d4e01['sendStatus'](_0x5c41cf);}return _0x1d4e01[_0x4f48('0x18')](_0x5c41cf)[_0x4f48('0x19')]();};}function respondWithResult(_0x583c2a,_0x34deb8){_0x34deb8=_0x34deb8||0xc8;return function(_0x5bad58){if(_0x5bad58){return _0x583c2a['status'](_0x34deb8)['json'](_0x5bad58);}};}function respondWithFilteredResult(_0x12473d,_0x22420d){return function(_0x215f03){if(_0x215f03){var _0x231f64=typeof _0x22420d[_0x4f48('0x1a')]==='undefined'&&typeof _0x22420d[_0x4f48('0x1b')]===_0x4f48('0x1c');var _0x21e9a4=_0x215f03[_0x4f48('0x1d')];var _0x67b20=_0x231f64?0x0:_0x22420d[_0x4f48('0x1a')];var _0x2fe239=_0x231f64?_0x215f03[_0x4f48('0x1d')]:_0x22420d[_0x4f48('0x1a')]+_0x22420d[_0x4f48('0x1b')];var _0x586d1a;if(_0x2fe239>=_0x21e9a4){_0x2fe239=_0x21e9a4;_0x586d1a=0xc8;}else{_0x586d1a=0xce;}_0x12473d[_0x4f48('0x18')](_0x586d1a);return _0x12473d[_0x4f48('0x1e')](_0x4f48('0x1f'),_0x67b20+'-'+_0x2fe239+'/'+_0x21e9a4)[_0x4f48('0x20')](_0x215f03);}return null;};}function patchUpdates(_0x1ec170){return function(_0x242b85){try{jsonpatch[_0x4f48('0x21')](_0x242b85,_0x1ec170,!![]);}catch(_0x43ea48){return BPromise[_0x4f48('0x22')](_0x43ea48);}return _0x242b85[_0x4f48('0x23')]();};}function saveUpdates(_0x1c4b09,_0xdc6c65){return function(_0x12d36c){if(_0x12d36c){return _0x12d36c[_0x4f48('0x24')](_0x1c4b09)['then'](function(_0x5f3e53){return _0x5f3e53;});}return null;};}function removeEntity(_0x58985d,_0x5e33ed){return function(_0x5366ea){if(_0x5366ea){return _0x5366ea['destroy']()['then'](function(){var _0x2636a7=_0x5366ea[_0x4f48('0x25')]({'plain':!![]});var _0x58fa92=_0x4f48('0x26');return db[_0x4f48('0x27')][_0x4f48('0x28')]({'where':{'type':_0x58fa92,'resourceId':_0x2636a7['id']}})[_0x4f48('0x29')](function(){return _0x5366ea;});})[_0x4f48('0x29')](function(){_0x58985d[_0x4f48('0x18')](0xcc)[_0x4f48('0x19')]();});}};}function handleEntityNotFound(_0xf4aa85,_0x3ee0bc){return function(_0x2342e0){if(!_0x2342e0){_0xf4aa85[_0x4f48('0x2a')](0x194);}return _0x2342e0;};}function handleError(_0x419aea,_0x3ce0e3){_0x3ce0e3=_0x3ce0e3||0x1f4;return function(_0x17ec09){logger[_0x4f48('0x2b')](_0x17ec09['stack']);if(_0x17ec09['name']){delete _0x17ec09['name'];}_0x419aea[_0x4f48('0x18')](_0x3ce0e3)['send'](_0x17ec09);};}exports[_0x4f48('0x2c')]=function(_0x1c271b,_0x2fb377){var _0x4e9fcf={},_0x14e1cd={},_0x34410a={'count':0x0,'rows':[]};var _0xa92cc=_[_0x4f48('0x2d')](db['Trigger'][_0x4f48('0x2e')],function(_0x5263da){return{'name':_0x5263da[_0x4f48('0x2f')],'type':_0x5263da[_0x4f48('0x30')][_0x4f48('0x31')]};});_0x14e1cd[_0x4f48('0x32')]=_[_0x4f48('0x2d')](_0xa92cc,_0x4f48('0x33'));_0x14e1cd['query']=_[_0x4f48('0x34')](_0x1c271b[_0x4f48('0x35')]);_0x14e1cd[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x14e1cd[_0x4f48('0x32')],_0x14e1cd['query']);_0x4e9fcf[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x14e1cd['model'],qs['fields'](_0x1c271b[_0x4f48('0x35')]['fields']));_0x4e9fcf['attributes']=_0x4e9fcf[_0x4f48('0x38')][_0x4f48('0x39')]?_0x4e9fcf[_0x4f48('0x38')]:_0x14e1cd[_0x4f48('0x32')];if(!_0x1c271b[_0x4f48('0x35')][_0x4f48('0x3a')]('nolimit')){_0x4e9fcf[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x4e9fcf['offset']=qs[_0x4f48('0x1a')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x1a')]);}_0x4e9fcf[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x4e9fcf[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_[_0x4f48('0x3e')](_0x1c271b[_0x4f48('0x35')],_0x14e1cd['filters']),_0xa92cc);if(_0x1c271b['query'][_0x4f48('0x3f')]){_0x4e9fcf[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x4e9fcf[_0x4f48('0x3d')],{'$or':_['map'](_0xa92cc,function(_0x2f06e3){if(_0x2f06e3['type']!==_0x4f48('0x41')){var _0x36a0d2={};_0x36a0d2[_0x2f06e3[_0x4f48('0x33')]]={'$like':'%'+_0x1c271b['query'][_0x4f48('0x3f')]+'%'};return _0x36a0d2;}})});}_0x4e9fcf=_['merge']({},_0x4e9fcf,_0x1c271b[_0x4f48('0x42')]);var _0x898ef9={'where':_0x4e9fcf[_0x4f48('0x3d')]};return db[_0x4f48('0x43')][_0x4f48('0x1d')](_0x898ef9)[_0x4f48('0x29')](function(_0xdb1650){_0x34410a[_0x4f48('0x1d')]=_0xdb1650;if(_0x1c271b[_0x4f48('0x35')][_0x4f48('0x44')]){_0x4e9fcf[_0x4f48('0x45')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x4e9fcf);})[_0x4f48('0x29')](function(_0x22bf4e){_0x34410a[_0x4f48('0x46')]=_0x22bf4e;return _0x34410a;})[_0x4f48('0x29')](respondWithFilteredResult(_0x2fb377,_0x4e9fcf))[_0x4f48('0x47')](handleError(_0x2fb377,null));};exports[_0x4f48('0x48')]=function(_0x6aaa71,_0x295b23){var _0x4cbd28={'raw':![],'where':{'id':_0x6aaa71[_0x4f48('0x49')]['id']}},_0x42d54f={};_0x42d54f[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x43')][_0x4f48('0x2e')]);_0x42d54f[_0x4f48('0x35')]=_[_0x4f48('0x34')](_0x6aaa71[_0x4f48('0x35')]);_0x42d54f[_0x4f48('0x36')]=_['intersection'](_0x42d54f[_0x4f48('0x32')],_0x42d54f[_0x4f48('0x35')]);_0x4cbd28[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x42d54f['model'],qs[_0x4f48('0x4a')](_0x6aaa71['query']['fields']));_0x4cbd28[_0x4f48('0x38')]=_0x4cbd28['attributes'][_0x4f48('0x39')]?_0x4cbd28['attributes']:_0x42d54f[_0x4f48('0x32')];if(_0x6aaa71[_0x4f48('0x35')][_0x4f48('0x44')]){_0x4cbd28[_0x4f48('0x45')]=[{'all':!![]}];}_0x4cbd28=_[_0x4f48('0x40')]({},_0x4cbd28,_0x6aaa71[_0x4f48('0x42')]);return db[_0x4f48('0x43')][_0x4f48('0x4b')](_0x4cbd28)[_0x4f48('0x29')](handleEntityNotFound(_0x295b23,null))[_0x4f48('0x29')](respondWithResult(_0x295b23,null))[_0x4f48('0x47')](handleError(_0x295b23,null));};exports[_0x4f48('0x4c')]=function(_0x289b86,_0x223ffb){return db[_0x4f48('0x43')]['create'](_0x289b86[_0x4f48('0x4d')],{})[_0x4f48('0x29')](function(_0x4ce5aa){var _0x4dd44d=_0x289b86[_0x4f48('0x4e')][_0x4f48('0x25')]({'plain':!![]});if(!_0x4dd44d)throw new Error(_0x4f48('0x4f'));if(_0x4dd44d[_0x4f48('0x50')]===_0x4f48('0x4e')){var _0x33a25c=_0x4ce5aa['get']({'plain':!![]});var _0x2cb17f=_0x4f48('0x26');return db[_0x4f48('0x51')][_0x4f48('0x4b')]({'where':{'name':_0x2cb17f,'userProfileId':_0x4dd44d[_0x4f48('0x52')]},'raw':!![]})['then'](function(_0x441950){if(_0x441950&&_0x441950[_0x4f48('0x53')]===0x0){return db['UserProfileResource'][_0x4f48('0x4c')]({'name':_0x33a25c['name'],'resourceId':_0x33a25c['id'],'type':_0x441950['name'],'sectionId':_0x441950['id']},{})[_0x4f48('0x29')](function(){return _0x4ce5aa;});}else{return _0x4ce5aa;}})['catch'](function(_0x23890b){logger[_0x4f48('0x2b')](_0x4f48('0x54'),_0x23890b);throw _0x23890b;});}return _0x4ce5aa;})[_0x4f48('0x29')](respondWithResult(_0x223ffb,0xc9))[_0x4f48('0x47')](handleError(_0x223ffb,null));};exports[_0x4f48('0x24')]=function(_0x260af5,_0x987554){if(_0x260af5[_0x4f48('0x4d')]['id']){delete _0x260af5[_0x4f48('0x4d')]['id'];}return db['Trigger'][_0x4f48('0x4b')]({'where':{'id':_0x260af5[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x987554,null))[_0x4f48('0x29')](saveUpdates(_0x260af5['body'],null))[_0x4f48('0x29')](respondWithResult(_0x987554,null))[_0x4f48('0x47')](handleError(_0x987554,null));};exports['destroy']=function(_0x3a08e6,_0x2e15e5){return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x3a08e6['params']['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x2e15e5,null))[_0x4f48('0x29')](removeEntity(_0x2e15e5,null))['catch'](handleError(_0x2e15e5,null));};exports[_0x4f48('0x55')]=function(_0x6c1d4e,_0xf0d077,_0x3b7979){if(_0x6c1d4e['body']['id']){delete _0x6c1d4e[_0x4f48('0x4d')]['id'];}return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x6c1d4e[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0xf0d077,null))[_0x4f48('0x29')](function(_0x5ae83f){if(_0x5ae83f){_0x6c1d4e[_0x4f48('0x4d')][_0x4f48('0x56')]=_0x5ae83f['id'];return db[_0x4f48('0x57')]['create'](_0x6c1d4e[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0xf0d077,null))[_0x4f48('0x47')](handleError(_0xf0d077,null));};exports['addAnyCondition']=function(_0x350ae4,_0x19368d,_0x3b476e){if(_0x350ae4[_0x4f48('0x4d')]['id']){delete _0x350ae4[_0x4f48('0x4d')]['id'];}return db['Trigger'][_0x4f48('0x4b')]({'where':{'id':_0x350ae4['params']['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x19368d,null))['then'](function(_0xb29d0d){if(_0xb29d0d){_0x350ae4['body'][_0x4f48('0x58')]=_0xb29d0d['id'];return db[_0x4f48('0x57')][_0x4f48('0x4c')](_0x350ae4[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0x19368d,null))['catch'](handleError(_0x19368d,null));};exports[_0x4f48('0x59')]=function(_0x3ed369,_0x20f763,_0x3a4dbe){var _0x36a5bc={};var _0x3e0554={};var _0x6e7ffd;var _0x5508d6;return db[_0x4f48('0x43')][_0x4f48('0x5a')]({'where':{'id':_0x3ed369[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x20f763,null))[_0x4f48('0x29')](function(_0x4908eb){if(_0x4908eb){_0x6e7ffd=_0x4908eb;_0x3e0554[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x57')][_0x4f48('0x2e')]);_0x3e0554[_0x4f48('0x35')]=_['keys'](_0x3ed369[_0x4f48('0x35')]);_0x3e0554[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x3e0554[_0x4f48('0x32')],_0x3e0554[_0x4f48('0x35')]);_0x36a5bc[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x3e0554['model'],qs[_0x4f48('0x4a')](_0x3ed369[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x36a5bc[_0x4f48('0x38')]=_0x36a5bc[_0x4f48('0x38')][_0x4f48('0x39')]?_0x36a5bc[_0x4f48('0x38')]:_0x3e0554[_0x4f48('0x32')];_0x36a5bc[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x36a5bc[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_['pick'](_0x3ed369['query'],_0x3e0554[_0x4f48('0x36')]));if(_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3f')]){_0x36a5bc[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x36a5bc[_0x4f48('0x3d')],{'$or':_['map'](_0x36a5bc[_0x4f48('0x38')],function(_0x3c8878){var _0x256a9d={};_0x256a9d[_0x3c8878]={'$like':'%'+_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3f')]+'%'};return _0x256a9d;})});}_0x36a5bc=_[_0x4f48('0x40')]({},_0x36a5bc,_0x3ed369['options']);return _0x6e7ffd['getAllConditions'](_0x36a5bc);}})[_0x4f48('0x29')](function(_0x368ff1){if(_0x368ff1){_0x5508d6=_0x368ff1[_0x4f48('0x39')];if(!_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x36a5bc['limit']=qs[_0x4f48('0x1b')](_0x3ed369['query']['limit']);_0x36a5bc['offset']=qs[_0x4f48('0x1a')](_0x3ed369[_0x4f48('0x35')]['offset']);}return _0x6e7ffd['getAllConditions'](_0x36a5bc);}})[_0x4f48('0x29')](function(_0xa4c364){if(_0xa4c364){return _0xa4c364?{'count':_0x5508d6,'rows':_0xa4c364}:null;}})[_0x4f48('0x29')](respondWithResult(_0x20f763,null))[_0x4f48('0x47')](handleError(_0x20f763,null));};exports['getAnyConditions']=function(_0x28dadb,_0x1c827b,_0x1cd87b){var _0x5242b4={};var _0x3a93c4={};var _0xd68f19;var _0x49a7cf;return db[_0x4f48('0x43')]['findOne']({'where':{'id':_0x28dadb['params']['id']}})['then'](handleEntityNotFound(_0x1c827b,null))[_0x4f48('0x29')](function(_0x7dba66){if(_0x7dba66){_0xd68f19=_0x7dba66;_0x3a93c4[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x57')]['rawAttributes']);_0x3a93c4[_0x4f48('0x35')]=_['keys'](_0x28dadb[_0x4f48('0x35')]);_0x3a93c4[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x3a93c4[_0x4f48('0x32')],_0x3a93c4[_0x4f48('0x35')]);_0x5242b4[_0x4f48('0x38')]=_['intersection'](_0x3a93c4['model'],qs[_0x4f48('0x4a')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x5242b4['attributes']=_0x5242b4[_0x4f48('0x38')][_0x4f48('0x39')]?_0x5242b4[_0x4f48('0x38')]:_0x3a93c4[_0x4f48('0x32')];_0x5242b4[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x5242b4[_0x4f48('0x3d')]=qs['filters'](_['pick'](_0x28dadb[_0x4f48('0x35')],_0x3a93c4[_0x4f48('0x36')]));if(_0x28dadb['query'][_0x4f48('0x3f')]){_0x5242b4['where']=_[_0x4f48('0x40')](_0x5242b4[_0x4f48('0x3d')],{'$or':_[_0x4f48('0x2d')](_0x5242b4[_0x4f48('0x38')],function(_0x66e51e){var _0xb91ff3={};_0xb91ff3[_0x66e51e]={'$like':'%'+_0x28dadb['query']['filter']+'%'};return _0xb91ff3;})});}_0x5242b4=_[_0x4f48('0x40')]({},_0x5242b4,_0x28dadb['options']);return _0xd68f19['getAnyConditions'](_0x5242b4);}})['then'](function(_0x50fad3){if(_0x50fad3){_0x49a7cf=_0x50fad3[_0x4f48('0x39')];if(!_0x28dadb[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x5242b4[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x5242b4[_0x4f48('0x1a')]=qs['offset'](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x1a')]);}return _0xd68f19[_0x4f48('0x5c')](_0x5242b4);}})[_0x4f48('0x29')](function(_0x1a5c41){if(_0x1a5c41){return _0x1a5c41?{'count':_0x49a7cf,'rows':_0x1a5c41}:null;}})[_0x4f48('0x29')](respondWithResult(_0x1c827b,null))['catch'](handleError(_0x1c827b,null));};exports[_0x4f48('0x5d')]=function(_0x4d78e4,_0x1a7876,_0x4ced9e){if(_0x4d78e4[_0x4f48('0x4d')]['id']){delete _0x4d78e4['body']['id'];}return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x4d78e4[_0x4f48('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a7876,null))[_0x4f48('0x29')](function(_0x1407d2){if(_0x1407d2){_0x4d78e4[_0x4f48('0x4d')][_0x4f48('0x5e')]=_0x1407d2['id'];return db['Action'][_0x4f48('0x4c')](_0x4d78e4[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0x1a7876,null))[_0x4f48('0x47')](handleError(_0x1a7876,null));};exports[_0x4f48('0x5f')]=function(_0x40665d,_0x335c2a,_0x2e1881){var _0x2428b1={};var _0x403c52={};var _0x47caf7;var _0x307d88;return db[_0x4f48('0x43')]['findOne']({'where':{'id':_0x40665d[_0x4f48('0x49')]['id']}})['then'](handleEntityNotFound(_0x335c2a,null))[_0x4f48('0x29')](function(_0x371633){if(_0x371633){_0x47caf7=_0x371633;_0x403c52[_0x4f48('0x32')]=_[_0x4f48('0x34')](db['Action']['rawAttributes']);_0x403c52[_0x4f48('0x35')]=_['keys'](_0x40665d[_0x4f48('0x35')]);_0x403c52['filters']=_[_0x4f48('0x37')](_0x403c52['model'],_0x403c52['query']);_0x2428b1[_0x4f48('0x38')]=_['intersection'](_0x403c52[_0x4f48('0x32')],qs[_0x4f48('0x4a')](_0x40665d[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x2428b1[_0x4f48('0x38')]=_0x2428b1['attributes'][_0x4f48('0x39')]?_0x2428b1[_0x4f48('0x38')]:_0x403c52[_0x4f48('0x32')];_0x2428b1[_0x4f48('0x3b')]=qs['sort'](_0x40665d[_0x4f48('0x35')]['sort']);_0x2428b1[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_['pick'](_0x40665d[_0x4f48('0x35')],_0x403c52[_0x4f48('0x36')]));if(_0x40665d['query'][_0x4f48('0x3f')]){_0x2428b1[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x2428b1[_0x4f48('0x3d')],{'$or':_[_0x4f48('0x2d')](_0x2428b1[_0x4f48('0x38')],function(_0x1751fe){var _0x54ef6b={};_0x54ef6b[_0x1751fe]={'$like':'%'+_0x40665d['query'][_0x4f48('0x3f')]+'%'};return _0x54ef6b;})});}_0x2428b1=_['merge']({},_0x2428b1,_0x40665d['options']);return _0x47caf7[_0x4f48('0x5f')](_0x2428b1);}})[_0x4f48('0x29')](function(_0x53c7da){if(_0x53c7da){_0x307d88=_0x53c7da[_0x4f48('0x39')];if(!_0x40665d[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x2428b1[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x40665d[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x2428b1['offset']=qs['offset'](_0x40665d[_0x4f48('0x35')]['offset']);}return _0x47caf7['getActions'](_0x2428b1);}})[_0x4f48('0x29')](function(_0x247434){if(_0x247434){return _0x247434?{'count':_0x307d88,'rows':_0x247434}:null;}})[_0x4f48('0x29')](respondWithResult(_0x335c2a,null))[_0x4f48('0x47')](handleError(_0x335c2a,null));}; \ No newline at end of file +var _0x2d2a=['moment','mustache','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','user','role','Triggers','UserProfileSection','find','userProfileId','autoAssociation','error','body','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x343485,_0x149494){var _0x1e8259=function(_0x4b83fb){while(--_0x4b83fb){_0x343485['push'](_0x343485['shift']());}};_0x1e8259(++_0x149494);}(_0x2d2a,0x16f));var _0xa2d2=function(_0x46aa01,_0x5016fe){_0x46aa01=_0x46aa01-0x0;var _0xbaf9e3=_0x2d2a[_0x46aa01];return _0xbaf9e3;};'use strict';var emlformat=require(_0xa2d2('0x0'));var rimraf=require(_0xa2d2('0x1'));var zipdir=require(_0xa2d2('0x2'));var jsonpatch=require(_0xa2d2('0x3'));var rp=require(_0xa2d2('0x4'));var moment=require(_0xa2d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa2d2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa2d2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2d2('0x8'));var _=require(_0xa2d2('0x9'));var squel=require(_0xa2d2('0xa'));var crypto=require(_0xa2d2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa2d2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa2d2('0xd'));var Redis=require(_0xa2d2('0xe'));var authService=require(_0xa2d2('0xf'));var qs=require(_0xa2d2('0x10'));var as=require(_0xa2d2('0x11'));var hardwareService=require(_0xa2d2('0x12'));var logger=require(_0xa2d2('0x13'))(_0xa2d2('0x14'));var utils=require('../../config/utils');var config=require(_0xa2d2('0x15'));var licenseUtil=require(_0xa2d2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f474d,_0x384eea){_0x384eea=_0x384eea||0xcc;return function(_0x16c447){if(_0x16c447){return _0x3f474d['sendStatus'](_0x384eea);}return _0x3f474d[_0xa2d2('0x17')](_0x384eea)[_0xa2d2('0x18')]();};}function respondWithResult(_0x8821c9,_0x3d3970){_0x3d3970=_0x3d3970||0xc8;return function(_0x5b7c63){if(_0x5b7c63){return _0x8821c9[_0xa2d2('0x17')](_0x3d3970)['json'](_0x5b7c63);}};}function respondWithFilteredResult(_0x310c5f,_0x73eb11){return function(_0x4f67b1){if(_0x4f67b1){var _0x462a13=typeof _0x73eb11['offset']===_0xa2d2('0x19')&&typeof _0x73eb11[_0xa2d2('0x1a')]===_0xa2d2('0x19');var _0x223b7f=_0x4f67b1[_0xa2d2('0x1b')];var _0x4b4a8f=_0x462a13?0x0:_0x73eb11['offset'];var _0x2fab6d=_0x462a13?_0x4f67b1[_0xa2d2('0x1b')]:_0x73eb11[_0xa2d2('0x1c')]+_0x73eb11['limit'];var _0x1668db;if(_0x2fab6d>=_0x223b7f){_0x2fab6d=_0x223b7f;_0x1668db=0xc8;}else{_0x1668db=0xce;}_0x310c5f[_0xa2d2('0x17')](_0x1668db);return _0x310c5f['set'](_0xa2d2('0x1d'),_0x4b4a8f+'-'+_0x2fab6d+'/'+_0x223b7f)[_0xa2d2('0x1e')](_0x4f67b1);}return null;};}function patchUpdates(_0x4d3b6c){return function(_0xf2f7fa){try{jsonpatch[_0xa2d2('0x1f')](_0xf2f7fa,_0x4d3b6c,!![]);}catch(_0xe9e34e){return BPromise[_0xa2d2('0x20')](_0xe9e34e);}return _0xf2f7fa[_0xa2d2('0x21')]();};}function saveUpdates(_0x105574,_0x48ec3f){return function(_0x48f2cd){if(_0x48f2cd){return _0x48f2cd[_0xa2d2('0x22')](_0x105574)[_0xa2d2('0x23')](function(_0x597e25){return _0x597e25;});}return null;};}function removeEntity(_0xfce1a1,_0xedc0ed){return function(_0x92bf77){if(_0x92bf77){return _0x92bf77[_0xa2d2('0x24')]()['then'](function(){var _0x4fa4c8=_0x92bf77[_0xa2d2('0x25')]({'plain':!![]});var _0x201835='Triggers';return db[_0xa2d2('0x26')][_0xa2d2('0x24')]({'where':{'type':_0x201835,'resourceId':_0x4fa4c8['id']}})[_0xa2d2('0x23')](function(){return _0x92bf77;});})[_0xa2d2('0x23')](function(){_0xfce1a1[_0xa2d2('0x17')](0xcc)[_0xa2d2('0x18')]();});}};}function handleEntityNotFound(_0x2c9f50,_0x2b4d58){return function(_0x1474d0){if(!_0x1474d0){_0x2c9f50['sendStatus'](0x194);}return _0x1474d0;};}function handleError(_0x25ffc9,_0x481cdf){_0x481cdf=_0x481cdf||0x1f4;return function(_0xda2c62){logger['error'](_0xda2c62[_0xa2d2('0x27')]);if(_0xda2c62[_0xa2d2('0x28')]){delete _0xda2c62['name'];}_0x25ffc9['status'](_0x481cdf)[_0xa2d2('0x29')](_0xda2c62);};}exports[_0xa2d2('0x2a')]=function(_0x1f6651,_0x38b9bd){var _0x58e215={},_0x515547={},_0x155344={'count':0x0,'rows':[]};var _0x5d80e8=_[_0xa2d2('0x2b')](db[_0xa2d2('0x2c')][_0xa2d2('0x2d')],function(_0x25b149){return{'name':_0x25b149[_0xa2d2('0x2e')],'type':_0x25b149[_0xa2d2('0x2f')][_0xa2d2('0x30')]};});_0x515547[_0xa2d2('0x31')]=_['map'](_0x5d80e8,_0xa2d2('0x28'));_0x515547[_0xa2d2('0x32')]=_[_0xa2d2('0x33')](_0x1f6651[_0xa2d2('0x32')]);_0x515547[_0xa2d2('0x34')]=_[_0xa2d2('0x35')](_0x515547[_0xa2d2('0x31')],_0x515547[_0xa2d2('0x32')]);_0x58e215[_0xa2d2('0x36')]=_[_0xa2d2('0x35')](_0x515547[_0xa2d2('0x31')],qs[_0xa2d2('0x37')](_0x1f6651[_0xa2d2('0x32')][_0xa2d2('0x37')]));_0x58e215['attributes']=_0x58e215[_0xa2d2('0x36')][_0xa2d2('0x38')]?_0x58e215['attributes']:_0x515547['model'];if(!_0x1f6651[_0xa2d2('0x32')]['hasOwnProperty'](_0xa2d2('0x39'))){_0x58e215[_0xa2d2('0x1a')]=qs[_0xa2d2('0x1a')](_0x1f6651[_0xa2d2('0x32')][_0xa2d2('0x1a')]);_0x58e215['offset']=qs[_0xa2d2('0x1c')](_0x1f6651['query']['offset']);}_0x58e215[_0xa2d2('0x3a')]=qs[_0xa2d2('0x3b')](_0x1f6651['query'][_0xa2d2('0x3b')]);_0x58e215['where']=qs[_0xa2d2('0x34')](_[_0xa2d2('0x3c')](_0x1f6651[_0xa2d2('0x32')],_0x515547[_0xa2d2('0x34')]),_0x5d80e8);if(_0x1f6651[_0xa2d2('0x32')][_0xa2d2('0x3d')]){_0x58e215[_0xa2d2('0x3e')]=_[_0xa2d2('0x3f')](_0x58e215[_0xa2d2('0x3e')],{'$or':_[_0xa2d2('0x2b')](_0x5d80e8,function(_0x478bf9){if(_0x478bf9[_0xa2d2('0x2f')]!==_0xa2d2('0x40')){var _0x47119b={};_0x47119b[_0x478bf9[_0xa2d2('0x28')]]={'$like':'%'+_0x1f6651[_0xa2d2('0x32')][_0xa2d2('0x3d')]+'%'};return _0x47119b;}})});}_0x58e215=_[_0xa2d2('0x3f')]({},_0x58e215,_0x1f6651['options']);var _0x922221={'where':_0x58e215[_0xa2d2('0x3e')]};return db[_0xa2d2('0x2c')][_0xa2d2('0x1b')](_0x922221)[_0xa2d2('0x23')](function(_0x1f38ad){_0x155344['count']=_0x1f38ad;if(_0x1f6651[_0xa2d2('0x32')][_0xa2d2('0x41')]){_0x58e215[_0xa2d2('0x42')]=[{'all':!![]}];}return db[_0xa2d2('0x2c')][_0xa2d2('0x43')](_0x58e215);})[_0xa2d2('0x23')](function(_0x3a93f4){_0x155344[_0xa2d2('0x44')]=_0x3a93f4;return _0x155344;})['then'](respondWithFilteredResult(_0x38b9bd,_0x58e215))[_0xa2d2('0x45')](handleError(_0x38b9bd,null));};exports[_0xa2d2('0x46')]=function(_0x35c212,_0x4d8bb9){var _0x453587={'raw':![],'where':{'id':_0x35c212[_0xa2d2('0x47')]['id']}},_0x1017ac={};_0x1017ac[_0xa2d2('0x31')]=_['keys'](db[_0xa2d2('0x2c')][_0xa2d2('0x2d')]);_0x1017ac[_0xa2d2('0x32')]=_[_0xa2d2('0x33')](_0x35c212[_0xa2d2('0x32')]);_0x1017ac[_0xa2d2('0x34')]=_[_0xa2d2('0x35')](_0x1017ac[_0xa2d2('0x31')],_0x1017ac[_0xa2d2('0x32')]);_0x453587[_0xa2d2('0x36')]=_[_0xa2d2('0x35')](_0x1017ac['model'],qs['fields'](_0x35c212[_0xa2d2('0x32')][_0xa2d2('0x37')]));_0x453587['attributes']=_0x453587['attributes'][_0xa2d2('0x38')]?_0x453587[_0xa2d2('0x36')]:_0x1017ac[_0xa2d2('0x31')];if(_0x35c212[_0xa2d2('0x32')][_0xa2d2('0x41')]){_0x453587[_0xa2d2('0x42')]=[{'all':!![]}];}_0x453587=_[_0xa2d2('0x3f')]({},_0x453587,_0x35c212[_0xa2d2('0x48')]);return db['Trigger']['find'](_0x453587)[_0xa2d2('0x23')](handleEntityNotFound(_0x4d8bb9,null))[_0xa2d2('0x23')](respondWithResult(_0x4d8bb9,null))[_0xa2d2('0x45')](handleError(_0x4d8bb9,null));};exports[_0xa2d2('0x49')]=function(_0x1f1855,_0x311d84){return db['Trigger'][_0xa2d2('0x49')](_0x1f1855['body'],{})[_0xa2d2('0x23')](function(_0x274a74){var _0x1e2e95=_0x1f1855[_0xa2d2('0x4a')][_0xa2d2('0x25')]({'plain':!![]});if(!_0x1e2e95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e2e95[_0xa2d2('0x4b')]===_0xa2d2('0x4a')){var _0x321f9d=_0x274a74[_0xa2d2('0x25')]({'plain':!![]});var _0x1c6b44=_0xa2d2('0x4c');return db[_0xa2d2('0x4d')][_0xa2d2('0x4e')]({'where':{'name':_0x1c6b44,'userProfileId':_0x1e2e95[_0xa2d2('0x4f')]},'raw':!![]})['then'](function(_0x383910){if(_0x383910&&_0x383910[_0xa2d2('0x50')]===0x0){return db[_0xa2d2('0x26')]['create']({'name':_0x321f9d[_0xa2d2('0x28')],'resourceId':_0x321f9d['id'],'type':_0x383910[_0xa2d2('0x28')],'sectionId':_0x383910['id']},{})[_0xa2d2('0x23')](function(){return _0x274a74;});}else{return _0x274a74;}})[_0xa2d2('0x45')](function(_0xb47106){logger[_0xa2d2('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb47106);throw _0xb47106;});}return _0x274a74;})['then'](respondWithResult(_0x311d84,0xc9))[_0xa2d2('0x45')](handleError(_0x311d84,null));};exports[_0xa2d2('0x22')]=function(_0x1d9fe9,_0x10eb54){if(_0x1d9fe9[_0xa2d2('0x52')]['id']){delete _0x1d9fe9[_0xa2d2('0x52')]['id'];}return db['Trigger'][_0xa2d2('0x4e')]({'where':{'id':_0x1d9fe9['params']['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x10eb54,null))[_0xa2d2('0x23')](saveUpdates(_0x1d9fe9[_0xa2d2('0x52')],null))[_0xa2d2('0x23')](respondWithResult(_0x10eb54,null))[_0xa2d2('0x45')](handleError(_0x10eb54,null));};exports[_0xa2d2('0x24')]=function(_0x88b0ae,_0x19e5b5){return db[_0xa2d2('0x2c')][_0xa2d2('0x4e')]({'where':{'id':_0x88b0ae['params']['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x19e5b5,null))[_0xa2d2('0x23')](removeEntity(_0x19e5b5,null))[_0xa2d2('0x45')](handleError(_0x19e5b5,null));};exports[_0xa2d2('0x53')]=function(_0x5866e3,_0x3aaacf,_0x2f8dc4){if(_0x5866e3[_0xa2d2('0x52')]['id']){delete _0x5866e3[_0xa2d2('0x52')]['id'];}return db[_0xa2d2('0x2c')][_0xa2d2('0x4e')]({'where':{'id':_0x5866e3['params']['id']}})['then'](handleEntityNotFound(_0x3aaacf,null))[_0xa2d2('0x23')](function(_0x344a58){if(_0x344a58){_0x5866e3[_0xa2d2('0x52')]['TriggerAllId']=_0x344a58['id'];return db[_0xa2d2('0x54')]['create'](_0x5866e3[_0xa2d2('0x52')]);}})[_0xa2d2('0x23')](respondWithResult(_0x3aaacf,null))[_0xa2d2('0x45')](handleError(_0x3aaacf,null));};exports[_0xa2d2('0x55')]=function(_0x590a25,_0x5408e6,_0x1acf44){if(_0x590a25[_0xa2d2('0x52')]['id']){delete _0x590a25[_0xa2d2('0x52')]['id'];}return db[_0xa2d2('0x2c')][_0xa2d2('0x4e')]({'where':{'id':_0x590a25[_0xa2d2('0x47')]['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x5408e6,null))[_0xa2d2('0x23')](function(_0xfe0458){if(_0xfe0458){_0x590a25[_0xa2d2('0x52')]['TriggerAnyId']=_0xfe0458['id'];return db[_0xa2d2('0x54')][_0xa2d2('0x49')](_0x590a25['body']);}})[_0xa2d2('0x23')](respondWithResult(_0x5408e6,null))[_0xa2d2('0x45')](handleError(_0x5408e6,null));};exports[_0xa2d2('0x56')]=function(_0x459438,_0x3dbec1,_0x28a81f){var _0x22a44b={};var _0x566f36={};var _0x12fb41;var _0x7b6178;return db['Trigger'][_0xa2d2('0x57')]({'where':{'id':_0x459438[_0xa2d2('0x47')]['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x3dbec1,null))[_0xa2d2('0x23')](function(_0x306868){if(_0x306868){_0x12fb41=_0x306868;_0x566f36[_0xa2d2('0x31')]=_['keys'](db[_0xa2d2('0x54')][_0xa2d2('0x2d')]);_0x566f36[_0xa2d2('0x32')]=_[_0xa2d2('0x33')](_0x459438['query']);_0x566f36[_0xa2d2('0x34')]=_[_0xa2d2('0x35')](_0x566f36[_0xa2d2('0x31')],_0x566f36['query']);_0x22a44b[_0xa2d2('0x36')]=_[_0xa2d2('0x35')](_0x566f36[_0xa2d2('0x31')],qs[_0xa2d2('0x37')](_0x459438[_0xa2d2('0x32')][_0xa2d2('0x37')]));_0x22a44b[_0xa2d2('0x36')]=_0x22a44b[_0xa2d2('0x36')][_0xa2d2('0x38')]?_0x22a44b[_0xa2d2('0x36')]:_0x566f36['model'];_0x22a44b['order']=qs[_0xa2d2('0x3b')](_0x459438[_0xa2d2('0x32')]['sort']);_0x22a44b[_0xa2d2('0x3e')]=qs['filters'](_[_0xa2d2('0x3c')](_0x459438[_0xa2d2('0x32')],_0x566f36[_0xa2d2('0x34')]));if(_0x459438[_0xa2d2('0x32')]['filter']){_0x22a44b[_0xa2d2('0x3e')]=_[_0xa2d2('0x3f')](_0x22a44b[_0xa2d2('0x3e')],{'$or':_[_0xa2d2('0x2b')](_0x22a44b['attributes'],function(_0x229735){var _0x923e3={};_0x923e3[_0x229735]={'$like':'%'+_0x459438[_0xa2d2('0x32')][_0xa2d2('0x3d')]+'%'};return _0x923e3;})});}_0x22a44b=_[_0xa2d2('0x3f')]({},_0x22a44b,_0x459438[_0xa2d2('0x48')]);return _0x12fb41[_0xa2d2('0x56')](_0x22a44b);}})[_0xa2d2('0x23')](function(_0x2cf18b){if(_0x2cf18b){_0x7b6178=_0x2cf18b[_0xa2d2('0x38')];if(!_0x459438['query'][_0xa2d2('0x58')](_0xa2d2('0x39'))){_0x22a44b[_0xa2d2('0x1a')]=qs['limit'](_0x459438[_0xa2d2('0x32')][_0xa2d2('0x1a')]);_0x22a44b[_0xa2d2('0x1c')]=qs['offset'](_0x459438['query'][_0xa2d2('0x1c')]);}return _0x12fb41[_0xa2d2('0x56')](_0x22a44b);}})[_0xa2d2('0x23')](function(_0x868f42){if(_0x868f42){return _0x868f42?{'count':_0x7b6178,'rows':_0x868f42}:null;}})[_0xa2d2('0x23')](respondWithResult(_0x3dbec1,null))[_0xa2d2('0x45')](handleError(_0x3dbec1,null));};exports['getAnyConditions']=function(_0x3ed61d,_0x2340a2,_0x26e0a3){var _0x5d320c={};var _0x5837d5={};var _0x1f0a8f;var _0x4b2f44;return db[_0xa2d2('0x2c')]['findOne']({'where':{'id':_0x3ed61d['params']['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x2340a2,null))[_0xa2d2('0x23')](function(_0x4b3137){if(_0x4b3137){_0x1f0a8f=_0x4b3137;_0x5837d5[_0xa2d2('0x31')]=_[_0xa2d2('0x33')](db[_0xa2d2('0x54')]['rawAttributes']);_0x5837d5[_0xa2d2('0x32')]=_[_0xa2d2('0x33')](_0x3ed61d[_0xa2d2('0x32')]);_0x5837d5[_0xa2d2('0x34')]=_[_0xa2d2('0x35')](_0x5837d5[_0xa2d2('0x31')],_0x5837d5['query']);_0x5d320c['attributes']=_[_0xa2d2('0x35')](_0x5837d5[_0xa2d2('0x31')],qs[_0xa2d2('0x37')](_0x3ed61d['query']['fields']));_0x5d320c[_0xa2d2('0x36')]=_0x5d320c['attributes'][_0xa2d2('0x38')]?_0x5d320c[_0xa2d2('0x36')]:_0x5837d5[_0xa2d2('0x31')];_0x5d320c[_0xa2d2('0x3a')]=qs[_0xa2d2('0x3b')](_0x3ed61d[_0xa2d2('0x32')][_0xa2d2('0x3b')]);_0x5d320c[_0xa2d2('0x3e')]=qs[_0xa2d2('0x34')](_[_0xa2d2('0x3c')](_0x3ed61d[_0xa2d2('0x32')],_0x5837d5['filters']));if(_0x3ed61d['query'][_0xa2d2('0x3d')]){_0x5d320c[_0xa2d2('0x3e')]=_['merge'](_0x5d320c['where'],{'$or':_['map'](_0x5d320c['attributes'],function(_0x7627dc){var _0xb46937={};_0xb46937[_0x7627dc]={'$like':'%'+_0x3ed61d[_0xa2d2('0x32')][_0xa2d2('0x3d')]+'%'};return _0xb46937;})});}_0x5d320c=_[_0xa2d2('0x3f')]({},_0x5d320c,_0x3ed61d[_0xa2d2('0x48')]);return _0x1f0a8f[_0xa2d2('0x59')](_0x5d320c);}})[_0xa2d2('0x23')](function(_0x28149f){if(_0x28149f){_0x4b2f44=_0x28149f[_0xa2d2('0x38')];if(!_0x3ed61d[_0xa2d2('0x32')]['hasOwnProperty'](_0xa2d2('0x39'))){_0x5d320c[_0xa2d2('0x1a')]=qs[_0xa2d2('0x1a')](_0x3ed61d[_0xa2d2('0x32')][_0xa2d2('0x1a')]);_0x5d320c[_0xa2d2('0x1c')]=qs[_0xa2d2('0x1c')](_0x3ed61d[_0xa2d2('0x32')]['offset']);}return _0x1f0a8f[_0xa2d2('0x59')](_0x5d320c);}})[_0xa2d2('0x23')](function(_0x535511){if(_0x535511){return _0x535511?{'count':_0x4b2f44,'rows':_0x535511}:null;}})['then'](respondWithResult(_0x2340a2,null))[_0xa2d2('0x45')](handleError(_0x2340a2,null));};exports[_0xa2d2('0x5a')]=function(_0x3e9fed,_0x3c9f62,_0x4a9bbf){if(_0x3e9fed[_0xa2d2('0x52')]['id']){delete _0x3e9fed[_0xa2d2('0x52')]['id'];}return db[_0xa2d2('0x2c')][_0xa2d2('0x4e')]({'where':{'id':_0x3e9fed['params']['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x3c9f62,null))[_0xa2d2('0x23')](function(_0x243077){if(_0x243077){_0x3e9fed['body']['TriggerId']=_0x243077['id'];return db[_0xa2d2('0x5b')][_0xa2d2('0x49')](_0x3e9fed[_0xa2d2('0x52')]);}})['then'](respondWithResult(_0x3c9f62,null))['catch'](handleError(_0x3c9f62,null));};exports[_0xa2d2('0x5c')]=function(_0x4ec55f,_0x3cc559,_0xc6502){var _0x358828={};var _0x4c3e19={};var _0x1e14fb;var _0x2eabc2;return db['Trigger'][_0xa2d2('0x57')]({'where':{'id':_0x4ec55f[_0xa2d2('0x47')]['id']}})[_0xa2d2('0x23')](handleEntityNotFound(_0x3cc559,null))[_0xa2d2('0x23')](function(_0x1357a7){if(_0x1357a7){_0x1e14fb=_0x1357a7;_0x4c3e19[_0xa2d2('0x31')]=_[_0xa2d2('0x33')](db[_0xa2d2('0x5b')][_0xa2d2('0x2d')]);_0x4c3e19['query']=_[_0xa2d2('0x33')](_0x4ec55f[_0xa2d2('0x32')]);_0x4c3e19[_0xa2d2('0x34')]=_['intersection'](_0x4c3e19[_0xa2d2('0x31')],_0x4c3e19['query']);_0x358828['attributes']=_[_0xa2d2('0x35')](_0x4c3e19[_0xa2d2('0x31')],qs[_0xa2d2('0x37')](_0x4ec55f[_0xa2d2('0x32')][_0xa2d2('0x37')]));_0x358828[_0xa2d2('0x36')]=_0x358828[_0xa2d2('0x36')]['length']?_0x358828['attributes']:_0x4c3e19[_0xa2d2('0x31')];_0x358828[_0xa2d2('0x3a')]=qs['sort'](_0x4ec55f[_0xa2d2('0x32')][_0xa2d2('0x3b')]);_0x358828['where']=qs[_0xa2d2('0x34')](_[_0xa2d2('0x3c')](_0x4ec55f[_0xa2d2('0x32')],_0x4c3e19[_0xa2d2('0x34')]));if(_0x4ec55f['query'][_0xa2d2('0x3d')]){_0x358828[_0xa2d2('0x3e')]=_[_0xa2d2('0x3f')](_0x358828['where'],{'$or':_['map'](_0x358828[_0xa2d2('0x36')],function(_0x1d554e){var _0x2ec0db={};_0x2ec0db[_0x1d554e]={'$like':'%'+_0x4ec55f['query'][_0xa2d2('0x3d')]+'%'};return _0x2ec0db;})});}_0x358828=_[_0xa2d2('0x3f')]({},_0x358828,_0x4ec55f[_0xa2d2('0x48')]);return _0x1e14fb[_0xa2d2('0x5c')](_0x358828);}})[_0xa2d2('0x23')](function(_0x248c55){if(_0x248c55){_0x2eabc2=_0x248c55[_0xa2d2('0x38')];if(!_0x4ec55f['query'][_0xa2d2('0x58')](_0xa2d2('0x39'))){_0x358828[_0xa2d2('0x1a')]=qs[_0xa2d2('0x1a')](_0x4ec55f[_0xa2d2('0x32')][_0xa2d2('0x1a')]);_0x358828[_0xa2d2('0x1c')]=qs['offset'](_0x4ec55f[_0xa2d2('0x32')][_0xa2d2('0x1c')]);}return _0x1e14fb[_0xa2d2('0x5c')](_0x358828);}})[_0xa2d2('0x23')](function(_0x3100d0){if(_0x3100d0){return _0x3100d0?{'count':_0x2eabc2,'rows':_0x3100d0}:null;}})[_0xa2d2('0x23')](respondWithResult(_0x3cc559,null))[_0xa2d2('0x45')](handleError(_0x3cc559,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 21fbc8b..564354a 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 _0x8c52=['path','rimraf','../../config/environment','./trigger.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x8c52,0x7e));var _0x28c5=function(_0x451b32,_0x1eace6){_0x451b32=_0x451b32-0x0;var _0x4ac489=_0x8c52[_0x451b32];return _0x4ac489;};'use strict';var _=require(_0x28c5('0x0'));var util=require('util');var logger=require(_0x28c5('0x1'))(_0x28c5('0x2'));var moment=require(_0x28c5('0x3'));var BPromise=require(_0x28c5('0x4'));var rp=require(_0x28c5('0x5'));var fs=require('fs');var path=require(_0x28c5('0x6'));var rimraf=require(_0x28c5('0x7'));var config=require(_0x28c5('0x8'));var attributes=require(_0x28c5('0x9'));module[_0x28c5('0xa')]=function(_0x209f3d,_0x3b5c38){return _0x209f3d['define']('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab86=['util','../../config/logger','bluebird','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash'];(function(_0x59a895,_0x195c3d){var _0x2de8f9=function(_0x2a4084){while(--_0x2a4084){_0x59a895['push'](_0x59a895['shift']());}};_0x2de8f9(++_0x195c3d);}(_0xab86,0x13e));var _0x6ab8=function(_0x423ccb,_0x210002){_0x423ccb=_0x423ccb-0x0;var _0xafea3f=_0xab86[_0x423ccb];return _0xafea3f;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var logger=require(_0x6ab8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ab8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ab8('0x4'));var rimraf=require('rimraf');var config=require(_0x6ab8('0x5'));var attributes=require(_0x6ab8('0x6'));module[_0x6ab8('0x7')]=function(_0x154d17,_0x6f41f){return _0x154d17[_0x6ab8('0x8')](_0x6ab8('0x9'),attributes,{'tableName':_0x6ab8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 23b9788..818e192 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 _0x65da=['debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowTrigger','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info'];(function(_0x4470b3,_0x15d053){var _0xb5ac6c=function(_0x3f0685){while(--_0x3f0685){_0x4470b3['push'](_0x4470b3['shift']());}};_0xb5ac6c(++_0x15d053);}(_0x65da,0x152));var _0xa65d=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x65da[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xa65d('0x0'));var util=require('util');var moment=require(_0xa65d('0x1'));var BPromise=require(_0xa65d('0x2'));var rs=require(_0xa65d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa65d('0x4'))['db'];var utils=require(_0xa65d('0x5'));var logger=require(_0xa65d('0x6'))(_0xa65d('0x7'));var config=require(_0xa65d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa65d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x372107,_0x36afc3,_0x461d40){return new BPromise(function(_0x1631de,_0x13ed40){return client[_0xa65d('0xa')](_0x372107,_0x461d40)['then'](function(_0x3c0017){logger[_0xa65d('0xb')]('Trigger,\x20%s,\x20%s',_0x36afc3,'request\x20sent');logger[_0xa65d('0xc')](_0xa65d('0xd'),_0x36afc3,_0xa65d('0xe'),JSON[_0xa65d('0xf')](_0x3c0017));if(_0x3c0017['error']){if(_0x3c0017[_0xa65d('0x10')][_0xa65d('0x11')]===0x1f4){logger[_0xa65d('0x10')](_0xa65d('0x12'),_0x36afc3,_0x3c0017[_0xa65d('0x10')][_0xa65d('0x13')]);return _0x13ed40(_0x3c0017['error'][_0xa65d('0x13')]);}logger[_0xa65d('0x10')]('Trigger,\x20%s,\x20%s',_0x36afc3,_0x3c0017[_0xa65d('0x10')]['message']);return _0x1631de(_0x3c0017[_0xa65d('0x10')]['message']);}else{logger[_0xa65d('0xb')]('Trigger,\x20%s,\x20%s',_0x36afc3,_0xa65d('0xe'));_0x1631de(_0x3c0017[_0xa65d('0x14')]['message']);}})['catch'](function(_0x268f86){logger[_0xa65d('0x10')](_0xa65d('0x12'),_0x36afc3,_0x268f86);_0x13ed40(_0x268f86);});});}exports[_0xa65d('0x15')]=function(_0x335e62){var _0x3e0630=this;return new Promise(function(_0x4127bb,_0x4cd6ce){return db[_0xa65d('0x16')][_0xa65d('0x17')]({'raw':_0x335e62['options']?_0x335e62[_0xa65d('0x18')][_0xa65d('0x19')]===undefined?!![]:![]:!![],'where':_0x335e62[_0xa65d('0x18')]?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1a')]||null:null,'attributes':_0x335e62[_0xa65d('0x18')]?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1b')]||null:null,'limit':_0x335e62['options']?_0x335e62['options'][_0xa65d('0x1c')]||null:null,'include':_0x335e62['options']?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x335e62[_0xa65d('0x18')][_0xa65d('0x1d')],function(_0x146bb0){return{'model':db[_0x146bb0['model']],'as':_0x146bb0['as'],'attributes':_0x146bb0[_0xa65d('0x1b')],'include':_0x146bb0[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x146bb0[_0xa65d('0x1d')],function(_0x28d92b){return{'model':db[_0x28d92b['model']],'as':_0x28d92b['as'],'attributes':_0x28d92b[_0xa65d('0x1b')],'include':_0x28d92b[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x28d92b['include'],function(_0x5874a6){return{'model':db[_0x5874a6[_0xa65d('0x1f')]],'as':_0x5874a6['as'],'attributes':_0x5874a6[_0xa65d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x101177){logger[_0xa65d('0xb')](_0xa65d('0x15'),_0x335e62);logger['debug'](_0xa65d('0x15'),_0x335e62,JSON[_0xa65d('0xf')](_0x101177));_0x4127bb(_0x101177);})['catch'](function(_0x233b86){logger[_0xa65d('0x10')](_0xa65d('0x15'),_0x233b86['message'],_0x335e62);_0x4cd6ce(_0x3e0630[_0xa65d('0x10')](0x1f4,_0x233b86[_0xa65d('0x13')]));});});};exports['ShowTrigger']=function(_0x56b3ac){var _0x558e52=this;return new Promise(function(_0x357fd0,_0x3920a0){return db['Trigger']['find']({'raw':_0x56b3ac['options']?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x19')]===undefined?!![]:![]:!![],'where':_0x56b3ac[_0xa65d('0x18')]?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1a')]||null:null,'attributes':_0x56b3ac['options']?_0x56b3ac['options']['attributes']||null:null,'include':_0x56b3ac['options']?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1d')]?_['map'](_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1d')],function(_0x1268ee){return{'model':db[_0x1268ee[_0xa65d('0x1f')]],'as':_0x1268ee['as'],'attributes':_0x1268ee[_0xa65d('0x1b')],'include':_0x1268ee[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x1268ee['include'],function(_0x2ba141){return{'model':db[_0x2ba141[_0xa65d('0x1f')]],'as':_0x2ba141['as'],'attributes':_0x2ba141['attributes'],'include':_0x2ba141[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x2ba141[_0xa65d('0x1d')],function(_0x2703eb){return{'model':db[_0x2703eb[_0xa65d('0x1f')]],'as':_0x2703eb['as'],'attributes':_0x2703eb[_0xa65d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa65d('0x20')](function(_0x1338e0){logger[_0xa65d('0xb')]('ShowTrigger',_0x56b3ac);logger[_0xa65d('0xc')](_0xa65d('0x21'),_0x56b3ac,JSON[_0xa65d('0xf')](_0x1338e0));_0x357fd0(_0x1338e0);})[_0xa65d('0x22')](function(_0x1ed823){logger[_0xa65d('0x10')](_0xa65d('0x21'),_0x1ed823['message'],_0x56b3ac);_0x3920a0(_0x558e52[_0xa65d('0x10')](0x1f4,_0x1ed823[_0xa65d('0x13')]));});});}; \ No newline at end of file +var _0xa46b=['map','then','debug','ShowTrigger','Trigger','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTrigger','options','raw','where','attributes','limit','include','model'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa46b,0xb5));var _0xba46=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa46b[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xba46('0x0'));var util=require(_0xba46('0x1'));var moment=require('moment');var BPromise=require(_0xba46('0x2'));var rs=require(_0xba46('0x3'));var fs=require('fs');var Redis=require(_0xba46('0x4'));var db=require(_0xba46('0x5'))['db'];var utils=require(_0xba46('0x6'));var logger=require(_0xba46('0x7'))(_0xba46('0x8'));var config=require(_0xba46('0x9'));var jayson=require(_0xba46('0xa'));var client=jayson[_0xba46('0xb')][_0xba46('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f8143,_0x5c9e47,_0x5963cc){return new BPromise(function(_0x194358,_0x3542f6){return client['request'](_0x2f8143,_0x5963cc)['then'](function(_0x1fc9fa){logger[_0xba46('0xd')](_0xba46('0xe'),_0x5c9e47,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x5c9e47,_0xba46('0xf'),JSON[_0xba46('0x10')](_0x1fc9fa));if(_0x1fc9fa[_0xba46('0x11')]){if(_0x1fc9fa['error']['code']===0x1f4){logger[_0xba46('0x11')](_0xba46('0xe'),_0x5c9e47,_0x1fc9fa[_0xba46('0x11')]['message']);return _0x3542f6(_0x1fc9fa[_0xba46('0x11')][_0xba46('0x12')]);}logger[_0xba46('0x11')](_0xba46('0xe'),_0x5c9e47,_0x1fc9fa[_0xba46('0x11')]['message']);return _0x194358(_0x1fc9fa[_0xba46('0x11')][_0xba46('0x12')]);}else{logger[_0xba46('0xd')](_0xba46('0xe'),_0x5c9e47,_0xba46('0xf'));_0x194358(_0x1fc9fa[_0xba46('0x13')]['message']);}})[_0xba46('0x14')](function(_0x6ef060){logger[_0xba46('0x11')](_0xba46('0xe'),_0x5c9e47,_0x6ef060);_0x3542f6(_0x6ef060);});});}exports[_0xba46('0x15')]=function(_0x5bdae8){var _0x5447d0=this;return new Promise(function(_0x2c4927,_0x12aed3){return db['Trigger']['findAll']({'raw':_0x5bdae8[_0xba46('0x16')]?_0x5bdae8[_0xba46('0x16')][_0xba46('0x17')]===undefined?!![]:![]:!![],'where':_0x5bdae8[_0xba46('0x16')]?_0x5bdae8[_0xba46('0x16')][_0xba46('0x18')]||null:null,'attributes':_0x5bdae8[_0xba46('0x16')]?_0x5bdae8['options'][_0xba46('0x19')]||null:null,'limit':_0x5bdae8[_0xba46('0x16')]?_0x5bdae8[_0xba46('0x16')][_0xba46('0x1a')]||null:null,'include':_0x5bdae8[_0xba46('0x16')]?_0x5bdae8[_0xba46('0x16')][_0xba46('0x1b')]?_['map'](_0x5bdae8[_0xba46('0x16')][_0xba46('0x1b')],function(_0x33101c){return{'model':db[_0x33101c[_0xba46('0x1c')]],'as':_0x33101c['as'],'attributes':_0x33101c[_0xba46('0x19')],'include':_0x33101c[_0xba46('0x1b')]?_[_0xba46('0x1d')](_0x33101c[_0xba46('0x1b')],function(_0xb23854){return{'model':db[_0xb23854['model']],'as':_0xb23854['as'],'attributes':_0xb23854[_0xba46('0x19')],'include':_0xb23854[_0xba46('0x1b')]?_[_0xba46('0x1d')](_0xb23854[_0xba46('0x1b')],function(_0x2a6e3c){return{'model':db[_0x2a6e3c['model']],'as':_0x2a6e3c['as'],'attributes':_0x2a6e3c[_0xba46('0x19')]};}):[]};}):[]};}):[]:[]})[_0xba46('0x1e')](function(_0x47c2bf){logger[_0xba46('0xd')](_0xba46('0x15'),_0x5bdae8);logger[_0xba46('0x1f')](_0xba46('0x15'),_0x5bdae8,JSON['stringify'](_0x47c2bf));_0x2c4927(_0x47c2bf);})[_0xba46('0x14')](function(_0x2af8a2){logger[_0xba46('0x11')]('GetTrigger',_0x2af8a2[_0xba46('0x12')],_0x5bdae8);_0x12aed3(_0x5447d0[_0xba46('0x11')](0x1f4,_0x2af8a2[_0xba46('0x12')]));});});};exports[_0xba46('0x20')]=function(_0x362ded){var _0x5d0223=this;return new Promise(function(_0x3df25e,_0x1621d1){return db[_0xba46('0x21')][_0xba46('0x22')]({'raw':_0x362ded[_0xba46('0x16')]?_0x362ded['options'][_0xba46('0x17')]===undefined?!![]:![]:!![],'where':_0x362ded[_0xba46('0x16')]?_0x362ded[_0xba46('0x16')]['where']||null:null,'attributes':_0x362ded['options']?_0x362ded[_0xba46('0x16')][_0xba46('0x19')]||null:null,'include':_0x362ded[_0xba46('0x16')]?_0x362ded['options'][_0xba46('0x1b')]?_[_0xba46('0x1d')](_0x362ded[_0xba46('0x16')][_0xba46('0x1b')],function(_0x15936a){return{'model':db[_0x15936a['model']],'as':_0x15936a['as'],'attributes':_0x15936a[_0xba46('0x19')],'include':_0x15936a[_0xba46('0x1b')]?_[_0xba46('0x1d')](_0x15936a[_0xba46('0x1b')],function(_0x4f49df){return{'model':db[_0x4f49df[_0xba46('0x1c')]],'as':_0x4f49df['as'],'attributes':_0x4f49df['attributes'],'include':_0x4f49df[_0xba46('0x1b')]?_[_0xba46('0x1d')](_0x4f49df[_0xba46('0x1b')],function(_0x8f314a){return{'model':db[_0x8f314a[_0xba46('0x1c')]],'as':_0x8f314a['as'],'attributes':_0x8f314a[_0xba46('0x19')]};}):[]};}):[]};}):[]:[]})[_0xba46('0x1e')](function(_0x3295da){logger[_0xba46('0xd')](_0xba46('0x20'),_0x362ded);logger[_0xba46('0x1f')]('ShowTrigger',_0x362ded,JSON[_0xba46('0x10')](_0x3295da));_0x3df25e(_0x3295da);})['catch'](function(_0x5d9126){logger[_0xba46('0x11')](_0xba46('0x20'),_0x5d9126[_0xba46('0x12')],_0x362ded);_0x1621d1(_0x5d0223[_0xba46('0x11')](0x1f4,_0x5d9126[_0xba46('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c167f54..e1ca094 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 _0x6a76=['isAuthenticated','index','/:id','post','/:id/clone','clone','create','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6a76,0x1ba));var _0x66a7=function(_0xd2e88,_0x4c0089){_0xd2e88=_0xd2e88-0x0;var _0x39a606=_0x6a76[_0xd2e88];return _0x39a606;};'use strict';var multer=require(_0x66a7('0x0'));var util=require('util');var path=require(_0x66a7('0x1'));var timeout=require(_0x66a7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66a7('0x3'));var interaction=require(_0x66a7('0x4'));var config=require(_0x66a7('0x5'));var controller=require('./trunk.controller');router['get']('/',auth[_0x66a7('0x6')](),controller[_0x66a7('0x7')]);router['get'](_0x66a7('0x8'),auth[_0x66a7('0x6')](),controller['show']);router[_0x66a7('0x9')](_0x66a7('0xa'),auth['isAuthenticated'](),controller[_0x66a7('0xb')]);router['post']('/',auth[_0x66a7('0x6')](),controller[_0x66a7('0xc')]);router['put'](_0x66a7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x66a7('0xd')](_0x66a7('0x8'),auth[_0x66a7('0x6')](),controller[_0x66a7('0xe')]);module[_0x66a7('0xf')]=router; \ No newline at end of file +var _0xdded=['index','get','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated'];(function(_0x494110,_0x544437){var _0x220669=function(_0x4ac3aa){while(--_0x4ac3aa){_0x494110['push'](_0x494110['shift']());}};_0x220669(++_0x544437);}(_0xdded,0x115));var _0xddde=function(_0x3fe6ce,_0x4e364e){_0x3fe6ce=_0x3fe6ce-0x0;var _0xc81b00=_0xdded[_0x3fe6ce];return _0xc81b00;};'use strict';var multer=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var path=require(_0xddde('0x2'));var timeout=require(_0xddde('0x3'));var express=require('express');var router=express[_0xddde('0x4')]();var fs_extra=require(_0xddde('0x5'));var auth=require(_0xddde('0x6'));var interaction=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var controller=require(_0xddde('0x9'));router['get']('/',auth[_0xddde('0xa')](),controller[_0xddde('0xb')]);router[_0xddde('0xc')](_0xddde('0xd'),auth[_0xddde('0xa')](),controller[_0xddde('0xe')]);router[_0xddde('0xf')](_0xddde('0x10'),auth[_0xddde('0xa')](),controller[_0xddde('0x11')]);router['post']('/',auth[_0xddde('0xa')](),controller[_0xddde('0x12')]);router[_0xddde('0x13')](_0xddde('0xd'),auth[_0xddde('0xa')](),controller[_0xddde('0x14')]);router[_0xddde('0x15')]('/:id',auth[_0xddde('0xa')](),controller[_0xddde('0x16')]);module[_0xddde('0x17')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index f58d695..1baf802 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 _0x1cb1=['uas','pai','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','accept','originate'];(function(_0xd42166,_0x43d5d3){var _0x2b97b2=function(_0x264a82){while(--_0x264a82){_0xd42166['push'](_0xd42166['shift']());}};_0x2b97b2(++_0x43d5d3);}(_0x1cb1,0x6b));var _0x11cb=function(_0x3db353,_0x3c412f){_0x3db353=_0x3db353-0x0;var _0x20ee0f=_0x1cb1[_0x3db353];return _0x20ee0f;};'use strict';var Sequelize=require(_0x11cb('0x0'));module[_0x11cb('0x1')]={'name':{'type':Sequelize[_0x11cb('0x2')],'allowNull':![],'unique':_0x11cb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x5'),_0x11cb('0x6'),_0x11cb('0x7')),'allowNull':![],'defaultValue':_0x11cb('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11cb('0x8')},'callingpres':{'type':Sequelize[_0x11cb('0x4')]('ALLOWED_NOT_SCREENED',_0x11cb('0x9'),_0x11cb('0xa'),_0x11cb('0xb'),_0x11cb('0xc'),_0x11cb('0xd'),_0x11cb('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x11cb('0x2')]},'permit':{'type':Sequelize[_0x11cb('0x2')]},'secret':{'type':Sequelize[_0x11cb('0x2')]},'md5secret':{'type':Sequelize[_0x11cb('0x2')]},'remotesecret':{'type':Sequelize[_0x11cb('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0xf'),'set':function(_0x337946){this[_0x11cb('0x10')](_0x11cb('0x11'),_0x337946?_0x337946['join'](','):null);},'get':function(){return this['getDataValue'](_0x11cb('0x11'))?this[_0x11cb('0x12')](_0x11cb('0x11'))[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0x11cb('0x15'),_0x11cb('0x16'),_0x11cb('0x17'),_0x11cb('0x18'),_0x11cb('0x19')),'defaultValue':_0x11cb('0x15')},'directmedia':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x1b'),_0x11cb('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x11cb('0x2')]},'directmediadeny':{'type':Sequelize[_0x11cb('0x2')]},'nat':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x1d'),'set':function(_0x1950c6){this[_0x11cb('0x10')]('nat',_0x1950c6?_0x1950c6[_0x11cb('0x1e')](','):null);},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x1f'))?this['getDataValue'](_0x11cb('0x1f'))[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x20')},'callgroup':{'type':Sequelize[_0x11cb('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x11cb('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x11cb('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x11cb('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0x21')},'allow':{'type':Sequelize[_0x11cb('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x34c206){this['setDataValue'](_0x11cb('0x22'),_0x34c206?_0x34c206[_0x11cb('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x22'))?this[_0x11cb('0x12')](_0x11cb('0x22'))[_0x11cb('0x13')](';'):null;},'comment':_0x11cb('0x23')},'autoframing':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0x24'),'set':function(_0x5154e0){this[_0x11cb('0x10')](_0x11cb('0x25'),_0x5154e0?_0x5154e0[_0x11cb('0x1e')](','):null);},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x25'))?this['getDataValue']('insecure')[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x26')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x11cb('0x2')]},'callerid':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x27')},'amaflags':{'type':Sequelize[_0x11cb('0x2')]},'callcounter':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':_0x11cb('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x11cb('0x2')]},'template':{'type':Sequelize[_0x11cb('0x2')]},'videosupport':{'type':Sequelize[_0x11cb('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x11cb('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x11cb('0x2')]},'session_timers':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x29'),'refuse',_0x11cb('0x2a'))},'session_expires':{'type':Sequelize[_0x11cb('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x11cb('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x11cb('0x4')]('uac','uas'),'defaultValue':_0x11cb('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x11cb('0x2')]},'regexten':{'type':Sequelize[_0x11cb('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x11cb('0x28')](0x5)},'qualify':{'type':Sequelize[_0x11cb('0x4')]('yes','no'),'defaultValue':_0x11cb('0x1a')},'keepalive':{'type':Sequelize[_0x11cb('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x11cb('0x2')]},'defaultuser':{'type':Sequelize[_0x11cb('0x2')]},'rtptimeout':{'type':Sequelize[_0x11cb('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x11cb('0x2')]},'callbackextension':{'type':Sequelize[_0x11cb('0x2')]},'timert1':{'type':Sequelize[_0x11cb('0x28')](0xb)},'timerb':{'type':Sequelize[_0x11cb('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x11cb('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x11cb('0x2')]},'contactdeny':{'type':Sequelize[_0x11cb('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x11cb('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x11cb('0x28')](0xb)},'encryption':{'type':Sequelize[_0x11cb('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x11cb('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x11cb('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x11cb('0x2')]},'dtlscafile':{'type':Sequelize[_0x11cb('0x2')]},'dtlscapath':{'type':Sequelize[_0x11cb('0x2')]},'dtlssetup':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x2d'),'passive',_0x11cb('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x11cb('0x2')]},'call_limit':{'type':Sequelize[_0x11cb('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x11cb('0x2')]},'mohsuggest':{'type':Sequelize[_0x11cb('0x2')]},'parkinglot':{'type':Sequelize[_0x11cb('0x2')]},'description':{'type':Sequelize[_0x11cb('0x2')]},'host':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x2f')},'canreinvite':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x1b'),_0x11cb('0x1c'),_0x11cb('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x11cb('0x2')]},'otherFields':{'type':Sequelize[_0x11cb('0x2')]},'active':{'type':Sequelize[_0x11cb('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6165=['getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','nonat','outgoing','nat','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join'];(function(_0x3cc29f,_0x353898){var _0x5609de=function(_0x1cb9ae){while(--_0x1cb9ae){_0x3cc29f['push'](_0x3cc29f['shift']());}};_0x5609de(++_0x353898);}(_0x6165,0x178));var _0x5616=function(_0x31be43,_0x563806){_0x31be43=_0x31be43-0x0;var _0x17d934=_0x6165[_0x31be43];return _0x17d934;};'use strict';var Sequelize=require(_0x5616('0x0'));module[_0x5616('0x1')]={'name':{'type':Sequelize[_0x5616('0x2')],'allowNull':![],'unique':_0x5616('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x5'),_0x5616('0x6'),_0x5616('0x7')),'allowNull':![],'defaultValue':_0x5616('0x5')},'context':{'type':Sequelize[_0x5616('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x5616('0x8'),'ALLOWED',_0x5616('0x9'),_0x5616('0xa'),_0x5616('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x5616('0x2')]},'permit':{'type':Sequelize[_0x5616('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x5616('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x5616('0x2')],'defaultValue':_0x5616('0xc'),'set':function(_0x7d74d4){this[_0x5616('0xd')](_0x5616('0xe'),_0x7d74d4?_0x7d74d4[_0x5616('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x5616('0xe'))?this[_0x5616('0x10')](_0x5616('0xe'))[_0x5616('0x11')](','):null;},'comment':_0x5616('0x12')},'dtmfmode':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x13'),_0x5616('0x14'),'shortinfo','inband','auto'),'defaultValue':_0x5616('0x13')},'directmedia':{'type':Sequelize[_0x5616('0x4')]('yes','no',_0x5616('0x15'),'update',_0x5616('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5616('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5616('0x2')]},'directmediadeny':{'type':Sequelize[_0x5616('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x50510b){this[_0x5616('0xd')]('nat',_0x50510b?_0x50510b[_0x5616('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x5616('0x17'))?this[_0x5616('0x10')](_0x5616('0x17'))[_0x5616('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x5616('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5616('0x2')]},'pickupgroup':{'type':Sequelize[_0x5616('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x5616('0x2')]},'language':{'type':Sequelize[_0x5616('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5616('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5616('0x2')],'defaultValue':_0x5616('0x18')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4914b7){this['setDataValue'](_0x5616('0x19'),_0x4914b7?_0x4914b7[_0x5616('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x5616('0x19'))?this[_0x5616('0x10')]('allow')[_0x5616('0x11')](';'):null;},'comment':_0x5616('0x1a')},'autoframing':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'insecure':{'type':Sequelize[_0x5616('0x2')],'defaultValue':_0x5616('0x1c'),'set':function(_0x25dcd8){this[_0x5616('0xd')](_0x5616('0x1d'),_0x25dcd8?_0x25dcd8[_0x5616('0xf')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue']('insecure')[_0x5616('0x11')](','):null;},'comment':_0x5616('0x1e')},'trustrpid':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no',_0x5616('0x1f'))},'promiscredir':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x5616('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x5616('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x5616('0x21')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x5616('0x4')]('yes','no'),'defaultValue':_0x5616('0x1b')},'busylevel':{'type':Sequelize[_0x5616('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x5616('0x2')]},'videosupport':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5616('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5616('0x4')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x22'),_0x5616('0x23'),_0x5616('0x24'))},'session_expires':{'type':Sequelize[_0x5616('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x5616('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x25'),_0x5616('0x26')),'defaultValue':_0x5616('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x5616('0x2')]},'regexten':{'type':Sequelize[_0x5616('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x5616('0x2')]},'port':{'type':Sequelize[_0x5616('0x20')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x5616('0x1b'),'no'),'defaultValue':_0x5616('0x1b')},'keepalive':{'type':Sequelize[_0x5616('0x20')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x5616('0x2')]},'rtptimeout':{'type':Sequelize[_0x5616('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5616('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5616('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no',_0x5616('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5616('0x2')]},'callbackextension':{'type':Sequelize[_0x5616('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x5616('0x20')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5616('0x2')]},'contactdeny':{'type':Sequelize[_0x5616('0x2')]},'contactacl':{'type':Sequelize[_0x5616('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x5616('0x2')]},'maxforwards':{'type':Sequelize[_0x5616('0x20')](0xb)},'encryption':{'type':Sequelize[_0x5616('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x5616('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x5616('0x1b'),'no',_0x5616('0x28'),_0x5616('0x29'))},'dtlsrekey':{'type':Sequelize[_0x5616('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x5616('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x5616('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x5616('0x2')]},'dtlscapath':{'type':Sequelize[_0x5616('0x2')]},'dtlssetup':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x2a'),_0x5616('0x2b'),_0x5616('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5616('0x2')]},'usereqphone':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5616('0x2')]},'recordofffeature':{'type':Sequelize[_0x5616('0x2')]},'call_limit':{'type':Sequelize[_0x5616('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x5616('0x4')](_0x5616('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x5616('0x2')]},'mohinterpret':{'type':Sequelize[_0x5616('0x2')]},'mohsuggest':{'type':Sequelize[_0x5616('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5616('0x2')]},'host':{'type':Sequelize[_0x5616('0x2')],'defaultValue':_0x5616('0x2d')},'canreinvite':{'type':Sequelize[_0x5616('0x4')]('yes','no','nonat',_0x5616('0x2e'),_0x5616('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5616('0x2')]},'otherFields':{'type':Sequelize[_0x5616('0x2')]},'active':{'type':Sequelize[_0x5616('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 8797638..cff24e4 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 _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x2dd795,_0x552445){var _0x1397b2=function(_0x32437a){while(--_0x32437a){_0x2dd795['push'](_0x2dd795['shift']());}};_0x1397b2(++_0x552445);}(_0xedd9,0xfc));var _0x9edd=function(_0x1756ed,_0x2b2d98){_0x1756ed=_0x1756ed-0x0;var _0x2b06e2=_0xedd9[_0x1756ed];return _0x2b06e2;};'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'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x136bc0,_0x56e162){var _0x513218=function(_0x5b1417){while(--_0x5b1417){_0x136bc0['push'](_0x136bc0['shift']());}};_0x513218(++_0x56e162);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x44d0e7,_0x2df9fd){_0x44d0e7=_0x44d0e7-0x0;var _0x2c8e97=_0xd6d6[_0x44d0e7];return _0x2c8e97;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0310995..444d5df 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 _0x31c2=['bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk','util','../../config/logger'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x31c2,0xd0));var _0x231c=function(_0x4f2756,_0x3fffa7){_0x4f2756=_0x4f2756-0x0;var _0x3ab0dd=_0x31c2[_0x4f2756];return _0x3ab0dd;};'use strict';var _=require('lodash');var util=require(_0x231c('0x0'));var logger=require(_0x231c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x231c('0x2'));var rp=require(_0x231c('0x3'));var fs=require('fs');var path=require(_0x231c('0x4'));var rimraf=require(_0x231c('0x5'));var config=require('../../config/environment');var attributes=require(_0x231c('0x6'));module[_0x231c('0x7')]=function(_0x344c6d,_0x55dc2d){return _0x344c6d[_0x231c('0x8')](_0x231c('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed96=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xed96,0x90));var _0x6ed9=function(_0x3eb926,_0x27e966){_0x3eb926=_0x3eb926-0x0;var _0x29460d=_0xed96[_0x3eb926];return _0x29460d;};'use strict';var _=require(_0x6ed9('0x0'));var util=require(_0x6ed9('0x1'));var logger=require('../../config/logger')(_0x6ed9('0x2'));var moment=require(_0x6ed9('0x3'));var BPromise=require(_0x6ed9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ed9('0x5'));var rimraf=require(_0x6ed9('0x6'));var config=require(_0x6ed9('0x7'));var attributes=require(_0x6ed9('0x8'));module[_0x6ed9('0x9')]=function(_0x129e88,_0x441755){return _0x129e88['define'](_0x6ed9('0xa'),attributes,{'tableName':_0x6ed9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 6c5a488..74dfc45 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 _0xd633=['Trunk','findAll','raw','options','where','attributes','limit','include','model','map','debug','stringify','ShowTrunk','find','then','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','catch','GetTrunk'];(function(_0x435592,_0x363aed){var _0x2d544d=function(_0x57dc9f){while(--_0x57dc9f){_0x435592['push'](_0x435592['shift']());}};_0x2d544d(++_0x363aed);}(_0xd633,0x1b3));var _0x3d63=function(_0x1124ea,_0x19e351){_0x1124ea=_0x1124ea-0x0;var _0x442d53=_0xd633[_0x1124ea];return _0x442d53;};'use strict';var _=require(_0x3d63('0x0'));var util=require(_0x3d63('0x1'));var moment=require(_0x3d63('0x2'));var BPromise=require(_0x3d63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d63('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d63('0x5'))(_0x3d63('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d63('0x7'));var client=jayson[_0x3d63('0x8')][_0x3d63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x517f85,_0xeec484,_0x1caf74){return new BPromise(function(_0x102896,_0x391ad4){return client['request'](_0x517f85,_0x1caf74)['then'](function(_0x45dab3){logger['info'](_0x3d63('0xa'),_0xeec484,'request\x20sent');logger['debug'](_0x3d63('0xb'),_0xeec484,'request\x20sent',JSON['stringify'](_0x45dab3));if(_0x45dab3['error']){if(_0x45dab3['error'][_0x3d63('0xc')]===0x1f4){logger[_0x3d63('0xd')]('Trunk,\x20%s,\x20%s',_0xeec484,_0x45dab3[_0x3d63('0xd')][_0x3d63('0xe')]);return _0x391ad4(_0x45dab3[_0x3d63('0xd')][_0x3d63('0xe')]);}logger[_0x3d63('0xd')](_0x3d63('0xa'),_0xeec484,_0x45dab3[_0x3d63('0xd')]['message']);return _0x102896(_0x45dab3[_0x3d63('0xd')]['message']);}else{logger[_0x3d63('0xf')](_0x3d63('0xa'),_0xeec484,_0x3d63('0x10'));_0x102896(_0x45dab3[_0x3d63('0x11')][_0x3d63('0xe')]);}})[_0x3d63('0x12')](function(_0x2bf6b4){logger[_0x3d63('0xd')]('Trunk,\x20%s,\x20%s',_0xeec484,_0x2bf6b4);_0x391ad4(_0x2bf6b4);});});}exports[_0x3d63('0x13')]=function(_0x4c6c39){var _0x2fc41c=this;return new Promise(function(_0x5d2b8e,_0x2d2ebb){return db[_0x3d63('0x14')][_0x3d63('0x15')]({'raw':_0x4c6c39['options']?_0x4c6c39['options'][_0x3d63('0x16')]===undefined?!![]:![]:!![],'where':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x18')]||null:null,'attributes':_0x4c6c39['options']?_0x4c6c39['options'][_0x3d63('0x19')]||null:null,'limit':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x1a')]||null:null,'include':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39['options'][_0x3d63('0x1b')]?_['map'](_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x1b')],function(_0x271618){return{'model':db[_0x271618[_0x3d63('0x1c')]],'as':_0x271618['as'],'attributes':_0x271618[_0x3d63('0x19')],'include':_0x271618[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x271618[_0x3d63('0x1b')],function(_0x48f6ea){return{'model':db[_0x48f6ea[_0x3d63('0x1c')]],'as':_0x48f6ea['as'],'attributes':_0x48f6ea[_0x3d63('0x19')],'include':_0x48f6ea[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x48f6ea[_0x3d63('0x1b')],function(_0x475e1a){return{'model':db[_0x475e1a[_0x3d63('0x1c')]],'as':_0x475e1a['as'],'attributes':_0x475e1a[_0x3d63('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x215b50){logger[_0x3d63('0xf')](_0x3d63('0x13'),_0x4c6c39);logger[_0x3d63('0x1e')](_0x3d63('0x13'),_0x4c6c39,JSON[_0x3d63('0x1f')](_0x215b50));_0x5d2b8e(_0x215b50);})['catch'](function(_0xe924c6){logger[_0x3d63('0xd')]('GetTrunk',_0xe924c6['message'],_0x4c6c39);_0x2d2ebb(_0x2fc41c[_0x3d63('0xd')](0x1f4,_0xe924c6[_0x3d63('0xe')]));});});};exports[_0x3d63('0x20')]=function(_0x2ae7e3){var _0x181b1d=this;return new Promise(function(_0x4a3535,_0x4a20a2){return db[_0x3d63('0x14')][_0x3d63('0x21')]({'raw':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x16')]===undefined?!![]:![]:!![],'where':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x18')]||null:null,'attributes':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x19')]||null:null,'include':_0x2ae7e3['options']?_0x2ae7e3[_0x3d63('0x17')]['include']?_[_0x3d63('0x1d')](_0x2ae7e3[_0x3d63('0x17')]['include'],function(_0x228c42){return{'model':db[_0x228c42[_0x3d63('0x1c')]],'as':_0x228c42['as'],'attributes':_0x228c42[_0x3d63('0x19')],'include':_0x228c42[_0x3d63('0x1b')]?_['map'](_0x228c42[_0x3d63('0x1b')],function(_0x45835f){return{'model':db[_0x45835f[_0x3d63('0x1c')]],'as':_0x45835f['as'],'attributes':_0x45835f['attributes'],'include':_0x45835f[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x45835f[_0x3d63('0x1b')],function(_0x5df4b9){return{'model':db[_0x5df4b9[_0x3d63('0x1c')]],'as':_0x5df4b9['as'],'attributes':_0x5df4b9[_0x3d63('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3d63('0x22')](function(_0x49ca0b){logger[_0x3d63('0xf')](_0x3d63('0x20'),_0x2ae7e3);logger[_0x3d63('0x1e')](_0x3d63('0x20'),_0x2ae7e3,JSON[_0x3d63('0x1f')](_0x49ca0b));_0x4a3535(_0x49ca0b);})['catch'](function(_0x5911b9){logger[_0x3d63('0xd')](_0x3d63('0x20'),_0x5911b9[_0x3d63('0xe')],_0x2ae7e3);_0x4a20a2(_0x181b1d[_0x3d63('0xd')](0x1f4,_0x5911b9['message']));});});}; \ No newline at end of file +var _0xde69=['jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','stringify','ShowTrunk','find','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x5f50b5,_0xa8db83){var _0x54c383=function(_0x381334){while(--_0x381334){_0x5f50b5['push'](_0x5f50b5['shift']());}};_0x54c383(++_0xa8db83);}(_0xde69,0x160));var _0x9de6=function(_0x5f0ecc,_0x36e3de){_0x5f0ecc=_0x5f0ecc-0x0;var _0x47b0ed=_0xde69[_0x5f0ecc];return _0x47b0ed;};'use strict';var _=require('lodash');var util=require(_0x9de6('0x0'));var moment=require('moment');var BPromise=require(_0x9de6('0x1'));var rs=require(_0x9de6('0x2'));var fs=require('fs');var Redis=require(_0x9de6('0x3'));var db=require(_0x9de6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9de6('0x5'))(_0x9de6('0x6'));var config=require(_0x9de6('0x7'));var jayson=require(_0x9de6('0x8'));var client=jayson[_0x9de6('0x9')][_0x9de6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad25d,_0x4f8d36,_0x16eb95){return new BPromise(function(_0x1f24bd,_0x1b7487){return client[_0x9de6('0xb')](_0x5ad25d,_0x16eb95)[_0x9de6('0xc')](function(_0x38ac30){logger[_0x9de6('0xd')](_0x9de6('0xe'),_0x4f8d36,_0x9de6('0xf'));logger[_0x9de6('0x10')](_0x9de6('0x11'),_0x4f8d36,_0x9de6('0xf'),JSON['stringify'](_0x38ac30));if(_0x38ac30[_0x9de6('0x12')]){if(_0x38ac30[_0x9de6('0x12')][_0x9de6('0x13')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x4f8d36,_0x38ac30[_0x9de6('0x12')][_0x9de6('0x14')]);return _0x1b7487(_0x38ac30[_0x9de6('0x12')][_0x9de6('0x14')]);}logger[_0x9de6('0x12')](_0x9de6('0xe'),_0x4f8d36,_0x38ac30['error'][_0x9de6('0x14')]);return _0x1f24bd(_0x38ac30['error']['message']);}else{logger[_0x9de6('0xd')](_0x9de6('0xe'),_0x4f8d36,_0x9de6('0xf'));_0x1f24bd(_0x38ac30[_0x9de6('0x15')][_0x9de6('0x14')]);}})[_0x9de6('0x16')](function(_0x1b51cb){logger[_0x9de6('0x12')](_0x9de6('0xe'),_0x4f8d36,_0x1b51cb);_0x1b7487(_0x1b51cb);});});}exports[_0x9de6('0x17')]=function(_0x4d0f20){var _0x5f366f=this;return new Promise(function(_0x1c59fe,_0x46ac6f){return db[_0x9de6('0x18')][_0x9de6('0x19')]({'raw':_0x4d0f20['options']?_0x4d0f20[_0x9de6('0x1a')][_0x9de6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d0f20[_0x9de6('0x1a')]?_0x4d0f20[_0x9de6('0x1a')][_0x9de6('0x1c')]||null:null,'attributes':_0x4d0f20['options']?_0x4d0f20[_0x9de6('0x1a')][_0x9de6('0x1d')]||null:null,'limit':_0x4d0f20['options']?_0x4d0f20[_0x9de6('0x1a')]['limit']||null:null,'include':_0x4d0f20[_0x9de6('0x1a')]?_0x4d0f20[_0x9de6('0x1a')][_0x9de6('0x1e')]?_[_0x9de6('0x1f')](_0x4d0f20['options'][_0x9de6('0x1e')],function(_0xbec19a){return{'model':db[_0xbec19a['model']],'as':_0xbec19a['as'],'attributes':_0xbec19a[_0x9de6('0x1d')],'include':_0xbec19a[_0x9de6('0x1e')]?_[_0x9de6('0x1f')](_0xbec19a['include'],function(_0x5d2b27){return{'model':db[_0x5d2b27['model']],'as':_0x5d2b27['as'],'attributes':_0x5d2b27[_0x9de6('0x1d')],'include':_0x5d2b27[_0x9de6('0x1e')]?_[_0x9de6('0x1f')](_0x5d2b27[_0x9de6('0x1e')],function(_0x64f1c2){return{'model':db[_0x64f1c2['model']],'as':_0x64f1c2['as'],'attributes':_0x64f1c2['attributes']};}):[]};}):[]};}):[]:[]})[_0x9de6('0xc')](function(_0x4ebe09){logger[_0x9de6('0xd')](_0x9de6('0x17'),_0x4d0f20);logger[_0x9de6('0x10')](_0x9de6('0x17'),_0x4d0f20,JSON[_0x9de6('0x20')](_0x4ebe09));_0x1c59fe(_0x4ebe09);})[_0x9de6('0x16')](function(_0x6ad46f){logger[_0x9de6('0x12')](_0x9de6('0x17'),_0x6ad46f[_0x9de6('0x14')],_0x4d0f20);_0x46ac6f(_0x5f366f[_0x9de6('0x12')](0x1f4,_0x6ad46f[_0x9de6('0x14')]));});});};exports[_0x9de6('0x21')]=function(_0x27a92a){var _0xa2e2bc=this;return new Promise(function(_0x4c1caa,_0x4fc08a){return db[_0x9de6('0x18')][_0x9de6('0x22')]({'raw':_0x27a92a[_0x9de6('0x1a')]?_0x27a92a[_0x9de6('0x1a')][_0x9de6('0x1b')]===undefined?!![]:![]:!![],'where':_0x27a92a[_0x9de6('0x1a')]?_0x27a92a[_0x9de6('0x1a')][_0x9de6('0x1c')]||null:null,'attributes':_0x27a92a[_0x9de6('0x1a')]?_0x27a92a[_0x9de6('0x1a')]['attributes']||null:null,'include':_0x27a92a[_0x9de6('0x1a')]?_0x27a92a[_0x9de6('0x1a')][_0x9de6('0x1e')]?_[_0x9de6('0x1f')](_0x27a92a['options'][_0x9de6('0x1e')],function(_0x194475){return{'model':db[_0x194475[_0x9de6('0x23')]],'as':_0x194475['as'],'attributes':_0x194475['attributes'],'include':_0x194475[_0x9de6('0x1e')]?_[_0x9de6('0x1f')](_0x194475[_0x9de6('0x1e')],function(_0x703baf){return{'model':db[_0x703baf['model']],'as':_0x703baf['as'],'attributes':_0x703baf[_0x9de6('0x1d')],'include':_0x703baf['include']?_[_0x9de6('0x1f')](_0x703baf[_0x9de6('0x1e')],function(_0x51b33d){return{'model':db[_0x51b33d[_0x9de6('0x23')]],'as':_0x51b33d['as'],'attributes':_0x51b33d[_0x9de6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9de6('0xc')](function(_0x40cf07){logger[_0x9de6('0xd')]('ShowTrunk',_0x27a92a);logger[_0x9de6('0x10')]('ShowTrunk',_0x27a92a,JSON['stringify'](_0x40cf07));_0x4c1caa(_0x40cf07);})[_0x9de6('0x16')](function(_0x259216){logger[_0x9de6('0x12')](_0x9de6('0x21'),_0x259216['message'],_0x27a92a);_0x4fc08a(_0xa2e2bc[_0x9de6('0x12')](0x1f4,_0x259216[_0x9de6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5ec45f0..cbeb01d 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 _0x2df9=['Router','../../components/auth/service','./user-setting.controller','/:id','exports','express'];(function(_0x5bceb8,_0x1714ff){var _0x441f32=function(_0x33823e){while(--_0x33823e){_0x5bceb8['push'](_0x5bceb8['shift']());}};_0x441f32(++_0x1714ff);}(_0x2df9,0x113));var _0x92df=function(_0x250635,_0x2f621b){_0x250635=_0x250635-0x0;var _0x4f0688=_0x2df9[_0x250635];return _0x4f0688;};'use strict';var express=require(_0x92df('0x0'));var router=express[_0x92df('0x1')]();var auth=require(_0x92df('0x2'));var controller=require(_0x92df('0x3'));router['put'](_0x92df('0x4'),auth['isAuthenticated'](),controller['update']);module[_0x92df('0x5')]=router; \ No newline at end of file +var _0xd29a=['update','express','Router','../../components/auth/service','./user-setting.controller','put','isAuthenticated'];(function(_0xf4770b,_0xe68669){var _0x4a672b=function(_0x5a8971){while(--_0x5a8971){_0xf4770b['push'](_0xf4770b['shift']());}};_0x4a672b(++_0xe68669);}(_0xd29a,0xa2));var _0xad29=function(_0x4735ed,_0x43c9cc){_0x4735ed=_0x4735ed-0x0;var _0x394889=_0xd29a[_0x4735ed];return _0x394889;};'use strict';var express=require(_0xad29('0x0'));var router=express[_0xad29('0x1')]();var auth=require(_0xad29('0x2'));var controller=require(_0xad29('0x3'));router[_0xad29('0x4')]('/:id',auth[_0xad29('0x5')](),controller[_0xad29('0x6')]);module['exports']=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 5d9ab62..ea67b53 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 _0x803d=['warning','info','debug','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x326722,_0x299750){var _0x3327a9=function(_0x4ad025){while(--_0x4ad025){_0x326722['push'](_0x326722['shift']());}};_0x3327a9(++_0x299750);}(_0x803d,0x13d));var _0xd803=function(_0x2ccf50,_0x258a8c){_0x2ccf50=_0x2ccf50-0x0;var _0x5e0c68=_0x803d[_0x2ccf50];return _0x5e0c68;};'use strict';var Sequelize=require(_0xd803('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd803('0x1'),_0xd803('0x2'),_0xd803('0x3'),_0xd803('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xd803('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd803('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd803('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd803('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd803('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd803('0x9')],'unique':_0xd803('0xa')}}; \ No newline at end of file +var _0x3abb=['warning','info','debug','exports','error','BOOLEAN','TEXT','DATE','INTEGER','sequelize'];(function(_0x375984,_0x1815d2){var _0x5b5e47=function(_0x383ee8){while(--_0x383ee8){_0x375984['push'](_0x375984['shift']());}};_0x5b5e47(++_0x1815d2);}(_0x3abb,0x17b));var _0xb3ab=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x3abb[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0xb3ab('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xb3ab('0x1'),_0xb3ab('0x2'),_0xb3ab('0x3')];module[_0xb3ab('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xb3ab('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb3ab('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb3ab('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb3ab('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb3ab('0x9')],'unique':'UserId'}}; \ 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 2bd0e76..b60067a 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 _0x3fec=['status','json','update','then','sendStatus','stack','name','send','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','body','catch','lodash','api','../../config/environment','socket.io-emitter','register','defaults','redis','localhost'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc3fe('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xc3fe('0x1'));var config=require(_0xc3fe('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0xc3fe('0x3'))(new Redis(config['redis']));require('./user-setting.socket')[_0xc3fe('0x4')](socket);config['redis']=_[_0xc3fe('0x5')](config[_0xc3fe('0x6')],{'host':_0xc3fe('0x7'),'port':0x18eb});function respondWithResult(_0x1ae20f,_0xf96362){_0xf96362=_0xf96362||0xc8;return function(_0x43a9a9){if(_0x43a9a9){return _0x1ae20f[_0xc3fe('0x8')](_0xf96362)[_0xc3fe('0x9')](_0x43a9a9);}};}function saveUpdates(_0x25b1eb){return function(_0x17dbcb){if(_0x17dbcb){return _0x17dbcb[_0xc3fe('0xa')](_0x25b1eb)[_0xc3fe('0xb')](function(_0x2852c9){return _0x2852c9;});}return null;};}function handleEntityNotFound(_0x3ffe1a){return function(_0x22f543){if(!_0x22f543){_0x3ffe1a[_0xc3fe('0xc')](0x194);}return _0x22f543;};}function handleError(_0x5b166d,_0x3100bd){_0x3100bd=_0x3100bd||0x1f4;return function(_0x144702){logger['error'](_0x144702[_0xc3fe('0xd')]);if(_0x144702[_0xc3fe('0xe')]){delete _0x144702[_0xc3fe('0xe')];}_0x5b166d[_0xc3fe('0x8')](_0x3100bd)[_0xc3fe('0xf')](_0x144702);};}exports[_0xc3fe('0xa')]=function(_0x1ac4d7,_0x7d5e67){if(_0x1ac4d7[_0xc3fe('0x10')][_0xc3fe('0x11')]!=='admin')throw new Error(_0xc3fe('0x12'));if(isNaN(Number(_0x1ac4d7['params']['id'])))throw new Error(_0xc3fe('0x13'));return db[_0xc3fe('0x14')][_0xc3fe('0x15')]({'where':{'id':_0x1ac4d7[_0xc3fe('0x16')]['id']}})[_0xc3fe('0xb')](handleEntityNotFound(_0x7d5e67,null))[_0xc3fe('0xb')](saveUpdates(_0x1ac4d7[_0xc3fe('0x17')],null))[_0xc3fe('0xb')](respondWithResult(_0x7d5e67,null))[_0xc3fe('0x18')](handleError(_0x7d5e67,null));}; \ No newline at end of file +var _0x28aa=['admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','send','user','role'];(function(_0x32c0c9,_0x40cb27){var _0x908e05=function(_0x4c2089){while(--_0x4c2089){_0x32c0c9['push'](_0x32c0c9['shift']());}};_0x908e05(++_0x40cb27);}(_0x28aa,0xf8));var _0xa28a=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x28aa[_0x18a79d];return _0x4f8848;};'use strict';var _=require('lodash');var Redis=require(_0xa28a('0x0'));var logger=require(_0xa28a('0x1'))(_0xa28a('0x2'));var config=require(_0xa28a('0x3'));var db=require(_0xa28a('0x4'))['db'];var socket=require(_0xa28a('0x5'))(new Redis(config['redis']));require(_0xa28a('0x6'))[_0xa28a('0x7')](socket);config[_0xa28a('0x8')]=_[_0xa28a('0x9')](config['redis'],{'host':_0xa28a('0xa'),'port':0x18eb});function respondWithResult(_0x33cda2,_0x150568){_0x150568=_0x150568||0xc8;return function(_0x1d2e08){if(_0x1d2e08){return _0x33cda2[_0xa28a('0xb')](_0x150568)[_0xa28a('0xc')](_0x1d2e08);}};}function saveUpdates(_0x2ab985){return function(_0x102a61){if(_0x102a61){return _0x102a61[_0xa28a('0xd')](_0x2ab985)[_0xa28a('0xe')](function(_0x3e8701){return _0x3e8701;});}return null;};}function handleEntityNotFound(_0xc23755){return function(_0x19a508){if(!_0x19a508){_0xc23755[_0xa28a('0xf')](0x194);}return _0x19a508;};}function handleError(_0x1d0a82,_0x5b3abd){_0x5b3abd=_0x5b3abd||0x1f4;return function(_0x1c223c){logger[_0xa28a('0x10')](_0x1c223c[_0xa28a('0x11')]);if(_0x1c223c[_0xa28a('0x12')]){delete _0x1c223c['name'];}_0x1d0a82[_0xa28a('0xb')](_0x5b3abd)[_0xa28a('0x13')](_0x1c223c);};}exports['update']=function(_0x500cef,_0x3350d6){if(_0x500cef[_0xa28a('0x14')][_0xa28a('0x15')]!==_0xa28a('0x16'))throw new Error(_0xa28a('0x17'));if(isNaN(Number(_0x500cef[_0xa28a('0x18')]['id'])))throw new Error(_0xa28a('0x19'));return db[_0xa28a('0x1a')][_0xa28a('0x1b')]({'where':{'id':_0x500cef['params']['id']}})[_0xa28a('0xe')](handleEntityNotFound(_0x3350d6,null))[_0xa28a('0xe')](saveUpdates(_0x500cef[_0xa28a('0x1c')],null))['then'](respondWithResult(_0x3350d6,null))[_0xa28a('0x1d')](handleError(_0x3350d6,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 c245927..560a105 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 _0xbdf8=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0xbdf8,0x144));var _0x8bdf=function(_0x42838e,_0x2a0689){_0x42838e=_0x42838e-0x0;var _0x3c04e1=_0xbdf8[_0x42838e];return _0x3c04e1;};'use strict';var EventEmitter=require(_0x8bdf('0x0'));var UserSetting=require(_0x8bdf('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8bdf('0x2')](0x0);var events={'afterCreate':_0x8bdf('0x3'),'afterUpdate':_0x8bdf('0x4'),'afterDestroy':_0x8bdf('0x5')};function emitEvent(_0x23d11f){return function(_0x28a337,_0x12443f,_0x37080a){UserSettingEvents[_0x8bdf('0x6')](_0x23d11f+':'+_0x28a337['id'],_0x28a337);UserSettingEvents['emit'](_0x23d11f,_0x28a337);_0x37080a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x8bdf('0x7')](e,emitEvent(event));}}module[_0x8bdf('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x2015=['emit','hasOwnProperty','events','UserSetting','setMaxListeners','save','update','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2015,0x122));var _0x5201=function(_0x128cfd,_0x14c32b){_0x128cfd=_0x128cfd-0x0;var _0x375d19=_0x2015[_0x128cfd];return _0x375d19;};'use strict';var EventEmitter=require(_0x5201('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x5201('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x5201('0x2')](0x0);var events={'afterCreate':_0x5201('0x3'),'afterUpdate':_0x5201('0x4'),'afterDestroy':_0x5201('0x5')};function emitEvent(_0x10ba98){return function(_0x52e899,_0x2a4ecd,_0x4a50ea){UserSettingEvents[_0x5201('0x6')](_0x10ba98+':'+_0x52e899['id'],_0x52e899);UserSettingEvents[_0x5201('0x6')](_0x10ba98,_0x52e899);_0x4a50ea(null);};}for(var e in events){if(events[_0x5201('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=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 fb05192..fffaeac 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 _0xf290=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define','user_settings'];(function(_0x2f7d20,_0x3f8989){var _0x4e00fe=function(_0x3207ed){while(--_0x3207ed){_0x2f7d20['push'](_0x2f7d20['shift']());}};_0x4e00fe(++_0x3f8989);}(_0xf290,0xde));var _0x0f29=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xf290[_0x3dfeb9];return _0x412314;};'use strict';var attributes=require('./user-setting.attributes');module[_0x0f29('0x0')]=function(_0x550692){return _0x550692[_0x0f29('0x1')]('UserSetting',attributes,{'tableName':_0x0f29('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b4f85){if(!_0x1b4f85[_0x0f29('0x3')])_0x1b4f85[_0x0f29('0x4')]=null;else if(_0x1b4f85[_0x0f29('0x4')]===null)_0x1b4f85['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xa477=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xa477,0xe6));var _0x7a47=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa477[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x7a47('0x0'));module[_0x7a47('0x1')]=function(_0x576699){return _0x576699[_0x7a47('0x2')](_0x7a47('0x3'),attributes,{'tableName':_0x7a47('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19697b){if(!_0x19697b[_0x7a47('0x5')])_0x19697b[_0x7a47('0x6')]=null;else if(_0x19697b[_0x7a47('0x6')]===null)_0x19697b['clientSideLoggingEnabledSince']=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 fa508e1..3731a69 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 _0xebe6=['register','length','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x288285,_0x222a9e){var _0x1d1328=function(_0x3d78f6){while(--_0x3d78f6){_0x288285['push'](_0x288285['shift']());}};_0x1d1328(++_0x222a9e);}(_0xebe6,0x13a));var _0x6ebe=function(_0x5229bb,_0x4b17f5){_0x5229bb=_0x5229bb-0x0;var _0x15db9b=_0xebe6[_0x5229bb];return _0x15db9b;};'use strict';var UserSettingEvents=require(_0x6ebe('0x0'));var events=[_0x6ebe('0x1'),_0x6ebe('0x2'),_0x6ebe('0x3')];function createListener(_0x229b70,_0x12699e){return function(_0x80db7b){_0x12699e[_0x6ebe('0x4')](_0x229b70,_0x80db7b);if(_0x229b70===_0x6ebe('0x5')){_0x12699e[_0x6ebe('0x4')]('user-setting:update:user-'+_0x80db7b['UserId'],_0x80db7b);}};}exports[_0x6ebe('0x6')]=function(_0x2a63a5){for(var _0x1226b9=0x0,_0x19b9dc=events[_0x6ebe('0x7')];_0x1226b9<_0x19b9dc;_0x1226b9++){var _0x4f8750=events[_0x1226b9];var _0x3cd02f=createListener('user-setting:'+_0x4f8750,_0x2a63a5);UserSettingEvents['on'](_0x4f8750,_0x3cd02f);}}; \ No newline at end of file +var _0x0b63=['update','user-setting:update','emit','user-setting:update:user-','UserId','register','user-setting:','./user-setting.events'];(function(_0x280049,_0xf27818){var _0x511486=function(_0x4984ee){while(--_0x4984ee){_0x280049['push'](_0x280049['shift']());}};_0x511486(++_0xf27818);}(_0x0b63,0xe7));var _0x30b6=function(_0x5aedb3,_0x42c1be){_0x5aedb3=_0x5aedb3-0x0;var _0x35ec9c=_0x0b63[_0x5aedb3];return _0x35ec9c;};'use strict';var UserSettingEvents=require(_0x30b6('0x0'));var events=['save','remove',_0x30b6('0x1')];function createListener(_0x862463,_0x4023ed){return function(_0x13ecc9){_0x4023ed['emit'](_0x862463,_0x13ecc9);if(_0x862463===_0x30b6('0x2')){_0x4023ed[_0x30b6('0x3')](_0x30b6('0x4')+_0x13ecc9[_0x30b6('0x5')],_0x13ecc9);}};}exports[_0x30b6('0x6')]=function(_0x2fddeb){for(var _0x4fb35e=0x0,_0x11a637=events['length'];_0x4fb35e<_0x11a637;_0x4fb35e++){var _0x4488c6=events[_0x4fb35e];var _0x4eb0af=createListener(_0x30b6('0x7')+_0x4488c6,_0x2fddeb);UserSettingEvents['on'](_0x4488c6,_0x4eb0af);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 3c54ba0..c140ad7 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 _0xe148=['addContacts','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','update','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post'];(function(_0x32a2aa,_0x1c032d){var _0x3c0e61=function(_0x1b97af){while(--_0x1b97af){_0x32a2aa['push'](_0x32a2aa['shift']());}};_0x3c0e61(++_0x1c032d);}(_0xe148,0x109));var _0x8e14=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0xe148[_0x671369];return _0x33f2b4;};'use strict';var multer=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var path=require(_0x8e14('0x2'));var timeout=require(_0x8e14('0x3'));var express=require(_0x8e14('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e14('0x5'));var interaction=require(_0x8e14('0x6'));var config=require(_0x8e14('0x7'));var controller=require(_0x8e14('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8e14('0x9')](_0x8e14('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8e14('0x9')]('/whoami',auth[_0x8e14('0xb')](),controller[_0x8e14('0xc')]);router[_0x8e14('0x9')](_0x8e14('0xd'),auth[_0x8e14('0xb')](),controller[_0x8e14('0xe')]);router[_0x8e14('0x9')](_0x8e14('0xf'),auth['isAuthenticated'](),controller[_0x8e14('0x10')]);router['get'](_0x8e14('0x11'),controller[_0x8e14('0x12')]);router[_0x8e14('0x9')](_0x8e14('0x13'),auth[_0x8e14('0xb')](),controller['getOpenTabs']);router[_0x8e14('0x9')](_0x8e14('0x14'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x15')]);router['get'](_0x8e14('0x16'),auth['isAuthenticated'](),controller[_0x8e14('0x17')]);router[_0x8e14('0x9')](_0x8e14('0x18'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x19')]);router['get']('/:id/groups',auth[_0x8e14('0xb')](),controller['getGroups']);router[_0x8e14('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x8e14('0x1a')]);router[_0x8e14('0x9')](_0x8e14('0x1b'),auth[_0x8e14('0xb')](),controller['getScreenRecordings']);router[_0x8e14('0x9')](_0x8e14('0x1c'),auth[_0x8e14('0xb')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0x8e14('0xb')](),controller['getOpenchannelInteractions']);router['get'](_0x8e14('0x1d'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x1e')]);router[_0x8e14('0x9')](_0x8e14('0x1f'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x8e14('0x9')](_0x8e14('0x20'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x21')]);router[_0x8e14('0x9')](_0x8e14('0x22'),auth[_0x8e14('0xb')](),controller['getWhatsappInteractions']);router[_0x8e14('0x9')](_0x8e14('0x23'),auth[_0x8e14('0xb')](),controller['getTeams']);router[_0x8e14('0x9')](_0x8e14('0x24'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x25')]);router[_0x8e14('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0x8e14('0x26')]);router[_0x8e14('0x9')]('/:id/prefixes',auth[_0x8e14('0xb')](),controller[_0x8e14('0x27')]);router['get']('/:id/fax_accounts',auth[_0x8e14('0xb')](),controller['getFaxAccounts']);router[_0x8e14('0x9')](_0x8e14('0x28'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x29')]);router[_0x8e14('0x9')](_0x8e14('0x2a'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2b')]);router[_0x8e14('0x9')](_0x8e14('0x2c'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2d')]);router[_0x8e14('0x9')](_0x8e14('0x2e'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2f')]);router['get'](_0x8e14('0x30'),auth[_0x8e14('0xb')](),controller['getWhatsappAccounts']);router[_0x8e14('0x9')](_0x8e14('0x31'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x32')]);router[_0x8e14('0x9')](_0x8e14('0x33'),auth[_0x8e14('0xb')](),controller['getApiKey']);router[_0x8e14('0x34')](_0x8e14('0x14'),auth['isAuthenticated'](),controller[_0x8e14('0x35')]);router['post']('/',auth[_0x8e14('0xb')](),controller['create']);router[_0x8e14('0x34')](_0x8e14('0x36'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x37')]);router[_0x8e14('0x34')](_0x8e14('0x16'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x38')]);var upload=multer({'storage':multer[_0x8e14('0x39')]({'destination':function(_0x8f4afc,_0x48c018,_0x3aae16){_0x3aae16(null,path['join'](config[_0x8e14('0x3a')],_0x8e14('0x3b')));},'filename':function(_0xf84bf3,_0x23d577,_0x4344d4){_0x4344d4(null,util[_0x8e14('0x3c')](_0x8e14('0x3d'),Date[_0x8e14('0x3e')](),_0x23d577['originalname']));}})});router[_0x8e14('0x34')](_0x8e14('0x11'),upload[_0x8e14('0x3f')]('file'),controller[_0x8e14('0x40')]);router[_0x8e14('0x34')](_0x8e14('0x41'),auth['isAuthenticated'](),controller['login']);router[_0x8e14('0x34')](_0x8e14('0x42'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x43')]);router[_0x8e14('0x34')](_0x8e14('0x44'),auth['isAuthenticated'](),controller[_0x8e14('0x45')]);router[_0x8e14('0x34')](_0x8e14('0x46'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x47')]);router[_0x8e14('0x34')](_0x8e14('0x23'),auth['isAuthenticated'](),controller[_0x8e14('0x48')]);router['post'](_0x8e14('0x49'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x4a')]);router['post'](_0x8e14('0x4b'),auth[_0x8e14('0xb')](),controller['addMailInteractions']);router[_0x8e14('0x34')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x8e14('0x34')]('/:id/sms_interactions',auth[_0x8e14('0xb')](),controller[_0x8e14('0x4c')]);router[_0x8e14('0x34')](_0x8e14('0x4d'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x4e')]);router[_0x8e14('0x34')](_0x8e14('0x4f'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x50')]);router[_0x8e14('0x34')]('/:id/fax_accounts',auth[_0x8e14('0xb')](),controller['addFaxAccounts']);router[_0x8e14('0x34')](_0x8e14('0x28'),auth[_0x8e14('0xb')](),controller['addMailAccounts']);router['post'](_0x8e14('0x2a'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x51')]);router['post'](_0x8e14('0x2c'),auth['isAuthenticated'](),controller[_0x8e14('0x52')]);router[_0x8e14('0x34')](_0x8e14('0x2e'),auth['isAuthenticated'](),controller[_0x8e14('0x53')]);router[_0x8e14('0x34')](_0x8e14('0x30'),auth['isAuthenticated'](),controller[_0x8e14('0x54')]);router[_0x8e14('0x34')](_0x8e14('0x33'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0x8e14('0xf'),auth['isAuthenticated'](),controller[_0x8e14('0x55')]);router[_0x8e14('0x56')](_0x8e14('0x57'),auth['isAuthenticated'](),controller['changePassword']);router[_0x8e14('0x58')](_0x8e14('0x16'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x59')]);router[_0x8e14('0x58')](_0x8e14('0x23'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5a')]);router[_0x8e14('0x58')]('/:id',auth[_0x8e14('0xb')](),controller[_0x8e14('0x5b')]);router[_0x8e14('0x58')](_0x8e14('0x49'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5c')]);router[_0x8e14('0x58')](_0x8e14('0x4b'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5d')]);router[_0x8e14('0x58')](_0x8e14('0x5e'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5f')]);router[_0x8e14('0x58')](_0x8e14('0x60'),auth['isAuthenticated'](),controller[_0x8e14('0x61')]);router[_0x8e14('0x58')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x8e14('0x62')]);router[_0x8e14('0x58')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x8e14('0x58')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x8e14('0x63')]);router[_0x8e14('0x58')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x8e14('0x64')]);router['delete']('/:id/openchannel_accounts',auth[_0x8e14('0xb')](),controller[_0x8e14('0x65')]);router[_0x8e14('0x58')]('/:id/sms_accounts',auth[_0x8e14('0xb')](),controller[_0x8e14('0x66')]);router[_0x8e14('0x58')](_0x8e14('0x2e'),auth['isAuthenticated'](),controller[_0x8e14('0x67')]);router[_0x8e14('0x58')](_0x8e14('0x30'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x68')]);router['delete'](_0x8e14('0x33'),auth[_0x8e14('0xb')](),controller['removeApiKey']);module[_0x8e14('0x69')]=router; \ No newline at end of file +var _0xe1ee=['put','/:id','update','/:id/password','changePassword','removeQueues','delete','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','whoami','getPresence','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','/create_many','addQueues','join','root','server/files/images/','%s-%s','now','originalname','single','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey'];(function(_0x9d5a92,_0x34875d){var _0x3d84f2=function(_0x4bde89){while(--_0x4bde89){_0x9d5a92['push'](_0x9d5a92['shift']());}};_0x3d84f2(++_0x34875d);}(_0xe1ee,0x158));var _0xee1e=function(_0xecb7da,_0x1bcc50){_0xecb7da=_0xecb7da-0x0;var _0x571c35=_0xe1ee[_0xecb7da];return _0x571c35;};'use strict';var multer=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var path=require('path');var timeout=require(_0xee1e('0x2'));var express=require(_0xee1e('0x3'));var router=express['Router']();var fs_extra=require(_0xee1e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee1e('0x5'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0xee1e('0x6')]('/',auth[_0xee1e('0x7')](),controller[_0xee1e('0x8')]);router[_0xee1e('0x6')]('/describe',auth[_0xee1e('0x7')](),controller['describe']);router['get']('/whoami',auth[_0xee1e('0x7')](),controller[_0xee1e('0x9')]);router[_0xee1e('0x6')]('/presence',auth['isAuthenticated'](),controller[_0xee1e('0xa')]);router[_0xee1e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xee1e('0xb')]);router[_0xee1e('0x6')](_0xee1e('0xc'),controller[_0xee1e('0xd')]);router[_0xee1e('0x6')]('/:id/open_tabs',auth[_0xee1e('0x7')](),controller[_0xee1e('0xe')]);router[_0xee1e('0x6')](_0xee1e('0xf'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x10')]);router['get'](_0xee1e('0x11'),auth['isAuthenticated'](),controller[_0xee1e('0x12')]);router['get'](_0xee1e('0x13'),auth['isAuthenticated'](),controller[_0xee1e('0x14')]);router[_0xee1e('0x6')](_0xee1e('0x15'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x16')]);router[_0xee1e('0x6')](_0xee1e('0x17'),auth['isAuthenticated'](),controller[_0xee1e('0x18')]);router[_0xee1e('0x6')](_0xee1e('0x19'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x1a')]);router[_0xee1e('0x6')](_0xee1e('0x1b'),auth['isAuthenticated'](),controller[_0xee1e('0x1c')]);router[_0xee1e('0x6')]('/:id/openchannel/interactions',auth[_0xee1e('0x7')](),controller[_0xee1e('0x1d')]);router['get'](_0xee1e('0x1e'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x1f')]);router[_0xee1e('0x6')](_0xee1e('0x20'),auth[_0xee1e('0x7')](),controller['getSmsInteractions']);router[_0xee1e('0x6')](_0xee1e('0x21'),auth[_0xee1e('0x7')](),controller['getFaxInteractions']);router[_0xee1e('0x6')](_0xee1e('0x22'),auth[_0xee1e('0x7')](),controller['getWhatsappInteractions']);router['get'](_0xee1e('0x23'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x24')]);router[_0xee1e('0x6')](_0xee1e('0x25'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x26')]);router[_0xee1e('0x6')](_0xee1e('0x27'),auth[_0xee1e('0x7')](),controller['getAgents']);router[_0xee1e('0x6')]('/:id/prefixes',auth[_0xee1e('0x7')](),controller[_0xee1e('0x28')]);router[_0xee1e('0x6')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xee1e('0x29')]);router[_0xee1e('0x6')]('/:id/mail_accounts',auth[_0xee1e('0x7')](),controller[_0xee1e('0x2a')]);router['get'](_0xee1e('0x2b'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x2c')]);router[_0xee1e('0x6')]('/:id/sms_accounts',auth[_0xee1e('0x7')](),controller[_0xee1e('0x2d')]);router[_0xee1e('0x6')](_0xee1e('0x2e'),auth[_0xee1e('0x7')](),controller['getChatWebsites']);router[_0xee1e('0x6')](_0xee1e('0x2f'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x30')]);router[_0xee1e('0x6')](_0xee1e('0x31'),auth['isAuthenticated'](),controller[_0xee1e('0x32')]);router[_0xee1e('0x6')](_0xee1e('0x33'),auth[_0xee1e('0x7')](),controller['getApiKey']);router[_0xee1e('0x34')](_0xee1e('0xf'),auth['isAuthenticated'](),controller[_0xee1e('0x35')]);router[_0xee1e('0x34')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xee1e('0x36'),auth[_0xee1e('0x7')](),controller['bulkCreate']);router[_0xee1e('0x34')](_0xee1e('0x11'),auth['isAuthenticated'](),controller[_0xee1e('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1aa62e,_0x2a1a50,_0x40f389){_0x40f389(null,path[_0xee1e('0x38')](config[_0xee1e('0x39')],_0xee1e('0x3a')));},'filename':function(_0x509923,_0x2041d9,_0x273b42){_0x273b42(null,util['format'](_0xee1e('0x3b'),Date[_0xee1e('0x3c')](),_0x2041d9[_0xee1e('0x3d')]));}})});router['post'](_0xee1e('0xc'),upload[_0xee1e('0x3e')](_0xee1e('0x3f')),controller['addAvatar']);router['post']('/:id/login',auth[_0xee1e('0x7')](),controller[_0xee1e('0x40')]);router[_0xee1e('0x34')](_0xee1e('0x41'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x42')]);router[_0xee1e('0x34')](_0xee1e('0x43'),auth['isAuthenticated'](),controller[_0xee1e('0x44')]);router['post'](_0xee1e('0x45'),auth[_0xee1e('0x7')](),controller['unpause']);router[_0xee1e('0x34')](_0xee1e('0x23'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x46')]);router[_0xee1e('0x34')](_0xee1e('0x47'),auth[_0xee1e('0x7')](),controller['addChatInteractions']);router['post'](_0xee1e('0x48'),auth[_0xee1e('0x7')](),controller['addMailInteractions']);router[_0xee1e('0x34')](_0xee1e('0x49'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x4a')]);router[_0xee1e('0x34')](_0xee1e('0x4b'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x4c')]);router['post']('/:id/openchannel_interactions',auth[_0xee1e('0x7')](),controller[_0xee1e('0x4d')]);router['post'](_0xee1e('0x4e'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x4f')]);router['post']('/:id/fax_accounts',auth[_0xee1e('0x7')](),controller[_0xee1e('0x50')]);router[_0xee1e('0x34')](_0xee1e('0x51'),auth[_0xee1e('0x7')](),controller['addMailAccounts']);router['post'](_0xee1e('0x2b'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x52')]);router[_0xee1e('0x34')](_0xee1e('0x53'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x54')]);router[_0xee1e('0x34')](_0xee1e('0x2e'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x55')]);router[_0xee1e('0x34')]('/:id/whatsapp_accounts',auth[_0xee1e('0x7')](),controller[_0xee1e('0x56')]);router[_0xee1e('0x34')](_0xee1e('0x33'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x57')]);router[_0xee1e('0x58')](_0xee1e('0x59'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x5a')]);router[_0xee1e('0x58')](_0xee1e('0x5b'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x5c')]);router['delete'](_0xee1e('0x11'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x5d')]);router[_0xee1e('0x5e')](_0xee1e('0x23'),auth[_0xee1e('0x7')](),controller['removeTeams']);router[_0xee1e('0x5e')](_0xee1e('0x59'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x5f')]);router[_0xee1e('0x5e')](_0xee1e('0x47'),auth[_0xee1e('0x7')](),controller['removeChatInteractions']);router[_0xee1e('0x5e')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xee1e('0x60')]);router['delete'](_0xee1e('0x49'),auth['isAuthenticated'](),controller[_0xee1e('0x61')]);router[_0xee1e('0x5e')]('/:id/sms_interactions',auth[_0xee1e('0x7')](),controller[_0xee1e('0x62')]);router[_0xee1e('0x5e')](_0xee1e('0x63'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x64')]);router[_0xee1e('0x5e')](_0xee1e('0x4e'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x65')]);router[_0xee1e('0x5e')](_0xee1e('0x66'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x67')]);router['delete']('/:id/mail_accounts',auth[_0xee1e('0x7')](),controller[_0xee1e('0x68')]);router['delete'](_0xee1e('0x2b'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x69')]);router[_0xee1e('0x5e')](_0xee1e('0x53'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x6a')]);router[_0xee1e('0x5e')]('/:id/chat_websites',auth[_0xee1e('0x7')](),controller[_0xee1e('0x6b')]);router[_0xee1e('0x5e')]('/:id/whatsapp_accounts',auth[_0xee1e('0x7')](),controller['removeWhatsappAccounts']);router[_0xee1e('0x5e')](_0xee1e('0x33'),auth[_0xee1e('0x7')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 1be838e..da48174 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x237aa6,_0x5a22e6){var _0x587955=function(_0x33cac7){while(--_0x33cac7){_0x237aa6['push'](_0x237aa6['shift']());}};_0x587955(++_0x5a22e6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcb91[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'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 1e476e3..0e9b631 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 _0x3c43=['UserSetting','userSetting','attributes','push','User','findAll','rows','length','chat','sms','fax','dataValues','mail','openchannel','whatsapp','all','show','params','differenceBy','keys','intersection','model','fields','merge','openTabs','body','describe','addContacts','ids','internal','Setting','securePassword','max','isNil','min_internal','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','SELECT','from','voicemail','fullname','email','permissions','101','102','103','113','110','104','105','107','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','autoAssociation','compact','Sequelize','ValidationError','authenticate','Wrong\x20credentials','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','channel','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','format','voicePause','UserVoiceQueueRt','upsert','remove','Queues','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','filters','order','sort','pick','options','hasOwnProperty','CmList','Tag','Tags','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','omit','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','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$notLike','$like','$overlap','$contained','$any','firstName','lastName','CmContact','Contact','dialActive','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','isEmpty','queues','inbound','flatten','lower','col','toString','asc','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','lodash','jayson/promise','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','then','role','destroy','get','admin','Users','user','Agents','agent','Telephones','filter','ignore','value','includes','find','name','UserProfileResource','send','index','rawAttributes','map','fieldName','type','password','salt','getOptions','where','query','includeAll','include','true'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0x3c43,0x152));var _0x33c4=function(_0x3fd6cc,_0x40f46d){_0x3fd6cc=_0x3fd6cc-0x0;var _0x172588=_0x3c43[_0x3fd6cc];return _0x172588;};'use strict';var moment=require(_0x33c4('0x0'));var util=require(_0x33c4('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x33c4('0x2'));var squel=require('squel');var jayson=require(_0x33c4('0x3'));var Redis=require(_0x33c4('0x4'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x33c4('0x5'));var config=require(_0x33c4('0x6'));var licenseUtil=require(_0x33c4('0x7'));var APIBadRequestError=require(_0x33c4('0x8'))[_0x33c4('0x9')];var APINotFoundError=require('../../errors/api')[_0x33c4('0xa')];var APIHandleError=require(_0x33c4('0x8'))[_0x33c4('0xb')];var db=require(_0x33c4('0xc'))['db'];var socket=require(_0x33c4('0xd'))(new Redis(config[_0x33c4('0xe')]));require(_0x33c4('0xf'))['register'](socket);config[_0x33c4('0xe')]=_[_0x33c4('0x10')](config[_0x33c4('0xe')],{'host':_0x33c4('0x11'),'port':0x18eb});var amiClient=jayson[_0x33c4('0x12')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x563dfb,_0x4a3d87,_0x35708b,_0x225139){return new Promise(function(_0xf9948f,_0x3864c3){var _0x52c42f=_0x225139||amiClient;return _0x52c42f[_0x33c4('0x13')](_0x563dfb,_0x35708b)['then'](function(_0x23e1ee){logger[_0x33c4('0x14')](_0x33c4('0x15'),_0x4a3d87,_0x33c4('0x16'));logger[_0x33c4('0x17')](_0x33c4('0x18'),_0x4a3d87,'request\x20sent',JSON[_0x33c4('0x19')](_0x23e1ee));if(_0x23e1ee[_0x33c4('0x1a')]){if(_0x23e1ee[_0x33c4('0x1a')]['code']===0x1f4){logger[_0x33c4('0x1a')](_0x33c4('0x15'),_0x4a3d87,_0x23e1ee[_0x33c4('0x1a')]['message']);return _0x3864c3(_0x23e1ee[_0x33c4('0x1a')][_0x33c4('0x1b')]);}logger[_0x33c4('0x1a')](_0x33c4('0x15'),_0x4a3d87,_0x23e1ee[_0x33c4('0x1a')][_0x33c4('0x1b')]);return _0xf9948f(_0x23e1ee[_0x33c4('0x1a')][_0x33c4('0x1b')]);}else{logger[_0x33c4('0x14')](_0x33c4('0x15'),_0x4a3d87,'request\x20sent');_0xf9948f(_0x23e1ee[_0x33c4('0x1c')][_0x33c4('0x1b')]);}})[_0x33c4('0x1d')](function(_0x51fa24){logger[_0x33c4('0x1a')](_0x33c4('0x15'),_0x4a3d87,_0x51fa24);_0x3864c3(_0x51fa24);});});}function respondWithStatusCode(_0x5ae8b9,_0x26e97d){_0x26e97d=_0x26e97d||0xcc;return function(_0x4faeab){if(_0x4faeab){return _0x5ae8b9[_0x33c4('0x1e')](_0x26e97d);}return _0x5ae8b9[_0x33c4('0x1f')](_0x26e97d)['end']();};}function respondWithResult(_0x3f4b08,_0x4b8754){_0x4b8754=_0x4b8754||0xc8;return function(_0x5eda16){if(_0x5eda16){return _0x3f4b08[_0x33c4('0x1f')](_0x4b8754)[_0x33c4('0x20')](_0x5eda16);}};}function respondWithFilteredResult(_0x54dd09,_0x191d2b){return function(_0x1890fd){if(_0x1890fd){var _0x43ea9c=typeof _0x191d2b[_0x33c4('0x21')]==='undefined'&&typeof _0x191d2b[_0x33c4('0x22')]===_0x33c4('0x23');var _0x562a68=_0x1890fd['count'];var _0x37f968=_0x43ea9c?0x0:_0x191d2b[_0x33c4('0x21')];var _0x1048a1=_0x43ea9c?_0x1890fd[_0x33c4('0x24')]:_0x191d2b['offset']+_0x191d2b[_0x33c4('0x22')];var _0x110027;if(_0x1048a1>=_0x562a68){_0x1048a1=_0x562a68;_0x110027=0xc8;}else{_0x110027=0xce;}_0x54dd09[_0x33c4('0x1f')](_0x110027);return _0x54dd09[_0x33c4('0x25')](_0x33c4('0x26'),_0x37f968+'-'+_0x1048a1+'/'+_0x562a68)[_0x33c4('0x20')](_0x1890fd);}return null;};}function saveUpdates(_0x4ab58a){return function(_0x1cf223){if(_0x1cf223){return _0x1cf223[_0x33c4('0x27')](_0x4ab58a)[_0x33c4('0x28')](function(_0x4a8eb9){if(_0x4a8eb9[_0x33c4('0x29')]==='agent'){socket['emit']('userNotification:recalc:'+_0x4a8eb9['id'],_0x4a8eb9);}return _0x4a8eb9;});}return null;};}function removeEntity(_0x278fdd){return function(_0x426af1){if(_0x426af1){return _0x426af1[_0x33c4('0x2a')]()[_0x33c4('0x28')](function(){var _0x3332c4=_0x426af1[_0x33c4('0x2b')]({'plain':!![]});if(_0x3332c4[_0x33c4('0x29')]===_0x33c4('0x2c'))return;var _0x27cda7=[{'name':_0x33c4('0x2d'),'value':_0x33c4('0x2e'),'ignore':!![]},{'name':_0x33c4('0x2f'),'value':_0x33c4('0x30'),'ignore':![]},{'name':_0x33c4('0x31'),'value':'telephone','ignore':![]}];var _0x42a695=_(_0x27cda7)[_0x33c4('0x32')](_0x33c4('0x33'))['map'](_0x33c4('0x34'))[_0x33c4('0x34')]();if(_[_0x33c4('0x35')](_0x42a695,_0x3332c4[_0x33c4('0x29')])){return;}var _0x494317=_[_0x33c4('0x36')](_0x27cda7,['value',_0x3332c4[_0x33c4('0x29')]])[_0x33c4('0x37')];return db[_0x33c4('0x38')][_0x33c4('0x2a')]({'where':{'type':_0x494317,'resourceId':_0x3332c4['id']}})[_0x33c4('0x28')](function(){return _0x426af1;});})[_0x33c4('0x28')](function(){_0x278fdd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c1102){return function(_0x2df220){if(!_0x2df220){_0x5c1102['sendStatus'](0x194);}return _0x2df220;};}function handleError(_0x3746a1,_0x4fae9a){_0x4fae9a=_0x4fae9a||0x1f4;return function(_0x4c0487){logger[_0x33c4('0x1a')](_0x4c0487['stack']);if(_0x4c0487['name']){delete _0x4c0487[_0x33c4('0x37')];}_0x3746a1['status'](_0x4fae9a)[_0x33c4('0x39')](_0x4c0487);};}exports[_0x33c4('0x3a')]=function(_0x1df291,_0xc05f4e){var _0x3671f0={},_0x434080={'count':0x0,'rows':[]};var _0x5e0fd4=_(db['User'][_0x33c4('0x3b')])[_0x33c4('0x3c')](function(_0xab9d29){return{'name':_0xab9d29[_0x33c4('0x3d')],'type':_0xab9d29[_0x33c4('0x3e')]['key']};})[_0x33c4('0x32')](function(_0xc3fe52){return!_[_0x33c4('0x35')]([_0x33c4('0x3f'),_0x33c4('0x40')],_0xc3fe52[_0x33c4('0x37')]);})[_0x33c4('0x34')]();_0x3671f0=qs[_0x33c4('0x41')](_0x5e0fd4,_0x1df291);var _0x2fb533={'where':_0x3671f0[_0x33c4('0x42')]};return db['User'][_0x33c4('0x24')](_0x2fb533)[_0x33c4('0x28')](function(_0x51ebdd){_0x434080['count']=_0x51ebdd;if(_0x1df291[_0x33c4('0x43')][_0x33c4('0x44')]){_0x3671f0[_0x33c4('0x45')]=[{'all':!![]}];}if(_0x1df291['query']['userSetting']===_0x33c4('0x46')){_0x3671f0[_0x33c4('0x45')]=[{'model':db[_0x33c4('0x47')],'as':_0x33c4('0x48')}];}if(!_[_0x33c4('0x35')](_0x3671f0[_0x33c4('0x49')],'id')){_0x3671f0['attributes'][_0x33c4('0x4a')]('id');}return db[_0x33c4('0x4b')][_0x33c4('0x4c')](_0x3671f0);})[_0x33c4('0x28')](function(_0x3013df){_0x434080[_0x33c4('0x4d')]=_0x3013df;if(_0x1df291[_0x33c4('0x43')]['openTabs']==='true'){var _0x1dfb36=[];for(var _0x36b35b=0x0;_0x36b35b<_0x434080[_0x33c4('0x4d')][_0x33c4('0x4e')];_0x36b35b++){_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0x434080[_0x33c4('0x4d')][_0x36b35b]['dataValues']));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0x434080[_0x33c4('0x4d')][_0x36b35b]['dataValues']));_0x1dfb36['push'](get_open_tabs(_0x33c4('0x51'),_0x434080[_0x33c4('0x4d')][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0x434080[_0x33c4('0x4d')][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x54'),_0x434080['rows'][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x55'),_0x434080['rows'][_0x36b35b][_0x33c4('0x52')]));}return Promise[_0x33c4('0x56')](_0x1dfb36)['then'](function(){return _0x434080;});}else{return _0x434080;}})['then'](respondWithFilteredResult(_0xc05f4e,_0x3671f0))[_0x33c4('0x1d')](handleError(_0xc05f4e,null));};exports[_0x33c4('0x57')]=function(_0xe1fb11,_0x6fe377){var _0x43f3fe={'raw':![],'where':{'id':_0xe1fb11[_0x33c4('0x58')]['id']}},_0x25c1cc={};_0x25c1cc['model']=_[_0x33c4('0x59')](_[_0x33c4('0x5a')](db[_0x33c4('0x4b')][_0x33c4('0x3b')]),['password','salt']);_0x25c1cc[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0xe1fb11[_0x33c4('0x43')]);_0x25c1cc['filters']=_[_0x33c4('0x5b')](_0x25c1cc[_0x33c4('0x5c')],_0x25c1cc['query']);_0x43f3fe[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x25c1cc['model'],qs[_0x33c4('0x5d')](_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x43f3fe['attributes']=_0x43f3fe[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x43f3fe[_0x33c4('0x49')]:_0x25c1cc[_0x33c4('0x5c')];if(_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x44')]){_0x43f3fe[_0x33c4('0x45')]=[{'all':!![]}];}if(_0xe1fb11[_0x33c4('0x43')]['userSetting']===_0x33c4('0x46')){_0x43f3fe[_0x33c4('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x43f3fe=_[_0x33c4('0x5e')]({},_0x43f3fe,_0xe1fb11['options']);if(!_[_0x33c4('0x35')](_0x43f3fe[_0x33c4('0x49')],'id')){_0x43f3fe['attributes']['push']('id');}return db[_0x33c4('0x4b')][_0x33c4('0x36')](_0x43f3fe)[_0x33c4('0x28')](handleEntityNotFound(_0x6fe377,null))[_0x33c4('0x28')](function(_0xe3cf86){var _0x16719d=[];values=_0xe3cf86;if(_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x5f')]===_0x33c4('0x46')){_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x54'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x55'),_0xe3cf86['dataValues']));_0x16719d[_0x33c4('0x4a')](get_open_tabs('fax',_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0xe3cf86[_0x33c4('0x52')]));return Promise[_0x33c4('0x56')](_0x16719d);}else{return values;}})[_0x33c4('0x28')](function(){return values;})['then'](respondWithResult(_0x6fe377,null))[_0x33c4('0x1d')](handleError(_0x6fe377,null));};exports[_0x33c4('0x27')]=function(_0x5a8272,_0x436a06){if(_0x5a8272[_0x33c4('0x60')]['id']){delete _0x5a8272['body']['id'];}delete _0x5a8272['body'][_0x33c4('0x29')];return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x5a8272[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x436a06,null))[_0x33c4('0x28')](saveUpdates(_0x5a8272[_0x33c4('0x60')],null))['then'](respondWithResult(_0x436a06,null))[_0x33c4('0x1d')](handleError(_0x436a06,null));};exports[_0x33c4('0x61')]=function(_0x529c71,_0xef6b92){return db['User']['describe']()[_0x33c4('0x28')](respondWithResult(_0xef6b92,null))['catch'](handleError(_0xef6b92,null));};exports['addContacts']=function(_0x59d6fc,_0x1e11f6){return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x59d6fc['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1e11f6,null))['then'](function(_0x20a06b){if(_0x20a06b){return _0x20a06b[_0x33c4('0x62')](_0x59d6fc[_0x33c4('0x60')][_0x33c4('0x63')],_['omit'](_0x59d6fc[_0x33c4('0x60')],[_0x33c4('0x63'),'id'])||{});}})[_0x33c4('0x28')](respondWithResult(_0x1e11f6,null))['catch'](handleError(_0x1e11f6,null));};function validateUser(_0x562646){return new Promise(function(_0xff65fc,_0x33d03b){if(_0x562646[_0x33c4('0x64')])return _0xff65fc(_0x562646);return db[_0x33c4('0x65')]['findById'](0x1)[_0x33c4('0x28')](function(_0xa20eb0){if(_0xa20eb0[_0x33c4('0x66')])authService['validatePasswordPattern'](_0x562646[_0x33c4('0x3f')]);db[_0x33c4('0x4b')][_0x33c4('0x67')]('internal')[_0x33c4('0x28')](function(_0xa01cab){if(_[_0x33c4('0x68')](_0xa01cab)){_0x562646[_0x33c4('0x64')]=_0xa20eb0[_0x33c4('0x69')]||0x1;return;}if(_[_0x33c4('0x68')](_0xa20eb0[_0x33c4('0x69')])||_0xa20eb0['min_internal']===_0xa01cab){_0x562646[_0x33c4('0x64')]=_0xa01cab+0x1;return;}if(_0xa20eb0[_0x33c4('0x69')]>_0xa01cab){_0x562646[_0x33c4('0x64')]=_0xa20eb0[_0x33c4('0x69')];return;}return db[_0x33c4('0x6a')]['query'](_0x33c4('0x6b'),{'type':db[_0x33c4('0x6a')][_0x33c4('0x6c')][_0x33c4('0x6d')]})[_0x33c4('0x28')](function(_0x50c2e9){if(_0x50c2e9&&_0x50c2e9['length']){for(var _0x3f8603=0x0,_0x4193c2=_0x50c2e9[_0x33c4('0x4e')];_0x3f8603<_0x4193c2&&_[_0x33c4('0x68')](_0x562646['internal']);_0x3f8603++){if(_0xa20eb0[_0x33c4('0x69')]<=_0x50c2e9[_0x3f8603]['from']){_0x562646[_0x33c4('0x64')]=_0x50c2e9[_0x3f8603][_0x33c4('0x6e')];}else if(_0xa20eb0[_0x33c4('0x69')]>_0x50c2e9[_0x3f8603][_0x33c4('0x6e')]&&_0xa20eb0[_0x33c4('0x69')]<=_0x50c2e9[_0x3f8603]['to']){_0x562646[_0x33c4('0x64')]=_0xa20eb0['min_internal'];}}}if(_[_0x33c4('0x68')](_0x562646[_0x33c4('0x64')])){_0x562646[_0x33c4('0x64')]=_0xa01cab+0x1;}return _0xff65fc(_0x562646);});});})[_0x33c4('0x1d')](function(_0x58c070){_0x33d03b(_0x58c070);});});}function updateUser(_0x4fb7e5){return new Promise(function(_0x4d6ff7,_0x5554a6){try{if(_0x4fb7e5[_0x33c4('0x6f')]){_0x4fb7e5['mailbox']=_0x4fb7e5[_0x33c4('0x64')];_0x4fb7e5['VoiceMail']={'mailbox':_0x4fb7e5[_0x33c4('0x64')],'password':_0x4fb7e5[_0x33c4('0x3f')],'fullname':_0x4fb7e5[_0x33c4('0x70')],'email':_0x4fb7e5[_0x33c4('0x71')]};}if(_0x4fb7e5[_0x33c4('0x29')]===_0x33c4('0x30')){if(!_0x4fb7e5[_0x33c4('0x72')])_0x4fb7e5['permissions']=[_0x33c4('0x73'),_0x33c4('0x74'),_0x33c4('0x75'),_0x33c4('0x76'),_0x33c4('0x77'),_0x33c4('0x78'),_0x33c4('0x79'),'106',_0x33c4('0x7a'),_0x33c4('0x7b'),_0x33c4('0x7c'),'100',_0x33c4('0x7d'),_0x33c4('0x7e'),_0x33c4('0x7f')];}_0x4d6ff7(_0x4fb7e5);}catch(_0x4de2cd){_0x5554a6(_0x4de2cd);}});}exports[_0x33c4('0x80')]=function(_0x24be1a,_0x476f71){if(_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x29')]===_0x33c4('0x30'))throw new Error(_0x33c4('0x81'));if(_0x24be1a[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e')&&_0x24be1a[_0x33c4('0x2e')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x24be1a['body']['role']==='admin'&&_0x24be1a[_0x33c4('0x2e')]['role']!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x82'));}return licenseUtil[_0x33c4('0x83')]([_0x24be1a[_0x33c4('0x60')]])[_0x33c4('0x28')](function(){return validateUser(_0x24be1a[_0x33c4('0x60')]);})[_0x33c4('0x28')](function(_0x3353e9){return updateUser(_0x3353e9)[_0x33c4('0x28')](function(_0x216103){if(_0x216103[_0x33c4('0x29')]===_0x33c4('0x2c')){_0x216103[_0x33c4('0x84')]=_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x84')];delete _0x216103[_0x33c4('0x85')];}return _0x216103;});})[_0x33c4('0x28')](function(_0x4bb0a6){return db['User'][_0x33c4('0x80')](_0x4bb0a6,{'include':[{'model':db['VoiceMail'],'as':_0x33c4('0x86')}]});})[_0x33c4('0x28')](function(_0x14961f){if(_0x24be1a[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e'))return _0x14961f;if(_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x29')]!=='user')return _0x14961f;return db[_0x33c4('0x87')][_0x33c4('0x36')]({'where':{'name':_0x14961f['role']==='agent'?_0x33c4('0x2f'):_0x33c4('0x31'),'userProfileId':_0x24be1a['user'][_0x33c4('0x85')]},'raw':!![]})[_0x33c4('0x28')](function(_0x82f7aa){if(!_0x82f7aa||_0x82f7aa['autoAssociation']!=0x0)return _0x14961f;return db[_0x33c4('0x38')][_0x33c4('0x80')]({'name':_0x14961f[_0x33c4('0x37')],'resourceId':_0x14961f['id'],'type':_0x82f7aa[_0x33c4('0x37')],'sectionId':_0x82f7aa['id']},{})[_0x33c4('0x28')](function(){return _0x14961f;});})['catch'](function(_0x1c3d71){logger[_0x33c4('0x1a')](_0x33c4('0x88'),_0x1c3d71);throw _0x1c3d71;});})[_0x33c4('0x28')](respondWithResult(_0x476f71,0xc9))['catch'](handleError(_0x476f71,null));};exports['bulkCreate']=function(_0x239e85,_0x4d7f04){var _0x7e96f=_0x239e85[_0x33c4('0x60')];var _0x181890=[];if(_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]==='agent')throw new Error(_0x33c4('0x81'));if(_[_0x33c4('0x89')](_0x7e96f,['role',_0x33c4('0x2e')])&&_0x239e85[_0x33c4('0x2e')]['role']!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x8a'));}if(_[_0x33c4('0x89')](_0x7e96f,[_0x33c4('0x29'),'admin'])&&_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x8b'));}return licenseUtil[_0x33c4('0x83')](_0x7e96f)['then'](function(){return validateUser(_0x7e96f[0x0]);})['then'](function(){for(var _0x1e4c43=0x1;_0x1e4c43<_0x7e96f[_0x33c4('0x4e')];_0x1e4c43++){var _0x3a5371=_0x7e96f[_0x1e4c43-0x1][_0x33c4('0x64')];if(!_0x7e96f[_0x1e4c43][_0x33c4('0x64')])_0x7e96f[_0x1e4c43][_0x33c4('0x64')]=_0x3a5371+0x1;_0x181890[_0x33c4('0x4a')](validateUser(_0x7e96f[_0x1e4c43]));}return Promise['all'](_0x181890);})[_0x33c4('0x28')](function(){_0x181890=[];for(var _0xd0eb96=0x0;_0xd0eb96<_0x7e96f['length'];_0xd0eb96++){_0x181890[_0x33c4('0x4a')](updateUser(_0x7e96f[_0xd0eb96]));}return Promise[_0x33c4('0x56')](_0x181890);})[_0x33c4('0x28')](function(){_0x181890=_0x7e96f[_0x33c4('0x3c')](function(_0x4ca692){return db[_0x33c4('0x4b')]['create'](_0x4ca692,{'include':[{'model':db[_0x33c4('0x86')],'as':_0x33c4('0x86')}]})[_0x33c4('0x28')](function(_0x2d01ab){_0x4ca692['id']=_0x2d01ab['id'];return _0x4ca692;});});return Promise[_0x33c4('0x56')](_0x181890);})[_0x33c4('0x28')](function(_0x3a7719){if(_0x239e85[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e'))return _0x3a7719;if(_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]!==_0x33c4('0x2e'))return _0x3a7719;var _0x3e1c7c=_[_0x33c4('0x89')](_0x3a7719,function(_0x5aec1f){return _0x5aec1f['role']===_0x33c4('0x30')||_0x5aec1f['role']===_0x33c4('0x8c');});if(!_0x3e1c7c)return _0x3a7719;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x33c4('0x2f'),_0x33c4('0x31')]},'userProfileId':_0x239e85[_0x33c4('0x2e')][_0x33c4('0x85')]},'raw':!![]})['then'](function(_0x52fe5f){if(_['isEmpty'](_0x52fe5f)||!_[_0x33c4('0x89')](_0x52fe5f,['autoAssociation',0x0]))return _0x3a7719;_0x181890=[];var _0x3f92e8=_(_0x52fe5f)[_0x33c4('0x3c')](function(_0x586327){if(_0x586327[_0x33c4('0x8d')]===0x1)return;return _0x586327[_0x33c4('0x37')]===_0x33c4('0x2f')?_0x33c4('0x30'):'telephone';})[_0x33c4('0x8e')]()['value']();for(var _0x3555f8=0x0;_0x3555f8<_0x3a7719['length'];_0x3555f8++){if(!_[_0x33c4('0x35')](_0x3f92e8,_0x3a7719[_0x3555f8][_0x33c4('0x29')]))return;var _0x1c01df=_0x3a7719[_0x3555f8][_0x33c4('0x29')]===_0x33c4('0x30')?_0x33c4('0x2f'):_0x33c4('0x31');_0x181890[_0x33c4('0x4a')](db[_0x33c4('0x38')][_0x33c4('0x80')]({'name':_0x3a7719[_0x3555f8][_0x33c4('0x37')],'resourceId':_0x3a7719[_0x3555f8]['id'],'type':_0x1c01df,'sectionId':_['find'](_0x52fe5f,[_0x33c4('0x37'),_0x1c01df])['id']},{}));}return Promise['all'](_0x181890);});})['then'](respondWithResult(_0x4d7f04,0xc9))['catch'](handleError(_0x4d7f04,null));};exports['changePassword']=function(_0x1d6e03,_0x73dab4){if(_0x1d6e03[_0x33c4('0x60')]['id']){delete _0x1d6e03[_0x33c4('0x60')]['id'];}return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1d6e03[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](function(_0x4d2fd9){if(!_0x4d2fd9)return null;if(_0x4d2fd9['id']===_0x1d6e03[_0x33c4('0x2e')]['id']){if(!_0x1d6e03[_0x33c4('0x60')]['oldPassword']||!_0x1d6e03[_0x33c4('0x60')]['newPassword']){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x4d2fd9[_0x33c4('0x91')](_0x1d6e03[_0x33c4('0x60')]['oldPassword'])){throw new db['Sequelize'][(_0x33c4('0x90'))](_0x33c4('0x92'));}if(_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x93')]===_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0x95'));}}else if(_0x1d6e03['user'][_0x33c4('0x29')]===_0x33c4('0x2c')){if(!_0x1d6e03['body'][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0x96'));}}else if(_0x1d6e03[_0x33c4('0x2e')]['role']===_0x33c4('0x2e')){if(!_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0x96'));}if(_0x4d2fd9['role']!=='agent'){throw new db['Sequelize'][(_0x33c4('0x90'))](_0x33c4('0x81'));}}else{throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))]('Unauthorized');}return _0x4d2fd9;})[_0x33c4('0x28')](handleEntityNotFound(_0x73dab4,null))[_0x33c4('0x28')](function(_0x550e8a){return db['Setting'][_0x33c4('0x97')]({'attributes':['id','securePassword',_0x33c4('0x98'),_0x33c4('0x99')]})[_0x33c4('0x28')](function(_0x3bd4d3){if(_0x3bd4d3[_0x33c4('0x66')])authService[_0x33c4('0x9a')](_0x1d6e03[_0x33c4('0x60')]['newPassword']);if(!_0x3bd4d3[_0x33c4('0x98')]||!_0x550e8a['previousPasswords'])return _0x550e8a;authService[_0x33c4('0x9b')](_0x1d6e03[_0x33c4('0x60')]['newPassword'],_0x550e8a[_0x33c4('0x9c')],_0x3bd4d3[_0x33c4('0x99')]);return _0x550e8a;})[_0x33c4('0x28')](saveUpdates({'password':_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')],'passwordResetAt':_0x1d6e03[_0x33c4('0x2e')]['id']==_0x1d6e03[_0x33c4('0x58')]['id']?moment():null,'previousPasswords':authService[_0x33c4('0x9d')](_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')],_0x550e8a[_0x33c4('0x9c')])},null));})[_0x33c4('0x28')](respondWithResult(_0x73dab4,null))[_0x33c4('0x1d')](handleError(_0x73dab4,null));};exports[_0x33c4('0x9e')]=function(_0x4a666d,_0x50fc8c){var _0x15ad36=_0x4a666d[_0x33c4('0x60')][_0x33c4('0x9f')];return db['User'][_0x33c4('0x36')]({'where':{'id':_0x4a666d[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29'),'online','loginInPause','voicePause',_0x33c4('0xa0')]})[_0x33c4('0x28')](handleEntityNotFound(_0x50fc8c,null))['then'](function(_0x581181){if(_0x581181){if(!utils[_0x33c4('0xa1')](_0x15ad36)){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0xa2'));}return _0x581181[_0x33c4('0xa3')+_[_0x33c4('0xa4')](_0x15ad36[_0x33c4('0xa5')]())+'Queues'](_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')],{'penalty':_0x4a666d['body'][_0x33c4('0xa6')]||0x0})[_0x33c4('0xa7')](function(_0x3b43ec){for(var _0xee208d=0x0;_0xee208d<_0x4a666d['body'][_0x33c4('0x63')][_0x33c4('0x4e')];_0xee208d+=0x1){var _0x59e2b9={'UserId':Number(_0x4a666d[_0x33c4('0x58')]['id'])};_0x59e2b9[_['capitalize'](_0x15ad36[_0x33c4('0xa5')]())+_0x33c4('0xa8')]=Number(_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')][_0xee208d]);socket[_0x33c4('0xa9')]('user'+_['capitalize'](_0x15ad36[_0x33c4('0xa5')]())+_0x33c4('0xaa'),_0x59e2b9);}return _0x3b43ec;})[_0x33c4('0x28')](function(){if(_0x15ad36===_0x33c4('0xab')){return db[_0x33c4('0xac')][_0x33c4('0x4c')]({'where':{'id':_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')]||[]},'raw':!![],'attributes':['id',_0x33c4('0x37')]});}})[_0x33c4('0x28')](function(_0x140d92){var _0x55ffcd=_0x581181[_0x33c4('0x2b')]({'plain':!![]});var _0x2ec94e=[];if(_0x15ad36===_0x33c4('0xab')&&_0x55ffcd['role']===_0x33c4('0x30')&&_0x55ffcd[_0x33c4('0xad')]){for(let _0xe0bcc4=0x0;_0xe0bcc4<_0x140d92['length'];_0xe0bcc4+=0x1){_0x2ec94e['push']({'membername':_0x55ffcd[_0x33c4('0x37')],'UserId':_0x55ffcd['id'],'queue_name':_0x140d92[_0xe0bcc4][_0x33c4('0x37')],'VoiceQueueId':_0x140d92[_0xe0bcc4]['id'],'interface':_[_0x33c4('0x68')](_0x55ffcd[_0x33c4('0xa0')])?util[_0x33c4('0xae')]('SIP/%s',_0x55ffcd[_0x33c4('0x37')]):_0x55ffcd[_0x33c4('0xa0')],'paused':_0x55ffcd[_0x33c4('0xaf')]||![],'penalty':_0x4a666d[_0x33c4('0x60')][_0x33c4('0xa6')]||0x0});}return Promise[_0x33c4('0x56')](_0x2ec94e[_0x33c4('0x3c')](function(_0x402f9f){return db[_0x33c4('0xb0')][_0x33c4('0xb1')](_0x402f9f);}));}return _0x581181;});}})[_0x33c4('0x28')](respondWithStatusCode(_0x50fc8c,null))[_0x33c4('0x1d')](handleError(_0x50fc8c,null));};exports['removeQueues']=function(_0x59fa4d,_0x61f54){var _0x177e4e,_0x42530f;return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x59fa4d[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29')]})[_0x33c4('0x28')](handleEntityNotFound(_0x61f54,null))[_0x33c4('0x28')](function(_0x3fe5a6){if(_0x3fe5a6){_0x177e4e=_0x3fe5a6;if(!_0x59fa4d['query']['channel']||!utils['isValidChannel'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')])){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0xa2'));}return _0x3fe5a6[_0x33c4('0xb2')+_[_0x33c4('0xa4')](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb3')](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x63')]);}})[_0x33c4('0x28')](function(_0x37ea90){if(_[_0x33c4('0xb4')](_0x59fa4d['query']['ids'])){for(var _0xd77201=0x0;_0xd77201<_0x59fa4d['query'][_0x33c4('0x63')][_0x33c4('0x4e')];_0xd77201+=0x1){_0x42530f={'UserId':Number(_0x59fa4d['params']['id'])};_0x42530f[_[_0x33c4('0xa4')](_0x59fa4d['query']['channel'][_0x33c4('0xa5')]())+'QueueId']=Number(_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x63')][_0xd77201]);socket[_0x33c4('0xa9')]('user'+_[_0x33c4('0xa4')](_0x59fa4d['query'][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb5'),_0x42530f);}}else{_0x42530f={'UserId':Number(_0x59fa4d['params']['id'])};_0x42530f[_['capitalize'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')]['toLowerCase']())+_0x33c4('0xa8')]=Number(_0x59fa4d[_0x33c4('0x43')]['ids']);socket[_0x33c4('0xa9')]('user'+_['capitalize'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb5'),_0x42530f);}return _0x37ea90;})['then'](function(){if(_0x59fa4d['query'][_0x33c4('0x9f')]===_0x33c4('0xab')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x59fa4d['params']['id'],'VoiceQueueId':_0x59fa4d['query'][_0x33c4('0x63')]},'individualHooks':!![]})[_0x33c4('0x28')](function(){return _0x177e4e;});}return _0x177e4e;})['then'](respondWithStatusCode(_0x61f54,null))['catch'](handleError(_0x61f54,null));};exports[_0x33c4('0xb6')]=function(_0x36570d,_0x32be6c){_0x36570d[_0x33c4('0x60')][_0x33c4('0xb7')]=_0x36570d['file'][_0x33c4('0xb8')];return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x36570d[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x32be6c,null))[_0x33c4('0x28')](saveUpdates(_0x36570d[_0x33c4('0x60')],null))[_0x33c4('0x28')](respondWithResult(_0x32be6c,null))[_0x33c4('0x1d')](handleError(_0x32be6c,null));};exports[_0x33c4('0xb9')]=function(_0x5cf7d8,_0x26d697){var _0x1741b6=path[_0x33c4('0xba')](config['root'],_0x33c4('0xbb'));return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x5cf7d8[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0xb7')],'raw':!![]})[_0x33c4('0x28')](handleEntityNotFound(_0x26d697,null))['then'](function(_0x2de02c){if(_0x2de02c){if(_[_0x33c4('0x68')](_0x2de02c[_0x33c4('0xb7')])){return _0x26d697[_0x33c4('0xbc')](_0x1741b6);}else{if(!fs[_0x33c4('0xbd')](path[_0x33c4('0xba')](config['root'],_0x33c4('0xbe'),_0x2de02c['userpic']))){return _0x26d697['download'](_0x1741b6);}return _0x26d697[_0x33c4('0xbc')](path['join'](config['root'],_0x33c4('0xbe'),_0x2de02c[_0x33c4('0xb7')]));}}})[_0x33c4('0x1d')](handleError(_0x26d697,null));};exports[_0x33c4('0xbf')]=function(_0x4f4d89,_0x179922){return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x4f4d89[_0x33c4('0x58')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x179922,null))[_0x33c4('0x28')](function(_0x537c78){var _0x2fa06e=[];values=_0x537c78[_0x33c4('0x52')];_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0x537c78[_0x33c4('0x52')]));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0x537c78['dataValues']));_0x2fa06e['push'](get_open_tabs(_0x33c4('0x54'),_0x537c78['dataValues']));_0x2fa06e['push'](get_open_tabs(_0x33c4('0x55'),_0x537c78['dataValues']));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x51'),_0x537c78[_0x33c4('0x52')]));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0x537c78[_0x33c4('0x52')]));return Promise['all'](_0x2fa06e);})[_0x33c4('0x28')](function(_0x5428ac){if(_0x5428ac){var _0x550087=_['map'](values[_0x33c4('0xc0')],function(_0x2c9268){return{'channel':_0x33c4('0xc1'),'id':_0x2c9268['id'],'createdAt':_0x2c9268[_0x33c4('0xc2')]};});var _0x2ad346=_[_0x33c4('0x3c')](values[_0x33c4('0xc3')],function(_0x12abab){return{'channel':_0x33c4('0xc4'),'id':_0x12abab['id'],'createdAt':_0x12abab[_0x33c4('0xc2')]};});var _0x2f0d7d=_[_0x33c4('0x3c')](values[_0x33c4('0xc5')],function(_0x24a180){return{'channel':_0x33c4('0xc6'),'id':_0x24a180['id'],'createdAt':_0x24a180[_0x33c4('0xc2')]};});var _0x2b92fe=_[_0x33c4('0x3c')](values[_0x33c4('0xc7')],function(_0x404c65){return{'channel':_0x33c4('0xc8'),'id':_0x404c65['id'],'createdAt':_0x404c65['createdAt']};});var _0x30802d=_[_0x33c4('0x3c')](values[_0x33c4('0xc9')],function(_0x31b115){return{'channel':_0x33c4('0xca'),'id':_0x31b115['id'],'createdAt':_0x31b115['createdAt']};});var _0x279107=_[_0x33c4('0x3c')](values[_0x33c4('0xcb')],function(_0x3d94c0){return{'channel':_0x33c4('0xcc'),'id':_0x3d94c0['id'],'createdAt':_0x3d94c0[_0x33c4('0xc2')]};});var _0x2a9ece=_[_0x33c4('0xcd')](_0x550087,_0x2ad346,_0x2f0d7d,_0x2b92fe,_0x30802d,_0x279107);var _0x25bccd={'count':_0x2a9ece[_0x33c4('0x4e')],'rows':_0x2a9ece};return _0x25bccd;}else return null;})[_0x33c4('0x28')](respondWithResult(_0x179922,null))[_0x33c4('0x1d')](handleError(_0x179922,null));};exports[_0x33c4('0xce')]=function(_0x28d32a,_0x19e8ca){var _0x15933b={};var _0x31ef51={};var _0x4b573b;var _0x46ba28;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x28d32a['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x19e8ca,null))[_0x33c4('0x28')](function(_0x35ad13){if(_0x35ad13){_0x4b573b=_0x35ad13;_0x31ef51[_0x33c4('0x5c')]=_['keys'](db['CmContact'][_0x33c4('0x3b')]);_0x31ef51[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x28d32a[_0x33c4('0x43')]);_0x31ef51[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x31ef51[_0x33c4('0x5c')],_0x31ef51[_0x33c4('0x43')]);_0x15933b[_0x33c4('0x49')]=_['intersection'](_0x31ef51[_0x33c4('0x5c')],qs['fields'](_0x28d32a['query']['fields']));_0x15933b[_0x33c4('0x49')]=_0x15933b[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x15933b[_0x33c4('0x49')]:_0x31ef51[_0x33c4('0x5c')];_0x15933b[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x28d32a['query']['sort']);_0x15933b['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x28d32a[_0x33c4('0x43')],_0x31ef51['filters']));if(_0x28d32a[_0x33c4('0x43')][_0x33c4('0x32')]){_0x15933b[_0x33c4('0x42')]=_['merge'](_0x15933b[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x15933b[_0x33c4('0x49')],function(_0x30dfdd){var _0x597858={};_0x597858[_0x30dfdd]={'$like':'%'+_0x28d32a[_0x33c4('0x43')]['filter']+'%'};return _0x597858;})});}_0x15933b=_['merge']({},_0x15933b,_0x28d32a[_0x33c4('0xd3')]);return _0x4b573b[_0x33c4('0xce')](_0x15933b);}})[_0x33c4('0x28')](function(_0x52e18e){if(_0x52e18e){_0x46ba28=_0x52e18e['length'];if(_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0x44'))){_0x15933b['include']=[{'model':db[_0x33c4('0xd5')],'as':'List','required':![]},{'model':db[_0x33c4('0xd6')],'as':_0x33c4('0xd7'),'attributes':['id',_0x33c4('0x37'),'color'],'where':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]?{'id':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]}:undefined,'required':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]?!![]:![]}];}if(!_0x28d32a[_0x33c4('0x43')]['hasOwnProperty'](_0x33c4('0xd9'))){_0x15933b[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x28d32a['query'][_0x33c4('0x22')]);_0x15933b[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x28d32a[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x4b573b[_0x33c4('0xce')](_0x15933b);}})[_0x33c4('0x28')](function(_0x41e40d){if(_0x41e40d){return _0x41e40d?{'count':_0x46ba28,'rows':_0x41e40d}:null;}})['then'](respondWithResult(_0x19e8ca,null))[_0x33c4('0x1d')](handleError(_0x19e8ca,null));};exports[_0x33c4('0xda')]=function(_0x35f938,_0xc0c88a){var _0x4bc5ec;var _0xd33faa={};var _0x5c4c41;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x35f938[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29')]})['then'](handleEntityNotFound(_0xc0c88a,null))['then'](function(_0x17ee66){if(!utils[_0x33c4('0xa1')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])){throw new db['Sequelize']['ValidationError'](_0x33c4('0xa2'));}_0x4bc5ec=_0x17ee66;var _0x1f28d3={};_0x1f28d3['model']=_[_0x33c4('0x5a')](db[_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])+_0x33c4('0xdb')][_0x33c4('0x3b')]);_0x1f28d3[_0x33c4('0x43')]=_['keys'](_0x35f938[_0x33c4('0x43')]);_0x1f28d3['filters']=_[_0x33c4('0x5b')](_0x1f28d3['model'],_0x1f28d3[_0x33c4('0x43')]);_0xd33faa[_0x33c4('0x49')]=_['intersection'](_0x1f28d3[_0x33c4('0x5c')],qs['fields'](_0x35f938[_0x33c4('0x43')][_0x33c4('0x5d')]));_0xd33faa['attributes']=_0xd33faa[_0x33c4('0x49')]['length']?_0xd33faa[_0x33c4('0x49')]:_0x1f28d3[_0x33c4('0x5c')];_0xd33faa[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x35f938[_0x33c4('0x43')][_0x33c4('0xd1')]);_0xd33faa[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x35f938[_0x33c4('0x43')],_0x1f28d3['filters']));if(_0x35f938[_0x33c4('0x43')][_0x33c4('0x32')]){_0xd33faa['where']=_[_0x33c4('0x5e')](_0xd33faa[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0xd33faa[_0x33c4('0x49')],function(_0x5bcac9){var _0xc0df5b={};_0xc0df5b[_0x5bcac9]={'$like':'%'+_0x35f938[_0x33c4('0x43')]['filter']+'%'};return _0xc0df5b;})});}_0xd33faa=_[_0x33c4('0x5e')]({},_0xd33faa,_0x35f938[_0x33c4('0xd3')]);switch(_0x4bc5ec[_0x33c4('0x29')]){case'admin':return db[_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])+_0x33c4('0xdb')][_0x33c4('0x4c')](_0xd33faa);case _0x33c4('0x2e'):case _0x33c4('0x30'):return _0x4bc5ec['get'+_['capitalize'](_0x35f938['query']['channel'])+_0x33c4('0xb3')](_0xd33faa);default:throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0xdc'));}})['then'](function(_0x56eb49){_0x5c4c41=_0x56eb49[_0x33c4('0x4e')];if(!_0x35f938['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0xd33faa['limit']=qs['limit'](_0x35f938[_0x33c4('0x43')][_0x33c4('0x22')]);_0xd33faa[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x21')]);}switch(_0x4bc5ec[_0x33c4('0x29')]){case _0x33c4('0x2c'):return db[_[_0x33c4('0xa4')](_0x35f938['query']['channel'])+_0x33c4('0xdb')][_0x33c4('0x4c')](_0xd33faa);case _0x33c4('0x2e'):case'agent':return _0x4bc5ec[_0x33c4('0x2b')+_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')]['channel'])+'Queues'](_0xd33faa);}})[_0x33c4('0x28')](function(_0x218f5d){return{'count':_0x5c4c41,'rows':_0x218f5d};})[_0x33c4('0x28')](respondWithResult(_0xc0c88a,null))[_0x33c4('0x1d')](handleError(_0xc0c88a,null));};exports[_0x33c4('0xdd')]=function(_0x39a411,_0x52186b){var _0x4cac38={};var _0x4c030d={};var _0x1f13cd;var _0x29aa1d;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x39a411[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x52186b,null))['then'](function(_0x50da27){if(_0x50da27){_0x1f13cd=_0x50da27;_0x4c030d[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xb0')][_0x33c4('0x3b')]);_0x4c030d[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x39a411[_0x33c4('0x43')]);_0x4c030d['filters']=_['intersection'](_0x4c030d[_0x33c4('0x5c')],_0x4c030d[_0x33c4('0x43')]);_0x4cac38[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x4c030d[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x39a411['query'][_0x33c4('0x5d')]));_0x4cac38[_0x33c4('0x49')]=_0x4cac38[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x4cac38[_0x33c4('0x49')]:_0x4c030d['model'];_0x4cac38[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x39a411[_0x33c4('0x43')]['sort']);_0x4cac38[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_['pick'](_0x39a411['query'],_0x4c030d[_0x33c4('0xcf')]));if(_0x39a411[_0x33c4('0x43')][_0x33c4('0x32')]){_0x4cac38[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x4cac38[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x4cac38[_0x33c4('0x49')],function(_0x17af32){var _0x47868c={};_0x47868c[_0x17af32]={'$like':'%'+_0x39a411[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x47868c;})});}_0x4cac38=_[_0x33c4('0x5e')]({},_0x4cac38,_0x39a411[_0x33c4('0xd3')]);return _0x1f13cd[_0x33c4('0xdd')](_0x4cac38);}})[_0x33c4('0x28')](function(_0x4f7341){if(_0x4f7341){_0x29aa1d=_0x4f7341[_0x33c4('0x4e')];if(!_0x39a411[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x4cac38[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x39a411[_0x33c4('0x43')][_0x33c4('0x22')]);_0x4cac38['offset']=qs[_0x33c4('0x21')](_0x39a411[_0x33c4('0x43')]['offset']);}return _0x1f13cd[_0x33c4('0xdd')](_0x4cac38);}})[_0x33c4('0x28')](function(_0x12cc24){if(_0x12cc24){return _0x12cc24?{'count':_0x29aa1d,'rows':_0x12cc24}:null;}})['then'](respondWithResult(_0x52186b,null))[_0x33c4('0x1d')](handleError(_0x52186b,null));};exports[_0x33c4('0xde')]=function(_0x34434e,_0x33be25){var _0x56ed4a={};var _0x687375={};var _0x34a21e;var _0x3fa34b;return db['User']['findOne']({'where':{'id':_0x34434e['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x33be25,null))[_0x33c4('0x28')](function(_0x260f1d){if(_0x260f1d){_0x34a21e=_0x260f1d;_0x687375[_0x33c4('0x5c')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x687375[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x34434e['query']);_0x687375[_0x33c4('0xcf')]=_['intersection'](_0x687375[_0x33c4('0x5c')],_0x687375['query']);_0x56ed4a[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x687375['model'],qs[_0x33c4('0x5d')](_0x34434e[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x56ed4a[_0x33c4('0x49')]=_0x56ed4a['attributes']['length']?_0x56ed4a['attributes']:_0x687375['model'];_0x56ed4a[_0x33c4('0xd0')]=qs['sort'](_0x34434e[_0x33c4('0x43')]['sort']);_0x56ed4a[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x34434e[_0x33c4('0x43')],_0x687375[_0x33c4('0xcf')]));if(_0x34434e[_0x33c4('0x43')][_0x33c4('0x32')]){_0x56ed4a[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x56ed4a['where'],{'$or':_[_0x33c4('0x3c')](_0x56ed4a[_0x33c4('0x49')],function(_0x5cd9df){var _0x179bb5={};_0x179bb5[_0x5cd9df]={'$like':'%'+_0x34434e[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x179bb5;})});}_0x56ed4a=_['merge']({},_0x56ed4a,_0x34434e[_0x33c4('0xd3')]);return _0x34a21e[_0x33c4('0xde')](_0x56ed4a);}})[_0x33c4('0x28')](function(_0x2cbcdb){if(_0x2cbcdb){_0x3fa34b=_0x2cbcdb['length'];if(!_0x34434e['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x56ed4a[_0x33c4('0x22')]=qs['limit'](_0x34434e[_0x33c4('0x43')][_0x33c4('0x22')]);_0x56ed4a[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x34434e[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x34a21e[_0x33c4('0xde')](_0x56ed4a);}})[_0x33c4('0x28')](function(_0x3ee937){if(_0x3ee937){return _0x3ee937?{'count':_0x3fa34b,'rows':_0x3ee937}:null;}})[_0x33c4('0x28')](respondWithResult(_0x33be25,null))[_0x33c4('0x1d')](handleError(_0x33be25,null));};exports[_0x33c4('0xdf')]=function(_0x381e5c,_0x1204ef){var _0x52bf48={'raw':!![],'where':{}};var _0x2bade2={};var _0xd40a7d={'count':0x0,'rows':[]};return db['User'][_0x33c4('0x97')]({'where':{'id':_0x381e5c[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x1204ef,null))[_0x33c4('0x28')](function(_0x1bfb51){if(_0x1bfb51){_0x2bade2[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['VoiceRecording']['rawAttributes']);_0x2bade2['query']=_['keys'](_0x381e5c[_0x33c4('0x43')]);_0x2bade2[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x2bade2[_0x33c4('0x5c')],_0x2bade2[_0x33c4('0x43')]);_0x52bf48[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x2bade2[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x381e5c[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x52bf48[_0x33c4('0x49')]=_0x52bf48[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x52bf48[_0x33c4('0x49')]:_0x2bade2[_0x33c4('0x5c')];if(!_0x381e5c[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x52bf48[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x381e5c['query'][_0x33c4('0x22')]);_0x52bf48[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x381e5c['query'][_0x33c4('0x21')]);}_0x52bf48[_0x33c4('0xd0')]=qs['sort'](_0x381e5c[_0x33c4('0x43')]['sort']);_0x52bf48['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x381e5c['query'],_0x2bade2['filters']));_0x52bf48[_0x33c4('0x42')][_0x33c4('0xe0')]=_0x1bfb51['id'];if(_0x381e5c[_0x33c4('0x43')][_0x33c4('0x32')]){_0x52bf48['where']=_[_0x33c4('0x5e')](_0x52bf48[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x52bf48[_0x33c4('0x49')],function(_0x53d535){var _0x279460={};_0x279460[_0x53d535]={'$like':'%'+_0x381e5c[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x279460;})});}_0x52bf48=_['merge']({},_0x52bf48,_0x381e5c[_0x33c4('0xd3')]);return db[_0x33c4('0xe1')]['count']({'where':_0x52bf48[_0x33c4('0x42')]})[_0x33c4('0x28')](function(_0xa3ce47){_0xd40a7d[_0x33c4('0x24')]=_0xa3ce47;if(_0x381e5c[_0x33c4('0x43')][_0x33c4('0x44')]){_0x52bf48[_0x33c4('0x45')]=[{'all':!![]}];}return db[_0x33c4('0xe1')][_0x33c4('0x4c')](_0x52bf48);})[_0x33c4('0x28')](function(_0x294280){_0xd40a7d['rows']=_0x294280;return _0xd40a7d;});}})[_0x33c4('0x28')](respondWithFilteredResult(_0x1204ef,_0x52bf48))[_0x33c4('0x1d')](handleError(_0x1204ef,null));};exports['getScreenRecordings']=function(_0x556c37,_0x5f4a3b){var _0x294f24={'raw':!![],'where':{}};var _0xf9dbdc={};var _0x1b66ce={'count':0x0,'rows':[]};return db['User'][_0x33c4('0x97')]({'where':{'id':_0x556c37['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x5f4a3b,null))[_0x33c4('0x28')](function(_0x3437ac){if(_0x3437ac){_0xf9dbdc[_0x33c4('0x5c')]=_['keys'](db[_0x33c4('0xe2')][_0x33c4('0x3b')]);_0xf9dbdc['query']=_[_0x33c4('0x5a')](_0x556c37['query']);_0xf9dbdc[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0xf9dbdc[_0x33c4('0x5c')],_0xf9dbdc[_0x33c4('0x43')]);_0x294f24['attributes']=_[_0x33c4('0x5b')](_0xf9dbdc[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x556c37[_0x33c4('0x43')]['fields']));_0x294f24[_0x33c4('0x49')]=_0x294f24[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x294f24[_0x33c4('0x49')]:_0xf9dbdc['model'];if(!_0x556c37['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x294f24[_0x33c4('0x22')]=qs['limit'](_0x556c37[_0x33c4('0x43')][_0x33c4('0x22')]);_0x294f24[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x556c37[_0x33c4('0x43')]['offset']);}_0x294f24['order']=qs[_0x33c4('0xd1')](_0x556c37[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x294f24[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x556c37[_0x33c4('0x43')],_0xf9dbdc[_0x33c4('0xcf')]));_0x294f24[_0x33c4('0x42')]['UserId']=_0x3437ac['id'];if(_0x556c37[_0x33c4('0x43')]['filter']){_0x294f24[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x294f24['where'],{'$or':_[_0x33c4('0x3c')](_0x294f24['attributes'],function(_0x27e224){var _0x22e8df={};_0x22e8df[_0x27e224]={'$like':'%'+_0x556c37[_0x33c4('0x43')]['filter']+'%'};return _0x22e8df;})});}_0x294f24=_[_0x33c4('0x5e')]({},_0x294f24,_0x556c37[_0x33c4('0xd3')]);return db[_0x33c4('0xe2')][_0x33c4('0x24')]({'where':_0x294f24[_0x33c4('0x42')]})[_0x33c4('0x28')](function(_0xac4d0b){_0x1b66ce[_0x33c4('0x24')]=_0xac4d0b;if(_0x556c37[_0x33c4('0x43')]['includeAll']){_0x294f24[_0x33c4('0x45')]=[{'all':!![]}];}return db['ScreenRecording'][_0x33c4('0x4c')](_0x294f24);})[_0x33c4('0x28')](function(_0x503655){_0x1b66ce['rows']=_0x503655;return _0x1b66ce;});}})[_0x33c4('0x28')](respondWithFilteredResult(_0x5f4a3b,_0x294f24))['catch'](handleError(_0x5f4a3b,null));};exports['getChatInteractions']=function(_0xc431c7,_0x1689ff){var _0x1caeec={};var _0x2144f7={};var _0x1db663;var _0x2faf6e;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0xc431c7[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1689ff,null))[_0x33c4('0x28')](function(_0x3bf950){if(_0x3bf950){_0x1db663=_0x3bf950;_0x2144f7[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xe3')][_0x33c4('0x3b')]);_0x2144f7[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0xc431c7[_0x33c4('0x43')]);_0x2144f7['filters']=_[_0x33c4('0x5b')](_0x2144f7[_0x33c4('0x5c')],_0x2144f7[_0x33c4('0x43')]);_0x1caeec[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x2144f7[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0xc431c7[_0x33c4('0x43')]['fields']));_0x1caeec[_0x33c4('0x49')]=_0x1caeec[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x1caeec[_0x33c4('0x49')]:_0x2144f7['model'];_0x1caeec[_0x33c4('0xd0')]=qs['sort'](_0xc431c7['query'][_0x33c4('0xd1')]);_0x1caeec[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0xc431c7[_0x33c4('0x43')],_0x2144f7[_0x33c4('0xcf')]));if(_0xc431c7[_0x33c4('0x43')]['filter']){_0x1caeec['where']=_[_0x33c4('0x5e')](_0x1caeec[_0x33c4('0x42')],{'$or':_['map'](_0x1caeec['attributes'],function(_0x327fa5){var _0x2e108e={};_0x2e108e[_0x327fa5]={'$like':'%'+_0xc431c7[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x2e108e;})});}_0x1caeec=_[_0x33c4('0x5e')]({},_0x1caeec,_0xc431c7[_0x33c4('0xd3')]);return _0x1db663[_0x33c4('0xe4')](_0x1caeec);}})[_0x33c4('0x28')](function(_0x4dbd49){if(_0x4dbd49){_0x2faf6e=_0x4dbd49[_0x33c4('0x4e')];if(!_0xc431c7['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x1caeec['limit']=qs[_0x33c4('0x22')](_0xc431c7[_0x33c4('0x43')][_0x33c4('0x22')]);_0x1caeec['offset']=qs[_0x33c4('0x21')](_0xc431c7[_0x33c4('0x43')]['offset']);}return _0x1db663[_0x33c4('0xe4')](_0x1caeec);}})[_0x33c4('0x28')](function(_0xfa1e28){if(_0xfa1e28){return _0xfa1e28?{'count':_0x2faf6e,'rows':_0xfa1e28}:null;}})['then'](respondWithResult(_0x1689ff,null))[_0x33c4('0x1d')](handleError(_0x1689ff,null));};exports[_0x33c4('0xe5')]=function(_0x1d0e6a,_0x1ee188){var _0x141e10={};var _0x4fdcc3={};var _0x4007f1;var _0x5901b6;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x1d0e6a['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1ee188,null))['then'](function(_0x4466d5){if(_0x4466d5){_0x4007f1=_0x4466d5;_0x4fdcc3[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['OpenchannelInteraction'][_0x33c4('0x3b')]);_0x4fdcc3[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x1d0e6a[_0x33c4('0x43')]);_0x4fdcc3[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x4fdcc3[_0x33c4('0x5c')],_0x4fdcc3[_0x33c4('0x43')]);_0x141e10[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x4fdcc3['model'],qs['fields'](_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x141e10[_0x33c4('0x49')]=_0x141e10['attributes'][_0x33c4('0x4e')]?_0x141e10[_0x33c4('0x49')]:_0x4fdcc3[_0x33c4('0x5c')];_0x141e10[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x141e10['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x1d0e6a['query'],_0x4fdcc3[_0x33c4('0xcf')]));if(_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x32')]){_0x141e10[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x141e10[_0x33c4('0x42')],{'$or':_['map'](_0x141e10['attributes'],function(_0xd284b8){var _0x3be0d3={};_0x3be0d3[_0xd284b8]={'$like':'%'+_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x3be0d3;})});}_0x141e10=_[_0x33c4('0x5e')]({},_0x141e10,_0x1d0e6a[_0x33c4('0xd3')]);return _0x4007f1['getOpenchannelInteractions'](_0x141e10);}})['then'](function(_0x349be2){if(_0x349be2){_0x5901b6=_0x349be2[_0x33c4('0x4e')];if(!_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x141e10[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x1d0e6a['query'][_0x33c4('0x22')]);_0x141e10['offset']=qs[_0x33c4('0x21')](_0x1d0e6a['query'][_0x33c4('0x21')]);}return _0x4007f1['getOpenchannelInteractions'](_0x141e10);}})[_0x33c4('0x28')](function(_0x38e1eb){if(_0x38e1eb){return _0x38e1eb?{'count':_0x5901b6,'rows':_0x38e1eb}:null;}})['then'](respondWithResult(_0x1ee188,null))['catch'](handleError(_0x1ee188,null));};exports[_0x33c4('0xe6')]=function(_0x2f49a0,_0x58b9ca){var _0x140ade={'raw':!![],'where':{}};var _0x1e12b0={};var _0x33641f={'count':0x0,'rows':[]};return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x2f49a0[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x58b9ca,null))[_0x33c4('0x28')](function(_0x3eba12){if(_0x3eba12){_0x1e12b0[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['MailInteraction'][_0x33c4('0x3b')]);_0x1e12b0[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x2f49a0[_0x33c4('0x43')]);_0x1e12b0[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x1e12b0[_0x33c4('0x5c')],_0x1e12b0[_0x33c4('0x43')]);_0x140ade['attributes']=_[_0x33c4('0x5b')](_0x1e12b0['model'],qs[_0x33c4('0x5d')](_0x2f49a0['query'][_0x33c4('0x5d')]));_0x140ade[_0x33c4('0x49')]=_0x140ade[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x140ade[_0x33c4('0x49')]:_0x1e12b0[_0x33c4('0x5c')];if(!_0x2f49a0[_0x33c4('0x43')][_0x33c4('0xd4')]('nolimit')){_0x140ade['limit']=qs[_0x33c4('0x22')](_0x2f49a0[_0x33c4('0x43')][_0x33c4('0x22')]);_0x140ade[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x2f49a0[_0x33c4('0x43')]['offset']);}_0x140ade['order']=qs[_0x33c4('0xd1')](_0x2f49a0[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x140ade[_0x33c4('0x42')]=qs['filters'](_['pick'](_0x2f49a0[_0x33c4('0x43')],_0x1e12b0[_0x33c4('0xcf')]));_0x140ade['where'][_0x33c4('0xe0')]=_0x3eba12['id'];if(_0x2f49a0['query'][_0x33c4('0x32')]){_0x140ade['where']=_[_0x33c4('0x5e')](_0x140ade[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x140ade[_0x33c4('0x49')],function(_0x566ad0){var _0x4154dd={};_0x4154dd[_0x566ad0]={'$like':'%'+_0x2f49a0['query'][_0x33c4('0x32')]+'%'};return _0x4154dd;})});}_0x140ade=_[_0x33c4('0x5e')]({},_0x140ade,_0x2f49a0['options']);return db[_0x33c4('0xe7')][_0x33c4('0x24')]({'where':_0x140ade['where']})[_0x33c4('0x28')](function(_0x103464){_0x33641f[_0x33c4('0x24')]=_0x103464;if(_0x2f49a0[_0x33c4('0x43')]['includeAll']){_0x140ade[_0x33c4('0x45')]=[{'all':!![]}];}return db[_0x33c4('0xe7')][_0x33c4('0x4c')](_0x140ade);})[_0x33c4('0x28')](function(_0x3eac30){_0x33641f[_0x33c4('0x4d')]=_0x3eac30;return _0x33641f;});}})['then'](respondWithFilteredResult(_0x58b9ca,_0x140ade))['catch'](handleError(_0x58b9ca,null));};exports[_0x33c4('0xe8')]=function(_0x521994,_0x39ac12){var _0x330e42={};var _0x40d13b={};var _0x1c8325;var _0x42875a;return db['User']['findOne']({'where':{'id':_0x521994[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x39ac12,null))[_0x33c4('0x28')](function(_0x22b7a1){if(_0x22b7a1){_0x1c8325=_0x22b7a1;_0x40d13b['model']=_[_0x33c4('0x5a')](db[_0x33c4('0xe9')][_0x33c4('0x3b')]);_0x40d13b[_0x33c4('0x43')]=_['keys'](_0x521994[_0x33c4('0x43')]);_0x40d13b[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x40d13b[_0x33c4('0x5c')],_0x40d13b[_0x33c4('0x43')]);_0x330e42[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x40d13b[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x521994[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x330e42[_0x33c4('0x49')]=_0x330e42[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x330e42['attributes']:_0x40d13b[_0x33c4('0x5c')];_0x330e42[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x521994[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x330e42[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x521994['query'],_0x40d13b['filters']));if(_0x521994[_0x33c4('0x43')][_0x33c4('0x32')]){_0x330e42[_0x33c4('0x42')]=_['merge'](_0x330e42[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x330e42['attributes'],function(_0x39ce23){var _0x54bcda={};_0x54bcda[_0x39ce23]={'$like':'%'+_0x521994['query'][_0x33c4('0x32')]+'%'};return _0x54bcda;})});}_0x330e42=_[_0x33c4('0x5e')]({},_0x330e42,_0x521994['options']);return _0x1c8325[_0x33c4('0xe8')](_0x330e42);}})[_0x33c4('0x28')](function(_0x26aee8){if(_0x26aee8){_0x42875a=_0x26aee8[_0x33c4('0x4e')];if(!_0x521994[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x330e42[_0x33c4('0x22')]=qs['limit'](_0x521994[_0x33c4('0x43')][_0x33c4('0x22')]);_0x330e42[_0x33c4('0x21')]=qs['offset'](_0x521994[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x1c8325['getSmsInteractions'](_0x330e42);}})[_0x33c4('0x28')](function(_0x1a6430){if(_0x1a6430){return _0x1a6430?{'count':_0x42875a,'rows':_0x1a6430}:null;}})[_0x33c4('0x28')](respondWithResult(_0x39ac12,null))['catch'](handleError(_0x39ac12,null));};exports[_0x33c4('0xea')]=function(_0x4880bf,_0x43c2bd){var _0x5312f3={};var _0xd2aa7c={};var _0x3e5a61;var _0x1d2f76;return db[_0x33c4('0x4b')]['findOne']({'where':{'id':_0x4880bf[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x43c2bd,null))['then'](function(_0x3da996){if(_0x3da996){_0x3e5a61=_0x3da996;_0xd2aa7c[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xeb')][_0x33c4('0x3b')]);_0xd2aa7c[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x4880bf[_0x33c4('0x43')]);_0xd2aa7c[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0xd2aa7c[_0x33c4('0x5c')],_0xd2aa7c['query']);_0x5312f3[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0xd2aa7c[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x4880bf['query'][_0x33c4('0x5d')]));_0x5312f3[_0x33c4('0x49')]=_0x5312f3['attributes']['length']?_0x5312f3[_0x33c4('0x49')]:_0xd2aa7c['model'];_0x5312f3[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x4880bf[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x5312f3[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x4880bf[_0x33c4('0x43')],_0xd2aa7c[_0x33c4('0xcf')]));if(_0x4880bf['query']['filter']){_0x5312f3['where']=_[_0x33c4('0x5e')](_0x5312f3[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x5312f3['attributes'],function(_0x2dc89b){var _0x263d89={};_0x263d89[_0x2dc89b]={'$like':'%'+_0x4880bf['query']['filter']+'%'};return _0x263d89;})});}_0x5312f3=_[_0x33c4('0x5e')]({},_0x5312f3,_0x4880bf[_0x33c4('0xd3')]);return _0x3e5a61[_0x33c4('0xea')](_0x5312f3);}})['then'](function(_0xbae636){if(_0xbae636){_0x1d2f76=_0xbae636[_0x33c4('0x4e')];if(!_0x4880bf[_0x33c4('0x43')]['hasOwnProperty']('nolimit')){_0x5312f3[_0x33c4('0x22')]=qs['limit'](_0x4880bf['query']['limit']);_0x5312f3['offset']=qs['offset'](_0x4880bf['query']['offset']);}return _0x3e5a61[_0x33c4('0xea')](_0x5312f3);}})['then'](function(_0x48bdd4){if(_0x48bdd4){return _0x48bdd4?{'count':_0x1d2f76,'rows':_0x48bdd4}:null;}})['then'](respondWithResult(_0x43c2bd,null))['catch'](handleError(_0x43c2bd,null));};exports[_0x33c4('0xec')]=function(_0x46b060,_0x47cc5a){var _0x19f494={};var _0x2907a4={};var _0x648207;var _0x57c4f7;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x46b060['params']['id']}})['then'](handleEntityNotFound(_0x47cc5a,null))[_0x33c4('0x28')](function(_0x5753ec){if(_0x5753ec){_0x648207=_0x5753ec;_0x2907a4[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xed')]['rawAttributes']);_0x2907a4[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x46b060[_0x33c4('0x43')]);_0x2907a4[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x2907a4[_0x33c4('0x5c')],_0x2907a4[_0x33c4('0x43')]);_0x19f494[_0x33c4('0x49')]=_['intersection'](_0x2907a4['model'],qs[_0x33c4('0x5d')](_0x46b060[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x19f494[_0x33c4('0x49')]=_0x19f494['attributes'][_0x33c4('0x4e')]?_0x19f494[_0x33c4('0x49')]:_0x2907a4['model'];_0x19f494[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x46b060[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x19f494[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x46b060['query'],_0x2907a4['filters']));if(_0x46b060[_0x33c4('0x43')][_0x33c4('0x32')]){_0x19f494[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x19f494[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x19f494[_0x33c4('0x49')],function(_0x385976){var _0x51f837={};_0x51f837[_0x385976]={'$like':'%'+_0x46b060[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x51f837;})});}_0x19f494=_[_0x33c4('0x5e')]({},_0x19f494,_0x46b060[_0x33c4('0xd3')]);return _0x648207['getWhatsappInteractions'](_0x19f494);}})[_0x33c4('0x28')](function(_0x23eb20){if(_0x23eb20){_0x57c4f7=_0x23eb20[_0x33c4('0x4e')];if(!_0x46b060['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x19f494['limit']=qs[_0x33c4('0x22')](_0x46b060[_0x33c4('0x43')][_0x33c4('0x22')]);_0x19f494[_0x33c4('0x21')]=qs['offset'](_0x46b060[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x648207['getWhatsappInteractions'](_0x19f494);}})['then'](function(_0x3c78fc){if(_0x3c78fc){return _0x3c78fc?{'count':_0x57c4f7,'rows':_0x3c78fc}:null;}})[_0x33c4('0x28')](respondWithResult(_0x47cc5a,null))[_0x33c4('0x1d')](handleError(_0x47cc5a,null));};exports[_0x33c4('0xee')]=function(_0x2ecbea,_0x45da69,_0x231845){var _0x551154;var _0x30e61b;var _0x1b2e4f;var _0x59e1ff=!_[_0x33c4('0x68')](_0x2ecbea[_0x33c4('0x58')]['id'])?_0x2ecbea[_0x33c4('0x58')]['id']:!_['isNil'](_0x2ecbea[_0x33c4('0x2e')]['id'])?_0x2ecbea[_0x33c4('0x2e')]['id']:null;return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x59e1ff,'role':{'$or':['admin',_0x33c4('0x2e'),'agent']}},'attributes':['id',_0x33c4('0x37'),_0x33c4('0xef'),_0x33c4('0xf0'),_0x33c4('0x29'),_0x33c4('0x64'),'loginInPause']})[_0x33c4('0x28')](function(_0x190c46){if(_0x190c46){if(_0x190c46[_0x33c4('0x29')]===_0x33c4('0x30')){_0x551154=_0x190c46;if(_0x2ecbea[_0x33c4('0x60')][_0x33c4('0xa0')]){_0x1b2e4f=util[_0x33c4('0xae')](_0x33c4('0xf1'),_0x551154[_0x2ecbea['body'][_0x33c4('0xa0')]]);}else if(_0x2ecbea[_0x33c4('0x60')][_0x33c4('0xf2')]){_0x1b2e4f=util[_0x33c4('0xae')]('SIP/%s',_0x2ecbea[_0x33c4('0x60')]['intrf']);}else{_0x1b2e4f=util[_0x33c4('0xae')](_0x33c4('0xf3'),_0x551154[_0x33c4('0x37')]);}socket['to'](util['format'](_0x33c4('0xf4'),_0x551154[_0x33c4('0x37')]))[_0x33c4('0xa9')](_0x33c4('0xf5'),{'user':{'id':_0x551154['id'],'name':_0x551154[_0x33c4('0x37')]},'ip':_0x2ecbea[_0x33c4('0xf6')]['x-forwarded-for']||_0x2ecbea[_0x33c4('0xf7')]['remoteAddress']||_0x2ecbea[_0x33c4('0xf8')]['remoteAddress']||_0x2ecbea['connection']['socket'][_0x33c4('0xf9')]});return db[_0x33c4('0xb0')][_0x33c4('0x2a')]({'where':{'membername':_0x551154[_0x33c4('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0xfa'));}})[_0x33c4('0x28')](function(){if(_0x551154){return _0x551154[_0x33c4('0xfb')]({'raw':!![]});}})[_0x33c4('0x28')](function(_0x11fb19){if(_0x551154){if(_0x11fb19){_0x30e61b=_0x11fb19;if(_0x30e61b[_0x33c4('0x4e')]){var _0x152677=_0x30e61b[_0x33c4('0x3c')](function(_0x8b6c0f){var _0x3bc172={'membername':_0x551154[_0x33c4('0x37')],'UserId':_0x551154['id'],'queue_name':_0x8b6c0f[_0x33c4('0x37')],'VoiceQueueId':_0x8b6c0f['id'],'interface':_0x1b2e4f,'paused':_0x551154[_0x33c4('0xfc')]||![],'penalty':_0x8b6c0f[_0x33c4('0xfd')]||0x0};return db[_0x33c4('0xb0')][_0x33c4('0xb1')](_0x3bc172);});return Promise[_0x33c4('0x56')](_0x152677);}}}})['then'](function(){if(_0x551154){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x551154['name'],'exitAt':null}});}})[_0x33c4('0x28')](function(_0x32f9ed){if(_0x551154){var _0x1ea582=[];_0x32f9ed[_0x33c4('0xff')](function(_0x265976){_0x1ea582[_0x33c4('0x4a')](_0x265976[_0x33c4('0x27')]({'exitAt':moment()[_0x33c4('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x1ea582);}})[_0x33c4('0x28')](function(){if(_0x551154){var _0x1a6915=[];var _0x396a60=[];var _0x1929c6=utils[_0x33c4('0x100')]();var _0x26a808={'membername':_0x551154['name'],'interface':_0x1b2e4f,'enterAt':moment()['format'](_0x33c4('0x101')),'role':_0x551154[_0x33c4('0x29')],'internal':_0x551154[_0x33c4('0x64')]};_0x1929c6['forEach'](function(_0x81085){_0x1a6915[_0x33c4('0x4a')](_[_0x33c4('0x5e')]({'channel':_0x81085,'type':_0x33c4('0x102'),'data1':_0x2ecbea['body'][_0x33c4('0x103')],'data2':_0x1b2e4f},_0x26a808));if(_0x551154['loginInPause']){_0x396a60['push'](_['merge']({'channel':_0x81085,'type':_0x33c4('0x104'),'data1':_0x33c4('0x105')},_0x26a808));}});return db[_0x33c4('0xfe')][_0x33c4('0x106')](_0x1a6915[_0x33c4('0xcd')](_0x396a60),{'individualHooks':!![]});}})[_0x33c4('0x28')](function(){if(_0x551154){return _0x551154['update']({'online':!![],'lastLoginAt':moment()['format'](_0x33c4('0x101')),'voicePause':_0x551154['loginInPause']||![],'mailPause':_0x551154[_0x33c4('0xfc')]||![],'chatPause':_0x551154[_0x33c4('0xfc')]||![],'faxPause':_0x551154[_0x33c4('0xfc')]||![],'smsPause':_0x551154[_0x33c4('0xfc')]||![],'openchannelPause':_0x551154[_0x33c4('0xfc')]||![],'whatsappPause':_0x551154[_0x33c4('0xfc')]||![],'pauseType':_0x551154[_0x33c4('0xfc')]?_0x33c4('0x105'):null,'interface':_0x1b2e4f,'lastPauseAt':moment()[_0x33c4('0xae')](_0x33c4('0x101'))});}})[_0x33c4('0x28')](function(_0x3a0a3d){if(_0x2ecbea[_0x33c4('0x107')]){return _0x231845();}else{return Promise[_0x33c4('0x108')](_0x3a0a3d)[_0x33c4('0x28')](respondWithResult(_0x45da69,null));}})['catch'](handleError(_0x45da69,null));};exports[_0x33c4('0x109')]=function(_0x1a67c1,_0x25eab3){var _0x2f725e;return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1a67c1[_0x33c4('0x58')]['id'],'role':_0x33c4('0x30')},'attributes':['id',_0x33c4('0x37'),'role']})[_0x33c4('0x28')](handleEntityNotFound(_0x25eab3,null))['then'](function(_0x505bfd){if(_0x505bfd){_0x2f725e=_0x505bfd;return db[_0x33c4('0xb0')][_0x33c4('0x2a')]({'where':{'membername':_0x2f725e[_0x33c4('0x37')]},'individualHooks':!![]});}})[_0x33c4('0x28')](function(){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x2f725e['name'],'exitAt':null}});})[_0x33c4('0x28')](function(_0x5353e9){var _0x4012ab=[];_0x5353e9[_0x33c4('0xff')](function(_0x3493e7){_0x4012ab[_0x33c4('0x4a')](_0x3493e7[_0x33c4('0x27')]({'exitAt':moment()['format'](_0x33c4('0x101'))}));});return Promise[_0x33c4('0x56')](_0x4012ab);})[_0x33c4('0x28')](function(){return _0x2f725e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x33c4('0x28')](respondWithResult(_0x25eab3,null))[_0x33c4('0x1d')](handleError(_0x25eab3,null));};exports[_0x33c4('0x10a')]=function(_0x1ef24b,_0x16ed31){var _0x4d6f7d;return db[_0x33c4('0xb0')][_0x33c4('0x27')]({'paused':0x1},{'where':{'UserId':_0x1ef24b[_0x33c4('0x58')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1ef24b[_0x33c4('0x58')]['id'],'role':_0x33c4('0x30')},'attributes':['id',_0x33c4('0x37'),'role',_0x33c4('0x64'),_0x33c4('0xa0'),_0x33c4('0xad')]});})[_0x33c4('0x28')](handleEntityNotFound(_0x16ed31,null))['then'](function(_0x2fee07){if(_0x2fee07){_0x4d6f7d=_0x2fee07;return respondWithRpcPromise(_0x33c4('0x10b'),_0x33c4('0x10a'),{'id':_0x4d6f7d['id'],'name':_0x4d6f7d[_0x33c4('0x37')],'pause':!![]});}})['then'](function(){if(_0x4d6f7d){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x4d6f7d['name'],'type':_0x33c4('0x104'),'exitAt':null}});}})['then'](function(_0x1b9915){if(_0x1b9915[_0x33c4('0x4e')]){var _0xf0c773=moment()[_0x33c4('0xae')](_0x33c4('0x101'));for(var _0xfd9f66=0x0,_0x5bca5f=_0x1b9915['length'];_0xfd9f66<_0x5bca5f;_0xfd9f66++){_0x1b9915[_0xfd9f66][_0x33c4('0x10c')]({'exitAt':_0xf0c773});}}})['then'](function(){var _0x34df7c=[];var _0x231d56=utils['getChannels']();_0x231d56[_0x33c4('0xff')](function(_0x5b9cda){_0x34df7c[_0x33c4('0x4a')]({'channel':_0x5b9cda,'membername':_0x4d6f7d['name'],'interface':_[_0x33c4('0x68')](_0x4d6f7d[_0x33c4('0xa0')])?util['format'](_0x33c4('0xf3'),_0x4d6f7d[_0x33c4('0x37')]):_0x4d6f7d[_0x33c4('0xa0')],'type':_0x33c4('0x104'),'enterAt':moment()[_0x33c4('0xae')](_0x33c4('0x101')),'data1':_0x1ef24b['body'][_0x33c4('0x3e')]||_0x33c4('0x10d'),'role':_0x4d6f7d[_0x33c4('0x29')],'internal':_0x4d6f7d[_0x33c4('0x64')]});});return db[_0x33c4('0xfe')][_0x33c4('0x106')](_0x34df7c,{'individualHooks':!![]});})[_0x33c4('0x28')](function(){return _0x4d6f7d[_0x33c4('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1ef24b[_0x33c4('0x60')][_0x33c4('0x3e')]||_0x33c4('0x10d'),'lastPauseAt':moment()[_0x33c4('0xae')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x16ed31,null))[_0x33c4('0x1d')](handleError(_0x16ed31,null));};exports['unpause']=function(_0x39f1d5,_0x3f9d18){if(_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]&&!utils['isValidChannel'](_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')])){throw new APIBadRequestError(util[_0x33c4('0xae')](_0x33c4('0x10e'),_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]));}return db['User'][_0x33c4('0x36')]({'where':{'id':_0x39f1d5[_0x33c4('0x58')]['id']},'attributes':['id','name','role',_0x33c4('0x64'),'interface',_0x33c4('0xad'),_0x33c4('0xaf'),_0x33c4('0x10f'),_0x33c4('0x110'),_0x33c4('0x111'),_0x33c4('0x112'),_0x33c4('0x113'),_0x33c4('0x114'),_0x33c4('0x115'),_0x33c4('0x116')]})[_0x33c4('0x28')](function(_0x47067a){if(!_0x47067a){throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x39f1d5['params']['id']));}return _0x47067a[_0x33c4('0x118')](_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]);})[_0x33c4('0x28')](respondWithResult(_0x3f9d18,null))['catch'](APIHandleError(_0x3f9d18));};exports[_0x33c4('0x119')]=function(_0x4213f5,_0x219a9e){var _0x56fb4b={};var _0x36c387={};var _0xf71b29;var _0x44c9d7;return db['User'][_0x33c4('0x97')]({'where':{'id':_0x4213f5[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x219a9e,null))['then'](function(_0x45e40a){if(_0x45e40a){_0xf71b29=_0x45e40a;_0x36c387[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0x11a')][_0x33c4('0x3b')]);_0x36c387[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x4213f5['query']);_0x36c387[_0x33c4('0xcf')]=_['intersection'](_0x36c387[_0x33c4('0x5c')],_0x36c387[_0x33c4('0x43')]);_0x56fb4b[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x36c387[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x4213f5[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x56fb4b[_0x33c4('0x49')]=_0x56fb4b[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x56fb4b['attributes']:_0x36c387[_0x33c4('0x5c')];_0x56fb4b[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x4213f5[_0x33c4('0x43')]['sort']);_0x56fb4b[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x4213f5[_0x33c4('0x43')],_0x36c387[_0x33c4('0xcf')]));if(_0x4213f5['query'][_0x33c4('0x32')]){_0x56fb4b['where']=_[_0x33c4('0x5e')](_0x56fb4b[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x56fb4b[_0x33c4('0x49')],function(_0x2b0299){var _0x25f8c3={};_0x25f8c3[_0x2b0299]={'$like':'%'+_0x4213f5['query']['filter']+'%'};return _0x25f8c3;})});}_0x56fb4b=_[_0x33c4('0x5e')]({},_0x56fb4b,_0x4213f5['options']);return _0xf71b29[_0x33c4('0x119')](_0x56fb4b);}})[_0x33c4('0x28')](function(_0x544410){if(_0x544410){_0x44c9d7=_0x544410[_0x33c4('0x4e')];if(!_0x4213f5[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x56fb4b['limit']=qs[_0x33c4('0x22')](_0x4213f5[_0x33c4('0x43')]['limit']);_0x56fb4b[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x4213f5[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0xf71b29[_0x33c4('0x119')](_0x56fb4b);}})[_0x33c4('0x28')](function(_0xee6b8){if(_0xee6b8){return _0xee6b8?{'count':_0x44c9d7,'rows':_0xee6b8}:null;}})[_0x33c4('0x28')](respondWithResult(_0x219a9e,null))[_0x33c4('0x1d')](handleError(_0x219a9e,null));};exports[_0x33c4('0x11b')]=function(_0x336299,_0x490edd){var _0x278728=_0x336299[_0x33c4('0x58')]['id'];var _0x5633e9=_0x336299[_0x33c4('0x60')]?_0x336299[_0x33c4('0x60')][_0x33c4('0x63')]:null;var _0x596030=[];return Promise[_0x33c4('0x108')]()['then'](function(){if(!_0x5633e9)throw new APIBadRequestError(_0x33c4('0x11c'));})[_0x33c4('0x28')](function(){return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x278728}});})[_0x33c4('0x28')](function(_0x1006d5){if(!_0x1006d5)throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x336299[_0x33c4('0x58')]['id']));return db[_0x33c4('0x6a')][_0x33c4('0x11d')](function(_0x2510bc){return _0x1006d5[_0x33c4('0x11b')](_0x5633e9,{'transaction':_0x2510bc})['then'](function(){return db['Team'][_0x33c4('0x4c')]({'where':{'id':{'$in':_0x5633e9}}});})[_0x33c4('0x28')](function(_0x1aafd3){var _0x484d2f=_[_0x33c4('0x3c')](_0x1aafd3,function(_0x3d437f){return _0x3d437f[_0x33c4('0x11e')]();});return Promise['all'](_0x484d2f);})[_0x33c4('0x28')](function(_0x327027){_0x596030=_[_0x33c4('0x11f')](_0x327027);var _0x20f148=_[_0x33c4('0x3c')](_0x596030,function(_0x468a20){return _0x468a20[_0x33c4('0x120')](_0x1006d5['id'],{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x20f148);})[_0x33c4('0x28')](function(){if(!_0x1006d5['online'])return;var _0x308afe=_[_0x33c4('0x32')](_0x596030,function(_0xfa5e1e){return _0xfa5e1e[_0x33c4('0x121')](_0x33c4('0x9f'))===_0x33c4('0x122');});var _0x5734e2=_['map'](_0x308afe,function(_0x175c57){return db[_0x33c4('0xb0')][_0x33c4('0xb1')]({'membername':_0x1006d5[_0x33c4('0x37')],'UserId':_0x1006d5['id'],'queue_name':_0x175c57[_0x33c4('0x37')],'VoiceQueueId':_0x175c57['id'],'interface':_[_0x33c4('0x68')](_0x1006d5['interface'])?util[_0x33c4('0xae')](_0x33c4('0xf3'),_0x1006d5[_0x33c4('0x37')]):_0x1006d5[_0x33c4('0xa0')],'paused':_0x1006d5[_0x33c4('0xaf')]||![],'penalty':_0x1006d5[_0x33c4('0xa6')]},{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x5734e2);})[_0x33c4('0x28')](function(){return db[_0x33c4('0x123')][_0x33c4('0x4c')]({'where':{'teamId':{'$in':_0x5633e9}}});})[_0x33c4('0x28')](function(_0xc7ac1d){var _0x13bebd=_['map'](_0xc7ac1d,function(_0x22e0cb){return db[_0x33c4('0x124')][_0x33c4('0x80')]({'UserId':_0x1006d5['id'],'VoicePrefixId':_0x22e0cb['VoicePrefixId']},{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x13bebd);});});})['then'](function(){for(var _0xf1a743=0x0;_0xf1a743<_0x596030[_0x33c4('0x4e')];_0xf1a743++){var _0x118b03=_0x596030[_0xf1a743][_0x33c4('0x121')](_0x33c4('0x9f'));var _0x1dca78=_0x118b03+_0x33c4('0xa8');socket[_0x33c4('0xa9')](_0x33c4('0x2e')+_0x118b03+_0x33c4('0xaa'),{'UserId':_0x278728,['queueField']:_0x596030[_0xf1a743]['id']});}})[_0x33c4('0x28')](respondWithStatusCode(_0x490edd,null))['catch'](APIHandleError(_0x490edd));};exports['removeTeams']=function(_0x4e3783,_0x6ead49){var _0x1bf830=_0x4e3783[_0x33c4('0x58')]['id'];var _0x4cb5d5=null;if(_0x4e3783[_0x33c4('0x43')]['ids']){_0x4cb5d5=_[_0x33c4('0xb4')](_0x4e3783[_0x33c4('0x43')][_0x33c4('0x63')])?_0x4e3783[_0x33c4('0x43')]['ids']:[_0x4e3783[_0x33c4('0x43')][_0x33c4('0x63')]];}var _0x4fa453=[];return Promise[_0x33c4('0x108')]()[_0x33c4('0x28')](function(){if(!_0x4cb5d5)throw new APIBadRequestError(_0x33c4('0x125'));})[_0x33c4('0x28')](function(){return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x1bf830}});})[_0x33c4('0x28')](function(_0x2d236a){if(!_0x2d236a)throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x4e3783[_0x33c4('0x58')]['id']));return db[_0x33c4('0x6a')]['transaction'](function(_0x5624df){return _0x2d236a[_0x33c4('0x126')](_0x4cb5d5,{'transaction':_0x5624df})['then'](function(){return db[_0x33c4('0x11a')]['findAll']({'where':{'id':{'$in':_0x4cb5d5}}});})[_0x33c4('0x28')](function(_0x269765){var _0x401f26=_[_0x33c4('0x3c')](_0x269765,function(_0x18f90b){return _0x18f90b[_0x33c4('0x11e')]();});return Promise[_0x33c4('0x56')](_0x401f26);})[_0x33c4('0x28')](function(_0x4f2102){_0x4fa453=_[_0x33c4('0x11f')](_0x4f2102);var _0x12f0f3=_[_0x33c4('0x3c')](_0x4fa453,function(_0x5a233d){return _0x5a233d[_0x33c4('0x127')](_0x2d236a['id'],{'transaction':_0x5624df});});return Promise[_0x33c4('0x56')](_0x12f0f3);})[_0x33c4('0x28')](function(){if(!_0x2d236a[_0x33c4('0xad')])return;var _0x28914c=_[_0x33c4('0x32')](_0x4fa453,function(_0x2ee8bb){return _0x2ee8bb[_0x33c4('0x121')]('channel')===_0x33c4('0x122');});var _0x3c8ba4=_[_0x33c4('0x3c')](_0x28914c,function(_0x4775b2){return db['UserVoiceQueueRt'][_0x33c4('0x2a')]({'where':{'VoiceQueueId':_0x4775b2['id'],'UserId':_0x2d236a['id']},'transaction':_0x5624df});});return Promise['all'](_0x3c8ba4);})[_0x33c4('0x28')](function(){return db[_0x33c4('0x123')][_0x33c4('0x4c')]({'where':{'teamId':{'$in':_0x4cb5d5}}});})[_0x33c4('0x28')](function(_0x300e99){var _0x1b796b=_[_0x33c4('0x3c')](_0x300e99,function(_0xcbd1b8){return db[_0x33c4('0x124')]['destroy']({'where':{'UserId':_0x2d236a['id'],'VoicePrefixId':_0xcbd1b8['VoicePrefixId']}},{'transaction':_0x5624df});});return Promise[_0x33c4('0x56')](_0x1b796b);});});})[_0x33c4('0x28')](function(){for(var _0x589a9c=0x0;_0x589a9c<_0x4fa453['length'];_0x589a9c++){var _0x3826b7=_0x4fa453[_0x589a9c]['getDataValue'](_0x33c4('0x9f'));var _0x2bb09d=_0x3826b7+_0x33c4('0xa8');socket[_0x33c4('0xa9')](_0x33c4('0x2e')+_0x3826b7+_0x33c4('0xb5'),{'UserId':_0x1bf830,['queueField']:_0x4fa453[_0x589a9c]['id']});}})[_0x33c4('0x28')](respondWithStatusCode(_0x6ead49,null))[_0x33c4('0x1d')](APIHandleError(_0x6ead49));};exports[_0x33c4('0x128')]=function(_0x12d909,_0xdd0d7f){var _0x366ba8={};var _0x47b010={};var _0x47441b;var _0x1d1faa;return db[_0x33c4('0x4b')]['findOne']({'where':{'id':_0x12d909['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0xdd0d7f,null))[_0x33c4('0x28')](function(_0x10ad22){if(_0x10ad22){_0x47441b=_0x10ad22;_0x47b010['model']=_[_0x33c4('0x5a')](db[_0x33c4('0xd5')][_0x33c4('0x3b')]);_0x47b010[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x12d909[_0x33c4('0x43')]);_0x47b010[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x47b010[_0x33c4('0x5c')],_0x47b010['query']);_0x366ba8[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x47b010['model'],qs[_0x33c4('0x5d')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x366ba8[_0x33c4('0x49')]=_0x366ba8[_0x33c4('0x49')]['length']?_0x366ba8[_0x33c4('0x49')]:_0x47b010[_0x33c4('0x5c')];_0x366ba8[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x12d909[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x366ba8['where']=qs[_0x33c4('0xcf')](_['pick'](_0x12d909[_0x33c4('0x43')],_0x47b010[_0x33c4('0xcf')]));if(_0x12d909[_0x33c4('0x43')][_0x33c4('0x32')]){_0x366ba8['where']=_[_0x33c4('0x5e')](_0x366ba8[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x366ba8[_0x33c4('0x49')],function(_0x41d27b){var _0x41636e={};_0x41636e[_0x41d27b]={'$like':'%'+_0x12d909[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x41636e;})});}_0x366ba8=_[_0x33c4('0x5e')]({},_0x366ba8,_0x12d909[_0x33c4('0xd3')]);return _0x47441b[_0x33c4('0x128')](_0x366ba8);}})[_0x33c4('0x28')](function(_0x331380){if(_0x331380){_0x1d1faa=_0x331380['length'];if(!_0x12d909[_0x33c4('0x43')]['hasOwnProperty']('nolimit')){_0x366ba8[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x22')]);_0x366ba8['offset']=qs[_0x33c4('0x21')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x47441b[_0x33c4('0x128')](_0x366ba8);}})[_0x33c4('0x28')](function(_0x33fd8b){if(_0x33fd8b){return _0x33fd8b?{'count':_0x1d1faa,'rows':_0x33fd8b}:null;}})[_0x33c4('0x28')](respondWithResult(_0xdd0d7f,null))['catch'](handleError(_0xdd0d7f,null));};exports[_0x33c4('0x129')]=function(_0x10784b,_0x2928bc){var _0x4022da={};var _0x446bb8={};var _0x394b28;return db['User'][_0x33c4('0x97')]({'where':{'id':_0x10784b[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x2928bc,null))['then'](function(_0x50c7a9){if(_0x50c7a9){_0x394b28=_0x50c7a9;_0x446bb8[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0x4b')][_0x33c4('0x3b')]);_0x446bb8['query']=_['keys'](_0x10784b['query']);_0x446bb8[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x446bb8['model'],_0x446bb8['query']);_0x4022da['attributes']=_['intersection'](_0x446bb8[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x10784b[_0x33c4('0x43')]['fields']));_0x4022da[_0x33c4('0x49')]=_0x4022da[_0x33c4('0x49')]['length']?_0x4022da[_0x33c4('0x49')]:_0x446bb8[_0x33c4('0x5c')];_0x4022da[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x10784b[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x4022da[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x10784b[_0x33c4('0x43')],_0x446bb8['filters']));if(_0x10784b[_0x33c4('0x43')][_0x33c4('0x32')]){_0x4022da['where']=_[_0x33c4('0x5e')](_0x4022da[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x4022da['attributes'],function(_0x138495){var _0x57e0e1={};_0x57e0e1[_0x138495]={'$like':'%'+_0x10784b[_0x33c4('0x43')]['filter']+'%'};return _0x57e0e1;})});}_0x4022da['model']=db[_0x33c4('0x4b')];_0x4022da['as']='Agents';_0x4022da=_[_0x33c4('0x5e')]({},_0x4022da,_0x10784b[_0x33c4('0xd3')]);return _0x394b28['getVoiceQueues']({'include':[_0x4022da]});}})[_0x33c4('0x28')](function(_0x451975){if(_0x451975){var _0x207825={},_0x17c4fc=[];for(var _0x3d5c9d=0x0;_0x3d5c9d<_0x451975[_0x33c4('0x4e')];_0x3d5c9d+=0x1){for(var _0x37dec8=0x0,_0x388805;_0x37dec8<_0x451975[_0x3d5c9d]['Agents'][_0x33c4('0x4e')];_0x37dec8+=0x1){_0x388805=_0x451975[_0x3d5c9d][_0x33c4('0x2f')][_0x37dec8]['get']({'plain':!![]});_0x207825[_0x388805['id']]=_0x388805;}}_0x207825=_[_0x33c4('0x12a')](_0x207825);for(var _0x5cd8f6=qs[_0x33c4('0x21')](_0x10784b['query']['offset']);_0x5cd8f6<_0x207825[_0x33c4('0x4e')]&&_0x17c4fc[_0x33c4('0x4e')]=_0x48c0e2){_0x4b8d76=_0x48c0e2;_0x3f482c=0xc8;}else{_0x3f482c=0xce;}_0x4cc90d[_0x8ed5('0x25')](_0x3f482c);return _0x4cc90d[_0x8ed5('0x26')](_0x8ed5('0x27'),_0x158d7c+'-'+_0x4b8d76+'/'+_0x48c0e2)[_0x8ed5('0x21')](_0x511334);}return null;};}function saveUpdates(_0x1a4e48){return function(_0xbccd96){if(_0xbccd96){return _0xbccd96['update'](_0x1a4e48)['then'](function(_0x3d913f){if(_0x3d913f['role']===_0x8ed5('0x28')){socket['emit']('userNotification:recalc:'+_0x3d913f['id'],_0x3d913f);}return _0x3d913f;});}return null;};}function removeEntity(_0xe385fa){return function(_0x401a78){if(_0x401a78){return _0x401a78[_0x8ed5('0x29')]()['then'](function(){var _0x26fae3=_0x401a78[_0x8ed5('0x2a')]({'plain':!![]});if(_0x26fae3['role']===_0x8ed5('0x2b'))return;var _0x2e869e=[{'name':_0x8ed5('0x2c'),'value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x29cafb=_(_0x2e869e)[_0x8ed5('0x2d')]('ignore')[_0x8ed5('0x2e')](_0x8ed5('0x2f'))['value']();if(_[_0x8ed5('0x30')](_0x29cafb,_0x26fae3['role'])){return;}var _0xa45a20=_[_0x8ed5('0x31')](_0x2e869e,[_0x8ed5('0x2f'),_0x26fae3[_0x8ed5('0x32')]])['name'];return db[_0x8ed5('0x33')][_0x8ed5('0x29')]({'where':{'type':_0xa45a20,'resourceId':_0x26fae3['id']}})[_0x8ed5('0x16')](function(){return _0x401a78;});})[_0x8ed5('0x16')](function(){_0xe385fa['status'](0xcc)[_0x8ed5('0x20')]();});}};}function handleEntityNotFound(_0xf4d1b6){return function(_0x1de272){if(!_0x1de272){_0xf4d1b6[_0x8ed5('0x1f')](0x194);}return _0x1de272;};}function handleError(_0x1a3dd9,_0x1ecfff){_0x1ecfff=_0x1ecfff||0x1f4;return function(_0x55e64f){logger[_0x8ed5('0x1c')](_0x55e64f['stack']);if(_0x55e64f[_0x8ed5('0x34')]){delete _0x55e64f['name'];}_0x1a3dd9[_0x8ed5('0x25')](_0x1ecfff)[_0x8ed5('0x35')](_0x55e64f);};}exports[_0x8ed5('0x36')]=function(_0x52572b,_0xd759){var _0x526112={},_0x490a5d={'count':0x0,'rows':[]};var _0x43674d=_(db[_0x8ed5('0x37')]['rawAttributes'])[_0x8ed5('0x2e')](function(_0x27f904){return{'name':_0x27f904[_0x8ed5('0x38')],'type':_0x27f904[_0x8ed5('0x39')][_0x8ed5('0x3a')]};})[_0x8ed5('0x2d')](function(_0x11e091){return!_[_0x8ed5('0x30')]([_0x8ed5('0x3b'),'salt'],_0x11e091[_0x8ed5('0x34')]);})[_0x8ed5('0x2f')]();_0x526112=qs[_0x8ed5('0x3c')](_0x43674d,_0x52572b);var _0x599897={'where':_0x526112[_0x8ed5('0x3d')]};return db[_0x8ed5('0x37')][_0x8ed5('0x23')](_0x599897)[_0x8ed5('0x16')](function(_0x3e5ec9){_0x490a5d[_0x8ed5('0x23')]=_0x3e5ec9;if(_0x52572b[_0x8ed5('0x3e')][_0x8ed5('0x3f')]){_0x526112[_0x8ed5('0x40')]=[{'all':!![]}];}if(_0x52572b[_0x8ed5('0x3e')][_0x8ed5('0x41')]==='true'){_0x526112[_0x8ed5('0x40')]=[{'model':db[_0x8ed5('0x42')],'as':_0x8ed5('0x41')}];}if(!_[_0x8ed5('0x30')](_0x526112[_0x8ed5('0x43')],'id')){_0x526112['attributes'][_0x8ed5('0x44')]('id');}return db['User'][_0x8ed5('0x45')](_0x526112);})['then'](function(_0x50bb66){_0x490a5d[_0x8ed5('0x46')]=_0x50bb66;if(_0x52572b[_0x8ed5('0x3e')][_0x8ed5('0x47')]===_0x8ed5('0x48')){var _0x39c4f2=[];for(var _0x235435=0x0;_0x235435<_0x490a5d[_0x8ed5('0x46')][_0x8ed5('0x49')];_0x235435++){_0x39c4f2[_0x8ed5('0x44')](get_open_tabs('chat',_0x490a5d[_0x8ed5('0x46')][_0x235435][_0x8ed5('0x4a')]));_0x39c4f2[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x4b'),_0x490a5d[_0x8ed5('0x46')][_0x235435][_0x8ed5('0x4a')]));_0x39c4f2[_0x8ed5('0x44')](get_open_tabs('fax',_0x490a5d[_0x8ed5('0x46')][_0x235435][_0x8ed5('0x4a')]));_0x39c4f2['push'](get_open_tabs(_0x8ed5('0x4c'),_0x490a5d[_0x8ed5('0x46')][_0x235435][_0x8ed5('0x4a')]));_0x39c4f2[_0x8ed5('0x44')](get_open_tabs('openchannel',_0x490a5d['rows'][_0x235435][_0x8ed5('0x4a')]));_0x39c4f2[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x4d'),_0x490a5d[_0x8ed5('0x46')][_0x235435][_0x8ed5('0x4a')]));}return Promise['all'](_0x39c4f2)['then'](function(){return _0x490a5d;});}else{return _0x490a5d;}})[_0x8ed5('0x16')](respondWithFilteredResult(_0xd759,_0x526112))[_0x8ed5('0x1e')](handleError(_0xd759,null));};exports[_0x8ed5('0x4e')]=function(_0x4fa91a,_0x321b10){var _0x26c993={'raw':![],'where':{'id':_0x4fa91a['params']['id']}},_0x84d326={};_0x84d326['model']=_['differenceBy'](_[_0x8ed5('0x4f')](db[_0x8ed5('0x37')][_0x8ed5('0x50')]),[_0x8ed5('0x3b'),_0x8ed5('0x51')]);_0x84d326[_0x8ed5('0x3e')]=_['keys'](_0x4fa91a[_0x8ed5('0x3e')]);_0x84d326[_0x8ed5('0x52')]=_['intersection'](_0x84d326['model'],_0x84d326['query']);_0x26c993[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x84d326[_0x8ed5('0x54')],qs['fields'](_0x4fa91a[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x26c993[_0x8ed5('0x43')]=_0x26c993[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x26c993[_0x8ed5('0x43')]:_0x84d326[_0x8ed5('0x54')];if(_0x4fa91a['query']['includeAll']){_0x26c993[_0x8ed5('0x40')]=[{'all':!![]}];}if(_0x4fa91a[_0x8ed5('0x3e')][_0x8ed5('0x41')]==='true'){_0x26c993[_0x8ed5('0x40')]=[{'model':db[_0x8ed5('0x42')],'as':_0x8ed5('0x41')}];}_0x26c993=_[_0x8ed5('0x56')]({},_0x26c993,_0x4fa91a[_0x8ed5('0x57')]);if(!_['includes'](_0x26c993[_0x8ed5('0x43')],'id')){_0x26c993[_0x8ed5('0x43')]['push']('id');}return db[_0x8ed5('0x37')][_0x8ed5('0x31')](_0x26c993)['then'](handleEntityNotFound(_0x321b10,null))[_0x8ed5('0x16')](function(_0x1ca373){var _0x11056f=[];values=_0x1ca373;if(_0x4fa91a['query']['openTabs']===_0x8ed5('0x48')){_0x11056f[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x58'),_0x1ca373[_0x8ed5('0x4a')]));_0x11056f[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x4b'),_0x1ca373[_0x8ed5('0x4a')]));_0x11056f['push'](get_open_tabs(_0x8ed5('0x59'),_0x1ca373[_0x8ed5('0x4a')]));_0x11056f[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x4d'),_0x1ca373[_0x8ed5('0x4a')]));_0x11056f[_0x8ed5('0x44')](get_open_tabs('fax',_0x1ca373['dataValues']));_0x11056f[_0x8ed5('0x44')](get_open_tabs('mail',_0x1ca373['dataValues']));return Promise[_0x8ed5('0x5a')](_0x11056f);}else{return values;}})[_0x8ed5('0x16')](function(){return values;})['then'](respondWithResult(_0x321b10,null))['catch'](handleError(_0x321b10,null));};exports['update']=function(_0x300082,_0x39b52a){if(_0x300082[_0x8ed5('0x5b')]['id']){delete _0x300082[_0x8ed5('0x5b')]['id'];}delete _0x300082[_0x8ed5('0x5b')]['role'];return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x300082['params']['id']}})['then'](handleEntityNotFound(_0x39b52a,null))[_0x8ed5('0x16')](saveUpdates(_0x300082[_0x8ed5('0x5b')],null))['then'](respondWithResult(_0x39b52a,null))[_0x8ed5('0x1e')](handleError(_0x39b52a,null));};exports[_0x8ed5('0x5c')]=function(_0x1fd6c,_0x303f78){return db[_0x8ed5('0x37')][_0x8ed5('0x5c')]()[_0x8ed5('0x16')](respondWithResult(_0x303f78,null))['catch'](handleError(_0x303f78,null));};exports[_0x8ed5('0x5d')]=function(_0x195423,_0x51e54e){return db['User'][_0x8ed5('0x31')]({'where':{'id':_0x195423['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x51e54e,null))['then'](function(_0x376f1d){if(_0x376f1d){return _0x376f1d['addContacts'](_0x195423[_0x8ed5('0x5b')][_0x8ed5('0x5e')],_[_0x8ed5('0x5f')](_0x195423[_0x8ed5('0x5b')],['ids','id'])||{});}})[_0x8ed5('0x16')](respondWithResult(_0x51e54e,null))['catch'](handleError(_0x51e54e,null));};function validateUser(_0x199de3){return new Promise(function(_0x2b0c58,_0x200394){if(_0x199de3['internal'])return _0x2b0c58(_0x199de3);return db[_0x8ed5('0x60')][_0x8ed5('0x61')](0x1)['then'](function(_0x3ad9cf){if(_0x3ad9cf[_0x8ed5('0x62')])authService[_0x8ed5('0x63')](_0x199de3[_0x8ed5('0x3b')]);db[_0x8ed5('0x37')][_0x8ed5('0x64')](_0x8ed5('0x65'))[_0x8ed5('0x16')](function(_0x1088d9){if(_['isNil'](_0x1088d9)){_0x199de3[_0x8ed5('0x65')]=_0x3ad9cf[_0x8ed5('0x66')]||0x1;return;}if(_['isNil'](_0x3ad9cf['min_internal'])||_0x3ad9cf['min_internal']===_0x1088d9){_0x199de3['internal']=_0x1088d9+0x1;return;}if(_0x3ad9cf[_0x8ed5('0x66')]>_0x1088d9){_0x199de3[_0x8ed5('0x65')]=_0x3ad9cf[_0x8ed5('0x66')];return;}return db[_0x8ed5('0x67')][_0x8ed5('0x3e')](_0x8ed5('0x68'),{'type':db[_0x8ed5('0x67')]['QueryTypes']['SELECT']})['then'](function(_0x2c6ba2){if(_0x2c6ba2&&_0x2c6ba2[_0x8ed5('0x49')]){for(var _0x28720f=0x0,_0x40b6f5=_0x2c6ba2[_0x8ed5('0x49')];_0x28720f<_0x40b6f5&&_['isNil'](_0x199de3[_0x8ed5('0x65')]);_0x28720f++){if(_0x3ad9cf[_0x8ed5('0x66')]<=_0x2c6ba2[_0x28720f][_0x8ed5('0x69')]){_0x199de3[_0x8ed5('0x65')]=_0x2c6ba2[_0x28720f][_0x8ed5('0x69')];}else if(_0x3ad9cf[_0x8ed5('0x66')]>_0x2c6ba2[_0x28720f][_0x8ed5('0x69')]&&_0x3ad9cf[_0x8ed5('0x66')]<=_0x2c6ba2[_0x28720f]['to']){_0x199de3[_0x8ed5('0x65')]=_0x3ad9cf[_0x8ed5('0x66')];}}}if(_['isNil'](_0x199de3['internal'])){_0x199de3[_0x8ed5('0x65')]=_0x1088d9+0x1;}return _0x2b0c58(_0x199de3);});});})['catch'](function(_0x352ccc){_0x200394(_0x352ccc);});});}function updateUser(_0x3e74b4){return new Promise(function(_0x42213b,_0x55bb01){try{if(_0x3e74b4[_0x8ed5('0x6a')]){_0x3e74b4[_0x8ed5('0x6b')]=_0x3e74b4['internal'];_0x3e74b4[_0x8ed5('0x6c')]={'mailbox':_0x3e74b4[_0x8ed5('0x65')],'password':_0x3e74b4[_0x8ed5('0x3b')],'fullname':_0x3e74b4['fullname'],'email':_0x3e74b4[_0x8ed5('0x6d')]};}if(_0x3e74b4['role']===_0x8ed5('0x28')){if(!_0x3e74b4['permissions'])_0x3e74b4[_0x8ed5('0x6e')]=[_0x8ed5('0x6f'),_0x8ed5('0x70'),_0x8ed5('0x71'),_0x8ed5('0x72'),_0x8ed5('0x73'),'104','105',_0x8ed5('0x74'),_0x8ed5('0x75'),_0x8ed5('0x76'),_0x8ed5('0x77'),_0x8ed5('0x78'),_0x8ed5('0x79'),_0x8ed5('0x7a'),_0x8ed5('0x7b')];}_0x42213b(_0x3e74b4);}catch(_0x53e362){_0x55bb01(_0x53e362);}});}exports['create']=function(_0x2ddb83,_0x490ad1){if(_0x2ddb83[_0x8ed5('0x7c')]['role']==='agent')throw new Error('Unauthorized');if(_0x2ddb83[_0x8ed5('0x5b')]['role']===_0x8ed5('0x7c')&&_0x2ddb83[_0x8ed5('0x7c')][_0x8ed5('0x32')]!==_0x8ed5('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2ddb83[_0x8ed5('0x5b')][_0x8ed5('0x32')]===_0x8ed5('0x2b')&&_0x2ddb83[_0x8ed5('0x7c')][_0x8ed5('0x32')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x8ed5('0x7d')]([_0x2ddb83[_0x8ed5('0x5b')]])[_0x8ed5('0x16')](function(){return validateUser(_0x2ddb83[_0x8ed5('0x5b')]);})['then'](function(_0x1c5999){return updateUser(_0x1c5999)[_0x8ed5('0x16')](function(_0x471ae4){if(_0x471ae4[_0x8ed5('0x32')]===_0x8ed5('0x2b')){_0x471ae4[_0x8ed5('0x7e')]=_0x2ddb83[_0x8ed5('0x7c')]['settingsEnabled'];delete _0x471ae4['userProfileId'];}return _0x471ae4;});})[_0x8ed5('0x16')](function(_0x5cd2c3){return db[_0x8ed5('0x37')][_0x8ed5('0x7f')](_0x5cd2c3,{'include':[{'model':db[_0x8ed5('0x6c')],'as':_0x8ed5('0x6c')}]});})[_0x8ed5('0x16')](function(_0x246878){if(_0x2ddb83['body'][_0x8ed5('0x32')]==='user')return _0x246878;if(_0x2ddb83[_0x8ed5('0x7c')]['role']!==_0x8ed5('0x7c'))return _0x246878;return db[_0x8ed5('0x80')]['find']({'where':{'name':_0x246878[_0x8ed5('0x32')]===_0x8ed5('0x28')?_0x8ed5('0x81'):_0x8ed5('0x82'),'userProfileId':_0x2ddb83[_0x8ed5('0x7c')][_0x8ed5('0x83')]},'raw':!![]})[_0x8ed5('0x16')](function(_0x1a2a44){if(!_0x1a2a44||_0x1a2a44[_0x8ed5('0x84')]!=0x0)return _0x246878;return db[_0x8ed5('0x33')][_0x8ed5('0x7f')]({'name':_0x246878[_0x8ed5('0x34')],'resourceId':_0x246878['id'],'type':_0x1a2a44['name'],'sectionId':_0x1a2a44['id']},{})[_0x8ed5('0x16')](function(){return _0x246878;});})[_0x8ed5('0x1e')](function(_0x1d848b){logger[_0x8ed5('0x1c')](_0x8ed5('0x85'),_0x1d848b);throw _0x1d848b;});})[_0x8ed5('0x16')](respondWithResult(_0x490ad1,0xc9))[_0x8ed5('0x1e')](handleError(_0x490ad1,null));};exports['bulkCreate']=function(_0x1ddb67,_0x160a1c){var _0x1f8a54=_0x1ddb67[_0x8ed5('0x5b')];var _0x216ba8=[];if(_0x1ddb67[_0x8ed5('0x7c')][_0x8ed5('0x32')]===_0x8ed5('0x28'))throw new Error('Unauthorized');if(_['some'](_0x1f8a54,[_0x8ed5('0x32'),_0x8ed5('0x7c')])&&_0x1ddb67['user'][_0x8ed5('0x32')]!==_0x8ed5('0x2b')){throw new Error(_0x8ed5('0x86'));}if(_['some'](_0x1f8a54,[_0x8ed5('0x32'),_0x8ed5('0x2b')])&&_0x1ddb67[_0x8ed5('0x7c')][_0x8ed5('0x32')]!==_0x8ed5('0x2b')){throw new Error(_0x8ed5('0x87'));}return licenseUtil['checkUserLimits'](_0x1f8a54)[_0x8ed5('0x16')](function(){return validateUser(_0x1f8a54[0x0]);})[_0x8ed5('0x16')](function(){for(var _0x4f303f=0x1;_0x4f303f<_0x1f8a54[_0x8ed5('0x49')];_0x4f303f++){var _0x2c1893=_0x1f8a54[_0x4f303f-0x1][_0x8ed5('0x65')];if(!_0x1f8a54[_0x4f303f]['internal'])_0x1f8a54[_0x4f303f][_0x8ed5('0x65')]=_0x2c1893+0x1;_0x216ba8[_0x8ed5('0x44')](validateUser(_0x1f8a54[_0x4f303f]));}return Promise[_0x8ed5('0x5a')](_0x216ba8);})[_0x8ed5('0x16')](function(){_0x216ba8=[];for(var _0x566a37=0x0;_0x566a37<_0x1f8a54[_0x8ed5('0x49')];_0x566a37++){_0x216ba8[_0x8ed5('0x44')](updateUser(_0x1f8a54[_0x566a37]));}return Promise[_0x8ed5('0x5a')](_0x216ba8);})[_0x8ed5('0x16')](function(){_0x216ba8=_0x1f8a54['map'](function(_0x29afbf){return db[_0x8ed5('0x37')][_0x8ed5('0x7f')](_0x29afbf,{'include':[{'model':db['VoiceMail'],'as':_0x8ed5('0x6c')}]})['then'](function(_0x118681){_0x29afbf['id']=_0x118681['id'];return _0x29afbf;});});return Promise['all'](_0x216ba8);})[_0x8ed5('0x16')](function(_0x590500){if(_0x1ddb67[_0x8ed5('0x5b')][_0x8ed5('0x32')]===_0x8ed5('0x7c'))return _0x590500;if(_0x1ddb67[_0x8ed5('0x7c')][_0x8ed5('0x32')]!==_0x8ed5('0x7c'))return _0x590500;var _0x3590f4=_[_0x8ed5('0x88')](_0x590500,function(_0x4d5b5e){return _0x4d5b5e[_0x8ed5('0x32')]===_0x8ed5('0x28')||_0x4d5b5e['role']===_0x8ed5('0x89');});if(!_0x3590f4)return _0x590500;return db[_0x8ed5('0x80')][_0x8ed5('0x45')]({'where':{'name':{'$or':[_0x8ed5('0x81'),_0x8ed5('0x82')]},'userProfileId':_0x1ddb67[_0x8ed5('0x7c')][_0x8ed5('0x83')]},'raw':!![]})['then'](function(_0x3d33e7){if(_[_0x8ed5('0x8a')](_0x3d33e7)||!_[_0x8ed5('0x88')](_0x3d33e7,[_0x8ed5('0x84'),0x0]))return _0x590500;_0x216ba8=[];var _0x575876=_(_0x3d33e7)[_0x8ed5('0x2e')](function(_0x230062){if(_0x230062[_0x8ed5('0x84')]===0x1)return;return _0x230062[_0x8ed5('0x34')]===_0x8ed5('0x81')?'agent':_0x8ed5('0x89');})['compact']()[_0x8ed5('0x2f')]();for(var _0x2d3308=0x0;_0x2d3308<_0x590500[_0x8ed5('0x49')];_0x2d3308++){if(!_[_0x8ed5('0x30')](_0x575876,_0x590500[_0x2d3308][_0x8ed5('0x32')]))return;var _0x390485=_0x590500[_0x2d3308][_0x8ed5('0x32')]==='agent'?_0x8ed5('0x81'):_0x8ed5('0x82');_0x216ba8['push'](db[_0x8ed5('0x33')][_0x8ed5('0x7f')]({'name':_0x590500[_0x2d3308][_0x8ed5('0x34')],'resourceId':_0x590500[_0x2d3308]['id'],'type':_0x390485,'sectionId':_[_0x8ed5('0x31')](_0x3d33e7,['name',_0x390485])['id']},{}));}return Promise[_0x8ed5('0x5a')](_0x216ba8);});})[_0x8ed5('0x16')](respondWithResult(_0x160a1c,0xc9))[_0x8ed5('0x1e')](handleError(_0x160a1c,null));};exports[_0x8ed5('0x8b')]=function(_0x553204,_0x35a15f){if(_0x553204['body']['id']){delete _0x553204['body']['id'];}return db['User'][_0x8ed5('0x31')]({'where':{'id':_0x553204[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](function(_0x1e89fb){if(!_0x1e89fb)return null;if(_0x1e89fb['id']===_0x553204['user']['id']){if(!_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8d')]||!_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')]){throw new db[(_0x8ed5('0x8f'))]['ValidationError'](_0x8ed5('0x90'));}if(!_0x1e89fb['authenticate'](_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8d')])){throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0x92'));}if(_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8d')]===_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')]){throw new db[(_0x8ed5('0x8f'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x553204[_0x8ed5('0x7c')][_0x8ed5('0x32')]===_0x8ed5('0x2b')){if(!_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')]){throw new db[(_0x8ed5('0x8f'))]['ValidationError'](_0x8ed5('0x93'));}}else if(_0x553204[_0x8ed5('0x7c')]['role']==='user'){if(!_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')]){throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0x93'));}if(_0x1e89fb[_0x8ed5('0x32')]!==_0x8ed5('0x28')){throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0x94'));}}else{throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0x94'));}return _0x1e89fb;})['then'](handleEntityNotFound(_0x35a15f,null))[_0x8ed5('0x16')](function(_0x2d7c36){return db[_0x8ed5('0x60')][_0x8ed5('0x95')]({'attributes':['id',_0x8ed5('0x62'),_0x8ed5('0x96'),_0x8ed5('0x97')]})['then'](function(_0x210db9){if(_0x210db9[_0x8ed5('0x62')])authService['validatePasswordPattern'](_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')]);if(!_0x210db9[_0x8ed5('0x96')]||!_0x2d7c36[_0x8ed5('0x98')])return _0x2d7c36;authService[_0x8ed5('0x99')](_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')],_0x2d7c36['previousPasswords'],_0x210db9[_0x8ed5('0x97')]);return _0x2d7c36;})[_0x8ed5('0x16')](saveUpdates({'password':_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')],'passwordResetAt':_0x553204[_0x8ed5('0x7c')]['id']==_0x553204['params']['id']?moment():null,'previousPasswords':authService[_0x8ed5('0x9a')](_0x553204[_0x8ed5('0x5b')][_0x8ed5('0x8e')],_0x2d7c36[_0x8ed5('0x98')])},null));})['then'](respondWithResult(_0x35a15f,null))[_0x8ed5('0x1e')](handleError(_0x35a15f,null));};exports[_0x8ed5('0x9b')]=function(_0x1fadc3,_0x88b720){var _0x1aa083=_0x1fadc3[_0x8ed5('0x5b')][_0x8ed5('0x9c')];return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x1fadc3[_0x8ed5('0x8c')]['id']},'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0x32'),'online','loginInPause','voicePause',_0x8ed5('0x9d')]})[_0x8ed5('0x16')](handleEntityNotFound(_0x88b720,null))[_0x8ed5('0x16')](function(_0x4f53b2){if(_0x4f53b2){if(!utils[_0x8ed5('0x9e')](_0x1aa083)){throw new db['Sequelize'][(_0x8ed5('0x91'))](_0x8ed5('0x9f'));}return _0x4f53b2[_0x8ed5('0xa0')+_[_0x8ed5('0xa1')](_0x1aa083['toLowerCase']())+_0x8ed5('0xa2')](_0x1fadc3[_0x8ed5('0x5b')][_0x8ed5('0x5e')],{'penalty':_0x1fadc3[_0x8ed5('0x5b')]['penalty']||0x0})['spread'](function(_0x389e24){for(var _0x2954c4=0x0;_0x2954c4<_0x1fadc3[_0x8ed5('0x5b')]['ids'][_0x8ed5('0x49')];_0x2954c4+=0x1){var _0x3da900={'UserId':Number(_0x1fadc3[_0x8ed5('0x8c')]['id'])};_0x3da900[_['capitalize'](_0x1aa083[_0x8ed5('0xa3')]())+_0x8ed5('0xa4')]=Number(_0x1fadc3['body']['ids'][_0x2954c4]);socket[_0x8ed5('0xa5')](_0x8ed5('0x7c')+_[_0x8ed5('0xa1')](_0x1aa083['toLowerCase']())+_0x8ed5('0xa6'),_0x3da900);}return _0x389e24;})[_0x8ed5('0x16')](function(){if(_0x1aa083===_0x8ed5('0xa7')){return db[_0x8ed5('0xa8')][_0x8ed5('0x45')]({'where':{'id':_0x1fadc3[_0x8ed5('0x5b')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x8ed5('0x16')](function(_0x53ca63){var _0x2bc72f=_0x4f53b2[_0x8ed5('0x2a')]({'plain':!![]});var _0x2469c1=[];if(_0x1aa083==='voice'&&_0x2bc72f[_0x8ed5('0x32')]==='agent'&&_0x2bc72f[_0x8ed5('0xa9')]){for(let _0x198022=0x0;_0x198022<_0x53ca63[_0x8ed5('0x49')];_0x198022+=0x1){_0x2469c1[_0x8ed5('0x44')]({'membername':_0x2bc72f[_0x8ed5('0x34')],'UserId':_0x2bc72f['id'],'queue_name':_0x53ca63[_0x198022][_0x8ed5('0x34')],'VoiceQueueId':_0x53ca63[_0x198022]['id'],'interface':_['isNil'](_0x2bc72f['interface'])?util['format'](_0x8ed5('0xaa'),_0x2bc72f['name']):_0x2bc72f['interface'],'paused':_0x2bc72f[_0x8ed5('0xab')]||![],'penalty':_0x1fadc3[_0x8ed5('0x5b')][_0x8ed5('0xac')]||0x0});}return Promise[_0x8ed5('0x5a')](_0x2469c1[_0x8ed5('0x2e')](function(_0x2bed93){return db[_0x8ed5('0xad')]['upsert'](_0x2bed93);}));}return _0x4f53b2;});}})[_0x8ed5('0x16')](respondWithStatusCode(_0x88b720,null))[_0x8ed5('0x1e')](handleError(_0x88b720,null));};exports[_0x8ed5('0xae')]=function(_0x80507e,_0x4fa380){var _0x4ce1ef,_0x5932fa;return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x80507e[_0x8ed5('0x8c')]['id']},'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0x32')]})[_0x8ed5('0x16')](handleEntityNotFound(_0x4fa380,null))[_0x8ed5('0x16')](function(_0x3f0616){if(_0x3f0616){_0x4ce1ef=_0x3f0616;if(!_0x80507e['query'][_0x8ed5('0x9c')]||!utils['isValidChannel'](_0x80507e[_0x8ed5('0x3e')][_0x8ed5('0x9c')])){throw new db[(_0x8ed5('0x8f'))]['ValidationError'](_0x8ed5('0x9f'));}return _0x3f0616[_0x8ed5('0xaf')+_[_0x8ed5('0xa1')](_0x80507e[_0x8ed5('0x3e')]['channel'][_0x8ed5('0xa3')]())+_0x8ed5('0xa2')](_0x80507e[_0x8ed5('0x3e')][_0x8ed5('0x5e')]);}})[_0x8ed5('0x16')](function(_0x3750e6){if(_[_0x8ed5('0xb0')](_0x80507e[_0x8ed5('0x3e')][_0x8ed5('0x5e')])){for(var _0x340e59=0x0;_0x340e59<_0x80507e[_0x8ed5('0x3e')][_0x8ed5('0x5e')]['length'];_0x340e59+=0x1){_0x5932fa={'UserId':Number(_0x80507e['params']['id'])};_0x5932fa[_['capitalize'](_0x80507e['query'][_0x8ed5('0x9c')][_0x8ed5('0xa3')]())+_0x8ed5('0xa4')]=Number(_0x80507e['query'][_0x8ed5('0x5e')][_0x340e59]);socket[_0x8ed5('0xa5')]('user'+_[_0x8ed5('0xa1')](_0x80507e['query'][_0x8ed5('0x9c')][_0x8ed5('0xa3')]())+_0x8ed5('0xb1'),_0x5932fa);}}else{_0x5932fa={'UserId':Number(_0x80507e['params']['id'])};_0x5932fa[_['capitalize'](_0x80507e['query'][_0x8ed5('0x9c')]['toLowerCase']())+_0x8ed5('0xa4')]=Number(_0x80507e[_0x8ed5('0x3e')]['ids']);socket[_0x8ed5('0xa5')](_0x8ed5('0x7c')+_['capitalize'](_0x80507e[_0x8ed5('0x3e')][_0x8ed5('0x9c')][_0x8ed5('0xa3')]())+_0x8ed5('0xb1'),_0x5932fa);}return _0x3750e6;})['then'](function(){if(_0x80507e['query'][_0x8ed5('0x9c')]===_0x8ed5('0xa7')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x80507e[_0x8ed5('0x8c')]['id'],'VoiceQueueId':_0x80507e[_0x8ed5('0x3e')]['ids']},'individualHooks':!![]})[_0x8ed5('0x16')](function(){return _0x4ce1ef;});}return _0x4ce1ef;})[_0x8ed5('0x16')](respondWithStatusCode(_0x4fa380,null))['catch'](handleError(_0x4fa380,null));};exports[_0x8ed5('0xb2')]=function(_0x23a2a3,_0x45c057){_0x23a2a3[_0x8ed5('0x5b')][_0x8ed5('0xb3')]=_0x23a2a3[_0x8ed5('0xb4')]['filename'];return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x23a2a3[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x45c057,null))['then'](saveUpdates(_0x23a2a3[_0x8ed5('0x5b')],null))[_0x8ed5('0x16')](respondWithResult(_0x45c057,null))[_0x8ed5('0x1e')](handleError(_0x45c057,null));};exports['getAvatar']=function(_0x2939eb,_0xe514cf){var _0x26caae=path[_0x8ed5('0xb5')](config[_0x8ed5('0xb6')],_0x8ed5('0xb7'));return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x2939eb['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x8ed5('0x16')](handleEntityNotFound(_0xe514cf,null))[_0x8ed5('0x16')](function(_0x5b924a){if(_0x5b924a){if(_[_0x8ed5('0xb8')](_0x5b924a['userpic'])){return _0xe514cf[_0x8ed5('0xb9')](_0x26caae);}else{if(!fs[_0x8ed5('0xba')](path[_0x8ed5('0xb5')](config[_0x8ed5('0xb6')],_0x8ed5('0xbb'),_0x5b924a['userpic']))){return _0xe514cf[_0x8ed5('0xb9')](_0x26caae);}return _0xe514cf['download'](path['join'](config[_0x8ed5('0xb6')],_0x8ed5('0xbb'),_0x5b924a[_0x8ed5('0xb3')]));}}})[_0x8ed5('0x1e')](handleError(_0xe514cf,null));};exports['getOpenTabs']=function(_0x4d4135,_0x3be51d){return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x4d4135[_0x8ed5('0x8c')]['id']},'attributes':['id']})[_0x8ed5('0x16')](handleEntityNotFound(_0x3be51d,null))['then'](function(_0x10b1ec){var _0x56e6f7=[];values=_0x10b1ec[_0x8ed5('0x4a')];_0x56e6f7['push'](get_open_tabs(_0x8ed5('0x58'),_0x10b1ec['dataValues']));_0x56e6f7['push'](get_open_tabs(_0x8ed5('0x4b'),_0x10b1ec[_0x8ed5('0x4a')]));_0x56e6f7[_0x8ed5('0x44')](get_open_tabs('openchannel',_0x10b1ec['dataValues']));_0x56e6f7[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0x4d'),_0x10b1ec[_0x8ed5('0x4a')]));_0x56e6f7[_0x8ed5('0x44')](get_open_tabs(_0x8ed5('0xbc'),_0x10b1ec[_0x8ed5('0x4a')]));_0x56e6f7['push'](get_open_tabs(_0x8ed5('0x4c'),_0x10b1ec['dataValues']));return Promise[_0x8ed5('0x5a')](_0x56e6f7);})[_0x8ed5('0x16')](function(_0x566c49){if(_0x566c49){var _0x322360=_['map'](values[_0x8ed5('0xbd')],function(_0x5521b8){return{'channel':_0x8ed5('0xbe'),'id':_0x5521b8['id'],'createdAt':_0x5521b8[_0x8ed5('0xbf')]};});var _0x14c9a6=_[_0x8ed5('0x2e')](values[_0x8ed5('0xc0')],function(_0x19754c){return{'channel':_0x8ed5('0xc1'),'id':_0x19754c['id'],'createdAt':_0x19754c[_0x8ed5('0xbf')]};});var _0x593b27=_[_0x8ed5('0x2e')](values[_0x8ed5('0xc2')],function(_0x5deba2){return{'channel':_0x8ed5('0xc3'),'id':_0x5deba2['id'],'createdAt':_0x5deba2['createdAt']};});var _0x2da9f2=_[_0x8ed5('0x2e')](values[_0x8ed5('0xc4')],function(_0x595a61){return{'channel':_0x8ed5('0xc5'),'id':_0x595a61['id'],'createdAt':_0x595a61[_0x8ed5('0xbf')]};});var _0x1cd212=_[_0x8ed5('0x2e')](values[_0x8ed5('0xc6')],function(_0x45c97f){return{'channel':'SMS','id':_0x45c97f['id'],'createdAt':_0x45c97f[_0x8ed5('0xbf')]};});var _0x15d973=_['map'](values[_0x8ed5('0xc7')],function(_0x4937c2){return{'channel':_0x8ed5('0xc8'),'id':_0x4937c2['id'],'createdAt':_0x4937c2[_0x8ed5('0xbf')]};});var _0x3195f0=_[_0x8ed5('0xc9')](_0x322360,_0x14c9a6,_0x593b27,_0x2da9f2,_0x1cd212,_0x15d973);var _0x27823d={'count':_0x3195f0[_0x8ed5('0x49')],'rows':_0x3195f0};return _0x27823d;}else return null;})['then'](respondWithResult(_0x3be51d,null))['catch'](handleError(_0x3be51d,null));};exports[_0x8ed5('0xca')]=function(_0x5899c7,_0x1ce5f5){var _0x2ae36b={};var _0x372efa={};var _0x11c6e0;var _0x3c3666;return db['User'][_0x8ed5('0x95')]({'where':{'id':_0x5899c7[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x1ce5f5,null))[_0x8ed5('0x16')](function(_0x2774fb){if(_0x2774fb){_0x11c6e0=_0x2774fb;_0x372efa[_0x8ed5('0x54')]=_['keys'](db[_0x8ed5('0xcb')][_0x8ed5('0x50')]);_0x372efa['query']=_[_0x8ed5('0x4f')](_0x5899c7['query']);_0x372efa[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x372efa[_0x8ed5('0x54')],_0x372efa['query']);_0x2ae36b[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x372efa['model'],qs['fields'](_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x2ae36b[_0x8ed5('0x43')]=_0x2ae36b[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x2ae36b[_0x8ed5('0x43')]:_0x372efa[_0x8ed5('0x54')];_0x2ae36b[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x5899c7['query'][_0x8ed5('0xcd')]);_0x2ae36b[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_['pick'](_0x5899c7[_0x8ed5('0x3e')],_0x372efa[_0x8ed5('0x52')]));if(_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x2ae36b[_0x8ed5('0x3d')]=_['merge'](_0x2ae36b['where'],{'$or':_[_0x8ed5('0x2e')](_0x2ae36b['attributes'],function(_0x8bd467){var _0x1d7686={};_0x1d7686[_0x8bd467]={'$like':'%'+_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x1d7686;})});}_0x2ae36b=_['merge']({},_0x2ae36b,_0x5899c7[_0x8ed5('0x57')]);return _0x11c6e0['getContacts'](_0x2ae36b);}})[_0x8ed5('0x16')](function(_0x183124){if(_0x183124){_0x3c3666=_0x183124['length'];if(_0x5899c7['query'][_0x8ed5('0xce')](_0x8ed5('0x3f'))){_0x2ae36b[_0x8ed5('0x40')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x8ed5('0xcf')],'as':_0x8ed5('0xd0'),'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0xd1')],'where':_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0xd2')]?{'id':_0x5899c7[_0x8ed5('0x3e')]['tag']}:undefined,'required':_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0xd2')]?!![]:![]}];}if(!_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0xce')]('nolimit')){_0x2ae36b['limit']=qs[_0x8ed5('0x22')](_0x5899c7[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x2ae36b['offset']=qs[_0x8ed5('0x24')](_0x5899c7['query']['offset']);}return _0x11c6e0['getContacts'](_0x2ae36b);}})[_0x8ed5('0x16')](function(_0x3d0060){if(_0x3d0060){return _0x3d0060?{'count':_0x3c3666,'rows':_0x3d0060}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x1ce5f5,null))[_0x8ed5('0x1e')](handleError(_0x1ce5f5,null));};exports[_0x8ed5('0xd3')]=function(_0x1ee914,_0x39375a){var _0x5f3ec7;var _0x2bc08c={};var _0x1d6be2;return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x1ee914[_0x8ed5('0x8c')]['id']},'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0x32')]})[_0x8ed5('0x16')](handleEntityNotFound(_0x39375a,null))[_0x8ed5('0x16')](function(_0x5ada1b){if(!utils[_0x8ed5('0x9e')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x9c')])){throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0x9f'));}_0x5f3ec7=_0x5ada1b;var _0x37dbf7={};_0x37dbf7[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_[_0x8ed5('0xa1')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x9c')])+'Queue'][_0x8ed5('0x50')]);_0x37dbf7[_0x8ed5('0x3e')]=_['keys'](_0x1ee914[_0x8ed5('0x3e')]);_0x37dbf7[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x37dbf7['model'],_0x37dbf7[_0x8ed5('0x3e')]);_0x2bc08c[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x37dbf7[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x2bc08c['attributes']=_0x2bc08c[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x2bc08c['attributes']:_0x37dbf7[_0x8ed5('0x54')];_0x2bc08c[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x2bc08c[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x1ee914['query'],_0x37dbf7[_0x8ed5('0x52')]));if(_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x2bc08c[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x2bc08c[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x2bc08c[_0x8ed5('0x43')],function(_0x5238c7){var _0x4c43cd={};_0x4c43cd[_0x5238c7]={'$like':'%'+_0x1ee914['query']['filter']+'%'};return _0x4c43cd;})});}_0x2bc08c=_[_0x8ed5('0x56')]({},_0x2bc08c,_0x1ee914['options']);switch(_0x5f3ec7[_0x8ed5('0x32')]){case'admin':return db[_[_0x8ed5('0xa1')](_0x1ee914['query'][_0x8ed5('0x9c')])+_0x8ed5('0xd5')][_0x8ed5('0x45')](_0x2bc08c);case _0x8ed5('0x7c'):case'agent':return _0x5f3ec7[_0x8ed5('0x2a')+_[_0x8ed5('0xa1')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x9c')])+_0x8ed5('0xa2')](_0x2bc08c);default:throw new db[(_0x8ed5('0x8f'))][(_0x8ed5('0x91'))](_0x8ed5('0xd6'));}})['then'](function(_0x52150a){_0x1d6be2=_0x52150a[_0x8ed5('0x49')];if(!_0x1ee914['query'][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x2bc08c[_0x8ed5('0x22')]=qs[_0x8ed5('0x22')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x2bc08c[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}switch(_0x5f3ec7['role']){case _0x8ed5('0x2b'):return db[_[_0x8ed5('0xa1')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x9c')])+'Queue']['findAll'](_0x2bc08c);case _0x8ed5('0x7c'):case _0x8ed5('0x28'):return _0x5f3ec7[_0x8ed5('0x2a')+_[_0x8ed5('0xa1')](_0x1ee914[_0x8ed5('0x3e')][_0x8ed5('0x9c')])+'Queues'](_0x2bc08c);}})[_0x8ed5('0x16')](function(_0x194a0c){return{'count':_0x1d6be2,'rows':_0x194a0c};})['then'](respondWithResult(_0x39375a,null))[_0x8ed5('0x1e')](handleError(_0x39375a,null));};exports[_0x8ed5('0xd8')]=function(_0x11f9af,_0x54919c){var _0x8b9c5a={};var _0x816035={};var _0x4fcdef;var _0x21f773;return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x11f9af['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x54919c,null))[_0x8ed5('0x16')](function(_0x878c1e){if(_0x878c1e){_0x4fcdef=_0x878c1e;_0x816035[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0xad')][_0x8ed5('0x50')]);_0x816035[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x11f9af[_0x8ed5('0x3e')]);_0x816035[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x816035['model'],_0x816035['query']);_0x8b9c5a['attributes']=_[_0x8ed5('0x53')](_0x816035[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x8b9c5a[_0x8ed5('0x43')]=_0x8b9c5a['attributes'][_0x8ed5('0x49')]?_0x8b9c5a[_0x8ed5('0x43')]:_0x816035[_0x8ed5('0x54')];_0x8b9c5a[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x8b9c5a[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x11f9af[_0x8ed5('0x3e')],_0x816035[_0x8ed5('0x52')]));if(_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x8b9c5a[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x8b9c5a[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x8b9c5a[_0x8ed5('0x43')],function(_0x234e46){var _0x25b026={};_0x25b026[_0x234e46]={'$like':'%'+_0x11f9af['query'][_0x8ed5('0x2d')]+'%'};return _0x25b026;})});}_0x8b9c5a=_[_0x8ed5('0x56')]({},_0x8b9c5a,_0x11f9af[_0x8ed5('0x57')]);return _0x4fcdef[_0x8ed5('0xd8')](_0x8b9c5a);}})[_0x8ed5('0x16')](function(_0x410f38){if(_0x410f38){_0x21f773=_0x410f38['length'];if(!_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x8b9c5a[_0x8ed5('0x22')]=qs[_0x8ed5('0x22')](_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x8b9c5a[_0x8ed5('0x24')]=qs['offset'](_0x11f9af[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x4fcdef[_0x8ed5('0xd8')](_0x8b9c5a);}})[_0x8ed5('0x16')](function(_0x492b7e){if(_0x492b7e){return _0x492b7e?{'count':_0x21f773,'rows':_0x492b7e}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x54919c,null))[_0x8ed5('0x1e')](handleError(_0x54919c,null));};exports[_0x8ed5('0xd9')]=function(_0x464ffd,_0x416634){var _0x44864c={};var _0x100a4a={};var _0x5ea8f2;var _0x3264bc;return db['User'][_0x8ed5('0x95')]({'where':{'id':_0x464ffd[_0x8ed5('0x8c')]['id']}})['then'](handleEntityNotFound(_0x416634,null))[_0x8ed5('0x16')](function(_0x567ea5){if(_0x567ea5){_0x5ea8f2=_0x567ea5;_0x100a4a[_0x8ed5('0x54')]=_['keys'](db[_0x8ed5('0xda')][_0x8ed5('0x50')]);_0x100a4a['query']=_[_0x8ed5('0x4f')](_0x464ffd[_0x8ed5('0x3e')]);_0x100a4a['filters']=_['intersection'](_0x100a4a[_0x8ed5('0x54')],_0x100a4a['query']);_0x44864c[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x100a4a[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x464ffd['query']['fields']));_0x44864c[_0x8ed5('0x43')]=_0x44864c[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x44864c[_0x8ed5('0x43')]:_0x100a4a['model'];_0x44864c['order']=qs[_0x8ed5('0xcd')](_0x464ffd[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x44864c[_0x8ed5('0x3d')]=qs['filters'](_[_0x8ed5('0xd4')](_0x464ffd['query'],_0x100a4a['filters']));if(_0x464ffd[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x44864c[_0x8ed5('0x3d')]=_['merge'](_0x44864c[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x44864c[_0x8ed5('0x43')],function(_0x769716){var _0x5ed7ce={};_0x5ed7ce[_0x769716]={'$like':'%'+_0x464ffd[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x5ed7ce;})});}_0x44864c=_[_0x8ed5('0x56')]({},_0x44864c,_0x464ffd[_0x8ed5('0x57')]);return _0x5ea8f2[_0x8ed5('0xd9')](_0x44864c);}})[_0x8ed5('0x16')](function(_0x4638c2){if(_0x4638c2){_0x3264bc=_0x4638c2[_0x8ed5('0x49')];if(!_0x464ffd[_0x8ed5('0x3e')]['hasOwnProperty'](_0x8ed5('0xd7'))){_0x44864c['limit']=qs[_0x8ed5('0x22')](_0x464ffd[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x44864c[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x464ffd['query'][_0x8ed5('0x24')]);}return _0x5ea8f2[_0x8ed5('0xd9')](_0x44864c);}})[_0x8ed5('0x16')](function(_0x334029){if(_0x334029){return _0x334029?{'count':_0x3264bc,'rows':_0x334029}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x416634,null))['catch'](handleError(_0x416634,null));};exports[_0x8ed5('0xdb')]=function(_0x5841b8,_0x18d7bf){var _0x1cf85c={'raw':!![],'where':{}};var _0x196096={};var _0x2da655={'count':0x0,'rows':[]};return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x5841b8[_0x8ed5('0x8c')]['id']}})['then'](handleEntityNotFound(_0x18d7bf,null))['then'](function(_0x12c99e){if(_0x12c99e){_0x196096['model']=_['keys'](db[_0x8ed5('0xdc')][_0x8ed5('0x50')]);_0x196096[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x5841b8[_0x8ed5('0x3e')]);_0x196096[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x196096['model'],_0x196096[_0x8ed5('0x3e')]);_0x1cf85c[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x196096[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x5841b8[_0x8ed5('0x3e')]['fields']));_0x1cf85c[_0x8ed5('0x43')]=_0x1cf85c[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x1cf85c[_0x8ed5('0x43')]:_0x196096['model'];if(!_0x5841b8['query'][_0x8ed5('0xce')]('nolimit')){_0x1cf85c['limit']=qs[_0x8ed5('0x22')](_0x5841b8[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x1cf85c[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x5841b8['query'][_0x8ed5('0x24')]);}_0x1cf85c['order']=qs[_0x8ed5('0xcd')](_0x5841b8[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x1cf85c[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x5841b8['query'],_0x196096[_0x8ed5('0x52')]));_0x1cf85c[_0x8ed5('0x3d')]['UserId']=_0x12c99e['id'];if(_0x5841b8[_0x8ed5('0x3e')]['filter']){_0x1cf85c['where']=_['merge'](_0x1cf85c[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x1cf85c[_0x8ed5('0x43')],function(_0xa74b78){var _0x4ea666={};_0x4ea666[_0xa74b78]={'$like':'%'+_0x5841b8[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x4ea666;})});}_0x1cf85c=_[_0x8ed5('0x56')]({},_0x1cf85c,_0x5841b8[_0x8ed5('0x57')]);return db[_0x8ed5('0xdc')][_0x8ed5('0x23')]({'where':_0x1cf85c[_0x8ed5('0x3d')]})[_0x8ed5('0x16')](function(_0xcb8433){_0x2da655[_0x8ed5('0x23')]=_0xcb8433;if(_0x5841b8['query'][_0x8ed5('0x3f')]){_0x1cf85c[_0x8ed5('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8ed5('0x45')](_0x1cf85c);})[_0x8ed5('0x16')](function(_0x4bc723){_0x2da655['rows']=_0x4bc723;return _0x2da655;});}})[_0x8ed5('0x16')](respondWithFilteredResult(_0x18d7bf,_0x1cf85c))[_0x8ed5('0x1e')](handleError(_0x18d7bf,null));};exports['getScreenRecordings']=function(_0x443496,_0x35ed00){var _0x240d39={'raw':!![],'where':{}};var _0x41213d={};var _0x28ab08={'count':0x0,'rows':[]};return db[_0x8ed5('0x37')]['findOne']({'where':{'id':_0x443496[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x35ed00,null))[_0x8ed5('0x16')](function(_0x3c54f4){if(_0x3c54f4){_0x41213d[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0xdd')][_0x8ed5('0x50')]);_0x41213d[_0x8ed5('0x3e')]=_['keys'](_0x443496[_0x8ed5('0x3e')]);_0x41213d[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x41213d[_0x8ed5('0x54')],_0x41213d[_0x8ed5('0x3e')]);_0x240d39[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x41213d['model'],qs['fields'](_0x443496[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x240d39[_0x8ed5('0x43')]=_0x240d39[_0x8ed5('0x43')]['length']?_0x240d39['attributes']:_0x41213d[_0x8ed5('0x54')];if(!_0x443496[_0x8ed5('0x3e')][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x240d39[_0x8ed5('0x22')]=qs['limit'](_0x443496['query']['limit']);_0x240d39['offset']=qs[_0x8ed5('0x24')](_0x443496[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}_0x240d39[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x443496[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x240d39[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_['pick'](_0x443496[_0x8ed5('0x3e')],_0x41213d[_0x8ed5('0x52')]));_0x240d39[_0x8ed5('0x3d')][_0x8ed5('0xde')]=_0x3c54f4['id'];if(_0x443496[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x240d39[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x240d39[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x240d39[_0x8ed5('0x43')],function(_0xfbe05e){var _0x584933={};_0x584933[_0xfbe05e]={'$like':'%'+_0x443496[_0x8ed5('0x3e')]['filter']+'%'};return _0x584933;})});}_0x240d39=_[_0x8ed5('0x56')]({},_0x240d39,_0x443496['options']);return db[_0x8ed5('0xdd')][_0x8ed5('0x23')]({'where':_0x240d39['where']})['then'](function(_0x19e497){_0x28ab08[_0x8ed5('0x23')]=_0x19e497;if(_0x443496[_0x8ed5('0x3e')][_0x8ed5('0x3f')]){_0x240d39[_0x8ed5('0x40')]=[{'all':!![]}];}return db[_0x8ed5('0xdd')]['findAll'](_0x240d39);})[_0x8ed5('0x16')](function(_0x40f231){_0x28ab08[_0x8ed5('0x46')]=_0x40f231;return _0x28ab08;});}})[_0x8ed5('0x16')](respondWithFilteredResult(_0x35ed00,_0x240d39))['catch'](handleError(_0x35ed00,null));};exports[_0x8ed5('0xdf')]=function(_0x4cbbf5,_0x218938){var _0x1967d7={};var _0x13feee={};var _0x542c61;var _0x1dfe62;return db[_0x8ed5('0x37')]['findOne']({'where':{'id':_0x4cbbf5[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x218938,null))[_0x8ed5('0x16')](function(_0xdb33ff){if(_0xdb33ff){_0x542c61=_0xdb33ff;_0x13feee[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0xe0')][_0x8ed5('0x50')]);_0x13feee[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x4cbbf5['query']);_0x13feee[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x13feee[_0x8ed5('0x54')],_0x13feee['query']);_0x1967d7[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x13feee[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x4cbbf5[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x1967d7[_0x8ed5('0x43')]=_0x1967d7[_0x8ed5('0x43')]['length']?_0x1967d7[_0x8ed5('0x43')]:_0x13feee[_0x8ed5('0x54')];_0x1967d7[_0x8ed5('0xcc')]=qs['sort'](_0x4cbbf5['query'][_0x8ed5('0xcd')]);_0x1967d7['where']=qs[_0x8ed5('0x52')](_['pick'](_0x4cbbf5['query'],_0x13feee[_0x8ed5('0x52')]));if(_0x4cbbf5[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x1967d7[_0x8ed5('0x3d')]=_['merge'](_0x1967d7[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x1967d7[_0x8ed5('0x43')],function(_0x373b76){var _0xa6afec={};_0xa6afec[_0x373b76]={'$like':'%'+_0x4cbbf5[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0xa6afec;})});}_0x1967d7=_[_0x8ed5('0x56')]({},_0x1967d7,_0x4cbbf5[_0x8ed5('0x57')]);return _0x542c61[_0x8ed5('0xdf')](_0x1967d7);}})[_0x8ed5('0x16')](function(_0x519f53){if(_0x519f53){_0x1dfe62=_0x519f53[_0x8ed5('0x49')];if(!_0x4cbbf5['query'][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x1967d7['limit']=qs['limit'](_0x4cbbf5[_0x8ed5('0x3e')]['limit']);_0x1967d7['offset']=qs[_0x8ed5('0x24')](_0x4cbbf5[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x542c61[_0x8ed5('0xdf')](_0x1967d7);}})[_0x8ed5('0x16')](function(_0x338548){if(_0x338548){return _0x338548?{'count':_0x1dfe62,'rows':_0x338548}:null;}})['then'](respondWithResult(_0x218938,null))['catch'](handleError(_0x218938,null));};exports[_0x8ed5('0xe1')]=function(_0x29d8b0,_0x45eac0){var _0x1caae2={};var _0x147d66={};var _0x445d3c;var _0x317883;return db['User'][_0x8ed5('0x95')]({'where':{'id':_0x29d8b0['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x45eac0,null))[_0x8ed5('0x16')](function(_0x575e71){if(_0x575e71){_0x445d3c=_0x575e71;_0x147d66[_0x8ed5('0x54')]=_['keys'](db['OpenchannelInteraction'][_0x8ed5('0x50')]);_0x147d66[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x29d8b0['query']);_0x147d66[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x147d66[_0x8ed5('0x54')],_0x147d66['query']);_0x1caae2['attributes']=_[_0x8ed5('0x53')](_0x147d66[_0x8ed5('0x54')],qs['fields'](_0x29d8b0['query'][_0x8ed5('0x55')]));_0x1caae2[_0x8ed5('0x43')]=_0x1caae2[_0x8ed5('0x43')]['length']?_0x1caae2[_0x8ed5('0x43')]:_0x147d66[_0x8ed5('0x54')];_0x1caae2[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x29d8b0[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x1caae2[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x29d8b0['query'],_0x147d66[_0x8ed5('0x52')]));if(_0x29d8b0[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x1caae2[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x1caae2[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x1caae2['attributes'],function(_0x957f08){var _0x3ad873={};_0x3ad873[_0x957f08]={'$like':'%'+_0x29d8b0['query']['filter']+'%'};return _0x3ad873;})});}_0x1caae2=_[_0x8ed5('0x56')]({},_0x1caae2,_0x29d8b0[_0x8ed5('0x57')]);return _0x445d3c[_0x8ed5('0xe1')](_0x1caae2);}})['then'](function(_0x24b861){if(_0x24b861){_0x317883=_0x24b861[_0x8ed5('0x49')];if(!_0x29d8b0['query'][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x1caae2[_0x8ed5('0x22')]=qs['limit'](_0x29d8b0[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x1caae2[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x29d8b0['query'][_0x8ed5('0x24')]);}return _0x445d3c[_0x8ed5('0xe1')](_0x1caae2);}})[_0x8ed5('0x16')](function(_0x4a7996){if(_0x4a7996){return _0x4a7996?{'count':_0x317883,'rows':_0x4a7996}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x45eac0,null))['catch'](handleError(_0x45eac0,null));};exports['getMailInteractions']=function(_0x5b285d,_0xfe5803){var _0x24a5a0={'raw':!![],'where':{}};var _0x1abc4d={};var _0x4789bc={'count':0x0,'rows':[]};return db[_0x8ed5('0x37')]['findOne']({'where':{'id':_0x5b285d[_0x8ed5('0x8c')]['id']}})['then'](handleEntityNotFound(_0xfe5803,null))[_0x8ed5('0x16')](function(_0x1b6090){if(_0x1b6090){_0x1abc4d['model']=_[_0x8ed5('0x4f')](db['MailInteraction'][_0x8ed5('0x50')]);_0x1abc4d[_0x8ed5('0x3e')]=_['keys'](_0x5b285d[_0x8ed5('0x3e')]);_0x1abc4d[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x1abc4d[_0x8ed5('0x54')],_0x1abc4d['query']);_0x24a5a0[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x1abc4d[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x5b285d['query'][_0x8ed5('0x55')]));_0x24a5a0[_0x8ed5('0x43')]=_0x24a5a0[_0x8ed5('0x43')]['length']?_0x24a5a0[_0x8ed5('0x43')]:_0x1abc4d[_0x8ed5('0x54')];if(!_0x5b285d['query']['hasOwnProperty']('nolimit')){_0x24a5a0['limit']=qs[_0x8ed5('0x22')](_0x5b285d[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x24a5a0[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x5b285d['query']['offset']);}_0x24a5a0[_0x8ed5('0xcc')]=qs[_0x8ed5('0xcd')](_0x5b285d[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x24a5a0[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_['pick'](_0x5b285d['query'],_0x1abc4d[_0x8ed5('0x52')]));_0x24a5a0[_0x8ed5('0x3d')]['UserId']=_0x1b6090['id'];if(_0x5b285d[_0x8ed5('0x3e')]['filter']){_0x24a5a0[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x24a5a0['where'],{'$or':_[_0x8ed5('0x2e')](_0x24a5a0[_0x8ed5('0x43')],function(_0x247ee1){var _0x3c1c13={};_0x3c1c13[_0x247ee1]={'$like':'%'+_0x5b285d['query'][_0x8ed5('0x2d')]+'%'};return _0x3c1c13;})});}_0x24a5a0=_['merge']({},_0x24a5a0,_0x5b285d[_0x8ed5('0x57')]);return db[_0x8ed5('0xe2')][_0x8ed5('0x23')]({'where':_0x24a5a0[_0x8ed5('0x3d')]})['then'](function(_0x138580){_0x4789bc[_0x8ed5('0x23')]=_0x138580;if(_0x5b285d[_0x8ed5('0x3e')][_0x8ed5('0x3f')]){_0x24a5a0[_0x8ed5('0x40')]=[{'all':!![]}];}return db['MailInteraction'][_0x8ed5('0x45')](_0x24a5a0);})[_0x8ed5('0x16')](function(_0x4b32c4){_0x4789bc[_0x8ed5('0x46')]=_0x4b32c4;return _0x4789bc;});}})[_0x8ed5('0x16')](respondWithFilteredResult(_0xfe5803,_0x24a5a0))[_0x8ed5('0x1e')](handleError(_0xfe5803,null));};exports[_0x8ed5('0xe3')]=function(_0x38c43a,_0x1f8cff){var _0x22bb11={};var _0x4f4bb5={};var _0x2f2dcc;var _0x24edf4;return db[_0x8ed5('0x37')]['findOne']({'where':{'id':_0x38c43a[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x1f8cff,null))['then'](function(_0x2583b8){if(_0x2583b8){_0x2f2dcc=_0x2583b8;_0x4f4bb5['model']=_[_0x8ed5('0x4f')](db[_0x8ed5('0xe4')]['rawAttributes']);_0x4f4bb5[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x38c43a[_0x8ed5('0x3e')]);_0x4f4bb5[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x4f4bb5['model'],_0x4f4bb5[_0x8ed5('0x3e')]);_0x22bb11[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0x4f4bb5[_0x8ed5('0x54')],qs['fields'](_0x38c43a[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x22bb11[_0x8ed5('0x43')]=_0x22bb11[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x22bb11[_0x8ed5('0x43')]:_0x4f4bb5[_0x8ed5('0x54')];_0x22bb11[_0x8ed5('0xcc')]=qs['sort'](_0x38c43a[_0x8ed5('0x3e')]['sort']);_0x22bb11[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_['pick'](_0x38c43a[_0x8ed5('0x3e')],_0x4f4bb5[_0x8ed5('0x52')]));if(_0x38c43a[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x22bb11[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x22bb11[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x22bb11[_0x8ed5('0x43')],function(_0x4f11e5){var _0x4efef9={};_0x4efef9[_0x4f11e5]={'$like':'%'+_0x38c43a[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x4efef9;})});}_0x22bb11=_['merge']({},_0x22bb11,_0x38c43a[_0x8ed5('0x57')]);return _0x2f2dcc[_0x8ed5('0xe3')](_0x22bb11);}})[_0x8ed5('0x16')](function(_0x1cbe77){if(_0x1cbe77){_0x24edf4=_0x1cbe77['length'];if(!_0x38c43a['query'][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x22bb11[_0x8ed5('0x22')]=qs['limit'](_0x38c43a['query'][_0x8ed5('0x22')]);_0x22bb11[_0x8ed5('0x24')]=qs['offset'](_0x38c43a[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x2f2dcc[_0x8ed5('0xe3')](_0x22bb11);}})['then'](function(_0x4c573f){if(_0x4c573f){return _0x4c573f?{'count':_0x24edf4,'rows':_0x4c573f}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x1f8cff,null))[_0x8ed5('0x1e')](handleError(_0x1f8cff,null));};exports['getFaxInteractions']=function(_0x16bb6c,_0x52993c){var _0x52d2b7={};var _0xa4ca4b={};var _0x151f75;var _0x255303;return db['User'][_0x8ed5('0x95')]({'where':{'id':_0x16bb6c['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x52993c,null))[_0x8ed5('0x16')](function(_0x13cf56){if(_0x13cf56){_0x151f75=_0x13cf56;_0xa4ca4b['model']=_[_0x8ed5('0x4f')](db[_0x8ed5('0xe5')][_0x8ed5('0x50')]);_0xa4ca4b[_0x8ed5('0x3e')]=_[_0x8ed5('0x4f')](_0x16bb6c['query']);_0xa4ca4b[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0xa4ca4b[_0x8ed5('0x54')],_0xa4ca4b[_0x8ed5('0x3e')]);_0x52d2b7[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0xa4ca4b['model'],qs['fields'](_0x16bb6c[_0x8ed5('0x3e')]['fields']));_0x52d2b7[_0x8ed5('0x43')]=_0x52d2b7['attributes']['length']?_0x52d2b7[_0x8ed5('0x43')]:_0xa4ca4b[_0x8ed5('0x54')];_0x52d2b7['order']=qs[_0x8ed5('0xcd')](_0x16bb6c[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x52d2b7[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_['pick'](_0x16bb6c[_0x8ed5('0x3e')],_0xa4ca4b['filters']));if(_0x16bb6c[_0x8ed5('0x3e')]['filter']){_0x52d2b7[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x52d2b7[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x52d2b7[_0x8ed5('0x43')],function(_0xfd5762){var _0xa53598={};_0xa53598[_0xfd5762]={'$like':'%'+_0x16bb6c['query']['filter']+'%'};return _0xa53598;})});}_0x52d2b7=_[_0x8ed5('0x56')]({},_0x52d2b7,_0x16bb6c['options']);return _0x151f75[_0x8ed5('0xe6')](_0x52d2b7);}})[_0x8ed5('0x16')](function(_0x7f544d){if(_0x7f544d){_0x255303=_0x7f544d[_0x8ed5('0x49')];if(!_0x16bb6c[_0x8ed5('0x3e')]['hasOwnProperty'](_0x8ed5('0xd7'))){_0x52d2b7['limit']=qs[_0x8ed5('0x22')](_0x16bb6c[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x52d2b7['offset']=qs[_0x8ed5('0x24')](_0x16bb6c[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x151f75[_0x8ed5('0xe6')](_0x52d2b7);}})['then'](function(_0x500ee4){if(_0x500ee4){return _0x500ee4?{'count':_0x255303,'rows':_0x500ee4}:null;}})['then'](respondWithResult(_0x52993c,null))[_0x8ed5('0x1e')](handleError(_0x52993c,null));};exports['getWhatsappInteractions']=function(_0x57f419,_0xe20a3a){var _0x265f75={};var _0x407d32={};var _0x33b47e;var _0x59aaa6;return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x57f419['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0xe20a3a,null))[_0x8ed5('0x16')](function(_0x152269){if(_0x152269){_0x33b47e=_0x152269;_0x407d32[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0xe7')][_0x8ed5('0x50')]);_0x407d32['query']=_[_0x8ed5('0x4f')](_0x57f419['query']);_0x407d32[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x407d32['model'],_0x407d32[_0x8ed5('0x3e')]);_0x265f75['attributes']=_[_0x8ed5('0x53')](_0x407d32[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x57f419[_0x8ed5('0x3e')]['fields']));_0x265f75[_0x8ed5('0x43')]=_0x265f75[_0x8ed5('0x43')]['length']?_0x265f75[_0x8ed5('0x43')]:_0x407d32[_0x8ed5('0x54')];_0x265f75['order']=qs[_0x8ed5('0xcd')](_0x57f419['query'][_0x8ed5('0xcd')]);_0x265f75[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x57f419[_0x8ed5('0x3e')],_0x407d32[_0x8ed5('0x52')]));if(_0x57f419[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x265f75['where']=_['merge'](_0x265f75[_0x8ed5('0x3d')],{'$or':_[_0x8ed5('0x2e')](_0x265f75[_0x8ed5('0x43')],function(_0x3a7ff2){var _0x1a34fe={};_0x1a34fe[_0x3a7ff2]={'$like':'%'+_0x57f419[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x1a34fe;})});}_0x265f75=_[_0x8ed5('0x56')]({},_0x265f75,_0x57f419[_0x8ed5('0x57')]);return _0x33b47e['getWhatsappInteractions'](_0x265f75);}})['then'](function(_0x39886f){if(_0x39886f){_0x59aaa6=_0x39886f['length'];if(!_0x57f419[_0x8ed5('0x3e')][_0x8ed5('0xce')]('nolimit')){_0x265f75[_0x8ed5('0x22')]=qs[_0x8ed5('0x22')](_0x57f419[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x265f75[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x57f419['query']['offset']);}return _0x33b47e[_0x8ed5('0xe8')](_0x265f75);}})['then'](function(_0x3b2d30){if(_0x3b2d30){return _0x3b2d30?{'count':_0x59aaa6,'rows':_0x3b2d30}:null;}})['then'](respondWithResult(_0xe20a3a,null))[_0x8ed5('0x1e')](handleError(_0xe20a3a,null));};exports[_0x8ed5('0xe9')]=function(_0x2ee176,_0x1491c1,_0x341b96){var _0x28b325;var _0x504c9c;var _0x23ecd8;var _0x200afd=!_[_0x8ed5('0xb8')](_0x2ee176['params']['id'])?_0x2ee176['params']['id']:!_['isNil'](_0x2ee176['user']['id'])?_0x2ee176['user']['id']:null;return db[_0x8ed5('0x37')]['find']({'where':{'id':_0x200afd,'role':{'$or':['admin','user',_0x8ed5('0x28')]}},'attributes':['id','name',_0x8ed5('0xea'),_0x8ed5('0xeb'),_0x8ed5('0x32'),_0x8ed5('0x65'),_0x8ed5('0xec')]})[_0x8ed5('0x16')](function(_0x5bd4e0){if(_0x5bd4e0){if(_0x5bd4e0[_0x8ed5('0x32')]===_0x8ed5('0x28')){_0x28b325=_0x5bd4e0;if(_0x2ee176['body']['interface']){_0x23ecd8=util['format'](_0x8ed5('0xed'),_0x28b325[_0x2ee176[_0x8ed5('0x5b')][_0x8ed5('0x9d')]]);}else if(_0x2ee176[_0x8ed5('0x5b')][_0x8ed5('0xee')]){_0x23ecd8=util[_0x8ed5('0xef')](_0x8ed5('0xaa'),_0x2ee176['body'][_0x8ed5('0xee')]);}else{_0x23ecd8=util[_0x8ed5('0xef')]('SIP/%s',_0x28b325[_0x8ed5('0x34')]);}socket['to'](util['format'](_0x8ed5('0xf0'),_0x28b325[_0x8ed5('0x34')]))[_0x8ed5('0xa5')](_0x8ed5('0xf1'),{'user':{'id':_0x28b325['id'],'name':_0x28b325[_0x8ed5('0x34')]},'ip':_0x2ee176[_0x8ed5('0xf2')][_0x8ed5('0xf3')]||_0x2ee176[_0x8ed5('0xf4')][_0x8ed5('0xf5')]||_0x2ee176[_0x8ed5('0xf6')]['remoteAddress']||_0x2ee176[_0x8ed5('0xf4')][_0x8ed5('0xf6')][_0x8ed5('0xf5')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x28b325[_0x8ed5('0x34')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x8ed5('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x8ed5('0x16')](function(){if(_0x28b325){return _0x28b325[_0x8ed5('0xf7')]({'raw':!![]});}})[_0x8ed5('0x16')](function(_0x5d3a71){if(_0x28b325){if(_0x5d3a71){_0x504c9c=_0x5d3a71;if(_0x504c9c[_0x8ed5('0x49')]){var _0xbcf73f=_0x504c9c[_0x8ed5('0x2e')](function(_0x29f25c){var _0x305317={'membername':_0x28b325[_0x8ed5('0x34')],'UserId':_0x28b325['id'],'queue_name':_0x29f25c[_0x8ed5('0x34')],'VoiceQueueId':_0x29f25c['id'],'interface':_0x23ecd8,'paused':_0x28b325['loginInPause']||![],'penalty':_0x29f25c[_0x8ed5('0xf8')]||0x0};return db[_0x8ed5('0xad')][_0x8ed5('0xf9')](_0x305317);});return Promise['all'](_0xbcf73f);}}}})[_0x8ed5('0x16')](function(){if(_0x28b325){return db[_0x8ed5('0xfa')][_0x8ed5('0x45')]({'where':{'membername':_0x28b325[_0x8ed5('0x34')],'exitAt':null}});}})[_0x8ed5('0x16')](function(_0x1de2d0){if(_0x28b325){var _0x1e8517=[];_0x1de2d0[_0x8ed5('0xfb')](function(_0x5a2ef6){_0x1e8517[_0x8ed5('0x44')](_0x5a2ef6[_0x8ed5('0xfc')]({'exitAt':moment()[_0x8ed5('0xef')](_0x8ed5('0xfd'))}));});return Promise[_0x8ed5('0x5a')](_0x1e8517);}})[_0x8ed5('0x16')](function(){if(_0x28b325){var _0x5c8476=[];var _0x5a80d6=[];var _0x46c62a=utils['getChannels']();var _0x10f742={'membername':_0x28b325[_0x8ed5('0x34')],'interface':_0x23ecd8,'enterAt':moment()['format'](_0x8ed5('0xfd')),'role':_0x28b325[_0x8ed5('0x32')],'internal':_0x28b325['internal']};_0x46c62a[_0x8ed5('0xfb')](function(_0x1c1764){_0x5c8476[_0x8ed5('0x44')](_['merge']({'channel':_0x1c1764,'type':_0x8ed5('0xfe'),'data1':_0x2ee176[_0x8ed5('0x5b')][_0x8ed5('0xff')],'data2':_0x23ecd8},_0x10f742));if(_0x28b325[_0x8ed5('0xec')]){_0x5a80d6[_0x8ed5('0x44')](_[_0x8ed5('0x56')]({'channel':_0x1c1764,'type':_0x8ed5('0x100'),'data1':_0x8ed5('0x101')},_0x10f742));}});return db[_0x8ed5('0xfa')][_0x8ed5('0x102')](_0x5c8476[_0x8ed5('0xc9')](_0x5a80d6),{'individualHooks':!![]});}})[_0x8ed5('0x16')](function(){if(_0x28b325){return _0x28b325[_0x8ed5('0xfc')]({'online':!![],'lastLoginAt':moment()['format'](_0x8ed5('0xfd')),'voicePause':_0x28b325[_0x8ed5('0xec')]||![],'mailPause':_0x28b325['loginInPause']||![],'chatPause':_0x28b325[_0x8ed5('0xec')]||![],'faxPause':_0x28b325[_0x8ed5('0xec')]||![],'smsPause':_0x28b325[_0x8ed5('0xec')]||![],'openchannelPause':_0x28b325[_0x8ed5('0xec')]||![],'whatsappPause':_0x28b325['loginInPause']||![],'pauseType':_0x28b325[_0x8ed5('0xec')]?'LOGININPAUSE':null,'interface':_0x23ecd8,'lastPauseAt':moment()['format'](_0x8ed5('0xfd'))});}})[_0x8ed5('0x16')](function(_0x448290){if(_0x2ee176[_0x8ed5('0x103')]){return _0x341b96();}else{return Promise[_0x8ed5('0x104')](_0x448290)[_0x8ed5('0x16')](respondWithResult(_0x1491c1,null));}})[_0x8ed5('0x1e')](handleError(_0x1491c1,null));};exports[_0x8ed5('0x105')]=function(_0x483482,_0x4965ce){var _0x9fb17;return db['User'][_0x8ed5('0x31')]({'where':{'id':_0x483482[_0x8ed5('0x8c')]['id'],'role':'agent'},'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0x32')]})['then'](handleEntityNotFound(_0x4965ce,null))[_0x8ed5('0x16')](function(_0x53cdbe){if(_0x53cdbe){_0x9fb17=_0x53cdbe;return db[_0x8ed5('0xad')][_0x8ed5('0x29')]({'where':{'membername':_0x9fb17[_0x8ed5('0x34')]},'individualHooks':!![]});}})[_0x8ed5('0x16')](function(){return db[_0x8ed5('0xfa')][_0x8ed5('0x45')]({'where':{'membername':_0x9fb17[_0x8ed5('0x34')],'exitAt':null}});})[_0x8ed5('0x16')](function(_0x32fa34){var _0x29478c=[];_0x32fa34[_0x8ed5('0xfb')](function(_0x9e7044){_0x29478c[_0x8ed5('0x44')](_0x9e7044[_0x8ed5('0xfc')]({'exitAt':moment()[_0x8ed5('0xef')](_0x8ed5('0xfd'))}));});return Promise[_0x8ed5('0x5a')](_0x29478c);})[_0x8ed5('0x16')](function(){return _0x9fb17['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8ed5('0x16')](respondWithResult(_0x4965ce,null))[_0x8ed5('0x1e')](handleError(_0x4965ce,null));};exports[_0x8ed5('0x106')]=function(_0x16c2da,_0x5e8749){var _0x9f04c0;return db[_0x8ed5('0xad')][_0x8ed5('0xfc')]({'paused':0x1},{'where':{'UserId':_0x16c2da[_0x8ed5('0x8c')]['id']},'individualHooks':!![]})[_0x8ed5('0x16')](function(){return db[_0x8ed5('0x37')][_0x8ed5('0x31')]({'where':{'id':_0x16c2da[_0x8ed5('0x8c')]['id'],'role':_0x8ed5('0x28')},'attributes':['id',_0x8ed5('0x34'),_0x8ed5('0x32'),_0x8ed5('0x65'),_0x8ed5('0x9d'),_0x8ed5('0xa9')]});})[_0x8ed5('0x16')](handleEntityNotFound(_0x5e8749,null))[_0x8ed5('0x16')](function(_0x132003){if(_0x132003){_0x9f04c0=_0x132003;return respondWithRpcPromise('QueuePause',_0x8ed5('0x106'),{'id':_0x9f04c0['id'],'name':_0x9f04c0['name'],'pause':!![]});}})['then'](function(){if(_0x9f04c0){return db[_0x8ed5('0xfa')][_0x8ed5('0x45')]({'where':{'membername':_0x9f04c0[_0x8ed5('0x34')],'type':_0x8ed5('0x100'),'exitAt':null}});}})[_0x8ed5('0x16')](function(_0x3dbe13){if(_0x3dbe13[_0x8ed5('0x49')]){var _0xff0410=moment()['format'](_0x8ed5('0xfd'));for(var _0x1cbfce=0x0,_0x3d6a8d=_0x3dbe13['length'];_0x1cbfce<_0x3d6a8d;_0x1cbfce++){_0x3dbe13[_0x1cbfce][_0x8ed5('0x107')]({'exitAt':_0xff0410});}}})[_0x8ed5('0x16')](function(){var _0x4d5b19=[];var _0x52b1b5=utils[_0x8ed5('0x108')]();_0x52b1b5[_0x8ed5('0xfb')](function(_0x1b51cd){_0x4d5b19[_0x8ed5('0x44')]({'channel':_0x1b51cd,'membername':_0x9f04c0[_0x8ed5('0x34')],'interface':_[_0x8ed5('0xb8')](_0x9f04c0[_0x8ed5('0x9d')])?util['format'](_0x8ed5('0xaa'),_0x9f04c0[_0x8ed5('0x34')]):_0x9f04c0[_0x8ed5('0x9d')],'type':_0x8ed5('0x100'),'enterAt':moment()[_0x8ed5('0xef')](_0x8ed5('0xfd')),'data1':_0x16c2da[_0x8ed5('0x5b')][_0x8ed5('0x39')]||_0x8ed5('0x109'),'role':_0x9f04c0[_0x8ed5('0x32')],'internal':_0x9f04c0[_0x8ed5('0x65')]});});return db[_0x8ed5('0xfa')][_0x8ed5('0x102')](_0x4d5b19,{'individualHooks':!![]});})[_0x8ed5('0x16')](function(){return _0x9f04c0[_0x8ed5('0xfc')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x16c2da[_0x8ed5('0x5b')][_0x8ed5('0x39')]||_0x8ed5('0x109'),'lastPauseAt':moment()[_0x8ed5('0xef')](_0x8ed5('0xfd'))});})[_0x8ed5('0x16')](respondWithResult(_0x5e8749,null))[_0x8ed5('0x1e')](handleError(_0x5e8749,null));};exports['unpause']=function(_0x3d4fe4,_0x33f7f5){if(_0x3d4fe4[_0x8ed5('0x5b')][_0x8ed5('0x9c')]&&!utils[_0x8ed5('0x9e')](_0x3d4fe4[_0x8ed5('0x5b')][_0x8ed5('0x9c')])){throw new APIBadRequestError(util[_0x8ed5('0xef')](_0x8ed5('0x10a'),_0x3d4fe4['body'][_0x8ed5('0x9c')]));}return db[_0x8ed5('0x37')]['find']({'where':{'id':_0x3d4fe4['params']['id']},'attributes':['id',_0x8ed5('0x34'),'role',_0x8ed5('0x65'),_0x8ed5('0x9d'),'online',_0x8ed5('0xab'),'mailPause',_0x8ed5('0x10b'),'faxPause',_0x8ed5('0x10c'),_0x8ed5('0x10d'),'whatsappPause',_0x8ed5('0x10e'),_0x8ed5('0x10f')]})['then'](function(_0x5ad996){if(!_0x5ad996){throw new APINotFoundError(util[_0x8ed5('0xef')](_0x8ed5('0x110'),_0x3d4fe4['params']['id']));}return _0x5ad996[_0x8ed5('0x111')](_0x3d4fe4[_0x8ed5('0x5b')][_0x8ed5('0x9c')]);})[_0x8ed5('0x16')](respondWithResult(_0x33f7f5,null))[_0x8ed5('0x1e')](APIHandleError(_0x33f7f5));};exports[_0x8ed5('0x112')]=function(_0x393548,_0x69ac11){var _0x3549c4={};var _0xc5c3e6={};var _0x353197;var _0x5c99c1;return db[_0x8ed5('0x37')]['findOne']({'where':{'id':_0x393548[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x69ac11,null))[_0x8ed5('0x16')](function(_0x5eace2){if(_0x5eace2){_0x353197=_0x5eace2;_0xc5c3e6[_0x8ed5('0x54')]=_['keys'](db[_0x8ed5('0x113')][_0x8ed5('0x50')]);_0xc5c3e6['query']=_[_0x8ed5('0x4f')](_0x393548['query']);_0xc5c3e6[_0x8ed5('0x52')]=_['intersection'](_0xc5c3e6[_0x8ed5('0x54')],_0xc5c3e6[_0x8ed5('0x3e')]);_0x3549c4[_0x8ed5('0x43')]=_[_0x8ed5('0x53')](_0xc5c3e6[_0x8ed5('0x54')],qs['fields'](_0x393548['query'][_0x8ed5('0x55')]));_0x3549c4['attributes']=_0x3549c4[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x3549c4[_0x8ed5('0x43')]:_0xc5c3e6[_0x8ed5('0x54')];_0x3549c4['order']=qs[_0x8ed5('0xcd')](_0x393548[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x3549c4[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x393548[_0x8ed5('0x3e')],_0xc5c3e6[_0x8ed5('0x52')]));if(_0x393548[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x3549c4['where']=_[_0x8ed5('0x56')](_0x3549c4['where'],{'$or':_[_0x8ed5('0x2e')](_0x3549c4[_0x8ed5('0x43')],function(_0x2619de){var _0x4cb271={};_0x4cb271[_0x2619de]={'$like':'%'+_0x393548['query'][_0x8ed5('0x2d')]+'%'};return _0x4cb271;})});}_0x3549c4=_[_0x8ed5('0x56')]({},_0x3549c4,_0x393548[_0x8ed5('0x57')]);return _0x353197[_0x8ed5('0x112')](_0x3549c4);}})['then'](function(_0x2fc6e5){if(_0x2fc6e5){_0x5c99c1=_0x2fc6e5[_0x8ed5('0x49')];if(!_0x393548['query'][_0x8ed5('0xce')](_0x8ed5('0xd7'))){_0x3549c4['limit']=qs[_0x8ed5('0x22')](_0x393548[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x3549c4[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x393548[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x353197[_0x8ed5('0x112')](_0x3549c4);}})[_0x8ed5('0x16')](function(_0xa32633){if(_0xa32633){return _0xa32633?{'count':_0x5c99c1,'rows':_0xa32633}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x69ac11,null))[_0x8ed5('0x1e')](handleError(_0x69ac11,null));};exports[_0x8ed5('0x114')]=function(_0xd8aed9,_0x1a8ccc){var _0x4fd36c=_0xd8aed9[_0x8ed5('0x8c')]['id'];var _0x5ad0d6=_0xd8aed9['body']?_0xd8aed9[_0x8ed5('0x5b')]['ids']:null;var _0x485121=[];return Promise['resolve']()[_0x8ed5('0x16')](function(){if(!_0x5ad0d6)throw new APIBadRequestError(_0x8ed5('0x115'));})[_0x8ed5('0x16')](function(){return db['User']['findOne']({'where':{'id':_0x4fd36c}});})[_0x8ed5('0x16')](function(_0x3ce1c8){if(!_0x3ce1c8)throw new APINotFoundError(util[_0x8ed5('0xef')]('User\x20with\x20id\x20%s\x20not\x20found',_0xd8aed9[_0x8ed5('0x8c')]['id']));return db['sequelize'][_0x8ed5('0x116')](function(_0x26a020){return _0x3ce1c8[_0x8ed5('0x114')](_0x5ad0d6,{'transaction':_0x26a020})[_0x8ed5('0x16')](function(){return db[_0x8ed5('0x113')][_0x8ed5('0x45')]({'where':{'id':{'$in':_0x5ad0d6}}});})['then'](function(_0x4835f2){var _0x44d220=_[_0x8ed5('0x2e')](_0x4835f2,function(_0x31f19e){return _0x31f19e[_0x8ed5('0x117')]();});return Promise[_0x8ed5('0x5a')](_0x44d220);})[_0x8ed5('0x16')](function(_0x410786){_0x485121=_[_0x8ed5('0x118')](_0x410786);var _0x1170af=_[_0x8ed5('0x2e')](_0x485121,function(_0x2536b9){return _0x2536b9[_0x8ed5('0x119')](_0x3ce1c8['id'],{'transaction':_0x26a020});});return Promise[_0x8ed5('0x5a')](_0x1170af);})[_0x8ed5('0x16')](function(){if(!_0x3ce1c8['online'])return;var _0x62c697=_[_0x8ed5('0x2d')](_0x485121,function(_0x531ccf){return _0x531ccf[_0x8ed5('0x11a')](_0x8ed5('0x9c'))===_0x8ed5('0x11b');});var _0xb3db1c=_[_0x8ed5('0x2e')](_0x62c697,function(_0x7fe54e){return db[_0x8ed5('0xad')][_0x8ed5('0xf9')]({'membername':_0x3ce1c8[_0x8ed5('0x34')],'UserId':_0x3ce1c8['id'],'queue_name':_0x7fe54e['name'],'VoiceQueueId':_0x7fe54e['id'],'interface':_[_0x8ed5('0xb8')](_0x3ce1c8[_0x8ed5('0x9d')])?util[_0x8ed5('0xef')](_0x8ed5('0xaa'),_0x3ce1c8[_0x8ed5('0x34')]):_0x3ce1c8['interface'],'paused':_0x3ce1c8[_0x8ed5('0xab')]||![],'penalty':_0x3ce1c8['penalty']},{'transaction':_0x26a020});});return Promise[_0x8ed5('0x5a')](_0xb3db1c);})[_0x8ed5('0x16')](function(){return db[_0x8ed5('0x11c')][_0x8ed5('0x45')]({'where':{'teamId':{'$in':_0x5ad0d6}}});})[_0x8ed5('0x16')](function(_0x20705e){var _0x1d8010=_[_0x8ed5('0x2e')](_0x20705e,function(_0xc058d0){return db[_0x8ed5('0x11d')][_0x8ed5('0x7f')]({'UserId':_0x3ce1c8['id'],'VoicePrefixId':_0xc058d0['VoicePrefixId']},{'transaction':_0x26a020});});return Promise[_0x8ed5('0x5a')](_0x1d8010);});});})['then'](function(){for(var _0x31f96b=0x0;_0x31f96b<_0x485121[_0x8ed5('0x49')];_0x31f96b++){var _0x4f44f8=_0x485121[_0x31f96b]['getDataValue'](_0x8ed5('0x9c'));var _0x541f2e=_0x4f44f8+'QueueId';socket[_0x8ed5('0xa5')]('user'+_0x4f44f8+_0x8ed5('0xa6'),{'UserId':_0x4fd36c,['queueField']:_0x485121[_0x31f96b]['id']});}})[_0x8ed5('0x16')](respondWithStatusCode(_0x1a8ccc,null))[_0x8ed5('0x1e')](APIHandleError(_0x1a8ccc));};exports['removeTeams']=function(_0x33a7f3,_0x20b380){var _0x34269c=_0x33a7f3['params']['id'];var _0x532684=null;if(_0x33a7f3[_0x8ed5('0x3e')][_0x8ed5('0x5e')]){_0x532684=_[_0x8ed5('0xb0')](_0x33a7f3[_0x8ed5('0x3e')][_0x8ed5('0x5e')])?_0x33a7f3['query']['ids']:[_0x33a7f3[_0x8ed5('0x3e')][_0x8ed5('0x5e')]];}var _0x1827b1=[];return Promise[_0x8ed5('0x104')]()[_0x8ed5('0x16')](function(){if(!_0x532684)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x34269c}});})['then'](function(_0xed5fae){if(!_0xed5fae)throw new APINotFoundError(util[_0x8ed5('0xef')](_0x8ed5('0x110'),_0x33a7f3[_0x8ed5('0x8c')]['id']));return db[_0x8ed5('0x67')][_0x8ed5('0x116')](function(_0x44c3e1){return _0xed5fae[_0x8ed5('0x11e')](_0x532684,{'transaction':_0x44c3e1})['then'](function(){return db[_0x8ed5('0x113')]['findAll']({'where':{'id':{'$in':_0x532684}}});})[_0x8ed5('0x16')](function(_0x102add){var _0xa853a9=_[_0x8ed5('0x2e')](_0x102add,function(_0x1b7435){return _0x1b7435['getAssociatedQueues']();});return Promise[_0x8ed5('0x5a')](_0xa853a9);})[_0x8ed5('0x16')](function(_0x16c10d){_0x1827b1=_[_0x8ed5('0x118')](_0x16c10d);var _0x3cf8d7=_[_0x8ed5('0x2e')](_0x1827b1,function(_0x42c727){return _0x42c727['removeAgent'](_0xed5fae['id'],{'transaction':_0x44c3e1});});return Promise[_0x8ed5('0x5a')](_0x3cf8d7);})[_0x8ed5('0x16')](function(){if(!_0xed5fae['online'])return;var _0x322fcb=_[_0x8ed5('0x2d')](_0x1827b1,function(_0x43995b){return _0x43995b[_0x8ed5('0x11a')](_0x8ed5('0x9c'))==='Voice';});var _0x1da903=_[_0x8ed5('0x2e')](_0x322fcb,function(_0x57a759){return db[_0x8ed5('0xad')]['destroy']({'where':{'VoiceQueueId':_0x57a759['id'],'UserId':_0xed5fae['id']},'transaction':_0x44c3e1});});return Promise[_0x8ed5('0x5a')](_0x1da903);})[_0x8ed5('0x16')](function(){return db[_0x8ed5('0x11c')][_0x8ed5('0x45')]({'where':{'teamId':{'$in':_0x532684}}});})['then'](function(_0x524758){var _0x3aff5e=_[_0x8ed5('0x2e')](_0x524758,function(_0x214a12){return db[_0x8ed5('0x11d')][_0x8ed5('0x29')]({'where':{'UserId':_0xed5fae['id'],'VoicePrefixId':_0x214a12[_0x8ed5('0x11f')]}},{'transaction':_0x44c3e1});});return Promise[_0x8ed5('0x5a')](_0x3aff5e);});});})[_0x8ed5('0x16')](function(){for(var _0x2d5ae4=0x0;_0x2d5ae4<_0x1827b1[_0x8ed5('0x49')];_0x2d5ae4++){var _0x427bd3=_0x1827b1[_0x2d5ae4][_0x8ed5('0x11a')](_0x8ed5('0x9c'));var _0x130438=_0x427bd3+_0x8ed5('0xa4');socket[_0x8ed5('0xa5')](_0x8ed5('0x7c')+_0x427bd3+_0x8ed5('0xb1'),{'UserId':_0x34269c,['queueField']:_0x1827b1[_0x2d5ae4]['id']});}})[_0x8ed5('0x16')](respondWithStatusCode(_0x20b380,null))['catch'](APIHandleError(_0x20b380));};exports['getLists']=function(_0x12de5a,_0x5dbd7a){var _0x2227e4={};var _0x3efe3e={};var _0x5dbd6d;var _0x607f3e;return db[_0x8ed5('0x37')][_0x8ed5('0x95')]({'where':{'id':_0x12de5a['params']['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x5dbd7a,null))[_0x8ed5('0x16')](function(_0x122e4c){if(_0x122e4c){_0x5dbd6d=_0x122e4c;_0x3efe3e[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0x120')][_0x8ed5('0x50')]);_0x3efe3e['query']=_['keys'](_0x12de5a[_0x8ed5('0x3e')]);_0x3efe3e[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x3efe3e['model'],_0x3efe3e[_0x8ed5('0x3e')]);_0x2227e4['attributes']=_[_0x8ed5('0x53')](_0x3efe3e[_0x8ed5('0x54')],qs['fields'](_0x12de5a[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x2227e4['attributes']=_0x2227e4[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x2227e4[_0x8ed5('0x43')]:_0x3efe3e['model'];_0x2227e4['order']=qs[_0x8ed5('0xcd')](_0x12de5a['query'][_0x8ed5('0xcd')]);_0x2227e4[_0x8ed5('0x3d')]=qs[_0x8ed5('0x52')](_[_0x8ed5('0xd4')](_0x12de5a[_0x8ed5('0x3e')],_0x3efe3e[_0x8ed5('0x52')]));if(_0x12de5a['query'][_0x8ed5('0x2d')]){_0x2227e4[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x2227e4['where'],{'$or':_['map'](_0x2227e4[_0x8ed5('0x43')],function(_0x4b0729){var _0x5bc702={};_0x5bc702[_0x4b0729]={'$like':'%'+_0x12de5a[_0x8ed5('0x3e')][_0x8ed5('0x2d')]+'%'};return _0x5bc702;})});}_0x2227e4=_[_0x8ed5('0x56')]({},_0x2227e4,_0x12de5a[_0x8ed5('0x57')]);return _0x5dbd6d['getLists'](_0x2227e4);}})[_0x8ed5('0x16')](function(_0x2e49b5){if(_0x2e49b5){_0x607f3e=_0x2e49b5[_0x8ed5('0x49')];if(!_0x12de5a[_0x8ed5('0x3e')]['hasOwnProperty'](_0x8ed5('0xd7'))){_0x2227e4[_0x8ed5('0x22')]=qs[_0x8ed5('0x22')](_0x12de5a[_0x8ed5('0x3e')][_0x8ed5('0x22')]);_0x2227e4[_0x8ed5('0x24')]=qs[_0x8ed5('0x24')](_0x12de5a[_0x8ed5('0x3e')][_0x8ed5('0x24')]);}return _0x5dbd6d[_0x8ed5('0x121')](_0x2227e4);}})['then'](function(_0xd72c67){if(_0xd72c67){return _0xd72c67?{'count':_0x607f3e,'rows':_0xd72c67}:null;}})[_0x8ed5('0x16')](respondWithResult(_0x5dbd7a,null))[_0x8ed5('0x1e')](handleError(_0x5dbd7a,null));};exports[_0x8ed5('0x122')]=function(_0x360efd,_0x23ad12){var _0x2c9cec={};var _0x3222f4={};var _0x185418;return db['User'][_0x8ed5('0x95')]({'where':{'id':_0x360efd[_0x8ed5('0x8c')]['id']}})[_0x8ed5('0x16')](handleEntityNotFound(_0x23ad12,null))['then'](function(_0x458877){if(_0x458877){_0x185418=_0x458877;_0x3222f4[_0x8ed5('0x54')]=_[_0x8ed5('0x4f')](db[_0x8ed5('0x37')][_0x8ed5('0x50')]);_0x3222f4[_0x8ed5('0x3e')]=_['keys'](_0x360efd[_0x8ed5('0x3e')]);_0x3222f4[_0x8ed5('0x52')]=_[_0x8ed5('0x53')](_0x3222f4[_0x8ed5('0x54')],_0x3222f4[_0x8ed5('0x3e')]);_0x2c9cec['attributes']=_[_0x8ed5('0x53')](_0x3222f4[_0x8ed5('0x54')],qs[_0x8ed5('0x55')](_0x360efd[_0x8ed5('0x3e')][_0x8ed5('0x55')]));_0x2c9cec[_0x8ed5('0x43')]=_0x2c9cec[_0x8ed5('0x43')][_0x8ed5('0x49')]?_0x2c9cec[_0x8ed5('0x43')]:_0x3222f4['model'];_0x2c9cec[_0x8ed5('0xcc')]=qs['sort'](_0x360efd[_0x8ed5('0x3e')][_0x8ed5('0xcd')]);_0x2c9cec[_0x8ed5('0x3d')]=qs['filters'](_[_0x8ed5('0xd4')](_0x360efd[_0x8ed5('0x3e')],_0x3222f4[_0x8ed5('0x52')]));if(_0x360efd[_0x8ed5('0x3e')][_0x8ed5('0x2d')]){_0x2c9cec[_0x8ed5('0x3d')]=_[_0x8ed5('0x56')](_0x2c9cec['where'],{'$or':_[_0x8ed5('0x2e')](_0x2c9cec['attributes'],function(_0xe96959){var _0x3af338={};_0x3af338[_0xe96959]={'$like':'%'+_0x360efd['query'][_0x8ed5('0x2d')]+'%'};return _0x3af338;})});}_0x2c9cec['model']=db[_0x8ed5('0x37')];_0x2c9cec['as']=_0x8ed5('0x81');_0x2c9cec=_[_0x8ed5('0x56')]({},_0x2c9cec,_0x360efd[_0x8ed5('0x57')]);return _0x185418['getVoiceQueues']({'include':[_0x2c9cec]});}})[_0x8ed5('0x16')](function(_0x171e32){if(_0x171e32){var _0x2ed943={},_0x2beb72=[];for(var _0x133d40=0x0;_0x133d40<_0x171e32['length'];_0x133d40+=0x1){for(var _0x26d249=0x0,_0x26d457;_0x26d249<_0x171e32[_0x133d40][_0x8ed5('0x81')][_0x8ed5('0x49')];_0x26d249+=0x1){_0x26d457=_0x171e32[_0x133d40][_0x8ed5('0x81')][_0x26d249][_0x8ed5('0x2a')]({'plain':!![]});_0x2ed943[_0x26d457['id']]=_0x26d457;}}_0x2ed943=_[_0x8ed5('0x123')](_0x2ed943);for(var _0x3bea37=qs[_0x8ed5('0x24')](_0x360efd['query'][_0x8ed5('0x24')]);_0x3bea37<_0x2ed943[_0x8ed5('0x49')]&&_0x2beb72['length']=_0x5812b5[_0xf229('0x4c')]){throw new Error(_0xf229('0x4d'));}})[_0xf229('0x1c')](function(){if(_0x344bb6){return db['UserVoiceQueueRt'][_0xf229('0x44')]({'where':{'membername':_0x344bb6['name']},'individualHooks':!![]});}})[_0xf229('0x1c')](function(){if(_0x344bb6){return _0x344bb6[_0xf229('0x4e')]({'raw':!![]});}})[_0xf229('0x1c')](function(_0x2d73fe){if(_0x344bb6){if(_0x2d73fe){var _0x5938c9=[];_0x5d70d0=_0x2d73fe;if(_0x5d70d0[_0xf229('0x28')]){for(var _0x14535f=0x0;_0x14535f<_0x5d70d0[_0xf229('0x28')];_0x14535f++){_0x5938c9[_0xf229('0x2b')](db[_0xf229('0x25')]['upsert']({'membername':_0x344bb6[_0xf229('0x1f')],'UserId':_0x344bb6['id'],'queue_name':_0x5d70d0[_0x14535f][_0xf229('0x1f')],'VoiceQueueId':_0x5d70d0[_0x14535f]['id'],'interface':_0x34a229,'paused':_0x344bb6[_0xf229('0x48')]||![],'penalty':_0x5d70d0[_0x14535f]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xf229('0x45')](_0x5938c9);}}}})[_0xf229('0x1c')](function(){if(_0x344bb6){return db['MemberReport'][_0xf229('0xe')]({'where':{'membername':_0x344bb6[_0xf229('0x1f')],'exitAt':null}});}})[_0xf229('0x1c')](function(_0x5e67f4){if(_0x344bb6){if(_0x5e67f4&&_0x5e67f4[_0xf229('0x28')]){var _0x588120=[];_0x5e67f4[_0xf229('0x2a')](function(_0x2b91d9){_0x588120[_0xf229('0x2b')](_0x2b91d9[_0xf229('0x26')]({'exitAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf229('0x45')](_0x588120);}}})[_0xf229('0x1c')](function(){if(_0x344bb6){var _0x5c0d0b=[];var _0xc43a0b=[];var _0x286707=utils[_0xf229('0x4f')]();var _0x2db018={'membername':_0x344bb6[_0xf229('0x1f')],'interface':_0x34a229,'enterAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x344bb6['role'],'internal':_0x344bb6[_0xf229('0x21')]};_0x286707[_0xf229('0x2a')](function(_0x4e37fa){_0x5c0d0b[_0xf229('0x2b')](_[_0xf229('0x50')]({'channel':_0x4e37fa,'type':_0xf229('0x51'),'data1':_0xf229('0x52'),'data2':_0x34a229},_0x2db018));if(_0x344bb6[_0xf229('0x48')]){_0xc43a0b[_0xf229('0x2b')](_[_0xf229('0x50')]({'channel':_0x4e37fa,'type':_0xf229('0x27'),'data1':_0xf229('0x53')},_0x2db018));}});return db['MemberReport'][_0xf229('0x54')](_0x5c0d0b['concat'](_0xc43a0b),{'individualHooks':!![]});}})[_0xf229('0x1c')](function(){if(_0x344bb6){return _0x344bb6['update']({'online':!![],'lastLoginAt':moment()[_0xf229('0x22')](_0xf229('0x2e')),'voicePause':_0x344bb6[_0xf229('0x48')]||![],'mailPause':_0x344bb6[_0xf229('0x48')]||![],'chatPause':_0x344bb6[_0xf229('0x48')]||![],'faxPause':_0x344bb6[_0xf229('0x48')]||![],'smsPause':_0x344bb6[_0xf229('0x48')]||![],'openchannelPause':_0x344bb6['loginInPause']||![],'pauseType':_0x344bb6['loginInPause']?_0xf229('0x53'):null,'lastPauseAt':moment()['format'](_0xf229('0x2e')),'interface':_0x34a229});}})[_0xf229('0x1c')](function(_0x309e5f){_0x20a7e8(_0x309e5f);})[_0xf229('0x17')](function(_0x19b7fc){_0x1748e7(_0x461014[_0xf229('0x18')](0x1f4,_0x19b7fc[_0xf229('0x19')]));});});}; \ No newline at end of file +var _0xe9e0=['params','UserVoiceQueueRt','update','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','SIP/%s','interface','type','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','body','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','mailPause','chatPause','faxPause','smsPause','whatsappPause','lastPauseAt','unpause','LogoutUser','destroy','all','phone','count','getLicense','agents','getVoiceQueues','loginInPause','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','User','findAll','options','where','attributes','limit','include','map','model','then','info','GetUser','debug','stringify','catch','error','ShowUser','find','message','PauseUser','name','internal','format','User\x20with\x20id\x20%s\x20not\x20found'];(function(_0x52f213,_0x4a9e5c){var _0xbcd8c5=function(_0x36b1d9){while(--_0x36b1d9){_0x52f213['push'](_0x52f213['shift']());}};_0xbcd8c5(++_0x4a9e5c);}(_0xe9e0,0x1c9));var _0x0e9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0e9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0x0e9e('0x1'));var db=require(_0x0e9e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e9e('0x3'))('rpc');var config=require(_0x0e9e('0x4'));config[_0x0e9e('0x5')]=_[_0x0e9e('0x6')](config[_0x0e9e('0x5')],{'host':_0x0e9e('0x7'),'port':0x18eb});var socket=require(_0x0e9e('0x8'))(new Redis(config[_0x0e9e('0x5')]));require(_0x0e9e('0x9'))[_0x0e9e('0xa')](socket);exports['GetUser']=function(_0x137a03){var _0x207931=this;return new Promise(function(_0x34901d,_0x2330de){return db[_0x0e9e('0xb')][_0x0e9e('0xc')]({'raw':_0x137a03['options']?_0x137a03[_0x0e9e('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x137a03['options']?_0x137a03[_0x0e9e('0xd')][_0x0e9e('0xe')]||null:null,'attributes':_0x137a03[_0x0e9e('0xd')]?_0x137a03[_0x0e9e('0xd')][_0x0e9e('0xf')]||null:null,'limit':_0x137a03[_0x0e9e('0xd')]?_0x137a03[_0x0e9e('0xd')][_0x0e9e('0x10')]||null:null,'include':_0x137a03[_0x0e9e('0xd')]?_0x137a03['options'][_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0x137a03[_0x0e9e('0xd')][_0x0e9e('0x11')],function(_0xfb4294){return{'model':db[_0xfb4294['model']],'as':_0xfb4294['as'],'attributes':_0xfb4294[_0x0e9e('0xf')],'include':_0xfb4294[_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0xfb4294['include'],function(_0x206bc6){return{'model':db[_0x206bc6[_0x0e9e('0x13')]],'as':_0x206bc6['as'],'attributes':_0x206bc6[_0x0e9e('0xf')],'include':_0x206bc6[_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0x206bc6[_0x0e9e('0x11')],function(_0xf65f9b){return{'model':db[_0xf65f9b[_0x0e9e('0x13')]],'as':_0xf65f9b['as'],'attributes':_0xf65f9b['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e9e('0x14')](function(_0xed3b7a){logger[_0x0e9e('0x15')](_0x0e9e('0x16'),_0x137a03);logger[_0x0e9e('0x17')](_0x0e9e('0x16'),_0x137a03,JSON[_0x0e9e('0x18')](_0xed3b7a));_0x34901d(_0xed3b7a);})[_0x0e9e('0x19')](function(_0xeda937){logger['error']('GetUser',_0xeda937['message'],_0x137a03);_0x2330de(_0x207931[_0x0e9e('0x1a')](0x1f4,_0xeda937['message']));});});};exports[_0x0e9e('0x1b')]=function(_0x559292){var _0x6984e0=this;return new Promise(function(_0x2dfa65,_0x188e6d){return db[_0x0e9e('0xb')][_0x0e9e('0x1c')]({'raw':_0x559292[_0x0e9e('0xd')]?_0x559292[_0x0e9e('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x559292['options']?_0x559292[_0x0e9e('0xd')][_0x0e9e('0xe')]||null:null,'attributes':_0x559292['options']?_0x559292[_0x0e9e('0xd')][_0x0e9e('0xf')]||null:null,'include':_0x559292['options']?_0x559292[_0x0e9e('0xd')][_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0x559292['options'][_0x0e9e('0x11')],function(_0x543a8f){return{'model':db[_0x543a8f[_0x0e9e('0x13')]],'as':_0x543a8f['as'],'attributes':_0x543a8f[_0x0e9e('0xf')],'include':_0x543a8f[_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0x543a8f[_0x0e9e('0x11')],function(_0x13045c){return{'model':db[_0x13045c[_0x0e9e('0x13')]],'as':_0x13045c['as'],'attributes':_0x13045c[_0x0e9e('0xf')],'include':_0x13045c[_0x0e9e('0x11')]?_[_0x0e9e('0x12')](_0x13045c[_0x0e9e('0x11')],function(_0x978f24){return{'model':db[_0x978f24[_0x0e9e('0x13')]],'as':_0x978f24['as'],'attributes':_0x978f24[_0x0e9e('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x111904){logger[_0x0e9e('0x15')](_0x0e9e('0x1b'),_0x559292);logger[_0x0e9e('0x17')](_0x0e9e('0x1b'),_0x559292,JSON[_0x0e9e('0x18')](_0x111904));_0x2dfa65(_0x111904);})[_0x0e9e('0x19')](function(_0xf056a5){logger['error'](_0x0e9e('0x1b'),_0xf056a5[_0x0e9e('0x1d')],_0x559292);_0x188e6d(_0x6984e0[_0x0e9e('0x1a')](0x1f4,_0xf056a5['message']));});});};exports[_0x0e9e('0x1e')]=function(_0x58b636){var _0x1d1e5d;return db[_0x0e9e('0xb')][_0x0e9e('0x1c')]({'where':_0x58b636[_0x0e9e('0xd')][_0x0e9e('0xe')]||{},'attributes':['id',_0x0e9e('0x1f'),'role',_0x0e9e('0x20'),'interface']})[_0x0e9e('0x14')](function(_0x419985){if(!_0x419985){throw new Error(util[_0x0e9e('0x21')](_0x0e9e('0x22'),_0x58b636[_0x0e9e('0x23')]['id']));}_0x1d1e5d=_0x419985;return db[_0x0e9e('0x24')][_0x0e9e('0x25')]({'paused':0x1},{'where':{'UserId':_0x1d1e5d['id']},'individualHooks':!![]});})[_0x0e9e('0x14')](function(){return db[_0x0e9e('0x26')][_0x0e9e('0xc')]({'where':{'membername':_0x1d1e5d[_0x0e9e('0x1f')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x54b9ad){if(_0x54b9ad&&_0x54b9ad[_0x0e9e('0x27')]){var _0x238f0e=moment()[_0x0e9e('0x21')](_0x0e9e('0x28'));for(var _0x5a43f0=0x0,_0x2a8885=_0x54b9ad[_0x0e9e('0x27')];_0x5a43f0<_0x2a8885;_0x5a43f0++){_0x54b9ad[_0x5a43f0][_0x0e9e('0x29')]({'exitAt':_0x238f0e});}}})[_0x0e9e('0x14')](function(){var _0xe5b3f5=[];var _0x3f386e=utils['getChannels']();_0x3f386e[_0x0e9e('0x2a')](function(_0x6ba5c8){_0xe5b3f5[_0x0e9e('0x2b')]({'channel':_0x6ba5c8,'membername':_0x1d1e5d[_0x0e9e('0x1f')],'interface':_[_0x0e9e('0x2c')](_0x1d1e5d['interface'])?util[_0x0e9e('0x21')](_0x0e9e('0x2d'),_0x1d1e5d[_0x0e9e('0x1f')]):_0x1d1e5d[_0x0e9e('0x2e')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x58b636['body'][_0x0e9e('0x2f')]||_0x0e9e('0x30'),'role':_0x1d1e5d[_0x0e9e('0x31')],'internal':_0x1d1e5d['internal'],'uniqueid':_0x58b636['body'][_0x0e9e('0x32')]||null});});return db[_0x0e9e('0x26')][_0x0e9e('0x33')](_0xe5b3f5,{'individualHooks':!![]});})[_0x0e9e('0x14')](function(){return _0x1d1e5d[_0x0e9e('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x58b636[_0x0e9e('0x34')][_0x0e9e('0x2f')]||_0x0e9e('0x30'),'lastPauseAt':moment()[_0x0e9e('0x21')](_0x0e9e('0x28'))});})[_0x0e9e('0x19')](function(_0x3e9190){throw _0x3e9190;});};exports[_0x0e9e('0x35')]=function(_0x4d4494){return Promise[_0x0e9e('0x36')]()[_0x0e9e('0x14')](function(){if(_0x4d4494[_0x0e9e('0x34')][_0x0e9e('0x37')]&&!utils[_0x0e9e('0x38')](_0x4d4494['body'][_0x0e9e('0x37')])){throw new Error(util['format'](_0x0e9e('0x39'),_0x4d4494[_0x0e9e('0x34')]['channel']));}return db[_0x0e9e('0xb')][_0x0e9e('0x3a')]({'where':_0x4d4494[_0x0e9e('0xd')][_0x0e9e('0xe')]||{},'attributes':['id',_0x0e9e('0x1f'),_0x0e9e('0x31'),_0x0e9e('0x20'),'interface',_0x0e9e('0x3b'),'voicePause',_0x0e9e('0x3c'),_0x0e9e('0x3d'),_0x0e9e('0x3e'),'openchannelPause',_0x0e9e('0x3f'),_0x0e9e('0x40'),'pauseType',_0x0e9e('0x41')]});})[_0x0e9e('0x14')](function(_0x1cdaa2){if(!_0x1cdaa2){throw new Error(util[_0x0e9e('0x21')](_0x0e9e('0x22'),_0x4d4494[_0x0e9e('0x23')]['id']));}return _0x1cdaa2[_0x0e9e('0x42')](_0x4d4494['body'][_0x0e9e('0x37')],'system');})[_0x0e9e('0x19')](function(_0x562d8d){throw _0x562d8d;});};exports[_0x0e9e('0x43')]=function(_0x453bb4){var _0x320c31=this;return new Promise(function(_0x36d4e9,_0x33e4a4){var _0x5113cf;return db[_0x0e9e('0xb')]['findOne']({'where':_0x453bb4[_0x0e9e('0xd')][_0x0e9e('0xe')]||{},'attributes':['id',_0x0e9e('0x1f')]})[_0x0e9e('0x14')](function(_0x3864e3){if(_0x3864e3){_0x5113cf=_0x3864e3;return db[_0x0e9e('0x24')][_0x0e9e('0x44')]({'where':{'membername':_0x5113cf['name']},'individualHooks':!![]});}})['then'](function(){if(_0x5113cf){return db['MemberReport']['findAll']({'where':{'membername':_0x5113cf['name'],'exitAt':null}});}})['then'](function(_0x14caf2){if(_0x5113cf){if(_0x14caf2&&_0x14caf2['length']){var _0x3d15a2=[];_0x14caf2['forEach'](function(_0x4c7ae9){_0x3d15a2['push'](_0x4c7ae9[_0x0e9e('0x25')]({'exitAt':moment()[_0x0e9e('0x21')](_0x0e9e('0x28'))}));});return BPromise[_0x0e9e('0x45')](_0x3d15a2);}}})[_0x0e9e('0x14')](function(){if(_0x5113cf){return _0x5113cf[_0x0e9e('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2f1181){_0x36d4e9(_0x2f1181);})[_0x0e9e('0x19')](function(_0x417c64){_0x33e4a4(_0x320c31[_0x0e9e('0x1a')](0x1f4,_0x417c64[_0x0e9e('0x1d')]));});});};exports['LoginUser']=function(_0x3b53d5){var _0x3d6352=this;return new Promise(function(_0x1ec273,_0x665878){var _0x115ef1;var _0x312a9b;var _0x2bdb5c;var _0x9f4f12;return db[_0x0e9e('0xb')][_0x0e9e('0x3a')]({'where':_0x3b53d5[_0x0e9e('0xd')][_0x0e9e('0xe')]||{},'attributes':['id','name',_0x0e9e('0x31'),'mobile',_0x0e9e('0x46'),_0x0e9e('0x20'),'loginInPause',_0x0e9e('0x2e')]})[_0x0e9e('0x14')](function(_0x5dc755){if(_0x5dc755){_0x115ef1=_0x5dc755;_0x9f4f12=_0x3b53d5['body']['interface']?_0x3b53d5['body'][_0x0e9e('0x2e')]:util[_0x0e9e('0x21')](_0x0e9e('0x2d'),_0x115ef1['name']);return db[_0x0e9e('0xb')][_0x0e9e('0x47')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x115ef1['id']}}});}})['then'](function(_0x48bcbd){if(_0x48bcbd){_0x2bdb5c=_0x48bcbd;return require('../../config/license/util')[_0x0e9e('0x48')]();}})[_0x0e9e('0x14')](function(_0x7cadd0){if(_0x7cadd0&&_0x7cadd0[_0x0e9e('0x49')]&&_0x2bdb5c>=_0x7cadd0[_0x0e9e('0x49')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x0e9e('0x14')](function(){if(_0x115ef1){return db[_0x0e9e('0x24')][_0x0e9e('0x44')]({'where':{'membername':_0x115ef1['name']},'individualHooks':!![]});}})[_0x0e9e('0x14')](function(){if(_0x115ef1){return _0x115ef1[_0x0e9e('0x4a')]({'raw':!![]});}})[_0x0e9e('0x14')](function(_0x454b80){if(_0x115ef1){if(_0x454b80){var _0x1aac0f=[];_0x312a9b=_0x454b80;if(_0x312a9b[_0x0e9e('0x27')]){for(var _0xbb92f2=0x0;_0xbb92f2<_0x312a9b[_0x0e9e('0x27')];_0xbb92f2++){_0x1aac0f['push'](db[_0x0e9e('0x24')]['upsert']({'membername':_0x115ef1[_0x0e9e('0x1f')],'UserId':_0x115ef1['id'],'queue_name':_0x312a9b[_0xbb92f2]['name'],'VoiceQueueId':_0x312a9b[_0xbb92f2]['id'],'interface':_0x9f4f12,'paused':_0x115ef1[_0x0e9e('0x4b')]||![],'penalty':_0x312a9b[_0xbb92f2]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x1aac0f);}}}})['then'](function(){if(_0x115ef1){return db[_0x0e9e('0x26')][_0x0e9e('0xc')]({'where':{'membername':_0x115ef1[_0x0e9e('0x1f')],'exitAt':null}});}})[_0x0e9e('0x14')](function(_0x25bdc1){if(_0x115ef1){if(_0x25bdc1&&_0x25bdc1['length']){var _0x16c20c=[];_0x25bdc1['forEach'](function(_0x455ef0){_0x16c20c[_0x0e9e('0x2b')](_0x455ef0[_0x0e9e('0x25')]({'exitAt':moment()[_0x0e9e('0x21')](_0x0e9e('0x28'))}));});return BPromise[_0x0e9e('0x45')](_0x16c20c);}}})[_0x0e9e('0x14')](function(){if(_0x115ef1){var _0x4842f8=[];var _0x5d469f=[];var _0xd184d1=utils[_0x0e9e('0x4c')]();var _0x3cb4a6={'membername':_0x115ef1[_0x0e9e('0x1f')],'interface':_0x9f4f12,'enterAt':moment()[_0x0e9e('0x21')](_0x0e9e('0x28')),'role':_0x115ef1[_0x0e9e('0x31')],'internal':_0x115ef1['internal']};_0xd184d1['forEach'](function(_0x2b2c27){_0x4842f8[_0x0e9e('0x2b')](_[_0x0e9e('0x4d')]({'channel':_0x2b2c27,'type':_0x0e9e('0x4e'),'data1':_0x0e9e('0x4f'),'data2':_0x9f4f12},_0x3cb4a6));if(_0x115ef1[_0x0e9e('0x4b')]){_0x5d469f['push'](_[_0x0e9e('0x4d')]({'channel':_0x2b2c27,'type':'PAUSE','data1':_0x0e9e('0x50')},_0x3cb4a6));}});return db[_0x0e9e('0x26')][_0x0e9e('0x33')](_0x4842f8[_0x0e9e('0x51')](_0x5d469f),{'individualHooks':!![]});}})[_0x0e9e('0x14')](function(){if(_0x115ef1){return _0x115ef1['update']({'online':!![],'lastLoginAt':moment()['format'](_0x0e9e('0x28')),'voicePause':_0x115ef1[_0x0e9e('0x4b')]||![],'mailPause':_0x115ef1[_0x0e9e('0x4b')]||![],'chatPause':_0x115ef1[_0x0e9e('0x4b')]||![],'faxPause':_0x115ef1['loginInPause']||![],'smsPause':_0x115ef1[_0x0e9e('0x4b')]||![],'openchannelPause':_0x115ef1['loginInPause']||![],'pauseType':_0x115ef1[_0x0e9e('0x4b')]?_0x0e9e('0x50'):null,'lastPauseAt':moment()[_0x0e9e('0x21')](_0x0e9e('0x28')),'interface':_0x9f4f12});}})[_0x0e9e('0x14')](function(_0x1b156e){_0x1ec273(_0x1b156e);})[_0x0e9e('0x19')](function(_0x1427ba){_0x665878(_0x3d6352['error'](0x1f4,_0x1427ba[_0x0e9e('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 74d50c7..4b3f20b 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 _0x1a81=['./user.events','save','remove','removeListener','register'];(function(_0x52d119,_0xfb015c){var _0xf82f81=function(_0x52c7b6){while(--_0x52c7b6){_0x52d119['push'](_0x52d119['shift']());}};_0xf82f81(++_0xfb015c);}(_0x1a81,0x1f4));var _0x11a8=function(_0x56622a,_0x223e67){_0x56622a=_0x56622a-0x0;var _0x371650=_0x1a81[_0x56622a];return _0x371650;};'use strict';var UserEvents=require(_0x11a8('0x0'));var events=[_0x11a8('0x1'),_0x11a8('0x2'),'update'];function createListener(_0x268081,_0x10f27c){return function(_0x549feb){_0x10f27c['emit'](_0x268081,_0x549feb);};}function removeListener(_0x32eb65,_0x2e02e2){return function(){UserEvents[_0x11a8('0x3')](_0x32eb65,_0x2e02e2);};}exports[_0x11a8('0x4')]=function(_0x1b370d){for(var _0x368950=0x0,_0xeae209=events['length'];_0x368950<_0xeae209;_0x368950++){var _0x5ec9bf=events[_0x368950];var _0x5c44a5=createListener('user:'+_0x5ec9bf,_0x1b370d);UserEvents['on'](_0x5ec9bf,_0x5c44a5);}}; \ No newline at end of file +var _0xf21a=['save','remove','emit','removeListener','register','length','./user.events'];(function(_0x12403d,_0x875c57){var _0x36ca44=function(_0x2a0fca){while(--_0x2a0fca){_0x12403d['push'](_0x12403d['shift']());}};_0x36ca44(++_0x875c57);}(_0xf21a,0xd8));var _0xaf21=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf21a[_0x321bb2];return _0x9c12ed;};'use strict';var UserEvents=require(_0xaf21('0x0'));var events=[_0xaf21('0x1'),_0xaf21('0x2'),'update'];function createListener(_0x5b1f37,_0x357635){return function(_0x1914bc){_0x357635[_0xaf21('0x3')](_0x5b1f37,_0x1914bc);};}function removeListener(_0x11d85c,_0x61652c){return function(){UserEvents[_0xaf21('0x4')](_0x11d85c,_0x61652c);};}exports[_0xaf21('0x5')]=function(_0x2516a7){for(var _0x231475=0x0,_0x3e5425=events[_0xaf21('0x6')];_0x231475<_0x3e5425;_0x231475++){var _0x3b93bc=events[_0x231475];var _0x4b7be0=createListener('user:'+_0x3b93bc,_0x2516a7);UserEvents['on'](_0x3b93bc,_0x4b7be0);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b0af63d..2fee171 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(_0x19db4a,_0x39f04d){var _0x274fd4=function(_0x558813){while(--_0x558813){_0x19db4a['push'](_0x19db4a['shift']());}};_0x274fd4(++_0x39f04d);}(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x307cec,_0x1cf922){var _0x285c73=function(_0x2602e7){while(--_0x2602e7){_0x307cec['push'](_0x307cec['shift']());}};_0x285c73(++_0x1cf922);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index fb75484..259feb7 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 _0x2d6d=['sequelize','exports'];(function(_0xb94101,_0x4027bb){var _0x4b94f4=function(_0x450437){while(--_0x450437){_0xb94101['push'](_0xb94101['shift']());}};_0x4b94f4(++_0x4027bb);}(_0x2d6d,0xec));var _0xd2d6=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x2d6d[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0xd2d6('0x0'));module[_0xd2d6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x517d=['sequelize','exports','INTEGER'];(function(_0x50da1d,_0x1fa929){var _0x30cd08=function(_0x337a45){while(--_0x337a45){_0x50da1d['push'](_0x50da1d['shift']());}};_0x30cd08(++_0x1fa929);}(_0x517d,0x12f));var _0xd517=function(_0x182142,_0x564118){_0x182142=_0x182142-0x0;var _0x3b307a=_0x517d[_0x182142];return _0x3b307a;};'use strict';var Sequelize=require(_0xd517('0x0'));module[_0xd517('0x1')]={'penalty':{'type':Sequelize[_0xd517('0x2')],'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 e5a8286..c888dad 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 _0x1bd4=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x59a8dc,_0x5c0a65){var _0x53336d=function(_0xb0eb66){while(--_0xb0eb66){_0x59a8dc['push'](_0x59a8dc['shift']());}};_0x53336d(++_0x5c0a65);}(_0x1bd4,0x1d8));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41bd('0x0'));var util=require(_0x41bd('0x1'));var logger=require(_0x41bd('0x2'))(_0x41bd('0x3'));var moment=require(_0x41bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bd('0x6'));var config=require(_0x41bd('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x41bd('0x8')]=function(_0x5ad8fb,_0x1f9f14){return _0x5ad8fb[_0x41bd('0x9')](_0x41bd('0xa'),attributes,{'tableName':_0x41bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd3f=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xbd3f,0x103));var _0xfbd3=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0xbd3f[_0xb6e43];return _0x47c40f;};'use strict';var _=require(_0xfbd3('0x0'));var util=require(_0xfbd3('0x1'));var logger=require(_0xfbd3('0x2'))(_0xfbd3('0x3'));var moment=require(_0xfbd3('0x4'));var BPromise=require('bluebird');var rp=require(_0xfbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbd3('0x6'));var config=require(_0xfbd3('0x7'));var attributes=require(_0xfbd3('0x8'));module[_0xfbd3('0x9')]=function(_0xe29472,_0x2bfcd9){return _0xe29472[_0xfbd3('0xa')](_0xfbd3('0xb'),attributes,{'tableName':_0xfbd3('0xc'),'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 b1d91b2..b37aef4 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 _0xf496=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x566143,_0x39d70e){var _0x37881d=function(_0x3d82ca){while(--_0x3d82ca){_0x566143['push'](_0x566143['shift']());}};_0x37881d(++_0x39d70e);}(_0xf496,0xc0));var _0x6f49=function(_0x4e809e,_0x148a2d){_0x4e809e=_0x4e809e-0x0;var _0x126252=_0xf496[_0x4e809e];return _0x126252;};'use strict';var _=require('lodash');var util=require(_0x6f49('0x0'));var moment=require(_0x6f49('0x1'));var BPromise=require(_0x6f49('0x2'));var rs=require(_0x6f49('0x3'));var fs=require('fs');var Redis=require(_0x6f49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f49('0x5'));var logger=require(_0x6f49('0x6'))(_0x6f49('0x7'));var config=require(_0x6f49('0x8'));var jayson=require(_0x6f49('0x9'));var client=jayson[_0x6f49('0xa')][_0x6f49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1942b2,_0x3e76f0,_0x292530){return new BPromise(function(_0x43d3c2,_0xaa9c74){return client[_0x6f49('0xc')](_0x1942b2,_0x292530)['then'](function(_0x9b2618){logger['info'](_0x6f49('0xd'),_0x3e76f0,'request\x20sent');logger[_0x6f49('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3e76f0,_0x6f49('0xf'),JSON[_0x6f49('0x10')](_0x9b2618));if(_0x9b2618[_0x6f49('0x11')]){if(_0x9b2618['error'][_0x6f49('0x12')]===0x1f4){logger[_0x6f49('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3e76f0,_0x9b2618[_0x6f49('0x11')]['message']);return _0xaa9c74(_0x9b2618[_0x6f49('0x11')][_0x6f49('0x13')]);}logger[_0x6f49('0x11')](_0x6f49('0xd'),_0x3e76f0,_0x9b2618['error'][_0x6f49('0x13')]);return _0x43d3c2(_0x9b2618[_0x6f49('0x11')][_0x6f49('0x13')]);}else{logger[_0x6f49('0x14')](_0x6f49('0xd'),_0x3e76f0,_0x6f49('0xf'));_0x43d3c2(_0x9b2618['result']['message']);}})[_0x6f49('0x15')](function(_0x4faa9e){logger[_0x6f49('0x11')](_0x6f49('0xd'),_0x3e76f0,_0x4faa9e);_0xaa9c74(_0x4faa9e);});});} \ No newline at end of file +var _0xc637=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0xeba865,_0xaa973){var _0xfbe83b=function(_0x26c88a){while(--_0x26c88a){_0xeba865['push'](_0xeba865['shift']());}};_0xfbe83b(++_0xaa973);}(_0xc637,0x13b));var _0x7c63=function(_0x35292f,_0x2ed644){_0x35292f=_0x35292f-0x0;var _0x450e0c=_0xc637[_0x35292f];return _0x450e0c;};'use strict';var _=require('lodash');var util=require(_0x7c63('0x0'));var moment=require(_0x7c63('0x1'));var BPromise=require(_0x7c63('0x2'));var rs=require(_0x7c63('0x3'));var fs=require('fs');var Redis=require(_0x7c63('0x4'));var db=require(_0x7c63('0x5'))['db'];var utils=require(_0x7c63('0x6'));var logger=require(_0x7c63('0x7'))(_0x7c63('0x8'));var config=require(_0x7c63('0x9'));var jayson=require(_0x7c63('0xa'));var client=jayson[_0x7c63('0xb')][_0x7c63('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xdf69,_0x35b653,_0x5d6c3f){return new BPromise(function(_0x285dec,_0x1a963a){return client[_0x7c63('0xd')](_0xdf69,_0x5d6c3f)[_0x7c63('0xe')](function(_0x220e08){logger['info'](_0x7c63('0xf'),_0x35b653,_0x7c63('0x10'));logger[_0x7c63('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x35b653,_0x7c63('0x10'),JSON['stringify'](_0x220e08));if(_0x220e08['error']){if(_0x220e08[_0x7c63('0x12')][_0x7c63('0x13')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x35b653,_0x220e08['error']['message']);return _0x1a963a(_0x220e08[_0x7c63('0x12')]['message']);}logger[_0x7c63('0x12')](_0x7c63('0xf'),_0x35b653,_0x220e08[_0x7c63('0x12')][_0x7c63('0x14')]);return _0x285dec(_0x220e08['error'][_0x7c63('0x14')]);}else{logger[_0x7c63('0x15')](_0x7c63('0xf'),_0x35b653,'request\x20sent');_0x285dec(_0x220e08[_0x7c63('0x16')][_0x7c63('0x14')]);}})[_0x7c63('0x17')](function(_0x51656c){logger[_0x7c63('0x12')](_0x7c63('0xf'),_0x35b653,_0x51656c);_0x1a963a(_0x51656c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7f755af..531834c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d24e,_0x1f75c0){var _0x1a54d0=function(_0x422a0f){while(--_0x422a0f){_0x5d24e['push'](_0x5d24e['shift']());}};_0x1a54d0(++_0x1f75c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xcb91[_0x4d08b8];return _0x70214a;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5f0f2c,_0x9817bf){var _0x104e69=function(_0x6915cc){while(--_0x6915cc){_0x5f0f2c['push'](_0x5f0f2c['shift']());}};_0x104e69(++_0x9817bf);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d57889e..d7de372 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 _0x2013=['sequelize','exports','INTEGER','STRING'];(function(_0x476e5c,_0x188d9b){var _0x51992c=function(_0x54c31f){while(--_0x54c31f){_0x476e5c['push'](_0x476e5c['shift']());}};_0x51992c(++_0x188d9b);}(_0x2013,0x190));var _0x3201=function(_0x2b72e0,_0x5730a7){_0x2b72e0=_0x2b72e0-0x0;var _0x4d6565=_0x2013[_0x2b72e0];return _0x4d6565;};'use strict';var Sequelize=require(_0x3201('0x0'));module[_0x3201('0x1')]={'penalty':{'type':Sequelize[_0x3201('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3201('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3201('0x3')]}}; \ No newline at end of file +var _0x2989=['STRING','sequelize','exports','INTEGER'];(function(_0x192331,_0x535ca2){var _0x403fb4=function(_0x135216){while(--_0x135216){_0x192331['push'](_0x192331['shift']());}};_0x403fb4(++_0x535ca2);}(_0x2989,0x175));var _0x9298=function(_0x2de0e8,_0x1f7201){_0x2de0e8=_0x2de0e8-0x0;var _0x394685=_0x2989[_0x2de0e8];return _0x394685;};'use strict';var Sequelize=require(_0x9298('0x0'));module[_0x9298('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9298('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9298('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f9ec1f8..be263f4 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 _0x84e4=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','UserFaxQueue','lodash','util'];(function(_0x81dade,_0x214864){var _0x3b7224=function(_0x1ee304){while(--_0x1ee304){_0x81dade['push'](_0x81dade['shift']());}};_0x3b7224(++_0x214864);}(_0x84e4,0x127));var _0x484e=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x84e4[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x484e('0x0'));var util=require(_0x484e('0x1'));var logger=require(_0x484e('0x2'))(_0x484e('0x3'));var moment=require(_0x484e('0x4'));var BPromise=require(_0x484e('0x5'));var rp=require(_0x484e('0x6'));var fs=require('fs');var path=require(_0x484e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x484e('0x8')]=function(_0x474d30,_0x3a6ba5){return _0x474d30[_0x484e('0x9')](_0x484e('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f0=['define','UserFaxQueue','user_has_fax_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x28c249,_0x380399){var _0x38b10f=function(_0x4e7610){while(--_0x4e7610){_0x28c249['push'](_0x28c249['shift']());}};_0x38b10f(++_0x380399);}(_0xc1f0,0x92));var _0x0c1f=function(_0x34fe54,_0x32ca32){_0x34fe54=_0x34fe54-0x0;var _0x507c89=_0xc1f0[_0x34fe54];return _0x507c89;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c1f('0x0'))(_0x0c1f('0x1'));var moment=require(_0x0c1f('0x2'));var BPromise=require(_0x0c1f('0x3'));var rp=require(_0x0c1f('0x4'));var fs=require('fs');var path=require(_0x0c1f('0x5'));var rimraf=require(_0x0c1f('0x6'));var config=require(_0x0c1f('0x7'));var attributes=require(_0x0c1f('0x8'));module[_0x0c1f('0x9')]=function(_0x4f3d7f,_0x36b89f){return _0x4f3d7f[_0x0c1f('0xa')](_0x0c1f('0xb'),attributes,{'tableName':_0x0c1f('0xc'),'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 4e4b875..07a25a0 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 _0x7b77=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa756a3,_0x51445f){var _0xfd50f=function(_0x422a69){while(--_0x422a69){_0xa756a3['push'](_0xa756a3['shift']());}};_0xfd50f(++_0x51445f);}(_0x7b77,0xab));var _0x77b7=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x7b77[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0x77b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77b7('0x1'));var rs=require(_0x77b7('0x2'));var fs=require('fs');var Redis=require(_0x77b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b7('0x4'));var logger=require(_0x77b7('0x5'))(_0x77b7('0x6'));var config=require(_0x77b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b89fe,_0x2d8172,_0x52cecf){return new BPromise(function(_0x4cd610,_0x4b8438){return client['request'](_0x4b89fe,_0x52cecf)[_0x77b7('0x9')](function(_0x13b56b){logger[_0x77b7('0xa')](_0x77b7('0xb'),_0x2d8172,_0x77b7('0xc'));logger[_0x77b7('0xd')](_0x77b7('0xe'),_0x2d8172,_0x77b7('0xc'),JSON[_0x77b7('0xf')](_0x13b56b));if(_0x13b56b[_0x77b7('0x10')]){if(_0x13b56b['error'][_0x77b7('0x11')]===0x1f4){logger[_0x77b7('0x10')](_0x77b7('0xb'),_0x2d8172,_0x13b56b[_0x77b7('0x10')]['message']);return _0x4b8438(_0x13b56b['error'][_0x77b7('0x12')]);}logger['error'](_0x77b7('0xb'),_0x2d8172,_0x13b56b[_0x77b7('0x10')][_0x77b7('0x12')]);return _0x4cd610(_0x13b56b[_0x77b7('0x10')][_0x77b7('0x12')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2d8172,'request\x20sent');_0x4cd610(_0x13b56b[_0x77b7('0x13')][_0x77b7('0x12')]);}})[_0x77b7('0x14')](function(_0x374678){logger['error'](_0x77b7('0xb'),_0x2d8172,_0x374678);_0x4b8438(_0x374678);});});} \ No newline at end of file +var _0xf14b=['stringify','error','message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf14b,0x88));var _0xbf14=function(_0x3ea360,_0x4a3b9e){_0x3ea360=_0x3ea360-0x0;var _0x330457=_0xf14b[_0x3ea360];return _0x330457;};'use strict';var _=require(_0xbf14('0x0'));var util=require(_0xbf14('0x1'));var moment=require(_0xbf14('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf14('0x3'));var db=require(_0xbf14('0x4'))['db'];var utils=require(_0xbf14('0x5'));var logger=require(_0xbf14('0x6'))(_0xbf14('0x7'));var config=require(_0xbf14('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf14('0x9')][_0xbf14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcd583c,_0x33bbd1,_0x5a7f1e){return new BPromise(function(_0x2bf3ae,_0xcfd31f){return client['request'](_0xcd583c,_0x5a7f1e)[_0xbf14('0xb')](function(_0x48de83){logger[_0xbf14('0xc')](_0xbf14('0xd'),_0x33bbd1,_0xbf14('0xe'));logger[_0xbf14('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x33bbd1,'request\x20sent',JSON[_0xbf14('0x10')](_0x48de83));if(_0x48de83[_0xbf14('0x11')]){if(_0x48de83[_0xbf14('0x11')]['code']===0x1f4){logger[_0xbf14('0x11')](_0xbf14('0xd'),_0x33bbd1,_0x48de83[_0xbf14('0x11')]['message']);return _0xcfd31f(_0x48de83[_0xbf14('0x11')]['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x33bbd1,_0x48de83[_0xbf14('0x11')][_0xbf14('0x12')]);return _0x2bf3ae(_0x48de83[_0xbf14('0x11')][_0xbf14('0x12')]);}else{logger['info'](_0xbf14('0xd'),_0x33bbd1,'request\x20sent');_0x2bf3ae(_0x48de83['result'][_0xbf14('0x12')]);}})['catch'](function(_0x5f0e87){logger[_0xbf14('0x11')](_0xbf14('0xd'),_0x33bbd1,_0x5f0e87);_0xcfd31f(_0x5f0e87);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 27b2995..7b189e4 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xd4f210,_0x2e08cf){var _0x5b1352=function(_0xcd93ef){while(--_0xcd93ef){_0xd4f210['push'](_0xd4f210['shift']());}};_0x5b1352(++_0x2e08cf);}(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x540311,_0x53ca8b){var _0x56beef=function(_0x2cb4e8){while(--_0x2cb4e8){_0x540311['push'](_0x540311['shift']());}};_0x56beef(++_0x53ca8b);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2451327..15922ec 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 _0x4e3d=['exports','sequelize'];(function(_0x20b0a3,_0xa0a2ca){var _0x5882f1=function(_0x34d30e){while(--_0x34d30e){_0x20b0a3['push'](_0x20b0a3['shift']());}};_0x5882f1(++_0xa0a2ca);}(_0x4e3d,0x12b));var _0xd4e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4e3d[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xd4e3('0x0'));module[_0xd4e3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x86ce=['sequelize','exports'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x86ce,0x174));var _0xe86c=function(_0x4bcb3c,_0x192122){_0x4bcb3c=_0x4bcb3c-0x0;var _0xfe09bb=_0x86ce[_0x4bcb3c];return _0xfe09bb;};'use strict';var Sequelize=require(_0xe86c('0x0'));module[_0xe86c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 8d0a7ac..8f8970a 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 _0x208d=['bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','api'];(function(_0x2058b3,_0x1b49b4){var _0x5cae63=function(_0x59d590){while(--_0x59d590){_0x2058b3['push'](_0x2058b3['shift']());}};_0x5cae63(++_0x1b49b4);}(_0x208d,0x11c));var _0xd208=function(_0x5800a5,_0x2823f6){_0x5800a5=_0x5800a5-0x0;var _0x420c85=_0x208d[_0x5800a5];return _0x420c85;};'use strict';var _=require('lodash');var util=require(_0xd208('0x0'));var logger=require('../../config/logger')(_0xd208('0x1'));var moment=require('moment');var BPromise=require(_0xd208('0x2'));var rp=require(_0xd208('0x3'));var fs=require('fs');var path=require(_0xd208('0x4'));var rimraf=require(_0xd208('0x5'));var config=require('../../config/environment');var attributes=require(_0xd208('0x6'));module[_0xd208('0x7')]=function(_0xd88502,_0x4139be){return _0xd88502[_0xd208('0x8')](_0xd208('0x9'),attributes,{'tableName':_0xd208('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8ee=['bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','../../config/logger','api','moment'];(function(_0x397014,_0x17cc12){var _0x1163f7=function(_0x290ac1){while(--_0x290ac1){_0x397014['push'](_0x397014['shift']());}};_0x1163f7(++_0x17cc12);}(_0xd8ee,0x11b));var _0xed8e=function(_0x525290,_0x493c29){_0x525290=_0x525290-0x0;var _0x1231ca=_0xd8ee[_0x525290];return _0x1231ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed8e('0x0'))(_0xed8e('0x1'));var moment=require(_0xed8e('0x2'));var BPromise=require(_0xed8e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed8e('0x4'));var rimraf=require(_0xed8e('0x5'));var config=require(_0xed8e('0x6'));var attributes=require(_0xed8e('0x7'));module[_0xed8e('0x8')]=function(_0x344442,_0x1c1e83){return _0x344442[_0xed8e('0x9')]('UserMailQueue',attributes,{'tableName':_0xed8e('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 74bf667..822694a 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 _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(_0x4a8845,_0x11180a){var _0xffa189=function(_0x1a2d11){while(--_0x1a2d11){_0x4a8845['push'](_0x4a8845['shift']());}};_0xffa189(++_0x11180a);}(_0xe14b,0x93));var _0xbe14=function(_0x4bac65,_0x742f8d){_0x4bac65=_0x4bac65-0x0;var _0x51b0e0=_0xe14b[_0x4bac65];return _0x51b0e0;};'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 +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48f369,_0x3a7a90){var _0x45a957=function(_0x597ccd){while(--_0x597ccd){_0x48f369['push'](_0x48f369['shift']());}};_0x45a957(++_0x3a7a90);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index ee3a042..b688f1d 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 _0x21a9=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','util','path'];(function(_0x5b32f8,_0x4d0658){var _0x50e07f=function(_0x252edb){while(--_0x252edb){_0x5b32f8['push'](_0x5b32f8['shift']());}};_0x50e07f(++_0x4d0658);}(_0x21a9,0x1ae));var _0x921a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x21a9[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0x921a('0x0'));var path=require(_0x921a('0x1'));var timeout=require(_0x921a('0x2'));var express=require(_0x921a('0x3'));var router=express[_0x921a('0x4')]();var fs_extra=require(_0x921a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x921a('0x6'));var config=require(_0x921a('0x7'));var controller=require('./userNotification.controller');router[_0x921a('0x8')]('/',auth[_0x921a('0x9')](),controller[_0x921a('0xa')]);module[_0x921a('0xb')]=router; \ No newline at end of file +var _0xb129=['Router','fs-extra','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification','multer','path','connect-timeout','express'];(function(_0xa706e0,_0x471bec){var _0xc6e0a8=function(_0xbe3a80){while(--_0xbe3a80){_0xa706e0['push'](_0xa706e0['shift']());}};_0xc6e0a8(++_0x471bec);}(_0xb129,0x15a));var _0x9b12=function(_0x26bff1,_0x34c8ec){_0x26bff1=_0x26bff1-0x0;var _0x71a8d5=_0xb129[_0x26bff1];return _0x71a8d5;};'use strict';var multer=require(_0x9b12('0x0'));var util=require('util');var path=require(_0x9b12('0x1'));var timeout=require(_0x9b12('0x2'));var express=require(_0x9b12('0x3'));var router=express[_0x9b12('0x4')]();var fs_extra=require(_0x9b12('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9b12('0x6'));var config=require('../../config/environment');var controller=require(_0x9b12('0x7'));router['post']('/',auth[_0x9b12('0x8')](),controller[_0x9b12('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 6e3d848..1332e21 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 _0x92bc=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x51606b,_0x112eb0){var _0x3ea25c=function(_0x29c56f){while(--_0x29c56f){_0x51606b['push'](_0x51606b['shift']());}};_0x3ea25c(++_0x112eb0);}(_0x92bc,0x117));var _0xc92b=function(_0x1ba92e,_0x518215){_0x1ba92e=_0x1ba92e-0x0;var _0x5a313b=_0x92bc[_0x1ba92e];return _0x5a313b;};'use strict';var Sequelize=require(_0xc92b('0x0'));module[_0xc92b('0x1')]={'body':{'type':Sequelize[_0xc92b('0x2')]},'senderName':{'type':Sequelize[_0xc92b('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xc92b('0x4')]}}; \ No newline at end of file +var _0xf2aa=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0xbd4746,_0x9ca2c8){var _0x2afcef=function(_0x5c6a0b){while(--_0x5c6a0b){_0xbd4746['push'](_0xbd4746['shift']());}};_0x2afcef(++_0x9ca2c8);}(_0xf2aa,0x129));var _0xaf2a=function(_0x5b9de6,_0x3bd267){_0x5b9de6=_0x5b9de6-0x0;var _0x558207=_0xf2aa[_0x5b9de6];return _0x558207;};'use strict';var Sequelize=require(_0xaf2a('0x0'));module['exports']={'body':{'type':Sequelize[_0xaf2a('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xaf2a('0x1')]},'recipientsDescription':{'type':Sequelize[_0xaf2a('0x2')]},'beep':{'type':Sequelize[_0xaf2a('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f4bbfc9..a365726 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 _0xe8be=['reject','save','update','destroy','then','error','stack','name','send','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','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','user','recipientsId','sortBy','join','sequelize','UserNotification','create','beep','forEach','recipient','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','model','toLowerCase','User','union','ids','queue','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x4fab75,_0x398990){var _0x739298=function(_0x40943a){while(--_0x40943a){_0x4fab75['push'](_0x4fab75['shift']());}};_0x739298(++_0x398990);}(_0xe8be,0x174));var _0xee8b=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xe8be[_0x3f6e26];return _0x474345;};'use strict';var emlformat=require(_0xee8b('0x0'));var rimraf=require(_0xee8b('0x1'));var zipdir=require(_0xee8b('0x2'));var jsonpatch=require(_0xee8b('0x3'));var rp=require(_0xee8b('0x4'));var moment=require('moment');var BPromise=require(_0xee8b('0x5'));var Mustache=require(_0xee8b('0x6'));var util=require(_0xee8b('0x7'));var path=require(_0xee8b('0x8'));var sox=require(_0xee8b('0x9'));var csv=require(_0xee8b('0xa'));var ejs=require(_0xee8b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee8b('0xc'));var crypto=require(_0xee8b('0xd'));var jsforce=require(_0xee8b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee8b('0xa'));var querystring=require(_0xee8b('0xf'));var Papa=require('papaparse');var Redis=require(_0xee8b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xee8b('0x11'));var hardwareService=require(_0xee8b('0x12'));var logger=require(_0xee8b('0x13'))(_0xee8b('0x14'));var utils=require(_0xee8b('0x15'));var config=require(_0xee8b('0x16'));var licenseUtil=require(_0xee8b('0x17'));var db=require('../../mysqldb')['db'];config[_0xee8b('0x18')]=_[_0xee8b('0x19')](config[_0xee8b('0x18')],{'host':_0xee8b('0x1a'),'port':0x18eb});var socket=require(_0xee8b('0x1b'))(new Redis(config['redis']));require(_0xee8b('0x1c'))['register'](socket);function respondWithStatusCode(_0x35ef35,_0x594633){_0x594633=_0x594633||0xcc;return function(_0x21586f){if(_0x21586f){return _0x35ef35[_0xee8b('0x1d')](_0x594633);}return _0x35ef35[_0xee8b('0x1e')](_0x594633)[_0xee8b('0x1f')]();};}function respondWithResult(_0x336713,_0x4ae1d6){_0x4ae1d6=_0x4ae1d6||0xc8;return function(_0x5a46e9){if(_0x5a46e9){return _0x336713[_0xee8b('0x1e')](_0x4ae1d6)['json'](_0x5a46e9);}};}function respondWithFilteredResult(_0x5ecc3c,_0x15345c){return function(_0x595de3){if(_0x595de3){var _0x421e86=typeof _0x15345c['offset']===_0xee8b('0x20')&&typeof _0x15345c[_0xee8b('0x21')]==='undefined';var _0x5bd8e9=_0x595de3[_0xee8b('0x22')];var _0x431c0d=_0x421e86?0x0:_0x15345c[_0xee8b('0x23')];var _0x32627c=_0x421e86?_0x595de3[_0xee8b('0x22')]:_0x15345c[_0xee8b('0x23')]+_0x15345c[_0xee8b('0x21')];var _0x240e27;if(_0x32627c>=_0x5bd8e9){_0x32627c=_0x5bd8e9;_0x240e27=0xc8;}else{_0x240e27=0xce;}_0x5ecc3c[_0xee8b('0x1e')](_0x240e27);return _0x5ecc3c[_0xee8b('0x24')](_0xee8b('0x25'),_0x431c0d+'-'+_0x32627c+'/'+_0x5bd8e9)[_0xee8b('0x26')](_0x595de3);}return null;};}function patchUpdates(_0x16fe11){return function(_0xdfb4f1){try{jsonpatch[_0xee8b('0x27')](_0xdfb4f1,_0x16fe11,!![]);}catch(_0x5d7ade){return BPromise[_0xee8b('0x28')](_0x5d7ade);}return _0xdfb4f1[_0xee8b('0x29')]();};}function saveUpdates(_0x4a878e,_0x57649e){return function(_0x227b9b){if(_0x227b9b){return _0x227b9b[_0xee8b('0x2a')](_0x4a878e)['then'](function(_0x4df8e7){return _0x4df8e7;});}return null;};}function removeEntity(_0x538c08,_0x3e6657){return function(_0x2f097c){if(_0x2f097c){return _0x2f097c[_0xee8b('0x2b')]()[_0xee8b('0x2c')](function(){_0x538c08['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb7861,_0x27fe44){return function(_0x385481){if(!_0x385481){_0xdb7861['sendStatus'](0x194);}return _0x385481;};}function handleError(_0x40a6a0,_0x39c5d8){_0x39c5d8=_0x39c5d8||0x1f4;return function(_0x4b12a6){logger[_0xee8b('0x2d')](_0x4b12a6[_0xee8b('0x2e')]);if(_0x4b12a6['name']){delete _0x4b12a6[_0xee8b('0x2f')];}_0x40a6a0[_0xee8b('0x1e')](_0x39c5d8)[_0xee8b('0x30')](_0x4b12a6);};}exports[_0xee8b('0x31')]=function(_0x5f3fb8,_0x20753f,_0x2c95f7){if(!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x34'))&&!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x35'))){throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x38'));}else{if(_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x35'))&&!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x39'))){throw new db[(_0xee8b('0x36'))]['ValidationError'](_0xee8b('0x3a'));}if(!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x3b'))){throw new db['Sequelize'][(_0xee8b('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x42db06=JSON[_0xee8b('0x3c')](_0x5f3fb8[_0xee8b('0x32')]['recipients']);}catch(_0x54028d){logger[_0xee8b('0x2d')](_0x54028d);throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x3d'));}var _0x360d9a=[_0xee8b('0x3e'),_0xee8b('0x3f'),_0xee8b('0x40'),_0xee8b('0x41'),_0xee8b('0x42'),_0xee8b('0x43'),'whatsappqueue',_0xee8b('0x44'),'user'];if(_[_0xee8b('0x45')](_0x42db06,function(_0x3218e9){return!_[_0xee8b('0x46')](_0x360d9a,_0x3218e9['model']['toLowerCase']());})){throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x47'));}}}var _0xf83db0={};_0xf83db0[_0xee8b('0x48')]=_0x5f3fb8['body']['hasOwnProperty'](_0xee8b('0x48'))?_0x5f3fb8['body'][_0xee8b('0x48')]:_0x5f3fb8['user'][_0xee8b('0x49')];_0xf83db0[_0xee8b('0x4a')]=_[_0xee8b('0x4b')](_0x5f3fb8[_0xee8b('0x32')]['recipientsDescription'])?null:_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x4a')];_0xf83db0['beep']=_0x5f3fb8[_0xee8b('0x32')]['beep']||![];_0xf83db0[_0xee8b('0x4c')]=_0x5f3fb8[_0xee8b('0x4d')]['id'];return getContent(_0x5f3fb8[_0xee8b('0x32')])[_0xee8b('0x2c')](function(_0x2e29ad){_0xf83db0[_0xee8b('0x32')]=_0x2e29ad;return getRecipients(_0x42db06);})[_0xee8b('0x2c')](function(_0x34554f){_0xf83db0[_0xee8b('0x4e')]=_[_0xee8b('0x4f')](_0x34554f)[_0xee8b('0x50')](',');return db[_0xee8b('0x51')]['transaction'](function(_0x3fe47d){return db[_0xee8b('0x52')][_0xee8b('0x53')](_0xf83db0,{'raw':!![],'transaction':_0x3fe47d})['then'](function(_0xdb0ce4){var _0x276caf={'sender':_0xf83db0[_0xee8b('0x48')],'description':_0xf83db0[_0xee8b('0x4a')],'content':_0xf83db0[_0xee8b('0x32')],'beep':_0xf83db0[_0xee8b('0x54')]};_0x34554f[_0xee8b('0x55')](function(_0x4450aa){_0x276caf[_0xee8b('0x56')]=_0x4450aa;socket['emit'](_0xee8b('0x57'),_0x276caf);});return _0xdb0ce4;});});})['then'](respondWithResult(_0x20753f,0xc9))[_0xee8b('0x58')](handleError(_0x20753f,null));};function getContent(_0x27c6dd){return new BPromise(function(_0x22ab31,_0x4324a3){if(_0x27c6dd[_0xee8b('0x34')]){_0x22ab31(_0x27c6dd['text']);return;}return db[_0xee8b('0x59')][_0xee8b('0x5a')]({'attributes':['html'],'where':{'id':_0x27c6dd[_0xee8b('0x35')]},'raw':!![]})[_0xee8b('0x2c')](function(_0x176aca){if(!_0x176aca)throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x5b'));var _0xc35a9c=Mustache['render'](_0x176aca['html'],_0x27c6dd[_0xee8b('0x39')]);_0x22ab31(_0xc35a9c);})[_0xee8b('0x58')](function(_0x3a0b4d){_0x4324a3(_0x3a0b4d);});});}function getRecipients(_0x507ea4){return new BPromise(function(_0x280392,_0x1dda87){var _0x39239e=[];var _0x3db63c=[];_0x507ea4[_0xee8b('0x55')](function(_0xedb37){var _0x346458=_['startCase'](_0xedb37[_0xee8b('0x5c')][_0xee8b('0x5d')]());if(_0x346458===_0xee8b('0x5e')){_0x39239e=_[_0xee8b('0x5f')](_0x39239e,_0xedb37[_0xee8b('0x60')]);}else{if(_[_0xee8b('0x46')](_0x346458,_0xee8b('0x61')))_0x346458=_0x346458['replace'](_0xee8b('0x61'),_0xee8b('0x62'));_0xedb37['ids'][_0xee8b('0x55')](function(_0x3ea25f){_0x3db63c['push'](getAgents(_0x346458,_0x3ea25f));});}});return BPromise[_0xee8b('0x63')](_0x3db63c)['then'](function(_0x2902c2){_0x39239e=_[_0xee8b('0x5f')](_0x39239e,_[_0xee8b('0x64')](_0x2902c2));_0x280392(_0x39239e);})[_0xee8b('0x58')](function(_0x2d0108){_0x1dda87(_0x2d0108);});});}function getAgents(_0x5db551,_0x5d8ca7){return new BPromise(function(_0xf1ddca,_0x3b8511){return db[_0x5db551][_0xee8b('0x5a')]({'where':{'id':_0x5d8ca7}})[_0xee8b('0x2c')](function(_0x7c641b){return _0x7c641b[_0xee8b('0x65')]({'attributes':['id'],'raw':!![]})[_0xee8b('0x2c')](function(_0x400791){var _0x1087a7=_[_0xee8b('0x66')](_0x400791,'id');_0xf1ddca(_0x1087a7);});})[_0xee8b('0x58')](function(_0x3f9e49){_0x3b8511(_0x3f9e49);});});} \ No newline at end of file +var _0x87ec=['send','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','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','recipient','emit','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','forEach','startCase','User','union','queue','replace','Queue','push','all','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','status','error','stack','name'];(function(_0x2a535b,_0x452b6f){var _0x59e74d=function(_0x3928a4){while(--_0x3928a4){_0x2a535b['push'](_0x2a535b['shift']());}};_0x59e74d(++_0x452b6f);}(_0x87ec,0x158));var _0xc87e=function(_0x388d01,_0x38bf51){_0x388d01=_0x388d01-0x0;var _0x23bf5c=_0x87ec[_0x388d01];return _0x23bf5c;};'use strict';var emlformat=require(_0xc87e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc87e('0x1'));var jsonpatch=require(_0xc87e('0x2'));var rp=require(_0xc87e('0x3'));var moment=require(_0xc87e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc87e('0x5'));var util=require(_0xc87e('0x6'));var path=require(_0xc87e('0x7'));var sox=require(_0xc87e('0x8'));var csv=require(_0xc87e('0x9'));var ejs=require(_0xc87e('0xa'));var fs=require('fs');var fs_extra=require(_0xc87e('0xb'));var _=require(_0xc87e('0xc'));var squel=require(_0xc87e('0xd'));var crypto=require(_0xc87e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc87e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc87e('0x10'));var Papa=require('papaparse');var Redis=require(_0xc87e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc87e('0x12'));var hardwareService=require(_0xc87e('0x13'));var logger=require(_0xc87e('0x14'))(_0xc87e('0x15'));var utils=require(_0xc87e('0x16'));var config=require(_0xc87e('0x17'));var licenseUtil=require(_0xc87e('0x18'));var db=require(_0xc87e('0x19'))['db'];config[_0xc87e('0x1a')]=_[_0xc87e('0x1b')](config[_0xc87e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc87e('0x1c'))(new Redis(config[_0xc87e('0x1a')]));require('./userNotification.socket')[_0xc87e('0x1d')](socket);function respondWithStatusCode(_0x231cc6,_0x2cacff){_0x2cacff=_0x2cacff||0xcc;return function(_0x30374a){if(_0x30374a){return _0x231cc6[_0xc87e('0x1e')](_0x2cacff);}return _0x231cc6['status'](_0x2cacff)[_0xc87e('0x1f')]();};}function respondWithResult(_0x3d7ebf,_0x6855c3){_0x6855c3=_0x6855c3||0xc8;return function(_0x5e4ae1){if(_0x5e4ae1){return _0x3d7ebf['status'](_0x6855c3)[_0xc87e('0x20')](_0x5e4ae1);}};}function respondWithFilteredResult(_0x30c1a3,_0x1cce59){return function(_0x51d2d1){if(_0x51d2d1){var _0x58b975=typeof _0x1cce59[_0xc87e('0x21')]==='undefined'&&typeof _0x1cce59[_0xc87e('0x22')]===_0xc87e('0x23');var _0x5ce6b1=_0x51d2d1[_0xc87e('0x24')];var _0x31d836=_0x58b975?0x0:_0x1cce59[_0xc87e('0x21')];var _0x1cd0fb=_0x58b975?_0x51d2d1[_0xc87e('0x24')]:_0x1cce59['offset']+_0x1cce59[_0xc87e('0x22')];var _0x3d6468;if(_0x1cd0fb>=_0x5ce6b1){_0x1cd0fb=_0x5ce6b1;_0x3d6468=0xc8;}else{_0x3d6468=0xce;}_0x30c1a3['status'](_0x3d6468);return _0x30c1a3['set'](_0xc87e('0x25'),_0x31d836+'-'+_0x1cd0fb+'/'+_0x5ce6b1)[_0xc87e('0x20')](_0x51d2d1);}return null;};}function patchUpdates(_0x5dcbdb){return function(_0x3b32bd){try{jsonpatch[_0xc87e('0x26')](_0x3b32bd,_0x5dcbdb,!![]);}catch(_0x46a4e3){return BPromise[_0xc87e('0x27')](_0x46a4e3);}return _0x3b32bd[_0xc87e('0x28')]();};}function saveUpdates(_0x669be,_0x3e4aa3){return function(_0x317b9f){if(_0x317b9f){return _0x317b9f[_0xc87e('0x29')](_0x669be)['then'](function(_0x109ad1){return _0x109ad1;});}return null;};}function removeEntity(_0x5058bc,_0x383889){return function(_0x447395){if(_0x447395){return _0x447395[_0xc87e('0x2a')]()[_0xc87e('0x2b')](function(){_0x5058bc[_0xc87e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d24f0,_0x21a45f){return function(_0x1ea52c){if(!_0x1ea52c){_0x4d24f0[_0xc87e('0x1e')](0x194);}return _0x1ea52c;};}function handleError(_0x467abd,_0x478c99){_0x478c99=_0x478c99||0x1f4;return function(_0x529f43){logger[_0xc87e('0x2d')](_0x529f43[_0xc87e('0x2e')]);if(_0x529f43[_0xc87e('0x2f')]){delete _0x529f43[_0xc87e('0x2f')];}_0x467abd['status'](_0x478c99)[_0xc87e('0x30')](_0x529f43);};}exports['sendUserNotification']=function(_0x39461d,_0x4f5af8,_0x4309db){if(!_0x39461d[_0xc87e('0x31')][_0xc87e('0x32')](_0xc87e('0x33'))&&!_0x39461d[_0xc87e('0x31')][_0xc87e('0x32')](_0xc87e('0x34'))){throw new db[(_0xc87e('0x35'))][(_0xc87e('0x36'))](_0xc87e('0x37'));}else{if(_0x39461d[_0xc87e('0x31')][_0xc87e('0x32')](_0xc87e('0x34'))&&!_0x39461d[_0xc87e('0x31')]['hasOwnProperty'](_0xc87e('0x38'))){throw new db[(_0xc87e('0x35'))][(_0xc87e('0x36'))](_0xc87e('0x39'));}if(!_0x39461d['body']['hasOwnProperty'](_0xc87e('0x3a'))){throw new db['Sequelize'][(_0xc87e('0x36'))](_0xc87e('0x3b'));}else{try{var _0x527c9e=JSON[_0xc87e('0x3c')](_0x39461d[_0xc87e('0x31')]['recipients']);}catch(_0xfb01b5){logger[_0xc87e('0x2d')](_0xfb01b5);throw new db[(_0xc87e('0x35'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x502a32=[_0xc87e('0x3d'),_0xc87e('0x3e'),_0xc87e('0x3f'),_0xc87e('0x40'),'smsqueue','voicequeue',_0xc87e('0x41'),'team',_0xc87e('0x42')];if(_[_0xc87e('0x43')](_0x527c9e,function(_0x5ca4da){return!_[_0xc87e('0x44')](_0x502a32,_0x5ca4da[_0xc87e('0x45')][_0xc87e('0x46')]());})){throw new db[(_0xc87e('0x35'))][(_0xc87e('0x36'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x114114={};_0x114114[_0xc87e('0x47')]=_0x39461d['body'][_0xc87e('0x32')](_0xc87e('0x47'))?_0x39461d[_0xc87e('0x31')][_0xc87e('0x47')]:_0x39461d[_0xc87e('0x42')][_0xc87e('0x48')];_0x114114['recipientsDescription']=_['isEmpty'](_0x39461d[_0xc87e('0x31')][_0xc87e('0x49')])?null:_0x39461d[_0xc87e('0x31')][_0xc87e('0x49')];_0x114114[_0xc87e('0x4a')]=_0x39461d[_0xc87e('0x31')][_0xc87e('0x4a')]||![];_0x114114[_0xc87e('0x4b')]=_0x39461d[_0xc87e('0x42')]['id'];return getContent(_0x39461d[_0xc87e('0x31')])[_0xc87e('0x2b')](function(_0x39c9ba){_0x114114[_0xc87e('0x31')]=_0x39c9ba;return getRecipients(_0x527c9e);})['then'](function(_0x26790d){_0x114114[_0xc87e('0x4c')]=_[_0xc87e('0x4d')](_0x26790d)[_0xc87e('0x4e')](',');return db[_0xc87e('0x4f')][_0xc87e('0x50')](function(_0x24eab4){return db[_0xc87e('0x51')]['create'](_0x114114,{'raw':!![],'transaction':_0x24eab4})['then'](function(_0x450eff){var _0x2e7a38={'sender':_0x114114[_0xc87e('0x47')],'description':_0x114114[_0xc87e('0x49')],'content':_0x114114[_0xc87e('0x31')],'beep':_0x114114[_0xc87e('0x4a')]};_0x26790d['forEach'](function(_0x45e9a5){_0x2e7a38[_0xc87e('0x52')]=_0x45e9a5;socket[_0xc87e('0x53')]('userNotification:send',_0x2e7a38);});return _0x450eff;});});})[_0xc87e('0x2b')](respondWithResult(_0x4f5af8,0xc9))[_0xc87e('0x54')](handleError(_0x4f5af8,null));};function getContent(_0x4de013){return new BPromise(function(_0x38653a,_0x55b1f2){if(_0x4de013[_0xc87e('0x33')]){_0x38653a(_0x4de013['text']);return;}return db['Template'][_0xc87e('0x55')]({'attributes':['html'],'where':{'id':_0x4de013['TemplateId']},'raw':!![]})['then'](function(_0x30c947){if(!_0x30c947)throw new db[(_0xc87e('0x35'))][(_0xc87e('0x36'))](_0xc87e('0x56'));var _0x10c0d9=Mustache['render'](_0x30c947[_0xc87e('0x57')],_0x4de013[_0xc87e('0x38')]);_0x38653a(_0x10c0d9);})[_0xc87e('0x54')](function(_0x18d41d){_0x55b1f2(_0x18d41d);});});}function getRecipients(_0x3b351a){return new BPromise(function(_0x291497,_0x1c7eb5){var _0x10fd8c=[];var _0x4263ba=[];_0x3b351a[_0xc87e('0x58')](function(_0x316850){var _0x240c4a=_[_0xc87e('0x59')](_0x316850[_0xc87e('0x45')][_0xc87e('0x46')]());if(_0x240c4a===_0xc87e('0x5a')){_0x10fd8c=_[_0xc87e('0x5b')](_0x10fd8c,_0x316850['ids']);}else{if(_[_0xc87e('0x44')](_0x240c4a,_0xc87e('0x5c')))_0x240c4a=_0x240c4a[_0xc87e('0x5d')](_0xc87e('0x5c'),_0xc87e('0x5e'));_0x316850['ids'][_0xc87e('0x58')](function(_0x2e66b6){_0x4263ba[_0xc87e('0x5f')](getAgents(_0x240c4a,_0x2e66b6));});}});return BPromise[_0xc87e('0x60')](_0x4263ba)[_0xc87e('0x2b')](function(_0x1c2152){_0x10fd8c=_['union'](_0x10fd8c,_['flatten'](_0x1c2152));_0x291497(_0x10fd8c);})[_0xc87e('0x54')](function(_0xd4e447){_0x1c7eb5(_0xd4e447);});});}function getAgents(_0x46f448,_0x1036c5){return new BPromise(function(_0x93cecd,_0x228b02){return db[_0x46f448][_0xc87e('0x55')]({'where':{'id':_0x1036c5}})[_0xc87e('0x2b')](function(_0xfa008d){return _0xfa008d[_0xc87e('0x61')]({'attributes':['id'],'raw':!![]})[_0xc87e('0x2b')](function(_0x36bd9b){var _0x2ce092=_['map'](_0x36bd9b,'id');_0x93cecd(_0x2ce092);});})[_0xc87e('0x54')](function(_0x4f6dc9){_0x228b02(_0x4f6dc9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3ef5996..4652a07 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 _0xf54a=['exports','../../mysqldb','UserNotification','emit','hasOwnProperty','hook'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0xf54a,0x11b));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xaf54('0x0'))['db'][_0xaf54('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a5044){return function(_0x41ff17,_0x596b64,_0x30af71){UserNotificationEvents[_0xaf54('0x2')](_0x1a5044+':'+_0x41ff17['id'],_0x41ff17);UserNotificationEvents[_0xaf54('0x2')](_0x1a5044,_0x41ff17);_0x30af71(null);};}for(var e in events){if(events[_0xaf54('0x3')](e)){var event=events[e];UserNotification[_0xaf54('0x4')](e,emitEvent(event));}}module[_0xaf54('0x5')]=UserNotificationEvents; \ No newline at end of file +var _0x21f7=['exports','events','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x21f7,0x121));var _0x721f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x21f7[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x721f('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x721f('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x721f('0x2')](0x0);var events={'afterCreate':_0x721f('0x3'),'afterUpdate':'update','afterDestroy':_0x721f('0x4')};function emitEvent(_0x4d4f62){return function(_0x318ca4,_0xed5d06,_0x100f90){UserNotificationEvents[_0x721f('0x5')](_0x4d4f62+':'+_0x318ca4['id'],_0x318ca4);UserNotificationEvents['emit'](_0x4d4f62,_0x318ca4);_0x100f90(null);};}for(var e in events){if(events[_0x721f('0x6')](e)){var event=events[e];UserNotification[_0x721f('0x7')](e,emitEvent(event));}}module[_0x721f('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index da950b9..25060c6 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 _0x655c=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4'];(function(_0x4d7563,_0x4c3f27){var _0x44946b=function(_0x27798a){while(--_0x27798a){_0x4d7563['push'](_0x4d7563['shift']());}};_0x44946b(++_0x4c3f27);}(_0x655c,0x6c));var _0xc655=function(_0x26f2a3,_0xdec8ff){_0x26f2a3=_0x26f2a3-0x0;var _0x3a4bd3=_0x655c[_0x26f2a3];return _0x3a4bd3;};'use strict';var _=require(_0xc655('0x0'));var util=require(_0xc655('0x1'));var logger=require(_0xc655('0x2'))(_0xc655('0x3'));var moment=require(_0xc655('0x4'));var BPromise=require(_0xc655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc655('0x6'));var config=require(_0xc655('0x7'));var attributes=require(_0xc655('0x8'));module['exports']=function(_0x2b6d8c,_0x472667){return _0x2b6d8c['define'](_0xc655('0x9'),attributes,{'tableName':_0xc655('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc655('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7ea6=['request-promise','path','rimraf','define','UserNotification','userNotifications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xc1c184,_0x29966d){var _0x124ac6=function(_0x44ca80){while(--_0x44ca80){_0xc1c184['push'](_0xc1c184['shift']());}};_0x124ac6(++_0x29966d);}(_0x7ea6,0x72));var _0x67ea=function(_0x2716c3,_0x4cc7c5){_0x2716c3=_0x2716c3-0x0;var _0x2fb080=_0x7ea6[_0x2716c3];return _0x2fb080;};'use strict';var _=require(_0x67ea('0x0'));var util=require(_0x67ea('0x1'));var logger=require(_0x67ea('0x2'))(_0x67ea('0x3'));var moment=require(_0x67ea('0x4'));var BPromise=require(_0x67ea('0x5'));var rp=require(_0x67ea('0x6'));var fs=require('fs');var path=require(_0x67ea('0x7'));var rimraf=require(_0x67ea('0x8'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module['exports']=function(_0x53aade,_0x133a30){return _0x53aade[_0x67ea('0x9')](_0x67ea('0xa'),attributes,{'tableName':_0x67ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d107a88..e3046a2 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 _0x793f=['info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./userNotification.socket','register','request','then'];(function(_0x494cbb,_0x470317){var _0x4eaba5=function(_0x11197b){while(--_0x11197b){_0x494cbb['push'](_0x494cbb['shift']());}};_0x4eaba5(++_0x470317);}(_0x793f,0x73));var _0xf793=function(_0x2a6d34,_0x4da937){_0x2a6d34=_0x2a6d34-0x0;var _0x2b500c=_0x793f[_0x2a6d34];return _0x2b500c;};'use strict';var _=require(_0xf793('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf793('0x1'));var rs=require(_0xf793('0x2'));var fs=require('fs');var Redis=require(_0xf793('0x3'));var db=require(_0xf793('0x4'))['db'];var utils=require(_0xf793('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf793('0x6'));var jayson=require(_0xf793('0x7'));var client=jayson[_0xf793('0x8')]['http']({'port':0x232a});config[_0xf793('0x9')]=_['defaults'](config[_0xf793('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf793('0xa'))(new Redis(config[_0xf793('0x9')]));require(_0xf793('0xb'))[_0xf793('0xc')](socket);function respondWithRpcPromise(_0x2ad4d6,_0x2508f3,_0x4bb5c4){return new BPromise(function(_0x2d816f,_0x45ad96){return client[_0xf793('0xd')](_0x2ad4d6,_0x4bb5c4)[_0xf793('0xe')](function(_0x497156){logger[_0xf793('0xf')]('UserNotification,\x20%s,\x20%s',_0x2508f3,'request\x20sent');logger[_0xf793('0x10')](_0xf793('0x11'),_0x2508f3,_0xf793('0x12'),JSON[_0xf793('0x13')](_0x497156));if(_0x497156[_0xf793('0x14')]){if(_0x497156['error'][_0xf793('0x15')]===0x1f4){logger[_0xf793('0x14')]('UserNotification,\x20%s,\x20%s',_0x2508f3,_0x497156[_0xf793('0x14')][_0xf793('0x16')]);return _0x45ad96(_0x497156[_0xf793('0x14')][_0xf793('0x16')]);}logger[_0xf793('0x14')]('UserNotification,\x20%s,\x20%s',_0x2508f3,_0x497156[_0xf793('0x14')][_0xf793('0x16')]);return _0x2d816f(_0x497156[_0xf793('0x14')]['message']);}else{logger[_0xf793('0xf')](_0xf793('0x17'),_0x2508f3,'request\x20sent');_0x2d816f(_0x497156[_0xf793('0x18')][_0xf793('0x16')]);}})[_0xf793('0x19')](function(_0x4bb97f){logger['error'](_0xf793('0x17'),_0x2508f3,_0x4bb97f);_0x45ad96(_0x4bb97f);});});} \ No newline at end of file +var _0x1262=['UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ebc11,_0xaeefe8){var _0x27757b=function(_0x2b4755){while(--_0x2b4755){_0x1ebc11['push'](_0x1ebc11['shift']());}};_0x27757b(++_0xaeefe8);}(_0x1262,0xa1));var _0x2126=function(_0x640033,_0x298768){_0x640033=_0x640033-0x0;var _0x1c39bc=_0x1262[_0x640033];return _0x1c39bc;};'use strict';var _=require(_0x2126('0x0'));var util=require(_0x2126('0x1'));var moment=require('moment');var BPromise=require(_0x2126('0x2'));var rs=require(_0x2126('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2126('0x4'))['db'];var utils=require(_0x2126('0x5'));var logger=require(_0x2126('0x6'))(_0x2126('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2126('0x8')]['http']({'port':0x232a});config['redis']=_[_0x2126('0x9')](config[_0x2126('0xa')],{'host':_0x2126('0xb'),'port':0x18eb});var socket=require(_0x2126('0xc'))(new Redis(config[_0x2126('0xa')]));require(_0x2126('0xd'))[_0x2126('0xe')](socket);function respondWithRpcPromise(_0x4303ea,_0x1fbf9d,_0x992824){return new BPromise(function(_0x504d65,_0x304185){return client[_0x2126('0xf')](_0x4303ea,_0x992824)['then'](function(_0x3c7495){logger['info']('UserNotification,\x20%s,\x20%s',_0x1fbf9d,_0x2126('0x10'));logger['debug'](_0x2126('0x11'),_0x1fbf9d,_0x2126('0x10'),JSON[_0x2126('0x12')](_0x3c7495));if(_0x3c7495[_0x2126('0x13')]){if(_0x3c7495['error'][_0x2126('0x14')]===0x1f4){logger[_0x2126('0x13')](_0x2126('0x15'),_0x1fbf9d,_0x3c7495['error'][_0x2126('0x16')]);return _0x304185(_0x3c7495[_0x2126('0x13')][_0x2126('0x16')]);}logger[_0x2126('0x13')]('UserNotification,\x20%s,\x20%s',_0x1fbf9d,_0x3c7495['error']['message']);return _0x504d65(_0x3c7495[_0x2126('0x13')][_0x2126('0x16')]);}else{logger[_0x2126('0x17')]('UserNotification,\x20%s,\x20%s',_0x1fbf9d,_0x2126('0x10'));_0x504d65(_0x3c7495[_0x2126('0x18')][_0x2126('0x16')]);}})[_0x2126('0x19')](function(_0x3e8674){logger[_0x2126('0x13')](_0x2126('0x15'),_0x1fbf9d,_0x3e8674);_0x304185(_0x3e8674);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index dbcfc5a..f8c402e 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 _0x006e=['emit','userNotification:','remove'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x006e,0x86));var _0xe006=function(_0x183a19,_0x36dace){_0x183a19=_0x183a19-0x0;var _0x5e2ba3=_0x006e[_0x183a19];return _0x5e2ba3;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0xe006('0x0'),'update'];function createListener(_0x53e696,_0x5ce643){return function(_0x5e4acc){_0x5ce643[_0xe006('0x1')](_0x53e696,_0x5e4acc);};}function removeListener(_0x590c21,_0x475f82){return function(){UserNotificationEvents['removeListener'](_0x590c21,_0x475f82);};}exports['register']=function(_0x3a61d5){for(var _0x3bd97d=0x0,_0x4b218e=events['length'];_0x3bd97d<_0x4b218e;_0x3bd97d++){var _0x5f3f83=events[_0x3bd97d];var _0x8f7838=createListener(_0xe006('0x2')+_0x5f3f83,_0x3a61d5);UserNotificationEvents['on'](_0x5f3f83,_0x8f7838);}}; \ No newline at end of file +var _0x92a6=['save','remove','update','emit','register','length','./userNotification.events'];(function(_0x84db0e,_0x3e0083){var _0x19f095=function(_0x1c959c){while(--_0x1c959c){_0x84db0e['push'](_0x84db0e['shift']());}};_0x19f095(++_0x3e0083);}(_0x92a6,0x117));var _0x692a=function(_0x4c2711,_0x28ba27){_0x4c2711=_0x4c2711-0x0;var _0x405be4=_0x92a6[_0x4c2711];return _0x405be4;};'use strict';var UserNotificationEvents=require(_0x692a('0x0'));var events=[_0x692a('0x1'),_0x692a('0x2'),_0x692a('0x3')];function createListener(_0x4aec12,_0x2ef64f){return function(_0x3efd12){_0x2ef64f[_0x692a('0x4')](_0x4aec12,_0x3efd12);};}function removeListener(_0x25e489,_0x39c3a0){return function(){UserNotificationEvents['removeListener'](_0x25e489,_0x39c3a0);};}exports[_0x692a('0x5')]=function(_0x3a1db4){for(var _0x17df29=0x0,_0x433ca1=events[_0x692a('0x6')];_0x17df29<_0x433ca1;_0x17df29++){var _0x25ddb8=events[_0x17df29];var _0x39e8fc=createListener('userNotification:'+_0x25ddb8,_0x3a1db4);UserNotificationEvents['on'](_0x25ddb8,_0x39e8fc);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8e749d1..c272595 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x237eef,_0x5a7753){var _0x370c86=function(_0x3d6c2d){while(--_0x3d6c2d){_0x237eef['push'](_0x237eef['shift']());}};_0x370c86(++_0x5a7753);}(_0x70e0,0x17b));var _0x070e=function(_0x40a845,_0x5024da){_0x40a845=_0x40a845-0x0;var _0x53a3ac=_0x70e0[_0x40a845];return _0x53a3ac;};'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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x8b3288,_0x18f349){var _0x465281=function(_0x5ba1d4){while(--_0x5ba1d4){_0x8b3288['push'](_0x8b3288['shift']());}};_0x465281(++_0x18f349);}(_0x70e0,0x17b));var _0x070e=function(_0x3bf0e5,_0x22488b){_0x3bf0e5=_0x3bf0e5-0x0;var _0x379975=_0x70e0[_0x3bf0e5];return _0x379975;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0b7f46e..3b86765 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 _0x7a01=['sequelize','exports'];(function(_0x1a7f32,_0x2957df){var _0x34a005=function(_0x51f195){while(--_0x51f195){_0x1a7f32['push'](_0x1a7f32['shift']());}};_0x34a005(++_0x2957df);}(_0x7a01,0x1f0));var _0x17a0=function(_0x2a7cbd,_0x199b18){_0x2a7cbd=_0x2a7cbd-0x0;var _0x3c9e0c=_0x7a01[_0x2a7cbd];return _0x3c9e0c;};'use strict';var Sequelize=require(_0x17a0('0x0'));module[_0x17a0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x45fd=['exports','INTEGER'];(function(_0x5555eb,_0xd55f90){var _0x2ea319=function(_0x48af2e){while(--_0x48af2e){_0x5555eb['push'](_0x5555eb['shift']());}};_0x2ea319(++_0xd55f90);}(_0x45fd,0xa4));var _0xd45f=function(_0x159225,_0x167ace){_0x159225=_0x159225-0x0;var _0x117fcf=_0x45fd[_0x159225];return _0x117fcf;};'use strict';var Sequelize=require('sequelize');module[_0xd45f('0x0')]={'penalty':{'type':Sequelize[_0xd45f('0x1')],'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 790e780..c8fe199 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 _0xa732=['exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x5b569f,_0x5c321b){var _0x318308=function(_0x945c40){while(--_0x945c40){_0x5b569f['push'](_0x5b569f['shift']());}};_0x318308(++_0x5c321b);}(_0xa732,0x18b));var _0x2a73=function(_0x33923f,_0x9e2f92){_0x33923f=_0x33923f-0x0;var _0x29c91a=_0xa732[_0x33923f];return _0x29c91a;};'use strict';var _=require(_0x2a73('0x0'));var util=require(_0x2a73('0x1'));var logger=require(_0x2a73('0x2'))(_0x2a73('0x3'));var moment=require(_0x2a73('0x4'));var BPromise=require(_0x2a73('0x5'));var rp=require(_0x2a73('0x6'));var fs=require('fs');var path=require(_0x2a73('0x7'));var rimraf=require(_0x2a73('0x8'));var config=require(_0x2a73('0x9'));var attributes=require(_0x2a73('0xa'));module[_0x2a73('0xb')]=function(_0x676675,_0x1fc87d){return _0x676675[_0x2a73('0xc')](_0x2a73('0xd'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a9e=['path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api','request-promise'];(function(_0x36b261,_0x504c02){var _0x2cf069=function(_0x2d61cc){while(--_0x2d61cc){_0x36b261['push'](_0x36b261['shift']());}};_0x2cf069(++_0x504c02);}(_0x5a9e,0x15a));var _0xe5a9=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x5a9e[_0x469ac7];return _0x22f3b0;};'use strict';var _=require(_0xe5a9('0x0'));var util=require('util');var logger=require(_0xe5a9('0x1'))(_0xe5a9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe5a9('0x3'));var fs=require('fs');var path=require(_0xe5a9('0x4'));var rimraf=require('rimraf');var config=require(_0xe5a9('0x5'));var attributes=require(_0xe5a9('0x6'));module[_0xe5a9('0x7')]=function(_0x1ca71c,_0x41925c){return _0x1ca71c[_0xe5a9('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0xe5a9('0x9'),'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 ed21fef..c82f286 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 _0x1d81=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x1d81,0x14f));var _0x11d8=function(_0x27d675,_0x4f1135){_0x27d675=_0x27d675-0x0;var _0x35b1d5=_0x1d81[_0x27d675];return _0x35b1d5;};'use strict';var _=require(_0x11d8('0x0'));var util=require(_0x11d8('0x1'));var moment=require(_0x11d8('0x2'));var BPromise=require(_0x11d8('0x3'));var rs=require(_0x11d8('0x4'));var fs=require('fs');var Redis=require(_0x11d8('0x5'));var db=require(_0x11d8('0x6'))['db'];var utils=require(_0x11d8('0x7'));var logger=require(_0x11d8('0x8'))('rpc');var config=require(_0x11d8('0x9'));var jayson=require(_0x11d8('0xa'));var client=jayson[_0x11d8('0xb')][_0x11d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbed23a,_0x23f08f,_0x1759fd){return new BPromise(function(_0x4f9dd2,_0x4b0715){return client[_0x11d8('0xd')](_0xbed23a,_0x1759fd)[_0x11d8('0xe')](function(_0x588899){logger[_0x11d8('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x11d8('0x10'));logger[_0x11d8('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x23f08f,_0x11d8('0x10'),JSON[_0x11d8('0x12')](_0x588899));if(_0x588899[_0x11d8('0x13')]){if(_0x588899[_0x11d8('0x13')][_0x11d8('0x14')]===0x1f4){logger['error'](_0x11d8('0x15'),_0x23f08f,_0x588899[_0x11d8('0x13')][_0x11d8('0x16')]);return _0x4b0715(_0x588899[_0x11d8('0x13')][_0x11d8('0x16')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x588899['error'][_0x11d8('0x16')]);return _0x4f9dd2(_0x588899['error']['message']);}else{logger[_0x11d8('0xf')](_0x11d8('0x15'),_0x23f08f,'request\x20sent');_0x4f9dd2(_0x588899['result']['message']);}})[_0x11d8('0x17')](function(_0x68964){logger[_0x11d8('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x68964);_0x4b0715(_0x68964);});});} \ No newline at end of file +var _0x6d63=['error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c6e54,_0x413139){var _0x4cc87c=function(_0x12365b){while(--_0x12365b){_0x1c6e54['push'](_0x1c6e54['shift']());}};_0x4cc87c(++_0x413139);}(_0x6d63,0x1a7));var _0x36d6=function(_0x31b24e,_0x18041c){_0x31b24e=_0x31b24e-0x0;var _0xd7f411=_0x6d63[_0x31b24e];return _0xd7f411;};'use strict';var _=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var moment=require(_0x36d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x36d6('0x3'));var fs=require('fs');var Redis=require(_0x36d6('0x4'));var db=require(_0x36d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x36d6('0x6'))(_0x36d6('0x7'));var config=require(_0x36d6('0x8'));var jayson=require(_0x36d6('0x9'));var client=jayson[_0x36d6('0xa')][_0x36d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xed71bc,_0x2128b1,_0xa92624){return new BPromise(function(_0x588be6,_0x12de7f){return client['request'](_0xed71bc,_0xa92624)['then'](function(_0x978637){logger[_0x36d6('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2128b1,_0x36d6('0xd'));logger[_0x36d6('0xe')](_0x36d6('0xf'),_0x2128b1,_0x36d6('0xd'),JSON[_0x36d6('0x10')](_0x978637));if(_0x978637[_0x36d6('0x11')]){if(_0x978637[_0x36d6('0x11')][_0x36d6('0x12')]===0x1f4){logger[_0x36d6('0x11')](_0x36d6('0x13'),_0x2128b1,_0x978637[_0x36d6('0x11')][_0x36d6('0x14')]);return _0x12de7f(_0x978637[_0x36d6('0x11')][_0x36d6('0x14')]);}logger[_0x36d6('0x11')](_0x36d6('0x13'),_0x2128b1,_0x978637[_0x36d6('0x11')][_0x36d6('0x14')]);return _0x588be6(_0x978637[_0x36d6('0x11')][_0x36d6('0x14')]);}else{logger['info'](_0x36d6('0x13'),_0x2128b1,_0x36d6('0xd'));_0x588be6(_0x978637['result'][_0x36d6('0x14')]);}})[_0x36d6('0x15')](function(_0x2d3163){logger[_0x36d6('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2128b1,_0x2d3163);_0x12de7f(_0x2d3163);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 71e90cc..4766e09 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 _0xc692=['addSections','update','destroy','delete','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','/:id','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone'];(function(_0x270919,_0xbedd){var _0x497195=function(_0xef5b95){while(--_0xef5b95){_0x270919['push'](_0x270919['shift']());}};_0x497195(++_0xbedd);}(_0xc692,0x11e));var _0x2c69=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc692[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var path=require(_0x2c69('0x2'));var timeout=require(_0x2c69('0x3'));var express=require(_0x2c69('0x4'));var router=express[_0x2c69('0x5')]();var fs_extra=require(_0x2c69('0x6'));var auth=require(_0x2c69('0x7'));var interaction=require(_0x2c69('0x8'));var config=require(_0x2c69('0x9'));var controller=require(_0x2c69('0xa'));router[_0x2c69('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c69('0xc')]);router['get'](_0x2c69('0xd'),auth[_0x2c69('0xe')](),controller['describe']);router[_0x2c69('0xb')](_0x2c69('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2c69('0xb')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x11')]);router[_0x2c69('0xb')](_0x2c69('0x12'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2c69('0x14')](_0x2c69('0x15'),auth[_0x2c69('0xe')](),controller['clone']);router[_0x2c69('0x14')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x16')]);router[_0x2c69('0x14')](_0x2c69('0x12'),auth[_0x2c69('0xe')](),controller['addResources']);router['put'](_0x2c69('0xf'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x17')]);router['delete'](_0x2c69('0xf'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x18')]);router[_0x2c69('0x19')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x1a')]);router[_0x2c69('0x19')](_0x2c69('0x12'),auth['isAuthenticated'](),controller['removeResources']);module[_0x2c69('0x1b')]=router; \ No newline at end of file +var _0x28dc=['/:id/resources','post','create','/:id/clone','clone','addSections','put','/:id','update','delete','destroy','removeSections','removeResources','exports','util','path','../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','/describe','describe','get','show','/:id/sections','getSections'];(function(_0x9b95ab,_0x2e2f67){var _0x589def=function(_0x180d23){while(--_0x180d23){_0x9b95ab['push'](_0x9b95ab['shift']());}};_0x589def(++_0x2e2f67);}(_0x28dc,0xe6));var _0xc28d=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x28dc[_0x3fe042];return _0x7d4a1f;};'use strict';var multer=require('multer');var util=require(_0xc28d('0x0'));var path=require(_0xc28d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc28d('0x2'));var interaction=require(_0xc28d('0x3'));var config=require('../../config/environment');var controller=require(_0xc28d('0x4'));router['get']('/',auth[_0xc28d('0x5')](),controller[_0xc28d('0x6')]);router['get'](_0xc28d('0x7'),auth[_0xc28d('0x5')](),controller[_0xc28d('0x8')]);router[_0xc28d('0x9')]('/:id',auth[_0xc28d('0x5')](),controller[_0xc28d('0xa')]);router[_0xc28d('0x9')](_0xc28d('0xb'),auth['isAuthenticated'](),controller[_0xc28d('0xc')]);router[_0xc28d('0x9')](_0xc28d('0xd'),auth[_0xc28d('0x5')](),controller['getResources']);router[_0xc28d('0xe')]('/',auth[_0xc28d('0x5')](),controller[_0xc28d('0xf')]);router[_0xc28d('0xe')](_0xc28d('0x10'),auth[_0xc28d('0x5')](),controller[_0xc28d('0x11')]);router['post'](_0xc28d('0xb'),auth[_0xc28d('0x5')](),controller[_0xc28d('0x12')]);router['post'](_0xc28d('0xd'),auth[_0xc28d('0x5')](),controller['addResources']);router[_0xc28d('0x13')](_0xc28d('0x14'),auth['isAuthenticated'](),controller[_0xc28d('0x15')]);router[_0xc28d('0x16')](_0xc28d('0x14'),auth['isAuthenticated'](),controller[_0xc28d('0x17')]);router['delete'](_0xc28d('0xb'),auth['isAuthenticated'](),controller[_0xc28d('0x18')]);router[_0xc28d('0x16')]('/:id/resources',auth[_0xc28d('0x5')](),controller[_0xc28d('0x19')]);module[_0xc28d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f7f67f8..05f4157 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 _0x2ff2=['BOOLEAN','sequelize','exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ff2,0x137));var _0x22ff=function(_0x1966ad,_0x43f2f3){_0x1966ad=_0x1966ad-0x0;var _0x5d7637=_0x2ff2[_0x1966ad];return _0x5d7637;};'use strict';var Sequelize=require(_0x22ff('0x0'));module[_0x22ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22ff('0x2')},'crudPermissions':{'type':Sequelize[_0x22ff('0x3')],'set':function(_0x41526d){this[_0x22ff('0x4')](_0x22ff('0x5'),_0x41526d?_0x41526d[_0x22ff('0x6')](''):[]);},'get':function(){return this[_0x22ff('0x7')](_0x22ff('0x5'))?this[_0x22ff('0x7')](_0x22ff('0x5'))[_0x22ff('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x22ff('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x84e0=['join','getDataValue','BOOLEAN','sequelize','exports','name','STRING','crudPermissions'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x84e0,0x1f3));var _0x084e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x084e('0x0'));module[_0x084e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x084e('0x2')},'crudPermissions':{'type':Sequelize[_0x084e('0x3')],'set':function(_0x393c25){this['setDataValue'](_0x084e('0x4'),_0x393c25?_0x393c25[_0x084e('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x084e('0x4'))?this[_0x084e('0x6')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x084e('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x084e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x084e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b7539f0..711d75c 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 _0x2a7b=['autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','params','describe','addSections','sequelize','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','getResources','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','destroy','then','error','stack','name','send','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','merge','options','UserProfile','includeAll','include','findAll','rows','catch','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x2a7b,0x8d));var _0xb2a7=function(_0x5e4b4b,_0x225205){_0x5e4b4b=_0x5e4b4b-0x0;var _0x12be3c=_0x2a7b[_0x5e4b4b];return _0x12be3c;};'use strict';var emlformat=require(_0xb2a7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb2a7('0x1'));var rp=require(_0xb2a7('0x2'));var moment=require(_0xb2a7('0x3'));var BPromise=require(_0xb2a7('0x4'));var Mustache=require('mustache');var util=require(_0xb2a7('0x5'));var path=require(_0xb2a7('0x6'));var sox=require(_0xb2a7('0x7'));var csv=require(_0xb2a7('0x8'));var ejs=require(_0xb2a7('0x9'));var fs=require('fs');var fs_extra=require(_0xb2a7('0xa'));var _=require(_0xb2a7('0xb'));var squel=require(_0xb2a7('0xc'));var crypto=require(_0xb2a7('0xd'));var jsforce=require(_0xb2a7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb2a7('0x8'));var querystring=require(_0xb2a7('0xf'));var Papa=require(_0xb2a7('0x10'));var Redis=require(_0xb2a7('0x11'));var authService=require(_0xb2a7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2a7('0x13'));var hardwareService=require(_0xb2a7('0x14'));var logger=require(_0xb2a7('0x15'))(_0xb2a7('0x16'));var utils=require(_0xb2a7('0x17'));var config=require(_0xb2a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb2a7('0x19'))['db'];config[_0xb2a7('0x1a')]=_[_0xb2a7('0x1b')](config['redis'],{'host':_0xb2a7('0x1c'),'port':0x18eb});var socket=require(_0xb2a7('0x1d'))(new Redis(config[_0xb2a7('0x1a')]));require('./userProfile.socket')[_0xb2a7('0x1e')](socket);function respondWithStatusCode(_0x19d792,_0x718500){_0x718500=_0x718500||0xcc;return function(_0x21f95b){if(_0x21f95b){return _0x19d792[_0xb2a7('0x1f')](_0x718500);}return _0x19d792['status'](_0x718500)[_0xb2a7('0x20')]();};}function respondWithResult(_0x1158d0,_0x4d2e16){_0x4d2e16=_0x4d2e16||0xc8;return function(_0x384b70){if(_0x384b70){return _0x1158d0['status'](_0x4d2e16)[_0xb2a7('0x21')](_0x384b70);}};}function respondWithFilteredResult(_0xe0d3af,_0x2c569f){return function(_0x46a2e5){if(_0x46a2e5){var _0x52a95b=typeof _0x2c569f[_0xb2a7('0x22')]===_0xb2a7('0x23')&&typeof _0x2c569f[_0xb2a7('0x24')]==='undefined';var _0x40502f=_0x46a2e5['count'];var _0x582670=_0x52a95b?0x0:_0x2c569f['offset'];var _0x367d4a=_0x52a95b?_0x46a2e5[_0xb2a7('0x25')]:_0x2c569f['offset']+_0x2c569f['limit'];var _0x518016;if(_0x367d4a>=_0x40502f){_0x367d4a=_0x40502f;_0x518016=0xc8;}else{_0x518016=0xce;}_0xe0d3af[_0xb2a7('0x26')](_0x518016);return _0xe0d3af[_0xb2a7('0x27')]('Content-Range',_0x582670+'-'+_0x367d4a+'/'+_0x40502f)['json'](_0x46a2e5);}return null;};}function patchUpdates(_0x441c3c){return function(_0x4106cf){try{jsonpatch[_0xb2a7('0x28')](_0x4106cf,_0x441c3c,!![]);}catch(_0x15e207){return BPromise['reject'](_0x15e207);}return _0x4106cf[_0xb2a7('0x29')]();};}function saveUpdates(_0x30ea78,_0x4221f0){return function(_0x33d4eb){if(_0x33d4eb){return _0x33d4eb[_0xb2a7('0x2a')](_0x30ea78)['then'](function(_0x4336d){return _0x4336d;});}return null;};}function removeEntity(_0x3cd0bc,_0x3e2c92){return function(_0x288309){if(_0x288309){return _0x288309[_0xb2a7('0x2b')]()[_0xb2a7('0x2c')](function(){_0x3cd0bc[_0xb2a7('0x26')](0xcc)[_0xb2a7('0x20')]();});}};}function handleEntityNotFound(_0x49af91,_0x303014){return function(_0x54a33d){if(!_0x54a33d){_0x49af91[_0xb2a7('0x1f')](0x194);}return _0x54a33d;};}function handleError(_0x2feb25,_0x236e2a){_0x236e2a=_0x236e2a||0x1f4;return function(_0x51283c){logger[_0xb2a7('0x2d')](_0x51283c[_0xb2a7('0x2e')]);if(_0x51283c['name']){delete _0x51283c[_0xb2a7('0x2f')];}_0x2feb25[_0xb2a7('0x26')](_0x236e2a)[_0xb2a7('0x30')](_0x51283c);};}exports['index']=function(_0x437c48,_0x309283){var _0x24b1a9={},_0x12d150={},_0x5813e0={'count':0x0,'rows':[]};var _0x35a98c=_['map'](db['UserProfile'][_0xb2a7('0x31')],function(_0x2f3b3f){return{'name':_0x2f3b3f['fieldName'],'type':_0x2f3b3f['type'][_0xb2a7('0x32')]};});_0x12d150[_0xb2a7('0x33')]=_[_0xb2a7('0x34')](_0x35a98c,'name');_0x12d150[_0xb2a7('0x35')]=_[_0xb2a7('0x36')](_0x437c48[_0xb2a7('0x35')]);_0x12d150[_0xb2a7('0x37')]=_[_0xb2a7('0x38')](_0x12d150[_0xb2a7('0x33')],_0x12d150[_0xb2a7('0x35')]);_0x24b1a9['attributes']=_[_0xb2a7('0x38')](_0x12d150[_0xb2a7('0x33')],qs['fields'](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x39')]));_0x24b1a9['attributes']=_0x24b1a9[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x24b1a9[_0xb2a7('0x3a')]:_0x12d150[_0xb2a7('0x33')];if(!_0x437c48[_0xb2a7('0x35')]['hasOwnProperty'](_0xb2a7('0x3c'))){_0x24b1a9['limit']=qs[_0xb2a7('0x24')](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x24')]);_0x24b1a9[_0xb2a7('0x22')]=qs[_0xb2a7('0x22')](_0x437c48['query']['offset']);}_0x24b1a9[_0xb2a7('0x3d')]=qs[_0xb2a7('0x3e')](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x3e')]);_0x24b1a9[_0xb2a7('0x3f')]=qs[_0xb2a7('0x37')](_[_0xb2a7('0x40')](_0x437c48[_0xb2a7('0x35')],_0x12d150[_0xb2a7('0x37')]),_0x35a98c);if(_0x437c48['query'][_0xb2a7('0x41')]){_0x24b1a9[_0xb2a7('0x3f')]=_['merge'](_0x24b1a9[_0xb2a7('0x3f')],{'$or':_[_0xb2a7('0x34')](_0x35a98c,function(_0x5a84d4){if(_0x5a84d4[_0xb2a7('0x42')]!=='VIRTUAL'){var _0x108edf={};_0x108edf[_0x5a84d4[_0xb2a7('0x2f')]]={'$like':'%'+_0x437c48['query'][_0xb2a7('0x41')]+'%'};return _0x108edf;}})});}_0x24b1a9=_[_0xb2a7('0x43')]({},_0x24b1a9,_0x437c48[_0xb2a7('0x44')]);var _0x2cf6a1={'where':_0x24b1a9[_0xb2a7('0x3f')]};return db[_0xb2a7('0x45')][_0xb2a7('0x25')](_0x2cf6a1)[_0xb2a7('0x2c')](function(_0xcfc72e){_0x5813e0['count']=_0xcfc72e;if(_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x46')]){_0x24b1a9[_0xb2a7('0x47')]=[{'all':!![]}];}return db[_0xb2a7('0x45')][_0xb2a7('0x48')](_0x24b1a9);})['then'](function(_0x46368f){_0x5813e0[_0xb2a7('0x49')]=_0x46368f;return _0x5813e0;})['then'](respondWithFilteredResult(_0x309283,_0x24b1a9))[_0xb2a7('0x4a')](handleError(_0x309283,null));};exports['show']=function(_0x4debee,_0x426aa7){var _0x3966e={'raw':![],'where':{'id':_0x4debee['params']['id']}},_0x1123c0={};_0x1123c0[_0xb2a7('0x33')]=_[_0xb2a7('0x36')](db['UserProfile'][_0xb2a7('0x31')]);_0x1123c0['query']=_['keys'](_0x4debee['query']);_0x1123c0[_0xb2a7('0x37')]=_[_0xb2a7('0x38')](_0x1123c0[_0xb2a7('0x33')],_0x1123c0[_0xb2a7('0x35')]);_0x3966e[_0xb2a7('0x3a')]=_[_0xb2a7('0x38')](_0x1123c0[_0xb2a7('0x33')],qs[_0xb2a7('0x39')](_0x4debee[_0xb2a7('0x35')][_0xb2a7('0x39')]));_0x3966e['attributes']=_0x3966e[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x3966e['attributes']:_0x1123c0[_0xb2a7('0x33')];if(_0x4debee[_0xb2a7('0x35')][_0xb2a7('0x46')]){_0x3966e['include']=[{'all':!![]}];}_0x3966e=_[_0xb2a7('0x43')]({},_0x3966e,_0x4debee['options']);return db[_0xb2a7('0x45')][_0xb2a7('0x4b')](_0x3966e)['then'](handleEntityNotFound(_0x426aa7,null))[_0xb2a7('0x2c')](respondWithResult(_0x426aa7,null))[_0xb2a7('0x4a')](handleError(_0x426aa7,null));};exports[_0xb2a7('0x4c')]=function(_0x1056a4,_0x2feed1){return db['UserProfile'][_0xb2a7('0x4c')](_0x1056a4[_0xb2a7('0x4d')],{})[_0xb2a7('0x2c')](respondWithResult(_0x2feed1,0xc9))[_0xb2a7('0x4a')](handleError(_0x2feed1,null));};exports['clone']=function(_0x28e36f,_0x18c4bf){var _0x5b5545={'where':{'id':_0x28e36f['params']['id']}},_0x118cb8={};_0x118cb8[_0xb2a7('0x33')]=_[_0xb2a7('0x36')](db['UserProfile'][_0xb2a7('0x31')]);_0x5b5545['attributes']=_[_0xb2a7('0x38')](_0x118cb8[_0xb2a7('0x33')],qs['fields'](_0x28e36f[_0xb2a7('0x35')]['fields']));_0x5b5545[_0xb2a7('0x3a')]=_0x5b5545[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x5b5545[_0xb2a7('0x3a')]:_0x118cb8['model'];if(_0x28e36f['query'][_0xb2a7('0x46')]){_0x5b5545[_0xb2a7('0x47')]=[{'all':!![]}];}_0x5b5545=_['merge']({},_0x5b5545,_0x28e36f['options']);return db[_0xb2a7('0x45')][_0xb2a7('0x4b')](_0x5b5545)[_0xb2a7('0x2c')](handleEntityNotFound(_0x18c4bf,null))[_0xb2a7('0x2c')](function(_0x469b82){if(_0x469b82){var _0x178837=_0x469b82[_0xb2a7('0x4e')]({'plain':!![]});_0x178837=qs[_0xb2a7('0x4f')](_0x178837,['id',_0xb2a7('0x50'),_0xb2a7('0x51'),_0xb2a7('0x52')]);_0x28e36f[_0xb2a7('0x4d')]=_[_0xb2a7('0x4f')](_0x28e36f[_0xb2a7('0x4d')],['id',_0xb2a7('0x50'),'updatedAt']);return db['sequelize'][_0xb2a7('0x53')](function(_0x2f99e){return db[_0xb2a7('0x45')][_0xb2a7('0x4c')](_[_0xb2a7('0x43')](_0x178837,_0x28e36f[_0xb2a7('0x4d')]),{'include':_0x28e36f[_0xb2a7('0x35')][_0xb2a7('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x2f99e})['then'](function(_0x25a609){var _0x347367=_0x25a609[_0xb2a7('0x4e')]({'plain':!![]});return db[_0xb2a7('0x54')]['findAll']({'where':{'userProfileId':_0x28e36f['params']['id']},'raw':!![]})['then'](function(_0x402107){if(_0x402107){return BPromise['each'](_0x402107,function(_0x17f58b){return new BPromise(function(_0x9cc496,_0x33066d){if(_0x17f58b[_0xb2a7('0x55')]===null||_0x17f58b[_0xb2a7('0x55')]===0x1)_0x9cc496(null);return db[_0xb2a7('0x56')][_0xb2a7('0x48')]({'where':{'sectionId':_0x17f58b['id']},'raw':!![]})['then'](function(_0x535645){var _0x3e1da5=_['map'](_0x535645,function(_0x1f656c){return qs[_0xb2a7('0x4f')](_0x1f656c,['id',_0xb2a7('0x50'),'updatedAt',_0xb2a7('0x57')]);});_0x9cc496(_0x3e1da5);})[_0xb2a7('0x4a')](function(_0x247077){_0x33066d(_0x247077);});})[_0xb2a7('0x2c')](function(_0x8a4731){var _0x6ad79a=qs[_0xb2a7('0x4f')](_0x17f58b,['id',_0xb2a7('0x50'),_0xb2a7('0x51')]);_0x6ad79a[_0xb2a7('0x58')]=_0x347367['id'];if(_0x8a4731)_0x6ad79a[_0xb2a7('0x59')]=_0x8a4731;return _0x6ad79a;})[_0xb2a7('0x2c')](function(_0x371d87){return db['UserProfileSection'][_0xb2a7('0x4c')](_0x371d87,{'include':[{'model':db[_0xb2a7('0x56')],'as':_0xb2a7('0x59')}],'raw':!![],'transaction':_0x2f99e});});})[_0xb2a7('0x2c')](function(){return _0x347367;});}});});});}})['then'](respondWithResult(_0x18c4bf,0xc9))[_0xb2a7('0x4a')](handleError(_0x18c4bf,null));};exports[_0xb2a7('0x2a')]=function(_0x40fcc1,_0x3359c0){if(_0x40fcc1['body']['id']){delete _0x40fcc1[_0xb2a7('0x4d')]['id'];}return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x40fcc1[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x3359c0,null))['then'](saveUpdates(_0x40fcc1[_0xb2a7('0x4d')],null))[_0xb2a7('0x2c')](respondWithResult(_0x3359c0,null))[_0xb2a7('0x4a')](handleError(_0x3359c0,null));};exports['destroy']=function(_0x56362d,_0x24b459){return db['UserProfile']['find']({'where':{'id':_0x56362d[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x24b459,null))[_0xb2a7('0x2c')](removeEntity(_0x24b459,null))[_0xb2a7('0x4a')](handleError(_0x24b459,null));};exports['describe']=function(_0x4d7bac,_0x1594b8){return db[_0xb2a7('0x45')][_0xb2a7('0x5b')]()['then'](respondWithResult(_0x1594b8,null))[_0xb2a7('0x4a')](handleError(_0x1594b8,null));};exports[_0xb2a7('0x5c')]=function(_0x18ec8f,_0x18911a){var _0x8ff074=_0x18ec8f[_0xb2a7('0x4d')];return db['UserProfile'][_0xb2a7('0x4b')]({'where':{'id':_0x18ec8f[_0xb2a7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x18911a,null))[_0xb2a7('0x2c')](function(_0x247395){if(_0x247395){return db[_0xb2a7('0x5d')]['transaction'](function(_0x1191ab){return db[_0xb2a7('0x54')][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x18ec8f[_0xb2a7('0x5a')]['id'],'sectionId':_[_0xb2a7('0x34')](_0x8ff074,function(_0x341d28){return _0x341d28[_0xb2a7('0x57')];})},'transaction':_0x1191ab})[_0xb2a7('0x2c')](function(){var _0x3b0735=_[_0xb2a7('0x34')](_0x8ff074,function(_0x3c2629){_0x3c2629['userProfileId']=_0x18ec8f[_0xb2a7('0x5a')]['id'];return _0x3c2629;});var _0xa88c53=[];return BPromise['each'](_0x3b0735,function(_0x579c8b){return db[_0xb2a7('0x54')][_0xb2a7('0x4c')](_0x579c8b,{'include':[{'model':db[_0xb2a7('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x1191ab})[_0xb2a7('0x2c')](function(_0x4afaa8){_0xa88c53[_0xb2a7('0x5e')](_0x4afaa8['get']({'plain':!![]}));});})[_0xb2a7('0x2c')](function(){return _0xa88c53;});});});}})['then'](function(_0x24cc75){return _0x24cc75;})[_0xb2a7('0x2c')](respondWithResult(_0x18911a,null))[_0xb2a7('0x4a')](handleError(_0x18911a,null));};exports[_0xb2a7('0x5f')]=function(_0x49e6d8,_0x42c246){var _0x22fb51;return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x49e6d8[_0xb2a7('0x5a')]['id']},'attributes':['id','name']})[_0xb2a7('0x2c')](handleEntityNotFound(_0x42c246,null))[_0xb2a7('0x2c')](function(_0x1e597b){if(_0x1e597b){_0x22fb51=_0x1e597b;return db[_0xb2a7('0x54')][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x49e6d8[_0xb2a7('0x5a')]['id'],'sectionId':_0x49e6d8['query'][_0xb2a7('0x60')]}});}})[_0xb2a7('0x2c')](function(){return _0x22fb51;})[_0xb2a7('0x2c')](respondWithStatusCode(_0x42c246,null))[_0xb2a7('0x4a')](handleError(_0x42c246,null));};exports['getSections']=function(_0x1f0ee4,_0xe74ef4){var _0x401720=[];var _0x2ce574=[];return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x1f0ee4['params']['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x349e7a){_0x401720=_[_0xb2a7('0x41')](_0x349e7a,function(_0x5857de){return _0x5857de[_0xb2a7('0x61')]===0x1||_[_0xb2a7('0x62')]([0x3eb,0x709],_0x5857de[_0xb2a7('0x57')]);});if(!_[_0xb2a7('0x63')](_0x401720)){return _[_0xb2a7('0x34')](_0x401720,function(_0x92145c){return _0x92145c[_0xb2a7('0x57')];});}else{return;}})['then'](function(_0x415299){if(_0x415299)_0x2ce574=_0x415299;if(_['includes'](_0x2ce574,0x64)){var _0x5642bb=_['find'](_0x401720,{'sectionId':0x64});return hasDefaultDashboard(_0x5642bb)[_0xb2a7('0x2c')](function(_0x3c4ed){return _[_0xb2a7('0x34')](_0x401720,function(_0x39b829){if(_0x39b829[_0xb2a7('0x57')]===0x64){_0x39b829['subsections']=_0x3c4ed;}return _0x39b829;});});}else{return;}})[_0xb2a7('0x2c')](function(_0x56ca04){if(_0x56ca04)_0x401720=_0x56ca04;if(_[_0xb2a7('0x62')](_0x2ce574,0x3eb)){var _0x1500c3=_['find'](_0x401720,{'sectionId':0x3eb});return getCustomDashboards(_0x1500c3)[_0xb2a7('0x2c')](function(_0x2b9c20){return _[_0xb2a7('0x34')](_0x401720,function(_0x48eff6){if(_0x1500c3[_0xb2a7('0x61')]){if(_0x48eff6[_0xb2a7('0x57')]===0x3eb){_0x48eff6['subsections']=_0x2b9c20;}}else{if(_0x48eff6[_0xb2a7('0x57')]===0x64){if(!_0x48eff6[_0xb2a7('0x64')]){_0x48eff6[_0xb2a7('0x64')]=[];}_0x48eff6[_0xb2a7('0x64')]=_0x48eff6['subsections'][_0xb2a7('0x65')](_0x2b9c20);}}return _0x48eff6;});});}else{return;}})[_0xb2a7('0x2c')](function(_0x39503b){if(_0x39503b)_0x401720=_0x39503b;if(_[_0xb2a7('0x62')](_0x2ce574,0x709)){var _0x65a402=_['find'](_0x401720,{'sectionId':0x709});return getPlugins(_0x65a402)[_0xb2a7('0x2c')](function(_0x4eecbc){if(_0x65a402['enabled']){return _[_0xb2a7('0x34')](_0x401720,function(_0x543541){if(_0x543541['sectionId']===0x709){_0x543541[_0xb2a7('0x64')]=_0x4eecbc;}return _0x543541;});}else{var _0x234671={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4eecbc};var _0x4271c7=_['map'](_0x401720);_0x4271c7[_0xb2a7('0x5e')](_0x234671);return _0x4271c7;}});}else{return;}})[_0xb2a7('0x2c')](function(_0x3ec67a){if(_0x3ec67a)_0x401720=_0x3ec67a;return _['filter'](_0x401720,[_0xb2a7('0x61'),0x1]);})[_0xb2a7('0x2c')](respondWithResult(_0xe74ef4,null))['catch'](handleError(_0xe74ef4,null));};function hasDefaultDashboard(_0x109a89){var _0x14008a=[0x65];return new BPromise(function(_0x5939af,_0xe7adea){try{if(_0x109a89[_0xb2a7('0x55')]){_0x5939af(_0x14008a);}else{return db[_0xb2a7('0x56')][_0xb2a7('0x66')]({'where':{'sectionId':_0x109a89['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x2c05ed){_0x2c05ed?_0x5939af(_0x14008a):_0x5939af();});}}catch(_0x2b7576){_0xe7adea(_0x2b7576);}});}function getCustomDashboards(_0x1dda8a){var _0x2d19fa=[];return new BPromise(function(_0x3a652b,_0x5f3d82){try{if(_0x1dda8a[_0xb2a7('0x55')]){return db[_0xb2a7('0x67')][_0xb2a7('0x48')]({'raw':!![]})['then'](function(_0x22b487){_0x22b487[_0xb2a7('0x68')](function(_0x55db3e){_0x2d19fa[_0xb2a7('0x5e')](_0x55db3e['id']+0x1869f);});_0x3a652b(_0x2d19fa);});}else{return db[_0xb2a7('0x56')]['findAll']({'where':{'sectionId':_0x1dda8a['id']},'raw':!![]})['then'](function(_0x5caafc){_0x5caafc[_0xb2a7('0x68')](function(_0x32339d){_0x2d19fa['push'](_0x32339d[_0xb2a7('0x69')]+0x1869f);});_0x3a652b(_0x2d19fa);});}}catch(_0x2f2a24){_0x5f3d82(_0x2f2a24);}});}function getPlugins(_0x41330e){var _0xc7d298=[];return new BPromise(function(_0x11d975,_0x1c2d86){try{if(_0x41330e[_0xb2a7('0x55')]){return db['Plugin'][_0xb2a7('0x48')]({'raw':!![]})[_0xb2a7('0x2c')](function(_0x48c205){_0x48c205['forEach'](function(_0x17c7ac){_0xc7d298[_0xb2a7('0x5e')](_0x17c7ac['id']+0x15b38);});_0x11d975(_0xc7d298);});}else{return db[_0xb2a7('0x56')][_0xb2a7('0x48')]({'where':{'sectionId':_0x41330e['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x220cfc){_0x220cfc[_0xb2a7('0x68')](function(_0x495c19){_0xc7d298[_0xb2a7('0x5e')](_0x495c19[_0xb2a7('0x69')]+0x15b38);});_0x11d975(_0xc7d298);});}}catch(_0xda87f4){_0x1c2d86(_0xda87f4);}});}exports[_0xb2a7('0x6a')]=function(_0x475b5e,_0x3a2ba3){return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x475b5e[_0xb2a7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a2ba3,null))[_0xb2a7('0x2c')](function(_0x44f746){if(_0x44f746){return db[_0xb2a7('0x5d')][_0xb2a7('0x53')](function(_0x65354){return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x475b5e[_0xb2a7('0x5a')]['id']},'attributes':['id'],'raw':!![]})[_0xb2a7('0x2c')](function(_0x5ab4d7){if(_0x5ab4d7){return db['UserProfileSection'][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x475b5e[_0xb2a7('0x5a')]['id'],'id':_[_0xb2a7('0x34')](_0x5ab4d7,function(_0x28c891){return _0x28c891['id'];})},'transaction':_0x65354});}})[_0xb2a7('0x2c')](function(_0x4a1519){var _0x3bb30b=_[_0xb2a7('0x34')](_0x475b5e[_0xb2a7('0x4d')],function(_0x3a8903){_0x3a8903[_0xb2a7('0x58')]=_0x475b5e[_0xb2a7('0x5a')]['id'];return _0x3a8903;});return db[_0xb2a7('0x54')][_0xb2a7('0x6b')](_0x3bb30b,{'raw':!![],'transaction':_0x65354});})['then'](function(_0x1b17a6){var _0xcb989f=_[_0xb2a7('0x41')](_[_0xb2a7('0x34')](_0x1b17a6,function(_0x2ebbfc){return _0x2ebbfc['get']({'plain':!![]});}),{'includeAll':![]});if(_0xcb989f){return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x475b5e['params']['id'],'sectionId':_[_0xb2a7('0x34')](_0xcb989f,function(_0x4f0367){return _0x4f0367[_0xb2a7('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xb2a7('0x2c')](function(_0x48ea88){var _0x4c5654=_[_0xb2a7('0x34')](_0x475b5e[_0xb2a7('0x4d')],function(_0x1e115f){_0x1e115f[_0xb2a7('0x58')]=_0x475b5e[_0xb2a7('0x5a')]['id'];return _0x1e115f;});return db[_0xb2a7('0x56')][_0xb2a7('0x6b')](_0x4c5654,{'raw':!![],'transaction':_0x65354});});}})[_0xb2a7('0x4a')](handleError(_0x3a2ba3,null));});}})[_0xb2a7('0x2c')](function(_0x10f3a7){var _0x43eb42=_[_0xb2a7('0x34')](_0x10f3a7,function(_0x46836f){return _0x46836f[_0xb2a7('0x4e')]({'plain':!![]});});})[_0xb2a7('0x2c')](respondWithResult(_0x3a2ba3,null))[_0xb2a7('0x4a')](handleError(_0x3a2ba3,null));};exports[_0xb2a7('0x6c')]=function(_0x5eaa73,_0x5ee55d,_0x22882e){return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x5eaa73[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x5ee55d,null))[_0xb2a7('0x2c')](function(_0xa75f6){if(_0xa75f6){return _0xa75f6[_0xb2a7('0x6c')](_0x5eaa73[_0xb2a7('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x5ee55d,null))[_0xb2a7('0x4a')](handleError(_0x5ee55d,null));};exports['getResources']=function(_0x3269fb,_0x200856){var _0x5e6c76={};if(!_0x3269fb[_0xb2a7('0x35')][_0xb2a7('0x6d')])throw new Error(_0xb2a7('0x6e'));if(!_0x3269fb['query'][_0xb2a7('0x6f')](_0xb2a7('0x3c'))){_0x5e6c76[_0xb2a7('0x24')]=qs['limit'](_0x3269fb['query'][_0xb2a7('0x24')]);_0x5e6c76['offset']=qs[_0xb2a7('0x22')](_0x3269fb[_0xb2a7('0x35')][_0xb2a7('0x22')]);}return db[_0xb2a7('0x45')]['find']({'where':{'id':_0x3269fb[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](function(_0x1c2398){if(!_0x1c2398)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3269fb['params']['id']);return db['UserProfile'][_0xb2a7('0x70')](_0x3269fb);})[_0xb2a7('0x2c')](respondWithFilteredResult(_0x200856,_0x5e6c76))['catch'](handleError(_0x200856,null));}; \ No newline at end of file +var _0x05d0=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','send','index','map','UserProfile','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','clone','find','get','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','describe','addSections','each','push','removeSections','destroy','getSections','enabled','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','status','end'];(function(_0xd2f4f5,_0x341930){var _0x41fc10=function(_0x496824){while(--_0x496824){_0xd2f4f5['push'](_0xd2f4f5['shift']());}};_0x41fc10(++_0x341930);}(_0x05d0,0xcc));var _0x005d=function(_0x363d89,_0xce001d){_0x363d89=_0x363d89-0x0;var _0x4e2cdf=_0x05d0[_0x363d89];return _0x4e2cdf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x005d('0x0'));var zipdir=require(_0x005d('0x1'));var jsonpatch=require(_0x005d('0x2'));var rp=require(_0x005d('0x3'));var moment=require('moment');var BPromise=require(_0x005d('0x4'));var Mustache=require(_0x005d('0x5'));var util=require(_0x005d('0x6'));var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var fs_extra=require(_0x005d('0xb'));var _=require(_0x005d('0xc'));var squel=require(_0x005d('0xd'));var crypto=require(_0x005d('0xe'));var jsforce=require(_0x005d('0xf'));var deskjs=require(_0x005d('0x10'));var toCsv=require(_0x005d('0x9'));var querystring=require(_0x005d('0x11'));var Papa=require(_0x005d('0x12'));var Redis=require('ioredis');var authService=require(_0x005d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x005d('0x14'));var logger=require(_0x005d('0x15'))('api');var utils=require(_0x005d('0x16'));var config=require(_0x005d('0x17'));var licenseUtil=require(_0x005d('0x18'));var db=require(_0x005d('0x19'))['db'];config[_0x005d('0x1a')]=_[_0x005d('0x1b')](config[_0x005d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x005d('0x1c'))(new Redis(config[_0x005d('0x1a')]));require(_0x005d('0x1d'))['register'](socket);function respondWithStatusCode(_0x20147d,_0x408287){_0x408287=_0x408287||0xcc;return function(_0xf4ec9e){if(_0xf4ec9e){return _0x20147d['sendStatus'](_0x408287);}return _0x20147d[_0x005d('0x1e')](_0x408287)[_0x005d('0x1f')]();};}function respondWithResult(_0x3f0968,_0x43cfe1){_0x43cfe1=_0x43cfe1||0xc8;return function(_0x21f158){if(_0x21f158){return _0x3f0968[_0x005d('0x1e')](_0x43cfe1)[_0x005d('0x20')](_0x21f158);}};}function respondWithFilteredResult(_0x1ef5ba,_0x13493a){return function(_0x247f12){if(_0x247f12){var _0x48d5cd=typeof _0x13493a[_0x005d('0x21')]===_0x005d('0x22')&&typeof _0x13493a[_0x005d('0x23')]===_0x005d('0x22');var _0xeeedc=_0x247f12[_0x005d('0x24')];var _0x57280b=_0x48d5cd?0x0:_0x13493a[_0x005d('0x21')];var _0x3b7760=_0x48d5cd?_0x247f12[_0x005d('0x24')]:_0x13493a[_0x005d('0x21')]+_0x13493a['limit'];var _0x280bc8;if(_0x3b7760>=_0xeeedc){_0x3b7760=_0xeeedc;_0x280bc8=0xc8;}else{_0x280bc8=0xce;}_0x1ef5ba[_0x005d('0x1e')](_0x280bc8);return _0x1ef5ba[_0x005d('0x25')](_0x005d('0x26'),_0x57280b+'-'+_0x3b7760+'/'+_0xeeedc)['json'](_0x247f12);}return null;};}function patchUpdates(_0x130f97){return function(_0x4996ae){try{jsonpatch[_0x005d('0x27')](_0x4996ae,_0x130f97,!![]);}catch(_0x2dc5d7){return BPromise[_0x005d('0x28')](_0x2dc5d7);}return _0x4996ae[_0x005d('0x29')]();};}function saveUpdates(_0x2a7e1b,_0x5d8a70){return function(_0xc207b8){if(_0xc207b8){return _0xc207b8[_0x005d('0x2a')](_0x2a7e1b)[_0x005d('0x2b')](function(_0x2f3daf){return _0x2f3daf;});}return null;};}function removeEntity(_0x28cf28,_0x3a25ea){return function(_0x1ab0fc){if(_0x1ab0fc){return _0x1ab0fc['destroy']()['then'](function(){_0x28cf28[_0x005d('0x1e')](0xcc)[_0x005d('0x1f')]();});}};}function handleEntityNotFound(_0x2ab313,_0x8c79ee){return function(_0x18eed1){if(!_0x18eed1){_0x2ab313[_0x005d('0x2c')](0x194);}return _0x18eed1;};}function handleError(_0x43fd9c,_0xb9c7ab){_0xb9c7ab=_0xb9c7ab||0x1f4;return function(_0x274f79){logger[_0x005d('0x2d')](_0x274f79['stack']);if(_0x274f79['name']){delete _0x274f79['name'];}_0x43fd9c[_0x005d('0x1e')](_0xb9c7ab)[_0x005d('0x2e')](_0x274f79);};}exports[_0x005d('0x2f')]=function(_0x4ae54e,_0x4fe09b){var _0x20d04a={},_0x33159d={},_0xfd1907={'count':0x0,'rows':[]};var _0x59c9c7=_[_0x005d('0x30')](db[_0x005d('0x31')][_0x005d('0x32')],function(_0x3556f7){return{'name':_0x3556f7[_0x005d('0x33')],'type':_0x3556f7['type'][_0x005d('0x34')]};});_0x33159d[_0x005d('0x35')]=_[_0x005d('0x30')](_0x59c9c7,_0x005d('0x36'));_0x33159d[_0x005d('0x37')]=_[_0x005d('0x38')](_0x4ae54e[_0x005d('0x37')]);_0x33159d[_0x005d('0x39')]=_[_0x005d('0x3a')](_0x33159d[_0x005d('0x35')],_0x33159d[_0x005d('0x37')]);_0x20d04a[_0x005d('0x3b')]=_[_0x005d('0x3a')](_0x33159d['model'],qs[_0x005d('0x3c')](_0x4ae54e[_0x005d('0x37')]['fields']));_0x20d04a[_0x005d('0x3b')]=_0x20d04a[_0x005d('0x3b')][_0x005d('0x3d')]?_0x20d04a[_0x005d('0x3b')]:_0x33159d[_0x005d('0x35')];if(!_0x4ae54e[_0x005d('0x37')]['hasOwnProperty']('nolimit')){_0x20d04a[_0x005d('0x23')]=qs['limit'](_0x4ae54e[_0x005d('0x37')]['limit']);_0x20d04a['offset']=qs[_0x005d('0x21')](_0x4ae54e[_0x005d('0x37')][_0x005d('0x21')]);}_0x20d04a['order']=qs[_0x005d('0x3e')](_0x4ae54e[_0x005d('0x37')]['sort']);_0x20d04a[_0x005d('0x3f')]=qs[_0x005d('0x39')](_[_0x005d('0x40')](_0x4ae54e[_0x005d('0x37')],_0x33159d[_0x005d('0x39')]),_0x59c9c7);if(_0x4ae54e[_0x005d('0x37')]['filter']){_0x20d04a[_0x005d('0x3f')]=_[_0x005d('0x41')](_0x20d04a['where'],{'$or':_[_0x005d('0x30')](_0x59c9c7,function(_0x589d8a){if(_0x589d8a[_0x005d('0x42')]!==_0x005d('0x43')){var _0x2e7456={};_0x2e7456[_0x589d8a['name']]={'$like':'%'+_0x4ae54e['query'][_0x005d('0x44')]+'%'};return _0x2e7456;}})});}_0x20d04a=_[_0x005d('0x41')]({},_0x20d04a,_0x4ae54e[_0x005d('0x45')]);var _0x3adf62={'where':_0x20d04a['where']};return db['UserProfile'][_0x005d('0x24')](_0x3adf62)['then'](function(_0x3553a5){_0xfd1907[_0x005d('0x24')]=_0x3553a5;if(_0x4ae54e[_0x005d('0x37')]['includeAll']){_0x20d04a[_0x005d('0x46')]=[{'all':!![]}];}return db[_0x005d('0x31')][_0x005d('0x47')](_0x20d04a);})[_0x005d('0x2b')](function(_0x4c55fa){_0xfd1907[_0x005d('0x48')]=_0x4c55fa;return _0xfd1907;})[_0x005d('0x2b')](respondWithFilteredResult(_0x4fe09b,_0x20d04a))[_0x005d('0x49')](handleError(_0x4fe09b,null));};exports[_0x005d('0x4a')]=function(_0x1b2cdd,_0x1a47b5){var _0x284ccc={'raw':![],'where':{'id':_0x1b2cdd[_0x005d('0x4b')]['id']}},_0x218575={};_0x218575[_0x005d('0x35')]=_['keys'](db['UserProfile'][_0x005d('0x32')]);_0x218575[_0x005d('0x37')]=_['keys'](_0x1b2cdd[_0x005d('0x37')]);_0x218575[_0x005d('0x39')]=_[_0x005d('0x3a')](_0x218575[_0x005d('0x35')],_0x218575[_0x005d('0x37')]);_0x284ccc[_0x005d('0x3b')]=_['intersection'](_0x218575[_0x005d('0x35')],qs[_0x005d('0x3c')](_0x1b2cdd[_0x005d('0x37')][_0x005d('0x3c')]));_0x284ccc['attributes']=_0x284ccc['attributes'][_0x005d('0x3d')]?_0x284ccc['attributes']:_0x218575[_0x005d('0x35')];if(_0x1b2cdd['query'][_0x005d('0x4c')]){_0x284ccc[_0x005d('0x46')]=[{'all':!![]}];}_0x284ccc=_['merge']({},_0x284ccc,_0x1b2cdd[_0x005d('0x45')]);return db[_0x005d('0x31')]['find'](_0x284ccc)[_0x005d('0x2b')](handleEntityNotFound(_0x1a47b5,null))['then'](respondWithResult(_0x1a47b5,null))[_0x005d('0x49')](handleError(_0x1a47b5,null));};exports[_0x005d('0x4d')]=function(_0x4381d5,_0x36e626){return db['UserProfile'][_0x005d('0x4d')](_0x4381d5[_0x005d('0x4e')],{})[_0x005d('0x2b')](respondWithResult(_0x36e626,0xc9))['catch'](handleError(_0x36e626,null));};exports[_0x005d('0x4f')]=function(_0x1c3e5a,_0x1c889b){var _0x149f1c={'where':{'id':_0x1c3e5a['params']['id']}},_0x4461ff={};_0x4461ff['model']=_['keys'](db[_0x005d('0x31')][_0x005d('0x32')]);_0x149f1c['attributes']=_[_0x005d('0x3a')](_0x4461ff['model'],qs[_0x005d('0x3c')](_0x1c3e5a[_0x005d('0x37')][_0x005d('0x3c')]));_0x149f1c[_0x005d('0x3b')]=_0x149f1c[_0x005d('0x3b')]['length']?_0x149f1c['attributes']:_0x4461ff[_0x005d('0x35')];if(_0x1c3e5a[_0x005d('0x37')][_0x005d('0x4c')]){_0x149f1c[_0x005d('0x46')]=[{'all':!![]}];}_0x149f1c=_[_0x005d('0x41')]({},_0x149f1c,_0x1c3e5a[_0x005d('0x45')]);return db[_0x005d('0x31')][_0x005d('0x50')](_0x149f1c)[_0x005d('0x2b')](handleEntityNotFound(_0x1c889b,null))[_0x005d('0x2b')](function(_0xc7a73d){if(_0xc7a73d){var _0x1e4d99=_0xc7a73d[_0x005d('0x51')]({'plain':!![]});_0x1e4d99=qs[_0x005d('0x52')](_0x1e4d99,['id','createdAt',_0x005d('0x53'),_0x005d('0x54')]);_0x1c3e5a[_0x005d('0x4e')]=_[_0x005d('0x52')](_0x1c3e5a['body'],['id','createdAt',_0x005d('0x53')]);return db[_0x005d('0x55')][_0x005d('0x56')](function(_0x2cb2fb){return db[_0x005d('0x31')][_0x005d('0x4d')](_[_0x005d('0x41')](_0x1e4d99,_0x1c3e5a[_0x005d('0x4e')]),{'include':_0x1c3e5a[_0x005d('0x37')][_0x005d('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x2cb2fb})[_0x005d('0x2b')](function(_0x27b81d){var _0x576be0=_0x27b81d[_0x005d('0x51')]({'plain':!![]});return db[_0x005d('0x57')]['findAll']({'where':{'userProfileId':_0x1c3e5a['params']['id']},'raw':!![]})[_0x005d('0x2b')](function(_0x525218){if(_0x525218){return BPromise['each'](_0x525218,function(_0xd69b9e){return new BPromise(function(_0xc9b8da,_0x4e371e){if(_0xd69b9e[_0x005d('0x58')]===null||_0xd69b9e['autoAssociation']===0x1)_0xc9b8da(null);return db[_0x005d('0x59')]['findAll']({'where':{'sectionId':_0xd69b9e['id']},'raw':!![]})['then'](function(_0x2ed36b){var _0x13fe32=_[_0x005d('0x30')](_0x2ed36b,function(_0x35a8bf){return qs['omit'](_0x35a8bf,['id',_0x005d('0x5a'),_0x005d('0x53'),_0x005d('0x5b')]);});_0xc9b8da(_0x13fe32);})[_0x005d('0x49')](function(_0x173b64){_0x4e371e(_0x173b64);});})[_0x005d('0x2b')](function(_0x576e3f){var _0x1c13c5=qs['omit'](_0xd69b9e,['id',_0x005d('0x5a'),_0x005d('0x53')]);_0x1c13c5[_0x005d('0x5c')]=_0x576be0['id'];if(_0x576e3f)_0x1c13c5[_0x005d('0x5d')]=_0x576e3f;return _0x1c13c5;})[_0x005d('0x2b')](function(_0x4db2f4){return db[_0x005d('0x57')][_0x005d('0x4d')](_0x4db2f4,{'include':[{'model':db['UserProfileResource'],'as':_0x005d('0x5d')}],'raw':!![],'transaction':_0x2cb2fb});});})['then'](function(){return _0x576be0;});}});});});}})[_0x005d('0x2b')](respondWithResult(_0x1c889b,0xc9))[_0x005d('0x49')](handleError(_0x1c889b,null));};exports[_0x005d('0x2a')]=function(_0x27e06d,_0x97351){if(_0x27e06d[_0x005d('0x4e')]['id']){delete _0x27e06d[_0x005d('0x4e')]['id'];}return db[_0x005d('0x31')][_0x005d('0x50')]({'where':{'id':_0x27e06d[_0x005d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x97351,null))['then'](saveUpdates(_0x27e06d['body'],null))['then'](respondWithResult(_0x97351,null))['catch'](handleError(_0x97351,null));};exports['destroy']=function(_0x4ad6fe,_0x3bc9a2){return db[_0x005d('0x31')]['find']({'where':{'id':_0x4ad6fe[_0x005d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bc9a2,null))[_0x005d('0x2b')](removeEntity(_0x3bc9a2,null))[_0x005d('0x49')](handleError(_0x3bc9a2,null));};exports[_0x005d('0x5e')]=function(_0xa258e7,_0x5f2b98){return db[_0x005d('0x31')][_0x005d('0x5e')]()[_0x005d('0x2b')](respondWithResult(_0x5f2b98,null))['catch'](handleError(_0x5f2b98,null));};exports[_0x005d('0x5f')]=function(_0x323d9e,_0x650c2f){var _0x3ba205=_0x323d9e[_0x005d('0x4e')];return db[_0x005d('0x31')]['find']({'where':{'id':_0x323d9e[_0x005d('0x4b')]['id']}})[_0x005d('0x2b')](handleEntityNotFound(_0x650c2f,null))[_0x005d('0x2b')](function(_0x4a86b2){if(_0x4a86b2){return db['sequelize'][_0x005d('0x56')](function(_0x4aec7c){return db[_0x005d('0x57')]['destroy']({'where':{'userProfileId':_0x323d9e[_0x005d('0x4b')]['id'],'sectionId':_[_0x005d('0x30')](_0x3ba205,function(_0xed464){return _0xed464[_0x005d('0x5b')];})},'transaction':_0x4aec7c})[_0x005d('0x2b')](function(){var _0x224b4e=_['map'](_0x3ba205,function(_0x1f8de2){_0x1f8de2[_0x005d('0x5c')]=_0x323d9e[_0x005d('0x4b')]['id'];return _0x1f8de2;});var _0x5c84c3=[];return BPromise[_0x005d('0x60')](_0x224b4e,function(_0x50ab0c){return db[_0x005d('0x57')][_0x005d('0x4d')](_0x50ab0c,{'include':[{'model':db[_0x005d('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x4aec7c})[_0x005d('0x2b')](function(_0x169ad6){_0x5c84c3[_0x005d('0x61')](_0x169ad6['get']({'plain':!![]}));});})['then'](function(){return _0x5c84c3;});});});}})['then'](function(_0xceae3c){return _0xceae3c;})[_0x005d('0x2b')](respondWithResult(_0x650c2f,null))['catch'](handleError(_0x650c2f,null));};exports[_0x005d('0x62')]=function(_0xb63596,_0x46bde3){var _0x2d84de;return db['UserProfile'][_0x005d('0x50')]({'where':{'id':_0xb63596[_0x005d('0x4b')]['id']},'attributes':['id',_0x005d('0x36')]})[_0x005d('0x2b')](handleEntityNotFound(_0x46bde3,null))['then'](function(_0x4c7aea){if(_0x4c7aea){_0x2d84de=_0x4c7aea;return db[_0x005d('0x57')][_0x005d('0x63')]({'where':{'userProfileId':_0xb63596[_0x005d('0x4b')]['id'],'sectionId':_0xb63596[_0x005d('0x37')]['ids']}});}})[_0x005d('0x2b')](function(){return _0x2d84de;})['then'](respondWithStatusCode(_0x46bde3,null))[_0x005d('0x49')](handleError(_0x46bde3,null));};exports[_0x005d('0x64')]=function(_0x3418f6,_0xef1d57){var _0x30174c=[];var _0x3435a9=[];return db[_0x005d('0x57')][_0x005d('0x47')]({'where':{'userProfileId':_0x3418f6['params']['id']},'raw':!![]})[_0x005d('0x2b')](function(_0x9c88e1){_0x30174c=_['filter'](_0x9c88e1,function(_0x9776ef){return _0x9776ef[_0x005d('0x65')]===0x1||_['includes']([0x3eb,0x709],_0x9776ef[_0x005d('0x5b')]);});if(!_['isEmpty'](_0x30174c)){return _[_0x005d('0x30')](_0x30174c,function(_0x381d3e){return _0x381d3e['sectionId'];});}else{return;}})[_0x005d('0x2b')](function(_0x2999fb){if(_0x2999fb)_0x3435a9=_0x2999fb;if(_[_0x005d('0x66')](_0x3435a9,0x64)){var _0x5ec475=_['find'](_0x30174c,{'sectionId':0x64});return hasDefaultDashboard(_0x5ec475)[_0x005d('0x2b')](function(_0x25b63a){return _[_0x005d('0x30')](_0x30174c,function(_0x171c0b){if(_0x171c0b[_0x005d('0x5b')]===0x64){_0x171c0b[_0x005d('0x67')]=_0x25b63a;}return _0x171c0b;});});}else{return;}})[_0x005d('0x2b')](function(_0x465f3d){if(_0x465f3d)_0x30174c=_0x465f3d;if(_['includes'](_0x3435a9,0x3eb)){var _0x43fe66=_['find'](_0x30174c,{'sectionId':0x3eb});return getCustomDashboards(_0x43fe66)['then'](function(_0x1fa5e1){return _[_0x005d('0x30')](_0x30174c,function(_0x2a4714){if(_0x43fe66['enabled']){if(_0x2a4714['sectionId']===0x3eb){_0x2a4714[_0x005d('0x67')]=_0x1fa5e1;}}else{if(_0x2a4714['sectionId']===0x64){if(!_0x2a4714[_0x005d('0x67')]){_0x2a4714[_0x005d('0x67')]=[];}_0x2a4714[_0x005d('0x67')]=_0x2a4714[_0x005d('0x67')][_0x005d('0x68')](_0x1fa5e1);}}return _0x2a4714;});});}else{return;}})[_0x005d('0x2b')](function(_0x406b5d){if(_0x406b5d)_0x30174c=_0x406b5d;if(_[_0x005d('0x66')](_0x3435a9,0x709)){var _0x285de9=_[_0x005d('0x50')](_0x30174c,{'sectionId':0x709});return getPlugins(_0x285de9)[_0x005d('0x2b')](function(_0x385718){if(_0x285de9[_0x005d('0x65')]){return _[_0x005d('0x30')](_0x30174c,function(_0x4b0771){if(_0x4b0771['sectionId']===0x709){_0x4b0771[_0x005d('0x67')]=_0x385718;}return _0x4b0771;});}else{var _0x1a6bf5={'sectionId':0x76c,'enabled':0x1,'subsections':_0x385718};var _0xc2f892=_[_0x005d('0x30')](_0x30174c);_0xc2f892[_0x005d('0x61')](_0x1a6bf5);return _0xc2f892;}});}else{return;}})[_0x005d('0x2b')](function(_0x5f5331){if(_0x5f5331)_0x30174c=_0x5f5331;return _[_0x005d('0x44')](_0x30174c,[_0x005d('0x65'),0x1]);})[_0x005d('0x2b')](respondWithResult(_0xef1d57,null))[_0x005d('0x49')](handleError(_0xef1d57,null));};function hasDefaultDashboard(_0x13fc31){var _0x402560=[0x65];return new BPromise(function(_0x5d9597,_0x3700a0){try{if(_0x13fc31[_0x005d('0x58')]){_0x5d9597(_0x402560);}else{return db[_0x005d('0x59')][_0x005d('0x69')]({'where':{'sectionId':_0x13fc31['id']},'raw':!![]})[_0x005d('0x2b')](function(_0x2e71e1){_0x2e71e1?_0x5d9597(_0x402560):_0x5d9597();});}}catch(_0x5f0e73){_0x3700a0(_0x5f0e73);}});}function getCustomDashboards(_0x218cd8){var _0x511d96=[];return new BPromise(function(_0x2b62cd,_0xffd6bb){try{if(_0x218cd8['autoAssociation']){return db[_0x005d('0x6a')]['findAll']({'raw':!![]})[_0x005d('0x2b')](function(_0x464379){_0x464379[_0x005d('0x6b')](function(_0x23fb07){_0x511d96['push'](_0x23fb07['id']+0x1869f);});_0x2b62cd(_0x511d96);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x218cd8['id']},'raw':!![]})[_0x005d('0x2b')](function(_0x4944ad){_0x4944ad[_0x005d('0x6b')](function(_0x42d453){_0x511d96[_0x005d('0x61')](_0x42d453['resourceId']+0x1869f);});_0x2b62cd(_0x511d96);});}}catch(_0x100892){_0xffd6bb(_0x100892);}});}function getPlugins(_0x27774d){var _0x2ce76e=[];return new BPromise(function(_0x5506b1,_0x11d191){try{if(_0x27774d[_0x005d('0x58')]){return db['Plugin'][_0x005d('0x47')]({'raw':!![]})[_0x005d('0x2b')](function(_0x373b85){_0x373b85[_0x005d('0x6b')](function(_0x6b0cba){_0x2ce76e[_0x005d('0x61')](_0x6b0cba['id']+0x15b38);});_0x5506b1(_0x2ce76e);});}else{return db[_0x005d('0x59')][_0x005d('0x47')]({'where':{'sectionId':_0x27774d['id']},'raw':!![]})[_0x005d('0x2b')](function(_0x5197a0){_0x5197a0[_0x005d('0x6b')](function(_0x45c294){_0x2ce76e[_0x005d('0x61')](_0x45c294[_0x005d('0x6c')]+0x15b38);});_0x5506b1(_0x2ce76e);});}}catch(_0x5df41e){_0x11d191(_0x5df41e);}});}exports['addResources']=function(_0x2c2de1,_0xb98a04){return db[_0x005d('0x31')][_0x005d('0x50')]({'where':{'id':_0x2c2de1[_0x005d('0x4b')]['id']}})[_0x005d('0x2b')](handleEntityNotFound(_0xb98a04,null))[_0x005d('0x2b')](function(_0x296744){if(_0x296744){return db[_0x005d('0x55')][_0x005d('0x56')](function(_0xdb166){return db[_0x005d('0x57')][_0x005d('0x47')]({'where':{'userProfileId':_0x2c2de1[_0x005d('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x005d('0x2b')](function(_0x25c77b){if(_0x25c77b){return db['UserProfileSection'][_0x005d('0x63')]({'where':{'userProfileId':_0x2c2de1[_0x005d('0x4b')]['id'],'id':_[_0x005d('0x30')](_0x25c77b,function(_0x2141c2){return _0x2141c2['id'];})},'transaction':_0xdb166});}})[_0x005d('0x2b')](function(_0x1c1bcc){var _0x4d42ed=_[_0x005d('0x30')](_0x2c2de1[_0x005d('0x4e')],function(_0x144b92){_0x144b92[_0x005d('0x5c')]=_0x2c2de1[_0x005d('0x4b')]['id'];return _0x144b92;});return db[_0x005d('0x57')][_0x005d('0x6d')](_0x4d42ed,{'raw':!![],'transaction':_0xdb166});})[_0x005d('0x2b')](function(_0x401e51){var _0x505d37=_[_0x005d('0x44')](_[_0x005d('0x30')](_0x401e51,function(_0x1bf170){return _0x1bf170[_0x005d('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x505d37){return db[_0x005d('0x57')]['findAll']({'where':{'userProfileId':_0x2c2de1[_0x005d('0x4b')]['id'],'sectionId':_[_0x005d('0x30')](_0x505d37,function(_0x544eb4){return _0x544eb4[_0x005d('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x005d('0x2b')](function(_0x46db69){var _0x181269=_[_0x005d('0x30')](_0x2c2de1[_0x005d('0x4e')],function(_0x3b96c9){_0x3b96c9[_0x005d('0x5c')]=_0x2c2de1[_0x005d('0x4b')]['id'];return _0x3b96c9;});return db[_0x005d('0x59')][_0x005d('0x6d')](_0x181269,{'raw':!![],'transaction':_0xdb166});});}})[_0x005d('0x49')](handleError(_0xb98a04,null));});}})['then'](function(_0x498e68){var _0x1d265a=_['map'](_0x498e68,function(_0x3a87c){return _0x3a87c[_0x005d('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0xb98a04,null))[_0x005d('0x49')](handleError(_0xb98a04,null));};exports[_0x005d('0x6e')]=function(_0x48eedb,_0x304226,_0x2e150e){return db[_0x005d('0x31')][_0x005d('0x50')]({'where':{'id':_0x48eedb[_0x005d('0x4b')]['id']}})[_0x005d('0x2b')](handleEntityNotFound(_0x304226,null))['then'](function(_0x4f9d14){if(_0x4f9d14){return _0x4f9d14[_0x005d('0x6e')](_0x48eedb['query'][_0x005d('0x6f')]);}})[_0x005d('0x2b')](respondWithStatusCode(_0x304226,null))[_0x005d('0x49')](handleError(_0x304226,null));};exports[_0x005d('0x70')]=function(_0x14d89f,_0x30578c){var _0x5ef7ec={};if(!_0x14d89f[_0x005d('0x37')][_0x005d('0x71')])throw new Error(_0x005d('0x72'));if(!_0x14d89f['query'][_0x005d('0x73')](_0x005d('0x74'))){_0x5ef7ec['limit']=qs[_0x005d('0x23')](_0x14d89f[_0x005d('0x37')][_0x005d('0x23')]);_0x5ef7ec['offset']=qs['offset'](_0x14d89f[_0x005d('0x37')][_0x005d('0x21')]);}return db[_0x005d('0x31')]['find']({'where':{'id':_0x14d89f['params']['id']}})[_0x005d('0x2b')](function(_0x2fab6b){if(!_0x2fab6b)throw new Error(_0x005d('0x75')+_0x14d89f[_0x005d('0x4b')]['id']);return db[_0x005d('0x31')]['getResources'](_0x14d89f);})[_0x005d('0x2b')](respondWithFilteredResult(_0x30578c,_0x5ef7ec))[_0x005d('0x49')](handleError(_0x30578c,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 7db6c3e..15d0567 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 _0x6f83=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','save'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x6f83,0x72));var _0x36f8=function(_0x13e2ca,_0x1a3b3d){_0x13e2ca=_0x13e2ca-0x0;var _0x105595=_0x6f83[_0x13e2ca];return _0x105595;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x36f8('0x0'))['db'][_0x36f8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x36f8('0x2'),'afterUpdate':_0x36f8('0x3'),'afterDestroy':_0x36f8('0x4')};function emitEvent(_0x442b8b){return function(_0x456795,_0xf53947,_0x9ed336){UserProfileEvents[_0x36f8('0x5')](_0x442b8b+':'+_0x456795['id'],_0x456795);UserProfileEvents[_0x36f8('0x5')](_0x442b8b,_0x456795);_0x9ed336(null);};}for(var e in events){if(events[_0x36f8('0x6')](e)){var event=events[e];UserProfile[_0x36f8('0x7')](e,emitEvent(event));}}module[_0x36f8('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x3588=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x335712,_0x321dd0){var _0x13949a=function(_0x594320){while(--_0x594320){_0x335712['push'](_0x335712['shift']());}};_0x13949a(++_0x321dd0);}(_0x3588,0x82));var _0x8358=function(_0x59df9c,_0x5668b9){_0x59df9c=_0x59df9c-0x0;var _0x248b8a=_0x3588[_0x59df9c];return _0x248b8a;};'use strict';var EventEmitter=require(_0x8358('0x0'));var UserProfile=require(_0x8358('0x1'))['db'][_0x8358('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8358('0x3')](0x0);var events={'afterCreate':_0x8358('0x4'),'afterUpdate':_0x8358('0x5'),'afterDestroy':_0x8358('0x6')};function emitEvent(_0x586dd2){return function(_0x3fd803,_0xa7a3d4,_0x146ed6){UserProfileEvents[_0x8358('0x7')](_0x586dd2+':'+_0x3fd803['id'],_0x3fd803);UserProfileEvents['emit'](_0x586dd2,_0x3fd803);_0x146ed6(null);};}for(var e in events){if(events[_0x8358('0x8')](e)){var event=events[e];UserProfile[_0x8358('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cf1aae5..ec8ba31 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 _0xda5a=['ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','parentSections','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','triggers','Trigger','trunks','Trunk','plugins','Plugin','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','toString','OpenTabs','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','UserProfileSection','find','params','ignore','isEmpty','length','autoAssociation','push','all','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','findAll','model','then','associatedResources','map','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareProjects','contacts','CmContact','Lists','ListId','lists','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0x463926,_0x395f63){var _0x75b6e7=function(_0x2c0e5d){while(--_0x2c0e5d){_0x463926['push'](_0x463926['shift']());}};_0x75b6e7(++_0x395f63);}(_0xda5a,0x99));var _0xada5=function(_0x223a7c,_0x11ebdc){_0x223a7c=_0x223a7c-0x0;var _0x22e78a=_0xda5a[_0x223a7c];return _0x22e78a;};'use strict';var _=require(_0xada5('0x0'));var attributes=require(_0xada5('0x1'));var qs=require(_0xada5('0x2'));var squel=require('squel');module['exports']=function(_0x3c1c3c){var _0x276127=_0x3c1c3c[_0xada5('0x3')];function _0x29f4ad(_0x2dae7f,_0x4bb3cf){return new Promise(function(_0x5e5770,_0x3d8ac5){if(!_0x4bb3cf)return _0x5e5770(null);var _0x3aa735=_0x4bb3cf['filter']?{[_0x4bb3cf[_0xada5('0x4')][_0xada5('0x5')]]:_0x4bb3cf[_0xada5('0x4')][_0xada5('0x6')]}:undefined;return _0x276127[_0x2dae7f][_0xada5('0x7')]({'where':_0x3aa735,'raw':!![]})['then'](function(_0x2b9b50){_0x4bb3cf['associatedResources']=_['map'](_0x2b9b50,'id');_0x5e5770(_0x4bb3cf);})['catch'](function(_0x58664b){_0x3d8ac5(_0x58664b);});});}function _0x590e18(_0xf93e87,_0xdda76f){return new Promise(function(_0x23b127,_0x4f01dc){var _0x2af807=_0xf93e87[_0xada5('0x4')]?{[_0xf93e87[_0xada5('0x4')]['field']]:_0xf93e87['filter']['value']}:undefined;return _0x276127[_0xf93e87[_0xada5('0x8')]][_0xada5('0x7')]({'where':_0x2af807,'raw':!![]})[_0xada5('0x9')](function(_0x834fbd){_0xdda76f[_0xada5('0xa')]=_[_0xada5('0xb')](_0x834fbd,function(_0x5f2cc2){return _0x5f2cc2[_0xada5('0xc')];});_0x23b127(_0xdda76f);})['catch'](function(_0x14c9aa){_0x4f01dc(_0x14c9aa);});});}function _0x3a74dc(_0x5bd540,_0x417e31,_0x4c1f9f){if(!_0x417e31)return Promise['resolve'](null);return new Promise(function(_0x3dc46c,_0x241141){return _0x276127[_0xada5('0xd')]['findAll']({'where':{'sectionId':_0x417e31['id']},'raw':!![]})[_0xada5('0x9')](function(_0x462e93){if(_0x5bd540[_0xada5('0x5')]&&_0x5bd540['field']!=='id'){_0x417e31[_0xada5('0xa')]=_[_0xada5('0xb')](_0x462e93,function(_0xcd5855){return _0xcd5855[_0x5bd540[_0xada5('0x5')]];});}else{if(_0x4c1f9f===_0xada5('0xe')){_0x417e31[_0xada5('0xa')]=_['map'](_0x462e93,function(_0xdba090){return{'id':_0xdba090[_0xada5('0xf')],'type':_0xdba090[_0xada5('0x10')]};});}else{_0x417e31[_0xada5('0xa')]=_[_0xada5('0xb')](_0x462e93,function(_0x306e3b){return _0x306e3b[_0xada5('0xf')];});}}_0x3dc46c(_0x417e31);})['catch'](function(_0x22aedb){_0x241141(_0x22aedb);});});}function _0x543dc(_0x1ee220,_0xf4b238){var _0x12a7d4={'parentSections':[]};switch(_0x1ee220['toLowerCase']()){case _0xada5('0x11'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x13');break;case'odbc':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x14');break;case _0xada5('0x15'):_0x12a7d4[_0xada5('0x12')]='SquareRecording';_0x12a7d4['parentSections']=[{'name':_0xada5('0x16'),'field':_0xada5('0xc'),'foreignKey':'projectName'}];break;case'projects':_0x12a7d4[_0xada5('0x12')]='JscriptyProject';break;case _0xada5('0x17'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x18');_0x12a7d4['parentSections']=[{'name':_0xada5('0x19'),'field':'id','foreignKey':_0xada5('0x1a')}];break;case _0xada5('0x1b'):_0x12a7d4[_0xada5('0x12')]='CmList';break;case _0xada5('0x1c'):_0x12a7d4[_0xada5('0x12')]='CmCompany';break;case _0xada5('0x1d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x1e');break;case _0xada5('0x1f'):_0x12a7d4['childModel']=_0xada5('0x20');break;case _0xada5('0x21'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x22');break;case _0xada5('0x23'):_0x12a7d4['childModel']=_0xada5('0x24');break;case _0xada5('0x25'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x26');break;case _0xada5('0x27'):case'internalroutes':case _0xada5('0x28'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x29');break;case _0xada5('0x2a'):_0x12a7d4['childModel']='VoiceContext';break;case _0xada5('0x2b'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x2c');break;case _0xada5('0x2d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x2e');_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x30'),'field':_0xada5('0xc'),'foreignKey':_0xada5('0x31'),'model':_0xada5('0x32'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x34')]}},{'name':_0xada5('0x35'),'field':'name','foreignKey':_0xada5('0x31'),'model':_0xada5('0x32'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x36')]}},{'name':_0xada5('0x37'),'field':_0xada5('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xada5('0x10'),'value':[_0xada5('0x38')]}},{'name':_0xada5('0x39'),'field':_0xada5('0xc'),'foreignKey':'queue','model':_0xada5('0x3a'),'filter':{'field':'type','value':[_0xada5('0x3b')]}}];break;case _0xada5('0x3c'):_0x12a7d4['childModel']='VoiceMusicOnHold';break;case _0xada5('0x3d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3e');break;case'voiceprefixes':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3f');break;case _0xada5('0x40'):_0x12a7d4[_0xada5('0x12')]='Campaign';break;case _0xada5('0x41'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x42');break;case _0xada5('0x43'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x44');break;case _0xada5('0x45'):_0x12a7d4['childModel']=_0xada5('0x46');break;case _0xada5('0x47'):_0x12a7d4['childModel']=_0xada5('0x48');break;case _0xada5('0x49'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4a');break;case _0xada5('0x4b'):_0x12a7d4[_0xada5('0x12')]='SmsQueue';break;case _0xada5('0x4c'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4d');break;case'whatsappqueues':_0x12a7d4[_0xada5('0x12')]='WhatsappQueue';break;case _0xada5('0x4e'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4f');break;case _0xada5('0x50'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x51');break;case _0xada5('0x52'):case _0xada5('0x53'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3a');if(_0xf4b238){_0x12a7d4['parentSections']=[{'name':_0xada5('0x37')},{'name':'QueueCampaigns'}];}break;case _0xada5('0x54'):case _0xada5('0x55'):case'telephones':_0x12a7d4['childModel']=_0xada5('0x32');if(_0xf4b238){_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x56'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x57'),_0xada5('0x58')]},'ignore':!![]},{'name':_0xada5('0x30')},{'name':'Telephones'}];}break;case _0xada5('0x59'):_0x12a7d4['childModel']=_0xada5('0x5a');break;case'salesforceaccounts':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x5b');break;case _0xada5('0x5c'):_0x12a7d4[_0xada5('0x12')]='FreshdeskAccount';break;case _0xada5('0x5d'):_0x12a7d4['childModel']='SugarcrmAccount';break;case _0xada5('0x5e'):_0x12a7d4[_0xada5('0x12')]='DeskAccount';break;case _0xada5('0x5f'):_0x12a7d4['childModel']=_0xada5('0x60');break;case _0xada5('0x61'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x32');break;case _0xada5('0x62'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x63');break;case _0xada5('0x64'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x65');break;case _0xada5('0x66'):_0x12a7d4['childModel']=_0xada5('0x67');break;case'intervals':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x68');break;case _0xada5('0x69'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6a');break;case _0xada5('0x6b'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6c');break;case _0xada5('0x6d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6e');break;case'tags':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6f');break;case _0xada5('0x70'):_0x12a7d4[_0xada5('0x12')]='Template';break;case _0xada5('0x71'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x72');break;case _0xada5('0x73'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x74');break;case'variables':_0x12a7d4['childModel']='Variable';break;case _0xada5('0x75'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x76');break;case'extractedreports':_0x12a7d4[_0xada5('0x12')]=_0xada5('0xe');_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x77'),'field':'id','foreignKey':_0xada5('0x78')}];break;case _0xada5('0x79'):_0x12a7d4[_0xada5('0x12')]='AnalyticMetric';break;}return _0x12a7d4;}function _0x9b4cf4(_0x2bfbb9,_0x3b7257){var _0x32f6fd=_0x2bfbb9[_0xada5('0x7a')](0x0)[_0xada5('0x7b')]()+_0x2bfbb9[_0xada5('0x7c')](0x1);var _0x5a4908={'type':_0x276127[_0xada5('0x7d')][_0xada5('0x7e')][_0xada5('0x7f')],'raw':!![]};return new Promise(function(_0x20c172,_0x5dfa32){var _0x4001f7=squel[_0xada5('0x80')]()[_0xada5('0x5')](_0xada5('0x81')+_0x32f6fd+'InteractionId','id')[_0xada5('0x5')](_0xada5('0x82'))[_0xada5('0x83')](_0xada5('0x84')+_0x2bfbb9+_0xada5('0x85'),'ui')[_0xada5('0x86')]('ui.UserId\x20=\x20?',_0x3b7257['id']);return _0x276127['sequelize']['query'](_0x4001f7[_0xada5('0x87')](),_0x5a4908)[_0xada5('0x9')](function(_0x3f31bb){_0x3b7257[_0x32f6fd+_0xada5('0x88')]=_0x3f31bb;_0x20c172(_0x3f31bb);})['catch'](function(_0x1deb4f){_0x5dfa32(_0x1deb4f);});});}return _0x3c1c3c['define']('UserProfile',attributes,{'tableName':_0xada5('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e0784){var _0x4b8d71={'raw':_0x2e0784[_0xada5('0x8a')]['raw'],'where':{}};var _0x3b8a06={};var _0x1ab22e={'count':0x0,'rows':[]};var _0x550e54=_0x2e0784['query']['section'];var _0x9440d2=_0x2e0784[_0xada5('0x8a')][_0xada5('0x8b')]||![];var _0x94684c=_0x543dc(_0x550e54,_0x9440d2);if(!_0x94684c[_0xada5('0x12')])throw new Error(_0xada5('0x8c')+_0x550e54+'\x27');var _0x4bf01c=[{'name':_0x550e54}];if(!_['isEmpty'](_0x94684c[_0xada5('0x2f')]))_0x4bf01c=_0x94684c[_0xada5('0x2f')];var _0x384755=[];for(var _0x52bc32=0x0;_0x52bc32<_0x4bf01c['length'];_0x52bc32++){_0x384755['push'](_0x276127[_0xada5('0x8d')][_0xada5('0x8e')]({'where':{'userProfileId':_0x2e0784[_0xada5('0x8f')]['id'],'name':_0x4bf01c[_0x52bc32]['name']},'raw':!![]}));}return Promise['all'](_0x384755)[_0xada5('0x9')](function(_0x31ee1d){var _0x36b4b1=_[_0xada5('0x4')](_0x31ee1d,function(_0x43b05c){return _0x43b05c?_0x43b05c:undefined;});var _0x4e4346=_[_0xada5('0x4')](_0x4bf01c,[_0xada5('0x90'),!![]]);var _0x22e04f=_['isEmpty'](_0x36b4b1)&&_[_0xada5('0x91')](_0x4e4346)?null:_['union'](_0x4e4346,_0x36b4b1);if(!_0x22e04f)return null;var _0x42f5f4=[];for(var _0x3ea864=0x0;_0x3ea864<_0x22e04f[_0xada5('0x92')];_0x3ea864++){var _0x3c2cab=_['find'](_0x4bf01c,function(_0x3e739c){return _0x22e04f[_0x3ea864]?_0x3e739c[_0xada5('0xc')]===_0x22e04f[_0x3ea864][_0xada5('0xc')]:null;});if(_0x3c2cab){if(_0x22e04f[_0x3ea864][_0xada5('0x90')]){_0x42f5f4['push'](_0x29f4ad(_0x94684c[_0xada5('0x12')],_0x22e04f[_0x3ea864]));}else{if(!_0x22e04f[_0x3ea864][_0xada5('0x93')]){_0x42f5f4[_0xada5('0x94')](_0x3a74dc(_0x3c2cab,_0x22e04f[_0x3ea864],_0x94684c[_0xada5('0x12')]));}else{if(_0x3c2cab[_0xada5('0x8')]){_0x42f5f4['push'](_0x590e18(_0x3c2cab,_0x22e04f[_0x3ea864]));}}}}}return Promise[_0xada5('0x95')](_0x42f5f4);})[_0xada5('0x9')](function(_0xd645db){var _0x336f94=_0xd645db;var _0xccbfa2=null;if(_0x336f94){_0xccbfa2=_0x336f94[_0xada5('0x92')]===0x1?_0x336f94[0x0]:null;}if(!_0xccbfa2&&!_0x336f94)return _0x1ab22e;var _0x4310d8=_0x276127[_0x94684c['childModel']]['rawAttributes'];_0x3b8a06[_0xada5('0x8')]=_[_0xada5('0x96')](_0x4310d8);_0x3b8a06[_0xada5('0x8a')]=_[_0xada5('0x96')](_0x2e0784['query']);_0x3b8a06[_0xada5('0x97')]=_['intersection'](_0x3b8a06[_0xada5('0x8')],_0x3b8a06[_0xada5('0x8a')]);_0x4b8d71['attributes']=_[_0xada5('0x98')](_0x3b8a06['model'],qs[_0xada5('0x99')](_0x2e0784[_0xada5('0x8a')]['fields']));_0x4b8d71[_0xada5('0x9a')]=_0x4b8d71[_0xada5('0x9a')][_0xada5('0x92')]?_0x4b8d71[_0xada5('0x9a')]:_0x3b8a06[_0xada5('0x8')];if(!_0x2e0784['query'][_0xada5('0x9b')]('nolimit')){_0x4b8d71['limit']=qs[_0xada5('0x9c')](_0x2e0784[_0xada5('0x8a')][_0xada5('0x9c')]);_0x4b8d71[_0xada5('0x9d')]=qs[_0xada5('0x9d')](_0x2e0784['query'][_0xada5('0x9d')]);}_0x4b8d71['order']=qs[_0xada5('0x9e')](_0x2e0784['query'][_0xada5('0x9e')]);_0x4b8d71[_0xada5('0x86')]=qs['filters'](_[_0xada5('0x9f')](_0x2e0784[_0xada5('0x8a')],_0x3b8a06[_0xada5('0x97')]));if(_0x2e0784['query'][_0xada5('0x4')]){_0x4b8d71['where']=_[_0xada5('0xa0')](_0x4b8d71[_0xada5('0x86')],{'$or':_[_0xada5('0xb')](_0x4310d8,function(_0x3ae660){if(_0x3ae660[_0xada5('0x10')][_0xada5('0xa1')]!==_0xada5('0xa2')){var _0x1bd1ce={};_0x1bd1ce[_0x3ae660[_0xada5('0x5')]]={'$like':'%'+_0x2e0784[_0xada5('0x8a')]['filter']+'%'};return _0x1bd1ce;}})});}var _0x271afc=[];var _0x517039=null;var _0x5b098d={};if(_0xccbfa2){_0x517039=_[_0xada5('0x8e')](_0x4bf01c,['name',_0xccbfa2[_0xada5('0xc')]]);if(_0x517039[_0xada5('0x5')]){_0x5b098d={};if(_0x94684c[_0xada5('0x12')]===_0xada5('0xe')){_0x5b098d[_0x517039[_0xada5('0xa3')]]=_['map'](_0xccbfa2[_0xada5('0xa')],'id');}else{_0x5b098d[_0x517039[_0xada5('0xa3')]]=_0xccbfa2[_0xada5('0xa')];}_0x271afc[_0xada5('0x94')](_0x5b098d);}else{_0x4b8d71['where']['id']=_0xccbfa2[_0xada5('0xa')];}}else{for(var _0x3e08aa=0x0;_0x3e08aa<_0x336f94[_0xada5('0x92')];_0x3e08aa++){_0x517039=_[_0xada5('0x8e')](_0x4bf01c,['name',_0x336f94[_0x3e08aa][_0xada5('0xc')]]);if(_0x517039[_0xada5('0x5')]){_0x5b098d={};_0x5b098d[_0x517039[_0xada5('0xa3')]]=_0x336f94[_0x3e08aa][_0xada5('0xa')];_0x271afc[_0xada5('0x94')](_0x5b098d);}else{if(!_0x4b8d71[_0xada5('0x86')]['id'])_0x4b8d71[_0xada5('0x86')]['id']=[];_0x336f94[_0x3e08aa][_0xada5('0xa')][_0xada5('0xa4')](function(_0x3dea96){_0x4b8d71[_0xada5('0x86')]['id'][_0xada5('0x94')](_0x3dea96);});}}}if(!_['isEmpty'](_0x271afc)){_0x4b8d71[_0xada5('0x86')]=_[_0xada5('0xa0')](_0x4b8d71[_0xada5('0x86')],{'$and':{'$or':_0x271afc}});}_0x4b8d71=_[_0xada5('0xa0')]({},_0x4b8d71,_0x2e0784['options']);if(_0xccbfa2&&!_0xccbfa2[_0xada5('0x93')]&&_0x94684c[_0xada5('0x12')]===_0xada5('0xe')){if(_0x2e0784[_0xada5('0x8a')][_0xada5('0xa5')]){_0x4b8d71[_0xada5('0xa6')]=[{'all':!![]}];}return _0x276127[_0x94684c[_0xada5('0x12')]]['findAll'](_0x4b8d71)[_0xada5('0x9')](function(_0x9ff69c){var _0x4d883e=[];_0x9ff69c['forEach'](function(_0x482543){var _0x3350a1;switch(_0x482543[_0xada5('0xa7')]){case _0xada5('0xa8'):_0x3350a1=_[_0xada5('0x8e')](_0xccbfa2[_0xada5('0xa')],function(_0x12c496){return _0x12c496['id']===_0x482543[_0xada5('0x78')]&&_0x12c496[_0xada5('0x10')]===_0xada5('0xa9');});break;case _0xada5('0xaa'):_0x3350a1=_[_0xada5('0x8e')](_0xccbfa2['associatedResources'],function(_0x2eacc3){return _0x2eacc3['id']===_0x482543[_0xada5('0x78')]&&_0x2eacc3[_0xada5('0x10')]===_0xada5('0xab');});break;}if(_0x3350a1)_0x4d883e[_0xada5('0x94')](_0x482543);});_0x1ab22e[_0xada5('0xac')]=_0x4d883e[_0xada5('0x92')];_0x1ab22e[_0xada5('0xad')]=_0x4d883e;return _0x1ab22e;});}else{if(!_[_0xada5('0x91')](_0x2e0784[_0xada5('0x8a')][_0xada5('0xae')])){_0x4b8d71[_0xada5('0x86')]['id']=_0x4b8d71[_0xada5('0x86')]['id']?_[_0xada5('0x98')](_0x4b8d71[_0xada5('0x86')]['id'],_0x2e0784['query'][_0xada5('0xae')]):_0x2e0784[_0xada5('0x8a')][_0xada5('0xae')];if(_0x2e0784[_0xada5('0x8a')][_0xada5('0xaf')]){_0x4b8d71[_0xada5('0xb0')]=_0x2e0784[_0xada5('0x8a')][_0xada5('0xaf')];}}if(_0x2e0784['query'][_0xada5('0xb1')]){_0x4b8d71[_0xada5('0x86')]=_['merge'](_0x4b8d71[_0xada5('0x86')],{'$and':_0x2e0784['query'][_0xada5('0xb1')]});}return _0x276127[_0x94684c[_0xada5('0x12')]]['count']({'where':_0x4b8d71['where']})[_0xada5('0x9')](function(_0x39f503){_0x1ab22e['count']=_0x39f503;if(_0x2e0784[_0xada5('0x8a')]['includeAll']){if(_0x94684c[_0xada5('0x12')]===_0xada5('0x18')){_0x4b8d71[_0xada5('0xa6')]=[{'model':_0x276127[_0xada5('0x6f')],'as':_0xada5('0xb2'),'attributes':['id',_0xada5('0xc'),_0xada5('0xb3')],'required':_0x2e0784['query'][_0xada5('0xb4')]?!![]:![]},{'model':_0x276127[_0xada5('0x6f')],'as':_0xada5('0xb5'),'attributes':['id',_0xada5('0xc'),_0xada5('0xb3')],'through':_0x2e0784[_0xada5('0x8a')][_0xada5('0xb4')]?{'attributes':[],'where':{'TagId':_0x2e0784[_0xada5('0x8a')][_0xada5('0xb4')]||undefined}}:{},'required':_0x2e0784['query'][_0xada5('0xb4')]?!![]:![]}];}else{_0x4b8d71[_0xada5('0xa6')]=[{'all':!![]}];}}return _0x276127[_0x94684c[_0xada5('0x12')]]['findAll'](_0x4b8d71);})[_0xada5('0x9')](function(_0x2d33a6){_0x1ab22e[_0xada5('0xad')]=_0x2d33a6;if(_0x550e54===_0xada5('0x30')&&_0x2e0784[_0xada5('0x8a')][_0xada5('0xb6')]==='true'){var _0x8ae498=[];for(var _0xc968d7=0x0;_0xc968d7<_0x1ab22e[_0xada5('0xad')][_0xada5('0x92')];_0xc968d7++){_0x8ae498[_0xada5('0x94')](_0x9b4cf4('chat',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498['push'](_0x9b4cf4('sms',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498['push'](_0x9b4cf4(_0xada5('0xb8'),_0x1ab22e[_0xada5('0xad')][_0xc968d7]['dataValues']));_0x8ae498['push'](_0x9b4cf4(_0xada5('0xb9'),_0x1ab22e[_0xada5('0xad')][_0xc968d7][_0xada5('0xb7')]));_0x8ae498[_0xada5('0x94')](_0x9b4cf4(_0xada5('0xba'),_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498[_0xada5('0x94')](_0x9b4cf4('whatsapp',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));}return Promise[_0xada5('0x95')](_0x8ae498)['then'](function(){return _0x1ab22e;});}return _0x1ab22e;});}});}}});}; \ No newline at end of file +var _0x6c11=['options','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tag','Tags','tag','openTabs','true','chat','sms','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','then','associatedResources','model','findAll','map','name','catch','resolve','UserProfileResource','field','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Dashboard','intervals','pauses','scheduler','Sound','tags','templates','Template','triggers','trunks','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','union','length','ignore','push','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach'];(function(_0x29aed5,_0x245b34){var _0x432488=function(_0x579062){while(--_0x579062){_0x29aed5['push'](_0x29aed5['shift']());}};_0x432488(++_0x245b34);}(_0x6c11,0x19a));var _0x16c1=function(_0x2c286f,_0x5c75ce){_0x2c286f=_0x2c286f-0x0;var _0x5d8f64=_0x6c11[_0x2c286f];return _0x5d8f64;};'use strict';var _=require(_0x16c1('0x0'));var attributes=require(_0x16c1('0x1'));var qs=require(_0x16c1('0x2'));var squel=require(_0x16c1('0x3'));module[_0x16c1('0x4')]=function(_0x3b4717){var _0x59280b=_0x3b4717[_0x16c1('0x5')];function _0x4f754f(_0x33be98,_0x174ce7){return new Promise(function(_0x2158f1,_0x24076b){if(!_0x174ce7)return _0x2158f1(null);var _0x3ef2ce=_0x174ce7[_0x16c1('0x6')]?{[_0x174ce7[_0x16c1('0x6')]['field']]:_0x174ce7[_0x16c1('0x6')]['value']}:undefined;return _0x59280b[_0x33be98]['findAll']({'where':_0x3ef2ce,'raw':!![]})[_0x16c1('0x7')](function(_0x54f0dc){_0x174ce7[_0x16c1('0x8')]=_['map'](_0x54f0dc,'id');_0x2158f1(_0x174ce7);})['catch'](function(_0x420a9f){_0x24076b(_0x420a9f);});});}function _0x1d002e(_0xf47b19,_0x2fe7f7){return new Promise(function(_0x38b57c,_0x5de4a1){var _0x43b984=_0xf47b19[_0x16c1('0x6')]?{[_0xf47b19[_0x16c1('0x6')]['field']]:_0xf47b19[_0x16c1('0x6')]['value']}:undefined;return _0x59280b[_0xf47b19[_0x16c1('0x9')]][_0x16c1('0xa')]({'where':_0x43b984,'raw':!![]})[_0x16c1('0x7')](function(_0x52c950){_0x2fe7f7[_0x16c1('0x8')]=_[_0x16c1('0xb')](_0x52c950,function(_0x3a5fe2){return _0x3a5fe2[_0x16c1('0xc')];});_0x38b57c(_0x2fe7f7);})[_0x16c1('0xd')](function(_0x28841c){_0x5de4a1(_0x28841c);});});}function _0x284797(_0x3acd02,_0x279670,_0xe23422){if(!_0x279670)return Promise[_0x16c1('0xe')](null);return new Promise(function(_0xf26216,_0x2636cc){return _0x59280b[_0x16c1('0xf')]['findAll']({'where':{'sectionId':_0x279670['id']},'raw':!![]})[_0x16c1('0x7')](function(_0x5484cb){if(_0x3acd02[_0x16c1('0x10')]&&_0x3acd02[_0x16c1('0x10')]!=='id'){_0x279670[_0x16c1('0x8')]=_[_0x16c1('0xb')](_0x5484cb,function(_0x5d8bf7){return _0x5d8bf7[_0x3acd02[_0x16c1('0x10')]];});}else{if(_0xe23422===_0x16c1('0x11')){_0x279670[_0x16c1('0x8')]=_[_0x16c1('0xb')](_0x5484cb,function(_0x19019e){return{'id':_0x19019e['resourceId'],'type':_0x19019e[_0x16c1('0x12')]};});}else{_0x279670['associatedResources']=_[_0x16c1('0xb')](_0x5484cb,function(_0x40f38c){return _0x40f38c[_0x16c1('0x13')];});}}_0xf26216(_0x279670);})[_0x16c1('0xd')](function(_0x1c4a7b){_0x2636cc(_0x1c4a7b);});});}function _0x32af69(_0x188f97,_0x193de6){var _0x38703c={'parentSections':[]};switch(_0x188f97[_0x16c1('0x14')]()){case _0x16c1('0x15'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x17');break;case _0x16c1('0x18'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x19');break;case _0x16c1('0x1a'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x1b');_0x38703c[_0x16c1('0x1c')]=[{'name':_0x16c1('0x1d'),'field':'name','foreignKey':_0x16c1('0x1e')}];break;case _0x16c1('0x1f'):_0x38703c['childModel']=_0x16c1('0x20');break;case'contacts':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x21');_0x38703c['parentSections']=[{'name':_0x16c1('0x22'),'field':'id','foreignKey':_0x16c1('0x23')}];break;case'lists':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x24');break;case _0x16c1('0x25'):_0x38703c['childModel']=_0x16c1('0x26');break;case _0x16c1('0x27'):_0x38703c[_0x16c1('0x16')]='CmCustomField';break;case _0x16c1('0x28'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x29');break;case _0x16c1('0x2a'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x2b');break;case _0x16c1('0x2c'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x2d');break;case'faxaccounts':_0x38703c[_0x16c1('0x16')]='FaxAccount';break;case'inboundroutes':case _0x16c1('0x2e'):case'outboundroutes':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x2f');break;case _0x16c1('0x30'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x31');break;case _0x16c1('0x32'):_0x38703c['childModel']=_0x16c1('0x33');break;case _0x16c1('0x34'):_0x38703c['childModel']=_0x16c1('0x35');_0x38703c['parentSections']=[{'name':'Agents','field':_0x16c1('0xc'),'foreignKey':_0x16c1('0x36'),'model':_0x16c1('0x37'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0x16c1('0xc'),'foreignKey':'membername','model':_0x16c1('0x37'),'filter':{'field':_0x16c1('0x38'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x16c1('0xc'),'foreignKey':_0x16c1('0x39'),'model':_0x16c1('0x3a'),'filter':{'field':_0x16c1('0x12'),'value':[_0x16c1('0x3b')]}},{'name':_0x16c1('0x3c'),'field':_0x16c1('0xc'),'foreignKey':_0x16c1('0x39'),'model':_0x16c1('0x3a'),'filter':{'field':'type','value':[_0x16c1('0x3d')]}}];break;case _0x16c1('0x3e'):_0x38703c['childModel']=_0x16c1('0x3f');break;case _0x16c1('0x40'):_0x38703c[_0x16c1('0x16')]='VoiceChanSpy';break;case _0x16c1('0x41'):_0x38703c['childModel']='VoicePrefix';break;case _0x16c1('0x42'):_0x38703c[_0x16c1('0x16')]='Campaign';break;case _0x16c1('0x43'):_0x38703c[_0x16c1('0x16')]='MailQueue';break;case _0x16c1('0x44'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x45');break;case _0x16c1('0x46'):_0x38703c[_0x16c1('0x16')]='MailSubstatus';break;case'openchannelqueues':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x47');break;case _0x16c1('0x48'):_0x38703c[_0x16c1('0x16')]='OpenchannelAccount';break;case _0x16c1('0x49'):_0x38703c['childModel']=_0x16c1('0x4a');break;case'smsaccounts':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x4b');break;case'whatsappqueues':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x4c');break;case _0x16c1('0x4d'):_0x38703c['childModel']=_0x16c1('0x4e');break;case _0x16c1('0x4f'):_0x38703c['childModel']=_0x16c1('0x50');break;case _0x16c1('0x51'):case _0x16c1('0x52'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x3a');if(_0x193de6){_0x38703c[_0x16c1('0x1c')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x16c1('0x53'):case _0x16c1('0x54'):case _0x16c1('0x55'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x37');if(_0x193de6){_0x38703c[_0x16c1('0x1c')]=[{'name':_0x16c1('0x56'),'filter':{'field':_0x16c1('0x38'),'value':[_0x16c1('0x57'),_0x16c1('0x58')]},'ignore':!![]},{'name':_0x16c1('0x59')},{'name':'Telephones'}];}break;case _0x16c1('0x5a'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x5b');break;case _0x16c1('0x5c'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x5d');break;case _0x16c1('0x5e'):_0x38703c['childModel']=_0x16c1('0x5f');break;case _0x16c1('0x60'):_0x38703c['childModel']=_0x16c1('0x61');break;case _0x16c1('0x62'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x63');break;case'zohoaccounts':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x64');break;case _0x16c1('0x65'):_0x38703c['childModel']=_0x16c1('0x37');break;case'cannedanswers':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x66');break;case _0x16c1('0x67'):_0x38703c[_0x16c1('0x16')]='Disposition';break;case'customdashboards':_0x38703c['childModel']=_0x16c1('0x68');break;case _0x16c1('0x69'):_0x38703c[_0x16c1('0x16')]='Interval';break;case _0x16c1('0x6a'):_0x38703c[_0x16c1('0x16')]='Pause';break;case _0x16c1('0x6b'):_0x38703c[_0x16c1('0x16')]='Schedule';break;case'sounds':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x6c');break;case _0x16c1('0x6d'):_0x38703c[_0x16c1('0x16')]='Tag';break;case _0x16c1('0x6e'):_0x38703c['childModel']=_0x16c1('0x6f');break;case _0x16c1('0x70'):_0x38703c['childModel']='Trigger';break;case _0x16c1('0x71'):_0x38703c[_0x16c1('0x16')]='Trunk';break;case'variables':_0x38703c[_0x16c1('0x16')]=_0x16c1('0x72');break;case _0x16c1('0x73'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x74');break;case _0x16c1('0x75'):_0x38703c[_0x16c1('0x16')]=_0x16c1('0x11');_0x38703c[_0x16c1('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0x16c1('0x76')}];break;case _0x16c1('0x77'):_0x38703c['childModel']=_0x16c1('0x78');break;}return _0x38703c;}function _0x8b185(_0x2473ff,_0x39392a){var _0x63122b=_0x2473ff[_0x16c1('0x79')](0x0)[_0x16c1('0x7a')]()+_0x2473ff[_0x16c1('0x7b')](0x1);var _0x59810a={'type':_0x59280b['Sequelize']['QueryTypes'][_0x16c1('0x7c')],'raw':!![]};return new Promise(function(_0x36262f,_0x1a6056){var _0x55d8cf=squel[_0x16c1('0x7d')]()[_0x16c1('0x10')]('ui.'+_0x63122b+_0x16c1('0x7e'),'id')[_0x16c1('0x10')](_0x16c1('0x7f'))[_0x16c1('0x80')]('user_has_'+_0x2473ff+_0x16c1('0x81'),'ui')[_0x16c1('0x82')](_0x16c1('0x83'),_0x39392a['id']);return _0x59280b[_0x16c1('0x84')][_0x16c1('0x85')](_0x55d8cf[_0x16c1('0x86')](),_0x59810a)['then'](function(_0x3182fe){_0x39392a[_0x63122b+_0x16c1('0x87')]=_0x3182fe;_0x36262f(_0x3182fe);})['catch'](function(_0x3bbec2){_0x1a6056(_0x3bbec2);});});}return _0x3b4717[_0x16c1('0x88')](_0x16c1('0x89'),attributes,{'tableName':_0x16c1('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x9b3f15){var _0x5c05ad={'raw':_0x9b3f15[_0x16c1('0x85')][_0x16c1('0x8b')],'where':{}};var _0x3d81a0={};var _0x3ba2df={'count':0x0,'rows':[]};var _0x1ae1d1=_0x9b3f15[_0x16c1('0x85')][_0x16c1('0x8c')];var _0x380f64=_0x9b3f15[_0x16c1('0x85')][_0x16c1('0x8d')]||![];var _0x362e0d=_0x32af69(_0x1ae1d1,_0x380f64);if(!_0x362e0d[_0x16c1('0x16')])throw new Error(_0x16c1('0x8e')+_0x1ae1d1+'\x27');var _0x17ee04=[{'name':_0x1ae1d1}];if(!_[_0x16c1('0x8f')](_0x362e0d[_0x16c1('0x1c')]))_0x17ee04=_0x362e0d[_0x16c1('0x1c')];var _0x2a4e8b=[];for(var _0xd7c740=0x0;_0xd7c740<_0x17ee04['length'];_0xd7c740++){_0x2a4e8b['push'](_0x59280b[_0x16c1('0x90')][_0x16c1('0x91')]({'where':{'userProfileId':_0x9b3f15[_0x16c1('0x92')]['id'],'name':_0x17ee04[_0xd7c740][_0x16c1('0xc')]},'raw':!![]}));}return Promise['all'](_0x2a4e8b)[_0x16c1('0x7')](function(_0x4af66e){var _0x541cca=_['filter'](_0x4af66e,function(_0x5af80b){return _0x5af80b?_0x5af80b:undefined;});var _0x29622f=_[_0x16c1('0x6')](_0x17ee04,['ignore',!![]]);var _0x91a26d=_[_0x16c1('0x8f')](_0x541cca)&&_[_0x16c1('0x8f')](_0x29622f)?null:_[_0x16c1('0x93')](_0x29622f,_0x541cca);if(!_0x91a26d)return null;var _0xc79ac3=[];for(var _0x3700cf=0x0;_0x3700cf<_0x91a26d[_0x16c1('0x94')];_0x3700cf++){var _0x23b5a2=_[_0x16c1('0x91')](_0x17ee04,function(_0x37247d){return _0x91a26d[_0x3700cf]?_0x37247d[_0x16c1('0xc')]===_0x91a26d[_0x3700cf]['name']:null;});if(_0x23b5a2){if(_0x91a26d[_0x3700cf][_0x16c1('0x95')]){_0xc79ac3[_0x16c1('0x96')](_0x4f754f(_0x362e0d['childModel'],_0x91a26d[_0x3700cf]));}else{if(!_0x91a26d[_0x3700cf][_0x16c1('0x97')]){_0xc79ac3[_0x16c1('0x96')](_0x284797(_0x23b5a2,_0x91a26d[_0x3700cf],_0x362e0d[_0x16c1('0x16')]));}else{if(_0x23b5a2[_0x16c1('0x9')]){_0xc79ac3[_0x16c1('0x96')](_0x1d002e(_0x23b5a2,_0x91a26d[_0x3700cf]));}}}}}return Promise[_0x16c1('0x98')](_0xc79ac3);})[_0x16c1('0x7')](function(_0x489d61){var _0x2ff8bf=_0x489d61;var _0x2ac59f=null;if(_0x2ff8bf){_0x2ac59f=_0x2ff8bf['length']===0x1?_0x2ff8bf[0x0]:null;}if(!_0x2ac59f&&!_0x2ff8bf)return _0x3ba2df;var _0xdfe970=_0x59280b[_0x362e0d[_0x16c1('0x16')]]['rawAttributes'];_0x3d81a0[_0x16c1('0x9')]=_[_0x16c1('0x99')](_0xdfe970);_0x3d81a0[_0x16c1('0x85')]=_['keys'](_0x9b3f15['query']);_0x3d81a0[_0x16c1('0x9a')]=_[_0x16c1('0x9b')](_0x3d81a0[_0x16c1('0x9')],_0x3d81a0['query']);_0x5c05ad[_0x16c1('0x9c')]=_[_0x16c1('0x9b')](_0x3d81a0[_0x16c1('0x9')],qs[_0x16c1('0x9d')](_0x9b3f15[_0x16c1('0x85')][_0x16c1('0x9d')]));_0x5c05ad[_0x16c1('0x9c')]=_0x5c05ad[_0x16c1('0x9c')][_0x16c1('0x94')]?_0x5c05ad[_0x16c1('0x9c')]:_0x3d81a0[_0x16c1('0x9')];if(!_0x9b3f15['query'][_0x16c1('0x9e')](_0x16c1('0x9f'))){_0x5c05ad[_0x16c1('0xa0')]=qs[_0x16c1('0xa0')](_0x9b3f15['query'][_0x16c1('0xa0')]);_0x5c05ad['offset']=qs['offset'](_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xa1')]);}_0x5c05ad['order']=qs[_0x16c1('0xa2')](_0x9b3f15[_0x16c1('0x85')]['sort']);_0x5c05ad['where']=qs[_0x16c1('0x9a')](_[_0x16c1('0xa3')](_0x9b3f15[_0x16c1('0x85')],_0x3d81a0[_0x16c1('0x9a')]));if(_0x9b3f15['query'][_0x16c1('0x6')]){_0x5c05ad[_0x16c1('0x82')]=_[_0x16c1('0xa4')](_0x5c05ad['where'],{'$or':_[_0x16c1('0xb')](_0xdfe970,function(_0x5d4c48){if(_0x5d4c48['type'][_0x16c1('0xa5')]!==_0x16c1('0xa6')){var _0x535112={};_0x535112[_0x5d4c48[_0x16c1('0x10')]]={'$like':'%'+_0x9b3f15[_0x16c1('0x85')][_0x16c1('0x6')]+'%'};return _0x535112;}})});}var _0x29160f=[];var _0x2f01f5=null;var _0x163e90={};if(_0x2ac59f){_0x2f01f5=_['find'](_0x17ee04,[_0x16c1('0xc'),_0x2ac59f[_0x16c1('0xc')]]);if(_0x2f01f5[_0x16c1('0x10')]){_0x163e90={};if(_0x362e0d['childModel']==='AnalyticExtractedReport'){_0x163e90[_0x2f01f5['foreignKey']]=_[_0x16c1('0xb')](_0x2ac59f[_0x16c1('0x8')],'id');}else{_0x163e90[_0x2f01f5[_0x16c1('0xa7')]]=_0x2ac59f[_0x16c1('0x8')];}_0x29160f[_0x16c1('0x96')](_0x163e90);}else{_0x5c05ad[_0x16c1('0x82')]['id']=_0x2ac59f['associatedResources'];}}else{for(var _0x412d5a=0x0;_0x412d5a<_0x2ff8bf[_0x16c1('0x94')];_0x412d5a++){_0x2f01f5=_[_0x16c1('0x91')](_0x17ee04,['name',_0x2ff8bf[_0x412d5a]['name']]);if(_0x2f01f5[_0x16c1('0x10')]){_0x163e90={};_0x163e90[_0x2f01f5[_0x16c1('0xa7')]]=_0x2ff8bf[_0x412d5a][_0x16c1('0x8')];_0x29160f['push'](_0x163e90);}else{if(!_0x5c05ad[_0x16c1('0x82')]['id'])_0x5c05ad[_0x16c1('0x82')]['id']=[];_0x2ff8bf[_0x412d5a][_0x16c1('0x8')][_0x16c1('0xa8')](function(_0x47d028){_0x5c05ad[_0x16c1('0x82')]['id'][_0x16c1('0x96')](_0x47d028);});}}}if(!_[_0x16c1('0x8f')](_0x29160f)){_0x5c05ad[_0x16c1('0x82')]=_[_0x16c1('0xa4')](_0x5c05ad['where'],{'$and':{'$or':_0x29160f}});}_0x5c05ad=_[_0x16c1('0xa4')]({},_0x5c05ad,_0x9b3f15[_0x16c1('0xa9')]);if(_0x2ac59f&&!_0x2ac59f['autoAssociation']&&_0x362e0d[_0x16c1('0x16')]==='AnalyticExtractedReport'){if(_0x9b3f15['query'][_0x16c1('0xaa')]){_0x5c05ad[_0x16c1('0xab')]=[{'all':!![]}];}return _0x59280b[_0x362e0d[_0x16c1('0x16')]][_0x16c1('0xa')](_0x5c05ad)[_0x16c1('0x7')](function(_0xb0c4af){var _0x282424=[];_0xb0c4af[_0x16c1('0xa8')](function(_0xb23119){var _0x1015bc;switch(_0xb23119[_0x16c1('0xac')]){case _0x16c1('0xad'):_0x1015bc=_[_0x16c1('0x91')](_0x2ac59f['associatedResources'],function(_0x52d22e){return _0x52d22e['id']===_0xb23119['reportId']&&_0x52d22e[_0x16c1('0x12')]==='DefaultReports';});break;case _0x16c1('0xae'):_0x1015bc=_[_0x16c1('0x91')](_0x2ac59f[_0x16c1('0x8')],function(_0x4d6fb5){return _0x4d6fb5['id']===_0xb23119[_0x16c1('0x76')]&&_0x4d6fb5['type']===_0x16c1('0xaf');});break;}if(_0x1015bc)_0x282424[_0x16c1('0x96')](_0xb23119);});_0x3ba2df[_0x16c1('0xb0')]=_0x282424[_0x16c1('0x94')];_0x3ba2df[_0x16c1('0xb1')]=_0x282424;return _0x3ba2df;});}else{if(!_[_0x16c1('0x8f')](_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb2')])){_0x5c05ad[_0x16c1('0x82')]['id']=_0x5c05ad[_0x16c1('0x82')]['id']?_[_0x16c1('0x9b')](_0x5c05ad[_0x16c1('0x82')]['id'],_0x9b3f15[_0x16c1('0x85')]['ids']):_0x9b3f15[_0x16c1('0x85')]['ids'];if(_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb3')]){_0x5c05ad[_0x16c1('0xb4')]=_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb3')];}}if(_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb5')]){_0x5c05ad[_0x16c1('0x82')]=_[_0x16c1('0xa4')](_0x5c05ad[_0x16c1('0x82')],{'$and':_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb5')]});}return _0x59280b[_0x362e0d['childModel']]['count']({'where':_0x5c05ad['where']})['then'](function(_0x2241d3){_0x3ba2df[_0x16c1('0xb0')]=_0x2241d3;if(_0x9b3f15[_0x16c1('0x85')]['includeAll']){if(_0x362e0d[_0x16c1('0x16')]===_0x16c1('0x21')){_0x5c05ad[_0x16c1('0xab')]=[{'model':_0x59280b[_0x16c1('0xb6')],'as':_0x16c1('0xb7'),'attributes':['id',_0x16c1('0xc'),'color'],'required':_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb8')]?!![]:![]},{'model':_0x59280b[_0x16c1('0xb6')],'as':'ThroughTags','attributes':['id',_0x16c1('0xc'),'color'],'through':_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb8')]?{'attributes':[],'where':{'TagId':_0x9b3f15[_0x16c1('0x85')]['tag']||undefined}}:{},'required':_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb8')]?!![]:![]}];}else{_0x5c05ad[_0x16c1('0xab')]=[{'all':!![]}];}}return _0x59280b[_0x362e0d[_0x16c1('0x16')]][_0x16c1('0xa')](_0x5c05ad);})[_0x16c1('0x7')](function(_0x42d531){_0x3ba2df[_0x16c1('0xb1')]=_0x42d531;if(_0x1ae1d1===_0x16c1('0x59')&&_0x9b3f15[_0x16c1('0x85')][_0x16c1('0xb9')]===_0x16c1('0xba')){var _0x2ef720=[];for(var _0x35f8a7=0x0;_0x35f8a7<_0x3ba2df[_0x16c1('0xb1')][_0x16c1('0x94')];_0x35f8a7++){_0x2ef720[_0x16c1('0x96')](_0x8b185(_0x16c1('0xbb'),_0x3ba2df['rows'][_0x35f8a7]['dataValues']));_0x2ef720[_0x16c1('0x96')](_0x8b185(_0x16c1('0xbc'),_0x3ba2df[_0x16c1('0xb1')][_0x35f8a7][_0x16c1('0xbd')]));_0x2ef720['push'](_0x8b185(_0x16c1('0xbe'),_0x3ba2df[_0x16c1('0xb1')][_0x35f8a7][_0x16c1('0xbd')]));_0x2ef720[_0x16c1('0x96')](_0x8b185('mail',_0x3ba2df[_0x16c1('0xb1')][_0x35f8a7][_0x16c1('0xbd')]));_0x2ef720[_0x16c1('0x96')](_0x8b185(_0x16c1('0xbf'),_0x3ba2df[_0x16c1('0xb1')][_0x35f8a7][_0x16c1('0xbd')]));_0x2ef720[_0x16c1('0x96')](_0x8b185(_0x16c1('0xc0'),_0x3ba2df['rows'][_0x35f8a7][_0x16c1('0xbd')]));}return Promise[_0x16c1('0x98')](_0x2ef720)[_0x16c1('0x7')](function(){return _0x3ba2df;});}return _0x3ba2df;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d4d5f09..fce2e40 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 _0x4f81=['localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x4f81,0x1e3));var _0x14f8=function(_0x3e682d,_0x4ef863){_0x3e682d=_0x3e682d-0x0;var _0x3500e1=_0x4f81[_0x3e682d];return _0x3500e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x14f8('0x1'));var fs=require('fs');var Redis=require(_0x14f8('0x2'));var db=require(_0x14f8('0x3'))['db'];var utils=require(_0x14f8('0x4'));var logger=require(_0x14f8('0x5'))(_0x14f8('0x6'));var config=require(_0x14f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14f8('0x8')]['http']({'port':0x232a});config[_0x14f8('0x9')]=_[_0x14f8('0xa')](config['redis'],{'host':_0x14f8('0xb'),'port':0x18eb});var socket=require(_0x14f8('0xc'))(new Redis(config['redis']));require(_0x14f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x496303,_0x19a1d0,_0x40a43d){return new BPromise(function(_0xbfbf2a,_0xd10497){return client[_0x14f8('0xe')](_0x496303,_0x40a43d)[_0x14f8('0xf')](function(_0x1fa3e8){logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,_0x14f8('0x12'));logger[_0x14f8('0x13')](_0x14f8('0x14'),_0x19a1d0,'request\x20sent',JSON[_0x14f8('0x15')](_0x1fa3e8));if(_0x1fa3e8[_0x14f8('0x16')]){if(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x17')]===0x1f4){logger[_0x14f8('0x16')](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xd10497(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xbfbf2a(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}else{logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,'request\x20sent');_0xbfbf2a(_0x1fa3e8[_0x14f8('0x19')][_0x14f8('0x18')]);}})['catch'](function(_0x4f5720){logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x4f5720);_0xd10497(_0x4f5720);});});} \ No newline at end of file +var _0x06ae=['UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','request','then','info','UserProfile,\x20%s,\x20%s','debug'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var moment=require(_0xe06a('0x1'));var BPromise=require(_0xe06a('0x2'));var rs=require(_0xe06a('0x3'));var fs=require('fs');var Redis=require(_0xe06a('0x4'));var db=require(_0xe06a('0x5'))['db'];var utils=require(_0xe06a('0x6'));var logger=require(_0xe06a('0x7'))(_0xe06a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe06a('0x9')]({'port':0x232a});config[_0xe06a('0xa')]=_[_0xe06a('0xb')](config[_0xe06a('0xa')],{'host':_0xe06a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06a('0xa')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x1a9f4e,_0x4eedc5,_0x2212e2){return new BPromise(function(_0x48e52a,_0x521741){return client[_0xe06a('0xd')](_0x1a9f4e,_0x2212e2)[_0xe06a('0xe')](function(_0x574fd0){logger[_0xe06a('0xf')](_0xe06a('0x10'),_0x4eedc5,'request\x20sent');logger[_0xe06a('0x11')](_0xe06a('0x12'),_0x4eedc5,_0xe06a('0x13'),JSON['stringify'](_0x574fd0));if(_0x574fd0[_0xe06a('0x14')]){if(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x15')]===0x1f4){logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0['error'][_0xe06a('0x16')]);return _0x521741(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x16')]);}logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0[_0xe06a('0x14')]['message']);return _0x48e52a(_0x574fd0[_0xe06a('0x14')]['message']);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x4eedc5,_0xe06a('0x13'));_0x48e52a(_0x574fd0[_0xe06a('0x17')][_0xe06a('0x16')]);}})['catch'](function(_0x614743){logger[_0xe06a('0x14')]('UserProfile,\x20%s,\x20%s',_0x4eedc5,_0x614743);_0x521741(_0x614743);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 802bee0..de994da 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 _0xd267=['removeListener','length','./userProfile.events','save','remove'];(function(_0x20ca70,_0x165cd6){var _0x3d5032=function(_0x8907ad){while(--_0x8907ad){_0x20ca70['push'](_0x20ca70['shift']());}};_0x3d5032(++_0x165cd6);}(_0xd267,0xd4));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x7d26('0x0'));var events=[_0x7d26('0x1'),_0x7d26('0x2'),'update'];function createListener(_0x6226bd,_0x8e6c3e){return function(_0x6040f){_0x8e6c3e['emit'](_0x6226bd,_0x6040f);};}function removeListener(_0x228d11,_0x177776){return function(){UserProfileEvents[_0x7d26('0x3')](_0x228d11,_0x177776);};}exports['register']=function(_0x566b90){for(var _0x9dd0c2=0x0,_0x59626a=events[_0x7d26('0x4')];_0x9dd0c2<_0x59626a;_0x9dd0c2++){var _0x191aff=events[_0x9dd0c2];var _0x316471=createListener('userProfile:'+_0x191aff,_0x566b90);UserProfileEvents['on'](_0x191aff,_0x316471);}}; \ No newline at end of file +var _0x944c=['register','length','./userProfile.events','remove','update','emit','removeListener'];(function(_0x15e715,_0x5d5502){var _0x4f419f=function(_0x27722d){while(--_0x27722d){_0x15e715['push'](_0x15e715['shift']());}};_0x4f419f(++_0x5d5502);}(_0x944c,0x1de));var _0xc944=function(_0x9e3354,_0x53a6f9){_0x9e3354=_0x9e3354-0x0;var _0x312a11=_0x944c[_0x9e3354];return _0x312a11;};'use strict';var UserProfileEvents=require(_0xc944('0x0'));var events=['save',_0xc944('0x1'),_0xc944('0x2')];function createListener(_0x4f0c4f,_0x26defe){return function(_0x20caf1){_0x26defe[_0xc944('0x3')](_0x4f0c4f,_0x20caf1);};}function removeListener(_0x288b26,_0x35e6f5){return function(){UserProfileEvents[_0xc944('0x4')](_0x288b26,_0x35e6f5);};}exports[_0xc944('0x5')]=function(_0x219ce2){for(var _0x48671e=0x0,_0x18c445=events[_0xc944('0x6')];_0x48671e<_0x18c445;_0x48671e++){var _0x5db20f=events[_0x48671e];var _0x45e7f3=createListener('userProfile:'+_0x5db20f,_0x219ce2);UserProfileEvents['on'](_0x5db20f,_0x45e7f3);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 68b6005..f3dbf4f 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 _0xda49=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1dc995,_0x5dd8f4){var _0x2cd006=function(_0x41cd9e){while(--_0x41cd9e){_0x1dc995['push'](_0x1dc995['shift']());}};_0x2cd006(++_0x5dd8f4);}(_0xda49,0x8b));var _0x9da4=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xda49[_0x599e60];return _0x468e19;};'use strict';var multer=require(_0x9da4('0x0'));var util=require(_0x9da4('0x1'));var path=require(_0x9da4('0x2'));var timeout=require('connect-timeout');var express=require(_0x9da4('0x3'));var router=express[_0x9da4('0x4')]();var fs_extra=require(_0x9da4('0x5'));var auth=require(_0x9da4('0x6'));var interaction=require(_0x9da4('0x7'));var config=require(_0x9da4('0x8'));var controller=require(_0x9da4('0x9'));router[_0x9da4('0xa')]('/',auth['isAuthenticated'](),controller[_0x9da4('0xb')]);router[_0x9da4('0xa')](_0x9da4('0xc'),auth[_0x9da4('0xd')](),controller[_0x9da4('0xe')]);router[_0x9da4('0xa')](_0x9da4('0xf'),auth[_0x9da4('0xd')](),controller[_0x9da4('0x10')]);router[_0x9da4('0x11')]('/',auth['isAuthenticated'](),controller[_0x9da4('0x12')]);router[_0x9da4('0x13')](_0x9da4('0xf'),auth['isAuthenticated'](),controller[_0x9da4('0x14')]);router[_0x9da4('0x15')](_0x9da4('0xf'),auth[_0x9da4('0xd')](),controller[_0x9da4('0x16')]);module[_0x9da4('0x17')]=router; \ No newline at end of file +var _0x3a00=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x2ffda1,_0x297ecb){var _0x59e35a=function(_0x23a128){while(--_0x23a128){_0x2ffda1['push'](_0x2ffda1['shift']());}};_0x59e35a(++_0x297ecb);}(_0x3a00,0x1a3));var _0x03a0=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x3a00[_0x261522];return _0x98a25a;};'use strict';var multer=require(_0x03a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03a0('0x1'));var express=require(_0x03a0('0x2'));var router=express[_0x03a0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x03a0('0x4'));var interaction=require(_0x03a0('0x5'));var config=require(_0x03a0('0x6'));var controller=require(_0x03a0('0x7'));router['get']('/',auth[_0x03a0('0x8')](),controller[_0x03a0('0x9')]);router[_0x03a0('0xa')](_0x03a0('0xb'),auth['isAuthenticated'](),controller[_0x03a0('0xc')]);router[_0x03a0('0xa')](_0x03a0('0xd'),auth['isAuthenticated'](),controller[_0x03a0('0xe')]);router[_0x03a0('0xf')]('/',auth[_0x03a0('0x8')](),controller[_0x03a0('0x10')]);router[_0x03a0('0x11')](_0x03a0('0xd'),auth[_0x03a0('0x8')](),controller[_0x03a0('0x12')]);router['delete'](_0x03a0('0xd'),auth['isAuthenticated'](),controller[_0x03a0('0x13')]);module[_0x03a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 775ba58..8da9dd6 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 _0x6909=['INTEGER','sequelize','exports','STRING'];(function(_0x29c1b1,_0x381ea7){var _0x4c9ade=function(_0x1eff58){while(--_0x1eff58){_0x29c1b1['push'](_0x29c1b1['shift']());}};_0x4c9ade(++_0x381ea7);}(_0x6909,0x17d));var _0x9690=function(_0x38d25e,_0x1ff702){_0x38d25e=_0x38d25e-0x0;var _0x1f316d=_0x6909[_0x38d25e];return _0x1f316d;};'use strict';var Sequelize=require(_0x9690('0x0'));module[_0x9690('0x1')]={'name':{'type':Sequelize[_0x9690('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9690('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x64d3=['sequelize','STRING','INTEGER'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0x64d3,0x1aa));var _0x364d=function(_0x2937ac,_0xc8b1b2){_0x2937ac=_0x2937ac-0x0;var _0x788104=_0x64d3[_0x2937ac];return _0x788104;};'use strict';var Sequelize=require(_0x364d('0x0'));module['exports']={'name':{'type':Sequelize[_0x364d('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x364d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x364d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0bcee44..547bc24 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 _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x687b,0x14a));var _0xb687=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0x687b[_0x482b06];return _0x404a0a;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file +var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x38d672,_0xc41411){var _0x33b0ca=function(_0x1022ee){while(--_0x1022ee){_0x38d672['push'](_0x38d672['shift']());}};_0x33b0ca(++_0xc41411);}(_0x7a54,0x106));var _0x47a5=function(_0x399cf8,_0x778f){_0x399cf8=_0x399cf8-0x0;var _0x2dc5d4=_0x7a54[_0x399cf8];return _0x2dc5d4;};'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['UserProfileResource'][_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['UserProfileResource']['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['UserProfileResource']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['UserProfileResource'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 8212f6b..252d8fe 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 _0xd7a2=['exports','define','user_profile_has_resources','resourceId','sectionId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x5ac739,_0xdbaf4b){var _0x2447cc=function(_0x3ed453){while(--_0x3ed453){_0x5ac739['push'](_0x5ac739['shift']());}};_0x2447cc(++_0xdbaf4b);}(_0xd7a2,0x17e));var _0x2d7a=function(_0x20fd39,_0x4e3faf){_0x20fd39=_0x20fd39-0x0;var _0x2f2af9=_0xd7a2[_0x20fd39];return _0x2f2af9;};'use strict';var _=require(_0x2d7a('0x0'));var util=require(_0x2d7a('0x1'));var logger=require('../../config/logger')(_0x2d7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d7a('0x3'));var fs=require('fs');var path=require(_0x2d7a('0x4'));var rimraf=require(_0x2d7a('0x5'));var config=require(_0x2d7a('0x6'));var attributes=require(_0x2d7a('0x7'));module[_0x2d7a('0x8')]=function(_0x57f08a,_0x28d8b9){return _0x57f08a[_0x2d7a('0x9')]('UserProfileResource',attributes,{'tableName':_0x2d7a('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x2d7a('0xb'),_0x2d7a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2149=['compositeIndex','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserProfileResource'];(function(_0x889ab5,_0x4214e4){var _0x4db94b=function(_0x4d0d9d){while(--_0x4d0d9d){_0x889ab5['push'](_0x889ab5['shift']());}};_0x4db94b(++_0x4214e4);}(_0x2149,0x1c9));var _0x9214=function(_0x504b9e,_0x3b95b4){_0x504b9e=_0x504b9e-0x0;var _0x530a04=_0x2149[_0x504b9e];return _0x530a04;};'use strict';var _=require(_0x9214('0x0'));var util=require('util');var logger=require(_0x9214('0x1'))(_0x9214('0x2'));var moment=require(_0x9214('0x3'));var BPromise=require(_0x9214('0x4'));var rp=require(_0x9214('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9214('0x6'));var config=require(_0x9214('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x9214('0x8')]=function(_0x56133d,_0x2dff8c){return _0x56133d[_0x9214('0x9')](_0x9214('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x9214('0xb'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index a28b971..2d94b06 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 _0x26f0=['../../config/logger','rpc','client','then','UserProfileResource,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x26f0,0x19a));var _0x026f=function(_0x3eb9a6,_0x5cd5f5){_0x3eb9a6=_0x3eb9a6-0x0;var _0x389665=_0x26f0[_0x3eb9a6];return _0x389665;};'use strict';var _=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var moment=require('moment');var BPromise=require(_0x026f('0x2'));var rs=require(_0x026f('0x3'));var fs=require('fs');var Redis=require(_0x026f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x026f('0x5'));var logger=require(_0x026f('0x6'))(_0x026f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x026f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8936b,_0x52a942,_0x484264){return new BPromise(function(_0x206d4c,_0x1e2241){return client['request'](_0xd8936b,_0x484264)[_0x026f('0x9')](function(_0x38900b){logger['info'](_0x026f('0xa'),_0x52a942,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x52a942,'request\x20sent',JSON['stringify'](_0x38900b));if(_0x38900b['error']){if(_0x38900b[_0x026f('0xb')][_0x026f('0xc')]===0x1f4){logger[_0x026f('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x52a942,_0x38900b[_0x026f('0xb')][_0x026f('0xd')]);return _0x1e2241(_0x38900b[_0x026f('0xb')]['message']);}logger[_0x026f('0xb')](_0x026f('0xa'),_0x52a942,_0x38900b['error'][_0x026f('0xd')]);return _0x206d4c(_0x38900b['error'][_0x026f('0xd')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x52a942,'request\x20sent');_0x206d4c(_0x38900b[_0x026f('0xe')]['message']);}})[_0x026f('0xf')](function(_0x470cd4){logger['error'](_0x026f('0xa'),_0x52a942,_0x470cd4);_0x1e2241(_0x470cd4);});});} \ No newline at end of file +var _0x553d=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x553d,0x192));var _0xd553=function(_0x281bc8,_0x570aad){_0x281bc8=_0x281bc8-0x0;var _0x1d35b4=_0x553d[_0x281bc8];return _0x1d35b4;};'use strict';var _=require(_0xd553('0x0'));var util=require('util');var moment=require(_0xd553('0x1'));var BPromise=require(_0xd553('0x2'));var rs=require(_0xd553('0x3'));var fs=require('fs');var Redis=require(_0xd553('0x4'));var db=require(_0xd553('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd553('0x6'));var config=require('../../config/environment');var jayson=require(_0xd553('0x7'));var client=jayson['client'][_0xd553('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ce4f4,_0xea700a,_0x134d71){return new BPromise(function(_0x5bd6ab,_0x317e08){return client[_0xd553('0x9')](_0x5ce4f4,_0x134d71)[_0xd553('0xa')](function(_0x4f1cd3){logger[_0xd553('0xb')](_0xd553('0xc'),_0xea700a,_0xd553('0xd'));logger[_0xd553('0xe')](_0xd553('0xf'),_0xea700a,_0xd553('0xd'),JSON[_0xd553('0x10')](_0x4f1cd3));if(_0x4f1cd3[_0xd553('0x11')]){if(_0x4f1cd3[_0xd553('0x11')][_0xd553('0x12')]===0x1f4){logger['error'](_0xd553('0xc'),_0xea700a,_0x4f1cd3[_0xd553('0x11')][_0xd553('0x13')]);return _0x317e08(_0x4f1cd3[_0xd553('0x11')]['message']);}logger[_0xd553('0x11')](_0xd553('0xc'),_0xea700a,_0x4f1cd3['error'][_0xd553('0x13')]);return _0x5bd6ab(_0x4f1cd3[_0xd553('0x11')]['message']);}else{logger[_0xd553('0xb')](_0xd553('0xc'),_0xea700a,_0xd553('0xd'));_0x5bd6ab(_0x4f1cd3[_0xd553('0x14')]['message']);}})[_0xd553('0x15')](function(_0x103ab0){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xea700a,_0x103ab0);_0x317e08(_0x103ab0);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 33db571..6db2d26 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 _0x32e0=['multer','util','express','../../components/auth/service','./userProfileSection.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e0,0xa5));var _0x032e=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x32e0[_0x57fa7e];return _0x320671;};'use strict';var multer=require(_0x032e('0x0'));var util=require(_0x032e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x032e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x032e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x032e('0x4'));router[_0x032e('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x032e('0x6'),auth['isAuthenticated'](),controller[_0x032e('0x7')]);router[_0x032e('0x5')](_0x032e('0x8'),auth[_0x032e('0x9')](),controller[_0x032e('0xa')]);router[_0x032e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x032e('0xc')](_0x032e('0x8'),auth[_0x032e('0x9')](),controller[_0x032e('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x032e('0xe')]);module['exports']=router; \ No newline at end of file +var _0x22d9=['isAuthenticated','/describe','show','create','put','/:id','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x5a3202,_0x4a9c0d){var _0xb4cf2=function(_0x169a51){while(--_0x169a51){_0x5a3202['push'](_0x5a3202['shift']());}};_0xb4cf2(++_0x4a9c0d);}(_0x22d9,0x1e5));var _0x922d=function(_0x505f50,_0x1f6978){_0x505f50=_0x505f50-0x0;var _0x235de6=_0x22d9[_0x505f50];return _0x235de6;};'use strict';var multer=require(_0x922d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x922d('0x1'));var router=express[_0x922d('0x2')]();var fs_extra=require(_0x922d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x922d('0x4'));var config=require(_0x922d('0x5'));var controller=require(_0x922d('0x6'));router[_0x922d('0x7')]('/',auth[_0x922d('0x8')](),controller['index']);router[_0x922d('0x7')](_0x922d('0x9'),auth[_0x922d('0x8')](),controller['describe']);router['get']('/:id',auth[_0x922d('0x8')](),controller[_0x922d('0xa')]);router['post']('/',auth[_0x922d('0x8')](),controller[_0x922d('0xb')]);router[_0x922d('0xc')](_0x922d('0xd'),auth[_0x922d('0x8')](),controller[_0x922d('0xe')]);router[_0x922d('0xf')](_0x922d('0xd'),auth[_0x922d('0x8')](),controller['destroy']);module[_0x922d('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 771ea13..710b6be 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 _0x9354=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x9354,0x96));var _0x4935=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x9354[_0x1eb585];return _0x497ee2;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4935('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4935('0x1')],'set':function(_0x5327fc){this[_0x4935('0x4')](_0x4935('0x5'),_0x5327fc?_0x5327fc[_0x4935('0x6')](''):[]);},'get':function(){return this[_0x4935('0x7')](_0x4935('0x5'))?this[_0x4935('0x7')](_0x4935('0x5'))[_0x4935('0x8')](''):[];}}}; \ No newline at end of file +var _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0x7d25,0x8a));var _0x57d2=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x7d25[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d0b3f4c..7f3af7a 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 _0xda5b=['filters','filter','merge','type','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where'];(function(_0x281e02,_0x2c2889){var _0x52df67=function(_0x294473){while(--_0x294473){_0x281e02['push'](_0x281e02['shift']());}};_0x52df67(++_0x2c2889);}(_0xda5b,0x1d3));var _0xbda5=function(_0x6f9e6c,_0x5ef730){_0x6f9e6c=_0x6f9e6c-0x0;var _0x20a1a0=_0xda5b[_0x6f9e6c];return _0x20a1a0;};'use strict';var emlformat=require(_0xbda5('0x0'));var rimraf=require(_0xbda5('0x1'));var zipdir=require(_0xbda5('0x2'));var jsonpatch=require(_0xbda5('0x3'));var rp=require(_0xbda5('0x4'));var moment=require('moment');var BPromise=require(_0xbda5('0x5'));var Mustache=require(_0xbda5('0x6'));var util=require(_0xbda5('0x7'));var path=require(_0xbda5('0x8'));var sox=require(_0xbda5('0x9'));var csv=require('to-csv');var ejs=require(_0xbda5('0xa'));var fs=require('fs');var fs_extra=require(_0xbda5('0xb'));var _=require(_0xbda5('0xc'));var squel=require(_0xbda5('0xd'));var crypto=require(_0xbda5('0xe'));var jsforce=require(_0xbda5('0xf'));var deskjs=require(_0xbda5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbda5('0x11'));var Redis=require(_0xbda5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbda5('0x13'));var as=require(_0xbda5('0x14'));var hardwareService=require(_0xbda5('0x15'));var logger=require(_0xbda5('0x16'))('api');var utils=require(_0xbda5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbda5('0x18'))['db'];function respondWithStatusCode(_0xe4e2ee,_0x1d574c){_0x1d574c=_0x1d574c||0xcc;return function(_0x50073e){if(_0x50073e){return _0xe4e2ee['sendStatus'](_0x1d574c);}return _0xe4e2ee[_0xbda5('0x19')](_0x1d574c)[_0xbda5('0x1a')]();};}function respondWithResult(_0x2ec0d8,_0x3e18ab){_0x3e18ab=_0x3e18ab||0xc8;return function(_0x471225){if(_0x471225){return _0x2ec0d8[_0xbda5('0x19')](_0x3e18ab)['json'](_0x471225);}};}function respondWithFilteredResult(_0x2fb5e7,_0x2c45ff){return function(_0x1d00b9){if(_0x1d00b9){var _0x3106d7=typeof _0x2c45ff[_0xbda5('0x1b')]==='undefined'&&typeof _0x2c45ff[_0xbda5('0x1c')]==='undefined';var _0x1f3a13=_0x1d00b9['count'];var _0x12a9d1=_0x3106d7?0x0:_0x2c45ff[_0xbda5('0x1b')];var _0x82b21d=_0x3106d7?_0x1d00b9['count']:_0x2c45ff[_0xbda5('0x1b')]+_0x2c45ff[_0xbda5('0x1c')];var _0x345fb4;if(_0x82b21d>=_0x1f3a13){_0x82b21d=_0x1f3a13;_0x345fb4=0xc8;}else{_0x345fb4=0xce;}_0x2fb5e7[_0xbda5('0x19')](_0x345fb4);return _0x2fb5e7[_0xbda5('0x1d')](_0xbda5('0x1e'),_0x12a9d1+'-'+_0x82b21d+'/'+_0x1f3a13)[_0xbda5('0x1f')](_0x1d00b9);}return null;};}function patchUpdates(_0xf6da1b){return function(_0x3347a6){try{jsonpatch[_0xbda5('0x20')](_0x3347a6,_0xf6da1b,!![]);}catch(_0x53de27){return BPromise[_0xbda5('0x21')](_0x53de27);}return _0x3347a6[_0xbda5('0x22')]();};}function saveUpdates(_0x2f0667,_0x51829a){return function(_0x40b0b5){if(_0x40b0b5){return _0x40b0b5[_0xbda5('0x23')](_0x2f0667)[_0xbda5('0x24')](function(_0x5e760f){return _0x5e760f;});}return null;};}function removeEntity(_0x691951,_0x3b5bb4){return function(_0x5790b8){if(_0x5790b8){return _0x5790b8[_0xbda5('0x25')]()['then'](function(){_0x691951[_0xbda5('0x19')](0xcc)[_0xbda5('0x1a')]();});}};}function handleEntityNotFound(_0x312ff5,_0x1ccdeb){return function(_0x23d63f){if(!_0x23d63f){_0x312ff5[_0xbda5('0x26')](0x194);}return _0x23d63f;};}function handleError(_0x449830,_0x3e948f){_0x3e948f=_0x3e948f||0x1f4;return function(_0x54782d){logger[_0xbda5('0x27')](_0x54782d['stack']);if(_0x54782d[_0xbda5('0x28')]){delete _0x54782d[_0xbda5('0x28')];}_0x449830['status'](_0x3e948f)[_0xbda5('0x29')](_0x54782d);};}exports[_0xbda5('0x2a')]=function(_0x1c3084,_0x1ec316){var _0x53967d={},_0x17f697={},_0x3fa4f8={'count':0x0,'rows':[]};var _0x713cd2=_[_0xbda5('0x2b')](db[_0xbda5('0x2c')][_0xbda5('0x2d')],function(_0x8417ca){return{'name':_0x8417ca[_0xbda5('0x2e')],'type':_0x8417ca['type']['key']};});_0x17f697['model']=_[_0xbda5('0x2b')](_0x713cd2,_0xbda5('0x28'));_0x17f697[_0xbda5('0x2f')]=_[_0xbda5('0x30')](_0x1c3084['query']);_0x17f697['filters']=_[_0xbda5('0x31')](_0x17f697['model'],_0x17f697[_0xbda5('0x2f')]);_0x53967d[_0xbda5('0x32')]=_[_0xbda5('0x31')](_0x17f697[_0xbda5('0x33')],qs[_0xbda5('0x34')](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x34')]));_0x53967d[_0xbda5('0x32')]=_0x53967d[_0xbda5('0x32')][_0xbda5('0x35')]?_0x53967d[_0xbda5('0x32')]:_0x17f697[_0xbda5('0x33')];if(!_0x1c3084['query']['hasOwnProperty'](_0xbda5('0x36'))){_0x53967d[_0xbda5('0x1c')]=qs[_0xbda5('0x1c')](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x1c')]);_0x53967d[_0xbda5('0x1b')]=qs[_0xbda5('0x1b')](_0x1c3084['query']['offset']);}_0x53967d[_0xbda5('0x37')]=qs['sort'](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x38')]);_0x53967d[_0xbda5('0x39')]=qs[_0xbda5('0x3a')](_['pick'](_0x1c3084['query'],_0x17f697[_0xbda5('0x3a')]),_0x713cd2);if(_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x3b')]){_0x53967d[_0xbda5('0x39')]=_[_0xbda5('0x3c')](_0x53967d[_0xbda5('0x39')],{'$or':_[_0xbda5('0x2b')](_0x713cd2,function(_0x43b025){if(_0x43b025[_0xbda5('0x3d')]!==_0xbda5('0x3e')){var _0x4de32a={};_0x4de32a[_0x43b025[_0xbda5('0x28')]]={'$like':'%'+_0x1c3084['query'][_0xbda5('0x3b')]+'%'};return _0x4de32a;}})});}_0x53967d=_[_0xbda5('0x3c')]({},_0x53967d,_0x1c3084[_0xbda5('0x3f')]);var _0x4e796f={'where':_0x53967d[_0xbda5('0x39')]};return db[_0xbda5('0x2c')][_0xbda5('0x40')](_0x4e796f)[_0xbda5('0x24')](function(_0x506ed0){_0x3fa4f8[_0xbda5('0x40')]=_0x506ed0;if(_0x1c3084['query'][_0xbda5('0x41')]){_0x53967d['include']=[{'all':!![]}];}return db[_0xbda5('0x2c')]['findAll'](_0x53967d);})[_0xbda5('0x24')](function(_0x1e416f){_0x3fa4f8[_0xbda5('0x42')]=_0x1e416f;return _0x3fa4f8;})[_0xbda5('0x24')](respondWithFilteredResult(_0x1ec316,_0x53967d))[_0xbda5('0x43')](handleError(_0x1ec316,null));};exports[_0xbda5('0x44')]=function(_0x545dbd,_0x6211be){var _0x517c14={'raw':![],'where':{'id':_0x545dbd[_0xbda5('0x45')]['id']}},_0x2b38cf={};_0x2b38cf[_0xbda5('0x33')]=_['keys'](db[_0xbda5('0x2c')]['rawAttributes']);_0x2b38cf[_0xbda5('0x2f')]=_['keys'](_0x545dbd[_0xbda5('0x2f')]);_0x2b38cf[_0xbda5('0x3a')]=_[_0xbda5('0x31')](_0x2b38cf['model'],_0x2b38cf['query']);_0x517c14[_0xbda5('0x32')]=_[_0xbda5('0x31')](_0x2b38cf[_0xbda5('0x33')],qs[_0xbda5('0x34')](_0x545dbd[_0xbda5('0x2f')]['fields']));_0x517c14[_0xbda5('0x32')]=_0x517c14[_0xbda5('0x32')][_0xbda5('0x35')]?_0x517c14[_0xbda5('0x32')]:_0x2b38cf[_0xbda5('0x33')];if(_0x545dbd[_0xbda5('0x2f')][_0xbda5('0x41')]){_0x517c14[_0xbda5('0x46')]=[{'all':!![]}];}_0x517c14=_['merge']({},_0x517c14,_0x545dbd[_0xbda5('0x3f')]);return db[_0xbda5('0x2c')]['find'](_0x517c14)[_0xbda5('0x24')](handleEntityNotFound(_0x6211be,null))[_0xbda5('0x24')](respondWithResult(_0x6211be,null))[_0xbda5('0x43')](handleError(_0x6211be,null));};exports[_0xbda5('0x47')]=function(_0x185245,_0x188f5b){return db[_0xbda5('0x2c')][_0xbda5('0x47')](_0x185245[_0xbda5('0x48')],{})[_0xbda5('0x24')](respondWithResult(_0x188f5b,0xc9))['catch'](handleError(_0x188f5b,null));};exports[_0xbda5('0x23')]=function(_0x2dce48,_0x286ee6){if(_0x2dce48[_0xbda5('0x48')]['id']){delete _0x2dce48[_0xbda5('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x2dce48['params']['id']}})[_0xbda5('0x24')](handleEntityNotFound(_0x286ee6,null))[_0xbda5('0x24')](saveUpdates(_0x2dce48[_0xbda5('0x48')],null))[_0xbda5('0x24')](respondWithResult(_0x286ee6,null))[_0xbda5('0x43')](handleError(_0x286ee6,null));};exports['destroy']=function(_0xb9440d,_0x29f98f){return db[_0xbda5('0x2c')][_0xbda5('0x49')]({'where':{'id':_0xb9440d[_0xbda5('0x45')]['id']}})[_0xbda5('0x24')](handleEntityNotFound(_0x29f98f,null))[_0xbda5('0x24')](removeEntity(_0x29f98f,null))[_0xbda5('0x43')](handleError(_0x29f98f,null));};exports['describe']=function(_0x262d6f,_0x15a537){return db['UserProfileSection'][_0xbda5('0x4a')]()[_0xbda5('0x24')](respondWithResult(_0x15a537,null))[_0xbda5('0x43')](handleError(_0x15a537,null));}; \ No newline at end of file +var _0xdcff=['VIRTUAL','merge','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','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','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter'];(function(_0x1b0092,_0x3d344b){var _0x199073=function(_0x3733fc){while(--_0x3733fc){_0x1b0092['push'](_0x1b0092['shift']());}};_0x199073(++_0x3d344b);}(_0xdcff,0x1c4));var _0xfdcf=function(_0x172703,_0x179101){_0x172703=_0x172703-0x0;var _0x11b24c=_0xdcff[_0x172703];return _0x11b24c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdcf('0x0'));var zipdir=require(_0xfdcf('0x1'));var jsonpatch=require(_0xfdcf('0x2'));var rp=require(_0xfdcf('0x3'));var moment=require(_0xfdcf('0x4'));var BPromise=require(_0xfdcf('0x5'));var Mustache=require(_0xfdcf('0x6'));var util=require('util');var path=require(_0xfdcf('0x7'));var sox=require(_0xfdcf('0x8'));var csv=require(_0xfdcf('0x9'));var ejs=require(_0xfdcf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfdcf('0xb'));var crypto=require('crypto');var jsforce=require(_0xfdcf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfdcf('0x9'));var querystring=require('querystring');var Papa=require(_0xfdcf('0xd'));var Redis=require(_0xfdcf('0xe'));var authService=require(_0xfdcf('0xf'));var qs=require(_0xfdcf('0x10'));var as=require(_0xfdcf('0x11'));var hardwareService=require(_0xfdcf('0x12'));var logger=require(_0xfdcf('0x13'))('api');var utils=require(_0xfdcf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfdcf('0x15'));var db=require(_0xfdcf('0x16'))['db'];function respondWithStatusCode(_0x2abf7d,_0xe730f8){_0xe730f8=_0xe730f8||0xcc;return function(_0x4f21f0){if(_0x4f21f0){return _0x2abf7d[_0xfdcf('0x17')](_0xe730f8);}return _0x2abf7d['status'](_0xe730f8)['end']();};}function respondWithResult(_0xb1502c,_0x591ebc){_0x591ebc=_0x591ebc||0xc8;return function(_0x32b9d5){if(_0x32b9d5){return _0xb1502c[_0xfdcf('0x18')](_0x591ebc)[_0xfdcf('0x19')](_0x32b9d5);}};}function respondWithFilteredResult(_0x54eb76,_0x55b9cf){return function(_0x3d77e5){if(_0x3d77e5){var _0x10a670=typeof _0x55b9cf[_0xfdcf('0x1a')]===_0xfdcf('0x1b')&&typeof _0x55b9cf[_0xfdcf('0x1c')]==='undefined';var _0x210620=_0x3d77e5[_0xfdcf('0x1d')];var _0x4bfe4b=_0x10a670?0x0:_0x55b9cf['offset'];var _0x74f5d3=_0x10a670?_0x3d77e5[_0xfdcf('0x1d')]:_0x55b9cf['offset']+_0x55b9cf[_0xfdcf('0x1c')];var _0x1861c5;if(_0x74f5d3>=_0x210620){_0x74f5d3=_0x210620;_0x1861c5=0xc8;}else{_0x1861c5=0xce;}_0x54eb76[_0xfdcf('0x18')](_0x1861c5);return _0x54eb76[_0xfdcf('0x1e')](_0xfdcf('0x1f'),_0x4bfe4b+'-'+_0x74f5d3+'/'+_0x210620)['json'](_0x3d77e5);}return null;};}function patchUpdates(_0x21266e){return function(_0x7ad855){try{jsonpatch['apply'](_0x7ad855,_0x21266e,!![]);}catch(_0x4bde67){return BPromise[_0xfdcf('0x20')](_0x4bde67);}return _0x7ad855['save']();};}function saveUpdates(_0x56f304,_0x41e901){return function(_0x2db769){if(_0x2db769){return _0x2db769[_0xfdcf('0x21')](_0x56f304)['then'](function(_0x283bbd){return _0x283bbd;});}return null;};}function removeEntity(_0x237f53,_0x5b4d6c){return function(_0x2b5de8){if(_0x2b5de8){return _0x2b5de8[_0xfdcf('0x22')]()[_0xfdcf('0x23')](function(){_0x237f53[_0xfdcf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490c17,_0x2b7b37){return function(_0x5af58f){if(!_0x5af58f){_0x490c17['sendStatus'](0x194);}return _0x5af58f;};}function handleError(_0x4cc2b5,_0x383eab){_0x383eab=_0x383eab||0x1f4;return function(_0x5c3128){logger[_0xfdcf('0x24')](_0x5c3128[_0xfdcf('0x25')]);if(_0x5c3128['name']){delete _0x5c3128[_0xfdcf('0x26')];}_0x4cc2b5[_0xfdcf('0x18')](_0x383eab)[_0xfdcf('0x27')](_0x5c3128);};}exports[_0xfdcf('0x28')]=function(_0x517b20,_0x9d65be){var _0x547e1f={},_0x4a13e3={},_0x586cb4={'count':0x0,'rows':[]};var _0x565f83=_['map'](db['UserProfileSection'][_0xfdcf('0x29')],function(_0x5b2b90){return{'name':_0x5b2b90[_0xfdcf('0x2a')],'type':_0x5b2b90[_0xfdcf('0x2b')][_0xfdcf('0x2c')]};});_0x4a13e3[_0xfdcf('0x2d')]=_[_0xfdcf('0x2e')](_0x565f83,_0xfdcf('0x26'));_0x4a13e3[_0xfdcf('0x2f')]=_[_0xfdcf('0x30')](_0x517b20[_0xfdcf('0x2f')]);_0x4a13e3[_0xfdcf('0x31')]=_[_0xfdcf('0x32')](_0x4a13e3[_0xfdcf('0x2d')],_0x4a13e3[_0xfdcf('0x2f')]);_0x547e1f[_0xfdcf('0x33')]=_[_0xfdcf('0x32')](_0x4a13e3['model'],qs['fields'](_0x517b20[_0xfdcf('0x2f')][_0xfdcf('0x34')]));_0x547e1f[_0xfdcf('0x33')]=_0x547e1f[_0xfdcf('0x33')][_0xfdcf('0x35')]?_0x547e1f[_0xfdcf('0x33')]:_0x4a13e3[_0xfdcf('0x2d')];if(!_0x517b20[_0xfdcf('0x2f')][_0xfdcf('0x36')](_0xfdcf('0x37'))){_0x547e1f[_0xfdcf('0x1c')]=qs['limit'](_0x517b20[_0xfdcf('0x2f')]['limit']);_0x547e1f[_0xfdcf('0x1a')]=qs[_0xfdcf('0x1a')](_0x517b20['query'][_0xfdcf('0x1a')]);}_0x547e1f['order']=qs['sort'](_0x517b20[_0xfdcf('0x2f')]['sort']);_0x547e1f[_0xfdcf('0x38')]=qs[_0xfdcf('0x31')](_[_0xfdcf('0x39')](_0x517b20[_0xfdcf('0x2f')],_0x4a13e3['filters']),_0x565f83);if(_0x517b20[_0xfdcf('0x2f')][_0xfdcf('0x3a')]){_0x547e1f[_0xfdcf('0x38')]=_['merge'](_0x547e1f[_0xfdcf('0x38')],{'$or':_['map'](_0x565f83,function(_0x183b45){if(_0x183b45[_0xfdcf('0x2b')]!==_0xfdcf('0x3b')){var _0x4d3a1c={};_0x4d3a1c[_0x183b45[_0xfdcf('0x26')]]={'$like':'%'+_0x517b20[_0xfdcf('0x2f')][_0xfdcf('0x3a')]+'%'};return _0x4d3a1c;}})});}_0x547e1f=_[_0xfdcf('0x3c')]({},_0x547e1f,_0x517b20[_0xfdcf('0x3d')]);var _0x253d72={'where':_0x547e1f[_0xfdcf('0x38')]};return db[_0xfdcf('0x3e')][_0xfdcf('0x1d')](_0x253d72)[_0xfdcf('0x23')](function(_0x297bc2){_0x586cb4[_0xfdcf('0x1d')]=_0x297bc2;if(_0x517b20[_0xfdcf('0x2f')][_0xfdcf('0x3f')]){_0x547e1f[_0xfdcf('0x40')]=[{'all':!![]}];}return db[_0xfdcf('0x3e')][_0xfdcf('0x41')](_0x547e1f);})['then'](function(_0x54cbf9){_0x586cb4[_0xfdcf('0x42')]=_0x54cbf9;return _0x586cb4;})[_0xfdcf('0x23')](respondWithFilteredResult(_0x9d65be,_0x547e1f))[_0xfdcf('0x43')](handleError(_0x9d65be,null));};exports[_0xfdcf('0x44')]=function(_0x5a29ef,_0x30b603){var _0x37520e={'raw':![],'where':{'id':_0x5a29ef[_0xfdcf('0x45')]['id']}},_0x3497f3={};_0x3497f3[_0xfdcf('0x2d')]=_[_0xfdcf('0x30')](db[_0xfdcf('0x3e')][_0xfdcf('0x29')]);_0x3497f3['query']=_[_0xfdcf('0x30')](_0x5a29ef['query']);_0x3497f3['filters']=_[_0xfdcf('0x32')](_0x3497f3[_0xfdcf('0x2d')],_0x3497f3[_0xfdcf('0x2f')]);_0x37520e[_0xfdcf('0x33')]=_['intersection'](_0x3497f3[_0xfdcf('0x2d')],qs[_0xfdcf('0x34')](_0x5a29ef[_0xfdcf('0x2f')][_0xfdcf('0x34')]));_0x37520e[_0xfdcf('0x33')]=_0x37520e[_0xfdcf('0x33')][_0xfdcf('0x35')]?_0x37520e['attributes']:_0x3497f3[_0xfdcf('0x2d')];if(_0x5a29ef[_0xfdcf('0x2f')][_0xfdcf('0x3f')]){_0x37520e[_0xfdcf('0x40')]=[{'all':!![]}];}_0x37520e=_['merge']({},_0x37520e,_0x5a29ef[_0xfdcf('0x3d')]);return db['UserProfileSection'][_0xfdcf('0x46')](_0x37520e)[_0xfdcf('0x23')](handleEntityNotFound(_0x30b603,null))[_0xfdcf('0x23')](respondWithResult(_0x30b603,null))[_0xfdcf('0x43')](handleError(_0x30b603,null));};exports['create']=function(_0x507423,_0x158667){return db['UserProfileSection']['create'](_0x507423[_0xfdcf('0x47')],{})[_0xfdcf('0x23')](respondWithResult(_0x158667,0xc9))[_0xfdcf('0x43')](handleError(_0x158667,null));};exports[_0xfdcf('0x21')]=function(_0xe92135,_0x56ca5d){if(_0xe92135[_0xfdcf('0x47')]['id']){delete _0xe92135[_0xfdcf('0x47')]['id'];}return db[_0xfdcf('0x3e')][_0xfdcf('0x46')]({'where':{'id':_0xe92135[_0xfdcf('0x45')]['id']}})[_0xfdcf('0x23')](handleEntityNotFound(_0x56ca5d,null))[_0xfdcf('0x23')](saveUpdates(_0xe92135[_0xfdcf('0x47')],null))[_0xfdcf('0x23')](respondWithResult(_0x56ca5d,null))['catch'](handleError(_0x56ca5d,null));};exports[_0xfdcf('0x22')]=function(_0x1fbbeb,_0x313e4f){return db[_0xfdcf('0x3e')][_0xfdcf('0x46')]({'where':{'id':_0x1fbbeb[_0xfdcf('0x45')]['id']}})[_0xfdcf('0x23')](handleEntityNotFound(_0x313e4f,null))['then'](removeEntity(_0x313e4f,null))[_0xfdcf('0x43')](handleError(_0x313e4f,null));};exports[_0xfdcf('0x48')]=function(_0x483e59,_0x260028){return db['UserProfileSection']['describe']()[_0xfdcf('0x23')](respondWithResult(_0x260028,null))[_0xfdcf('0x43')](handleError(_0x260028,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d03a20e..6cd3c25 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 _0xdc61=['compositeIndex','sectionId','userProfileId','lodash','moment','bluebird','path','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x15e9a8,_0x35a295){var _0xdab359=function(_0xcc9899){while(--_0xcc9899){_0x15e9a8['push'](_0x15e9a8['shift']());}};_0xdab359(++_0x35a295);}(_0xdc61,0x7b));var _0x1dc6=function(_0x4b1a67,_0x1e9406){_0x4b1a67=_0x4b1a67-0x0;var _0x50d54e=_0xdc61[_0x4b1a67];return _0x50d54e;};'use strict';var _=require(_0x1dc6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1dc6('0x1'));var BPromise=require(_0x1dc6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1dc6('0x3'));var rimraf=require('rimraf');var config=require(_0x1dc6('0x4'));var attributes=require(_0x1dc6('0x5'));module[_0x1dc6('0x6')]=function(_0x569c34,_0x64be6b){return _0x569c34['define'](_0x1dc6('0x7'),attributes,{'tableName':_0x1dc6('0x8'),'paranoid':![],'indexes':[{'name':_0x1dc6('0x9'),'fields':[_0x1dc6('0xa'),_0x1dc6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34c1=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','compositeIndex','userProfileId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34c1,0x16c));var _0x134c=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0x34c1[_0x33ac75];return _0x34d5f2;};'use strict';var _=require(_0x134c('0x0'));var util=require(_0x134c('0x1'));var logger=require('../../config/logger')(_0x134c('0x2'));var moment=require(_0x134c('0x3'));var BPromise=require(_0x134c('0x4'));var rp=require(_0x134c('0x5'));var fs=require('fs');var path=require(_0x134c('0x6'));var rimraf=require(_0x134c('0x7'));var config=require(_0x134c('0x8'));var attributes=require('./userProfileSection.attributes');module[_0x134c('0x9')]=function(_0x4305f1,_0x5718d6){return _0x4305f1[_0x134c('0xa')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x134c('0xb'),'fields':['sectionId',_0x134c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 21b539b..b4ab4a5 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 _0x6c41=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d3d7b,_0x5c0937){var _0x33e7c8=function(_0xe0ee81){while(--_0xe0ee81){_0x3d3d7b['push'](_0x3d3d7b['shift']());}};_0x33e7c8(++_0x5c0937);}(_0x6c41,0x151));var _0x16c4=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x6c41[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x16c4('0x0'));var util=require(_0x16c4('0x1'));var moment=require('moment');var BPromise=require(_0x16c4('0x2'));var rs=require(_0x16c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16c4('0x4'))['db'];var utils=require(_0x16c4('0x5'));var logger=require(_0x16c4('0x6'))('rpc');var config=require(_0x16c4('0x7'));var jayson=require(_0x16c4('0x8'));var client=jayson['client'][_0x16c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c4ee2,_0x59fbe6,_0x56c378){return new BPromise(function(_0x5327f0,_0x58c6e8){return client[_0x16c4('0xa')](_0x5c4ee2,_0x56c378)[_0x16c4('0xb')](function(_0x41a9df){logger['info'](_0x16c4('0xc'),_0x59fbe6,_0x16c4('0xd'));logger[_0x16c4('0xe')](_0x16c4('0xf'),_0x59fbe6,_0x16c4('0xd'),JSON[_0x16c4('0x10')](_0x41a9df));if(_0x41a9df[_0x16c4('0x11')]){if(_0x41a9df['error'][_0x16c4('0x12')]===0x1f4){logger[_0x16c4('0x11')](_0x16c4('0xc'),_0x59fbe6,_0x41a9df[_0x16c4('0x11')]['message']);return _0x58c6e8(_0x41a9df[_0x16c4('0x11')][_0x16c4('0x13')]);}logger[_0x16c4('0x11')](_0x16c4('0xc'),_0x59fbe6,_0x41a9df['error'][_0x16c4('0x13')]);return _0x5327f0(_0x41a9df[_0x16c4('0x11')][_0x16c4('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x59fbe6,'request\x20sent');_0x5327f0(_0x41a9df[_0x16c4('0x14')][_0x16c4('0x13')]);}})[_0x16c4('0x15')](function(_0x2ea322){logger[_0x16c4('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x59fbe6,_0x2ea322);_0x58c6e8(_0x2ea322);});});} \ No newline at end of file +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(_0x16ccdd,_0x6c9fa3){var _0x18916d=function(_0x58dad6){while(--_0x58dad6){_0x16ccdd['push'](_0x16ccdd['shift']());}};_0x18916d(++_0x6c9fa3);}(_0xd5f7,0x16f));var _0x7d5f=function(_0x55adb5,_0x41bd54){_0x55adb5=_0x55adb5-0x0;var _0x56fb45=_0xd5f7[_0x55adb5];return _0x56fb45;};'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 diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 08e4e1d..2d633b3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x170ee8,_0x13c147){var _0x24e763=function(_0x44ed7c){while(--_0x44ed7c){_0x170ee8['push'](_0x170ee8['shift']());}};_0x24e763(++_0x13c147);}(_0xe706,0xa3));var _0x6e70=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xe706[_0x5c6299];return _0x23b564;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3d1f8e,_0x279486){var _0x3ebcb3=function(_0x544b2e){while(--_0x544b2e){_0x3d1f8e['push'](_0x3d1f8e['shift']());}};_0x3ebcb3(++_0x279486);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3885515..e374c12 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 _0xe4c0=['exports'];(function(_0x24d8db,_0x2392c6){var _0x13d20d=function(_0x568f80){while(--_0x568f80){_0x24d8db['push'](_0x24d8db['shift']());}};_0x13d20d(++_0x2392c6);}(_0xe4c0,0x1ca));var _0x0e4c=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0xe4c0[_0x7538c5];return _0x8b56be;};'use strict';var Sequelize=require('sequelize');module[_0x0e4c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x28dc=['exports','INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x28dc,0xe6));var _0xc28d=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0x28dc[_0x134448];return _0x2d52a1;};'use strict';var Sequelize=require('sequelize');module[_0xc28d('0x0')]={'penalty':{'type':Sequelize[_0xc28d('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 9d41435..096231b 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 _0xdfa0=['path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4617b1,_0x11a341){var _0x2b14dc=function(_0x4f5b20){while(--_0x4f5b20){_0x4617b1['push'](_0x4617b1['shift']());}};_0x2b14dc(++_0x11a341);}(_0xdfa0,0x69));var _0x0dfa=function(_0x10c0a2,_0x401389){_0x10c0a2=_0x10c0a2-0x0;var _0x2efe4f=_0xdfa0[_0x10c0a2];return _0x2efe4f;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var logger=require(_0x0dfa('0x1'))(_0x0dfa('0x2'));var moment=require('moment');var BPromise=require(_0x0dfa('0x3'));var rp=require(_0x0dfa('0x4'));var fs=require('fs');var path=require(_0x0dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x0dfa('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x0dfa('0x7')]=function(_0x2efe20,_0x4830b6){return _0x2efe20[_0x0dfa('0x8')](_0x0dfa('0x9'),attributes,{'tableName':_0x0dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fd4=['rimraf','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x26390f,_0x5e1005){_0x26390f=_0x26390f-0x0;var _0x3d9d11=_0x9fd4[_0x26390f];return _0x3d9d11;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var BPromise=require(_0x49fd('0x5'));var rp=require(_0x49fd('0x6'));var fs=require('fs');var path=require(_0x49fd('0x7'));var rimraf=require(_0x49fd('0x8'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x49fd('0x9')]=function(_0x42fdc7,_0x1bc16e){return _0x42fdc7[_0x49fd('0xa')]('UserSmsQueue',attributes,{'tableName':_0x49fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index a6ab621..ece8b4a 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 _0x24d7=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4d68d2,_0x1c93b1){var _0x7b8f3=function(_0x1d0d96){while(--_0x1d0d96){_0x4d68d2['push'](_0x4d68d2['shift']());}};_0x7b8f3(++_0x1c93b1);}(_0x24d7,0x198));var _0x724d=function(_0x1f6e8c,_0x362e75){_0x1f6e8c=_0x1f6e8c-0x0;var _0x414141=_0x24d7[_0x1f6e8c];return _0x414141;};'use strict';var _=require(_0x724d('0x0'));var util=require(_0x724d('0x1'));var moment=require(_0x724d('0x2'));var BPromise=require(_0x724d('0x3'));var rs=require(_0x724d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x724d('0x5'));var logger=require(_0x724d('0x6'))(_0x724d('0x7'));var config=require(_0x724d('0x8'));var jayson=require(_0x724d('0x9'));var client=jayson['client'][_0x724d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43aa64,_0x544b20,_0x4e4178){return new BPromise(function(_0x118b04,_0x560a02){return client['request'](_0x43aa64,_0x4e4178)[_0x724d('0xb')](function(_0x2be927){logger[_0x724d('0xc')](_0x724d('0xd'),_0x544b20,_0x724d('0xe'));logger[_0x724d('0xf')](_0x724d('0x10'),_0x544b20,_0x724d('0xe'),JSON[_0x724d('0x11')](_0x2be927));if(_0x2be927[_0x724d('0x12')]){if(_0x2be927[_0x724d('0x12')]['code']===0x1f4){logger[_0x724d('0x12')](_0x724d('0xd'),_0x544b20,_0x2be927[_0x724d('0x12')]['message']);return _0x560a02(_0x2be927[_0x724d('0x12')]['message']);}logger[_0x724d('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x544b20,_0x2be927[_0x724d('0x12')]['message']);return _0x118b04(_0x2be927[_0x724d('0x12')][_0x724d('0x13')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x544b20,'request\x20sent');_0x118b04(_0x2be927['result'][_0x724d('0x13')]);}})[_0x724d('0x14')](function(_0x40ba54){logger[_0x724d('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x544b20,_0x40ba54);_0x560a02(_0x40ba54);});});} \ No newline at end of file +var _0x9788=['stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3c08ea,_0x419b25){var _0x4b6e51=function(_0x4e53b3){while(--_0x4e53b3){_0x3c08ea['push'](_0x3c08ea['shift']());}};_0x4b6e51(++_0x419b25);}(_0x9788,0x15d));var _0x8978=function(_0x2cf429,_0x4f79b1){_0x2cf429=_0x2cf429-0x0;var _0x4e352f=_0x9788[_0x2cf429];return _0x4e352f;};'use strict';var _=require(_0x8978('0x0'));var util=require('util');var moment=require(_0x8978('0x1'));var BPromise=require(_0x8978('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8978('0x3'));var db=require(_0x8978('0x4'))['db'];var utils=require(_0x8978('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8978('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8978('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22f7af,_0x1ead70,_0x5b9c39){return new BPromise(function(_0x376312,_0x39d7e7){return client['request'](_0x22f7af,_0x5b9c39)[_0x8978('0x8')](function(_0x30b60c){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x1ead70,_0x8978('0x9'));logger[_0x8978('0xa')](_0x8978('0xb'),_0x1ead70,_0x8978('0x9'),JSON[_0x8978('0xc')](_0x30b60c));if(_0x30b60c[_0x8978('0xd')]){if(_0x30b60c[_0x8978('0xd')][_0x8978('0xe')]===0x1f4){logger['error'](_0x8978('0xf'),_0x1ead70,_0x30b60c[_0x8978('0xd')][_0x8978('0x10')]);return _0x39d7e7(_0x30b60c[_0x8978('0xd')][_0x8978('0x10')]);}logger[_0x8978('0xd')](_0x8978('0xf'),_0x1ead70,_0x30b60c[_0x8978('0xd')][_0x8978('0x10')]);return _0x376312(_0x30b60c[_0x8978('0xd')][_0x8978('0x10')]);}else{logger[_0x8978('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x1ead70,_0x8978('0x9'));_0x376312(_0x30b60c[_0x8978('0x12')][_0x8978('0x10')]);}})['catch'](function(_0x14d05c){logger[_0x8978('0xd')](_0x8978('0xf'),_0x1ead70,_0x14d05c);_0x39d7e7(_0x14d05c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ea92d8d..c64943e 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 _0x4a75=['exports','INTEGER','sequelize'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x4a75,0xdd));var _0x54a7=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x4a75[_0x5d7227];return _0x15ac55;};'use strict';var Sequelize=require(_0x54a7('0x0'));module[_0x54a7('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x54a7('0x2')]}}; \ No newline at end of file +var _0x9841=['exports','sequelize'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x9841,0xf7));var _0x1984=function(_0x1c4e98,_0x187001){_0x1c4e98=_0x1c4e98-0x0;var _0x1f2420=_0x9841[_0x1c4e98];return _0x1f2420;};'use strict';var Sequelize=require(_0x1984('0x0'));module[_0x1984('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c0bb480..6e9b5ab 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(_0x1108fe,_0x131a36){var _0x334e86=function(_0x381f9f){while(--_0x381f9f){_0x1108fe['push'](_0x1108fe['shift']());}};_0x334e86(++_0x131a36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x3d8807,_0x19bda0){var _0x1f9ad9=function(_0x415f3e){while(--_0x415f3e){_0x3d8807['push'](_0x3d8807['shift']());}};_0x1f9ad9(++_0x19bda0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 7a89991..ed9aeef 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5ab761,_0x3bf2d5){var _0x126dbf=function(_0x111ac0){while(--_0x111ac0){_0x5ab761['push'](_0x5ab761['shift']());}};_0x126dbf(++_0x3bf2d5);}(_0xedd9,0xfc));var _0x9edd=function(_0x67b060,_0x5b2995){_0x67b060=_0x67b060-0x0;var _0x947671=_0xedd9[_0x67b060];return _0x947671;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x94c8d3,_0x1d58ce){var _0x1ad94f=function(_0x5e3cbc){while(--_0x5e3cbc){_0x94c8d3['push'](_0x94c8d3['shift']());}};_0x1ad94f(++_0x1d58ce);}(_0xedd9,0xfc));var _0x9edd=function(_0x288ab8,_0x3ddadb){_0x288ab8=_0x288ab8-0x0;var _0x449669=_0xedd9[_0x288ab8];return _0x449669;};'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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9e3985d..0bd2d4b 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 _0xc755=['exports'];(function(_0x357526,_0x5f3b11){var _0x205f46=function(_0xf292e0){while(--_0xf292e0){_0x357526['push'](_0x357526['shift']());}};_0x205f46(++_0x5f3b11);}(_0xc755,0xd6));var _0x5c75=function(_0x79b72,_0x1772df){_0x79b72=_0x79b72-0x0;var _0x50802d=_0xc755[_0x79b72];return _0x50802d;};'use strict';var Sequelize=require('sequelize');module[_0x5c75('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0efc=['sequelize','exports'];(function(_0x12cebf,_0x26fbdd){var _0x100c9c=function(_0x2b042b){while(--_0x2b042b){_0x12cebf['push'](_0x12cebf['shift']());}};_0x100c9c(++_0x26fbdd);}(_0x0efc,0x1b2));var _0xc0ef=function(_0x421b7b,_0x566ee9){_0x421b7b=_0x421b7b-0x0;var _0x2c472c=_0x0efc[_0x421b7b];return _0x2c472c;};'use strict';var Sequelize=require(_0xc0ef('0x0'));module[_0xc0ef('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 3cdd308..32644e4 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 _0x4146=['../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1457ad,_0x5bce7d){var _0x5b384b=function(_0x154ad4){while(--_0x154ad4){_0x1457ad['push'](_0x1457ad['shift']());}};_0x5b384b(++_0x5bce7d);}(_0x4146,0x191));var _0x6414=function(_0x1f137d,_0x3773cf){_0x1f137d=_0x1f137d-0x0;var _0x237aaa=_0x4146[_0x1f137d];return _0x237aaa;};'use strict';var _=require(_0x6414('0x0'));var util=require('util');var logger=require(_0x6414('0x1'))(_0x6414('0x2'));var moment=require(_0x6414('0x3'));var BPromise=require(_0x6414('0x4'));var rp=require(_0x6414('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6414('0x6'));var config=require(_0x6414('0x7'));var attributes=require(_0x6414('0x8'));module[_0x6414('0x9')]=function(_0x5343e2,_0x595dc4){return _0x5343e2[_0x6414('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x6414('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1932=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','./userVoiceQueue.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1932,0xa8));var _0x2193=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1932[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x2193('0x0'));var util=require(_0x2193('0x1'));var logger=require(_0x2193('0x2'))(_0x2193('0x3'));var moment=require(_0x2193('0x4'));var BPromise=require('bluebird');var rp=require(_0x2193('0x5'));var fs=require('fs');var path=require(_0x2193('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2193('0x7'));module['exports']=function(_0x3aaed8,_0x3a749c){return _0x3aaed8[_0x2193('0x8')](_0x2193('0x9'),attributes,{'tableName':_0x2193('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index c4b77ee..d8e0077 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 _0x44c3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x44c3,0x95));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var moment=require(_0x344c('0x2'));var BPromise=require(_0x344c('0x3'));var rs=require(_0x344c('0x4'));var fs=require('fs');var Redis=require(_0x344c('0x5'));var db=require(_0x344c('0x6'))['db'];var utils=require(_0x344c('0x7'));var logger=require(_0x344c('0x8'))(_0x344c('0x9'));var config=require('../../config/environment');var jayson=require(_0x344c('0xa'));var client=jayson[_0x344c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb100,_0x149dff,_0x47f720){return new BPromise(function(_0xd65b9f,_0x36e08e){return client[_0x344c('0xc')](_0x1eb100,_0x47f720)['then'](function(_0xfec475){logger[_0x344c('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'));logger[_0x344c('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'),JSON[_0x344c('0x10')](_0xfec475));if(_0xfec475[_0x344c('0x11')]){if(_0xfec475[_0x344c('0x11')][_0x344c('0x12')]===0x1f4){logger['error'](_0x344c('0x13'),_0x149dff,_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);return _0x36e08e(_0xfec475['error'][_0x344c('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);return _0xd65b9f(_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);}else{logger[_0x344c('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'));_0xd65b9f(_0xfec475[_0x344c('0x15')][_0x344c('0x14')]);}})['catch'](function(_0x5cb35a){logger[_0x344c('0x11')](_0x344c('0x13'),_0x149dff,_0x5cb35a);_0x36e08e(_0x5cb35a);});});} \ No newline at end of file +var _0xbe92=['UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x14a97c,_0x56f11){var _0x5b1302=function(_0x317165){while(--_0x317165){_0x14a97c['push'](_0x14a97c['shift']());}};_0x5b1302(++_0x56f11);}(_0xbe92,0x1e9));var _0x2be9=function(_0x37a887,_0x5abb88){_0x37a887=_0x37a887-0x0;var _0x52ff95=_0xbe92[_0x37a887];return _0x52ff95;};'use strict';var _=require('lodash');var util=require(_0x2be9('0x0'));var moment=require(_0x2be9('0x1'));var BPromise=require('bluebird');var rs=require(_0x2be9('0x2'));var fs=require('fs');var Redis=require(_0x2be9('0x3'));var db=require(_0x2be9('0x4'))['db'];var utils=require(_0x2be9('0x5'));var logger=require(_0x2be9('0x6'))('rpc');var config=require(_0x2be9('0x7'));var jayson=require(_0x2be9('0x8'));var client=jayson[_0x2be9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13f8f2,_0x3fc019,_0x466c16){return new BPromise(function(_0x1108d9,_0x172ad0){return client['request'](_0x13f8f2,_0x466c16)[_0x2be9('0xa')](function(_0x5156f5){logger['info'](_0x2be9('0xb'),_0x3fc019,'request\x20sent');logger['debug'](_0x2be9('0xc'),_0x3fc019,_0x2be9('0xd'),JSON[_0x2be9('0xe')](_0x5156f5));if(_0x5156f5['error']){if(_0x5156f5[_0x2be9('0xf')][_0x2be9('0x10')]===0x1f4){logger[_0x2be9('0xf')](_0x2be9('0xb'),_0x3fc019,_0x5156f5[_0x2be9('0xf')]['message']);return _0x172ad0(_0x5156f5['error'][_0x2be9('0x11')]);}logger[_0x2be9('0xf')](_0x2be9('0xb'),_0x3fc019,_0x5156f5[_0x2be9('0xf')][_0x2be9('0x11')]);return _0x1108d9(_0x5156f5[_0x2be9('0xf')][_0x2be9('0x11')]);}else{logger[_0x2be9('0x12')](_0x2be9('0xb'),_0x3fc019,_0x2be9('0xd'));_0x1108d9(_0x5156f5['result']['message']);}})[_0x2be9('0x13')](function(_0xa79fdf){logger['error'](_0x2be9('0xb'),_0x3fc019,_0xa79fdf);_0x172ad0(_0xa79fdf);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b1f1c9d..dd1e7a9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4cd0d9,_0x3f6f68){var _0xe4133b=function(_0x3e9bce){while(--_0x3e9bce){_0x4cd0d9['push'](_0x4cd0d9['shift']());}};_0xe4133b(++_0x3f6f68);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x469101,_0x5808cf){var _0x3a92ff=function(_0x4e344b){while(--_0x4e344b){_0x469101['push'](_0x469101['shift']());}};_0x3a92ff(++_0x5808cf);}(_0xe706,0xa3));var _0x6e70=function(_0x569744,_0x30c532){_0x569744=_0x569744-0x0;var _0x57e918=_0xe706[_0x569744];return _0x57e918;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 98055a7..c5a99ff 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 _0x1771=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x18769a,_0xbb8d4c){var _0x28c59b=function(_0x4eb66f){while(--_0x4eb66f){_0x18769a['push'](_0x18769a['shift']());}};_0x28c59b(++_0xbb8d4c);}(_0x1771,0xdc));var _0x1177=function(_0x105f45,_0x1af649){_0x105f45=_0x105f45-0x0;var _0x5545d2=_0x1771[_0x105f45];return _0x5545d2;};'use strict';var Sequelize=require(_0x1177('0x0'));module[_0x1177('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1177('0x2')},'membername':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'comment':_0x1177('0x2')},'UserId':{'type':Sequelize[_0x1177('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'unique':_0x1177('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x1177('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'unique':_0x1177('0x5'),'comment':_0x1177('0x2')},'penalty':{'type':Sequelize[_0x1177('0x4')](0xb),'defaultValue':0x0,'comment':_0x1177('0x2')},'paused':{'type':Sequelize[_0x1177('0x4')](0xb),'defaultValue':0x0,'comment':_0x1177('0x2')}}; \ No newline at end of file +var _0xd021=['Required\x20by\x20Asterisk','queue_interface','sequelize','INTEGER'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xd021,0x15e));var _0x1d02=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd021[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1d02('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1d02('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1d02('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x1d02('0x2')},'UserId':{'type':Sequelize[_0x1d02('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1d02('0x3'),'comment':_0x1d02('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1d02('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1d02('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x1d02('0x2')},'paused':{'type':Sequelize[_0x1d02('0x1')](0xb),'defaultValue':0x0,'comment':_0x1d02('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 507dcdb..0df2722 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 _0xfb46=['update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb46,0xb5));var _0x6fb4=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0xfb46[_0x3bc3b4];return _0x4c546b;};'use strict';var EventEmitter=require(_0x6fb4('0x0'));var UserVoiceQueueRt=require(_0x6fb4('0x1'))['db'][_0x6fb4('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fb4('0x3'),'afterDestroy':_0x6fb4('0x4')};function emitEvent(_0x42319b){return function(_0x44a04b,_0x40aa99,_0xc3e0aa){UserVoiceQueueRtEvents[_0x6fb4('0x5')](_0x42319b+':'+_0x44a04b['id'],_0x44a04b);UserVoiceQueueRtEvents[_0x6fb4('0x5')](_0x42319b,_0x44a04b);_0xc3e0aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x6fb4('0x6')](e,emitEvent(event));}}module[_0x6fb4('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x5ee2=['hook','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5bd7d9,_0x9a830f){var _0x53c9a7=function(_0x595d9e){while(--_0x595d9e){_0x5bd7d9['push'](_0x5bd7d9['shift']());}};_0x53c9a7(++_0x9a830f);}(_0x5ee2,0x9b));var _0x25ee=function(_0x367731,_0x2bc225){_0x367731=_0x367731-0x0;var _0x174b03=_0x5ee2[_0x367731];return _0x174b03;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x25ee('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x25ee('0x1')](0x0);var events={'afterCreate':_0x25ee('0x2'),'afterUpdate':_0x25ee('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e640c){return function(_0x9d511b,_0x1fadba,_0x518420){UserVoiceQueueRtEvents[_0x25ee('0x4')](_0x2e640c+':'+_0x9d511b['id'],_0x9d511b);UserVoiceQueueRtEvents[_0x25ee('0x4')](_0x2e640c,_0x9d511b);_0x518420(null);};}for(var e in events){if(events[_0x25ee('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x25ee('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index cf4a7ba..91a3a99 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 _0x7a82=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x3b405e,_0x204e49){var _0x43891f=function(_0x5eddf1){while(--_0x5eddf1){_0x3b405e['push'](_0x3b405e['shift']());}};_0x43891f(++_0x204e49);}(_0x7a82,0xb4));var _0x27a8=function(_0x484d86,_0x5b8de8){_0x484d86=_0x484d86-0x0;var _0x3be269=_0x7a82[_0x484d86];return _0x3be269;};'use strict';var _=require(_0x27a8('0x0'));var util=require('util');var logger=require(_0x27a8('0x1'))(_0x27a8('0x2'));var moment=require('moment');var BPromise=require(_0x27a8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27a8('0x4'));var rimraf=require('rimraf');var config=require(_0x27a8('0x5'));var attributes=require(_0x27a8('0x6'));module[_0x27a8('0x7')]=function(_0x57fea5,_0x2134af){return _0x57fea5[_0x27a8('0x8')](_0x27a8('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb1=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','util','moment','bluebird'];(function(_0x2e3d82,_0x18a7f0){var _0x57ecc4=function(_0x363749){while(--_0x363749){_0x2e3d82['push'](_0x2e3d82['shift']());}};_0x57ecc4(++_0x18a7f0);}(_0x2eb1,0x102));var _0x12eb=function(_0x1d97a3,_0x5015cf){_0x1d97a3=_0x1d97a3-0x0;var _0x20e3f0=_0x2eb1[_0x1d97a3];return _0x20e3f0;};'use strict';var _=require('lodash');var util=require(_0x12eb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x12eb('0x1'));var BPromise=require(_0x12eb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12eb('0x3'));var rimraf=require(_0x12eb('0x4'));var config=require(_0x12eb('0x5'));var attributes=require(_0x12eb('0x6'));module[_0x12eb('0x7')]=function(_0x17a19c,_0x3af95a){return _0x17a19c[_0x12eb('0x8')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index e82e76c..4b441ba 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 _0x43b8=['message','UserVoiceQueueRt,\x20%s,\x20%s','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','debug','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','request','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x43b8,0xfc));var _0x843b=function(_0x2b7ffe,_0x3129be){_0x2b7ffe=_0x2b7ffe-0x0;var _0x1a009a=_0x43b8[_0x2b7ffe];return _0x1a009a;};'use strict';var _=require('lodash');var util=require(_0x843b('0x0'));var moment=require(_0x843b('0x1'));var BPromise=require('bluebird');var rs=require(_0x843b('0x2'));var fs=require('fs');var Redis=require(_0x843b('0x3'));var db=require(_0x843b('0x4'))['db'];var utils=require(_0x843b('0x5'));var logger=require('../../config/logger')(_0x843b('0x6'));var config=require('../../config/environment');var jayson=require(_0x843b('0x7'));var client=jayson[_0x843b('0x8')][_0x843b('0x9')]({'port':0x232a});config['redis']=_[_0x843b('0xa')](config[_0x843b('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x843b('0xb')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x7e0f77,_0x38fdfb,_0x40c043){return new BPromise(function(_0x4c9cdb,_0x49daf){return client[_0x843b('0xc')](_0x7e0f77,_0x40c043)[_0x843b('0xd')](function(_0x59b19e){logger[_0x843b('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38fdfb,_0x843b('0xf'));logger['debug'](_0x843b('0x10'),_0x38fdfb,_0x843b('0xf'),JSON[_0x843b('0x11')](_0x59b19e));if(_0x59b19e[_0x843b('0x12')]){if(_0x59b19e[_0x843b('0x12')][_0x843b('0x13')]===0x1f4){logger[_0x843b('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38fdfb,_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);return _0x49daf(_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);}logger[_0x843b('0x12')](_0x843b('0x15'),_0x38fdfb,_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);return _0x4c9cdb(_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);}else{logger[_0x843b('0xe')](_0x843b('0x15'),_0x38fdfb,'request\x20sent');_0x4c9cdb(_0x59b19e['result']['message']);}})['catch'](function(_0x19cda7){logger['error'](_0x843b('0x15'),_0x38fdfb,_0x19cda7);_0x49daf(_0x19cda7);});});}exports[_0x843b('0x16')]=function(_0x3a1d21){var _0x5b6ee9=this;return new Promise(function(_0x5162a2,_0x404bd3){return db[_0x843b('0x17')][_0x843b('0x18')]({'raw':_0x3a1d21['options']?_0x3a1d21[_0x843b('0x19')][_0x843b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a1d21[_0x843b('0x19')]?_0x3a1d21['options'][_0x843b('0x1b')]||null:null,'attributes':[[db[_0x843b('0x1c')]['fn'](_0x843b('0x1d'),db[_0x843b('0x1c')]['fn']('IF',db[_0x843b('0x1c')][_0x843b('0x1e')]('`paused`\x20=\x201,\x201,\x20null'))),_0x843b('0x1f')]]})[_0x843b('0xd')](function(_0x2630fc){logger[_0x843b('0xe')](_0x843b('0x16'),_0x3a1d21);logger[_0x843b('0x20')](_0x843b('0x16'),_0x3a1d21,JSON['stringify'](_0x2630fc));_0x5162a2(_0x2630fc);})[_0x843b('0x21')](function(_0x402782){logger[_0x843b('0x12')](_0x843b('0x16'),_0x402782[_0x843b('0x14')],_0x3a1d21);_0x404bd3(_0x5b6ee9[_0x843b('0x12')](0x1f4,_0x402782['message']));});});}; \ No newline at end of file +var _0x1ebb=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','literal','outboundQueuePauses','lodash','util'];(function(_0x24f885,_0x93dbf){var _0x3b4bdd=function(_0x4b4a3e){while(--_0x4b4a3e){_0x24f885['push'](_0x24f885['shift']());}};_0x3b4bdd(++_0x93dbf);}(_0x1ebb,0x1df));var _0xb1eb=function(_0x420945,_0x1b3ffc){_0x420945=_0x420945-0x0;var _0x218795=_0x1ebb[_0x420945];return _0x218795;};'use strict';var _=require(_0xb1eb('0x0'));var util=require(_0xb1eb('0x1'));var moment=require('moment');var BPromise=require(_0xb1eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1eb('0x4'));var logger=require(_0xb1eb('0x5'))(_0xb1eb('0x6'));var config=require(_0xb1eb('0x7'));var jayson=require(_0xb1eb('0x8'));var client=jayson[_0xb1eb('0x9')][_0xb1eb('0xa')]({'port':0x232a});config[_0xb1eb('0xb')]=_[_0xb1eb('0xc')](config['redis'],{'host':_0xb1eb('0xd'),'port':0x18eb});var socket=require(_0xb1eb('0xe'))(new Redis(config[_0xb1eb('0xb')]));require('./userVoiceQueueRt.socket')[_0xb1eb('0xf')](socket);function respondWithRpcPromise(_0x527069,_0x1c5c6d,_0x5a65fe){return new BPromise(function(_0x48d1d7,_0x1c0bf4){return client[_0xb1eb('0x10')](_0x527069,_0x5a65fe)[_0xb1eb('0x11')](function(_0x9f7195){logger[_0xb1eb('0x12')](_0xb1eb('0x13'),_0x1c5c6d,_0xb1eb('0x14'));logger[_0xb1eb('0x15')](_0xb1eb('0x16'),_0x1c5c6d,_0xb1eb('0x14'),JSON[_0xb1eb('0x17')](_0x9f7195));if(_0x9f7195['error']){if(_0x9f7195[_0xb1eb('0x18')][_0xb1eb('0x19')]===0x1f4){logger['error'](_0xb1eb('0x13'),_0x1c5c6d,_0x9f7195[_0xb1eb('0x18')]['message']);return _0x1c0bf4(_0x9f7195[_0xb1eb('0x18')][_0xb1eb('0x1a')]);}logger[_0xb1eb('0x18')](_0xb1eb('0x13'),_0x1c5c6d,_0x9f7195[_0xb1eb('0x18')][_0xb1eb('0x1a')]);return _0x48d1d7(_0x9f7195['error'][_0xb1eb('0x1a')]);}else{logger[_0xb1eb('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1c5c6d,_0xb1eb('0x14'));_0x48d1d7(_0x9f7195[_0xb1eb('0x1b')][_0xb1eb('0x1a')]);}})[_0xb1eb('0x1c')](function(_0xe5a7f4){logger[_0xb1eb('0x18')](_0xb1eb('0x13'),_0x1c5c6d,_0xe5a7f4);_0x1c0bf4(_0xe5a7f4);});});}exports[_0xb1eb('0x1d')]=function(_0x1af209){var _0x209ba4=this;return new Promise(function(_0x114cc3,_0x3e307a){return db['UserVoiceQueueRt'][_0xb1eb('0x1e')]({'raw':_0x1af209['options']?_0x1af209[_0xb1eb('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1af209['options']?_0x1af209['options'][_0xb1eb('0x20')]||null:null,'attributes':[[db[_0xb1eb('0x21')]['fn'](_0xb1eb('0x22'),db[_0xb1eb('0x21')]['fn']('IF',db['sequelize'][_0xb1eb('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0xb1eb('0x24')]]})[_0xb1eb('0x11')](function(_0x5827b0){logger[_0xb1eb('0x12')](_0xb1eb('0x1d'),_0x1af209);logger[_0xb1eb('0x15')]('GetVoiceQueueRtPauses',_0x1af209,JSON[_0xb1eb('0x17')](_0x5827b0));_0x114cc3(_0x5827b0);})[_0xb1eb('0x1c')](function(_0x415169){logger[_0xb1eb('0x18')]('GetVoiceQueueRtPauses',_0x415169['message'],_0x1af209);_0x3e307a(_0x209ba4[_0xb1eb('0x18')](0x1f4,_0x415169[_0xb1eb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4e1f6e4..93c475e 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 _0xba18=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register'];(function(_0x67e45e,_0x23f132){var _0x5dff4a=function(_0x37bbe4){while(--_0x37bbe4){_0x67e45e['push'](_0x67e45e['shift']());}};_0x5dff4a(++_0x23f132);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x8ba1('0x0'));var events=[_0x8ba1('0x1'),_0x8ba1('0x2'),_0x8ba1('0x3')];function createListener(_0x4070cc,_0x46f8c7){return function(_0x25144d){_0x46f8c7[_0x8ba1('0x4')](_0x4070cc,_0x25144d);};}function removeListener(_0x59c54c,_0xe3bc16){return function(){UserVoiceQueueRtEvents[_0x8ba1('0x5')](_0x59c54c,_0xe3bc16);};}exports[_0x8ba1('0x6')]=function(_0x2a9dab){for(var _0x3b107c=0x0,_0x2ffa15=events['length'];_0x3b107c<_0x2ffa15;_0x3b107c++){var _0x3a87eb=events[_0x3b107c];var _0x3d1fe7=createListener('userVoiceQueueRt:'+_0x3a87eb,_0x2a9dab);UserVoiceQueueRtEvents['on'](_0x3a87eb,_0x3d1fe7);}}; \ No newline at end of file +var _0x0619=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length'];(function(_0x17dcd1,_0x3b7ccb){var _0x12af77=function(_0x5c3bac){while(--_0x5c3bac){_0x17dcd1['push'](_0x17dcd1['shift']());}};_0x12af77(++_0x3b7ccb);}(_0x0619,0x90));var _0x9061=function(_0x53df9d,_0x2e1b80){_0x53df9d=_0x53df9d-0x0;var _0x5186e3=_0x0619[_0x53df9d];return _0x5186e3;};'use strict';var UserVoiceQueueRtEvents=require(_0x9061('0x0'));var events=[_0x9061('0x1'),_0x9061('0x2'),_0x9061('0x3')];function createListener(_0x4f2ab6,_0x3a207b){return function(_0x69e4c){_0x3a207b[_0x9061('0x4')](_0x4f2ab6,_0x69e4c);};}function removeListener(_0x1384a7,_0x1bc8ce){return function(){UserVoiceQueueRtEvents[_0x9061('0x5')](_0x1384a7,_0x1bc8ce);};}exports[_0x9061('0x6')]=function(_0x3a79a8){for(var _0xac2b69=0x0,_0x259fbd=events[_0x9061('0x7')];_0xac2b69<_0x259fbd;_0xac2b69++){var _0x5a950f=events[_0xac2b69];var _0x3ab87c=createListener('userVoiceQueueRt:'+_0x5a950f,_0x3a79a8);UserVoiceQueueRtEvents['on'](_0x5a950f,_0x3ab87c);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 8f22405..704f05f 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x59088a,_0x5262f2){var _0x1d3985=function(_0x4c1366){while(--_0x4c1366){_0x59088a['push'](_0x59088a['shift']());}};_0x1d3985(++_0x5262f2);}(_0xe706,0xa3));var _0x6e70=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0xe706[_0x332a78];return _0x537ac5;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x29ddf8,_0x3e0086){var _0x32e88b=function(_0x3ff20e){while(--_0x3ff20e){_0x29ddf8['push'](_0x29ddf8['shift']());}};_0x32e88b(++_0x3e0086);}(_0x70e0,0x17b));var _0x070e=function(_0x5186c4,_0x457707){_0x5186c4=_0x5186c4-0x0;var _0x533bd0=_0x70e0[_0x5186c4];return _0x533bd0;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 16a3960..9471864 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 _0xa0a1=['INTEGER','sequelize'];(function(_0x303ab8,_0x59e0f7){var _0x25ff0d=function(_0x314264){while(--_0x314264){_0x303ab8['push'](_0x303ab8['shift']());}};_0x25ff0d(++_0x59e0f7);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x1379eb,_0x109dca){_0x1379eb=_0x1379eb-0x0;var _0x156332=_0xa0a1[_0x1379eb];return _0x156332;};'use strict';var Sequelize=require(_0x1a0a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1a0a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9489=['INTEGER','sequelize','exports'];(function(_0x4d03d1,_0x170d7f){var _0xcbf37f=function(_0x3736c2){while(--_0x3736c2){_0x4d03d1['push'](_0x4d03d1['shift']());}};_0xcbf37f(++_0x170d7f);}(_0x9489,0xb2));var _0x9948=function(_0x456633,_0x2976da){_0x456633=_0x456633-0x0;var _0x4e3b1c=_0x9489[_0x456633];return _0x4e3b1c;};'use strict';var Sequelize=require(_0x9948('0x0'));module[_0x9948('0x1')]={'penalty':{'type':Sequelize[_0x9948('0x2')],'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 7c9a1cb..f42a867 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 _0x48ed=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash'];(function(_0x2338e3,_0x523f4e){var _0x3f19a9=function(_0x48bb39){while(--_0x48bb39){_0x2338e3['push'](_0x2338e3['shift']());}};_0x3f19a9(++_0x523f4e);}(_0x48ed,0x19f));var _0xd48e=function(_0x23e5d2,_0x415e7a){_0x23e5d2=_0x23e5d2-0x0;var _0x51ee49=_0x48ed[_0x23e5d2];return _0x51ee49;};'use strict';var _=require(_0xd48e('0x0'));var util=require(_0xd48e('0x1'));var logger=require(_0xd48e('0x2'))(_0xd48e('0x3'));var moment=require('moment');var BPromise=require(_0xd48e('0x4'));var rp=require(_0xd48e('0x5'));var fs=require('fs');var path=require(_0xd48e('0x6'));var rimraf=require(_0xd48e('0x7'));var config=require(_0xd48e('0x8'));var attributes=require(_0xd48e('0x9'));module[_0xd48e('0xa')]=function(_0x298f75,_0x862029){return _0x298f75[_0xd48e('0xb')]('UserWhatsappQueue',attributes,{'tableName':_0xd48e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad6d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','lodash'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xad6d,0x149));var _0xdad6=function(_0x4895d7,_0x1c2920){_0x4895d7=_0x4895d7-0x0;var _0xc0253b=_0xad6d[_0x4895d7];return _0xc0253b;};'use strict';var _=require(_0xdad6('0x0'));var util=require(_0xdad6('0x1'));var logger=require(_0xdad6('0x2'))('api');var moment=require(_0xdad6('0x3'));var BPromise=require(_0xdad6('0x4'));var rp=require(_0xdad6('0x5'));var fs=require('fs');var path=require(_0xdad6('0x6'));var rimraf=require(_0xdad6('0x7'));var config=require(_0xdad6('0x8'));var attributes=require(_0xdad6('0x9'));module[_0xdad6('0xa')]=function(_0x484367,_0x404754){return _0x484367['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','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 75aa833..c45a774 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 _0x4676=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4c1f0b,_0x50fa2b){var _0x5e2432=function(_0x12d38){while(--_0x12d38){_0x4c1f0b['push'](_0x4c1f0b['shift']());}};_0x5e2432(++_0x50fa2b);}(_0x4676,0x15b));var _0x6467=function(_0x460b54,_0x4a2719){_0x460b54=_0x460b54-0x0;var _0x22034b=_0x4676[_0x460b54];return _0x22034b;};'use strict';var _=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var moment=require(_0x6467('0x2'));var BPromise=require(_0x6467('0x3'));var rs=require(_0x6467('0x4'));var fs=require('fs');var Redis=require(_0x6467('0x5'));var db=require(_0x6467('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6467('0x7'))(_0x6467('0x8'));var config=require(_0x6467('0x9'));var jayson=require(_0x6467('0xa'));var client=jayson['client'][_0x6467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbd194,_0x464162,_0x4368a1){return new BPromise(function(_0x49630f,_0x3b7ae9){return client[_0x6467('0xc')](_0xbd194,_0x4368a1)[_0x6467('0xd')](function(_0x2e6af1){logger['info'](_0x6467('0xe'),_0x464162,_0x6467('0xf'));logger[_0x6467('0x10')](_0x6467('0x11'),_0x464162,_0x6467('0xf'),JSON[_0x6467('0x12')](_0x2e6af1));if(_0x2e6af1[_0x6467('0x13')]){if(_0x2e6af1[_0x6467('0x13')]['code']===0x1f4){logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x2e6af1['error'][_0x6467('0x14')]);return _0x3b7ae9(_0x2e6af1[_0x6467('0x13')][_0x6467('0x14')]);}logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x2e6af1['error'][_0x6467('0x14')]);return _0x49630f(_0x2e6af1[_0x6467('0x13')][_0x6467('0x14')]);}else{logger['info'](_0x6467('0xe'),_0x464162,_0x6467('0xf'));_0x49630f(_0x2e6af1[_0x6467('0x15')][_0x6467('0x14')]);}})[_0x6467('0x16')](function(_0x50f6e5){logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x50f6e5);_0x3b7ae9(_0x50f6e5);});});} \ No newline at end of file +var _0x6dd9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x6dd9,0x143));var _0x96dd=function(_0x1008df,_0x32a725){_0x1008df=_0x1008df-0x0;var _0x55cd48=_0x6dd9[_0x1008df];return _0x55cd48;};'use strict';var _=require(_0x96dd('0x0'));var util=require(_0x96dd('0x1'));var moment=require(_0x96dd('0x2'));var BPromise=require(_0x96dd('0x3'));var rs=require(_0x96dd('0x4'));var fs=require('fs');var Redis=require(_0x96dd('0x5'));var db=require(_0x96dd('0x6'))['db'];var utils=require(_0x96dd('0x7'));var logger=require(_0x96dd('0x8'))(_0x96dd('0x9'));var config=require(_0x96dd('0xa'));var jayson=require(_0x96dd('0xb'));var client=jayson[_0x96dd('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bba6c,_0x337b86,_0x14c855){return new BPromise(function(_0x2e86f0,_0x2a5aea){return client[_0x96dd('0xd')](_0x5bba6c,_0x14c855)['then'](function(_0x32ab73){logger[_0x96dd('0xe')](_0x96dd('0xf'),_0x337b86,_0x96dd('0x10'));logger[_0x96dd('0x11')](_0x96dd('0x12'),_0x337b86,_0x96dd('0x10'),JSON['stringify'](_0x32ab73));if(_0x32ab73[_0x96dd('0x13')]){if(_0x32ab73[_0x96dd('0x13')]['code']===0x1f4){logger[_0x96dd('0x13')](_0x96dd('0xf'),_0x337b86,_0x32ab73['error'][_0x96dd('0x14')]);return _0x2a5aea(_0x32ab73[_0x96dd('0x13')][_0x96dd('0x14')]);}logger[_0x96dd('0x13')](_0x96dd('0xf'),_0x337b86,_0x32ab73[_0x96dd('0x13')]['message']);return _0x2e86f0(_0x32ab73[_0x96dd('0x13')][_0x96dd('0x14')]);}else{logger['info'](_0x96dd('0xf'),_0x337b86,'request\x20sent');_0x2e86f0(_0x32ab73[_0x96dd('0x15')]['message']);}})[_0x96dd('0x16')](function(_0x584960){logger['error'](_0x96dd('0xf'),_0x337b86,_0x584960);_0x2a5aea(_0x584960);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index b86f41e..9729428 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 _0x4f99=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','post','create','/:id'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4f99,0x157));var _0x94f9=function(_0x224436,_0x13088b){_0x224436=_0x224436-0x0;var _0x3c694a=_0x4f99[_0x224436];return _0x3c694a;};'use strict';var multer=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var path=require('path');var timeout=require(_0x94f9('0x2'));var express=require(_0x94f9('0x3'));var router=express[_0x94f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94f9('0x5'));var interaction=require(_0x94f9('0x6'));var config=require('../../config/environment');var controller=require(_0x94f9('0x7'));router[_0x94f9('0x8')]('/',auth[_0x94f9('0x9')](),controller[_0x94f9('0xa')]);router[_0x94f9('0x8')]('/:id',auth[_0x94f9('0x9')](),controller['show']);router[_0x94f9('0xb')]('/',auth['isAuthenticated'](),controller[_0x94f9('0xc')]);router['put'](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0xe')]);router[_0x94f9('0xf')](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0ba7=['create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0x0ba7,0x16d));var _0x70ba=function(_0x33bc25,_0x45c46c){_0x33bc25=_0x33bc25-0x0;var _0x22f2bd=_0x0ba7[_0x33bc25];return _0x22f2bd;};'use strict';var multer=require(_0x70ba('0x0'));var util=require('util');var path=require(_0x70ba('0x1'));var timeout=require(_0x70ba('0x2'));var express=require(_0x70ba('0x3'));var router=express[_0x70ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x70ba('0x5'));var interaction=require(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var controller=require(_0x70ba('0x8'));router[_0x70ba('0x9')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xb')]);router[_0x70ba('0x9')](_0x70ba('0xc'),auth[_0x70ba('0xa')](),controller[_0x70ba('0xd')]);router[_0x70ba('0xe')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xf')]);router[_0x70ba('0x10')]('/:id',auth[_0x70ba('0xa')](),controller['update']);router[_0x70ba('0x11')](_0x70ba('0xc'),auth[_0x70ba('0xa')](),controller[_0x70ba('0x12')]);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 6c36ade..38acabc 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 _0x1d8d=['name','sequelize','STRING'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x1d8d,0x1e7));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1d8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1d8('0x1')],'unique':_0xd1d8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd1d8('0x1')]}}; \ No newline at end of file +var _0xd772=['STRING','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd772,0xd7));var _0x2d77=function(_0x1b5053,_0x1cca7a){_0x1b5053=_0x1b5053-0x0;var _0x378cae=_0xd772[_0x1b5053];return _0x378cae;};'use strict';var Sequelize=require('sequelize');module[_0x2d77('0x0')]={'name':{'type':Sequelize[_0x2d77('0x1')],'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 01c225f..a5b5577 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 _0xa670=['get','Variables','UserProfileResource','stack','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','name','options','Variable','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','then'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa670,0x11c));var _0x0a67=function(_0x4ad197,_0x1de072){_0x4ad197=_0x4ad197-0x0;var _0xd24a4f=_0xa670[_0x4ad197];return _0xd24a4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a67('0x0'));var jsonpatch=require(_0x0a67('0x1'));var rp=require(_0x0a67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a67('0x3'));var util=require(_0x0a67('0x4'));var path=require(_0x0a67('0x5'));var sox=require(_0x0a67('0x6'));var csv=require(_0x0a67('0x7'));var ejs=require(_0x0a67('0x8'));var fs=require('fs');var fs_extra=require(_0x0a67('0x9'));var _=require('lodash');var squel=require(_0x0a67('0xa'));var crypto=require(_0x0a67('0xb'));var jsforce=require(_0x0a67('0xc'));var deskjs=require(_0x0a67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a67('0xe'));var Papa=require(_0x0a67('0xf'));var Redis=require('ioredis');var authService=require(_0x0a67('0x10'));var qs=require(_0x0a67('0x11'));var as=require(_0x0a67('0x12'));var hardwareService=require(_0x0a67('0x13'));var logger=require('../../config/logger')(_0x0a67('0x14'));var utils=require('../../config/utils');var config=require(_0x0a67('0x15'));var licenseUtil=require(_0x0a67('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc694,_0x164907){_0x164907=_0x164907||0xcc;return function(_0x154832){if(_0x154832){return _0x2bc694[_0x0a67('0x17')](_0x164907);}return _0x2bc694[_0x0a67('0x18')](_0x164907)[_0x0a67('0x19')]();};}function respondWithResult(_0x7af112,_0x46efb0){_0x46efb0=_0x46efb0||0xc8;return function(_0x2dff7e){if(_0x2dff7e){return _0x7af112[_0x0a67('0x18')](_0x46efb0)[_0x0a67('0x1a')](_0x2dff7e);}};}function respondWithFilteredResult(_0x563a04,_0x5658fd){return function(_0x528f9b){if(_0x528f9b){var _0x4f54ab=typeof _0x5658fd[_0x0a67('0x1b')]===_0x0a67('0x1c')&&typeof _0x5658fd['limit']===_0x0a67('0x1c');var _0x1b5114=_0x528f9b[_0x0a67('0x1d')];var _0x27baf5=_0x4f54ab?0x0:_0x5658fd['offset'];var _0x15dd92=_0x4f54ab?_0x528f9b['count']:_0x5658fd[_0x0a67('0x1b')]+_0x5658fd[_0x0a67('0x1e')];var _0x5462df;if(_0x15dd92>=_0x1b5114){_0x15dd92=_0x1b5114;_0x5462df=0xc8;}else{_0x5462df=0xce;}_0x563a04['status'](_0x5462df);return _0x563a04['set'](_0x0a67('0x1f'),_0x27baf5+'-'+_0x15dd92+'/'+_0x1b5114)[_0x0a67('0x1a')](_0x528f9b);}return null;};}function patchUpdates(_0x4ecd02){return function(_0x239295){try{jsonpatch[_0x0a67('0x20')](_0x239295,_0x4ecd02,!![]);}catch(_0x4c256){return BPromise[_0x0a67('0x21')](_0x4c256);}return _0x239295['save']();};}function saveUpdates(_0x3b632e,_0x176e29){return function(_0x5114ca){if(_0x5114ca){return _0x5114ca['update'](_0x3b632e)['then'](function(_0x22ffac){return _0x22ffac;});}return null;};}function removeEntity(_0x69c295,_0x567129){return function(_0x2eb94c){if(_0x2eb94c){return _0x2eb94c[_0x0a67('0x22')]()[_0x0a67('0x23')](function(){var _0x39a907=_0x2eb94c[_0x0a67('0x24')]({'plain':!![]});var _0x1c757=_0x0a67('0x25');return db[_0x0a67('0x26')][_0x0a67('0x22')]({'where':{'type':_0x1c757,'resourceId':_0x39a907['id']}})[_0x0a67('0x23')](function(){return _0x2eb94c;});})[_0x0a67('0x23')](function(){_0x69c295[_0x0a67('0x18')](0xcc)[_0x0a67('0x19')]();});}};}function handleEntityNotFound(_0x1c1aa6,_0x35fc12){return function(_0x26c69b){if(!_0x26c69b){_0x1c1aa6['sendStatus'](0x194);}return _0x26c69b;};}function handleError(_0x4f21ee,_0x350d1c){_0x350d1c=_0x350d1c||0x1f4;return function(_0x55b4bf){logger['error'](_0x55b4bf[_0x0a67('0x27')]);if(_0x55b4bf['name']){delete _0x55b4bf['name'];}_0x4f21ee[_0x0a67('0x18')](_0x350d1c)['send'](_0x55b4bf);};}exports[_0x0a67('0x28')]=function(_0x366e1f,_0x138f43){var _0x1d33e9={},_0x3ee32e={},_0x5f296c={'count':0x0,'rows':[]};var _0x268a68=_[_0x0a67('0x29')](db['Variable'][_0x0a67('0x2a')],function(_0x270d37){return{'name':_0x270d37[_0x0a67('0x2b')],'type':_0x270d37['type'][_0x0a67('0x2c')]};});_0x3ee32e[_0x0a67('0x2d')]=_[_0x0a67('0x29')](_0x268a68,'name');_0x3ee32e[_0x0a67('0x2e')]=_['keys'](_0x366e1f[_0x0a67('0x2e')]);_0x3ee32e[_0x0a67('0x2f')]=_[_0x0a67('0x30')](_0x3ee32e['model'],_0x3ee32e['query']);_0x1d33e9[_0x0a67('0x31')]=_[_0x0a67('0x30')](_0x3ee32e[_0x0a67('0x2d')],qs[_0x0a67('0x32')](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x32')]));_0x1d33e9[_0x0a67('0x31')]=_0x1d33e9['attributes']['length']?_0x1d33e9[_0x0a67('0x31')]:_0x3ee32e['model'];if(!_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x33')](_0x0a67('0x34'))){_0x1d33e9['limit']=qs['limit'](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x1e')]);_0x1d33e9[_0x0a67('0x1b')]=qs['offset'](_0x366e1f[_0x0a67('0x2e')]['offset']);}_0x1d33e9['order']=qs[_0x0a67('0x35')](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x35')]);_0x1d33e9['where']=qs[_0x0a67('0x2f')](_[_0x0a67('0x36')](_0x366e1f['query'],_0x3ee32e[_0x0a67('0x2f')]),_0x268a68);if(_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x37')]){_0x1d33e9[_0x0a67('0x38')]=_[_0x0a67('0x39')](_0x1d33e9['where'],{'$or':_['map'](_0x268a68,function(_0x1cadf0){if(_0x1cadf0['type']!==_0x0a67('0x3a')){var _0x2a5b1c={};_0x2a5b1c[_0x1cadf0[_0x0a67('0x3b')]]={'$like':'%'+_0x366e1f['query'][_0x0a67('0x37')]+'%'};return _0x2a5b1c;}})});}_0x1d33e9=_[_0x0a67('0x39')]({},_0x1d33e9,_0x366e1f[_0x0a67('0x3c')]);var _0x6480bf={'where':_0x1d33e9[_0x0a67('0x38')]};return db[_0x0a67('0x3d')][_0x0a67('0x1d')](_0x6480bf)[_0x0a67('0x23')](function(_0x49145b){_0x5f296c[_0x0a67('0x1d')]=_0x49145b;if(_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x3e')]){_0x1d33e9[_0x0a67('0x3f')]=[{'all':!![]}];}return db[_0x0a67('0x3d')]['findAll'](_0x1d33e9);})[_0x0a67('0x23')](function(_0xa41250){_0x5f296c[_0x0a67('0x40')]=_0xa41250;return _0x5f296c;})[_0x0a67('0x23')](respondWithFilteredResult(_0x138f43,_0x1d33e9))[_0x0a67('0x41')](handleError(_0x138f43,null));};exports[_0x0a67('0x42')]=function(_0x924b6c,_0x5bbf7a){var _0x4794e4={'raw':!![],'where':{'id':_0x924b6c[_0x0a67('0x43')]['id']}},_0x1abd8e={};_0x1abd8e[_0x0a67('0x2d')]=_[_0x0a67('0x44')](db[_0x0a67('0x3d')][_0x0a67('0x2a')]);_0x1abd8e['query']=_[_0x0a67('0x44')](_0x924b6c['query']);_0x1abd8e[_0x0a67('0x2f')]=_[_0x0a67('0x30')](_0x1abd8e[_0x0a67('0x2d')],_0x1abd8e[_0x0a67('0x2e')]);_0x4794e4[_0x0a67('0x31')]=_['intersection'](_0x1abd8e[_0x0a67('0x2d')],qs[_0x0a67('0x32')](_0x924b6c[_0x0a67('0x2e')][_0x0a67('0x32')]));_0x4794e4[_0x0a67('0x31')]=_0x4794e4[_0x0a67('0x31')]['length']?_0x4794e4[_0x0a67('0x31')]:_0x1abd8e['model'];if(_0x924b6c[_0x0a67('0x2e')]['includeAll']){_0x4794e4[_0x0a67('0x3f')]=[{'all':!![]}];}_0x4794e4=_['merge']({},_0x4794e4,_0x924b6c[_0x0a67('0x3c')]);return db[_0x0a67('0x3d')][_0x0a67('0x45')](_0x4794e4)['then'](handleEntityNotFound(_0x5bbf7a,null))['then'](respondWithResult(_0x5bbf7a,null))[_0x0a67('0x41')](handleError(_0x5bbf7a,null));};exports[_0x0a67('0x46')]=function(_0x1798c0,_0x2ce854){return db[_0x0a67('0x3d')][_0x0a67('0x46')](_0x1798c0[_0x0a67('0x47')],{})['then'](function(_0x5eb837){var _0x5826f5=_0x1798c0[_0x0a67('0x48')]['get']({'plain':!![]});if(!_0x5826f5)throw new Error(_0x0a67('0x49'));if(_0x5826f5[_0x0a67('0x4a')]===_0x0a67('0x48')){var _0x42f016=_0x5eb837[_0x0a67('0x24')]({'plain':!![]});var _0x8dcfae=_0x0a67('0x25');return db[_0x0a67('0x4b')][_0x0a67('0x45')]({'where':{'name':_0x8dcfae,'userProfileId':_0x5826f5[_0x0a67('0x4c')]},'raw':!![]})['then'](function(_0x2ac9a2){if(_0x2ac9a2&&_0x2ac9a2[_0x0a67('0x4d')]===0x0){return db[_0x0a67('0x26')][_0x0a67('0x46')]({'name':_0x42f016[_0x0a67('0x3b')],'resourceId':_0x42f016['id'],'type':_0x2ac9a2[_0x0a67('0x3b')],'sectionId':_0x2ac9a2['id']},{})['then'](function(){return _0x5eb837;});}else{return _0x5eb837;}})[_0x0a67('0x41')](function(_0x4d279c){logger[_0x0a67('0x4e')](_0x0a67('0x4f'),_0x4d279c);throw _0x4d279c;});}return _0x5eb837;})[_0x0a67('0x23')](respondWithResult(_0x2ce854,0xc9))[_0x0a67('0x41')](handleError(_0x2ce854,null));};exports['update']=function(_0x5e5044,_0x1db3f5){if(_0x5e5044['body']['id']){delete _0x5e5044[_0x0a67('0x47')]['id'];}return db['Variable'][_0x0a67('0x45')]({'where':{'id':_0x5e5044[_0x0a67('0x43')]['id']}})[_0x0a67('0x23')](handleEntityNotFound(_0x1db3f5,null))[_0x0a67('0x23')](saveUpdates(_0x5e5044[_0x0a67('0x47')],null))[_0x0a67('0x23')](respondWithResult(_0x1db3f5,null))[_0x0a67('0x41')](handleError(_0x1db3f5,null));};exports[_0x0a67('0x22')]=function(_0x5c4731,_0x3c525a){return db[_0x0a67('0x3d')][_0x0a67('0x45')]({'where':{'id':_0x5c4731[_0x0a67('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c525a,null))['then'](removeEntity(_0x3c525a,null))['catch'](handleError(_0x3c525a,null));}; \ No newline at end of file +var _0xa855=['options','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','get','UserProfileSection','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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/logger','api','../../config/utils','../../config/environment','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','where','pick','filter','VIRTUAL','merge'];(function(_0x243ecd,_0x5d27ee){var _0x5e33df=function(_0x222ccb){while(--_0x222ccb){_0x243ecd['push'](_0x243ecd['shift']());}};_0x5e33df(++_0x5d27ee);}(_0xa855,0xae));var _0x5a85=function(_0x407e38,_0x30e1cb){_0x407e38=_0x407e38-0x0;var _0x996a91=_0xa855[_0x407e38];return _0x996a91;};'use strict';var emlformat=require(_0x5a85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a85('0x1'));var jsonpatch=require(_0x5a85('0x2'));var rp=require(_0x5a85('0x3'));var moment=require('moment');var BPromise=require(_0x5a85('0x4'));var Mustache=require(_0x5a85('0x5'));var util=require('util');var path=require(_0x5a85('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5a85('0x7'));var fs=require('fs');var fs_extra=require(_0x5a85('0x8'));var _=require(_0x5a85('0x9'));var squel=require(_0x5a85('0xa'));var crypto=require(_0x5a85('0xb'));var jsforce=require(_0x5a85('0xc'));var deskjs=require(_0x5a85('0xd'));var toCsv=require(_0x5a85('0xe'));var querystring=require(_0x5a85('0xf'));var Papa=require(_0x5a85('0x10'));var Redis=require(_0x5a85('0x11'));var authService=require(_0x5a85('0x12'));var qs=require(_0x5a85('0x13'));var as=require(_0x5a85('0x14'));var hardwareService=require(_0x5a85('0x15'));var logger=require(_0x5a85('0x16'))(_0x5a85('0x17'));var utils=require(_0x5a85('0x18'));var config=require(_0x5a85('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403f40,_0x3d9f84){_0x3d9f84=_0x3d9f84||0xcc;return function(_0x2b3efe){if(_0x2b3efe){return _0x403f40['sendStatus'](_0x3d9f84);}return _0x403f40['status'](_0x3d9f84)[_0x5a85('0x1a')]();};}function respondWithResult(_0x28b2b4,_0x1d5de3){_0x1d5de3=_0x1d5de3||0xc8;return function(_0x489188){if(_0x489188){return _0x28b2b4[_0x5a85('0x1b')](_0x1d5de3)[_0x5a85('0x1c')](_0x489188);}};}function respondWithFilteredResult(_0x12fe4d,_0x4cd40f){return function(_0x398d79){if(_0x398d79){var _0x454b9f=typeof _0x4cd40f['offset']===_0x5a85('0x1d')&&typeof _0x4cd40f['limit']===_0x5a85('0x1d');var _0x2f585c=_0x398d79[_0x5a85('0x1e')];var _0x4d7504=_0x454b9f?0x0:_0x4cd40f[_0x5a85('0x1f')];var _0x457859=_0x454b9f?_0x398d79[_0x5a85('0x1e')]:_0x4cd40f['offset']+_0x4cd40f[_0x5a85('0x20')];var _0x175501;if(_0x457859>=_0x2f585c){_0x457859=_0x2f585c;_0x175501=0xc8;}else{_0x175501=0xce;}_0x12fe4d['status'](_0x175501);return _0x12fe4d[_0x5a85('0x21')](_0x5a85('0x22'),_0x4d7504+'-'+_0x457859+'/'+_0x2f585c)[_0x5a85('0x1c')](_0x398d79);}return null;};}function patchUpdates(_0x20c72f){return function(_0x4a8634){try{jsonpatch[_0x5a85('0x23')](_0x4a8634,_0x20c72f,!![]);}catch(_0x389814){return BPromise['reject'](_0x389814);}return _0x4a8634['save']();};}function saveUpdates(_0xfa9698,_0x356ce3){return function(_0x2d1eaf){if(_0x2d1eaf){return _0x2d1eaf[_0x5a85('0x24')](_0xfa9698)[_0x5a85('0x25')](function(_0x5403a4){return _0x5403a4;});}return null;};}function removeEntity(_0x2a1d37,_0x21f282){return function(_0x16cd19){if(_0x16cd19){return _0x16cd19[_0x5a85('0x26')]()[_0x5a85('0x25')](function(){var _0x588ed3=_0x16cd19['get']({'plain':!![]});var _0x2cb7e2=_0x5a85('0x27');return db[_0x5a85('0x28')]['destroy']({'where':{'type':_0x2cb7e2,'resourceId':_0x588ed3['id']}})[_0x5a85('0x25')](function(){return _0x16cd19;});})['then'](function(){_0x2a1d37[_0x5a85('0x1b')](0xcc)[_0x5a85('0x1a')]();});}};}function handleEntityNotFound(_0xd73a37,_0x3a7389){return function(_0x581f68){if(!_0x581f68){_0xd73a37[_0x5a85('0x29')](0x194);}return _0x581f68;};}function handleError(_0x2e62e0,_0x4fec75){_0x4fec75=_0x4fec75||0x1f4;return function(_0x1a1e8b){logger[_0x5a85('0x2a')](_0x1a1e8b[_0x5a85('0x2b')]);if(_0x1a1e8b[_0x5a85('0x2c')]){delete _0x1a1e8b[_0x5a85('0x2c')];}_0x2e62e0[_0x5a85('0x1b')](_0x4fec75)[_0x5a85('0x2d')](_0x1a1e8b);};}exports[_0x5a85('0x2e')]=function(_0x192036,_0x23934d){var _0x40df51={},_0xf6b1ca={},_0x279f9e={'count':0x0,'rows':[]};var _0x4b3cfb=_[_0x5a85('0x2f')](db[_0x5a85('0x30')][_0x5a85('0x31')],function(_0x12ae0a){return{'name':_0x12ae0a['fieldName'],'type':_0x12ae0a[_0x5a85('0x32')][_0x5a85('0x33')]};});_0xf6b1ca[_0x5a85('0x34')]=_[_0x5a85('0x2f')](_0x4b3cfb,_0x5a85('0x2c'));_0xf6b1ca[_0x5a85('0x35')]=_[_0x5a85('0x36')](_0x192036[_0x5a85('0x35')]);_0xf6b1ca[_0x5a85('0x37')]=_['intersection'](_0xf6b1ca['model'],_0xf6b1ca[_0x5a85('0x35')]);_0x40df51[_0x5a85('0x38')]=_[_0x5a85('0x39')](_0xf6b1ca[_0x5a85('0x34')],qs[_0x5a85('0x3a')](_0x192036['query'][_0x5a85('0x3a')]));_0x40df51[_0x5a85('0x38')]=_0x40df51[_0x5a85('0x38')][_0x5a85('0x3b')]?_0x40df51['attributes']:_0xf6b1ca[_0x5a85('0x34')];if(!_0x192036[_0x5a85('0x35')]['hasOwnProperty'](_0x5a85('0x3c'))){_0x40df51['limit']=qs[_0x5a85('0x20')](_0x192036[_0x5a85('0x35')][_0x5a85('0x20')]);_0x40df51[_0x5a85('0x1f')]=qs[_0x5a85('0x1f')](_0x192036[_0x5a85('0x35')][_0x5a85('0x1f')]);}_0x40df51['order']=qs['sort'](_0x192036[_0x5a85('0x35')]['sort']);_0x40df51[_0x5a85('0x3d')]=qs[_0x5a85('0x37')](_[_0x5a85('0x3e')](_0x192036[_0x5a85('0x35')],_0xf6b1ca[_0x5a85('0x37')]),_0x4b3cfb);if(_0x192036[_0x5a85('0x35')][_0x5a85('0x3f')]){_0x40df51['where']=_['merge'](_0x40df51[_0x5a85('0x3d')],{'$or':_['map'](_0x4b3cfb,function(_0x57c7d2){if(_0x57c7d2[_0x5a85('0x32')]!==_0x5a85('0x40')){var _0x23a429={};_0x23a429[_0x57c7d2[_0x5a85('0x2c')]]={'$like':'%'+_0x192036[_0x5a85('0x35')][_0x5a85('0x3f')]+'%'};return _0x23a429;}})});}_0x40df51=_[_0x5a85('0x41')]({},_0x40df51,_0x192036[_0x5a85('0x42')]);var _0x202e11={'where':_0x40df51[_0x5a85('0x3d')]};return db['Variable'][_0x5a85('0x1e')](_0x202e11)[_0x5a85('0x25')](function(_0x4c33b0){_0x279f9e[_0x5a85('0x1e')]=_0x4c33b0;if(_0x192036['query']['includeAll']){_0x40df51['include']=[{'all':!![]}];}return db[_0x5a85('0x30')][_0x5a85('0x43')](_0x40df51);})['then'](function(_0xf637a1){_0x279f9e[_0x5a85('0x44')]=_0xf637a1;return _0x279f9e;})[_0x5a85('0x25')](respondWithFilteredResult(_0x23934d,_0x40df51))[_0x5a85('0x45')](handleError(_0x23934d,null));};exports[_0x5a85('0x46')]=function(_0x5c2ca2,_0x60b907){var _0x2f9efd={'raw':!![],'where':{'id':_0x5c2ca2[_0x5a85('0x47')]['id']}},_0x535e31={};_0x535e31[_0x5a85('0x34')]=_[_0x5a85('0x36')](db[_0x5a85('0x30')][_0x5a85('0x31')]);_0x535e31[_0x5a85('0x35')]=_[_0x5a85('0x36')](_0x5c2ca2[_0x5a85('0x35')]);_0x535e31[_0x5a85('0x37')]=_['intersection'](_0x535e31[_0x5a85('0x34')],_0x535e31[_0x5a85('0x35')]);_0x2f9efd[_0x5a85('0x38')]=_[_0x5a85('0x39')](_0x535e31['model'],qs[_0x5a85('0x3a')](_0x5c2ca2[_0x5a85('0x35')][_0x5a85('0x3a')]));_0x2f9efd[_0x5a85('0x38')]=_0x2f9efd[_0x5a85('0x38')]['length']?_0x2f9efd[_0x5a85('0x38')]:_0x535e31[_0x5a85('0x34')];if(_0x5c2ca2[_0x5a85('0x35')][_0x5a85('0x48')]){_0x2f9efd['include']=[{'all':!![]}];}_0x2f9efd=_[_0x5a85('0x41')]({},_0x2f9efd,_0x5c2ca2['options']);return db[_0x5a85('0x30')][_0x5a85('0x49')](_0x2f9efd)['then'](handleEntityNotFound(_0x60b907,null))[_0x5a85('0x25')](respondWithResult(_0x60b907,null))['catch'](handleError(_0x60b907,null));};exports[_0x5a85('0x4a')]=function(_0x3840da,_0x27cccd){return db[_0x5a85('0x30')][_0x5a85('0x4a')](_0x3840da[_0x5a85('0x4b')],{})[_0x5a85('0x25')](function(_0x4e16ec){var _0x22758c=_0x3840da[_0x5a85('0x4c')]['get']({'plain':!![]});if(!_0x22758c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22758c[_0x5a85('0x4d')]===_0x5a85('0x4c')){var _0x40a297=_0x4e16ec[_0x5a85('0x4e')]({'plain':!![]});var _0x160663=_0x5a85('0x27');return db[_0x5a85('0x4f')][_0x5a85('0x49')]({'where':{'name':_0x160663,'userProfileId':_0x22758c['userProfileId']},'raw':!![]})[_0x5a85('0x25')](function(_0x651a53){if(_0x651a53&&_0x651a53['autoAssociation']===0x0){return db[_0x5a85('0x28')][_0x5a85('0x4a')]({'name':_0x40a297[_0x5a85('0x2c')],'resourceId':_0x40a297['id'],'type':_0x651a53[_0x5a85('0x2c')],'sectionId':_0x651a53['id']},{})[_0x5a85('0x25')](function(){return _0x4e16ec;});}else{return _0x4e16ec;}})[_0x5a85('0x45')](function(_0x2b1bc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b1bc);throw _0x2b1bc;});}return _0x4e16ec;})[_0x5a85('0x25')](respondWithResult(_0x27cccd,0xc9))[_0x5a85('0x45')](handleError(_0x27cccd,null));};exports[_0x5a85('0x24')]=function(_0xf4cad5,_0x59c301){if(_0xf4cad5[_0x5a85('0x4b')]['id']){delete _0xf4cad5['body']['id'];}return db[_0x5a85('0x30')][_0x5a85('0x49')]({'where':{'id':_0xf4cad5[_0x5a85('0x47')]['id']}})[_0x5a85('0x25')](handleEntityNotFound(_0x59c301,null))[_0x5a85('0x25')](saveUpdates(_0xf4cad5[_0x5a85('0x4b')],null))[_0x5a85('0x25')](respondWithResult(_0x59c301,null))[_0x5a85('0x45')](handleError(_0x59c301,null));};exports[_0x5a85('0x26')]=function(_0xa010e,_0x4071ba){return db[_0x5a85('0x30')][_0x5a85('0x49')]({'where':{'id':_0xa010e[_0x5a85('0x47')]['id']}})[_0x5a85('0x25')](handleEntityNotFound(_0x4071ba,null))[_0x5a85('0x25')](removeEntity(_0x4071ba,null))[_0x5a85('0x45')](handleError(_0x4071ba,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index bfd276e..4ad0c1f 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 _0xb944=['../../config/logger','api','moment','bluebird','path','./variable.attributes','exports','define','Variable','tools_variables','util'];(function(_0x575356,_0x17ea0a){var _0x37ff6=function(_0x3eb907){while(--_0x3eb907){_0x575356['push'](_0x575356['shift']());}};_0x37ff6(++_0x17ea0a);}(_0xb944,0xf1));var _0x4b94=function(_0x3dff0d,_0x4d59ff){_0x3dff0d=_0x3dff0d-0x0;var _0x352383=_0xb944[_0x3dff0d];return _0x352383;};'use strict';var _=require('lodash');var util=require(_0x4b94('0x0'));var logger=require(_0x4b94('0x1'))(_0x4b94('0x2'));var moment=require(_0x4b94('0x3'));var BPromise=require(_0x4b94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b94('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4b94('0x6'));module[_0x4b94('0x7')]=function(_0x37abfa,_0x4d11be){return _0x37abfa[_0x4b94('0x8')](_0x4b94('0x9'),attributes,{'tableName':_0x4b94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa459=['tools_variables','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','Variable'];(function(_0x56b9ec,_0x49cfed){var _0x535b5d=function(_0x3de705){while(--_0x3de705){_0x56b9ec['push'](_0x56b9ec['shift']());}};_0x535b5d(++_0x49cfed);}(_0xa459,0xfe));var _0x9a45=function(_0x4b82a9,_0x13626b){_0x4b82a9=_0x4b82a9-0x0;var _0x418eea=_0xa459[_0x4b82a9];return _0x418eea;};'use strict';var _=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var logger=require(_0x9a45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9a45('0x3'));var rp=require(_0x9a45('0x4'));var fs=require('fs');var path=require(_0x9a45('0x5'));var rimraf=require(_0x9a45('0x6'));var config=require(_0x9a45('0x7'));var attributes=require('./variable.attributes');module['exports']=function(_0x221924,_0x3a795d){return _0x221924[_0x9a45('0x8')](_0x9a45('0x9'),attributes,{'tableName':_0x9a45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 1a041c7..df0db61 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xa41a,0x6b));var _0xaa41=function(_0x32b363,_0x2a8e26){_0x32b363=_0x32b363-0x0;var _0x13e95d=_0xa41a[_0x32b363];return _0x13e95d;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x2d4372,_0x384e41){var _0x2833ae=function(_0x4d6887){while(--_0x4d6887){_0x2d4372['push'](_0x2d4372['shift']());}};_0x2833ae(++_0x384e41);}(_0x7217,0x19e));var _0x7721=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x7217[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 41edc92..e1e7fb0 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 _0xb941=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0xb941,0x15c));var _0x1b94=function(_0x402282,_0x615de3){_0x402282=_0x402282-0x0;var _0x4f65af=_0xb941[_0x402282];return _0x4f65af;};'use strict';var express=require('express');var router=express[_0x1b94('0x0')]();var auth=require(_0x1b94('0x1'));var controller=require(_0x1b94('0x2'));router[_0x1b94('0x3')]('/',controller[_0x1b94('0x4')]);router[_0x1b94('0x3')](_0x1b94('0x5'),auth[_0x1b94('0x6')](),auth[_0x1b94('0x7')](),controller[_0x1b94('0x8')]);router['get']('/reset',auth[_0x1b94('0x6')](),auth[_0x1b94('0x7')](),controller[_0x1b94('0x9')]);router['get'](_0x1b94('0xa'),auth[_0x1b94('0x6')](),auth['canUpdate'](),controller[_0x1b94('0xb')]);router['get'](_0x1b94('0xc'),auth[_0x1b94('0x6')](),controller[_0x1b94('0xd')]);router[_0x1b94('0x3')](_0x1b94('0xe'),controller[_0x1b94('0xf')]);module[_0x1b94('0x10')]=router; \ No newline at end of file +var _0x3d39=['./version.controller','get','index','/fetch','fetch','isAuthenticated','reset','/pull','canUpdate','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service'];(function(_0xdb1acd,_0x5ee69b){var _0x479c66=function(_0x3eb1e3){while(--_0x3eb1e3){_0xdb1acd['push'](_0xdb1acd['shift']());}};_0x479c66(++_0x5ee69b);}(_0x3d39,0xb9));var _0x93d3=function(_0x219fd8,_0x134841){_0x219fd8=_0x219fd8-0x0;var _0x46cf3f=_0x3d39[_0x219fd8];return _0x46cf3f;};'use strict';var express=require('express');var router=express[_0x93d3('0x0')]();var auth=require(_0x93d3('0x1'));var controller=require(_0x93d3('0x2'));router[_0x93d3('0x3')]('/',controller[_0x93d3('0x4')]);router[_0x93d3('0x3')](_0x93d3('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x93d3('0x6')]);router['get']('/reset',auth[_0x93d3('0x7')](),auth['canUpdate'](),controller[_0x93d3('0x8')]);router[_0x93d3('0x3')](_0x93d3('0x9'),auth[_0x93d3('0x7')](),auth[_0x93d3('0xa')](),controller[_0x93d3('0xb')]);router[_0x93d3('0x3')](_0x93d3('0xc'),auth[_0x93d3('0x7')](),controller[_0x93d3('0xd')]);router[_0x93d3('0x3')](_0x93d3('0xe'),controller[_0x93d3('0xf')]);module[_0x93d3('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 429c2e5..e95c94e 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 _0x23ed=['last','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','index','exports','version','query','fetch','tags','latest','status','master','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','error','migrations','readdirSync','join','root','length','replace','.js','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x23ed,0x19a));var _0xd23e=function(_0x4ceae1,_0x437160){_0x4ceae1=_0x4ceae1-0x0;var _0x3dc47e=_0x23ed[_0x4ceae1];return _0x3dc47e;};'use strict';var Umzug=require(_0xd23e('0x0'));var path=require(_0xd23e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xd23e('0x2'))(module,'version');var compareVersions=require(_0xd23e('0x3'));var exec=require(_0xd23e('0x4'))[_0xd23e('0x5')];var db=require(_0xd23e('0x6'))['db'];var config=require(_0xd23e('0x7'));var pm2=require(_0xd23e('0x8'));var logger=require('../../config/logger')('update');var git=require(_0xd23e('0x9'))(config['root']);exports[_0xd23e('0xa')]=function(_0x51eda4,_0xad55dc){var _0x13bbea={'current':module[_0xd23e('0xb')][_0xd23e('0xc')],'phonebar':0x2};if(_0x51eda4[_0xd23e('0xd')]&&_0x51eda4[_0xd23e('0xd')]['latest']){return git[_0xd23e('0xe')]()[_0xd23e('0xf')](function(_0x5a4abf,_0x7bb0c3){_0x13bbea[_0xd23e('0x10')]=(_0x5a4abf?module['exports'][_0xd23e('0xc')]:_0x7bb0c3[_0xd23e('0x10')])||'2.0.0';return _0xad55dc['status'](0xc8)['json'](_0x13bbea);});}else{return _0xad55dc[_0xd23e('0x11')](0xc8)['json'](_0x13bbea);}};exports[_0xd23e('0xe')]=function(_0x5154e7,_0x33595a){return git[_0xd23e('0xe')](['origin',_0xd23e('0x12')],function(_0x249def){if(_0x249def){logger['error'](_0x249def);return _0x33595a['status'](0x1f4)[_0xd23e('0x13')](_0x249def);}logger[_0xd23e('0x14')](_0xd23e('0x15'));return _0x33595a['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x16')});});};exports[_0xd23e('0x17')]=function(_0x1a1483,_0x5a4a24){return git[_0xd23e('0x17')]([_0xd23e('0x18'),_0xd23e('0x19')],function(_0x453174){if(_0x453174){logger['error'](_0x453174);return _0x5a4a24[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x453174);}logger['info'](_0xd23e('0x1a'));return _0x5a4a24[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x1b')});});};exports[_0xd23e('0x1c')]=function(_0x1ef3e4,_0x3e2f1b){exec(_0xd23e('0x1d'),function(_0x23f863,_0x39490e,_0x590fb2){logger[_0xd23e('0x14')](_0x39490e);logger[_0xd23e('0x14')](_0x590fb2);if(_0x23f863){logger['error'](_0x23f863);return _0x3e2f1b[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x23f863);}return _0x3e2f1b[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0x39490e});});};exports[_0xd23e('0x1e')]=function(_0x4ac145,_0x40d60b){return pm2['restart']('motion2')[_0xd23e('0x1f')](function(_0x23402c){logger[_0xd23e('0x14')]('pm2\x20restart\x20motion\x20%s',_0x23402c);return _0x40d60b[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x20')});})[_0xd23e('0x21')](function(_0x1dd583){logger[_0xd23e('0x22')](_0x1dd583);return _0x40d60b[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x1dd583);});};exports[_0xd23e('0x23')]=function(_0x18b7fb,_0x728824){var _0x5a512d=fs[_0xd23e('0x24')](path[_0xd23e('0x25')](config[_0xd23e('0x26')],'server',_0xd23e('0x23')));var _0x354427=[];for(var _0x39f6ad=0x0;_0x39f6ad<_0x5a512d[_0xd23e('0x27')];_0x39f6ad++){var _0x5a7972=_0x5a512d[_0x39f6ad][_0xd23e('0x28')](_0xd23e('0x29'),'');if(compareVersions(module[_0xd23e('0xb')][_0xd23e('0xc')],_0x5a7972)===-0x1){_0x354427['push'](_0x5a7972);}}if(_0x354427[_0xd23e('0x27')]){var _0x5c45bb=_0x354427[_0xd23e('0x2a')](compareVersions);var _0x4ac2e2=new Umzug({'storage':_0xd23e('0x2b'),'storageOptions':{'model':db[_0xd23e('0x2c')],'modelName':_0xd23e('0x2c'),'columnName':_0xd23e('0xc')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xd23e('0x2b')]['constructor'],function(){throw new Error(_0xd23e('0x2d'));}],'path':path['join'](config[_0xd23e('0x26')],_0xd23e('0x2e'),_0xd23e('0x23')),'pattern':/\.js$/}});_0x4ac2e2['up']({'migrations':_[_0xd23e('0x2f')](_0x5c45bb,function(_0x211e46){return _0x211e46+_0xd23e('0x29');})})[_0xd23e('0x1f')](function(){return _0x728824['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x30')+module[_0xd23e('0xb')][_0xd23e('0xc')]+'\x20to\x20'+_[_0xd23e('0x31')](_0x5c45bb),'migrations':_[_0xd23e('0x25')](_0x5c45bb)});})[_0xd23e('0x21')](function(_0x5909c1){if(_0x5909c1 instanceof db[_0xd23e('0x2b')]['UniqueConstraintError']){return _0x728824[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x32')});}else{return _0x728824['status'](0x1f4)['json'](_0x5909c1);}});}else{return _0x728824['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x32')});}}; \ No newline at end of file +var _0x602c=['Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','index','exports','query','fetch','tags','latest','json','status','origin','master','error','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','.js','push','sequelize','Migration','getQueryInterface','constructor'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0x602c,0x15c));var _0xc602=function(_0x35f4a1,_0x4160bf){_0x35f4a1=_0x35f4a1-0x0;var _0x3b2175=_0x602c[_0x35f4a1];return _0x3b2175;};'use strict';var Umzug=require(_0xc602('0x0'));var path=require(_0xc602('0x1'));var fs=require('fs');var _=require(_0xc602('0x2'));var pkginfo=require(_0xc602('0x3'))(module,_0xc602('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xc602('0x5'))[_0xc602('0x6')];var db=require(_0xc602('0x7'))['db'];var config=require(_0xc602('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xc602('0x9'))('update');var git=require(_0xc602('0xa'))(config[_0xc602('0xb')]);exports[_0xc602('0xc')]=function(_0x7132f8,_0x442ddc){var _0x30b1f5={'current':module[_0xc602('0xd')]['version'],'phonebar':0x2};if(_0x7132f8['query']&&_0x7132f8[_0xc602('0xe')]['latest']){return git[_0xc602('0xf')]()[_0xc602('0x10')](function(_0x4ecf9e,_0x108a58){_0x30b1f5[_0xc602('0x11')]=(_0x4ecf9e?module[_0xc602('0xd')]['version']:_0x108a58[_0xc602('0x11')])||'2.0.0';return _0x442ddc['status'](0xc8)[_0xc602('0x12')](_0x30b1f5);});}else{return _0x442ddc[_0xc602('0x13')](0xc8)[_0xc602('0x12')](_0x30b1f5);}};exports[_0xc602('0xf')]=function(_0x404967,_0x2c1f1c){return git[_0xc602('0xf')]([_0xc602('0x14'),_0xc602('0x15')],function(_0x568560){if(_0x568560){logger[_0xc602('0x16')](_0x568560);return _0x2c1f1c[_0xc602('0x13')](0x1f4)['json'](_0x568560);}logger['info']('git\x20fetch');return _0x2c1f1c[_0xc602('0x13')](0xc8)[_0xc602('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc602('0x17')]=function(_0x42771d,_0x32a3da){return git[_0xc602('0x17')]([_0xc602('0x18'),'FETCH_HEAD'],function(_0xd8f8b9){if(_0xd8f8b9){logger['error'](_0xd8f8b9);return _0x32a3da[_0xc602('0x13')](0x1f4)[_0xc602('0x12')](_0xd8f8b9);}logger[_0xc602('0x19')](_0xc602('0x1a'));return _0x32a3da['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0xaa5c61,_0x1aead7){exec(_0xc602('0x1b'),function(_0x43b7c2,_0x5bc2f0,_0x22bb46){logger[_0xc602('0x19')](_0x5bc2f0);logger[_0xc602('0x19')](_0x22bb46);if(_0x43b7c2){logger[_0xc602('0x16')](_0x43b7c2);return _0x1aead7[_0xc602('0x13')](0x1f4)[_0xc602('0x12')](_0x43b7c2);}return _0x1aead7[_0xc602('0x13')](0xc8)[_0xc602('0x12')]({'output':_0x5bc2f0});});};exports[_0xc602('0x1c')]=function(_0x49f6d7,_0x51c460){return pm2['restart'](_0xc602('0x1d'))['then'](function(_0x456359){logger['info'](_0xc602('0x1e'),_0x456359);return _0x51c460['status'](0xc8)['json']({'output':_0xc602('0x1f')});})[_0xc602('0x20')](function(_0x3a4e91){logger['error'](_0x3a4e91);return _0x51c460[_0xc602('0x13')](0x1f4)[_0xc602('0x12')](_0x3a4e91);});};exports['migrations']=function(_0x2c8d74,_0x4436f4){var _0x363480=fs[_0xc602('0x21')](path[_0xc602('0x22')](config[_0xc602('0xb')],_0xc602('0x23'),_0xc602('0x24')));var _0x3c40bd=[];for(var _0xf15f1a=0x0;_0xf15f1a<_0x363480[_0xc602('0x25')];_0xf15f1a++){var _0xc1aed8=_0x363480[_0xf15f1a]['replace'](_0xc602('0x26'),'');if(compareVersions(module[_0xc602('0xd')][_0xc602('0x4')],_0xc1aed8)===-0x1){_0x3c40bd[_0xc602('0x27')](_0xc1aed8);}}if(_0x3c40bd[_0xc602('0x25')]){var _0x2618f7=_0x3c40bd['sort'](compareVersions);var _0x5470b7=new Umzug({'storage':_0xc602('0x28'),'storageOptions':{'model':db[_0xc602('0x29')],'modelName':_0xc602('0x29'),'columnName':_0xc602('0x4')},'migrations':{'params':[db['sequelize'][_0xc602('0x2a')](),db[_0xc602('0x28')][_0xc602('0x2b')],function(){throw new Error(_0xc602('0x2c'));}],'path':path['join'](config[_0xc602('0xb')],_0xc602('0x23'),'migrations'),'pattern':/\.js$/}});_0x5470b7['up']({'migrations':_[_0xc602('0x2d')](_0x2618f7,function(_0x3ce657){return _0x3ce657+_0xc602('0x26');})})[_0xc602('0x2e')](function(){return _0x4436f4[_0xc602('0x13')](0xc8)[_0xc602('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xc602('0x4')]+'\x20to\x20'+_[_0xc602('0x2f')](_0x2618f7),'migrations':_['join'](_0x2618f7)});})['catch'](function(_0x5796a7){if(_0x5796a7 instanceof db[_0xc602('0x28')]['UniqueConstraintError']){return _0x4436f4[_0xc602('0x13')](0xc8)[_0xc602('0x12')]({'output':_0xc602('0x30')});}else{return _0x4436f4[_0xc602('0x13')](0x1f4)[_0xc602('0x12')](_0x5796a7);}});}else{return _0x4436f4[_0xc602('0x13')](0xc8)[_0xc602('0x12')]({'output':_0xc602('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 145bcfc..7b71015 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 _0x4ba9=['./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x4ba9,0xe1));var _0x94ba=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x4ba9[_0x4b2cc6];return _0x3e0b08;};'use strict';var multer=require(_0x94ba('0x0'));var util=require('util');var path=require(_0x94ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x94ba('0x2'));var router=express[_0x94ba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x94ba('0x4'));var interaction=require(_0x94ba('0x5'));var config=require('../../config/environment');var controller=require(_0x94ba('0x6'));router['get']('/',auth[_0x94ba('0x7')](),controller[_0x94ba('0x8')]);router[_0x94ba('0x9')](_0x94ba('0xa'),auth[_0x94ba('0x7')](),controller[_0x94ba('0xb')]);router[_0x94ba('0x9')]('/:id',auth[_0x94ba('0x7')](),controller[_0x94ba('0xc')]);router[_0x94ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x94ba('0xe')]);router[_0x94ba('0xf')](_0x94ba('0x10'),auth[_0x94ba('0x7')](),controller[_0x94ba('0x11')]);router[_0x94ba('0x12')](_0x94ba('0x10'),auth[_0x94ba('0x7')](),controller[_0x94ba('0x13')]);module[_0x94ba('0x14')]=router; \ No newline at end of file +var _0xe905=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x54245f,_0x31f567){var _0x151fa8=function(_0x426af2){while(--_0x426af2){_0x54245f['push'](_0x54245f['shift']());}};_0x151fa8(++_0x31f567);}(_0xe905,0xb9));var _0x5e90=function(_0x46a325,_0xd31391){_0x46a325=_0x46a325-0x0;var _0x9c0a8d=_0xe905[_0x46a325];return _0x9c0a8d;};'use strict';var multer=require('multer');var util=require(_0x5e90('0x0'));var path=require(_0x5e90('0x1'));var timeout=require(_0x5e90('0x2'));var express=require(_0x5e90('0x3'));var router=express[_0x5e90('0x4')]();var fs_extra=require(_0x5e90('0x5'));var auth=require(_0x5e90('0x6'));var interaction=require(_0x5e90('0x7'));var config=require(_0x5e90('0x8'));var controller=require(_0x5e90('0x9'));router[_0x5e90('0xa')]('/',auth['isAuthenticated'](),controller[_0x5e90('0xb')]);router[_0x5e90('0xa')]('/describe',auth[_0x5e90('0xc')](),controller[_0x5e90('0xd')]);router['get']('/:id',auth[_0x5e90('0xc')](),controller['show']);router[_0x5e90('0xe')]('/',auth['isAuthenticated'](),controller[_0x5e90('0xf')]);router[_0x5e90('0x10')](_0x5e90('0x11'),auth['isAuthenticated'](),controller[_0x5e90('0x12')]);router[_0x5e90('0x13')](_0x5e90('0x11'),auth['isAuthenticated'](),controller[_0x5e90('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 34b8bd1..5b8713b 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 _0xd26f=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x22fefb,_0x105065){var _0x49a5e0=function(_0x11b61a){while(--_0x11b61a){_0x22fefb['push'](_0x22fefb['shift']());}};_0x49a5e0(++_0x105065);}(_0xd26f,0x113));var _0xfd26=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd26f[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfd26('0x2')]},'calleridname':{'type':Sequelize[_0xfd26('0x2')]},'queue':{'type':Sequelize[_0xfd26('0x2')]},'interface':{'type':Sequelize[_0xfd26('0x2')]},'membername':{'type':Sequelize[_0xfd26('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfd26('0x3')]},'agentconnectAt':{'type':Sequelize[_0xfd26('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xfd26('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfd26('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfd26('0x4')]},'agentcomplete':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfd26('0x4')]},'agentacw':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfd26('0x2')]},'lastevent':{'type':Sequelize[_0xfd26('0x2')]},'channel':{'type':Sequelize[_0xfd26('0x2')]},'channelstate':{'type':Sequelize[_0xfd26('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd26('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfd26('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xfd26('0x2')]},'destcalleridname':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xfd26('0x2')]},'destlanguage':{'type':Sequelize[_0xfd26('0x2')]},'destaccountcode':{'type':Sequelize[_0xfd26('0x2')]},'destcontext':{'type':Sequelize[_0xfd26('0x2')]},'destexten':{'type':Sequelize[_0xfd26('0x2')]},'destpriority':{'type':Sequelize[_0xfd26('0x2')]},'destuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xfd26('0x2')]},'transfer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfd26('0x2')],'comment':_0xfd26('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'agententerreason':{'type':Sequelize[_0xfd26('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x937d=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN'];(function(_0x3353ef,_0x37d77f){var _0x4176d9=function(_0x40c2af){while(--_0x40c2af){_0x3353ef['push'](_0x3353ef['shift']());}};_0x4176d9(++_0x37d77f);}(_0x937d,0x1f4));var _0xd937=function(_0x1856ea,_0x5ce9ca){_0x1856ea=_0x1856ea-0x0;var _0x427538=_0x937d[_0x1856ea];return _0x427538;};'use strict';var Sequelize=require(_0xd937('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd937('0x1')]},'calleridname':{'type':Sequelize[_0xd937('0x1')]},'queue':{'type':Sequelize[_0xd937('0x1')]},'interface':{'type':Sequelize[_0xd937('0x1')]},'membername':{'type':Sequelize[_0xd937('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd937('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xd937('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd937('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd937('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd937('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd937('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd937('0x4')]},'agentacw':{'type':Sequelize[_0xd937('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd937('0x4')]},'reason':{'type':Sequelize[_0xd937('0x1')]},'lastevent':{'type':Sequelize[_0xd937('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xd937('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd937('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd937('0x1')]},'accountcode':{'type':Sequelize[_0xd937('0x1')]},'context':{'type':Sequelize[_0xd937('0x1')]},'exten':{'type':Sequelize[_0xd937('0x1')]},'priority':{'type':Sequelize[_0xd937('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd937('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd937('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd937('0x1')]},'destcalleridname':{'type':Sequelize[_0xd937('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd937('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd937('0x1')]},'destlanguage':{'type':Sequelize[_0xd937('0x1')]},'destaccountcode':{'type':Sequelize[_0xd937('0x1')]},'destcontext':{'type':Sequelize[_0xd937('0x1')]},'destexten':{'type':Sequelize[_0xd937('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd937('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd937('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd937('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd937('0x1')],'comment':_0xd937('0x5')},'transferexten':{'type':Sequelize[_0xd937('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd937('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 0a4d4fa..0a5d7e5 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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 57809fd..795c4ff 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 _0x4f0d=['uniqueid','destuniqueid','bluebird','request-promise','path','../../config/environment','define','VoiceAgentReport'];(function(_0x5799ff,_0x3f6ac0){var _0x9513c5=function(_0x5ae2b5){while(--_0x5ae2b5){_0x5799ff['push'](_0x5799ff['shift']());}};_0x9513c5(++_0x3f6ac0);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0x4f0d[_0x540160];return _0x476120;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd4f0('0x0'));var rp=require(_0xd4f0('0x1'));var fs=require('fs');var path=require(_0xd4f0('0x2'));var rimraf=require('rimraf');var config=require(_0xd4f0('0x3'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1809dd,_0x4da370){return _0x1809dd[_0xd4f0('0x4')](_0xd4f0('0x5'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd4f0('0x6'),_0xd4f0('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc090=['define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports'];(function(_0x45b700,_0x446c29){var _0x22a9b7=function(_0x5c87fa){while(--_0x5c87fa){_0x45b700['push'](_0x45b700['shift']());}};_0x22a9b7(++_0x446c29);}(_0xc090,0x112));var _0x0c09=function(_0x114323,_0x193373){_0x114323=_0x114323-0x0;var _0x10b04e=_0xc090[_0x114323];return _0x10b04e;};'use strict';var _=require(_0x0c09('0x0'));var util=require(_0x0c09('0x1'));var logger=require(_0x0c09('0x2'))(_0x0c09('0x3'));var moment=require(_0x0c09('0x4'));var BPromise=require(_0x0c09('0x5'));var rp=require(_0x0c09('0x6'));var fs=require('fs');var path=require(_0x0c09('0x7'));var rimraf=require(_0x0c09('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c09('0x9'));module[_0x0c09('0xa')]=function(_0x4f3f48,_0x49a403){return _0x4f3f48[_0x0c09('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x0c09('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0c09('0xd'),_0x0c09('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 50f6929..3e09633 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 _0x0c09=['jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','where','attributes','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c09,0x1e6));var _0x90c0=function(_0x232be5,_0x3e3ae0){_0x232be5=_0x232be5-0x0;var _0x46f6b1=_0x0c09[_0x232be5];return _0x46f6b1;};'use strict';var _=require('lodash');var util=require(_0x90c0('0x0'));var moment=require(_0x90c0('0x1'));var BPromise=require(_0x90c0('0x2'));var rs=require(_0x90c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90c0('0x4'))['db'];var utils=require(_0x90c0('0x5'));var logger=require(_0x90c0('0x6'))(_0x90c0('0x7'));var config=require(_0x90c0('0x8'));var jayson=require(_0x90c0('0x9'));var client=jayson[_0x90c0('0xa')][_0x90c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39537a,_0x4487e5,_0x39d144){return new BPromise(function(_0x26464a,_0x3972ca){return client[_0x90c0('0xc')](_0x39537a,_0x39d144)[_0x90c0('0xd')](function(_0x53fb0e){logger[_0x90c0('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x90c0('0xf'));logger[_0x90c0('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4487e5,_0x90c0('0xf'),JSON['stringify'](_0x53fb0e));if(_0x53fb0e[_0x90c0('0x11')]){if(_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x12')]===0x1f4){logger[_0x90c0('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x53fb0e[_0x90c0('0x11')]['message']);return _0x3972ca(_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x13')]);return _0x26464a(_0x53fb0e['error'][_0x90c0('0x13')]);}else{logger[_0x90c0('0xe')](_0x90c0('0x14'),_0x4487e5,'request\x20sent');_0x26464a(_0x53fb0e[_0x90c0('0x15')][_0x90c0('0x13')]);}})[_0x90c0('0x16')](function(_0x365dd6){logger['error'](_0x90c0('0x14'),_0x4487e5,_0x365dd6);_0x3972ca(_0x365dd6);});});}exports[_0x90c0('0x17')]=function(_0x319889){var _0x4a5cc0=this;return new Promise(function(_0x838e53,_0x394b69){return db[_0x90c0('0x18')][_0x90c0('0x19')](_0x319889[_0x90c0('0x1a')],{'raw':_0x319889[_0x90c0('0x1b')]?_0x319889[_0x90c0('0x1b')][_0x90c0('0x1c')]===undefined?!![]:![]:!![]})[_0x90c0('0xd')](function(_0x5afbe2){logger[_0x90c0('0xe')]('CreateVoiceAgentReport',_0x319889);logger[_0x90c0('0x10')](_0x90c0('0x17'),_0x319889,JSON[_0x90c0('0x1d')](_0x5afbe2));_0x838e53(_0x5afbe2);})[_0x90c0('0x16')](function(_0x1951f4){logger[_0x90c0('0x11')]('CreateVoiceAgentReport',_0x1951f4[_0x90c0('0x13')],_0x319889);_0x394b69(_0x4a5cc0['error'](0x1f4,_0x1951f4['message']));});});};exports[_0x90c0('0x1e')]=function(_0x329f63){var _0x27890d=this;return new Promise(function(_0x21bae5,_0x2bfa43){return db[_0x90c0('0x18')]['update'](_0x329f63[_0x90c0('0x1a')],{'raw':_0x329f63['options']?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x329f63[_0x90c0('0x1b')]?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x1f')]||null:null,'attributes':_0x329f63['options']?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x20')]||null:null,'limit':_0x329f63[_0x90c0('0x1b')]?_0x329f63['options']['limit']||null:null})[_0x90c0('0xd')](function(_0x4dfab1){logger[_0x90c0('0xe')](_0x90c0('0x1e'),_0x329f63);logger[_0x90c0('0x10')]('UpdateVoiceAgentReport',_0x329f63,JSON[_0x90c0('0x1d')](_0x4dfab1));_0x21bae5(_0x4dfab1);})[_0x90c0('0x16')](function(_0x29c70f){logger[_0x90c0('0x11')](_0x90c0('0x1e'),_0x29c70f[_0x90c0('0x13')],_0x329f63);_0x2bfa43(_0x27890d['error'](0x1f4,_0x29c70f['message']));});});}; \ No newline at end of file +var _0x0eec=['stringify','UpdateVoiceAgentReport','update','body','where','attributes','limit','then','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateVoiceAgentReport','VoiceAgentReport','options','raw','debug'];(function(_0x5814ca,_0x3b6713){var _0xeb1833=function(_0x553de1){while(--_0x553de1){_0x5814ca['push'](_0x5814ca['shift']());}};_0xeb1833(++_0x3b6713);}(_0x0eec,0x109));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc0ee('0x0'));var util=require(_0xc0ee('0x1'));var moment=require(_0xc0ee('0x2'));var BPromise=require(_0xc0ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0ee('0x4'));var logger=require(_0xc0ee('0x5'))(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var jayson=require(_0xc0ee('0x8'));var client=jayson['client'][_0xc0ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x475305,_0x5c3aff,_0x538459){return new BPromise(function(_0x4c77a1,_0x247827){return client[_0xc0ee('0xa')](_0x475305,_0x538459)['then'](function(_0x468d2a){logger[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x5c3aff,_0xc0ee('0xd'));logger['debug'](_0xc0ee('0xe'),_0x5c3aff,'request\x20sent',JSON['stringify'](_0x468d2a));if(_0x468d2a[_0xc0ee('0xf')]){if(_0x468d2a[_0xc0ee('0xf')][_0xc0ee('0x10')]===0x1f4){logger[_0xc0ee('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5c3aff,_0x468d2a[_0xc0ee('0xf')][_0xc0ee('0x11')]);return _0x247827(_0x468d2a[_0xc0ee('0xf')][_0xc0ee('0x11')]);}logger[_0xc0ee('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5c3aff,_0x468d2a[_0xc0ee('0xf')][_0xc0ee('0x11')]);return _0x4c77a1(_0x468d2a[_0xc0ee('0xf')][_0xc0ee('0x11')]);}else{logger[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x5c3aff,_0xc0ee('0xd'));_0x4c77a1(_0x468d2a['result'][_0xc0ee('0x11')]);}})['catch'](function(_0x2a866a){logger[_0xc0ee('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5c3aff,_0x2a866a);_0x247827(_0x2a866a);});});}exports[_0xc0ee('0x12')]=function(_0x541ac1){var _0x3bb976=this;return new Promise(function(_0x41ec56,_0x2b1d00){return db[_0xc0ee('0x13')]['create'](_0x541ac1['body'],{'raw':_0x541ac1['options']?_0x541ac1[_0xc0ee('0x14')][_0xc0ee('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x47256f){logger[_0xc0ee('0xb')](_0xc0ee('0x12'),_0x541ac1);logger[_0xc0ee('0x16')](_0xc0ee('0x12'),_0x541ac1,JSON[_0xc0ee('0x17')](_0x47256f));_0x41ec56(_0x47256f);})['catch'](function(_0x30e694){logger[_0xc0ee('0xf')]('CreateVoiceAgentReport',_0x30e694[_0xc0ee('0x11')],_0x541ac1);_0x2b1d00(_0x3bb976[_0xc0ee('0xf')](0x1f4,_0x30e694[_0xc0ee('0x11')]));});});};exports[_0xc0ee('0x18')]=function(_0x33de83){var _0x20d4b9=this;return new Promise(function(_0x4c714e,_0x27c77b){return db[_0xc0ee('0x13')][_0xc0ee('0x19')](_0x33de83[_0xc0ee('0x1a')],{'raw':_0x33de83[_0xc0ee('0x14')]?_0x33de83[_0xc0ee('0x14')][_0xc0ee('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33de83[_0xc0ee('0x14')]?_0x33de83[_0xc0ee('0x14')][_0xc0ee('0x1b')]||null:null,'attributes':_0x33de83[_0xc0ee('0x14')]?_0x33de83[_0xc0ee('0x14')][_0xc0ee('0x1c')]||null:null,'limit':_0x33de83['options']?_0x33de83[_0xc0ee('0x14')][_0xc0ee('0x1d')]||null:null})[_0xc0ee('0x1e')](function(_0x522343){logger[_0xc0ee('0xb')](_0xc0ee('0x18'),_0x33de83);logger[_0xc0ee('0x16')](_0xc0ee('0x18'),_0x33de83,JSON[_0xc0ee('0x17')](_0x522343));_0x4c714e(_0x522343);})[_0xc0ee('0x1f')](function(_0x4e1c86){logger[_0xc0ee('0xf')](_0xc0ee('0x18'),_0x4e1c86[_0xc0ee('0x11')],_0x33de83);_0x27c77b(_0x20d4b9[_0xc0ee('0xf')](0x1f4,_0x4e1c86['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 6ae0da7..e1873a6 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x3a7062,_0x328337){var _0x256c11=function(_0x174b10){while(--_0x174b10){_0x3a7062['push'](_0x3a7062['shift']());}};_0x256c11(++_0x328337);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3a93a7,_0x52bf3c){_0x3a93a7=_0x3a93a7-0x0;var _0x57fe87=_0x1cb9[_0x3a93a7];return _0x57fe87;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x6334=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4384e3,_0x546fea){var _0x4077e4=function(_0x378db4){while(--_0x378db4){_0x4384e3['push'](_0x4384e3['shift']());}};_0x4077e4(++_0x546fea);}(_0x6334,0x119));var _0x4633=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x6334[_0x259d17];return _0x407535;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),auth['isAuthenticated'](),controller[_0x4633('0xe')]);router[_0x4633('0xa')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0xf')]);router[_0x4633('0x10')]('/',auth['isAuthenticated'](),controller[_0x4633('0x11')]);router[_0x4633('0x12')]('/:id',auth[_0x4633('0xb')](),controller[_0x4633('0x13')]);router[_0x4633('0x14')](_0x4633('0x15'),auth['isAuthenticated'](),controller[_0x4633('0x16')]);module[_0x4633('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3f20621..fa0cde2 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 _0x2cf5=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','internal','outbound'];(function(_0x38aa39,_0x563f65){var _0x1ff3a5=function(_0x49213c){while(--_0x49213c){_0x38aa39['push'](_0x38aa39['shift']());}};_0x1ff3a5(++_0x563f65);}(_0x2cf5,0x19f));var _0x52cf=function(_0x1952ab,_0x285074){_0x1952ab=_0x1952ab-0x0;var _0x5ccce4=_0x2cf5[_0x1952ab];return _0x5ccce4;};'use strict';var Sequelize=require(_0x52cf('0x0'));module[_0x52cf('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x52cf('0x2')]('inbound',_0x52cf('0x3'),_0x52cf('0x4'),'inbound-fax','outbound-fax',_0x52cf('0x5'))},'tag':{'type':Sequelize[_0x52cf('0x6')]},'accountcode':{'type':Sequelize[_0x52cf('0x6')]},'source':{'type':Sequelize[_0x52cf('0x6')]},'destination':{'type':Sequelize[_0x52cf('0x6')]},'destinationcontext':{'type':Sequelize[_0x52cf('0x6')]},'callerid':{'type':Sequelize[_0x52cf('0x6')]},'channel':{'type':Sequelize[_0x52cf('0x6')]},'destinationchannel':{'type':Sequelize[_0x52cf('0x6')]},'lastapplication':{'type':Sequelize[_0x52cf('0x6')]},'lastdata':{'type':Sequelize[_0x52cf('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x52cf('0x8')]},'answertime':{'type':Sequelize[_0x52cf('0x8')]},'endtime':{'type':Sequelize[_0x52cf('0x8')]},'duration':{'type':Sequelize[_0x52cf('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x52cf('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x52cf('0x6')]},'amaflags':{'type':Sequelize[_0x52cf('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x52cf('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x52cf('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x52cf('0x6')]},'note':{'type':Sequelize[_0x52cf('0x6')]},'prefix':{'type':Sequelize[_0x52cf('0x6')]},'routeid':{'type':Sequelize[_0x52cf('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x96fb=['INTEGER','sequelize','exports','STRING','ENUM','inbound','inbound-fax','outbound-fax','TEXT','DATE'];(function(_0x47b498,_0x5260d8){var _0xa96394=function(_0x54903f){while(--_0x54903f){_0x47b498['push'](_0x47b498['shift']());}};_0xa96394(++_0x5260d8);}(_0x96fb,0x65));var _0xb96f=function(_0x474f2c,_0x258715){_0x474f2c=_0x474f2c-0x0;var _0x47b9fd=_0x96fb[_0x474f2c];return _0x47b9fd;};'use strict';var Sequelize=require(_0xb96f('0x0'));module[_0xb96f('0x1')]={'uniqueid':{'type':Sequelize[_0xb96f('0x2')]},'type':{'type':Sequelize[_0xb96f('0x3')](_0xb96f('0x4'),'internal','outbound',_0xb96f('0x5'),_0xb96f('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb96f('0x2')]},'source':{'type':Sequelize[_0xb96f('0x2')]},'destination':{'type':Sequelize[_0xb96f('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb96f('0x2')]},'channel':{'type':Sequelize[_0xb96f('0x2')]},'destinationchannel':{'type':Sequelize[_0xb96f('0x2')]},'lastapplication':{'type':Sequelize[_0xb96f('0x2')]},'lastdata':{'type':Sequelize[_0xb96f('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb96f('0x8')]},'answertime':{'type':Sequelize[_0xb96f('0x8')]},'endtime':{'type':Sequelize[_0xb96f('0x8')]},'duration':{'type':Sequelize[_0xb96f('0x9')]},'billableseconds':{'type':Sequelize[_0xb96f('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb96f('0x2')]},'amaflags':{'type':Sequelize[_0xb96f('0x2')]},'userfield':{'type':Sequelize[_0xb96f('0x2')]},'userDisposition':{'type':Sequelize[_0xb96f('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xb96f('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb96f('0x2')]},'routeid':{'type':Sequelize[_0xb96f('0x9')]},'sipcallid':{'type':Sequelize[_0xb96f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 304b2cb..0ba23c0 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49295f,_0x1c281c){_0x49295f=_0x49295f-0x0;var _0x5de211=_0x5f2f[_0x49295f];return _0x5de211;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','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','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x2ef3,0xba));var _0x32ef=function(_0xcb6af8,_0x39b52){_0xcb6af8=_0xcb6af8-0x0;var _0x7a7f61=_0x2ef3[_0xcb6af8];return _0x7a7f61;};'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['VoiceCallReport'][_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')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ed9c33a..0fcab6c 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 _0x6489=['rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e75af,_0x2d9b04){var _0x41da67=function(_0x340b58){while(--_0x340b58){_0x5e75af['push'](_0x5e75af['shift']());}};_0x41da67(++_0x2d9b04);}(_0x6489,0x124));var _0x9648=function(_0x3a07da,_0x2734f0){_0x3a07da=_0x3a07da-0x0;var _0x577fe8=_0x6489[_0x3a07da];return _0x577fe8;};'use strict';var _=require(_0x9648('0x0'));var util=require('util');var logger=require(_0x9648('0x1'))(_0x9648('0x2'));var moment=require(_0x9648('0x3'));var BPromise=require(_0x9648('0x4'));var rp=require(_0x9648('0x5'));var fs=require('fs');var path=require(_0x9648('0x6'));var rimraf=require(_0x9648('0x7'));var config=require(_0x9648('0x8'));var attributes=require(_0x9648('0x9'));module['exports']=function(_0x30ca0e,_0x311100){return _0x30ca0e['define'](_0x9648('0xa'),attributes,{'tableName':_0x9648('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9648('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7aad=['report_call','lodash','../../config/logger','api','bluebird','request-promise','path','./voiceCallReport.attributes','exports'];(function(_0x22ea49,_0x4a785c){var _0x580ac8=function(_0x2f717a){while(--_0x2f717a){_0x22ea49['push'](_0x22ea49['shift']());}};_0x580ac8(++_0x4a785c);}(_0x7aad,0x160));var _0xd7aa=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7aad[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xd7aa('0x0'));var util=require('util');var logger=require(_0xd7aa('0x1'))(_0xd7aa('0x2'));var moment=require('moment');var BPromise=require(_0xd7aa('0x3'));var rp=require(_0xd7aa('0x4'));var fs=require('fs');var path=require(_0xd7aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7aa('0x6'));module[_0xd7aa('0x7')]=function(_0x2fe602,_0xb6d0b2){return _0x2fe602['define']('VoiceCallReport',attributes,{'tableName':_0xd7aa('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1334949..cfdd36a 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 _0x37df=['model','include','debug','CreateVoiceCallReport','VoiceCallReport','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','options','raw','where','attributes','map'];(function(_0x4cf6b0,_0x120ce1){var _0x15d06e=function(_0x4366e1){while(--_0x4366e1){_0x4cf6b0['push'](_0x4cf6b0['shift']());}};_0x15d06e(++_0x120ce1);}(_0x37df,0x195));var _0xf37d=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x37df[_0x291d3f];return _0x242080;};'use strict';var _=require(_0xf37d('0x0'));var util=require(_0xf37d('0x1'));var moment=require(_0xf37d('0x2'));var BPromise=require(_0xf37d('0x3'));var rs=require(_0xf37d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf37d('0x5'));var logger=require(_0xf37d('0x6'))(_0xf37d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf37d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50edaa,_0x32b479,_0x9190a8){return new BPromise(function(_0x29b922,_0x18050f){return client[_0xf37d('0x9')](_0x50edaa,_0x9190a8)[_0xf37d('0xa')](function(_0x4bbf6b){logger[_0xf37d('0xb')](_0xf37d('0xc'),_0x32b479,'request\x20sent');logger['debug'](_0xf37d('0xd'),_0x32b479,_0xf37d('0xe'),JSON[_0xf37d('0xf')](_0x4bbf6b));if(_0x4bbf6b['error']){if(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x11')]===0x1f4){logger['error'](_0xf37d('0xc'),_0x32b479,_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);return _0x18050f(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);}logger[_0xf37d('0x10')](_0xf37d('0xc'),_0x32b479,_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);return _0x29b922(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x32b479,_0xf37d('0xe'));_0x29b922(_0x4bbf6b[_0xf37d('0x13')][_0xf37d('0x12')]);}})[_0xf37d('0x14')](function(_0x1213a4){logger[_0xf37d('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x32b479,_0x1213a4);_0x18050f(_0x1213a4);});});}exports[_0xf37d('0x15')]=function(_0x1980f7){var _0x594fe3=this;return new Promise(function(_0x1f134d,_0x5bb10e){return db['VoiceCallReport']['findAll']({'raw':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x17')]===undefined?!![]:![]:!![],'where':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x18')]||null:null,'attributes':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x19')]||null:null,'limit':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')]['limit']||null:null,'include':_0x1980f7[_0xf37d('0x16')]?_0x1980f7['options']['include']?_[_0xf37d('0x1a')](_0x1980f7[_0xf37d('0x16')]['include'],function(_0x23682f){return{'model':db[_0x23682f[_0xf37d('0x1b')]],'as':_0x23682f['as'],'attributes':_0x23682f[_0xf37d('0x19')],'include':_0x23682f['include']?_['map'](_0x23682f[_0xf37d('0x1c')],function(_0x3b0965){return{'model':db[_0x3b0965[_0xf37d('0x1b')]],'as':_0x3b0965['as'],'attributes':_0x3b0965[_0xf37d('0x19')],'include':_0x3b0965[_0xf37d('0x1c')]?_['map'](_0x3b0965[_0xf37d('0x1c')],function(_0x16bf6c){return{'model':db[_0x16bf6c[_0xf37d('0x1b')]],'as':_0x16bf6c['as'],'attributes':_0x16bf6c[_0xf37d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa024b7){logger[_0xf37d('0xb')](_0xf37d('0x15'),_0x1980f7);logger[_0xf37d('0x1d')]('GetVoiceCallReport',_0x1980f7,JSON[_0xf37d('0xf')](_0xa024b7));_0x1f134d(_0xa024b7);})['catch'](function(_0x3ea8f5){logger[_0xf37d('0x10')](_0xf37d('0x15'),_0x3ea8f5[_0xf37d('0x12')],_0x1980f7);_0x5bb10e(_0x594fe3[_0xf37d('0x10')](0x1f4,_0x3ea8f5['message']));});});};exports[_0xf37d('0x1e')]=function(_0x3382a4){var _0x2ad74d=this;return new Promise(function(_0x22c280,_0x4d7aeb){return db[_0xf37d('0x1f')]['create'](_0x3382a4[_0xf37d('0x20')],{'raw':_0x3382a4[_0xf37d('0x16')]?_0x3382a4['options'][_0xf37d('0x17')]===undefined?!![]:![]:!![]})[_0xf37d('0xa')](function(_0x234473){logger[_0xf37d('0xb')]('CreateVoiceCallReport',_0x3382a4);logger[_0xf37d('0x1d')]('CreateVoiceCallReport',_0x3382a4,JSON[_0xf37d('0xf')](_0x234473));_0x22c280(_0x234473);})[_0xf37d('0x14')](function(_0x523c56){logger[_0xf37d('0x10')]('CreateVoiceCallReport',_0x523c56[_0xf37d('0x12')],_0x3382a4);_0x4d7aeb(_0x2ad74d[_0xf37d('0x10')](0x1f4,_0x523c56[_0xf37d('0x12')]));});});};exports[_0xf37d('0x21')]=function(_0x5358de){var _0x1862ec=this;return new Promise(function(_0x381408,_0x3c2afc){return db[_0xf37d('0x1f')][_0xf37d('0x22')](_0x5358de[_0xf37d('0x20')],{'raw':_0x5358de[_0xf37d('0x16')]?_0x5358de[_0xf37d('0x16')][_0xf37d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5358de['options']?_0x5358de[_0xf37d('0x16')][_0xf37d('0x18')]||null:null,'attributes':_0x5358de['options']?_0x5358de['options'][_0xf37d('0x19')]||null:null,'limit':_0x5358de[_0xf37d('0x16')]?_0x5358de['options'][_0xf37d('0x23')]||null:null})[_0xf37d('0xa')](function(_0x592be2){logger['info'](_0xf37d('0x21'),_0x5358de);logger[_0xf37d('0x1d')]('UpdateVoiceCallReport',_0x5358de,JSON[_0xf37d('0xf')](_0x592be2));_0x381408(_0x592be2);})[_0xf37d('0x14')](function(_0x4faa4b){logger['error']('UpdateVoiceCallReport',_0x4faa4b[_0xf37d('0x12')],_0x5358de);_0x3c2afc(_0x1862ec[_0xf37d('0x10')](0x1f4,_0x4faa4b[_0xf37d('0x12')]));});});}; \ No newline at end of file +var _0xee14=['GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result'];(function(_0x54cf62,_0x51eb75){var _0x4ea084=function(_0x524899){while(--_0x524899){_0x54cf62['push'](_0x54cf62['shift']());}};_0x4ea084(++_0x51eb75);}(_0xee14,0x166));var _0x4ee1=function(_0xfb07c6,_0x331873){_0xfb07c6=_0xfb07c6-0x0;var _0x5060c4=_0xee14[_0xfb07c6];return _0x5060c4;};'use strict';var _=require(_0x4ee1('0x0'));var util=require('util');var moment=require(_0x4ee1('0x1'));var BPromise=require(_0x4ee1('0x2'));var rs=require(_0x4ee1('0x3'));var fs=require('fs');var Redis=require(_0x4ee1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var config=require(_0x4ee1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4ee1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17312a,_0x387527,_0x43b89e){return new BPromise(function(_0x3f970e,_0x21b5d1){return client[_0x4ee1('0xa')](_0x17312a,_0x43b89e)[_0x4ee1('0xb')](function(_0x367572){logger[_0x4ee1('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x387527,'request\x20sent');logger[_0x4ee1('0xd')](_0x4ee1('0xe'),_0x387527,_0x4ee1('0xf'),JSON[_0x4ee1('0x10')](_0x367572));if(_0x367572[_0x4ee1('0x11')]){if(_0x367572[_0x4ee1('0x11')][_0x4ee1('0x12')]===0x1f4){logger[_0x4ee1('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x387527,_0x367572[_0x4ee1('0x11')][_0x4ee1('0x13')]);return _0x21b5d1(_0x367572[_0x4ee1('0x11')]['message']);}logger[_0x4ee1('0x11')](_0x4ee1('0x14'),_0x387527,_0x367572['error']['message']);return _0x3f970e(_0x367572[_0x4ee1('0x11')][_0x4ee1('0x13')]);}else{logger[_0x4ee1('0xc')](_0x4ee1('0x14'),_0x387527,_0x4ee1('0xf'));_0x3f970e(_0x367572[_0x4ee1('0x15')]['message']);}})['catch'](function(_0x5e5738){logger[_0x4ee1('0x11')](_0x4ee1('0x14'),_0x387527,_0x5e5738);_0x21b5d1(_0x5e5738);});});}exports[_0x4ee1('0x16')]=function(_0x108644){var _0xd9c6fd=this;return new Promise(function(_0x4f7ebe,_0xd8ab2e){return db[_0x4ee1('0x17')][_0x4ee1('0x18')]({'raw':_0x108644['options']?_0x108644[_0x4ee1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x108644['options']?_0x108644[_0x4ee1('0x19')][_0x4ee1('0x1a')]||null:null,'attributes':_0x108644['options']?_0x108644[_0x4ee1('0x19')][_0x4ee1('0x1b')]||null:null,'limit':_0x108644[_0x4ee1('0x19')]?_0x108644['options'][_0x4ee1('0x1c')]||null:null,'include':_0x108644[_0x4ee1('0x19')]?_0x108644['options'][_0x4ee1('0x1d')]?_[_0x4ee1('0x1e')](_0x108644[_0x4ee1('0x19')][_0x4ee1('0x1d')],function(_0x600fc1){return{'model':db[_0x600fc1[_0x4ee1('0x1f')]],'as':_0x600fc1['as'],'attributes':_0x600fc1[_0x4ee1('0x1b')],'include':_0x600fc1[_0x4ee1('0x1d')]?_[_0x4ee1('0x1e')](_0x600fc1['include'],function(_0x3799ab){return{'model':db[_0x3799ab['model']],'as':_0x3799ab['as'],'attributes':_0x3799ab[_0x4ee1('0x1b')],'include':_0x3799ab[_0x4ee1('0x1d')]?_['map'](_0x3799ab['include'],function(_0x43c8bb){return{'model':db[_0x43c8bb[_0x4ee1('0x1f')]],'as':_0x43c8bb['as'],'attributes':_0x43c8bb[_0x4ee1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ee1('0xb')](function(_0x287012){logger[_0x4ee1('0xc')](_0x4ee1('0x16'),_0x108644);logger[_0x4ee1('0xd')](_0x4ee1('0x16'),_0x108644,JSON[_0x4ee1('0x10')](_0x287012));_0x4f7ebe(_0x287012);})[_0x4ee1('0x20')](function(_0x2434ac){logger[_0x4ee1('0x11')](_0x4ee1('0x16'),_0x2434ac['message'],_0x108644);_0xd8ab2e(_0xd9c6fd[_0x4ee1('0x11')](0x1f4,_0x2434ac[_0x4ee1('0x13')]));});});};exports[_0x4ee1('0x21')]=function(_0x140cb5){var _0x124a15=this;return new Promise(function(_0x103fad,_0x57bbad){return db['VoiceCallReport'][_0x4ee1('0x22')](_0x140cb5[_0x4ee1('0x23')],{'raw':_0x140cb5[_0x4ee1('0x19')]?_0x140cb5[_0x4ee1('0x19')][_0x4ee1('0x24')]===undefined?!![]:![]:!![]})[_0x4ee1('0xb')](function(_0x579428){logger['info'](_0x4ee1('0x21'),_0x140cb5);logger[_0x4ee1('0xd')](_0x4ee1('0x21'),_0x140cb5,JSON[_0x4ee1('0x10')](_0x579428));_0x103fad(_0x579428);})['catch'](function(_0x3d0582){logger[_0x4ee1('0x11')](_0x4ee1('0x21'),_0x3d0582[_0x4ee1('0x13')],_0x140cb5);_0x57bbad(_0x124a15[_0x4ee1('0x11')](0x1f4,_0x3d0582[_0x4ee1('0x13')]));});});};exports[_0x4ee1('0x25')]=function(_0x28526f){var _0x58f51e=this;return new Promise(function(_0x1c4875,_0x15e849){return db[_0x4ee1('0x17')]['update'](_0x28526f[_0x4ee1('0x23')],{'raw':_0x28526f[_0x4ee1('0x19')]?_0x28526f[_0x4ee1('0x19')][_0x4ee1('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28526f[_0x4ee1('0x19')]?_0x28526f[_0x4ee1('0x19')]['where']||null:null,'attributes':_0x28526f['options']?_0x28526f[_0x4ee1('0x19')][_0x4ee1('0x1b')]||null:null,'limit':_0x28526f[_0x4ee1('0x19')]?_0x28526f[_0x4ee1('0x19')][_0x4ee1('0x1c')]||null:null})[_0x4ee1('0xb')](function(_0x2cf6be){logger[_0x4ee1('0xc')]('UpdateVoiceCallReport',_0x28526f);logger[_0x4ee1('0xd')](_0x4ee1('0x25'),_0x28526f,JSON[_0x4ee1('0x10')](_0x2cf6be));_0x1c4875(_0x2cf6be);})[_0x4ee1('0x20')](function(_0x2fada5){logger['error'](_0x4ee1('0x25'),_0x2fada5[_0x4ee1('0x13')],_0x28526f);_0x15e849(_0x58f51e['error'](0x1f4,_0x2fada5[_0x4ee1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 26beb1c..d40e600 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 _0x0b5d=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','show','post','isAuthenticated'];(function(_0x3b8522,_0x203c72){var _0x108c21=function(_0x371054){while(--_0x371054){_0x3b8522['push'](_0x3b8522['shift']());}};_0x108c21(++_0x203c72);}(_0x0b5d,0x136));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd0b5('0x0'));var path=require(_0xd0b5('0x1'));var timeout=require(_0xd0b5('0x2'));var express=require(_0xd0b5('0x3'));var router=express[_0xd0b5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0b5('0x5'));var config=require(_0xd0b5('0x6'));var controller=require(_0xd0b5('0x7'));router[_0xd0b5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd0b5('0x8')](_0xd0b5('0x9'),auth['isAuthenticated'](),controller[_0xd0b5('0xa')]);router[_0xd0b5('0xb')]('/',auth[_0xd0b5('0xc')](),controller['create']);router[_0xd0b5('0xd')](_0xd0b5('0x9'),auth[_0xd0b5('0xc')](),controller[_0xd0b5('0xe')]);router[_0xd0b5('0xf')](_0xd0b5('0x9'),auth[_0xd0b5('0xc')](),controller['destroy']);module[_0xd0b5('0x10')]=router; \ No newline at end of file +var _0x0e6b=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','show','post','isAuthenticated','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x536c07,_0x5c4c1a){var _0x5dd8e4=function(_0x44b010){while(--_0x44b010){_0x536c07['push'](_0x536c07['shift']());}};_0x5dd8e4(++_0x5c4c1a);}(_0x0e6b,0x161));var _0xb0e6=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x0e6b[_0x3f4891];return _0x54f2d8;};'use strict';var multer=require(_0xb0e6('0x0'));var util=require(_0xb0e6('0x1'));var path=require(_0xb0e6('0x2'));var timeout=require(_0xb0e6('0x3'));var express=require(_0xb0e6('0x4'));var router=express[_0xb0e6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb0e6('0x6'));var interaction=require(_0xb0e6('0x7'));var config=require(_0xb0e6('0x8'));var controller=require(_0xb0e6('0x9'));router[_0xb0e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0e6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0e6('0xc')]);router[_0xb0e6('0xd')]('/',auth[_0xb0e6('0xe')](),controller[_0xb0e6('0xf')]);router[_0xb0e6('0x10')](_0xb0e6('0x11'),auth[_0xb0e6('0xe')](),controller[_0xb0e6('0x12')]);router['delete'](_0xb0e6('0x11'),auth['isAuthenticated'](),controller[_0xb0e6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 59f1228..62f2234 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 _0xed53=['options','join','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x47e611,_0x141ea4){var _0x4a3809=function(_0x1d0004){while(--_0x1d0004){_0x47e611['push'](_0x47e611['shift']());}};_0x4a3809(++_0x141ea4);}(_0xed53,0x12d));var _0x3ed5=function(_0x3d7c5e,_0x28be64){_0x3d7c5e=_0x3d7c5e-0x0;var _0x3d3e24=_0xed53[_0x3d7c5e];return _0x3d3e24;};'use strict';var Sequelize=require(_0x3ed5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3ed5('0x1')],'unique':_0x3ed5('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x3ed5('0x1')],'set':function(_0x3e7f0f){this['setDataValue'](_0x3ed5('0x3'),_0x3e7f0f?_0x3e7f0f[_0x3ed5('0x4')](''):[]);},'get':function(){return this[_0x3ed5('0x5')](_0x3ed5('0x3'))?this[_0x3ed5('0x5')](_0x3ed5('0x3'))[_0x3ed5('0x6')](''):[];}},'auth':{'type':Sequelize[_0x3ed5('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x3ed5('0x1')]},'record':{'type':Sequelize[_0x3ed5('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3ed5('0x1')]},'description':{'type':Sequelize[_0x3ed5('0x1')]}}; \ No newline at end of file +var _0xf406=['STRING','name','setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf406,0x6a));var _0x6f40=function(_0x2f1ac4,_0x236a72){_0x2f1ac4=_0x2f1ac4-0x0;var _0x18e1a5=_0xf406[_0x2f1ac4];return _0x18e1a5;};'use strict';var Sequelize=require(_0x6f40('0x0'));module[_0x6f40('0x1')]={'name':{'type':Sequelize[_0x6f40('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x6f40('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x6f40('0x2')],'set':function(_0x3b594c){this[_0x6f40('0x4')](_0x6f40('0x5'),_0x3b594c?_0x3b594c['join'](''):[]);},'get':function(){return this[_0x6f40('0x6')](_0x6f40('0x5'))?this[_0x6f40('0x6')](_0x6f40('0x5'))[_0x6f40('0x7')](''):[];}},'auth':{'type':Sequelize[_0x6f40('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x6f40('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6f40('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 47e4449..ad903dc 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 _0x851d=['merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','ChanSpies','UserProfileResource','then','end','error','stack','name','send','index','map','VoiceChanSpy','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x27c67a,_0x1a45b5){var _0x19b96e=function(_0x251ebe){while(--_0x251ebe){_0x27c67a['push'](_0x27c67a['shift']());}};_0x19b96e(++_0x1a45b5);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd851('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd851('0x1'));var jsonpatch=require(_0xd851('0x2'));var rp=require('request-promise');var moment=require(_0xd851('0x3'));var BPromise=require(_0xd851('0x4'));var Mustache=require(_0xd851('0x5'));var util=require(_0xd851('0x6'));var path=require(_0xd851('0x7'));var sox=require(_0xd851('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd851('0x9'));var _=require(_0xd851('0xa'));var squel=require(_0xd851('0xb'));var crypto=require(_0xd851('0xc'));var jsforce=require(_0xd851('0xd'));var deskjs=require(_0xd851('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd851('0xf'));var Papa=require('papaparse');var Redis=require(_0xd851('0x10'));var authService=require(_0xd851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd851('0x12'));var hardwareService=require(_0xd851('0x13'));var logger=require(_0xd851('0x14'))(_0xd851('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd851('0x16'));var db=require(_0xd851('0x17'))['db'];function respondWithStatusCode(_0x173c88,_0x1188d5){_0x1188d5=_0x1188d5||0xcc;return function(_0x5a01bf){if(_0x5a01bf){return _0x173c88[_0xd851('0x18')](_0x1188d5);}return _0x173c88[_0xd851('0x19')](_0x1188d5)['end']();};}function respondWithResult(_0x399128,_0x2705fd){_0x2705fd=_0x2705fd||0xc8;return function(_0x237dda){if(_0x237dda){return _0x399128['status'](_0x2705fd)[_0xd851('0x1a')](_0x237dda);}};}function respondWithFilteredResult(_0x370ad3,_0xb26cf1){return function(_0x1e2ee7){if(_0x1e2ee7){var _0x1b3d4c=typeof _0xb26cf1[_0xd851('0x1b')]==='undefined'&&typeof _0xb26cf1[_0xd851('0x1c')]===_0xd851('0x1d');var _0x1f4f98=_0x1e2ee7[_0xd851('0x1e')];var _0x12b309=_0x1b3d4c?0x0:_0xb26cf1[_0xd851('0x1b')];var _0x3559a1=_0x1b3d4c?_0x1e2ee7['count']:_0xb26cf1['offset']+_0xb26cf1[_0xd851('0x1c')];var _0x8ddf05;if(_0x3559a1>=_0x1f4f98){_0x3559a1=_0x1f4f98;_0x8ddf05=0xc8;}else{_0x8ddf05=0xce;}_0x370ad3[_0xd851('0x19')](_0x8ddf05);return _0x370ad3[_0xd851('0x1f')](_0xd851('0x20'),_0x12b309+'-'+_0x3559a1+'/'+_0x1f4f98)[_0xd851('0x1a')](_0x1e2ee7);}return null;};}function patchUpdates(_0x8585e5){return function(_0x239356){try{jsonpatch[_0xd851('0x21')](_0x239356,_0x8585e5,!![]);}catch(_0x46773f){return BPromise[_0xd851('0x22')](_0x46773f);}return _0x239356[_0xd851('0x23')]();};}function saveUpdates(_0x17cb41,_0x4e38af){return function(_0x404ba4){if(_0x404ba4){return _0x404ba4[_0xd851('0x24')](_0x17cb41)['then'](function(_0x3856a8){return _0x3856a8;});}return null;};}function removeEntity(_0x30177c,_0x2f888e){return function(_0x4bb814){if(_0x4bb814){return _0x4bb814['destroy']()['then'](function(){var _0x35a9b0=_0x4bb814[_0xd851('0x25')]({'plain':!![]});var _0x2f2009=_0xd851('0x26');return db[_0xd851('0x27')]['destroy']({'where':{'type':_0x2f2009,'resourceId':_0x35a9b0['id']}})[_0xd851('0x28')](function(){return _0x4bb814;});})['then'](function(){_0x30177c[_0xd851('0x19')](0xcc)[_0xd851('0x29')]();});}};}function handleEntityNotFound(_0x39f9d4,_0x36457c){return function(_0x337da5){if(!_0x337da5){_0x39f9d4[_0xd851('0x18')](0x194);}return _0x337da5;};}function handleError(_0x4d1fa6,_0x94977e){_0x94977e=_0x94977e||0x1f4;return function(_0x441c27){logger[_0xd851('0x2a')](_0x441c27[_0xd851('0x2b')]);if(_0x441c27[_0xd851('0x2c')]){delete _0x441c27[_0xd851('0x2c')];}_0x4d1fa6[_0xd851('0x19')](_0x94977e)[_0xd851('0x2d')](_0x441c27);};}exports[_0xd851('0x2e')]=function(_0x2ef08d,_0xce3947){var _0x132df8={},_0x598ad4={},_0x15ce59={'count':0x0,'rows':[]};var _0x990498=_[_0xd851('0x2f')](db[_0xd851('0x30')]['rawAttributes'],function(_0x165f79){return{'name':_0x165f79['fieldName'],'type':_0x165f79['type'][_0xd851('0x31')]};});_0x598ad4[_0xd851('0x32')]=_['map'](_0x990498,'name');_0x598ad4[_0xd851('0x33')]=_[_0xd851('0x34')](_0x2ef08d[_0xd851('0x33')]);_0x598ad4[_0xd851('0x35')]=_[_0xd851('0x36')](_0x598ad4['model'],_0x598ad4['query']);_0x132df8[_0xd851('0x37')]=_[_0xd851('0x36')](_0x598ad4[_0xd851('0x32')],qs[_0xd851('0x38')](_0x2ef08d[_0xd851('0x33')][_0xd851('0x38')]));_0x132df8[_0xd851('0x37')]=_0x132df8[_0xd851('0x37')]['length']?_0x132df8['attributes']:_0x598ad4['model'];if(!_0x2ef08d[_0xd851('0x33')][_0xd851('0x39')](_0xd851('0x3a'))){_0x132df8[_0xd851('0x1c')]=qs[_0xd851('0x1c')](_0x2ef08d['query'][_0xd851('0x1c')]);_0x132df8[_0xd851('0x1b')]=qs['offset'](_0x2ef08d[_0xd851('0x33')][_0xd851('0x1b')]);}_0x132df8[_0xd851('0x3b')]=qs[_0xd851('0x3c')](_0x2ef08d['query']['sort']);_0x132df8[_0xd851('0x3d')]=qs['filters'](_[_0xd851('0x3e')](_0x2ef08d[_0xd851('0x33')],_0x598ad4[_0xd851('0x35')]),_0x990498);if(_0x2ef08d['query']['filter']){_0x132df8[_0xd851('0x3d')]=_[_0xd851('0x3f')](_0x132df8[_0xd851('0x3d')],{'$or':_['map'](_0x990498,function(_0x326631){if(_0x326631[_0xd851('0x40')]!==_0xd851('0x41')){var _0x321d6e={};_0x321d6e[_0x326631['name']]={'$like':'%'+_0x2ef08d['query'][_0xd851('0x42')]+'%'};return _0x321d6e;}})});}_0x132df8=_[_0xd851('0x3f')]({},_0x132df8,_0x2ef08d[_0xd851('0x43')]);var _0x5056bc={'where':_0x132df8[_0xd851('0x3d')]};return db[_0xd851('0x30')][_0xd851('0x1e')](_0x5056bc)['then'](function(_0x1ebf20){_0x15ce59[_0xd851('0x1e')]=_0x1ebf20;if(_0x2ef08d[_0xd851('0x33')][_0xd851('0x44')]){_0x132df8[_0xd851('0x45')]=[{'all':!![]}];}return db[_0xd851('0x30')][_0xd851('0x46')](_0x132df8);})[_0xd851('0x28')](function(_0x23dc50){_0x15ce59[_0xd851('0x47')]=_0x23dc50;return _0x15ce59;})[_0xd851('0x28')](respondWithFilteredResult(_0xce3947,_0x132df8))[_0xd851('0x48')](handleError(_0xce3947,null));};exports['show']=function(_0x5e4f40,_0x4fe987){var _0x247bb3={'raw':![],'where':{'id':_0x5e4f40['params']['id']}},_0x273868={};_0x273868[_0xd851('0x32')]=_[_0xd851('0x34')](db[_0xd851('0x30')][_0xd851('0x49')]);_0x273868['query']=_[_0xd851('0x34')](_0x5e4f40[_0xd851('0x33')]);_0x273868[_0xd851('0x35')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],_0x273868['query']);_0x247bb3[_0xd851('0x37')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],qs[_0xd851('0x38')](_0x5e4f40['query'][_0xd851('0x38')]));_0x247bb3[_0xd851('0x37')]=_0x247bb3[_0xd851('0x37')][_0xd851('0x4a')]?_0x247bb3['attributes']:_0x273868['model'];if(_0x5e4f40[_0xd851('0x33')][_0xd851('0x44')]){_0x247bb3[_0xd851('0x45')]=[{'all':!![]}];}_0x247bb3=_[_0xd851('0x3f')]({},_0x247bb3,_0x5e4f40[_0xd851('0x43')]);return db[_0xd851('0x30')][_0xd851('0x4b')](_0x247bb3)[_0xd851('0x28')](handleEntityNotFound(_0x4fe987,null))[_0xd851('0x28')](respondWithResult(_0x4fe987,null))[_0xd851('0x48')](handleError(_0x4fe987,null));};exports[_0xd851('0x4c')]=function(_0x3bcd39,_0x3828fe){return db['VoiceChanSpy'][_0xd851('0x4c')](_0x3bcd39[_0xd851('0x4d')],{})[_0xd851('0x28')](function(_0x38014d){var _0x5b9d03=_0x3bcd39[_0xd851('0x4e')][_0xd851('0x25')]({'plain':!![]});if(!_0x5b9d03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b9d03['role']===_0xd851('0x4e')){var _0x2d9ecb=_0x38014d['get']({'plain':!![]});var _0x95c37e=_0xd851('0x26');return db[_0xd851('0x4f')][_0xd851('0x4b')]({'where':{'name':_0x95c37e,'userProfileId':_0x5b9d03[_0xd851('0x50')]},'raw':!![]})['then'](function(_0x10cf5b){if(_0x10cf5b&&_0x10cf5b['autoAssociation']===0x0){return db['UserProfileResource'][_0xd851('0x4c')]({'name':_0x2d9ecb[_0xd851('0x2c')],'resourceId':_0x2d9ecb['id'],'type':_0x10cf5b[_0xd851('0x2c')],'sectionId':_0x10cf5b['id']},{})[_0xd851('0x28')](function(){return _0x38014d;});}else{return _0x38014d;}})['catch'](function(_0x4bc500){logger[_0xd851('0x2a')](_0xd851('0x51'),_0x4bc500);throw _0x4bc500;});}return _0x38014d;})['then'](respondWithResult(_0x3828fe,0xc9))[_0xd851('0x48')](handleError(_0x3828fe,null));};exports[_0xd851('0x24')]=function(_0x2b8db2,_0x2478ad){if(_0x2b8db2['body']['id']){delete _0x2b8db2[_0xd851('0x4d')]['id'];}return db[_0xd851('0x30')]['find']({'where':{'id':_0x2b8db2[_0xd851('0x52')]['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x2478ad,null))[_0xd851('0x28')](saveUpdates(_0x2b8db2[_0xd851('0x4d')],null))[_0xd851('0x28')](respondWithResult(_0x2478ad,null))[_0xd851('0x48')](handleError(_0x2478ad,null));};exports[_0xd851('0x53')]=function(_0x129412,_0x1118cc){return db['VoiceChanSpy'][_0xd851('0x4b')]({'where':{'id':_0x129412['params']['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x1118cc,null))[_0xd851('0x28')](removeEntity(_0x1118cc,null))['catch'](handleError(_0x1118cc,null));}; \ No newline at end of file +var _0x0834=['catch','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','params','zip-dir','fast-json-patch','mustache','util','sox','to-csv','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','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','reject','save','then','get','ChanSpies','destroy','end','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','offset','sort','filters','filter','where','VIRTUAL','options','include','findAll','rows'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x0834,0x18e));var _0x4083=function(_0x4de2f6,_0xc8ab81){_0x4de2f6=_0x4de2f6-0x0;var _0x271c41=_0x0834[_0x4de2f6];return _0x271c41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4083('0x0'));var jsonpatch=require(_0x4083('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4083('0x2'));var util=require(_0x4083('0x3'));var path=require('path');var sox=require(_0x4083('0x4'));var csv=require(_0x4083('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4083('0x6'));var _=require('lodash');var squel=require(_0x4083('0x7'));var crypto=require(_0x4083('0x8'));var jsforce=require(_0x4083('0x9'));var deskjs=require(_0x4083('0xa'));var toCsv=require(_0x4083('0x5'));var querystring=require(_0x4083('0xb'));var Papa=require(_0x4083('0xc'));var Redis=require(_0x4083('0xd'));var authService=require(_0x4083('0xe'));var qs=require(_0x4083('0xf'));var as=require(_0x4083('0x10'));var hardwareService=require(_0x4083('0x11'));var logger=require(_0x4083('0x12'))(_0x4083('0x13'));var utils=require(_0x4083('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4083('0x15'))['db'];function respondWithStatusCode(_0x3dfd39,_0x4e6fb2){_0x4e6fb2=_0x4e6fb2||0xcc;return function(_0x2a24ac){if(_0x2a24ac){return _0x3dfd39[_0x4083('0x16')](_0x4e6fb2);}return _0x3dfd39[_0x4083('0x17')](_0x4e6fb2)['end']();};}function respondWithResult(_0x4bef74,_0xb5badb){_0xb5badb=_0xb5badb||0xc8;return function(_0x392f82){if(_0x392f82){return _0x4bef74['status'](_0xb5badb)[_0x4083('0x18')](_0x392f82);}};}function respondWithFilteredResult(_0x316e54,_0xc7c267){return function(_0x146632){if(_0x146632){var _0x38757d=typeof _0xc7c267['offset']===_0x4083('0x19')&&typeof _0xc7c267[_0x4083('0x1a')]===_0x4083('0x19');var _0x2658b0=_0x146632['count'];var _0x4e7d59=_0x38757d?0x0:_0xc7c267['offset'];var _0xafda0c=_0x38757d?_0x146632[_0x4083('0x1b')]:_0xc7c267['offset']+_0xc7c267[_0x4083('0x1a')];var _0x4a16dc;if(_0xafda0c>=_0x2658b0){_0xafda0c=_0x2658b0;_0x4a16dc=0xc8;}else{_0x4a16dc=0xce;}_0x316e54[_0x4083('0x17')](_0x4a16dc);return _0x316e54[_0x4083('0x1c')](_0x4083('0x1d'),_0x4e7d59+'-'+_0xafda0c+'/'+_0x2658b0)[_0x4083('0x18')](_0x146632);}return null;};}function patchUpdates(_0x4b32e9){return function(_0x3b29b1){try{jsonpatch['apply'](_0x3b29b1,_0x4b32e9,!![]);}catch(_0x3d8045){return BPromise[_0x4083('0x1e')](_0x3d8045);}return _0x3b29b1[_0x4083('0x1f')]();};}function saveUpdates(_0x94d72c,_0x5d7461){return function(_0x328efe){if(_0x328efe){return _0x328efe['update'](_0x94d72c)[_0x4083('0x20')](function(_0x3f990d){return _0x3f990d;});}return null;};}function removeEntity(_0x577a80,_0x52a440){return function(_0x3ce623){if(_0x3ce623){return _0x3ce623['destroy']()['then'](function(){var _0x5f034c=_0x3ce623[_0x4083('0x21')]({'plain':!![]});var _0xb2fbb5=_0x4083('0x22');return db['UserProfileResource'][_0x4083('0x23')]({'where':{'type':_0xb2fbb5,'resourceId':_0x5f034c['id']}})[_0x4083('0x20')](function(){return _0x3ce623;});})[_0x4083('0x20')](function(){_0x577a80['status'](0xcc)[_0x4083('0x24')]();});}};}function handleEntityNotFound(_0x323736,_0x5f5679){return function(_0x315458){if(!_0x315458){_0x323736[_0x4083('0x16')](0x194);}return _0x315458;};}function handleError(_0x2daca5,_0xabc8c7){_0xabc8c7=_0xabc8c7||0x1f4;return function(_0xdf4d9e){logger[_0x4083('0x25')](_0xdf4d9e[_0x4083('0x26')]);if(_0xdf4d9e[_0x4083('0x27')]){delete _0xdf4d9e[_0x4083('0x27')];}_0x2daca5['status'](_0xabc8c7)['send'](_0xdf4d9e);};}exports[_0x4083('0x28')]=function(_0x189e4d,_0x2d4dc6){var _0x108453={},_0x2621ff={},_0x191f79={'count':0x0,'rows':[]};var _0x55832a=_[_0x4083('0x29')](db[_0x4083('0x2a')][_0x4083('0x2b')],function(_0x414ac9){return{'name':_0x414ac9[_0x4083('0x2c')],'type':_0x414ac9[_0x4083('0x2d')]['key']};});_0x2621ff[_0x4083('0x2e')]=_[_0x4083('0x29')](_0x55832a,_0x4083('0x27'));_0x2621ff[_0x4083('0x2f')]=_[_0x4083('0x30')](_0x189e4d[_0x4083('0x2f')]);_0x2621ff['filters']=_[_0x4083('0x31')](_0x2621ff['model'],_0x2621ff[_0x4083('0x2f')]);_0x108453[_0x4083('0x32')]=_['intersection'](_0x2621ff[_0x4083('0x2e')],qs[_0x4083('0x33')](_0x189e4d[_0x4083('0x2f')][_0x4083('0x33')]));_0x108453['attributes']=_0x108453['attributes'][_0x4083('0x34')]?_0x108453[_0x4083('0x32')]:_0x2621ff['model'];if(!_0x189e4d[_0x4083('0x2f')]['hasOwnProperty'](_0x4083('0x35'))){_0x108453['limit']=qs['limit'](_0x189e4d['query'][_0x4083('0x1a')]);_0x108453[_0x4083('0x36')]=qs[_0x4083('0x36')](_0x189e4d[_0x4083('0x2f')][_0x4083('0x36')]);}_0x108453['order']=qs['sort'](_0x189e4d[_0x4083('0x2f')][_0x4083('0x37')]);_0x108453['where']=qs[_0x4083('0x38')](_['pick'](_0x189e4d['query'],_0x2621ff['filters']),_0x55832a);if(_0x189e4d[_0x4083('0x2f')][_0x4083('0x39')]){_0x108453[_0x4083('0x3a')]=_['merge'](_0x108453['where'],{'$or':_[_0x4083('0x29')](_0x55832a,function(_0x4bdbee){if(_0x4bdbee[_0x4083('0x2d')]!==_0x4083('0x3b')){var _0x3264ec={};_0x3264ec[_0x4bdbee[_0x4083('0x27')]]={'$like':'%'+_0x189e4d[_0x4083('0x2f')][_0x4083('0x39')]+'%'};return _0x3264ec;}})});}_0x108453=_['merge']({},_0x108453,_0x189e4d[_0x4083('0x3c')]);var _0x1ad1f1={'where':_0x108453['where']};return db['VoiceChanSpy'][_0x4083('0x1b')](_0x1ad1f1)['then'](function(_0x25aded){_0x191f79[_0x4083('0x1b')]=_0x25aded;if(_0x189e4d[_0x4083('0x2f')]['includeAll']){_0x108453[_0x4083('0x3d')]=[{'all':!![]}];}return db[_0x4083('0x2a')][_0x4083('0x3e')](_0x108453);})['then'](function(_0x116161){_0x191f79[_0x4083('0x3f')]=_0x116161;return _0x191f79;})[_0x4083('0x20')](respondWithFilteredResult(_0x2d4dc6,_0x108453))[_0x4083('0x40')](handleError(_0x2d4dc6,null));};exports[_0x4083('0x41')]=function(_0x468242,_0x4717d5){var _0x466ab6={'raw':![],'where':{'id':_0x468242['params']['id']}},_0x595a4f={};_0x595a4f[_0x4083('0x2e')]=_[_0x4083('0x30')](db[_0x4083('0x2a')][_0x4083('0x2b')]);_0x595a4f[_0x4083('0x2f')]=_[_0x4083('0x30')](_0x468242[_0x4083('0x2f')]);_0x595a4f['filters']=_[_0x4083('0x31')](_0x595a4f[_0x4083('0x2e')],_0x595a4f[_0x4083('0x2f')]);_0x466ab6[_0x4083('0x32')]=_[_0x4083('0x31')](_0x595a4f['model'],qs[_0x4083('0x33')](_0x468242['query']['fields']));_0x466ab6[_0x4083('0x32')]=_0x466ab6[_0x4083('0x32')][_0x4083('0x34')]?_0x466ab6[_0x4083('0x32')]:_0x595a4f['model'];if(_0x468242[_0x4083('0x2f')]['includeAll']){_0x466ab6[_0x4083('0x3d')]=[{'all':!![]}];}_0x466ab6=_[_0x4083('0x42')]({},_0x466ab6,_0x468242[_0x4083('0x3c')]);return db['VoiceChanSpy'][_0x4083('0x43')](_0x466ab6)[_0x4083('0x20')](handleEntityNotFound(_0x4717d5,null))[_0x4083('0x20')](respondWithResult(_0x4717d5,null))['catch'](handleError(_0x4717d5,null));};exports[_0x4083('0x44')]=function(_0x36b5fd,_0x4776d3){return db[_0x4083('0x2a')][_0x4083('0x44')](_0x36b5fd[_0x4083('0x45')],{})[_0x4083('0x20')](function(_0x56da3e){var _0x607d65=_0x36b5fd[_0x4083('0x46')][_0x4083('0x21')]({'plain':!![]});if(!_0x607d65)throw new Error(_0x4083('0x47'));if(_0x607d65['role']===_0x4083('0x46')){var _0x5bf897=_0x56da3e[_0x4083('0x21')]({'plain':!![]});var _0x2c7e01='ChanSpies';return db[_0x4083('0x48')][_0x4083('0x43')]({'where':{'name':_0x2c7e01,'userProfileId':_0x607d65[_0x4083('0x49')]},'raw':!![]})[_0x4083('0x20')](function(_0x2194ef){if(_0x2194ef&&_0x2194ef[_0x4083('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bf897[_0x4083('0x27')],'resourceId':_0x5bf897['id'],'type':_0x2194ef[_0x4083('0x27')],'sectionId':_0x2194ef['id']},{})['then'](function(){return _0x56da3e;});}else{return _0x56da3e;}})[_0x4083('0x40')](function(_0x367e67){logger[_0x4083('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x367e67);throw _0x367e67;});}return _0x56da3e;})[_0x4083('0x20')](respondWithResult(_0x4776d3,0xc9))['catch'](handleError(_0x4776d3,null));};exports[_0x4083('0x4b')]=function(_0x402690,_0x209be3){if(_0x402690[_0x4083('0x45')]['id']){delete _0x402690[_0x4083('0x45')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x402690[_0x4083('0x4c')]['id']}})['then'](handleEntityNotFound(_0x209be3,null))[_0x4083('0x20')](saveUpdates(_0x402690[_0x4083('0x45')],null))['then'](respondWithResult(_0x209be3,null))['catch'](handleError(_0x209be3,null));};exports[_0x4083('0x23')]=function(_0x450dce,_0x2b7ded){return db[_0x4083('0x2a')][_0x4083('0x43')]({'where':{'id':_0x450dce['params']['id']}})[_0x4083('0x20')](handleEntityNotFound(_0x2b7ded,null))['then'](removeEntity(_0x2b7ded,null))[_0x4083('0x40')](handleError(_0x2b7ded,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index bb15611..f201343 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 _0x83ef=['concat','internal','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','catch','VoiceExtension','destroy','bulkCreate','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','Set','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','password','name','options','join','length'];(function(_0x5dc539,_0x16480d){var _0x38a440=function(_0x4344e8){while(--_0x4344e8){_0x5dc539['push'](_0x5dc539['shift']());}};_0x38a440(++_0x16480d);}(_0x83ef,0x1ef));var _0xf83e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x83ef[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xf83e('0x0'));var BPromise=require(_0xf83e('0x1'));var attributes=require(_0xf83e('0x2'));var getUserApplications=function(_0x189c8b,_0x191240,_0x15445e){var _0x5e86b1=0x1;var _0x44090e=[];var _0xdce4a5={'context':_0x191240[_0xf83e('0x3')]||_0xf83e('0x4'),'exten':util[_0xf83e('0x5')](_0xf83e('0x6'),_0x189c8b[_0xf83e('0x7')],_0x15445e),'type':_0xf83e('0x8'),'isApp':![],'ChanSpyId':_0x189c8b['id'],'UserId':_0x191240['id']};_0x44090e['push'](_['merge']({'app':_0xf83e('0x9'),'appdata':util[_0xf83e('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x5e86b1++},_0xdce4a5));if(_0x189c8b[_0xf83e('0xa')]){_0x44090e['push'](_[_0xf83e('0xb')]({'app':_0xf83e('0xc'),'appdata':util[_0xf83e('0x5')](_0xf83e('0xd'),_0x189c8b[_0xf83e('0xe')]),'priority':_0x5e86b1++},_0xdce4a5));}if(_0x189c8b[_0xf83e('0xf')]){_0x44090e[_0xf83e('0x10')](_[_0xf83e('0xb')]({'app':_0xf83e('0x11'),'appdata':_0x189c8b[_0xf83e('0x12')],'priority':_0x5e86b1++},_0xdce4a5));}_0x44090e[_0xf83e('0x10')](_[_0xf83e('0xb')]({'app':'ChanSpy','appdata':util[_0xf83e('0x5')]('SIP/%s,%s',_0x191240[_0xf83e('0x13')],_0x189c8b[_0xf83e('0x14')]?_0x189c8b[_0xf83e('0x14')][_0xf83e('0x15')](''):''),'priority':_0x5e86b1++},_0xdce4a5));if(_0x189c8b[_0xf83e('0xa')]){_0x44090e['push'](_['merge']({'app':'StopMixMonitor','priority':_0x5e86b1++},_0xdce4a5));}return _0x44090e;};var getChanSpyApplications=function(_0x3dbdd3,_0x5da457){var _0x470c9d=[];for(var _0x18a43c=0x0,_0x12ae2a=0x1;_0x18a43c<_0x5da457[_0xf83e('0x16')];_0x18a43c++,_0x12ae2a=0x1){_0x470c9d=_0x470c9d[_0xf83e('0x17')](getUserApplications(_0x3dbdd3,_0x5da457[_0x18a43c],_0x5da457[_0x18a43c][_0xf83e('0x18')]));if(_0x5da457[_0x18a43c][_0xf83e('0x18')]!=_0x5da457[_0x18a43c]['name']){_0x470c9d=_0x470c9d[_0xf83e('0x17')](getUserApplications(_0x3dbdd3,_0x5da457[_0x18a43c],_0x5da457[_0x18a43c][_0xf83e('0x13')]));}}return _0x470c9d;};var getChanSpyPromise=function(_0x3b930f,_0x4f8315){return new BPromise(function(_0x1d43fe,_0x473d20){return _0x3b930f['User'][_0xf83e('0x19')]({'attributes':['id','name',_0xf83e('0x18')],'where':{'role':_0xf83e('0x1a'),'chanspy':!![]},'raw':!![]})[_0xf83e('0x1b')](function(_0xde13a5){if(_0xde13a5){return _0x1d43fe(getChanSpyApplications(_0x4f8315,_0xde13a5));}return _0x1d43fe([]);})['catch'](function(_0x2b653f){_0x473d20(_0x2b653f);});});};module[_0xf83e('0x1c')]=function(_0x1f4cb8,_0x213a13){var _0x279934=_0x1f4cb8[_0xf83e('0x1d')];return _0x1f4cb8[_0xf83e('0x1e')](_0xf83e('0x1f'),attributes,{'tableName':_0xf83e('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x47bdda,_0x2e48bf,_0x129370){return getChanSpyPromise(_0x279934,_0x47bdda)['then'](function(_0x476a1b){if(_0x476a1b&&_0x476a1b[_0xf83e('0x16')]){return _0x279934['VoiceExtension']['bulkCreate'](_0x476a1b);}})[_0xf83e('0x1b')](function(){_0x129370();})[_0xf83e('0x21')](function(_0x4cbfbc){_0x129370(_0x4cbfbc);});},'afterUpdate':function(_0x3cc5a5,_0x2cb187,_0x4383c6){return _0x279934[_0xf83e('0x22')][_0xf83e('0x23')]({'where':{'ChanSpyId':_0x3cc5a5['id']}})['then'](function(){return getChanSpyPromise(_0x279934,_0x3cc5a5);})[_0xf83e('0x1b')](function(_0x5bd78e){if(_0x5bd78e&&_0x5bd78e[_0xf83e('0x16')]){return _0x279934[_0xf83e('0x22')][_0xf83e('0x24')](_0x5bd78e);}})[_0xf83e('0x1b')](function(){_0x4383c6();})[_0xf83e('0x21')](function(_0x1355bf){_0x4383c6(_0x1355bf);});},'afterDestroy':function(_0x4ebf0c,_0x181562,_0x461835){return _0x279934[_0xf83e('0x22')][_0xf83e('0x23')]({'where':{'ChanSpyId':_0x4ebf0c['id']}})[_0xf83e('0x1b')](function(){_0x461835();})[_0xf83e('0x21')](function(_0x5add7f){_0x461835(_0x5add7f);});}}});}; \ No newline at end of file +var _0xc1d7=['define','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','push','Set','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','then','catch','models'];(function(_0x859340,_0x44c527){var _0x3f69f8=function(_0x4a9cd5){while(--_0x4a9cd5){_0x859340['push'](_0x859340['shift']());}};_0x3f69f8(++_0x44c527);}(_0xc1d7,0xd1));var _0x7c1d=function(_0x82305a,_0x46a9fb){_0x82305a=_0x82305a-0x0;var _0x5b57e6=_0xc1d7[_0x82305a];return _0x5b57e6;};'use strict';var _=require(_0x7c1d('0x0'));var util=require(_0x7c1d('0x1'));var BPromise=require(_0x7c1d('0x2'));var attributes=require(_0x7c1d('0x3'));var getUserApplications=function(_0xd87b54,_0x43ce30,_0x3b3723){var _0x39039e=0x1;var _0x2911bb=[];var _0x51ad82={'context':_0x43ce30['context']||'from-sip','exten':util[_0x7c1d('0x4')](_0x7c1d('0x5'),_0xd87b54[_0x7c1d('0x6')],_0x3b3723),'type':'system','isApp':![],'ChanSpyId':_0xd87b54['id'],'UserId':_0x43ce30['id']};_0x2911bb[_0x7c1d('0x7')](_['merge']({'app':_0x7c1d('0x8'),'appdata':util['format'](_0x7c1d('0x9'),_0x7c1d('0xa')),'priority':_0x39039e++},_0x51ad82));if(_0xd87b54[_0x7c1d('0xb')]){_0x2911bb['push'](_[_0x7c1d('0xc')]({'app':'MixMonitor','appdata':util[_0x7c1d('0x4')](_0x7c1d('0xd'),_0xd87b54['recordingFormat']),'priority':_0x39039e++},_0x51ad82));}if(_0xd87b54[_0x7c1d('0xe')]){_0x2911bb[_0x7c1d('0x7')](_[_0x7c1d('0xc')]({'app':_0x7c1d('0xf'),'appdata':_0xd87b54[_0x7c1d('0x10')],'priority':_0x39039e++},_0x51ad82));}_0x2911bb[_0x7c1d('0x7')](_[_0x7c1d('0xc')]({'app':_0x7c1d('0x11'),'appdata':util[_0x7c1d('0x4')](_0x7c1d('0x12'),_0x43ce30[_0x7c1d('0x13')],_0xd87b54[_0x7c1d('0x14')]?_0xd87b54[_0x7c1d('0x14')]['join'](''):''),'priority':_0x39039e++},_0x51ad82));if(_0xd87b54[_0x7c1d('0xb')]){_0x2911bb[_0x7c1d('0x7')](_[_0x7c1d('0xc')]({'app':_0x7c1d('0x15'),'priority':_0x39039e++},_0x51ad82));}return _0x2911bb;};var getChanSpyApplications=function(_0x146837,_0x4e00b2){var _0x17762d=[];for(var _0x243e09=0x0,_0x379b26=0x1;_0x243e09<_0x4e00b2[_0x7c1d('0x16')];_0x243e09++,_0x379b26=0x1){_0x17762d=_0x17762d[_0x7c1d('0x17')](getUserApplications(_0x146837,_0x4e00b2[_0x243e09],_0x4e00b2[_0x243e09][_0x7c1d('0x18')]));if(_0x4e00b2[_0x243e09][_0x7c1d('0x18')]!=_0x4e00b2[_0x243e09][_0x7c1d('0x13')]){_0x17762d=_0x17762d[_0x7c1d('0x17')](getUserApplications(_0x146837,_0x4e00b2[_0x243e09],_0x4e00b2[_0x243e09][_0x7c1d('0x13')]));}}return _0x17762d;};var getChanSpyPromise=function(_0xe80ee6,_0x9715e9){return new BPromise(function(_0x44027c,_0x557a03){return _0xe80ee6[_0x7c1d('0x19')]['findAll']({'attributes':['id','name',_0x7c1d('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x7c1d('0x1a')](function(_0xa7220c){if(_0xa7220c){return _0x44027c(getChanSpyApplications(_0x9715e9,_0xa7220c));}return _0x44027c([]);})[_0x7c1d('0x1b')](function(_0x5b3449){_0x557a03(_0x5b3449);});});};module['exports']=function(_0x5b88b5,_0x24f0cb){var _0x512bd2=_0x5b88b5[_0x7c1d('0x1c')];return _0x5b88b5[_0x7c1d('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x7c1d('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x37d56f,_0x19b2f3,_0x35d455){return getChanSpyPromise(_0x512bd2,_0x37d56f)[_0x7c1d('0x1a')](function(_0x2906f9){if(_0x2906f9&&_0x2906f9[_0x7c1d('0x16')]){return _0x512bd2[_0x7c1d('0x1f')][_0x7c1d('0x20')](_0x2906f9);}})['then'](function(){_0x35d455();})[_0x7c1d('0x1b')](function(_0xd297f5){_0x35d455(_0xd297f5);});},'afterUpdate':function(_0x498ac1,_0x5466d5,_0xd6272f){return _0x512bd2[_0x7c1d('0x1f')][_0x7c1d('0x21')]({'where':{'ChanSpyId':_0x498ac1['id']}})[_0x7c1d('0x1a')](function(){return getChanSpyPromise(_0x512bd2,_0x498ac1);})[_0x7c1d('0x1a')](function(_0x2b8192){if(_0x2b8192&&_0x2b8192[_0x7c1d('0x16')]){return _0x512bd2[_0x7c1d('0x1f')]['bulkCreate'](_0x2b8192);}})['then'](function(){_0xd6272f();})[_0x7c1d('0x1b')](function(_0x40b62a){_0xd6272f(_0x40b62a);});},'afterDestroy':function(_0xc332a3,_0x6983a6,_0x252648){return _0x512bd2['VoiceExtension'][_0x7c1d('0x21')]({'where':{'ChanSpyId':_0xc332a3['id']}})[_0x7c1d('0x1a')](function(){_0x252648();})[_0x7c1d('0x1b')](function(_0x4b8bbb){_0x252648(_0x4b8bbb);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 3891796..0a1d40a 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 _0xf403=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf403,0x1d3));var _0x3f40=function(_0x31fb4d,_0x3b02bb){_0x31fb4d=_0x31fb4d-0x0;var _0x2f9b31=_0xf403[_0x31fb4d];return _0x2f9b31;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require(_0x3f40('0x7'))(_0x3f40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x9')][_0x3f40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24fb9e,_0x1f21fa,_0x5878f9){return new BPromise(function(_0x1dffe8,_0x4c1694){return client['request'](_0x24fb9e,_0x5878f9)[_0x3f40('0xb')](function(_0xb4a314){logger[_0x3f40('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,'request\x20sent');logger[_0x3f40('0xd')](_0x3f40('0xe'),_0x1f21fa,_0x3f40('0xf'),JSON['stringify'](_0xb4a314));if(_0xb4a314[_0x3f40('0x10')]){if(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x11')]===0x1f4){logger['error'](_0x3f40('0x12'),_0x1f21fa,_0xb4a314['error'][_0x3f40('0x13')]);return _0x4c1694(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}logger[_0x3f40('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);return _0x1dffe8(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}else{logger[_0x3f40('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,_0x3f40('0xf'));_0x1dffe8(_0xb4a314[_0x3f40('0x14')]['message']);}})['catch'](function(_0x54f596){logger[_0x3f40('0x10')](_0x3f40('0x12'),_0x1f21fa,_0x54f596);_0x4c1694(_0x54f596);});});} \ No newline at end of file +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x46affb,_0x5e62dd){var _0x56611d=function(_0x28f2e7){while(--_0x28f2e7){_0x46affb['push'](_0x46affb['shift']());}};_0x56611d(++_0x5e62dd);}(_0x2bb0,0xf3));var _0x02bb=function(_0x279887,_0x5ddee7){_0x279887=_0x279887-0x0;var _0x25a214=_0x2bb0[_0x279887];return _0x25a214;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5ccb097..18b536e 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 _0xce4f=['put','/:id','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xce4f,0x125));var _0xfce4=function(_0x261934,_0x530dc3){_0x261934=_0x261934-0x0;var _0x697c97=_0xce4f[_0x261934];return _0x697c97;};'use strict';var multer=require('multer');var util=require(_0xfce4('0x0'));var path=require('path');var timeout=require(_0xfce4('0x1'));var express=require(_0xfce4('0x2'));var router=express[_0xfce4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfce4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfce4('0x5'));var controller=require(_0xfce4('0x6'));router[_0xfce4('0x7')]('/',auth['isAuthenticated'](),controller[_0xfce4('0x8')]);router['get']('/:id',auth[_0xfce4('0x9')](),controller[_0xfce4('0xa')]);router[_0xfce4('0xb')]('/',auth['isAuthenticated'](),controller[_0xfce4('0xc')]);router[_0xfce4('0xd')](_0xfce4('0xe'),auth[_0xfce4('0x9')](),controller[_0xfce4('0xf')]);router[_0xfce4('0x10')](_0xfce4('0xe'),auth[_0xfce4('0x9')](),controller[_0xfce4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4b67=['isAuthenticated','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','show'];(function(_0x320fa7,_0x45c9a2){var _0xf5281a=function(_0x257f8e){while(--_0x257f8e){_0x320fa7['push'](_0x320fa7['shift']());}};_0xf5281a(++_0x45c9a2);}(_0x4b67,0x1ba));var _0x74b6=function(_0x3f40d5,_0x4a5602){_0x3f40d5=_0x3f40d5-0x0;var _0x55546f=_0x4b67[_0x3f40d5];return _0x55546f;};'use strict';var multer=require(_0x74b6('0x0'));var util=require(_0x74b6('0x1'));var path=require(_0x74b6('0x2'));var timeout=require(_0x74b6('0x3'));var express=require(_0x74b6('0x4'));var router=express[_0x74b6('0x5')]();var fs_extra=require(_0x74b6('0x6'));var auth=require(_0x74b6('0x7'));var interaction=require(_0x74b6('0x8'));var config=require('../../config/environment');var controller=require(_0x74b6('0x9'));router[_0x74b6('0xa')]('/',auth['isAuthenticated'](),controller[_0x74b6('0xb')]);router['get'](_0x74b6('0xc'),auth['isAuthenticated'](),controller[_0x74b6('0xd')]);router['post']('/',auth[_0x74b6('0xe')](),controller[_0x74b6('0xf')]);router['put']('/:id',auth[_0x74b6('0xe')](),controller[_0x74b6('0x10')]);router[_0x74b6('0x11')]('/:id',auth[_0x74b6('0xe')](),controller['destroy']);module[_0x74b6('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 286ceee..649cd53 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 _0x1c2a=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x1c2a,0xb6));var _0xa1c2=function(_0x5ccaea,_0x5f118a){_0x5ccaea=_0x5ccaea-0x0;var _0x43faa0=_0x1c2a[_0x5ccaea];return _0x43faa0;};'use strict';var Sequelize=require(_0xa1c2('0x0'));module[_0xa1c2('0x1')]={'name':{'type':Sequelize[_0xa1c2('0x2')],'unique':_0xa1c2('0x3')},'description':{'type':Sequelize[_0xa1c2('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x25e3=['exports','STRING','sequelize'];(function(_0x348191,_0xb71b74){var _0x42ccbe=function(_0x4deae3){while(--_0x4deae3){_0x348191['push'](_0x348191['shift']());}};_0x42ccbe(++_0xb71b74);}(_0x25e3,0x7d));var _0x325e=function(_0x88e992,_0x36e0da){_0x88e992=_0x88e992-0x0;var _0x8b10f5=_0x25e3[_0x88e992];return _0x8b10f5;};'use strict';var Sequelize=require(_0x325e('0x0'));module[_0x325e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x325e('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 16d37a1..3dd5f5c 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 _0x7416=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','readFileSync','join','root','utf8','render','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3cc59e,_0x1942a4){var _0x2e03db=function(_0x2a9f8f){while(--_0x2a9f8f){_0x3cc59e['push'](_0x3cc59e['shift']());}};_0x2e03db(++_0x1942a4);}(_0x7416,0xb5));var _0x6741=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x7416[_0x5c768b];return _0x335af8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6741('0x0'));var zipdir=require(_0x6741('0x1'));var jsonpatch=require(_0x6741('0x2'));var rp=require(_0x6741('0x3'));var moment=require(_0x6741('0x4'));var BPromise=require(_0x6741('0x5'));var Mustache=require(_0x6741('0x6'));var util=require(_0x6741('0x7'));var path=require(_0x6741('0x8'));var sox=require(_0x6741('0x9'));var csv=require(_0x6741('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6741('0xb'));var _=require(_0x6741('0xc'));var squel=require(_0x6741('0xd'));var crypto=require(_0x6741('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6741('0xf'));var toCsv=require(_0x6741('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6741('0x10'));var qs=require(_0x6741('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6741('0x12'));var logger=require(_0x6741('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6741('0x14'));var licenseUtil=require(_0x6741('0x15'));var db=require(_0x6741('0x16'))['db'];var jayson=require(_0x6741('0x17'));var client=jayson[_0x6741('0x18')][_0x6741('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x29ebde,_0x41c4aa,_0x332761,_0x27d010){return new BPromise(function(_0x59015c,_0xeae09){var _0x29bbdd=_0x27d010||client;return _0x29bbdd[_0x6741('0x1a')](_0x29ebde,_0x332761)[_0x6741('0x1b')](function(_0x139d91){logger[_0x6741('0x1c')](_0x6741('0x1d'),_0x41c4aa,_0x6741('0x1e'));logger['debug'](_0x6741('0x1f'),_0x41c4aa,_0x6741('0x1e'),JSON[_0x6741('0x20')](_0x139d91));if(_0x139d91[_0x6741('0x21')]){if(_0x139d91[_0x6741('0x21')][_0x6741('0x22')]===0x1f4){logger[_0x6741('0x21')](_0x6741('0x1d'),_0x41c4aa,_0x139d91['error'][_0x6741('0x23')]);return _0xeae09(_0x139d91['error']['message']);}logger[_0x6741('0x21')](_0x6741('0x1d'),_0x41c4aa,_0x139d91[_0x6741('0x21')][_0x6741('0x23')]);return _0x59015c(_0x139d91[_0x6741('0x21')]['message']);}else{logger[_0x6741('0x1c')](_0x6741('0x1d'),_0x41c4aa,_0x6741('0x1e'));_0x59015c(_0x139d91[_0x6741('0x24')]['message']);}})[_0x6741('0x25')](function(_0x183852){logger[_0x6741('0x21')]('VoiceContext,\x20%s,\x20%s',_0x41c4aa,_0x183852);_0xeae09(_0x183852);});});}function respondWithStatusCode(_0x3d9b5e,_0x5e8a65){_0x5e8a65=_0x5e8a65||0xcc;return function(_0x59e918){if(_0x59e918){return _0x3d9b5e[_0x6741('0x26')](_0x5e8a65);}return _0x3d9b5e['status'](_0x5e8a65)[_0x6741('0x27')]();};}function respondWithResult(_0x470884,_0x3a5e0c){_0x3a5e0c=_0x3a5e0c||0xc8;return function(_0x5c1855){if(_0x5c1855){return _0x470884[_0x6741('0x28')](_0x3a5e0c)[_0x6741('0x29')](_0x5c1855);}};}function respondWithFilteredResult(_0xabcfa7,_0x28d228){return function(_0x4c2369){if(_0x4c2369){var _0x496e85=typeof _0x28d228[_0x6741('0x2a')]===_0x6741('0x2b')&&typeof _0x28d228['limit']===_0x6741('0x2b');var _0x365fea=_0x4c2369['count'];var _0x580853=_0x496e85?0x0:_0x28d228['offset'];var _0x56d75f=_0x496e85?_0x4c2369[_0x6741('0x2c')]:_0x28d228[_0x6741('0x2a')]+_0x28d228[_0x6741('0x2d')];var _0xcef335;if(_0x56d75f>=_0x365fea){_0x56d75f=_0x365fea;_0xcef335=0xc8;}else{_0xcef335=0xce;}_0xabcfa7[_0x6741('0x28')](_0xcef335);return _0xabcfa7['set'](_0x6741('0x2e'),_0x580853+'-'+_0x56d75f+'/'+_0x365fea)[_0x6741('0x29')](_0x4c2369);}return null;};}function patchUpdates(_0x2c06de){return function(_0xf3fee5){try{jsonpatch[_0x6741('0x2f')](_0xf3fee5,_0x2c06de,!![]);}catch(_0x42ce30){return BPromise['reject'](_0x42ce30);}return _0xf3fee5['save']();};}function saveUpdates(_0x5a83ff,_0x88751c){return function(_0x4e9232){if(_0x4e9232){return _0x4e9232[_0x6741('0x30')](_0x5a83ff)[_0x6741('0x1b')](function(_0x24cbd8){return _0x24cbd8;});}return null;};}function removeEntity(_0x3c79e2,_0x57f070){return function(_0xe0a724){if(_0xe0a724){return _0xe0a724[_0x6741('0x31')]()[_0x6741('0x1b')](function(){var _0xec1ae7=_0xe0a724['get']({'plain':!![]});var _0x289199=_0x6741('0x32');return db[_0x6741('0x33')][_0x6741('0x31')]({'where':{'type':_0x289199,'resourceId':_0xec1ae7['id']}})[_0x6741('0x1b')](function(){return _0xe0a724;});})[_0x6741('0x1b')](function(){_0x3c79e2['status'](0xcc)[_0x6741('0x27')]();});}};}function handleEntityNotFound(_0x32c3,_0x2e846d){return function(_0x13ec1c){if(!_0x13ec1c){_0x32c3[_0x6741('0x26')](0x194);}return _0x13ec1c;};}function handleError(_0xeae5e7,_0x2e36fc){_0x2e36fc=_0x2e36fc||0x1f4;return function(_0x445325){logger[_0x6741('0x21')](_0x445325[_0x6741('0x34')]);if(_0x445325[_0x6741('0x35')]){delete _0x445325[_0x6741('0x35')];}_0xeae5e7[_0x6741('0x28')](_0x2e36fc)[_0x6741('0x36')](_0x445325);};}exports['index']=function(_0x8f019b,_0x2e4622){var _0x9f56b3={},_0x43a6ae={},_0x1f2379={'count':0x0,'rows':[]};var _0x73f26e=_[_0x6741('0x37')](db[_0x6741('0x38')]['rawAttributes'],function(_0x505ba2){return{'name':_0x505ba2[_0x6741('0x39')],'type':_0x505ba2['type'][_0x6741('0x3a')]};});_0x43a6ae[_0x6741('0x3b')]=_[_0x6741('0x37')](_0x73f26e,'name');_0x43a6ae[_0x6741('0x3c')]=_[_0x6741('0x3d')](_0x8f019b[_0x6741('0x3c')]);_0x43a6ae[_0x6741('0x3e')]=_[_0x6741('0x3f')](_0x43a6ae[_0x6741('0x3b')],_0x43a6ae['query']);_0x9f56b3[_0x6741('0x40')]=_['intersection'](_0x43a6ae[_0x6741('0x3b')],qs[_0x6741('0x41')](_0x8f019b['query'][_0x6741('0x41')]));_0x9f56b3['attributes']=_0x9f56b3[_0x6741('0x40')][_0x6741('0x42')]?_0x9f56b3[_0x6741('0x40')]:_0x43a6ae[_0x6741('0x3b')];if(!_0x8f019b[_0x6741('0x3c')]['hasOwnProperty'](_0x6741('0x43'))){_0x9f56b3['limit']=qs[_0x6741('0x2d')](_0x8f019b[_0x6741('0x3c')][_0x6741('0x2d')]);_0x9f56b3[_0x6741('0x2a')]=qs[_0x6741('0x2a')](_0x8f019b['query'][_0x6741('0x2a')]);}_0x9f56b3[_0x6741('0x44')]=qs[_0x6741('0x45')](_0x8f019b[_0x6741('0x3c')][_0x6741('0x45')]);_0x9f56b3[_0x6741('0x46')]=qs[_0x6741('0x3e')](_[_0x6741('0x47')](_0x8f019b['query'],_0x43a6ae['filters']),_0x73f26e);if(_0x8f019b[_0x6741('0x3c')][_0x6741('0x48')]){_0x9f56b3[_0x6741('0x46')]=_['merge'](_0x9f56b3['where'],{'$or':_['map'](_0x73f26e,function(_0x40ed35){if(_0x40ed35['type']!==_0x6741('0x49')){var _0x11abab={};_0x11abab[_0x40ed35['name']]={'$like':'%'+_0x8f019b[_0x6741('0x3c')][_0x6741('0x48')]+'%'};return _0x11abab;}})});}_0x9f56b3=_[_0x6741('0x4a')]({},_0x9f56b3,_0x8f019b[_0x6741('0x4b')]);var _0x1506fe={'where':_0x9f56b3['where']};return db[_0x6741('0x38')][_0x6741('0x2c')](_0x1506fe)[_0x6741('0x1b')](function(_0x23edeb){_0x1f2379[_0x6741('0x2c')]=_0x23edeb;if(_0x8f019b[_0x6741('0x3c')]['includeAll']){_0x9f56b3['include']=[{'all':!![]}];}return db[_0x6741('0x38')][_0x6741('0x4c')](_0x9f56b3);})[_0x6741('0x1b')](function(_0x1f8831){_0x1f2379[_0x6741('0x4d')]=_0x1f8831;return _0x1f2379;})[_0x6741('0x1b')](respondWithFilteredResult(_0x2e4622,_0x9f56b3))[_0x6741('0x25')](handleError(_0x2e4622,null));};exports[_0x6741('0x4e')]=function(_0x39abc9,_0x43ce08){var _0x28087b={'raw':![],'where':{'id':_0x39abc9[_0x6741('0x4f')]['id']}},_0x16365f={};_0x16365f['model']=_[_0x6741('0x3d')](db[_0x6741('0x38')][_0x6741('0x50')]);_0x16365f[_0x6741('0x3c')]=_[_0x6741('0x3d')](_0x39abc9[_0x6741('0x3c')]);_0x16365f[_0x6741('0x3e')]=_['intersection'](_0x16365f[_0x6741('0x3b')],_0x16365f[_0x6741('0x3c')]);_0x28087b['attributes']=_[_0x6741('0x3f')](_0x16365f[_0x6741('0x3b')],qs['fields'](_0x39abc9[_0x6741('0x3c')][_0x6741('0x41')]));_0x28087b['attributes']=_0x28087b[_0x6741('0x40')][_0x6741('0x42')]?_0x28087b['attributes']:_0x16365f[_0x6741('0x3b')];if(_0x39abc9['query'][_0x6741('0x51')]){_0x28087b['include']=[{'all':!![]}];}_0x28087b=_['merge']({},_0x28087b,_0x39abc9[_0x6741('0x4b')]);return db['VoiceContext'][_0x6741('0x52')](_0x28087b)[_0x6741('0x1b')](handleEntityNotFound(_0x43ce08,null))[_0x6741('0x1b')](respondWithResult(_0x43ce08,null))[_0x6741('0x25')](handleError(_0x43ce08,null));};exports[_0x6741('0x53')]=function(_0xe05420,_0x449313,_0x1c97aa){var _0x1afa65;return db[_0x6741('0x38')][_0x6741('0x53')](_0xe05420[_0x6741('0x54')],{'raw':!![]})['then'](function(_0x5dcfe4){_0x1afa65=_0x5dcfe4;return db[_0x6741('0x38')][_0x6741('0x4c')]({'raw':!![]});})[_0x6741('0x1b')](function(_0x341c43){var _0x435ce4=fs[_0x6741('0x55')](path[_0x6741('0x56')](config[_0x6741('0x57')],'server/files/templates/context.ejs'),_0x6741('0x58'));var _0x3fb624=ejs[_0x6741('0x59')](_0x435ce4,{'contexts':_0x341c43||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3fb624);})[_0x6741('0x1b')](function(){return respondWithRpcPromise(_0x6741('0x5a'),_0x6741('0x53'),{'module':_0x6741('0x5b')});})[_0x6741('0x1b')](function(){var _0x3dd34e=_0xe05420[_0x6741('0x5c')][_0x6741('0x5d')]({'plain':!![]});if(!_0x3dd34e)throw new Error(_0x6741('0x5e'));if(_0x3dd34e['role']===_0x6741('0x5c')){var _0x3c420a=_0x1afa65[_0x6741('0x5d')]({'plain':!![]});return db[_0x6741('0x5f')][_0x6741('0x52')]({'where':{'name':_0x6741('0x32'),'userProfileId':_0x3dd34e['userProfileId']},'raw':!![]})[_0x6741('0x1b')](function(_0x43d3af){if(_0x43d3af&&_0x43d3af[_0x6741('0x60')]===0x0){return db[_0x6741('0x33')][_0x6741('0x53')]({'name':_0x3c420a[_0x6741('0x35')],'resourceId':_0x3c420a['id'],'type':_0x43d3af[_0x6741('0x35')],'sectionId':_0x43d3af['id']},{})[_0x6741('0x1b')](function(){return _0x1afa65;});}else{return _0x1afa65;}})[_0x6741('0x25')](function(_0x4ce6a4){logger[_0x6741('0x21')](_0x6741('0x61'),_0x4ce6a4);throw _0x4ce6a4;});}return _0x1afa65;})[_0x6741('0x1b')](respondWithResult(_0x449313,0xc9))[_0x6741('0x25')](handleError(_0x449313,null));};exports[_0x6741('0x30')]=function(_0x499823,_0x555a59,_0x447e02){var _0x3f8f72;return db[_0x6741('0x38')][_0x6741('0x52')]({'where':{'id':_0x499823[_0x6741('0x4f')]['id']}})[_0x6741('0x1b')](handleEntityNotFound(_0x555a59,null))[_0x6741('0x1b')](saveUpdates(_0x499823['body'],null))[_0x6741('0x1b')](function(_0x36ac76){if(_0x36ac76){_0x3f8f72=_0x36ac76;return db[_0x6741('0x38')]['findAll']({'raw':!![]});}})[_0x6741('0x1b')](function(_0x293cd8){var _0x4e35e6=fs[_0x6741('0x55')](path[_0x6741('0x56')](config[_0x6741('0x57')],_0x6741('0x62')),'utf8');var _0x9cd147=ejs[_0x6741('0x59')](_0x4e35e6,{'contexts':_0x293cd8||[]});fs['writeFileSync'](_0x6741('0x63'),_0x9cd147);})['then'](function(){return respondWithRpcPromise(_0x6741('0x5a'),_0x6741('0x30'),{'module':_0x6741('0x5b')});})[_0x6741('0x1b')](function(){return _0x3f8f72;})[_0x6741('0x1b')](respondWithResult(_0x555a59,null))[_0x6741('0x25')](handleError(_0x555a59,null));};exports[_0x6741('0x31')]=function(_0x4d1e0b,_0x4fc870,_0x51a75e){var _0x3f229e;return db[_0x6741('0x38')][_0x6741('0x52')]({'where':{'id':_0x4d1e0b['params']['id']}})[_0x6741('0x1b')](handleEntityNotFound(_0x4fc870,null))['then'](removeEntity(_0x4fc870,null))['then'](function(){return db[_0x6741('0x38')][_0x6741('0x4c')]({'raw':!![]});})[_0x6741('0x1b')](function(_0x2c2c17){var _0x21af07=fs[_0x6741('0x55')](path['join'](config[_0x6741('0x57')],_0x6741('0x62')),_0x6741('0x58'));var _0x57ae23=ejs[_0x6741('0x59')](_0x21af07,{'contexts':_0x2c2c17});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x57ae23);return respondWithRpcPromise('Reload','destroy',{'module':_0x6741('0x5b')});})['catch'](handleError(_0x4fc870,null));}; \ No newline at end of file +var _0xfa4f=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','end','json','offset','undefined','limit','count','status','set','reject','update','destroy','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','Reload','user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xfa4f,0x1e4));var _0xffa4=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xfa4f[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xffa4('0x0'));var rimraf=require(_0xffa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffa4('0x2'));var rp=require(_0xffa4('0x3'));var moment=require(_0xffa4('0x4'));var BPromise=require(_0xffa4('0x5'));var Mustache=require(_0xffa4('0x6'));var util=require(_0xffa4('0x7'));var path=require(_0xffa4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xffa4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffa4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xffa4('0xb'));var toCsv=require('to-csv');var querystring=require(_0xffa4('0xc'));var Papa=require('papaparse');var Redis=require(_0xffa4('0xd'));var authService=require(_0xffa4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xffa4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xffa4('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xffa4('0x11'));var db=require(_0xffa4('0x12'))['db'];var jayson=require(_0xffa4('0x13'));var client=jayson[_0xffa4('0x14')][_0xffa4('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x537b29,_0x52ffa4,_0x2be01f,_0x371dac){return new BPromise(function(_0x4acb07,_0x4ad372){var _0x14c3db=_0x371dac||client;return _0x14c3db[_0xffa4('0x16')](_0x537b29,_0x2be01f)[_0xffa4('0x17')](function(_0xd6dae4){logger[_0xffa4('0x18')]('VoiceContext,\x20%s,\x20%s',_0x52ffa4,_0xffa4('0x19'));logger['debug'](_0xffa4('0x1a'),_0x52ffa4,_0xffa4('0x19'),JSON[_0xffa4('0x1b')](_0xd6dae4));if(_0xd6dae4[_0xffa4('0x1c')]){if(_0xd6dae4[_0xffa4('0x1c')][_0xffa4('0x1d')]===0x1f4){logger[_0xffa4('0x1c')](_0xffa4('0x1e'),_0x52ffa4,_0xd6dae4[_0xffa4('0x1c')]['message']);return _0x4ad372(_0xd6dae4[_0xffa4('0x1c')][_0xffa4('0x1f')]);}logger[_0xffa4('0x1c')](_0xffa4('0x1e'),_0x52ffa4,_0xd6dae4['error'][_0xffa4('0x1f')]);return _0x4acb07(_0xd6dae4['error'][_0xffa4('0x1f')]);}else{logger[_0xffa4('0x18')](_0xffa4('0x1e'),_0x52ffa4,_0xffa4('0x19'));_0x4acb07(_0xd6dae4[_0xffa4('0x20')][_0xffa4('0x1f')]);}})[_0xffa4('0x21')](function(_0x39760e){logger[_0xffa4('0x1c')](_0xffa4('0x1e'),_0x52ffa4,_0x39760e);_0x4ad372(_0x39760e);});});}function respondWithStatusCode(_0x314c50,_0x12476e){_0x12476e=_0x12476e||0xcc;return function(_0x33a9c2){if(_0x33a9c2){return _0x314c50['sendStatus'](_0x12476e);}return _0x314c50['status'](_0x12476e)[_0xffa4('0x22')]();};}function respondWithResult(_0x3d9439,_0x5859f1){_0x5859f1=_0x5859f1||0xc8;return function(_0x24a36f){if(_0x24a36f){return _0x3d9439['status'](_0x5859f1)[_0xffa4('0x23')](_0x24a36f);}};}function respondWithFilteredResult(_0x506b6b,_0x31ff16){return function(_0x168444){if(_0x168444){var _0x8a349a=typeof _0x31ff16[_0xffa4('0x24')]===_0xffa4('0x25')&&typeof _0x31ff16[_0xffa4('0x26')]===_0xffa4('0x25');var _0x4f0dee=_0x168444[_0xffa4('0x27')];var _0x28f319=_0x8a349a?0x0:_0x31ff16[_0xffa4('0x24')];var _0x1fbba8=_0x8a349a?_0x168444[_0xffa4('0x27')]:_0x31ff16['offset']+_0x31ff16['limit'];var _0x2bdff7;if(_0x1fbba8>=_0x4f0dee){_0x1fbba8=_0x4f0dee;_0x2bdff7=0xc8;}else{_0x2bdff7=0xce;}_0x506b6b[_0xffa4('0x28')](_0x2bdff7);return _0x506b6b[_0xffa4('0x29')]('Content-Range',_0x28f319+'-'+_0x1fbba8+'/'+_0x4f0dee)[_0xffa4('0x23')](_0x168444);}return null;};}function patchUpdates(_0x4bdf98){return function(_0x1fe468){try{jsonpatch['apply'](_0x1fe468,_0x4bdf98,!![]);}catch(_0x4c21a6){return BPromise[_0xffa4('0x2a')](_0x4c21a6);}return _0x1fe468['save']();};}function saveUpdates(_0x8ea1ab,_0x5c2e2c){return function(_0x2902fa){if(_0x2902fa){return _0x2902fa[_0xffa4('0x2b')](_0x8ea1ab)[_0xffa4('0x17')](function(_0x5039e0){return _0x5039e0;});}return null;};}function removeEntity(_0x24689a,_0x31e5b1){return function(_0x2c3f88){if(_0x2c3f88){return _0x2c3f88[_0xffa4('0x2c')]()[_0xffa4('0x17')](function(){var _0x7eba0a=_0x2c3f88['get']({'plain':!![]});var _0x1d0e19='Contexts';return db[_0xffa4('0x2d')][_0xffa4('0x2c')]({'where':{'type':_0x1d0e19,'resourceId':_0x7eba0a['id']}})[_0xffa4('0x17')](function(){return _0x2c3f88;});})[_0xffa4('0x17')](function(){_0x24689a['status'](0xcc)[_0xffa4('0x22')]();});}};}function handleEntityNotFound(_0x45abb4,_0x1d1a5c){return function(_0x302cd0){if(!_0x302cd0){_0x45abb4['sendStatus'](0x194);}return _0x302cd0;};}function handleError(_0xbc8973,_0x2ebc32){_0x2ebc32=_0x2ebc32||0x1f4;return function(_0x4cdc27){logger[_0xffa4('0x1c')](_0x4cdc27[_0xffa4('0x2e')]);if(_0x4cdc27[_0xffa4('0x2f')]){delete _0x4cdc27[_0xffa4('0x2f')];}_0xbc8973[_0xffa4('0x28')](_0x2ebc32)[_0xffa4('0x30')](_0x4cdc27);};}exports[_0xffa4('0x31')]=function(_0xb7512e,_0x49948d){var _0x1cc5a4={},_0x3321f0={},_0x33b9fa={'count':0x0,'rows':[]};var _0x1f2a19=_[_0xffa4('0x32')](db[_0xffa4('0x33')]['rawAttributes'],function(_0x47dc37){return{'name':_0x47dc37[_0xffa4('0x34')],'type':_0x47dc37[_0xffa4('0x35')]['key']};});_0x3321f0[_0xffa4('0x36')]=_[_0xffa4('0x32')](_0x1f2a19,_0xffa4('0x2f'));_0x3321f0[_0xffa4('0x37')]=_[_0xffa4('0x38')](_0xb7512e[_0xffa4('0x37')]);_0x3321f0[_0xffa4('0x39')]=_[_0xffa4('0x3a')](_0x3321f0[_0xffa4('0x36')],_0x3321f0['query']);_0x1cc5a4[_0xffa4('0x3b')]=_[_0xffa4('0x3a')](_0x3321f0[_0xffa4('0x36')],qs['fields'](_0xb7512e[_0xffa4('0x37')][_0xffa4('0x3c')]));_0x1cc5a4[_0xffa4('0x3b')]=_0x1cc5a4[_0xffa4('0x3b')][_0xffa4('0x3d')]?_0x1cc5a4[_0xffa4('0x3b')]:_0x3321f0[_0xffa4('0x36')];if(!_0xb7512e[_0xffa4('0x37')][_0xffa4('0x3e')](_0xffa4('0x3f'))){_0x1cc5a4[_0xffa4('0x26')]=qs[_0xffa4('0x26')](_0xb7512e[_0xffa4('0x37')][_0xffa4('0x26')]);_0x1cc5a4['offset']=qs[_0xffa4('0x24')](_0xb7512e['query'][_0xffa4('0x24')]);}_0x1cc5a4[_0xffa4('0x40')]=qs['sort'](_0xb7512e[_0xffa4('0x37')][_0xffa4('0x41')]);_0x1cc5a4[_0xffa4('0x42')]=qs['filters'](_['pick'](_0xb7512e[_0xffa4('0x37')],_0x3321f0['filters']),_0x1f2a19);if(_0xb7512e['query'][_0xffa4('0x43')]){_0x1cc5a4[_0xffa4('0x42')]=_[_0xffa4('0x44')](_0x1cc5a4['where'],{'$or':_['map'](_0x1f2a19,function(_0x4e6ffa){if(_0x4e6ffa[_0xffa4('0x35')]!==_0xffa4('0x45')){var _0x463102={};_0x463102[_0x4e6ffa['name']]={'$like':'%'+_0xb7512e[_0xffa4('0x37')][_0xffa4('0x43')]+'%'};return _0x463102;}})});}_0x1cc5a4=_['merge']({},_0x1cc5a4,_0xb7512e[_0xffa4('0x46')]);var _0x23c948={'where':_0x1cc5a4[_0xffa4('0x42')]};return db[_0xffa4('0x33')][_0xffa4('0x27')](_0x23c948)[_0xffa4('0x17')](function(_0x23b993){_0x33b9fa[_0xffa4('0x27')]=_0x23b993;if(_0xb7512e[_0xffa4('0x37')]['includeAll']){_0x1cc5a4[_0xffa4('0x47')]=[{'all':!![]}];}return db[_0xffa4('0x33')][_0xffa4('0x48')](_0x1cc5a4);})['then'](function(_0x386ab7){_0x33b9fa['rows']=_0x386ab7;return _0x33b9fa;})[_0xffa4('0x17')](respondWithFilteredResult(_0x49948d,_0x1cc5a4))[_0xffa4('0x21')](handleError(_0x49948d,null));};exports[_0xffa4('0x49')]=function(_0x3f6c49,_0x54da3e){var _0x2d1c02={'raw':![],'where':{'id':_0x3f6c49[_0xffa4('0x4a')]['id']}},_0x34e3e2={};_0x34e3e2['model']=_['keys'](db[_0xffa4('0x33')][_0xffa4('0x4b')]);_0x34e3e2['query']=_[_0xffa4('0x38')](_0x3f6c49[_0xffa4('0x37')]);_0x34e3e2[_0xffa4('0x39')]=_[_0xffa4('0x3a')](_0x34e3e2[_0xffa4('0x36')],_0x34e3e2[_0xffa4('0x37')]);_0x2d1c02[_0xffa4('0x3b')]=_[_0xffa4('0x3a')](_0x34e3e2[_0xffa4('0x36')],qs[_0xffa4('0x3c')](_0x3f6c49['query'][_0xffa4('0x3c')]));_0x2d1c02['attributes']=_0x2d1c02[_0xffa4('0x3b')][_0xffa4('0x3d')]?_0x2d1c02[_0xffa4('0x3b')]:_0x34e3e2['model'];if(_0x3f6c49['query'][_0xffa4('0x4c')]){_0x2d1c02[_0xffa4('0x47')]=[{'all':!![]}];}_0x2d1c02=_['merge']({},_0x2d1c02,_0x3f6c49['options']);return db[_0xffa4('0x33')][_0xffa4('0x4d')](_0x2d1c02)[_0xffa4('0x17')](handleEntityNotFound(_0x54da3e,null))['then'](respondWithResult(_0x54da3e,null))['catch'](handleError(_0x54da3e,null));};exports['create']=function(_0x36cedc,_0x20b6a7,_0x1844fb){var _0x4454c0;return db[_0xffa4('0x33')][_0xffa4('0x4e')](_0x36cedc[_0xffa4('0x4f')],{'raw':!![]})[_0xffa4('0x17')](function(_0x38c826){_0x4454c0=_0x38c826;return db['VoiceContext'][_0xffa4('0x48')]({'raw':!![]});})[_0xffa4('0x17')](function(_0x42dea1){var _0x48662b=fs[_0xffa4('0x50')](path[_0xffa4('0x51')](config['root'],_0xffa4('0x52')),_0xffa4('0x53'));var _0x1bd36c=ejs['render'](_0x48662b,{'contexts':_0x42dea1||[]});fs[_0xffa4('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1bd36c);})[_0xffa4('0x17')](function(){return respondWithRpcPromise(_0xffa4('0x55'),'create',{'module':'chan_sip.so'});})[_0xffa4('0x17')](function(){var _0x3fc4de=_0x36cedc[_0xffa4('0x56')]['get']({'plain':!![]});if(!_0x3fc4de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fc4de[_0xffa4('0x57')]===_0xffa4('0x56')){var _0x5db3be=_0x4454c0['get']({'plain':!![]});return db[_0xffa4('0x58')][_0xffa4('0x4d')]({'where':{'name':_0xffa4('0x59'),'userProfileId':_0x3fc4de[_0xffa4('0x5a')]},'raw':!![]})['then'](function(_0x58d084){if(_0x58d084&&_0x58d084[_0xffa4('0x5b')]===0x0){return db[_0xffa4('0x2d')][_0xffa4('0x4e')]({'name':_0x5db3be[_0xffa4('0x2f')],'resourceId':_0x5db3be['id'],'type':_0x58d084[_0xffa4('0x2f')],'sectionId':_0x58d084['id']},{})[_0xffa4('0x17')](function(){return _0x4454c0;});}else{return _0x4454c0;}})['catch'](function(_0x1d3032){logger[_0xffa4('0x1c')](_0xffa4('0x5c'),_0x1d3032);throw _0x1d3032;});}return _0x4454c0;})[_0xffa4('0x17')](respondWithResult(_0x20b6a7,0xc9))['catch'](handleError(_0x20b6a7,null));};exports[_0xffa4('0x2b')]=function(_0x4354b0,_0x14e42f,_0x35734d){var _0x16fa1a;return db[_0xffa4('0x33')]['find']({'where':{'id':_0x4354b0['params']['id']}})['then'](handleEntityNotFound(_0x14e42f,null))[_0xffa4('0x17')](saveUpdates(_0x4354b0[_0xffa4('0x4f')],null))[_0xffa4('0x17')](function(_0x1d8c42){if(_0x1d8c42){_0x16fa1a=_0x1d8c42;return db[_0xffa4('0x33')]['findAll']({'raw':!![]});}})['then'](function(_0x12d62b){var _0x579c33=fs[_0xffa4('0x50')](path[_0xffa4('0x51')](config[_0xffa4('0x5d')],_0xffa4('0x52')),_0xffa4('0x53'));var _0xe97f33=ejs[_0xffa4('0x5e')](_0x579c33,{'contexts':_0x12d62b||[]});fs[_0xffa4('0x54')](_0xffa4('0x5f'),_0xe97f33);})[_0xffa4('0x17')](function(){return respondWithRpcPromise(_0xffa4('0x55'),_0xffa4('0x2b'),{'module':_0xffa4('0x60')});})[_0xffa4('0x17')](function(){return _0x16fa1a;})['then'](respondWithResult(_0x14e42f,null))[_0xffa4('0x21')](handleError(_0x14e42f,null));};exports[_0xffa4('0x2c')]=function(_0x2056a5,_0x3dea00,_0x4e0ec8){var _0x5e8bb1;return db['VoiceContext'][_0xffa4('0x4d')]({'where':{'id':_0x2056a5['params']['id']}})[_0xffa4('0x17')](handleEntityNotFound(_0x3dea00,null))[_0xffa4('0x17')](removeEntity(_0x3dea00,null))['then'](function(){return db[_0xffa4('0x33')][_0xffa4('0x48')]({'raw':!![]});})[_0xffa4('0x17')](function(_0x568f4a){var _0x46bc79=fs[_0xffa4('0x50')](path[_0xffa4('0x51')](config[_0xffa4('0x5d')],'server/files/templates/context.ejs'),'utf8');var _0x2afe4f=ejs[_0xffa4('0x5e')](_0x46bc79,{'contexts':_0x568f4a});fs[_0xffa4('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2afe4f);return respondWithRpcPromise(_0xffa4('0x55'),_0xffa4('0x2c'),{'module':_0xffa4('0x60')});})[_0xffa4('0x21')](handleError(_0x3dea00,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 38d34fe..ef76033 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 _0xb1b4=['VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x45fd3c,_0x3ab0e1){var _0x4b47a4=function(_0x2b2d50){while(--_0x2b2d50){_0x45fd3c['push'](_0x45fd3c['shift']());}};_0x4b47a4(++_0x3ab0e1);}(_0xb1b4,0x175));var _0x4b1b=function(_0x2c5009,_0x63505f){_0x2c5009=_0x2c5009-0x0;var _0x40b7f9=_0xb1b4[_0x2c5009];return _0x40b7f9;};'use strict';var _=require(_0x4b1b('0x0'));var util=require(_0x4b1b('0x1'));var logger=require(_0x4b1b('0x2'))('api');var moment=require(_0x4b1b('0x3'));var BPromise=require(_0x4b1b('0x4'));var rp=require(_0x4b1b('0x5'));var fs=require('fs');var path=require(_0x4b1b('0x6'));var rimraf=require(_0x4b1b('0x7'));var config=require(_0x4b1b('0x8'));var attributes=require('./voiceContext.attributes');module[_0x4b1b('0x9')]=function(_0x1c61de,_0x41fec8){return _0x1c61de[_0x4b1b('0xa')](_0x4b1b('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab46=['./voiceContext.attributes','exports','define','VoiceContext','api','moment','request-promise','path','rimraf'];(function(_0x8f10f9,_0x44280b){var _0x32b6c1=function(_0x3d6f6a){while(--_0x3d6f6a){_0x8f10f9['push'](_0x8f10f9['shift']());}};_0x32b6c1(++_0x44280b);}(_0xab46,0x190));var _0x6ab4=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0xab46[_0x1d0499];return _0x153fb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6ab4('0x0'));var moment=require(_0x6ab4('0x1'));var BPromise=require('bluebird');var rp=require(_0x6ab4('0x2'));var fs=require('fs');var path=require(_0x6ab4('0x3'));var rimraf=require(_0x6ab4('0x4'));var config=require('../../config/environment');var attributes=require(_0x6ab4('0x5'));module[_0x6ab4('0x6')]=function(_0x379870,_0xcc1983){return _0x379870[_0x6ab4('0x7')](_0x6ab4('0x8'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 8b7a17f..93efad3 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 _0x7969=['request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3df77c,_0x1bd36d){var _0x2b794f=function(_0x5c6e62){while(--_0x5c6e62){_0x3df77c['push'](_0x3df77c['shift']());}};_0x2b794f(++_0x1bd36d);}(_0x7969,0x1c2));var _0x9796=function(_0x3894fa,_0xda7220){_0x3894fa=_0x3894fa-0x0;var _0x20dc04=_0x7969[_0x3894fa];return _0x20dc04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9796('0x0'));var BPromise=require(_0x9796('0x1'));var rs=require(_0x9796('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9796('0x3'));var logger=require(_0x9796('0x4'))(_0x9796('0x5'));var config=require(_0x9796('0x6'));var jayson=require(_0x9796('0x7'));var client=jayson[_0x9796('0x8')][_0x9796('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x712716,_0x584f53,_0x4509c8){return new BPromise(function(_0x529351,_0x4e0079){return client[_0x9796('0xa')](_0x712716,_0x4509c8)['then'](function(_0x7ebdbd){logger['info'](_0x9796('0xb'),_0x584f53,_0x9796('0xc'));logger[_0x9796('0xd')](_0x9796('0xe'),_0x584f53,_0x9796('0xc'),JSON[_0x9796('0xf')](_0x7ebdbd));if(_0x7ebdbd[_0x9796('0x10')]){if(_0x7ebdbd[_0x9796('0x10')]['code']===0x1f4){logger[_0x9796('0x10')]('VoiceContext,\x20%s,\x20%s',_0x584f53,_0x7ebdbd[_0x9796('0x10')]['message']);return _0x4e0079(_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);}logger[_0x9796('0x10')](_0x9796('0xb'),_0x584f53,_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);return _0x529351(_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);}else{logger[_0x9796('0x12')](_0x9796('0xb'),_0x584f53,_0x9796('0xc'));_0x529351(_0x7ebdbd[_0x9796('0x13')]['message']);}})['catch'](function(_0x4f5a81){logger[_0x9796('0x10')](_0x9796('0xb'),_0x584f53,_0x4f5a81);_0x4e0079(_0x4f5a81);});});} \ No newline at end of file +var _0xa478=['http','then','info','request\x20sent','debug','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xa478,0x136));var _0x8a47=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa478[_0x3c2a69];return _0x596bc8;};'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')]('VoiceContext,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VoiceContext,\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']('VoiceContext,\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);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 0fc6278..49b3b77 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 _0xbf6e=['post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x11e8ac,_0xe2068f){var _0xc35fdf=function(_0x1a1422){while(--_0x1a1422){_0x11e8ac['push'](_0x11e8ac['shift']());}};_0xc35fdf(++_0xe2068f);}(_0xbf6e,0x149));var _0xebf6=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xbf6e[_0x382a62];return _0x490a25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['describe']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0xd')]('/',auth[_0xebf6('0x9')](),controller['create']);router[_0xebf6('0xe')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller[_0xebf6('0xf')]);router[_0xebf6('0x10')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x11')]);module[_0xebf6('0x12')]=router; \ No newline at end of file +var _0xc5e6=['get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller'];(function(_0x246f11,_0x4198fe){var _0x340053=function(_0x43f720){while(--_0x43f720){_0x246f11['push'](_0x246f11['shift']());}};_0x340053(++_0x4198fe);}(_0xc5e6,0x83));var _0x6c5e=function(_0x65d13d,_0x49e929){_0x65d13d=_0x65d13d-0x0;var _0x309bb3=_0xc5e6[_0x65d13d];return _0x309bb3;};'use strict';var multer=require(_0x6c5e('0x0'));var util=require(_0x6c5e('0x1'));var path=require(_0x6c5e('0x2'));var timeout=require(_0x6c5e('0x3'));var express=require(_0x6c5e('0x4'));var router=express[_0x6c5e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c5e('0x6'));var config=require(_0x6c5e('0x7'));var controller=require(_0x6c5e('0x8'));router[_0x6c5e('0x9')]('/',auth['isAuthenticated'](),controller[_0x6c5e('0xa')]);router[_0x6c5e('0x9')](_0x6c5e('0xb'),auth[_0x6c5e('0xc')](),controller[_0x6c5e('0xd')]);router['get'](_0x6c5e('0xe'),auth[_0x6c5e('0xc')](),controller[_0x6c5e('0xf')]);router[_0x6c5e('0x10')]('/',auth[_0x6c5e('0xc')](),controller['create']);router[_0x6c5e('0x11')]('/:id',auth[_0x6c5e('0xc')](),controller[_0x6c5e('0x12')]);router['delete'](_0x6c5e('0xe'),auth[_0x6c5e('0xc')](),controller['destroy']);module[_0x6c5e('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 6fc3277..39b65f6 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3e74,0x175));var _0x43e7=function(_0x587f08,_0x560cd0){_0x587f08=_0x587f08-0x0;var _0x3f2cbd=_0x3e74[_0x587f08];return _0x3f2cbd;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x54ef=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x54ef,0x112));var _0xf54e=function(_0x20b516,_0x5ce54d){_0x20b516=_0x20b516-0x0;var _0x372769=_0x54ef[_0x20b516];return _0x372769;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'privilege':{'type':Sequelize[_0xf54e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf54e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'calleridnum':{'type':Sequelize[_0xf54e('0x2')]},'calleridname':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'language':{'type':Sequelize[_0xf54e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf54e('0x2')]},'priority':{'type':Sequelize[_0xf54e('0x3')]},'uniqueid':{'type':Sequelize[_0xf54e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf54e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'destlanguage':{'type':Sequelize[_0xf54e('0x2')]},'destaccountcode':{'type':Sequelize[_0xf54e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf54e('0x2')]},'destpriority':{'type':Sequelize[_0xf54e('0x3')]},'destuniqueid':{'type':Sequelize[_0xf54e('0x2')]},'destlinkedid':{'type':Sequelize[_0xf54e('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xf54e('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf54e('0x4')]},'lastevent':{'type':Sequelize[_0xf54e('0x2')],'comment':_0xf54e('0x5')},'routeId':{'type':Sequelize[_0xf54e('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf54e('0x3')]},'billableseconds':{'type':Sequelize[_0xf54e('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 1723a68..b8e74e2 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 _0x3dc2=['VoiceDialReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','update','body','destroy','describe','rimraf','zip-dir','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/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','send','map'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x3dc2,0xbe));var _0x23dc=function(_0x42a4fd,_0x37ea6c){_0x42a4fd=_0x42a4fd-0x0;var _0x1626c3=_0x3dc2[_0x42a4fd];return _0x1626c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23dc('0x0'));var zipdir=require(_0x23dc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23dc('0x2'));var moment=require(_0x23dc('0x3'));var BPromise=require(_0x23dc('0x4'));var Mustache=require(_0x23dc('0x5'));var util=require(_0x23dc('0x6'));var path=require(_0x23dc('0x7'));var sox=require('sox');var csv=require(_0x23dc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23dc('0x9'));var _=require(_0x23dc('0xa'));var squel=require(_0x23dc('0xb'));var crypto=require(_0x23dc('0xc'));var jsforce=require(_0x23dc('0xd'));var deskjs=require(_0x23dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x23dc('0xf'));var Papa=require(_0x23dc('0x10'));var Redis=require(_0x23dc('0x11'));var authService=require(_0x23dc('0x12'));var qs=require(_0x23dc('0x13'));var as=require(_0x23dc('0x14'));var hardwareService=require(_0x23dc('0x15'));var logger=require(_0x23dc('0x16'))(_0x23dc('0x17'));var utils=require(_0x23dc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x23dc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2af55e,_0xb2efa7){_0xb2efa7=_0xb2efa7||0xcc;return function(_0x14821a){if(_0x14821a){return _0x2af55e[_0x23dc('0x1a')](_0xb2efa7);}return _0x2af55e[_0x23dc('0x1b')](_0xb2efa7)[_0x23dc('0x1c')]();};}function respondWithResult(_0x36562d,_0x5b08e9){_0x5b08e9=_0x5b08e9||0xc8;return function(_0x4eae5e){if(_0x4eae5e){return _0x36562d[_0x23dc('0x1b')](_0x5b08e9)[_0x23dc('0x1d')](_0x4eae5e);}};}function respondWithFilteredResult(_0x252641,_0x363775){return function(_0x23db2a){if(_0x23db2a){var _0x3adc42=typeof _0x363775[_0x23dc('0x1e')]==='undefined'&&typeof _0x363775[_0x23dc('0x1f')]===_0x23dc('0x20');var _0x5050fe=_0x23db2a[_0x23dc('0x21')];var _0x4ca543=_0x3adc42?0x0:_0x363775[_0x23dc('0x1e')];var _0x435aa4=_0x3adc42?_0x23db2a[_0x23dc('0x21')]:_0x363775[_0x23dc('0x1e')]+_0x363775[_0x23dc('0x1f')];var _0x1c9a4b;if(_0x435aa4>=_0x5050fe){_0x435aa4=_0x5050fe;_0x1c9a4b=0xc8;}else{_0x1c9a4b=0xce;}_0x252641[_0x23dc('0x1b')](_0x1c9a4b);return _0x252641[_0x23dc('0x22')](_0x23dc('0x23'),_0x4ca543+'-'+_0x435aa4+'/'+_0x5050fe)[_0x23dc('0x1d')](_0x23db2a);}return null;};}function patchUpdates(_0x414b06){return function(_0x5e766a){try{jsonpatch[_0x23dc('0x24')](_0x5e766a,_0x414b06,!![]);}catch(_0xdbc235){return BPromise[_0x23dc('0x25')](_0xdbc235);}return _0x5e766a[_0x23dc('0x26')]();};}function saveUpdates(_0x33092e,_0xc658bb){return function(_0x540bc8){if(_0x540bc8){return _0x540bc8['update'](_0x33092e)[_0x23dc('0x27')](function(_0x27e1f0){return _0x27e1f0;});}return null;};}function removeEntity(_0x8cb710,_0x201d3f){return function(_0x571851){if(_0x571851){return _0x571851['destroy']()['then'](function(){_0x8cb710[_0x23dc('0x1b')](0xcc)[_0x23dc('0x1c')]();});}};}function handleEntityNotFound(_0x121292,_0x1ccb8e){return function(_0xceb76c){if(!_0xceb76c){_0x121292['sendStatus'](0x194);}return _0xceb76c;};}function handleError(_0x1cc942,_0x4bdcf1){_0x4bdcf1=_0x4bdcf1||0x1f4;return function(_0x1ec33e){logger['error'](_0x1ec33e[_0x23dc('0x28')]);if(_0x1ec33e['name']){delete _0x1ec33e[_0x23dc('0x29')];}_0x1cc942[_0x23dc('0x1b')](_0x4bdcf1)[_0x23dc('0x2a')](_0x1ec33e);};}exports['index']=function(_0x5d3979,_0x37cb48){var _0x25f132={},_0xff9efe={},_0x3e8536={'count':0x0,'rows':[]};var _0x4e73ea=_[_0x23dc('0x2b')](db[_0x23dc('0x2c')]['rawAttributes'],function(_0x4772a4){return{'name':_0x4772a4[_0x23dc('0x2d')],'type':_0x4772a4[_0x23dc('0x2e')]['key']};});_0xff9efe[_0x23dc('0x2f')]=_[_0x23dc('0x2b')](_0x4e73ea,_0x23dc('0x29'));_0xff9efe['query']=_['keys'](_0x5d3979[_0x23dc('0x30')]);_0xff9efe[_0x23dc('0x31')]=_[_0x23dc('0x32')](_0xff9efe[_0x23dc('0x2f')],_0xff9efe[_0x23dc('0x30')]);_0x25f132[_0x23dc('0x33')]=_['intersection'](_0xff9efe['model'],qs[_0x23dc('0x34')](_0x5d3979[_0x23dc('0x30')]['fields']));_0x25f132['attributes']=_0x25f132[_0x23dc('0x33')][_0x23dc('0x35')]?_0x25f132[_0x23dc('0x33')]:_0xff9efe[_0x23dc('0x2f')];if(!_0x5d3979[_0x23dc('0x30')][_0x23dc('0x36')](_0x23dc('0x37'))){_0x25f132['limit']=qs[_0x23dc('0x1f')](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x1f')]);_0x25f132[_0x23dc('0x1e')]=qs['offset'](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x1e')]);}_0x25f132[_0x23dc('0x38')]=qs[_0x23dc('0x39')](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x39')]);_0x25f132['where']=qs['filters'](_[_0x23dc('0x3a')](_0x5d3979[_0x23dc('0x30')],_0xff9efe[_0x23dc('0x31')]),_0x4e73ea);if(_0x5d3979[_0x23dc('0x30')][_0x23dc('0x3b')]){_0x25f132[_0x23dc('0x3c')]=_['merge'](_0x25f132[_0x23dc('0x3c')],{'$or':_[_0x23dc('0x2b')](_0x4e73ea,function(_0x469987){if(_0x469987[_0x23dc('0x2e')]!==_0x23dc('0x3d')){var _0x21a71b={};_0x21a71b[_0x469987[_0x23dc('0x29')]]={'$like':'%'+_0x5d3979[_0x23dc('0x30')][_0x23dc('0x3b')]+'%'};return _0x21a71b;}})});}_0x25f132=_[_0x23dc('0x3e')]({},_0x25f132,_0x5d3979['options']);var _0xd7aae3={'where':_0x25f132[_0x23dc('0x3c')]};return db[_0x23dc('0x2c')]['count'](_0xd7aae3)[_0x23dc('0x27')](function(_0x451f94){_0x3e8536[_0x23dc('0x21')]=_0x451f94;if(_0x5d3979['query']['includeAll']){_0x25f132[_0x23dc('0x3f')]=[{'all':!![]}];}return db[_0x23dc('0x2c')][_0x23dc('0x40')](_0x25f132);})[_0x23dc('0x27')](function(_0x50ff8f){_0x3e8536[_0x23dc('0x41')]=_0x50ff8f;return _0x3e8536;})[_0x23dc('0x27')](respondWithFilteredResult(_0x37cb48,_0x25f132))[_0x23dc('0x42')](handleError(_0x37cb48,null));};exports['show']=function(_0xe5fae0,_0x4fad4d){var _0x907ec4={'raw':!![],'where':{'id':_0xe5fae0[_0x23dc('0x43')]['id']}},_0x224c51={};_0x224c51[_0x23dc('0x2f')]=_[_0x23dc('0x44')](db[_0x23dc('0x2c')][_0x23dc('0x45')]);_0x224c51['query']=_[_0x23dc('0x44')](_0xe5fae0[_0x23dc('0x30')]);_0x224c51[_0x23dc('0x31')]=_[_0x23dc('0x32')](_0x224c51[_0x23dc('0x2f')],_0x224c51['query']);_0x907ec4['attributes']=_['intersection'](_0x224c51[_0x23dc('0x2f')],qs[_0x23dc('0x34')](_0xe5fae0[_0x23dc('0x30')]['fields']));_0x907ec4['attributes']=_0x907ec4['attributes'][_0x23dc('0x35')]?_0x907ec4[_0x23dc('0x33')]:_0x224c51['model'];if(_0xe5fae0['query'][_0x23dc('0x46')]){_0x907ec4['include']=[{'all':!![]}];}_0x907ec4=_['merge']({},_0x907ec4,_0xe5fae0[_0x23dc('0x47')]);return db[_0x23dc('0x2c')][_0x23dc('0x48')](_0x907ec4)[_0x23dc('0x27')](handleEntityNotFound(_0x4fad4d,null))[_0x23dc('0x27')](respondWithResult(_0x4fad4d,null))[_0x23dc('0x42')](handleError(_0x4fad4d,null));};exports['create']=function(_0x15c6f4,_0xb6d9d3){return db[_0x23dc('0x2c')][_0x23dc('0x49')](_0x15c6f4['body'],{})['then'](respondWithResult(_0xb6d9d3,0xc9))['catch'](handleError(_0xb6d9d3,null));};exports[_0x23dc('0x4a')]=function(_0x88f638,_0xb34e48){if(_0x88f638['body']['id']){delete _0x88f638[_0x23dc('0x4b')]['id'];}return db[_0x23dc('0x2c')][_0x23dc('0x48')]({'where':{'id':_0x88f638['params']['id']}})[_0x23dc('0x27')](handleEntityNotFound(_0xb34e48,null))[_0x23dc('0x27')](saveUpdates(_0x88f638[_0x23dc('0x4b')],null))[_0x23dc('0x27')](respondWithResult(_0xb34e48,null))[_0x23dc('0x42')](handleError(_0xb34e48,null));};exports[_0x23dc('0x4c')]=function(_0x2290f3,_0x4d95f6){return db[_0x23dc('0x2c')]['find']({'where':{'id':_0x2290f3[_0x23dc('0x43')]['id']}})[_0x23dc('0x27')](handleEntityNotFound(_0x4d95f6,null))['then'](removeEntity(_0x4d95f6,null))[_0x23dc('0x42')](handleError(_0x4d95f6,null));};exports['describe']=function(_0x2046e7,_0x622398){return db[_0x23dc('0x2c')][_0x23dc('0x4d')]()['then'](respondWithResult(_0x622398,null))['catch'](handleError(_0x622398,null));}; \ No newline at end of file +var _0x3b2f=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','VoiceDialReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x27a46c,_0x32d860){var _0x1b1ac8=function(_0x2cac51){while(--_0x2cac51){_0x27a46c['push'](_0x27a46c['shift']());}};_0x1b1ac8(++_0x32d860);}(_0x3b2f,0xcb));var _0xf3b2=function(_0x1e1059,_0x406e2f){_0x1e1059=_0x1e1059-0x0;var _0x5e39cd=_0x3b2f[_0x1e1059];return _0x5e39cd;};'use strict';var emlformat=require(_0xf3b2('0x0'));var rimraf=require(_0xf3b2('0x1'));var zipdir=require(_0xf3b2('0x2'));var jsonpatch=require(_0xf3b2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3b2('0x4'));var util=require(_0xf3b2('0x5'));var path=require(_0xf3b2('0x6'));var sox=require('sox');var csv=require(_0xf3b2('0x7'));var ejs=require(_0xf3b2('0x8'));var fs=require('fs');var fs_extra=require(_0xf3b2('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf3b2('0xa'));var jsforce=require(_0xf3b2('0xb'));var deskjs=require(_0xf3b2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf3b2('0xd'));var Papa=require('papaparse');var Redis=require(_0xf3b2('0xe'));var authService=require(_0xf3b2('0xf'));var qs=require(_0xf3b2('0x10'));var as=require(_0xf3b2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3b2('0x12'))(_0xf3b2('0x13'));var utils=require(_0xf3b2('0x14'));var config=require(_0xf3b2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3b2('0x16'))['db'];function respondWithStatusCode(_0x553838,_0x139731){_0x139731=_0x139731||0xcc;return function(_0x1e6d04){if(_0x1e6d04){return _0x553838['sendStatus'](_0x139731);}return _0x553838[_0xf3b2('0x17')](_0x139731)[_0xf3b2('0x18')]();};}function respondWithResult(_0x3ac236,_0x2e5285){_0x2e5285=_0x2e5285||0xc8;return function(_0x196e7a){if(_0x196e7a){return _0x3ac236[_0xf3b2('0x17')](_0x2e5285)['json'](_0x196e7a);}};}function respondWithFilteredResult(_0x20e5b5,_0x58006a){return function(_0x36e37c){if(_0x36e37c){var _0x21fa5e=typeof _0x58006a['offset']==='undefined'&&typeof _0x58006a['limit']===_0xf3b2('0x19');var _0x5b0a3b=_0x36e37c[_0xf3b2('0x1a')];var _0x50f00d=_0x21fa5e?0x0:_0x58006a[_0xf3b2('0x1b')];var _0x5729c1=_0x21fa5e?_0x36e37c[_0xf3b2('0x1a')]:_0x58006a[_0xf3b2('0x1b')]+_0x58006a['limit'];var _0x363ce1;if(_0x5729c1>=_0x5b0a3b){_0x5729c1=_0x5b0a3b;_0x363ce1=0xc8;}else{_0x363ce1=0xce;}_0x20e5b5[_0xf3b2('0x17')](_0x363ce1);return _0x20e5b5['set'](_0xf3b2('0x1c'),_0x50f00d+'-'+_0x5729c1+'/'+_0x5b0a3b)['json'](_0x36e37c);}return null;};}function patchUpdates(_0x1622aa){return function(_0x46cd53){try{jsonpatch[_0xf3b2('0x1d')](_0x46cd53,_0x1622aa,!![]);}catch(_0x24afb7){return BPromise[_0xf3b2('0x1e')](_0x24afb7);}return _0x46cd53['save']();};}function saveUpdates(_0x4b267f,_0x50e0dd){return function(_0x50feef){if(_0x50feef){return _0x50feef['update'](_0x4b267f)[_0xf3b2('0x1f')](function(_0x542ff7){return _0x542ff7;});}return null;};}function removeEntity(_0x192170,_0x38c49e){return function(_0xe4dbd8){if(_0xe4dbd8){return _0xe4dbd8[_0xf3b2('0x20')]()[_0xf3b2('0x1f')](function(){_0x192170['status'](0xcc)[_0xf3b2('0x18')]();});}};}function handleEntityNotFound(_0x201418,_0x32a794){return function(_0x572166){if(!_0x572166){_0x201418[_0xf3b2('0x21')](0x194);}return _0x572166;};}function handleError(_0x580c83,_0x42a1b6){_0x42a1b6=_0x42a1b6||0x1f4;return function(_0x1c9316){logger[_0xf3b2('0x22')](_0x1c9316[_0xf3b2('0x23')]);if(_0x1c9316[_0xf3b2('0x24')]){delete _0x1c9316[_0xf3b2('0x24')];}_0x580c83[_0xf3b2('0x17')](_0x42a1b6)[_0xf3b2('0x25')](_0x1c9316);};}exports[_0xf3b2('0x26')]=function(_0x32183c,_0x28688e){var _0x110b1a={},_0xed7f7e={},_0x278103={'count':0x0,'rows':[]};var _0x107f1c=_['map'](db[_0xf3b2('0x27')][_0xf3b2('0x28')],function(_0x539f33){return{'name':_0x539f33['fieldName'],'type':_0x539f33[_0xf3b2('0x29')][_0xf3b2('0x2a')]};});_0xed7f7e[_0xf3b2('0x2b')]=_[_0xf3b2('0x2c')](_0x107f1c,_0xf3b2('0x24'));_0xed7f7e[_0xf3b2('0x2d')]=_[_0xf3b2('0x2e')](_0x32183c[_0xf3b2('0x2d')]);_0xed7f7e[_0xf3b2('0x2f')]=_[_0xf3b2('0x30')](_0xed7f7e[_0xf3b2('0x2b')],_0xed7f7e['query']);_0x110b1a[_0xf3b2('0x31')]=_['intersection'](_0xed7f7e['model'],qs[_0xf3b2('0x32')](_0x32183c[_0xf3b2('0x2d')][_0xf3b2('0x32')]));_0x110b1a[_0xf3b2('0x31')]=_0x110b1a[_0xf3b2('0x31')]['length']?_0x110b1a[_0xf3b2('0x31')]:_0xed7f7e[_0xf3b2('0x2b')];if(!_0x32183c[_0xf3b2('0x2d')]['hasOwnProperty'](_0xf3b2('0x33'))){_0x110b1a[_0xf3b2('0x34')]=qs['limit'](_0x32183c[_0xf3b2('0x2d')][_0xf3b2('0x34')]);_0x110b1a['offset']=qs[_0xf3b2('0x1b')](_0x32183c['query'][_0xf3b2('0x1b')]);}_0x110b1a[_0xf3b2('0x35')]=qs[_0xf3b2('0x36')](_0x32183c['query'][_0xf3b2('0x36')]);_0x110b1a[_0xf3b2('0x37')]=qs['filters'](_[_0xf3b2('0x38')](_0x32183c['query'],_0xed7f7e[_0xf3b2('0x2f')]),_0x107f1c);if(_0x32183c[_0xf3b2('0x2d')][_0xf3b2('0x39')]){_0x110b1a['where']=_[_0xf3b2('0x3a')](_0x110b1a[_0xf3b2('0x37')],{'$or':_['map'](_0x107f1c,function(_0x149b5e){if(_0x149b5e[_0xf3b2('0x29')]!==_0xf3b2('0x3b')){var _0x32af93={};_0x32af93[_0x149b5e[_0xf3b2('0x24')]]={'$like':'%'+_0x32183c[_0xf3b2('0x2d')][_0xf3b2('0x39')]+'%'};return _0x32af93;}})});}_0x110b1a=_[_0xf3b2('0x3a')]({},_0x110b1a,_0x32183c[_0xf3b2('0x3c')]);var _0x6afb2f={'where':_0x110b1a[_0xf3b2('0x37')]};return db['VoiceDialReport'][_0xf3b2('0x1a')](_0x6afb2f)[_0xf3b2('0x1f')](function(_0x20966d){_0x278103[_0xf3b2('0x1a')]=_0x20966d;if(_0x32183c[_0xf3b2('0x2d')][_0xf3b2('0x3d')]){_0x110b1a[_0xf3b2('0x3e')]=[{'all':!![]}];}return db[_0xf3b2('0x27')][_0xf3b2('0x3f')](_0x110b1a);})[_0xf3b2('0x1f')](function(_0x1e8fdd){_0x278103[_0xf3b2('0x40')]=_0x1e8fdd;return _0x278103;})[_0xf3b2('0x1f')](respondWithFilteredResult(_0x28688e,_0x110b1a))['catch'](handleError(_0x28688e,null));};exports[_0xf3b2('0x41')]=function(_0x16991e,_0x5ee359){var _0x394c17={'raw':!![],'where':{'id':_0x16991e['params']['id']}},_0x4a71a5={};_0x4a71a5[_0xf3b2('0x2b')]=_[_0xf3b2('0x2e')](db[_0xf3b2('0x27')][_0xf3b2('0x28')]);_0x4a71a5['query']=_[_0xf3b2('0x2e')](_0x16991e[_0xf3b2('0x2d')]);_0x4a71a5[_0xf3b2('0x2f')]=_[_0xf3b2('0x30')](_0x4a71a5['model'],_0x4a71a5[_0xf3b2('0x2d')]);_0x394c17['attributes']=_['intersection'](_0x4a71a5[_0xf3b2('0x2b')],qs['fields'](_0x16991e['query']['fields']));_0x394c17['attributes']=_0x394c17[_0xf3b2('0x31')]['length']?_0x394c17[_0xf3b2('0x31')]:_0x4a71a5[_0xf3b2('0x2b')];if(_0x16991e[_0xf3b2('0x2d')][_0xf3b2('0x3d')]){_0x394c17['include']=[{'all':!![]}];}_0x394c17=_[_0xf3b2('0x3a')]({},_0x394c17,_0x16991e['options']);return db[_0xf3b2('0x27')][_0xf3b2('0x42')](_0x394c17)['then'](handleEntityNotFound(_0x5ee359,null))['then'](respondWithResult(_0x5ee359,null))['catch'](handleError(_0x5ee359,null));};exports[_0xf3b2('0x43')]=function(_0x5c9f80,_0x303285){return db[_0xf3b2('0x27')]['create'](_0x5c9f80['body'],{})[_0xf3b2('0x1f')](respondWithResult(_0x303285,0xc9))[_0xf3b2('0x44')](handleError(_0x303285,null));};exports['update']=function(_0x556823,_0x4737bf){if(_0x556823[_0xf3b2('0x45')]['id']){delete _0x556823[_0xf3b2('0x45')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x556823[_0xf3b2('0x46')]['id']}})[_0xf3b2('0x1f')](handleEntityNotFound(_0x4737bf,null))[_0xf3b2('0x1f')](saveUpdates(_0x556823[_0xf3b2('0x45')],null))[_0xf3b2('0x1f')](respondWithResult(_0x4737bf,null))[_0xf3b2('0x44')](handleError(_0x4737bf,null));};exports['destroy']=function(_0x3447ea,_0x49a844){return db['VoiceDialReport'][_0xf3b2('0x42')]({'where':{'id':_0x3447ea[_0xf3b2('0x46')]['id']}})['then'](handleEntityNotFound(_0x49a844,null))[_0xf3b2('0x1f')](removeEntity(_0x49a844,null))[_0xf3b2('0x44')](handleError(_0x49a844,null));};exports[_0xf3b2('0x47')]=function(_0x3ac530,_0x294ff3){return db['VoiceDialReport'][_0xf3b2('0x47')]()['then'](respondWithResult(_0x294ff3,null))[_0xf3b2('0x44')](handleError(_0x294ff3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ff63e03..87dd0ee 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 _0x6732=['rimraf','../../config/environment','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var logger=require(_0x2673('0x2'))(_0x2673('0x3'));var moment=require('moment');var BPromise=require(_0x2673('0x4'));var rp=require(_0x2673('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2673('0x6'));var config=require(_0x2673('0x7'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x90d6e5,_0x2ec408){return _0x90d6e5[_0x2673('0x8')](_0x2673('0x9'),attributes,{'tableName':_0x2673('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2673('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93b6=['VoiceDialReport','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x40c5b1,_0x1ee8fb){var _0xadf958=function(_0x2efb71){while(--_0x2efb71){_0x40c5b1['push'](_0x40c5b1['shift']());}};_0xadf958(++_0x1ee8fb);}(_0x93b6,0x151));var _0x693b=function(_0x123776,_0x323fa2){_0x123776=_0x123776-0x0;var _0xd95647=_0x93b6[_0x123776];return _0xd95647;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var logger=require('../../config/logger')(_0x693b('0x2'));var moment=require(_0x693b('0x3'));var BPromise=require('bluebird');var rp=require(_0x693b('0x4'));var fs=require('fs');var path=require(_0x693b('0x5'));var rimraf=require(_0x693b('0x6'));var config=require(_0x693b('0x7'));var attributes=require(_0x693b('0x8'));module[_0x693b('0x9')]=function(_0x2a3f16,_0x2a2473){return _0x2a3f16[_0x693b('0xa')](_0x693b('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2824c43..b659f74 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 _0x8209=['UpdateVoiceDialReport','where','attributes','util','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceDialReport,\x20%s,\x20%s','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport'];(function(_0x10b84a,_0x9eccd6){var _0x284a42=function(_0x164656){while(--_0x164656){_0x10b84a['push'](_0x10b84a['shift']());}};_0x284a42(++_0x9eccd6);}(_0x8209,0xb1));var _0x9820=function(_0x41fcea,_0x83311b){_0x41fcea=_0x41fcea-0x0;var _0x465542=_0x8209[_0x41fcea];return _0x465542;};'use strict';var _=require('lodash');var util=require(_0x9820('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9820('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x9820('0x2'))(_0x9820('0x3'));var config=require('../../config/environment');var jayson=require(_0x9820('0x4'));var client=jayson[_0x9820('0x5')][_0x9820('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xbd9011,_0x176848,_0x1aa925){return new BPromise(function(_0x11d391,_0x268e60){return client[_0x9820('0x7')](_0xbd9011,_0x1aa925)[_0x9820('0x8')](function(_0x5475df){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x9820('0x9'));logger[_0x9820('0xa')](_0x9820('0xb'),_0x176848,_0x9820('0x9'),JSON[_0x9820('0xc')](_0x5475df));if(_0x5475df[_0x9820('0xd')]){if(_0x5475df['error'][_0x9820('0xe')]===0x1f4){logger[_0x9820('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);return _0x268e60(_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);}logger[_0x9820('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);return _0x11d391(_0x5475df[_0x9820('0xd')]['message']);}else{logger[_0x9820('0x10')](_0x9820('0x11'),_0x176848,_0x9820('0x9'));_0x11d391(_0x5475df[_0x9820('0x12')][_0x9820('0xf')]);}})[_0x9820('0x13')](function(_0x72aa3e){logger['error'](_0x9820('0x11'),_0x176848,_0x72aa3e);_0x268e60(_0x72aa3e);});});}exports['CreateVoiceDialReport']=function(_0x222d13){var _0x5d265a=this;return new Promise(function(_0xeb667f,_0x499ba5){return db[_0x9820('0x14')][_0x9820('0x15')](_0x222d13[_0x9820('0x16')],{'raw':_0x222d13[_0x9820('0x17')]?_0x222d13[_0x9820('0x17')][_0x9820('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2f8cba){logger[_0x9820('0x10')]('CreateVoiceDialReport',_0x222d13);logger[_0x9820('0xa')]('CreateVoiceDialReport',_0x222d13,JSON[_0x9820('0xc')](_0x2f8cba));_0xeb667f(_0x2f8cba);})[_0x9820('0x13')](function(_0x4b9b1b){logger[_0x9820('0xd')](_0x9820('0x19'),_0x4b9b1b[_0x9820('0xf')],_0x222d13);_0x499ba5(_0x5d265a[_0x9820('0xd')](0x1f4,_0x4b9b1b[_0x9820('0xf')]));});});};exports[_0x9820('0x1a')]=function(_0x11985f){var _0x1c7001=this;return new Promise(function(_0x23dfa0,_0x33ba5e){return db['VoiceDialReport']['update'](_0x11985f[_0x9820('0x16')],{'raw':_0x11985f['options']?_0x11985f[_0x9820('0x17')][_0x9820('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11985f[_0x9820('0x17')]?_0x11985f[_0x9820('0x17')][_0x9820('0x1b')]||null:null,'attributes':_0x11985f[_0x9820('0x17')]?_0x11985f['options'][_0x9820('0x1c')]||null:null,'limit':_0x11985f[_0x9820('0x17')]?_0x11985f[_0x9820('0x17')]['limit']||null:null})[_0x9820('0x8')](function(_0x58a5a6){logger[_0x9820('0x10')]('UpdateVoiceDialReport',_0x11985f);logger[_0x9820('0xa')]('UpdateVoiceDialReport',_0x11985f,JSON['stringify'](_0x58a5a6));_0x23dfa0(_0x58a5a6);})[_0x9820('0x13')](function(_0x511722){logger['error']('UpdateVoiceDialReport',_0x511722[_0x9820('0xf')],_0x11985f);_0x33ba5e(_0x1c7001[_0x9820('0xd')](0x1f4,_0x511722[_0x9820('0xf')]));});});}; \ No newline at end of file +var _0xc317=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','limit','lodash','util','moment'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xc317,0xd6));var _0x7c31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc317[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7c31('0x0'));var util=require(_0x7c31('0x1'));var moment=require(_0x7c31('0x2'));var BPromise=require(_0x7c31('0x3'));var rs=require(_0x7c31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c31('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c31('0x6'))('rpc');var config=require(_0x7c31('0x7'));var jayson=require(_0x7c31('0x8'));var client=jayson[_0x7c31('0x9')][_0x7c31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da0b8,_0x4191ad,_0x2c994b){return new BPromise(function(_0x49c341,_0xbd8134){return client[_0x7c31('0xb')](_0x1da0b8,_0x2c994b)['then'](function(_0x4fc15a){logger[_0x7c31('0xc')](_0x7c31('0xd'),_0x4191ad,'request\x20sent');logger[_0x7c31('0xe')](_0x7c31('0xf'),_0x4191ad,_0x7c31('0x10'),JSON[_0x7c31('0x11')](_0x4fc15a));if(_0x4fc15a[_0x7c31('0x12')]){if(_0x4fc15a[_0x7c31('0x12')][_0x7c31('0x13')]===0x1f4){logger['error'](_0x7c31('0xd'),_0x4191ad,_0x4fc15a['error'][_0x7c31('0x14')]);return _0xbd8134(_0x4fc15a['error'][_0x7c31('0x14')]);}logger[_0x7c31('0x12')](_0x7c31('0xd'),_0x4191ad,_0x4fc15a[_0x7c31('0x12')]['message']);return _0x49c341(_0x4fc15a['error']['message']);}else{logger[_0x7c31('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x4191ad,'request\x20sent');_0x49c341(_0x4fc15a[_0x7c31('0x15')][_0x7c31('0x14')]);}})[_0x7c31('0x16')](function(_0x20d9b9){logger[_0x7c31('0x12')](_0x7c31('0xd'),_0x4191ad,_0x20d9b9);_0xbd8134(_0x20d9b9);});});}exports[_0x7c31('0x17')]=function(_0x3c97b9){var _0x1afac8=this;return new Promise(function(_0x5ca96f,_0xb34786){return db[_0x7c31('0x18')]['create'](_0x3c97b9[_0x7c31('0x19')],{'raw':_0x3c97b9[_0x7c31('0x1a')]?_0x3c97b9[_0x7c31('0x1a')][_0x7c31('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3e5dba){logger[_0x7c31('0xc')]('CreateVoiceDialReport',_0x3c97b9);logger[_0x7c31('0xe')](_0x7c31('0x17'),_0x3c97b9,JSON[_0x7c31('0x11')](_0x3e5dba));_0x5ca96f(_0x3e5dba);})[_0x7c31('0x16')](function(_0x127cb7){logger[_0x7c31('0x12')]('CreateVoiceDialReport',_0x127cb7[_0x7c31('0x14')],_0x3c97b9);_0xb34786(_0x1afac8[_0x7c31('0x12')](0x1f4,_0x127cb7['message']));});});};exports[_0x7c31('0x1c')]=function(_0x4874b9){var _0x450b3e=this;return new Promise(function(_0x22c22c,_0x9808a){return db[_0x7c31('0x18')][_0x7c31('0x1d')](_0x4874b9[_0x7c31('0x19')],{'raw':_0x4874b9[_0x7c31('0x1a')]?_0x4874b9[_0x7c31('0x1a')][_0x7c31('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4874b9[_0x7c31('0x1a')]?_0x4874b9[_0x7c31('0x1a')]['where']||null:null,'attributes':_0x4874b9['options']?_0x4874b9[_0x7c31('0x1a')]['attributes']||null:null,'limit':_0x4874b9[_0x7c31('0x1a')]?_0x4874b9[_0x7c31('0x1a')][_0x7c31('0x1e')]||null:null})['then'](function(_0x586ca2){logger[_0x7c31('0xc')](_0x7c31('0x1c'),_0x4874b9);logger['debug'](_0x7c31('0x1c'),_0x4874b9,JSON[_0x7c31('0x11')](_0x586ca2));_0x22c22c(_0x586ca2);})[_0x7c31('0x16')](function(_0x3dba26){logger['error']('UpdateVoiceDialReport',_0x3dba26['message'],_0x4874b9);_0x9808a(_0x450b3e['error'](0x1f4,_0x3dba26[_0x7c31('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 88b3104..2184f99 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 _0x2b88=['get','isAuthenticated','show','create','/:id/applications','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x2cfac1,_0x29a0c9){var _0x25409b=function(_0x2ffb47){while(--_0x2ffb47){_0x2cfac1['push'](_0x2cfac1['shift']());}};_0x25409b(++_0x29a0c9);}(_0x2b88,0x122));var _0x82b8=function(_0x41bee3,_0x2315fb){_0x41bee3=_0x41bee3-0x0;var _0x2596ac=_0x2b88[_0x41bee3];return _0x2596ac;};'use strict';var multer=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var path=require(_0x82b8('0x2'));var timeout=require('connect-timeout');var express=require(_0x82b8('0x3'));var router=express[_0x82b8('0x4')]();var fs_extra=require(_0x82b8('0x5'));var auth=require(_0x82b8('0x6'));var interaction=require(_0x82b8('0x7'));var config=require(_0x82b8('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x82b8('0x9')]);router[_0x82b8('0xa')]('/:id',auth[_0x82b8('0xb')](),controller[_0x82b8('0xc')]);router['post']('/',auth[_0x82b8('0xb')](),controller[_0x82b8('0xd')]);router['post'](_0x82b8('0xe'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x82b8('0xf'),auth['isAuthenticated'](),controller[_0x82b8('0x10')]);router[_0x82b8('0x11')](_0x82b8('0xf'),auth[_0x82b8('0xb')](),controller[_0x82b8('0x12')]);module[_0x82b8('0x13')]=router; \ No newline at end of file +var _0xb259=['post','create','/:id/applications','addApplications','put','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x4f41e2,_0x2e4497){var _0x23327f=function(_0x27dbf8){while(--_0x27dbf8){_0x4f41e2['push'](_0x4f41e2['shift']());}};_0x23327f(++_0x2e4497);}(_0xb259,0xc1));var _0x9b25=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xb259[_0x16dbfd];return _0x382254;};'use strict';var multer=require(_0x9b25('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b25('0x1'));var express=require('express');var router=express[_0x9b25('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9b25('0x3'));var interaction=require(_0x9b25('0x4'));var config=require(_0x9b25('0x5'));var controller=require('./voiceExtension.controller');router[_0x9b25('0x6')]('/',auth[_0x9b25('0x7')](),controller[_0x9b25('0x8')]);router[_0x9b25('0x6')](_0x9b25('0x9'),auth['isAuthenticated'](),controller[_0x9b25('0xa')]);router[_0x9b25('0xb')]('/',auth[_0x9b25('0x7')](),controller[_0x9b25('0xc')]);router[_0x9b25('0xb')](_0x9b25('0xd'),auth[_0x9b25('0x7')](),controller[_0x9b25('0xe')]);router[_0x9b25('0xf')](_0x9b25('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x9b25('0x7')](),controller['destroy']);module[_0x9b25('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index be8cdd4..392bcc4 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 _0x84e7=['STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','any','BOOLEAN','wav','VIRTUAL','getDataValue','exports'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x84e7,0xb5));var _0x784e=function(_0x4f0002,_0x159a72){_0x4f0002=_0x4f0002-0x0;var _0x1b68d9=_0x84e7[_0x4f0002];return _0x1b68d9;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'context':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x784e('0x2')},'priority':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x784e('0x2')},'tag':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x784e('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x784e('0x4'),_0x784e('0x5'),_0x784e('0x6'),_0x784e('0x7'),'outbound-fax','system',_0x784e('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x784e('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x784e('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x784e('0x1')],'defaultValue':_0x784e('0xa')},'answer':{'type':Sequelize[_0x784e('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x784e('0xb')],'get':function(_0x215cb8){return this[_0x784e('0xc')]('exten');}},'alias':{'type':Sequelize[_0x784e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x382d=['inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x382d,0xf3));var _0xd382=function(_0x46cbc6,_0x477112){_0x46cbc6=_0x46cbc6-0x0;var _0x335ca5=_0x382d[_0x46cbc6];return _0x335ca5;};'use strict';var Sequelize=require(_0xd382('0x0'));module[_0xd382('0x1')]={'context':{'type':Sequelize[_0xd382('0x2')],'allowNull':![],'unique':_0xd382('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd382('0x2')],'allowNull':![],'unique':_0xd382('0x3')},'priority':{'type':Sequelize[_0xd382('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xd382('0x3')},'tag':{'type':Sequelize[_0xd382('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd382('0x4')},'appdata':{'type':Sequelize[_0xd382('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd382('0x5')](_0xd382('0x6'),_0xd382('0x7'),_0xd382('0x8'),_0xd382('0x9'),'outbound-fax',_0xd382('0xa'),_0xd382('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xd382('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd382('0xc')},'IntervalId':{'type':Sequelize[_0xd382('0xd')]},'isApp':{'type':Sequelize[_0xd382('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd382('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd382('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd382('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd382('0xd')]},'recordingFormat':{'type':Sequelize[_0xd382('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd382('0xf')],'get':function(_0x295bd1){return this[_0xd382('0x10')](_0xd382('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d9a1245..24c9b1d 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 _0x800f=['register','sendStatus','status','limit','undefined','count','offset','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','rows','catch','params','keys','length','includeAll','options','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','send','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0x800f,0x16e));var _0xf800=function(_0x4cb22f,_0x4f60a1){_0x4cb22f=_0x4cb22f-0x0;var _0x51f6cb=_0x800f[_0x4cb22f];return _0x51f6cb;};'use strict';var _=require(_0xf800('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf800('0x1'))(_0xf800('0x2'));var config=require(_0xf800('0x3'));var db=require(_0xf800('0x4'))['db'];config[_0xf800('0x5')]=_[_0xf800('0x6')](config['redis'],{'host':_0xf800('0x7'),'port':0x18eb});var socket=require(_0xf800('0x8'))(new Redis(config[_0xf800('0x5')]));require(_0xf800('0x9'))[_0xf800('0xa')](socket);function respondWithStatusCode(_0x1ade4c,_0x4c1e68){_0x4c1e68=_0x4c1e68||0xcc;return function(_0x109947){if(_0x109947){return _0x1ade4c[_0xf800('0xb')](_0x4c1e68);}return _0x1ade4c[_0xf800('0xc')](_0x4c1e68)['end']();};}function respondWithResult(_0x1f9083,_0x3802e0){_0x3802e0=_0x3802e0||0xc8;return function(_0x18f0b6){if(_0x18f0b6){return _0x1f9083[_0xf800('0xc')](_0x3802e0)['json'](_0x18f0b6);}};}function respondWithFilteredResult(_0x15bbdb,_0x414dfa){return function(_0x2335c8){if(_0x2335c8){var _0xc238ea=typeof _0x414dfa['offset']==='undefined'&&typeof _0x414dfa[_0xf800('0xd')]===_0xf800('0xe');var _0x15081d=_0x2335c8[_0xf800('0xf')];var _0x1653e2=_0xc238ea?0x0:_0x414dfa[_0xf800('0x10')];var _0x4ef375=_0xc238ea?_0x2335c8[_0xf800('0xf')]:_0x414dfa[_0xf800('0x10')]+_0x414dfa['limit'];var _0x4d4b46;if(_0x4ef375>=_0x15081d){_0x4ef375=_0x15081d;_0x4d4b46=0xc8;}else{_0x4d4b46=0xce;}_0x15bbdb['status'](_0x4d4b46);return _0x15bbdb['set']('Content-Range',_0x1653e2+'-'+_0x4ef375+'/'+_0x15081d)[_0xf800('0x11')](_0x2335c8);}return null;};}function removeEntity(_0x4b64c5){return function(_0x53c2da){if(_0x53c2da){return _0x53c2da[_0xf800('0x12')]()[_0xf800('0x13')](function(){var _0x47df06=_0x53c2da[_0xf800('0x14')]({'plain':!![]});var _0x176ba6=[{'name':_0xf800('0x15'),'value':_0xf800('0x16'),'ignore':![]},{'name':_0xf800('0x17'),'value':_0xf800('0x18'),'ignore':![]},{'name':_0xf800('0x19'),'value':_0xf800('0x1a'),'ignore':![]}];var _0x37e159=_(_0x176ba6)[_0xf800('0x1b')](_0xf800('0x1c'))[_0xf800('0x1d')](_0xf800('0x1e'))[_0xf800('0x1e')]();if(_[_0xf800('0x1f')](_0x37e159,_0x47df06[_0xf800('0x20')])){return;}var _0x6a8668=_[_0xf800('0x21')](_0x176ba6,['value',_0x47df06['type']])[_0xf800('0x22')];return db[_0xf800('0x23')][_0xf800('0x12')]({'where':{'type':_0x6a8668,'resourceId':_0x47df06['id']}})[_0xf800('0x13')](function(){return _0x53c2da;});})[_0xf800('0x13')](function(){_0x4b64c5['status'](0xcc)[_0xf800('0x24')]();});}};}function handleEntityNotFound(_0x4c3f33){return function(_0x312fce){if(!_0x312fce){_0x4c3f33[_0xf800('0xb')](0x194);}return _0x312fce;};}function handleError(_0x15fd38,_0x7cb41e){_0x7cb41e=_0x7cb41e||0x1f4;return function(_0x297df4){logger[_0xf800('0x25')](_0x297df4['stack']);if(_0x297df4[_0xf800('0x22')]){delete _0x297df4[_0xf800('0x22')];}_0x15fd38[_0xf800('0xc')](_0x7cb41e)['send'](_0x297df4);};}exports['index']=function(_0x149f4c,_0x21abac){var _0x1a84b2={},_0x2e9797={},_0x31b92a={'count':0x0,'rows':[]};var _0x342eaa=_[_0xf800('0x1d')](db[_0xf800('0x26')][_0xf800('0x27')],function(_0x23928b){return{'name':_0x23928b[_0xf800('0x28')],'type':_0x23928b[_0xf800('0x20')][_0xf800('0x29')]};});_0x2e9797[_0xf800('0x2a')]=_[_0xf800('0x1d')](_0x342eaa,_0xf800('0x22'));_0x2e9797['query']=_['keys'](_0x149f4c[_0xf800('0x2b')]);_0x2e9797[_0xf800('0x2c')]=_[_0xf800('0x2d')](_0x2e9797[_0xf800('0x2a')],_0x2e9797[_0xf800('0x2b')]);_0x1a84b2[_0xf800('0x2e')]=_[_0xf800('0x2d')](_0x2e9797['model'],qs[_0xf800('0x2f')](_0x149f4c['query'][_0xf800('0x2f')]));_0x1a84b2[_0xf800('0x2e')]=_0x1a84b2['attributes']['length']?_0x1a84b2['attributes']:_0x2e9797[_0xf800('0x2a')];if(!_0x149f4c[_0xf800('0x2b')]['hasOwnProperty'](_0xf800('0x30'))){_0x1a84b2[_0xf800('0xd')]=qs[_0xf800('0xd')](_0x149f4c[_0xf800('0x2b')]['limit']);_0x1a84b2[_0xf800('0x10')]=qs[_0xf800('0x10')](_0x149f4c[_0xf800('0x2b')][_0xf800('0x10')]);}_0x1a84b2[_0xf800('0x31')]=qs[_0xf800('0x32')](_0x149f4c[_0xf800('0x2b')][_0xf800('0x32')]);_0x1a84b2[_0xf800('0x33')]=qs[_0xf800('0x2c')](_['pick'](_0x149f4c[_0xf800('0x2b')],_0x2e9797[_0xf800('0x2c')]),_0x342eaa);if(_0x149f4c[_0xf800('0x2b')][_0xf800('0x1b')]){_0x1a84b2[_0xf800('0x33')]=_[_0xf800('0x34')](_0x1a84b2['where'],{'$or':_[_0xf800('0x1d')](_0x342eaa,function(_0x4f1fde){if(_0x4f1fde['type']!==_0xf800('0x35')){var _0x4b19bf={};_0x4b19bf[_0x4f1fde[_0xf800('0x22')]]={'$like':'%'+_0x149f4c[_0xf800('0x2b')][_0xf800('0x1b')]+'%'};return _0x4b19bf;}})});}_0x1a84b2=_[_0xf800('0x34')]({},_0x1a84b2,_0x149f4c['options']);var _0x1cc65e={'where':_0x1a84b2[_0xf800('0x33')]};return db[_0xf800('0x26')][_0xf800('0xf')](_0x1cc65e)[_0xf800('0x13')](function(_0x3c3f90){_0x31b92a[_0xf800('0xf')]=_0x3c3f90;if(_0x149f4c['query']['includeAll']){_0x1a84b2[_0xf800('0x36')]=[{'all':!![]}];}return db[_0xf800('0x26')][_0xf800('0x37')](_0x1a84b2);})[_0xf800('0x13')](function(_0x58ea58){_0x31b92a[_0xf800('0x38')]=_0x58ea58;return _0x31b92a;})[_0xf800('0x13')](respondWithFilteredResult(_0x21abac,_0x1a84b2))[_0xf800('0x39')](handleError(_0x21abac,null));};exports['show']=function(_0xb58489,_0xf1f294){var _0x492828={'raw':![],'where':{'id':_0xb58489[_0xf800('0x3a')]['id']}},_0x2b158e={};_0x2b158e[_0xf800('0x2a')]=_[_0xf800('0x3b')](db[_0xf800('0x26')][_0xf800('0x27')]);_0x2b158e[_0xf800('0x2b')]=_[_0xf800('0x3b')](_0xb58489[_0xf800('0x2b')]);_0x2b158e[_0xf800('0x2c')]=_[_0xf800('0x2d')](_0x2b158e[_0xf800('0x2a')],_0x2b158e[_0xf800('0x2b')]);_0x492828[_0xf800('0x2e')]=_[_0xf800('0x2d')](_0x2b158e[_0xf800('0x2a')],qs[_0xf800('0x2f')](_0xb58489[_0xf800('0x2b')][_0xf800('0x2f')]));_0x492828['attributes']=_0x492828[_0xf800('0x2e')][_0xf800('0x3c')]?_0x492828['attributes']:_0x2b158e[_0xf800('0x2a')];if(_0xb58489['query'][_0xf800('0x3d')]){_0x492828[_0xf800('0x36')]=[{'all':!![]}];}_0x492828=_[_0xf800('0x34')]({},_0x492828,_0xb58489[_0xf800('0x3e')]);return db[_0xf800('0x26')][_0xf800('0x21')](_0x492828)['then'](handleEntityNotFound(_0xf1f294,null))['then'](respondWithResult(_0xf1f294,null))[_0xf800('0x39')](handleError(_0xf1f294,null));};exports[_0xf800('0x12')]=function(_0x2a1d85,_0x32cde0){return db['VoiceExtension'][_0xf800('0x21')]({'where':{'id':_0x2a1d85[_0xf800('0x3a')]['id']}})['then'](handleEntityNotFound(_0x32cde0,null))['then'](removeEntity(_0x32cde0,null))[_0xf800('0x39')](handleError(_0x32cde0,null));};exports['create']=function(_0x4ab6fe,_0x183d0c){if(_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x20')]===_0xf800('0x18')&&!_['startsWith'](_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')],'_')){_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')]='_'[_0xf800('0x41')](_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')]);}return db[_0xf800('0x26')][_0xf800('0x42')](_0x4ab6fe['body'],{'raw':![]})[_0xf800('0x13')](function(_0x3f8b47){var _0x299df2=_0x4ab6fe[_0xf800('0x43')]['get']({'plain':!![]});if(!_0x299df2)throw new Error(_0xf800('0x44'));if(_0x299df2[_0xf800('0x45')]===_0xf800('0x43')){var _0x2b6866=_0x3f8b47[_0xf800('0x14')]({'plain':!![]});var _0x188042=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xf800('0x19'),'value':_0xf800('0x1a')}];var _0x2b6411=_[_0xf800('0x21')](_0x188042,[_0xf800('0x1e'),_0x2b6866[_0xf800('0x20')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x2b6411,'userProfileId':_0x299df2[_0xf800('0x46')]},'raw':!![]})[_0xf800('0x13')](function(_0x413cf1){if(_0x413cf1&&_0x413cf1[_0xf800('0x47')]===0x0){return db[_0xf800('0x23')][_0xf800('0x42')]({'name':_0x2b6866[_0xf800('0x22')],'resourceId':_0x2b6866['id'],'type':_0x413cf1[_0xf800('0x22')],'sectionId':_0x413cf1['id']},{})[_0xf800('0x13')](function(){return _0x3f8b47;});}else{return _0x3f8b47;}})[_0xf800('0x39')](function(_0x1144f9){logger[_0xf800('0x25')](_0xf800('0x48'),_0x1144f9);throw _0x1144f9;});}return _0x3f8b47;})[_0xf800('0x13')](respondWithResult(_0x183d0c,0xc9))[_0xf800('0x39')](handleError(_0x183d0c,null));};exports['update']=function(_0x5187b0,_0x249bb8){if(_0x5187b0['body']['id']){delete _0x5187b0[_0xf800('0x3f')]['id'];}return db[_0xf800('0x26')][_0xf800('0x21')]({'where':{'id':_0x5187b0[_0xf800('0x3a')]['id']}})[_0xf800('0x13')](handleEntityNotFound(_0x249bb8,null))[_0xf800('0x13')](function(_0x3677c6){if(_0x3677c6){return db['VoiceExtension'][_0xf800('0x49')](_['pick'](_0x5187b0[_0xf800('0x3f')],['exten',_0xf800('0x4a'),_0xf800('0x4b'),_0xf800('0x4c'),_0xf800('0x4d'),_0xf800('0x4e'),_0xf800('0x4f')]),{'where':{'context':_0x3677c6[_0xf800('0x4a')],'exten':_0x3677c6['exten']},'individualHooks':!![]})[_0xf800('0x13')](function(_0x3f16ef){return _0x3f16ef;});}return null;})[_0xf800('0x13')](respondWithStatusCode(_0x249bb8,null))[_0xf800('0x39')](handleError(_0x249bb8,null));};exports[_0xf800('0x50')]=function(_0x5ed0ff,_0x1bc9ad){var _0x5a25cd=_0x5ed0ff[_0xf800('0x3a')]['id'];var _0x32c387=_0x5ed0ff[_0xf800('0x3f')];var _0x1c7eca=0xc8;var _0x10bb56=null;return db['sequelize'][_0xf800('0x51')]({'isolationLevel':db[_0xf800('0x52')]['Transaction']['ISOLATION_LEVELS'][_0xf800('0x53')]},function(_0x4da655){return db['VoiceExtension'][_0xf800('0x54')]({'where':{'id':_0x5a25cd},'transaction':_0x4da655})[_0xf800('0x13')](function(_0x530bd2){if(_0x530bd2){return db[_0xf800('0x26')][_0xf800('0x12')]({'where':{'VoiceExtensionId':_0x5a25cd},'transaction':_0x4da655})[_0xf800('0x13')](function(){var _0x44038c=_[_0xf800('0x1d')](_0x32c387,function(_0x25db6f){_0x25db6f[_0xf800('0x55')]=_0x5a25cd;_0x25db6f[_0xf800('0x56')]=!![];return _0x25db6f;});return _0x530bd2[_0xf800('0x57')](_0x44038c);})[_0xf800('0x13')](function(_0x35da94){return db['VoiceExtension'][_0xf800('0x58')](_0x35da94,{'transaction':_0x4da655});});}else{_0x1c7eca=0x194;_0x10bb56=[];}});})['then'](function(){if(_0x1c7eca!==0x194){return db[_0xf800('0x26')][_0xf800('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5a25cd},'order':_0xf800('0x5a')})[_0xf800('0x13')](function(_0x10b3f4){_0x10bb56=_0x10b3f4;});}})[_0xf800('0x39')](function(_0x4b0daa){_0x1c7eca=0x1f4;logger[_0xf800('0x25')](_0x4b0daa[_0xf800('0x5b')]);if(_0x4b0daa[_0xf800('0x22')]){delete _0x4b0daa['name'];}_0x10bb56=_0x4b0daa;})[_0xf800('0x5c')](function(){if(_0x10bb56===null){_0x1bc9ad[_0xf800('0xb')](_0x1c7eca);}else{if(_0x1c7eca===0x1f4){_0x1bc9ad[_0xf800('0xc')](_0x1c7eca)[_0xf800('0x5d')](_0x10bb56);}else{_0x1bc9ad[_0xf800('0xc')](_0x1c7eca)[_0xf800('0x11')](_0x10bb56);}}});}; \ No newline at end of file +var _0x0b59=['pick','filter','VIRTUAL','merge','options','rows','show','params','includeAll','include','catch','create','body','exten','concat','role','inbound','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','count','offset','set','get','InboundRoutes','outbound','InternalRoutes','internal','ignore','value','includes','type','name','destroy','then','error','stack','send','index','map','VoiceExtension','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','where'];(function(_0x17b0db,_0x4ad022){var _0x43ade3=function(_0x18b216){while(--_0x18b216){_0x17b0db['push'](_0x17b0db['shift']());}};_0x43ade3(++_0x4ad022);}(_0x0b59,0xdd));var _0x90b5=function(_0x1df0f6,_0x40e364){_0x1df0f6=_0x1df0f6-0x0;var _0x30e439=_0x0b59[_0x1df0f6];return _0x30e439;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x90b5('0x0'));var logger=require(_0x90b5('0x1'))('api');var config=require(_0x90b5('0x2'));var db=require('../../mysqldb')['db'];config[_0x90b5('0x3')]=_[_0x90b5('0x4')](config[_0x90b5('0x3')],{'host':_0x90b5('0x5'),'port':0x18eb});var socket=require(_0x90b5('0x6'))(new Redis(config[_0x90b5('0x3')]));require(_0x90b5('0x7'))[_0x90b5('0x8')](socket);function respondWithStatusCode(_0x5b1fd5,_0x56e3e7){_0x56e3e7=_0x56e3e7||0xcc;return function(_0x1613c4){if(_0x1613c4){return _0x5b1fd5[_0x90b5('0x9')](_0x56e3e7);}return _0x5b1fd5[_0x90b5('0xa')](_0x56e3e7)[_0x90b5('0xb')]();};}function respondWithResult(_0x2102a6,_0x1bcfa3){_0x1bcfa3=_0x1bcfa3||0xc8;return function(_0x1eaf02){if(_0x1eaf02){return _0x2102a6[_0x90b5('0xa')](_0x1bcfa3)[_0x90b5('0xc')](_0x1eaf02);}};}function respondWithFilteredResult(_0x4c5fb3,_0x4563c9){return function(_0x404447){if(_0x404447){var _0x8ee381=typeof _0x4563c9['offset']===_0x90b5('0xd')&&typeof _0x4563c9['limit']==='undefined';var _0x2582cd=_0x404447[_0x90b5('0xe')];var _0x57275e=_0x8ee381?0x0:_0x4563c9[_0x90b5('0xf')];var _0x584bf8=_0x8ee381?_0x404447[_0x90b5('0xe')]:_0x4563c9[_0x90b5('0xf')]+_0x4563c9['limit'];var _0x4ee791;if(_0x584bf8>=_0x2582cd){_0x584bf8=_0x2582cd;_0x4ee791=0xc8;}else{_0x4ee791=0xce;}_0x4c5fb3['status'](_0x4ee791);return _0x4c5fb3[_0x90b5('0x10')]('Content-Range',_0x57275e+'-'+_0x584bf8+'/'+_0x2582cd)[_0x90b5('0xc')](_0x404447);}return null;};}function removeEntity(_0x56a63a){return function(_0xb79845){if(_0xb79845){return _0xb79845['destroy']()['then'](function(){var _0x495fec=_0xb79845[_0x90b5('0x11')]({'plain':!![]});var _0x516710=[{'name':_0x90b5('0x12'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x90b5('0x13'),'ignore':![]},{'name':_0x90b5('0x14'),'value':_0x90b5('0x15'),'ignore':![]}];var _0x588b33=_(_0x516710)['filter'](_0x90b5('0x16'))['map'](_0x90b5('0x17'))['value']();if(_[_0x90b5('0x18')](_0x588b33,_0x495fec[_0x90b5('0x19')])){return;}var _0x11832d=_['find'](_0x516710,['value',_0x495fec[_0x90b5('0x19')]])[_0x90b5('0x1a')];return db['UserProfileResource'][_0x90b5('0x1b')]({'where':{'type':_0x11832d,'resourceId':_0x495fec['id']}})[_0x90b5('0x1c')](function(){return _0xb79845;});})[_0x90b5('0x1c')](function(){_0x56a63a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e932){return function(_0x13563e){if(!_0x13563e){_0x21e932['sendStatus'](0x194);}return _0x13563e;};}function handleError(_0x2245b2,_0x28be4d){_0x28be4d=_0x28be4d||0x1f4;return function(_0x5022d8){logger[_0x90b5('0x1d')](_0x5022d8[_0x90b5('0x1e')]);if(_0x5022d8['name']){delete _0x5022d8['name'];}_0x2245b2[_0x90b5('0xa')](_0x28be4d)[_0x90b5('0x1f')](_0x5022d8);};}exports[_0x90b5('0x20')]=function(_0x468b0d,_0x9fb05d){var _0x2ff0b8={},_0x4aec8f={},_0x1e97b6={'count':0x0,'rows':[]};var _0x52487d=_[_0x90b5('0x21')](db[_0x90b5('0x22')][_0x90b5('0x23')],function(_0x4b802b){return{'name':_0x4b802b['fieldName'],'type':_0x4b802b[_0x90b5('0x19')]['key']};});_0x4aec8f['model']=_['map'](_0x52487d,_0x90b5('0x1a'));_0x4aec8f[_0x90b5('0x24')]=_[_0x90b5('0x25')](_0x468b0d[_0x90b5('0x24')]);_0x4aec8f[_0x90b5('0x26')]=_[_0x90b5('0x27')](_0x4aec8f['model'],_0x4aec8f['query']);_0x2ff0b8[_0x90b5('0x28')]=_[_0x90b5('0x27')](_0x4aec8f[_0x90b5('0x29')],qs[_0x90b5('0x2a')](_0x468b0d['query'][_0x90b5('0x2a')]));_0x2ff0b8[_0x90b5('0x28')]=_0x2ff0b8[_0x90b5('0x28')][_0x90b5('0x2b')]?_0x2ff0b8[_0x90b5('0x28')]:_0x4aec8f['model'];if(!_0x468b0d[_0x90b5('0x24')][_0x90b5('0x2c')](_0x90b5('0x2d'))){_0x2ff0b8['limit']=qs[_0x90b5('0x2e')](_0x468b0d[_0x90b5('0x24')]['limit']);_0x2ff0b8[_0x90b5('0xf')]=qs[_0x90b5('0xf')](_0x468b0d[_0x90b5('0x24')][_0x90b5('0xf')]);}_0x2ff0b8[_0x90b5('0x2f')]=qs['sort'](_0x468b0d[_0x90b5('0x24')]['sort']);_0x2ff0b8[_0x90b5('0x30')]=qs['filters'](_[_0x90b5('0x31')](_0x468b0d['query'],_0x4aec8f[_0x90b5('0x26')]),_0x52487d);if(_0x468b0d[_0x90b5('0x24')][_0x90b5('0x32')]){_0x2ff0b8['where']=_['merge'](_0x2ff0b8[_0x90b5('0x30')],{'$or':_[_0x90b5('0x21')](_0x52487d,function(_0x529c82){if(_0x529c82[_0x90b5('0x19')]!==_0x90b5('0x33')){var _0x387383={};_0x387383[_0x529c82['name']]={'$like':'%'+_0x468b0d[_0x90b5('0x24')][_0x90b5('0x32')]+'%'};return _0x387383;}})});}_0x2ff0b8=_[_0x90b5('0x34')]({},_0x2ff0b8,_0x468b0d[_0x90b5('0x35')]);var _0x17c498={'where':_0x2ff0b8[_0x90b5('0x30')]};return db[_0x90b5('0x22')][_0x90b5('0xe')](_0x17c498)[_0x90b5('0x1c')](function(_0xdd5ae9){_0x1e97b6[_0x90b5('0xe')]=_0xdd5ae9;if(_0x468b0d['query']['includeAll']){_0x2ff0b8['include']=[{'all':!![]}];}return db[_0x90b5('0x22')]['findAll'](_0x2ff0b8);})[_0x90b5('0x1c')](function(_0x108eec){_0x1e97b6[_0x90b5('0x36')]=_0x108eec;return _0x1e97b6;})['then'](respondWithFilteredResult(_0x9fb05d,_0x2ff0b8))['catch'](handleError(_0x9fb05d,null));};exports[_0x90b5('0x37')]=function(_0x39ec32,_0x4ee5ba){var _0x4f2932={'raw':![],'where':{'id':_0x39ec32[_0x90b5('0x38')]['id']}},_0x38b06c={};_0x38b06c[_0x90b5('0x29')]=_['keys'](db[_0x90b5('0x22')][_0x90b5('0x23')]);_0x38b06c[_0x90b5('0x24')]=_['keys'](_0x39ec32[_0x90b5('0x24')]);_0x38b06c[_0x90b5('0x26')]=_[_0x90b5('0x27')](_0x38b06c['model'],_0x38b06c[_0x90b5('0x24')]);_0x4f2932['attributes']=_[_0x90b5('0x27')](_0x38b06c[_0x90b5('0x29')],qs[_0x90b5('0x2a')](_0x39ec32['query']['fields']));_0x4f2932[_0x90b5('0x28')]=_0x4f2932[_0x90b5('0x28')]['length']?_0x4f2932[_0x90b5('0x28')]:_0x38b06c[_0x90b5('0x29')];if(_0x39ec32[_0x90b5('0x24')][_0x90b5('0x39')]){_0x4f2932[_0x90b5('0x3a')]=[{'all':!![]}];}_0x4f2932=_[_0x90b5('0x34')]({},_0x4f2932,_0x39ec32[_0x90b5('0x35')]);return db['VoiceExtension']['find'](_0x4f2932)[_0x90b5('0x1c')](handleEntityNotFound(_0x4ee5ba,null))[_0x90b5('0x1c')](respondWithResult(_0x4ee5ba,null))[_0x90b5('0x3b')](handleError(_0x4ee5ba,null));};exports['destroy']=function(_0x23ea35,_0x32c44e){return db['VoiceExtension']['find']({'where':{'id':_0x23ea35['params']['id']}})[_0x90b5('0x1c')](handleEntityNotFound(_0x32c44e,null))[_0x90b5('0x1c')](removeEntity(_0x32c44e,null))[_0x90b5('0x3b')](handleError(_0x32c44e,null));};exports[_0x90b5('0x3c')]=function(_0x1351b3,_0x5b4c1){if(_0x1351b3['body'][_0x90b5('0x19')]===_0x90b5('0x13')&&!_['startsWith'](_0x1351b3[_0x90b5('0x3d')][_0x90b5('0x3e')],'_')){_0x1351b3[_0x90b5('0x3d')][_0x90b5('0x3e')]='_'[_0x90b5('0x3f')](_0x1351b3[_0x90b5('0x3d')][_0x90b5('0x3e')]);}return db[_0x90b5('0x22')]['create'](_0x1351b3['body'],{'raw':![]})['then'](function(_0x38cb4a){var _0x4186b9=_0x1351b3['user'][_0x90b5('0x11')]({'plain':!![]});if(!_0x4186b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4186b9[_0x90b5('0x40')]==='user'){var _0x21a7f2=_0x38cb4a['get']({'plain':!![]});var _0x5f36d9=[{'name':_0x90b5('0x12'),'value':_0x90b5('0x41')},{'name':'OutboundRoutes','value':_0x90b5('0x13')},{'name':_0x90b5('0x14'),'value':_0x90b5('0x15')}];var _0x5be5bd=_['find'](_0x5f36d9,[_0x90b5('0x17'),_0x21a7f2[_0x90b5('0x19')]])[_0x90b5('0x1a')];return db[_0x90b5('0x42')][_0x90b5('0x43')]({'where':{'name':_0x5be5bd,'userProfileId':_0x4186b9[_0x90b5('0x44')]},'raw':!![]})[_0x90b5('0x1c')](function(_0x9f8d5e){if(_0x9f8d5e&&_0x9f8d5e[_0x90b5('0x45')]===0x0){return db[_0x90b5('0x46')][_0x90b5('0x3c')]({'name':_0x21a7f2[_0x90b5('0x1a')],'resourceId':_0x21a7f2['id'],'type':_0x9f8d5e['name'],'sectionId':_0x9f8d5e['id']},{})[_0x90b5('0x1c')](function(){return _0x38cb4a;});}else{return _0x38cb4a;}})[_0x90b5('0x3b')](function(_0x1f6ae3){logger['error'](_0x90b5('0x47'),_0x1f6ae3);throw _0x1f6ae3;});}return _0x38cb4a;})['then'](respondWithResult(_0x5b4c1,0xc9))[_0x90b5('0x3b')](handleError(_0x5b4c1,null));};exports[_0x90b5('0x48')]=function(_0x489d24,_0x1d5b24){if(_0x489d24[_0x90b5('0x3d')]['id']){delete _0x489d24['body']['id'];}return db[_0x90b5('0x22')]['find']({'where':{'id':_0x489d24[_0x90b5('0x38')]['id']}})[_0x90b5('0x1c')](handleEntityNotFound(_0x1d5b24,null))['then'](function(_0x18f415){if(_0x18f415){return db['VoiceExtension'][_0x90b5('0x48')](_[_0x90b5('0x31')](_0x489d24[_0x90b5('0x3d')],['exten','context',_0x90b5('0x49'),_0x90b5('0x4a'),_0x90b5('0x4b'),_0x90b5('0x4c'),_0x90b5('0x4d')]),{'where':{'context':_0x18f415['context'],'exten':_0x18f415[_0x90b5('0x3e')]},'individualHooks':!![]})[_0x90b5('0x1c')](function(_0x147f48){return _0x147f48;});}return null;})[_0x90b5('0x1c')](respondWithStatusCode(_0x1d5b24,null))[_0x90b5('0x3b')](handleError(_0x1d5b24,null));};exports[_0x90b5('0x4e')]=function(_0x58f700,_0x120d0d){var _0x1b5ac0=_0x58f700[_0x90b5('0x38')]['id'];var _0x448d62=_0x58f700[_0x90b5('0x3d')];var _0x1d8148=0xc8;var _0x18ddf9=null;return db[_0x90b5('0x4f')][_0x90b5('0x50')]({'isolationLevel':db[_0x90b5('0x4f')]['Transaction'][_0x90b5('0x51')][_0x90b5('0x52')]},function(_0x17f9ff){return db[_0x90b5('0x22')][_0x90b5('0x53')]({'where':{'id':_0x1b5ac0},'transaction':_0x17f9ff})[_0x90b5('0x1c')](function(_0x5d9cae){if(_0x5d9cae){return db[_0x90b5('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x1b5ac0},'transaction':_0x17f9ff})[_0x90b5('0x1c')](function(){var _0x178ee5=_[_0x90b5('0x21')](_0x448d62,function(_0x1608c7){_0x1608c7[_0x90b5('0x54')]=_0x1b5ac0;_0x1608c7[_0x90b5('0x55')]=!![];return _0x1608c7;});return _0x5d9cae['createRouting'](_0x178ee5);})[_0x90b5('0x1c')](function(_0x389593){return db[_0x90b5('0x22')][_0x90b5('0x56')](_0x389593,{'transaction':_0x17f9ff});});}else{_0x1d8148=0x194;_0x18ddf9=[];}});})[_0x90b5('0x1c')](function(){if(_0x1d8148!==0x194){return db[_0x90b5('0x22')][_0x90b5('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b5ac0},'order':_0x90b5('0x58')})[_0x90b5('0x1c')](function(_0x45a46f){_0x18ddf9=_0x45a46f;});}})['catch'](function(_0x3022a3){_0x1d8148=0x1f4;logger['error'](_0x3022a3[_0x90b5('0x1e')]);if(_0x3022a3[_0x90b5('0x1a')]){delete _0x3022a3[_0x90b5('0x1a')];}_0x18ddf9=_0x3022a3;})[_0x90b5('0x59')](function(){if(_0x18ddf9===null){_0x120d0d[_0x90b5('0x9')](_0x1d8148);}else{if(_0x1d8148===0x1f4){_0x120d0d[_0x90b5('0xa')](_0x1d8148)['send'](_0x18ddf9);}else{_0x120d0d[_0x90b5('0xa')](_0x1d8148)[_0x90b5('0xc')](_0x18ddf9);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cdf8f80..2535930 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 _0x602c=['remove','emit','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update'];(function(_0x13fc71,_0x230bd3){var _0x525f1e=function(_0x3d1ff3){while(--_0x3d1ff3){_0x13fc71['push'](_0x13fc71['shift']());}};_0x525f1e(++_0x230bd3);}(_0x602c,0x148));var _0xc602=function(_0x30399c,_0x57b2aa){_0x30399c=_0x30399c-0x0;var _0x4a0491=_0x602c[_0x30399c];return _0x4a0491;};'use strict';var EventEmitter=require(_0xc602('0x0'));var VoiceExtension=require(_0xc602('0x1'))['db'][_0xc602('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc602('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc602('0x4'),'afterDestroy':_0xc602('0x5')};function emitEvent(_0x3e108c){return function(_0x3150ff,_0x4d6b09,_0x5c6fda){VoiceExtensionEvents[_0xc602('0x6')](_0x3e108c+':'+_0x3150ff['id'],_0x3150ff);VoiceExtensionEvents[_0xc602('0x6')](_0x3e108c,_0x3150ff);_0x5c6fda(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xc602('0x7')](e,emitEvent(event));}}module[_0xc602('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x7ed7=['hasOwnProperty','exports','../../mysqldb','VoiceExtension','setMaxListeners','update'];(function(_0x355141,_0x4ce3bd){var _0x328382=function(_0x44e03c){while(--_0x44e03c){_0x355141['push'](_0x355141['shift']());}};_0x328382(++_0x4ce3bd);}(_0x7ed7,0x116));var _0x77ed=function(_0x1e376d,_0x2d317d){_0x1e376d=_0x1e376d-0x0;var _0x3e2488=_0x7ed7[_0x1e376d];return _0x3e2488;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x77ed('0x0'))['db'][_0x77ed('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x77ed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77ed('0x3'),'afterDestroy':'remove'};function emitEvent(_0x39ddbf){return function(_0x4d124e,_0x39d0f6,_0x4f0273){VoiceExtensionEvents['emit'](_0x39ddbf+':'+_0x4d124e['id'],_0x4d124e);VoiceExtensionEvents['emit'](_0x39ddbf,_0x4d124e);_0x4f0273(null);};}for(var e in events){if(events[_0x77ed('0x4')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x77ed('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f82512e..aff5ccf 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 _0xc4f5=['priority','concat','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','length','trunk','param','split','phone','prefix','SIP','join','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','last'];(function(_0x4ae5d1,_0x29bc8a){var _0x15b583=function(_0x2429c5){while(--_0x2429c5){_0x4ae5d1['push'](_0x4ae5d1['shift']());}};_0x15b583(++_0x29bc8a);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x26dc96,_0x10c6f5){_0x26dc96=_0x26dc96-0x0;var _0x30b7be=_0xc4f5[_0x26dc96];return _0x30b7be;};'use strict';var _=require('lodash');var attributes=require(_0x5c4f('0x0'));module[_0x5c4f('0x1')]=function(_0x37e15c){var _0x515f4c=_0x37e15c[_0x5c4f('0x2')];function _0x221555(_0x24c5b6){var _0xfd69b2=0x2;var _0x2676f7=[{'type':_0x24c5b6['type'],'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x4')+_0x24c5b6[_0x5c4f('0x5')],'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6['type'],'app':_0x24c5b6[_0x5c4f('0x8')]?'Set':_0x5c4f('0x9'),'appdata':_0x24c5b6['alias']?_0x5c4f('0xa')+_0x24c5b6[_0x5c4f('0x8')]:_0x5c4f('0xb'),'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']}];if(_0x24c5b6[_0x5c4f('0x5')]===_0x5c4f('0xc')){_0x2676f7['push']({'type':_0x5c4f('0xc'),'app':_0x5c4f('0x3'),'appdata':'CDR(routeid)='+_0x24c5b6['id'],'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']});}_0x2676f7[_0x5c4f('0xd')]({'type':_0x24c5b6[_0x5c4f('0x5')],'app':_0x5c4f('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x24c5b6['context'],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6[_0x5c4f('0x5')],'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0xe'),'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6['exten'],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6['type'],'app':_0x5c4f('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x24c5b6['context'],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']});return _0x2676f7;}function _0x5154eb(_0x3824b0){var _0x2cff0f=0x2;var _0x2360da=[{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x10'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x3824b0['alias']?_0x5c4f('0x3'):_0x5c4f('0x9'),'appdata':_0x3824b0[_0x5c4f('0x8')]?_0x5c4f('0xa')+_0x3824b0['alias']:'No\x20alias\x20set','context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x11')+(_0x3824b0[_0x5c4f('0x12')]?_0x5c4f('0x13')+_0x3824b0[_0x5c4f('0x12')]+'}':'${EXTEN}'),'context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x14')+_0x3824b0['id'],'context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x16')+(_0x2cff0f+0x2)+_0x5c4f('0x17')+(_0x2cff0f+0x1)+')','context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x3824b0[_0x5c4f('0x12')]?_0x5c4f('0x18')+_0x3824b0[_0x5c4f('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3824b0['context'],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0xe'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x19'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1a')+_0x3824b0['id'],'context':_0x3824b0['context'],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']}];if(_0x3824b0[_0x5c4f('0x1b')]('recordingFormat')&&_0x3824b0[_0x5c4f('0x1c')]!==_0x5c4f('0x1d')){_0x2360da[_0x5c4f('0xd')]({'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1e'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1f')+_0x3824b0['recordingFormat']||'wav','context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']});}return _0x2360da;}function _0x1ffc6e(_0x46b020,_0x1025e2){var _0x447b4f=[{'name':'trunk','param':0x0},{'name':_0x5c4f('0x20'),'param':0x1},{'name':_0x5c4f('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x3b65c7={};var _0x9a12cb=_0x1025e2['split'](',');var _0x5c7281=[];for(var _0x130f17=0x0;_0x130f17<_0x447b4f[_0x5c4f('0x22')];_0x130f17++){switch(_0x447b4f[_0x130f17]['name']){case _0x5c4f('0x23'):_0x3b65c7[_0x5c4f('0x23')]=_0x9a12cb[_0x447b4f[_0x130f17][_0x5c4f('0x24')]][_0x5c4f('0x25')]('/')[0x1];_0x3b65c7[_0x5c4f('0x26')]=_0x9a12cb[_0x447b4f[_0x130f17]['param']][_0x5c4f('0x25')]('/')[0x2];_0x3b65c7['prefix']=_0x3b65c7[_0x5c4f('0x26')]?_0x3b65c7[_0x5c4f('0x26')][_0x5c4f('0x25')]('$')[0x0]:undefined;_0x3b65c7[_0x5c4f('0x26')]=_0x46b020[_0x5c4f('0x12')]?(_0x3b65c7[_0x5c4f('0x27')]||'')+_0x5c4f('0x13')+_0x46b020[_0x5c4f('0x12')]+'}':(_0x3b65c7[_0x5c4f('0x27')]||'')+'${EXTEN}';_0x5c7281[_0x447b4f[_0x130f17]['param']]=[_0x5c4f('0x28'),_0x3b65c7[_0x5c4f('0x23')],_0x3b65c7['phone']][_0x5c4f('0x29')]('/');break;case _0x5c4f('0x21'):_0x3b65c7[_0x5c4f('0x21')]=_0x9a12cb[_0x447b4f[_0x130f17][_0x5c4f('0x24')]];if(_0x46b020[_0x5c4f('0x1c')]!==_0x5c4f('0x1d')){if(_0x3b65c7['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3b65c7[_0x5c4f('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x3b65c7[_0x5c4f('0x21')]=_0x3b65c7[_0x5c4f('0x21')][_0x5c4f('0x2a')](_0x5c4f('0x2b'),'');}_0x5c7281[_0x447b4f[_0x130f17]['param']]=_0x3b65c7['options'];break;default:_0x5c7281[_0x447b4f[_0x130f17]['param']]=_0x9a12cb[_0x447b4f[_0x130f17]['param']];}}return _0x5c7281[_0x5c4f('0x29')](',');}function _0x1ead67(_0x2be120,_0x280b3a,_0x13075f){return new Promise(function(_0x3684b3,_0x2a40b8){var _0x1b7a55=[];if(_[_0x5c4f('0x2c')](_0x280b3a))return _0x3684b3(_0x1b7a55);_0x515f4c[_0x5c4f('0x2d')][_0x5c4f('0x2e')]({'attributes':['id',_0x5c4f('0x2f'),_0x5c4f('0x30')],'raw':!![]})[_0x5c4f('0x31')](function(_0x2d01d9){for(var _0x219616=0x0,_0x4e2f3e=0x0;_0x219616<_0x280b3a[_0x5c4f('0x22')];_0x219616++,_0x4e2f3e=0x0){var _0x1a6a58=_0x280b3a[_0x219616];var _0x88ca8b=[];var _0x3f21c4=[];delete _0x1a6a58['id'];if(_0x1a6a58[_0x5c4f('0x2f')]!==_0x5c4f('0x32')){_0x1a6a58['intervals']=[_0x1a6a58[_0x5c4f('0x2f')]];}else{_0x1a6a58[_0x5c4f('0x33')]=_0x1a6a58['IntervalId']?_[_0x5c4f('0x34')](_[_0x5c4f('0x35')](_0x2d01d9,{'IntervalId':_0x1a6a58[_0x5c4f('0x30')]}),_0x5c4f('0x2f')):[];}_0x1a6a58['context']=_0x2be120[_0x5c4f('0x6')];_0x1a6a58[_0x5c4f('0x7')]=_0x2be120['exten'];if(_0x1a6a58[_0x5c4f('0x5')])_0x1a6a58[_0x5c4f('0x5')]=_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')]();if(_0x2be120['type']===_0x5c4f('0xf')){if(_0x1a6a58[_0x5c4f('0x1b')](_0x5c4f('0x37'))&&_0x1a6a58[_0x5c4f('0x37')]&&_0x1a6a58[_0x5c4f('0x37')]!=='--'){_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x38')+_0x1a6a58[_0x5c4f('0x37')],'context':_0x2be120['context'],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1a6a58['callerID']?_0x5c4f('0x39')+_0x1a6a58[_0x5c4f('0x3a')]+')':_0x5c4f('0x3b')),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120['exten'],'priority':_0x1a6a58['intervals'][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}else{if(_0x1a6a58['hasOwnProperty'](_0x5c4f('0x3c'))){if([_0x5c4f('0x3d'),_0x5c4f('0x3e')][_0x5c4f('0x3f')](_0x1a6a58[_0x5c4f('0x40')][_0x5c4f('0x36')]())&&_0x1a6a58[_0x5c4f('0x41')]!==_0x5c4f('0x42')){if(_0x1a6a58[_0x5c4f('0x3c')]){_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58['type'][_0x5c4f('0x36')](),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x43'),'context':_0x2be120['context'],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120['exten'],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}else{_0x88ca8b['push']({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x44'),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x45'),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}}}}for(var _0x5e52ec=0x0;_0x5e52ec<_0x1a6a58[_0x5c4f('0x33')]['length'];_0x5e52ec++){var _0x132924=_0x13075f+_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')];var _0x7ff8b8=_0x5e52ec===_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]-0x1?_0x13075f+_0x88ca8b[_0x5c4f('0x22')]+_0x3f21c4[_0x5c4f('0x22')]+0x2:_0x13075f+_0x5e52ec+0x1;_0x88ca8b[_0x5c4f('0x46')](_0x5e52ec,0x0,{'type':_0x2be120[_0x5c4f('0x5')],'app':_0x5c4f('0x47'),'appdata':_0x1a6a58['intervals'][_0x5e52ec]+'?'+_0x2be120[_0x5c4f('0x6')]+',${EXTEN},'+_0x132924+':'+_0x2be120['context']+',${EXTEN},'+_0x7ff8b8,'exten':_0x2be120[_0x5c4f('0x7')],'context':_0x2be120[_0x5c4f('0x6')],'priority':_0x13075f+_0x5e52ec,'VoiceExtensionId':_0x2be120['id']});}if(_0x1a6a58['appType']===_0x5c4f('0x48'))_0x1a6a58[_0x5c4f('0x49')]=_0x1ffc6e(_0x2be120,_0x1a6a58[_0x5c4f('0x49')]);_0x1a6a58['priority']=_0x88ca8b[_0x5c4f('0x22')]?_[_0x5c4f('0x4a')](_0x88ca8b)[_0x5c4f('0x4b')]+0x1:_0x13075f;_0x1b7a55=_[_0x5c4f('0x4c')](_0x1b7a55,_0x88ca8b,[_0x1a6a58],_0x3f21c4);_0x13075f=_[_0x5c4f('0x4a')](_0x1b7a55)[_0x5c4f('0x4b')]+0x1;}return _0x3684b3(_0x1b7a55);})['catch'](function(_0x47a357){_0x2a40b8(_0x47a357);});});}return _0x37e15c['define'](_0x5c4f('0x4d'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x45cf01){var _0x4f64d4=this[_0x5c4f('0x4e')]({'plain':!![]});var _0x17535b=_0x4f64d4['type']==='outbound'?_0x5154eb(_0x4f64d4):_0x221555(_0x4f64d4);return _0x1ead67(_0x4f64d4,_0x45cf01,_[_0x5c4f('0x4a')](_0x17535b)[_0x5c4f('0x4b')]+0x1)['then'](function(_0x2535f1){var _0x231652=_[_0x5c4f('0x4c')](_0x17535b,_0x2535f1);_0x231652[_0x5c4f('0xd')]({'type':_0x4f64d4[_0x5c4f('0x5')],'app':_0x5c4f('0x4f'),'exten':_0x4f64d4['exten'],'context':_0x4f64d4[_0x5c4f('0x6')],'priority':_[_0x5c4f('0x4a')](_0x231652)[_0x5c4f('0x4b')]+0x1,'VoiceExtensionId':_0x4f64d4['id']});return _0x231652;});}}});}; \ No newline at end of file +var _0x254a=['Set','CDR(type)=','type','alias','NoOp','CDR(routeAlias)=','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','context','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','length','name','trunk','param','split','phone','prefix','${EXTEN}','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','playback','includes','app','appType','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','concat','lodash','./voiceExtension.attributes','exports','models'];(function(_0x332b8a,_0x43f444){var _0x4a891b=function(_0x5e6a04){while(--_0x5e6a04){_0x332b8a['push'](_0x332b8a['shift']());}};_0x4a891b(++_0x43f444);}(_0x254a,0x138));var _0xa254=function(_0x1915e5,_0xe53420){_0x1915e5=_0x1915e5-0x0;var _0x148dd0=_0x254a[_0x1915e5];return _0x148dd0;};'use strict';var _=require(_0xa254('0x0'));var attributes=require(_0xa254('0x1'));module[_0xa254('0x2')]=function(_0x51d166){var _0xdd386c=_0x51d166[_0xa254('0x3')];function _0x34467a(_0x425c63){var _0x500e29=0x2;var _0x8fbfaf=[{'type':_0x425c63['type'],'app':_0xa254('0x4'),'appdata':_0xa254('0x5')+_0x425c63[_0xa254('0x6')],'context':_0x425c63['context'],'exten':_0x425c63['exten'],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']},{'type':_0x425c63[_0xa254('0x6')],'app':_0x425c63[_0xa254('0x7')]?'Set':_0xa254('0x8'),'appdata':_0x425c63['alias']?_0xa254('0x9')+_0x425c63[_0xa254('0x7')]:'No\x20alias\x20set','context':_0x425c63['context'],'exten':_0x425c63[_0xa254('0xa')],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']}];if(_0x425c63[_0xa254('0x6')]===_0xa254('0xb')){_0x8fbfaf[_0xa254('0xc')]({'type':_0xa254('0xb'),'app':'Set','appdata':_0xa254('0xd')+_0x425c63['id'],'context':_0x425c63['context'],'exten':_0x425c63['exten'],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']});}_0x8fbfaf[_0xa254('0xc')]({'type':_0x425c63[_0xa254('0x6')],'app':'Set','appdata':_0xa254('0xe'),'context':_0x425c63[_0xa254('0xf')],'exten':_0x425c63[_0xa254('0xa')],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']},{'type':_0x425c63[_0xa254('0x6')],'app':_0xa254('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x425c63[_0xa254('0xf')],'exten':_0x425c63[_0xa254('0xa')],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']},{'type':_0x425c63[_0xa254('0x6')],'app':_0xa254('0x4'),'appdata':_0xa254('0x10'),'context':_0x425c63[_0xa254('0xf')],'exten':_0x425c63[_0xa254('0xa')],'priority':_0x500e29++,'VoiceExtensionId':_0x425c63['id']});return _0x8fbfaf;}function _0x1f21ae(_0x348a64){var _0x5b5de4=0x2;var _0x547205=[{'type':'outbound','app':_0xa254('0x4'),'appdata':_0xa254('0x11'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0x348a64[_0xa254('0x7')]?_0xa254('0x4'):'NoOp','appdata':_0x348a64[_0xa254('0x7')]?'CDR(routeAlias)='+_0x348a64[_0xa254('0x7')]:_0xa254('0x13'),'context':_0x348a64['context'],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':'Set','appdata':'CDR(destination)='+(_0x348a64[_0xa254('0x14')]?_0xa254('0x15')+_0x348a64[_0xa254('0x14')]+'}':'${EXTEN}'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':'Set','appdata':'CDR(routeid)='+_0x348a64['id'],'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5b5de4+0x2)+_0xa254('0x17')+(_0x5b5de4+0x1)+')','context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':_0x348a64[_0xa254('0x14')]?_0xa254('0x18')+_0x348a64[_0xa254('0x14')]+'}':_0xa254('0x19'),'context':_0x348a64['context'],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':_0xa254('0xe'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64['exten'],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':_0xa254('0x1a'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64['exten'],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':_0xa254('0x10'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':_0xa254('0x1b')+_0x348a64['id'],'context':_0x348a64['context'],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']}];if(_0x348a64[_0xa254('0x1c')](_0xa254('0x1d'))&&_0x348a64[_0xa254('0x1d')]!=='none'){_0x547205[_0xa254('0xc')]({'type':_0xa254('0x12'),'app':_0xa254('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']},{'type':_0xa254('0x12'),'app':'Set','appdata':_0xa254('0x1e')+_0x348a64[_0xa254('0x1d')]||_0xa254('0x1f'),'context':_0x348a64[_0xa254('0xf')],'exten':_0x348a64[_0xa254('0xa')],'priority':_0x5b5de4++,'VoiceExtensionId':_0x348a64['id']});}return _0x547205;}function _0x667f32(_0x1f37df,_0x26bfd6){var _0x172d0d=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xa254('0x20'),'param':0x2},{'name':_0xa254('0x21'),'param':0x3}];var _0x4e0f32={};var _0x264205=_0x26bfd6['split'](',');var _0x5d1cd0=[];for(var _0x288c66=0x0;_0x288c66<_0x172d0d[_0xa254('0x22')];_0x288c66++){switch(_0x172d0d[_0x288c66][_0xa254('0x23')]){case _0xa254('0x24'):_0x4e0f32['trunk']=_0x264205[_0x172d0d[_0x288c66][_0xa254('0x25')]][_0xa254('0x26')]('/')[0x1];_0x4e0f32[_0xa254('0x27')]=_0x264205[_0x172d0d[_0x288c66][_0xa254('0x25')]][_0xa254('0x26')]('/')[0x2];_0x4e0f32[_0xa254('0x28')]=_0x4e0f32[_0xa254('0x27')]?_0x4e0f32[_0xa254('0x27')][_0xa254('0x26')]('$')[0x0]:undefined;_0x4e0f32[_0xa254('0x27')]=_0x1f37df[_0xa254('0x14')]?(_0x4e0f32[_0xa254('0x28')]||'')+_0xa254('0x15')+_0x1f37df['cutdigits']+'}':(_0x4e0f32['prefix']||'')+_0xa254('0x29');_0x5d1cd0[_0x172d0d[_0x288c66][_0xa254('0x25')]]=['SIP',_0x4e0f32['trunk'],_0x4e0f32[_0xa254('0x27')]][_0xa254('0x2a')]('/');break;case _0xa254('0x20'):_0x4e0f32[_0xa254('0x20')]=_0x264205[_0x172d0d[_0x288c66][_0xa254('0x25')]];if(_0x1f37df[_0xa254('0x1d')]!==_0xa254('0x2b')){if(_0x4e0f32['options'][_0xa254('0x2c')](_0xa254('0x2d'))<0x0){_0x4e0f32[_0xa254('0x20')]+=_0xa254('0x2d');}}else{_0x4e0f32[_0xa254('0x20')]=_0x4e0f32[_0xa254('0x20')]['replace'](_0xa254('0x2d'),'');}_0x5d1cd0[_0x172d0d[_0x288c66][_0xa254('0x25')]]=_0x4e0f32[_0xa254('0x20')];break;default:_0x5d1cd0[_0x172d0d[_0x288c66][_0xa254('0x25')]]=_0x264205[_0x172d0d[_0x288c66][_0xa254('0x25')]];}}return _0x5d1cd0[_0xa254('0x2a')](',');}function _0x3a3458(_0x32c60e,_0x171d57,_0x15bbba){return new Promise(function(_0x21f446,_0x5d16e7){var _0x5d42df=[];if(_[_0xa254('0x2e')](_0x171d57))return _0x21f446(_0x5d42df);_0xdd386c[_0xa254('0x2f')][_0xa254('0x30')]({'attributes':['id','interval',_0xa254('0x31')],'raw':!![]})['then'](function(_0x1b589f){for(var _0x1ef195=0x0,_0x8c18af=0x0;_0x1ef195<_0x171d57['length'];_0x1ef195++,_0x8c18af=0x0){var _0x32d7a5=_0x171d57[_0x1ef195];var _0x5049e8=[];var _0xb4381=[];delete _0x32d7a5['id'];if(_0x32d7a5[_0xa254('0x32')]!==_0xa254('0x33')){_0x32d7a5[_0xa254('0x34')]=[_0x32d7a5[_0xa254('0x32')]];}else{_0x32d7a5['intervals']=_0x32d7a5[_0xa254('0x31')]?_['map'](_[_0xa254('0x35')](_0x1b589f,{'IntervalId':_0x32d7a5[_0xa254('0x31')]}),'interval'):[];}_0x32d7a5[_0xa254('0xf')]=_0x32c60e[_0xa254('0xf')];_0x32d7a5[_0xa254('0xa')]=_0x32c60e[_0xa254('0xa')];if(_0x32d7a5[_0xa254('0x6')])_0x32d7a5[_0xa254('0x6')]=_0x32d7a5[_0xa254('0x6')][_0xa254('0x36')]();if(_0x32c60e['type']==='outbound'){if(_0x32d7a5['hasOwnProperty'](_0xa254('0x37'))&&_0x32d7a5['tag']&&_0x32d7a5[_0xa254('0x37')]!=='--'){_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5['type'][_0xa254('0x36')](),'app':'Set','appdata':_0xa254('0x38')+_0x32d7a5[_0xa254('0x37')],'context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5[_0xa254('0x34')][_0xa254('0x22')]+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});}_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5[_0xa254('0x6')][_0xa254('0x36')](),'app':_0xa254('0x16'),'appdata':_0xa254('0x39')+(_0x32d7a5['callerID']?_0xa254('0x3a')+_0x32d7a5[_0xa254('0x3b')]+')':_0xa254('0x3c')),'context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5[_0xa254('0x34')]['length']+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});}else{if(_0x32d7a5[_0xa254('0x1c')]('answer')){if(['queue',_0xa254('0x3d')][_0xa254('0x3e')](_0x32d7a5[_0xa254('0x3f')]['toLowerCase']())&&_0x32d7a5[_0xa254('0x40')]!=='custom'){if(_0x32d7a5[_0xa254('0x41')]){_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5[_0xa254('0x6')][_0xa254('0x36')](),'app':_0xa254('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5[_0xa254('0x34')][_0xa254('0x22')]+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5[_0xa254('0x6')][_0xa254('0x36')](),'app':_0xa254('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5['intervals'][_0xa254('0x22')]+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});}else{_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5[_0xa254('0x6')]['toLowerCase'](),'app':'ExecIf','appdata':_0xa254('0x42'),'context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5[_0xa254('0x34')]['length']+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});_0x5049e8[_0xa254('0xc')]({'type':_0x32d7a5[_0xa254('0x6')][_0xa254('0x36')](),'app':_0xa254('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x32c60e[_0xa254('0xf')],'exten':_0x32c60e[_0xa254('0xa')],'priority':_0x32d7a5[_0xa254('0x34')]['length']+_0x15bbba+_0x8c18af++,'VoiceExtensionId':_0x32c60e['id']});}}}}for(var _0x35e28b=0x0;_0x35e28b<_0x32d7a5[_0xa254('0x34')][_0xa254('0x22')];_0x35e28b++){var _0x4c1d2b=_0x15bbba+_0x32d7a5[_0xa254('0x34')][_0xa254('0x22')];var _0x1bd93d=_0x35e28b===_0x32d7a5[_0xa254('0x34')][_0xa254('0x22')]-0x1?_0x15bbba+_0x5049e8['length']+_0xb4381['length']+0x2:_0x15bbba+_0x35e28b+0x1;_0x5049e8[_0xa254('0x43')](_0x35e28b,0x0,{'type':_0x32c60e[_0xa254('0x6')],'app':_0xa254('0x44'),'appdata':_0x32d7a5['intervals'][_0x35e28b]+'?'+_0x32c60e[_0xa254('0xf')]+_0xa254('0x45')+_0x4c1d2b+':'+_0x32c60e['context']+_0xa254('0x45')+_0x1bd93d,'exten':_0x32c60e[_0xa254('0xa')],'context':_0x32c60e[_0xa254('0xf')],'priority':_0x15bbba+_0x35e28b,'VoiceExtensionId':_0x32c60e['id']});}if(_0x32d7a5[_0xa254('0x40')]===_0xa254('0x46'))_0x32d7a5[_0xa254('0x47')]=_0x667f32(_0x32c60e,_0x32d7a5[_0xa254('0x47')]);_0x32d7a5[_0xa254('0x48')]=_0x5049e8['length']?_[_0xa254('0x49')](_0x5049e8)[_0xa254('0x48')]+0x1:_0x15bbba;_0x5d42df=_['concat'](_0x5d42df,_0x5049e8,[_0x32d7a5],_0xb4381);_0x15bbba=_[_0xa254('0x49')](_0x5d42df)[_0xa254('0x48')]+0x1;}return _0x21f446(_0x5d42df);})[_0xa254('0x4a')](function(_0xb21c9){_0x5d16e7(_0xb21c9);});});}return _0x51d166[_0xa254('0x4b')](_0xa254('0x4c'),attributes,{'tableName':_0xa254('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x294d2b){var _0x346ee9=this['get']({'plain':!![]});var _0x489cea=_0x346ee9[_0xa254('0x6')]==='outbound'?_0x1f21ae(_0x346ee9):_0x34467a(_0x346ee9);return _0x3a3458(_0x346ee9,_0x294d2b,_[_0xa254('0x49')](_0x489cea)[_0xa254('0x48')]+0x1)['then'](function(_0x2b8d83){var _0x28d224=_[_0xa254('0x4e')](_0x489cea,_0x2b8d83);_0x28d224[_0xa254('0xc')]({'type':_0x346ee9[_0xa254('0x6')],'app':'Hangup','exten':_0x346ee9[_0xa254('0xa')],'context':_0x346ee9[_0xa254('0xf')],'priority':_[_0xa254('0x49')](_0x28d224)[_0xa254('0x48')]+0x1,'VoiceExtensionId':_0x346ee9['id']});return _0x28d224;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3b86cfa..f2f6ae7 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 _0x91c6=['http','redis','localhost','socket.io-emitter','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','result','catch','findAll','options','raw','where','limit','map','include','model','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x91c6,0xf9));var _0x691c=function(_0x1248c9,_0x22f277){_0x1248c9=_0x1248c9-0x0;var _0x2f7ff0=_0x91c6[_0x1248c9];return _0x2f7ff0;};'use strict';var _=require(_0x691c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x691c('0x1'));var rs=require(_0x691c('0x2'));var fs=require('fs');var Redis=require(_0x691c('0x3'));var db=require(_0x691c('0x4'))['db'];var utils=require(_0x691c('0x5'));var logger=require('../../config/logger')(_0x691c('0x6'));var config=require(_0x691c('0x7'));var jayson=require(_0x691c('0x8'));var client=jayson[_0x691c('0x9')][_0x691c('0xa')]({'port':0x232a});config[_0x691c('0xb')]=_['defaults'](config[_0x691c('0xb')],{'host':_0x691c('0xc'),'port':0x18eb});var socket=require(_0x691c('0xd'))(new Redis(config[_0x691c('0xb')]));require('./voiceExtension.socket')[_0x691c('0xe')](socket);function respondWithRpcPromise(_0x22944b,_0x3efbfb,_0x53c1eb){return new BPromise(function(_0x4bf36c,_0x497367){return client[_0x691c('0xf')](_0x22944b,_0x53c1eb)[_0x691c('0x10')](function(_0x16ef24){logger[_0x691c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,'request\x20sent');logger[_0x691c('0x12')](_0x691c('0x13'),_0x3efbfb,_0x691c('0x14'),JSON[_0x691c('0x15')](_0x16ef24));if(_0x16ef24[_0x691c('0x16')]){if(_0x16ef24[_0x691c('0x16')][_0x691c('0x17')]===0x1f4){logger[_0x691c('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);return _0x497367(_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);}logger[_0x691c('0x16')](_0x691c('0x19'),_0x3efbfb,_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);return _0x4bf36c(_0x16ef24['error'][_0x691c('0x18')]);}else{logger[_0x691c('0x11')](_0x691c('0x19'),_0x3efbfb,_0x691c('0x14'));_0x4bf36c(_0x16ef24[_0x691c('0x1a')]['message']);}})[_0x691c('0x1b')](function(_0x2bc7fe){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,_0x2bc7fe);_0x497367(_0x2bc7fe);});});}exports['GetVoiceExtension']=function(_0x152965){var _0x5d07de=this;return new Promise(function(_0x2a9195,_0x53a419){return db['VoiceExtension'][_0x691c('0x1c')]({'raw':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')][_0x691c('0x1e')]===undefined?!![]:![]:!![],'where':_0x152965[_0x691c('0x1d')]?_0x152965['options'][_0x691c('0x1f')]||null:null,'attributes':_0x152965['options']?_0x152965[_0x691c('0x1d')]['attributes']||null:null,'limit':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')][_0x691c('0x20')]||null:null,'include':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')]['include']?_[_0x691c('0x21')](_0x152965['options'][_0x691c('0x22')],function(_0x22cc77){return{'model':db[_0x22cc77[_0x691c('0x23')]],'as':_0x22cc77['as'],'attributes':_0x22cc77[_0x691c('0x24')],'include':_0x22cc77[_0x691c('0x22')]?_[_0x691c('0x21')](_0x22cc77[_0x691c('0x22')],function(_0xccf826){return{'model':db[_0xccf826['model']],'as':_0xccf826['as'],'attributes':_0xccf826[_0x691c('0x24')],'include':_0xccf826[_0x691c('0x22')]?_[_0x691c('0x21')](_0xccf826[_0x691c('0x22')],function(_0x598ece){return{'model':db[_0x598ece['model']],'as':_0x598ece['as'],'attributes':_0x598ece[_0x691c('0x24')]};}):[]};}):[]};}):[]:[]})[_0x691c('0x10')](function(_0x4feaa6){logger[_0x691c('0x11')]('GetVoiceExtension',_0x152965);logger[_0x691c('0x12')]('GetVoiceExtension',_0x152965,JSON[_0x691c('0x15')](_0x4feaa6));_0x2a9195(_0x4feaa6);})[_0x691c('0x1b')](function(_0x21c531){logger['error']('GetVoiceExtension',_0x21c531[_0x691c('0x18')],_0x152965);_0x53a419(_0x5d07de[_0x691c('0x16')](0x1f4,_0x21c531[_0x691c('0x18')]));});});}; \ No newline at end of file +var _0x7409=['model','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','error','VoiceExtension,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map'];(function(_0x2bde9f,_0x3ccd1b){var _0x3e8886=function(_0x3984bf){while(--_0x3984bf){_0x2bde9f['push'](_0x2bde9f['shift']());}};_0x3e8886(++_0x3ccd1b);}(_0x7409,0x6e));var _0x9740=function(_0x35db17,_0x8d64da){_0x35db17=_0x35db17-0x0;var _0x73f088=_0x7409[_0x35db17];return _0x73f088;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require('moment');var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require(_0x9740('0xa'));var client=jayson['client'][_0x9740('0xb')]({'port':0x232a});config[_0x9740('0xc')]=_[_0x9740('0xd')](config['redis'],{'host':_0x9740('0xe'),'port':0x18eb});var socket=require(_0x9740('0xf'))(new Redis(config[_0x9740('0xc')]));require('./voiceExtension.socket')[_0x9740('0x10')](socket);function respondWithRpcPromise(_0x548bf8,_0x1a6ff9,_0xc27c18){return new BPromise(function(_0x4e39f9,_0x59dd44){return client['request'](_0x548bf8,_0xc27c18)[_0x9740('0x11')](function(_0x3bc357){logger[_0x9740('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent',JSON['stringify'](_0x3bc357));if(_0x3bc357['error']){if(_0x3bc357[_0x9740('0x13')]['code']===0x1f4){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x3bc357['error'][_0x9740('0x15')]);return _0x59dd44(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}logger[_0x9740('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x1a6ff9,_0x3bc357[_0x9740('0x13')]['message']);return _0x4e39f9(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}else{logger[_0x9740('0x12')](_0x9740('0x14'),_0x1a6ff9,_0x9740('0x16'));_0x4e39f9(_0x3bc357[_0x9740('0x17')][_0x9740('0x15')]);}})[_0x9740('0x18')](function(_0x206c4d){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x206c4d);_0x59dd44(_0x206c4d);});});}exports[_0x9740('0x19')]=function(_0x3fb57c){var _0x31d4f7=this;return new Promise(function(_0x3f9e9d,_0xdf62fc){return db[_0x9740('0x1a')][_0x9740('0x1b')]({'raw':_0x3fb57c['options']?_0x3fb57c[_0x9740('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x1d')]||null:null,'attributes':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x1e')]||null:null,'limit':_0x3fb57c['options']?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x1f')]||null:null,'include':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x20')]?_[_0x9740('0x21')](_0x3fb57c[_0x9740('0x1c')][_0x9740('0x20')],function(_0x11ee90){return{'model':db[_0x11ee90['model']],'as':_0x11ee90['as'],'attributes':_0x11ee90[_0x9740('0x1e')],'include':_0x11ee90['include']?_['map'](_0x11ee90['include'],function(_0x4d2e0d){return{'model':db[_0x4d2e0d[_0x9740('0x22')]],'as':_0x4d2e0d['as'],'attributes':_0x4d2e0d[_0x9740('0x1e')],'include':_0x4d2e0d[_0x9740('0x20')]?_['map'](_0x4d2e0d[_0x9740('0x20')],function(_0x353630){return{'model':db[_0x353630[_0x9740('0x22')]],'as':_0x353630['as'],'attributes':_0x353630[_0x9740('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bfa1f){logger[_0x9740('0x12')](_0x9740('0x19'),_0x3fb57c);logger['debug'](_0x9740('0x19'),_0x3fb57c,JSON[_0x9740('0x23')](_0x3bfa1f));_0x3f9e9d(_0x3bfa1f);})[_0x9740('0x18')](function(_0x2bba86){logger[_0x9740('0x13')](_0x9740('0x19'),_0x2bba86[_0x9740('0x15')],_0x3fb57c);_0xdf62fc(_0x31d4f7[_0x9740('0x13')](0x1f4,_0x2bba86[_0x9740('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 105e709..4097467 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x37c84e,_0x54d3fe){var _0x4737ce=function(_0x4ec94b){while(--_0x4ec94b){_0x37c84e['push'](_0x37c84e['shift']());}};_0x4737ce(++_0x54d3fe);}(_0x5fc3,0xa8));var _0x35fc=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x5fc3[_0x47b15f];return _0x55bf25;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0xfdb399,_0x1d68e0){var _0xe1f875=function(_0x5f2791){while(--_0x5f2791){_0xfdb399['push'](_0xfdb399['shift']());}};_0xe1f875(++_0x1d68e0);}(_0xf494,0x1c6));var _0x4f49=function(_0x2659b3,_0x47c8b5){_0x2659b3=_0x2659b3-0x0;var _0x5c9617=_0xf494[_0x2659b3];return _0x5c9617;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 708ff01..0506bdd 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3a236c,_0x209f66){var _0x5b824f=function(_0x2b0602){while(--_0x2b0602){_0x3a236c['push'](_0x3a236c['shift']());}};_0x5b824f(++_0x209f66);}(_0x2ef3,0xba));var _0x32ef=function(_0x595a2c,_0x2d968e){_0x595a2c=_0x595a2c-0x0;var _0x37d4ec=_0x2ef3[_0x595a2c];return _0x37d4ec;};'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('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x27a0=['exports','util','path','connect-timeout','express','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','put','update','delete','destroy'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x27a0,0xbf));var _0x027a=function(_0x3aa42b,_0x176a45){_0x3aa42b=_0x3aa42b-0x0;var _0x34bab1=_0x27a0[_0x3aa42b];return _0x34bab1;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('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(_0x027a('0x5'));router[_0x027a('0x6')]('/',auth[_0x027a('0x7')](),controller[_0x027a('0x8')]);router[_0x027a('0x6')](_0x027a('0x9'),auth['isAuthenticated'](),controller[_0x027a('0xa')]);router[_0x027a('0x6')](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0xc')]);router[_0x027a('0xd')]('/',auth[_0x027a('0x7')](),controller['create']);router[_0x027a('0xe')](_0x027a('0x9'),auth[_0x027a('0x7')](),controller[_0x027a('0xf')]);router[_0x027a('0x10')](_0x027a('0x9'),auth[_0x027a('0x7')](),controller[_0x027a('0x11')]);module[_0x027a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 9367542..6a3daa8 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 _0xf829=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x2e7b84,_0x25ea06){var _0x6b60fc=function(_0x2b6aa5){while(--_0x2b6aa5){_0x2e7b84['push'](_0x2e7b84['shift']());}};_0x6b60fc(++_0x25ea06);}(_0xf829,0x115));var _0x9f82=function(_0x49bf83,_0x3a54dc){_0x49bf83=_0x49bf83-0x0;var _0x339b39=_0xf829[_0x49bf83];return _0x339b39;};'use strict';var Sequelize=require(_0x9f82('0x0'));module[_0x9f82('0x1')]={'customer_id':{'type':Sequelize[_0x9f82('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x9f82('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x9f82('0x2')],'defaultValue':'','allowNull':![],'unique':_0x9f82('0x4')},'password':{'type':Sequelize[_0x9f82('0x2')]},'fullname':{'type':Sequelize[_0x9f82('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x10f214){this[_0x9f82('0x5')](_0x9f82('0x6'),typeof _0x10f214===_0x9f82('0x7')&&_0x10f214[_0x9f82('0x8')]()?_0x10f214[_0x9f82('0x8')]():null);}},'pager':{'type':Sequelize[_0x9f82('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x9f82('0x9')},'attach':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9f82('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9f82('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'stamp':{'type':_0x9f82('0xd')},'emailsubject':{'type':Sequelize[_0x9f82('0x2')]},'emailbody':{'type':Sequelize[_0x9f82('0x2')]},'maxsecs':{'type':Sequelize[_0x9f82('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9f82('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9f82('0xf')],'get':function(){return this['getDataValue'](_0x9f82('0x10'))+_0x9f82('0x11')+this[_0x9f82('0x12')]('mailbox');}}}; \ No newline at end of file +var _0xe7b4=['string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x2aef3e,_0xa16c1d){var _0x4f9961=function(_0x1f39fb){while(--_0x1f39fb){_0x2aef3e['push'](_0x2aef3e['shift']());}};_0x4f9961(++_0xa16c1d);}(_0xe7b4,0x1b4));var _0x4e7b=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xe7b4[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require('sequelize');module[_0x4e7b('0x0')]={'customer_id':{'type':Sequelize[_0x4e7b('0x1')]},'context':{'type':Sequelize[_0x4e7b('0x1')],'defaultValue':_0x4e7b('0x2'),'unique':_0x4e7b('0x3')},'mailbox':{'type':Sequelize[_0x4e7b('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4e7b('0x3')},'password':{'type':Sequelize[_0x4e7b('0x1')]},'fullname':{'type':Sequelize[_0x4e7b('0x1')]},'email':{'type':Sequelize[_0x4e7b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x18630c){this[_0x4e7b('0x4')](_0x4e7b('0x5'),typeof _0x18630c===_0x4e7b('0x6')&&_0x18630c['trim']()?_0x18630c[_0x4e7b('0x7')]():null);}},'pager':{'type':Sequelize[_0x4e7b('0x1')]},'tz':{'type':Sequelize[_0x4e7b('0x1')],'defaultValue':_0x4e7b('0x8')},'attach':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':_0x4e7b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x4e7b('0x1')]},'callback':{'type':Sequelize[_0x4e7b('0x1')]},'review':{'type':Sequelize['ENUM'](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4e7b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4e7b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4e7b('0x9')]('yes','no'),'defaultValue':_0x4e7b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4e7b('0x9')](_0x4e7b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x4e7b('0xc')},'emailsubject':{'type':Sequelize[_0x4e7b('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x4e7b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4e7b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4e7b('0xe')],'get':function(){return this['getDataValue'](_0x4e7b('0xf'))+'\x20-\x20'+this[_0x4e7b('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 562d460..234dac6 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 _0xe1e3=['set','Content-Range','apply','reject','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','VoiceMailMessage','nolimit','order','options','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status'];(function(_0x1fd4d7,_0x2feafd){var _0x7efe8a=function(_0xc54f55){while(--_0xc54f55){_0x1fd4d7['push'](_0x1fd4d7['shift']());}};_0x7efe8a(++_0x2feafd);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4b18e1,_0x196f9e){_0x4b18e1=_0x4b18e1-0x0;var _0x5edc64=_0xe1e3[_0x4b18e1];return _0x5edc64;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){var _0x33bf0f=_0x60e6bc[_0x3e1e('0x1f')]({'plain':!![]});var _0x159212=_0x3e1e('0x20');return db[_0x3e1e('0x21')]['destroy']({'where':{'type':_0x159212,'resourceId':_0x33bf0f['id']}})['then'](function(){return _0x60e6bc;});})[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be84e,_0x56b9a8){return function(_0x1a33bb){if(!_0x1a33bb){_0x4be84e[_0x3e1e('0x14')](0x194);}return _0x1a33bb;};}function handleError(_0x5b1bd1,_0x52f966){_0x52f966=_0x52f966||0x1f4;return function(_0x5ac814){logger[_0x3e1e('0x22')](_0x5ac814[_0x3e1e('0x23')]);if(_0x5ac814['name']){delete _0x5ac814[_0x3e1e('0x24')];}_0x5b1bd1[_0x3e1e('0x18')](_0x52f966)[_0x3e1e('0x25')](_0x5ac814);};}exports['index']=function(_0xdef39,_0x4ec149){var _0x591c36={},_0x494c75={},_0x39da8d={'count':0x0,'rows':[]};var _0x5b8f95=_['map'](db[_0x3e1e('0x26')][_0x3e1e('0x27')],function(_0x1c57c2){return{'name':_0x1c57c2[_0x3e1e('0x28')],'type':_0x1c57c2[_0x3e1e('0x29')]['key']};});_0x494c75['model']=_['map'](_0x5b8f95,'name');_0x494c75[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0xdef39[_0x3e1e('0x2a')]);_0x494c75[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x494c75[_0x3e1e('0x2e')],_0x494c75[_0x3e1e('0x2a')]);_0x591c36[_0x3e1e('0x2f')]=_['intersection'](_0x494c75[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0xdef39['query'][_0x3e1e('0x30')]));_0x591c36[_0x3e1e('0x2f')]=_0x591c36[_0x3e1e('0x2f')][_0x3e1e('0x31')]?_0x591c36['attributes']:_0x494c75['model'];if(!_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x32')]('nolimit')){_0x591c36[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0xdef39['query'][_0x3e1e('0x16')]);_0x591c36[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x15')]);}_0x591c36['order']=qs[_0x3e1e('0x33')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x33')]);_0x591c36[_0x3e1e('0x34')]=qs['filters'](_[_0x3e1e('0x35')](_0xdef39[_0x3e1e('0x2a')],_0x494c75[_0x3e1e('0x2c')]),_0x5b8f95);if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x591c36[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x591c36['where'],{'$or':_[_0x3e1e('0x38')](_0x5b8f95,function(_0x4fdd7c){if(_0x4fdd7c['type']!==_0x3e1e('0x39')){var _0x469a42={};_0x469a42[_0x4fdd7c[_0x3e1e('0x24')]]={'$like':'%'+_0xdef39['query'][_0x3e1e('0x36')]+'%'};return _0x469a42;}})});}_0x591c36=_[_0x3e1e('0x37')]({},_0x591c36,_0xdef39['options']);var _0x16d03f={'where':_0x591c36[_0x3e1e('0x34')]};return db['VoiceMail']['count'](_0x16d03f)[_0x3e1e('0x1e')](function(_0x49e4cb){_0x39da8d['count']=_0x49e4cb;if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0x591c36[_0x3e1e('0x3b')]=[{'all':!![]}];}return db[_0x3e1e('0x26')][_0x3e1e('0x3c')](_0x591c36);})['then'](function(_0x5b32ad){_0x39da8d[_0x3e1e('0x3d')]=_0x5b32ad;return _0x39da8d;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4ec149,_0x591c36))[_0x3e1e('0x3e')](handleError(_0x4ec149,null));};exports['show']=function(_0x1124d0,_0x2dcce1){var _0xabe865={'raw':!![],'where':{'id':_0x1124d0[_0x3e1e('0x3f')]['id']}},_0x4ad5fd={};_0x4ad5fd['model']=_['keys'](db[_0x3e1e('0x26')][_0x3e1e('0x27')]);_0x4ad5fd[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0x1124d0['query']);_0x4ad5fd['filters']=_['intersection'](_0x4ad5fd['model'],_0x4ad5fd[_0x3e1e('0x2a')]);_0xabe865[_0x3e1e('0x2f')]=_['intersection'](_0x4ad5fd['model'],qs[_0x3e1e('0x30')](_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x30')]));_0xabe865['attributes']=_0xabe865[_0x3e1e('0x2f')]['length']?_0xabe865[_0x3e1e('0x2f')]:_0x4ad5fd[_0x3e1e('0x2e')];if(_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0xabe865[_0x3e1e('0x3b')]=[{'all':!![]}];}_0xabe865=_[_0x3e1e('0x37')]({},_0xabe865,_0x1124d0['options']);return db[_0x3e1e('0x26')][_0x3e1e('0x40')](_0xabe865)['then'](handleEntityNotFound(_0x2dcce1,null))[_0x3e1e('0x1e')](respondWithResult(_0x2dcce1,null))[_0x3e1e('0x3e')](handleError(_0x2dcce1,null));};exports['create']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x26')][_0x3e1e('0x41')](_0x1cc820['body'],{})[_0x3e1e('0x1e')](function(_0x3d7303){var _0x29d23b=_0x1cc820[_0x3e1e('0x42')]['get']({'plain':!![]});if(!_0x29d23b)throw new Error(_0x3e1e('0x43'));if(_0x29d23b[_0x3e1e('0x44')]===_0x3e1e('0x42')){var _0x25ddf7=_0x3d7303[_0x3e1e('0x1f')]({'plain':!![]});var _0x1df5a8=_0x3e1e('0x20');return db[_0x3e1e('0x45')]['find']({'where':{'name':_0x1df5a8,'userProfileId':_0x29d23b[_0x3e1e('0x46')]},'raw':!![]})['then'](function(_0x5b0d0d){if(_0x5b0d0d&&_0x5b0d0d['autoAssociation']===0x0){return db[_0x3e1e('0x21')][_0x3e1e('0x41')]({'name':_0x25ddf7['name'],'resourceId':_0x25ddf7['id'],'type':_0x5b0d0d[_0x3e1e('0x24')],'sectionId':_0x5b0d0d['id']},{})['then'](function(){return _0x3d7303;});}else{return _0x3d7303;}})['catch'](function(_0x3eaf76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eaf76);throw _0x3eaf76;});}return _0x3d7303;})['then'](respondWithResult(_0x347b3f,0xc9))[_0x3e1e('0x3e')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x47')]=function(_0x1334c8,_0x162a51){if(_0x1334c8[_0x3e1e('0x48')]['id']){delete _0x1334c8[_0x3e1e('0x48')]['id'];}return db[_0x3e1e('0x26')]['find']({'where':{'id':_0x1334c8[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x162a51,null))[_0x3e1e('0x1e')](saveUpdates(_0x1334c8[_0x3e1e('0x48')],null))[_0x3e1e('0x1e')](respondWithResult(_0x162a51,null))['catch'](handleError(_0x162a51,null));};exports['destroy']=function(_0xba8d16,_0xb1456e){return db['VoiceMail'][_0x3e1e('0x40')]({'where':{'id':_0xba8d16['params']['id']}})['then'](handleEntityNotFound(_0xb1456e,null))[_0x3e1e('0x1e')](removeEntity(_0xb1456e,null))[_0x3e1e('0x3e')](handleError(_0xb1456e,null));};exports['getMessages']=function(_0x17bc26,_0x551f12,_0x553451){return db[_0x3e1e('0x26')]['findOne']({'where':{'id':_0x17bc26[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x551f12,null))[_0x3e1e('0x1e')](function(_0x57d845){var _0x7ea199;var _0x8a4987={},_0x48be40={};_0x48be40['model']=_['keys'](db[_0x3e1e('0x49')][_0x3e1e('0x27')]);_0x48be40[_0x3e1e('0x2a')]=_['keys'](_0x17bc26[_0x3e1e('0x2a')]);_0x48be40[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x48be40['model'],_0x48be40['query']);_0x8a4987[_0x3e1e('0x2f')]=_['intersection'](_0x48be40[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0x17bc26[_0x3e1e('0x2a')]['fields']));_0x8a4987[_0x3e1e('0x2f')]=_0x8a4987['attributes'][_0x3e1e('0x31')]?_0x8a4987[_0x3e1e('0x2f')]:_0x48be40['model'];if(!_0x17bc26[_0x3e1e('0x2a')]['hasOwnProperty'](_0x3e1e('0x4a'))){_0x8a4987['limit']=qs[_0x3e1e('0x16')](_0x17bc26['query'][_0x3e1e('0x16')]);_0x8a4987[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0x17bc26['query'][_0x3e1e('0x15')]);}_0x8a4987[_0x3e1e('0x4b')]=qs['sort'](_0x17bc26[_0x3e1e('0x2a')]['sort']);_0x8a4987['where']=qs['filters'](_[_0x3e1e('0x35')](_0x17bc26[_0x3e1e('0x2a')],_0x48be40[_0x3e1e('0x2c')]));if(_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'$or':_[_0x3e1e('0x38')](_0x8a4987[_0x3e1e('0x2f')],function(_0x4634c0){var _0x2a9c84={};_0x2a9c84[_0x4634c0]={'$like':'%'+_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]+'%'};return _0x2a9c84;})});}_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'mailboxuser':_0x57d845['mailbox']});_0x8a4987=_[_0x3e1e('0x37')]({},_0x8a4987,_0x17bc26[_0x3e1e('0x4c')]);return db[_0x3e1e('0x49')][_0x3e1e('0x4d')](_0x8a4987)[_0x3e1e('0x1e')](respondWithFilteredResult(_0x551f12,_0x8a4987));})[_0x3e1e('0x3e')](handleError(_0x551f12,null));}; \ No newline at end of file +var _0xe511=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','create','catch','body','destroy','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','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','end','json','offset','limit','count','set','Content-Range','save','update','then','get','Voicemails','error','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','filters'];(function(_0x5718b9,_0x28fd00){var _0x97befb=function(_0x3130b3){while(--_0x3130b3){_0x5718b9['push'](_0x5718b9['shift']());}};_0x97befb(++_0x28fd00);}(_0xe511,0x16f));var _0x1e51=function(_0x3c6a41,_0x19ce75){_0x3c6a41=_0x3c6a41-0x0;var _0xee6d8d=_0xe511[_0x3c6a41];return _0xee6d8d;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];function respondWithStatusCode(_0x3c5330,_0x5544eb){_0x5544eb=_0x5544eb||0xcc;return function(_0x408a77){if(_0x408a77){return _0x3c5330[_0x1e51('0x18')](_0x5544eb);}return _0x3c5330[_0x1e51('0x19')](_0x5544eb)[_0x1e51('0x1a')]();};}function respondWithResult(_0x21bcbd,_0x32945d){_0x32945d=_0x32945d||0xc8;return function(_0x441c70){if(_0x441c70){return _0x21bcbd[_0x1e51('0x19')](_0x32945d)[_0x1e51('0x1b')](_0x441c70);}};}function respondWithFilteredResult(_0xd76fba,_0x5a5c07){return function(_0x3b01b7){if(_0x3b01b7){var _0x24db4f=typeof _0x5a5c07[_0x1e51('0x1c')]==='undefined'&&typeof _0x5a5c07[_0x1e51('0x1d')]==='undefined';var _0x53d222=_0x3b01b7[_0x1e51('0x1e')];var _0x27dcad=_0x24db4f?0x0:_0x5a5c07[_0x1e51('0x1c')];var _0x4785a5=_0x24db4f?_0x3b01b7[_0x1e51('0x1e')]:_0x5a5c07[_0x1e51('0x1c')]+_0x5a5c07['limit'];var _0x39449b;if(_0x4785a5>=_0x53d222){_0x4785a5=_0x53d222;_0x39449b=0xc8;}else{_0x39449b=0xce;}_0xd76fba['status'](_0x39449b);return _0xd76fba[_0x1e51('0x1f')](_0x1e51('0x20'),_0x27dcad+'-'+_0x4785a5+'/'+_0x53d222)[_0x1e51('0x1b')](_0x3b01b7);}return null;};}function patchUpdates(_0x183a95){return function(_0x506f40){try{jsonpatch['apply'](_0x506f40,_0x183a95,!![]);}catch(_0x4e6a49){return BPromise['reject'](_0x4e6a49);}return _0x506f40[_0x1e51('0x21')]();};}function saveUpdates(_0x4f1f56,_0x3f7340){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0x1e51('0x22')](_0x4f1f56)[_0x1e51('0x23')](function(_0x23c85a){return _0x23c85a;});}return null;};}function removeEntity(_0xf9298,_0x270adf){return function(_0x461d3d){if(_0x461d3d){return _0x461d3d['destroy']()['then'](function(){var _0x43f5c5=_0x461d3d[_0x1e51('0x24')]({'plain':!![]});var _0x2e42b1=_0x1e51('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e42b1,'resourceId':_0x43f5c5['id']}})['then'](function(){return _0x461d3d;});})[_0x1e51('0x23')](function(){_0xf9298[_0x1e51('0x19')](0xcc)[_0x1e51('0x1a')]();});}};}function handleEntityNotFound(_0x5412bc,_0x1e7a96){return function(_0x49c507){if(!_0x49c507){_0x5412bc['sendStatus'](0x194);}return _0x49c507;};}function handleError(_0x3349f0,_0x5c5bbd){_0x5c5bbd=_0x5c5bbd||0x1f4;return function(_0x170ec6){logger[_0x1e51('0x26')](_0x170ec6['stack']);if(_0x170ec6[_0x1e51('0x27')]){delete _0x170ec6[_0x1e51('0x27')];}_0x3349f0[_0x1e51('0x19')](_0x5c5bbd)[_0x1e51('0x28')](_0x170ec6);};}exports['index']=function(_0x4cf046,_0x4f67d3){var _0x20eb9b={},_0x288b50={},_0x1ba84a={'count':0x0,'rows':[]};var _0x36dabe=_[_0x1e51('0x29')](db[_0x1e51('0x2a')][_0x1e51('0x2b')],function(_0x34701c){return{'name':_0x34701c[_0x1e51('0x2c')],'type':_0x34701c[_0x1e51('0x2d')][_0x1e51('0x2e')]};});_0x288b50['model']=_[_0x1e51('0x29')](_0x36dabe,_0x1e51('0x27'));_0x288b50[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x4cf046[_0x1e51('0x2f')]);_0x288b50['filters']=_[_0x1e51('0x31')](_0x288b50['model'],_0x288b50[_0x1e51('0x2f')]);_0x20eb9b[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0x288b50['model'],qs[_0x1e51('0x33')](_0x4cf046['query'][_0x1e51('0x33')]));_0x20eb9b['attributes']=_0x20eb9b['attributes'][_0x1e51('0x34')]?_0x20eb9b[_0x1e51('0x32')]:_0x288b50[_0x1e51('0x35')];if(!_0x4cf046['query'][_0x1e51('0x36')]('nolimit')){_0x20eb9b[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x4cf046['query'][_0x1e51('0x1d')]);_0x20eb9b[_0x1e51('0x1c')]=qs[_0x1e51('0x1c')](_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x20eb9b[_0x1e51('0x37')]=qs['sort'](_0x4cf046['query'][_0x1e51('0x38')]);_0x20eb9b['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x4cf046[_0x1e51('0x2f')],_0x288b50[_0x1e51('0x39')]),_0x36dabe);if(_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]){_0x20eb9b[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0x20eb9b[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x36dabe,function(_0x45d5fe){if(_0x45d5fe['type']!==_0x1e51('0x3e')){var _0x5818be={};_0x5818be[_0x45d5fe[_0x1e51('0x27')]]={'$like':'%'+_0x4cf046[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x5818be;}})});}_0x20eb9b=_[_0x1e51('0x3d')]({},_0x20eb9b,_0x4cf046[_0x1e51('0x3f')]);var _0x2f8fd9={'where':_0x20eb9b[_0x1e51('0x3c')]};return db[_0x1e51('0x2a')][_0x1e51('0x1e')](_0x2f8fd9)[_0x1e51('0x23')](function(_0xc40fce){_0x1ba84a['count']=_0xc40fce;if(_0x4cf046['query'][_0x1e51('0x40')]){_0x20eb9b[_0x1e51('0x41')]=[{'all':!![]}];}return db[_0x1e51('0x2a')][_0x1e51('0x42')](_0x20eb9b);})[_0x1e51('0x23')](function(_0x1a9e0d){_0x1ba84a[_0x1e51('0x43')]=_0x1a9e0d;return _0x1ba84a;})[_0x1e51('0x23')](respondWithFilteredResult(_0x4f67d3,_0x20eb9b))['catch'](handleError(_0x4f67d3,null));};exports[_0x1e51('0x44')]=function(_0x30eba9,_0x1750b3){var _0x41ca21={'raw':!![],'where':{'id':_0x30eba9[_0x1e51('0x45')]['id']}},_0xfd96a0={};_0xfd96a0[_0x1e51('0x35')]=_['keys'](db[_0x1e51('0x2a')][_0x1e51('0x2b')]);_0xfd96a0['query']=_[_0x1e51('0x30')](_0x30eba9[_0x1e51('0x2f')]);_0xfd96a0[_0x1e51('0x39')]=_['intersection'](_0xfd96a0[_0x1e51('0x35')],_0xfd96a0[_0x1e51('0x2f')]);_0x41ca21[_0x1e51('0x32')]=_[_0x1e51('0x31')](_0xfd96a0[_0x1e51('0x35')],qs[_0x1e51('0x33')](_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x33')]));_0x41ca21[_0x1e51('0x32')]=_0x41ca21['attributes'][_0x1e51('0x34')]?_0x41ca21[_0x1e51('0x32')]:_0xfd96a0['model'];if(_0x30eba9[_0x1e51('0x2f')][_0x1e51('0x40')]){_0x41ca21[_0x1e51('0x41')]=[{'all':!![]}];}_0x41ca21=_['merge']({},_0x41ca21,_0x30eba9[_0x1e51('0x3f')]);return db[_0x1e51('0x2a')][_0x1e51('0x46')](_0x41ca21)['then'](handleEntityNotFound(_0x1750b3,null))[_0x1e51('0x23')](respondWithResult(_0x1750b3,null))['catch'](handleError(_0x1750b3,null));};exports['create']=function(_0x54688b,_0x169e6c){return db[_0x1e51('0x2a')]['create'](_0x54688b['body'],{})[_0x1e51('0x23')](function(_0x7ffc42){var _0x2a43dd=_0x54688b[_0x1e51('0x47')][_0x1e51('0x24')]({'plain':!![]});if(!_0x2a43dd)throw new Error(_0x1e51('0x48'));if(_0x2a43dd['role']===_0x1e51('0x47')){var _0x48a2d0=_0x7ffc42[_0x1e51('0x24')]({'plain':!![]});var _0x43589a='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x43589a,'userProfileId':_0x2a43dd[_0x1e51('0x49')]},'raw':!![]})[_0x1e51('0x23')](function(_0x31a37a){if(_0x31a37a&&_0x31a37a['autoAssociation']===0x0){return db[_0x1e51('0x4a')][_0x1e51('0x4b')]({'name':_0x48a2d0[_0x1e51('0x27')],'resourceId':_0x48a2d0['id'],'type':_0x31a37a[_0x1e51('0x27')],'sectionId':_0x31a37a['id']},{})[_0x1e51('0x23')](function(){return _0x7ffc42;});}else{return _0x7ffc42;}})[_0x1e51('0x4c')](function(_0x32fe1f){logger[_0x1e51('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32fe1f);throw _0x32fe1f;});}return _0x7ffc42;})[_0x1e51('0x23')](respondWithResult(_0x169e6c,0xc9))[_0x1e51('0x4c')](handleError(_0x169e6c,null));};exports[_0x1e51('0x22')]=function(_0x213edb,_0x177b63){if(_0x213edb[_0x1e51('0x4d')]['id']){delete _0x213edb['body']['id'];}return db[_0x1e51('0x2a')]['find']({'where':{'id':_0x213edb['params']['id']}})['then'](handleEntityNotFound(_0x177b63,null))[_0x1e51('0x23')](saveUpdates(_0x213edb[_0x1e51('0x4d')],null))[_0x1e51('0x23')](respondWithResult(_0x177b63,null))['catch'](handleError(_0x177b63,null));};exports[_0x1e51('0x4e')]=function(_0x133576,_0x36c981){return db['VoiceMail'][_0x1e51('0x46')]({'where':{'id':_0x133576[_0x1e51('0x45')]['id']}})[_0x1e51('0x23')](handleEntityNotFound(_0x36c981,null))['then'](removeEntity(_0x36c981,null))[_0x1e51('0x4c')](handleError(_0x36c981,null));};exports[_0x1e51('0x4f')]=function(_0x175aa0,_0x30ee67,_0x666ae9){return db[_0x1e51('0x2a')][_0x1e51('0x50')]({'where':{'id':_0x175aa0[_0x1e51('0x45')]['id']}})['then'](handleEntityNotFound(_0x30ee67,null))[_0x1e51('0x23')](function(_0x2e78e7){var _0x48848f;var _0x5a9d2a={},_0x577b19={};_0x577b19[_0x1e51('0x35')]=_[_0x1e51('0x30')](db[_0x1e51('0x51')][_0x1e51('0x2b')]);_0x577b19[_0x1e51('0x2f')]=_[_0x1e51('0x30')](_0x175aa0[_0x1e51('0x2f')]);_0x577b19[_0x1e51('0x39')]=_[_0x1e51('0x31')](_0x577b19['model'],_0x577b19['query']);_0x5a9d2a['attributes']=_[_0x1e51('0x31')](_0x577b19[_0x1e51('0x35')],qs['fields'](_0x175aa0['query'][_0x1e51('0x33')]));_0x5a9d2a[_0x1e51('0x32')]=_0x5a9d2a['attributes'][_0x1e51('0x34')]?_0x5a9d2a[_0x1e51('0x32')]:_0x577b19[_0x1e51('0x35')];if(!_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x36')](_0x1e51('0x52'))){_0x5a9d2a[_0x1e51('0x1d')]=qs[_0x1e51('0x1d')](_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x1d')]);_0x5a9d2a['offset']=qs[_0x1e51('0x1c')](_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x1c')]);}_0x5a9d2a[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x175aa0[_0x1e51('0x2f')]['sort']);_0x5a9d2a['where']=qs[_0x1e51('0x39')](_[_0x1e51('0x3a')](_0x175aa0[_0x1e51('0x2f')],_0x577b19[_0x1e51('0x39')]));if(_0x175aa0['query']['filter']){_0x5a9d2a['where']=_[_0x1e51('0x3d')](_0x5a9d2a[_0x1e51('0x3c')],{'$or':_[_0x1e51('0x29')](_0x5a9d2a[_0x1e51('0x32')],function(_0x184665){var _0x5c68b1={};_0x5c68b1[_0x184665]={'$like':'%'+_0x175aa0[_0x1e51('0x2f')][_0x1e51('0x3b')]+'%'};return _0x5c68b1;})});}_0x5a9d2a[_0x1e51('0x3c')]=_['merge'](_0x5a9d2a[_0x1e51('0x3c')],{'mailboxuser':_0x2e78e7[_0x1e51('0x53')]});_0x5a9d2a=_[_0x1e51('0x3d')]({},_0x5a9d2a,_0x175aa0['options']);return db[_0x1e51('0x51')][_0x1e51('0x54')](_0x5a9d2a)['then'](respondWithFilteredResult(_0x30ee67,_0x5a9d2a));})['catch'](handleError(_0x30ee67,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 12c932d..821d909 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 _0xae31=['context','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','mailbox_context','mailbox'];(function(_0x22cb34,_0x116622){var _0x592d3c=function(_0x5f19a4){while(--_0x5f19a4){_0x22cb34['push'](_0x22cb34['shift']());}};_0x592d3c(++_0x116622);}(_0xae31,0x91));var _0x1ae3=function(_0x50d7fd,_0x30cd62){_0x50d7fd=_0x50d7fd-0x0;var _0x512b17=_0xae31[_0x50d7fd];return _0x512b17;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1ae3('0x0'));var moment=require('moment');var BPromise=require(_0x1ae3('0x1'));var rp=require(_0x1ae3('0x2'));var fs=require('fs');var path=require(_0x1ae3('0x3'));var rimraf=require(_0x1ae3('0x4'));var config=require(_0x1ae3('0x5'));var attributes=require(_0x1ae3('0x6'));module['exports']=function(_0x55f1af,_0x3560fb){return _0x55f1af[_0x1ae3('0x7')](_0x1ae3('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x1ae3('0x9'),'fields':[_0x1ae3('0xa'),_0x1ae3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1448=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x520584,_0x24622e){var _0x4d3818=function(_0x11ae78){while(--_0x11ae78){_0x520584['push'](_0x520584['shift']());}};_0x4d3818(++_0x24622e);}(_0x1448,0x108));var _0x8144=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1448[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8144('0x0'));var util=require(_0x8144('0x1'));var logger=require(_0x8144('0x2'))(_0x8144('0x3'));var moment=require(_0x8144('0x4'));var BPromise=require(_0x8144('0x5'));var rp=require(_0x8144('0x6'));var fs=require('fs');var path=require(_0x8144('0x7'));var rimraf=require(_0x8144('0x8'));var config=require(_0x8144('0x9'));var attributes=require(_0x8144('0xa'));module[_0x8144('0xb')]=function(_0x2a4aac,_0x488371){return _0x2a4aac[_0x8144('0xc')](_0x8144('0xd'),attributes,{'tableName':_0x8144('0xe'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8144('0xf'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index e003115..df15639 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 _0x70fd=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70fd,0x1b2));var _0xd70f=function(_0x3909fc,_0xe12bde){_0x3909fc=_0x3909fc-0x0;var _0x2226d8=_0x70fd[_0x3909fc];return _0x2226d8;};'use strict';var _=require(_0xd70f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd70f('0x1'));var rs=require(_0xd70f('0x2'));var fs=require('fs');var Redis=require(_0xd70f('0x3'));var db=require(_0xd70f('0x4'))['db'];var utils=require(_0xd70f('0x5'));var logger=require(_0xd70f('0x6'))('rpc');var config=require(_0xd70f('0x7'));var jayson=require(_0xd70f('0x8'));var client=jayson[_0xd70f('0x9')][_0xd70f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b83bf,_0xd0b6ce,_0x179a13){return new BPromise(function(_0x16e231,_0x3886cd){return client[_0xd70f('0xb')](_0x1b83bf,_0x179a13)[_0xd70f('0xc')](function(_0xb640b0){logger['info'](_0xd70f('0xd'),_0xd0b6ce,_0xd70f('0xe'));logger[_0xd70f('0xf')](_0xd70f('0x10'),_0xd0b6ce,'request\x20sent',JSON[_0xd70f('0x11')](_0xb640b0));if(_0xb640b0[_0xd70f('0x12')]){if(_0xb640b0[_0xd70f('0x12')]['code']===0x1f4){logger[_0xd70f('0x12')](_0xd70f('0xd'),_0xd0b6ce,_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);return _0x3886cd(_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0xd0b6ce,_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);return _0x16e231(_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);}else{logger[_0xd70f('0x14')](_0xd70f('0xd'),_0xd0b6ce,_0xd70f('0xe'));_0x16e231(_0xb640b0['result']['message']);}})[_0xd70f('0x15')](function(_0x44204){logger['error'](_0xd70f('0xd'),_0xd0b6ce,_0x44204);_0x3886cd(_0x44204);});});} \ No newline at end of file +var _0xe64a=['jayson/promise','client','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x280247,_0x3d33f5){var _0x58c898=function(_0x3232d1){while(--_0x3232d1){_0x280247['push'](_0x280247['shift']());}};_0x58c898(++_0x3d33f5);}(_0xe64a,0x17d));var _0xae64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe64a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae64('0x0'));var util=require('util');var moment=require(_0xae64('0x1'));var BPromise=require(_0xae64('0x2'));var rs=require(_0xae64('0x3'));var fs=require('fs');var Redis=require(_0xae64('0x4'));var db=require(_0xae64('0x5'))['db'];var utils=require(_0xae64('0x6'));var logger=require(_0xae64('0x7'))(_0xae64('0x8'));var config=require(_0xae64('0x9'));var jayson=require(_0xae64('0xa'));var client=jayson[_0xae64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x569b97,_0x39382d,_0x19db14){return new BPromise(function(_0x537f08,_0x5e1170){return client['request'](_0x569b97,_0x19db14)['then'](function(_0x338aa1){logger[_0xae64('0xc')](_0xae64('0xd'),_0x39382d,_0xae64('0xe'));logger[_0xae64('0xf')](_0xae64('0x10'),_0x39382d,_0xae64('0xe'),JSON[_0xae64('0x11')](_0x338aa1));if(_0x338aa1['error']){if(_0x338aa1[_0xae64('0x12')][_0xae64('0x13')]===0x1f4){logger[_0xae64('0x12')](_0xae64('0xd'),_0x39382d,_0x338aa1[_0xae64('0x12')][_0xae64('0x14')]);return _0x5e1170(_0x338aa1['error']['message']);}logger[_0xae64('0x12')]('VoiceMail,\x20%s,\x20%s',_0x39382d,_0x338aa1['error']['message']);return _0x537f08(_0x338aa1[_0xae64('0x12')][_0xae64('0x14')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x39382d,_0xae64('0xe'));_0x537f08(_0x338aa1[_0xae64('0x15')]['message']);}})[_0xae64('0x16')](function(_0x3c6e9a){logger[_0xae64('0x12')](_0xae64('0xd'),_0x39382d,_0x3c6e9a);_0x5e1170(_0x3c6e9a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index be3d286..97ec89d 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 _0xfb25=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','create','update','delete','/:id','destroy','multer','path','connect-timeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb25,0x1e0));var _0x5fb2=function(_0x28215d,_0x43fef8){_0x28215d=_0x28215d-0x0;var _0x111b57=_0xfb25[_0x28215d];return _0x111b57;};'use strict';var multer=require(_0x5fb2('0x0'));var util=require('util');var path=require(_0x5fb2('0x1'));var timeout=require(_0x5fb2('0x2'));var express=require(_0x5fb2('0x3'));var router=express[_0x5fb2('0x4')]();var fs_extra=require(_0x5fb2('0x5'));var auth=require(_0x5fb2('0x6'));var interaction=require(_0x5fb2('0x7'));var config=require(_0x5fb2('0x8'));var controller=require(_0x5fb2('0x9'));router[_0x5fb2('0xa')]('/',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0xc')]);router['get']('/:id',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x5fb2('0xe')]);router[_0x5fb2('0xf')]('/',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x10')]);router['put']('/:id',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x11')]);router[_0x5fb2('0x12')](_0x5fb2('0x13'),auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf0c6=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf0c6,0x172));var _0x6f0c=function(_0x532812,_0x347631){_0x532812=_0x532812-0x0;var _0x57d9e6=_0xf0c6[_0x532812];return _0x57d9e6;};'use strict';var multer=require(_0x6f0c('0x0'));var util=require(_0x6f0c('0x1'));var path=require(_0x6f0c('0x2'));var timeout=require(_0x6f0c('0x3'));var express=require(_0x6f0c('0x4'));var router=express[_0x6f0c('0x5')]();var fs_extra=require(_0x6f0c('0x6'));var auth=require(_0x6f0c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6f0c('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x6f0c('0x9')]('/',auth[_0x6f0c('0xa')](),controller[_0x6f0c('0xb')]);router[_0x6f0c('0x9')]('/:id',auth[_0x6f0c('0xa')](),controller[_0x6f0c('0xc')]);router[_0x6f0c('0x9')](_0x6f0c('0xd'),auth['isAuthenticated'](),controller[_0x6f0c('0xe')]);router[_0x6f0c('0xf')]('/',auth[_0x6f0c('0xa')](),controller[_0x6f0c('0x10')]);router[_0x6f0c('0x11')](_0x6f0c('0x12'),auth[_0x6f0c('0xa')](),controller[_0x6f0c('0x13')]);router[_0x6f0c('0x14')](_0x6f0c('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f0c('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 d1325f8..816915a 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 _0x8a8b=['literal','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x8a8b,0xa3));var _0xb8a8=function(_0x211774,_0x5b0bfb){_0x211774=_0x211774-0x0;var _0x395a65=_0x8a8b[_0x211774];return _0x395a65;};'use strict';var Sequelize=require(_0xb8a8('0x0'));module[_0xb8a8('0x1')]={'name':{'type':Sequelize[_0xb8a8('0x2')],'get':function(_0x3cfee0){return this[_0xb8a8('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb8a8('0x5')](_0xb8a8('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'stamp':{'type':_0xb8a8('0x7'),'defaultValue':Sequelize[_0xb8a8('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xa7ff=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL'];(function(_0x4e6227,_0x331d56){var _0x1d544f=function(_0x12b7b9){while(--_0x12b7b9){_0x4e6227['push'](_0x4e6227['shift']());}};_0x1d544f(++_0x331d56);}(_0xa7ff,0x182));var _0xfa7f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xa7ff[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa7f('0x0')],'get':function(_0x3d982a){return this[_0xfa7f('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xfa7f('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xfa7f('0x4')](_0xfa7f('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfa7f('0x3')],'defaultValue':''},'stamp':{'type':_0xfa7f('0x6'),'defaultValue':Sequelize[_0xfa7f('0x7')](_0xfa7f('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index d1a6511..c84bd16 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 _0x2d41=['create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','findAll','catch','show','params','includeAll','include','find'];(function(_0x261808,_0x1ce540){var _0x2d684a=function(_0x3f82fa){while(--_0x3f82fa){_0x261808['push'](_0x261808['shift']());}};_0x2d684a(++_0x1ce540);}(_0x2d41,0x1ab));var _0x12d4=function(_0x698078,_0xf2ac9c){_0x698078=_0x698078-0x0;var _0x492aba=_0x2d41[_0x698078];return _0x492aba;};'use strict';var emlformat=require(_0x12d4('0x0'));var rimraf=require(_0x12d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12d4('0x2'));var rp=require(_0x12d4('0x3'));var moment=require(_0x12d4('0x4'));var BPromise=require(_0x12d4('0x5'));var Mustache=require(_0x12d4('0x6'));var util=require(_0x12d4('0x7'));var path=require(_0x12d4('0x8'));var sox=require(_0x12d4('0x9'));var csv=require(_0x12d4('0xa'));var ejs=require(_0x12d4('0xb'));var fs=require('fs');var fs_extra=require(_0x12d4('0xc'));var _=require(_0x12d4('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x12d4('0xe'));var deskjs=require(_0x12d4('0xf'));var toCsv=require(_0x12d4('0xa'));var querystring=require(_0x12d4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x12d4('0x11'));var qs=require(_0x12d4('0x12'));var as=require(_0x12d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12d4('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12d4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d92a1,_0x55c9b9){_0x55c9b9=_0x55c9b9||0xcc;return function(_0x5d2154){if(_0x5d2154){return _0x2d92a1[_0x12d4('0x16')](_0x55c9b9);}return _0x2d92a1['status'](_0x55c9b9)[_0x12d4('0x17')]();};}function respondWithResult(_0x286f7c,_0x126e93){_0x126e93=_0x126e93||0xc8;return function(_0x27bf74){if(_0x27bf74){return _0x286f7c[_0x12d4('0x18')](_0x126e93)['json'](_0x27bf74);}};}function respondWithFilteredResult(_0x1c163d,_0x3d348c){return function(_0x321849){if(_0x321849){var _0x4a21c4=typeof _0x3d348c[_0x12d4('0x19')]===_0x12d4('0x1a')&&typeof _0x3d348c[_0x12d4('0x1b')]===_0x12d4('0x1a');var _0x1e6933=_0x321849['count'];var _0x5c1f0e=_0x4a21c4?0x0:_0x3d348c[_0x12d4('0x19')];var _0xbfa8e4=_0x4a21c4?_0x321849[_0x12d4('0x1c')]:_0x3d348c['offset']+_0x3d348c['limit'];var _0x5c65a0;if(_0xbfa8e4>=_0x1e6933){_0xbfa8e4=_0x1e6933;_0x5c65a0=0xc8;}else{_0x5c65a0=0xce;}_0x1c163d[_0x12d4('0x18')](_0x5c65a0);return _0x1c163d[_0x12d4('0x1d')](_0x12d4('0x1e'),_0x5c1f0e+'-'+_0xbfa8e4+'/'+_0x1e6933)['json'](_0x321849);}return null;};}function patchUpdates(_0x1d5ef3){return function(_0x559dca){try{jsonpatch[_0x12d4('0x1f')](_0x559dca,_0x1d5ef3,!![]);}catch(_0x2c014e){return BPromise[_0x12d4('0x20')](_0x2c014e);}return _0x559dca[_0x12d4('0x21')]();};}function saveUpdates(_0x3e68e9,_0x20268c){return function(_0x245587){if(_0x245587){return _0x245587[_0x12d4('0x22')](_0x3e68e9)['then'](function(_0x13120b){return _0x13120b;});}return null;};}function removeEntity(_0x4905ec,_0x13ea86){return function(_0x344e3b){if(_0x344e3b){return _0x344e3b[_0x12d4('0x23')]()[_0x12d4('0x24')](function(){_0x4905ec[_0x12d4('0x18')](0xcc)[_0x12d4('0x17')]();});}};}function handleEntityNotFound(_0x2e817b,_0x431072){return function(_0x441544){if(!_0x441544){_0x2e817b[_0x12d4('0x16')](0x194);}return _0x441544;};}function handleError(_0x158d6f,_0x1524c2){_0x1524c2=_0x1524c2||0x1f4;return function(_0x381d37){logger[_0x12d4('0x25')](_0x381d37[_0x12d4('0x26')]);if(_0x381d37['name']){delete _0x381d37['name'];}_0x158d6f['status'](_0x1524c2)[_0x12d4('0x27')](_0x381d37);};}exports[_0x12d4('0x28')]=function(_0x406f61,_0x1be450){var _0x3dca89={},_0x4903d1={},_0x10ce58={'count':0x0,'rows':[]};var _0x473b92=_[_0x12d4('0x29')](db[_0x12d4('0x2a')][_0x12d4('0x2b')],function(_0x347d0a){return{'name':_0x347d0a[_0x12d4('0x2c')],'type':_0x347d0a[_0x12d4('0x2d')]['key']};});_0x4903d1[_0x12d4('0x2e')]=_[_0x12d4('0x2f')](_[_0x12d4('0x29')](_0x473b92,_0x12d4('0x30')),[_0x12d4('0x30')]);_0x4903d1[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0x406f61[_0x12d4('0x31')]);_0x4903d1[_0x12d4('0x33')]=_[_0x12d4('0x34')](_0x4903d1[_0x12d4('0x2e')],_0x4903d1[_0x12d4('0x31')]);_0x3dca89[_0x12d4('0x35')]=_[_0x12d4('0x34')](_0x4903d1[_0x12d4('0x2e')],qs[_0x12d4('0x36')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x36')]));_0x3dca89[_0x12d4('0x35')]=_0x3dca89[_0x12d4('0x35')][_0x12d4('0x37')]?_0x3dca89[_0x12d4('0x35')]:_0x4903d1[_0x12d4('0x2e')];if(!_0x406f61['query']['hasOwnProperty'](_0x12d4('0x38'))){_0x3dca89[_0x12d4('0x1b')]=qs[_0x12d4('0x1b')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x1b')]);_0x3dca89['offset']=qs[_0x12d4('0x19')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x19')]);}_0x3dca89[_0x12d4('0x39')]=qs[_0x12d4('0x3a')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x3a')]);_0x3dca89['where']=qs[_0x12d4('0x33')](_[_0x12d4('0x3b')](_0x406f61['query'],_0x4903d1[_0x12d4('0x33')]),_0x473b92);if(_0x406f61[_0x12d4('0x31')][_0x12d4('0x3c')]){_0x3dca89[_0x12d4('0x3d')]=_[_0x12d4('0x3e')](_0x3dca89[_0x12d4('0x3d')],{'$or':_[_0x12d4('0x29')](_0x473b92,function(_0x31935f){if(_0x31935f[_0x12d4('0x2d')]!=='VIRTUAL'){var _0x46bcc4={};_0x46bcc4[_0x31935f[_0x12d4('0x30')]]={'$like':'%'+_0x406f61[_0x12d4('0x31')][_0x12d4('0x3c')]+'%'};return _0x46bcc4;}})});}_0x3dca89=_[_0x12d4('0x3e')]({},_0x3dca89,_0x406f61[_0x12d4('0x3f')]);var _0xba8380={'where':_0x3dca89[_0x12d4('0x3d')]};return db[_0x12d4('0x2a')][_0x12d4('0x1c')](_0xba8380)[_0x12d4('0x24')](function(_0x301785){_0x10ce58[_0x12d4('0x1c')]=_0x301785;if(_0x406f61[_0x12d4('0x31')]['includeAll']){_0x3dca89['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x12d4('0x40')](_0x3dca89);})[_0x12d4('0x24')](function(_0xd60eae){_0x10ce58['rows']=_0xd60eae;return _0x10ce58;})[_0x12d4('0x24')](respondWithFilteredResult(_0x1be450,_0x3dca89))[_0x12d4('0x41')](handleError(_0x1be450,null));};exports[_0x12d4('0x42')]=function(_0x2ee3b6,_0x42a190){var _0x2a5bac={'raw':!![],'where':{'id':_0x2ee3b6[_0x12d4('0x43')]['id']}},_0x16e44d={};_0x16e44d[_0x12d4('0x2e')]=_['keys'](db[_0x12d4('0x2a')][_0x12d4('0x2b')]);_0x16e44d[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0x2ee3b6['query']);_0x16e44d[_0x12d4('0x33')]=_['intersection'](_0x16e44d[_0x12d4('0x2e')],_0x16e44d['query']);_0x2a5bac[_0x12d4('0x35')]=_[_0x12d4('0x34')](_0x16e44d[_0x12d4('0x2e')],qs[_0x12d4('0x36')](_0x2ee3b6[_0x12d4('0x31')][_0x12d4('0x36')]));_0x2a5bac[_0x12d4('0x35')]=_0x2a5bac[_0x12d4('0x35')][_0x12d4('0x37')]?_0x2a5bac['attributes']:_0x16e44d['model'];if(_0x2ee3b6[_0x12d4('0x31')][_0x12d4('0x44')]){_0x2a5bac[_0x12d4('0x45')]=[{'all':!![]}];}_0x2a5bac=_[_0x12d4('0x3e')]({},_0x2a5bac,_0x2ee3b6[_0x12d4('0x3f')]);return db['VoiceMailMessage'][_0x12d4('0x46')](_0x2a5bac)[_0x12d4('0x24')](handleEntityNotFound(_0x42a190,null))[_0x12d4('0x24')](respondWithResult(_0x42a190,null))[_0x12d4('0x41')](handleError(_0x42a190,null));};exports[_0x12d4('0x47')]=function(_0x58093d,_0x364e17){return db[_0x12d4('0x2a')][_0x12d4('0x47')](_0x58093d[_0x12d4('0x48')],{})['then'](respondWithResult(_0x364e17,0xc9))[_0x12d4('0x41')](handleError(_0x364e17,null));};exports[_0x12d4('0x22')]=function(_0x435589,_0x5e5a49){if(_0x435589['body']['id']){delete _0x435589[_0x12d4('0x48')]['id'];}return db[_0x12d4('0x2a')][_0x12d4('0x46')]({'where':{'id':_0x435589['params']['id']}})[_0x12d4('0x24')](handleEntityNotFound(_0x5e5a49,null))['then'](saveUpdates(_0x435589[_0x12d4('0x48')],null))['then'](respondWithResult(_0x5e5a49,null))[_0x12d4('0x41')](handleError(_0x5e5a49,null));};exports['destroy']=function(_0x3bc5d7,_0x1f7dac){return db[_0x12d4('0x2a')][_0x12d4('0x46')]({'where':{'id':_0x3bc5d7[_0x12d4('0x43')]['id']}})[_0x12d4('0x24')](handleEntityNotFound(_0x1f7dac,null))[_0x12d4('0x24')](removeEntity(_0x1f7dac,null))['catch'](handleError(_0x1f7dac,null));};exports[_0x12d4('0x49')]=function(_0x2fc0f9,_0x106f9d,_0x5431f9){return db['VoiceMailMessage']['find']({'where':{'id':_0x2fc0f9[_0x12d4('0x43')]['id']},'attributes':['id',_0x12d4('0x4a'),'msg_id']})[_0x12d4('0x24')](handleEntityNotFound(_0x106f9d,null))[_0x12d4('0x24')](function(_0x80c706){if(_0x80c706){if(!_0x80c706['recording']){throw new db[(_0x12d4('0x4b'))][(_0x12d4('0x4c'))](_0x12d4('0x4d'));}var _0x21f7b2={'Content-Type':_0x12d4('0x4e'),'Content-Disposition':_0x12d4('0x4f')};if(_0x80c706[_0x12d4('0x50')]){_0x21f7b2['Content-Disposition']=_0x12d4('0x51')+_0x80c706[_0x12d4('0x50')]+_0x12d4('0x52');}_0x106f9d[_0x12d4('0x1d')](_0x21f7b2);return _0x106f9d[_0x12d4('0x27')](new Buffer(_0x80c706[_0x12d4('0x4a')]));}})[_0x12d4('0x41')](handleError(_0x106f9d,null));}; \ No newline at end of file +var _0xb89d=['../../mysqldb','status','offset','undefined','limit','count','set','json','apply','update','then','destroy','end','sendStatus','error','stack','name','send','index','fieldName','type','key','model','differenceBy','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','map','options','VoiceMailMessage','includeAll','include','catch','params','rawAttributes','create','body','find','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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/license/util'];(function(_0x343388,_0x17c988){var _0x3f1132=function(_0x1a6dad){while(--_0x1a6dad){_0x343388['push'](_0x343388['shift']());}};_0x3f1132(++_0x17c988);}(_0xb89d,0x12c));var _0xdb89=function(_0x501f31,_0x3a7785){_0x501f31=_0x501f31-0x0;var _0x3841ba=_0xb89d[_0x501f31];return _0x3841ba;};'use strict';var emlformat=require(_0xdb89('0x0'));var rimraf=require(_0xdb89('0x1'));var zipdir=require(_0xdb89('0x2'));var jsonpatch=require(_0xdb89('0x3'));var rp=require(_0xdb89('0x4'));var moment=require(_0xdb89('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb89('0x6'));var util=require(_0xdb89('0x7'));var path=require('path');var sox=require(_0xdb89('0x8'));var csv=require(_0xdb89('0x9'));var ejs=require(_0xdb89('0xa'));var fs=require('fs');var fs_extra=require(_0xdb89('0xb'));var _=require(_0xdb89('0xc'));var squel=require(_0xdb89('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdb89('0xe'));var toCsv=require(_0xdb89('0x9'));var querystring=require(_0xdb89('0xf'));var Papa=require(_0xdb89('0x10'));var Redis=require(_0xdb89('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb89('0x12'));var hardwareService=require(_0xdb89('0x13'));var logger=require(_0xdb89('0x14'))(_0xdb89('0x15'));var utils=require(_0xdb89('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdb89('0x17'));var db=require(_0xdb89('0x18'))['db'];function respondWithStatusCode(_0x47f800,_0x17f653){_0x17f653=_0x17f653||0xcc;return function(_0x262f45){if(_0x262f45){return _0x47f800['sendStatus'](_0x17f653);}return _0x47f800['status'](_0x17f653)['end']();};}function respondWithResult(_0x1f61de,_0xa03da7){_0xa03da7=_0xa03da7||0xc8;return function(_0x2c59e8){if(_0x2c59e8){return _0x1f61de[_0xdb89('0x19')](_0xa03da7)['json'](_0x2c59e8);}};}function respondWithFilteredResult(_0x36d4ef,_0x4ffaa7){return function(_0x3fcb7d){if(_0x3fcb7d){var _0x351aef=typeof _0x4ffaa7[_0xdb89('0x1a')]===_0xdb89('0x1b')&&typeof _0x4ffaa7[_0xdb89('0x1c')]==='undefined';var _0x690f1=_0x3fcb7d[_0xdb89('0x1d')];var _0x443061=_0x351aef?0x0:_0x4ffaa7[_0xdb89('0x1a')];var _0xab3a7c=_0x351aef?_0x3fcb7d[_0xdb89('0x1d')]:_0x4ffaa7[_0xdb89('0x1a')]+_0x4ffaa7[_0xdb89('0x1c')];var _0x5e7c97;if(_0xab3a7c>=_0x690f1){_0xab3a7c=_0x690f1;_0x5e7c97=0xc8;}else{_0x5e7c97=0xce;}_0x36d4ef['status'](_0x5e7c97);return _0x36d4ef[_0xdb89('0x1e')]('Content-Range',_0x443061+'-'+_0xab3a7c+'/'+_0x690f1)[_0xdb89('0x1f')](_0x3fcb7d);}return null;};}function patchUpdates(_0x112651){return function(_0x22b582){try{jsonpatch[_0xdb89('0x20')](_0x22b582,_0x112651,!![]);}catch(_0x30c697){return BPromise['reject'](_0x30c697);}return _0x22b582['save']();};}function saveUpdates(_0x33b02a,_0x486913){return function(_0x46ec76){if(_0x46ec76){return _0x46ec76[_0xdb89('0x21')](_0x33b02a)[_0xdb89('0x22')](function(_0x4f6f1a){return _0x4f6f1a;});}return null;};}function removeEntity(_0x466ee0,_0xf77b71){return function(_0x230c3d){if(_0x230c3d){return _0x230c3d[_0xdb89('0x23')]()[_0xdb89('0x22')](function(){_0x466ee0[_0xdb89('0x19')](0xcc)[_0xdb89('0x24')]();});}};}function handleEntityNotFound(_0x2fe8e1,_0x5b2b5a){return function(_0x38efed){if(!_0x38efed){_0x2fe8e1[_0xdb89('0x25')](0x194);}return _0x38efed;};}function handleError(_0x1b1121,_0x111904){_0x111904=_0x111904||0x1f4;return function(_0x23bce0){logger[_0xdb89('0x26')](_0x23bce0[_0xdb89('0x27')]);if(_0x23bce0['name']){delete _0x23bce0[_0xdb89('0x28')];}_0x1b1121['status'](_0x111904)[_0xdb89('0x29')](_0x23bce0);};}exports[_0xdb89('0x2a')]=function(_0x542124,_0x413769){var _0x1b27c8={},_0x429aca={},_0x411754={'count':0x0,'rows':[]};var _0x25fc0c=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x5eee95){return{'name':_0x5eee95[_0xdb89('0x2b')],'type':_0x5eee95[_0xdb89('0x2c')][_0xdb89('0x2d')]};});_0x429aca[_0xdb89('0x2e')]=_[_0xdb89('0x2f')](_['map'](_0x25fc0c,_0xdb89('0x28')),[_0xdb89('0x28')]);_0x429aca['query']=_[_0xdb89('0x30')](_0x542124[_0xdb89('0x31')]);_0x429aca['filters']=_[_0xdb89('0x32')](_0x429aca[_0xdb89('0x2e')],_0x429aca[_0xdb89('0x31')]);_0x1b27c8[_0xdb89('0x33')]=_[_0xdb89('0x32')](_0x429aca[_0xdb89('0x2e')],qs[_0xdb89('0x34')](_0x542124[_0xdb89('0x31')][_0xdb89('0x34')]));_0x1b27c8['attributes']=_0x1b27c8[_0xdb89('0x33')][_0xdb89('0x35')]?_0x1b27c8['attributes']:_0x429aca[_0xdb89('0x2e')];if(!_0x542124[_0xdb89('0x31')]['hasOwnProperty'](_0xdb89('0x36'))){_0x1b27c8[_0xdb89('0x1c')]=qs['limit'](_0x542124[_0xdb89('0x31')][_0xdb89('0x1c')]);_0x1b27c8[_0xdb89('0x1a')]=qs[_0xdb89('0x1a')](_0x542124[_0xdb89('0x31')][_0xdb89('0x1a')]);}_0x1b27c8[_0xdb89('0x37')]=qs[_0xdb89('0x38')](_0x542124['query'][_0xdb89('0x38')]);_0x1b27c8[_0xdb89('0x39')]=qs[_0xdb89('0x3a')](_[_0xdb89('0x3b')](_0x542124['query'],_0x429aca[_0xdb89('0x3a')]),_0x25fc0c);if(_0x542124[_0xdb89('0x31')]['filter']){_0x1b27c8[_0xdb89('0x39')]=_[_0xdb89('0x3c')](_0x1b27c8[_0xdb89('0x39')],{'$or':_[_0xdb89('0x3d')](_0x25fc0c,function(_0x1edf4e){if(_0x1edf4e[_0xdb89('0x2c')]!=='VIRTUAL'){var _0x318a5e={};_0x318a5e[_0x1edf4e[_0xdb89('0x28')]]={'$like':'%'+_0x542124[_0xdb89('0x31')]['filter']+'%'};return _0x318a5e;}})});}_0x1b27c8=_['merge']({},_0x1b27c8,_0x542124[_0xdb89('0x3e')]);var _0x9fa89f={'where':_0x1b27c8[_0xdb89('0x39')]};return db[_0xdb89('0x3f')]['count'](_0x9fa89f)[_0xdb89('0x22')](function(_0x18cfec){_0x411754['count']=_0x18cfec;if(_0x542124[_0xdb89('0x31')][_0xdb89('0x40')]){_0x1b27c8[_0xdb89('0x41')]=[{'all':!![]}];}return db[_0xdb89('0x3f')]['findAll'](_0x1b27c8);})[_0xdb89('0x22')](function(_0x189354){_0x411754['rows']=_0x189354;return _0x411754;})[_0xdb89('0x22')](respondWithFilteredResult(_0x413769,_0x1b27c8))[_0xdb89('0x42')](handleError(_0x413769,null));};exports['show']=function(_0x2274de,_0x1d2e97){var _0x2ceb0f={'raw':!![],'where':{'id':_0x2274de[_0xdb89('0x43')]['id']}},_0x156ebd={};_0x156ebd[_0xdb89('0x2e')]=_[_0xdb89('0x30')](db[_0xdb89('0x3f')][_0xdb89('0x44')]);_0x156ebd[_0xdb89('0x31')]=_[_0xdb89('0x30')](_0x2274de[_0xdb89('0x31')]);_0x156ebd[_0xdb89('0x3a')]=_[_0xdb89('0x32')](_0x156ebd[_0xdb89('0x2e')],_0x156ebd['query']);_0x2ceb0f[_0xdb89('0x33')]=_[_0xdb89('0x32')](_0x156ebd['model'],qs['fields'](_0x2274de['query'][_0xdb89('0x34')]));_0x2ceb0f[_0xdb89('0x33')]=_0x2ceb0f[_0xdb89('0x33')][_0xdb89('0x35')]?_0x2ceb0f[_0xdb89('0x33')]:_0x156ebd[_0xdb89('0x2e')];if(_0x2274de[_0xdb89('0x31')][_0xdb89('0x40')]){_0x2ceb0f[_0xdb89('0x41')]=[{'all':!![]}];}_0x2ceb0f=_[_0xdb89('0x3c')]({},_0x2ceb0f,_0x2274de[_0xdb89('0x3e')]);return db[_0xdb89('0x3f')]['find'](_0x2ceb0f)[_0xdb89('0x22')](handleEntityNotFound(_0x1d2e97,null))['then'](respondWithResult(_0x1d2e97,null))['catch'](handleError(_0x1d2e97,null));};exports[_0xdb89('0x45')]=function(_0x4276a7,_0x1b4e33){return db['VoiceMailMessage'][_0xdb89('0x45')](_0x4276a7[_0xdb89('0x46')],{})[_0xdb89('0x22')](respondWithResult(_0x1b4e33,0xc9))[_0xdb89('0x42')](handleError(_0x1b4e33,null));};exports[_0xdb89('0x21')]=function(_0x1cfa82,_0x1dab14){if(_0x1cfa82[_0xdb89('0x46')]['id']){delete _0x1cfa82[_0xdb89('0x46')]['id'];}return db[_0xdb89('0x3f')]['find']({'where':{'id':_0x1cfa82[_0xdb89('0x43')]['id']}})['then'](handleEntityNotFound(_0x1dab14,null))[_0xdb89('0x22')](saveUpdates(_0x1cfa82['body'],null))[_0xdb89('0x22')](respondWithResult(_0x1dab14,null))['catch'](handleError(_0x1dab14,null));};exports[_0xdb89('0x23')]=function(_0x265ef6,_0x8075c6){return db[_0xdb89('0x3f')][_0xdb89('0x47')]({'where':{'id':_0x265ef6[_0xdb89('0x43')]['id']}})['then'](handleEntityNotFound(_0x8075c6,null))['then'](removeEntity(_0x8075c6,null))[_0xdb89('0x42')](handleError(_0x8075c6,null));};exports['download']=function(_0x3c9f1f,_0x50d9f0,_0x5daba3){return db['VoiceMailMessage'][_0xdb89('0x47')]({'where':{'id':_0x3c9f1f[_0xdb89('0x43')]['id']},'attributes':['id','recording',_0xdb89('0x48')]})['then'](handleEntityNotFound(_0x50d9f0,null))[_0xdb89('0x22')](function(_0x30fe34){if(_0x30fe34){if(!_0x30fe34['recording']){throw new db[(_0xdb89('0x49'))][(_0xdb89('0x4a'))](_0xdb89('0x4b'));}var _0x4e0ed2={'Content-Type':_0xdb89('0x4c'),'Content-Disposition':_0xdb89('0x4d')};if(_0x30fe34['msg_id']){_0x4e0ed2['Content-Disposition']=_0xdb89('0x4e')+_0x30fe34[_0xdb89('0x48')]+_0xdb89('0x4f');}_0x50d9f0[_0xdb89('0x1e')](_0x4e0ed2);return _0x50d9f0[_0xdb89('0x29')](new Buffer(_0x30fe34[_0xdb89('0x50')]));}})['catch'](handleError(_0x50d9f0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3f67eff..b838f76 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 _0x603e=['lodash','util','api','bluebird','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x603e,0x15c));var _0xe603=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x603e[_0x16eb11];return _0x3ae7ef;};'use strict';var _=require(_0xe603('0x0'));var util=require(_0xe603('0x1'));var logger=require('../../config/logger')(_0xe603('0x2'));var moment=require('moment');var BPromise=require(_0xe603('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe603('0x4'));var config=require(_0xe603('0x5'));var attributes=require(_0xe603('0x6'));module[_0xe603('0x7')]=function(_0xdadf86,_0x5c84e1){return _0xdadf86[_0xe603('0x8')](_0xe603('0x9'),attributes,{'tableName':_0xe603('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xe603('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb967=['../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23548f,_0x5e27df){var _0x12dabe=function(_0x2cd30c){while(--_0x2cd30c){_0x23548f['push'](_0x23548f['shift']());}};_0x12dabe(++_0x5e27df);}(_0xb967,0x10a));var _0x7b96=function(_0x5341d2,_0x2da6d6){_0x5341d2=_0x5341d2-0x0;var _0x3a4d6a=_0xb967[_0x5341d2];return _0x3a4d6a;};'use strict';var _=require(_0x7b96('0x0'));var util=require(_0x7b96('0x1'));var logger=require(_0x7b96('0x2'))(_0x7b96('0x3'));var moment=require(_0x7b96('0x4'));var BPromise=require(_0x7b96('0x5'));var rp=require(_0x7b96('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7b96('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x7b96('0x8')]=function(_0x3d3849,_0x36c61e){return _0x3d3849[_0x7b96('0x9')](_0x7b96('0xa'),attributes,{'tableName':_0x7b96('0xb'),'paranoid':![],'indexes':[{'name':_0x7b96('0xc'),'fields':[_0x7b96('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 02b084c..2a121fc 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 _0x1225=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3d18af,_0x5b4fa0){var _0x2ef919=function(_0x3c26d6){while(--_0x3c26d6){_0x3d18af['push'](_0x3d18af['shift']());}};_0x2ef919(++_0x5b4fa0);}(_0x1225,0x171));var _0x5122=function(_0x2144f0,_0x8479fd){_0x2144f0=_0x2144f0-0x0;var _0x1d0f5d=_0x1225[_0x2144f0];return _0x1d0f5d;};'use strict';var _=require(_0x5122('0x0'));var util=require(_0x5122('0x1'));var moment=require(_0x5122('0x2'));var BPromise=require(_0x5122('0x3'));var rs=require(_0x5122('0x4'));var fs=require('fs');var Redis=require(_0x5122('0x5'));var db=require(_0x5122('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5122('0x7'))(_0x5122('0x8'));var config=require(_0x5122('0x9'));var jayson=require(_0x5122('0xa'));var client=jayson[_0x5122('0xb')][_0x5122('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3608e3,_0x47bc76,_0x440610){return new BPromise(function(_0x2b2e41,_0x4fd12f){return client[_0x5122('0xd')](_0x3608e3,_0x440610)[_0x5122('0xe')](function(_0x1b90f2){logger[_0x5122('0xf')](_0x5122('0x10'),_0x47bc76,_0x5122('0x11'));logger['debug'](_0x5122('0x12'),_0x47bc76,_0x5122('0x11'),JSON[_0x5122('0x13')](_0x1b90f2));if(_0x1b90f2[_0x5122('0x14')]){if(_0x1b90f2[_0x5122('0x14')]['code']===0x1f4){logger[_0x5122('0x14')](_0x5122('0x10'),_0x47bc76,_0x1b90f2[_0x5122('0x14')]['message']);return _0x4fd12f(_0x1b90f2[_0x5122('0x14')]['message']);}logger[_0x5122('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x47bc76,_0x1b90f2['error'][_0x5122('0x15')]);return _0x2b2e41(_0x1b90f2[_0x5122('0x14')]['message']);}else{logger[_0x5122('0xf')](_0x5122('0x10'),_0x47bc76,_0x5122('0x11'));_0x2b2e41(_0x1b90f2[_0x5122('0x16')][_0x5122('0x15')]);}})[_0x5122('0x17')](function(_0x5d4415){logger[_0x5122('0x14')](_0x5122('0x10'),_0x47bc76,_0x5d4415);_0x4fd12f(_0x5d4415);});});} \ No newline at end of file +var _0x74e3=['client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1e78ca,_0x1f6466){var _0x486a60=function(_0x109460){while(--_0x109460){_0x1e78ca['push'](_0x1e78ca['shift']());}};_0x486a60(++_0x1f6466);}(_0x74e3,0x187));var _0x374e=function(_0x7d9758,_0xf4d2eb){_0x7d9758=_0x7d9758-0x0;var _0x9e9815=_0x74e3[_0x7d9758];return _0x9e9815;};'use strict';var _=require('lodash');var util=require(_0x374e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x374e('0x1'));var fs=require('fs');var Redis=require(_0x374e('0x2'));var db=require(_0x374e('0x3'))['db'];var utils=require(_0x374e('0x4'));var logger=require(_0x374e('0x5'))(_0x374e('0x6'));var config=require('../../config/environment');var jayson=require(_0x374e('0x7'));var client=jayson[_0x374e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a0ad,_0x599fc1,_0xda1ee3){return new BPromise(function(_0x25d2bf,_0x4776de){return client[_0x374e('0x9')](_0x17a0ad,_0xda1ee3)[_0x374e('0xa')](function(_0x55fd63){logger[_0x374e('0xb')](_0x374e('0xc'),_0x599fc1,'request\x20sent');logger[_0x374e('0xd')](_0x374e('0xe'),_0x599fc1,'request\x20sent',JSON[_0x374e('0xf')](_0x55fd63));if(_0x55fd63[_0x374e('0x10')]){if(_0x55fd63[_0x374e('0x10')][_0x374e('0x11')]===0x1f4){logger[_0x374e('0x10')](_0x374e('0xc'),_0x599fc1,_0x55fd63[_0x374e('0x10')][_0x374e('0x12')]);return _0x4776de(_0x55fd63[_0x374e('0x10')]['message']);}logger[_0x374e('0x10')](_0x374e('0xc'),_0x599fc1,_0x55fd63[_0x374e('0x10')][_0x374e('0x12')]);return _0x25d2bf(_0x55fd63[_0x374e('0x10')][_0x374e('0x12')]);}else{logger['info'](_0x374e('0xc'),_0x599fc1,'request\x20sent');_0x25d2bf(_0x55fd63[_0x374e('0x13')][_0x374e('0x12')]);}})[_0x374e('0x14')](function(_0x590f07){logger[_0x374e('0x10')](_0x374e('0xc'),_0x599fc1,_0x590f07);_0x4776de(_0x590f07);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b2dbc14..a00cb06 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 _0x8589=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sounds','getSounds','post','put','/:id','delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout'];(function(_0x593943,_0x4ea58c){var _0x18f984=function(_0x2799b8){while(--_0x2799b8){_0x593943['push'](_0x593943['shift']());}};_0x18f984(++_0x4ea58c);}(_0x8589,0xb1));var _0x9858=function(_0x27656b,_0x18b3c7){_0x27656b=_0x27656b-0x0;var _0x2b47c8=_0x8589[_0x27656b];return _0x2b47c8;};'use strict';var multer=require(_0x9858('0x0'));var util=require(_0x9858('0x1'));var path=require('path');var timeout=require(_0x9858('0x2'));var express=require(_0x9858('0x3'));var router=express['Router']();var fs_extra=require(_0x9858('0x4'));var auth=require(_0x9858('0x5'));var interaction=require(_0x9858('0x6'));var config=require(_0x9858('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x9858('0x8')]('/',auth[_0x9858('0x9')](),controller[_0x9858('0xa')]);router[_0x9858('0x8')]('/:id',auth[_0x9858('0x9')](),controller['show']);router['get'](_0x9858('0xb'),auth[_0x9858('0x9')](),controller[_0x9858('0xc')]);router[_0x9858('0xd')]('/',auth[_0x9858('0x9')](),controller['create']);router[_0x9858('0xd')](_0x9858('0xb'),auth[_0x9858('0x9')](),controller['addSound']);router[_0x9858('0xe')](_0x9858('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9858('0x10')](_0x9858('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x9858('0x10')](_0x9858('0x11'),auth[_0x9858('0x9')](),controller[_0x9858('0x12')]);module[_0x9858('0x13')]=router; \ No newline at end of file +var _0xa543=['post','create','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds'];(function(_0x2e67f7,_0x3111ab){var _0x175e11=function(_0x7619){while(--_0x7619){_0x2e67f7['push'](_0x2e67f7['shift']());}};_0x175e11(++_0x3111ab);}(_0xa543,0x11d));var _0x3a54=function(_0x34ad33,_0x37ff19){_0x34ad33=_0x34ad33-0x0;var _0x2c629e=_0xa543[_0x34ad33];return _0x2c629e;};'use strict';var multer=require('multer');var util=require(_0x3a54('0x0'));var path=require('path');var timeout=require(_0x3a54('0x1'));var express=require(_0x3a54('0x2'));var router=express[_0x3a54('0x3')]();var fs_extra=require(_0x3a54('0x4'));var auth=require(_0x3a54('0x5'));var interaction=require(_0x3a54('0x6'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x3a54('0x7')]('/',auth[_0x3a54('0x8')](),controller[_0x3a54('0x9')]);router['get'](_0x3a54('0xa'),auth['isAuthenticated'](),controller[_0x3a54('0xb')]);router[_0x3a54('0x7')](_0x3a54('0xc'),auth['isAuthenticated'](),controller[_0x3a54('0xd')]);router[_0x3a54('0xe')]('/',auth[_0x3a54('0x8')](),controller[_0x3a54('0xf')]);router[_0x3a54('0xe')]('/:id/sounds',auth[_0x3a54('0x8')](),controller['addSound']);router[_0x3a54('0x10')](_0x3a54('0xa'),auth[_0x3a54('0x8')](),controller[_0x3a54('0x11')]);router[_0x3a54('0x12')]('/:id',auth[_0x3a54('0x8')](),controller[_0x3a54('0x13')]);router[_0x3a54('0x12')](_0x3a54('0x14'),auth[_0x3a54('0x8')](),controller[_0x3a54('0x15')]);module[_0x3a54('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index b86672d..4cbab76 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 _0x5f5b=['files','mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','custom'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f5b,0xec));var _0xb5f5=function(_0x305010,_0x54c9e3){_0x305010=_0x305010-0x0;var _0x46aa73=_0x5f5b[_0x305010];return _0x46aa73;};'use strict';var Sequelize=require('sequelize');module[_0xb5f5('0x0')]={'name':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':![],'unique':_0xb5f5('0x2')},'mode':{'type':Sequelize['ENUM'](_0xb5f5('0x3'),_0xb5f5('0x4'),_0xb5f5('0x5'),'quietmp3nb',_0xb5f5('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0xb5f5('0x4')},'directory':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![],'defaultValue':_0xb5f5('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb5f5('0x8')},'defaultEntry':{'type':Sequelize[_0xb5f5('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9a6=['quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','ENUM','files','mp3nb'];(function(_0x150ea6,_0x44495e){var _0x3c26aa=function(_0x335f31){while(--_0x335f31){_0x150ea6['push'](_0x150ea6['shift']());}};_0x3c26aa(++_0x44495e);}(_0xa9a6,0x94));var _0x6a9a=function(_0x5ed922,_0x1e165c){_0x5ed922=_0x5ed922-0x0;var _0x218492=_0xa9a6[_0x5ed922];return _0x218492;};'use strict';var Sequelize=require(_0x6a9a('0x0'));module[_0x6a9a('0x1')]={'name':{'type':Sequelize[_0x6a9a('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x6a9a('0x3')]('custom',_0x6a9a('0x4'),_0x6a9a('0x5'),_0x6a9a('0x6'),_0x6a9a('0x7'),_0x6a9a('0x8')),'allowNull':!![],'defaultValue':_0x6a9a('0x4')},'directory':{'type':Sequelize[_0x6a9a('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x6a9a('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6a9a('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x6a9a('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 838982b..6c38160 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 _0x8c40=['server/files/moh','%s.%s','symlinkSync','Sequelize','removeSound','findOne','id2','converted_format','createdAt','ValidationError','rawAttributes','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','map','type','key','query','keys','model','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceMusicOnHold','includeAll','findAll','catch','params','attributes','length','find','body','create','transaction','mode','files','directory','join','root','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','message','addSound','Sound','save_name','server/files/sounds/converted','format','basename','extname'];(function(_0x5aa0e3,_0x5088f7){var _0xef1132=function(_0x57a942){while(--_0x57a942){_0x5aa0e3['push'](_0x5aa0e3['shift']());}};_0xef1132(++_0x5088f7);}(_0x8c40,0x15c));var _0x08c4=function(_0xa05bd8,_0x2d5c8b){_0xa05bd8=_0xa05bd8-0x0;var _0x415cb7=_0x8c40[_0xa05bd8];return _0x415cb7;};'use strict';var emlformat=require(_0x08c4('0x0'));var rimraf=require(_0x08c4('0x1'));var zipdir=require(_0x08c4('0x2'));var jsonpatch=require(_0x08c4('0x3'));var rp=require('request-promise');var moment=require(_0x08c4('0x4'));var BPromise=require(_0x08c4('0x5'));var Mustache=require('mustache');var util=require(_0x08c4('0x6'));var path=require(_0x08c4('0x7'));var sox=require(_0x08c4('0x8'));var csv=require(_0x08c4('0x9'));var ejs=require(_0x08c4('0xa'));var fs=require('fs');var fs_extra=require(_0x08c4('0xb'));var _=require('lodash');var squel=require(_0x08c4('0xc'));var crypto=require(_0x08c4('0xd'));var jsforce=require(_0x08c4('0xe'));var deskjs=require(_0x08c4('0xf'));var toCsv=require(_0x08c4('0x9'));var querystring=require(_0x08c4('0x10'));var Papa=require(_0x08c4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x08c4('0x12'));var as=require(_0x08c4('0x13'));var hardwareService=require(_0x08c4('0x14'));var logger=require(_0x08c4('0x15'))(_0x08c4('0x16'));var utils=require(_0x08c4('0x17'));var config=require(_0x08c4('0x18'));var licenseUtil=require(_0x08c4('0x19'));var db=require(_0x08c4('0x1a'))['db'];function respondWithStatusCode(_0xe2599d,_0x347590){_0x347590=_0x347590||0xcc;return function(_0x4dc779){if(_0x4dc779){return _0xe2599d[_0x08c4('0x1b')](_0x347590);}return _0xe2599d[_0x08c4('0x1c')](_0x347590)[_0x08c4('0x1d')]();};}function respondWithResult(_0x51bffa,_0x4edec0){_0x4edec0=_0x4edec0||0xc8;return function(_0x5670d0){if(_0x5670d0){return _0x51bffa[_0x08c4('0x1c')](_0x4edec0)[_0x08c4('0x1e')](_0x5670d0);}};}function respondWithFilteredResult(_0x1b368e,_0x54a51d){return function(_0x5a6aa3){if(_0x5a6aa3){var _0xc937c8=typeof _0x54a51d[_0x08c4('0x1f')]==='undefined'&&typeof _0x54a51d[_0x08c4('0x20')]===_0x08c4('0x21');var _0x4be50b=_0x5a6aa3[_0x08c4('0x22')];var _0x194370=_0xc937c8?0x0:_0x54a51d[_0x08c4('0x1f')];var _0x2cb077=_0xc937c8?_0x5a6aa3[_0x08c4('0x22')]:_0x54a51d[_0x08c4('0x1f')]+_0x54a51d[_0x08c4('0x20')];var _0xeeb2df;if(_0x2cb077>=_0x4be50b){_0x2cb077=_0x4be50b;_0xeeb2df=0xc8;}else{_0xeeb2df=0xce;}_0x1b368e[_0x08c4('0x1c')](_0xeeb2df);return _0x1b368e[_0x08c4('0x23')](_0x08c4('0x24'),_0x194370+'-'+_0x2cb077+'/'+_0x4be50b)[_0x08c4('0x1e')](_0x5a6aa3);}return null;};}function patchUpdates(_0x26261d){return function(_0x12347f){try{jsonpatch[_0x08c4('0x25')](_0x12347f,_0x26261d,!![]);}catch(_0x27187a){return BPromise[_0x08c4('0x26')](_0x27187a);}return _0x12347f['save']();};}function saveUpdates(_0x34172b,_0x27e329){return function(_0x41c146){if(_0x41c146){return _0x41c146[_0x08c4('0x27')](_0x34172b)[_0x08c4('0x28')](function(_0x197a2e){return _0x197a2e;});}return null;};}function removeEntity(_0x3c807c,_0x70a747){return function(_0x48af1a){if(_0x48af1a){return _0x48af1a[_0x08c4('0x29')]()[_0x08c4('0x28')](function(){var _0x5da193=_0x48af1a[_0x08c4('0x2a')]({'plain':!![]});var _0x58e7c4='MusicOnHolds';return db[_0x08c4('0x2b')][_0x08c4('0x29')]({'where':{'type':_0x58e7c4,'resourceId':_0x5da193['id']}})['then'](function(){return _0x48af1a;});})['then'](function(){_0x3c807c['status'](0xcc)[_0x08c4('0x1d')]();});}};}function handleEntityNotFound(_0x49a02f,_0x25ea16){return function(_0x63d384){if(!_0x63d384){_0x49a02f[_0x08c4('0x1b')](0x194);}return _0x63d384;};}function handleError(_0x2a356e,_0x22b0b1){_0x22b0b1=_0x22b0b1||0x1f4;return function(_0x26878f){logger[_0x08c4('0x2c')](_0x26878f[_0x08c4('0x2d')]);if(_0x26878f['name']){delete _0x26878f[_0x08c4('0x2e')];}_0x2a356e[_0x08c4('0x1c')](_0x22b0b1)['send'](_0x26878f);};}exports['index']=function(_0x491bc2,_0x570d56){var _0x5c7e38={},_0x332dbc={},_0x167f24={'count':0x0,'rows':[]};var _0x32dc8a=_[_0x08c4('0x2f')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x5e1394){return{'name':_0x5e1394['fieldName'],'type':_0x5e1394[_0x08c4('0x30')][_0x08c4('0x31')]};});_0x332dbc['model']=_[_0x08c4('0x2f')](_0x32dc8a,'name');_0x332dbc[_0x08c4('0x32')]=_[_0x08c4('0x33')](_0x491bc2['query']);_0x332dbc['filters']=_['intersection'](_0x332dbc[_0x08c4('0x34')],_0x332dbc[_0x08c4('0x32')]);_0x5c7e38['attributes']=_[_0x08c4('0x35')](_0x332dbc['model'],qs['fields'](_0x491bc2[_0x08c4('0x32')][_0x08c4('0x36')]));_0x5c7e38['attributes']=_0x5c7e38['attributes']['length']?_0x5c7e38['attributes']:_0x332dbc[_0x08c4('0x34')];if(!_0x491bc2[_0x08c4('0x32')][_0x08c4('0x37')](_0x08c4('0x38'))){_0x5c7e38[_0x08c4('0x20')]=qs[_0x08c4('0x20')](_0x491bc2[_0x08c4('0x32')][_0x08c4('0x20')]);_0x5c7e38[_0x08c4('0x1f')]=qs[_0x08c4('0x1f')](_0x491bc2['query']['offset']);}_0x5c7e38[_0x08c4('0x39')]=qs[_0x08c4('0x3a')](_0x491bc2[_0x08c4('0x32')]['sort']);delete _0x491bc2[_0x08c4('0x32')][_0x08c4('0x3a')];_0x5c7e38[_0x08c4('0x3b')]=qs[_0x08c4('0x3c')](_[_0x08c4('0x3d')](_0x491bc2['query'],_0x332dbc[_0x08c4('0x3c')]),_0x32dc8a);if(_0x491bc2[_0x08c4('0x32')][_0x08c4('0x3e')]){_0x5c7e38[_0x08c4('0x3b')]=_[_0x08c4('0x3f')](_0x5c7e38[_0x08c4('0x3b')],{'$or':_[_0x08c4('0x2f')](_0x32dc8a,function(_0x2cca4b){if(_0x2cca4b[_0x08c4('0x30')]!=='VIRTUAL'){var _0x351d25={};_0x351d25[_0x2cca4b['name']]={'$like':'%'+_0x491bc2['query'][_0x08c4('0x3e')]+'%'};return _0x351d25;}})});}_0x5c7e38=_[_0x08c4('0x3f')]({},_0x5c7e38,_0x491bc2[_0x08c4('0x40')]);var _0x149d85={'where':_0x5c7e38[_0x08c4('0x3b')]};return db[_0x08c4('0x41')]['count'](_0x149d85)['then'](function(_0x15900f){_0x167f24['count']=_0x15900f;if(_0x491bc2['query'][_0x08c4('0x42')]){_0x5c7e38['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x08c4('0x43')](_0x5c7e38);})['then'](function(_0xe47377){_0x167f24['rows']=_0xe47377;return _0x167f24;})[_0x08c4('0x28')](respondWithFilteredResult(_0x570d56,_0x5c7e38))[_0x08c4('0x44')](handleError(_0x570d56,null));};exports['show']=function(_0x17535e,_0x23b786){var _0x2d3b54={'raw':![],'where':{'id':_0x17535e[_0x08c4('0x45')]['id']}},_0x55b015={};_0x55b015[_0x08c4('0x34')]=_[_0x08c4('0x33')](db[_0x08c4('0x41')]['rawAttributes']);_0x55b015[_0x08c4('0x32')]=_['keys'](_0x17535e[_0x08c4('0x32')]);_0x55b015[_0x08c4('0x3c')]=_[_0x08c4('0x35')](_0x55b015[_0x08c4('0x34')],_0x55b015['query']);_0x2d3b54[_0x08c4('0x46')]=_[_0x08c4('0x35')](_0x55b015[_0x08c4('0x34')],qs[_0x08c4('0x36')](_0x17535e[_0x08c4('0x32')][_0x08c4('0x36')]));_0x2d3b54[_0x08c4('0x46')]=_0x2d3b54['attributes'][_0x08c4('0x47')]?_0x2d3b54['attributes']:_0x55b015[_0x08c4('0x34')];if(_0x17535e['query'][_0x08c4('0x42')]){_0x2d3b54['include']=[{'all':!![]}];}_0x2d3b54=_['merge']({},_0x2d3b54,_0x17535e[_0x08c4('0x40')]);return db[_0x08c4('0x41')][_0x08c4('0x48')](_0x2d3b54)[_0x08c4('0x28')](handleEntityNotFound(_0x23b786,null))['then'](respondWithResult(_0x23b786,null))[_0x08c4('0x44')](handleError(_0x23b786,null));};exports[_0x08c4('0x27')]=function(_0x5adc95,_0x4db1aa){if(_0x5adc95['body']['id']){delete _0x5adc95[_0x08c4('0x49')]['id'];}return db[_0x08c4('0x41')][_0x08c4('0x48')]({'where':{'id':_0x5adc95[_0x08c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4db1aa,null))[_0x08c4('0x28')](saveUpdates(_0x5adc95[_0x08c4('0x49')],null))['then'](respondWithResult(_0x4db1aa,null))[_0x08c4('0x44')](handleError(_0x4db1aa,null));};exports[_0x08c4('0x4a')]=function(_0x72d802,_0x46ea02,_0x3c43f7){return db['sequelize'][_0x08c4('0x4b')](function(_0x105712){if(_0x72d802['body'][_0x08c4('0x4c')]===_0x08c4('0x4d')){_0x72d802[_0x08c4('0x49')][_0x08c4('0x4e')]=path[_0x08c4('0x4f')](config[_0x08c4('0x50')],'server/files/moh',_0x72d802[_0x08c4('0x49')]['name']);}return db[_0x08c4('0x41')][_0x08c4('0x4a')](_0x72d802[_0x08c4('0x49')],{'transaction':_0x105712})['then'](function(_0x419f95){if(_0x72d802[_0x08c4('0x49')][_0x08c4('0x4c')]===_0x08c4('0x4d')){fs['mkdirSync'](_0x419f95['directory'],parseInt('0777',0x8));}var _0x5c7eb2=_0x72d802['user'][_0x08c4('0x2a')]({'plain':!![]});if(!_0x5c7eb2)throw new Error(_0x08c4('0x51'));if(_0x5c7eb2[_0x08c4('0x52')]==='user'){var _0x59a5cc=_0x419f95[_0x08c4('0x2a')]({'plain':!![]});return db[_0x08c4('0x53')][_0x08c4('0x48')]({'where':{'name':_0x08c4('0x54'),'userProfileId':_0x5c7eb2[_0x08c4('0x55')]},'raw':!![]})[_0x08c4('0x28')](function(_0x5918bd){if(_0x5918bd&&_0x5918bd[_0x08c4('0x56')]===0x0){return db[_0x08c4('0x2b')][_0x08c4('0x4a')]({'name':_0x59a5cc[_0x08c4('0x2e')],'resourceId':_0x59a5cc['id'],'type':_0x5918bd[_0x08c4('0x2e')],'sectionId':_0x5918bd['id']},{})['then'](function(){return _0x419f95;});}else{return _0x419f95;}})['catch'](function(_0x5054f2){logger[_0x08c4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5054f2);});}return _0x419f95;});})[_0x08c4('0x28')](respondWithResult(_0x46ea02,0xc9))[_0x08c4('0x44')](handleError(_0x46ea02,null));};exports[_0x08c4('0x29')]=function(_0x39eeff,_0x482913,_0x5d94cd){var _0xe036ac;return db[_0x08c4('0x41')][_0x08c4('0x48')]({'where':{'id':_0x39eeff['params']['id']}})[_0x08c4('0x28')](function(_0x9108a0){if(_0x9108a0){return db[_0x08c4('0x57')][_0x08c4('0x4b')](function(_0x402e49){return _0x9108a0[_0x08c4('0x29')]({'transaction':_0x402e49,'raw':!![]})[_0x08c4('0x28')](function(_0x1beb2d){if(_0x1beb2d[_0x08c4('0x4e')]){fs[_0x08c4('0x58')](_0x1beb2d[_0x08c4('0x4e')])[_0x08c4('0x59')](function(_0x2925d4){fs[_0x08c4('0x5a')](path[_0x08c4('0x4f')](_0x1beb2d['directory'],_0x2925d4));});fs[_0x08c4('0x5b')](_0x1beb2d[_0x08c4('0x4e')]);}return _0x1beb2d;});})['catch'](function(_0x1eff48){throw new db['Sequelize']['ValidationError'](_0x1eff48[_0x08c4('0x5c')]);});}})[_0x08c4('0x28')](handleEntityNotFound(_0x482913,null))[_0x08c4('0x28')](removeEntity(_0x482913,null))[_0x08c4('0x44')](handleError(_0x482913,null));};exports[_0x08c4('0x5d')]=function(_0x498bed,_0x4b4ca,_0x471585){return db['sequelize']['transaction'](function(_0x4bb13c){var _0x4830cb;return db['VoiceMusicOnHold'][_0x08c4('0x48')]({'where':{'id':_0x498bed[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](function(_0x15cf00){if(_0x15cf00){_0x4830cb=_0x15cf00;return _0x15cf00[_0x08c4('0x5d')](_0x498bed['body']['id'],{'transaction':_0x4bb13c});}})[_0x08c4('0x28')](function(_0xdbed57){if(_0xdbed57){return db[_0x08c4('0x5e')]['findOne']({'where':{'id':_0x498bed['body']['id']},'attributes':['id',_0x08c4('0x2e'),_0x08c4('0x5f'),'converted_format','createdAt'],'raw':!![]});}})[_0x08c4('0x28')](function(_0x474e9){if(_0x474e9){var _0x46483e=path['join'](config[_0x08c4('0x50')],_0x08c4('0x60'),util[_0x08c4('0x61')]('%s.%s',path[_0x08c4('0x62')](_0x474e9[_0x08c4('0x5f')],path[_0x08c4('0x63')](_0x474e9[_0x08c4('0x5f')])),_0x474e9['converted_format']));var _0x41d422=path[_0x08c4('0x4f')](config[_0x08c4('0x50')],_0x08c4('0x64'),_0x4830cb['name'],util['format'](_0x08c4('0x65'),_0x474e9[_0x08c4('0x2e')],_0x474e9['converted_format']));fs[_0x08c4('0x66')](_0x46483e,_0x41d422);return _0x474e9;}})['catch'](function(_0x19baa0){throw new db[(_0x08c4('0x67'))]['ValidationError'](_0x19baa0[_0x08c4('0x5c')]);});})[_0x08c4('0x28')](handleEntityNotFound(_0x4b4ca,null))[_0x08c4('0x28')](respondWithResult(_0x4b4ca,0xc9))[_0x08c4('0x44')](handleError(_0x4b4ca,null));};exports[_0x08c4('0x68')]=function(_0x3cc610,_0x4510f5,_0x2020db){return db['sequelize'][_0x08c4('0x4b')](function(_0x244d41){var _0x18ef2f;return db[_0x08c4('0x41')][_0x08c4('0x69')]({'where':{'id':_0x3cc610[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](handleEntityNotFound(_0x4510f5,null))['then'](function(_0x2b9325){if(_0x2b9325){_0x18ef2f=_0x2b9325;return _0x2b9325[_0x08c4('0x68')](_0x3cc610[_0x08c4('0x45')][_0x08c4('0x6a')]);}})[_0x08c4('0x28')](function(_0x165b38){if(_0x165b38){return db[_0x08c4('0x5e')][_0x08c4('0x69')]({'where':{'id':_0x3cc610[_0x08c4('0x45')][_0x08c4('0x6a')]},'attributes':['id',_0x08c4('0x2e'),_0x08c4('0x5f'),_0x08c4('0x6b'),_0x08c4('0x6c')],'raw':!![]});}})[_0x08c4('0x28')](function(_0x587799){if(_0x587799){fs[_0x08c4('0x5a')](path[_0x08c4('0x4f')](_0x18ef2f[_0x08c4('0x4e')],util[_0x08c4('0x61')](_0x08c4('0x65'),_0x587799[_0x08c4('0x2e')],_0x587799['converted_format'])));return _0x587799;}})[_0x08c4('0x44')](function(_0x4d3ad3){throw new db['Sequelize'][(_0x08c4('0x6d'))](_0x4d3ad3[_0x08c4('0x5c')]);});})[_0x08c4('0x28')](handleEntityNotFound(_0x4510f5,null))[_0x08c4('0x28')](respondWithStatusCode(_0x4510f5,0xcc))[_0x08c4('0x44')](handleError(_0x4510f5,null));};exports['getSounds']=function(_0x582988,_0x15e09f,_0x21a2e5){var _0x5e3df3={};var _0x4fbf1b={};var _0x46bdad;var _0x2b638e;return db[_0x08c4('0x41')][_0x08c4('0x69')]({'where':{'id':_0x582988[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](handleEntityNotFound(_0x15e09f,null))[_0x08c4('0x28')](function(_0x5d07be){if(_0x5d07be){_0x46bdad=_0x5d07be;_0x4fbf1b['model']=_[_0x08c4('0x33')](db[_0x08c4('0x5e')][_0x08c4('0x6e')]);_0x4fbf1b[_0x08c4('0x32')]=_['keys'](_0x582988[_0x08c4('0x32')]);_0x4fbf1b['filters']=_[_0x08c4('0x35')](_0x4fbf1b[_0x08c4('0x34')],_0x4fbf1b[_0x08c4('0x32')]);_0x5e3df3[_0x08c4('0x46')]=_['intersection'](_0x4fbf1b['model'],qs[_0x08c4('0x36')](_0x582988['query'][_0x08c4('0x36')]));_0x5e3df3[_0x08c4('0x46')]=_0x5e3df3['attributes'][_0x08c4('0x47')]?_0x5e3df3[_0x08c4('0x46')]:_0x4fbf1b[_0x08c4('0x34')];_0x5e3df3[_0x08c4('0x39')]=qs['sort'](_0x582988[_0x08c4('0x32')][_0x08c4('0x3a')]);_0x5e3df3[_0x08c4('0x3b')]=qs[_0x08c4('0x3c')](_[_0x08c4('0x3d')](_0x582988[_0x08c4('0x32')],_0x4fbf1b[_0x08c4('0x3c')]));if(_0x582988[_0x08c4('0x32')][_0x08c4('0x3e')]){_0x5e3df3[_0x08c4('0x3b')]=_['merge'](_0x5e3df3[_0x08c4('0x3b')],{'$or':_['map'](_0x5e3df3[_0x08c4('0x46')],function(_0x496337){var _0x33c3ed={};_0x33c3ed[_0x496337]={'$like':'%'+_0x582988[_0x08c4('0x32')][_0x08c4('0x3e')]+'%'};return _0x33c3ed;})});}_0x5e3df3=_[_0x08c4('0x3f')]({},_0x5e3df3,_0x582988[_0x08c4('0x40')]);return _0x46bdad[_0x08c4('0x6f')](_0x5e3df3);}})[_0x08c4('0x28')](function(_0x20177e){if(_0x20177e){_0x2b638e=_0x20177e[_0x08c4('0x47')];if(!_0x582988[_0x08c4('0x32')][_0x08c4('0x37')](_0x08c4('0x38'))){_0x5e3df3[_0x08c4('0x20')]=qs[_0x08c4('0x20')](_0x582988[_0x08c4('0x32')][_0x08c4('0x20')]);_0x5e3df3[_0x08c4('0x1f')]=qs[_0x08c4('0x1f')](_0x582988[_0x08c4('0x32')][_0x08c4('0x1f')]);}return _0x46bdad[_0x08c4('0x6f')](_0x5e3df3);}})[_0x08c4('0x28')](function(_0xcabdc3){if(_0xcabdc3){return _0xcabdc3?{'count':_0x2b638e,'rows':_0xcabdc3}:null;}})[_0x08c4('0x28')](respondWithResult(_0x15e09f,null))[_0x08c4('0x44')](handleError(_0x15e09f,null));}; \ No newline at end of file +var _0x8d60=['UserProfileResource','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','update','body','create','sequelize','mode','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','extname','converted_format','symlinkSync','removeSound','id2','Sound','order','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','then','get'];(function(_0x11b34c,_0x3927d1){var _0x3fc1d3=function(_0x4dd148){while(--_0x4dd148){_0x11b34c['push'](_0x11b34c['shift']());}};_0x3fc1d3(++_0x3927d1);}(_0x8d60,0x1a2));var _0x08d6=function(_0x3c6ba1,_0x3443cc){_0x3c6ba1=_0x3c6ba1-0x0;var _0x463e78=_0x8d60[_0x3c6ba1];return _0x463e78;};'use strict';var emlformat=require(_0x08d6('0x0'));var rimraf=require(_0x08d6('0x1'));var zipdir=require(_0x08d6('0x2'));var jsonpatch=require(_0x08d6('0x3'));var rp=require(_0x08d6('0x4'));var moment=require(_0x08d6('0x5'));var BPromise=require(_0x08d6('0x6'));var Mustache=require(_0x08d6('0x7'));var util=require(_0x08d6('0x8'));var path=require(_0x08d6('0x9'));var sox=require(_0x08d6('0xa'));var csv=require(_0x08d6('0xb'));var ejs=require(_0x08d6('0xc'));var fs=require('fs');var fs_extra=require(_0x08d6('0xd'));var _=require(_0x08d6('0xe'));var squel=require('squel');var crypto=require(_0x08d6('0xf'));var jsforce=require(_0x08d6('0x10'));var deskjs=require(_0x08d6('0x11'));var toCsv=require(_0x08d6('0xb'));var querystring=require(_0x08d6('0x12'));var Papa=require(_0x08d6('0x13'));var Redis=require('ioredis');var authService=require(_0x08d6('0x14'));var qs=require(_0x08d6('0x15'));var as=require(_0x08d6('0x16'));var hardwareService=require(_0x08d6('0x17'));var logger=require(_0x08d6('0x18'))(_0x08d6('0x19'));var utils=require(_0x08d6('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x08d6('0x1b'));var db=require(_0x08d6('0x1c'))['db'];function respondWithStatusCode(_0x5d5d17,_0x44093b){_0x44093b=_0x44093b||0xcc;return function(_0x3a9326){if(_0x3a9326){return _0x5d5d17['sendStatus'](_0x44093b);}return _0x5d5d17[_0x08d6('0x1d')](_0x44093b)[_0x08d6('0x1e')]();};}function respondWithResult(_0x260145,_0x52c90c){_0x52c90c=_0x52c90c||0xc8;return function(_0x179075){if(_0x179075){return _0x260145[_0x08d6('0x1d')](_0x52c90c)[_0x08d6('0x1f')](_0x179075);}};}function respondWithFilteredResult(_0x5d0da9,_0xb8dec1){return function(_0x5f25b9){if(_0x5f25b9){var _0x42ac1e=typeof _0xb8dec1[_0x08d6('0x20')]===_0x08d6('0x21')&&typeof _0xb8dec1[_0x08d6('0x22')]===_0x08d6('0x21');var _0x2d706d=_0x5f25b9['count'];var _0x31919a=_0x42ac1e?0x0:_0xb8dec1[_0x08d6('0x20')];var _0x3d7422=_0x42ac1e?_0x5f25b9[_0x08d6('0x23')]:_0xb8dec1[_0x08d6('0x20')]+_0xb8dec1[_0x08d6('0x22')];var _0x4db283;if(_0x3d7422>=_0x2d706d){_0x3d7422=_0x2d706d;_0x4db283=0xc8;}else{_0x4db283=0xce;}_0x5d0da9[_0x08d6('0x1d')](_0x4db283);return _0x5d0da9['set'](_0x08d6('0x24'),_0x31919a+'-'+_0x3d7422+'/'+_0x2d706d)[_0x08d6('0x1f')](_0x5f25b9);}return null;};}function patchUpdates(_0x24e09d){return function(_0x31216b){try{jsonpatch[_0x08d6('0x25')](_0x31216b,_0x24e09d,!![]);}catch(_0x3ae949){return BPromise[_0x08d6('0x26')](_0x3ae949);}return _0x31216b['save']();};}function saveUpdates(_0x25cfa2,_0x46d0fd){return function(_0x496795){if(_0x496795){return _0x496795['update'](_0x25cfa2)['then'](function(_0x3def2d){return _0x3def2d;});}return null;};}function removeEntity(_0x118cf1,_0x43127d){return function(_0x1e7702){if(_0x1e7702){return _0x1e7702[_0x08d6('0x27')]()[_0x08d6('0x28')](function(){var _0x445403=_0x1e7702[_0x08d6('0x29')]({'plain':!![]});var _0x333866='MusicOnHolds';return db[_0x08d6('0x2a')][_0x08d6('0x27')]({'where':{'type':_0x333866,'resourceId':_0x445403['id']}})['then'](function(){return _0x1e7702;});})['then'](function(){_0x118cf1[_0x08d6('0x1d')](0xcc)[_0x08d6('0x1e')]();});}};}function handleEntityNotFound(_0x2e5e4a,_0x2be1b3){return function(_0x2f7771){if(!_0x2f7771){_0x2e5e4a[_0x08d6('0x2b')](0x194);}return _0x2f7771;};}function handleError(_0x712433,_0xc5f131){_0xc5f131=_0xc5f131||0x1f4;return function(_0x2ffae0){logger[_0x08d6('0x2c')](_0x2ffae0[_0x08d6('0x2d')]);if(_0x2ffae0[_0x08d6('0x2e')]){delete _0x2ffae0[_0x08d6('0x2e')];}_0x712433[_0x08d6('0x1d')](_0xc5f131)['send'](_0x2ffae0);};}exports[_0x08d6('0x2f')]=function(_0x2abc56,_0x566b77){var _0x377983={},_0x52b665={},_0x2cfa59={'count':0x0,'rows':[]};var _0xc967fc=_[_0x08d6('0x30')](db[_0x08d6('0x31')][_0x08d6('0x32')],function(_0x36fc2f){return{'name':_0x36fc2f[_0x08d6('0x33')],'type':_0x36fc2f[_0x08d6('0x34')][_0x08d6('0x35')]};});_0x52b665[_0x08d6('0x36')]=_['map'](_0xc967fc,'name');_0x52b665[_0x08d6('0x37')]=_['keys'](_0x2abc56[_0x08d6('0x37')]);_0x52b665[_0x08d6('0x38')]=_[_0x08d6('0x39')](_0x52b665[_0x08d6('0x36')],_0x52b665[_0x08d6('0x37')]);_0x377983[_0x08d6('0x3a')]=_['intersection'](_0x52b665[_0x08d6('0x36')],qs[_0x08d6('0x3b')](_0x2abc56['query'][_0x08d6('0x3b')]));_0x377983[_0x08d6('0x3a')]=_0x377983[_0x08d6('0x3a')][_0x08d6('0x3c')]?_0x377983[_0x08d6('0x3a')]:_0x52b665[_0x08d6('0x36')];if(!_0x2abc56['query'][_0x08d6('0x3d')](_0x08d6('0x3e'))){_0x377983[_0x08d6('0x22')]=qs[_0x08d6('0x22')](_0x2abc56[_0x08d6('0x37')][_0x08d6('0x22')]);_0x377983['offset']=qs[_0x08d6('0x20')](_0x2abc56[_0x08d6('0x37')][_0x08d6('0x20')]);}_0x377983['order']=qs[_0x08d6('0x3f')](_0x2abc56['query']['sort']);delete _0x2abc56['query'][_0x08d6('0x3f')];_0x377983[_0x08d6('0x40')]=qs['filters'](_[_0x08d6('0x41')](_0x2abc56[_0x08d6('0x37')],_0x52b665['filters']),_0xc967fc);if(_0x2abc56[_0x08d6('0x37')][_0x08d6('0x42')]){_0x377983[_0x08d6('0x40')]=_[_0x08d6('0x43')](_0x377983[_0x08d6('0x40')],{'$or':_['map'](_0xc967fc,function(_0x80d5bd){if(_0x80d5bd[_0x08d6('0x34')]!=='VIRTUAL'){var _0x4ff6e7={};_0x4ff6e7[_0x80d5bd['name']]={'$like':'%'+_0x2abc56['query'][_0x08d6('0x42')]+'%'};return _0x4ff6e7;}})});}_0x377983=_[_0x08d6('0x43')]({},_0x377983,_0x2abc56[_0x08d6('0x44')]);var _0x1062a0={'where':_0x377983[_0x08d6('0x40')]};return db[_0x08d6('0x31')][_0x08d6('0x23')](_0x1062a0)['then'](function(_0x58acda){_0x2cfa59[_0x08d6('0x23')]=_0x58acda;if(_0x2abc56['query'][_0x08d6('0x45')]){_0x377983[_0x08d6('0x46')]=[{'all':!![]}];}return db[_0x08d6('0x31')][_0x08d6('0x47')](_0x377983);})[_0x08d6('0x28')](function(_0xa170d){_0x2cfa59['rows']=_0xa170d;return _0x2cfa59;})[_0x08d6('0x28')](respondWithFilteredResult(_0x566b77,_0x377983))[_0x08d6('0x48')](handleError(_0x566b77,null));};exports[_0x08d6('0x49')]=function(_0x19d8c0,_0x13ad45){var _0x5e794f={'raw':![],'where':{'id':_0x19d8c0[_0x08d6('0x4a')]['id']}},_0x5745a1={};_0x5745a1[_0x08d6('0x36')]=_[_0x08d6('0x4b')](db[_0x08d6('0x31')][_0x08d6('0x32')]);_0x5745a1[_0x08d6('0x37')]=_[_0x08d6('0x4b')](_0x19d8c0[_0x08d6('0x37')]);_0x5745a1[_0x08d6('0x38')]=_[_0x08d6('0x39')](_0x5745a1[_0x08d6('0x36')],_0x5745a1[_0x08d6('0x37')]);_0x5e794f[_0x08d6('0x3a')]=_['intersection'](_0x5745a1[_0x08d6('0x36')],qs[_0x08d6('0x3b')](_0x19d8c0[_0x08d6('0x37')][_0x08d6('0x3b')]));_0x5e794f[_0x08d6('0x3a')]=_0x5e794f[_0x08d6('0x3a')][_0x08d6('0x3c')]?_0x5e794f['attributes']:_0x5745a1[_0x08d6('0x36')];if(_0x19d8c0['query'][_0x08d6('0x45')]){_0x5e794f[_0x08d6('0x46')]=[{'all':!![]}];}_0x5e794f=_[_0x08d6('0x43')]({},_0x5e794f,_0x19d8c0[_0x08d6('0x44')]);return db[_0x08d6('0x31')][_0x08d6('0x4c')](_0x5e794f)[_0x08d6('0x28')](handleEntityNotFound(_0x13ad45,null))[_0x08d6('0x28')](respondWithResult(_0x13ad45,null))[_0x08d6('0x48')](handleError(_0x13ad45,null));};exports[_0x08d6('0x4d')]=function(_0x3b7cb4,_0x273a84){if(_0x3b7cb4[_0x08d6('0x4e')]['id']){delete _0x3b7cb4['body']['id'];}return db[_0x08d6('0x31')]['find']({'where':{'id':_0x3b7cb4[_0x08d6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x273a84,null))[_0x08d6('0x28')](saveUpdates(_0x3b7cb4[_0x08d6('0x4e')],null))[_0x08d6('0x28')](respondWithResult(_0x273a84,null))['catch'](handleError(_0x273a84,null));};exports[_0x08d6('0x4f')]=function(_0x21813a,_0x15384f,_0x4684dd){return db[_0x08d6('0x50')]['transaction'](function(_0x5c82ce){if(_0x21813a[_0x08d6('0x4e')][_0x08d6('0x51')]==='files'){_0x21813a[_0x08d6('0x4e')][_0x08d6('0x52')]=path[_0x08d6('0x53')](config[_0x08d6('0x54')],_0x08d6('0x55'),_0x21813a[_0x08d6('0x4e')][_0x08d6('0x2e')]);}return db[_0x08d6('0x31')][_0x08d6('0x4f')](_0x21813a[_0x08d6('0x4e')],{'transaction':_0x5c82ce})[_0x08d6('0x28')](function(_0x3c20f2){if(_0x21813a[_0x08d6('0x4e')][_0x08d6('0x51')]==='files'){fs[_0x08d6('0x56')](_0x3c20f2['directory'],parseInt(_0x08d6('0x57'),0x8));}var _0x48cc01=_0x21813a[_0x08d6('0x58')][_0x08d6('0x29')]({'plain':!![]});if(!_0x48cc01)throw new Error(_0x08d6('0x59'));if(_0x48cc01[_0x08d6('0x5a')]==='user'){var _0x536830=_0x3c20f2[_0x08d6('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x08d6('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x48cc01['userProfileId']},'raw':!![]})[_0x08d6('0x28')](function(_0x2ed757){if(_0x2ed757&&_0x2ed757['autoAssociation']===0x0){return db[_0x08d6('0x2a')][_0x08d6('0x4f')]({'name':_0x536830[_0x08d6('0x2e')],'resourceId':_0x536830['id'],'type':_0x2ed757[_0x08d6('0x2e')],'sectionId':_0x2ed757['id']},{})[_0x08d6('0x28')](function(){return _0x3c20f2;});}else{return _0x3c20f2;}})[_0x08d6('0x48')](function(_0x5efcba){logger[_0x08d6('0x2c')](_0x08d6('0x5b'),_0x5efcba);});}return _0x3c20f2;});})[_0x08d6('0x28')](respondWithResult(_0x15384f,0xc9))[_0x08d6('0x48')](handleError(_0x15384f,null));};exports[_0x08d6('0x27')]=function(_0x4b287e,_0x386ee9,_0x11f985){var _0x5b41ba;return db[_0x08d6('0x31')][_0x08d6('0x4c')]({'where':{'id':_0x4b287e[_0x08d6('0x4a')]['id']}})[_0x08d6('0x28')](function(_0x5c49c3){if(_0x5c49c3){return db[_0x08d6('0x50')][_0x08d6('0x5c')](function(_0xb41f85){return _0x5c49c3['destroy']({'transaction':_0xb41f85,'raw':!![]})[_0x08d6('0x28')](function(_0x5dbc3c){if(_0x5dbc3c[_0x08d6('0x52')]){fs[_0x08d6('0x5d')](_0x5dbc3c[_0x08d6('0x52')])[_0x08d6('0x5e')](function(_0x5e2d54){fs[_0x08d6('0x5f')](path[_0x08d6('0x53')](_0x5dbc3c[_0x08d6('0x52')],_0x5e2d54));});fs[_0x08d6('0x60')](_0x5dbc3c[_0x08d6('0x52')]);}return _0x5dbc3c;});})['catch'](function(_0x46f71d){throw new db[(_0x08d6('0x61'))][(_0x08d6('0x62'))](_0x46f71d[_0x08d6('0x63')]);});}})[_0x08d6('0x28')](handleEntityNotFound(_0x386ee9,null))[_0x08d6('0x28')](removeEntity(_0x386ee9,null))[_0x08d6('0x48')](handleError(_0x386ee9,null));};exports[_0x08d6('0x64')]=function(_0x3ef92f,_0x50d349,_0x1c4c21){return db[_0x08d6('0x50')][_0x08d6('0x5c')](function(_0x414c80){var _0x69f8e7;return db[_0x08d6('0x31')][_0x08d6('0x4c')]({'where':{'id':_0x3ef92f[_0x08d6('0x4a')]['id']}})[_0x08d6('0x28')](function(_0xa572d7){if(_0xa572d7){_0x69f8e7=_0xa572d7;return _0xa572d7[_0x08d6('0x64')](_0x3ef92f['body']['id'],{'transaction':_0x414c80});}})[_0x08d6('0x28')](function(_0x54d234){if(_0x54d234){return db['Sound'][_0x08d6('0x65')]({'where':{'id':_0x3ef92f[_0x08d6('0x4e')]['id']},'attributes':['id',_0x08d6('0x2e'),_0x08d6('0x66'),'converted_format',_0x08d6('0x67')],'raw':!![]});}})['then'](function(_0xfc9176){if(_0xfc9176){var _0x57f21d=path['join'](config[_0x08d6('0x54')],_0x08d6('0x68'),util[_0x08d6('0x69')](_0x08d6('0x6a'),path['basename'](_0xfc9176[_0x08d6('0x66')],path[_0x08d6('0x6b')](_0xfc9176['save_name'])),_0xfc9176[_0x08d6('0x6c')]));var _0x3d0c03=path['join'](config[_0x08d6('0x54')],'server/files/moh',_0x69f8e7[_0x08d6('0x2e')],util[_0x08d6('0x69')](_0x08d6('0x6a'),_0xfc9176[_0x08d6('0x2e')],_0xfc9176[_0x08d6('0x6c')]));fs[_0x08d6('0x6d')](_0x57f21d,_0x3d0c03);return _0xfc9176;}})[_0x08d6('0x48')](function(_0x59cf13){throw new db[(_0x08d6('0x61'))][(_0x08d6('0x62'))](_0x59cf13[_0x08d6('0x63')]);});})['then'](handleEntityNotFound(_0x50d349,null))[_0x08d6('0x28')](respondWithResult(_0x50d349,0xc9))[_0x08d6('0x48')](handleError(_0x50d349,null));};exports[_0x08d6('0x6e')]=function(_0x4db4f8,_0x258d39,_0x48823d){return db[_0x08d6('0x50')]['transaction'](function(_0x10eb0b){var _0x224f9d;return db[_0x08d6('0x31')][_0x08d6('0x65')]({'where':{'id':_0x4db4f8['params']['id']}})[_0x08d6('0x28')](handleEntityNotFound(_0x258d39,null))[_0x08d6('0x28')](function(_0x1c7530){if(_0x1c7530){_0x224f9d=_0x1c7530;return _0x1c7530[_0x08d6('0x6e')](_0x4db4f8['params'][_0x08d6('0x6f')]);}})[_0x08d6('0x28')](function(_0x287d7b){if(_0x287d7b){return db[_0x08d6('0x70')][_0x08d6('0x65')]({'where':{'id':_0x4db4f8[_0x08d6('0x4a')][_0x08d6('0x6f')]},'attributes':['id','name','save_name',_0x08d6('0x6c'),_0x08d6('0x67')],'raw':!![]});}})[_0x08d6('0x28')](function(_0x5941da){if(_0x5941da){fs[_0x08d6('0x5f')](path['join'](_0x224f9d[_0x08d6('0x52')],util[_0x08d6('0x69')](_0x08d6('0x6a'),_0x5941da[_0x08d6('0x2e')],_0x5941da['converted_format'])));return _0x5941da;}})[_0x08d6('0x48')](function(_0x4c9eb7){throw new db['Sequelize'][(_0x08d6('0x62'))](_0x4c9eb7[_0x08d6('0x63')]);});})['then'](handleEntityNotFound(_0x258d39,null))[_0x08d6('0x28')](respondWithStatusCode(_0x258d39,0xcc))['catch'](handleError(_0x258d39,null));};exports['getSounds']=function(_0x177470,_0x5c0a1b,_0x53520c){var _0x5da0d9={};var _0x5bf2b2={};var _0x1ac4f8;var _0x137ce8;return db[_0x08d6('0x31')]['findOne']({'where':{'id':_0x177470[_0x08d6('0x4a')]['id']}})[_0x08d6('0x28')](handleEntityNotFound(_0x5c0a1b,null))['then'](function(_0x5bce3e){if(_0x5bce3e){_0x1ac4f8=_0x5bce3e;_0x5bf2b2[_0x08d6('0x36')]=_['keys'](db['Sound'][_0x08d6('0x32')]);_0x5bf2b2[_0x08d6('0x37')]=_[_0x08d6('0x4b')](_0x177470['query']);_0x5bf2b2[_0x08d6('0x38')]=_[_0x08d6('0x39')](_0x5bf2b2['model'],_0x5bf2b2[_0x08d6('0x37')]);_0x5da0d9[_0x08d6('0x3a')]=_[_0x08d6('0x39')](_0x5bf2b2['model'],qs['fields'](_0x177470[_0x08d6('0x37')][_0x08d6('0x3b')]));_0x5da0d9[_0x08d6('0x3a')]=_0x5da0d9[_0x08d6('0x3a')][_0x08d6('0x3c')]?_0x5da0d9[_0x08d6('0x3a')]:_0x5bf2b2[_0x08d6('0x36')];_0x5da0d9[_0x08d6('0x71')]=qs[_0x08d6('0x3f')](_0x177470[_0x08d6('0x37')][_0x08d6('0x3f')]);_0x5da0d9[_0x08d6('0x40')]=qs[_0x08d6('0x38')](_[_0x08d6('0x41')](_0x177470['query'],_0x5bf2b2[_0x08d6('0x38')]));if(_0x177470['query'][_0x08d6('0x42')]){_0x5da0d9[_0x08d6('0x40')]=_['merge'](_0x5da0d9['where'],{'$or':_[_0x08d6('0x30')](_0x5da0d9['attributes'],function(_0x4a320e){var _0x15bccb={};_0x15bccb[_0x4a320e]={'$like':'%'+_0x177470[_0x08d6('0x37')][_0x08d6('0x42')]+'%'};return _0x15bccb;})});}_0x5da0d9=_[_0x08d6('0x43')]({},_0x5da0d9,_0x177470[_0x08d6('0x44')]);return _0x1ac4f8[_0x08d6('0x72')](_0x5da0d9);}})[_0x08d6('0x28')](function(_0x366a06){if(_0x366a06){_0x137ce8=_0x366a06['length'];if(!_0x177470[_0x08d6('0x37')]['hasOwnProperty']('nolimit')){_0x5da0d9[_0x08d6('0x22')]=qs[_0x08d6('0x22')](_0x177470['query'][_0x08d6('0x22')]);_0x5da0d9[_0x08d6('0x20')]=qs[_0x08d6('0x20')](_0x177470[_0x08d6('0x37')][_0x08d6('0x20')]);}return _0x1ac4f8[_0x08d6('0x72')](_0x5da0d9);}})['then'](function(_0x457cb1){if(_0x457cb1){return _0x457cb1?{'count':_0x137ce8,'rows':_0x457cb1}:null;}})['then'](respondWithResult(_0x5c0a1b,null))[_0x08d6('0x48')](handleError(_0x5c0a1b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 6a23374..f6f48c4 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 _0x933b=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x470aa2,_0x16fb16){var _0x51570d=function(_0x2dae71){while(--_0x2dae71){_0x470aa2['push'](_0x470aa2['shift']());}};_0x51570d(++_0x16fb16);}(_0x933b,0xf7));var _0xb933=function(_0x5896bf,_0x176a5a){_0x5896bf=_0x5896bf-0x0;var _0x5c7547=_0x933b[_0x5896bf];return _0x5c7547;};'use strict';var _=require(_0xb933('0x0'));var util=require('util');var logger=require(_0xb933('0x1'))(_0xb933('0x2'));var moment=require(_0xb933('0x3'));var BPromise=require(_0xb933('0x4'));var rp=require(_0xb933('0x5'));var fs=require('fs');var path=require(_0xb933('0x6'));var rimraf=require(_0xb933('0x7'));var config=require(_0xb933('0x8'));var attributes=require(_0xb933('0x9'));module[_0xb933('0xa')]=function(_0x3d89f9,_0xe7fa9b){return _0x3d89f9[_0xb933('0xb')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd38a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x4db54c,_0x5a9c7a){var _0x4fa9c5=function(_0x446dc3){while(--_0x446dc3){_0x4db54c['push'](_0x4db54c['shift']());}};_0x4fa9c5(++_0x5a9c7a);}(_0xd38a,0x1b6));var _0xad38=function(_0x1ca9e1,_0x8480c3){_0x1ca9e1=_0x1ca9e1-0x0;var _0x2be0f6=_0xd38a[_0x1ca9e1];return _0x2be0f6;};'use strict';var _=require(_0xad38('0x0'));var util=require(_0xad38('0x1'));var logger=require(_0xad38('0x2'))('api');var moment=require(_0xad38('0x3'));var BPromise=require(_0xad38('0x4'));var rp=require(_0xad38('0x5'));var fs=require('fs');var path=require(_0xad38('0x6'));var rimraf=require(_0xad38('0x7'));var config=require('../../config/environment');var attributes=require(_0xad38('0x8'));module['exports']=function(_0x2e1082,_0x10c73b){return _0x2e1082['define'](_0xad38('0x9'),attributes,{'tableName':_0xad38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index e647a65..cb74875 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 _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','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x25d4d2,_0x50c193){var _0x55054d=function(_0x2ae684){while(--_0x2ae684){_0x25d4d2['push'](_0x25d4d2['shift']());}};_0x55054d(++_0x50c193);}(_0xedd9,0xfc));var _0x9edd=function(_0x6a8741,_0x57ac09){_0x6a8741=_0x6a8741-0x0;var _0xc70b78=_0xedd9[_0x6a8741];return _0xc70b78;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\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 +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','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x24e58f,_0x49a913){var _0x2cf3ab=function(_0x1f67ee){while(--_0x1f67ee){_0x24e58f['push'](_0x24e58f['shift']());}};_0x2cf3ab(++_0x49a913);}(_0xedd9,0xfc));var _0x9edd=function(_0x5cfb93,_0x35b4d4){_0x5cfb93=_0x5cfb93-0x0;var _0x668eee=_0xedd9[_0x5cfb93];return _0x668eee;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\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/voicePrefix/index.js b/server/api/voicePrefix/index.js index 01fe322..edf954c 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 _0xf128=['/:id/users','/:id/teams','getTeams','create','addAgents','post','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x1d18b4,_0x455d59){var _0x5e142d=function(_0x442060){while(--_0x442060){_0x1d18b4['push'](_0x1d18b4['shift']());}};_0x5e142d(++_0x455d59);}(_0xf128,0x109));var _0x8f12=function(_0x3e57ef,_0x388fab){_0x3e57ef=_0x3e57ef-0x0;var _0x5ade66=_0xf128[_0x3e57ef];return _0x5ade66;};'use strict';var multer=require(_0x8f12('0x0'));var util=require(_0x8f12('0x1'));var path=require(_0x8f12('0x2'));var timeout=require(_0x8f12('0x3'));var express=require(_0x8f12('0x4'));var router=express[_0x8f12('0x5')]();var fs_extra=require(_0x8f12('0x6'));var auth=require(_0x8f12('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8f12('0x8'));var controller=require(_0x8f12('0x9'));router[_0x8f12('0xa')]('/',auth[_0x8f12('0xb')](),controller['index']);router[_0x8f12('0xa')](_0x8f12('0xc'),auth[_0x8f12('0xb')](),controller['describe']);router[_0x8f12('0xa')](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0xe')]);router['get'](_0x8f12('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8f12('0xa')](_0x8f12('0x10'),auth['isAuthenticated'](),controller[_0x8f12('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8f12('0x12')]);router['post'](_0x8f12('0xf'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x13')]);router[_0x8f12('0x14')](_0x8f12('0x10'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x15')]);router['put'](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x16')]);router[_0x8f12('0x17')](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x18')]);router['delete']('/:id/users',auth[_0x8f12('0xb')](),controller[_0x8f12('0x19')]);router[_0x8f12('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8f12('0x1a')]);module[_0x8f12('0x1b')]=router; \ No newline at end of file +var _0xae4a=['create','addAgents','addTeams','put','/:id','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xae4a,0x68));var _0xaae4=function(_0x20ba74,_0x533a84){_0x20ba74=_0x20ba74-0x0;var _0x249229=_0xae4a[_0x20ba74];return _0x249229;};'use strict';var multer=require(_0xaae4('0x0'));var util=require(_0xaae4('0x1'));var path=require('path');var timeout=require(_0xaae4('0x2'));var express=require(_0xaae4('0x3'));var router=express['Router']();var fs_extra=require(_0xaae4('0x4'));var auth=require(_0xaae4('0x5'));var interaction=require(_0xaae4('0x6'));var config=require(_0xaae4('0x7'));var controller=require(_0xaae4('0x8'));router[_0xaae4('0x9')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0xb')]);router[_0xaae4('0x9')](_0xaae4('0xc'),auth[_0xaae4('0xa')](),controller[_0xaae4('0xd')]);router[_0xaae4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaae4('0xe')]);router[_0xaae4('0x9')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x10')]);router[_0xaae4('0x9')](_0xaae4('0x11'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x12')]);router[_0xaae4('0x13')]('/',auth[_0xaae4('0xa')](),controller[_0xaae4('0x14')]);router[_0xaae4('0x13')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x15')]);router[_0xaae4('0x13')](_0xaae4('0x11'),auth['isAuthenticated'](),controller[_0xaae4('0x16')]);router[_0xaae4('0x17')](_0xaae4('0x18'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x19')]);router['delete'](_0xaae4('0x18'),auth['isAuthenticated'](),controller[_0xaae4('0x1a')]);router[_0xaae4('0x1b')](_0xaae4('0xf'),auth[_0xaae4('0xa')](),controller[_0xaae4('0x1c')]);router[_0xaae4('0x1b')]('/:id/teams',auth[_0xaae4('0xa')](),controller[_0xaae4('0x1d')]);module[_0xaae4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index cf3765f..17ce9aa 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 _0x1ef2=['exports','name','VIRTUAL','system-','getDataValue','STRING','INTEGER'];(function(_0xb1e99e,_0x5a20ef){var _0x11ba35=function(_0x23ea94){while(--_0x23ea94){_0xb1e99e['push'](_0xb1e99e['shift']());}};_0x11ba35(++_0x5a20ef);}(_0x1ef2,0xa1));var _0x21ef=function(_0x152051,_0x51b9e5){_0x152051=_0x152051-0x0;var _0x1ce591=_0x1ef2[_0x152051];return _0x1ce591;};'use strict';var Sequelize=require('sequelize');module[_0x21ef('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x21ef('0x1')},'prefix':{'type':Sequelize[_0x21ef('0x2')],'get':function(_0x26989a){return _0x21ef('0x3')+this[_0x21ef('0x4')](_0x21ef('0x1'))+'-';}},'description':{'type':Sequelize[_0x21ef('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x21ef('0x6')]}}; \ No newline at end of file +var _0xbad4=['VIRTUAL','STRING','INTEGER','sequelize','exports','name'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xbad4,0x15f));var _0x4bad=function(_0x302ad7,_0x4a5160){_0x302ad7=_0x302ad7-0x0;var _0xe388f6=_0xbad4[_0x302ad7];return _0xe388f6;};'use strict';var Sequelize=require(_0x4bad('0x0'));module[_0x4bad('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4bad('0x2')},'prefix':{'type':Sequelize[_0x4bad('0x3')],'get':function(_0xf25431){return'system-'+this['getDataValue'](_0x4bad('0x2'))+'-';}},'description':{'type':Sequelize[_0x4bad('0x4')]},'callerIdAll':{'type':Sequelize[_0x4bad('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x4bad('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e46a168..428f30b 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(_0x124031,_0x395297){var _0x278769=function(_0x2215d0){while(--_0x2215d0){_0x124031['push'](_0x124031['shift']());}};_0x278769(++_0x395297);}(_0x02ce,0x1ac));var _0xe02c=function(_0x69ae63,_0x266fab){_0x69ae63=_0x69ae63-0x0;var _0x30405f=_0x02ce[_0x69ae63];return _0x30405f;};'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 _0x065e=['localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','get','VoicePrefixes','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','VoicePrefix','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','callerIdAll','push','Set','PREFIX-CALLERIDALL=','NoOp','goto','context','${EXTEN:','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','order','pick','getTeams','findOne','addTeams','Team','findAll','Agents','voicePause','interface','each','upsert','UserVoicePrefix','forEach','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','every','TeamId','includes','all','union','compact','isEmpty','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults'];(function(_0x6a650f,_0x2bb822){var _0x5b0372=function(_0x1adcff){while(--_0x1adcff){_0x6a650f['push'](_0x6a650f['shift']());}};_0x5b0372(++_0x2bb822);}(_0x065e,0x1a7));var _0xe065=function(_0x5ab05b,_0x59ba0f){_0x5ab05b=_0x5ab05b-0x0;var _0x47b4ac=_0x065e[_0x5ab05b];return _0x47b4ac;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];config[_0xe065('0x16')]=_[_0xe065('0x17')](config['redis'],{'host':_0xe065('0x18'),'port':0x18eb});var socket=require(_0xe065('0x19'))(new Redis(config[_0xe065('0x16')]));require(_0xe065('0x1a'))[_0xe065('0x1b')](socket);function respondWithStatusCode(_0x541985,_0x3d3557){_0x3d3557=_0x3d3557||0xcc;return function(_0x2b4789){if(_0x2b4789){return _0x541985[_0xe065('0x1c')](_0x3d3557);}return _0x541985[_0xe065('0x1d')](_0x3d3557)[_0xe065('0x1e')]();};}function respondWithResult(_0x352206,_0x2e5feb){_0x2e5feb=_0x2e5feb||0xc8;return function(_0x545100){if(_0x545100){return _0x352206[_0xe065('0x1d')](_0x2e5feb)[_0xe065('0x1f')](_0x545100);}};}function respondWithFilteredResult(_0x54d260,_0x2bfec0){return function(_0x1d2f7a){if(_0x1d2f7a){var _0x397f05=typeof _0x2bfec0[_0xe065('0x20')]===_0xe065('0x21')&&typeof _0x2bfec0[_0xe065('0x22')]===_0xe065('0x21');var _0x5000e1=_0x1d2f7a[_0xe065('0x23')];var _0x52e9b2=_0x397f05?0x0:_0x2bfec0[_0xe065('0x20')];var _0x23233d=_0x397f05?_0x1d2f7a['count']:_0x2bfec0[_0xe065('0x20')]+_0x2bfec0['limit'];var _0xe26e9b;if(_0x23233d>=_0x5000e1){_0x23233d=_0x5000e1;_0xe26e9b=0xc8;}else{_0xe26e9b=0xce;}_0x54d260[_0xe065('0x1d')](_0xe26e9b);return _0x54d260[_0xe065('0x24')](_0xe065('0x25'),_0x52e9b2+'-'+_0x23233d+'/'+_0x5000e1)[_0xe065('0x1f')](_0x1d2f7a);}return null;};}function patchUpdates(_0x105cb2){return function(_0x22a0cb){try{jsonpatch[_0xe065('0x26')](_0x22a0cb,_0x105cb2,!![]);}catch(_0x1c5dd9){return BPromise['reject'](_0x1c5dd9);}return _0x22a0cb[_0xe065('0x27')]();};}function saveUpdates(_0x43b712,_0x44ec95){return function(_0x13f6e5){if(_0x13f6e5){return _0x13f6e5['update'](_0x43b712)['then'](function(_0x164965){return _0x164965;});}return null;};}function removeEntity(_0x530dc0,_0x14e6b6){return function(_0x27e669){if(_0x27e669){return _0x27e669[_0xe065('0x28')]()[_0xe065('0x29')](function(){var _0x418731=_0x27e669[_0xe065('0x2a')]({'plain':!![]});var _0x3b1caf=_0xe065('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b1caf,'resourceId':_0x418731['id']}})[_0xe065('0x29')](function(){return _0x27e669;});})[_0xe065('0x29')](function(){_0x530dc0[_0xe065('0x1d')](0xcc)[_0xe065('0x1e')]();});}};}function handleEntityNotFound(_0x5b1220,_0x23f573){return function(_0x55ecaa){if(!_0x55ecaa){_0x5b1220['sendStatus'](0x194);}return _0x55ecaa;};}function handleError(_0x182743,_0x2659e6){_0x2659e6=_0x2659e6||0x1f4;return function(_0x2aa766){logger['error'](_0x2aa766[_0xe065('0x2c')]);if(_0x2aa766['name']){delete _0x2aa766[_0xe065('0x2d')];}_0x182743[_0xe065('0x1d')](_0x2659e6)[_0xe065('0x2e')](_0x2aa766);};}exports[_0xe065('0x2f')]=function(_0x58c49b,_0x3f02b2){var _0x4940cf={},_0x3fa56f={},_0x2e4e4a={'count':0x0,'rows':[]};var _0x5d0864=_[_0xe065('0x30')](db['VoicePrefix'][_0xe065('0x31')],function(_0x4999b0){return{'name':_0x4999b0[_0xe065('0x32')],'type':_0x4999b0[_0xe065('0x33')][_0xe065('0x34')]};});_0x3fa56f[_0xe065('0x35')]=_['map'](_0x5d0864,_0xe065('0x2d'));_0x3fa56f[_0xe065('0x36')]=_[_0xe065('0x37')](_0x58c49b[_0xe065('0x36')]);_0x3fa56f[_0xe065('0x38')]=_[_0xe065('0x39')](_0x3fa56f['model'],_0x3fa56f[_0xe065('0x36')]);_0x4940cf[_0xe065('0x3a')]=_['intersection'](_0x3fa56f[_0xe065('0x35')],qs[_0xe065('0x3b')](_0x58c49b[_0xe065('0x36')][_0xe065('0x3b')]));_0x4940cf[_0xe065('0x3a')]=_0x4940cf[_0xe065('0x3a')][_0xe065('0x3c')]?_0x4940cf['attributes']:_0x3fa56f[_0xe065('0x35')];if(!_0x58c49b['query'][_0xe065('0x3d')](_0xe065('0x3e'))){_0x4940cf[_0xe065('0x22')]=qs[_0xe065('0x22')](_0x58c49b[_0xe065('0x36')][_0xe065('0x22')]);_0x4940cf['offset']=qs[_0xe065('0x20')](_0x58c49b[_0xe065('0x36')][_0xe065('0x20')]);}_0x4940cf['order']=qs[_0xe065('0x3f')](_0x58c49b[_0xe065('0x36')][_0xe065('0x3f')]);_0x4940cf[_0xe065('0x40')]=qs[_0xe065('0x38')](_['pick'](_0x58c49b[_0xe065('0x36')],_0x3fa56f[_0xe065('0x38')]),_0x5d0864);if(_0x58c49b['query'][_0xe065('0x41')]){_0x4940cf['where']=_[_0xe065('0x42')](_0x4940cf[_0xe065('0x40')],{'$or':_['map'](_0x5d0864,function(_0x3c7e70){if(_0x3c7e70[_0xe065('0x33')]!=='VIRTUAL'){var _0x16b5da={};_0x16b5da[_0x3c7e70[_0xe065('0x2d')]]={'$like':'%'+_0x58c49b[_0xe065('0x36')][_0xe065('0x41')]+'%'};return _0x16b5da;}})});}_0x4940cf=_[_0xe065('0x42')]({},_0x4940cf,_0x58c49b[_0xe065('0x43')]);var _0x395cc2={'where':_0x4940cf[_0xe065('0x40')]};return db[_0xe065('0x44')][_0xe065('0x23')](_0x395cc2)[_0xe065('0x29')](function(_0x4364c3){_0x2e4e4a[_0xe065('0x23')]=_0x4364c3;if(_0x58c49b['query']['includeAll']){_0x4940cf[_0xe065('0x45')]=[{'all':!![]}];}return db[_0xe065('0x44')]['findAll'](_0x4940cf);})[_0xe065('0x29')](function(_0x448044){_0x2e4e4a[_0xe065('0x46')]=_0x448044;return _0x2e4e4a;})[_0xe065('0x29')](respondWithFilteredResult(_0x3f02b2,_0x4940cf))[_0xe065('0x47')](handleError(_0x3f02b2,null));};exports[_0xe065('0x48')]=function(_0x39440c,_0x11e82d){var _0x1f93e9={'raw':![],'where':{'id':_0x39440c[_0xe065('0x49')]['id']}},_0x52073d={};_0x52073d[_0xe065('0x35')]=_[_0xe065('0x37')](db['VoicePrefix'][_0xe065('0x31')]);_0x52073d[_0xe065('0x36')]=_[_0xe065('0x37')](_0x39440c[_0xe065('0x36')]);_0x52073d['filters']=_[_0xe065('0x39')](_0x52073d[_0xe065('0x35')],_0x52073d[_0xe065('0x36')]);_0x1f93e9[_0xe065('0x3a')]=_[_0xe065('0x39')](_0x52073d[_0xe065('0x35')],qs[_0xe065('0x3b')](_0x39440c['query'][_0xe065('0x3b')]));_0x1f93e9[_0xe065('0x3a')]=_0x1f93e9[_0xe065('0x3a')][_0xe065('0x3c')]?_0x1f93e9[_0xe065('0x3a')]:_0x52073d[_0xe065('0x35')];if(_0x39440c[_0xe065('0x36')]['includeAll']){_0x1f93e9[_0xe065('0x45')]=[{'all':!![]}];}_0x1f93e9=_['merge']({},_0x1f93e9,_0x39440c[_0xe065('0x43')]);return db[_0xe065('0x44')][_0xe065('0x4a')](_0x1f93e9)['then'](handleEntityNotFound(_0x11e82d,null))[_0xe065('0x29')](respondWithResult(_0x11e82d,null))[_0xe065('0x47')](handleError(_0x11e82d,null));};exports[_0xe065('0x28')]=function(_0x162d11,_0x3c6880){return db[_0xe065('0x44')][_0xe065('0x4a')]({'where':{'id':_0x162d11[_0xe065('0x49')]['id']}})[_0xe065('0x29')](handleEntityNotFound(_0x3c6880,null))[_0xe065('0x29')](removeEntity(_0x3c6880,null))[_0xe065('0x47')](handleError(_0x3c6880,null));};exports[_0xe065('0x4b')]=function(_0x14327f,_0x490498){return db['VoicePrefix']['describe']()[_0xe065('0x29')](respondWithResult(_0x490498,null))['catch'](handleError(_0x490498,null));};exports[_0xe065('0x4c')]=function(_0x2c5e42,_0x5a7a98){var _0x480aec;return db[_0xe065('0x4d')][_0xe065('0x4e')](function(_0x5cce78){return db[_0xe065('0x44')][_0xe065('0x4c')](_0x2c5e42[_0xe065('0x4f')],{'transaction':_0x5cce78})[_0xe065('0x29')](function(_0x12df39){_0x480aec=_0x12df39[_0xe065('0x2a')]({'plain':!![]});return db[_0xe065('0x50')][_0xe065('0x4a')]({'where':{'id':_0x480aec[_0xe065('0x51')]},'raw':!![]})[_0xe065('0x29')](function(_0x49a367){return createVoicePrefixExtensions(_0x480aec,_0x49a367,_0x5cce78);});});})[_0xe065('0x29')](function(){var _0x18eb92=_0x2c5e42[_0xe065('0x52')][_0xe065('0x2a')]({'plain':!![]});if(!_0x18eb92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18eb92[_0xe065('0x53')]===_0xe065('0x52')){var _0x21884d=_0x480aec;return db[_0xe065('0x54')]['find']({'where':{'name':_0xe065('0x2b'),'userProfileId':_0x18eb92[_0xe065('0x55')]},'raw':!![]})[_0xe065('0x29')](function(_0x5320c6){if(_0x5320c6&&_0x5320c6[_0xe065('0x56')]===0x0){return db[_0xe065('0x57')][_0xe065('0x4c')]({'name':_0x21884d[_0xe065('0x2d')],'resourceId':_0x21884d['id'],'type':_0x5320c6[_0xe065('0x2d')],'sectionId':_0x5320c6['id']},{})[_0xe065('0x29')](function(){return _0x480aec;});}else{return _0x480aec;}})[_0xe065('0x47')](function(_0x464ef7){logger[_0xe065('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x464ef7);throw _0x464ef7;});}return _0x480aec;})[_0xe065('0x29')](respondWithResult(_0x5a7a98,null))['catch'](handleError(_0x5a7a98,null));};function Extension(_0x44edf0,_0x24fc1c,_0x3c1229,_0x4e9e85){this['context']='from-sip';this[_0xe065('0x59')]=_0x44edf0;this[_0xe065('0x5a')]=_0x3c1229;this[_0xe065('0x33')]=_0xe065('0x5b');this[_0xe065('0x5c')]=_0xe065('0x5d');this[_0xe065('0x5e')]=_0x24fc1c;this[_0xe065('0x5f')]=_0x4e9e85;}function createVoicePrefixExtensions(_0x20abe0,_0x3169fa,_0x25ec8a){return new BPromise(function(_0x590429,_0x544bff){var _0x2fe0ac=new Extension(formatPrefixName(_0x20abe0[_0xe065('0x60')]),0x1,'NoOp',_0xe065('0x61'));_0x2fe0ac['VoicePrefixId']=_0x20abe0['id'];return db['VoiceExtension'][_0xe065('0x4c')](_0x2fe0ac,{'transaction':_0x25ec8a})[_0xe065('0x29')](function(_0x4e7275){var _0x96355e=_0x4e7275[_0xe065('0x2a')]({'plain':!![]});var _0x817baf=_[_0xe065('0x30')](addVoicePrefixExtensions(_0x20abe0,_0x3169fa),function(_0x5edc0f){_0x5edc0f[_0xe065('0x51')]=_0x96355e['id'];_0x5edc0f[_0xe065('0x62')]=_0x20abe0['id'];return _0x5edc0f;});return db[_0xe065('0x50')][_0xe065('0x63')](_0x817baf,{'transaction':_0x25ec8a})[_0xe065('0x29')](function(_0x4f35a6){if(!_0x4f35a6){return _0x544bff(_0xe065('0x64'));}else{return _0x590429(_0x4f35a6);}})[_0xe065('0x47')](function(_0x29b3f0){return _0x544bff(_0x29b3f0);});});;});};function addVoicePrefixExtensions(_0x155133,_0x2968c5){var _0xfce2e=[];var _0x5af9d5=formatPrefixName(_0x155133['prefix']);_0xfce2e['push'](new Extension(_0x5af9d5,0x2,'Set','CDR(prefix)='+_0x155133[_0xe065('0x2d')]));if(_0x155133[_0xe065('0x65')]){_0xfce2e[_0xe065('0x66')](new Extension(_0x5af9d5,0x3,_0xe065('0x67'),_0xe065('0x68')+_0x155133[_0xe065('0x65')]));}else{_0xfce2e[_0xe065('0x66')](new Extension(_0x5af9d5,0x3,_0xe065('0x69'),'No\x20callerid\x20available'));}_0xfce2e['push'](new Extension(_0x5af9d5,0x4,_0xe065('0x6a'),_0x2968c5[_0xe065('0x6b')]+','+_0xe065('0x6c')+(0x8+_0x155133['name'][_0xe065('0x3c')])+'}'+','+0x1));return _0xfce2e;}function formatPrefixName(_0x268428){var _0x113a0f='_';for(var _0x4765a0=0x0;_0x4765a0<_0x268428[_0xe065('0x3c')];_0x4765a0++){if(_0x268428[_0xe065('0x6d')](_0x4765a0)=='-'){_0x113a0f+=_0x268428[_0xe065('0x6d')](_0x4765a0);}else{_0x113a0f+='['+_0x268428[_0xe065('0x6d')](_0x4765a0)+']';}}_0x113a0f+='.';return _0x113a0f;}exports[_0xe065('0x6e')]=function(_0xecef2,_0x213feb,_0x4493db){var _0xa5310c=_0xecef2[_0xe065('0x4f')];_0xa5310c[_0xe065('0x60')]=_0xe065('0x6f')+_0xa5310c[_0xe065('0x2d')]+'-';return db[_0xe065('0x4d')]['transaction'](function(_0x31d6cb){return db[_0xe065('0x44')][_0xe065('0x6e')](_0xa5310c,{'where':{'id':_0xa5310c['id']},'transaction':_0x31d6cb})[_0xe065('0x29')](function(){return db[_0xe065('0x50')][_0xe065('0x28')]({'where':{'VoicePrefixId':_0xa5310c['id']},'transaction':_0x31d6cb})[_0xe065('0x29')](function(){return db[_0xe065('0x50')][_0xe065('0x4a')]({'where':{'id':_0xa5310c[_0xe065('0x51')]},'raw':!![]})[_0xe065('0x29')](function(_0xa08631){return createVoicePrefixExtensions(_0xa5310c,_0xa08631,_0x31d6cb);});});});})[_0xe065('0x29')](function(){return db[_0xe065('0x44')][_0xe065('0x70')](_0xa5310c['id']);})[_0xe065('0x29')](respondWithResult(_0x213feb,null))[_0xe065('0x47')](handleError(_0x213feb,null));};exports['addAgents']=function(_0x256eef,_0x185b5b,_0x3e2241){return db[_0xe065('0x44')][_0xe065('0x4a')]({'where':{'id':_0x256eef[_0xe065('0x49')]['id']}})[_0xe065('0x29')](handleEntityNotFound(_0x185b5b,null))[_0xe065('0x29')](function(_0x54b1f2){if(_0x54b1f2){return _0x54b1f2[_0xe065('0x71')](_0x256eef['body']['ids'],_[_0xe065('0x72')](_0x256eef['body'],[_0xe065('0x73'),'id'])||{})['spread'](function(_0x1df721){for(var _0x162482=0x0;_0x162482<_0x256eef[_0xe065('0x4f')][_0xe065('0x73')][_0xe065('0x3c')];_0x162482+=0x1){socket[_0xe065('0x74')](_0xe065('0x75'),{'UserId':Number(_0x256eef[_0xe065('0x4f')][_0xe065('0x73')][_0x162482]),'VoicePrefixId':Number(_0x256eef['params']['id'])});}return _0x1df721;});}})[_0xe065('0x29')](respondWithResult(_0x185b5b,null))[_0xe065('0x47')](handleError(_0x185b5b,null));};exports[_0xe065('0x76')]=function(_0x3f8e32,_0x5858d9,_0x26c427){return db[_0xe065('0x44')][_0xe065('0x4a')]({'where':{'id':_0x3f8e32['params']['id']}})[_0xe065('0x29')](handleEntityNotFound(_0x5858d9,null))[_0xe065('0x29')](function(_0x3c024b){if(_0x3c024b){return _0x3c024b['removeAgents'](_0x3f8e32[_0xe065('0x36')][_0xe065('0x73')])['then'](function(){if(_['isArray'](_0x3f8e32[_0xe065('0x36')][_0xe065('0x73')])){for(var _0x1b8c33=0x0;_0x1b8c33<_0x3f8e32[_0xe065('0x36')][_0xe065('0x73')]['length'];_0x1b8c33+=0x1){socket['emit'](_0xe065('0x77'),{'UserId':Number(_0x3f8e32[_0xe065('0x36')]['ids'][_0x1b8c33]),'VoicePrefixId':Number(_0x3f8e32[_0xe065('0x49')]['id'])});}}else{socket[_0xe065('0x74')](_0xe065('0x77'),{'UserId':Number(_0x3f8e32[_0xe065('0x36')][_0xe065('0x73')]),'VoicePrefixId':Number(_0x3f8e32[_0xe065('0x49')]['id'])});}});}})[_0xe065('0x29')](respondWithStatusCode(_0x5858d9,null))[_0xe065('0x47')](handleError(_0x5858d9,null));};exports[_0xe065('0x78')]=function(_0x1ec81f,_0x4d25b9,_0x5d940d){var _0x34174f={};var _0x5336e3={};var _0x2451ec;var _0x45b479;return db[_0xe065('0x44')]['findOne']({'where':{'id':_0x1ec81f[_0xe065('0x49')]['id']}})[_0xe065('0x29')](handleEntityNotFound(_0x4d25b9,null))[_0xe065('0x29')](function(_0x124054){if(_0x124054){_0x2451ec=_0x124054;_0x5336e3[_0xe065('0x35')]=_[_0xe065('0x37')](db[_0xe065('0x79')][_0xe065('0x31')]);_0x5336e3[_0xe065('0x36')]=_[_0xe065('0x37')](_0x1ec81f[_0xe065('0x36')]);_0x5336e3['filters']=_[_0xe065('0x39')](_0x5336e3[_0xe065('0x35')],_0x5336e3[_0xe065('0x36')]);_0x34174f[_0xe065('0x3a')]=_[_0xe065('0x39')](_0x5336e3[_0xe065('0x35')],qs[_0xe065('0x3b')](_0x1ec81f[_0xe065('0x36')][_0xe065('0x3b')]));_0x34174f[_0xe065('0x3a')]=_0x34174f[_0xe065('0x3a')][_0xe065('0x3c')]?_0x34174f['attributes']:_0x5336e3[_0xe065('0x35')];_0x34174f[_0xe065('0x7a')]=qs[_0xe065('0x3f')](_0x1ec81f[_0xe065('0x36')][_0xe065('0x3f')]);_0x34174f[_0xe065('0x40')]=qs[_0xe065('0x38')](_[_0xe065('0x7b')](_0x1ec81f[_0xe065('0x36')],_0x5336e3[_0xe065('0x38')]));if(_0x1ec81f[_0xe065('0x36')][_0xe065('0x41')]){_0x34174f[_0xe065('0x40')]=_[_0xe065('0x42')](_0x34174f[_0xe065('0x40')],{'$or':_[_0xe065('0x30')](_0x34174f[_0xe065('0x3a')],function(_0x47792d){var _0x105eaa={};_0x105eaa[_0x47792d]={'$like':'%'+_0x1ec81f[_0xe065('0x36')][_0xe065('0x41')]+'%'};return _0x105eaa;})});}_0x34174f=_[_0xe065('0x42')]({},_0x34174f,_0x1ec81f[_0xe065('0x43')]);return _0x2451ec[_0xe065('0x78')](_0x34174f);}})[_0xe065('0x29')](function(_0x428745){if(_0x428745){_0x45b479=_0x428745[_0xe065('0x3c')];if(!_0x1ec81f[_0xe065('0x36')][_0xe065('0x3d')](_0xe065('0x3e'))){_0x34174f[_0xe065('0x22')]=qs[_0xe065('0x22')](_0x1ec81f[_0xe065('0x36')][_0xe065('0x22')]);_0x34174f[_0xe065('0x20')]=qs[_0xe065('0x20')](_0x1ec81f[_0xe065('0x36')][_0xe065('0x20')]);}return _0x2451ec[_0xe065('0x78')](_0x34174f);}})[_0xe065('0x29')](function(_0x4da03f){if(_0x4da03f){return _0x4da03f?{'count':_0x45b479,'rows':_0x4da03f}:null;}})[_0xe065('0x29')](respondWithResult(_0x4d25b9,null))[_0xe065('0x47')](handleError(_0x4d25b9,null));};exports[_0xe065('0x7c')]=function(_0xe199d7,_0x40231d,_0x34b37c){var _0x24ebbd={};var _0x22bc5c={};var _0x5d6761;var _0x2f2f53;return db['VoicePrefix'][_0xe065('0x7d')]({'where':{'id':_0xe199d7['params']['id']}})[_0xe065('0x29')](handleEntityNotFound(_0x40231d,null))[_0xe065('0x29')](function(_0x19e3cf){if(_0x19e3cf){_0x5d6761=_0x19e3cf;_0x22bc5c[_0xe065('0x35')]=_['keys'](db['Team'][_0xe065('0x31')]);_0x22bc5c[_0xe065('0x36')]=_[_0xe065('0x37')](_0xe199d7['query']);_0x22bc5c[_0xe065('0x38')]=_[_0xe065('0x39')](_0x22bc5c[_0xe065('0x35')],_0x22bc5c['query']);_0x24ebbd['attributes']=_['intersection'](_0x22bc5c['model'],qs[_0xe065('0x3b')](_0xe199d7[_0xe065('0x36')][_0xe065('0x3b')]));_0x24ebbd[_0xe065('0x3a')]=_0x24ebbd[_0xe065('0x3a')]['length']?_0x24ebbd[_0xe065('0x3a')]:_0x22bc5c[_0xe065('0x35')];_0x24ebbd['order']=qs[_0xe065('0x3f')](_0xe199d7['query'][_0xe065('0x3f')]);_0x24ebbd['where']=qs[_0xe065('0x38')](_[_0xe065('0x7b')](_0xe199d7[_0xe065('0x36')],_0x22bc5c[_0xe065('0x38')]));if(_0xe199d7[_0xe065('0x36')][_0xe065('0x41')]){_0x24ebbd[_0xe065('0x40')]=_[_0xe065('0x42')](_0x24ebbd[_0xe065('0x40')],{'$or':_[_0xe065('0x30')](_0x24ebbd[_0xe065('0x3a')],function(_0x242712){var _0xa89a0e={};_0xa89a0e[_0x242712]={'$like':'%'+_0xe199d7[_0xe065('0x36')]['filter']+'%'};return _0xa89a0e;})});}_0x24ebbd=_['merge']({},_0x24ebbd,_0xe199d7[_0xe065('0x43')]);return _0x5d6761[_0xe065('0x7c')](_0x24ebbd);}})['then'](function(_0x33a5b9){if(_0x33a5b9){_0x2f2f53=_0x33a5b9[_0xe065('0x3c')];if(!_0xe199d7[_0xe065('0x36')][_0xe065('0x3d')](_0xe065('0x3e'))){_0x24ebbd[_0xe065('0x22')]=qs[_0xe065('0x22')](_0xe199d7['query']['limit']);_0x24ebbd[_0xe065('0x20')]=qs[_0xe065('0x20')](_0xe199d7[_0xe065('0x36')][_0xe065('0x20')]);}return _0x5d6761['getTeams'](_0x24ebbd);}})[_0xe065('0x29')](function(_0x33f41c){if(_0x33f41c){return _0x33f41c?{'count':_0x2f2f53,'rows':_0x33f41c}:null;}})[_0xe065('0x29')](respondWithResult(_0x40231d,null))[_0xe065('0x47')](handleError(_0x40231d,null));};exports[_0xe065('0x7e')]=function(_0x123188,_0x490961,_0x3cd1c8){var _0x4a63da=_0x123188['body'][_0xe065('0x73')];var _0x14440a;return db[_0xe065('0x7f')][_0xe065('0x80')]({'where':{'id':_0x4a63da},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe065('0x81'),'attributes':['id',_0xe065('0x2d'),'online',_0xe065('0x82'),_0xe065('0x83')],'raw':!![]}]})[_0xe065('0x29')](function(_0x29ecc6){if(_0x29ecc6){_0x14440a=_0x29ecc6;var _0x2aab25=_['flatMap'](_0x29ecc6,function(_0x1998ee){var _0x5df1f5=_0x1998ee[_0xe065('0x2a')]({'plain':!![]});return _0x5df1f5['Agents'];});return db[_0xe065('0x44')][_0xe065('0x4a')]({'where':{'id':_0x123188[_0xe065('0x49')]['id']}})['then'](function(_0x4d68c2){return db[_0xe065('0x4d')][_0xe065('0x4e')](function(_0x5c61df){return _0x4d68c2[_0xe065('0x7e')](_0x4a63da,{'transaction':_0x5c61df})['then'](function(){return BPromise[_0xe065('0x84')](_0x14440a,function(_0x41c62a){return db['TeamVoicePrefix'][_0xe065('0x85')]({'TeamId':_0x41c62a['id'],'VoicePrefixId':_0x123188[_0xe065('0x49')]['id']},{'transaction':_0x5c61df});});})[_0xe065('0x29')](function(){return BPromise[_0xe065('0x84')](_0x2aab25,function(_0xd8b280){return db[_0xe065('0x86')]['findOrCreate']({'where':{'UserId':_0xd8b280['id'],'VoicePrefixId':_0x123188['params']['id']},'transaction':_0x5c61df});});})[_0xe065('0x29')](function(){_0x2aab25[_0xe065('0x87')](function(_0x41d5b5){socket[_0xe065('0x74')](_0xe065('0x75'),{'UserId':_0x41d5b5['id'],'VoicePrefixId':_0x4d68c2['id']});});});});});}})['then'](respondWithStatusCode(_0x490961,null))['catch'](handleError(_0x490961,null));};exports['removeTeams']=function(_0x3e51b4,_0xab9cb,_0x5d64af){return db[_0xe065('0x7f')][_0xe065('0x80')]({'where':{'id':_0x3e51b4[_0xe065('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe065('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xab9cb,null))[_0xe065('0x29')](function(_0x42afb3){var _0x38119f=_[_0xe065('0x30')](_0x42afb3,'id');var _0x5b7ce9=[];var _0xa80c6d=[];var _0x3a46d3=squel['select']();_0x3a46d3[_0xe065('0x88')](_0xe065('0x89'))[_0xe065('0x8a')]('team_has_voice_prefixes','tq')[_0xe065('0x8b')]('user_has_teams','ut',_0xe065('0x8c'))[_0xe065('0x40')]('VoicePrefixId\x20=\x20?',_0x3e51b4['params']['id']);for(var _0x451186=0x0;_0x451186<_0x42afb3[_0xe065('0x3c')];_0x451186+=0x1){let _0x16e82a=_0x42afb3[_0x451186];for(var _0x243415=0x0;_0x243415<_0x16e82a[_0xe065('0x81')][_0xe065('0x3c')];_0x243415+=0x1){let _0x2b8d04=_0x16e82a['Agents'][_0x243415];var _0x572836=_0x3a46d3['clone']();_0x572836[_0xe065('0x40')](_0xe065('0x8d'),_0x2b8d04['id']);_0xa80c6d['push'](db[_0xe065('0x4d')][_0xe065('0x36')](_0x572836['toString'](),{'type':db[_0xe065('0x4d')]['QueryTypes']['SELECT']})[_0xe065('0x29')](function(_0x1a21c0){if(_0x1a21c0[_0xe065('0x3c')]===0x1){return _0x2b8d04['id'];}else{var _0x5c7e10=_[_0xe065('0x8e')](_[_0xe065('0x30')](_0x1a21c0,_0xe065('0x8f')),function(_0x10a15e){return _[_0xe065('0x90')](_0x38119f,_0x10a15e);});if(_0x5c7e10){return _0x2b8d04['id'];}}}));}}return BPromise[_0xe065('0x91')](_0xa80c6d)[_0xe065('0x29')](function(_0x20c16c){_0x5b7ce9=_(_0x5b7ce9)[_0xe065('0x92')](_0x20c16c)[_0xe065('0x93')]()['value']();return db[_0xe065('0x44')][_0xe065('0x4a')]({'where':{'id':_0x3e51b4[_0xe065('0x49')]['id']}})[_0xe065('0x29')](function(_0x97b140){return db['sequelize'][_0xe065('0x4e')](function(_0x257ea2){return _0x97b140['removeTeams'](_0x3e51b4['query'][_0xe065('0x73')],{'transaction':_0x257ea2})[_0xe065('0x29')](function(){if(!_[_0xe065('0x94')](_0x5b7ce9)){return _0x97b140[_0xe065('0x76')](_0x5b7ce9,{'transaction':_0x257ea2});}})['then'](function(){_0x5b7ce9[_0xe065('0x87')](function(_0x1113fa){socket[_0xe065('0x74')](_0xe065('0x77'),{'UserId':_0x1113fa,'VoicePrefixId':_0x97b140['id']});});});});});});})['then'](respondWithStatusCode(_0xab9cb,null))[_0xe065('0x47')](handleError(_0xab9cb,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 827e5f6..ba6efd4 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 _0xbcd1=['setMaxListeners','save','remove','emit','hasOwnProperty','../../mysqldb','VoicePrefix'];(function(_0x4408d5,_0x42c1ab){var _0x22c585=function(_0x23020e){while(--_0x23020e){_0x4408d5['push'](_0x4408d5['shift']());}};_0x22c585(++_0x42c1ab);}(_0xbcd1,0x171));var _0x1bcd=function(_0x57fcd6,_0x70b457){_0x57fcd6=_0x57fcd6-0x0;var _0x5b6c73=_0xbcd1[_0x57fcd6];return _0x5b6c73;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x1bcd('0x0'))['db'][_0x1bcd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1bcd('0x2')](0x0);var events={'afterCreate':_0x1bcd('0x3'),'afterUpdate':'update','afterDestroy':_0x1bcd('0x4')};function emitEvent(_0x22e013){return function(_0x277389,_0x1a145f,_0x7ea934){VoicePrefixEvents[_0x1bcd('0x5')](_0x22e013+':'+_0x277389['id'],_0x277389);VoicePrefixEvents[_0x1bcd('0x5')](_0x22e013,_0x277389);_0x7ea934(null);};}for(var e in events){if(events[_0x1bcd('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x5b54=['../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hook','events'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x5b54,0xd7));var _0x45b5=function(_0x28b8be,_0x4d310c){_0x28b8be=_0x28b8be-0x0;var _0x3f7601=_0x5b54[_0x28b8be];return _0x3f7601;};'use strict';var EventEmitter=require(_0x45b5('0x0'));var VoicePrefix=require(_0x45b5('0x1'))['db'][_0x45b5('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x45b5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x45b5('0x4'),'afterDestroy':_0x45b5('0x5')};function emitEvent(_0x1afd57){return function(_0x33b59e,_0x1ce370,_0x29332a){VoicePrefixEvents[_0x45b5('0x6')](_0x1afd57+':'+_0x33b59e['id'],_0x33b59e);VoicePrefixEvents[_0x45b5('0x6')](_0x1afd57,_0x33b59e);_0x29332a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x45b5('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index c0db094..d82bccd 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 _0xb631=['exports','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4bb1b3,_0x446a44){var _0x6b3651=function(_0x1f0a7b){while(--_0x1f0a7b){_0x4bb1b3['push'](_0x4bb1b3['shift']());}};_0x6b3651(++_0x446a44);}(_0xb631,0x15f));var _0x1b63=function(_0xb00fe9,_0x22109e){_0xb00fe9=_0xb00fe9-0x0;var _0x271d1a=_0xb631[_0xb00fe9];return _0x271d1a;};'use strict';var _=require('lodash');var util=require(_0x1b63('0x0'));var logger=require(_0x1b63('0x1'))(_0x1b63('0x2'));var moment=require(_0x1b63('0x3'));var BPromise=require(_0x1b63('0x4'));var rp=require(_0x1b63('0x5'));var fs=require('fs');var path=require(_0x1b63('0x6'));var rimraf=require(_0x1b63('0x7'));var config=require(_0x1b63('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x1b63('0x9')]=function(_0x4bb97a,_0x30d33b){return _0x4bb97a['define'](_0x1b63('0xa'),attributes,{'tableName':_0x1b63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe214=['lodash','util','../../config/logger','request-promise','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x4c4ca2,_0x30d812){var _0x17dac3=function(_0x4f07e6){while(--_0x4f07e6){_0x4c4ca2['push'](_0x4c4ca2['shift']());}};_0x17dac3(++_0x30d812);}(_0xe214,0xaa));var _0x4e21=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe214[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4e21('0x0'));var util=require(_0x4e21('0x1'));var logger=require(_0x4e21('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e21('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e21('0x4'));var attributes=require(_0x4e21('0x5'));module[_0x4e21('0x6')]=function(_0x1a920b,_0x50d87b){return _0x1a920b[_0x4e21('0x7')](_0x4e21('0x8'),attributes,{'tableName':_0x4e21('0x9'),'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 0fdc665..fed84fc 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 _0xd9ce=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xb6c029,_0x289717){var _0x369954=function(_0xf20e69){while(--_0xf20e69){_0xb6c029['push'](_0xb6c029['shift']());}};_0x369954(++_0x289717);}(_0xd9ce,0xeb));var _0xed9c=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0xd9ce[_0x565faf];return _0x42292f;};'use strict';var _=require(_0xed9c('0x0'));var util=require(_0xed9c('0x1'));var moment=require(_0xed9c('0x2'));var BPromise=require(_0xed9c('0x3'));var rs=require(_0xed9c('0x4'));var fs=require('fs');var Redis=require(_0xed9c('0x5'));var db=require(_0xed9c('0x6'))['db'];var utils=require(_0xed9c('0x7'));var logger=require('../../config/logger')(_0xed9c('0x8'));var config=require(_0xed9c('0x9'));var jayson=require(_0xed9c('0xa'));var client=jayson[_0xed9c('0xb')][_0xed9c('0xc')]({'port':0x232a});config[_0xed9c('0xd')]=_['defaults'](config[_0xed9c('0xd')],{'host':_0xed9c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xed9c('0xf'))['register'](socket);function respondWithRpcPromise(_0x2a61eb,_0x12471a,_0xd11a6){return new BPromise(function(_0x7f112a,_0x5e3385){return client[_0xed9c('0x10')](_0x2a61eb,_0xd11a6)[_0xed9c('0x11')](function(_0x103137){logger[_0xed9c('0x12')](_0xed9c('0x13'),_0x12471a,'request\x20sent');logger['debug'](_0xed9c('0x14'),_0x12471a,_0xed9c('0x15'),JSON[_0xed9c('0x16')](_0x103137));if(_0x103137[_0xed9c('0x17')]){if(_0x103137['error']['code']===0x1f4){logger[_0xed9c('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x12471a,_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);return _0x5e3385(_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);}logger[_0xed9c('0x17')](_0xed9c('0x13'),_0x12471a,_0x103137[_0xed9c('0x17')]['message']);return _0x7f112a(_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);}else{logger[_0xed9c('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x12471a,_0xed9c('0x15'));_0x7f112a(_0x103137[_0xed9c('0x19')]['message']);}})[_0xed9c('0x1a')](function(_0x465bec){logger[_0xed9c('0x17')](_0xed9c('0x13'),_0x12471a,_0x465bec);_0x5e3385(_0x465bec);});});} \ No newline at end of file +var _0xc6a2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xc6a2,0x69));var _0x2c6a=function(_0x18eb68,_0x3d7d45){_0x18eb68=_0x18eb68-0x0;var _0x46599e=_0xc6a2[_0x18eb68];return _0x46599e;};'use strict';var _=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var moment=require('moment');var BPromise=require(_0x2c6a('0x2'));var rs=require(_0x2c6a('0x3'));var fs=require('fs');var Redis=require(_0x2c6a('0x4'));var db=require(_0x2c6a('0x5'))['db'];var utils=require(_0x2c6a('0x6'));var logger=require(_0x2c6a('0x7'))(_0x2c6a('0x8'));var config=require(_0x2c6a('0x9'));var jayson=require(_0x2c6a('0xa'));var client=jayson[_0x2c6a('0xb')][_0x2c6a('0xc')]({'port':0x232a});config[_0x2c6a('0xd')]=_[_0x2c6a('0xe')](config[_0x2c6a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c6a('0xf'))(new Redis(config[_0x2c6a('0xd')]));require(_0x2c6a('0x10'))[_0x2c6a('0x11')](socket);function respondWithRpcPromise(_0x261e90,_0x28b169,_0x25d67f){return new BPromise(function(_0x2a7040,_0x4aa0a3){return client['request'](_0x261e90,_0x25d67f)[_0x2c6a('0x12')](function(_0x46531e){logger[_0x2c6a('0x13')](_0x2c6a('0x14'),_0x28b169,'request\x20sent');logger['debug'](_0x2c6a('0x15'),_0x28b169,_0x2c6a('0x16'),JSON[_0x2c6a('0x17')](_0x46531e));if(_0x46531e['error']){if(_0x46531e['error']['code']===0x1f4){logger[_0x2c6a('0x18')](_0x2c6a('0x14'),_0x28b169,_0x46531e[_0x2c6a('0x18')][_0x2c6a('0x19')]);return _0x4aa0a3(_0x46531e[_0x2c6a('0x18')][_0x2c6a('0x19')]);}logger[_0x2c6a('0x18')](_0x2c6a('0x14'),_0x28b169,_0x46531e[_0x2c6a('0x18')]['message']);return _0x2a7040(_0x46531e[_0x2c6a('0x18')][_0x2c6a('0x19')]);}else{logger['info'](_0x2c6a('0x14'),_0x28b169,'request\x20sent');_0x2a7040(_0x46531e['result'][_0x2c6a('0x19')]);}})[_0x2c6a('0x1a')](function(_0x15fa74){logger[_0x2c6a('0x18')](_0x2c6a('0x14'),_0x28b169,_0x15fa74);_0x4aa0a3(_0x15fa74);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index bdc3bbd..3eb7606 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 _0x6b61=['update','emit','register','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6b61,0x16a));var _0x16b6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6b61[_0xbca1b1];return _0x4e1686;};'use strict';var VoicePrefixEvents=require(_0x16b6('0x0'));var events=['save',_0x16b6('0x1'),_0x16b6('0x2')];function createListener(_0xbeab11,_0x2f73f2){return function(_0xffc401){_0x2f73f2[_0x16b6('0x3')](_0xbeab11,_0xffc401);};}function removeListener(_0x213f9e,_0x12ffdd){return function(){VoicePrefixEvents['removeListener'](_0x213f9e,_0x12ffdd);};}exports[_0x16b6('0x4')]=function(_0x173c5d){for(var _0x594a8f=0x0,_0x3d06d6=events[_0x16b6('0x5')];_0x594a8f<_0x3d06d6;_0x594a8f++){var _0x59552d=events[_0x594a8f];var _0x460269=createListener(_0x16b6('0x6')+_0x59552d,_0x173c5d);VoicePrefixEvents['on'](_0x59552d,_0x460269);}}; \ No newline at end of file +var _0x2be0=['save','remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x6d5377,_0x1f10af){var _0x4e305e=function(_0x53c40b){while(--_0x53c40b){_0x6d5377['push'](_0x6d5377['shift']());}};_0x4e305e(++_0x1f10af);}(_0x2be0,0x128));var _0x02be=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2be0[_0x42245d];return _0x4b211a;};'use strict';var VoicePrefixEvents=require(_0x02be('0x0'));var events=[_0x02be('0x1'),_0x02be('0x2'),_0x02be('0x3')];function createListener(_0x2aa17c,_0x51708c){return function(_0x12d55f){_0x51708c[_0x02be('0x4')](_0x2aa17c,_0x12d55f);};}function removeListener(_0xb18781,_0x5e05a0){return function(){VoicePrefixEvents[_0x02be('0x5')](_0xb18781,_0x5e05a0);};}exports[_0x02be('0x6')]=function(_0x46392d){for(var _0x184bf6=0x0,_0x522686=events[_0x02be('0x7')];_0x184bf6<_0x522686;_0x184bf6++){var _0x3eaa8a=events[_0x184bf6];var _0x22686f=createListener(_0x02be('0x8')+_0x3eaa8a,_0x46392d);VoicePrefixEvents['on'](_0x3eaa8a,_0x22686f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ec4d1fa..6ccb36f 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x501c92,_0x4c52d8){var _0x519828=function(_0x40308d){while(--_0x40308d){_0x501c92['push'](_0x501c92['shift']());}};_0x519828(++_0x4c52d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);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('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=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(_0x3e3221,_0x392851){var _0x190da4=function(_0x13d601){while(--_0x13d601){_0x3e3221['push'](_0x3e3221['shift']());}};_0x190da4(++_0x392851);}(_0xb10b,0x12a));var _0xbb10=function(_0x5eff86,_0x2cdd22){_0x5eff86=_0x5eff86-0x0;var _0x4b3010=_0xb10b[_0x5eff86];return _0x4b3010;};'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 2ea775e..2cfd451 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 _0x1d70=['Active/Disactive\x20Recall\x20In\x20Queue','DESC','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\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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrordered','setDataValue','rrmemory','type','getDataValue','strategy','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','progressive','power','booked','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x33aad9,_0x32e987){var _0x191058=function(_0x13a230){while(--_0x13a230){_0x33aad9['push'](_0x33aad9['shift']());}};_0x191058(++_0x32e987);}(_0x1d70,0xf7));var _0x01d7=function(_0x59c278,_0x3d6d80){_0x59c278=_0x59c278-0x0;var _0x3bc355=_0x1d70[_0x59c278];return _0x3bc355;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01d7('0x0')],'allowNull':![],'unique':_0x01d7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x01d7('0x3')},'musiconhold':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x01d7('0x2')]('rr',_0x01d7('0x4'),_0x01d7('0x5'),_0x01d7('0x6'),_0x01d7('0x7'),'rrmemory','linear','wrandom',_0x01d7('0x8')),'allowNull':![],'defaultValue':_0x01d7('0x4'),'set':function(_0x2f06c7){this[_0x01d7('0x9')]('strategy',_0x2f06c7?_0x2f06c7:_0x01d7('0xa'));},'get':function(){var _0x5a4803=this['getDataValue'](_0x01d7('0xb'));var _0x1563a2=this[_0x01d7('0xc')]('dialMethod');var _0xaf8478=this[_0x01d7('0xc')](_0x01d7('0xd'));if(_0x5a4803==='outbound'){if(_0x1563a2==='preview'){return null;}if(_0x1563a2==='booked'&&![_0x01d7('0xa'),'roundrobin'][_0x01d7('0xe')](_0xaf8478)){this[_0x01d7('0x9')](_0x01d7('0xd'),_0x01d7('0xa'));}}return _0xaf8478;}},'servicelevel':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x01d7('0xf')](0xb)},'timeout':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x01d7('0x0')]},'weight':{'type':Sequelize[_0x01d7('0xf')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no'),'defaultValue':_0x01d7('0x10')},'autopause':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no',_0x01d7('0x11')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x01d7('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no',_0x01d7('0x12')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x01d7('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x01d7('0x0')]},'queue_youarenext':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x01d7('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x01d7('0x0')]},'queue_quantity2':{'type':Sequelize[_0x01d7('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x01d7('0x0')]},'queue_less_than':{'type':Sequelize[_0x01d7('0x0')]},'periodic_announce':{'type':Sequelize[_0x01d7('0x13')],'set':function(_0x4c33e7){this[_0x01d7('0x9')]('periodic_announce',_0x4c33e7?_0x4c33e7[_0x01d7('0x14')](','):[]);},'get':function(){return this['getDataValue'](_0x01d7('0x15'))?this[_0x01d7('0xc')](_0x01d7('0x15'))[_0x01d7('0x16')](','):[];}},'joinempty':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':_0x01d7('0x10'),'set':function(_0x5e00fa){this['setDataValue'](_0x01d7('0x17'),_0x5e00fa?_0x5e00fa['join'](','):undefined);},'get':function(){return this[_0x01d7('0xc')](_0x01d7('0x17'))?this[_0x01d7('0xc')](_0x01d7('0x17'))[_0x01d7('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'no','set':function(_0x412435){this[_0x01d7('0x9')](_0x01d7('0x18'),_0x412435?_0x412435[_0x01d7('0x14')](','):undefined);},'get':function(){return this[_0x01d7('0xc')]('leavewhenempty')?this[_0x01d7('0xc')]('leavewhenempty')[_0x01d7('0x16')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01d7('0x0')]},'acw':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'set':function(_0x57be83){this[_0x01d7('0x9')]('acw',_0x57be83);if(_0x57be83){if(this['getDataValue'](_0x01d7('0x1a'))<0x2){this[_0x01d7('0x9')](_0x01d7('0x1a'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x1b'),_0x01d7('0x1c'),_0x01d7('0x1d'),'predictive',_0x01d7('0x1e')),'defaultValue':_0x01d7('0x1c'),'comment':_0x01d7('0x1f')},'dialLimitChannel':{'type':Sequelize[_0x01d7('0xf')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x01d7('0x20')},'dialLimitQueue':{'type':Sequelize[_0x01d7('0xf')](0x4)[_0x01d7('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x01d7('0x22')},'dialPowerLevel':{'type':Sequelize[_0x01d7('0x23')](0x2)[_0x01d7('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x01d7('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x01d7('0x2')]('agentBusyFactor',_0x01d7('0x25')),'defaultValue':'dropRate','comment':_0x01d7('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x01d7('0x23')](0x2)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x01d7('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x01d7('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x28')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x01d7('0x29'),'comment':_0x01d7('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2b')},'dialQueueProject':{'type':Sequelize[_0x01d7('0x0')],'comment':_0x01d7('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'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[_0x01d7('0x0')],'defaultValue':_0x01d7('0x32')},'dialPrefix':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x01d7('0x2')]('always',_0x01d7('0x33'),_0x01d7('0x34')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'comment':_0x01d7('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x01d7('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x01d7('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x01d7('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x01d7('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x01d7('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x01d7('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x01d7('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'comment':_0x01d7('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x3e'),'ASC'),'defaultValue':_0x01d7('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x01d7('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x01d7('0xf')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x01d7('0x3f')},'dialCutDigit':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x01d7('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x42')},'dialDropRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01d7('0xf')],'allowNull':!![],'comment':_0x01d7('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![],'comment':_0x01d7('0x4a'),'set':function(_0x428085){if(!_0x428085)this[_0x01d7('0x9')](_0x01d7('0x4b'),null);this[_0x01d7('0x9')](_0x01d7('0x4c'),_0x428085);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x01d7('0xf')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![]}}; \ No newline at end of file +var _0x4879=['all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','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)','#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,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','type','dialMethod','getDataValue','strategy','preview','booked','roundrobin','INTEGER','yes'];(function(_0x28bbdb,_0x55936f){var _0x3c1636=function(_0x179daa){while(--_0x179daa){_0x28bbdb['push'](_0x28bbdb['shift']());}};_0x3c1636(++_0x55936f);}(_0x4879,0x132));var _0x9487=function(_0x1c9f77,_0x1ee32c){_0x1c9f77=_0x1c9f77-0x0;var _0x726168=_0x4879[_0x1c9f77];return _0x726168;};'use strict';var Sequelize=require(_0x9487('0x0'));module[_0x9487('0x1')]={'name':{'type':Sequelize[_0x9487('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9487('0x3')]('inbound',_0x9487('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x9487('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9487('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x9487('0x5'),_0x9487('0x6'),_0x9487('0x7'),_0x9487('0x8'),_0x9487('0x9'),'linear',_0x9487('0xa'),_0x9487('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x52f69f){this[_0x9487('0xc')]('strategy',_0x52f69f?_0x52f69f:_0x9487('0x9'));},'get':function(){var _0x342214=this['getDataValue'](_0x9487('0xd'));var _0x544163=this['getDataValue'](_0x9487('0xe'));var _0x1f5d47=this[_0x9487('0xf')](_0x9487('0x10'));if(_0x342214==='outbound'){if(_0x544163===_0x9487('0x11')){return null;}if(_0x544163===_0x9487('0x12')&&!['rrmemory',_0x9487('0x13')]['includes'](_0x1f5d47)){this[_0x9487('0xc')](_0x9487('0x10'),_0x9487('0x9'));}}return _0x1f5d47;}},'servicelevel':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9487('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9487('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9487('0x2')]},'weight':{'type':Sequelize[_0x9487('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9487('0x3')]('yes','no'),'defaultValue':_0x9487('0x15')},'autopause':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no',_0x9487('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9487('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9487('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x9487('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9487('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9487('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9487('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9487('0x3')]('yes','no'),'defaultValue':_0x9487('0x15')},'announce_holdtime':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no',_0x9487('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9487('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x9487('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9487('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9487('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9487('0x2')]},'queue_youarenext':{'type':Sequelize[_0x9487('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9487('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9487('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9487('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9487('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x9487('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x9487('0x2')]},'queue_less_than':{'type':Sequelize[_0x9487('0x2')]},'periodic_announce':{'type':Sequelize[_0x9487('0x18')],'set':function(_0x22f267){this[_0x9487('0xc')]('periodic_announce',_0x22f267?_0x22f267[_0x9487('0x19')](','):[]);},'get':function(){return this[_0x9487('0xf')]('periodic_announce')?this['getDataValue'](_0x9487('0x1a'))[_0x9487('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x3a434f){this[_0x9487('0xc')](_0x9487('0x1c'),_0x3a434f?_0x3a434f[_0x9487('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x9487('0x1c'))?this[_0x9487('0xf')](_0x9487('0x1c'))[_0x9487('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9487('0x2')],'defaultValue':'no','set':function(_0x27cd5e){this[_0x9487('0xc')](_0x9487('0x1d'),_0x27cd5e?_0x27cd5e[_0x9487('0x19')](','):undefined);},'get':function(){return this[_0x9487('0xf')]('leavewhenempty')?this[_0x9487('0xf')](_0x9487('0x1d'))[_0x9487('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9487('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9487('0x2')]},'acw':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':0x0,'set':function(_0x2d9a15){this[_0x9487('0xc')](_0x9487('0x1f'),_0x2d9a15);if(_0x2d9a15){if(this[_0x9487('0xf')](_0x9487('0x20'))<0x2){this[_0x9487('0xc')](_0x9487('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9487('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':0x0,'comment':_0x9487('0x21')},'dialMethod':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x11'),'progressive',_0x9487('0x22'),'predictive','booked'),'defaultValue':_0x9487('0x23'),'comment':_0x9487('0x24')},'dialLimitChannel':{'type':Sequelize[_0x9487('0x14')](0x4)[_0x9487('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x9487('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9487('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x9487('0x3')]('agentBusyFactor','dropRate'),'defaultValue':_0x9487('0x27'),'comment':_0x9487('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9487('0x29')](0x2)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9487('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9487('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9487('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x9487('0x2')],'defaultValue':_0x9487('0x2d'),'comment':_0x9487('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x2f')},'dialQueueProject':{'type':Sequelize[_0x9487('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9487('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9487('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x9487('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9487('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9487('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9487('0x2')],'defaultValue':_0x9487('0x37')},'dialPrefix':{'type':Sequelize[_0x9487('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9487('0x3')]('always',_0x9487('0x38'),_0x9487('0x39')),'defaultValue':_0x9487('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9487('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x9487('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9487('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9487('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9487('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9487('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x9487('0x14')](0x9)[_0x9487('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9487('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9487('0x14')](0x9)[_0x9487('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9487('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9487('0x14')](0x9)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9487('0x14')](0x5)[_0x9487('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9487('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x9487('0x14')](0x5)[_0x9487('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9487('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':0x0,'comment':_0x9487('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9487('0x3')](_0x9487('0x43'),_0x9487('0x44')),'defaultValue':_0x9487('0x43')},'dialQueueProject2':{'type':Sequelize[_0x9487('0x2')],'comment':_0x9487('0x45')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9487('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9487('0x14')](0x5)[_0x9487('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9487('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9487('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9487('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9487('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9487('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9487('0x14')],'allowNull':!![],'comment':_0x9487('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x277f53){if(!_0x277f53)this['setDataValue'](_0x9487('0x50'),null);this[_0x9487('0xc')](_0x9487('0x51'),_0x277f53);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x9487('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9487('0x14')](0x3)[_0x9487('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9487('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index aa027e7..aa3e784 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 _0x79bf=['getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','SELECT','every','includes','compact','isEmpty','removeAgents','addAgents','spread','emit','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','scheduledAt','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','type','name','UserProfileResource','destroy','end','sendStatus','send','index','VoiceQueue','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','find','body','get','role','UserProfileSection','userProfileId','autoAssociation','create','rawAttributes','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal'];(function(_0x263a79,_0x5b8f0b){var _0x4f4abe=function(_0x4a5d4b){while(--_0x4a5d4b){_0x263a79['push'](_0x263a79['shift']());}};_0x4f4abe(++_0x5b8f0b);}(_0x79bf,0x1df));var _0xf79b=function(_0x3e4566,_0x1e02e2){_0x3e4566=_0x3e4566-0x0;var _0x2eb60f=_0x79bf[_0x3e4566];return _0x2eb60f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf79b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf79b('0x1'));var rp=require('request-promise');var moment=require(_0xf79b('0x2'));var BPromise=require(_0xf79b('0x3'));var Mustache=require(_0xf79b('0x4'));var util=require(_0xf79b('0x5'));var path=require(_0xf79b('0x6'));var sox=require(_0xf79b('0x7'));var csv=require(_0xf79b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf79b('0x9'));var _=require(_0xf79b('0xa'));var squel=require(_0xf79b('0xb'));var crypto=require('crypto');var jsforce=require(_0xf79b('0xc'));var deskjs=require(_0xf79b('0xd'));var toCsv=require(_0xf79b('0x8'));var querystring=require(_0xf79b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf79b('0xf'));var qs=require(_0xf79b('0x10'));var as=require(_0xf79b('0x11'));var hardwareService=require(_0xf79b('0x12'));var logger=require(_0xf79b('0x13'))(_0xf79b('0x14'));var utils=require(_0xf79b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf79b('0x16'));var db=require(_0xf79b('0x17'))['db'];config[_0xf79b('0x18')]=_[_0xf79b('0x19')](config[_0xf79b('0x18')],{'host':_0xf79b('0x1a'),'port':0x18eb});var socket=require(_0xf79b('0x1b'))(new Redis(config[_0xf79b('0x18')]));require(_0xf79b('0x1c'))[_0xf79b('0x1d')](socket);function respondWithStatusCode(_0x1bd011,_0x2d1361){_0x2d1361=_0x2d1361||0xcc;return function(_0x5ac739){if(_0x5ac739){return _0x1bd011['sendStatus'](_0x2d1361);}return _0x1bd011[_0xf79b('0x1e')](_0x2d1361)['end']();};}function respondWithResult(_0x3caf78,_0x4ed585){_0x4ed585=_0x4ed585||0xc8;return function(_0x39536e){if(_0x39536e){return _0x3caf78['status'](_0x4ed585)['json'](_0x39536e);}};}function respondWithFilteredResult(_0x14b21d,_0x56a70e){return function(_0x387e4e){if(_0x387e4e){var _0x97c15d=typeof _0x56a70e[_0xf79b('0x1f')]==='undefined'&&typeof _0x56a70e[_0xf79b('0x20')]==='undefined';var _0x379ac0=_0x387e4e[_0xf79b('0x21')];var _0x2340e3=_0x97c15d?0x0:_0x56a70e[_0xf79b('0x1f')];var _0xf18b94=_0x97c15d?_0x387e4e['count']:_0x56a70e[_0xf79b('0x1f')]+_0x56a70e['limit'];var _0x5d33fa;if(_0xf18b94>=_0x379ac0){_0xf18b94=_0x379ac0;_0x5d33fa=0xc8;}else{_0x5d33fa=0xce;}_0x14b21d[_0xf79b('0x1e')](_0x5d33fa);return _0x14b21d[_0xf79b('0x22')](_0xf79b('0x23'),_0x2340e3+'-'+_0xf18b94+'/'+_0x379ac0)[_0xf79b('0x24')](_0x387e4e);}return null;};}function patchUpdates(_0x20a503){return function(_0x3ef00a){try{jsonpatch['apply'](_0x3ef00a,_0x20a503,!![]);}catch(_0x255c13){return BPromise[_0xf79b('0x25')](_0x255c13);}return _0x3ef00a[_0xf79b('0x26')]();};}function saveUpdates(_0x13a339,_0x2de335){return function(_0x466065){if(_0x466065){return _0x466065[_0xf79b('0x27')](_0x13a339)[_0xf79b('0x28')](function(_0xf1480e){return _0xf1480e;});}return null;};}function removeEntity(_0x31bd2a,_0x5c9dfb){return function(_0x2dfa65){if(_0x2dfa65){return _0x2dfa65['destroy']()['then'](function(){var _0x1a99e3=_0x2dfa65['get']({'plain':!![]});var _0xb4e37=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a'),'ignore':![]},{'name':_0xf79b('0x2b'),'value':_0xf79b('0x2c'),'ignore':![]}];var _0x4e9e45=_(_0xb4e37)[_0xf79b('0x2d')]('ignore')[_0xf79b('0x2e')](_0xf79b('0x2f'))[_0xf79b('0x2f')]();if(_['includes'](_0x4e9e45,_0x1a99e3[_0xf79b('0x30')])){return;}var _0x3b7c5d=_['find'](_0xb4e37,[_0xf79b('0x2f'),_0x1a99e3['type']])[_0xf79b('0x31')];return db[_0xf79b('0x32')][_0xf79b('0x33')]({'where':{'type':_0x3b7c5d,'resourceId':_0x1a99e3['id']}})[_0xf79b('0x28')](function(){return _0x2dfa65;});})[_0xf79b('0x28')](function(){_0x31bd2a[_0xf79b('0x1e')](0xcc)[_0xf79b('0x34')]();});}};}function handleEntityNotFound(_0x682ebf,_0x4a4d75){return function(_0x38901f){if(!_0x38901f){_0x682ebf[_0xf79b('0x35')](0x194);}return _0x38901f;};}function handleError(_0x3d33c0,_0x231a32){_0x231a32=_0x231a32||0x1f4;return function(_0x24e603){logger['error'](_0x24e603['stack']);if(_0x24e603[_0xf79b('0x31')]){delete _0x24e603[_0xf79b('0x31')];}_0x3d33c0[_0xf79b('0x1e')](_0x231a32)[_0xf79b('0x36')](_0x24e603);};}exports[_0xf79b('0x37')]=function(_0x4bb695,_0x5701d7){var _0x3c8fb5={},_0x1957ba={},_0x1b0cd7={'count':0x0,'rows':[]};var _0x39ae31=_[_0xf79b('0x2e')](db[_0xf79b('0x38')]['rawAttributes'],function(_0x2feedf){return{'name':_0x2feedf[_0xf79b('0x39')],'type':_0x2feedf[_0xf79b('0x30')][_0xf79b('0x3a')]};});_0x1957ba[_0xf79b('0x3b')]=_['map'](_0x39ae31,_0xf79b('0x31'));_0x1957ba['query']=_[_0xf79b('0x3c')](_0x4bb695['query']);_0x1957ba[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x1957ba[_0xf79b('0x3b')],_0x1957ba[_0xf79b('0x3f')]);_0x3c8fb5['attributes']=_['intersection'](_0x1957ba['model'],qs[_0xf79b('0x40')](_0x4bb695[_0xf79b('0x3f')]['fields']));_0x3c8fb5[_0xf79b('0x41')]=_0x3c8fb5['attributes'][_0xf79b('0x42')]?_0x3c8fb5[_0xf79b('0x41')]:_0x1957ba[_0xf79b('0x3b')];if(!_0x4bb695['query'][_0xf79b('0x43')](_0xf79b('0x44'))){_0x3c8fb5['limit']=qs[_0xf79b('0x20')](_0x4bb695['query'][_0xf79b('0x20')]);_0x3c8fb5[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x1f')]);}_0x3c8fb5[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x3c8fb5[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x4bb695['query'],_0x1957ba[_0xf79b('0x3d')]),_0x39ae31);if(_0x4bb695[_0xf79b('0x3f')]['filter']){_0x3c8fb5['where']=_[_0xf79b('0x49')](_0x3c8fb5[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x39ae31,function(_0x2ea597){if(_0x2ea597[_0xf79b('0x30')]!=='VIRTUAL'){var _0x31fcf5={};_0x31fcf5[_0x2ea597[_0xf79b('0x31')]]={'$like':'%'+_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x31fcf5;}})});}_0x3c8fb5=_[_0xf79b('0x49')]({},_0x3c8fb5,_0x4bb695[_0xf79b('0x4a')]);var _0xe3bff8={'where':_0x3c8fb5[_0xf79b('0x47')]};return db[_0xf79b('0x38')][_0xf79b('0x21')](_0xe3bff8)[_0xf79b('0x28')](function(_0x8e9ab4){_0x1b0cd7[_0xf79b('0x21')]=_0x8e9ab4;if(_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x3c8fb5[_0xf79b('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0xf79b('0x4d')](_0x3c8fb5);})['then'](function(_0x76f13f){_0x1b0cd7[_0xf79b('0x4e')]=_0x76f13f;return _0x1b0cd7;})[_0xf79b('0x28')](respondWithFilteredResult(_0x5701d7,_0x3c8fb5))[_0xf79b('0x4f')](handleError(_0x5701d7,null));};exports[_0xf79b('0x50')]=function(_0x158f2f,_0xfda08e){var _0x429164={'raw':![],'where':{'id':_0x158f2f['params']['id']}},_0x46b1a6={};_0x46b1a6['model']=_[_0xf79b('0x3c')](db['VoiceQueue']['rawAttributes']);_0x46b1a6['query']=_[_0xf79b('0x3c')](_0x158f2f[_0xf79b('0x3f')]);_0x46b1a6[_0xf79b('0x3d')]=_['intersection'](_0x46b1a6[_0xf79b('0x3b')],_0x46b1a6[_0xf79b('0x3f')]);_0x429164['attributes']=_[_0xf79b('0x3e')](_0x46b1a6[_0xf79b('0x3b')],qs['fields'](_0x158f2f[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x429164[_0xf79b('0x41')]=_0x429164[_0xf79b('0x41')][_0xf79b('0x42')]?_0x429164[_0xf79b('0x41')]:_0x46b1a6[_0xf79b('0x3b')];if(_0x158f2f[_0xf79b('0x3f')]['includeAll']){_0x429164[_0xf79b('0x4c')]=[{'all':!![]}];}_0x429164=_[_0xf79b('0x49')]({},_0x429164,_0x158f2f[_0xf79b('0x4a')]);return db[_0xf79b('0x38')][_0xf79b('0x51')](_0x429164)[_0xf79b('0x28')](handleEntityNotFound(_0xfda08e,null))['then'](respondWithResult(_0xfda08e,null))[_0xf79b('0x4f')](handleError(_0xfda08e,null));};exports['create']=function(_0x1b0332,_0x2261d7){return db[_0xf79b('0x38')]['create'](_0x1b0332[_0xf79b('0x52')],{})['then'](function(_0x6145ca){var _0x214ef2=_0x1b0332['user'][_0xf79b('0x53')]({'plain':!![]});if(!_0x214ef2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x214ef2[_0xf79b('0x54')]==='user'){var _0x545baa=_0x6145ca[_0xf79b('0x53')]({'plain':!![]});var _0x280774=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a')},{'name':_0xf79b('0x2b'),'value':'outbound'}];var _0x7bfde2=_[_0xf79b('0x51')](_0x280774,[_0xf79b('0x2f'),_0x545baa[_0xf79b('0x30')]])['name'];return db[_0xf79b('0x55')][_0xf79b('0x51')]({'where':{'name':_0x7bfde2,'userProfileId':_0x214ef2[_0xf79b('0x56')]},'raw':!![]})['then'](function(_0x3bc052){if(_0x3bc052&&_0x3bc052[_0xf79b('0x57')]===0x0){return db['UserProfileResource'][_0xf79b('0x58')]({'name':_0x545baa[_0xf79b('0x31')],'resourceId':_0x545baa['id'],'type':_0x3bc052[_0xf79b('0x31')],'sectionId':_0x3bc052['id']},{})['then'](function(){return _0x6145ca;});}else{return _0x6145ca;}})[_0xf79b('0x4f')](function(_0x152c18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152c18);throw _0x152c18;});}return _0x6145ca;})[_0xf79b('0x28')](respondWithResult(_0x2261d7,0xc9))['catch'](handleError(_0x2261d7,null));};exports['clone']=function(_0x53f426,_0x4c4fdb){var _0xe5fa0e={'where':{'id':_0x53f426['params']['id']}},_0x4435df={};_0x4435df[_0xf79b('0x3b')]=_['keys'](db[_0xf79b('0x38')][_0xf79b('0x59')]);_0xe5fa0e[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x4435df[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x53f426['query'][_0xf79b('0x40')]));_0xe5fa0e[_0xf79b('0x41')]=_0xe5fa0e[_0xf79b('0x41')]['length']?_0xe5fa0e[_0xf79b('0x41')]:_0x4435df['model'];if(_0x53f426['query'][_0xf79b('0x4b')]){_0xe5fa0e[_0xf79b('0x4c')]=[{'all':!![]}];}_0xe5fa0e=_[_0xf79b('0x49')]({},_0xe5fa0e,_0x53f426[_0xf79b('0x4a')]);return db['VoiceQueue']['find'](_0xe5fa0e)[_0xf79b('0x28')](handleEntityNotFound(_0x4c4fdb,null))[_0xf79b('0x28')](function(_0x5bb211){if(_0x5bb211){var _0x3ab27a=_0x5bb211[_0xf79b('0x53')]({'plain':!![]});_0x3ab27a=qs[_0xf79b('0x5a')](_0x3ab27a,['id',_0xf79b('0x5b'),_0xf79b('0x5c')]);_0x53f426[_0xf79b('0x52')]=_['omit'](_0x53f426[_0xf79b('0x52')],['id',_0xf79b('0x5b'),_0xf79b('0x5c')]);return db['VoiceQueue'][_0xf79b('0x58')](_[_0xf79b('0x49')](_0x3ab27a,_0x53f426[_0xf79b('0x52')]),{'include':_0x53f426[_0xf79b('0x3f')][_0xf79b('0x4b')]?[{'all':!![]}]:undefined})[_0xf79b('0x28')](function(_0x4fa99f){var _0x50d557=_0x53f426[_0xf79b('0x5d')][_0xf79b('0x53')]({'plain':!![]});if(!_0x50d557)throw new Error(_0xf79b('0x5e'));if(_0x50d557[_0xf79b('0x54')]==='user'){var _0x248f67=_0x4fa99f[_0xf79b('0x53')]({'plain':!![]});var _0x238168=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a')},{'name':_0xf79b('0x2b'),'value':_0xf79b('0x2c')}];var _0x59a8bf=_[_0xf79b('0x51')](_0x238168,[_0xf79b('0x2f'),_0x248f67[_0xf79b('0x30')]])[_0xf79b('0x31')];return db[_0xf79b('0x55')][_0xf79b('0x51')]({'where':{'name':_0x59a8bf,'userProfileId':_0x50d557['userProfileId']},'raw':!![]})[_0xf79b('0x28')](function(_0xecaf56){if(_0xecaf56&&_0xecaf56[_0xf79b('0x57')]===0x0){return db[_0xf79b('0x32')][_0xf79b('0x58')]({'name':_0x248f67[_0xf79b('0x31')],'resourceId':_0x248f67['id'],'type':_0xecaf56[_0xf79b('0x31')],'sectionId':_0xecaf56['id']},{})['then'](function(){return _0x4fa99f;});}else{return _0x4fa99f;}})[_0xf79b('0x4f')](function(_0x556d7a){logger[_0xf79b('0x5f')](_0xf79b('0x60'),_0x556d7a);throw _0x556d7a;});}return _0x4fa99f;});}})[_0xf79b('0x28')](respondWithResult(_0x4c4fdb,0xc9))[_0xf79b('0x4f')](handleError(_0x4c4fdb,null));};exports['update']=function(_0x350a99,_0x3e7858){if(_0x350a99[_0xf79b('0x52')]['id']){delete _0x350a99[_0xf79b('0x52')]['id'];}return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x350a99[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x3e7858,null))[_0xf79b('0x28')](saveUpdates(_0x350a99['body'],null))[_0xf79b('0x28')](respondWithResult(_0x3e7858,null))[_0xf79b('0x4f')](handleError(_0x3e7858,null));};exports[_0xf79b('0x33')]=function(_0x328012,_0x54272c){return db['VoiceQueue'][_0xf79b('0x51')]({'where':{'id':_0x328012[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x54272c,null))[_0xf79b('0x28')](removeEntity(_0x54272c,null))[_0xf79b('0x4f')](handleError(_0x54272c,null));};exports[_0xf79b('0x62')]=function(_0x3f2ab5,_0x258805,_0xf9ee15){var _0x168d8c={'raw':![],'where':{}};var _0x5133ba={};var _0x4b871c={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x3f2ab5[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0x258805,null))[_0xf79b('0x28')](function(_0x12360a){if(_0x12360a){_0x5133ba[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db[_0xf79b('0x64')][_0xf79b('0x59')]);_0x5133ba[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x3f2ab5['query']);_0x5133ba[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x5133ba['model'],_0x5133ba[_0xf79b('0x3f')]);_0x168d8c['attributes']=_[_0xf79b('0x3e')](_0x5133ba['model'],qs['fields'](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x168d8c[_0xf79b('0x41')]=_0x168d8c[_0xf79b('0x41')][_0xf79b('0x42')]?_0x168d8c[_0xf79b('0x41')]:_0x5133ba['model'];if(!_0x3f2ab5['query'][_0xf79b('0x43')]('nolimit')){_0x168d8c[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x168d8c[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x3f2ab5['query'][_0xf79b('0x1f')]);}_0x168d8c[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x168d8c[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_['pick'](_0x3f2ab5[_0xf79b('0x3f')],_0x5133ba[_0xf79b('0x3d')]));_0x168d8c[_0xf79b('0x47')]['VoiceQueueId']=_0x12360a['id'];if(_0x3f2ab5['query']['filter']){_0x168d8c['where']=_['merge'](_0x168d8c[_0xf79b('0x47')],{'$or':_['map'](_0x168d8c[_0xf79b('0x41')],function(_0x55cd28){var _0x2c4b79={};_0x2c4b79[_0x55cd28]={'$like':'%'+_0x3f2ab5[_0xf79b('0x3f')]['filter']+'%'};return _0x2c4b79;})});}_0x168d8c=_[_0xf79b('0x49')]({},_0x168d8c,_0x3f2ab5['options']);return db[_0xf79b('0x64')][_0xf79b('0x21')]({'where':_0x168d8c['where']})['then'](function(_0x3c5a5f){_0x4b871c[_0xf79b('0x21')]=_0x3c5a5f;if(_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x168d8c[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x64')][_0xf79b('0x4d')](_0x168d8c);})[_0xf79b('0x28')](function(_0x548d9e){_0x4b871c['rows']=_0x548d9e;return _0x4b871c;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x258805,_0x168d8c))[_0xf79b('0x4f')](handleError(_0x258805,null));};exports[_0xf79b('0x65')]=function(_0x5736c9,_0xaad7b2,_0x427867){var _0x17cba2={'raw':!![],'where':{}};var _0x2f583c={};var _0x3b2df1={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x5736c9[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xaad7b2,null))[_0xf79b('0x28')](function(_0x2f9599){if(_0x2f9599){_0x2f583c[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['CmHopperHistory']['rawAttributes']);_0x2f583c[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x5736c9[_0xf79b('0x3f')]);_0x2f583c[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x2f583c[_0xf79b('0x3b')],_0x2f583c[_0xf79b('0x3f')]);_0x17cba2[_0xf79b('0x41')]=_['intersection'](_0x2f583c[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x5736c9['query'][_0xf79b('0x40')]));_0x17cba2[_0xf79b('0x41')]=_0x17cba2[_0xf79b('0x41')][_0xf79b('0x42')]?_0x17cba2[_0xf79b('0x41')]:_0x2f583c[_0xf79b('0x3b')];if(!_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x43')]('nolimit')){_0x17cba2[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x17cba2['offset']=qs['offset'](_0x5736c9[_0xf79b('0x3f')]['offset']);}_0x17cba2[_0xf79b('0x45')]=qs['sort'](_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x17cba2[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x5736c9['query'],_0x2f583c['filters']));_0x17cba2[_0xf79b('0x47')][_0xf79b('0x66')]=_0x2f9599['id'];if(_0x5736c9[_0xf79b('0x3f')]['filter']){_0x17cba2['where']=_[_0xf79b('0x49')](_0x17cba2[_0xf79b('0x47')],{'$or':_['map'](_0x17cba2['attributes'],function(_0x5f3abb){var _0x2575cf={};_0x2575cf[_0x5f3abb]={'$like':'%'+_0x5736c9['query'][_0xf79b('0x2d')]+'%'};return _0x2575cf;})});}_0x17cba2=_[_0xf79b('0x49')]({},_0x17cba2,_0x5736c9[_0xf79b('0x4a')]);return db['CmHopperHistory'][_0xf79b('0x21')]({'where':_0x17cba2[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x3f3a04){_0x3b2df1[_0xf79b('0x21')]=_0x3f3a04;if(_0x5736c9[_0xf79b('0x3f')]['includeAll']){_0x17cba2[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x67')][_0xf79b('0x4d')](_0x17cba2);})['then'](function(_0x50a177){_0x3b2df1[_0xf79b('0x4e')]=_0x50a177;return _0x3b2df1;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0xaad7b2,_0x17cba2))[_0xf79b('0x4f')](handleError(_0xaad7b2,null));};exports[_0xf79b('0x68')]=function(_0xfffb3c,_0x4600f4,_0x3f7002){var _0x27acc3={'raw':!![],'where':{}};var _0x41f8cb={};var _0x3f66bc={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0xfffb3c[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x4600f4,null))[_0xf79b('0x28')](function(_0x2f5482){if(_0x2f5482){_0x41f8cb[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['CmHopperFinal'][_0xf79b('0x59')]);_0x41f8cb[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0xfffb3c['query']);_0x41f8cb[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x41f8cb[_0xf79b('0x3b')],_0x41f8cb[_0xf79b('0x3f')]);_0x27acc3['attributes']=_[_0xf79b('0x3e')](_0x41f8cb['model'],qs[_0xf79b('0x40')](_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x27acc3[_0xf79b('0x41')]=_0x27acc3[_0xf79b('0x41')][_0xf79b('0x42')]?_0x27acc3[_0xf79b('0x41')]:_0x41f8cb['model'];if(!_0xfffb3c['query'][_0xf79b('0x43')](_0xf79b('0x44'))){_0x27acc3[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x27acc3[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0xfffb3c[_0xf79b('0x3f')]['offset']);}_0x27acc3['order']=qs[_0xf79b('0x46')](_0xfffb3c['query'][_0xf79b('0x46')]);_0x27acc3['where']=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0xfffb3c['query'],_0x41f8cb[_0xf79b('0x3d')]));_0x27acc3[_0xf79b('0x47')]['VoiceQueueId']=_0x2f5482['id'];if(_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x27acc3[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x27acc3['where'],{'$or':_[_0xf79b('0x2e')](_0x27acc3[_0xf79b('0x41')],function(_0x45e237){var _0xaf7330={};_0xaf7330[_0x45e237]={'$like':'%'+_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0xaf7330;})});}_0x27acc3=_['merge']({},_0x27acc3,_0xfffb3c[_0xf79b('0x4a')]);return db[_0xf79b('0x69')][_0xf79b('0x21')]({'where':_0x27acc3[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x4de0b2){_0x3f66bc[_0xf79b('0x21')]=_0x4de0b2;if(_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x27acc3[_0xf79b('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xf79b('0x4d')](_0x27acc3);})[_0xf79b('0x28')](function(_0x4b04e5){_0x3f66bc['rows']=_0x4b04e5;return _0x3f66bc;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x4600f4,_0x27acc3))[_0xf79b('0x4f')](handleError(_0x4600f4,null));};exports[_0xf79b('0x6a')]=function(_0x5df040,_0x114d9a,_0x4fd9de){var _0x244062={'raw':!![],'where':{}};var _0x254186={};var _0x353b37={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x5df040[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x114d9a,null))[_0xf79b('0x28')](function(_0x32417d){if(_0x32417d){_0x254186['model']=_[_0xf79b('0x3c')](db[_0xf79b('0x6b')][_0xf79b('0x59')]);_0x254186[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x5df040['query']);_0x254186['filters']=_[_0xf79b('0x3e')](_0x254186[_0xf79b('0x3b')],_0x254186['query']);_0x244062[_0xf79b('0x41')]=_['intersection'](_0x254186[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x5df040[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x244062[_0xf79b('0x41')]=_0x244062[_0xf79b('0x41')][_0xf79b('0x42')]?_0x244062[_0xf79b('0x41')]:_0x254186[_0xf79b('0x3b')];if(!_0x5df040[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x244062['limit']=qs[_0xf79b('0x20')](_0x5df040[_0xf79b('0x3f')]['limit']);_0x244062[_0xf79b('0x1f')]=qs['offset'](_0x5df040[_0xf79b('0x3f')]['offset']);}_0x244062[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x5df040['query'][_0xf79b('0x46')]);_0x244062[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x5df040['query'],_0x254186[_0xf79b('0x3d')]));_0x244062[_0xf79b('0x47')]['VoiceQueueId']=_0x32417d['id'];if(_0x5df040[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x244062[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x244062[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x244062[_0xf79b('0x41')],function(_0x21eb55){var _0x53659e={};_0x53659e[_0x21eb55]={'$like':'%'+_0x5df040['query']['filter']+'%'};return _0x53659e;})});}_0x244062=_['merge']({},_0x244062,_0x5df040[_0xf79b('0x4a')]);return db['CmHopperBlack'][_0xf79b('0x21')]({'where':_0x244062[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x4e294d){_0x353b37[_0xf79b('0x21')]=_0x4e294d;if(_0x5df040[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x244062[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x6b')][_0xf79b('0x4d')](_0x244062);})[_0xf79b('0x28')](function(_0x13ac83){_0x353b37['rows']=_0x13ac83;return _0x353b37;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x114d9a,_0x244062))[_0xf79b('0x4f')](handleError(_0x114d9a,null));};exports[_0xf79b('0x6c')]=function(_0x513564,_0x2f375d,_0xd0ea98){var _0x2c5171={};var _0x7566a6={};var _0x1cd979;var _0xb42e23;return db['VoiceQueue'][_0xf79b('0x63')]({'where':{'id':_0x513564['params']['id']}})['then'](handleEntityNotFound(_0x2f375d,null))[_0xf79b('0x28')](function(_0x3d77e4){if(_0x3d77e4){_0x1cd979=_0x3d77e4;_0x7566a6[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['Team'][_0xf79b('0x59')]);_0x7566a6[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x513564['query']);_0x7566a6[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x7566a6['model'],_0x7566a6[_0xf79b('0x3f')]);_0x2c5171[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x7566a6['model'],qs[_0xf79b('0x40')](_0x513564[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x2c5171[_0xf79b('0x41')]=_0x2c5171[_0xf79b('0x41')][_0xf79b('0x42')]?_0x2c5171['attributes']:_0x7566a6[_0xf79b('0x3b')];_0x2c5171['order']=qs[_0xf79b('0x46')](_0x513564[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x2c5171[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_['pick'](_0x513564['query'],_0x7566a6['filters']));if(_0x513564[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x2c5171['where']=_[_0xf79b('0x49')](_0x2c5171['where'],{'$or':_['map'](_0x2c5171['attributes'],function(_0x237be3){var _0x30e43a={};_0x30e43a[_0x237be3]={'$like':'%'+_0x513564['query'][_0xf79b('0x2d')]+'%'};return _0x30e43a;})});}_0x2c5171=_['merge']({},_0x2c5171,_0x513564[_0xf79b('0x4a')]);return _0x1cd979[_0xf79b('0x6c')](_0x2c5171);}})[_0xf79b('0x28')](function(_0x326e7a){if(_0x326e7a){_0xb42e23=_0x326e7a['length'];if(!_0x513564[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x2c5171[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x513564['query'][_0xf79b('0x20')]);_0x2c5171[_0xf79b('0x1f')]=qs['offset'](_0x513564[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x1cd979['getTeams'](_0x2c5171);}})[_0xf79b('0x28')](function(_0x3fb819){if(_0x3fb819){return _0x3fb819?{'count':_0xb42e23,'rows':_0x3fb819}:null;}})[_0xf79b('0x28')](respondWithResult(_0x2f375d,null))['catch'](handleError(_0x2f375d,null));};exports[_0xf79b('0x6d')]=function(_0x404c4f,_0x458c16,_0x109344){var _0x36e719=_0x404c4f[_0xf79b('0x52')][_0xf79b('0x6e')];var _0x22e6d8=_[_0xf79b('0x2e')](_0x36e719,'id');return db[_0xf79b('0x6f')][_0xf79b('0x4d')]({'where':{'id':_0x22e6d8},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf79b('0x31'),_0xf79b('0x70'),'voicePause',_0xf79b('0x71')],'raw':!![]}]})[_0xf79b('0x28')](function(_0x15092c){if(_0x15092c){var _0xe229c7=_[_0xf79b('0x72')](_0x15092c,function(_0x12034f){var _0x4ae1eb=_0x12034f[_0xf79b('0x53')]({'plain':!![]});_0x4ae1eb[_0xf79b('0x73')][_0xf79b('0x74')](function(_0x4cc371){_0x4cc371[_0xf79b('0x75')]=_['find'](_0x36e719,{'id':_0x4ae1eb['id']})[_0xf79b('0x75')];});return _0x4ae1eb['Agents'];});return db[_0xf79b('0x38')]['find']({'where':{'id':_0x404c4f[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(_0x28974c){return db[_0xf79b('0x76')][_0xf79b('0x77')](function(_0x12bbce){return _0x28974c[_0xf79b('0x6d')](_0x22e6d8,{'transaction':_0x12bbce})['then'](function(){return BPromise[_0xf79b('0x78')](_0x36e719,function(_0x40eb1c){return db[_0xf79b('0x79')][_0xf79b('0x7a')]({'TeamId':_0x40eb1c['id'],'VoiceQueueId':_0x404c4f[_0xf79b('0x61')]['id'],'penalty':_0x40eb1c[_0xf79b('0x75')]},{'transaction':_0x12bbce});});})[_0xf79b('0x28')](function(){return BPromise[_0xf79b('0x78')](_0xe229c7,function(_0x471cf4){return db[_0xf79b('0x7b')][_0xf79b('0x7c')]({'where':{'UserId':_0x471cf4['id'],'VoiceQueueId':_0x404c4f[_0xf79b('0x61')]['id']},'defaults':{'penalty':_0x471cf4[_0xf79b('0x75')]},'transaction':_0x12bbce});});})[_0xf79b('0x28')](function(){return BPromise[_0xf79b('0x78')](_['filter'](_0xe229c7,{'online':!![]}),function(_0x1414c8){return db[_0xf79b('0x7d')][_0xf79b('0x7a')]({'membername':_0x1414c8[_0xf79b('0x31')],'UserId':_0x1414c8['id'],'queue_name':_0x28974c['name'],'VoiceQueueId':_0x28974c['id'],'interface':_[_0xf79b('0x7e')](_0x1414c8[_0xf79b('0x71')])?util[_0xf79b('0x7f')]('SIP/%s',_0x1414c8[_0xf79b('0x31')]):_0x1414c8['interface'],'paused':_0x1414c8[_0xf79b('0x80')]||![],'penalty':_0x1414c8['penalty']},{'transaction':_0x12bbce});});})['then'](function(){_0xe229c7[_0xf79b('0x74')](function(_0x30cb17){socket['emit'](_0xf79b('0x81'),{'UserId':_0x30cb17['id'],'VoiceQueueId':_0x28974c['id']});});});});});}})[_0xf79b('0x28')](respondWithStatusCode(_0x458c16,null))[_0xf79b('0x4f')](handleError(_0x458c16,null));};exports[_0xf79b('0x82')]=function(_0x12fb37,_0x489570,_0x27b742){return db[_0xf79b('0x6f')][_0xf79b('0x4d')]({'where':{'id':_0x12fb37[_0xf79b('0x3f')][_0xf79b('0x83')]},'attributes':['id'],'include':[{'model':db[_0xf79b('0x84')],'as':_0xf79b('0x73'),'attributes':['id'],'raw':!![]}]})[_0xf79b('0x28')](handleEntityNotFound(_0x489570,null))[_0xf79b('0x28')](function(_0x1244da){var _0x87bf3d=_[_0xf79b('0x2e')](_0x1244da,'id');var _0x5dc462=[];var _0x2187a4=[];var _0x30c670=squel[_0xf79b('0x85')]();_0x30c670[_0xf79b('0x86')](_0xf79b('0x87'))[_0xf79b('0x88')](_0xf79b('0x89'),'tq')[_0xf79b('0x8a')](_0xf79b('0x8b'),'ut',_0xf79b('0x8c'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x12fb37[_0xf79b('0x61')]['id']);for(var _0x9ec9eb=0x0;_0x9ec9eb<_0x1244da[_0xf79b('0x42')];_0x9ec9eb+=0x1){let _0x5721e0=_0x1244da[_0x9ec9eb];for(var _0x4a4057=0x0;_0x4a4057<_0x5721e0['Agents']['length'];_0x4a4057+=0x1){let _0x3636ea=_0x5721e0['Agents'][_0x4a4057];var _0x20106e=_0x30c670[_0xf79b('0x8e')]();_0x20106e[_0xf79b('0x47')]('ut.UserId\x20=\x20?',_0x3636ea['id']);_0x2187a4[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x20106e['toString'](),{'type':db[_0xf79b('0x76')]['QueryTypes'][_0xf79b('0x90')]})[_0xf79b('0x28')](function(_0x31dd41){if(_0x31dd41[_0xf79b('0x42')]===0x1){return _0x3636ea['id'];}else{var _0x2f94e9=_[_0xf79b('0x91')](_['map'](_0x31dd41,'TeamId'),function(_0x277ee1){return _[_0xf79b('0x92')](_0x87bf3d,_0x277ee1);});if(_0x2f94e9){return _0x3636ea['id'];}}}));}}return BPromise['all'](_0x2187a4)['then'](function(_0x192cff){_0x5dc462=_(_0x5dc462)['union'](_0x192cff)[_0xf79b('0x93')]()[_0xf79b('0x2f')]();return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x12fb37[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(_0x392763){return db['sequelize'][_0xf79b('0x77')](function(_0x95fa68){return _0x392763[_0xf79b('0x82')](_0x12fb37[_0xf79b('0x3f')][_0xf79b('0x83')],{'transaction':_0x95fa68})['then'](function(){if(!_[_0xf79b('0x94')](_0x5dc462)){return _0x392763[_0xf79b('0x95')](_0x5dc462,{'transaction':_0x95fa68})[_0xf79b('0x28')](function(){return db[_0xf79b('0x7d')][_0xf79b('0x33')]({'where':{'VoiceQueueId':_0x12fb37['params']['id'],'UserId':_0x5dc462},'transaction':_0x95fa68});});}})[_0xf79b('0x28')](function(){_0x5dc462['forEach'](function(_0x1e16b8){socket['emit']('userVoiceQueue:remove',{'UserId':_0x1e16b8,'VoiceQueueId':_0x392763['id']});});});});});});})[_0xf79b('0x28')](respondWithStatusCode(_0x489570,null))[_0xf79b('0x4f')](handleError(_0x489570,null));};exports[_0xf79b('0x96')]=function(_0x2bc949,_0x2d8345,_0x3366f2){var _0x2370fc,_0x1ce3e2;return db['VoiceQueue']['find']({'where':{'id':_0x2bc949[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x2d8345,null))[_0xf79b('0x28')](function(_0x396bed){if(_0x396bed){_0x1ce3e2=_0x396bed;return _0x396bed[_0xf79b('0x96')](_0x2bc949['body'][_0xf79b('0x83')],_[_0xf79b('0x5a')](_0x2bc949[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{})[_0xf79b('0x97')](function(_0x1381b2){for(var _0x172ea7=0x0;_0x172ea7<_0x2bc949['body'][_0xf79b('0x83')]['length'];_0x172ea7+=0x1){socket[_0xf79b('0x98')](_0xf79b('0x81'),{'UserId':Number(_0x2bc949[_0xf79b('0x52')][_0xf79b('0x83')][_0x172ea7]),'VoiceQueueId':Number(_0x2bc949['params']['id'])});}return _0x1381b2;});}})['then'](function(_0x4c2ffb){_0x2370fc=_0x4c2ffb||[];if(_0x1ce3e2){return db['User'][_0xf79b('0x4d')]({'where':{'id':_0x2bc949[_0xf79b('0x52')][_0xf79b('0x83')]},'attributes':['id',_0xf79b('0x31'),_0xf79b('0x70'),_0xf79b('0x80'),'interface'],'raw':!![]});}})[_0xf79b('0x28')](function(_0x1e75e0){if(!_[_0xf79b('0x94')](_0x1e75e0)){var _0x339529=[];for(var _0x5d2d84=0x0;_0x5d2d84<_0x1e75e0[_0xf79b('0x42')];_0x5d2d84++){if(_0x1e75e0[_0x5d2d84][_0xf79b('0x70')]){_0x339529['push'](db[_0xf79b('0x7d')][_0xf79b('0x7a')]({'membername':_0x1e75e0[_0x5d2d84][_0xf79b('0x31')],'UserId':_0x1e75e0[_0x5d2d84]['id'],'queue_name':_0x1ce3e2[_0xf79b('0x31')],'VoiceQueueId':_0x1ce3e2['id'],'interface':_['isNil'](_0x1e75e0[_0x5d2d84]['interface'])?util['format']('SIP/%s',_0x1e75e0[_0x5d2d84]['name']):_0x1e75e0[_0x5d2d84]['interface'],'paused':_0x1e75e0[_0x5d2d84][_0xf79b('0x80')]||![],'penalty':_0x2bc949[_0xf79b('0x52')][_0xf79b('0x75')]||0x0}));}}return BPromise[_0xf79b('0x99')](_0x339529);}})[_0xf79b('0x28')](function(){return _0x2370fc;})['then'](respondWithResult(_0x2d8345,null))[_0xf79b('0x4f')](handleError(_0x2d8345,null));};exports['removeAgents']=function(_0x2e4ffc,_0x45e78c,_0x2f9054){return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x2e4ffc[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0x45e78c,null))[_0xf79b('0x28')](function(_0x4dedf6){if(_0x4dedf6){return _0x4dedf6[_0xf79b('0x95')](_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')])['then'](function(){if(_[_0xf79b('0x9a')](_0x2e4ffc[_0xf79b('0x3f')]['ids'])){for(var _0x22b0a6=0x0;_0x22b0a6<_0x2e4ffc[_0xf79b('0x3f')]['ids'][_0xf79b('0x42')];_0x22b0a6+=0x1){socket[_0xf79b('0x98')]('userVoiceQueue:remove',{'UserId':Number(_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')][_0x22b0a6]),'VoiceQueueId':Number(_0x2e4ffc[_0xf79b('0x61')]['id'])});}}else{socket[_0xf79b('0x98')](_0xf79b('0x9b'),{'UserId':Number(_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')]),'VoiceQueueId':Number(_0x2e4ffc[_0xf79b('0x61')]['id'])});}});}})[_0xf79b('0x28')](function(_0x33d4d8){return db[_0xf79b('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x2e4ffc[_0xf79b('0x61')]['id'],'UserId':_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')]}})[_0xf79b('0x28')](function(){return _0x33d4d8;});})['then'](respondWithStatusCode(_0x45e78c,null))['catch'](handleError(_0x45e78c,null));};exports['getAgents']=function(_0x42c620,_0x57d492,_0x3b10bd){var _0x248b91={};var _0x20aaca={};var _0x32f68f;var _0x2537fe;return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x42c620[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x57d492,null))['then'](function(_0x46c38c){if(_0x46c38c){_0x32f68f=_0x46c38c;_0x20aaca[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['User'][_0xf79b('0x59')]);_0x20aaca[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x42c620['query']);_0x20aaca[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x20aaca['model'],_0x20aaca[_0xf79b('0x3f')]);_0x248b91['attributes']=_[_0xf79b('0x3e')](_0x20aaca[_0xf79b('0x3b')],qs['fields'](_0x42c620[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x248b91[_0xf79b('0x41')]=_0x248b91['attributes'][_0xf79b('0x42')]?_0x248b91['attributes']:_0x20aaca[_0xf79b('0x3b')];_0x248b91[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x42c620['query']['sort']);_0x248b91['where']=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x42c620[_0xf79b('0x3f')],_0x20aaca[_0xf79b('0x3d')]));if(_0x42c620[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x248b91[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x248b91['where'],{'$or':_[_0xf79b('0x2e')](_0x248b91[_0xf79b('0x41')],function(_0x25fafe){var _0x2fbbee={};_0x2fbbee[_0x25fafe]={'$like':'%'+_0x42c620[_0xf79b('0x3f')]['filter']+'%'};return _0x2fbbee;})});}_0x248b91=_[_0xf79b('0x49')]({},_0x248b91,_0x42c620[_0xf79b('0x4a')]);return _0x32f68f[_0xf79b('0x9c')](_0x248b91);}})[_0xf79b('0x28')](function(_0x13b920){if(_0x13b920){_0x2537fe=_0x13b920[_0xf79b('0x42')];if(!_0x42c620[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x248b91['limit']=qs[_0xf79b('0x20')](_0x42c620['query']['limit']);_0x248b91['offset']=qs[_0xf79b('0x1f')](_0x42c620['query'][_0xf79b('0x1f')]);}return _0x32f68f[_0xf79b('0x9c')](_0x248b91);}})[_0xf79b('0x28')](function(_0x437d0e){if(_0x437d0e){return _0x437d0e?{'count':_0x2537fe,'rows':_0x437d0e}:null;}})[_0xf79b('0x28')](respondWithResult(_0x57d492,null))[_0xf79b('0x4f')](handleError(_0x57d492,null));};exports[_0xf79b('0x9d')]=function(_0x50d087,_0x26f570,_0x5b4d24){var _0x38925b={};var _0x368e79={};var _0x58e4a0;var _0x2f96f7;return db[_0xf79b('0x38')]['findOne']({'where':{'id':_0x50d087['params']['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x26f570,null))[_0xf79b('0x28')](function(_0x3d1711){if(_0x3d1711){_0x58e4a0=_0x3d1711;_0x368e79[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db[_0xf79b('0x7d')][_0xf79b('0x59')]);_0x368e79[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x50d087[_0xf79b('0x3f')]);_0x368e79[_0xf79b('0x3d')]=_['intersection'](_0x368e79[_0xf79b('0x3b')],_0x368e79[_0xf79b('0x3f')]);_0x38925b[_0xf79b('0x41')]=_['intersection'](_0x368e79[_0xf79b('0x3b')],qs['fields'](_0x50d087[_0xf79b('0x3f')]['fields']));_0x38925b['attributes']=_0x38925b[_0xf79b('0x41')]['length']?_0x38925b[_0xf79b('0x41')]:_0x368e79[_0xf79b('0x3b')];_0x38925b['order']=qs['sort'](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x38925b[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x50d087[_0xf79b('0x3f')],_0x368e79[_0xf79b('0x3d')]));if(_0x50d087['query'][_0xf79b('0x2d')]){_0x38925b[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x38925b[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x38925b[_0xf79b('0x41')],function(_0x236c5b){var _0x3b9a66={};_0x3b9a66[_0x236c5b]={'$like':'%'+_0x50d087[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x3b9a66;})});}_0x38925b=_[_0xf79b('0x49')]({},_0x38925b,_0x50d087['options']);return _0x58e4a0['getMembers'](_0x38925b);}})[_0xf79b('0x28')](function(_0x381ab8){if(_0x381ab8){_0x2f96f7=_0x381ab8[_0xf79b('0x42')];if(!_0x50d087[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x38925b[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x38925b[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x58e4a0[_0xf79b('0x9d')](_0x38925b);}})['then'](function(_0xa4cef3){return _0xa4cef3?{'count':_0x2f96f7,'rows':_0xa4cef3}:null;})[_0xf79b('0x28')](respondWithResult(_0x26f570,null))['catch'](handleError(_0x26f570,null));};exports[_0xf79b('0x9e')]=function(_0x575190,_0x23e0a6,_0x5ea33d){var _0x3d3664={};var _0x198a21={};var _0x29c491;var _0x31d0f3;return db['VoiceQueue']['findOne']({'where':{'id':_0x575190['params']['id']}})['then'](handleEntityNotFound(_0x23e0a6,null))[_0xf79b('0x28')](function(_0x537123){if(_0x537123){_0x29c491=_0x537123;_0x198a21['model']=_[_0xf79b('0x3c')](db[_0xf79b('0x9f')][_0xf79b('0x59')]);_0x198a21[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x575190['query']);_0x198a21[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x198a21[_0xf79b('0x3b')],_0x198a21[_0xf79b('0x3f')]);_0x3d3664[_0xf79b('0x41')]=_['intersection'](_0x198a21[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x575190[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x3d3664[_0xf79b('0x41')]=_0x3d3664[_0xf79b('0x41')][_0xf79b('0x42')]?_0x3d3664[_0xf79b('0x41')]:_0x198a21[_0xf79b('0x3b')];_0x3d3664[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x575190[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x3d3664[_0xf79b('0x47')]=qs['filters'](_[_0xf79b('0x48')](_0x575190[_0xf79b('0x3f')],_0x198a21['filters']));if(_0x575190['query'][_0xf79b('0x2d')]){_0x3d3664['where']=_['merge'](_0x3d3664[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x3d3664['attributes'],function(_0x4204d4){var _0x1519b3={};_0x1519b3[_0x4204d4]={'$like':'%'+_0x575190['query']['filter']+'%'};return _0x1519b3;})});}_0x3d3664=_[_0xf79b('0x49')]({},_0x3d3664,_0x575190[_0xf79b('0x4a')]);return _0x29c491[_0xf79b('0x9e')](_0x3d3664);}})[_0xf79b('0x28')](function(_0x468bb7){if(_0x468bb7){_0x31d0f3=_0x468bb7[_0xf79b('0x42')];if(!_0x575190[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x3d3664['limit']=qs['limit'](_0x575190[_0xf79b('0x3f')]['limit']);_0x3d3664[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x575190[_0xf79b('0x3f')]['offset']);}return _0x29c491[_0xf79b('0x9e')](_0x3d3664);}})[_0xf79b('0x28')](function(_0x6bc286){if(_0x6bc286){return _0x6bc286?{'count':_0x31d0f3,'rows':_0x6bc286}:null;}})[_0xf79b('0x28')](respondWithResult(_0x23e0a6,null))['catch'](handleError(_0x23e0a6,null));};exports[_0xf79b('0xa0')]=function(_0x202b0b,_0xab5f90,_0x2f7361){var _0x4c09c0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x399615,_0x508801;return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x202b0b[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0xab5f90,null))[_0xf79b('0x28')](function(_0x4a3825){if(_0x4a3825){_0x508801=_0x4a3825;return _0x4a3825[_0xf79b('0xa0')](_0x202b0b[_0xf79b('0x52')][_0xf79b('0x83')],_['omit'](_0x202b0b[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{});}return null;})['spread'](function(_0x333fe9){var _0x3691ac;_0x399615=_0x333fe9||[];var _0x3a17f2=[];if(_0x333fe9){for(var _0x2064a9=0x0;_0x2064a9<_0x333fe9[_0xf79b('0x42')];_0x2064a9+=0x1){var _0x42b6a0=_0x333fe9[_0x2064a9][_0xf79b('0x53')]({'plain':!![]});_0x508801[_0xf79b('0xa1')]=_0x202b0b['body'][_0xf79b('0xa1')]?_0x202b0b[_0xf79b('0x52')]['dialCheckDuplicateType']:_0x508801['dialCheckDuplicateType'];switch(_0x508801[_0xf79b('0xa1')]){case'always':_0x3691ac=squel['insert']()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')](['phone','scheduledAt',_0xf79b('0xa5'),_0xf79b('0xa6'),_0xf79b('0x66'),_0xf79b('0x5b'),_0xf79b('0x5c')],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27','scheduledAt')[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))['field'](_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))['from'](_0xf79b('0xaa'))['where'](_0xf79b('0xab'))[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xf79b('0x47')](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xae'))[_0xf79b('0x88')](_0xf79b('0xaf'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b['params']['id'][_0xf79b('0xa9')]()))['where'](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb0'))['from']('cm_hopper')[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')]())))['toString']();break;case _0xf79b('0xb1'):_0x3691ac=squel[_0xf79b('0xb2')]()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')]([_0xf79b('0xa7'),_0xf79b('0xb3'),_0xf79b('0xa5'),'ListId',_0xf79b('0x66'),_0xf79b('0x5b'),'updatedAt'],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0xb3'))[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x42b6a0[_0xf79b('0xa8')]['toString'](),_0xf79b('0xa6'))['field'](_0x202b0b['params']['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27','createdAt')[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))['from'](_0xf79b('0xaa'))[_0xf79b('0x47')]('deletedAt\x20IS\x20NULL')[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')](_0xf79b('0xb4'))[_0xf79b('0x47')](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb0'))[_0xf79b('0x88')](_0xf79b('0xa3'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')]())))['toString']();break;default:_0x3691ac=squel[_0xf79b('0xb2')]()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')](['phone','scheduledAt',_0xf79b('0xa5'),_0xf79b('0xa6'),'VoiceQueueId','createdAt',_0xf79b('0x5c')],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0xb3'))[_0xf79b('0x86')]('id','ContactId')['field'](_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))[_0xf79b('0x86')](_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xaa'))[_0xf79b('0x47')](_0xf79b('0xab'))[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf79b('0xa9')]();}_0x3a17f2['push'](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x3691ac));}return BPromise[_0xf79b('0x99')](_0x3a17f2);}})[_0xf79b('0x28')](function(){var _0x4271f1=[];var _0x54a3d7=squel['insert']()[_0xf79b('0xa2')](_0xf79b('0xb5'))[_0xf79b('0xa4')]([_0xf79b('0xb6'),_0xf79b('0xa7'),_0xf79b('0xb7'),'createdAt',_0xf79b('0x5c')],squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb8'))['field'](_0xf79b('0xb9'))[_0xf79b('0x86')]('ci.OrderBy+1')[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xba'),'ci')[_0xf79b('0x8a')](_0xf79b('0xa3'),'h','h.ContactId=ci.CmContactId')['where']('h.scheduledat=?',_0x4c09c0)[_0xf79b('0x47')](_0xf79b('0xbb'),_0xf79b('0xbc')))[_0xf79b('0xa9')]();_0x4271f1[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x54a3d7));return BPromise[_0xf79b('0x99')](_0x4271f1);})[_0xf79b('0x28')](function(){return _0x399615;})[_0xf79b('0x28')](respondWithResult(_0xab5f90,null))['catch'](handleError(_0xab5f90,null));};exports['removeLists']=function(_0x36bc82,_0x528e5b,_0x2a98eb){return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x36bc82[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x528e5b,null))['then'](function(_0x4f3e75){if(_0x4f3e75){return _0x4f3e75[_0xf79b('0xbd')](_0x36bc82[_0xf79b('0x3f')][_0xf79b('0x83')]);}})['then'](function(_0x1d7e3f){if(_0x1d7e3f){return db[_0xf79b('0x64')][_0xf79b('0x33')]({'where':{'ListId':_0x36bc82[_0xf79b('0x3f')][_0xf79b('0x83')],'VoiceQueueId':_0x36bc82[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(){return _0x1d7e3f;});}})['then'](respondWithStatusCode(_0x528e5b,null))[_0xf79b('0x4f')](handleError(_0x528e5b,null));};exports[_0xf79b('0xbe')]=function(_0x10d3d2,_0xd2d6c6,_0x5bb383){var _0x209ee4={};var _0x3db7bd={};var _0x409e86;var _0x326195;return db['VoiceQueue'][_0xf79b('0x63')]({'where':{'id':_0x10d3d2[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xd2d6c6,null))[_0xf79b('0x28')](function(_0x234b8f){if(_0x234b8f){_0x409e86=_0x234b8f;_0x3db7bd['model']=_[_0xf79b('0x3c')](db['CmList'][_0xf79b('0x59')]);_0x3db7bd[_0xf79b('0x3f')]=_['keys'](_0x10d3d2['query']);_0x3db7bd[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x3db7bd['model'],_0x3db7bd[_0xf79b('0x3f')]);_0x209ee4[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x3db7bd[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x10d3d2['query'][_0xf79b('0x40')]));_0x209ee4[_0xf79b('0x41')]=_0x209ee4[_0xf79b('0x41')][_0xf79b('0x42')]?_0x209ee4[_0xf79b('0x41')]:_0x3db7bd['model'];_0x209ee4[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x209ee4[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x10d3d2[_0xf79b('0x3f')],_0x3db7bd[_0xf79b('0x3d')]));if(_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x209ee4['where']=_[_0xf79b('0x49')](_0x209ee4[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x209ee4[_0xf79b('0x41')],function(_0x4e0a14){var _0x20f212={};_0x20f212[_0x4e0a14]={'$like':'%'+_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x20f212;})});}_0x209ee4=_['merge']({},_0x209ee4,_0x10d3d2[_0xf79b('0x4a')]);return _0x409e86[_0xf79b('0xbe')](_0x209ee4);}})[_0xf79b('0x28')](function(_0x1a0b53){if(_0x1a0b53){_0x326195=_0x1a0b53[_0xf79b('0x42')];if(!_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x43')]('nolimit')){_0x209ee4[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x10d3d2['query']['limit']);_0x209ee4[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x409e86[_0xf79b('0xbe')](_0x209ee4);}})[_0xf79b('0x28')](function(_0x4748d5){if(_0x4748d5){return _0x4748d5?{'count':_0x326195,'rows':_0x4748d5}:null;}})[_0xf79b('0x28')](respondWithResult(_0xd2d6c6,null))['catch'](handleError(_0xd2d6c6,null));};exports[_0xf79b('0xbf')]=function(_0x562485,_0x4f0f16,_0x4f0c02){var _0x2bdfe0,_0x224260;return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x562485[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x4f0f16,null))[_0xf79b('0x28')](function(_0x365f29){if(_0x365f29){_0x224260=_0x365f29;return _0x365f29[_0xf79b('0xbf')](_0x562485[_0xf79b('0x52')][_0xf79b('0x83')],_['omit'](_0x562485[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{});}return null;})['spread'](function(_0x22d9bd){var _0x2e1a26;_0x2bdfe0=_0x22d9bd||[];var _0x802794=[];if(_0x22d9bd){for(var _0x46dfcc=0x0;_0x46dfcc<_0x22d9bd[_0xf79b('0x42')];_0x46dfcc+=0x1){var _0x2ea95d=_0x22d9bd[_0x46dfcc][_0xf79b('0x53')]({'plain':!![]});_0x2e1a26=squel[_0xf79b('0xb2')]()['into'](_0xf79b('0xc0'))['fromQuery']([_0xf79b('0xa7'),_0xf79b('0xa5'),_0xf79b('0xa6'),_0xf79b('0x66'),_0xf79b('0x5b'),_0xf79b('0x5c')],squel[_0xf79b('0x85')]()[_0xf79b('0x86')]('phone',_0xf79b('0xa7'))[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x2ea95d[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))[_0xf79b('0x86')](_0x562485[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')](_0xf79b('0xc1'),_0xf79b('0x5b'))[_0xf79b('0x86')](_0xf79b('0xc1'),_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xaa'))[_0xf79b('0x47')](_0xf79b('0xab'))['where'](_0xf79b('0xac'),_0x2ea95d['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')](_0xf79b('0xb4')))['toString']();_0x802794[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x2e1a26));}return BPromise[_0xf79b('0x99')](_0x802794);}})['then'](function(){return _0x2bdfe0;})[_0xf79b('0x28')](respondWithResult(_0x4f0f16,null))[_0xf79b('0x4f')](handleError(_0x4f0f16,null));};exports[_0xf79b('0xc2')]=function(_0x27ae4,_0xcc238b,_0x25ad0b){return db['VoiceQueue'][_0xf79b('0x51')]({'where':{'id':_0x27ae4['params']['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xcc238b,null))[_0xf79b('0x28')](function(_0x33fb1c){if(_0x33fb1c){return _0x33fb1c[_0xf79b('0xc2')](_0x27ae4[_0xf79b('0x3f')]['ids']);}})['then'](function(_0x5a59e1){if(_0x5a59e1){return db[_0xf79b('0x6b')][_0xf79b('0x33')]({'where':{'ListId':_0x27ae4[_0xf79b('0x3f')]['ids'],'VoiceQueueId':_0x27ae4['params']['id']}})[_0xf79b('0x28')](function(){return _0x5a59e1;});}})[_0xf79b('0x28')](respondWithStatusCode(_0xcc238b,null))[_0xf79b('0x4f')](handleError(_0xcc238b,null));}; \ No newline at end of file +var _0xc43c=['CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','error','stack','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','userVoiceQueue:save','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','TeamId','union','compact','removeTeams','isEmpty','removeAgents','emit','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','scheduledAt','cm_contacts','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','fromQuery','cm_hopper_additional_phones'];(function(_0x157b4a,_0xfb274c){var _0x3d8901=function(_0x5d14ab){while(--_0x5d14ab){_0x157b4a['push'](_0x157b4a['shift']());}};_0x3d8901(++_0xfb274c);}(_0xc43c,0xd4));var _0xcc43=function(_0xfd2d5f,_0x51feea){_0xfd2d5f=_0xfd2d5f-0x0;var _0x51dabe=_0xc43c[_0xfd2d5f];return _0x51dabe;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc43('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcc43('0x4'));var csv=require(_0xcc43('0x5'));var ejs=require(_0xcc43('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc43('0x7'));var squel=require(_0xcc43('0x8'));var crypto=require(_0xcc43('0x9'));var jsforce=require(_0xcc43('0xa'));var deskjs=require(_0xcc43('0xb'));var toCsv=require(_0xcc43('0x5'));var querystring=require(_0xcc43('0xc'));var Papa=require(_0xcc43('0xd'));var Redis=require('ioredis');var authService=require(_0xcc43('0xe'));var qs=require(_0xcc43('0xf'));var as=require(_0xcc43('0x10'));var hardwareService=require(_0xcc43('0x11'));var logger=require(_0xcc43('0x12'))(_0xcc43('0x13'));var utils=require(_0xcc43('0x14'));var config=require(_0xcc43('0x15'));var licenseUtil=require(_0xcc43('0x16'));var db=require(_0xcc43('0x17'))['db'];config[_0xcc43('0x18')]=_['defaults'](config[_0xcc43('0x18')],{'host':_0xcc43('0x19'),'port':0x18eb});var socket=require(_0xcc43('0x1a'))(new Redis(config[_0xcc43('0x18')]));require('./voiceQueue.socket')[_0xcc43('0x1b')](socket);function respondWithStatusCode(_0x446095,_0x12fec8){_0x12fec8=_0x12fec8||0xcc;return function(_0x97c8ec){if(_0x97c8ec){return _0x446095[_0xcc43('0x1c')](_0x12fec8);}return _0x446095['status'](_0x12fec8)[_0xcc43('0x1d')]();};}function respondWithResult(_0x3a1933,_0x519321){_0x519321=_0x519321||0xc8;return function(_0x3fb33c){if(_0x3fb33c){return _0x3a1933['status'](_0x519321)[_0xcc43('0x1e')](_0x3fb33c);}};}function respondWithFilteredResult(_0x43ed95,_0xfbff32){return function(_0x50348a){if(_0x50348a){var _0x44628c=typeof _0xfbff32[_0xcc43('0x1f')]===_0xcc43('0x20')&&typeof _0xfbff32[_0xcc43('0x21')]==='undefined';var _0x2d526e=_0x50348a[_0xcc43('0x22')];var _0x57bd2d=_0x44628c?0x0:_0xfbff32[_0xcc43('0x1f')];var _0x58d7fb=_0x44628c?_0x50348a[_0xcc43('0x22')]:_0xfbff32['offset']+_0xfbff32[_0xcc43('0x21')];var _0x2a604e;if(_0x58d7fb>=_0x2d526e){_0x58d7fb=_0x2d526e;_0x2a604e=0xc8;}else{_0x2a604e=0xce;}_0x43ed95[_0xcc43('0x23')](_0x2a604e);return _0x43ed95['set'](_0xcc43('0x24'),_0x57bd2d+'-'+_0x58d7fb+'/'+_0x2d526e)['json'](_0x50348a);}return null;};}function patchUpdates(_0x1a578f){return function(_0x3c94e8){try{jsonpatch[_0xcc43('0x25')](_0x3c94e8,_0x1a578f,!![]);}catch(_0x948783){return BPromise[_0xcc43('0x26')](_0x948783);}return _0x3c94e8['save']();};}function saveUpdates(_0x2ba3d0,_0x164551){return function(_0x5caa7a){if(_0x5caa7a){return _0x5caa7a[_0xcc43('0x27')](_0x2ba3d0)[_0xcc43('0x28')](function(_0x7838d0){return _0x7838d0;});}return null;};}function removeEntity(_0x55fd66,_0x35d2a1){return function(_0x480662){if(_0x480662){return _0x480662[_0xcc43('0x29')]()[_0xcc43('0x28')](function(){var _0x399d3a=_0x480662[_0xcc43('0x2a')]({'plain':!![]});var _0x1f25fe=[{'name':'VoiceQueues','value':_0xcc43('0x2b'),'ignore':![]},{'name':_0xcc43('0x2c'),'value':_0xcc43('0x2d'),'ignore':![]}];var _0x200f72=_(_0x1f25fe)[_0xcc43('0x2e')](_0xcc43('0x2f'))['map'](_0xcc43('0x30'))[_0xcc43('0x30')]();if(_[_0xcc43('0x31')](_0x200f72,_0x399d3a[_0xcc43('0x32')])){return;}var _0x532526=_[_0xcc43('0x33')](_0x1f25fe,[_0xcc43('0x30'),_0x399d3a[_0xcc43('0x32')]])[_0xcc43('0x34')];return db['UserProfileResource'][_0xcc43('0x29')]({'where':{'type':_0x532526,'resourceId':_0x399d3a['id']}})[_0xcc43('0x28')](function(){return _0x480662;});})[_0xcc43('0x28')](function(){_0x55fd66[_0xcc43('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e68dc,_0x234b98){return function(_0x1b2b0f){if(!_0x1b2b0f){_0x4e68dc[_0xcc43('0x1c')](0x194);}return _0x1b2b0f;};}function handleError(_0x799a9d,_0x1ea5e9){_0x1ea5e9=_0x1ea5e9||0x1f4;return function(_0x1b8e47){logger[_0xcc43('0x35')](_0x1b8e47[_0xcc43('0x36')]);if(_0x1b8e47['name']){delete _0x1b8e47[_0xcc43('0x34')];}_0x799a9d['status'](_0x1ea5e9)['send'](_0x1b8e47);};}exports[_0xcc43('0x37')]=function(_0x125d24,_0xc4f761){var _0x1c9f99={},_0x257c58={},_0x5a79d1={'count':0x0,'rows':[]};var _0x52e8e9=_['map'](db['VoiceQueue'][_0xcc43('0x38')],function(_0x2144e3){return{'name':_0x2144e3[_0xcc43('0x39')],'type':_0x2144e3['type'][_0xcc43('0x3a')]};});_0x257c58[_0xcc43('0x3b')]=_[_0xcc43('0x3c')](_0x52e8e9,'name');_0x257c58[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x125d24['query']);_0x257c58[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x257c58[_0xcc43('0x3b')],_0x257c58[_0xcc43('0x3d')]);_0x1c9f99[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x257c58[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x125d24[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x1c9f99[_0xcc43('0x41')]=_0x1c9f99[_0xcc43('0x41')][_0xcc43('0x43')]?_0x1c9f99[_0xcc43('0x41')]:_0x257c58['model'];if(!_0x125d24[_0xcc43('0x3d')][_0xcc43('0x44')]('nolimit')){_0x1c9f99[_0xcc43('0x21')]=qs['limit'](_0x125d24[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x1c9f99[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x125d24[_0xcc43('0x3d')][_0xcc43('0x1f')]);}_0x1c9f99[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x125d24['query']['sort']);_0x1c9f99['where']=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x125d24[_0xcc43('0x3d')],_0x257c58[_0xcc43('0x3f')]),_0x52e8e9);if(_0x125d24['query'][_0xcc43('0x2e')]){_0x1c9f99[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x1c9f99['where'],{'$or':_['map'](_0x52e8e9,function(_0xfb9c30){if(_0xfb9c30[_0xcc43('0x32')]!==_0xcc43('0x4a')){var _0x255d2d={};_0x255d2d[_0xfb9c30['name']]={'$like':'%'+_0x125d24[_0xcc43('0x3d')]['filter']+'%'};return _0x255d2d;}})});}_0x1c9f99=_['merge']({},_0x1c9f99,_0x125d24[_0xcc43('0x4b')]);var _0x77db19={'where':_0x1c9f99[_0xcc43('0x48')]};return db[_0xcc43('0x4c')]['count'](_0x77db19)['then'](function(_0x11ba03){_0x5a79d1[_0xcc43('0x22')]=_0x11ba03;if(_0x125d24[_0xcc43('0x3d')][_0xcc43('0x4d')]){_0x1c9f99[_0xcc43('0x4e')]=[{'all':!![]}];}return db[_0xcc43('0x4c')][_0xcc43('0x4f')](_0x1c9f99);})[_0xcc43('0x28')](function(_0x2f78d9){_0x5a79d1[_0xcc43('0x50')]=_0x2f78d9;return _0x5a79d1;})[_0xcc43('0x28')](respondWithFilteredResult(_0xc4f761,_0x1c9f99))[_0xcc43('0x51')](handleError(_0xc4f761,null));};exports[_0xcc43('0x52')]=function(_0x46c167,_0x318ca7){var _0x949ae9={'raw':![],'where':{'id':_0x46c167[_0xcc43('0x53')]['id']}},_0x15b6a5={};_0x15b6a5['model']=_[_0xcc43('0x3e')](db['VoiceQueue'][_0xcc43('0x38')]);_0x15b6a5[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x46c167[_0xcc43('0x3d')]);_0x15b6a5['filters']=_[_0xcc43('0x40')](_0x15b6a5[_0xcc43('0x3b')],_0x15b6a5['query']);_0x949ae9[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x15b6a5[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x46c167[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x949ae9[_0xcc43('0x41')]=_0x949ae9[_0xcc43('0x41')][_0xcc43('0x43')]?_0x949ae9[_0xcc43('0x41')]:_0x15b6a5[_0xcc43('0x3b')];if(_0x46c167['query'][_0xcc43('0x4d')]){_0x949ae9[_0xcc43('0x4e')]=[{'all':!![]}];}_0x949ae9=_['merge']({},_0x949ae9,_0x46c167[_0xcc43('0x4b')]);return db[_0xcc43('0x4c')][_0xcc43('0x33')](_0x949ae9)[_0xcc43('0x28')](handleEntityNotFound(_0x318ca7,null))[_0xcc43('0x28')](respondWithResult(_0x318ca7,null))['catch'](handleError(_0x318ca7,null));};exports[_0xcc43('0x54')]=function(_0x216208,_0x4334dd){return db[_0xcc43('0x4c')][_0xcc43('0x54')](_0x216208[_0xcc43('0x55')],{})[_0xcc43('0x28')](function(_0x426fe2){var _0x3b93e5=_0x216208[_0xcc43('0x56')][_0xcc43('0x2a')]({'plain':!![]});if(!_0x3b93e5)throw new Error(_0xcc43('0x57'));if(_0x3b93e5[_0xcc43('0x58')]==='user'){var _0x395c76=_0x426fe2['get']({'plain':!![]});var _0xc1e590=[{'name':_0xcc43('0x59'),'value':_0xcc43('0x2b')},{'name':_0xcc43('0x2c'),'value':_0xcc43('0x2d')}];var _0x57f6bc=_[_0xcc43('0x33')](_0xc1e590,['value',_0x395c76[_0xcc43('0x32')]])[_0xcc43('0x34')];return db[_0xcc43('0x5a')][_0xcc43('0x33')]({'where':{'name':_0x57f6bc,'userProfileId':_0x3b93e5[_0xcc43('0x5b')]},'raw':!![]})[_0xcc43('0x28')](function(_0x87253f){if(_0x87253f&&_0x87253f[_0xcc43('0x5c')]===0x0){return db[_0xcc43('0x5d')][_0xcc43('0x54')]({'name':_0x395c76[_0xcc43('0x34')],'resourceId':_0x395c76['id'],'type':_0x87253f[_0xcc43('0x34')],'sectionId':_0x87253f['id']},{})[_0xcc43('0x28')](function(){return _0x426fe2;});}else{return _0x426fe2;}})[_0xcc43('0x51')](function(_0x8a15d){logger[_0xcc43('0x35')](_0xcc43('0x5e'),_0x8a15d);throw _0x8a15d;});}return _0x426fe2;})['then'](respondWithResult(_0x4334dd,0xc9))[_0xcc43('0x51')](handleError(_0x4334dd,null));};exports[_0xcc43('0x5f')]=function(_0x10a5f1,_0x1a3f09){var _0xfa62ad={'where':{'id':_0x10a5f1[_0xcc43('0x53')]['id']}},_0x44fc66={};_0x44fc66[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db['VoiceQueue'][_0xcc43('0x38')]);_0xfa62ad['attributes']=_['intersection'](_0x44fc66[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x10a5f1[_0xcc43('0x3d')][_0xcc43('0x42')]));_0xfa62ad[_0xcc43('0x41')]=_0xfa62ad['attributes'][_0xcc43('0x43')]?_0xfa62ad[_0xcc43('0x41')]:_0x44fc66[_0xcc43('0x3b')];if(_0x10a5f1[_0xcc43('0x3d')][_0xcc43('0x4d')]){_0xfa62ad[_0xcc43('0x4e')]=[{'all':!![]}];}_0xfa62ad=_[_0xcc43('0x49')]({},_0xfa62ad,_0x10a5f1['options']);return db[_0xcc43('0x4c')][_0xcc43('0x33')](_0xfa62ad)[_0xcc43('0x28')](handleEntityNotFound(_0x1a3f09,null))['then'](function(_0x274896){if(_0x274896){var _0x3b55b9=_0x274896[_0xcc43('0x2a')]({'plain':!![]});_0x3b55b9=qs[_0xcc43('0x60')](_0x3b55b9,['id',_0xcc43('0x61'),_0xcc43('0x62')]);_0x10a5f1['body']=_['omit'](_0x10a5f1[_0xcc43('0x55')],['id',_0xcc43('0x61'),_0xcc43('0x62')]);return db[_0xcc43('0x4c')]['create'](_[_0xcc43('0x49')](_0x3b55b9,_0x10a5f1[_0xcc43('0x55')]),{'include':_0x10a5f1['query'][_0xcc43('0x4d')]?[{'all':!![]}]:undefined})[_0xcc43('0x28')](function(_0x44bb3d){var _0x4b4cd1=_0x10a5f1[_0xcc43('0x56')][_0xcc43('0x2a')]({'plain':!![]});if(!_0x4b4cd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b4cd1[_0xcc43('0x58')]===_0xcc43('0x56')){var _0x2a54c0=_0x44bb3d[_0xcc43('0x2a')]({'plain':!![]});var _0x204d6b=[{'name':_0xcc43('0x59'),'value':_0xcc43('0x2b')},{'name':_0xcc43('0x2c'),'value':_0xcc43('0x2d')}];var _0x2c584f=_[_0xcc43('0x33')](_0x204d6b,[_0xcc43('0x30'),_0x2a54c0[_0xcc43('0x32')]])[_0xcc43('0x34')];return db[_0xcc43('0x5a')][_0xcc43('0x33')]({'where':{'name':_0x2c584f,'userProfileId':_0x4b4cd1[_0xcc43('0x5b')]},'raw':!![]})[_0xcc43('0x28')](function(_0x5058a7){if(_0x5058a7&&_0x5058a7[_0xcc43('0x5c')]===0x0){return db[_0xcc43('0x5d')][_0xcc43('0x54')]({'name':_0x2a54c0[_0xcc43('0x34')],'resourceId':_0x2a54c0['id'],'type':_0x5058a7[_0xcc43('0x34')],'sectionId':_0x5058a7['id']},{})[_0xcc43('0x28')](function(){return _0x44bb3d;});}else{return _0x44bb3d;}})[_0xcc43('0x51')](function(_0x30b807){logger[_0xcc43('0x35')](_0xcc43('0x5e'),_0x30b807);throw _0x30b807;});}return _0x44bb3d;});}})[_0xcc43('0x28')](respondWithResult(_0x1a3f09,0xc9))[_0xcc43('0x51')](handleError(_0x1a3f09,null));};exports['update']=function(_0x5cc52e,_0x2ebb74){if(_0x5cc52e[_0xcc43('0x55')]['id']){delete _0x5cc52e[_0xcc43('0x55')]['id'];}return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x5cc52e['params']['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x2ebb74,null))[_0xcc43('0x28')](saveUpdates(_0x5cc52e[_0xcc43('0x55')],null))['then'](respondWithResult(_0x2ebb74,null))[_0xcc43('0x51')](handleError(_0x2ebb74,null));};exports[_0xcc43('0x29')]=function(_0xb827aa,_0x1df26d){return db[_0xcc43('0x4c')]['find']({'where':{'id':_0xb827aa[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x1df26d,null))[_0xcc43('0x28')](removeEntity(_0x1df26d,null))[_0xcc43('0x51')](handleError(_0x1df26d,null));};exports[_0xcc43('0x63')]=function(_0x4bc0ef,_0x503a8e,_0x1f7db3){var _0x4336cb={'raw':![],'where':{}};var _0x5c1d48={};var _0x4d7b56={'count':0x0,'rows':[]};return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x4bc0ef[_0xcc43('0x53')]['id']}})['then'](handleEntityNotFound(_0x503a8e,null))[_0xcc43('0x28')](function(_0x57510f){if(_0x57510f){_0x5c1d48[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db[_0xcc43('0x65')][_0xcc43('0x38')]);_0x5c1d48[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x4bc0ef[_0xcc43('0x3d')]);_0x5c1d48['filters']=_['intersection'](_0x5c1d48[_0xcc43('0x3b')],_0x5c1d48[_0xcc43('0x3d')]);_0x4336cb[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x5c1d48[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x4336cb['attributes']=_0x4336cb[_0xcc43('0x41')][_0xcc43('0x43')]?_0x4336cb[_0xcc43('0x41')]:_0x5c1d48[_0xcc43('0x3b')];if(!_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x44')](_0xcc43('0x66'))){_0x4336cb['limit']=qs[_0xcc43('0x21')](_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x4336cb[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x1f')]);}_0x4336cb[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x4336cb[_0xcc43('0x48')]=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x4bc0ef[_0xcc43('0x3d')],_0x5c1d48[_0xcc43('0x3f')]));_0x4336cb[_0xcc43('0x48')][_0xcc43('0x67')]=_0x57510f['id'];if(_0x4bc0ef['query']['filter']){_0x4336cb[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x4336cb[_0xcc43('0x48')],{'$or':_['map'](_0x4336cb['attributes'],function(_0xaa6dc1){var _0x2dae8d={};_0x2dae8d[_0xaa6dc1]={'$like':'%'+_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x2e')]+'%'};return _0x2dae8d;})});}_0x4336cb=_['merge']({},_0x4336cb,_0x4bc0ef[_0xcc43('0x4b')]);return db['CmHopper']['count']({'where':_0x4336cb['where']})[_0xcc43('0x28')](function(_0x21156c){_0x4d7b56[_0xcc43('0x22')]=_0x21156c;if(_0x4bc0ef[_0xcc43('0x3d')][_0xcc43('0x4d')]){_0x4336cb[_0xcc43('0x4e')]=[{'all':!![]}];}return db[_0xcc43('0x65')][_0xcc43('0x4f')](_0x4336cb);})[_0xcc43('0x28')](function(_0x23b24d){_0x4d7b56[_0xcc43('0x50')]=_0x23b24d;return _0x4d7b56;});}})['then'](respondWithFilteredResult(_0x503a8e,_0x4336cb))['catch'](handleError(_0x503a8e,null));};exports[_0xcc43('0x68')]=function(_0x49c1fb,_0xb9a885,_0x3b776d){var _0x55df07={'raw':!![],'where':{}};var _0x588c8c={};var _0x1b4a9e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xcc43('0x64')]({'where':{'id':_0x49c1fb[_0xcc43('0x53')]['id']}})['then'](handleEntityNotFound(_0xb9a885,null))[_0xcc43('0x28')](function(_0x2f9cab){if(_0x2f9cab){_0x588c8c['model']=_[_0xcc43('0x3e')](db['CmHopperHistory']['rawAttributes']);_0x588c8c[_0xcc43('0x3d')]=_['keys'](_0x49c1fb[_0xcc43('0x3d')]);_0x588c8c[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x588c8c[_0xcc43('0x3b')],_0x588c8c[_0xcc43('0x3d')]);_0x55df07[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x588c8c[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x49c1fb[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x55df07[_0xcc43('0x41')]=_0x55df07[_0xcc43('0x41')]['length']?_0x55df07[_0xcc43('0x41')]:_0x588c8c[_0xcc43('0x3b')];if(!_0x49c1fb['query'][_0xcc43('0x44')](_0xcc43('0x66'))){_0x55df07[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x49c1fb['query'][_0xcc43('0x21')]);_0x55df07[_0xcc43('0x1f')]=qs['offset'](_0x49c1fb[_0xcc43('0x3d')][_0xcc43('0x1f')]);}_0x55df07[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x49c1fb['query'][_0xcc43('0x46')]);_0x55df07['where']=qs['filters'](_[_0xcc43('0x47')](_0x49c1fb[_0xcc43('0x3d')],_0x588c8c[_0xcc43('0x3f')]));_0x55df07[_0xcc43('0x48')][_0xcc43('0x67')]=_0x2f9cab['id'];if(_0x49c1fb[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x55df07['where']=_[_0xcc43('0x49')](_0x55df07['where'],{'$or':_[_0xcc43('0x3c')](_0x55df07[_0xcc43('0x41')],function(_0x3eda5a){var _0x26cd31={};_0x26cd31[_0x3eda5a]={'$like':'%'+_0x49c1fb[_0xcc43('0x3d')][_0xcc43('0x2e')]+'%'};return _0x26cd31;})});}_0x55df07=_[_0xcc43('0x49')]({},_0x55df07,_0x49c1fb[_0xcc43('0x4b')]);return db['CmHopperHistory'][_0xcc43('0x22')]({'where':_0x55df07[_0xcc43('0x48')]})[_0xcc43('0x28')](function(_0x54b4b5){_0x1b4a9e[_0xcc43('0x22')]=_0x54b4b5;if(_0x49c1fb[_0xcc43('0x3d')][_0xcc43('0x4d')]){_0x55df07[_0xcc43('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xcc43('0x4f')](_0x55df07);})[_0xcc43('0x28')](function(_0x1c1500){_0x1b4a9e[_0xcc43('0x50')]=_0x1c1500;return _0x1b4a9e;});}})['then'](respondWithFilteredResult(_0xb9a885,_0x55df07))[_0xcc43('0x51')](handleError(_0xb9a885,null));};exports[_0xcc43('0x69')]=function(_0x237889,_0x474a80,_0x1bd453){var _0xff6053={'raw':!![],'where':{}};var _0x3a8f62={};var _0xa750c3={'count':0x0,'rows':[]};return db[_0xcc43('0x4c')]['findOne']({'where':{'id':_0x237889['params']['id']}})['then'](handleEntityNotFound(_0x474a80,null))['then'](function(_0x289524){if(_0x289524){_0x3a8f62['model']=_['keys'](db['CmHopperFinal'][_0xcc43('0x38')]);_0x3a8f62[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x237889[_0xcc43('0x3d')]);_0x3a8f62[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x3a8f62[_0xcc43('0x3b')],_0x3a8f62[_0xcc43('0x3d')]);_0xff6053[_0xcc43('0x41')]=_['intersection'](_0x3a8f62[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x237889[_0xcc43('0x3d')]['fields']));_0xff6053[_0xcc43('0x41')]=_0xff6053[_0xcc43('0x41')][_0xcc43('0x43')]?_0xff6053[_0xcc43('0x41')]:_0x3a8f62[_0xcc43('0x3b')];if(!_0x237889[_0xcc43('0x3d')]['hasOwnProperty']('nolimit')){_0xff6053[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x237889[_0xcc43('0x3d')][_0xcc43('0x21')]);_0xff6053[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x237889[_0xcc43('0x3d')][_0xcc43('0x1f')]);}_0xff6053[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x237889[_0xcc43('0x3d')]['sort']);_0xff6053[_0xcc43('0x48')]=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x237889['query'],_0x3a8f62['filters']));_0xff6053[_0xcc43('0x48')][_0xcc43('0x67')]=_0x289524['id'];if(_0x237889[_0xcc43('0x3d')]['filter']){_0xff6053[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0xff6053[_0xcc43('0x48')],{'$or':_[_0xcc43('0x3c')](_0xff6053['attributes'],function(_0x4e50ef){var _0xd4fe35={};_0xd4fe35[_0x4e50ef]={'$like':'%'+_0x237889[_0xcc43('0x3d')]['filter']+'%'};return _0xd4fe35;})});}_0xff6053=_[_0xcc43('0x49')]({},_0xff6053,_0x237889[_0xcc43('0x4b')]);return db[_0xcc43('0x6a')]['count']({'where':_0xff6053[_0xcc43('0x48')]})[_0xcc43('0x28')](function(_0x111eda){_0xa750c3['count']=_0x111eda;if(_0x237889['query'][_0xcc43('0x4d')]){_0xff6053['include']=[{'all':!![]}];}return db[_0xcc43('0x6a')][_0xcc43('0x4f')](_0xff6053);})['then'](function(_0x46b7c1){_0xa750c3[_0xcc43('0x50')]=_0x46b7c1;return _0xa750c3;});}})[_0xcc43('0x28')](respondWithFilteredResult(_0x474a80,_0xff6053))[_0xcc43('0x51')](handleError(_0x474a80,null));};exports[_0xcc43('0x6b')]=function(_0x563561,_0x3a3ac9,_0x6beb0f){var _0x5754d1={'raw':!![],'where':{}};var _0x45b3b6={};var _0x35466a={'count':0x0,'rows':[]};return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x563561['params']['id']}})['then'](handleEntityNotFound(_0x3a3ac9,null))['then'](function(_0x9c7291){if(_0x9c7291){_0x45b3b6[_0xcc43('0x3b')]=_['keys'](db[_0xcc43('0x6c')]['rawAttributes']);_0x45b3b6[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x563561[_0xcc43('0x3d')]);_0x45b3b6['filters']=_[_0xcc43('0x40')](_0x45b3b6[_0xcc43('0x3b')],_0x45b3b6[_0xcc43('0x3d')]);_0x5754d1[_0xcc43('0x41')]=_['intersection'](_0x45b3b6['model'],qs[_0xcc43('0x42')](_0x563561['query'][_0xcc43('0x42')]));_0x5754d1[_0xcc43('0x41')]=_0x5754d1[_0xcc43('0x41')][_0xcc43('0x43')]?_0x5754d1[_0xcc43('0x41')]:_0x45b3b6['model'];if(!_0x563561['query']['hasOwnProperty'](_0xcc43('0x66'))){_0x5754d1['limit']=qs[_0xcc43('0x21')](_0x563561[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x5754d1[_0xcc43('0x1f')]=qs['offset'](_0x563561['query'][_0xcc43('0x1f')]);}_0x5754d1[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x563561[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x5754d1[_0xcc43('0x48')]=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x563561['query'],_0x45b3b6['filters']));_0x5754d1[_0xcc43('0x48')][_0xcc43('0x67')]=_0x9c7291['id'];if(_0x563561[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x5754d1[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x5754d1[_0xcc43('0x48')],{'$or':_[_0xcc43('0x3c')](_0x5754d1[_0xcc43('0x41')],function(_0x34ef96){var _0x1010a1={};_0x1010a1[_0x34ef96]={'$like':'%'+_0x563561[_0xcc43('0x3d')]['filter']+'%'};return _0x1010a1;})});}_0x5754d1=_[_0xcc43('0x49')]({},_0x5754d1,_0x563561[_0xcc43('0x4b')]);return db[_0xcc43('0x6c')][_0xcc43('0x22')]({'where':_0x5754d1[_0xcc43('0x48')]})['then'](function(_0x3054e5){_0x35466a[_0xcc43('0x22')]=_0x3054e5;if(_0x563561['query']['includeAll']){_0x5754d1[_0xcc43('0x4e')]=[{'all':!![]}];}return db[_0xcc43('0x6c')][_0xcc43('0x4f')](_0x5754d1);})[_0xcc43('0x28')](function(_0x311283){_0x35466a[_0xcc43('0x50')]=_0x311283;return _0x35466a;});}})['then'](respondWithFilteredResult(_0x3a3ac9,_0x5754d1))[_0xcc43('0x51')](handleError(_0x3a3ac9,null));};exports['getTeams']=function(_0x1a91d4,_0x5757b6,_0x16cdbb){var _0x243076={};var _0x21b95c={};var _0x274026;var _0x26ffa2;return db['VoiceQueue']['findOne']({'where':{'id':_0x1a91d4[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x5757b6,null))[_0xcc43('0x28')](function(_0x1604f9){if(_0x1604f9){_0x274026=_0x1604f9;_0x21b95c[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db[_0xcc43('0x6d')][_0xcc43('0x38')]);_0x21b95c[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x1a91d4[_0xcc43('0x3d')]);_0x21b95c[_0xcc43('0x3f')]=_['intersection'](_0x21b95c['model'],_0x21b95c[_0xcc43('0x3d')]);_0x243076[_0xcc43('0x41')]=_['intersection'](_0x21b95c[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x1a91d4[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x243076[_0xcc43('0x41')]=_0x243076[_0xcc43('0x41')][_0xcc43('0x43')]?_0x243076[_0xcc43('0x41')]:_0x21b95c[_0xcc43('0x3b')];_0x243076['order']=qs['sort'](_0x1a91d4[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x243076[_0xcc43('0x48')]=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x1a91d4['query'],_0x21b95c['filters']));if(_0x1a91d4[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x243076[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x243076['where'],{'$or':_[_0xcc43('0x3c')](_0x243076['attributes'],function(_0x3895f4){var _0x243b4f={};_0x243b4f[_0x3895f4]={'$like':'%'+_0x1a91d4['query'][_0xcc43('0x2e')]+'%'};return _0x243b4f;})});}_0x243076=_[_0xcc43('0x49')]({},_0x243076,_0x1a91d4[_0xcc43('0x4b')]);return _0x274026[_0xcc43('0x6e')](_0x243076);}})[_0xcc43('0x28')](function(_0x26fa7f){if(_0x26fa7f){_0x26ffa2=_0x26fa7f[_0xcc43('0x43')];if(!_0x1a91d4[_0xcc43('0x3d')][_0xcc43('0x44')](_0xcc43('0x66'))){_0x243076[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x1a91d4[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x243076[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x1a91d4[_0xcc43('0x3d')]['offset']);}return _0x274026[_0xcc43('0x6e')](_0x243076);}})[_0xcc43('0x28')](function(_0x190f3a){if(_0x190f3a){return _0x190f3a?{'count':_0x26ffa2,'rows':_0x190f3a}:null;}})[_0xcc43('0x28')](respondWithResult(_0x5757b6,null))[_0xcc43('0x51')](handleError(_0x5757b6,null));};exports[_0xcc43('0x6f')]=function(_0x49b802,_0x42f59d,_0x832063){var _0x24bac3=_0x49b802[_0xcc43('0x55')][_0xcc43('0x70')];var _0x25e5b8=_[_0xcc43('0x3c')](_0x24bac3,'id');return db['Team'][_0xcc43('0x4f')]({'where':{'id':_0x25e5b8},'attributes':['id'],'include':[{'model':db[_0xcc43('0x71')],'as':'Agents','attributes':['id',_0xcc43('0x34'),_0xcc43('0x72'),'voicePause',_0xcc43('0x73')],'raw':!![]}]})[_0xcc43('0x28')](function(_0x431989){if(_0x431989){var _0x421a57=_[_0xcc43('0x74')](_0x431989,function(_0x2b767e){var _0x39bbf0=_0x2b767e[_0xcc43('0x2a')]({'plain':!![]});_0x39bbf0[_0xcc43('0x75')][_0xcc43('0x76')](function(_0xab4020){_0xab4020[_0xcc43('0x77')]=_['find'](_0x24bac3,{'id':_0x39bbf0['id']})[_0xcc43('0x77')];});return _0x39bbf0[_0xcc43('0x75')];});return db[_0xcc43('0x4c')]['find']({'where':{'id':_0x49b802[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](function(_0xe55ab9){return db[_0xcc43('0x78')][_0xcc43('0x79')](function(_0x3722b3){return _0xe55ab9[_0xcc43('0x6f')](_0x25e5b8,{'transaction':_0x3722b3})[_0xcc43('0x28')](function(){return BPromise[_0xcc43('0x7a')](_0x24bac3,function(_0x40880d){return db[_0xcc43('0x7b')][_0xcc43('0x7c')]({'TeamId':_0x40880d['id'],'VoiceQueueId':_0x49b802[_0xcc43('0x53')]['id'],'penalty':_0x40880d[_0xcc43('0x77')]},{'transaction':_0x3722b3});});})['then'](function(){return BPromise[_0xcc43('0x7a')](_0x421a57,function(_0x3ef8e3){return db[_0xcc43('0x7d')][_0xcc43('0x7e')]({'where':{'UserId':_0x3ef8e3['id'],'VoiceQueueId':_0x49b802[_0xcc43('0x53')]['id']},'defaults':{'penalty':_0x3ef8e3[_0xcc43('0x77')]},'transaction':_0x3722b3});});})['then'](function(){return BPromise[_0xcc43('0x7a')](_[_0xcc43('0x2e')](_0x421a57,{'online':!![]}),function(_0x2784dd){return db[_0xcc43('0x7f')][_0xcc43('0x7c')]({'membername':_0x2784dd[_0xcc43('0x34')],'UserId':_0x2784dd['id'],'queue_name':_0xe55ab9[_0xcc43('0x34')],'VoiceQueueId':_0xe55ab9['id'],'interface':_[_0xcc43('0x80')](_0x2784dd[_0xcc43('0x73')])?util[_0xcc43('0x81')](_0xcc43('0x82'),_0x2784dd[_0xcc43('0x34')]):_0x2784dd[_0xcc43('0x73')],'paused':_0x2784dd[_0xcc43('0x83')]||![],'penalty':_0x2784dd[_0xcc43('0x77')]},{'transaction':_0x3722b3});});})[_0xcc43('0x28')](function(){_0x421a57[_0xcc43('0x76')](function(_0x4093a8){socket['emit'](_0xcc43('0x84'),{'UserId':_0x4093a8['id'],'VoiceQueueId':_0xe55ab9['id']});});});});});}})[_0xcc43('0x28')](respondWithStatusCode(_0x42f59d,null))[_0xcc43('0x51')](handleError(_0x42f59d,null));};exports['removeTeams']=function(_0x564a7a,_0x1977b7,_0x32d718){return db[_0xcc43('0x6d')][_0xcc43('0x4f')]({'where':{'id':_0x564a7a[_0xcc43('0x3d')][_0xcc43('0x85')]},'attributes':['id'],'include':[{'model':db[_0xcc43('0x71')],'as':_0xcc43('0x75'),'attributes':['id'],'raw':!![]}]})[_0xcc43('0x28')](handleEntityNotFound(_0x1977b7,null))['then'](function(_0x26b208){var _0x1a422c=_[_0xcc43('0x3c')](_0x26b208,'id');var _0x3a3e1e=[];var _0x27f810=[];var _0x51db2e=squel['select']();_0x51db2e[_0xcc43('0x86')](_0xcc43('0x87'))[_0xcc43('0x88')]('team_has_voice_queues','tq')[_0xcc43('0x89')](_0xcc43('0x8a'),'ut',_0xcc43('0x8b'))['where']('VoiceQueueId\x20=\x20?',_0x564a7a['params']['id']);for(var _0x27e0a0=0x0;_0x27e0a0<_0x26b208[_0xcc43('0x43')];_0x27e0a0+=0x1){let _0x54dd83=_0x26b208[_0x27e0a0];for(var _0x95fcc8=0x0;_0x95fcc8<_0x54dd83[_0xcc43('0x75')][_0xcc43('0x43')];_0x95fcc8+=0x1){let _0x5272e1=_0x54dd83[_0xcc43('0x75')][_0x95fcc8];var _0x2dc13d=_0x51db2e['clone']();_0x2dc13d[_0xcc43('0x48')]('ut.UserId\x20=\x20?',_0x5272e1['id']);_0x27f810[_0xcc43('0x8c')](db[_0xcc43('0x78')][_0xcc43('0x3d')](_0x2dc13d[_0xcc43('0x8d')](),{'type':db[_0xcc43('0x78')][_0xcc43('0x8e')]['SELECT']})[_0xcc43('0x28')](function(_0x22cc53){if(_0x22cc53[_0xcc43('0x43')]===0x1){return _0x5272e1['id'];}else{var _0x17c5d2=_['every'](_['map'](_0x22cc53,_0xcc43('0x8f')),function(_0x159d32){return _[_0xcc43('0x31')](_0x1a422c,_0x159d32);});if(_0x17c5d2){return _0x5272e1['id'];}}}));}}return BPromise['all'](_0x27f810)['then'](function(_0xaeb436){_0x3a3e1e=_(_0x3a3e1e)[_0xcc43('0x90')](_0xaeb436)[_0xcc43('0x91')]()[_0xcc43('0x30')]();return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x564a7a[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](function(_0x44115b){return db[_0xcc43('0x78')]['transaction'](function(_0x26ba7e){return _0x44115b[_0xcc43('0x92')](_0x564a7a[_0xcc43('0x3d')]['ids'],{'transaction':_0x26ba7e})[_0xcc43('0x28')](function(){if(!_[_0xcc43('0x93')](_0x3a3e1e)){return _0x44115b[_0xcc43('0x94')](_0x3a3e1e,{'transaction':_0x26ba7e})[_0xcc43('0x28')](function(){return db[_0xcc43('0x7f')][_0xcc43('0x29')]({'where':{'VoiceQueueId':_0x564a7a[_0xcc43('0x53')]['id'],'UserId':_0x3a3e1e},'transaction':_0x26ba7e});});}})[_0xcc43('0x28')](function(){_0x3a3e1e['forEach'](function(_0x46b84d){socket[_0xcc43('0x95')]('userVoiceQueue:remove',{'UserId':_0x46b84d,'VoiceQueueId':_0x44115b['id']});});});});});});})[_0xcc43('0x28')](respondWithStatusCode(_0x1977b7,null))[_0xcc43('0x51')](handleError(_0x1977b7,null));};exports[_0xcc43('0x96')]=function(_0x35aad7,_0x5067c9,_0xd10646){var _0x1a8005,_0x95c876;return db['VoiceQueue'][_0xcc43('0x33')]({'where':{'id':_0x35aad7[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x5067c9,null))[_0xcc43('0x28')](function(_0xf562b0){if(_0xf562b0){_0x95c876=_0xf562b0;return _0xf562b0[_0xcc43('0x96')](_0x35aad7['body'][_0xcc43('0x85')],_[_0xcc43('0x60')](_0x35aad7['body'],['ids','id'])||{})[_0xcc43('0x97')](function(_0x15a59d){for(var _0x472d13=0x0;_0x472d13<_0x35aad7[_0xcc43('0x55')]['ids']['length'];_0x472d13+=0x1){socket[_0xcc43('0x95')](_0xcc43('0x84'),{'UserId':Number(_0x35aad7['body']['ids'][_0x472d13]),'VoiceQueueId':Number(_0x35aad7[_0xcc43('0x53')]['id'])});}return _0x15a59d;});}})['then'](function(_0x3e3768){_0x1a8005=_0x3e3768||[];if(_0x95c876){return db[_0xcc43('0x71')][_0xcc43('0x4f')]({'where':{'id':_0x35aad7['body']['ids']},'attributes':['id',_0xcc43('0x34'),_0xcc43('0x72'),_0xcc43('0x83'),_0xcc43('0x73')],'raw':!![]});}})[_0xcc43('0x28')](function(_0x5cfb88){if(!_[_0xcc43('0x93')](_0x5cfb88)){var _0x493836=[];for(var _0x3f5617=0x0;_0x3f5617<_0x5cfb88[_0xcc43('0x43')];_0x3f5617++){if(_0x5cfb88[_0x3f5617][_0xcc43('0x72')]){_0x493836[_0xcc43('0x8c')](db[_0xcc43('0x7f')]['upsert']({'membername':_0x5cfb88[_0x3f5617][_0xcc43('0x34')],'UserId':_0x5cfb88[_0x3f5617]['id'],'queue_name':_0x95c876[_0xcc43('0x34')],'VoiceQueueId':_0x95c876['id'],'interface':_[_0xcc43('0x80')](_0x5cfb88[_0x3f5617][_0xcc43('0x73')])?util[_0xcc43('0x81')](_0xcc43('0x82'),_0x5cfb88[_0x3f5617][_0xcc43('0x34')]):_0x5cfb88[_0x3f5617][_0xcc43('0x73')],'paused':_0x5cfb88[_0x3f5617][_0xcc43('0x83')]||![],'penalty':_0x35aad7[_0xcc43('0x55')]['penalty']||0x0}));}}return BPromise[_0xcc43('0x98')](_0x493836);}})[_0xcc43('0x28')](function(){return _0x1a8005;})[_0xcc43('0x28')](respondWithResult(_0x5067c9,null))[_0xcc43('0x51')](handleError(_0x5067c9,null));};exports[_0xcc43('0x94')]=function(_0x535464,_0x3051bf,_0x5c359f){return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x535464['params']['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x3051bf,null))[_0xcc43('0x28')](function(_0x23f524){if(_0x23f524){return _0x23f524[_0xcc43('0x94')](_0x535464[_0xcc43('0x3d')][_0xcc43('0x85')])[_0xcc43('0x28')](function(){if(_[_0xcc43('0x99')](_0x535464[_0xcc43('0x3d')][_0xcc43('0x85')])){for(var _0x196d51=0x0;_0x196d51<_0x535464[_0xcc43('0x3d')][_0xcc43('0x85')][_0xcc43('0x43')];_0x196d51+=0x1){socket[_0xcc43('0x95')]('userVoiceQueue:remove',{'UserId':Number(_0x535464[_0xcc43('0x3d')][_0xcc43('0x85')][_0x196d51]),'VoiceQueueId':Number(_0x535464['params']['id'])});}}else{socket[_0xcc43('0x95')](_0xcc43('0x9a'),{'UserId':Number(_0x535464[_0xcc43('0x3d')][_0xcc43('0x85')]),'VoiceQueueId':Number(_0x535464[_0xcc43('0x53')]['id'])});}});}})[_0xcc43('0x28')](function(_0x51dc40){return db[_0xcc43('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x535464[_0xcc43('0x53')]['id'],'UserId':_0x535464[_0xcc43('0x3d')]['ids']}})[_0xcc43('0x28')](function(){return _0x51dc40;});})[_0xcc43('0x28')](respondWithStatusCode(_0x3051bf,null))[_0xcc43('0x51')](handleError(_0x3051bf,null));};exports[_0xcc43('0x9b')]=function(_0x31ac5c,_0x13b446,_0xfc8618){var _0x5136ab={};var _0x11f629={};var _0x11b6ef;var _0x407db4;return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x31ac5c[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x13b446,null))[_0xcc43('0x28')](function(_0x4abe40){if(_0x4abe40){_0x11b6ef=_0x4abe40;_0x11f629[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db[_0xcc43('0x71')][_0xcc43('0x38')]);_0x11f629[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x31ac5c[_0xcc43('0x3d')]);_0x11f629[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x11f629[_0xcc43('0x3b')],_0x11f629[_0xcc43('0x3d')]);_0x5136ab[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x11f629['model'],qs[_0xcc43('0x42')](_0x31ac5c['query'][_0xcc43('0x42')]));_0x5136ab['attributes']=_0x5136ab[_0xcc43('0x41')][_0xcc43('0x43')]?_0x5136ab['attributes']:_0x11f629[_0xcc43('0x3b')];_0x5136ab['order']=qs['sort'](_0x31ac5c[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x5136ab[_0xcc43('0x48')]=qs['filters'](_[_0xcc43('0x47')](_0x31ac5c['query'],_0x11f629[_0xcc43('0x3f')]));if(_0x31ac5c[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x5136ab[_0xcc43('0x48')]=_['merge'](_0x5136ab[_0xcc43('0x48')],{'$or':_['map'](_0x5136ab[_0xcc43('0x41')],function(_0x5607c4){var _0x7e8693={};_0x7e8693[_0x5607c4]={'$like':'%'+_0x31ac5c[_0xcc43('0x3d')]['filter']+'%'};return _0x7e8693;})});}_0x5136ab=_[_0xcc43('0x49')]({},_0x5136ab,_0x31ac5c[_0xcc43('0x4b')]);return _0x11b6ef[_0xcc43('0x9b')](_0x5136ab);}})[_0xcc43('0x28')](function(_0x4413e7){if(_0x4413e7){_0x407db4=_0x4413e7['length'];if(!_0x31ac5c[_0xcc43('0x3d')][_0xcc43('0x44')]('nolimit')){_0x5136ab[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x31ac5c['query'][_0xcc43('0x21')]);_0x5136ab['offset']=qs['offset'](_0x31ac5c['query'][_0xcc43('0x1f')]);}return _0x11b6ef[_0xcc43('0x9b')](_0x5136ab);}})[_0xcc43('0x28')](function(_0x1f7164){if(_0x1f7164){return _0x1f7164?{'count':_0x407db4,'rows':_0x1f7164}:null;}})['then'](respondWithResult(_0x13b446,null))[_0xcc43('0x51')](handleError(_0x13b446,null));};exports['getMembers']=function(_0x591736,_0x3ba1de,_0x4b68a3){var _0x405d0d={};var _0x2aa041={};var _0x53ea33;var _0x63a67b;return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x591736['params']['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x3ba1de,null))[_0xcc43('0x28')](function(_0x1f4d26){if(_0x1f4d26){_0x53ea33=_0x1f4d26;_0x2aa041[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db[_0xcc43('0x7f')][_0xcc43('0x38')]);_0x2aa041[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x591736[_0xcc43('0x3d')]);_0x2aa041[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x2aa041[_0xcc43('0x3b')],_0x2aa041[_0xcc43('0x3d')]);_0x405d0d[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x2aa041[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x591736[_0xcc43('0x3d')]['fields']));_0x405d0d[_0xcc43('0x41')]=_0x405d0d[_0xcc43('0x41')]['length']?_0x405d0d[_0xcc43('0x41')]:_0x2aa041[_0xcc43('0x3b')];_0x405d0d[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x591736[_0xcc43('0x3d')]['sort']);_0x405d0d[_0xcc43('0x48')]=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x591736[_0xcc43('0x3d')],_0x2aa041[_0xcc43('0x3f')]));if(_0x591736[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x405d0d['where']=_[_0xcc43('0x49')](_0x405d0d[_0xcc43('0x48')],{'$or':_['map'](_0x405d0d[_0xcc43('0x41')],function(_0x40f1bb){var _0xa76c19={};_0xa76c19[_0x40f1bb]={'$like':'%'+_0x591736[_0xcc43('0x3d')][_0xcc43('0x2e')]+'%'};return _0xa76c19;})});}_0x405d0d=_['merge']({},_0x405d0d,_0x591736[_0xcc43('0x4b')]);return _0x53ea33['getMembers'](_0x405d0d);}})[_0xcc43('0x28')](function(_0x54828c){if(_0x54828c){_0x63a67b=_0x54828c[_0xcc43('0x43')];if(!_0x591736[_0xcc43('0x3d')][_0xcc43('0x44')](_0xcc43('0x66'))){_0x405d0d[_0xcc43('0x21')]=qs['limit'](_0x591736[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x405d0d[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x591736[_0xcc43('0x3d')][_0xcc43('0x1f')]);}return _0x53ea33['getMembers'](_0x405d0d);}})[_0xcc43('0x28')](function(_0x39d054){return _0x39d054?{'count':_0x63a67b,'rows':_0x39d054}:null;})[_0xcc43('0x28')](respondWithResult(_0x3ba1de,null))[_0xcc43('0x51')](handleError(_0x3ba1de,null));};exports['getLists']=function(_0x448fe0,_0x503c9a,_0x1c4130){var _0x301e0c={};var _0x4bd744={};var _0x2a51a6;var _0x33aba5;return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x448fe0[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x503c9a,null))[_0xcc43('0x28')](function(_0x1bdc10){if(_0x1bdc10){_0x2a51a6=_0x1bdc10;_0x4bd744['model']=_[_0xcc43('0x3e')](db['CmList'][_0xcc43('0x38')]);_0x4bd744[_0xcc43('0x3d')]=_[_0xcc43('0x3e')](_0x448fe0['query']);_0x4bd744[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0x4bd744['model'],_0x4bd744[_0xcc43('0x3d')]);_0x301e0c[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0x4bd744[_0xcc43('0x3b')],qs[_0xcc43('0x42')](_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x42')]));_0x301e0c[_0xcc43('0x41')]=_0x301e0c['attributes']['length']?_0x301e0c[_0xcc43('0x41')]:_0x4bd744['model'];_0x301e0c[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x301e0c['where']=qs[_0xcc43('0x3f')](_[_0xcc43('0x47')](_0x448fe0[_0xcc43('0x3d')],_0x4bd744['filters']));if(_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x301e0c[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x301e0c[_0xcc43('0x48')],{'$or':_[_0xcc43('0x3c')](_0x301e0c[_0xcc43('0x41')],function(_0x1eff8b){var _0x65b71f={};_0x65b71f[_0x1eff8b]={'$like':'%'+_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x2e')]+'%'};return _0x65b71f;})});}_0x301e0c=_['merge']({},_0x301e0c,_0x448fe0[_0xcc43('0x4b')]);return _0x2a51a6['getLists'](_0x301e0c);}})['then'](function(_0x9a3a5e){if(_0x9a3a5e){_0x33aba5=_0x9a3a5e['length'];if(!_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x44')](_0xcc43('0x66'))){_0x301e0c[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x301e0c['offset']=qs['offset'](_0x448fe0[_0xcc43('0x3d')][_0xcc43('0x1f')]);}return _0x2a51a6[_0xcc43('0x9c')](_0x301e0c);}})[_0xcc43('0x28')](function(_0x16980f){if(_0x16980f){return _0x16980f?{'count':_0x33aba5,'rows':_0x16980f}:null;}})['then'](respondWithResult(_0x503c9a,null))[_0xcc43('0x51')](handleError(_0x503c9a,null));};exports[_0xcc43('0x9d')]=function(_0x3a9f34,_0x2e5c63,_0x2cca80){var _0x9eb5e8=moment()[_0xcc43('0x81')](_0xcc43('0x9e'));var _0x1355eb,_0x211af3;return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x3a9f34[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x2e5c63,null))[_0xcc43('0x28')](function(_0xc9ce05){if(_0xc9ce05){_0x211af3=_0xc9ce05;return _0xc9ce05[_0xcc43('0x9d')](_0x3a9f34[_0xcc43('0x55')]['ids'],_[_0xcc43('0x60')](_0x3a9f34[_0xcc43('0x55')],['ids','id'])||{});}return null;})[_0xcc43('0x97')](function(_0x343ffd){var _0x14cd55;_0x1355eb=_0x343ffd||[];var _0x1714ea=[];if(_0x343ffd){for(var _0x516871=0x0;_0x516871<_0x343ffd[_0xcc43('0x43')];_0x516871+=0x1){var _0x1ceb49=_0x343ffd[_0x516871][_0xcc43('0x2a')]({'plain':!![]});_0x211af3[_0xcc43('0x9f')]=_0x3a9f34['body'][_0xcc43('0x9f')]?_0x3a9f34[_0xcc43('0x55')]['dialCheckDuplicateType']:_0x211af3[_0xcc43('0x9f')];switch(_0x211af3[_0xcc43('0x9f')]){case _0xcc43('0xa0'):_0x14cd55=squel[_0xcc43('0xa1')]()[_0xcc43('0xa2')](_0xcc43('0xa3'))['fromQuery']([_0xcc43('0xa4'),'scheduledAt',_0xcc43('0xa5'),_0xcc43('0xa6'),_0xcc43('0x67'),_0xcc43('0x61'),'updatedAt'],squel[_0xcc43('0xa7')]()[_0xcc43('0x86')](_0xcc43('0xa4'),'phone')['field']('\x27'+_0x9eb5e8+'\x27',_0xcc43('0xa8'))[_0xcc43('0x86')]('id',_0xcc43('0xa5'))[_0xcc43('0x86')](_0x1ceb49['CmListId']['toString'](),_0xcc43('0xa6'))[_0xcc43('0x86')](_0x3a9f34[_0xcc43('0x53')]['id'][_0xcc43('0x8d')](),'VoiceQueueId')[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x61'))[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x62'))['from'](_0xcc43('0xa9'))[_0xcc43('0x48')]('deletedAt\x20IS\x20NULL')[_0xcc43('0x48')]('ListId\x20=\x20?',_0x1ceb49[_0xcc43('0xaa')][_0xcc43('0x8d')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xcc43('0x48')](_0xcc43('0xab'),squel[_0xcc43('0xa7')]()[_0xcc43('0x86')](_0xcc43('0xac'))['from']('cm_hopper_final')[_0xcc43('0x48')](_0xcc43('0xad'),_0x3a9f34[_0xcc43('0x53')]['id'][_0xcc43('0x8d')]()))[_0xcc43('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcc43('0xa7')]()[_0xcc43('0x86')](_0xcc43('0xae'))[_0xcc43('0x88')](_0xcc43('0xa3'))['where'](_0xcc43('0xad'),_0x3a9f34['params']['id'][_0xcc43('0x8d')]())))['toString']();break;case'onlyIfOpen':_0x14cd55=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0xcc43('0xa8'),'ContactId',_0xcc43('0xa6'),_0xcc43('0x67'),'createdAt',_0xcc43('0x62')],squel[_0xcc43('0xa7')]()[_0xcc43('0x86')]('phone',_0xcc43('0xa4'))['field']('\x27'+_0x9eb5e8+'\x27',_0xcc43('0xa8'))[_0xcc43('0x86')]('id','ContactId')[_0xcc43('0x86')](_0x1ceb49['CmListId'][_0xcc43('0x8d')](),'ListId')[_0xcc43('0x86')](_0x3a9f34[_0xcc43('0x53')]['id'][_0xcc43('0x8d')](),_0xcc43('0x67'))[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x61'))[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x62'))[_0xcc43('0x88')]('cm_contacts')[_0xcc43('0x48')](_0xcc43('0xaf'))[_0xcc43('0x48')](_0xcc43('0xb0'),_0x1ceb49[_0xcc43('0xaa')][_0xcc43('0x8d')]())[_0xcc43('0x48')](_0xcc43('0xb1'))[_0xcc43('0x48')](_0xcc43('0xab'),squel[_0xcc43('0xa7')]()[_0xcc43('0x86')](_0xcc43('0xae'))[_0xcc43('0x88')]('cm_hopper')[_0xcc43('0x48')]('VoiceQueueId\x20=\x20?',_0x3a9f34[_0xcc43('0x53')]['id']['toString']())))[_0xcc43('0x8d')]();break;default:_0x14cd55=squel[_0xcc43('0xa1')]()[_0xcc43('0xa2')](_0xcc43('0xa3'))[_0xcc43('0xb2')](['phone',_0xcc43('0xa8'),'ContactId','ListId',_0xcc43('0x67'),_0xcc43('0x61'),_0xcc43('0x62')],squel['select']()['field']('phone','phone')[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0xa8'))[_0xcc43('0x86')]('id',_0xcc43('0xa5'))[_0xcc43('0x86')](_0x1ceb49[_0xcc43('0xaa')][_0xcc43('0x8d')](),_0xcc43('0xa6'))[_0xcc43('0x86')](_0x3a9f34[_0xcc43('0x53')]['id'][_0xcc43('0x8d')](),'VoiceQueueId')[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x61'))[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x62'))['from']('cm_contacts')['where'](_0xcc43('0xaf'))[_0xcc43('0x48')]('ListId\x20=\x20?',_0x1ceb49['CmListId']['toString']())[_0xcc43('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0xcc43('0x8d')]();}_0x1714ea[_0xcc43('0x8c')](db[_0xcc43('0x78')][_0xcc43('0x3d')](_0x14cd55));}return BPromise[_0xcc43('0x98')](_0x1714ea);}})['then'](function(){var _0x2fba7c=[];var _0x25931b=squel['insert']()['into'](_0xcc43('0xb3'))[_0xcc43('0xb2')]([_0xcc43('0xb4'),_0xcc43('0xa4'),_0xcc43('0xb5'),'createdAt',_0xcc43('0x62')],squel[_0xcc43('0xa7')]()[_0xcc43('0x86')](_0xcc43('0xb6'))[_0xcc43('0x86')]('ci.item')[_0xcc43('0x86')](_0xcc43('0xb7'))['field']('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x61'))[_0xcc43('0x86')]('\x27'+_0x9eb5e8+'\x27',_0xcc43('0x62'))[_0xcc43('0x88')](_0xcc43('0xb8'),'ci')[_0xcc43('0x89')]('cm_hopper','h',_0xcc43('0xb9'))['where'](_0xcc43('0xba'),_0x9eb5e8)['where'](_0xcc43('0xbb'),_0xcc43('0xbc')))[_0xcc43('0x8d')]();_0x2fba7c[_0xcc43('0x8c')](db[_0xcc43('0x78')]['query'](_0x25931b));return BPromise[_0xcc43('0x98')](_0x2fba7c);})['then'](function(){return _0x1355eb;})[_0xcc43('0x28')](respondWithResult(_0x2e5c63,null))[_0xcc43('0x51')](handleError(_0x2e5c63,null));};exports['removeLists']=function(_0x3451a8,_0x2f6140,_0x5c168d){return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x3451a8[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x2f6140,null))['then'](function(_0x30064c){if(_0x30064c){return _0x30064c[_0xcc43('0xbd')](_0x3451a8[_0xcc43('0x3d')][_0xcc43('0x85')]);}})[_0xcc43('0x28')](function(_0x647f4a){if(_0x647f4a){return db[_0xcc43('0x65')][_0xcc43('0x29')]({'where':{'ListId':_0x3451a8[_0xcc43('0x3d')][_0xcc43('0x85')],'VoiceQueueId':_0x3451a8[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](function(){return _0x647f4a;});}})[_0xcc43('0x28')](respondWithStatusCode(_0x2f6140,null))['catch'](handleError(_0x2f6140,null));};exports[_0xcc43('0xbe')]=function(_0x2faa63,_0x3e91eb,_0x5aa52a){var _0x5e89da={};var _0xeb0644={};var _0x167172;var _0x4fcc46;return db[_0xcc43('0x4c')][_0xcc43('0x64')]({'where':{'id':_0x2faa63[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x3e91eb,null))[_0xcc43('0x28')](function(_0x2bb9d4){if(_0x2bb9d4){_0x167172=_0x2bb9d4;_0xeb0644[_0xcc43('0x3b')]=_[_0xcc43('0x3e')](db[_0xcc43('0xbf')][_0xcc43('0x38')]);_0xeb0644['query']=_[_0xcc43('0x3e')](_0x2faa63[_0xcc43('0x3d')]);_0xeb0644[_0xcc43('0x3f')]=_[_0xcc43('0x40')](_0xeb0644[_0xcc43('0x3b')],_0xeb0644[_0xcc43('0x3d')]);_0x5e89da[_0xcc43('0x41')]=_[_0xcc43('0x40')](_0xeb0644['model'],qs['fields'](_0x2faa63['query'][_0xcc43('0x42')]));_0x5e89da[_0xcc43('0x41')]=_0x5e89da[_0xcc43('0x41')][_0xcc43('0x43')]?_0x5e89da[_0xcc43('0x41')]:_0xeb0644[_0xcc43('0x3b')];_0x5e89da[_0xcc43('0x45')]=qs[_0xcc43('0x46')](_0x2faa63[_0xcc43('0x3d')][_0xcc43('0x46')]);_0x5e89da[_0xcc43('0x48')]=qs['filters'](_[_0xcc43('0x47')](_0x2faa63['query'],_0xeb0644[_0xcc43('0x3f')]));if(_0x2faa63[_0xcc43('0x3d')][_0xcc43('0x2e')]){_0x5e89da[_0xcc43('0x48')]=_[_0xcc43('0x49')](_0x5e89da['where'],{'$or':_['map'](_0x5e89da[_0xcc43('0x41')],function(_0x3f19b5){var _0x541fd3={};_0x541fd3[_0x3f19b5]={'$like':'%'+_0x2faa63['query'][_0xcc43('0x2e')]+'%'};return _0x541fd3;})});}_0x5e89da=_['merge']({},_0x5e89da,_0x2faa63['options']);return _0x167172['getBlackLists'](_0x5e89da);}})[_0xcc43('0x28')](function(_0x583e3b){if(_0x583e3b){_0x4fcc46=_0x583e3b[_0xcc43('0x43')];if(!_0x2faa63[_0xcc43('0x3d')][_0xcc43('0x44')]('nolimit')){_0x5e89da[_0xcc43('0x21')]=qs[_0xcc43('0x21')](_0x2faa63[_0xcc43('0x3d')][_0xcc43('0x21')]);_0x5e89da[_0xcc43('0x1f')]=qs[_0xcc43('0x1f')](_0x2faa63[_0xcc43('0x3d')][_0xcc43('0x1f')]);}return _0x167172['getBlackLists'](_0x5e89da);}})['then'](function(_0x2a7302){if(_0x2a7302){return _0x2a7302?{'count':_0x4fcc46,'rows':_0x2a7302}:null;}})[_0xcc43('0x28')](respondWithResult(_0x3e91eb,null))[_0xcc43('0x51')](handleError(_0x3e91eb,null));};exports[_0xcc43('0xc0')]=function(_0x4fa0b2,_0x665528,_0x21a894){var _0x222f29,_0x53484d;return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x4fa0b2[_0xcc43('0x53')]['id']}})['then'](handleEntityNotFound(_0x665528,null))[_0xcc43('0x28')](function(_0x3b9ba1){if(_0x3b9ba1){_0x53484d=_0x3b9ba1;return _0x3b9ba1['addBlackLists'](_0x4fa0b2[_0xcc43('0x55')]['ids'],_['omit'](_0x4fa0b2[_0xcc43('0x55')],[_0xcc43('0x85'),'id'])||{});}return null;})[_0xcc43('0x97')](function(_0x29406e){var _0x1fec0d;_0x222f29=_0x29406e||[];var _0x19b867=[];if(_0x29406e){for(var _0xc87ec2=0x0;_0xc87ec2<_0x29406e['length'];_0xc87ec2+=0x1){var _0x4f9c55=_0x29406e[_0xc87ec2][_0xcc43('0x2a')]({'plain':!![]});_0x1fec0d=squel[_0xcc43('0xa1')]()[_0xcc43('0xa2')](_0xcc43('0xc1'))['fromQuery']([_0xcc43('0xa4'),_0xcc43('0xa5'),_0xcc43('0xa6'),_0xcc43('0x67'),'createdAt',_0xcc43('0x62')],squel['select']()['field'](_0xcc43('0xa4'),_0xcc43('0xa4'))['field']('id',_0xcc43('0xa5'))[_0xcc43('0x86')](_0x4f9c55[_0xcc43('0xaa')]['toString'](),'ListId')[_0xcc43('0x86')](_0x4fa0b2[_0xcc43('0x53')]['id'][_0xcc43('0x8d')](),'VoiceQueueId')[_0xcc43('0x86')](_0xcc43('0xc2'),_0xcc43('0x61'))['field']('NOW()','updatedAt')['from'](_0xcc43('0xa9'))[_0xcc43('0x48')]('deletedAt\x20IS\x20NULL')[_0xcc43('0x48')](_0xcc43('0xb0'),_0x4f9c55[_0xcc43('0xaa')][_0xcc43('0x8d')]())[_0xcc43('0x48')](_0xcc43('0xb1')))[_0xcc43('0x8d')]();_0x19b867[_0xcc43('0x8c')](db[_0xcc43('0x78')][_0xcc43('0x3d')](_0x1fec0d));}return BPromise['all'](_0x19b867);}})['then'](function(){return _0x222f29;})[_0xcc43('0x28')](respondWithResult(_0x665528,null))[_0xcc43('0x51')](handleError(_0x665528,null));};exports[_0xcc43('0xc3')]=function(_0x4775b2,_0x3891c5,_0x5a034d){return db[_0xcc43('0x4c')][_0xcc43('0x33')]({'where':{'id':_0x4775b2[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](handleEntityNotFound(_0x3891c5,null))[_0xcc43('0x28')](function(_0x3373bb){if(_0x3373bb){return _0x3373bb[_0xcc43('0xc3')](_0x4775b2['query'][_0xcc43('0x85')]);}})[_0xcc43('0x28')](function(_0x24a58a){if(_0x24a58a){return db[_0xcc43('0x6c')][_0xcc43('0x29')]({'where':{'ListId':_0x4775b2[_0xcc43('0x3d')][_0xcc43('0x85')],'VoiceQueueId':_0x4775b2[_0xcc43('0x53')]['id']}})[_0xcc43('0x28')](function(){return _0x24a58a;});}})['then'](respondWithStatusCode(_0x3891c5,null))['catch'](handleError(_0x3891c5,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index fcbee95..278afd9 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 _0x7be6=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x7be6,0xa1));var _0x67be=function(_0x3e6ba5,_0x3d33f5){_0x3e6ba5=_0x3e6ba5-0x0;var _0x82e56=_0x7be6[_0x3e6ba5];return _0x82e56;};'use strict';var EventEmitter=require(_0x67be('0x0'));var VoiceQueue=require(_0x67be('0x1'))['db'][_0x67be('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x67be('0x3')](0x0);var events={'afterCreate':_0x67be('0x4'),'afterUpdate':_0x67be('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1bc84a){return function(_0x31bc0a,_0x16bc3a,_0x4e50c2){VoiceQueueEvents[_0x67be('0x6')](_0x1bc84a+':'+_0x31bc0a['id'],_0x31bc0a);VoiceQueueEvents[_0x67be('0x6')](_0x1bc84a,_0x31bc0a);_0x4e50c2(null);};}for(var e in events){if(events[_0x67be('0x7')](e)){var event=events[e];VoiceQueue[_0x67be('0x8')](e,emitEvent(event));}}module[_0x67be('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x86a2=['VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x86a2,0x16f));var _0x286a=function(_0x99c991,_0x439ce7){_0x99c991=_0x99c991-0x0;var _0x3e2061=_0x86a2[_0x99c991];return _0x3e2061;};'use strict';var EventEmitter=require(_0x286a('0x0'));var VoiceQueue=require(_0x286a('0x1'))['db'][_0x286a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x286a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x286a('0x4'),'afterDestroy':_0x286a('0x5')};function emitEvent(_0x290d2d){return function(_0x261847,_0x35adc7,_0x379161){VoiceQueueEvents[_0x286a('0x6')](_0x290d2d+':'+_0x261847['id'],_0x261847);VoiceQueueEvents['emit'](_0x290d2d,_0x261847);_0x379161(null);};}for(var e in events){if(events[_0x286a('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x286a('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 0fff14f..212b322 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x955078,_0x11da52){var _0x165906=function(_0x2054ab){while(--_0x2054ab){_0x955078['push'](_0x955078['shift']());}};_0x165906(++_0x11da52);}(_0x34e8,0x12c));var _0x834e=function(_0x32fdb0,_0x5f22e1){_0x32fdb0=_0x32fdb0-0x0;var _0x4d9074=_0x34e8[_0x32fdb0];return _0x4d9074;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3cf109,_0xca5ff4){var _0x595942=function(_0x19cfa0){while(--_0x19cfa0){_0x3cf109['push'](_0x3cf109['shift']());}};_0x595942(++_0xca5ff4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a24ef2a..7e1780c 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 _0x66d4=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','map','include','model','debug','catch','find','ShowVoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49bf15,_0x40f6cf){var _0x15897a=function(_0x5a3a75){while(--_0x5a3a75){_0x49bf15['push'](_0x49bf15['shift']());}};_0x15897a(++_0x40f6cf);}(_0x66d4,0x10f));var _0x466d=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x66d4[_0x3b3cc6];return _0x1161e4;};'use strict';var _=require(_0x466d('0x0'));var util=require(_0x466d('0x1'));var moment=require('moment');var BPromise=require(_0x466d('0x2'));var rs=require(_0x466d('0x3'));var fs=require('fs');var Redis=require(_0x466d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x466d('0x5'));var logger=require(_0x466d('0x6'))(_0x466d('0x7'));var config=require(_0x466d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x466d('0x9')][_0x466d('0xa')]({'port':0x232a});config[_0x466d('0xb')]=_[_0x466d('0xc')](config['redis'],{'host':_0x466d('0xd'),'port':0x18eb});var socket=require(_0x466d('0xe'))(new Redis(config[_0x466d('0xb')]));require(_0x466d('0xf'))['register'](socket);function respondWithRpcPromise(_0x1306e1,_0x141508,_0x3d36f2){return new BPromise(function(_0x35c2f2,_0x407ec3){return client[_0x466d('0x10')](_0x1306e1,_0x3d36f2)[_0x466d('0x11')](function(_0x1ebf71){logger[_0x466d('0x12')](_0x466d('0x13'),_0x141508,_0x466d('0x14'));logger['debug'](_0x466d('0x15'),_0x141508,_0x466d('0x14'),JSON[_0x466d('0x16')](_0x1ebf71));if(_0x1ebf71['error']){if(_0x1ebf71[_0x466d('0x17')]['code']===0x1f4){logger[_0x466d('0x17')](_0x466d('0x13'),_0x141508,_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);return _0x407ec3(_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);}logger[_0x466d('0x17')](_0x466d('0x13'),_0x141508,_0x1ebf71[_0x466d('0x17')]['message']);return _0x35c2f2(_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);}else{logger[_0x466d('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x141508,_0x466d('0x14'));_0x35c2f2(_0x1ebf71[_0x466d('0x19')][_0x466d('0x18')]);}})['catch'](function(_0x56ddfc){logger[_0x466d('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x141508,_0x56ddfc);_0x407ec3(_0x56ddfc);});});}exports[_0x466d('0x1a')]=function(_0x3989cb){var _0x27c305=this;return new Promise(function(_0x453524,_0x6bbd01){return db[_0x466d('0x1b')][_0x466d('0x1c')]({'raw':_0x3989cb[_0x466d('0x1d')]?_0x3989cb[_0x466d('0x1d')][_0x466d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options'][_0x466d('0x1f')]||null:null,'attributes':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options'][_0x466d('0x20')]||null:null,'limit':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options']['limit']||null:null,'include':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options']['include']?_[_0x466d('0x21')](_0x3989cb[_0x466d('0x1d')][_0x466d('0x22')],function(_0x1300ca){return{'model':db[_0x1300ca[_0x466d('0x23')]],'as':_0x1300ca['as'],'attributes':_0x1300ca['attributes'],'include':_0x1300ca[_0x466d('0x22')]?_[_0x466d('0x21')](_0x1300ca[_0x466d('0x22')],function(_0x3023df){return{'model':db[_0x3023df['model']],'as':_0x3023df['as'],'attributes':_0x3023df[_0x466d('0x20')],'include':_0x3023df['include']?_[_0x466d('0x21')](_0x3023df[_0x466d('0x22')],function(_0x59e7a7){return{'model':db[_0x59e7a7[_0x466d('0x23')]],'as':_0x59e7a7['as'],'attributes':_0x59e7a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x466d('0x11')](function(_0x549aa0){logger[_0x466d('0x12')]('GetVoiceQueue',_0x3989cb);logger[_0x466d('0x24')](_0x466d('0x1a'),_0x3989cb,JSON[_0x466d('0x16')](_0x549aa0));_0x453524(_0x549aa0);})[_0x466d('0x25')](function(_0x54b83a){logger[_0x466d('0x17')](_0x466d('0x1a'),_0x54b83a[_0x466d('0x18')],_0x3989cb);_0x6bbd01(_0x27c305[_0x466d('0x17')](0x1f4,_0x54b83a[_0x466d('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x695878){var _0x5ce29c=this;return new Promise(function(_0x2ca3b4,_0x1f1254){return db[_0x466d('0x1b')][_0x466d('0x26')]({'raw':_0x695878[_0x466d('0x1d')]?_0x695878[_0x466d('0x1d')][_0x466d('0x1e')]===undefined?!![]:![]:!![],'where':_0x695878['options']?_0x695878[_0x466d('0x1d')][_0x466d('0x1f')]||null:null,'attributes':_0x695878['options']?_0x695878[_0x466d('0x1d')][_0x466d('0x20')]||null:null,'include':_0x695878[_0x466d('0x1d')]?_0x695878[_0x466d('0x1d')][_0x466d('0x22')]?_[_0x466d('0x21')](_0x695878[_0x466d('0x1d')][_0x466d('0x22')],function(_0x29024d){return{'model':db[_0x29024d[_0x466d('0x23')]],'as':_0x29024d['as'],'attributes':_0x29024d[_0x466d('0x20')],'include':_0x29024d[_0x466d('0x22')]?_[_0x466d('0x21')](_0x29024d[_0x466d('0x22')],function(_0x7a5a01){return{'model':db[_0x7a5a01[_0x466d('0x23')]],'as':_0x7a5a01['as'],'attributes':_0x7a5a01[_0x466d('0x20')],'include':_0x7a5a01[_0x466d('0x22')]?_[_0x466d('0x21')](_0x7a5a01[_0x466d('0x22')],function(_0xbfa6e9){return{'model':db[_0xbfa6e9['model']],'as':_0xbfa6e9['as'],'attributes':_0xbfa6e9[_0x466d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x466d('0x11')](function(_0x16e6eb){logger['info']('ShowVoiceQueue',_0x695878);logger[_0x466d('0x24')](_0x466d('0x27'),_0x695878,JSON['stringify'](_0x16e6eb));_0x2ca3b4(_0x16e6eb);})['catch'](function(_0x2f743d){logger[_0x466d('0x17')]('ShowVoiceQueue',_0x2f743d[_0x466d('0x18')],_0x695878);_0x1f1254(_0x5ce29c[_0x466d('0x17')](0x1f4,_0x2f743d['message']));});});}; \ No newline at end of file +var _0x5675=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','ShowVoiceQueue','where','lodash'];(function(_0x150b05,_0xb6daed){var _0x14cb1d=function(_0x5bd4d8){while(--_0x5bd4d8){_0x150b05['push'](_0x150b05['shift']());}};_0x14cb1d(++_0xb6daed);}(_0x5675,0xf5));var _0x5567=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5675[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x5567('0x0'));var util=require('util');var moment=require(_0x5567('0x1'));var BPromise=require(_0x5567('0x2'));var rs=require(_0x5567('0x3'));var fs=require('fs');var Redis=require(_0x5567('0x4'));var db=require(_0x5567('0x5'))['db'];var utils=require(_0x5567('0x6'));var logger=require(_0x5567('0x7'))(_0x5567('0x8'));var config=require(_0x5567('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5567('0xa')][_0x5567('0xb')]({'port':0x232a});config[_0x5567('0xc')]=_[_0x5567('0xd')](config[_0x5567('0xc')],{'host':_0x5567('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5567('0xc')]));require(_0x5567('0xf'))[_0x5567('0x10')](socket);function respondWithRpcPromise(_0x10d326,_0x2d699d,_0x2ba718){return new BPromise(function(_0x17d5da,_0x3af75f){return client[_0x5567('0x11')](_0x10d326,_0x2ba718)[_0x5567('0x12')](function(_0x57e629){logger[_0x5567('0x13')](_0x5567('0x14'),_0x2d699d,_0x5567('0x15'));logger[_0x5567('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2d699d,'request\x20sent',JSON[_0x5567('0x17')](_0x57e629));if(_0x57e629[_0x5567('0x18')]){if(_0x57e629[_0x5567('0x18')][_0x5567('0x19')]===0x1f4){logger[_0x5567('0x18')](_0x5567('0x14'),_0x2d699d,_0x57e629['error'][_0x5567('0x1a')]);return _0x3af75f(_0x57e629['error']['message']);}logger[_0x5567('0x18')](_0x5567('0x14'),_0x2d699d,_0x57e629[_0x5567('0x18')][_0x5567('0x1a')]);return _0x17d5da(_0x57e629[_0x5567('0x18')]['message']);}else{logger[_0x5567('0x13')](_0x5567('0x14'),_0x2d699d,_0x5567('0x15'));_0x17d5da(_0x57e629[_0x5567('0x1b')][_0x5567('0x1a')]);}})[_0x5567('0x1c')](function(_0x55074e){logger[_0x5567('0x18')](_0x5567('0x14'),_0x2d699d,_0x55074e);_0x3af75f(_0x55074e);});});}exports[_0x5567('0x1d')]=function(_0x45573e){var _0x4bb14e=this;return new Promise(function(_0x2027bc,_0x55cfc7){return db[_0x5567('0x1e')][_0x5567('0x1f')]({'raw':_0x45573e[_0x5567('0x20')]?_0x45573e[_0x5567('0x20')][_0x5567('0x21')]===undefined?!![]:![]:!![],'where':_0x45573e['options']?_0x45573e['options']['where']||null:null,'attributes':_0x45573e['options']?_0x45573e['options'][_0x5567('0x22')]||null:null,'limit':_0x45573e[_0x5567('0x20')]?_0x45573e[_0x5567('0x20')][_0x5567('0x23')]||null:null,'include':_0x45573e[_0x5567('0x20')]?_0x45573e[_0x5567('0x20')][_0x5567('0x24')]?_[_0x5567('0x25')](_0x45573e[_0x5567('0x20')][_0x5567('0x24')],function(_0x2a72a8){return{'model':db[_0x2a72a8[_0x5567('0x26')]],'as':_0x2a72a8['as'],'attributes':_0x2a72a8[_0x5567('0x22')],'include':_0x2a72a8[_0x5567('0x24')]?_[_0x5567('0x25')](_0x2a72a8[_0x5567('0x24')],function(_0x53aa9a){return{'model':db[_0x53aa9a['model']],'as':_0x53aa9a['as'],'attributes':_0x53aa9a[_0x5567('0x22')],'include':_0x53aa9a[_0x5567('0x24')]?_[_0x5567('0x25')](_0x53aa9a['include'],function(_0x3110aa){return{'model':db[_0x3110aa[_0x5567('0x26')]],'as':_0x3110aa['as'],'attributes':_0x3110aa[_0x5567('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50b94a){logger[_0x5567('0x13')](_0x5567('0x1d'),_0x45573e);logger[_0x5567('0x16')](_0x5567('0x1d'),_0x45573e,JSON['stringify'](_0x50b94a));_0x2027bc(_0x50b94a);})[_0x5567('0x1c')](function(_0x4bdc1a){logger['error']('GetVoiceQueue',_0x4bdc1a[_0x5567('0x1a')],_0x45573e);_0x55cfc7(_0x4bb14e['error'](0x1f4,_0x4bdc1a[_0x5567('0x1a')]));});});};exports[_0x5567('0x27')]=function(_0x4bf242){var _0x283346=this;return new Promise(function(_0x329078,_0x38a58e){return db[_0x5567('0x1e')]['find']({'raw':_0x4bf242[_0x5567('0x20')]?_0x4bf242['options'][_0x5567('0x21')]===undefined?!![]:![]:!![],'where':_0x4bf242[_0x5567('0x20')]?_0x4bf242['options'][_0x5567('0x28')]||null:null,'attributes':_0x4bf242['options']?_0x4bf242['options'][_0x5567('0x22')]||null:null,'include':_0x4bf242[_0x5567('0x20')]?_0x4bf242['options'][_0x5567('0x24')]?_[_0x5567('0x25')](_0x4bf242['options']['include'],function(_0x5a48c2){return{'model':db[_0x5a48c2[_0x5567('0x26')]],'as':_0x5a48c2['as'],'attributes':_0x5a48c2[_0x5567('0x22')],'include':_0x5a48c2[_0x5567('0x24')]?_[_0x5567('0x25')](_0x5a48c2[_0x5567('0x24')],function(_0x7ee4d0){return{'model':db[_0x7ee4d0[_0x5567('0x26')]],'as':_0x7ee4d0['as'],'attributes':_0x7ee4d0[_0x5567('0x22')],'include':_0x7ee4d0[_0x5567('0x24')]?_[_0x5567('0x25')](_0x7ee4d0[_0x5567('0x24')],function(_0x32bd44){return{'model':db[_0x32bd44[_0x5567('0x26')]],'as':_0x32bd44['as'],'attributes':_0x32bd44[_0x5567('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5567('0x12')](function(_0x37d38f){logger[_0x5567('0x13')](_0x5567('0x27'),_0x4bf242);logger[_0x5567('0x16')](_0x5567('0x27'),_0x4bf242,JSON['stringify'](_0x37d38f));_0x329078(_0x37d38f);})[_0x5567('0x1c')](function(_0x562299){logger[_0x5567('0x18')](_0x5567('0x27'),_0x562299[_0x5567('0x1a')],_0x4bf242);_0x38a58e(_0x283346[_0x5567('0x18')](0x1f4,_0x562299[_0x5567('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 916b032..a5ac462 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 _0xe017=['remove','update','emit','removeListener','register','length','save'];(function(_0x2d6f79,_0x2b5e21){var _0x1d5423=function(_0x3f327f){while(--_0x3f327f){_0x2d6f79['push'](_0x2d6f79['shift']());}};_0x1d5423(++_0x2b5e21);}(_0xe017,0x7d));var _0x7e01=function(_0x370d9c,_0x50f2f0){_0x370d9c=_0x370d9c-0x0;var _0x597a57=_0xe017[_0x370d9c];return _0x597a57;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x7e01('0x0'),_0x7e01('0x1'),_0x7e01('0x2')];function createListener(_0x5b3812,_0x372a69){return function(_0x40c611){_0x372a69[_0x7e01('0x3')](_0x5b3812,_0x40c611);};}function removeListener(_0x42eb5f,_0x4a9c91){return function(){VoiceQueueEvents[_0x7e01('0x4')](_0x42eb5f,_0x4a9c91);};}exports[_0x7e01('0x5')]=function(_0x570b77){for(var _0x1eefe8=0x0,_0x3d55b5=events[_0x7e01('0x6')];_0x1eefe8<_0x3d55b5;_0x1eefe8++){var _0x422f8c=events[_0x1eefe8];var _0x2f2ea1=createListener('voiceQueue:'+_0x422f8c,_0x570b77);VoiceQueueEvents['on'](_0x422f8c,_0x2f2ea1);}}; \ No newline at end of file +var _0xfe0a=['length','voiceQueue:','./voiceQueue.events','update','register'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xfe0a,0x19c));var _0xafe0=function(_0x584b9d,_0x1cb5c5){_0x584b9d=_0x584b9d-0x0;var _0x172053=_0xfe0a[_0x584b9d];return _0x172053;};'use strict';var VoiceQueueEvents=require(_0xafe0('0x0'));var events=['save','remove',_0xafe0('0x1')];function createListener(_0x545f93,_0x284bd9){return function(_0x292b97){_0x284bd9['emit'](_0x545f93,_0x292b97);};}function removeListener(_0xfb3d7c,_0x24ef97){return function(){VoiceQueueEvents['removeListener'](_0xfb3d7c,_0x24ef97);};}exports[_0xafe0('0x2')]=function(_0x4ec629){for(var _0x31e6c1=0x0,_0x16fcd6=events[_0xafe0('0x3')];_0x31e6c1<_0x16fcd6;_0x31e6c1++){var _0xf08122=events[_0x31e6c1];var _0x592b9d=createListener(_0xafe0('0x4')+_0xf08122,_0x4ec629);VoiceQueueEvents['on'](_0xf08122,_0x592b9d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index d5438b6..29c5e95 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 _0x906d=['show','post','create','update','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/index','getVoiceQueuesReport'];(function(_0x2ad80f,_0x40e4dd){var _0xc10ada=function(_0x2b9658){while(--_0x2b9658){_0x2ad80f['push'](_0x2ad80f['shift']());}};_0xc10ada(++_0x40e4dd);}(_0x906d,0x197));var _0xd906=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x906d[_0x273dc5];return _0x46dae7;};'use strict';var multer=require(_0xd906('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd906('0x1'));var express=require(_0xd906('0x2'));var router=express[_0xd906('0x3')]();var fs_extra=require(_0xd906('0x4'));var auth=require(_0xd906('0x5'));var interaction=require(_0xd906('0x6'));var config=require(_0xd906('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd906('0x8')]);router[_0xd906('0x9')]('/describe',auth[_0xd906('0xa')](),controller['describe']);router[_0xd906('0x9')](_0xd906('0xb'),auth[_0xd906('0xa')](),controller[_0xd906('0xc')]);router[_0xd906('0x9')]('/:id',auth[_0xd906('0xa')](),controller[_0xd906('0xd')]);router[_0xd906('0xe')]('/',auth[_0xd906('0xa')](),controller[_0xd906('0xf')]);router['put']('/:id',auth[_0xd906('0xa')](),controller[_0xd906('0x10')]);router['delete'](_0xd906('0x11'),auth[_0xd906('0xa')](),controller[_0xd906('0x12')]);module[_0xd906('0x13')]=router; \ No newline at end of file +var _0x1c4b=['path','connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','exports','util'];(function(_0x4aa56d,_0x58db0f){var _0x36ce6e=function(_0x526984){while(--_0x526984){_0x4aa56d['push'](_0x4aa56d['shift']());}};_0x36ce6e(++_0x58db0f);}(_0x1c4b,0x179));var _0xb1c4=function(_0xe12eb4,_0x3abf24){_0xe12eb4=_0xe12eb4-0x0;var _0xce090a=_0x1c4b[_0xe12eb4];return _0xce090a;};'use strict';var multer=require('multer');var util=require(_0xb1c4('0x0'));var path=require(_0xb1c4('0x1'));var timeout=require(_0xb1c4('0x2'));var express=require(_0xb1c4('0x3'));var router=express[_0xb1c4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1c4('0x5'));var controller=require(_0xb1c4('0x6'));router[_0xb1c4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb1c4('0x7')](_0xb1c4('0x8'),auth[_0xb1c4('0x9')](),controller[_0xb1c4('0xa')]);router[_0xb1c4('0x7')](_0xb1c4('0xb'),auth['isAuthenticated'](),controller[_0xb1c4('0xc')]);router[_0xb1c4('0x7')](_0xb1c4('0xd'),auth[_0xb1c4('0x9')](),controller[_0xb1c4('0xe')]);router[_0xb1c4('0xf')]('/',auth[_0xb1c4('0x9')](),controller[_0xb1c4('0x10')]);router[_0xb1c4('0x11')]('/:id',auth[_0xb1c4('0x9')](),controller['update']);router[_0xb1c4('0x12')](_0xb1c4('0xd'),auth[_0xb1c4('0x9')](),controller[_0xb1c4('0x13')]);module[_0xb1c4('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 4dde079..4b4f352 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 _0xaac6=['diff','setDataValue','queuecallerleaveAt','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3833f4,_0xb7f4ec){var _0x393f0b=function(_0x2eb3a9){while(--_0x2eb3a9){_0x3833f4['push'](_0x3833f4['shift']());}};_0x393f0b(++_0xb7f4ec);}(_0xaac6,0x167));var _0x6aac=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xaac6[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x6aac('0x0'));var moment=require(_0x6aac('0x1'));module[_0x6aac('0x2')]={'type':{'type':Sequelize[_0x6aac('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6aac('0x3')]},'calleridname':{'type':Sequelize[_0x6aac('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x6aac('0x4')],'set':function(_0x2a37e1){var _0x58d181=moment(_0x2a37e1);var _0xca45f9=moment(this[_0x6aac('0x5')](_0x6aac('0x6')))[_0x6aac('0x7')](_0x6aac('0x8'));var _0x18c0e4=_0x58d181[_0x6aac('0x9')](_0xca45f9,'seconds');this[_0x6aac('0xa')](_0x6aac('0xb'),_0x2a37e1);this['setDataValue']('holdtime',_0x18c0e4||null);}},'position':{'type':Sequelize[_0x6aac('0xc')]},'count':{'type':Sequelize[_0x6aac('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6aac('0x3')],'comment':_0x6aac('0xd')},'originalposition':{'type':Sequelize[_0x6aac('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6aac('0x3')]},'connectedlinename':{'type':Sequelize[_0x6aac('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6aac('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x6aac('0xc')]},'mohtime':{'type':Sequelize[_0x6aac('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6aac('0x3')]},'transfer':{'type':Sequelize[_0x6aac('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6aac('0x3')],'comment':_0x6aac('0xf')},'transferexten':{'type':Sequelize[_0x6aac('0x3')]},'transferuniqueid':{'type':Sequelize[_0x6aac('0x3')]},'disposition':{'type':Sequelize[_0x6aac('0x3')]},'secondDisposition':{'type':Sequelize[_0x6aac('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6aac('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x6aac('0x3')]}}; \ No newline at end of file +var _0xd9af=['STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3f9d91,_0x20c819){var _0x105894=function(_0x1fe09d){while(--_0x1fe09d){_0x3f9d91['push'](_0x3f9d91['shift']());}};_0x105894(++_0x20c819);}(_0xd9af,0x1a0));var _0xfd9a=function(_0x31b077,_0x567dc7){_0x31b077=_0x31b077-0x0;var _0x14b511=_0xd9af[_0x31b077];return _0x14b511;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfd9a('0x0')]},'calleridnum':{'type':Sequelize[_0xfd9a('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xfd9a('0x1')]},'queuecallerleaveAt':{'type':Sequelize[_0xfd9a('0x1')],'set':function(_0x2cee19){var _0x423d80=moment(_0x2cee19);var _0x9964c9=moment(this['getDataValue'](_0xfd9a('0x2')))[_0xfd9a('0x3')](_0xfd9a('0x4'));var _0x1255b8=_0x423d80[_0xfd9a('0x5')](_0x9964c9,_0xfd9a('0x6'));this['setDataValue'](_0xfd9a('0x7'),_0x2cee19);this[_0xfd9a('0x8')](_0xfd9a('0x9'),_0x1255b8||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xfd9a('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfd9a('0x1')]},'queuecallercomplete':{'type':Sequelize[_0xfd9a('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xfd9a('0x1')]},'queuecallerexit':{'type':Sequelize[_0xfd9a('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xfd9a('0x0')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xfd9a('0xb')]},'channel':{'type':Sequelize[_0xfd9a('0x0')]},'connectedlinenum':{'type':Sequelize[_0xfd9a('0x0')]},'connectedlinename':{'type':Sequelize[_0xfd9a('0x0')]},'accountcode':{'type':Sequelize[_0xfd9a('0x0')]},'context':{'type':Sequelize[_0xfd9a('0x0')]},'exten':{'type':Sequelize[_0xfd9a('0x0')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfd9a('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xfd9a('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xfd9a('0xc')},'transferexten':{'type':Sequelize[_0xfd9a('0x0')]},'transferuniqueid':{'type':Sequelize[_0xfd9a('0x0')]},'disposition':{'type':Sequelize[_0xfd9a('0x0')]},'secondDisposition':{'type':Sequelize[_0xfd9a('0x0')]},'thirdDisposition':{'type':Sequelize[_0xfd9a('0x0')]},'queuecallerenterreason':{'type':Sequelize[_0xfd9a('0xb')],'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 eaacac5..35c0775 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 _0x6d48=['options','includeAll','include','findAll','rows','catch','params','filters','intersection','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','defaults','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x41e499,_0x48d0dc){var _0x45ac00=function(_0x491f46){while(--_0x491f46){_0x41e499['push'](_0x41e499['shift']());}};_0x45ac00(++_0x48d0dc);}(_0x6d48,0xfb));var _0x86d4=function(_0x327027,_0x554b7e){_0x327027=_0x327027-0x0;var _0x4a9067=_0x6d48[_0x327027];return _0x4a9067;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d4('0x0'));var zipdir=require(_0x86d4('0x1'));var jsonpatch=require(_0x86d4('0x2'));var rp=require(_0x86d4('0x3'));var moment=require(_0x86d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86d4('0x5'));var util=require(_0x86d4('0x6'));var path=require(_0x86d4('0x7'));var sox=require(_0x86d4('0x8'));var csv=require(_0x86d4('0x9'));var ejs=require(_0x86d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x86d4('0xb'));var jsforce=require(_0x86d4('0xc'));var deskjs=require(_0x86d4('0xd'));var toCsv=require(_0x86d4('0x9'));var querystring=require(_0x86d4('0xe'));var Papa=require(_0x86d4('0xf'));var Redis=require(_0x86d4('0x10'));var authService=require(_0x86d4('0x11'));var qs=require(_0x86d4('0x12'));var as=require(_0x86d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d4('0x14'))(_0x86d4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x86d4('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x86d4('0x17')](config[_0x86d4('0x18')],{'host':_0x86d4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86d4('0x18')]));require(_0x86d4('0x1a'))[_0x86d4('0x1b')](socket);function respondWithStatusCode(_0x502539,_0xd95b58){_0xd95b58=_0xd95b58||0xcc;return function(_0x57ea8b){if(_0x57ea8b){return _0x502539[_0x86d4('0x1c')](_0xd95b58);}return _0x502539[_0x86d4('0x1d')](_0xd95b58)[_0x86d4('0x1e')]();};}function respondWithResult(_0xa55a05,_0x24aeda){_0x24aeda=_0x24aeda||0xc8;return function(_0x3df090){if(_0x3df090){return _0xa55a05['status'](_0x24aeda)['json'](_0x3df090);}};}function respondWithFilteredResult(_0x3c26d9,_0x2c4e9f){return function(_0x51b4ec){if(_0x51b4ec){var _0x3a6cd1=typeof _0x2c4e9f[_0x86d4('0x1f')]===_0x86d4('0x20')&&typeof _0x2c4e9f[_0x86d4('0x21')]==='undefined';var _0x1a8457=_0x51b4ec[_0x86d4('0x22')];var _0x48cc8c=_0x3a6cd1?0x0:_0x2c4e9f['offset'];var _0x4acd72=_0x3a6cd1?_0x51b4ec['count']:_0x2c4e9f[_0x86d4('0x1f')]+_0x2c4e9f[_0x86d4('0x21')];var _0x472a24;if(_0x4acd72>=_0x1a8457){_0x4acd72=_0x1a8457;_0x472a24=0xc8;}else{_0x472a24=0xce;}_0x3c26d9[_0x86d4('0x1d')](_0x472a24);return _0x3c26d9[_0x86d4('0x23')]('Content-Range',_0x48cc8c+'-'+_0x4acd72+'/'+_0x1a8457)['json'](_0x51b4ec);}return null;};}function patchUpdates(_0x307bee){return function(_0x2e2e85){try{jsonpatch[_0x86d4('0x24')](_0x2e2e85,_0x307bee,!![]);}catch(_0x4220b8){return BPromise[_0x86d4('0x25')](_0x4220b8);}return _0x2e2e85[_0x86d4('0x26')]();};}function saveUpdates(_0x3205ef,_0x339db3){return function(_0x26d321){if(_0x26d321){return _0x26d321[_0x86d4('0x27')](_0x3205ef)[_0x86d4('0x28')](function(_0x59b47d){return _0x59b47d;});}return null;};}function removeEntity(_0x4bfd12,_0x210670){return function(_0x41829c){if(_0x41829c){return _0x41829c[_0x86d4('0x29')]()[_0x86d4('0x28')](function(){_0x4bfd12[_0x86d4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ecf21,_0x22a8c1){return function(_0x52534e){if(!_0x52534e){_0x1ecf21['sendStatus'](0x194);}return _0x52534e;};}function handleError(_0x53547b,_0x680624){_0x680624=_0x680624||0x1f4;return function(_0x1281b){logger[_0x86d4('0x2a')](_0x1281b[_0x86d4('0x2b')]);if(_0x1281b[_0x86d4('0x2c')]){delete _0x1281b['name'];}_0x53547b['status'](_0x680624)[_0x86d4('0x2d')](_0x1281b);};}exports['index']=function(_0x17a9c0,_0x343ed2){var _0x314158={},_0x58212f={},_0x1e265d={'count':0x0,'rows':[]};var _0x5db6f3=_[_0x86d4('0x2e')](db[_0x86d4('0x2f')][_0x86d4('0x30')],function(_0x2761c6){return{'name':_0x2761c6['fieldName'],'type':_0x2761c6[_0x86d4('0x31')][_0x86d4('0x32')]};});_0x58212f[_0x86d4('0x33')]=_['map'](_0x5db6f3,'name');_0x58212f[_0x86d4('0x34')]=_[_0x86d4('0x35')](_0x17a9c0[_0x86d4('0x34')]);_0x58212f['filters']=_['intersection'](_0x58212f[_0x86d4('0x33')],_0x58212f[_0x86d4('0x34')]);_0x314158[_0x86d4('0x36')]=_['intersection'](_0x58212f[_0x86d4('0x33')],qs[_0x86d4('0x37')](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x37')]));_0x314158[_0x86d4('0x36')]=_0x314158['attributes']['length']?_0x314158[_0x86d4('0x36')]:_0x58212f[_0x86d4('0x33')];if(!_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x38')](_0x86d4('0x39'))){_0x314158[_0x86d4('0x21')]=qs[_0x86d4('0x21')](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x21')]);_0x314158[_0x86d4('0x1f')]=qs['offset'](_0x17a9c0[_0x86d4('0x34')]['offset']);}_0x314158[_0x86d4('0x3a')]=qs['sort'](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x3b')]);_0x314158['where']=qs['filters'](_[_0x86d4('0x3c')](_0x17a9c0[_0x86d4('0x34')],_0x58212f['filters']),_0x5db6f3);if(_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x3d')]){_0x314158[_0x86d4('0x3e')]=_[_0x86d4('0x3f')](_0x314158[_0x86d4('0x3e')],{'$or':_[_0x86d4('0x2e')](_0x5db6f3,function(_0x3c9260){if(_0x3c9260['type']!==_0x86d4('0x40')){var _0x34f83a={};_0x34f83a[_0x3c9260[_0x86d4('0x2c')]]={'$like':'%'+_0x17a9c0['query'][_0x86d4('0x3d')]+'%'};return _0x34f83a;}})});}_0x314158=_[_0x86d4('0x3f')]({},_0x314158,_0x17a9c0[_0x86d4('0x41')]);var _0x399e3e={'where':_0x314158[_0x86d4('0x3e')]};return db[_0x86d4('0x2f')][_0x86d4('0x22')](_0x399e3e)[_0x86d4('0x28')](function(_0x5a14ac){_0x1e265d[_0x86d4('0x22')]=_0x5a14ac;if(_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x42')]){_0x314158[_0x86d4('0x43')]=[{'all':!![]}];}return db[_0x86d4('0x2f')][_0x86d4('0x44')](_0x314158);})[_0x86d4('0x28')](function(_0x538212){_0x1e265d[_0x86d4('0x45')]=_0x538212;return _0x1e265d;})[_0x86d4('0x28')](respondWithFilteredResult(_0x343ed2,_0x314158))[_0x86d4('0x46')](handleError(_0x343ed2,null));};exports['show']=function(_0x501627,_0x554ac3){var _0x48e0f0={'raw':![],'where':{'id':_0x501627[_0x86d4('0x47')]['id']}},_0x14134e={};_0x14134e[_0x86d4('0x33')]=_['keys'](db[_0x86d4('0x2f')][_0x86d4('0x30')]);_0x14134e[_0x86d4('0x34')]=_['keys'](_0x501627[_0x86d4('0x34')]);_0x14134e[_0x86d4('0x48')]=_[_0x86d4('0x49')](_0x14134e['model'],_0x14134e[_0x86d4('0x34')]);_0x48e0f0['attributes']=_['intersection'](_0x14134e['model'],qs[_0x86d4('0x37')](_0x501627[_0x86d4('0x34')][_0x86d4('0x37')]));_0x48e0f0[_0x86d4('0x36')]=_0x48e0f0[_0x86d4('0x36')]['length']?_0x48e0f0[_0x86d4('0x36')]:_0x14134e[_0x86d4('0x33')];if(_0x501627[_0x86d4('0x34')][_0x86d4('0x42')]){_0x48e0f0[_0x86d4('0x43')]=[{'all':!![]}];}_0x48e0f0=_[_0x86d4('0x3f')]({},_0x48e0f0,_0x501627[_0x86d4('0x41')]);return db[_0x86d4('0x2f')][_0x86d4('0x4a')](_0x48e0f0)[_0x86d4('0x28')](handleEntityNotFound(_0x554ac3,null))['then'](respondWithResult(_0x554ac3,null))[_0x86d4('0x46')](handleError(_0x554ac3,null));};exports[_0x86d4('0x4b')]=function(_0x5b58f6,_0x35ab9f){return db[_0x86d4('0x2f')][_0x86d4('0x4b')](_0x5b58f6['body'],{})[_0x86d4('0x28')](respondWithResult(_0x35ab9f,0xc9))[_0x86d4('0x46')](handleError(_0x35ab9f,null));};exports['update']=function(_0x4d05c1,_0x151f22){if(_0x4d05c1[_0x86d4('0x4c')]['id']){delete _0x4d05c1[_0x86d4('0x4c')]['id'];}return db['VoiceQueueReport'][_0x86d4('0x4a')]({'where':{'id':_0x4d05c1[_0x86d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x151f22,null))[_0x86d4('0x28')](saveUpdates(_0x4d05c1[_0x86d4('0x4c')],null))[_0x86d4('0x28')](respondWithResult(_0x151f22,null))[_0x86d4('0x46')](handleError(_0x151f22,null));};exports[_0x86d4('0x29')]=function(_0x5ceedf,_0xb44628){return db['VoiceQueueReport'][_0x86d4('0x4a')]({'where':{'id':_0x5ceedf[_0x86d4('0x47')]['id']}})[_0x86d4('0x28')](handleEntityNotFound(_0xb44628,null))['then'](removeEntity(_0xb44628,null))[_0x86d4('0x46')](handleError(_0xb44628,null));};exports[_0x86d4('0x4d')]=function(_0x5a4976,_0xa335b1){return db[_0x86d4('0x2f')]['describe']()['then'](respondWithResult(_0xa335b1,null))[_0x86d4('0x46')](handleError(_0xa335b1,null));};exports[_0x86d4('0x4e')]=function(_0x59adba,_0x151d00){var _0x455154={},_0x423ed7={},_0x436a07={'count':0x0,'rows':[]};_0x423ed7[_0x86d4('0x33')]=_['keys'](db[_0x86d4('0x2f')]['rawAttributes']);_0x423ed7[_0x86d4('0x34')]=_[_0x86d4('0x35')](_0x59adba['query']);_0x423ed7['filters']=_[_0x86d4('0x49')](_0x423ed7['model'],_0x423ed7[_0x86d4('0x34')]);_0x455154[_0x86d4('0x36')]=_[_0x86d4('0x49')](_0x423ed7[_0x86d4('0x33')],qs[_0x86d4('0x37')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x37')]));_0x455154[_0x86d4('0x36')]=_0x455154[_0x86d4('0x36')]['length']?_0x455154['attributes']:_0x423ed7[_0x86d4('0x33')];if(!_0x59adba[_0x86d4('0x34')][_0x86d4('0x38')]('nolimit')){_0x455154[_0x86d4('0x21')]=qs[_0x86d4('0x21')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x21')]);_0x455154['offset']=qs[_0x86d4('0x1f')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x1f')]);}_0x455154[_0x86d4('0x3a')]=qs[_0x86d4('0x3b')](_0x59adba['query']['sort']);_0x455154[_0x86d4('0x3e')]=qs[_0x86d4('0x48')](_['pick'](_0x59adba['query'],_0x423ed7[_0x86d4('0x48')]));if(_0x59adba['query'][_0x86d4('0x3d')]){_0x455154[_0x86d4('0x3e')]=_[_0x86d4('0x3f')](_0x455154[_0x86d4('0x3e')],{'$or':_[_0x86d4('0x2e')](_0x455154[_0x86d4('0x36')],function(_0x90736e){var _0x12aa9e={};_0x12aa9e[_0x90736e]={'$like':'%'+_0x59adba[_0x86d4('0x34')][_0x86d4('0x3d')]+'%'};return _0x12aa9e;})});}_0x455154=_['merge']({},_0x455154,_0x59adba[_0x86d4('0x41')]);var _0x18d4f0={'where':_0x455154[_0x86d4('0x3e')]};return db[_0x86d4('0x2f')][_0x86d4('0x22')](_0x18d4f0)[_0x86d4('0x28')](function(_0x4fc5a5){_0x436a07[_0x86d4('0x22')]=_0x4fc5a5;if(_0x59adba[_0x86d4('0x34')][_0x86d4('0x42')]){_0x455154[_0x86d4('0x43')]=[{'all':!![]}];}return db[_0x86d4('0x2f')]['findAll'](_0x455154);})[_0x86d4('0x28')](function(_0x4373ad){_0x436a07['rows']=_0x4373ad;return _0x436a07;})['then'](respondWithFilteredResult(_0x151d00,_0x455154,_0x86d4('0x4e')))[_0x86d4('0x46')](handleError(_0x151d00,null,_0x86d4('0x4e')));}; \ No newline at end of file +var _0x6a5d=['sendStatus','error','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','then','includeAll','include','findAll','rows','catch','params','options','create','body','find','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x2bdb37,_0x5cc638){var _0x190198=function(_0x1dbc2c){while(--_0x1dbc2c){_0x2bdb37['push'](_0x2bdb37['shift']());}};_0x190198(++_0x5cc638);}(_0x6a5d,0x122));var _0xd6a5=function(_0x160b20,_0x1d09e8){_0x160b20=_0x160b20-0x0;var _0x5f3654=_0x6a5d[_0x160b20];return _0x5f3654;};'use strict';var emlformat=require(_0xd6a5('0x0'));var rimraf=require(_0xd6a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6a5('0x2'));var moment=require(_0xd6a5('0x3'));var BPromise=require(_0xd6a5('0x4'));var Mustache=require(_0xd6a5('0x5'));var util=require(_0xd6a5('0x6'));var path=require(_0xd6a5('0x7'));var sox=require(_0xd6a5('0x8'));var csv=require('to-csv');var ejs=require(_0xd6a5('0x9'));var fs=require('fs');var fs_extra=require(_0xd6a5('0xa'));var _=require('lodash');var squel=require(_0xd6a5('0xb'));var crypto=require(_0xd6a5('0xc'));var jsforce=require(_0xd6a5('0xd'));var deskjs=require(_0xd6a5('0xe'));var toCsv=require(_0xd6a5('0xf'));var querystring=require(_0xd6a5('0x10'));var Papa=require(_0xd6a5('0x11'));var Redis=require('ioredis');var authService=require(_0xd6a5('0x12'));var qs=require(_0xd6a5('0x13'));var as=require(_0xd6a5('0x14'));var hardwareService=require(_0xd6a5('0x15'));var logger=require(_0xd6a5('0x16'))(_0xd6a5('0x17'));var utils=require(_0xd6a5('0x18'));var config=require(_0xd6a5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd6a5('0x1a'))['db'];config[_0xd6a5('0x1b')]=_[_0xd6a5('0x1c')](config['redis'],{'host':_0xd6a5('0x1d'),'port':0x18eb});var socket=require(_0xd6a5('0x1e'))(new Redis(config[_0xd6a5('0x1b')]));require('./voiceQueueReport.socket')[_0xd6a5('0x1f')](socket);function respondWithStatusCode(_0x4d738d,_0x2745fd){_0x2745fd=_0x2745fd||0xcc;return function(_0x14ecf8){if(_0x14ecf8){return _0x4d738d['sendStatus'](_0x2745fd);}return _0x4d738d[_0xd6a5('0x20')](_0x2745fd)[_0xd6a5('0x21')]();};}function respondWithResult(_0x45fcad,_0x5a975c){_0x5a975c=_0x5a975c||0xc8;return function(_0x372042){if(_0x372042){return _0x45fcad[_0xd6a5('0x20')](_0x5a975c)[_0xd6a5('0x22')](_0x372042);}};}function respondWithFilteredResult(_0x4ff4f4,_0x1c5278){return function(_0x379347){if(_0x379347){var _0x17b6e6=typeof _0x1c5278['offset']===_0xd6a5('0x23')&&typeof _0x1c5278[_0xd6a5('0x24')]===_0xd6a5('0x23');var _0x360723=_0x379347[_0xd6a5('0x25')];var _0x416875=_0x17b6e6?0x0:_0x1c5278[_0xd6a5('0x26')];var _0x406274=_0x17b6e6?_0x379347[_0xd6a5('0x25')]:_0x1c5278['offset']+_0x1c5278[_0xd6a5('0x24')];var _0x2d5186;if(_0x406274>=_0x360723){_0x406274=_0x360723;_0x2d5186=0xc8;}else{_0x2d5186=0xce;}_0x4ff4f4[_0xd6a5('0x20')](_0x2d5186);return _0x4ff4f4[_0xd6a5('0x27')](_0xd6a5('0x28'),_0x416875+'-'+_0x406274+'/'+_0x360723)[_0xd6a5('0x22')](_0x379347);}return null;};}function patchUpdates(_0x1232f4){return function(_0x1741d3){try{jsonpatch[_0xd6a5('0x29')](_0x1741d3,_0x1232f4,!![]);}catch(_0x281f65){return BPromise[_0xd6a5('0x2a')](_0x281f65);}return _0x1741d3[_0xd6a5('0x2b')]();};}function saveUpdates(_0x2d3583,_0x9028d){return function(_0x1bc648){if(_0x1bc648){return _0x1bc648[_0xd6a5('0x2c')](_0x2d3583)['then'](function(_0x460904){return _0x460904;});}return null;};}function removeEntity(_0x1d95bd,_0x529ff4){return function(_0x4b2e0c){if(_0x4b2e0c){return _0x4b2e0c[_0xd6a5('0x2d')]()['then'](function(){_0x1d95bd['status'](0xcc)[_0xd6a5('0x21')]();});}};}function handleEntityNotFound(_0xe40ff9,_0x211b88){return function(_0x24cf90){if(!_0x24cf90){_0xe40ff9[_0xd6a5('0x2e')](0x194);}return _0x24cf90;};}function handleError(_0x2d1662,_0x57490f){_0x57490f=_0x57490f||0x1f4;return function(_0x568060){logger[_0xd6a5('0x2f')](_0x568060[_0xd6a5('0x30')]);if(_0x568060[_0xd6a5('0x31')]){delete _0x568060[_0xd6a5('0x31')];}_0x2d1662[_0xd6a5('0x20')](_0x57490f)['send'](_0x568060);};}exports['index']=function(_0x2e9ab8,_0x461d0f){var _0x3469fd={},_0x2810d3={},_0x263362={'count':0x0,'rows':[]};var _0x3398cc=_[_0xd6a5('0x32')](db[_0xd6a5('0x33')][_0xd6a5('0x34')],function(_0x5b7d11){return{'name':_0x5b7d11[_0xd6a5('0x35')],'type':_0x5b7d11['type']['key']};});_0x2810d3[_0xd6a5('0x36')]=_['map'](_0x3398cc,'name');_0x2810d3[_0xd6a5('0x37')]=_[_0xd6a5('0x38')](_0x2e9ab8[_0xd6a5('0x37')]);_0x2810d3[_0xd6a5('0x39')]=_[_0xd6a5('0x3a')](_0x2810d3[_0xd6a5('0x36')],_0x2810d3['query']);_0x3469fd[_0xd6a5('0x3b')]=_[_0xd6a5('0x3a')](_0x2810d3[_0xd6a5('0x36')],qs['fields'](_0x2e9ab8['query'][_0xd6a5('0x3c')]));_0x3469fd[_0xd6a5('0x3b')]=_0x3469fd[_0xd6a5('0x3b')][_0xd6a5('0x3d')]?_0x3469fd[_0xd6a5('0x3b')]:_0x2810d3[_0xd6a5('0x36')];if(!_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x3e')]('nolimit')){_0x3469fd[_0xd6a5('0x24')]=qs['limit'](_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x24')]);_0x3469fd['offset']=qs[_0xd6a5('0x26')](_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x26')]);}_0x3469fd[_0xd6a5('0x3f')]=qs[_0xd6a5('0x40')](_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x40')]);_0x3469fd[_0xd6a5('0x41')]=qs['filters'](_[_0xd6a5('0x42')](_0x2e9ab8['query'],_0x2810d3[_0xd6a5('0x39')]),_0x3398cc);if(_0x2e9ab8[_0xd6a5('0x37')]['filter']){_0x3469fd[_0xd6a5('0x41')]=_[_0xd6a5('0x43')](_0x3469fd[_0xd6a5('0x41')],{'$or':_[_0xd6a5('0x32')](_0x3398cc,function(_0x249b18){if(_0x249b18[_0xd6a5('0x44')]!=='VIRTUAL'){var _0x21aba6={};_0x21aba6[_0x249b18['name']]={'$like':'%'+_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x45')]+'%'};return _0x21aba6;}})});}_0x3469fd=_['merge']({},_0x3469fd,_0x2e9ab8['options']);var _0xf547ba={'where':_0x3469fd[_0xd6a5('0x41')]};return db['VoiceQueueReport']['count'](_0xf547ba)[_0xd6a5('0x46')](function(_0x3f5008){_0x263362[_0xd6a5('0x25')]=_0x3f5008;if(_0x2e9ab8[_0xd6a5('0x37')][_0xd6a5('0x47')]){_0x3469fd[_0xd6a5('0x48')]=[{'all':!![]}];}return db[_0xd6a5('0x33')][_0xd6a5('0x49')](_0x3469fd);})[_0xd6a5('0x46')](function(_0x12db50){_0x263362[_0xd6a5('0x4a')]=_0x12db50;return _0x263362;})[_0xd6a5('0x46')](respondWithFilteredResult(_0x461d0f,_0x3469fd))[_0xd6a5('0x4b')](handleError(_0x461d0f,null));};exports['show']=function(_0x2f66c8,_0x3c82df){var _0x358740={'raw':![],'where':{'id':_0x2f66c8[_0xd6a5('0x4c')]['id']}},_0x4603d8={};_0x4603d8[_0xd6a5('0x36')]=_[_0xd6a5('0x38')](db[_0xd6a5('0x33')][_0xd6a5('0x34')]);_0x4603d8['query']=_[_0xd6a5('0x38')](_0x2f66c8[_0xd6a5('0x37')]);_0x4603d8[_0xd6a5('0x39')]=_[_0xd6a5('0x3a')](_0x4603d8[_0xd6a5('0x36')],_0x4603d8['query']);_0x358740['attributes']=_['intersection'](_0x4603d8['model'],qs[_0xd6a5('0x3c')](_0x2f66c8[_0xd6a5('0x37')][_0xd6a5('0x3c')]));_0x358740[_0xd6a5('0x3b')]=_0x358740[_0xd6a5('0x3b')][_0xd6a5('0x3d')]?_0x358740['attributes']:_0x4603d8[_0xd6a5('0x36')];if(_0x2f66c8[_0xd6a5('0x37')][_0xd6a5('0x47')]){_0x358740['include']=[{'all':!![]}];}_0x358740=_[_0xd6a5('0x43')]({},_0x358740,_0x2f66c8[_0xd6a5('0x4d')]);return db[_0xd6a5('0x33')]['find'](_0x358740)[_0xd6a5('0x46')](handleEntityNotFound(_0x3c82df,null))[_0xd6a5('0x46')](respondWithResult(_0x3c82df,null))[_0xd6a5('0x4b')](handleError(_0x3c82df,null));};exports['create']=function(_0x5747dd,_0x2a34be){return db[_0xd6a5('0x33')][_0xd6a5('0x4e')](_0x5747dd[_0xd6a5('0x4f')],{})[_0xd6a5('0x46')](respondWithResult(_0x2a34be,0xc9))[_0xd6a5('0x4b')](handleError(_0x2a34be,null));};exports[_0xd6a5('0x2c')]=function(_0xf479d0,_0x4cebbc){if(_0xf479d0[_0xd6a5('0x4f')]['id']){delete _0xf479d0[_0xd6a5('0x4f')]['id'];}return db[_0xd6a5('0x33')]['find']({'where':{'id':_0xf479d0[_0xd6a5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4cebbc,null))['then'](saveUpdates(_0xf479d0['body'],null))[_0xd6a5('0x46')](respondWithResult(_0x4cebbc,null))[_0xd6a5('0x4b')](handleError(_0x4cebbc,null));};exports[_0xd6a5('0x2d')]=function(_0x3b87fa,_0x52ad25){return db['VoiceQueueReport'][_0xd6a5('0x50')]({'where':{'id':_0x3b87fa[_0xd6a5('0x4c')]['id']}})[_0xd6a5('0x46')](handleEntityNotFound(_0x52ad25,null))[_0xd6a5('0x46')](removeEntity(_0x52ad25,null))[_0xd6a5('0x4b')](handleError(_0x52ad25,null));};exports[_0xd6a5('0x51')]=function(_0x454cd5,_0x5802db){return db[_0xd6a5('0x33')]['describe']()[_0xd6a5('0x46')](respondWithResult(_0x5802db,null))[_0xd6a5('0x4b')](handleError(_0x5802db,null));};exports[_0xd6a5('0x52')]=function(_0x2138eb,_0x366feb){var _0x4bedba={},_0x45a7c9={},_0x1efbd7={'count':0x0,'rows':[]};_0x45a7c9[_0xd6a5('0x36')]=_[_0xd6a5('0x38')](db['VoiceQueueReport'][_0xd6a5('0x34')]);_0x45a7c9[_0xd6a5('0x37')]=_[_0xd6a5('0x38')](_0x2138eb['query']);_0x45a7c9[_0xd6a5('0x39')]=_[_0xd6a5('0x3a')](_0x45a7c9[_0xd6a5('0x36')],_0x45a7c9[_0xd6a5('0x37')]);_0x4bedba[_0xd6a5('0x3b')]=_[_0xd6a5('0x3a')](_0x45a7c9[_0xd6a5('0x36')],qs['fields'](_0x2138eb[_0xd6a5('0x37')][_0xd6a5('0x3c')]));_0x4bedba[_0xd6a5('0x3b')]=_0x4bedba[_0xd6a5('0x3b')][_0xd6a5('0x3d')]?_0x4bedba[_0xd6a5('0x3b')]:_0x45a7c9['model'];if(!_0x2138eb[_0xd6a5('0x37')][_0xd6a5('0x3e')](_0xd6a5('0x53'))){_0x4bedba[_0xd6a5('0x24')]=qs[_0xd6a5('0x24')](_0x2138eb['query'][_0xd6a5('0x24')]);_0x4bedba['offset']=qs[_0xd6a5('0x26')](_0x2138eb[_0xd6a5('0x37')]['offset']);}_0x4bedba['order']=qs[_0xd6a5('0x40')](_0x2138eb[_0xd6a5('0x37')]['sort']);_0x4bedba[_0xd6a5('0x41')]=qs[_0xd6a5('0x39')](_[_0xd6a5('0x42')](_0x2138eb[_0xd6a5('0x37')],_0x45a7c9[_0xd6a5('0x39')]));if(_0x2138eb[_0xd6a5('0x37')][_0xd6a5('0x45')]){_0x4bedba[_0xd6a5('0x41')]=_[_0xd6a5('0x43')](_0x4bedba[_0xd6a5('0x41')],{'$or':_[_0xd6a5('0x32')](_0x4bedba[_0xd6a5('0x3b')],function(_0x3efb96){var _0x2e123a={};_0x2e123a[_0x3efb96]={'$like':'%'+_0x2138eb['query'][_0xd6a5('0x45')]+'%'};return _0x2e123a;})});}_0x4bedba=_['merge']({},_0x4bedba,_0x2138eb['options']);var _0x295483={'where':_0x4bedba[_0xd6a5('0x41')]};return db['VoiceQueueReport'][_0xd6a5('0x25')](_0x295483)[_0xd6a5('0x46')](function(_0x2422ed){_0x1efbd7[_0xd6a5('0x25')]=_0x2422ed;if(_0x2138eb['query'][_0xd6a5('0x47')]){_0x4bedba[_0xd6a5('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd6a5('0x49')](_0x4bedba);})[_0xd6a5('0x46')](function(_0x2d569f){_0x1efbd7[_0xd6a5('0x4a')]=_0x2d569f;return _0x1efbd7;})[_0xd6a5('0x46')](respondWithFilteredResult(_0x366feb,_0x4bedba,_0xd6a5('0x52')))[_0xd6a5('0x4b')](handleError(_0x366feb,null,_0xd6a5('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 3b536a5..9e9845b 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 _0xd17c=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x348461,_0x47a721){var _0x5b30f6=function(_0x594e30){while(--_0x594e30){_0x348461['push'](_0x348461['shift']());}};_0x5b30f6(++_0x47a721);}(_0xd17c,0xd1));var _0xcd17=function(_0x158de7,_0x369b23){_0x158de7=_0x158de7-0x0;var _0x24d61e=_0xd17c[_0x158de7];return _0x24d61e;};'use strict';var EventEmitter=require(_0xcd17('0x0'));var VoiceQueueReport=require(_0xcd17('0x1'))['db'][_0xcd17('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xcd17('0x3')](0x0);var events={'afterCreate':_0xcd17('0x4'),'afterUpdate':_0xcd17('0x5'),'afterDestroy':_0xcd17('0x6')};function emitEvent(_0x339f8b){return function(_0x5d0f6e,_0x38147b,_0x60cd56){VoiceQueueReportEvents['emit'](_0x339f8b+':'+_0x5d0f6e['id'],_0x5d0f6e);VoiceQueueReportEvents[_0xcd17('0x7')](_0x339f8b,_0x5d0f6e);_0x60cd56(null);};}for(var e in events){if(events[_0xcd17('0x8')](e)){var event=events[e];VoiceQueueReport[_0xcd17('0x9')](e,emitEvent(event));}}module[_0xcd17('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xbfa1=['events','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x284f13,_0x4ed439){var _0x451152=function(_0x56a900){while(--_0x56a900){_0x284f13['push'](_0x284f13['shift']());}};_0x451152(++_0x4ed439);}(_0xbfa1,0xaa));var _0x1bfa=function(_0xea5a83,_0x2e8a4b){_0xea5a83=_0xea5a83-0x0;var _0x13817b=_0xbfa1[_0xea5a83];return _0x13817b;};'use strict';var EventEmitter=require(_0x1bfa('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x1bfa('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1bfa('0x2')](0x0);var events={'afterCreate':_0x1bfa('0x3'),'afterUpdate':_0x1bfa('0x4'),'afterDestroy':_0x1bfa('0x5')};function emitEvent(_0x52b8bc){return function(_0x3bbbdf,_0x2c0585,_0x5e29a2){VoiceQueueReportEvents[_0x1bfa('0x6')](_0x52b8bc+':'+_0x3bbbdf['id'],_0x3bbbdf);VoiceQueueReportEvents[_0x1bfa('0x6')](_0x52b8bc,_0x3bbbdf);_0x5e29a2(null);};}for(var e in events){if(events[_0x1bfa('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1bfa('0x8')](e,emitEvent(event));}}module[_0x1bfa('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2f03df7..e1be182 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 _0xa901=['./voiceQueueReport.attributes','define','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x52cd61,_0x2b8b85){var _0x26f8ea=function(_0x32de68){while(--_0x32de68){_0x52cd61['push'](_0x52cd61['shift']());}};_0x26f8ea(++_0x2b8b85);}(_0xa901,0x65));var _0x1a90=function(_0x32cfcd,_0x45c746){_0x32cfcd=_0x32cfcd-0x0;var _0x432baa=_0xa901[_0x32cfcd];return _0x432baa;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var logger=require(_0x1a90('0x1'))(_0x1a90('0x2'));var moment=require(_0x1a90('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a90('0x4'));var fs=require('fs');var path=require(_0x1a90('0x5'));var rimraf=require(_0x1a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a90('0x7'));module['exports']=function(_0x1c3e0d,_0x19eb97){return _0x1c3e0d[_0x1a90('0x8')]('VoiceQueueReport',attributes,{'tableName':_0x1a90('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1a90('0xa')]},{'fields':[_0x1a90('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a92=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','calleridnum'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9a92,0x196));var _0x29a9=function(_0x5ba42b,_0x3cd21c){_0x5ba42b=_0x5ba42b-0x0;var _0x29084e=_0x9a92[_0x5ba42b];return _0x29084e;};'use strict';var _=require(_0x29a9('0x0'));var util=require(_0x29a9('0x1'));var logger=require(_0x29a9('0x2'))(_0x29a9('0x3'));var moment=require(_0x29a9('0x4'));var BPromise=require(_0x29a9('0x5'));var rp=require(_0x29a9('0x6'));var fs=require('fs');var path=require(_0x29a9('0x7'));var rimraf=require(_0x29a9('0x8'));var config=require(_0x29a9('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x29a9('0xa')]=function(_0x246d80,_0x4b12a8){return _0x246d80[_0x29a9('0xb')](_0x29a9('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x29a9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 9935525..e6834dc 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 _0xc874=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','model','attributes','include','map','then','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x432e03,_0x23ae2e){var _0x3ebb01=function(_0x553f3f){while(--_0x553f3f){_0x432e03['push'](_0x432e03['shift']());}};_0x3ebb01(++_0x23ae2e);}(_0xc874,0x104));var _0x4c87=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xc874[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x4c87('0x0'));var util=require(_0x4c87('0x1'));var moment=require(_0x4c87('0x2'));var BPromise=require(_0x4c87('0x3'));var rs=require(_0x4c87('0x4'));var fs=require('fs');var Redis=require(_0x4c87('0x5'));var db=require(_0x4c87('0x6'))['db'];var utils=require(_0x4c87('0x7'));var logger=require('../../config/logger')(_0x4c87('0x8'));var config=require(_0x4c87('0x9'));var jayson=require(_0x4c87('0xa'));var client=jayson[_0x4c87('0xb')]['http']({'port':0x232a});config[_0x4c87('0xc')]=_[_0x4c87('0xd')](config[_0x4c87('0xc')],{'host':_0x4c87('0xe'),'port':0x18eb});var socket=require(_0x4c87('0xf'))(new Redis(config['redis']));require(_0x4c87('0x10'))[_0x4c87('0x11')](socket);function respondWithRpcPromise(_0x12fb25,_0x1789c7,_0x209df1){return new BPromise(function(_0x11c363,_0x1b1e26){return client[_0x4c87('0x12')](_0x12fb25,_0x209df1)['then'](function(_0x3899ad){logger[_0x4c87('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1789c7,_0x4c87('0x14'));logger[_0x4c87('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1789c7,'request\x20sent',JSON[_0x4c87('0x16')](_0x3899ad));if(_0x3899ad[_0x4c87('0x17')]){if(_0x3899ad[_0x4c87('0x17')]['code']===0x1f4){logger[_0x4c87('0x17')](_0x4c87('0x18'),_0x1789c7,_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);return _0x1b1e26(_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);}logger['error'](_0x4c87('0x18'),_0x1789c7,_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);return _0x11c363(_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);}else{logger[_0x4c87('0x13')](_0x4c87('0x18'),_0x1789c7,_0x4c87('0x14'));_0x11c363(_0x3899ad[_0x4c87('0x1a')][_0x4c87('0x19')]);}})[_0x4c87('0x1b')](function(_0x494c4f){logger[_0x4c87('0x17')](_0x4c87('0x18'),_0x1789c7,_0x494c4f);_0x1b1e26(_0x494c4f);});});}exports[_0x4c87('0x1c')]=function(_0x3f653f){var _0xa4480b=this;return new Promise(function(_0x444786,_0x20d1df){return db[_0x4c87('0x1d')][_0x4c87('0x1e')]({'raw':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')][_0x4c87('0x20')]||null:null,'attributes':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f['options']['attributes']||null:null,'limit':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')][_0x4c87('0x21')]||null:null,'include':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')]['include']?_['map'](_0x3f653f[_0x4c87('0x1f')]['include'],function(_0x5e9620){return{'model':db[_0x5e9620[_0x4c87('0x22')]],'as':_0x5e9620['as'],'attributes':_0x5e9620[_0x4c87('0x23')],'include':_0x5e9620[_0x4c87('0x24')]?_[_0x4c87('0x25')](_0x5e9620['include'],function(_0x1954ca){return{'model':db[_0x1954ca[_0x4c87('0x22')]],'as':_0x1954ca['as'],'attributes':_0x1954ca[_0x4c87('0x23')],'include':_0x1954ca[_0x4c87('0x24')]?_[_0x4c87('0x25')](_0x1954ca[_0x4c87('0x24')],function(_0x3714fc){return{'model':db[_0x3714fc[_0x4c87('0x22')]],'as':_0x3714fc['as'],'attributes':_0x3714fc[_0x4c87('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4c87('0x26')](function(_0x38b58d){logger['info']('GetVoiceQueueReport',_0x3f653f);logger[_0x4c87('0x15')](_0x4c87('0x1c'),_0x3f653f,JSON[_0x4c87('0x16')](_0x38b58d));_0x444786(_0x38b58d);})['catch'](function(_0x2cd011){logger[_0x4c87('0x17')](_0x4c87('0x1c'),_0x2cd011[_0x4c87('0x19')],_0x3f653f);_0x20d1df(_0xa4480b['error'](0x1f4,_0x2cd011[_0x4c87('0x19')]));});});};exports[_0x4c87('0x27')]=function(_0xb97b8){var _0x5f508b=this;return new Promise(function(_0x19896e,_0x339cfe){return db[_0x4c87('0x1d')][_0x4c87('0x28')](_0xb97b8['body'],{'raw':_0xb97b8['options']?_0xb97b8['options']['raw']===undefined?!![]:![]:!![]})[_0x4c87('0x26')](function(_0x37e560){logger[_0x4c87('0x13')]('CreateVoiceQueueReport',_0xb97b8);logger['debug']('CreateVoiceQueueReport',_0xb97b8,JSON['stringify'](_0x37e560));_0x19896e(_0x37e560);})[_0x4c87('0x1b')](function(_0x328606){logger[_0x4c87('0x17')](_0x4c87('0x27'),_0x328606[_0x4c87('0x19')],_0xb97b8);_0x339cfe(_0x5f508b['error'](0x1f4,_0x328606[_0x4c87('0x19')]));});});};exports[_0x4c87('0x29')]=function(_0x278a0f){var _0x4a6447=this;return new Promise(function(_0x272973,_0x2a8617){return db[_0x4c87('0x1d')][_0x4c87('0x2a')](_0x278a0f[_0x4c87('0x2b')],{'raw':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f[_0x4c87('0x1f')][_0x4c87('0x2c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f[_0x4c87('0x1f')][_0x4c87('0x20')]||null:null,'attributes':_0x278a0f['options']?_0x278a0f['options'][_0x4c87('0x23')]||null:null,'limit':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f['options'][_0x4c87('0x21')]||null:null})[_0x4c87('0x26')](function(_0x12486e){logger[_0x4c87('0x13')](_0x4c87('0x29'),_0x278a0f);logger[_0x4c87('0x15')](_0x4c87('0x29'),_0x278a0f,JSON[_0x4c87('0x16')](_0x12486e));_0x272973(_0x12486e);})[_0x4c87('0x1b')](function(_0x62d2d2){logger[_0x4c87('0x17')](_0x4c87('0x29'),_0x62d2d2['message'],_0x278a0f);_0x2a8617(_0x4a6447['error'](0x1f4,_0x62d2d2[_0x4c87('0x19')]));});});}; \ No newline at end of file +var _0x697c=['error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ae39d,_0x5c3787){var _0x1015a7=function(_0x261278){while(--_0x261278){_0x4ae39d['push'](_0x4ae39d['shift']());}};_0x1015a7(++_0x5c3787);}(_0x697c,0x17b));var _0xc697=function(_0x53d4c4,_0x3e9511){_0x53d4c4=_0x53d4c4-0x0;var _0x3dc1ce=_0x697c[_0x53d4c4];return _0x3dc1ce;};'use strict';var _=require(_0xc697('0x0'));var util=require(_0xc697('0x1'));var moment=require(_0xc697('0x2'));var BPromise=require(_0xc697('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc697('0x4'));var db=require(_0xc697('0x5'))['db'];var utils=require(_0xc697('0x6'));var logger=require(_0xc697('0x7'))(_0xc697('0x8'));var config=require(_0xc697('0x9'));var jayson=require(_0xc697('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xc697('0xb')]=_[_0xc697('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc697('0xd')](socket);function respondWithRpcPromise(_0x26ca16,_0x3373c6,_0x135db7){return new BPromise(function(_0x67d51d,_0x2d5318){return client['request'](_0x26ca16,_0x135db7)[_0xc697('0xe')](function(_0x178896){logger[_0xc697('0xf')](_0xc697('0x10'),_0x3373c6,_0xc697('0x11'));logger[_0xc697('0x12')](_0xc697('0x13'),_0x3373c6,_0xc697('0x11'),JSON[_0xc697('0x14')](_0x178896));if(_0x178896['error']){if(_0x178896[_0xc697('0x15')][_0xc697('0x16')]===0x1f4){logger[_0xc697('0x15')](_0xc697('0x10'),_0x3373c6,_0x178896['error']['message']);return _0x2d5318(_0x178896[_0xc697('0x15')][_0xc697('0x17')]);}logger[_0xc697('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x3373c6,_0x178896['error'][_0xc697('0x17')]);return _0x67d51d(_0x178896[_0xc697('0x15')][_0xc697('0x17')]);}else{logger[_0xc697('0xf')](_0xc697('0x10'),_0x3373c6,_0xc697('0x11'));_0x67d51d(_0x178896[_0xc697('0x18')]['message']);}})[_0xc697('0x19')](function(_0x175586){logger[_0xc697('0x15')](_0xc697('0x10'),_0x3373c6,_0x175586);_0x2d5318(_0x175586);});});}exports[_0xc697('0x1a')]=function(_0x1b58e0){var _0x2129e3=this;return new Promise(function(_0x526a3a,_0x4b90ec){return db[_0xc697('0x1b')]['findAll']({'raw':_0x1b58e0['options']?_0x1b58e0[_0xc697('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b58e0[_0xc697('0x1c')]?_0x1b58e0[_0xc697('0x1c')][_0xc697('0x1d')]||null:null,'attributes':_0x1b58e0['options']?_0x1b58e0['options'][_0xc697('0x1e')]||null:null,'limit':_0x1b58e0[_0xc697('0x1c')]?_0x1b58e0['options'][_0xc697('0x1f')]||null:null,'include':_0x1b58e0[_0xc697('0x1c')]?_0x1b58e0[_0xc697('0x1c')][_0xc697('0x20')]?_[_0xc697('0x21')](_0x1b58e0['options'][_0xc697('0x20')],function(_0x1baea5){return{'model':db[_0x1baea5[_0xc697('0x22')]],'as':_0x1baea5['as'],'attributes':_0x1baea5[_0xc697('0x1e')],'include':_0x1baea5[_0xc697('0x20')]?_[_0xc697('0x21')](_0x1baea5['include'],function(_0x2eb6b4){return{'model':db[_0x2eb6b4[_0xc697('0x22')]],'as':_0x2eb6b4['as'],'attributes':_0x2eb6b4[_0xc697('0x1e')],'include':_0x2eb6b4[_0xc697('0x20')]?_[_0xc697('0x21')](_0x2eb6b4[_0xc697('0x20')],function(_0x1881d9){return{'model':db[_0x1881d9[_0xc697('0x22')]],'as':_0x1881d9['as'],'attributes':_0x1881d9[_0xc697('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc697('0xe')](function(_0x53002b){logger['info'](_0xc697('0x1a'),_0x1b58e0);logger[_0xc697('0x12')]('GetVoiceQueueReport',_0x1b58e0,JSON['stringify'](_0x53002b));_0x526a3a(_0x53002b);})[_0xc697('0x19')](function(_0x260d2a){logger[_0xc697('0x15')]('GetVoiceQueueReport',_0x260d2a[_0xc697('0x17')],_0x1b58e0);_0x4b90ec(_0x2129e3[_0xc697('0x15')](0x1f4,_0x260d2a[_0xc697('0x17')]));});});};exports[_0xc697('0x23')]=function(_0x26fbc2){var _0x12fe50=this;return new Promise(function(_0x12e29d,_0x2254a0){return db['VoiceQueueReport']['create'](_0x26fbc2[_0xc697('0x24')],{'raw':_0x26fbc2['options']?_0x26fbc2[_0xc697('0x1c')][_0xc697('0x25')]===undefined?!![]:![]:!![]})[_0xc697('0xe')](function(_0x4ba908){logger['info'](_0xc697('0x23'),_0x26fbc2);logger[_0xc697('0x12')](_0xc697('0x23'),_0x26fbc2,JSON[_0xc697('0x14')](_0x4ba908));_0x12e29d(_0x4ba908);})[_0xc697('0x19')](function(_0x212904){logger[_0xc697('0x15')](_0xc697('0x23'),_0x212904[_0xc697('0x17')],_0x26fbc2);_0x2254a0(_0x12fe50[_0xc697('0x15')](0x1f4,_0x212904[_0xc697('0x17')]));});});};exports[_0xc697('0x26')]=function(_0x4fa918){var _0x236ac0=this;return new Promise(function(_0x1d066f,_0x5ce2e9){return db[_0xc697('0x1b')][_0xc697('0x27')](_0x4fa918[_0xc697('0x24')],{'raw':_0x4fa918[_0xc697('0x1c')]?_0x4fa918[_0xc697('0x1c')][_0xc697('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fa918[_0xc697('0x1c')]?_0x4fa918[_0xc697('0x1c')][_0xc697('0x1d')]||null:null,'attributes':_0x4fa918['options']?_0x4fa918['options'][_0xc697('0x1e')]||null:null,'limit':_0x4fa918['options']?_0x4fa918[_0xc697('0x1c')][_0xc697('0x1f')]||null:null})[_0xc697('0xe')](function(_0x573f90){logger[_0xc697('0xf')](_0xc697('0x26'),_0x4fa918);logger[_0xc697('0x12')](_0xc697('0x26'),_0x4fa918,JSON[_0xc697('0x14')](_0x573f90));_0x1d066f(_0x573f90);})[_0xc697('0x19')](function(_0x2bb261){logger[_0xc697('0x15')](_0xc697('0x26'),_0x2bb261[_0xc697('0x17')],_0x4fa918);_0x5ce2e9(_0x236ac0[_0xc697('0x15')](0x1f4,_0x2bb261[_0xc697('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index bf2d66b..44b3c49 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 _0x4944=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update'];(function(_0x29678a,_0x183038){var _0x47c4ef=function(_0x50efde){while(--_0x50efde){_0x29678a['push'](_0x29678a['shift']());}};_0x47c4ef(++_0x183038);}(_0x4944,0x6d));var _0x4494=function(_0x58206b,_0x17d1cd){_0x58206b=_0x58206b-0x0;var _0x70bfaa=_0x4944[_0x58206b];return _0x70bfaa;};'use strict';var VoiceQueueReportEvents=require(_0x4494('0x0'));var events=['save',_0x4494('0x1'),_0x4494('0x2')];function createListener(_0x2578d3,_0x138f00){return function(_0x22adf0){_0x138f00['emit'](_0x2578d3,_0x22adf0);};}function removeListener(_0x187098,_0x5c7492){return function(){VoiceQueueReportEvents[_0x4494('0x3')](_0x187098,_0x5c7492);};}exports[_0x4494('0x4')]=function(_0x38480d){for(var _0xb94d02=0x0,_0x2a4911=events[_0x4494('0x5')];_0xb94d02<_0x2a4911;_0xb94d02++){var _0x55bb81=events[_0xb94d02];var _0x12ef8e=createListener(_0x4494('0x6')+_0x55bb81,_0x38480d);VoiceQueueReportEvents['on'](_0x55bb81,_0x12ef8e);}}; \ No newline at end of file +var _0xdbd0=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','voiceQueueReport:'];(function(_0x8cc7a6,_0x74ce1b){var _0xff3944=function(_0x22f8b0){while(--_0x22f8b0){_0x8cc7a6['push'](_0x8cc7a6['shift']());}};_0xff3944(++_0x74ce1b);}(_0xdbd0,0x88));var _0x0dbd=function(_0x1ce197,_0x166975){_0x1ce197=_0x1ce197-0x0;var _0x1328cf=_0xdbd0[_0x1ce197];return _0x1328cf;};'use strict';var VoiceQueueReportEvents=require(_0x0dbd('0x0'));var events=[_0x0dbd('0x1'),_0x0dbd('0x2'),_0x0dbd('0x3')];function createListener(_0x4392ca,_0x58ef9e){return function(_0x3ac5c2){_0x58ef9e[_0x0dbd('0x4')](_0x4392ca,_0x3ac5c2);};}function removeListener(_0x1aeffb,_0x5ec8d7){return function(){VoiceQueueReportEvents[_0x0dbd('0x5')](_0x1aeffb,_0x5ec8d7);};}exports[_0x0dbd('0x6')]=function(_0xcd515f){for(var _0x3bd770=0x0,_0x4b653b=events['length'];_0x3bd770<_0x4b653b;_0x3bd770++){var _0xcb72c2=events[_0x3bd770];var _0x3b3f21=createListener(_0x0dbd('0x7')+_0xcb72c2,_0xcd515f);VoiceQueueReportEvents['on'](_0xcb72c2,_0x3b3f21);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 070c61f..ac116b7 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 _0x8cb4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8cb4,0xf3));var _0x48cb=function(_0x5d621b,_0x122552){_0x5d621b=_0x5d621b-0x0;var _0xbee2ba=_0x8cb4[_0x5d621b];return _0xbee2ba;};'use strict';var multer=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var path=require(_0x48cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x48cb('0x3'));var router=express[_0x48cb('0x4')]();var fs_extra=require(_0x48cb('0x5'));var auth=require(_0x48cb('0x6'));var interaction=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xa')]);router[_0x48cb('0xb')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller['show']);router['post']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xd')]);router[_0x48cb('0xe')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0xf')]);router[_0x48cb('0x10')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0x11')]);module[_0x48cb('0x12')]=router; \ No newline at end of file +var _0xed0b=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ba386,_0x3442ba){var _0x16933c=function(_0x1d1165){while(--_0x1d1165){_0x5ba386['push'](_0x5ba386['shift']());}};_0x16933c(++_0x3442ba);}(_0xed0b,0x1c8));var _0xbed0=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0xed0b[_0x644ecd];return _0x1c66ce;};'use strict';var multer=require(_0xbed0('0x0'));var util=require('util');var path=require(_0xbed0('0x1'));var timeout=require('connect-timeout');var express=require(_0xbed0('0x2'));var router=express[_0xbed0('0x3')]();var fs_extra=require(_0xbed0('0x4'));var auth=require(_0xbed0('0x5'));var interaction=require(_0xbed0('0x6'));var config=require(_0xbed0('0x7'));var controller=require(_0xbed0('0x8'));router[_0xbed0('0x9')]('/',auth[_0xbed0('0xa')](),controller[_0xbed0('0xb')]);router[_0xbed0('0x9')](_0xbed0('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbed0('0xd')]('/',auth[_0xbed0('0xa')](),controller['create']);router['put'](_0xbed0('0xc'),auth['isAuthenticated'](),controller[_0xbed0('0xe')]);router[_0xbed0('0xf')](_0xbed0('0xc'),auth[_0xbed0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5f754b0..d6e6a27 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 _0x019e=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x12e3f4,_0x4a3923){var _0x50d9b4=function(_0x2f0972){while(--_0x2f0972){_0x12e3f4['push'](_0x12e3f4['shift']());}};_0x50d9b4(++_0x4a3923);}(_0x019e,0xe6));var _0xe019=function(_0x35ee4c,_0x44ee31){_0x35ee4c=_0x35ee4c-0x0;var _0x11882c=_0x019e[_0x35ee4c];return _0x11882c;};'use strict';var Sequelize=require(_0xe019('0x0'));var moment=require(_0xe019('0x1'));module[_0xe019('0x2')]={'time':{'type':Sequelize[_0xe019('0x3')]},'callid':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe019('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xe019('0x5'))}}; \ No newline at end of file +var _0x2e5a=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x5a79ce,_0x58c9cc){var _0x319707=function(_0x430984){while(--_0x430984){_0x5a79ce['push'](_0x5a79ce['shift']());}};_0x319707(++_0x58c9cc);}(_0x2e5a,0xec));var _0xa2e5=function(_0x1bf2a2,_0x2fb005){_0x1bf2a2=_0x1bf2a2-0x0;var _0x50ad5e=_0x2e5a[_0x1bf2a2];return _0x50ad5e;};'use strict';var Sequelize=require(_0xa2e5('0x0'));var moment=require(_0xa2e5('0x1'));module[_0xa2e5('0x2')]={'time':{'type':Sequelize[_0xa2e5('0x3')]},'callid':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa2e5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa2e5('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xa2e5('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index cd1dd3e..f0c9611 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 _0x53ae=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel'];(function(_0x2b9790,_0x4d37fc){var _0x1caf58=function(_0x151051){while(--_0x151051){_0x2b9790['push'](_0x2b9790['shift']());}};_0x1caf58(++_0x4d37fc);}(_0x53ae,0x161));var _0xe53a=function(_0x3bcc63,_0x484411){_0x3bcc63=_0x3bcc63-0x0;var _0x1313e1=_0x53ae[_0x3bcc63];return _0x1313e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe53a('0x0'));var zipdir=require(_0xe53a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe53a('0x2'));var moment=require(_0xe53a('0x3'));var BPromise=require(_0xe53a('0x4'));var Mustache=require(_0xe53a('0x5'));var util=require(_0xe53a('0x6'));var path=require('path');var sox=require(_0xe53a('0x7'));var csv=require(_0xe53a('0x8'));var ejs=require(_0xe53a('0x9'));var fs=require('fs');var fs_extra=require(_0xe53a('0xa'));var _=require('lodash');var squel=require(_0xe53a('0xb'));var crypto=require(_0xe53a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe53a('0xd'));var Papa=require(_0xe53a('0xe'));var Redis=require(_0xe53a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe53a('0x10'));var as=require(_0xe53a('0x11'));var hardwareService=require(_0xe53a('0x12'));var logger=require(_0xe53a('0x13'))(_0xe53a('0x14'));var utils=require(_0xe53a('0x15'));var config=require(_0xe53a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe53a('0x17'))['db'];function respondWithStatusCode(_0x326ecc,_0x1222c6){_0x1222c6=_0x1222c6||0xcc;return function(_0x221ec5){if(_0x221ec5){return _0x326ecc[_0xe53a('0x18')](_0x1222c6);}return _0x326ecc[_0xe53a('0x19')](_0x1222c6)[_0xe53a('0x1a')]();};}function respondWithResult(_0x586d0e,_0x491760){_0x491760=_0x491760||0xc8;return function(_0x47cabd){if(_0x47cabd){return _0x586d0e[_0xe53a('0x19')](_0x491760)[_0xe53a('0x1b')](_0x47cabd);}};}function respondWithFilteredResult(_0x5dd7c5,_0x142060){return function(_0x23dce9){if(_0x23dce9){var _0x17032f=typeof _0x142060[_0xe53a('0x1c')]===_0xe53a('0x1d')&&typeof _0x142060[_0xe53a('0x1e')]==='undefined';var _0x770e15=_0x23dce9['count'];var _0x3dc1a7=_0x17032f?0x0:_0x142060[_0xe53a('0x1c')];var _0x48886a=_0x17032f?_0x23dce9[_0xe53a('0x1f')]:_0x142060['offset']+_0x142060[_0xe53a('0x1e')];var _0x2a492e;if(_0x48886a>=_0x770e15){_0x48886a=_0x770e15;_0x2a492e=0xc8;}else{_0x2a492e=0xce;}_0x5dd7c5['status'](_0x2a492e);return _0x5dd7c5['set'](_0xe53a('0x20'),_0x3dc1a7+'-'+_0x48886a+'/'+_0x770e15)[_0xe53a('0x1b')](_0x23dce9);}return null;};}function patchUpdates(_0x3dadeb){return function(_0x291140){try{jsonpatch[_0xe53a('0x21')](_0x291140,_0x3dadeb,!![]);}catch(_0x5e1fa7){return BPromise[_0xe53a('0x22')](_0x5e1fa7);}return _0x291140[_0xe53a('0x23')]();};}function saveUpdates(_0x3f74c7,_0xeb4687){return function(_0x2d98f8){if(_0x2d98f8){return _0x2d98f8[_0xe53a('0x24')](_0x3f74c7)[_0xe53a('0x25')](function(_0x1d62a2){return _0x1d62a2;});}return null;};}function removeEntity(_0x4503e8,_0x563d74){return function(_0x10e787){if(_0x10e787){return _0x10e787[_0xe53a('0x26')]()[_0xe53a('0x25')](function(){_0x4503e8[_0xe53a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267902,_0xde3a68){return function(_0x11d5d9){if(!_0x11d5d9){_0x267902[_0xe53a('0x18')](0x194);}return _0x11d5d9;};}function handleError(_0x4a0bb8,_0x339483){_0x339483=_0x339483||0x1f4;return function(_0x2ff5c4){logger[_0xe53a('0x27')](_0x2ff5c4['stack']);if(_0x2ff5c4[_0xe53a('0x28')]){delete _0x2ff5c4[_0xe53a('0x28')];}_0x4a0bb8[_0xe53a('0x19')](_0x339483)[_0xe53a('0x29')](_0x2ff5c4);};}exports['index']=function(_0x2ff39b,_0x52b620){var _0xf18e45={},_0xb79af2={},_0x20a9cf={'count':0x0,'rows':[]};var _0xe66210=_[_0xe53a('0x2a')](db[_0xe53a('0x2b')][_0xe53a('0x2c')],function(_0x1316a0){return{'name':_0x1316a0[_0xe53a('0x2d')],'type':_0x1316a0[_0xe53a('0x2e')]['key']};});_0xb79af2[_0xe53a('0x2f')]=_[_0xe53a('0x2a')](_0xe66210,_0xe53a('0x28'));_0xb79af2['query']=_[_0xe53a('0x30')](_0x2ff39b[_0xe53a('0x31')]);_0xb79af2[_0xe53a('0x32')]=_[_0xe53a('0x33')](_0xb79af2[_0xe53a('0x2f')],_0xb79af2[_0xe53a('0x31')]);_0xf18e45[_0xe53a('0x34')]=_['intersection'](_0xb79af2[_0xe53a('0x2f')],qs['fields'](_0x2ff39b['query'][_0xe53a('0x35')]));_0xf18e45['attributes']=_0xf18e45[_0xe53a('0x34')][_0xe53a('0x36')]?_0xf18e45[_0xe53a('0x34')]:_0xb79af2[_0xe53a('0x2f')];if(!_0x2ff39b['query']['hasOwnProperty'](_0xe53a('0x37'))){_0xf18e45['limit']=qs[_0xe53a('0x1e')](_0x2ff39b[_0xe53a('0x31')]['limit']);_0xf18e45[_0xe53a('0x1c')]=qs['offset'](_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x1c')]);}_0xf18e45[_0xe53a('0x38')]=qs[_0xe53a('0x39')](_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x39')]);_0xf18e45[_0xe53a('0x3a')]=qs[_0xe53a('0x32')](_[_0xe53a('0x3b')](_0x2ff39b[_0xe53a('0x31')],_0xb79af2[_0xe53a('0x32')]),_0xe66210);if(_0x2ff39b['query'][_0xe53a('0x3c')]){_0xf18e45[_0xe53a('0x3a')]=_[_0xe53a('0x3d')](_0xf18e45[_0xe53a('0x3a')],{'$or':_[_0xe53a('0x2a')](_0xe66210,function(_0x170daa){if(_0x170daa[_0xe53a('0x2e')]!=='VIRTUAL'){var _0x564a61={};_0x564a61[_0x170daa[_0xe53a('0x28')]]={'$like':'%'+_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x3c')]+'%'};return _0x564a61;}})});}_0xf18e45=_[_0xe53a('0x3d')]({},_0xf18e45,_0x2ff39b[_0xe53a('0x3e')]);var _0x541e32={'where':_0xf18e45['where']};return db[_0xe53a('0x2b')][_0xe53a('0x1f')](_0x541e32)[_0xe53a('0x25')](function(_0x3be169){_0x20a9cf[_0xe53a('0x1f')]=_0x3be169;if(_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x3f')]){_0xf18e45[_0xe53a('0x40')]=[{'all':!![]}];}return db[_0xe53a('0x2b')][_0xe53a('0x41')](_0xf18e45);})['then'](function(_0x32e13b){_0x20a9cf[_0xe53a('0x42')]=_0x32e13b;return _0x20a9cf;})[_0xe53a('0x25')](respondWithFilteredResult(_0x52b620,_0xf18e45))[_0xe53a('0x43')](handleError(_0x52b620,null));};exports[_0xe53a('0x44')]=function(_0x3b85d8,_0x6c94ea){var _0x3fbcac={'raw':!![],'where':{'id':_0x3b85d8[_0xe53a('0x45')]['id']}},_0x9fa31b={};_0x9fa31b[_0xe53a('0x2f')]=_['keys'](db[_0xe53a('0x2b')][_0xe53a('0x2c')]);_0x9fa31b[_0xe53a('0x31')]=_[_0xe53a('0x30')](_0x3b85d8[_0xe53a('0x31')]);_0x9fa31b[_0xe53a('0x32')]=_[_0xe53a('0x33')](_0x9fa31b['model'],_0x9fa31b[_0xe53a('0x31')]);_0x3fbcac['attributes']=_[_0xe53a('0x33')](_0x9fa31b[_0xe53a('0x2f')],qs[_0xe53a('0x35')](_0x3b85d8[_0xe53a('0x31')][_0xe53a('0x35')]));_0x3fbcac[_0xe53a('0x34')]=_0x3fbcac[_0xe53a('0x34')][_0xe53a('0x36')]?_0x3fbcac['attributes']:_0x9fa31b[_0xe53a('0x2f')];if(_0x3b85d8['query']['includeAll']){_0x3fbcac[_0xe53a('0x40')]=[{'all':!![]}];}_0x3fbcac=_['merge']({},_0x3fbcac,_0x3b85d8[_0xe53a('0x3e')]);return db['VoiceQueuesLog']['find'](_0x3fbcac)[_0xe53a('0x25')](handleEntityNotFound(_0x6c94ea,null))[_0xe53a('0x25')](respondWithResult(_0x6c94ea,null))[_0xe53a('0x43')](handleError(_0x6c94ea,null));};exports[_0xe53a('0x46')]=function(_0x42b670,_0x2cc56f){return db[_0xe53a('0x2b')][_0xe53a('0x46')](_0x42b670[_0xe53a('0x47')],{})['then'](respondWithResult(_0x2cc56f,0xc9))[_0xe53a('0x43')](handleError(_0x2cc56f,null));};exports['update']=function(_0xefb3f7,_0x2d794c){if(_0xefb3f7[_0xe53a('0x47')]['id']){delete _0xefb3f7[_0xe53a('0x47')]['id'];}return db[_0xe53a('0x2b')][_0xe53a('0x48')]({'where':{'id':_0xefb3f7['params']['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x2d794c,null))[_0xe53a('0x25')](saveUpdates(_0xefb3f7[_0xe53a('0x47')],null))[_0xe53a('0x25')](respondWithResult(_0x2d794c,null))[_0xe53a('0x43')](handleError(_0x2d794c,null));};exports[_0xe53a('0x26')]=function(_0x2a59bb,_0x2f5630){return db[_0xe53a('0x2b')]['find']({'where':{'id':_0x2a59bb[_0xe53a('0x45')]['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x2f5630,null))[_0xe53a('0x25')](removeEntity(_0x2f5630,null))['catch'](handleError(_0x2f5630,null));}; \ No newline at end of file +var _0x8e65=['destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','rawAttributes','keys','includeAll','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','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','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','reject','update','then'];(function(_0x28fbb1,_0x57f1ef){var _0x40100d=function(_0x4f66c5){while(--_0x4f66c5){_0x28fbb1['push'](_0x28fbb1['shift']());}};_0x40100d(++_0x57f1ef);}(_0x8e65,0xb6));var _0x58e6=function(_0x30bba0,_0x2f9580){_0x30bba0=_0x30bba0-0x0;var _0x507c27=_0x8e65[_0x30bba0];return _0x507c27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58e6('0x0'));var zipdir=require(_0x58e6('0x1'));var jsonpatch=require(_0x58e6('0x2'));var rp=require(_0x58e6('0x3'));var moment=require(_0x58e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x58e6('0x5'));var util=require(_0x58e6('0x6'));var path=require(_0x58e6('0x7'));var sox=require(_0x58e6('0x8'));var csv=require(_0x58e6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58e6('0xa'));var _=require(_0x58e6('0xb'));var squel=require('squel');var crypto=require(_0x58e6('0xc'));var jsforce=require(_0x58e6('0xd'));var deskjs=require(_0x58e6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x58e6('0xf'));var Papa=require(_0x58e6('0x10'));var Redis=require(_0x58e6('0x11'));var authService=require(_0x58e6('0x12'));var qs=require(_0x58e6('0x13'));var as=require(_0x58e6('0x14'));var hardwareService=require(_0x58e6('0x15'));var logger=require(_0x58e6('0x16'))(_0x58e6('0x17'));var utils=require('../../config/utils');var config=require(_0x58e6('0x18'));var licenseUtil=require(_0x58e6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a71d,_0xd782d6){_0xd782d6=_0xd782d6||0xcc;return function(_0xf84b01){if(_0xf84b01){return _0x36a71d['sendStatus'](_0xd782d6);}return _0x36a71d[_0x58e6('0x1a')](_0xd782d6)[_0x58e6('0x1b')]();};}function respondWithResult(_0x3ee733,_0x1d07bd){_0x1d07bd=_0x1d07bd||0xc8;return function(_0x5e8e03){if(_0x5e8e03){return _0x3ee733[_0x58e6('0x1a')](_0x1d07bd)[_0x58e6('0x1c')](_0x5e8e03);}};}function respondWithFilteredResult(_0x107752,_0x3be10a){return function(_0x8e1bcf){if(_0x8e1bcf){var _0x486a21=typeof _0x3be10a[_0x58e6('0x1d')]===_0x58e6('0x1e')&&typeof _0x3be10a['limit']===_0x58e6('0x1e');var _0x101184=_0x8e1bcf[_0x58e6('0x1f')];var _0x76d1b8=_0x486a21?0x0:_0x3be10a[_0x58e6('0x1d')];var _0xd8fe78=_0x486a21?_0x8e1bcf[_0x58e6('0x1f')]:_0x3be10a[_0x58e6('0x1d')]+_0x3be10a[_0x58e6('0x20')];var _0x1184fe;if(_0xd8fe78>=_0x101184){_0xd8fe78=_0x101184;_0x1184fe=0xc8;}else{_0x1184fe=0xce;}_0x107752[_0x58e6('0x1a')](_0x1184fe);return _0x107752['set']('Content-Range',_0x76d1b8+'-'+_0xd8fe78+'/'+_0x101184)[_0x58e6('0x1c')](_0x8e1bcf);}return null;};}function patchUpdates(_0x51a517){return function(_0x11d8ac){try{jsonpatch[_0x58e6('0x21')](_0x11d8ac,_0x51a517,!![]);}catch(_0x668b03){return BPromise[_0x58e6('0x22')](_0x668b03);}return _0x11d8ac['save']();};}function saveUpdates(_0x478823,_0x2d833b){return function(_0x1f24d8){if(_0x1f24d8){return _0x1f24d8[_0x58e6('0x23')](_0x478823)[_0x58e6('0x24')](function(_0x1dc47e){return _0x1dc47e;});}return null;};}function removeEntity(_0x225464,_0xb92126){return function(_0x2b083e){if(_0x2b083e){return _0x2b083e[_0x58e6('0x25')]()['then'](function(){_0x225464['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x490dc3,_0x31d3f4){return function(_0x510ffe){if(!_0x510ffe){_0x490dc3[_0x58e6('0x26')](0x194);}return _0x510ffe;};}function handleError(_0x49b2aa,_0x347670){_0x347670=_0x347670||0x1f4;return function(_0x17d826){logger[_0x58e6('0x27')](_0x17d826[_0x58e6('0x28')]);if(_0x17d826[_0x58e6('0x29')]){delete _0x17d826[_0x58e6('0x29')];}_0x49b2aa[_0x58e6('0x1a')](_0x347670)[_0x58e6('0x2a')](_0x17d826);};}exports[_0x58e6('0x2b')]=function(_0x33ed68,_0x4561b1){var _0x18edb4={},_0x297f7b={},_0x2d563d={'count':0x0,'rows':[]};var _0xd37849=_[_0x58e6('0x2c')](db[_0x58e6('0x2d')]['rawAttributes'],function(_0x5621c4){return{'name':_0x5621c4['fieldName'],'type':_0x5621c4['type']['key']};});_0x297f7b[_0x58e6('0x2e')]=_['map'](_0xd37849,'name');_0x297f7b[_0x58e6('0x2f')]=_['keys'](_0x33ed68[_0x58e6('0x2f')]);_0x297f7b[_0x58e6('0x30')]=_[_0x58e6('0x31')](_0x297f7b[_0x58e6('0x2e')],_0x297f7b[_0x58e6('0x2f')]);_0x18edb4[_0x58e6('0x32')]=_[_0x58e6('0x31')](_0x297f7b[_0x58e6('0x2e')],qs['fields'](_0x33ed68[_0x58e6('0x2f')][_0x58e6('0x33')]));_0x18edb4[_0x58e6('0x32')]=_0x18edb4[_0x58e6('0x32')][_0x58e6('0x34')]?_0x18edb4[_0x58e6('0x32')]:_0x297f7b[_0x58e6('0x2e')];if(!_0x33ed68['query'][_0x58e6('0x35')]('nolimit')){_0x18edb4[_0x58e6('0x20')]=qs[_0x58e6('0x20')](_0x33ed68[_0x58e6('0x2f')]['limit']);_0x18edb4[_0x58e6('0x1d')]=qs[_0x58e6('0x1d')](_0x33ed68['query'][_0x58e6('0x1d')]);}_0x18edb4['order']=qs[_0x58e6('0x36')](_0x33ed68[_0x58e6('0x2f')][_0x58e6('0x36')]);_0x18edb4[_0x58e6('0x37')]=qs[_0x58e6('0x30')](_[_0x58e6('0x38')](_0x33ed68['query'],_0x297f7b[_0x58e6('0x30')]),_0xd37849);if(_0x33ed68[_0x58e6('0x2f')][_0x58e6('0x39')]){_0x18edb4[_0x58e6('0x37')]=_[_0x58e6('0x3a')](_0x18edb4['where'],{'$or':_[_0x58e6('0x2c')](_0xd37849,function(_0xc5bf84){if(_0xc5bf84[_0x58e6('0x3b')]!==_0x58e6('0x3c')){var _0x127ce7={};_0x127ce7[_0xc5bf84['name']]={'$like':'%'+_0x33ed68[_0x58e6('0x2f')][_0x58e6('0x39')]+'%'};return _0x127ce7;}})});}_0x18edb4=_[_0x58e6('0x3a')]({},_0x18edb4,_0x33ed68[_0x58e6('0x3d')]);var _0x367fd7={'where':_0x18edb4['where']};return db['VoiceQueuesLog'][_0x58e6('0x1f')](_0x367fd7)[_0x58e6('0x24')](function(_0x17b106){_0x2d563d[_0x58e6('0x1f')]=_0x17b106;if(_0x33ed68[_0x58e6('0x2f')]['includeAll']){_0x18edb4['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x58e6('0x3e')](_0x18edb4);})['then'](function(_0x22ab72){_0x2d563d['rows']=_0x22ab72;return _0x2d563d;})[_0x58e6('0x24')](respondWithFilteredResult(_0x4561b1,_0x18edb4))[_0x58e6('0x3f')](handleError(_0x4561b1,null));};exports[_0x58e6('0x40')]=function(_0x14f234,_0xcc2347){var _0x110bea={'raw':!![],'where':{'id':_0x14f234[_0x58e6('0x41')]['id']}},_0x5733cb={};_0x5733cb[_0x58e6('0x2e')]=_['keys'](db['VoiceQueuesLog'][_0x58e6('0x42')]);_0x5733cb[_0x58e6('0x2f')]=_[_0x58e6('0x43')](_0x14f234[_0x58e6('0x2f')]);_0x5733cb[_0x58e6('0x30')]=_['intersection'](_0x5733cb[_0x58e6('0x2e')],_0x5733cb[_0x58e6('0x2f')]);_0x110bea['attributes']=_[_0x58e6('0x31')](_0x5733cb['model'],qs['fields'](_0x14f234[_0x58e6('0x2f')][_0x58e6('0x33')]));_0x110bea[_0x58e6('0x32')]=_0x110bea[_0x58e6('0x32')]['length']?_0x110bea[_0x58e6('0x32')]:_0x5733cb[_0x58e6('0x2e')];if(_0x14f234[_0x58e6('0x2f')][_0x58e6('0x44')]){_0x110bea[_0x58e6('0x45')]=[{'all':!![]}];}_0x110bea=_[_0x58e6('0x3a')]({},_0x110bea,_0x14f234[_0x58e6('0x3d')]);return db[_0x58e6('0x2d')][_0x58e6('0x46')](_0x110bea)[_0x58e6('0x24')](handleEntityNotFound(_0xcc2347,null))[_0x58e6('0x24')](respondWithResult(_0xcc2347,null))[_0x58e6('0x3f')](handleError(_0xcc2347,null));};exports[_0x58e6('0x47')]=function(_0x57c9f6,_0x9b6fad){return db['VoiceQueuesLog'][_0x58e6('0x47')](_0x57c9f6[_0x58e6('0x48')],{})['then'](respondWithResult(_0x9b6fad,0xc9))[_0x58e6('0x3f')](handleError(_0x9b6fad,null));};exports['update']=function(_0x3f3d7d,_0x2089b2){if(_0x3f3d7d[_0x58e6('0x48')]['id']){delete _0x3f3d7d[_0x58e6('0x48')]['id'];}return db[_0x58e6('0x2d')][_0x58e6('0x46')]({'where':{'id':_0x3f3d7d[_0x58e6('0x41')]['id']}})[_0x58e6('0x24')](handleEntityNotFound(_0x2089b2,null))[_0x58e6('0x24')](saveUpdates(_0x3f3d7d[_0x58e6('0x48')],null))[_0x58e6('0x24')](respondWithResult(_0x2089b2,null))[_0x58e6('0x3f')](handleError(_0x2089b2,null));};exports['destroy']=function(_0x74bc89,_0x54ea5b){return db[_0x58e6('0x2d')][_0x58e6('0x46')]({'where':{'id':_0x74bc89[_0x58e6('0x41')]['id']}})[_0x58e6('0x24')](handleEntityNotFound(_0x54ea5b,null))[_0x58e6('0x24')](removeEntity(_0x54ea5b,null))['catch'](handleError(_0x54ea5b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 2fe8316..6d8a3e1 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 _0xfb93=['voice_queues_log','event','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x2c8afe,_0x100f80){var _0x982977=function(_0x5b3a44){while(--_0x5b3a44){_0x2c8afe['push'](_0x2c8afe['shift']());}};_0x982977(++_0x100f80);}(_0xfb93,0x115));var _0x3fb9=function(_0x1a21d0,_0x4ba87c){_0x1a21d0=_0x1a21d0-0x0;var _0x5a3938=_0xfb93[_0x1a21d0];return _0x5a3938;};'use strict';var _=require(_0x3fb9('0x0'));var util=require('util');var logger=require(_0x3fb9('0x1'))(_0x3fb9('0x2'));var moment=require('moment');var BPromise=require(_0x3fb9('0x3'));var rp=require(_0x3fb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fb9('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x3fb9('0x6')]=function(_0x27f92b,_0x173476){return _0x27f92b[_0x3fb9('0x7')](_0x3fb9('0x8'),attributes,{'tableName':_0x3fb9('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x3fb9('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xb95d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger'];(function(_0x4e4413,_0x37a767){var _0x433746=function(_0x1b61e1){while(--_0x1b61e1){_0x4e4413['push'](_0x4e4413['shift']());}};_0x433746(++_0x37a767);}(_0xb95d,0x1c5));var _0xdb95=function(_0x5c2cc6,_0x6a7e4a){_0x5c2cc6=_0x5c2cc6-0x0;var _0x575df7=_0xb95d[_0x5c2cc6];return _0x575df7;};'use strict';var _=require(_0xdb95('0x0'));var util=require('util');var logger=require(_0xdb95('0x1'))(_0xdb95('0x2'));var moment=require(_0xdb95('0x3'));var BPromise=require(_0xdb95('0x4'));var rp=require(_0xdb95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb95('0x6'));var config=require(_0xdb95('0x7'));var attributes=require(_0xdb95('0x8'));module['exports']=function(_0x23f12a,_0x58553c){return _0x23f12a['define']('VoiceQueuesLog',attributes,{'tableName':_0xdb95('0x9'),'paranoid':![],'indexes':[{'name':_0xdb95('0xa'),'fields':[_0xdb95('0xb'),_0xdb95('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 763ab28..602eeef 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 _0x8979=['http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1fc601,_0x191b32){var _0x13990e=function(_0x6a78d5){while(--_0x6a78d5){_0x1fc601['push'](_0x1fc601['shift']());}};_0x13990e(++_0x191b32);}(_0x8979,0x16e));var _0x9897=function(_0x304967,_0x307b50){_0x304967=_0x304967-0x0;var _0x122383=_0x8979[_0x304967];return _0x122383;};'use strict';var _=require(_0x9897('0x0'));var util=require(_0x9897('0x1'));var moment=require(_0x9897('0x2'));var BPromise=require('bluebird');var rs=require(_0x9897('0x3'));var fs=require('fs');var Redis=require(_0x9897('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9897('0x5'))('rpc');var config=require(_0x9897('0x6'));var jayson=require(_0x9897('0x7'));var client=jayson['client'][_0x9897('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22b116,_0x59c3bf,_0x379277){return new BPromise(function(_0x37813e,_0x436798){return client[_0x9897('0x9')](_0x22b116,_0x379277)[_0x9897('0xa')](function(_0x33efe3){logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));logger[_0x9897('0xe')](_0x9897('0xf'),_0x59c3bf,_0x9897('0xd'),JSON[_0x9897('0x10')](_0x33efe3));if(_0x33efe3[_0x9897('0x11')]){if(_0x33efe3['error'][_0x9897('0x12')]===0x1f4){logger[_0x9897('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59c3bf,_0x33efe3['error'][_0x9897('0x13')]);return _0x436798(_0x33efe3[_0x9897('0x11')][_0x9897('0x13')]);}logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x33efe3[_0x9897('0x11')]['message']);return _0x37813e(_0x33efe3[_0x9897('0x11')]['message']);}else{logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));_0x37813e(_0x33efe3[_0x9897('0x14')][_0x9897('0x13')]);}})[_0x9897('0x15')](function(_0x304a42){logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x304a42);_0x436798(_0x304a42);});});} \ No newline at end of file +var _0x688a=['stringify','error','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3a341c,_0x2c7b89){var _0x4eb8bd=function(_0x213a8b){while(--_0x213a8b){_0x3a341c['push'](_0x3a341c['shift']());}};_0x4eb8bd(++_0x2c7b89);}(_0x688a,0x124));var _0xa688=function(_0x2f5eb8,_0xe955f7){_0x2f5eb8=_0x2f5eb8-0x0;var _0x5efef4=_0x688a[_0x2f5eb8];return _0x5efef4;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1a8d3f4..4489c07 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 _0x5f23=['put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','show','/:id/download','downloads','downloadTranscribe','post','create','/:id/transcribe'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x5f23,0x10a));var _0x35f2=function(_0x11d5cf,_0x1b32b0){_0x11d5cf=_0x11d5cf-0x0;var _0x157138=_0x5f23[_0x11d5cf];return _0x157138;};'use strict';var multer=require(_0x35f2('0x0'));var util=require(_0x35f2('0x1'));var path=require(_0x35f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x35f2('0x3')]();var fs_extra=require(_0x35f2('0x4'));var auth=require(_0x35f2('0x5'));var interaction=require(_0x35f2('0x6'));var config=require(_0x35f2('0x7'));var controller=require(_0x35f2('0x8'));router[_0x35f2('0x9')]('/',auth['isAuthenticated'](),controller[_0x35f2('0xa')]);router[_0x35f2('0x9')]('/describe',auth[_0x35f2('0xb')](),controller[_0x35f2('0xc')]);router[_0x35f2('0x9')]('/:id',auth[_0x35f2('0xb')](),controller[_0x35f2('0xd')]);router['get'](_0x35f2('0xe'),auth[_0x35f2('0xb')](),controller['download']);router['get']('/:id/downloads',controller[_0x35f2('0xf')]);router[_0x35f2('0x9')]('/:id/transcribe',auth[_0x35f2('0xb')](),controller[_0x35f2('0x10')]);router[_0x35f2('0x11')]('/',auth[_0x35f2('0xb')](),controller[_0x35f2('0x12')]);router[_0x35f2('0x11')](_0x35f2('0x13'),auth[_0x35f2('0xb')](),controller['runTranscribe']);router[_0x35f2('0x14')](_0x35f2('0x15'),auth['isAuthenticated'](),controller[_0x35f2('0x16')]);router[_0x35f2('0x17')](_0x35f2('0x15'),auth['isAuthenticated'](),controller[_0x35f2('0x18')]);module[_0x35f2('0x19')]=router; \ No newline at end of file +var _0x6bb8=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','destroy','exports'];(function(_0x19a501,_0x263b5e){var _0xc3a3d3=function(_0x11872b){while(--_0x11872b){_0x19a501['push'](_0x19a501['shift']());}};_0xc3a3d3(++_0x263b5e);}(_0x6bb8,0x64));var _0x86bb=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x6bb8[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x86bb('0x0'));var util=require(_0x86bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x86bb('0x2'));var router=express[_0x86bb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86bb('0x4'));var interaction=require(_0x86bb('0x5'));var config=require(_0x86bb('0x6'));var controller=require('./voiceRecording.controller');router[_0x86bb('0x7')]('/',auth[_0x86bb('0x8')](),controller['index']);router[_0x86bb('0x7')](_0x86bb('0x9'),auth[_0x86bb('0x8')](),controller[_0x86bb('0xa')]);router[_0x86bb('0x7')](_0x86bb('0xb'),auth['isAuthenticated'](),controller[_0x86bb('0xc')]);router[_0x86bb('0x7')](_0x86bb('0xd'),auth[_0x86bb('0x8')](),controller[_0x86bb('0xe')]);router['get'](_0x86bb('0xf'),controller[_0x86bb('0x10')]);router[_0x86bb('0x7')](_0x86bb('0x11'),auth[_0x86bb('0x8')](),controller[_0x86bb('0x12')]);router[_0x86bb('0x13')]('/',auth[_0x86bb('0x8')](),controller[_0x86bb('0x14')]);router[_0x86bb('0x13')]('/:id/transcribe',auth[_0x86bb('0x8')](),controller['runTranscribe']);router[_0x86bb('0x15')](_0x86bb('0xb'),auth[_0x86bb('0x8')](),controller[_0x86bb('0x16')]);router['delete']('/:id',auth[_0x86bb('0x8')](),controller[_0x86bb('0x17')]);module[_0x86bb('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8ab3c59..e8f401f 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var 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 0086331..2fad5f4 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 _0x54d5=['token','$and','push','secrets','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','VoiceRecording','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x54d5,0x16a));var _0x554d=function(_0x2ea6f4,_0x3bd3ea){_0x2ea6f4=_0x2ea6f4-0x0;var _0xdd158a=_0x54d5[_0x2ea6f4];return _0xdd158a;};'use strict';var emlformat=require(_0x554d('0x0'));var rimraf=require(_0x554d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x554d('0x2'));var rp=require(_0x554d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x554d('0x4'));var util=require('util');var path=require(_0x554d('0x5'));var sox=require(_0x554d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x554d('0x7'));var squel=require(_0x554d('0x8'));var crypto=require(_0x554d('0x9'));var jsforce=require(_0x554d('0xa'));var deskjs=require(_0x554d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x554d('0xc'));var Papa=require(_0x554d('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x554d('0xe'));var Redis=require(_0x554d('0xf'));var authService=require(_0x554d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x554d('0x11'));var hardwareService=require(_0x554d('0x12'));var logger=require('../../config/logger')(_0x554d('0x13'));var utils=require(_0x554d('0x14'));var config=require(_0x554d('0x15'));var licenseUtil=require(_0x554d('0x16'));var db=require(_0x554d('0x17'))['db'];function respondWithStatusCode(_0x503b67,_0x4fe60e){_0x4fe60e=_0x4fe60e||0xcc;return function(_0x13de32){if(_0x13de32){return _0x503b67[_0x554d('0x18')](_0x4fe60e);}return _0x503b67[_0x554d('0x19')](_0x4fe60e)['end']();};}function respondWithResult(_0xe51295,_0x496582){_0x496582=_0x496582||0xc8;return function(_0x10cebc){if(_0x10cebc){return _0xe51295[_0x554d('0x19')](_0x496582)['json'](_0x10cebc);}};}function respondWithFilteredResult(_0x2cd17b,_0x3be09c){return function(_0x578957){if(_0x578957){var _0x307018=typeof _0x3be09c['offset']==='undefined'&&typeof _0x3be09c[_0x554d('0x1a')]==='undefined';var _0x138109=_0x578957[_0x554d('0x1b')];var _0x5494bc=_0x307018?0x0:_0x3be09c['offset'];var _0x1cb127=_0x307018?_0x578957[_0x554d('0x1b')]:_0x3be09c[_0x554d('0x1c')]+_0x3be09c[_0x554d('0x1a')];var _0x1c81ab;if(_0x1cb127>=_0x138109){_0x1cb127=_0x138109;_0x1c81ab=0xc8;}else{_0x1c81ab=0xce;}_0x2cd17b[_0x554d('0x19')](_0x1c81ab);return _0x2cd17b[_0x554d('0x1d')](_0x554d('0x1e'),_0x5494bc+'-'+_0x1cb127+'/'+_0x138109)['json'](_0x578957);}return null;};}function patchUpdates(_0x51a84c){return function(_0x13004c){try{jsonpatch[_0x554d('0x1f')](_0x13004c,_0x51a84c,!![]);}catch(_0x5ec1a6){return BPromise[_0x554d('0x20')](_0x5ec1a6);}return _0x13004c[_0x554d('0x21')]();};}function saveUpdates(_0xa06c99,_0x1e7655){return function(_0x3d2502){if(_0x3d2502){return _0x3d2502[_0x554d('0x22')](_0xa06c99)[_0x554d('0x23')](function(_0x2d0063){return _0x2d0063;});}return null;};}function removeEntity(_0x4ffdd,_0x41a8ba){return function(_0x28bcdb){if(_0x28bcdb){return _0x28bcdb[_0x554d('0x24')]()[_0x554d('0x23')](function(){_0x4ffdd['status'](0xcc)[_0x554d('0x25')]();});}};}function handleEntityNotFound(_0x574a6e,_0x58b58c){return function(_0x20582a){if(!_0x20582a){_0x574a6e[_0x554d('0x18')](0x194);}return _0x20582a;};}function handleError(_0x1d1380,_0x4dc3cf){_0x4dc3cf=_0x4dc3cf||0x1f4;return function(_0x1d613c){logger[_0x554d('0x26')](_0x1d613c['stack']);if(_0x1d613c[_0x554d('0x27')]){delete _0x1d613c[_0x554d('0x27')];}_0x1d1380['status'](_0x4dc3cf)[_0x554d('0x28')](_0x1d613c);};}exports['index']=function(_0x120162,_0x3a2f2f){var _0xec8dac={},_0x374a43={},_0x67977e={'count':0x0,'rows':[]};var _0x4ce775=_[_0x554d('0x29')](db[_0x554d('0x2a')][_0x554d('0x2b')],function(_0x1c97ef){return{'name':_0x1c97ef[_0x554d('0x2c')],'type':_0x1c97ef[_0x554d('0x2d')]['key']};});_0x374a43['model']=_['differenceBy'](_[_0x554d('0x29')](_0x4ce775,'name'),['format']);_0x374a43[_0x554d('0x2e')]=_['keys'](_0x120162[_0x554d('0x2e')]);_0x374a43[_0x554d('0x2f')]=_['intersection'](_0x374a43[_0x554d('0x30')],_0x374a43['query']);_0xec8dac[_0x554d('0x31')]=_[_0x554d('0x32')](_0x374a43['model'],qs['fields'](_0x120162[_0x554d('0x2e')][_0x554d('0x33')]));_0xec8dac[_0x554d('0x31')]=_0xec8dac['attributes'][_0x554d('0x34')]?_0xec8dac[_0x554d('0x31')]:_0x374a43[_0x554d('0x30')];if(!_0x120162[_0x554d('0x2e')][_0x554d('0x35')](_0x554d('0x36'))){_0xec8dac[_0x554d('0x1a')]=qs[_0x554d('0x1a')](_0x120162['query'][_0x554d('0x1a')]);_0xec8dac['offset']=qs[_0x554d('0x1c')](_0x120162[_0x554d('0x2e')][_0x554d('0x1c')]);}_0xec8dac[_0x554d('0x37')]=qs[_0x554d('0x38')](_0x120162[_0x554d('0x2e')][_0x554d('0x38')]);_0xec8dac[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x120162[_0x554d('0x2e')],_0x374a43[_0x554d('0x2f')]),_0x4ce775);if(_0x120162['query'][_0x554d('0x3b')]){_0xec8dac[_0x554d('0x39')]=_[_0x554d('0x3c')](_0xec8dac[_0x554d('0x39')],{'$or':_[_0x554d('0x29')](_0x4ce775,function(_0x5f09c9){if(_0x5f09c9[_0x554d('0x2d')]!==_0x554d('0x3d')){var _0x3fa0fd={};_0x3fa0fd[_0x5f09c9[_0x554d('0x27')]]={'$like':'%'+_0x120162[_0x554d('0x2e')][_0x554d('0x3b')]+'%'};return _0x3fa0fd;}})});}_0xec8dac=_[_0x554d('0x3c')]({},_0xec8dac,_0x120162['options']);var _0x301ea5={'where':_0xec8dac[_0x554d('0x39')]};return db[_0x554d('0x2a')][_0x554d('0x1b')](_0x301ea5)[_0x554d('0x23')](function(_0x3936f0){_0x67977e[_0x554d('0x1b')]=_0x3936f0;if(_0x120162[_0x554d('0x2e')][_0x554d('0x3e')]){_0xec8dac[_0x554d('0x3f')]=[{'all':!![]}];}return db[_0x554d('0x2a')][_0x554d('0x40')](_0xec8dac);})[_0x554d('0x23')](function(_0x1626b7){_0x67977e[_0x554d('0x41')]=_0x1626b7;return _0x67977e;})[_0x554d('0x23')](respondWithFilteredResult(_0x3a2f2f,_0xec8dac))['catch'](handleError(_0x3a2f2f,null));};exports[_0x554d('0x42')]=function(_0x3c9231,_0x3a9734){var _0x3e83c0={'raw':![],'where':{'id':_0x3c9231[_0x554d('0x43')]['id']}},_0x5bcc16={};_0x5bcc16[_0x554d('0x30')]=_[_0x554d('0x44')](db[_0x554d('0x2a')]['rawAttributes']);_0x5bcc16[_0x554d('0x2e')]=_['keys'](_0x3c9231[_0x554d('0x2e')]);_0x5bcc16[_0x554d('0x2f')]=_[_0x554d('0x32')](_0x5bcc16[_0x554d('0x30')],_0x5bcc16[_0x554d('0x2e')]);_0x3e83c0[_0x554d('0x31')]=_[_0x554d('0x32')](_0x5bcc16[_0x554d('0x30')],qs[_0x554d('0x33')](_0x3c9231['query'][_0x554d('0x33')]));_0x3e83c0[_0x554d('0x31')]=_0x3e83c0[_0x554d('0x31')]['length']?_0x3e83c0[_0x554d('0x31')]:_0x5bcc16[_0x554d('0x30')];if(_0x3c9231['query'][_0x554d('0x3e')]){_0x3e83c0[_0x554d('0x3f')]=[{'all':!![]}];}_0x3e83c0=_[_0x554d('0x3c')]({},_0x3e83c0,_0x3c9231[_0x554d('0x45')]);return db[_0x554d('0x2a')]['find'](_0x3e83c0)['then'](handleEntityNotFound(_0x3a9734,null))[_0x554d('0x23')](respondWithResult(_0x3a9734,null))[_0x554d('0x46')](handleError(_0x3a9734,null));};exports['create']=function(_0x5da5d0,_0x5790fd){return db[_0x554d('0x2a')][_0x554d('0x47')](_0x5da5d0[_0x554d('0x48')],{})[_0x554d('0x23')](respondWithResult(_0x5790fd,0xc9))[_0x554d('0x46')](handleError(_0x5790fd,null));};exports[_0x554d('0x22')]=function(_0x2dda71,_0x21cad2){if(_0x2dda71[_0x554d('0x48')]['id']){delete _0x2dda71[_0x554d('0x48')]['id'];}return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':{'id':_0x2dda71[_0x554d('0x43')]['id']}})[_0x554d('0x23')](handleEntityNotFound(_0x21cad2,null))[_0x554d('0x23')](saveUpdates(_0x2dda71['body'],null))[_0x554d('0x23')](respondWithResult(_0x21cad2,null))['catch'](handleError(_0x21cad2,null));};exports['describe']=function(_0x16d7c6,_0x79e0f6){return db[_0x554d('0x2a')][_0x554d('0x4a')]()['then'](respondWithResult(_0x79e0f6,null))[_0x554d('0x46')](handleError(_0x79e0f6,null));};exports[_0x554d('0x4b')]=function(_0x515987,_0x45317a,_0x2276b6){var _0x5eaed5=require('../../components/encryptor');var _0x5903fb=![];var _0x5911a0={};if(_0x515987['query'][_0x554d('0x2d')]&&_0x515987['query']['type']==='uniqueid'){_0x5911a0[_0x554d('0x4c')]=_0x515987[_0x554d('0x43')]['id'];}else{_0x5911a0['id']=_0x515987[_0x554d('0x43')]['id'];}return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':_0x5911a0,'attributes':['id',_0x554d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x45317a,null))[_0x554d('0x23')](function(_0x444844){if(_0x444844){var _0x4671ad=_0x444844[_0x554d('0x4d')];var _0xcc0a3b=util[_0x554d('0x4e')](_0x554d('0x4f'),_0x4671ad);if(fs[_0x554d('0x50')](_0xcc0a3b)){_0x5903fb=!![];return _0x5eaed5[_0x554d('0x51')](_0xcc0a3b,_0x4671ad,config['secrets'][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0x444844;});}return _0x444844;}})[_0x554d('0x23')](function(_0x2535c2){if(_0x2535c2){var _0x8e860e=_0x2535c2['value'];if(!fs[_0x554d('0x50')](_0x8e860e)){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x2535c2[_0x554d('0x55')]){return _0x45317a['download'](_0x8e860e,_0x2535c2[_0x554d('0x55')]+path[_0x554d('0x56')](_0x8e860e),function(){if(_0x5903fb){fs['unlink'](_0x8e860e);}});}else{return _0x45317a['download'](_0x8e860e,function(_0xe5bd6e){if(_0x5903fb){fs[_0x554d('0x57')](_0x8e860e);}});}}})[_0x554d('0x46')](function(_0xaa62cb){if(_0xaa62cb['message']===_0x554d('0x58')){_0x45317a[_0x554d('0x19')](0x194)[_0x554d('0x28')](_0x554d('0x59'));}else{return handleError(_0x45317a,null);}});};exports[_0x554d('0x5a')]=function(_0x10ece3,_0x3a18fd,_0x3615cc){var _0x4c3fed=require(_0x554d('0x5b'));var _0x4bbc02=![];var _0x297e6b={'$and':[db[_0x554d('0x5c')][_0x554d('0x39')](db['sequelize']['fn'](_0x554d('0x5d'),db['sequelize']['col'](_0x554d('0x4c'))),_0x10ece3[_0x554d('0x2e')][_0x554d('0x5e')])]};if(_0x10ece3['query']['type']&&_0x10ece3[_0x554d('0x2e')][_0x554d('0x2d')]==='uniqueid'){_0x297e6b['$and']['push']({'uniqueid':_0x10ece3['params']['id']});}else{_0x297e6b[_0x554d('0x5f')][_0x554d('0x60')]({'id':_0x10ece3['params']['id']});}return db[_0x554d('0x2a')]['find']({'where':_0x297e6b,'attributes':['id',_0x554d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x3a18fd,null))[_0x554d('0x23')](function(_0x32ccba){if(_0x32ccba){var _0x1303fa=util[_0x554d('0x4e')]('%s.cypher',_0x32ccba[_0x554d('0x4d')]);if(fs[_0x554d('0x50')](_0x1303fa)){_0x4bbc02=!![];return _0x4c3fed[_0x554d('0x51')](_0x1303fa,_0x32ccba[_0x554d('0x4d')],config[_0x554d('0x61')][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0x32ccba;});}return _0x32ccba;}})[_0x554d('0x23')](function(_0x447305){if(_0x447305){if(!fs[_0x554d('0x50')](_0x447305[_0x554d('0x4d')])){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x58'));}if(_0x447305[_0x554d('0x55')]){return _0x3a18fd[_0x554d('0x4b')](_0x447305['value'],_0x447305['filename']+path[_0x554d('0x56')](_0x447305[_0x554d('0x4d')]),function(){if(_0x4bbc02){fs[_0x554d('0x57')](_0x447305[_0x554d('0x4d')]);}});}else{return _0x3a18fd[_0x554d('0x4b')](_0x447305[_0x554d('0x4d')],function(_0x373dad){if(_0x4bbc02){fs[_0x554d('0x57')](_0x447305[_0x554d('0x4d')]);}});}}})[_0x554d('0x46')](handleError(_0x3a18fd,null));};exports[_0x554d('0x24')]=function(_0x365f9b,_0x182349){return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':{'id':_0x365f9b[_0x554d('0x43')]['id']}})[_0x554d('0x23')](function(_0x98a6bd){if(_[_0x554d('0x62')](_0x98a6bd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x98a6bd;})['then'](function(_0x102495){var _0x10e999=_0x102495[_0x554d('0x4d')];logger[_0x554d('0x63')](_0x554d('0x64'),_0x10e999);if(!_[_0x554d('0x62')](_0x102495[_0x554d('0x4d')])&&fs[_0x554d('0x50')](_0x10e999)){logger[_0x554d('0x63')](_0x554d('0x65')+_0x10e999+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x554d('0x66')](_0x10e999);}_0x10e999=_0x10e999+_0x554d('0x67');if(!_['isNil'](_0x102495[_0x554d('0x4d')])&&fs[_0x554d('0x50')](_0x10e999)){logger[_0x554d('0x63')](_0x554d('0x65')+_0x10e999+_0x554d('0x68'));fs['unlinkSync'](_0x10e999);}return _0x102495;})[_0x554d('0x23')](function(_0x38cab4){if(!_0x38cab4)throw new InternalError();return _0x38cab4[_0x554d('0x24')]();})[_0x554d('0x23')](function(){_0x182349['status'](0xcc)[_0x554d('0x25')]();})[_0x554d('0x46')](handleError(_0x182349,null));};function getBucketslist(_0x36061a,_0x336aec,_0x41ee71){return new Promise(function(_0x5e4f39,_0x3f7699){var _0x4a22a0=new AWS['S3']({'accessKeyId':_0x336aec,'secretAccessKey':_0x36061a,'region':_0x41ee71});_0x4a22a0[_0x554d('0x69')]({},function(_0x68dd11,_0x1fc951){if(_0x68dd11){return _0x3f7699(_0x68dd11);}else{return _0x5e4f39(_0x1fc951);}});});}function createBucket(_0x4739dc,_0x4f37a2,_0x4dd98c,_0x98daf4){return new Promise(function(_0x5a1cf7,_0x17f0d4){var _0x320866=new AWS['S3']({'accessKeyId':_0x4f37a2,'secretAccessKey':_0x4739dc,'region':_0x4dd98c});_0x320866[_0x554d('0x6a')]({'Bucket':_0x98daf4},function(_0x3143df,_0x2ba535){if(_0x3143df){return _0x17f0d4(_0x3143df);}else{return _0x5a1cf7(_0x2ba535);}});});}function uploadFile(_0x1b5cd7,_0x5c0431,_0x4e99d9,_0x4aa525,_0x347f6b,_0x40e704){return new Promise(function(_0x4ebad4,_0x5004ae){var _0x3a5702=new AWS['S3']({'accessKeyId':_0x5c0431,'secretAccessKey':_0x1b5cd7,'region':_0x4e99d9});_0x3a5702[_0x554d('0x6b')]({'Bucket':_0x4aa525,'Key':_0x347f6b,'Body':_0x40e704},function(_0x5a4ba9,_0x376625){if(_0x5a4ba9){return _0x5004ae(_0x5a4ba9);}else{return _0x4ebad4(_0x376625);}});});}function startTranscribe(_0x415aa1,_0x373ad3,_0x509cfd,_0x10bb11,_0x4c696,_0x30c2f1){return new Promise(function(_0x5627fe,_0x1f8d06){var _0x37cfc8=new AWS[(_0x554d('0x6c'))]({'accessKeyId':_0x373ad3,'secretAccessKey':_0x415aa1,'region':_0x509cfd});_0x37cfc8[_0x554d('0x6d')]({'TranscriptionJobName':_0x10bb11,'LanguageCode':_0x4c696,'Media':{'MediaFileUri':_0x30c2f1}},function(_0x100762,_0x14491c){if(_0x100762){return _0x1f8d06(_0x100762);}else{return _0x5627fe(_0x14491c);}});});}function transcribe(_0x38640c,_0x32f328,_0x5bdbaa,_0x511202,_0x2def22,_0x46f546,_0x41cbd5){return new Promise(function(_0x163eff,_0x171cf8){var _0x5d852a={};logger[_0x554d('0x63')](util[_0x554d('0x4e')](_0x554d('0x6e'),_0x38640c,_0x2def22));return uploadFile(_0x32f328,_0x5bdbaa,_0x511202,_0x2def22,path[_0x554d('0x6f')](_0x46f546),fs[_0x554d('0x70')](_0x46f546))[_0x554d('0x23')](function(_0x83abf){logger[_0x554d('0x63')](util['format'](_0x554d('0x71'),_0x38640c,_0x2def22,_0x83abf[_0x554d('0x72')]));_0x5d852a[_0x554d('0x73')]=_0x83abf[_0x554d('0x74')];_0x5d852a[_0x554d('0x75')]=_0x83abf[_0x554d('0x72')];logger['info'](util[_0x554d('0x4e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x38640c));return startTranscribe(_0x32f328,_0x5bdbaa,_0x511202,uuidv4(),_0x41cbd5,_0x83abf['Location']);})[_0x554d('0x23')](function(_0x36da95){logger[_0x554d('0x63')](util[_0x554d('0x4e')](_0x554d('0x76'),_0x38640c,_0x36da95[_0x554d('0x77')]['TranscriptionJobName']));_0x5d852a[_0x554d('0x78')]=_0x36da95[_0x554d('0x77')][_0x554d('0x79')];_0x5d852a['transcribeStatus']=_0x36da95[_0x554d('0x77')][_0x554d('0x7a')];return _0x163eff(_0x5d852a);})[_0x554d('0x46')](function(_0x34c7fc){return _0x171cf8(_0x34c7fc);});});}exports['runTranscribe']=function(_0x4acf42,_0x472be4,_0xe6d187){var _0x31c50e;var _0x30ea27;var _0x366822;var _0x169f5e=require(_0x554d('0x5b'));return db[_0x554d('0x2a')][_0x554d('0x7b')]({'where':{'id':_0x4acf42[_0x554d('0x43')]['id']}})[_0x554d('0x23')](function(_0xe492ae){if(_0xe492ae){var _0x1588b7=util['format'](_0x554d('0x4f'),_0xe492ae[_0x554d('0x4d')]);if(fs['existsSync'](_0x1588b7)){cypher=!![];return _0x169f5e['decryptFile'](_0x1588b7,_0xe492ae['value'],config['secrets'][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0xe492ae;});}return _0xe492ae;}})[_0x554d('0x23')](function(_0x55c40c){if(!_0x55c40c){throw new db[(_0x554d('0x53'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x30ea27=_0x55c40c;return db[_0x554d('0x7c')][_0x554d('0x7b')]({'where':{'id':0x1}});})[_0x554d('0x23')](handleEntityNotFound(_0x472be4,null))[_0x554d('0x23')](function(_0x24929c){if(_0x24929c){_0x31c50e=_0x24929c;if(!_0x31c50e[_0x554d('0x7d')]||!_0x31c50e[_0x554d('0x7e')]||!_0x31c50e[_0x554d('0x7f')]||!_0x31c50e[_0x554d('0x80')]||!_0x31c50e['bucket']){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x81'));}if(_0x4acf42['body']['runSentiment']&&(!_0x31c50e[_0x554d('0x82')]||!_0x31c50e[_0x554d('0x83')]||!_0x31c50e[_0x554d('0x84')]||!_0x31c50e[_0x554d('0x80')]||!_0x31c50e[_0x554d('0x73')])){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x85'));}return db[_0x554d('0x86')][_0x554d('0x7b')]({'where':{'id':_0x31c50e[_0x554d('0x7e')]}});}})[_0x554d('0x23')](function(_0x240f59){if(!_0x240f59){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x87'));}if(!_0x240f59[_0x554d('0x88')]||!_0x240f59[_0x554d('0x89')]){throw new db[(_0x554d('0x53'))]['ValidationError'](_0x554d('0x8a'));}_0x366822=_0x240f59;return getBucketslist(_0x366822[_0x554d('0x88')],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')]);})['then'](function(_0x5526bb){if(_0x5526bb&&_0x5526bb['Buckets']){var _0x2a4fc3=_[_0x554d('0x49')](_0x5526bb[_0x554d('0x8b')],function(_0x40fc31){return _0x40fc31['Name']===_0x31c50e[_0x554d('0x73')];});if(!_0x2a4fc3){logger['info'](util['format'](_0x554d('0x8c'),_0x4acf42['params']['id'],_0x31c50e['bucket']));return createBucket(_0x366822[_0x554d('0x88')],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')],_0x31c50e[_0x554d('0x73')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4acf42[_0x554d('0x43')]['id'],_0x31c50e[_0x554d('0x73')]));return;}})[_0x554d('0x23')](function(_0x4ccfdd){if(_0x30ea27[_0x554d('0x8d')]===_0x554d('0x8e')){return transcribe(_0x4acf42[_0x554d('0x43')]['id'],_0x366822['data1'],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')],_0x31c50e['bucket'],_0x30ea27['value'],_0x31c50e[_0x554d('0x80')]);}else{logger[_0x554d('0x63')](util[_0x554d('0x4e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4acf42['params']['id']));return{'transcribeStatus':_0x554d('0x8f')};}})['then'](function(_0x2e7ed1){if(_0x2e7ed1){_0x2e7ed1[_0x554d('0x90')]=_0x4acf42['body'][_0x554d('0x91')];return _0x30ea27[_0x554d('0x92')](_0x2e7ed1);}})['then'](respondWithResult(_0x472be4,null))[_0x554d('0x46')](handleError(_0x472be4,null));};function writeFile(_0x15a6b5,_0x2f65b3){return new Promise(function(_0xb239bc,_0x317896){fs[_0x554d('0x93')](_0x2f65b3,_0x15a6b5,function(_0x45f6d4,_0xbd26d6){if(_0x45f6d4){return _0x317896(_0x45f6d4);}else{return _0xb239bc(_0xbd26d6);}});});}exports['downloadTranscribe']=function(_0x3812ef,_0x380df0,_0x117215){return db[_0x554d('0x2a')][_0x554d('0x7b')]({'where':{'id':_0x3812ef[_0x554d('0x43')]['id']}})[_0x554d('0x23')](handleEntityNotFound(_0x380df0))[_0x554d('0x23')](function(_0x761791){if(_0x761791&&_0x761791[_0x554d('0x94')]){var _0x111df8=_0x761791['fileText'];var _0x41bc25=config[_0x554d('0x95')]+'/server/files/transcribes/transcribe_'+_0x761791['id']+_0x554d('0x96');if(fs[_0x554d('0x50')](_0x41bc25)){return _0x41bc25;}return writeFile(_0x111df8,_0x41bc25)['then'](function(){return _0x41bc25;});}else{throw new db['Sequelize']['ValidationError'](_0x554d('0x97'));}})[_0x554d('0x23')](function(_0x3dfdf6){return _0x380df0['download'](_0x3dfdf6);})[_0x554d('0x46')](handleError(_0x380df0));}; \ No newline at end of file +var _0xa74c=['.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','ValidationError','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','upload','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data1','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','fileText','root','/server/files/transcribes/transcribe_'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xa74c,0x1d3));var _0xca74=function(_0x156c84,_0x452577){_0x156c84=_0x156c84-0x0;var _0x1bb69f=_0xa74c[_0x156c84];return _0x1bb69f;};'use strict';var emlformat=require(_0xca74('0x0'));var rimraf=require(_0xca74('0x1'));var zipdir=require(_0xca74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca74('0x3'));var moment=require(_0xca74('0x4'));var BPromise=require(_0xca74('0x5'));var Mustache=require(_0xca74('0x6'));var util=require(_0xca74('0x7'));var path=require(_0xca74('0x8'));var sox=require(_0xca74('0x9'));var csv=require('to-csv');var ejs=require(_0xca74('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca74('0xb'));var squel=require(_0xca74('0xc'));var crypto=require('crypto');var jsforce=require(_0xca74('0xd'));var deskjs=require(_0xca74('0xe'));var toCsv=require(_0xca74('0xf'));var querystring=require(_0xca74('0x10'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xca74('0x11'));var Redis=require(_0xca74('0x12'));var authService=require(_0xca74('0x13'));var qs=require(_0xca74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca74('0x15'));var logger=require(_0xca74('0x16'))(_0xca74('0x17'));var utils=require(_0xca74('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xca74('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f16c9,_0x1da517){_0x1da517=_0x1da517||0xcc;return function(_0x47e5cd){if(_0x47e5cd){return _0x2f16c9[_0xca74('0x1a')](_0x1da517);}return _0x2f16c9[_0xca74('0x1b')](_0x1da517)[_0xca74('0x1c')]();};}function respondWithResult(_0xea1974,_0x504fb4){_0x504fb4=_0x504fb4||0xc8;return function(_0x2610df){if(_0x2610df){return _0xea1974['status'](_0x504fb4)[_0xca74('0x1d')](_0x2610df);}};}function respondWithFilteredResult(_0x51341e,_0x312446){return function(_0x14b921){if(_0x14b921){var _0x220557=typeof _0x312446[_0xca74('0x1e')]===_0xca74('0x1f')&&typeof _0x312446[_0xca74('0x20')]===_0xca74('0x1f');var _0x1879dd=_0x14b921[_0xca74('0x21')];var _0x2c311a=_0x220557?0x0:_0x312446[_0xca74('0x1e')];var _0xe1bee5=_0x220557?_0x14b921['count']:_0x312446[_0xca74('0x1e')]+_0x312446[_0xca74('0x20')];var _0x2d442f;if(_0xe1bee5>=_0x1879dd){_0xe1bee5=_0x1879dd;_0x2d442f=0xc8;}else{_0x2d442f=0xce;}_0x51341e[_0xca74('0x1b')](_0x2d442f);return _0x51341e[_0xca74('0x22')]('Content-Range',_0x2c311a+'-'+_0xe1bee5+'/'+_0x1879dd)[_0xca74('0x1d')](_0x14b921);}return null;};}function patchUpdates(_0x174761){return function(_0x4181c9){try{jsonpatch[_0xca74('0x23')](_0x4181c9,_0x174761,!![]);}catch(_0x420883){return BPromise['reject'](_0x420883);}return _0x4181c9[_0xca74('0x24')]();};}function saveUpdates(_0x23b3e3,_0x49d961){return function(_0x64a1c1){if(_0x64a1c1){return _0x64a1c1[_0xca74('0x25')](_0x23b3e3)[_0xca74('0x26')](function(_0x7e377b){return _0x7e377b;});}return null;};}function removeEntity(_0x3fff76,_0x45946e){return function(_0x11bee2){if(_0x11bee2){return _0x11bee2[_0xca74('0x27')]()[_0xca74('0x26')](function(){_0x3fff76[_0xca74('0x1b')](0xcc)[_0xca74('0x1c')]();});}};}function handleEntityNotFound(_0x3969d0,_0x48b7d4){return function(_0x6e8c8a){if(!_0x6e8c8a){_0x3969d0['sendStatus'](0x194);}return _0x6e8c8a;};}function handleError(_0x213720,_0x2ecb56){_0x2ecb56=_0x2ecb56||0x1f4;return function(_0x1f3ae5){logger['error'](_0x1f3ae5[_0xca74('0x28')]);if(_0x1f3ae5[_0xca74('0x29')]){delete _0x1f3ae5[_0xca74('0x29')];}_0x213720[_0xca74('0x1b')](_0x2ecb56)[_0xca74('0x2a')](_0x1f3ae5);};}exports[_0xca74('0x2b')]=function(_0x5f505a,_0x1a36e8){var _0x12fc24={},_0x1630a4={},_0x5d9e84={'count':0x0,'rows':[]};var _0x2f6b27=_[_0xca74('0x2c')](db[_0xca74('0x2d')]['rawAttributes'],function(_0x345218){return{'name':_0x345218[_0xca74('0x2e')],'type':_0x345218[_0xca74('0x2f')][_0xca74('0x30')]};});_0x1630a4[_0xca74('0x31')]=_[_0xca74('0x32')](_[_0xca74('0x2c')](_0x2f6b27,'name'),[_0xca74('0x33')]);_0x1630a4[_0xca74('0x34')]=_[_0xca74('0x35')](_0x5f505a['query']);_0x1630a4[_0xca74('0x36')]=_['intersection'](_0x1630a4[_0xca74('0x31')],_0x1630a4[_0xca74('0x34')]);_0x12fc24[_0xca74('0x37')]=_[_0xca74('0x38')](_0x1630a4[_0xca74('0x31')],qs['fields'](_0x5f505a[_0xca74('0x34')][_0xca74('0x39')]));_0x12fc24['attributes']=_0x12fc24[_0xca74('0x37')][_0xca74('0x3a')]?_0x12fc24['attributes']:_0x1630a4[_0xca74('0x31')];if(!_0x5f505a['query'][_0xca74('0x3b')](_0xca74('0x3c'))){_0x12fc24[_0xca74('0x20')]=qs[_0xca74('0x20')](_0x5f505a[_0xca74('0x34')]['limit']);_0x12fc24[_0xca74('0x1e')]=qs[_0xca74('0x1e')](_0x5f505a[_0xca74('0x34')][_0xca74('0x1e')]);}_0x12fc24[_0xca74('0x3d')]=qs[_0xca74('0x3e')](_0x5f505a[_0xca74('0x34')]['sort']);_0x12fc24[_0xca74('0x3f')]=qs[_0xca74('0x36')](_[_0xca74('0x40')](_0x5f505a['query'],_0x1630a4[_0xca74('0x36')]),_0x2f6b27);if(_0x5f505a['query'][_0xca74('0x41')]){_0x12fc24[_0xca74('0x3f')]=_[_0xca74('0x42')](_0x12fc24[_0xca74('0x3f')],{'$or':_[_0xca74('0x2c')](_0x2f6b27,function(_0xb2e23d){if(_0xb2e23d['type']!=='VIRTUAL'){var _0x20bbf4={};_0x20bbf4[_0xb2e23d[_0xca74('0x29')]]={'$like':'%'+_0x5f505a[_0xca74('0x34')][_0xca74('0x41')]+'%'};return _0x20bbf4;}})});}_0x12fc24=_[_0xca74('0x42')]({},_0x12fc24,_0x5f505a[_0xca74('0x43')]);var _0x475e47={'where':_0x12fc24[_0xca74('0x3f')]};return db[_0xca74('0x2d')][_0xca74('0x21')](_0x475e47)['then'](function(_0x2e8136){_0x5d9e84['count']=_0x2e8136;if(_0x5f505a['query'][_0xca74('0x44')]){_0x12fc24[_0xca74('0x45')]=[{'all':!![]}];}return db[_0xca74('0x2d')][_0xca74('0x46')](_0x12fc24);})[_0xca74('0x26')](function(_0x20bf47){_0x5d9e84[_0xca74('0x47')]=_0x20bf47;return _0x5d9e84;})['then'](respondWithFilteredResult(_0x1a36e8,_0x12fc24))[_0xca74('0x48')](handleError(_0x1a36e8,null));};exports[_0xca74('0x49')]=function(_0x4acdf0,_0x45e860){var _0x2aa6cd={'raw':![],'where':{'id':_0x4acdf0['params']['id']}},_0x22742e={};_0x22742e[_0xca74('0x31')]=_[_0xca74('0x35')](db[_0xca74('0x2d')]['rawAttributes']);_0x22742e[_0xca74('0x34')]=_['keys'](_0x4acdf0[_0xca74('0x34')]);_0x22742e['filters']=_[_0xca74('0x38')](_0x22742e[_0xca74('0x31')],_0x22742e[_0xca74('0x34')]);_0x2aa6cd['attributes']=_[_0xca74('0x38')](_0x22742e[_0xca74('0x31')],qs[_0xca74('0x39')](_0x4acdf0['query'][_0xca74('0x39')]));_0x2aa6cd[_0xca74('0x37')]=_0x2aa6cd['attributes']['length']?_0x2aa6cd[_0xca74('0x37')]:_0x22742e[_0xca74('0x31')];if(_0x4acdf0[_0xca74('0x34')][_0xca74('0x44')]){_0x2aa6cd[_0xca74('0x45')]=[{'all':!![]}];}_0x2aa6cd=_['merge']({},_0x2aa6cd,_0x4acdf0[_0xca74('0x43')]);return db[_0xca74('0x2d')][_0xca74('0x4a')](_0x2aa6cd)[_0xca74('0x26')](handleEntityNotFound(_0x45e860,null))[_0xca74('0x26')](respondWithResult(_0x45e860,null))[_0xca74('0x48')](handleError(_0x45e860,null));};exports[_0xca74('0x4b')]=function(_0xa36115,_0x5565f3){return db[_0xca74('0x2d')][_0xca74('0x4b')](_0xa36115[_0xca74('0x4c')],{})[_0xca74('0x26')](respondWithResult(_0x5565f3,0xc9))[_0xca74('0x48')](handleError(_0x5565f3,null));};exports['update']=function(_0x4ec6be,_0x2e1cd5){if(_0x4ec6be[_0xca74('0x4c')]['id']){delete _0x4ec6be[_0xca74('0x4c')]['id'];}return db[_0xca74('0x2d')]['find']({'where':{'id':_0x4ec6be[_0xca74('0x4d')]['id']}})[_0xca74('0x26')](handleEntityNotFound(_0x2e1cd5,null))[_0xca74('0x26')](saveUpdates(_0x4ec6be[_0xca74('0x4c')],null))[_0xca74('0x26')](respondWithResult(_0x2e1cd5,null))[_0xca74('0x48')](handleError(_0x2e1cd5,null));};exports['describe']=function(_0x56ee9c,_0x463dac){return db['VoiceRecording'][_0xca74('0x4e')]()['then'](respondWithResult(_0x463dac,null))[_0xca74('0x48')](handleError(_0x463dac,null));};exports[_0xca74('0x4f')]=function(_0x29e042,_0x217367,_0x3b9103){var _0x4e01f3=require(_0xca74('0x50'));var _0x3e48f7=![];var _0x3daab7={};if(_0x29e042[_0xca74('0x34')]['type']&&_0x29e042['query'][_0xca74('0x2f')]===_0xca74('0x51')){_0x3daab7[_0xca74('0x51')]=_0x29e042[_0xca74('0x4d')]['id'];}else{_0x3daab7['id']=_0x29e042['params']['id'];}return db[_0xca74('0x2d')]['find']({'where':_0x3daab7,'attributes':['id',_0xca74('0x52')],'raw':!![]})[_0xca74('0x26')](handleEntityNotFound(_0x217367,null))[_0xca74('0x26')](function(_0xd13f18){if(_0xd13f18){var _0x2ce82d=_0xd13f18[_0xca74('0x52')];var _0x2b414f=util[_0xca74('0x33')](_0xca74('0x53'),_0x2ce82d);if(fs[_0xca74('0x54')](_0x2b414f)){_0x3e48f7=!![];return _0x4e01f3[_0xca74('0x55')](_0x2b414f,_0x2ce82d,config[_0xca74('0x56')][_0xca74('0x57')])['then'](function(){return _0xd13f18;});}return _0xd13f18;}})[_0xca74('0x26')](function(_0x44ee59){if(_0x44ee59){var _0x527849=_0x44ee59[_0xca74('0x52')];if(!fs[_0xca74('0x54')](_0x527849)){throw new db[(_0xca74('0x58'))]['ValidationError'](_0xca74('0x59'));}if(_0x44ee59[_0xca74('0x5a')]){return _0x217367[_0xca74('0x4f')](_0x527849,_0x44ee59[_0xca74('0x5a')]+path[_0xca74('0x5b')](_0x527849),function(){if(_0x3e48f7){fs[_0xca74('0x5c')](_0x527849);}});}else{return _0x217367[_0xca74('0x4f')](_0x527849,function(_0x5f14d1){if(_0x3e48f7){fs[_0xca74('0x5c')](_0x527849);}});}}})['catch'](function(_0x1be1b4){if(_0x1be1b4['message']===_0xca74('0x59')){_0x217367['status'](0x194)[_0xca74('0x2a')](_0xca74('0x5d'));}else{return handleError(_0x217367,null);}});};exports[_0xca74('0x5e')]=function(_0x5037cf,_0x582040,_0x274cd9){var _0x2f7e10=require(_0xca74('0x50'));var _0x3af926=![];var _0x34b768={'$and':[db[_0xca74('0x5f')][_0xca74('0x3f')](db['sequelize']['fn'](_0xca74('0x60'),db[_0xca74('0x5f')][_0xca74('0x61')](_0xca74('0x51'))),_0x5037cf[_0xca74('0x34')][_0xca74('0x62')])]};if(_0x5037cf[_0xca74('0x34')]['type']&&_0x5037cf[_0xca74('0x34')]['type']===_0xca74('0x51')){_0x34b768[_0xca74('0x63')][_0xca74('0x64')]({'uniqueid':_0x5037cf[_0xca74('0x4d')]['id']});}else{_0x34b768['$and'][_0xca74('0x64')]({'id':_0x5037cf[_0xca74('0x4d')]['id']});}return db[_0xca74('0x2d')][_0xca74('0x4a')]({'where':_0x34b768,'attributes':['id','value'],'raw':!![]})[_0xca74('0x26')](handleEntityNotFound(_0x582040,null))[_0xca74('0x26')](function(_0x4d2f0a){if(_0x4d2f0a){var _0x155da1=util[_0xca74('0x33')](_0xca74('0x53'),_0x4d2f0a[_0xca74('0x52')]);if(fs[_0xca74('0x54')](_0x155da1)){_0x3af926=!![];return _0x2f7e10[_0xca74('0x55')](_0x155da1,_0x4d2f0a['value'],config[_0xca74('0x56')]['recording'])[_0xca74('0x26')](function(){return _0x4d2f0a;});}return _0x4d2f0a;}})[_0xca74('0x26')](function(_0x3a7534){if(_0x3a7534){if(!fs['existsSync'](_0x3a7534[_0xca74('0x52')])){throw new db[(_0xca74('0x58'))][(_0xca74('0x65'))](_0xca74('0x59'));}if(_0x3a7534['filename']){return _0x582040[_0xca74('0x4f')](_0x3a7534[_0xca74('0x52')],_0x3a7534[_0xca74('0x5a')]+path[_0xca74('0x5b')](_0x3a7534[_0xca74('0x52')]),function(){if(_0x3af926){fs[_0xca74('0x5c')](_0x3a7534[_0xca74('0x52')]);}});}else{return _0x582040[_0xca74('0x4f')](_0x3a7534[_0xca74('0x52')],function(_0x142202){if(_0x3af926){fs[_0xca74('0x5c')](_0x3a7534[_0xca74('0x52')]);}});}}})['catch'](handleError(_0x582040,null));};exports['destroy']=function(_0x516f3e,_0x219690){return db[_0xca74('0x2d')][_0xca74('0x4a')]({'where':{'id':_0x516f3e[_0xca74('0x4d')]['id']}})[_0xca74('0x26')](function(_0x21a8dc){if(_['isNil'](_0x21a8dc)){throw new ReferenceError(_0xca74('0x66'));}return _0x21a8dc;})[_0xca74('0x26')](function(_0x326613){var _0x1b34ce=_0x326613['value'];logger[_0xca74('0x67')](_0xca74('0x68'),_0x1b34ce);if(!_['isNil'](_0x326613[_0xca74('0x52')])&&fs[_0xca74('0x54')](_0x1b34ce)){logger['info'](_0xca74('0x69')+_0x1b34ce+_0xca74('0x6a'));fs[_0xca74('0x6b')](_0x1b34ce);}_0x1b34ce=_0x1b34ce+_0xca74('0x6c');if(!_[_0xca74('0x6d')](_0x326613[_0xca74('0x52')])&&fs[_0xca74('0x54')](_0x1b34ce)){logger[_0xca74('0x67')](_0xca74('0x69')+_0x1b34ce+_0xca74('0x6a'));fs['unlinkSync'](_0x1b34ce);}return _0x326613;})[_0xca74('0x26')](function(_0x2d8c6d){if(!_0x2d8c6d)throw new InternalError();return _0x2d8c6d['destroy']();})[_0xca74('0x26')](function(){_0x219690[_0xca74('0x1b')](0xcc)[_0xca74('0x1c')]();})[_0xca74('0x48')](handleError(_0x219690,null));};function getBucketslist(_0x5b48c5,_0x107ff2,_0x25604b){return new Promise(function(_0x25bac2,_0x3052b8){var _0x43a6a3=new AWS['S3']({'accessKeyId':_0x107ff2,'secretAccessKey':_0x5b48c5,'region':_0x25604b});_0x43a6a3['listBuckets']({},function(_0x2d5816,_0x924e21){if(_0x2d5816){return _0x3052b8(_0x2d5816);}else{return _0x25bac2(_0x924e21);}});});}function createBucket(_0x398568,_0x346919,_0x39783c,_0x3b1bb6){return new Promise(function(_0x2d44c3,_0x1f1ec3){var _0x5785ce=new AWS['S3']({'accessKeyId':_0x346919,'secretAccessKey':_0x398568,'region':_0x39783c});_0x5785ce['createBucket']({'Bucket':_0x3b1bb6},function(_0x59f3c6,_0x3b924c){if(_0x59f3c6){return _0x1f1ec3(_0x59f3c6);}else{return _0x2d44c3(_0x3b924c);}});});}function uploadFile(_0x7f250,_0x4a0924,_0x3ec77f,_0x3ec247,_0x2a65ec,_0x59baa1){return new Promise(function(_0x24ec34,_0x1f513c){var _0x4b01a9=new AWS['S3']({'accessKeyId':_0x4a0924,'secretAccessKey':_0x7f250,'region':_0x3ec77f});_0x4b01a9[_0xca74('0x6e')]({'Bucket':_0x3ec247,'Key':_0x2a65ec,'Body':_0x59baa1},function(_0x4485d5,_0x563bb9){if(_0x4485d5){return _0x1f513c(_0x4485d5);}else{return _0x24ec34(_0x563bb9);}});});}function startTranscribe(_0xbd029a,_0x442cce,_0x23d73e,_0x46b87f,_0x22ba25,_0x3a7da6){return new Promise(function(_0x1814e0,_0x1f6b31){var _0xfaf910=new AWS['TranscribeService']({'accessKeyId':_0x442cce,'secretAccessKey':_0xbd029a,'region':_0x23d73e});_0xfaf910['startTranscriptionJob']({'TranscriptionJobName':_0x46b87f,'LanguageCode':_0x22ba25,'Media':{'MediaFileUri':_0x3a7da6}},function(_0x585dce,_0x3b9dc4){if(_0x585dce){return _0x1f6b31(_0x585dce);}else{return _0x1814e0(_0x3b9dc4);}});});}function transcribe(_0x7d38b7,_0x1274c9,_0x3e60fd,_0x598077,_0x483ec1,_0x28b5f6,_0x40985a){return new Promise(function(_0x435e94,_0x1c46de){var _0xcdb2e0={};logger[_0xca74('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x7d38b7,_0x483ec1));return uploadFile(_0x1274c9,_0x3e60fd,_0x598077,_0x483ec1,path['basename'](_0x28b5f6),fs[_0xca74('0x6f')](_0x28b5f6))[_0xca74('0x26')](function(_0x2b0d41){logger[_0xca74('0x67')](util[_0xca74('0x33')](_0xca74('0x70'),_0x7d38b7,_0x483ec1,_0x2b0d41[_0xca74('0x71')]));_0xcdb2e0['bucket']=_0x2b0d41[_0xca74('0x72')];_0xcdb2e0[_0xca74('0x73')]=_0x2b0d41[_0xca74('0x71')];logger[_0xca74('0x67')](util['format'](_0xca74('0x74'),_0x7d38b7));return startTranscribe(_0x1274c9,_0x3e60fd,_0x598077,uuidv4(),_0x40985a,_0x2b0d41[_0xca74('0x71')]);})[_0xca74('0x26')](function(_0x458845){logger[_0xca74('0x67')](util[_0xca74('0x33')](_0xca74('0x75'),_0x7d38b7,_0x458845['TranscriptionJob'][_0xca74('0x76')]));_0xcdb2e0[_0xca74('0x77')]=_0x458845[_0xca74('0x78')][_0xca74('0x76')];_0xcdb2e0[_0xca74('0x79')]=_0x458845[_0xca74('0x78')][_0xca74('0x7a')];return _0x435e94(_0xcdb2e0);})['catch'](function(_0x179e0a){return _0x1c46de(_0x179e0a);});});}exports[_0xca74('0x7b')]=function(_0xb8e890,_0x443aac,_0x4c4b18){var _0x263365;var _0x309147;var _0x50936b;var _0x2a98cf=require(_0xca74('0x50'));return db[_0xca74('0x2d')][_0xca74('0x7c')]({'where':{'id':_0xb8e890[_0xca74('0x4d')]['id']}})['then'](function(_0x17547a){if(_0x17547a){var _0x29f778=util['format'](_0xca74('0x53'),_0x17547a['value']);if(fs['existsSync'](_0x29f778)){cypher=!![];return _0x2a98cf['decryptFile'](_0x29f778,_0x17547a[_0xca74('0x52')],config[_0xca74('0x56')][_0xca74('0x57')])[_0xca74('0x26')](function(){return _0x17547a;});}return _0x17547a;}})[_0xca74('0x26')](function(_0x2900e6){if(!_0x2900e6){throw new db['Sequelize'][(_0xca74('0x65'))](_0xca74('0x7d'));}_0x309147=_0x2900e6;return db[_0xca74('0x7e')][_0xca74('0x7c')]({'where':{'id':0x1}});})[_0xca74('0x26')](handleEntityNotFound(_0x443aac,null))['then'](function(_0x19b3d3){if(_0x19b3d3){_0x263365=_0x19b3d3;if(!_0x263365['transcribe']||!_0x263365[_0xca74('0x7f')]||!_0x263365[_0xca74('0x80')]||!_0x263365['language']||!_0x263365['bucket']){throw new db[(_0xca74('0x58'))][(_0xca74('0x65'))](_0xca74('0x81'));}if(_0xb8e890['body'][_0xca74('0x82')]&&(!_0x263365[_0xca74('0x83')]||!_0x263365[_0xca74('0x84')]||!_0x263365[_0xca74('0x85')]||!_0x263365[_0xca74('0x86')]||!_0x263365[_0xca74('0x87')])){throw new db['Sequelize'][(_0xca74('0x65'))](_0xca74('0x88'));}return db[_0xca74('0x89')][_0xca74('0x7c')]({'where':{'id':_0x263365[_0xca74('0x7f')]}});}})['then'](function(_0x3af7c1){if(!_0x3af7c1){throw new db[(_0xca74('0x58'))][(_0xca74('0x65'))](_0xca74('0x8a'));}if(!_0x3af7c1['data1']||!_0x3af7c1[_0xca74('0x8b')]){throw new db[(_0xca74('0x58'))][(_0xca74('0x65'))](_0xca74('0x8c'));}_0x50936b=_0x3af7c1;return getBucketslist(_0x50936b['data1'],_0x50936b[_0xca74('0x8b')],_0x263365['transcribeRegion']);})['then'](function(_0x63fbca){if(_0x63fbca&&_0x63fbca[_0xca74('0x8d')]){var _0x1a4d8f=_[_0xca74('0x4a')](_0x63fbca[_0xca74('0x8d')],function(_0x3cc105){return _0x3cc105[_0xca74('0x8e')]===_0x263365[_0xca74('0x87')];});if(!_0x1a4d8f){logger[_0xca74('0x67')](util[_0xca74('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xb8e890['params']['id'],_0x263365[_0xca74('0x87')]));return createBucket(_0x50936b['data1'],_0x50936b[_0xca74('0x8b')],_0x263365['transcribeRegion'],_0x263365[_0xca74('0x87')]);}logger[_0xca74('0x67')](util[_0xca74('0x33')](_0xca74('0x8f'),_0xb8e890['params']['id'],_0x263365['bucket']));return;}})[_0xca74('0x26')](function(_0xc03689){if(_0x309147[_0xca74('0x79')]===_0xca74('0x90')){return transcribe(_0xb8e890['params']['id'],_0x50936b[_0xca74('0x91')],_0x50936b[_0xca74('0x8b')],_0x263365[_0xca74('0x80')],_0x263365[_0xca74('0x87')],_0x309147['value'],_0x263365[_0xca74('0x86')]);}else{logger[_0xca74('0x67')](util[_0xca74('0x33')](_0xca74('0x92'),_0xb8e890[_0xca74('0x4d')]['id']));return{'transcribeStatus':_0xca74('0x93')};}})[_0xca74('0x26')](function(_0xdba5ae){if(_0xdba5ae){_0xdba5ae[_0xca74('0x94')]=_0xb8e890[_0xca74('0x4c')][_0xca74('0x82')];return _0x309147['updateAttributes'](_0xdba5ae);}})[_0xca74('0x26')](respondWithResult(_0x443aac,null))[_0xca74('0x48')](handleError(_0x443aac,null));};function writeFile(_0xb228f1,_0x446357){return new Promise(function(_0x85b519,_0x2cbce7){fs[_0xca74('0x95')](_0x446357,_0xb228f1,function(_0x1f2c66,_0xd16300){if(_0x1f2c66){return _0x2cbce7(_0x1f2c66);}else{return _0x85b519(_0xd16300);}});});}exports['downloadTranscribe']=function(_0x39cbb9,_0x429b09,_0x83e6b2){return db['VoiceRecording'][_0xca74('0x7c')]({'where':{'id':_0x39cbb9[_0xca74('0x4d')]['id']}})[_0xca74('0x26')](handleEntityNotFound(_0x429b09))[_0xca74('0x26')](function(_0x105ef0){if(_0x105ef0&&_0x105ef0[_0xca74('0x96')]){var _0x21ee4f=_0x105ef0[_0xca74('0x96')];var _0xa360ca=config[_0xca74('0x97')]+_0xca74('0x98')+_0x105ef0['id']+_0xca74('0x99');if(fs[_0xca74('0x54')](_0xa360ca)){return _0xa360ca;}return writeFile(_0x21ee4f,_0xa360ca)['then'](function(){return _0xa360ca;});}else{throw new db[(_0xca74('0x58'))][(_0xca74('0x65'))](_0xca74('0x9a'));}})[_0xca74('0x26')](function(_0x2bb0f6){return _0x429b09[_0xca74('0x4f')](_0x2bb0f6);})['catch'](handleError(_0x429b09));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index ea5596f..c6ea16f 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 _0x9658=['VoiceRecording','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x20620f,_0x37c815){var _0x593a2f=function(_0x25479a){while(--_0x25479a){_0x20620f['push'](_0x20620f['shift']());}};_0x593a2f(++_0x37c815);}(_0x9658,0x6f));var _0x8965=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x9658[_0x16db8b];return _0x5ba017;};'use strict';var attributes=require(_0x8965('0x0'));module['exports']=function(_0x1f5bb6,_0xa89576){return _0x1f5bb6['define'](_0x8965('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x8965('0x2'),'fields':[_0x8965('0x2')]},{'name':_0x8965('0x3'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb647=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb647,0xdb));var _0x7b64=function(_0x3b3400,_0x20cfb7){_0x3b3400=_0x3b3400-0x0;var _0x532265=_0xb647[_0x3b3400];return _0x532265;};'use strict';var attributes=require(_0x7b64('0x0'));module[_0x7b64('0x1')]=function(_0x3cf0d4,_0x248af6){return _0x3cf0d4[_0x7b64('0x2')](_0x7b64('0x3'),attributes,{'tableName':_0x7b64('0x4'),'paranoid':![],'indexes':[{'name':_0x7b64('0x5'),'fields':['uniqueid']},{'name':_0x7b64('0x6'),'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 5adab42..22bd3ee 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 _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x1f1b10,_0x3136fd){var _0x3d0c2b=function(_0x59b85a){while(--_0x59b85a){_0x1f1b10['push'](_0x1f1b10['shift']());}};_0x3d0c2b(++_0x3136fd);}(_0xacf4,0xe7));var _0x4acf=function(_0x2fd7fb,_0x32afad){_0x2fd7fb=_0x2fd7fb-0x0;var _0x15bf0a=_0xacf4[_0x2fd7fb];return _0x15bf0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});}; \ No newline at end of file +var _0x0424=['stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0x0424,0x159));var _0x4042=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0424[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['update'](_0x466077[_0x4042('0x17')],{'raw':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466077['options']?_0x466077[_0x4042('0x18')][_0x4042('0x1a')]||null:null,'attributes':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')]['attributes']||null:null,'limit':_0x466077[_0x4042('0x18')]?_0x466077[_0x4042('0x18')][_0x4042('0x1b')]||null:null})[_0x4042('0xa')](function(_0x352631){logger['info'](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('UpdateVoiceRecording',_0x466077,JSON[_0x4042('0xf')](_0x352631));_0xe5c1ec(_0x352631);})['catch'](function(_0x271b82){logger[_0x4042('0x10')](_0x4042('0x15'),_0x271b82['message'],_0x466077);_0x4fe024(_0x4b02d4[_0x4042('0x10')](0x1f4,_0x271b82[_0x4042('0x11')]));});});};exports[_0x4042('0x1c')]=function(_0xbdadc8){var _0x1c4d9f=this;return new Promise(function(_0x52e575,_0x58c409){var _0x1d8d48=require(_0x4042('0x1d'));var _0x26542c;return db[_0x4042('0x1e')][_0x4042('0x1f')]({'attributes':['id',_0x4042('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x33733b){_0x26542c=_0x33733b;return db[_0x4042('0x16')]['create'](_0xbdadc8[_0x4042('0x17')]);})[_0x4042('0xa')](function(_0xe924fe){if(_0x26542c['callRecordingEncryption']&&fs['existsSync'](_0xe924fe[_0x4042('0x21')])){var _0x43bd1c=util['format'](_0x4042('0x22'),_0xe924fe[_0x4042('0x21')]);return _0x1d8d48[_0x4042('0x23')](_0xe924fe[_0x4042('0x21')],_0x43bd1c,config[_0x4042('0x24')][_0x4042('0x25')])[_0x4042('0xa')](function(){fs[_0x4042('0x26')](_0xe924fe[_0x4042('0x21')]);logger['info'](_0x4042('0x27'));return _0xe924fe;});}return _0xe924fe;})[_0x4042('0xa')](function(_0x5320f8){logger[_0x4042('0x12')](_0x4042('0x1c'),_0xbdadc8);logger['debug'](_0x4042('0x1c'),_0xbdadc8,JSON[_0x4042('0xf')](_0x5320f8));_0x52e575(_0x5320f8);})[_0x4042('0x14')](function(_0xaa7c99){logger[_0x4042('0x10')](_0x4042('0x1c'),_0xaa7c99[_0x4042('0x11')],_0xbdadc8);_0x58c409(_0x1c4d9f[_0x4042('0x10')](0x1f4,_0xaa7c99[_0x4042('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 322dd16..f9a1989 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 _0x53e5=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x302d0a,_0x31aeff){var _0x154752=function(_0x44fc09){while(--_0x44fc09){_0x302d0a['push'](_0x302d0a['shift']());}};_0x154752(++_0x31aeff);}(_0x53e5,0x72));var _0x553e=function(_0x1bb572,_0x3674d8){_0x1bb572=_0x1bb572-0x0;var _0x3716e3=_0x53e5[_0x1bb572];return _0x3716e3;};'use strict';var multer=require('multer');var util=require(_0x553e('0x0'));var path=require(_0x553e('0x1'));var timeout=require(_0x553e('0x2'));var express=require(_0x553e('0x3'));var router=express[_0x553e('0x4')]();var fs_extra=require(_0x553e('0x5'));var auth=require(_0x553e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x553e('0x7'));var controller=require(_0x553e('0x8'));router[_0x553e('0x9')]('/',auth['isAuthenticated'](),controller[_0x553e('0xa')]);router[_0x553e('0x9')](_0x553e('0xb'),auth[_0x553e('0xc')](),controller[_0x553e('0xd')]);router['get'](_0x553e('0xe'),auth[_0x553e('0xc')](),controller[_0x553e('0xf')]);router['post']('/',auth[_0x553e('0xc')](),controller['create']);router[_0x553e('0x10')]('/:id',auth[_0x553e('0xc')](),controller[_0x553e('0x11')]);router[_0x553e('0x12')](_0x553e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x553e('0x13')]=router; \ No newline at end of file +var _0x7aa1=['Router','fs-extra','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','exports','util','path','express'];(function(_0x5add96,_0x288a79){var _0x3e697e=function(_0x52e43a){while(--_0x52e43a){_0x5add96['push'](_0x5add96['shift']());}};_0x3e697e(++_0x288a79);}(_0x7aa1,0x7b));var _0x17aa=function(_0x180133,_0x589186){_0x180133=_0x180133-0x0;var _0x208b21=_0x7aa1[_0x180133];return _0x208b21;};'use strict';var multer=require('multer');var util=require(_0x17aa('0x0'));var path=require(_0x17aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x17aa('0x2'));var router=express[_0x17aa('0x3')]();var fs_extra=require(_0x17aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x17aa('0x5'));router[_0x17aa('0x6')]('/',auth[_0x17aa('0x7')](),controller['index']);router[_0x17aa('0x6')](_0x17aa('0x8'),auth[_0x17aa('0x7')](),controller[_0x17aa('0x9')]);router[_0x17aa('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x17aa('0xa')]);router[_0x17aa('0xb')]('/',auth[_0x17aa('0x7')](),controller[_0x17aa('0xc')]);router[_0x17aa('0xd')](_0x17aa('0xe'),auth[_0x17aa('0x7')](),controller[_0x17aa('0xf')]);router['delete'](_0x17aa('0xe'),auth[_0x17aa('0x7')](),controller[_0x17aa('0x10')]);module[_0x17aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0addf32..5bd2e40 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 _0xecef=['STRING','Yes','moment','exports','blind','attended'];(function(_0x594a98,_0x508a42){var _0x355283=function(_0x13d677){while(--_0x13d677){_0x594a98['push'](_0x594a98['shift']());}};_0x355283(++_0x508a42);}(_0xecef,0xe0));var _0xfece=function(_0x145d7d,_0x349ede){_0x145d7d=_0x145d7d-0x0;var _0x25bc00=_0xecef[_0x145d7d];return _0x25bc00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfece('0x0'));module[_0xfece('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfece('0x2'),_0xfece('0x3'))},'result':{'type':Sequelize[_0xfece('0x4')]},'transfererchannel':{'type':Sequelize[_0xfece('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xfece('0x4')]},'transferercalleridname':{'type':Sequelize[_0xfece('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xfece('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xfece('0x4')]},'transferercontext':{'type':Sequelize[_0xfece('0x4')]},'transfererexten':{'type':Sequelize[_0xfece('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xfece('0x4')]},'transfereechannel':{'type':Sequelize[_0xfece('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xfece('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xfece('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xfece('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfece('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xfece('0x4')]},'transfereeexten':{'type':Sequelize[_0xfece('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xfece('0x5'),'No')},'context':{'type':Sequelize[_0xfece('0x4')]},'extension':{'type':Sequelize[_0xfece('0x4')]}}; \ No newline at end of file +var _0xe2a8=['Yes','moment','exports','blind','STRING','ENUM'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xe2a8,0x13f));var _0x8e2a=function(_0x5c198d,_0x5cbcf6){_0x5c198d=_0x5c198d-0x0;var _0x1893a1=_0xe2a8[_0x5c198d];return _0x1893a1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8e2a('0x0'));module[_0x8e2a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8e2a('0x2'),'attended')},'result':{'type':Sequelize[_0x8e2a('0x3')]},'transfererchannel':{'type':Sequelize[_0x8e2a('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x8e2a('0x3')]},'transferercalleridname':{'type':Sequelize[_0x8e2a('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x8e2a('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x8e2a('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x8e2a('0x3')]},'transfereechannel':{'type':Sequelize[_0x8e2a('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x8e2a('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x8e2a('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8e2a('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x8e2a('0x3')]},'transfereecontext':{'type':Sequelize[_0x8e2a('0x3')]},'transfereeexten':{'type':Sequelize[_0x8e2a('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x8e2a('0x4')](_0x8e2a('0x5'),'No')},'context':{'type':Sequelize[_0x8e2a('0x3')]},'extension':{'type':Sequelize[_0x8e2a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d3e542b..3e8ae89 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 _0x00fd=['pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x00fd,0x188));var _0xd00f=function(_0x5146a6,_0x2e14c5){_0x5146a6=_0x5146a6-0x0;var _0x49523e=_0x00fd[_0x5146a6];return _0x49523e;};'use strict';var emlformat=require(_0xd00f('0x0'));var rimraf=require(_0xd00f('0x1'));var zipdir=require(_0xd00f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd00f('0x3'));var BPromise=require(_0xd00f('0x4'));var Mustache=require(_0xd00f('0x5'));var util=require(_0xd00f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd00f('0x7'));var ejs=require(_0xd00f('0x8'));var fs=require('fs');var fs_extra=require(_0xd00f('0x9'));var _=require('lodash');var squel=require(_0xd00f('0xa'));var crypto=require(_0xd00f('0xb'));var jsforce=require(_0xd00f('0xc'));var deskjs=require(_0xd00f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd00f('0xe'));var Papa=require(_0xd00f('0xf'));var Redis=require('ioredis');var authService=require(_0xd00f('0x10'));var qs=require(_0xd00f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd00f('0x12'));var logger=require('../../config/logger')(_0xd00f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd00f('0x14'));var db=require(_0xd00f('0x15'))['db'];function respondWithStatusCode(_0x582859,_0x2c9551){_0x2c9551=_0x2c9551||0xcc;return function(_0x1f216c){if(_0x1f216c){return _0x582859[_0xd00f('0x16')](_0x2c9551);}return _0x582859['status'](_0x2c9551)[_0xd00f('0x17')]();};}function respondWithResult(_0x379327,_0xd9d092){_0xd9d092=_0xd9d092||0xc8;return function(_0x21ad79){if(_0x21ad79){return _0x379327[_0xd00f('0x18')](_0xd9d092)[_0xd00f('0x19')](_0x21ad79);}};}function respondWithFilteredResult(_0x4503c0,_0x289084){return function(_0x12905d){if(_0x12905d){var _0x398729=typeof _0x289084['offset']==='undefined'&&typeof _0x289084['limit']===_0xd00f('0x1a');var _0xdcac47=_0x12905d[_0xd00f('0x1b')];var _0x450b38=_0x398729?0x0:_0x289084[_0xd00f('0x1c')];var _0x18d964=_0x398729?_0x12905d['count']:_0x289084[_0xd00f('0x1c')]+_0x289084[_0xd00f('0x1d')];var _0x5b003d;if(_0x18d964>=_0xdcac47){_0x18d964=_0xdcac47;_0x5b003d=0xc8;}else{_0x5b003d=0xce;}_0x4503c0[_0xd00f('0x18')](_0x5b003d);return _0x4503c0[_0xd00f('0x1e')](_0xd00f('0x1f'),_0x450b38+'-'+_0x18d964+'/'+_0xdcac47)[_0xd00f('0x19')](_0x12905d);}return null;};}function patchUpdates(_0x28d159){return function(_0x3dc79b){try{jsonpatch[_0xd00f('0x20')](_0x3dc79b,_0x28d159,!![]);}catch(_0x2d6fda){return BPromise[_0xd00f('0x21')](_0x2d6fda);}return _0x3dc79b[_0xd00f('0x22')]();};}function saveUpdates(_0x303a0f,_0x16769e){return function(_0x1f1c15){if(_0x1f1c15){return _0x1f1c15[_0xd00f('0x23')](_0x303a0f)['then'](function(_0x1a61d5){return _0x1a61d5;});}return null;};}function removeEntity(_0xb96afc,_0x2e977f){return function(_0x41e43b){if(_0x41e43b){return _0x41e43b[_0xd00f('0x24')]()[_0xd00f('0x25')](function(){_0xb96afc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x219d30,_0x43f8b5){return function(_0x278161){if(!_0x278161){_0x219d30['sendStatus'](0x194);}return _0x278161;};}function handleError(_0x51ed70,_0x379293){_0x379293=_0x379293||0x1f4;return function(_0x3e45dd){logger['error'](_0x3e45dd['stack']);if(_0x3e45dd[_0xd00f('0x26')]){delete _0x3e45dd[_0xd00f('0x26')];}_0x51ed70[_0xd00f('0x18')](_0x379293)[_0xd00f('0x27')](_0x3e45dd);};}exports[_0xd00f('0x28')]=function(_0x11e04d,_0xa7b0ce){var _0x47f1d6={},_0x768ade={},_0x4ab5b2={'count':0x0,'rows':[]};var _0x1626b9=_[_0xd00f('0x29')](db[_0xd00f('0x2a')][_0xd00f('0x2b')],function(_0x2b5451){return{'name':_0x2b5451[_0xd00f('0x2c')],'type':_0x2b5451[_0xd00f('0x2d')][_0xd00f('0x2e')]};});_0x768ade[_0xd00f('0x2f')]=_[_0xd00f('0x29')](_0x1626b9,_0xd00f('0x26'));_0x768ade['query']=_[_0xd00f('0x30')](_0x11e04d[_0xd00f('0x31')]);_0x768ade['filters']=_['intersection'](_0x768ade[_0xd00f('0x2f')],_0x768ade[_0xd00f('0x31')]);_0x47f1d6[_0xd00f('0x32')]=_[_0xd00f('0x33')](_0x768ade['model'],qs[_0xd00f('0x34')](_0x11e04d['query'][_0xd00f('0x34')]));_0x47f1d6[_0xd00f('0x32')]=_0x47f1d6[_0xd00f('0x32')]['length']?_0x47f1d6['attributes']:_0x768ade['model'];if(!_0x11e04d[_0xd00f('0x31')][_0xd00f('0x35')](_0xd00f('0x36'))){_0x47f1d6[_0xd00f('0x1d')]=qs[_0xd00f('0x1d')](_0x11e04d[_0xd00f('0x31')][_0xd00f('0x1d')]);_0x47f1d6[_0xd00f('0x1c')]=qs['offset'](_0x11e04d['query']['offset']);}_0x47f1d6[_0xd00f('0x37')]=qs[_0xd00f('0x38')](_0x11e04d[_0xd00f('0x31')]['sort']);_0x47f1d6['where']=qs[_0xd00f('0x39')](_[_0xd00f('0x3a')](_0x11e04d[_0xd00f('0x31')],_0x768ade[_0xd00f('0x39')]),_0x1626b9);if(_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3b')]){_0x47f1d6[_0xd00f('0x3c')]=_[_0xd00f('0x3d')](_0x47f1d6[_0xd00f('0x3c')],{'$or':_[_0xd00f('0x29')](_0x1626b9,function(_0x52256d){if(_0x52256d[_0xd00f('0x2d')]!=='VIRTUAL'){var _0x25a4ee={};_0x25a4ee[_0x52256d[_0xd00f('0x26')]]={'$like':'%'+_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3b')]+'%'};return _0x25a4ee;}})});}_0x47f1d6=_[_0xd00f('0x3d')]({},_0x47f1d6,_0x11e04d[_0xd00f('0x3e')]);var _0x472144={'where':_0x47f1d6[_0xd00f('0x3c')]};return db['VoiceTransferReport'][_0xd00f('0x1b')](_0x472144)[_0xd00f('0x25')](function(_0xb77e35){_0x4ab5b2[_0xd00f('0x1b')]=_0xb77e35;if(_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3f')]){_0x47f1d6[_0xd00f('0x40')]=[{'all':!![]}];}return db[_0xd00f('0x2a')][_0xd00f('0x41')](_0x47f1d6);})[_0xd00f('0x25')](function(_0x5138cf){_0x4ab5b2[_0xd00f('0x42')]=_0x5138cf;return _0x4ab5b2;})[_0xd00f('0x25')](respondWithFilteredResult(_0xa7b0ce,_0x47f1d6))[_0xd00f('0x43')](handleError(_0xa7b0ce,null));};exports[_0xd00f('0x44')]=function(_0x877984,_0x24b204){var _0xccb049={'raw':!![],'where':{'id':_0x877984[_0xd00f('0x45')]['id']}},_0xb3ca4b={};_0xb3ca4b['model']=_[_0xd00f('0x30')](db[_0xd00f('0x2a')][_0xd00f('0x2b')]);_0xb3ca4b[_0xd00f('0x31')]=_[_0xd00f('0x30')](_0x877984[_0xd00f('0x31')]);_0xb3ca4b['filters']=_[_0xd00f('0x33')](_0xb3ca4b[_0xd00f('0x2f')],_0xb3ca4b['query']);_0xccb049[_0xd00f('0x32')]=_[_0xd00f('0x33')](_0xb3ca4b[_0xd00f('0x2f')],qs[_0xd00f('0x34')](_0x877984[_0xd00f('0x31')]['fields']));_0xccb049['attributes']=_0xccb049[_0xd00f('0x32')][_0xd00f('0x46')]?_0xccb049[_0xd00f('0x32')]:_0xb3ca4b['model'];if(_0x877984['query'][_0xd00f('0x3f')]){_0xccb049[_0xd00f('0x40')]=[{'all':!![]}];}_0xccb049=_['merge']({},_0xccb049,_0x877984['options']);return db[_0xd00f('0x2a')][_0xd00f('0x47')](_0xccb049)[_0xd00f('0x25')](handleEntityNotFound(_0x24b204,null))['then'](respondWithResult(_0x24b204,null))['catch'](handleError(_0x24b204,null));};exports[_0xd00f('0x48')]=function(_0x3161d,_0x385576){return db[_0xd00f('0x2a')][_0xd00f('0x48')](_0x3161d['body'],{})[_0xd00f('0x25')](respondWithResult(_0x385576,0xc9))['catch'](handleError(_0x385576,null));};exports['update']=function(_0x36c426,_0x863b83){if(_0x36c426[_0xd00f('0x49')]['id']){delete _0x36c426['body']['id'];}return db[_0xd00f('0x2a')][_0xd00f('0x47')]({'where':{'id':_0x36c426['params']['id']}})['then'](handleEntityNotFound(_0x863b83,null))[_0xd00f('0x25')](saveUpdates(_0x36c426[_0xd00f('0x49')],null))[_0xd00f('0x25')](respondWithResult(_0x863b83,null))[_0xd00f('0x43')](handleError(_0x863b83,null));};exports[_0xd00f('0x24')]=function(_0x59f7d7,_0x525920){return db[_0xd00f('0x2a')][_0xd00f('0x47')]({'where':{'id':_0x59f7d7[_0xd00f('0x45')]['id']}})[_0xd00f('0x25')](handleEntityNotFound(_0x525920,null))['then'](removeEntity(_0x525920,null))[_0xd00f('0x43')](handleError(_0x525920,null));};exports[_0xd00f('0x4a')]=function(_0x364c67,_0x33ad5e){return db[_0xd00f('0x2a')][_0xd00f('0x4a')]()['then'](respondWithResult(_0x33ad5e,null))[_0xd00f('0x43')](handleError(_0x33ad5e,null));}; \ No newline at end of file +var _0x884b=['options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','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','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params'];(function(_0x34c085,_0x47624b){var _0x9f7dc2=function(_0x3fcbed){while(--_0x3fcbed){_0x34c085['push'](_0x34c085['shift']());}};_0x9f7dc2(++_0x47624b);}(_0x884b,0x1d3));var _0xb884=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x884b[_0x33c1b1];return _0x2c2037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb884('0x0'));var zipdir=require(_0xb884('0x1'));var jsonpatch=require(_0xb884('0x2'));var rp=require(_0xb884('0x3'));var moment=require('moment');var BPromise=require(_0xb884('0x4'));var Mustache=require(_0xb884('0x5'));var util=require(_0xb884('0x6'));var path=require(_0xb884('0x7'));var sox=require('sox');var csv=require(_0xb884('0x8'));var ejs=require(_0xb884('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb884('0xa'));var squel=require(_0xb884('0xb'));var crypto=require('crypto');var jsforce=require(_0xb884('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb884('0x8'));var querystring=require(_0xb884('0xd'));var Papa=require(_0xb884('0xe'));var Redis=require(_0xb884('0xf'));var authService=require(_0xb884('0x10'));var qs=require(_0xb884('0x11'));var as=require(_0xb884('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb884('0x13'))(_0xb884('0x14'));var utils=require(_0xb884('0x15'));var config=require(_0xb884('0x16'));var licenseUtil=require(_0xb884('0x17'));var db=require(_0xb884('0x18'))['db'];function respondWithStatusCode(_0x188439,_0x17178d){_0x17178d=_0x17178d||0xcc;return function(_0x5b190a){if(_0x5b190a){return _0x188439[_0xb884('0x19')](_0x17178d);}return _0x188439['status'](_0x17178d)['end']();};}function respondWithResult(_0x364c5b,_0x53ebd1){_0x53ebd1=_0x53ebd1||0xc8;return function(_0x245739){if(_0x245739){return _0x364c5b[_0xb884('0x1a')](_0x53ebd1)[_0xb884('0x1b')](_0x245739);}};}function respondWithFilteredResult(_0x28883d,_0xd3c905){return function(_0x385f84){if(_0x385f84){var _0x3dade7=typeof _0xd3c905[_0xb884('0x1c')]===_0xb884('0x1d')&&typeof _0xd3c905[_0xb884('0x1e')]===_0xb884('0x1d');var _0x487f89=_0x385f84['count'];var _0x46c0ed=_0x3dade7?0x0:_0xd3c905[_0xb884('0x1c')];var _0x3f41c0=_0x3dade7?_0x385f84[_0xb884('0x1f')]:_0xd3c905['offset']+_0xd3c905[_0xb884('0x1e')];var _0x39dc36;if(_0x3f41c0>=_0x487f89){_0x3f41c0=_0x487f89;_0x39dc36=0xc8;}else{_0x39dc36=0xce;}_0x28883d[_0xb884('0x1a')](_0x39dc36);return _0x28883d[_0xb884('0x20')](_0xb884('0x21'),_0x46c0ed+'-'+_0x3f41c0+'/'+_0x487f89)[_0xb884('0x1b')](_0x385f84);}return null;};}function patchUpdates(_0x5c6eab){return function(_0x3ef837){try{jsonpatch[_0xb884('0x22')](_0x3ef837,_0x5c6eab,!![]);}catch(_0x7e6e93){return BPromise[_0xb884('0x23')](_0x7e6e93);}return _0x3ef837['save']();};}function saveUpdates(_0x2f1ab4,_0xd5c043){return function(_0x2e09f6){if(_0x2e09f6){return _0x2e09f6[_0xb884('0x24')](_0x2f1ab4)['then'](function(_0x2cb361){return _0x2cb361;});}return null;};}function removeEntity(_0x149fe1,_0x678804){return function(_0x1e85fe){if(_0x1e85fe){return _0x1e85fe[_0xb884('0x25')]()[_0xb884('0x26')](function(){_0x149fe1[_0xb884('0x1a')](0xcc)[_0xb884('0x27')]();});}};}function handleEntityNotFound(_0x9954c2,_0x2a1771){return function(_0x1f4605){if(!_0x1f4605){_0x9954c2[_0xb884('0x19')](0x194);}return _0x1f4605;};}function handleError(_0x5d6dc0,_0x2c42d3){_0x2c42d3=_0x2c42d3||0x1f4;return function(_0x2e2cda){logger[_0xb884('0x28')](_0x2e2cda[_0xb884('0x29')]);if(_0x2e2cda[_0xb884('0x2a')]){delete _0x2e2cda['name'];}_0x5d6dc0[_0xb884('0x1a')](_0x2c42d3)[_0xb884('0x2b')](_0x2e2cda);};}exports[_0xb884('0x2c')]=function(_0x481846,_0x4a575e){var _0xc09152={},_0x56b9a0={},_0x176daa={'count':0x0,'rows':[]};var _0x2894d1=_[_0xb884('0x2d')](db[_0xb884('0x2e')][_0xb884('0x2f')],function(_0x1a8a61){return{'name':_0x1a8a61['fieldName'],'type':_0x1a8a61[_0xb884('0x30')][_0xb884('0x31')]};});_0x56b9a0[_0xb884('0x32')]=_[_0xb884('0x2d')](_0x2894d1,_0xb884('0x2a'));_0x56b9a0[_0xb884('0x33')]=_[_0xb884('0x34')](_0x481846[_0xb884('0x33')]);_0x56b9a0[_0xb884('0x35')]=_[_0xb884('0x36')](_0x56b9a0['model'],_0x56b9a0[_0xb884('0x33')]);_0xc09152['attributes']=_[_0xb884('0x36')](_0x56b9a0[_0xb884('0x32')],qs['fields'](_0x481846['query'][_0xb884('0x37')]));_0xc09152['attributes']=_0xc09152[_0xb884('0x38')][_0xb884('0x39')]?_0xc09152[_0xb884('0x38')]:_0x56b9a0[_0xb884('0x32')];if(!_0x481846[_0xb884('0x33')][_0xb884('0x3a')](_0xb884('0x3b'))){_0xc09152[_0xb884('0x1e')]=qs[_0xb884('0x1e')](_0x481846[_0xb884('0x33')][_0xb884('0x1e')]);_0xc09152[_0xb884('0x1c')]=qs[_0xb884('0x1c')](_0x481846[_0xb884('0x33')][_0xb884('0x1c')]);}_0xc09152[_0xb884('0x3c')]=qs[_0xb884('0x3d')](_0x481846['query'][_0xb884('0x3d')]);_0xc09152[_0xb884('0x3e')]=qs[_0xb884('0x35')](_['pick'](_0x481846[_0xb884('0x33')],_0x56b9a0[_0xb884('0x35')]),_0x2894d1);if(_0x481846[_0xb884('0x33')][_0xb884('0x3f')]){_0xc09152[_0xb884('0x3e')]=_[_0xb884('0x40')](_0xc09152[_0xb884('0x3e')],{'$or':_[_0xb884('0x2d')](_0x2894d1,function(_0x3e7705){if(_0x3e7705['type']!=='VIRTUAL'){var _0x2e2927={};_0x2e2927[_0x3e7705[_0xb884('0x2a')]]={'$like':'%'+_0x481846['query'][_0xb884('0x3f')]+'%'};return _0x2e2927;}})});}_0xc09152=_[_0xb884('0x40')]({},_0xc09152,_0x481846['options']);var _0x5d509c={'where':_0xc09152['where']};return db[_0xb884('0x2e')][_0xb884('0x1f')](_0x5d509c)[_0xb884('0x26')](function(_0x3a93ad){_0x176daa[_0xb884('0x1f')]=_0x3a93ad;if(_0x481846[_0xb884('0x33')][_0xb884('0x41')]){_0xc09152[_0xb884('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb884('0x43')](_0xc09152);})[_0xb884('0x26')](function(_0x2b81ff){_0x176daa[_0xb884('0x44')]=_0x2b81ff;return _0x176daa;})[_0xb884('0x26')](respondWithFilteredResult(_0x4a575e,_0xc09152))[_0xb884('0x45')](handleError(_0x4a575e,null));};exports[_0xb884('0x46')]=function(_0x5d1231,_0x48ce7e){var _0x1dece2={'raw':!![],'where':{'id':_0x5d1231[_0xb884('0x47')]['id']}},_0x17e276={};_0x17e276[_0xb884('0x32')]=_[_0xb884('0x34')](db['VoiceTransferReport'][_0xb884('0x2f')]);_0x17e276[_0xb884('0x33')]=_[_0xb884('0x34')](_0x5d1231[_0xb884('0x33')]);_0x17e276[_0xb884('0x35')]=_[_0xb884('0x36')](_0x17e276[_0xb884('0x32')],_0x17e276[_0xb884('0x33')]);_0x1dece2['attributes']=_['intersection'](_0x17e276['model'],qs['fields'](_0x5d1231[_0xb884('0x33')][_0xb884('0x37')]));_0x1dece2[_0xb884('0x38')]=_0x1dece2[_0xb884('0x38')]['length']?_0x1dece2[_0xb884('0x38')]:_0x17e276[_0xb884('0x32')];if(_0x5d1231[_0xb884('0x33')][_0xb884('0x41')]){_0x1dece2['include']=[{'all':!![]}];}_0x1dece2=_['merge']({},_0x1dece2,_0x5d1231[_0xb884('0x48')]);return db['VoiceTransferReport'][_0xb884('0x49')](_0x1dece2)[_0xb884('0x26')](handleEntityNotFound(_0x48ce7e,null))[_0xb884('0x26')](respondWithResult(_0x48ce7e,null))[_0xb884('0x45')](handleError(_0x48ce7e,null));};exports[_0xb884('0x4a')]=function(_0x4eb3dd,_0x561a70){return db[_0xb884('0x2e')][_0xb884('0x4a')](_0x4eb3dd[_0xb884('0x4b')],{})[_0xb884('0x26')](respondWithResult(_0x561a70,0xc9))[_0xb884('0x45')](handleError(_0x561a70,null));};exports[_0xb884('0x24')]=function(_0x1bdd5f,_0x53f547){if(_0x1bdd5f[_0xb884('0x4b')]['id']){delete _0x1bdd5f[_0xb884('0x4b')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x1bdd5f[_0xb884('0x47')]['id']}})[_0xb884('0x26')](handleEntityNotFound(_0x53f547,null))[_0xb884('0x26')](saveUpdates(_0x1bdd5f[_0xb884('0x4b')],null))[_0xb884('0x26')](respondWithResult(_0x53f547,null))[_0xb884('0x45')](handleError(_0x53f547,null));};exports[_0xb884('0x25')]=function(_0x27a470,_0x56b316){return db[_0xb884('0x2e')][_0xb884('0x49')]({'where':{'id':_0x27a470[_0xb884('0x47')]['id']}})[_0xb884('0x26')](handleEntityNotFound(_0x56b316,null))[_0xb884('0x26')](removeEntity(_0x56b316,null))[_0xb884('0x45')](handleError(_0x56b316,null));};exports[_0xb884('0x4c')]=function(_0x41fc5f,_0xbf2143){return db[_0xb884('0x2e')][_0xb884('0x4c')]()[_0xb884('0x26')](respondWithResult(_0xbf2143,null))[_0xb884('0x45')](handleError(_0xbf2143,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a38350d..e1edc01 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 _0xfd0f=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','moment','request-promise'];(function(_0x4ebb9f,_0x3f5630){var _0xf77862=function(_0x4d7587){while(--_0x4d7587){_0x4ebb9f['push'](_0x4ebb9f['shift']());}};_0xf77862(++_0x3f5630);}(_0xfd0f,0x1c8));var _0xffd0=function(_0x44fd63,_0x692201){_0x44fd63=_0x44fd63-0x0;var _0x19b154=_0xfd0f[_0x44fd63];return _0x19b154;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xffd0('0x2'));var BPromise=require('bluebird');var rp=require(_0xffd0('0x3'));var fs=require('fs');var path=require(_0xffd0('0x4'));var rimraf=require(_0xffd0('0x5'));var config=require(_0xffd0('0x6'));var attributes=require(_0xffd0('0x7'));module['exports']=function(_0x182b4f,_0xfbe53){return _0x182b4f[_0xffd0('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xffd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3ca=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','define'];(function(_0xfc3c78,_0x26001e){var _0x2edcf8=function(_0x50a224){while(--_0x50a224){_0xfc3c78['push'](_0xfc3c78['shift']());}};_0x2edcf8(++_0x26001e);}(_0xc3ca,0x19a));var _0xac3c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc3ca[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xac3c('0x0'));var util=require(_0xac3c('0x1'));var logger=require(_0xac3c('0x2'))(_0xac3c('0x3'));var moment=require(_0xac3c('0x4'));var BPromise=require(_0xac3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac3c('0x6'));var config=require(_0xac3c('0x7'));var attributes=require(_0xac3c('0x8'));module['exports']=function(_0x3fe88c,_0x5093b5){return _0x3fe88c[_0xac3c('0x9')](_0xac3c('0xa'),attributes,{'tableName':_0xac3c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index cd5ec9b..295c004 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 _0x1f7b=['rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x69fb6a,_0x46ec8d){var _0x2faee2=function(_0x56b079){while(--_0x56b079){_0x69fb6a['push'](_0x69fb6a['shift']());}};_0x2faee2(++_0x46ec8d);}(_0x1f7b,0xc4));var _0xb1f7=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x1f7b[_0x1dfa63];return _0x26f2a9;};'use strict';var _=require('lodash');var util=require(_0xb1f7('0x0'));var moment=require(_0xb1f7('0x1'));var BPromise=require(_0xb1f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1f7('0x3'));var db=require(_0xb1f7('0x4'))['db'];var utils=require(_0xb1f7('0x5'));var logger=require(_0xb1f7('0x6'))(_0xb1f7('0x7'));var config=require(_0xb1f7('0x8'));var jayson=require(_0xb1f7('0x9'));var client=jayson[_0xb1f7('0xa')][_0xb1f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6276,_0xc1a3e6,_0x3a37c6){return new BPromise(function(_0x447699,_0x119af6){return client[_0xb1f7('0xc')](_0x2d6276,_0x3a37c6)[_0xb1f7('0xd')](function(_0x4245e1){logger['info'](_0xb1f7('0xe'),_0xc1a3e6,_0xb1f7('0xf'));logger[_0xb1f7('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xc1a3e6,_0xb1f7('0xf'),JSON['stringify'](_0x4245e1));if(_0x4245e1['error']){if(_0x4245e1[_0xb1f7('0x11')]['code']===0x1f4){logger[_0xb1f7('0x11')](_0xb1f7('0xe'),_0xc1a3e6,_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);return _0x119af6(_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);}logger['error'](_0xb1f7('0xe'),_0xc1a3e6,_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);return _0x447699(_0x4245e1['error'][_0xb1f7('0x12')]);}else{logger[_0xb1f7('0x13')](_0xb1f7('0xe'),_0xc1a3e6,'request\x20sent');_0x447699(_0x4245e1[_0xb1f7('0x14')][_0xb1f7('0x12')]);}})[_0xb1f7('0x15')](function(_0x3f1f6e){logger[_0xb1f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0xc1a3e6,_0x3f1f6e);_0x119af6(_0x3f1f6e);});});}exports[_0xb1f7('0x16')]=function(_0x3f9c05){var _0x4bd4ff=this;return new Promise(function(_0x33b37f,_0x5bdd1f){return db[_0xb1f7('0x17')][_0xb1f7('0x18')](_0x3f9c05[_0xb1f7('0x19')],{'raw':_0x3f9c05[_0xb1f7('0x1a')]?_0x3f9c05[_0xb1f7('0x1a')][_0xb1f7('0x1b')]===undefined?!![]:![]:!![]})[_0xb1f7('0xd')](function(_0x178e23){logger[_0xb1f7('0x13')]('CreateVoiceTransferReport',_0x3f9c05);logger[_0xb1f7('0x10')](_0xb1f7('0x16'),_0x3f9c05,JSON[_0xb1f7('0x1c')](_0x178e23));_0x33b37f(_0x178e23);})[_0xb1f7('0x15')](function(_0x1ea1ef){logger[_0xb1f7('0x11')]('CreateVoiceTransferReport',_0x1ea1ef[_0xb1f7('0x12')],_0x3f9c05);_0x5bdd1f(_0x4bd4ff['error'](0x1f4,_0x1ea1ef[_0xb1f7('0x12')]));});});}; \ No newline at end of file +var _0x7bb9=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','options','raw','CreateVoiceTransferReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info'];(function(_0x3d62a9,_0x156e72){var _0x318ee8=function(_0x93068f){while(--_0x93068f){_0x3d62a9['push'](_0x3d62a9['shift']());}};_0x318ee8(++_0x156e72);}(_0x7bb9,0x11c));var _0x97bb=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7bb9[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x97bb('0x0'));var util=require(_0x97bb('0x1'));var moment=require(_0x97bb('0x2'));var BPromise=require(_0x97bb('0x3'));var rs=require(_0x97bb('0x4'));var fs=require('fs');var Redis=require(_0x97bb('0x5'));var db=require(_0x97bb('0x6'))['db'];var utils=require(_0x97bb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x97bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x97bb('0x9')][_0x97bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x309bac,_0xafa031,_0x380dc3){return new BPromise(function(_0x4e1f74,_0x23df00){return client['request'](_0x309bac,_0x380dc3)[_0x97bb('0xb')](function(_0x177542){logger[_0x97bb('0xc')](_0x97bb('0xd'),_0xafa031,_0x97bb('0xe'));logger[_0x97bb('0xf')](_0x97bb('0x10'),_0xafa031,_0x97bb('0xe'),JSON['stringify'](_0x177542));if(_0x177542[_0x97bb('0x11')]){if(_0x177542[_0x97bb('0x11')][_0x97bb('0x12')]===0x1f4){logger[_0x97bb('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0xafa031,_0x177542[_0x97bb('0x11')][_0x97bb('0x13')]);return _0x23df00(_0x177542[_0x97bb('0x11')][_0x97bb('0x13')]);}logger[_0x97bb('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0xafa031,_0x177542[_0x97bb('0x11')][_0x97bb('0x13')]);return _0x4e1f74(_0x177542['error'][_0x97bb('0x13')]);}else{logger[_0x97bb('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0xafa031,_0x97bb('0xe'));_0x4e1f74(_0x177542[_0x97bb('0x14')]['message']);}})[_0x97bb('0x15')](function(_0x40a210){logger[_0x97bb('0x11')](_0x97bb('0xd'),_0xafa031,_0x40a210);_0x23df00(_0x40a210);});});}exports['CreateVoiceTransferReport']=function(_0x3550d9){var _0x5a1aba=this;return new Promise(function(_0x35c280,_0x160ccb){return db['VoiceTransferReport'][_0x97bb('0x16')](_0x3550d9['body'],{'raw':_0x3550d9['options']?_0x3550d9[_0x97bb('0x17')][_0x97bb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4c0dab){logger[_0x97bb('0xc')](_0x97bb('0x19'),_0x3550d9);logger['debug'](_0x97bb('0x19'),_0x3550d9,JSON[_0x97bb('0x1a')](_0x4c0dab));_0x35c280(_0x4c0dab);})[_0x97bb('0x15')](function(_0x4fffbe){logger[_0x97bb('0x11')]('CreateVoiceTransferReport',_0x4fffbe[_0x97bb('0x13')],_0x3550d9);_0x160ccb(_0x5a1aba['error'](0x1f4,_0x4fffbe[_0x97bb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index f5de46b..2a68388 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 _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x1baba1,_0x45a1f5){var _0x5d815c=function(_0x475818){while(--_0x475818){_0x1baba1['push'](_0x1baba1['shift']());}};_0x5d815c(++_0x45a1f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x3509b9,_0x38bb75){var _0x11704f=function(_0x37a435){while(--_0x37a435){_0x3509b9['push'](_0x3509b9['shift']());}};_0x11704f(++_0x38bb75);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index a16f4c0..e993522 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 _0x593e=['number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','name','status','send','NotFound','request','code','message','catch','findOne','agent','then','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','rows','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x39f761,_0x552ff1){var _0x5096f0=function(_0x7ab8d3){while(--_0x7ab8d3){_0x39f761['push'](_0x39f761['shift']());}};_0x5096f0(++_0x552ff1);}(_0x593e,0xcb));var _0xe593=function(_0x26e461,_0x198549){_0x26e461=_0x26e461-0x0;var _0x237a76=_0x593e[_0x26e461];return _0x237a76;};'use strict';var path=require(_0xe593('0x0'));var fs=require('fs');var _=require(_0xe593('0x1'));var db=require(_0xe593('0x2'))['db'];var config=require(_0xe593('0x3'));var util=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var jayson=require(_0xe593('0x6'));var amiClient=jayson[_0xe593('0x7')]['http']({'port':0x232a});var logger=require(_0xe593('0x8'))(_0xe593('0x9'));var Redis=require(_0xe593('0xa'));config[_0xe593('0xb')]=_[_0xe593('0xc')](config[_0xe593('0xb')],{'host':_0xe593('0xd'),'port':0x18eb});var io=require(_0xe593('0xe'))(new Redis(config[_0xe593('0xb')]));var Schema=require(_0xe593('0xf'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]},'callNumber':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x12')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x14')]},'transferNumber':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]}});function emit(_0x40416c,_0x1c6de3,_0x2d525c){logger[_0xe593('0x16')](_0x40416c,_0x1c6de3,JSON[_0xe593('0x17')](_0x2d525c));io['to'](_0x40416c)['emit'](_0x1c6de3,_0x2d525c);}function handleError(_0xfbc79f){return function(_0x470d07){console['log'](_0xe593('0x18'),_0x470d07,_0x470d07 instanceof RangeError);logger[_0xe593('0x19')](_0x470d07['stack']);if(_0x470d07 instanceof RangeError){if(_0x470d07[_0xe593('0x1a')]){delete _0x470d07[_0xe593('0x1a')];}_0xfbc79f[_0xe593('0x1b')](0x194)[_0xe593('0x1c')](_0x470d07);}else{if(_0x470d07[_0xe593('0x1a')]){delete _0x470d07[_0xe593('0x1a')];}_0xfbc79f[_0xe593('0x1b')](0x1f4)['send'](_0x470d07);}};}function checkError(){return function(_0x4af4c8){if(!_0x4af4c8){throw new RangeError(_0xe593('0x1d'));}return _0x4af4c8;};}function respondWithRpcPromise(_0x5d4895,_0x56c23f){return new BPromise(function(_0x1bb8e8,_0x3c65b5){var _0x57379d=amiClient;return _0x57379d[_0xe593('0x1e')](_0x5d4895,_0x56c23f)['then'](function(_0x1672bf){if(_0x1672bf[_0xe593('0x19')]){if(_0x1672bf[_0xe593('0x19')][_0xe593('0x1f')]===0x1f4){return _0x3c65b5(_0x1672bf[_0xe593('0x19')][_0xe593('0x20')]);}return _0x1bb8e8(_0x1672bf[_0xe593('0x19')][_0xe593('0x20')]);}else{_0x1bb8e8(_0x1672bf['result']);}})[_0xe593('0x21')](function(_0x347d7d){_0x3c65b5(_0x347d7d);});});}function getAgent(_0x480218){return db['User'][_0xe593('0x22')]({'where':{'id':_0x480218,'role':_0xe593('0x23')}})[_0xe593('0x24')](checkError());}function getAgentCheckSession(_0x43699d,_0x3b66bc){return new BPromise(function(_0x27a3d2,_0x5918cd){var _0x350e2b=respondWithRpcPromise('VoiceChannels');var _0x1dacf6=getAgent(_0x43699d);Promise[_0xe593('0x25')]([_0x350e2b,_0x1dacf6])['then'](function(_0x337ee0){var _0x561a01=_0x337ee0[0x0];var _0x44a68c=_0x337ee0[0x1];var _0x1c147b=_[_0xe593('0x26')](_0x561a01['rows'],function(_0x1ae8d9){return _0x1ae8d9[_0xe593('0x27')]==_0x44a68c['id']&&_0x1ae8d9[_0xe593('0x28')]==_0x3b66bc;});if(_0x1c147b[_0xe593('0x29')]==0x1){_0x27a3d2(_0x44a68c);}else{_0x5918cd(new RangeError(_0xe593('0x2a')+_0x3b66bc+_0xe593('0x2b')));}});});}exports[_0xe593('0x2c')]=function(_0x4efc93,_0x4098a9){logger[_0xe593('0x16')]('originate\x20fired:',_0x4efc93[_0xe593('0x2d')]);var _0x571995=originateValidation[_0xe593('0xf')](_0x4efc93[_0xe593('0x2d')]);if(_0x571995[_0xe593('0x29')]>0x0){return _0x4098a9[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x571995);}var _0x24a560=_0x4efc93[_0xe593('0x2d')][_0xe593('0x2f')];var _0x11f287=_0x4efc93[_0xe593('0x2d')]['callNumber'];var _0x27a563=_0x4efc93[_0xe593('0x2d')][_0xe593('0x30')];var _0x5a55c0=_0x4efc93['body'][_0xe593('0x31')];return getAgent(_0x24a560)['then'](function(_0x232bf1){logger[_0xe593('0x16')](_0xe593('0x32'),_0x232bf1[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x232bf1[_0xe593('0x1a')]),'webbar:originate',{'callNumber':_0x11f287,'callerId':_0x27a563,'callbackUrl':_0x5a55c0});return _0x4098a9['status'](0xc8)[_0xe593('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0xe593('0x21')](handleError(_0x4098a9));};exports['hangup']=function(_0x206775,_0x5b9589){logger['info'](_0xe593('0x35'),_0x206775[_0xe593('0x2d')]);var _0x2aa9d8=hangupValidation['validate'](_0x206775['body']);if(_0x2aa9d8['length']>0x0){return _0x5b9589[_0xe593('0x1b')](0x190)['json'](_0x2aa9d8);}var _0x37ba0e=_0x206775[_0xe593('0x2d')][_0xe593('0x2f')];var _0x475207=_0x206775['body'][_0xe593('0x28')];return getAgent(_0x37ba0e)['then'](function(_0x36c08e){logger['info']('entityFound:',_0x36c08e['name']);emit(util[_0xe593('0x33')]('user:%s',_0x36c08e[_0xe593('0x1a')]),_0xe593('0x36'),{'sessionId':_0x475207});return _0x5b9589[_0xe593('0x1b')](0xc8)['json']({'error':![],'message':_0xe593('0x37')});})[_0xe593('0x21')](handleError(_0x5b9589));};exports[_0xe593('0x38')]=function(_0x4655dd,_0x26ff41){logger[_0xe593('0x16')](_0xe593('0x39'),_0x4655dd[_0xe593('0x2d')]);var _0x4b36e1=answerValidation[_0xe593('0xf')](_0x4655dd[_0xe593('0x2d')]);if(_0x4b36e1[_0xe593('0x29')]>0x0){return _0x26ff41[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x4b36e1);}var _0x4d3018=_0x4655dd['body'][_0xe593('0x2f')];var _0x380429=_0x4655dd[_0xe593('0x2d')]['sessionId'];return getAgent(_0x4d3018)[_0xe593('0x24')](function(_0x8a4c26){logger['info']('entityFound:',_0x8a4c26[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x8a4c26['name']),_0xe593('0x3a'),{'sessionId':_0x380429});return _0x26ff41[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x3b')});})['catch'](handleError(_0x26ff41));};exports['hold']=function(_0x4a7434,_0x4c8d14){logger[_0xe593('0x16')]('hold\x20fired:',_0x4a7434[_0xe593('0x2d')]);var _0xd016b3=holdValidation[_0xe593('0xf')](_0x4a7434[_0xe593('0x2d')]);if(_0xd016b3[_0xe593('0x29')]>0x0){return _0x4c8d14[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0xd016b3);}var _0x297c3e=_0x4a7434['body'][_0xe593('0x2f')];var _0x1a5e0f=_0x4a7434[_0xe593('0x2d')]['sessionId'];return getAgent(_0x297c3e)[_0xe593('0x24')](function(_0x5dfdb1){logger[_0xe593('0x16')](_0xe593('0x32'),_0x5dfdb1[_0xe593('0x1a')]);emit(util['format']('user:%s',_0x5dfdb1[_0xe593('0x1a')]),_0xe593('0x3c'),{'sessionId':_0x1a5e0f});return _0x4c8d14['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x4c8d14));};exports['unhold']=function(_0x383645,_0x1e48d8){logger[_0xe593('0x16')](_0xe593('0x3d'),_0x383645[_0xe593('0x2d')]);var _0x44201e=unholdValidation[_0xe593('0xf')](_0x383645[_0xe593('0x2d')]);if(_0x44201e[_0xe593('0x29')]>0x0){return _0x1e48d8[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x44201e);}var _0x1ea4ef=_0x383645[_0xe593('0x2d')][_0xe593('0x2f')];var _0xa25aa8=_0x383645[_0xe593('0x2d')]['sessionId'];return getAgent(_0x1ea4ef)[_0xe593('0x24')](function(_0x12e2ac){logger[_0xe593('0x16')](_0xe593('0x32'),_0x12e2ac[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x12e2ac[_0xe593('0x1a')]),_0xe593('0x3e'),{'sessionId':_0xa25aa8});return _0x1e48d8[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x3f')});})[_0xe593('0x21')](handleError(_0x1e48d8));};exports[_0xe593('0x40')]=function(_0x93ca5e,_0x5e8f9c){logger[_0xe593('0x16')](_0xe593('0x41'),_0x5e8f9c[_0xe593('0x2d')]);var _0x24d061=callsValidation[_0xe593('0xf')](_0x93ca5e['body']);if(_0x24d061['length']>0x0){return _0x5e8f9c[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x24d061);}var _0x318dd2=_0x93ca5e[_0xe593('0x2d')][_0xe593('0x2f')];var _0x1e49ed=respondWithRpcPromise(_0xe593('0x42'));var _0x518b6f=getAgent(_0x318dd2);return Promise['all']([_0x1e49ed,_0x518b6f])[_0xe593('0x24')](function(_0x23ee3b){var _0x4ff51d=_0x23ee3b[0x0];var _0x103403=_0x23ee3b[0x1];var _0xf8ed1d=_[_0xe593('0x26')](_0x4ff51d[_0xe593('0x43')],function(_0x3a3d7b){return _0x3a3d7b[_0xe593('0x27')]==_0x103403['id'];});return _0x5e8f9c[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'count':_0xf8ed1d[_0xe593('0x29')],'rows':_0xf8ed1d});})[_0xe593('0x21')](handleError(_0x5e8f9c));};exports['conference']=function(_0x36f38e,_0x13e368){logger[_0xe593('0x16')](_0xe593('0x44'),_0x36f38e[_0xe593('0x2d')]);var _0x202b18=conferenceValidation[_0xe593('0xf')](_0x36f38e['body']);if(_0x202b18[_0xe593('0x29')]>0x0){return _0x13e368[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x202b18);}var _0x14f8e1=_0x36f38e['body'][_0xe593('0x2f')];return getAgent(_0x14f8e1)[_0xe593('0x24')](function(_0x207c3d){logger[_0xe593('0x16')](_0xe593('0x32'),_0x207c3d['name']);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x207c3d[_0xe593('0x1a')]),_0xe593('0x45'));return _0x13e368[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x46')});})[_0xe593('0x21')](handleError(_0x13e368));};exports['transfer']=function(_0x2145c0,_0x16f9fc){logger[_0xe593('0x16')](_0xe593('0x47'),_0x2145c0[_0xe593('0x2d')]);var _0x9f1813=transferValidation[_0xe593('0xf')](_0x2145c0[_0xe593('0x2d')]);if(_0x9f1813[_0xe593('0x29')]>0x0){return _0x16f9fc[_0xe593('0x1b')](0x190)['json'](_0x9f1813);}var _0x190e90=_0x2145c0[_0xe593('0x2d')][_0xe593('0x2f')];var _0x492a9e=_0x2145c0[_0xe593('0x2d')][_0xe593('0x28')];var _0x4001b7=_0x2145c0[_0xe593('0x2d')][_0xe593('0x48')];return getAgent(_0x190e90)['then'](function(_0x17a1bc){logger[_0xe593('0x16')]('entityFound:',_0x17a1bc[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x17a1bc[_0xe593('0x1a')]),'webbar:transfer',{'sessionId':_0x492a9e,'transferNumber':_0x4001b7});return _0x16f9fc[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x49')});})['catch'](handleError(_0x16f9fc));}; \ No newline at end of file +var _0xd87e=['transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','client','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','emit','log','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','all','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','sessionId','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','filter','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:'];(function(_0x133fc0,_0x1edda8){var _0x4ce619=function(_0x308be5){while(--_0x308be5){_0x133fc0['push'](_0x133fc0['shift']());}};_0x4ce619(++_0x1edda8);}(_0xd87e,0x1bf));var _0xed87=function(_0x3e2cf1,_0x2294a7){_0x3e2cf1=_0x3e2cf1-0x0;var _0x3796d0=_0xd87e[_0x3e2cf1];return _0x3796d0;};'use strict';var path=require(_0xed87('0x0'));var fs=require('fs');var _=require(_0xed87('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xed87('0x2'));var util=require(_0xed87('0x3'));var BPromise=require(_0xed87('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xed87('0x5')]['http']({'port':0x232a});var logger=require(_0xed87('0x6'))(_0xed87('0x7'));var Redis=require('ioredis');config[_0xed87('0x8')]=_['defaults'](config['redis'],{'host':_0xed87('0x9'),'port':0x18eb});var io=require(_0xed87('0xa'))(new Redis(config[_0xed87('0x8')]));var Schema=require(_0xed87('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xed87('0xc')]},'callNumber':{'type':_0xed87('0xd'),'required':[!![],_0xed87('0xe')]},'callerId':{'type':_0xed87('0xd')},'callbackUrl':{'type':_0xed87('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xed87('0xd'),'required':[!![],_0xed87('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]},'sessionId':{'type':_0xed87('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xed87('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xed87('0xf'),'required':[!![],_0xed87('0xc')]}});function emit(_0xd34e0e,_0x173413,_0x2563e4){logger[_0xed87('0x11')](_0xd34e0e,_0x173413,JSON['stringify'](_0x2563e4));io['to'](_0xd34e0e)[_0xed87('0x12')](_0x173413,_0x2563e4);}function handleError(_0x18ab7d){return function(_0x2c386a){console[_0xed87('0x13')]('handleError:',_0x2c386a,_0x2c386a instanceof RangeError);logger[_0xed87('0x14')](_0x2c386a[_0xed87('0x15')]);if(_0x2c386a instanceof RangeError){if(_0x2c386a[_0xed87('0x16')]){delete _0x2c386a[_0xed87('0x16')];}_0x18ab7d[_0xed87('0x17')](0x194)[_0xed87('0x18')](_0x2c386a);}else{if(_0x2c386a[_0xed87('0x16')]){delete _0x2c386a[_0xed87('0x16')];}_0x18ab7d[_0xed87('0x17')](0x1f4)['send'](_0x2c386a);}};}function checkError(){return function(_0x5a7329){if(!_0x5a7329){throw new RangeError('NotFound');}return _0x5a7329;};}function respondWithRpcPromise(_0x47c121,_0x42609e){return new BPromise(function(_0x5d3ec8,_0x4191a7){var _0x2b0b98=amiClient;return _0x2b0b98['request'](_0x47c121,_0x42609e)[_0xed87('0x19')](function(_0x505733){if(_0x505733[_0xed87('0x14')]){if(_0x505733[_0xed87('0x14')][_0xed87('0x1a')]===0x1f4){return _0x4191a7(_0x505733[_0xed87('0x14')][_0xed87('0x1b')]);}return _0x5d3ec8(_0x505733['error'][_0xed87('0x1b')]);}else{_0x5d3ec8(_0x505733[_0xed87('0x1c')]);}})[_0xed87('0x1d')](function(_0x320bcc){_0x4191a7(_0x320bcc);});});}function getAgent(_0x31c600){return db[_0xed87('0x1e')][_0xed87('0x1f')]({'where':{'id':_0x31c600,'role':_0xed87('0x20')}})[_0xed87('0x19')](checkError());}function getAgentCheckSession(_0x38f5c,_0x469181){return new BPromise(function(_0x341a35,_0x16a541){var _0x2b86e2=respondWithRpcPromise('VoiceChannels');var _0xb32b1c=getAgent(_0x38f5c);Promise[_0xed87('0x21')]([_0x2b86e2,_0xb32b1c])['then'](function(_0x3dff74){var _0x33c367=_0x3dff74[0x0];var _0x21c93b=_0x3dff74[0x1];var _0x4b259e=_['filter'](_0x33c367[_0xed87('0x22')],function(_0x428b75){return _0x428b75[_0xed87('0x23')]==_0x21c93b['id']&&_0x428b75['sessionId']==_0x469181;});if(_0x4b259e[_0xed87('0x24')]==0x1){_0x341a35(_0x21c93b);}else{_0x16a541(new RangeError(_0xed87('0x25')+_0x469181+_0xed87('0x26')));}});});}exports[_0xed87('0x27')]=function(_0x114e60,_0x46b9f9){logger[_0xed87('0x11')](_0xed87('0x28'),_0x114e60[_0xed87('0x29')]);var _0x4c0bc0=originateValidation[_0xed87('0xb')](_0x114e60[_0xed87('0x29')]);if(_0x4c0bc0['length']>0x0){return _0x46b9f9[_0xed87('0x17')](0x190)['json'](_0x4c0bc0);}var _0x4430aa=_0x114e60[_0xed87('0x29')][_0xed87('0x2a')];var _0x46b41b=_0x114e60[_0xed87('0x29')][_0xed87('0x2b')];var _0xbd7b69=_0x114e60[_0xed87('0x29')][_0xed87('0x2c')];var _0x6f7b23=_0x114e60[_0xed87('0x29')]['callbackUrl'];return getAgent(_0x4430aa)[_0xed87('0x19')](function(_0x167de8){logger['info'](_0xed87('0x2d'),_0x167de8['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x167de8['name']),_0xed87('0x30'),{'callNumber':_0x46b41b,'callerId':_0xbd7b69,'callbackUrl':_0x6f7b23});return _0x46b9f9[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x32')});})[_0xed87('0x1d')](handleError(_0x46b9f9));};exports['hangup']=function(_0x1ca26d,_0x525a11){logger[_0xed87('0x11')]('hangup\x20fired:',_0x1ca26d[_0xed87('0x29')]);var _0xb6fe59=hangupValidation[_0xed87('0xb')](_0x1ca26d[_0xed87('0x29')]);if(_0xb6fe59[_0xed87('0x24')]>0x0){return _0x525a11[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0xb6fe59);}var _0x161491=_0x1ca26d[_0xed87('0x29')]['userId'];var _0x4b49f8=_0x1ca26d[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x161491)[_0xed87('0x19')](function(_0x325112){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x325112['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x325112[_0xed87('0x16')]),'webbar:hangup',{'sessionId':_0x4b49f8});return _0x525a11[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x34')});})[_0xed87('0x1d')](handleError(_0x525a11));};exports[_0xed87('0x35')]=function(_0x151179,_0x315e13){logger[_0xed87('0x11')](_0xed87('0x36'),_0x151179[_0xed87('0x29')]);var _0x5c6925=answerValidation[_0xed87('0xb')](_0x151179[_0xed87('0x29')]);if(_0x5c6925[_0xed87('0x24')]>0x0){return _0x315e13['status'](0x190)['json'](_0x5c6925);}var _0xa31eec=_0x151179[_0xed87('0x29')][_0xed87('0x2a')];var _0x41a658=_0x151179['body'][_0xed87('0x33')];return getAgent(_0xa31eec)[_0xed87('0x19')](function(_0x57fa19){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x57fa19[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x57fa19[_0xed87('0x16')]),_0xed87('0x37'),{'sessionId':_0x41a658});return _0x315e13[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x38')});})[_0xed87('0x1d')](handleError(_0x315e13));};exports['hold']=function(_0x168d7a,_0x122369){logger[_0xed87('0x11')](_0xed87('0x39'),_0x168d7a[_0xed87('0x29')]);var _0x1d3f37=holdValidation[_0xed87('0xb')](_0x168d7a[_0xed87('0x29')]);if(_0x1d3f37[_0xed87('0x24')]>0x0){return _0x122369[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x1d3f37);}var _0x26c8f4=_0x168d7a[_0xed87('0x29')][_0xed87('0x2a')];var _0x2ed9c3=_0x168d7a[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x26c8f4)['then'](function(_0x2c7bef){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x2c7bef['name']);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x2c7bef['name']),_0xed87('0x3a'),{'sessionId':_0x2ed9c3});return _0x122369[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x3b')});})['catch'](handleError(_0x122369));};exports[_0xed87('0x3c')]=function(_0x436e15,_0x3ca34c){logger[_0xed87('0x11')](_0xed87('0x3d'),_0x436e15[_0xed87('0x29')]);var _0x242b57=unholdValidation[_0xed87('0xb')](_0x436e15[_0xed87('0x29')]);if(_0x242b57[_0xed87('0x24')]>0x0){return _0x3ca34c[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x242b57);}var _0x2e5a9f=_0x436e15['body'][_0xed87('0x2a')];var _0x4ea4e3=_0x436e15[_0xed87('0x29')][_0xed87('0x33')];return getAgent(_0x2e5a9f)[_0xed87('0x19')](function(_0x27ad77){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x27ad77[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x27ad77[_0xed87('0x16')]),'webbar:unhold',{'sessionId':_0x4ea4e3});return _0x3ca34c[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x3e')});})[_0xed87('0x1d')](handleError(_0x3ca34c));};exports[_0xed87('0x3f')]=function(_0x44b176,_0x1dbadc){logger[_0xed87('0x11')](_0xed87('0x40'),_0x1dbadc[_0xed87('0x29')]);var _0x32db1f=callsValidation['validate'](_0x44b176['body']);if(_0x32db1f[_0xed87('0x24')]>0x0){return _0x1dbadc[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x32db1f);}var _0x2ef4a9=_0x44b176[_0xed87('0x29')]['userId'];var _0x7e6738=respondWithRpcPromise(_0xed87('0x41'));var _0x184e99=getAgent(_0x2ef4a9);return Promise[_0xed87('0x21')]([_0x7e6738,_0x184e99])[_0xed87('0x19')](function(_0x43034f){var _0x15e3bc=_0x43034f[0x0];var _0x1391a2=_0x43034f[0x1];var _0x2ffffa=_[_0xed87('0x42')](_0x15e3bc[_0xed87('0x22')],function(_0x227d19){return _0x227d19[_0xed87('0x23')]==_0x1391a2['id'];});return _0x1dbadc[_0xed87('0x17')](0xc8)['json']({'count':_0x2ffffa[_0xed87('0x24')],'rows':_0x2ffffa});})[_0xed87('0x1d')](handleError(_0x1dbadc));};exports[_0xed87('0x43')]=function(_0x423076,_0x1c6578){logger[_0xed87('0x11')](_0xed87('0x44'),_0x423076[_0xed87('0x29')]);var _0x4b1cc5=conferenceValidation[_0xed87('0xb')](_0x423076[_0xed87('0x29')]);if(_0x4b1cc5[_0xed87('0x24')]>0x0){return _0x1c6578[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x4b1cc5);}var _0x306d9a=_0x423076['body']['userId'];return getAgent(_0x306d9a)[_0xed87('0x19')](function(_0x176bc4){logger[_0xed87('0x11')](_0xed87('0x2d'),_0x176bc4[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0x176bc4[_0xed87('0x16')]),'webbar:conference');return _0x1c6578[_0xed87('0x17')](0xc8)['json']({'error':![],'message':_0xed87('0x45')});})[_0xed87('0x1d')](handleError(_0x1c6578));};exports['transfer']=function(_0x11b3a8,_0x30f9d0){logger['info'](_0xed87('0x46'),_0x11b3a8[_0xed87('0x29')]);var _0x2dd1e8=transferValidation[_0xed87('0xb')](_0x11b3a8[_0xed87('0x29')]);if(_0x2dd1e8['length']>0x0){return _0x30f9d0[_0xed87('0x17')](0x190)[_0xed87('0x31')](_0x2dd1e8);}var _0x263810=_0x11b3a8[_0xed87('0x29')]['userId'];var _0x58279a=_0x11b3a8[_0xed87('0x29')][_0xed87('0x33')];var _0x52b53f=_0x11b3a8[_0xed87('0x29')][_0xed87('0x47')];return getAgent(_0x263810)[_0xed87('0x19')](function(_0xa1c262){logger[_0xed87('0x11')](_0xed87('0x2d'),_0xa1c262[_0xed87('0x16')]);emit(util[_0xed87('0x2e')](_0xed87('0x2f'),_0xa1c262[_0xed87('0x16')]),_0xed87('0x48'),{'sessionId':_0x58279a,'transferNumber':_0x52b53f});return _0x30f9d0[_0xed87('0x17')](0xc8)[_0xed87('0x31')]({'error':![],'message':_0xed87('0x49')});})['catch'](handleError(_0x30f9d0));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index de7a8c1..f2fc421 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 _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0x1b8bb0,_0x5cb62b){var _0x11d90e=function(_0x459fdf){while(--_0x459fdf){_0x1b8bb0['push'](_0x1b8bb0['shift']());}};_0x11d90e(++_0x5cb62b);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0xfcf0[_0x1ca29f];return _0x576c3b;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAgents','addApplications','notify','send','put','update','delete','destroy','removeAnswers','exports'];(function(_0x497b6d,_0x417ee8){var _0x29abf3=function(_0x346033){while(--_0x346033){_0x497b6d['push'](_0x497b6d['shift']());}};_0x29abf3(++_0x417ee8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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('./whatsappAccount.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['show']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/canned_answers',auth[_0x65f6('0x8')](),controller['getAnswers']);router['get'](_0x65f6('0xe'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);router['get'](_0x65f6('0x10'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);router[_0x65f6('0x12')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0x13')]);router[_0x65f6('0x12')](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x14')]);router['post'](_0x65f6('0x15'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x65f6('0x12')](_0x65f6('0xe'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x16')]);router[_0x65f6('0x12')](_0x65f6('0x10'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x17')]);router['post']('/:id/notify',controller[_0x65f6('0x18')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x65f6('0x19')]);router[_0x65f6('0x1a')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0x1b')]);router[_0x65f6('0x1c')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1d')]);router['delete'](_0x65f6('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x65f6('0x1c')](_0x65f6('0x15'),auth['isAuthenticated'](),controller[_0x65f6('0x1e')]);router[_0x65f6('0x1c')](_0x65f6('0xe'),auth[_0x65f6('0x8')](),controller['removeAgents']);module[_0x65f6('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index aaec073..19be36e 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 _0x9aee=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1180e5,_0x1747cd){var _0x42965f=function(_0x567686){while(--_0x567686){_0x1180e5['push'](_0x1180e5['shift']());}};_0x42965f(++_0x1747cd);}(_0x9aee,0x162));var _0xe9ae=function(_0x1b38e7,_0x489741){_0x1b38e7=_0x1b38e7-0x0;var _0x1b4635=_0x9aee[_0x1b38e7];return _0x1b4635;};'use strict';var Sequelize=require(_0xe9ae('0x0'));var rs=require(_0xe9ae('0x1'));module['exports']={'name':{'type':Sequelize[_0xe9ae('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe9ae('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe9ae('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe9ae('0x2')]},'type':{'type':Sequelize[_0xe9ae('0x3')]('twilio',_0xe9ae('0x4'))},'accountSid':{'type':Sequelize[_0xe9ae('0x2')]},'baseUrl':{'type':Sequelize[_0xe9ae('0x2')]},'authToken':{'type':Sequelize[_0xe9ae('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe9ae('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe9ae('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe9ae('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe9ae('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x21c352){if(!_0x21c352){this[_0xe9ae('0x9')](_0xe9ae('0xa'),null);}this[_0xe9ae('0x9')]('mandatoryDisposition',_0x21c352);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcccb=['randomstring','name','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x54c594,_0x4b66b0){var _0x57b45d=function(_0x2b017b){while(--_0x2b017b){_0x54c594['push'](_0x54c594['shift']());}};_0x57b45d(++_0x4b66b0);}(_0xcccb,0xff));var _0xbccc=function(_0xde040b,_0x25a90e){_0xde040b=_0xde040b-0x0;var _0x5251f9=_0xcccb[_0xde040b];return _0x5251f9;};'use strict';var Sequelize=require(_0xbccc('0x0'));var rs=require(_0xbccc('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xbccc('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xbccc('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xbccc('0x3')],'defaultValue':function(){return rs[_0xbccc('0x4')]();}},'phone':{'type':Sequelize[_0xbccc('0x3')]},'type':{'type':Sequelize[_0xbccc('0x5')](_0xbccc('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0xbccc('0x3')]},'baseUrl':{'type':Sequelize[_0xbccc('0x3')]},'authToken':{'type':Sequelize[_0xbccc('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbccc('0x7')],'defaultValue':function(){return _0xbccc('0x8');}},'notificationSound':{'type':Sequelize[_0xbccc('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xbccc('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbccc('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbccc('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbccc('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbccc('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbccc('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbccc('0xa')],'comment':_0xbccc('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbccc('0xc'),'set':function(_0x20fb98){if(!_0x20fb98){this[_0xbccc('0xd')](_0xbccc('0xe'),null);}this[_0xbccc('0xd')](_0xbccc('0xf'),_0x20fb98);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 5b96a2d..92b7718 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 _0x2235=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','ids','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','WhatsappApplication','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','whatsapp:','MessageSid','from','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','DESC','list','Contacts','defaults','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','applications','unmanaged','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x2235,0x7a));var _0x5223=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2235[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x5223('0x0'));var rimraf=require(_0x5223('0x1'));var zipdir=require(_0x5223('0x2'));var jsonpatch=require(_0x5223('0x3'));var rp=require(_0x5223('0x4'));var moment=require(_0x5223('0x5'));var BPromise=require(_0x5223('0x6'));var Mustache=require(_0x5223('0x7'));var util=require(_0x5223('0x8'));var path=require(_0x5223('0x9'));var sox=require(_0x5223('0xa'));var csv=require(_0x5223('0xb'));var ejs=require(_0x5223('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5223('0xd'));var squel=require(_0x5223('0xe'));var crypto=require('crypto');var jsforce=require(_0x5223('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5223('0x10'));var Papa=require(_0x5223('0x11'));var Redis=require(_0x5223('0x12'));var authService=require(_0x5223('0x13'));var qs=require(_0x5223('0x14'));var as=require(_0x5223('0x15'));var hardwareService=require(_0x5223('0x16'));var logger=require(_0x5223('0x17'))('api');var utils=require(_0x5223('0x18'));var config=require(_0x5223('0x19'));var licenseUtil=require(_0x5223('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5223('0x1b')]=_['defaults'](config[_0x5223('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5223('0x1c'))(new Redis(config[_0x5223('0x1b')]));require('./whatsappAccount.socket')[_0x5223('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5223('0x1e')][_0x5223('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2ca728,_0x4a9ebd,_0x3bb294,_0x585486){return new BPromise(function(_0x27612e,_0x4d0344){var _0x358772=_0x585486||client;return _0x358772[_0x5223('0x20')](_0x2ca728,_0x3bb294)['then'](function(_0x54d152){logger[_0x5223('0x21')](_0x5223('0x22'),_0x4a9ebd,_0x5223('0x23'));logger[_0x5223('0x24')](_0x5223('0x25'),_0x4a9ebd,'request\x20sent',JSON[_0x5223('0x26')](_0x54d152));if(_0x54d152[_0x5223('0x27')]){if(_0x54d152[_0x5223('0x27')][_0x5223('0x28')]===0x1f4){logger[_0x5223('0x27')](_0x5223('0x22'),_0x4a9ebd,_0x54d152[_0x5223('0x27')]['message']);return _0x4d0344(_0x54d152[_0x5223('0x27')][_0x5223('0x29')]);}logger[_0x5223('0x27')](_0x5223('0x22'),_0x4a9ebd,_0x54d152[_0x5223('0x27')]['message']);return _0x27612e(_0x54d152['error'][_0x5223('0x29')]);}else{logger[_0x5223('0x21')](_0x5223('0x22'),_0x4a9ebd,_0x5223('0x23'));_0x27612e(_0x54d152[_0x5223('0x2a')][_0x5223('0x29')]);}})['catch'](function(_0x1dbb1e){logger[_0x5223('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4a9ebd,_0x1dbb1e);_0x4d0344(_0x1dbb1e);});});}function respondWithStatusCode(_0x4a0aed,_0x5f2e54){_0x5f2e54=_0x5f2e54||0xcc;return function(_0x34b4b1){if(_0x34b4b1){return _0x4a0aed[_0x5223('0x2b')](_0x5f2e54);}return _0x4a0aed[_0x5223('0x2c')](_0x5f2e54)[_0x5223('0x2d')]();};}function respondWithResult(_0xc06553,_0x3552be){_0x3552be=_0x3552be||0xc8;return function(_0x379874){if(_0x379874){return _0xc06553[_0x5223('0x2c')](_0x3552be)[_0x5223('0x2e')](_0x379874);}};}function respondWithFilteredResult(_0x222f10,_0xed9f58){return function(_0x12a8ce){if(_0x12a8ce){var _0x1954ca=typeof _0xed9f58[_0x5223('0x2f')]===_0x5223('0x30')&&typeof _0xed9f58[_0x5223('0x31')]==='undefined';var _0x3cac75=_0x12a8ce[_0x5223('0x32')];var _0x3f571d=_0x1954ca?0x0:_0xed9f58['offset'];var _0x40ce98=_0x1954ca?_0x12a8ce[_0x5223('0x32')]:_0xed9f58[_0x5223('0x2f')]+_0xed9f58['limit'];var _0x36bd09;if(_0x40ce98>=_0x3cac75){_0x40ce98=_0x3cac75;_0x36bd09=0xc8;}else{_0x36bd09=0xce;}_0x222f10[_0x5223('0x2c')](_0x36bd09);return _0x222f10[_0x5223('0x33')]('Content-Range',_0x3f571d+'-'+_0x40ce98+'/'+_0x3cac75)[_0x5223('0x2e')](_0x12a8ce);}return null;};}function patchUpdates(_0x11c3d4){return function(_0x269447){try{jsonpatch[_0x5223('0x34')](_0x269447,_0x11c3d4,!![]);}catch(_0x20335d){return BPromise[_0x5223('0x35')](_0x20335d);}return _0x269447[_0x5223('0x36')]();};}function saveUpdates(_0x2f6451,_0x2369f3){return function(_0x89f5cb){if(_0x89f5cb){return _0x89f5cb['update'](_0x2f6451)[_0x5223('0x37')](function(_0x1f1c8c){return _0x1f1c8c;});}return null;};}function removeEntity(_0x23b12,_0x536091){return function(_0xa7c9ac){if(_0xa7c9ac){return _0xa7c9ac['destroy']()['then'](function(){var _0x500bd3=_0xa7c9ac[_0x5223('0x38')]({'plain':!![]});var _0x30bb26=_0x5223('0x39');return db[_0x5223('0x3a')]['destroy']({'where':{'type':_0x30bb26,'resourceId':_0x500bd3['id']}})['then'](function(){return _0xa7c9ac;});})[_0x5223('0x37')](function(){_0x23b12[_0x5223('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9799,_0xdafee4){return function(_0x5b2783){if(!_0x5b2783){_0x3c9799[_0x5223('0x2b')](0x194);}return _0x5b2783;};}function handleError(_0x43a7c9,_0x8424e3){_0x8424e3=_0x8424e3||0x1f4;return function(_0x47e16b){logger['error'](_0x47e16b[_0x5223('0x3b')]);if(_0x47e16b[_0x5223('0x3c')]){delete _0x47e16b[_0x5223('0x3c')];}_0x43a7c9[_0x5223('0x2c')](_0x8424e3)['send'](_0x47e16b);};}exports[_0x5223('0x3d')]=function(_0x745416,_0x4471cb){var _0x3dee59={'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]},_0x3752db={},_0x2ce5d9={'count':0x0,'rows':[]};var _0x53c1e2=_[_0x5223('0x40')](db[_0x5223('0x41')][_0x5223('0x42')],function(_0x5aeaa1){return{'name':_0x5aeaa1[_0x5223('0x43')],'type':_0x5aeaa1[_0x5223('0x44')][_0x5223('0x45')]};});_0x3752db['model']=_[_0x5223('0x40')](_0x53c1e2,_0x5223('0x3c'));_0x3752db[_0x5223('0x46')]=_['keys'](_0x745416[_0x5223('0x46')]);_0x3752db[_0x5223('0x47')]=_[_0x5223('0x48')](_0x3752db[_0x5223('0x49')],_0x3752db[_0x5223('0x46')]);_0x3dee59['attributes']=_[_0x5223('0x48')](_0x3752db[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x745416['query'][_0x5223('0x4a')]));_0x3dee59[_0x5223('0x4b')]=_0x3dee59[_0x5223('0x4b')][_0x5223('0x4c')]?_0x3dee59['attributes']:_0x3752db[_0x5223('0x49')];if(!_0x745416[_0x5223('0x46')][_0x5223('0x4d')](_0x5223('0x4e'))){_0x3dee59[_0x5223('0x31')]=qs['limit'](_0x745416[_0x5223('0x46')][_0x5223('0x31')]);_0x3dee59['offset']=qs['offset'](_0x745416['query'][_0x5223('0x2f')]);}_0x3dee59[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x745416[_0x5223('0x46')][_0x5223('0x50')]);_0x3dee59[_0x5223('0x51')]=qs[_0x5223('0x47')](_['pick'](_0x745416['query'],_0x3752db[_0x5223('0x47')]),_0x53c1e2);if(_0x745416[_0x5223('0x46')][_0x5223('0x52')]){_0x3dee59['where']=_[_0x5223('0x53')](_0x3dee59[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x53c1e2,function(_0x33f6fd){if(_0x33f6fd[_0x5223('0x44')]!==_0x5223('0x54')){var _0x5ab217={};_0x5ab217[_0x33f6fd[_0x5223('0x3c')]]={'$like':'%'+_0x745416[_0x5223('0x46')]['filter']+'%'};return _0x5ab217;}})});}_0x3dee59=_[_0x5223('0x53')]({},_0x3dee59,_0x745416[_0x5223('0x55')]);var _0x450e5d={'where':_0x3dee59[_0x5223('0x51')]};return db[_0x5223('0x41')][_0x5223('0x32')](_0x450e5d)[_0x5223('0x37')](function(_0x14107e){_0x2ce5d9[_0x5223('0x32')]=_0x14107e;if(_0x745416[_0x5223('0x46')][_0x5223('0x56')]){_0x3dee59[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x41')][_0x5223('0x58')](_0x3dee59);})['then'](function(_0x4a0c93){_0x2ce5d9[_0x5223('0x59')]=_0x4a0c93;return _0x2ce5d9;})[_0x5223('0x37')](respondWithFilteredResult(_0x4471cb,_0x3dee59))['catch'](handleError(_0x4471cb,null));};exports['show']=function(_0x7dbaa9,_0x585e7a){var _0x333ce9={'raw':![],'where':{'id':_0x7dbaa9[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]},_0x403384={};_0x403384[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x41')][_0x5223('0x42')]);_0x403384['query']=_[_0x5223('0x5b')](_0x7dbaa9[_0x5223('0x46')]);_0x403384[_0x5223('0x47')]=_[_0x5223('0x48')](_0x403384['model'],_0x403384[_0x5223('0x46')]);_0x333ce9[_0x5223('0x4b')]=_[_0x5223('0x48')](_0x403384[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x7dbaa9[_0x5223('0x46')][_0x5223('0x4a')]));_0x333ce9['attributes']=_0x333ce9[_0x5223('0x4b')][_0x5223('0x4c')]?_0x333ce9[_0x5223('0x4b')]:_0x403384[_0x5223('0x49')];if(_0x7dbaa9[_0x5223('0x46')][_0x5223('0x56')]){_0x333ce9[_0x5223('0x57')]=[{'all':!![]}];}_0x333ce9=_[_0x5223('0x53')]({},_0x333ce9,_0x7dbaa9[_0x5223('0x55')]);return db['WhatsappAccount']['find'](_0x333ce9)['then'](handleEntityNotFound(_0x585e7a,null))[_0x5223('0x37')](respondWithResult(_0x585e7a,null))[_0x5223('0x5c')](handleError(_0x585e7a,null));};exports[_0x5223('0x5d')]=function(_0x4d14a8,_0x499f4a){return db[_0x5223('0x41')]['create'](_0x4d14a8['body'],{})[_0x5223('0x37')](function(_0x34c584){var _0x14684a=_0x4d14a8[_0x5223('0x5e')][_0x5223('0x38')]({'plain':!![]});if(!_0x14684a)throw new Error(_0x5223('0x5f'));if(_0x14684a[_0x5223('0x60')]==='user'){var _0x145a63=_0x34c584[_0x5223('0x38')]({'plain':!![]});var _0x50cef4=_0x5223('0x39');return db['UserProfileSection'][_0x5223('0x61')]({'where':{'name':_0x50cef4,'userProfileId':_0x14684a[_0x5223('0x62')]},'raw':!![]})[_0x5223('0x37')](function(_0x3cc7fb){if(_0x3cc7fb&&_0x3cc7fb[_0x5223('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x145a63[_0x5223('0x3c')],'resourceId':_0x145a63['id'],'type':_0x3cc7fb[_0x5223('0x3c')],'sectionId':_0x3cc7fb['id']},{})[_0x5223('0x37')](function(){return _0x34c584;});}else{return _0x34c584;}})[_0x5223('0x5c')](function(_0x32e14c){logger[_0x5223('0x27')](_0x5223('0x64'),_0x32e14c);throw _0x32e14c;});}return _0x34c584;})['then'](respondWithResult(_0x499f4a,0xc9))['catch'](handleError(_0x499f4a,null));};exports[_0x5223('0x65')]=function(_0x113376,_0x3ea470){if(_0x113376['body']['id']){delete _0x113376[_0x5223('0x66')]['id'];}return db[_0x5223('0x41')]['find']({'where':{'id':_0x113376[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]})[_0x5223('0x37')](handleEntityNotFound(_0x3ea470,null))[_0x5223('0x37')](saveUpdates(_0x113376[_0x5223('0x66')],null))[_0x5223('0x37')](respondWithResult(_0x3ea470,null))[_0x5223('0x5c')](handleError(_0x3ea470,null));};exports[_0x5223('0x67')]=function(_0xdd50c0,_0x5e5301){return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0xdd50c0[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5e5301,null))[_0x5223('0x37')](removeEntity(_0x5e5301,null))[_0x5223('0x5c')](handleError(_0x5e5301,null));};exports[_0x5223('0x68')]=function(_0x1d874c,_0x3d7b12){return db[_0x5223('0x41')][_0x5223('0x68')]()[_0x5223('0x37')](respondWithResult(_0x3d7b12,null))[_0x5223('0x5c')](handleError(_0x3d7b12,null));};exports[_0x5223('0x69')]=function(_0x2eae99,_0x44c31d,_0x21c920){if(_0x2eae99[_0x5223('0x66')]['id']){delete _0x2eae99['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2eae99['params']['id']}})['then'](handleEntityNotFound(_0x44c31d,null))[_0x5223('0x37')](function(_0x506be0){if(_0x506be0){_0x2eae99['body']['WhatsappAccountId']=_0x506be0['id'];return db[_0x5223('0x6a')][_0x5223('0x5d')](_0x2eae99[_0x5223('0x66')]);}})[_0x5223('0x37')](respondWithResult(_0x44c31d,null))[_0x5223('0x5c')](handleError(_0x44c31d,null));};exports[_0x5223('0x6b')]=function(_0x5e7eb8,_0x5d0d68,_0x118847){var _0x305bef={'raw':![],'where':{}};var _0x389ce3={};var _0x1629db={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x5e7eb8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x5d0d68,null))[_0x5223('0x37')](function(_0x4727f3){if(_0x4727f3){_0x389ce3[_0x5223('0x49')]=_['keys'](db['Disposition'][_0x5223('0x42')]);_0x389ce3[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x5e7eb8['query']);_0x389ce3[_0x5223('0x47')]=_[_0x5223('0x48')](_0x389ce3[_0x5223('0x49')],_0x389ce3[_0x5223('0x46')]);_0x305bef['attributes']=_['intersection'](_0x389ce3[_0x5223('0x49')],qs['fields'](_0x5e7eb8[_0x5223('0x46')]['fields']));_0x305bef[_0x5223('0x4b')]=_0x305bef[_0x5223('0x4b')][_0x5223('0x4c')]?_0x305bef[_0x5223('0x4b')]:_0x389ce3[_0x5223('0x49')];if(!_0x5e7eb8['query']['hasOwnProperty'](_0x5223('0x4e'))){_0x305bef['limit']=qs['limit'](_0x5e7eb8[_0x5223('0x46')][_0x5223('0x31')]);_0x305bef[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x5e7eb8[_0x5223('0x46')][_0x5223('0x2f')]);}_0x305bef[_0x5223('0x4f')]=qs['sort'](_0x5e7eb8['query'][_0x5223('0x50')]);_0x305bef[_0x5223('0x51')]=qs[_0x5223('0x47')](_['pick'](_0x5e7eb8[_0x5223('0x46')],_0x389ce3[_0x5223('0x47')]));_0x305bef[_0x5223('0x51')][_0x5223('0x6d')]=_0x4727f3['id'];if(_0x5e7eb8[_0x5223('0x46')][_0x5223('0x52')]){_0x305bef[_0x5223('0x51')]=_[_0x5223('0x53')](_0x305bef[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x305bef['attributes'],function(_0x31a81a){var _0xaf2993={};_0xaf2993[_0x31a81a]={'$like':'%'+_0x5e7eb8[_0x5223('0x46')][_0x5223('0x52')]+'%'};return _0xaf2993;})});}_0x305bef=_['merge']({},_0x305bef,_0x5e7eb8[_0x5223('0x55')]);return db['Disposition'][_0x5223('0x32')]({'where':_0x305bef[_0x5223('0x51')]})[_0x5223('0x37')](function(_0x2d7fe1){_0x1629db['count']=_0x2d7fe1;if(_0x5e7eb8[_0x5223('0x46')][_0x5223('0x56')]){_0x305bef[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x6a')][_0x5223('0x58')](_0x305bef);})[_0x5223('0x37')](function(_0x156d4c){_0x1629db[_0x5223('0x59')]=_0x156d4c;return _0x1629db;});}})[_0x5223('0x37')](respondWithFilteredResult(_0x5d0d68,_0x305bef))['catch'](handleError(_0x5d0d68,null));};exports[_0x5223('0x6e')]=function(_0x50af89,_0x398e1f,_0x4b8135){return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x50af89[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x398e1f,null))[_0x5223('0x37')](function(_0x54a025){if(_0x54a025){return _0x54a025[_0x5223('0x6e')](_0x50af89[_0x5223('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x398e1f,null))[_0x5223('0x5c')](handleError(_0x398e1f,null));};exports[_0x5223('0x6f')]=function(_0x519be4,_0x59c6e2,_0x50f910){if(_0x519be4[_0x5223('0x66')]['id']){delete _0x519be4[_0x5223('0x66')]['id'];}return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x519be4[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x59c6e2,null))['then'](function(_0x43d294){if(_0x43d294){_0x519be4[_0x5223('0x66')][_0x5223('0x6d')]=_0x43d294['id'];return db[_0x5223('0x70')][_0x5223('0x5d')](_0x519be4['body']);}})[_0x5223('0x37')](respondWithResult(_0x59c6e2,null))['catch'](handleError(_0x59c6e2,null));};exports['getAnswers']=function(_0x128f31,_0x4aaa31,_0x327d55){var _0x564259={'raw':![],'where':{}};var _0x494408={};var _0x1472ef={'count':0x0,'rows':[]};return db[_0x5223('0x41')][_0x5223('0x6c')]({'where':{'id':_0x128f31[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x4aaa31,null))[_0x5223('0x37')](function(_0xe2bd50){if(_0xe2bd50){_0x494408[_0x5223('0x49')]=_['keys'](db[_0x5223('0x70')]['rawAttributes']);_0x494408[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x128f31['query']);_0x494408[_0x5223('0x47')]=_[_0x5223('0x48')](_0x494408['model'],_0x494408[_0x5223('0x46')]);_0x564259['attributes']=_[_0x5223('0x48')](_0x494408['model'],qs[_0x5223('0x4a')](_0x128f31[_0x5223('0x46')][_0x5223('0x4a')]));_0x564259[_0x5223('0x4b')]=_0x564259[_0x5223('0x4b')]['length']?_0x564259['attributes']:_0x494408[_0x5223('0x49')];if(!_0x128f31['query'][_0x5223('0x4d')](_0x5223('0x4e'))){_0x564259['limit']=qs[_0x5223('0x31')](_0x128f31[_0x5223('0x46')][_0x5223('0x31')]);_0x564259[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x128f31[_0x5223('0x46')]['offset']);}_0x564259['order']=qs[_0x5223('0x50')](_0x128f31['query']['sort']);_0x564259[_0x5223('0x51')]=qs['filters'](_[_0x5223('0x71')](_0x128f31['query'],_0x494408[_0x5223('0x47')]));_0x564259[_0x5223('0x51')][_0x5223('0x6d')]=_0xe2bd50['id'];if(_0x128f31[_0x5223('0x46')][_0x5223('0x52')]){_0x564259[_0x5223('0x51')]=_['merge'](_0x564259[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x564259[_0x5223('0x4b')],function(_0x348892){var _0x267b0f={};_0x267b0f[_0x348892]={'$like':'%'+_0x128f31[_0x5223('0x46')][_0x5223('0x52')]+'%'};return _0x267b0f;})});}_0x564259=_[_0x5223('0x53')]({},_0x564259,_0x128f31[_0x5223('0x55')]);return db[_0x5223('0x70')][_0x5223('0x32')]({'where':_0x564259[_0x5223('0x51')]})[_0x5223('0x37')](function(_0x2904f3){_0x1472ef['count']=_0x2904f3;if(_0x128f31['query'][_0x5223('0x56')]){_0x564259[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x70')][_0x5223('0x58')](_0x564259);})[_0x5223('0x37')](function(_0x1cdb3a){_0x1472ef['rows']=_0x1cdb3a;return _0x1472ef;});}})[_0x5223('0x37')](respondWithFilteredResult(_0x4aaa31,_0x564259))['catch'](handleError(_0x4aaa31,null));};exports[_0x5223('0x72')]=function(_0x1fcdc8,_0x1819f2,_0x23ee7d){return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x1fcdc8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x1819f2,null))[_0x5223('0x37')](function(_0x1653d9){if(_0x1653d9){return _0x1653d9[_0x5223('0x72')](_0x1fcdc8['query'][_0x5223('0x73')]);}})[_0x5223('0x37')](respondWithStatusCode(_0x1819f2,null))[_0x5223('0x5c')](handleError(_0x1819f2,null));};exports[_0x5223('0x74')]=function(_0x146a2,_0x493703,_0x1c3570){return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0x146a2[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x493703,null))[_0x5223('0x37')](function(_0x3cad4){if(_0x3cad4){return _0x3cad4[_0x5223('0x74')](_0x146a2['body'][_0x5223('0x73')],_[_0x5223('0x75')](_0x146a2['body'],[_0x5223('0x73'),'id'])||{})['spread'](function(_0x26512c){for(var _0x3d995a=0x0;_0x3d995a<_0x146a2[_0x5223('0x66')][_0x5223('0x73')][_0x5223('0x4c')];_0x3d995a+=0x1){socket['emit'](_0x5223('0x76'),{'UserId':Number(_0x146a2[_0x5223('0x66')]['ids'][_0x3d995a]),'WhatsappAccountId':Number(_0x146a2[_0x5223('0x5a')]['id'])});}return _0x26512c;});}})[_0x5223('0x37')](respondWithResult(_0x493703,null))['catch'](handleError(_0x493703,null));};exports[_0x5223('0x77')]=function(_0x2219a5,_0x24e769,_0x562e39){return db[_0x5223('0x41')]['find']({'where':{'id':_0x2219a5[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x24e769,null))[_0x5223('0x37')](function(_0xca426b){if(_0xca426b){return _0xca426b['removeAgents'](_0x2219a5[_0x5223('0x46')][_0x5223('0x73')])[_0x5223('0x37')](function(){if(_[_0x5223('0x78')](_0x2219a5[_0x5223('0x46')][_0x5223('0x73')])){for(var _0x585a0e=0x0;_0x585a0e<_0x2219a5['query'][_0x5223('0x73')][_0x5223('0x4c')];_0x585a0e+=0x1){socket['emit'](_0x5223('0x79'),{'UserId':Number(_0x2219a5[_0x5223('0x46')][_0x5223('0x73')][_0x585a0e]),'WhatsappAccountId':Number(_0x2219a5['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x2219a5[_0x5223('0x46')][_0x5223('0x73')]),'WhatsappAccountId':Number(_0x2219a5[_0x5223('0x5a')]['id'])});}});}})[_0x5223('0x37')](respondWithStatusCode(_0x24e769,null))[_0x5223('0x5c')](handleError(_0x24e769,null));};exports[_0x5223('0x7a')]=function(_0x12ac45,_0x12f406,_0x1aaa21){var _0x5a984d={};var _0x467d32={};var _0x28a53d;var _0x3f73b2;return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x12ac45[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x12f406,null))[_0x5223('0x37')](function(_0x24ed0e){if(_0x24ed0e){_0x28a53d=_0x24ed0e;_0x467d32[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x7b')][_0x5223('0x42')]);_0x467d32['query']=_[_0x5223('0x5b')](_0x12ac45['query']);_0x467d32[_0x5223('0x47')]=_[_0x5223('0x48')](_0x467d32['model'],_0x467d32[_0x5223('0x46')]);_0x5a984d['attributes']=_[_0x5223('0x48')](_0x467d32[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x12ac45[_0x5223('0x46')][_0x5223('0x4a')]));_0x5a984d['attributes']=_0x5a984d[_0x5223('0x4b')][_0x5223('0x4c')]?_0x5a984d[_0x5223('0x4b')]:_0x467d32['model'];_0x5a984d[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x12ac45[_0x5223('0x46')][_0x5223('0x50')]);_0x5a984d[_0x5223('0x51')]=qs[_0x5223('0x47')](_[_0x5223('0x71')](_0x12ac45[_0x5223('0x46')],_0x467d32[_0x5223('0x47')]));if(_0x12ac45[_0x5223('0x46')][_0x5223('0x52')]){_0x5a984d['where']=_[_0x5223('0x53')](_0x5a984d[_0x5223('0x51')],{'$or':_['map'](_0x5a984d['attributes'],function(_0x378b90){var _0xe23df7={};_0xe23df7[_0x378b90]={'$like':'%'+_0x12ac45[_0x5223('0x46')]['filter']+'%'};return _0xe23df7;})});}_0x5a984d=_[_0x5223('0x53')]({},_0x5a984d,_0x12ac45['options']);return _0x28a53d[_0x5223('0x7a')](_0x5a984d);}})[_0x5223('0x37')](function(_0x50a2e8){if(_0x50a2e8){_0x3f73b2=_0x50a2e8[_0x5223('0x4c')];if(!_0x12ac45['query'][_0x5223('0x4d')](_0x5223('0x4e'))){_0x5a984d[_0x5223('0x31')]=qs[_0x5223('0x31')](_0x12ac45[_0x5223('0x46')][_0x5223('0x31')]);_0x5a984d['offset']=qs[_0x5223('0x2f')](_0x12ac45['query'][_0x5223('0x2f')]);}return _0x28a53d[_0x5223('0x7a')](_0x5a984d);}})[_0x5223('0x37')](function(_0x2a37d9){if(_0x2a37d9){return _0x2a37d9?{'count':_0x3f73b2,'rows':_0x2a37d9}:null;}})['then'](respondWithResult(_0x12f406,null))[_0x5223('0x5c')](handleError(_0x12f406,null));};exports[_0x5223('0x7c')]=function(_0x25cf09,_0x49ea64){var _0x4dc732=_0x25cf09['params']['id'];var _0x53c096=_0x25cf09[_0x5223('0x66')];var _0x2201a1=0xc8;var _0x5332a8=null;return db[_0x5223('0x7d')][_0x5223('0x7e')]({'isolationLevel':db[_0x5223('0x7d')]['Transaction'][_0x5223('0x7f')][_0x5223('0x80')]},function(_0x258684){return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x4dc732},'transaction':_0x258684})[_0x5223('0x37')](function(_0x417558){if(_0x417558){return db['WhatsappApplication'][_0x5223('0x67')]({'where':{'WhatsappAccountId':_0x4dc732},'transaction':_0x258684})['then'](function(){var _0x1ddcda=_[_0x5223('0x40')](_0x53c096,function(_0x4a81c9){_0x4a81c9['WhatsappAccountId']=_0x4dc732;return _0x4a81c9;});return db['WhatsappApplication'][_0x5223('0x81')](_0x1ddcda,{'transaction':_0x258684});});}else{_0x2201a1=0x194;_0x5332a8=[];}});})['then'](function(){if(_0x2201a1!==0x194){return db[_0x5223('0x82')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4dc732},'order':_0x5223('0x83')})[_0x5223('0x37')](function(_0x29b3e0){_0x5332a8=_0x29b3e0;});}})[_0x5223('0x5c')](function(_0x2c21aa){_0x2201a1=0x1f4;logger[_0x5223('0x27')](_0x2c21aa['stack']);if(_0x2c21aa[_0x5223('0x3c')]){delete _0x2c21aa[_0x5223('0x3c')];}_0x5332a8=_0x2c21aa;})[_0x5223('0x84')](function(){if(_0x5332a8===null){_0x49ea64[_0x5223('0x2b')](_0x2201a1);}else{if(_0x2201a1===0x1f4){_0x49ea64[_0x5223('0x2c')](_0x2201a1)['send'](_0x5332a8);}else{_0x49ea64[_0x5223('0x2c')](_0x2201a1)[_0x5223('0x2e')](_0x5332a8);}}});};exports[_0x5223('0x85')]=function(_0x5091e8,_0x47a5a9,_0x4f4217){var _0x4a68b9={};var _0xaab9ae={};var _0x1a818d;var _0x248b4c;return db[_0x5223('0x41')][_0x5223('0x6c')]({'where':{'id':_0x5091e8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x47a5a9,null))[_0x5223('0x37')](function(_0x481168){if(_0x481168){_0x1a818d=_0x481168;_0xaab9ae[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x82')][_0x5223('0x42')]);_0xaab9ae[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x5091e8[_0x5223('0x46')]);_0xaab9ae[_0x5223('0x47')]=_['intersection'](_0xaab9ae['model'],_0xaab9ae[_0x5223('0x46')]);_0x4a68b9['attributes']=_[_0x5223('0x48')](_0xaab9ae['model'],qs[_0x5223('0x4a')](_0x5091e8[_0x5223('0x46')][_0x5223('0x4a')]));_0x4a68b9[_0x5223('0x4b')]=_0x4a68b9['attributes'][_0x5223('0x4c')]?_0x4a68b9[_0x5223('0x4b')]:_0xaab9ae[_0x5223('0x49')];_0x4a68b9[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x5091e8[_0x5223('0x46')]['sort']);_0x4a68b9[_0x5223('0x51')]=qs[_0x5223('0x47')](_[_0x5223('0x71')](_0x5091e8[_0x5223('0x46')],_0xaab9ae[_0x5223('0x47')]));if(_0x5091e8[_0x5223('0x46')]['filter']){_0x4a68b9[_0x5223('0x51')]=_['merge'](_0x4a68b9['where'],{'$or':_['map'](_0x4a68b9[_0x5223('0x4b')],function(_0x33ce54){var _0x440c7a={};_0x440c7a[_0x33ce54]={'$like':'%'+_0x5091e8['query'][_0x5223('0x52')]+'%'};return _0x440c7a;})});}_0x4a68b9=_[_0x5223('0x53')]({},_0x4a68b9,_0x5091e8['options']);return _0x1a818d[_0x5223('0x85')](_0x4a68b9);}})[_0x5223('0x37')](function(_0x5437b7){if(_0x5437b7){_0x248b4c=_0x5437b7[_0x5223('0x4c')];if(!_0x5091e8[_0x5223('0x46')][_0x5223('0x4d')](_0x5223('0x4e'))){_0x4a68b9[_0x5223('0x31')]=qs[_0x5223('0x31')](_0x5091e8[_0x5223('0x46')][_0x5223('0x31')]);_0x4a68b9[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x5091e8[_0x5223('0x46')]['offset']);}return _0x1a818d['getApplications'](_0x4a68b9);}})[_0x5223('0x37')](function(_0xd8004b){if(_0xd8004b){return _0xd8004b?{'count':_0x248b4c,'rows':_0xd8004b}:null;}})[_0x5223('0x37')](respondWithResult(_0x47a5a9,null))['catch'](handleError(_0x47a5a9,null));};exports[_0x5223('0x86')]=function(_0x1ebc1b,_0x1759e0,_0x258599){var _0x29b355={'channel':_0x5223('0x87')};var _0xd6bbd6=[];var _0x20d712=[];var _0x5d111e={};return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0x1ebc1b[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x82')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1759e0,null))[_0x5223('0x37')](function(_0x533f0f){_0x29b355[_0x5223('0x88')]=_0x533f0f;if(_0x29b355[_0x5223('0x88')]&&_0x29b355[_0x5223('0x88')]['type']===_0x5223('0x89')&&_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')]){if(_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][_0x5223('0x4c')]===0x0)return;if(_0x1ebc1b[_0x5223('0x66')]['statuses'][0x0][_0x5223('0x8b')]!==_0x5223('0x8c'))return;return db[_0x5223('0x8d')][_0x5223('0x65')]({'read':!![],'readAt':_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][0x0][_0x5223('0x8e')]},{'where':{'messageId':_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][0x0][_0x5223('0x8f')]},'individualHooks':!![]})[_0x5223('0x37')](function(_0x547e5e){return _0x1759e0['status'](0xc8)['json'](_0x547e5e);});}_0x29b355['applications']=_[_0x5223('0x90')](_0x533f0f[_0x5223('0x91')],[_0x5223('0x83')],[_0x5223('0x92')]);if(_0x29b355[_0x5223('0x88')][_0x5223('0x91')]){delete _0x29b355[_0x5223('0x88')]['Applications'];}return db[_0x5223('0x93')][_0x5223('0x68')]()[_0x5223('0x37')](function(_0x4830c4){if(!_0x4830c4){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))]('no\x20available\x20attributes');}_0xd6bbd6=_[_0x5223('0x96')](_[_0x5223('0x5b')](_0x4830c4),[_0x5223('0x97'),_0x5223('0x98')]);_0x20d712=_[_0x5223('0x96')](_[_0x5223('0x5b')](_0x4830c4),[_0x5223('0x97'),_0x5223('0x98'),_0x5223('0x99'),_0x5223('0x9a')]);_0x29b355[_0x5223('0x66')]={'mapKey':'mobile'};if(_0x29b355['account']&&_0x29b355[_0x5223('0x88')][_0x5223('0x44')]===_0x5223('0x9b')){_0x29b355['body']['from']=_0x1ebc1b[_0x5223('0x66')][_0x5223('0x9c')]['replace'](_0x5223('0x9d'),'');_0x29b355[_0x5223('0x66')][_0x5223('0x66')]=_0x1ebc1b[_0x5223('0x66')]['Body'];_0x29b355['body']['messageId']=_0x1ebc1b['body'][_0x5223('0x9e')];}if(_0x29b355[_0x5223('0x88')]&&_0x29b355['account'][_0x5223('0x44')]==='sinch'){_0x29b355['body'][_0x5223('0x9f')]=_0x1ebc1b[_0x5223('0x66')][_0x5223('0xa0')][0x0][_0x5223('0x9f')];_0x29b355[_0x5223('0x66')][_0x5223('0x66')]=_0x1ebc1b[_0x5223('0x66')]['notifications'][0x0][_0x5223('0x29')]['body'];_0x29b355[_0x5223('0x66')][_0x5223('0xa1')]=_0x1ebc1b[_0x5223('0x66')]['notifications'][0x0][_0x5223('0x8f')];}if(_0x29b355[_0x5223('0x66')]['id']){delete _0x29b355[_0x5223('0x66')]['id'];}if(_['isNil'](_0x29b355[_0x5223('0x66')]['from'])){throw new db[(_0x5223('0x94'))]['ValidationError'](_0x5223('0xa2'));}if(_[_0x5223('0xa3')](_0x29b355['body'][_0x5223('0x66')])||_0x29b355[_0x5223('0x66')][_0x5223('0x66')]===''){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xa4'));}if(_['isNil'](_0x29b355[_0x5223('0x66')]['mapKey'])){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xa5')+_0x20d712);}if(!_[_0x5223('0xa6')](_0x20d712,_0x29b355[_0x5223('0x66')][_0x5223('0xa7')])){throw new db[(_0x5223('0x94'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20d712);}_0x5d111e[_0x29b355[_0x5223('0x66')][_0x5223('0xa7')]]=_0x29b355[_0x5223('0x66')][_0x5223('0x9f')];return db[_0x5223('0xa8')][_0x5223('0x61')]({'where':{'id':_0x29b355[_0x5223('0x88')][_0x5223('0x9a')]},'include':[{'model':db[_0x5223('0x93')],'as':'Contacts','where':_0x5d111e,'limit':0x1,'order':[['updatedAt',_0x5223('0xa9')]]}]});})[_0x5223('0x37')](handleEntityNotFound(_0x1759e0,null))[_0x5223('0x37')](function(_0x25c8db){if(_0x25c8db){_0x29b355[_0x5223('0xaa')]=_[_0x5223('0x75')](_0x25c8db,[_0x5223('0xab')]);if(_0x25c8db[_0x5223('0xab')][_0x5223('0x4c')]){return _0x25c8db[_0x5223('0xab')][0x0];}var _0x10e834=_[_0x5223('0xac')](_0x29b355[_0x5223('0x66')],{'firstName':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'ListId':_0x25c8db['id']});_0x10e834[_0x29b355[_0x5223('0x66')]['mapKey']]=_0x29b355[_0x5223('0x66')][_0x5223('0x9f')];return db[_0x5223('0x93')][_0x5223('0x5d')](_0x10e834,{'fields':_0xd6bbd6,'raw':!![]});}})[_0x5223('0x37')](handleEntityNotFound(_0x1759e0,null))['then'](function(_0x27e291){if(_0x27e291){_0x29b355[_0x5223('0xad')]=_0x27e291;var _0x2d8158={'ContactId':_0x27e291['id'],'phone':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id']};var _0x7f15c1={'ContactId':_0x27e291['id'],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id'],'closed':![]};return db[_0x5223('0xae')][_0x5223('0x61')]({'where':_0x7f15c1})['then'](function(_0x3fcde4){if(_0x3fcde4){return[_0x3fcde4,![]];}return db[_0x5223('0xae')]['create'](_0x2d8158)[_0x5223('0x37')](function(_0x55af5d){return[_0x55af5d,!![]];});});}})[_0x5223('0xaf')](function(_0xbb4d4d,_0x4d93bb){_0x29b355['interaction']=_0xbb4d4d['get']({'plain':!![]});_0x29b355[_0x5223('0xb0')][_0x5223('0xb1')]=![];if(_0x4d93bb){if(_0x29b355[_0x5223('0x88')][_0x5223('0xb2')]){_0x29b355['applications'][_0x5223('0xb3')]({'id':0x0,'priority':_0x29b355[_0x5223('0xb4')][_0x5223('0x4c')]+0x1,'app':'close','appdata':_0x5223('0xb5'),'interval':'*,*,*,*'});}_0x29b355[_0x5223('0xb0')]['created']=!![];}return db[_0x5223('0x8d')][_0x5223('0x5d')]({'phone':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'messageId':_0x29b355[_0x5223('0x66')][_0x5223('0xa1')],'body':_0x29b355[_0x5223('0x66')][_0x5223('0x66')],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id'],'WhatsappInteractionId':_0xbb4d4d['id'],'direction':'in','ContactId':_0xbb4d4d[_0x5223('0xb6')],'AttachmentId':_0x29b355['body']['AttachmentId']});})[_0x5223('0x37')](function(_0x108f5a){_0x29b355[_0x5223('0x29')]=_0x108f5a;if(_0x29b355['interaction'][_0x5223('0xb7')]){return db['User']['find']({'attributes':['id',_0x5223('0x3c')],'where':{'id':_0x29b355[_0x5223('0xb0')]['UserId']}})[_0x5223('0x37')](function(_0xb52eae){if(_0xb52eae){_0x29b355['applications'][_0x5223('0xb8')]({'id':0x0,'priority':0x0,'app':_0x5223('0xb9'),'appdata':_0xb52eae['name']+','+(_0x29b355['account'][_0x5223('0xba')]||0xa),'interval':_0x5223('0xbb')});}return respondWithRpcPromise(_0x5223('0xbc'),'startRouting',_0x29b355);});}return respondWithRpcPromise(_0x5223('0xbc'),_0x5223('0xbd'),_0x29b355);})[_0x5223('0x37')](function(_0x16684e){if(_0x16684e){var _0x5f39b9=0xc8;var _0x16d275='receiveMessage';logger[_0x5223('0x21')](_0x5223('0x25'),_0x16d275,_0x5f39b9,_0x5223('0xbe'));logger['debug'](_0x5223('0xbf'),_0x16d275,_0x5f39b9,_0x5223('0xbe'),JSON[_0x5223('0x26')](_0x16684e));if(_0x29b355[_0x5223('0x88')][_0x5223('0x44')]===_0x5223('0x9b')){return _0x1759e0['status'](_0x5f39b9)[_0x5223('0x33')](_0x5223('0xc0'),_0x5223('0xc1'))[_0x5223('0xc2')](_0x5223('0xc3'));}else{return _0x1759e0['status'](_0x5f39b9)[_0x5223('0x2e')](_0x16684e);}}});})[_0x5223('0x5c')](handleError(_0x1759e0,null));};exports['send']=function(_0x22d87c,_0x625687,_0x42f706){var _0x3f7dad,_0x4de6d9,_0x4756a;if(_[_0x5223('0xa3')](_0x22d87c[_0x5223('0x66')][_0x5223('0x66')])||_0x22d87c['body'][_0x5223('0x66')]===''){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x22d87c[_0x5223('0x66')]['to'])){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xc4'));}_0x3f7dad=_0x22d87c[_0x5223('0x66')]['to'];return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x22d87c[_0x5223('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x5223('0xc5'),'include':[{'model':db[_0x5223('0x93')],'as':_0x5223('0xab'),'where':{'mobile':_0x3f7dad},'limit':0x1,'order':[[_0x5223('0x98'),_0x5223('0xa9')]]}]}]})[_0x5223('0x37')](handleEntityNotFound(_0x625687,null))[_0x5223('0x37')](function(_0x47105c){if(_0x47105c&&_0x47105c[_0x5223('0xc5')]){_0x4de6d9=_0x47105c[_0x5223('0x38')]({'plain':!![]});if(_0x4de6d9['List']&&_0x4de6d9[_0x5223('0xc5')][_0x5223('0xab')][_0x5223('0x4c')]){return _0x4de6d9[_0x5223('0xc5')][_0x5223('0xab')][0x0];}return db[_0x5223('0x93')][_0x5223('0x5d')](_[_0x5223('0xac')](_0x22d87c['body'],{'firstName':_0x3f7dad,'mobile':_0x3f7dad,'phone':_0x3f7dad,'ListId':_0x4de6d9['ListId']}));}})[_0x5223('0x37')](handleEntityNotFound(_0x625687,null))[_0x5223('0x37')](function(_0x2c732d){if(_0x2c732d){_0x4756a=_0x2c732d;return db['WhatsappInteraction'][_0x5223('0x61')]({'where':{'ContactId':_0x4756a['id'],'closed':![],'WhatsappAccountId':_0x4de6d9['id']}})['then'](function(_0x189f45){if(_0x189f45){return[_0x189f45,![]];}return db[_0x5223('0xae')][_0x5223('0x5d')]({'UserId':_0x22d87c['user']['id'],'ContactId':_0x4756a['id'],'WhatsappAccountId':_0x4de6d9['id'],'phone':_0x3f7dad,'firstMsgDirection':_0x5223('0xc6'),'Messages':[_['merge'](_0x22d87c[_0x5223('0x66')],{'read':![],'body':_0x22d87c['body']['body'],'phone':_0x3f7dad,'WhatsappAccountId':_0x4de6d9['id'],'UserId':_0x22d87c[_0x5223('0x5e')]['id'],'ContactId':_0x4756a['id']})]},{'include':[{'model':db[_0x5223('0x8d')],'as':_0x5223('0xc7')}]})[_0x5223('0x37')](function(_0x39528d){return[_0x39528d,!![]];});});}})['spread'](function(_0x2d8910,_0x50c8c5){if(_0x50c8c5){return _0x2d8910;}return db[_0x5223('0x8d')][_0x5223('0x5d')](_[_0x5223('0x53')](_0x22d87c['body'],{'read':![],'body':_0x22d87c['body']['body'],'phone':_0x3f7dad,'WhatsappAccountId':_0x4de6d9['id'],'WhatsappInteractionId':_0x2d8910['id'],'UserId':_0x22d87c[_0x5223('0x5e')]['id'],'ContactId':_0x4756a['id']}))[_0x5223('0x37')](function(_0x55d0ab){_0x2d8910[_0x5223('0xc8')][_0x5223('0xc7')]=[];_0x2d8910[_0x5223('0xc8')]['Messages']['push'](_0x55d0ab[_0x5223('0xc8')]);return _0x2d8910;});})[_0x5223('0x37')](respondWithResult(_0x625687,null))['catch'](handleError(_0x625687,null));}; \ No newline at end of file +var _0x8c44=['then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','WhatsappAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','mandatoryDispositionPause','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addAgents','omit','spread','removeAgents','emit','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','hasOwnProperty','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','http'];(function(_0x5773f5,_0x5d8c42){var _0x437123=function(_0xc93762){while(--_0xc93762){_0x5773f5['push'](_0x5773f5['shift']());}};_0x437123(++_0x5d8c42);}(_0x8c44,0x167));var _0x48c4=function(_0x53a456,_0x1c3d73){_0x53a456=_0x53a456-0x0;var _0x19bf77=_0x8c44[_0x53a456];return _0x19bf77;};'use strict';var emlformat=require(_0x48c4('0x0'));var rimraf=require(_0x48c4('0x1'));var zipdir=require(_0x48c4('0x2'));var jsonpatch=require(_0x48c4('0x3'));var rp=require('request-promise');var moment=require(_0x48c4('0x4'));var BPromise=require(_0x48c4('0x5'));var Mustache=require(_0x48c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x48c4('0x7'));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('squel');var crypto=require(_0x48c4('0x8'));var jsforce=require(_0x48c4('0x9'));var deskjs=require(_0x48c4('0xa'));var toCsv=require(_0x48c4('0xb'));var querystring=require(_0x48c4('0xc'));var Papa=require(_0x48c4('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x48c4('0xe'));var as=require(_0x48c4('0xf'));var hardwareService=require(_0x48c4('0x10'));var logger=require('../../config/logger')(_0x48c4('0x11'));var utils=require('../../config/utils');var config=require(_0x48c4('0x12'));var licenseUtil=require(_0x48c4('0x13'));var db=require(_0x48c4('0x14'))['db'];config[_0x48c4('0x15')]=_[_0x48c4('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x48c4('0x17')](socket);var jayson=require(_0x48c4('0x18'));var client=jayson[_0x48c4('0x19')][_0x48c4('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x48208e,_0x5686b6,_0x35dfa4,_0x5528eb){return new BPromise(function(_0x1a6fc4,_0x4de69a){var _0x3822c4=_0x5528eb||client;return _0x3822c4['request'](_0x48208e,_0x35dfa4)[_0x48c4('0x1b')](function(_0x18ce4c){logger[_0x48c4('0x1c')]('WhatsappAccount,\x20%s,\x20%s',_0x5686b6,'request\x20sent');logger[_0x48c4('0x1d')](_0x48c4('0x1e'),_0x5686b6,_0x48c4('0x1f'),JSON[_0x48c4('0x20')](_0x18ce4c));if(_0x18ce4c[_0x48c4('0x21')]){if(_0x18ce4c[_0x48c4('0x21')][_0x48c4('0x22')]===0x1f4){logger[_0x48c4('0x21')](_0x48c4('0x23'),_0x5686b6,_0x18ce4c[_0x48c4('0x21')][_0x48c4('0x24')]);return _0x4de69a(_0x18ce4c['error'][_0x48c4('0x24')]);}logger[_0x48c4('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x5686b6,_0x18ce4c['error'][_0x48c4('0x24')]);return _0x1a6fc4(_0x18ce4c['error'][_0x48c4('0x24')]);}else{logger[_0x48c4('0x1c')](_0x48c4('0x23'),_0x5686b6,_0x48c4('0x1f'));_0x1a6fc4(_0x18ce4c[_0x48c4('0x25')][_0x48c4('0x24')]);}})[_0x48c4('0x26')](function(_0x23d9f5){logger[_0x48c4('0x21')](_0x48c4('0x23'),_0x5686b6,_0x23d9f5);_0x4de69a(_0x23d9f5);});});}function respondWithStatusCode(_0x3177fd,_0x367b1e){_0x367b1e=_0x367b1e||0xcc;return function(_0x2e1934){if(_0x2e1934){return _0x3177fd[_0x48c4('0x27')](_0x367b1e);}return _0x3177fd[_0x48c4('0x28')](_0x367b1e)['end']();};}function respondWithResult(_0x1fb187,_0x34c2a5){_0x34c2a5=_0x34c2a5||0xc8;return function(_0x306b0b){if(_0x306b0b){return _0x1fb187[_0x48c4('0x28')](_0x34c2a5)['json'](_0x306b0b);}};}function respondWithFilteredResult(_0x5da01d,_0x3d10c2){return function(_0x394a5f){if(_0x394a5f){var _0x515d0a=typeof _0x3d10c2[_0x48c4('0x29')]===_0x48c4('0x2a')&&typeof _0x3d10c2[_0x48c4('0x2b')]===_0x48c4('0x2a');var _0x37ba2d=_0x394a5f[_0x48c4('0x2c')];var _0x2cfcb7=_0x515d0a?0x0:_0x3d10c2[_0x48c4('0x29')];var _0x533faa=_0x515d0a?_0x394a5f['count']:_0x3d10c2['offset']+_0x3d10c2['limit'];var _0x400b54;if(_0x533faa>=_0x37ba2d){_0x533faa=_0x37ba2d;_0x400b54=0xc8;}else{_0x400b54=0xce;}_0x5da01d[_0x48c4('0x28')](_0x400b54);return _0x5da01d[_0x48c4('0x2d')](_0x48c4('0x2e'),_0x2cfcb7+'-'+_0x533faa+'/'+_0x37ba2d)['json'](_0x394a5f);}return null;};}function patchUpdates(_0x4cda58){return function(_0x14e912){try{jsonpatch[_0x48c4('0x2f')](_0x14e912,_0x4cda58,!![]);}catch(_0x1a9cd4){return BPromise[_0x48c4('0x30')](_0x1a9cd4);}return _0x14e912[_0x48c4('0x31')]();};}function saveUpdates(_0x27c3d4,_0x538efb){return function(_0x3afcd0){if(_0x3afcd0){return _0x3afcd0[_0x48c4('0x32')](_0x27c3d4)[_0x48c4('0x1b')](function(_0xaf6490){return _0xaf6490;});}return null;};}function removeEntity(_0x110ae3,_0x1a5daa){return function(_0x41475b){if(_0x41475b){return _0x41475b['destroy']()['then'](function(){var _0x5e0beb=_0x41475b['get']({'plain':!![]});var _0x4b7dc0=_0x48c4('0x33');return db[_0x48c4('0x34')][_0x48c4('0x35')]({'where':{'type':_0x4b7dc0,'resourceId':_0x5e0beb['id']}})[_0x48c4('0x1b')](function(){return _0x41475b;});})[_0x48c4('0x1b')](function(){_0x110ae3['status'](0xcc)[_0x48c4('0x36')]();});}};}function handleEntityNotFound(_0x280a2e,_0x230966){return function(_0x1334cc){if(!_0x1334cc){_0x280a2e[_0x48c4('0x27')](0x194);}return _0x1334cc;};}function handleError(_0x280ba1,_0x4e7f1f){_0x4e7f1f=_0x4e7f1f||0x1f4;return function(_0x9182ae){logger['error'](_0x9182ae[_0x48c4('0x37')]);if(_0x9182ae[_0x48c4('0x38')]){delete _0x9182ae[_0x48c4('0x38')];}_0x280ba1[_0x48c4('0x28')](_0x4e7f1f)[_0x48c4('0x39')](_0x9182ae);};}exports[_0x48c4('0x3a')]=function(_0x3e2fd1,_0x310f9b){var _0x17b7a1={'include':[{'model':db[_0x48c4('0x3b')],'as':'mandatoryDispositionPause'}]},_0x5846dc={},_0x478a8e={'count':0x0,'rows':[]};var _0x451936=_[_0x48c4('0x3c')](db[_0x48c4('0x3d')][_0x48c4('0x3e')],function(_0x511db0){return{'name':_0x511db0['fieldName'],'type':_0x511db0[_0x48c4('0x3f')][_0x48c4('0x40')]};});_0x5846dc[_0x48c4('0x41')]=_['map'](_0x451936,_0x48c4('0x38'));_0x5846dc['query']=_[_0x48c4('0x42')](_0x3e2fd1[_0x48c4('0x43')]);_0x5846dc[_0x48c4('0x44')]=_[_0x48c4('0x45')](_0x5846dc['model'],_0x5846dc['query']);_0x17b7a1[_0x48c4('0x46')]=_['intersection'](_0x5846dc[_0x48c4('0x41')],qs[_0x48c4('0x47')](_0x3e2fd1['query']['fields']));_0x17b7a1[_0x48c4('0x46')]=_0x17b7a1[_0x48c4('0x46')][_0x48c4('0x48')]?_0x17b7a1['attributes']:_0x5846dc[_0x48c4('0x41')];if(!_0x3e2fd1[_0x48c4('0x43')]['hasOwnProperty'](_0x48c4('0x49'))){_0x17b7a1[_0x48c4('0x2b')]=qs[_0x48c4('0x2b')](_0x3e2fd1[_0x48c4('0x43')]['limit']);_0x17b7a1['offset']=qs[_0x48c4('0x29')](_0x3e2fd1['query'][_0x48c4('0x29')]);}_0x17b7a1[_0x48c4('0x4a')]=qs[_0x48c4('0x4b')](_0x3e2fd1[_0x48c4('0x43')]['sort']);_0x17b7a1[_0x48c4('0x4c')]=qs[_0x48c4('0x44')](_[_0x48c4('0x4d')](_0x3e2fd1[_0x48c4('0x43')],_0x5846dc['filters']),_0x451936);if(_0x3e2fd1[_0x48c4('0x43')][_0x48c4('0x4e')]){_0x17b7a1[_0x48c4('0x4c')]=_[_0x48c4('0x4f')](_0x17b7a1[_0x48c4('0x4c')],{'$or':_[_0x48c4('0x3c')](_0x451936,function(_0x40fef9){if(_0x40fef9[_0x48c4('0x3f')]!==_0x48c4('0x50')){var _0x4e9665={};_0x4e9665[_0x40fef9[_0x48c4('0x38')]]={'$like':'%'+_0x3e2fd1['query'][_0x48c4('0x4e')]+'%'};return _0x4e9665;}})});}_0x17b7a1=_[_0x48c4('0x4f')]({},_0x17b7a1,_0x3e2fd1[_0x48c4('0x51')]);var _0x4c7b25={'where':_0x17b7a1[_0x48c4('0x4c')]};return db[_0x48c4('0x3d')]['count'](_0x4c7b25)[_0x48c4('0x1b')](function(_0x4fb348){_0x478a8e[_0x48c4('0x2c')]=_0x4fb348;if(_0x3e2fd1[_0x48c4('0x43')][_0x48c4('0x52')]){_0x17b7a1[_0x48c4('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x48c4('0x54')](_0x17b7a1);})[_0x48c4('0x1b')](function(_0x3cdbe9){_0x478a8e['rows']=_0x3cdbe9;return _0x478a8e;})[_0x48c4('0x1b')](respondWithFilteredResult(_0x310f9b,_0x17b7a1))[_0x48c4('0x26')](handleError(_0x310f9b,null));};exports[_0x48c4('0x55')]=function(_0x5f42c3,_0x3cf8ef){var _0xd8d428={'raw':![],'where':{'id':_0x5f42c3[_0x48c4('0x56')]['id']},'include':[{'model':db[_0x48c4('0x3b')],'as':_0x48c4('0x57')}]},_0x35c62c={};_0x35c62c['model']=_['keys'](db[_0x48c4('0x3d')][_0x48c4('0x3e')]);_0x35c62c[_0x48c4('0x43')]=_[_0x48c4('0x42')](_0x5f42c3[_0x48c4('0x43')]);_0x35c62c[_0x48c4('0x44')]=_[_0x48c4('0x45')](_0x35c62c[_0x48c4('0x41')],_0x35c62c[_0x48c4('0x43')]);_0xd8d428[_0x48c4('0x46')]=_[_0x48c4('0x45')](_0x35c62c[_0x48c4('0x41')],qs[_0x48c4('0x47')](_0x5f42c3['query'][_0x48c4('0x47')]));_0xd8d428[_0x48c4('0x46')]=_0xd8d428[_0x48c4('0x46')][_0x48c4('0x48')]?_0xd8d428[_0x48c4('0x46')]:_0x35c62c['model'];if(_0x5f42c3[_0x48c4('0x43')][_0x48c4('0x52')]){_0xd8d428['include']=[{'all':!![]}];}_0xd8d428=_['merge']({},_0xd8d428,_0x5f42c3[_0x48c4('0x51')]);return db[_0x48c4('0x3d')]['find'](_0xd8d428)['then'](handleEntityNotFound(_0x3cf8ef,null))[_0x48c4('0x1b')](respondWithResult(_0x3cf8ef,null))[_0x48c4('0x26')](handleError(_0x3cf8ef,null));};exports[_0x48c4('0x58')]=function(_0x42f225,_0x1f9b29){return db[_0x48c4('0x3d')][_0x48c4('0x58')](_0x42f225[_0x48c4('0x59')],{})['then'](function(_0x16e6eb){var _0x28f203=_0x42f225[_0x48c4('0x5a')][_0x48c4('0x5b')]({'plain':!![]});if(!_0x28f203)throw new Error(_0x48c4('0x5c'));if(_0x28f203['role']===_0x48c4('0x5a')){var _0x1e46d6=_0x16e6eb[_0x48c4('0x5b')]({'plain':!![]});var _0x5a6631=_0x48c4('0x33');return db['UserProfileSection'][_0x48c4('0x5d')]({'where':{'name':_0x5a6631,'userProfileId':_0x28f203[_0x48c4('0x5e')]},'raw':!![]})[_0x48c4('0x1b')](function(_0x53ddde){if(_0x53ddde&&_0x53ddde['autoAssociation']===0x0){return db[_0x48c4('0x34')]['create']({'name':_0x1e46d6[_0x48c4('0x38')],'resourceId':_0x1e46d6['id'],'type':_0x53ddde[_0x48c4('0x38')],'sectionId':_0x53ddde['id']},{})[_0x48c4('0x1b')](function(){return _0x16e6eb;});}else{return _0x16e6eb;}})[_0x48c4('0x26')](function(_0x512814){logger[_0x48c4('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x512814);throw _0x512814;});}return _0x16e6eb;})[_0x48c4('0x1b')](respondWithResult(_0x1f9b29,0xc9))[_0x48c4('0x26')](handleError(_0x1f9b29,null));};exports[_0x48c4('0x32')]=function(_0x1f8045,_0x5fde34){if(_0x1f8045[_0x48c4('0x59')]['id']){delete _0x1f8045['body']['id'];}return db[_0x48c4('0x3d')][_0x48c4('0x5d')]({'where':{'id':_0x1f8045['params']['id']},'include':[{'model':db[_0x48c4('0x3b')],'as':_0x48c4('0x57')}]})[_0x48c4('0x1b')](handleEntityNotFound(_0x5fde34,null))[_0x48c4('0x1b')](saveUpdates(_0x1f8045[_0x48c4('0x59')],null))[_0x48c4('0x1b')](respondWithResult(_0x5fde34,null))[_0x48c4('0x26')](handleError(_0x5fde34,null));};exports['destroy']=function(_0x52e050,_0x520ec4){return db['WhatsappAccount'][_0x48c4('0x5d')]({'where':{'id':_0x52e050['params']['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x520ec4,null))['then'](removeEntity(_0x520ec4,null))[_0x48c4('0x26')](handleError(_0x520ec4,null));};exports[_0x48c4('0x5f')]=function(_0x1dd620,_0x2e422b){return db[_0x48c4('0x3d')][_0x48c4('0x5f')]()[_0x48c4('0x1b')](respondWithResult(_0x2e422b,null))['catch'](handleError(_0x2e422b,null));};exports[_0x48c4('0x60')]=function(_0x2097fb,_0x3a7669,_0x4e6e4a){if(_0x2097fb[_0x48c4('0x59')]['id']){delete _0x2097fb[_0x48c4('0x59')]['id'];}return db[_0x48c4('0x3d')][_0x48c4('0x5d')]({'where':{'id':_0x2097fb[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x3a7669,null))['then'](function(_0x4dbdb4){if(_0x4dbdb4){_0x2097fb[_0x48c4('0x59')][_0x48c4('0x61')]=_0x4dbdb4['id'];return db[_0x48c4('0x62')][_0x48c4('0x58')](_0x2097fb[_0x48c4('0x59')]);}})[_0x48c4('0x1b')](respondWithResult(_0x3a7669,null))['catch'](handleError(_0x3a7669,null));};exports[_0x48c4('0x63')]=function(_0x16b2a9,_0x119c40,_0x1122b6){var _0x22b267={'raw':![],'where':{}};var _0x3938c0={};var _0xd27b2={'count':0x0,'rows':[]};return db[_0x48c4('0x3d')][_0x48c4('0x64')]({'where':{'id':_0x16b2a9[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x119c40,null))[_0x48c4('0x1b')](function(_0x4d490a){if(_0x4d490a){_0x3938c0[_0x48c4('0x41')]=_['keys'](db[_0x48c4('0x62')][_0x48c4('0x3e')]);_0x3938c0[_0x48c4('0x43')]=_[_0x48c4('0x42')](_0x16b2a9['query']);_0x3938c0[_0x48c4('0x44')]=_[_0x48c4('0x45')](_0x3938c0['model'],_0x3938c0[_0x48c4('0x43')]);_0x22b267[_0x48c4('0x46')]=_['intersection'](_0x3938c0['model'],qs['fields'](_0x16b2a9[_0x48c4('0x43')]['fields']));_0x22b267['attributes']=_0x22b267['attributes'][_0x48c4('0x48')]?_0x22b267[_0x48c4('0x46')]:_0x3938c0[_0x48c4('0x41')];if(!_0x16b2a9[_0x48c4('0x43')]['hasOwnProperty'](_0x48c4('0x49'))){_0x22b267[_0x48c4('0x2b')]=qs[_0x48c4('0x2b')](_0x16b2a9['query']['limit']);_0x22b267['offset']=qs[_0x48c4('0x29')](_0x16b2a9[_0x48c4('0x43')][_0x48c4('0x29')]);}_0x22b267[_0x48c4('0x4a')]=qs[_0x48c4('0x4b')](_0x16b2a9['query'][_0x48c4('0x4b')]);_0x22b267[_0x48c4('0x4c')]=qs[_0x48c4('0x44')](_[_0x48c4('0x4d')](_0x16b2a9['query'],_0x3938c0['filters']));_0x22b267['where']['WhatsappAccountId']=_0x4d490a['id'];if(_0x16b2a9[_0x48c4('0x43')][_0x48c4('0x4e')]){_0x22b267[_0x48c4('0x4c')]=_['merge'](_0x22b267[_0x48c4('0x4c')],{'$or':_[_0x48c4('0x3c')](_0x22b267[_0x48c4('0x46')],function(_0x2e3754){var _0x2ce992={};_0x2ce992[_0x2e3754]={'$like':'%'+_0x16b2a9[_0x48c4('0x43')][_0x48c4('0x4e')]+'%'};return _0x2ce992;})});}_0x22b267=_[_0x48c4('0x4f')]({},_0x22b267,_0x16b2a9[_0x48c4('0x51')]);return db['Disposition'][_0x48c4('0x2c')]({'where':_0x22b267['where']})[_0x48c4('0x1b')](function(_0x429557){_0xd27b2[_0x48c4('0x2c')]=_0x429557;if(_0x16b2a9['query'][_0x48c4('0x52')]){_0x22b267['include']=[{'all':!![]}];}return db[_0x48c4('0x62')][_0x48c4('0x54')](_0x22b267);})[_0x48c4('0x1b')](function(_0x4b54b){_0xd27b2['rows']=_0x4b54b;return _0xd27b2;});}})[_0x48c4('0x1b')](respondWithFilteredResult(_0x119c40,_0x22b267))[_0x48c4('0x26')](handleError(_0x119c40,null));};exports['removeDispositions']=function(_0x58037b,_0x4549cc,_0x11f5ad){return db[_0x48c4('0x3d')][_0x48c4('0x5d')]({'where':{'id':_0x58037b[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x4549cc,null))[_0x48c4('0x1b')](function(_0x4e44ed){if(_0x4e44ed){return _0x4e44ed[_0x48c4('0x65')](_0x58037b['query'][_0x48c4('0x66')]);}})[_0x48c4('0x1b')](respondWithStatusCode(_0x4549cc,null))['catch'](handleError(_0x4549cc,null));};exports[_0x48c4('0x67')]=function(_0xea5460,_0x1d3712,_0x4d6a19){if(_0xea5460[_0x48c4('0x59')]['id']){delete _0xea5460['body']['id'];}return db['WhatsappAccount'][_0x48c4('0x5d')]({'where':{'id':_0xea5460[_0x48c4('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d3712,null))[_0x48c4('0x1b')](function(_0x1d59f2){if(_0x1d59f2){_0xea5460[_0x48c4('0x59')][_0x48c4('0x61')]=_0x1d59f2['id'];return db['CannedAnswer']['create'](_0xea5460[_0x48c4('0x59')]);}})['then'](respondWithResult(_0x1d3712,null))[_0x48c4('0x26')](handleError(_0x1d3712,null));};exports['getAnswers']=function(_0x418551,_0x2092b6,_0x574383){var _0x19be4d={'raw':![],'where':{}};var _0x380562={};var _0x24ca6c={'count':0x0,'rows':[]};return db[_0x48c4('0x3d')][_0x48c4('0x64')]({'where':{'id':_0x418551[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x2092b6,null))[_0x48c4('0x1b')](function(_0x175171){if(_0x175171){_0x380562[_0x48c4('0x41')]=_[_0x48c4('0x42')](db[_0x48c4('0x68')]['rawAttributes']);_0x380562[_0x48c4('0x43')]=_[_0x48c4('0x42')](_0x418551['query']);_0x380562[_0x48c4('0x44')]=_[_0x48c4('0x45')](_0x380562[_0x48c4('0x41')],_0x380562[_0x48c4('0x43')]);_0x19be4d[_0x48c4('0x46')]=_[_0x48c4('0x45')](_0x380562['model'],qs[_0x48c4('0x47')](_0x418551[_0x48c4('0x43')][_0x48c4('0x47')]));_0x19be4d[_0x48c4('0x46')]=_0x19be4d['attributes'][_0x48c4('0x48')]?_0x19be4d[_0x48c4('0x46')]:_0x380562[_0x48c4('0x41')];if(!_0x418551[_0x48c4('0x43')]['hasOwnProperty'](_0x48c4('0x49'))){_0x19be4d[_0x48c4('0x2b')]=qs[_0x48c4('0x2b')](_0x418551[_0x48c4('0x43')][_0x48c4('0x2b')]);_0x19be4d[_0x48c4('0x29')]=qs[_0x48c4('0x29')](_0x418551[_0x48c4('0x43')][_0x48c4('0x29')]);}_0x19be4d[_0x48c4('0x4a')]=qs[_0x48c4('0x4b')](_0x418551[_0x48c4('0x43')][_0x48c4('0x4b')]);_0x19be4d[_0x48c4('0x4c')]=qs[_0x48c4('0x44')](_[_0x48c4('0x4d')](_0x418551[_0x48c4('0x43')],_0x380562[_0x48c4('0x44')]));_0x19be4d['where'][_0x48c4('0x61')]=_0x175171['id'];if(_0x418551[_0x48c4('0x43')][_0x48c4('0x4e')]){_0x19be4d[_0x48c4('0x4c')]=_[_0x48c4('0x4f')](_0x19be4d[_0x48c4('0x4c')],{'$or':_['map'](_0x19be4d[_0x48c4('0x46')],function(_0x465f92){var _0x4e976d={};_0x4e976d[_0x465f92]={'$like':'%'+_0x418551[_0x48c4('0x43')]['filter']+'%'};return _0x4e976d;})});}_0x19be4d=_['merge']({},_0x19be4d,_0x418551[_0x48c4('0x51')]);return db[_0x48c4('0x68')][_0x48c4('0x2c')]({'where':_0x19be4d['where']})[_0x48c4('0x1b')](function(_0x7bb5e8){_0x24ca6c[_0x48c4('0x2c')]=_0x7bb5e8;if(_0x418551[_0x48c4('0x43')][_0x48c4('0x52')]){_0x19be4d[_0x48c4('0x53')]=[{'all':!![]}];}return db[_0x48c4('0x68')]['findAll'](_0x19be4d);})[_0x48c4('0x1b')](function(_0x222f74){_0x24ca6c[_0x48c4('0x69')]=_0x222f74;return _0x24ca6c;});}})[_0x48c4('0x1b')](respondWithFilteredResult(_0x2092b6,_0x19be4d))['catch'](handleError(_0x2092b6,null));};exports[_0x48c4('0x6a')]=function(_0x3a9c29,_0x1f47b2,_0x38fb2a){return db['WhatsappAccount'][_0x48c4('0x5d')]({'where':{'id':_0x3a9c29[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x1f47b2,null))[_0x48c4('0x1b')](function(_0xdfe9ab){if(_0xdfe9ab){return _0xdfe9ab['removeAnswers'](_0x3a9c29[_0x48c4('0x43')][_0x48c4('0x66')]);}})[_0x48c4('0x1b')](respondWithStatusCode(_0x1f47b2,null))[_0x48c4('0x26')](handleError(_0x1f47b2,null));};exports[_0x48c4('0x6b')]=function(_0x355c19,_0x4b0bb9,_0x139205){return db['WhatsappAccount']['find']({'where':{'id':_0x355c19[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x4b0bb9,null))[_0x48c4('0x1b')](function(_0x285195){if(_0x285195){return _0x285195[_0x48c4('0x6b')](_0x355c19[_0x48c4('0x59')][_0x48c4('0x66')],_[_0x48c4('0x6c')](_0x355c19[_0x48c4('0x59')],[_0x48c4('0x66'),'id'])||{})[_0x48c4('0x6d')](function(_0xf4eb7e){for(var _0x2b4e1c=0x0;_0x2b4e1c<_0x355c19[_0x48c4('0x59')][_0x48c4('0x66')]['length'];_0x2b4e1c+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x355c19[_0x48c4('0x59')][_0x48c4('0x66')][_0x2b4e1c]),'WhatsappAccountId':Number(_0x355c19[_0x48c4('0x56')]['id'])});}return _0xf4eb7e;});}})[_0x48c4('0x1b')](respondWithResult(_0x4b0bb9,null))['catch'](handleError(_0x4b0bb9,null));};exports[_0x48c4('0x6e')]=function(_0x52ef89,_0x4ef147,_0x375030){return db[_0x48c4('0x3d')][_0x48c4('0x5d')]({'where':{'id':_0x52ef89['params']['id']}})['then'](handleEntityNotFound(_0x4ef147,null))['then'](function(_0x501d7f){if(_0x501d7f){return _0x501d7f[_0x48c4('0x6e')](_0x52ef89[_0x48c4('0x43')][_0x48c4('0x66')])['then'](function(){if(_['isArray'](_0x52ef89[_0x48c4('0x43')][_0x48c4('0x66')])){for(var _0x25626c=0x0;_0x25626c<_0x52ef89['query']['ids'][_0x48c4('0x48')];_0x25626c+=0x1){socket[_0x48c4('0x6f')](_0x48c4('0x70'),{'UserId':Number(_0x52ef89[_0x48c4('0x43')]['ids'][_0x25626c]),'WhatsappAccountId':Number(_0x52ef89[_0x48c4('0x56')]['id'])});}}else{socket[_0x48c4('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x52ef89[_0x48c4('0x43')][_0x48c4('0x66')]),'WhatsappAccountId':Number(_0x52ef89[_0x48c4('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ef147,null))[_0x48c4('0x26')](handleError(_0x4ef147,null));};exports['getAgents']=function(_0x1d27fe,_0x2b8d2b,_0x2ca2c9){var _0x453cc1={};var _0x2f37b4={};var _0x326756;var _0x355dfe;return db[_0x48c4('0x3d')]['findOne']({'where':{'id':_0x1d27fe[_0x48c4('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b8d2b,null))[_0x48c4('0x1b')](function(_0x46d0c5){if(_0x46d0c5){_0x326756=_0x46d0c5;_0x2f37b4[_0x48c4('0x41')]=_[_0x48c4('0x42')](db[_0x48c4('0x71')][_0x48c4('0x3e')]);_0x2f37b4['query']=_['keys'](_0x1d27fe['query']);_0x2f37b4[_0x48c4('0x44')]=_['intersection'](_0x2f37b4['model'],_0x2f37b4['query']);_0x453cc1[_0x48c4('0x46')]=_[_0x48c4('0x45')](_0x2f37b4[_0x48c4('0x41')],qs['fields'](_0x1d27fe[_0x48c4('0x43')][_0x48c4('0x47')]));_0x453cc1['attributes']=_0x453cc1[_0x48c4('0x46')]['length']?_0x453cc1[_0x48c4('0x46')]:_0x2f37b4[_0x48c4('0x41')];_0x453cc1[_0x48c4('0x4a')]=qs[_0x48c4('0x4b')](_0x1d27fe['query'][_0x48c4('0x4b')]);_0x453cc1[_0x48c4('0x4c')]=qs[_0x48c4('0x44')](_['pick'](_0x1d27fe[_0x48c4('0x43')],_0x2f37b4[_0x48c4('0x44')]));if(_0x1d27fe['query'][_0x48c4('0x4e')]){_0x453cc1['where']=_['merge'](_0x453cc1[_0x48c4('0x4c')],{'$or':_[_0x48c4('0x3c')](_0x453cc1[_0x48c4('0x46')],function(_0x3ac112){var _0xdfac0a={};_0xdfac0a[_0x3ac112]={'$like':'%'+_0x1d27fe[_0x48c4('0x43')][_0x48c4('0x4e')]+'%'};return _0xdfac0a;})});}_0x453cc1=_['merge']({},_0x453cc1,_0x1d27fe['options']);return _0x326756[_0x48c4('0x72')](_0x453cc1);}})[_0x48c4('0x1b')](function(_0x293baa){if(_0x293baa){_0x355dfe=_0x293baa[_0x48c4('0x48')];if(!_0x1d27fe[_0x48c4('0x43')]['hasOwnProperty'](_0x48c4('0x49'))){_0x453cc1[_0x48c4('0x2b')]=qs[_0x48c4('0x2b')](_0x1d27fe[_0x48c4('0x43')]['limit']);_0x453cc1[_0x48c4('0x29')]=qs['offset'](_0x1d27fe[_0x48c4('0x43')][_0x48c4('0x29')]);}return _0x326756[_0x48c4('0x72')](_0x453cc1);}})['then'](function(_0x1bcd42){if(_0x1bcd42){return _0x1bcd42?{'count':_0x355dfe,'rows':_0x1bcd42}:null;}})[_0x48c4('0x1b')](respondWithResult(_0x2b8d2b,null))['catch'](handleError(_0x2b8d2b,null));};exports[_0x48c4('0x73')]=function(_0x3d2102,_0x4aff59){var _0x27cb60=_0x3d2102[_0x48c4('0x56')]['id'];var _0x36f5fe=_0x3d2102[_0x48c4('0x59')];var _0x1055d3=0xc8;var _0x3f0f30=null;return db['sequelize'][_0x48c4('0x74')]({'isolationLevel':db[_0x48c4('0x75')][_0x48c4('0x76')][_0x48c4('0x77')][_0x48c4('0x78')]},function(_0x4f8c6b){return db[_0x48c4('0x3d')][_0x48c4('0x64')]({'where':{'id':_0x27cb60},'transaction':_0x4f8c6b})['then'](function(_0x36c4f6){if(_0x36c4f6){return db[_0x48c4('0x79')][_0x48c4('0x35')]({'where':{'WhatsappAccountId':_0x27cb60},'transaction':_0x4f8c6b})[_0x48c4('0x1b')](function(){var _0x1a56d7=_['map'](_0x36f5fe,function(_0xbcda7e){_0xbcda7e[_0x48c4('0x61')]=_0x27cb60;return _0xbcda7e;});return db[_0x48c4('0x79')][_0x48c4('0x7a')](_0x1a56d7,{'transaction':_0x4f8c6b});});}else{_0x1055d3=0x194;_0x3f0f30=[];}});})[_0x48c4('0x1b')](function(){if(_0x1055d3!==0x194){return db[_0x48c4('0x79')][_0x48c4('0x7b')]({'where':{'WhatsappAccountId':_0x27cb60},'order':_0x48c4('0x7c')})['then'](function(_0x401f92){_0x3f0f30=_0x401f92;});}})[_0x48c4('0x26')](function(_0x407664){_0x1055d3=0x1f4;logger[_0x48c4('0x21')](_0x407664[_0x48c4('0x37')]);if(_0x407664[_0x48c4('0x38')]){delete _0x407664[_0x48c4('0x38')];}_0x3f0f30=_0x407664;})[_0x48c4('0x7d')](function(){if(_0x3f0f30===null){_0x4aff59[_0x48c4('0x27')](_0x1055d3);}else{if(_0x1055d3===0x1f4){_0x4aff59['status'](_0x1055d3)[_0x48c4('0x39')](_0x3f0f30);}else{_0x4aff59['status'](_0x1055d3)[_0x48c4('0x7e')](_0x3f0f30);}}});};exports[_0x48c4('0x7f')]=function(_0xc78c79,_0x40d484,_0x11625d){var _0x8cba={};var _0x30827b={};var _0x33a31d;var _0x72db22;return db[_0x48c4('0x3d')][_0x48c4('0x64')]({'where':{'id':_0xc78c79[_0x48c4('0x56')]['id']}})[_0x48c4('0x1b')](handleEntityNotFound(_0x40d484,null))['then'](function(_0x17eb0c){if(_0x17eb0c){_0x33a31d=_0x17eb0c;_0x30827b['model']=_[_0x48c4('0x42')](db[_0x48c4('0x79')][_0x48c4('0x3e')]);_0x30827b[_0x48c4('0x43')]=_['keys'](_0xc78c79[_0x48c4('0x43')]);_0x30827b['filters']=_[_0x48c4('0x45')](_0x30827b[_0x48c4('0x41')],_0x30827b[_0x48c4('0x43')]);_0x8cba[_0x48c4('0x46')]=_['intersection'](_0x30827b[_0x48c4('0x41')],qs[_0x48c4('0x47')](_0xc78c79[_0x48c4('0x43')][_0x48c4('0x47')]));_0x8cba['attributes']=_0x8cba[_0x48c4('0x46')][_0x48c4('0x48')]?_0x8cba[_0x48c4('0x46')]:_0x30827b[_0x48c4('0x41')];_0x8cba['order']=qs[_0x48c4('0x4b')](_0xc78c79[_0x48c4('0x43')]['sort']);_0x8cba['where']=qs[_0x48c4('0x44')](_[_0x48c4('0x4d')](_0xc78c79[_0x48c4('0x43')],_0x30827b[_0x48c4('0x44')]));if(_0xc78c79[_0x48c4('0x43')]['filter']){_0x8cba[_0x48c4('0x4c')]=_[_0x48c4('0x4f')](_0x8cba['where'],{'$or':_[_0x48c4('0x3c')](_0x8cba[_0x48c4('0x46')],function(_0x5eaa19){var _0x3bea8a={};_0x3bea8a[_0x5eaa19]={'$like':'%'+_0xc78c79[_0x48c4('0x43')][_0x48c4('0x4e')]+'%'};return _0x3bea8a;})});}_0x8cba=_[_0x48c4('0x4f')]({},_0x8cba,_0xc78c79[_0x48c4('0x51')]);return _0x33a31d[_0x48c4('0x7f')](_0x8cba);}})[_0x48c4('0x1b')](function(_0x1797af){if(_0x1797af){_0x72db22=_0x1797af['length'];if(!_0xc78c79[_0x48c4('0x43')][_0x48c4('0x80')](_0x48c4('0x49'))){_0x8cba[_0x48c4('0x2b')]=qs[_0x48c4('0x2b')](_0xc78c79['query']['limit']);_0x8cba[_0x48c4('0x29')]=qs[_0x48c4('0x29')](_0xc78c79[_0x48c4('0x43')]['offset']);}return _0x33a31d[_0x48c4('0x7f')](_0x8cba);}})[_0x48c4('0x1b')](function(_0x374866){if(_0x374866){return _0x374866?{'count':_0x72db22,'rows':_0x374866}:null;}})[_0x48c4('0x1b')](respondWithResult(_0x40d484,null))[_0x48c4('0x26')](handleError(_0x40d484,null));};exports['notify']=function(_0xd15238,_0x4bb327,_0x4c3784){var _0x479582={'channel':_0x48c4('0x81')};var _0x29ec84=[];var _0x189394=[];var _0x403678={};return db[_0x48c4('0x3d')]['find']({'where':{'id':_0xd15238[_0x48c4('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x48c4('0x82')}]})[_0x48c4('0x1b')](handleEntityNotFound(_0x4bb327,null))[_0x48c4('0x1b')](function(_0x5681f1){_0x479582[_0x48c4('0x83')]=_0x5681f1;if(_0x479582[_0x48c4('0x83')]&&_0x479582['account']['type']===_0x48c4('0x84')&&_0xd15238[_0x48c4('0x59')][_0x48c4('0x85')]){if(_0xd15238[_0x48c4('0x59')][_0x48c4('0x85')][_0x48c4('0x48')]===0x0)return;if(_0xd15238[_0x48c4('0x59')][_0x48c4('0x85')][0x0][_0x48c4('0x86')]!==_0x48c4('0x87'))return;return db[_0x48c4('0x88')][_0x48c4('0x32')]({'read':!![],'readAt':_0xd15238[_0x48c4('0x59')]['statuses'][0x0][_0x48c4('0x89')]},{'where':{'messageId':_0xd15238[_0x48c4('0x59')][_0x48c4('0x85')][0x0][_0x48c4('0x8a')]},'individualHooks':!![]})['then'](function(_0x5292b6){return _0x4bb327[_0x48c4('0x28')](0xc8)[_0x48c4('0x7e')](_0x5292b6);});}_0x479582[_0x48c4('0x8b')]=_[_0x48c4('0x8c')](_0x5681f1[_0x48c4('0x82')],[_0x48c4('0x7c')],[_0x48c4('0x8d')]);if(_0x479582[_0x48c4('0x83')][_0x48c4('0x82')]){delete _0x479582[_0x48c4('0x83')]['Applications'];}return db[_0x48c4('0x8e')][_0x48c4('0x5f')]()[_0x48c4('0x1b')](function(_0x5ba638){if(!_0x5ba638){throw new db[(_0x48c4('0x8f'))][(_0x48c4('0x90'))](_0x48c4('0x91'));}_0x29ec84=_[_0x48c4('0x92')](_['keys'](_0x5ba638),[_0x48c4('0x93'),_0x48c4('0x94')]);_0x189394=_[_0x48c4('0x92')](_[_0x48c4('0x42')](_0x5ba638),[_0x48c4('0x93'),_0x48c4('0x94'),_0x48c4('0x95'),_0x48c4('0x96')]);_0x479582[_0x48c4('0x59')]={'mapKey':_0x48c4('0x97')};if(_0x479582[_0x48c4('0x83')]&&_0x479582[_0x48c4('0x83')]['type']===_0x48c4('0x98')){_0x479582['body'][_0x48c4('0x99')]=_0xd15238[_0x48c4('0x59')][_0x48c4('0x9a')][_0x48c4('0x9b')]('whatsapp:','');_0x479582[_0x48c4('0x59')][_0x48c4('0x59')]=_0xd15238[_0x48c4('0x59')]['Body'];_0x479582['body'][_0x48c4('0x9c')]=_0xd15238[_0x48c4('0x59')][_0x48c4('0x9d')];}if(_0x479582['account']&&_0x479582[_0x48c4('0x83')][_0x48c4('0x3f')]===_0x48c4('0x84')){_0x479582['body'][_0x48c4('0x99')]=_0xd15238[_0x48c4('0x59')][_0x48c4('0x9e')][0x0][_0x48c4('0x99')];_0x479582[_0x48c4('0x59')][_0x48c4('0x59')]=_0xd15238[_0x48c4('0x59')][_0x48c4('0x9e')][0x0][_0x48c4('0x24')][_0x48c4('0x59')];_0x479582[_0x48c4('0x59')][_0x48c4('0x9c')]=_0xd15238[_0x48c4('0x59')][_0x48c4('0x9e')][0x0][_0x48c4('0x8a')];}if(_0x479582[_0x48c4('0x59')]['id']){delete _0x479582['body']['id'];}if(_[_0x48c4('0x9f')](_0x479582['body'][_0x48c4('0x99')])){throw new db[(_0x48c4('0x8f'))][(_0x48c4('0x90'))](_0x48c4('0xa0'));}if(_[_0x48c4('0x9f')](_0x479582[_0x48c4('0x59')][_0x48c4('0x59')])||_0x479582['body'][_0x48c4('0x59')]===''){throw new db[(_0x48c4('0x8f'))]['ValidationError'](_0x48c4('0xa1'));}if(_['isNil'](_0x479582[_0x48c4('0x59')][_0x48c4('0xa2')])){throw new db['Sequelize'][(_0x48c4('0x90'))](_0x48c4('0xa3')+_0x189394);}if(!_[_0x48c4('0xa4')](_0x189394,_0x479582[_0x48c4('0x59')]['mapKey'])){throw new db[(_0x48c4('0x8f'))][(_0x48c4('0x90'))](_0x48c4('0xa5')+_0x189394);}_0x403678[_0x479582[_0x48c4('0x59')][_0x48c4('0xa2')]]=_0x479582[_0x48c4('0x59')][_0x48c4('0x99')];return db[_0x48c4('0xa6')][_0x48c4('0x5d')]({'where':{'id':_0x479582[_0x48c4('0x83')]['ListId']},'include':[{'model':db[_0x48c4('0x8e')],'as':_0x48c4('0xa7'),'where':_0x403678,'limit':0x1,'order':[[_0x48c4('0x94'),_0x48c4('0xa8')]]}]});})['then'](handleEntityNotFound(_0x4bb327,null))[_0x48c4('0x1b')](function(_0x5488ed){if(_0x5488ed){_0x479582[_0x48c4('0xa9')]=_['omit'](_0x5488ed,[_0x48c4('0xa7')]);if(_0x5488ed[_0x48c4('0xa7')][_0x48c4('0x48')]){return _0x5488ed[_0x48c4('0xa7')][0x0];}var _0x5df183=_[_0x48c4('0x16')](_0x479582[_0x48c4('0x59')],{'firstName':_0x479582[_0x48c4('0x59')]['from'],'ListId':_0x5488ed['id']});_0x5df183[_0x479582[_0x48c4('0x59')][_0x48c4('0xa2')]]=_0x479582[_0x48c4('0x59')][_0x48c4('0x99')];return db[_0x48c4('0x8e')][_0x48c4('0x58')](_0x5df183,{'fields':_0x29ec84,'raw':!![]});}})[_0x48c4('0x1b')](handleEntityNotFound(_0x4bb327,null))[_0x48c4('0x1b')](function(_0x32420c){if(_0x32420c){_0x479582[_0x48c4('0xaa')]=_0x32420c;var _0x367524={'ContactId':_0x32420c['id'],'phone':_0x479582[_0x48c4('0x59')][_0x48c4('0x99')],'WhatsappAccountId':_0xd15238['params']['id']};var _0x5a40d6={'ContactId':_0x32420c['id'],'WhatsappAccountId':_0xd15238[_0x48c4('0x56')]['id'],'closed':![]};return db[_0x48c4('0xab')][_0x48c4('0x5d')]({'where':_0x5a40d6})[_0x48c4('0x1b')](function(_0x382d23){if(_0x382d23){return[_0x382d23,![]];}return db[_0x48c4('0xab')][_0x48c4('0x58')](_0x367524)[_0x48c4('0x1b')](function(_0x55cf34){return[_0x55cf34,!![]];});});}})[_0x48c4('0x6d')](function(_0x138ec9,_0x4e0bec){_0x479582['interaction']=_0x138ec9[_0x48c4('0x5b')]({'plain':!![]});_0x479582[_0x48c4('0xac')]['created']=![];if(_0x4e0bec){if(_0x479582[_0x48c4('0x83')][_0x48c4('0xad')]){_0x479582['applications']['push']({'id':0x0,'priority':_0x479582[_0x48c4('0x8b')][_0x48c4('0x48')]+0x1,'app':'close','appdata':_0x48c4('0xae'),'interval':_0x48c4('0xaf')});}_0x479582[_0x48c4('0xac')][_0x48c4('0xb0')]=!![];}return db[_0x48c4('0x88')]['create']({'phone':_0x479582[_0x48c4('0x59')][_0x48c4('0x99')],'messageId':_0x479582['body'][_0x48c4('0x9c')],'body':_0x479582[_0x48c4('0x59')][_0x48c4('0x59')],'WhatsappAccountId':_0xd15238[_0x48c4('0x56')]['id'],'WhatsappInteractionId':_0x138ec9['id'],'direction':'in','ContactId':_0x138ec9[_0x48c4('0xb1')],'AttachmentId':_0x479582[_0x48c4('0x59')][_0x48c4('0xb2')]});})[_0x48c4('0x1b')](function(_0x3d76cb){_0x479582[_0x48c4('0x24')]=_0x3d76cb;if(_0x479582['interaction'][_0x48c4('0xb3')]){return db[_0x48c4('0x71')][_0x48c4('0x5d')]({'attributes':['id','name'],'where':{'id':_0x479582[_0x48c4('0xac')][_0x48c4('0xb3')]}})[_0x48c4('0x1b')](function(_0x38e8bf){if(_0x38e8bf){_0x479582[_0x48c4('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x48c4('0xb4'),'appdata':_0x38e8bf[_0x48c4('0x38')]+','+(_0x479582['account'][_0x48c4('0xb5')]||0xa),'interval':_0x48c4('0xaf')});}return respondWithRpcPromise(_0x48c4('0xb6'),'startRouting',_0x479582);});}return respondWithRpcPromise('Start',_0x48c4('0xb7'),_0x479582);})['then'](function(_0x222fcd){if(_0x222fcd){var _0x349da5=0xc8;var _0x3f8d8c=_0x48c4('0xb8');logger[_0x48c4('0x1c')](_0x48c4('0x1e'),_0x3f8d8c,_0x349da5,_0x48c4('0xb9'));logger['debug'](_0x48c4('0xba'),_0x3f8d8c,_0x349da5,_0x48c4('0xb9'),JSON[_0x48c4('0x20')](_0x222fcd));if(_0x479582[_0x48c4('0x83')][_0x48c4('0x3f')]===_0x48c4('0x98')){return _0x4bb327[_0x48c4('0x28')](_0x349da5)[_0x48c4('0x2d')](_0x48c4('0xbb'),'text/xml')[_0x48c4('0x39')]('\x0a');}else{return _0x4bb327[_0x48c4('0x28')](_0x349da5)[_0x48c4('0x7e')](_0x222fcd);}}});})['catch'](handleError(_0x4bb327,null));};exports['send']=function(_0x2d25d0,_0x21c728,_0xb4ba87){var _0x5af58b,_0x12640b,_0x58d4d2;if(_[_0x48c4('0x9f')](_0x2d25d0[_0x48c4('0x59')][_0x48c4('0x59')])||_0x2d25d0[_0x48c4('0x59')][_0x48c4('0x59')]===''){throw new db[(_0x48c4('0x8f'))][(_0x48c4('0x90'))](_0x48c4('0xa1'));}if(_['isNil'](_0x2d25d0[_0x48c4('0x59')]['to'])){throw new db['Sequelize'][(_0x48c4('0x90'))]('to\x20is\x20mandatory');}_0x5af58b=_0x2d25d0[_0x48c4('0x59')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x2d25d0[_0x48c4('0x56')]['id']},'include':[{'model':db[_0x48c4('0xa6')],'as':_0x48c4('0xbc'),'include':[{'model':db[_0x48c4('0x8e')],'as':_0x48c4('0xa7'),'where':{'mobile':_0x5af58b},'limit':0x1,'order':[[_0x48c4('0x94'),_0x48c4('0xa8')]]}]}]})[_0x48c4('0x1b')](handleEntityNotFound(_0x21c728,null))[_0x48c4('0x1b')](function(_0x1fc5cc){if(_0x1fc5cc&&_0x1fc5cc[_0x48c4('0xbc')]){_0x12640b=_0x1fc5cc[_0x48c4('0x5b')]({'plain':!![]});if(_0x12640b['List']&&_0x12640b[_0x48c4('0xbc')][_0x48c4('0xa7')][_0x48c4('0x48')]){return _0x12640b[_0x48c4('0xbc')][_0x48c4('0xa7')][0x0];}return db[_0x48c4('0x8e')][_0x48c4('0x58')](_[_0x48c4('0x16')](_0x2d25d0[_0x48c4('0x59')],{'firstName':_0x5af58b,'mobile':_0x5af58b,'phone':_0x5af58b,'ListId':_0x12640b[_0x48c4('0x96')]}));}})['then'](handleEntityNotFound(_0x21c728,null))['then'](function(_0x300bbe){if(_0x300bbe){_0x58d4d2=_0x300bbe;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x58d4d2['id'],'closed':![],'WhatsappAccountId':_0x12640b['id']}})[_0x48c4('0x1b')](function(_0x24e4ee){if(_0x24e4ee){return[_0x24e4ee,![]];}return db['WhatsappInteraction'][_0x48c4('0x58')]({'UserId':_0x2d25d0[_0x48c4('0x5a')]['id'],'ContactId':_0x58d4d2['id'],'WhatsappAccountId':_0x12640b['id'],'phone':_0x5af58b,'firstMsgDirection':_0x48c4('0xbd'),'Messages':[_[_0x48c4('0x4f')](_0x2d25d0[_0x48c4('0x59')],{'read':![],'body':_0x2d25d0[_0x48c4('0x59')][_0x48c4('0x59')],'phone':_0x5af58b,'WhatsappAccountId':_0x12640b['id'],'UserId':_0x2d25d0[_0x48c4('0x5a')]['id'],'ContactId':_0x58d4d2['id']})]},{'include':[{'model':db[_0x48c4('0x88')],'as':_0x48c4('0xbe')}]})[_0x48c4('0x1b')](function(_0x254001){return[_0x254001,!![]];});});}})[_0x48c4('0x6d')](function(_0x3fc7b2,_0x2954d0){if(_0x2954d0){return _0x3fc7b2;}return db[_0x48c4('0x88')]['create'](_[_0x48c4('0x4f')](_0x2d25d0[_0x48c4('0x59')],{'read':![],'body':_0x2d25d0[_0x48c4('0x59')]['body'],'phone':_0x5af58b,'WhatsappAccountId':_0x12640b['id'],'WhatsappInteractionId':_0x3fc7b2['id'],'UserId':_0x2d25d0[_0x48c4('0x5a')]['id'],'ContactId':_0x58d4d2['id']}))[_0x48c4('0x1b')](function(_0x23be2c){_0x3fc7b2[_0x48c4('0xbf')][_0x48c4('0xbe')]=[];_0x3fc7b2[_0x48c4('0xbf')][_0x48c4('0xbe')][_0x48c4('0xc0')](_0x23be2c[_0x48c4('0xbf')]);return _0x3fc7b2;});})['then'](respondWithResult(_0x21c728,null))[_0x48c4('0x26')](handleError(_0x21c728,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 45a2380..6f43491 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 _0xa7d9=['save','update','remove','emit','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x56a095,_0x2c7dd8){var _0x15beb4=function(_0x36079f){while(--_0x36079f){_0x56a095['push'](_0x56a095['shift']());}};_0x15beb4(++_0x2c7dd8);}(_0xa7d9,0xe7));var _0x9a7d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa7d9[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x9a7d('0x0'))['db'][_0x9a7d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9a7d('0x2')](0x0);var events={'afterCreate':_0x9a7d('0x3'),'afterUpdate':_0x9a7d('0x4'),'afterDestroy':_0x9a7d('0x5')};function emitEvent(_0x5a2ec5){return function(_0x210289,_0xcfc149,_0x41b1a8){WhatsappAccountEvents[_0x9a7d('0x6')](_0x5a2ec5+':'+_0x210289['id'],_0x210289);WhatsappAccountEvents[_0x9a7d('0x6')](_0x5a2ec5,_0x210289);_0x41b1a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x9a7d('0x7')](e,emitEvent(event));}}module[_0x9a7d('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x6167=['WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x47023,_0x3a69cd){var _0xd254d5=function(_0xf95434){while(--_0xf95434){_0x47023['push'](_0x47023['shift']());}};_0xd254d5(++_0x3a69cd);}(_0x6167,0x187));var _0x7616=function(_0x546c96,_0x2c204e){_0x546c96=_0x546c96-0x0;var _0x8dff11=_0x6167[_0x546c96];return _0x8dff11;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x7616('0x0'))['db'][_0x7616('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7616('0x2')](0x0);var events={'afterCreate':_0x7616('0x3'),'afterUpdate':'update','afterDestroy':_0x7616('0x4')};function emitEvent(_0x44fed3){return function(_0x2b01ce,_0x4f9849,_0x577030){WhatsappAccountEvents[_0x7616('0x5')](_0x44fed3+':'+_0x2b01ce['id'],_0x2b01ce);WhatsappAccountEvents[_0x7616('0x5')](_0x44fed3,_0x2b01ce);_0x577030(null);};}for(var e in events){if(events[_0x7616('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x7616('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 46ef6a6..7a5b886 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 _0x194e=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x194e,0xe3));var _0xe194=function(_0x260525,_0x211b29){_0x260525=_0x260525-0x0;var _0xb75e8b=_0x194e[_0x260525];return _0xb75e8b;};'use strict';var _=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var logger=require(_0xe194('0x2'))(_0xe194('0x3'));var moment=require(_0xe194('0x4'));var BPromise=require(_0xe194('0x5'));var rp=require(_0xe194('0x6'));var fs=require('fs');var path=require(_0xe194('0x7'));var rimraf=require(_0xe194('0x8'));var config=require(_0xe194('0x9'));var attributes=require(_0xe194('0xa'));module['exports']=function(_0x2c153f,_0xe1bb03){return _0x2c153f[_0xe194('0xb')](_0xe194('0xc'),attributes,{'tableName':_0xe194('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9eb=['api','moment','request-promise','path','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util'];(function(_0x3600e4,_0x3bdc26){var _0x227f80=function(_0x3ca8c9){while(--_0x3ca8c9){_0x3600e4['push'](_0x3600e4['shift']());}};_0x227f80(++_0x3bdc26);}(_0xa9eb,0xf8));var _0xba9e=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xa9eb[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xba9e('0x0'));var util=require(_0xba9e('0x1'));var logger=require('../../config/logger')(_0xba9e('0x2'));var moment=require(_0xba9e('0x3'));var BPromise=require('bluebird');var rp=require(_0xba9e('0x4'));var fs=require('fs');var path=require(_0xba9e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba9e('0x6'));module[_0xba9e('0x7')]=function(_0x316abb,_0x3803ee){return _0x316abb[_0xba9e('0x8')](_0xba9e('0x9'),attributes,{'tableName':'whatsapp_accounts','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 85c7673..691cd27 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 _0x4628=['result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','include','map','attributes','model','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','request','info','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message'];(function(_0x3aa1f5,_0x5c9dba){var _0x22ab3b=function(_0x130b84){while(--_0x130b84){_0x3aa1f5['push'](_0x3aa1f5['shift']());}};_0x22ab3b(++_0x5c9dba);}(_0x4628,0xd3));var _0x8462=function(_0x19c66f,_0x1866f8){_0x19c66f=_0x19c66f-0x0;var _0x522de6=_0x4628[_0x19c66f];return _0x522de6;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});config[_0x8462('0xb')]=_['defaults'](config[_0x8462('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8462('0xc'))(new Redis(config[_0x8462('0xb')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3ebf01,_0x1cc040,_0x34cd6b){return new BPromise(function(_0x3cd893,_0x18e80e){return client[_0x8462('0xd')](_0x3ebf01,_0x34cd6b)['then'](function(_0x1799d6){logger[_0x8462('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x1cc040,_0x8462('0xf'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1cc040,'request\x20sent',JSON[_0x8462('0x10')](_0x1799d6));if(_0x1799d6[_0x8462('0x11')]){if(_0x1799d6[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')](_0x8462('0x12'),_0x1cc040,_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);return _0x18e80e(_0x1799d6['error'][_0x8462('0x13')]);}logger[_0x8462('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x1cc040,_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);return _0x3cd893(_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);}else{logger['info'](_0x8462('0x12'),_0x1cc040,_0x8462('0xf'));_0x3cd893(_0x1799d6[_0x8462('0x14')][_0x8462('0x13')]);}})[_0x8462('0x15')](function(_0x528157){logger['error'](_0x8462('0x12'),_0x1cc040,_0x528157);_0x18e80e(_0x528157);});});}exports[_0x8462('0x16')]=function(_0x267e7d){var _0x2c3c48=this;return new Promise(function(_0x49bef5,_0x490dcb){return db[_0x8462('0x17')][_0x8462('0x18')]({'raw':_0x267e7d[_0x8462('0x19')]?_0x267e7d[_0x8462('0x19')][_0x8462('0x1a')]===undefined?!![]:![]:!![],'where':_0x267e7d['options']?_0x267e7d[_0x8462('0x19')]['where']||null:null,'attributes':_0x267e7d['options']?_0x267e7d['options']['attributes']||null:null,'include':_0x267e7d[_0x8462('0x19')]?_0x267e7d[_0x8462('0x19')][_0x8462('0x1b')]?_[_0x8462('0x1c')](_0x267e7d[_0x8462('0x19')][_0x8462('0x1b')],function(_0x3b5af3){return{'model':db[_0x3b5af3['model']],'as':_0x3b5af3['as'],'attributes':_0x3b5af3[_0x8462('0x1d')],'include':_0x3b5af3[_0x8462('0x1b')]?_[_0x8462('0x1c')](_0x3b5af3[_0x8462('0x1b')],function(_0x27b8b9){return{'model':db[_0x27b8b9[_0x8462('0x1e')]],'as':_0x27b8b9['as'],'attributes':_0x27b8b9['attributes'],'include':_0x27b8b9['include']?_['map'](_0x27b8b9[_0x8462('0x1b')],function(_0x279637){return{'model':db[_0x279637['model']],'as':_0x279637['as'],'attributes':_0x279637[_0x8462('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8462('0x1f')](function(_0xdafc1d){logger[_0x8462('0xe')]('ShowWhatsappAccount',_0x267e7d);logger[_0x8462('0x20')]('ShowWhatsappAccount',_0x267e7d,JSON[_0x8462('0x10')](_0xdafc1d));_0x49bef5(_0xdafc1d);})['catch'](function(_0x4541c8){logger['error']('ShowWhatsappAccount',_0x4541c8[_0x8462('0x13')],_0x267e7d);_0x490dcb(_0x2c3c48[_0x8462('0x11')](0x1f4,_0x4541c8[_0x8462('0x13')]));});});}; \ No newline at end of file +var _0x6e1d=['stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27f1f6,_0x166f19){var _0x188532=function(_0x8911d3){while(--_0x8911d3){_0x27f1f6['push'](_0x27f1f6['shift']());}};_0x188532(++_0x166f19);}(_0x6e1d,0xfa));var _0xd6e1=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x6e1d[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xd6e1('0x0'));var util=require(_0xd6e1('0x1'));var moment=require(_0xd6e1('0x2'));var BPromise=require(_0xd6e1('0x3'));var rs=require(_0xd6e1('0x4'));var fs=require('fs');var Redis=require(_0xd6e1('0x5'));var db=require(_0xd6e1('0x6'))['db'];var utils=require(_0xd6e1('0x7'));var logger=require('../../config/logger')(_0xd6e1('0x8'));var config=require(_0xd6e1('0x9'));var jayson=require(_0xd6e1('0xa'));var client=jayson['client'][_0xd6e1('0xb')]({'port':0x232a});config['redis']=_[_0xd6e1('0xc')](config['redis'],{'host':_0xd6e1('0xd'),'port':0x18eb});var socket=require(_0xd6e1('0xe'))(new Redis(config['redis']));require(_0xd6e1('0xf'))[_0xd6e1('0x10')](socket);function respondWithRpcPromise(_0x5173c5,_0x228e6a,_0x18aab7){return new BPromise(function(_0x3802eb,_0x1e5112){return client[_0xd6e1('0x11')](_0x5173c5,_0x18aab7)[_0xd6e1('0x12')](function(_0x289ec6){logger[_0xd6e1('0x13')](_0xd6e1('0x14'),_0x228e6a,_0xd6e1('0x15'));logger[_0xd6e1('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x228e6a,_0xd6e1('0x15'),JSON[_0xd6e1('0x17')](_0x289ec6));if(_0x289ec6[_0xd6e1('0x18')]){if(_0x289ec6['error'][_0xd6e1('0x19')]===0x1f4){logger[_0xd6e1('0x18')](_0xd6e1('0x14'),_0x228e6a,_0x289ec6[_0xd6e1('0x18')][_0xd6e1('0x1a')]);return _0x1e5112(_0x289ec6[_0xd6e1('0x18')][_0xd6e1('0x1a')]);}logger[_0xd6e1('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x228e6a,_0x289ec6[_0xd6e1('0x18')][_0xd6e1('0x1a')]);return _0x3802eb(_0x289ec6[_0xd6e1('0x18')][_0xd6e1('0x1a')]);}else{logger['info'](_0xd6e1('0x14'),_0x228e6a,_0xd6e1('0x15'));_0x3802eb(_0x289ec6[_0xd6e1('0x1b')][_0xd6e1('0x1a')]);}})[_0xd6e1('0x1c')](function(_0x2bec1e){logger[_0xd6e1('0x18')](_0xd6e1('0x14'),_0x228e6a,_0x2bec1e);_0x1e5112(_0x2bec1e);});});}exports[_0xd6e1('0x1d')]=function(_0x8e8379){var _0x12e87d=this;return new Promise(function(_0x24d99d,_0x339323){return db[_0xd6e1('0x1e')][_0xd6e1('0x1f')]({'raw':_0x8e8379['options']?_0x8e8379['options'][_0xd6e1('0x20')]===undefined?!![]:![]:!![],'where':_0x8e8379[_0xd6e1('0x21')]?_0x8e8379[_0xd6e1('0x21')][_0xd6e1('0x22')]||null:null,'attributes':_0x8e8379[_0xd6e1('0x21')]?_0x8e8379[_0xd6e1('0x21')][_0xd6e1('0x23')]||null:null,'include':_0x8e8379['options']?_0x8e8379['options'][_0xd6e1('0x24')]?_[_0xd6e1('0x25')](_0x8e8379[_0xd6e1('0x21')][_0xd6e1('0x24')],function(_0x192738){return{'model':db[_0x192738[_0xd6e1('0x26')]],'as':_0x192738['as'],'attributes':_0x192738[_0xd6e1('0x23')],'include':_0x192738[_0xd6e1('0x24')]?_[_0xd6e1('0x25')](_0x192738['include'],function(_0x329b26){return{'model':db[_0x329b26[_0xd6e1('0x26')]],'as':_0x329b26['as'],'attributes':_0x329b26[_0xd6e1('0x23')],'include':_0x329b26['include']?_['map'](_0x329b26['include'],function(_0x48673a){return{'model':db[_0x48673a[_0xd6e1('0x26')]],'as':_0x48673a['as'],'attributes':_0x48673a[_0xd6e1('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd6e1('0x12')](function(_0x39c533){logger[_0xd6e1('0x13')](_0xd6e1('0x1d'),_0x8e8379);logger[_0xd6e1('0x16')]('ShowWhatsappAccount',_0x8e8379,JSON[_0xd6e1('0x17')](_0x39c533));_0x24d99d(_0x39c533);})[_0xd6e1('0x1c')](function(_0x204ef7){logger[_0xd6e1('0x18')](_0xd6e1('0x1d'),_0x204ef7['message'],_0x8e8379);_0x339323(_0x12e87d[_0xd6e1('0x18')](0x1f4,_0x204ef7[_0xd6e1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a18374b..b9a738e 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 _0x393c=['whatsappAccount:','./whatsappAccount.events','save','remove','emit','removeListener'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x393c,0xe5));var _0xc393=function(_0x37f9fd,_0x11a523){_0x37f9fd=_0x37f9fd-0x0;var _0x27f2d8=_0x393c[_0x37f9fd];return _0x27f2d8;};'use strict';var WhatsappAccountEvents=require(_0xc393('0x0'));var events=[_0xc393('0x1'),_0xc393('0x2'),'update'];function createListener(_0x29c35b,_0x3c73eb){return function(_0x24447a){_0x3c73eb[_0xc393('0x3')](_0x29c35b,_0x24447a);};}function removeListener(_0x5af17d,_0x44ccd3){return function(){WhatsappAccountEvents[_0xc393('0x4')](_0x5af17d,_0x44ccd3);};}exports['register']=function(_0x1da1b5){for(var _0x38b37e=0x0,_0x36e128=events['length'];_0x38b37e<_0x36e128;_0x38b37e++){var _0x4f3659=events[_0x38b37e];var _0x68a548=createListener(_0xc393('0x5')+_0x4f3659,_0x1da1b5);WhatsappAccountEvents['on'](_0x4f3659,_0x68a548);}}; \ No newline at end of file +var _0xcafd=['update','emit','removeListener','register','./whatsappAccount.events','save'];(function(_0x32ead5,_0x565b7d){var _0x141ee4=function(_0x13bb7c){while(--_0x13bb7c){_0x32ead5['push'](_0x32ead5['shift']());}};_0x141ee4(++_0x565b7d);}(_0xcafd,0x64));var _0xdcaf=function(_0x3fa749,_0x43fabf){_0x3fa749=_0x3fa749-0x0;var _0x54d5c5=_0xcafd[_0x3fa749];return _0x54d5c5;};'use strict';var WhatsappAccountEvents=require(_0xdcaf('0x0'));var events=[_0xdcaf('0x1'),'remove',_0xdcaf('0x2')];function createListener(_0x5b9657,_0x4c3cd4){return function(_0x15a221){_0x4c3cd4[_0xdcaf('0x3')](_0x5b9657,_0x15a221);};}function removeListener(_0x25b43e,_0x3483ad){return function(){WhatsappAccountEvents[_0xdcaf('0x4')](_0x25b43e,_0x3483ad);};}exports[_0xdcaf('0x5')]=function(_0x1e567f){for(var _0x56f9b3=0x0,_0xc25656=events['length'];_0x56f9b3<_0xc25656;_0x56f9b3++){var _0x19302c=events[_0x56f9b3];var _0x5e0884=createListener('whatsappAccount:'+_0x19302c,_0x1e567f);WhatsappAccountEvents['on'](_0x19302c,_0x5e0884);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 6aba290..eac4b30 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 _0x4f53=['./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a685,_0x3c7c71){var _0x330af2=function(_0x2e1f07){while(--_0x2e1f07){_0x21a685['push'](_0x21a685['shift']());}};_0x330af2(++_0x3c7c71);}(_0x4f53,0x110));var _0x34f5=function(_0x3d1d2f,_0x1158fc){_0x3d1d2f=_0x3d1d2f-0x0;var _0x2bd2ba=_0x4f53[_0x3d1d2f];return _0x2bd2ba;};'use strict';var multer=require(_0x34f5('0x0'));var util=require('util');var path=require(_0x34f5('0x1'));var timeout=require(_0x34f5('0x2'));var express=require(_0x34f5('0x3'));var router=express[_0x34f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34f5('0x5'));var interaction=require(_0x34f5('0x6'));var config=require(_0x34f5('0x7'));var controller=require(_0x34f5('0x8'));router[_0x34f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x34f5('0xa')]);router[_0x34f5('0x9')](_0x34f5('0xb'),auth[_0x34f5('0xc')](),controller[_0x34f5('0xd')]);router[_0x34f5('0xe')]('/',auth[_0x34f5('0xc')](),controller[_0x34f5('0xf')]);router[_0x34f5('0x10')](_0x34f5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x34f5('0x11')](_0x34f5('0xb'),auth['isAuthenticated'](),controller[_0x34f5('0x12')]);module[_0x34f5('0x13')]=router; \ No newline at end of file +var _0x4953=['../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','get','/:id','post','create','put','update','destroy','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x4953,0x14b));var _0x3495=function(_0x2bec00,_0x5718c0){_0x2bec00=_0x2bec00-0x0;var _0x32cd5e=_0x4953[_0x2bec00];return _0x32cd5e;};'use strict';var multer=require('multer');var util=require(_0x3495('0x0'));var path=require(_0x3495('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3495('0x2')]();var fs_extra=require(_0x3495('0x3'));var auth=require(_0x3495('0x4'));var interaction=require(_0x3495('0x5'));var config=require('../../config/environment');var controller=require(_0x3495('0x6'));router['get']('/',auth[_0x3495('0x7')](),controller['index']);router[_0x3495('0x8')](_0x3495('0x9'),auth[_0x3495('0x7')](),controller['show']);router[_0x3495('0xa')]('/',auth[_0x3495('0x7')](),controller[_0x3495('0xb')]);router[_0x3495('0xc')](_0x3495('0x9'),auth[_0x3495('0x7')](),controller[_0x3495('0xd')]);router['delete'](_0x3495('0x9'),auth[_0x3495('0x7')](),controller[_0x3495('0xe')]);module[_0x3495('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2a4900c..8998d0c 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 _0x1d9d=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x1d9d,0xbc));var _0xd1d9=function(_0x1c877d,_0x221ce1){_0x1c877d=_0x1c877d-0x0;var _0x575c32=_0x1d9d[_0x1c877d];return _0x575c32;};'use strict';var Sequelize=require(_0xd1d9('0x0'));module[_0xd1d9('0x1')]={'priority':{'type':Sequelize[_0xd1d9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd1d9('0x3')],'allowNull':![],'defaultValue':_0xd1d9('0x4')},'appdata':{'type':Sequelize[_0xd1d9('0x5')]()},'description':{'type':Sequelize[_0xd1d9('0x3')]},'interval':{'type':Sequelize[_0xd1d9('0x3')],'defaultValue':_0xd1d9('0x6')}}; \ No newline at end of file +var _0x5782=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x5782,0xc2));var _0x2578=function(_0x4f3039,_0x100a43){_0x4f3039=_0x4f3039-0x0;var _0x13218c=_0x5782[_0x4f3039];return _0x13218c;};'use strict';var Sequelize=require(_0x2578('0x0'));module[_0x2578('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2578('0x2')],'allowNull':![],'defaultValue':_0x2578('0x3')},'appdata':{'type':Sequelize[_0x2578('0x4')]()},'description':{'type':Sequelize[_0x2578('0x2')]},'interval':{'type':Sequelize[_0x2578('0x2')],'defaultValue':_0x2578('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 473c864..8c70f07 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 _0x5d0a=['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','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','save','update','then','error','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4c42e9,_0xa58a1){_0x4c42e9=_0x4c42e9-0x0;var _0x34af6d=_0x5d0a[_0x4c42e9];return _0x34af6d;};'use strict';var emlformat=require(_0xa5d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5d0('0x2'));var moment=require(_0xa5d0('0x3'));var BPromise=require(_0xa5d0('0x4'));var Mustache=require(_0xa5d0('0x5'));var util=require('util');var path=require(_0xa5d0('0x6'));var sox=require(_0xa5d0('0x7'));var csv=require(_0xa5d0('0x8'));var ejs=require(_0xa5d0('0x9'));var fs=require('fs');var fs_extra=require(_0xa5d0('0xa'));var _=require(_0xa5d0('0xb'));var squel=require(_0xa5d0('0xc'));var crypto=require(_0xa5d0('0xd'));var jsforce=require(_0xa5d0('0xe'));var deskjs=require(_0xa5d0('0xf'));var toCsv=require(_0xa5d0('0x8'));var querystring=require('querystring');var Papa=require(_0xa5d0('0x10'));var Redis=require(_0xa5d0('0x11'));var authService=require(_0xa5d0('0x12'));var qs=require(_0xa5d0('0x13'));var as=require(_0xa5d0('0x14'));var hardwareService=require(_0xa5d0('0x15'));var logger=require(_0xa5d0('0x16'))(_0xa5d0('0x17'));var utils=require(_0xa5d0('0x18'));var config=require(_0xa5d0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d0('0x1a'))['db'];function respondWithStatusCode(_0x4bdb6b,_0x566b17){_0x566b17=_0x566b17||0xcc;return function(_0x3ab8b9){if(_0x3ab8b9){return _0x4bdb6b[_0xa5d0('0x1b')](_0x566b17);}return _0x4bdb6b[_0xa5d0('0x1c')](_0x566b17)[_0xa5d0('0x1d')]();};}function respondWithResult(_0x4cb722,_0x56ee85){_0x56ee85=_0x56ee85||0xc8;return function(_0xf06747){if(_0xf06747){return _0x4cb722[_0xa5d0('0x1c')](_0x56ee85)[_0xa5d0('0x1e')](_0xf06747);}};}function respondWithFilteredResult(_0x22afa2,_0x3847bb){return function(_0x146722){if(_0x146722){var _0x1461d5=typeof _0x3847bb['offset']===_0xa5d0('0x1f')&&typeof _0x3847bb['limit']===_0xa5d0('0x1f');var _0x3c00fd=_0x146722['count'];var _0x5bc068=_0x1461d5?0x0:_0x3847bb[_0xa5d0('0x20')];var _0x234254=_0x1461d5?_0x146722['count']:_0x3847bb[_0xa5d0('0x20')]+_0x3847bb[_0xa5d0('0x21')];var _0x9fab4;if(_0x234254>=_0x3c00fd){_0x234254=_0x3c00fd;_0x9fab4=0xc8;}else{_0x9fab4=0xce;}_0x22afa2[_0xa5d0('0x1c')](_0x9fab4);return _0x22afa2[_0xa5d0('0x22')](_0xa5d0('0x23'),_0x5bc068+'-'+_0x234254+'/'+_0x3c00fd)['json'](_0x146722);}return null;};}function patchUpdates(_0x4cf8db){return function(_0x2a56ff){try{jsonpatch[_0xa5d0('0x24')](_0x2a56ff,_0x4cf8db,!![]);}catch(_0x4cc587){return BPromise['reject'](_0x4cc587);}return _0x2a56ff[_0xa5d0('0x25')]();};}function saveUpdates(_0x42a745,_0x27a4cb){return function(_0xde8c41){if(_0xde8c41){return _0xde8c41[_0xa5d0('0x26')](_0x42a745)[_0xa5d0('0x27')](function(_0x518a60){return _0x518a60;});}return null;};}function removeEntity(_0x2de295,_0x307377){return function(_0xefd903){if(_0xefd903){return _0xefd903['destroy']()[_0xa5d0('0x27')](function(){_0x2de295[_0xa5d0('0x1c')](0xcc)[_0xa5d0('0x1d')]();});}};}function handleEntityNotFound(_0x4d5e7a,_0x4916f6){return function(_0x758789){if(!_0x758789){_0x4d5e7a['sendStatus'](0x194);}return _0x758789;};}function handleError(_0x49ca76,_0x55cd15){_0x55cd15=_0x55cd15||0x1f4;return function(_0x2b29a5){logger[_0xa5d0('0x28')](_0x2b29a5['stack']);if(_0x2b29a5[_0xa5d0('0x29')]){delete _0x2b29a5['name'];}_0x49ca76[_0xa5d0('0x1c')](_0x55cd15)['send'](_0x2b29a5);};}exports[_0xa5d0('0x2a')]=function(_0xc3336f,_0x431fea){var _0x48dbd2={},_0x5495cb={},_0x5bcfe1={'count':0x0,'rows':[]};var _0x3d7818=_[_0xa5d0('0x2b')](db[_0xa5d0('0x2c')][_0xa5d0('0x2d')],function(_0x5e876c){return{'name':_0x5e876c[_0xa5d0('0x2e')],'type':_0x5e876c[_0xa5d0('0x2f')]['key']};});_0x5495cb[_0xa5d0('0x30')]=_[_0xa5d0('0x2b')](_0x3d7818,_0xa5d0('0x29'));_0x5495cb[_0xa5d0('0x31')]=_[_0xa5d0('0x32')](_0xc3336f[_0xa5d0('0x31')]);_0x5495cb[_0xa5d0('0x33')]=_[_0xa5d0('0x34')](_0x5495cb[_0xa5d0('0x30')],_0x5495cb[_0xa5d0('0x31')]);_0x48dbd2[_0xa5d0('0x35')]=_['intersection'](_0x5495cb[_0xa5d0('0x30')],qs[_0xa5d0('0x36')](_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x36')]));_0x48dbd2['attributes']=_0x48dbd2[_0xa5d0('0x35')][_0xa5d0('0x37')]?_0x48dbd2['attributes']:_0x5495cb[_0xa5d0('0x30')];if(!_0xc3336f['query'][_0xa5d0('0x38')](_0xa5d0('0x39'))){_0x48dbd2['limit']=qs['limit'](_0xc3336f['query'][_0xa5d0('0x21')]);_0x48dbd2['offset']=qs[_0xa5d0('0x20')](_0xc3336f[_0xa5d0('0x31')]['offset']);}_0x48dbd2[_0xa5d0('0x3a')]=qs[_0xa5d0('0x3b')](_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x3b')]);_0x48dbd2[_0xa5d0('0x3c')]=qs[_0xa5d0('0x33')](_[_0xa5d0('0x3d')](_0xc3336f[_0xa5d0('0x31')],_0x5495cb[_0xa5d0('0x33')]),_0x3d7818);if(_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x3e')]){_0x48dbd2[_0xa5d0('0x3c')]=_['merge'](_0x48dbd2[_0xa5d0('0x3c')],{'$or':_['map'](_0x3d7818,function(_0x393daf){if(_0x393daf[_0xa5d0('0x2f')]!==_0xa5d0('0x3f')){var _0x40c179={};_0x40c179[_0x393daf[_0xa5d0('0x29')]]={'$like':'%'+_0xc3336f[_0xa5d0('0x31')]['filter']+'%'};return _0x40c179;}})});}_0x48dbd2=_[_0xa5d0('0x40')]({},_0x48dbd2,_0xc3336f['options']);var _0x16fe00={'where':_0x48dbd2['where']};return db['WhatsappApplication'][_0xa5d0('0x41')](_0x16fe00)[_0xa5d0('0x27')](function(_0x249b28){_0x5bcfe1[_0xa5d0('0x41')]=_0x249b28;if(_0xc3336f['query'][_0xa5d0('0x42')]){_0x48dbd2[_0xa5d0('0x43')]=[{'all':!![]}];}return db[_0xa5d0('0x2c')][_0xa5d0('0x44')](_0x48dbd2);})[_0xa5d0('0x27')](function(_0x26d37f){_0x5bcfe1[_0xa5d0('0x45')]=_0x26d37f;return _0x5bcfe1;})['then'](respondWithFilteredResult(_0x431fea,_0x48dbd2))[_0xa5d0('0x46')](handleError(_0x431fea,null));};exports[_0xa5d0('0x47')]=function(_0x20ae65,_0x343376){var _0x1090b6={'raw':!![],'where':{'id':_0x20ae65[_0xa5d0('0x48')]['id']}},_0x358b23={};_0x358b23[_0xa5d0('0x30')]=_['keys'](db[_0xa5d0('0x2c')]['rawAttributes']);_0x358b23[_0xa5d0('0x31')]=_['keys'](_0x20ae65[_0xa5d0('0x31')]);_0x358b23['filters']=_[_0xa5d0('0x34')](_0x358b23['model'],_0x358b23[_0xa5d0('0x31')]);_0x1090b6[_0xa5d0('0x35')]=_['intersection'](_0x358b23[_0xa5d0('0x30')],qs[_0xa5d0('0x36')](_0x20ae65[_0xa5d0('0x31')][_0xa5d0('0x36')]));_0x1090b6['attributes']=_0x1090b6['attributes'][_0xa5d0('0x37')]?_0x1090b6[_0xa5d0('0x35')]:_0x358b23[_0xa5d0('0x30')];if(_0x20ae65[_0xa5d0('0x31')]['includeAll']){_0x1090b6['include']=[{'all':!![]}];}_0x1090b6=_[_0xa5d0('0x40')]({},_0x1090b6,_0x20ae65[_0xa5d0('0x49')]);return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')](_0x1090b6)[_0xa5d0('0x27')](handleEntityNotFound(_0x343376,null))['then'](respondWithResult(_0x343376,null))['catch'](handleError(_0x343376,null));};exports[_0xa5d0('0x4b')]=function(_0x9a4c50,_0x2d8551){return db[_0xa5d0('0x2c')][_0xa5d0('0x4b')](_0x9a4c50[_0xa5d0('0x4c')],{})[_0xa5d0('0x27')](respondWithResult(_0x2d8551,0xc9))[_0xa5d0('0x46')](handleError(_0x2d8551,null));};exports[_0xa5d0('0x26')]=function(_0xbb7c45,_0x555ec8){if(_0xbb7c45[_0xa5d0('0x4c')]['id']){delete _0xbb7c45['body']['id'];}return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')]({'where':{'id':_0xbb7c45['params']['id']}})[_0xa5d0('0x27')](handleEntityNotFound(_0x555ec8,null))[_0xa5d0('0x27')](saveUpdates(_0xbb7c45[_0xa5d0('0x4c')],null))[_0xa5d0('0x27')](respondWithResult(_0x555ec8,null))[_0xa5d0('0x46')](handleError(_0x555ec8,null));};exports['destroy']=function(_0x30d13c,_0x54bd94){return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')]({'where':{'id':_0x30d13c[_0xa5d0('0x48')]['id']}})[_0xa5d0('0x27')](handleEntityNotFound(_0x54bd94,null))['then'](removeEntity(_0x54bd94,null))['catch'](handleError(_0x54bd94,null));}; \ No newline at end of file +var _0xc0d7=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','include','findAll','find','create','catch','body','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1a2c22,_0x15027){var _0x2fc87e=function(_0x587806){while(--_0x587806){_0x1a2c22['push'](_0x1a2c22['shift']());}};_0x2fc87e(++_0x15027);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x3af1f0,_0x1e6081){_0x3af1f0=_0x3af1f0-0x0;var _0x5f2b4a=_0xc0d7[_0x3af1f0];return _0x5f2b4a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c0d('0x0'));var rp=require(_0x7c0d('0x1'));var moment=require(_0x7c0d('0x2'));var BPromise=require(_0x7c0d('0x3'));var Mustache=require(_0x7c0d('0x4'));var util=require(_0x7c0d('0x5'));var path=require(_0x7c0d('0x6'));var sox=require(_0x7c0d('0x7'));var csv=require(_0x7c0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c0d('0x9'));var _=require(_0x7c0d('0xa'));var squel=require(_0x7c0d('0xb'));var crypto=require(_0x7c0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c0d('0xd'));var toCsv=require(_0x7c0d('0x8'));var querystring=require(_0x7c0d('0xe'));var Papa=require(_0x7c0d('0xf'));var Redis=require('ioredis');var authService=require(_0x7c0d('0x10'));var qs=require(_0x7c0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c0d('0x12'))(_0x7c0d('0x13'));var utils=require('../../config/utils');var config=require(_0x7c0d('0x14'));var licenseUtil=require(_0x7c0d('0x15'));var db=require(_0x7c0d('0x16'))['db'];function respondWithStatusCode(_0x198dde,_0x41236d){_0x41236d=_0x41236d||0xcc;return function(_0x34dccf){if(_0x34dccf){return _0x198dde['sendStatus'](_0x41236d);}return _0x198dde[_0x7c0d('0x17')](_0x41236d)[_0x7c0d('0x18')]();};}function respondWithResult(_0x2ee593,_0x25c4a8){_0x25c4a8=_0x25c4a8||0xc8;return function(_0x33dd94){if(_0x33dd94){return _0x2ee593[_0x7c0d('0x17')](_0x25c4a8)[_0x7c0d('0x19')](_0x33dd94);}};}function respondWithFilteredResult(_0x13f301,_0x4a5fb4){return function(_0x340937){if(_0x340937){var _0x4e9850=typeof _0x4a5fb4[_0x7c0d('0x1a')]==='undefined'&&typeof _0x4a5fb4[_0x7c0d('0x1b')]===_0x7c0d('0x1c');var _0x478100=_0x340937[_0x7c0d('0x1d')];var _0x2841e1=_0x4e9850?0x0:_0x4a5fb4[_0x7c0d('0x1a')];var _0x1418ee=_0x4e9850?_0x340937[_0x7c0d('0x1d')]:_0x4a5fb4[_0x7c0d('0x1a')]+_0x4a5fb4[_0x7c0d('0x1b')];var _0x111dbe;if(_0x1418ee>=_0x478100){_0x1418ee=_0x478100;_0x111dbe=0xc8;}else{_0x111dbe=0xce;}_0x13f301[_0x7c0d('0x17')](_0x111dbe);return _0x13f301[_0x7c0d('0x1e')](_0x7c0d('0x1f'),_0x2841e1+'-'+_0x1418ee+'/'+_0x478100)[_0x7c0d('0x19')](_0x340937);}return null;};}function patchUpdates(_0x12e19a){return function(_0x2f0ac0){try{jsonpatch[_0x7c0d('0x20')](_0x2f0ac0,_0x12e19a,!![]);}catch(_0x1308c6){return BPromise['reject'](_0x1308c6);}return _0x2f0ac0['save']();};}function saveUpdates(_0x5dae80,_0x54b14f){return function(_0x5872fe){if(_0x5872fe){return _0x5872fe[_0x7c0d('0x21')](_0x5dae80)[_0x7c0d('0x22')](function(_0x1c7b84){return _0x1c7b84;});}return null;};}function removeEntity(_0x2f657e,_0x1ef191){return function(_0x2a92ce){if(_0x2a92ce){return _0x2a92ce[_0x7c0d('0x23')]()['then'](function(){_0x2f657e[_0x7c0d('0x17')](0xcc)[_0x7c0d('0x18')]();});}};}function handleEntityNotFound(_0x5aa006,_0x540abc){return function(_0x357cca){if(!_0x357cca){_0x5aa006['sendStatus'](0x194);}return _0x357cca;};}function handleError(_0x236973,_0x305a3a){_0x305a3a=_0x305a3a||0x1f4;return function(_0x43ba3b){logger[_0x7c0d('0x24')](_0x43ba3b[_0x7c0d('0x25')]);if(_0x43ba3b['name']){delete _0x43ba3b[_0x7c0d('0x26')];}_0x236973[_0x7c0d('0x17')](_0x305a3a)[_0x7c0d('0x27')](_0x43ba3b);};}exports[_0x7c0d('0x28')]=function(_0x2a8756,_0x4aea76){var _0x2b261={},_0x553627={},_0x3a8947={'count':0x0,'rows':[]};var _0x1d2020=_[_0x7c0d('0x29')](db[_0x7c0d('0x2a')][_0x7c0d('0x2b')],function(_0x35284b){return{'name':_0x35284b['fieldName'],'type':_0x35284b[_0x7c0d('0x2c')]['key']};});_0x553627[_0x7c0d('0x2d')]=_[_0x7c0d('0x29')](_0x1d2020,'name');_0x553627['query']=_[_0x7c0d('0x2e')](_0x2a8756['query']);_0x553627[_0x7c0d('0x2f')]=_[_0x7c0d('0x30')](_0x553627['model'],_0x553627['query']);_0x2b261['attributes']=_['intersection'](_0x553627[_0x7c0d('0x2d')],qs['fields'](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x32')]));_0x2b261['attributes']=_0x2b261[_0x7c0d('0x33')][_0x7c0d('0x34')]?_0x2b261[_0x7c0d('0x33')]:_0x553627[_0x7c0d('0x2d')];if(!_0x2a8756['query'][_0x7c0d('0x35')](_0x7c0d('0x36'))){_0x2b261[_0x7c0d('0x1b')]=qs[_0x7c0d('0x1b')](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x1b')]);_0x2b261[_0x7c0d('0x1a')]=qs[_0x7c0d('0x1a')](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x1a')]);}_0x2b261['order']=qs[_0x7c0d('0x37')](_0x2a8756[_0x7c0d('0x31')]['sort']);_0x2b261[_0x7c0d('0x38')]=qs[_0x7c0d('0x2f')](_[_0x7c0d('0x39')](_0x2a8756[_0x7c0d('0x31')],_0x553627[_0x7c0d('0x2f')]),_0x1d2020);if(_0x2a8756[_0x7c0d('0x31')]['filter']){_0x2b261[_0x7c0d('0x38')]=_[_0x7c0d('0x3a')](_0x2b261[_0x7c0d('0x38')],{'$or':_[_0x7c0d('0x29')](_0x1d2020,function(_0xf5058e){if(_0xf5058e['type']!=='VIRTUAL'){var _0x653e1f={};_0x653e1f[_0xf5058e[_0x7c0d('0x26')]]={'$like':'%'+_0x2a8756['query'][_0x7c0d('0x3b')]+'%'};return _0x653e1f;}})});}_0x2b261=_['merge']({},_0x2b261,_0x2a8756[_0x7c0d('0x3c')]);var _0x544e9f={'where':_0x2b261['where']};return db[_0x7c0d('0x2a')]['count'](_0x544e9f)[_0x7c0d('0x22')](function(_0x1a0daa){_0x3a8947['count']=_0x1a0daa;if(_0x2a8756['query']['includeAll']){_0x2b261[_0x7c0d('0x3d')]=[{'all':!![]}];}return db[_0x7c0d('0x2a')][_0x7c0d('0x3e')](_0x2b261);})[_0x7c0d('0x22')](function(_0x5dc200){_0x3a8947['rows']=_0x5dc200;return _0x3a8947;})[_0x7c0d('0x22')](respondWithFilteredResult(_0x4aea76,_0x2b261))['catch'](handleError(_0x4aea76,null));};exports['show']=function(_0x420ecf,_0x5dd062){var _0x2ae43c={'raw':!![],'where':{'id':_0x420ecf['params']['id']}},_0x36aafb={};_0x36aafb[_0x7c0d('0x2d')]=_[_0x7c0d('0x2e')](db[_0x7c0d('0x2a')][_0x7c0d('0x2b')]);_0x36aafb[_0x7c0d('0x31')]=_['keys'](_0x420ecf[_0x7c0d('0x31')]);_0x36aafb[_0x7c0d('0x2f')]=_['intersection'](_0x36aafb[_0x7c0d('0x2d')],_0x36aafb[_0x7c0d('0x31')]);_0x2ae43c[_0x7c0d('0x33')]=_[_0x7c0d('0x30')](_0x36aafb['model'],qs[_0x7c0d('0x32')](_0x420ecf[_0x7c0d('0x31')][_0x7c0d('0x32')]));_0x2ae43c[_0x7c0d('0x33')]=_0x2ae43c[_0x7c0d('0x33')]['length']?_0x2ae43c[_0x7c0d('0x33')]:_0x36aafb['model'];if(_0x420ecf[_0x7c0d('0x31')]['includeAll']){_0x2ae43c[_0x7c0d('0x3d')]=[{'all':!![]}];}_0x2ae43c=_[_0x7c0d('0x3a')]({},_0x2ae43c,_0x420ecf[_0x7c0d('0x3c')]);return db[_0x7c0d('0x2a')][_0x7c0d('0x3f')](_0x2ae43c)['then'](handleEntityNotFound(_0x5dd062,null))[_0x7c0d('0x22')](respondWithResult(_0x5dd062,null))['catch'](handleError(_0x5dd062,null));};exports[_0x7c0d('0x40')]=function(_0x182029,_0x32bb12){return db['WhatsappApplication'][_0x7c0d('0x40')](_0x182029['body'],{})['then'](respondWithResult(_0x32bb12,0xc9))[_0x7c0d('0x41')](handleError(_0x32bb12,null));};exports[_0x7c0d('0x21')]=function(_0x24a5c4,_0x57038b){if(_0x24a5c4[_0x7c0d('0x42')]['id']){delete _0x24a5c4[_0x7c0d('0x42')]['id'];}return db[_0x7c0d('0x2a')]['find']({'where':{'id':_0x24a5c4[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x22')](handleEntityNotFound(_0x57038b,null))[_0x7c0d('0x22')](saveUpdates(_0x24a5c4[_0x7c0d('0x42')],null))[_0x7c0d('0x22')](respondWithResult(_0x57038b,null))['catch'](handleError(_0x57038b,null));};exports['destroy']=function(_0x41c115,_0x333ebf){return db['WhatsappApplication']['find']({'where':{'id':_0x41c115[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x22')](handleEntityNotFound(_0x333ebf,null))[_0x7c0d('0x22')](removeEntity(_0x333ebf,null))['catch'](handleError(_0x333ebf,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c8ad6c9..c0f7c45 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 _0x984b=['bluebird','rimraf','../../config/environment','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','api','moment'];(function(_0x4c6ea2,_0x235789){var _0x3f1e64=function(_0x32cc91){while(--_0x32cc91){_0x4c6ea2['push'](_0x4c6ea2['shift']());}};_0x3f1e64(++_0x235789);}(_0x984b,0xee));var _0xb984=function(_0x5316a3,_0x1ea00b){_0x5316a3=_0x5316a3-0x0;var _0x1c7d1e=_0x984b[_0x5316a3];return _0x1c7d1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb984('0x0'));var moment=require(_0xb984('0x1'));var BPromise=require(_0xb984('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x2cca53,_0x46c541){return _0x2cca53['define'](_0xb984('0x5'),attributes,{'tableName':_0xb984('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb984('0x7')});}; \ No newline at end of file +var _0x7aaf=['rimraf','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise'];(function(_0x4fac8d,_0x327051){var _0x204bdb=function(_0xe6939a){while(--_0xe6939a){_0x4fac8d['push'](_0x4fac8d['shift']());}};_0x204bdb(++_0x327051);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x4072e5,_0x2dd9f1){_0x4072e5=_0x4072e5-0x0;var _0x5c24e8=_0x7aaf[_0x4072e5];return _0x5c24e8;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var logger=require(_0xf7aa('0x1'))(_0xf7aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7aa('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x5'));module[_0xf7aa('0x6')]=function(_0x1babcd,_0xf02ed5){return _0x1babcd['define'](_0xf7aa('0x7'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf7aa('0x8')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 020068a..111ef55 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x008c,0x188));var _0xc008=function(_0x4ea809,_0x5416a6){_0x4ea809=_0x4ea809-0x0;var _0x31be45=_0x008c[_0x4ea809];return _0x31be45;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xeec6[_0x5e9876];return _0x576c48;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 04ab133..e4f6298 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 _0xa6b0=['/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x2dca64,_0x85899){var _0x442ba2=function(_0x357ba8){while(--_0x357ba8){_0x2dca64['push'](_0x2dca64['shift']());}};_0x442ba2(++_0x85899);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x420c27,_0xecec40){_0x420c27=_0x420c27-0x0;var _0x555949=_0xa6b0[_0x420c27];return _0x555949;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0x8')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x8')](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);router[_0x0a6b('0x12')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller['addMessage']);router['post'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x17')),controller[_0x0a6b('0x18')]);router[_0x0a6b('0x19')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')]('whatsapp',_0x0a6b('0x1a')),controller[_0x0a6b('0x1b')]);router['delete'](_0x0a6b('0xd'),auth['isAuthenticated'](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x1c')),controller[_0x0a6b('0x1d')]);router['delete'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),controller['removeTags']);module[_0x0a6b('0x1e')]=router; \ No newline at end of file +var _0x9a5a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x9a5a,0x194));var _0xa9a5=function(_0x46302f,_0x4ef2b1){_0x46302f=_0x46302f-0x0;var _0x11cd60=_0x9a5a[_0x46302f];return _0x11cd60;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);router[_0xa9a5('0x14')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller['addMessage']);router[_0xa9a5('0x14')](_0xa9a5('0x15'),auth[_0xa9a5('0xd')](),interaction[_0xa9a5('0x16')](_0xa9a5('0x17'),_0xa9a5('0x18')),controller['addTags']);router[_0xa9a5('0x19')](_0xa9a5('0x1a'),auth[_0xa9a5('0xd')](),interaction[_0xa9a5('0x16')]('whatsapp',_0xa9a5('0x1b')),controller[_0xa9a5('0x1c')]);router[_0xa9a5('0x1d')]('/:id',auth[_0xa9a5('0xd')](),interaction['tracked']('whatsapp',_0xa9a5('0x1e')),controller[_0xa9a5('0x1f')]);router['delete'](_0xa9a5('0x15'),auth['isAuthenticated'](),controller[_0xa9a5('0x20')]);module[_0xa9a5('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 18166ec..1b5a04f 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 _0x6379=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x13f323,_0x57bdca){var _0x5bf651=function(_0x598adf){while(--_0x598adf){_0x13f323['push'](_0x13f323['shift']());}};_0x5bf651(++_0x57bdca);}(_0x6379,0x84));var _0x9637=function(_0x1a7244,_0x3d99d9){_0x1a7244=_0x1a7244-0x0;var _0x5c4e9f=_0x6379[_0x1a7244];return _0x5c4e9f;};'use strict';var Sequelize=require(_0x9637('0x0'));var moment=require(_0x9637('0x1'));module[_0x9637('0x2')]={'closed':{'type':Sequelize[_0x9637('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9637('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9637('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9637('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9637('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in',_0x9637('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9637('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x29b1=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x2345fc,_0x127208){var _0x5d1fa3=function(_0x1ffc49){while(--_0x1ffc49){_0x2345fc['push'](_0x2345fc['shift']());}};_0x5d1fa3(++_0x127208);}(_0x29b1,0x13b));var _0x129b=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x29b1[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x129b('0x0')]={'closed':{'type':Sequelize[_0x129b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x129b('0x2')]},'disposition':{'type':Sequelize[_0x129b('0x3')]},'secondDisposition':{'type':Sequelize[_0x129b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x129b('0x3')]},'note':{'type':Sequelize[_0x129b('0x3')]},'phone':{'type':Sequelize[_0x129b('0x3')]},'read1stAt':{'type':Sequelize[_0x129b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x129b('0x4')]('in',_0x129b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x129b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x129b('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 fcdaf2b..1ee3c14 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 _0xcd94=['N.A.','closed','closedAt','toString','existsSync','createWriteStream','basename','out','System','secret','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','end','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','user','show','params','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','ids','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','tmp','root','server','files','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','get','Whatsapp'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcd94,0x19b));var _0x4cd9=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0xcd94[_0x7cb10c];return _0x11df59;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4cd9('0x0'));var moment=require(_0x4cd9('0x1'));var BPromise=require(_0x4cd9('0x2'));var util=require(_0x4cd9('0x3'));var path=require(_0x4cd9('0x4'));var ejs=require(_0x4cd9('0x5'));var fs=require('fs');var _=require(_0x4cd9('0x6'));var Redis=require('ioredis');var interaction=require(_0x4cd9('0x7'));var qs=require(_0x4cd9('0x8'));var pdf=require(_0x4cd9('0x9'));var logger=require(_0x4cd9('0xa'))(_0x4cd9('0xb'));var config=require(_0x4cd9('0xc'));var db=require(_0x4cd9('0xd'))['db'];config[_0x4cd9('0xe')]=_[_0x4cd9('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4cd9('0x10'))(new Redis(config[_0x4cd9('0xe')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4a424a,_0x4d70e3){_0x4d70e3=_0x4d70e3||0xcc;return function(_0x515512){if(_0x515512){return _0x4a424a[_0x4cd9('0x11')](_0x4d70e3);}return _0x4a424a[_0x4cd9('0x12')](_0x4d70e3)['end']();};}function respondWithResult(_0x5e2773,_0x25f934){_0x25f934=_0x25f934||0xc8;return function(_0xf50e8c){if(_0xf50e8c){return _0x5e2773[_0x4cd9('0x12')](_0x25f934)[_0x4cd9('0x13')](_0xf50e8c);}};}function respondWithFilteredResult(_0x522a10,_0x3c35d7){return function(_0x5839c2){if(_0x5839c2){var _0x42f724=typeof _0x3c35d7[_0x4cd9('0x14')]===_0x4cd9('0x15')&&typeof _0x3c35d7[_0x4cd9('0x16')]===_0x4cd9('0x15');var _0xc8f727=_0x5839c2[_0x4cd9('0x17')];var _0x3b020d=_0x42f724?0x0:_0x3c35d7['offset'];var _0x4b0ba3=_0x42f724?_0x5839c2[_0x4cd9('0x17')]:_0x3c35d7[_0x4cd9('0x14')]+_0x3c35d7[_0x4cd9('0x16')];var _0x2b471f;if(_0x4b0ba3>=_0xc8f727){_0x4b0ba3=_0xc8f727;_0x2b471f=0xc8;}else{_0x2b471f=0xce;}_0x522a10[_0x4cd9('0x12')](_0x2b471f);return _0x522a10[_0x4cd9('0x18')]('Content-Range',_0x3b020d+'-'+_0x4b0ba3+'/'+_0xc8f727)[_0x4cd9('0x13')](_0x5839c2);}return null;};}function saveUpdates(_0x187dfa){return function(_0x1dbc8a){if(_0x1dbc8a){return _0x1dbc8a[_0x4cd9('0x19')](_0x187dfa)[_0x4cd9('0x1a')](function(_0x9b74bd){return _0x9b74bd;});}return null;};}function removeEntity(_0x366d97){return function(_0x39efdb){if(_0x39efdb){return _0x39efdb[_0x4cd9('0x1b')]()['then'](function(){_0x366d97[_0x4cd9('0x12')](0xcc)[_0x4cd9('0x1c')]();});}};}function handleEntityNotFound(_0x4f6b7f){return function(_0x28ccfd){if(!_0x28ccfd){_0x4f6b7f['sendStatus'](0x194);}return _0x28ccfd;};}function handleError(_0x26ee3c,_0x4424dc){_0x4424dc=_0x4424dc||0x1f4;return function(_0x2cc1b4){logger[_0x4cd9('0x1d')](_0x2cc1b4[_0x4cd9('0x1e')]);if(_0x2cc1b4[_0x4cd9('0x1f')]){delete _0x2cc1b4[_0x4cd9('0x1f')];}_0x26ee3c['status'](_0x4424dc)[_0x4cd9('0x20')](_0x2cc1b4);};}exports[_0x4cd9('0x21')]=function(_0x3bca78,_0x423153){var _0x2f0ed1={};var _0x5c0464=_['map'](db[_0x4cd9('0x22')][_0x4cd9('0x23')],function(_0x1954ed){return{'name':_0x1954ed[_0x4cd9('0x24')],'type':_0x1954ed[_0x4cd9('0x25')]['key']};});_0x2f0ed1=qs[_0x4cd9('0x26')](_0x5c0464,_0x3bca78);return interaction[_0x4cd9('0x27')](_0x4cd9('0x28'),_0x3bca78['query'],_0x3bca78[_0x4cd9('0x29')],_0x2f0ed1,_0x5c0464)['then'](respondWithFilteredResult(_0x423153,_0x2f0ed1))['catch'](handleError(_0x423153,null));};exports[_0x4cd9('0x2a')]=function(_0x25aee2,_0x39402b){var _0xb00090={'raw':![],'where':{'id':_0x25aee2[_0x4cd9('0x2b')]['id']}},_0x2d0910={};_0x2d0910[_0x4cd9('0x2c')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x2d0910['query']=_[_0x4cd9('0x2d')](_0x25aee2['query']);_0x2d0910[_0x4cd9('0x2e')]=_[_0x4cd9('0x2f')](_0x2d0910[_0x4cd9('0x2c')],_0x2d0910[_0x4cd9('0x30')]);_0xb00090[_0x4cd9('0x31')]=_['intersection'](_0x2d0910[_0x4cd9('0x2c')],qs[_0x4cd9('0x32')](_0x25aee2[_0x4cd9('0x30')][_0x4cd9('0x32')]));_0xb00090[_0x4cd9('0x31')]=_0xb00090[_0x4cd9('0x31')][_0x4cd9('0x33')]?_0xb00090[_0x4cd9('0x31')]:_0x2d0910[_0x4cd9('0x2c')];if(_0x25aee2['query'][_0x4cd9('0x34')]){_0xb00090[_0x4cd9('0x35')]=[{'all':!![]}];}_0xb00090=_[_0x4cd9('0x36')]({},_0xb00090,_0x25aee2[_0x4cd9('0x37')]);return db[_0x4cd9('0x22')]['find'](_0xb00090)['then'](handleEntityNotFound(_0x39402b,null))[_0x4cd9('0x1a')](respondWithResult(_0x39402b,null))[_0x4cd9('0x38')](handleError(_0x39402b,null));};exports[_0x4cd9('0x39')]=function(_0xb80264,_0x5f0ba2){return db[_0x4cd9('0x22')]['create'](_0xb80264[_0x4cd9('0x3a')],{})['then'](respondWithResult(_0x5f0ba2,0xc9))[_0x4cd9('0x38')](handleError(_0x5f0ba2,null));};exports[_0x4cd9('0x19')]=function(_0x4120ea,_0xf7da19){if(_0x4120ea[_0x4cd9('0x3a')]['id']){delete _0x4120ea[_0x4cd9('0x3a')]['id'];}return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x4120ea[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0xf7da19,null))['then'](saveUpdates(_0x4120ea['body'],null))[_0x4cd9('0x1a')](respondWithResult(_0xf7da19,null))[_0x4cd9('0x38')](handleError(_0xf7da19,null));};exports[_0x4cd9('0x1b')]=function(_0xa257bf,_0x29554a){return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0xa257bf[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x29554a,null))[_0x4cd9('0x1a')](removeEntity(_0x29554a,null))[_0x4cd9('0x38')](handleError(_0x29554a,null));};exports['describe']=function(_0x97f7fa,_0x2a2abc){return db[_0x4cd9('0x22')][_0x4cd9('0x3c')]()['then'](respondWithResult(_0x2a2abc,null))['catch'](handleError(_0x2a2abc,null));};exports[_0x4cd9('0x3d')]=function(_0x2eb5c5,_0x48d9ff){return db[_0x4cd9('0x3e')][_0x4cd9('0x3b')]({'where':{'id':_0x2eb5c5[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x48d9ff,null))[_0x4cd9('0x1a')](function(_0xc745db){if(_0xc745db){return _0xc745db[_0x4cd9('0x3d')](_0x2eb5c5[_0x4cd9('0x3a')]['ids'],_[_0x4cd9('0x3f')](_0x2eb5c5['body'],['ids','id'])||{});}})[_0x4cd9('0x1a')](respondWithResult(_0x48d9ff,null))[_0x4cd9('0x38')](handleError(_0x48d9ff,null));};exports[_0x4cd9('0x40')]=function(_0x441452,_0x363587){var _0x71cf4c={'raw':![],'where':{}};var _0xbd8b4a={};var _0x5dae70={'count':0x0,'rows':[]};return db[_0x4cd9('0x22')][_0x4cd9('0x41')]({'where':{'id':_0x441452[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x363587,null))[_0x4cd9('0x1a')](function(_0x4a094b){if(_0x4a094b){_0xbd8b4a['model']=_[_0x4cd9('0x2d')](db[_0x4cd9('0x3e')][_0x4cd9('0x23')]);_0xbd8b4a[_0x4cd9('0x30')]=_['keys'](_0x441452[_0x4cd9('0x30')]);_0xbd8b4a[_0x4cd9('0x2e')]=_[_0x4cd9('0x2f')](_0xbd8b4a[_0x4cd9('0x2c')],_0xbd8b4a[_0x4cd9('0x30')]);_0x71cf4c[_0x4cd9('0x31')]=_[_0x4cd9('0x2f')](_0xbd8b4a[_0x4cd9('0x2c')],qs[_0x4cd9('0x32')](_0x441452[_0x4cd9('0x30')][_0x4cd9('0x32')]));_0x71cf4c['attributes']=_0x71cf4c[_0x4cd9('0x31')][_0x4cd9('0x33')]?_0x71cf4c[_0x4cd9('0x31')]:_0xbd8b4a[_0x4cd9('0x2c')];if(!_0x441452[_0x4cd9('0x30')][_0x4cd9('0x42')](_0x4cd9('0x43'))){_0x71cf4c[_0x4cd9('0x16')]=qs[_0x4cd9('0x16')](_0x441452[_0x4cd9('0x30')]['limit']);_0x71cf4c[_0x4cd9('0x14')]=qs[_0x4cd9('0x14')](_0x441452[_0x4cd9('0x30')][_0x4cd9('0x14')]);}_0x71cf4c[_0x4cd9('0x44')]=qs['sort'](_0x441452['query']['sort']);_0x71cf4c[_0x4cd9('0x45')]=qs[_0x4cd9('0x2e')](_[_0x4cd9('0x46')](_0x441452[_0x4cd9('0x30')],_0xbd8b4a['filters']));_0x71cf4c[_0x4cd9('0x45')][_0x4cd9('0x47')]=_0x4a094b['id'];if(_0x441452[_0x4cd9('0x30')][_0x4cd9('0x48')]){_0x71cf4c[_0x4cd9('0x45')]=_['merge'](_0x71cf4c[_0x4cd9('0x45')],{'$or':_[_0x4cd9('0x49')](_0x71cf4c[_0x4cd9('0x31')],function(_0x371d90){var _0x3ddc3a={};_0x3ddc3a[_0x371d90]={'$like':'%'+_0x441452[_0x4cd9('0x30')][_0x4cd9('0x48')]+'%'};return _0x3ddc3a;})});}if(_0x441452[_0x4cd9('0x30')]['$gte']){var _0x45f9db=_0x441452[_0x4cd9('0x30')][_0x4cd9('0x4a')][_0x4cd9('0x4b')](',');var _0x263467={};_0x263467[_0x45f9db[0x0]]={'$gte':moment(_0x45f9db[0x1])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))};_0x71cf4c[_0x4cd9('0x45')]=_[_0x4cd9('0x36')](_0x71cf4c[_0x4cd9('0x45')],_0x263467);}_0x71cf4c=_[_0x4cd9('0x36')]({},_0x71cf4c,_0x441452[_0x4cd9('0x37')]);return db[_0x4cd9('0x3e')][_0x4cd9('0x17')]({'where':_0x71cf4c['where']})[_0x4cd9('0x1a')](function(_0x1aa3e0){_0x5dae70[_0x4cd9('0x17')]=_0x1aa3e0;if(_0x441452[_0x4cd9('0x30')]['includeAll']){_0x71cf4c[_0x4cd9('0x35')]=[{'all':!![]}];}return db[_0x4cd9('0x3e')]['findAll'](_0x71cf4c);})[_0x4cd9('0x1a')](function(_0x5a4fff){_0x5dae70[_0x4cd9('0x4e')]=_0x5a4fff;return _0x5dae70;});}})[_0x4cd9('0x1a')](respondWithFilteredResult(_0x363587,_0x71cf4c))['catch'](handleError(_0x363587,null));};exports[_0x4cd9('0x4f')]=function(_0x2eebfc,_0x3895de){return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x2eebfc[_0x4cd9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3895de,null))['then'](function(_0x1703a3){if(_0x1703a3){return _0x1703a3[_0x4cd9('0x50')](_0x2eebfc[_0x4cd9('0x3a')][_0x4cd9('0x51')],_[_0x4cd9('0x3f')](_0x2eebfc[_0x4cd9('0x3a')],[_0x4cd9('0x51'),'id'])||{})[_0x4cd9('0x52')](function(){return db[_0x4cd9('0x53')]['findAll']({'attributes':['id','name',_0x4cd9('0x54')],'where':{'id':_0x2eebfc[_0x4cd9('0x3a')][_0x4cd9('0x51')]}});})[_0x4cd9('0x1a')](function(_0x5dd615){socket[_0x4cd9('0x55')](_0x4cd9('0x56'),{'id':Number(_0x2eebfc[_0x4cd9('0x2b')]['id']),'tags':_0x5dd615||[]});return{'id':Number(_0x2eebfc[_0x4cd9('0x2b')]['id']),'tags':_0x5dd615||[]};});}})[_0x4cd9('0x1a')](respondWithResult(_0x3895de,null))['catch'](handleError(_0x3895de,null));};exports[_0x4cd9('0x57')]=function(_0x52adfa,_0x43a373){return db['WhatsappInteraction'][_0x4cd9('0x3b')]({'where':{'id':_0x52adfa[_0x4cd9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x43a373,null))[_0x4cd9('0x1a')](function(_0x277611){if(_0x277611){return _0x277611['removeTags'](_0x52adfa[_0x4cd9('0x30')][_0x4cd9('0x51')]);}})['then'](respondWithStatusCode(_0x43a373,null))[_0x4cd9('0x38')](handleError(_0x43a373,null));};exports[_0x4cd9('0x58')]=function(_0x496500,_0xe8d1d6){var _0x1a0c4d=moment()[_0x4cd9('0x59')]()['toString']();var _0x32def3=path[_0x4cd9('0x5a')](config['root'],'server','files',_0x4cd9('0x5b'));var _0x38be1d=path[_0x4cd9('0x5a')](config[_0x4cd9('0x5c')],_0x4cd9('0x5d'),_0x4cd9('0x5e'),_0x4cd9('0x5f'));var _0x4ef105=path['join'](_0x32def3,_0x1a0c4d);var _0x8d6ce0=util[_0x4cd9('0x4c')]('transcript-%d-%s.zip',_0x496500[_0x4cd9('0x2b')]['id'],_0x1a0c4d);var _0x169fee=path[_0x4cd9('0x5a')](_0x32def3,_0x8d6ce0);var _0x2fafc0=[];_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x61')],'as':'User','attributes':['id',_0x4cd9('0x62')],'raw':!![]});_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x63')],'as':_0x4cd9('0x64'),'attributes':['id',_0x4cd9('0x65'),_0x4cd9('0x66')],'raw':!![]});if(_0x496500[_0x4cd9('0x30')][_0x4cd9('0x5f')]){_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x67')],'as':_0x4cd9('0x67'),'raw':!![]});}var _0x473144=[{'model':db[_0x4cd9('0x3e')],'as':_0x4cd9('0x68'),'attributes':['id',_0x4cd9('0x3a'),_0x4cd9('0x69'),_0x4cd9('0x6a'),'secret',_0x4cd9('0x6b')],'include':_0x2fafc0}];_0x473144['push']({'model':db[_0x4cd9('0x6c')],'as':_0x4cd9('0x6d'),'attributes':['id',_0x4cd9('0x1f')]});_0x473144[_0x4cd9('0x60')]({'model':db['User'],'as':_0x4cd9('0x6e'),'attributes':['id',_0x4cd9('0x62')]});return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x496500['params']['id']},'include':_0x473144})[_0x4cd9('0x1a')](handleEntityNotFound(_0xe8d1d6,null))['then'](function(_0xfe47d5){if(_0xfe47d5){var _0x258756=_0xfe47d5[_0x4cd9('0x6f')]({'plain':!![]});fs['mkdirSync'](_0x4ef105);var _0x485155={'channel':_0x4cd9('0x70'),'account':_0x258756[_0x4cd9('0x6d')][_0x4cd9('0x1f')],'agent':_0x258756[_0x4cd9('0x6e')]?_0x258756[_0x4cd9('0x6e')][_0x4cd9('0x62')]:_0x4cd9('0x71'),'createdAt':moment(_0x258756[_0x4cd9('0x69')])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))['toString'](),'closedAt':_0x258756[_0x4cd9('0x72')]?moment(_0x258756[_0x4cd9('0x73')])['format'](_0x4cd9('0x4d'))[_0x4cd9('0x74')]():'','disposition':_0x258756['disposition'],'messages':_(_0x258756[_0x4cd9('0x68')])[_0x4cd9('0x48')]({'secret':![]})[_0x4cd9('0x49')](function(_0xe87ae){if(_0xe87ae[_0x4cd9('0x67')]){var _0x1067f0=path[_0x4cd9('0x5a')](_0x38be1d,_0xe87ae['Attachment']['basename']);if(fs[_0x4cd9('0x75')](_0x1067f0)){fs['createReadStream'](_0x1067f0)['pipe'](fs[_0x4cd9('0x76')](path[_0x4cd9('0x5a')](_0x4ef105,_0xe87ae['Attachment'][_0x4cd9('0x77')])));}}return{'date':moment(_0xe87ae[_0x4cd9('0x69')])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))[_0x4cd9('0x74')](),'sender':_0xe87ae['direction']===_0x4cd9('0x78')?_0xe87ae[_0x4cd9('0x61')]?_0xe87ae[_0x4cd9('0x61')][_0x4cd9('0x62')]:_0x4cd9('0x79'):_0xe87ae[_0x4cd9('0x64')]['firstName']+(_0xe87ae[_0x4cd9('0x64')][_0x4cd9('0x66')]?'\x20'+_0xe87ae[_0x4cd9('0x64')]['lastName']:''),'body':_0xe87ae['Attachment']?_0xe87ae[_0x4cd9('0x67')][_0x4cd9('0x77')]:_0xe87ae[_0x4cd9('0x3a')],'direction':_0xe87ae[_0x4cd9('0x6a')]==='out'?'A':'C','secret':_0xe87ae[_0x4cd9('0x7a')],'read':_0xe87ae[_0x4cd9('0x6b')],'attachment':_0xe87ae['Attachment']};})[_0x4cd9('0x7b')]()};return ejs[_0x4cd9('0x7c')](path['join'](config[_0x4cd9('0x5c')],'server','views',_0x4cd9('0x7d')),{'interaction':_0x485155})['then'](function(_0x201d9d){var _0x3999f1=path[_0x4cd9('0x5a')](_0x4ef105,_0x4cd9('0x7e')+_0x258756['id']+'-'+_0x1a0c4d+_0x4cd9('0x7f'));var _0xf7e0c6={'path':_0x3999f1,'channel':_0x4cd9('0x70'),'interactionId':_0x258756['id']};return pdf[_0x4cd9('0x80')](_0x201d9d,_0xf7e0c6);})['then'](function(){return new BPromise(function(_0x3886f9,_0x47bfdd){zipdir(_0x4ef105,{'saveTo':_0x169fee},function(_0x4dbcbe,_0x1abad1){if(_0x4dbcbe)return _0x47bfdd(_0x4dbcbe);return _0x3886f9(_0x1abad1);});})['then'](function(){return new BPromise(function(_0x2a2d0a,_0x2e4a3a){rimraf(_0x4ef105,function(_0x327a4d){if(_0x327a4d)_0x2e4a3a(_0x327a4d);return _0x2a2d0a();});});})[_0x4cd9('0x1a')](function(){return _0xe8d1d6[_0x4cd9('0x58')](_0x169fee,_0x8d6ce0,function(_0x114555){if(_0x114555){console[_0x4cd9('0x81')](_0x4cd9('0x82'),_0x114555);}else{fs['unlinkSync'](_0x169fee);}});});});}else{return _0xe8d1d6['sendStatus'](0xc8);}})[_0x4cd9('0x38')](handleError(_0xe8d1d6,null));}; \ No newline at end of file +var _0x992b=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','color','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','push','Attachment','createdAt','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','N.A.','closed','toString','disposition','Messages','basename','createReadStream','direction','System','Contact','secret','value','renderFile','views','downloadInteraction.ejs','.pdf','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','name','index','map','WhatsappInteraction','type','key','getOptions','findAll','whatsapp','query','catch','show','rawAttributes','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x992b,0x127));var _0xb992=function(_0x5e58be,_0x1f098c){_0x5e58be=_0x5e58be-0x0;var _0x1220a7=_0x992b[_0x5e58be];return _0x1220a7;};'use strict';var rimraf=require(_0xb992('0x0'));var zipdir=require('zip-dir');var moment=require(_0xb992('0x1'));var BPromise=require(_0xb992('0x2'));var util=require(_0xb992('0x3'));var path=require(_0xb992('0x4'));var ejs=require(_0xb992('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xb992('0x6'));var interaction=require(_0xb992('0x7'));var qs=require(_0xb992('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xb992('0x9'))('api');var config=require('../../config/environment');var db=require(_0xb992('0xa'))['db'];config[_0xb992('0xb')]=_['defaults'](config[_0xb992('0xb')],{'host':_0xb992('0xc'),'port':0x18eb});var socket=require(_0xb992('0xd'))(new Redis(config[_0xb992('0xb')]));require(_0xb992('0xe'))[_0xb992('0xf')](socket);function respondWithStatusCode(_0x440f17,_0x48bb17){_0x48bb17=_0x48bb17||0xcc;return function(_0x28a77b){if(_0x28a77b){return _0x440f17[_0xb992('0x10')](_0x48bb17);}return _0x440f17[_0xb992('0x11')](_0x48bb17)[_0xb992('0x12')]();};}function respondWithResult(_0x4455d4,_0x3c80c5){_0x3c80c5=_0x3c80c5||0xc8;return function(_0x4f436b){if(_0x4f436b){return _0x4455d4['status'](_0x3c80c5)['json'](_0x4f436b);}};}function respondWithFilteredResult(_0x27400e,_0x34789d){return function(_0x34d0dd){if(_0x34d0dd){var _0x516cd2=typeof _0x34789d[_0xb992('0x13')]===_0xb992('0x14')&&typeof _0x34789d[_0xb992('0x15')]===_0xb992('0x14');var _0x41dc8f=_0x34d0dd[_0xb992('0x16')];var _0x39b8a7=_0x516cd2?0x0:_0x34789d[_0xb992('0x13')];var _0x6b16c7=_0x516cd2?_0x34d0dd[_0xb992('0x16')]:_0x34789d[_0xb992('0x13')]+_0x34789d[_0xb992('0x15')];var _0xa1c51e;if(_0x6b16c7>=_0x41dc8f){_0x6b16c7=_0x41dc8f;_0xa1c51e=0xc8;}else{_0xa1c51e=0xce;}_0x27400e['status'](_0xa1c51e);return _0x27400e[_0xb992('0x17')](_0xb992('0x18'),_0x39b8a7+'-'+_0x6b16c7+'/'+_0x41dc8f)[_0xb992('0x19')](_0x34d0dd);}return null;};}function saveUpdates(_0x498f61){return function(_0x480fa1){if(_0x480fa1){return _0x480fa1[_0xb992('0x1a')](_0x498f61)[_0xb992('0x1b')](function(_0x500975){return _0x500975;});}return null;};}function removeEntity(_0x2ea029){return function(_0x304392){if(_0x304392){return _0x304392[_0xb992('0x1c')]()[_0xb992('0x1b')](function(){_0x2ea029[_0xb992('0x11')](0xcc)[_0xb992('0x12')]();});}};}function handleEntityNotFound(_0x4fe861){return function(_0x3e9553){if(!_0x3e9553){_0x4fe861[_0xb992('0x10')](0x194);}return _0x3e9553;};}function handleError(_0x4d51a0,_0x45fb84){_0x45fb84=_0x45fb84||0x1f4;return function(_0x1785fc){logger[_0xb992('0x1d')](_0x1785fc['stack']);if(_0x1785fc[_0xb992('0x1e')]){delete _0x1785fc[_0xb992('0x1e')];}_0x4d51a0[_0xb992('0x11')](_0x45fb84)['send'](_0x1785fc);};}exports[_0xb992('0x1f')]=function(_0xea8a71,_0x3fd7c3){var _0x46f5dd={};var _0x35501a=_[_0xb992('0x20')](db[_0xb992('0x21')]['rawAttributes'],function(_0x514efc){return{'name':_0x514efc['fieldName'],'type':_0x514efc[_0xb992('0x22')][_0xb992('0x23')]};});_0x46f5dd=qs[_0xb992('0x24')](_0x35501a,_0xea8a71);return interaction[_0xb992('0x25')](_0xb992('0x26'),_0xea8a71[_0xb992('0x27')],_0xea8a71['user'],_0x46f5dd,_0x35501a)[_0xb992('0x1b')](respondWithFilteredResult(_0x3fd7c3,_0x46f5dd))[_0xb992('0x28')](handleError(_0x3fd7c3,null));};exports[_0xb992('0x29')]=function(_0xd39216,_0x43f32d){var _0xa14e7c={'raw':![],'where':{'id':_0xd39216['params']['id']}},_0x1d4cf6={};_0x1d4cf6['model']=_['keys'](db[_0xb992('0x21')][_0xb992('0x2a')]);_0x1d4cf6['query']=_[_0xb992('0x2b')](_0xd39216[_0xb992('0x27')]);_0x1d4cf6['filters']=_[_0xb992('0x2c')](_0x1d4cf6[_0xb992('0x2d')],_0x1d4cf6[_0xb992('0x27')]);_0xa14e7c[_0xb992('0x2e')]=_[_0xb992('0x2c')](_0x1d4cf6[_0xb992('0x2d')],qs[_0xb992('0x2f')](_0xd39216[_0xb992('0x27')]['fields']));_0xa14e7c[_0xb992('0x2e')]=_0xa14e7c[_0xb992('0x2e')][_0xb992('0x30')]?_0xa14e7c[_0xb992('0x2e')]:_0x1d4cf6[_0xb992('0x2d')];if(_0xd39216[_0xb992('0x27')][_0xb992('0x31')]){_0xa14e7c[_0xb992('0x32')]=[{'all':!![]}];}_0xa14e7c=_[_0xb992('0x33')]({},_0xa14e7c,_0xd39216[_0xb992('0x34')]);return db[_0xb992('0x21')][_0xb992('0x35')](_0xa14e7c)[_0xb992('0x1b')](handleEntityNotFound(_0x43f32d,null))[_0xb992('0x1b')](respondWithResult(_0x43f32d,null))[_0xb992('0x28')](handleError(_0x43f32d,null));};exports[_0xb992('0x36')]=function(_0x3a918a,_0x2e5644){return db[_0xb992('0x21')][_0xb992('0x36')](_0x3a918a[_0xb992('0x37')],{})['then'](respondWithResult(_0x2e5644,0xc9))['catch'](handleError(_0x2e5644,null));};exports['update']=function(_0x37ec66,_0x43b2af){if(_0x37ec66['body']['id']){delete _0x37ec66[_0xb992('0x37')]['id'];}return db[_0xb992('0x21')][_0xb992('0x35')]({'where':{'id':_0x37ec66[_0xb992('0x38')]['id']}})[_0xb992('0x1b')](handleEntityNotFound(_0x43b2af,null))[_0xb992('0x1b')](saveUpdates(_0x37ec66[_0xb992('0x37')],null))[_0xb992('0x1b')](respondWithResult(_0x43b2af,null))[_0xb992('0x28')](handleError(_0x43b2af,null));};exports[_0xb992('0x1c')]=function(_0x52b9d3,_0x411021){return db['WhatsappInteraction']['find']({'where':{'id':_0x52b9d3[_0xb992('0x38')]['id']}})['then'](handleEntityNotFound(_0x411021,null))[_0xb992('0x1b')](removeEntity(_0x411021,null))[_0xb992('0x28')](handleError(_0x411021,null));};exports[_0xb992('0x39')]=function(_0x1dcb61,_0x102d6c){return db[_0xb992('0x21')]['describe']()[_0xb992('0x1b')](respondWithResult(_0x102d6c,null))[_0xb992('0x28')](handleError(_0x102d6c,null));};exports[_0xb992('0x3a')]=function(_0x30dc9a,_0x4459ad){return db[_0xb992('0x3b')][_0xb992('0x35')]({'where':{'id':_0x30dc9a[_0xb992('0x38')]['id']}})[_0xb992('0x1b')](handleEntityNotFound(_0x4459ad,null))['then'](function(_0xbbcec1){if(_0xbbcec1){return _0xbbcec1[_0xb992('0x3a')](_0x30dc9a[_0xb992('0x37')][_0xb992('0x3c')],_[_0xb992('0x3d')](_0x30dc9a[_0xb992('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x4459ad,null))[_0xb992('0x28')](handleError(_0x4459ad,null));};exports['getMessages']=function(_0x9a975e,_0x3fa130){var _0x77e6d9={'raw':![],'where':{}};var _0xd70a93={};var _0x4abfdc={'count':0x0,'rows':[]};return db[_0xb992('0x21')][_0xb992('0x3e')]({'where':{'id':_0x9a975e['params']['id']}})[_0xb992('0x1b')](handleEntityNotFound(_0x3fa130,null))['then'](function(_0x8eb977){if(_0x8eb977){_0xd70a93[_0xb992('0x2d')]=_[_0xb992('0x2b')](db['WhatsappMessage'][_0xb992('0x2a')]);_0xd70a93[_0xb992('0x27')]=_[_0xb992('0x2b')](_0x9a975e[_0xb992('0x27')]);_0xd70a93[_0xb992('0x3f')]=_['intersection'](_0xd70a93[_0xb992('0x2d')],_0xd70a93['query']);_0x77e6d9[_0xb992('0x2e')]=_['intersection'](_0xd70a93[_0xb992('0x2d')],qs['fields'](_0x9a975e[_0xb992('0x27')][_0xb992('0x2f')]));_0x77e6d9[_0xb992('0x2e')]=_0x77e6d9[_0xb992('0x2e')]['length']?_0x77e6d9[_0xb992('0x2e')]:_0xd70a93[_0xb992('0x2d')];if(!_0x9a975e[_0xb992('0x27')][_0xb992('0x40')](_0xb992('0x41'))){_0x77e6d9[_0xb992('0x15')]=qs[_0xb992('0x15')](_0x9a975e[_0xb992('0x27')]['limit']);_0x77e6d9[_0xb992('0x13')]=qs[_0xb992('0x13')](_0x9a975e[_0xb992('0x27')]['offset']);}_0x77e6d9[_0xb992('0x42')]=qs[_0xb992('0x43')](_0x9a975e['query'][_0xb992('0x43')]);_0x77e6d9[_0xb992('0x44')]=qs[_0xb992('0x3f')](_[_0xb992('0x45')](_0x9a975e[_0xb992('0x27')],_0xd70a93[_0xb992('0x3f')]));_0x77e6d9[_0xb992('0x44')][_0xb992('0x46')]=_0x8eb977['id'];if(_0x9a975e[_0xb992('0x27')]['filter']){_0x77e6d9[_0xb992('0x44')]=_['merge'](_0x77e6d9[_0xb992('0x44')],{'$or':_[_0xb992('0x20')](_0x77e6d9[_0xb992('0x2e')],function(_0xdae933){var _0x521aee={};_0x521aee[_0xdae933]={'$like':'%'+_0x9a975e['query']['filter']+'%'};return _0x521aee;})});}if(_0x9a975e[_0xb992('0x27')][_0xb992('0x47')]){var _0x443059=_0x9a975e[_0xb992('0x27')][_0xb992('0x47')][_0xb992('0x48')](',');var _0x37ab08={};_0x37ab08[_0x443059[0x0]]={'$gte':moment(_0x443059[0x1])[_0xb992('0x49')](_0xb992('0x4a'))};_0x77e6d9['where']=_[_0xb992('0x33')](_0x77e6d9[_0xb992('0x44')],_0x37ab08);}_0x77e6d9=_[_0xb992('0x33')]({},_0x77e6d9,_0x9a975e[_0xb992('0x34')]);return db[_0xb992('0x3b')][_0xb992('0x16')]({'where':_0x77e6d9[_0xb992('0x44')]})[_0xb992('0x1b')](function(_0x244eed){_0x4abfdc[_0xb992('0x16')]=_0x244eed;if(_0x9a975e[_0xb992('0x27')][_0xb992('0x31')]){_0x77e6d9['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xb992('0x25')](_0x77e6d9);})[_0xb992('0x1b')](function(_0x39b7f6){_0x4abfdc[_0xb992('0x4b')]=_0x39b7f6;return _0x4abfdc;});}})[_0xb992('0x1b')](respondWithFilteredResult(_0x3fa130,_0x77e6d9))[_0xb992('0x28')](handleError(_0x3fa130,null));};exports['addTags']=function(_0x2b87ce,_0x382dc0){return db[_0xb992('0x21')][_0xb992('0x35')]({'where':{'id':_0x2b87ce[_0xb992('0x38')]['id']}})['then'](handleEntityNotFound(_0x382dc0,null))[_0xb992('0x1b')](function(_0x285700){if(_0x285700){return _0x285700[_0xb992('0x4c')](_0x2b87ce[_0xb992('0x37')][_0xb992('0x3c')],_[_0xb992('0x3d')](_0x2b87ce[_0xb992('0x37')],[_0xb992('0x3c'),'id'])||{})[_0xb992('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb992('0x1e'),_0xb992('0x4e')],'where':{'id':_0x2b87ce[_0xb992('0x37')][_0xb992('0x3c')]}});})[_0xb992('0x1b')](function(_0x475e95){socket[_0xb992('0x4f')]('whatsappInteractionTags:save',{'id':Number(_0x2b87ce[_0xb992('0x38')]['id']),'tags':_0x475e95||[]});return{'id':Number(_0x2b87ce[_0xb992('0x38')]['id']),'tags':_0x475e95||[]};});}})[_0xb992('0x1b')](respondWithResult(_0x382dc0,null))['catch'](handleError(_0x382dc0,null));};exports[_0xb992('0x50')]=function(_0x3325e2,_0x378aa4){return db['WhatsappInteraction'][_0xb992('0x35')]({'where':{'id':_0x3325e2[_0xb992('0x38')]['id']}})[_0xb992('0x1b')](handleEntityNotFound(_0x378aa4,null))['then'](function(_0x22a0c9){if(_0x22a0c9){return _0x22a0c9[_0xb992('0x50')](_0x3325e2[_0xb992('0x27')][_0xb992('0x3c')]);}})['then'](respondWithStatusCode(_0x378aa4,null))[_0xb992('0x28')](handleError(_0x378aa4,null));};exports[_0xb992('0x51')]=function(_0x1c3d00,_0xe6d87c){var _0x3dcc6f=moment()[_0xb992('0x52')]()['toString']();var _0x305cc6=path['join'](config[_0xb992('0x53')],_0xb992('0x54'),_0xb992('0x55'),_0xb992('0x56'));var _0x32075b=path[_0xb992('0x57')](config[_0xb992('0x53')],_0xb992('0x54'),_0xb992('0x55'),_0xb992('0x58'));var _0x3b2cc4=path[_0xb992('0x57')](_0x305cc6,_0x3dcc6f);var _0x57423e=util[_0xb992('0x49')](_0xb992('0x59'),_0x1c3d00[_0xb992('0x38')]['id'],_0x3dcc6f);var _0x3eed2a=path[_0xb992('0x57')](_0x305cc6,_0x57423e);var _0x449479=[];_0x449479['push']({'model':db[_0xb992('0x5a')],'as':_0xb992('0x5a'),'attributes':['id',_0xb992('0x5b')],'raw':!![]});_0x449479['push']({'model':db[_0xb992('0x5c')],'as':'Contact','attributes':['id',_0xb992('0x5d'),_0xb992('0x5e')],'raw':!![]});if(_0x1c3d00[_0xb992('0x27')][_0xb992('0x58')]){_0x449479[_0xb992('0x5f')]({'model':db[_0xb992('0x60')],'as':_0xb992('0x60'),'raw':!![]});}var _0x586a2f=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xb992('0x37'),_0xb992('0x61'),'direction','secret',_0xb992('0x62')],'include':_0x449479}];_0x586a2f[_0xb992('0x5f')]({'model':db[_0xb992('0x63')],'as':'Account','attributes':['id',_0xb992('0x1e')]});_0x586a2f[_0xb992('0x5f')]({'model':db[_0xb992('0x5a')],'as':_0xb992('0x64'),'attributes':['id',_0xb992('0x5b')]});return db['WhatsappInteraction'][_0xb992('0x35')]({'where':{'id':_0x1c3d00[_0xb992('0x38')]['id']},'include':_0x586a2f})['then'](handleEntityNotFound(_0xe6d87c,null))[_0xb992('0x1b')](function(_0x1046c2){if(_0x1046c2){var _0x556fee=_0x1046c2[_0xb992('0x65')]({'plain':!![]});fs[_0xb992('0x66')](_0x3b2cc4);var _0x5d4ab3={'channel':_0xb992('0x67'),'account':_0x556fee['Account'][_0xb992('0x1e')],'agent':_0x556fee['Owner']?_0x556fee[_0xb992('0x64')][_0xb992('0x5b')]:_0xb992('0x68'),'createdAt':moment(_0x556fee[_0xb992('0x61')])['format'](_0xb992('0x4a'))['toString'](),'closedAt':_0x556fee[_0xb992('0x69')]?moment(_0x556fee['closedAt'])[_0xb992('0x49')](_0xb992('0x4a'))[_0xb992('0x6a')]():'','disposition':_0x556fee[_0xb992('0x6b')],'messages':_(_0x556fee[_0xb992('0x6c')])['filter']({'secret':![]})[_0xb992('0x20')](function(_0x1a16cc){if(_0x1a16cc[_0xb992('0x60')]){var _0x1bb056=path[_0xb992('0x57')](_0x32075b,_0x1a16cc['Attachment'][_0xb992('0x6d')]);if(fs['existsSync'](_0x1bb056)){fs[_0xb992('0x6e')](_0x1bb056)['pipe'](fs['createWriteStream'](path[_0xb992('0x57')](_0x3b2cc4,_0x1a16cc[_0xb992('0x60')][_0xb992('0x6d')])));}}return{'date':moment(_0x1a16cc[_0xb992('0x61')])[_0xb992('0x49')](_0xb992('0x4a'))[_0xb992('0x6a')](),'sender':_0x1a16cc[_0xb992('0x6f')]==='out'?_0x1a16cc['User']?_0x1a16cc[_0xb992('0x5a')][_0xb992('0x5b')]:_0xb992('0x70'):_0x1a16cc[_0xb992('0x71')][_0xb992('0x5d')]+(_0x1a16cc[_0xb992('0x71')]['lastName']?'\x20'+_0x1a16cc[_0xb992('0x71')][_0xb992('0x5e')]:''),'body':_0x1a16cc['Attachment']?_0x1a16cc[_0xb992('0x60')][_0xb992('0x6d')]:_0x1a16cc[_0xb992('0x37')],'direction':_0x1a16cc[_0xb992('0x6f')]==='out'?'A':'C','secret':_0x1a16cc[_0xb992('0x72')],'read':_0x1a16cc['read'],'attachment':_0x1a16cc[_0xb992('0x60')]};})[_0xb992('0x73')]()};return ejs[_0xb992('0x74')](path[_0xb992('0x57')](config[_0xb992('0x53')],_0xb992('0x54'),_0xb992('0x75'),_0xb992('0x76')),{'interaction':_0x5d4ab3})[_0xb992('0x1b')](function(_0x2d4aea){var _0x4c5ae8=path[_0xb992('0x57')](_0x3b2cc4,'transcript-'+_0x556fee['id']+'-'+_0x3dcc6f+_0xb992('0x77'));var _0xb8dd8d={'path':_0x4c5ae8,'channel':_0xb992('0x67'),'interactionId':_0x556fee['id']};return pdf['createPdfFromHTML'](_0x2d4aea,_0xb8dd8d);})['then'](function(){return new BPromise(function(_0x305c08,_0x27454c){zipdir(_0x3b2cc4,{'saveTo':_0x3eed2a},function(_0x57c7e8,_0x223d9c){if(_0x57c7e8)return _0x27454c(_0x57c7e8);return _0x305c08(_0x223d9c);});})['then'](function(){return new BPromise(function(_0x343cc1,_0x299b51){rimraf(_0x3b2cc4,function(_0x78a9f7){if(_0x78a9f7)_0x299b51(_0x78a9f7);return _0x343cc1();});});})[_0xb992('0x1b')](function(){return _0xe6d87c[_0xb992('0x51')](_0x3eed2a,_0x57423e,function(_0x46eb46){if(_0x46eb46){console['log'](_0xb992('0x78'),_0x46eb46);}else{fs[_0xb992('0x79')](_0x3eed2a);}});});});}else{return _0xe6d87c[_0xb992('0x10')](0xc8);}})['catch'](handleError(_0xe6d87c,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index aa83d51..1d7a3fa 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 _0x3c81=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0x3c81,0x102));var _0x13c8=function(_0x38c797,_0x3bee1f){_0x38c797=_0x38c797-0x0;var _0x5f4ef6=_0x3c81[_0x38c797];return _0x5f4ef6;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var WhatsappInteraction=require(_0x13c8('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x13c8('0x1'))['db'][_0x13c8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x101d4f){return function(_0x3ec886,_0x18bd0f,_0x1c16f1){_0x3ec886[_0x13c8('0x3')]({'attributes':['id'],'raw':!![]})[_0x13c8('0x4')](function(_0x445b69){_0x3ec886['setDataValue'](_0x13c8('0x5'),_0x445b69['map'](function(_0x380aed){return{'id':_0x380aed['id']};}));return WhatsappMessage[_0x13c8('0x6')]({'where':{'WhatsappInteractionId':_0x3ec886['id'],'direction':'in','read':![]},'raw':!![]});})[_0x13c8('0x4')](function(_0x30b4d6){_0x3ec886[_0x13c8('0x7')](_0x13c8('0x8'),_0x30b4d6[_0x13c8('0x9')]);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f+':'+_0x3ec886['id'],_0x3ec886);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f,_0x3ec886);_0x1c16f1(null);})[_0x13c8('0xb')](_0x1c16f1(null));};}for(var e in events){if(events[_0x13c8('0xc')](e)){var event=events[e];WhatsappInteraction[_0x13c8('0xd')](e,emitEvent(event));}}module[_0x13c8('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6ea9=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x15da95,_0x2a6b25){var _0x5cfdc5=function(_0x3c899e){while(--_0x3c899e){_0x15da95['push'](_0x15da95['shift']());}};_0x5cfdc5(++_0x2a6b25);}(_0x6ea9,0x89));var _0x96ea=function(_0xb1c8d7,_0x32d0de){_0xb1c8d7=_0xb1c8d7-0x0;var _0xbed63f=_0x6ea9[_0xb1c8d7];return _0xbed63f;};'use strict';var EventEmitter=require(_0x96ea('0x0'));var WhatsappInteraction=require(_0x96ea('0x1'))['db'][_0x96ea('0x2')];var WhatsappMessage=require(_0x96ea('0x1'))['db'][_0x96ea('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96ea('0x4'),'afterUpdate':_0x96ea('0x5'),'afterDestroy':_0x96ea('0x6')};function emitEvent(_0x4de4d5){return function(_0xd6de64,_0x58e57e,_0x32cf31){_0xd6de64['getUsers']({'attributes':['id'],'raw':!![]})[_0x96ea('0x7')](function(_0x5da08c){_0xd6de64[_0x96ea('0x8')](_0x96ea('0x9'),_0x5da08c[_0x96ea('0xa')](function(_0x35e378){return{'id':_0x35e378['id']};}));return WhatsappMessage[_0x96ea('0xb')]({'where':{'WhatsappInteractionId':_0xd6de64['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96ea('0x7')](function(_0x542e92){_0xd6de64[_0x96ea('0x8')](_0x96ea('0xc'),_0x542e92[_0x96ea('0xd')]);WhatsappInteractionEvents[_0x96ea('0xe')](_0x4de4d5+':'+_0xd6de64['id'],_0xd6de64);WhatsappInteractionEvents[_0x96ea('0xe')](_0x4de4d5,_0xd6de64);_0x32cf31(null);})[_0x96ea('0xf')](_0x32cf31(null));};}for(var e in events){if(events[_0x96ea('0x10')](e)){var event=events[e];WhatsappInteraction[_0x96ea('0x11')](e,emitEvent(event));}}module[_0x96ea('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index a8be18f..4c3506a 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 _0xaae4=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x1bfee7,_0x4a9c39){var _0x5aa07b=function(_0x3995fc){while(--_0x3995fc){_0x1bfee7['push'](_0x1bfee7['shift']());}};_0x5aa07b(++_0x4a9c39);}(_0xaae4,0x120));var _0x4aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4aae('0x0'));var util=require(_0x4aae('0x1'));var logger=require(_0x4aae('0x2'))('api');var moment=require(_0x4aae('0x3'));var BPromise=require(_0x4aae('0x4'));var rp=require(_0x4aae('0x5'));var fs=require('fs');var path=require(_0x4aae('0x6'));var rimraf=require(_0x4aae('0x7'));var config=require(_0x4aae('0x8'));var attributes=require(_0x4aae('0x9'));module['exports']=function(_0xb5135a,_0x32b1fc){return _0xb5135a['define'](_0x4aae('0xa'),attributes,{'tableName':_0x4aae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c4b45,_0x262bc4,_0x1aaf7b){if(_0x1c4b45[_0x4aae('0xc')](_0x4aae('0xd'))){_0x1c4b45[_0x4aae('0xe')]=moment()[_0x4aae('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1aaf7b(null,_0x1c4b45);}}});}; \ No newline at end of file +var _0x02d9=['./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x02d9,0x1d7));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x902d('0x0'));var util=require(_0x902d('0x1'));var logger=require(_0x902d('0x2'))('api');var moment=require(_0x902d('0x3'));var BPromise=require(_0x902d('0x4'));var rp=require(_0x902d('0x5'));var fs=require('fs');var path=require(_0x902d('0x6'));var rimraf=require(_0x902d('0x7'));var config=require(_0x902d('0x8'));var attributes=require(_0x902d('0x9'));module['exports']=function(_0x401222,_0x4e13ad){return _0x401222[_0x902d('0xa')](_0x902d('0xb'),attributes,{'tableName':_0x902d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e459f,_0x33bf54,_0x10bab4){if(_0x4e459f['changed']('closed')){_0x4e459f[_0x902d('0xd')]=moment()[_0x902d('0xe')](_0x902d('0xf'));}_0x10bab4(null,_0x4e459f);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c8c5a68..f5117ec 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 _0x5537=['WhatsappInteraction','update','body','raw','options','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','where','addTags','ids','AddTags','debug','lodash','util','bluebird','randomstring','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5b306d,_0x498446){var _0x55bfc0=function(_0x589c50){while(--_0x589c50){_0x5b306d['push'](_0x5b306d['shift']());}};_0x55bfc0(++_0x498446);}(_0x5537,0x78));var _0x7553=function(_0x3e4a27,_0x10b5aa){_0x3e4a27=_0x3e4a27-0x0;var _0x4e61c1=_0x5537[_0x3e4a27];return _0x4e61c1;};'use strict';var _=require(_0x7553('0x0'));var util=require(_0x7553('0x1'));var moment=require('moment');var BPromise=require(_0x7553('0x2'));var rs=require(_0x7553('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7553('0x4'));var jayson=require(_0x7553('0x5'));var client=jayson[_0x7553('0x6')][_0x7553('0x7')]({'port':0x232a});config[_0x7553('0x8')]=_[_0x7553('0x9')](config['redis'],{'host':_0x7553('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7553('0xb'))[_0x7553('0xc')](socket);function respondWithRpcPromise(_0x282d20,_0x25159f,_0x344f75){return new BPromise(function(_0xdc51bc,_0x4111a3){return client['request'](_0x282d20,_0x344f75)[_0x7553('0xd')](function(_0x5347c8){logger[_0x7553('0xe')](_0x7553('0xf'),_0x25159f,_0x7553('0x10'));logger['debug'](_0x7553('0x11'),_0x25159f,_0x7553('0x10'),JSON[_0x7553('0x12')](_0x5347c8));if(_0x5347c8[_0x7553('0x13')]){if(_0x5347c8[_0x7553('0x13')][_0x7553('0x14')]===0x1f4){logger[_0x7553('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x25159f,_0x5347c8[_0x7553('0x13')]['message']);return _0x4111a3(_0x5347c8['error'][_0x7553('0x15')]);}logger[_0x7553('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x25159f,_0x5347c8[_0x7553('0x13')]['message']);return _0xdc51bc(_0x5347c8[_0x7553('0x13')][_0x7553('0x15')]);}else{logger[_0x7553('0xe')](_0x7553('0xf'),_0x25159f,_0x7553('0x10'));_0xdc51bc(_0x5347c8[_0x7553('0x16')][_0x7553('0x15')]);}})[_0x7553('0x17')](function(_0x2ff083){logger['error'](_0x7553('0xf'),_0x25159f,_0x2ff083);_0x4111a3(_0x2ff083);});});}exports['UpdateWhatsappInteraction']=function(_0x20ff13){var _0x45a690=this;return new Promise(function(_0x174adf,_0x5e86ae){return db[_0x7553('0x18')][_0x7553('0x19')](_0x20ff13[_0x7553('0x1a')],{'raw':_0x20ff13['options']?_0x20ff13['options'][_0x7553('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ff13['options']?_0x20ff13[_0x7553('0x1c')]['where']||null:null,'attributes':_0x20ff13[_0x7553('0x1c')]?_0x20ff13[_0x7553('0x1c')]['attributes']||null:null,'limit':_0x20ff13['options']?_0x20ff13['options']['limit']||null:null})[_0x7553('0xd')](function(_0x579fe7){logger[_0x7553('0xe')](_0x7553('0x1d'),_0x20ff13);logger['debug'](_0x7553('0x1d'),_0x20ff13,JSON[_0x7553('0x12')](_0x579fe7));_0x174adf(_0x579fe7);})[_0x7553('0x17')](function(_0x1159e5){logger[_0x7553('0x13')]('UpdateWhatsappInteraction',_0x1159e5[_0x7553('0x15')],_0x20ff13);_0x5e86ae(_0x45a690[_0x7553('0x13')](0x1f4,_0x1159e5['message']));});});};exports[_0x7553('0x1e')]=function(_0x40dbf8){return new Promise(function(_0x345bec,_0x3d24f3){return db[_0x7553('0x18')]['find']({'where':_0x40dbf8['options']?_0x40dbf8[_0x7553('0x1c')][_0x7553('0x1f')]||null:null})[_0x7553('0xd')](function(_0x1352e0){if(_0x1352e0){return _0x1352e0[_0x7553('0x20')](_0x40dbf8[_0x7553('0x1a')][_0x7553('0x21')],_['omit'](_0x40dbf8[_0x7553('0x1a')],[_0x7553('0x21'),'id'])||{});}})['spread'](function(_0x13e31f){logger[_0x7553('0xe')](_0x7553('0x22'),_0x40dbf8);logger[_0x7553('0x23')]('AddTags',_0x40dbf8,JSON[_0x7553('0x12')](_0x13e31f));_0x345bec(_0x13e31f);})[_0x7553('0x17')](function(_0x4072f4){logger['error']('AddTags',_0x4072f4['message'],_0x40dbf8);_0x3d24f3(_this[_0x7553('0x13')](0x1f4,_0x4072f4[_0x7553('0x15')]));});});}; \ No newline at end of file +var _0x6a15=['socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','body','where','options','attributes','limit','UpdateWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x29e3e8,_0x387854){var _0x4007bd=function(_0x48a2e8){while(--_0x48a2e8){_0x29e3e8['push'](_0x29e3e8['shift']());}};_0x4007bd(++_0x387854);}(_0x6a15,0x93));var _0x56a1=function(_0xf5fbed,_0x3ac172){_0xf5fbed=_0xf5fbed-0x0;var _0x1f35a8=_0x6a15[_0xf5fbed];return _0x1f35a8;};'use strict';var _=require(_0x56a1('0x0'));var util=require(_0x56a1('0x1'));var moment=require('moment');var BPromise=require(_0x56a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56a1('0x3'))['db'];var utils=require(_0x56a1('0x4'));var logger=require(_0x56a1('0x5'))(_0x56a1('0x6'));var config=require(_0x56a1('0x7'));var jayson=require(_0x56a1('0x8'));var client=jayson[_0x56a1('0x9')]['http']({'port':0x232a});config[_0x56a1('0xa')]=_[_0x56a1('0xb')](config[_0x56a1('0xa')],{'host':_0x56a1('0xc'),'port':0x18eb});var socket=require(_0x56a1('0xd'))(new Redis(config[_0x56a1('0xa')]));require(_0x56a1('0xe'))[_0x56a1('0xf')](socket);function respondWithRpcPromise(_0x26384a,_0x1ac780,_0x3d6d09){return new BPromise(function(_0x409c8c,_0x30512b){return client[_0x56a1('0x10')](_0x26384a,_0x3d6d09)[_0x56a1('0x11')](function(_0x4d6e8e){logger[_0x56a1('0x12')](_0x56a1('0x13'),_0x1ac780,'request\x20sent');logger[_0x56a1('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x1ac780,_0x56a1('0x15'),JSON['stringify'](_0x4d6e8e));if(_0x4d6e8e[_0x56a1('0x16')]){if(_0x4d6e8e[_0x56a1('0x16')][_0x56a1('0x17')]===0x1f4){logger[_0x56a1('0x16')](_0x56a1('0x13'),_0x1ac780,_0x4d6e8e[_0x56a1('0x16')]['message']);return _0x30512b(_0x4d6e8e[_0x56a1('0x16')][_0x56a1('0x18')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x1ac780,_0x4d6e8e[_0x56a1('0x16')][_0x56a1('0x18')]);return _0x409c8c(_0x4d6e8e[_0x56a1('0x16')]['message']);}else{logger['info'](_0x56a1('0x13'),_0x1ac780,'request\x20sent');_0x409c8c(_0x4d6e8e[_0x56a1('0x19')][_0x56a1('0x18')]);}})[_0x56a1('0x1a')](function(_0x502c7b){logger[_0x56a1('0x16')](_0x56a1('0x13'),_0x1ac780,_0x502c7b);_0x30512b(_0x502c7b);});});}exports['UpdateWhatsappInteraction']=function(_0x26ef1f){var _0x1cfd23=this;return new Promise(function(_0x170e54,_0x2b3346){return db['WhatsappInteraction']['update'](_0x26ef1f[_0x56a1('0x1b')],{'raw':_0x26ef1f['options']?_0x26ef1f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26ef1f['options']?_0x26ef1f['options'][_0x56a1('0x1c')]||null:null,'attributes':_0x26ef1f[_0x56a1('0x1d')]?_0x26ef1f[_0x56a1('0x1d')][_0x56a1('0x1e')]||null:null,'limit':_0x26ef1f['options']?_0x26ef1f['options'][_0x56a1('0x1f')]||null:null})[_0x56a1('0x11')](function(_0x3f7cd5){logger[_0x56a1('0x12')](_0x56a1('0x20'),_0x26ef1f);logger['debug']('UpdateWhatsappInteraction',_0x26ef1f,JSON['stringify'](_0x3f7cd5));_0x170e54(_0x3f7cd5);})['catch'](function(_0x426941){logger[_0x56a1('0x16')](_0x56a1('0x20'),_0x426941[_0x56a1('0x18')],_0x26ef1f);_0x2b3346(_0x1cfd23[_0x56a1('0x16')](0x1f4,_0x426941[_0x56a1('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5e7482){return new Promise(function(_0x427cf5,_0x5a6979){return db[_0x56a1('0x21')][_0x56a1('0x22')]({'where':_0x5e7482['options']?_0x5e7482[_0x56a1('0x1d')][_0x56a1('0x1c')]||null:null})[_0x56a1('0x11')](function(_0x636bbb){if(_0x636bbb){return _0x636bbb[_0x56a1('0x23')](_0x5e7482[_0x56a1('0x1b')][_0x56a1('0x24')],_[_0x56a1('0x25')](_0x5e7482[_0x56a1('0x1b')],[_0x56a1('0x24'),'id'])||{});}})[_0x56a1('0x26')](function(_0x52cfb4){logger['info'](_0x56a1('0x27'),_0x5e7482);logger[_0x56a1('0x14')](_0x56a1('0x27'),_0x5e7482,JSON['stringify'](_0x52cfb4));_0x427cf5(_0x52cfb4);})[_0x56a1('0x1a')](function(_0x43acad){logger[_0x56a1('0x16')](_0x56a1('0x27'),_0x43acad[_0x56a1('0x18')],_0x5e7482);_0x5a6979(_this['error'](0x1f4,_0x43acad[_0x56a1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ad73619..a8abc8e 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 _0x0cf3=['save','remove','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x0cf3,0x16b));var _0x30cf=function(_0x2681b7,_0x2d1b49){_0x2681b7=_0x2681b7-0x0;var _0x4d466b=_0x0cf3[_0x2681b7];return _0x4d466b;};'use strict';var WhatsappInteractionEvents=require(_0x30cf('0x0'));var events=[_0x30cf('0x1'),_0x30cf('0x2'),'update'];function createListener(_0x1ac137,_0x8a760b){return function(_0x4c6adf){_0x8a760b[_0x30cf('0x3')](_0x1ac137,_0x4c6adf);};}function removeListener(_0x585442,_0x46c57e){return function(){WhatsappInteractionEvents[_0x30cf('0x4')](_0x585442,_0x46c57e);};}exports['register']=function(_0x59cb81){for(var _0x57229f=0x0,_0x180249=events[_0x30cf('0x5')];_0x57229f<_0x180249;_0x57229f++){var _0xdf5242=events[_0x57229f];var _0xdc9cd9=createListener(_0x30cf('0x6')+_0xdf5242,_0x59cb81);WhatsappInteractionEvents['on'](_0xdf5242,_0xdc9cd9);}}; \ No newline at end of file +var _0xbfaf=['register','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xbfaf,0x158));var _0xfbfa=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xbfaf[_0x4afac5];return _0x2404b3;};'use strict';var WhatsappInteractionEvents=require(_0xfbfa('0x0'));var events=[_0xfbfa('0x1'),_0xfbfa('0x2'),_0xfbfa('0x3')];function createListener(_0x54dbd4,_0x5e1809){return function(_0x5c4f37){_0x5e1809[_0xfbfa('0x4')](_0x54dbd4,_0x5c4f37);};}function removeListener(_0x5b1e99,_0x240608){return function(){WhatsappInteractionEvents[_0xfbfa('0x5')](_0x5b1e99,_0x240608);};}exports[_0xfbfa('0x6')]=function(_0x433b48){for(var _0x5b0db2=0x0,_0x2f6513=events['length'];_0x5b0db2<_0x2f6513;_0x5b0db2++){var _0x5dc9d7=events[_0x5b0db2];var _0x46d3b3=createListener('whatsappInteraction:'+_0x5dc9d7,_0x433b48);WhatsappInteractionEvents['on'](_0x5dc9d7,_0x46d3b3);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d767d76..a7c7ece 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 _0xefd9=['post','status','put','update','/:id/accept','/:id/reject','reject','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','whatsapp','create'];(function(_0x2018cf,_0x2ebfd4){var _0x3561b6=function(_0x1f7051){while(--_0x1f7051){_0x2018cf['push'](_0x2018cf['shift']());}};_0x3561b6(++_0x2ebfd4);}(_0xefd9,0x15a));var _0x9efd=function(_0x26d05d,_0x368ba0){_0x26d05d=_0x26d05d-0x0;var _0x510108=_0xefd9[_0x26d05d];return _0x510108;};'use strict';var multer=require(_0x9efd('0x0'));var util=require(_0x9efd('0x1'));var path=require(_0x9efd('0x2'));var timeout=require(_0x9efd('0x3'));var express=require(_0x9efd('0x4'));var router=express[_0x9efd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9efd('0x6'));var interaction=require(_0x9efd('0x7'));var config=require(_0x9efd('0x8'));var controller=require(_0x9efd('0x9'));router[_0x9efd('0xa')]('/',auth[_0x9efd('0xb')](),controller[_0x9efd('0xc')]);router[_0x9efd('0xa')](_0x9efd('0xd'),auth[_0x9efd('0xb')](),controller[_0x9efd('0xe')]);router[_0x9efd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9efd('0xf')]);router['post']('/',auth[_0x9efd('0xb')](),interaction['tracked'](_0x9efd('0x10'),'whatsappmessage:create'),controller[_0x9efd('0x11')]);router[_0x9efd('0x12')]('/:id/status',controller[_0x9efd('0x13')]);router[_0x9efd('0x14')]('/:id',auth[_0x9efd('0xb')](),controller[_0x9efd('0x15')]);router['put'](_0x9efd('0x16'),auth[_0x9efd('0xb')](),controller['accept']);router['put'](_0x9efd('0x17'),auth[_0x9efd('0xb')](),controller[_0x9efd('0x18')]);router[_0x9efd('0x19')](_0x9efd('0x1a'),auth['isAuthenticated'](),controller[_0x9efd('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xb19f=['/:id','show','post','tracked','whatsappmessage:create','create','status','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x13ade2,_0x340806){var _0x737169=function(_0x2b5eee){while(--_0x2b5eee){_0x13ade2['push'](_0x13ade2['shift']());}};_0x737169(++_0x340806);}(_0xb19f,0xdd));var _0xfb19=function(_0x253804,_0x4101e2){_0x253804=_0x253804-0x0;var _0x26cb31=_0xb19f[_0x253804];return _0x26cb31;};'use strict';var multer=require(_0xfb19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfb19('0x1'));var express=require(_0xfb19('0x2'));var router=express['Router']();var fs_extra=require(_0xfb19('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb19('0x4'));var controller=require('./whatsappMessage.controller');router[_0xfb19('0x5')]('/',auth[_0xfb19('0x6')](),controller[_0xfb19('0x7')]);router[_0xfb19('0x5')](_0xfb19('0x8'),auth[_0xfb19('0x6')](),controller['describe']);router[_0xfb19('0x5')](_0xfb19('0x9'),auth[_0xfb19('0x6')](),controller[_0xfb19('0xa')]);router[_0xfb19('0xb')]('/',auth[_0xfb19('0x6')](),interaction[_0xfb19('0xc')]('whatsapp',_0xfb19('0xd')),controller[_0xfb19('0xe')]);router[_0xfb19('0xb')]('/:id/status',controller[_0xfb19('0xf')]);router[_0xfb19('0x10')](_0xfb19('0x9'),auth[_0xfb19('0x6')](),controller['update']);router['put'](_0xfb19('0x11'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xfb19('0x12'),auth['isAuthenticated'](),controller[_0xfb19('0x13')]);router[_0xfb19('0x14')](_0xfb19('0x9'),auth[_0xfb19('0x6')](),controller[_0xfb19('0x15')]);module[_0xfb19('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9f06957..ae5170b 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 _0xc01b=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x3243d4,_0x2cfa97){var _0x45f124=function(_0xf8e1ce){while(--_0xf8e1ce){_0x3243d4['push'](_0x3243d4['shift']());}};_0x45f124(++_0x2cfa97);}(_0xc01b,0x74));var _0xbc01=function(_0x56bc08,_0x27e788){_0x56bc08=_0x56bc08-0x0;var _0x27b2ca=_0xc01b[_0x56bc08];return _0x27b2ca;};'use strict';var Sequelize=require(_0xbc01('0x0'));module[_0xbc01('0x1')]={'body':{'type':Sequelize[_0xbc01('0x2')](_0xbc01('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbc01('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbc01('0x5')]('in',_0xbc01('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbc01('0x7')](0xbe)},'phone':{'type':Sequelize[_0xbc01('0x7')]},'readAt':{'type':Sequelize[_0xbc01('0x8')]},'secret':{'type':Sequelize[_0xbc01('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbc01('0x7')]},'providerResponse':{'type':Sequelize[_0xbc01('0x2')]}}; \ No newline at end of file +var _0x0cee=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x227745,_0x171942){var _0x4c4a55=function(_0x361c82){while(--_0x361c82){_0x227745['push'](_0x227745['shift']());}};_0x4c4a55(++_0x171942);}(_0x0cee,0x113));var _0xe0ce=function(_0x48ce65,_0x1957fe){_0x48ce65=_0x48ce65-0x0;var _0x3a0e1c=_0x0cee[_0x48ce65];return _0x3a0e1c;};'use strict';var Sequelize=require(_0xe0ce('0x0'));module[_0xe0ce('0x1')]={'body':{'type':Sequelize[_0xe0ce('0x2')](_0xe0ce('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe0ce('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0ce('0x5')]('in',_0xe0ce('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe0ce('0x7')](0xbe)},'phone':{'type':Sequelize[_0xe0ce('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xe0ce('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe0ce('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ae787b5..d994665 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 _0xd309=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','WhatsappMessage','includeAll','include','findAll','show','params','options','find','create','body','update','describe','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteraction','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','fullname','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','inspect','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x231261,_0x1f241f){var _0x7dc2=function(_0xa1ebaf){while(--_0xa1ebaf){_0x231261['push'](_0x231261['shift']());}};_0x7dc2(++_0x1f241f);}(_0xd309,0x77));var _0x9d30=function(_0x2e96fc,_0x5b6556){_0x2e96fc=_0x2e96fc-0x0;var _0x51c0b8=_0xd309[_0x2e96fc];return _0x51c0b8;};'use strict';var emlformat=require(_0x9d30('0x0'));var rimraf=require(_0x9d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d30('0x2'));var moment=require(_0x9d30('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9d30('0x4'));var util=require(_0x9d30('0x5'));var path=require(_0x9d30('0x6'));var sox=require(_0x9d30('0x7'));var csv=require(_0x9d30('0x8'));var ejs=require(_0x9d30('0x9'));var fs=require('fs');var fs_extra=require(_0x9d30('0xa'));var _=require('lodash');var squel=require(_0x9d30('0xb'));var crypto=require(_0x9d30('0xc'));var jsforce=require(_0x9d30('0xd'));var deskjs=require(_0x9d30('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d30('0xf'));var Papa=require('papaparse');var Redis=require(_0x9d30('0x10'));var authService=require(_0x9d30('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d30('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d30('0x13'))(_0x9d30('0x14'));var utils=require(_0x9d30('0x15'));var config=require(_0x9d30('0x16'));var licenseUtil=require(_0x9d30('0x17'));var db=require(_0x9d30('0x18'))['db'];config[_0x9d30('0x19')]=_['defaults'](config[_0x9d30('0x19')],{'host':_0x9d30('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d30('0x19')]));require('./whatsappMessage.socket')[_0x9d30('0x1b')](socket);var jayson=require(_0x9d30('0x1c'));var client=jayson[_0x9d30('0x1d')][_0x9d30('0x1e')]({'port':0x232c});var client9002=jayson[_0x9d30('0x1d')][_0x9d30('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2f2202,_0x2ed591,_0x1b6d10,_0x2f8751){return new BPromise(function(_0x147ac8,_0x1a5215){var _0x86a4b1=_0x2f8751||client;return _0x86a4b1[_0x9d30('0x1f')](_0x2f2202,_0x1b6d10)[_0x9d30('0x20')](function(_0x2bf078){logger[_0x9d30('0x21')](_0x9d30('0x22'),_0x2ed591,_0x9d30('0x23'));logger[_0x9d30('0x24')](_0x9d30('0x25'),_0x2ed591,_0x9d30('0x23'),JSON[_0x9d30('0x26')](_0x2bf078));if(_0x2bf078['error']){if(_0x2bf078['error'][_0x9d30('0x27')]===0x1f4){logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);return _0x1a5215(_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);}logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);return _0x147ac8(_0x2bf078['error']['message']);}else{logger['info'](_0x9d30('0x22'),_0x2ed591,_0x9d30('0x23'));_0x147ac8(_0x2bf078[_0x9d30('0x2a')][_0x9d30('0x29')]);}})[_0x9d30('0x2b')](function(_0x553272){logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x553272);_0x1a5215(_0x553272);});});}function respondWithStatusCode(_0xb76ecc,_0x4d540a){_0x4d540a=_0x4d540a||0xcc;return function(_0x4d128b){if(_0x4d128b){return _0xb76ecc[_0x9d30('0x2c')](_0x4d540a);}return _0xb76ecc['status'](_0x4d540a)[_0x9d30('0x2d')]();};}function respondWithResult(_0xd55b40,_0x50495f){_0x50495f=_0x50495f||0xc8;return function(_0x18d9d4){if(_0x18d9d4){return _0xd55b40[_0x9d30('0x2e')](_0x50495f)[_0x9d30('0x2f')](_0x18d9d4);}};}function respondWithFilteredResult(_0x37a452,_0x4c7d3e){return function(_0xfe48bf){if(_0xfe48bf){var _0x7538c7=typeof _0x4c7d3e['offset']==='undefined'&&typeof _0x4c7d3e[_0x9d30('0x30')]===_0x9d30('0x31');var _0x1bd32b=_0xfe48bf[_0x9d30('0x32')];var _0x2417fa=_0x7538c7?0x0:_0x4c7d3e[_0x9d30('0x33')];var _0x4006b5=_0x7538c7?_0xfe48bf[_0x9d30('0x32')]:_0x4c7d3e[_0x9d30('0x33')]+_0x4c7d3e[_0x9d30('0x30')];var _0x4245ae;if(_0x4006b5>=_0x1bd32b){_0x4006b5=_0x1bd32b;_0x4245ae=0xc8;}else{_0x4245ae=0xce;}_0x37a452[_0x9d30('0x2e')](_0x4245ae);return _0x37a452[_0x9d30('0x34')](_0x9d30('0x35'),_0x2417fa+'-'+_0x4006b5+'/'+_0x1bd32b)[_0x9d30('0x2f')](_0xfe48bf);}return null;};}function patchUpdates(_0x48eabf){return function(_0x541994){try{jsonpatch['apply'](_0x541994,_0x48eabf,!![]);}catch(_0x38739c){return BPromise[_0x9d30('0x36')](_0x38739c);}return _0x541994[_0x9d30('0x37')]();};}function saveUpdates(_0x75d1fe,_0x54782a){return function(_0x40d9e4){if(_0x40d9e4){return _0x40d9e4['update'](_0x75d1fe)[_0x9d30('0x20')](function(_0x59a86d){return _0x59a86d;});}return null;};}function removeEntity(_0x26fd7d,_0x2a9c56){return function(_0xecd2e7){if(_0xecd2e7){return _0xecd2e7[_0x9d30('0x38')]()['then'](function(){_0x26fd7d['status'](0xcc)[_0x9d30('0x2d')]();});}};}function handleEntityNotFound(_0x5b1d76,_0xffc297){return function(_0x4a9889){if(!_0x4a9889){_0x5b1d76[_0x9d30('0x2c')](0x194);}return _0x4a9889;};}function handleError(_0x248d13,_0x21e99c){_0x21e99c=_0x21e99c||0x1f4;return function(_0x4560f0){logger['error'](_0x4560f0[_0x9d30('0x39')]);if(_0x4560f0[_0x9d30('0x3a')]){delete _0x4560f0[_0x9d30('0x3a')];}_0x248d13[_0x9d30('0x2e')](_0x21e99c)[_0x9d30('0x3b')](_0x4560f0);};}exports['index']=function(_0x3cd5e0,_0x75f4da){var _0x49d29c={},_0x347940={},_0x2b99f9={'count':0x0,'rows':[]};var _0xf25036=_[_0x9d30('0x3c')](db['WhatsappMessage'][_0x9d30('0x3d')],function(_0x2785c5){return{'name':_0x2785c5[_0x9d30('0x3e')],'type':_0x2785c5[_0x9d30('0x3f')][_0x9d30('0x40')]};});_0x347940[_0x9d30('0x41')]=_[_0x9d30('0x3c')](_0xf25036,_0x9d30('0x3a'));_0x347940[_0x9d30('0x42')]=_[_0x9d30('0x43')](_0x3cd5e0[_0x9d30('0x42')]);_0x347940[_0x9d30('0x44')]=_[_0x9d30('0x45')](_0x347940[_0x9d30('0x41')],_0x347940[_0x9d30('0x42')]);_0x49d29c[_0x9d30('0x46')]=_[_0x9d30('0x45')](_0x347940[_0x9d30('0x41')],qs[_0x9d30('0x47')](_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x47')]));_0x49d29c[_0x9d30('0x46')]=_0x49d29c[_0x9d30('0x46')][_0x9d30('0x48')]?_0x49d29c[_0x9d30('0x46')]:_0x347940[_0x9d30('0x41')];if(!_0x3cd5e0['query'][_0x9d30('0x49')](_0x9d30('0x4a'))){_0x49d29c[_0x9d30('0x30')]=qs['limit'](_0x3cd5e0[_0x9d30('0x42')]['limit']);_0x49d29c[_0x9d30('0x33')]=qs['offset'](_0x3cd5e0['query'][_0x9d30('0x33')]);}_0x49d29c[_0x9d30('0x4b')]=qs[_0x9d30('0x4c')](_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x4c')]);_0x49d29c[_0x9d30('0x4d')]=qs[_0x9d30('0x44')](_[_0x9d30('0x4e')](_0x3cd5e0[_0x9d30('0x42')],_0x347940[_0x9d30('0x44')]),_0xf25036);if(_0x3cd5e0['query']['filter']){_0x49d29c[_0x9d30('0x4d')]=_[_0x9d30('0x4f')](_0x49d29c[_0x9d30('0x4d')],{'$or':_[_0x9d30('0x3c')](_0xf25036,function(_0x483a68){if(_0x483a68[_0x9d30('0x3f')]!=='VIRTUAL'){var _0x7eab1b={};_0x7eab1b[_0x483a68['name']]={'$like':'%'+_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x50')]+'%'};return _0x7eab1b;}})});}_0x49d29c=_[_0x9d30('0x4f')]({},_0x49d29c,_0x3cd5e0['options']);var _0x5c72e1={'where':_0x49d29c[_0x9d30('0x4d')]};return db[_0x9d30('0x51')]['count'](_0x5c72e1)[_0x9d30('0x20')](function(_0x4360b1){_0x2b99f9[_0x9d30('0x32')]=_0x4360b1;if(_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x52')]){_0x49d29c[_0x9d30('0x53')]=[{'all':!![]}];}return db[_0x9d30('0x51')][_0x9d30('0x54')](_0x49d29c);})['then'](function(_0x241e88){_0x2b99f9['rows']=_0x241e88;return _0x2b99f9;})[_0x9d30('0x20')](respondWithFilteredResult(_0x75f4da,_0x49d29c))[_0x9d30('0x2b')](handleError(_0x75f4da,null));};exports[_0x9d30('0x55')]=function(_0x2b3864,_0x2bd198){var _0x3088fc={'raw':!![],'where':{'id':_0x2b3864[_0x9d30('0x56')]['id']}},_0x3669e3={};_0x3669e3[_0x9d30('0x41')]=_[_0x9d30('0x43')](db[_0x9d30('0x51')][_0x9d30('0x3d')]);_0x3669e3['query']=_[_0x9d30('0x43')](_0x2b3864['query']);_0x3669e3[_0x9d30('0x44')]=_[_0x9d30('0x45')](_0x3669e3[_0x9d30('0x41')],_0x3669e3[_0x9d30('0x42')]);_0x3088fc['attributes']=_[_0x9d30('0x45')](_0x3669e3['model'],qs['fields'](_0x2b3864[_0x9d30('0x42')][_0x9d30('0x47')]));_0x3088fc[_0x9d30('0x46')]=_0x3088fc['attributes']['length']?_0x3088fc['attributes']:_0x3669e3[_0x9d30('0x41')];if(_0x2b3864[_0x9d30('0x42')]['includeAll']){_0x3088fc[_0x9d30('0x53')]=[{'all':!![]}];}_0x3088fc=_[_0x9d30('0x4f')]({},_0x3088fc,_0x2b3864[_0x9d30('0x57')]);return db[_0x9d30('0x51')][_0x9d30('0x58')](_0x3088fc)['then'](handleEntityNotFound(_0x2bd198,null))[_0x9d30('0x20')](respondWithResult(_0x2bd198,null))[_0x9d30('0x2b')](handleError(_0x2bd198,null));};exports[_0x9d30('0x59')]=function(_0x26ae32,_0x353898){return db['WhatsappMessage'][_0x9d30('0x59')](_0x26ae32[_0x9d30('0x5a')],{})['then'](respondWithResult(_0x353898,0xc9))[_0x9d30('0x2b')](handleError(_0x353898,null));};exports[_0x9d30('0x5b')]=function(_0x3a7724,_0x3cbba6){if(_0x3a7724[_0x9d30('0x5a')]['id']){delete _0x3a7724['body']['id'];}return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x3a7724[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x3cbba6,null))[_0x9d30('0x20')](saveUpdates(_0x3a7724[_0x9d30('0x5a')],null))['then'](respondWithResult(_0x3cbba6,null))[_0x9d30('0x2b')](handleError(_0x3cbba6,null));};exports[_0x9d30('0x38')]=function(_0x403a74,_0x13f5bc){return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x403a74[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x13f5bc,null))[_0x9d30('0x20')](removeEntity(_0x13f5bc,null))['catch'](handleError(_0x13f5bc,null));};exports[_0x9d30('0x5c')]=function(_0x39e6ce,_0x1583d6){return db[_0x9d30('0x51')][_0x9d30('0x5c')]()[_0x9d30('0x20')](respondWithResult(_0x1583d6,null))[_0x9d30('0x2b')](handleError(_0x1583d6,null));};var interaction_log=require(_0x9d30('0x13'))('whatsapp-interactions');exports['accept']=function(_0x11c6d5,_0x3da296,_0xce998a){var _0x1cf979={'agent':{},'channel':_0x9d30('0x5d')};if(_0x11c6d5[_0x9d30('0x5a')]['id']){delete _0x11c6d5[_0x9d30('0x5a')]['id'];}_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x5e')]=!![];_0x11c6d5['body'][_0x9d30('0x5f')]=moment()[_0x9d30('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')]=_0x11c6d5['body']['UserId']||_0x11c6d5['user']['id'];_0x1cf979[_0x9d30('0x62')]['id']=_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')];return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x11c6d5[_0x9d30('0x56')]['id'],'UserId':null}})[_0x9d30('0x20')](handleEntityNotFound(_0x3da296,null))['then'](saveUpdates(_0x11c6d5['body'],null))['then'](function(_0x361b1b){if(_0x361b1b){_0x1cf979[_0x9d30('0x29')]=_0x361b1b[_0x9d30('0x63')]({'plain':!![]});return db[_0x9d30('0x64')][_0x9d30('0x58')]({'where':{'id':_0x361b1b['WhatsappInteractionId']}});}return null;})[_0x9d30('0x20')](handleEntityNotFound(_0x3da296,null))['then'](function(_0x548eda){if(_0x548eda){return _0x548eda[_0x9d30('0x5b')]({'UserId':_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')],'read1stAt':_[_0x9d30('0x65')](_0x548eda['read1stAt'])?moment()[_0x9d30('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9d30('0x20')](function(_0x452f7a){if(_0x452f7a){_0x1cf979[_0x9d30('0x66')]=_0x452f7a['get']({'plain':!![]});interaction_log[_0x9d30('0x21')](_0x9d30('0x67'),_0x11c6d5[_0x9d30('0x68')]['id'],_0x11c6d5[_0x9d30('0x68')][_0x9d30('0x3a')],_0x11c6d5[_0x9d30('0x68')]['role'],_0x1cf979[_0x9d30('0x66')]['id'],_0x11c6d5[_0x9d30('0x5a')]?JSON['stringify'](_0x11c6d5['body']):_0x9d30('0x69'));return respondWithRpcPromise('AcceptMessage',_0x9d30('0x6a'),_0x1cf979);}return null;})['then'](function(_0x159bae){var _0x579db8=_0x9d30('0x6b')+_0x159bae[_0x9d30('0x29')][_0x9d30('0x6c')];return db[_0x9d30('0x6d')]['query'](_0x579db8,{'type':db[_0x9d30('0x6e')][_0x9d30('0x6f')][_0x9d30('0x70')],'raw':!![]})['then'](function(_0x2bac21){return _0x2bac21;});})[_0x9d30('0x20')](function(_0x41dc42){if(_0x41dc42){_0x1cf979[_0x9d30('0x29')][_0x9d30('0x71')]=_0x41dc42[0x0];if(!_0x11c6d5['body'][_0x9d30('0x61')])return;return db['User']['find']({'where':{'id':_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')],'role':_0x9d30('0x62')},'attributes':['id',_0x9d30('0x3a'),'fullname',_0x9d30('0x72'),_0x9d30('0x73')],'raw':!![]});}return null;})['then'](function(_0x4e659a){if(!_0x4e659a)return null;_0x1cf979[_0x9d30('0x29')][_0x9d30('0x62')]=_0x4e659a;return _0x1cf979;})[_0x9d30('0x20')](function(_0x3be80f){if(_0x3be80f){if(_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x74')]){_0x1cf979[_0x9d30('0x29')]['interface']=util[_0x9d30('0x60')](_0x9d30('0x75'),_0x11c6d5[_0x9d30('0x68')]['name']);_0x1cf979[_0x9d30('0x29')][_0x9d30('0x76')]=_0x1cf979[_0x9d30('0x76')];_0x1cf979[_0x9d30('0x29')][_0x9d30('0x77')]=_0x1cf979['channel'];_0x1cf979['message'][_0x9d30('0x78')]=_0x9d30('0x79');return respondWithRpcPromise(_0x9d30('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x1cf979[_0x9d30('0x29')]},client9002)[_0x9d30('0x20')](function(){return _0x1cf979;});}return _0x1cf979;}return null;})[_0x9d30('0x20')](respondWithResult(_0x3da296,null))['catch'](handleError(_0x3da296,null));};var interaction_log=require(_0x9d30('0x13'))(_0x9d30('0x7b'));exports[_0x9d30('0x36')]=function(_0x7e623a,_0x38c662,_0x14b592){var _0x44a3c0={'agent':{},'channel':_0x9d30('0x5d')};if(_0x7e623a[_0x9d30('0x5a')]['id']){delete _0x7e623a['body']['id'];}_0x7e623a[_0x9d30('0x5a')][_0x9d30('0x61')]=_0x7e623a[_0x9d30('0x5a')]['UserId']||_0x7e623a[_0x9d30('0x68')]['id'];_0x44a3c0[_0x9d30('0x62')]['id']=_0x7e623a[_0x9d30('0x5a')]['UserId'];return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x7e623a[_0x9d30('0x56')]['id'],'UserId':null}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c662,null))['then'](function(_0x220bb3){if(_0x220bb3){_0x44a3c0[_0x9d30('0x29')]=_0x220bb3[_0x9d30('0x63')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x220bb3['WhatsappInteractionId']}});}return null;})[_0x9d30('0x20')](handleEntityNotFound(_0x38c662,null))[_0x9d30('0x20')](function(_0x1c6bb7){if(_0x1c6bb7){_0x44a3c0[_0x9d30('0x66')]=_0x1c6bb7[_0x9d30('0x63')]({'plain':!![]});interaction_log[_0x9d30('0x21')](_0x9d30('0x7c'),_0x7e623a[_0x9d30('0x68')]['id'],_0x7e623a[_0x9d30('0x68')][_0x9d30('0x3a')],_0x7e623a['user']['role'],_0x44a3c0['interaction']['id'],_0x7e623a[_0x9d30('0x5a')]?JSON[_0x9d30('0x26')](_0x7e623a[_0x9d30('0x5a')]):_0x9d30('0x69'));return respondWithRpcPromise('RejectMessage',_0x9d30('0x7d'),_0x44a3c0);}return null;})[_0x9d30('0x20')](function(_0x427d11){var _0x5a734c=_0x9d30('0x6b')+_0x427d11[_0x9d30('0x29')][_0x9d30('0x6c')];return db[_0x9d30('0x6d')][_0x9d30('0x42')](_0x5a734c,{'type':db[_0x9d30('0x6e')][_0x9d30('0x6f')]['SELECT'],'raw':!![]})[_0x9d30('0x20')](function(_0x1fd8b0){return _0x1fd8b0;});})[_0x9d30('0x20')](function(_0x3314c9){if(_0x3314c9){_0x44a3c0[_0x9d30('0x29')][_0x9d30('0x71')]=_0x3314c9[0x0];if(!_0x7e623a['body'][_0x9d30('0x61')])return;return db[_0x9d30('0x7e')]['find']({'where':{'id':_0x7e623a[_0x9d30('0x5a')][_0x9d30('0x61')],'role':'agent'},'attributes':['id',_0x9d30('0x3a'),_0x9d30('0x7f'),_0x9d30('0x72'),_0x9d30('0x73')],'raw':!![]});}return null;})[_0x9d30('0x20')](function(_0x1e3ea9){if(!_0x1e3ea9)return null;_0x44a3c0['message'][_0x9d30('0x62')]=_0x1e3ea9;return _0x44a3c0;})[_0x9d30('0x20')](function(_0x5f0cef){if(_0x5f0cef){_0x5f0cef[_0x9d30('0x29')]['interface']=util[_0x9d30('0x60')](_0x9d30('0x75'),_0x7e623a[_0x9d30('0x68')][_0x9d30('0x3a')]);_0x5f0cef[_0x9d30('0x29')][_0x9d30('0x76')]=_0x44a3c0[_0x9d30('0x76')];_0x5f0cef[_0x9d30('0x29')][_0x9d30('0x77')]=_0x44a3c0[_0x9d30('0x76')];_0x5f0cef[_0x9d30('0x29')]['event']=_0x9d30('0x36');respondWithRpcPromise('EventManager',_0x9d30('0x7a'),{'event':_0x9d30('0x80'),'message':_0x5f0cef['message']},client9002);return _0x44a3c0;}return null;})[_0x9d30('0x20')](respondWithResult(_0x38c662,null))[_0x9d30('0x2b')](handleError(_0x38c662,null));};exports[_0x9d30('0x2e')]=function(_0x3eec57,_0x38c232,_0x4c9274){if(_0x3eec57['body']['id']){delete _0x3eec57['body']['id'];}var _0x3a73b2;return db['WhatsappMessage'][_0x9d30('0x58')]({'where':{'id':_0x3eec57[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c232,null))[_0x9d30('0x20')](function(_0x54af10){if(_0x54af10){_0x3a73b2=_0x54af10;return db[_0x9d30('0x81')][_0x9d30('0x58')]({'where':{'id':_0x54af10['WhatsappAccountId']}});}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c232,null))['then'](function(_0x42f01b){if(_0x42f01b){logger[_0x9d30('0x24')](_0x9d30('0x82'),_0x9d30('0x2e'),_0x9d30('0x83'),_0x42f01b[_0x9d30('0x3f')],util['inspect'](_0x3eec57['body'],{'showHidden':![],'depth':null}));switch(_0x42f01b[_0x9d30('0x3f')]){case _0x9d30('0x84'):if(_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x85')]&&_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x85')]===_0x3a73b2['messageId']&&_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x86')]&&_0x3eec57['body']['MessageStatus']===_0x9d30('0x5e')){return _0x3a73b2[_0x9d30('0x5b')]({'read':!![]});}else{logger[_0x9d30('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x9d30('0x2e'),_0x9d30('0x84'),util[_0x9d30('0x87')](_0x3eec57['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a73b2;}})[_0x9d30('0x20')](respondWithResult(_0x38c232,null))[_0x9d30('0x2b')](handleError(_0x38c232,null));}; \ No newline at end of file +var _0x7668=['rawAttributes','intersection','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','../../config/logger','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','EventManager','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','code','error','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','WhatsappMessage','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7668,0x1e9));var _0x8766=function(_0x111d8b,_0x3f356f){_0x111d8b=_0x111d8b-0x0;var _0x56656c=_0x7668[_0x111d8b];return _0x56656c;};'use strict';var emlformat=require(_0x8766('0x0'));var rimraf=require(_0x8766('0x1'));var zipdir=require(_0x8766('0x2'));var jsonpatch=require(_0x8766('0x3'));var rp=require(_0x8766('0x4'));var moment=require(_0x8766('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8766('0x6'));var util=require(_0x8766('0x7'));var path=require(_0x8766('0x8'));var sox=require('sox');var csv=require(_0x8766('0x9'));var ejs=require(_0x8766('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8766('0xb'));var jsforce=require(_0x8766('0xc'));var deskjs=require(_0x8766('0xd'));var toCsv=require(_0x8766('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8766('0xe'));var authService=require(_0x8766('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8766('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x8766('0x11'));var config=require(_0x8766('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8766('0x13'))['db'];config['redis']=_[_0x8766('0x14')](config[_0x8766('0x15')],{'host':_0x8766('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8766('0x15')]));require(_0x8766('0x17'))[_0x8766('0x18')](socket);var jayson=require(_0x8766('0x19'));var client=jayson[_0x8766('0x1a')][_0x8766('0x1b')]({'port':0x232c});var client9002=jayson[_0x8766('0x1a')][_0x8766('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x133897,_0x1c4161,_0x447699,_0x635f4){return new BPromise(function(_0x4102f0,_0x4162d8){var _0x4d6f66=_0x635f4||client;return _0x4d6f66[_0x8766('0x1c')](_0x133897,_0x447699)[_0x8766('0x1d')](function(_0x4a607a){logger[_0x8766('0x1e')](_0x8766('0x1f'),_0x1c4161,_0x8766('0x20'));logger[_0x8766('0x21')](_0x8766('0x22'),_0x1c4161,_0x8766('0x20'),JSON['stringify'](_0x4a607a));if(_0x4a607a['error']){if(_0x4a607a['error'][_0x8766('0x23')]===0x1f4){logger[_0x8766('0x24')](_0x8766('0x1f'),_0x1c4161,_0x4a607a[_0x8766('0x24')][_0x8766('0x25')]);return _0x4162d8(_0x4a607a['error'][_0x8766('0x25')]);}logger['error'](_0x8766('0x1f'),_0x1c4161,_0x4a607a[_0x8766('0x24')][_0x8766('0x25')]);return _0x4102f0(_0x4a607a[_0x8766('0x24')]['message']);}else{logger[_0x8766('0x1e')](_0x8766('0x1f'),_0x1c4161,'request\x20sent');_0x4102f0(_0x4a607a['result'][_0x8766('0x25')]);}})['catch'](function(_0x1897c8){logger[_0x8766('0x24')](_0x8766('0x1f'),_0x1c4161,_0x1897c8);_0x4162d8(_0x1897c8);});});}function respondWithStatusCode(_0x357cc6,_0x7fd506){_0x7fd506=_0x7fd506||0xcc;return function(_0x45fe12){if(_0x45fe12){return _0x357cc6[_0x8766('0x26')](_0x7fd506);}return _0x357cc6[_0x8766('0x27')](_0x7fd506)[_0x8766('0x28')]();};}function respondWithResult(_0x16d686,_0xc2587e){_0xc2587e=_0xc2587e||0xc8;return function(_0x483db8){if(_0x483db8){return _0x16d686[_0x8766('0x27')](_0xc2587e)['json'](_0x483db8);}};}function respondWithFilteredResult(_0x502b94,_0x576551){return function(_0x507f62){if(_0x507f62){var _0x4d8720=typeof _0x576551[_0x8766('0x29')]===_0x8766('0x2a')&&typeof _0x576551[_0x8766('0x2b')]==='undefined';var _0x3487ab=_0x507f62[_0x8766('0x2c')];var _0xf1634b=_0x4d8720?0x0:_0x576551[_0x8766('0x29')];var _0xb85dca=_0x4d8720?_0x507f62[_0x8766('0x2c')]:_0x576551[_0x8766('0x29')]+_0x576551[_0x8766('0x2b')];var _0x11997a;if(_0xb85dca>=_0x3487ab){_0xb85dca=_0x3487ab;_0x11997a=0xc8;}else{_0x11997a=0xce;}_0x502b94[_0x8766('0x27')](_0x11997a);return _0x502b94[_0x8766('0x2d')](_0x8766('0x2e'),_0xf1634b+'-'+_0xb85dca+'/'+_0x3487ab)[_0x8766('0x2f')](_0x507f62);}return null;};}function patchUpdates(_0x299499){return function(_0xa0319d){try{jsonpatch[_0x8766('0x30')](_0xa0319d,_0x299499,!![]);}catch(_0x11f9ec){return BPromise[_0x8766('0x31')](_0x11f9ec);}return _0xa0319d[_0x8766('0x32')]();};}function saveUpdates(_0xc2eaed,_0x13ef88){return function(_0x34248d){if(_0x34248d){return _0x34248d['update'](_0xc2eaed)[_0x8766('0x1d')](function(_0x49addb){return _0x49addb;});}return null;};}function removeEntity(_0x21e738,_0x4c2314){return function(_0x4f8e08){if(_0x4f8e08){return _0x4f8e08[_0x8766('0x33')]()[_0x8766('0x1d')](function(){_0x21e738[_0x8766('0x27')](0xcc)[_0x8766('0x28')]();});}};}function handleEntityNotFound(_0x421e34,_0x38a6cc){return function(_0x3ae6ee){if(!_0x3ae6ee){_0x421e34['sendStatus'](0x194);}return _0x3ae6ee;};}function handleError(_0x397c64,_0x3a4157){_0x3a4157=_0x3a4157||0x1f4;return function(_0x6330b){logger['error'](_0x6330b[_0x8766('0x34')]);if(_0x6330b[_0x8766('0x35')]){delete _0x6330b['name'];}_0x397c64[_0x8766('0x27')](_0x3a4157)[_0x8766('0x36')](_0x6330b);};}exports[_0x8766('0x37')]=function(_0x37fe09,_0x16fc56){var _0x48b072={},_0x5019ed={},_0x51d329={'count':0x0,'rows':[]};var _0x200f2e=_['map'](db[_0x8766('0x38')]['rawAttributes'],function(_0x3bc94f){return{'name':_0x3bc94f['fieldName'],'type':_0x3bc94f[_0x8766('0x39')][_0x8766('0x3a')]};});_0x5019ed[_0x8766('0x3b')]=_[_0x8766('0x3c')](_0x200f2e,_0x8766('0x35'));_0x5019ed['query']=_[_0x8766('0x3d')](_0x37fe09[_0x8766('0x3e')]);_0x5019ed['filters']=_['intersection'](_0x5019ed[_0x8766('0x3b')],_0x5019ed[_0x8766('0x3e')]);_0x48b072[_0x8766('0x3f')]=_['intersection'](_0x5019ed[_0x8766('0x3b')],qs[_0x8766('0x40')](_0x37fe09['query'][_0x8766('0x40')]));_0x48b072[_0x8766('0x3f')]=_0x48b072[_0x8766('0x3f')][_0x8766('0x41')]?_0x48b072[_0x8766('0x3f')]:_0x5019ed[_0x8766('0x3b')];if(!_0x37fe09[_0x8766('0x3e')][_0x8766('0x42')](_0x8766('0x43'))){_0x48b072[_0x8766('0x2b')]=qs[_0x8766('0x2b')](_0x37fe09[_0x8766('0x3e')]['limit']);_0x48b072[_0x8766('0x29')]=qs[_0x8766('0x29')](_0x37fe09['query']['offset']);}_0x48b072[_0x8766('0x44')]=qs[_0x8766('0x45')](_0x37fe09['query']['sort']);_0x48b072[_0x8766('0x46')]=qs[_0x8766('0x47')](_[_0x8766('0x48')](_0x37fe09[_0x8766('0x3e')],_0x5019ed[_0x8766('0x47')]),_0x200f2e);if(_0x37fe09['query']['filter']){_0x48b072[_0x8766('0x46')]=_[_0x8766('0x49')](_0x48b072[_0x8766('0x46')],{'$or':_[_0x8766('0x3c')](_0x200f2e,function(_0x37a704){if(_0x37a704[_0x8766('0x39')]!==_0x8766('0x4a')){var _0x538d39={};_0x538d39[_0x37a704[_0x8766('0x35')]]={'$like':'%'+_0x37fe09['query'][_0x8766('0x4b')]+'%'};return _0x538d39;}})});}_0x48b072=_[_0x8766('0x49')]({},_0x48b072,_0x37fe09[_0x8766('0x4c')]);var _0x8ab4={'where':_0x48b072['where']};return db[_0x8766('0x38')][_0x8766('0x2c')](_0x8ab4)['then'](function(_0x14dc6d){_0x51d329[_0x8766('0x2c')]=_0x14dc6d;if(_0x37fe09[_0x8766('0x3e')][_0x8766('0x4d')]){_0x48b072[_0x8766('0x4e')]=[{'all':!![]}];}return db[_0x8766('0x38')][_0x8766('0x4f')](_0x48b072);})['then'](function(_0x418b29){_0x51d329[_0x8766('0x50')]=_0x418b29;return _0x51d329;})[_0x8766('0x1d')](respondWithFilteredResult(_0x16fc56,_0x48b072))[_0x8766('0x51')](handleError(_0x16fc56,null));};exports['show']=function(_0x521f2a,_0x35fcee){var _0x4bb1d7={'raw':!![],'where':{'id':_0x521f2a[_0x8766('0x52')]['id']}},_0x135c7d={};_0x135c7d[_0x8766('0x3b')]=_[_0x8766('0x3d')](db['WhatsappMessage'][_0x8766('0x53')]);_0x135c7d[_0x8766('0x3e')]=_[_0x8766('0x3d')](_0x521f2a[_0x8766('0x3e')]);_0x135c7d['filters']=_[_0x8766('0x54')](_0x135c7d[_0x8766('0x3b')],_0x135c7d[_0x8766('0x3e')]);_0x4bb1d7[_0x8766('0x3f')]=_['intersection'](_0x135c7d['model'],qs[_0x8766('0x40')](_0x521f2a[_0x8766('0x3e')][_0x8766('0x40')]));_0x4bb1d7[_0x8766('0x3f')]=_0x4bb1d7[_0x8766('0x3f')]['length']?_0x4bb1d7[_0x8766('0x3f')]:_0x135c7d[_0x8766('0x3b')];if(_0x521f2a[_0x8766('0x3e')]['includeAll']){_0x4bb1d7[_0x8766('0x4e')]=[{'all':!![]}];}_0x4bb1d7=_[_0x8766('0x49')]({},_0x4bb1d7,_0x521f2a[_0x8766('0x4c')]);return db[_0x8766('0x38')][_0x8766('0x55')](_0x4bb1d7)['then'](handleEntityNotFound(_0x35fcee,null))[_0x8766('0x1d')](respondWithResult(_0x35fcee,null))['catch'](handleError(_0x35fcee,null));};exports['create']=function(_0x22b09b,_0x3bcd25){return db[_0x8766('0x38')][_0x8766('0x56')](_0x22b09b[_0x8766('0x57')],{})[_0x8766('0x1d')](respondWithResult(_0x3bcd25,0xc9))['catch'](handleError(_0x3bcd25,null));};exports[_0x8766('0x58')]=function(_0x2bd111,_0x127442){if(_0x2bd111[_0x8766('0x57')]['id']){delete _0x2bd111[_0x8766('0x57')]['id'];}return db[_0x8766('0x38')][_0x8766('0x55')]({'where':{'id':_0x2bd111['params']['id']}})[_0x8766('0x1d')](handleEntityNotFound(_0x127442,null))[_0x8766('0x1d')](saveUpdates(_0x2bd111['body'],null))[_0x8766('0x1d')](respondWithResult(_0x127442,null))[_0x8766('0x51')](handleError(_0x127442,null));};exports[_0x8766('0x33')]=function(_0x2020fe,_0x47c749){return db[_0x8766('0x38')]['find']({'where':{'id':_0x2020fe[_0x8766('0x52')]['id']}})[_0x8766('0x1d')](handleEntityNotFound(_0x47c749,null))[_0x8766('0x1d')](removeEntity(_0x47c749,null))[_0x8766('0x51')](handleError(_0x47c749,null));};exports['describe']=function(_0xcc1765,_0x2f51da){return db[_0x8766('0x38')][_0x8766('0x59')]()[_0x8766('0x1d')](respondWithResult(_0x2f51da,null))[_0x8766('0x51')](handleError(_0x2f51da,null));};var interaction_log=require('../../config/logger')(_0x8766('0x5a'));exports[_0x8766('0x5b')]=function(_0x3d994e,_0x2d98ae,_0x13e46d){var _0x3a5740={'agent':{},'channel':_0x8766('0x5c')};if(_0x3d994e[_0x8766('0x57')]['id']){delete _0x3d994e[_0x8766('0x57')]['id'];}_0x3d994e['body'][_0x8766('0x5d')]=!![];_0x3d994e[_0x8766('0x57')][_0x8766('0x5e')]=moment()['format'](_0x8766('0x5f'));_0x3d994e[_0x8766('0x57')][_0x8766('0x60')]=_0x3d994e[_0x8766('0x57')][_0x8766('0x60')]||_0x3d994e[_0x8766('0x61')]['id'];_0x3a5740['agent']['id']=_0x3d994e[_0x8766('0x57')][_0x8766('0x60')];return db[_0x8766('0x38')][_0x8766('0x55')]({'where':{'id':_0x3d994e[_0x8766('0x52')]['id'],'UserId':null}})[_0x8766('0x1d')](handleEntityNotFound(_0x2d98ae,null))[_0x8766('0x1d')](saveUpdates(_0x3d994e['body'],null))[_0x8766('0x1d')](function(_0x323d5b){if(_0x323d5b){_0x3a5740[_0x8766('0x25')]=_0x323d5b[_0x8766('0x62')]({'plain':!![]});return db[_0x8766('0x63')][_0x8766('0x55')]({'where':{'id':_0x323d5b[_0x8766('0x64')]}});}return null;})[_0x8766('0x1d')](handleEntityNotFound(_0x2d98ae,null))[_0x8766('0x1d')](function(_0x5b044c){if(_0x5b044c){return _0x5b044c[_0x8766('0x58')]({'UserId':_0x3d994e['body'][_0x8766('0x60')],'read1stAt':_[_0x8766('0x65')](_0x5b044c[_0x8766('0x66')])?moment()[_0x8766('0x67')](_0x8766('0x5f')):undefined});}return null;})['then'](function(_0x59ad6f){if(_0x59ad6f){_0x3a5740[_0x8766('0x68')]=_0x59ad6f[_0x8766('0x62')]({'plain':!![]});interaction_log[_0x8766('0x1e')](_0x8766('0x69'),_0x3d994e['user']['id'],_0x3d994e[_0x8766('0x61')][_0x8766('0x35')],_0x3d994e[_0x8766('0x61')][_0x8766('0x6a')],_0x3a5740['interaction']['id'],_0x3d994e['body']?JSON[_0x8766('0x6b')](_0x3d994e[_0x8766('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8766('0x6c'),_0x3a5740);}return null;})[_0x8766('0x1d')](function(_0x35555c){var _0x50d721=_0x8766('0x6d')+_0x35555c[_0x8766('0x25')][_0x8766('0x6e')];return db[_0x8766('0x6f')]['query'](_0x50d721,{'type':db[_0x8766('0x70')][_0x8766('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5b3f08){return _0x5b3f08;});})[_0x8766('0x1d')](function(_0x1b2316){if(_0x1b2316){_0x3a5740[_0x8766('0x25')][_0x8766('0x72')]=_0x1b2316[0x0];if(!_0x3d994e[_0x8766('0x57')]['UserId'])return;return db[_0x8766('0x73')][_0x8766('0x55')]({'where':{'id':_0x3d994e[_0x8766('0x57')][_0x8766('0x60')],'role':_0x8766('0x74')},'attributes':['id',_0x8766('0x35'),_0x8766('0x75'),_0x8766('0x76'),_0x8766('0x77')],'raw':!![]});}return null;})[_0x8766('0x1d')](function(_0x3f56b0){if(!_0x3f56b0)return null;_0x3a5740['message'][_0x8766('0x74')]=_0x3f56b0;return _0x3a5740;})['then'](function(_0x59ca05){if(_0x59ca05){if(_0x3d994e['body'][_0x8766('0x78')]){_0x3a5740[_0x8766('0x25')][_0x8766('0x79')]=util[_0x8766('0x67')](_0x8766('0x7a'),_0x3d994e[_0x8766('0x61')]['name']);_0x3a5740[_0x8766('0x25')][_0x8766('0x7b')]=_0x3a5740[_0x8766('0x7b')];_0x3a5740['message'][_0x8766('0x7c')]=_0x3a5740[_0x8766('0x7b')];_0x3a5740[_0x8766('0x25')][_0x8766('0x7d')]=_0x8766('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x3a5740[_0x8766('0x25')]},client9002)[_0x8766('0x1d')](function(){return _0x3a5740;});}return _0x3a5740;}return null;})['then'](respondWithResult(_0x2d98ae,null))[_0x8766('0x51')](handleError(_0x2d98ae,null));};var interaction_log=require(_0x8766('0x7e'))(_0x8766('0x5a'));exports[_0x8766('0x31')]=function(_0x3de788,_0x2eb7ed,_0x21853f){var _0xfb2e5={'agent':{},'channel':_0x8766('0x5c')};if(_0x3de788[_0x8766('0x57')]['id']){delete _0x3de788[_0x8766('0x57')]['id'];}_0x3de788['body']['UserId']=_0x3de788['body'][_0x8766('0x60')]||_0x3de788[_0x8766('0x61')]['id'];_0xfb2e5[_0x8766('0x74')]['id']=_0x3de788[_0x8766('0x57')][_0x8766('0x60')];return db[_0x8766('0x38')][_0x8766('0x55')]({'where':{'id':_0x3de788[_0x8766('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2eb7ed,null))[_0x8766('0x1d')](function(_0x223bcb){if(_0x223bcb){_0xfb2e5[_0x8766('0x25')]=_0x223bcb[_0x8766('0x62')]({'plain':!![]});return db[_0x8766('0x63')][_0x8766('0x55')]({'where':{'id':_0x223bcb[_0x8766('0x64')]}});}return null;})[_0x8766('0x1d')](handleEntityNotFound(_0x2eb7ed,null))['then'](function(_0x473258){if(_0x473258){_0xfb2e5[_0x8766('0x68')]=_0x473258[_0x8766('0x62')]({'plain':!![]});interaction_log[_0x8766('0x1e')](_0x8766('0x7f'),_0x3de788[_0x8766('0x61')]['id'],_0x3de788[_0x8766('0x61')][_0x8766('0x35')],_0x3de788[_0x8766('0x61')][_0x8766('0x6a')],_0xfb2e5['interaction']['id'],_0x3de788[_0x8766('0x57')]?JSON[_0x8766('0x6b')](_0x3de788['body']):_0x8766('0x80'));return respondWithRpcPromise(_0x8766('0x81'),_0x8766('0x82'),_0xfb2e5);}return null;})['then'](function(_0x1df4ed){var _0xe007a5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1df4ed['message'][_0x8766('0x6e')];return db[_0x8766('0x6f')][_0x8766('0x3e')](_0xe007a5,{'type':db[_0x8766('0x70')][_0x8766('0x71')][_0x8766('0x83')],'raw':!![]})[_0x8766('0x1d')](function(_0x193371){return _0x193371;});})[_0x8766('0x1d')](function(_0x362a00){if(_0x362a00){_0xfb2e5[_0x8766('0x25')]['contact']=_0x362a00[0x0];if(!_0x3de788[_0x8766('0x57')]['UserId'])return;return db[_0x8766('0x73')][_0x8766('0x55')]({'where':{'id':_0x3de788['body'][_0x8766('0x60')],'role':'agent'},'attributes':['id',_0x8766('0x35'),_0x8766('0x75'),_0x8766('0x76'),_0x8766('0x77')],'raw':!![]});}return null;})[_0x8766('0x1d')](function(_0xa437f6){if(!_0xa437f6)return null;_0xfb2e5[_0x8766('0x25')][_0x8766('0x74')]=_0xa437f6;return _0xfb2e5;})[_0x8766('0x1d')](function(_0x484c65){if(_0x484c65){_0x484c65[_0x8766('0x25')][_0x8766('0x79')]=util[_0x8766('0x67')](_0x8766('0x7a'),_0x3de788[_0x8766('0x61')][_0x8766('0x35')]);_0x484c65['message']['channel']=_0xfb2e5[_0x8766('0x7b')];_0x484c65[_0x8766('0x25')][_0x8766('0x7c')]=_0xfb2e5[_0x8766('0x7b')];_0x484c65[_0x8766('0x25')][_0x8766('0x7d')]='reject';respondWithRpcPromise(_0x8766('0x84'),_0x8766('0x84'),{'event':_0x8766('0x85'),'message':_0x484c65[_0x8766('0x25')]},client9002);return _0xfb2e5;}return null;})[_0x8766('0x1d')](respondWithResult(_0x2eb7ed,null))['catch'](handleError(_0x2eb7ed,null));};exports['status']=function(_0x358bb4,_0x14b757,_0x3dde09){if(_0x358bb4[_0x8766('0x57')]['id']){delete _0x358bb4['body']['id'];}var _0x4dfff7;return db[_0x8766('0x38')]['find']({'where':{'id':_0x358bb4[_0x8766('0x52')]['id']}})['then'](handleEntityNotFound(_0x14b757,null))[_0x8766('0x1d')](function(_0x1c1ec1){if(_0x1c1ec1){_0x4dfff7=_0x1c1ec1;return db[_0x8766('0x86')][_0x8766('0x55')]({'where':{'id':_0x1c1ec1['WhatsappAccountId']}});}})[_0x8766('0x1d')](handleEntityNotFound(_0x14b757,null))[_0x8766('0x1d')](function(_0x30ae6f){if(_0x30ae6f){logger['debug'](_0x8766('0x87'),'status',_0x8766('0x88'),_0x30ae6f[_0x8766('0x39')],util[_0x8766('0x89')](_0x358bb4[_0x8766('0x57')],{'showHidden':![],'depth':null}));switch(_0x30ae6f[_0x8766('0x39')]){case _0x8766('0x8a'):if(_0x358bb4[_0x8766('0x57')][_0x8766('0x8b')]&&_0x358bb4[_0x8766('0x57')][_0x8766('0x8b')]===_0x4dfff7[_0x8766('0x8c')]&&_0x358bb4[_0x8766('0x57')][_0x8766('0x8d')]&&_0x358bb4['body'][_0x8766('0x8d')]==='read'){return _0x4dfff7[_0x8766('0x58')]({'read':!![]});}else{logger[_0x8766('0x24')](_0x8766('0x8e'),_0x8766('0x27'),'twilio',util[_0x8766('0x89')](_0x358bb4[_0x8766('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4dfff7;}})['then'](respondWithResult(_0x14b757,null))[_0x8766('0x51')](handleError(_0x14b757,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4c0c8dd..fb61872 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 _0x0abf=['hook','events','WhatsappMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x5184d9,_0x307075){var _0x57ffd0=function(_0x17c431){while(--_0x17c431){_0x5184d9['push'](_0x5184d9['shift']());}};_0x57ffd0(++_0x307075);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xf0ab('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf0ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0ab('0x3')};function emitEvent(_0x4889fb){return function(_0x7ea4e0,_0x3be05e,_0x2efe43){WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb+':'+_0x7ea4e0['id'],_0x7ea4e0);WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb,_0x7ea4e0);_0x2efe43(null);};}for(var e in events){if(events[_0xf0ab('0x5')](e)){var event=events[e];WhatsappMessage[_0xf0ab('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x765e=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x518bc9,_0x418736){var _0x47ad85=function(_0x511b3d){while(--_0x511b3d){_0x518bc9['push'](_0x518bc9['shift']());}};_0x47ad85(++_0x418736);}(_0x765e,0x131));var _0xe765=function(_0x4e9e96,_0x27f741){_0x4e9e96=_0x4e9e96-0x0;var _0x2008d0=_0x765e[_0x4e9e96];return _0x2008d0;};'use strict';var EventEmitter=require(_0xe765('0x0'));var WhatsappMessage=require(_0xe765('0x1'))['db'][_0xe765('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xe765('0x3')](0x0);var events={'afterCreate':_0xe765('0x4'),'afterUpdate':_0xe765('0x5'),'afterDestroy':_0xe765('0x6')};function emitEvent(_0x38d6d2){return function(_0x30703f,_0xd2e232,_0x9559d4){WhatsappMessageEvents[_0xe765('0x7')](_0x38d6d2+':'+_0x30703f['id'],_0x30703f);WhatsappMessageEvents[_0xe765('0x7')](_0x38d6d2,_0x30703f);_0x9559d4(null);};}for(var e in events){if(events[_0xe765('0x8')](e)){var event=events[e];WhatsappMessage[_0xe765('0x9')](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 c4999d3..abab696 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 _0x9992=['util','moment','bluebird','request-promise','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','err','finally','lodash'];(function(_0x15717e,_0x2ad12b){var _0x5dd7a2=function(_0x43283d){while(--_0x43283d){_0x15717e['push'](_0x15717e['shift']());}};_0x5dd7a2(++_0x2ad12b);}(_0x9992,0x143));var _0x2999=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x9992[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x2999('0x0'));var util=require(_0x2999('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2999('0x2'));var BPromise=require(_0x2999('0x3'));var rp=require(_0x2999('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2999('0x5'));module[_0x2999('0x6')]=function(_0x4bc81f,_0x422015){return _0x4bc81f[_0x2999('0x7')]('WhatsappMessage',attributes,{'tableName':_0x2999('0x8'),'paranoid':![],'indexes':[{'name':_0x2999('0x9'),'fields':[_0x2999('0x9')]},{'name':_0x2999('0xa'),'fields':[_0x2999('0xb')],'type':_0x2999('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5879a1,_0x57ba92,_0xe1f01b){var _0x3d45d2=_0x4bc81f[_0x2999('0xd')];var _0x1f1536=_0x5879a1[_0x2999('0xe')]({'plain':!![]});if(_0x1f1536[_0x2999('0xf')][_0x2999('0x10')]()==='in'||_0x1f1536['direction']['toLowerCase']()===_0x2999('0x11')&&!_0x1f1536[_0x2999('0x12')]&&!_[_0x2999('0x13')](_0x1f1536[_0x2999('0x14')])){_0x3d45d2['WhatsappInteraction'][_0x2999('0x15')]({'where':{'id':_0x1f1536[_0x2999('0x16')]}})[_0x2999('0x17')](function(_0x4d992e){if(_0x4d992e){_0x4d992e[_0x2999('0x18')]({'lastMsgAt':_0x1f1536[_0x2999('0x19')],'lastMsgDirection':_0x1f1536['direction'][_0x2999('0x10')]()});}})[_0x2999('0x1a')](function(_0x4f9708){console[_0x2999('0x1b')](_0x4f9708);});}if(_0x1f1536[_0x2999('0xf')]==='out'&&!_0x1f1536[_0x2999('0x12')]){var _0x357064;_0x3d45d2[_0x2999('0x1c')]['find']({'where':{'id':_0x1f1536[_0x2999('0x1d')]},'raw':!![]})[_0x2999('0x17')](function(_0x5545ba){_0x357064=_0x5545ba;if(_0x357064&&_0x357064[_0x2999('0x1e')]){switch(_0x357064['type']){case _0x2999('0x1f'):var _0x3ce8d6=require('twilio');if(_0x357064[_0x2999('0x20')]&&_0x357064[_0x2999('0x21')]&&_0x357064[_0x2999('0x22')]){var _0x1a240a=new _0x3ce8d6(_0x357064[_0x2999('0x20')],_0x357064[_0x2999('0x21')]);_0x1a240a[_0x2999('0x23')]['create']({'body':_0x1f1536[_0x2999('0xb')],'to':_0x2999('0x24')+_0x1f1536[_0x2999('0x22')],'from':'whatsapp:'+_0x357064[_0x2999('0x22')],'statusCallback':_0x357064[_0x2999('0x25')]+'/api/whatsapp/messages/'+_0x1f1536['id']+_0x2999('0x26')+_0x357064[_0x2999('0x27')]})[_0x2999('0x17')](function(_0x35b28a){if(_0x35b28a[_0x2999('0x28')]){return _0x5879a1['update']({'messageId':_0x35b28a['sid']});}})[_0x2999('0x1a')](function(_0x34cfe8){logger[_0x2999('0x1b')](_0x2999('0x29'),_0x2999('0x2a'),_0x2999('0x1f'),util[_0x2999('0x2b')](_0x34cfe8,{'showHidden':![],'depth':null}));});}else{logger[_0x2999('0x1b')](_0x2999('0x29'),_0x2999('0x2a'),_0x2999('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2999('0x2c'):var _0x595e0b=_0x357064[_0x2999('0x20')];var _0x420c5f=_0x357064[_0x2999('0x21')];var _0xa8bf86=_0x357064[_0x2999('0x2d')]+_0x2999('0x2e')+_0x595e0b+_0x2999('0x2f');var _0x24024e={'to':[_0x1f1536['phone']],'message':{'type':_0x2999('0x30'),'text':_0x1f1536[_0x2999('0xb')]}};var _0x54fc12={'method':_0x2999('0x31'),'uri':_0xa8bf86,'headers':{'Authorization':'Bearer\x20'+_0x420c5f,'Content-Type':_0x2999('0x32')},'body':_0x24024e,'json':!![]};rp(_0x54fc12)[_0x2999('0x17')](function(_0x56640c){if(_0x56640c[_0x2999('0x33')][0x0]['message_id']){return _0x5879a1[_0x2999('0x18')]({'messageId':_0x56640c[_0x2999('0x33')][0x0]['message_id']});}})[_0x2999('0x1a')](function(_0x44e7dc){logger[_0x2999('0x34')]('WhatsappMessage,\x20%s',_0x44e7dc);});break;}}})[_0x2999('0x35')](function(){_0xe1f01b();});}else{_0xe1f01b();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6da3=['afterCreate','inspect','sinch','authToken','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','findOne','then','update','createdAt','catch','WhatsappAccount','find','type','twilio','accountSid','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2271e5,_0x6ea709){var _0x5a054e=function(_0x4d1cd0){while(--_0x4d1cd0){_0x2271e5['push'](_0x2271e5['shift']());}};_0x5a054e(++_0x6ea709);}(_0x6da3,0xf9));var _0x36da=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6da3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x36da('0x0'));var util=require(_0x36da('0x1'));var logger=require(_0x36da('0x2'))('api');var moment=require(_0x36da('0x3'));var BPromise=require(_0x36da('0x4'));var rp=require(_0x36da('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0x36da('0x6'));var config=require('../../config/environment');var attributes=require(_0x36da('0x7'));module[_0x36da('0x8')]=function(_0x3eb004,_0x5d078d){return _0x3eb004[_0x36da('0x9')](_0x36da('0xa'),attributes,{'tableName':_0x36da('0xb'),'paranoid':![],'indexes':[{'name':_0x36da('0xc'),'fields':[_0x36da('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x36da('0xd')],'type':_0x36da('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a9763,_0x1c5bd6,_0x3a96aa){var _0x274261=_0x3eb004[_0x36da('0xf')];var _0x13bd02=_0x1a9763[_0x36da('0x10')]({'plain':!![]});if(_0x13bd02[_0x36da('0x11')]['toLowerCase']()==='in'||_0x13bd02[_0x36da('0x11')][_0x36da('0x12')]()==='out'&&!_0x13bd02[_0x36da('0x13')]&&!_['isNil'](_0x13bd02[_0x36da('0x14')])){_0x274261['WhatsappInteraction'][_0x36da('0x15')]({'where':{'id':_0x13bd02['WhatsappInteractionId']}})[_0x36da('0x16')](function(_0x1b79c5){if(_0x1b79c5){_0x1b79c5[_0x36da('0x17')]({'lastMsgAt':_0x13bd02[_0x36da('0x18')],'lastMsgDirection':_0x13bd02[_0x36da('0x11')][_0x36da('0x12')]()});}})[_0x36da('0x19')](function(_0x4c43d6){console['error'](_0x4c43d6);});}if(_0x13bd02[_0x36da('0x11')]==='out'&&!_0x13bd02[_0x36da('0x13')]){var _0x57da8c;_0x274261[_0x36da('0x1a')][_0x36da('0x1b')]({'where':{'id':_0x13bd02['WhatsappAccountId']},'raw':!![]})[_0x36da('0x16')](function(_0x1975e6){_0x57da8c=_0x1975e6;if(_0x57da8c&&_0x57da8c[_0x36da('0x1c')]){switch(_0x57da8c['type']){case _0x36da('0x1d'):var _0x185fba=require(_0x36da('0x1d'));if(_0x57da8c[_0x36da('0x1e')]&&_0x57da8c['authToken']&&_0x57da8c[_0x36da('0x1f')]){var _0x15e980=new _0x185fba(_0x57da8c[_0x36da('0x1e')],_0x57da8c['authToken']);_0x15e980[_0x36da('0x20')][_0x36da('0x21')]({'body':_0x13bd02[_0x36da('0xd')],'to':_0x36da('0x22')+_0x13bd02[_0x36da('0x1f')],'from':_0x36da('0x22')+_0x57da8c[_0x36da('0x1f')],'statusCallback':_0x57da8c[_0x36da('0x23')]+_0x36da('0x24')+_0x13bd02['id']+'/status?token='+_0x57da8c[_0x36da('0x25')]})[_0x36da('0x16')](function(_0x59e47c){if(_0x59e47c['sid']){return _0x1a9763[_0x36da('0x17')]({'messageId':_0x59e47c[_0x36da('0x26')]});}})['catch'](function(_0x519d7d){logger[_0x36da('0x27')](_0x36da('0x28'),_0x36da('0x29'),'twilio',util[_0x36da('0x2a')](_0x519d7d,{'showHidden':![],'depth':null}));});}else{logger[_0x36da('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x36da('0x29'),_0x36da('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x36da('0x2b'):var _0x318399=_0x57da8c[_0x36da('0x1e')];var _0x28f45b=_0x57da8c[_0x36da('0x2c')];var _0x4a915c=_0x57da8c[_0x36da('0x2d')]+_0x36da('0x2e')+_0x318399+'/messages/';var _0x17f215={'to':[_0x13bd02[_0x36da('0x1f')]],'message':{'type':_0x36da('0x2f'),'text':_0x13bd02['body']}};var _0x4a4f40={'method':_0x36da('0x30'),'uri':_0x4a915c,'headers':{'Authorization':_0x36da('0x31')+_0x28f45b,'Content-Type':_0x36da('0x32')},'body':_0x17f215,'json':!![]};rp(_0x4a4f40)['then'](function(_0x3f69b3){if(_0x3f69b3[_0x36da('0x33')][0x0][_0x36da('0x34')]){return _0x1a9763[_0x36da('0x17')]({'messageId':_0x3f69b3[_0x36da('0x33')][0x0]['message_id']});}})[_0x36da('0x19')](function(_0x41fd52){logger[_0x36da('0x35')](_0x36da('0x36'),_0x41fd52);});break;}}})[_0x36da('0x37')](function(){_0x3a96aa();});}else{_0x3a96aa();}}},'charset':_0x36da('0x38'),'collate':_0x36da('0x39')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1034ad7..4d69735 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 _0xa6d5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','request\x20sent','catch','create','body','options','raw','CreateWhatsappMessage','stringify','util','moment','bluebird','randomstring'];(function(_0x529972,_0x2a1477){var _0x14da23=function(_0x276837){while(--_0x276837){_0x529972['push'](_0x529972['shift']());}};_0x14da23(++_0x2a1477);}(_0xa6d5,0x15c));var _0x5a6d=function(_0x3174bf,_0x3460e4){_0x3174bf=_0x3174bf-0x0;var _0xf18c31=_0xa6d5[_0x3174bf];return _0xf18c31;};'use strict';var _=require('lodash');var util=require(_0x5a6d('0x0'));var moment=require(_0x5a6d('0x1'));var BPromise=require(_0x5a6d('0x2'));var rs=require(_0x5a6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a6d('0x4'))['db'];var utils=require(_0x5a6d('0x5'));var logger=require(_0x5a6d('0x6'))('rpc');var config=require(_0x5a6d('0x7'));var jayson=require(_0x5a6d('0x8'));var client=jayson[_0x5a6d('0x9')]['http']({'port':0x232a});config[_0x5a6d('0xa')]=_[_0x5a6d('0xb')](config['redis'],{'host':_0x5a6d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5a6d('0xd'))[_0x5a6d('0xe')](socket);function respondWithRpcPromise(_0x26a8ea,_0x2b5752,_0x4fde34){return new BPromise(function(_0x176b2d,_0x1d8f07){return client[_0x5a6d('0xf')](_0x26a8ea,_0x4fde34)[_0x5a6d('0x10')](function(_0x2b9bff){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x2b5752,'request\x20sent');logger[_0x5a6d('0x11')](_0x5a6d('0x12'),_0x2b5752,'request\x20sent',JSON['stringify'](_0x2b9bff));if(_0x2b9bff[_0x5a6d('0x13')]){if(_0x2b9bff[_0x5a6d('0x13')][_0x5a6d('0x14')]===0x1f4){logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x2b9bff[_0x5a6d('0x13')]['message']);return _0x1d8f07(_0x2b9bff['error']['message']);}logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x2b9bff[_0x5a6d('0x13')]['message']);return _0x176b2d(_0x2b9bff[_0x5a6d('0x13')][_0x5a6d('0x16')]);}else{logger[_0x5a6d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x2b5752,_0x5a6d('0x18'));_0x176b2d(_0x2b9bff['result'][_0x5a6d('0x16')]);}})[_0x5a6d('0x19')](function(_0x52038e){logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x52038e);_0x1d8f07(_0x52038e);});});}exports['CreateWhatsappMessage']=function(_0x38607b){var _0x2040c2=this;return new Promise(function(_0x4a4bd2,_0x2ae31a){return db['WhatsappMessage'][_0x5a6d('0x1a')](_0x38607b[_0x5a6d('0x1b')],{'raw':_0x38607b['options']?_0x38607b[_0x5a6d('0x1c')][_0x5a6d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3e2ea1){logger['info'](_0x5a6d('0x1e'),_0x38607b);logger[_0x5a6d('0x11')](_0x5a6d('0x1e'),_0x38607b,JSON[_0x5a6d('0x1f')](_0x3e2ea1));_0x4a4bd2(_0x3e2ea1);})['catch'](function(_0x5a6163){logger[_0x5a6d('0x13')](_0x5a6d('0x1e'),_0x5a6163['message'],_0x38607b);_0x2ae31a(_0x2040c2['error'](0x1f4,_0x5a6163['message']));});});}; \ No newline at end of file +var _0x09d9=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0xae0c01,_0x449c99){var _0x913e86=function(_0x421e87){while(--_0x421e87){_0xae0c01['push'](_0xae0c01['shift']());}};_0x913e86(++_0x449c99);}(_0x09d9,0x144));var _0x909d=function(_0x5641e3,_0x1437ae){_0x5641e3=_0x5641e3-0x0;var _0x4065e8=_0x09d9[_0x5641e3];return _0x4065e8;};'use strict';var _=require(_0x909d('0x0'));var util=require(_0x909d('0x1'));var moment=require(_0x909d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x909d('0x3'));var db=require(_0x909d('0x4'))['db'];var utils=require(_0x909d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x909d('0x6'));var jayson=require(_0x909d('0x7'));var client=jayson[_0x909d('0x8')]['http']({'port':0x232a});config[_0x909d('0x9')]=_['defaults'](config[_0x909d('0x9')],{'host':_0x909d('0xa'),'port':0x18eb});var socket=require(_0x909d('0xb'))(new Redis(config['redis']));require(_0x909d('0xc'))[_0x909d('0xd')](socket);function respondWithRpcPromise(_0x389579,_0x189bdd,_0x49b4a9){return new BPromise(function(_0x367a77,_0x51404c){return client['request'](_0x389579,_0x49b4a9)[_0x909d('0xe')](function(_0x1471ef){logger[_0x909d('0xf')](_0x909d('0x10'),_0x189bdd,_0x909d('0x11'));logger[_0x909d('0x12')](_0x909d('0x13'),_0x189bdd,_0x909d('0x11'),JSON[_0x909d('0x14')](_0x1471ef));if(_0x1471ef[_0x909d('0x15')]){if(_0x1471ef[_0x909d('0x15')][_0x909d('0x16')]===0x1f4){logger[_0x909d('0x15')](_0x909d('0x10'),_0x189bdd,_0x1471ef[_0x909d('0x15')][_0x909d('0x17')]);return _0x51404c(_0x1471ef['error'][_0x909d('0x17')]);}logger[_0x909d('0x15')](_0x909d('0x10'),_0x189bdd,_0x1471ef[_0x909d('0x15')][_0x909d('0x17')]);return _0x367a77(_0x1471ef[_0x909d('0x15')][_0x909d('0x17')]);}else{logger[_0x909d('0xf')](_0x909d('0x10'),_0x189bdd,_0x909d('0x11'));_0x367a77(_0x1471ef[_0x909d('0x18')][_0x909d('0x17')]);}})[_0x909d('0x19')](function(_0x5d068c){logger[_0x909d('0x15')](_0x909d('0x10'),_0x189bdd,_0x5d068c);_0x51404c(_0x5d068c);});});}exports[_0x909d('0x1a')]=function(_0xd42eb8){var _0x3ba9ca=this;return new Promise(function(_0x5328cf,_0x2d9a72){return db[_0x909d('0x1b')][_0x909d('0x1c')](_0xd42eb8['body'],{'raw':_0xd42eb8[_0x909d('0x1d')]?_0xd42eb8[_0x909d('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x909d('0xe')](function(_0x121194){logger[_0x909d('0xf')](_0x909d('0x1a'),_0xd42eb8);logger['debug'](_0x909d('0x1a'),_0xd42eb8,JSON[_0x909d('0x14')](_0x121194));_0x5328cf(_0x121194);})[_0x909d('0x19')](function(_0x1a58cc){logger[_0x909d('0x15')](_0x909d('0x1a'),_0x1a58cc['message'],_0xd42eb8);_0x2d9a72(_0x3ba9ca[_0x909d('0x15')](0x1f4,_0x1a58cc['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 3a5be55..a57bc0a 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 _0x1c5a=['whatsappMessage:','./whatsappMessage.events','remove','emit','removeListener','register','length'];(function(_0x543f8b,_0xcd2fba){var _0x62f0a9=function(_0x2b06a5){while(--_0x2b06a5){_0x543f8b['push'](_0x543f8b['shift']());}};_0x62f0a9(++_0xcd2fba);}(_0x1c5a,0x135));var _0xa1c5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1c5a[_0x3bf83f];return _0x22c4a9;};'use strict';var WhatsappMessageEvents=require(_0xa1c5('0x0'));var events=['save',_0xa1c5('0x1'),'update'];function createListener(_0x3c0715,_0x3391a7){return function(_0x596698){_0x3391a7[_0xa1c5('0x2')](_0x3c0715,_0x596698);};}function removeListener(_0x5c8190,_0x4ce767){return function(){WhatsappMessageEvents[_0xa1c5('0x3')](_0x5c8190,_0x4ce767);};}exports[_0xa1c5('0x4')]=function(_0x2f0721){for(var _0x7e2516=0x0,_0x49fd0a=events[_0xa1c5('0x5')];_0x7e2516<_0x49fd0a;_0x7e2516++){var _0x3224f4=events[_0x7e2516];var _0x52ca78=createListener(_0xa1c5('0x6')+_0x3224f4,_0x2f0721);WhatsappMessageEvents['on'](_0x3224f4,_0x52ca78);}}; \ No newline at end of file +var _0xf9cd=['removeListener','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x431948,_0x472eed){var _0x5541aa=function(_0x27504f){while(--_0x27504f){_0x431948['push'](_0x431948['shift']());}};_0x5541aa(++_0x472eed);}(_0xf9cd,0x19d));var _0xdf9c=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xf9cd[_0x4c440b];return _0x2d48cf;};'use strict';var WhatsappMessageEvents=require(_0xdf9c('0x0'));var events=['save',_0xdf9c('0x1'),'update'];function createListener(_0x55ec71,_0x459cf9){return function(_0xc008d){_0x459cf9['emit'](_0x55ec71,_0xc008d);};}function removeListener(_0x373ae8,_0x4477b4){return function(){WhatsappMessageEvents[_0xdf9c('0x2')](_0x373ae8,_0x4477b4);};}exports['register']=function(_0x5ed8da){for(var _0x49f731=0x0,_0x347bc3=events[_0xdf9c('0x3')];_0x49f731<_0x347bc3;_0x49f731++){var _0x38a7f6=events[_0x49f731];var _0x22d348=createListener(_0xdf9c('0x4')+_0x38a7f6,_0x5ed8da);WhatsappMessageEvents['on'](_0x38a7f6,_0x22d348);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d059d58..45ab669 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 _0xe76f=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer'];(function(_0x4089bf,_0x49de28){var _0x12f3ba=function(_0x48f32b){while(--_0x48f32b){_0x4089bf['push'](_0x4089bf['shift']());}};_0x12f3ba(++_0x49de28);}(_0xe76f,0x1df));var _0xfe76=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe76f[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xfe76('0x0'));var util=require(_0xfe76('0x1'));var path=require('path');var timeout=require(_0xfe76('0x2'));var express=require(_0xfe76('0x3'));var router=express[_0xfe76('0x4')]();var fs_extra=require(_0xfe76('0x5'));var auth=require(_0xfe76('0x6'));var interaction=require(_0xfe76('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0xfe76('0x8')](),controller[_0xfe76('0x9')]);router[_0xfe76('0xa')](_0xfe76('0xb'),auth[_0xfe76('0x8')](),controller[_0xfe76('0xc')]);router[_0xfe76('0xa')](_0xfe76('0xd'),auth[_0xfe76('0x8')](),controller[_0xfe76('0xe')]);router[_0xfe76('0xa')](_0xfe76('0xf'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x10')]);router[_0xfe76('0xa')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x12')]);router[_0xfe76('0xa')](_0xfe76('0x13'),auth[_0xfe76('0x8')](),controller['getAgents']);router['post']('/',auth[_0xfe76('0x8')](),controller[_0xfe76('0x14')]);router[_0xfe76('0x15')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x16')]);router[_0xfe76('0x15')](_0xfe76('0x13'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x17')]);router[_0xfe76('0x18')](_0xfe76('0xd'),auth['isAuthenticated'](),controller[_0xfe76('0x19')]);router['delete'](_0xfe76('0xd'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x1a')]);router[_0xfe76('0x1b')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x1c')]);router[_0xfe76('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xfe76('0x1d')]=router; \ No newline at end of file +var _0x5507=['/:id/members','/:id/teams','getTeams','/:id/users','create','post','addTeams','put','delete','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x5507,0xae));var _0x7550=function(_0xfec237,_0x40a262){_0xfec237=_0xfec237-0x0;var _0x2e8f1b=_0x5507[_0xfec237];return _0x2e8f1b;};'use strict';var multer=require('multer');var util=require(_0x7550('0x0'));var path=require(_0x7550('0x1'));var timeout=require('connect-timeout');var express=require(_0x7550('0x2'));var router=express[_0x7550('0x3')]();var fs_extra=require(_0x7550('0x4'));var auth=require(_0x7550('0x5'));var interaction=require(_0x7550('0x6'));var config=require(_0x7550('0x7'));var controller=require(_0x7550('0x8'));router[_0x7550('0x9')]('/',auth['isAuthenticated'](),controller[_0x7550('0xa')]);router[_0x7550('0x9')](_0x7550('0xb'),auth[_0x7550('0xc')](),controller['describe']);router['get'](_0x7550('0xd'),auth[_0x7550('0xc')](),controller[_0x7550('0xe')]);router['get'](_0x7550('0xf'),auth[_0x7550('0xc')](),controller['getMembers']);router[_0x7550('0x9')](_0x7550('0x10'),auth[_0x7550('0xc')](),controller[_0x7550('0x11')]);router['get'](_0x7550('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x7550('0xc')](),controller[_0x7550('0x13')]);router[_0x7550('0x14')](_0x7550('0x10'),auth[_0x7550('0xc')](),controller[_0x7550('0x15')]);router[_0x7550('0x14')](_0x7550('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7550('0x16')](_0x7550('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7550('0x17')]('/:id',auth[_0x7550('0xc')](),controller[_0x7550('0x18')]);router[_0x7550('0x17')](_0x7550('0x10'),auth[_0x7550('0xc')](),controller['removeTeams']);router[_0x7550('0x17')]('/:id/users',auth[_0x7550('0xc')](),controller[_0x7550('0x19')]);module[_0x7550('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 89a2924..eea755b 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 _0x7868=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0x7868,0x1c0));var _0x8786=function(_0xd98f9d,_0x10cb93){_0xd98f9d=_0xd98f9d-0x0;var _0x41440d=_0x7868[_0xd98f9d];return _0x41440d;};'use strict';var Sequelize=require(_0x8786('0x0'));module['exports']={'name':{'type':Sequelize[_0x8786('0x1')],'unique':_0x8786('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8786('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8786('0x4')](_0x8786('0x5'),'beepall',_0x8786('0x6'))},'description':{'type':Sequelize[_0x8786('0x1')]}}; \ No newline at end of file +var _0x6b19=['STRING','sequelize','exports','name','rrmemory','beepall','roundrobin'];(function(_0x57c5fc,_0x36eace){var _0x2a5d8a=function(_0x5beb7c){while(--_0x5beb7c){_0x57c5fc['push'](_0x57c5fc['shift']());}};_0x2a5d8a(++_0x36eace);}(_0x6b19,0xe8));var _0x96b1=function(_0x480d6e,_0x45d6d3){_0x480d6e=_0x480d6e-0x0;var _0x510431=_0x6b19[_0x480d6e];return _0x510431;};'use strict';var Sequelize=require(_0x96b1('0x0'));module[_0x96b1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x96b1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x96b1('0x3'),_0x96b1('0x4'),_0x96b1('0x5'))},'description':{'type':Sequelize[_0x96b1('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 05b5def..d3f7d79 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 _0x1ab3=['UserWhatsappQueue','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','save','then','get','UserProfileResource','destroy','error','name','send','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','rawAttributes','nolimit','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','SIP','createdAt','findOne','getTeams','addTeams','Team','User','Agents','online','voicePause','sequelize','transaction','each'];(function(_0x5be290,_0x583450){var _0x542d5a=function(_0x2c14ef){while(--_0x2c14ef){_0x5be290['push'](_0x5be290['shift']());}};_0x542d5a(++_0x583450);}(_0x1ab3,0xad));var _0x31ab=function(_0x27b6a5,_0x1b148d){_0x27b6a5=_0x27b6a5-0x0;var _0x25d174=_0x1ab3[_0x27b6a5];return _0x25d174;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31ab('0x0'));var zipdir=require(_0x31ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x31ab('0x2'));var util=require(_0x31ab('0x3'));var path=require(_0x31ab('0x4'));var sox=require('sox');var csv=require(_0x31ab('0x5'));var ejs=require(_0x31ab('0x6'));var fs=require('fs');var fs_extra=require(_0x31ab('0x7'));var _=require(_0x31ab('0x8'));var squel=require(_0x31ab('0x9'));var crypto=require(_0x31ab('0xa'));var jsforce=require(_0x31ab('0xb'));var deskjs=require(_0x31ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x31ab('0xd'));var Papa=require(_0x31ab('0xe'));var Redis=require(_0x31ab('0xf'));var authService=require(_0x31ab('0x10'));var qs=require(_0x31ab('0x11'));var as=require(_0x31ab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x31ab('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x31ab('0x14'));var db=require(_0x31ab('0x15'))['db'];config[_0x31ab('0x16')]=_[_0x31ab('0x17')](config[_0x31ab('0x16')],{'host':_0x31ab('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31ab('0x16')]));require(_0x31ab('0x19'))['register'](socket);function respondWithStatusCode(_0x142b3a,_0x1b8dc3){_0x1b8dc3=_0x1b8dc3||0xcc;return function(_0x374391){if(_0x374391){return _0x142b3a[_0x31ab('0x1a')](_0x1b8dc3);}return _0x142b3a['status'](_0x1b8dc3)[_0x31ab('0x1b')]();};}function respondWithResult(_0x460896,_0x45de43){_0x45de43=_0x45de43||0xc8;return function(_0xec54bd){if(_0xec54bd){return _0x460896[_0x31ab('0x1c')](_0x45de43)[_0x31ab('0x1d')](_0xec54bd);}};}function respondWithFilteredResult(_0x4801b3,_0x3a436d){return function(_0x8260a6){if(_0x8260a6){var _0x4e8adc=typeof _0x3a436d['offset']==='undefined'&&typeof _0x3a436d[_0x31ab('0x1e')]===_0x31ab('0x1f');var _0x452e68=_0x8260a6['count'];var _0x4623fb=_0x4e8adc?0x0:_0x3a436d['offset'];var _0xbf401f=_0x4e8adc?_0x8260a6[_0x31ab('0x20')]:_0x3a436d[_0x31ab('0x21')]+_0x3a436d[_0x31ab('0x1e')];var _0x5e0069;if(_0xbf401f>=_0x452e68){_0xbf401f=_0x452e68;_0x5e0069=0xc8;}else{_0x5e0069=0xce;}_0x4801b3[_0x31ab('0x1c')](_0x5e0069);return _0x4801b3['set'](_0x31ab('0x22'),_0x4623fb+'-'+_0xbf401f+'/'+_0x452e68)['json'](_0x8260a6);}return null;};}function patchUpdates(_0x384291){return function(_0x51f175){try{jsonpatch[_0x31ab('0x23')](_0x51f175,_0x384291,!![]);}catch(_0x3495ed){return BPromise['reject'](_0x3495ed);}return _0x51f175[_0x31ab('0x24')]();};}function saveUpdates(_0x2078e4,_0x513a07){return function(_0x4af7dd){if(_0x4af7dd){return _0x4af7dd['update'](_0x2078e4)[_0x31ab('0x25')](function(_0x3ca4b3){return _0x3ca4b3;});}return null;};}function removeEntity(_0x417ec0,_0x3b5ba9){return function(_0x1f72d2){if(_0x1f72d2){return _0x1f72d2['destroy']()[_0x31ab('0x25')](function(){var _0x245e08=_0x1f72d2[_0x31ab('0x26')]({'plain':!![]});var _0x306e76='WhatsappQueues';return db[_0x31ab('0x27')][_0x31ab('0x28')]({'where':{'type':_0x306e76,'resourceId':_0x245e08['id']}})[_0x31ab('0x25')](function(){return _0x1f72d2;});})[_0x31ab('0x25')](function(){_0x417ec0[_0x31ab('0x1c')](0xcc)[_0x31ab('0x1b')]();});}};}function handleEntityNotFound(_0xd54628,_0x10907d){return function(_0x3802db){if(!_0x3802db){_0xd54628['sendStatus'](0x194);}return _0x3802db;};}function handleError(_0x1f5f5f,_0x1cd9ab){_0x1cd9ab=_0x1cd9ab||0x1f4;return function(_0x29bbe9){logger[_0x31ab('0x29')](_0x29bbe9['stack']);if(_0x29bbe9[_0x31ab('0x2a')]){delete _0x29bbe9[_0x31ab('0x2a')];}_0x1f5f5f[_0x31ab('0x1c')](_0x1cd9ab)[_0x31ab('0x2b')](_0x29bbe9);};}exports['index']=function(_0x180d3f,_0x5a4448){var _0x2d81f7={},_0x49a842={},_0x5d3af5={'count':0x0,'rows':[]};var _0x185892=_[_0x31ab('0x2c')](db[_0x31ab('0x2d')]['rawAttributes'],function(_0x562b79){return{'name':_0x562b79[_0x31ab('0x2e')],'type':_0x562b79[_0x31ab('0x2f')][_0x31ab('0x30')]};});_0x49a842[_0x31ab('0x31')]=_[_0x31ab('0x2c')](_0x185892,_0x31ab('0x2a'));_0x49a842[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x180d3f[_0x31ab('0x32')]);_0x49a842[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x49a842[_0x31ab('0x31')],_0x49a842[_0x31ab('0x32')]);_0x2d81f7[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x49a842[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x37')]));_0x2d81f7['attributes']=_0x2d81f7[_0x31ab('0x36')]['length']?_0x2d81f7[_0x31ab('0x36')]:_0x49a842[_0x31ab('0x31')];if(!_0x180d3f[_0x31ab('0x32')][_0x31ab('0x38')]('nolimit')){_0x2d81f7[_0x31ab('0x1e')]=qs[_0x31ab('0x1e')](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x2d81f7['offset']=qs[_0x31ab('0x21')](_0x180d3f['query'][_0x31ab('0x21')]);}_0x2d81f7[_0x31ab('0x39')]=qs['sort'](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3a')]);_0x2d81f7['where']=qs[_0x31ab('0x34')](_[_0x31ab('0x3b')](_0x180d3f[_0x31ab('0x32')],_0x49a842[_0x31ab('0x34')]),_0x185892);if(_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3c')]){_0x2d81f7[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x2d81f7[_0x31ab('0x3d')],{'$or':_['map'](_0x185892,function(_0x22f5aa){if(_0x22f5aa[_0x31ab('0x2f')]!==_0x31ab('0x3f')){var _0x348fff={};_0x348fff[_0x22f5aa['name']]={'$like':'%'+_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x348fff;}})});}_0x2d81f7=_[_0x31ab('0x3e')]({},_0x2d81f7,_0x180d3f[_0x31ab('0x40')]);var _0x4eff25={'where':_0x2d81f7[_0x31ab('0x3d')]};return db[_0x31ab('0x2d')]['count'](_0x4eff25)['then'](function(_0x2dfafe){_0x5d3af5[_0x31ab('0x20')]=_0x2dfafe;if(_0x180d3f[_0x31ab('0x32')][_0x31ab('0x41')]){_0x2d81f7['include']=[{'all':!![]}];}return db[_0x31ab('0x2d')][_0x31ab('0x42')](_0x2d81f7);})[_0x31ab('0x25')](function(_0x4dcd1){_0x5d3af5[_0x31ab('0x43')]=_0x4dcd1;return _0x5d3af5;})['then'](respondWithFilteredResult(_0x5a4448,_0x2d81f7))[_0x31ab('0x44')](handleError(_0x5a4448,null));};exports[_0x31ab('0x45')]=function(_0x316a9e,_0x5ef2d4){var _0x408930={'raw':!![],'where':{'id':_0x316a9e[_0x31ab('0x46')]['id']}},_0x3c592e={};_0x3c592e[_0x31ab('0x31')]=_[_0x31ab('0x33')](db[_0x31ab('0x2d')]['rawAttributes']);_0x3c592e[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x316a9e[_0x31ab('0x32')]);_0x3c592e[_0x31ab('0x34')]=_['intersection'](_0x3c592e[_0x31ab('0x31')],_0x3c592e[_0x31ab('0x32')]);_0x408930[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x3c592e[_0x31ab('0x31')],qs['fields'](_0x316a9e[_0x31ab('0x32')][_0x31ab('0x37')]));_0x408930[_0x31ab('0x36')]=_0x408930['attributes'][_0x31ab('0x47')]?_0x408930[_0x31ab('0x36')]:_0x3c592e[_0x31ab('0x31')];if(_0x316a9e[_0x31ab('0x32')]['includeAll']){_0x408930[_0x31ab('0x48')]=[{'all':!![]}];}_0x408930=_[_0x31ab('0x3e')]({},_0x408930,_0x316a9e[_0x31ab('0x40')]);return db[_0x31ab('0x2d')][_0x31ab('0x49')](_0x408930)[_0x31ab('0x25')](handleEntityNotFound(_0x5ef2d4,null))['then'](respondWithResult(_0x5ef2d4,null))['catch'](handleError(_0x5ef2d4,null));};exports[_0x31ab('0x4a')]=function(_0x20a516,_0x5ccec5){return db['WhatsappQueue'][_0x31ab('0x4a')](_0x20a516[_0x31ab('0x4b')],{})[_0x31ab('0x25')](function(_0x51e7e2){var _0x48e7cd=_0x20a516[_0x31ab('0x4c')][_0x31ab('0x26')]({'plain':!![]});if(!_0x48e7cd)throw new Error(_0x31ab('0x4d'));if(_0x48e7cd[_0x31ab('0x4e')]===_0x31ab('0x4c')){var _0xbe94fd=_0x51e7e2[_0x31ab('0x26')]({'plain':!![]});var _0x2e29e8=_0x31ab('0x4f');return db[_0x31ab('0x50')][_0x31ab('0x49')]({'where':{'name':_0x2e29e8,'userProfileId':_0x48e7cd['userProfileId']},'raw':!![]})[_0x31ab('0x25')](function(_0x4e39a4){if(_0x4e39a4&&_0x4e39a4[_0x31ab('0x51')]===0x0){return db[_0x31ab('0x27')][_0x31ab('0x4a')]({'name':_0xbe94fd[_0x31ab('0x2a')],'resourceId':_0xbe94fd['id'],'type':_0x4e39a4['name'],'sectionId':_0x4e39a4['id']},{})[_0x31ab('0x25')](function(){return _0x51e7e2;});}else{return _0x51e7e2;}})[_0x31ab('0x44')](function(_0x447caa){logger['error'](_0x31ab('0x52'),_0x447caa);throw _0x447caa;});}return _0x51e7e2;})[_0x31ab('0x25')](respondWithResult(_0x5ccec5,0xc9))['catch'](handleError(_0x5ccec5,null));};exports[_0x31ab('0x53')]=function(_0xf572aa,_0x1846cf){if(_0xf572aa[_0x31ab('0x4b')]['id']){delete _0xf572aa[_0x31ab('0x4b')]['id'];}return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0xf572aa[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x1846cf,null))[_0x31ab('0x25')](saveUpdates(_0xf572aa[_0x31ab('0x4b')],null))['then'](respondWithResult(_0x1846cf,null))['catch'](handleError(_0x1846cf,null));};exports['destroy']=function(_0x2ed35a,_0x4fd44b){return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x2ed35a[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x4fd44b,null))[_0x31ab('0x25')](removeEntity(_0x4fd44b,null))[_0x31ab('0x44')](handleError(_0x4fd44b,null));};exports[_0x31ab('0x54')]=function(_0x5d2a44,_0x507cee){return db[_0x31ab('0x2d')][_0x31ab('0x54')]()[_0x31ab('0x25')](respondWithResult(_0x507cee,null))[_0x31ab('0x44')](handleError(_0x507cee,null));};exports[_0x31ab('0x55')]=function(_0x47968d,_0x5ef177,_0x20f8e4){var _0x5b225d={'raw':!![],'where':{}},_0x272a84={},_0x5335b1;return db['WhatsappQueue']['findOne']({'where':{'id':_0x47968d[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x5ef177,null))[_0x31ab('0x25')](function(_0x362150){if(_0x362150){_0x5335b1=_0x362150['get']({'plain':!![]});_0x272a84[_0x31ab('0x31')]=_[_0x31ab('0x33')](db['UserWhatsappQueue'][_0x31ab('0x56')]);_0x272a84['query']=_[_0x31ab('0x33')](_0x47968d['query']);_0x272a84[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x272a84[_0x31ab('0x31')],_0x272a84[_0x31ab('0x32')]);_0x5b225d[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x272a84[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x47968d[_0x31ab('0x32')][_0x31ab('0x37')]));_0x5b225d[_0x31ab('0x36')]=_0x5b225d[_0x31ab('0x36')][_0x31ab('0x47')]?_0x5b225d[_0x31ab('0x36')]:_0x272a84[_0x31ab('0x31')];if(!_0x47968d[_0x31ab('0x32')][_0x31ab('0x38')](_0x31ab('0x57'))){_0x5b225d[_0x31ab('0x1e')]=qs[_0x31ab('0x1e')](_0x47968d[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x5b225d['offset']=qs['offset'](_0x47968d[_0x31ab('0x32')][_0x31ab('0x21')]);}_0x5b225d[_0x31ab('0x39')]=qs['sort'](_0x47968d[_0x31ab('0x32')][_0x31ab('0x3a')]);_0x5b225d['where']=qs[_0x31ab('0x34')](_[_0x31ab('0x3b')](_0x47968d['query'],_0x272a84['filters']));_0x5b225d['where'][_0x31ab('0x58')]=_0x362150['id'];if(_0x47968d[_0x31ab('0x32')]['filter']){_0x5b225d[_0x31ab('0x3d')]=_['merge'](_0x5b225d[_0x31ab('0x3d')],{'$or':_['map'](_0x5b225d[_0x31ab('0x36')],function(_0x2184f6){var _0x54247c={};_0x54247c[_0x2184f6]={'$like':'%'+_0x47968d[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x54247c;})});}_0x5b225d=_['merge']({},_0x5b225d,_0x47968d[_0x31ab('0x40')]);return db['UserWhatsappQueue'][_0x31ab('0x42')](_0x5b225d);}})[_0x31ab('0x25')](function(_0x43522d){if(_0x43522d){return db['User'][_0x31ab('0x59')]({'where':{'id':_['map'](_0x43522d,_0x31ab('0x5a')),'role':_0x31ab('0x5b')},'attributes':['id',_0x31ab('0x2a'),_0x31ab('0x5c'),_0x31ab('0x5d'),'createdAt']});}})[_0x31ab('0x25')](function(_0x5afd38){if(_0x5afd38){return{'count':_0x5afd38['count'],'rows':_[_0x31ab('0x2c')](_0x5afd38[_0x31ab('0x43')],function(_0x310f52){return{'membername':_0x310f52['name'],'UserId':_0x310f52['id'],'queue_name':_0x5335b1[_0x31ab('0x2a')],'WhatsappQueueId':_0x5335b1['id'],'interface':util['format']('%s/%s',_0x31ab('0x5e'),_0x310f52[_0x31ab('0x2a')]),'penalty':0x0,'paused':_0x310f52['whatsappPause'],'createdAt':_0x310f52[_0x31ab('0x5f')],'updatedAt':_0x310f52[_0x31ab('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31ab('0x25')](respondWithFilteredResult(_0x5ef177,_0x5b225d))[_0x31ab('0x44')](handleError(_0x5ef177,null));};exports['getTeams']=function(_0x3f1f92,_0x3fd654,_0x335bbc){var _0x163b61={};var _0x5c0a81={};var _0xb8c67c;var _0x44bf93;return db[_0x31ab('0x2d')][_0x31ab('0x60')]({'where':{'id':_0x3f1f92[_0x31ab('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd654,null))['then'](function(_0x5f58aa){if(_0x5f58aa){_0xb8c67c=_0x5f58aa;_0x5c0a81[_0x31ab('0x31')]=_['keys'](db['Team'][_0x31ab('0x56')]);_0x5c0a81[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x3f1f92[_0x31ab('0x32')]);_0x5c0a81[_0x31ab('0x34')]=_['intersection'](_0x5c0a81['model'],_0x5c0a81['query']);_0x163b61['attributes']=_[_0x31ab('0x35')](_0x5c0a81[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x37')]));_0x163b61[_0x31ab('0x36')]=_0x163b61[_0x31ab('0x36')][_0x31ab('0x47')]?_0x163b61[_0x31ab('0x36')]:_0x5c0a81['model'];_0x163b61[_0x31ab('0x39')]=qs[_0x31ab('0x3a')](_0x3f1f92['query'][_0x31ab('0x3a')]);_0x163b61[_0x31ab('0x3d')]=qs[_0x31ab('0x34')](_['pick'](_0x3f1f92[_0x31ab('0x32')],_0x5c0a81[_0x31ab('0x34')]));if(_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x3c')]){_0x163b61[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x163b61['where'],{'$or':_[_0x31ab('0x2c')](_0x163b61[_0x31ab('0x36')],function(_0x4f25c7){var _0x4a6dba={};_0x4a6dba[_0x4f25c7]={'$like':'%'+_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x4a6dba;})});}_0x163b61=_[_0x31ab('0x3e')]({},_0x163b61,_0x3f1f92['options']);return _0xb8c67c[_0x31ab('0x61')](_0x163b61);}})['then'](function(_0x199385){if(_0x199385){_0x44bf93=_0x199385[_0x31ab('0x47')];if(!_0x3f1f92['query']['hasOwnProperty'](_0x31ab('0x57'))){_0x163b61['limit']=qs[_0x31ab('0x1e')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x163b61[_0x31ab('0x21')]=qs[_0x31ab('0x21')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x21')]);}return _0xb8c67c['getTeams'](_0x163b61);}})[_0x31ab('0x25')](function(_0x4b70d1){if(_0x4b70d1){return _0x4b70d1?{'count':_0x44bf93,'rows':_0x4b70d1}:null;}})[_0x31ab('0x25')](respondWithResult(_0x3fd654,null))[_0x31ab('0x44')](handleError(_0x3fd654,null));};exports[_0x31ab('0x62')]=function(_0x531ea9,_0x3b1aae,_0x1bcad2){var _0x55a4bf=_0x531ea9[_0x31ab('0x4b')]['ids'];return db[_0x31ab('0x63')][_0x31ab('0x42')]({'where':{'id':_0x55a4bf},'attributes':['id'],'include':[{'model':db[_0x31ab('0x64')],'as':_0x31ab('0x65'),'attributes':['id',_0x31ab('0x2a'),_0x31ab('0x66'),_0x31ab('0x67'),'interface'],'raw':!![]}]})[_0x31ab('0x25')](function(_0x11ad5c){if(_0x11ad5c){var _0x3eb90c=_['flatMap'](_0x11ad5c,function(_0x5711c0){var _0x4f29a7=_0x5711c0[_0x31ab('0x26')]({'plain':!![]});return _0x4f29a7[_0x31ab('0x65')];});return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x531ea9[_0x31ab('0x46')]['id']}})['then'](function(_0x51bdfb){return db[_0x31ab('0x68')][_0x31ab('0x69')](function(_0x1ee7ca){return _0x51bdfb[_0x31ab('0x62')](_0x55a4bf,{'transaction':_0x1ee7ca})['then'](function(){return BPromise[_0x31ab('0x6a')](_0x3eb90c,function(_0x2de647){return db[_0x31ab('0x6b')][_0x31ab('0x6c')]({'where':{'UserId':_0x2de647['id'],'WhatsappQueueId':_0x531ea9[_0x31ab('0x46')]['id']},'transaction':_0x1ee7ca});});})['then'](function(){_0x3eb90c['forEach'](function(_0x2096c7){socket[_0x31ab('0x6d')](_0x31ab('0x6e'),{'UserId':_0x2096c7['id'],'WhatsappQueueId':_0x51bdfb['id']});});});});});}})[_0x31ab('0x25')](respondWithStatusCode(_0x3b1aae,null))[_0x31ab('0x44')](handleError(_0x3b1aae,null));};exports[_0x31ab('0x6f')]=function(_0x1613c5,_0x452baa,_0x20ad91){return db[_0x31ab('0x63')][_0x31ab('0x42')]({'where':{'id':_0x1613c5['query'][_0x31ab('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x452baa,null))['then'](function(_0x18ddbe){var _0x458ac7=_[_0x31ab('0x2c')](_0x18ddbe,'id');var _0x5911fa=[];var _0xfa0468=[];var _0x1bdd11=squel[_0x31ab('0x71')]();_0x1bdd11[_0x31ab('0x72')](_0x31ab('0x73'))[_0x31ab('0x74')](_0x31ab('0x75'),'tq')['join']('user_has_teams','ut',_0x31ab('0x76'))[_0x31ab('0x3d')](_0x31ab('0x77'),_0x1613c5[_0x31ab('0x46')]['id']);for(var _0x53b742=0x0;_0x53b742<_0x18ddbe[_0x31ab('0x47')];_0x53b742+=0x1){let _0x803446=_0x18ddbe[_0x53b742];for(var _0x356e44=0x0;_0x356e44<_0x803446['Agents'][_0x31ab('0x47')];_0x356e44+=0x1){let _0x18a9af=_0x803446['Agents'][_0x356e44];var _0x47ece2=_0x1bdd11[_0x31ab('0x78')]();_0x47ece2[_0x31ab('0x3d')]('ut.UserId\x20=\x20?',_0x18a9af['id']);_0xfa0468[_0x31ab('0x79')](db[_0x31ab('0x68')][_0x31ab('0x32')](_0x47ece2['toString'](),{'type':db[_0x31ab('0x68')][_0x31ab('0x7a')][_0x31ab('0x7b')]})['then'](function(_0x281581){if(_0x281581['length']===0x1){return _0x18a9af['id'];}else{var _0xcff296=_[_0x31ab('0x7c')](_[_0x31ab('0x2c')](_0x281581,_0x31ab('0x7d')),function(_0x17682c){return _[_0x31ab('0x7e')](_0x458ac7,_0x17682c);});if(_0xcff296){return _0x18a9af['id'];}}}));}}return BPromise[_0x31ab('0x7f')](_0xfa0468)[_0x31ab('0x25')](function(_0x4e9341){_0x5911fa=_(_0x5911fa)[_0x31ab('0x80')](_0x4e9341)[_0x31ab('0x81')]()[_0x31ab('0x82')]();return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x1613c5['params']['id']}})['then'](function(_0x4898d7){return db[_0x31ab('0x68')][_0x31ab('0x69')](function(_0x2c4bf6){return _0x4898d7[_0x31ab('0x6f')](_0x1613c5[_0x31ab('0x32')][_0x31ab('0x70')],{'transaction':_0x2c4bf6})[_0x31ab('0x25')](function(){if(!_[_0x31ab('0x83')](_0x5911fa)){return _0x4898d7['removeAgents'](_0x5911fa,{'transaction':_0x2c4bf6});}})[_0x31ab('0x25')](function(){_0x5911fa[_0x31ab('0x84')](function(_0xce6dd){socket[_0x31ab('0x6d')](_0x31ab('0x85'),{'UserId':_0xce6dd,'WhatsappQueueId':_0x4898d7['id']});});});});});});})[_0x31ab('0x25')](respondWithStatusCode(_0x452baa,null))[_0x31ab('0x44')](handleError(_0x452baa,null));};exports[_0x31ab('0x86')]=function(_0x1d1672,_0x308f52,_0x4c14b8){return db[_0x31ab('0x2d')]['find']({'where':{'id':_0x1d1672[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x308f52,null))[_0x31ab('0x25')](function(_0xf83185){if(_0xf83185){return _0xf83185[_0x31ab('0x86')](_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')],_[_0x31ab('0x87')](_0x1d1672['body'],[_0x31ab('0x70'),'id'])||{})[_0x31ab('0x88')](function(_0x343aba){for(var _0x347485=0x0;_0x347485<_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')][_0x31ab('0x47')];_0x347485+=0x1){socket[_0x31ab('0x6d')](_0x31ab('0x6e'),{'UserId':Number(_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')][_0x347485]),'WhatsappQueueId':Number(_0x1d1672[_0x31ab('0x46')]['id'])});}return _0x343aba;});}})['then'](respondWithResult(_0x308f52,null))[_0x31ab('0x44')](handleError(_0x308f52,null));};exports['removeAgents']=function(_0x40b601,_0x127360,_0x320875){return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x40b601[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x127360,null))['then'](function(_0x2f06e0){if(_0x2f06e0){return _0x2f06e0[_0x31ab('0x89')](_0x40b601[_0x31ab('0x32')][_0x31ab('0x70')])[_0x31ab('0x25')](function(){if(_[_0x31ab('0x8a')](_0x40b601[_0x31ab('0x32')][_0x31ab('0x70')])){for(var _0x16ca20=0x0;_0x16ca20<_0x40b601['query']['ids'][_0x31ab('0x47')];_0x16ca20+=0x1){socket[_0x31ab('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x40b601['query'][_0x31ab('0x70')][_0x16ca20]),'WhatsappQueueId':Number(_0x40b601[_0x31ab('0x46')]['id'])});}}else{socket[_0x31ab('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x40b601[_0x31ab('0x32')]['ids']),'WhatsappQueueId':Number(_0x40b601[_0x31ab('0x46')]['id'])});}});}})[_0x31ab('0x25')](respondWithStatusCode(_0x127360,null))['catch'](handleError(_0x127360,null));};exports['getAgents']=function(_0x1ec80a,_0x36cd02,_0x5c1269){var _0x8eb921={};var _0x23fcac={};var _0x5edfaa;var _0x405624;return db['WhatsappQueue'][_0x31ab('0x60')]({'where':{'id':_0x1ec80a[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x36cd02,null))[_0x31ab('0x25')](function(_0x206f72){if(_0x206f72){_0x5edfaa=_0x206f72;_0x23fcac[_0x31ab('0x31')]=_['keys'](db['User'][_0x31ab('0x56')]);_0x23fcac[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x1ec80a[_0x31ab('0x32')]);_0x23fcac[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x23fcac[_0x31ab('0x31')],_0x23fcac['query']);_0x8eb921['attributes']=_['intersection'](_0x23fcac[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x1ec80a['query']['fields']));_0x8eb921[_0x31ab('0x36')]=_0x8eb921[_0x31ab('0x36')][_0x31ab('0x47')]?_0x8eb921['attributes']:_0x23fcac[_0x31ab('0x31')];_0x8eb921[_0x31ab('0x39')]=qs['sort'](_0x1ec80a[_0x31ab('0x32')]['sort']);_0x8eb921[_0x31ab('0x3d')]=qs['filters'](_[_0x31ab('0x3b')](_0x1ec80a[_0x31ab('0x32')],_0x23fcac[_0x31ab('0x34')]));if(_0x1ec80a['query']['filter']){_0x8eb921[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x8eb921[_0x31ab('0x3d')],{'$or':_[_0x31ab('0x2c')](_0x8eb921[_0x31ab('0x36')],function(_0x56e3c9){var _0x3be3c2={};_0x3be3c2[_0x56e3c9]={'$like':'%'+_0x1ec80a['query'][_0x31ab('0x3c')]+'%'};return _0x3be3c2;})});}_0x8eb921=_[_0x31ab('0x3e')]({},_0x8eb921,_0x1ec80a[_0x31ab('0x40')]);return _0x5edfaa[_0x31ab('0x8b')](_0x8eb921);}})[_0x31ab('0x25')](function(_0x55aa7e){if(_0x55aa7e){_0x405624=_0x55aa7e[_0x31ab('0x47')];if(!_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x38')](_0x31ab('0x57'))){_0x8eb921[_0x31ab('0x1e')]=qs['limit'](_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x8eb921[_0x31ab('0x21')]=qs['offset'](_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x21')]);}return _0x5edfaa['getAgents'](_0x8eb921);}})[_0x31ab('0x25')](function(_0x11971d){if(_0x11971d){return _0x11971d?{'count':_0x405624,'rows':_0x11971d}:null;}})[_0x31ab('0x25')](respondWithResult(_0x36cd02,null))['catch'](handleError(_0x36cd02,null));}; \ No newline at end of file +var _0x06e5=['sort','WhatsappQueueId','User','updatedAt','format','%s/%s','SIP','whatsappPause','createdAt','getTeams','findOne','Team','rawAttributes','online','interface','flatMap','sequelize','transaction','addTeams','userWhatsappQueue:save','removeTeams','ids','Agents','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','get','WhatsappQueues','UserProfileResource','destroy','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','merge','where','options','WhatsappQueue','findAll','rows','show','includeAll','include','find','catch','create','body','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','UserWhatsappQueue','nolimit','order'];(function(_0x36cb66,_0x1fc8cb){var _0xe402a6=function(_0xa11911){while(--_0xa11911){_0x36cb66['push'](_0x36cb66['shift']());}};_0xe402a6(++_0x1fc8cb);}(_0x06e5,0x14a));var _0x506e=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x06e5[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x506e('0x0'));var rimraf=require(_0x506e('0x1'));var zipdir=require(_0x506e('0x2'));var jsonpatch=require(_0x506e('0x3'));var rp=require(_0x506e('0x4'));var moment=require(_0x506e('0x5'));var BPromise=require(_0x506e('0x6'));var Mustache=require(_0x506e('0x7'));var util=require(_0x506e('0x8'));var path=require(_0x506e('0x9'));var sox=require(_0x506e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x506e('0xb'));var _=require(_0x506e('0xc'));var squel=require(_0x506e('0xd'));var crypto=require('crypto');var jsforce=require(_0x506e('0xe'));var deskjs=require(_0x506e('0xf'));var toCsv=require(_0x506e('0x10'));var querystring=require(_0x506e('0x11'));var Papa=require('papaparse');var Redis=require(_0x506e('0x12'));var authService=require(_0x506e('0x13'));var qs=require(_0x506e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x506e('0x15'));var logger=require(_0x506e('0x16'))(_0x506e('0x17'));var utils=require(_0x506e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x506e('0x19'));var db=require(_0x506e('0x1a'))['db'];config[_0x506e('0x1b')]=_['defaults'](config[_0x506e('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x506e('0x1b')]));require(_0x506e('0x1c'))[_0x506e('0x1d')](socket);function respondWithStatusCode(_0x2e39b8,_0xe1217c){_0xe1217c=_0xe1217c||0xcc;return function(_0x2ee665){if(_0x2ee665){return _0x2e39b8[_0x506e('0x1e')](_0xe1217c);}return _0x2e39b8[_0x506e('0x1f')](_0xe1217c)[_0x506e('0x20')]();};}function respondWithResult(_0x31058d,_0xb56ae2){_0xb56ae2=_0xb56ae2||0xc8;return function(_0x3f3860){if(_0x3f3860){return _0x31058d[_0x506e('0x1f')](_0xb56ae2)[_0x506e('0x21')](_0x3f3860);}};}function respondWithFilteredResult(_0x2f9a0e,_0x52e237){return function(_0x3e0440){if(_0x3e0440){var _0x268b85=typeof _0x52e237[_0x506e('0x22')]==='undefined'&&typeof _0x52e237[_0x506e('0x23')]===_0x506e('0x24');var _0x219791=_0x3e0440[_0x506e('0x25')];var _0x26d663=_0x268b85?0x0:_0x52e237[_0x506e('0x22')];var _0x1706ca=_0x268b85?_0x3e0440[_0x506e('0x25')]:_0x52e237['offset']+_0x52e237['limit'];var _0x1ad034;if(_0x1706ca>=_0x219791){_0x1706ca=_0x219791;_0x1ad034=0xc8;}else{_0x1ad034=0xce;}_0x2f9a0e[_0x506e('0x1f')](_0x1ad034);return _0x2f9a0e[_0x506e('0x26')](_0x506e('0x27'),_0x26d663+'-'+_0x1706ca+'/'+_0x219791)[_0x506e('0x21')](_0x3e0440);}return null;};}function patchUpdates(_0x302371){return function(_0x4d8842){try{jsonpatch[_0x506e('0x28')](_0x4d8842,_0x302371,!![]);}catch(_0x5af54d){return BPromise[_0x506e('0x29')](_0x5af54d);}return _0x4d8842['save']();};}function saveUpdates(_0x7246dc,_0x3dc0ee){return function(_0x5ba7b9){if(_0x5ba7b9){return _0x5ba7b9['update'](_0x7246dc)[_0x506e('0x2a')](function(_0x102eb6){return _0x102eb6;});}return null;};}function removeEntity(_0x34af52,_0x20c85c){return function(_0x39c0df){if(_0x39c0df){return _0x39c0df['destroy']()[_0x506e('0x2a')](function(){var _0x34f7f4=_0x39c0df[_0x506e('0x2b')]({'plain':!![]});var _0xc8e8f5=_0x506e('0x2c');return db[_0x506e('0x2d')][_0x506e('0x2e')]({'where':{'type':_0xc8e8f5,'resourceId':_0x34f7f4['id']}})['then'](function(){return _0x39c0df;});})[_0x506e('0x2a')](function(){_0x34af52[_0x506e('0x1f')](0xcc)[_0x506e('0x20')]();});}};}function handleEntityNotFound(_0xe13378,_0x1c6a89){return function(_0x2d0af0){if(!_0x2d0af0){_0xe13378['sendStatus'](0x194);}return _0x2d0af0;};}function handleError(_0xfcb064,_0x332dd8){_0x332dd8=_0x332dd8||0x1f4;return function(_0x34d486){logger['error'](_0x34d486['stack']);if(_0x34d486[_0x506e('0x2f')]){delete _0x34d486[_0x506e('0x2f')];}_0xfcb064[_0x506e('0x1f')](_0x332dd8)[_0x506e('0x30')](_0x34d486);};}exports[_0x506e('0x31')]=function(_0x80b7fb,_0x33da2f){var _0x4e96c1={},_0x47f9d4={},_0x14c028={'count':0x0,'rows':[]};var _0x1e8f13=_[_0x506e('0x32')](db['WhatsappQueue']['rawAttributes'],function(_0x53630d){return{'name':_0x53630d[_0x506e('0x33')],'type':_0x53630d[_0x506e('0x34')][_0x506e('0x35')]};});_0x47f9d4[_0x506e('0x36')]=_[_0x506e('0x32')](_0x1e8f13,_0x506e('0x2f'));_0x47f9d4['query']=_[_0x506e('0x37')](_0x80b7fb[_0x506e('0x38')]);_0x47f9d4[_0x506e('0x39')]=_[_0x506e('0x3a')](_0x47f9d4[_0x506e('0x36')],_0x47f9d4[_0x506e('0x38')]);_0x4e96c1[_0x506e('0x3b')]=_['intersection'](_0x47f9d4['model'],qs[_0x506e('0x3c')](_0x80b7fb[_0x506e('0x38')][_0x506e('0x3c')]));_0x4e96c1[_0x506e('0x3b')]=_0x4e96c1['attributes'][_0x506e('0x3d')]?_0x4e96c1[_0x506e('0x3b')]:_0x47f9d4[_0x506e('0x36')];if(!_0x80b7fb[_0x506e('0x38')][_0x506e('0x3e')]('nolimit')){_0x4e96c1[_0x506e('0x23')]=qs['limit'](_0x80b7fb[_0x506e('0x38')][_0x506e('0x23')]);_0x4e96c1[_0x506e('0x22')]=qs['offset'](_0x80b7fb['query'][_0x506e('0x22')]);}_0x4e96c1['order']=qs['sort'](_0x80b7fb[_0x506e('0x38')]['sort']);_0x4e96c1['where']=qs[_0x506e('0x39')](_[_0x506e('0x3f')](_0x80b7fb[_0x506e('0x38')],_0x47f9d4[_0x506e('0x39')]),_0x1e8f13);if(_0x80b7fb[_0x506e('0x38')][_0x506e('0x40')]){_0x4e96c1['where']=_[_0x506e('0x41')](_0x4e96c1[_0x506e('0x42')],{'$or':_[_0x506e('0x32')](_0x1e8f13,function(_0x4d5825){if(_0x4d5825['type']!=='VIRTUAL'){var _0x243624={};_0x243624[_0x4d5825[_0x506e('0x2f')]]={'$like':'%'+_0x80b7fb[_0x506e('0x38')][_0x506e('0x40')]+'%'};return _0x243624;}})});}_0x4e96c1=_[_0x506e('0x41')]({},_0x4e96c1,_0x80b7fb[_0x506e('0x43')]);var _0x2b6312={'where':_0x4e96c1[_0x506e('0x42')]};return db[_0x506e('0x44')][_0x506e('0x25')](_0x2b6312)['then'](function(_0x48f0f4){_0x14c028['count']=_0x48f0f4;if(_0x80b7fb[_0x506e('0x38')]['includeAll']){_0x4e96c1['include']=[{'all':!![]}];}return db[_0x506e('0x44')][_0x506e('0x45')](_0x4e96c1);})['then'](function(_0x59f652){_0x14c028[_0x506e('0x46')]=_0x59f652;return _0x14c028;})['then'](respondWithFilteredResult(_0x33da2f,_0x4e96c1))['catch'](handleError(_0x33da2f,null));};exports[_0x506e('0x47')]=function(_0x21c5ac,_0x4a77aa){var _0x179758={'raw':!![],'where':{'id':_0x21c5ac['params']['id']}},_0x28f579={};_0x28f579[_0x506e('0x36')]=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x28f579[_0x506e('0x38')]=_[_0x506e('0x37')](_0x21c5ac[_0x506e('0x38')]);_0x28f579['filters']=_['intersection'](_0x28f579[_0x506e('0x36')],_0x28f579[_0x506e('0x38')]);_0x179758[_0x506e('0x3b')]=_[_0x506e('0x3a')](_0x28f579[_0x506e('0x36')],qs[_0x506e('0x3c')](_0x21c5ac[_0x506e('0x38')][_0x506e('0x3c')]));_0x179758['attributes']=_0x179758[_0x506e('0x3b')][_0x506e('0x3d')]?_0x179758[_0x506e('0x3b')]:_0x28f579[_0x506e('0x36')];if(_0x21c5ac[_0x506e('0x38')][_0x506e('0x48')]){_0x179758[_0x506e('0x49')]=[{'all':!![]}];}_0x179758=_['merge']({},_0x179758,_0x21c5ac[_0x506e('0x43')]);return db[_0x506e('0x44')][_0x506e('0x4a')](_0x179758)['then'](handleEntityNotFound(_0x4a77aa,null))['then'](respondWithResult(_0x4a77aa,null))[_0x506e('0x4b')](handleError(_0x4a77aa,null));};exports[_0x506e('0x4c')]=function(_0x45155f,_0x254bb1){return db[_0x506e('0x44')]['create'](_0x45155f[_0x506e('0x4d')],{})[_0x506e('0x2a')](function(_0x1a520f){var _0x4bd458=_0x45155f['user'][_0x506e('0x2b')]({'plain':!![]});if(!_0x4bd458)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd458[_0x506e('0x4e')]===_0x506e('0x4f')){var _0x3b060a=_0x1a520f[_0x506e('0x2b')]({'plain':!![]});var _0x7c3638=_0x506e('0x2c');return db[_0x506e('0x50')][_0x506e('0x4a')]({'where':{'name':_0x7c3638,'userProfileId':_0x4bd458['userProfileId']},'raw':!![]})[_0x506e('0x2a')](function(_0x304b84){if(_0x304b84&&_0x304b84[_0x506e('0x51')]===0x0){return db[_0x506e('0x2d')]['create']({'name':_0x3b060a['name'],'resourceId':_0x3b060a['id'],'type':_0x304b84['name'],'sectionId':_0x304b84['id']},{})[_0x506e('0x2a')](function(){return _0x1a520f;});}else{return _0x1a520f;}})[_0x506e('0x4b')](function(_0x2c7333){logger[_0x506e('0x52')](_0x506e('0x53'),_0x2c7333);throw _0x2c7333;});}return _0x1a520f;})['then'](respondWithResult(_0x254bb1,0xc9))[_0x506e('0x4b')](handleError(_0x254bb1,null));};exports[_0x506e('0x54')]=function(_0x58d0fc,_0x31e96c){if(_0x58d0fc[_0x506e('0x4d')]['id']){delete _0x58d0fc[_0x506e('0x4d')]['id'];}return db[_0x506e('0x44')][_0x506e('0x4a')]({'where':{'id':_0x58d0fc[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](handleEntityNotFound(_0x31e96c,null))[_0x506e('0x2a')](saveUpdates(_0x58d0fc[_0x506e('0x4d')],null))[_0x506e('0x2a')](respondWithResult(_0x31e96c,null))['catch'](handleError(_0x31e96c,null));};exports[_0x506e('0x2e')]=function(_0x116f2c,_0x1603cc){return db[_0x506e('0x44')][_0x506e('0x4a')]({'where':{'id':_0x116f2c[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](handleEntityNotFound(_0x1603cc,null))[_0x506e('0x2a')](removeEntity(_0x1603cc,null))[_0x506e('0x4b')](handleError(_0x1603cc,null));};exports['describe']=function(_0x6a4708,_0x1a191a){return db[_0x506e('0x44')]['describe']()[_0x506e('0x2a')](respondWithResult(_0x1a191a,null))['catch'](handleError(_0x1a191a,null));};exports[_0x506e('0x56')]=function(_0x94d554,_0x5d7ec1,_0x3b116a){var _0x47925d={'raw':!![],'where':{}},_0x2b0052={},_0x266496;return db['WhatsappQueue']['findOne']({'where':{'id':_0x94d554[_0x506e('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d7ec1,null))[_0x506e('0x2a')](function(_0x24a33c){if(_0x24a33c){_0x266496=_0x24a33c[_0x506e('0x2b')]({'plain':!![]});_0x2b0052['model']=_[_0x506e('0x37')](db[_0x506e('0x57')]['rawAttributes']);_0x2b0052[_0x506e('0x38')]=_[_0x506e('0x37')](_0x94d554[_0x506e('0x38')]);_0x2b0052[_0x506e('0x39')]=_[_0x506e('0x3a')](_0x2b0052[_0x506e('0x36')],_0x2b0052[_0x506e('0x38')]);_0x47925d['attributes']=_[_0x506e('0x3a')](_0x2b0052[_0x506e('0x36')],qs[_0x506e('0x3c')](_0x94d554[_0x506e('0x38')][_0x506e('0x3c')]));_0x47925d[_0x506e('0x3b')]=_0x47925d[_0x506e('0x3b')][_0x506e('0x3d')]?_0x47925d['attributes']:_0x2b0052[_0x506e('0x36')];if(!_0x94d554[_0x506e('0x38')][_0x506e('0x3e')](_0x506e('0x58'))){_0x47925d['limit']=qs[_0x506e('0x23')](_0x94d554['query'][_0x506e('0x23')]);_0x47925d[_0x506e('0x22')]=qs[_0x506e('0x22')](_0x94d554[_0x506e('0x38')][_0x506e('0x22')]);}_0x47925d[_0x506e('0x59')]=qs[_0x506e('0x5a')](_0x94d554[_0x506e('0x38')][_0x506e('0x5a')]);_0x47925d[_0x506e('0x42')]=qs[_0x506e('0x39')](_[_0x506e('0x3f')](_0x94d554[_0x506e('0x38')],_0x2b0052[_0x506e('0x39')]));_0x47925d[_0x506e('0x42')][_0x506e('0x5b')]=_0x24a33c['id'];if(_0x94d554[_0x506e('0x38')][_0x506e('0x40')]){_0x47925d[_0x506e('0x42')]=_[_0x506e('0x41')](_0x47925d[_0x506e('0x42')],{'$or':_[_0x506e('0x32')](_0x47925d[_0x506e('0x3b')],function(_0x48d1d1){var _0x3a00e={};_0x3a00e[_0x48d1d1]={'$like':'%'+_0x94d554[_0x506e('0x38')][_0x506e('0x40')]+'%'};return _0x3a00e;})});}_0x47925d=_['merge']({},_0x47925d,_0x94d554[_0x506e('0x43')]);return db[_0x506e('0x57')]['findAll'](_0x47925d);}})[_0x506e('0x2a')](function(_0xebc93){if(_0xebc93){return db[_0x506e('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0xebc93,'UserId'),'role':'agent'},'attributes':['id',_0x506e('0x2f'),'whatsappPause',_0x506e('0x5d'),'createdAt']});}})['then'](function(_0x69ec41){if(_0x69ec41){return{'count':_0x69ec41['count'],'rows':_[_0x506e('0x32')](_0x69ec41['rows'],function(_0x2a0329){return{'membername':_0x2a0329[_0x506e('0x2f')],'UserId':_0x2a0329['id'],'queue_name':_0x266496[_0x506e('0x2f')],'WhatsappQueueId':_0x266496['id'],'interface':util[_0x506e('0x5e')](_0x506e('0x5f'),_0x506e('0x60'),_0x2a0329[_0x506e('0x2f')]),'penalty':0x0,'paused':_0x2a0329[_0x506e('0x61')],'createdAt':_0x2a0329[_0x506e('0x62')],'updatedAt':_0x2a0329['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x506e('0x2a')](respondWithFilteredResult(_0x5d7ec1,_0x47925d))[_0x506e('0x4b')](handleError(_0x5d7ec1,null));};exports[_0x506e('0x63')]=function(_0x54674d,_0x119d78,_0x31dae1){var _0x5514ca={};var _0x3af224={};var _0x1cb9e6;var _0x5521a3;return db['WhatsappQueue'][_0x506e('0x64')]({'where':{'id':_0x54674d[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](handleEntityNotFound(_0x119d78,null))[_0x506e('0x2a')](function(_0x3f455e){if(_0x3f455e){_0x1cb9e6=_0x3f455e;_0x3af224[_0x506e('0x36')]=_[_0x506e('0x37')](db[_0x506e('0x65')][_0x506e('0x66')]);_0x3af224[_0x506e('0x38')]=_[_0x506e('0x37')](_0x54674d['query']);_0x3af224['filters']=_['intersection'](_0x3af224[_0x506e('0x36')],_0x3af224['query']);_0x5514ca[_0x506e('0x3b')]=_[_0x506e('0x3a')](_0x3af224[_0x506e('0x36')],qs[_0x506e('0x3c')](_0x54674d['query']['fields']));_0x5514ca[_0x506e('0x3b')]=_0x5514ca[_0x506e('0x3b')][_0x506e('0x3d')]?_0x5514ca[_0x506e('0x3b')]:_0x3af224[_0x506e('0x36')];_0x5514ca[_0x506e('0x59')]=qs['sort'](_0x54674d[_0x506e('0x38')][_0x506e('0x5a')]);_0x5514ca[_0x506e('0x42')]=qs[_0x506e('0x39')](_['pick'](_0x54674d[_0x506e('0x38')],_0x3af224[_0x506e('0x39')]));if(_0x54674d[_0x506e('0x38')]['filter']){_0x5514ca[_0x506e('0x42')]=_[_0x506e('0x41')](_0x5514ca['where'],{'$or':_['map'](_0x5514ca[_0x506e('0x3b')],function(_0x3a8596){var _0x5e552a={};_0x5e552a[_0x3a8596]={'$like':'%'+_0x54674d['query'][_0x506e('0x40')]+'%'};return _0x5e552a;})});}_0x5514ca=_[_0x506e('0x41')]({},_0x5514ca,_0x54674d[_0x506e('0x43')]);return _0x1cb9e6[_0x506e('0x63')](_0x5514ca);}})[_0x506e('0x2a')](function(_0x284a84){if(_0x284a84){_0x5521a3=_0x284a84[_0x506e('0x3d')];if(!_0x54674d[_0x506e('0x38')][_0x506e('0x3e')]('nolimit')){_0x5514ca[_0x506e('0x23')]=qs[_0x506e('0x23')](_0x54674d[_0x506e('0x38')][_0x506e('0x23')]);_0x5514ca[_0x506e('0x22')]=qs[_0x506e('0x22')](_0x54674d['query']['offset']);}return _0x1cb9e6['getTeams'](_0x5514ca);}})['then'](function(_0x5dcef9){if(_0x5dcef9){return _0x5dcef9?{'count':_0x5521a3,'rows':_0x5dcef9}:null;}})[_0x506e('0x2a')](respondWithResult(_0x119d78,null))[_0x506e('0x4b')](handleError(_0x119d78,null));};exports['addTeams']=function(_0x2e59ef,_0x4f1538,_0x4bc27c){var _0x443e15=_0x2e59ef[_0x506e('0x4d')]['ids'];return db[_0x506e('0x65')][_0x506e('0x45')]({'where':{'id':_0x443e15},'attributes':['id'],'include':[{'model':db[_0x506e('0x5c')],'as':'Agents','attributes':['id',_0x506e('0x2f'),_0x506e('0x67'),'voicePause',_0x506e('0x68')],'raw':!![]}]})[_0x506e('0x2a')](function(_0x7b0e64){if(_0x7b0e64){var _0x50e10b=_[_0x506e('0x69')](_0x7b0e64,function(_0x5d07d8){var _0x3b08f2=_0x5d07d8[_0x506e('0x2b')]({'plain':!![]});return _0x3b08f2['Agents'];});return db[_0x506e('0x44')][_0x506e('0x4a')]({'where':{'id':_0x2e59ef[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](function(_0x35ddce){return db[_0x506e('0x6a')][_0x506e('0x6b')](function(_0x4c7fb9){return _0x35ddce[_0x506e('0x6c')](_0x443e15,{'transaction':_0x4c7fb9})[_0x506e('0x2a')](function(){return BPromise['each'](_0x50e10b,function(_0x50ef91){return db[_0x506e('0x57')]['findOrCreate']({'where':{'UserId':_0x50ef91['id'],'WhatsappQueueId':_0x2e59ef['params']['id']},'transaction':_0x4c7fb9});});})[_0x506e('0x2a')](function(){_0x50e10b['forEach'](function(_0x2856ef){socket['emit'](_0x506e('0x6d'),{'UserId':_0x2856ef['id'],'WhatsappQueueId':_0x35ddce['id']});});});});});}})[_0x506e('0x2a')](respondWithStatusCode(_0x4f1538,null))['catch'](handleError(_0x4f1538,null));};exports[_0x506e('0x6e')]=function(_0x3a4d62,_0x3debee,_0x2810a1){return db[_0x506e('0x65')]['findAll']({'where':{'id':_0x3a4d62[_0x506e('0x38')][_0x506e('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x506e('0x5c')],'as':_0x506e('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3debee,null))['then'](function(_0x3e5dd7){var _0x551f8e=_[_0x506e('0x32')](_0x3e5dd7,'id');var _0x3a3056=[];var _0x2f7654=[];var _0x443932=squel['select']();_0x443932[_0x506e('0x71')]('tq.TeamId')[_0x506e('0x72')]('team_has_whatsapp_queues','tq')[_0x506e('0x73')](_0x506e('0x74'),'ut',_0x506e('0x75'))['where'](_0x506e('0x76'),_0x3a4d62[_0x506e('0x55')]['id']);for(var _0x3f42fa=0x0;_0x3f42fa<_0x3e5dd7[_0x506e('0x3d')];_0x3f42fa+=0x1){let _0x5b24ee=_0x3e5dd7[_0x3f42fa];for(var _0x2fe2b2=0x0;_0x2fe2b2<_0x5b24ee[_0x506e('0x70')][_0x506e('0x3d')];_0x2fe2b2+=0x1){let _0x13a9e0=_0x5b24ee[_0x506e('0x70')][_0x2fe2b2];var _0x646aca=_0x443932[_0x506e('0x77')]();_0x646aca[_0x506e('0x42')](_0x506e('0x78'),_0x13a9e0['id']);_0x2f7654[_0x506e('0x79')](db[_0x506e('0x6a')][_0x506e('0x38')](_0x646aca[_0x506e('0x7a')](),{'type':db[_0x506e('0x6a')][_0x506e('0x7b')][_0x506e('0x7c')]})[_0x506e('0x2a')](function(_0x336b91){if(_0x336b91[_0x506e('0x3d')]===0x1){return _0x13a9e0['id'];}else{var _0x4d6e81=_[_0x506e('0x7d')](_['map'](_0x336b91,_0x506e('0x7e')),function(_0x208e10){return _[_0x506e('0x7f')](_0x551f8e,_0x208e10);});if(_0x4d6e81){return _0x13a9e0['id'];}}}));}}return BPromise['all'](_0x2f7654)[_0x506e('0x2a')](function(_0x291a98){_0x3a3056=_(_0x3a3056)[_0x506e('0x80')](_0x291a98)[_0x506e('0x81')]()[_0x506e('0x82')]();return db[_0x506e('0x44')][_0x506e('0x4a')]({'where':{'id':_0x3a4d62[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](function(_0x2737cd){return db[_0x506e('0x6a')][_0x506e('0x6b')](function(_0x505514){return _0x2737cd[_0x506e('0x6e')](_0x3a4d62[_0x506e('0x38')]['ids'],{'transaction':_0x505514})[_0x506e('0x2a')](function(){if(!_[_0x506e('0x83')](_0x3a3056)){return _0x2737cd[_0x506e('0x84')](_0x3a3056,{'transaction':_0x505514});}})['then'](function(){_0x3a3056[_0x506e('0x85')](function(_0x22be74){socket[_0x506e('0x86')]('userWhatsappQueue:remove',{'UserId':_0x22be74,'WhatsappQueueId':_0x2737cd['id']});});});});});});})[_0x506e('0x2a')](respondWithStatusCode(_0x3debee,null))[_0x506e('0x4b')](handleError(_0x3debee,null));};exports['addAgents']=function(_0x3af42d,_0x2b5c0c,_0x338ddf){return db[_0x506e('0x44')]['find']({'where':{'id':_0x3af42d[_0x506e('0x55')]['id']}})[_0x506e('0x2a')](handleEntityNotFound(_0x2b5c0c,null))[_0x506e('0x2a')](function(_0x5904f0){if(_0x5904f0){return _0x5904f0[_0x506e('0x87')](_0x3af42d[_0x506e('0x4d')][_0x506e('0x6f')],_['omit'](_0x3af42d[_0x506e('0x4d')],[_0x506e('0x6f'),'id'])||{})[_0x506e('0x88')](function(_0x3f22ae){for(var _0x3cce8b=0x0;_0x3cce8b<_0x3af42d['body']['ids'][_0x506e('0x3d')];_0x3cce8b+=0x1){socket[_0x506e('0x86')](_0x506e('0x6d'),{'UserId':Number(_0x3af42d[_0x506e('0x4d')]['ids'][_0x3cce8b]),'WhatsappQueueId':Number(_0x3af42d['params']['id'])});}return _0x3f22ae;});}})[_0x506e('0x2a')](respondWithResult(_0x2b5c0c,null))[_0x506e('0x4b')](handleError(_0x2b5c0c,null));};exports[_0x506e('0x84')]=function(_0x57d640,_0x4e7ae3,_0x599811){return db[_0x506e('0x44')][_0x506e('0x4a')]({'where':{'id':_0x57d640[_0x506e('0x55')]['id']}})['then'](handleEntityNotFound(_0x4e7ae3,null))['then'](function(_0x131a84){if(_0x131a84){return _0x131a84[_0x506e('0x84')](_0x57d640[_0x506e('0x38')][_0x506e('0x6f')])['then'](function(){if(_[_0x506e('0x89')](_0x57d640[_0x506e('0x38')][_0x506e('0x6f')])){for(var _0xebfe2e=0x0;_0xebfe2e<_0x57d640[_0x506e('0x38')][_0x506e('0x6f')][_0x506e('0x3d')];_0xebfe2e+=0x1){socket[_0x506e('0x86')](_0x506e('0x8a'),{'UserId':Number(_0x57d640[_0x506e('0x38')][_0x506e('0x6f')][_0xebfe2e]),'WhatsappQueueId':Number(_0x57d640[_0x506e('0x55')]['id'])});}}else{socket[_0x506e('0x86')]('userWhatsappQueue:remove',{'UserId':Number(_0x57d640[_0x506e('0x38')][_0x506e('0x6f')]),'WhatsappQueueId':Number(_0x57d640[_0x506e('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e7ae3,null))[_0x506e('0x4b')](handleError(_0x4e7ae3,null));};exports[_0x506e('0x8b')]=function(_0xc51756,_0x3f28a8,_0x365979){var _0x5b22ea={};var _0xed6dd3={};var _0x300d48;var _0x547029;return db[_0x506e('0x44')][_0x506e('0x64')]({'where':{'id':_0xc51756['params']['id']}})['then'](handleEntityNotFound(_0x3f28a8,null))[_0x506e('0x2a')](function(_0x48d895){if(_0x48d895){_0x300d48=_0x48d895;_0xed6dd3['model']=_[_0x506e('0x37')](db['User'][_0x506e('0x66')]);_0xed6dd3[_0x506e('0x38')]=_[_0x506e('0x37')](_0xc51756['query']);_0xed6dd3[_0x506e('0x39')]=_[_0x506e('0x3a')](_0xed6dd3[_0x506e('0x36')],_0xed6dd3[_0x506e('0x38')]);_0x5b22ea[_0x506e('0x3b')]=_[_0x506e('0x3a')](_0xed6dd3[_0x506e('0x36')],qs[_0x506e('0x3c')](_0xc51756[_0x506e('0x38')][_0x506e('0x3c')]));_0x5b22ea[_0x506e('0x3b')]=_0x5b22ea[_0x506e('0x3b')][_0x506e('0x3d')]?_0x5b22ea['attributes']:_0xed6dd3['model'];_0x5b22ea[_0x506e('0x59')]=qs[_0x506e('0x5a')](_0xc51756[_0x506e('0x38')][_0x506e('0x5a')]);_0x5b22ea['where']=qs[_0x506e('0x39')](_[_0x506e('0x3f')](_0xc51756[_0x506e('0x38')],_0xed6dd3['filters']));if(_0xc51756[_0x506e('0x38')][_0x506e('0x40')]){_0x5b22ea[_0x506e('0x42')]=_[_0x506e('0x41')](_0x5b22ea['where'],{'$or':_[_0x506e('0x32')](_0x5b22ea[_0x506e('0x3b')],function(_0xf02ac){var _0x3d447a={};_0x3d447a[_0xf02ac]={'$like':'%'+_0xc51756[_0x506e('0x38')][_0x506e('0x40')]+'%'};return _0x3d447a;})});}_0x5b22ea=_[_0x506e('0x41')]({},_0x5b22ea,_0xc51756[_0x506e('0x43')]);return _0x300d48['getAgents'](_0x5b22ea);}})[_0x506e('0x2a')](function(_0x1c24e6){if(_0x1c24e6){_0x547029=_0x1c24e6[_0x506e('0x3d')];if(!_0xc51756[_0x506e('0x38')][_0x506e('0x3e')](_0x506e('0x58'))){_0x5b22ea[_0x506e('0x23')]=qs[_0x506e('0x23')](_0xc51756['query'][_0x506e('0x23')]);_0x5b22ea['offset']=qs['offset'](_0xc51756[_0x506e('0x38')][_0x506e('0x22')]);}return _0x300d48[_0x506e('0x8b')](_0x5b22ea);}})[_0x506e('0x2a')](function(_0x112f88){if(_0x112f88){return _0x112f88?{'count':_0x547029,'rows':_0x112f88}:null;}})[_0x506e('0x2a')](respondWithResult(_0x3f28a8,null))[_0x506e('0x4b')](handleError(_0x3f28a8,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a55ffa3..ea90806 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 _0x3e83=['emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x3e83,0x189));var _0x33e8=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0x3e83[_0x19a9b5];return _0x632733;};'use strict';var EventEmitter=require(_0x33e8('0x0'));var WhatsappQueue=require(_0x33e8('0x1'))['db'][_0x33e8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x33e8('0x3')](0x0);var events={'afterCreate':_0x33e8('0x4'),'afterUpdate':_0x33e8('0x5'),'afterDestroy':_0x33e8('0x6')};function emitEvent(_0x2fc3c5){return function(_0x538e23,_0x2f9da9,_0x162b92){WhatsappQueueEvents[_0x33e8('0x7')](_0x2fc3c5+':'+_0x538e23['id'],_0x538e23);WhatsappQueueEvents[_0x33e8('0x7')](_0x2fc3c5,_0x538e23);_0x162b92(null);};}for(var e in events){if(events[_0x33e8('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x33e8('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xced7=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xced7,0x70));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x7ced('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7ced('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7ced('0x2'),'afterDestroy':_0x7ced('0x3')};function emitEvent(_0x5f29ac){return function(_0x7e5de3,_0x39ce23,_0x41aa9a){WhatsappQueueEvents[_0x7ced('0x4')](_0x5f29ac+':'+_0x7e5de3['id'],_0x7e5de3);WhatsappQueueEvents[_0x7ced('0x4')](_0x5f29ac,_0x7e5de3);_0x41aa9a(null);};}for(var e in events){if(events[_0x7ced('0x5')](e)){var event=events[e];WhatsappQueue[_0x7ced('0x6')](e,emitEvent(event));}}module[_0x7ced('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 3f35e10..0759d09 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 _0x8d83=['define','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x284247,_0x26bdfe){var _0x3c1b30=function(_0x22f37b){while(--_0x22f37b){_0x284247['push'](_0x284247['shift']());}};_0x3c1b30(++_0x26bdfe);}(_0x8d83,0xa2));var _0x38d8=function(_0x1ae31,_0x12e3c6){_0x1ae31=_0x1ae31-0x0;var _0x585990=_0x8d83[_0x1ae31];return _0x585990;};'use strict';var _=require(_0x38d8('0x0'));var util=require('util');var logger=require(_0x38d8('0x1'))(_0x38d8('0x2'));var moment=require(_0x38d8('0x3'));var BPromise=require(_0x38d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38d8('0x5'));var config=require(_0x38d8('0x6'));var attributes=require(_0x38d8('0x7'));module['exports']=function(_0x5ef564,_0x5e82ed){return _0x5ef564[_0x38d8('0x8')]('WhatsappQueue',attributes,{'tableName':_0x38d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4203=['exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x490c45,_0x97b829){var _0x82738e=function(_0x215c17){while(--_0x215c17){_0x490c45['push'](_0x490c45['shift']());}};_0x82738e(++_0x97b829);}(_0x4203,0xd4));var _0x3420=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4203[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x3420('0x0'));var util=require(_0x3420('0x1'));var logger=require(_0x3420('0x2'))(_0x3420('0x3'));var moment=require(_0x3420('0x4'));var BPromise=require('bluebird');var rp=require(_0x3420('0x5'));var fs=require('fs');var path=require(_0x3420('0x6'));var rimraf=require('rimraf');var config=require(_0x3420('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x3420('0x8')]=function(_0x1d60b0,_0x20c706){return _0x1d60b0['define'](_0x3420('0x9'),attributes,{'tableName':_0x3420('0xa'),'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 fc91358..9f74129 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 _0xf116=['redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','debug','find','raw','ShowWhatsappQueue','stringify','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6de3e9,_0x2a6ef3){var _0x6d0d9=function(_0x323e3e){while(--_0x323e3e){_0x6de3e9['push'](_0x6de3e9['shift']());}};_0x6d0d9(++_0x2a6ef3);}(_0xf116,0xec));var _0x6f11=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0xf116[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x6f11('0x0'));var util=require('util');var moment=require(_0x6f11('0x1'));var BPromise=require(_0x6f11('0x2'));var rs=require(_0x6f11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f11('0x4'));var logger=require(_0x6f11('0x5'))(_0x6f11('0x6'));var config=require(_0x6f11('0x7'));var jayson=require(_0x6f11('0x8'));var client=jayson[_0x6f11('0x9')]['http']({'port':0x232a});config[_0x6f11('0xa')]=_[_0x6f11('0xb')](config[_0x6f11('0xa')],{'host':_0x6f11('0xc'),'port':0x18eb});var socket=require(_0x6f11('0xd'))(new Redis(config[_0x6f11('0xa')]));require(_0x6f11('0xe'))[_0x6f11('0xf')](socket);function respondWithRpcPromise(_0x31f684,_0x2591c1,_0x25f9ae){return new BPromise(function(_0x39cedb,_0x2db979){return client[_0x6f11('0x10')](_0x31f684,_0x25f9ae)[_0x6f11('0x11')](function(_0xf0a54c){logger[_0x6f11('0x12')](_0x6f11('0x13'),_0x2591c1,_0x6f11('0x14'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2591c1,'request\x20sent',JSON['stringify'](_0xf0a54c));if(_0xf0a54c[_0x6f11('0x15')]){if(_0xf0a54c['error'][_0x6f11('0x16')]===0x1f4){logger['error'](_0x6f11('0x13'),_0x2591c1,_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);return _0x2db979(_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);}logger['error'](_0x6f11('0x13'),_0x2591c1,_0xf0a54c['error']['message']);return _0x39cedb(_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);}else{logger['info'](_0x6f11('0x13'),_0x2591c1,_0x6f11('0x14'));_0x39cedb(_0xf0a54c[_0x6f11('0x18')][_0x6f11('0x17')]);}})[_0x6f11('0x19')](function(_0x380085){logger[_0x6f11('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x2591c1,_0x380085);_0x2db979(_0x380085);});});}exports[_0x6f11('0x1a')]=function(_0x24a748){var _0x14d236=this;return new Promise(function(_0x5a4851,_0x5d169d){return db[_0x6f11('0x1b')][_0x6f11('0x1c')]({'raw':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x24a748['options']?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x1e')]||null:null,'attributes':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')]['attributes']||null:null,'limit':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x1f')]||null:null,'include':_0x24a748['options']?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x24a748[_0x6f11('0x1d')][_0x6f11('0x20')],function(_0x552abb){return{'model':db[_0x552abb[_0x6f11('0x22')]],'as':_0x552abb['as'],'attributes':_0x552abb[_0x6f11('0x23')],'include':_0x552abb[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x552abb[_0x6f11('0x20')],function(_0x1b9798){return{'model':db[_0x1b9798['model']],'as':_0x1b9798['as'],'attributes':_0x1b9798['attributes'],'include':_0x1b9798[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x1b9798[_0x6f11('0x20')],function(_0x158aca){return{'model':db[_0x158aca[_0x6f11('0x22')]],'as':_0x158aca['as'],'attributes':_0x158aca[_0x6f11('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ec067){logger[_0x6f11('0x12')](_0x6f11('0x1a'),_0x24a748);logger[_0x6f11('0x24')](_0x6f11('0x1a'),_0x24a748,JSON['stringify'](_0x1ec067));_0x5a4851(_0x1ec067);})['catch'](function(_0x5d82c2){logger[_0x6f11('0x15')](_0x6f11('0x1a'),_0x5d82c2[_0x6f11('0x17')],_0x24a748);_0x5d169d(_0x14d236[_0x6f11('0x15')](0x1f4,_0x5d82c2[_0x6f11('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x5a8c48){var _0x458a12=this;return new Promise(function(_0x4e976b,_0x562b19){return db[_0x6f11('0x1b')][_0x6f11('0x25')]({'raw':_0x5a8c48['options']?_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x26')]===undefined?!![]:![]:!![],'where':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48['options'][_0x6f11('0x1e')]||null:null,'attributes':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x23')]||null:null,'include':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48['options'][_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x20')],function(_0x4c8ef5){return{'model':db[_0x4c8ef5[_0x6f11('0x22')]],'as':_0x4c8ef5['as'],'attributes':_0x4c8ef5[_0x6f11('0x23')],'include':_0x4c8ef5[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x4c8ef5[_0x6f11('0x20')],function(_0xa8001){return{'model':db[_0xa8001['model']],'as':_0xa8001['as'],'attributes':_0xa8001[_0x6f11('0x23')],'include':_0xa8001['include']?_[_0x6f11('0x21')](_0xa8001[_0x6f11('0x20')],function(_0x1a635c){return{'model':db[_0x1a635c[_0x6f11('0x22')]],'as':_0x1a635c['as'],'attributes':_0x1a635c[_0x6f11('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6f11('0x11')](function(_0x2c7a57){logger['info'](_0x6f11('0x27'),_0x5a8c48);logger[_0x6f11('0x24')](_0x6f11('0x27'),_0x5a8c48,JSON[_0x6f11('0x28')](_0x2c7a57));_0x4e976b(_0x2c7a57);})['catch'](function(_0x689390){logger[_0x6f11('0x15')](_0x6f11('0x27'),_0x689390[_0x6f11('0x17')],_0x5a8c48);_0x562b19(_0x458a12['error'](0x1f4,_0x689390['message']));});});}; \ No newline at end of file +var _0x2b00=['include','attributes','then','stringify','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','map','model'];(function(_0x2a1a31,_0x1b8b1a){var _0xe175e8=function(_0xa6f2c2){while(--_0xa6f2c2){_0x2a1a31['push'](_0x2a1a31['shift']());}};_0xe175e8(++_0x1b8b1a);}(_0x2b00,0x11d));var _0x02b0=function(_0x5912a0,_0x1f366f){_0x5912a0=_0x5912a0-0x0;var _0x1b69ea=_0x2b00[_0x5912a0];return _0x1b69ea;};'use strict';var _=require('lodash');var util=require(_0x02b0('0x0'));var moment=require(_0x02b0('0x1'));var BPromise=require(_0x02b0('0x2'));var rs=require(_0x02b0('0x3'));var fs=require('fs');var Redis=require(_0x02b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x02b0('0x5'));var logger=require(_0x02b0('0x6'))(_0x02b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x02b0('0x8'));var client=jayson[_0x02b0('0x9')][_0x02b0('0xa')]({'port':0x232a});config[_0x02b0('0xb')]=_[_0x02b0('0xc')](config[_0x02b0('0xb')],{'host':_0x02b0('0xd'),'port':0x18eb});var socket=require(_0x02b0('0xe'))(new Redis(config[_0x02b0('0xb')]));require(_0x02b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f8dd0,_0x53fcca,_0xd31f70){return new BPromise(function(_0x5bf318,_0x311702){return client[_0x02b0('0x10')](_0x4f8dd0,_0xd31f70)['then'](function(_0x270732){logger[_0x02b0('0x11')](_0x02b0('0x12'),_0x53fcca,_0x02b0('0x13'));logger[_0x02b0('0x14')](_0x02b0('0x15'),_0x53fcca,_0x02b0('0x13'),JSON['stringify'](_0x270732));if(_0x270732[_0x02b0('0x16')]){if(_0x270732[_0x02b0('0x16')][_0x02b0('0x17')]===0x1f4){logger[_0x02b0('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x53fcca,_0x270732[_0x02b0('0x16')]['message']);return _0x311702(_0x270732[_0x02b0('0x16')][_0x02b0('0x18')]);}logger[_0x02b0('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x53fcca,_0x270732[_0x02b0('0x16')][_0x02b0('0x18')]);return _0x5bf318(_0x270732[_0x02b0('0x16')][_0x02b0('0x18')]);}else{logger[_0x02b0('0x11')](_0x02b0('0x12'),_0x53fcca,_0x02b0('0x13'));_0x5bf318(_0x270732['result'][_0x02b0('0x18')]);}})[_0x02b0('0x19')](function(_0x421cec){logger[_0x02b0('0x16')](_0x02b0('0x12'),_0x53fcca,_0x421cec);_0x311702(_0x421cec);});});}exports[_0x02b0('0x1a')]=function(_0x49f862){var _0x47ae8e=this;return new Promise(function(_0x6532bd,_0x4f51c0){return db[_0x02b0('0x1b')][_0x02b0('0x1c')]({'raw':_0x49f862[_0x02b0('0x1d')]?_0x49f862['options'][_0x02b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x49f862[_0x02b0('0x1d')]?_0x49f862[_0x02b0('0x1d')][_0x02b0('0x1f')]||null:null,'attributes':_0x49f862['options']?_0x49f862[_0x02b0('0x1d')]['attributes']||null:null,'limit':_0x49f862[_0x02b0('0x1d')]?_0x49f862['options'][_0x02b0('0x20')]||null:null,'include':_0x49f862[_0x02b0('0x1d')]?_0x49f862[_0x02b0('0x1d')]['include']?_[_0x02b0('0x21')](_0x49f862[_0x02b0('0x1d')]['include'],function(_0x3842f0){return{'model':db[_0x3842f0[_0x02b0('0x22')]],'as':_0x3842f0['as'],'attributes':_0x3842f0['attributes'],'include':_0x3842f0['include']?_['map'](_0x3842f0[_0x02b0('0x23')],function(_0x2d78ab){return{'model':db[_0x2d78ab['model']],'as':_0x2d78ab['as'],'attributes':_0x2d78ab[_0x02b0('0x24')],'include':_0x2d78ab[_0x02b0('0x23')]?_[_0x02b0('0x21')](_0x2d78ab[_0x02b0('0x23')],function(_0x369ec7){return{'model':db[_0x369ec7[_0x02b0('0x22')]],'as':_0x369ec7['as'],'attributes':_0x369ec7[_0x02b0('0x24')]};}):[]};}):[]};}):[]:[]})[_0x02b0('0x25')](function(_0x2c7e21){logger[_0x02b0('0x11')]('GetWhatsappQueue',_0x49f862);logger[_0x02b0('0x14')]('GetWhatsappQueue',_0x49f862,JSON[_0x02b0('0x26')](_0x2c7e21));_0x6532bd(_0x2c7e21);})[_0x02b0('0x19')](function(_0x2e6a14){logger[_0x02b0('0x16')](_0x02b0('0x1a'),_0x2e6a14['message'],_0x49f862);_0x4f51c0(_0x47ae8e[_0x02b0('0x16')](0x1f4,_0x2e6a14['message']));});});};exports['ShowWhatsappQueue']=function(_0x51954c){var _0x5bf1b9=this;return new Promise(function(_0x44acc4,_0x471ecd){return db[_0x02b0('0x1b')][_0x02b0('0x27')]({'raw':_0x51954c['options']?_0x51954c['options']['raw']===undefined?!![]:![]:!![],'where':_0x51954c[_0x02b0('0x1d')]?_0x51954c[_0x02b0('0x1d')][_0x02b0('0x1f')]||null:null,'attributes':_0x51954c[_0x02b0('0x1d')]?_0x51954c[_0x02b0('0x1d')][_0x02b0('0x24')]||null:null,'include':_0x51954c['options']?_0x51954c[_0x02b0('0x1d')]['include']?_[_0x02b0('0x21')](_0x51954c[_0x02b0('0x1d')]['include'],function(_0x1235a5){return{'model':db[_0x1235a5[_0x02b0('0x22')]],'as':_0x1235a5['as'],'attributes':_0x1235a5[_0x02b0('0x24')],'include':_0x1235a5[_0x02b0('0x23')]?_[_0x02b0('0x21')](_0x1235a5[_0x02b0('0x23')],function(_0x4cfa15){return{'model':db[_0x4cfa15['model']],'as':_0x4cfa15['as'],'attributes':_0x4cfa15[_0x02b0('0x24')],'include':_0x4cfa15[_0x02b0('0x23')]?_['map'](_0x4cfa15[_0x02b0('0x23')],function(_0x398cad){return{'model':db[_0x398cad[_0x02b0('0x22')]],'as':_0x398cad['as'],'attributes':_0x398cad[_0x02b0('0x24')]};}):[]};}):[]};}):[]:[]})[_0x02b0('0x25')](function(_0x4af7b5){logger[_0x02b0('0x11')]('ShowWhatsappQueue',_0x51954c);logger['debug']('ShowWhatsappQueue',_0x51954c,JSON['stringify'](_0x4af7b5));_0x44acc4(_0x4af7b5);})[_0x02b0('0x19')](function(_0x43a6f2){logger[_0x02b0('0x16')]('ShowWhatsappQueue',_0x43a6f2[_0x02b0('0x18')],_0x51954c);_0x471ecd(_0x5bf1b9[_0x02b0('0x16')](0x1f4,_0x43a6f2['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 5f3c1f9..21410c8 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 _0xf155=['length','./whatsappQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf155,0x199));var _0x5f15=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0xf155[_0x1945a5];return _0x5817a5;};'use strict';var WhatsappQueueEvents=require(_0x5f15('0x0'));var events=[_0x5f15('0x1'),_0x5f15('0x2'),_0x5f15('0x3')];function createListener(_0x815850,_0xfd53a3){return function(_0x1e38ae){_0xfd53a3[_0x5f15('0x4')](_0x815850,_0x1e38ae);};}function removeListener(_0x1dcbaa,_0x5c81d9){return function(){WhatsappQueueEvents['removeListener'](_0x1dcbaa,_0x5c81d9);};}exports['register']=function(_0x381af1){for(var _0x73993b=0x0,_0x1f7291=events[_0x5f15('0x5')];_0x73993b<_0x1f7291;_0x73993b++){var _0x340718=events[_0x73993b];var _0x5dc1d2=createListener('whatsappQueue:'+_0x340718,_0x381af1);WhatsappQueueEvents['on'](_0x340718,_0x5dc1d2);}}; \ No newline at end of file +var _0x9ab5=['remove','update','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x9ab5,0x9e));var _0x59ab=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9ab5[_0x618414];return _0x21c19a;};'use strict';var WhatsappQueueEvents=require(_0x59ab('0x0'));var events=[_0x59ab('0x1'),_0x59ab('0x2'),_0x59ab('0x3')];function createListener(_0x5ad0a4,_0x31657b){return function(_0x1a0cfa){_0x31657b['emit'](_0x5ad0a4,_0x1a0cfa);};}function removeListener(_0x5bb30e,_0x476067){return function(){WhatsappQueueEvents[_0x59ab('0x4')](_0x5bb30e,_0x476067);};}exports[_0x59ab('0x5')]=function(_0x21651c){for(var _0x47bce4=0x0,_0x2cab1a=events[_0x59ab('0x6')];_0x47bce4<_0x2cab1a;_0x47bce4++){var _0x32b68f=events[_0x47bce4];var _0x346af2=createListener(_0x59ab('0x7')+_0x32b68f,_0x21651c);WhatsappQueueEvents['on'](_0x32b68f,_0x346af2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 581efe6..3697b67 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 _0xe0f2=['./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','update','delete','/:id','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x479f6f,_0x1c26c4){var _0x24e701=function(_0x5291dd){while(--_0x5291dd){_0x479f6f['push'](_0x479f6f['shift']());}};_0x24e701(++_0x1c26c4);}(_0xe0f2,0x67));var _0x2e0f=function(_0x363a81,_0x533e8d){_0x363a81=_0x363a81-0x0;var _0x1f139c=_0xe0f2[_0x363a81];return _0x1f139c;};'use strict';var multer=require(_0x2e0f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e0f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e0f('0x2'));var interaction=require(_0x2e0f('0x3'));var config=require(_0x2e0f('0x4'));var controller=require(_0x2e0f('0x5'));router[_0x2e0f('0x6')]('/',auth[_0x2e0f('0x7')](),controller[_0x2e0f('0x8')]);router[_0x2e0f('0x6')](_0x2e0f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x2e0f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2e0f('0xa')]);router[_0x2e0f('0xb')]('/',auth[_0x2e0f('0x7')](),controller['create']);router[_0x2e0f('0xc')]('/:id',auth[_0x2e0f('0x7')](),controller[_0x2e0f('0xd')]);router[_0x2e0f('0xe')](_0x2e0f('0xf'),auth[_0x2e0f('0x7')](),controller[_0x2e0f('0x10')]);module[_0x2e0f('0x11')]=router; \ No newline at end of file +var _0x5295=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post','create','put','/:id'];(function(_0xe6d40,_0x5509a5){var _0x2024e9=function(_0x8b3768){while(--_0x8b3768){_0xe6d40['push'](_0xe6d40['shift']());}};_0x2024e9(++_0x5509a5);}(_0x5295,0x14e));var _0x5529=function(_0xb61e6c,_0x181f81){_0xb61e6c=_0xb61e6c-0x0;var _0x2f88d5=_0x5295[_0xb61e6c];return _0x2f88d5;};'use strict';var multer=require('multer');var util=require(_0x5529('0x0'));var path=require(_0x5529('0x1'));var timeout=require('connect-timeout');var express=require(_0x5529('0x2'));var router=express[_0x5529('0x3')]();var fs_extra=require(_0x5529('0x4'));var auth=require(_0x5529('0x5'));var interaction=require(_0x5529('0x6'));var config=require('../../config/environment');var controller=require(_0x5529('0x7'));router['get']('/',auth[_0x5529('0x8')](),controller[_0x5529('0x9')]);router['get'](_0x5529('0xa'),auth[_0x5529('0x8')](),controller[_0x5529('0xb')]);router[_0x5529('0xc')]('/:id',auth[_0x5529('0x8')](),controller[_0x5529('0xd')]);router[_0x5529('0xe')]('/',auth[_0x5529('0x8')](),controller[_0x5529('0xf')]);router[_0x5529('0x10')](_0x5529('0x11'),auth[_0x5529('0x8')](),controller[_0x5529('0x12')]);router[_0x5529('0x13')](_0x5529('0x11'),auth[_0x5529('0x8')](),controller[_0x5529('0x14')]);module[_0x5529('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0d25ff2..d5b9cce 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(_0x5988ff,_0x145b06){var _0x3a8ec3=function(_0x9d2ff4){while(--_0x9d2ff4){_0x5988ff['push'](_0x5988ff['shift']());}};_0x3a8ec3(++_0x145b06);}(_0x7a54,0x106));var _0x47a5=function(_0x5709d0,_0x1560c6){_0x5709d0=_0x5709d0-0x0;var _0x3245ea=_0x7a54[_0x5709d0];return _0x3245ea;};'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(_0x3a26e6,_0x1314ab){var _0x53ac6f=function(_0x56564e){while(--_0x56564e){_0x3a26e6['push'](_0x3a26e6['shift']());}};_0x53ac6f(++_0x1314ab);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 a52bd5a..f49fea3 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 _0x0972=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','catch','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3683be,_0x1aa3cf){var _0x7e4c5b=function(_0x31bb47){while(--_0x31bb47){_0x3683be['push'](_0x3683be['shift']());}};_0x7e4c5b(++_0x1aa3cf);}(_0x0972,0x64));var _0x2097=function(_0x206e6c,_0x3c0c4e){_0x206e6c=_0x206e6c-0x0;var _0x423a21=_0x0972[_0x206e6c];return _0x423a21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];function respondWithStatusCode(_0x3b2f94,_0x170005){_0x170005=_0x170005||0xcc;return function(_0x16871b){if(_0x16871b){return _0x3b2f94[_0x2097('0x1a')](_0x170005);}return _0x3b2f94[_0x2097('0x1b')](_0x170005)[_0x2097('0x1c')]();};}function respondWithResult(_0x1c9ef9,_0x2c3e41){_0x2c3e41=_0x2c3e41||0xc8;return function(_0x354387){if(_0x354387){return _0x1c9ef9['status'](_0x2c3e41)[_0x2097('0x1d')](_0x354387);}};}function respondWithFilteredResult(_0x35c062,_0x4d31bc){return function(_0x4eec05){if(_0x4eec05){var _0x4fc8c5=typeof _0x4d31bc[_0x2097('0x1e')]==='undefined'&&typeof _0x4d31bc[_0x2097('0x1f')]===_0x2097('0x20');var _0x43fec9=_0x4eec05[_0x2097('0x21')];var _0x44c584=_0x4fc8c5?0x0:_0x4d31bc['offset'];var _0x324652=_0x4fc8c5?_0x4eec05[_0x2097('0x21')]:_0x4d31bc[_0x2097('0x1e')]+_0x4d31bc[_0x2097('0x1f')];var _0x1d3804;if(_0x324652>=_0x43fec9){_0x324652=_0x43fec9;_0x1d3804=0xc8;}else{_0x1d3804=0xce;}_0x35c062[_0x2097('0x1b')](_0x1d3804);return _0x35c062[_0x2097('0x22')](_0x2097('0x23'),_0x44c584+'-'+_0x324652+'/'+_0x43fec9)['json'](_0x4eec05);}return null;};}function patchUpdates(_0x4d957e){return function(_0xf65dc6){try{jsonpatch['apply'](_0xf65dc6,_0x4d957e,!![]);}catch(_0x227c00){return BPromise[_0x2097('0x24')](_0x227c00);}return _0xf65dc6['save']();};}function saveUpdates(_0x442db7,_0x5b0582){return function(_0x2e17c8){if(_0x2e17c8){return _0x2e17c8[_0x2097('0x25')](_0x442db7)[_0x2097('0x26')](function(_0x20b93a){return _0x20b93a;});}return null;};}function removeEntity(_0x36b15e,_0x35047b){return function(_0x56390a){if(_0x56390a){return _0x56390a[_0x2097('0x27')]()['then'](function(){_0x36b15e[_0x2097('0x1b')](0xcc)[_0x2097('0x1c')]();});}};}function handleEntityNotFound(_0x345875,_0x9f59bc){return function(_0x499988){if(!_0x499988){_0x345875[_0x2097('0x1a')](0x194);}return _0x499988;};}function handleError(_0x80c5ee,_0x56af3b){_0x56af3b=_0x56af3b||0x1f4;return function(_0x1229fc){logger['error'](_0x1229fc[_0x2097('0x28')]);if(_0x1229fc['name']){delete _0x1229fc[_0x2097('0x29')];}_0x80c5ee[_0x2097('0x1b')](_0x56af3b)[_0x2097('0x2a')](_0x1229fc);};}exports[_0x2097('0x2b')]=function(_0x410afa,_0x36228c){var _0x450e0b={},_0x4b443d={},_0x11242f={'count':0x0,'rows':[]};var _0x14d964=_['map'](db[_0x2097('0x2c')][_0x2097('0x2d')],function(_0x59fb84){return{'name':_0x59fb84['fieldName'],'type':_0x59fb84[_0x2097('0x2e')][_0x2097('0x2f')]};});_0x4b443d[_0x2097('0x30')]=_[_0x2097('0x31')](_0x14d964,_0x2097('0x29'));_0x4b443d[_0x2097('0x32')]=_['keys'](_0x410afa[_0x2097('0x32')]);_0x4b443d['filters']=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],_0x4b443d[_0x2097('0x32')]);_0x450e0b[_0x2097('0x34')]=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],qs[_0x2097('0x35')](_0x410afa[_0x2097('0x32')][_0x2097('0x35')]));_0x450e0b['attributes']=_0x450e0b[_0x2097('0x34')][_0x2097('0x36')]?_0x450e0b[_0x2097('0x34')]:_0x4b443d['model'];if(!_0x410afa[_0x2097('0x32')][_0x2097('0x37')](_0x2097('0x38'))){_0x450e0b[_0x2097('0x1f')]=qs['limit'](_0x410afa['query']['limit']);_0x450e0b[_0x2097('0x1e')]=qs[_0x2097('0x1e')](_0x410afa[_0x2097('0x32')][_0x2097('0x1e')]);}_0x450e0b[_0x2097('0x39')]=qs[_0x2097('0x3a')](_0x410afa['query'][_0x2097('0x3a')]);_0x450e0b[_0x2097('0x3b')]=qs[_0x2097('0x3c')](_[_0x2097('0x3d')](_0x410afa[_0x2097('0x32')],_0x4b443d[_0x2097('0x3c')]),_0x14d964);if(_0x410afa['query'][_0x2097('0x3e')]){_0x450e0b[_0x2097('0x3b')]=_[_0x2097('0x3f')](_0x450e0b['where'],{'$or':_['map'](_0x14d964,function(_0x57649e){if(_0x57649e[_0x2097('0x2e')]!==_0x2097('0x40')){var _0x85b01e={};_0x85b01e[_0x57649e[_0x2097('0x29')]]={'$like':'%'+_0x410afa[_0x2097('0x32')][_0x2097('0x3e')]+'%'};return _0x85b01e;}})});}_0x450e0b=_[_0x2097('0x3f')]({},_0x450e0b,_0x410afa[_0x2097('0x41')]);var _0x3bfb5c={'where':_0x450e0b[_0x2097('0x3b')]};return db[_0x2097('0x2c')]['count'](_0x3bfb5c)[_0x2097('0x26')](function(_0x2f5378){_0x11242f[_0x2097('0x21')]=_0x2f5378;if(_0x410afa['query'][_0x2097('0x42')]){_0x450e0b[_0x2097('0x43')]=[{'all':!![]}];}return db[_0x2097('0x2c')][_0x2097('0x44')](_0x450e0b);})[_0x2097('0x26')](function(_0xd4d89e){_0x11242f[_0x2097('0x45')]=_0xd4d89e;return _0x11242f;})[_0x2097('0x26')](respondWithFilteredResult(_0x36228c,_0x450e0b))['catch'](handleError(_0x36228c,null));};exports[_0x2097('0x46')]=function(_0x283adc,_0x186ca5){var _0x3288ae={'raw':!![],'where':{'id':_0x283adc[_0x2097('0x47')]['id']}},_0x12e0e2={};_0x12e0e2[_0x2097('0x30')]=_[_0x2097('0x48')](db['WhatsappQueueReport'][_0x2097('0x2d')]);_0x12e0e2['query']=_[_0x2097('0x48')](_0x283adc[_0x2097('0x32')]);_0x12e0e2[_0x2097('0x3c')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],_0x12e0e2['query']);_0x3288ae[_0x2097('0x34')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],qs[_0x2097('0x35')](_0x283adc[_0x2097('0x32')]['fields']));_0x3288ae[_0x2097('0x34')]=_0x3288ae[_0x2097('0x34')][_0x2097('0x36')]?_0x3288ae[_0x2097('0x34')]:_0x12e0e2[_0x2097('0x30')];if(_0x283adc[_0x2097('0x32')][_0x2097('0x42')]){_0x3288ae[_0x2097('0x43')]=[{'all':!![]}];}_0x3288ae=_['merge']({},_0x3288ae,_0x283adc[_0x2097('0x41')]);return db[_0x2097('0x2c')][_0x2097('0x49')](_0x3288ae)[_0x2097('0x26')](handleEntityNotFound(_0x186ca5,null))['then'](respondWithResult(_0x186ca5,null))['catch'](handleError(_0x186ca5,null));};exports['create']=function(_0xdf0b6e,_0x396979){return db['WhatsappQueueReport'][_0x2097('0x4a')](_0xdf0b6e[_0x2097('0x4b')],{})['then'](respondWithResult(_0x396979,0xc9))['catch'](handleError(_0x396979,null));};exports[_0x2097('0x25')]=function(_0x21829d,_0x1b4de6){if(_0x21829d['body']['id']){delete _0x21829d[_0x2097('0x4b')]['id'];}return db[_0x2097('0x2c')]['find']({'where':{'id':_0x21829d[_0x2097('0x47')]['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x1b4de6,null))[_0x2097('0x26')](saveUpdates(_0x21829d[_0x2097('0x4b')],null))[_0x2097('0x26')](respondWithResult(_0x1b4de6,null))['catch'](handleError(_0x1b4de6,null));};exports['destroy']=function(_0x140b41,_0x39f9cb){return db[_0x2097('0x2c')]['find']({'where':{'id':_0x140b41['params']['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x39f9cb,null))[_0x2097('0x26')](removeEntity(_0x39f9cb,null))['catch'](handleError(_0x39f9cb,null));};exports[_0x2097('0x4c')]=function(_0x33583e,_0x12bdbd){return db[_0x2097('0x2c')][_0x2097('0x4c')]()['then'](respondWithResult(_0x12bdbd,null))[_0x2097('0x4d')](handleError(_0x12bdbd,null));}; \ No newline at end of file +var _0xe1e3=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x34657b,_0x31f4ec){_0x34657b=_0x34657b-0x0;var _0x3c43c1=_0xe1e3[_0x34657b];return _0x3c43c1;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index b623461..bfd0d9f 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 _0x9558=['rimraf','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','lodash','api','moment','request-promise','path'];(function(_0x15aead,_0x102bbf){var _0x3aa800=function(_0x5b0d70){while(--_0x5b0d70){_0x15aead['push'](_0x15aead['shift']());}};_0x3aa800(++_0x102bbf);}(_0x9558,0x1bd));var _0x8955=function(_0x43251e,_0x584e7f){_0x43251e=_0x43251e-0x0;var _0x5c8edc=_0x9558[_0x43251e];return _0x5c8edc;};'use strict';var _=require(_0x8955('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8955('0x1'));var moment=require(_0x8955('0x2'));var BPromise=require('bluebird');var rp=require(_0x8955('0x3'));var fs=require('fs');var path=require(_0x8955('0x4'));var rimraf=require(_0x8955('0x5'));var config=require('../../config/environment');var attributes=require(_0x8955('0x6'));module[_0x8955('0x7')]=function(_0x294cc3,_0x56d9dd){return _0x294cc3['define']('WhatsappQueueReport',attributes,{'tableName':_0x8955('0x8'),'paranoid':![],'indexes':[{'name':_0x8955('0x9'),'fields':[_0x8955('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc375=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xc375,0x143));var _0x5c37=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xc375[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x5c37('0x0'));var util=require(_0x5c37('0x1'));var logger=require(_0x5c37('0x2'))('api');var moment=require(_0x5c37('0x3'));var BPromise=require(_0x5c37('0x4'));var rp=require(_0x5c37('0x5'));var fs=require('fs');var path=require(_0x5c37('0x6'));var rimraf=require(_0x5c37('0x7'));var config=require('../../config/environment');var attributes=require(_0x5c37('0x8'));module[_0x5c37('0x9')]=function(_0x49d1af,_0x4bac18){return _0x49d1af[_0x5c37('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x5c37('0xb'),'paranoid':![],'indexes':[{'name':_0x5c37('0xc'),'fields':[_0x5c37('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 159eb40..d93482b 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 _0x3646=['raw','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateWhatsappQueueReport','create','body','options'];(function(_0x35027c,_0x4af623){var _0x4bba7d=function(_0x1d84f9){while(--_0x1d84f9){_0x35027c['push'](_0x35027c['shift']());}};_0x4bba7d(++_0x4af623);}(_0x3646,0xab));var _0x6364=function(_0x3baf6b,_0x49e57b){_0x3baf6b=_0x3baf6b-0x0;var _0x4da69a=_0x3646[_0x3baf6b];return _0x4da69a;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var moment=require('moment');var BPromise=require(_0x6364('0x2'));var rs=require(_0x6364('0x3'));var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6364('0x8'));var client=jayson[_0x6364('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1db030,_0xd627da,_0x2a390b){return new BPromise(function(_0x165785,_0x2332df){return client[_0x6364('0xa')](_0x1db030,_0x2a390b)[_0x6364('0xb')](function(_0x11019e){logger['info'](_0x6364('0xc'),_0xd627da,_0x6364('0xd'));logger[_0x6364('0xe')](_0x6364('0xf'),_0xd627da,_0x6364('0xd'),JSON[_0x6364('0x10')](_0x11019e));if(_0x11019e[_0x6364('0x11')]){if(_0x11019e[_0x6364('0x11')][_0x6364('0x12')]===0x1f4){logger[_0x6364('0x11')](_0x6364('0xc'),_0xd627da,_0x11019e['error']['message']);return _0x2332df(_0x11019e['error']['message']);}logger[_0x6364('0x11')](_0x6364('0xc'),_0xd627da,_0x11019e['error'][_0x6364('0x13')]);return _0x165785(_0x11019e[_0x6364('0x11')][_0x6364('0x13')]);}else{logger[_0x6364('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0xd627da,'request\x20sent');_0x165785(_0x11019e[_0x6364('0x15')][_0x6364('0x13')]);}})[_0x6364('0x16')](function(_0x36eae9){logger['error'](_0x6364('0xc'),_0xd627da,_0x36eae9);_0x2332df(_0x36eae9);});});}exports[_0x6364('0x17')]=function(_0x4d0b76){var _0x9674ba=this;return new Promise(function(_0x216cbb,_0x35909c){return db['WhatsappQueueReport'][_0x6364('0x18')](_0x4d0b76[_0x6364('0x19')],{'raw':_0x4d0b76[_0x6364('0x1a')]?_0x4d0b76[_0x6364('0x1a')][_0x6364('0x1b')]===undefined?!![]:![]:!![]})[_0x6364('0xb')](function(_0x213da3){logger[_0x6364('0x14')](_0x6364('0x17'),_0x4d0b76);logger['debug']('CreateWhatsappQueueReport',_0x4d0b76,JSON[_0x6364('0x10')](_0x213da3));_0x216cbb(_0x213da3);})[_0x6364('0x16')](function(_0x42762e){logger[_0x6364('0x11')](_0x6364('0x17'),_0x42762e[_0x6364('0x13')],_0x4d0b76);_0x35909c(_0x9674ba[_0x6364('0x11')](0x1f4,_0x42762e[_0x6364('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x11187e){var _0x53b07f=this;return new Promise(function(_0xa85d14,_0x2195db){return db['WhatsappQueueReport'][_0x6364('0x1c')](_0x11187e['body'],{'raw':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11187e[_0x6364('0x1a')]?_0x11187e['options'][_0x6364('0x1d')]||null:null,'attributes':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1e')]||null:null,'limit':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1f')]||null:null})['then'](function(_0x23dc61){logger[_0x6364('0x14')](_0x6364('0x20'),_0x11187e);logger[_0x6364('0xe')](_0x6364('0x20'),_0x11187e,JSON[_0x6364('0x10')](_0x23dc61));_0xa85d14(_0x23dc61);})[_0x6364('0x16')](function(_0x3d8283){logger['error']('UpdateWhatsappQueueReport',_0x3d8283[_0x6364('0x13')],_0x11187e);_0x2195db(_0x53b07f[_0x6364('0x11')](0x1f4,_0x3d8283[_0x6364('0x13')]));});});}; \ No newline at end of file +var _0x827f=['WhatsappQueueReport,\x20%s,\x20%s','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','debug','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x827f,0x9b));var _0xf827=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x827f[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xf827('0x0'));var util=require(_0xf827('0x1'));var moment=require(_0xf827('0x2'));var BPromise=require(_0xf827('0x3'));var rs=require(_0xf827('0x4'));var fs=require('fs');var Redis=require(_0xf827('0x5'));var db=require(_0xf827('0x6'))['db'];var utils=require(_0xf827('0x7'));var logger=require('../../config/logger')(_0xf827('0x8'));var config=require(_0xf827('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf827('0xa')][_0xf827('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x335524,_0x177938,_0x5046c3){return new BPromise(function(_0x4cdea4,_0x578d64){return client[_0xf827('0xc')](_0x335524,_0x5046c3)[_0xf827('0xd')](function(_0x2c3c5e){logger[_0xf827('0xe')](_0xf827('0xf'),_0x177938,'request\x20sent');logger['debug'](_0xf827('0x10'),_0x177938,_0xf827('0x11'),JSON['stringify'](_0x2c3c5e));if(_0x2c3c5e['error']){if(_0x2c3c5e[_0xf827('0x12')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x177938,_0x2c3c5e[_0xf827('0x12')][_0xf827('0x13')]);return _0x578d64(_0x2c3c5e[_0xf827('0x12')][_0xf827('0x13')]);}logger[_0xf827('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x177938,_0x2c3c5e[_0xf827('0x12')]['message']);return _0x4cdea4(_0x2c3c5e['error']['message']);}else{logger[_0xf827('0xe')](_0xf827('0xf'),_0x177938,_0xf827('0x11'));_0x4cdea4(_0x2c3c5e[_0xf827('0x14')][_0xf827('0x13')]);}})[_0xf827('0x15')](function(_0x28288a){logger[_0xf827('0x12')](_0xf827('0xf'),_0x177938,_0x28288a);_0x578d64(_0x28288a);});});}exports['CreateWhatsappQueueReport']=function(_0x2f5ff3){var _0x34dec3=this;return new Promise(function(_0x4b73ba,_0x4f9627){return db[_0xf827('0x16')][_0xf827('0x17')](_0x2f5ff3[_0xf827('0x18')],{'raw':_0x2f5ff3[_0xf827('0x19')]?_0x2f5ff3['options'][_0xf827('0x1a')]===undefined?!![]:![]:!![]})[_0xf827('0xd')](function(_0x198a09){logger[_0xf827('0xe')](_0xf827('0x1b'),_0x2f5ff3);logger[_0xf827('0x1c')]('CreateWhatsappQueueReport',_0x2f5ff3,JSON['stringify'](_0x198a09));_0x4b73ba(_0x198a09);})[_0xf827('0x15')](function(_0x31e309){logger[_0xf827('0x12')](_0xf827('0x1b'),_0x31e309['message'],_0x2f5ff3);_0x4f9627(_0x34dec3['error'](0x1f4,_0x31e309[_0xf827('0x13')]));});});};exports[_0xf827('0x1d')]=function(_0x16872b){var _0x5992c6=this;return new Promise(function(_0x304a7a,_0x52341f){return db[_0xf827('0x16')][_0xf827('0x1e')](_0x16872b[_0xf827('0x18')],{'raw':_0x16872b[_0xf827('0x19')]?_0x16872b[_0xf827('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16872b['options']?_0x16872b[_0xf827('0x19')][_0xf827('0x1f')]||null:null,'attributes':_0x16872b[_0xf827('0x19')]?_0x16872b[_0xf827('0x19')][_0xf827('0x20')]||null:null,'limit':_0x16872b[_0xf827('0x19')]?_0x16872b[_0xf827('0x19')][_0xf827('0x21')]||null:null})[_0xf827('0xd')](function(_0x49f31f){logger[_0xf827('0xe')](_0xf827('0x1d'),_0x16872b);logger[_0xf827('0x1c')](_0xf827('0x1d'),_0x16872b,JSON['stringify'](_0x49f31f));_0x304a7a(_0x49f31f);})[_0xf827('0x15')](function(_0x5405ea){logger['error'](_0xf827('0x1d'),_0x5405ea[_0xf827('0x13')],_0x16872b);_0x52341f(_0x5992c6[_0xf827('0x12')](0x1f4,_0x5405ea[_0xf827('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 926b7ed..f6359eb 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 _0xfe41=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x5335c4,_0x3f1891){var _0x1c8659=function(_0x57e375){while(--_0x57e375){_0x5335c4['push'](_0x5335c4['shift']());}};_0x1c8659(++_0x3f1891);}(_0xfe41,0x131));var _0x1fe4=function(_0x1a49fc,_0x527071){_0x1a49fc=_0x1a49fc-0x0;var _0x5589fc=_0xfe41[_0x1a49fc];return _0x5589fc;};'use strict';var multer=require(_0x1fe4('0x0'));var util=require(_0x1fe4('0x1'));var path=require(_0x1fe4('0x2'));var timeout=require(_0x1fe4('0x3'));var express=require(_0x1fe4('0x4'));var router=express[_0x1fe4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1fe4('0x6'));var interaction=require(_0x1fe4('0x7'));var config=require(_0x1fe4('0x8'));var controller=require(_0x1fe4('0x9'));router[_0x1fe4('0xa')]('/',auth[_0x1fe4('0xb')](),controller['index']);router['get'](_0x1fe4('0xc'),auth['isAuthenticated'](),controller[_0x1fe4('0xd')]);router[_0x1fe4('0xa')]('/:id',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0xe')]);router[_0x1fe4('0xf')]('/',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x10')]);router[_0x1fe4('0x11')](_0x1fe4('0x12'),auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x13')]);router[_0x1fe4('0x14')]('/:id',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9e13=['/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e13,0x1aa));var _0x39e1=function(_0x457358,_0x3fd5cc){_0x457358=_0x457358-0x0;var _0x4e8463=_0x9e13[_0x457358];return _0x4e8463;};'use strict';var multer=require(_0x39e1('0x0'));var util=require(_0x39e1('0x1'));var path=require(_0x39e1('0x2'));var timeout=require(_0x39e1('0x3'));var express=require(_0x39e1('0x4'));var router=express[_0x39e1('0x5')]();var fs_extra=require(_0x39e1('0x6'));var auth=require(_0x39e1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x39e1('0x8'));var controller=require(_0x39e1('0x9'));router['get']('/',auth[_0x39e1('0xa')](),controller[_0x39e1('0xb')]);router[_0x39e1('0xc')](_0x39e1('0xd'),auth[_0x39e1('0xa')](),controller[_0x39e1('0xe')]);router['get'](_0x39e1('0xf'),auth[_0x39e1('0xa')](),controller[_0x39e1('0x10')]);router['post']('/',auth[_0x39e1('0xa')](),controller[_0x39e1('0x11')]);router['put']('/:id',auth[_0x39e1('0xa')](),controller['update']);router[_0x39e1('0x12')](_0x39e1('0xf'),auth['isAuthenticated'](),controller[_0x39e1('0x13')]);module[_0x39e1('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index e5dfa29..a087597 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 _0x2d07=['queue','DATE','sequelize','exports','ENUM','account'];(function(_0x2c1daa,_0x5cecf8){var _0x5e5bba=function(_0x328a4c){while(--_0x328a4c){_0x2c1daa['push'](_0x2c1daa['shift']());}};_0x5e5bba(++_0x5cecf8);}(_0x2d07,0x13a));var _0x72d0=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x2d07[_0x5c1cdc];return _0x2e8317;};'use strict';var Sequelize=require(_0x72d0('0x0'));module[_0x72d0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x72d0('0x2')](_0x72d0('0x3'),'agent',_0x72d0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x72d0('0x5')]}}; \ No newline at end of file +var _0x937d=['sequelize','account','agent','queue','DATE'];(function(_0x2f569e,_0x41de36){var _0x37376a=function(_0x35a05b){while(--_0x35a05b){_0x2f569e['push'](_0x2f569e['shift']());}};_0x37376a(++_0x41de36);}(_0x937d,0x1f4));var _0xd937=function(_0x252085,_0x9b7770){_0x252085=_0x252085-0x0;var _0x5bf7ef=_0x937d[_0x252085];return _0x5bf7ef;};'use strict';var Sequelize=require(_0xd937('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd937('0x1'),_0xd937('0x2'),_0xd937('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd937('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f4116dd..67ade8a 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 _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','WhatsappTransferReport','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(_0x2c83f2,_0x745d24){_0x2c83f2=_0x2c83f2-0x0;var _0x3b33b8=_0x9f0e[_0x2c83f2];return _0x3b33b8;};'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['WhatsappTransferReport'][_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['WhatsappTransferReport'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['WhatsappTransferReport'][_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 _0x0f4b=['ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','destroy','params','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0f4b,0x1a9));var _0xb0f4=function(_0x5d397a,_0x48cb91){_0x5d397a=_0x5d397a-0x0;var _0x108880=_0x0f4b[_0x5d397a];return _0x108880;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb0f4('0x0'));var jsonpatch=require(_0xb0f4('0x1'));var rp=require(_0xb0f4('0x2'));var moment=require(_0xb0f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0f4('0x4'));var path=require(_0xb0f4('0x5'));var sox=require(_0xb0f4('0x6'));var csv=require('to-csv');var ejs=require(_0xb0f4('0x7'));var fs=require('fs');var fs_extra=require(_0xb0f4('0x8'));var _=require(_0xb0f4('0x9'));var squel=require(_0xb0f4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0f4('0xb'));var toCsv=require(_0xb0f4('0xc'));var querystring=require(_0xb0f4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb0f4('0xe'));var as=require(_0xb0f4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0f4('0x10'))(_0xb0f4('0x11'));var utils=require(_0xb0f4('0x12'));var config=require(_0xb0f4('0x13'));var licenseUtil=require(_0xb0f4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34715b,_0x6b2e49){_0x6b2e49=_0x6b2e49||0xcc;return function(_0x4724c7){if(_0x4724c7){return _0x34715b['sendStatus'](_0x6b2e49);}return _0x34715b[_0xb0f4('0x15')](_0x6b2e49)[_0xb0f4('0x16')]();};}function respondWithResult(_0x328c92,_0x8673ca){_0x8673ca=_0x8673ca||0xc8;return function(_0x698f75){if(_0x698f75){return _0x328c92[_0xb0f4('0x15')](_0x8673ca)[_0xb0f4('0x17')](_0x698f75);}};}function respondWithFilteredResult(_0x2f54fc,_0x37fc0b){return function(_0x54e064){if(_0x54e064){var _0x2e8f70=typeof _0x37fc0b[_0xb0f4('0x18')]===_0xb0f4('0x19')&&typeof _0x37fc0b['limit']==='undefined';var _0x4b9148=_0x54e064[_0xb0f4('0x1a')];var _0x3d0b1f=_0x2e8f70?0x0:_0x37fc0b[_0xb0f4('0x18')];var _0x5855eb=_0x2e8f70?_0x54e064['count']:_0x37fc0b[_0xb0f4('0x18')]+_0x37fc0b['limit'];var _0x4e5d5a;if(_0x5855eb>=_0x4b9148){_0x5855eb=_0x4b9148;_0x4e5d5a=0xc8;}else{_0x4e5d5a=0xce;}_0x2f54fc['status'](_0x4e5d5a);return _0x2f54fc[_0xb0f4('0x1b')](_0xb0f4('0x1c'),_0x3d0b1f+'-'+_0x5855eb+'/'+_0x4b9148)[_0xb0f4('0x17')](_0x54e064);}return null;};}function patchUpdates(_0x1c8a80){return function(_0x4f624a){try{jsonpatch[_0xb0f4('0x1d')](_0x4f624a,_0x1c8a80,!![]);}catch(_0xaa66e){return BPromise[_0xb0f4('0x1e')](_0xaa66e);}return _0x4f624a[_0xb0f4('0x1f')]();};}function saveUpdates(_0x5b5a63,_0x104555){return function(_0x107f11){if(_0x107f11){return _0x107f11[_0xb0f4('0x20')](_0x5b5a63)['then'](function(_0x74ac11){return _0x74ac11;});}return null;};}function removeEntity(_0x1f445f,_0x4a7233){return function(_0x2aeb5f){if(_0x2aeb5f){return _0x2aeb5f['destroy']()[_0xb0f4('0x21')](function(){_0x1f445f[_0xb0f4('0x15')](0xcc)[_0xb0f4('0x16')]();});}};}function handleEntityNotFound(_0x69d5fa,_0x134e55){return function(_0x33015d){if(!_0x33015d){_0x69d5fa[_0xb0f4('0x22')](0x194);}return _0x33015d;};}function handleError(_0x120448,_0x164f9c){_0x164f9c=_0x164f9c||0x1f4;return function(_0x289d9){logger['error'](_0x289d9[_0xb0f4('0x23')]);if(_0x289d9[_0xb0f4('0x24')]){delete _0x289d9[_0xb0f4('0x24')];}_0x120448[_0xb0f4('0x15')](_0x164f9c)[_0xb0f4('0x25')](_0x289d9);};}exports[_0xb0f4('0x26')]=function(_0x50677e,_0x123e1e){var _0x2ccbf8={},_0x41c34d={},_0x499ea8={'count':0x0,'rows':[]};var _0x3eb3a8=_[_0xb0f4('0x27')](db[_0xb0f4('0x28')][_0xb0f4('0x29')],function(_0x3fa2a3){return{'name':_0x3fa2a3[_0xb0f4('0x2a')],'type':_0x3fa2a3[_0xb0f4('0x2b')][_0xb0f4('0x2c')]};});_0x41c34d[_0xb0f4('0x2d')]=_['map'](_0x3eb3a8,_0xb0f4('0x24'));_0x41c34d[_0xb0f4('0x2e')]=_[_0xb0f4('0x2f')](_0x50677e[_0xb0f4('0x2e')]);_0x41c34d['filters']=_['intersection'](_0x41c34d[_0xb0f4('0x2d')],_0x41c34d[_0xb0f4('0x2e')]);_0x2ccbf8['attributes']=_[_0xb0f4('0x30')](_0x41c34d['model'],qs[_0xb0f4('0x31')](_0x50677e[_0xb0f4('0x2e')][_0xb0f4('0x31')]));_0x2ccbf8[_0xb0f4('0x32')]=_0x2ccbf8['attributes'][_0xb0f4('0x33')]?_0x2ccbf8['attributes']:_0x41c34d[_0xb0f4('0x2d')];if(!_0x50677e[_0xb0f4('0x2e')][_0xb0f4('0x34')]('nolimit')){_0x2ccbf8[_0xb0f4('0x35')]=qs[_0xb0f4('0x35')](_0x50677e[_0xb0f4('0x2e')]['limit']);_0x2ccbf8[_0xb0f4('0x18')]=qs['offset'](_0x50677e[_0xb0f4('0x2e')]['offset']);}_0x2ccbf8['order']=qs[_0xb0f4('0x36')](_0x50677e[_0xb0f4('0x2e')][_0xb0f4('0x36')]);_0x2ccbf8[_0xb0f4('0x37')]=qs[_0xb0f4('0x38')](_[_0xb0f4('0x39')](_0x50677e['query'],_0x41c34d['filters']),_0x3eb3a8);if(_0x50677e[_0xb0f4('0x2e')][_0xb0f4('0x3a')]){_0x2ccbf8[_0xb0f4('0x37')]=_[_0xb0f4('0x3b')](_0x2ccbf8['where'],{'$or':_[_0xb0f4('0x27')](_0x3eb3a8,function(_0x1f5ff6){if(_0x1f5ff6[_0xb0f4('0x2b')]!=='VIRTUAL'){var _0x1e82c5={};_0x1e82c5[_0x1f5ff6[_0xb0f4('0x24')]]={'$like':'%'+_0x50677e[_0xb0f4('0x2e')]['filter']+'%'};return _0x1e82c5;}})});}_0x2ccbf8=_[_0xb0f4('0x3b')]({},_0x2ccbf8,_0x50677e[_0xb0f4('0x3c')]);var _0x160486={'where':_0x2ccbf8[_0xb0f4('0x37')]};return db[_0xb0f4('0x28')][_0xb0f4('0x1a')](_0x160486)[_0xb0f4('0x21')](function(_0x279bf5){_0x499ea8[_0xb0f4('0x1a')]=_0x279bf5;if(_0x50677e[_0xb0f4('0x2e')][_0xb0f4('0x3d')]){_0x2ccbf8[_0xb0f4('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x2ccbf8);})[_0xb0f4('0x21')](function(_0x4566e9){_0x499ea8[_0xb0f4('0x3f')]=_0x4566e9;return _0x499ea8;})['then'](respondWithFilteredResult(_0x123e1e,_0x2ccbf8))[_0xb0f4('0x40')](handleError(_0x123e1e,null));};exports[_0xb0f4('0x41')]=function(_0x34b3ae,_0x14dc57){var _0x5c9616={'raw':!![],'where':{'id':_0x34b3ae['params']['id']}},_0x1db482={};_0x1db482[_0xb0f4('0x2d')]=_['keys'](db[_0xb0f4('0x28')][_0xb0f4('0x29')]);_0x1db482[_0xb0f4('0x2e')]=_['keys'](_0x34b3ae[_0xb0f4('0x2e')]);_0x1db482['filters']=_[_0xb0f4('0x30')](_0x1db482[_0xb0f4('0x2d')],_0x1db482[_0xb0f4('0x2e')]);_0x5c9616['attributes']=_['intersection'](_0x1db482[_0xb0f4('0x2d')],qs[_0xb0f4('0x31')](_0x34b3ae['query'][_0xb0f4('0x31')]));_0x5c9616['attributes']=_0x5c9616[_0xb0f4('0x32')][_0xb0f4('0x33')]?_0x5c9616[_0xb0f4('0x32')]:_0x1db482[_0xb0f4('0x2d')];if(_0x34b3ae[_0xb0f4('0x2e')]['includeAll']){_0x5c9616[_0xb0f4('0x3e')]=[{'all':!![]}];}_0x5c9616=_[_0xb0f4('0x3b')]({},_0x5c9616,_0x34b3ae[_0xb0f4('0x3c')]);return db[_0xb0f4('0x28')][_0xb0f4('0x42')](_0x5c9616)['then'](handleEntityNotFound(_0x14dc57,null))[_0xb0f4('0x21')](respondWithResult(_0x14dc57,null))[_0xb0f4('0x40')](handleError(_0x14dc57,null));};exports[_0xb0f4('0x43')]=function(_0x21a065,_0x323cb1){return db[_0xb0f4('0x28')]['create'](_0x21a065[_0xb0f4('0x44')],{})['then'](respondWithResult(_0x323cb1,0xc9))[_0xb0f4('0x40')](handleError(_0x323cb1,null));};exports[_0xb0f4('0x20')]=function(_0x55704d,_0x5fe634){if(_0x55704d[_0xb0f4('0x44')]['id']){delete _0x55704d[_0xb0f4('0x44')]['id'];}return db['WhatsappTransferReport'][_0xb0f4('0x42')]({'where':{'id':_0x55704d['params']['id']}})[_0xb0f4('0x21')](handleEntityNotFound(_0x5fe634,null))[_0xb0f4('0x21')](saveUpdates(_0x55704d[_0xb0f4('0x44')],null))[_0xb0f4('0x21')](respondWithResult(_0x5fe634,null))[_0xb0f4('0x40')](handleError(_0x5fe634,null));};exports[_0xb0f4('0x45')]=function(_0x28d9d4,_0x4d1846){return db[_0xb0f4('0x28')]['find']({'where':{'id':_0x28d9d4[_0xb0f4('0x46')]['id']}})[_0xb0f4('0x21')](handleEntityNotFound(_0x4d1846,null))[_0xb0f4('0x21')](removeEntity(_0x4d1846,null))[_0xb0f4('0x40')](handleError(_0x4d1846,null));};exports[_0xb0f4('0x47')]=function(_0x4220b9,_0x30f9aa){return db[_0xb0f4('0x28')]['describe']()[_0xb0f4('0x21')](respondWithResult(_0x30f9aa,null))[_0xb0f4('0x40')](handleError(_0x30f9aa,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9b141f7..1d7a46b 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 _0x3099=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x41d7e4,_0x400232){var _0xd4a044=function(_0x2f2fd4){while(--_0x2f2fd4){_0x41d7e4['push'](_0x41d7e4['shift']());}};_0xd4a044(++_0x400232);}(_0x3099,0x113));var _0x9309=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3099[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9309('0x0'));var util=require(_0x9309('0x1'));var logger=require(_0x9309('0x2'))(_0x9309('0x3'));var moment=require(_0x9309('0x4'));var BPromise=require(_0x9309('0x5'));var rp=require(_0x9309('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9309('0x7'));var config=require(_0x9309('0x8'));var attributes=require(_0x9309('0x9'));module[_0x9309('0xa')]=function(_0x65a498,_0x180e4f){return _0x65a498[_0x9309('0xb')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9309('0xc'),'fields':[_0x9309('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7a6=['../../config/environment','exports','WhatsappTransferReport','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xe7a6,0x1c5));var _0x6e7a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe7a6[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6e7a('0x0'));var util=require(_0x6e7a('0x1'));var logger=require(_0x6e7a('0x2'))(_0x6e7a('0x3'));var moment=require(_0x6e7a('0x4'));var BPromise=require(_0x6e7a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e7a('0x6'));var rimraf=require('rimraf');var config=require(_0x6e7a('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x6e7a('0x8')]=function(_0x53bdd7,_0x55ca89){return _0x53bdd7['define'](_0x6e7a('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','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 91053cf..1f7dd75 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 _0x4b78=['code','error','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4b78,0x90));var _0x84b7=function(_0x438028,_0x3dc7fb){_0x438028=_0x438028-0x0;var _0xe07257=_0x4b78[_0x438028];return _0xe07257;};'use strict';var _=require('lodash');var util=require(_0x84b7('0x0'));var moment=require(_0x84b7('0x1'));var BPromise=require(_0x84b7('0x2'));var rs=require(_0x84b7('0x3'));var fs=require('fs');var Redis=require(_0x84b7('0x4'));var db=require(_0x84b7('0x5'))['db'];var utils=require(_0x84b7('0x6'));var logger=require(_0x84b7('0x7'))(_0x84b7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x84b7('0x9')][_0x84b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9dc8,_0x48269b,_0x5b2348){return new BPromise(function(_0x1786b7,_0x51a571){return client[_0x84b7('0xb')](_0x4e9dc8,_0x5b2348)[_0x84b7('0xc')](function(_0x2a52df){logger[_0x84b7('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x84b7('0xe'));logger[_0x84b7('0xf')](_0x84b7('0x10'),_0x48269b,_0x84b7('0xe'),JSON['stringify'](_0x2a52df));if(_0x2a52df['error']){if(_0x2a52df['error'][_0x84b7('0x11')]===0x1f4){logger[_0x84b7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);return _0x51a571(_0x2a52df['error'][_0x84b7('0x13')]);}logger[_0x84b7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);return _0x1786b7(_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);}else{logger[_0x84b7('0xd')](_0x84b7('0x14'),_0x48269b,_0x84b7('0xe'));_0x1786b7(_0x2a52df[_0x84b7('0x15')]['message']);}})[_0x84b7('0x16')](function(_0xf68e0f){logger[_0x84b7('0x12')](_0x84b7('0x14'),_0x48269b,_0xf68e0f);_0x51a571(_0xf68e0f);});});} \ No newline at end of file +var _0x24a3=['jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','info','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x200292,_0x50149c){var _0x3656ac=function(_0xe70484){while(--_0xe70484){_0x200292['push'](_0x200292['shift']());}};_0x3656ac(++_0x50149c);}(_0x24a3,0x1f0));var _0x324a=function(_0x1c9be8,_0x460eef){_0x1c9be8=_0x1c9be8-0x0;var _0x5619e2=_0x24a3[_0x1c9be8];return _0x5619e2;};'use strict';var _=require(_0x324a('0x0'));var util=require('util');var moment=require(_0x324a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x324a('0x2'));var db=require(_0x324a('0x3'))['db'];var utils=require(_0x324a('0x4'));var logger=require(_0x324a('0x5'))(_0x324a('0x6'));var config=require(_0x324a('0x7'));var jayson=require(_0x324a('0x8'));var client=jayson[_0x324a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30d6c7,_0x5905a0,_0x4242b0){return new BPromise(function(_0x2ae6cc,_0x18957f){return client[_0x324a('0xa')](_0x30d6c7,_0x4242b0)[_0x324a('0xb')](function(_0x3e77be){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x5905a0,_0x324a('0xc'));logger[_0x324a('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5905a0,_0x324a('0xc'),JSON[_0x324a('0xe')](_0x3e77be));if(_0x3e77be[_0x324a('0xf')]){if(_0x3e77be[_0x324a('0xf')][_0x324a('0x10')]===0x1f4){logger[_0x324a('0xf')](_0x324a('0x11'),_0x5905a0,_0x3e77be['error']['message']);return _0x18957f(_0x3e77be[_0x324a('0xf')][_0x324a('0x12')]);}logger[_0x324a('0xf')](_0x324a('0x11'),_0x5905a0,_0x3e77be['error'][_0x324a('0x12')]);return _0x2ae6cc(_0x3e77be[_0x324a('0xf')][_0x324a('0x12')]);}else{logger[_0x324a('0x13')](_0x324a('0x11'),_0x5905a0,_0x324a('0xc'));_0x2ae6cc(_0x3e77be['result'][_0x324a('0x12')]);}})[_0x324a('0x14')](function(_0x55972e){logger[_0x324a('0xf')](_0x324a('0x11'),_0x5905a0,_0x55972e);_0x18957f(_0x55972e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 7a5d908..ab5beec 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a0b=['catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','log'];(function(_0x5d82bb,_0x3c4097){var _0x1f9676=function(_0x35914a){while(--_0x35914a){_0x5d82bb['push'](_0x5d82bb['shift']());}};_0x1f9676(++_0x3c4097);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x466c68,_0x220577){_0x466c68=_0x466c68-0x0;var _0x9c7ba8=_0x1a0b[_0x466c68];return _0x9c7ba8;};'use strict';var _=require(_0xb1a0('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xb1a0('0x1'));var checkLicense=require(_0xb1a0('0x2'));var rpc=require(_0xb1a0('0x3'));var config=require(_0xb1a0('0x4'));var logger=require(_0xb1a0('0x5'))(_0xb1a0('0x6'));var pm2=require(_0xb1a0('0x7'));var pm2Config=require(_0xb1a0('0x8'));var schedule=require(_0xb1a0('0x9'));var chat=require(_0xb1a0('0xa'));var whatsapp=require(_0xb1a0('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xb1a0('0xc')]['sync']()['then'](function(){if(config[_0xb1a0('0xd')]){return seedDb[_0xb1a0('0xe')]();}})[_0xb1a0('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xb1a0('0x10')]();})[_0xb1a0('0xf')](function(_0x16c4fb){logger[_0xb1a0('0x11')](_0x16c4fb);return chat[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(){return whatsapp['start']();})[_0xb1a0('0xf')](function(){return schedule[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(){return transcribe['start']();})[_0xb1a0('0xf')](function(){return provider[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(_0x180c44){logger['info'](_0x180c44);return pm2[_0xb1a0('0x12')](pm2Config);})[_0xb1a0('0xf')](function(_0x171d06){var _0x209b89=_0x171d06[_0xb1a0('0x13')](function(_0x3b9724){return typeof _0x3b9724[_0xb1a0('0x14')]===_0xb1a0('0x15')&&_0x3b9724[_0xb1a0('0x14')]>=0x0;});if(_0x209b89[_0xb1a0('0x16')]>0x0){throw new Error(_0x209b89[_0xb1a0('0x16')]+_0xb1a0('0x17')+_[_0xb1a0('0x18')](_0x209b89,function(_0x3e6d71){return'\x22'+_0x3e6d71[_0xb1a0('0x19')][_0xb1a0('0x1a')]+'\x22';}));}logger[_0xb1a0('0x11')]('Online\x20apps:',_['map'](_['filter'](_0x171d06,{'status':'online'}),'name')['join']());logger['info']('Offline\x20apps:',_[_0xb1a0('0x18')](_[_0xb1a0('0x13')](_0x171d06,function(_0x3af888){return _0x3af888['status']!==_0xb1a0('0x1b');}),_0xb1a0('0x1a'))[_0xb1a0('0x1c')]()||'None');console[_0xb1a0('0x1d')]('App\x20Ready!');})[_0xb1a0('0x1e')](function(_0x301514){console[_0xb1a0('0x1d')](_0xb1a0('0x1f'),_0x301514);logger['error'](_0xb1a0('0x20'),_0x301514);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xed1f=['sync','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','filter','online','name','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize'];(function(_0xe3fb68,_0x357e5b){var _0x1ba0a3=function(_0x3c3c79){while(--_0x3c3c79){_0xe3fb68['push'](_0xe3fb68['shift']());}};_0x1ba0a3(++_0x357e5b);}(_0xed1f,0x170));var _0xfed1=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xed1f[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xfed1('0x0'));var db=require(_0xfed1('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0xfed1('0x2'));var config=require('./config/environment');var logger=require(_0xfed1('0x3'))('app');var pm2=require(_0xfed1('0x4'));var pm2Config=require(_0xfed1('0x5'));var schedule=require(_0xfed1('0x6'));var chat=require(_0xfed1('0x7'));var whatsapp=require(_0xfed1('0x8'));var transcribe=require(_0xfed1('0x9'));var provider=require(_0xfed1('0xa'));function main(){return db[_0xfed1('0xb')][_0xfed1('0xc')]()[_0xfed1('0xd')](function(){if(config['seedDB']){return seedDb[_0xfed1('0xe')]();}})[_0xfed1('0xd')](function(){return checkLicense[_0xfed1('0xe')]();})['then'](function(){return rpc[_0xfed1('0xf')]();})['then'](function(_0x5d94ce){logger[_0xfed1('0x10')](_0x5d94ce);return chat[_0xfed1('0x11')]();})['then'](function(){return whatsapp['start']();})[_0xfed1('0xd')](function(){return schedule[_0xfed1('0x11')]();})['then'](function(){return transcribe[_0xfed1('0x11')]();})['then'](function(){return provider[_0xfed1('0x11')]();})[_0xfed1('0xd')](function(_0x445d36){logger[_0xfed1('0x10')](_0x445d36);return pm2['start'](pm2Config);})[_0xfed1('0xd')](function(_0x3754c2){var _0x4a0f51=_0x3754c2['filter'](function(_0x176227){return typeof _0x176227[_0xfed1('0x12')]===_0xfed1('0x13')&&_0x176227['exitCode']>=0x0;});if(_0x4a0f51[_0xfed1('0x14')]>0x0){throw new Error(_0x4a0f51[_0xfed1('0x14')]+_0xfed1('0x15')+_[_0xfed1('0x16')](_0x4a0f51,function(_0x5ab809){return'\x22'+_0x5ab809[_0xfed1('0x17')]['name']+'\x22';}));}logger[_0xfed1('0x10')](_0xfed1('0x18'),_[_0xfed1('0x16')](_[_0xfed1('0x19')](_0x3754c2,{'status':_0xfed1('0x1a')}),_0xfed1('0x1b'))[_0xfed1('0x1c')]());logger[_0xfed1('0x10')](_0xfed1('0x1d'),_['map'](_[_0xfed1('0x19')](_0x3754c2,function(_0x491497){return _0x491497[_0xfed1('0x1e')]!==_0xfed1('0x1a');}),_0xfed1('0x1b'))[_0xfed1('0x1c')]()||_0xfed1('0x1f'));console[_0xfed1('0x20')](_0xfed1('0x21'));})[_0xfed1('0x22')](function(_0x484f8a){console['log'](_0xfed1('0x23'),_0x484f8a);logger['error'](_0xfed1('0x24'),_0x484f8a);process[_0xfed1('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c470e2e..57057c0 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 _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x3cdc8a,_0x4bf272){var _0x5af324=function(_0x4b0539){while(--_0x4b0539){_0x3cdc8a['push'](_0x3cdc8a['shift']());}};_0x5af324(++_0x4bf272);}(_0x34e8,0x12c));var _0x834e=function(_0x4a7d53,_0xcb3c3a){_0x4a7d53=_0x4a7d53-0x0;var _0x268c62=_0x34e8[_0x4a7d53];return _0x268c62;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});} \ No newline at end of file +var _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x2ffc1e,_0x2c3b27){var _0x3014d1=function(_0x50ca45){while(--_0x50ca45){_0x2ffc1e['push'](_0x2ffc1e['shift']());}};_0x3014d1(++_0x2c3b27);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 604ff03..7e1e561 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(_0x3f0fd0,_0x599d6f){var _0x3ee3f8=function(_0x4124a1){while(--_0x4124a1){_0x3f0fd0['push'](_0x3f0fd0['shift']());}};_0x3ee3f8(++_0x599d6f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d5c49,_0x528f94){_0x5d5c49=_0x5d5c49-0x0;var _0x41cb72=_0x0b0e[_0x5d5c49];return _0x41cb72;};'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 _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x17f02a,_0x550941){var _0x527154=function(_0x220bfd){while(--_0x220bfd){_0x17f02a['push'](_0x17f02a['shift']());}};_0x527154(++_0x550941);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 00fb052..5a8eebc 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 _0xac1f=['CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','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','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','DATE','buildExpression','type','default','value','start','end','map','clause','and','tags','ids','User','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','agent','getLists','attributes','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','color','keyBy','QueryTypes','SELECT'];(function(_0x32b9d2,_0x273b5d){var _0x5af2e3=function(_0x2549bc){while(--_0x2549bc){_0x32b9d2['push'](_0x32b9d2['shift']());}};_0x5af2e3(++_0x273b5d);}(_0xac1f,0xed));var _0xfac1=function(_0x22c82f,_0x26c2fb){_0x22c82f=_0x22c82f-0x0;var _0x1348d7=_0xac1f[_0x22c82f];return _0x1348d7;};'use strict';var _=require(_0xfac1('0x0'));var squel=require(_0xfac1('0x1'));var as=require(_0xfac1('0x2'));var qs=require(_0xfac1('0x3'));var utils=require(_0xfac1('0x4'));var db=require(_0xfac1('0x5'))['db'];function skipContactsQuery(_0xb87bf6,_0x16da16){var _0x19d65f=![];if(_0xb87bf6[_0xfac1('0x6')]==='agent'&&!_0x16da16[_0xfac1('0x7')]&&!_0x16da16[_0xfac1('0x8')]&&_0x16da16['autocomplete']!==_0xfac1('0x9')){_0x19d65f=!![];}return _0x19d65f;}function getContactsSubquery(){return squel[_0xfac1('0xa')]()[_0xfac1('0xb')](_0xfac1('0xc'),'c')[_0xfac1('0xd')](_0xfac1('0xe'));}function applyJoinClauses(_0x223f75,_0x5690e4){var _0x221240=_0x5690e4?'c':_0xfac1('0xf');_0x223f75['left_join']('cm_user_has_contacts','uc',_0xfac1('0x10')+_0x221240+_0xfac1('0x11'))['left_join'](_0xfac1('0x12'),'ct',_0xfac1('0x13')+_0x221240+_0xfac1('0x11'))['left_join'](_0xfac1('0x14'),'t','t.id\x20=\x20ct.TagId');return _0x223f75;}function addFieldsToQuery(_0x128465,_0x451a83,_0x3f3a30,_0x425a0c,_0x50716c){var _0x241cc7=_0x50716c?'c':_0xfac1('0xf');if(!_0x451a83){_0x451a83=['id',_0xfac1('0x15'),_0xfac1('0x16'),_0xfac1('0x17'),_0xfac1('0x18'),_0xfac1('0x19'),_0xfac1('0x1a'),_0xfac1('0x8'),'CompanyId',_0xfac1('0x1b'),_0xfac1('0x1c'),_0xfac1('0x1d'),_0xfac1('0x1e')];}else if(!_0x451a83[_0xfac1('0x1f')]('id')){_0x451a83[_0xfac1('0x20')]('id');}var _0x28498c=_0x3f3a30&&_0x50716c||!_0x3f3a30&&!_0x50716c;if(_0x425a0c){_0x28498c=_0x425a0c&&_0x50716c||!_0x425a0c&&!_0x50716c;}_0x451a83[_0xfac1('0x21')](function(_0x46565a){if(_0x46565a==='TagIds'){if(_0x28498c){_0x128465[_0xfac1('0x22')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x46565a);}else if(_0x3f3a30||_0x425a0c){_0x128465[_0xfac1('0x22')](_0x241cc7+'.'+_0x46565a);}}else{_0x128465[_0xfac1('0x22')](_0x241cc7+'.'+_0x46565a);}});return _0x128465;}function getSqlClauses(){var _0xa4a3a2={'default':squel[_0xfac1('0x23')](),'fields':squel['expr'](),'filter':squel[_0xfac1('0x23')](),'tags':{'clause':squel[_0xfac1('0x23')](),'ids':null},'user':{'clause':squel[_0xfac1('0x23')](),'skip':![]}};return _0xa4a3a2;}function parseTagParameter(_0x446b2b){var _0x1223ec=squel[_0xfac1('0x23')]();if(_0x446b2b){var _0x536746=utils[_0xfac1('0x24')](_0x446b2b);_0x536746[_0xfac1('0x21')](function(_0x336a50){_0x1223ec['or'](_0xfac1('0x25'),'%,'+_0x336a50+',%');});}return _0x1223ec;}function parseSearchFilter(_0x32e950){var _0x3cd5ff=squel[_0xfac1('0x23')]();if(_0x32e950){var _0x124419=_0x32e950[_0xfac1('0x26')]('\x5c','\x5c\x5c')[_0xfac1('0x26')](/'/g,'\x27\x27');if(_0x124419[_0xfac1('0x27')]('\x20')[_0xfac1('0x28')]>0x1){_0x3cd5ff['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfac1('0x29')](_0x124419),null);}else{if(qs[_0xfac1('0x2a')](_0x124419)){_0x3cd5ff['or']('c.id\x20LIKE\x20?',_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2b'),_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2c'),_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2d'),_0x124419+'%');}else if(qs[_0xfac1('0x2e')](_0x124419)){_0x3cd5ff['or']('c.email\x20LIKE\x20?',_0x124419+'%');}else{_0x3cd5ff['or'](_0xfac1('0x2f'),'%'+_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x30'),'%'+_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x31'),'%'+_0x124419+'%');}}}return _0x3cd5ff;}function parseAdvancedSearchFilter(_0x21951d,_0x2d420a){var _0x1ccfa6=getSqlClauses();var _0x3d3caa=as[_0xfac1('0x32')](_0x21951d);var _0x3bd200=_0x3d3caa[_0xfac1('0x33')];for(var _0xe24221=0x0;_0xe24221<_0x3d3caa[_0xfac1('0x34')][_0xfac1('0x28')];_0xe24221++){var _0x5fca73=_0x3d3caa[_0xfac1('0x34')][_0xe24221];var _0x7e8cfb='c';var _0x308bbe=_[_0xfac1('0x35')](_0x2d420a,[_0xfac1('0x36'),_0x5fca73['field']]);if(_0x308bbe){if(_0x5fca73[_0xfac1('0x22')]===_0xfac1('0x37')||_0x308bbe[_0xfac1('0x38')]==='datetime'){_0x5fca73['castTo']=_0xfac1('0x39');}var _0x2e40d7=as[_0xfac1('0x3a')](_0x7e8cfb,_0x308bbe[_0xfac1('0x3b')],_0x5fca73);_0x1ccfa6[_0xfac1('0x3c')][_0x3bd200](_0x2e40d7['text'],_0x2e40d7[_0xfac1('0x3d')][_0xfac1('0x3e')],_0x2e40d7[_0xfac1('0x3d')][_0xfac1('0x3f')]);}else{if(_0x5fca73[_0xfac1('0x22')]==='Tag'){var _0x4f6f85=_0x5fca73['value'][_0xfac1('0x27')](',')[_0xfac1('0x40')](function(_0x345224){return Number(_0x345224);});var _0x2cedab=parseTagParameter(_0x4f6f85);_0x1ccfa6['tags'][_0xfac1('0x41')][_0xfac1('0x42')](_0x2cedab);_0x1ccfa6[_0xfac1('0x43')][_0xfac1('0x44')]=_0x4f6f85;}else if(_0x5fca73['field']===_0xfac1('0x45')){_0x1ccfa6['user'][_0xfac1('0x41')]['and'](_0xfac1('0x46'),_0x5fca73[_0xfac1('0x3d')]);_0x1ccfa6['user'][_0xfac1('0x47')]=!![];}}}return _0x1ccfa6;}function parseModelFields(_0x892593,_0x53d364){var _0x183232=squel[_0xfac1('0x23')]();var _0x90969f=_(_0x892593)[_0xfac1('0x48')]()['map'](function(_0x310317){return _[_0xfac1('0x49')](_0x53d364,['name',_0x310317])?_0x310317:undefined;})[_0xfac1('0x4a')]()[_0xfac1('0x3d')]();if(_0x892593[_0xfac1('0x4b')]){_0x90969f['push'](_0xfac1('0x4b'));}if(_0x90969f[_0xfac1('0x28')]>0x0){_0x90969f[_0xfac1('0x21')](function(_0x136724){if(_0x136724===_0xfac1('0x8')){_0x183232['and'](_0xfac1('0x4c'),[][_0xfac1('0x4d')](_0x892593[_0x136724]));}else if(_0x136724===_0xfac1('0x4b')){var _0x5845ab='%'+_0x892593[_0x136724]+'%';_0x183232['and'](_0xfac1('0x4e'),_0x5845ab);}else{_0x183232['and']('c.'+_0x136724+_0xfac1('0x4f'),_0x892593[_0x136724]);}});}return _0x183232;}function parseQueryParameters(_0x163fd6,_0x24042a){var _0x59a066=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x163fd6,_0x24042a);})[_0xfac1('0x50')](function(_0x5c7bac){_0x59a066[_0xfac1('0x51')][_0xfac1('0x42')](_0x5c7bac);return parseTagParameter(_0x163fd6[_0xfac1('0x52')]);})[_0xfac1('0x50')](function(_0x4c0857){_0x59a066[_0xfac1('0x43')][_0xfac1('0x41')][_0xfac1('0x42')](_0x4c0857);return parseSearchFilter(_0x163fd6['filter']);})['then'](function(_0x296391){_0x59a066[_0xfac1('0x53')]=_0x296391;return _0x59a066;});}function checkListsRestrictions(_0x2bed52,_0x304e63,_0x4f57b4){var _0x1a883f=squel[_0xfac1('0x23')]();return Promise[_0xfac1('0x54')]()['then'](function(){if(_0x304e63['search']&&_0x2bed52[_0xfac1('0x6')]===_0xfac1('0x55')&&!_0x4f57b4){return _0x2bed52[_0xfac1('0x56')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x597a38){if(_0x597a38){if(_0x597a38['length']===0x0){_0x1a883f[_0xfac1('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x1a883f['and'](_0xfac1('0x4c'),_[_0xfac1('0x40')](_0x597a38,'id'));}}})[_0xfac1('0x50')](function(){return _0x1a883f;});}function buildContactsQuery(_0x59a887,_0x17c563,_0x169527,_0x4931a7,_0x2f73db,_0x382609){if(_0x17c563){_0x17c563=_0x169527[_0xfac1('0x57')];}_0x59a887=addFieldsToQuery(_0x59a887,_0x17c563,_0x4931a7,_0x382609,!![]);var _0x87c810=squel[_0xfac1('0xa')]();_0x87c810=addFieldsToQuery(_0x87c810,_0x17c563,_0x4931a7,_0x382609,![]);if(_0x4931a7||_0x382609){_0x59a887=applyJoinClauses(_0x59a887,!![]);_0x59a887['group'](_0xfac1('0x58'));if(_0x169527[_0xfac1('0x59')]){_0x87c810[_0xfac1('0x59')](_0x169527[_0xfac1('0x59')]);}if(_0x169527[_0xfac1('0x5a')]){_0x87c810[_0xfac1('0x5a')](_0x169527[_0xfac1('0x5a')]);}}else{_0x87c810=applyJoinClauses(_0x87c810,![]);_0x87c810['group'](_0xfac1('0x5b'));if(_0x169527[_0xfac1('0x59')]){_0x59a887['limit'](_0x169527[_0xfac1('0x59')]);}if(_0x169527[_0xfac1('0x5a')]){_0x59a887[_0xfac1('0x5a')](_0x169527[_0xfac1('0x5a')]);}}_0x87c810[_0xfac1('0x5c')](_0x2f73db);if(_0x169527[_0xfac1('0x5d')]){_0x169527[_0xfac1('0x5d')]['forEach'](function(_0x89e0ca){_0x59a887[_0xfac1('0x5d')]('c.'+_0x89e0ca[0x0],_0x89e0ca[0x1]===_0xfac1('0x5e')?![]:!![]);_0x87c810[_0xfac1('0x5d')](_0xfac1('0x5f')+_0x89e0ca[0x0],_0x89e0ca[0x1]==='DESC'?![]:!![]);});}_0x87c810['from'](_0x59a887,'subqry');return _0x87c810;}function getFilteredContacts(_0x209bc1){var _0x581844=[];return db[_0xfac1('0x60')][_0xfac1('0x61')]({'attributes':['id',_0xfac1('0x36'),_0xfac1('0x62')],'raw':!![]})[_0xfac1('0x50')](function(_0x397895){_0x581844=_[_0xfac1('0x63')](_0x397895,'id');var _0x1f58b5={'type':db['Sequelize'][_0xfac1('0x64')][_0xfac1('0x65')],'model':db[_0xfac1('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xfac1('0x67')](_0x209bc1[_0xfac1('0x68')](),_0x1f58b5);})['then'](function(_0x5da244){_0x5da244[_0xfac1('0x21')](function(_0x480739){if(_0x480739['TagIds']){_0x480739[_0xfac1('0x69')]=[];_0x480739[_0xfac1('0x1e')][_0xfac1('0x27')](',')[_0xfac1('0x21')](function(_0x1fa3c4){_0x480739[_0xfac1('0x69')][_0xfac1('0x20')](_0x581844[_0x1fa3c4]);});}delete _0x480739['TagIds'];});return _0x5da244;});}function countFilteredContacts(_0x24959a,_0x5891c2){var _0x379c82=_0x24959a[_0xfac1('0x6a')]();_0x379c82[_0xfac1('0x22')](_0xfac1('0x6b'));_0x379c82=applyJoinClauses(_0x379c82,!![]);_0x24959a['group'](_0xfac1('0x58'));var _0xef66c=utils[_0xfac1('0x24')](_0x5891c2);if(!_[_0xfac1('0x6c')](_0xef66c)){_0x379c82[_0xfac1('0xd')](_0xfac1('0x6d'),_0xef66c);}var _0x1fbf7c={'type':db[_0xfac1('0x6e')][_0xfac1('0x64')][_0xfac1('0x65')],'raw':!![]};return db[_0xfac1('0x6f')][_0xfac1('0x67')](_0x379c82['toString'](),_0x1fbf7c)[_0xfac1('0x50')](function(_0x226ba2){return _0x226ba2[0x0]['COUNT(*)'];});}module[_0xfac1('0x70')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x8d8b=['c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','left_join','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','phone','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','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.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','fieldType','datetime','DATE','buildExpression','default','value','start','end','split','map','clause','and','tags','ids','User','user','uc.UserId\x20=\x20?','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','subqry.','DESC','Tag','name','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','isEmpty','t.id\x20IN\x20?','COUNT(*)','lodash','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','ListId','autocomplete','true','select','from','where'];(function(_0x48a5cc,_0x4d4796){var _0xeef6e4=function(_0x3945a0){while(--_0x3945a0){_0x48a5cc['push'](_0x48a5cc['shift']());}};_0xeef6e4(++_0x4d4796);}(_0x8d8b,0xd0));var _0xb8d8=function(_0x9daf72,_0x1e581b){_0x9daf72=_0x9daf72-0x0;var _0x1a1081=_0x8d8b[_0x9daf72];return _0x1a1081;};'use strict';var _=require(_0xb8d8('0x0'));var squel=require(_0xb8d8('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xb8d8('0x2'));var utils=require(_0xb8d8('0x3'));var db=require(_0xb8d8('0x4'))['db'];function skipContactsQuery(_0x114c4c,_0x102118){var _0xbcd8b2=![];if(_0x114c4c['role']===_0xb8d8('0x5')&&!_0x102118['search']&&!_0x102118[_0xb8d8('0x6')]&&_0x102118[_0xb8d8('0x7')]!==_0xb8d8('0x8')){_0xbcd8b2=!![];}return _0xbcd8b2;}function getContactsSubquery(){return squel[_0xb8d8('0x9')]()[_0xb8d8('0xa')]('cm_contacts','c')[_0xb8d8('0xb')](_0xb8d8('0xc'));}function applyJoinClauses(_0x4fd6a1,_0x5d2f85){var _0x4d7363=_0x5d2f85?'c':_0xb8d8('0xd');_0x4fd6a1['left_join'](_0xb8d8('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x4d7363+'.id')[_0xb8d8('0xf')]('cm_contact_has_tags','ct',_0xb8d8('0x10')+_0x4d7363+'.id')['left_join']('tools_tags','t',_0xb8d8('0x11'));return _0x4fd6a1;}function addFieldsToQuery(_0x200bde,_0x3f275f,_0x5a6904,_0x57c327,_0x28631e){var _0x367707=_0x28631e?'c':_0xb8d8('0xd');if(!_0x3f275f){_0x3f275f=['id',_0xb8d8('0x12'),_0xb8d8('0x13'),_0xb8d8('0x14'),'mobile',_0xb8d8('0x15'),_0xb8d8('0x16'),'ListId',_0xb8d8('0x17'),'createdAt',_0xb8d8('0x18'),_0xb8d8('0x19'),_0xb8d8('0x1a')];}else if(!_0x3f275f[_0xb8d8('0x1b')]('id')){_0x3f275f['push']('id');}var _0x2e99cc=_0x5a6904&&_0x28631e||!_0x5a6904&&!_0x28631e;if(_0x57c327){_0x2e99cc=_0x57c327&&_0x28631e||!_0x57c327&&!_0x28631e;}_0x3f275f[_0xb8d8('0x1c')](function(_0x55b552){if(_0x55b552===_0xb8d8('0x1a')){if(_0x2e99cc){_0x200bde['field'](_0xb8d8('0x1d'),_0x55b552);}else if(_0x5a6904||_0x57c327){_0x200bde[_0xb8d8('0x1e')](_0x367707+'.'+_0x55b552);}}else{_0x200bde[_0xb8d8('0x1e')](_0x367707+'.'+_0x55b552);}});return _0x200bde;}function getSqlClauses(){var _0x7774f2={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0xb8d8('0x1f')](),'tags':{'clause':squel[_0xb8d8('0x1f')](),'ids':null},'user':{'clause':squel[_0xb8d8('0x1f')](),'skip':![]}};return _0x7774f2;}function parseTagParameter(_0x71c6b2){var _0xde9577=squel['expr']();if(_0x71c6b2){var _0x195d5a=utils[_0xb8d8('0x20')](_0x71c6b2);_0x195d5a[_0xb8d8('0x1c')](function(_0x56e4c5){_0xde9577['or'](_0xb8d8('0x21'),'%,'+_0x56e4c5+',%');});}return _0xde9577;}function parseSearchFilter(_0x4bcae2){var _0x46005d=squel[_0xb8d8('0x1f')]();if(_0x4bcae2){var _0x5edc43=_0x4bcae2[_0xb8d8('0x22')]('\x5c','\x5c\x5c')[_0xb8d8('0x22')](/'/g,'\x27\x27');if(_0x5edc43['split']('\x20')['length']>0x1){_0x46005d['or'](_0xb8d8('0x23'),qs[_0xb8d8('0x24')](_0x5edc43),null);}else{if(qs[_0xb8d8('0x25')](_0x5edc43)){_0x46005d['or'](_0xb8d8('0x26'),_0x5edc43+'%');_0x46005d['or'](_0xb8d8('0x27'),_0x5edc43+'%');_0x46005d['or'](_0xb8d8('0x28'),_0x5edc43+'%');_0x46005d['or'](_0xb8d8('0x29'),_0x5edc43+'%');}else if(qs[_0xb8d8('0x2a')](_0x5edc43)){_0x46005d['or']('c.email\x20LIKE\x20?',_0x5edc43+'%');}else{_0x46005d['or'](_0xb8d8('0x2b'),'%'+_0x5edc43+'%');_0x46005d['or'](_0xb8d8('0x2c'),'%'+_0x5edc43+'%');_0x46005d['or'](_0xb8d8('0x2d'),'%'+_0x5edc43+'%');}}}return _0x46005d;}function parseAdvancedSearchFilter(_0x1fba06,_0x3931b4){var _0x32d0c0=getSqlClauses();var _0x717049=as[_0xb8d8('0x2e')](_0x1fba06);var _0x2d9b27=_0x717049[_0xb8d8('0x2f')];for(var _0x3c817a=0x0;_0x3c817a<_0x717049[_0xb8d8('0x30')][_0xb8d8('0x31')];_0x3c817a++){var _0x10e02f=_0x717049[_0xb8d8('0x30')][_0x3c817a];var _0x3b0e41='c';var _0x1996d6=_[_0xb8d8('0x32')](_0x3931b4,['name',_0x10e02f[_0xb8d8('0x1e')]]);if(_0x1996d6){if(_0x10e02f[_0xb8d8('0x1e')]==='dateOfBirth'||_0x1996d6[_0xb8d8('0x33')]===_0xb8d8('0x34')){_0x10e02f['castTo']=_0xb8d8('0x35');}var _0x195462=as[_0xb8d8('0x36')](_0x3b0e41,_0x1996d6['type'],_0x10e02f);_0x32d0c0[_0xb8d8('0x37')][_0x2d9b27](_0x195462['text'],_0x195462[_0xb8d8('0x38')][_0xb8d8('0x39')],_0x195462['value'][_0xb8d8('0x3a')]);}else{if(_0x10e02f['field']==='Tag'){var _0xf1d63a=_0x10e02f[_0xb8d8('0x38')][_0xb8d8('0x3b')](',')[_0xb8d8('0x3c')](function(_0x31e14a){return Number(_0x31e14a);});var _0x104ee7=parseTagParameter(_0xf1d63a);_0x32d0c0['tags'][_0xb8d8('0x3d')][_0xb8d8('0x3e')](_0x104ee7);_0x32d0c0[_0xb8d8('0x3f')][_0xb8d8('0x40')]=_0xf1d63a;}else if(_0x10e02f[_0xb8d8('0x1e')]===_0xb8d8('0x41')){_0x32d0c0[_0xb8d8('0x42')][_0xb8d8('0x3d')][_0xb8d8('0x3e')](_0xb8d8('0x43'),_0x10e02f[_0xb8d8('0x38')]);_0x32d0c0[_0xb8d8('0x42')]['skip']=!![];}}}return _0x32d0c0;}function parseModelFields(_0x47fd58,_0x2ad273){var _0x3ccc4e=squel[_0xb8d8('0x1f')]();var _0x1022e6=_(_0x47fd58)[_0xb8d8('0x44')]()[_0xb8d8('0x3c')](function(_0x2fc53f){return _[_0xb8d8('0x45')](_0x2ad273,['name',_0x2fc53f])?_0x2fc53f:undefined;})[_0xb8d8('0x46')]()[_0xb8d8('0x38')]();if(_0x47fd58[_0xb8d8('0x47')]){_0x1022e6[_0xb8d8('0x48')](_0xb8d8('0x47'));}if(_0x1022e6[_0xb8d8('0x31')]>0x0){_0x1022e6[_0xb8d8('0x1c')](function(_0x90b55){if(_0x90b55===_0xb8d8('0x6')){_0x3ccc4e[_0xb8d8('0x3e')](_0xb8d8('0x49'),[][_0xb8d8('0x4a')](_0x47fd58[_0x90b55]));}else if(_0x90b55===_0xb8d8('0x47')){var _0x1b820c='%'+_0x47fd58[_0x90b55]+'%';_0x3ccc4e['and'](_0xb8d8('0x4b'),_0x1b820c);}else{_0x3ccc4e['and']('c.'+_0x90b55+_0xb8d8('0x4c'),_0x47fd58[_0x90b55]);}});}return _0x3ccc4e;}function parseQueryParameters(_0x529513,_0x4bdfcc){var _0x475839=getSqlClauses();return Promise['resolve']()[_0xb8d8('0x4d')](function(){return parseModelFields(_0x529513,_0x4bdfcc);})['then'](function(_0x53ce6d){_0x475839[_0xb8d8('0x4e')]['and'](_0x53ce6d);return parseTagParameter(_0x529513[_0xb8d8('0x4f')]);})[_0xb8d8('0x4d')](function(_0x3aab32){_0x475839[_0xb8d8('0x3f')]['clause'][_0xb8d8('0x3e')](_0x3aab32);return parseSearchFilter(_0x529513['filter']);})[_0xb8d8('0x4d')](function(_0x407344){_0x475839[_0xb8d8('0x50')]=_0x407344;return _0x475839;});}function checkListsRestrictions(_0x159c99,_0x1c56b4,_0x173719){var _0x3042b4=squel[_0xb8d8('0x1f')]();return Promise[_0xb8d8('0x51')]()[_0xb8d8('0x4d')](function(){if(_0x1c56b4['search']&&_0x159c99[_0xb8d8('0x52')]==='agent'&&!_0x173719){return _0x159c99[_0xb8d8('0x53')]({'attributes':['id'],'raw':!![]});}})[_0xb8d8('0x4d')](function(_0x58407f){if(_0x58407f){if(_0x58407f[_0xb8d8('0x31')]===0x0){_0x3042b4[_0xb8d8('0x3e')](_0xb8d8('0x54'));}else{_0x3042b4[_0xb8d8('0x3e')](_0xb8d8('0x49'),_['map'](_0x58407f,'id'));}}})[_0xb8d8('0x4d')](function(){return _0x3042b4;});}function buildContactsQuery(_0x2e13a8,_0x10dc20,_0x1e3f24,_0x1ce2ec,_0x5d304b,_0x3a2a2a){if(_0x10dc20){_0x10dc20=_0x1e3f24[_0xb8d8('0x55')];}_0x2e13a8=addFieldsToQuery(_0x2e13a8,_0x10dc20,_0x1ce2ec,_0x3a2a2a,!![]);var _0x40b708=squel[_0xb8d8('0x9')]();_0x40b708=addFieldsToQuery(_0x40b708,_0x10dc20,_0x1ce2ec,_0x3a2a2a,![]);if(_0x1ce2ec||_0x3a2a2a){_0x2e13a8=applyJoinClauses(_0x2e13a8,!![]);_0x2e13a8[_0xb8d8('0x56')](_0xb8d8('0x57'));if(_0x1e3f24['limit']){_0x40b708[_0xb8d8('0x58')](_0x1e3f24[_0xb8d8('0x58')]);}if(_0x1e3f24[_0xb8d8('0x59')]){_0x40b708[_0xb8d8('0x59')](_0x1e3f24[_0xb8d8('0x59')]);}}else{_0x40b708=applyJoinClauses(_0x40b708,![]);_0x40b708['group'](_0xb8d8('0x5a'));if(_0x1e3f24[_0xb8d8('0x58')]){_0x2e13a8[_0xb8d8('0x58')](_0x1e3f24['limit']);}if(_0x1e3f24['offset']){_0x2e13a8[_0xb8d8('0x59')](_0x1e3f24[_0xb8d8('0x59')]);}}_0x40b708[_0xb8d8('0x5b')](_0x5d304b);if(_0x1e3f24[_0xb8d8('0x5c')]){_0x1e3f24['order'][_0xb8d8('0x1c')](function(_0x5481b0){_0x2e13a8[_0xb8d8('0x5c')]('c.'+_0x5481b0[0x0],_0x5481b0[0x1]==='DESC'?![]:!![]);_0x40b708[_0xb8d8('0x5c')](_0xb8d8('0x5d')+_0x5481b0[0x0],_0x5481b0[0x1]===_0xb8d8('0x5e')?![]:!![]);});}_0x40b708[_0xb8d8('0xa')](_0x2e13a8,_0xb8d8('0xd'));return _0x40b708;}function getFilteredContacts(_0x40cc34){var _0x9457f2=[];return db[_0xb8d8('0x5f')]['findAll']({'attributes':['id',_0xb8d8('0x60'),_0xb8d8('0x61')],'raw':!![]})[_0xb8d8('0x4d')](function(_0x5cffd5){_0x9457f2=_[_0xb8d8('0x62')](_0x5cffd5,'id');var _0x2b01b0={'type':db[_0xb8d8('0x63')][_0xb8d8('0x64')][_0xb8d8('0x65')],'model':db[_0xb8d8('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xb8d8('0x67')][_0xb8d8('0x68')](_0x40cc34[_0xb8d8('0x69')](),_0x2b01b0);})[_0xb8d8('0x4d')](function(_0x102487){_0x102487[_0xb8d8('0x1c')](function(_0x59f510){if(_0x59f510[_0xb8d8('0x1a')]){_0x59f510[_0xb8d8('0x6a')]=[];_0x59f510[_0xb8d8('0x1a')][_0xb8d8('0x3b')](',')['forEach'](function(_0x3bbee2){_0x59f510[_0xb8d8('0x6a')][_0xb8d8('0x48')](_0x9457f2[_0x3bbee2]);});}delete _0x59f510['TagIds'];});return _0x102487;});}function countFilteredContacts(_0x109856,_0x54e00c){var _0x58ed9c=_0x109856['clone']();_0x58ed9c[_0xb8d8('0x1e')]('COUNT(*)');_0x58ed9c=applyJoinClauses(_0x58ed9c,!![]);_0x109856[_0xb8d8('0x56')]('c.id');var _0x1df515=utils[_0xb8d8('0x20')](_0x54e00c);if(!_[_0xb8d8('0x6b')](_0x1df515)){_0x58ed9c[_0xb8d8('0xb')](_0xb8d8('0x6c'),_0x1df515);}var _0x5557f8={'type':db['Sequelize']['QueryTypes'][_0xb8d8('0x65')],'raw':!![]};return db[_0xb8d8('0x67')]['query'](_0x58ed9c[_0xb8d8('0x69')](),_0x5557f8)[_0xb8d8('0x4d')](function(_0x37e496){return _0x37e496[0x0][_0xb8d8('0x6d')];});}module['exports']={'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 7cff495..5657deb 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 _0x7128=['decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','session','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','unlink','decryptFile','createDecipher','close','secret','base64'];(function(_0x263276,_0x4e0583){var _0x37e440=function(_0x589277){while(--_0x589277){_0x263276['push'](_0x263276['shift']());}};_0x37e440(++_0x4e0583);}(_0x7128,0xc2));var _0x8712=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x7128[_0x1e9424];return _0x1bd96c;};'use strict';var crypto=require(_0x8712('0x0'));var fs=require('fs');var BPromise=require(_0x8712('0x1'));var _=require(_0x8712('0x2'));var config=require(_0x8712('0x3'));var logger=require(_0x8712('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x8712('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x8712('0x6')]&&config[_0x8712('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8712('0x6')][_0x8712('0x7')]);if(isSupported){fileOptions[_0x8712('0x7')]=config[_0x8712('0x6')][_0x8712('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8712('0x8')](',\x20');logger['error'](config['encrypt'][_0x8712('0x7')],_0x8712('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x4bdcd6){return AES_SUPPORTED_RX[_0x8712('0xa')](_0x4bdcd6);}function getSupportedCiphers(){return crypto[_0x8712('0xb')]()[_0x8712('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x349103){return getSupportedCiphers()['indexOf'](_0x349103)>-0x1;}function combineOptions(_0x514f93){var _0x49f2a1={};for(var _0x988e69 in fileOptions){if(fileOptions[_0x8712('0xd')](_0x988e69)){_0x49f2a1[_0x988e69]=fileOptions[_0x988e69];}}if(_0x514f93){for(var _0x114a60 in _0x514f93){if(_0x514f93['hasOwnProperty'](_0x114a60)){_0x49f2a1[_0x114a60]=_0x514f93[_0x114a60];}}}return _0x49f2a1;}exports[_0x8712('0xe')]=function(_0x42dd9e,_0x3c9f23,_0x38c0ea,_0x55500a){return new BPromise(function(_0x2d350b,_0x2eaaed){_0x55500a=combineOptions(_0x55500a);var _0x5fe6a1=new Buffer(_0x38c0ea);var _0x1b9cee=fs[_0x8712('0xf')](_0x42dd9e);var _0x8a2c04=fs[_0x8712('0x10')](_0x3c9f23);var _0xfb3c20=crypto[_0x8712('0x11')](_0x55500a['algorithm'],_0x5fe6a1);_0x1b9cee['on'](_0x8712('0x12'),function(_0x333a31){var _0x52060c=new Buffer(_0xfb3c20[_0x8712('0x13')](_0x333a31),'binary');_0x8a2c04[_0x8712('0x14')](_0x52060c);});_0x1b9cee['on']('end',function(){try{var _0x2cba85=new Buffer(_0xfb3c20[_0x8712('0x15')](_0x8712('0x16')),_0x8712('0x16'));_0x8a2c04[_0x8712('0x14')](_0x2cba85);_0x8a2c04[_0x8712('0x17')]();_0x8a2c04['on']('close',function(){return _0x2d350b(_0x3c9f23);});}catch(_0x29c6c7){fs[_0x8712('0x18')](_0x3c9f23);return _0x2eaaed(_0x29c6c7);}});});};exports[_0x8712('0x19')]=function(_0x5920e1,_0x7f8e69,_0x5e9d24,_0x17b7a9){return new BPromise(function(_0xd05506,_0x140ab4){_0x17b7a9=combineOptions(_0x17b7a9);var _0x4491ed=new Buffer(_0x5e9d24);var _0x2e8f63=fs['createReadStream'](_0x5920e1);var _0x26e60f=fs[_0x8712('0x10')](_0x7f8e69);var _0x324e4b=crypto[_0x8712('0x1a')](_0x17b7a9[_0x8712('0x7')],_0x4491ed);_0x2e8f63['on']('data',function(_0x43f674){var _0x34bd00=new Buffer(_0x324e4b[_0x8712('0x13')](_0x43f674),_0x8712('0x16'));_0x26e60f[_0x8712('0x14')](_0x34bd00);});_0x2e8f63['on'](_0x8712('0x17'),function(){try{var _0x10f20a=new Buffer(_0x324e4b[_0x8712('0x15')](_0x8712('0x16')),_0x8712('0x16'));_0x26e60f[_0x8712('0x14')](_0x10f20a);_0x26e60f['end']();_0x26e60f['on'](_0x8712('0x1b'),function(){return _0xd05506(_0x7f8e69);});}catch(_0x5ca44d){fs[_0x8712('0x18')](_0x7f8e69);return _0x140ab4(_0x5ca44d);}});});};exports['encryptString']=function(_0x502930,_0x4ea2cf,_0x2804d1){var _0x44c366=_0x2804d1||stringOptions[_0x8712('0x7')];var _0x5b4343=_0x4ea2cf||stringOptions[_0x8712('0x1c')];var _0xbd25dd=crypto[_0x8712('0x11')](_0x44c366,_0x5b4343);var _0x2ce6fe=_0xbd25dd[_0x8712('0x13')](_0x502930,'utf8',_0x8712('0x1d'));_0x2ce6fe+=_0xbd25dd['final'](_0x8712('0x1d'));return _0x2ce6fe;};exports[_0x8712('0x1e')]=function(_0x2eac80,_0x59a840,_0x228d7e){var _0x514da8=_0x228d7e||stringOptions[_0x8712('0x7')];var _0x2aac52=_0x59a840||stringOptions[_0x8712('0x1c')];var _0x3e8574=crypto[_0x8712('0x1a')](_0x514da8,_0x2aac52);var _0x424316=_0x3e8574['update'](_0x2eac80,_0x8712('0x1d'),_0x8712('0x1f'));_0x424316+=_0x3e8574[_0x8712('0x15')]('utf8');return _0x424316;}; \ No newline at end of file +var _0xe136=['aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','data','update','binary','end','final','write','decryptFile','createDecipher','close','unlink','encryptString','secret','createCipher','utf8','base64','bluebird','lodash','../../config/environment','../../config/logger','app','session'];(function(_0x2ad8f7,_0xccb550){var _0x51fa2c=function(_0x227b0b){while(--_0x227b0b){_0x2ad8f7['push'](_0x2ad8f7['shift']());}};_0x51fa2c(++_0xccb550);}(_0xe136,0x11a));var _0x6e13=function(_0x1b517e,_0x5a8934){_0x1b517e=_0x1b517e-0x0;var _0x248129=_0xe136[_0x1b517e];return _0x248129;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x6e13('0x0'));var _=require(_0x6e13('0x1'));var config=require(_0x6e13('0x2'));var logger=require(_0x6e13('0x3'))(_0x6e13('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x6e13('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x6e13('0x6')};if(config['encrypt']&&config[_0x6e13('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x6e13('0x7')][_0x6e13('0x8')]);if(isSupported){fileOptions[_0x6e13('0x8')]=config[_0x6e13('0x7')][_0x6e13('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x6e13('0x7')]['algorithm'],_0x6e13('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x5df090){return AES_SUPPORTED_RX[_0x6e13('0xa')](_0x5df090);}function getSupportedCiphers(){return crypto[_0x6e13('0xb')]()[_0x6e13('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x5b70d9){return getSupportedCiphers()[_0x6e13('0xd')](_0x5b70d9)>-0x1;}function combineOptions(_0x69a3ba){var _0x729152={};for(var _0x5506d5 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5506d5)){_0x729152[_0x5506d5]=fileOptions[_0x5506d5];}}if(_0x69a3ba){for(var _0x3883f9 in _0x69a3ba){if(_0x69a3ba[_0x6e13('0xe')](_0x3883f9)){_0x729152[_0x3883f9]=_0x69a3ba[_0x3883f9];}}}return _0x729152;}exports['encryptFile']=function(_0x1cb934,_0x3312f3,_0x3b1dd7,_0x57d714){return new BPromise(function(_0x4335bf,_0xcc4638){_0x57d714=combineOptions(_0x57d714);var _0xab5349=new Buffer(_0x3b1dd7);var _0x5a96f5=fs[_0x6e13('0xf')](_0x1cb934);var _0x512f7d=fs[_0x6e13('0x10')](_0x3312f3);var _0x8fd3b9=crypto['createCipher'](_0x57d714[_0x6e13('0x8')],_0xab5349);_0x5a96f5['on'](_0x6e13('0x11'),function(_0x46a859){var _0x236f09=new Buffer(_0x8fd3b9[_0x6e13('0x12')](_0x46a859),_0x6e13('0x13'));_0x512f7d['write'](_0x236f09);});_0x5a96f5['on'](_0x6e13('0x14'),function(){try{var _0x2e8b06=new Buffer(_0x8fd3b9[_0x6e13('0x15')](_0x6e13('0x13')),_0x6e13('0x13'));_0x512f7d[_0x6e13('0x16')](_0x2e8b06);_0x512f7d[_0x6e13('0x14')]();_0x512f7d['on']('close',function(){return _0x4335bf(_0x3312f3);});}catch(_0x31dd07){fs['unlink'](_0x3312f3);return _0xcc4638(_0x31dd07);}});});};exports[_0x6e13('0x17')]=function(_0x162ca7,_0x394507,_0x325123,_0x53ec65){return new BPromise(function(_0x3a0512,_0x46d2a6){_0x53ec65=combineOptions(_0x53ec65);var _0x1f4bdd=new Buffer(_0x325123);var _0x5b68a4=fs['createReadStream'](_0x162ca7);var _0x2c6a3b=fs['createWriteStream'](_0x394507);var _0x487164=crypto[_0x6e13('0x18')](_0x53ec65[_0x6e13('0x8')],_0x1f4bdd);_0x5b68a4['on'](_0x6e13('0x11'),function(_0x5d042d){var _0x215940=new Buffer(_0x487164[_0x6e13('0x12')](_0x5d042d),_0x6e13('0x13'));_0x2c6a3b[_0x6e13('0x16')](_0x215940);});_0x5b68a4['on'](_0x6e13('0x14'),function(){try{var _0x30a8a0=new Buffer(_0x487164[_0x6e13('0x15')](_0x6e13('0x13')),'binary');_0x2c6a3b[_0x6e13('0x16')](_0x30a8a0);_0x2c6a3b[_0x6e13('0x14')]();_0x2c6a3b['on'](_0x6e13('0x19'),function(){return _0x3a0512(_0x394507);});}catch(_0x2a4ba7){fs[_0x6e13('0x1a')](_0x394507);return _0x46d2a6(_0x2a4ba7);}});});};exports[_0x6e13('0x1b')]=function(_0x12c396,_0x1593e9,_0x57bfad){var _0x3cf96e=_0x57bfad||stringOptions[_0x6e13('0x8')];var _0x4a6e8d=_0x1593e9||stringOptions[_0x6e13('0x1c')];var _0x414d0e=crypto[_0x6e13('0x1d')](_0x3cf96e,_0x4a6e8d);var _0x2a3bb9=_0x414d0e[_0x6e13('0x12')](_0x12c396,_0x6e13('0x1e'),'base64');_0x2a3bb9+=_0x414d0e[_0x6e13('0x15')](_0x6e13('0x1f'));return _0x2a3bb9;};exports['decryptString']=function(_0xc2398b,_0xb2ec34,_0x24d433){var _0x126537=_0x24d433||stringOptions[_0x6e13('0x8')];var _0x66b2ff=_0xb2ec34||stringOptions[_0x6e13('0x1c')];var _0x12b10f=crypto['createDecipher'](_0x126537,_0x66b2ff);var _0x2c1bbc=_0x12b10f[_0x6e13('0x12')](_0xc2398b,_0x6e13('0x1f'),'utf8');_0x2c1bbc+=_0x12b10f[_0x6e13('0x15')]('utf8');return _0x2c1bbc;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index eb75996..c805593 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 _0x2a61=['range','forEach','push','query','SELECT','dirname','basename','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length'];(function(_0x35c879,_0x1ed40a){var _0x43c682=function(_0x333f86){while(--_0x333f86){_0x35c879['push'](_0x35c879['shift']());}};_0x43c682(++_0x1ed40a);}(_0x2a61,0x13b));var _0x12a6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2a61[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x12a6('0x0'));var path=require(_0x12a6('0x1'));var _=require(_0x12a6('0x2'));var csv=require(_0x12a6('0x3'));var fs=require('fs');var BPromise=require(_0x12a6('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x12a6('0x5'));var db=require(_0x12a6('0x6'))['db'];var dbH=require(_0x12a6('0x6'))[_0x12a6('0x7')];var logger=require(_0x12a6('0x8'))(_0x12a6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x12a6('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x12a6('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x6a0338,_0x3002d9){var _0xc0be2a={'status':_0x6a0338};var _0x48af83={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3002d9){_0xc0be2a[_0x12a6('0xb')]=_0x3002d9;}return db['AnalyticExtractedReport'][_0x12a6('0xc')](_0xc0be2a,_0x48af83);}function main(){var _0x3d894a=0x1388;var _0x5c4992;logger[_0x12a6('0xd')](util[_0x12a6('0xe')](_0x12a6('0xf'),EXTRACTED_REPORT_ID,_0x12a6('0x10')));return db[_0x12a6('0x11')][_0x12a6('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x12a6('0x13'),_0x12a6('0x14')]})[_0x12a6('0x15')](function(_0x17b85f){if(_0x17b85f){_0x5c4992=_0x17b85f;_0x3d894a=_0x5c4992['splitSizeCsv']||0x1388;}})[_0x12a6('0x15')](function(){return dbH[_0x12a6('0x16')]['query'](util[_0x12a6('0xe')](_0x12a6('0x17'),QUERY),{'type':dbH[_0x12a6('0x16')][_0x12a6('0x18')]['SELECT']});})[_0x12a6('0x15')](function(_0x19fe9a){if(!_0x19fe9a[0x0][_0x12a6('0x19')]){return analyticExtractedReport(_0x12a6('0x1a'));}var _0x416404=[];var _0x4c2b31=0x0;if(_0x5c4992['split']){if(_0x19fe9a&&_0x19fe9a[_0x12a6('0x1b')]){var _0x1af4ec=_[_0x12a6('0x1c')](_0x19fe9a[0x0][_0x12a6('0x19')]/_0x3d894a);var _0x4357c7=Number['isInteger'](_0x19fe9a[0x0][_0x12a6('0x19')]/_0x3d894a)?_0x19fe9a[0x0][_0x12a6('0x19')]%_0x3d894a:0x0;_0x1af4ec[_0x12a6('0x1d')](function(_0x123194){if(_0x123194>0x0){_0x4c2b31+=_0x3d894a;}_0x416404[_0x12a6('0x1e')](dbH[_0x12a6('0x16')][_0x12a6('0x1f')](util[_0x12a6('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3d894a,_0x4c2b31),{'type':dbH[_0x12a6('0x16')][_0x12a6('0x18')]['SELECT']}));});if(_0x4357c7>0x0){_0x4c2b31+=_0x3d894a;_0x416404['push'](dbH['sequelize'][_0x12a6('0x1f')](util[_0x12a6('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4357c7,_0x4c2b31),{'type':dbH['sequelize'][_0x12a6('0x18')][_0x12a6('0x20')]}));}}}else{_0x416404['push'](dbH[_0x12a6('0x16')][_0x12a6('0x1f')](QUERY,{'type':dbH[_0x12a6('0x16')]['QueryTypes']['SELECT']}));}var _0x2e285e=path[_0x12a6('0x21')](PATH);var _0x221219=path[_0x12a6('0x22')](PATH,'.csv');var _0x331df9=_0x5c4992[_0x12a6('0x13')]&&_0x416404[_0x12a6('0x1b')]>0x1;var _0x1cf059=[];if(!fs[_0x12a6('0x23')](path[_0x12a6('0x24')](_0x2e285e,_0x221219))&&_0x331df9){fs['mkdirSync'](path[_0x12a6('0x24')](_0x2e285e,_0x221219));}return BPromise[_0x12a6('0x25')](_0x416404,function(_0x4b60eb){_0x1cf059[_0x12a6('0x1e')](_0x4b60eb);})[_0x12a6('0x15')](function(){for(var _0x117a7d=0x0;_0x117a7d<_0x1cf059[_0x12a6('0x1b')];_0x117a7d+=0x1){var _0x9182b1;var _0x1cac22=_0x1cf059[_0x117a7d];if(_0x331df9){_0x9182b1=path['join'](_0x2e285e,_0x221219,util[_0x12a6('0xe')](_0x12a6('0x26'),_0x221219,_0x117a7d,_0x12a6('0x27')));}else{_0x9182b1=path[_0x12a6('0x24')](_0x2e285e,util[_0x12a6('0xe')](_0x12a6('0x28'),_0x221219,_0x12a6('0x27')));}fs[_0x12a6('0x29')](_0x9182b1,csv(_0x1cac22));}})[_0x12a6('0x15')](function(){if(_0x331df9){return new Promise(function(_0x20d7c7){zipdir(path['join'](_0x2e285e,_0x221219),{'saveTo':path[_0x12a6('0x24')](_0x2e285e,util[_0x12a6('0xe')](_0x12a6('0x28'),_0x221219,_0x12a6('0x2a')))},function(_0xe56092,_0x1b78ec){rimraf(path[_0x12a6('0x24')](_0x2e285e,_0x221219),function(){});_0x20d7c7('zip\x20finished');});});}})[_0x12a6('0x15')](function(){logger[_0x12a6('0xd')](util['format'](_0x12a6('0x2b'),EXTRACTED_REPORT_ID,_0x12a6('0x10')));return analyticExtractedReport(_0x12a6('0x2c'),_0x331df9?util['format']('%s.%s',_0x221219,_0x331df9?_0x12a6('0x2a'):_0x12a6('0x27')):null);});})['catch'](function(_0xba619a){logger[_0x12a6('0xd')](util[_0x12a6('0xe')](_0x12a6('0x2d'),EXTRACTED_REPORT_ID,_0x12a6('0x10')),util[_0x12a6('0x2e')](_0xba619a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x12a6('0x2f'));})[_0x12a6('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xec44=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','QueryTypes','num','Empty','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Completed','catch','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','info'];(function(_0x42ec09,_0x1b54fc){var _0x19f6bf=function(_0x32c2e6){while(--_0x32c2e6){_0x42ec09['push'](_0x42ec09['shift']());}};_0x19f6bf(++_0x1b54fc);}(_0xec44,0x86));var _0x4ec4=function(_0x3c43f6,_0x429058){_0x3c43f6=_0x3c43f6-0x0;var _0x5677a4=_0xec44[_0x3c43f6];return _0x5677a4;};'use strict';var util=require(_0x4ec4('0x0'));var path=require(_0x4ec4('0x1'));var _=require(_0x4ec4('0x2'));var csv=require(_0x4ec4('0x3'));var fs=require('fs');var BPromise=require(_0x4ec4('0x4'));var zipdir=require(_0x4ec4('0x5'));var rimraf=require(_0x4ec4('0x6'));var db=require(_0x4ec4('0x7'))['db'];var dbH=require(_0x4ec4('0x7'))[_0x4ec4('0x8')];var logger=require(_0x4ec4('0x9'))(_0x4ec4('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x4ec4('0xb')][0x2]);var QUERY=process[_0x4ec4('0xb')][0x3];var PATH=process[_0x4ec4('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5eb368,_0x38180f){var _0x50d4db={'status':_0x5eb368};var _0x4ddf20={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38180f){_0x50d4db['savename']=_0x38180f;}return db['AnalyticExtractedReport']['update'](_0x50d4db,_0x4ddf20);}function main(){var _0x5abf77=0x1388;var _0x44cd3a;logger[_0x4ec4('0xc')](util[_0x4ec4('0xd')](_0x4ec4('0xe'),EXTRACTED_REPORT_ID,_0x4ec4('0xf')));return db[_0x4ec4('0x10')][_0x4ec4('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4ec4('0x12'),_0x4ec4('0x13')]})[_0x4ec4('0x14')](function(_0x2e5936){if(_0x2e5936){_0x44cd3a=_0x2e5936;_0x5abf77=_0x44cd3a[_0x4ec4('0x13')]||0x1388;}})[_0x4ec4('0x14')](function(){return dbH[_0x4ec4('0x15')]['query'](util[_0x4ec4('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x4ec4('0x15')][_0x4ec4('0x16')]['SELECT']});})['then'](function(_0x1e2d96){if(!_0x1e2d96[0x0][_0x4ec4('0x17')]){return analyticExtractedReport(_0x4ec4('0x18'));}var _0x44eef9=[];var _0x59040c=0x0;if(_0x44cd3a[_0x4ec4('0x12')]){if(_0x1e2d96&&_0x1e2d96['length']){var _0x418b65=_[_0x4ec4('0x19')](_0x1e2d96[0x0][_0x4ec4('0x17')]/_0x5abf77);var _0x307ecf=Number[_0x4ec4('0x1a')](_0x1e2d96[0x0][_0x4ec4('0x17')]/_0x5abf77)?_0x1e2d96[0x0][_0x4ec4('0x17')]%_0x5abf77:0x0;_0x418b65[_0x4ec4('0x1b')](function(_0x53b471){if(_0x53b471>0x0){_0x59040c+=_0x5abf77;}_0x44eef9[_0x4ec4('0x1c')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5abf77,_0x59040c),{'type':dbH[_0x4ec4('0x15')][_0x4ec4('0x16')]['SELECT']}));});if(_0x307ecf>0x0){_0x59040c+=_0x5abf77;_0x44eef9[_0x4ec4('0x1c')](dbH['sequelize'][_0x4ec4('0x1d')](util[_0x4ec4('0xd')](_0x4ec4('0x1e'),QUERY,_0x307ecf,_0x59040c),{'type':dbH[_0x4ec4('0x15')][_0x4ec4('0x16')][_0x4ec4('0x1f')]}));}}}else{_0x44eef9[_0x4ec4('0x1c')](dbH[_0x4ec4('0x15')]['query'](QUERY,{'type':dbH[_0x4ec4('0x15')]['QueryTypes'][_0x4ec4('0x1f')]}));}var _0x2792fc=path[_0x4ec4('0x20')](PATH);var _0x3c3eb9=path['basename'](PATH,_0x4ec4('0x21'));var _0x3dc6c5=_0x44cd3a[_0x4ec4('0x12')]&&_0x44eef9[_0x4ec4('0x22')]>0x1;var _0x45b5ab=[];if(!fs[_0x4ec4('0x23')](path[_0x4ec4('0x24')](_0x2792fc,_0x3c3eb9))&&_0x3dc6c5){fs[_0x4ec4('0x25')](path[_0x4ec4('0x24')](_0x2792fc,_0x3c3eb9));}return BPromise[_0x4ec4('0x26')](_0x44eef9,function(_0x381d0d){_0x45b5ab[_0x4ec4('0x1c')](_0x381d0d);})['then'](function(){for(var _0x42ce0c=0x0;_0x42ce0c<_0x45b5ab['length'];_0x42ce0c+=0x1){var _0x5b3c31;var _0x3137aa=_0x45b5ab[_0x42ce0c];if(_0x3dc6c5){_0x5b3c31=path['join'](_0x2792fc,_0x3c3eb9,util[_0x4ec4('0xd')](_0x4ec4('0x27'),_0x3c3eb9,_0x42ce0c,_0x4ec4('0x28')));}else{_0x5b3c31=path[_0x4ec4('0x24')](_0x2792fc,util['format'](_0x4ec4('0x29'),_0x3c3eb9,_0x4ec4('0x28')));}fs['writeFileSync'](_0x5b3c31,csv(_0x3137aa));}})[_0x4ec4('0x14')](function(){if(_0x3dc6c5){return new Promise(function(_0xc3914){zipdir(path[_0x4ec4('0x24')](_0x2792fc,_0x3c3eb9),{'saveTo':path[_0x4ec4('0x24')](_0x2792fc,util[_0x4ec4('0xd')]('%s.%s',_0x3c3eb9,_0x4ec4('0x2a')))},function(_0x487064,_0x537fda){rimraf(path[_0x4ec4('0x24')](_0x2792fc,_0x3c3eb9),function(){});_0xc3914(_0x4ec4('0x2b'));});});}})['then'](function(){logger[_0x4ec4('0xc')](util[_0x4ec4('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4ec4('0xf')));return analyticExtractedReport(_0x4ec4('0x2c'),_0x3dc6c5?util['format'](_0x4ec4('0x29'),_0x3c3eb9,_0x3dc6c5?_0x4ec4('0x2a'):_0x4ec4('0x28')):null);});})[_0x4ec4('0x2d')](function(_0x24d0ef){logger['info'](util[_0x4ec4('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x4ec4('0x2e')](_0x24d0ef,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4ec4('0x2f'));})[_0x4ec4('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0bfa3c6..d5f1e74 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 _0x6a68=['splitSizePdf','then','isInteger','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split'];(function(_0x165703,_0x3309f6){var _0xd78d24=function(_0x25307d){while(--_0x25307d){_0x165703['push'](_0x165703['shift']());}};_0xd78d24(++_0x3309f6);}(_0x6a68,0x192));var _0x86a6=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6a68[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x86a6('0x0'));var fs=require('fs');var util=require(_0x86a6('0x1'));var path=require(_0x86a6('0x2'));var moment=require(_0x86a6('0x3'));var htmlToPdfmake=require(_0x86a6('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x86a6('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x86a6('0x6'))[_0x86a6('0x7')];var window=new JSDOM('')[_0x86a6('0x8')];var BPromise=require(_0x86a6('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x86a6('0xa'))[_0x86a6('0xb')];var logger=require(_0x86a6('0xc'))(_0x86a6('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x86a6('0xe')][0x2]);var QUERY=process[_0x86a6('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x86a6('0xe')][0x5];var FORMAT=_0x86a6('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2f98d4,_0x316e91){var _0x2a4914={'status':_0x2f98d4};var _0x2a5058={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x316e91){_0x2a4914['savename']=_0x316e91;}return db[_0x86a6('0x10')][_0x86a6('0x11')](_0x2a4914,_0x2a5058);}function getHeaders(_0x5d87a5){return _[_0x86a6('0x12')](_0x5d87a5,function(_0x2d5aaf){return{'text':_0x2d5aaf,'style':_0x86a6('0x13')};});}function getRows(_0x2e57da,_0x5bc63e){return _[_0x86a6('0x12')](_0x5bc63e,function(_0x44af38){return _(_0x44af38)[_0x86a6('0x14')](_0x2e57da)[_0x86a6('0x12')](function(_0x42dd7a){return _0x42dd7a?_[_0x86a6('0x15')](_0x42dd7a):'';})[_0x86a6('0x16')]();});}function createTable(_0x230bdf,_0x3a4791){var _0x3c8c40={'widths':_[_0x86a6('0x17')](Array(_0x230bdf['length']),0x91),'heights':function(_0x4866bb){return _0x4866bb===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5662f3=getHeaders(_0x230bdf);_0x3c8c40[_0x86a6('0x18')][_0x86a6('0x19')](_0x5662f3);var _0x467b11=getRows(_0x230bdf,_0x3a4791);_0x3c8c40[_0x86a6('0x18')]=_0x3c8c40[_0x86a6('0x18')][_0x86a6('0x1a')](_0x467b11);return _0x3c8c40;}function createTables(_0x3eb22f){var _0x12f911=[];var _0x3c8e4e=_[_0x86a6('0x1b')](Object['keys'](_0x3eb22f[0x0]),0x5);_0x3c8e4e[_0x86a6('0x1c')](function(_0xadd7fd){_0x12f911['push'](createTable(_0xadd7fd,_0x3eb22f));});return _0x12f911;}function getPDFDocDefinition(_0x4b9b24){var _0x1ea6bb=util[_0x86a6('0x1d')](_0x86a6('0x1e'),NAME,EXTRACTED_REPORT[_0x86a6('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0x86a6('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x86a6('0x20')])[_0x86a6('0x1d')](FORMAT));var _0xe10864=[];for(var _0x5d2c39=0x0;_0x5d2c39<_0x4b9b24[_0x86a6('0x21')];_0x5d2c39++){var _0x1f2a95=[];if(_0x5d2c39===0x0){_0x1f2a95[_0x86a6('0x19')]({'text':_0x1ea6bb,'style':_0x86a6('0x22')});}var _0x11a3ee={'table':_0x4b9b24[_0x5d2c39]};if(_0x5d2c39>0x0){_0x11a3ee[_0x86a6('0x23')]=_0x86a6('0x24');_0x11a3ee[_0x86a6('0x25')]=[0x0,0x46,0x0,0x0];}_0x1f2a95[_0x86a6('0x19')](_0x11a3ee);_0xe10864[_0x86a6('0x19')](_0x1f2a95);}return{'pageSize':'A4','pageOrientation':_0x86a6('0x26'),'content':_0xe10864,'footer':function(_0x14281e,_0x258213){return{'text':_0x14281e[_0x86a6('0x15')]()+_0x86a6('0x27')+_0x258213,'style':_0x86a6('0x28')};},'defaultStyle':{'font':_0x86a6('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x86a6('0x2a')},'footer':{'alignment':_0x86a6('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x53f7d7){var _0xd2c9b8=0x1388;var _0x118ccf;if(!_0x53f7d7[0x0]['num']){return analyticExtractedReport(_0x86a6('0x2c'));}return db[_0x86a6('0x2d')][_0x86a6('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x86a6('0x2f'),_0x86a6('0x30')]})[_0x86a6('0x31')](function(_0x4f433b){if(_0x4f433b){_0x118ccf=_0x4f433b;_0xd2c9b8=_0x118ccf[_0x86a6('0x30')]||0x3e8;}})[_0x86a6('0x31')](function(){var _0x5cd092=[];var _0x37e1fe=0x0;if(_0x118ccf[_0x86a6('0x2f')]){if(_0x53f7d7&&_0x53f7d7[_0x86a6('0x21')]){var _0x501e6f=_['range'](_0x53f7d7[0x0]['num']/_0xd2c9b8);var _0x2f422a=Number[_0x86a6('0x32')](_0x53f7d7[0x0][_0x86a6('0x33')]/_0xd2c9b8)?_0x53f7d7[0x0][_0x86a6('0x33')]%_0xd2c9b8:0x0;_0x501e6f['forEach'](function(_0x54771d){if(_0x54771d>0x0){_0x37e1fe+=_0xd2c9b8;}_0x5cd092[_0x86a6('0x19')](dbH['sequelize'][_0x86a6('0x34')](util['format'](_0x86a6('0x35'),QUERY,_0xd2c9b8,_0x37e1fe),{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));});if(_0x2f422a>0x0){_0x37e1fe+=_0xd2c9b8;_0x5cd092['push'](dbH['sequelize']['query'](util['format'](_0x86a6('0x35'),QUERY,_0x2f422a,_0x37e1fe),{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));}}}else{_0x5cd092['push'](dbH[_0x86a6('0x36')]['query'](QUERY,{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));}var _0x603aa4=path[_0x86a6('0x39')](PATH);var _0x1c7c19=path['basename'](PATH,_0x86a6('0x3a'));var _0x44a371=_0x118ccf['split']&&_0x5cd092[_0x86a6('0x21')]>0x1;var _0x2912ad=[];if(!fs[_0x86a6('0x3b')](path['join'](_0x603aa4,_0x1c7c19))&&_0x44a371){fs[_0x86a6('0x3c')](path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19));}return BPromise[_0x86a6('0x3e')](_0x5cd092,function(_0xcad00){_0x2912ad[_0x86a6('0x19')](_0xcad00);})[_0x86a6('0x31')](function(){var _0x500619=[];for(var _0x24fcf9=0x0;_0x24fcf9<_0x2912ad[_0x86a6('0x21')];_0x24fcf9+=0x1){var _0x2068fd=_0x2912ad[_0x24fcf9];var _0x8a7ab=createTables(_[_0x86a6('0x3f')](_0x2068fd));var _0x679354;var _0x4f8ebd=getPDFDocDefinition(_0x8a7ab);var _0x3d7172=getPDFPrinter();var _0x1b8e69=_0x3d7172[_0x86a6('0x40')](_0x4f8ebd);if(_0x44a371){_0x679354=path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19,util[_0x86a6('0x1d')]('%s%d.%s',_0x1c7c19,_0x24fcf9,_0x86a6('0x41')));}else{_0x679354=path[_0x86a6('0x3d')](_0x603aa4,util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,'pdf'));}_0x500619['push'](writePDFDocument(_0x1b8e69,_0x679354));}return Promise[_0x86a6('0x43')](_0x500619);})['then'](function(){if(_0x44a371){return new Promise(function(_0x4c1e2f){zipdir(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),{'saveTo':path[_0x86a6('0x3d')](_0x603aa4,util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,'zip'))},function(){rimraf(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),function(){});_0x4c1e2f('zip\x20finished');});});}})[_0x86a6('0x31')](function(){if(!_0x44a371)return;rimraf(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),function(){});})[_0x86a6('0x31')](function(){logger[_0x86a6('0x44')](util[_0x86a6('0x1d')](_0x86a6('0x45'),EXTRACTED_REPORT_ID,_0x86a6('0x46')));return analyticExtractedReport('Completed',_0x44a371?util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,_0x44a371?_0x86a6('0x47'):_0x86a6('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x86a6('0x44')](util[_0x86a6('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x86a6('0x46')));return db[_0x86a6('0x10')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x251236){EXTRACTED_REPORT=_0x251236;return dbH[_0x86a6('0x36')][_0x86a6('0x34')](util[_0x86a6('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x86a6('0x36')]['QueryTypes']['SELECT']});})['then'](extractReport)['catch'](function(_0x11a1e9){logger[_0x86a6('0x44')](util[_0x86a6('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x11a1e9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x86a6('0x48'));})[_0x86a6('0x49')](function(){process[_0x86a6('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x14b24d=new PdfPrinter({'Arial':{'normal':__dirname+_0x86a6('0x4b'),'bold':__dirname+_0x86a6('0x4c'),'italics':__dirname+_0x86a6('0x4d'),'bolditalics':__dirname+_0x86a6('0x4e')}});return _0x14b24d;}function getPDFDocDefinitionFromHTML(_0x92bb29,_0x4ee149){var _0x1e713d=util['format']('%s\x20#%d',_0x4ee149[_0x86a6('0x4f')],_0x4ee149[_0x86a6('0x50')]);var _0x16371b=moment()[_0x86a6('0x1d')](_0x86a6('0x51'))['toString']();var _0x3e5867=htmlToPdfmake(_0x92bb29,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e5867],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x86a6('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x86a6('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x86a6('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x86a6('0x22')}];},'footer':function(_0x113f3e,_0x492458){return[{'text':util['format'](_0x86a6('0x53'),_0x1e713d,_0x113f3e,_0x492458,_0x16371b),'style':_0x86a6('0x28')}];}};}function writePDFDocument(_0x4df725,_0xd508f4){return new Promise(function(_0x297471,_0x3e5bf5){var _0x45a611=_0x4df725['pipe'](fs[_0x86a6('0x54')](_0xd508f4));_0x45a611['on'](_0x86a6('0x55'),function(){_0x297471('finish');});_0x45a611['on'](_0x86a6('0x56'),function(_0x17d472){_0x3e5bf5(_0x17d472);});_0x4df725[_0x86a6('0x57')]();});}exports[_0x86a6('0x58')]=function(_0x550e7a,_0x273388){var _0x14e770=getPDFPrinter();var _0x3a37c2=getPDFDocDefinitionFromHTML(_0x550e7a,_0x273388);var _0x4d5ba7=_0x14e770[_0x86a6('0x40')](_0x3a37c2);return writePDFDocument(_0x4d5ba7,_0x273388[_0x86a6('0x2')])[_0x86a6('0x59')](function(_0x16bf0a){throw _0x16bf0a;});}; \ No newline at end of file +var _0x8daa=['pageBreak','before','margin','footer','Arial','black','Empty','Setting','find','split','splitSizePdf','then','range','num','isInteger','forEach','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','error','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','value','length','auto','push','body','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','header'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8daa,0x1d4));var _0xa8da=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x8daa[_0x1fa841];return _0x384b67;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa8da('0x0'));var path=require(_0xa8da('0x1'));var moment=require(_0xa8da('0x2'));var htmlToPdfmake=require(_0xa8da('0x3'));var PdfPrinter=require(_0xa8da('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xa8da('0x5'));var JSDOM=require(_0xa8da('0x6'))['JSDOM'];var window=new JSDOM('')[_0xa8da('0x7')];var BPromise=require(_0xa8da('0x8'));var db=require(_0xa8da('0x9'))['db'];var dbH=require(_0xa8da('0x9'))['dbH'];var logger=require('../../config/logger')(_0xa8da('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xa8da('0xb')][0x4];var NAME=process[_0xa8da('0xb')][0x5];var FORMAT=_0xa8da('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x38b258,_0xba8c80){var _0x47a411={'status':_0x38b258};var _0x5c6c3f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xba8c80){_0x47a411[_0xa8da('0xd')]=_0xba8c80;}return db['AnalyticExtractedReport'][_0xa8da('0xe')](_0x47a411,_0x5c6c3f);}function getHeaders(_0x350502){return _[_0xa8da('0xf')](_0x350502,function(_0xaf0215){return{'text':_0xaf0215,'style':'tableHeader'};});}function getRows(_0xa190d9,_0x2e1d77){return _['map'](_0x2e1d77,function(_0x12b313){return _(_0x12b313)[_0xa8da('0x10')](_0xa190d9)[_0xa8da('0xf')](function(_0x1b701d){return _0x1b701d?_[_0xa8da('0x11')](_0x1b701d):'';})[_0xa8da('0x12')]();});}function createTable(_0xfbd196,_0x409771){var _0x45ec1d={'widths':_['fill'](Array(_0xfbd196[_0xa8da('0x13')]),0x91),'heights':function(_0x589c0d){return _0x589c0d===0x0?_0xa8da('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x203fc1=getHeaders(_0xfbd196);_0x45ec1d['body'][_0xa8da('0x15')](_0x203fc1);var _0x1c9255=getRows(_0xfbd196,_0x409771);_0x45ec1d[_0xa8da('0x16')]=_0x45ec1d['body'][_0xa8da('0x17')](_0x1c9255);return _0x45ec1d;}function createTables(_0x2a7ff3){var _0x1a51c7=[];var _0x3d0ddb=_[_0xa8da('0x18')](Object[_0xa8da('0x19')](_0x2a7ff3[0x0]),0x5);_0x3d0ddb['forEach'](function(_0x3595b1){_0x1a51c7[_0xa8da('0x15')](createTable(_0x3595b1,_0x2a7ff3));});return _0x1a51c7;}function getPDFDocDefinition(_0x1638d9){var _0x5273f7=util[_0xa8da('0x1a')](_0xa8da('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xa8da('0x1c')])[_0xa8da('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x5bc407=[];for(var _0x254f9f=0x0;_0x254f9f<_0x1638d9[_0xa8da('0x13')];_0x254f9f++){var _0x519168=[];if(_0x254f9f===0x0){_0x519168[_0xa8da('0x15')]({'text':_0x5273f7,'style':_0xa8da('0x1d')});}var _0x30b159={'table':_0x1638d9[_0x254f9f]};if(_0x254f9f>0x0){_0x30b159[_0xa8da('0x1e')]=_0xa8da('0x1f');_0x30b159[_0xa8da('0x20')]=[0x0,0x46,0x0,0x0];}_0x519168['push'](_0x30b159);_0x5bc407[_0xa8da('0x15')](_0x519168);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5bc407,'footer':function(_0x5b6aca,_0x55fa41){return{'text':_0x5b6aca[_0xa8da('0x11')]()+'\x20/\x20'+_0x55fa41,'style':_0xa8da('0x21')};},'defaultStyle':{'font':_0xa8da('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa8da('0x23')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x55d9d4){var _0x507f44=0x1388;var _0x10419d;if(!_0x55d9d4[0x0]['num']){return analyticExtractedReport(_0xa8da('0x24'));}return db[_0xa8da('0x25')][_0xa8da('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa8da('0x27'),_0xa8da('0x28')]})[_0xa8da('0x29')](function(_0x2da658){if(_0x2da658){_0x10419d=_0x2da658;_0x507f44=_0x10419d[_0xa8da('0x28')]||0x3e8;}})[_0xa8da('0x29')](function(){var _0x398833=[];var _0x500025=0x0;if(_0x10419d['split']){if(_0x55d9d4&&_0x55d9d4['length']){var _0x29612d=_[_0xa8da('0x2a')](_0x55d9d4[0x0][_0xa8da('0x2b')]/_0x507f44);var _0x2ab35d=Number[_0xa8da('0x2c')](_0x55d9d4[0x0][_0xa8da('0x2b')]/_0x507f44)?_0x55d9d4[0x0][_0xa8da('0x2b')]%_0x507f44:0x0;_0x29612d[_0xa8da('0x2d')](function(_0xfa43cc){if(_0xfa43cc>0x0){_0x500025+=_0x507f44;}_0x398833[_0xa8da('0x15')](dbH[_0xa8da('0x2e')][_0xa8da('0x2f')](util[_0xa8da('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x507f44,_0x500025),{'type':dbH[_0xa8da('0x2e')][_0xa8da('0x30')][_0xa8da('0x31')]}));});if(_0x2ab35d>0x0){_0x500025+=_0x507f44;_0x398833[_0xa8da('0x15')](dbH[_0xa8da('0x2e')][_0xa8da('0x2f')](util['format'](_0xa8da('0x32'),QUERY,_0x2ab35d,_0x500025),{'type':dbH['sequelize'][_0xa8da('0x30')][_0xa8da('0x31')]}));}}}else{_0x398833[_0xa8da('0x15')](dbH[_0xa8da('0x2e')][_0xa8da('0x2f')](QUERY,{'type':dbH[_0xa8da('0x2e')][_0xa8da('0x30')][_0xa8da('0x31')]}));}var _0x46ffb7=path[_0xa8da('0x33')](PATH);var _0x53a1a1=path[_0xa8da('0x34')](PATH,'.pdf');var _0xcad770=_0x10419d[_0xa8da('0x27')]&&_0x398833[_0xa8da('0x13')]>0x1;var _0x215d88=[];if(!fs[_0xa8da('0x35')](path[_0xa8da('0x36')](_0x46ffb7,_0x53a1a1))&&_0xcad770){fs[_0xa8da('0x37')](path[_0xa8da('0x36')](_0x46ffb7,_0x53a1a1));}return BPromise[_0xa8da('0x38')](_0x398833,function(_0x3ca1d8){_0x215d88[_0xa8da('0x15')](_0x3ca1d8);})[_0xa8da('0x29')](function(){var _0x229b59=[];for(var _0x897dfc=0x0;_0x897dfc<_0x215d88['length'];_0x897dfc+=0x1){var _0x561a47=_0x215d88[_0x897dfc];var _0xcc2558=createTables(_['flatten'](_0x561a47));var _0x5d8e47;var _0x4fdd2a=getPDFDocDefinition(_0xcc2558);var _0x1be119=getPDFPrinter();var _0x5a1379=_0x1be119[_0xa8da('0x39')](_0x4fdd2a);if(_0xcad770){_0x5d8e47=path['join'](_0x46ffb7,_0x53a1a1,util[_0xa8da('0x1a')](_0xa8da('0x3a'),_0x53a1a1,_0x897dfc,_0xa8da('0x3b')));}else{_0x5d8e47=path[_0xa8da('0x36')](_0x46ffb7,util[_0xa8da('0x1a')](_0xa8da('0x3c'),_0x53a1a1,_0xa8da('0x3b')));}_0x229b59[_0xa8da('0x15')](writePDFDocument(_0x5a1379,_0x5d8e47));}return Promise['all'](_0x229b59);})[_0xa8da('0x29')](function(){if(_0xcad770){return new Promise(function(_0x17285d){zipdir(path[_0xa8da('0x36')](_0x46ffb7,_0x53a1a1),{'saveTo':path['join'](_0x46ffb7,util[_0xa8da('0x1a')]('%s.%s',_0x53a1a1,'zip'))},function(){rimraf(path[_0xa8da('0x36')](_0x46ffb7,_0x53a1a1),function(){});_0x17285d(_0xa8da('0x3d'));});});}})[_0xa8da('0x29')](function(){if(!_0xcad770)return;rimraf(path[_0xa8da('0x36')](_0x46ffb7,_0x53a1a1),function(){});})['then'](function(){logger[_0xa8da('0x3e')](util[_0xa8da('0x1a')](_0xa8da('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0xcad770?util['format']('%s.%s',_0x53a1a1,_0xcad770?_0xa8da('0x40'):_0xa8da('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa8da('0x1a')](_0xa8da('0x41'),EXTRACTED_REPORT_ID,_0xa8da('0x42')));return db[_0xa8da('0x43')][_0xa8da('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa8da('0x29')](function(_0x2ee723){EXTRACTED_REPORT=_0x2ee723;return dbH[_0xa8da('0x2e')][_0xa8da('0x2f')](util[_0xa8da('0x1a')](_0xa8da('0x45'),QUERY),{'type':dbH[_0xa8da('0x2e')][_0xa8da('0x30')]['SELECT']});})[_0xa8da('0x29')](extractReport)[_0xa8da('0x46')](function(_0x28bd84){logger[_0xa8da('0x3e')](util[_0xa8da('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0xa8da('0x47')](_0x28bd84,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa8da('0x48'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2cc12f=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xa8da('0x49'),'bolditalics':__dirname+_0xa8da('0x4a')}});return _0x2cc12f;}function getPDFDocDefinitionFromHTML(_0x3e731c,_0x3eb1fc){var _0x3851e2=util[_0xa8da('0x1a')]('%s\x20#%d',_0x3eb1fc[_0xa8da('0x4b')],_0x3eb1fc['interactionId']);var _0x5df52c=moment()[_0xa8da('0x1a')](_0xa8da('0x4c'))['toString']();var _0x2016d0=htmlToPdfmake(_0x3e731c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2016d0],'defaultStyle':{'font':_0xa8da('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa8da('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xa8da('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xa8da('0x4e'),'style':'header'}];},'footer':function(_0x2117bb,_0x583f84){return[{'text':util[_0xa8da('0x1a')](_0xa8da('0x4f'),_0x3851e2,_0x2117bb,_0x583f84,_0x5df52c),'style':_0xa8da('0x21')}];}};}function writePDFDocument(_0x3c0ed6,_0x20cee3){return new Promise(function(_0x305645,_0x2f7935){var _0x1058be=_0x3c0ed6[_0xa8da('0x50')](fs[_0xa8da('0x51')](_0x20cee3));_0x1058be['on']('finish',function(){_0x305645('finish');});_0x1058be['on'](_0xa8da('0x52'),function(_0x5ae779){_0x2f7935(_0x5ae779);});_0x3c0ed6['end']();});}exports['createPdfFromHTML']=function(_0x154bac,_0x1fbf4b){var _0x548b51=getPDFPrinter();var _0x1f72f3=getPDFDocDefinitionFromHTML(_0x154bac,_0x1fbf4b);var _0x5fcbc2=_0x548b51[_0xa8da('0x39')](_0x1f72f3);return writePDFDocument(_0x5fcbc2,_0x1fbf4b['path'])[_0xa8da('0x46')](function(_0x2e00ab){throw _0x2e00ab;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index de6e07f..7ed3ec9 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 _0xae8c=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','split','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0xae8c,0x14c));var _0xcae8=function(_0x17ad1c,_0x124722){_0x17ad1c=_0x17ad1c-0x0;var _0x310b59=_0xae8c[_0x17ad1c];return _0x310b59;};'use strict';var util=require('util');var path=require(_0xcae8('0x0'));var _=require(_0xcae8('0x1'));var fs=require('fs');var json2xls=require(_0xcae8('0x2'));var BPromise=require(_0xcae8('0x3'));var zipdir=require(_0xcae8('0x4'));var rimraf=require('rimraf');var db=require(_0xcae8('0x5'))['db'];var dbH=require(_0xcae8('0x5'))[_0xcae8('0x6')];var logger=require(_0xcae8('0x7'))(_0xcae8('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcae8('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb45b7e,_0x45ad3b){var _0x211418={'status':_0xb45b7e};var _0x5b2985={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45ad3b){_0x211418[_0xcae8('0xa')]=_0x45ad3b;}return db['AnalyticExtractedReport'][_0xcae8('0xb')](_0x211418,_0x5b2985);}function main(){var _0x3dc50f=0x1388;var _0x222477;logger[_0xcae8('0xc')](util[_0xcae8('0xd')](_0xcae8('0xe'),EXTRACTED_REPORT_ID,_0xcae8('0xf')));return db['Setting'][_0xcae8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcae8('0x11')](function(_0x46ab13){if(_0x46ab13){_0x222477=_0x46ab13;_0x3dc50f=_0x222477['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xcae8('0x12')][_0xcae8('0x13')](util['format'](_0xcae8('0x14'),QUERY),{'type':dbH[_0xcae8('0x12')]['QueryTypes'][_0xcae8('0x15')]});})['then'](function(_0x419a6a){if(!_0x419a6a[0x0][_0xcae8('0x16')]){return analyticExtractedReport(_0xcae8('0x17'));}var _0x505871=[];var _0x36b3d5=0x0;if(_0x222477['split']){if(_0x419a6a&&_0x419a6a['length']){var _0xdb9079=_['range'](_0x419a6a[0x0]['num']/_0x3dc50f);var _0x926615=Number[_0xcae8('0x18')](_0x419a6a[0x0][_0xcae8('0x16')]/_0x3dc50f)?_0x419a6a[0x0][_0xcae8('0x16')]%_0x3dc50f:0x0;_0xdb9079[_0xcae8('0x19')](function(_0x55f955){if(_0x55f955>0x0){_0x36b3d5+=_0x3dc50f;}_0x505871[_0xcae8('0x1a')](dbH[_0xcae8('0x12')][_0xcae8('0x13')](util[_0xcae8('0xd')](_0xcae8('0x1b'),QUERY,_0x3dc50f,_0x36b3d5),{'type':dbH[_0xcae8('0x12')]['QueryTypes']['SELECT']}));});if(_0x926615>0x0){_0x36b3d5+=_0x3dc50f;_0x505871[_0xcae8('0x1a')](dbH[_0xcae8('0x12')][_0xcae8('0x13')](util[_0xcae8('0xd')](_0xcae8('0x1b'),QUERY,_0x926615,_0x36b3d5),{'type':dbH[_0xcae8('0x12')]['QueryTypes'][_0xcae8('0x15')]}));}}}else{_0x505871[_0xcae8('0x1a')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xcae8('0x12')][_0xcae8('0x1c')][_0xcae8('0x15')]}));}var _0x2c932e=path[_0xcae8('0x1d')](PATH);var _0x1111c6=path[_0xcae8('0x1e')](PATH,_0xcae8('0x1f'));var _0x2f1873=_0x222477[_0xcae8('0x20')]&&_0x505871[_0xcae8('0x21')]>0x1;var _0x5be47d=[];if(!fs[_0xcae8('0x22')](path[_0xcae8('0x23')](_0x2c932e,_0x1111c6))&&_0x2f1873){fs[_0xcae8('0x24')](path[_0xcae8('0x23')](_0x2c932e,_0x1111c6));}return BPromise[_0xcae8('0x25')](_0x505871,function(_0x466035){_0x5be47d[_0xcae8('0x1a')](_0x466035);})[_0xcae8('0x11')](function(){for(var _0x20f596=0x0;_0x20f596<_0x5be47d['length'];_0x20f596+=0x1){var _0x9406ce;var _0x51dad1=_0x5be47d[_0x20f596];if(_0x2f1873){_0x9406ce=path[_0xcae8('0x23')](_0x2c932e,_0x1111c6,util[_0xcae8('0xd')](_0xcae8('0x26'),_0x1111c6,_0x20f596,_0xcae8('0x27')));}else{_0x9406ce=path[_0xcae8('0x23')](_0x2c932e,util[_0xcae8('0xd')]('%s.%s',_0x1111c6,_0xcae8('0x27')));}fs['writeFileSync'](_0x9406ce,json2xls(_0x51dad1),_0xcae8('0x28'));}})[_0xcae8('0x11')](function(){if(_0x2f1873){return new Promise(function(_0x27ca43){zipdir(path[_0xcae8('0x23')](_0x2c932e,_0x1111c6),{'saveTo':path[_0xcae8('0x23')](_0x2c932e,util['format'](_0xcae8('0x29'),_0x1111c6,_0xcae8('0x2a')))},function(_0x2b0c95,_0x54dbc0){rimraf(path[_0xcae8('0x23')](_0x2c932e,_0x1111c6),function(){});_0x27ca43(_0xcae8('0x2b'));});});}})[_0xcae8('0x11')](function(){logger['info'](util[_0xcae8('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcae8('0xf')));return analyticExtractedReport(_0xcae8('0x2c'),_0x2f1873?util[_0xcae8('0xd')](_0xcae8('0x29'),_0x1111c6,_0x2f1873?_0xcae8('0x2a'):'xlsx'):null);});})[_0xcae8('0x2d')](function(_0x1e3602){logger[_0xcae8('0xc')](util[_0xcae8('0xd')](_0xcae8('0x2e'),EXTRACTED_REPORT_ID,_0xcae8('0xf')),util['inspect'](_0x1e3602,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xcae8('0x2f')](function(){process[_0xcae8('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3a98=['push','dirname','basename','.xlsx','split','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','isInteger','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize'];(function(_0x4eda67,_0x3eb9c9){var _0x39342a=function(_0x49aabc){while(--_0x49aabc){_0x4eda67['push'](_0x4eda67['shift']());}};_0x39342a(++_0x3eb9c9);}(_0x3a98,0x84));var _0x83a9=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x3a98[_0x36de10];return _0x58100f;};'use strict';var util=require(_0x83a9('0x0'));var path=require(_0x83a9('0x1'));var _=require(_0x83a9('0x2'));var fs=require('fs');var json2xls=require(_0x83a9('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x83a9('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x83a9('0x5'))[_0x83a9('0x6')];var logger=require(_0x83a9('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x83a9('0x8')][0x2]);var QUERY=process[_0x83a9('0x8')][0x3];var PATH=process[_0x83a9('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x37268e,_0x1eeb84){var _0x814235={'status':_0x37268e};var _0x198987={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1eeb84){_0x814235[_0x83a9('0x9')]=_0x1eeb84;}return db[_0x83a9('0xa')]['update'](_0x814235,_0x198987);}function main(){var _0x2f7eaa=0x1388;var _0x118919;logger['info'](util[_0x83a9('0xb')](_0x83a9('0xc'),EXTRACTED_REPORT_ID,_0x83a9('0xd')));return db[_0x83a9('0xe')][_0x83a9('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x83a9('0x10')]})[_0x83a9('0x11')](function(_0x26ffa0){if(_0x26ffa0){_0x118919=_0x26ffa0;_0x2f7eaa=_0x118919[_0x83a9('0x10')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x83a9('0x12')](util[_0x83a9('0xb')](_0x83a9('0x13'),QUERY),{'type':dbH['sequelize'][_0x83a9('0x14')][_0x83a9('0x15')]});})[_0x83a9('0x11')](function(_0xf7870){if(!_0xf7870[0x0]['num']){return analyticExtractedReport(_0x83a9('0x16'));}var _0x1c9361=[];var _0x3a7ef6=0x0;if(_0x118919['split']){if(_0xf7870&&_0xf7870[_0x83a9('0x17')]){var _0x23ac30=_[_0x83a9('0x18')](_0xf7870[0x0]['num']/_0x2f7eaa);var _0x272180=Number[_0x83a9('0x19')](_0xf7870[0x0][_0x83a9('0x1a')]/_0x2f7eaa)?_0xf7870[0x0][_0x83a9('0x1a')]%_0x2f7eaa:0x0;_0x23ac30[_0x83a9('0x1b')](function(_0x44a4ee){if(_0x44a4ee>0x0){_0x3a7ef6+=_0x2f7eaa;}_0x1c9361['push'](dbH['sequelize'][_0x83a9('0x12')](util[_0x83a9('0xb')](_0x83a9('0x1c'),QUERY,_0x2f7eaa,_0x3a7ef6),{'type':dbH['sequelize'][_0x83a9('0x14')]['SELECT']}));});if(_0x272180>0x0){_0x3a7ef6+=_0x2f7eaa;_0x1c9361['push'](dbH[_0x83a9('0x1d')][_0x83a9('0x12')](util[_0x83a9('0xb')](_0x83a9('0x1c'),QUERY,_0x272180,_0x3a7ef6),{'type':dbH[_0x83a9('0x1d')][_0x83a9('0x14')][_0x83a9('0x15')]}));}}}else{_0x1c9361[_0x83a9('0x1e')](dbH[_0x83a9('0x1d')][_0x83a9('0x12')](QUERY,{'type':dbH['sequelize'][_0x83a9('0x14')][_0x83a9('0x15')]}));}var _0x16bde9=path[_0x83a9('0x1f')](PATH);var _0x1a680d=path[_0x83a9('0x20')](PATH,_0x83a9('0x21'));var _0x4cf2d3=_0x118919[_0x83a9('0x22')]&&_0x1c9361[_0x83a9('0x17')]>0x1;var _0x195c1d=[];if(!fs[_0x83a9('0x23')](path[_0x83a9('0x24')](_0x16bde9,_0x1a680d))&&_0x4cf2d3){fs[_0x83a9('0x25')](path[_0x83a9('0x24')](_0x16bde9,_0x1a680d));}return BPromise[_0x83a9('0x26')](_0x1c9361,function(_0x6a67ee){_0x195c1d[_0x83a9('0x1e')](_0x6a67ee);})['then'](function(){for(var _0x34e53b=0x0;_0x34e53b<_0x195c1d['length'];_0x34e53b+=0x1){var _0x11aa69;var _0x4b8da0=_0x195c1d[_0x34e53b];if(_0x4cf2d3){_0x11aa69=path[_0x83a9('0x24')](_0x16bde9,_0x1a680d,util[_0x83a9('0xb')](_0x83a9('0x27'),_0x1a680d,_0x34e53b,_0x83a9('0x28')));}else{_0x11aa69=path['join'](_0x16bde9,util[_0x83a9('0xb')](_0x83a9('0x29'),_0x1a680d,'xlsx'));}fs[_0x83a9('0x2a')](_0x11aa69,json2xls(_0x4b8da0),_0x83a9('0x2b'));}})[_0x83a9('0x11')](function(){if(_0x4cf2d3){return new Promise(function(_0x7c70a9){zipdir(path[_0x83a9('0x24')](_0x16bde9,_0x1a680d),{'saveTo':path[_0x83a9('0x24')](_0x16bde9,util[_0x83a9('0xb')](_0x83a9('0x29'),_0x1a680d,_0x83a9('0x2c')))},function(_0xcb219b,_0x542e1c){rimraf(path[_0x83a9('0x24')](_0x16bde9,_0x1a680d),function(){});_0x7c70a9(_0x83a9('0x2d'));});});}})['then'](function(){logger[_0x83a9('0x2e')](util[_0x83a9('0xb')](_0x83a9('0x2f'),EXTRACTED_REPORT_ID,_0x83a9('0xd')));return analyticExtractedReport(_0x83a9('0x30'),_0x4cf2d3?util[_0x83a9('0xb')](_0x83a9('0x29'),_0x1a680d,_0x4cf2d3?_0x83a9('0x2c'):'xlsx'):null);});})[_0x83a9('0x31')](function(_0x35f0b3){logger[_0x83a9('0x2e')](util['format'](_0x83a9('0x32'),EXTRACTED_REPORT_ID,_0x83a9('0xd')),util['inspect'](_0x35f0b3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x83a9('0x33'));})[_0x83a9('0x34')](function(){process[_0x83a9('0x35')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e6bf763..12c0449 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 _0x2083=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','format','CDR(type)=%s','type','context','exten','inbound','Set','CDR(routeid)=','VoiceExtensionId','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','filter','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length'];(function(_0x4f9939,_0x56fa3b){var _0x5e8326=function(_0x46752d){while(--_0x46752d){_0x4f9939['push'](_0x4f9939['shift']());}};_0x5e8326(++_0x56fa3b);}(_0x2083,0x1b6));var _0x3208=function(_0x79d5d0,_0x3dc9ef){_0x79d5d0=_0x79d5d0-0x0;var _0xfb3597=_0x2083[_0x79d5d0];return _0xfb3597;};'use strict';var _=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));function rewrite(_0x44127b,_0x150d2b){var _0x1864da=this;return _0x44127b[_0x3208('0x2')][_0x3208('0x3')][_0x3208('0x4')]({'raw':!![]})[_0x3208('0x5')](function(_0x59d905){_0x1864da[_0x3208('0x6')]=_0x59d905;return _0x44127b[_0x3208('0x2')]['VoiceExtension'][_0x3208('0x4')]({'where':{'IntervalId':_0x150d2b[_0x3208('0x7')]},'raw':!![]});})['then'](function(_0x22c021){return _0x44127b[_0x3208('0x2')][_0x3208('0x8')]['findAll']({'where':{'exten':{'$in':_[_0x3208('0x9')](_['map'](_0x22c021,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3208('0x5')](function(_0x4390d4){var _0x59187a=_['filter'](_0x4390d4,{'priority':'1'});var _0x5decb7=_['filter'](_0x4390d4,{'isApp':0x1});var _0x5be0b6=_[_0x3208('0xa')](_0x5decb7,'exten');var _0x125c8e=[_0x3208('0xb'),'playback'];var _0x55e16d=[];var _0x3a1cb7=[];for(var _0x207470 in _0x5be0b6){if(_0x5be0b6[_0x3208('0xc')](_0x207470)){_0x1864da[_0x3208('0xd')]=0x2;_0x1864da[_0x3208('0xe')]=[];_0x1864da[_0x3208('0xf')]=_[_0x3208('0x10')](_0x59187a,{'exten':_0x5be0b6[_0x207470][0x0]['exten']});_0x1864da['extensions'][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':util[_0x3208('0x12')](_0x3208('0x13'),_0x5be0b6[_0x207470][0x0][_0x3208('0x14')]),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x5be0b6[_0x207470][0x0][_0x3208('0x14')]===_0x3208('0x17')){_0x1864da[_0x3208('0xe')]['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x19')+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});}else if(_0x5be0b6[_0x207470][0x0]['type']==='outbound'){if(_0x1864da[_0x3208('0xf')]){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':_0x3208('0x18'),'appdata':'CDR(destination)='+(_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]?_0x3208('0x1c')+_0x1864da[_0x3208('0xf')]['cutdigits']+'}':_0x3208('0x1d')),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x19')+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});var _0x30f1bb=_0x1864da[_0x3208('0xd')]++;_0x1864da['extensions'][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x30f1bb+0x2)+_0x3208('0x1f')+(_0x30f1bb+0x1)+')','context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x30f1bb,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x1864da['extension']){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]?_0x3208('0x20')+_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]+'}':_0x3208('0x21'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}_0x1864da[_0x3208('0xe')]['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'outboundrouteid='+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x1864da[_0x3208('0xf')]&&_0x1864da['extension']['hasOwnProperty']('recordingFormat')&&_0x1864da[_0x3208('0xf')]['recordingFormat']!==_0x3208('0x22')){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':_0x3208('0x23')+_0x1864da['extension'][_0x3208('0x24')]||_0x3208('0x25'),'context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0]['exten'],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':_0x3208('0x18'),'appdata':_0x3208('0x26'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x27'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x1864da['extensions']['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x28'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0]['exten'],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});for(var _0x2807ab=0x0,_0x42fc49=0x0;_0x2807ab<_0x5be0b6[_0x207470]['length'];_0x2807ab+=0x1,_0x42fc49=0x0){var _0x4b415d=_0x5be0b6[_0x207470][_0x2807ab];if(_0x4b415d['type']){_0x4b415d[_0x3208('0x14')]=_0x4b415d[_0x3208('0x14')][_0x3208('0x29')]();}var _0x991bc4=[];var _0x11933e=[];delete _0x4b415d['id'];delete _0x4b415d[_0x3208('0x2a')];delete _0x4b415d[_0x3208('0x2b')];var _0x3d47b0=_0x4b415d[_0x3208('0x2c')]!==_0x3208('0x2d')?[_0x4b415d['interval']]:_0x4b415d[_0x3208('0x7')]?_['map'](_[_0x3208('0x2e')](_0x1864da['intervals'],{'IntervalId':_0x4b415d[_0x3208('0x7')]}),_0x3208('0x2c')):[];if(_0x4b415d[_0x3208('0xc')](_0x3208('0x2f'))){if(_0x4b415d['tag']&&_0x4b415d['tag']!=='--'){_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'CDR(tag)='+_0x4b415d[_0x3208('0x2f')],'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0['length']+_0x1864da['priority']+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}if(_0x4b415d[_0x3208('0x14')]===_0x3208('0x30')&&_0x4b415d[_0x3208('0xc')](_0x3208('0x31'))){if(_0x4b415d[_0x3208('0x31')]){_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':_0x3208('0x32')+_0x4b415d[_0x3208('0x31')]+')','context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}else{_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':_0x3208('0x34'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da['priority']+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}if(_0x4b415d['hasOwnProperty'](_0x3208('0x35'))){if(_0x125c8e[_0x3208('0x36')](_0x4b415d[_0x3208('0x37')]['toLowerCase']())>=0x0&&_0x4b415d[_0x3208('0x38')]!==_0x3208('0x39')){if(_0x4b415d[_0x3208('0x35')]){_0x991bc4['push']({'type':_0x4b415d['type'],'app':'ExecIf','appdata':_0x3208('0x3a'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0['length']+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d['VoiceExtensionId']});_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x3b'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}else{_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d['type'],'app':'ExecIf','appdata':_0x3208('0x3c'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d['VoiceExtensionId']});_0x991bc4['push']({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x3d'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}}for(var _0x50d590=0x0;_0x50d590<_0x3d47b0[_0x3208('0x33')];_0x50d590+=0x1){var _0x205f76=_0x1864da[_0x3208('0xd')]+_0x3d47b0[_0x3208('0x33')];var _0x1fad50=_0x50d590===_0x3d47b0[_0x3208('0x33')]-0x1?_0x1864da[_0x3208('0xd')]+_0x991bc4[_0x3208('0x33')]+_0x11933e[_0x3208('0x33')]+0x2:_0x1864da[_0x3208('0xd')]+_0x50d590+0x1;_0x991bc4[_0x3208('0x3e')](_0x50d590,0x0,{'type':_0x4b415d[_0x3208('0x14')],'app':'GotoIfTime','appdata':_0x3d47b0[_0x50d590]+'?'+_0x4b415d[_0x3208('0x15')]+_0x3208('0x3f')+_0x205f76+':'+_0x4b415d[_0x3208('0x15')]+_0x3208('0x3f')+_0x1fad50,'exten':_0x4b415d[_0x3208('0x16')],'context':_0x4b415d['context'],'priority':_0x1864da['priority']+_0x50d590,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});}_0x4b415d[_0x3208('0xd')]=_0x991bc4[_0x3208('0x33')]?_[_0x3208('0x40')](_0x991bc4)[_0x3208('0xd')]+0x1:_0x1864da[_0x3208('0xd')];_0x1864da[_0x3208('0xd')]=(_0x11933e['length']?_['last'](_0x11933e)[_0x3208('0xd')]:_0x4b415d['priority'])+0x1;_0x1864da[_0x3208('0xe')]=_[_0x3208('0x41')](_0x1864da[_0x3208('0xe')],_0x991bc4,[_0x4b415d],_0x11933e);}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':'Hangup','exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'priority':_0x1864da['priority'],'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x55e16d[_0x3208('0x11')](_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']);_0x3a1cb7=_[_0x3208('0x41')](_0x3a1cb7,_0x1864da[_0x3208('0xe')]);}}return _0x44127b[_0x3208('0x42')](function(_0x4ed33a){return _0x44127b[_0x3208('0x2')]['VoiceExtension'][_0x3208('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x55e16d}},'transaction':_0x4ed33a})[_0x3208('0x5')](function(_0x1733bd){return _0x44127b[_0x3208('0x2')]['VoiceExtension']['bulkCreate'](_[_0x3208('0x44')](_0x3a1cb7,_0x3208('0xd')),{'transaction':_0x4ed33a});});});})['catch'](function(_0x46e5a0){console['error'](_0x46e5a0);});}exports[_0x3208('0x45')]=rewrite; \ No newline at end of file +var _0xdec6=['Set','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','map','filter','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push'];(function(_0x48df8b,_0x2226ef){var _0xffc233=function(_0x438fb5){while(--_0x438fb5){_0x48df8b['push'](_0x48df8b['shift']());}};_0xffc233(++_0x2226ef);}(_0xdec6,0x7a));var _0x6dec=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xdec6[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var util=require(_0x6dec('0x0'));function rewrite(_0x2335af,_0x1ae1ec){var _0x59ac73=this;return _0x2335af[_0x6dec('0x1')][_0x6dec('0x2')][_0x6dec('0x3')]({'raw':!![]})[_0x6dec('0x4')](function(_0x31e273){_0x59ac73[_0x6dec('0x5')]=_0x31e273;return _0x2335af[_0x6dec('0x1')][_0x6dec('0x6')][_0x6dec('0x3')]({'where':{'IntervalId':_0x1ae1ec[_0x6dec('0x7')]},'raw':!![]});})[_0x6dec('0x4')](function(_0x1a5c85){return _0x2335af['models'][_0x6dec('0x6')][_0x6dec('0x3')]({'where':{'exten':{'$in':_[_0x6dec('0x8')](_['map'](_0x1a5c85,'exten'))}},'order':[{'raw':_0x6dec('0x9')}],'raw':!![]});})[_0x6dec('0x4')](function(_0xa008cd){var _0x2842d5=_['filter'](_0xa008cd,{'priority':'1'});var _0x1f606d=_['filter'](_0xa008cd,{'isApp':0x1});var _0x22defe=_[_0x6dec('0xa')](_0x1f606d,_0x6dec('0xb'));var _0x566caa=[_0x6dec('0xc'),_0x6dec('0xd')];var _0x30ed53=[];var _0x5ab4dd=[];for(var _0x1cd041 in _0x22defe){if(_0x22defe[_0x6dec('0xe')](_0x1cd041)){_0x59ac73[_0x6dec('0xf')]=0x2;_0x59ac73[_0x6dec('0x10')]=[];_0x59ac73[_0x6dec('0x11')]=_[_0x6dec('0x12')](_0x2842d5,{'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')]});_0x59ac73[_0x6dec('0x10')]['push']({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':'Set','appdata':util[_0x6dec('0x13')](_0x6dec('0x14'),_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')]),'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0]['exten'],'priority':_0x59ac73['priority']++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});if(_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')]===_0x6dec('0x18')){_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x1b')+_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')],'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0]['exten'],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});}else if(_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')]===_0x6dec('0x1c')){if(_0x59ac73[_0x6dec('0x11')]){_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x1d')+(_0x59ac73[_0x6dec('0x11')]['cutdigits']?_0x6dec('0x1e')+_0x59ac73[_0x6dec('0x11')]['cutdigits']+'}':_0x6dec('0x1f')),'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0]['exten'],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});}_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x1b')+_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')],'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});var _0xb27dd2=_0x59ac73['priority']++;_0x59ac73[_0x6dec('0x10')]['push']({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':'ExecIf','appdata':_0x6dec('0x20')+(_0xb27dd2+0x2)+'):Goto('+(_0xb27dd2+0x1)+')','context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0xb27dd2,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});if(_0x59ac73['extension']){_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':_0x6dec('0x1a'),'appdata':_0x59ac73[_0x6dec('0x11')][_0x6dec('0x21')]?_0x6dec('0x22')+_0x59ac73[_0x6dec('0x11')]['cutdigits']+'}':_0x6dec('0x23'),'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73['priority']++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});}_0x59ac73[_0x6dec('0x10')]['push']({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x24')+_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')],'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});if(_0x59ac73['extension']&&_0x59ac73['extension']['hasOwnProperty'](_0x6dec('0x25'))&&_0x59ac73['extension'][_0x6dec('0x25')]!==_0x6dec('0x26')){_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':'Set','appdata':_0x6dec('0x27')+_0x59ac73[_0x6dec('0x11')][_0x6dec('0x25')]||_0x6dec('0x28'),'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73['priority']++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});}}_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x22defe[_0x1cd041][0x0]['context'],'exten':_0x22defe[_0x1cd041][0x0]['exten'],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x29'),'context':_0x22defe[_0x1cd041][0x0]['context'],'exten':_0x22defe[_0x1cd041][0x0]['exten'],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});_0x59ac73['extensions'][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0]['type'],'app':'Set','appdata':_0x6dec('0x2a'),'context':_0x22defe[_0x1cd041][0x0]['context'],'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'priority':_0x59ac73[_0x6dec('0xf')]++,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});for(var _0x260e0e=0x0,_0x5f2c9b=0x0;_0x260e0e<_0x22defe[_0x1cd041][_0x6dec('0x2b')];_0x260e0e+=0x1,_0x5f2c9b=0x0){var _0x3376c6=_0x22defe[_0x1cd041][_0x260e0e];if(_0x3376c6[_0x6dec('0x15')]){_0x3376c6['type']=_0x3376c6[_0x6dec('0x15')]['toLowerCase']();}var _0x22d140=[];var _0x1fbc3a=[];delete _0x3376c6['id'];delete _0x3376c6[_0x6dec('0x2c')];delete _0x3376c6['updatedAt'];var _0x557e88=_0x3376c6[_0x6dec('0x2d')]!=='*,*,*,*'?[_0x3376c6[_0x6dec('0x2d')]]:_0x3376c6['IntervalId']?_[_0x6dec('0x2e')](_[_0x6dec('0x2f')](_0x59ac73[_0x6dec('0x5')],{'IntervalId':_0x3376c6[_0x6dec('0x7')]}),_0x6dec('0x2d')):[];if(_0x3376c6[_0x6dec('0xe')](_0x6dec('0x30'))){if(_0x3376c6[_0x6dec('0x30')]&&_0x3376c6[_0x6dec('0x30')]!=='--'){_0x22d140[_0x6dec('0x19')]({'type':_0x3376c6[_0x6dec('0x15')],'app':'Set','appdata':_0x6dec('0x31')+_0x3376c6[_0x6dec('0x30')],'context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73['priority']+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});}}if(_0x3376c6[_0x6dec('0x15')]===_0x6dec('0x1c')&&_0x3376c6[_0x6dec('0xe')](_0x6dec('0x32'))){if(_0x3376c6[_0x6dec('0x32')]){_0x22d140[_0x6dec('0x19')]({'type':_0x3376c6[_0x6dec('0x15')],'app':_0x6dec('0x33'),'appdata':_0x6dec('0x34')+_0x3376c6['callerID']+')','context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73['priority']+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});}else{_0x22d140['push']({'type':_0x3376c6[_0x6dec('0x15')],'app':_0x6dec('0x33'),'appdata':_0x6dec('0x35'),'context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73[_0x6dec('0xf')]+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});}}if(_0x3376c6[_0x6dec('0xe')](_0x6dec('0x36'))){if(_0x566caa[_0x6dec('0x37')](_0x3376c6[_0x6dec('0x38')][_0x6dec('0x39')]())>=0x0&&_0x3376c6[_0x6dec('0x3a')]!==_0x6dec('0x3b')){if(_0x3376c6['answer']){_0x22d140[_0x6dec('0x19')]({'type':_0x3376c6['type'],'app':_0x6dec('0x33'),'appdata':_0x6dec('0x3c'),'context':_0x3376c6['context'],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73['priority']+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});_0x22d140['push']({'type':_0x3376c6['type'],'app':'Set','appdata':_0x6dec('0x3d'),'context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73[_0x6dec('0xf')]+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});}else{_0x22d140[_0x6dec('0x19')]({'type':_0x3376c6['type'],'app':'ExecIf','appdata':_0x6dec('0x3e'),'context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6[_0x6dec('0xb')],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73[_0x6dec('0xf')]+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});_0x22d140[_0x6dec('0x19')]({'type':_0x3376c6[_0x6dec('0x15')],'app':_0x6dec('0x1a'),'appdata':_0x6dec('0x3f'),'context':_0x3376c6[_0x6dec('0x16')],'exten':_0x3376c6['exten'],'priority':_0x557e88[_0x6dec('0x2b')]+_0x59ac73[_0x6dec('0xf')]+_0x5f2c9b++,'VoiceExtensionId':_0x3376c6[_0x6dec('0x17')]});}}}for(var _0x5742f9=0x0;_0x5742f9<_0x557e88[_0x6dec('0x2b')];_0x5742f9+=0x1){var _0x381d10=_0x59ac73[_0x6dec('0xf')]+_0x557e88['length'];var _0x8237fb=_0x5742f9===_0x557e88[_0x6dec('0x2b')]-0x1?_0x59ac73[_0x6dec('0xf')]+_0x22d140[_0x6dec('0x2b')]+_0x1fbc3a[_0x6dec('0x2b')]+0x2:_0x59ac73[_0x6dec('0xf')]+_0x5742f9+0x1;_0x22d140['splice'](_0x5742f9,0x0,{'type':_0x3376c6[_0x6dec('0x15')],'app':'GotoIfTime','appdata':_0x557e88[_0x5742f9]+'?'+_0x3376c6[_0x6dec('0x16')]+_0x6dec('0x40')+_0x381d10+':'+_0x3376c6[_0x6dec('0x16')]+',${EXTEN},'+_0x8237fb,'exten':_0x3376c6[_0x6dec('0xb')],'context':_0x3376c6[_0x6dec('0x16')],'priority':_0x59ac73[_0x6dec('0xf')]+_0x5742f9,'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});}_0x3376c6[_0x6dec('0xf')]=_0x22d140[_0x6dec('0x2b')]?_[_0x6dec('0x41')](_0x22d140)[_0x6dec('0xf')]+0x1:_0x59ac73[_0x6dec('0xf')];_0x59ac73[_0x6dec('0xf')]=(_0x1fbc3a['length']?_['last'](_0x1fbc3a)[_0x6dec('0xf')]:_0x3376c6[_0x6dec('0xf')])+0x1;_0x59ac73[_0x6dec('0x10')]=_[_0x6dec('0x42')](_0x59ac73[_0x6dec('0x10')],_0x22d140,[_0x3376c6],_0x1fbc3a);}_0x59ac73[_0x6dec('0x10')][_0x6dec('0x19')]({'type':_0x22defe[_0x1cd041][0x0][_0x6dec('0x15')],'app':_0x6dec('0x43'),'exten':_0x22defe[_0x1cd041][0x0][_0x6dec('0xb')],'context':_0x22defe[_0x1cd041][0x0][_0x6dec('0x16')],'priority':_0x59ac73[_0x6dec('0xf')],'VoiceExtensionId':_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]});_0x30ed53[_0x6dec('0x19')](_0x22defe[_0x1cd041][0x0][_0x6dec('0x17')]);_0x5ab4dd=_[_0x6dec('0x42')](_0x5ab4dd,_0x59ac73[_0x6dec('0x10')]);}}return _0x2335af[_0x6dec('0x44')](function(_0x124021){return _0x2335af[_0x6dec('0x1')][_0x6dec('0x6')][_0x6dec('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x30ed53}},'transaction':_0x124021})[_0x6dec('0x4')](function(_0xbf5003){return _0x2335af['models'][_0x6dec('0x6')][_0x6dec('0x46')](_[_0x6dec('0x47')](_0x5ab4dd,_0x6dec('0xf')),{'transaction':_0x124021});});});})[_0x6dec('0x48')](function(_0x4f09bc){console['error'](_0x4f09bc);});}exports[_0x6dec('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index aff39c1..f77e3ff 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 _0x583c=['../../../mysqldb','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','catch','message','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','str','VoiceQueue','findAll','outbound','CmList','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','Campaign','dialCheckDuplicateType','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','CSV\x20parsed\x20correctly!','bluebird','util','lodash','squel','papaparse','ioredis'];(function(_0x59d898,_0x36d124){var _0x1a31d9=function(_0x2260bc){while(--_0x2260bc){_0x59d898['push'](_0x59d898['shift']());}};_0x1a31d9(++_0x36d124);}(_0x583c,0x138));var _0xc583=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x583c[_0x1d50f2];return _0x3769b8;};'use strict';var BPromise=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var _=require(_0xc583('0x2'));var fs=require('fs');var squel=require(_0xc583('0x3'));var Papa=require(_0xc583('0x4'));var Redis=require(_0xc583('0x5'));var db=require(_0xc583('0x6'))['db'];var config=require(_0xc583('0x7'));var logger=require('../../../config/logger')(_0xc583('0x8'));config[_0xc583('0x9')]=_['defaults'](config[_0xc583('0x9')],{'host':_0xc583('0xa'),'port':0x18eb});var socket=require(_0xc583('0xb'))(new Redis(config['redis']));require(_0xc583('0xc'))[_0xc583('0xd')](socket);try{if(!process['argv'][0x2]||process[_0xc583('0xe')][0x2]===_0xc583('0xf')||process[_0xc583('0xe')][0x2]===_0xc583('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xc583('0xe')][0x2];if(!process[_0xc583('0xe')][0x3]||process['argv'][0x3]===_0xc583('0xf')||process[_0xc583('0xe')][0x3]===_0xc583('0x10')||!process[_0xc583('0xe')][0x4]||process[_0xc583('0xe')][0x4]===_0xc583('0xf')||process[_0xc583('0xe')][0x4]===_0xc583('0x10')){throw new Error(_0xc583('0x11'));}var FIELDS=_[_0xc583('0x12')](process[_0xc583('0xe')][0x3][_0xc583('0x13')](','),process['argv'][0x4][_0xc583('0x13')](','));if(!process[_0xc583('0xe')][0x5]||process[_0xc583('0xe')][0x5]===_0xc583('0xf')||process[_0xc583('0xe')][0x5]===_0xc583('0x10')){throw new Error(_0xc583('0x14'));}var LISTID=process[_0xc583('0xe')][0x5];var COMPANYID=process[_0xc583('0xe')][0x6]&&process[_0xc583('0xe')][0x6]!==_0xc583('0xf')&&process[_0xc583('0xe')][0x6]!==_0xc583('0x10')?process[_0xc583('0xe')][0x6]:null;var DUPLICATES=process[_0xc583('0xe')][0x7]&&process['argv'][0x7]!==_0xc583('0xf')&&process[_0xc583('0xe')][0x7]!==_0xc583('0x10')?process[_0xc583('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0xc583('0xe')][0x8]===_0xc583('0xf')||process[_0xc583('0xe')][0x8]===_0xc583('0x10')){throw new Error(_0xc583('0x15'));}var SOCKET_TIMESTAMP=process[_0xc583('0xe')][0x8];}catch(_0x378515){logger['error'](_0x378515);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(_0x44cd6f,_0x47eec0,_0x2a93e5,_0x6d762f){var _0x3b8a45={'message':_0x47eec0};_0x3b8a45[_0x44cd6f]=!![];if(_0x2a93e5){_0x3b8a45[_0xc583('0x16')]=_0x2a93e5;}if(_0x6d762f){_0x3b8a45['index']=_0x6d762f;}return _0x3b8a45;}function isEmail(_0x4805cc){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'](_0x4805cc);}function checkRow(_0x32f70d,_0x1ecc73,_0x569d50){return new BPromise(function(_0xd56188,_0x37495a){if(_['isNil'](_0x32f70d)){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x18'),null,_0x569d50));}if(_0x32f70d[_0xc583('0x19')]&&_0x32f70d[_0xc583('0x19')][_0xc583('0x1a')]){var _0x365874=_[_0xc583('0x1b')](_0x32f70d[_0xc583('0x19')],'message')['join'](';');return _0x37495a(handleCheckRowError('error',_0x365874,null,_0x569d50));}var _0x11e9f8={};for(var _0x5edad2 in FIELDS){if(FIELDS[_0xc583('0x1c')](_0x5edad2)&&FIELDS[_0x5edad2]){_0x11e9f8[_0x5edad2]=_0x32f70d[_0xc583('0x1d')][0x0][FIELDS[_0x5edad2]]||_0x32f70d[_0xc583('0x1d')][0x0]['\ufeff'+FIELDS[_0x5edad2]];}}if(!_0x11e9f8[_0xc583('0x1e')]){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x1f'),null,_0x569d50));}if(!_0x11e9f8[_0xc583('0x20')]){return _0x37495a(handleCheckRowError(_0xc583('0x17'),'phone\x20not\x20specified!',null,_0x569d50));}if(_0x11e9f8['birthDate']){var _0x2c97ab=moment(_0x11e9f8[_0xc583('0x21')],_0xc583('0x22'));if(!_0x2c97ab['isValid']()){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x23'),null,_0x569d50));}}if(_0x11e9f8[_0xc583('0x24')]){if(!isEmail(_0x11e9f8[_0xc583('0x24')])){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x25'),null,_0x569d50));}}_0x11e9f8[_0xc583('0x26')]=LISTID;_0x11e9f8[_0xc583('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc583('0x1a')]&&_0x1ecc73){var _0x457b20={};for(var _0x30bf7e=0x0,_0xe4d685=DUPLICATES[_0xc583('0x1a')];_0x30bf7e<_0xe4d685;_0x30bf7e+=0x1){_0x457b20[DUPLICATES[_0x30bf7e]]=_0x11e9f8[DUPLICATES[_0x30bf7e]];}var _0x50492c=_[_0xc583('0x28')](_0x1ecc73,_0x457b20);if(_0x50492c){return _0x37495a(handleCheckRowError(_0xc583('0x29'),_0xc583('0x2a'),_0x50492c,_0x569d50));}}return db['CmContact'][_0xc583('0x2b')](_0x11e9f8,{'raw':!![],'hooks':![],'fields':_[_0xc583('0x2c')](_0x11e9f8)})[_0xc583('0x2d')](function(_0x4c92e4){if(DUPLICATES&&DUPLICATES[_0xc583('0x1a')]&&_0x1ecc73){_0x1ecc73['push'](_['pick'](_0x11e9f8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4c92e4['id'];return _0xd56188();})[_0xc583('0x2e')](function(_0x1bfe39){return _0x37495a(handleCheckRowError(_0xc583('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1bfe39[_0xc583('0x2f')]||JSON[_0xc583('0x30')](_0x1bfe39)),null,_0x569d50));});});}function checkHopper(){function _0x12b34b(){return function(_0x3ecc85){logger['error']('cmContact',_0xc583('0x31'),util[_0xc583('0x32')](_0x3ecc85,{'showHidden':![],'depth':null}));};}var _0x5364c5=function(_0x46d042,_0x37dd0f){var _0x1ebd56=squel[_0xc583('0x33')]()['into'](_0xc583('0x34'))[_0xc583('0x35')]([_0xc583('0x20'),_0xc583('0x36'),_0xc583('0x37'),_0xc583('0x26'),_0x37dd0f,_0xc583('0x38'),_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')['field'](_0xc583('0x3c'),_0xc583('0x36'))[_0xc583('0x3b')]('id',_0xc583('0x37'))['field'](LISTID[_0xc583('0x3d')](),_0xc583('0x26'))['field'](_0x46d042['id']['toString'](),_0x37dd0f)[_0xc583('0x3b')](_0xc583('0x3c'),'createdAt')[_0xc583('0x3b')]('NOW()',_0xc583('0x39'))[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')]('deletedAt\x20IS\x20NULL')[_0xc583('0x40')](_0xc583('0x41'),LISTID[_0xc583('0x3d')]())[_0xc583('0x40')](_0xc583('0x42'))[_0xc583('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'))[_0xc583('0x3e')](_0xc583('0x34'))[_0xc583('0x40')](_0x37dd0f+_0xc583('0x43'),_0x46d042['id'][_0xc583('0x3d')]())))[_0xc583('0x3d')]();return _0x1ebd56;};var _0x513006=function(_0x410977,_0x226b0e){var _0x5141ed=squel[_0xc583('0x33')]()[_0xc583('0x44')](_0xc583('0x34'))[_0xc583('0x35')]([_0xc583('0x20'),'scheduledAt',_0xc583('0x37'),_0xc583('0x26'),_0x226b0e,_0xc583('0x38'),_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x36'))[_0xc583('0x3b')]('id',_0xc583('0x37'))[_0xc583('0x3b')](LISTID[_0xc583('0x3d')](),_0xc583('0x26'))[_0xc583('0x3b')](_0x410977['id'][_0xc583('0x3d')](),_0x226b0e)[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x38'))[_0xc583('0x3b')]('NOW()','updatedAt')[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))['where'](_0xc583('0x41'),LISTID['toString']())[_0xc583('0x40')](_0xc583('0x46'),squel['str'](hopperContacts))['where'](_0xc583('0x42'))[_0xc583('0x40')](_0xc583('0x47'),squel['select']()[_0xc583('0x3b')](_0xc583('0x48'))[_0xc583('0x3e')](_0xc583('0x49'))[_0xc583('0x40')](_0x226b0e+'\x20=\x20?',_0x410977['id'][_0xc583('0x3d')]()))['where'](_0xc583('0x47'),squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'))[_0xc583('0x3e')]('cm_hopper')[_0xc583('0x40')](_0x226b0e+_0xc583('0x43'),_0x410977['id'][_0xc583('0x3d')]())))[_0xc583('0x3d')]();return _0x5141ed;};function _0x1abadb(_0x16d79b,_0x56929b){var _0xdedac6=squel[_0xc583('0x33')]()[_0xc583('0x44')](_0xc583('0x34'))['fromQuery']([_0xc583('0x20'),_0xc583('0x36'),_0xc583('0x37'),'ListId',_0x56929b,'createdAt',_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')[_0xc583('0x3b')](_0xc583('0x3c'),'scheduledAt')['field']('id','ContactId')[_0xc583('0x3b')](LISTID['toString'](),'ListId')[_0xc583('0x3b')](_0x16d79b['id'][_0xc583('0x3d')](),_0x56929b)[_0xc583('0x3b')]('NOW()',_0xc583('0x38'))['field'](_0xc583('0x3c'),'updatedAt')[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))[_0xc583('0x40')]('ListId\x20=\x20?',LISTID[_0xc583('0x3d')]())[_0xc583('0x40')]('id\x20IN\x20?',squel[_0xc583('0x4a')](hopperContacts))[_0xc583('0x40')](_0xc583('0x42')))[_0xc583('0x3d')]();return _0xdedac6;}function _0x33fda6(_0x1d3188,_0x43a33e){var _0x3da349=squel[_0xc583('0x33')]()['into']('cm_hopper_black')[_0xc583('0x35')]([_0xc583('0x20'),_0xc583('0x37'),_0xc583('0x26'),_0x43a33e,_0xc583('0x38'),_0xc583('0x39')],squel['select']()['field'](_0xc583('0x20'),_0xc583('0x20'))[_0xc583('0x3b')]('id',_0xc583('0x37'))[_0xc583('0x3b')](LISTID['toString'](),_0xc583('0x26'))[_0xc583('0x3b')](_0x1d3188['id']['toString'](),_0x43a33e)[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x38'))[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x39'))[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))[_0xc583('0x40')](_0xc583('0x41'),LISTID[_0xc583('0x3d')]())[_0xc583('0x40')](_0xc583('0x46'),squel[_0xc583('0x4a')](hopperContacts))[_0xc583('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xc583('0x3d')]();return _0x3da349;}return db[_0xc583('0x4b')][_0xc583('0x4c')]({'where':{'type':_0xc583('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xc583('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xc583('0x2d')](function(_0x3e8a9c){var _0x17317d=[];if(_0x3e8a9c){var _0x5ee756;for(var _0x243ac3=0x0,_0x4abfde;_0x243ac3<_0x3e8a9c[_0xc583('0x1a')];_0x243ac3+=0x1){_0x4abfde=_0x3e8a9c[_0x243ac3][_0xc583('0x4f')]({'plain':!![]});switch(_0x4abfde['dialCheckDuplicateType']){case _0xc583('0x50'):_0x17317d[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x513006(_0x4abfde,'VoiceQueueId'))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));break;case _0xc583('0x54'):_0x17317d[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x5364c5(_0x4abfde,_0xc583('0x55')))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));break;default:_0x17317d[_0xc583('0x51')](db['sequelize'][_0xc583('0x53')](_0x1abadb(_0x4abfde,_0xc583('0x55')))['then'](function(){})[_0xc583('0x2e')](_0x12b34b()));}}}return _0x17317d;})[_0xc583('0x56')]()[_0xc583('0x2d')](function(){return db[_0xc583('0x4b')][_0xc583('0x4c')]({'where':{'type':_0xc583('0x4d')},'attributes':['id'],'include':[{'model':db[_0xc583('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x3515de){var _0x99c127=[];if(_0x3515de){var _0x24b9dc;for(var _0x2760a4=0x0,_0x55283b;_0x2760a4<_0x3515de[_0xc583('0x1a')];_0x2760a4+=0x1){_0x55283b=_0x3515de[_0x2760a4][_0xc583('0x4f')]({'plain':!![]});_0x99c127[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x33fda6(_0x55283b,'VoiceQueueId'))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));}}return _0x99c127;})[_0xc583('0x56')]();})[_0xc583('0x2d')](function(){return db[_0xc583('0x57')][_0xc583('0x4c')]({'attributes':['id',_0xc583('0x58')],'include':[{'model':db[_0xc583('0x4e')],'as':_0xc583('0x59'),'where':{'id':LISTID}}]})[_0xc583('0x2d')](function(_0x37725d){var _0x3324d7=[];if(_0x37725d){for(var _0x22efdc=0x0,_0x133a22;_0x22efdc<_0x37725d[_0xc583('0x1a')];_0x22efdc+=0x1){_0x133a22=_0x37725d[_0x22efdc][_0xc583('0x4f')]({'plain':!![]});switch(_0x133a22[_0xc583('0x58')]){case _0xc583('0x50'):_0x3324d7['push'](db['sequelize'][_0xc583('0x53')](_0x513006(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));break;case'onlyIfOpen':_0x3324d7[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x5364c5(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));break;default:_0x3324d7[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x1abadb(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));}}}return _0x3324d7;})[_0xc583('0x56')]();})[_0xc583('0x2d')](function(){return db[_0xc583('0x57')][_0xc583('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xc583('0x4e')],'as':_0xc583('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x4035c6){var _0x6d71a6=[];if(_0x4035c6){for(var _0x1485ef=0x0,_0x1953e6;_0x1485ef<_0x4035c6['length'];_0x1485ef+=0x1){_0x1953e6=_0x4035c6[_0x1485ef][_0xc583('0x4f')]({'plain':!![]});_0x6d71a6[_0xc583('0x51')](db[_0xc583('0x52')]['query'](_0x33fda6(_0x1953e6,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));}}return _0x6d71a6;})[_0xc583('0x56')]();})[_0xc583('0x2e')](function(_0x39a818){logger[_0xc583('0x17')](_0xc583('0x5c'),'generalCheckHopper',_0x39a818[_0xc583('0x2f')]);});}var processPromises=function(_0x378079){return BPromise['all'](promises)[_0xc583('0x2d')](function(_0x5a1441){})[_0xc583('0x2e')](function(_0x570c0d){logger[_0xc583('0x17')]('Error\x20processing\x20rows\x20block:',JSON[_0xc583('0x30')](_0x570c0d));})[_0xc583('0x5d')](function(){socket[_0xc583('0x5e')](_0xc583('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x378079){return _0x378079['resume']();}});};var endCsv=function(){return BPromise[_0xc583('0x60')]()[_0xc583('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xc583('0x2d')](function(){socket[_0xc583('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc583('0x61')](FILEPATH);}catch(_0x4bbea3){logger[_0xc583('0x17')](_0xc583('0x62'),JSON[_0xc583('0x30')](_0x4bbea3));}finally{process['exit'](0x0);}});};process['on'](_0xc583('0x63'),function(){logger[_0xc583('0x64')](_0xc583('0x65'));endCsv();});function main(){return BPromise[_0xc583('0x60')]()[_0xc583('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc583('0x66')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x38de85){var _0x23ddbd=fs[_0xc583('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc583('0x68')](_0x23ddbd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bf336,_0x146e07){total+=0x1;var _0x484093=total;promises[_0xc583('0x51')](checkRow(_0x4bf336,_0x38de85,_0x484093)[_0xc583('0x2d')](function(){success+=0x1;})['catch'](function(_0x234cfe){if(_0x234cfe[_0xc583('0x17')]){errors+=0x1;delete _0x234cfe[_0xc583('0x17')];}else if(_0x234cfe[_0xc583('0x29')]){duplicates+=0x1;delete _0x234cfe[_0xc583('0x29')];}rows[_0xc583('0x51')](_0x234cfe);}));if(total%0xc8===0x0){_0x146e07['pause']();return processPromises(_0x146e07);}},'complete':function(){return processPromises()[_0xc583('0x2d')](function(){logger[_0xc583('0x64')](_0xc583('0x69'));endCsv();});},'error':function(_0x30a3f6,_0x47b65b){logger['info']('CSV\x20parse\x20error',JSON[_0xc583('0x30')](_0x30a3f6));endCsv();}});})[_0xc583('0x2e')](function(_0x4dedbd){logger[_0xc583('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc583('0x30')](_0x4dedbd));});}main(); \ No newline at end of file +var _0x063a=['cm_hopper_final','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','catch','onlyIfOpen','VoiceQueueId','all','Campaign','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','field','NOW()','scheduledAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','select','\x20=\x20?','ListId','phone\x20NOT\x20IN\x20(?)','calleridnum'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x063a,0x104));var _0xa063=function(_0x4d8510,_0xd6c36){_0x4d8510=_0x4d8510-0x0;var _0x2e3a2b=_0x063a[_0x4d8510];return _0x2e3a2b;};'use strict';var BPromise=require('bluebird');var util=require(_0xa063('0x0'));var _=require(_0xa063('0x1'));var fs=require('fs');var squel=require(_0xa063('0x2'));var Papa=require(_0xa063('0x3'));var Redis=require('ioredis');var db=require(_0xa063('0x4'))['db'];var config=require(_0xa063('0x5'));var logger=require('../../../config/logger')(_0xa063('0x6'));config[_0xa063('0x7')]=_[_0xa063('0x8')](config[_0xa063('0x7')],{'host':_0xa063('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xa063('0xa')](socket);try{if(!process[_0xa063('0xb')][0x2]||process[_0xa063('0xb')][0x2]===_0xa063('0xc')||process['argv'][0x2]==='null'){throw new Error(_0xa063('0xd'));}var FILEPATH=process[_0xa063('0xb')][0x2];if(!process[_0xa063('0xb')][0x3]||process['argv'][0x3]===_0xa063('0xc')||process[_0xa063('0xb')][0x3]==='null'||!process[_0xa063('0xb')][0x4]||process[_0xa063('0xb')][0x4]==='undefined'||process[_0xa063('0xb')][0x4]===_0xa063('0xe')){throw new Error(_0xa063('0xf'));}var FIELDS=_['zipObject'](process[_0xa063('0xb')][0x3][_0xa063('0x10')](','),process[_0xa063('0xb')][0x4][_0xa063('0x10')](','));if(!process[_0xa063('0xb')][0x5]||process[_0xa063('0xb')][0x5]===_0xa063('0xc')||process['argv'][0x5]===_0xa063('0xe')){throw new Error(_0xa063('0x11'));}var LISTID=process[_0xa063('0xb')][0x5];var COMPANYID=process[_0xa063('0xb')][0x6]&&process[_0xa063('0xb')][0x6]!=='undefined'&&process[_0xa063('0xb')][0x6]!==_0xa063('0xe')?process[_0xa063('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xa063('0xb')][0x7]!==_0xa063('0xc')&&process['argv'][0x7]!==_0xa063('0xe')?process[_0xa063('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0xa063('0xb')][0x8]===_0xa063('0xc')||process[_0xa063('0xb')][0x8]===_0xa063('0xe')){throw new Error(_0xa063('0x12'));}var SOCKET_TIMESTAMP=process[_0xa063('0xb')][0x8];}catch(_0x4c0bfd){logger[_0xa063('0x13')](_0x4c0bfd);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(_0x1c8175,_0x5bf215,_0x305067,_0x48a195){var _0x1dc372={'message':_0x5bf215};_0x1dc372[_0x1c8175]=!![];if(_0x305067){_0x1dc372['contact']=_0x305067;}if(_0x48a195){_0x1dc372[_0xa063('0x14')]=_0x48a195;}return _0x1dc372;}function isEmail(_0x327489){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))*$/[_0xa063('0x15')](_0x327489);}function checkRow(_0x40f066,_0x5cd8d2,_0x388648){return new BPromise(function(_0x341b78,_0x295a0d){if(_[_0xa063('0x16')](_0x40f066)){return _0x295a0d(handleCheckRowError('error',_0xa063('0x17'),null,_0x388648));}if(_0x40f066[_0xa063('0x18')]&&_0x40f066[_0xa063('0x18')][_0xa063('0x19')]){var _0x5e7b00=_['map'](_0x40f066['errors'],_0xa063('0x1a'))[_0xa063('0x1b')](';');return _0x295a0d(handleCheckRowError(_0xa063('0x13'),_0x5e7b00,null,_0x388648));}var _0x350984={};for(var _0x3fbddc in FIELDS){if(FIELDS[_0xa063('0x1c')](_0x3fbddc)&&FIELDS[_0x3fbddc]){_0x350984[_0x3fbddc]=_0x40f066[_0xa063('0x1d')][0x0][FIELDS[_0x3fbddc]]||_0x40f066[_0xa063('0x1d')][0x0]['\ufeff'+FIELDS[_0x3fbddc]];}}if(!_0x350984['firstName']){return _0x295a0d(handleCheckRowError('error',_0xa063('0x1e'),null,_0x388648));}if(!_0x350984[_0xa063('0x1f')]){return _0x295a0d(handleCheckRowError(_0xa063('0x13'),_0xa063('0x20'),null,_0x388648));}if(_0x350984['birthDate']){var _0x343f9f=moment(_0x350984[_0xa063('0x21')],_0xa063('0x22'));if(!_0x343f9f['isValid']()){return _0x295a0d(handleCheckRowError(_0xa063('0x13'),_0xa063('0x23'),null,_0x388648));}}if(_0x350984[_0xa063('0x24')]){if(!isEmail(_0x350984[_0xa063('0x24')])){return _0x295a0d(handleCheckRowError(_0xa063('0x13'),_0xa063('0x25'),null,_0x388648));}}_0x350984['ListId']=LISTID;_0x350984['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa063('0x19')]&&_0x5cd8d2){var _0x4c9df8={};for(var _0x33744a=0x0,_0x41579f=DUPLICATES[_0xa063('0x19')];_0x33744a<_0x41579f;_0x33744a+=0x1){_0x4c9df8[DUPLICATES[_0x33744a]]=_0x350984[DUPLICATES[_0x33744a]];}var _0x2a8aa4=_[_0xa063('0x26')](_0x5cd8d2,_0x4c9df8);if(_0x2a8aa4){return _0x295a0d(handleCheckRowError(_0xa063('0x27'),_0xa063('0x28'),_0x2a8aa4,_0x388648));}}return db[_0xa063('0x29')][_0xa063('0x2a')](_0x350984,{'raw':!![],'hooks':![],'fields':_[_0xa063('0x2b')](_0x350984)})[_0xa063('0x2c')](function(_0x28e197){if(DUPLICATES&&DUPLICATES['length']&&_0x5cd8d2){_0x5cd8d2[_0xa063('0x2d')](_[_0xa063('0x2e')](_0x350984,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x28e197['id'];return _0x341b78();})['catch'](function(_0x4d6b8c){return _0x295a0d(handleCheckRowError(_0xa063('0x13'),_0xa063('0x2f')+(_0x4d6b8c['message']||JSON[_0xa063('0x30')](_0x4d6b8c)),null,_0x388648));});});}function checkHopper(){function _0xd1170f(){return function(_0x259e33){logger[_0xa063('0x13')](_0xa063('0x31'),'checkHopper',util[_0xa063('0x32')](_0x259e33,{'showHidden':![],'depth':null}));};}var _0x5d0e28=function(_0x238538,_0x1d035d){var _0x5aaa1c=squel[_0xa063('0x33')]()[_0xa063('0x34')](_0xa063('0x35'))[_0xa063('0x36')]([_0xa063('0x1f'),'scheduledAt',_0xa063('0x37'),'ListId',_0x1d035d,_0xa063('0x38'),_0xa063('0x39')],squel['select']()[_0xa063('0x3a')](_0xa063('0x1f'),_0xa063('0x1f'))[_0xa063('0x3a')](_0xa063('0x3b'),_0xa063('0x3c'))[_0xa063('0x3a')]('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0xa063('0x3a')](_0x238538['id']['toString'](),_0x1d035d)[_0xa063('0x3a')](_0xa063('0x3b'),_0xa063('0x38'))[_0xa063('0x3a')]('NOW()',_0xa063('0x39'))[_0xa063('0x3d')](_0xa063('0x3e'))[_0xa063('0x3f')](_0xa063('0x40'))[_0xa063('0x3f')](_0xa063('0x41'),LISTID[_0xa063('0x42')]())['where'](_0xa063('0x43'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa063('0x44')]()[_0xa063('0x3a')](_0xa063('0x1f'))[_0xa063('0x3d')](_0xa063('0x35'))[_0xa063('0x3f')](_0x1d035d+_0xa063('0x45'),_0x238538['id'][_0xa063('0x42')]())))[_0xa063('0x42')]();return _0x5aaa1c;};var _0x5b93fe=function(_0x5958b8,_0x1d49df){var _0x3c2301=squel[_0xa063('0x33')]()['into'](_0xa063('0x35'))[_0xa063('0x36')]([_0xa063('0x1f'),_0xa063('0x3c'),'ContactId',_0xa063('0x46'),_0x1d49df,_0xa063('0x38'),_0xa063('0x39')],squel[_0xa063('0x44')]()[_0xa063('0x3a')](_0xa063('0x1f'),_0xa063('0x1f'))['field']('NOW()',_0xa063('0x3c'))[_0xa063('0x3a')]('id',_0xa063('0x37'))[_0xa063('0x3a')](LISTID['toString'](),_0xa063('0x46'))[_0xa063('0x3a')](_0x5958b8['id'][_0xa063('0x42')](),_0x1d49df)[_0xa063('0x3a')](_0xa063('0x3b'),'createdAt')[_0xa063('0x3a')](_0xa063('0x3b'),_0xa063('0x39'))[_0xa063('0x3d')](_0xa063('0x3e'))[_0xa063('0x3f')](_0xa063('0x40'))[_0xa063('0x3f')](_0xa063('0x41'),LISTID[_0xa063('0x42')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xa063('0x43'))[_0xa063('0x3f')](_0xa063('0x47'),squel[_0xa063('0x44')]()['field'](_0xa063('0x48'))[_0xa063('0x3d')](_0xa063('0x49'))['where'](_0x1d49df+_0xa063('0x45'),_0x5958b8['id']['toString']()))[_0xa063('0x3f')](_0xa063('0x47'),squel['select']()['field'](_0xa063('0x1f'))[_0xa063('0x3d')](_0xa063('0x35'))[_0xa063('0x3f')](_0x1d49df+_0xa063('0x45'),_0x5958b8['id'][_0xa063('0x42')]())))[_0xa063('0x42')]();return _0x3c2301;};function _0x50a64e(_0x559266,_0x2150ce){var _0x57b067=squel[_0xa063('0x33')]()[_0xa063('0x34')](_0xa063('0x35'))['fromQuery']([_0xa063('0x1f'),'scheduledAt',_0xa063('0x37'),_0xa063('0x46'),_0x2150ce,_0xa063('0x38'),_0xa063('0x39')],squel[_0xa063('0x44')]()[_0xa063('0x3a')](_0xa063('0x1f'),_0xa063('0x1f'))[_0xa063('0x3a')]('NOW()',_0xa063('0x3c'))[_0xa063('0x3a')]('id',_0xa063('0x37'))[_0xa063('0x3a')](LISTID[_0xa063('0x42')](),_0xa063('0x46'))['field'](_0x559266['id'][_0xa063('0x42')](),_0x2150ce)[_0xa063('0x3a')](_0xa063('0x3b'),'createdAt')['field'](_0xa063('0x3b'),_0xa063('0x39'))[_0xa063('0x3d')](_0xa063('0x3e'))['where'](_0xa063('0x40'))[_0xa063('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0xa063('0x3f')](_0xa063('0x4a'),squel[_0xa063('0x4b')](hopperContacts))[_0xa063('0x3f')](_0xa063('0x43')))[_0xa063('0x42')]();return _0x57b067;}function _0x5e579e(_0x3cce55,_0x27dc3f){var _0x3c90d1=squel['insert']()[_0xa063('0x34')](_0xa063('0x4c'))[_0xa063('0x36')]([_0xa063('0x1f'),_0xa063('0x37'),_0xa063('0x46'),_0x27dc3f,_0xa063('0x38'),'updatedAt'],squel[_0xa063('0x44')]()[_0xa063('0x3a')](_0xa063('0x1f'),_0xa063('0x1f'))[_0xa063('0x3a')]('id',_0xa063('0x37'))[_0xa063('0x3a')](LISTID[_0xa063('0x42')](),_0xa063('0x46'))[_0xa063('0x3a')](_0x3cce55['id'][_0xa063('0x42')](),_0x27dc3f)[_0xa063('0x3a')](_0xa063('0x3b'),_0xa063('0x38'))[_0xa063('0x3a')](_0xa063('0x3b'),_0xa063('0x39'))[_0xa063('0x3d')](_0xa063('0x3e'))[_0xa063('0x3f')](_0xa063('0x40'))[_0xa063('0x3f')]('ListId\x20=\x20?',LISTID[_0xa063('0x42')]())[_0xa063('0x3f')](_0xa063('0x4a'),squel[_0xa063('0x4b')](hopperContacts))[_0xa063('0x3f')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x3c90d1;}return db[_0xa063('0x4d')][_0xa063('0x4e')]({'where':{'type':_0xa063('0x4f')},'attributes':['id',_0xa063('0x50')],'include':[{'model':db[_0xa063('0x51')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0xd313a0){var _0x8d98f1=[];if(_0xd313a0){var _0x3dbe18;for(var _0x3793ba=0x0,_0x5ebc8e;_0x3793ba<_0xd313a0[_0xa063('0x19')];_0x3793ba+=0x1){_0x5ebc8e=_0xd313a0[_0x3793ba][_0xa063('0x52')]({'plain':!![]});switch(_0x5ebc8e[_0xa063('0x50')]){case _0xa063('0x53'):_0x8d98f1[_0xa063('0x2d')](db[_0xa063('0x54')][_0xa063('0x55')](_0x5b93fe(_0x5ebc8e,'VoiceQueueId'))[_0xa063('0x2c')](function(){})[_0xa063('0x56')](_0xd1170f()));break;case _0xa063('0x57'):_0x8d98f1[_0xa063('0x2d')](db[_0xa063('0x54')][_0xa063('0x55')](_0x5d0e28(_0x5ebc8e,_0xa063('0x58')))[_0xa063('0x2c')](function(){})[_0xa063('0x56')](_0xd1170f()));break;default:_0x8d98f1[_0xa063('0x2d')](db[_0xa063('0x54')][_0xa063('0x55')](_0x50a64e(_0x5ebc8e,'VoiceQueueId'))['then'](function(){})[_0xa063('0x56')](_0xd1170f()));}}}return _0x8d98f1;})[_0xa063('0x59')]()[_0xa063('0x2c')](function(){return db[_0xa063('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xa063('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa063('0x2c')](function(_0x5374d2){var _0x4a5d29=[];if(_0x5374d2){var _0xd271e4;for(var _0xb3e82d=0x0,_0x1c539b;_0xb3e82d<_0x5374d2[_0xa063('0x19')];_0xb3e82d+=0x1){_0x1c539b=_0x5374d2[_0xb3e82d][_0xa063('0x52')]({'plain':!![]});_0x4a5d29[_0xa063('0x2d')](db[_0xa063('0x54')][_0xa063('0x55')](_0x5e579e(_0x1c539b,'VoiceQueueId'))[_0xa063('0x2c')](function(){})[_0xa063('0x56')](_0xd1170f()));}}return _0x4a5d29;})['all']();})['then'](function(){return db[_0xa063('0x5a')][_0xa063('0x4e')]({'attributes':['id',_0xa063('0x50')],'include':[{'model':db[_0xa063('0x51')],'as':_0xa063('0x5b'),'where':{'id':LISTID}}]})[_0xa063('0x2c')](function(_0x132443){var _0x2acfff=[];if(_0x132443){for(var _0x1e1405=0x0,_0x1d72b9;_0x1e1405<_0x132443[_0xa063('0x19')];_0x1e1405+=0x1){_0x1d72b9=_0x132443[_0x1e1405]['get']({'plain':!![]});switch(_0x1d72b9['dialCheckDuplicateType']){case _0xa063('0x53'):_0x2acfff[_0xa063('0x2d')](db['sequelize'][_0xa063('0x55')](_0x5b93fe(_0x1d72b9,_0xa063('0x5c')))['then'](function(){})[_0xa063('0x56')](_0xd1170f()));break;case'onlyIfOpen':_0x2acfff[_0xa063('0x2d')](db['sequelize']['query'](_0x5d0e28(_0x1d72b9,_0xa063('0x5c')))['then'](function(){})[_0xa063('0x56')](_0xd1170f()));break;default:_0x2acfff['push'](db[_0xa063('0x54')][_0xa063('0x55')](_0x50a64e(_0x1d72b9,_0xa063('0x5c')))[_0xa063('0x2c')](function(){})[_0xa063('0x56')](_0xd1170f()));}}}return _0x2acfff;})[_0xa063('0x59')]();})[_0xa063('0x2c')](function(){return db['Campaign'][_0xa063('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xa063('0x51')],'as':_0xa063('0x5d'),'where':{'id':LISTID}}]})[_0xa063('0x2c')](function(_0x3c9760){var _0x167a61=[];if(_0x3c9760){for(var _0x25be64=0x0,_0x21de4c;_0x25be64<_0x3c9760['length'];_0x25be64+=0x1){_0x21de4c=_0x3c9760[_0x25be64][_0xa063('0x52')]({'plain':!![]});_0x167a61[_0xa063('0x2d')](db[_0xa063('0x54')][_0xa063('0x55')](_0x5e579e(_0x21de4c,'CampaignId'))[_0xa063('0x2c')](function(){})[_0xa063('0x56')](_0xd1170f()));}}return _0x167a61;})[_0xa063('0x59')]();})[_0xa063('0x56')](function(_0x322a74){logger[_0xa063('0x13')](_0xa063('0x5e'),_0xa063('0x5f'),_0x322a74['message']);});}var processPromises=function(_0x21d895){return BPromise[_0xa063('0x59')](promises)[_0xa063('0x2c')](function(_0x1fab90){})[_0xa063('0x56')](function(_0x373e58){logger[_0xa063('0x13')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x373e58));})[_0xa063('0x60')](function(){socket[_0xa063('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x21d895){return _0x21d895[_0xa063('0x62')]();}});};var endCsv=function(){return BPromise[_0xa063('0x63')]()[_0xa063('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xa063('0x2c')](function(){socket[_0xa063('0x61')](_0xa063('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa063('0x65')](FILEPATH);}catch(_0x3f2bb2){logger['error'](_0xa063('0x66'),JSON[_0xa063('0x30')](_0x3f2bb2));}finally{process[_0xa063('0x67')](0x0);}});};process['on'](_0xa063('0x68'),function(){logger[_0xa063('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa063('0x63')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa063('0x10')](',');return db['CmContact'][_0xa063('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa063('0x2c')](function(_0x5698c3){var _0x2766f5=fs[_0xa063('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xa063('0x6b')](_0x2766f5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ba75a,_0x2d1a81){total+=0x1;var _0x274283=total;promises[_0xa063('0x2d')](checkRow(_0x5ba75a,_0x5698c3,_0x274283)['then'](function(){success+=0x1;})[_0xa063('0x56')](function(_0x1070a3){if(_0x1070a3[_0xa063('0x13')]){errors+=0x1;delete _0x1070a3[_0xa063('0x13')];}else if(_0x1070a3[_0xa063('0x27')]){duplicates+=0x1;delete _0x1070a3[_0xa063('0x27')];}rows[_0xa063('0x2d')](_0x1070a3);}));if(total%0xc8===0x0){_0x2d1a81[_0xa063('0x6c')]();return processPromises(_0x2d1a81);}},'complete':function(){return processPromises()[_0xa063('0x2c')](function(){logger['info'](_0xa063('0x6d'));endCsv();});},'error':function(_0xc4f0a4,_0x39cbde){logger[_0xa063('0x69')]('CSV\x20parse\x20error',JSON['stringify'](_0xc4f0a4));endCsv();}});})[_0xa063('0x56')](function(_0x1a9a9f){logger[_0xa063('0x13')](_0xa063('0x6e'),JSON[_0xa063('0x30')](_0x1a9a9f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7c0e953..821b602 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 _0x292c=['No\x20agent\x20available','SIGINT','uncaughtException','lodash','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','split','length','push','all','CmContactHasItem','findOne','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','toString','updatedAt','select','fields','field','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','recallme','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','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','code','info','sequelize','query','catch','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','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=','timezones','dialTimezone','isNil','set','offset','main','stringify','start','binding','clone','socket_timestamp','root','.csv','includes','header','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','campaigns','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','body\x20id\x20mandatory','map'];(function(_0x4c722e,_0x255163){var _0xa679c4=function(_0xc4da58){while(--_0xc4da58){_0x4c722e['push'](_0x4c722e['shift']());}};_0xa679c4(++_0x255163);}(_0x292c,0x17d));var _0xc292=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x292c[_0x470bfb];return _0x2f5d97;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc292('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xc292('0x1'));var moment=require('moment');var squel=require(_0xc292('0x2'));var Redis=require(_0xc292('0x3'));var db=require(_0xc292('0x4'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xc292('0x5'))(_0xc292('0x6'));config[_0xc292('0x7')]=_[_0xc292('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc292('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xc292('0xa')]('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']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x20abae){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'](_0x20abae);}function selectNotIn(_0x24e0e1,_0x5b6521,_0x2d311a,_0x179064,_0x456455){return squel['select']()['field'](_0xc292('0xb'))[_0xc292('0xc')](_0x179064)[_0xc292('0xd')](_0x5b6521,null,_0x5b6521+_0xc292('0xe')+_0x179064+'.'+_0x2d311a)['where'](_0x179064+'.'+_0x2d311a+_0xc292('0xf')+_0x24e0e1+'.'+_0x2d311a)[_0xc292('0x10')](_0x5b6521+_0xc292('0x11')+_0x456455[_0xc292('0xd')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x15a89e,_0x4ec2bf){promisesAdditionalPhones=[];return db[_0xc292('0x12')][_0xc292('0x13')]({'raw':!![],'attributes':['id',_0xc292('0x14')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc292('0x15')](function(_0x5a7e77){if(_0x5a7e77!==null){var _0x59dd08=[];for(var _0x2572e8=0x0;_0x2572e8<_0x5a7e77['length'];_0x2572e8++){var _0x3e95a1=_0x5a7e77[_0x2572e8];_0x59dd08['push'](insertAdditionalPhones(_0x3e95a1));}}Promise['all'](_0x59dd08)['then'](function(){_0x15a89e({'val':0x1});});});});}function insertAdditionalPhones(_0x4f22d6){return new Promise(function(_0xf3076d,_0x21f7b2){var _0x4a0913=_0x4f22d6['AdditionalPhones'];var _0x30aef2=_0x4a0913[_0xc292('0x16')](';');var _0x1dd032=[];orderBy=0x0;for(var _0x1c192e=0x0;_0x1c192e<_0x30aef2[_0xc292('0x17')];_0x1c192e++){_0x1dd032[_0xc292('0x18')](splitAdditionalPhone(_0x4f22d6['id'],_0x30aef2[_0x1c192e]));}Promise[_0xc292('0x19')](_0x1dd032)[_0xc292('0x15')](function(){_0xf3076d({'val':_0x30aef2[_0xc292('0x17')]});});});}function splitAdditionalPhone(_0x199352,_0x452788){return new Promise(function(_0x2331be,_0x575e90){var _0x2d9284=_0x452788[_0xc292('0x16')](':');var _0x242082=_0x2d9284[0x0];var _0x2758b7=_0x2d9284[0x1];if(!_['isNil'](_0x2758b7)){var _0x4887b8=_0x2758b7[_0xc292('0x16')]('|');var _0x563f85=[];for(var _0x4f53b6=0x0;_0x4f53b6<_0x4887b8[_0xc292('0x17')];_0x4f53b6++){if(_0x4887b8[_0x4f53b6]!==''){var _0x48b096=_['filter'](promisesAdditionalPhones,{'contactId':_0x199352,'phone':_0x4887b8[_0x4f53b6]});if(_0x48b096['length']==0x0){orderBy++;promisesAdditionalPhones[_0xc292('0x18')]({'contactId':_0x199352,'contactTypeId':_0x242082,'phone':_0x4887b8[_0x4f53b6],'orderBy':orderBy});}}}_0x2331be({'ok':0x1});}else _0x2331be({'res':0x0});});}function createAdditionalPhone(_0x47b4a8,_0x5cd288,_0x1610cd,_0x1d5922){var _0x55ff16='';var _0x11c7f4='';var _0x2ebcd1=_0x1610cd[_0xc292('0x16')]('§');_0x55ff16=_0x2ebcd1[0x0];if(_0x2ebcd1['length']==0x2)_0x11c7f4=_0x2ebcd1[0x1];return new Promise(function(_0xaca765,_0x2d76f2){return db[_0xc292('0x1a')][_0xc292('0x1b')]({'where':{'CmContactId':_0x47b4a8,'item':_0x55ff16}})['then'](function(_0x35cc24){if(_0x35cc24){return db[_0xc292('0x1a')][_0xc292('0x1c')]({'ItemTypeId':_0x5cd288,'description':_0x11c7f4,'OrderBy':_0x1d5922},{'where':{'CmContactId':_0x47b4a8,'item':_0x55ff16}})[_0xc292('0x15')](function(_0x3a3d45){_0xaca765({'res':_0xc292('0x1d')});});}else{return db['CmContactHasItem'][_0xc292('0x1e')]({'CmContactId':_0x47b4a8,'item':_0x55ff16,'description':_0x11c7f4,'ItemTypeId':_0x5cd288,'OrderBy':_0x1d5922,'ItemClass':_0xc292('0x1f')})['then'](function(_0x26be53){_0xaca765({'res':'inserted'});});}});});}function insertCmHopper(_0x92cffd,_0x5338e6,_0x5677a0,_0x35a5f7,_0x3319d0){var _0x2762c8=[_0xc292('0x20'),_0xc292('0x21'),_0xc292('0x22'),_0xc292('0x23'),_0x5338e6+'.'+_0x35a5f7,_0xc292('0x24'),_0xc292('0x25'),_0xc292('0x26'),'cm_contacts.UserId','\x22'+_0x3319d0+'\x22'];return squel[_0xc292('0x27')]()[_0xc292('0x28')]('cm_hopper')[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2a'),_0xc292('0x2b'),_0xc292('0x2c'),_0x35a5f7,_0xc292('0x2d'),'updatedAt',_0xc292('0x2e'),_0xc292('0x2f'),'recallme'],squel['select']()['fields'](_0x2762c8)[_0xc292('0xc')](_0x5338e6)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0x5338e6+_0xc292('0x32'))[_0xc292('0xd')](_0x5677a0,null,_0x5677a0+_0xc292('0xe')+_0x5338e6+'.'+_0x35a5f7)[_0xc292('0x10')](_0x5338e6+_0xc292('0x33'),_0x92cffd)[_0xc292('0x10')](_0xc292('0x34'),NOW)[_0xc292('0x10')](_0xc292('0x35'),selectNotIn(_0x5338e6,_0x5677a0,_0x35a5f7,'cm_hopper',[_0xc292('0x36'),_0xc292('0x37')]))['where'](_0xc292('0x35'),selectNotIn(_0x5338e6,_0x5677a0,_0x35a5f7,_0xc292('0x38'),['\x22always\x22'])))[_0xc292('0x39')]();}function insertCmHopperBlack(_0x2cea5a,_0x5940bd,_0xb6c510,_0x39ff75){var _0x260acd=[_0xc292('0x20'),'cm_contacts.id',_0xc292('0x23'),_0x5940bd+'.'+_0x39ff75,_0xc292('0x24'),_0xc292('0x25')];return squel[_0xc292('0x27')]()[_0xc292('0x28')]('cm_hopper_black')[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2b'),_0xc292('0x2c'),_0x39ff75,_0xc292('0x2d'),_0xc292('0x3a')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x260acd)[_0xc292('0xc')](_0x5940bd)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0x5940bd+'.CmListId')['join'](_0xb6c510,null,_0xb6c510+_0xc292('0xe')+_0x5940bd+'.'+_0x39ff75)[_0xc292('0x10')](_0x5940bd+'.CmListId\x20=\x20?',_0x2cea5a)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc292('0x10')](_0xc292('0x35'),squel[_0xc292('0x3b')]()[_0xc292('0x3d')]('phone')[_0xc292('0xc')](_0xc292('0x3e'))[_0xc292('0x10')](_0xc292('0x3f'),_0x2cea5a)['where'](_0x39ff75+'\x20=\x20'+_0x5940bd+'.'+_0x39ff75)))[_0xc292('0x39')]();}function insertTzCmHopper(_0x39ce0d,_0xb86fc2,_0x21a39f,_0x138ea9,_0x54a53b,_0x569ecf){var _0x263d72=[_0xc292('0x20'),_0xc292('0x40')+_0x569ecf+_0xc292('0x41'),_0xc292('0x22'),_0xc292('0x23'),_0xb86fc2+'.'+_0x138ea9,_0xc292('0x24'),_0xc292('0x25'),_0xc292('0x26'),_0xc292('0x42'),'\x22'+_0x54a53b+'\x22'];var _0x26348b=squel[_0xc292('0x27')]()[_0xc292('0x28')](_0xc292('0x38'))[_0xc292('0x29')]([_0xc292('0xb'),'scheduledat',_0xc292('0x2b'),_0xc292('0x2c'),_0x138ea9,'createdAt',_0xc292('0x3a'),_0xc292('0x2e'),'UserId',_0xc292('0x43')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x263d72)[_0xc292('0xc')](_0xb86fc2)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0xb86fc2+_0xc292('0x32'))['join'](_0x21a39f,null,_0x21a39f+_0xc292('0xe')+_0xb86fc2+'.'+_0x138ea9)[_0xc292('0xd')](_0x569ecf,null,_0x569ecf+_0xc292('0xe')+_0xb86fc2+'.'+_0x138ea9)['where'](_0xb86fc2+_0xc292('0x33'),_0x39ce0d)[_0xc292('0x10')](_0xc292('0x34'),NOW)[_0xc292('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb86fc2,_0x21a39f,_0x138ea9,'cm_hopper',[_0xc292('0x36'),_0xc292('0x37')]))[_0xc292('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb86fc2,_0x21a39f,_0x138ea9,'cm_hopper',[_0xc292('0x36')])))[_0xc292('0x39')]();return _0x26348b;}function insertTzCmHopperBlack(_0x27b706,_0x2bbb57,_0x1d9ae5,_0x1ade37){var _0x4d18b1=[_0xc292('0x20'),_0xc292('0x22'),_0xc292('0x23'),_0x2bbb57+'.'+_0x1ade37,_0xc292('0x24'),_0xc292('0x25')];return squel['insert']()['into'](_0xc292('0x3e'))[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2b'),_0xc292('0x2c'),_0x1ade37,_0xc292('0x2d'),'updatedAt'],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x4d18b1)[_0xc292('0xc')](_0x2bbb57)[_0xc292('0xd')]('cm_contacts',null,_0xc292('0x31')+_0x2bbb57+_0xc292('0x32'))[_0xc292('0xd')](_0x1d9ae5,null,_0x1d9ae5+'.id\x20=\x20'+_0x2bbb57+'.'+_0x1ade37)[_0xc292('0x10')](_0x2bbb57+'.CmListId\x20=\x20?',_0x27b706)['where'](_0xc292('0x34'),NOW)[_0xc292('0x10')](_0xc292('0x35'),squel['select']()['field'](_0xc292('0xb'))[_0xc292('0xc')]('cm_hopper_black')[_0xc292('0x10')](_0xc292('0x3f'),_0x27b706)[_0xc292('0x10')](_0x1ade37+_0xc292('0xf')+_0x2bbb57+'.'+_0x1ade37)))[_0xc292('0x39')]();}function insertCmHopperAdditionalPhones(_0x2a3089){var _0x5e53bc=[_0xc292('0x44'),_0xc292('0x45'),_0xc292('0x46'),_0xc292('0x47'),_0xc292('0x48')];return squel[_0xc292('0x27')]()[_0xc292('0x28')](_0xc292('0x49'))[_0xc292('0x29')]([_0xc292('0x4a'),'phone',_0xc292('0x4b'),_0xc292('0x2d'),_0xc292('0x3a')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x5e53bc)['from'](_0xc292('0x38'))[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x4c'))[_0xc292('0xd')](_0xc292('0x4d'),null,_0xc292('0x4e'))[_0xc292('0x10')](_0xc292('0x4f'),_0x2a3089)['where'](_0xc292('0x34'),NOW))[_0xc292('0x39')]();}function insertCmContact(_0xf5c5bc,_0x1ee835,_0x3130a0,_0xe3997f){var _0x5137aa=_[_0xc292('0x50')](_[_0xc292('0x51')](_0xe3997f),['ListId',_0xc292('0x52'),_0xc292('0x2d'),_0xc292('0x3a')]);return squel['insert']()[_0xc292('0x28')]('cm_contacts')[_0xc292('0x29')](_0x5137aa,squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x5137aa)[_0xc292('0xc')](_0x1ee835)[_0xc292('0x10')]('('+_0x3130a0[_0xc292('0xd')](',')+_0xc292('0x53'),squel[_0xc292('0x3b')]()['fields'](_0x3130a0)[_0xc292('0xc')](_0xc292('0x30'))[_0xc292('0x10')]('ListId\x20=\x20?',_0xf5c5bc)[_0xc292('0x10')](_0xc292('0x54')))[_0xc292('0x10')](_0xc292('0x55'),squel[_0xc292('0x3b')]()[_0xc292('0x3d')](_0xc292('0x56'),_0xc292('0x57'))[_0xc292('0xc')](_0x1ee835)[_0xc292('0x58')](_0x3130a0[_0xc292('0xd')](','))))[_0xc292('0x39')]();}function handleStop(){logger['info'](_0xc292('0x59'));stopped=!![];}function handleUncaughtException(_0x1fea9b){logger[_0xc292('0x5a')](_0x1fea9b[_0xc292('0x5b')]);process[_0xc292('0x5c')](0x1);}function handleError(_0x53277a,_0x5ef2ef){stats[_0xc292('0x5d')][_0xc292('0x18')]({'name':_0x5ef2ef[_0xc292('0x5e')],'message':_0x5ef2ef[_0xc292('0x5b')],'row':_0x53277a});}function handleQuery(_0x396738){logger[_0xc292('0x5f')](_0x396738);return db[_0xc292('0x60')][_0xc292('0x61')](_0x396738)['spread'](function(_0xd96041){results['push'](_0xd96041);})[_0xc292('0x62')](function(_0x4cdee0){logger[_0xc292('0x5a')](_0x4cdee0[_0xc292('0x5b')]);});}function updateTzCampaigns(_0x573305){return new Promise(function(_0x3c0c03,_0x10d169){var _0x40f7a2=squel[_0xc292('0x3b')]()[_0xc292('0x3c')]([_0xc292('0x63'),'campaigns.dialTimezone'])['from']('campaigns')[_0xc292('0xd')](_0xc292('0x64'),null,_0xc292('0x65'))['where'](_0xc292('0x66')+_0x573305);db[_0xc292('0x60')][_0xc292('0x61')](_0x40f7a2[_0xc292('0x39')]())[_0xc292('0x67')](function(_0x4846cd){var _0x1cef9f=[];for(var _0x411f27=0x0;_0x411f27<_0x4846cd[_0xc292('0x17')];_0x411f27++){_0x1cef9f['push'](getTimezoneData(_0x4846cd[_0x411f27],tmp_campaigns));}BPromise[_0xc292('0x19')](_0x1cef9f)[_0xc292('0x15')](function(){_0x3c0c03({'val':0x1});});})[_0xc292('0x62')](function(_0x2d9e78){logger['error'](_0x2d9e78[_0xc292('0x5b')]);_0x3c0c03({'val':0x0});});});}function updateTzVoiceQueues(_0x2d53f4){return new Promise(function(_0x352819,_0xdf3e38){var _0x46a3fa=squel[_0xc292('0x3b')]()['fields']([_0xc292('0x68'),_0xc292('0x69')])[_0xc292('0xc')]('voice_queues')[_0xc292('0xd')](_0xc292('0x6a'),null,_0xc292('0x6b'))[_0xc292('0x10')](_0xc292('0x6c')+_0x2d53f4);db[_0xc292('0x60')][_0xc292('0x61')](_0x46a3fa[_0xc292('0x39')]())[_0xc292('0x67')](function(_0x4167ee){var _0x11fbf1=[];for(var _0x1512e1=0x0;_0x1512e1<_0x4167ee[_0xc292('0x17')];_0x1512e1++){_0x11fbf1['push'](getTimezoneData(_0x4167ee[_0x1512e1],tmp_voice_queues));}BPromise[_0xc292('0x19')](_0x11fbf1)[_0xc292('0x15')](function(){_0x352819({'val':0x1});});})[_0xc292('0x62')](function(_0x40887c){logger[_0xc292('0x5a')](_0x40887c[_0xc292('0x5b')]);_0x352819({'val':0x0});});});}function getTimezoneData(_0x3fa3d8,_0x491024){return new Promise(function(_0x7a710a,_0xc3b2ec){var _0x25a00b=shared[_0xc292('0x6d')];var _0x5bff81=_0x25a00b[_0x3fa3d8[_0xc292('0x6e')]];if(_[_0xc292('0x6f')](_0x5bff81)){_0x7a710a({'ret':0x1});}else{var _0x182126=_0x5bff81['utcOffset'];var _0x461d19=squel[_0xc292('0x27')]()[_0xc292('0x28')](_0x491024)[_0xc292('0x70')]('id',_0x3fa3d8['id'])[_0xc292('0x70')](_0xc292('0x71'),_0x182126)[_0xc292('0x70')](_0xc292('0x6e'),_0x3fa3d8['dialTimezone'])[_0xc292('0x39')]();return db[_0xc292('0x60')]['query'](_0x461d19)['spread'](function(_0x5a7437){_0x7a710a({'ret':0x1});})[_0xc292('0x62')](function(_0x577d4c){logger[_0xc292('0x5a')](_0x577d4c['message']);_0xc3b2ec({'ret':0x1});});}});}function handleTZQuery(_0x6f11f1){logger['info'](_0x6f11f1);return db[_0xc292('0x60')][_0xc292('0x61')](_0x6f11f1)[_0xc292('0x67')](function(_0x1c2952){})[_0xc292('0x62')](function(_0x5d4c1a){logger[_0xc292('0x5a')](_0x5d4c1a[_0xc292('0x5b')]);});}function main(_0x14a4d5,_0x56d517,_0x43441e,_0x3ec439){logger[_0xc292('0x5f')](_0xc292('0x72'),_0x14a4d5,JSON[_0xc292('0x73')](_0x56d517));process['send'](_0xc292('0x74'));var _0x64d757=_0x56d517[_0xc292('0x75')];var _0x2cff18=_[_0xc292('0x76')](_0x64d757);var _0x54a79d=_0x56d517[_0xc292('0x77')];var _0x2da55d=path[_0xc292('0xd')](config[_0xc292('0x78')],'server/files/tmp',_0x54a79d+_0xc292('0x79'));hasTZ=_['keys'](_0x64d757)[_0xc292('0x7a')]('dialTimezone');var _0x45bb17=_[_0xc292('0x51')](_0x64d757)[_0xc292('0xd')]();logger[_0xc292('0x5f')](_0xc292('0x7b'),_0x45bb17);db['ContactItemType'][_0xc292('0x13')]({'raw':!![],'attributes':['id',_0xc292('0x7c')]})[_0xc292('0x15')](function(_0x3a3fe6){for(var _0x563482=0x0;_0x563482<_0x3a3fe6[_0xc292('0x17')];_0x563482++){if(_0x3a3fe6[_0x563482][_0xc292('0x7c')]in _0x64d757){contactItemTypes[_0xc292('0x18')](_0x3a3fe6[_0x563482]);delete _0x2cff18[_0x3a3fe6[_0x563482][_0xc292('0x7c')]];hasAdditionalPhones=!![];}for(var _0x396917 in _0x64d757){if(_0x3a3fe6[_0x563482][_0xc292('0x7c')]+_0xc292('0x7d')===_0x396917){phoneDescriptions['push']({'itemTypeId':_0x3a3fe6[_0x563482]['id'],'description':_0x396917});delete _0x2cff18[_0x396917];}}}if(hasAdditionalPhones)_0x2cff18[_0xc292('0x14')]='';var _0x30ed92=_[_0xc292('0x51')](_0x2cff18)[_0xc292('0xd')]();logger[_0xc292('0x5f')]('header',_0x30ed92);fs[_0xc292('0x7e')](_0x2da55d,_0x30ed92+'\x0a');Papa[_0xc292('0x7f')](fs[_0xc292('0x80')](_0x14a4d5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x139ee3,_0x4c75d7){try{for(var _0x50dfa1=0x0,_0x2f57b5=[];_0x50dfa1<_0x139ee3[_0xc292('0x81')][_0xc292('0x17')];_0x50dfa1++){stats[_0xc292('0x82')]+=0x1;if(_0x139ee3[_0xc292('0x5d')][_0x50dfa1]){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],_0x139ee3[_0xc292('0x5d')][_0x50dfa1]);}else{var _0x2a11af=[];var _0x12f8e5=[];var _0x1e5b53={};for(var _0xa6a170 in _0x64d757){let _0x1a99ef=contactItemTypes[_0xc292('0x83')](_0x5da20c=>_0x5da20c[_0xc292('0x7c')]===_0xa6a170);let _0xcebd00=contactItemTypes[_0xc292('0x83')](_0x50ee98=>_0x50ee98[_0xc292('0x7c')]+_0xc292('0x7d')===_0xa6a170);if(_[_0xc292('0x6f')](_0x1a99ef)&&_['isNil'](_0xcebd00)){if(_0x64d757[_0xc292('0x84')](_0xa6a170)){if(_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]){var _0x722c8f=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]['replace'](/"/g,'\x27'));switch(_0xa6a170){case _0xc292('0x2a'):var _0x32c11e=moment(_0x722c8f,_0xc292('0x86'),!![]);if(_0x32c11e[_0xc292('0x87')]()){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc292('0x2e'):var _0x25d168=parseInt(_0x722c8f);_0x722c8f=_[_0xc292('0x88')](_0x25d168)||_0x25d168<0x0||_0x25d168>0x4?_0x3ec439?0x3:0x2:_0x25d168;_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');break;case _0xc292('0x2f'):var _0x41ddfc=parseInt(_0x722c8f);if(_[_0xc292('0x89')](_0x41ddfc)&&_[_0xc292('0x7a')](_0x43441e,_0x41ddfc)){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x41ddfc+'\x22');}else{_0x2a11af['push'](_0xc292('0x8a'));}break;case _0xc292('0x8b'):if(isEmail(_0x722c8f)){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')](_0xc292('0x8c'));}break;case _0xc292('0x8d'):var _0x241cf2=moment(_0x722c8f,_0xc292('0x8e'),!![]);if(_0x241cf2[_0xc292('0x87')]()){_0x2f57b5['push']('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')](_0xc292('0x8f'));}break;case _0xc292('0x6e'):var _0x4ae3bd=shared[_0xc292('0x6d')];var _0xbc6ce7=_0x4ae3bd[_0x722c8f];if(!_['isNil'](_0xbc6ce7)){var _0x2939b9=_0xbc6ce7['utcOffset'];_0x2f57b5['push']('\x22'+_0x722c8f+'\x22');_0x2f57b5[_0xc292('0x18')]('\x22'+_0x2939b9+'\x22');}break;default:_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}}else{switch(_0xa6a170){case'firstName':case _0xc292('0xb'):_0x2a11af['push'](_0xa6a170+'\x20not\x20specified');break;default:_0x2f57b5[_0xc292('0x18')]('\x22\x22');}}}}else{var _0x130f75='';if(!_[_0xc292('0x6f')](_0x1a99ef)){if(!_0x1e5b53[_0xc292('0x84')](_0x1a99ef['id'])){if(!_[_0xc292('0x6f')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]])){var _0x722c8f=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]['replace'](/"/g,'\x27'));var _0x1302b0=phoneDescriptions['find'](_0x5f0936=>_0x5f0936[_0xc292('0x90')]===_0x1a99ef['id']);if(!_[_0xc292('0x6f')](_0x1302b0)){var _0x14b722=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0x1302b0['description']]]['replace'](/"/g,'\x27'));if(!_[_0xc292('0x6f')](_0x14b722))_0x722c8f=_0x722c8f+'§'+_0x14b722;}if(_0x130f75=='')_0x130f75=_0x722c8f;else _0x130f75+='|'+_0x722c8f;}_0x12f8e5['push'](_0x1a99ef['id']+':'+_0x130f75);_0x1e5b53[_0x1a99ef['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x12f8e5['join'](';')+'\x22');}if(_0x2a11af[_0xc292('0x17')]){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],{'code':_0xc292('0x91'),'message':_0x2a11af[_0xc292('0xd')]()});}else{fs[_0xc292('0x92')](_0x2da55d,_0x2f57b5[_0xc292('0xd')]()+'\x0a');}_0x2f57b5=[];}if(!(stats[_0xc292('0x82')]%0xc8)){socket[_0xc292('0x93')](_0xc292('0x94')+_0x54a79d,stats);stats[_0xc292('0x5d')]=[];}}if(stopped){logger[_0xc292('0x5f')](_0xc292('0x95'));_0x4c75d7['abort']();}}catch(_0x2f76ca){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],{'code':_0xc292('0x96'),'message':_0x2f76ca[_0xc292('0x5b')]});logger[_0xc292('0x5a')](_0xc292('0x97'),_0x2f76ca[_0xc292('0x5b')]);}},'complete':function(){try{var _0x24d2ee=[];var _0x4bbe85=[];var _0x3ad39a=_0xc292('0x30');if(_0x56d517['duplicates']&&_0x56d517[_0xc292('0x98')]['length']){_0x3ad39a=_0xc292('0x99')+_0x54a79d;_0x24d2ee[_0xc292('0x18')](_0xc292('0x9a')+_0x3ad39a+_0xc292('0x9b'));}tmp_campaigns=_0xc292('0x9c')+_0x54a79d;tmp_voice_queues=_0xc292('0x9d')+_0x54a79d;_0x4bbe85[_0xc292('0x18')](_0xc292('0x9a')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x4bbe85[_0xc292('0x18')](_0xc292('0x9a')+tmp_voice_queues+_0xc292('0x9e'));BPromise[_0xc292('0x9f')](_0x4bbe85,handleTZQuery)[_0xc292('0x15')](function(_0x5b47d1){updateTzCampaigns(_0x56d517[_0xc292('0x2c')])[_0xc292('0x15')](function(_0x4aba1b){updateTzVoiceQueues(_0x56d517[_0xc292('0x2c')])[_0xc292('0x15')](function(_0x5c2a38){if(hasTZ)_0x30ed92=_0x30ed92['replace'](_0xc292('0x6e'),_0xc292('0xa0'));var _0x195cd2=util['format'](_0xc292('0xa1'),_0x2da55d,_0x3ad39a,_0x30ed92,_0x56d517[_0xc292('0x2c')],_0x56d517[_0xc292('0x52')]||null,NOW,NOW);if(_[_0xc292('0x6f')](_0x64d757['scheduledat'])){_0x195cd2+=_0xc292('0xa2');}_0x24d2ee['push'](_0x195cd2);if(_0x56d517[_0xc292('0x98')]&&_0x56d517[_0xc292('0x98')][_0xc292('0x17')]){_0x24d2ee[_0xc292('0x18')](insertCmContact(_0x56d517[_0xc292('0x2c')],_0x3ad39a,_0x56d517['duplicates'],_0x64d757));_0x24d2ee[_0xc292('0x18')](_0xc292('0xa3')+_0x3ad39a+';');}BPromise[_0xc292('0x9f')](_0x24d2ee,handleQuery)['then'](function(_0x149eb5){BPromise[_0xc292('0x19')]([handleAdditionalPhones()])['then'](function(){_0x24d2ee=[];for(var _0x5d3198=0x0;_0x5d3198\x20\x20','root','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','push','all','length','then','split','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','ContactId','ListId','updatedAt','select'];(function(_0x148403,_0x419dac){var _0x2d3dfd=function(_0x47db43){while(--_0x47db43){_0x148403['push'](_0x148403['shift']());}};_0x2d3dfd(++_0x419dac);}(_0x68b3,0x1d8));var _0x368b=function(_0x28184b,_0x2031d0){_0x28184b=_0x28184b-0x0;var _0xf68df4=_0x68b3[_0x28184b];return _0xf68df4;};'use strict';var fs=require('fs');var path=require(_0x368b('0x0'));var _=require(_0x368b('0x1'));var Papa=require(_0x368b('0x2'));var util=require(_0x368b('0x3'));var BPromise=require(_0x368b('0x4'));var moment=require('moment');var squel=require(_0x368b('0x5'));var Redis=require(_0x368b('0x6'));var db=require(_0x368b('0x7'))['db'];var config=require(_0x368b('0x8'));var shared=require('../../../config/environment/shared');var logger=require(_0x368b('0x9'))(_0x368b('0xa'));config[_0x368b('0xb')]=_[_0x368b('0xc')](config[_0x368b('0xb')],{'host':_0x368b('0xd'),'port':0x18eb});var socket=require(_0x368b('0xe'))(new Redis(config[_0x368b('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x368b('0xf')](_0x368b('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x368b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x160e12){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))*$/[_0x368b('0x11')](_0x160e12);}function selectNotIn(_0x34a110,_0x51d513,_0x4463dc,_0x269cfc,_0x253e4b){return squel['select']()[_0x368b('0x12')](_0x368b('0x13'))['from'](_0x269cfc)[_0x368b('0x14')](_0x51d513,null,_0x51d513+_0x368b('0x15')+_0x269cfc+'.'+_0x4463dc)[_0x368b('0x16')](_0x269cfc+'.'+_0x4463dc+_0x368b('0x17')+_0x34a110+'.'+_0x4463dc)[_0x368b('0x16')](_0x51d513+'.dialCheckDuplicateType\x20IN\x20('+_0x253e4b[_0x368b('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x40faa0,_0x4ce41b){promisesAdditionalPhones=[];return db[_0x368b('0x18')][_0x368b('0x19')]({'raw':!![],'attributes':['id',_0x368b('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x220cd5){if(_0x220cd5!==null){var _0x392376=[];for(var _0x1f1029=0x0;_0x1f1029<_0x220cd5['length'];_0x1f1029++){var _0x102407=_0x220cd5[_0x1f1029];_0x392376[_0x368b('0x1b')](insertAdditionalPhones(_0x102407));}}Promise[_0x368b('0x1c')](_0x392376)['then'](function(){_0x40faa0({'val':0x1});});});});}function insertAdditionalPhones(_0x5d543e){return new Promise(function(_0x3e2e9f,_0x27d2a0){var _0x2c3cec=_0x5d543e[_0x368b('0x1a')];var _0x1a4f20=_0x2c3cec['split'](';');var _0x26447c=[];orderBy=0x0;for(var _0x44cfe6=0x0;_0x44cfe6<_0x1a4f20[_0x368b('0x1d')];_0x44cfe6++){_0x26447c[_0x368b('0x1b')](splitAdditionalPhone(_0x5d543e['id'],_0x1a4f20[_0x44cfe6]));}Promise[_0x368b('0x1c')](_0x26447c)[_0x368b('0x1e')](function(){_0x3e2e9f({'val':_0x1a4f20[_0x368b('0x1d')]});});});}function splitAdditionalPhone(_0x1d8066,_0x508e48){return new Promise(function(_0x13e750,_0x2f08d9){var _0x18869a=_0x508e48[_0x368b('0x1f')](':');var _0x286853=_0x18869a[0x0];var _0x4c2fca=_0x18869a[0x1];if(!_[_0x368b('0x20')](_0x4c2fca)){var _0x1ca429=_0x4c2fca[_0x368b('0x1f')]('|');var _0xafa856=[];for(var _0x77a269=0x0;_0x77a269<_0x1ca429[_0x368b('0x1d')];_0x77a269++){if(_0x1ca429[_0x77a269]!==''){var _0x430e16=_[_0x368b('0x21')](promisesAdditionalPhones,{'contactId':_0x1d8066,'phone':_0x1ca429[_0x77a269]});if(_0x430e16[_0x368b('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x368b('0x1b')]({'contactId':_0x1d8066,'contactTypeId':_0x286853,'phone':_0x1ca429[_0x77a269],'orderBy':orderBy});}}}_0x13e750({'ok':0x1});}else _0x13e750({'res':0x0});});}function createAdditionalPhone(_0x133c1b,_0x344d8a,_0xceec4b,_0x376e61){var _0x4636f4='';var _0x23a83a='';var _0x5dc5fa=_0xceec4b[_0x368b('0x1f')]('§');_0x4636f4=_0x5dc5fa[0x0];if(_0x5dc5fa[_0x368b('0x1d')]==0x2)_0x23a83a=_0x5dc5fa[0x1];return new Promise(function(_0x1e0e46,_0x2b036e){return db[_0x368b('0x22')][_0x368b('0x23')]({'where':{'CmContactId':_0x133c1b,'item':_0x4636f4}})[_0x368b('0x1e')](function(_0x5db0b4){if(_0x5db0b4){return db['CmContactHasItem'][_0x368b('0x24')]({'ItemTypeId':_0x344d8a,'description':_0x23a83a,'OrderBy':_0x376e61},{'where':{'CmContactId':_0x133c1b,'item':_0x4636f4}})[_0x368b('0x1e')](function(_0x3d1ceb){_0x1e0e46({'res':_0x368b('0x25')});});}else{return db['CmContactHasItem'][_0x368b('0x26')]({'CmContactId':_0x133c1b,'item':_0x4636f4,'description':_0x23a83a,'ItemTypeId':_0x344d8a,'OrderBy':_0x376e61,'ItemClass':_0x368b('0x27')})[_0x368b('0x1e')](function(_0x1c68ca){_0x1e0e46({'res':_0x368b('0x28')});});}});});}function insertCmHopper(_0x4d8410,_0x22ada9,_0x424fab,_0x239536,_0xd8187c){var _0x5d36d7=['cm_contacts.phone','cm_contacts.scheduledat',_0x368b('0x29'),_0x368b('0x2a'),_0x22ada9+'.'+_0x239536,_0x368b('0x2b'),_0x368b('0x2c'),_0x368b('0x2d'),'cm_contacts.UserId','\x22'+_0xd8187c+'\x22'];return squel[_0x368b('0x2e')]()[_0x368b('0x2f')]('cm_hopper')[_0x368b('0x30')]([_0x368b('0x13'),'scheduledat',_0x368b('0x31'),_0x368b('0x32'),_0x239536,'createdAt',_0x368b('0x33'),'priority','UserId','recallme'],squel[_0x368b('0x34')]()[_0x368b('0x35')](_0x5d36d7)[_0x368b('0x36')](_0x22ada9)[_0x368b('0x14')](_0x368b('0x37'),null,_0x368b('0x38')+_0x22ada9+_0x368b('0x39'))[_0x368b('0x14')](_0x424fab,null,_0x424fab+_0x368b('0x15')+_0x22ada9+'.'+_0x239536)[_0x368b('0x16')](_0x22ada9+'.CmListId\x20=\x20?',_0x4d8410)[_0x368b('0x16')](_0x368b('0x3a'),NOW)['where'](_0x368b('0x3b'),selectNotIn(_0x22ada9,_0x424fab,_0x239536,_0x368b('0x3c'),[_0x368b('0x3d'),_0x368b('0x3e')]))[_0x368b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x22ada9,_0x424fab,_0x239536,_0x368b('0x3c'),[_0x368b('0x3d')])))[_0x368b('0x3f')]();}function insertCmHopperBlack(_0x3e0210,_0x4e44d0,_0x579cb3,_0x7ba60d){var _0x3d00f9=[_0x368b('0x40'),_0x368b('0x29'),_0x368b('0x2a'),_0x4e44d0+'.'+_0x7ba60d,_0x368b('0x2b'),_0x368b('0x2c')];return squel[_0x368b('0x2e')]()[_0x368b('0x2f')](_0x368b('0x41'))['fromQuery']([_0x368b('0x13'),_0x368b('0x31'),'ListId',_0x7ba60d,_0x368b('0x42'),_0x368b('0x33')],squel[_0x368b('0x34')]()[_0x368b('0x35')](_0x3d00f9)['from'](_0x4e44d0)[_0x368b('0x14')](_0x368b('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x4e44d0+_0x368b('0x39'))[_0x368b('0x14')](_0x579cb3,null,_0x579cb3+_0x368b('0x15')+_0x4e44d0+'.'+_0x7ba60d)['where'](_0x4e44d0+_0x368b('0x43'),_0x3e0210)[_0x368b('0x16')](_0x368b('0x3a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x368b('0x34')]()[_0x368b('0x12')]('phone')[_0x368b('0x36')](_0x368b('0x41'))[_0x368b('0x16')](_0x368b('0x44'),_0x3e0210)[_0x368b('0x16')](_0x7ba60d+_0x368b('0x17')+_0x4e44d0+'.'+_0x7ba60d)))[_0x368b('0x3f')]();}function insertTzCmHopper(_0x269cf5,_0x5db559,_0x33914c,_0x321a64,_0x432df9,_0xcaf3d0){var _0x540d7a=[_0x368b('0x40'),_0x368b('0x45')+_0xcaf3d0+_0x368b('0x46'),_0x368b('0x29'),_0x368b('0x2a'),_0x5db559+'.'+_0x321a64,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x368b('0x2d'),_0x368b('0x47'),'\x22'+_0x432df9+'\x22'];var _0x1c8755=squel['insert']()[_0x368b('0x2f')](_0x368b('0x3c'))[_0x368b('0x30')]([_0x368b('0x13'),_0x368b('0x48'),_0x368b('0x31'),_0x368b('0x32'),_0x321a64,_0x368b('0x42'),_0x368b('0x33'),_0x368b('0x49'),'UserId',_0x368b('0x4a')],squel['select']()[_0x368b('0x35')](_0x540d7a)['from'](_0x5db559)[_0x368b('0x14')]('cm_contacts',null,_0x368b('0x38')+_0x5db559+_0x368b('0x39'))[_0x368b('0x14')](_0x33914c,null,_0x33914c+_0x368b('0x15')+_0x5db559+'.'+_0x321a64)['join'](_0xcaf3d0,null,_0xcaf3d0+_0x368b('0x15')+_0x5db559+'.'+_0x321a64)[_0x368b('0x16')](_0x5db559+_0x368b('0x43'),_0x269cf5)[_0x368b('0x16')](_0x368b('0x3a'),NOW)[_0x368b('0x16')](_0x368b('0x3b'),selectNotIn(_0x5db559,_0x33914c,_0x321a64,_0x368b('0x3c'),[_0x368b('0x3d'),'\x22onlyIfOpen\x22']))[_0x368b('0x16')](_0x368b('0x3b'),selectNotIn(_0x5db559,_0x33914c,_0x321a64,_0x368b('0x3c'),[_0x368b('0x3d')])))[_0x368b('0x3f')]();return _0x1c8755;}function insertTzCmHopperBlack(_0x567301,_0x16492f,_0x1ddb6e,_0x8bee0d){var _0x3992f6=[_0x368b('0x40'),_0x368b('0x29'),_0x368b('0x2a'),_0x16492f+'.'+_0x8bee0d,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()['into'](_0x368b('0x41'))['fromQuery']([_0x368b('0x13'),_0x368b('0x31'),'ListId',_0x8bee0d,'createdAt',_0x368b('0x33')],squel['select']()[_0x368b('0x35')](_0x3992f6)[_0x368b('0x36')](_0x16492f)['join'](_0x368b('0x37'),null,_0x368b('0x38')+_0x16492f+'.CmListId')[_0x368b('0x14')](_0x1ddb6e,null,_0x1ddb6e+'.id\x20=\x20'+_0x16492f+'.'+_0x8bee0d)[_0x368b('0x16')](_0x16492f+_0x368b('0x43'),_0x567301)[_0x368b('0x16')](_0x368b('0x3a'),NOW)['where'](_0x368b('0x3b'),squel[_0x368b('0x34')]()[_0x368b('0x12')](_0x368b('0x13'))['from'](_0x368b('0x41'))['where'](_0x368b('0x44'),_0x567301)[_0x368b('0x16')](_0x8bee0d+'\x20=\x20'+_0x16492f+'.'+_0x8bee0d)))['toString']();}function insertCmHopperAdditionalPhones(_0x200420){var _0xeea586=[_0x368b('0x4b'),_0x368b('0x4c'),_0x368b('0x4d'),'cm_contact_has_items.createdAt',_0x368b('0x4e')];return squel[_0x368b('0x2e')]()['into'](_0x368b('0x4f'))[_0x368b('0x30')]([_0x368b('0x50'),_0x368b('0x13'),'OrderBy',_0x368b('0x42'),_0x368b('0x33')],squel[_0x368b('0x34')]()[_0x368b('0x35')](_0xeea586)['from']('cm_hopper')['join']('cm_contacts',null,_0x368b('0x51'))[_0x368b('0x14')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where']('cm_hopper.ListId\x20=\x20?',_0x200420)['where'](_0x368b('0x3a'),NOW))[_0x368b('0x3f')]();}function insertCmContact(_0xca4639,_0x5d5b4d,_0x1571ca,_0x4ecfa1){var _0x50296f=_[_0x368b('0x52')](_[_0x368b('0x53')](_0x4ecfa1),[_0x368b('0x32'),_0x368b('0x54'),'createdAt',_0x368b('0x33')]);return squel[_0x368b('0x2e')]()[_0x368b('0x2f')]('cm_contacts')[_0x368b('0x30')](_0x50296f,squel[_0x368b('0x34')]()['fields'](_0x50296f)[_0x368b('0x36')](_0x5d5b4d)[_0x368b('0x16')]('('+_0x1571ca['join'](',')+_0x368b('0x55'),squel['select']()[_0x368b('0x35')](_0x1571ca)[_0x368b('0x36')]('cm_contacts')[_0x368b('0x16')](_0x368b('0x44'),_0xca4639)[_0x368b('0x16')](_0x368b('0x56')))[_0x368b('0x16')]('id\x20IN\x20?',squel[_0x368b('0x34')]()[_0x368b('0x12')](_0x368b('0x57'),_0x368b('0x58'))[_0x368b('0x36')](_0x5d5b4d)[_0x368b('0x59')](_0x1571ca[_0x368b('0x14')](','))))[_0x368b('0x3f')]();}function handleStop(){logger['info'](_0x368b('0x5a'));stopped=!![];}function handleUncaughtException(_0x2e37a0){logger['error'](_0x2e37a0[_0x368b('0x5b')]);process[_0x368b('0x5c')](0x1);}function handleError(_0x2f94d3,_0x543ca3){stats['errors'][_0x368b('0x1b')]({'name':_0x543ca3[_0x368b('0x5d')],'message':_0x543ca3[_0x368b('0x5b')],'row':_0x2f94d3});}function handleQuery(_0xb7cef7){logger['info'](_0xb7cef7);return db[_0x368b('0x5e')]['query'](_0xb7cef7)[_0x368b('0x5f')](function(_0x2af914){results[_0x368b('0x1b')](_0x2af914);})['catch'](function(_0x23c349){logger[_0x368b('0x60')](_0x23c349[_0x368b('0x5b')]);});}function updateTzCampaigns(_0x4d6255){return new Promise(function(_0x51dffd,_0x594e85){var _0x7bca21=squel[_0x368b('0x34')]()[_0x368b('0x35')]([_0x368b('0x61'),_0x368b('0x62')])['from'](_0x368b('0x63'))[_0x368b('0x14')]('campaigns_has_cm_lists',null,_0x368b('0x64'))['where']('campaigns_has_cm_lists.CmListId='+_0x4d6255);db[_0x368b('0x5e')][_0x368b('0x65')](_0x7bca21[_0x368b('0x3f')]())[_0x368b('0x5f')](function(_0x2056ad){var _0x46703c=[];for(var _0x4921b0=0x0;_0x4921b0<_0x2056ad[_0x368b('0x1d')];_0x4921b0++){_0x46703c[_0x368b('0x1b')](getTimezoneData(_0x2056ad[_0x4921b0],tmp_campaigns));}BPromise[_0x368b('0x1c')](_0x46703c)['then'](function(){_0x51dffd({'val':0x1});});})['catch'](function(_0x5e8bf3){logger['error'](_0x5e8bf3[_0x368b('0x5b')]);_0x51dffd({'val':0x0});});});}function updateTzVoiceQueues(_0x51061c){return new Promise(function(_0x5ab241,_0x23a1d6){var _0xfd61c8=squel[_0x368b('0x34')]()[_0x368b('0x35')]([_0x368b('0x66'),_0x368b('0x67')])[_0x368b('0x36')](_0x368b('0x68'))['join'](_0x368b('0x69'),null,_0x368b('0x6a'))['where'](_0x368b('0x6b')+_0x51061c);db[_0x368b('0x5e')][_0x368b('0x65')](_0xfd61c8[_0x368b('0x3f')]())[_0x368b('0x5f')](function(_0xc0bd3f){var _0x1ac79c=[];for(var _0x41e848=0x0;_0x41e848<_0xc0bd3f[_0x368b('0x1d')];_0x41e848++){_0x1ac79c[_0x368b('0x1b')](getTimezoneData(_0xc0bd3f[_0x41e848],tmp_voice_queues));}BPromise[_0x368b('0x1c')](_0x1ac79c)[_0x368b('0x1e')](function(){_0x5ab241({'val':0x1});});})[_0x368b('0x6c')](function(_0x12a9a6){logger['error'](_0x12a9a6['message']);_0x5ab241({'val':0x0});});});}function getTimezoneData(_0x2a8eea,_0x2ba4d0){return new Promise(function(_0x31645e,_0x53be5c){var _0x208cbb=shared[_0x368b('0x6d')];var _0x2350b5=_0x208cbb[_0x2a8eea['dialTimezone']];if(_[_0x368b('0x20')](_0x2350b5)){_0x31645e({'ret':0x1});}else{var _0x308362=_0x2350b5['utcOffset'];var _0x235c63=squel[_0x368b('0x2e')]()[_0x368b('0x2f')](_0x2ba4d0)['set']('id',_0x2a8eea['id'])['set'](_0x368b('0x6e'),_0x308362)['set'](_0x368b('0x6f'),_0x2a8eea[_0x368b('0x6f')])[_0x368b('0x3f')]();return db[_0x368b('0x5e')]['query'](_0x235c63)[_0x368b('0x5f')](function(_0x1a35c9){_0x31645e({'ret':0x1});})[_0x368b('0x6c')](function(_0x54c95a){logger[_0x368b('0x60')](_0x54c95a[_0x368b('0x5b')]);_0x53be5c({'ret':0x1});});}});}function handleTZQuery(_0x109447){logger[_0x368b('0x70')](_0x109447);return db['sequelize'][_0x368b('0x65')](_0x109447)['spread'](function(_0x1740a6){})[_0x368b('0x6c')](function(_0x26164a){logger['error'](_0x26164a['message']);});}function main(_0x4bb209,_0x57435b,_0x221d92,_0x3146a9){logger['info']('main',_0x4bb209,JSON[_0x368b('0x71')](_0x57435b));process['send'](_0x368b('0x72'));var _0x1697e4=_0x57435b['binding'];var _0x11c5e2=_['clone'](_0x1697e4);var _0x1c214b=_0x57435b['socket_timestamp'];var _0x1dd4a7=path[_0x368b('0x14')](config['root'],_0x368b('0x73'),_0x1c214b+'.csv');hasTZ=_[_0x368b('0x53')](_0x1697e4)[_0x368b('0x74')]('dialTimezone');var _0x5be9f4=_[_0x368b('0x53')](_0x1697e4)['join']();logger['info'](_0x368b('0x75'),_0x5be9f4);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','name']})['then'](function(_0x37cef5){for(var _0x4a91da=0x0;_0x4a91da<_0x37cef5[_0x368b('0x1d')];_0x4a91da++){if(_0x37cef5[_0x4a91da][_0x368b('0x76')]in _0x1697e4){contactItemTypes['push'](_0x37cef5[_0x4a91da]);delete _0x11c5e2[_0x37cef5[_0x4a91da][_0x368b('0x76')]];hasAdditionalPhones=!![];}for(var _0x3f5e7b in _0x1697e4){if(_0x37cef5[_0x4a91da]['name']+_0x368b('0x77')===_0x3f5e7b){phoneDescriptions['push']({'itemTypeId':_0x37cef5[_0x4a91da]['id'],'description':_0x3f5e7b});delete _0x11c5e2[_0x3f5e7b];}}}if(hasAdditionalPhones)_0x11c5e2['AdditionalPhones']='';var _0x1f4043=_[_0x368b('0x53')](_0x11c5e2)['join']();logger[_0x368b('0x70')]('header',_0x1f4043);fs['writeFileSync'](_0x1dd4a7,_0x1f4043+'\x0a');Papa[_0x368b('0x78')](fs['createReadStream'](_0x4bb209),{'header':!![],'skipEmptyLines':!![],'step':function(_0xb4049,_0x4944d3){try{for(var _0x483ea6=0x0,_0x43a5a6=[];_0x483ea6<_0xb4049['data'][_0x368b('0x1d')];_0x483ea6++){stats[_0x368b('0x79')]+=0x1;if(_0xb4049[_0x368b('0x7a')][_0x483ea6]){handleError(_0xb4049[_0x368b('0x7b')][_0x483ea6],_0xb4049[_0x368b('0x7a')][_0x483ea6]);}else{var _0x150a34=[];var _0x51b65f=[];var _0x54c18={};for(var _0x11ed4b in _0x1697e4){let _0x152108=contactItemTypes[_0x368b('0x7c')](_0x134e28=>_0x134e28['name']===_0x11ed4b);let _0x313462=contactItemTypes[_0x368b('0x7c')](_0x3672e6=>_0x3672e6[_0x368b('0x76')]+_0x368b('0x77')===_0x11ed4b);if(_[_0x368b('0x20')](_0x152108)&&_[_0x368b('0x20')](_0x313462)){if(_0x1697e4[_0x368b('0x7d')](_0x11ed4b)){if(_0xb4049[_0x368b('0x7b')][_0x483ea6][_0x1697e4[_0x11ed4b]]){var _0x381226=_[_0x368b('0x7e')](_0xb4049[_0x368b('0x7b')][_0x483ea6][_0x1697e4[_0x11ed4b]][_0x368b('0x7f')](/"/g,'\x27'));switch(_0x11ed4b){case'scheduledat':var _0x4136e6=moment(_0x381226,_0x368b('0x10'),!![]);if(_0x4136e6[_0x368b('0x80')]()){_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x381226+'\x22');}else{_0x150a34[_0x368b('0x1b')](_0x368b('0x81'));}break;case _0x368b('0x49'):var _0x1bbf12=parseInt(_0x381226);_0x381226=_[_0x368b('0x82')](_0x1bbf12)||_0x1bbf12<0x0||_0x1bbf12>0x4?_0x3146a9?0x3:0x2:_0x1bbf12;_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x381226+'\x22');break;case _0x368b('0x83'):var _0x13077c=parseInt(_0x381226);if(_[_0x368b('0x84')](_0x13077c)&&_['includes'](_0x221d92,_0x13077c)){_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x13077c+'\x22');}else{_0x150a34[_0x368b('0x1b')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x381226)){_0x43a5a6['push']('\x22'+_0x381226+'\x22');}else{_0x150a34[_0x368b('0x1b')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x177737=moment(_0x381226,_0x368b('0x85'),!![]);if(_0x177737[_0x368b('0x80')]()){_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x381226+'\x22');}else{_0x150a34['push'](_0x368b('0x86'));}break;case _0x368b('0x6f'):var _0x1c405c=shared[_0x368b('0x6d')];var _0x209cc9=_0x1c405c[_0x381226];if(!_[_0x368b('0x20')](_0x209cc9)){var _0x4c1a29=_0x209cc9[_0x368b('0x87')];_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x381226+'\x22');_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x4c1a29+'\x22');}break;default:_0x43a5a6[_0x368b('0x1b')]('\x22'+_0x381226+'\x22');}}else{switch(_0x11ed4b){case _0x368b('0x88'):case'phone':_0x150a34[_0x368b('0x1b')](_0x11ed4b+'\x20not\x20specified');break;default:_0x43a5a6[_0x368b('0x1b')]('\x22\x22');}}}}else{var _0x5e770f='';if(!_[_0x368b('0x20')](_0x152108)){if(!_0x54c18['hasOwnProperty'](_0x152108['id'])){if(!_[_0x368b('0x20')](_0xb4049['data'][_0x483ea6][_0x1697e4[_0x11ed4b]])){var _0x381226=_[_0x368b('0x7e')](_0xb4049['data'][_0x483ea6][_0x1697e4[_0x11ed4b]][_0x368b('0x7f')](/"/g,'\x27'));var _0x11a086=phoneDescriptions[_0x368b('0x7c')](_0x2d697e=>_0x2d697e[_0x368b('0x89')]===_0x152108['id']);if(!_[_0x368b('0x20')](_0x11a086)){var _0x31ad68=_[_0x368b('0x7e')](_0xb4049[_0x368b('0x7b')][_0x483ea6][_0x1697e4[_0x11a086[_0x368b('0x8a')]]][_0x368b('0x7f')](/"/g,'\x27'));if(!_[_0x368b('0x20')](_0x31ad68))_0x381226=_0x381226+'§'+_0x31ad68;}if(_0x5e770f=='')_0x5e770f=_0x381226;else _0x5e770f+='|'+_0x381226;}_0x51b65f[_0x368b('0x1b')](_0x152108['id']+':'+_0x5e770f);_0x54c18[_0x152108['id']]=0x1;}}}}if(hasAdditionalPhones){_0x43a5a6['push']('\x22'+_0x51b65f[_0x368b('0x14')](';')+'\x22');}if(_0x150a34['length']){handleError(_0xb4049[_0x368b('0x7b')][_0x483ea6],{'code':'SystemRow','message':_0x150a34[_0x368b('0x14')]()});}else{fs[_0x368b('0x8b')](_0x1dd4a7,_0x43a5a6[_0x368b('0x14')]()+'\x0a');}_0x43a5a6=[];}if(!(stats['rows']%0xc8)){socket[_0x368b('0x8c')](_0x368b('0x8d')+_0x1c214b,stats);stats[_0x368b('0x7a')]=[];}}if(stopped){logger[_0x368b('0x70')]('Abort\x20parser');_0x4944d3[_0x368b('0x8e')]();}}catch(_0x958f91){handleError(_0xb4049[_0x368b('0x7b')][_0x483ea6],{'code':_0x368b('0x8f'),'message':_0x958f91['message']});logger['error']('step',_0x958f91[_0x368b('0x5b')]);}},'complete':function(){try{var _0x3fde19=[];var _0x325d82=[];var _0xaf166a=_0x368b('0x37');if(_0x57435b[_0x368b('0x90')]&&_0x57435b[_0x368b('0x90')][_0x368b('0x1d')]){_0xaf166a=_0x368b('0x91')+_0x1c214b;_0x3fde19['push']('CREATE\x20TABLE\x20'+_0xaf166a+_0x368b('0x92'));}tmp_campaigns=_0x368b('0x93')+_0x1c214b;tmp_voice_queues=_0x368b('0x94')+_0x1c214b;_0x325d82[_0x368b('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x325d82[_0x368b('0x1b')](_0x368b('0x95')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x368b('0x96')](_0x325d82,handleTZQuery)[_0x368b('0x1e')](function(_0xc93771){updateTzCampaigns(_0x57435b[_0x368b('0x32')])['then'](function(_0x33c54d){updateTzVoiceQueues(_0x57435b[_0x368b('0x32')])[_0x368b('0x1e')](function(_0x5243ac){if(hasTZ)_0x1f4043=_0x1f4043['replace'](_0x368b('0x6f'),'dialTimezone,utcOffset');var _0x24ad09=util[_0x368b('0xf')](_0x368b('0x97'),_0x1dd4a7,_0xaf166a,_0x1f4043,_0x57435b[_0x368b('0x32')],_0x57435b[_0x368b('0x54')]||null,NOW,NOW);if(_[_0x368b('0x20')](_0x1697e4[_0x368b('0x48')])){_0x24ad09+=_0x368b('0x98');}_0x3fde19[_0x368b('0x1b')](_0x24ad09);if(_0x57435b[_0x368b('0x90')]&&_0x57435b[_0x368b('0x90')]['length']){_0x3fde19[_0x368b('0x1b')](insertCmContact(_0x57435b[_0x368b('0x32')],_0xaf166a,_0x57435b[_0x368b('0x90')],_0x1697e4));_0x3fde19['push'](_0x368b('0x99')+_0xaf166a+';');}BPromise['each'](_0x3fde19,handleQuery)[_0x368b('0x1e')](function(_0xaf7e6b){BPromise['all']([handleAdditionalPhones()])[_0x368b('0x1e')](function(){_0x3fde19=[];for(var _0x44d285=0x0;_0x44d285\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','map','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','localhost','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','length','isNil','AdditionalPhones','then','message','push','all','split','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','createdAt','updatedAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','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?','id\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','errors','spread','catch','main','stringify','send','start','binding','socket_timestamp','root','.csv','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','data'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x4808,0x160));var _0x8480=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4808[_0x5608a3];return _0x1ed50a;};'use strict';var fs=require('fs');var path=require(_0x8480('0x0'));var _=require(_0x8480('0x1'));var Papa=require(_0x8480('0x2'));var util=require('util');var BPromise=require(_0x8480('0x3'));var moment=require('moment');var squel=require(_0x8480('0x4'));var Redis=require(_0x8480('0x5'));var db=require(_0x8480('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x8480('0x7'))(_0x8480('0x8'));config['redis']=_[_0x8480('0x9')](config['redis'],{'host':_0x8480('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8480('0xb')]));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()[_0x8480('0xc')](_0x8480('0xd'));var tempTableName=_0x8480('0xe')+moment()[_0x8480('0xc')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x27b6d6){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))*$/[_0x8480('0xf')](_0x27b6d6);}function selectNotIn(_0x232440,_0x2301e9,_0x376291,_0x124a76,_0x1bb2a5){return squel[_0x8480('0x10')]()[_0x8480('0x11')](_0x8480('0x12'))[_0x8480('0x13')](_0x124a76)[_0x8480('0x14')](_0x2301e9,null,_0x2301e9+_0x8480('0x15')+_0x124a76+'.'+_0x376291)[_0x8480('0x16')](_0x124a76+'.'+_0x376291+_0x8480('0x17')+_0x232440+'.'+_0x376291)[_0x8480('0x16')](_0x2301e9+_0x8480('0x18')+_0x1bb2a5[_0x8480('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xa15c3c,_0x5ea74c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8480('0x19')][_0x8480('0x1a')](_0x8480('0x1b')+tempTableName)['spread'](function(_0x12ead9){if(_0x12ead9!==null){var _0x2b6f56=[];for(var _0x118b2c=0x0;_0x118b2c<_0x12ead9[_0x8480('0x1c')];_0x118b2c++){var _0x34c687=_0x12ead9[_0x118b2c];if(!_[_0x8480('0x1d')](_0x34c687[_0x8480('0x12')])){if(!_['isNil'](_0x34c687[_0x8480('0x1e')]))_0x2b6f56['push'](insertAdditionalPhones(_0x34c687));promisesContact['push']({'contact':_0x34c687});}}}Promise['all'](_0x2b6f56)[_0x8480('0x1f')](function(){_0xa15c3c({'val':0x1});});})['catch'](function(_0x3e3827){logger['error'](_0x3e3827[_0x8480('0x20')]);});});}function insertAdditionalPhones(_0x4445d8){return new Promise(function(_0x1e2b60,_0x4cfed1){var _0x3165e7=_0x4445d8[_0x8480('0x1e')];if(_[_0x8480('0x1d')](_0x3165e7))_0x4cfed1({'val':0x0});else{var _0xa0fb7e=_0x3165e7['split'](';');var _0x5480c3=[];orderBy=0x0;for(var _0x37f38f=0x0;_0x37f38f<_0xa0fb7e[_0x8480('0x1c')];_0x37f38f++){_0x5480c3[_0x8480('0x21')](splitAdditionalPhone(_0x4445d8['id'],_0xa0fb7e[_0x37f38f]));}Promise[_0x8480('0x22')](_0x5480c3)['then'](function(){_0x1e2b60({'val':_0xa0fb7e[_0x8480('0x1c')]});});}});}function splitAdditionalPhone(_0x51c2d2,_0x560ea2){return new Promise(function(_0x38c7fa,_0x46e353){var _0x3413a6=_0x560ea2['split'](':');var _0x25b1a3=_0x3413a6[0x0];var _0x4ca36e=_0x3413a6[0x1];if(_0x4ca36e!==''){var _0x19f056=_0x4ca36e[_0x8480('0x23')]('|');var _0x5e64eb=[];for(var _0x18edd5=0x0;_0x18edd5<_0x19f056[_0x8480('0x1c')];_0x18edd5++){if(_0x19f056[_0x18edd5]!==''){var _0x3feecd=_[_0x8480('0x24')](promisesAdditionalPhones,{'contactId':_0x51c2d2,'phone':_0x19f056[_0x18edd5]});if(_0x3feecd[_0x8480('0x1c')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x51c2d2,'contactTypeId':_0x25b1a3,'phone':_0x19f056[_0x18edd5],'orderBy':orderBy});}}}_0x38c7fa({'ok':0x1});}else _0x38c7fa({'res':0x0});});}function createAdditionalPhone(_0x350df6,_0x3c0241,_0x53663c,_0x845033){var _0x24f7b4='';var _0x203981='';var _0x319ff1=_0x53663c['split']('§');_0x24f7b4=_0x319ff1[0x0];if(_0x319ff1['length']==0x2)_0x203981=_0x319ff1[0x1];return new Promise(function(_0x4eff81,_0x5a1d25){return db[_0x8480('0x25')][_0x8480('0x26')]({'where':{'CmContactId':_0x350df6,'item':_0x24f7b4}})[_0x8480('0x1f')](function(_0x2286b7){if(_0x2286b7){return db['CmContactHasItem'][_0x8480('0x27')]({'ItemTypeId':_0x3c0241,'description':_0x203981,'OrderBy':_0x845033},{'where':{'CmContactId':_0x350df6,'item':_0x24f7b4}})['then'](function(_0xea820e){_0x4eff81({'res':'updated'});});}else{return db[_0x8480('0x25')][_0x8480('0x28')]({'CmContactId':_0x350df6,'item':_0x24f7b4,'ItemTypeId':_0x3c0241,'description':_0x203981,'OrderBy':_0x845033,'ItemClass':_0x8480('0x29')})[_0x8480('0x1f')](function(_0x4495b1){_0x4eff81({'res':_0x8480('0x2a')});});}});});}function updateContact(_0x2a4218){return new Promise(function(_0x3f938c,_0x3a875a){var _0xaf0e75=_0x2a4218['id'];delete _0x2a4218['id'];return db[_0x8480('0x2b')][_0x8480('0x27')](_0x2a4218,{'where':{'id':_0xaf0e75}})[_0x8480('0x1f')](function(_0x270972){updatedRows+=0x1;return db[_0x8480('0x2c')][_0x8480('0x27')]({'phone':_0x2a4218[_0x8480('0x12')]},{'where':{'ContactId':_0xaf0e75}})[_0x8480('0x1f')](function(_0x3bceb){_0x3f938c({'ret':'OK'});});});});}function insertCmHopper(_0x346662,_0xb00b86,_0x50d045,_0x13a699,_0xb6284f){var _0x16e471=[_0x8480('0x2d'),_0x8480('0x2e'),_0x8480('0x2f'),_0x8480('0x30'),_0xb00b86+'.'+_0x13a699,_0x8480('0x31'),_0x8480('0x32'),_0x8480('0x33'),_0x8480('0x34'),'\x22'+_0xb6284f+'\x22'];return squel[_0x8480('0x35')]()[_0x8480('0x36')](_0x8480('0x37'))[_0x8480('0x38')](['phone','scheduledat',_0x8480('0x39'),'ListId',_0x13a699,'createdAt','updatedAt',_0x8480('0x3a'),_0x8480('0x3b'),'recallme'],squel['select']()[_0x8480('0x3c')](_0x16e471)[_0x8480('0x13')](_0xb00b86)[_0x8480('0x14')](_0x8480('0x3d'),null,_0x8480('0x3e')+_0xb00b86+_0x8480('0x3f'))['join'](_0x50d045,null,_0x50d045+_0x8480('0x15')+_0xb00b86+'.'+_0x13a699)[_0x8480('0x16')](_0xb00b86+_0x8480('0x40'),_0x346662)[_0x8480('0x16')](_0x8480('0x41'),NOW)[_0x8480('0x16')](_0x8480('0x42'),selectNotIn(_0xb00b86,_0x50d045,_0x13a699,_0x8480('0x37'),[_0x8480('0x43'),_0x8480('0x44')]))['where'](_0x8480('0x42'),selectNotIn(_0xb00b86,_0x50d045,_0x13a699,'cm_hopper',['\x22always\x22'])))[_0x8480('0x45')]();}function insertCmHopperBlack(_0x525165,_0x2c27d9,_0x2f4fdb,_0x3780b6){var _0x57b6d0=[_0x8480('0x2d'),_0x8480('0x2f'),_0x8480('0x30'),_0x2c27d9+'.'+_0x3780b6,'cm_contacts.createdAt',_0x8480('0x32')];return squel['insert']()[_0x8480('0x36')](_0x8480('0x46'))[_0x8480('0x38')](['phone','ContactId',_0x8480('0x47'),_0x3780b6,_0x8480('0x48'),_0x8480('0x49')],squel[_0x8480('0x10')]()['fields'](_0x57b6d0)[_0x8480('0x13')](_0x2c27d9)[_0x8480('0x14')]('cm_contacts',null,_0x8480('0x3e')+_0x2c27d9+_0x8480('0x3f'))['join'](_0x2f4fdb,null,_0x2f4fdb+_0x8480('0x15')+_0x2c27d9+'.'+_0x3780b6)['where'](_0x2c27d9+_0x8480('0x40'),_0x525165)['where'](_0x8480('0x41'),NOW)[_0x8480('0x16')](_0x8480('0x42'),squel[_0x8480('0x10')]()[_0x8480('0x11')]('phone')['from']('cm_hopper_black')[_0x8480('0x16')](_0x8480('0x4a'),_0x525165)[_0x8480('0x16')](_0x3780b6+_0x8480('0x4b'),_0x2c27d9+'.'+_0x3780b6)))['toString']();}function insertCmHopperAdditionalPhones(_0x300710){var _0x4a30a4=[_0x8480('0x4c'),_0x8480('0x4d'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x8480('0x4e')];return squel['insert']()[_0x8480('0x36')](_0x8480('0x4f'))[_0x8480('0x38')]([_0x8480('0x50'),_0x8480('0x12'),_0x8480('0x51'),_0x8480('0x48'),_0x8480('0x49')],squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x4a30a4)[_0x8480('0x13')](_0x8480('0x37'))[_0x8480('0x14')](_0x8480('0x3d'),null,_0x8480('0x52'))['join'](_0x8480('0x53'),null,_0x8480('0x54'))[_0x8480('0x16')]('cm_hopper.ListId\x20=\x20?',_0x300710)['where'](_0x8480('0x41'),NOW))[_0x8480('0x45')]();}function insertCmContact(_0x6b1e12,_0x32d873,_0x23cad8,_0x3dcfbb){var _0x51ebdd=_[_0x8480('0x55')](_[_0x8480('0x56')](_0x3dcfbb),['ListId',_0x8480('0x57'),_0x8480('0x48'),_0x8480('0x49')]);return squel[_0x8480('0x35')]()['into'](_0x8480('0x3d'))[_0x8480('0x38')](_0x51ebdd,squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x51ebdd)[_0x8480('0x13')](_0x32d873)[_0x8480('0x16')]('('+_0x23cad8[_0x8480('0x14')](',')+_0x8480('0x58'),squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x23cad8)['from'](_0x8480('0x3d'))[_0x8480('0x16')](_0x8480('0x4a'),_0x6b1e12))['where'](_0x8480('0x59'),squel['select']()[_0x8480('0x11')](_0x8480('0x5a'),_0x8480('0x5b'))[_0x8480('0x13')](_0x32d873)[_0x8480('0x5c')](_0x23cad8[_0x8480('0x14')](','))))['toString']();}function handleStop(){logger[_0x8480('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x45416e){logger[_0x8480('0x5e')](_0x45416e[_0x8480('0x20')]);process[_0x8480('0x5f')](0x1);}function handleError(_0x200f5c,_0x46fe85){stats[_0x8480('0x60')]['push']({'name':_0x46fe85['code'],'message':_0x46fe85['message'],'row':_0x200f5c});}function handleQuery(_0x4f84bb){logger[_0x8480('0x5d')](_0x4f84bb);return db['sequelize']['query'](_0x4f84bb)[_0x8480('0x61')](function(_0x3aa59a){results[_0x8480('0x21')](_0x3aa59a);})[_0x8480('0x62')](function(_0x5a29d4){logger[_0x8480('0x5e')](_0x5a29d4[_0x8480('0x20')]);});}function main(_0x338ffb,_0x343e92,_0x5c49f5,_0x2d74e8){logger[_0x8480('0x5d')](_0x8480('0x63'),_0x338ffb,JSON[_0x8480('0x64')](_0x343e92));process[_0x8480('0x65')](_0x8480('0x66'));var _0x387380=_0x343e92[_0x8480('0x67')];var _0x24ff04=_['clone'](_0x387380);var _0x21501e=_0x343e92[_0x8480('0x68')];var _0x5e0f8a=path[_0x8480('0x14')](config[_0x8480('0x69')],'server/files/tmp',_0x21501e+_0x8480('0x6a'));logger[_0x8480('0x5d')](_0x8480('0x6b'),_0x343e92);db[_0x8480('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x8480('0x6d')]})[_0x8480('0x1f')](function(_0x26eddb){for(var _0x4dec88=0x0;_0x4dec88<_0x26eddb[_0x8480('0x1c')];_0x4dec88++){if(_0x26eddb[_0x4dec88][_0x8480('0x6d')]in _0x387380){contactItemTypes[_0x8480('0x21')](_0x26eddb[_0x4dec88]);delete _0x24ff04[_0x26eddb[_0x4dec88][_0x8480('0x6d')]];hasAdditionalPhones=!![];}for(var _0x8796c3 in _0x387380){if(_0x26eddb[_0x4dec88][_0x8480('0x6d')]+_0x8480('0x6e')===_0x8796c3){phoneDescriptions[_0x8480('0x21')]({'itemTypeId':_0x26eddb[_0x4dec88]['id'],'description':_0x8796c3});delete _0x24ff04[_0x8796c3];}}}if(hasAdditionalPhones)_0x24ff04['AdditionalPhones']='';var _0x132a6e=_[_0x8480('0x56')](_0x24ff04)[_0x8480('0x14')]();logger[_0x8480('0x5d')](_0x8480('0x6f'),_0x132a6e);fs[_0x8480('0x70')](_0x5e0f8a,_0x132a6e+'\x0a');Papa[_0x8480('0x71')](fs[_0x8480('0x72')](_0x338ffb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37d67a,_0x1af43c){try{for(var _0x137d7e=0x0,_0x172f6a=[];_0x137d7e<_0x37d67a['data'][_0x8480('0x1c')];_0x137d7e++){stats['rows']+=0x1;if(_0x37d67a[_0x8480('0x60')][_0x137d7e]){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],_0x37d67a[_0x8480('0x60')][_0x137d7e]);}else{var _0x42ceaf=[];var _0x1295c9=[];var _0x51481c={};for(var _0x592b6f in _0x387380){let _0x130ef1=contactItemTypes[_0x8480('0x74')](_0xf88f2a=>_0xf88f2a[_0x8480('0x6d')]===_0x592b6f);let _0x59a458=contactItemTypes['find'](_0x3bb0e3=>_0x3bb0e3[_0x8480('0x6d')]+_0x8480('0x6e')===_0x592b6f);if(_['isNil'](_0x130ef1)&&_[_0x8480('0x1d')](_0x59a458)){if(_0x387380[_0x8480('0x75')](_0x592b6f)){if(_0x37d67a[_0x8480('0x73')][_0x137d7e][_0x387380[_0x592b6f]]){var _0x3eb307=_[_0x8480('0x76')](_0x37d67a['data'][_0x137d7e][_0x387380[_0x592b6f]]['replace'](/"/g,'\x27'));switch(_0x592b6f){case _0x8480('0x77'):var _0x3daf8b=moment(_0x3eb307,_0x8480('0xd'),!![]);if(_0x3daf8b['isValid']()){_0x172f6a['push']('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf['push'](_0x8480('0x78'));}break;case _0x8480('0x3a'):var _0x126b68=parseInt(_0x3eb307);_0x3eb307=_[_0x8480('0x79')](_0x126b68)||_0x126b68<0x0||_0x126b68>0x4?_0x2d74e8?0x3:0x2:_0x126b68;_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');break;case'UserId':var _0x2239ba=parseInt(_0x3eb307);if(_['isNumber'](_0x2239ba)&&_['includes'](_0x5c49f5,_0x2239ba)){_0x172f6a[_0x8480('0x21')]('\x22'+_0x2239ba+'\x22');}else{_0x42ceaf['push'](_0x8480('0x7a'));}break;case _0x8480('0x7b'):if(isEmail(_0x3eb307)){_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf[_0x8480('0x21')](_0x8480('0x7c'));}break;case _0x8480('0x7d'):var _0x4c9f46=moment(_0x3eb307,'YYYY-MM-DD',!![]);if(_0x4c9f46[_0x8480('0x7e')]()){_0x172f6a['push']('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf[_0x8480('0x21')](_0x8480('0x7f'));}break;default:_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');}}else{switch(_0x592b6f){case'firstName':case _0x8480('0x12'):_0x42ceaf['push'](_0x592b6f+_0x8480('0x80'));break;default:_0x172f6a[_0x8480('0x21')]('\x22\x22');}}}}else{var _0x16f28d='';if(!_['isNil'](_0x130ef1)){if(!_0x51481c['hasOwnProperty'](_0x130ef1['id'])){for(var _0x505ef6=0x0;_0x505ef6<_0x387380[_0x592b6f][_0x8480('0x1c')];_0x505ef6++){var _0x3eb307=_[_0x8480('0x76')](_0x37d67a['data'][_0x137d7e][_0x387380[_0x592b6f][_0x505ef6]][_0x8480('0x81')](/"/g,'\x27'));var _0x59c62c=phoneDescriptions[_0x8480('0x74')](_0x2a1e24=>_0x2a1e24[_0x8480('0x82')]===_0x130ef1['id']);if(!_['isNil'](_0x59c62c)){var _0x1523a6=_[_0x8480('0x76')](_0x37d67a[_0x8480('0x73')][_0x137d7e][_0x387380[_0x59c62c['description']][0x0]][_0x8480('0x81')](/"/g,'\x27'));if(!_['isNil'](_0x1523a6))_0x3eb307=_0x3eb307+'§'+_0x1523a6;}if(_0x16f28d=='')_0x16f28d=_0x3eb307;else _0x16f28d+='|'+_0x3eb307;}_0x1295c9[_0x8480('0x21')](_0x130ef1['id']+':'+_0x16f28d);_0x51481c[_0x130ef1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x172f6a[_0x8480('0x21')]('\x22'+_0x1295c9[_0x8480('0x14')](';')+'\x22');}if(_0x42ceaf[_0x8480('0x1c')]){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],{'code':_0x8480('0x83'),'message':_0x42ceaf['join']()});}else{fs[_0x8480('0x84')](_0x5e0f8a,_0x172f6a[_0x8480('0x14')]()+'\x0a');}_0x172f6a=[];}if(!(stats[_0x8480('0x85')]%0xc8)){socket[_0x8480('0x86')](_0x8480('0x87')+_0x21501e,stats);stats[_0x8480('0x60')]=[];}}if(stopped){logger[_0x8480('0x5d')](_0x8480('0x88'));_0x1af43c[_0x8480('0x89')]();}}catch(_0x298032){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],{'code':_0x8480('0x8a'),'message':_0x298032[_0x8480('0x20')]});logger['error']('step',_0x298032[_0x8480('0x20')]);}},'complete':function(){try{var _0x187e20=[];var _0x25d90d=tempTableName;_0x187e20[_0x8480('0x21')](_0x8480('0x8b')+_0x25d90d+_0x8480('0x8c'));logger[_0x8480('0x5d')]('CIS\x20len',contactItemTypes[_0x8480('0x1c')]);var _0x16bbfe=util[_0x8480('0xc')](_0x8480('0x8d'),_0x5e0f8a,_0x25d90d,_0x132a6e,_0x343e92[_0x8480('0x47')],_0x343e92[_0x8480('0x57')]||null,NOW,NOW);if(_[_0x8480('0x1d')](_0x387380['scheduledat'])){_0x16bbfe+=',\x20scheduledAt\x20=\x20NOW()';}_0x187e20[_0x8480('0x21')](_0x16bbfe);BPromise[_0x8480('0x8e')](_0x187e20,handleQuery)[_0x8480('0x1f')](function(_0xff0ea4){BPromise[_0x8480('0x22')]([handleAdditionalPhones()])['then'](function(){_0x187e20=[];for(var _0x241e03=0x0;_0x241e03\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','argv','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','all','then','catch','message','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.priority','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.id','cm_contacts.updatedAt','insert','into','.CmListId','.CmListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','toString','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','error','exit','errors','query','main','stringify','send','start','binding','socket_timestamp','root','.csv','body','findAll','name','_description','header','writeFileSync','parse','data','rows','find','hasOwnProperty','trim','replace','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd237,0x14f));var _0x7d23=function(_0x3f8e20,_0x1daf92){_0x3f8e20=_0x3f8e20-0x0;var _0x54b65e=_0xd237[_0x3f8e20];return _0x54b65e;};'use strict';var fs=require('fs');var path=require(_0x7d23('0x0'));var _=require(_0x7d23('0x1'));var Papa=require(_0x7d23('0x2'));var util=require(_0x7d23('0x3'));var BPromise=require('bluebird');var moment=require(_0x7d23('0x4'));var squel=require(_0x7d23('0x5'));var Redis=require(_0x7d23('0x6'));var db=require(_0x7d23('0x7'))['db'];var config=require(_0x7d23('0x8'));var logger=require(_0x7d23('0x9'))('import');config[_0x7d23('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7d23('0xb'))(new Redis(config[_0x7d23('0xa')]));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()[_0x7d23('0xc')](_0x7d23('0xd'));var tempTableName=_0x7d23('0xe')+moment()[_0x7d23('0xc')](_0x7d23('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2bcd72){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'](_0x2bcd72);}function selectNotIn(_0x25675b,_0x4aebf8,_0x288e84,_0x59cd06,_0x5bd275){return squel['select']()[_0x7d23('0x10')](_0x7d23('0x11'))[_0x7d23('0x12')](_0x59cd06)[_0x7d23('0x13')](_0x4aebf8,null,_0x4aebf8+_0x7d23('0x14')+_0x59cd06+'.'+_0x288e84)[_0x7d23('0x15')](_0x59cd06+'.'+_0x288e84+_0x7d23('0x16')+_0x25675b+'.'+_0x288e84)['where'](_0x4aebf8+'.dialCheckDuplicateType\x20IN\x20('+_0x5bd275[_0x7d23('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xf1db40,_0x270c75){promisesAdditionalPhones=[];promisesContact=[];return db[_0x7d23('0x17')]['query'](_0x7d23('0x18')+tempTableName)['spread'](function(_0xf480b9){if(_0xf480b9!==null){var _0x518220=[];for(var _0x626d75=0x0;_0x626d75<_0xf480b9[_0x7d23('0x19')];_0x626d75++){var _0xc92e23=_0xf480b9[_0x626d75];if(!_[_0x7d23('0x1a')](_0xc92e23[_0x7d23('0x11')])){if(!_['isNil'](_0xc92e23[_0x7d23('0x1b')]))_0x518220[_0x7d23('0x1c')](insertAdditionalPhones(_0xc92e23));promisesContact['push']({'contact':_0xc92e23});}}}Promise[_0x7d23('0x1d')](_0x518220)[_0x7d23('0x1e')](function(){_0xf1db40({'val':0x1});});})[_0x7d23('0x1f')](function(_0x53d64b){logger['error'](_0x53d64b[_0x7d23('0x20')]);});});}function insertAdditionalPhones(_0x3b7005){return new Promise(function(_0x56b0ba,_0x427637){var _0x563e75=_0x3b7005[_0x7d23('0x1b')];if(_['isNil'](_0x563e75))_0x427637({'val':0x0});else{var _0x321849=_0x563e75[_0x7d23('0x21')](';');var _0x59522b=[];orderBy=0x0;for(var _0x296bad=0x0;_0x296bad<_0x321849[_0x7d23('0x19')];_0x296bad++){_0x59522b[_0x7d23('0x1c')](splitAdditionalPhone(_0x3b7005['id'],_0x321849[_0x296bad]));}Promise['all'](_0x59522b)[_0x7d23('0x1e')](function(){_0x56b0ba({'val':_0x321849['length']});});}});}function splitAdditionalPhone(_0x2e6d9f,_0x354b2a){return new Promise(function(_0x1c007a,_0x3a5d87){var _0x23bfae=_0x354b2a[_0x7d23('0x21')](':');var _0xdef075=_0x23bfae[0x0];var _0x4196c7=_0x23bfae[0x1];if(_0x4196c7!==''){var _0x1d79b2=_0x4196c7[_0x7d23('0x21')]('|');var _0x713db8=[];for(var _0x5a9295=0x0;_0x5a9295<_0x1d79b2[_0x7d23('0x19')];_0x5a9295++){if(_0x1d79b2[_0x5a9295]!==''){var _0x1ee7c2=_[_0x7d23('0x22')](promisesAdditionalPhones,{'contactId':_0x2e6d9f,'phone':_0x1d79b2[_0x5a9295]});if(_0x1ee7c2[_0x7d23('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x7d23('0x1c')]({'contactId':_0x2e6d9f,'contactTypeId':_0xdef075,'phone':_0x1d79b2[_0x5a9295],'orderBy':orderBy});}}}_0x1c007a({'ok':0x1});}else _0x1c007a({'res':0x0});});}function createAdditionalPhone(_0x289be5,_0x15e64d,_0xc61f31,_0x4808f2){var _0x395b33='';var _0x4783ad='';var _0x4a5136=_0xc61f31[_0x7d23('0x21')]('§');_0x395b33=_0x4a5136[0x0];if(_0x4a5136[_0x7d23('0x19')]==0x2)_0x4783ad=_0x4a5136[0x1];return new Promise(function(_0xa9f8a6,_0x4b1c92){return db[_0x7d23('0x23')][_0x7d23('0x24')]({'where':{'CmContactId':_0x289be5,'item':_0x395b33}})[_0x7d23('0x1e')](function(_0x2adb02){if(_0x2adb02){return db[_0x7d23('0x23')][_0x7d23('0x25')]({'ItemTypeId':_0x15e64d,'description':_0x4783ad,'OrderBy':_0x4808f2},{'where':{'CmContactId':_0x289be5,'item':_0x395b33}})['then'](function(_0x15379e){_0xa9f8a6({'res':_0x7d23('0x26')});});}else{return db[_0x7d23('0x23')][_0x7d23('0x27')]({'CmContactId':_0x289be5,'item':_0x395b33,'ItemTypeId':_0x15e64d,'description':_0x4783ad,'OrderBy':_0x4808f2,'ItemClass':_0x7d23('0x28')})['then'](function(_0x2f8011){_0xa9f8a6({'res':_0x7d23('0x29')});});}});});}function updateContact(_0x5d4545){return new Promise(function(_0x36fdf4,_0x39db30){var _0x31b87b=_0x5d4545['id'];delete _0x5d4545['id'];return db['CmContact'][_0x7d23('0x25')](_0x5d4545,{'where':{'id':_0x31b87b}})[_0x7d23('0x1e')](function(_0x53f032){updatedRows+=0x1;return db[_0x7d23('0x2a')][_0x7d23('0x25')]({'phone':_0x5d4545[_0x7d23('0x11')]},{'where':{'ContactId':_0x31b87b}})[_0x7d23('0x1e')](function(_0x19efd7){_0x36fdf4({'ret':'OK'});});});});}function insertCmHopper(_0x5eb76f,_0x55e7a0,_0x140840,_0x55431c,_0xea9477){var _0x419e1b=[_0x7d23('0x2b'),_0x7d23('0x2c'),'cm_contacts.id','cm_contacts.ListId',_0x55e7a0+'.'+_0x55431c,_0x7d23('0x2d'),'cm_contacts.updatedAt',_0x7d23('0x2e'),'cm_contacts.UserId','\x22'+_0xea9477+'\x22'];return squel['insert']()['into'](_0x7d23('0x2f'))[_0x7d23('0x30')]([_0x7d23('0x11'),_0x7d23('0x31'),_0x7d23('0x32'),_0x7d23('0x33'),_0x55431c,_0x7d23('0x34'),_0x7d23('0x35'),_0x7d23('0x36'),_0x7d23('0x37'),_0x7d23('0x38')],squel[_0x7d23('0x39')]()[_0x7d23('0x3a')](_0x419e1b)[_0x7d23('0x12')](_0x55e7a0)['join'](_0x7d23('0x3b'),null,_0x7d23('0x3c')+_0x55e7a0+'.CmListId')['join'](_0x140840,null,_0x140840+_0x7d23('0x14')+_0x55e7a0+'.'+_0x55431c)[_0x7d23('0x15')](_0x55e7a0+'.CmListId\x20=\x20?',_0x5eb76f)[_0x7d23('0x15')](_0x7d23('0x3d'),NOW)[_0x7d23('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x55e7a0,_0x140840,_0x55431c,_0x7d23('0x2f'),['\x22always\x22',_0x7d23('0x3e')]))[_0x7d23('0x15')](_0x7d23('0x3f'),selectNotIn(_0x55e7a0,_0x140840,_0x55431c,_0x7d23('0x2f'),[_0x7d23('0x40')])))['toString']();}function insertCmHopperBlack(_0x4efd8e,_0x4eacc9,_0x1d4137,_0x56cc74){var _0xb2062a=[_0x7d23('0x2b'),_0x7d23('0x41'),'cm_contacts.ListId',_0x4eacc9+'.'+_0x56cc74,_0x7d23('0x2d'),_0x7d23('0x42')];return squel[_0x7d23('0x43')]()[_0x7d23('0x44')]('cm_hopper_black')[_0x7d23('0x30')]([_0x7d23('0x11'),_0x7d23('0x32'),'ListId',_0x56cc74,_0x7d23('0x34'),_0x7d23('0x35')],squel['select']()[_0x7d23('0x3a')](_0xb2062a)[_0x7d23('0x12')](_0x4eacc9)[_0x7d23('0x13')](_0x7d23('0x3b'),null,_0x7d23('0x3c')+_0x4eacc9+_0x7d23('0x45'))[_0x7d23('0x13')](_0x1d4137,null,_0x1d4137+'.id\x20=\x20'+_0x4eacc9+'.'+_0x56cc74)[_0x7d23('0x15')](_0x4eacc9+_0x7d23('0x46'),_0x4efd8e)['where'](_0x7d23('0x3d'),NOW)[_0x7d23('0x15')](_0x7d23('0x3f'),squel[_0x7d23('0x39')]()[_0x7d23('0x10')]('phone')['from']('cm_hopper_black')[_0x7d23('0x15')]('ListId\x20=\x20?',_0x4efd8e)[_0x7d23('0x15')](_0x56cc74+_0x7d23('0x47'),_0x4eacc9+'.'+_0x56cc74)))['toString']();}function insertCmHopperAdditionalPhones(_0x2693d9){var _0x1ce901=['cm_hopper.id',_0x7d23('0x48'),_0x7d23('0x49'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel['insert']()[_0x7d23('0x44')](_0x7d23('0x4a'))[_0x7d23('0x30')]([_0x7d23('0x4b'),_0x7d23('0x11'),_0x7d23('0x4c'),_0x7d23('0x34'),_0x7d23('0x35')],squel[_0x7d23('0x39')]()[_0x7d23('0x3a')](_0x1ce901)['from'](_0x7d23('0x2f'))[_0x7d23('0x13')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x7d23('0x4d'),null,_0x7d23('0x4e'))[_0x7d23('0x15')]('cm_hopper.ListId\x20=\x20?',_0x2693d9)[_0x7d23('0x15')](_0x7d23('0x3d'),NOW))[_0x7d23('0x4f')]();}function insertCmContact(_0x4fa3a3,_0x425807,_0x4fb1e9,_0x180b73){var _0x25bf25=_[_0x7d23('0x50')](_[_0x7d23('0x51')](_0x180b73),[_0x7d23('0x33'),_0x7d23('0x52'),_0x7d23('0x34'),'updatedAt']);return squel[_0x7d23('0x43')]()[_0x7d23('0x44')]('cm_contacts')['fromQuery'](_0x25bf25,squel[_0x7d23('0x39')]()[_0x7d23('0x3a')](_0x25bf25)['from'](_0x425807)[_0x7d23('0x15')]('('+_0x4fb1e9['join'](',')+_0x7d23('0x53'),squel['select']()[_0x7d23('0x3a')](_0x4fb1e9)['from'](_0x7d23('0x3b'))['where']('ListId\x20=\x20?',_0x4fa3a3))[_0x7d23('0x15')]('id\x20IN\x20?',squel['select']()['field'](_0x7d23('0x54'),_0x7d23('0x55'))['from'](_0x425807)['group'](_0x4fb1e9[_0x7d23('0x13')](','))))['toString']();}function handleStop(){logger[_0x7d23('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x548206){logger[_0x7d23('0x57')](_0x548206[_0x7d23('0x20')]);process[_0x7d23('0x58')](0x1);}function handleError(_0x322622,_0x25e826){stats[_0x7d23('0x59')][_0x7d23('0x1c')]({'name':_0x25e826['code'],'message':_0x25e826[_0x7d23('0x20')],'row':_0x322622});}function handleQuery(_0x2b6cd5){logger['info'](_0x2b6cd5);return db[_0x7d23('0x17')][_0x7d23('0x5a')](_0x2b6cd5)['spread'](function(_0x1a7307){results[_0x7d23('0x1c')](_0x1a7307);})[_0x7d23('0x1f')](function(_0x9fc45b){logger['error'](_0x9fc45b[_0x7d23('0x20')]);});}function main(_0x6f8b3,_0x5ad14d,_0xff37eb,_0x423732){logger['info'](_0x7d23('0x5b'),_0x6f8b3,JSON[_0x7d23('0x5c')](_0x5ad14d));process[_0x7d23('0x5d')](_0x7d23('0x5e'));var _0x2a015d=_0x5ad14d[_0x7d23('0x5f')];var _0x13c90a=_['clone'](_0x2a015d);var _0x246705=_0x5ad14d[_0x7d23('0x60')];var _0x30b999=path[_0x7d23('0x13')](config[_0x7d23('0x61')],'server/files/tmp',_0x246705+_0x7d23('0x62'));logger[_0x7d23('0x56')](_0x7d23('0x63'),_0x5ad14d);db['ContactItemType'][_0x7d23('0x64')]({'raw':!![],'attributes':['id','name']})[_0x7d23('0x1e')](function(_0x366158){for(var _0x116e16=0x0;_0x116e16<_0x366158[_0x7d23('0x19')];_0x116e16++){if(_0x366158[_0x116e16]['name']in _0x2a015d){contactItemTypes['push'](_0x366158[_0x116e16]);delete _0x13c90a[_0x366158[_0x116e16]['name']];hasAdditionalPhones=!![];}for(var _0x9b333b in _0x2a015d){if(_0x366158[_0x116e16][_0x7d23('0x65')]+_0x7d23('0x66')===_0x9b333b){phoneDescriptions[_0x7d23('0x1c')]({'itemTypeId':_0x366158[_0x116e16]['id'],'description':_0x9b333b});delete _0x13c90a[_0x9b333b];}}}if(hasAdditionalPhones)_0x13c90a[_0x7d23('0x1b')]='';var _0x5b4c4d=_[_0x7d23('0x51')](_0x13c90a)[_0x7d23('0x13')]();logger['info'](_0x7d23('0x67'),_0x5b4c4d);fs[_0x7d23('0x68')](_0x30b999,_0x5b4c4d+'\x0a');Papa[_0x7d23('0x69')](fs['createReadStream'](_0x6f8b3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x872b8f,_0x5aca33){try{for(var _0x42d31c=0x0,_0x22009c=[];_0x42d31c<_0x872b8f[_0x7d23('0x6a')]['length'];_0x42d31c++){stats[_0x7d23('0x6b')]+=0x1;if(_0x872b8f[_0x7d23('0x59')][_0x42d31c]){handleError(_0x872b8f['data'][_0x42d31c],_0x872b8f[_0x7d23('0x59')][_0x42d31c]);}else{var _0x54b754=[];var _0x3a5bc2=[];var _0x3e9487={};for(var _0x486dc3 in _0x2a015d){let _0x17609b=contactItemTypes[_0x7d23('0x6c')](_0x378ad5=>_0x378ad5[_0x7d23('0x65')]===_0x486dc3);let _0x5e03ef=contactItemTypes['find'](_0x45c2ef=>_0x45c2ef[_0x7d23('0x65')]+_0x7d23('0x66')===_0x486dc3);if(_['isNil'](_0x17609b)&&_[_0x7d23('0x1a')](_0x5e03ef)){if(_0x2a015d[_0x7d23('0x6d')](_0x486dc3)){if(_0x872b8f['data'][_0x42d31c][_0x2a015d[_0x486dc3]]){var _0x5cd4ab=_[_0x7d23('0x6e')](_0x872b8f[_0x7d23('0x6a')][_0x42d31c][_0x2a015d[_0x486dc3]][_0x7d23('0x6f')](/"/g,'\x27'));switch(_0x486dc3){case _0x7d23('0x31'):var _0x6054dc=moment(_0x5cd4ab,_0x7d23('0xd'),!![]);if(_0x6054dc['isValid']()){_0x22009c[_0x7d23('0x1c')]('\x22'+_0x5cd4ab+'\x22');}else{_0x54b754[_0x7d23('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0xc2898=parseInt(_0x5cd4ab);_0x5cd4ab=_[_0x7d23('0x70')](_0xc2898)||_0xc2898<0x0||_0xc2898>0x4?_0x423732?0x3:0x2:_0xc2898;_0x22009c['push']('\x22'+_0x5cd4ab+'\x22');break;case _0x7d23('0x37'):var _0x5db517=parseInt(_0x5cd4ab);if(_[_0x7d23('0x71')](_0x5db517)&&_['includes'](_0xff37eb,_0x5db517)){_0x22009c[_0x7d23('0x1c')]('\x22'+_0x5db517+'\x22');}else{_0x54b754[_0x7d23('0x1c')](_0x7d23('0x72'));}break;case _0x7d23('0x73'):if(isEmail(_0x5cd4ab)){_0x22009c[_0x7d23('0x1c')]('\x22'+_0x5cd4ab+'\x22');}else{_0x54b754[_0x7d23('0x1c')](_0x7d23('0x74'));}break;case _0x7d23('0x75'):var _0x54a7f9=moment(_0x5cd4ab,_0x7d23('0x76'),!![]);if(_0x54a7f9[_0x7d23('0x77')]()){_0x22009c[_0x7d23('0x1c')]('\x22'+_0x5cd4ab+'\x22');}else{_0x54b754[_0x7d23('0x1c')](_0x7d23('0x78'));}break;default:_0x22009c[_0x7d23('0x1c')]('\x22'+_0x5cd4ab+'\x22');}}else{switch(_0x486dc3){case _0x7d23('0x79'):case'phone':_0x54b754[_0x7d23('0x1c')](_0x486dc3+_0x7d23('0x7a'));break;default:_0x22009c[_0x7d23('0x1c')]('\x22\x22');}}}}else{var _0x2a506f='';if(!_[_0x7d23('0x1a')](_0x17609b)){if(!_0x3e9487[_0x7d23('0x6d')](_0x17609b['id'])){for(var _0x886b3a=0x0;_0x886b3a<_0x2a015d[_0x486dc3][_0x7d23('0x19')];_0x886b3a++){var _0x5cd4ab=_[_0x7d23('0x6e')](_0x872b8f[_0x7d23('0x6a')][_0x42d31c][_0x2a015d[_0x486dc3][_0x886b3a]][_0x7d23('0x6f')](/"/g,'\x27'));var _0x226464=phoneDescriptions['find'](_0x52fa4b=>_0x52fa4b[_0x7d23('0x7b')]===_0x17609b['id']);if(!_['isNil'](_0x226464)){var _0x5a9abd=_[_0x7d23('0x6e')](_0x872b8f[_0x7d23('0x6a')][_0x42d31c][_0x2a015d[_0x226464[_0x7d23('0x7c')]][0x0]][_0x7d23('0x6f')](/"/g,'\x27'));if(!_[_0x7d23('0x1a')](_0x5a9abd))_0x5cd4ab=_0x5cd4ab+'§'+_0x5a9abd;}if(_0x2a506f=='')_0x2a506f=_0x5cd4ab;else _0x2a506f+='|'+_0x5cd4ab;}_0x3a5bc2['push'](_0x17609b['id']+':'+_0x2a506f);_0x3e9487[_0x17609b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x22009c[_0x7d23('0x1c')]('\x22'+_0x3a5bc2[_0x7d23('0x13')](';')+'\x22');}if(_0x54b754[_0x7d23('0x19')]){handleError(_0x872b8f[_0x7d23('0x6a')][_0x42d31c],{'code':_0x7d23('0x7d'),'message':_0x54b754[_0x7d23('0x13')]()});}else{fs[_0x7d23('0x7e')](_0x30b999,_0x22009c[_0x7d23('0x13')]()+'\x0a');}_0x22009c=[];}if(!(stats[_0x7d23('0x6b')]%0xc8)){socket['emit']('contact:import:'+_0x246705,stats);stats[_0x7d23('0x59')]=[];}}if(stopped){logger[_0x7d23('0x56')](_0x7d23('0x7f'));_0x5aca33['abort']();}}catch(_0x4c6ab7){handleError(_0x872b8f[_0x7d23('0x6a')][_0x42d31c],{'code':_0x7d23('0x80'),'message':_0x4c6ab7[_0x7d23('0x20')]});logger[_0x7d23('0x57')](_0x7d23('0x81'),_0x4c6ab7[_0x7d23('0x20')]);}},'complete':function(){try{var _0x454423=[];var _0x47bcf1=tempTableName;_0x454423['push'](_0x7d23('0x82')+_0x47bcf1+'\x20LIKE\x20cm_contacts;');logger[_0x7d23('0x56')](_0x7d23('0x83'),contactItemTypes[_0x7d23('0x19')]);var _0x36815d=util[_0x7d23('0xc')](_0x7d23('0x84'),_0x30b999,_0x47bcf1,_0x5b4c4d,_0x5ad14d[_0x7d23('0x33')],_0x5ad14d[_0x7d23('0x52')]||null,NOW,NOW);if(_['isNil'](_0x2a015d[_0x7d23('0x31')])){_0x36815d+=',\x20scheduledAt\x20=\x20NOW()';}_0x454423[_0x7d23('0x1c')](_0x36815d);BPromise[_0x7d23('0x85')](_0x454423,handleQuery)[_0x7d23('0x1e')](function(_0x3387c0){BPromise[_0x7d23('0x1d')]([handleAdditionalPhones()])[_0x7d23('0x1e')](function(){_0x454423=[];for(var _0x544182=0x0;_0x544182\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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','mail','getFullTextValue','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','text','value','unreadMessages','read','and','Contact','$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?'];(function(_0x128073,_0x332897){var _0x4e1368=function(_0x586627){while(--_0x586627){_0x128073['push'](_0x128073['shift']());}};_0x4e1368(++_0x332897);}(_0x19ea,0xfe));var _0xa19e=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x19ea[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0xa19e('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0xa19e('0x1'));var updateInteraction=require('./update-interaction')[_0xa19e('0x2')];var utils=require(_0xa19e('0x3'));var db=require(_0xa19e('0x4'))['db'];function skipInteractionsQuery(_0x4d323a,_0x4a6556,_0x1fac51){var _0x2a8e2c=![];var _0x29fe52=utils[_0xa19e('0x5')](_0x4d323a);if(_0x4a6556[_0xa19e('0x6')]===_0xa19e('0x7')&&!_0x1fac51[_0xa19e('0x8')]&&!_0x1fac51[_0x29fe52]){_0x2a8e2c=!![];}return _0x2a8e2c;}function getTagsQuery(){return squel[_0xa19e('0x9')]()[_0xa19e('0xa')]('id')[_0xa19e('0xa')](_0xa19e('0xb'))['field'](_0xa19e('0xc'))[_0xa19e('0xd')](_0xa19e('0xe'));}function getUsersQuery(_0x8e307b,_0x54bf8c){var _0x13818d=utils[_0xa19e('0xf')](_0x8e307b);var _0xfb8dbf='user_has_'+_0x8e307b+_0xa19e('0x10');var _0x1d63b6=squel[_0xa19e('0x9')]()[_0xa19e('0xa')](_0xa19e('0x11'))['field'](_0xa19e('0x12'))[_0xa19e('0xa')](_0xa19e('0x13')+_0x13818d)[_0xa19e('0xd')](_0xfb8dbf,'ui')[_0xa19e('0x14')](_0xa19e('0x15'),'u',_0xa19e('0x16'));if(_0x54bf8c[_0xa19e('0x17')]>0x0){_0x1d63b6[_0xa19e('0x18')](_0xa19e('0x13')+_0x13818d+_0xa19e('0x19'),_['map'](_0x54bf8c,'id'));}return _0x1d63b6;}function getInteractionsQuery(_0x28fd37){var _0x34066a=utils[_0xa19e('0x1a')](_0x28fd37);var _0x256819=utils[_0xa19e('0x5')](_0x28fd37);var _0x38e398=utils[_0xa19e('0xf')](_0x28fd37);return squel['select']()[_0xa19e('0xd')](_0x34066a['interactions'],'i')[_0xa19e('0x14')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa19e('0x14')](_0xa19e('0x15'),'o','o.id\x20=\x20i.UserId')[_0xa19e('0x14')](_0x34066a[_0xa19e('0x1b')],'a',_0xa19e('0x1c')+_0x256819)[_0xa19e('0x14')](_0x34066a['messages'],'me',_0xa19e('0x1d')+_0x38e398+_0xa19e('0x1e'))[_0xa19e('0x14')](_0x34066a[_0xa19e('0x1f')],'it',_0xa19e('0x20')+_0x38e398+_0xa19e('0x1e'))[_0xa19e('0x14')](_0xa19e('0xe'),'t',_0xa19e('0x21'));}function getSqlClauses(){var _0x536386={'body':squel[_0xa19e('0x22')](),'contact':squel[_0xa19e('0x22')](),'default':squel['expr'](),'fields':squel[_0xa19e('0x22')](),'filter':squel[_0xa19e('0x22')](),'read':squel['expr'](),'tags':{'clause':squel[_0xa19e('0x22')](),'ids':null},'user':squel[_0xa19e('0x22')]()};return _0x536386;}function parseTagParameter(_0x5d5559){var _0x40dc1c=squel[_0xa19e('0x22')]();if(_0x5d5559){var _0x2bd823=utils[_0xa19e('0x23')](_0x5d5559);_0x2bd823[_0xa19e('0x24')](function(_0x180407){_0x40dc1c['or'](_0xa19e('0x25'),'%,'+_0x180407+',%');});}return _0x40dc1c;}function parseReadParameter(_0x3f5ac6){var _0x18c96f='';if(_0x3f5ac6){_0x18c96f=_0xa19e('0x26');if(_0x3f5ac6==='1'){_0x18c96f=_0x18c96f[_0xa19e('0x27')](_0xa19e('0x28'),'=');}else{_0x18c96f=_0x18c96f[_0xa19e('0x27')](_0xa19e('0x28'),'>');}}return _0x18c96f;}function parseSearchFilter(_0xdf0b20,_0x4613c3){var _0x16bcd5=squel[_0xa19e('0x22')]();if(_0x4613c3){var _0x3dcd74=_0x4613c3[_0xa19e('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa19e('0x29')](_0x3dcd74)){_0x16bcd5['or'](_0xa19e('0x2a'),_0x3dcd74+'%');if([_0xa19e('0x2b'),_0xa19e('0x2c')][_0xa19e('0x2d')](_0xdf0b20)){_0x16bcd5['or'](_0xa19e('0x2e'),_0x3dcd74+'%');}else if(_0xdf0b20==='fax'){_0x16bcd5['or'](_0xa19e('0x2f'),_0x3dcd74+'%');}else if(_0xdf0b20===_0xa19e('0x30')){_0x16bcd5['or']('i.from\x20LIKE\x20?',_0x3dcd74+'%');}}else if(_0xdf0b20===_0xa19e('0x31')&&qs['isEmail'](_0x3dcd74)){_0x16bcd5['or']('c.email\x20LIKE\x20?',_0x3dcd74+'%');}else{if(_0xdf0b20===_0xa19e('0x31')){_0x16bcd5['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3dcd74))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa19e('0x32')](_0x3dcd74));}else{if(_0xdf0b20!==_0xa19e('0x33')){_0x16bcd5['or'](_0xa19e('0x34'),qs['getFullTextValue'](_0x3dcd74));}_0x16bcd5['or'](_0xa19e('0x35'),_0x3dcd74+'%');}}}return _0x16bcd5;}function parseAdvancedSearchFilter(_0x3f959c,_0x1f9af3){var _0x288a41=getSqlClauses();var _0xf857e7=as[_0xa19e('0x36')](_0x3f959c);var _0x53899a=_0xf857e7[_0xa19e('0x37')];for(var _0x434081=0x0;_0x434081<_0xf857e7['conditions'][_0xa19e('0x17')];_0x434081++){var _0x12b20a=_0xf857e7[_0xa19e('0x38')][_0x434081];var _0x5824c5='i';var _0x4bf11f=_[_0xa19e('0x39')](_0x1f9af3,['name',_0x12b20a[_0xa19e('0xa')]]);if(_0x4bf11f){var _0x13b2f8=as[_0xa19e('0x3a')](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41['default'][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8[_0xa19e('0x3d')]['start'],_0x13b2f8[_0xa19e('0x3d')]['end']);}else{switch(_0x12b20a[_0xa19e('0xa')]){case _0xa19e('0x3e'):var _0x209424=parseReadParameter(_0x12b20a['value']);_0x288a41[_0xa19e('0x3f')][_0xa19e('0x40')](_0x209424);break;case _0xa19e('0x41'):if(_0x12b20a['operator']===_0xa19e('0x42')){if(_0x12b20a[_0xa19e('0x3d')]['split']('\x20')['length']>0x1){_0x288a41[_0xa19e('0x43')][_0x53899a](_0xa19e('0x44'),qs['getFullTextValue'](_0x12b20a[_0xa19e('0x3d')]),null);}else{var _0x2d43b4='%'+_0x12b20a['value']+'%';_0x288a41[_0xa19e('0x43')][_0x53899a](_0xa19e('0x45'),_0x2d43b4,_0x2d43b4,_0x2d43b4);}}else{_0x4bf11f=_[_0xa19e('0x39')](_0x1f9af3,[_0xa19e('0xb'),_0xa19e('0x46')]);_0x12b20a['field']=_0xa19e('0x46');_0x13b2f8=as[_0xa19e('0x3a')](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41[_0xa19e('0x43')][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8['value'][_0xa19e('0x47')],_0x13b2f8['value'][_0xa19e('0x48')]);}break;case _0xa19e('0x49'):var _0x5d493c=_0x12b20a[_0xa19e('0x3d')][_0xa19e('0x4a')](',')['map'](function(_0x41d7ae){return Number(_0x41d7ae);});var _0x5b58b1=parseTagParameter(_0x5d493c);_0x288a41[_0xa19e('0x4b')][_0xa19e('0x4c')][_0xa19e('0x40')](_0x5b58b1);_0x288a41[_0xa19e('0x4b')][_0xa19e('0x4d')]=_0x5d493c;break;case _0xa19e('0x4e'):if(_0x12b20a[_0xa19e('0x4f')]===_0xa19e('0x42')){_0x288a41['user'][_0x53899a](_0xa19e('0x50'),'%'+_0x12b20a[_0xa19e('0x3d')]+'%',null);}else{_0x4bf11f=_['find'](_0x1f9af3,['name',_0xa19e('0x51')]);_0x12b20a[_0xa19e('0xa')]=_0xa19e('0x51');_0x13b2f8=as['buildExpression'](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41[_0xa19e('0x52')][_0x53899a](_0x13b2f8['text'],_0x13b2f8[_0xa19e('0x3d')][_0xa19e('0x47')],_0x13b2f8[_0xa19e('0x3d')]['end']);}break;case _0xa19e('0x53'):case'plainBody':_0x13b2f8=as[_0xa19e('0x3a')]('me',null,_0x12b20a);_0x288a41[_0xa19e('0x53')][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8[_0xa19e('0x3d')][_0xa19e('0x47')],_0x13b2f8['value'][_0xa19e('0x48')]);break;}}}return _0x288a41;}function parseModelFields(_0x4c90fe,_0x4779d8,_0x5d2e5f){var _0x17e36e=utils[_0xa19e('0x5')](_0x4c90fe);var _0x2db3b2=squel[_0xa19e('0x22')]();var _0x538c9a=_(_0x4779d8)[_0xa19e('0x54')]()[_0xa19e('0x55')](function(_0x427214){return _[_0xa19e('0x56')](_0x5d2e5f,['name',_0x427214])?_0x427214:undefined;})[_0xa19e('0x57')]()['value']();if(_0x538c9a[_0xa19e('0x17')]>0x0){_0x538c9a[_0xa19e('0x24')](function(_0x3309ec){if(_0x3309ec===_0x17e36e){_0x2db3b2['and']('i.'+_0x17e36e+_0xa19e('0x19'),[][_0xa19e('0x58')](_0x4779d8[_0x3309ec]));}else if(_0x3309ec==='createdAt'){var _0x101576=JSON[_0xa19e('0x59')](_0x4779d8[_0x3309ec])[_0xa19e('0x5a')];var _0x3f8751=JSON['parse'](_0x4779d8[_0x3309ec])['$lte'];_0x2db3b2[_0xa19e('0x40')](_0xa19e('0x5b'),_0x101576,_0x3f8751);}else{if(_0x4779d8[_0x3309ec]==='null'){_0x2db3b2[_0xa19e('0x40')]('i.'+_0x3309ec+_0xa19e('0x5c'));}else{_0x2db3b2['and']('i.'+_0x3309ec+_0xa19e('0x5d'),_0x4779d8[_0x3309ec]);}}});}return _0x2db3b2;}function parseQueryParameters(_0x68e0d1,_0x44a946,_0x22890b){var _0x3cc870=getSqlClauses();return Promise[_0xa19e('0x5e')]()[_0xa19e('0x5f')](function(){return parseModelFields(_0x68e0d1,_0x44a946,_0x22890b);})[_0xa19e('0x5f')](function(_0x9008e4){_0x3cc870[_0xa19e('0x60')][_0xa19e('0x40')](_0x9008e4);return parseReadParameter(_0x44a946['read']);})['then'](function(_0x2f37b0){_0x3cc870[_0xa19e('0x3f')][_0xa19e('0x40')](_0x2f37b0);return parseTagParameter(_0x44a946['tag']);})['then'](function(_0x51b2cc){_0x3cc870[_0xa19e('0x4b')]['clause'][_0xa19e('0x40')](_0x51b2cc);return parseSearchFilter(_0x68e0d1,_0x44a946[_0xa19e('0x61')]);})[_0xa19e('0x5f')](function(_0xdf2b29){_0x3cc870['filter']=_0xdf2b29;return _0x3cc870;});}function checkAccountsRestrictions(_0x966a23,_0xe4bb66,_0x437292){var _0xfe4a4=utils[_0xa19e('0x5')](_0x966a23);var _0x12064e=_0xa19e('0x62')+_[_0xa19e('0x63')](_0x966a23)+(_0x966a23===_0xa19e('0x64')?_0xa19e('0x65'):_0xa19e('0x66'));var _0xae7dbc=squel[_0xa19e('0x22')]();return Promise[_0xa19e('0x5e')]()[_0xa19e('0x5f')](function(){if(_0x437292[_0xa19e('0x8')]&&_0xe4bb66[_0xa19e('0x6')]==='agent'){return _0xe4bb66[_0x12064e]({'attributes':['id'],'raw':!![]});}})[_0xa19e('0x5f')](function(_0x3cf325){if(_0x3cf325){if(_0x3cf325['length']===0x0){_0xae7dbc[_0xa19e('0x40')]('i.'+_0xfe4a4+'\x20IS\x20NULL');}else{_0xae7dbc['and']('i.'+_0xfe4a4+_0xa19e('0x19'),_[_0xa19e('0x55')](_0x3cf325,'id'));}}else if(!_0x437292[_0xfe4a4]){_0xae7dbc[_0xa19e('0x40')]('i.'+_0xfe4a4+'\x20IS\x20NOT\x20NULL');}})[_0xa19e('0x5f')](function(){return _0xae7dbc;});}function getClosedOrderClause(_0x4ad542,_0x462a4e){var _0x5afd28='';var _0x423d57=[_0xa19e('0x67'),_0xa19e('0x68'),_0xa19e('0x69')];if(_0x4ad542===_0xa19e('0x31')){_0x423d57['unshift'](_0xa19e('0x6a'));}if(_0x462a4e['closed']==='0'&&_0x4ad542===_0xa19e('0x31')){_0x5afd28=_0xa19e('0x6a');}else{if(_0x462a4e[_0xa19e('0x6b')]==='1'){_0x423d57[_0xa19e('0x6c')]();}_0x5afd28=_0xa19e('0x6d')+_0x423d57[_0xa19e('0x6e')](',\x20')+')';}return _0x5afd28;}function getFilteredInteractions(_0x9d442b,_0x331b17,_0x340df1,_0x3f6bf7){var _0x307a5d=utils[_0xa19e('0xf')](_0x9d442b);var _0x481e43=_[_0xa19e('0x63')](_0x9d442b)+_0xa19e('0x6f');var _0x5ca466=[];var _0x4195c9=getTagsQuery();var _0x53a806={'type':db[_0xa19e('0x70')]['QueryTypes'][_0xa19e('0x71')],'raw':!![]};var _0x45f260=[];var _0x52159a=[];return db[_0xa19e('0x72')]['query'](_0x4195c9[_0xa19e('0x73')](),_0x53a806)[_0xa19e('0x5f')](function(_0x14da59){_0x5ca466=_[_0xa19e('0x74')](_0x14da59,'id');_0x53a806=_[_0xa19e('0x75')](_0x53a806,{'model':db[_0x481e43],'mapToModel':!![],'nest':!![]});if(_0x340df1[_0xa19e('0x60')]){_0x3f6bf7['attributes'][_0xa19e('0x24')](function(_0x45e5f6){_0x331b17[_0xa19e('0xa')]('i.'+_0x45e5f6);});}else{_0x331b17['field'](_0xa19e('0x76'),_0xa19e('0x3e'));_0x331b17[_0xa19e('0xa')]('a.key',_0xa19e('0x77'));_0x331b17[_0xa19e('0xa')]('a.mandatoryDisposition',_0xa19e('0x78'));if(_0x9d442b===_0xa19e('0x31')){_0x331b17[_0xa19e('0xa')]('a.email',_0xa19e('0x79'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7a'),_0xa19e('0x7b'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7c'));_0x331b17[_0xa19e('0xa')]('i.createdAt');_0x331b17[_0xa19e('0xa')](_0xa19e('0x7d'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7e'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7f'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x80'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x81'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x82'));_0x331b17[_0xa19e('0xa')]('i.subject');_0x331b17[_0xa19e('0xa')](_0xa19e('0x69'));_0x331b17['field'](_0xa19e('0x68'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x67'));_0x331b17['field'](_0xa19e('0x6a'));_0x331b17['field']('i.to');_0x331b17['field'](_0xa19e('0x83'));_0x331b17['field'](_0xa19e('0x84'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x85'));}else if(_0x9d442b==='openchannel'){_0x331b17[_0xa19e('0xa')](_0xa19e('0x86'),_0xa19e('0x7b'));}else{_0x331b17[_0xa19e('0xa')](_0xa19e('0x87'),_0xa19e('0x7b'));}if(_0x9d442b!==_0xa19e('0x31')){_0x331b17[_0xa19e('0xa')]('i.*');}_0x331b17[_0xa19e('0xa')]('c.firstName',_0xa19e('0x88'));_0x331b17['field'](_0xa19e('0x89'),_0xa19e('0x8a'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x8b'),_0xa19e('0x8c'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x8d'),'Contact.phone');_0x331b17[_0xa19e('0xa')](_0xa19e('0x8e'),_0xa19e('0x8f'));_0x331b17[_0xa19e('0xa')]('c.fax',_0xa19e('0x90'));_0x331b17['field']('o.fullname','Owner.fullname');_0x331b17[_0xa19e('0xa')](_0xa19e('0x91'),_0xa19e('0x92'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x93'),_0xa19e('0x94'));}if(_0x3f6bf7['limit']){_0x331b17[_0xa19e('0x95')](_0x3f6bf7['limit']);}if(_0x3f6bf7[_0xa19e('0x96')]){_0x331b17['offset'](_0x3f6bf7['offset']);}return db['sequelize'][_0xa19e('0x97')](_0x331b17[_0xa19e('0x73')](),_0x53a806);})[_0xa19e('0x5f')](function(_0x29177c){_0x45f260=_0x29177c;var _0x45ae6d=getUsersQuery(_0x9d442b,_0x45f260);return db[_0xa19e('0x72')][_0xa19e('0x97')](_0x45ae6d[_0xa19e('0x73')](),_0x53a806);})[_0xa19e('0x5f')](function(_0x23cefa){_0x52159a=_[_0xa19e('0x98')](_0x23cefa,_0x307a5d);if(_0x9d442b===_0xa19e('0x31')){return db['Setting'][_0xa19e('0x99')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x444a6e){var _0x23b6d9=_0x444a6e?_0x444a6e[_0xa19e('0x9a')]:undefined;var _0x3f2610=_0x45f260[_0xa19e('0x55')](function(_0x2ce237){return updateInteraction(_0x2ce237,_0x5ca466,_0x52159a,_0x23b6d9);});return Promise[_0xa19e('0x9b')](_0x3f2610);});}function countFilteredInteractions(_0x1c77d4,_0x52e038){var _0xc1d84e=_0x1c77d4[_0xa19e('0x9c')]();_0xc1d84e['field'](_0xa19e('0x9d'));_0xc1d84e[_0xa19e('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x12cb29=utils[_0xa19e('0x23')](_0x52e038);if(!_[_0xa19e('0x9e')](_0x12cb29)){_0xc1d84e[_0xa19e('0x18')](_0xa19e('0x9f'),_0x12cb29);}var _0x195f22={'type':db[_0xa19e('0x70')][_0xa19e('0xa0')][_0xa19e('0x71')],'raw':!![]};return db[_0xa19e('0x72')][_0xa19e('0x97')](_0xc1d84e[_0xa19e('0x73')](),_0x195f22);}module[_0xa19e('0xa1')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x80df=['Accounts','agent','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','sequelize','toString','merge','a.key','Account.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','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.substatus','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','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','Setting','findOne','enableEmailPreview','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','sqlOperator','conditions','find','type','default','text','start','end','unreadMessages','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','contact','Tag','tags','clause','and','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','get','capitalize'];(function(_0x29c5c5,_0x3eecaa){var _0x5cbf34=function(_0x2508b8){while(--_0x2508b8){_0x29c5c5['push'](_0x29c5c5['shift']());}};_0x5cbf34(++_0x3eecaa);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var squel=require(_0xf80d('0x1'));var as=require(_0xf80d('0x2'));var qs=require(_0xf80d('0x3'));var updateInteraction=require('./update-interaction')[_0xf80d('0x4')];var utils=require(_0xf80d('0x5'));var db=require(_0xf80d('0x6'))['db'];function skipInteractionsQuery(_0x21365c,_0x15d302,_0xa6b1bb){var _0x26fb05=![];var _0xeffeb7=utils[_0xf80d('0x7')](_0x21365c);if(_0x15d302[_0xf80d('0x8')]==='agent'&&!_0xa6b1bb[_0xf80d('0x9')]&&!_0xa6b1bb[_0xeffeb7]){_0x26fb05=!![];}return _0x26fb05;}function getTagsQuery(){return squel[_0xf80d('0xa')]()[_0xf80d('0xb')]('id')[_0xf80d('0xb')](_0xf80d('0xc'))[_0xf80d('0xb')](_0xf80d('0xd'))[_0xf80d('0xe')](_0xf80d('0xf'));}function getUsersQuery(_0x2ef5d1,_0x30df95){var _0x1987de=utils[_0xf80d('0x10')](_0x2ef5d1);var _0x29bd2c='user_has_'+_0x2ef5d1+'_interactions';var _0x2ad8a7=squel[_0xf80d('0xa')]()['field'](_0xf80d('0x11'))['field'](_0xf80d('0x12'))['field'](_0xf80d('0x13')+_0x1987de)['from'](_0x29bd2c,'ui')[_0xf80d('0x14')](_0xf80d('0x15'),'u',_0xf80d('0x16'));if(_0x30df95[_0xf80d('0x17')]>0x0){_0x2ad8a7[_0xf80d('0x18')](_0xf80d('0x13')+_0x1987de+_0xf80d('0x19'),_[_0xf80d('0x1a')](_0x30df95,'id'));}return _0x2ad8a7;}function getInteractionsQuery(_0x3db0e7){var _0x3b8a82=utils[_0xf80d('0x1b')](_0x3db0e7);var _0x27b2ea=utils[_0xf80d('0x7')](_0x3db0e7);var _0x1d104a=utils[_0xf80d('0x10')](_0x3db0e7);return squel[_0xf80d('0xa')]()[_0xf80d('0xe')](_0x3b8a82[_0xf80d('0x1c')],'i')[_0xf80d('0x14')]('cm_contacts','c',_0xf80d('0x1d'))[_0xf80d('0x14')]('users','o',_0xf80d('0x1e'))['left_join'](_0x3b8a82[_0xf80d('0x1f')],'a',_0xf80d('0x20')+_0x27b2ea)[_0xf80d('0x14')](_0x3b8a82[_0xf80d('0x21')],'me',_0xf80d('0x22')+_0x1d104a+_0xf80d('0x23'))[_0xf80d('0x14')](_0x3b8a82[_0xf80d('0x24')],'it',_0xf80d('0x25')+_0x1d104a+_0xf80d('0x23'))[_0xf80d('0x14')](_0xf80d('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x32ad42={'body':squel[_0xf80d('0x26')](),'contact':squel['expr'](),'default':squel[_0xf80d('0x26')](),'fields':squel[_0xf80d('0x26')](),'filter':squel[_0xf80d('0x26')](),'read':squel[_0xf80d('0x26')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xf80d('0x26')]()};return _0x32ad42;}function parseTagParameter(_0x14399e){var _0xf4c3af=squel[_0xf80d('0x26')]();if(_0x14399e){var _0x3edbec=utils[_0xf80d('0x27')](_0x14399e);_0x3edbec[_0xf80d('0x28')](function(_0x68f2c6){_0xf4c3af['or'](_0xf80d('0x29'),'%,'+_0x68f2c6+',%');});}return _0xf4c3af;}function parseReadParameter(_0x4d2579){var _0xe940d6='';if(_0x4d2579){_0xe940d6=_0xf80d('0x2a');if(_0x4d2579==='1'){_0xe940d6=_0xe940d6[_0xf80d('0x2b')](_0xf80d('0x2c'),'=');}else{_0xe940d6=_0xe940d6[_0xf80d('0x2b')](_0xf80d('0x2c'),'>');}}return _0xe940d6;}function parseSearchFilter(_0x401cfb,_0x5a6615){var _0x4e9219=squel[_0xf80d('0x26')]();if(_0x5a6615){var _0x214bff=_0x5a6615[_0xf80d('0x2b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x214bff)){_0x4e9219['or'](_0xf80d('0x2d'),_0x214bff+'%');if(['sms',_0xf80d('0x2e')][_0xf80d('0x2f')](_0x401cfb)){_0x4e9219['or'](_0xf80d('0x30'),_0x214bff+'%');}else if(_0x401cfb==='fax'){_0x4e9219['or'](_0xf80d('0x31'),_0x214bff+'%');}else if(_0x401cfb===_0xf80d('0x32')){_0x4e9219['or']('i.from\x20LIKE\x20?',_0x214bff+'%');}}else if(_0x401cfb===_0xf80d('0x33')&&qs[_0xf80d('0x34')](_0x214bff)){_0x4e9219['or'](_0xf80d('0x35'),_0x214bff+'%');}else{if(_0x401cfb==='mail'){_0x4e9219['or'](_0xf80d('0x36'),qs[_0xf80d('0x37')](_0x214bff))['or'](_0xf80d('0x38'),qs[_0xf80d('0x37')](_0x214bff));}else{if(_0x401cfb!==_0xf80d('0x39')){_0x4e9219['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf80d('0x37')](_0x214bff));}_0x4e9219['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x214bff+'%');}}}return _0x4e9219;}function parseAdvancedSearchFilter(_0x2004c5,_0x1b7596){var _0xd5ebb4=getSqlClauses();var _0x359698=as['parseSearch'](_0x2004c5);var _0x1cc91e=_0x359698[_0xf80d('0x3a')];for(var _0xbc0d77=0x0;_0xbc0d77<_0x359698[_0xf80d('0x3b')]['length'];_0xbc0d77++){var _0x1d4103=_0x359698[_0xf80d('0x3b')][_0xbc0d77];var _0x43916b='i';var _0x3460c7=_[_0xf80d('0x3c')](_0x1b7596,[_0xf80d('0xc'),_0x1d4103[_0xf80d('0xb')]]);if(_0x3460c7){var _0x45765a=as['buildExpression'](_0x43916b,_0x3460c7[_0xf80d('0x3d')],_0x1d4103);_0xd5ebb4[_0xf80d('0x3e')][_0x1cc91e](_0x45765a[_0xf80d('0x3f')],_0x45765a['value'][_0xf80d('0x40')],_0x45765a['value'][_0xf80d('0x41')]);}else{switch(_0x1d4103[_0xf80d('0xb')]){case _0xf80d('0x42'):var _0xed4cc5=parseReadParameter(_0x1d4103['value']);_0xd5ebb4['read']['and'](_0xed4cc5);break;case _0xf80d('0x43'):if(_0x1d4103[_0xf80d('0x44')]===_0xf80d('0x45')){if(_0x1d4103[_0xf80d('0x46')][_0xf80d('0x47')]('\x20')[_0xf80d('0x17')]>0x1){_0xd5ebb4['contact'][_0x1cc91e](_0xf80d('0x48'),qs[_0xf80d('0x37')](_0x1d4103[_0xf80d('0x46')]),null);}else{var _0x5b3d97='%'+_0x1d4103[_0xf80d('0x46')]+'%';_0xd5ebb4['contact'][_0x1cc91e](_0xf80d('0x49'),_0x5b3d97,_0x5b3d97,_0x5b3d97);}}else{_0x3460c7=_[_0xf80d('0x3c')](_0x1b7596,[_0xf80d('0xc'),_0xf80d('0x4a')]);_0x1d4103[_0xf80d('0xb')]=_0xf80d('0x4a');_0x45765a=as[_0xf80d('0x4b')](_0x43916b,_0x3460c7[_0xf80d('0x3d')],_0x1d4103);_0xd5ebb4[_0xf80d('0x4c')][_0x1cc91e](_0x45765a[_0xf80d('0x3f')],_0x45765a[_0xf80d('0x46')][_0xf80d('0x40')],_0x45765a[_0xf80d('0x46')][_0xf80d('0x41')]);}break;case _0xf80d('0x4d'):var _0x89a185=_0x1d4103[_0xf80d('0x46')][_0xf80d('0x47')](',')[_0xf80d('0x1a')](function(_0x24c1e4){return Number(_0x24c1e4);});var _0x6b0db=parseTagParameter(_0x89a185);_0xd5ebb4[_0xf80d('0x4e')][_0xf80d('0x4f')][_0xf80d('0x50')](_0x6b0db);_0xd5ebb4[_0xf80d('0x4e')]['ids']=_0x89a185;break;case _0xf80d('0x51'):if(_0x1d4103[_0xf80d('0x44')]===_0xf80d('0x45')){_0xd5ebb4[_0xf80d('0x52')][_0x1cc91e](_0xf80d('0x53'),'%'+_0x1d4103['value']+'%',null);}else{_0x3460c7=_[_0xf80d('0x3c')](_0x1b7596,[_0xf80d('0xc'),_0xf80d('0x54')]);_0x1d4103[_0xf80d('0xb')]=_0xf80d('0x54');_0x45765a=as[_0xf80d('0x4b')](_0x43916b,_0x3460c7[_0xf80d('0x3d')],_0x1d4103);_0xd5ebb4[_0xf80d('0x52')][_0x1cc91e](_0x45765a[_0xf80d('0x3f')],_0x45765a[_0xf80d('0x46')][_0xf80d('0x40')],_0x45765a[_0xf80d('0x46')][_0xf80d('0x41')]);}break;case _0xf80d('0x55'):case _0xf80d('0x56'):_0x45765a=as[_0xf80d('0x4b')]('me',null,_0x1d4103);_0xd5ebb4[_0xf80d('0x55')][_0x1cc91e](_0x45765a['text'],_0x45765a[_0xf80d('0x46')][_0xf80d('0x40')],_0x45765a[_0xf80d('0x46')]['end']);break;}}}return _0xd5ebb4;}function parseModelFields(_0x3e5cf6,_0x1088ca,_0x51e367){var _0x57673b=utils[_0xf80d('0x7')](_0x3e5cf6);var _0x5ec859=squel[_0xf80d('0x26')]();var _0x24c70e=_(_0x1088ca)[_0xf80d('0x57')]()[_0xf80d('0x1a')](function(_0x45f8cd){return _[_0xf80d('0x58')](_0x51e367,[_0xf80d('0xc'),_0x45f8cd])?_0x45f8cd:undefined;})[_0xf80d('0x59')]()[_0xf80d('0x46')]();if(_0x24c70e[_0xf80d('0x17')]>0x0){_0x24c70e[_0xf80d('0x28')](function(_0x27a78b){if(_0x27a78b===_0x57673b){_0x5ec859['and']('i.'+_0x57673b+_0xf80d('0x19'),[][_0xf80d('0x5a')](_0x1088ca[_0x27a78b]));}else if(_0x27a78b===_0xf80d('0x5b')){var _0x5c3c41=JSON[_0xf80d('0x5c')](_0x1088ca[_0x27a78b])[_0xf80d('0x5d')];var _0x563cf3=JSON[_0xf80d('0x5c')](_0x1088ca[_0x27a78b])[_0xf80d('0x5e')];_0x5ec859['and'](_0xf80d('0x5f'),_0x5c3c41,_0x563cf3);}else{if(_0x1088ca[_0x27a78b]===_0xf80d('0x60')){_0x5ec859[_0xf80d('0x50')]('i.'+_0x27a78b+_0xf80d('0x61'));}else{_0x5ec859['and']('i.'+_0x27a78b+_0xf80d('0x62'),_0x1088ca[_0x27a78b]);}}});}return _0x5ec859;}function parseQueryParameters(_0x374985,_0x1a4c08,_0x4f011c){var _0x44e040=getSqlClauses();return Promise[_0xf80d('0x63')]()[_0xf80d('0x64')](function(){return parseModelFields(_0x374985,_0x1a4c08,_0x4f011c);})[_0xf80d('0x64')](function(_0x181e5d){_0x44e040[_0xf80d('0x65')][_0xf80d('0x50')](_0x181e5d);return parseReadParameter(_0x1a4c08[_0xf80d('0x66')]);})[_0xf80d('0x64')](function(_0x22b2e9){_0x44e040['read'][_0xf80d('0x50')](_0x22b2e9);return parseTagParameter(_0x1a4c08[_0xf80d('0x67')]);})[_0xf80d('0x64')](function(_0x32c02e){_0x44e040['tags']['clause'][_0xf80d('0x50')](_0x32c02e);return parseSearchFilter(_0x374985,_0x1a4c08[_0xf80d('0x68')]);})['then'](function(_0x43e4b8){_0x44e040[_0xf80d('0x68')]=_0x43e4b8;return _0x44e040;});}function checkAccountsRestrictions(_0x444d3b,_0x15a051,_0x4d3e67){var _0x3ae779=utils['getAccountFK'](_0x444d3b);var _0x4339f8=_0xf80d('0x69')+_[_0xf80d('0x6a')](_0x444d3b)+(_0x444d3b==='chat'?'Websites':_0xf80d('0x6b'));var _0x27b9f3=squel['expr']();return Promise['resolve']()[_0xf80d('0x64')](function(){if(_0x4d3e67[_0xf80d('0x9')]&&_0x15a051[_0xf80d('0x8')]===_0xf80d('0x6c')){return _0x15a051[_0x4339f8]({'attributes':['id'],'raw':!![]});}})[_0xf80d('0x64')](function(_0x40582f){if(_0x40582f){if(_0x40582f[_0xf80d('0x17')]===0x0){_0x27b9f3[_0xf80d('0x50')]('i.'+_0x3ae779+'\x20IS\x20NULL');}else{_0x27b9f3[_0xf80d('0x50')]('i.'+_0x3ae779+_0xf80d('0x19'),_[_0xf80d('0x1a')](_0x40582f,'id'));}}else if(!_0x4d3e67[_0x3ae779]){_0x27b9f3['and']('i.'+_0x3ae779+_0xf80d('0x6d'));}})[_0xf80d('0x64')](function(){return _0x27b9f3;});}function getClosedOrderClause(_0x57ac3b,_0x360783){var _0x38d607='';var _0x34b2b6=['i.thirdDisposition',_0xf80d('0x6e'),_0xf80d('0x6f')];if(_0x57ac3b===_0xf80d('0x33')){_0x34b2b6['unshift']('i.substatus');}if(_0x360783[_0xf80d('0x70')]==='0'&&_0x57ac3b===_0xf80d('0x33')){_0x38d607='i.substatus';}else{if(_0x360783[_0xf80d('0x70')]==='1'){_0x34b2b6['shift']();}_0x38d607=_0xf80d('0x71')+_0x34b2b6[_0xf80d('0x72')](',\x20')+')';}return _0x38d607;}function getFilteredInteractions(_0x10bc20,_0x4d236f,_0x2b4fa6,_0x422daa){var _0x9985a1=utils[_0xf80d('0x10')](_0x10bc20);var _0x24c608=_[_0xf80d('0x6a')](_0x10bc20)+_0xf80d('0x73');var _0x13bd9d=[];var _0x1e87d6=getTagsQuery();var _0x3a810f={'type':db[_0xf80d('0x74')][_0xf80d('0x75')]['SELECT'],'raw':!![]};var _0x12f3a5=[];var _0x1eb3e2=[];return db[_0xf80d('0x76')]['query'](_0x1e87d6[_0xf80d('0x77')](),_0x3a810f)[_0xf80d('0x64')](function(_0x594293){_0x13bd9d=_['keyBy'](_0x594293,'id');_0x3a810f=_[_0xf80d('0x78')](_0x3a810f,{'model':db[_0x24c608],'mapToModel':!![],'nest':!![]});if(_0x2b4fa6[_0xf80d('0x65')]){_0x422daa['attributes'][_0xf80d('0x28')](function(_0xb5b702){_0x4d236f[_0xf80d('0xb')]('i.'+_0xb5b702);});}else{_0x4d236f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf80d('0x42'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x79'),_0xf80d('0x7a'));_0x4d236f[_0xf80d('0xb')]('a.mandatoryDisposition',_0xf80d('0x7b'));if(_0x10bc20===_0xf80d('0x33')){_0x4d236f['field'](_0xf80d('0x7c'),_0xf80d('0x7d'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x7e'),'contactName');_0x4d236f[_0xf80d('0xb')](_0xf80d('0x7f'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x80'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x81'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x82'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x83'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x84'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x85'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x86'));_0x4d236f[_0xf80d('0xb')]('i.subject');_0x4d236f['field'](_0xf80d('0x6f'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x6e'));_0x4d236f[_0xf80d('0xb')]('i.thirdDisposition');_0x4d236f[_0xf80d('0xb')](_0xf80d('0x87'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x88'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x89'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x8a'));_0x4d236f['field'](_0xf80d('0x8b'));}else if(_0x10bc20==='openchannel'){_0x4d236f[_0xf80d('0xb')](_0xf80d('0x8c'),_0xf80d('0x8d'));}else{_0x4d236f[_0xf80d('0xb')]('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','contactName');}if(_0x10bc20!==_0xf80d('0x33')){_0x4d236f[_0xf80d('0xb')](_0xf80d('0x8e'));}_0x4d236f[_0xf80d('0xb')]('c.firstName',_0xf80d('0x8f'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x90'),_0xf80d('0x91'));_0x4d236f['field'](_0xf80d('0x92'),'Contact.email');_0x4d236f[_0xf80d('0xb')](_0xf80d('0x93'),_0xf80d('0x94'));_0x4d236f[_0xf80d('0xb')](_0xf80d('0x95'),_0xf80d('0x96'));_0x4d236f[_0xf80d('0xb')]('c.fax','Contact.fax');_0x4d236f[_0xf80d('0xb')](_0xf80d('0x97'),_0xf80d('0x98'));_0x4d236f[_0xf80d('0xb')]('o.internal','Owner.internal');_0x4d236f['field'](_0xf80d('0x99'),_0xf80d('0x9a'));}if(_0x422daa[_0xf80d('0x9b')]){_0x4d236f[_0xf80d('0x9b')](_0x422daa[_0xf80d('0x9b')]);}if(_0x422daa['offset']){_0x4d236f[_0xf80d('0x9c')](_0x422daa[_0xf80d('0x9c')]);}return db['sequelize'][_0xf80d('0x9d')](_0x4d236f[_0xf80d('0x77')](),_0x3a810f);})['then'](function(_0x2d24e3){_0x12f3a5=_0x2d24e3;var _0x5c20cf=getUsersQuery(_0x10bc20,_0x12f3a5);return db[_0xf80d('0x76')][_0xf80d('0x9d')](_0x5c20cf[_0xf80d('0x77')](),_0x3a810f);})['then'](function(_0x3ce54d){_0x1eb3e2=_['groupBy'](_0x3ce54d,_0x9985a1);if(_0x10bc20==='mail'){return db[_0xf80d('0x9e')][_0xf80d('0x9f')]({'attributes':[_0xf80d('0xa0')],'raw':!![]});}})[_0xf80d('0x64')](function(_0x2ba3db){var _0x38cfad=_0x2ba3db?_0x2ba3db['enableEmailPreview']:undefined;var _0x1c390d=_0x12f3a5[_0xf80d('0x1a')](function(_0x2a0620){return updateInteraction(_0x2a0620,_0x13bd9d,_0x1eb3e2,_0x38cfad);});return Promise['all'](_0x1c390d);});}function countFilteredInteractions(_0x18b0b0,_0x12103c){var _0x5182bf=_0x18b0b0['clone']();_0x5182bf[_0xf80d('0xb')](_0xf80d('0xa1'));_0x5182bf[_0xf80d('0xb')](_0xf80d('0xa2'),_0xf80d('0x42'));var _0x51b4bf=utils[_0xf80d('0x27')](_0x12103c);if(!_['isEmpty'](_0x51b4bf)){_0x5182bf['where']('t.id\x20IN\x20?',_0x51b4bf);}var _0x26a14f={'type':db['Sequelize'][_0xf80d('0x75')]['SELECT'],'raw':!![]};return db[_0xf80d('0x76')][_0xf80d('0x9d')](_0x5182bf[_0xf80d('0x77')](),_0x26a14f);}module['exports']={'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 423ad67..d94a3fb 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 _0x128b=['../../mysqldb','split','push','waiting','talking','unmanaged','closed','disposition','answered','UserId','total','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','TagIds','lodash'];(function(_0x3446af,_0x3b2f92){var _0x252b14=function(_0x1caaca){while(--_0x1caaca){_0x3446af['push'](_0x3446af['shift']());}};_0x252b14(++_0x3b2f92);}(_0x128b,0xb3));var _0xb128=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x128b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb128('0x0'));var db=require(_0xb128('0x1'))['db'];function getInteractionUsers(_0x414fc2,_0x334693){return new Promise(function(_0x623fc3,_0x454598){try{var _0x36a0a9=[];if(_0x334693[_0x414fc2]){_0x36a0a9=_0x334693[_0x414fc2]['map'](function(_0x37e8f1){return{'id':_0x37e8f1['id'],'fullname':_0x37e8f1['fullname']};});}return _0x623fc3(_0x36a0a9);}catch(_0x320d98){_0x454598(_0x320d98);}});}function getInteractionTags(_0x45c6c0,_0x279665){var _0x129ef8=[];if(_0x45c6c0){_0x45c6c0[_0xb128('0x2')](',')['forEach'](function(_0x21bf06){_0x129ef8[_0xb128('0x3')](_0x279665[_0x21bf06]);});}return _0x129ef8;}function updateWaitingCounter(_0xf2014a){if(_0xf2014a[_0xb128('0x4')]){_0xf2014a[_0xb128('0x4')]-=0x1;}}function updateInteractionCounters(_0x48990c){_0x48990c['waiting']=0x0;_0x48990c[_0xb128('0x5')]=0x0;_0x48990c['answered']=0x0;_0x48990c[_0xb128('0x6')]=0x0;_0x48990c['abandoned']=0x0;_0x48990c['total']=0x0;if(_0x48990c[_0xb128('0x7')]){if(_0x48990c[_0xb128('0x8')]==='abandoned'){_0x48990c['abandoned']+=0x1;updateWaitingCounter(_0x48990c);}if(_0x48990c['UserId']){_0x48990c[_0xb128('0x9')]+=0x1;if(_0x48990c['talking']){_0x48990c[_0xb128('0x5')]-=0x1;}}else{if(_0x48990c[_0xb128('0x8')]){_0x48990c[_0xb128('0x6')]+=0x1;updateWaitingCounter(_0x48990c);}}}else{if(!_0x48990c[_0xb128('0xa')]){_0x48990c[_0xb128('0x4')]+=0x1;}if(_0x48990c[_0xb128('0xa')]){_0x48990c[_0xb128('0x5')]+=0x1;updateWaitingCounter(_0x48990c);}}_0x48990c[_0xb128('0xb')]+=0x1;return _0x48990c;}function getLastMessageText(_0x4231b1){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x4231b1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb128('0xc')],'order':_0xb128('0xd'),'raw':!![]})[_0xb128('0xe')](function(_0x1d5267){if(_0x1d5267&&_0x1d5267[_0xb128('0xc')]){_0x4231b1[_0xb128('0xf')]=_['trimStart'](_0x1d5267[_0xb128('0xc')]);}return _0x4231b1;})[_0xb128('0x10')](function(_0x4322c4){throw _0x4322c4;});}exports[_0xb128('0x11')]=function(_0x59b7dd,_0x428d7d,_0x426d10,_0x3224d7){return new Promise(function(_0x2c4561,_0x546521){return getInteractionUsers(_0x59b7dd['id'],_0x426d10)['then'](function(_0x44c344){_0x59b7dd[_0xb128('0x12')]=_0x44c344;return getInteractionTags(_0x59b7dd['TagIds'],_0x428d7d);})[_0xb128('0xe')](function(_0x1a3e21){_0x59b7dd['Tags']=_0x1a3e21;delete _0x59b7dd[_0xb128('0x13')];return updateInteractionCounters(_0x59b7dd);})['then'](function(_0x4ffb76){if(_0x3224d7){return getLastMessageText(_0x4ffb76);}else{return _0x4ffb76;}})[_0xb128('0xe')](function(_0xcd2319){_0x2c4561(_0xcd2319);})[_0xb128('0x10')](function(_0x1729a9){_0x546521(_0x1729a9);});});}; \ No newline at end of file +var _0x82ed=['-id','then','trimStart','catch','updateInteraction','Users','TagIds','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','plainBody'];(function(_0x57d00d,_0x3bb282){var _0x2d2b37=function(_0x595b76){while(--_0x595b76){_0x57d00d['push'](_0x57d00d['shift']());}};_0x2d2b37(++_0x3bb282);}(_0x82ed,0x173));var _0xd82e=function(_0x392d71,_0x271154){_0x392d71=_0x392d71-0x0;var _0x1e0396=_0x82ed[_0x392d71];return _0x1e0396;};'use strict';var _=require('lodash');var db=require(_0xd82e('0x0'))['db'];function getInteractionUsers(_0xcd9106,_0x2f449e){return new Promise(function(_0xdc3783,_0x43acdb){try{var _0x5ee501=[];if(_0x2f449e[_0xcd9106]){_0x5ee501=_0x2f449e[_0xcd9106][_0xd82e('0x1')](function(_0x3a99d6){return{'id':_0x3a99d6['id'],'fullname':_0x3a99d6[_0xd82e('0x2')]};});}return _0xdc3783(_0x5ee501);}catch(_0x53528b){_0x43acdb(_0x53528b);}});}function getInteractionTags(_0x511042,_0x55b5bf){var _0x194c0c=[];if(_0x511042){_0x511042[_0xd82e('0x3')](',')[_0xd82e('0x4')](function(_0x55a8fb){_0x194c0c[_0xd82e('0x5')](_0x55b5bf[_0x55a8fb]);});}return _0x194c0c;}function updateWaitingCounter(_0x4177b9){if(_0x4177b9[_0xd82e('0x6')]){_0x4177b9['waiting']-=0x1;}}function updateInteractionCounters(_0xfd3d71){_0xfd3d71[_0xd82e('0x6')]=0x0;_0xfd3d71[_0xd82e('0x7')]=0x0;_0xfd3d71[_0xd82e('0x8')]=0x0;_0xfd3d71[_0xd82e('0x9')]=0x0;_0xfd3d71[_0xd82e('0xa')]=0x0;_0xfd3d71[_0xd82e('0xb')]=0x0;if(_0xfd3d71[_0xd82e('0xc')]){if(_0xfd3d71[_0xd82e('0xd')]===_0xd82e('0xa')){_0xfd3d71[_0xd82e('0xa')]+=0x1;updateWaitingCounter(_0xfd3d71);}if(_0xfd3d71[_0xd82e('0xe')]){_0xfd3d71[_0xd82e('0x8')]+=0x1;if(_0xfd3d71[_0xd82e('0x7')]){_0xfd3d71[_0xd82e('0x7')]-=0x1;}}else{if(_0xfd3d71[_0xd82e('0xd')]){_0xfd3d71[_0xd82e('0x9')]+=0x1;updateWaitingCounter(_0xfd3d71);}}}else{if(!_0xfd3d71[_0xd82e('0xe')]){_0xfd3d71['waiting']+=0x1;}if(_0xfd3d71[_0xd82e('0xe')]){_0xfd3d71[_0xd82e('0x7')]+=0x1;updateWaitingCounter(_0xfd3d71);}}_0xfd3d71[_0xd82e('0xb')]+=0x1;return _0xfd3d71;}function getLastMessageText(_0x2ab534){return db[_0xd82e('0xf')][_0xd82e('0x10')]({'where':{'$and':[{'MailInteractionId':_0x2ab534['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd82e('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd82e('0x12')],'order':_0xd82e('0x13'),'raw':!![]})[_0xd82e('0x14')](function(_0x374e0a){if(_0x374e0a&&_0x374e0a['plainBody']){_0x2ab534['lastMsgText']=_[_0xd82e('0x15')](_0x374e0a[_0xd82e('0x12')]);}return _0x2ab534;})[_0xd82e('0x16')](function(_0x3f9caf){throw _0x3f9caf;});}exports[_0xd82e('0x17')]=function(_0xd40e93,_0x1a63d7,_0x44ac9d,_0x47dce4){return new Promise(function(_0x2992e7,_0x1d5f72){return getInteractionUsers(_0xd40e93['id'],_0x44ac9d)[_0xd82e('0x14')](function(_0x4a7774){_0xd40e93[_0xd82e('0x18')]=_0x4a7774;return getInteractionTags(_0xd40e93[_0xd82e('0x19')],_0x1a63d7);})[_0xd82e('0x14')](function(_0x56616f){_0xd40e93['Tags']=_0x56616f;delete _0xd40e93[_0xd82e('0x19')];return updateInteractionCounters(_0xd40e93);})['then'](function(_0x1c27d0){if(_0x47dce4){return getLastMessageText(_0x1c27d0);}else{return _0x1c27d0;}})[_0xd82e('0x14')](function(_0x186501){_0x2992e7(_0x186501);})['catch'](function(_0x23d862){_0x1d5f72(_0x23d862);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 688a9ad..cc5b87c 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 _0xa9fc=['_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','info','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','_interactions'];(function(_0xa3e0f7,_0x1b06db){var _0x4ce604=function(_0x29df1e){while(--_0x29df1e){_0xa3e0f7['push'](_0xa3e0f7['shift']());}};_0x4ce604(++_0x1b06db);}(_0xa9fc,0x12f));var _0xca9f=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xa9fc[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0xca9f('0x0'));var db=require(_0xca9f('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0xca9f('0x2'))(_0xca9f('0x3')),'fax':require(_0xca9f('0x2'))(_0xca9f('0x4')),'sms':require(_0xca9f('0x2'))(_0xca9f('0x5')),'chat':require(_0xca9f('0x2'))(_0xca9f('0x6')),'whatsapp':require('../../config/logger')(_0xca9f('0x7'))};function getAccountFK(_0x3b43c0){return _[_0xca9f('0x8')](_0x3b43c0)+(_0x3b43c0===_0xca9f('0x9')?_0xca9f('0xa'):_0xca9f('0xb'))+'Id';}function getInteractionFK(_0x34bc12){return _['capitalize'](_0x34bc12)+_0xca9f('0xc');}function getInteractionId(_0x4f1961,_0x37a2bb,_0x4ab920){if(_0x4f1961&&_0x4f1961[_['upperFirst'](_0x4ab920)+_0xca9f('0xc')]){return _0x4f1961[_[_0xca9f('0xd')](_0x4ab920)+_0xca9f('0xc')];}else if(_0x4f1961&&_0x4f1961['id']){return _0x4f1961['id'];}else if(_0x37a2bb&&_0x37a2bb['id']){return _0x37a2bb['id'];}else{return _0xca9f('0xe');}}function getInteractionsTables(_0x54d7a0){return{'accounts':_0x54d7a0+'_'+(_0x54d7a0===_0xca9f('0x9')?_0xca9f('0xf'):'accounts'),'interactions':_0x54d7a0+_0xca9f('0x10'),'interactionsTags':_0x54d7a0+_0xca9f('0x11'),'messages':_0x54d7a0+_0xca9f('0x12'),'userInteractions':_0xca9f('0x13')+_0x54d7a0+_0xca9f('0x10')};}function getSelectedTags(_0x5be744){var _0x10b4bc=[];if(_0x5be744){_0x10b4bc=Array[_0xca9f('0x14')](_0x5be744)?_0x5be744:[_0x5be744];}return _0x10b4bc;}function log(_0x5a5e09,_0x1fc639,_0x696b69,_0x2e0631,_0x3bcedc,_0x4abef9){loggers[_0x3bcedc[_0xca9f('0x15')]()][_0x5a5e09](_0xca9f('0x16'),_0x4abef9['toUpperCase'](),_0x1fc639?_0x1fc639['id']:null,_0x1fc639?_0x1fc639[_0xca9f('0x17')]:null,_0x1fc639?_0x1fc639[_0xca9f('0x18')]:null,getInteractionId(_0x696b69,_0x2e0631,_0x3bcedc),_0x696b69?JSON[_0xca9f('0x19')](_0x696b69):_0xca9f('0x1a'));}function updateUser(_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95){db[_[_0xca9f('0xd')](_0x53e304)+'Interaction'][_0xca9f('0x1b')]({'where':{'id':getInteractionId(_0xcbdf4e,_0x58260c,_0x53e304)}})[_0xca9f('0x1c')](function(_0x23f3e9){if(_0x23f3e9){return _0x23f3e9['update']({'UserId':_0x272a8f?_0x272a8f['id']:null});}})[_0xca9f('0x1c')](function(_0x860fe6){if(_0x860fe6){log(_0xca9f('0x1d'),_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95);}})['catch'](function(){log(_0xca9f('0x1e'),_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95);});}module[_0xca9f('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x9f6d=['whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update','info','error','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x1c5a9a,_0x561145){var _0x5179b5=function(_0x465e4d){while(--_0x465e4d){_0x1c5a9a['push'](_0x1c5a9a['shift']());}};_0x5179b5(++_0x561145);}(_0x9f6d,0xda));var _0xd9f6=function(_0x2806f9,_0x3e6211){_0x2806f9=_0x2806f9-0x0;var _0xfc5f6e=_0x9f6d[_0x2806f9];return _0xfc5f6e;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xd9f6('0x0'))(_0xd9f6('0x1')),'mail':require('../../config/logger')(_0xd9f6('0x2')),'fax':require(_0xd9f6('0x0'))(_0xd9f6('0x3')),'sms':require(_0xd9f6('0x0'))(_0xd9f6('0x4')),'chat':require(_0xd9f6('0x0'))(_0xd9f6('0x5')),'whatsapp':require(_0xd9f6('0x0'))(_0xd9f6('0x6'))};function getAccountFK(_0x3d2cad){return _[_0xd9f6('0x7')](_0x3d2cad)+(_0x3d2cad==='chat'?_0xd9f6('0x8'):_0xd9f6('0x9'))+'Id';}function getInteractionFK(_0x5cc6d5){return _[_0xd9f6('0x7')](_0x5cc6d5)+_0xd9f6('0xa');}function getInteractionId(_0x5f523c,_0x458bdc,_0x35ea24){if(_0x5f523c&&_0x5f523c[_[_0xd9f6('0xb')](_0x35ea24)+_0xd9f6('0xa')]){return _0x5f523c[_[_0xd9f6('0xb')](_0x35ea24)+'InteractionId'];}else if(_0x5f523c&&_0x5f523c['id']){return _0x5f523c['id'];}else if(_0x458bdc&&_0x458bdc['id']){return _0x458bdc['id'];}else{return _0xd9f6('0xc');}}function getInteractionsTables(_0x1fa61f){return{'accounts':_0x1fa61f+'_'+(_0x1fa61f===_0xd9f6('0xd')?_0xd9f6('0xe'):'accounts'),'interactions':_0x1fa61f+_0xd9f6('0xf'),'interactionsTags':_0x1fa61f+_0xd9f6('0x10'),'messages':_0x1fa61f+_0xd9f6('0x11'),'userInteractions':_0xd9f6('0x12')+_0x1fa61f+'_interactions'};}function getSelectedTags(_0x431ca0){var _0x409e12=[];if(_0x431ca0){_0x409e12=Array[_0xd9f6('0x13')](_0x431ca0)?_0x431ca0:[_0x431ca0];}return _0x409e12;}function log(_0xc16085,_0x5d77db,_0x322555,_0x3972ae,_0x9ce98f,_0x39d0c1){loggers[_0x9ce98f[_0xd9f6('0x14')]()][_0xc16085](_0xd9f6('0x15'),_0x39d0c1[_0xd9f6('0x16')](),_0x5d77db?_0x5d77db['id']:null,_0x5d77db?_0x5d77db[_0xd9f6('0x17')]:null,_0x5d77db?_0x5d77db[_0xd9f6('0x18')]:null,getInteractionId(_0x322555,_0x3972ae,_0x9ce98f),_0x322555?JSON[_0xd9f6('0x19')](_0x322555):_0xd9f6('0x1a'));}function updateUser(_0x4b4e36,_0xbce4fb,_0x4f8d7e,_0x37c59a,_0x25fce7){db[_[_0xd9f6('0xb')](_0x37c59a)+'Interaction'][_0xd9f6('0x1b')]({'where':{'id':getInteractionId(_0xbce4fb,_0x4f8d7e,_0x37c59a)}})[_0xd9f6('0x1c')](function(_0xc7f6c8){if(_0xc7f6c8){return _0xc7f6c8[_0xd9f6('0x1d')]({'UserId':_0x4b4e36?_0x4b4e36['id']:null});}})['then'](function(_0x26cc24){if(_0x26cc24){log(_0xd9f6('0x1e'),_0x4b4e36,_0xbce4fb,_0x4f8d7e,_0x37c59a,_0x25fce7);}})['catch'](function(){log(_0xd9f6('0x1f'),_0x4b4e36,_0xbce4fb,_0x4f8d7e,_0x37c59a,_0x25fce7);});}module['exports']={'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 dab0c72..5a2235b 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 _0x5f70=['catch','users','User','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x5378c0,_0x54c93c){var _0x301128=function(_0x4cbdd9){while(--_0x4cbdd9){_0x5378c0['push'](_0x5378c0['shift']());}};_0x301128(++_0x54c93c);}(_0x5f70,0x1a5));var _0x05f7=function(_0x11fc98,_0x35cc48){_0x11fc98=_0x11fc98-0x0;var _0x9019e=_0x5f70[_0x11fc98];return _0x9019e;};'use strict';var crypto=require(_0x05f7('0x0'));var util=require(_0x05f7('0x1'));var compose=require('composable-middleware');var db=require(_0x05f7('0x2'))['db'];var config=require(_0x05f7('0x3'));function getValueFromLicense(_0x5e46c5,_0x536201){if(_0x5e46c5&&_0x536201){if(_0x536201[_0x05f7('0x4')]&&_0x536201['license']){var _0x3c095a=_0x536201[_0x05f7('0x4')];var _0x1f95aa=_0x536201[_0x05f7('0x5')];var _0x15d0da=_0x3c095a[_0x05f7('0x6')]('-')[0x4];var _0x5350b6=_0x3c095a['split']('-')[0x0];var _0x33fb71=crypto[_0x05f7('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x15d0da,_0x3c095a,_0x5350b6));var _0x5011f7=_0x33fb71['update'](_0x1f95aa,_0x05f7('0x8'),_0x05f7('0x9'));_0x5011f7+=_0x33fb71[_0x05f7('0xa')](_0x05f7('0x9'));var _0x1c0ae2=JSON[_0x05f7('0xb')](_0x5011f7);return _0x1c0ae2[_0x05f7('0xc')](_0x5e46c5)?_0x1c0ae2[_0x5e46c5]:null;}}return null;}function isLimit(_0x26c6e9,_0xc4edc9,_0x3b2cdc,_0x2b0bf8){var _0x55c4b6=_0xc4edc9;return compose()[_0x05f7('0xd')](function(_0x3879af,_0x2ac9e7,_0x951166){return db[_0x05f7('0xe')][_0x05f7('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x394ca5){var _0x3ba31e=getValueFromLicense(_0x26c6e9,_0x394ca5);return _0x3ba31e?_0x3ba31e:_0x55c4b6;})[_0x05f7('0x10')](function(_0x3b1574){_0x55c4b6=_0x3b1574;return _0x3b2cdc[_0x05f7('0x11')](_0x2b0bf8);})[_0x05f7('0x10')](function(_0x3b0809){if(_0x3b0809>=_0x55c4b6){return _0x2ac9e7[_0x05f7('0x12')](0x193)[_0x05f7('0x13')]({'message':util['format'](_0x05f7('0x14'),_0x26c6e9)});}_0x951166();})[_0x05f7('0x15')](function(_0xf7d40b){_0x951166(_0xf7d40b);});});}function isUserLimit(){return isLimit(_0x05f7('0x16'),0x1,db[_0x05f7('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x05f7('0x18')}]}});}exports[_0x05f7('0x19')]=isUserLimit; \ No newline at end of file +var _0x089a=['users','User','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch'];(function(_0x316d81,_0x6516bb){var _0x5e777e=function(_0x56640f){while(--_0x56640f){_0x316d81['push'](_0x316d81['shift']());}};_0x5e777e(++_0x6516bb);}(_0x089a,0x157));var _0xa089=function(_0x26283f,_0x1cd35b){_0x26283f=_0x26283f-0x0;var _0x2bb55b=_0x089a[_0x26283f];return _0x2bb55b;};'use strict';var crypto=require('crypto');var util=require(_0xa089('0x0'));var compose=require(_0xa089('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xa089('0x2'));function getValueFromLicense(_0x40d2c,_0x4f29d3){if(_0x40d2c&&_0x4f29d3){if(_0x4f29d3[_0xa089('0x3')]&&_0x4f29d3[_0xa089('0x4')]){var _0x13a0d8=_0x4f29d3[_0xa089('0x3')];var _0x54256b=_0x4f29d3[_0xa089('0x4')];var _0x1c3ae0=_0x13a0d8['split']('-')[0x4];var _0x507fdc=_0x13a0d8[_0xa089('0x5')]('-')[0x0];var _0x302001=crypto[_0xa089('0x6')]('aes-256-ctr',util['format']('%s:%s:%s',_0x1c3ae0,_0x13a0d8,_0x507fdc));var _0x53ab94=_0x302001[_0xa089('0x7')](_0x54256b,_0xa089('0x8'),_0xa089('0x9'));_0x53ab94+=_0x302001[_0xa089('0xa')](_0xa089('0x9'));var _0x269819=JSON[_0xa089('0xb')](_0x53ab94);return _0x269819[_0xa089('0xc')](_0x40d2c)?_0x269819[_0x40d2c]:null;}}return null;}function isLimit(_0x11aad8,_0x40931e,_0x2ffc65,_0x5b96fd){var _0x15323c=_0x40931e;return compose()['use'](function(_0x3192c1,_0x5d95f0,_0xe21670){return db[_0xa089('0xd')][_0xa089('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xa089('0xf')](function(_0x48faba){var _0x3295b7=getValueFromLicense(_0x11aad8,_0x48faba);return _0x3295b7?_0x3295b7:_0x15323c;})['then'](function(_0x2e8478){_0x15323c=_0x2e8478;return _0x2ffc65[_0xa089('0x10')](_0x5b96fd);})[_0xa089('0xf')](function(_0x38eb6e){if(_0x38eb6e>=_0x15323c){return _0x5d95f0[_0xa089('0x11')](0x193)[_0xa089('0x12')]({'message':util['format'](_0xa089('0x13'),_0x11aad8)});}_0xe21670();})[_0xa089('0x14')](function(_0x2328b5){_0xe21670(_0x2328b5);});});}function isUserLimit(){return isLimit(_0xa089('0x15'),0x1,db[_0xa089('0x16')],{'where':{'$or':[{'role':_0xa089('0x17')},{'role':_0xa089('0x18')}]}});}exports[_0xa089('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 020508a..a4f33ab 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 _0x2bd0=['[$or]','and','replace','[$and]','split','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','includes','$ne','\x20OR\x20','field','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','startsWith'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x2bd0,0xa5));var _0x02bd=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x2bd0[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x02bd('0x0'));var moment=require(_0x02bd('0x1'));exports['parseSearch']=function(_0x1f6ca4){var _0xce5cb7={'conditions':[]};_0xce5cb7['sqlOperator']=_[_0x02bd('0x2')](_0x1f6ca4,_0x02bd('0x3'))?'or':_0x02bd('0x4');var _0xec4d1f=_0x1f6ca4[_0x02bd('0x5')](_0x02bd('0x6'),'')[_0x02bd('0x5')]('[$or]','')['split']('||');for(var _0x5d653f=0x0;_0x5d653f<_0xec4d1f['length'];_0x5d653f++){var _0x576fa2=_0xec4d1f[_0x5d653f][_0x02bd('0x7')](':=');var _0x4d40f7=_0x576fa2[0x0];var _0x4fa83d=_0x576fa2['slice'](0x1);_0x4fa83d[_0x02bd('0x8')](function(_0x1b7b30){var _0x34c940=_0x1b7b30['split']('[')['shift']();var _0x5e0d14=_0x1b7b30[_0x02bd('0x9')](/\[(.*?)\]/g);_0x5e0d14['forEach'](function(_0x30996c){var _0x2a61b1=_0x30996c['split']('[')['filter'](function(_0x2882e4){return _0x2882e4[_0x02bd('0xa')](']')>-0x1;})[_0x02bd('0xb')](function(_0x29b59f){return _0x29b59f[_0x02bd('0x7')](']')[0x0];})[0x0];_0xce5cb7[_0x02bd('0xc')][_0x02bd('0xd')]({'field':_0x4d40f7,'operator':_0x34c940,'value':_0x2a61b1});});});}return _0xce5cb7;};exports[_0x02bd('0xe')]=function(_0x464c49,_0x4d42ea,_0x56e970){var _0x48265a={};if(_0x4d42ea===_0x02bd('0xf')){if(_0x56e970['operator']==='$eq'){_0x56e970[_0x02bd('0x10')]=_0x02bd('0x11');_0x56e970[_0x02bd('0x12')]+=','+_0x56e970[_0x02bd('0x12')];}else if(_['includes']([_0x02bd('0x13'),_0x02bd('0x14')],_0x56e970[_0x02bd('0x10')])){_0x56e970[_0x02bd('0x12')]=moment(_0x56e970[_0x02bd('0x12')])[_0x02bd('0x15')](0x1,_0x02bd('0x16'))[_0x02bd('0x17')](_0x02bd('0x18'));}}if(_0x56e970[_0x02bd('0x19')]){_0x4d42ea=_0x56e970[_0x02bd('0x19')];_0x48265a[_0x02bd('0x1a')]=_0x02bd('0x1b')+_0x464c49+'.'+_0x56e970['field']+'\x20AS\x20'+_0x56e970[_0x02bd('0x19')]+')\x20'+parseOperator(_0x56e970['operator']);}else{_0x48265a[_0x02bd('0x1a')]=_0x464c49+'.'+_0x56e970['field']+'\x20'+parseOperator(_0x56e970[_0x02bd('0x10')]);}if(_[_0x02bd('0x1c')]([_0x02bd('0x1d'),'$notIn'],_0x56e970[_0x02bd('0x10')]))_0x48265a[_0x02bd('0x1a')]='('+_0x48265a[_0x02bd('0x1a')]+_0x02bd('0x1e')+_0x464c49+'.'+_0x56e970[_0x02bd('0x1f')]+_0x02bd('0x20');_0x48265a[_0x02bd('0x12')]=parseValue(_0x4d42ea,_0x56e970[_0x02bd('0x10')],_0x56e970[_0x02bd('0x12')]);return _0x48265a;};function parseOperator(_0x56424f){var _0x232f1b;switch(_0x56424f){case'$in':_0x232f1b=_0x02bd('0x21');break;case _0x02bd('0x22'):_0x232f1b=_0x02bd('0x23');break;case'$eq':_0x232f1b=_0x02bd('0x24');break;case _0x02bd('0x1d'):_0x232f1b=_0x02bd('0x25');break;case'$substring':case _0x02bd('0x26'):case _0x02bd('0x27'):_0x232f1b=_0x02bd('0x28');break;case _0x02bd('0x29'):_0x232f1b=_0x02bd('0x2a');break;case _0x02bd('0x13'):_0x232f1b=_0x02bd('0x2b');break;case'$lte':_0x232f1b='<=\x20?';break;case _0x02bd('0x2c'):_0x232f1b=_0x02bd('0x2d');break;case _0x02bd('0x11'):_0x232f1b=_0x02bd('0x2e');break;}return _0x232f1b;}function parseValue(_0x4646d9,_0x5a7da1,_0x28163e){var _0x288378={'start':undefined,'end':undefined};switch(_0x5a7da1){case _0x02bd('0x2f'):case'$notIn':_0x288378[_0x02bd('0x30')]=_0x28163e['split'](',');break;case _0x02bd('0x31'):_0x288378[_0x02bd('0x30')]='%'+_0x28163e+'%';break;case _0x02bd('0x26'):_0x288378[_0x02bd('0x30')]=_0x28163e+'%';break;case _0x02bd('0x27'):_0x288378['start']='%'+_0x28163e;break;case'$between':var _0x174358=_0x28163e[_0x02bd('0x7')](',');var _0x28163e=_0x174358[_0x02bd('0x32')]();var _0x3dada2=_0x174358[_0x02bd('0x33')]();if(_0x4646d9===_0x02bd('0xf')){_0x28163e=moment(_0x28163e)[_0x02bd('0x34')](0x0,!![])['format']();_0x3dada2=moment(_0x3dada2)['utcOffset'](0x0,!![])[_0x02bd('0x15')](0x17,_0x02bd('0x35'))['add'](0x3b,_0x02bd('0x36'))['add'](0x3b,_0x02bd('0x37'))['format']();}_0x288378={'start':_0x28163e,'end':_0x3dada2};break;default:_0x288378['start']=_0x28163e;break;}return _0x288378;} \ No newline at end of file +var _0x48bd=['add','days','format','castTo','text','CAST(','field','\x20AS\x20','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$startsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$substring','$endsWith','pop','utcOffset','minutes','moment','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','slice','match','forEach','filter','map','conditions','buildExpression','DATE','operator','$eq','value','includes','$lte'];(function(_0x4c24e0,_0x23aca7){var _0x4aec0b=function(_0x44ef5c){while(--_0x44ef5c){_0x4c24e0['push'](_0x4c24e0['shift']());}};_0x4aec0b(++_0x23aca7);}(_0x48bd,0xc3));var _0xd48b=function(_0x42c10b,_0x10700d){_0x42c10b=_0x42c10b-0x0;var _0x25aff8=_0x48bd[_0x42c10b];return _0x25aff8;};'use strict';var _=require('lodash');var moment=require(_0xd48b('0x0'));exports['parseSearch']=function(_0x3a266b){var _0x5ea1c8={'conditions':[]};_0x5ea1c8[_0xd48b('0x1')]=_[_0xd48b('0x2')](_0x3a266b,_0xd48b('0x3'))?'or':'and';var _0x209515=_0x3a266b['replace'](_0xd48b('0x4'),'')[_0xd48b('0x5')]('[$or]','')[_0xd48b('0x6')]('||');for(var _0x48fc07=0x0;_0x48fc07<_0x209515[_0xd48b('0x7')];_0x48fc07++){var _0x582014=_0x209515[_0x48fc07][_0xd48b('0x6')](':=');var _0x492487=_0x582014[0x0];var _0x96ade=_0x582014[_0xd48b('0x8')](0x1);_0x96ade['forEach'](function(_0xadaf07){var _0x29557d=_0xadaf07[_0xd48b('0x6')]('[')['shift']();var _0x4ffc1d=_0xadaf07[_0xd48b('0x9')](/\[(.*?)\]/g);_0x4ffc1d[_0xd48b('0xa')](function(_0x31907f){var _0x19fbea=_0x31907f[_0xd48b('0x6')]('[')[_0xd48b('0xb')](function(_0x20b60b){return _0x20b60b['indexOf'](']')>-0x1;})[_0xd48b('0xc')](function(_0x3f46ef){return _0x3f46ef[_0xd48b('0x6')](']')[0x0];})[0x0];_0x5ea1c8[_0xd48b('0xd')]['push']({'field':_0x492487,'operator':_0x29557d,'value':_0x19fbea});});});}return _0x5ea1c8;};exports[_0xd48b('0xe')]=function(_0x1855de,_0x18c4e5,_0x4a6705){var _0x3a701a={};if(_0x18c4e5===_0xd48b('0xf')){if(_0x4a6705[_0xd48b('0x10')]===_0xd48b('0x11')){_0x4a6705[_0xd48b('0x10')]='$between';_0x4a6705['value']+=','+_0x4a6705[_0xd48b('0x12')];}else if(_[_0xd48b('0x13')](['$gt',_0xd48b('0x14')],_0x4a6705[_0xd48b('0x10')])){_0x4a6705[_0xd48b('0x12')]=moment(_0x4a6705[_0xd48b('0x12')])[_0xd48b('0x15')](0x1,_0xd48b('0x16'))[_0xd48b('0x17')]('YYYY-MM-DD');}}if(_0x4a6705[_0xd48b('0x18')]){_0x18c4e5=_0x4a6705[_0xd48b('0x18')];_0x3a701a[_0xd48b('0x19')]=_0xd48b('0x1a')+_0x1855de+'.'+_0x4a6705[_0xd48b('0x1b')]+_0xd48b('0x1c')+_0x4a6705[_0xd48b('0x18')]+')\x20'+parseOperator(_0x4a6705[_0xd48b('0x10')]);}else{_0x3a701a['text']=_0x1855de+'.'+_0x4a6705[_0xd48b('0x1b')]+'\x20'+parseOperator(_0x4a6705[_0xd48b('0x10')]);}if(_[_0xd48b('0x13')](['$ne','$notIn'],_0x4a6705[_0xd48b('0x10')]))_0x3a701a[_0xd48b('0x19')]='('+_0x3a701a[_0xd48b('0x19')]+_0xd48b('0x1d')+_0x1855de+'.'+_0x4a6705[_0xd48b('0x1b')]+_0xd48b('0x1e');_0x3a701a[_0xd48b('0x12')]=parseValue(_0x18c4e5,_0x4a6705['operator'],_0x4a6705[_0xd48b('0x12')]);return _0x3a701a;};function parseOperator(_0x509829){var _0x80d5b5;switch(_0x509829){case _0xd48b('0x1f'):_0x80d5b5=_0xd48b('0x20');break;case _0xd48b('0x21'):_0x80d5b5=_0xd48b('0x22');break;case _0xd48b('0x11'):_0x80d5b5=_0xd48b('0x23');break;case _0xd48b('0x24'):_0x80d5b5=_0xd48b('0x25');break;case'$substring':case _0xd48b('0x26'):case'$endsWith':_0x80d5b5=_0xd48b('0x27');break;case _0xd48b('0x28'):_0x80d5b5='<\x20?';break;case _0xd48b('0x29'):_0x80d5b5=_0xd48b('0x2a');break;case'$lte':_0x80d5b5=_0xd48b('0x2b');break;case _0xd48b('0x2c'):_0x80d5b5=_0xd48b('0x2d');break;case _0xd48b('0x2e'):_0x80d5b5=_0xd48b('0x2f');break;}return _0x80d5b5;}function parseValue(_0x5cf84b,_0x335745,_0x57c31b){var _0x3d5aad={'start':undefined,'end':undefined};switch(_0x335745){case _0xd48b('0x1f'):case'$notIn':_0x3d5aad[_0xd48b('0x30')]=_0x57c31b[_0xd48b('0x6')](',');break;case _0xd48b('0x31'):_0x3d5aad[_0xd48b('0x30')]='%'+_0x57c31b+'%';break;case _0xd48b('0x26'):_0x3d5aad['start']=_0x57c31b+'%';break;case _0xd48b('0x32'):_0x3d5aad['start']='%'+_0x57c31b;break;case _0xd48b('0x2e'):var _0x119674=_0x57c31b[_0xd48b('0x6')](',');var _0x57c31b=_0x119674['shift']();var _0x51c67e=_0x119674[_0xd48b('0x33')]();if(_0x5cf84b===_0xd48b('0xf')){_0x57c31b=moment(_0x57c31b)[_0xd48b('0x34')](0x0,!![])[_0xd48b('0x17')]();_0x51c67e=moment(_0x51c67e)[_0xd48b('0x34')](0x0,!![])[_0xd48b('0x15')](0x17,'hours')['add'](0x3b,_0xd48b('0x35'))[_0xd48b('0x15')](0x3b,'seconds')['format']();}_0x3d5aad={'start':_0x57c31b,'end':_0x51c67e};break;default:_0x3d5aad[_0xd48b('0x30')]=_0x57c31b;break;}return _0x3d5aad;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 52ab892..f7f0735 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 _0x1b20=['sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','omit','length','isObject','isString','unset','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','join','getOptions','$id','query','model','name','attributes','intersection','fields','nolimit','limit','order','pick','object','filter','columns','value','where','VIRTUAL','lower','merge','options','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','isArray','offset'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var sequelize=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4a27f9){var _0x54eccf=['ne'];try{var _0x27a406=JSON[_0x01b2('0x2')](_0x4a27f9);var _0x2d6e99=Object[_0x01b2('0x3')](_0x27a406)[0x0];return _0x54eccf[_0x01b2('0x4')](_0x2d6e99);}catch(_0x365550){return![];}}function getOperatorValue(_0x419c17){var _0x28de4a=JSON[_0x01b2('0x2')](_0x419c17);var _0xa64ad1=Object[_0x01b2('0x3')](_0x28de4a)[0x0];var _0x323470=_0x28de4a[_0xa64ad1];return{['$'+_0xa64ad1]:_0x323470};}exports['fields']=function(_0x132a08){var _0x591ec0=null;if(_0x132a08){_0x591ec0=_0x132a08[_0x01b2('0x5')](',');}return _0x591ec0;};exports[_0x01b2('0x6')]=function(_0x3bad99,_0x3338f6){var _0x9c411f={};if(!_[_0x01b2('0x7')](_0x3bad99)){_[_0x01b2('0x8')](_0x3bad99,function(_0x22319b,_0x55804c){try{if(_0x3338f6){var _0x3c0044=_['find'](_0x3338f6,{'name':_0x55804c})||{};if(hasSequelizeOperator(_0x22319b)){_0x9c411f[_0x55804c]=getOperatorValue(_0x22319b);}else if(_0x3c0044[_0x01b2('0x9')]==='DATE'&&_[_0x01b2('0xa')](_0x22319b)){var _0x8ac569=JSON[_0x01b2('0x2')](_0x22319b);var _0x5ed1e2={'$gte':moment(moment(_0x8ac569['$gte'])[_0x01b2('0xb')](_0x01b2('0xc')))[_0x01b2('0xd')]()[_0x01b2('0xb')](),'$lte':moment(moment(_0x8ac569[_0x01b2('0xe')])['format'](_0x01b2('0xc')))[_0x01b2('0xd')]()[_0x01b2('0xf')](0x1,'s')[_0x01b2('0xb')]()};_0x9c411f[_0x55804c]=_0x5ed1e2;}else if(_0x3c0044['name']==='uniqueid'){_0x9c411f[_0x55804c]=_0x22319b;}else{_0x9c411f[_0x55804c]=_[_0x01b2('0x10')](_0x22319b)?_0x22319b:JSON[_0x01b2('0x2')](_0x22319b);}}else{_0x9c411f[_0x55804c]=_['isArray'](_0x22319b)?_0x22319b:JSON[_0x01b2('0x2')](_0x22319b);}}catch(_0x444236){_0x9c411f[_0x55804c]=_0x22319b[_0x01b2('0x5')](',');}});}return _0x9c411f;};exports['limit']=function(_0x25c55f){_0x25c55f=parseInt(_0x25c55f,0xa);if(!_0x25c55f||_0x25c55f<0x0){_0x25c55f=LIMIT_VALUE;}return _0x25c55f;};exports[_0x01b2('0x11')]=function(_0x38c4c8){_0x38c4c8=parseInt(_0x38c4c8,0xa);if(!_0x38c4c8||_0x38c4c8<0x0){_0x38c4c8=0x0;}return _0x38c4c8;};exports[_0x01b2('0x12')]=function(_0x1391f5){var _0x56ea3c,_0xfbd5db=null;if(_0x1391f5){_0x56ea3c=_0x1391f5['split'](',');_0xfbd5db=_[_0x01b2('0x13')](_0x56ea3c,function(_0x4c0008){if(_0x4c0008[_0x01b2('0x14')]('-')===0x0){return[_0x4c0008===_0x01b2('0x15')?sequelize[_0x01b2('0x16')](sequelize['col'](_0x01b2('0x15')),_0x01b2('0x17')):_0x4c0008[_0x01b2('0x18')](0x1),_0x01b2('0x19')];}else{return[_0x4c0008===_0x01b2('0x15')?sequelize['cast'](sequelize[_0x01b2('0x1a')]('priority'),'unsigned'):_0x4c0008,_0x01b2('0x1b')];}});}return _0xfbd5db;};exports[_0x01b2('0x1c')]=function(_0x3fcb69,_0x1d2e56){if(_[_0x01b2('0x7')](_0x3fcb69)){return _0x3fcb69;}if(_[_0x01b2('0x10')](_0x3fcb69)){for(var _0x4920f7=0x0;_0x4920f7<_0x3fcb69[_0x01b2('0x1d')];_0x4920f7+=0x1){_0x3fcb69[_0x4920f7]=this[_0x01b2('0x1c')](_0x3fcb69[_0x4920f7],_0x1d2e56);}return _0x3fcb69;}if(!_[_0x01b2('0x1e')](_0x3fcb69)){return _0x3fcb69;}if(_[_0x01b2('0x1f')](_0x1d2e56)){_0x1d2e56=[_0x1d2e56];}if(!_['isArray'](_0x1d2e56)){return _0x3fcb69;}for(var _0x45290e=0x0;_0x45290e<_0x1d2e56['length'];_0x45290e+=0x1){_[_0x01b2('0x20')](_0x3fcb69,_0x1d2e56[_0x45290e]);}for(var _0x1e6ac2 in _0x3fcb69){if(_0x3fcb69['hasOwnProperty'](_0x1e6ac2)){_0x3fcb69[_0x1e6ac2]=this[_0x01b2('0x1c')](_0x3fcb69[_0x1e6ac2],_0x1d2e56);}}return _0x3fcb69;};exports['isNumeric']=function(_0x487c49){return _0x487c49[_0x01b2('0x21')](RegExp(_0x01b2('0x22')))?!![]:![];};exports['isEmail']=function(_0x24ed7d){return _0x24ed7d[_0x01b2('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x01b2('0x23')]=function(_0x2cf50f){var _0x3009a6=[];_0x2cf50f[_0x01b2('0x5')](/[ ,]+/)[_0x01b2('0x24')](function(_0x3169f5){_0x3169f5=_0x3169f5[_0x01b2('0x25')](/([^:]")"+/g,'$1');_0x3169f5='+'+_0x3169f5+'*';var _0x11d8e5=/[ `!@#$%^&*()_\-?~]/;if(_0x3169f5[_0x01b2('0x21')](_0x11d8e5))_0x3169f5='\x22'+_0x3169f5+'\x22';_0x3009a6['push'](_0x3169f5);});return _0x3009a6[_0x01b2('0x26')]('\x20');};exports[_0x01b2('0x27')]=function(_0x1c4ab5,_0x3081ed,_0x306666){var _0x11dd4e={},_0x582dd1={};if(_0x3081ed['query'][_0x01b2('0x28')]){_0x3081ed['query']['id']=_0x3081ed['query'][_0x01b2('0x28')];delete _0x3081ed[_0x01b2('0x29')][_0x01b2('0x28')];}_0x11dd4e[_0x01b2('0x2a')]=_['map'](_0x1c4ab5,_0x01b2('0x2b'));_0x11dd4e['query']=_[_0x01b2('0x3')](_0x3081ed['query']);_0x11dd4e['filters']=_['intersection'](_0x11dd4e[_0x01b2('0x2a')],_0x11dd4e[_0x01b2('0x29')]);_0x582dd1[_0x01b2('0x2c')]=_[_0x01b2('0x2d')](_0x11dd4e['model'],this[_0x01b2('0x2e')](_0x3081ed[_0x01b2('0x29')]['fields']));_0x582dd1[_0x01b2('0x2c')]=_0x582dd1[_0x01b2('0x2c')][_0x01b2('0x1d')]?_0x582dd1[_0x01b2('0x2c')]:_0x11dd4e[_0x01b2('0x2a')];if(!_0x3081ed[_0x01b2('0x29')]['hasOwnProperty'](_0x01b2('0x2f'))){_0x582dd1[_0x01b2('0x30')]=this['limit'](_0x3081ed['query'][_0x01b2('0x30')]);_0x582dd1[_0x01b2('0x11')]=this[_0x01b2('0x11')](_0x3081ed[_0x01b2('0x29')][_0x01b2('0x11')]);}_0x582dd1[_0x01b2('0x31')]=this['sort'](_0x3081ed['query'][_0x01b2('0x12')]);_0x582dd1['where']=this[_0x01b2('0x6')](_[_0x01b2('0x32')](_0x3081ed[_0x01b2('0x29')],_0x11dd4e[_0x01b2('0x6')]),_0x1c4ab5);if(_0x3081ed[_0x01b2('0x29')]['filter']){var _0x279ce0=_0x1c4ab5;var _0x183585=_0x3081ed[_0x01b2('0x29')]['filter'];if(typeof _0x183585===_0x01b2('0x33')){_0x279ce0=_[_0x01b2('0x34')](_0x1c4ab5,function(_0x28a0f4){return _['includes'](_0x183585[_0x01b2('0x35')],_0x28a0f4['name']);});_0x183585=_0x183585[_0x01b2('0x36')];}_0x582dd1[_0x01b2('0x37')]=_['merge'](_0x582dd1[_0x01b2('0x37')],{'$or':_[_0x01b2('0x13')](_0x279ce0,function(_0x4da4aa){if(_0x4da4aa[_0x01b2('0x9')]!==_0x01b2('0x38')){if(_0x306666){return sequelize[_0x01b2('0x37')](sequelize['fn'](_0x01b2('0x39'),sequelize[_0x01b2('0x1a')](_0x4da4aa['name'])),{'$like':sequelize['fn'](_0x01b2('0x39'),'%'+_0x3081ed[_0x01b2('0x29')][_0x01b2('0x34')]+'%')});}else{var _0x5d1b39={};_0x5d1b39[_0x4da4aa[_0x01b2('0x2b')]]={'$like':'%'+_0x3081ed[_0x01b2('0x29')][_0x01b2('0x34')]+'%'};return _0x5d1b39;}}})});}_0x582dd1=_[_0x01b2('0x3a')]({},_0x582dd1,_0x3081ed[_0x01b2('0x3b')]);return _0x582dd1;}; \ No newline at end of file +var _0xb138=['filters','intersection','attributes','limit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','col','priority','substr','DESC','cast','unsigned','ASC','length','omit','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model'];(function(_0xa82c60,_0x3f05bf){var _0x291fef=function(_0x31feda){while(--_0x31feda){_0xa82c60['push'](_0xa82c60['shift']());}};_0x291fef(++_0x3f05bf);}(_0xb138,0x1dd));var _0x8b13=function(_0x2b6a06,_0x43df66){_0x2b6a06=_0x2b6a06-0x0;var _0xcdac20=_0xb138[_0x2b6a06];return _0xcdac20;};'use strict';var _=require(_0x8b13('0x0'));var sequelize=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33f214){var _0xadad70=['ne'];try{var _0x185752=JSON[_0x8b13('0x3')](_0x33f214);var _0x5369d4=Object[_0x8b13('0x4')](_0x185752)[0x0];return _0xadad70[_0x8b13('0x5')](_0x5369d4);}catch(_0x3af81a){return![];}}function getOperatorValue(_0x5ae5b2){var _0xd19a0f=JSON[_0x8b13('0x3')](_0x5ae5b2);var _0x5d51b1=Object[_0x8b13('0x4')](_0xd19a0f)[0x0];var _0x33d1a7=_0xd19a0f[_0x5d51b1];return{['$'+_0x5d51b1]:_0x33d1a7};}exports[_0x8b13('0x6')]=function(_0x498832){var _0x8570b0=null;if(_0x498832){_0x8570b0=_0x498832[_0x8b13('0x7')](',');}return _0x8570b0;};exports['filters']=function(_0x53ae50,_0x1f2528){var _0x21fcd9={};if(!_[_0x8b13('0x8')](_0x53ae50)){_[_0x8b13('0x9')](_0x53ae50,function(_0x3e8eca,_0x51f070){try{if(_0x1f2528){var _0x11bc89=_[_0x8b13('0xa')](_0x1f2528,{'name':_0x51f070})||{};if(hasSequelizeOperator(_0x3e8eca)){_0x21fcd9[_0x51f070]=getOperatorValue(_0x3e8eca);}else if(_0x11bc89[_0x8b13('0xb')]===_0x8b13('0xc')&&_[_0x8b13('0xd')](_0x3e8eca)){var _0x1893b1=JSON['parse'](_0x3e8eca);var _0x50e7a4={'$gte':moment(moment(_0x1893b1[_0x8b13('0xe')])[_0x8b13('0xf')]('YYYY-MM-DD'))['utc']()['format'](),'$lte':moment(moment(_0x1893b1[_0x8b13('0x10')])[_0x8b13('0xf')](_0x8b13('0x11')))[_0x8b13('0x12')]()[_0x8b13('0x13')](0x1,'s')['format']()};_0x21fcd9[_0x51f070]=_0x50e7a4;}else if(_0x11bc89[_0x8b13('0x14')]===_0x8b13('0x15')){_0x21fcd9[_0x51f070]=_0x3e8eca;}else{_0x21fcd9[_0x51f070]=_[_0x8b13('0x16')](_0x3e8eca)?_0x3e8eca:JSON[_0x8b13('0x3')](_0x3e8eca);}}else{_0x21fcd9[_0x51f070]=_[_0x8b13('0x16')](_0x3e8eca)?_0x3e8eca:JSON[_0x8b13('0x3')](_0x3e8eca);}}catch(_0x10fbde){_0x21fcd9[_0x51f070]=_0x3e8eca[_0x8b13('0x7')](',');}});}return _0x21fcd9;};exports['limit']=function(_0x4dac71){_0x4dac71=parseInt(_0x4dac71,0xa);if(!_0x4dac71||_0x4dac71<0x0){_0x4dac71=LIMIT_VALUE;}return _0x4dac71;};exports[_0x8b13('0x17')]=function(_0x335709){_0x335709=parseInt(_0x335709,0xa);if(!_0x335709||_0x335709<0x0){_0x335709=0x0;}return _0x335709;};exports[_0x8b13('0x18')]=function(_0x9c03b4){var _0x1e0fe3,_0x3cc9a0=null;if(_0x9c03b4){_0x1e0fe3=_0x9c03b4['split'](',');_0x3cc9a0=_[_0x8b13('0x19')](_0x1e0fe3,function(_0x3c4d4f){if(_0x3c4d4f[_0x8b13('0x1a')]('-')===0x0){return[_0x3c4d4f==='priority'?sequelize['cast'](sequelize[_0x8b13('0x1b')](_0x8b13('0x1c')),'unsigned'):_0x3c4d4f[_0x8b13('0x1d')](0x1),_0x8b13('0x1e')];}else{return[_0x3c4d4f===_0x8b13('0x1c')?sequelize[_0x8b13('0x1f')](sequelize[_0x8b13('0x1b')]('priority'),_0x8b13('0x20')):_0x3c4d4f,_0x8b13('0x21')];}});}return _0x3cc9a0;};exports['omit']=function(_0x33422f,_0x4fdd1c){if(_[_0x8b13('0x8')](_0x33422f)){return _0x33422f;}if(_[_0x8b13('0x16')](_0x33422f)){for(var _0x54786a=0x0;_0x54786a<_0x33422f[_0x8b13('0x22')];_0x54786a+=0x1){_0x33422f[_0x54786a]=this[_0x8b13('0x23')](_0x33422f[_0x54786a],_0x4fdd1c);}return _0x33422f;}if(!_['isObject'](_0x33422f)){return _0x33422f;}if(_[_0x8b13('0x24')](_0x4fdd1c)){_0x4fdd1c=[_0x4fdd1c];}if(!_[_0x8b13('0x16')](_0x4fdd1c)){return _0x33422f;}for(var _0x410122=0x0;_0x410122<_0x4fdd1c[_0x8b13('0x22')];_0x410122+=0x1){_[_0x8b13('0x25')](_0x33422f,_0x4fdd1c[_0x410122]);}for(var _0x54cdfc in _0x33422f){if(_0x33422f[_0x8b13('0x26')](_0x54cdfc)){_0x33422f[_0x54cdfc]=this[_0x8b13('0x23')](_0x33422f[_0x54cdfc],_0x4fdd1c);}}return _0x33422f;};exports[_0x8b13('0x27')]=function(_0x1511bf){return _0x1511bf[_0x8b13('0x28')](RegExp(_0x8b13('0x29')))?!![]:![];};exports['isEmail']=function(_0x35fdca){return _0x35fdca[_0x8b13('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x8b13('0x2a')]=function(_0x9d2377){var _0x23fde7=[];_0x9d2377[_0x8b13('0x7')](/[ ,]+/)[_0x8b13('0x2b')](function(_0x44bce2){_0x44bce2=_0x44bce2[_0x8b13('0x2c')](/([^:]")"+/g,'$1');_0x44bce2='+'+_0x44bce2+'*';var _0x5751db=/[ `!@#$%^&*()_\-?~]/;if(_0x44bce2[_0x8b13('0x28')](_0x5751db))_0x44bce2='\x22'+_0x44bce2+'\x22';_0x23fde7[_0x8b13('0x2d')](_0x44bce2);});return _0x23fde7[_0x8b13('0x2e')]('\x20');};exports[_0x8b13('0x2f')]=function(_0x51a334,_0x4f7d91,_0xb7771d){var _0x5cedea={},_0x5663fa={};if(_0x4f7d91[_0x8b13('0x30')]['$id']){_0x4f7d91[_0x8b13('0x30')]['id']=_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x31')];delete _0x4f7d91[_0x8b13('0x30')][_0x8b13('0x31')];}_0x5cedea[_0x8b13('0x32')]=_[_0x8b13('0x19')](_0x51a334,_0x8b13('0x14'));_0x5cedea[_0x8b13('0x30')]=_[_0x8b13('0x4')](_0x4f7d91['query']);_0x5cedea[_0x8b13('0x33')]=_[_0x8b13('0x34')](_0x5cedea[_0x8b13('0x32')],_0x5cedea[_0x8b13('0x30')]);_0x5663fa[_0x8b13('0x35')]=_[_0x8b13('0x34')](_0x5cedea[_0x8b13('0x32')],this[_0x8b13('0x6')](_0x4f7d91['query'][_0x8b13('0x6')]));_0x5663fa['attributes']=_0x5663fa[_0x8b13('0x35')][_0x8b13('0x22')]?_0x5663fa[_0x8b13('0x35')]:_0x5cedea[_0x8b13('0x32')];if(!_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x26')]('nolimit')){_0x5663fa['limit']=this[_0x8b13('0x36')](_0x4f7d91['query'][_0x8b13('0x36')]);_0x5663fa['offset']=this[_0x8b13('0x17')](_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x17')]);}_0x5663fa[_0x8b13('0x37')]=this[_0x8b13('0x18')](_0x4f7d91['query']['sort']);_0x5663fa[_0x8b13('0x38')]=this['filters'](_[_0x8b13('0x39')](_0x4f7d91[_0x8b13('0x30')],_0x5cedea['filters']),_0x51a334);if(_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')]){var _0x35c1d6=_0x51a334;var _0x81b931=_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')];if(typeof _0x81b931===_0x8b13('0x3b')){_0x35c1d6=_['filter'](_0x51a334,function(_0x5a3f5c){return _['includes'](_0x81b931[_0x8b13('0x3c')],_0x5a3f5c[_0x8b13('0x14')]);});_0x81b931=_0x81b931[_0x8b13('0x3d')];}_0x5663fa[_0x8b13('0x38')]=_[_0x8b13('0x3e')](_0x5663fa[_0x8b13('0x38')],{'$or':_['map'](_0x35c1d6,function(_0x4342db){if(_0x4342db['type']!==_0x8b13('0x3f')){if(_0xb7771d){return sequelize['where'](sequelize['fn'](_0x8b13('0x40'),sequelize[_0x8b13('0x1b')](_0x4342db[_0x8b13('0x14')])),{'$like':sequelize['fn'](_0x8b13('0x40'),'%'+_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')]+'%')});}else{var _0x2009a1={};_0x2009a1[_0x4342db['name']]={'$like':'%'+_0x4f7d91['query']['filter']+'%'};return _0x2009a1;}}})});}_0x5663fa=_[_0x8b13('0x3e')]({},_0x5663fa,_0x4f7d91[_0x8b13('0x41')]);return _0x5663fa;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 00ceff0..e49105b 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 _0xac78=['lastLoginAt','lastPauseAt','chatPause','faxPause','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','client','http','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','voiceStatus','pause','openchannelStatus','smsStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','startCase','Queue','getAgents','all','flatten','value','getAgentIdsByQueues','map','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','openchannelPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','online'];(function(_0x5c1c6e,_0x438317){var _0x223e16=function(_0x5c87b0){while(--_0x5c87b0){_0x5c1c6e['push'](_0x5c1c6e['shift']());}};_0x223e16(++_0x438317);}(_0xac78,0xcf));var _0x8ac7=function(_0x3ed3d1,_0x397ef8){_0x3ed3d1=_0x3ed3d1-0x0;var _0x31d0c=_0xac78[_0x3ed3d1];return _0x31d0c;};'use strict';var _=require(_0x8ac7('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x8ac7('0x1')][_0x8ac7('0x2')]({'port':0x232a});var routingClient=jayson[_0x8ac7('0x1')][_0x8ac7('0x2')]({'port':0x232c});function isAgentPaused(_0x3ce98c,_0x2d9a8b){var _0x1d396d=[_0x3ce98c['chatPause'],_0x3ce98c['faxPause'],_0x3ce98c[_0x8ac7('0x3')],_0x3ce98c['openchannelPause'],_0x3ce98c[_0x8ac7('0x4')],_0x3ce98c[_0x8ac7('0x5')],_0x3ce98c[_0x8ac7('0x6')]];if(!_0x2d9a8b)return _[_0x8ac7('0x7')](_0x1d396d);var _0x34459a=_[_0x8ac7('0x8')](_0x1d396d);return _0x34459a[_0x8ac7('0x9')]>0x0&&_0x34459a[_0x8ac7('0x9')]<_0x1d396d[_0x8ac7('0x9')]?!![]:![];}function isIdle(_0x42eecb){return _0x42eecb===_0x8ac7('0xa')||_0x42eecb===_0x8ac7('0xb')||_0x42eecb===_0x8ac7('0xc')||_0x42eecb==='ringing'||_['isNil'](_0x42eecb);}function isAgentIdle(_0x24a427){if(_0x24a427[_0x8ac7('0xd')]!==_0x8ac7('0xa')&&_0x24a427[_0x8ac7('0x5')]){_0x24a427[_0x8ac7('0xd')]=_0x8ac7('0xe');return![];}return _[_0x8ac7('0x7')]([_0x24a427['chatStatus'],_0x24a427['faxStatus'],_0x24a427['mailStatus'],_0x24a427[_0x8ac7('0xf')],_0x24a427[_0x8ac7('0x10')],_0x24a427['voiceStatus'],_0x24a427['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x8ac7('0x11')](function(_0x20e95b){if(_0x20e95b[_0x8ac7('0x12')]){throw new Error(_0x8ac7('0x13'));}var _0x15f654=_0x20e95b[_0x8ac7('0x14')];return routingClient[_0x8ac7('0x15')](_0x8ac7('0x16'),{})[_0x8ac7('0x11')](function(_0x3724ab){if(_0x3724ab[_0x8ac7('0x12')]){throw new Error(_0x8ac7('0x17'));}var _0x350f95=_0x3724ab[_0x8ac7('0x14')];return _[_0x8ac7('0x18')]({},_0x15f654,_0x350f95);});})[_0x8ac7('0x19')](function(_0x572248){throw _0x572248;});}exports[_0x8ac7('0x1a')]=getRealtimeAgents;function getAgentStatus(_0x111516){var _0x50f4db=_0x8ac7('0xb');if(isAgentPaused(_0x111516))_0x50f4db=_0x8ac7('0xe');else if(isAgentPaused(_0x111516,!![]))_0x50f4db='*pause';else if(isAgentIdle(_0x111516))_0x50f4db=_0x8ac7('0xa');else _0x50f4db=_0x8ac7('0x1b');return _0x50f4db;}exports[_0x8ac7('0x1c')]=getAgentStatus;function getAgentIdsByQueues(_0x34210e,_0x43f79e){var _0x56d3b5=_['isArray'](_0x34210e)?_0x34210e:[_0x34210e];var _0x3d4fbc=_[_0x8ac7('0x1d')](_0x43f79e)+_0x8ac7('0x1e');var _0x3452c7=_['map'](_0x56d3b5,function(_0x34630a){return db[_0x3d4fbc]['findOne']({'where':{'id':_0x34630a}})['then'](function(_0x1b1191){if(!_0x1b1191)return[];return _0x1b1191[_0x8ac7('0x1f')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x8ac7('0x20')](_0x3452c7)['then'](function(_0x3f9464){var _0x3056ec=_(_0x3f9464)[_0x8ac7('0x21')]()['map']('id')['uniq']()[_0x8ac7('0x22')]();return _0x3056ec;});}exports[_0x8ac7('0x23')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e785b,_0x220b0b,_0x3e3dbd){try{if(_0x220b0b[_0x8ac7('0x9')]>0x0){_0x1e785b=_0x1e785b[_0x8ac7('0x8')](function(_0x4d0f41){return _0x220b0b['includes'](_0x4d0f41['id']);});}var _0xeb54e5=_0x1e785b[_0x8ac7('0x8')](function(_0x39f163){var _0x4b2d2b=_0x8ac7('0x1b');if(isAgentIdle(_0x39f163)){_0x4b2d2b=_0x8ac7('0xa');}return _0x4b2d2b===_0x3e3dbd;});return _[_0x8ac7('0x24')](_0xeb54e5,'id');}catch(_0x276fe5){throw _0x276fe5;}}exports[_0x8ac7('0x25')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x3934dc,_0x4987fe,_0xba9b69){return Promise[_0x8ac7('0x26')]()[_0x8ac7('0x11')](function(){if(_0x4987fe[_0x8ac7('0x9')]>0x0){_0x3934dc=_0x3934dc[_0x8ac7('0x8')](function(_0x310992){return _0x4987fe[_0x8ac7('0x27')](_0x310992['id']);});}return _0x3934dc;})[_0x8ac7('0x11')](function(){return db[_0x8ac7('0x28')][_0x8ac7('0x29')]({'attributes':['id',_0x8ac7('0x2a'),_0x8ac7('0x2b'),'chatPause','faxPause','mailPause',_0x8ac7('0x2c'),_0x8ac7('0x4'),_0x8ac7('0x5'),_0x8ac7('0x6'),_0x8ac7('0x2d')],'where':{'id':{'$in':_[_0x8ac7('0x24')](_0x3934dc,'id')}},'raw':!![]});})[_0x8ac7('0x11')](function(_0x60cf33){return _0x60cf33[_0x8ac7('0x24')](function(_0xe65338){var _0x5e7834=_[_0x8ac7('0x2e')](_0x3934dc,['id',_0xe65338['id']]);var _0x39ad3b=filterAgentAttributes(_0x5e7834);_['merge'](_0xe65338,_0x39ad3b);_0xe65338[_0x8ac7('0x2f')]=getAgentStatus(_0xe65338);return _0xe65338;});})[_0x8ac7('0x11')](function(_0x2d714f){var _0x266614=sortAgentsByStatus(_0x2d714f,_0xba9b69);return _[_0x8ac7('0x24')](_0x266614,'id');})[_0x8ac7('0x19')](function(_0x1e44b7){throw _0x1e44b7;});}exports[_0x8ac7('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x48c3cb){var _0x3454dd={'fields':[],'order':null};var _0x4959e4=_0x48c3cb[_0x8ac7('0x31')](',');_0x3454dd[_0x8ac7('0x32')]=_[_0x8ac7('0x8')](_0x4959e4,function(_0x5ef462){if(!_0x5ef462[_0x8ac7('0x27')](_0x8ac7('0x2f'))){return!![];}_0x3454dd[_0x8ac7('0x33')]=_[_0x8ac7('0x34')](_0x5ef462,'-')?_0x8ac7('0x35'):_0x8ac7('0x36');return![];});return _0x3454dd;}exports[_0x8ac7('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x4b9dfb){if(_0x4b9dfb[_0x8ac7('0x27')](_0x8ac7('0x2b'))&&!_0x4b9dfb[_0x8ac7('0x27')](_0x8ac7('0x38'))){var _0x311cdf=_0x4b9dfb['substring'](0x0,_0x4b9dfb[_0x8ac7('0x39')](_0x8ac7('0x2b')));_0x4b9dfb+=','+_0x311cdf+_0x8ac7('0x38');}return _0x4b9dfb;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0xbd3d2,_0x4050c9){var _0x3a8317=_0xbd3d2[_0x8ac7('0x3a')](function(_0x285140,_0x2bb076){if(_0x285140[_0x8ac7('0x2f')]===_0x2bb076[_0x8ac7('0x2f')]){if(_0x285140[_0x8ac7('0x2f')]===_0x8ac7('0xe')){if(_0x4050c9===_0x8ac7('0x35')){return(_0x285140[_0x8ac7('0x2d')]||'')<(_0x2bb076[_0x8ac7('0x2d')]||'')||_0x285140['fullname'][_0x8ac7('0x3b')]()>_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?0x1:-0x1;}else{return(_0x285140['pauseType']||'')<(_0x2bb076[_0x8ac7('0x2d')]||'')||_0x285140[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()>_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?-0x1:0x1;}}else{if(_0x4050c9===_0x8ac7('0x35')){return _0x285140['fullname']['toLowerCase']()<_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?0x1:-0x1;}else{return _0x285140[_0x8ac7('0x2b')]['toLowerCase']()<_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?-0x1:0x1;}}}else{if(_0x4050c9===_0x8ac7('0x35')){return _0x285140[_0x8ac7('0x2f')]<_0x2bb076[_0x8ac7('0x2f')]?0x1:-0x1;}else{return _0x285140[_0x8ac7('0x2f')]<_0x2bb076[_0x8ac7('0x2f')]?-0x1:0x1;}}});return _0x3a8317;}exports[_0x8ac7('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x1cfa1f){var _0x439f88=[_0x8ac7('0x3d'),_0x8ac7('0x3e'),_0x8ac7('0x3f'),_0x8ac7('0x40'),_0x8ac7('0x2d'),_0x8ac7('0x40'),_0x8ac7('0x38'),'address',_0x8ac7('0x41'),_0x8ac7('0x2c'),'mailPause',_0x8ac7('0x4'),_0x8ac7('0x6'),_0x8ac7('0x42'),_0x8ac7('0x5'),'chatCapacity',_0x8ac7('0x43'),_0x8ac7('0x44'),'smsCapacity','whatsappCapacity',_0x8ac7('0x45'),'chatCurrentCapacity',_0x8ac7('0x46'),_0x8ac7('0x47'),'smsCurrentCapacity',_0x8ac7('0x48'),_0x8ac7('0x49'),'chatStatus','openchannelStatus',_0x8ac7('0x4a'),_0x8ac7('0x10'),_0x8ac7('0x4b'),_0x8ac7('0x4c'),_0x8ac7('0xd'),_0x8ac7('0x4d'),_0x8ac7('0x4e'),_0x8ac7('0x4f'),_0x8ac7('0x50'),_0x8ac7('0x51'),_0x8ac7('0x52'),_0x8ac7('0x53'),'queue','destconnectedlinenum',_0x8ac7('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x8ac7('0x55'),_0x8ac7('0x56')];var _0x547b6a=[_0x8ac7('0x41'),_0x8ac7('0x2c'),'mailPause',_0x8ac7('0x4'),_0x8ac7('0x6'),_0x8ac7('0x42'),_0x8ac7('0x5'),'online'];var _0xcb88ff=_(_0x1cfa1f)[_0x8ac7('0x57')](_0x547b6a)[_0x8ac7('0x58')](_0x439f88)[_0x8ac7('0x22')]();return _0xcb88ff;}exports[_0x8ac7('0x59')]=filterAgentAttributes; \ No newline at end of file +var _0x4fa8=['length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','smsPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','order','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','fullname','validateSortParameter','sort','toLowerCase','userpic','online','lastPauseAt','address','chatCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every'];(function(_0x116a48,_0x29c4f9){var _0x2b26ba=function(_0x284486){while(--_0x284486){_0x116a48['push'](_0x116a48['shift']());}};_0x2b26ba(++_0x29c4f9);}(_0x4fa8,0xb2));var _0x84fa=function(_0x5d677e,_0x132658){_0x5d677e=_0x5d677e-0x0;var _0x79d0a2=_0x4fa8[_0x5d677e];return _0x79d0a2;};'use strict';var _=require(_0x84fa('0x0'));var jayson=require(_0x84fa('0x1'));var db=require(_0x84fa('0x2'))['db'];var amiClient=jayson[_0x84fa('0x3')][_0x84fa('0x4')]({'port':0x232a});var routingClient=jayson[_0x84fa('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x732ca6,_0x566a8d){var _0x50ec5f=[_0x732ca6[_0x84fa('0x5')],_0x732ca6[_0x84fa('0x6')],_0x732ca6[_0x84fa('0x7')],_0x732ca6[_0x84fa('0x8')],_0x732ca6['smsPause'],_0x732ca6[_0x84fa('0x9')],_0x732ca6[_0x84fa('0xa')]];if(!_0x566a8d)return _[_0x84fa('0xb')](_0x50ec5f);var _0x4b963c=_['filter'](_0x50ec5f);return _0x4b963c[_0x84fa('0xc')]>0x0&&_0x4b963c[_0x84fa('0xc')]<_0x50ec5f[_0x84fa('0xc')]?!![]:![];}function isIdle(_0x58b09b){return _0x58b09b===_0x84fa('0xd')||_0x58b09b===_0x84fa('0xe')||_0x58b09b===_0x84fa('0xf')||_0x58b09b==='ringing'||_[_0x84fa('0x10')](_0x58b09b);}function isAgentIdle(_0x5edbce){if(_0x5edbce[_0x84fa('0x11')]!==_0x84fa('0xd')&&_0x5edbce['voicePause']){_0x5edbce[_0x84fa('0x11')]=_0x84fa('0x12');return![];}return _['every']([_0x5edbce[_0x84fa('0x13')],_0x5edbce[_0x84fa('0x14')],_0x5edbce[_0x84fa('0x15')],_0x5edbce[_0x84fa('0x16')],_0x5edbce[_0x84fa('0x17')],_0x5edbce[_0x84fa('0x11')],_0x5edbce[_0x84fa('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x84fa('0x19')](_0x84fa('0x1a'),{})[_0x84fa('0x1b')](function(_0x33cbd3){if(_0x33cbd3[_0x84fa('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x51d64d=_0x33cbd3[_0x84fa('0x1d')];return routingClient[_0x84fa('0x19')](_0x84fa('0x1a'),{})[_0x84fa('0x1b')](function(_0x35dd52){if(_0x35dd52[_0x84fa('0x1c')]){throw new Error(_0x84fa('0x1e'));}var _0x357207=_0x35dd52[_0x84fa('0x1d')];return _[_0x84fa('0x1f')]({},_0x51d64d,_0x357207);});})['catch'](function(_0x113c62){throw _0x113c62;});}exports[_0x84fa('0x20')]=getRealtimeAgents;function getAgentStatus(_0x175cfa){var _0x4d4a67='unknown';if(isAgentPaused(_0x175cfa))_0x4d4a67=_0x84fa('0x12');else if(isAgentPaused(_0x175cfa,!![]))_0x4d4a67=_0x84fa('0x21');else if(isAgentIdle(_0x175cfa))_0x4d4a67=_0x84fa('0xd');else _0x4d4a67=_0x84fa('0x22');return _0x4d4a67;}exports[_0x84fa('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x4304d3,_0x37e857){var _0x52a8b9=_[_0x84fa('0x24')](_0x4304d3)?_0x4304d3:[_0x4304d3];var _0x158ef8=_[_0x84fa('0x25')](_0x37e857)+_0x84fa('0x26');var _0x4ec80d=_[_0x84fa('0x27')](_0x52a8b9,function(_0x330019){return db[_0x158ef8][_0x84fa('0x28')]({'where':{'id':_0x330019}})['then'](function(_0x209fab){if(!_0x209fab)return[];return _0x209fab['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x84fa('0x29')](_0x4ec80d)[_0x84fa('0x1b')](function(_0x57ca67){var _0x2ffe95=_(_0x57ca67)[_0x84fa('0x2a')]()[_0x84fa('0x27')]('id')[_0x84fa('0x2b')]()[_0x84fa('0x2c')]();return _0x2ffe95;});}exports[_0x84fa('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x497c05,_0x3cebd8,_0x29b157){try{if(_0x3cebd8[_0x84fa('0xc')]>0x0){_0x497c05=_0x497c05[_0x84fa('0x2e')](function(_0x2da3d8){return _0x3cebd8[_0x84fa('0x2f')](_0x2da3d8['id']);});}var _0x30ee66=_0x497c05[_0x84fa('0x2e')](function(_0x188a18){var _0x306c7a=_0x84fa('0x22');if(isAgentIdle(_0x188a18)){_0x306c7a='idle';}return _0x306c7a===_0x29b157;});return _[_0x84fa('0x27')](_0x30ee66,'id');}catch(_0x6ee7b6){throw _0x6ee7b6;}}exports[_0x84fa('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2f4c28,_0x541435,_0x19506){return Promise[_0x84fa('0x31')]()[_0x84fa('0x1b')](function(){if(_0x541435[_0x84fa('0xc')]>0x0){_0x2f4c28=_0x2f4c28[_0x84fa('0x2e')](function(_0x446f02){return _0x541435[_0x84fa('0x2f')](_0x446f02['id']);});}return _0x2f4c28;})[_0x84fa('0x1b')](function(){return db[_0x84fa('0x32')][_0x84fa('0x33')]({'attributes':['id',_0x84fa('0x34'),'fullname','chatPause',_0x84fa('0x6'),_0x84fa('0x7'),_0x84fa('0x8'),_0x84fa('0x35'),_0x84fa('0x9'),_0x84fa('0xa'),_0x84fa('0x36')],'where':{'id':{'$in':_['map'](_0x2f4c28,'id')}},'raw':!![]});})[_0x84fa('0x1b')](function(_0x2aeb68){return _0x2aeb68[_0x84fa('0x27')](function(_0xb88d62){var _0x12ebf2=_[_0x84fa('0x37')](_0x2f4c28,['id',_0xb88d62['id']]);var _0x22995f=filterAgentAttributes(_0x12ebf2);_[_0x84fa('0x1f')](_0xb88d62,_0x22995f);_0xb88d62[_0x84fa('0x38')]=getAgentStatus(_0xb88d62);return _0xb88d62;});})[_0x84fa('0x1b')](function(_0x2d9985){var _0x46cd2e=sortAgentsByStatus(_0x2d9985,_0x19506);return _['map'](_0x46cd2e,'id');})[_0x84fa('0x39')](function(_0x286e13){throw _0x286e13;});}exports[_0x84fa('0x3a')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x54da7a){var _0x5cac56={'fields':[],'order':null};var _0x4590b7=_0x54da7a[_0x84fa('0x3b')](',');_0x5cac56['fields']=_[_0x84fa('0x2e')](_0x4590b7,function(_0x1366d0){if(!_0x1366d0[_0x84fa('0x2f')](_0x84fa('0x38'))){return!![];}_0x5cac56[_0x84fa('0x3c')]=_['startsWith'](_0x1366d0,'-')?_0x84fa('0x3d'):_0x84fa('0x3e');return![];});return _0x5cac56;}exports[_0x84fa('0x3f')]=getUpdatedSortOptions;function validateSortParameter(_0x636b26){if(_0x636b26[_0x84fa('0x2f')]('fullname')&&!_0x636b26[_0x84fa('0x2f')](_0x84fa('0x40'))){var _0x39a038=_0x636b26[_0x84fa('0x41')](0x0,_0x636b26[_0x84fa('0x42')](_0x84fa('0x43')));_0x636b26+=','+_0x39a038+_0x84fa('0x40');}return _0x636b26;}exports[_0x84fa('0x44')]=validateSortParameter;function sortAgentsByStatus(_0x5b320a,_0x163d24){var _0x28cf1b=_0x5b320a[_0x84fa('0x45')](function(_0x5153f1,_0x4a2b7f){if(_0x5153f1['globalStatus']===_0x4a2b7f[_0x84fa('0x38')]){if(_0x5153f1[_0x84fa('0x38')]===_0x84fa('0x12')){if(_0x163d24==='DESC'){return(_0x5153f1[_0x84fa('0x36')]||'')<(_0x4a2b7f[_0x84fa('0x36')]||'')||_0x5153f1[_0x84fa('0x43')][_0x84fa('0x46')]()>_0x4a2b7f[_0x84fa('0x43')][_0x84fa('0x46')]()?0x1:-0x1;}else{return(_0x5153f1['pauseType']||'')<(_0x4a2b7f[_0x84fa('0x36')]||'')||_0x5153f1['fullname']['toLowerCase']()>_0x4a2b7f['fullname'][_0x84fa('0x46')]()?-0x1:0x1;}}else{if(_0x163d24===_0x84fa('0x3d')){return _0x5153f1[_0x84fa('0x43')][_0x84fa('0x46')]()<_0x4a2b7f[_0x84fa('0x43')][_0x84fa('0x46')]()?0x1:-0x1;}else{return _0x5153f1[_0x84fa('0x43')][_0x84fa('0x46')]()<_0x4a2b7f['fullname'][_0x84fa('0x46')]()?-0x1:0x1;}}}else{if(_0x163d24===_0x84fa('0x3d')){return _0x5153f1[_0x84fa('0x38')]<_0x4a2b7f[_0x84fa('0x38')]?0x1:-0x1;}else{return _0x5153f1['globalStatus']<_0x4a2b7f[_0x84fa('0x38')]?-0x1:0x1;}}});return _0x28cf1b;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x58c836){var _0x1918b3=[_0x84fa('0x47'),_0x84fa('0x48'),'lastLoginAt',_0x84fa('0x49'),_0x84fa('0x36'),'lastPauseAt',_0x84fa('0x40'),_0x84fa('0x4a'),_0x84fa('0x5'),_0x84fa('0x8'),_0x84fa('0x7'),_0x84fa('0x35'),_0x84fa('0xa'),_0x84fa('0x6'),_0x84fa('0x9'),_0x84fa('0x4b'),'openchannelCapacity','mailCapacity',_0x84fa('0x4c'),'whatsappCapacity',_0x84fa('0x4d'),_0x84fa('0x4e'),_0x84fa('0x4f'),_0x84fa('0x50'),_0x84fa('0x51'),_0x84fa('0x52'),'faxCurrentCapacity',_0x84fa('0x13'),'openchannelStatus',_0x84fa('0x15'),_0x84fa('0x17'),_0x84fa('0x18'),_0x84fa('0x14'),_0x84fa('0x11'),_0x84fa('0x53'),_0x84fa('0x54'),_0x84fa('0x55'),'smsStatusTime','whatsappStatusTime',_0x84fa('0x56'),_0x84fa('0x57'),_0x84fa('0x58'),_0x84fa('0x59'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x84fa('0x5a'),_0x84fa('0x5b')];var _0x4ed4bc=[_0x84fa('0x5'),'openchannelPause',_0x84fa('0x7'),_0x84fa('0x35'),_0x84fa('0xa'),_0x84fa('0x6'),_0x84fa('0x9'),_0x84fa('0x48')];var _0x49557b=_(_0x58c836)[_0x84fa('0x5c')](_0x4ed4bc)[_0x84fa('0x5d')](_0x1918b3)[_0x84fa('0x2c')]();return _0x49557b;}exports[_0x84fa('0x5e')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 00ae722..ba1cb60 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 _0xfcf1=['then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedInDb','find','pick','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','invalid','notInUse','onHold','ringInUse','talking','unknown','pTalking','originated','message','statusMessage','dialActive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xfcf1,0x109));var _0x1fcf=function(_0x1a03e3,_0x384141){_0x1a03e3=_0x1a03e3-0x0;var _0x4238c5=_0xfcf1[_0x1a03e3];return _0x4238c5;};'use strict';var _=require(_0x1fcf('0x0'));var jayson=require(_0x1fcf('0x1'));var util=require(_0x1fcf('0x2'));var amiClient=jayson[_0x1fcf('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x1fcf('0x3')][_0x1fcf('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1fcf('0x5'),_0x1fcf('0x6'),_0x1fcf('0x7'),_0x1fcf('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x1fcf('0x9'),'loggedInDb',_0x1fcf('0xa'),_0x1fcf('0xb'),'ringing',_0x1fcf('0xc'),_0x1fcf('0xd'),'unavailable',_0x1fcf('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1fcf('0xf'),_0x1fcf('0x10'),_0x1fcf('0x11'),_0x1fcf('0x12'),_0x1fcf('0x13'),'dialMethod','Trunk','startPredictive','startProgressive',_0x1fcf('0x14'),'erlangCallToSecond',_0x1fcf('0x15'),_0x1fcf('0x16'),_0x1fcf('0x17'),_0x1fcf('0x18'),_0x1fcf('0x19'),_0x1fcf('0x1a'),'predictiveIntervalTotalCalls',_0x1fcf('0x1b'),_0x1fcf('0x1c'),_0x1fcf('0x1d'),_0x1fcf('0x1e'),_0x1fcf('0x1f')];function getRealtimeQueues(_0x4fe0ba,_0x55b96a){var _0x46d62e=_0x55b96a===_0x1fcf('0x20')?amiClient:routingClient;return _0x46d62e[_0x1fcf('0x21')](_[_0x1fcf('0x22')](_0x55b96a)+'Queues',_0x4fe0ba)[_0x1fcf('0x23')](function(_0xe74637){if(_0xe74637[_0x1fcf('0x24')])throw new Error(util[_0x1fcf('0x25')](_0x1fcf('0x26'),_0x55b96a));return _0xe74637[_0x1fcf('0x27')];})[_0x1fcf('0x28')](function(_0x26af2a){throw _0x26af2a;});}exports[_0x1fcf('0x29')]=getRealtimeQueues;function initializeQueues(_0x2ca311,_0x3939b4,_0x3935f2,_0x1e5649){var _0x483d43=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3935f2===_0x1fcf('0x20')){if(_0x1e5649===_0x1fcf('0x2a')){_0x483d43=_0x483d43[_0x1fcf('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1e5649===_0x1fcf('0x2c')){_0x483d43=_0x483d43[_0x1fcf('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2ca311[_0x1fcf('0x2d')](function(_0x37a635){var _0x55c7c2=_0x37a635[_0x1fcf('0x2e')]({'plain':!![]});_0x55c7c2[_0x1fcf('0x7')]=0x0;_0x55c7c2[_0x1fcf('0x2f')]=0x0;_0x55c7c2[_0x1fcf('0x6')]=0x0;_0x55c7c2['available']=0x0;_0x55c7c2[_0x1fcf('0x8')]=0x0;if(_0x3935f2==='voice'){_0x55c7c2['talking']=0x0;_0x55c7c2['busy']=0x0;if(_0x1e5649==='outbound'){_0x55c7c2[_0x1fcf('0xf')]=0x0;_0x55c7c2[_0x1fcf('0x10')]=0x0;}}var _0x438d2e=_[_0x1fcf('0x30')](_0x3939b4,['id',_0x55c7c2['id']]);if(_0x438d2e){_['merge'](_0x55c7c2,_[_0x1fcf('0x31')](_0x438d2e,_0x483d43));}return _0x55c7c2;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x4f8a=['paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','originated','message','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','then','result','catch','inbound','concat','map','get','busy','outbound','pTalking','merge','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn'];(function(_0x39531c,_0x4e4dfb){var _0x9dfc07=function(_0x419fb9){while(--_0x419fb9){_0x39531c['push'](_0x39531c['shift']());}};_0x9dfc07(++_0x4e4dfb);}(_0x4f8a,0x15e));var _0xa4f8=function(_0x123b39,_0x5bb782){_0x123b39=_0x123b39-0x0;var _0x27963f=_0x4f8a[_0x123b39];return _0x27963f;};'use strict';var _=require(_0xa4f8('0x0'));var jayson=require(_0xa4f8('0x1'));var util=require(_0xa4f8('0x2'));var amiClient=jayson[_0xa4f8('0x3')][_0xa4f8('0x4')]({'port':0x232a});var routingClient=jayson[_0xa4f8('0x3')][_0xa4f8('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xa4f8('0x5'),_0xa4f8('0x6'),_0xa4f8('0x7'),_0xa4f8('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xa4f8('0x9'),_0xa4f8('0xa'),_0xa4f8('0xb'),_0xa4f8('0xc'),_0xa4f8('0xd'),_0xa4f8('0xe'),_0xa4f8('0xf'),_0xa4f8('0x10'),_0xa4f8('0x11'),_0xa4f8('0x12')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xa4f8('0x13'),_0xa4f8('0x14'),_0xa4f8('0x15'),_0xa4f8('0x16'),'dialMethod',_0xa4f8('0x17'),_0xa4f8('0x18'),_0xa4f8('0x19'),_0xa4f8('0x1a'),_0xa4f8('0x1b'),_0xa4f8('0x1c'),_0xa4f8('0x1d'),_0xa4f8('0x1e'),_0xa4f8('0x1f'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0xa4f8('0x20'),_0xa4f8('0x21'),_0xa4f8('0x22'),'predictiveIntervalDroppedCallsCallersExit',_0xa4f8('0x23'),_0xa4f8('0x24')];function getRealtimeQueues(_0x551633,_0x1d6c3a){var _0x2691f9=_0x1d6c3a===_0xa4f8('0x25')?amiClient:routingClient;return _0x2691f9[_0xa4f8('0x26')](_['startCase'](_0x1d6c3a)+'Queues',_0x551633)[_0xa4f8('0x27')](function(_0x28766f){if(_0x28766f['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1d6c3a));return _0x28766f[_0xa4f8('0x28')];})[_0xa4f8('0x29')](function(_0x352ec0){throw _0x352ec0;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x1195cc,_0x4adb45,_0x23a530,_0x18b4c7){var _0xadc4e4=DEFAULT_QUEUE_ATTRIBUTES;if(_0x23a530===_0xa4f8('0x25')){if(_0x18b4c7===_0xa4f8('0x2a')){_0xadc4e4=_0xadc4e4['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x18b4c7==='outbound'){_0xadc4e4=_0xadc4e4[_0xa4f8('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1195cc[_0xa4f8('0x2c')](function(_0xe06e94){var _0x256619=_0xe06e94[_0xa4f8('0x2d')]({'plain':!![]});_0x256619['paused']=0x0;_0x256619[_0xa4f8('0xb')]=0x0;_0x256619[_0xa4f8('0x6')]=0x0;_0x256619['available']=0x0;_0x256619[_0xa4f8('0x8')]=0x0;if(_0x23a530===_0xa4f8('0x25')){_0x256619['talking']=0x0;_0x256619[_0xa4f8('0x2e')]=0x0;if(_0x18b4c7===_0xa4f8('0x2f')){_0x256619[_0xa4f8('0x30')]=0x0;_0x256619[_0xa4f8('0x13')]=0x0;}}var _0x5c67d6=_['find'](_0x4adb45,['id',_0x256619['id']]);if(_0x5c67d6){_[_0xa4f8('0x31')](_0x256619,_['pick'](_0x5c67d6,_0xadc4e4));}return _0x256619;});}exports[_0xa4f8('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 2dd7094..f0fb90d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x3f4579,_0x2d6f73){var _0x200f87=function(_0x3d41a2){while(--_0x3d41a2){_0x3f4579['push'](_0x3f4579['shift']());}};_0x200f87(++_0x2d6f73);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 +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(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e3cb426..d4d8eae 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 _0xf3de=['utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x5e584d,_0x3570e4){var _0x2126ce=function(_0x1b8dd3){while(--_0x1b8dd3){_0x5e584d['push'](_0x5e584d['shift']());}};_0x2126ce(++_0x3570e4);}(_0xf3de,0xd7));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef3d('0x0'));var os=require('os');var crypto=require(_0xef3d('0x1'));var machine=require(_0xef3d('0x2'));var exec=require(_0xef3d('0x3'))[_0xef3d('0x4')];var config=require('../environment');function getInterfaces(){var _0x40f40d=[];var _0x1b80b1=os[_0xef3d('0x5')]();var _0x4f59b2=_[_0xef3d('0x6')](_['keys'](_0x1b80b1));for(var _0xd41877=0x0;_0xd41877<_0x4f59b2[_0xef3d('0x7')];_0xd41877++){var _0x2185bd=_0x1b80b1[_0x4f59b2[_0xd41877]]['filter'](function(_0x506a9f){return _0x506a9f['family']===_0xef3d('0x8')&&_0x506a9f[_0xef3d('0x9')]===![];});_0x40f40d=_0x40f40d['concat'](_0x2185bd);}return _0x40f40d;}function getFirstInterface(){var _0xb7529b=_[_0xef3d('0xa')](getInterfaces());return{'macAddress':_0xb7529b&&_0xb7529b[_0xef3d('0xb')]?_0xb7529b[_0xef3d('0xb')]:_0xef3d('0xc'),'ipAddress':_0xb7529b&&_0xb7529b[_0xef3d('0xd')]?_0xb7529b['address']:_0xef3d('0xe')};}exports[_0xef3d('0xf')]=getFirstInterface;function getCPUhash(){var _0x473ca9=_[_0xef3d('0x6')](os[_0xef3d('0x10')]()[_0xef3d('0x11')](function(_0x3696d3){return _0x3696d3[_0xef3d('0x12')];}))[_0xef3d('0x13')](':');return crypto[_0xef3d('0x14')](_0xef3d('0x15'))[_0xef3d('0x16')](_0x473ca9)[_0xef3d('0x17')](_0xef3d('0x18'));}exports[_0xef3d('0x19')]=function(){var _0x29472e=os[_0xef3d('0x1a')]();var _0x402e39=/[0-9a-f-]{36}/;if(config[_0xef3d('0x1b')]&&_0x402e39['test'](config[_0xef3d('0x1b')])){return config[_0xef3d('0x1b')];}else if(_0x29472e===_0xef3d('0x1c')){return exec(_0xef3d('0x1d'),{'encoding':_0xef3d('0x1e')})[_0xef3d('0x1f')]('\x0d\x0a','');}else{var _0x457c7a=getFirstInterface();var _0x5094bd=getCPUhash();var _0x17d428=_0x5094bd+'|'+os['hostname']()+'|'+_0x457c7a[_0xef3d('0x20')]+'|'+_0x457c7a[_0xef3d('0x21')];var _0x14c5cb=crypto[_0xef3d('0x14')]('md5')[_0xef3d('0x16')](_0x17d428)[_0xef3d('0x17')](_0xef3d('0x18'));return _0x14c5cb[_0xef3d('0x22')](0x0,0x8)+'-'+_0x14c5cb[_0xef3d('0x22')](0x8,0xc)+'-'+_0x14c5cb[_0xef3d('0x22')](0xc,0x10)+'-'+_0x14c5cb['substring'](0x10,0x14)+'-'+_0x14c5cb[_0xef3d('0x22')](0x14);}}; \ No newline at end of file +var _0x98f5=['crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','length','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','update','substring'];(function(_0x5b0708,_0x514b4a){var _0x240614=function(_0x1eaf6c){while(--_0x1eaf6c){_0x5b0708['push'](_0x5b0708['shift']());}};_0x240614(++_0x514b4a);}(_0x98f5,0xd2));var _0x598f=function(_0x39aa10,_0x4c980f){_0x39aa10=_0x39aa10-0x0;var _0x5bc78f=_0x98f5[_0x39aa10];return _0x5bc78f;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x598f('0x0'));var machine=require(_0x598f('0x1'));var exec=require('child_process')[_0x598f('0x2')];var config=require(_0x598f('0x3'));function getInterfaces(){var _0x12185d=[];var _0x46cdeb=os[_0x598f('0x4')]();var _0x1d0b1e=_[_0x598f('0x5')](_['keys'](_0x46cdeb));for(var _0x51335e=0x0;_0x51335e<_0x1d0b1e[_0x598f('0x6')];_0x51335e++){var _0x336e97=_0x46cdeb[_0x1d0b1e[_0x51335e]]['filter'](function(_0x3d21d8){return _0x3d21d8['family']===_0x598f('0x7')&&_0x3d21d8[_0x598f('0x8')]===![];});_0x12185d=_0x12185d[_0x598f('0x9')](_0x336e97);}return _0x12185d;}function getFirstInterface(){var _0x34b645=_[_0x598f('0xa')](getInterfaces());return{'macAddress':_0x34b645&&_0x34b645[_0x598f('0xb')]?_0x34b645[_0x598f('0xb')]:_0x598f('0xc'),'ipAddress':_0x34b645&&_0x34b645[_0x598f('0xd')]?_0x34b645[_0x598f('0xd')]:'127.0.0.1'};}exports[_0x598f('0xe')]=getFirstInterface;function getCPUhash(){var _0x190743=_[_0x598f('0x5')](os[_0x598f('0xf')]()[_0x598f('0x10')](function(_0x58ca8e){return _0x58ca8e[_0x598f('0x11')];}))[_0x598f('0x12')](':');return crypto[_0x598f('0x13')](_0x598f('0x14'))['update'](_0x190743)[_0x598f('0x15')](_0x598f('0x16'));}exports[_0x598f('0x17')]=function(){var _0x3a20b5=os['platform']();var _0x1e733c=/[0-9a-f-]{36}/;if(config[_0x598f('0x18')]&&_0x1e733c[_0x598f('0x19')](config['licenseToken'])){return config[_0x598f('0x18')];}else if(_0x3a20b5===_0x598f('0x1a')){return exec(_0x598f('0x1b'),{'encoding':_0x598f('0x1c')})[_0x598f('0x1d')]('\x0d\x0a','');}else{var _0x5c3837=getFirstInterface();var _0x34781e=getCPUhash();var _0x522576=_0x34781e+'|'+os[_0x598f('0x1e')]()+'|'+_0x5c3837[_0x598f('0x1f')]+'|'+_0x5c3837[_0x598f('0x20')];var _0xda0930=crypto[_0x598f('0x13')](_0x598f('0x14'))[_0x598f('0x21')](_0x522576)[_0x598f('0x15')]('hex');return _0xda0930[_0x598f('0x22')](0x0,0x8)+'-'+_0xda0930[_0x598f('0x22')](0x8,0xc)+'-'+_0xda0930[_0x598f('0x22')](0xc,0x10)+'-'+_0xda0930['substring'](0x10,0x14)+'-'+_0xda0930[_0x598f('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index eec4d52..146cd64 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 _0x4d59=['error','message','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../logger','https://www.xcallymotion.com','format','exports','GET','then','catch','get','data1','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x5883e2,_0x4491d9){var _0x282302=function(_0x63eeb3){while(--_0x63eeb3){_0x5883e2['push'](_0x5883e2['shift']());}};_0x282302(++_0x4491d9);}(_0x4d59,0x18c));var _0x94d5=function(_0x32d120,_0x1f48ab){_0x32d120=_0x32d120-0x0;var _0x11c12c=_0x4d59[_0x32d120];return _0x11c12c;};'use strict';var util=require(_0x94d5('0x0'));var moment=require(_0x94d5('0x1'));var rp=require(_0x94d5('0x2'));var BPromise=require(_0x94d5('0x3'));var pkginfo=require(_0x94d5('0x4'))(module,_0x94d5('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x94d5('0x6'))('license');var HOST=_0x94d5('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x177273){return new BPromise(function(_0x55b615,_0x45804c){var _0x1d17e2=util[_0x94d5('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x177273,module[_0x94d5('0x9')][_0x94d5('0x5')]);if(oldToken){_0x1d17e2=util[_0x94d5('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x177273,module['exports'][_0x94d5('0x5')],oldToken);}var _0x3753ed={'uri':_0x1d17e2,'method':_0x94d5('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x3753ed)[_0x94d5('0xb')](function(_0x349b0a){_0x55b615(_0x349b0a);})[_0x94d5('0xc')](function(_0x31838e){_0x45804c(_0x31838e);});});}function manageLicense(_0x2875ea,_0x3c8145){var _0x423424=_0x3c8145[_0x94d5('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x423424['data1']!==_0x2875ea&&!_0x423424['data2']){oldToken=_0x423424[_0x94d5('0xe')];}httpRequest(_0x2875ea)[_0x94d5('0xb')](function(_0x2a1670){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2a1670[_0x94d5('0xf')]){isOldTokenSent=![];if(!_0x423424[_0x94d5('0x10')]&&_0x423424[_0x94d5('0x10')]!=_0x2a1670['license']||_0x423424[_0x94d5('0x10')]&&_0x423424[_0x94d5('0x11')]){logger[_0x94d5('0x12')](_0x94d5('0x13'));}if(_0x423424[_0x94d5('0x10')]&&!_0x423424[_0x94d5('0x11')]&&_0x423424[_0x94d5('0x10')]!=_0x2a1670['license']){logger[_0x94d5('0x12')](_0x94d5('0x14'));}if(_0x423424[_0x94d5('0x10')]&&!_0x423424['data2']&&_0x423424[_0x94d5('0x10')]==_0x2a1670[_0x94d5('0x10')]){return _0x3c8145;}return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':_0x2a1670[_0x94d5('0x10')]});}else{if(_0x2a1670[_0x94d5('0x10')]||_0x423424[_0x94d5('0x10')]){if(!_0x423424['data2']){if(_0x423424[_0x94d5('0xe')]==_0x2875ea){GRAY_PERIOD_REASON=_0x94d5('0x16');logger['info'](_0x94d5('0x17'));}else{GRAY_PERIOD_REASON=_0x94d5('0x18');logger[_0x94d5('0x12')](_0x94d5('0x19'),_0x423424['data1'],_0x2875ea);}logger[_0x94d5('0x12')](_0x94d5('0x1a'),GRAY_PERIOD_REASON[_0x94d5('0x1b')](),moment()[_0x94d5('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x3c8145['update']({'data2':encryptor[_0x94d5('0x1c')](moment()[_0x94d5('0x8')](_0x94d5('0x1d')))});}else{if(moment()['diff'](encryptor[_0x94d5('0x1e')](_0x423424[_0x94d5('0x11')]),_0x94d5('0x1f'))>DAYS){logger[_0x94d5('0x12')](_0x94d5('0x20'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':null});}}}else{if(_0x423424[_0x94d5('0xe')]!=_0x2875ea){logger[_0x94d5('0x12')](_0x94d5('0x19'),_0x423424[_0x94d5('0xe')],_0x2875ea);return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':null});}}}return _0x3c8145;})[_0x94d5('0xb')](function(_0x4529a8){_0x3c8145=_0x4529a8;})['catch'](function(_0x49437a){logger[_0x94d5('0x21')](_0x49437a[_0x94d5('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x94d5('0x23')](),_0x3c8145);},TIME);});}function defaultLicense(){var _0x56e195=hardware['getUuid']();if(_0x56e195){return db[_0x94d5('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x56e195}})['spread'](function(_0x5e5d53,_0x4a8b44){logger[_0x94d5('0x12')](_0x94d5('0x25'),_0x56e195);manageLicense(_0x56e195,_0x5e5d53);})[_0x94d5('0xc')](function(_0x48c6c8){logger['error'](_0x48c6c8['message']);});}}exports[_0x94d5('0x26')]=defaultLicense; \ No newline at end of file +var _0xebd8=['getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','%s/api/servers/%s/check?version=%s','exports','format','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','catch','message','finally'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xebd8,0xa1));var _0x8ebd=function(_0x3c7254,_0x2c2891){_0x3c7254=_0x3c7254-0x0;var _0x171499=_0xebd8[_0x3c7254];return _0x171499;};'use strict';var util=require('util');var moment=require(_0x8ebd('0x0'));var rp=require(_0x8ebd('0x1'));var BPromise=require(_0x8ebd('0x2'));var pkginfo=require(_0x8ebd('0x3'))(module,_0x8ebd('0x4'));var db=require(_0x8ebd('0x5'))['db'];var encryptor=require(_0x8ebd('0x6'));var hardware=require(_0x8ebd('0x7'));var logger=require(_0x8ebd('0x8'))(_0x8ebd('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4ac44c){return new BPromise(function(_0x5d128d,_0x422f35){var _0x2eef19=util['format'](_0x8ebd('0xa'),HOST,_0x4ac44c,module[_0x8ebd('0xb')][_0x8ebd('0x4')]);if(oldToken){_0x2eef19=util[_0x8ebd('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4ac44c,module[_0x8ebd('0xb')]['version'],oldToken);}var _0x2e43d2={'uri':_0x2eef19,'method':_0x8ebd('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2e43d2)[_0x8ebd('0xe')](function(_0x12fd61){_0x5d128d(_0x12fd61);})['catch'](function(_0x1cb1e7){_0x422f35(_0x1cb1e7);});});}function manageLicense(_0x1d5da4,_0x3e8040){var _0x3ae44b=_0x3e8040[_0x8ebd('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x3ae44b[_0x8ebd('0x10')]!==_0x1d5da4&&!_0x3ae44b[_0x8ebd('0x11')]){oldToken=_0x3ae44b[_0x8ebd('0x10')];}httpRequest(_0x1d5da4)[_0x8ebd('0xe')](function(_0x51f257){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x51f257[_0x8ebd('0x12')]){isOldTokenSent=![];if(!_0x3ae44b[_0x8ebd('0x9')]&&_0x3ae44b[_0x8ebd('0x9')]!=_0x51f257['license']||_0x3ae44b[_0x8ebd('0x9')]&&_0x3ae44b['data2']){logger[_0x8ebd('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3ae44b[_0x8ebd('0x9')]&&!_0x3ae44b[_0x8ebd('0x11')]&&_0x3ae44b[_0x8ebd('0x9')]!=_0x51f257[_0x8ebd('0x9')]){logger['info'](_0x8ebd('0x14'));}if(_0x3ae44b[_0x8ebd('0x9')]&&!_0x3ae44b['data2']&&_0x3ae44b['license']==_0x51f257[_0x8ebd('0x9')]){return _0x3e8040;}return _0x3e8040[_0x8ebd('0x15')]({'data1':_0x1d5da4,'data2':null,'license':_0x51f257[_0x8ebd('0x9')]});}else{if(_0x51f257[_0x8ebd('0x9')]||_0x3ae44b[_0x8ebd('0x9')]){if(!_0x3ae44b['data2']){if(_0x3ae44b['data1']==_0x1d5da4){GRAY_PERIOD_REASON=_0x8ebd('0x16');logger[_0x8ebd('0x13')](_0x8ebd('0x17'));}else{GRAY_PERIOD_REASON=_0x8ebd('0x18');logger['info'](_0x8ebd('0x19'),_0x3ae44b[_0x8ebd('0x10')],_0x1d5da4);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x8ebd('0x1a')](),moment()[_0x8ebd('0xc')](_0x8ebd('0x1b')));return _0x3e8040[_0x8ebd('0x15')]({'data2':encryptor[_0x8ebd('0x1c')](moment()[_0x8ebd('0xc')](_0x8ebd('0x1b')))});}else{if(moment()[_0x8ebd('0x1d')](encryptor['decryptString'](_0x3ae44b['data2']),_0x8ebd('0x1e'))>DAYS){logger[_0x8ebd('0x13')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x8ebd('0x1b')));isOldTokenSent=![];return _0x3e8040['update']({'data1':_0x1d5da4,'data2':null,'license':null});}}}else{if(_0x3ae44b[_0x8ebd('0x10')]!=_0x1d5da4){logger[_0x8ebd('0x13')](_0x8ebd('0x19'),_0x3ae44b[_0x8ebd('0x10')],_0x1d5da4);return _0x3e8040[_0x8ebd('0x15')]({'data1':_0x1d5da4,'data2':null,'license':null});}}}return _0x3e8040;})[_0x8ebd('0xe')](function(_0x45d918){_0x3e8040=_0x45d918;})[_0x8ebd('0x1f')](function(_0x40bc78){logger['error'](_0x40bc78[_0x8ebd('0x20')]);})[_0x8ebd('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x8ebd('0x22')](),_0x3e8040);},TIME);});}function defaultLicense(){var _0x1a98a1=hardware[_0x8ebd('0x22')]();if(_0x1a98a1){return db['License'][_0x8ebd('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x1a98a1}})[_0x8ebd('0x24')](function(_0x87ffbb,_0x56d068){logger['info'](_0x8ebd('0x25'),_0x1a98a1);manageLicense(_0x1a98a1,_0x87ffbb);})[_0x8ebd('0x1f')](function(_0x39598b){logger[_0x8ebd('0x26')](_0x39598b[_0x8ebd('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 42b5bc8..03c21be 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 _0xbe7b=['isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','getUuid','gray','deadline','add','days','changed','data1','message','User','findAll','role','sequelize','COUNT','col','telephone','users','forEach','user','countBy','admin','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','then','catch','uuid','license'];(function(_0x31ec5a,_0x193db){var _0x2b6b97=function(_0x4ea773){while(--_0x4ea773){_0x31ec5a['push'](_0x31ec5a['shift']());}};_0x2b6b97(++_0x193db);}(_0xbe7b,0x147));var _0xbbe7=function(_0x531424,_0x215494){_0x531424=_0x531424-0x0;var _0x83c322=_0xbe7b[_0x531424];return _0x83c322;};'use strict';var util=require(_0xbbe7('0x0'));var _=require(_0xbbe7('0x1'));var moment=require(_0xbbe7('0x2'));var BPromise=require(_0xbbe7('0x3'));var hardware=require(_0xbbe7('0x4'));var encryptor=require(_0xbbe7('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbbe7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbbe7('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbbe7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbbe7('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x76338f){return new BPromise(function(_0x4bc00f,_0x5a12ab){return db[_0xbbe7('0x9')][_0xbbe7('0xa')](_[_0xbbe7('0xb')](_0x76338f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5dce83){return checkLicense(_0x5dce83,null);})[_0xbbe7('0xc')](function(_0x1925ec){_0x4bc00f(_0x1925ec);return;})[_0xbbe7('0xd')](function(_0x3265cc){_0x5a12ab(_0x3265cc);});});}function checkLicense(_0xce5409,_0x45c94d){if(!_0xce5409){demoLicense[_0xbbe7('0xe')]=_0xce5409['data1'];return demoLicense;}try{var _0x2c56d5=_0x45c94d||_0xce5409[_0xbbe7('0xf')];if(_[_0xbbe7('0x10')](_0x2c56d5)){throw new Error(_0xbbe7('0x11'));}var _0x45172c=_0xce5409['data1'];var _0x359dfe=_0xce5409[_0xbbe7('0x12')];var _0x45db6f=_0x45172c[_0xbbe7('0x13')]('-')[0x4];var _0x2f2dbe=_0x45172c[_0xbbe7('0x13')]('-')[0x0];var _0x47d173=encryptor[_0xbbe7('0x14')](_0x2c56d5,util[_0xbbe7('0x15')](_0xbbe7('0x16'),_0x45db6f,_0x45172c,_0x2f2dbe));var _0x53c85d=JSON[_0xbbe7('0x17')](_0x47d173);_0x53c85d[_0xbbe7('0x18')]=![];_0x53c85d[_0xbbe7('0xe')]=_0x45172c;_0x53c85d[_0xbbe7('0x19')]=hardware[_0xbbe7('0x1a')]();if(_0x359dfe){var _0x1cfb79=encryptor[_0xbbe7('0x14')](_0x359dfe);_0x53c85d[_0xbbe7('0x1b')]=_0x1cfb79;_0x53c85d[_0xbbe7('0x1c')]=moment(_0x1cfb79)[_0xbbe7('0x1d')](0x7,_0xbbe7('0x1e'))[_0xbbe7('0x15')]();_0x53c85d['grayReason']=_0x53c85d[_0xbbe7('0xe')]!=_0x53c85d[_0xbbe7('0x19')]?_0xbbe7('0x1f'):'disabled';}return _0x53c85d;}catch(_0x47807a){breakingLicense[_0xbbe7('0xe')]=_0xce5409[_0xbbe7('0x20')];breakingLicense[_0xbbe7('0x21')]=_0x47807a[_0xbbe7('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x9df25,_0x4020ff){getLicense()[_0xbbe7('0xc')](function(_0x11a39){return db[_0xbbe7('0x22')][_0xbbe7('0x23')]({'attributes':[_0xbbe7('0x24'),[db[_0xbbe7('0x25')]['fn'](_0xbbe7('0x26'),db['sequelize'][_0xbbe7('0x27')](_0xbbe7('0x24'))),'count']],'group':_0xbbe7('0x24'),'where':{'role':{'$or':['admin','user',_0xbbe7('0x28')]}},'raw':!![]})[_0xbbe7('0xc')](function(_0x2eb105){var _0x5e4af7={'user':_0x11a39[_0xbbe7('0x29')]||0x0,'telephone':_0x11a39['telephones']||0x0};_0x2eb105[_0xbbe7('0x2a')](function(_0x4a966a){var _0x262b1a=_0x4a966a['role']==='admin'?_0xbbe7('0x2b'):_0x4a966a[_0xbbe7('0x24')];_0x5e4af7[_0x262b1a]-=_0x4a966a['count'];if(_0x5e4af7[_0x262b1a]<0x0)_0x5e4af7[_0x262b1a]=0x0;});_0x9df25(_0x5e4af7);return;});})[_0xbbe7('0xd')](function(_0x4b4ddd){_0x4020ff(_0x4b4ddd);});});}function checkUserLimits(_0x5dc9bd){return new BPromise(function(_0x4a5521,_0x4a857a){getLimits()[_0xbbe7('0xc')](function(_0x2fff95){var _0x46700a=_['pick'](_[_0xbbe7('0x2c')](_0x5dc9bd,'role'),[_0xbbe7('0x2d'),_0xbbe7('0x2b'),_0xbbe7('0x28')]);var _0x3c4415=(_0x46700a[_0xbbe7('0x2d')]||0x0)+(_0x46700a[_0xbbe7('0x2b')]||0x0);var _0x144b7b=_0x46700a[_0xbbe7('0x28')]||0x0;if(_0x3c4415>_0x2fff95[_0xbbe7('0x2b')])return _0x4a857a(_0xbbe7('0x2e'));if(_0x144b7b>_0x2fff95[_0xbbe7('0x28')])return _0x4a857a(_0xbbe7('0x2f'));return _0x4a5521();})['catch'](function(_0x128909){_0x4a857a(_0x128909);});});}module[_0xbbe7('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x32ff=['users','telephones','forEach','catch','pick','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','Breaking\x20license','License','defaults','then','data1','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','getUuid','gray','add','days','changed','disabled','message','User','findAll','role','sequelize','COUNT','admin','user','telephone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32ff,0x15f));var _0xf32f=function(_0xe17cea,_0x3eac1e){_0xe17cea=_0xe17cea-0x0;var _0x48bb15=_0x32ff[_0xe17cea];return _0x48bb15;};'use strict';var util=require(_0xf32f('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf32f('0x1'));var hardware=require(_0xf32f('0x2'));var encryptor=require(_0xf32f('0x3'));var db=require(_0xf32f('0x4'))['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':_0xf32f('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'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':![],'update':![],'description':_0xf32f('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3dcbbb){return new BPromise(function(_0x125856,_0x424ada){return db[_0xf32f('0x7')]['find'](_[_0xf32f('0x8')](_0x3dcbbb,{'raw':!![],'where':{'id':0x1}}))[_0xf32f('0x9')](function(_0x168811){return checkLicense(_0x168811,null);})[_0xf32f('0x9')](function(_0x7e7c0d){_0x125856(_0x7e7c0d);return;})['catch'](function(_0x55a8d0){_0x424ada(_0x55a8d0);});});}function checkLicense(_0x133618,_0x416bb2){if(!_0x133618){demoLicense['uuid']=_0x133618[_0xf32f('0xa')];return demoLicense;}try{var _0x5d0d6d=_0x416bb2||_0x133618['license'];if(_[_0xf32f('0xb')](_0x5d0d6d)){throw new Error(_0xf32f('0xc'));}var _0x171fb6=_0x133618[_0xf32f('0xa')];var _0x2eec6d=_0x133618['data2'];var _0x33ff9b=_0x171fb6[_0xf32f('0xd')]('-')[0x4];var _0x463a14=_0x171fb6[_0xf32f('0xd')]('-')[0x0];var _0x5cdc24=encryptor[_0xf32f('0xe')](_0x5d0d6d,util[_0xf32f('0xf')](_0xf32f('0x10'),_0x33ff9b,_0x171fb6,_0x463a14));var _0x45831f=JSON[_0xf32f('0x11')](_0x5cdc24);_0x45831f[_0xf32f('0x12')]=![];_0x45831f[_0xf32f('0x13')]=_0x171fb6;_0x45831f[_0xf32f('0x14')]=hardware[_0xf32f('0x15')]();if(_0x2eec6d){var _0x461c6e=encryptor[_0xf32f('0xe')](_0x2eec6d);_0x45831f[_0xf32f('0x16')]=_0x461c6e;_0x45831f['deadline']=moment(_0x461c6e)[_0xf32f('0x17')](0x7,_0xf32f('0x18'))['format']();_0x45831f['grayReason']=_0x45831f['uuid']!=_0x45831f['machineUuid']?_0xf32f('0x19'):_0xf32f('0x1a');}return _0x45831f;}catch(_0xe9b579){breakingLicense[_0xf32f('0x13')]=_0x133618['data1'];breakingLicense[_0xf32f('0x1b')]=_0xe9b579[_0xf32f('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5a989c,_0x3e7a96){getLicense()[_0xf32f('0x9')](function(_0x41f214){return db[_0xf32f('0x1c')][_0xf32f('0x1d')]({'attributes':[_0xf32f('0x1e'),[db[_0xf32f('0x1f')]['fn'](_0xf32f('0x20'),db[_0xf32f('0x1f')]['col'](_0xf32f('0x1e'))),'count']],'group':_0xf32f('0x1e'),'where':{'role':{'$or':[_0xf32f('0x21'),_0xf32f('0x22'),_0xf32f('0x23')]}},'raw':!![]})[_0xf32f('0x9')](function(_0x578208){var _0x3cc9e3={'user':_0x41f214[_0xf32f('0x24')]||0x0,'telephone':_0x41f214[_0xf32f('0x25')]||0x0};_0x578208[_0xf32f('0x26')](function(_0x2ddcf5){var _0x286378=_0x2ddcf5[_0xf32f('0x1e')]===_0xf32f('0x21')?_0xf32f('0x22'):_0x2ddcf5['role'];_0x3cc9e3[_0x286378]-=_0x2ddcf5['count'];if(_0x3cc9e3[_0x286378]<0x0)_0x3cc9e3[_0x286378]=0x0;});_0x5a989c(_0x3cc9e3);return;});})[_0xf32f('0x27')](function(_0x2ecac4){_0x3e7a96(_0x2ecac4);});});}function checkUserLimits(_0x4594e0){return new BPromise(function(_0x3f0b1,_0x1f69be){getLimits()[_0xf32f('0x9')](function(_0x22928e){var _0x76bce4=_[_0xf32f('0x28')](_['countBy'](_0x4594e0,_0xf32f('0x1e')),[_0xf32f('0x21'),_0xf32f('0x22'),_0xf32f('0x23')]);var _0x433efb=(_0x76bce4[_0xf32f('0x21')]||0x0)+(_0x76bce4[_0xf32f('0x22')]||0x0);var _0x1a4332=_0x76bce4[_0xf32f('0x23')]||0x0;if(_0x433efb>_0x22928e['user'])return _0x1f69be('License\x20limit\x20reached\x20for\x20users');if(_0x1a4332>_0x22928e['telephone'])return _0x1f69be(_0xf32f('0x29'));return _0x3f0b1();})['catch'](function(_0x1e2ecd){_0x1f69be(_0x1e2ecd);});});}module[_0xf32f('0x2a')]={'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 0dc430c..18f2a31 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 _0x4325=['app-id','secret','exports','http://localhost:9000'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';module[_0x5432('0x0')]={'DOMAIN':_0x5432('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x5432('0x2'),'GOOGLE_SECRET':_0x5432('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x958a=['exports','http://localhost:9000','app-id','secret'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0x958a,0x128));var _0xa958=function(_0x36a117,_0x32cf83){_0x36a117=_0x36a117-0x0;var _0x32036f=_0x958a[_0x36a117];return _0x32036f;};'use strict';module[_0xa958('0x0')]={'DOMAIN':_0xa958('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xa958('0x2'),'GOOGLE_SECRET':_0xa958('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bec7139..b89ece2 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe39e=['../utils/loggers'];(function(_0xd56b88,_0xdcc8fe){var _0x417c12=function(_0x256d98){while(--_0x256d98){_0xd56b88['push'](_0xd56b88['shift']());}};_0x417c12(++_0xdcc8fe);}(_0xe39e,0x1ef));var _0xee39=function(_0x5224d9,_0x3431c6){_0x5224d9=_0x5224d9-0x0;var _0x421ea3=_0xe39e[_0x5224d9];return _0x421ea3;};'use strict';var fileLogger=require(_0xee39('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0xa19d=['../utils/loggers','exports'];(function(_0x93200d,_0xbfa500){var _0x21676e=function(_0x3f5570){while(--_0x3f5570){_0x93200d['push'](_0x93200d['shift']());}};_0x21676e(++_0xbfa500);}(_0xa19d,0xca));var _0xda19=function(_0x51cc99,_0x5ea308){_0x51cc99=_0x51cc99-0x0;var _0x186820=_0xa19d[_0x51cc99];return _0x186820;};'use strict';var fileLogger=require(_0xda19('0x0'))['fileLogger'];module[_0xda19('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 7c8f67f..d5f383f 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 _0x635f=['email','routing','../../services/routing/index.js','xdr','../../config/environment','resolve','root','express','ami','join','agi','../../services/agi/index.js'];(function(_0x14b70a,_0x4bffc2){var _0x1c022f=function(_0x3367c0){while(--_0x3367c0){_0x14b70a['push'](_0x14b70a['shift']());}};_0x1c022f(++_0x4bffc2);}(_0x635f,0x13c));var _0xf635=function(_0x2dde6b,_0x16b4aa){_0x2dde6b=_0x2dde6b-0x0;var _0x2cf3b8=_0x635f[_0x2dde6b];return _0x2cf3b8;};'use strict';var path=require('path');var cfg=require(_0xf635('0x0'));var env={'NODE_PATH':path[_0xf635('0x1')](path['join'](cfg[_0xf635('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xf635('0x3'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xf635('0x4'),'script':path[_0xf635('0x5')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xf635('0x6'),'script':path[_0xf635('0x5')](__dirname,_0xf635('0x7')),'env':env},{'name':_0xf635('0x8'),'script':path[_0xf635('0x5')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xf635('0x9'),'script':path['join'](__dirname,_0xf635('0xa')),'env':env},{'name':_0xf635('0xb'),'script':path[_0xf635('0x5')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x4fcd=['../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root','legacy-libs','express'];(function(_0x180d0e,_0x3a43d5){var _0x24e629=function(_0xffcb0b){while(--_0xffcb0b){_0x180d0e['push'](_0x180d0e['shift']());}};_0x24e629(++_0x3a43d5);}(_0x4fcd,0x191));var _0xd4fc=function(_0x527a1f,_0xa115f8){_0x527a1f=_0x527a1f-0x0;var _0x599e8c=_0x4fcd[_0x527a1f];return _0x599e8c;};'use strict';var path=require(_0xd4fc('0x0'));var cfg=require(_0xd4fc('0x1'));var env={'NODE_PATH':path[_0xd4fc('0x2')](path[_0xd4fc('0x3')](cfg[_0xd4fc('0x4')],_0xd4fc('0x5')))};var pm2config={'apps':[{'name':_0xd4fc('0x6'),'script':path[_0xd4fc('0x3')](__dirname,_0xd4fc('0x7')),'env':env},{'name':'ami','script':path[_0xd4fc('0x3')](__dirname,_0xd4fc('0x8')),'env':env},{'name':_0xd4fc('0x9'),'script':path[_0xd4fc('0x3')](__dirname,_0xd4fc('0xa')),'env':env},{'name':_0xd4fc('0xb'),'script':path['join'](__dirname,_0xd4fc('0xc')),'env':env},{'name':_0xd4fc('0xd'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xd4fc('0xe'),'script':path[_0xd4fc('0x3')](__dirname,_0xd4fc('0xf')),'env':env}]};module[_0xd4fc('0x10')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7419a61..1569c0b 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 _0x3594=['list','describe','delete','dump','saved','pm2','connect','connected','start','then','disconnect','stop','restart'];(function(_0x5771a1,_0x3939ef){var _0x5a3ffe=function(_0x59bc39){while(--_0x59bc39){_0x5771a1['push'](_0x5771a1['shift']());}};_0x5a3ffe(++_0x3939ef);}(_0x3594,0x1d9));var _0x4359=function(_0x42fcfa,_0xc564b3){_0x42fcfa=_0x42fcfa-0x0;var _0x3e661c=_0x3594[_0x42fcfa];return _0x3e661c;};'use strict';var pm2=require(_0x4359('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0xa6ac18,_0x4c09a0){return pm2[_0x4359('0x1')](function(_0x21fb99){if(_0x21fb99){return _0x4c09a0(_0x21fb99);}return _0xa6ac18(_0x4359('0x2'));});});};exports[_0x4359('0x3')]=function(_0x1e6e48){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x47e3f6,_0x23b3e1){return pm2[_0x4359('0x3')](_0x1e6e48,function(_0x84a0ce,_0x744d3){if(_0x84a0ce){return _0x23b3e1(_0x84a0ce);}pm2[_0x4359('0x5')]();return _0x47e3f6(_0x744d3);});});});};exports[_0x4359('0x6')]=function(_0x2b73ae){return connect()['then'](function(){return new BPromise(function(_0xc3ed42,_0xbc4964){return pm2[_0x4359('0x6')](_0x2b73ae,function(_0x497a37,_0x119260){if(_0x497a37){return _0xbc4964(_0x497a37);}pm2['disconnect']();return _0xc3ed42(_0x119260);});});});};exports[_0x4359('0x7')]=function(_0x502916){return connect()['then'](function(){return new BPromise(function(_0x44fad3,_0x4afa23){return pm2[_0x4359('0x7')](_0x502916,function(_0x12a42d,_0xbed3d1){if(_0x12a42d){return _0x4afa23(_0x12a42d);}pm2[_0x4359('0x5')]();return _0x44fad3(_0xbed3d1);});});});};exports[_0x4359('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x512cc5,_0x3496d1){return pm2[_0x4359('0x8')](function(_0x45e0c8,_0x50f317){if(_0x45e0c8){return _0x3496d1(_0x45e0c8);}pm2[_0x4359('0x5')]();return _0x512cc5(_0x50f317);});});});};exports[_0x4359('0x9')]=function(_0x5bbd98){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x262c95,_0x452644){return pm2[_0x4359('0x9')](_0x5bbd98,function(_0x3cfb55,_0x4e9139){if(_0x3cfb55){return _0x452644(_0x3cfb55);}pm2[_0x4359('0x5')]();return _0x262c95(_0x4e9139);});});});};exports[_0x4359('0xa')]=function(_0x3e6aad){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x4b6eda,_0x2cb8dd){return pm2['delete'](_0x3e6aad,function(_0x41f909,_0x47870d){if(_0x41f909){return _0x2cb8dd(_0x41f909);}pm2[_0x4359('0x5')]();return _0x4b6eda(_0x47870d);});});});};exports[_0x4359('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3e3d3e,_0x319f69){return pm2['dump'](function(_0x135ff8){if(_0x135ff8){return _0x319f69(_0x135ff8);}return _0x3e3d3e(_0x4359('0xc'));});});});}; \ No newline at end of file +var _0x882a=['connect','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config'];(function(_0x343fb3,_0x1ff7fe){var _0x320496=function(_0xf680ff){while(--_0xf680ff){_0x343fb3['push'](_0x343fb3['shift']());}};_0x320496(++_0x1ff7fe);}(_0x882a,0x10f));var _0xa882=function(_0xd630f3,_0x2adf93){_0xd630f3=_0xd630f3-0x0;var _0x1c63b5=_0x882a[_0xd630f3];return _0x1c63b5;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa882('0x0'));var config=require(_0xa882('0x1'));function connect(){return new BPromise(function(_0x4887ad,_0x4346b4){return pm2[_0xa882('0x2')](function(_0x55a412){if(_0x55a412){return _0x4346b4(_0x55a412);}return _0x4887ad('connected');});});};exports[_0xa882('0x3')]=function(_0xc309a0){return connect()[_0xa882('0x4')](function(){return new BPromise(function(_0x25d617,_0x39296d){return pm2[_0xa882('0x3')](_0xc309a0,function(_0x4d38f0,_0x2e2b75){if(_0x4d38f0){return _0x39296d(_0x4d38f0);}pm2[_0xa882('0x5')]();return _0x25d617(_0x2e2b75);});});});};exports[_0xa882('0x6')]=function(_0x343cef){return connect()[_0xa882('0x4')](function(){return new BPromise(function(_0x1b7370,_0x351145){return pm2[_0xa882('0x6')](_0x343cef,function(_0x56f11e,_0x2a87e3){if(_0x56f11e){return _0x351145(_0x56f11e);}pm2[_0xa882('0x5')]();return _0x1b7370(_0x2a87e3);});});});};exports[_0xa882('0x7')]=function(_0x53beb7){return connect()['then'](function(){return new BPromise(function(_0x50cb5e,_0x2a3383){return pm2[_0xa882('0x7')](_0x53beb7,function(_0x46a7c6,_0x3fbbc8){if(_0x46a7c6){return _0x2a3383(_0x46a7c6);}pm2['disconnect']();return _0x50cb5e(_0x3fbbc8);});});});};exports[_0xa882('0x8')]=function(){return connect()[_0xa882('0x4')](function(){return new BPromise(function(_0x5624dc,_0x537d5e){return pm2[_0xa882('0x8')](function(_0x222e31,_0xa949cc){if(_0x222e31){return _0x537d5e(_0x222e31);}pm2[_0xa882('0x5')]();return _0x5624dc(_0xa949cc);});});});};exports[_0xa882('0x9')]=function(_0x2c34a8){return connect()[_0xa882('0x4')](function(){return new BPromise(function(_0x595545,_0x669418){return pm2[_0xa882('0x9')](_0x2c34a8,function(_0x5d9c42,_0x550b14){if(_0x5d9c42){return _0x669418(_0x5d9c42);}pm2['disconnect']();return _0x595545(_0x550b14);});});});};exports['delete']=function(_0x38fe8d){return connect()['then'](function(){return new BPromise(function(_0x23f8dd,_0x24c513){return pm2[_0xa882('0xa')](_0x38fe8d,function(_0x4170b6,_0x347ad7){if(_0x4170b6){return _0x24c513(_0x4170b6);}pm2[_0xa882('0x5')]();return _0x23f8dd(_0x347ad7);});});});};exports[_0xa882('0xb')]=function(){return connect()[_0xa882('0x4')](function(){return new BPromise(function(_0x725d56,_0x5494a8){return pm2[_0xa882('0xb')](function(_0x1511c1){if(_0x1511c1){return _0x5494a8(_0x1511c1);}return _0x725d56(_0xa882('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index e071066..08fb58d 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 _0x08c4=['start','lodash','moment','ioredis','util','../logger','redis','defaults','Setting','find','chatTimeout','ChatInteraction','findAll','subtract','then','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0x08c4,0x106));var _0x408c=function(_0x4bcdb4,_0xc52fa9){_0x4bcdb4=_0x4bcdb4-0x0;var _0x4eb83c=_0x08c4[_0x4bcdb4];return _0x4eb83c;};'use strict';var _=require(_0x408c('0x0'));var moment=require(_0x408c('0x1'));var Redis=require(_0x408c('0x2'));var util=require(_0x408c('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x408c('0x4'))('schedule');config[_0x408c('0x5')]=_[_0x408c('0x6')](config[_0x408c('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x408c('0x5')]));function closeInteractions(){var _0x2db5c3=0x0;var _0x3224b6=[];return db[_0x408c('0x7')][_0x408c('0x8')]({'raw':!![],'attributes':['id',_0x408c('0x9')],'where':{'id':0x1}})['then'](function(_0x15aeca){_0x2db5c3=_0x15aeca[_0x408c('0x9')];if(_0x2db5c3){return db[_0x408c('0xa')][_0x408c('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x408c('0xc')](_0x15aeca[_0x408c('0x9')],'minutes')}}});}else{return[];}})[_0x408c('0xd')](function(_0x491727){if(_0x491727&&_0x491727[_0x408c('0xe')]){_0x3224b6=_[_0x408c('0xf')](_0x491727||[],'id');logger[_0x408c('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3224b6[_0x408c('0x11')]());return db[_0x408c('0xa')][_0x408c('0x12')]({'closeReason':_0x408c('0x13'),'disposition':_0x408c('0x14'),'closed':!![],'closedAt':moment()[_0x408c('0x15')](_0x408c('0x16'))},{'where':{'id':_0x3224b6}});}})['then'](function(){if(_0x3224b6&&_0x3224b6[_0x408c('0xe')]){logger[_0x408c('0x10')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3224b6[_0x408c('0x11')]());for(var _0x533e17=0x0;_0x533e17<_0x3224b6['length'];_0x533e17++){io[_0x408c('0x17')](_0x408c('0x18'),{'id':_0x3224b6[_0x533e17],'closed':!![]});}}})[_0x408c('0x19')](function(_0x420536){logger[_0x408c('0x1a')](_0x408c('0x1b'),_0x420536?util['inspect'](_0x420536,{'showHidden':![],'depth':null}):'');});}exports[_0x408c('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0c16=['system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','inspect','lodash','moment','util','../../mysqldb','../logger','schedule','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0c16,0xb1));var _0x60c1=function(_0x5532e1,_0x388cd1){_0x5532e1=_0x5532e1-0x0;var _0x276bb5=_0x0c16[_0x5532e1];return _0x276bb5;};'use strict';var _=require(_0x60c1('0x0'));var moment=require(_0x60c1('0x1'));var Redis=require('ioredis');var util=require(_0x60c1('0x2'));var config=require('../../config/environment');var db=require(_0x60c1('0x3'))['db'];var logger=require(_0x60c1('0x4'))(_0x60c1('0x5'));config['redis']=_[_0x60c1('0x6')](config['redis'],{'host':_0x60c1('0x7'),'port':0x18eb});var io=require(_0x60c1('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x1c1048=0x0;var _0x16030f=[];return db[_0x60c1('0x9')]['find']({'raw':!![],'attributes':['id',_0x60c1('0xa')],'where':{'id':0x1}})[_0x60c1('0xb')](function(_0x419642){_0x1c1048=_0x419642[_0x60c1('0xa')];if(_0x1c1048){return db[_0x60c1('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x60c1('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x419642[_0x60c1('0xa')],_0x60c1('0xe'))}}});}else{return[];}})[_0x60c1('0xb')](function(_0x379a0f){if(_0x379a0f&&_0x379a0f[_0x60c1('0xf')]){_0x16030f=_['map'](_0x379a0f||[],'id');logger['info'](_0x60c1('0x10'),_0x16030f[_0x60c1('0x11')]());return db[_0x60c1('0xc')][_0x60c1('0x12')]({'closeReason':_0x60c1('0x13'),'disposition':_0x60c1('0x14'),'closed':!![],'closedAt':moment()['format'](_0x60c1('0x15'))},{'where':{'id':_0x16030f}});}})['then'](function(){if(_0x16030f&&_0x16030f[_0x60c1('0xf')]){logger[_0x60c1('0x16')](_0x60c1('0x17'),_0x16030f[_0x60c1('0x11')]());for(var _0x29285d=0x0;_0x29285d<_0x16030f[_0x60c1('0xf')];_0x29285d++){io['emit'](_0x60c1('0x18'),{'id':_0x16030f[_0x29285d],'closed':!![]});}}})[_0x60c1('0x19')](function(_0x9ac925){logger[_0x60c1('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0x9ac925?util[_0x60c1('0x1b')](_0x9ac925,{'showHidden':![],'depth':null}):'');});}exports['start']=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 3ec687c..8915c09 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 _0x4e14=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x213128,_0x19760d){var _0x46bd40=function(_0xd4e4d){while(--_0xd4e4d){_0x213128['push'](_0x213128['shift']());}};_0x46bd40(++_0x19760d);}(_0x4e14,0x1a3));var _0x44e1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x4e14[_0x29d94e];return _0x106237;};'use strict';function start(){var _0x5b5158=require(_0x44e1('0x0'));return _0x5b5158[_0x44e1('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xedf9=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x48ae62,_0x3cfce7){var _0x2634a6=function(_0x17b9c7){while(--_0x17b9c7){_0x48ae62['push'](_0x48ae62['shift']());}};_0x2634a6(++_0x3cfce7);}(_0xedf9,0x1c1));var _0x9edf=function(_0x1ecd12,_0x5826dd){_0x1ecd12=_0x1ecd12-0x0;var _0x348b09=_0xedf9[_0x1ecd12];return _0x348b09;};'use strict';function start(){var _0x5c3d2b=require(_0x9edf('0x0'));return _0x5c3d2b[_0x9edf('0x1')]();}module[_0x9edf('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 1bea613..6df77db 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 _0x4764=['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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','keyBy','difference','intersection','exists','stop','deleteJob','toRun','resolve','run\x20job','cron','active','endAt','add','start','add\x20cron','stop\x20cron','length','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','join','existsSync','status','message','attachments'];(function(_0x5e1ee2,_0x5bfd9e){var _0x3b2474=function(_0x22526e){while(--_0x22526e){_0x5e1ee2['push'](_0x5e1ee2['shift']());}};_0x3b2474(++_0x5bfd9e);}(_0x4764,0x7f));var _0x4476=function(_0x2f746b,_0x2da6b9){_0x2f746b=_0x2f746b-0x0;var _0x56e063=_0x4764[_0x2f746b];return _0x56e063;};'use strict';var fs=require('fs');var util=require(_0x4476('0x0'));var path=require(_0x4476('0x1'));var _=require(_0x4476('0x2'));var moment=require(_0x4476('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x4476('0x4'));var BPromise=require(_0x4476('0x5'));var logger=require(_0x4476('0x6'))(_0x4476('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x4476('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x4476('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5835f1,_0x23c754){return function(){logger[_0x4476('0xa')](_0x4476('0xb'),_0x5835f1[_0x4476('0xc')]);var _0x507afb=!![];var _0x413f65=_0x5835f1['MailAccount'][_0x4476('0xd')]();var _0x376b8b={'account':_0x413f65,'message':{'from':util[_0x4476('0xe')](_0x4476('0xf'),_0x5835f1[_0x4476('0x10')][_0x4476('0x11')],_0x5835f1[_0x4476('0x10')][_0x4476('0xc')]||_0x5835f1[_0x4476('0x10')][_0x4476('0x12')][_0x4476('0x13')]),'to':_0x5835f1[_0x4476('0xc')],'cc':_0x5835f1['cc'],'bcc':_0x5835f1[_0x4476('0x14')],'subject':util[_0x4476('0xe')](_0x4476('0x15'),_0x23c754[_0x4476('0x11')],_0x5835f1['subtractNumber'],_0x5835f1[_0x4476('0x16')])}};var _0x326463=path['join'](__dirname,_0x4476('0x17'));var _0x267d73=_0x23c754[_0x4476('0x18')];var _0x3b6000=util[_0x4476('0xe')](_0x4476('0x19'),path[_0x4476('0x1a')](_0x23c754[_0x4476('0x18')],path[_0x4476('0x1b')](_0x23c754[_0x4476('0x18')])),'zip');var _0x5dcbb0=path[_0x4476('0x1c')](_0x326463,_0x267d73);var _0x511024=path[_0x4476('0x1c')](_0x326463,_0x3b6000);if(fs[_0x4476('0x1d')](_0x5dcbb0)){_0x23c754[_0x4476('0x1e')]='Sent';_0x376b8b[_0x4476('0x1f')][_0x4476('0x20')]=[{'filename':_0x267d73,'path':_0x5dcbb0}];_0x376b8b['message'][_0x4476('0x21')]=util['format'](_0x4476('0x22'),JSON[_0x4476('0x23')](_0x23c754,null,0x2));}else if(fs[_0x4476('0x1d')](_0x511024)){_0x23c754[_0x4476('0x1e')]=_0x4476('0x24');_0x376b8b['message'][_0x4476('0x20')]=[{'filename':_0x3b6000,'path':_0x511024}];}else{_0x376b8b[_0x4476('0x1f')]['text']=_0x4476('0x25');if(!_0x5835f1['sendIfEmpty']){_0x507afb=![];logger[_0x4476('0xa')](_0x4476('0x26'));}}if(_0x507afb){return client['request']('SendMail',_0x376b8b)[_0x4476('0x27')](function(_0x454363){if(_0x454363[_0x4476('0x28')]){return logger['error'](_0x4476('0x29'),JSON['stringify'](_0x454363));}return logger[_0x4476('0xa')](_0x4476('0x2a'));})[_0x4476('0x2b')](function(_0x49c6b8){return logger[_0x4476('0x28')](_0x4476('0x29'),JSON[_0x4476('0x23')](_0x49c6b8));});}};}function handleError(){return function(_0x2b98fd){return logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x2b98fd));};}function handleResult(_0x5cd779){return function(_0x194a35){logger[_0x4476('0xa')](_0x4476('0x2c'),JSON[_0x4476('0x23')](_0x194a35));if(_0x5cd779['MailAccount']&&_0x5cd779[_0x4476('0x10')][_0x4476('0x12')]&&!_[_0x4476('0x2d')](_0x5cd779[_0x4476('0xc')])){setTimeout(handleSendEmail(_0x5cd779,_0x194a35),0x3c*0x3e8);}};}function handleJob(_0x1ebcc8){return function(){try{if(_[_0x4476('0x2d')](_0x1ebcc8[_0x4476('0x2e')])){return logger['info'](_0x4476('0x2f'));}if(_[_0x4476('0x2d')](_0x1ebcc8['subtractUnit'])){return logger[_0x4476('0xa')](_0x4476('0x30'));}var _0x528808={'startDate':moment()[_0x4476('0x31')](_0x1ebcc8[_0x4476('0x2e')],_0x1ebcc8[_0x4476('0x16')])[_0x4476('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x4476('0xe')](_0x4476('0x32')),'type':_0x4476('0x33'),'output':_0x1ebcc8['output'],'name':_0x1ebcc8[_0x4476('0x11')]};if(!_[_0x4476('0x2d')](_0x1ebcc8['DefaultReportId'])){logger[_0x4476('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x1ebcc8['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x1ebcc8['DefaultReportId']},_0x528808)[_0x4476('0x27')](handleResult(_0x1ebcc8))[_0x4476('0x2b')](handleError());}if(!_[_0x4476('0x2d')](_0x1ebcc8[_0x4476('0x34')])){logger[_0x4476('0xa')](_0x4476('0x35'),_0x1ebcc8[_0x4476('0x34')]);return analyticCustomReportController['runReport']({'id':_0x1ebcc8[_0x4476('0x34')]},_0x528808)[_0x4476('0x27')](handleResult(_0x1ebcc8))['catch'](handleError());}}catch(_0x38add7){logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x38add7));}return logger[_0x4476('0xa')](_0x4476('0x36'));};}function getJobs(_0x28ffbf){var _0x1cdf4a={};if(_0x28ffbf){_0x1cdf4a['id']=_0x28ffbf;}return db[_0x4476('0x37')][_0x4476('0x38')]({'where':_0x1cdf4a,'include':[{'model':db['MailAccount'],'attributes':['id',_0x4476('0x11'),_0x4476('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x4476('0x12'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x4476('0x27')](function(_0x495743){var _0x58456a=_[_0x4476('0x39')](manager[_0x4476('0x3a')]);var _0x4c3293=_['map'](_0x495743,function(_0x144c4d){return _0x144c4d['id'][_0x4476('0x3b')]();});var _0x550355=_[_0x4476('0x3c')](_0x495743,function(_0x506049){return _0x506049['id'][_0x4476('0x3b')]();});var _0xc23a74=_0x28ffbf?_0x4c3293:_[_0x4476('0x3d')](_0x4c3293,_0x58456a);var _0xa2b247=_[_0x4476('0x3e')](_0x4c3293,_0x58456a);var _0x72df4c=_['difference'](_0x58456a,_0x4c3293);var _0x50fcbb;var _0x7be98d;for(_0x50fcbb=0x0;_0x50fcbb<_0x72df4c['length']&&!_0x28ffbf;_0x50fcbb+=0x1){_0x7be98d=_0x72df4c[_0x50fcbb][_0x4476('0x3b')]();if(manager[_0x4476('0x3f')](_0x7be98d)){manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger['info']('delete\x20cron',_0x7be98d);}}logger['info'](_0x4476('0x42'),JSON[_0x4476('0x23')](_0xc23a74));for(_0x50fcbb=0x0;_0x50fcbb<_0xc23a74['length'];_0x50fcbb+=0x1){_0x7be98d=_0xc23a74[_0x50fcbb]['toString']();logger[_0x4476('0xa')]('index',_0x7be98d);if(_0x28ffbf){logger[_0x4476('0xa')]('my\x20id',_0x28ffbf);logger['info'](JSON['stringify'](_0x550355[_0x7be98d]));BPromise[_0x4476('0x43')]()[_0x4476('0x27')](handleJob(_0x550355[_0x7be98d]));logger['info'](_0x4476('0x44'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}else if(_0x550355[_0x7be98d]['cron']&&_0x550355[_0x7be98d][_0x4476('0x46')]&&moment()['isBetween'](_0x550355[_0x7be98d]['startAt'],_0x550355[_0x7be98d][_0x4476('0x47')])){manager[_0x4476('0x48')](_0x7be98d,_0x550355[_0x7be98d][_0x4476('0x45')],handleJob(_0x550355[_0x7be98d]));manager[_0x4476('0x49')](_0x7be98d);logger[_0x4476('0xa')](_0x4476('0x4a'),_0x550355[_0x7be98d]['name'],_0x550355[_0x7be98d]['cron']);}else if(manager['exists'](_0x7be98d)){manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger[_0x4476('0xa')](_0x4476('0x4b'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}}for(_0x50fcbb=0x0,_0x7be98d;_0x50fcbb<_0xa2b247[_0x4476('0x4c')]&&!_0x28ffbf;_0x50fcbb+=0x1){_0x7be98d=_0xa2b247[_0x50fcbb][_0x4476('0x3b')]();if(manager['exists'](_0x7be98d)){if(_0x550355[_0x7be98d][_0x4476('0x45')]&&_0x550355[_0x7be98d]['active']&&moment()['isBetween'](_0x550355[_0x7be98d]['startAt'],_0x550355[_0x7be98d][_0x4476('0x47')])){manager[_0x4476('0x4d')](_0x7be98d,_0x550355[_0x7be98d]['cron'],handleJob(_0x550355[_0x7be98d]));logger[_0x4476('0xa')](_0x4476('0x4e'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d]['cron']);}else{manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger['info']('stop\x20cron',_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}}}})[_0x4476('0x2b')](function(_0x2132f0){logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x2132f0));});}exports[_0x4476('0x4f')]=function(_0x4ec631){return getJobs(_0x4ec631);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xdec7=['exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','length','exists','stop','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','basename','existsSync','status','Sent','message','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId'];(function(_0x58f8d6,_0x3de6e9){var _0x249399=function(_0x5a2d88){while(--_0x5a2d88){_0x58f8d6['push'](_0x58f8d6['shift']());}};_0x249399(++_0x3de6e9);}(_0xdec7,0xbb));var _0x7dec=function(_0x416b63,_0x23bb95){_0x416b63=_0x416b63-0x0;var _0x99aacf=_0xdec7[_0x416b63];return _0x99aacf;};'use strict';var fs=require('fs');var util=require(_0x7dec('0x0'));var path=require('path');var _=require(_0x7dec('0x1'));var moment=require(_0x7dec('0x2'));var CronJobManager=require(_0x7dec('0x3'));var jayson=require(_0x7dec('0x4'));var BPromise=require(_0x7dec('0x5'));var logger=require('../logger')(_0x7dec('0x6'));var db=require(_0x7dec('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7dec('0x8'));var client=jayson[_0x7dec('0x9')][_0x7dec('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x160bf6,_0x51592b){return function(){logger[_0x7dec('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x160bf6[_0x7dec('0xc')]);var _0x30fcd7=!![];var _0x10ea0c=_0x160bf6['MailAccount']['getSmtpOptions']();var _0xc5011={'account':_0x10ea0c,'message':{'from':util[_0x7dec('0xd')](_0x7dec('0xe'),_0x160bf6[_0x7dec('0xf')][_0x7dec('0x10')],_0x160bf6[_0x7dec('0xf')]['email']||_0x160bf6[_0x7dec('0xf')][_0x7dec('0x11')][_0x7dec('0x12')]),'to':_0x160bf6[_0x7dec('0xc')],'cc':_0x160bf6['cc'],'bcc':_0x160bf6[_0x7dec('0x13')],'subject':util[_0x7dec('0xd')](_0x7dec('0x14'),_0x51592b['name'],_0x160bf6['subtractNumber'],_0x160bf6[_0x7dec('0x15')])}};var _0x46593f=path[_0x7dec('0x16')](__dirname,_0x7dec('0x17'));var _0x55b119=_0x51592b[_0x7dec('0x18')];var _0x47a9f3=util[_0x7dec('0xd')]('%s.%s',path[_0x7dec('0x19')](_0x51592b[_0x7dec('0x18')],path['extname'](_0x51592b[_0x7dec('0x18')])),'zip');var _0x2d7214=path[_0x7dec('0x16')](_0x46593f,_0x55b119);var _0x3968a1=path[_0x7dec('0x16')](_0x46593f,_0x47a9f3);if(fs[_0x7dec('0x1a')](_0x2d7214)){_0x51592b[_0x7dec('0x1b')]=_0x7dec('0x1c');_0xc5011[_0x7dec('0x1d')][_0x7dec('0x1e')]=[{'filename':_0x55b119,'path':_0x2d7214}];_0xc5011[_0x7dec('0x1d')][_0x7dec('0x1f')]=util[_0x7dec('0xd')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x51592b,null,0x2));}else if(fs['existsSync'](_0x3968a1)){_0x51592b[_0x7dec('0x1b')]=_0x7dec('0x1c');_0xc5011[_0x7dec('0x1d')]['attachments']=[{'filename':_0x47a9f3,'path':_0x3968a1}];}else{_0xc5011[_0x7dec('0x1d')][_0x7dec('0x1f')]=_0x7dec('0x20');if(!_0x160bf6[_0x7dec('0x21')]){_0x30fcd7=![];logger[_0x7dec('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x30fcd7){return client[_0x7dec('0x22')](_0x7dec('0x23'),_0xc5011)[_0x7dec('0x24')](function(_0x68d943){if(_0x68d943[_0x7dec('0x25')]){return logger[_0x7dec('0x25')](_0x7dec('0x26'),JSON[_0x7dec('0x27')](_0x68d943));}return logger['info']('email\x20sent');})[_0x7dec('0x28')](function(_0x227d29){return logger[_0x7dec('0x25')](_0x7dec('0x26'),JSON[_0x7dec('0x27')](_0x227d29));});}};}function handleError(){return function(_0x314907){return logger[_0x7dec('0x25')](JSON[_0x7dec('0x27')](_0x314907));};}function handleResult(_0x2aaf00){return function(_0x238bc6){logger['info'](_0x7dec('0x29'),JSON[_0x7dec('0x27')](_0x238bc6));if(_0x2aaf00[_0x7dec('0xf')]&&_0x2aaf00['MailAccount'][_0x7dec('0x11')]&&!_['isNil'](_0x2aaf00[_0x7dec('0xc')])){setTimeout(handleSendEmail(_0x2aaf00,_0x238bc6),0x3c*0x3e8);}};}function handleJob(_0x4bfb01){return function(){try{if(_[_0x7dec('0x2a')](_0x4bfb01['subtractNumber'])){return logger[_0x7dec('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7dec('0x2a')](_0x4bfb01[_0x7dec('0x15')])){return logger['info'](_0x7dec('0x2b'));}var _0x366b4b={'startDate':moment()[_0x7dec('0x2c')](_0x4bfb01['subtractNumber'],_0x4bfb01[_0x7dec('0x15')])[_0x7dec('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x7dec('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x4bfb01[_0x7dec('0x2d')],'name':_0x4bfb01['name']};if(!_[_0x7dec('0x2a')](_0x4bfb01[_0x7dec('0x2e')])){logger[_0x7dec('0xb')](_0x7dec('0x2f'),_0x4bfb01[_0x7dec('0x2e')]);return analyticDefaultReportController[_0x7dec('0x30')]({'id':_0x4bfb01[_0x7dec('0x2e')]},_0x366b4b)[_0x7dec('0x24')](handleResult(_0x4bfb01))[_0x7dec('0x28')](handleError());}if(!_[_0x7dec('0x2a')](_0x4bfb01[_0x7dec('0x31')])){logger['info'](_0x7dec('0x32'),_0x4bfb01[_0x7dec('0x31')]);return analyticCustomReportController[_0x7dec('0x30')]({'id':_0x4bfb01['CustomReportId']},_0x366b4b)[_0x7dec('0x24')](handleResult(_0x4bfb01))[_0x7dec('0x28')](handleError());}}catch(_0xcf3e4f){logger['error'](JSON[_0x7dec('0x27')](_0xcf3e4f));}return logger['info'](_0x7dec('0x33'));};}function getJobs(_0x278608){var _0x36a076={};if(_0x278608){_0x36a076['id']=_0x278608;}return db[_0x7dec('0x34')][_0x7dec('0x35')]({'where':_0x36a076,'include':[{'model':db[_0x7dec('0xf')],'attributes':['id',_0x7dec('0x10'),_0x7dec('0xc')],'include':[{'model':db[_0x7dec('0x36')],'as':_0x7dec('0x11'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x7dec('0x24')](function(_0x2fe4ee){var _0x29c297=_[_0x7dec('0x37')](manager['jobs']);var _0x4c66b7=_[_0x7dec('0x38')](_0x2fe4ee,function(_0x233ef8){return _0x233ef8['id'][_0x7dec('0x39')]();});var _0x1710d0=_[_0x7dec('0x3a')](_0x2fe4ee,function(_0x56fb9e){return _0x56fb9e['id'][_0x7dec('0x39')]();});var _0x46d739=_0x278608?_0x4c66b7:_[_0x7dec('0x3b')](_0x4c66b7,_0x29c297);var _0x414769=_['intersection'](_0x4c66b7,_0x29c297);var _0x54bc9f=_[_0x7dec('0x3b')](_0x29c297,_0x4c66b7);var _0x5e8b6c;var _0x4b3cde;for(_0x5e8b6c=0x0;_0x5e8b6c<_0x54bc9f[_0x7dec('0x3c')]&&!_0x278608;_0x5e8b6c+=0x1){_0x4b3cde=_0x54bc9f[_0x5e8b6c][_0x7dec('0x39')]();if(manager[_0x7dec('0x3d')](_0x4b3cde)){manager[_0x7dec('0x3e')](_0x4b3cde);manager['deleteJob'](_0x4b3cde);logger[_0x7dec('0xb')]('delete\x20cron',_0x4b3cde);}}logger[_0x7dec('0xb')](_0x7dec('0x3f'),JSON[_0x7dec('0x27')](_0x46d739));for(_0x5e8b6c=0x0;_0x5e8b6c<_0x46d739[_0x7dec('0x3c')];_0x5e8b6c+=0x1){_0x4b3cde=_0x46d739[_0x5e8b6c][_0x7dec('0x39')]();logger[_0x7dec('0xb')](_0x7dec('0x40'),_0x4b3cde);if(_0x278608){logger[_0x7dec('0xb')]('my\x20id',_0x278608);logger[_0x7dec('0xb')](JSON[_0x7dec('0x27')](_0x1710d0[_0x4b3cde]));BPromise[_0x7dec('0x41')]()[_0x7dec('0x24')](handleJob(_0x1710d0[_0x4b3cde]));logger['info'](_0x7dec('0x42'),_0x1710d0[_0x4b3cde][_0x7dec('0x10')],_0x1710d0[_0x4b3cde][_0x7dec('0x43')]);}else if(_0x1710d0[_0x4b3cde]['cron']&&_0x1710d0[_0x4b3cde][_0x7dec('0x44')]&&moment()[_0x7dec('0x45')](_0x1710d0[_0x4b3cde][_0x7dec('0x46')],_0x1710d0[_0x4b3cde][_0x7dec('0x47')])){manager[_0x7dec('0x48')](_0x4b3cde,_0x1710d0[_0x4b3cde][_0x7dec('0x43')],handleJob(_0x1710d0[_0x4b3cde]));manager[_0x7dec('0x49')](_0x4b3cde);logger['info'](_0x7dec('0x4a'),_0x1710d0[_0x4b3cde][_0x7dec('0x10')],_0x1710d0[_0x4b3cde][_0x7dec('0x43')]);}else if(manager[_0x7dec('0x3d')](_0x4b3cde)){manager[_0x7dec('0x3e')](_0x4b3cde);manager[_0x7dec('0x4b')](_0x4b3cde);logger[_0x7dec('0xb')](_0x7dec('0x4c'),_0x1710d0[_0x4b3cde][_0x7dec('0x10')],_0x1710d0[_0x4b3cde][_0x7dec('0x43')]);}}for(_0x5e8b6c=0x0,_0x4b3cde;_0x5e8b6c<_0x414769[_0x7dec('0x3c')]&&!_0x278608;_0x5e8b6c+=0x1){_0x4b3cde=_0x414769[_0x5e8b6c][_0x7dec('0x39')]();if(manager[_0x7dec('0x3d')](_0x4b3cde)){if(_0x1710d0[_0x4b3cde][_0x7dec('0x43')]&&_0x1710d0[_0x4b3cde][_0x7dec('0x44')]&&moment()[_0x7dec('0x45')](_0x1710d0[_0x4b3cde][_0x7dec('0x46')],_0x1710d0[_0x4b3cde][_0x7dec('0x47')])){manager['update'](_0x4b3cde,_0x1710d0[_0x4b3cde][_0x7dec('0x43')],handleJob(_0x1710d0[_0x4b3cde]));logger['info'](_0x7dec('0x4d'),_0x1710d0[_0x4b3cde]['name'],_0x1710d0[_0x4b3cde]['cron']);}else{manager[_0x7dec('0x3e')](_0x4b3cde);manager['deleteJob'](_0x4b3cde);logger[_0x7dec('0xb')](_0x7dec('0x4c'),_0x1710d0[_0x4b3cde][_0x7dec('0x10')],_0x1710d0[_0x4b3cde]['cron']);}}}})[_0x7dec('0x28')](function(_0x58934c){logger['error'](JSON[_0x7dec('0x27')](_0x58934c));});}exports[_0x7dec('0x4e')]=function(_0x4e196c){return getJobs(_0x4e196c);};exports[_0x7dec('0x49')]=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 b4a18a0..f54659e 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 _0x566f=['lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion','then','format','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','CloudProvider','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start'];(function(_0x288936,_0x36b619){var _0x1c7a30=function(_0x493ecf){while(--_0x493ecf){_0x288936['push'](_0x288936['shift']());}};_0x1c7a30(++_0x36b619);}(_0x566f,0x124));var _0xf566=function(_0x513795,_0x1de034){_0x513795=_0x513795-0x0;var _0xd484e=_0x566f[_0x513795];return _0xd484e;};var _=require(_0xf566('0x0'));var AWS=require(_0xf566('0x1'));var rp=require(_0xf566('0x2'));var util=require(_0xf566('0x3'));var BPromise=require(_0xf566('0x4'));var db=require(_0xf566('0x5'))['db'];var logger=require(_0xf566('0x6'))(_0xf566('0x7'));function getTranscriptionJob(_0x5eef34,_0xae69b5,_0x41a6be,_0x1a6dbc){return new Promise(function(_0x117398,_0x5898ea){var _0xacfc48=new AWS[(_0xf566('0x8'))]({'accessKeyId':_0xae69b5,'secretAccessKey':_0x5eef34,'region':_0x41a6be});_0xacfc48[_0xf566('0x9')]({'TranscriptionJobName':_0x1a6dbc},function(_0x1e33fa,_0x588e82){if(_0x1e33fa){return _0x5898ea(_0x1e33fa);}else{return _0x117398(_0x588e82);}});});}function sentiment(_0x2dd9f6,_0x5bf147,_0x112610,_0x18c2cc,_0x20c0bd){return new Promise(function(_0x357b9e,_0x537530){var _0x26ab55=new AWS[(_0xf566('0xa'))]({'accessKeyId':_0x5bf147,'secretAccessKey':_0x2dd9f6,'region':_0x112610});_0x26ab55[_0xf566('0xb')]({'Text':_0x18c2cc,'LanguageCode':_0x20c0bd[_0xf566('0xc')](0x0,0x2)},function(_0x3efa0d,_0x19408f){if(_0x3efa0d){return _0x537530(_0x3efa0d);}else{return _0x357b9e(_0x19408f);}});});}function checkTranscribeJob(_0x4aec5b,_0x3f15a6,_0x5d6937){var _0x1c1e09;return new BPromise(function(_0x272691,_0x1ed8ab){logger[_0xf566('0xd')](util['format'](_0xf566('0xe'),_0x4aec5b['id'],_0x4aec5b['transcribeName']));return getTranscriptionJob(_0x5d6937['data1'],_0x5d6937[_0xf566('0xf')],_0x3f15a6[_0xf566('0x10')],_0x4aec5b['transcribeName'])[_0xf566('0x11')](function(_0x312f10){logger['info'](util[_0xf566('0x12')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4aec5b['id'],_0x4aec5b[_0xf566('0x13')],_0x312f10['TranscriptionJob'][_0xf566('0x14')]));if(!_0x4aec5b[_0xf566('0x15')]){switch(_0x312f10['TranscriptionJob'][_0xf566('0x14')]){case _0xf566('0x16'):var _0x21b2d0={'transcribeStatus':_0x312f10[_0xf566('0x17')]['TranscriptionJobStatus'],'fileUri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')]};logger['info'](util[_0xf566('0x12')](_0xf566('0x1a'),_0x4aec5b['id']));return rp({'uri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')],'json':!![]})[_0xf566('0x11')](function(_0x2ff105){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x1b'),_0x4aec5b['id']));if(_0x2ff105&&_0x2ff105[_0xf566('0x1c')]&&_0x2ff105['results'][_0xf566('0x1d')]&&_0x2ff105[_0xf566('0x1c')]['transcripts'][_0xf566('0x1e')]){_0x21b2d0[_0xf566('0x15')]='';for(var _0x2e1b4f=0x0;_0x2e1b4f<_0x2ff105[_0xf566('0x1c')][_0xf566('0x1d')][_0xf566('0x1e')];_0x2e1b4f++){_0x21b2d0[_0xf566('0x15')]+=_0x2ff105['results']['transcripts'][_0x2e1b4f][_0xf566('0x1f')]+'';}}return _0x4aec5b[_0xf566('0x20')](_0x21b2d0);})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));if(!_0x4aec5b['tempSentiment']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6['sentiment']||!_0x3f15a6[_0xf566('0x25')]||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6[_0xf566('0x27')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21b2d0[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_settings[_0xf566('0x25')]}});}})['then'](function(_0x577d6a){if(!_0x577d6a){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x577d6a[_0xf566('0x2b')]||!_0x577d6a[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x577d6a;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09['data2'],_0x3f15a6[_0xf566('0x26')],_0x21b2d0[_0xf566('0x15')],_0x3f15a6[_0xf566('0x2d')]);})[_0xf566('0x11')](function(_0x477492){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x477492[_0xf566('0x2f')],'sPositive':_0x477492[_0xf566('0x30')][_0xf566('0x31')],'sNegative':_0x477492[_0xf566('0x30')][_0xf566('0x32')],'sMixed':_0x477492[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x477492[_0xf566('0x30')][_0xf566('0x34')]});})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});case _0xf566('0x35'):return _0x4aec5b['update']({'transcribeStatus':_0xf566('0x35'),'failureReason':_0x312f10['TranscriptionJob']['FailureReason']})['then'](function(){logger[_0xf566('0xd')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4aec5b['id']));_0x272691();});default:logger[_0xf566('0xd')](util['format'](_0xf566('0x36'),_0x4aec5b['id']));break;}}else{return BPromise['resolve']()[_0xf566('0x11')](function(){if(!_0x4aec5b['tempSentiment']){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6[_0xf566('0x37')]||!_0x3f15a6['sentimentAccountId']||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6['bucket']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4aec5b[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db[_0xf566('0x38')][_0xf566('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1444f5){if(!_0x1444f5){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x1444f5['data1']||!_0x1444f5[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x1444f5;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09[_0xf566('0xf')],_0x3f15a6['sentimentRegion'],_0x4aec5b['fileText'],_0x3f15a6['language']);})[_0xf566('0x11')](function(_0x393d51){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x393d51['Sentiment'],'sPositive':_0x393d51[_0xf566('0x30')]['Positive'],'sNegative':_0x393d51[_0xf566('0x30')]['Negative'],'sMixed':_0x393d51[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x393d51[_0xf566('0x30')]['Neutral'],'transcribeStatus':_0xf566('0x16')});})[_0xf566('0x11')](function(){logger['info'](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});}})[_0xf566('0x39')](function(_0x49c462){if(_0x49c462){if(!_0x49c462['name']||_0x49c462[_0xf566('0x3a')]!=='SequelizeValidationError'){logger[_0xf566('0x3b')](util['format'](_0xf566('0x3c'),_0x4aec5b['id']),util[_0xf566('0x3d')](_0x49c462,{'showHidden':![],'depth':null}));}}_0x272691();});});}function checkTranscribe(){var _0x53973a;var _0x31288d;var _0x4aa16f;return db[_0xf566('0x3e')][_0xf566('0x3f')]({'where':{'transcribeStatus':_0xf566('0x40')}})[_0xf566('0x11')](function(_0x5b731c){if(!_0x5b731c||!_0x5b731c[_0xf566('0x1e')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x41'));}_0x53973a=_0x5b731c;return db['Setting'][_0xf566('0x29')]({'where':{'id':0x1}});})[_0xf566('0x11')](function(_0x253736){if(!_0x253736){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x42'));}_0x31288d=_0x253736;if(!_0x31288d[_0xf566('0x7')]||!_0x31288d[_0xf566('0x43')]||!_0x31288d['transcribeRegion']||!_0x31288d[_0xf566('0x2d')]||!_0x31288d[_0xf566('0x27')]){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x44'));}return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_0x31288d['transcribeAccountId']}});})[_0xf566('0x11')](function(_0xb50a2){if(!_0xb50a2){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0xb50a2[_0xf566('0x2b')]||!_0xb50a2[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x4aa16f=_0xb50a2;var _0x6d24d3=[];_0x53973a['forEach'](function(_0x345530){_0x6d24d3[_0xf566('0x45')](checkTranscribeJob(_0x345530,_0x31288d,_0x4aa16f));});return BPromise[_0xf566('0x46')](_0x6d24d3);})[_0xf566('0x39')](function(_0x33f5ef){if(_0x33f5ef){if(!_0x33f5ef['name']||_0x33f5ef['name']!==_0xf566('0x47')){logger['error'](util['inspect'](_0x33f5ef,{'showHidden':![],'depth':null}));}}});}exports[_0xf566('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x19c3=['Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','resolve','Cloud\x20Provider\x20not\x20configured','Neutral','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','SequelizeValidationError','start','lodash','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket'];(function(_0x5bab8e,_0x5a9ed6){var _0x3e14ea=function(_0x3d5948){while(--_0x3d5948){_0x5bab8e['push'](_0x5bab8e['shift']());}};_0x3e14ea(++_0x5a9ed6);}(_0x19c3,0xf9));var _0x319c=function(_0x295a86,_0x4f350a){_0x295a86=_0x295a86-0x0;var _0x49b3aa=_0x19c3[_0x295a86];return _0x49b3aa;};var _=require(_0x319c('0x0'));var AWS=require('aws-sdk');var rp=require(_0x319c('0x1'));var util=require(_0x319c('0x2'));var BPromise=require('bluebird');var db=require(_0x319c('0x3'))['db'];var logger=require(_0x319c('0x4'))(_0x319c('0x5'));function getTranscriptionJob(_0x350517,_0x3a96b1,_0x290261,_0x4c35fe){return new Promise(function(_0x20f77e,_0x53a1de){var _0x2e38c4=new AWS[(_0x319c('0x6'))]({'accessKeyId':_0x3a96b1,'secretAccessKey':_0x350517,'region':_0x290261});_0x2e38c4[_0x319c('0x7')]({'TranscriptionJobName':_0x4c35fe},function(_0x306a4b,_0x3662ed){if(_0x306a4b){return _0x53a1de(_0x306a4b);}else{return _0x20f77e(_0x3662ed);}});});}function sentiment(_0x57e6c8,_0x160d2a,_0x1b7ffd,_0x3491c3,_0x462c4c){return new Promise(function(_0x475438,_0x3cb3ff){var _0x4911e3=new AWS[(_0x319c('0x8'))]({'accessKeyId':_0x160d2a,'secretAccessKey':_0x57e6c8,'region':_0x1b7ffd});_0x4911e3['detectSentiment']({'Text':_0x3491c3,'LanguageCode':_0x462c4c[_0x319c('0x9')](0x0,0x2)},function(_0x151ab5,_0x3adb44){if(_0x151ab5){return _0x3cb3ff(_0x151ab5);}else{return _0x475438(_0x3adb44);}});});}function checkTranscribeJob(_0x3c995c,_0x362f44,_0x3be537){var _0x401fdb;return new BPromise(function(_0x4b67ba,_0x494ec0){logger[_0x319c('0xa')](util[_0x319c('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3c995c['id'],_0x3c995c[_0x319c('0xc')]));return getTranscriptionJob(_0x3be537[_0x319c('0xd')],_0x3be537[_0x319c('0xe')],_0x362f44[_0x319c('0xf')],_0x3c995c[_0x319c('0xc')])[_0x319c('0x10')](function(_0x29b26c){logger['info'](util['format'](_0x319c('0x11'),_0x3c995c['id'],_0x3c995c[_0x319c('0xc')],_0x29b26c['TranscriptionJob'][_0x319c('0x12')]));if(!_0x3c995c['fileText']){switch(_0x29b26c[_0x319c('0x13')][_0x319c('0x12')]){case _0x319c('0x14'):var _0x347081={'transcribeStatus':_0x29b26c[_0x319c('0x13')][_0x319c('0x12')],'fileUri':_0x29b26c[_0x319c('0x13')]['Transcript'][_0x319c('0x15')]};logger[_0x319c('0xa')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x3c995c['id']));return rp({'uri':_0x29b26c[_0x319c('0x13')][_0x319c('0x16')][_0x319c('0x15')],'json':!![]})['then'](function(_0x3bc070){logger[_0x319c('0xa')](util[_0x319c('0xb')](_0x319c('0x17'),_0x3c995c['id']));if(_0x3bc070&&_0x3bc070[_0x319c('0x18')]&&_0x3bc070['results'][_0x319c('0x19')]&&_0x3bc070[_0x319c('0x18')][_0x319c('0x19')][_0x319c('0x1a')]){_0x347081[_0x319c('0x1b')]='';for(var _0x4a8ee8=0x0;_0x4a8ee8<_0x3bc070[_0x319c('0x18')]['transcripts'][_0x319c('0x1a')];_0x4a8ee8++){_0x347081[_0x319c('0x1b')]+=_0x3bc070['results'][_0x319c('0x19')][_0x4a8ee8]['transcript']+'';}}return _0x3c995c[_0x319c('0x1c')](_0x347081);})[_0x319c('0x10')](function(){logger[_0x319c('0xa')](util[_0x319c('0xb')](_0x319c('0x1d'),_0x3c995c['id']));if(!_0x3c995c[_0x319c('0x1e')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x21'));}if(!_0x362f44[_0x319c('0x22')]||!_0x362f44[_0x319c('0x23')]||!_0x362f44[_0x319c('0x24')]||!_0x362f44[_0x319c('0x25')]||!_0x362f44[_0x319c('0x26')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x27'));}if(!_0x347081[_0x319c('0x1b')]){throw new Error(_0x319c('0x28'));}if(_0x362f44['sentimentAccountId']===_0x3be537['id']){return _0x3be537;}else{return db[_0x319c('0x29')][_0x319c('0x2a')]({'where':{'id':_settings[_0x319c('0x23')]}});}})[_0x319c('0x10')](function(_0x570940){if(!_0x570940){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x2b'));}if(!_0x570940['data1']||!_0x570940[_0x319c('0xe')]){throw new db['Sequelize'][(_0x319c('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x401fdb=_0x570940;logger[_0x319c('0xa')](util[_0x319c('0xb')](_0x319c('0x2c'),_0x3c995c['id']));return sentiment(_0x401fdb['data1'],_0x401fdb[_0x319c('0xe')],_0x362f44[_0x319c('0x24')],_0x347081['fileText'],_0x362f44[_0x319c('0x25')]);})[_0x319c('0x10')](function(_0x2ed8c1){logger[_0x319c('0xa')](util[_0x319c('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3c995c['id']));return _0x3c995c[_0x319c('0x1c')]({'sentiment':_0x2ed8c1[_0x319c('0x2d')],'sPositive':_0x2ed8c1[_0x319c('0x2e')][_0x319c('0x2f')],'sNegative':_0x2ed8c1[_0x319c('0x2e')][_0x319c('0x30')],'sMixed':_0x2ed8c1[_0x319c('0x2e')][_0x319c('0x31')],'sNeutral':_0x2ed8c1[_0x319c('0x2e')]['Neutral']});})[_0x319c('0x10')](function(){logger[_0x319c('0xa')](util[_0x319c('0xb')](_0x319c('0x1d'),_0x3c995c['id']));_0x4b67ba();});case'FAILED':return _0x3c995c[_0x319c('0x1c')]({'transcribeStatus':_0x319c('0x32'),'failureReason':_0x29b26c[_0x319c('0x13')][_0x319c('0x33')]})[_0x319c('0x10')](function(){logger[_0x319c('0xa')](util['format'](_0x319c('0x1d'),_0x3c995c['id']));_0x4b67ba();});default:logger[_0x319c('0xa')](util[_0x319c('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3c995c['id']));break;}}else{return BPromise[_0x319c('0x34')]()[_0x319c('0x10')](function(){if(!_0x3c995c[_0x319c('0x1e')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x21'));}if(!_0x362f44[_0x319c('0x22')]||!_0x362f44[_0x319c('0x23')]||!_0x362f44[_0x319c('0x24')]||!_0x362f44[_0x319c('0x25')]||!_0x362f44['bucket']){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x27'));}if(!_0x3c995c[_0x319c('0x1b')]){throw new Error(_0x319c('0x28'));}if(_0x362f44['sentimentAccountId']===_0x3be537['id']){return _0x3be537;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x319c('0x23')]}});}})[_0x319c('0x10')](function(_0x43c527){if(!_0x43c527){throw new db['Sequelize'][(_0x319c('0x20'))](_0x319c('0x2b'));}if(!_0x43c527[_0x319c('0xd')]||!_0x43c527[_0x319c('0xe')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x35'));}_0x401fdb=_0x43c527;logger[_0x319c('0xa')](util['format'](_0x319c('0x2c'),_0x3c995c['id']));return sentiment(_0x401fdb[_0x319c('0xd')],_0x401fdb['data2'],_0x362f44[_0x319c('0x24')],_0x3c995c[_0x319c('0x1b')],_0x362f44[_0x319c('0x25')]);})[_0x319c('0x10')](function(_0x2ae778){logger[_0x319c('0xa')](util[_0x319c('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3c995c['id']));return _0x3c995c[_0x319c('0x1c')]({'sentiment':_0x2ae778[_0x319c('0x2d')],'sPositive':_0x2ae778[_0x319c('0x2e')][_0x319c('0x2f')],'sNegative':_0x2ae778['SentimentScore'][_0x319c('0x30')],'sMixed':_0x2ae778[_0x319c('0x2e')][_0x319c('0x31')],'sNeutral':_0x2ae778['SentimentScore'][_0x319c('0x36')],'transcribeStatus':'COMPLETED'});})[_0x319c('0x10')](function(){logger['info'](util[_0x319c('0xb')](_0x319c('0x1d'),_0x3c995c['id']));_0x4b67ba();});}})[_0x319c('0x37')](function(_0x39a10){if(_0x39a10){if(!_0x39a10[_0x319c('0x38')]||_0x39a10[_0x319c('0x38')]!=='SequelizeValidationError'){logger[_0x319c('0x39')](util[_0x319c('0xb')](_0x319c('0x3a'),_0x3c995c['id']),util[_0x319c('0x3b')](_0x39a10,{'showHidden':![],'depth':null}));}}_0x4b67ba();});});}function checkTranscribe(){var _0x201906;var _0x1a3491;var _0x57308b;return db[_0x319c('0x3c')][_0x319c('0x3d')]({'where':{'transcribeStatus':_0x319c('0x3e')}})['then'](function(_0x3502e6){if(!_0x3502e6||!_0x3502e6[_0x319c('0x1a')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x3f'));}_0x201906=_0x3502e6;return db[_0x319c('0x40')][_0x319c('0x2a')]({'where':{'id':0x1}});})[_0x319c('0x10')](function(_0x14cbdc){if(!_0x14cbdc){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))](_0x319c('0x41'));}_0x1a3491=_0x14cbdc;if(!_0x1a3491[_0x319c('0x5')]||!_0x1a3491['transcribeAccountId']||!_0x1a3491[_0x319c('0xf')]||!_0x1a3491[_0x319c('0x25')]||!_0x1a3491[_0x319c('0x26')]){throw new db['Sequelize'][(_0x319c('0x20'))](_0x319c('0x42'));}return db[_0x319c('0x29')][_0x319c('0x2a')]({'where':{'id':_0x1a3491[_0x319c('0x43')]}});})['then'](function(_0x112b2f){if(!_0x112b2f){throw new db['Sequelize'][(_0x319c('0x20'))](_0x319c('0x2b'));}if(!_0x112b2f[_0x319c('0xd')]||!_0x112b2f[_0x319c('0xe')]){throw new db[(_0x319c('0x1f'))][(_0x319c('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x57308b=_0x112b2f;var _0x1b1a78=[];_0x201906[_0x319c('0x44')](function(_0x46fce7){_0x1b1a78[_0x319c('0x45')](checkTranscribeJob(_0x46fce7,_0x1a3491,_0x57308b));});return BPromise['all'](_0x1b1a78);})[_0x319c('0x37')](function(_0xe063f9){if(_0xe063f9){if(!_0xe063f9[_0x319c('0x38')]||_0xe063f9[_0x319c('0x38')]!==_0x319c('0x46')){logger[_0x319c('0x39')](util['inspect'](_0xe063f9,{'showHidden':![],'depth':null}));}}});}exports[_0x319c('0x47')]=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 b61364a..a05c653 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 _0xb516=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a8f25,_0x1963a8){var _0x48ef13=function(_0x4f7389){while(--_0x4f7389){_0x4a8f25['push'](_0x4a8f25['shift']());}};_0x48ef13(++_0x1963a8);}(_0xb516,0x1ab));var _0x6b51=function(_0x54ae1f,_0x3a6d6e){_0x54ae1f=_0x54ae1f-0x0;var _0x2feabd=_0xb516[_0x54ae1f];return _0x2feabd;};'use strict';var _=require(_0x6b51('0x0'));var moment=require('moment');var Redis=require(_0x6b51('0x1'));var util=require(_0x6b51('0x2'));var config=require(_0x6b51('0x3'));var db=require(_0x6b51('0x4'))['db'];var logger=require('../logger')(_0x6b51('0x5'));config[_0x6b51('0x6')]=_[_0x6b51('0x7')](config['redis'],{'host':_0x6b51('0x8'),'port':0x18eb});var io=require(_0x6b51('0x9'))(new Redis(config[_0x6b51('0x6')]));function closeInteractions(){var _0xc50d78=[];return db[_0x6b51('0xa')][_0x6b51('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6b51('0xc')](0x18,_0x6b51('0xd'))}}})[_0x6b51('0xe')](function(_0x577e0d){if(_0x577e0d&&_0x577e0d[_0x6b51('0xf')]){_0xc50d78=_[_0x6b51('0x10')](_0x577e0d||[],'id');logger[_0x6b51('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0xc50d78[_0x6b51('0x12')]());return db[_0x6b51('0xa')][_0x6b51('0x13')]({'closeReason':_0x6b51('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6b51('0x15')](_0x6b51('0x16'))},{'where':{'id':_0xc50d78}});}})['then'](function(){if(_0xc50d78&&_0xc50d78['length']){logger['info'](_0x6b51('0x17'),_0xc50d78[_0x6b51('0x12')]());for(var _0x1bfe9d=0x0;_0x1bfe9d<_0xc50d78[_0x6b51('0xf')];_0x1bfe9d++){io[_0x6b51('0x18')](_0x6b51('0x19'),{'id':_0xc50d78[_0x1bfe9d],'closed':!![]});}}})[_0x6b51('0x1a')](function(_0x45da9f){logger[_0x6b51('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x45da9f?util[_0x6b51('0x1c')](_0x45da9f,{'showHidden':![],'depth':null}):'');});}exports[_0x6b51('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3584=['length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','../../config/environment','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x3584,0x79));var _0x4358=function(_0x3354c6,_0x1a237a){_0x3354c6=_0x3354c6-0x0;var _0x53d942=_0x3584[_0x3354c6];return _0x53d942;};'use strict';var _=require(_0x4358('0x0'));var moment=require(_0x4358('0x1'));var Redis=require(_0x4358('0x2'));var util=require('util');var config=require(_0x4358('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x4358('0x4'))(_0x4358('0x5'));config['redis']=_['defaults'](config[_0x4358('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4358('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x346b8e=[];return db[_0x4358('0x8')][_0x4358('0x9')]({'raw':!![],'attributes':['id',_0x4358('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4358('0xb')](0x18,_0x4358('0xc'))}}})[_0x4358('0xd')](function(_0xa5c45e){if(_0xa5c45e&&_0xa5c45e[_0x4358('0xe')]){_0x346b8e=_[_0x4358('0xf')](_0xa5c45e||[],'id');logger[_0x4358('0x10')](_0x4358('0x11'),_0x346b8e['join']());return db[_0x4358('0x8')][_0x4358('0x12')]({'closeReason':_0x4358('0x13'),'disposition':_0x4358('0x14'),'closed':!![],'closedAt':moment()['format'](_0x4358('0x15'))},{'where':{'id':_0x346b8e}});}})[_0x4358('0xd')](function(){if(_0x346b8e&&_0x346b8e[_0x4358('0xe')]){logger['info'](_0x4358('0x16'),_0x346b8e[_0x4358('0x17')]());for(var _0x389d7a=0x0;_0x389d7a<_0x346b8e[_0x4358('0xe')];_0x389d7a++){io['emit'](_0x4358('0x18'),{'id':_0x346b8e[_0x389d7a],'closed':!![]});}}})[_0x4358('0x19')](function(_0x1fb256){logger['error'](_0x4358('0x1a'),_0x1fb256?util['inspect'](_0x1fb256,{'showHidden':![],'depth':null}):'');});}exports['start']=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 22c1701..6c7ee11 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9373=['hopper2','catch','util','../mysqldb','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy','then','log','contacts1','CmHopper','bulkCreate','hopper1','finished\x20populating','contacts2'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x9373,0x142));var _0x3937=function(_0x68a67c,_0x5884d5){_0x68a67c=_0x68a67c-0x0;var _0x30563f=_0x9373[_0x68a67c];return _0x30563f;};'use strict';var util=require(_0x3937('0x0'));var db=require(_0x3937('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x3937('0x2')+i,'phone':0xf879fb460+i,'email':_0x3937('0x3')+i+_0x3937('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3937('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x3937('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3937('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3937('0x5')]({'id':i,'firstName':_0x3937('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x3937('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3937('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x3937('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3937('0x6')](),'updatedAt':Date[_0x3937('0x6')]()});}db[_0x3937('0x8')][_0x3937('0x9')]({'where':{}})[_0x3937('0xa')](function(){return db[_0x3937('0x8')]['bulkCreate'](contacts);})[_0x3937('0xa')](function(){console[_0x3937('0xb')]('finished\x20populating',_0x3937('0xc'));return db[_0x3937('0xd')][_0x3937('0x9')]({'where':{}});})[_0x3937('0xa')](function(){return db[_0x3937('0xd')][_0x3937('0xe')](hopper);})[_0x3937('0xa')](function(){console[_0x3937('0xb')]('finished\x20populating',_0x3937('0xf'));return db[_0x3937('0x8')][_0x3937('0xe')](contacts2);})[_0x3937('0xa')](function(){console[_0x3937('0xb')](_0x3937('0x10'),_0x3937('0x11'));return db[_0x3937('0xd')][_0x3937('0xe')](hopper2);})['then'](function(){console['log'](_0x3937('0x10'),_0x3937('0x12'));})[_0x3937('0x13')](function(_0x402080){console[_0x3937('0xb')](_0x402080);}); \ No newline at end of file +var _0x399a=['hopper1','log','contacts2','hopper2','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','finished\x20populating','CmHopper'];(function(_0x1d3ece,_0x3fb359){var _0x1ba5d2=function(_0xaa2729){while(--_0xaa2729){_0x1d3ece['push'](_0x1d3ece['shift']());}};_0x1ba5d2(++_0x3fb359);}(_0x399a,0xee));var _0xa399=function(_0x32b8a9,_0x59d62b){_0x32b8a9=_0x32b8a9-0x0;var _0x40105c=_0x399a[_0x32b8a9];return _0x40105c;};'use strict';var util=require(_0xa399('0x0'));var db=require(_0xa399('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xa399('0x2')+i,'lastName':_0xa399('0x3')+i,'phone':0xf879fb460+i,'email':_0xa399('0x4')+i+_0xa399('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa399('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xa399('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa399('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa399('0x6')]({'id':i,'firstName':_0xa399('0x2')+i,'lastName':_0xa399('0x3')+i,'phone':0xf879fb460+i,'email':_0xa399('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa399('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xa399('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa399('0x7')](),'updatedAt':Date[_0xa399('0x7')]()});}db[_0xa399('0x8')][_0xa399('0x9')]({'where':{}})[_0xa399('0xa')](function(){return db[_0xa399('0x8')][_0xa399('0xb')](contacts);})[_0xa399('0xa')](function(){console['log'](_0xa399('0xc'),'contacts1');return db['CmHopper']['destroy']({'where':{}});})[_0xa399('0xa')](function(){return db[_0xa399('0xd')]['bulkCreate'](hopper);})[_0xa399('0xa')](function(){console['log'](_0xa399('0xc'),_0xa399('0xe'));return db[_0xa399('0x8')][_0xa399('0xb')](contacts2);})[_0xa399('0xa')](function(){console[_0xa399('0xf')]('finished\x20populating',_0xa399('0x10'));return db[_0xa399('0xd')][_0xa399('0xb')](hopper2);})[_0xa399('0xa')](function(){console[_0xa399('0xf')](_0xa399('0xc'),_0xa399('0x11'));})['catch'](function(_0x4aaa3c){console['log'](_0x4aaa3c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 3c443d6..8ec65b8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2220=['udp','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','%s%s','agent','format','%s%s@xcally.com','password','friend'];(function(_0x337c64,_0x481924){var _0x4b0b1a=function(_0x4a840f){while(--_0x4a840f){_0x337c64['push'](_0x337c64['shift']());}};_0x4b0b1a(++_0x481924);}(_0x2220,0x14f));var _0x0222=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2220[_0x341e0f];return _0x59555a;};'use strict';var util=require(_0x0222('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x0222('0x1'),_0x0222('0x2'),i),'fullname':util[_0x0222('0x3')](_0x0222('0x1'),'agent',i),'email':util[_0x0222('0x3')](_0x0222('0x4'),'agent',i),'role':_0x0222('0x2'),'password':_0x0222('0x5'),'internal':0xfa0+i,'type':_0x0222('0x6'),'transport':[_0x0222('0x7'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x0222('0x3')](_0x0222('0x1'),_0x0222('0x2'),i),'encryption':_0x0222('0x8'),'avpf':_0x0222('0x8'),'force_avp':_0x0222('0x8'),'icesupport':_0x0222('0x8'),'dtlsenable':_0x0222('0x8'),'dtlsverify':'no','dtlscertfile':_0x0222('0x9'),'dtlsprivatekey':_0x0222('0xa'),'dtlssetup':_0x0222('0xb'),'callerid':util['format'](_0x0222('0xc'),util[_0x0222('0x3')](_0x0222('0x1'),_0x0222('0x2'),i),0xfa0+i)});}db[_0x0222('0xd')][_0x0222('0xe')](users)[_0x0222('0xf')](function(){console[_0x0222('0x10')]('add\x20user');})[_0x0222('0x11')](function(_0x4b9e3a){console[_0x0222('0x10')](_0x4b9e3a);}); \ No newline at end of file +var _0x65ce=['add\x20user','catch','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','friend','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log'];(function(_0xe5f72b,_0x4fa469){var _0x2e452a=function(_0x2c1169){while(--_0x2c1169){_0xe5f72b['push'](_0xe5f72b['shift']());}};_0x2e452a(++_0x4fa469);}(_0x65ce,0x145));var _0xe65c=function(_0x206023,_0x300c07){_0x206023=_0x206023-0x0;var _0x20f774=_0x65ce[_0x206023];return _0x20f774;};'use strict';var util=require('util');var db=require(_0xe65c('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe65c('0x1')]({'name':util[_0xe65c('0x2')]('%s%s',_0xe65c('0x3'),i),'fullname':util[_0xe65c('0x2')](_0xe65c('0x4'),'agent',i),'email':util[_0xe65c('0x2')](_0xe65c('0x5'),'agent',i),'role':_0xe65c('0x3'),'password':'password','internal':0xfa0+i,'type':_0xe65c('0x6'),'transport':['udp','ws','wss'],'disallow':['all'],'allow':[_0xe65c('0x7')],'defaultuser':util[_0xe65c('0x2')](_0xe65c('0x4'),_0xe65c('0x3'),i),'encryption':_0xe65c('0x8'),'avpf':'yes','force_avp':_0xe65c('0x8'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xe65c('0x9'),'dtlsprivatekey':_0xe65c('0xa'),'dtlssetup':'actpass','callerid':util['format'](_0xe65c('0xb'),util['format'](_0xe65c('0x4'),_0xe65c('0x3'),i),0xfa0+i)});}db[_0xe65c('0xc')][_0xe65c('0xd')](users)['then'](function(){console[_0xe65c('0xe')](_0xe65c('0xf'));})[_0xe65c('0x10')](function(_0x311179){console[_0xe65c('0xe')](_0x311179);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7577e68..c54dc59 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc36=['lodash','bluebird','../mysqldb','name','Agents','User','role','agent','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','telephone','Campaign','type','format','length','user:%s','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED'];(function(_0xc477cf,_0x40c5a5){var _0x5ce6c4=function(_0x490fb6){while(--_0x490fb6){_0xc477cf['push'](_0xc477cf['shift']());}};_0x5ce6c4(++_0x40c5a5);}(_0xdc36,0x18c));var _0x6dc3=function(_0x15578a,_0x171c59){_0x15578a=_0x15578a-0x0;var _0x1f7625=_0xdc36[_0x15578a];return _0x1f7625;};'use strict';var _=require(_0x6dc3('0x0'));var util=require('util');var BPromise=require(_0x6dc3('0x1'));var db=require(_0x6dc3('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6dc3('0x3')],'include':[{'as':_0x6dc3('0x4'),'model':db[_0x6dc3('0x5')],'attributes':['id','name',_0x6dc3('0x6')],'raw':!![],'where':{'role':_0x6dc3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x6dc3('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':_0x6dc3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6dc3('0x3'),'type'],'where':{'type':_0x6dc3('0x8')}};function getAssociatedResources(_0x1aecc5,_0x554fe5,_0x88957d){return db[_0x6dc3('0x9')][_0x6dc3('0xa')]({'where':{'name':_0x1aecc5,'userProfileId':_0x554fe5},'raw':!![]})[_0x6dc3('0xb')](function(_0x55c3e9){if(_0x55c3e9){if(_0x55c3e9[_0x6dc3('0xc')]){switch(_0x1aecc5){case'VoiceQueues':case _0x6dc3('0xd'):case _0x6dc3('0xe'):case _0x6dc3('0xf'):case _0x6dc3('0x10'):case _0x6dc3('0x11'):case _0x6dc3('0x12'):return db[_0x88957d][_0x6dc3('0x13')](queryQueues);case _0x6dc3('0x14'):return db[_0x88957d]['findAll'](queryTelephones);case _0x6dc3('0x15'):return db[_0x88957d][_0x6dc3('0x13')](queryTrunks);case _0x6dc3('0x16'):return db[_0x88957d][_0x6dc3('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x6dc3('0x13')]({'attributes':[_0x6dc3('0x17')],'where':{'sectionId':_0x55c3e9['id']},'raw':!![]})[_0x6dc3('0xb')](function(_0x469b81){if(_0x469b81){var _0x22b39a={'where':{'id':_['map'](_0x469b81,'resourceId')},'raw':!![]};switch(_0x88957d){case'User':_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x6')]=_0x6dc3('0x19');break;case _0x6dc3('0x1a'):_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x1b')]=_0x6dc3('0x8');break;}return db[_0x88957d][_0x6dc3('0x13')](_0x22b39a);}else{return[];}});}}else{return[];}})['then'](function(_0x33edab){return _0x33edab;});}function joinOrLeaveQueues(_0x279bae,_0xd1bfd4,_0x148885,_0x473229){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')]('%s:queue:%s',_0x148885,_0x473229[_0x6dc3('0x3')]));if(_0x473229[_0x6dc3('0x4')]){for(var _0x22b18a=0x0;_0x22b18a<_0x473229[_0x6dc3('0x4')][_0x6dc3('0x1d')];_0x22b18a+=0x1){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x473229[_0x6dc3('0x4')][_0x22b18a][_0x6dc3('0x3')]));}}}function joinOrLeave(_0x435a55,_0x52d5f2,_0x38dd7e){var _0x12455c;if(_0x435a55['handshake'][_0x6dc3('0x1f')]['id']){db['User'][_0x6dc3('0x20')]({'attributes':['id','name','role',_0x6dc3('0x21')],'where':{'id':_0x435a55['handshake'][_0x6dc3('0x1f')]['id']},'include':[{'model':db[_0x6dc3('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x23')],'as':_0x6dc3('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x25')],'as':_0x6dc3('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x28')],'as':_0x6dc3('0x29'),'attributes':['id'],'raw':!![]}]})[_0x6dc3('0xb')](function(_0x598ab4){if(_0x598ab4){_0x12455c=_0x598ab4;_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x598ab4['name']));var _0xd7c2b5=[];switch(_0x598ab4[_0x6dc3('0x6')]){case _0x6dc3('0x2a'):_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x6dc3('0x2c')];}_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x2e')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db['ChatQueue'][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x2f')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x30')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db['MailQueue']['findAll'](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x31')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x32')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')]['findAll'](queryTelephones));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x33')][_0x6dc3('0x13')](queryTrunks));_0xd7c2b5[_0x6dc3('0x2d')](db['Campaign'][_0x6dc3('0x13')](queryCampaigns));_0xd7c2b5['push'](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'user':_0x435a55[_0x52d5f2](_0x6dc3('0x34'));_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5['push'](getAssociatedResources('VoiceQueues',_0x598ab4['userProfileId'],_0x6dc3('0x2e')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('ChatQueues',_0x598ab4[_0x6dc3('0x21')],'ChatQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('FaxQueues',_0x598ab4['userProfileId'],'FaxQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('SmsQueues',_0x598ab4[_0x6dc3('0x21')],'SmsQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x10'),_0x598ab4[_0x6dc3('0x21')],'MailQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x11'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x31')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x12'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x32')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x14'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x5')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x15'),_0x598ab4['userProfileId'],_0x6dc3('0x33')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x16'),_0x598ab4['userProfileId'],_0x6dc3('0x1a')));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'agent':_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x35')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5['push'](_0x598ab4[_0x6dc3('0x36')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getFaxQueues']({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getSmsQueues']({'attributes':['id','name']}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x37')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x38')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x39')]({'attributes':['id',_0x6dc3('0x3')]}));break;}return BPromise[_0x6dc3('0x3a')](_0xd7c2b5);}})[_0x6dc3('0xb')](function(_0x33ae2b){if(_0x33ae2b&&_0x33ae2b[_0x6dc3('0x1d')]){for(var _0x255718=0x0;_0x255718<_0x33ae2b[_0x6dc3('0x1d')];_0x255718+=0x1){for(var _0x413361=0x0;_0x413361<_0x33ae2b[_0x255718][_0x6dc3('0x1d')];_0x413361+=0x1){switch(_0x255718){case 0x0:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3b'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x1:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3c'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x2:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3d'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x3:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3e'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x4:joinOrLeaveQueues(_0x435a55,_0x52d5f2,'mail',_0x33ae2b[_0x255718][_0x413361]);break;case 0x5:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3f'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x6:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x40'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x7:if(_0x12455c[_0x6dc3('0x6')]!=='agent')_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x41'),_0x33ae2b[_0x255718][_0x413361]['name']));break;case 0x8:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util['format'](_0x6dc3('0x42'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0x9:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x43'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x1b')],_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0xa:_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;}}}}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x32d90a=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x46')],'id');return _0x12455c[_0x6dc3('0x47')](_0x32d90a)[_0x6dc3('0xb')](function(){for(var _0x49a943=0x0;_0x49a943<_0x32d90a[_0x6dc3('0x1d')];_0x49a943+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x49'),{'ChatInteractionId':Number(_0x32d90a[_0x49a943]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0xf8e0d7=_['map'](_0x12455c[_0x6dc3('0x24')],'id');return _0x12455c[_0x6dc3('0x4a')](_0xf8e0d7)['then'](function(){for(var _0x4a2d69=0x0;_0x4a2d69<_0xf8e0d7[_0x6dc3('0x1d')];_0x4a2d69+=0x1){_0x38dd7e[_0x6dc3('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xf8e0d7[_0x4a2d69]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x55f8da=_['map'](_0x12455c['FaxInteractions'],'id');return _0x12455c[_0x6dc3('0x4b')](_0x55f8da)['then'](function(){for(var _0x2bece6=0x0;_0x2bece6<_0x55f8da[_0x6dc3('0x1d')];_0x2bece6+=0x1){_0x38dd7e['emit'](_0x6dc3('0x4c'),{'FaxInteractionId':Number(_0x55f8da[_0x2bece6]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x4b93cb=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x4d')],'id');return _0x12455c[_0x6dc3('0x4e')](_0x4b93cb)[_0x6dc3('0xb')](function(){for(var _0x4b43dc=0x0;_0x4b43dc<_0x4b93cb[_0x6dc3('0x1d')];_0x4b43dc+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x4f'),{'SmsInteractionId':Number(_0x4b93cb[_0x4b43dc]),'UserId':Number(_0x12455c['id'])});}});}})['then'](function(){if(_0x52d5f2==='leave'){var _0x211d9d=_['map'](_0x12455c[_0x6dc3('0x50')],'id');return _0x12455c[_0x6dc3('0x51')](_0x211d9d)[_0x6dc3('0xb')](function(){for(var _0x237ca9=0x0;_0x237ca9<_0x211d9d[_0x6dc3('0x1d')];_0x237ca9+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x52'),{'OpenchannelInteractionId':Number(_0x211d9d[_0x237ca9]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x3aac2b=_[_0x6dc3('0x45')](_0x12455c['WhatsappInteractions'],'id');return _0x12455c[_0x6dc3('0x53')](_0x3aac2b)[_0x6dc3('0xb')](function(){for(var _0x557421=0x0;_0x557421<_0x3aac2b[_0x6dc3('0x1d')];_0x557421+=0x1){_0x38dd7e['emit'](_0x6dc3('0x54'),{'WhatsappInteractionId':Number(_0x3aac2b[_0x557421]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0x55')](function(_0x514528){_0x435a55[_0x6dc3('0x56')](_0x514528);});}}function onDisconnect(_0x486354,_0x9034c1){joinOrLeave(_0x486354,_0x6dc3('0x44'),_0x9034c1);}function onConnect(_0x2aa73d){joinOrLeave(_0x2aa73d,_0x6dc3('0x57'));}exports[_0x6dc3('0x58')]=function(_0x544082){_0x544082['on']('connection',function(_0x1240da){_0x1240da[_0x6dc3('0x59')](0x0);_0x1240da[_0x6dc3('0x5a')]=_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')][_0x6dc3('0x5d')]+':'+_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')]['remotePort'];_0x1240da[_0x6dc3('0x5e')]=new Date();_0x1240da[_0x6dc3('0x56')]=function(_0xc7e5f3){console[_0x6dc3('0x56')]('SocketIO\x20'+_0x1240da[_0x6dc3('0x5f')][_0x6dc3('0x3')]+'['+_0x1240da[_0x6dc3('0x5a')]+']',_0xc7e5f3);};_0x1240da['on'](_0x6dc3('0x60'),function(){onDisconnect(_0x1240da,_0x544082);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x61'));});onConnect(_0x1240da);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x62'));});}; \ No newline at end of file +var _0xc6a2=['setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','handshake','query','find','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','WhatsappQueue','user','voice:inbound','voice:outbound','VoiceQueues','userProfileId','OpenchannelQueues','Trunks','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','all','length','chat','mail','whatsapp','telephone:%s','campaign:%s:%s','type','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log'];(function(_0x1d2c64,_0x3afab3){var _0x47edc8=function(_0x54fb40){while(--_0x54fb40){_0x1d2c64['push'](_0x1d2c64['shift']());}};_0x47edc8(++_0x3afab3);}(_0xc6a2,0x69));var _0x2c6a=function(_0x15a752,_0x5112d3){_0x15a752=_0x15a752-0x0;var _0x56c2eb=_0xc6a2[_0x15a752];return _0x56c2eb;};'use strict';var _=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var BPromise=require('bluebird');var db=require(_0x2c6a('0x2'))['db'];var config=require(_0x2c6a('0x3'));var queryQueues={'attributes':['id',_0x2c6a('0x4')],'include':[{'as':_0x2c6a('0x5'),'model':db[_0x2c6a('0x6')],'attributes':['id',_0x2c6a('0x4'),_0x2c6a('0x7')],'raw':!![],'where':{'role':_0x2c6a('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2c6a('0x4')],'where':{'role':_0x2c6a('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2c6a('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x2c6a('0x4')],'where':{'role':_0x2c6a('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2c6a('0x4'),'type'],'where':{'type':_0x2c6a('0xa')}};function getAssociatedResources(_0x3f4b72,_0x25ef48,_0x2290ed){return db[_0x2c6a('0xb')][_0x2c6a('0xc')]({'where':{'name':_0x3f4b72,'userProfileId':_0x25ef48},'raw':!![]})[_0x2c6a('0xd')](function(_0x2a7040){if(_0x2a7040){if(_0x2a7040['autoAssociation']){switch(_0x3f4b72){case'VoiceQueues':case _0x2c6a('0xe'):case _0x2c6a('0xf'):case _0x2c6a('0x10'):case _0x2c6a('0x11'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2290ed][_0x2c6a('0x12')](queryQueues);case _0x2c6a('0x13'):return db[_0x2290ed][_0x2c6a('0x12')](queryTelephones);case'Trunks':return db[_0x2290ed]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x2290ed][_0x2c6a('0x12')](queryCampaigns);}}else{return db[_0x2c6a('0x14')][_0x2c6a('0x12')]({'attributes':[_0x2c6a('0x15')],'where':{'sectionId':_0x2a7040['id']},'raw':!![]})[_0x2c6a('0xd')](function(_0x3bf95b){if(_0x3bf95b){var _0x2e684e={'where':{'id':_[_0x2c6a('0x16')](_0x3bf95b,_0x2c6a('0x15'))},'raw':!![]};switch(_0x2290ed){case'User':_0x2e684e[_0x2c6a('0x17')][_0x2c6a('0x7')]='telephone';break;case _0x2c6a('0x18'):_0x2e684e['where']['type']=_0x2c6a('0xa');break;}return db[_0x2290ed][_0x2c6a('0x12')](_0x2e684e);}else{return[];}});}}else{return[];}})[_0x2c6a('0xd')](function(_0xae2e1b){return _0xae2e1b;});}function joinOrLeaveQueues(_0x1b49d8,_0x40fc4e,_0x2f9dda,_0x54bc5d){_0x1b49d8[_0x40fc4e](util[_0x2c6a('0x19')](_0x2c6a('0x1a'),_0x2f9dda,_0x54bc5d[_0x2c6a('0x4')]));if(_0x54bc5d[_0x2c6a('0x5')]){for(var _0x10edaa=0x0;_0x10edaa<_0x54bc5d['Agents']['length'];_0x10edaa+=0x1){_0x1b49d8[_0x40fc4e](util[_0x2c6a('0x19')](_0x2c6a('0x1b'),_0x54bc5d[_0x2c6a('0x5')][_0x10edaa][_0x2c6a('0x4')]));}}}function joinOrLeave(_0x4e5994,_0x4c6d13,_0x542d24){var _0x395558;if(_0x4e5994[_0x2c6a('0x1c')][_0x2c6a('0x1d')]['id']){db[_0x2c6a('0x6')][_0x2c6a('0x1e')]({'attributes':['id',_0x2c6a('0x4'),_0x2c6a('0x7'),'userProfileId'],'where':{'id':_0x4e5994[_0x2c6a('0x1c')]['query']['id']},'include':[{'model':db[_0x2c6a('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2c6a('0x20')],'as':_0x2c6a('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c6a('0x22')],'as':_0x2c6a('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c6a('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2c6a('0x25')],'as':_0x2c6a('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c6a('0x27')],'as':_0x2c6a('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x1d77a3){if(_0x1d77a3){_0x395558=_0x1d77a3;_0x4e5994[_0x4c6d13](util[_0x2c6a('0x19')](_0x2c6a('0x1b'),_0x1d77a3[_0x2c6a('0x4')]));var _0x47abcf=[];switch(_0x1d77a3[_0x2c6a('0x7')]){case'admin':_0x4e5994[_0x4c6d13]('voice:inbound');_0x4e5994[_0x4c6d13]('voice:outbound');if(queryQueues[_0x2c6a('0x29')](_0x2c6a('0x2a'))){delete queryQueues[_0x2c6a('0x2a')];}_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x2c')][_0x2c6a('0x12')](queryQueues));_0x47abcf['push'](db[_0x2c6a('0x2d')][_0x2c6a('0x12')](queryQueues));_0x47abcf[_0x2c6a('0x2b')](db['FaxQueue'][_0x2c6a('0x12')](queryQueues));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x2e')][_0x2c6a('0x12')](queryQueues));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x2f')][_0x2c6a('0x12')](queryQueues));_0x47abcf[_0x2c6a('0x2b')](db['OpenchannelQueue'][_0x2c6a('0x12')](queryQueues));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x30')]['findAll'](queryQueues));_0x47abcf['push'](db[_0x2c6a('0x6')]['findAll'](queryTelephones));_0x47abcf[_0x2c6a('0x2b')](db['Trunk'][_0x2c6a('0x12')](queryTrunks));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x18')]['findAll'](queryCampaigns));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x6')]['findAll'](queryAgents));break;case _0x2c6a('0x31'):_0x4e5994[_0x4c6d13](_0x2c6a('0x32'));_0x4e5994[_0x4c6d13](_0x2c6a('0x33'));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources(_0x2c6a('0x34'),_0x1d77a3['userProfileId'],'VoiceQueue'));_0x47abcf['push'](getAssociatedResources(_0x2c6a('0xe'),_0x1d77a3[_0x2c6a('0x35')],_0x2c6a('0x2d')));_0x47abcf['push'](getAssociatedResources('FaxQueues',_0x1d77a3[_0x2c6a('0x35')],'FaxQueue'));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources('SmsQueues',_0x1d77a3[_0x2c6a('0x35')],_0x2c6a('0x2e')));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources(_0x2c6a('0x11'),_0x1d77a3['userProfileId'],'MailQueue'));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources(_0x2c6a('0x36'),_0x1d77a3['userProfileId'],'OpenchannelQueue'));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources('WhatsappQueues',_0x1d77a3[_0x2c6a('0x35')],_0x2c6a('0x30')));_0x47abcf['push'](getAssociatedResources(_0x2c6a('0x13'),_0x1d77a3[_0x2c6a('0x35')],'User'));_0x47abcf['push'](getAssociatedResources(_0x2c6a('0x37'),_0x1d77a3[_0x2c6a('0x35')],_0x2c6a('0x38')));_0x47abcf[_0x2c6a('0x2b')](getAssociatedResources('IvrCampaigns',_0x1d77a3['userProfileId'],_0x2c6a('0x18')));_0x47abcf[_0x2c6a('0x2b')](db[_0x2c6a('0x6')][_0x2c6a('0x12')](queryAgents));break;case'agent':_0x4e5994[_0x4c6d13](_0x2c6a('0x32'));_0x4e5994[_0x4c6d13](_0x2c6a('0x33'));_0x47abcf[_0x2c6a('0x2b')](_0x1d77a3[_0x2c6a('0x39')]({'attributes':['id',_0x2c6a('0x4')]}));_0x47abcf['push'](_0x1d77a3[_0x2c6a('0x3a')]({'attributes':['id','name']}));_0x47abcf[_0x2c6a('0x2b')](_0x1d77a3[_0x2c6a('0x3b')]({'attributes':['id',_0x2c6a('0x4')]}));_0x47abcf[_0x2c6a('0x2b')](_0x1d77a3['getSmsQueues']({'attributes':['id',_0x2c6a('0x4')]}));_0x47abcf[_0x2c6a('0x2b')](_0x1d77a3[_0x2c6a('0x3c')]({'attributes':['id',_0x2c6a('0x4')]}));_0x47abcf['push'](_0x1d77a3['getOpenchannelQueues']({'attributes':['id','name']}));_0x47abcf['push'](_0x1d77a3['getWhatsappQueues']({'attributes':['id',_0x2c6a('0x4')]}));break;}return BPromise[_0x2c6a('0x3d')](_0x47abcf);}})[_0x2c6a('0xd')](function(_0x38ce05){if(_0x38ce05&&_0x38ce05[_0x2c6a('0x3e')]){for(var _0x2badae=0x0;_0x2badae<_0x38ce05[_0x2c6a('0x3e')];_0x2badae+=0x1){for(var _0x8c3864=0x0;_0x8c3864<_0x38ce05[_0x2badae][_0x2c6a('0x3e')];_0x8c3864+=0x1){switch(_0x2badae){case 0x0:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,'voice',_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x1:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,_0x2c6a('0x3f'),_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x2:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,'fax',_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x3:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,'sms',_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x4:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,_0x2c6a('0x40'),_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x5:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,'openchannel',_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x6:joinOrLeaveQueues(_0x4e5994,_0x4c6d13,_0x2c6a('0x41'),_0x38ce05[_0x2badae][_0x8c3864]);break;case 0x7:if(_0x395558[_0x2c6a('0x7')]!==_0x2c6a('0x8'))_0x4e5994[_0x4c6d13](util['format'](_0x2c6a('0x42'),_0x38ce05[_0x2badae][_0x8c3864][_0x2c6a('0x4')]));break;case 0x8:if(_0x395558['role']!==_0x2c6a('0x8'))_0x4e5994[_0x4c6d13](util['format']('trunk:%s',_0x38ce05[_0x2badae][_0x8c3864]['name']));break;case 0x9:if(_0x395558[_0x2c6a('0x7')]!==_0x2c6a('0x8'))_0x4e5994[_0x4c6d13](util[_0x2c6a('0x19')](_0x2c6a('0x43'),_0x38ce05[_0x2badae][_0x8c3864][_0x2c6a('0x44')],_0x38ce05[_0x2badae][_0x8c3864][_0x2c6a('0x4')]));break;case 0xa:_0x4e5994[_0x4c6d13](util[_0x2c6a('0x19')](_0x2c6a('0x1b'),_0x38ce05[_0x2badae][_0x8c3864]['name']));break;}}}}})[_0x2c6a('0xd')](function(){if(_0x4c6d13===_0x2c6a('0x45')){var _0x13f9bd=_[_0x2c6a('0x16')](_0x395558[_0x2c6a('0x46')],'id');return _0x395558[_0x2c6a('0x47')](_0x13f9bd)[_0x2c6a('0xd')](function(){for(var _0x216c4c=0x0;_0x216c4c<_0x13f9bd['length'];_0x216c4c+=0x1){_0x542d24[_0x2c6a('0x48')](_0x2c6a('0x49'),{'ChatInteractionId':Number(_0x13f9bd[_0x216c4c]),'UserId':Number(_0x395558['id'])});}});}})[_0x2c6a('0xd')](function(){if(_0x4c6d13==='leave'){var _0x3a83dc=_['map'](_0x395558[_0x2c6a('0x21')],'id');return _0x395558[_0x2c6a('0x4a')](_0x3a83dc)[_0x2c6a('0xd')](function(){for(var _0x35835c=0x0;_0x35835c<_0x3a83dc['length'];_0x35835c+=0x1){_0x542d24['emit'](_0x2c6a('0x4b'),{'MailInteractionId':Number(_0x3a83dc[_0x35835c]),'UserId':Number(_0x395558['id'])});}});}})['then'](function(){if(_0x4c6d13===_0x2c6a('0x45')){var _0x4be9b0=_[_0x2c6a('0x16')](_0x395558['FaxInteractions'],'id');return _0x395558[_0x2c6a('0x4c')](_0x4be9b0)[_0x2c6a('0xd')](function(){for(var _0x32d196=0x0;_0x32d196<_0x4be9b0[_0x2c6a('0x3e')];_0x32d196+=0x1){_0x542d24[_0x2c6a('0x48')](_0x2c6a('0x4d'),{'FaxInteractionId':Number(_0x4be9b0[_0x32d196]),'UserId':Number(_0x395558['id'])});}});}})[_0x2c6a('0xd')](function(){if(_0x4c6d13===_0x2c6a('0x45')){var _0xa360f5=_[_0x2c6a('0x16')](_0x395558['SmsInteractions'],'id');return _0x395558[_0x2c6a('0x4e')](_0xa360f5)[_0x2c6a('0xd')](function(){for(var _0x1fc963=0x0;_0x1fc963<_0xa360f5[_0x2c6a('0x3e')];_0x1fc963+=0x1){_0x542d24['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xa360f5[_0x1fc963]),'UserId':Number(_0x395558['id'])});}});}})[_0x2c6a('0xd')](function(){if(_0x4c6d13==='leave'){var _0x370353=_[_0x2c6a('0x16')](_0x395558[_0x2c6a('0x26')],'id');return _0x395558['removeOpenchannelInteractions'](_0x370353)['then'](function(){for(var _0x2b6a6e=0x0;_0x2b6a6e<_0x370353[_0x2c6a('0x3e')];_0x2b6a6e+=0x1){_0x542d24[_0x2c6a('0x48')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x370353[_0x2b6a6e]),'UserId':Number(_0x395558['id'])});}});}})[_0x2c6a('0xd')](function(){if(_0x4c6d13===_0x2c6a('0x45')){var _0x1b27d0=_['map'](_0x395558['WhatsappInteractions'],'id');return _0x395558[_0x2c6a('0x4f')](_0x1b27d0)['then'](function(){for(var _0x29b0d1=0x0;_0x29b0d1<_0x1b27d0[_0x2c6a('0x3e')];_0x29b0d1+=0x1){_0x542d24[_0x2c6a('0x48')](_0x2c6a('0x50'),{'WhatsappInteractionId':Number(_0x1b27d0[_0x29b0d1]),'UserId':Number(_0x395558['id'])});}});}})[_0x2c6a('0x51')](function(_0x4f10e0){_0x4e5994[_0x2c6a('0x52')](_0x4f10e0);});}}function onDisconnect(_0x5a6c65,_0x14be18){joinOrLeave(_0x5a6c65,_0x2c6a('0x45'),_0x14be18);}function onConnect(_0x2e099c){joinOrLeave(_0x2e099c,'join');}exports['default']=function(_0x2fe8c8){_0x2fe8c8['on']('connection',function(_0x413c0f){_0x413c0f[_0x2c6a('0x53')](0x0);_0x413c0f[_0x2c6a('0x54')]=_0x413c0f[_0x2c6a('0x55')][_0x2c6a('0x56')][_0x2c6a('0x57')]+':'+_0x413c0f[_0x2c6a('0x55')][_0x2c6a('0x56')][_0x2c6a('0x58')];_0x413c0f[_0x2c6a('0x59')]=new Date();_0x413c0f[_0x2c6a('0x52')]=function(_0x182876){console['log']('SocketIO\x20'+_0x413c0f[_0x2c6a('0x5a')]['name']+'['+_0x413c0f['address']+']',_0x182876);};_0x413c0f['on'](_0x2c6a('0x5b'),function(){onDisconnect(_0x413c0f,_0x2fe8c8);_0x413c0f[_0x2c6a('0x52')](_0x2c6a('0x5c'));});onConnect(_0x413c0f);_0x413c0f[_0x2c6a('0x52')](_0x2c6a('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 324af1c..5f71245 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 _0x51dc=['get','channel','motionChannel','event','direction','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','UserId','format','agent','incomingmessage','outgoingmessage','offlineMessage','opened','SELECT','contact','interface','SIP/%s','name','catch','AfterCreate','changed','closed','substatus','AfterUpdate','User','fullname','email','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','../logger','triggers','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','error','code','Trigger,\x20%s'];(function(_0x22689b,_0x1ea4bc){var _0x121f07=function(_0x20ab7d){while(--_0x20ab7d){_0x22689b['push'](_0x22689b['shift']());}};_0x121f07(++_0x1ea4bc);}(_0x51dc,0x10e));var _0xc51d=function(_0x5e2d03,_0x263834){_0x5e2d03=_0x5e2d03-0x0;var _0xf0d88=_0x51dc[_0x5e2d03];return _0xf0d88;};'use strict';var util=require(_0xc51d('0x0'));var db=require(_0xc51d('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xc51d('0x2'))(_0xc51d('0x3'));var client=jayson['client'][_0xc51d('0x4')]({'port':0x232a});var triggers=[{'channel':_0xc51d('0x5'),'model':'ChatInteraction','event':_0xc51d('0x6'),'condition':_0xc51d('0x7'),'callback':afterCreate},{'channel':_0xc51d('0x5'),'model':_0xc51d('0x8'),'event':_0xc51d('0x9'),'condition':_0xc51d('0xa'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0xc51d('0x6'),'condition':_0xc51d('0xb'),'callback':afterCreateMessage},{'channel':_0xc51d('0x5'),'model':_0xc51d('0xc'),'event':_0xc51d('0x6'),'condition':_0xc51d('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xc51d('0xd'),'model':_0xc51d('0xe'),'event':_0xc51d('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc51d('0xd'),'model':_0xc51d('0xe'),'event':_0xc51d('0x9'),'condition':_0xc51d('0xa'),'callback':afterUpdate},{'channel':_0xc51d('0xd'),'model':_0xc51d('0xf'),'event':_0xc51d('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc51d('0x10'),'model':'WhatsappInteraction','event':_0xc51d('0x6'),'condition':_0xc51d('0x7'),'callback':afterCreate},{'channel':_0xc51d('0x10'),'model':_0xc51d('0x11'),'event':_0xc51d('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc51d('0x10'),'model':_0xc51d('0x12'),'event':'afterCreate','condition':_0xc51d('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xc51d('0x13'),'event':_0xc51d('0x6'),'condition':_0xc51d('0x7'),'callback':afterCreate},{'channel':_0xc51d('0x14'),'model':_0xc51d('0x13'),'event':'afterUpdate','condition':_0xc51d('0xa'),'callback':afterUpdate},{'channel':_0xc51d('0x14'),'model':_0xc51d('0x15'),'event':_0xc51d('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc51d('0x16'),'model':_0xc51d('0x17'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0xc51d('0x17'),'event':'afterUpdate','condition':_0xc51d('0xa'),'callback':afterUpdate},{'channel':_0xc51d('0x16'),'model':_0xc51d('0x18'),'event':_0xc51d('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xc51d('0x19'),'event':_0xc51d('0x6'),'condition':_0xc51d('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0xc51d('0x19'),'event':_0xc51d('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc51d('0x1a'),'model':_0xc51d('0x1b'),'event':_0xc51d('0x6'),'condition':_0xc51d('0xb'),'callback':afterCreateMessage}];function request(_0x4685e6){return client[_0xc51d('0x1c')](_0xc51d('0x1d'),_0x4685e6)['then'](function(_0x4f60c9){logger[_0xc51d('0x1e')]('Trigger,\x20%s',_0xc51d('0x1d'),_0x4f60c9);if(_0x4f60c9['error']){if(_0x4f60c9[_0xc51d('0x1f')][_0xc51d('0x20')]===0x1f4){logger[_0xc51d('0x1f')](_0xc51d('0x21'),_0xc51d('0x1d'),_0x4f60c9['error']);}}})['catch'](function(_0x413818){logger[_0xc51d('0x1f')]('Trigger,\x20%s',_0xc51d('0x1d'),_0x413818);});}function afterCreateMessage(_0xb107fe){return function(_0x3ebfda){_0x3ebfda=_0x3ebfda[_0xc51d('0x22')]({'plain':!![]});_0x3ebfda[_0xc51d('0x23')]=_0xb107fe;_0x3ebfda[_0xc51d('0x24')]=_0xb107fe;_0x3ebfda[_0xc51d('0x25')]=_0x3ebfda[_0xc51d('0x26')];Promise[_0xc51d('0x27')]()[_0xc51d('0x28')](function(){if(typeof _0x3ebfda[_0xc51d('0x29')]===_0xc51d('0x2a'))return null;var _0x3ea037=_0xc51d('0x2b')+_0x3ebfda[_0xc51d('0x29')];return db[_0xc51d('0x2c')][_0xc51d('0x2d')](_0x3ea037,{'type':db[_0xc51d('0x2e')][_0xc51d('0x2f')]['SELECT'],'raw':!![]});})[_0xc51d('0x28')](function(_0x5959f0){if(_0x5959f0){_0x3ebfda['contact']=_0x5959f0[0x0];}if(typeof _0x3ebfda[_0xc51d('0x30')]==='undefined')return;return getAgent(_0x3ebfda[_0xc51d('0x30')]);})[_0xc51d('0x28')](function(_0x3be64f){if(_0x3be64f){_0x3ebfda['interface']=util[_0xc51d('0x31')]('SIP/%s',_0x3be64f['name']);_0x3ebfda[_0xc51d('0x32')]=_0x3be64f;_0x3ebfda[_0xc51d('0x23')]=_0xb107fe;return request({'event':_0xc51d('0x33'),'message':_0x3ebfda});}else{return request({'event':_0xc51d('0x34'),'message':_0x3ebfda});}})['catch'](function(_0x8eec3d){logger[_0xc51d('0x1f')](_0xc51d('0x21'),'AfterCreateMessage',_0x8eec3d);});};}function afterCreateOfflineMessage(_0x4d9333){return function(_0x3fb8fc){_0x3fb8fc=_0x3fb8fc[_0xc51d('0x22')]({'plain':!![]});_0x3fb8fc[_0xc51d('0x23')]=_0x4d9333;_0x3fb8fc[_0xc51d('0x24')]=_0x4d9333;_0x3fb8fc[_0xc51d('0x25')]=_0xc51d('0x35');return request({'event':_0x3fb8fc[_0xc51d('0x25')],'message':_0x3fb8fc});};}function afterCreate(_0x59ac20,_0x419f97){return function(_0x4fca73){_0x4fca73=_0x4fca73['get']({'plain':!![]});_0x4fca73[_0xc51d('0x23')]=_0x59ac20;_0x4fca73['motionChannel']=_0x59ac20;_0x4fca73[_0xc51d('0x25')]=_0xc51d('0x36');Promise[_0xc51d('0x27')]()[_0xc51d('0x28')](function(){var _0x19656a=_0xc51d('0x2b')+_0x4fca73[_0xc51d('0x29')];return db[_0xc51d('0x2c')][_0xc51d('0x2d')](_0x19656a,{'type':db['Sequelize'][_0xc51d('0x2f')][_0xc51d('0x37')],'raw':!![]});})[_0xc51d('0x28')](function(_0x539a7c){if(_0x539a7c){_0x4fca73[_0xc51d('0x38')]=_0x539a7c[0x0];}if(typeof _0x4fca73[_0xc51d('0x30')]===_0xc51d('0x2a'))return;return getAgent(_0x4fca73['UserId']);})[_0xc51d('0x28')](function(_0x36be16){if(_0x36be16){_0x4fca73[_0xc51d('0x39')]=util[_0xc51d('0x31')](_0xc51d('0x3a'),_0x36be16[_0xc51d('0x3b')]);_0x4fca73[_0xc51d('0x32')]=_0x36be16;}return request({'event':_0x419f97,'message':_0x4fca73});})[_0xc51d('0x3c')](function(_0x19cf13){logger[_0xc51d('0x1f')](_0xc51d('0x21'),_0xc51d('0x3d'),_0x19cf13);});};}function afterUpdate(_0x19de7e){return function(_0x748c39){var _0x4b6d2e=_0x748c39[_0xc51d('0x3e')](_0xc51d('0x3f'))&&_0x748c39['closed'];var _0x4fc151=_0x748c39[_0xc51d('0x3e')]('substatus');if(_0x4b6d2e||_0x4fc151){var _0x4fec5e=_0x4b6d2e?_0xc51d('0xa'):'substatus';var _0x4b21ee=_0x748c39['get']({'plain':!![]});_0x4b21ee[_0xc51d('0x23')]=_0x19de7e;_0x4b21ee[_0xc51d('0x24')]=_0x19de7e;_0x4b21ee[_0xc51d('0x25')]=_0x4b6d2e?_0xc51d('0x3f'):_0xc51d('0x40');var _0x13c831=_0xc51d('0x2b')+_0x4b21ee[_0xc51d('0x29')];return db['sequelize'][_0xc51d('0x2d')](_0x13c831,{'type':db[_0xc51d('0x2e')][_0xc51d('0x2f')]['SELECT'],'raw':!![]})[_0xc51d('0x28')](function(_0x3f4802){if(_0x3f4802){_0x4b21ee[_0xc51d('0x38')]=_0x3f4802[0x0];}if(typeof _0x4b21ee[_0xc51d('0x30')]==='undefined')return;return getAgent(_0x4b21ee['UserId']);})[_0xc51d('0x28')](function(_0x58ba86){if(_0x58ba86){_0x4b21ee['interface']=util[_0xc51d('0x31')]('SIP/%s',_0x58ba86[_0xc51d('0x3b')]);_0x4b21ee['agent']=_0x58ba86;}return request({'event':_0x4fec5e,'message':_0x4b21ee});})[_0xc51d('0x3c')](function(_0x38d47d){logger['error'](_0xc51d('0x21'),_0xc51d('0x41'),_0x38d47d);});}};}function getAgent(_0x2f0ab2){return db[_0xc51d('0x42')]['find']({'where':{'id':_0x2f0ab2},'attributes':['id',_0xc51d('0x3b'),_0xc51d('0x43'),_0xc51d('0x44'),'internal'],'raw':!![]})[_0xc51d('0x28')](function(_0x2da05b){return _0x2da05b;});}exports['default']=function(){for(var _0x49442e=0x0;_0x49442e=_0x1497e0[_0x60f4('0x14')]){throw Error(_0x60f4('0x15'));}_0x49ed1c(_0x41665f);})[_0x60f4('0x16')](function(_0x491fe5){_0x433f7b(_0x491fe5);});});}; \ No newline at end of file +var _0x5e51=['catch','bluebird','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x3bbed0,_0x19aec6){var _0x566e88=function(_0x3c5b33){while(--_0x3c5b33){_0x3bbed0['push'](_0x3bbed0['shift']());}};_0x566e88(++_0x19aec6);}(_0x5e51,0x181));var _0x15e5=function(_0x1bf8cc,_0x118778){_0x1bf8cc=_0x1bf8cc-0x0;var _0x322d20=_0x5e51[_0x1bf8cc];return _0x322d20;};'use strict';var _=require('lodash');var BPromise=require(_0x15e5('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x15e5('0x1'));var channels=[_0x15e5('0x2'),_0x15e5('0x3'),_0x15e5('0x4'),_0x15e5('0x5'),_0x15e5('0x6'),_0x15e5('0x7'),_0x15e5('0x8')];exports[_0x15e5('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x2fbe52){_0x2fbe52=_0x2fbe52[_0x15e5('0xa')]();return _[_0x15e5('0xb')](channels,_0x2fbe52);};exports[_0x15e5('0xc')]=function(_0x19757f,_0x311a97,_0x1288de,_0x66cb3c){var _0xdbb7eb={'loginAttempts':_0x311a97,'blocked':_0x1288de};if(!_['isUndefined'](_0x66cb3c)){_0xdbb7eb[_0x15e5('0xd')]=_0x66cb3c;}return _0x19757f[_0x15e5('0xe')](_0xdbb7eb);};exports[_0x15e5('0xf')]=function(_0x2317ab){return new BPromise(function(_0x411731,_0x5def47){var _0x1f6eb2=0x0;if(_0x2317ab[_0x15e5('0x10')]!==_0x15e5('0x11')){_0x411731(_0x2317ab);}db[_0x15e5('0x12')][_0x15e5('0x13')]({'where':{'role':_0x15e5('0x11'),'online':!![],'id':{'$ne':_0x2317ab['id']}}})[_0x15e5('0x14')](function(_0x30d0e8){_0x1f6eb2=_0x30d0e8;return util[_0x15e5('0xf')]();})[_0x15e5('0x14')](function(_0x519188){if(_0x519188&&_0x519188['agents']&&_0x1f6eb2>=_0x519188[_0x15e5('0x15')]){throw Error(_0x15e5('0x16'));}_0x411731(_0x2317ab);})[_0x15e5('0x17')](function(_0x25d2c8){_0x5def47(_0x25d2c8);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 6472c2c..257f182 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['error','stack','status','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval'];(function(_0x9817f8,_0x1ca7ed){var _0x157f66=function(_0x1cefa8){while(--_0x1cefa8){_0x9817f8['push'](_0x9817f8['shift']());}};_0x157f66(++_0x1ca7ed);}(_0xbec5,0xe5));var _0x5bec=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0xbec5[_0x445c98];return _0x2fe913;};'use strict';var util=require(_0x5bec('0x0'));var logger=require(_0x5bec('0x1'))('api');var APIError=function(_0x1d4842,_0x38c81a){this[_0x5bec('0x2')]=_0x1d4842||_0x5bec('0x3');this[_0x5bec('0x4')]=_0x38c81a||'Error';util[_0x5bec('0x5')](APIError,Error);};var APIBadRequestError=function(_0x376cdb){this[_0x5bec('0x2')]=_0x376cdb||'Bad\x20Request';this[_0x5bec('0x4')]=_0x5bec('0x6');util[_0x5bec('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x406e65){this[_0x5bec('0x2')]=_0x406e65||_0x5bec('0x7');this[_0x5bec('0x4')]=_0x5bec('0x8');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x41a827){switch(_0x41a827){case'Bad\x20Request':return 0x190;case _0x5bec('0x9'),_0x5bec('0xa'):return 0x193;case _0x5bec('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a5482){return function(_0x288d1b){logger[_0x5bec('0xb')](_0x288d1b[_0x5bec('0xc')]);var _0x57ffc4=getStatusCode(_0x288d1b[_0x5bec('0x4')]);if(_0x288d1b[_0x5bec('0x4')])delete _0x288d1b['name'];return _0x4a5482[_0x5bec('0xd')](_0x57ffc4)[_0x5bec('0xe')](_0x288d1b);};}module[_0x5bec('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x0713=['Not\x20Found','Forbidden','OutOfInterval','error','stack','status','exports','api','message','Internal\x20Server\x20Error','Error','inherits','Bad\x20Request','name','Entity\x20not\x20found'];(function(_0x515aa1,_0x444e1c){var _0x5723f0=function(_0x4d2eb0){while(--_0x4d2eb0){_0x515aa1['push'](_0x515aa1['shift']());}};_0x5723f0(++_0x444e1c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x3071('0x0'));var APIError=function(_0x2afa91,_0x27405a){this[_0x3071('0x1')]=_0x2afa91||_0x3071('0x2');this['name']=_0x27405a||_0x3071('0x3');util[_0x3071('0x4')](APIError,Error);};var APIBadRequestError=function(_0x33a70c){this[_0x3071('0x1')]=_0x33a70c||_0x3071('0x5');this[_0x3071('0x6')]=_0x3071('0x5');util[_0x3071('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xbd737f){this[_0x3071('0x1')]=_0xbd737f||_0x3071('0x7');this[_0x3071('0x6')]=_0x3071('0x8');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x3457cd){switch(_0x3457cd){case _0x3071('0x5'):return 0x190;case _0x3071('0x9'),_0x3071('0xa'):return 0x193;case _0x3071('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a470a){return function(_0x2ace21){logger[_0x3071('0xb')](_0x2ace21[_0x3071('0xc')]);var _0x3ed4a0=getStatusCode(_0x2ace21[_0x3071('0x6')]);if(_0x2ace21['name'])delete _0x2ace21['name'];return _0x4a470a[_0x3071('0xd')](_0x3ed4a0)['send'](_0x2ace21);};}module[_0x3071('0xe')]={'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 7651258..249e672 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ef=['exports','404','status','send'];(function(_0x15ebfd,_0xbc1af8){var _0x268375=function(_0x32992b){while(--_0x32992b){_0x15ebfd['push'](_0x15ebfd['shift']());}};_0x268375(++_0xbc1af8);}(_0x62ef,0xd0));var _0xf62e=function(_0x125a8a,_0x490d31){_0x125a8a=_0x125a8a-0x0;var _0xe767a5=_0x62ef[_0x125a8a];return _0xe767a5;};'use strict';module[_0xf62e('0x0')][0x194]=function pageNotFound(_0x162465,_0x3182ed){var _0x5cad8f=_0xf62e('0x1');var _0x1cf337=0x194;var _0x57e2db={'status':_0x1cf337};_0x3182ed[_0xf62e('0x2')](_0x57e2db[_0xf62e('0x2')]);_0x3182ed['render'](_0x5cad8f,{},function(_0x421ca7,_0x3bb616){if(_0x421ca7){return _0x3182ed[_0xf62e('0x2')](_0x57e2db['status'])['json'](_0x57e2db);}_0x3182ed[_0xf62e('0x3')](_0x3bb616);});}; \ No newline at end of file +var _0x0a01=['render','json','exports','404','status'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x0a01,0x156));var _0x10a0=function(_0x453bf1,_0x3cca87){_0x453bf1=_0x453bf1-0x0;var _0x53b216=_0x0a01[_0x453bf1];return _0x53b216;};'use strict';module[_0x10a0('0x0')][0x194]=function pageNotFound(_0x377c8f,_0x133e83){var _0x2f1268=_0x10a0('0x1');var _0x4008a4=0x194;var _0xe817f4={'status':_0x4008a4};_0x133e83['status'](_0xe817f4[_0x10a0('0x2')]);_0x133e83[_0x10a0('0x3')](_0x2f1268,{},function(_0x3ccee5,_0x2a05d8){if(_0x3ccee5){return _0x133e83[_0x10a0('0x2')](_0xe817f4[_0x10a0('0x2')])[_0x10a0('0x4')](_0xe817f4);}_0x133e83['send'](_0x2a05d8);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index aef091f..bc1f518 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde5c=['VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','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','ChatQueue','ChatGroup','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../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','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','../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','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','UserId','UserSetting','userSetting','cascade','Recordings','hasMany','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoicePrefixes','ChatQueues','SmsQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','MailServerIn','CloudProvider','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','IntervalId','DashboardItem','Items','FaxAccountId','Exntensions','FaxQueue','TagId','Tags','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','CmContactId','JscriptySessions','OpenchannelInteractions','cm_contact_has_tags','AdditionalPhones','Campaign','CampaignId','OwnerId','Condition','All','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ContactItemType','Hopper','CmHopperId','Trigger','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','FieldId','Description','DescriptionId','VariableId','SugarcrmField','Subjects','Subject','Field','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','Dynamics365Field','FromId','ToId','SessionId','ProjectId','VoiceQueues','TeamVoicePrefix','TrunkId','SquareProjectId','Lists','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','lodash','jstz','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','sequelize','username','password','options','database','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../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','../api/screenRecording/screenRecording.model'];(function(_0x76f12d,_0x4f8dcb){var _0x559167=function(_0x14b76b){while(--_0x14b76b){_0x76f12d['push'](_0x76f12d['shift']());}};_0x559167(++_0x4f8dcb);}(_0xde5c,0x1e2));var _0xcde5=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xde5c[_0x3b3210];return _0x5b5484;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xcde5('0x0'));var jstz=require(_0xcde5('0x1'));var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config['sequelize'],{'database':_0xcde5('0x2'),'username':_0xcde5('0x3'),'password':_0xcde5('0x4'),'options':{'host':_0xcde5('0x5'),'port':0xcea,'dialect':_0xcde5('0x6'),'dialectOptions':{'charset':_0xcde5('0x7')},'logging':![],'timezone':timezone[_0xcde5('0x8')](),'define':{'charset':_0xcde5('0x9'),'collate':_0xcde5('0xa')}}});config[_0xcde5('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xcde5('0x2'),'username':_0xcde5('0x3'),'password':'xC@LL1234','options':{'host':_0xcde5('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcde5('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xcde5('0x9'),'collate':_0xcde5('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcde5('0xc')]['database'],config['sequelize'][_0xcde5('0xd')],config['sequelize'][_0xcde5('0xe')],config[_0xcde5('0xc')][_0xcde5('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xcde5('0x10')],config[_0xcde5('0xb')][_0xcde5('0xd')],config[_0xcde5('0xb')]['password'],config[_0xcde5('0xb')]['options'])};db[_0xcde5('0x11')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x13'));db[_0xcde5('0x14')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x15'));db['VoiceContext']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x16'));db[_0xcde5('0x17')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x18'));db[_0xcde5('0x19')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x1a'));db[_0xcde5('0x1b')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x1c'));db[_0xcde5('0x1d')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x1e'));db[_0xcde5('0x1f')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x20'));db[_0xcde5('0x21')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x22'));db[_0xcde5('0x23')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x24'));db[_0xcde5('0x25')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x26'));db[_0xcde5('0x27')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x28'));db[_0xcde5('0x29')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xcde5('0x2a')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x2b'));db[_0xcde5('0x2c')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x2d'));db[_0xcde5('0x2e')]=db[_0xcde5('0xc')]['import']('../api/trunk/trunk.model');db[_0xcde5('0x2f')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xcde5('0x30')]=db['sequelize'][_0xcde5('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xcde5('0x31')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x32'));db[_0xcde5('0x33')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0xcde5('0x34')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x35'));db[_0xcde5('0x36')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x37'));db[_0xcde5('0x38')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0xcde5('0x39')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x3a'));db[_0xcde5('0x3b')]=db[_0xcde5('0xc')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3c'));db['MailServerOut']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3d'));db['MailAccount']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/mailAccount/mailAccount.model');db[_0xcde5('0x3e')]=db[_0xcde5('0xc')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3f'));db[_0xcde5('0x40')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x41'));db['MailMessage']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x42'));db[_0xcde5('0x43')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x44'));db[_0xcde5('0x45')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0xcde5('0x46')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x47'));db['DashboardItem']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x48'));db[_0xcde5('0x49')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x4a'));db[_0xcde5('0x4b')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4c'));db['FaxInteraction']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4d'));db[_0xcde5('0x4e')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4f'));db['FaxQueue']=db[_0xcde5('0xc')]['import']('../api/faxQueue/faxQueue.model');db[_0xcde5('0x50')]=db['sequelize'][_0xcde5('0x12')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x51'));db['SmsApplication']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x52'));db[_0xcde5('0x53')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x54'));db['SmsMessage']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/smsMessage/smsMessage.model');db[_0xcde5('0x55')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/smsQueue/smsQueue.model');db[_0xcde5('0x56')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x57'));db['OpenchannelApplication']=db[_0xcde5('0xc')]['import'](_0xcde5('0x58'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xcde5('0x59'));db[_0xcde5('0x5a')]=db['sequelize']['import'](_0xcde5('0x5b'));db[_0xcde5('0x5c')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x5d'));db[_0xcde5('0x5e')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x5f'));db['OpenchannelQueueReport']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x60'));db[_0xcde5('0x61')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x62'));db[_0xcde5('0x63')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x64'));db[_0xcde5('0x65')]=db['sequelize']['import'](_0xcde5('0x66'));db[_0xcde5('0x67')]=db[_0xcde5('0xc')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xcde5('0x68')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/chatQueue/chatQueue.model');db[_0xcde5('0x69')]=db['sequelize'][_0xcde5('0x12')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xcde5('0xc')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xcde5('0x6a')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6b'));db[_0xcde5('0x6c')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x6d'));db['CmHopperBlack']=db[_0xcde5('0xc')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6e'));db['CmHopperHistory']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6f'));db['ReportAgentPreview']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xcde5('0x70')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x71'));db[_0xcde5('0x72')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x73'));db[_0xcde5('0x74')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x75'));db[_0xcde5('0x76')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x77'));db['Condition']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/condition/condition.model');db['Interval']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x78'));db[_0xcde5('0x79')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/pause/pause.model');db[_0xcde5('0x7a')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cdr/cdr.model');db[_0xcde5('0x7b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x7c'));db[_0xcde5('0x7d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x7e'));db[_0xcde5('0x7f')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x80'));db['Tag']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x81'));db['ContactItemType']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x82'));db[_0xcde5('0x83')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x84'));db[_0xcde5('0x85')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x86'));db[_0xcde5('0x87')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x88'));db['Trigger']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x89'));db[_0xcde5('0x8a')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/variable/variable.model');db[_0xcde5('0x8b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x8c'));db[_0xcde5('0x8d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x8e'));db[_0xcde5('0x8f')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xcde5('0x90')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x91'));db[_0xcde5('0x92')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x93'));db[_0xcde5('0x94')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0xcde5('0x95')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xcde5('0xc')]['import'](_0xcde5('0x96'));db[_0xcde5('0x97')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x98'));db[_0xcde5('0x99')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x9a'));db[_0xcde5('0x9b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x9c'));db[_0xcde5('0x9d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x9e'));db[_0xcde5('0x9f')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xa0'));db['SugarcrmField']=db['sequelize']['import'](_0xcde5('0xa1'));db[_0xcde5('0xa2')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xa3'));db[_0xcde5('0xa4')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xa5'));db['DeskField']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xa6'));db[_0xcde5('0xa7')]=db['sequelize']['import'](_0xcde5('0xa8'));db['ZohoConfiguration']=db[_0xcde5('0xc')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xcde5('0xa9')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xaa'));db[_0xcde5('0xab')]=db[_0xcde5('0xc')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xac'));db['ZendeskField']=db[_0xcde5('0xc')]['import'](_0xcde5('0xad'));db['FreshdeskAccount']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xae'));db[_0xcde5('0xaf')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb0'));db[_0xcde5('0xb1')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb2'));db[_0xcde5('0xb3')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb4'));db[_0xcde5('0xb5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb6'));db[_0xcde5('0xb7')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xb8'));db[_0xcde5('0xb9')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xba'));db['ServicenowConfiguration']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbb'));db[_0xcde5('0xbc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbd'));db['Dynamics365Account']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xcde5('0xbe')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbf'));db['Dynamics365Field']=db['sequelize']['import'](_0xcde5('0xc0'));db[_0xcde5('0xc1')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xc2'));db[_0xcde5('0xc3')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xc4'));db[_0xcde5('0xc5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xc6'));db[_0xcde5('0x8b')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x8c'));db['Network']=db[_0xcde5('0xc')]['import'](_0xcde5('0xc7'));db[_0xcde5('0xc8')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xc9'));db[_0xcde5('0xca')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xcb'));db[_0xcde5('0xcc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xcd'));db[_0xcde5('0xce')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xcde5('0xcf')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xd0'));db[_0xcde5('0xd1')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xd2'));db[_0xcde5('0xd3')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/squareReport/squareReport.model');db[_0xcde5('0xd4')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xd5'));db[_0xcde5('0xd6')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xd7'));db[_0xcde5('0xd8')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/setting/setting.model');db[_0xcde5('0xd9')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/squareOdbc/squareOdbc.model');db[_0xcde5('0xda')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xdb'));db[_0xcde5('0xdc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xdd'));db[_0xcde5('0xde')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xdf'));db[_0xcde5('0xe0')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xe1'));db[_0xcde5('0xe2')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe3'));db['Campaign']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/campaign/campaign.model');db[_0xcde5('0xe4')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xe5'));db['Attachment']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe6'));db['Plugin']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/plugin/plugin.model');db[_0xcde5('0xe7')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe8'));db[_0xcde5('0xe9')]=db['sequelize'][_0xcde5('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0xcde5('0xea')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xeb'));db[_0xcde5('0xec')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xed'));db[_0xcde5('0xee')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xef'));db[_0xcde5('0xf0')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf1'));db[_0xcde5('0xf2')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0xcde5('0xf3')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf4'));db[_0xcde5('0xf5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf6'));db['UserProfileResource']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf7'));db[_0xcde5('0xf8')]=db['sequelize'][_0xcde5('0x12')]('../api/userNotification/userNotification.model');db[_0xcde5('0xf9')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xfa'));db['WhatsappApplication']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xfb'));db[_0xcde5('0xfc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xfd'));db[_0xcde5('0xfe')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xff'));db[_0xcde5('0x100')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x101'));db['WhatsappTransferReport']=db['sequelize'][_0xcde5('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xcde5('0x102')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x103'));db['CloudProvider']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x104'));db['TeamVoicePrefix']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x105'));db[_0xcde5('0x106')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x107'));db['UserSetting']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x108'));db['User'][_0xcde5('0x109')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x109')](db[_0xcde5('0x10b')],{'as':_0xcde5('0x10c'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x10a')});db['User']['hasMany'](db[_0xcde5('0x1d')],{'as':_0xcde5('0x10e'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x110'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')]['hasMany'](db[_0xcde5('0x113')],{'as':'HopperHistory','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db['ReportAgentPreview'],{'as':_0xcde5('0x114'),'foreignKey':_0xcde5('0x10a')});db['User'][_0xcde5('0x10f')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x63')],{'as':_0xcde5('0x115'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x53')],{'as':_0xcde5('0x116'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')]['hasMany'](db[_0xcde5('0x117')],{'as':_0xcde5('0x118'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'foreignKey':_0xcde5('0x10a')});db['User'][_0xcde5('0x10f')](db[_0xcde5('0xfc')],{'as':'WhatsappInteractions','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db['UserNotification'],{'as':_0xcde5('0x11a'),'foreignKey':_0xcde5('0x11b')});db[_0xcde5('0x11')][_0xcde5('0x11c')](db[_0xcde5('0xf3')],{'as':_0xcde5('0xf3'),'foreignKey':_0xcde5('0x11d')});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x69')],{'as':_0xcde5('0x11f'),'through':_0xcde5('0x120')});db['User']['belongsToMany'](db['CmContact'],{'as':'Contacts','through':_0xcde5('0x121')});db['User']['belongsToMany'](db[_0xcde5('0xf0')],{'as':'Lists','through':_0xcde5('0x122')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x123')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'through':_0xcde5('0x124')});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0x63')],{'as':'ChatInteractions','through':_0xcde5('0x125')});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0x117')],{'as':'FaxInteractions','through':_0xcde5('0x126')});db['User'][_0xcde5('0x11e')](db['SmsInteraction'],{'as':_0xcde5('0x116'),'through':_0xcde5('0x127')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x128')],{'as':'OpenchannelInteractions','through':_0xcde5('0x129')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['WhatsappInteraction'],{'as':_0xcde5('0x12a'),'through':_0xcde5('0x12b')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x1b')],{'as':'VoiceQueues','through':_0xcde5('0x31'),'required':![]});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0xf2')],{'as':_0xcde5('0x12c'),'through':_0xcde5('0x106'),'required':![]});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x3e')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x68')],{'as':_0xcde5('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['FaxQueue'],{'as':'FaxQueues','through':_0xcde5('0x36'),'required':![]});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x55')],{'as':_0xcde5('0x12e'),'through':_0xcde5('0x38'),'required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x5c')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db['User']['belongsToMany'](db['WhatsappQueue'],{'as':_0xcde5('0x12f'),'through':_0xcde5('0x3b'),'required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xf0')],{'through':_0xcde5('0x122')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x130'),'through':_0xcde5('0x131')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['FaxAccount'],{'as':_0xcde5('0x132'),'through':_0xcde5('0x133')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x134')],{'as':_0xcde5('0x135'),'through':_0xcde5('0x136')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x137')],{'as':_0xcde5('0x138'),'through':'user_has_sms_accounts'});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xf9')],{'as':_0xcde5('0x139'),'through':_0xcde5('0x13a')});db[_0xcde5('0x14')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x13b'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x13c')});db[_0xcde5('0x13d')][_0xcde5('0x10f')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xcde5('0x17')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Applications','onDelete':_0xcde5('0x10d')});db[_0xcde5('0x19')][_0xcde5('0x11e')](db[_0xcde5('0x7f')],{'as':_0xcde5('0x13e'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0xcde5('0x13f'),'foreignKey':_0xcde5('0x140')});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x141')],{'as':_0xcde5('0x142'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x140')});db['VoiceQueue'][_0xcde5('0x10f')](db['CmHopperHistory'],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x140')});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':_0xcde5('0x114'),'foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x144')],{'as':_0xcde5('0x145'),'foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db['VoiceQueue'][_0xcde5('0x11c')](db[_0xcde5('0x2e')],{'as':_0xcde5('0x146'),'foreignKey':_0xcde5('0x147')});db[_0xcde5('0x1b')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':'IntervalId'});db[_0xcde5('0x1b')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x1b')][_0xcde5('0x11e')](db['CmList'],{'as':'Lists','through':_0xcde5('0x14b')});db['VoiceQueue'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x31')});db[_0xcde5('0x1b')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'as':_0xcde5('0x14d'),'through':_0xcde5('0x14e')});db['VoiceQueue'][_0xcde5('0x11e')](db['CmList'],{'as':_0xcde5('0x14f'),'through':_0xcde5('0x150')});db[_0xcde5('0x1d')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x1f')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':'User','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x21')][_0xcde5('0x10f')](db[_0xcde5('0x23')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x152'),'sourceKey':_0xcde5('0x153')});db['VoiceMailMessage'][_0xcde5('0x11c')](db['VoiceMail'],{'foreignKey':_0xcde5('0x152'),'targetKey':'mailbox'});db['VoiceCallReport'][_0xcde5('0x10f')](db[_0xcde5('0x2a')],{'as':_0xcde5('0x154'),'foreignKey':_0xcde5('0x155'),'constraints':![]});db['VoiceCallReport'][_0xcde5('0x10f')](db[_0xcde5('0x29')],{'as':_0xcde5('0x156'),'foreignKey':_0xcde5('0x155'),'constraints':![]});db['VoiceCallReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xcde5('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0xcde5('0x157')});db['MailServerIn'][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x134'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x159')][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':_0xcde5('0x15b'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x15d')]['belongsTo'](db[_0xcde5('0x134')],{'as':'MailAccount','foreignKey':_0xcde5('0x158')});db['MailServerOut'][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':'CloudProviderId','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x134')][_0xcde5('0x109')](db[_0xcde5('0x159')],{'as':_0xcde5('0x15e'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x134')][_0xcde5('0x109')](db[_0xcde5('0x15d')],{'as':_0xcde5('0x15f'),'onDelete':_0xcde5('0x10d')});db['MailAccount'][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x158'),'onDelete':'cascade'});db['MailAccount'][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x134')][_0xcde5('0x10f')](db[_0xcde5('0x163')],{'as':'Messages','foreignKey':_0xcde5('0x158')});db[_0xcde5('0x134')][_0xcde5('0x10f')](db[_0xcde5('0x40')],{'as':_0xcde5('0x164')});db[_0xcde5('0x134')]['hasMany'](db['MailApplication'],{'as':_0xcde5('0x165')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db[_0xcde5('0x87')],{'as':_0xcde5('0x87'),'foreignKey':_0xcde5('0x168')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db['Pause'],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x134')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcde5('0x136')});db[_0xcde5('0x3e')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x34')});db[_0xcde5('0x3e')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x169'),'as':_0xcde5('0x14d')});db['MailInteraction'][_0xcde5('0x10f')](db[_0xcde5('0x163')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x16a')});db[_0xcde5('0x40')]['belongsTo'](db['MailAccount'],{'as':_0xcde5('0x16b'),'foreignKey':'MailAccountId'});db[_0xcde5('0x40')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x40')]['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db['MailInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x16f'),'as':'Tags'});db['MailInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x16f'),'as':_0xcde5('0x170')});db[_0xcde5('0x40')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x124'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xcde5('0x10f')](db[_0xcde5('0x172')],{'as':_0xcde5('0x173'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{'as':_0xcde5('0x174'),'foreignKey':_0xcde5('0x16a')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x5e'),'foreignKey':_0xcde5('0x175')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x67')],{'as':_0xcde5('0x67'),'foreignKey':_0xcde5('0x176')});db[_0xcde5('0x43')][_0xcde5('0x11c')](db['User'],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x43')]['belongsTo'](db[_0xcde5('0x3e')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x43')]['belongsTo'](db['MailAccount'],{'onDelete':_0xcde5('0x15c')});db['MailApplication'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x43')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'TagId'});db['MailQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x134')],{});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':'ListId'});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['CmContact'],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x45')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0xcde5('0x163')],{});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['User'],{});db['MailQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x3e')],{});db[_0xcde5('0x46')][_0xcde5('0x10f')](db[_0xcde5('0x178')],{'as':_0xcde5('0x179'),'onDelete':'cascade'});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x17a')});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x117')],{'as':_0xcde5('0x164')});db['FaxAccount'][_0xcde5('0x10f')](db['FaxApplication'],{'as':_0xcde5('0x165')});db['FaxAccount'][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x17b'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x49')]['hasMany'](db[_0xcde5('0x4e')],{'as':'Messages'});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0x2e')],{'as':_0xcde5('0x2e')});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':'ListId'});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x49')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x133')});db[_0xcde5('0x4b')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xcde5('0x17c')],{'onDelete':_0xcde5('0x15c')});db['FaxApplication'][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x4b')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x17d')});db[_0xcde5('0x117')][_0xcde5('0x10f')](db[_0xcde5('0x4e')],{'as':_0xcde5('0x151'),'onDelete':_0xcde5('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'as':_0xcde5('0x16b'),'foreignKey':'FaxAccountId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':'ContactId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':'UserId'});db[_0xcde5('0x117')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':'fax_interaction_has_tags','as':_0xcde5('0x17e')});db[_0xcde5('0x117')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x17f'),'as':_0xcde5('0x170')});db[_0xcde5('0x117')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x126'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x11')});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x117')],{'as':_0xcde5('0x174'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xcde5('0x172')],{'as':_0xcde5('0x172'),'foreignKey':_0xcde5('0x180')});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db['FaxAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x17a')});db['FaxQueue'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':'Agents','through':'UserFaxQueue'});db[_0xcde5('0x17c')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x181'),'as':_0xcde5('0x14d')});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x49')],{});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167')});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x117')],{});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x4e')],{});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{});db['FaxQueueReport']['belongsTo'](db[_0xcde5('0x17c')],{});db['SmsAccount'][_0xcde5('0x10f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcde5('0x182'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x137')][_0xcde5('0x10f')](db['CannedAnswer'],{'as':_0xcde5('0x162'),'foreignKey':'SmsAccountId'});db[_0xcde5('0x137')][_0xcde5('0x10f')](db[_0xcde5('0x183')],{'as':_0xcde5('0x151'),'foreignKey':_0xcde5('0x182')});db[_0xcde5('0x137')][_0xcde5('0x10f')](db[_0xcde5('0x53')],{'as':_0xcde5('0x164')});db[_0xcde5('0x137')]['hasMany'](db[_0xcde5('0x184')],{'as':_0xcde5('0x165')});db[_0xcde5('0x137')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x137')][_0xcde5('0x11c')](db['Pause'],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x137')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':'user_has_sms_accounts'});db[_0xcde5('0x184')][_0xcde5('0x11c')](db['User'],{'onDelete':'restrict'});db[_0xcde5('0x184')][_0xcde5('0x11c')](db[_0xcde5('0x55')],{'onDelete':'restrict'});db['SmsApplication'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x184')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db['SmsApplication'][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'TagId'});db[_0xcde5('0x53')][_0xcde5('0x10f')](db[_0xcde5('0x183')],{'as':_0xcde5('0x151'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x53')]['belongsTo'](db['SmsAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x182')});db['SmsInteraction']['belongsTo'](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['SmsInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x53')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':_0xcde5('0x185'),'as':_0xcde5('0x17e')});db['SmsInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x185'),'as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0xcde5('0x11')],{'as':'Users','through':_0xcde5('0x127'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x183')]['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db[_0xcde5('0x183')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db[_0xcde5('0x183')][_0xcde5('0x11c')](db['SmsInteraction'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x183')]['belongsTo'](db[_0xcde5('0x137')],{'as':'Account','foreignKey':_0xcde5('0x182')});db[_0xcde5('0x55')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x38'),'foreignKey':_0xcde5('0x186')});db[_0xcde5('0x55')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x187'),'as':_0xcde5('0x14d')});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':'Dispositions','foreignKey':_0xcde5('0x188'),'onDelete':'cascade'});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x128')],{'as':_0xcde5('0x164'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')]['hasMany'](db[_0xcde5('0x5a')],{'as':'Messages','foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')]['hasMany'](db[_0xcde5('0x189')],{'as':_0xcde5('0x165'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167')});db[_0xcde5('0x56')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':'mandatoryDispositionPause','foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x56')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x18a')});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x5c')],{'onDelete':'restrict','foreignKey':_0xcde5('0x18b')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'OpenchannelAccountId'});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x17d')});db[_0xcde5('0x128')][_0xcde5('0x10f')](db[_0xcde5('0x5a')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x18c')});db['OpenchannelInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x128')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['OpenchannelInteraction']['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':'UserId'});db[_0xcde5('0x128')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x18d'),'as':_0xcde5('0x17e')});db[_0xcde5('0x128')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x18d'),'as':_0xcde5('0x170')});db[_0xcde5('0x128')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x129'),'foreignKey':_0xcde5('0x18c')});db[_0xcde5('0x5a')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':'User'});db['OpenchannelMessage'][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c')});db[_0xcde5('0x5a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':_0xcde5('0x18c')});db[_0xcde5('0x5a')]['belongsTo'](db[_0xcde5('0x172')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xcde5('0x5a')]['belongsTo'](db[_0xcde5('0x56')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x5c')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x39'),'foreignKey':_0xcde5('0x18b')});db[_0xcde5('0x5c')]['belongsToMany'](db['Team'],{'through':_0xcde5('0x18e'),'as':_0xcde5('0x14d')});db['ChatWebsite'][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x175'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x76')],{'as':'Answers','foreignKey':_0xcde5('0x175')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x18f')],{'as':_0xcde5('0x190')});db[_0xcde5('0x5e')]['hasMany'](db['ChatInteraction'],{'as':_0xcde5('0x164')});db[_0xcde5('0x5e')][_0xcde5('0x10f')](db['ChatApplication'],{'as':_0xcde5('0x165')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x65')],{'as':'Messages'});db[_0xcde5('0x5e')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db['ChatWebsite'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':'IntervalId'});db[_0xcde5('0x5e')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x134'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x5e')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x131')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{});db['OpenchannelQueueReport'][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x128')],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x5a')],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db['User'],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x192'),'foreignKey':_0xcde5('0x10a'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x61')][_0xcde5('0x11c')](db[_0xcde5('0x68')],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x194'),'onDelete':_0xcde5('0x15c')});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':'restrict','foreignKey':_0xcde5('0x17d')});db['ChatInteraction'][_0xcde5('0x10f')](db[_0xcde5('0x65')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x195')});db[_0xcde5('0x63')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x175')});db['ChatInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcde5('0x63')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':'Owner','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x63')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':'chat_interaction_has_tags','as':_0xcde5('0x17e')});db[_0xcde5('0x63')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':_0xcde5('0x196'),'as':_0xcde5('0x170')});db[_0xcde5('0x63')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x125'),'foreignKey':_0xcde5('0x195')});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x11')});db['ChatMessage'][_0xcde5('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['ChatMessage'][_0xcde5('0x11c')](db[_0xcde5('0x63')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':'ChatInteractionId'});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x172')],{'as':_0xcde5('0x172'),'foreignKey':_0xcde5('0x180')});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x175')});db['ChatOfflineMessage'][_0xcde5('0x10f')](db[_0xcde5('0x172')],{'as':'Attachments','foreignKey':_0xcde5('0x176'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x67')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x67')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':'Account','foreignKey':_0xcde5('0x175')});db[_0xcde5('0x68')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x33'),'hooks':!![]});db[_0xcde5('0x68')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x197'),'as':_0xcde5('0x14d')});db[_0xcde5('0x69')][_0xcde5('0x10f')](db[_0xcde5('0xca')],{'as':_0xcde5('0x151'),'foreignKey':_0xcde5('0x198'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x69')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x13f'),'through':'chat_group_has_users'});db[_0xcde5('0x18f')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x199'),'foreignKey':_0xcde5('0x175')});db[_0xcde5('0x6a')][_0xcde5('0x10f')](db[_0xcde5('0x6c')],{'as':'Contacts','foreignKey':_0xcde5('0x19a')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x83')],{'as':'Phones','foreignKey':_0xcde5('0x19b')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x141')],{'as':_0xcde5('0x142'),'foreignKey':_0xcde5('0x157')});db['CmContact'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':'ContactId'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x113')],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x157')});db['CmContact'][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':'ReportAgentPreview','foreignKey':_0xcde5('0x157')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0xcf')],{'as':_0xcde5('0x19c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x128')],{'as':_0xcde5('0x19d'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x63')],{'as':'ChatInteractions','foreignKey':_0xcde5('0x157'),'onDelete':'restrict'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db['SmsInteraction'],{'as':_0xcde5('0x116'),'foreignKey':_0xcde5('0x157'),'onDelete':'restrict'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db['FaxInteraction'],{'as':_0xcde5('0x118'),'foreignKey':'ContactId','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')][_0xcde5('0x11c')](db[_0xcde5('0x6a')],{'as':'Company','foreignKey':_0xcde5('0x19a')});db[_0xcde5('0x6c')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0xcde5('0x11')],{'as':'Users','through':_0xcde5('0x121')});db['CmContact'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xcde5('0x6c')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x19e'),'as':_0xcde5('0x170')});db[_0xcde5('0x141')][_0xcde5('0x10f')](db[_0xcde5('0x85')],{'as':_0xcde5('0x19f'),'foreignKey':'CmHopperId'});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':'ListId','onDelete':_0xcde5('0x10d')});db['CmHopper'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x192'),'foreignKey':_0xcde5('0x10a')});db['CmHopper'][_0xcde5('0x11c')](db[_0xcde5('0x1b')],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x140'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x1a0')],{'as':_0xcde5('0x1a0'),'foreignKey':_0xcde5('0x1a1'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x1a2')});db[_0xcde5('0x144')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x10d')});db['CmHopperBlack'][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167'),'onDelete':'cascade'});db[_0xcde5('0x144')][_0xcde5('0x11c')](db['VoiceQueue'],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x140'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xcde5('0x1a0'),'foreignKey':_0xcde5('0x1a1'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x74')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':_0xcde5('0x1a4'),'singular':_0xcde5('0x1a5')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xcde5('0x74')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':'Any','singular':_0xcde5('0x1a6')},'foreignKey':_0xcde5('0x1a7'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0xcde5('0x1a8'),'foreignKey':_0xcde5('0x1a9'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x160')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x1aa'),'onDelete':_0xcde5('0x10d')});db['Interval']['hasMany'](db[_0xcde5('0x148')],{'as':'Intervals','foreignKey':_0xcde5('0x177'),'onDelete':_0xcde5('0x10d'),'hooks':!![],'required':![]});db[_0xcde5('0x148')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Extensions','foreignKey':_0xcde5('0x177'),'onDelete':_0xcde5('0x15c')});db['Interval'][_0xcde5('0x10f')](db[_0xcde5('0x43')],{'as':_0xcde5('0x1ab'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x148')][_0xcde5('0x10f')](db['ChatApplication'],{'as':_0xcde5('0x1ac'),'foreignKey':'IntervalId'});db[_0xcde5('0x148')]['hasMany'](db['FaxApplication'],{'as':_0xcde5('0x1ad'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x148')][_0xcde5('0x10f')](db[_0xcde5('0x184')],{'as':_0xcde5('0x1ae'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x7d')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{});db[_0xcde5('0x7d')]['belongsTo'](db[_0xcde5('0x90')],{'foreignKey':_0xcde5('0x1af')});db['Schedule'][_0xcde5('0x11c')](db[_0xcde5('0x8f')],{'foreignKey':_0xcde5('0x1b0')});db['Sound'][_0xcde5('0x11e')](db[_0xcde5('0x19')],{'as':_0xcde5('0x1b1'),'through':_0xcde5('0x1b2'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['CmContact'],{'through':_0xcde5('0x19e')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['ChatInteraction'],{'through':_0xcde5('0x196')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db[_0xcde5('0x40')],{'through':'mail_interaction_has_tags'});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x53')],{'through':_0xcde5('0x185')});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x117')],{'through':_0xcde5('0x17f')});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x128')],{'through':_0xcde5('0x18d')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['WhatsappInteraction'],{'through':_0xcde5('0x1b3')});db[_0xcde5('0x83')][_0xcde5('0x11c')](db[_0xcde5('0x1b4')],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0xcde5('0x85')]['belongsTo'](db[_0xcde5('0x141')],{'as':_0xcde5('0x1b5'),'foreignKey':_0xcde5('0x1b6')});db[_0xcde5('0x83')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x19b')});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':'AllConditions','singular':_0xcde5('0x1b8')},'foreignKey':'TriggerAllId','onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':_0xcde5('0x1b9'),'singular':_0xcde5('0x1ba')},'foreignKey':_0xcde5('0x1bb'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x72')],{'as':'Actions','foreignKey':_0xcde5('0x1bc'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x8f')]['hasMany'](db[_0xcde5('0x95')],{'as':'Fields','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1b0'),'hooks':!![]});db[_0xcde5('0x90')][_0xcde5('0x10f')](db[_0xcde5('0x95')],{'as':_0xcde5('0x1bd'),'onDelete':'cascade','foreignKey':_0xcde5('0x1af')});db[_0xcde5('0x94')][_0xcde5('0x10f')](db[_0xcde5('0x95')],{'as':'Fields','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1be')});db[_0xcde5('0x95')][_0xcde5('0x11c')](db[_0xcde5('0x94')],{'foreignKey':'MetricId'});db[_0xcde5('0x97')][_0xcde5('0x10f')](db[_0xcde5('0x99')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':'Subjects','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c1')});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x99')][_0xcde5('0x11c')](db['SalesforceAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x9b')][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x9b')][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x9b')]['hasMany'](db[_0xcde5('0x9b')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0x9b')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db['SugarcrmAccount'][_0xcde5('0x10f')](db['SugarcrmConfiguration'],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x9f')]['hasMany'](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1c8'),'onDelete':'cascade','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x9f')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':'Descriptions','onDelete':_0xcde5('0x10d'),'foreignKey':'DescriptionId'});db[_0xcde5('0x9f')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x9f')][_0xcde5('0x11c')](db[_0xcde5('0x9d')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1c7')]['hasMany'](db['SugarcrmField'],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1c7')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':'Description','foreignKey':_0xcde5('0x1c5')});db['SugarcrmField']['hasMany'](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1c7')]['belongsTo'](db[_0xcde5('0x8a')],{'as':'Variable','foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xa2')][_0xcde5('0x10f')](db[_0xcde5('0xa4')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0xa4')][_0xcde5('0x10f')](db['DeskField'],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0xa4')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xa4')]['hasMany'](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xa4')][_0xcde5('0x11c')](db[_0xcde5('0xa2')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xcde5('0x1cc')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db['DeskField'],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0x1cb')]['belongsTo'](db['Variable'],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xa7')][_0xcde5('0x10f')](db[_0xcde5('0x1cd')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db['ZohoField'],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1cd')][_0xcde5('0x11c')](db[_0xcde5('0xa7')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db['ZohoField']['hasMany'](db[_0xcde5('0xa9')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xa9')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1c4'),'foreignKey':'DescriptionId'});db[_0xcde5('0xa9')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xa9')][_0xcde5('0x11c')](db['Variable'],{'as':'Variable','foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xab')][_0xcde5('0x10f')](db[_0xcde5('0x1ce')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['ZendeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db['ZendeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':_0xcde5('0x1bd'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1ce')][_0xcde5('0x11c')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1ce')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x1d0')});db[_0xcde5('0x1cf')]['hasMany'](db[_0xcde5('0x1cf')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db['ZendeskField'][_0xcde5('0x10f')](db['ZendeskField'],{'as':'Description','foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cf')][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db['ZendeskField'][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0x1d1')]['hasMany'](db[_0xcde5('0xaf')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['FreshdeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xaf')]['hasMany'](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xaf')][_0xcde5('0x11c')](db[_0xcde5('0x1d1')],{'as':_0xcde5('0x16b'),'foreignKey':'AccountId'});db[_0xcde5('0xaf')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x1d2')});db[_0xcde5('0xb1')][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db['FreshdeskField'][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb1')]['hasMany'](db[_0xcde5('0xb1')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0xb1')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xb3')][_0xcde5('0x10f')](db[_0xcde5('0xb5')],{'as':_0xcde5('0x1bf'),'onDelete':'cascade','foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xb5')][_0xcde5('0x10f')](db['VtigerField'],{'as':'Subjects','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xb5')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb5')]['hasMany'](db['VtigerField'],{'as':_0xcde5('0x1bd'),'foreignKey':'FieldId'});db[_0xcde5('0xb5')][_0xcde5('0x11c')](db[_0xcde5('0xb3')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xb7')]['belongsTo'](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db[_0xcde5('0xb9')][_0xcde5('0x10f')](db[_0xcde5('0x1d3')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1d3')]['hasMany'](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c8'),'foreignKey':'SubjectId'});db[_0xcde5('0x1d3')][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db['ServicenowConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1bd'),'foreignKey':'FieldId'});db[_0xcde5('0x1d3')][_0xcde5('0x11c')](db['ServicenowAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xbc')][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xbc')]['hasMany'](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db['ServicenowField'][_0xcde5('0x10f')](db['ServicenowField'],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xbc')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0x1d4')]['hasMany'](db[_0xcde5('0xbe')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0x1d4')][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':_0xcde5('0x15b')});db[_0xcde5('0xbe')]['hasMany'](db[_0xcde5('0x1d5')],{'as':'Subjects','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c1')});db['Dynamics365Configuration'][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xcde5('0xbe')][_0xcde5('0x10f')](db['Dynamics365Field'],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db['Dynamics365Configuration'][_0xcde5('0x11c')](db['Dynamics365Account'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1d5')]['hasMany'](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1d5')][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db['Dynamics365Field'][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1d5')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db[_0xcde5('0xc1')][_0xcde5('0x10f')](db[_0xcde5('0xc3')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xc3')]['hasMany'](db[_0xcde5('0xc5')],{'as':'Subjects','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xc3')][_0xcde5('0x10f')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xc3')]['hasMany'](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1bd'),'foreignKey':_0xcde5('0x1c3')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0xcde5('0x1c0')});db['FreshsalesField'][_0xcde5('0x10f')](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xc5')]['hasMany'](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xc5')][_0xcde5('0x10f')](db[_0xcde5('0xc5')],{'as':'Field','foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xc5')]['belongsTo'](db['Variable'],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport']['belongsTo'](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db[_0xcde5('0x63')],{});db[_0xcde5('0xc8')]['belongsTo'](db[_0xcde5('0x65')],{});db[_0xcde5('0xc8')]['belongsTo'](db[_0xcde5('0x11')],{});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db['ChatQueue'],{});db[_0xcde5('0xca')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1d6')});db['ChatInternalMessage'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1d7')});db['JscriptySessionReport'][_0xcde5('0x10f')](db[_0xcde5('0xce')],{'foreignKey':_0xcde5('0x1d8'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xcf')][_0xcde5('0x10f')](db[_0xcde5('0xcc')],{'foreignKey':_0xcde5('0x1d8'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xd1')]['belongsTo'](db[_0xcde5('0x137')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xd1')]['belongsTo'](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x53')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db['SmsMessage'],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db['SmsQueue'],{});db[_0xcde5('0xd6')]['hasMany'](db[_0xcde5('0xcf')],{'foreignKey':_0xcde5('0x1d9')});db['JscriptyProject'][_0xcde5('0x10f')](db['JscriptyQuestionReport'],{'foreignKey':_0xcde5('0x1d9')});db[_0xcde5('0xd6')]['hasMany'](db[_0xcde5('0xcc')],{'foreignKey':_0xcde5('0x1d9')});db['Team'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':'user_has_teams'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x1b')],{'through':'TeamVoiceQueue','as':_0xcde5('0x1da')});db[_0xcde5('0xe0')]['belongsToMany'](db[_0xcde5('0x3e')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team'][_0xcde5('0x11e')](db[_0xcde5('0x68')],{'through':_0xcde5('0x197'),'as':_0xcde5('0x12d')});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x17c')],{'through':_0xcde5('0x181'),'as':'FaxQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x55')],{'through':_0xcde5('0x187'),'as':'SmsQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x5c')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x102')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0xf2')],{'through':_0xcde5('0x1db'),'as':'VoicePrefixes'});db['Campaign'][_0xcde5('0x10f')](db[_0xcde5('0x141')],{'as':'Hoppers','foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')]['hasMany'](db[_0xcde5('0x113')],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x1a1')});db['Campaign'][_0xcde5('0x10f')](db[_0xcde5('0x144')],{'as':_0xcde5('0x145'),'foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')]['belongsTo'](db[_0xcde5('0x2e')],{'as':_0xcde5('0x2e'),'foreignKey':_0xcde5('0x1dc')});db['Campaign']['belongsTo'](db[_0xcde5('0x2e')],{'as':_0xcde5('0x146'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':_0xcde5('0x177')});db['Campaign'][_0xcde5('0x11c')](db[_0xcde5('0xda')],{'as':'SquareProject','foreignKey':_0xcde5('0x1dd')});db[_0xcde5('0x1a0')]['belongsToMany'](db[_0xcde5('0xf0')],{'as':_0xcde5('0x1de'),'through':_0xcde5('0x1df')});db['Campaign'][_0xcde5('0x11e')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x14f'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xcde5('0x11c')](db[_0xcde5('0x67')],{'as':_0xcde5('0x67'),'foreignKey':_0xcde5('0x176')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x163')],{});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db['MailAccount'],{'foreignKey':_0xcde5('0x1e0'),'as':_0xcde5('0x1e1')});db['MailTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0xcde5('0x1e4')});db['MailTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x3e')],{'foreignKey':_0xcde5('0x1e5'),'as':_0xcde5('0x1e6')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'foreignKey':_0xcde5('0x1e7'),'as':_0xcde5('0x1e8')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0xcde5('0xe9')]['belongsTo'](db[_0xcde5('0x63')],{});db['ChatTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'foreignKey':_0xcde5('0x1e9'),'as':_0xcde5('0x1e1')});db['ChatTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0xe9')]['belongsTo'](db[_0xcde5('0x11')],{'foreignKey':'ToUserId','as':_0xcde5('0x1e4')});db[_0xcde5('0xe9')][_0xcde5('0x11c')](db[_0xcde5('0x68')],{'foreignKey':'ToChatQueueId','as':_0xcde5('0x1e6')});db['ChatTransferReport'][_0xcde5('0x11c')](db['ChatWebsite'],{'foreignKey':_0xcde5('0x1ea'),'as':'ToAccount'});db[_0xcde5('0xea')][_0xcde5('0x11c')](db['FaxMessage'],{});db[_0xcde5('0xea')][_0xcde5('0x11c')](db['FaxInteraction'],{});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'foreignKey':_0xcde5('0x1eb'),'as':'FromAccount'});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':'FromUserId','as':_0xcde5('0x1e3')});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0xcde5('0x17c')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0xcde5('0x11c')](db['FaxAccount'],{'foreignKey':_0xcde5('0x1ed'),'as':_0xcde5('0x1e8')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x5a')],{});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x128')],{});db[_0xcde5('0xec')]['belongsTo'](db[_0xcde5('0x56')],{'foreignKey':_0xcde5('0x1ee'),'as':_0xcde5('0x1e1')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':'ToAgent'});db[_0xcde5('0xec')][_0xcde5('0x11c')](db['OpenchannelQueue'],{'foreignKey':_0xcde5('0x1ef'),'as':_0xcde5('0x1e6')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x183')],{});db[_0xcde5('0xee')]['belongsTo'](db[_0xcde5('0x53')],{});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'foreignKey':_0xcde5('0x1f0'),'as':'FromAccount'});db[_0xcde5('0xee')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':'FromAgent'});db[_0xcde5('0xee')][_0xcde5('0x11c')](db['User'],{'foreignKey':_0xcde5('0x1ec'),'as':_0xcde5('0x1e4')});db[_0xcde5('0xee')][_0xcde5('0x11c')](db[_0xcde5('0x55')],{'foreignKey':_0xcde5('0x1f1'),'as':_0xcde5('0x1e6')});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'foreignKey':_0xcde5('0x1f2'),'as':'ToAccount'});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x167'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x70')],{'as':_0xcde5('0x1f3'),'foreignKey':'ListId'});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x1f4'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x167')});db['CmList'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':'HopperFinals','foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':_0xcde5('0x114'),'foreignKey':'ListId'});db[_0xcde5('0xf0')]['belongsToMany'](db[_0xcde5('0x1b')],{'as':_0xcde5('0x1f5'),'through':_0xcde5('0x14b')});db[_0xcde5('0xf0')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x122')});db[_0xcde5('0xf2')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Extensions','onDelete':_0xcde5('0x10d')});db[_0xcde5('0xf2')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x106')});db['VoicePrefix'][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x1db'),'as':_0xcde5('0x14d')});db[_0xcde5('0xf3')][_0xcde5('0x10f')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'foreignKey':_0xcde5('0x11d')});db[_0xcde5('0xf3')][_0xcde5('0x10f')](db['UserProfileSection'],{'as':_0xcde5('0x1f6'),'foreignKey':_0xcde5('0x11d'),'onDelete':_0xcde5('0x10d')});db['UserProfileSection'][_0xcde5('0x10f')](db[_0xcde5('0x1f7')],{'as':_0xcde5('0x1f8'),'foreignKey':_0xcde5('0x1f9'),'onDelete':'cascade'});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db['Disposition'],{'as':_0xcde5('0x161'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xcde5('0xf9')]['hasMany'](db['CannedAnswer'],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x1fa')});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db[_0xcde5('0xfe')],{'as':'Messages','foreignKey':_0xcde5('0x1fa')});db['WhatsappAccount'][_0xcde5('0x10f')](db[_0xcde5('0xfc')],{'as':_0xcde5('0x164')});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db[_0xcde5('0x1fb')],{'as':_0xcde5('0x165')});db[_0xcde5('0xf9')][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf9')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0xf9')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x13a')});db['WhatsappApplication'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x15c')});db['WhatsappApplication'][_0xcde5('0x11c')](db[_0xcde5('0x102')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x1fb')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db['Interval'],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x1fb')][_0xcde5('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xcde5('0x17d')});db['WhatsappInteraction'][_0xcde5('0x10f')](db[_0xcde5('0xfe')],{'as':'Messages','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1fc')});db['WhatsappInteraction'][_0xcde5('0x11c')](db['WhatsappAccount'],{'as':_0xcde5('0x16b'),'foreignKey':'WhatsappAccountId'});db[_0xcde5('0xfc')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':'Contact','foreignKey':_0xcde5('0x157')});db[_0xcde5('0xfc')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db['WhatsappInteraction'][_0xcde5('0x11e')](db['Tag'],{'through':_0xcde5('0x1b3'),'as':'Tags'});db[_0xcde5('0xfc')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':'whatsapp_interaction_has_tags','as':_0xcde5('0x170')});db[_0xcde5('0xfc')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db['WhatsappMessage'][_0xcde5('0x11c')](db['CmContact'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c')});db[_0xcde5('0xfe')]['belongsTo'](db[_0xcde5('0xfc')],{'onDelete':_0xcde5('0x10d'),'as':'Interaction','foreignKey':_0xcde5('0x1fc')});db[_0xcde5('0xfe')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1fa')});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xfc')],{});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x102')],{});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0xfe')],{});db[_0xcde5('0x100')]['belongsTo'](db[_0xcde5('0x11')],{});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['WhatsappMessage'],{});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0xfc')],{});db['WhatsappTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'foreignKey':_0xcde5('0x1fe'),'as':'ToAccount'});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xcde5('0x1e6')});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['User'],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':_0xcde5('0x1e4')});db[_0xcde5('0x102')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':'Agents','through':_0xcde5('0x3b'),'foreignKey':_0xcde5('0x1ff')});db['WhatsappQueue'][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x200'),'as':_0xcde5('0x14d')});db[_0xcde5('0x10b')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x201'),'foreignKey':_0xcde5('0x10a'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xcde5('0x1d4')],{'as':'Dynamics365Account','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x15a')][_0xcde5('0x109')](db[_0xcde5('0x159')],{'as':_0xcde5('0x15e'),'onDelete':'restrict'});db[_0xcde5('0x15a')][_0xcde5('0x109')](db[_0xcde5('0x15d')],{'as':_0xcde5('0x15f'),'onDelete':_0xcde5('0x15c')});module[_0xcde5('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x2931=['SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Members','Website','CompanyId','Phones','CmCompany','Company','cm_contact_has_tags','AdditionalPhones','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticFieldReport','MetricId','Configurations','AccountId','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','Subjects','Descriptions','SubjectId','DeskAccount','DeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','TeamVoiceQueue','VoiceQueues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','name','database','username','password','options','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','import','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','userSetting','hasMany','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','OpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sound','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','Messages','mailbox','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailServerIn','CloudProviderId','Imap','Disposition','Dispositions','MailAccountId','Answers','Interactions','List','ListId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','restrict','TagId','Dashboard','FaxAccountId','Applications','Exntensions','mandatoryDispositionPauseId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccount'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x2931,0x80));var _0x1293=function(_0x450201,_0x57d8bc){_0x450201=_0x450201-0x0;var _0x3c617d=_0x2931[_0x450201];return _0x3c617d;};'use strict';var config=require(_0x1293('0x0'));var Sequelize=require('sequelize');var _=require(_0x1293('0x1'));var jstz=require(_0x1293('0x2'));var timezone=jstz[_0x1293('0x3')]();config[_0x1293('0x4')]=_[_0x1293('0x5')](config[_0x1293('0x4')],{'database':_0x1293('0x6'),'username':_0x1293('0x7'),'password':'xC@LL1234','options':{'host':_0x1293('0x8'),'port':0xcea,'dialect':_0x1293('0x9'),'dialectOptions':{'charset':_0x1293('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x1293('0xb'),'collate':_0x1293('0xc')}}});config[_0x1293('0xd')]=_['defaultsDeep'](config[_0x1293('0xd')],{'database':_0x1293('0x6'),'username':_0x1293('0x7'),'password':_0x1293('0xe'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x1293('0x9'),'dialectOptions':{'charset':_0x1293('0xa')},'logging':![],'timezone':timezone[_0x1293('0xf')](),'define':{'charset':_0x1293('0xb'),'collate':_0x1293('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1293('0x4')][_0x1293('0x10')],config[_0x1293('0x4')][_0x1293('0x11')],config[_0x1293('0x4')]['password'],config[_0x1293('0x4')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1293('0xd')][_0x1293('0x10')],config[_0x1293('0xd')][_0x1293('0x11')],config[_0x1293('0xd')][_0x1293('0x12')],config['sequelizeHistory'][_0x1293('0x13')])};db['User']=db[_0x1293('0x4')]['import']('../api/user/user.model');db[_0x1293('0x14')]=db[_0x1293('0x4')]['import'](_0x1293('0x15'));db[_0x1293('0x16')]=db['sequelize']['import'](_0x1293('0x17'));db[_0x1293('0x18')]=db['sequelize']['import'](_0x1293('0x19'));db[_0x1293('0x1a')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x1c'));db[_0x1293('0x1d')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x1e'));db[_0x1293('0x1f')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x20'));db[_0x1293('0x21')]=db[_0x1293('0x4')]['import']('../api/screenRecording/screenRecording.model');db[_0x1293('0x22')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x23'));db[_0x1293('0x24')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x25'));db['VoiceCallReport']=db[_0x1293('0x4')]['import'](_0x1293('0x26'));db[_0x1293('0x27')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x28'));db['VoiceAgentReport']=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x1293('0x29')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x1293('0x2a')]=db['sequelize'][_0x1293('0x1b')]('../api/memberReport/memberReport.model');db[_0x1293('0x2b')]=db[_0x1293('0x4')]['import']('../api/trunk/trunk.model');db[_0x1293('0x2c')]=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x1293('0x2d')]=db['sequelize'][_0x1293('0x1b')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x1293('0x2e')]=db[_0x1293('0x4')]['import'](_0x1293('0x2f'));db[_0x1293('0x30')]=db[_0x1293('0x4')]['import'](_0x1293('0x31'));db[_0x1293('0x32')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x33'));db[_0x1293('0x34')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x35'));db[_0x1293('0x36')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x37'));db[_0x1293('0x38')]=db[_0x1293('0x4')]['import'](_0x1293('0x39'));db[_0x1293('0x3a')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x3b'));db['MailServerIn']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x3c'));db[_0x1293('0x3d')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x3e'));db[_0x1293('0x3f')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x40'));db[_0x1293('0x41')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/mailQueue/mailQueue.model');db[_0x1293('0x42')]=db[_0x1293('0x4')]['import'](_0x1293('0x43'));db[_0x1293('0x44')]=db['sequelize']['import']('../api/mailInteraction/mailInteraction.model');db[_0x1293('0x45')]=db['sequelize']['import'](_0x1293('0x46'));db[_0x1293('0x47')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x48'));db[_0x1293('0x49')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x4a'));db['Dashboard']=db['sequelize']['import'](_0x1293('0x4b'));db[_0x1293('0x4c')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x4d'));db['FaxAccount']=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/faxAccount/faxAccount.model');db[_0x1293('0x4e')]=db[_0x1293('0x4')]['import'](_0x1293('0x4f'));db[_0x1293('0x50')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x51'));db[_0x1293('0x52')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x53'));db[_0x1293('0x54')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x55'));db[_0x1293('0x56')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize'][_0x1293('0x1b')](_0x1293('0x57'));db[_0x1293('0x58')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x59'));db[_0x1293('0x5a')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/smsInteraction/smsInteraction.model');db[_0x1293('0x5b')]=db['sequelize'][_0x1293('0x1b')]('../api/smsMessage/smsMessage.model');db[_0x1293('0x5c')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x5d'));db[_0x1293('0x5e')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x5f'));db[_0x1293('0x60')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/openchannelApplication/openchannelApplication.model');db[_0x1293('0x61')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x1293('0x62')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x63'));db['OpenchannelQueue']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x64'));db[_0x1293('0x65')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x66'));db[_0x1293('0x67')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x68'));db[_0x1293('0x69')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x6a'));db[_0x1293('0x6b')]=db[_0x1293('0x4')]['import'](_0x1293('0x6c'));db[_0x1293('0x6d')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x6e'));db['ChatOfflineMessage']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x6f'));db[_0x1293('0x70')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x71'));db[_0x1293('0x72')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x73'));db['ChatProactiveAction']=db['sequelize'][_0x1293('0x1b')](_0x1293('0x74'));db['CmCompany']=db['sequelize'][_0x1293('0x1b')]('../api/cmCompany/cmCompany.model');db[_0x1293('0x75')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x76'));db[_0x1293('0x77')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x78'));db[_0x1293('0x79')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x7a'));db[_0x1293('0x7b')]=db['sequelize']['import'](_0x1293('0x7c'));db[_0x1293('0x7d')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x7e'));db[_0x1293('0x7f')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x80'));db[_0x1293('0x81')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x82'));db[_0x1293('0x83')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x84'));db['Automation']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x85'));db[_0x1293('0x86')]=db['sequelize'][_0x1293('0x1b')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x1293('0x1b')](_0x1293('0x87'));db[_0x1293('0x88')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x89'));db[_0x1293('0x8a')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x8b'));db[_0x1293('0x8c')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x8d'));db[_0x1293('0x8e')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/cdr/cdr.model');db[_0x1293('0x8f')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x1293('0x90')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x91'));db['Sound']=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/sound/sound.model');db[_0x1293('0x92')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x93'));db[_0x1293('0x94')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x95'));db[_0x1293('0x96')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x97'));db[_0x1293('0x98')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x99'));db[_0x1293('0x9a')]=db[_0x1293('0x4')]['import'](_0x1293('0x9b'));db['Trigger']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x9c'));db[_0x1293('0x9d')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x9e'));db[_0x1293('0x9f')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/integration/integration.model');db[_0x1293('0xa0')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/integrationReport/integrationReport.model');db[_0x1293('0xa1')]=db[_0x1293('0x4')]['import'](_0x1293('0xa2'));db[_0x1293('0xa3')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xa4'));db[_0x1293('0xa5')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xa6'));db[_0x1293('0xa7')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xa8'));db['AnalyticFieldReport']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xa9'));db[_0x1293('0xaa')]=db[_0x1293('0x4')]['import'](_0x1293('0xab'));db[_0x1293('0xac')]=db[_0x1293('0x4')]['import'](_0x1293('0xad'));db[_0x1293('0xae')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x1293('0xaf')]=db['sequelize'][_0x1293('0x1b')]('../api/intSalesforceField/intSalesforceField.model');db[_0x1293('0xb0')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xb1'));db[_0x1293('0xb2')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xb3'));db['SugarcrmField']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xb4'));db['DeskAccount']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xb5'));db['DeskConfiguration']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xb6'));db[_0x1293('0xb7')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xb8'));db['ZohoAccount']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xb9'));db[_0x1293('0xba')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xbb'));db[_0x1293('0xbc')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/intZohoField/intZohoField.model');db[_0x1293('0xbd')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xbe'));db[_0x1293('0xbf')]=db['sequelize'][_0x1293('0x1b')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x1293('0xc0')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/intZendeskField/intZendeskField.model');db[_0x1293('0xc1')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xc2'));db[_0x1293('0xc3')]=db[_0x1293('0x4')]['import'](_0x1293('0xc4'));db[_0x1293('0xc5')]=db['sequelize'][_0x1293('0x1b')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x1293('0xc6')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xc7'));db['VtigerConfiguration']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xc8'));db[_0x1293('0xc9')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xca'));db[_0x1293('0xcb')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x1293('0xcc')]=db['sequelize'][_0x1293('0x1b')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x1293('0xcd')]=db[_0x1293('0x4')]['import'](_0x1293('0xce'));db[_0x1293('0xcf')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xd0'));db[_0x1293('0xd1')]=db[_0x1293('0x4')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x1293('0xd2')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x1293('0xd3')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x1293('0xd4')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xd5'));db[_0x1293('0xd6')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xd7'));db[_0x1293('0x9f')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xd8'));db[_0x1293('0xd9')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xda'));db['ChatQueueReport']=db[_0x1293('0x4')]['import'](_0x1293('0xdb'));db[_0x1293('0xdc')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x1293('0xdd')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x1293('0xde')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xdf'));db[_0x1293('0xe0')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xe1'));db['SmsQueueReport']=db['sequelize'][_0x1293('0x1b')](_0x1293('0xe2'));db[_0x1293('0xe3')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xe4'));db[_0x1293('0xe5')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xe6'));db['JscriptyProject']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xe7'));db['Setting']=db[_0x1293('0x4')]['import']('../api/setting/setting.model');db[_0x1293('0xe8')]=db[_0x1293('0x4')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x1293('0xe9')]=db['sequelize']['import'](_0x1293('0xea'));db[_0x1293('0xeb')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xec'));db[_0x1293('0xed')]=db[_0x1293('0x4')]['import'](_0x1293('0xee'));db[_0x1293('0xef')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xf0'));db[_0x1293('0xf1')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xf2'));db[_0x1293('0xf3')]=db[_0x1293('0x4')]['import'](_0x1293('0xf4'));db[_0x1293('0xf5')]=db[_0x1293('0x4')]['import']('../api/migration/migration.model');db['Attachment']=db['sequelize'][_0x1293('0x1b')]('../api/attachment/attachment.model');db[_0x1293('0xf6')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xf7'));db[_0x1293('0xf8')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xf9'));db[_0x1293('0xfa')]=db[_0x1293('0x4')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x1293('0xfb')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0xfc'));db[_0x1293('0xfd')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x1293('0xfe')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0xff'));db[_0x1293('0x100')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/cmList/cmList.model');db[_0x1293('0x101')]=db[_0x1293('0x4')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x1293('0x102')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x103'));db[_0x1293('0x104')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x105'));db['UserProfileResource']=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db['sequelize'][_0x1293('0x1b')](_0x1293('0x106'));db[_0x1293('0x107')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x108'));db[_0x1293('0x109')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x10a'));db[_0x1293('0x10b')]=db[_0x1293('0x4')]['import'](_0x1293('0x10c'));db['WhatsappMessage']=db['sequelize'][_0x1293('0x1b')](_0x1293('0x10d'));db['WhatsappQueueReport']=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x1293('0x10e')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x10f'));db[_0x1293('0x110')]=db[_0x1293('0x4')]['import'](_0x1293('0x111'));db[_0x1293('0x112')]=db[_0x1293('0x4')][_0x1293('0x1b')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x1293('0x4')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x113'));db[_0x1293('0x114')]=db[_0x1293('0x4')][_0x1293('0x1b')](_0x1293('0x115'));db[_0x1293('0x116')]=db['sequelize'][_0x1293('0x1b')](_0x1293('0x117'));db[_0x1293('0x118')][_0x1293('0x119')](db[_0x1293('0x22')],{'as':_0x1293('0x22'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')][_0x1293('0x119')](db[_0x1293('0x116')],{'as':_0x1293('0x11c'),'onDelete':'cascade','foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')]['hasMany'](db[_0x1293('0x1f')],{'as':'Recordings','foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')]['hasMany'](db[_0x1293('0x2d')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x1293('0x118')][_0x1293('0x11d')](db[_0x1293('0x18')],{'as':_0x1293('0x11e'),'onDelete':'cascade','hooks':!![]});db[_0x1293('0x118')]['hasMany'](db[_0x1293('0x7b')],{'as':_0x1293('0x11f'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')]['hasMany'](db[_0x1293('0x7d')],{'as':'HopperHistory','foreignKey':'UserId'});db['User'][_0x1293('0x11d')](db[_0x1293('0x7f')],{'as':_0x1293('0x7f'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')][_0x1293('0x11d')](db[_0x1293('0x61')],{'as':_0x1293('0x120'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')][_0x1293('0x11d')](db['ChatInteraction'],{'as':_0x1293('0x121'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')][_0x1293('0x11d')](db[_0x1293('0x5a')],{'as':_0x1293('0x122'),'foreignKey':'UserId'});db['User'][_0x1293('0x11d')](db['FaxInteraction'],{'as':_0x1293('0x123'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')]['hasMany'](db[_0x1293('0x44')],{'as':'MailInteractions','foreignKey':_0x1293('0x11b')});db['User'][_0x1293('0x11d')](db[_0x1293('0x10b')],{'as':_0x1293('0x124'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x118')]['hasMany'](db['UserNotification'],{'as':_0x1293('0x125'),'foreignKey':_0x1293('0x126')});db['User'][_0x1293('0x127')](db[_0x1293('0x102')],{'as':'UserProfile','foreignKey':_0x1293('0x128')});db[_0x1293('0x118')]['belongsToMany'](db[_0x1293('0x72')],{'as':_0x1293('0x129'),'through':_0x1293('0x12a')});db[_0x1293('0x118')][_0x1293('0x12b')](db['CmContact'],{'as':_0x1293('0x12c'),'through':_0x1293('0x12d')});db[_0x1293('0x118')]['belongsToMany'](db[_0x1293('0x100')],{'as':_0x1293('0x12e'),'through':_0x1293('0x12f')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0xef')],{'through':_0x1293('0x130')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x44')],{'as':'MailInteractions','through':_0x1293('0x131')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x6b')],{'as':'ChatInteractions','through':_0x1293('0x132')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x50')],{'as':_0x1293('0x123'),'through':'user_has_fax_interactions'});db['User'][_0x1293('0x12b')](db[_0x1293('0x5a')],{'as':_0x1293('0x122'),'through':_0x1293('0x133')});db[_0x1293('0x118')][_0x1293('0x12b')](db['OpenchannelInteraction'],{'as':_0x1293('0x120'),'through':_0x1293('0x134')});db['User'][_0x1293('0x12b')](db[_0x1293('0x10b')],{'as':'WhatsappInteractions','through':_0x1293('0x135')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x1d')],{'as':'VoiceQueues','through':_0x1293('0x2e'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x101')],{'as':_0x1293('0x136'),'through':'UserVoicePrefix','required':![]});db[_0x1293('0x118')]['belongsToMany'](db['MailQueue'],{'as':_0x1293('0x137'),'through':_0x1293('0x32'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x70')],{'as':_0x1293('0x138'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x54')],{'as':_0x1293('0x139'),'through':_0x1293('0x34'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x5c')],{'as':'SmsQueues','through':_0x1293('0x36'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x13a')],{'as':'OpenchannelQueues','through':_0x1293('0x38'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db['WhatsappQueue'],{'as':_0x1293('0x13b'),'through':_0x1293('0x3a'),'required':![]});db[_0x1293('0x118')][_0x1293('0x12b')](db['CmList'],{'through':_0x1293('0x12f')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x65')],{'as':_0x1293('0x13c'),'through':_0x1293('0x13d')});db['User'][_0x1293('0x12b')](db[_0x1293('0x13e')],{'as':_0x1293('0x13f'),'through':_0x1293('0x140')});db[_0x1293('0x118')][_0x1293('0x12b')](db['MailAccount'],{'as':_0x1293('0x141'),'through':_0x1293('0x142')});db[_0x1293('0x118')]['belongsToMany'](db[_0x1293('0x5e')],{'as':_0x1293('0x143'),'through':_0x1293('0x144')});db['User'][_0x1293('0x12b')](db['SmsAccount'],{'as':_0x1293('0x145'),'through':_0x1293('0x146')});db[_0x1293('0x118')][_0x1293('0x12b')](db[_0x1293('0x107')],{'as':_0x1293('0x147'),'through':_0x1293('0x148')});db[_0x1293('0x14')][_0x1293('0x11d')](db[_0x1293('0x18')],{'as':_0x1293('0x149'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x14a')});db[_0x1293('0x16')][_0x1293('0x11d')](db[_0x1293('0x18')],{'onDelete':_0x1293('0x11a')});db[_0x1293('0x18')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x1293('0x1a')]['belongsToMany'](db[_0x1293('0x14b')],{'as':_0x1293('0x14c'),'through':_0x1293('0x14d')});db[_0x1293('0x1d')][_0x1293('0x11d')](db[_0x1293('0x2d')],{'as':'Members','foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')][_0x1293('0x11d')](db[_0x1293('0x77')],{'as':_0x1293('0x14f'),'foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')][_0x1293('0x11d')](db[_0x1293('0x7b')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x1293('0x1d')][_0x1293('0x11d')](db[_0x1293('0x7d')],{'as':_0x1293('0x150'),'foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')][_0x1293('0x11d')](db[_0x1293('0x7f')],{'as':_0x1293('0x7f'),'foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')][_0x1293('0x11d')](db['CmHopperBlack'],{'as':_0x1293('0x151'),'foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')]['hasMany'](db[_0x1293('0xe0')],{'as':_0x1293('0x152'),'foreignKey':_0x1293('0x14e')});db[_0x1293('0x1d')][_0x1293('0x127')](db[_0x1293('0x2b')],{'as':'Trunk','foreignKey':_0x1293('0x153')});db[_0x1293('0x1d')][_0x1293('0x127')](db[_0x1293('0x2b')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x1293('0x1d')][_0x1293('0x127')](db['Interval'],{'as':'Interval','foreignKey':_0x1293('0x154')});db[_0x1293('0x1d')][_0x1293('0x127')](db['Pause'],{'as':_0x1293('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1293('0x1d')]['belongsToMany'](db[_0x1293('0x100')],{'as':'Lists','through':_0x1293('0x156')});db['VoiceQueue']['belongsToMany'](db[_0x1293('0x118')],{'as':'Agents','through':_0x1293('0x2e')});db['VoiceQueue'][_0x1293('0x12b')](db[_0x1293('0xef')],{'as':_0x1293('0x157'),'through':'TeamVoiceQueue'});db[_0x1293('0x1d')]['belongsToMany'](db[_0x1293('0x100')],{'as':_0x1293('0x158'),'through':'voice_queues_has_cm_blacklists'});db[_0x1293('0x1f')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':'User','foreignKey':_0x1293('0x11b')});db[_0x1293('0x21')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x118'),'foreignKey':_0x1293('0x11b')});db['VoiceMail'][_0x1293('0x11d')](db[_0x1293('0x24')],{'as':_0x1293('0x159'),'onDelete':_0x1293('0x11a'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x1293('0x24')]['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x1293('0x15a')});db[_0x1293('0x15b')][_0x1293('0x11d')](db[_0x1293('0x29')],{'as':_0x1293('0x15c'),'foreignKey':_0x1293('0x15d'),'constraints':![]});db[_0x1293('0x15b')][_0x1293('0x11d')](db[_0x1293('0x15e')],{'as':_0x1293('0x15f'),'foreignKey':'uniqueid','constraints':![]});db[_0x1293('0x15b')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':'User','foreignKey':'UserId'});db[_0x1293('0x15b')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db['MailServerIn'][_0x1293('0x127')](db['MailAccount'],{'as':_0x1293('0x3f'),'foreignKey':'MailAccountId'});db[_0x1293('0x162')][_0x1293('0x127')](db[_0x1293('0x112')],{'as':_0x1293('0x112'),'foreignKey':_0x1293('0x163'),'onDelete':'restrict'});db[_0x1293('0x3d')][_0x1293('0x127')](db[_0x1293('0x3f')],{'as':_0x1293('0x3f'),'foreignKey':'MailAccountId'});db[_0x1293('0x3d')][_0x1293('0x127')](db['CloudProvider'],{'as':_0x1293('0x112'),'foreignKey':_0x1293('0x163'),'onDelete':'restrict'});db['MailAccount'][_0x1293('0x119')](db['MailServerIn'],{'as':_0x1293('0x164'),'onDelete':'cascade'});db['MailAccount'][_0x1293('0x119')](db[_0x1293('0x3d')],{'as':'Smtp','onDelete':_0x1293('0x11a')});db[_0x1293('0x3f')][_0x1293('0x11d')](db[_0x1293('0x165')],{'as':_0x1293('0x166'),'foreignKey':_0x1293('0x167'),'onDelete':_0x1293('0x11a')});db['MailAccount'][_0x1293('0x11d')](db[_0x1293('0x86')],{'as':_0x1293('0x168'),'foreignKey':_0x1293('0x167')});db[_0x1293('0x3f')][_0x1293('0x11d')](db['MailMessage'],{'as':_0x1293('0x159'),'foreignKey':_0x1293('0x167')});db[_0x1293('0x3f')][_0x1293('0x11d')](db['MailInteraction'],{'as':_0x1293('0x169')});db['MailAccount'][_0x1293('0x11d')](db[_0x1293('0x47')],{'as':'Applications'});db[_0x1293('0x3f')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x3f')][_0x1293('0x127')](db[_0x1293('0x9a')],{'as':_0x1293('0x9a'),'foreignKey':'TemplateId'});db['MailAccount']['belongsTo'](db[_0x1293('0x8c')],{'as':_0x1293('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x142')});db[_0x1293('0x41')]['belongsToMany'](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x32')});db[_0x1293('0x41')][_0x1293('0x12b')](db[_0x1293('0xef')],{'through':_0x1293('0x16d'),'as':_0x1293('0x157')});db[_0x1293('0x44')]['hasMany'](db['MailMessage'],{'as':_0x1293('0x159'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x16e')});db[_0x1293('0x44')][_0x1293('0x127')](db['MailAccount'],{'as':_0x1293('0x16f'),'foreignKey':'MailAccountId'});db[_0x1293('0x44')][_0x1293('0x127')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x1293('0x44')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':'UserId'});db[_0x1293('0x44')][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':_0x1293('0x171'),'as':_0x1293('0x172')});db[_0x1293('0x44')]['belongsToMany'](db['Tag'],{'through':_0x1293('0x171'),'as':'ThroughTags'});db[_0x1293('0x44')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x173'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage'][_0x1293('0x11d')](db[_0x1293('0x174')],{'as':_0x1293('0x175'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x45')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':'User'});db[_0x1293('0x45')][_0x1293('0x127')](db[_0x1293('0x75')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x160')});db[_0x1293('0x45')]['belongsTo'](db[_0x1293('0x44')],{'as':_0x1293('0x176'),'foreignKey':_0x1293('0x16e')});db[_0x1293('0x45')][_0x1293('0x127')](db[_0x1293('0x3f')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db['ChatWebsite'],{'as':_0x1293('0x65'),'foreignKey':_0x1293('0x177')});db['MailMessage'][_0x1293('0x127')](db['ChatOfflineMessage'],{'as':_0x1293('0x178'),'foreignKey':'ChatOfflineMessageId'});db[_0x1293('0x47')][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':_0x1293('0x179')});db[_0x1293('0x47')][_0x1293('0x127')](db[_0x1293('0x41')],{'onDelete':_0x1293('0x179')});db['MailApplication'][_0x1293('0x127')](db['MailAccount'],{'onDelete':_0x1293('0x179')});db[_0x1293('0x47')][_0x1293('0x127')](db[_0x1293('0x8a')],{'onDelete':_0x1293('0x179'),'foreignKey':'IntervalId'});db['MailApplication'][_0x1293('0x127')](db[_0x1293('0x92')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x17a')});db[_0x1293('0x49')][_0x1293('0x127')](db[_0x1293('0x3f')],{});db[_0x1293('0x49')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':'List','foreignKey':_0x1293('0x16b')});db['MailQueueReport'][_0x1293('0x127')](db['CmContact'],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db['MailQueueReport'][_0x1293('0x127')](db[_0x1293('0x44')],{});db['MailQueueReport'][_0x1293('0x127')](db[_0x1293('0x45')],{});db[_0x1293('0x49')][_0x1293('0x127')](db['User'],{});db[_0x1293('0x49')]['belongsTo'](db[_0x1293('0x41')],{});db[_0x1293('0x17b')][_0x1293('0x11d')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0x1293('0x13e')][_0x1293('0x11d')](db['Disposition'],{'as':_0x1293('0x166'),'foreignKey':_0x1293('0x17c'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x13e')][_0x1293('0x11d')](db[_0x1293('0x86')],{'as':_0x1293('0x168'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x1293('0x11d')](db[_0x1293('0x50')],{'as':'Interactions'});db['FaxAccount'][_0x1293('0x11d')](db[_0x1293('0x4e')],{'as':_0x1293('0x17d')});db[_0x1293('0x13e')]['hasMany'](db[_0x1293('0x18')],{'as':_0x1293('0x17e'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x13e')]['hasMany'](db[_0x1293('0x52')],{'as':_0x1293('0x159')});db['FaxAccount'][_0x1293('0x127')](db[_0x1293('0x2b')],{'as':_0x1293('0x2b')});db[_0x1293('0x13e')][_0x1293('0x127')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x1293('0x13e')]['belongsTo'](db[_0x1293('0x8c')],{'as':_0x1293('0x155'),'foreignKey':_0x1293('0x17f')});db['FaxAccount']['belongsToMany'](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x140')});db['FaxApplication'][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':'restrict'});db[_0x1293('0x4e')][_0x1293('0x127')](db[_0x1293('0x54')],{'onDelete':'restrict'});db[_0x1293('0x4e')]['belongsTo'](db[_0x1293('0x13e')],{'onDelete':_0x1293('0x179')});db[_0x1293('0x4e')]['belongsTo'](db['Tag'],{'onDelete':_0x1293('0x179'),'foreignKey':'TagId'});db['FaxInteraction'][_0x1293('0x11d')](db[_0x1293('0x52')],{'as':'Messages','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x180')});db[_0x1293('0x50')][_0x1293('0x127')](db[_0x1293('0x13e')],{'as':_0x1293('0x16f'),'foreignKey':'FaxAccountId'});db[_0x1293('0x50')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db['FaxInteraction'][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x50')]['belongsToMany'](db['Tag'],{'through':_0x1293('0x181'),'as':'Tags'});db[_0x1293('0x50')]['belongsToMany'](db['Tag'],{'through':_0x1293('0x181'),'as':'ThroughTags'});db[_0x1293('0x50')][_0x1293('0x12b')](db['User'],{'as':_0x1293('0x173'),'through':'user_has_fax_interactions','foreignKey':_0x1293('0x180')});db[_0x1293('0x52')][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x118')});db[_0x1293('0x52')][_0x1293('0x127')](db[_0x1293('0x50')],{'as':_0x1293('0x176'),'foreignKey':_0x1293('0x180')});db[_0x1293('0x52')][_0x1293('0x127')](db[_0x1293('0x75')],{'onDelete':'cascade','as':_0x1293('0x160')});db[_0x1293('0x52')]['belongsTo'](db[_0x1293('0x174')],{'as':_0x1293('0x174'),'foreignKey':_0x1293('0x182')});db['FaxMessage'][_0x1293('0x127')](db[_0x1293('0x13e')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxQueue'][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x34')});db['FaxQueue']['belongsToMany'](db[_0x1293('0xef')],{'through':_0x1293('0x183'),'as':_0x1293('0x157')});db[_0x1293('0x56')][_0x1293('0x127')](db[_0x1293('0x13e')],{});db[_0x1293('0x56')]['belongsTo'](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':'ListId'});db['FaxQueueReport']['belongsTo'](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x56')][_0x1293('0x127')](db[_0x1293('0x50')],{});db['FaxQueueReport'][_0x1293('0x127')](db[_0x1293('0x52')],{});db[_0x1293('0x56')][_0x1293('0x127')](db[_0x1293('0x118')],{});db[_0x1293('0x56')]['belongsTo'](db[_0x1293('0x54')],{});db[_0x1293('0x184')][_0x1293('0x11d')](db[_0x1293('0x165')],{'as':_0x1293('0x166'),'foreignKey':_0x1293('0x185'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x184')][_0x1293('0x11d')](db[_0x1293('0x86')],{'as':_0x1293('0x168'),'foreignKey':_0x1293('0x185')});db[_0x1293('0x184')][_0x1293('0x11d')](db[_0x1293('0x5b')],{'as':_0x1293('0x159'),'foreignKey':_0x1293('0x185')});db[_0x1293('0x184')][_0x1293('0x11d')](db[_0x1293('0x5a')],{'as':_0x1293('0x169')});db['SmsAccount'][_0x1293('0x11d')](db[_0x1293('0x58')],{'as':'Applications'});db[_0x1293('0x184')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':'List','foreignKey':_0x1293('0x16b')});db['SmsAccount'][_0x1293('0x127')](db[_0x1293('0x8c')],{'as':_0x1293('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount']['belongsToMany'](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x146')});db['SmsApplication'][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db['SmsQueue'],{'onDelete':_0x1293('0x179')});db[_0x1293('0x58')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x1293('0x179')});db['SmsApplication'][_0x1293('0x127')](db[_0x1293('0x8a')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x154')});db['SmsApplication']['belongsTo'](db[_0x1293('0x92')],{'onDelete':_0x1293('0x179'),'foreignKey':'TagId'});db[_0x1293('0x5a')][_0x1293('0x11d')](db[_0x1293('0x5b')],{'as':'Messages','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x186')});db[_0x1293('0x5a')][_0x1293('0x127')](db[_0x1293('0x184')],{'as':_0x1293('0x16f'),'foreignKey':_0x1293('0x185')});db[_0x1293('0x5a')]['belongsTo'](db[_0x1293('0x75')],{'as':'Contact','foreignKey':_0x1293('0x161')});db[_0x1293('0x5a')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':'UserId'});db['SmsInteraction'][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':_0x1293('0x187'),'as':_0x1293('0x172')});db[_0x1293('0x5a')]['belongsToMany'](db[_0x1293('0x92')],{'through':'sms_interaction_has_tags','as':_0x1293('0x188')});db[_0x1293('0x5a')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x173'),'through':_0x1293('0x133'),'foreignKey':'SmsInteractionId'});db[_0x1293('0x5b')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':'User'});db[_0x1293('0x5b')][_0x1293('0x127')](db[_0x1293('0x75')],{'onDelete':_0x1293('0x11a'),'as':'Contact'});db['SmsMessage']['belongsTo'](db[_0x1293('0x5a')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x176'),'foreignKey':'SmsInteractionId'});db[_0x1293('0x5b')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x1293('0x185')});db[_0x1293('0x5c')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':'UserSmsQueue','foreignKey':_0x1293('0x189')});db[_0x1293('0x5c')][_0x1293('0x12b')](db['Team'],{'through':_0x1293('0x18a'),'as':_0x1293('0x157')});db[_0x1293('0x5e')][_0x1293('0x11d')](db[_0x1293('0x165')],{'as':_0x1293('0x166'),'foreignKey':_0x1293('0x18b'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x5e')][_0x1293('0x11d')](db[_0x1293('0x86')],{'as':_0x1293('0x168'),'foreignKey':_0x1293('0x18b')});db[_0x1293('0x5e')][_0x1293('0x11d')](db[_0x1293('0x61')],{'as':_0x1293('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x1293('0x5e')]['hasMany'](db['OpenchannelMessage'],{'as':_0x1293('0x159'),'foreignKey':_0x1293('0x18b')});db['OpenchannelAccount'][_0x1293('0x11d')](db['OpenchannelApplication'],{'as':_0x1293('0x17d'),'foreignKey':_0x1293('0x18b')});db[_0x1293('0x5e')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x5e')][_0x1293('0x127')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x1293('0x17f')});db[_0x1293('0x5e')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':'user_has_openchannel_accounts'});db[_0x1293('0x60')][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':_0x1293('0x179')});db[_0x1293('0x60')][_0x1293('0x127')](db[_0x1293('0x13a')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x18c')});db['OpenchannelApplication'][_0x1293('0x127')](db[_0x1293('0x5e')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x18b')});db[_0x1293('0x60')][_0x1293('0x127')](db[_0x1293('0x8a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x1293('0x60')][_0x1293('0x127')](db[_0x1293('0x92')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x17a')});db[_0x1293('0x61')][_0x1293('0x11d')](db[_0x1293('0x62')],{'as':_0x1293('0x159'),'onDelete':'cascade','foreignKey':_0x1293('0x18d')});db['OpenchannelInteraction'][_0x1293('0x127')](db[_0x1293('0x5e')],{'as':_0x1293('0x16f'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction']['belongsTo'](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x61')]['belongsTo'](db['User'],{'as':_0x1293('0x170'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x61')][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':_0x1293('0x18e'),'as':_0x1293('0x172')});db[_0x1293('0x61')][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':_0x1293('0x18e'),'as':_0x1293('0x188')});db[_0x1293('0x61')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x173'),'through':_0x1293('0x134'),'foreignKey':'OpenchannelInteractionId'});db[_0x1293('0x62')][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':'cascade','as':_0x1293('0x118')});db[_0x1293('0x62')][_0x1293('0x127')](db[_0x1293('0x75')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x160')});db[_0x1293('0x62')][_0x1293('0x127')](db[_0x1293('0x61')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x176'),'foreignKey':_0x1293('0x18d')});db[_0x1293('0x62')]['belongsTo'](db[_0x1293('0x174')],{'as':'Attachment','foreignKey':_0x1293('0x182')});db[_0x1293('0x62')]['belongsTo'](db[_0x1293('0x5e')],{'as':_0x1293('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0x1293('0x13a')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x38'),'foreignKey':_0x1293('0x18c')});db[_0x1293('0x13a')][_0x1293('0x12b')](db[_0x1293('0xef')],{'through':_0x1293('0x18f'),'as':_0x1293('0x157')});db[_0x1293('0x65')][_0x1293('0x11d')](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db['ChatWebsite']['hasMany'](db[_0x1293('0x86')],{'as':'Answers','foreignKey':_0x1293('0x177')});db[_0x1293('0x65')][_0x1293('0x11d')](db[_0x1293('0x190')],{'as':_0x1293('0x191')});db['ChatWebsite'][_0x1293('0x11d')](db[_0x1293('0x6b')],{'as':'Interactions'});db['ChatWebsite']['hasMany'](db['ChatApplication'],{'as':'Applications'});db[_0x1293('0x65')][_0x1293('0x11d')](db[_0x1293('0x6d')],{'as':_0x1293('0x159')});db[_0x1293('0x65')]['belongsTo'](db['CmList'],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x65')][_0x1293('0x127')](db[_0x1293('0x8a')],{'as':_0x1293('0x8a'),'foreignKey':'IntervalId'});db[_0x1293('0x65')][_0x1293('0x127')](db[_0x1293('0x3f')],{'as':_0x1293('0x3f'),'foreignKey':_0x1293('0x167')});db[_0x1293('0x65')][_0x1293('0x127')](db[_0x1293('0x8c')],{'as':_0x1293('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x1293('0x67')][_0x1293('0x127')](db[_0x1293('0x5e')],{});db[_0x1293('0x67')]['belongsTo'](db[_0x1293('0x100')],{'as':'List','foreignKey':_0x1293('0x16b')});db['OpenchannelQueueReport'][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':'ContactId'});db[_0x1293('0x67')][_0x1293('0x127')](db['OpenchannelInteraction'],{});db[_0x1293('0x67')][_0x1293('0x127')](db[_0x1293('0x62')],{});db[_0x1293('0x67')][_0x1293('0x127')](db[_0x1293('0x118')],{});db[_0x1293('0x67')][_0x1293('0x127')](db[_0x1293('0x13a')],{});db['ChatApplication']['belongsTo'](db[_0x1293('0x118')],{'as':_0x1293('0x192'),'foreignKey':'UserId','onDelete':_0x1293('0x179')});db['ChatApplication'][_0x1293('0x127')](db[_0x1293('0x70')],{'as':_0x1293('0x193'),'foreignKey':'ChatQueueId','onDelete':_0x1293('0x179')});db[_0x1293('0x69')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x1293('0x177'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x1293('0x92')],{'onDelete':_0x1293('0x179'),'foreignKey':_0x1293('0x17a')});db[_0x1293('0x6b')]['hasMany'](db[_0x1293('0x6d')],{'as':_0x1293('0x159'),'onDelete':_0x1293('0x11a'),'foreignKey':'ChatInteractionId'});db[_0x1293('0x6b')][_0x1293('0x127')](db[_0x1293('0x65')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x1293('0x6b')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':'ContactId'});db[_0x1293('0x6b')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x6b')][_0x1293('0x12b')](db['Tag'],{'through':_0x1293('0x194'),'as':_0x1293('0x172')});db[_0x1293('0x6b')][_0x1293('0x12b')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x1293('0x188')});db[_0x1293('0x6b')][_0x1293('0x12b')](db['User'],{'as':_0x1293('0x173'),'through':_0x1293('0x132'),'foreignKey':_0x1293('0x195')});db['ChatMessage']['belongsTo'](db[_0x1293('0x118')],{'onDelete':_0x1293('0x11a'),'as':'User'});db[_0x1293('0x6d')]['belongsTo'](db[_0x1293('0x75')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x160'),'foreignKey':'ContactId'});db[_0x1293('0x6d')]['belongsTo'](db[_0x1293('0x6b')],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x176'),'foreignKey':_0x1293('0x195')});db[_0x1293('0x6d')][_0x1293('0x127')](db[_0x1293('0x174')],{'as':_0x1293('0x174'),'foreignKey':'AttachmentId'});db[_0x1293('0x6d')][_0x1293('0x127')](db[_0x1293('0x65')],{'as':_0x1293('0x16f'),'foreignKey':_0x1293('0x177')});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':_0x1293('0x175'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x1293('0x11a'),'hooks':!![]});db[_0x1293('0x178')][_0x1293('0x127')](db['CmContact'],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x160'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x1293('0x127')](db[_0x1293('0x65')],{'as':'Account','foreignKey':_0x1293('0x177')});db['ChatQueue'][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':'Agents','through':_0x1293('0x30'),'hooks':!![]});db[_0x1293('0x70')][_0x1293('0x12b')](db[_0x1293('0xef')],{'through':_0x1293('0x196'),'as':'Teams'});db['ChatGroup'][_0x1293('0x11d')](db[_0x1293('0xdc')],{'as':_0x1293('0x159'),'foreignKey':_0x1293('0x197'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x72')]['belongsToMany'](db[_0x1293('0x118')],{'as':_0x1293('0x198'),'through':_0x1293('0x12a')});db[_0x1293('0x190')][_0x1293('0x127')](db[_0x1293('0x65')],{'as':_0x1293('0x199'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x1293('0x11d')](db[_0x1293('0x75')],{'as':_0x1293('0x12c'),'foreignKey':_0x1293('0x19a')});db[_0x1293('0x75')][_0x1293('0x11d')](db['CmContactHasItem'],{'as':_0x1293('0x19b'),'foreignKey':'CmContactId'});db[_0x1293('0x75')][_0x1293('0x11d')](db[_0x1293('0x77')],{'as':_0x1293('0x14f'),'foreignKey':_0x1293('0x161')});db['CmContact'][_0x1293('0x11d')](db['CmHopperFinal'],{'as':_0x1293('0x11f'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x75')]['hasMany'](db[_0x1293('0x7d')],{'as':_0x1293('0x150'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x75')]['hasMany'](db[_0x1293('0x7f')],{'as':_0x1293('0x7f'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x75')][_0x1293('0x11d')](db[_0x1293('0xe0')],{'as':_0x1293('0x152'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x75')][_0x1293('0x11d')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x1293('0x75')][_0x1293('0x11d')](db[_0x1293('0x6b')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x1293('0x11d')](db['SmsInteraction'],{'as':_0x1293('0x122'),'foreignKey':'ContactId','onDelete':_0x1293('0x179')});db[_0x1293('0x75')]['hasMany'](db[_0x1293('0x50')],{'as':_0x1293('0x123'),'foreignKey':_0x1293('0x161'),'onDelete':_0x1293('0x179')});db[_0x1293('0x75')][_0x1293('0x11d')](db[_0x1293('0x44')],{'as':'MailInteractions','foreignKey':_0x1293('0x161'),'onDelete':_0x1293('0x179')});db[_0x1293('0x75')][_0x1293('0x127')](db[_0x1293('0x19c')],{'as':_0x1293('0x19d'),'foreignKey':_0x1293('0x19a')});db[_0x1293('0x75')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x75')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':'Users','through':_0x1293('0x12d')});db['CmContact'][_0x1293('0x12b')](db[_0x1293('0x92')],{'as':_0x1293('0x172'),'through':'cm_contact_has_tags'});db[_0x1293('0x75')]['belongsToMany'](db[_0x1293('0x92')],{'through':_0x1293('0x19e'),'as':_0x1293('0x188')});db[_0x1293('0x77')][_0x1293('0x11d')](db['CmHopperAdditionalPhone'],{'as':_0x1293('0x19f'),'foreignKey':'CmHopperId'});db[_0x1293('0x77')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper'][_0x1293('0x127')](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b'),'onDelete':'cascade'});db[_0x1293('0x77')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x192'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x77')][_0x1293('0x127')](db[_0x1293('0x1d')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x1293('0x77')][_0x1293('0x127')](db['Campaign'],{'as':_0x1293('0xf3'),'foreignKey':_0x1293('0x1a0'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x77')]['belongsTo'](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':_0x1293('0x1a1')});db[_0x1293('0x79')][_0x1293('0x127')](db['CmContact'],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x79')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1293('0x16b'),'onDelete':_0x1293('0x11a')});db['CmHopperBlack'][_0x1293('0x127')](db[_0x1293('0x1d')],{'as':_0x1293('0x193'),'foreignKey':'VoiceQueueId','onDelete':_0x1293('0x11a')});db[_0x1293('0x79')][_0x1293('0x127')](db['Campaign'],{'as':'Campaign','foreignKey':_0x1293('0x1a0'),'onDelete':'cascade'});db[_0x1293('0x1a2')][_0x1293('0x11d')](db[_0x1293('0x88')],{'as':{'plural':_0x1293('0x1a3'),'singular':_0x1293('0x1a4')},'foreignKey':_0x1293('0x1a5'),'onDelete':_0x1293('0x11a'),'hooks':!![]});db[_0x1293('0x1a2')]['hasMany'](db[_0x1293('0x88')],{'as':{'plural':'Any','singular':_0x1293('0x1a6')},'foreignKey':_0x1293('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x1293('0x1a2')][_0x1293('0x11d')](db[_0x1293('0x83')],{'as':'Actions','foreignKey':_0x1293('0x1a8'),'onDelete':'cascade','hooks':!![]});db[_0x1293('0x165')][_0x1293('0x11d')](db[_0x1293('0x165')],{'as':_0x1293('0x166'),'foreignKey':_0x1293('0x1a9'),'onDelete':'cascade'});db['Interval'][_0x1293('0x11d')](db['Interval'],{'as':'Intervals','foreignKey':_0x1293('0x154'),'onDelete':_0x1293('0x11a'),'hooks':!![],'required':![]});db['Interval'][_0x1293('0x11d')](db[_0x1293('0x18')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x1293('0x179')});db[_0x1293('0x8a')][_0x1293('0x11d')](db['MailApplication'],{'as':_0x1293('0x1aa'),'foreignKey':_0x1293('0x154')});db[_0x1293('0x8a')][_0x1293('0x11d')](db[_0x1293('0x69')],{'as':_0x1293('0x1ab'),'foreignKey':_0x1293('0x154')});db[_0x1293('0x8a')][_0x1293('0x11d')](db['FaxApplication'],{'as':_0x1293('0x1ac'),'foreignKey':_0x1293('0x154')});db['Interval'][_0x1293('0x11d')](db[_0x1293('0x58')],{'as':_0x1293('0x1ad'),'foreignKey':'IntervalId'});db[_0x1293('0x90')][_0x1293('0x127')](db['MailAccount'],{});db[_0x1293('0x90')][_0x1293('0x127')](db[_0x1293('0xa3')],{'foreignKey':_0x1293('0x1ae')});db[_0x1293('0x90')][_0x1293('0x127')](db['AnalyticCustomReport'],{'foreignKey':_0x1293('0x1af')});db[_0x1293('0x14b')]['belongsToMany'](db[_0x1293('0x1a')],{'as':_0x1293('0x1b0'),'through':_0x1293('0x14d'),'onDelete':_0x1293('0x179')});db[_0x1293('0x92')][_0x1293('0x12b')](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag'][_0x1293('0x12b')](db[_0x1293('0x6b')],{'through':_0x1293('0x194')});db[_0x1293('0x92')][_0x1293('0x12b')](db['MailInteraction'],{'through':_0x1293('0x171')});db['Tag'][_0x1293('0x12b')](db[_0x1293('0x5a')],{'through':_0x1293('0x187')});db[_0x1293('0x92')][_0x1293('0x12b')](db[_0x1293('0x50')],{'through':'fax_interaction_has_tags'});db[_0x1293('0x92')]['belongsToMany'](db[_0x1293('0x61')],{'through':'openchannel_interaction_has_tags'});db[_0x1293('0x92')][_0x1293('0x12b')](db[_0x1293('0x10b')],{'through':_0x1293('0x1b1')});db[_0x1293('0x96')][_0x1293('0x127')](db['ContactItemType'],{'as':_0x1293('0x1b2'),'foreignKey':_0x1293('0x1b3')});db[_0x1293('0x98')]['belongsTo'](db[_0x1293('0x77')],{'as':_0x1293('0x1b4'),'foreignKey':_0x1293('0x1b5')});db[_0x1293('0x96')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':'CmContactId'});db[_0x1293('0x1b6')][_0x1293('0x11d')](db[_0x1293('0x88')],{'as':{'plural':_0x1293('0x1b7'),'singular':_0x1293('0x1b8')},'foreignKey':_0x1293('0x1b9'),'onDelete':_0x1293('0x11a'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x1293('0x88')],{'as':{'plural':_0x1293('0x1ba'),'singular':_0x1293('0x1bb')},'foreignKey':_0x1293('0x1bc'),'onDelete':_0x1293('0x11a'),'hooks':!![]});db['Trigger'][_0x1293('0x11d')](db['Action'],{'as':_0x1293('0x1bd'),'foreignKey':_0x1293('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0x1293('0xa1')][_0x1293('0x11d')](db['AnalyticFieldReport'],{'as':_0x1293('0x1bf'),'onDelete':'cascade','foreignKey':_0x1293('0x1af'),'hooks':!![]});db['AnalyticDefaultReport'][_0x1293('0x11d')](db[_0x1293('0x1c0')],{'as':'Fields','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1ae')});db[_0x1293('0xa7')][_0x1293('0x11d')](db[_0x1293('0x1c0')],{'as':_0x1293('0x1bf'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c1')});db['AnalyticFieldReport'][_0x1293('0x127')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x1293('0xac')][_0x1293('0x11d')](db[_0x1293('0xae')],{'as':_0x1293('0x1c2'),'onDelete':'cascade','foreignKey':_0x1293('0x1c3')});db['SalesforceConfiguration']['hasMany'](db[_0x1293('0xaf')],{'as':'Subjects','onDelete':_0x1293('0x11a'),'foreignKey':'SubjectId'});db[_0x1293('0xae')]['hasMany'](db[_0x1293('0xaf')],{'as':'Descriptions','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0xae')][_0x1293('0x11d')](db[_0x1293('0xaf')],{'as':_0x1293('0x1bf'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xae')][_0x1293('0x127')](db[_0x1293('0xac')],{'as':_0x1293('0x16f'),'foreignKey':'AccountId'});db[_0x1293('0xaf')][_0x1293('0x11d')](db['SalesforceField'],{'as':_0x1293('0x1c6'),'foreignKey':'SubjectId'});db[_0x1293('0xaf')]['hasMany'](db[_0x1293('0xaf')],{'as':_0x1293('0x1c7'),'foreignKey':'DescriptionId'});db[_0x1293('0xaf')][_0x1293('0x11d')](db[_0x1293('0xaf')],{'as':_0x1293('0x1c8'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xaf')][_0x1293('0x127')](db['Variable'],{'as':'Variable','foreignKey':_0x1293('0x1c9')});db['SugarcrmAccount'][_0x1293('0x11d')](db[_0x1293('0xb2')],{'as':_0x1293('0x1c2'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xb2')][_0x1293('0x11d')](db[_0x1293('0x1ca')],{'as':_0x1293('0x1cb'),'onDelete':_0x1293('0x11a'),'foreignKey':'SubjectId'});db[_0x1293('0xb2')][_0x1293('0x11d')](db['SugarcrmField'],{'as':_0x1293('0x1cc'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c4')});db['SugarcrmConfiguration']['hasMany'](db[_0x1293('0x1ca')],{'as':_0x1293('0x1bf'),'onDelete':'cascade','foreignKey':_0x1293('0x1c5')});db['SugarcrmConfiguration'][_0x1293('0x127')](db[_0x1293('0xb0')],{'as':'Account','foreignKey':_0x1293('0x1c3')});db[_0x1293('0x1ca')][_0x1293('0x11d')](db['SugarcrmField'],{'as':_0x1293('0x1c6'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0x1ca')][_0x1293('0x11d')](db['SugarcrmField'],{'as':_0x1293('0x1c7'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0x1ca')][_0x1293('0x11d')](db[_0x1293('0x1ca')],{'as':'Field','foreignKey':_0x1293('0x1c5')});db[_0x1293('0x1ca')]['belongsTo'](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':'VariableId'});db[_0x1293('0x1ce')][_0x1293('0x11d')](db[_0x1293('0x1cf')],{'as':_0x1293('0x1c2'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0x1cf')][_0x1293('0x11d')](db[_0x1293('0xb7')],{'as':'Subjects','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0x1cf')][_0x1293('0x11d')](db[_0x1293('0xb7')],{'as':_0x1293('0x1cc'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c4')});db['DeskConfiguration'][_0x1293('0x11d')](db['DeskField'],{'as':_0x1293('0x1bf'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x1293('0x1cf')]['belongsTo'](db[_0x1293('0x1ce')],{'as':_0x1293('0x16f'),'foreignKey':'AccountId'});db[_0x1293('0x1cf')][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':'int_desk_configuration_has_tags'});db[_0x1293('0xb7')]['hasMany'](db[_0x1293('0xb7')],{'as':'Subject','foreignKey':_0x1293('0x1cd')});db[_0x1293('0xb7')][_0x1293('0x11d')](db['DeskField'],{'as':_0x1293('0x1c7'),'foreignKey':'DescriptionId'});db[_0x1293('0xb7')][_0x1293('0x11d')](db[_0x1293('0xb7')],{'as':'Field','foreignKey':_0x1293('0x1c5')});db[_0x1293('0xb7')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x1293('0x1c9')});db['ZohoAccount'][_0x1293('0x11d')](db[_0x1293('0xba')],{'as':'Configurations','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xba')][_0x1293('0x11d')](db[_0x1293('0xbc')],{'as':_0x1293('0x1cb'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xba')]['hasMany'](db[_0x1293('0xbc')],{'as':_0x1293('0x1cc'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c4')});db['ZohoConfiguration'][_0x1293('0x11d')](db[_0x1293('0xbc')],{'as':_0x1293('0x1bf'),'onDelete':_0x1293('0x11a'),'foreignKey':'FieldId'});db[_0x1293('0xba')][_0x1293('0x127')](db['ZohoAccount'],{'as':_0x1293('0x16f'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xbc')][_0x1293('0x11d')](db[_0x1293('0xbc')],{'as':'Subject','foreignKey':_0x1293('0x1cd')});db[_0x1293('0xbc')][_0x1293('0x11d')](db[_0x1293('0xbc')],{'as':_0x1293('0x1c7'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0xbc')][_0x1293('0x11d')](db['ZohoField'],{'as':_0x1293('0x1c8'),'foreignKey':'FieldId'});db[_0x1293('0xbc')][_0x1293('0x127')](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':_0x1293('0x1c9')});db[_0x1293('0xbd')][_0x1293('0x11d')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xbf')][_0x1293('0x11d')](db[_0x1293('0xc0')],{'as':_0x1293('0x1cb'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xbf')][_0x1293('0x11d')](db['ZendeskField'],{'as':_0x1293('0x1cc'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0xbf')][_0x1293('0x11d')](db[_0x1293('0xc0')],{'as':_0x1293('0x1bf'),'foreignKey':'FieldId'});db[_0x1293('0xbf')][_0x1293('0x127')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x1293('0x1c3')});db[_0x1293('0xbf')]['belongsToMany'](db[_0x1293('0x92')],{'through':_0x1293('0x1d0')});db['ZendeskField'][_0x1293('0x11d')](db[_0x1293('0xc0')],{'as':'Subject','foreignKey':_0x1293('0x1cd')});db[_0x1293('0xc0')][_0x1293('0x11d')](db['ZendeskField'],{'as':'Description','foreignKey':_0x1293('0x1c4')});db[_0x1293('0xc0')]['hasMany'](db[_0x1293('0xc0')],{'as':_0x1293('0x1c8'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xc0')][_0x1293('0x127')](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':_0x1293('0x1c9')});db[_0x1293('0xc1')]['hasMany'](db[_0x1293('0xc3')],{'as':_0x1293('0x1c2'),'onDelete':'cascade','foreignKey':_0x1293('0x1c3')});db[_0x1293('0xc3')]['hasMany'](db[_0x1293('0xc5')],{'as':_0x1293('0x1cb'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xc3')][_0x1293('0x11d')](db['FreshdeskField'],{'as':_0x1293('0x1cc'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c4')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x1293('0x1bf'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xc3')][_0x1293('0x127')](db['FreshdeskAccount'],{'as':_0x1293('0x16f'),'foreignKey':'AccountId'});db[_0x1293('0xc3')]['belongsToMany'](db[_0x1293('0x92')],{'through':_0x1293('0x1d1')});db[_0x1293('0xc5')][_0x1293('0x11d')](db[_0x1293('0xc5')],{'as':'Subject','foreignKey':_0x1293('0x1cd')});db[_0x1293('0xc5')][_0x1293('0x11d')](db[_0x1293('0xc5')],{'as':_0x1293('0x1c7'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':'Field','foreignKey':_0x1293('0x1c5')});db[_0x1293('0xc5')][_0x1293('0x127')](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':_0x1293('0x1c9')});db[_0x1293('0xc6')][_0x1293('0x11d')](db[_0x1293('0x1d2')],{'as':_0x1293('0x1c2'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0x1d2')][_0x1293('0x11d')](db[_0x1293('0xc9')],{'as':_0x1293('0x1cb'),'foreignKey':_0x1293('0x1cd')});db['VtigerConfiguration'][_0x1293('0x11d')](db[_0x1293('0xc9')],{'as':_0x1293('0x1cc'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0x1d2')][_0x1293('0x11d')](db['VtigerField'],{'as':_0x1293('0x1bf'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0x1d2')][_0x1293('0x127')](db[_0x1293('0xc6')],{'as':_0x1293('0x16f'),'foreignKey':'AccountId'});db[_0x1293('0xc9')]['hasMany'](db[_0x1293('0xc9')],{'as':_0x1293('0x1c6'),'foreignKey':'SubjectId'});db[_0x1293('0xc9')]['hasMany'](db[_0x1293('0xc9')],{'as':_0x1293('0x1c7'),'foreignKey':_0x1293('0x1c4')});db['VtigerField'][_0x1293('0x11d')](db[_0x1293('0xc9')],{'as':_0x1293('0x1c8'),'foreignKey':'FieldId'});db[_0x1293('0xc9')][_0x1293('0x127')](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':_0x1293('0x1c9')});db[_0x1293('0xcb')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x1293('0x1c2'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xcc')][_0x1293('0x11d')](db[_0x1293('0xcd')],{'as':'Subjects','foreignKey':_0x1293('0x1cd')});db['ServicenowConfiguration'][_0x1293('0x11d')](db[_0x1293('0xcd')],{'as':_0x1293('0x1cc'),'foreignKey':'DescriptionId'});db[_0x1293('0xcc')][_0x1293('0x11d')](db[_0x1293('0xcd')],{'as':_0x1293('0x1bf'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xcc')][_0x1293('0x127')](db[_0x1293('0xcb')],{'as':_0x1293('0x16f'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xcd')]['hasMany'](db['ServicenowField'],{'as':_0x1293('0x1c6'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xcd')][_0x1293('0x11d')](db[_0x1293('0xcd')],{'as':_0x1293('0x1c7'),'foreignKey':_0x1293('0x1c4')});db['ServicenowField'][_0x1293('0x11d')](db[_0x1293('0xcd')],{'as':'Field','foreignKey':_0x1293('0x1c5')});db[_0x1293('0xcd')][_0x1293('0x127')](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':_0x1293('0x1c9')});db[_0x1293('0xcf')][_0x1293('0x11d')](db[_0x1293('0xd1')],{'as':_0x1293('0x1c2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x1293('0xcf')][_0x1293('0x127')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x1293('0x163')});db['Dynamics365Configuration'][_0x1293('0x11d')](db['Dynamics365Field'],{'as':_0x1293('0x1cb'),'onDelete':'cascade','foreignKey':_0x1293('0x1cd')});db[_0x1293('0xd1')][_0x1293('0x11d')](db[_0x1293('0xd2')],{'as':_0x1293('0x1cc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0x1293('0x1bf'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xd1')][_0x1293('0x127')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x1293('0x1c3')});db[_0x1293('0xd2')]['hasMany'](db[_0x1293('0xd2')],{'as':_0x1293('0x1c6'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xd2')][_0x1293('0x11d')](db[_0x1293('0xd2')],{'as':_0x1293('0x1c7'),'foreignKey':_0x1293('0x1c4')});db[_0x1293('0xd2')]['hasMany'](db[_0x1293('0xd2')],{'as':_0x1293('0x1c8'),'foreignKey':'FieldId'});db[_0x1293('0xd2')]['belongsTo'](db[_0x1293('0x9d')],{'as':_0x1293('0x9d'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0x1293('0x11d')](db[_0x1293('0xd4')],{'as':_0x1293('0x1c2'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1c3')});db[_0x1293('0xd4')]['hasMany'](db[_0x1293('0xd6')],{'as':_0x1293('0x1cb'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xd4')][_0x1293('0x11d')](db[_0x1293('0xd6')],{'as':_0x1293('0x1cc'),'foreignKey':_0x1293('0x1c4')});db['FreshsalesConfiguration'][_0x1293('0x11d')](db[_0x1293('0xd6')],{'as':_0x1293('0x1bf'),'foreignKey':'FieldId'});db[_0x1293('0xd4')][_0x1293('0x127')](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField'][_0x1293('0x11d')](db[_0x1293('0xd6')],{'as':_0x1293('0x1c6'),'foreignKey':_0x1293('0x1cd')});db[_0x1293('0xd6')][_0x1293('0x11d')](db['FreshsalesField'],{'as':_0x1293('0x1c7'),'foreignKey':'DescriptionId'});db[_0x1293('0xd6')]['hasMany'](db['FreshsalesField'],{'as':_0x1293('0x1c8'),'foreignKey':_0x1293('0x1c5')});db[_0x1293('0xd6')]['belongsTo'](db['Variable'],{'as':_0x1293('0x9d'),'foreignKey':'VariableId'});db[_0x1293('0x1d3')][_0x1293('0x127')](db[_0x1293('0x65')],{});db[_0x1293('0x1d3')][_0x1293('0x127')](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x1d3')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1293('0x1d3')][_0x1293('0x127')](db[_0x1293('0x6b')],{});db[_0x1293('0x1d3')][_0x1293('0x127')](db[_0x1293('0x6d')],{});db[_0x1293('0x1d3')][_0x1293('0x127')](db['User'],{});db['ChatQueueReport'][_0x1293('0x127')](db[_0x1293('0x70')],{});db[_0x1293('0xdc')]['belongsTo'](db[_0x1293('0x118')],{'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1d4')});db[_0x1293('0xdc')][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1d5')});db['JscriptySessionReport']['hasMany'](db[_0x1293('0xde')],{'foreignKey':_0x1293('0x1d6'),'onDelete':_0x1293('0x11a')});db[_0x1293('0xe0')][_0x1293('0x11d')](db[_0x1293('0xdd')],{'foreignKey':_0x1293('0x1d6'),'onDelete':'cascade'});db['SmsQueueReport'][_0x1293('0x127')](db[_0x1293('0x184')],{});db['SmsQueueReport'][_0x1293('0x127')](db['CmList'],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x1d7')]['belongsTo'](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0x1293('0x127')](db[_0x1293('0x5a')],{});db[_0x1293('0x1d7')][_0x1293('0x127')](db[_0x1293('0x5b')],{});db['SmsQueueReport']['belongsTo'](db[_0x1293('0x118')],{});db[_0x1293('0x1d7')][_0x1293('0x127')](db[_0x1293('0x5c')],{});db[_0x1293('0x1d8')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x1293('0x1d9')});db[_0x1293('0x1d8')][_0x1293('0x11d')](db['JscriptyQuestionReport'],{'foreignKey':_0x1293('0x1d9')});db[_0x1293('0x1d8')][_0x1293('0x11d')](db['JscriptyAnswerReport'],{'foreignKey':_0x1293('0x1d9')});db[_0x1293('0xef')]['belongsToMany'](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x130')});db[_0x1293('0xef')][_0x1293('0x12b')](db[_0x1293('0x1d')],{'through':_0x1293('0x1da'),'as':_0x1293('0x1db')});db['Team'][_0x1293('0x12b')](db[_0x1293('0x41')],{'through':'team_has_mail_queues','as':_0x1293('0x137')});db[_0x1293('0xef')][_0x1293('0x12b')](db['ChatQueue'],{'through':_0x1293('0x196'),'as':_0x1293('0x138')});db[_0x1293('0xef')][_0x1293('0x12b')](db[_0x1293('0x54')],{'through':_0x1293('0x183'),'as':_0x1293('0x139')});db['Team'][_0x1293('0x12b')](db[_0x1293('0x5c')],{'through':_0x1293('0x18a'),'as':'SmsQueues'});db[_0x1293('0xef')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0x1293('0x18f'),'as':_0x1293('0x1dc')});db[_0x1293('0xef')][_0x1293('0x12b')](db[_0x1293('0x110')],{'through':_0x1293('0x1dd'),'as':_0x1293('0x13b')});db[_0x1293('0xef')][_0x1293('0x12b')](db[_0x1293('0x101')],{'through':_0x1293('0x1de'),'as':'VoicePrefixes'});db['Campaign'][_0x1293('0x11d')](db[_0x1293('0x77')],{'as':_0x1293('0x14f'),'foreignKey':'CampaignId'});db[_0x1293('0xf3')]['hasMany'](db[_0x1293('0x7b')],{'as':_0x1293('0x11f'),'foreignKey':_0x1293('0x1a0')});db[_0x1293('0xf3')][_0x1293('0x11d')](db[_0x1293('0x7d')],{'as':_0x1293('0x150'),'foreignKey':'CampaignId'});db[_0x1293('0xf3')][_0x1293('0x11d')](db[_0x1293('0x79')],{'as':_0x1293('0x151'),'foreignKey':_0x1293('0x1a0')});db[_0x1293('0xf3')][_0x1293('0x127')](db[_0x1293('0x2b')],{'as':_0x1293('0x2b'),'foreignKey':_0x1293('0x153')});db[_0x1293('0xf3')][_0x1293('0x127')](db[_0x1293('0x2b')],{'as':_0x1293('0x1df'),'foreignKey':_0x1293('0x1e0')});db[_0x1293('0xf3')][_0x1293('0x127')](db['Interval'],{'as':'Interval','foreignKey':_0x1293('0x154')});db['Campaign']['belongsTo'](db[_0x1293('0xe9')],{'as':'SquareProject','foreignKey':_0x1293('0x1e1')});db[_0x1293('0xf3')][_0x1293('0x12b')](db[_0x1293('0x100')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x1293('0xf3')][_0x1293('0x12b')](db[_0x1293('0x100')],{'as':_0x1293('0x158'),'through':_0x1293('0x1e2')});db['Attachment'][_0x1293('0x127')](db[_0x1293('0x178')],{'as':_0x1293('0x178'),'foreignKey':_0x1293('0x1e3')});db[_0x1293('0xf8')]['belongsTo'](db[_0x1293('0x45')],{});db[_0x1293('0xf8')]['belongsTo'](db[_0x1293('0x44')],{});db[_0x1293('0xf8')][_0x1293('0x127')](db['MailAccount'],{'foreignKey':_0x1293('0x1e4'),'as':_0x1293('0x1e5')});db['MailTransferReport'][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e6'),'as':_0x1293('0x1e7')});db['MailTransferReport']['belongsTo'](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e8'),'as':_0x1293('0x1e9')});db[_0x1293('0xf8')][_0x1293('0x127')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x1293('0x1ea')});db[_0x1293('0xf8')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x1293('0x1eb'),'as':_0x1293('0x1ec')});db[_0x1293('0xfa')][_0x1293('0x127')](db['ChatMessage'],{});db['ChatTransferReport'][_0x1293('0x127')](db[_0x1293('0x6b')],{});db[_0x1293('0xfa')][_0x1293('0x127')](db[_0x1293('0x65')],{'foreignKey':_0x1293('0x1ed'),'as':_0x1293('0x1e5')});db[_0x1293('0xfa')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e6'),'as':_0x1293('0x1e7')});db[_0x1293('0xfa')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e8'),'as':'ToAgent'});db['ChatTransferReport'][_0x1293('0x127')](db[_0x1293('0x70')],{'foreignKey':_0x1293('0x1ee'),'as':_0x1293('0x1ea')});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x1293('0x1ef'),'as':_0x1293('0x1ec')});db[_0x1293('0xfb')][_0x1293('0x127')](db[_0x1293('0x52')],{});db[_0x1293('0xfb')][_0x1293('0x127')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x1293('0x127')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x1293('0x1e5')});db[_0x1293('0xfb')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e6'),'as':_0x1293('0x1e7')});db[_0x1293('0xfb')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':'ToUserId','as':_0x1293('0x1e9')});db[_0x1293('0xfb')][_0x1293('0x127')](db[_0x1293('0x54')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x1293('0xfb')][_0x1293('0x127')](db[_0x1293('0x13e')],{'foreignKey':_0x1293('0x1f0'),'as':_0x1293('0x1ec')});db[_0x1293('0xfd')][_0x1293('0x127')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x1293('0xfd')][_0x1293('0x127')](db['OpenchannelAccount'],{'foreignKey':_0x1293('0x1f1'),'as':'FromAccount'});db[_0x1293('0xfd')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x1293('0xfd')][_0x1293('0x127')](db['User'],{'foreignKey':_0x1293('0x1e8'),'as':'ToAgent'});db[_0x1293('0xfd')][_0x1293('0x127')](db[_0x1293('0x13a')],{'foreignKey':_0x1293('0x1f2'),'as':_0x1293('0x1ea')});db[_0x1293('0xfd')][_0x1293('0x127')](db[_0x1293('0x5e')],{'foreignKey':'ToOpenchannelAccountId','as':_0x1293('0x1ec')});db[_0x1293('0xfe')][_0x1293('0x127')](db[_0x1293('0x5b')],{});db[_0x1293('0xfe')][_0x1293('0x127')](db[_0x1293('0x5a')],{});db[_0x1293('0xfe')][_0x1293('0x127')](db[_0x1293('0x184')],{'foreignKey':_0x1293('0x1f3'),'as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x1293('0x1e6'),'as':_0x1293('0x1e7')});db[_0x1293('0xfe')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e8'),'as':_0x1293('0x1e9')});db['SmsTransferReport'][_0x1293('0x127')](db['SmsQueue'],{'foreignKey':_0x1293('0x1f4'),'as':'ToQueue'});db['SmsTransferReport'][_0x1293('0x127')](db[_0x1293('0x184')],{'foreignKey':'ToSmsAccountId','as':_0x1293('0x1ec')});db[_0x1293('0x100')][_0x1293('0x11d')](db[_0x1293('0x165')],{'as':'Dispositions','foreignKey':_0x1293('0x16b'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x100')][_0x1293('0x11d')](db[_0x1293('0x81')],{'as':_0x1293('0x1f5'),'foreignKey':_0x1293('0x16b')});db['CmList'][_0x1293('0x11d')](db[_0x1293('0x75')],{'as':_0x1293('0x12c'),'onDelete':'cascade','foreignKey':_0x1293('0x16b')});db[_0x1293('0x100')][_0x1293('0x11d')](db[_0x1293('0x7b')],{'as':_0x1293('0x11f'),'foreignKey':'ListId'});db['CmList'][_0x1293('0x11d')](db[_0x1293('0x7d')],{'as':_0x1293('0x1f6'),'foreignKey':'ListId'});db[_0x1293('0x100')][_0x1293('0x11d')](db[_0x1293('0x7f')],{'as':_0x1293('0x7f'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x100')][_0x1293('0x12b')](db[_0x1293('0x1d')],{'as':_0x1293('0x1f7'),'through':_0x1293('0x156')});db[_0x1293('0x100')][_0x1293('0x12b')](db['User'],{'as':'Agents','through':_0x1293('0x12f')});db[_0x1293('0x101')][_0x1293('0x11d')](db[_0x1293('0x18')],{'as':_0x1293('0x11e'),'onDelete':_0x1293('0x11a')});db[_0x1293('0x101')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':'Agents','through':_0x1293('0x114')});db[_0x1293('0x101')]['belongsToMany'](db[_0x1293('0xef')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x1293('0x102')]['hasMany'](db[_0x1293('0x118')],{'as':'Users','foreignKey':'userProfileId'});db[_0x1293('0x102')]['hasMany'](db[_0x1293('0x104')],{'as':_0x1293('0x1f8'),'foreignKey':'userProfileId','onDelete':_0x1293('0x11a')});db['UserProfileSection'][_0x1293('0x11d')](db[_0x1293('0x1f9')],{'as':_0x1293('0x1fa'),'foreignKey':_0x1293('0x1fb'),'onDelete':_0x1293('0x11a')});db['WhatsappAccount']['hasMany'](db[_0x1293('0x165')],{'as':_0x1293('0x166'),'foreignKey':'WhatsappAccountId','onDelete':_0x1293('0x11a')});db[_0x1293('0x107')][_0x1293('0x11d')](db[_0x1293('0x86')],{'as':_0x1293('0x168'),'foreignKey':_0x1293('0x1fc')});db[_0x1293('0x107')][_0x1293('0x11d')](db[_0x1293('0x1fd')],{'as':_0x1293('0x159'),'foreignKey':_0x1293('0x1fc')});db['WhatsappAccount']['hasMany'](db['WhatsappInteraction'],{'as':_0x1293('0x169')});db[_0x1293('0x107')][_0x1293('0x11d')](db[_0x1293('0x109')],{'as':_0x1293('0x17d')});db['WhatsappAccount'][_0x1293('0x127')](db['CmList'],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x107')][_0x1293('0x127')](db['Pause'],{'as':_0x1293('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1293('0x107')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x1293('0x127')](db[_0x1293('0x118')],{'onDelete':_0x1293('0x179')});db[_0x1293('0x109')][_0x1293('0x127')](db[_0x1293('0x110')],{'onDelete':_0x1293('0x179')});db[_0x1293('0x109')][_0x1293('0x127')](db[_0x1293('0x107')],{'onDelete':'restrict'});db[_0x1293('0x109')][_0x1293('0x127')](db[_0x1293('0x8a')],{'onDelete':_0x1293('0x179'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x1293('0x127')](db[_0x1293('0x92')],{'onDelete':'restrict','foreignKey':_0x1293('0x17a')});db[_0x1293('0x10b')][_0x1293('0x11d')](db['WhatsappMessage'],{'as':_0x1293('0x159'),'onDelete':_0x1293('0x11a'),'foreignKey':_0x1293('0x1fe')});db[_0x1293('0x10b')][_0x1293('0x127')](db[_0x1293('0x107')],{'as':_0x1293('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0x1293('0x10b')]['belongsTo'](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x10b')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x170'),'foreignKey':_0x1293('0x11b')});db[_0x1293('0x10b')][_0x1293('0x12b')](db[_0x1293('0x92')],{'through':'whatsapp_interaction_has_tags','as':_0x1293('0x172')});db[_0x1293('0x10b')][_0x1293('0x12b')](db['Tag'],{'through':_0x1293('0x1b1'),'as':_0x1293('0x188')});db['WhatsappInteraction'][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x1293('0x1fe')});db[_0x1293('0x1fd')][_0x1293('0x127')](db[_0x1293('0x118')],{'as':_0x1293('0x118')});db[_0x1293('0x1fd')][_0x1293('0x127')](db['CmContact'],{'onDelete':'cascade','as':_0x1293('0x160')});db[_0x1293('0x1fd')][_0x1293('0x127')](db['WhatsappInteraction'],{'onDelete':_0x1293('0x11a'),'as':_0x1293('0x176'),'foreignKey':'WhatsappInteractionId'});db[_0x1293('0x1fd')]['belongsTo'](db[_0x1293('0x107')],{'as':_0x1293('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0x1293('0x1ff')][_0x1293('0x127')](db['WhatsappAccount'],{});db[_0x1293('0x1ff')]['belongsTo'](db[_0x1293('0x100')],{'as':_0x1293('0x16a'),'foreignKey':_0x1293('0x16b')});db[_0x1293('0x1ff')][_0x1293('0x127')](db[_0x1293('0x75')],{'as':_0x1293('0x160'),'foreignKey':_0x1293('0x161')});db[_0x1293('0x1ff')][_0x1293('0x127')](db[_0x1293('0x10b')],{});db[_0x1293('0x1ff')][_0x1293('0x127')](db[_0x1293('0x110')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x1293('0x1fd')],{});db[_0x1293('0x1ff')][_0x1293('0x127')](db['User'],{});db[_0x1293('0x10e')]['belongsTo'](db['WhatsappMessage'],{});db[_0x1293('0x10e')][_0x1293('0x127')](db[_0x1293('0x10b')],{});db[_0x1293('0x10e')][_0x1293('0x127')](db[_0x1293('0x107')],{'foreignKey':_0x1293('0x200'),'as':'FromAccount'});db[_0x1293('0x10e')]['belongsTo'](db[_0x1293('0x107')],{'foreignKey':_0x1293('0x201'),'as':_0x1293('0x1ec')});db[_0x1293('0x10e')][_0x1293('0x127')](db[_0x1293('0x110')],{'foreignKey':_0x1293('0x202'),'as':_0x1293('0x1ea')});db[_0x1293('0x10e')][_0x1293('0x127')](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e6'),'as':_0x1293('0x1e7')});db['WhatsappTransferReport']['belongsTo'](db[_0x1293('0x118')],{'foreignKey':_0x1293('0x1e8'),'as':'ToAgent'});db[_0x1293('0x110')][_0x1293('0x12b')](db[_0x1293('0x118')],{'as':_0x1293('0x16c'),'through':_0x1293('0x3a'),'foreignKey':_0x1293('0x203')});db[_0x1293('0x110')][_0x1293('0x12b')](db[_0x1293('0xef')],{'through':_0x1293('0x1dd'),'as':'Teams'});db[_0x1293('0x116')][_0x1293('0x127')](db['User'],{'as':_0x1293('0x204'),'foreignKey':_0x1293('0x11b'),'onDelete':_0x1293('0x11a'),'hooks':!![]});db[_0x1293('0x112')][_0x1293('0x119')](db['Dynamics365Account'],{'as':_0x1293('0xcf'),'onDelete':'restrict'});db[_0x1293('0x112')][_0x1293('0x119')](db['MailServerIn'],{'as':_0x1293('0x164'),'onDelete':_0x1293('0x179')});db[_0x1293('0x112')][_0x1293('0x119')](db[_0x1293('0x3d')],{'as':'Smtp','onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 15bad24..24628e0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x647b=['/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/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/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/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/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','static','/demo','root','/snippet','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue'];(function(_0x3365c3,_0x18dc4e){var _0x13cdd6=function(_0x4328a0){while(--_0x4328a0){_0x3365c3['push'](_0x3365c3['shift']());}};_0x13cdd6(++_0x18dc4e);}(_0x647b,0xc7));var _0xb647=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x647b[_0x618414];return _0x21c19a;};'use strict';var path=require(_0xb647('0x0'));var express=require(_0xb647('0x1'));var errors=require(_0xb647('0x2'));var config=require(_0xb647('0x3'));var setupLoggers=require(_0xb647('0x4'))[_0xb647('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0xb647('0x6')]=function(_0xb5c18d){return setupLoggers(_0xb5c18d)[_0xb647('0x7')](function(){_0xb5c18d['use'](_0xb647('0x8'),require(_0xb647('0x9')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb'),require(_0xb647('0xc')));_0xb5c18d[_0xb647('0xa')]('/api/voice/contexts',require(_0xb647('0xd')));_0xb5c18d[_0xb647('0xa')]('/api/voice/extensions',require('./api/voiceExtension'));_0xb5c18d[_0xb647('0xa')]('/api/voice/mohs',require(_0xb647('0xe')));_0xb5c18d[_0xb647('0xa')]('/api/voice/queues',require('./api/voiceQueue'));_0xb5c18d[_0xb647('0xa')]('/api/voice/recordings',require(_0xb647('0xf')));_0xb5c18d['use'](_0xb647('0x10'),require('./api/screenRecording'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x11'),require('./api/voiceMail'));_0xb5c18d['use'](_0xb647('0x12'),require(_0xb647('0x13')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x14'),require('./api/voiceCallReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x15'),require(_0xb647('0x16')));_0xb5c18d[_0xb647('0xa')]('/api/voice/agents/reports',require(_0xb647('0x17')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x18'),require(_0xb647('0x19')));_0xb5c18d[_0xb647('0xa')]('/api/members/reports',require(_0xb647('0x1a')));_0xb5c18d['use'](_0xb647('0x1b'),require(_0xb647('0x1c')));_0xb5c18d['use'](_0xb647('0x1d'),require(_0xb647('0x1e')));_0xb5c18d[_0xb647('0xa')]('/api/mail/out_servers',require(_0xb647('0x1f')));_0xb5c18d['use'](_0xb647('0x20'),require(_0xb647('0x21')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x22'),require(_0xb647('0x23')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x24'),require(_0xb647('0x25')));_0xb5c18d[_0xb647('0xa')]('/api/mail/interactions',require(_0xb647('0x26')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x27'),require('./api/mailMessage'));_0xb5c18d['use'](_0xb647('0x28'),require(_0xb647('0x29')));_0xb5c18d['use'](_0xb647('0x2a'),require(_0xb647('0x2b')));_0xb5c18d[_0xb647('0xa')]('/api/dashboards',require(_0xb647('0x2c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x2d'),require(_0xb647('0x2e')));_0xb5c18d['use'](_0xb647('0x2f'),require('./api/faxAccount'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x30'),require(_0xb647('0x31')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x32'),require(_0xb647('0x33')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x34'),require('./api/faxMessage'));_0xb5c18d[_0xb647('0xa')]('/api/fax/queues',require(_0xb647('0x35')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x36'),require('./api/faxQueueReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x37'),require(_0xb647('0x38')));_0xb5c18d['use']('/api/sms/applications',require(_0xb647('0x39')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3a'),require(_0xb647('0x3b')));_0xb5c18d['use'](_0xb647('0x3c'),require('./api/smsMessage'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3d'),require(_0xb647('0x3e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3f'),require(_0xb647('0x40')));_0xb5c18d['use']('/api/openchannel/applications',require(_0xb647('0x41')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x42'),require(_0xb647('0x43')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x44'),require(_0xb647('0x45')));_0xb5c18d['use'](_0xb647('0x46'),require(_0xb647('0x47')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x48'),require('./api/chatWebsite'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x49'),require(_0xb647('0x4a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4b'),require(_0xb647('0x4c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4d'),require(_0xb647('0x4e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4f'),require(_0xb647('0x50')));_0xb5c18d['use'](_0xb647('0x51'),require(_0xb647('0x52')));_0xb5c18d[_0xb647('0xa')]('/api/chat/queues',require('./api/chatQueue'));_0xb5c18d[_0xb647('0xa')]('/api/chat/groups',require(_0xb647('0x53')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x54'),require('./api/chatProactiveAction'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x55'),require(_0xb647('0x56')));_0xb5c18d['use'](_0xb647('0x57'),require(_0xb647('0x58')));_0xb5c18d['use'](_0xb647('0x59'),require(_0xb647('0x5a')));_0xb5c18d['use']('/api/cm/hopper_black',require(_0xb647('0x5b')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x5c'),require(_0xb647('0x5d')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x5e'),require(_0xb647('0x5f')));_0xb5c18d['use'](_0xb647('0x60'),require(_0xb647('0x61')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x62'),require('./api/action'));_0xb5c18d[_0xb647('0xa')]('/api/automations',require(_0xb647('0x63')));_0xb5c18d[_0xb647('0xa')]('/api/canned_answers',require(_0xb647('0x64')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x65'),require(_0xb647('0x66')));_0xb5c18d[_0xb647('0xa')]('/api/conditions',require(_0xb647('0x67')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x68'),require(_0xb647('0x69')));_0xb5c18d['use']('/api/pauses',require(_0xb647('0x6a')));_0xb5c18d[_0xb647('0xa')]('/api/cdr',require('./api/cdr'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6b'),require('./api/voiceQueuesLog'));_0xb5c18d['use'](_0xb647('0x6c'),require('./api/schedule'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6d'),require(_0xb647('0x6e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6f'),require(_0xb647('0x70')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x71'),require('./api/contactItemType'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x72'),require(_0xb647('0x73')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x74'),require('./api/cmHopperAdditionalPhone'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x75'),require(_0xb647('0x76')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x77'),require('./api/trigger'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x78'),require('./api/variable'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x79'),require(_0xb647('0x7a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x7b'),require('./api/integrationReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x7c'),require(_0xb647('0x7d')));_0xb5c18d['use'](_0xb647('0x7e'),require(_0xb647('0x7f')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x80'),require(_0xb647('0x81')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x82'),require(_0xb647('0x83')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x84'),require(_0xb647('0x85')));_0xb5c18d['use'](_0xb647('0x86'),require(_0xb647('0x87')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x88'),require(_0xb647('0x89')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x8a'),require(_0xb647('0x8b')));_0xb5c18d['use'](_0xb647('0x8c'),require(_0xb647('0x8d')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0xb5c18d[_0xb647('0xa')]('/api/integrations/sugarcrm/configurations',require(_0xb647('0x8e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x8f'),require(_0xb647('0x90')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x91'),require(_0xb647('0x92')));_0xb5c18d['use'](_0xb647('0x93'),require('./api/intDeskConfiguration'));_0xb5c18d['use'](_0xb647('0x94'),require(_0xb647('0x95')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/zoho/accounts',require(_0xb647('0x96')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x97'),require(_0xb647('0x98')));_0xb5c18d['use'](_0xb647('0x99'),require(_0xb647('0x9a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9b'),require(_0xb647('0x9c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9d'),require('./api/intZendeskConfiguration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9e'),require('./api/intZendeskField'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9f'),require(_0xb647('0xa0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa1'),require(_0xb647('0xa2')));_0xb5c18d['use'](_0xb647('0xa3'),require(_0xb647('0xa4')));_0xb5c18d['use'](_0xb647('0xa5'),require(_0xb647('0xa6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa7'),require('./api/intVtigerConfiguration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa8'),require(_0xb647('0xa9')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/servicenow/accounts',require(_0xb647('0xaa')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xab'),require(_0xb647('0xac')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xad'),require(_0xb647('0xae')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xaf'),require(_0xb647('0xb0')));_0xb5c18d['use'](_0xb647('0xb1'),require('./api/intDynamics365Configuration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb2'),require(_0xb647('0xb3')));_0xb5c18d['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0xb5c18d[_0xb647('0xa')]('/api/integrations/freshsales/configurations',require(_0xb647('0xb4')));_0xb5c18d['use']('/api/integrations/freshsales/fields',require(_0xb647('0xb5')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb6'),require(_0xb647('0xb7')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb8'),require(_0xb647('0xb9')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xba'),require(_0xb647('0xbb')));_0xb5c18d[_0xb647('0xa')]('/api/jscripty/answers/reports',require(_0xb647('0xbc')));_0xb5c18d['use']('/api/jscripty/questions/reports',require(_0xb647('0xbd')));_0xb5c18d[_0xb647('0xa')]('/api/jscripty/sessions/reports',require(_0xb647('0xbe')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xbf'),require(_0xb647('0xc0')));_0xb5c18d['use']('/api/square/reports',require(_0xb647('0xc1')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc2'),require(_0xb647('0xc3')));_0xb5c18d['use'](_0xb647('0xc4'),require(_0xb647('0xc5')));_0xb5c18d[_0xb647('0xa')]('/api/settings',require(_0xb647('0xc6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc7'),require(_0xb647('0xc8')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc9'),require('./api/squareProject'));_0xb5c18d['use'](_0xb647('0xca'),require(_0xb647('0xcb')));_0xb5c18d['use'](_0xb647('0xcc'),require('./api/squareMessage'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xcd'),require(_0xb647('0xce')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xcf'),require('./api/license'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd0'),require(_0xb647('0xd1')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd2'),require('./api/migration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd3'),require(_0xb647('0xd4')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd5'),require(_0xb647('0xd6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd7'),require(_0xb647('0xd8')));_0xb5c18d['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd9'),require(_0xb647('0xda')));_0xb5c18d['use'](_0xb647('0xdb'),require(_0xb647('0xdc')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xdd'),require(_0xb647('0xde')));_0xb5c18d['use'](_0xb647('0xdf'),require(_0xb647('0xe0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe1'),require(_0xb647('0xe2')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe3'),require('./api/userProfile'));_0xb5c18d['use']('/api/userProfile/sections',require(_0xb647('0xe4')));_0xb5c18d['use'](_0xb647('0xe5'),require(_0xb647('0xe6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe7'),require(_0xb647('0xe8')));_0xb5c18d['use'](_0xb647('0xe9'),require('./api/whatsappAccount'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xea'),require('./api/whatsappApplication'));_0xb5c18d[_0xb647('0xa')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0xb5c18d['use'](_0xb647('0xeb'),require(_0xb647('0xec')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xed'),require('./api/whatsappQueueReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xee'),require(_0xb647('0xef')));_0xb5c18d[_0xb647('0xa')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0xb5c18d['use'](_0xb647('0xf0'),require(_0xb647('0xf1')));_0xb5c18d[_0xb647('0xa')]('/api/realtime',require('./api/realtime'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf2'),require(_0xb647('0xf3')));_0xb5c18d['use'](_0xb647('0xf4'),require(_0xb647('0xf5')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf6'),require('./api/authGoogle'));_0xb5c18d['use'](_0xb647('0xf7'),require('./api/authActiveDirectory'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf8'),require(_0xb647('0xf9')));_0xb5c18d['use'](_0xb647('0xfa'),require(_0xb647('0xfb')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xfc'),require('./api/version'));_0xb5c18d[_0xb647('0xa')]('/api/system',require(_0xb647('0xfd')));_0xb5c18d[_0xb647('0xa')]('/api/pm2',require(_0xb647('0xfe')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xff'),require(_0xb647('0x100')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x101'),clientSideLogs);_0xb5c18d['use'](_0xb647('0x102'),express['static'](path[_0xb647('0x103')](config['root'],'/apidoc')));_0xb5c18d['use']('/www',express[_0xb647('0x104')](path[_0xb647('0x103')](config['root'],'/www')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x105'),express[_0xb647('0x104')](path[_0xb647('0x103')](config[_0xb647('0x106')],_0xb647('0x105'))));_0xb5c18d[_0xb647('0xa')](_0xb647('0x107'),express[_0xb647('0x104')](path[_0xb647('0x103')](config[_0xb647('0x106')],_0xb647('0x108'),'3.1.0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x109'),express['static'](path[_0xb647('0x103')](config['root'],_0xb647('0x10a'))));_0xb5c18d['route'](_0xb647('0x10b'))['get'](errors[0x194]);_0xb5c18d[_0xb647('0x10c')]('/*')['get'](function(_0x36294f,_0x357b16){_0x357b16['sendFile'](path[_0xb647('0x10d')](_0xb5c18d['get']('appPath')+_0xb647('0x10e')));});return _0xb5c18d;});}; \ No newline at end of file +var _0xed66=['./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/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/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./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','/api/license','./api/campaign','/api/migrations','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/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/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','/www','root','/demo','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds'];(function(_0x24574b,_0x43a78e){var _0x107420=function(_0x4534c3){while(--_0x4534c3){_0x24574b['push'](_0x24574b['shift']());}};_0x107420(++_0x43a78e);}(_0xed66,0x1c6));var _0x6ed6=function(_0x1432a6,_0x5846c5){_0x1432a6=_0x1432a6-0x0;var _0x3eab00=_0xed66[_0x1432a6];return _0x3eab00;};'use strict';var path=require(_0x6ed6('0x0'));var express=require('express');var errors=require(_0x6ed6('0x1'));var config=require(_0x6ed6('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0x6ed6('0x3')];var clientSideLogs=require(_0x6ed6('0x4'));exports[_0x6ed6('0x5')]=function(_0x571428){return setupLoggers(_0x571428)[_0x6ed6('0x6')](function(){_0x571428[_0x6ed6('0x7')](_0x6ed6('0x8'),require(_0x6ed6('0x9')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa'),require(_0x6ed6('0xb')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xc'),require(_0x6ed6('0xd')));_0x571428[_0x6ed6('0x7')]('/api/voice/extensions',require(_0x6ed6('0xe')));_0x571428['use'](_0x6ed6('0xf'),require(_0x6ed6('0x10')));_0x571428['use']('/api/voice/queues',require(_0x6ed6('0x11')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x12'),require(_0x6ed6('0x13')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x14'),require(_0x6ed6('0x15')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x16'),require('./api/voiceMail'));_0x571428[_0x6ed6('0x7')]('/api/voice/mails/messages',require(_0x6ed6('0x17')));_0x571428['use'](_0x6ed6('0x18'),require(_0x6ed6('0x19')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x1a'),require(_0x6ed6('0x1b')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x1c'),require(_0x6ed6('0x1d')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x1e'),require(_0x6ed6('0x1f')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x20'),require(_0x6ed6('0x21')));_0x571428['use']('/api/trunks',require(_0x6ed6('0x22')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x23'),require(_0x6ed6('0x24')));_0x571428[_0x6ed6('0x7')]('/api/mail/out_servers',require(_0x6ed6('0x25')));_0x571428['use']('/api/mail/accounts',require(_0x6ed6('0x26')));_0x571428[_0x6ed6('0x7')]('/api/mail/queues',require('./api/mailQueue'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x27'),require(_0x6ed6('0x28')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x29'),require(_0x6ed6('0x2a')));_0x571428['use']('/api/mail/messages',require(_0x6ed6('0x2b')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x2c'),require('./api/mailApplication'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x2d'),require('./api/mailQueueReport'));_0x571428[_0x6ed6('0x7')]('/api/dashboards',require(_0x6ed6('0x2e')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x2f'),require(_0x6ed6('0x30')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x31'),require(_0x6ed6('0x32')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x33'),require(_0x6ed6('0x34')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x35'),require(_0x6ed6('0x36')));_0x571428['use'](_0x6ed6('0x37'),require(_0x6ed6('0x38')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x39'),require(_0x6ed6('0x3a')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x3b'),require(_0x6ed6('0x3c')));_0x571428[_0x6ed6('0x7')]('/api/sms/accounts',require(_0x6ed6('0x3d')));_0x571428[_0x6ed6('0x7')]('/api/sms/applications',require(_0x6ed6('0x3e')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x3f'),require(_0x6ed6('0x40')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x41'),require('./api/smsMessage'));_0x571428[_0x6ed6('0x7')]('/api/sms/queues',require(_0x6ed6('0x42')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x43'),require(_0x6ed6('0x44')));_0x571428['use'](_0x6ed6('0x45'),require('./api/openchannelApplication'));_0x571428[_0x6ed6('0x7')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x46'),require(_0x6ed6('0x47')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x48'),require('./api/openchannelQueue'));_0x571428[_0x6ed6('0x7')]('/api/chat/websites',require(_0x6ed6('0x49')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x4a'),require('./api/openchannelQueueReport'));_0x571428['use']('/api/chat/applications',require(_0x6ed6('0x4b')));_0x571428[_0x6ed6('0x7')]('/api/chat/interactions',require(_0x6ed6('0x4c')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x4d'),require(_0x6ed6('0x4e')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x4f'),require(_0x6ed6('0x50')));_0x571428['use']('/api/chat/queues',require(_0x6ed6('0x51')));_0x571428['use'](_0x6ed6('0x52'),require('./api/chatGroup'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x53'),require('./api/chatProactiveAction'));_0x571428[_0x6ed6('0x7')]('/api/cm/companies',require(_0x6ed6('0x54')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x55'),require(_0x6ed6('0x56')));_0x571428[_0x6ed6('0x7')]('/api/cm/hopper',require(_0x6ed6('0x57')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x58'),require(_0x6ed6('0x59')));_0x571428['use'](_0x6ed6('0x5a'),require(_0x6ed6('0x5b')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x5c'),require('./api/cmHopperHistory'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x5d'),require(_0x6ed6('0x5e')));_0x571428[_0x6ed6('0x7')]('/api/actions',require(_0x6ed6('0x5f')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x60'),require('./api/automation'));_0x571428[_0x6ed6('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x571428['use']('/api/dispositions',require('./api/disposition'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x61'),require(_0x6ed6('0x62')));_0x571428[_0x6ed6('0x7')]('/api/intervals',require(_0x6ed6('0x63')));_0x571428[_0x6ed6('0x7')]('/api/pauses',require(_0x6ed6('0x64')));_0x571428['use'](_0x6ed6('0x65'),require(_0x6ed6('0x66')));_0x571428['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x67'),require(_0x6ed6('0x68')));_0x571428['use'](_0x6ed6('0x69'),require(_0x6ed6('0x6a')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x6b'),require(_0x6ed6('0x6c')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x6d'),require(_0x6ed6('0x6e')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x6f'),require('./api/cmContactHasItem'));_0x571428['use'](_0x6ed6('0x70'),require('./api/cmHopperAdditionalPhone'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x71'),require('./api/template'));_0x571428['use'](_0x6ed6('0x72'),require(_0x6ed6('0x73')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x74'),require(_0x6ed6('0x75')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x76'),require(_0x6ed6('0x77')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x78'),require(_0x6ed6('0x79')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x7a'),require(_0x6ed6('0x7b')));_0x571428['use'](_0x6ed6('0x7c'),require(_0x6ed6('0x7d')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x7e'),require(_0x6ed6('0x7f')));_0x571428['use'](_0x6ed6('0x80'),require(_0x6ed6('0x81')));_0x571428['use'](_0x6ed6('0x82'),require(_0x6ed6('0x83')));_0x571428['use'](_0x6ed6('0x84'),require(_0x6ed6('0x85')));_0x571428['use'](_0x6ed6('0x86'),require(_0x6ed6('0x87')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x88'),require(_0x6ed6('0x89')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x8a'),require(_0x6ed6('0x8b')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x8c'),require('./api/intSugarcrmAccount'));_0x571428['use'](_0x6ed6('0x8d'),require(_0x6ed6('0x8e')));_0x571428[_0x6ed6('0x7')]('/api/integrations/sugarcrm/fields',require(_0x6ed6('0x8f')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x90'),require(_0x6ed6('0x91')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x92'),require(_0x6ed6('0x93')));_0x571428['use'](_0x6ed6('0x94'),require(_0x6ed6('0x95')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x96'),require(_0x6ed6('0x97')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x98'),require(_0x6ed6('0x99')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x9a'),require(_0x6ed6('0x9b')));_0x571428['use'](_0x6ed6('0x9c'),require(_0x6ed6('0x9d')));_0x571428[_0x6ed6('0x7')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x9e'),require(_0x6ed6('0x9f')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa0'),require(_0x6ed6('0xa1')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa2'),require(_0x6ed6('0xa3')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa4'),require(_0x6ed6('0xa5')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa6'),require(_0x6ed6('0xa7')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xa8'),require('./api/intVtigerConfiguration'));_0x571428['use']('/api/integrations/vtiger/fields',require(_0x6ed6('0xa9')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xaa'),require(_0x6ed6('0xab')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xac'),require(_0x6ed6('0xad')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xae'),require('./api/intServicenowField'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xaf'),require(_0x6ed6('0xb0')));_0x571428['use'](_0x6ed6('0xb1'),require(_0x6ed6('0xb2')));_0x571428[_0x6ed6('0x7')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xb3'),require(_0x6ed6('0xb4')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xb5'),require(_0x6ed6('0xb6')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xb7'),require(_0x6ed6('0xb8')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xb9'),require('./api/network'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xba'),require(_0x6ed6('0xbb')));_0x571428['use'](_0x6ed6('0xbc'),require(_0x6ed6('0xbd')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xbe'),require('./api/jscriptyAnswerReport'));_0x571428['use'](_0x6ed6('0xbf'),require(_0x6ed6('0xc0')));_0x571428['use'](_0x6ed6('0xc1'),require(_0x6ed6('0xc2')));_0x571428[_0x6ed6('0x7')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x571428['use'](_0x6ed6('0xc3'),require(_0x6ed6('0xc4')));_0x571428['use'](_0x6ed6('0xc5'),require(_0x6ed6('0xc6')));_0x571428['use'](_0x6ed6('0xc7'),require(_0x6ed6('0xc8')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xc9'),require(_0x6ed6('0xca')));_0x571428['use'](_0x6ed6('0xcb'),require('./api/squareOdbc'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xcc'),require(_0x6ed6('0xcd')));_0x571428['use'](_0x6ed6('0xce'),require(_0x6ed6('0xcf')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xd0'),require(_0x6ed6('0xd1')));_0x571428['use']('/api/teams',require(_0x6ed6('0xd2')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xd3'),require('./api/license'));_0x571428[_0x6ed6('0x7')]('/api/campaigns',require(_0x6ed6('0xd4')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xd5'),require('./api/migration'));_0x571428[_0x6ed6('0x7')]('/api/attachments',require(_0x6ed6('0xd6')));_0x571428['use']('/api/plugins',require(_0x6ed6('0xd7')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xd8'),require('./api/mailTransferReport'));_0x571428['use'](_0x6ed6('0xd9'),require('./api/chatTransferReport'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xda'),require('./api/faxTransferReport'));_0x571428['use'](_0x6ed6('0xdb'),require(_0x6ed6('0xdc')));_0x571428['use'](_0x6ed6('0xdd'),require(_0x6ed6('0xde')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xdf'),require('./api/cmList'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xe0'),require('./api/voicePrefix'));_0x571428[_0x6ed6('0x7')]('/api/userProfiles',require(_0x6ed6('0xe1')));_0x571428['use']('/api/userProfile/sections',require(_0x6ed6('0xe2')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xe3'),require(_0x6ed6('0xe4')));_0x571428['use'](_0x6ed6('0xe5'),require(_0x6ed6('0xe6')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xe7'),require(_0x6ed6('0xe8')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xe9'),require(_0x6ed6('0xea')));_0x571428[_0x6ed6('0x7')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xeb'),require('./api/whatsappMessage'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xec'),require(_0x6ed6('0xed')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xee'),require(_0x6ed6('0xef')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xf0'),require(_0x6ed6('0xf1')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xf2'),require(_0x6ed6('0xf3')));_0x571428['use'](_0x6ed6('0xf4'),require(_0x6ed6('0xf5')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xf6'),require(_0x6ed6('0xf7')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xf8'),require(_0x6ed6('0xf9')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xfa'),require(_0x6ed6('0xfb')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xfc'),require(_0x6ed6('0xfd')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0xfe'),require(_0x6ed6('0xff')));_0x571428[_0x6ed6('0x7')]('/api/rpc',require(_0x6ed6('0x100')));_0x571428[_0x6ed6('0x7')]('/api/version',require(_0x6ed6('0x101')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x102'),require(_0x6ed6('0x103')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x104'),require('./api/pm2'));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x105'),require(_0x6ed6('0x106')));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x107'),clientSideLogs);_0x571428['use']('/apidoc',express[_0x6ed6('0x108')](path[_0x6ed6('0x109')](config['root'],_0x6ed6('0x10a'))));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x10b'),express[_0x6ed6('0x108')](path['join'](config[_0x6ed6('0x10c')],_0x6ed6('0x10b'))));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x10d'),express[_0x6ed6('0x108')](path[_0x6ed6('0x109')](config[_0x6ed6('0x10c')],_0x6ed6('0x10d'))));_0x571428['use']('/snippet',express[_0x6ed6('0x108')](path[_0x6ed6('0x109')](config['root'],'snippet',_0x6ed6('0x10e'))));_0x571428[_0x6ed6('0x7')](_0x6ed6('0x10f'),express['static'](path[_0x6ed6('0x109')](config['root'],_0x6ed6('0x110'))));_0x571428[_0x6ed6('0x111')](_0x6ed6('0x112'))[_0x6ed6('0x113')](errors[0x194]);_0x571428[_0x6ed6('0x111')]('/*')[_0x6ed6('0x113')](function(_0x21f1ce,_0x54b358){_0x54b358[_0x6ed6('0x114')](path[_0x6ed6('0x115')](_0x571428['get'](_0x6ed6('0x116'))+_0x6ed6('0x117')));});return _0x571428;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b20f6b3..a21be0e 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e9=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x5d5770,_0x28ba90){var _0x2e2301=function(_0x2bd5bb){while(--_0x2bd5bb){_0x5d5770['push'](_0x5d5770['shift']());}};_0x2e2301(++_0x28ba90);}(_0x34e9,0x167));var _0x934e=function(_0x1c92f8,_0x337c6e){_0x1c92f8=_0x1c92f8-0x0;var _0x39dd8a=_0x34e9[_0x1c92f8];return _0x39dd8a;};'use strict';var jayson=require(_0x934e('0x0'));var _=require(_0x934e('0x1'));var config=require(_0x934e('0x2'));exports[_0x934e('0x3')]=function(){return new Promise(function(_0x5056b1,_0x3c9b9b){var _0x348b12={};_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x5')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceExtension/voiceExtension.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x6')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceRecording/voiceRecording.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x7')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x8')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x9')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xa')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xb')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xc')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xd')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xe')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0xf')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x10')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x11')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/mailMessage/mailMessage.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x12')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x13')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x14')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x15')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x16')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x17')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/faxQueue/faxQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x18')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x19')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1b')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/smsQueue/smsQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1c')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1d')));_0x348b12=_['merge'](_0x348b12,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x1e')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1f')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x20')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/chatQueue/chatQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x21')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x22')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x23')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x24')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x25')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/interval/interval.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x26')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x27')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x28')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/template/template.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x29')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x2a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2b')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2c')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x2d')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2e')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2f')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x30')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x31')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x32')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x33')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x34')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x35')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x348b12=_['merge'](_0x348b12,require('../api/setting/setting.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareOdbc/squareOdbc.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x36')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareRecording/squareRecording.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x37')));_0x348b12=_['merge'](_0x348b12,require('../api/campaign/campaign.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x38')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/plugin/plugin.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x39')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x3a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x3b')));var _0x3710eb=jayson[_0x934e('0x3c')](_0x348b12)['http']();var _0x59bedb=config['rpc'][_0x934e('0x3d')]||config[_0x934e('0x3d')]+0x1;var _0x5e0550=config['rpc']['ip']||_0x934e('0x3e');_0x3710eb['on'](_0x934e('0x3f'),function(_0x28fada){return _0x3c9b9b(_0x28fada);});_0x3710eb[_0x934e('0x3')](_0x59bedb,_0x5e0550,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5e0550,_0x59bedb);require('../config/triggers')[_0x934e('0x40')]();return _0x5056b1(_0x934e('0x41')+_0x5e0550+':'+_0x59bedb);});});}; \ No newline at end of file +var _0xf163=['../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.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/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen'];(function(_0x2d898d,_0x28a101){var _0x342607=function(_0x35da88){while(--_0x35da88){_0x2d898d['push'](_0x2d898d['shift']());}};_0x342607(++_0x28a101);}(_0xf163,0x129));var _0x3f16=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xf163[_0x256d6a];return _0x460058;};'use strict';var jayson=require(_0x3f16('0x0'));var _=require('lodash');var config=require(_0x3f16('0x1'));exports[_0x3f16('0x2')]=function(){return new Promise(function(_0x3ccaa4,_0x335c2b){var _0x3b5045={};_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x3')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/voiceExtension/voiceExtension.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x5')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x6')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x7')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x8')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x9')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0xa')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0xb')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0xc')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0xd')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0xe')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0xf')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x10')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x11')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x12')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x13')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x14')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x15')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x16')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x17')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x18')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x19')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x1a')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x1b')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/smsMessage/smsMessage.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/smsQueue/smsQueue.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x1c')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x1d')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x1e')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x1f')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x20')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x21')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x22')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/chatQueue/chatQueue.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/cmContact/cmContact.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x23')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x24')));_0x3b5045=_['merge'](_0x3b5045,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x25')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x26')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x27')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/pause/pause.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x28')));_0x3b5045=_['merge'](_0x3b5045,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x29')));_0x3b5045=_['merge'](_0x3b5045,require('../api/trigger/trigger.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x2a')));_0x3b5045=_['merge'](_0x3b5045,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x2b')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x2c')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x2d')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x2e')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x2f')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x30')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x31')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x32')));_0x3b5045=_['merge'](_0x3b5045,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x33')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x34')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x35')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x36')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/setting/setting.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x37')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x38')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x39')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x3a')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x3b')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x3c')));_0x3b5045=_['merge'](_0x3b5045,require(_0x3f16('0x3d')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x3e')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x3f')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x40')));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x3b5045=_[_0x3f16('0x4')](_0x3b5045,require(_0x3f16('0x41')));var _0x2dc2a8=jayson[_0x3f16('0x42')](_0x3b5045)[_0x3f16('0x43')]();var _0x54bc47=config[_0x3f16('0x44')][_0x3f16('0x45')]||config[_0x3f16('0x45')]+0x1;var _0x1240a6=config['rpc']['ip']||_0x3f16('0x46');_0x2dc2a8['on'](_0x3f16('0x47'),function(_0x3aa6a5){return _0x335c2b(_0x3aa6a5);});_0x2dc2a8[_0x3f16('0x2')](_0x54bc47,_0x1240a6,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1240a6,_0x54bc47);require(_0x3f16('0x48'))[_0x3f16('0x49')]();return _0x3ccaa4(_0x3f16('0x4a')+_0x1240a6+':'+_0x54bc47);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c940a85..631ae26 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 _0x6515=['setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./reply','./error','call','setEncoding'];(function(_0x54f380,_0xb75cb3){var _0x39079c=function(_0x2d73fd){while(--_0x2d73fd){_0x54f380['push'](_0x54f380['shift']());}};_0x39079c(++_0xb75cb3);}(_0x6515,0x1e5));var _0x5651=function(_0x599947,_0x1068d8){_0x599947=_0x599947-0x0;var _0x1670c6=_0x6515[_0x599947];return _0x1670c6;};'use strict';var util=require(_0x5651('0x0'));var _=require(_0x5651('0x1'));var EventEmitter=require(_0x5651('0x2'))['EventEmitter'];var AGIReply=require(_0x5651('0x3'));var AGIError=require(_0x5651('0x4'));function AGIChannel(_0x3221d5){var _0x299ab0=this,_0x1f4316=new AGIReply(),_0x188390=![],_0x27f505={};EventEmitter[_0x5651('0x5')](_0x299ab0);_0x3221d5[_0x5651('0x6')]('utf8');_0x3221d5[_0x5651('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1f4316[_0x5651('0x6')](_0x5651('0x8'));_0x1f4316['on'](_0x5651('0x9'),function(_0x1dc334){for(var _0x445b30 in _0x1dc334){_0x299ab0[_0x445b30]=_0x1dc334[_0x445b30];}_0x299ab0[_0x5651('0xa')](_0x5651('0xb'));});_0x1f4316['on'](_0x5651('0xc'),function(_0x2de712){if(_0x2de712[_0x5651('0xd')]()==_0x5651('0xe')){_0x299ab0[_0x5651('0xa')](_0x5651('0xe'));return;}if(_0x2de712['substring'](0x0,0xb)=='520-Invalid'){_0x188390=!![];}if(_0x188390){_0x27f505['rx']+=_0x2de712+'\x0a';if(_0x2de712[_0x5651('0xf')](_0x5651('0x10'))!=-0x1){_0x188390=![];}}else{_0x27f505['rx']=_0x2de712;}if(_0x188390){return;}if(typeof _0x27f505['cb']==_0x5651('0x11')){var _0x20049c=_0x27f505['rx'][_0x5651('0x12')](0x0,0x3),_0x544659=null,_0x590ae4=null;_0x20049c=parseInt(_0x20049c);if(isNaN(_0x20049c)){_0x27f505['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5651('0x13')});return;}if(_0x20049c!=0xc8){_0x27f505['cb'](null,{'code':_0x20049c,'result':-0x1,'extra':'KO'});return;}_0x544659=_0x27f505['rx'][_0x5651('0x12')](0x4)[_0x5651('0x14')](_0x5651('0x15'),'');if(_0x544659[_0x5651('0x16')]('\x20')!=-0x1){_0x544659=_0x544659[_0x5651('0x17')](0x0,_0x544659['indexOf']('\x20'));}if(_[_0x5651('0x18')](_0x544659,'-1')){_0x544659=parseInt(_0x544659);}_0x590ae4=_0x27f505['rx'][_0x5651('0x19')]('\x20');if(_0x590ae4[_0x5651('0x1a')]==0x3){_0x590ae4=_0x590ae4[0x2][_0x5651('0x12')](0x1,_0x590ae4[0x2][_0x5651('0x1a')]-0x1);}else if(_0x590ae4[_0x5651('0x1a')]>0x3){var _0x5dc0c3=/\((.+)\)/;var _0x27c8e1=_0x27f505['rx'][_0x5651('0x1b')](_0x5dc0c3);if(_0x27c8e1){_0x590ae4=_0x27c8e1[0x1];}else{_0x590ae4=null;}}else{_0x590ae4=null;}_0x27f505['cb'](null,{'code':_0x20049c,'result':_0x544659,'extra':_0x590ae4});}});_0x3221d5['on'](_0x5651('0x1c'),function(_0x47af77){_0x299ab0[_0x5651('0xa')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x47af77['code']));});_0x3221d5['on']('close',function(){_0x299ab0[_0x5651('0xa')](_0x5651('0x1d'),new AGIError(_0x5651('0x1e')));});_0x3221d5['on'](_0x5651('0x1f'),function(){_0x299ab0[_0x5651('0xa')](_0x5651('0x1f'),new AGIError(_0x5651('0x20')));_0x3221d5[_0x5651('0x21')]();});_0x3221d5[_0x5651('0x22')](_0x1f4316);this[_0x5651('0x23')]=function(_0x3dda51,_0x4b192f){var _0x3dda51=_0x3dda51||'',_0x4b192f=typeof _0x4b192f==_0x5651('0x11')?_0x4b192f:new Function();_0x27f505={'tx':_0x3dda51,'rx':'','cb':_0x4b192f};_0x3221d5[_0x5651('0x24')](_0x3dda51+'\x0a');},this[_0x5651('0x1d')]=function(){_0x3221d5[_0x5651('0x21')]();};}util[_0x5651('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x5651('0x26')][_0x5651('0x27')]=function(_0x1f182a){return this['command'][_0x5651('0x28')](this,_0x1f182a);};AGIChannel['prototype'][_0x5651('0x29')]=function(){return this['sendRequest'](_0x5651('0x2a'));};AGIChannel['prototype']['getData']=function(_0x53b939,_0x49f9ff,_0x25f31b){_0x53b939=_0x53b939===undefined?_0x5651('0x2b'):_0x53b939;_0x49f9ff=_0x49f9ff===undefined?'5':_0x49f9ff;_0x25f31b=_0x25f31b===undefined?'1':_0x25f31b;return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x2d'),_0x53b939,_0x49f9ff*0x3e8,_0x25f31b));};AGIChannel[_0x5651('0x26')]['noop']=function(_0xc05b38){_0xc05b38=_0xc05b38||_0x5651('0x2e');return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x2f'),_0xc05b38));};AGIChannel[_0x5651('0x26')][_0x5651('0x30')]=function(_0x15d105,_0x4d96c2){if(_[_0x5651('0x31')](_0x4d96c2)){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x32'),_0x15d105,_0x4d96c2[_0x5651('0x33')](',')));}return this[_0x5651('0x27')](util['format']('EXEC\x20%s\x20%s',_0x15d105,_0x4d96c2));};AGIChannel['prototype'][_0x5651('0x34')]=function(_0x186229){return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x35'),_0x186229));};AGIChannel[_0x5651('0x26')]['setExtension']=function(_0x157221){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x36'),_0x157221));};AGIChannel[_0x5651('0x26')][_0x5651('0x37')]=function(_0x10f308){return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x38'),_0x10f308));};AGIChannel[_0x5651('0x26')][_0x5651('0xe')]=function(){return this[_0x5651('0x27')]('HANGUP');};AGIChannel[_0x5651('0x26')][_0x5651('0x39')]=function(_0x47b67b,_0x5e916a){var _0x59cc72=_[_0x5651('0x3a')](_0x5e916a)||_['isNumber'](_0x5e916a)?_0x5e916a[_0x5651('0x3b')]():_0x5e916a;return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x3c'),_0x47b67b,_0x59cc72?_0x59cc72[_0x5651('0x3b')]()[_0x5651('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5651('0x26')][_0x5651('0x3d')]=function(_0x56fcd0,_0x45b5ad){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x3e'),_0x56fcd0,_0x45b5ad));};AGIChannel[_0x5651('0x26')][_0x5651('0x3f')]=function(_0x22f614,_0x45aafb){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x40'),_0x22f614,_0x45aafb));};AGIChannel['prototype'][_0x5651('0x41')]=function(_0x4b1625,_0x398ab1){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x42'),_0x4b1625,_0x398ab1));};AGIChannel[_0x5651('0x26')][_0x5651('0x43')]=function(_0x510013,_0x30514a,_0xd494f3){_0x30514a=_0x30514a||this[_0x5651('0x44')];_0xd494f3=_0xd494f3||0x1;this[_0x5651('0x34')](_0x510013);this[_0x5651('0x45')](_0x30514a);this['setPriority'](_0xd494f3);return this[_0x5651('0x46')](util[_0x5651('0x2c')](_0x5651('0x47'),_0x510013,_0x30514a,_0xd494f3));};AGIChannel[_0x5651('0x26')]['getVariable']=function(_0x3a1931){return this[_0x5651('0x27')](util[_0x5651('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3a1931));};AGIChannel[_0x5651('0x26')]['recordFile']=function(_0x5577cd,_0x34104a,_0x5cb065,_0x4b069d,_0x39ffac,_0x54dae7){_0x34104a=_0x34104a||_0x5651('0x48');_0x5cb065=_0x5cb065||'';_0x4b069d=_0x4b069d===undefined?-0x1:_0x4b069d==='-1'?-0x1:_0x4b069d*0x3e8;_0x39ffac=_0x39ffac===undefined?'':'s='+_0x39ffac;_0x54dae7=_0x54dae7?'BEEP':'';return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x49'),_0x5577cd,_0x34104a,_0x5cb065,_0x4b069d,_0x54dae7,_0x39ffac));};AGIChannel['prototype'][_0x5651('0x4a')]=function(_0x537668,_0x4a6652){_0x4a6652=_0x4a6652||'';return this[_0x5651('0x27')](util['format'](_0x5651('0x4b'),_0x537668,_0x4a6652));};AGIChannel[_0x5651('0x26')][_0x5651('0x4c')]=function(_0x53ecd7){return this[_0x5651('0x30')](_0x5651('0x4d'),_0x53ecd7);};AGIChannel[_0x5651('0x26')][_0x5651('0x4e')]=function(_0x1e2acc){return this['exec'](_0x5651('0x4f'),_0x1e2acc);};AGIChannel['prototype'][_0x5651('0x1c')]=function(_0x2bf1f4,_0x961b31){this[_0x5651('0x46')](util[_0x5651('0x2c')](_0x5651('0x50'),_0x2bf1f4['id'],_0x2bf1f4[_0x5651('0x51')],_0x961b31));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xcf71=['sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','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','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0xcf71,0xba));var _0x1cf7=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0xcf71[_0x4ac48d];return _0x7537af;};'use strict';var util=require(_0x1cf7('0x0'));var _=require(_0x1cf7('0x1'));var EventEmitter=require(_0x1cf7('0x2'))[_0x1cf7('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x1cf7('0x4'));function AGIChannel(_0x409e6f){var _0xcc31bf=this,_0x21307d=new AGIReply(),_0x11e462=![],_0x14d074={};EventEmitter[_0x1cf7('0x5')](_0xcc31bf);_0x409e6f[_0x1cf7('0x6')](_0x1cf7('0x7'));_0x409e6f[_0x1cf7('0x8')](0x8*0x3c*0x3c*0x3e8);_0x21307d[_0x1cf7('0x6')](_0x1cf7('0x7'));_0x21307d['on']('headers',function(_0x52c8c8){for(var _0xb4e19f in _0x52c8c8){_0xcc31bf[_0xb4e19f]=_0x52c8c8[_0xb4e19f];}_0xcc31bf[_0x1cf7('0x9')](_0x1cf7('0xa'));});_0x21307d['on']('line',function(_0x318b81){if(_0x318b81['toLowerCase']()=='hangup'){_0xcc31bf[_0x1cf7('0x9')](_0x1cf7('0xb'));return;}if(_0x318b81[_0x1cf7('0xc')](0x0,0xb)==_0x1cf7('0xd')){_0x11e462=!![];}if(_0x11e462){_0x14d074['rx']+=_0x318b81+'\x0a';if(_0x318b81[_0x1cf7('0xe')](_0x1cf7('0xf'))!=-0x1){_0x11e462=![];}}else{_0x14d074['rx']=_0x318b81;}if(_0x11e462){return;}if(typeof _0x14d074['cb']=='function'){var _0x18dc3b=_0x14d074['rx']['substring'](0x0,0x3),_0x58c99f=null,_0x1ad008=null;_0x18dc3b=parseInt(_0x18dc3b);if(isNaN(_0x18dc3b)){_0x14d074['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1cf7('0x10')});return;}if(_0x18dc3b!=0xc8){_0x14d074['cb'](null,{'code':_0x18dc3b,'result':-0x1,'extra':'KO'});return;}_0x58c99f=_0x14d074['rx'][_0x1cf7('0xc')](0x4)['replace'](_0x1cf7('0x11'),'');if(_0x58c99f[_0x1cf7('0x12')]('\x20')!=-0x1){_0x58c99f=_0x58c99f[_0x1cf7('0x13')](0x0,_0x58c99f[_0x1cf7('0x12')]('\x20'));}if(_[_0x1cf7('0x14')](_0x58c99f,'-1')){_0x58c99f=parseInt(_0x58c99f);}_0x1ad008=_0x14d074['rx'][_0x1cf7('0x15')]('\x20');if(_0x1ad008[_0x1cf7('0x16')]==0x3){_0x1ad008=_0x1ad008[0x2][_0x1cf7('0xc')](0x1,_0x1ad008[0x2][_0x1cf7('0x16')]-0x1);}else if(_0x1ad008[_0x1cf7('0x16')]>0x3){var _0x2a3671=/\((.+)\)/;var _0x148f07=_0x14d074['rx'][_0x1cf7('0x17')](_0x2a3671);if(_0x148f07){_0x1ad008=_0x148f07[0x1];}else{_0x1ad008=null;}}else{_0x1ad008=null;}_0x14d074['cb'](null,{'code':_0x18dc3b,'result':_0x58c99f,'extra':_0x1ad008});}});_0x409e6f['on']('error',function(_0x391553){_0xcc31bf[_0x1cf7('0x9')](_0x1cf7('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x391553[_0x1cf7('0x19')]));});_0x409e6f['on'](_0x1cf7('0x1a'),function(){_0xcc31bf[_0x1cf7('0x9')]('close',new AGIError(_0x1cf7('0x1b')));});_0x409e6f['on'](_0x1cf7('0x1c'),function(){_0xcc31bf[_0x1cf7('0x9')](_0x1cf7('0x1c'),new AGIError(_0x1cf7('0x1d')));_0x409e6f[_0x1cf7('0x1e')]();});_0x409e6f[_0x1cf7('0x1f')](_0x21307d);this[_0x1cf7('0x20')]=function(_0xa12f8a,_0x256151){var _0xa12f8a=_0xa12f8a||'',_0x256151=typeof _0x256151==_0x1cf7('0x21')?_0x256151:new Function();_0x14d074={'tx':_0xa12f8a,'rx':'','cb':_0x256151};_0x409e6f[_0x1cf7('0x22')](_0xa12f8a+'\x0a');},this[_0x1cf7('0x1a')]=function(){_0x409e6f[_0x1cf7('0x1e')]();};}util[_0x1cf7('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x25')]=function(_0x5174d4){return this['command']['sync'](this,_0x5174d4);};AGIChannel[_0x1cf7('0x24')]['answer']=function(){return this[_0x1cf7('0x25')](_0x1cf7('0x26'));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x27')]=function(_0x4dcf35,_0x5077f6,_0xecdbbb){_0x4dcf35=_0x4dcf35===undefined?_0x1cf7('0x28'):_0x4dcf35;_0x5077f6=_0x5077f6===undefined?'5':_0x5077f6;_0xecdbbb=_0xecdbbb===undefined?'1':_0xecdbbb;return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x2a'),_0x4dcf35,_0x5077f6*0x3e8,_0xecdbbb));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x2b')]=function(_0x5e2047){_0x5e2047=_0x5e2047||_0x1cf7('0x2c');return this['sendRequest'](util[_0x1cf7('0x29')](_0x1cf7('0x2d'),_0x5e2047));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x2e')]=function(_0x3c56a1,_0x3efa9c){if(_[_0x1cf7('0x2f')](_0x3efa9c)){return this[_0x1cf7('0x25')](util['format']('EXEC\x20%s\x20%s',_0x3c56a1,_0x3efa9c[_0x1cf7('0x30')](',')));}return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x31'),_0x3c56a1,_0x3efa9c));};AGIChannel[_0x1cf7('0x24')]['setContext']=function(_0x3519e0){return this['sendRequest'](util[_0x1cf7('0x29')](_0x1cf7('0x32'),_0x3519e0));};AGIChannel['prototype'][_0x1cf7('0x33')]=function(_0x3527c6){return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x34'),_0x3527c6));};AGIChannel[_0x1cf7('0x24')]['setPriority']=function(_0xa8a129){return this['sendRequest'](util['format'](_0x1cf7('0x35'),_0xa8a129));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0xb')]=function(){return this[_0x1cf7('0x25')](_0x1cf7('0x36'));};AGIChannel[_0x1cf7('0x24')]['setVariable']=function(_0x4d7f15,_0x434024){var _0x90bdce=_[_0x1cf7('0x37')](_0x434024)||_[_0x1cf7('0x38')](_0x434024)?_0x434024[_0x1cf7('0x39')]():_0x434024;return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x3a'),_0x4d7f15,_0x90bdce?_0x90bdce[_0x1cf7('0x39')]()[_0x1cf7('0x3b')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x1cf7('0x3c')]=function(_0x4eb6cd,_0x2ca673){return this[_0x1cf7('0x25')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x4eb6cd,_0x2ca673));};AGIChannel['prototype']['sayDigits']=function(_0x233a3c,_0x197497){return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x3d'),_0x233a3c,_0x197497));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x3e')]=function(_0x7cfd70,_0x4cce10){return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x3f'),_0x7cfd70,_0x4cce10));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x40')]=function(_0x24100d,_0x3c8dba,_0x29924b){_0x3c8dba=_0x3c8dba||this[_0x1cf7('0x41')];_0x29924b=_0x29924b||0x1;this[_0x1cf7('0x42')](_0x24100d);this[_0x1cf7('0x33')](_0x3c8dba);this[_0x1cf7('0x43')](_0x29924b);return this[_0x1cf7('0x2b')](util['format'](_0x1cf7('0x44'),_0x24100d,_0x3c8dba,_0x29924b));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x45')]=function(_0xb9d92f){return this['sendRequest'](util[_0x1cf7('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0xb9d92f));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x46')]=function(_0x457fee,_0x2c879b,_0x2f1345,_0x132e5c,_0x4096ee,_0x3a6560){_0x2c879b=_0x2c879b||'wav';_0x2f1345=_0x2f1345||'';_0x132e5c=_0x132e5c===undefined?-0x1:_0x132e5c==='-1'?-0x1:_0x132e5c*0x3e8;_0x4096ee=_0x4096ee===undefined?'':'s='+_0x4096ee;_0x3a6560=_0x3a6560?_0x1cf7('0x47'):'';return this[_0x1cf7('0x25')](util[_0x1cf7('0x29')](_0x1cf7('0x48'),_0x457fee,_0x2c879b,_0x2f1345,_0x132e5c,_0x3a6560,_0x4096ee));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x49')]=function(_0x2f79e8,_0x1948c4){_0x1948c4=_0x1948c4||'';return this[_0x1cf7('0x25')](util['format'](_0x1cf7('0x4a'),_0x2f79e8,_0x1948c4));};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x4b')]=function(_0x5d7d6c){return this[_0x1cf7('0x2e')](_0x1cf7('0x4c'),_0x5d7d6c);};AGIChannel[_0x1cf7('0x24')][_0x1cf7('0x4d')]=function(_0x1488e7){return this[_0x1cf7('0x2e')](_0x1cf7('0x4e'),_0x1488e7);};AGIChannel[_0x1cf7('0x24')]['error']=function(_0x296e94,_0x218b58){this[_0x1cf7('0x2b')](util[_0x1cf7('0x29')](_0x1cf7('0x4f'),_0x296e94['id'],_0x296e94[_0x1cf7('0x50')],_0x218b58));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1cf7('0x51')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 39029f3..b05d217 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 _0x9e48=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x442279,_0x39eda9){var _0x23355a=function(_0x35f42d){while(--_0x35f42d){_0x442279['push'](_0x442279['shift']());}};_0x23355a(++_0x39eda9);}(_0x9e48,0x87));var _0x89e4=function(_0x2d7f58,_0x4d5c28){_0x2d7f58=_0x2d7f58-0x0;var _0x174c16=_0x9e48[_0x2d7f58];return _0x174c16;};'use strict';var util=require(_0x89e4('0x0'));var error={'E_AGI_UNDEFINED':_0x89e4('0x1'),'E_AGI_ARGUMENT_PORT':_0x89e4('0x2'),'E_AGI_SERVER_ERROR':_0x89e4('0x3'),'E_AGI_SERVER_CLOSE':_0x89e4('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x89e4('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x89e4('0x6'),'E_AGI_SOCKET_ERROR':_0x89e4('0x7'),'E_AGI_SOCKET_CLOSE':_0x89e4('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x89e4('0x9'),'E_AGI_COMMAND_EMPTY':_0x89e4('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x89e4('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x443c4d){var _0x443c4d=_0x443c4d||null,_0x33b49e=_0x33b49e||[],_0x5a397a=0x1,_0x421099='';if(!error[_0x443c4d]){_0x443c4d=_0x89e4('0xc');}_0x33b49e[_0x89e4('0xd')](error[_0x443c4d]);while(arguments[_0x5a397a]){_0x33b49e[_0x89e4('0xd')](arguments[_0x5a397a]);_0x5a397a++;}_0x421099=util[_0x89e4('0xe')][_0x89e4('0xf')](util,_0x33b49e);this['message']=_0x421099;this[_0x89e4('0x10')]=_0x443c4d;}module[_0x89e4('0x11')]=AGIError; \ No newline at end of file +var _0x6beb=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','name','exports','util','Undefined\x20error.'];(function(_0x5ba129,_0x193fac){var _0x579d9b=function(_0x12e720){while(--_0x12e720){_0x5ba129['push'](_0x5ba129['shift']());}};_0x579d9b(++_0x193fac);}(_0x6beb,0x12a));var _0xb6be=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6beb[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xb6be('0x0'));var error={'E_AGI_UNDEFINED':_0xb6be('0x1'),'E_AGI_ARGUMENT_PORT':_0xb6be('0x2'),'E_AGI_SERVER_ERROR':_0xb6be('0x3'),'E_AGI_SERVER_CLOSE':_0xb6be('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb6be('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xb6be('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xb6be('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5274f0){var _0x5274f0=_0x5274f0||null,_0x5a27e1=_0x5a27e1||[],_0x3131f3=0x1,_0x3d123b='';if(!error[_0x5274f0]){_0x5274f0='E_AGI_UNDEFINED';}_0x5a27e1['push'](error[_0x5274f0]);while(arguments[_0x3131f3]){_0x5a27e1['push'](arguments[_0x3131f3]);_0x3131f3++;}_0x3d123b=util['format']['apply'](util,_0x5a27e1);this['message']=_0x3d123b;this[_0xb6be('0x8')]=_0x5274f0;}module[_0xb6be('0x9')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 18a97fc..8e4f098 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 _0xc286=['lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','agi','emit','E_AGI_SERVER_ERROR','parse','projectUpdate','error','exports'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xc286,0xe0));var _0x6c28=function(_0x5c10dc,_0x1c0913){_0x5c10dc=_0x5c10dc-0x0;var _0x298b81=_0xc286[_0x5c10dc];return _0x298b81;};'use strict';var _=require(_0x6c28('0x0'));var EventEmitter=require(_0x6c28('0x1'))[_0x6c28('0x2')];var Redis=require(_0x6c28('0x3'));var AGIError=require(_0x6c28('0x4'));var config=require(_0x6c28('0x5'));config[_0x6c28('0x6')]=_[_0x6c28('0x7')](config['redis'],{'host':_0x6c28('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6c28('0x6')]);sub['subscribe'](_0x6c28('0x9'),function(_0x9b0065){if(_0x9b0065)return eventEmitter[_0x6c28('0xa')]('error',new AGIError(_0x6c28('0xb'),_0x9b0065));});sub['on']('message',function(_0x101e42,_0x54a41f){if(_0x101e42!==_0x6c28('0x9'))return;try{var _0x34db41=JSON[_0x6c28('0xc')](_0x54a41f);eventEmitter[_0x6c28('0xa')](_0x6c28('0xd'),_0x34db41);}catch(_0x1b7d04){eventEmitter['emit'](_0x6c28('0xe'),new AGIError(_0x6c28('0xb'),_0x1b7d04));}});module[_0x6c28('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x28f6=['ioredis','./error','redis','defaults','localhost','subscribe','emit','error','message','agi','parse','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash','events'];(function(_0x5d30cb,_0x42d8df){var _0x3d7e23=function(_0xbcca32){while(--_0xbcca32){_0x5d30cb['push'](_0x5d30cb['shift']());}};_0x3d7e23(++_0x42d8df);}(_0x28f6,0x14e));var _0x628f=function(_0x49946c,_0x17b333){_0x49946c=_0x49946c-0x0;var _0x14291f=_0x28f6[_0x49946c];return _0x14291f;};'use strict';var _=require(_0x628f('0x0'));var EventEmitter=require(_0x628f('0x1'))['EventEmitter'];var Redis=require(_0x628f('0x2'));var AGIError=require(_0x628f('0x3'));var config=require('../../config/environment');config[_0x628f('0x4')]=_[_0x628f('0x5')](config[_0x628f('0x4')],{'host':_0x628f('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x628f('0x4')]);sub[_0x628f('0x7')]('agi',function(_0x33eaf2){if(_0x33eaf2)return eventEmitter[_0x628f('0x8')](_0x628f('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x33eaf2));});sub['on'](_0x628f('0xa'),function(_0x235388,_0x16fc59){if(_0x235388!==_0x628f('0xb'))return;try{var _0x245020=JSON[_0x628f('0xc')](_0x16fc59);eventEmitter['emit'](_0x628f('0xd'),_0x245020);}catch(_0x2a53ca){eventEmitter[_0x628f('0x8')](_0x628f('0x9'),new AGIError(_0x628f('0xe'),_0x2a53ca));}});module[_0x628f('0xf')]={'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 87579c1..a23d09d 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 _0x4766=['relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','agicommand','vswitch','default','target','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getdigits','getsecretdigits','edges','numberOfEdges','prototype','vertices','size'];(function(_0x45cea1,_0x45db40){var _0xda8ddd=function(_0x43062d){while(--_0x43062d){_0x45cea1['push'](_0x45cea1['shift']());}};_0xda8ddd(++_0x45db40);}(_0x4766,0x87));var _0x6476=function(_0x5e4990,_0x5d7865){_0x5e4990=_0x5e4990-0x0;var _0x1eeb10=_0x4766[_0x5e4990];return _0x1eeb10;};'use strict';var _=require(_0x6476('0x0'));var logger=require(_0x6476('0x1'))(_0x6476('0x2'));var verticesWithRetry=['menu',_0x6476('0x3'),_0x6476('0x4')];var Graph=function(){this['vertices']={};this[_0x6476('0x5')]={};this[_0x6476('0x6')]=0x0;};Graph[_0x6476('0x7')]['addVertex']=function(_0x16cbb0){this[_0x6476('0x8')][_0x16cbb0['id']]=_0x16cbb0;this[_0x6476('0x5')][_0x16cbb0['id']]=[];};Graph[_0x6476('0x7')]['addEdge']=function(_0x11d848,_0x2612bb,_0x5690f3){this['edges'][_0x11d848]['push']({'target':_0x2612bb,'condition':_0x5690f3});this[_0x6476('0x6')]+=0x1;};Graph['prototype'][_0x6476('0x9')]=function(){return _[_0x6476('0x9')](this[_0x6476('0x8')]);};Graph[_0x6476('0x7')][_0x6476('0xa')]=function(){return this[_0x6476('0x6')];};Graph['prototype'][_0x6476('0xb')]=function(_0x1430d7){return this['vertices'][_0x1430d7];};Graph[_0x6476('0x7')][_0x6476('0xc')]=function(_0x32fc59,_0x3926fc){if(!this[_0x6476('0x8')][_0x32fc59]){return logger['info'](_0x6476('0xd'));}var _0x2a7645=_0x3926fc(this[_0x6476('0x8')][_0x32fc59]);if(!_0x2a7645){return logger['info'](_0x6476('0xe'));}if(this[_0x6476('0x5')][_0x32fc59][_0x6476('0xf')]===0x0){return logger[_0x6476('0x10')](_0x6476('0x11'));}for(var _0x4bb5a6=0x0,_0x146745=[],_0x4977a4=![];_0x4bb5a6\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','evtHangup','createSquareReport','catch','hasOwnProperty','agi_','debug','variables','stringify','close','timeout','handleNotFound','production','handleUnpublished','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','then','getAll','[LICENSE]','finally','listening','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events'];(function(_0x25b0fa,_0x2ede54){var _0xc1d901=function(_0x3275e8){while(--_0x3275e8){_0x25b0fa['push'](_0x25b0fa['shift']());}};_0xc1d901(++_0x2ede54);}(_0xa862,0x105));var _0x2a86=function(_0x18fdaf,_0x457de2){_0x18fdaf=_0x18fdaf-0x0;var _0x557a9b=_0xa862[_0x18fdaf];return _0x557a9b;};'use strict';var _=require(_0x2a86('0x0'));var syncho=require(_0x2a86('0x1'));var util=require(_0x2a86('0x2'));var config=require(_0x2a86('0x3'));var logger=require(_0x2a86('0x4'))(_0x2a86('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x2a86('0x6'));var Project=require(_0x2a86('0x7'));var AGIEmitter=require(_0x2a86('0x8'))[_0x2a86('0x9')];var projects=[];config['agi']=_[_0x2a86('0xa')](config[_0x2a86('0x5')],{'ip':_0x2a86('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x1e5eb6){process[_0x2a86('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1e5eb6);agiHandler(_0x1e5eb6);}catch(_0x1032ee){logger[_0x2a86('0xd')](_0x1032ee[_0x2a86('0xe')]);}});});}function projectUpdateHandler(_0x515ae6){try{var _0x13170d=_[_0x2a86('0xf')](projects,['id',_0x515ae6['id']]);if(_0x13170d>-0x1){if(_0x515ae6[_0x2a86('0x10')]===!![]){projects['splice'](_0x13170d,0x1);}else{projects[_0x13170d]=_0x515ae6;}}else{projects['push'](_0x515ae6);}}catch(_0x4c37d1){logger['error'](_0x4c37d1[_0x2a86('0xe')]);}}function listeningHandler(){console[_0x2a86('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x2a86('0x5')]['port']);logger[_0x2a86('0x12')](util[_0x2a86('0x13')](_0x2a86('0x14'),config[_0x2a86('0x5')]['ip'],config[_0x2a86('0x5')][_0x2a86('0x15')]));}function errorHandler(_0x2cd9c){if(_0x2cd9c&&_0x2cd9c[_0x2a86('0x16')]&&_0x2cd9c['message']){logger['error'](util[_0x2a86('0x13')](_0x2a86('0x17'),_0x2cd9c['name'],_0x2cd9c['message']));}else{logger[_0x2a86('0xd')](util['format'](_0x2a86('0x18'),_0x2cd9c[_0x2a86('0xe')]));}}function closeHandler(){logger[_0x2a86('0x12')](util[_0x2a86('0x13')](_0x2a86('0x19'),this[_0x2a86('0x1a')],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));try{createSquareReport(this);}catch(_0x603b2e){logger['error'](_0x603b2e[_0x2a86('0xe')]);}}function timeoutHandler(){logger[_0x2a86('0x12')](util['format'](_0x2a86('0x1f'),this['arg_1'],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));}function hangupHandler(){logger[_0x2a86('0x12')](util[_0x2a86('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2a86('0x1a')],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));this[_0x2a86('0x20')]=!![];}function createSquareReport(_0x4719cc,_0x543257){rpc[_0x2a86('0x21')](_0x4719cc)['then'](function(_0x1aca4f){if(_0x543257){_0x543257(null,_0x1aca4f);}})[_0x2a86('0x22')](function(_0x47f88d){if(_0x543257){_0x543257(null,_0x47f88d);}});}function setChannelVariables(_0x2c2cba){for(var _0x9b5124 in _0x2c2cba){if(_0x2c2cba[_0x2a86('0x23')](_0x9b5124)){if(_0x9b5124['indexOf'](_0x2a86('0x24'))===0x0){_0x2c2cba[_0x9b5124['substring'](0x4)]=_0x2c2cba[_0x9b5124];delete _0x2c2cba[_0x9b5124];}}}}function agiHandler(_0x5a4c7f){logger[_0x2a86('0x25')](_0x2a86('0x26'),JSON[_0x2a86('0x27')](_0x5a4c7f,null,0x2));logger[_0x2a86('0x12')](util[_0x2a86('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5a4c7f[_0x2a86('0x1a')],_0x5a4c7f[_0x2a86('0x1b')],_0x5a4c7f[_0x2a86('0x1c')],_0x5a4c7f[_0x2a86('0x1d')],_0x5a4c7f[_0x2a86('0x1e')]));_0x5a4c7f['on'](_0x2a86('0xd'),errorHandler);_0x5a4c7f['on'](_0x2a86('0x28'),closeHandler);_0x5a4c7f['on'](_0x2a86('0x29'),timeoutHandler);_0x5a4c7f[_0x2a86('0x20')]=![];_0x5a4c7f['on']('hangup',hangupHandler);var _0x353343=_['find'](projects,[_0x2a86('0x16'),_0x5a4c7f[_0x2a86('0x1a')]]);if(!_0x353343)return Project[_0x2a86('0x2a')](_0x5a4c7f);if(!_0x353343[_0x2a86('0x2b')])return Project[_0x2a86('0x2c')](_0x5a4c7f);return Project['initialize'](_0x353343,_0x5a4c7f);}function main(){var _0x46b8b8;return utilLicense[_0x2a86('0x2d')]()['then'](function(_0x30a7a7){if(!_0x30a7a7)return;if(_0x30a7a7['voice']){if(_0x30a7a7['callysquare']&&_0x30a7a7[_0x2a86('0x2e')]>0x0){logger[_0x2a86('0x12')](util['format'](_0x2a86('0x2f'),_0x30a7a7[_0x2a86('0x2e')]));_0x46b8b8=_0x30a7a7[_0x2a86('0x2e')];}else{logger[_0x2a86('0x12')](_0x2a86('0x30'));}}else{logger[_0x2a86('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x46b8b8=-0x1;}})[_0x2a86('0x31')](function(){return Project[_0x2a86('0x32')]();})['then'](function(_0x3f6c85){projects=_0x3f6c85;return;})[_0x2a86('0x22')](function(_0x345da3){logger[_0x2a86('0xd')](_0x2a86('0x33'),_0x345da3[_0x2a86('0xe')]);})[_0x2a86('0x34')](function(){var _0x37b6ec=require('./server')(config[_0x2a86('0x5')][_0x2a86('0x15')],config[_0x2a86('0x5')]['ip'],_0x46b8b8);_0x37b6ec['on'](_0x2a86('0xd'),errorHandler);_0x37b6ec['on'](_0x2a86('0x35'),listeningHandler);_0x37b6ec['on']('connection',connectionHandler);_0x37b6ec['on'](_0x2a86('0x28'),closeHandler);});}main(); \ No newline at end of file +var _0x065f=['127.0.0.1','stack','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','port','name','[%s]\x20%s','message','[ERROR]\x20%s','info','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','hasOwnProperty','indexOf','agi_','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','find','handleNotFound','production','handleUnpublished','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter'];(function(_0x851d1d,_0x381180){var _0x821273=function(_0x507762){while(--_0x507762){_0x851d1d['push'](_0x851d1d['shift']());}};_0x821273(++_0x381180);}(_0x065f,0x1e6));var _0xf065=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x065f[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xf065('0x0'));var syncho=require(_0xf065('0x1'));var util=require(_0xf065('0x2'));var config=require('../../config/environment');var logger=require(_0xf065('0x3'))(_0xf065('0x4'));var utilLicense=require(_0xf065('0x5'));var rpc=require(_0xf065('0x6'));var Project=require(_0xf065('0x7'));var AGIEmitter=require('./events')[_0xf065('0x8')];var projects=[];config[_0xf065('0x4')]=_['defaults'](config['agi'],{'ip':_0xf065('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x1a7870){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1a7870);agiHandler(_0x1a7870);}catch(_0x757caa){logger['error'](_0x757caa[_0xf065('0xa')]);}});});}function projectUpdateHandler(_0x903ddb){try{var _0x3dbd1b=_['findIndex'](projects,['id',_0x903ddb['id']]);if(_0x3dbd1b>-0x1){if(_0x903ddb[_0xf065('0xb')]===!![]){projects['splice'](_0x3dbd1b,0x1);}else{projects[_0x3dbd1b]=_0x903ddb;}}else{projects[_0xf065('0xc')](_0x903ddb);}}catch(_0x26a158){logger[_0xf065('0xd')](_0x26a158['stack']);}}function listeningHandler(){console[_0xf065('0xe')](_0xf065('0xf'),config[_0xf065('0x4')]['port']);logger['info'](util[_0xf065('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xf065('0x4')]['ip'],config['agi'][_0xf065('0x11')]));}function errorHandler(_0x9ab7ca){if(_0x9ab7ca&&_0x9ab7ca[_0xf065('0x12')]&&_0x9ab7ca['message']){logger[_0xf065('0xd')](util[_0xf065('0x10')](_0xf065('0x13'),_0x9ab7ca[_0xf065('0x12')],_0x9ab7ca[_0xf065('0x14')]));}else{logger[_0xf065('0xd')](util['format'](_0xf065('0x15'),_0x9ab7ca[_0xf065('0xa')]));}}function closeHandler(){logger[_0xf065('0x16')](util[_0xf065('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xf065('0x17')],this[_0xf065('0x18')],this[_0xf065('0x19')],this[_0xf065('0x1a')],this[_0xf065('0x1b')]));try{createSquareReport(this);}catch(_0x1b2b06){logger[_0xf065('0xd')](_0x1b2b06[_0xf065('0xa')]);}}function timeoutHandler(){logger[_0xf065('0x16')](util[_0xf065('0x10')](_0xf065('0x1c'),this[_0xf065('0x17')],this[_0xf065('0x18')],this['callerid'],this[_0xf065('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0xf065('0x16')](util[_0xf065('0x10')](_0xf065('0x1d'),this[_0xf065('0x17')],this['calleridname'],this['callerid'],this[_0xf065('0x1a')],this[_0xf065('0x1b')]));this[_0xf065('0x1e')]=!![];}function createSquareReport(_0x65fba4,_0xa26ee1){rpc[_0xf065('0x1f')](_0x65fba4)[_0xf065('0x20')](function(_0x1681db){if(_0xa26ee1){_0xa26ee1(null,_0x1681db);}})['catch'](function(_0x29663d){if(_0xa26ee1){_0xa26ee1(null,_0x29663d);}});}function setChannelVariables(_0x3a5f30){for(var _0x213e98 in _0x3a5f30){if(_0x3a5f30[_0xf065('0x21')](_0x213e98)){if(_0x213e98[_0xf065('0x22')](_0xf065('0x23'))===0x0){_0x3a5f30[_0x213e98['substring'](0x4)]=_0x3a5f30[_0x213e98];delete _0x3a5f30[_0x213e98];}}}}function agiHandler(_0x539c6b){logger[_0xf065('0x24')]('variables',JSON[_0xf065('0x25')](_0x539c6b,null,0x2));logger[_0xf065('0x16')](util[_0xf065('0x10')](_0xf065('0x26'),_0x539c6b[_0xf065('0x17')],_0x539c6b[_0xf065('0x18')],_0x539c6b[_0xf065('0x19')],_0x539c6b[_0xf065('0x1a')],_0x539c6b[_0xf065('0x1b')]));_0x539c6b['on'](_0xf065('0xd'),errorHandler);_0x539c6b['on']('close',closeHandler);_0x539c6b['on']('timeout',timeoutHandler);_0x539c6b['evtHangup']=![];_0x539c6b['on'](_0xf065('0x27'),hangupHandler);var _0x6fe83=_[_0xf065('0x28')](projects,['name',_0x539c6b[_0xf065('0x17')]]);if(!_0x6fe83)return Project[_0xf065('0x29')](_0x539c6b);if(!_0x6fe83[_0xf065('0x2a')])return Project[_0xf065('0x2b')](_0x539c6b);return Project['initialize'](_0x6fe83,_0x539c6b);}function main(){var _0x3ed36b;return utilLicense[_0xf065('0x2c')]()[_0xf065('0x20')](function(_0x1784ff){if(!_0x1784ff)return;if(_0x1784ff[_0xf065('0x2d')]){if(_0x1784ff[_0xf065('0x2e')]&&_0x1784ff['callysquare']>0x0){logger['info'](util['format'](_0xf065('0x2f'),_0x1784ff['callysquare']));_0x3ed36b=_0x1784ff[_0xf065('0x2e')];}else{logger[_0xf065('0x16')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xf065('0x16')](_0xf065('0x30'));_0x3ed36b=-0x1;}})[_0xf065('0x20')](function(){return Project[_0xf065('0x31')]();})[_0xf065('0x20')](function(_0x153eed){projects=_0x153eed;return;})['catch'](function(_0x4ea621){logger['error'](_0xf065('0x32'),_0x4ea621['stack']);})[_0xf065('0x33')](function(){var _0x323b3a=require(_0xf065('0x34'))(config[_0xf065('0x4')][_0xf065('0x11')],config[_0xf065('0x4')]['ip'],_0x3ed36b);_0x323b3a['on'](_0xf065('0xd'),errorHandler);_0x323b3a['on'](_0xf065('0x35'),listeningHandler);_0x323b3a['on'](_0xf065('0x36'),connectionHandler);_0x323b3a['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index d21f511..b8f4a5f 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 _0x8c1a=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','message'];(function(_0x59b439,_0x4e16b6){var _0x74d02b=function(_0x319ddc){while(--_0x319ddc){_0x59b439['push'](_0x59b439['shift']());}};_0x74d02b(++_0x4e16b6);}(_0x8c1a,0x18e));var _0xa8c1=function(_0x18bac5,_0x2e54fc){_0x18bac5=_0x18bac5-0x0;var _0xdc6c44=_0x8c1a[_0x18bac5];return _0xdc6c44;};'use strict';var BPromise=require(_0xa8c1('0x0'));var jayson=require(_0xa8c1('0x1'));var client=jayson[_0xa8c1('0x2')][_0xa8c1('0x3')]({'port':0x232b});function request(_0x586a1b,_0x2a793f){return new BPromise(function(_0x31e0f0,_0x228bf0){return client[_0xa8c1('0x4')](_0x586a1b,_0x2a793f)[_0xa8c1('0x5')](function(_0x4a519f){if(_0x4a519f['error']){return _0x228bf0(_0x4a519f['error'][_0xa8c1('0x6')]);}else{return _0x31e0f0(_0x4a519f['result']);}})['catch'](function(_0x2d84e4){return _0x228bf0(_0x2d84e4);});});}exports[_0xa8c1('0x7')]=function(_0x589fb6,_0x36cad9){return request(_0xa8c1('0x8'),{'account':_0x589fb6,'message':_0x36cad9});}; \ No newline at end of file +var _0x2e0f=['request','then','error','message','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0xd13171,_0xc54453){var _0x452bd0=function(_0x3c0628){while(--_0x3c0628){_0xd13171['push'](_0xd13171['shift']());}};_0x452bd0(++_0xc54453);}(_0x2e0f,0x1bf));var _0xf2e0=function(_0x2c911f,_0x4757a1){_0x2c911f=_0x2c911f-0x0;var _0x417dc4=_0x2e0f[_0x2c911f];return _0x417dc4;};'use strict';var BPromise=require(_0xf2e0('0x0'));var jayson=require(_0xf2e0('0x1'));var client=jayson['client'][_0xf2e0('0x2')]({'port':0x232b});function request(_0x5d21b2,_0x4ca91f){return new BPromise(function(_0x461766,_0x55525e){return client[_0xf2e0('0x3')](_0x5d21b2,_0x4ca91f)[_0xf2e0('0x4')](function(_0x60c457){if(_0x60c457[_0xf2e0('0x5')]){return _0x55525e(_0x60c457[_0xf2e0('0x5')][_0xf2e0('0x6')]);}else{return _0x461766(_0x60c457['result']);}})['catch'](function(_0x70a27e){return _0x55525e(_0x70a27e);});});}exports[_0xf2e0('0x7')]=function(_0x5bc03c,_0x36412f){return request(_0xf2e0('0x8'),{'account':_0x5bc03c,'message':_0x36412f});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 01270f7..b0534e8 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 _0xe979=['util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','addEdge','toJson','mxGraphModel','inspect','start','root','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','debug','response','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','exports','moment','xml2json'];(function(_0x52973c,_0x3cbc09){var _0x192b6f=function(_0x397fbf){while(--_0x397fbf){_0x52973c['push'](_0x52973c['shift']());}};_0x192b6f(++_0x3cbc09);}(_0xe979,0x16c));var _0x9e97=function(_0x1a4a00,_0x3e3d48){_0x1a4a00=_0x1a4a00-0x0;var _0x3c4869=_0xe979[_0x1a4a00];return _0x3c4869;};'use strict';var _=require('lodash');var moment=require(_0x9e97('0x0'));var parser=require(_0x9e97('0x1'));var util=require(_0x9e97('0x2'));var logger=require(_0x9e97('0x3'))(_0x9e97('0x4'));var rpc=require(_0x9e97('0x5'));var mailRpc=require(_0x9e97('0x6'));var Graph=require(_0x9e97('0x7'));var Vertices=require(_0x9e97('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9e97('0x9')]()['catch'](function(_0x2f43b9){logger[_0x9e97('0xa')](_0x9e97('0xb'),_0x2f43b9[_0x9e97('0xc')]);return[];});}function addVertex(_0x57d481,_0x4792ed,_0x3d9c01){_0x4792ed[_0x9e97('0xd')]=_0x3d9c01;if(_0x4792ed[_0x9e97('0xe')]('retry')){_0x4792ed[_0x9e97('0xf')]=parseInt(_0x4792ed[_0x9e97('0x10')],0xa);}_0x57d481['addVertex'](_[_0x9e97('0x11')](_0x4792ed,_0x9e97('0x12')));}function initGraph(_0x23f696,_0x423324){var _0x25613b=new Graph();for(var _0x224bde in _0x23f696){if(_0x23f696[_0x9e97('0xe')](_0x224bde)){if(_[_0x9e97('0x13')](_0x23f696[_0x224bde])){for(var _0x391eab=0x0;_0x391eab<_0x23f696[_0x224bde][_0x9e97('0x14')];_0x391eab+=0x1){addVertex(_0x25613b,_0x23f696[_0x224bde][_0x391eab],_0x224bde);}}else{addVertex(_0x25613b,_0x23f696[_0x224bde],_0x224bde);}}}for(var _0x44c439=0x0;_0x44c439<_0x423324[_0x9e97('0x14')];_0x44c439+=0x1){if(_0x423324[_0x44c439][_0x9e97('0x15')]&&_0x423324[_0x44c439][_0x9e97('0x16')]){_0x25613b[_0x9e97('0x17')](_0x423324[_0x44c439][_0x9e97('0x15')],_0x423324[_0x44c439][_0x9e97('0x16')],_0x423324[_0x44c439]['value']);}}return _0x25613b;}function getRoot(_0x3fad52){return parser[_0x9e97('0x18')](_0x3fad52,{'object':!![]})[_0x9e97('0x19')]['root'];}function inspect(_0x186674){return util[_0x9e97('0x1a')](_0x186674,{'showHidden':![],'depth':null});}function initialize(_0x1c72f0,_0x3615cc){var _0x2af46e=getRoot(_0x1c72f0['production']);if(!_0x2af46e||!_0x2af46e[_0x9e97('0x1b')])return;var _0x332bb9,_0x156f13,_0x3bf5fc;logger['debug'](_0x9e97('0x1c'),JSON['stringify'](_0x2af46e,null,0x2));_0x3615cc['joinAt']=moment()['format'](_0x9e97('0x1d'));_0x332bb9=initGraph(_['omit'](_0x2af46e,'mxCell'),_0x2af46e[_0x9e97('0x12')]);_0x156f13=new Vertices(_0x3615cc,rpc,mailRpc);logger[_0x9e97('0x1e')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc[_0x9e97('0x22')],_0x3615cc[_0x9e97('0x23')]));_0x332bb9[_0x9e97('0x24')](_0x2af46e[_0x9e97('0x1b')]['id'],function(_0x4643f9){try{_0x4643f9=_0x156f13[_0x9e97('0x25')](_0x4643f9);logger['debug'](_0x9e97('0x26'),JSON[_0x9e97('0x27')](_0x4643f9,null,0x2));if(_0x4643f9['agicommand']===_0x9e97('0x28')){logger[_0x9e97('0x1e')](_0x9e97('0x29'));_0x3615cc[_0x9e97('0x2a')]=_0x4643f9['context']||_0x3615cc[_0x9e97('0x2a')];_0x3615cc['extension']=_0x4643f9[_0x9e97('0x2b')];_0x3615cc[_0x9e97('0x2c')]=_0x4643f9[_0x9e97('0x2c')]?_0x4643f9[_0x9e97('0x2c')]-0x1:0x1;return null;}else if(_0x4643f9&&_0x156f13[_0x4643f9[_0x9e97('0xd')]]){_0x3bf5fc=_0x156f13[_0x4643f9[_0x9e97('0xd')]](_0x4643f9);logger[_0x9e97('0x1e')]('response',JSON[_0x9e97('0x27')](_0x3bf5fc,null,0x2));if(_0x3bf5fc&&_0x3bf5fc[_0x9e97('0x2d')]===AGI_CODE_SUCCESS&&_0x3bf5fc[_0x9e97('0x2e')]!==AGI_RESULT_ERROR&&!_0x3615cc[_0x9e97('0x2f')]){logger[_0x9e97('0x30')]('response',inspect(_0x3bf5fc));return _['isUndefined'](_0x3bf5fc[_0x9e97('0x2e')])?null:_0x3bf5fc[_0x9e97('0x2e')]['toString']();}else{logger[_0x9e97('0xa')](_0x9e97('0x31'),inspect(_0x3bf5fc));return null;}}else{logger[_0x9e97('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x63e2ff){logger[_0x9e97('0xa')](_0x63e2ff[_0x9e97('0xc')]);return null;}});if(_0x2af46e[_0x9e97('0x32')]){logger[_0x9e97('0x1e')](util[_0x9e97('0x33')](_0x9e97('0x34'),_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc['dnid'],_0x3615cc['uniqueid']));_0x332bb9[_0x9e97('0x24')](_0x2af46e['finally']['id'],function(_0x333d14){try{_0x333d14=_0x156f13[_0x9e97('0x25')](_0x333d14);logger['debug'](_0x9e97('0x26'),JSON[_0x9e97('0x27')](_0x333d14,null,0x2));if(_0x333d14&&_0x156f13[_0x333d14[_0x9e97('0xd')]]){_0x3bf5fc=_0x156f13[_0x333d14[_0x9e97('0xd')]](_0x333d14);if(_0x3bf5fc){logger[_0x9e97('0x30')](_0x9e97('0x31'),inspect(_0x3bf5fc));return _['isUndefined'](_0x3bf5fc[_0x9e97('0x2e')])?null:_0x3bf5fc[_0x9e97('0x2e')][_0x9e97('0x35')]();}else{logger[_0x9e97('0xa')](_0x9e97('0x31'),inspect(_0x3bf5fc));return null;}}else{logger[_0x9e97('0xa')](_0x9e97('0x36'));return null;}}catch(_0x3d38c3){logger['error'](_0x3d38c3[_0x9e97('0xc')]);return null;}});}logger['info'](util[_0x9e97('0x33')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc[_0x9e97('0x22')],_0x3615cc[_0x9e97('0x23')]));logger[_0x9e97('0x1e')](util[_0x9e97('0x33')](_0x9e97('0x37'),_0x3615cc['context'],_0x3615cc[_0x9e97('0x2b')],parseInt(_0x3615cc[_0x9e97('0x2c')],0xa)+0x1));_0x3615cc[_0x9e97('0x38')](_0x3615cc['context'],_0x3615cc[_0x9e97('0x2b')],parseInt(_0x3615cc[_0x9e97('0x2c')],0xa)+0x1);_0x3615cc['close']();}function handleNotFound(_0x5eb9e9){logger[_0x9e97('0xa')](util[_0x9e97('0x33')](_0x9e97('0x39'),_0x5eb9e9[_0x9e97('0x1f')]));_0x5eb9e9['continueAt'](_0x5eb9e9[_0x9e97('0x2a')],_0x5eb9e9['extension'],parseInt(_0x5eb9e9[_0x9e97('0x2c')],0xa)+0x1);_0x5eb9e9['close']();}function handleUnpublished(_0x3a8479){logger[_0x9e97('0xa')](util['format'](_0x9e97('0x3a'),_0x3a8479[_0x9e97('0x1f')]));_0x3a8479[_0x9e97('0x38')](_0x3a8479[_0x9e97('0x2a')],_0x3a8479['extension'],parseInt(_0x3a8479['priority'],0xa)+0x1);_0x3a8479[_0x9e97('0x3b')]();}module[_0x9e97('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xaef6=['start','debug','joinAt','format','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','agicommand\x20not\x20found','finally','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','omit','mxCell','hasOwnProperty','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','production'];(function(_0x3e931d,_0x3c8900){var _0x4aa832=function(_0x55cc1b){while(--_0x55cc1b){_0x3e931d['push'](_0x3e931d['shift']());}};_0x4aa832(++_0x3c8900);}(_0xaef6,0x99));var _0x6aef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xaef6[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var moment=require(_0x6aef('0x0'));var parser=require(_0x6aef('0x1'));var util=require(_0x6aef('0x2'));var logger=require(_0x6aef('0x3'))(_0x6aef('0x4'));var rpc=require(_0x6aef('0x5'));var mailRpc=require(_0x6aef('0x6'));var Graph=require('./graph');var Vertices=require(_0x6aef('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6aef('0x8')]()[_0x6aef('0x9')](function(_0x273a1f){logger[_0x6aef('0xa')](_0x6aef('0xb'),_0x273a1f[_0x6aef('0xc')]);return[];});}function addVertex(_0x3a514a,_0x50f551,_0x5e82ef){_0x50f551['agicommand']=_0x5e82ef;if(_0x50f551['hasOwnProperty'](_0x6aef('0xd'))){_0x50f551[_0x6aef('0xe')]=parseInt(_0x50f551['retry'],0xa);}_0x3a514a['addVertex'](_[_0x6aef('0xf')](_0x50f551,_0x6aef('0x10')));}function initGraph(_0x33cb6a,_0x495765){var _0x5ee0c2=new Graph();for(var _0x1033c9 in _0x33cb6a){if(_0x33cb6a[_0x6aef('0x11')](_0x1033c9)){if(_['isArray'](_0x33cb6a[_0x1033c9])){for(var _0x1b256e=0x0;_0x1b256e<_0x33cb6a[_0x1033c9][_0x6aef('0x12')];_0x1b256e+=0x1){addVertex(_0x5ee0c2,_0x33cb6a[_0x1033c9][_0x1b256e],_0x1033c9);}}else{addVertex(_0x5ee0c2,_0x33cb6a[_0x1033c9],_0x1033c9);}}}for(var _0x993e23=0x0;_0x993e23<_0x495765[_0x6aef('0x12')];_0x993e23+=0x1){if(_0x495765[_0x993e23][_0x6aef('0x13')]&&_0x495765[_0x993e23][_0x6aef('0x14')]){_0x5ee0c2[_0x6aef('0x15')](_0x495765[_0x993e23][_0x6aef('0x13')],_0x495765[_0x993e23][_0x6aef('0x14')],_0x495765[_0x993e23]['value']);}}return _0x5ee0c2;}function getRoot(_0x4bf20c){return parser[_0x6aef('0x16')](_0x4bf20c,{'object':!![]})[_0x6aef('0x17')][_0x6aef('0x18')];}function inspect(_0x599ba5){return util[_0x6aef('0x19')](_0x599ba5,{'showHidden':![],'depth':null});}function initialize(_0x54e61d,_0x4f3c95){var _0x5de6d3=getRoot(_0x54e61d[_0x6aef('0x1a')]);if(!_0x5de6d3||!_0x5de6d3[_0x6aef('0x1b')])return;var _0x2a7101,_0x2d4a0d,_0x14e6de;logger[_0x6aef('0x1c')](_0x6aef('0x18'),JSON['stringify'](_0x5de6d3,null,0x2));_0x4f3c95[_0x6aef('0x1d')]=moment()[_0x6aef('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a7101=initGraph(_['omit'](_0x5de6d3,_0x6aef('0x10')),_0x5de6d3[_0x6aef('0x10')]);_0x2d4a0d=new Vertices(_0x4f3c95,rpc,mailRpc);logger[_0x6aef('0x1f')](util[_0x6aef('0x1e')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f3c95[_0x6aef('0x20')],_0x4f3c95[_0x6aef('0x21')],_0x4f3c95[_0x6aef('0x22')],_0x4f3c95[_0x6aef('0x23')],_0x4f3c95[_0x6aef('0x24')]));_0x2a7101[_0x6aef('0x25')](_0x5de6d3['start']['id'],function(_0xc885fc){try{_0xc885fc=_0x2d4a0d[_0x6aef('0x26')](_0xc885fc);logger[_0x6aef('0x1c')](_0x6aef('0x27'),JSON[_0x6aef('0x28')](_0xc885fc,null,0x2));if(_0xc885fc[_0x6aef('0x29')]===_0x6aef('0x2a')){logger[_0x6aef('0x1f')](_0x6aef('0x2b'));_0x4f3c95[_0x6aef('0x2c')]=_0xc885fc[_0x6aef('0x2c')]||_0x4f3c95[_0x6aef('0x2c')];_0x4f3c95[_0x6aef('0x2d')]=_0xc885fc[_0x6aef('0x2d')];_0x4f3c95[_0x6aef('0x2e')]=_0xc885fc['priority']?_0xc885fc['priority']-0x1:0x1;return null;}else if(_0xc885fc&&_0x2d4a0d[_0xc885fc[_0x6aef('0x29')]]){_0x14e6de=_0x2d4a0d[_0xc885fc[_0x6aef('0x29')]](_0xc885fc);logger[_0x6aef('0x1f')](_0x6aef('0x2f'),JSON[_0x6aef('0x28')](_0x14e6de,null,0x2));if(_0x14e6de&&_0x14e6de[_0x6aef('0x30')]===AGI_CODE_SUCCESS&&_0x14e6de[_0x6aef('0x31')]!==AGI_RESULT_ERROR&&!_0x4f3c95[_0x6aef('0x32')]){logger[_0x6aef('0x1c')]('response',inspect(_0x14e6de));return _['isUndefined'](_0x14e6de[_0x6aef('0x31')])?null:_0x14e6de[_0x6aef('0x31')]['toString']();}else{logger['error'](_0x6aef('0x2f'),inspect(_0x14e6de));return null;}}else{logger[_0x6aef('0xa')](_0x6aef('0x33'));return null;}}catch(_0x812b6d){logger[_0x6aef('0xa')](_0x812b6d[_0x6aef('0xc')]);return null;}});if(_0x5de6d3[_0x6aef('0x34')]){logger[_0x6aef('0x1f')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f3c95['arg_1'],_0x4f3c95[_0x6aef('0x21')],_0x4f3c95[_0x6aef('0x22')],_0x4f3c95[_0x6aef('0x23')],_0x4f3c95[_0x6aef('0x24')]));_0x2a7101[_0x6aef('0x25')](_0x5de6d3[_0x6aef('0x34')]['id'],function(_0x7ca8f5){try{_0x7ca8f5=_0x2d4a0d[_0x6aef('0x26')](_0x7ca8f5);logger['debug']('vertex',JSON[_0x6aef('0x28')](_0x7ca8f5,null,0x2));if(_0x7ca8f5&&_0x2d4a0d[_0x7ca8f5['agicommand']]){_0x14e6de=_0x2d4a0d[_0x7ca8f5[_0x6aef('0x29')]](_0x7ca8f5);if(_0x14e6de){logger['debug'](_0x6aef('0x2f'),inspect(_0x14e6de));return _[_0x6aef('0x35')](_0x14e6de[_0x6aef('0x31')])?null:_0x14e6de['result']['toString']();}else{logger['error'](_0x6aef('0x2f'),inspect(_0x14e6de));return null;}}else{logger['error'](_0x6aef('0x33'));return null;}}catch(_0x5a696a){logger[_0x6aef('0xa')](_0x5a696a[_0x6aef('0xc')]);return null;}});}logger[_0x6aef('0x1f')](util[_0x6aef('0x1e')](_0x6aef('0x36'),_0x4f3c95[_0x6aef('0x20')],_0x4f3c95[_0x6aef('0x21')],_0x4f3c95[_0x6aef('0x22')],_0x4f3c95[_0x6aef('0x23')],_0x4f3c95[_0x6aef('0x24')]));logger[_0x6aef('0x1f')](util[_0x6aef('0x1e')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4f3c95[_0x6aef('0x2c')],_0x4f3c95[_0x6aef('0x2d')],parseInt(_0x4f3c95['priority'],0xa)+0x1));_0x4f3c95[_0x6aef('0x37')](_0x4f3c95[_0x6aef('0x2c')],_0x4f3c95[_0x6aef('0x2d')],parseInt(_0x4f3c95[_0x6aef('0x2e')],0xa)+0x1);_0x4f3c95[_0x6aef('0x38')]();}function handleNotFound(_0x5c0db2){logger[_0x6aef('0xa')](util[_0x6aef('0x1e')](_0x6aef('0x39'),_0x5c0db2['arg_1']));_0x5c0db2[_0x6aef('0x37')](_0x5c0db2['context'],_0x5c0db2[_0x6aef('0x2d')],parseInt(_0x5c0db2[_0x6aef('0x2e')],0xa)+0x1);_0x5c0db2[_0x6aef('0x38')]();}function handleUnpublished(_0x58bd87){logger[_0x6aef('0xa')](util[_0x6aef('0x1e')](_0x6aef('0x3a'),_0x58bd87['arg_1']));_0x58bd87[_0x6aef('0x37')](_0x58bd87[_0x6aef('0x2c')],_0x58bd87[_0x6aef('0x2d')],parseInt(_0x58bd87[_0x6aef('0x2e')],0xa)+0x1);_0x58bd87[_0x6aef('0x38')]();}module[_0x6aef('0x3b')]={'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 186b3d5..37769ac 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 _0x6c29=['split','indexOf','slice','trim','_inBody','line','exports','util','stream','Transform','call','_localBuffer','prototype','_transform','toString','substring','length'];(function(_0xc5ece6,_0x49bb52){var _0x8b99b=function(_0x5036cd){while(--_0x5036cd){_0xc5ece6['push'](_0xc5ece6['shift']());}};_0x8b99b(++_0x49bb52);}(_0x6c29,0x1c1));var _0x96c2=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x6c29[_0x2afbb0];return _0x411ff2;};'use strict';var util=require(_0x96c2('0x0'));var Transform=require(_0x96c2('0x1'))[_0x96c2('0x2')];function AGIReply(_0x292bfc){Transform[_0x96c2('0x3')](this,_0x292bfc);this[_0x96c2('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x96c2('0x5')][_0x96c2('0x6')]=function(_0x5c84c4,_0x1c8b4a,_0x43d7fd){var _0x2ee7c6='\x0a',_0x2f9b84=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4e15bd=-0x1,_0x3dbbc2=-0x1,_0x2d1973='',_0x4406ad=0x0,_0x384fa2='',_0x18ca2c='';this[_0x96c2('0x4')]+=_0x5c84c4[_0x96c2('0x7')]();_0x384fa2=this[_0x96c2('0x4')];if(!this['_inBody']){_0x4406ad=0x0;while(_0x2f9b84[_0x4406ad]){while((_0x3dbbc2=_0x384fa2['indexOf'](_0x2f9b84[_0x4406ad]))!=-0x1){_0x2d1973=_0x2f9b84[_0x4406ad];_0x18ca2c=_0x384fa2[_0x96c2('0x8')](0x0,_0x3dbbc2);_0x384fa2=_0x384fa2[_0x96c2('0x8')](_0x3dbbc2+_0x2d1973[_0x96c2('0x9')]);var _0x4afb0e=_0x18ca2c[_0x96c2('0xa')](_0x2ee7c6),_0x1e763d=0x0,_0x1fcfe6={},_0x110a0d='',_0x605573='',_0xa933c3=-0x1;while(_0x4afb0e[_0x1e763d]){_0xa933c3=_0x4afb0e[_0x1e763d][_0x96c2('0xb')](':');if(_0xa933c3!=-0x1){_0x110a0d=_0x4afb0e[_0x1e763d][_0x96c2('0xc')](0x0,_0xa933c3)[_0x96c2('0xd')]();_0x605573=_0x4afb0e[_0x1e763d][_0x96c2('0xc')](_0xa933c3+0x1)['trim']();if(_0x110a0d[_0x96c2('0x9')]>0x0){_0x1fcfe6[_0x110a0d]=_0x605573;}}else{}_0x1e763d++;}this['emit']('headers',_0x1fcfe6);this[_0x96c2('0xe')]=!![];}_0x4406ad++;}this['_localBuffer']=_0x384fa2;}else{while((_0x4e15bd=_0x384fa2[_0x96c2('0xb')](_0x2ee7c6))!=-0x1){_0x18ca2c=_0x384fa2[_0x96c2('0x8')](0x0,_0x4e15bd);this['emit'](_0x96c2('0xf'),_0x18ca2c);_0x384fa2=_0x384fa2[_0x96c2('0x8')](_0x4e15bd+_0x2ee7c6[_0x96c2('0x9')]);}this[_0x96c2('0x4')]=_0x384fa2;}_0x43d7fd();};module[_0x96c2('0x10')]=AGIReply; \ No newline at end of file +var _0x407f=['split','indexOf','slice','trim','emit','line','exports','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length'];(function(_0x1b6587,_0x2efdc6){var _0x1fdf1c=function(_0x56afdc){while(--_0x56afdc){_0x1b6587['push'](_0x1b6587['shift']());}};_0x1fdf1c(++_0x2efdc6);}(_0x407f,0xc2));var _0xf407=function(_0x2b5c82,_0x5dadd7){_0x2b5c82=_0x2b5c82-0x0;var _0x29d9f1=_0x407f[_0x2b5c82];return _0x29d9f1;};'use strict';var util=require('util');var Transform=require('stream')['Transform'];function AGIReply(_0x34f89a){Transform[_0xf407('0x0')](this,_0x34f89a);this[_0xf407('0x1')]='';this[_0xf407('0x2')]=![];}util[_0xf407('0x3')](AGIReply,Transform);AGIReply[_0xf407('0x4')][_0xf407('0x5')]=function(_0x2bb1e4,_0x14df0c,_0x160f5c){var _0x438076='\x0a',_0x2bce9d=['\x0a\x0a',_0xf407('0x6')],_0x2d4ec6=-0x1,_0x3ac774=-0x1,_0x38ee37='',_0x3ab539=0x0,_0x5dc169='',_0x2291a7='';this[_0xf407('0x1')]+=_0x2bb1e4[_0xf407('0x7')]();_0x5dc169=this['_localBuffer'];if(!this['_inBody']){_0x3ab539=0x0;while(_0x2bce9d[_0x3ab539]){while((_0x3ac774=_0x5dc169['indexOf'](_0x2bce9d[_0x3ab539]))!=-0x1){_0x38ee37=_0x2bce9d[_0x3ab539];_0x2291a7=_0x5dc169[_0xf407('0x8')](0x0,_0x3ac774);_0x5dc169=_0x5dc169[_0xf407('0x8')](_0x3ac774+_0x38ee37[_0xf407('0x9')]);var _0x8f126=_0x2291a7[_0xf407('0xa')](_0x438076),_0x261ac2=0x0,_0x5637a5={},_0x2ee485='',_0x3f4ca0='',_0x3b26ae=-0x1;while(_0x8f126[_0x261ac2]){_0x3b26ae=_0x8f126[_0x261ac2][_0xf407('0xb')](':');if(_0x3b26ae!=-0x1){_0x2ee485=_0x8f126[_0x261ac2][_0xf407('0xc')](0x0,_0x3b26ae)[_0xf407('0xd')]();_0x3f4ca0=_0x8f126[_0x261ac2][_0xf407('0xc')](_0x3b26ae+0x1)['trim']();if(_0x2ee485['length']>0x0){_0x5637a5[_0x2ee485]=_0x3f4ca0;}}else{}_0x261ac2++;}this[_0xf407('0xe')]('headers',_0x5637a5);this[_0xf407('0x2')]=!![];}_0x3ab539++;}this['_localBuffer']=_0x5dc169;}else{while((_0x2d4ec6=_0x5dc169['indexOf'](_0x438076))!=-0x1){_0x2291a7=_0x5dc169[_0xf407('0x8')](0x0,_0x2d4ec6);this[_0xf407('0xe')](_0xf407('0xf'),_0x2291a7);_0x5dc169=_0x5dc169[_0xf407('0x8')](_0x2d4ec6+_0x438076[_0xf407('0x9')]);}this[_0xf407('0x1')]=_0x5dc169;}_0x160f5c();};module[_0xf407('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 da4c1d6..f6fcf69 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 _0xcb81=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','request','then','error','message','catch','getSquareProjects','name','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0xcb81,0x154));var _0x1cb8=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xcb81[_0x74745d];return _0x174ab3;};'use strict';var _=require(_0x1cb8('0x0'));var moment=require(_0x1cb8('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x1cb8('0x2')]['http']({'port':0x2329});function request(_0x5e8697,_0x55f3a0){return new Promise(function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x3')](_0x5e8697,_0x55f3a0)[_0x1cb8('0x4')](function(_0x41b867){if(_0x41b867['error']){return _0x33a8f2(_0x41b867[_0x1cb8('0x5')][_0x1cb8('0x6')]);}else{return _0x38c3ea(_0x41b867['result']);}})[_0x1cb8('0x7')](function(_0x39b4ad){return _0x33a8f2(_0x39b4ad);});});}exports[_0x1cb8('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1cb8('0x9'),'production']}});};exports['getSquareProject']=function(_0x29e901){return request(_0x1cb8('0xa'),{'options':{'raw':![],'where':{'name':_0x29e901},'attributes':[_0x1cb8('0xb')]}});};exports[_0x1cb8('0xc')]=function(_0x267dde){return request(_0x1cb8('0xd'),{'options':{'raw':![],'where':{'id':_0x267dde},'include':[{'model':_0x1cb8('0xe'),'as':_0x1cb8('0xf'),'include':[{'model':'CloudProvider','as':_0x1cb8('0x10')}]}],'attributes':['id',_0x1cb8('0x9'),_0x1cb8('0x11')],'smtp':!![]}});};exports[_0x1cb8('0x12')]=function(_0x1371cb){return request('ShowSquareProject',{'options':{'where':{'id':_0x1371cb},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x13')]=function(_0xcb6ad1){return request(_0x1cb8('0x14'),{'options':{'where':{'id':_0xcb6ad1},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x15')]=function(_0x339ad0){return request(_0x1cb8('0x16'),{'options':{'where':{'id':_0x339ad0},'attributes':['name']}});};exports[_0x1cb8('0x17')]=function(_0x4b4917){return request(_0x1cb8('0x18'),{'options':{'where':{'id':_0x4b4917},'attributes':[_0x1cb8('0x19')]}});};exports[_0x1cb8('0x1a')]=function(_0x46abd0){return request(_0x1cb8('0x1b'),{'options':{'where':{'id':_0x46abd0},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x1c')]=function(_0x9f0adb){return request(_0x1cb8('0x1d'),{'options':{'where':{'phone':_0x9f0adb[_0x1cb8('0x1e')]},'attributes':['id']}});};exports[_0x1cb8('0x1f')]=function(_0x3cda27){return request('ShowTrunk',{'options':{'where':{'id':_0x3cda27},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x20')]=function(_0x170f34){return request(_0x1cb8('0x21'),{'options':{'where':{'id':_0x170f34},'attributes':['save_name']}});};exports[_0x1cb8('0x22')]=function(_0x4f9220){return request(_0x1cb8('0x23'),{'options':{'raw':![],'where':{'id':_0x4f9220},'include':[{'model':_0x1cb8('0x24'),'as':_0x1cb8('0x25')}]}});};exports[_0x1cb8('0x26')]=function(_0x559916){return request('ShowSmsAccount',{'options':{'where':{'id':_0x559916},'attributes':['id',_0x1cb8('0x9')]}});};exports[_0x1cb8('0x27')]=function(_0x22dafe){return request(_0x1cb8('0x28'),{'body':_0x22dafe});};exports[_0x1cb8('0x29')]=function(_0x30985c){return request(_0x1cb8('0x2a'),{'body':_0x30985c});};exports['createSquareReport']=function(_0x1ec384){return request(_0x1cb8('0x2b'),{'body':_[_0x1cb8('0x2c')](_0x1ec384,{'project_name':_0x1ec384[_0x1cb8('0x2d')],'prev_project_name':_0x1ec384[_0x1cb8('0x2e')]||'','is_subproject':_0x1ec384[_0x1cb8('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0x1cb8('0x2f'))})});};exports[_0x1cb8('0x30')]=function(_0xfdfb31){return request(_0x1cb8('0x31'),{'body':_0xfdfb31});};exports[_0x1cb8('0x32')]=function(_0x4a9b74){return request(_0x1cb8('0x33'),{'body':_0x4a9b74});};exports[_0x1cb8('0x34')]=function(_0x3a8b53){return request(_0x1cb8('0x35'),{'options':{'raw':![],'where':{'phone':_0x3a8b53['phone'],'ListId':_0x3a8b53[_0x1cb8('0x36')]}}})[_0x1cb8('0x4')](function(_0x3a6a67){if(_0x3a6a67){return _0x3a6a67;}return request('CreateCmContact',{'body':_0x3a8b53});});};exports[_0x1cb8('0x37')]=function(_0x2a6da9){return request(_0x1cb8('0x38'),{'options':{'where':{'id':_0x2a6da9},'attributes':['name']}});};exports[_0x1cb8('0x39')]=function(_0x3e2af4,_0x239c62){return request(_0x1cb8('0x3a'),{'body':{'interface':_0x239c62},'options':{'where':_0x3e2af4}});};exports[_0x1cb8('0x3b')]=function(_0x54278d,_0x2607f0,_0x1de806){return request(_0x1cb8('0x3c'),{'body':{'type':_0x2607f0,'uniqueid':_0x1de806},'options':{'where':_0x54278d}});};exports[_0x1cb8('0x3d')]=function(_0x18fe1b){return request(_0x1cb8('0x3e'),{'body':{},'options':{'where':_0x18fe1b}});};exports[_0x1cb8('0x3f')]=function(_0x18cc99){return request(_0x1cb8('0x40'),{'body':{},'options':{'where':_0x18cc99}});}; \ No newline at end of file +var _0x61a5=['request','error','message','result','catch','GetSquareProjects','production','getSquareProject','ShowSquareProject','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http'];(function(_0x506b51,_0x2d2b6d){var _0xca5779=function(_0x5f0fcb){while(--_0x5f0fcb){_0x506b51['push'](_0x506b51['shift']());}};_0xca5779(++_0x2d2b6d);}(_0x61a5,0xf0));var _0x561a=function(_0x48e86c,_0x9f034d){_0x48e86c=_0x48e86c-0x0;var _0x54fa11=_0x61a5[_0x48e86c];return _0x54fa11;};'use strict';var _=require(_0x561a('0x0'));var moment=require('moment');var jayson=require(_0x561a('0x1'));var client=jayson[_0x561a('0x2')][_0x561a('0x3')]({'port':0x2329});function request(_0x862a0e,_0x29ccea){return new Promise(function(_0x58f636,_0xe92b4d){return client[_0x561a('0x4')](_0x862a0e,_0x29ccea)['then'](function(_0x18902a){if(_0x18902a[_0x561a('0x5')]){return _0xe92b4d(_0x18902a[_0x561a('0x5')][_0x561a('0x6')]);}else{return _0x58f636(_0x18902a[_0x561a('0x7')]);}})[_0x561a('0x8')](function(_0x1d5814){return _0xe92b4d(_0x1d5814);});});}exports['getSquareProjects']=function(){return request(_0x561a('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x561a('0xa')]}});};exports[_0x561a('0xb')]=function(_0x5b3510){return request(_0x561a('0xc'),{'options':{'raw':![],'where':{'name':_0x5b3510},'attributes':[_0x561a('0xa')]}});};exports['getMailAccountById']=function(_0x3a1eee){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3a1eee},'include':[{'model':_0x561a('0xd'),'as':_0x561a('0xe'),'include':[{'model':_0x561a('0xf'),'as':_0x561a('0xf')}]}],'attributes':['id',_0x561a('0x10'),_0x561a('0x11')],'smtp':!![]}});};exports[_0x561a('0x12')]=function(_0x22c89d){return request(_0x561a('0xc'),{'options':{'where':{'id':_0x22c89d},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x13')]=function(_0x28638b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x28638b},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x14')]=function(_0x1ab5ae){return request(_0x561a('0x15'),{'options':{'where':{'id':_0x1ab5ae},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x16')]=function(_0x3d91be){return request(_0x561a('0x17'),{'options':{'where':{'id':_0x3d91be},'attributes':[_0x561a('0x18')]}});};exports[_0x561a('0x19')]=function(_0x19870a){return request('ShowUser',{'options':{'where':{'id':_0x19870a},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x1a')]=function(_0x533d95){return request(_0x561a('0x1b'),{'options':{'where':{'phone':_0x533d95[_0x561a('0x1c')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x22c72a){return request('ShowTrunk',{'options':{'where':{'id':_0x22c72a},'attributes':['name']}});};exports[_0x561a('0x1d')]=function(_0xb023e6){return request('ShowSound',{'options':{'where':{'id':_0xb023e6},'attributes':[_0x561a('0x1e')]}});};exports[_0x561a('0x1f')]=function(_0x1367e2){return request(_0x561a('0x20'),{'options':{'raw':![],'where':{'id':_0x1367e2},'include':[{'model':_0x561a('0x21'),'as':_0x561a('0x22')}]}});};exports['getSmsAccountById']=function(_0x3e5509){return request(_0x561a('0x23'),{'options':{'where':{'id':_0x3e5509},'attributes':['id',_0x561a('0x10')]}});};exports['createSmsMessage']=function(_0x58c32f){return request(_0x561a('0x24'),{'body':_0x58c32f});};exports[_0x561a('0x25')]=function(_0x27afb3){return request(_0x561a('0x26'),{'body':_0x27afb3});};exports[_0x561a('0x27')]=function(_0x23ec64){return request(_0x561a('0x28'),{'body':_[_0x561a('0x29')](_0x23ec64,{'project_name':_0x23ec64['arg_1'],'prev_project_name':_0x23ec64['arg_2']||'','is_subproject':_0x23ec64[_0x561a('0x2a')]?!![]:![],'leaveAt':moment()[_0x561a('0x2b')](_0x561a('0x2c'))})});};exports[_0x561a('0x2d')]=function(_0x5a0acd){return request(_0x561a('0x2e'),{'body':_0x5a0acd});};exports[_0x561a('0x2f')]=function(_0x44c851){return request(_0x561a('0x30'),{'body':_0x44c851});};exports[_0x561a('0x31')]=function(_0x47f93a){return request(_0x561a('0x32'),{'options':{'raw':![],'where':{'phone':_0x47f93a[_0x561a('0x1c')],'ListId':_0x47f93a['ListId']}}})[_0x561a('0x33')](function(_0x276ae7){if(_0x276ae7){return _0x276ae7;}return request('CreateCmContact',{'body':_0x47f93a});});};exports[_0x561a('0x34')]=function(_0x591737){return request('ShowPause',{'options':{'where':{'id':_0x591737},'attributes':[_0x561a('0x10')]}});};exports[_0x561a('0x35')]=function(_0x4e0042,_0x10c24b){return request(_0x561a('0x36'),{'body':{'interface':_0x10c24b},'options':{'where':_0x4e0042}});};exports[_0x561a('0x37')]=function(_0x278c7e,_0x169243,_0xbb2ae8){return request(_0x561a('0x38'),{'body':{'type':_0x169243,'uniqueid':_0xbb2ae8},'options':{'where':_0x278c7e}});};exports[_0x561a('0x39')]=function(_0x506c2e){return request(_0x561a('0x3a'),{'body':{},'options':{'where':_0x506c2e}});};exports[_0x561a('0x3b')]=function(_0x2ab150){return request(_0x561a('0x3c'),{'body':{},'options':{'where':_0x2ab150}});}; \ 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 e6126f1..3504292 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 _0xdfe7=['./lex','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x2ea010,_0x20ab5b){_0x2ea010=_0x2ea010-0x0;var _0x215bc3=_0xdfe7[_0x2ea010];return _0x215bc3;};var polly=require('./polly');var lex=require(_0x7dfe('0x0'));module[_0x7dfe('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x14f5=['./lex'];(function(_0x1861b2,_0x196a4f){var _0x1d6f21=function(_0x5f5c5d){while(--_0x5f5c5d){_0x1861b2['push'](_0x1861b2['shift']());}};_0x1d6f21(++_0x196a4f);}(_0x14f5,0xae));var _0x514f=function(_0xe7f99f,_0x49aeb4){_0xe7f99f=_0xe7f99f-0x0;var _0x5c9b54=_0x14f5[_0xe7f99f];return _0x5c9b54;};var polly=require('./polly');var lex=require(_0x514f('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 77d1eb1..7499bfe 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 _0x55e0=['./lib/api','exports'];(function(_0x499a53,_0x3f90d8){var _0xfa7d8a=function(_0x411bc3){while(--_0x411bc3){_0x499a53['push'](_0x499a53['shift']());}};_0xfa7d8a(++_0x3f90d8);}(_0x55e0,0xdc));var _0x055e=function(_0x484ba8,_0x38aa81){_0x484ba8=_0x484ba8-0x0;var _0x975e23=_0x55e0[_0x484ba8];return _0x975e23;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ No newline at end of file +var _0xb58b=['exports'];(function(_0x9c1bdf,_0x1c8547){var _0x1ac49d=function(_0x4fc441){while(--_0x4fc441){_0x9c1bdf['push'](_0x9c1bdf['shift']());}};_0x1ac49d(++_0x1c8547);}(_0xb58b,0x1f1));var _0xbb58=function(_0xe44204,_0x3922a7){_0xe44204=_0xe44204-0x0;var _0x4c2e54=_0xb58b[_0xe44204];return _0x4c2e54;};'use strict';var lex=require('./lib/api');module[_0xbb58('0x0')]=function(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5){return lex(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5);}; \ 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 9529b20..2d93912 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(_0x44f0f2,_0x2f383f){var _0x5462f5=function(_0x3c47e6){while(--_0x3c47e6){_0x44f0f2['push'](_0x44f0f2['shift']());}};_0x5462f5(++_0x2f383f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0xb6a1c5,_0x10ec94){var _0x2d789f=function(_0x4083e9){while(--_0x4083e9){_0xb6a1c5['push'](_0xb6a1c5['shift']());}};_0x2d789f(++_0x10ec94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 869508a..d611441 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 _0x31ee=['./lib/api','exports'];(function(_0x19613f,_0x57e298){var _0x153aeb=function(_0x1d3c4f){while(--_0x1d3c4f){_0x19613f['push'](_0x19613f['shift']());}};_0x153aeb(++_0x57e298);}(_0x31ee,0x148));var _0xe31e=function(_0x9cca8c,_0x5b591e){_0x9cca8c=_0x9cca8c-0x0;var _0x40463e=_0x31ee[_0x9cca8c];return _0x40463e;};'use strict';var polly=require(_0xe31e('0x0'));module[_0xe31e('0x1')]=function(_0x40449f,_0x5be9be,_0x17e77b,_0x30ace9,_0x29a05d,_0x13dd84,_0x268f48){return polly(_0x40449f,_0x5be9be,_0x17e77b,_0x30ace9,_0x29a05d,_0x13dd84,_0x268f48);}; \ No newline at end of file +var _0x0084=['./lib/api','exports'];(function(_0x5caea9,_0x49509a){var _0x4a1e6b=function(_0x4a2670){while(--_0x4a2670){_0x5caea9['push'](_0x5caea9['shift']());}};_0x4a1e6b(++_0x49509a);}(_0x0084,0x196));var _0x4008=function(_0x456b77,_0x4fed12){_0x456b77=_0x456b77-0x0;var _0x118bb6=_0x0084[_0x456b77];return _0x118bb6;};'use strict';var polly=require(_0x4008('0x0'));module[_0x4008('0x1')]=function(_0x14ac87,_0x2434d0,_0x35eca9,_0x4bcd19,_0x42fe06,_0x3494fa,_0xb806b3){return polly(_0x14ac87,_0x2434d0,_0x35eca9,_0x4bcd19,_0x42fe06,_0x3494fa,_0xb806b3);}; \ 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 0b37dc3..676fc63 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 _0x53c5=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x99307b,_0x54ba56){var _0x252249=function(_0x303a0c){while(--_0x303a0c){_0x99307b['push'](_0x99307b['shift']());}};_0x252249(++_0x54ba56);}(_0x53c5,0x12d));var _0x553c=function(_0x369d74,_0x4d858c){_0x369d74=_0x369d74-0x0;var _0x439f60=_0x53c5[_0x369d74];return _0x439f60;};'use strict';var fs=require('fs');var path=require(_0x553c('0x0'));var BPromise=require(_0x553c('0x1'));var rs=require(_0x553c('0x2'));var AWS=require(_0x553c('0x3'));function pollyResult(_0x3564c9,_0x43343f,_0x4ad0f5){return new BPromise(function(_0xb02ab2,_0x3f43e5){_0x3564c9[_0x553c('0x4')](_0x43343f,function(_0x33f915,_0x18250d){if(_0x33f915){_0x3f43e5(_0x33f915);}else if(_0x18250d){if(_0x18250d[_0x553c('0x5')]instanceof Buffer){fs[_0x553c('0x6')](_0x4ad0f5,_0x18250d[_0x553c('0x5')],function(_0x39c89c){if(_0x39c89c){_0x3f43e5(_0x39c89c);}else{_0xb02ab2();}});}else{_0x3f43e5(new Error(_0x553c('0x7')));}}else{_0x3f43e5(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x553c('0x8')]=function(_0x2161fa,_0x323c8a,_0x52b902,_0x51b1fe,_0x266f78,_0x41ae0d,_0x1da949){var _0x42ef5b=new AWS['Polly']({'accessKeyId':_0x2161fa,'secretAccessKey':_0x323c8a,'region':_0x52b902});var _0x19f4a6={'Text':_0x266f78,'TextType':_0x41ae0d||'text','OutputFormat':_0x553c('0x9'),'VoiceId':_0x51b1fe};return pollyResult(_0x42ef5b,_0x19f4a6,_0x1da949);}; \ No newline at end of file +var _0x8d71=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x1a5d40,_0x5b6197){var _0x3eb499=function(_0x3985ab){while(--_0x3985ab){_0x1a5d40['push'](_0x1a5d40['shift']());}};_0x3eb499(++_0x5b6197);}(_0x8d71,0x127));var _0x18d7=function(_0x17f664,_0x28be59){_0x17f664=_0x17f664-0x0;var _0x2b4a18=_0x8d71[_0x17f664];return _0x2b4a18;};'use strict';var fs=require('fs');var path=require(_0x18d7('0x0'));var BPromise=require(_0x18d7('0x1'));var rs=require(_0x18d7('0x2'));var AWS=require(_0x18d7('0x3'));function pollyResult(_0x4481a1,_0x23b94e,_0x2760b6){return new BPromise(function(_0x43f871,_0x8968c7){_0x4481a1[_0x18d7('0x4')](_0x23b94e,function(_0x398aec,_0x588335){if(_0x398aec){_0x8968c7(_0x398aec);}else if(_0x588335){if(_0x588335[_0x18d7('0x5')]instanceof Buffer){fs['writeFile'](_0x2760b6,_0x588335[_0x18d7('0x5')],function(_0x54b2c0){if(_0x54b2c0){_0x8968c7(_0x54b2c0);}else{_0x43f871();}});}else{_0x8968c7(new Error(_0x18d7('0x6')));}}else{_0x8968c7(new Error(_0x18d7('0x7')));}});});}module['exports']=function(_0x44c2a1,_0x410360,_0x209548,_0x34566b,_0x3ec826,_0x5b621e,_0x399252){var _0x46b9b7=new AWS[(_0x18d7('0x8'))]({'accessKeyId':_0x44c2a1,'secretAccessKey':_0x410360,'region':_0x209548});var _0x16e1b5={'Text':_0x3ec826,'TextType':_0x5b621e||'text','OutputFormat':_0x18d7('0x9'),'VoiceId':_0x34566b};return pollyResult(_0x46b9b7,_0x16e1b5,_0x399252);}; \ 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 f04bfa3..a4096c3 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 _0x4f73=['exports','./lib/api'];(function(_0x19047b,_0x47106a){var _0x3be5db=function(_0x144b9c){while(--_0x144b9c){_0x19047b['push'](_0x19047b['shift']());}};_0x3be5db(++_0x47106a);}(_0x4f73,0xb3));var _0x34f7=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x4f73[_0x58965a];return _0x254efc;};'use strict';var asr=require(_0x34f7('0x0'));module[_0x34f7('0x1')]=function(_0x30f167,_0x893378,_0x4f0885,_0x55967c){return asr(_0x30f167,_0x893378,_0x4f0885);}; \ No newline at end of file +var _0x222e=['./lib/api','exports'];(function(_0x57b8f,_0x46bd03){var _0x500dc9=function(_0x48e451){while(--_0x48e451){_0x57b8f['push'](_0x57b8f['shift']());}};_0x500dc9(++_0x46bd03);}(_0x222e,0x148));var _0xe222=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x222e[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0xe222('0x0'));module[_0xe222('0x1')]=function(_0xd8e9e6,_0x11effc,_0x1c4386,_0x2034e0){return asr(_0xd8e9e6,_0x11effc,_0x1c4386);}; \ 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 9405576..4c25680 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 _0x8868=['base64','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8868,0x1ca));var _0x8886=function(_0x5dc577,_0x1de92b){_0x5dc577=_0x5dc577-0x0;var _0x250b22=_0x8868[_0x5dc577];return _0x250b22;};'use strict';var url=require(_0x8886('0x0'));var BPromise=require(_0x8886('0x1'));var fs=require('fs');var host=_0x8886('0x2');module[_0x8886('0x3')]=function(_0x11d0f9,_0x46ec8e,_0x34cd50){return new BPromise(function(_0x2508b2,_0x230fbb){var _0x224e93;if(typeof _0x11d0f9!==_0x8886('0x4')||_0x11d0f9['length']===0x0){return _0x230fbb('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x46ec8e!==_0x8886('0x4')||_0x46ec8e[_0x8886('0x5')]===0x0){return _0x230fbb('key\x20should\x20be\x20a\x20string');}if(typeof _0x34cd50!==_0x8886('0x6')&&(typeof _0x34cd50!=='string'||_0x34cd50[_0x8886('0x5')]===0x0)){return _0x230fbb(_0x8886('0x7'));}try{_0x224e93=fs[_0x8886('0x8')](_0x11d0f9)[_0x8886('0x9')](_0x8886('0xa'));}catch(_0x57b50){return _0x230fbb(_0x57b50);}return _0x2508b2({'method':'POST','uri':host+_0x8886('0xb')+_0x46ec8e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x34cd50},'audio':{'content':_0x224e93}},'json':!![]});});}; \ No newline at end of file +var _0x136c=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64'];(function(_0x5235a7,_0x3a065b){var _0x463bbf=function(_0x5934bc){while(--_0x5934bc){_0x5235a7['push'](_0x5235a7['shift']());}};_0x463bbf(++_0x3a065b);}(_0x136c,0x1d2));var _0xc136=function(_0xf77fc1,_0x1b5f46){_0xf77fc1=_0xf77fc1-0x0;var _0xf8faa7=_0x136c[_0xf77fc1];return _0xf8faa7;};'use strict';var url=require(_0xc136('0x0'));var BPromise=require(_0xc136('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xc136('0x2')]=function(_0x3b4cbd,_0x34c789,_0x15181c){return new BPromise(function(_0x1935fe,_0x9e2e9d){var _0x19565a;if(typeof _0x3b4cbd!==_0xc136('0x3')||_0x3b4cbd[_0xc136('0x4')]===0x0){return _0x9e2e9d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x34c789!==_0xc136('0x3')||_0x34c789['length']===0x0){return _0x9e2e9d(_0xc136('0x5'));}if(typeof _0x15181c!==_0xc136('0x6')&&(typeof _0x15181c!==_0xc136('0x3')||_0x15181c['length']===0x0)){return _0x9e2e9d(_0xc136('0x7'));}try{_0x19565a=fs['readFileSync'](_0x3b4cbd)[_0xc136('0x8')](_0xc136('0x9'));}catch(_0x181f1d){return _0x9e2e9d(_0x181f1d);}return _0x1935fe({'method':_0xc136('0xa'),'uri':host+_0xc136('0xb')+_0x34c789,'body':{'config':{'encoding':_0xc136('0xc'),'sampleRateHertz':_0xc136('0xd'),'languageCode':_0x15181c},'audio':{'content':_0x19565a}},'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 e246d55..9c997f8 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 _0x1055=['./asr','exports'];(function(_0x400d80,_0x5d771f){var _0x56a6c9=function(_0x38f805){while(--_0x38f805){_0x400d80['push'](_0x400d80['shift']());}};_0x56a6c9(++_0x5d771f);}(_0x1055,0x1d0));var _0x5105=function(_0x4fdd64,_0x4ec5d4){_0x4fdd64=_0x4fdd64-0x0;var _0x1e9ae1=_0x1055[_0x4fdd64];return _0x1e9ae1;};var asr=require(_0x5105('0x0'));module[_0x5105('0x1')]={'asr':asr}; \ No newline at end of file +var _0xea08=['exports'];(function(_0x5f0f7c,_0x307917){var _0x8944ad=function(_0x4f908d){while(--_0x4f908d){_0x5f0f7c['push'](_0x5f0f7c['shift']());}};_0x8944ad(++_0x307917);}(_0xea08,0x11b));var _0x8ea0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xea08[_0x40a045];return _0x1a687c;};var asr=require('./asr');module[_0x8ea0('0x0')]={'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 20cf9cf..1722f72 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 _0x8f13=['CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','finish','info','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','base64','then','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','catch','name','message','textRequest','result','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','chmodSync','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','sestekNDA','nda','text','channelData','CustomAction'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x8f13,0x87));var _0x38f1=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8f13[_0x36dfbd];return _0x4ecad9;};'use strict';var apiai=require(_0x38f1('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x38f1('0x1'));var fs=require('fs');var http=require(_0x38f1('0x2'));var https=require(_0x38f1('0x3'));var md5=require(_0x38f1('0x4'));var path=require(_0x38f1('0x5'));var querystring=require(_0x38f1('0x6'));var rp=require(_0x38f1('0x7'));var rs=require(_0x38f1('0x8'));var sox=require(_0x38f1('0x9'));var tts=require(_0x38f1('0xa'));var urlParse=require('url')[_0x38f1('0xb')];var util=require(_0x38f1('0xc'));var aws=require(_0x38f1('0xd'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x38f1('0xe'));var logger=require(_0x38f1('0xf'))(_0x38f1('0x10'));var ISPEECH_API=_0x38f1('0x11');function downloadFile(_0x593380,_0x2251bd){return new BPromise(function(_0x5b696f,_0x57114f){var _0x3f0976=urlParse(_0x593380);var _0x58d951=_0x3f0976[_0x38f1('0x12')]===_0x38f1('0x13')?https:http;var _0x5da310={'host':_0x3f0976[_0x38f1('0x14')],'path':_0x3f0976[_0x38f1('0x5')],'headers':{'user-agent':_0x38f1('0x15')}};_0x58d951[_0x38f1('0x16')](_0x5da310,function(_0x303a2a){if(_0x303a2a['statusCode']!==0xc8){logger[_0x38f1('0x17')]('request\x20to\x20'+_0x593380+'\x20failed,\x20status\x20code\x20=\x20'+_0x303a2a[_0x38f1('0x18')]+'\x20('+_0x303a2a[_0x38f1('0x19')]+')');_0x57114f(new Error(_0x38f1('0x1a')+_0x593380+_0x38f1('0x1b')+_0x303a2a[_0x38f1('0x18')]+'\x20('+_0x303a2a['statusMessage']+')'));return;}var _0x30798c=fs['createWriteStream'](_0x2251bd);_0x30798c['on'](_0x38f1('0x1c'),function(){logger[_0x38f1('0x1d')]('finish\x20download\x20file');_0x30798c['close'](_0x5b696f);});_0x30798c['on'](_0x38f1('0x17'),function(_0x34ab1a){fs[_0x38f1('0x1e')](_0x2251bd);logger[_0x38f1('0x17')](_0x38f1('0x1f'),_0x34ab1a);_0x57114f(_0x34ab1a);});_0x303a2a[_0x38f1('0x20')](_0x30798c);})['on'](_0x38f1('0x17'),function(_0x258ad3){logger[_0x38f1('0x17')](_0x258ad3);_0x57114f(_0x258ad3);})[_0x38f1('0x21')]();});}function uploadFile(_0x1f12d4){return new BPromise(function(_0x217dab,_0xb58270){var _0x1e87eb=urlParse(_0x1f12d4);var _0xfeb92c=_0x1e87eb['protocol']===_0x38f1('0x13')?https:http;var _0x35d1d6={'host':_0x1e87eb['host'],'path':_0x1e87eb['path'],'headers':{'user-agent':_0x38f1('0x15')}};_0xfeb92c[_0x38f1('0x16')](_0x35d1d6,function(_0x5f3163){if(_0x5f3163['statusCode']!==0xc8){_0xb58270(new Error(_0x38f1('0x1a')+_0x1f12d4+_0x38f1('0x1b')+_0x5f3163[_0x38f1('0x18')]+'\x20('+_0x5f3163[_0x38f1('0x19')]+')'));return;}var _0xb8d6da='';_0x5f3163['on'](_0x38f1('0x22'),function(_0x32127f){_0xb8d6da+=_0x32127f;});_0x5f3163['on']('end',function(){_0x217dab(_0xb8d6da);});})['on']('error',function(_0x48d66d){_0xb58270(_0x48d66d);})['end']();});}function convertFile(_0x40f78c,_0x1cbd3a){return new BPromise(function(_0x131891,_0x24b0a2){var _0x4d0738=sox[_0x38f1('0x23')](_0x40f78c,_0x1cbd3a,{'sampleRate':0x1f40,'format':_0x38f1('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d0738['on'](_0x38f1('0x17'),function(_0x1f17e4){logger['error'](_0x38f1('0x25'),_0x1f17e4);_0x24b0a2(_0x1f17e4);});_0x4d0738['on'](_0x38f1('0x21'),function(){logger['info'](_0x38f1('0x26'));_0x131891();});_0x4d0738['start']();});}function base64Decode(_0x2e427d,_0x20de24){var _0x29f98d=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29'));fs['writeFileSync'](_0x29f98d,_0x2e427d,_0x38f1('0x2a'));return convertFile(_0x29f98d,_0x20de24)[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x29f98d);fs['chmodSync'](_0x20de24,'777');}catch(_0x21f537){logger[_0x38f1('0x17')](_0x21f537);}return _0x20de24[_0x38f1('0x2c')]('.')[0x0];});}function base64Encode(_0x4e3815){var _0x1b5711=fs[_0x38f1('0x2d')](_0x4e3815);return new Buffer(_0x1b5711)['toString']('base64');}exports['googleCloudTTS']=function(_0x4f9ff9,_0x1cf9e6,_0x15a97d,_0x24ebf5,_0x530862,_0x228f74){var _0x9519,_0x35019d;var _0x406092=_0x38f1('0x2e');var _0x469131=_0x38f1('0x2f')+_0x4f9ff9;var _0x5709ba={};if(_0x1cf9e6===_0x38f1('0x30')){_0x5709ba['input']={'ssml':_0x15a97d};}else{_0x5709ba[_0x38f1('0x31')]={'text':_0x15a97d};};_0x5709ba['voice']={'languageCode':_0x24ebf5,'ssmlGender':_0x530862};_0x5709ba[_0x38f1('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x42ce58={'url':_0x406092+_0x38f1('0x33')+_0x469131,'method':_0x38f1('0x34'),'json':!![],'body':_0x5709ba};return rp(_0x42ce58)[_0x38f1('0x2b')](function(_0x201a77){return new BPromise(function(_0x2350e2,_0x283c51){_0x9519=path[_0x38f1('0x35')](__dirname,'tmp',rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));var _0x17b7c5=Buffer[_0x38f1('0x37')](_0x201a77[_0x38f1('0x38')],_0x38f1('0x2a'));return fs[_0x38f1('0x39')](_0x9519,_0x17b7c5,function(_0x8a4421){_0x283c51(_0x8a4421);},function(_0x210750){fs['chmodSync'](_0x9519,_0x38f1('0x3a'));_0x2350e2(_0x210750);});});})[_0x38f1('0x2b')](function(_0x192471){_0x35019d=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+'.wav');return convertFile(_0x9519,_0x35019d);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x9519);fs['chmodSync'](_0x35019d,_0x38f1('0x3a'));}catch(_0x397d52){logger[_0x38f1('0x17')](_0x397d52);}logger[_0x38f1('0x1d')](_0x38f1('0x3b'),_0x35019d[_0x38f1('0x2c')]('.')[0x0]);return _0x35019d[_0x38f1('0x2c')]('.')[0x0];});};exports[_0x38f1('0x3c')]=function(_0x13064e,_0x12e29f){var _0x560ced=_0x38f1('0x3d');var _0x50d206,_0x4d0d3a;var _0x5a7962;var _0x527cb2={'encoding':_0x38f1('0x3e'),'method':_0x38f1('0x34'),'timeout':0x2710,'url':_0x560ced,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x38f1('0x3f'),JSON[_0x38f1('0x40')]([_0x13064e,_0x12e29f||'en',![],_0x38f1('0x41')]),null,_0x38f1('0x42')]]]))};return rp(_0x527cb2)['then'](function(_0xf8c093){try{_0x5a7962=eval(_0xf8c093['slice'](0x5))[0x0][0x2];}catch(_0x383d4d){throw new Error(_0x38f1('0x43')+_0xf8c093[_0x38f1('0x22')]);}if(!_0x5a7962){if(_0x13064e[_0x38f1('0x44')]>0xc8){throw new Error(_0x38f1('0x45'));}else{throw new Error(_0x38f1('0x46')+_0x12e29f+'\x22\x20might\x20not\x20exist');}}try{_0x5a7962=eval(_0x5a7962)[0x0];}catch(_0x3a465c){throw new Error(_0x38f1('0x43')+res['data']);}const _0x3a691d=_0x5a7962;_0x50d206=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));fs[_0x38f1('0x47')](_0x50d206,_0x5a7962,{'encoding':'base64'});_0x4d0d3a=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs['generate'](0x4)+_0x38f1('0x29'));return convertFile(_0x50d206,_0x4d0d3a);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x50d206);fs['chmodSync'](_0x4d0d3a,_0x38f1('0x3a'));}catch(_0x548407){logger[_0x38f1('0x17')](_0x548407);}logger[_0x38f1('0x1d')](_0x38f1('0x48'),_0x4d0d3a['split']('.')[0x0]);return _0x4d0d3a['split']('.')[0x0];});};exports[_0x38f1('0x49')]=function(_0xde1340,_0xcdb295,_0x584e3b){return google['asr'](_0xde1340,_0xcdb295,_0x584e3b)[_0x38f1('0x2b')](function(_0x5508f8){logger[_0x38f1('0x1d')](_0x5508f8[_0x38f1('0x4a')]);return rp(_0x5508f8);})[_0x38f1('0x2b')](function(_0xdf617c){var _0x3d5871='';var _0x5432a0=0x0;try{fs['unlink'](_0xde1340);}catch(_0x2d6837){logger['error'](_0x2d6837);}if(_0xdf617c&&_0xdf617c[_0x38f1('0x4b')]){_0x3d5871=_0xdf617c[_0x38f1('0x4b')][_0x38f1('0x4c')](function(_0x175104){return _0x175104&&_0x175104[_0x38f1('0x4d')][0x0]&&_0x175104[_0x38f1('0x4d')][0x0][_0x38f1('0x4e')]?_0x175104[_0x38f1('0x4d')][0x0][_0x38f1('0x4e')]:'';})['join']('\x0a');_0x5432a0=_0xdf617c[_0x38f1('0x4b')]['map'](function(_0x186ff4){return _0x186ff4&&_0x186ff4[_0x38f1('0x4d')][0x0]&&_0x186ff4[_0x38f1('0x4d')][0x0]['confidence']?_0x186ff4[_0x38f1('0x4d')][0x0][_0x38f1('0x4f')]:0x0;})['join']('\x0a');}logger[_0x38f1('0x1d')]('googleASR\x20transcription',_0x3d5871);logger[_0x38f1('0x1d')]('googleASR\x20confidence',_0x5432a0);return{'transcript':_0x3d5871,'confidence':_0x5432a0};})[_0x38f1('0x50')](function(_0x948f0a){logger['error']('[%s]\x20%s:%s',_0x948f0a[_0x38f1('0x18')],_0x948f0a[_0x38f1('0x51')],_0x948f0a[_0x38f1('0x52')]);});};exports['googleDialogflow']=function(_0x2c0f52,_0x23b118,_0x4ea7f9,_0x27ac39){var _0x2e5ee6=apiai(_0x23b118,{'language':_0x27ac39||'en'});return _0x2e5ee6[_0x38f1('0x53')](_0x4ea7f9,{'sessionId':md5(_0x2c0f52)})[_0x38f1('0x2b')](function(_0x16bf08){logger['info'](JSON['stringify'](_0x16bf08));return{'source':_0x16bf08[_0x38f1('0x54')]['source'],'resolvedQuery':_0x16bf08[_0x38f1('0x54')]['resolvedQuery'],'action':_0x16bf08[_0x38f1('0x54')]['action'],'actionIncomplete':_0x16bf08['result'][_0x38f1('0x55')],'speech':_0x16bf08['result'][_0x38f1('0x56')][_0x38f1('0x57')],'score':_0x16bf08[_0x38f1('0x54')][_0x38f1('0x58')],'statusCode':_0x16bf08[_0x38f1('0x59')][_0x38f1('0x5a')],'endConversation':_0x16bf08['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x16bf08['result'][_0x38f1('0x5b')][_0x38f1('0x5c')]};});};exports['googleDialogflowV2']=function(_0x4c878d,_0x172b45,_0x23df1c,_0x43695e,_0x13175a,_0x45649f){var _0x5bd8c6=_0x43695e[_0x38f1('0x5d')](/\\n/g,'\x0a');var _0x1d1f03={'credentials':{'private_key':_0x5bd8c6,'client_email':_0x23df1c}};var _0x17601b=new dialogflow[(_0x38f1('0x5e'))](_0x1d1f03);var _0x2236e2=_0x17601b[_0x38f1('0x5f')](_0x172b45,md5(_0x4c878d));var _0x17eaff={'session':_0x2236e2,'queryInput':{'text':{'text':_0x13175a,'languageCode':_0x45649f}}};return _0x17601b['detectIntent'](_0x17eaff)[_0x38f1('0x2b')](function(_0x3d0a63){if(_0x3d0a63&&_0x3d0a63[_0x38f1('0x44')]){logger[_0x38f1('0x1d')](_0x38f1('0x60'),JSON[_0x38f1('0x40')](_0x3d0a63));var _0x5d6f41=_0x3d0a63[0x0];if(_0x5d6f41){var _0x4076b4={'action':_0x5d6f41[_0x38f1('0x61')]['action'],'allRequiredParamsPresent':_0x5d6f41['queryResult'][_0x38f1('0x62')],'endConversation':_0x5d6f41['queryResult'][_0x38f1('0x63')]&&_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x63')]['fields']?_0x5d6f41['queryResult'][_0x38f1('0x63')][_0x38f1('0x64')][_0x38f1('0x65')][_0x38f1('0x66')]:![],'fulfillmentText':_0x5d6f41['queryResult'][_0x38f1('0x67')],'intentName':_0x5d6f41['queryResult'][_0x38f1('0x68')][_0x38f1('0x51')],'intentDisplayName':_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x68')][_0x38f1('0x69')],'isFallbackIntent':_0x5d6f41['queryResult'][_0x38f1('0x68')][_0x38f1('0x6a')],'languageCode':_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x6b')],'queryText':_0x5d6f41[_0x38f1('0x61')]['queryText'],'responseId':_0x5d6f41['responseId'],'score':_0x5d6f41[_0x38f1('0x61')]['intentDetectionConfidence'],'speech':_0x5d6f41[_0x38f1('0x61')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x3d0a63)};return _0x4076b4;}}});};exports[_0x38f1('0x6c')]=function(_0x3b887f,_0x183114,_0x3789bb,_0x2cbec9){return tilde[_0x38f1('0x6d')](_0x3b887f,_0x183114,_0x3789bb,_0x2cbec9)[_0x38f1('0x2b')](function(_0x2e5e43){try{fs['unlink'](_0x3b887f);}catch(_0x3b62e8){logger[_0x38f1('0x17')](_0x3b62e8);}logger[_0x38f1('0x1d')](_0x38f1('0x6e'),_0x2e5e43[_0x38f1('0x4e')]);logger[_0x38f1('0x1d')](_0x38f1('0x6f'),_0x2e5e43['confidence']);return _0x2e5e43;});};exports[_0x38f1('0x70')]=function(_0x2641d9,_0x314be2,_0x191e53,_0x4e6f28,_0x1c0dfe,_0x2d46ed){var _0x13ea41=path['resolve'](__dirname,'tmp',rs[_0x38f1('0x28')](0x4)+'.mp3');var _0x4bbee4;return aws['polly'](_0x2641d9,_0x314be2,_0x191e53,_0x4e6f28,_0x1c0dfe,_0x2d46ed,_0x13ea41)[_0x38f1('0x2b')](function(){_0x4bbee4=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29'));return convertFile(_0x13ea41,_0x4bbee4);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x13ea41);fs[_0x38f1('0x71')](_0x4bbee4,'777');}catch(_0x193cf6){logger['error'](_0x193cf6);}return _0x4bbee4[_0x38f1('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0x3cc087,_0x34e1a3,_0xe713c3,_0x6aacb0,_0x178948,_0x4352a5){return aws[_0x38f1('0x72')](_0x3cc087,_0x34e1a3,_0xe713c3,_0x6aacb0,_0x178948,_0x4352a5)[_0x38f1('0x2b')](function(_0x166447){logger['info'](JSON[_0x38f1('0x40')](_0x166447));return _0x166447;});};exports[_0x38f1('0x73')]=function(_0x5f2daa,_0x4ae99f,_0x42d639,_0x1974f5){var _0x27437a=util[_0x38f1('0x74')](_0x38f1('0x75'),ISPEECH_API,_0x5f2daa,encodeURIComponent(_0x4ae99f),_0x42d639,_0x1974f5);var _0x1e9953=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));var _0x53837b;return downloadFile(_0x27437a,_0x1e9953)[_0x38f1('0x2b')](function(){_0x53837b=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x1e9953,_0x53837b);})[_0x38f1('0x2b')](function(){try{fs['unlink'](_0x1e9953);fs[_0x38f1('0x71')](_0x53837b,_0x38f1('0x3a'));}catch(_0x59f196){logger[_0x38f1('0x17')](_0x59f196);}return _0x53837b[_0x38f1('0x2c')]('.')[0x0];});};exports[_0x38f1('0x76')]=function(_0x1f0bed,_0x3de04a,_0x140ec0,_0x4019b1){var _0xe0bf9f=util[_0x38f1('0x74')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3de04a,_0x140ec0,base64Encode(_0x1f0bed),_0x4019b1?util[_0x38f1('0x74')](_0x38f1('0x77'),encodeURIComponent(_0x4019b1)):'freeform=3');return uploadFile(_0xe0bf9f)[_0x38f1('0x2b')](function(_0x38afbc){return querystring['parse'](_0x38afbc);});};exports[_0x38f1('0x78')]=function(_0x33f4f6,_0x27ec99){return sestek[_0x38f1('0x79')](_0x33f4f6,_0x27ec99)[_0x38f1('0x2b')](function(_0x533ff5){logger[_0x38f1('0x1d')](JSON[_0x38f1('0x40')](_0x533ff5));var _0x5e2776={'speech':_0x533ff5[_0x38f1('0x7a')],'action':_0x533ff5[_0x38f1('0x7b')]?_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7c')]:undefined,'actiondata':_0x533ff5['channelData']?_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7d')]:undefined};if(_0x533ff5['channelData']&&_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7e')]){return base64Decode(_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7e')][_0x38f1('0x7f')],path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29')))[_0x38f1('0x2b')](function(_0x50d7a5){_0x5e2776[_0x38f1('0x80')]=_0x50d7a5;return _0x5e2776;});}return _0x5e2776;});};exports[_0x38f1('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0xa231=['transcode','wav','error\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','.mp3','goggleTTS\x20path','uri','results','map','transcript','join','alternatives','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','endConversation','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','queryText','intentDetectionConfidence','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20confidence','polly','ispeechTTS','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','path','querystring','randomstring','sox','url','parse','util','./aws','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','request\x20to\x20','data'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xa231,0x163));var _0x1a23=function(_0x4ad37c,_0x2e7490){_0x4ad37c=_0x4ad37c-0x0;var _0x288919=_0xa231[_0x4ad37c];return _0x288919;};'use strict';var apiai=require(_0x1a23('0x0'));var BPromise=require(_0x1a23('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require('https');var md5=require('md5');var path=require(_0x1a23('0x2'));var querystring=require(_0x1a23('0x3'));var rp=require('request-promise');var rs=require(_0x1a23('0x4'));var sox=require(_0x1a23('0x5'));var tts=require('google-tts-api');var urlParse=require(_0x1a23('0x6'))[_0x1a23('0x7')];var util=require(_0x1a23('0x8'));var aws=require(_0x1a23('0x9'));var google=require('./google');var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x1a23('0xa'))(_0x1a23('0xb'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x125196,_0x579037){return new BPromise(function(_0x55e979,_0x6bc005){var _0x40a2d3=urlParse(_0x125196);var _0x4ba1b0=_0x40a2d3[_0x1a23('0xc')]===_0x1a23('0xd')?https:http;var _0x36c841={'host':_0x40a2d3[_0x1a23('0xe')],'path':_0x40a2d3[_0x1a23('0x2')],'headers':{'user-agent':_0x1a23('0xf')}};_0x4ba1b0[_0x1a23('0x10')](_0x36c841,function(_0x206b2d){if(_0x206b2d['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x125196+_0x1a23('0x11')+_0x206b2d[_0x1a23('0x12')]+'\x20('+_0x206b2d[_0x1a23('0x13')]+')');_0x6bc005(new Error('request\x20to\x20'+_0x125196+'\x20failed,\x20status\x20code\x20=\x20'+_0x206b2d[_0x1a23('0x12')]+'\x20('+_0x206b2d[_0x1a23('0x13')]+')'));return;}var _0x44d03=fs[_0x1a23('0x14')](_0x579037);_0x44d03['on'](_0x1a23('0x15'),function(){logger[_0x1a23('0x16')](_0x1a23('0x17'));_0x44d03[_0x1a23('0x18')](_0x55e979);});_0x44d03['on'](_0x1a23('0x19'),function(_0x22b278){fs[_0x1a23('0x1a')](_0x579037);logger[_0x1a23('0x19')](_0x1a23('0x1b'),_0x22b278);_0x6bc005(_0x22b278);});_0x206b2d[_0x1a23('0x1c')](_0x44d03);})['on']('error',function(_0x2db41d){logger['error'](_0x2db41d);_0x6bc005(_0x2db41d);})[_0x1a23('0x1d')]();});}function uploadFile(_0x170c34){return new BPromise(function(_0x18bdcb,_0x2a0169){var _0x2a7c6c=urlParse(_0x170c34);var _0x311f1a=_0x2a7c6c['protocol']==='https:'?https:http;var _0x550966={'host':_0x2a7c6c[_0x1a23('0xe')],'path':_0x2a7c6c[_0x1a23('0x2')],'headers':{'user-agent':'WHAT_EVER'}};_0x311f1a['get'](_0x550966,function(_0x7d311){if(_0x7d311[_0x1a23('0x12')]!==0xc8){_0x2a0169(new Error(_0x1a23('0x1e')+_0x170c34+_0x1a23('0x11')+_0x7d311['statusCode']+'\x20('+_0x7d311[_0x1a23('0x13')]+')'));return;}var _0x2ae43e='';_0x7d311['on'](_0x1a23('0x1f'),function(_0x4152ef){_0x2ae43e+=_0x4152ef;});_0x7d311['on'](_0x1a23('0x1d'),function(){_0x18bdcb(_0x2ae43e);});})['on']('error',function(_0x4890b1){_0x2a0169(_0x4890b1);})[_0x1a23('0x1d')]();});}function convertFile(_0x21557f,_0x53205b){return new BPromise(function(_0x44bc31,_0x575524){var _0x20f8e6=sox[_0x1a23('0x20')](_0x21557f,_0x53205b,{'sampleRate':0x1f40,'format':_0x1a23('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20f8e6['on']('error',function(_0x4190a9){logger[_0x1a23('0x19')](_0x1a23('0x22'),_0x4190a9);_0x575524(_0x4190a9);});_0x20f8e6['on'](_0x1a23('0x1d'),function(){logger['info']('finish\x20to\x20convert');_0x44bc31();});_0x20f8e6[_0x1a23('0x23')]();});}function base64Decode(_0x5b032a,_0xa5aa2b){var _0x3343a5=path['resolve'](__dirname,_0x1a23('0x24'),rs[_0x1a23('0x25')](0x4)+_0x1a23('0x26'));fs[_0x1a23('0x27')](_0x3343a5,_0x5b032a,_0x1a23('0x28'));return convertFile(_0x3343a5,_0xa5aa2b)[_0x1a23('0x29')](function(){try{fs[_0x1a23('0x1a')](_0x3343a5);fs[_0x1a23('0x2a')](_0xa5aa2b,_0x1a23('0x2b'));}catch(_0x283069){logger[_0x1a23('0x19')](_0x283069);}return _0xa5aa2b[_0x1a23('0x2c')]('.')[0x0];});}function base64Encode(_0x497a3a){var _0x29025e=fs[_0x1a23('0x2d')](_0x497a3a);return new Buffer(_0x29025e)['toString'](_0x1a23('0x28'));}exports[_0x1a23('0x2e')]=function(_0x1dea71,_0x22226c,_0x22131c,_0x1cf4b7,_0x812269,_0x44596c){var _0x1813c4,_0x4e71de;var _0x2af878=_0x1a23('0x2f');var _0x22a951=_0x1a23('0x30')+_0x1dea71;var _0x18fea7={};if(_0x22226c===_0x1a23('0x31')){_0x18fea7[_0x1a23('0x32')]={'ssml':_0x22131c};}else{_0x18fea7[_0x1a23('0x32')]={'text':_0x22131c};};_0x18fea7[_0x1a23('0x33')]={'languageCode':_0x1cf4b7,'ssmlGender':_0x812269};_0x18fea7[_0x1a23('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1491ba={'url':_0x2af878+_0x1a23('0x35')+_0x22a951,'method':_0x1a23('0x36'),'json':!![],'body':_0x18fea7};return rp(_0x1491ba)['then'](function(_0x1fd0f0){return new BPromise(function(_0x54b41f,_0x5596d7){_0x1813c4=path[_0x1a23('0x37')](__dirname,_0x1a23('0x24'),rs[_0x1a23('0x25')](0x4)+'.mp3');var _0x1e7466=Buffer[_0x1a23('0x38')](_0x1fd0f0[_0x1a23('0x39')],'base64');return fs[_0x1a23('0x3a')](_0x1813c4,_0x1e7466,function(_0x398ae6){_0x5596d7(_0x398ae6);},function(_0x46ac6e){fs[_0x1a23('0x2a')](_0x1813c4,'777');_0x54b41f(_0x46ac6e);});});})['then'](function(_0x53e3a5){_0x4e71de=path[_0x1a23('0x37')](__dirname,_0x1a23('0x24'),rs[_0x1a23('0x25')](0x4)+_0x1a23('0x26'));return convertFile(_0x1813c4,_0x4e71de);})[_0x1a23('0x29')](function(){try{fs[_0x1a23('0x1a')](_0x1813c4);fs['chmodSync'](_0x4e71de,'777');}catch(_0x490064){logger['error'](_0x490064);}logger['info'](_0x1a23('0x3b'),_0x4e71de[_0x1a23('0x2c')]('.')[0x0]);return _0x4e71de['split']('.')[0x0];});};exports[_0x1a23('0x3c')]=function(_0x42c581,_0x454a53){var _0x41242f='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x13798a,_0xaade53;var _0x11dfdb;var _0x3bb405={'encoding':_0x1a23('0x3d'),'method':_0x1a23('0x36'),'timeout':0x2710,'url':_0x41242f,'headers':{'Content-Type':_0x1a23('0x3e')},'body':_0x1a23('0x3f')+encodeURIComponent(JSON[_0x1a23('0x40')]([[[_0x1a23('0x41'),JSON[_0x1a23('0x40')]([_0x42c581,_0x454a53||'en',![],'null']),null,_0x1a23('0x42')]]]))};return rp(_0x3bb405)[_0x1a23('0x29')](function(_0x6dac16){try{_0x11dfdb=eval(_0x6dac16[_0x1a23('0x43')](0x5))[0x0][0x2];}catch(_0x4eba3f){throw new Error(_0x1a23('0x44')+_0x6dac16[_0x1a23('0x1f')]);}if(!_0x11dfdb){if(_0x42c581[_0x1a23('0x45')]>0xc8){throw new Error(_0x1a23('0x46'));}else{throw new Error(_0x1a23('0x47')+_0x454a53+'\x22\x20might\x20not\x20exist');}}try{_0x11dfdb=eval(_0x11dfdb)[0x0];}catch(_0x400fa4){throw new Error(_0x1a23('0x44')+res[_0x1a23('0x1f')]);}const _0x28bcfc=_0x11dfdb;_0x13798a=path['resolve'](__dirname,_0x1a23('0x24'),rs['generate'](0x4)+_0x1a23('0x48'));fs['writeFileSync'](_0x13798a,_0x11dfdb,{'encoding':_0x1a23('0x28')});_0xaade53=path[_0x1a23('0x37')](__dirname,'tmp',rs[_0x1a23('0x25')](0x4)+_0x1a23('0x26'));return convertFile(_0x13798a,_0xaade53);})[_0x1a23('0x29')](function(){try{fs[_0x1a23('0x1a')](_0x13798a);fs[_0x1a23('0x2a')](_0xaade53,_0x1a23('0x2b'));}catch(_0x4e8612){logger['error'](_0x4e8612);}logger[_0x1a23('0x16')](_0x1a23('0x49'),_0xaade53[_0x1a23('0x2c')]('.')[0x0]);return _0xaade53[_0x1a23('0x2c')]('.')[0x0];});};exports['googleASR']=function(_0x486161,_0x3c193d,_0x3a1b27){return google['asr'](_0x486161,_0x3c193d,_0x3a1b27)[_0x1a23('0x29')](function(_0x57b018){logger[_0x1a23('0x16')](_0x57b018[_0x1a23('0x4a')]);return rp(_0x57b018);})[_0x1a23('0x29')](function(_0x4d5a70){var _0xe6d248='';var _0x72ad9e=0x0;try{fs[_0x1a23('0x1a')](_0x486161);}catch(_0x4f7bc3){logger['error'](_0x4f7bc3);}if(_0x4d5a70&&_0x4d5a70[_0x1a23('0x4b')]){_0xe6d248=_0x4d5a70[_0x1a23('0x4b')][_0x1a23('0x4c')](function(_0x3e1cda){return _0x3e1cda&&_0x3e1cda['alternatives'][0x0]&&_0x3e1cda['alternatives'][0x0][_0x1a23('0x4d')]?_0x3e1cda['alternatives'][0x0][_0x1a23('0x4d')]:'';})[_0x1a23('0x4e')]('\x0a');_0x72ad9e=_0x4d5a70[_0x1a23('0x4b')][_0x1a23('0x4c')](function(_0xffed69){return _0xffed69&&_0xffed69[_0x1a23('0x4f')][0x0]&&_0xffed69['alternatives'][0x0][_0x1a23('0x50')]?_0xffed69[_0x1a23('0x4f')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x1a23('0x16')](_0x1a23('0x51'),_0xe6d248);logger[_0x1a23('0x16')](_0x1a23('0x52'),_0x72ad9e);return{'transcript':_0xe6d248,'confidence':_0x72ad9e};})[_0x1a23('0x53')](function(_0x544c06){logger[_0x1a23('0x19')](_0x1a23('0x54'),_0x544c06[_0x1a23('0x12')],_0x544c06[_0x1a23('0x55')],_0x544c06['message']);});};exports[_0x1a23('0x56')]=function(_0x59f816,_0x5d7f9f,_0x5d53ea,_0xd18341){var _0x55eb39=apiai(_0x5d7f9f,{'language':_0xd18341||'en'});return _0x55eb39['textRequest'](_0x5d53ea,{'sessionId':md5(_0x59f816)})[_0x1a23('0x29')](function(_0x6ce831){logger[_0x1a23('0x16')](JSON['stringify'](_0x6ce831));return{'source':_0x6ce831['result']['source'],'resolvedQuery':_0x6ce831[_0x1a23('0x57')][_0x1a23('0x58')],'action':_0x6ce831['result'][_0x1a23('0x59')],'actionIncomplete':_0x6ce831[_0x1a23('0x57')][_0x1a23('0x5a')],'speech':_0x6ce831[_0x1a23('0x57')][_0x1a23('0x5b')]['speech'],'score':_0x6ce831[_0x1a23('0x57')][_0x1a23('0x5c')],'statusCode':_0x6ce831[_0x1a23('0x5d')][_0x1a23('0x5e')],'endConversation':_0x6ce831[_0x1a23('0x57')]['metadata'][_0x1a23('0x5f')]||![],'isFallbackIntent':_0x6ce831[_0x1a23('0x57')][_0x1a23('0x60')][_0x1a23('0x61')]};});};exports['googleDialogflowV2']=function(_0x580975,_0xb23b87,_0x8ac5ef,_0x22ff68,_0x31bd8c,_0x2bd6bc){var _0xc11e1c=_0x22ff68[_0x1a23('0x62')](/\\n/g,'\x0a');var _0x30103e={'credentials':{'private_key':_0xc11e1c,'client_email':_0x8ac5ef}};var _0x59013c=new dialogflow[(_0x1a23('0x63'))](_0x30103e);var _0x9965bd=_0x59013c[_0x1a23('0x64')](_0xb23b87,md5(_0x580975));var _0x322ed7={'session':_0x9965bd,'queryInput':{'text':{'text':_0x31bd8c,'languageCode':_0x2bd6bc}}};return _0x59013c[_0x1a23('0x65')](_0x322ed7)[_0x1a23('0x29')](function(_0x42888d){if(_0x42888d&&_0x42888d[_0x1a23('0x45')]){logger[_0x1a23('0x16')](_0x1a23('0x66'),JSON[_0x1a23('0x40')](_0x42888d));var _0x12c71c=_0x42888d[0x0];if(_0x12c71c){var _0x33e7fd={'action':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x59')],'allRequiredParamsPresent':_0x12c71c[_0x1a23('0x67')]['allRequiredParamsPresent'],'endConversation':_0x12c71c['queryResult'][_0x1a23('0x68')]&&_0x12c71c[_0x1a23('0x67')][_0x1a23('0x68')][_0x1a23('0x69')]?_0x12c71c['queryResult'][_0x1a23('0x68')]['fields']['end_conversation'][_0x1a23('0x6a')]:![],'fulfillmentText':_0x12c71c['queryResult']['fulfillmentText'],'intentName':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x6b')]['name'],'intentDisplayName':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x6b')][_0x1a23('0x6c')],'isFallbackIntent':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x6b')][_0x1a23('0x6d')],'languageCode':_0x12c71c['queryResult']['languageCode'],'queryText':_0x12c71c['queryResult'][_0x1a23('0x6e')],'responseId':_0x12c71c['responseId'],'score':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x6f')],'speech':_0x12c71c[_0x1a23('0x67')][_0x1a23('0x70')],'providerResponse':JSON[_0x1a23('0x40')](_0x42888d)};return _0x33e7fd;}}});};exports[_0x1a23('0x71')]=function(_0x4cc5f9,_0x595853,_0x2cd558,_0x1a495b){return tilde[_0x1a23('0x72')](_0x4cc5f9,_0x595853,_0x2cd558,_0x1a495b)['then'](function(_0xb635dc){try{fs[_0x1a23('0x1a')](_0x4cc5f9);}catch(_0x1b311e){logger[_0x1a23('0x19')](_0x1b311e);}logger[_0x1a23('0x16')]('Tilde\x20ASR\x20transcription',_0xb635dc[_0x1a23('0x4d')]);logger[_0x1a23('0x16')](_0x1a23('0x73'),_0xb635dc[_0x1a23('0x50')]);return _0xb635dc;});};exports['awsPolly']=function(_0x11ab6d,_0x5765bd,_0x16a055,_0xbaeab4,_0x2c7508,_0x5eb141){var _0x3ecfa6=path['resolve'](__dirname,_0x1a23('0x24'),rs['generate'](0x4)+'.mp3');var _0x960e0a;return aws[_0x1a23('0x74')](_0x11ab6d,_0x5765bd,_0x16a055,_0xbaeab4,_0x2c7508,_0x5eb141,_0x3ecfa6)[_0x1a23('0x29')](function(){_0x960e0a=path[_0x1a23('0x37')](__dirname,_0x1a23('0x24'),rs[_0x1a23('0x25')](0x4)+_0x1a23('0x26'));return convertFile(_0x3ecfa6,_0x960e0a);})[_0x1a23('0x29')](function(){try{fs[_0x1a23('0x1a')](_0x3ecfa6);fs[_0x1a23('0x2a')](_0x960e0a,'777');}catch(_0x5ddd01){logger[_0x1a23('0x19')](_0x5ddd01);}return _0x960e0a['split']('.')[0x0];});};exports['awsLex']=function(_0x251e6d,_0xa850fa,_0x533fb0,_0x1b6583,_0x4740e2,_0xf83207){return aws['lex'](_0x251e6d,_0xa850fa,_0x533fb0,_0x1b6583,_0x4740e2,_0xf83207)[_0x1a23('0x29')](function(_0x1af7ee){logger[_0x1a23('0x16')](JSON[_0x1a23('0x40')](_0x1af7ee));return _0x1af7ee;});};exports[_0x1a23('0x75')]=function(_0x1117e9,_0x551392,_0x53beb4,_0xd26903){var _0x668d51=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1117e9,encodeURIComponent(_0x551392),_0x53beb4,_0xd26903);var _0x1356a1=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x1a23('0x48'));var _0x140089;return downloadFile(_0x668d51,_0x1356a1)['then'](function(){_0x140089=path['resolve'](__dirname,_0x1a23('0x24'),rs['generate'](0x4)+_0x1a23('0x26'));return convertFile(_0x1356a1,_0x140089);})[_0x1a23('0x29')](function(){try{fs['unlink'](_0x1356a1);fs[_0x1a23('0x2a')](_0x140089,_0x1a23('0x2b'));}catch(_0x5c8beb){logger[_0x1a23('0x19')](_0x5c8beb);}return _0x140089[_0x1a23('0x2c')]('.')[0x0];});};exports[_0x1a23('0x76')]=function(_0x185b76,_0x3bd439,_0x2a43f7,_0x469b46){var _0x4568d6=util[_0x1a23('0x77')](_0x1a23('0x78'),ISPEECH_API,_0x3bd439,_0x2a43f7,base64Encode(_0x185b76),_0x469b46?util[_0x1a23('0x77')](_0x1a23('0x79'),encodeURIComponent(_0x469b46)):'freeform=3');return uploadFile(_0x4568d6)[_0x1a23('0x29')](function(_0x25f1d7){return querystring[_0x1a23('0x7')](_0x25f1d7);});};exports[_0x1a23('0x7a')]=function(_0x11065b,_0x109ef5){return sestek[_0x1a23('0x7b')](_0x11065b,_0x109ef5)[_0x1a23('0x29')](function(_0xe16e63){logger[_0x1a23('0x16')](JSON['stringify'](_0xe16e63));var _0x367fc3={'speech':_0xe16e63['text'],'action':_0xe16e63['channelData']?_0xe16e63[_0x1a23('0x7c')]['CustomAction']:undefined,'actiondata':_0xe16e63[_0x1a23('0x7c')]?_0xe16e63[_0x1a23('0x7c')][_0x1a23('0x7d')]:undefined};if(_0xe16e63[_0x1a23('0x7c')]&&_0xe16e63['channelData'][_0x1a23('0x7e')]){return base64Decode(_0xe16e63[_0x1a23('0x7c')]['AudioFromTts']['Data'],path[_0x1a23('0x37')](__dirname,_0x1a23('0x24'),rs[_0x1a23('0x25')](0x4)+_0x1a23('0x26')))[_0x1a23('0x29')](function(_0x5f2f3f){_0x367fc3[_0x1a23('0x7f')]=_0x5f2f3f;return _0x367fc3;});}return _0x367fc3;});};exports[_0x1a23('0x80')]=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 8f34e03..1b01526 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x325e=['./nda'];(function(_0x2364d3,_0x4bae1e){var _0x651884=function(_0x18c13c){while(--_0x18c13c){_0x2364d3['push'](_0x2364d3['shift']());}};_0x651884(++_0x4bae1e);}(_0x325e,0xa8));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};var nda=require(_0xe325('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 6083022..c43ef05 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 _0x1d5b=['ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','body','channelData'];(function(_0x14aea2,_0x4fbda6){var _0x37423e=function(_0x3b9c20){while(--_0x3b9c20){_0x14aea2['push'](_0x14aea2['shift']());}};_0x37423e(++_0x4fbda6);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x47d403,_0x2f4ab9){_0x47d403=_0x47d403-0x0;var _0x4ad563=_0x1d5b[_0x47d403];return _0x4ad563;};'use strict';var rp=require(_0xb1d5('0x0'));var url=require(_0xb1d5('0x1'));var logger=require(_0xb1d5('0x2'))('agi');module[_0xb1d5('0x3')]=function(_0x594c25,_0x2f9c5a){var _0x1a673c={'method':_0xb1d5('0x4'),'uri':url[_0xb1d5('0x5')](_0x2f9c5a['ndauth_url'],'/token'),'form':{'grant_type':_0xb1d5('0x6'),'username':_0x2f9c5a[_0xb1d5('0x7')],'password':_0x2f9c5a[_0xb1d5('0x6')]},'json':!![]};return rp(_0x1a673c)[_0xb1d5('0x8')](function(_0x3b452f){var _0xb2d955={'method':_0xb1d5('0x4'),'uri':url[_0xb1d5('0x5')](_0x2f9c5a['ndassistant_url'],_0xb1d5('0x9')),'body':{'type':_0x2f9c5a[_0xb1d5('0xa')]||'message','channelId':'Nda','conversation':{'id':_0x594c25[_0xb1d5('0xb')]},'from':{'id':_0x594c25[_0xb1d5('0xc')],'name':_0x594c25[_0xb1d5('0xd')]},'recipient':{'id':_0x594c25['dnid'],'name':_0x594c25[_0xb1d5('0xe')]},'text':_0x2f9c5a[_0xb1d5('0xf')],'channelData':{}},'headers':{'Authorization':_0xb1d5('0x10')+_0x3b452f['access_token']},'json':!![]};if(_0x2f9c5a[_0xb1d5('0x11')]){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')][_0xb1d5('0x14')]=_0x2f9c5a['project'];}if(_0x2f9c5a[_0xb1d5('0x15')]=='1'){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb1d5('0x16')};}if(_0x2f9c5a[_0xb1d5('0x17')]){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')][_0xb1d5('0x18')]=_0x2f9c5a[_0xb1d5('0x17')];if(_0x2f9c5a['custom_action_data']){_0xb2d955[_0xb1d5('0x12')]['channelData'][_0xb1d5('0x19')]=_0x2f9c5a[_0xb1d5('0x1a')];}}logger['info'](JSON[_0xb1d5('0x1b')](_0xb2d955));return rp(_0xb2d955);});}; \ No newline at end of file +var _0x5eb1=['channelData','ProjectName','project','AudioOutputSettings','audio/wav','custom_action','custom_action_data','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','body'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x5eb1,0x7c));var _0x15eb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5eb1[_0x5f0089];return _0x193892;};'use strict';var rp=require('request-promise');var url=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))(_0x15eb('0x2'));module[_0x15eb('0x3')]=function(_0x2b9937,_0x1c2f32){var _0x5e1142={'method':_0x15eb('0x4'),'uri':url[_0x15eb('0x5')](_0x1c2f32[_0x15eb('0x6')],_0x15eb('0x7')),'form':{'grant_type':'password','username':_0x1c2f32[_0x15eb('0x8')],'password':_0x1c2f32[_0x15eb('0x9')]},'json':!![]};return rp(_0x5e1142)['then'](function(_0xe4d8ce){var _0x160879={'method':_0x15eb('0x4'),'uri':url[_0x15eb('0x5')](_0x1c2f32[_0x15eb('0xa')],_0x15eb('0xb')),'body':{'type':_0x1c2f32[_0x15eb('0xc')]||_0x15eb('0xd'),'channelId':_0x15eb('0xe'),'conversation':{'id':_0x2b9937[_0x15eb('0xf')]},'from':{'id':_0x2b9937[_0x15eb('0x10')],'name':_0x2b9937[_0x15eb('0x11')]},'recipient':{'id':_0x2b9937[_0x15eb('0x12')],'name':_0x2b9937['extension']},'text':_0x1c2f32[_0x15eb('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0xe4d8ce['access_token']},'json':!![]};if(_0x1c2f32['project']){_0x160879[_0x15eb('0x14')][_0x15eb('0x15')][_0x15eb('0x16')]=_0x1c2f32[_0x15eb('0x17')];}if(_0x1c2f32['ndagenerate_audio']=='1'){_0x160879[_0x15eb('0x14')][_0x15eb('0x15')][_0x15eb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x15eb('0x19')};}if(_0x1c2f32['custom_action']){_0x160879['body']['channelData']['CustomAction']=_0x1c2f32[_0x15eb('0x1a')];if(_0x1c2f32['custom_action_data']){_0x160879['body'][_0x15eb('0x15')]['CustomActionData']=_0x1c2f32[_0x15eb('0x1b')];}}logger['info'](JSON[_0x15eb('0x1c')](_0x160879));return rp(_0x160879);});}; \ 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 afeb938..677ae86 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 _0x024d=['./lib/api','exports'];(function(_0x918eae,_0x33b06c){var _0x3efb9a=function(_0x4d58db){while(--_0x4d58db){_0x918eae['push'](_0x918eae['shift']());}};_0x3efb9a(++_0x33b06c);}(_0x024d,0x1e4));var _0xd024=function(_0xf88267,_0x585dab){_0xf88267=_0xf88267-0x0;var _0x450318=_0x024d[_0xf88267];return _0x450318;};'use strict';var asr=require(_0xd024('0x0'));module[_0xd024('0x1')]=function(_0x2660b9,_0x45e4d9,_0x3d2866,_0x27c79c){return asr(_0x2660b9,_0x45e4d9,_0x3d2866,_0x27c79c);}; \ No newline at end of file +var _0x6fa2=['./lib/api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6fa2,0x1b7));var _0x26fa=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6fa2[_0x465a0c];return _0x1e202e;};'use strict';var asr=require(_0x26fa('0x0'));module['exports']=function(_0x39ca19,_0x49a4b3,_0x2e9234,_0x51f85d){return asr(_0x39ca19,_0x49a4b3,_0x2e9234,_0x51f85d);}; \ 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 2b85893..49b9c16 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 _0x8684=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','hypotheses','result','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x8684,0x125));var _0x4868=function(_0x59d2af,_0x1d7c95){_0x59d2af=_0x59d2af-0x0;var _0x2215f0=_0x8684[_0x59d2af];return _0x2215f0;};'use strict';var BPromise=require(_0x4868('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4868('0x1'));var crypto=require(_0x4868('0x2'));var logger=require(_0x4868('0x3'))(_0x4868('0x4'));module[_0x4868('0x5')]=function(_0x31aa80,_0x31c86e,_0x69f521,_0x46f518){return new BPromise(function(_0x489488,_0x15cb88){logger['info'](_0x4868('0x6'),_0x46f518||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x49dbe2=new WebSocket(_0x46f518||_0x4868('0x7'),{'perMessageDeflate':![]});var _0x48a0e8='';var _0x29f2f0='0';var _0x44bef3='1';var _0x5d9dd1=_0x4868('0x8');function _0x3b3637(_0x322951){var _0x306d2c=crypto[_0x4868('0x9')](_0x4868('0xa'));_0x306d2c[_0x4868('0xb')](_0x322951);return _0x306d2c[_0x4868('0xc')](_0x4868('0xd'));}function _0x57aef0(){try{logger[_0x4868('0xe')](_0x4868('0xf'));var _0x2b04f9=moment()[_0x4868('0x10')]();var _0x59075c=_0x3b3637(_0x2b04f9+_0x31c86e+_0x69f521);_0x49dbe2[_0x4868('0x11')](JSON[_0x4868('0x12')]({'appID':_0x31c86e,'timestamp':_0x2b04f9,'appKey':_0x59075c}));var _0x212105=fs[_0x4868('0x13')](_0x31aa80);_0x212105['on'](_0x4868('0x14'),function(_0x46330c){_0x49dbe2[_0x4868('0x11')](_0x46330c);});_0x212105['on'](_0x4868('0x15'),function(){_0x49dbe2[_0x4868('0x11')]('EOS');});}catch(_0x33a33d){logger[_0x4868('0x16')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x33a33d));_0x49dbe2[_0x4868('0x17')]();}}function _0x3ece4d(_0x15151d){try{if(_0x15151d){var _0x1780df=JSON[_0x4868('0x18')](_0x15151d);switch(_0x1780df[_0x4868('0x19')]){case 0x0:if(_0x1780df['result']){if(_0x1780df['result'][_0x4868('0x1a')]){logger['info'](_0x4868('0x1b'),JSON[_0x4868('0x12')](_0x1780df['result'][_0x4868('0x1c')]));_0x48a0e8=_0x1780df[_0x4868('0x1d')][_0x4868('0x1c')][0x0][_0x4868('0x1e')];_0x29f2f0=_0x1780df[_0x4868('0x1d')][_0x4868('0x1c')][0x0][_0x4868('0x1f')];_0x44bef3='0';_0x5d9dd1=_0x4868('0x20');_0x49dbe2[_0x4868('0x17')]();}}break;case 0x1:logger[_0x4868('0xe')](_0x4868('0x8'));_0x44bef3='1';_0x5d9dd1='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x4868('0x21'));_0x44bef3='2';_0x5d9dd1=_0x4868('0x21');break;case 0x9:logger[_0x4868('0xe')](_0x4868('0x22'));_0x44bef3='9';_0x5d9dd1=_0x4868('0x22');break;case 0xa:logger[_0x4868('0xe')](_0x4868('0x23'));_0x44bef3='10';_0x5d9dd1=_0x4868('0x23');break;case 0xb:logger[_0x4868('0xe')](_0x4868('0x24'));_0x44bef3='11';_0x5d9dd1=_0x4868('0x24');}}}catch(_0xc13662){logger[_0x4868('0x16')](_0x4868('0x25'),JSON[_0x4868('0x12')](_0xc13662));_0x49dbe2[_0x4868('0x17')]();}}function _0x184fd2(){logger[_0x4868('0xe')](_0x4868('0x26'));_0x489488({'transcript':_0x48a0e8,'confidence':_0x29f2f0,'status':_0x44bef3,'status_message':_0x5d9dd1});}function _0xa2aa0c(_0x863f02){logger[_0x4868('0x16')](_0x4868('0x27'));if(!_[_0x4868('0x28')](_0x863f02)){logger[_0x4868('0x16')](_['isObject'](_0x863f02)?JSON[_0x4868('0x12')](_0x863f02):_0x863f02);}}_0x49dbe2['on'](_0x4868('0x29'),_0x57aef0);_0x49dbe2['on'](_0x4868('0x2a'),_0x3ece4d);_0x49dbe2['on'](_0x4868('0x15'),_0x184fd2);_0x49dbe2['on'](_0x4868('0x16'),_0xa2aa0c);});}; \ No newline at end of file +var _0x22da=['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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','lodash','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x3b2b55,_0x31c65d){var _0x172194=function(_0xce8119){while(--_0xce8119){_0x3b2b55['push'](_0x3b2b55['shift']());}};_0x172194(++_0x31c65d);}(_0x22da,0x1a1));var _0xa22d=function(_0x5636a0,_0x4d0be2){_0x5636a0=_0x5636a0-0x0;var _0x55b36f=_0x22da[_0x5636a0];return _0x55b36f;};'use strict';var BPromise=require('bluebird');var _=require(_0xa22d('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa22d('0x1'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0xa22d('0x2'));module[_0xa22d('0x3')]=function(_0xe6554e,_0x109d74,_0x4b959a,_0xdcfb7d){return new BPromise(function(_0xbb510,_0xd062ac){logger[_0xa22d('0x4')](_0xa22d('0x5'),_0xdcfb7d||_0xa22d('0x6'));var _0x29dcc0=new WebSocket(_0xdcfb7d||_0xa22d('0x6'),{'perMessageDeflate':![]});var _0xe6a27f='';var _0x41f0a5='0';var _0x48c5dd='1';var _0x49bf08=_0xa22d('0x7');function _0x279468(_0x5a3312){var _0x13c11a=crypto['createHash'](_0xa22d('0x8'));_0x13c11a[_0xa22d('0x9')](_0x5a3312);return _0x13c11a[_0xa22d('0xa')](_0xa22d('0xb'));}function _0x5714a7(){try{logger[_0xa22d('0x4')](_0xa22d('0xc'));var _0x363259=moment()[_0xa22d('0xd')]();var _0x40cba5=_0x279468(_0x363259+_0x109d74+_0x4b959a);_0x29dcc0['send'](JSON[_0xa22d('0xe')]({'appID':_0x109d74,'timestamp':_0x363259,'appKey':_0x40cba5}));var _0x49259e=fs[_0xa22d('0xf')](_0xe6554e);_0x49259e['on'](_0xa22d('0x10'),function(_0x1be3c3){_0x29dcc0[_0xa22d('0x11')](_0x1be3c3);});_0x49259e['on'](_0xa22d('0x12'),function(){_0x29dcc0['send'](_0xa22d('0x13'));});}catch(_0x45ef0f){logger[_0xa22d('0x14')](_0xa22d('0x15'),JSON[_0xa22d('0xe')](_0x45ef0f));_0x29dcc0[_0xa22d('0x16')]();}}function _0x3a1e55(_0xcaaabb){try{if(_0xcaaabb){var _0x2f9135=JSON['parse'](_0xcaaabb);switch(_0x2f9135[_0xa22d('0x17')]){case 0x0:if(_0x2f9135['result']){if(_0x2f9135[_0xa22d('0x18')]['final']){logger[_0xa22d('0x4')](_0xa22d('0x19'),JSON[_0xa22d('0xe')](_0x2f9135['result']['hypotheses']));_0xe6a27f=_0x2f9135[_0xa22d('0x18')][_0xa22d('0x1a')][0x0][_0xa22d('0x1b')];_0x41f0a5=_0x2f9135[_0xa22d('0x18')][_0xa22d('0x1a')][0x0][_0xa22d('0x1c')];_0x48c5dd='0';_0x49bf08=_0xa22d('0x1d');_0x29dcc0[_0xa22d('0x16')]();}}break;case 0x1:logger[_0xa22d('0x4')](_0xa22d('0x7'));_0x48c5dd='1';_0x49bf08='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xa22d('0x4')](_0xa22d('0x1e'));_0x48c5dd='2';_0x49bf08='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xa22d('0x4')](_0xa22d('0x1f'));_0x48c5dd='9';_0x49bf08='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xa22d('0x4')](_0xa22d('0x20'));_0x48c5dd='10';_0x49bf08=_0xa22d('0x20');break;case 0xb:logger[_0xa22d('0x4')](_0xa22d('0x21'));_0x48c5dd='11';_0x49bf08='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xd564d3){logger[_0xa22d('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0xd564d3));_0x29dcc0[_0xa22d('0x16')]();}}function _0x3dfe3f(){logger[_0xa22d('0x4')](_0xa22d('0x22'));_0xbb510({'transcript':_0xe6a27f,'confidence':_0x41f0a5,'status':_0x48c5dd,'status_message':_0x49bf08});}function _0x3f09bd(_0x22078b){logger['error'](_0xa22d('0x23'));if(!_[_0xa22d('0x24')](_0x22078b)){logger[_0xa22d('0x14')](_['isObject'](_0x22078b)?JSON['stringify'](_0x22078b):_0x22078b);}}_0x29dcc0['on']('open',_0x5714a7);_0x29dcc0['on']('message',_0x3a1e55);_0x29dcc0['on'](_0xa22d('0x12'),_0x3dfe3f);_0x29dcc0['on'](_0xa22d('0x14'),_0x3f09bd);});}; \ 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 acb39e5..0501e8f 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 _0xf7b2=['./asr'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0xf7b2,0x174));var _0x2f7b=function(_0x11faa8,_0x349c0c){_0x11faa8=_0x11faa8-0x0;var _0x22bf15=_0xf7b2[_0x11faa8];return _0x22bf15;};var asr=require(_0x2f7b('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x154d=['exports','./asr'];(function(_0x88ffd4,_0x25f7e6){var _0x528f9c=function(_0x166382){while(--_0x166382){_0x88ffd4['push'](_0x88ffd4['shift']());}};_0x528f9c(++_0x25f7e6);}(_0x154d,0xd3));var _0xd154=function(_0x141896,_0x274a81){_0x141896=_0x141896-0x0;var _0x2cec16=_0x154d[_0x141896];return _0x2cec16;};var asr=require(_0xd154('0x0'));module[_0xd154('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 14a1ba5..7a2d99c 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(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'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 7b99854..849e36a 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 _0x86f5=['ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','headers','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','isString','saveRestApiResult','setVariable','split','length','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','wait','no\x20list\x20selected','scheduledAt','add','delay','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','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogout','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','macro','gosub','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','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','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','name','getSquareOdbc','getSquareOdbcById','then','dsn','getUser','getUserById','getTrunk','getSoundById','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','internal','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US'];(function(_0x2d0b09,_0xc9039b){var _0xff78d4=function(_0x52b645){while(--_0x52b645){_0x2d0b09['push'](_0x2d0b09['shift']());}};_0xff78d4(++_0xc9039b);}(_0x86f5,0x178));var _0x586f=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0x86f5[_0xd3348b];return _0x583cdc;};'use strict';var fs=require('fs');var util=require(_0x586f('0x0'));var _=require('lodash');var sh=require(_0x586f('0x1'));var odbc=require(_0x586f('0x2'))();var rs=require('randomstring');var moment=require(_0x586f('0x3'));var Mustache=require(_0x586f('0x4'));var rp=require(_0x586f('0x5'));var logger=require(_0x586f('0x6'))('agi');var config=require('../../config/environment');var shared=require(_0x586f('0x7'));var scripts=require(_0x586f('0x8'));var FILES_PATH=_0x586f('0x9');var recursiveMapAttributes=['rawHeaders',_0x586f('0xa')];var verticesWithRetry=[_0x586f('0xb'),_0x586f('0xc'),'getsecretdigits'];var AGIVertices=function(_0x5d31da,_0x27664e,_0x226d5a){this[_0x586f('0xd')]=_0x5d31da;this[_0x586f('0xe')]=_0x27664e;this[_0x586f('0xf')]=_0x226d5a;};AGIVertices[_0x586f('0x10')][_0x586f('0x11')]=function(_0x497eea,_0x21058a){this['rpc'][_0x586f('0x12')](_0x497eea)['then'](function(_0x3b0cfe){_0x21058a(null,_0x3b0cfe?_0x3b0cfe['name']:![]);})[_0x586f('0x13')](function(_0x560019){_0x21058a(_0x560019);});};AGIVertices[_0x586f('0x10')][_0x586f('0x14')]=function(_0x29b844,_0x3fc15c){this[_0x586f('0xe')][_0x586f('0x15')](_0x29b844)['then'](function(_0x219738){_0x3fc15c(null,_0x219738?_0x219738['name']:![]);})['catch'](function(_0x3381c6){_0x3fc15c(_0x3381c6);});};AGIVertices[_0x586f('0x10')][_0x586f('0x16')]=function(_0x178ca4,_0x30ec4d){this[_0x586f('0xe')]['getSquareProjectById'](_0x178ca4)['then'](function(_0x44f938){_0x30ec4d(null,_0x44f938?_0x44f938[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x35a14e){_0x30ec4d(_0x35a14e);});};AGIVertices[_0x586f('0x10')][_0x586f('0x18')]=function(_0x276f07,_0x1ff7f4){this[_0x586f('0xe')][_0x586f('0x19')](_0x276f07)[_0x586f('0x1a')](function(_0x38fda7){_0x1ff7f4(null,_0x38fda7?_0x38fda7[_0x586f('0x1b')]:![]);})['catch'](function(_0x3e36fb){_0x1ff7f4(_0x3e36fb);});};AGIVertices[_0x586f('0x10')][_0x586f('0x1c')]=function(_0x32b709,_0x4a7c6a){this[_0x586f('0xe')][_0x586f('0x1d')](_0x32b709)[_0x586f('0x1a')](function(_0x2457b3){_0x4a7c6a(null,_0x2457b3?_0x2457b3[_0x586f('0x17')]:![]);})['catch'](function(_0x45e18e){_0x4a7c6a(_0x45e18e);});};AGIVertices[_0x586f('0x10')][_0x586f('0x1e')]=function(_0x15a854,_0x396a6f){this[_0x586f('0xe')]['getTrunkById'](_0x15a854)[_0x586f('0x1a')](function(_0x444032){_0x396a6f(null,_0x444032?_0x444032[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x5536ce){_0x396a6f(_0x5536ce);});};AGIVertices[_0x586f('0x10')]['getSound']=function(_0x1063a3,_0xf059ad){var _0x7aa40d=this;this[_0x586f('0xe')][_0x586f('0x1f')](_0x1063a3)[_0x586f('0x1a')](function(_0x2ba6f1){_0xf059ad(null,_0x2ba6f1?_0x7aa40d['getSoundPath'](_0x2ba6f1[_0x586f('0x20')]):![]);})['catch'](function(_0x3d6bb2){_0xf059ad(_0x3d6bb2);});};AGIVertices['prototype']['getMailAccount']=function(_0x109bd0,_0x2a2f9f){this['rpc']['getMailAccountById'](_0x109bd0)[_0x586f('0x1a')](function(_0x13e324){_0x2a2f9f(null,_0x13e324?_0x13e324:![]);})['catch'](function(_0x15c0fa){_0x2a2f9f(_0x15c0fa);});};AGIVertices[_0x586f('0x10')][_0x586f('0x21')]=function(_0x3d7b00,_0x441c78,_0x339639){this['mailRpc'][_0x586f('0x21')](_0x3d7b00,_0x441c78)['then'](function(){_0x339639(null);})[_0x586f('0x13')](function(_0x37a7ca){_0x339639(_0x37a7ca);});};AGIVertices[_0x586f('0x10')][_0x586f('0x22')]=function(_0x304a5f,_0x3109a3){this[_0x586f('0xe')][_0x586f('0x23')](_0x304a5f)['then'](function(_0x32a272){if(_0x32a272){if(_0x32a272[_0x586f('0x24')]){_0x3109a3(null,[_0x32a272[_0x586f('0x25')]]);}else{_0x3109a3(null,_[_0x586f('0x26')](_0x32a272[_0x586f('0x27')],'interval'));}}else{_0x3109a3(null,![]);}})[_0x586f('0x13')](function(_0x5aa747){_0x3109a3(_0x5aa747);});};AGIVertices[_0x586f('0x10')]['getSoundPath']=function(_0x44ce55){return util[_0x586f('0x28')](_0x586f('0x29'),FILES_PATH,_0x44ce55);};AGIVertices[_0x586f('0x10')][_0x586f('0x2a')]=function(_0x3b7ffc,_0x3169c1,_0x42b622){odbc[_0x586f('0x2b')](_0x3b7ffc,function(_0x3405c5){if(_0x3405c5){logger['error'](_0x586f('0x2c'),_0x3405c5);_0x42b622(_0x3405c5);}else{logger[_0x586f('0x2d')]('ODBC\x20connection\x20successfully');odbc['query'](_0x3169c1,function(_0x46f31b,_0x4ab7fe){if(_0x46f31b){logger['info'](_0x586f('0x2e'),_0x3169c1);_0x42b622(_0x46f31b);}else{logger['info'](_0x586f('0x2f'),_0x3169c1);odbc[_0x586f('0x30')](function(_0x46bd3d){if(_0x46bd3d){logger[_0x586f('0x31')](_0x586f('0x32'),_0x46bd3d);}_0x42b622(null,_0x4ab7fe);});}});}});};AGIVertices[_0x586f('0x10')]['getSmsAccount']=function(_0x242ff8,_0x1ed450){this['rpc'][_0x586f('0x33')](_0x242ff8)['then'](function(_0x3c1ed8){_0x1ed450(null,_0x3c1ed8?_0x3c1ed8:![]);})[_0x586f('0x13')](function(_0x403267){_0x1ed450(_0x403267);});};AGIVertices[_0x586f('0x10')][_0x586f('0x34')]=function(_0x31871e,_0x37b43d){this[_0x586f('0xe')][_0x586f('0x34')](_0x31871e)[_0x586f('0x1a')](function(_0x5bf8fc){_0x37b43d(null,_0x5bf8fc);})['catch'](function(_0x2e9b2d){_0x37b43d(_0x2e9b2d);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x5729cb,_0x2c7bf6,_0x29866f){this[_0x586f('0xe')][_0x586f('0x35')]({'uniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'node':_0x5729cb['label'],'application':_0x5729cb[_0x586f('0x37')],'data':_0x2c7bf6||null,'project_name':this[_0x586f('0xd')][_0x586f('0x38')],'callerid':this[_0x586f('0xd')]['callerid']})[_0x586f('0x1a')](function(_0x1867dd){if(_0x29866f){_0x29866f(null,_0x1867dd);}})['catch'](function(_0x37ec2c){if(_0x29866f){_0x29866f(_0x37ec2c);}});};AGIVertices[_0x586f('0x10')]['createSquareRecording']=function(_0x3ad982,_0x190202,_0x476aee,_0x1b77d2){this[_0x586f('0xe')]['createSquareRecording']({'uniqueid':this[_0x586f('0xd')]['uniqueid'],'callerid':this[_0x586f('0xd')][_0x586f('0x39')],'calleridname':this[_0x586f('0xd')]['calleridname'],'context':this[_0x586f('0xd')][_0x586f('0x3a')],'extension':this[_0x586f('0xd')][_0x586f('0x3b')],'priority':this['channel'][_0x586f('0x3c')],'accountcode':this['channel'][_0x586f('0x3d')],'dnid':this[_0x586f('0xd')][_0x586f('0x3e')],'projectName':this[_0x586f('0xd')]['arg_1'],'saveName':_0x190202,'filename':_0x3ad982[_0x586f('0x3f')]||_0x190202,'savePath':_0x476aee})[_0x586f('0x1a')](function(_0x266fdb){_0x1b77d2(null,_0x266fdb);})[_0x586f('0x13')](function(_0x44dc51){_0x1b77d2(_0x44dc51);});};AGIVertices[_0x586f('0x10')]['createSquareMessage']=function(_0x69f5b5,_0x5b6a8b,_0x23ca93,_0xfac0f6,_0x37b682){this[_0x586f('0xe')][_0x586f('0x40')]({'uniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'body':_0x69f5b5,'direction':_0x5b6a8b,'providerName':_0x23ca93,'providerResponse':_0xfac0f6})[_0x586f('0x1a')](function(_0x3202d9){if(_0x37b682){_0x37b682(null,_0x3202d9);}})[_0x586f('0x13')](function(_0x23f20a){if(_0x37b682){_0x37b682(_0x23f20a);}});};AGIVertices[_0x586f('0x10')]['createCmContact']=function(_0x2e5b00,_0x51d5df){this['rpc'][_0x586f('0x41')]({'firstName':_[_0x586f('0x42')](_0x2e5b00['name'])||_[_0x586f('0x43')](_0x2e5b00[_0x586f('0x17')])?_0x586f('0x44')+Math[_0x586f('0x45')]():_0x2e5b00[_0x586f('0x17')],'lastName':_[_0x586f('0x42')](_0x2e5b00[_0x586f('0x46')])||_['isNil'](_0x2e5b00['lastName'])?null:_0x2e5b00['lastName'],'phone':_0x2e5b00[_0x586f('0x47')],'ListId':_0x2e5b00[_0x586f('0x48')],'scheduledat':_0x2e5b00['scheduledAt'],'callbackUniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x2e5b00['scheduledAt'][_0x586f('0x49')](),'priority':_0x2e5b00[_0x586f('0x4a')]})[_0x586f('0x1a')](function(_0x149137){_0x51d5df(null,_0x149137);})[_0x586f('0x13')](function(_0x418f87){_0x51d5df(_0x418f87);});};AGIVertices[_0x586f('0x10')][_0x586f('0x4b')]=function(_0x838a0e,_0x332614){this[_0x586f('0xe')][_0x586f('0x4c')](_0x838a0e)[_0x586f('0x1a')](function(_0x538f12){_0x332614(null,_0x538f12?_0x538f12[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x2f8a8b){_0x332614(_0x2f8a8b);});};AGIVertices[_0x586f('0x10')][_0x586f('0x4d')]=function(_0x541ad6,_0x180002,_0x35c404){var _0x1995ef={'role':_0x586f('0x4e')};_0x1995ef[_0x541ad6]=this['channel']['callerid'];this[_0x586f('0xe')][_0x586f('0x4d')](_0x1995ef,_0x180002,this[_0x586f('0xd')][_0x586f('0x36')])[_0x586f('0x1a')](function(_0x13660c){_0x35c404(null,_[_0x586f('0x43')](_0x13660c)?![]:!![]);})[_0x586f('0x13')](function(_0x5ecc31){logger[_0x586f('0x31')](_0x5ecc31);_0x35c404(null,![]);});};AGIVertices['prototype'][_0x586f('0x4f')]=function(_0x16d79c,_0x596e0c){var _0xf954b={'role':'agent'};_0xf954b[_0x16d79c]=this[_0x586f('0xd')][_0x586f('0x39')];this[_0x586f('0xe')][_0x586f('0x4f')](_0xf954b)['then'](function(_0x1735c0){_0x596e0c(null,_[_0x586f('0x43')](_0x1735c0)?![]:!![]);})[_0x586f('0x13')](function(_0x13843b){logger[_0x586f('0x31')](_0x13843b);_0x596e0c(null,![]);});};AGIVertices[_0x586f('0x10')]['agentLogout']=function(_0x3f74eb,_0x9643f0){var _0x17e793={'role':_0x586f('0x4e')};_0x17e793[_0x3f74eb]=this['channel'][_0x586f('0x39')];this[_0x586f('0xe')]['agentLogout'](_0x17e793)[_0x586f('0x1a')](function(_0x50dc83){_0x9643f0(null,_[_0x586f('0x43')](_0x50dc83)?![]:!![]);})[_0x586f('0x13')](function(_0x5265ea){logger['error'](_0x5265ea);_0x9643f0(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1ae8b6,_0x411105){var _0xace017={'role':'agent'};_0xace017[_0x1ae8b6]=this[_0x586f('0xd')][_0x586f('0x39')];var _0x3d6df9=_0x1ae8b6!=_0x586f('0x50')?util[_0x586f('0x28')](_0x586f('0x51'),'LOCAL',this[_0x586f('0xd')]['callerid']):undefined;this[_0x586f('0xe')]['agentLogin'](_0xace017,_0x3d6df9)[_0x586f('0x1a')](function(_0xd05078){_0x411105(null,_[_0x586f('0x43')](_0xd05078)?![]:!![]);})[_0x586f('0x13')](function(_0x388287){logger[_0x586f('0x31')](_0x388287);_0x411105(null,![]);});};AGIVertices[_0x586f('0x10')][_0x586f('0x52')]=function(_0x48093f,_0x1e8d18){sh[_0x586f('0x53')](_[_0x586f('0x54')](_0x48093f),function(_0x4c184c,_0x15703b){var _0x1483f6=_0x15703b['replace'](/(\r\n|\n|\r)/gm,'');_0x1e8d18(null,_0x1483f6);});};AGIVertices[_0x586f('0x10')]['googleCloudTTS']=function(_0x3d240,_0x4769da){scripts[_0x586f('0x55')](_0x3d240[_0x586f('0x56')],_0x3d240[_0x586f('0x57')]||_0x586f('0x58'),_0x3d240[_0x586f('0x58')],_0x3d240[_0x586f('0x59')]||_0x586f('0x5a'),_0x3d240[_0x586f('0x5b')]||_0x586f('0x5c'),_0x3d240[_0x586f('0x5d')]||'MP3')[_0x586f('0x1a')](function(_0x299d4e){_0x4769da(null,_0x299d4e);})[_0x586f('0x13')](function(_0x38afc3){_0x4769da(_0x38afc3);});};AGIVertices[_0x586f('0x10')]['googleTTS']=function(_0x29399f,_0x5a8d1b){scripts[_0x586f('0x5e')](_0x29399f[_0x586f('0x58')],_0x29399f[_0x586f('0x5f')]||'en',0x1)[_0x586f('0x1a')](function(_0x3bf38c){_0x5a8d1b(null,_0x3bf38c);})[_0x586f('0x13')](function(_0x5030c0){_0x5a8d1b(_0x5030c0);});};AGIVertices['prototype'][_0x586f('0x60')]=function(_0x193f98,_0x3e5ed5){var _0x1b73e0={'uri':_0x193f98[_0x586f('0x61')],'method':_0x193f98[_0x586f('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x193f98[_0x586f('0x63')])===_0x586f('0x64')&&parseInt(_0x193f98[_0x586f('0x63')])>=0x1?parseInt(_0x193f98[_0x586f('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x586f('0x65')]([_0x586f('0x66'),_0x586f('0x67')],_0x1b73e0[_0x586f('0x62')][_0x586f('0x68')]())){try{_0x1b73e0['body']=_0x193f98[_0x586f('0xa')]?JSON[_0x586f('0x69')](_0x193f98['rawBody']):{};}catch(_0x44da4a){logger[_0x586f('0x31')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x44da4a);}}try{_0x1b73e0['headers']=_0x193f98[_0x586f('0x6a')]?JSON[_0x586f('0x69')](_0x193f98[_0x586f('0x6a')]):{};}catch(_0x23c942){logger['error'](_0x586f('0x6b'),_0x23c942);}if(_0x193f98['computedVariables']){try{var _0x1a1c20=require(_0x193f98[_0x586f('0x6c')])[_0x586f('0x6d')](this,_0x1b73e0);_0x1b73e0['uri']=Mustache['render'](_0x193f98[_0x586f('0x61')],_0x1a1c20,{},['$$','$$']);if(_0x1b73e0[_0x586f('0x6e')]){_0x1b73e0[_0x586f('0x6e')]=JSON[_0x586f('0x69')](Mustache[_0x586f('0x6f')](JSON[_0x586f('0x70')](_0x1b73e0['headers']),_0x1a1c20,{},['$$','$$']));}if(_0x1b73e0[_0x586f('0x71')]){_0x1b73e0[_0x586f('0x71')]=JSON[_0x586f('0x69')](Mustache['render'](JSON['stringify'](_0x1b73e0[_0x586f('0x71')]),_0x1a1c20,{},['$$','$$']));}}catch(_0x1fc5b6){logger['error'](_0x586f('0x72'),_0x1fc5b6);}}rp(_0x1b73e0)['then'](function(_0x57e745){var _0x4e2637={'statusCode':_0x57e745['statusCode']||0xc8,'statusMessage':_0x57e745[_0x586f('0x73')]||'OK','headers':_0x57e745[_0x586f('0x6e')]||{},'body':_0x57e745[_0x586f('0x71')]||{}};_0x3e5ed5(null,_0x4e2637);})[_0x586f('0x13')](function(_0x253d69){var _0x5302d5={'statusCode':_0x253d69[_0x586f('0x74')]||0x1f4,'statusMessage':_0x253d69[_0x586f('0x75')]||_0x586f('0x76'),'headers':_0x253d69['options'][_0x586f('0x6e')]||{},'body':_0x253d69[_0x586f('0x77')][_0x586f('0x71')]||{}};_0x3e5ed5(null,_0x5302d5);});};AGIVertices[_0x586f('0x10')]['googleDialogflow']=function(_0x27600f,_0x49077b){scripts[_0x586f('0x78')](this[_0x586f('0xd')][_0x586f('0x36')],_0x27600f[_0x586f('0x79')],_0x27600f[_0x586f('0x58')],_0x27600f[_0x586f('0x7a')]||'en')[_0x586f('0x1a')](function(_0x176535){_0x49077b(null,_0x176535);})[_0x586f('0x13')](function(_0x221558){_0x49077b(_0x221558);});};AGIVertices[_0x586f('0x10')][_0x586f('0x7b')]=function(_0x28c215,_0x4a19e7){scripts[_0x586f('0x7b')](this[_0x586f('0xd')]['uniqueid'],_0x28c215[_0x586f('0x7c')],_0x28c215[_0x586f('0x7d')],_0x28c215['private_key'],_0x28c215[_0x586f('0x58')],_0x28c215[_0x586f('0x7e')]||'en')[_0x586f('0x1a')](function(_0x6a0a0d){_0x4a19e7(null,_0x6a0a0d);})[_0x586f('0x13')](function(_0x2dd076){_0x4a19e7(_0x2dd076);});};AGIVertices[_0x586f('0x10')][_0x586f('0x7f')]=function(_0x19dab4,_0x14c4c2){scripts[_0x586f('0x7f')](this[_0x586f('0xd')],_0x19dab4)['then'](function(_0x243b1f){_0x14c4c2(null,_0x243b1f);})[_0x586f('0x13')](function(_0x5a227a){_0x14c4c2(_0x5a227a);});};AGIVertices[_0x586f('0x10')][_0x586f('0x80')]=function(_0x535863,_0x1497eb){scripts[_0x586f('0x80')](_0x535863[_0x586f('0x79')],_0x535863['text'],_0x535863[_0x586f('0x81')]||_0x586f('0x5a'),_0x535863[_0x586f('0x82')])[_0x586f('0x1a')](function(_0xef1353){_0x1497eb(null,_0xef1353);})['catch'](function(_0x4945fa){_0x1497eb(_0x4945fa);});};AGIVertices[_0x586f('0x10')]['ispeechASR']=function(_0x4f6307,_0x4e9f1d,_0x45e45a){scripts[_0x586f('0x83')](_0x4e9f1d,_0x4f6307['key'],_0x4f6307[_0x586f('0x84')]||_0x586f('0x5a'),this[_0x586f('0x85')](_0x4f6307[_0x586f('0x86')])?_0x4f6307[_0x586f('0x86')]:undefined)[_0x586f('0x1a')](function(_0x1d9f9a){_0x45e45a(null,_0x1d9f9a);})[_0x586f('0x13')](function(_0x4e1a76){_0x45e45a(_0x4e1a76);});};AGIVertices[_0x586f('0x10')]['awsPolly']=function(_0x1df4f6,_0x31d9b8){scripts[_0x586f('0x87')](_0x1df4f6['aws_access_key_id'],_0x1df4f6[_0x586f('0x88')],_0x1df4f6[_0x586f('0x89')],_0x1df4f6[_0x586f('0x8a')]||'Amy',_0x1df4f6[_0x586f('0x58')],_0x1df4f6[_0x586f('0x8b')]||'text')[_0x586f('0x1a')](function(_0xe06283){_0x31d9b8(null,_0xe06283);})[_0x586f('0x13')](function(_0x3a0c1e){_0x31d9b8(_0x3a0c1e);});};AGIVertices['prototype'][_0x586f('0x8c')]=function(_0x23d209,_0x21641c){scripts[_0x586f('0x8c')](this['channel'][_0x586f('0x36')],_0x23d209[_0x586f('0x8d')],_0x23d209[_0x586f('0x88')],_0x23d209[_0x586f('0x8e')],_0x23d209[_0x586f('0x58')],_0x23d209[_0x586f('0x8f')])[_0x586f('0x1a')](function(_0x66bf15){_0x21641c(null,_0x66bf15);})[_0x586f('0x13')](function(_0x720e31){_0x21641c(_0x720e31);});};AGIVertices['prototype'][_0x586f('0x90')]=function(_0x31362d,_0x3fba4e,_0x55f4b0){scripts[_0x586f('0x90')](_0x3fba4e,_0x31362d[_0x586f('0x79')],_0x31362d[_0x586f('0x91')]||'en-US')[_0x586f('0x1a')](function(_0x49edac){_0x55f4b0(null,_0x49edac);})['catch'](function(_0x188e2b){_0x55f4b0(_0x188e2b);});};AGIVertices[_0x586f('0x10')][_0x586f('0x92')]=function(_0x216c61,_0x2eb509,_0x5c1cb1){scripts[_0x586f('0x92')](_0x2eb509,_0x216c61[_0x586f('0x93')],_0x216c61[_0x586f('0x94')],_0x216c61[_0x586f('0x95')])[_0x586f('0x1a')](function(_0x8870c1){_0x5c1cb1(null,_0x8870c1);})[_0x586f('0x13')](function(_0x3a6bc7){_0x5c1cb1(_0x3a6bc7);});};AGIVertices[_0x586f('0x10')]['clear']=function(_0xcd1d89){var _0x45b897=_[_0x586f('0x65')](verticesWithRetry,_0xcd1d89['agicommand'])?_0xcd1d89:_[_0x586f('0x96')](_0xcd1d89);for(var _0x17ffc1 in _0x45b897){if(_0x45b897['hasOwnProperty'](_0x17ffc1)){if(_0x45b897[_0x17ffc1]&&_['isString'](_0x45b897[_0x17ffc1])){if(_[_0x586f('0x65')](recursiveMapAttributes,_0x17ffc1)){_0x45b897[_0x17ffc1]=this[_0x586f('0x97')](_0x45b897[_0x17ffc1]);}else{_0x45b897[_0x17ffc1]=this[_0x586f('0x98')](_0x45b897[_0x17ffc1]);}}}}return _0x45b897;};AGIVertices['prototype'][_0x586f('0x99')]=function(_0x1f6a25){for(var _0x996245 in _0x1f6a25){if(_0x1f6a25[_0x586f('0x9a')](_0x996245)){if(_['isPlainObject'](_0x1f6a25[_0x996245])){this[_0x586f('0x99')](_0x1f6a25[_0x996245]);}else if(_[_0x586f('0x9b')](_0x1f6a25[_0x996245])){for(var _0x26687d=0x0;_0x26687d<_0x1f6a25[_0x996245]['length'];_0x26687d++){this[_0x586f('0x99')](_0x1f6a25[_0x996245][_0x26687d]);}}else if(_[_0x586f('0x9c')](_0x1f6a25[_0x996245])){_0x1f6a25[_0x996245]=this['replaceAllVariables'](_0x1f6a25[_0x996245]);}}}};AGIVertices[_0x586f('0x10')][_0x586f('0x9d')]=function(_0x1e182e,_0x3700e2){for(var _0x5060bc in _0x1e182e){if(_0x1e182e[_0x586f('0x9a')](_0x5060bc)){if(_['isPlainObject'](_0x1e182e[_0x5060bc])){if(!_['isEmpty'](_0x1e182e[_0x5060bc])){this[_0x586f('0x9d')](_0x1e182e[_0x5060bc],util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc));}}else if(_[_0x586f('0x9b')](_0x1e182e[_0x5060bc])){for(var _0x2aea52=0x0;_0x2aea52<_0x1e182e[_0x5060bc]['length'];_0x2aea52++){this[_0x586f('0x9d')](_0x1e182e[_0x5060bc][_0x2aea52],util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc+'['+_0x2aea52+']'));}}else{if(!_[_0x586f('0x43')](_0x1e182e[_0x5060bc])){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc),_0x1e182e[_0x5060bc]);}}}}};AGIVertices[_0x586f('0x10')][_0x586f('0x97')]=function(_0x21073a){try{var _0x26602e=JSON[_0x586f('0x69')](_0x21073a);this['recursiveNodeIndex'](_0x26602e);return JSON[_0x586f('0x70')](_0x26602e);}catch(_0x1ee6af){return this['replaceAllVariables'](_0x21073a);}};AGIVertices[_0x586f('0x10')][_0x586f('0x98')]=function(_0x137f69){var _0x5d8b4a=_0x137f69[_0x586f('0x9f')]('{');for(var _0x3e6c24=0x1;_0x3e6c24<_0x5d8b4a[_0x586f('0xa0')];_0x3e6c24+=0x1){var _0x50d96a=_0x5d8b4a[_0x3e6c24]['split']('}');if(_0x50d96a['length']>0x1){_0x137f69=_0x137f69[_0x586f('0xa1')]('{'+_0x50d96a[0x0]+'}',this[_0x586f('0xd')]['getVariable'](_0x50d96a[0x0])['extra']||_0x50d96a[0x0]);}}if(_0x5d8b4a[_0x586f('0xa0')]===0x1){return _0x137f69[_0x586f('0x49')]();}return this['replaceAllVariables'](_0x137f69);};AGIVertices[_0x586f('0x10')][_0x586f('0xa2')]=function(_0x33a760,_0x95a56d){var _0x3ccd0f=this['channel'][_0x586f('0x11')](_0x33a760);if(_0x3ccd0f[_0x586f('0xa3')]===-0x1){return _0x3ccd0f;}logger[_0x586f('0x2d')](util['format'](_0x586f('0xa4'),_0x95a56d,_0x3ccd0f[_0x586f('0xa5')]));return this[_0x586f('0xd')][_0x586f('0x9e')](_0x95a56d,_0x3ccd0f['extra']);};AGIVertices[_0x586f('0x10')][_0x586f('0x85')]=function(_0x671fec){return _0x671fec&&_0x671fec!=='0'&&_0x671fec!=='-1'&&_0x671fec!=='';};AGIVertices[_0x586f('0x10')][_0x586f('0xa6')]=function(_0x9931d4){this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x9931d4,'-');_0x9931d4['retry']=_0x9931d4['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x586f('0x10')]['mrcpsynth']=function(_0x46b625){logger[_0x586f('0x2d')](util['format'](_0x586f('0xa7'),_0x46b625[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x46b625[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}var _0x5ce7fc='\x22'+_0x46b625[_0x586f('0x58')]+'\x22';if(this[_0x586f('0x85')](_0x46b625[_0x586f('0x77')])){_0x5ce7fc+=','+_0x46b625[_0x586f('0x77')];}var _0x3fd684=this['channel'][_0x586f('0x53')](_0x586f('0xaa'),_0x5ce7fc);if(_0x3fd684[_0x586f('0xa3')]===-0x1){return _0x3fd684;}return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xab'),_0x5ce7fc));};AGIVertices['prototype'][_0x586f('0xac')]=function(_0x3bf90e){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xad'),_0x3bf90e[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3bf90e[_0x586f('0xae')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20grammar\x20configured');}var _0x53eca2=_0x3bf90e[_0x586f('0xae')];if(this[_0x586f('0x85')](_0x3bf90e[_0x586f('0x77')])){_0x53eca2+=','+_0x3bf90e['options'];}var _0x5e9d62=this[_0x586f('0xd')]['exec']('MRCPRecog',_0x53eca2);if(_0x5e9d62[_0x586f('0xa3')]===-0x1){return _0x5e9d62;}var _0x9f664a=this[_0x586f('0xa2')](_0x586f('0xaf'),_0x586f('0xb0'));if(_0x9f664a[_0x586f('0xa3')]===-0x1){return _0x9f664a;}var _0x2b5137=this['getAndSetVariable'](_0x586f('0xb1'),_0x586f('0xb2'));if(_0x2b5137['result']===-0x1){return _0x2b5137;}var _0xc9d89c=this[_0x586f('0xa2')](_0x586f('0xb3'),'MRCP_RECOG_INSTANCE');if(_0xc9d89c['result']===-0x1){return _0xc9d89c;}return this[_0x586f('0xd')]['noop'](util['format'](_0x586f('0xb4'),_0x53eca2));};AGIVertices['prototype'][_0x586f('0xb5')]=function(_0x4a1f17){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xb6'),_0x4a1f17[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0xb5')]([_0x4a1f17['command'],_0x4a1f17[_0x586f('0xb7')]]);};AGIVertices[_0x586f('0x10')][_0x586f('0xb8')]=function(_0x103daa){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x103daa[_0x586f('0xa8')]));if(this['isConfigured'](_0x103daa[_0x586f('0x63')])){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x103daa[_0x586f('0x63')]));var _0x53e4c5=this[_0x586f('0xd')][_0x586f('0xb9')](_0x103daa[_0x586f('0x63')]);if(_0x53e4c5[_0x586f('0xa3')]===-0x1){return _0x53e4c5;}}return this[_0x586f('0xd')][_0x586f('0xb8')]();};AGIVertices[_0x586f('0x10')]['callback']=function(_0x4326dc){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4326dc[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x4326dc[_0x586f('0x48')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4326dc,_0x586f('0xba'));}_0x4326dc[_0x586f('0xbb')]=moment();if(this[_0x586f('0x85')](_0x4326dc['delay'])){_0x4326dc[_0x586f('0xbb')]=moment()[_0x586f('0xbc')](_0x4326dc[_0x586f('0xbd')],'minutes');}if(!this[_0x586f('0x85')](_0x4326dc[_0x586f('0x4a')])){_0x4326dc[_0x586f('0x4a')]=0x2;}this['createCmContact'][_0x586f('0x6d')](this,_0x4326dc);return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xbe'),_0x4326dc[_0x586f('0x47')],_0x4326dc[_0x586f('0x48')],_0x4326dc[_0x586f('0xbb')]));};AGIVertices[_0x586f('0x10')][_0x586f('0xbf')]=function(_0x220825){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xc0'),_0x220825[_0x586f('0xa8')]));var _0x503f40=this['channel'][_0x586f('0x53')](_0x220825[_0x586f('0xc1')],_0x220825[_0x586f('0x77')]);if(_0x503f40['result']===-0x1){return _0x503f40;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xc2'),_0x220825['application'],_0x220825[_0x586f('0x77')]));};AGIVertices[_0x586f('0x10')][_0x586f('0xc3')]=function(_0x5f3709){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xc4'),_0x5f3709[_0x586f('0xa8')]));if(!this['isConfigured'](_0x5f3709[_0x586f('0x58')])){return this[_0x586f('0xd')]['noop'](_0x586f('0xc5'));}var _0x5a3a84='\x22'+_0x5f3709[_0x586f('0x58')]+'\x22';if(this[_0x586f('0x85')](_0x5f3709[_0x586f('0x77')])){_0x5a3a84+=','+_0x5f3709['options'];}var _0x5909dc=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xaa'),_0x5a3a84);if(_0x5909dc[_0x586f('0xa3')]===-0x1){return _0x5909dc;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5a3a84));};AGIVertices[_0x586f('0x10')]['sestektts']=function(_0x1db7de){logger[_0x586f('0x2d')](util['format'](_0x586f('0xc6'),_0x1db7de['label']));if(!this['isConfigured'](_0x1db7de[_0x586f('0x58')])){return this['channel']['noop'](_0x586f('0xc5'));}var _0x424ac4='\x22'+_0x1db7de['text']+'\x22';if(this['isConfigured'](_0x1db7de['options'])){_0x424ac4+=','+_0x1db7de['options'];}var _0x10f187=this[_0x586f('0xd')]['exec'](_0x586f('0xaa'),_0x424ac4);if(_0x10f187[_0x586f('0xa3')]===-0x1){return _0x10f187;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xab'),_0x424ac4));};AGIVertices[_0x586f('0x10')][_0x586f('0xc7')]=function(_0x38f72d){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x38f72d[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x38f72d[_0x586f('0xae')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc8'));}var _0x182bd4=_0x38f72d[_0x586f('0xae')];if(this['isConfigured'](_0x38f72d[_0x586f('0x77')])){_0x182bd4+=','+_0x38f72d[_0x586f('0x77')];}var _0xf4b5e0=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xc9'),_0x182bd4);if(_0xf4b5e0['result']===-0x1){return _0xf4b5e0;}var _0x3733c5=this['getAndSetVariable'](_0x586f('0xaf'),_0x586f('0xca'));if(_0x3733c5['result']===-0x1){return _0x3733c5;}var _0x6915f5=this['getAndSetVariable'](_0x586f('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x6915f5['result']===-0x1){return _0x6915f5;}var _0x4ae1d6=this['getAndSetVariable'](_0x586f('0xb3'),_0x586f('0xcb'));if(_0x4ae1d6['result']===-0x1){return _0x4ae1d6;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xb4'),_0x182bd4));};AGIVertices[_0x586f('0x10')][_0x586f('0xcc')]=function(_0x171912){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xcd'),_0x171912['label']));if(!this[_0x586f('0x85')](_0x171912['grammar'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc8'));}var _0x2c5196=_0x171912[_0x586f('0xae')];if(this[_0x586f('0x85')](_0x171912[_0x586f('0x77')])){_0x2c5196+=','+_0x171912[_0x586f('0x77')];}var _0x2caf64=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xc9'),_0x2c5196);if(_0x2caf64[_0x586f('0xa3')]===-0x1){return _0x2caf64;}var _0x564713=this[_0x586f('0xa2')](_0x586f('0xaf'),_0x586f('0xce'));if(_0x564713[_0x586f('0xa3')]===-0x1){return _0x564713;}var _0x1818f1=this[_0x586f('0xa2')](_0x586f('0xb1'),_0x586f('0xcf'));if(_0x1818f1['result']===-0x1){return _0x1818f1;}var _0x469323=this[_0x586f('0xa2')](_0x586f('0xb3'),_0x586f('0xd0'));if(_0x469323['result']===-0x1){return _0x469323;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xb4'),_0x2c5196));};AGIVertices[_0x586f('0x10')]['database']=function(_0x235a73){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xd1'),_0x235a73[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x235a73['odbc_id'])){return this['channel'][_0x586f('0x31')](_0x235a73,_0x586f('0xd2'));}var _0x49bf5a=this['getSquareOdbc'][_0x586f('0x6d')](this,_0x235a73[_0x586f('0xd3')]);if(!_0x49bf5a){return this[_0x586f('0xd')][_0x586f('0x31')](_0x235a73,_0x586f('0xd4'));}if(!this[_0x586f('0x85')](_0x235a73[_0x586f('0xd5')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x235a73,_0x586f('0xd6'));}var _0x4da907=_0x235a73['query'][_0x586f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xd8'),_0x4da907));var _0x3f4073=this[_0x586f('0x2a')][_0x586f('0x6d')](this,_0x49bf5a,_0x4da907);this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x235a73,_0x4da907);if(!this[_0x586f('0x85')](_0x235a73[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xda'));}var _0x51c3e0=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x235a73['variable_id']);if(!_0x51c3e0){return this['channel'][_0x586f('0x31')](_0x235a73,_0x586f('0xdb'));}var _0x3fdaae=this;_0x3f4073[_0x586f('0xdc')](function(_0x537f9b,_0x5eb7ff){Object[_0x586f('0xdd')](_0x537f9b)[_0x586f('0xdc')](function(_0x1fe270){_0x3fdaae[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0xde'),_0x51c3e0,_0x5eb7ff,_0x1fe270),_0x537f9b[_0x1fe270]);});});this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0xdf'),_0x51c3e0),_0x3f4073['length']);return this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0xe0'),_0x51c3e0));};AGIVertices[_0x586f('0x10')][_0x586f('0xe1')]=function(_0x2467de){logger[_0x586f('0xe2')](util[_0x586f('0x28')](_0x586f('0xe3'),_0x2467de[_0x586f('0xa8')]));if(!this['isConfigured'](_0x2467de[_0x586f('0xe4')])){return this['channel'][_0x586f('0x31')](_0x2467de,_0x586f('0xe5'));}var _0x5528cd=this[_0x586f('0x1c')][_0x586f('0x6d')](this,_0x2467de[_0x586f('0xe4')]);if(!_0x5528cd){return this[_0x586f('0xd')][_0x586f('0x31')](_0x2467de,_0x586f('0xe6'));}var _0x2a9374=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xe7'),[util[_0x586f('0x28')](_0x586f('0xe8'),_0x5528cd),_0x2467de[_0x586f('0x63')],_0x2467de[_0x586f('0xe9')],_0x2467de[_0x586f('0x61')]]);if(_0x2a9374[_0x586f('0xa3')]===-0x1){return _0x2a9374;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Executed\x20command\x20%s',_0x586f('0xe7')));};AGIVertices['prototype'][_0x586f('0xea')]=function(_0xe9d49f){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xeb'),_0xe9d49f[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0xe9d49f[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xec'));}if(!this[_0x586f('0x85')](_0xe9d49f['text'])){return this['channel'][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xed')]=!![];this[_0x586f('0x35')](_0xe9d49f);this['createSquareMessage'](_0xe9d49f[_0x586f('0x58')],'in','','');this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('Trying\x20Dialogflow:\x20%s',_0xe9d49f[_0x586f('0x58')]));var _0x2129e3=this[_0x586f('0x78')][_0x586f('0x6d')](this,_0xe9d49f);if(_0x2129e3){for(var _0x5732d4 in _0x2129e3){if(_0x2129e3[_0x586f('0x9a')](_0x5732d4)){this[_0x586f('0xd')][_0x586f('0x9e')](util['format'](_0x586f('0xee'),_0x5732d4['toUpperCase']()),_0x2129e3[_0x5732d4]);}}this['createSquareMessage'](_0x2129e3[_0x586f('0xef')],_0x586f('0xf0'),_0x586f('0xea'),'');return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')]('Dialogflow\x20Result\x20%s',_0x2129e3['speech']));}return this[_0x586f('0xd')]['error'](_0xe9d49f,_0x586f('0xf1'));};AGIVertices[_0x586f('0x10')][_0x586f('0xf2')]=function(_0x485467){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xf3'),_0x485467['label']));if(!this[_0x586f('0x85')](_0x485467[_0x586f('0x7c')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf4'));}if(!this[_0x586f('0x85')](_0x485467['client_email'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf5'));}if(!this[_0x586f('0x85')](_0x485467[_0x586f('0xf6')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf7'));}if(!this[_0x586f('0x85')](_0x485467['dialogflowV2_language'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf8'));}if(!this[_0x586f('0x85')](_0x485467[_0x586f('0x58')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20text\x20configured');}this['channel'][_0x586f('0xed')]=!![];this['createSquareDetailsReport'](_0x485467);this[_0x586f('0x40')](_0x485467[_0x586f('0x58')],'in','','');this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xf9'),_0x485467[_0x586f('0x58')]));var _0x299aa6=this[_0x586f('0x7b')][_0x586f('0x6d')](this,_0x485467);if(_0x299aa6){for(var _0x535f54 in _0x299aa6){if(_0x299aa6['hasOwnProperty'](_0x535f54)){if(_0x535f54!==_0x586f('0xfa')){this[_0x586f('0xd')][_0x586f('0x9e')](util['format'](_0x586f('0xee'),_0x535f54[_0x586f('0x68')]()),_0x299aa6[_0x535f54]);}}}this[_0x586f('0x40')](_0x299aa6[_0x586f('0xef')],_0x586f('0xf0'),_0x586f('0xf2'),_0x299aa6['providerResponse']);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xfb'),_0x299aa6[_0x586f('0xef')]));}return this[_0x586f('0xd')][_0x586f('0x31')](_0x485467,_0x586f('0xfc'));};AGIVertices[_0x586f('0x10')][_0x586f('0xfd')]=function(_0x24327e){logger['info'](util[_0x586f('0x28')](_0x586f('0xfe'),_0x24327e[_0x586f('0xa8')]));if(!this['isConfigured'](_0x24327e['ndauth_url'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xff'));}if(!this['isConfigured'](_0x24327e['username'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x100'));}if(!this['isConfigured'](_0x24327e['password'])){return this['channel'][_0x586f('0xa9')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x24327e[_0x586f('0x101')])){return this[_0x586f('0xd')]['noop'](_0x586f('0xc5'));}this['channel'][_0x586f('0xed')]=!![];this[_0x586f('0x35')](_0x24327e);this[_0x586f('0x40')](_0x24327e[_0x586f('0x58')],'in','','');this['channel']['noop'](util[_0x586f('0x28')](_0x586f('0x102'),_0x24327e[_0x586f('0x58')]));var _0x16f5cc=this[_0x586f('0x7f')]['sync'](this,_0x24327e);if(_0x16f5cc){for(var _0x10ffcf in _0x16f5cc){if(_0x16f5cc[_0x586f('0x9a')](_0x10ffcf)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x103'),_0x10ffcf['toUpperCase']()),_0x16f5cc[_0x10ffcf]);}}this[_0x586f('0x40')](_0x16f5cc['speech'],'out','sesteknda','');if(_0x16f5cc[_0x586f('0x104')]){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x16f5cc[_0x586f('0x104')]));var _0x2039dc=this[_0x586f('0xd')][_0x586f('0x105')](_0x16f5cc[_0x586f('0x104')]);try{fs['unlink'](_0x16f5cc[_0x586f('0x104')]+'.wav');}catch(_0x178547){logger[_0x586f('0x31')](_0x178547);}return _0x2039dc;}else{return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('SestekNDA\x20Result\x20%s',_0x16f5cc[_0x586f('0xef')]));}}return this[_0x586f('0xd')][_0x586f('0x31')](_0x24327e,_0x586f('0x106'));};AGIVertices[_0x586f('0x10')][_0x586f('0x107')]=function(_0x527107){logger[_0x586f('0x2d')](util['format'](_0x586f('0x108'),_0x527107[_0x586f('0xa8')]));return this[_0x586f('0xd')]['noop'](_0x586f('0x107'));};AGIVertices[_0x586f('0x10')][_0x586f('0x109')]=function(_0x12519d){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x10a'),_0x12519d[_0x586f('0xa8')]));var _0x34c653='';if(_0x12519d[_0x586f('0x10b')]){if(!this['isConfigured'](_0x12519d[_0x586f('0x10b')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x12519d,_0x586f('0x10c'));}else{var _0x1cb276=parseInt(_0x12519d[_0x586f('0x10b')],0xa);if(isNaN(_0x1cb276)){_0x34c653=_0x12519d[_0x586f('0x10b')];}else{_0x34c653=this[_0x586f('0x1e')]['sync'](this,_0x12519d['trunk_id']);if(!_0x34c653){return this[_0x586f('0xd')]['error'](_0x12519d,_0x586f('0x10d'));}}}}else if(_0x12519d[_0x586f('0x10e')]){_0x34c653=_0x12519d[_0x586f('0x10e')];}else{return this[_0x586f('0xd')][_0x586f('0x31')](_0x12519d,_0x586f('0x10c'));}var _0x2513e2=this['channel'][_0x586f('0x53')]('DIAL',[util[_0x586f('0x28')](_0x586f('0x10f'),_0x34c653,_0x12519d[_0x586f('0x47')]),_0x12519d[_0x586f('0x63')],_0x12519d['opts'],_0x12519d['url']]);if(_0x2513e2[_0x586f('0xa3')]===-0x1){return _0x2513e2;}return this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x110'),'DIAL'));};AGIVertices['prototype'][_0x586f('0x111')]=function(_0x34de82){logger['info'](util[_0x586f('0x28')](_0x586f('0x112'),_0x34de82['label']));return this['channel'][_0x586f('0xa9')](_0x586f('0x111'));};AGIVertices[_0x586f('0x10')][_0x586f('0xc')]=function(_0x158c62){logger[_0x586f('0x2d')](util['format'](_0x586f('0x113'),_0x158c62[_0x586f('0xa8')]));if(_0x158c62[_0x586f('0x114')]===0x0){return this[_0x586f('0xa6')](_0x158c62);}_0x158c62[_0x586f('0x114')]-=0x1;if(!this[_0x586f('0x85')](_0x158c62['file_id'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x158c62,_0x586f('0x115'));}var _0x266170=this['getSound'][_0x586f('0x6d')](this,_0x158c62[_0x586f('0x116')]);if(!_0x266170){return this[_0x586f('0xd')]['error'](_0x158c62,_0x586f('0x117'));}if(!this[_0x586f('0x85')](_0x158c62[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x586f('0xda'));}var _0x163ebf=this[_0x586f('0xd')][_0x586f('0x118')](_0x266170,_0x158c62[_0x586f('0x119')],_0x158c62[_0x586f('0x11a')]);var _0x41636e=_0x163ebf['result']?_0x163ebf[_0x586f('0xa3')][_0x586f('0x49')]():'';logger[_0x586f('0x2d')]('test',JSON[_0x586f('0x70')](_0x163ebf));if(_0x163ebf[_0x586f('0xa3')]===-0x1){this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,_0x41636e);return _0x163ebf;}else if(_0x163ebf[_0x586f('0xa5')]===_0x586f('0x63')){_0x163ebf[_0x586f('0xa3')]=_0x41636e[_0x586f('0xa0')]>=parseInt(_0x158c62['mindigit'])?'x':'i';}else{_0x163ebf[_0x586f('0xa3')]=_0x41636e['length']>=parseInt(_0x158c62[_0x586f('0x11b')])&&_0x41636e[_0x586f('0xa0')]<=parseInt(_0x158c62[_0x586f('0x11a')])?'x':'i';}var _0x3dc1d0=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x158c62[_0x586f('0xd9')]);if(!_0x3dc1d0){return this['channel']['error'](_0x158c62,'no\x20variable\x20found');}this['channel'][_0x586f('0x9e')](_0x3dc1d0,_0x41636e);if(this[_0x586f('0x85')](_0x158c62['hiddendigitsnum'])){var _0x10f1df=parseInt(_0x158c62[_0x586f('0x11c')],0xa);var _0x324311=rs[_0x586f('0x11d')]({'charset':'*','length':_0x10f1df});var _0x3d9c07=_0x41636e[_0x586f('0xa0')];if(_0x3d9c07>0x0){if(_0x3d9c07>_0x10f1df){this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,_0x158c62[_0x586f('0x11e')]===_0x586f('0x11f')?_0x324311+_0x41636e[_0x586f('0x120')](_0x10f1df):_0x41636e['substr'](0x0,_0x3d9c07-_0x10f1df)+_0x324311);}else{this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x158c62,rs['generate']({'charset':'*','length':_0x3d9c07}));}}else{this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,'');}}else{this[_0x586f('0x35')]['sync'](this,_0x158c62,_0x41636e);}return _0x163ebf;};AGIVertices['prototype'][_0x586f('0x121')]=function(_0x1936e8){logger['info'](util[_0x586f('0x28')](_0x586f('0x122'),_0x1936e8[_0x586f('0xa8')]));return this[_0x586f('0xc')](_0x1936e8);};AGIVertices['prototype'][_0x586f('0x123')]=function(_0xcddf1b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x124'),_0xcddf1b[_0x586f('0xa8')]));this['createSquareDetailsReport']['sync'](this,_0xcddf1b,_0xcddf1b[_0x586f('0x125')]);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x126'),_0xcddf1b[_0x586f('0x125')]));};AGIVertices['prototype'][_0x586f('0x127')]=function(_0x26dd61){logger[_0x586f('0x2d')](util['format'](_0x586f('0x128'),_0x26dd61[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x26dd61['aws_access_key_id'])||!this[_0x586f('0x85')](_0x26dd61[_0x586f('0x88')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x129'));}if(!this[_0x586f('0x85')](_0x26dd61[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x12a'),_0x26dd61[_0x586f('0x58')]));var _0x1e1b76=this[_0x586f('0x87')][_0x586f('0x6d')](this,_0x26dd61);if(_0x1e1b76){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x12b'),_0x1e1b76));var _0x5b3cdb=this[_0x586f('0xd')]['streamFile'](_0x1e1b76);try{fs[_0x586f('0x12c')](_0x1e1b76+_0x586f('0x12d'));}catch(_0x1df11f){logger['error'](_0x1df11f);}return _0x5b3cdb;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x26dd61,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x586f('0x10')]['awslex']=function(_0xdedead){logger['info'](util[_0x586f('0x28')](_0x586f('0x12e'),_0xdedead['label']));if(!this[_0x586f('0x85')](_0xdedead[_0x586f('0x8d')])||!this[_0x586f('0x85')](_0xdedead[_0x586f('0x88')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x129'));}if(!this[_0x586f('0x85')](_0xdedead['aws_bot_name'])){return this[_0x586f('0xd')]['noop'](_0x586f('0x12f'));}if(!this['isConfigured'](_0xdedead[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xed')]=!![];this['createSquareDetailsReport'](_0xdedead);this['createSquareMessage'](_0xdedead['text'],'in','','');this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x130'),_0xdedead[_0x586f('0x58')]));var _0xe53a03=this[_0x586f('0x8c')][_0x586f('0x6d')](this,_0xdedead);if(_0xe53a03){for(var _0x3a3e3b in _0xe53a03){if(_0xe53a03[_0x586f('0x9a')](_0x3a3e3b)&&_[_0x586f('0x9c')](_0xe53a03[_0x3a3e3b])){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x131'),_0x3a3e3b[_0x586f('0x68')]()),_0xe53a03[_0x3a3e3b]);}}if(_['isNil'](_0xe53a03[_0x586f('0x75')])){return this[_0x586f('0xd')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x586f('0x40')](_0xe53a03[_0x586f('0x75')],'out',_0x586f('0x132'),'');return this['channel']['noop'](util[_0x586f('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0xe53a03[_0x586f('0x75')]));}}return this[_0x586f('0xd')][_0x586f('0x31')](_0xdedead,_0x586f('0x133'));};AGIVertices[_0x586f('0x10')][_0x586f('0x134')]=function(_0x5ac10d){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5ac10d[_0x586f('0xa8')],_0x5ac10d[_0x586f('0x63')]));if(!this['isConfigured'](_0x5ac10d[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20key\x20configured');}var _0x134819=_0x586f('0x135');var _0x3aae3e=util[_0x586f('0x28')](_0x586f('0x136'),FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x435221=util[_0x586f('0x28')](_0x586f('0x137'),_0x3aae3e,_0x134819);var _0x236e74=!![];if(_0x5ac10d[_0x586f('0x138')]==='NOBEEP'){_0x236e74=![];}var _0x1a0d7e=this[_0x586f('0xd')][_0x586f('0x139')](_0x3aae3e,_0x134819,_0x5ac10d[_0x586f('0x13a')],_0x5ac10d[_0x586f('0x63')],undefined,_0x236e74);if(_0x1a0d7e[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x13b'),_0x435221));var _0x163f6a=this['googleASR'][_0x586f('0x6d')](this,_0x5ac10d,_0x435221);if(_0x163f6a){for(var _0x189456 in _0x163f6a){if(_0x163f6a['hasOwnProperty'](_0x189456)){this['channel']['setVariable'](util['format'](_0x586f('0x13c'),_0x189456[_0x586f('0x68')]()),_0x163f6a[_0x189456]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x13d'),JSON[_0x586f('0x70')](_0x163f6a)));}}return _0x1a0d7e;};AGIVertices['prototype'][_0x586f('0x13e')]=function(_0x3d2e4c){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3d2e4c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3d2e4c[_0x586f('0x93')])){return this[_0x586f('0xd')]['noop'](_0x586f('0x13f'));}if(!this['isConfigured'](_0x3d2e4c[_0x586f('0x94')])){return this['channel']['noop'](_0x586f('0x140'));}var _0x48109d='wav';var _0x1b6e32=util['format'](_0x586f('0x136'),FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x506f00=util[_0x586f('0x28')](_0x586f('0x137'),_0x1b6e32,_0x48109d);var _0x13d277=!![];if(_0x3d2e4c[_0x586f('0x138')]===_0x586f('0x141')){_0x13d277=![];}var _0x54446a=this[_0x586f('0xd')][_0x586f('0x139')](_0x1b6e32,_0x48109d,_0x3d2e4c[_0x586f('0x13a')],_0x3d2e4c[_0x586f('0x63')],undefined,_0x13d277);if(_0x54446a[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')]['noop'](util['format'](_0x586f('0x142'),_0x506f00));var _0x1df91a=this[_0x586f('0x92')][_0x586f('0x6d')](this,_0x3d2e4c,_0x506f00);if(_0x1df91a){for(var _0x411815 in _0x1df91a){if(_0x1df91a[_0x586f('0x9a')](_0x411815)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x143'),_0x411815[_0x586f('0x68')]()),_0x1df91a[_0x411815]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x144'),JSON[_0x586f('0x70')](_0x1df91a)));}}return _0x54446a;};AGIVertices[_0x586f('0x10')][_0x586f('0x145')]=function(_0x1a4ca5){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x146'),_0x1a4ca5[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x147')](_0x1a4ca5['context'],_0x1a4ca5[_0x586f('0x3b')],_0x1a4ca5[_0x586f('0x3c')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x148')]=function(_0x26e95e){logger[_0x586f('0x2d')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x26e95e[_0x586f('0xa8')]));if(!this['isConfigured'](_0x26e95e[_0x586f('0x149')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x26e95e,_0x586f('0x14a'));}try{var _0x5ee17c=eval(_0x26e95e[_0x586f('0x149')])?'true':_0x586f('0x14b');this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x14c'),_0x26e95e[_0x586f('0x149')],_0x5ee17c));return{'code':0xc8,'result':_0x5ee17c};}catch(_0x5a40d9){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x586f('0x10')][_0x586f('0x14d')]=function(_0x55265a){logger[_0x586f('0x2d')](util['format'](_0x586f('0x14e'),_0x55265a[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x55265a[_0x586f('0x14f')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x55265a,_0x586f('0x150'));}var _0x5c22f9=this[_0x586f('0x22')]['sync'](this,_0x55265a[_0x586f('0x14f')]);if(!_0x5c22f9){return this[_0x586f('0xd')][_0x586f('0x31')](_0x55265a,_0x586f('0x151'));}for(var _0x20581c=0x0;_0x20581c<_0x5c22f9[_0x586f('0xa0')];_0x20581c+=0x1){var _0x1eeb33=this[_0x586f('0xd')]['getVariable'](util['format'](_0x586f('0x152'),_0x5c22f9[_0x20581c]));if(_0x1eeb33[_0x586f('0xa3')]===-0x1){return _0x1eeb33;}logger['info'](util[_0x586f('0x28')]('IFTIME\x20%s\x20%s',_0x5c22f9[_0x20581c],_0x1eeb33[_0x586f('0xa5')]));if(_0x1eeb33[_0x586f('0xa5')]===_0x586f('0x153')){logger['info'](util['format'](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x153')));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x153')));return{'code':0xc8,'result':_0x586f('0x153')};}else{logger[_0x586f('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x5c22f9[_0x20581c],_0x586f('0x14b')));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x14b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x586f('0x10')][_0x586f('0x155')]=function(_0x25cb12){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x156'),_0x25cb12[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x155')]();};AGIVertices[_0x586f('0x10')][_0x586f('0x157')]=function(_0xb4e1ec){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x158'),_0xb4e1ec['label']));if(!this[_0x586f('0x85')](_0xb4e1ec['key'])){return this['channel'][_0x586f('0xa9')](_0x586f('0xec'));}var _0x4be02c=_0x586f('0x135');var _0x2b2fb9=util[_0x586f('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x212cda=util['format'](_0x586f('0x137'),_0x2b2fb9,_0x4be02c);var _0x455d26=!![];if(_0xb4e1ec[_0x586f('0x138')]===_0x586f('0x141')){_0x455d26=![];}var _0x1887c2=this[_0x586f('0xd')][_0x586f('0x139')](_0x2b2fb9,_0x4be02c,_0xb4e1ec[_0x586f('0x13a')],_0xb4e1ec[_0x586f('0x63')],undefined,_0x455d26);if(_0x1887c2[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x159'),_0x212cda));var _0x434a59=this[_0x586f('0x83')][_0x586f('0x6d')](this,_0xb4e1ec,_0x212cda);if(_0x434a59){for(var _0x41d441 in _0x434a59){if(_0x434a59[_0x586f('0x9a')](_0x41d441)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x15a'),_0x41d441[_0x586f('0x68')]()),_0x434a59[_0x41d441]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x434a59)));}}return _0x1887c2;};AGIVertices[_0x586f('0x10')]['ispeechtts']=function(_0x220b99){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x220b99[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x220b99[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xec'));}if(!this['isConfigured'](_0x220b99['text'])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x15b'),_0x220b99[_0x586f('0x58')]));var _0x4fbe9e=this[_0x586f('0x80')]['sync'](this,_0x220b99);if(_0x4fbe9e){this['channel']['noop'](util['format'](_0x586f('0x159'),_0x4fbe9e));var _0x95c5f2=this[_0x586f('0xd')][_0x586f('0x105')](_0x4fbe9e,_0x220b99['intKey']);try{fs[_0x586f('0x12c')](_0x4fbe9e+'.wav');}catch(_0x173362){logger[_0x586f('0x31')](_0x173362);}return _0x95c5f2;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x220b99,_0x586f('0x15c'));};AGIVertices[_0x586f('0x10')][_0x586f('0x15d')]=function(_0x58c3a4){logger['info'](util[_0x586f('0x28')](_0x586f('0x15e'),_0x58c3a4[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x58c3a4[_0x586f('0x15f')])){return this[_0x586f('0xd')]['error'](_0x58c3a4,'no\x20find\x20by\x20configured');}logger[_0x586f('0x2d')](util[_0x586f('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x586f('0xd')][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));var _0x4327c9=this[_0x586f('0x160')][_0x586f('0x6d')](this,_0x58c3a4['findBy']);if(_0x4327c9){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x58c3a4['findBy']));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x58c3a4[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this['channel'][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')]['logout']=function(_0x4bfd1c){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4bfd1c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x4bfd1c[_0x586f('0x15f')])){return this[_0x586f('0xd')]['error'](_0x4bfd1c,'no\x20find\x20by\x20configured');}logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x165'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));var _0x282166=this[_0x586f('0x166')]['sync'](this,_0x4bfd1c[_0x586f('0x15f')]);if(_0x282166){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x586f('0x2d')](util['format'](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x586f('0x167')]=function(_0x1d5324){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1d5324['label']));if(!this['isConfigured'](_0x1d5324['operation'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x1d5324,_0x586f('0x168'));}this['channel']['noop'](util['format'](_0x586f('0x169'),_0x1d5324[_0x586f('0x16a')]));var _0x5abbb4=eval(_0x1d5324[_0x586f('0x16a')]);if(!this['isConfigured'](_0x1d5324[_0x586f('0xd9')])){return this['channel'][_0x586f('0xa9')](_0x586f('0xda'));}var _0x7804bf=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x1d5324[_0x586f('0xd9')]);if(!_0x7804bf){return this['channel'][_0x586f('0x31')](_0x1d5324,_0x586f('0xdb'));}if(_[_0x586f('0x9b')](_0x5abbb4)){var _0x3129e0=this;_0x5abbb4[_0x586f('0xdc')](function(_0x574f00,_0x3f9867){_0x3129e0[_0x586f('0xd')]['setVariable'](util['format'](_0x586f('0x16b'),_0x7804bf,_0x3f9867),_0x574f00);});return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x16c'),_0x7804bf));}else{return this[_0x586f('0xd')][_0x586f('0x9e')](_0x7804bf,_0x5abbb4);}};AGIVertices[_0x586f('0x10')]['menu']=function(_0x238cde){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x238cde[_0x586f('0xa8')]));if(_0x238cde[_0x586f('0x114')]===0x0){return this[_0x586f('0xa6')](_0x238cde);}_0x238cde['retry']-=0x1;if(!this[_0x586f('0x85')](_0x238cde[_0x586f('0x116')])){return this[_0x586f('0xd')]['error'](_0x238cde,_0x586f('0x115'));}var _0x10d8ad=this[_0x586f('0x16d')]['sync'](this,_0x238cde[_0x586f('0x116')]);if(!_0x10d8ad){return this[_0x586f('0xd')][_0x586f('0x31')](_0x238cde,_0x586f('0x117'));}var _0x3c97e7=this[_0x586f('0xd')][_0x586f('0x118')](_0x10d8ad,_0x238cde['response'],_0x238cde[_0x586f('0x16e')]);var _0x4d403e=_0x3c97e7[_0x586f('0xa3')];if(_0x3c97e7[_0x586f('0xa3')]===-0x1){this[_0x586f('0x35')]['sync'](this,_0x238cde,'-1');return _0x3c97e7;}else if(_0x3c97e7[_0x586f('0xa5')]===_0x586f('0x63')){_0x3c97e7[_0x586f('0xa3')]=_0x3c97e7[_0x586f('0xa3')][_0x586f('0xa0')]>0x0?_0x3c97e7['result']:'t';}else if(_[_0x586f('0x42')](_0x3c97e7['result'])){_0x3c97e7[_0x586f('0xa3')]='#';_0x4d403e='#';}if(!this[_0x586f('0x85')](_0x238cde[_0x586f('0xd9')])){this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x35fa17=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x238cde[_0x586f('0xd9')]);if(!_0x35fa17){return this[_0x586f('0xd')][_0x586f('0x31')](_0x238cde,_0x586f('0xdb'));}this['channel'][_0x586f('0x9e')](_0x35fa17,_0x4d403e);}this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x238cde,_0x4d403e);return _0x3c97e7;};AGIVertices[_0x586f('0x10')][_0x586f('0xa9')]=function(_0x374413){logger[_0x586f('0x2d')](util['format'](_0x586f('0x16f'),_0x374413['label']));return this[_0x586f('0xd')][_0x586f('0xa9')](_0x374413[_0x586f('0x170')]||_0x374413[_0x586f('0xa8')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x171')]=function(_0x26e441){logger['info'](util[_0x586f('0x28')](_0x586f('0x172'),_0x26e441[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x26e441['findBy'])){return this['channel']['error'](_0x26e441,_0x586f('0x173'));}logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x165'),this[_0x586f('0xd')]['callerid'],_0x26e441[_0x586f('0x15f')]));var _0x2fd552=this[_0x586f('0x4b')][_0x586f('0x6d')](this,_0x26e441[_0x586f('0x174')]);var _0x994d63=this[_0x586f('0x4d')]['sync'](this,_0x26e441[_0x586f('0x15f')],_0x2fd552);if(_0x994d63){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441['findBy']));this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441[_0x586f('0x15f')]));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x26e441[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')][_0x586f('0x175')]=function(_0x160163){logger[_0x586f('0x2d')](util['format'](_0x586f('0x176'),_0x160163[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x160163[_0x586f('0x116')])){return this['channel'][_0x586f('0x31')](_0x160163,_0x586f('0x115'));}var _0x24aa4c=this['getSound'][_0x586f('0x6d')](this,_0x160163[_0x586f('0x116')]);if(!_0x24aa4c){return this[_0x586f('0xd')][_0x586f('0x31')](_0x160163,_0x586f('0x117'));}var _0x511e6f=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0x177'),[_0x24aa4c,_0x160163[_0x586f('0xe9')]]);if(_0x511e6f[_0x586f('0xa3')]===-0x1){return _0x511e6f;}return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xc2'),_0x586f('0x177'),_0x24aa4c));};AGIVertices[_0x586f('0x10')][_0x586f('0x178')]=function(_0x4fae26){logger[_0x586f('0x2d')](util['format'](_0x586f('0x179'),_0x4fae26['label']));if(!this[_0x586f('0x85')](_0x4fae26[_0x586f('0x17a')])){return this['channel'][_0x586f('0x31')](_0x4fae26,_0x586f('0x17b'));}var _0x3ff6c5='';var _0x34371b=parseInt(_0x4fae26[_0x586f('0x17a')],0xa);if(isNaN(_0x34371b)){_0x3ff6c5=_0x4fae26[_0x586f('0x17a')];}else{_0x3ff6c5=this[_0x586f('0x14')][_0x586f('0x6d')](this,_0x4fae26['queue_id']);if(!_0x3ff6c5){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4fae26,'no\x20queue\x20found');}}var _0x4c2f1b='';if(this['isConfigured'](_0x4fae26[_0x586f('0x116')])){var _0x3acdb1=this['getSound'][_0x586f('0x6d')](this,_0x4fae26[_0x586f('0x116')]);if(_0x3acdb1){_0x4c2f1b=_0x3acdb1;}}this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x4fae26,_0x3ff6c5);if(_0x4fae26['opts'][_0x586f('0x17c')]('x')<0x0){_0x4fae26[_0x586f('0xe9')]+='x';}if(_0x4fae26['opts']['indexOf']('X')<0x0){_0x4fae26[_0x586f('0xe9')]+='X';}this[_0x586f('0xd')][_0x586f('0x9e')]('XMCS-QUEUE',_0x3ff6c5?_0x3ff6c5[_0x586f('0x17d')]():'');var _0x48a35e=this['channel'][_0x586f('0x53')]('QUEUE',[_0x3ff6c5,_0x4fae26['opts'],_0x4fae26[_0x586f('0x61')],_0x4c2f1b,_0x4fae26['timeout'],_0x4fae26[_0x586f('0xb5')],_0x4fae26[_0x586f('0x17e')],_0x4fae26[_0x586f('0x17f')],'',_0x4fae26['position']]);if(_0x48a35e['result']===-0x1){return _0x48a35e;}return this['channel'][_0x586f('0xa9')](util['format'](_0x586f('0xc2'),_0x586f('0x180'),_0x3ff6c5));};AGIVertices[_0x586f('0x10')]['record']=function(_0x17baae){logger[_0x586f('0x2d')](util['format'](_0x586f('0x181'),_0x17baae[_0x586f('0xa8')]));var _0x3450a8=_0x17baae[_0x586f('0x182')]||'wav';var _0x13f97b=util[_0x586f('0x28')]('%s_%s',this[_0x586f('0xd')][_0x586f('0x36')],rs['generate'](0x5));var _0x249bf4=util[_0x586f('0x28')](_0x586f('0x183'),FILES_PATH,_0x13f97b,_0x3450a8);var _0x126139=util['format'](_0x586f('0x136'),FILES_PATH,_0x13f97b);this[_0x586f('0x184')][_0x586f('0x6d')](this,_0x17baae,_0x13f97b,_0x249bf4);this['channel'][_0x586f('0x9e')](_0x586f('0x185'),_0x13f97b);logger[_0x586f('0x2d')](_0x586f('0x186'),_0x126139,_0x3450a8,_0x17baae[_0x586f('0x187')],_0x17baae[_0x586f('0x63')]);return this['channel'][_0x586f('0x139')](_0x126139,_0x3450a8,_0x17baae[_0x586f('0x187')],_0x17baae['timeout'],undefined,!![]);};AGIVertices[_0x586f('0x10')][_0x586f('0x188')]=function(_0x5ca564){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x189'),_0x5ca564[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x5ca564['url'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x18a'));}var _0x488e57=this[_0x586f('0x60')][_0x586f('0x6d')](this,_0x5ca564);logger[_0x586f('0x2d')](util['format'](_0x586f('0x18b'),util[_0x586f('0x18c')](_0x488e57,{'showHidden':![],'depth':null})));if(!this[_0x586f('0x85')](_0x5ca564[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x18d'));}var _0x4e150f=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x5ca564[_0x586f('0xd9')]);if(!_0x4e150f){return this[_0x586f('0xd')][_0x586f('0x31')](_0x5ca564,_0x586f('0xdb'));}this['channel'][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x18e'),_0x4e150f),_0x488e57[_0x586f('0x74')]?_0x488e57[_0x586f('0x74')]:_0x586f('0x18f'));this[_0x586f('0xd')]['setVariable'](util['format'](_0x586f('0x190'),_0x4e150f),_0x488e57[_0x586f('0x73')]?_0x488e57['statusMessage']:'OK');if(_0x488e57[_0x586f('0x71')]){try{this[_0x586f('0x9d')](_0x488e57[_0x586f('0x71')],_0x4e150f);}catch(_0x270439){logger['error'](util[_0x586f('0x28')](_0x586f('0x191'),_0x4e150f));}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('variable\x20%s\x20set',_0x4e150f));};AGIVertices['prototype'][_0x586f('0x192')]=function(_0x4cf488){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x193'),_0x4cf488[_0x586f('0xa8')]));return this[_0x586f('0xd')]['sayDigits'](_0x4cf488[_0x586f('0x194')]['replace'](/\s+/g,''),_0x4cf488[_0x586f('0x187')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x195')]=function(_0x99e2c4){logger[_0x586f('0x2d')](util['format'](_0x586f('0x196'),_0x99e2c4[_0x586f('0xa8')]));return this[_0x586f('0xd')]['sayNumber'](_0x99e2c4[_0x586f('0x64')][_0x586f('0xd7')](/\s+/g,''),_0x99e2c4[_0x586f('0x187')]);};AGIVertices['prototype'][_0x586f('0x197')]=function(_0x3909bb){logger['info'](util['format'](_0x586f('0x198'),_0x3909bb[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x199')](_0x3909bb['text'],_0x3909bb['escape_digits']);};AGIVertices[_0x586f('0x10')][_0x586f('0x19a')]=function(_0x5333d6){logger['info'](util[_0x586f('0x28')](_0x586f('0x19b'),_0x5333d6[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x5333d6[_0x586f('0x19c')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x19d'));}var _0x81617e=this[_0x586f('0x19e')][_0x586f('0x6d')](this,_0x5333d6[_0x586f('0x19c')]);if(!_0x81617e||!_0x81617e[_0x586f('0x19f')]){return this[_0x586f('0xd')]['error'](_0x5333d6,_0x586f('0x1a0'));}var _0x1f6aad={'from':util['format']('\x22%s\x22\x20<%s>',_0x81617e['name'],_0x81617e[_0x586f('0x1a1')]||_0x81617e[_0x586f('0x19f')][_0x586f('0x1a2')]),'to':_0x5333d6['to']||'','cc':_0x5333d6['cc']||'','bcc':_0x5333d6[_0x586f('0x1a3')]||'','subject':_0x5333d6[_0x586f('0x1a4')],'html':_0x5333d6[_0x586f('0x58')],'text':_0x5333d6['text']};if(this[_0x586f('0x85')](_0x5333d6['template_id'])){}logger['debug'](_0x586f('0x1a5'),JSON['stringify'](_0x1f6aad));this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x5333d6,_0x5333d6[_0x586f('0x19c')]);this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x81617e[_0x586f('0x17')]));this[_0x586f('0x21')][_0x586f('0x6d')](this,_0x81617e['smtpOptions'],_0x1f6aad);return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1a6'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1a7')]=function(_0x15d487){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x15d487[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1a8'));};AGIVertices[_0x586f('0x10')]['sendSMS']=function(_0x3da17c){logger['info'](util['format'](_0x586f('0x1a9'),_0x3da17c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3da17c[_0x586f('0x1aa')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20sms\x20account\x20configured');}var _0x4d8dd4=this['getSmsAccount'][_0x586f('0x6d')](this,_0x3da17c['sms_account_id']);if(!_0x4d8dd4){return this[_0x586f('0xd')][_0x586f('0x31')](_0x3da17c,'no\x20sms\x20account\x20found');}var _0xa18e50={'body':_0x3da17c[_0x586f('0x1ab')],'phone':_0x3da17c['to']||'','SmsAccountId':_0x4d8dd4['id']};logger[_0x586f('0xe2')](_0x586f('0x1ac'),JSON[_0x586f('0x70')](_0xa18e50));this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x3da17c,_0x3da17c['sms_account_id']);this['channel'][_0x586f('0xa9')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4d8dd4[_0x586f('0x17')]));this[_0x586f('0x34')]['sync'](this,_0xa18e50);return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1ad'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1ae')]=function(_0x408cb7){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x408cb7[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x408cb7['variable_id'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x408cb7,'no\x20variable\x20selected');}var _0x1b49df=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x408cb7['variable_id']);if(!_0x1b49df){return this[_0x586f('0xd')]['error'](_0x408cb7,_0x586f('0xdb'));}return this[_0x586f('0xd')]['setVariable'](_0x1b49df,_0x408cb7[_0x586f('0x1af')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x1b0')]=function(_0x538162){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1b1'),_0x538162['label']));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0x538162['answer']===_0x586f('0x1b2')){this[_0x586f('0xd')][_0x586f('0xa9')]('Answer');return this['channel'][_0x586f('0xb8')]();}return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1b3'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1b4')]=function(_0x54c0cb){logger[_0x586f('0x2d')](util['format'](_0x586f('0x1b5'),_0x54c0cb[_0x586f('0xa8')]));if(!this['isConfigured'](_0x54c0cb[_0x586f('0x1b6')])){return this['channel'][_0x586f('0x31')](_0x54c0cb,_0x586f('0x1b7'));}var _0x274f42=this[_0x586f('0x16')]['sync'](this,_0x54c0cb['project_id']);if(!this['isConfigured'](_0x274f42)){return this[_0x586f('0xd')][_0x586f('0x31')](_0x54c0cb,util['format'](_0x586f('0x1b8'),_0x54c0cb[_0x586f('0x1b6')]));}if(_0x274f42===this['channel'][_0x586f('0x38')]){return this[_0x586f('0xd')]['error'](_0x54c0cb,_0x586f('0x1b9'));}this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x54c0cb,_0x274f42);var _0x2c0ea0=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0x1ba'),util[_0x586f('0x28')](_0x586f('0x1bb'),config[_0x586f('0xb5')][_0x586f('0x1bc')]||_0x586f('0x1bd'),_0x274f42,this[_0x586f('0xd')]['arg_1']));if(_0x2c0ea0[_0x586f('0xa3')]===-0x1){return _0x2c0ea0;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xc2'),_0x586f('0x1ba'),_0x274f42));};AGIVertices[_0x586f('0x10')][_0x586f('0x1be')]=function(_0x3f20db){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3f20db['label']));var _0x58c03e=this[_0x586f('0x52')][_0x586f('0x6d')](this,_0x3f20db['command']);this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x3f20db,_0x3f20db['command']);if(this[_0x586f('0x85')](_0x3f20db[_0x586f('0xd9')])){var _0x29ec4e=this[_0x586f('0x11')]['sync'](this,_0x3f20db[_0x586f('0xd9')]);if(_0x29ec4e){this['channel'][_0x586f('0x9e')](_0x29ec4e,_0x58c03e);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x1bf'),_0x3f20db[_0x586f('0x1c0')],_0x29ec4e));}}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3f20db[_0x586f('0x1c0')]));};AGIVertices['prototype'][_0x586f('0x1c1')]=function(_0x4d8f0b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1c2'),_0x4d8f0b[_0x586f('0xa8')]));_0x4d8f0b['text']=_0x4d8f0b[_0x586f('0x58')][_0x586f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x586f('0x85')](_0x4d8f0b[_0x586f('0x56')])){return this['channel'][_0x586f('0xa9')](_0x586f('0x1c3'));}if(!this[_0x586f('0x85')](_0x4d8f0b[_0x586f('0x58')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x1c4'),_0x4d8f0b[_0x586f('0x58')]));var _0x1fe90f=this['googleCloudTTS']['sync'](this,_0x4d8f0b);if(_0x1fe90f){this['channel'][_0x586f('0xa9')](util['format'](_0x586f('0x1c5'),_0x1fe90f));var _0x533673=this['channel']['streamFile'](_0x1fe90f);try{fs['unlink'](_0x1fe90f+'.wav');}catch(_0x5a104c){logger[_0x586f('0x31')](_0x5a104c);}return _0x533673;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x4d8f0b,_0x586f('0x1c6'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1c7')]=function(_0x55382b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1c8'),_0x55382b[_0x586f('0xa8')]));_0x55382b[_0x586f('0x58')]=_0x55382b[_0x586f('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x586f('0x85')](_0x55382b['text'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc5'));}this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x1c9'),_0x55382b['text']));var _0x2ddba5=this[_0x586f('0x5e')]['sync'](this,_0x55382b);if(_0x2ddba5){this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x1ca'),_0x2ddba5));var _0x4b3809=this[_0x586f('0xd')][_0x586f('0x105')](_0x2ddba5);try{fs[_0x586f('0x12c')](_0x2ddba5+_0x586f('0x12d'));}catch(_0x3f46a0){logger[_0x586f('0x31')](_0x3f46a0);}return _0x4b3809;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x55382b,_0x586f('0x1cb'));};AGIVertices[_0x586f('0x10')]['unpause']=function(_0x364dce){logger[_0x586f('0x2d')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x364dce[_0x586f('0xa8')]));if(!this['isConfigured'](_0x364dce[_0x586f('0x15f')])){return this['channel'][_0x586f('0x31')](_0x364dce,_0x586f('0x173'));}logger[_0x586f('0x2d')](util['format'](_0x586f('0x165'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));var _0x369dd7=this[_0x586f('0x4f')][_0x586f('0x6d')](this,_0x364dce[_0x586f('0x15f')]);if(_0x369dd7){logger['info'](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce['findBy']));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce['findBy']));this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0x163'),this['channel'][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')][_0x586f('0x1cc')]=function(_0x10566f){logger[_0x586f('0x2d')](util['format'](_0x586f('0x1cd'),_0x10566f[_0x586f('0xa8')]));var _0xb11643=this[_0x586f('0xd')]['exec'](_0x586f('0x1ce'),[_0x10566f['mailbox'],_0x10566f[_0x586f('0x77')]]);if(_0xb11643[_0x586f('0xa3')]===-0x1){return _0xb11643;}return this['channel']['noop'](util['format'](_0x586f('0xc2'),_0x586f('0x1ce'),_0x10566f[_0x586f('0x1cf')]));};AGIVertices[_0x586f('0x10')][_0x586f('0x1d0')]=function(_0x4c8da2){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4c8da2['label']));if(!this['isConfigured'](_0x4c8da2[_0x586f('0xd9')])){return this['channel']['error'](_0x4c8da2,'no\x20variable\x20selected');}var _0x3e97bb=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x4c8da2[_0x586f('0xd9')]);if(!_0x3e97bb){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4c8da2,'no\x20variable\x20found');}var _0x8dd3ff=this['channel'][_0x586f('0x11')](_0x3e97bb);return{'code':0xc8,'result':_0x8dd3ff[_0x586f('0xa5')]?_0x8dd3ff[_0x586f('0xa5')]:'-'};};String['prototype']['replaceAll']=function(_0x9056c3,_0x494b78){return this[_0x586f('0x9f')](_0x9056c3)[_0x586f('0x1d1')](_0x494b78);};module[_0x586f('0x1d2')]=AGIVertices; \ No newline at end of file +var _0xbecf=['body','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','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','exec','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','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','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','recordFile','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','template_id','sendMail\x20message','smtpOptions','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','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','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','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','mailRpc','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','callerid','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','replace','googleCloudTTS','apiKey','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','url','headers'];(function(_0x3e9332,_0x42c2ac){var _0x59fe47=function(_0x15136c){while(--_0x15136c){_0x3e9332['push'](_0x3e9332['shift']());}};_0x59fe47(++_0x42c2ac);}(_0xbecf,0x15c));var _0xfbec=function(_0x3bcc6f,_0x3a4e55){_0x3bcc6f=_0x3bcc6f-0x0;var _0x296d2c=_0xbecf[_0x3bcc6f];return _0x296d2c;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0xfbec('0x0'));var odbc=require(_0xfbec('0x1'))();var rs=require(_0xfbec('0x2'));var moment=require(_0xfbec('0x3'));var Mustache=require('mustache');var rp=require(_0xfbec('0x4'));var logger=require(_0xfbec('0x5'))(_0xfbec('0x6'));var config=require(_0xfbec('0x7'));var shared=require(_0xfbec('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xfbec('0x9');var recursiveMapAttributes=[_0xfbec('0xa'),_0xfbec('0xb')];var verticesWithRetry=[_0xfbec('0xc'),_0xfbec('0xd'),_0xfbec('0xe')];var AGIVertices=function(_0x1b87c5,_0x168ec5,_0x21863f){this['channel']=_0x1b87c5;this['rpc']=_0x168ec5;this['mailRpc']=_0x21863f;};AGIVertices[_0xfbec('0xf')][_0xfbec('0x10')]=function(_0x12d057,_0x2d0e02){this[_0xfbec('0x11')]['getVariableById'](_0x12d057)[_0xfbec('0x12')](function(_0x2b7d99){_0x2d0e02(null,_0x2b7d99?_0x2b7d99[_0xfbec('0x13')]:![]);})[_0xfbec('0x14')](function(_0x4859ea){_0x2d0e02(_0x4859ea);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x15')]=function(_0x3f06d4,_0x1af87d){this['rpc'][_0xfbec('0x16')](_0x3f06d4)['then'](function(_0x8b2f89){_0x1af87d(null,_0x8b2f89?_0x8b2f89['name']:![]);})[_0xfbec('0x14')](function(_0x923681){_0x1af87d(_0x923681);});};AGIVertices[_0xfbec('0xf')]['getSquareProject']=function(_0xe91fb8,_0x2a3329){this[_0xfbec('0x11')]['getSquareProjectById'](_0xe91fb8)[_0xfbec('0x12')](function(_0x267a4b){_0x2a3329(null,_0x267a4b?_0x267a4b[_0xfbec('0x13')]:![]);})[_0xfbec('0x14')](function(_0x42a6cf){_0x2a3329(_0x42a6cf);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x17')]=function(_0x4f2431,_0x5e90c3){this['rpc'][_0xfbec('0x18')](_0x4f2431)[_0xfbec('0x12')](function(_0x2c2007){_0x5e90c3(null,_0x2c2007?_0x2c2007['dsn']:![]);})[_0xfbec('0x14')](function(_0x383405){_0x5e90c3(_0x383405);});};AGIVertices['prototype'][_0xfbec('0x19')]=function(_0x226685,_0x54a20f){this[_0xfbec('0x11')][_0xfbec('0x1a')](_0x226685)[_0xfbec('0x12')](function(_0x43e395){_0x54a20f(null,_0x43e395?_0x43e395[_0xfbec('0x13')]:![]);})['catch'](function(_0x2e172e){_0x54a20f(_0x2e172e);});};AGIVertices['prototype'][_0xfbec('0x1b')]=function(_0x1c9a07,_0x5bbb79){this['rpc']['getTrunkById'](_0x1c9a07)[_0xfbec('0x12')](function(_0x421535){_0x5bbb79(null,_0x421535?_0x421535['name']:![]);})[_0xfbec('0x14')](function(_0xa56be8){_0x5bbb79(_0xa56be8);});};AGIVertices[_0xfbec('0xf')]['getSound']=function(_0x29126f,_0x2d9acb){var _0x437b7e=this;this[_0xfbec('0x11')][_0xfbec('0x1c')](_0x29126f)[_0xfbec('0x12')](function(_0x4aff99){_0x2d9acb(null,_0x4aff99?_0x437b7e[_0xfbec('0x1d')](_0x4aff99[_0xfbec('0x1e')]):![]);})[_0xfbec('0x14')](function(_0x30d356){_0x2d9acb(_0x30d356);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x1f')]=function(_0x41b4cf,_0x5cb9d7){this[_0xfbec('0x11')]['getMailAccountById'](_0x41b4cf)['then'](function(_0x5a3829){_0x5cb9d7(null,_0x5a3829?_0x5a3829:![]);})[_0xfbec('0x14')](function(_0x49cc9a){_0x5cb9d7(_0x49cc9a);});};AGIVertices['prototype']['sendMailMessage']=function(_0x3da9c6,_0xab9f46,_0x242a4b){this[_0xfbec('0x20')][_0xfbec('0x21')](_0x3da9c6,_0xab9f46)['then'](function(){_0x242a4b(null);})[_0xfbec('0x14')](function(_0x2376ce){_0x242a4b(_0x2376ce);});};AGIVertices['prototype'][_0xfbec('0x22')]=function(_0x4e83c0,_0x58960e){this[_0xfbec('0x11')][_0xfbec('0x23')](_0x4e83c0)[_0xfbec('0x12')](function(_0x143463){if(_0x143463){if(_0x143463['IntervalId']){_0x58960e(null,[_0x143463[_0xfbec('0x24')]]);}else{_0x58960e(null,_[_0xfbec('0x25')](_0x143463[_0xfbec('0x26')],'interval'));}}else{_0x58960e(null,![]);}})['catch'](function(_0x3d35b5){_0x58960e(_0x3d35b5);});};AGIVertices['prototype'][_0xfbec('0x1d')]=function(_0x41e891){return util[_0xfbec('0x27')](_0xfbec('0x28'),FILES_PATH,_0x41e891);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x29')]=function(_0x5c58fd,_0x4bf313,_0x387e55){odbc[_0xfbec('0x2a')](_0x5c58fd,function(_0x173064){if(_0x173064){logger[_0xfbec('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x173064);_0x387e55(_0x173064);}else{logger[_0xfbec('0x2c')]('ODBC\x20connection\x20successfully');odbc['query'](_0x4bf313,function(_0x256e74,_0x39bc67){if(_0x256e74){logger[_0xfbec('0x2c')](_0xfbec('0x2d'),_0x4bf313);_0x387e55(_0x256e74);}else{logger[_0xfbec('0x2c')](_0xfbec('0x2e'),_0x4bf313);odbc[_0xfbec('0x2f')](function(_0xcd753c){if(_0xcd753c){logger[_0xfbec('0x2b')](_0xfbec('0x30'),_0xcd753c);}_0x387e55(null,_0x39bc67);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x3b2b41,_0x2d6d9c){this[_0xfbec('0x11')][_0xfbec('0x31')](_0x3b2b41)['then'](function(_0xc5d2e9){_0x2d6d9c(null,_0xc5d2e9?_0xc5d2e9:![]);})[_0xfbec('0x14')](function(_0x1044d9){_0x2d6d9c(_0x1044d9);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x32')]=function(_0x44b2bf,_0x7b46a6){this['rpc'][_0xfbec('0x32')](_0x44b2bf)[_0xfbec('0x12')](function(_0x4e3f57){_0x7b46a6(null,_0x4e3f57);})[_0xfbec('0x14')](function(_0x3c0c5f){_0x7b46a6(_0x3c0c5f);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x33')]=function(_0x206a55,_0x10e23e,_0x154de6){this['rpc'][_0xfbec('0x33')]({'uniqueid':this[_0xfbec('0x34')]['uniqueid'],'node':_0x206a55[_0xfbec('0x35')],'application':_0x206a55['agicommand'],'data':_0x10e23e||null,'project_name':this[_0xfbec('0x34')]['arg_1'],'callerid':this[_0xfbec('0x34')][_0xfbec('0x36')]})[_0xfbec('0x12')](function(_0x1ce70b){if(_0x154de6){_0x154de6(null,_0x1ce70b);}})[_0xfbec('0x14')](function(_0x401a11){if(_0x154de6){_0x154de6(_0x401a11);}});};AGIVertices[_0xfbec('0xf')]['createSquareRecording']=function(_0x40cb7f,_0x64cf4d,_0x448dc3,_0x4772e8){this['rpc'][_0xfbec('0x37')]({'uniqueid':this[_0xfbec('0x34')][_0xfbec('0x38')],'callerid':this[_0xfbec('0x34')][_0xfbec('0x36')],'calleridname':this[_0xfbec('0x34')][_0xfbec('0x39')],'context':this['channel'][_0xfbec('0x3a')],'extension':this[_0xfbec('0x34')]['extension'],'priority':this[_0xfbec('0x34')][_0xfbec('0x3b')],'accountcode':this[_0xfbec('0x34')][_0xfbec('0x3c')],'dnid':this[_0xfbec('0x34')]['dnid'],'projectName':this[_0xfbec('0x34')][_0xfbec('0x3d')],'saveName':_0x64cf4d,'filename':_0x40cb7f[_0xfbec('0x3e')]||_0x64cf4d,'savePath':_0x448dc3})[_0xfbec('0x12')](function(_0x2bed4c){_0x4772e8(null,_0x2bed4c);})['catch'](function(_0x3b17ba){_0x4772e8(_0x3b17ba);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x3f')]=function(_0x286bf1,_0x458ee4,_0x4e79ff,_0x238394,_0x2cc356){this[_0xfbec('0x11')][_0xfbec('0x3f')]({'uniqueid':this[_0xfbec('0x34')]['uniqueid'],'body':_0x286bf1,'direction':_0x458ee4,'providerName':_0x4e79ff,'providerResponse':_0x238394})[_0xfbec('0x12')](function(_0x30fe9b){if(_0x2cc356){_0x2cc356(null,_0x30fe9b);}})[_0xfbec('0x14')](function(_0x2c5a9a){if(_0x2cc356){_0x2cc356(_0x2c5a9a);}});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x40')]=function(_0x354d49,_0x3cb620){this[_0xfbec('0x11')][_0xfbec('0x40')]({'firstName':_[_0xfbec('0x41')](_0x354d49[_0xfbec('0x13')])||_[_0xfbec('0x42')](_0x354d49['name'])?_0xfbec('0x43')+Math[_0xfbec('0x44')]():_0x354d49[_0xfbec('0x13')],'lastName':_[_0xfbec('0x41')](_0x354d49[_0xfbec('0x45')])||_[_0xfbec('0x42')](_0x354d49[_0xfbec('0x45')])?null:_0x354d49['lastName'],'phone':_0x354d49['phone'],'ListId':_0x354d49[_0xfbec('0x46')],'scheduledat':_0x354d49[_0xfbec('0x47')],'callbackUniqueid':this[_0xfbec('0x34')][_0xfbec('0x38')],'tags':_0xfbec('0x48'),'description':_0xfbec('0x49')+_0x354d49['scheduledAt'][_0xfbec('0x4a')](),'priority':_0x354d49[_0xfbec('0x4b')]})[_0xfbec('0x12')](function(_0x3b9439){_0x3cb620(null,_0x3b9439);})[_0xfbec('0x14')](function(_0x2296c4){_0x3cb620(_0x2296c4);});};AGIVertices[_0xfbec('0xf')]['getPause']=function(_0x2ec139,_0x2ad395){this['rpc'][_0xfbec('0x4c')](_0x2ec139)[_0xfbec('0x12')](function(_0x19cc60){_0x2ad395(null,_0x19cc60?_0x19cc60[_0xfbec('0x13')]:![]);})[_0xfbec('0x14')](function(_0x4fbf88){_0x2ad395(_0x4fbf88);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x4d')]=function(_0x1063fd,_0x30289e,_0x2b8f02){var _0x1d9469={'role':'agent'};_0x1d9469[_0x1063fd]=this['channel'][_0xfbec('0x36')];this[_0xfbec('0x11')][_0xfbec('0x4d')](_0x1d9469,_0x30289e,this[_0xfbec('0x34')][_0xfbec('0x38')])[_0xfbec('0x12')](function(_0x3c2b99){_0x2b8f02(null,_[_0xfbec('0x42')](_0x3c2b99)?![]:!![]);})['catch'](function(_0x38ead0){logger[_0xfbec('0x2b')](_0x38ead0);_0x2b8f02(null,![]);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x4e')]=function(_0x4e77e4,_0x3d3fc1){var _0x4792e6={'role':_0xfbec('0x4f')};_0x4792e6[_0x4e77e4]=this['channel'][_0xfbec('0x36')];this['rpc'][_0xfbec('0x4e')](_0x4792e6)[_0xfbec('0x12')](function(_0x5585a3){_0x3d3fc1(null,_[_0xfbec('0x42')](_0x5585a3)?![]:!![]);})[_0xfbec('0x14')](function(_0x5d70b5){logger[_0xfbec('0x2b')](_0x5d70b5);_0x3d3fc1(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x90ee34,_0x407587){var _0x1d25fe={'role':'agent'};_0x1d25fe[_0x90ee34]=this[_0xfbec('0x34')][_0xfbec('0x36')];this[_0xfbec('0x11')][_0xfbec('0x50')](_0x1d25fe)[_0xfbec('0x12')](function(_0x34cc03){_0x407587(null,_['isNil'](_0x34cc03)?![]:!![]);})[_0xfbec('0x14')](function(_0xc0356a){logger[_0xfbec('0x2b')](_0xc0356a);_0x407587(null,![]);});};AGIVertices[_0xfbec('0xf')]['agentLogin']=function(_0x53ca19,_0x185734){var _0x2751fa={'role':_0xfbec('0x4f')};_0x2751fa[_0x53ca19]=this[_0xfbec('0x34')][_0xfbec('0x36')];var _0x555120=_0x53ca19!=_0xfbec('0x51')?util[_0xfbec('0x27')](_0xfbec('0x52'),_0xfbec('0x53'),this[_0xfbec('0x34')]['callerid']):undefined;this['rpc'][_0xfbec('0x54')](_0x2751fa,_0x555120)['then'](function(_0x37bd34){_0x185734(null,_[_0xfbec('0x42')](_0x37bd34)?![]:!![]);})[_0xfbec('0x14')](function(_0x1fcdc8){logger['error'](_0x1fcdc8);_0x185734(null,![]);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x55')]=function(_0x3fc2b3,_0x5539d8){sh['exec'](_['trim'](_0x3fc2b3),function(_0x2e3295,_0x3df279){var _0x561b90=_0x3df279[_0xfbec('0x56')](/(\r\n|\n|\r)/gm,'');_0x5539d8(null,_0x561b90);});};AGIVertices[_0xfbec('0xf')]['googleCloudTTS']=function(_0x3c2f44,_0x4d08fa){scripts[_0xfbec('0x57')](_0x3c2f44[_0xfbec('0x58')],_0x3c2f44['google_cloud_tts_text_type']||_0xfbec('0x59'),_0x3c2f44[_0xfbec('0x59')],_0x3c2f44['languageCode']||'en-US',_0x3c2f44[_0xfbec('0x5a')]||_0xfbec('0x5b'),_0x3c2f44[_0xfbec('0x5c')]||_0xfbec('0x5d'))[_0xfbec('0x12')](function(_0x971b3e){_0x4d08fa(null,_0x971b3e);})[_0xfbec('0x14')](function(_0x53475a){_0x4d08fa(_0x53475a);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x5e')]=function(_0x16e27d,_0x2e8ece){scripts['googleTTS'](_0x16e27d[_0xfbec('0x59')],_0x16e27d[_0xfbec('0x5f')]||'en',0x1)[_0xfbec('0x12')](function(_0x3dc274){_0x2e8ece(null,_0x3dc274);})[_0xfbec('0x14')](function(_0x9766bc){_0x2e8ece(_0x9766bc);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x60')]=function(_0x4c5c0d,_0x805878){var _0x3a4fee={'uri':_0x4c5c0d['url'],'method':_0x4c5c0d[_0xfbec('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4c5c0d[_0xfbec('0x62')])===_0xfbec('0x63')&&parseInt(_0x4c5c0d[_0xfbec('0x62')])>=0x1?parseInt(_0x4c5c0d[_0xfbec('0x62')])*0x3e8:0x5*0x3e8};if(_[_0xfbec('0x64')](['POST','PUT'],_0x3a4fee[_0xfbec('0x61')]['toUpperCase']())){try{_0x3a4fee['body']=_0x4c5c0d['rawBody']?JSON[_0xfbec('0x65')](_0x4c5c0d['rawBody']):{};}catch(_0x16fabb){logger['error'](_0xfbec('0x66'),_0x16fabb);}}try{_0x3a4fee['headers']=_0x4c5c0d[_0xfbec('0xa')]?JSON[_0xfbec('0x65')](_0x4c5c0d[_0xfbec('0xa')]):{};}catch(_0x24c1dd){logger[_0xfbec('0x2b')](_0xfbec('0x67'),_0x24c1dd);}if(_0x4c5c0d[_0xfbec('0x68')]){try{var _0x534fad=require(_0x4c5c0d[_0xfbec('0x68')])[_0xfbec('0x69')](this,_0x3a4fee);_0x3a4fee[_0xfbec('0x6a')]=Mustache['render'](_0x4c5c0d[_0xfbec('0x6b')],_0x534fad,{},['$$','$$']);if(_0x3a4fee['headers']){_0x3a4fee[_0xfbec('0x6c')]=JSON[_0xfbec('0x65')](Mustache['render'](JSON['stringify'](_0x3a4fee[_0xfbec('0x6c')]),_0x534fad,{},['$$','$$']));}if(_0x3a4fee[_0xfbec('0x6d')]){_0x3a4fee[_0xfbec('0x6d')]=JSON[_0xfbec('0x65')](Mustache['render'](JSON[_0xfbec('0x6e')](_0x3a4fee[_0xfbec('0x6d')]),_0x534fad,{},['$$','$$']));}}catch(_0x1cac63){logger[_0xfbec('0x2b')](_0xfbec('0x6f'),_0x1cac63);}}rp(_0x3a4fee)['then'](function(_0x38f091){var _0x2a83f2={'statusCode':_0x38f091[_0xfbec('0x70')]||0xc8,'statusMessage':_0x38f091[_0xfbec('0x71')]||'OK','headers':_0x38f091['headers']||{},'body':_0x38f091['body']||{}};_0x805878(null,_0x2a83f2);})[_0xfbec('0x14')](function(_0x366c47){var _0x5c360b={'statusCode':_0x366c47['statusCode']||0x1f4,'statusMessage':_0x366c47[_0xfbec('0x72')]||_0xfbec('0x73'),'headers':_0x366c47['options'][_0xfbec('0x6c')]||{},'body':_0x366c47[_0xfbec('0x74')]['body']||{}};_0x805878(null,_0x5c360b);});};AGIVertices['prototype'][_0xfbec('0x75')]=function(_0x52d71f,_0x495a5d){scripts['googleDialogflow'](this[_0xfbec('0x34')][_0xfbec('0x38')],_0x52d71f[_0xfbec('0x76')],_0x52d71f[_0xfbec('0x59')],_0x52d71f[_0xfbec('0x77')]||'en')[_0xfbec('0x12')](function(_0x49da06){_0x495a5d(null,_0x49da06);})[_0xfbec('0x14')](function(_0x307cec){_0x495a5d(_0x307cec);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x78')]=function(_0x56f05,_0x57424d){scripts[_0xfbec('0x78')](this['channel'][_0xfbec('0x38')],_0x56f05[_0xfbec('0x79')],_0x56f05[_0xfbec('0x7a')],_0x56f05[_0xfbec('0x7b')],_0x56f05[_0xfbec('0x59')],_0x56f05['dialogflowV2_language']||'en')['then'](function(_0x79e2f4){_0x57424d(null,_0x79e2f4);})[_0xfbec('0x14')](function(_0x29f9f8){_0x57424d(_0x29f9f8);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x7c')]=function(_0x1e6a4e,_0x380924){scripts['sestekNDA'](this['channel'],_0x1e6a4e)[_0xfbec('0x12')](function(_0x4481a0){_0x380924(null,_0x4481a0);})[_0xfbec('0x14')](function(_0x56f0ee){_0x380924(_0x56f0ee);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x7d')]=function(_0x1d5a5b,_0x27fb9a){scripts[_0xfbec('0x7d')](_0x1d5a5b[_0xfbec('0x76')],_0x1d5a5b[_0xfbec('0x59')],_0x1d5a5b[_0xfbec('0x7e')]||_0xfbec('0x7f'),_0x1d5a5b[_0xfbec('0x80')])['then'](function(_0x4b1f56){_0x27fb9a(null,_0x4b1f56);})['catch'](function(_0x398d03){_0x27fb9a(_0x398d03);});};AGIVertices['prototype'][_0xfbec('0x81')]=function(_0x8156e7,_0x50e461,_0x297483){scripts['ispeechASR'](_0x50e461,_0x8156e7['key'],_0x8156e7[_0xfbec('0x82')]||_0xfbec('0x7f'),this[_0xfbec('0x83')](_0x8156e7['model'])?_0x8156e7[_0xfbec('0x84')]:undefined)[_0xfbec('0x12')](function(_0x40bae6){_0x297483(null,_0x40bae6);})[_0xfbec('0x14')](function(_0x5bd81b){_0x297483(_0x5bd81b);});};AGIVertices[_0xfbec('0xf')]['awsPolly']=function(_0x220c10,_0x57d27c){scripts[_0xfbec('0x85')](_0x220c10[_0xfbec('0x86')],_0x220c10[_0xfbec('0x87')],_0x220c10['aws_polly_region'],_0x220c10[_0xfbec('0x88')]||_0xfbec('0x89'),_0x220c10[_0xfbec('0x59')],_0x220c10[_0xfbec('0x8a')]||'text')[_0xfbec('0x12')](function(_0x299f94){_0x57d27c(null,_0x299f94);})['catch'](function(_0x101fc6){_0x57d27c(_0x101fc6);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x8b')]=function(_0x13980f,_0xf266da){scripts[_0xfbec('0x8b')](this['channel'][_0xfbec('0x38')],_0x13980f['aws_access_key_id'],_0x13980f[_0xfbec('0x87')],_0x13980f[_0xfbec('0x8c')],_0x13980f[_0xfbec('0x59')],_0x13980f['aws_bot_name'])[_0xfbec('0x12')](function(_0x20d858){_0xf266da(null,_0x20d858);})[_0xfbec('0x14')](function(_0x440995){_0xf266da(_0x440995);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x8d')]=function(_0x4e5934,_0x4cd100,_0x303fc4){scripts['googleASR'](_0x4cd100,_0x4e5934[_0xfbec('0x76')],_0x4e5934['google_asr_language']||'en-US')[_0xfbec('0x12')](function(_0x1d8836){_0x303fc4(null,_0x1d8836);})[_0xfbec('0x14')](function(_0x9119a4){_0x303fc4(_0x9119a4);});};AGIVertices[_0xfbec('0xf')][_0xfbec('0x8e')]=function(_0x505edf,_0x2d8e0f,_0xcda550){scripts['tildeASR'](_0x2d8e0f,_0x505edf['appid'],_0x505edf['appsecret'],_0x505edf[_0xfbec('0x6a')])[_0xfbec('0x12')](function(_0x2042e1){_0xcda550(null,_0x2042e1);})[_0xfbec('0x14')](function(_0x4fc796){_0xcda550(_0x4fc796);});};AGIVertices['prototype']['clear']=function(_0x54890d){var _0x34f5ab=_['includes'](verticesWithRetry,_0x54890d[_0xfbec('0x8f')])?_0x54890d:_[_0xfbec('0x90')](_0x54890d);for(var _0x58de8a in _0x34f5ab){if(_0x34f5ab[_0xfbec('0x91')](_0x58de8a)){if(_0x34f5ab[_0x58de8a]&&_[_0xfbec('0x92')](_0x34f5ab[_0x58de8a])){if(_[_0xfbec('0x64')](recursiveMapAttributes,_0x58de8a)){_0x34f5ab[_0x58de8a]=this['replaceObjectAllVariables'](_0x34f5ab[_0x58de8a]);}else{_0x34f5ab[_0x58de8a]=this[_0xfbec('0x93')](_0x34f5ab[_0x58de8a]);}}}}return _0x34f5ab;};AGIVertices[_0xfbec('0xf')][_0xfbec('0x94')]=function(_0x75d152){for(var _0xf45f62 in _0x75d152){if(_0x75d152[_0xfbec('0x91')](_0xf45f62)){if(_[_0xfbec('0x95')](_0x75d152[_0xf45f62])){this[_0xfbec('0x94')](_0x75d152[_0xf45f62]);}else if(_[_0xfbec('0x96')](_0x75d152[_0xf45f62])){for(var _0x48aa4a=0x0;_0x48aa4a<_0x75d152[_0xf45f62][_0xfbec('0x97')];_0x48aa4a++){this[_0xfbec('0x94')](_0x75d152[_0xf45f62][_0x48aa4a]);}}else if(_[_0xfbec('0x92')](_0x75d152[_0xf45f62])){_0x75d152[_0xf45f62]=this['replaceAllVariables'](_0x75d152[_0xf45f62]);}}}};AGIVertices[_0xfbec('0xf')][_0xfbec('0x98')]=function(_0x329887,_0x57f234){for(var _0xed4037 in _0x329887){if(_0x329887[_0xfbec('0x91')](_0xed4037)){if(_['isPlainObject'](_0x329887[_0xed4037])){if(!_[_0xfbec('0x41')](_0x329887[_0xed4037])){this[_0xfbec('0x98')](_0x329887[_0xed4037],util[_0xfbec('0x27')](_0xfbec('0x99'),_0x57f234,_0xed4037));}}else if(_[_0xfbec('0x96')](_0x329887[_0xed4037])){for(var _0x4655e5=0x0;_0x4655e5<_0x329887[_0xed4037]['length'];_0x4655e5++){this[_0xfbec('0x98')](_0x329887[_0xed4037][_0x4655e5],util[_0xfbec('0x27')](_0xfbec('0x99'),_0x57f234,_0xed4037+'['+_0x4655e5+']'));}}else{if(!_[_0xfbec('0x42')](_0x329887[_0xed4037])){this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x99'),_0x57f234,_0xed4037),_0x329887[_0xed4037]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x311d71){try{var _0x3e2788=JSON[_0xfbec('0x65')](_0x311d71);this[_0xfbec('0x94')](_0x3e2788);return JSON[_0xfbec('0x6e')](_0x3e2788);}catch(_0xf75ced){return this[_0xfbec('0x93')](_0x311d71);}};AGIVertices[_0xfbec('0xf')][_0xfbec('0x93')]=function(_0x3e4c53){var _0x29a6a1=_0x3e4c53[_0xfbec('0x9b')]('{');for(var _0x24750e=0x1;_0x24750e<_0x29a6a1[_0xfbec('0x97')];_0x24750e+=0x1){var _0x557748=_0x29a6a1[_0x24750e][_0xfbec('0x9b')]('}');if(_0x557748['length']>0x1){_0x3e4c53=_0x3e4c53['replaceAll']('{'+_0x557748[0x0]+'}',this[_0xfbec('0x34')][_0xfbec('0x10')](_0x557748[0x0])['extra']||_0x557748[0x0]);}}if(_0x29a6a1[_0xfbec('0x97')]===0x1){return _0x3e4c53[_0xfbec('0x4a')]();}return this[_0xfbec('0x93')](_0x3e4c53);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x9c')]=function(_0x4f5021,_0x55a665){var _0x121ddf=this[_0xfbec('0x34')][_0xfbec('0x10')](_0x4f5021);if(_0x121ddf[_0xfbec('0x9d')]===-0x1){return _0x121ddf;}logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x9e'),_0x55a665,_0x121ddf[_0xfbec('0x9f')]));return this['channel'][_0xfbec('0x9a')](_0x55a665,_0x121ddf[_0xfbec('0x9f')]);};AGIVertices[_0xfbec('0xf')]['isConfigured']=function(_0x14fc6f){return _0x14fc6f&&_0x14fc6f!=='0'&&_0x14fc6f!=='-1'&&_0x14fc6f!=='';};AGIVertices[_0xfbec('0xf')]['maxRetry']=function(_0x3fc965){this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x3fc965,'-');_0x3fc965['retry']=_0x3fc965[_0xfbec('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfbec('0xf')][_0xfbec('0xa1')]=function(_0x49b2a2){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0xa2'),_0x49b2a2['label']));if(!this[_0xfbec('0x83')](_0x49b2a2['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x294d92='\x22'+_0x49b2a2[_0xfbec('0x59')]+'\x22';if(this[_0xfbec('0x83')](_0x49b2a2[_0xfbec('0x74')])){_0x294d92+=','+_0x49b2a2[_0xfbec('0x74')];}var _0x155d9b=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0xa4'),_0x294d92);if(_0x155d9b[_0xfbec('0x9d')]===-0x1){return _0x155d9b;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xa6'),_0x294d92));};AGIVertices['prototype']['mrcprecog']=function(_0x2b79db){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0xa7'),_0x2b79db[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x2b79db[_0xfbec('0xa8')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20grammar\x20configured');}var _0x41ef7a=_0x2b79db[_0xfbec('0xa8')];if(this[_0xfbec('0x83')](_0x2b79db['options'])){_0x41ef7a+=','+_0x2b79db['options'];}var _0x25cf73=this[_0xfbec('0x34')]['exec'](_0xfbec('0xa9'),_0x41ef7a);if(_0x25cf73[_0xfbec('0x9d')]===-0x1){return _0x25cf73;}var _0x36b69b=this[_0xfbec('0x9c')]('RECOG_CONFIDENCE()',_0xfbec('0xaa'));if(_0x36b69b[_0xfbec('0x9d')]===-0x1){return _0x36b69b;}var _0x4efefb=this['getAndSetVariable']('RECOG_INPUT()',_0xfbec('0xab'));if(_0x4efefb[_0xfbec('0x9d')]===-0x1){return _0x4efefb;}var _0x498c92=this[_0xfbec('0x9c')](_0xfbec('0xac'),'MRCP_RECOG_INSTANCE');if(_0x498c92[_0xfbec('0x9d')]===-0x1){return _0x498c92;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xad'),_0x41ef7a));};AGIVertices[_0xfbec('0xf')]['agi']=function(_0x4b70d0){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xae'),_0x4b70d0[_0xfbec('0x35')]));return this[_0xfbec('0x34')][_0xfbec('0x6')]([_0x4b70d0['command'],_0x4b70d0[_0xfbec('0xaf')]]);};AGIVertices[_0xfbec('0xf')]['answer']=function(_0x5ae370){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xb0'),_0x5ae370['label']));if(this[_0xfbec('0x83')](_0x5ae370[_0xfbec('0x62')])){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xb1'),_0x5ae370['timeout']));var _0x29553d=this['channel'][_0xfbec('0xb2')](_0x5ae370[_0xfbec('0x62')]);if(_0x29553d[_0xfbec('0x9d')]===-0x1){return _0x29553d;}}return this[_0xfbec('0x34')][_0xfbec('0xb3')]();};AGIVertices[_0xfbec('0xf')]['callback']=function(_0x36c116){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0xb4'),_0x36c116[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x36c116[_0xfbec('0x46')])){return this[_0xfbec('0x34')]['error'](_0x36c116,_0xfbec('0xb5'));}_0x36c116[_0xfbec('0x47')]=moment();if(this[_0xfbec('0x83')](_0x36c116[_0xfbec('0xb6')])){_0x36c116[_0xfbec('0x47')]=moment()[_0xfbec('0xb7')](_0x36c116['delay'],'minutes');}if(!this['isConfigured'](_0x36c116[_0xfbec('0x4b')])){_0x36c116[_0xfbec('0x4b')]=0x2;}this[_0xfbec('0x40')][_0xfbec('0x69')](this,_0x36c116);return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xb8'),_0x36c116['phone'],_0x36c116[_0xfbec('0x46')],_0x36c116[_0xfbec('0x47')]));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xb9')]=function(_0x412239){logger['info'](util[_0xfbec('0x27')](_0xfbec('0xba'),_0x412239[_0xfbec('0x35')]));var _0x70f5f1=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0x412239[_0xfbec('0xbb')],_0x412239['options']);if(_0x70f5f1['result']===-0x1){return _0x70f5f1;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('Executed\x20command\x20%s\x20%s',_0x412239[_0xfbec('0xbb')],_0x412239[_0xfbec('0x74')]));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xbc')]=function(_0x3fdcc4){logger['info'](util['format'](_0xfbec('0xbd'),_0x3fdcc4['label']));if(!this[_0xfbec('0x83')](_0x3fdcc4[_0xfbec('0x59')])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0xbe'));}var _0x2931fc='\x22'+_0x3fdcc4[_0xfbec('0x59')]+'\x22';if(this[_0xfbec('0x83')](_0x3fdcc4[_0xfbec('0x74')])){_0x2931fc+=','+_0x3fdcc4[_0xfbec('0x74')];}var _0xf2ffe2=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0xa4'),_0x2931fc);if(_0xf2ffe2[_0xfbec('0x9d')]===-0x1){return _0xf2ffe2;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format'](_0xfbec('0xa6'),_0x2931fc));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xbf')]=function(_0xaedd6b){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0xc0'),_0xaedd6b[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0xaedd6b['text'])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xbe'));}var _0x4ef5c8='\x22'+_0xaedd6b[_0xfbec('0x59')]+'\x22';if(this[_0xfbec('0x83')](_0xaedd6b[_0xfbec('0x74')])){_0x4ef5c8+=','+_0xaedd6b[_0xfbec('0x74')];}var _0x42b220=this[_0xfbec('0x34')][_0xfbec('0xa3')]('MRCPSynth',_0x4ef5c8);if(_0x42b220[_0xfbec('0x9d')]===-0x1){return _0x42b220;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format'](_0xfbec('0xa6'),_0x4ef5c8));};AGIVertices['prototype'][_0xfbec('0xc1')]=function(_0x11c222){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x11c222[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x11c222[_0xfbec('0xa8')])){return this['channel']['noop'](_0xfbec('0xc2'));}var _0x1f7566=_0x11c222['grammar'];if(this['isConfigured'](_0x11c222[_0xfbec('0x74')])){_0x1f7566+=','+_0x11c222['options'];}var _0x48ae48=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0xa9'),_0x1f7566);if(_0x48ae48[_0xfbec('0x9d')]===-0x1){return _0x48ae48;}var _0x2c9971=this[_0xfbec('0x9c')](_0xfbec('0xc3'),_0xfbec('0xc4'));if(_0x2c9971[_0xfbec('0x9d')]===-0x1){return _0x2c9971;}var _0x114905=this[_0xfbec('0x9c')](_0xfbec('0xc5'),_0xfbec('0xc6'));if(_0x114905['result']===-0x1){return _0x114905;}var _0x223b0f=this[_0xfbec('0x9c')]('RECOG_INSTANCE()',_0xfbec('0xc7'));if(_0x223b0f['result']===-0x1){return _0x223b0f;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1f7566));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xc8')]=function(_0x2eba26){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xc9'),_0x2eba26[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x2eba26[_0xfbec('0xa8')])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0xc2'));}var _0x5a866c=_0x2eba26[_0xfbec('0xa8')];if(this['isConfigured'](_0x2eba26[_0xfbec('0x74')])){_0x5a866c+=','+_0x2eba26[_0xfbec('0x74')];}var _0x57bd46=this[_0xfbec('0x34')][_0xfbec('0xa3')]('MRCPRecog',_0x5a866c);if(_0x57bd46[_0xfbec('0x9d')]===-0x1){return _0x57bd46;}var _0x2e4a29=this['getAndSetVariable'](_0xfbec('0xc3'),'SESTEK_ASR_CONFIDENCE');if(_0x2e4a29[_0xfbec('0x9d')]===-0x1){return _0x2e4a29;}var _0x5e75c7=this[_0xfbec('0x9c')]('RECOG_INPUT()',_0xfbec('0xca'));if(_0x5e75c7[_0xfbec('0x9d')]===-0x1){return _0x5e75c7;}var _0x37a465=this[_0xfbec('0x9c')](_0xfbec('0xac'),_0xfbec('0xcb'));if(_0x37a465[_0xfbec('0x9d')]===-0x1){return _0x37a465;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xad'),_0x5a866c));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xcc')]=function(_0x2dc9d2){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xcd'),_0x2dc9d2[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x2dc9d2[_0xfbec('0xce')])){return this['channel']['error'](_0x2dc9d2,_0xfbec('0xcf'));}var _0x2048b4=this[_0xfbec('0x17')][_0xfbec('0x69')](this,_0x2dc9d2[_0xfbec('0xce')]);if(!_0x2048b4){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x2dc9d2,_0xfbec('0xd0'));}if(!this[_0xfbec('0x83')](_0x2dc9d2['query'])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x2dc9d2,'no\x20query\x20configured');}var _0x144ae5=_0x2dc9d2[_0xfbec('0xd1')][_0xfbec('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xd2'),_0x144ae5));var _0x598f9a=this['getQueryOdbc'][_0xfbec('0x69')](this,_0x2048b4,_0x144ae5);this['createSquareDetailsReport'][_0xfbec('0x69')](this,_0x2dc9d2,_0x144ae5);if(!this[_0xfbec('0x83')](_0x2dc9d2[_0xfbec('0xd3')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xd4'));}var _0x4e7e6e=this[_0xfbec('0x10')][_0xfbec('0x69')](this,_0x2dc9d2[_0xfbec('0xd3')]);if(!_0x4e7e6e){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x2dc9d2,_0xfbec('0xd5'));}var _0x50a535=this;_0x598f9a[_0xfbec('0xd6')](function(_0x4ba450,_0x35ccdc){Object[_0xfbec('0xd7')](_0x4ba450)[_0xfbec('0xd6')](function(_0x528844){_0x50a535[_0xfbec('0x34')][_0xfbec('0x9a')](util['format'](_0xfbec('0xd8'),_0x4e7e6e,_0x35ccdc,_0x528844),_0x4ba450[_0x528844]);});});this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0xd9'),_0x4e7e6e),_0x598f9a[_0xfbec('0x97')]);return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xda'),_0x4e7e6e));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xdb')]=function(_0x1faaaf){logger[_0xfbec('0xdc')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x1faaaf[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x1faaaf[_0xfbec('0xdd')])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x1faaaf,_0xfbec('0xde'));}var _0x1a9e10=this['getUser'][_0xfbec('0x69')](this,_0x1faaaf[_0xfbec('0xdd')]);if(!_0x1a9e10){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x1faaaf,'no\x20user\x20found');}var _0x2c7bf1=this['channel'][_0xfbec('0xa3')](_0xfbec('0xdf'),[util[_0xfbec('0x27')]('SIP/%s',_0x1a9e10),_0x1faaaf['timeout'],_0x1faaaf['opts'],_0x1faaaf[_0xfbec('0x6b')]]);if(_0x2c7bf1[_0xfbec('0x9d')]===-0x1){return _0x2c7bf1;}return this[_0xfbec('0x34')]['noop'](util['format'](_0xfbec('0xe0'),'DIAL'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xe1')]=function(_0x34d0d2){logger['info'](util[_0xfbec('0x27')](_0xfbec('0xe2'),_0x34d0d2[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x34d0d2[_0xfbec('0x76')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xe3'));}if(!this[_0xfbec('0x83')](_0x34d0d2[_0xfbec('0x59')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xbe'));}this[_0xfbec('0x34')][_0xfbec('0xe4')]=!![];this[_0xfbec('0x33')](_0x34d0d2);this[_0xfbec('0x3f')](_0x34d0d2[_0xfbec('0x59')],'in','','');this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xe5'),_0x34d0d2['text']));var _0x4db5f2=this['googleDialogflow'][_0xfbec('0x69')](this,_0x34d0d2);if(_0x4db5f2){for(var _0x282db2 in _0x4db5f2){if(_0x4db5f2['hasOwnProperty'](_0x282db2)){this[_0xfbec('0x34')][_0xfbec('0x9a')](util['format'](_0xfbec('0xe6'),_0x282db2[_0xfbec('0xe7')]()),_0x4db5f2[_0x282db2]);}}this[_0xfbec('0x3f')](_0x4db5f2['speech'],_0xfbec('0xe8'),_0xfbec('0xe1'),'');return this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xe9'),_0x4db5f2[_0xfbec('0xea')]));}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x34d0d2,_0xfbec('0xeb'));};AGIVertices['prototype'][_0xfbec('0xec')]=function(_0xc86f57){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0xed'),_0xc86f57[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0xc86f57['dialogflowV2_project_id'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0xc86f57['client_email'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xee'));}if(!this[_0xfbec('0x83')](_0xc86f57['private_key'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xef'));}if(!this[_0xfbec('0x83')](_0xc86f57[_0xfbec('0xf0')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xf1'));}if(!this[_0xfbec('0x83')](_0xc86f57[_0xfbec('0x59')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xbe'));}this[_0xfbec('0x34')][_0xfbec('0xe4')]=!![];this[_0xfbec('0x33')](_0xc86f57);this[_0xfbec('0x3f')](_0xc86f57[_0xfbec('0x59')],'in','','');this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('Trying\x20DialogflowV2:\x20%s',_0xc86f57['text']));var _0x13eabc=this[_0xfbec('0x78')][_0xfbec('0x69')](this,_0xc86f57);if(_0x13eabc){for(var _0x3cd9a2 in _0x13eabc){if(_0x13eabc[_0xfbec('0x91')](_0x3cd9a2)){if(_0x3cd9a2!==_0xfbec('0xf2')){this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')]('DIALOGFLOW_%s',_0x3cd9a2['toUpperCase']()),_0x13eabc[_0x3cd9a2]);}}}this[_0xfbec('0x3f')](_0x13eabc[_0xfbec('0xea')],_0xfbec('0xe8'),'dialogflowV2',_0x13eabc['providerResponse']);return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('DialogflowV2\x20Result\x20%s',_0x13eabc[_0xfbec('0xea')]));}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0xc86f57,_0xfbec('0xf3'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xf4')]=function(_0x1a0d03){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1a0d03[_0xfbec('0x35')]));if(!this['isConfigured'](_0x1a0d03[_0xfbec('0xf5')])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0xf6'));}if(!this[_0xfbec('0x83')](_0x1a0d03['username'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20username\x20configured');}if(!this[_0xfbec('0x83')](_0x1a0d03[_0xfbec('0xf7')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xf8'));}if(!this[_0xfbec('0x83')](_0x1a0d03[_0xfbec('0xf9')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xbe'));}this[_0xfbec('0x34')][_0xfbec('0xe4')]=!![];this[_0xfbec('0x33')](_0x1a0d03);this[_0xfbec('0x3f')](_0x1a0d03[_0xfbec('0x59')],'in','','');this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xfa'),_0x1a0d03[_0xfbec('0x59')]));var _0x54a012=this[_0xfbec('0x7c')][_0xfbec('0x69')](this,_0x1a0d03);if(_0x54a012){for(var _0x1381c0 in _0x54a012){if(_0x54a012['hasOwnProperty'](_0x1381c0)){this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')]('SESTEK_NDA_%s',_0x1381c0[_0xfbec('0xe7')]()),_0x54a012[_0x1381c0]);}}this[_0xfbec('0x3f')](_0x54a012['speech'],_0xfbec('0xe8'),_0xfbec('0xf4'),'');if(_0x54a012[_0xfbec('0xfb')]){this[_0xfbec('0x34')]['noop'](util['format'](_0xfbec('0xfc'),_0x54a012[_0xfbec('0xfb')]));var _0x353307=this[_0xfbec('0x34')][_0xfbec('0xfd')](_0x54a012['audiofile']);try{fs[_0xfbec('0xfe')](_0x54a012[_0xfbec('0xfb')]+'.wav');}catch(_0x514299){logger[_0xfbec('0x2b')](_0x514299);}return _0x353307;}else{return this['channel']['noop'](util[_0xfbec('0x27')](_0xfbec('0xff'),_0x54a012[_0xfbec('0xea')]));}}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x1a0d03,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xfbec('0xf')]['end']=function(_0xc7613e){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x100'),_0xc7613e[_0xfbec('0x35')]));return this[_0xfbec('0x34')]['noop'](_0xfbec('0x101'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x102')]=function(_0x48b4f8){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x103'),_0x48b4f8[_0xfbec('0x35')]));var _0x408c1d='';if(_0x48b4f8[_0xfbec('0x104')]){if(!this[_0xfbec('0x83')](_0x48b4f8[_0xfbec('0x104')])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x48b4f8,_0xfbec('0x105'));}else{var _0x37c42f=parseInt(_0x48b4f8[_0xfbec('0x104')],0xa);if(isNaN(_0x37c42f)){_0x408c1d=_0x48b4f8[_0xfbec('0x104')];}else{_0x408c1d=this[_0xfbec('0x1b')][_0xfbec('0x69')](this,_0x48b4f8[_0xfbec('0x104')]);if(!_0x408c1d){return this[_0xfbec('0x34')]['error'](_0x48b4f8,_0xfbec('0x106'));}}}}else if(_0x48b4f8['trunk_name']){_0x408c1d=_0x48b4f8[_0xfbec('0x107')];}else{return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x48b4f8,_0xfbec('0x105'));}var _0x1801ed=this[_0xfbec('0x34')]['exec'](_0xfbec('0xdf'),[util[_0xfbec('0x27')](_0xfbec('0x108'),_0x408c1d,_0x48b4f8[_0xfbec('0x109')]),_0x48b4f8[_0xfbec('0x62')],_0x48b4f8['opts'],_0x48b4f8[_0xfbec('0x6b')]]);if(_0x1801ed['result']===-0x1){return _0x1801ed;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0xe0'),'DIAL'));};AGIVertices['prototype'][_0xfbec('0x10a')]=function(_0x21c8db){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x10b'),_0x21c8db[_0xfbec('0x35')]));return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x10a'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0xd')]=function(_0x1d8ecd){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1d8ecd[_0xfbec('0x35')]));if(_0x1d8ecd[_0xfbec('0x10c')]===0x0){return this['maxRetry'](_0x1d8ecd);}_0x1d8ecd[_0xfbec('0x10c')]-=0x1;if(!this[_0xfbec('0x83')](_0x1d8ecd[_0xfbec('0x10d')])){return this['channel'][_0xfbec('0x2b')](_0x1d8ecd,'no\x20file\x20audio\x20selected');}var _0xbba849=this[_0xfbec('0x10e')][_0xfbec('0x69')](this,_0x1d8ecd[_0xfbec('0x10d')]);if(!_0xbba849){return this[_0xfbec('0x34')]['error'](_0x1d8ecd,_0xfbec('0x10f'));}if(!this['isConfigured'](_0x1d8ecd[_0xfbec('0xd3')])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0xfbec('0xd4'));}var _0x1abfb3=this['channel'][_0xfbec('0x110')](_0xbba849,_0x1d8ecd[_0xfbec('0x111')],_0x1d8ecd[_0xfbec('0x112')]);var _0x260b27=_0x1abfb3[_0xfbec('0x9d')]?_0x1abfb3['result']['toString']():'';logger[_0xfbec('0x2c')](_0xfbec('0x113'),JSON[_0xfbec('0x6e')](_0x1abfb3));if(_0x1abfb3[_0xfbec('0x9d')]===-0x1){this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x1d8ecd,_0x260b27);return _0x1abfb3;}else if(_0x1abfb3[_0xfbec('0x9f')]===_0xfbec('0x62')){_0x1abfb3[_0xfbec('0x9d')]=_0x260b27[_0xfbec('0x97')]>=parseInt(_0x1d8ecd[_0xfbec('0x114')])?'x':'i';}else{_0x1abfb3[_0xfbec('0x9d')]=_0x260b27['length']>=parseInt(_0x1d8ecd['mindigit'])&&_0x260b27[_0xfbec('0x97')]<=parseInt(_0x1d8ecd[_0xfbec('0x112')])?'x':'i';}var _0x115367=this['getVariable'][_0xfbec('0x69')](this,_0x1d8ecd['variable_id']);if(!_0x115367){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x1d8ecd,'no\x20variable\x20found');}this['channel'][_0xfbec('0x9a')](_0x115367,_0x260b27);if(this[_0xfbec('0x83')](_0x1d8ecd[_0xfbec('0x115')])){var _0x36d6cb=parseInt(_0x1d8ecd['hiddendigitsnum'],0xa);var _0x46f843=rs[_0xfbec('0x116')]({'charset':'*','length':_0x36d6cb});var _0x5033c2=_0x260b27[_0xfbec('0x97')];if(_0x5033c2>0x0){if(_0x5033c2>_0x36d6cb){this[_0xfbec('0x33')]['sync'](this,_0x1d8ecd,_0x1d8ecd[_0xfbec('0x117')]===_0xfbec('0x118')?_0x46f843+_0x260b27[_0xfbec('0x119')](_0x36d6cb):_0x260b27[_0xfbec('0x119')](0x0,_0x5033c2-_0x36d6cb)+_0x46f843);}else{this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x1d8ecd,rs['generate']({'charset':'*','length':_0x5033c2}));}}else{this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x1d8ecd,'');}}else{this[_0xfbec('0x33')]['sync'](this,_0x1d8ecd,_0x260b27);}return _0x1abfb3;};AGIVertices[_0xfbec('0xf')][_0xfbec('0xe')]=function(_0x4a649e){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x11a'),_0x4a649e[_0xfbec('0x35')]));return this[_0xfbec('0xd')](_0x4a649e);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x11b')]=function(_0x36d655){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x36d655[_0xfbec('0x35')]));this[_0xfbec('0x33')]['sync'](this,_0x36d655,_0x36d655['goalname']);return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x11c'),_0x36d655['goalname']));};AGIVertices[_0xfbec('0xf')]['awspolly']=function(_0x5dc1d3){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x11d'),_0x5dc1d3[_0xfbec('0x35')]));if(!this['isConfigured'](_0x5dc1d3[_0xfbec('0x86')])||!this['isConfigured'](_0x5dc1d3[_0xfbec('0x87')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x5dc1d3[_0xfbec('0x59')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xbe'));}this['channel']['noop'](util[_0xfbec('0x27')](_0xfbec('0x11e'),_0x5dc1d3[_0xfbec('0x59')]));var _0x1db5a3=this[_0xfbec('0x85')][_0xfbec('0x69')](this,_0x5dc1d3);if(_0x1db5a3){this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x1db5a3));var _0x220af9=this['channel'][_0xfbec('0xfd')](_0x1db5a3);try{fs['unlink'](_0x1db5a3+'.wav');}catch(_0x192bf0){logger[_0xfbec('0x2b')](_0x192bf0);}return _0x220af9;}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x5dc1d3,_0xfbec('0x11f'));};AGIVertices['prototype'][_0xfbec('0x120')]=function(_0xeef111){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x121'),_0xeef111[_0xfbec('0x35')]));if(!this['isConfigured'](_0xeef111[_0xfbec('0x86')])||!this[_0xfbec('0x83')](_0xeef111[_0xfbec('0x87')])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0x122'));}if(!this[_0xfbec('0x83')](_0xeef111[_0xfbec('0x123')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20bot\x20name\x20configured');}if(!this[_0xfbec('0x83')](_0xeef111[_0xfbec('0x59')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20text\x20configured');}this[_0xfbec('0x34')]['bot']=!![];this[_0xfbec('0x33')](_0xeef111);this[_0xfbec('0x3f')](_0xeef111[_0xfbec('0x59')],'in','','');this[_0xfbec('0x34')]['noop'](util[_0xfbec('0x27')](_0xfbec('0x124'),_0xeef111[_0xfbec('0x59')]));var _0x4b85e4=this[_0xfbec('0x8b')][_0xfbec('0x69')](this,_0xeef111);if(_0x4b85e4){for(var _0x4ab630 in _0x4b85e4){if(_0x4b85e4[_0xfbec('0x91')](_0x4ab630)&&_[_0xfbec('0x92')](_0x4b85e4[_0x4ab630])){this['channel']['setVariable'](util[_0xfbec('0x27')](_0xfbec('0x125'),_0x4ab630[_0xfbec('0xe7')]()),_0x4b85e4[_0x4ab630]);}}if(_[_0xfbec('0x42')](_0x4b85e4[_0xfbec('0x72')])){return this['channel'][_0xfbec('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xfbec('0x3f')](_0x4b85e4['message'],_0xfbec('0xe8'),_0xfbec('0x126'),'');return this['channel'][_0xfbec('0xa5')](util['format'](_0xfbec('0x127'),_0x4b85e4['message']));}}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0xeef111,_0xfbec('0x128'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x129')]=function(_0x55465c){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x12a'),_0x55465c['label'],_0x55465c[_0xfbec('0x62')]));if(!this['isConfigured'](_0x55465c['key'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20key\x20configured');}var _0x24933d=_0xfbec('0x12b');var _0xb8404e=util[_0xfbec('0x27')](_0xfbec('0x12c'),FILES_PATH,rs[_0xfbec('0x116')](0x4));var _0x4a67b0=util[_0xfbec('0x27')](_0xfbec('0x99'),_0xb8404e,_0x24933d);var _0x273111=!![];if(_0x55465c[_0xfbec('0x12d')]===_0xfbec('0x12e')){_0x273111=![];}var _0x156992=this[_0xfbec('0x34')]['recordFile'](_0xb8404e,_0x24933d,_0x55465c[_0xfbec('0x12f')],_0x55465c[_0xfbec('0x62')],undefined,_0x273111);if(_0x156992['result']!==-0x1){this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format'](_0xfbec('0x130'),_0x4a67b0));var _0x496b66=this[_0xfbec('0x8d')][_0xfbec('0x69')](this,_0x55465c,_0x4a67b0);if(_0x496b66){for(var _0x2efa4d in _0x496b66){if(_0x496b66[_0xfbec('0x91')](_0x2efa4d)){this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x131'),_0x2efa4d[_0xfbec('0xe7')]()),_0x496b66[_0x2efa4d]);}}return this[_0xfbec('0x34')]['noop'](util['format'](_0xfbec('0x132'),JSON[_0xfbec('0x6e')](_0x496b66)));}}return _0x156992;};AGIVertices[_0xfbec('0xf')][_0xfbec('0x133')]=function(_0x4ee7c7){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x134'),_0x4ee7c7[_0xfbec('0x35')]));if(!this['isConfigured'](_0x4ee7c7[_0xfbec('0x135')])){return this['channel']['noop'](_0xfbec('0x136'));}if(!this[_0xfbec('0x83')](_0x4ee7c7[_0xfbec('0x137')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20appsecret\x20configured');}var _0x4f890f='wav';var _0x2d2098=util[_0xfbec('0x27')](_0xfbec('0x12c'),FILES_PATH,rs['generate'](0x4));var _0xaa83e2=util[_0xfbec('0x27')](_0xfbec('0x99'),_0x2d2098,_0x4f890f);var _0x43e0ed=!![];if(_0x4ee7c7[_0xfbec('0x12d')]===_0xfbec('0x12e')){_0x43e0ed=![];}var _0x3837e1=this[_0xfbec('0x34')]['recordFile'](_0x2d2098,_0x4f890f,_0x4ee7c7[_0xfbec('0x12f')],_0x4ee7c7[_0xfbec('0x62')],undefined,_0x43e0ed);if(_0x3837e1[_0xfbec('0x9d')]!==-0x1){this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x138'),_0xaa83e2));var _0x502b0d=this[_0xfbec('0x8e')][_0xfbec('0x69')](this,_0x4ee7c7,_0xaa83e2);if(_0x502b0d){for(var _0x5f3092 in _0x502b0d){if(_0x502b0d[_0xfbec('0x91')](_0x5f3092)){this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x139'),_0x5f3092[_0xfbec('0xe7')]()),_0x502b0d[_0x5f3092]);}}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format'](_0xfbec('0x13a'),JSON[_0xfbec('0x6e')](_0x502b0d)));}}return _0x3837e1;};AGIVertices[_0xfbec('0xf')][_0xfbec('0x13b')]=function(_0x5b05b2){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x13c'),_0x5b05b2[_0xfbec('0x35')]));return this[_0xfbec('0x34')]['continueAt'](_0x5b05b2['context'],_0x5b05b2[_0xfbec('0x13d')],_0x5b05b2['priority']);};AGIVertices[_0xfbec('0xf')]['gotoif']=function(_0x290f2c){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x13e'),_0x290f2c['label']));if(!this[_0xfbec('0x83')](_0x290f2c[_0xfbec('0x13f')])){return this[_0xfbec('0x34')]['error'](_0x290f2c,_0xfbec('0x140'));}try{var _0x10cceb=eval(_0x290f2c['condition'])?_0xfbec('0x141'):_0xfbec('0x142');this[_0xfbec('0x34')]['noop'](util[_0xfbec('0x27')](_0xfbec('0x143'),_0x290f2c['condition'],_0x10cceb));return{'code':0xc8,'result':_0x10cceb};}catch(_0x591d52){return{'code':0xc8,'result':_0xfbec('0x142')};}};AGIVertices['prototype'][_0xfbec('0x144')]=function(_0x40045f){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x145'),_0x40045f['label']));if(!this[_0xfbec('0x83')](_0x40045f[_0xfbec('0x146')])){return this['channel'][_0xfbec('0x2b')](_0x40045f,'no\x20interval\x20configured');}var _0x264fae=this[_0xfbec('0x22')]['sync'](this,_0x40045f[_0xfbec('0x146')]);if(!_0x264fae){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x40045f,'no\x20intervals\x20found');}for(var _0x45a087=0x0;_0x45a087<_0x264fae[_0xfbec('0x97')];_0x45a087+=0x1){var _0xd22947=this[_0xfbec('0x34')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x264fae[_0x45a087]));if(_0xd22947['result']===-0x1){return _0xd22947;}logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x147'),_0x264fae[_0x45a087],_0xd22947[_0xfbec('0x9f')]));if(_0xd22947[_0xfbec('0x9f')]==='true'){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x147'),_0x264fae[_0x45a087],_0xfbec('0x141')));this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('IFTIME\x20%s\x20%s',_0x264fae[_0x45a087],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x147'),_0x264fae[_0x45a087],_0xfbec('0x142')));this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x147'),_0x264fae[_0x45a087],_0xfbec('0x142')));}}return{'code':0xc8,'result':_0xfbec('0x142')};};AGIVertices[_0xfbec('0xf')][_0xfbec('0x148')]=function(_0x587f83){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x149'),_0x587f83[_0xfbec('0x35')]));return this[_0xfbec('0x34')]['hangup']();};AGIVertices[_0xfbec('0xf')][_0xfbec('0x14a')]=function(_0x42fee9){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x42fee9['label']));if(!this[_0xfbec('0x83')](_0x42fee9[_0xfbec('0x76')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xe3'));}var _0x17ce2b='wav';var _0x38403b=util[_0xfbec('0x27')](_0xfbec('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x2630ba=util[_0xfbec('0x27')](_0xfbec('0x99'),_0x38403b,_0x17ce2b);var _0x89a6b7=!![];if(_0x42fee9[_0xfbec('0x12d')]===_0xfbec('0x12e')){_0x89a6b7=![];}var _0x16727b=this['channel'][_0xfbec('0x14b')](_0x38403b,_0x17ce2b,_0x42fee9[_0xfbec('0x12f')],_0x42fee9['timeout'],undefined,_0x89a6b7);if(_0x16727b[_0xfbec('0x9d')]!==-0x1){this[_0xfbec('0x34')]['noop'](util['format'](_0xfbec('0x14c'),_0x2630ba));var _0x5b8e97=this[_0xfbec('0x81')][_0xfbec('0x69')](this,_0x42fee9,_0x2630ba);if(_0x5b8e97){for(var _0xee5c93 in _0x5b8e97){if(_0x5b8e97[_0xfbec('0x91')](_0xee5c93)){this[_0xfbec('0x34')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0xee5c93[_0xfbec('0xe7')]()),_0x5b8e97[_0xee5c93]);}}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x14d'),JSON[_0xfbec('0x6e')](_0x5b8e97)));}}return _0x16727b;};AGIVertices[_0xfbec('0xf')]['ispeechtts']=function(_0x5a2372){logger['info'](util['format'](_0xfbec('0x14e'),_0x5a2372[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x5a2372[_0xfbec('0x76')])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0xe3'));}if(!this[_0xfbec('0x83')](_0x5a2372[_0xfbec('0x59')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xbe'));}this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x14f'),_0x5a2372[_0xfbec('0x59')]));var _0xd9d6ae=this[_0xfbec('0x7d')][_0xfbec('0x69')](this,_0x5a2372);if(_0xd9d6ae){this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x14c'),_0xd9d6ae));var _0x583afe=this['channel'][_0xfbec('0xfd')](_0xd9d6ae,_0x5a2372['intKey']);try{fs[_0xfbec('0xfe')](_0xd9d6ae+_0xfbec('0x150'));}catch(_0x57f096){logger[_0xfbec('0x2b')](_0x57f096);}return _0x583afe;}return this[_0xfbec('0x34')]['error'](_0x5a2372,_0xfbec('0x151'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x152')]=function(_0x42b0c2){logger[_0xfbec('0x2c')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x42b0c2[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x42b0c2['findBy'])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x42b0c2,'no\x20find\x20by\x20configured');}logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x153'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x42b0c2[_0xfbec('0x154')]));var _0x26e5c4=this['agentLogin'][_0xfbec('0x69')](this,_0x42b0c2[_0xfbec('0x154')]);if(_0x26e5c4){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x155'),this['channel'][_0xfbec('0x36')],_0x42b0c2[_0xfbec('0x154')]));this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x155'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x42b0c2[_0xfbec('0x154')]));return{'code':0xc8,'result':_0xfbec('0x156')};}else{logger['info'](util[_0xfbec('0x27')](_0xfbec('0x157'),this['channel'][_0xfbec('0x36')],_0x42b0c2[_0xfbec('0x154')]));this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbec('0x34')]['callerid'],_0x42b0c2[_0xfbec('0x154')]));return{'code':0xc8,'result':_0xfbec('0x158')};}};AGIVertices[_0xfbec('0xf')][_0xfbec('0x159')]=function(_0x43451d){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x15a'),_0x43451d[_0xfbec('0x35')]));if(!this['isConfigured'](_0x43451d['findBy'])){return this['channel'][_0xfbec('0x2b')](_0x43451d,_0xfbec('0x15b'));}logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x153'),this[_0xfbec('0x34')]['callerid'],_0x43451d['findBy']));var _0x4aec75=this[_0xfbec('0x50')][_0xfbec('0x69')](this,_0x43451d['findBy']);if(_0x4aec75){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfbec('0x34')][_0xfbec('0x36')],_0x43451d[_0xfbec('0x154')]));this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x155'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x43451d['findBy']));return{'code':0xc8,'result':_0xfbec('0x156')};}else{logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x157'),this['channel'][_0xfbec('0x36')],_0x43451d['findBy']));this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x157'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x43451d[_0xfbec('0x154')]));return{'code':0xc8,'result':_0xfbec('0x158')};}};AGIVertices[_0xfbec('0xf')][_0xfbec('0x15c')]=function(_0x44b3f5){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x44b3f5['label']));if(!this['isConfigured'](_0x44b3f5['operation'])){return this['channel'][_0xfbec('0x2b')](_0x44b3f5,_0xfbec('0x15d'));}this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x15e'),_0x44b3f5['operation']));var _0x56e923=eval(_0x44b3f5[_0xfbec('0x15f')]);if(!this['isConfigured'](_0x44b3f5[_0xfbec('0xd3')])){return this[_0xfbec('0x34')]['noop'](_0xfbec('0xd4'));}var _0x2acf61=this['getVariable'][_0xfbec('0x69')](this,_0x44b3f5[_0xfbec('0xd3')]);if(!_0x2acf61){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x44b3f5,'no\x20variable\x20found');}if(_[_0xfbec('0x96')](_0x56e923)){var _0x34f60e=this;_0x56e923['forEach'](function(_0x1b1f8e,_0x300612){_0x34f60e[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x160'),_0x2acf61,_0x300612),_0x1b1f8e);});return this[_0xfbec('0x34')]['noop'](util['format']('variable\x20%s[key]\x20set',_0x2acf61));}else{return this[_0xfbec('0x34')]['setVariable'](_0x2acf61,_0x56e923);}};AGIVertices['prototype'][_0xfbec('0xc')]=function(_0x2e26a5){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2e26a5[_0xfbec('0x35')]));if(_0x2e26a5[_0xfbec('0x10c')]===0x0){return this['maxRetry'](_0x2e26a5);}_0x2e26a5['retry']-=0x1;if(!this[_0xfbec('0x83')](_0x2e26a5[_0xfbec('0x10d')])){return this['channel']['error'](_0x2e26a5,_0xfbec('0x161'));}var _0x4ec8d5=this[_0xfbec('0x10e')][_0xfbec('0x69')](this,_0x2e26a5['file_id']);if(!_0x4ec8d5){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x2e26a5,'no\x20file\x20audio\x20found');}var _0x4adad4=this['channel'][_0xfbec('0x110')](_0x4ec8d5,_0x2e26a5[_0xfbec('0x111')],_0x2e26a5[_0xfbec('0x162')]);var _0xae3e58=_0x4adad4[_0xfbec('0x9d')];if(_0x4adad4[_0xfbec('0x9d')]===-0x1){this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x2e26a5,'-1');return _0x4adad4;}else if(_0x4adad4['extra']==='timeout'){_0x4adad4[_0xfbec('0x9d')]=_0x4adad4[_0xfbec('0x9d')][_0xfbec('0x97')]>0x0?_0x4adad4[_0xfbec('0x9d')]:'t';}else if(_[_0xfbec('0x41')](_0x4adad4[_0xfbec('0x9d')])){_0x4adad4[_0xfbec('0x9d')]='#';_0xae3e58='#';}if(!this[_0xfbec('0x83')](_0x2e26a5[_0xfbec('0xd3')])){this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0xd4'));}else{var _0x31b8e0=this[_0xfbec('0x10')][_0xfbec('0x69')](this,_0x2e26a5[_0xfbec('0xd3')]);if(!_0x31b8e0){return this['channel'][_0xfbec('0x2b')](_0x2e26a5,_0xfbec('0xd5'));}this[_0xfbec('0x34')][_0xfbec('0x9a')](_0x31b8e0,_0xae3e58);}this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x2e26a5,_0xae3e58);return _0x4adad4;};AGIVertices['prototype'][_0xfbec('0xa5')]=function(_0x34f07d){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x163'),_0x34f07d[_0xfbec('0x35')]));return this['channel'][_0xfbec('0xa5')](_0x34f07d[_0xfbec('0x164')]||_0x34f07d[_0xfbec('0x35')]);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x165')]=function(_0x59113f){logger['info'](util['format'](_0xfbec('0x166'),_0x59113f[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x59113f[_0xfbec('0x154')])){return this['channel'][_0xfbec('0x2b')](_0x59113f,'no\x20find\x20by\x20configured');}logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x153'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x59113f[_0xfbec('0x154')]));var _0x500856=this[_0xfbec('0x167')]['sync'](this,_0x59113f[_0xfbec('0x168')]);var _0x211894=this[_0xfbec('0x4d')][_0xfbec('0x69')](this,_0x59113f[_0xfbec('0x154')],_0x500856);if(_0x211894){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x155'),this[_0xfbec('0x34')]['callerid'],_0x59113f[_0xfbec('0x154')]));this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfbec('0x34')]['callerid'],_0x59113f['findBy']));return{'code':0xc8,'result':_0xfbec('0x156')};}else{logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbec('0x34')]['callerid'],_0x59113f[_0xfbec('0x154')]));this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xfbec('0x36')],_0x59113f['findBy']));return{'code':0xc8,'result':_0xfbec('0x158')};}};AGIVertices['prototype']['playback']=function(_0x28cce8){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x169'),_0x28cce8['label']));if(!this[_0xfbec('0x83')](_0x28cce8[_0xfbec('0x10d')])){return this[_0xfbec('0x34')]['error'](_0x28cce8,'no\x20file\x20audio\x20selected');}var _0x10b436=this['getSound'][_0xfbec('0x69')](this,_0x28cce8[_0xfbec('0x10d')]);if(!_0x10b436){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x28cce8,_0xfbec('0x10f'));}var _0x1867ec=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0x16a'),[_0x10b436,_0x28cce8[_0xfbec('0x16b')]]);if(_0x1867ec[_0xfbec('0x9d')]===-0x1){return _0x1867ec;}return this[_0xfbec('0x34')]['noop'](util[_0xfbec('0x27')](_0xfbec('0x16c'),'PLAYBACK',_0x10b436));};AGIVertices['prototype'][_0xfbec('0x16d')]=function(_0x7ecc45){logger[_0xfbec('0x2c')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x7ecc45[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x7ecc45[_0xfbec('0x16e')])){return this[_0xfbec('0x34')]['error'](_0x7ecc45,_0xfbec('0x16f'));}var _0x26d997='';var _0x3d857f=parseInt(_0x7ecc45[_0xfbec('0x16e')],0xa);if(isNaN(_0x3d857f)){_0x26d997=_0x7ecc45[_0xfbec('0x16e')];}else{_0x26d997=this[_0xfbec('0x15')][_0xfbec('0x69')](this,_0x7ecc45[_0xfbec('0x16e')]);if(!_0x26d997){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x7ecc45,_0xfbec('0x170'));}}var _0x4d0bdc='';if(this[_0xfbec('0x83')](_0x7ecc45[_0xfbec('0x10d')])){var _0x4fb182=this[_0xfbec('0x10e')]['sync'](this,_0x7ecc45['file_id']);if(_0x4fb182){_0x4d0bdc=_0x4fb182;}}this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x7ecc45,_0x26d997);if(_0x7ecc45[_0xfbec('0x16b')][_0xfbec('0x171')]('x')<0x0){_0x7ecc45[_0xfbec('0x16b')]+='x';}if(_0x7ecc45[_0xfbec('0x16b')][_0xfbec('0x171')]('X')<0x0){_0x7ecc45['opts']+='X';}this[_0xfbec('0x34')][_0xfbec('0x9a')](_0xfbec('0x172'),_0x26d997?_0x26d997[_0xfbec('0x173')]():'');var _0x4c7dc4=this['channel']['exec'](_0xfbec('0x174'),[_0x26d997,_0x7ecc45['opts'],_0x7ecc45['url'],_0x4d0bdc,_0x7ecc45['timeout'],_0x7ecc45['agi'],_0x7ecc45[_0xfbec('0x175')],_0x7ecc45[_0xfbec('0x176')],'',_0x7ecc45[_0xfbec('0x177')]]);if(_0x4c7dc4['result']===-0x1){return _0x4c7dc4;}return this[_0xfbec('0x34')]['noop'](util[_0xfbec('0x27')](_0xfbec('0x16c'),_0xfbec('0x174'),_0x26d997));};AGIVertices[_0xfbec('0xf')]['record']=function(_0x2fba25){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x178'),_0x2fba25[_0xfbec('0x35')]));var _0x1a0dc5=_0x2fba25[_0xfbec('0x179')]||_0xfbec('0x12b');var _0x477143=util['format'](_0xfbec('0x17a'),this[_0xfbec('0x34')][_0xfbec('0x38')],rs[_0xfbec('0x116')](0x5));var _0x317021=util[_0xfbec('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x477143,_0x1a0dc5);var _0x361d85=util['format'](_0xfbec('0x12c'),FILES_PATH,_0x477143);this['createSquareRecording'][_0xfbec('0x69')](this,_0x2fba25,_0x477143,_0x317021);this['channel'][_0xfbec('0x9a')](_0xfbec('0x17b'),_0x477143);logger[_0xfbec('0x2c')](_0xfbec('0x17c'),_0x361d85,_0x1a0dc5,_0x2fba25[_0xfbec('0x17d')],_0x2fba25[_0xfbec('0x62')]);return this[_0xfbec('0x34')][_0xfbec('0x14b')](_0x361d85,_0x1a0dc5,_0x2fba25[_0xfbec('0x17d')],_0x2fba25[_0xfbec('0x62')],undefined,!![]);};AGIVertices[_0xfbec('0xf')]['restapi']=function(_0x86c268){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x17e'),_0x86c268['label']));if(!this[_0xfbec('0x83')](_0x86c268[_0xfbec('0x6b')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')]('no\x20url\x20configured');}var _0xbdd1a1=this[_0xfbec('0x60')][_0xfbec('0x69')](this,_0x86c268);logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x17f'),util['inspect'](_0xbdd1a1,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x86c268['variable_id'])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x180'));}var _0x229a57=this['getVariable'][_0xfbec('0x69')](this,_0x86c268['variable_id']);if(!_0x229a57){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x86c268,_0xfbec('0xd5'));}this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x181'),_0x229a57),_0xbdd1a1[_0xfbec('0x70')]?_0xbdd1a1[_0xfbec('0x70')]:_0xfbec('0x182'));this[_0xfbec('0x34')][_0xfbec('0x9a')](util[_0xfbec('0x27')](_0xfbec('0x183'),_0x229a57),_0xbdd1a1[_0xfbec('0x71')]?_0xbdd1a1[_0xfbec('0x71')]:'OK');if(_0xbdd1a1[_0xfbec('0x6d')]){try{this[_0xfbec('0x98')](_0xbdd1a1[_0xfbec('0x6d')],_0x229a57);}catch(_0x5af146){logger['error'](util[_0xfbec('0x27')](_0xfbec('0x184'),_0x229a57));}}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('variable\x20%s\x20set',_0x229a57));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x185')]=function(_0x5543f9){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5543f9[_0xfbec('0x35')]));return this[_0xfbec('0x34')][_0xfbec('0x186')](_0x5543f9[_0xfbec('0x187')][_0xfbec('0x56')](/\s+/g,''),_0x5543f9[_0xfbec('0x17d')]);};AGIVertices[_0xfbec('0xf')]['saynumber']=function(_0x5bbe68){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x188'),_0x5bbe68['label']));return this['channel'][_0xfbec('0x189')](_0x5bbe68[_0xfbec('0x63')][_0xfbec('0x56')](/\s+/g,''),_0x5bbe68['escape_digits']);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x18a')]=function(_0x288bbe){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x18b'),_0x288bbe[_0xfbec('0x35')]));return this['channel']['sayPhonetic'](_0x288bbe[_0xfbec('0x59')],_0x288bbe['escape_digits']);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x18c')]=function(_0x2a90a9){logger['info'](util[_0xfbec('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2a90a9[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x2a90a9[_0xfbec('0x18d')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x18e'));}var _0x4002a6=this[_0xfbec('0x1f')][_0xfbec('0x69')](this,_0x2a90a9[_0xfbec('0x18d')]);if(!_0x4002a6||!_0x4002a6[_0xfbec('0x18f')]){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x2a90a9,_0xfbec('0x190'));}var _0xde48ad={'from':util[_0xfbec('0x27')]('\x22%s\x22\x20<%s>',_0x4002a6[_0xfbec('0x13')],_0x4002a6[_0xfbec('0x191')]||_0x4002a6['Smtp'][_0xfbec('0x192')]),'to':_0x2a90a9['to']||'','cc':_0x2a90a9['cc']||'','bcc':_0x2a90a9[_0xfbec('0x193')]||'','subject':_0x2a90a9[_0xfbec('0x194')],'html':_0x2a90a9[_0xfbec('0x59')],'text':_0x2a90a9['text']};if(this['isConfigured'](_0x2a90a9[_0xfbec('0x195')])){}logger[_0xfbec('0xdc')](_0xfbec('0x196'),JSON[_0xfbec('0x6e')](_0xde48ad));this[_0xfbec('0x33')]['sync'](this,_0x2a90a9,_0x2a90a9['account_id']);this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x4002a6[_0xfbec('0x13')]));this[_0xfbec('0x21')]['sync'](this,_0x4002a6[_0xfbec('0x197')],_0xde48ad);return this['channel'][_0xfbec('0xa5')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfbec('0x198')]=function(_0xbb91c2){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x199'),_0xbb91c2[_0xfbec('0x35')]));return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x19a'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x19b')]=function(_0x811bac){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x19c'),_0x811bac[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x811bac[_0xfbec('0x19d')])){return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x19e'));}var _0x26a4ad=this['getSmsAccount'][_0xfbec('0x69')](this,_0x811bac[_0xfbec('0x19d')]);if(!_0x26a4ad){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x811bac,_0xfbec('0x19f'));}var _0x1f9146={'body':_0x811bac[_0xfbec('0x1a0')],'phone':_0x811bac['to']||'','SmsAccountId':_0x26a4ad['id']};logger[_0xfbec('0xdc')](_0xfbec('0x1a1'),JSON[_0xfbec('0x6e')](_0x1f9146));this['createSquareDetailsReport'][_0xfbec('0x69')](this,_0x811bac,_0x811bac[_0xfbec('0x19d')]);this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x26a4ad[_0xfbec('0x13')]));this[_0xfbec('0x32')]['sync'](this,_0x1f9146);return this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x1a2'));};AGIVertices['prototype'][_0xfbec('0x1a3')]=function(_0x14ebdb){logger['info'](util['format'](_0xfbec('0x1a4'),_0x14ebdb[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x14ebdb[_0xfbec('0xd3')])){return this['channel']['error'](_0x14ebdb,'no\x20variable\x20selected');}var _0x4d9316=this[_0xfbec('0x10')][_0xfbec('0x69')](this,_0x14ebdb[_0xfbec('0xd3')]);if(!_0x4d9316){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x14ebdb,_0xfbec('0xd5'));}return this[_0xfbec('0x34')]['setVariable'](_0x4d9316,_0x14ebdb[_0xfbec('0x1a5')]);};AGIVertices[_0xfbec('0xf')][_0xfbec('0x1a6')]=function(_0x416e17){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x1a7'),_0x416e17[_0xfbec('0x35')]));this[_0xfbec('0x34')][_0xfbec('0xa5')]('START\x20CALLY\x20SQUARE');if(_0x416e17[_0xfbec('0xb3')]==='yes'){this[_0xfbec('0x34')][_0xfbec('0xa5')](_0xfbec('0x1a8'));return this[_0xfbec('0x34')]['answer']();}return this['channel'][_0xfbec('0xa5')](_0xfbec('0x1a9'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x1aa')]=function(_0x405d2a){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x1ab'),_0x405d2a['label']));if(!this[_0xfbec('0x83')](_0x405d2a[_0xfbec('0x1ac')])){return this[_0xfbec('0x34')]['error'](_0x405d2a,_0xfbec('0x1ad'));}var _0x33d05b=this['getSquareProject'][_0xfbec('0x69')](this,_0x405d2a[_0xfbec('0x1ac')]);if(!this[_0xfbec('0x83')](_0x33d05b)){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x405d2a,util[_0xfbec('0x27')](_0xfbec('0x1ae'),_0x405d2a[_0xfbec('0x1ac')]));}if(_0x33d05b===this['channel']['arg_1']){return this['channel'][_0xfbec('0x2b')](_0x405d2a,_0xfbec('0x1af'));}this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x405d2a,_0x33d05b);var _0x769fd4=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0x1b0'),util[_0xfbec('0x27')](_0xfbec('0x1b1'),config[_0xfbec('0x6')][_0xfbec('0x1b2')]||_0xfbec('0x1b3'),_0x33d05b,this[_0xfbec('0x34')][_0xfbec('0x3d')]));if(_0x769fd4[_0xfbec('0x9d')]===-0x1){return _0x769fd4;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x16c'),_0xfbec('0x1b0'),_0x33d05b));};AGIVertices[_0xfbec('0xf')]['system']=function(_0x3e4de2){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x1b4'),_0x3e4de2[_0xfbec('0x35')]));var _0x12fcf6=this[_0xfbec('0x55')][_0xfbec('0x69')](this,_0x3e4de2[_0xfbec('0x1b5')]);this[_0xfbec('0x33')][_0xfbec('0x69')](this,_0x3e4de2,_0x3e4de2[_0xfbec('0x1b5')]);if(this[_0xfbec('0x83')](_0x3e4de2[_0xfbec('0xd3')])){var _0x471bbb=this['getVariable'][_0xfbec('0x69')](this,_0x3e4de2['variable_id']);if(_0x471bbb){this['channel'][_0xfbec('0x9a')](_0x471bbb,_0x12fcf6);return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x1b6'),_0x3e4de2[_0xfbec('0x1b5')],_0x471bbb));}}return this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x1b7'),_0x3e4de2['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x3a5a7a){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x1b8'),_0x3a5a7a[_0xfbec('0x35')]));_0x3a5a7a[_0xfbec('0x59')]=_0x3a5a7a['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3a5a7a[_0xfbec('0x58')])){return this['channel'][_0xfbec('0xa5')]('no\x20apiKey\x20configured');}if(!this[_0xfbec('0x83')](_0x3a5a7a['text'])){return this['channel'][_0xfbec('0xa5')](_0xfbec('0xbe'));}this[_0xfbec('0x34')]['noop'](util[_0xfbec('0x27')](_0xfbec('0x1b9'),_0x3a5a7a[_0xfbec('0x59')]));var _0x1d0d42=this['googleCloudTTS'][_0xfbec('0x69')](this,_0x3a5a7a);if(_0x1d0d42){this['channel']['noop'](util[_0xfbec('0x27')](_0xfbec('0x1ba'),_0x1d0d42));var _0x3afe7f=this[_0xfbec('0x34')][_0xfbec('0xfd')](_0x1d0d42);try{fs['unlink'](_0x1d0d42+_0xfbec('0x150'));}catch(_0x5a495b){logger['error'](_0x5a495b);}return _0x3afe7f;}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x3a5a7a,_0xfbec('0x1bb'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x1bc')]=function(_0x5e4d67){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5e4d67[_0xfbec('0x35')]));_0x5e4d67[_0xfbec('0x59')]=_0x5e4d67[_0xfbec('0x59')][_0xfbec('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfbec('0x83')](_0x5e4d67[_0xfbec('0x59')])){return this['channel']['noop'](_0xfbec('0xbe'));}this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x5e4d67[_0xfbec('0x59')]));var _0x56cf88=this[_0xfbec('0x5e')][_0xfbec('0x69')](this,_0x5e4d67);if(_0x56cf88){this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x1bd'),_0x56cf88));var _0x32c30a=this[_0xfbec('0x34')][_0xfbec('0xfd')](_0x56cf88);try{fs['unlink'](_0x56cf88+_0xfbec('0x150'));}catch(_0x592243){logger[_0xfbec('0x2b')](_0x592243);}return _0x32c30a;}return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x5e4d67,_0xfbec('0x1be'));};AGIVertices[_0xfbec('0xf')][_0xfbec('0x1bf')]=function(_0x487b39){logger['info'](util[_0xfbec('0x27')](_0xfbec('0x1c0'),_0x487b39[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x487b39[_0xfbec('0x154')])){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x487b39,_0xfbec('0x15b'));}logger['info'](util[_0xfbec('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xfbec('0x36')],_0x487b39['findBy']));var _0x288e42=this[_0xfbec('0x4e')][_0xfbec('0x69')](this,_0x487b39[_0xfbec('0x154')]);if(_0x288e42){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x155'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x487b39[_0xfbec('0x154')]));this['channel'][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x155'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x487b39[_0xfbec('0x154')]));return{'code':0xc8,'result':_0xfbec('0x156')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbec('0x34')][_0xfbec('0x36')],_0x487b39[_0xfbec('0x154')]));this[_0xfbec('0x34')][_0xfbec('0xa5')](util['format'](_0xfbec('0x157'),this[_0xfbec('0x34')][_0xfbec('0x36')],_0x487b39[_0xfbec('0x154')]));return{'code':0xc8,'result':_0xfbec('0x158')};}};AGIVertices['prototype']['voicemail']=function(_0x421eb3){logger[_0xfbec('0x2c')](util[_0xfbec('0x27')](_0xfbec('0x1c1'),_0x421eb3[_0xfbec('0x35')]));var _0x3a68b9=this[_0xfbec('0x34')][_0xfbec('0xa3')](_0xfbec('0x1c2'),[_0x421eb3['mailbox'],_0x421eb3[_0xfbec('0x74')]]);if(_0x3a68b9[_0xfbec('0x9d')]===-0x1){return _0x3a68b9;}return this[_0xfbec('0x34')][_0xfbec('0xa5')](util[_0xfbec('0x27')](_0xfbec('0x16c'),'VOICEMAIL',_0x421eb3[_0xfbec('0x1c3')]));};AGIVertices[_0xfbec('0xf')]['vswitch']=function(_0x15b799){logger[_0xfbec('0x2c')](util['format'](_0xfbec('0x1c4'),_0x15b799[_0xfbec('0x35')]));if(!this[_0xfbec('0x83')](_0x15b799['variable_id'])){return this['channel'][_0xfbec('0x2b')](_0x15b799,_0xfbec('0x1c5'));}var _0x3343cb=this[_0xfbec('0x10')][_0xfbec('0x69')](this,_0x15b799[_0xfbec('0xd3')]);if(!_0x3343cb){return this[_0xfbec('0x34')][_0xfbec('0x2b')](_0x15b799,_0xfbec('0xd5'));}var _0xcdcbde=this[_0xfbec('0x34')]['getVariable'](_0x3343cb);return{'code':0xc8,'result':_0xcdcbde[_0xfbec('0x9f')]?_0xcdcbde[_0xfbec('0x9f')]:'-'};};String[_0xfbec('0xf')][_0xfbec('0x1c6')]=function(_0x42b793,_0x57a5ad){return this[_0xfbec('0x9b')](_0x42b793)[_0xfbec('0x1c7')](_0x57a5ad);};module[_0xfbec('0x1c8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2efbacc..d5b5a5c 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 _0x7d62=['finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout'];(function(_0x3b3362,_0x202631){var _0x223f5b=function(_0x21a21d){while(--_0x21a21d){_0x3b3362['push'](_0x3b3362['shift']());}};_0x223f5b(++_0x202631);}(_0x7d62,0x17b));var _0x27d6=function(_0x419b40,_0x4bbbc5){_0x419b40=_0x419b40-0x0;var _0x5afe27=_0x7d62[_0x419b40];return _0x5afe27;};'use strict';var _=require('lodash');var moment=require(_0x27d6('0x0'));var ami=require(_0x27d6('0x1'));var logger=require('../../../config/logger')(_0x27d6('0x2'));var RpcUser=require(_0x27d6('0x3'));var RpcVoiceAgentReport=require(_0x27d6('0x4'));function Acw(_0x344080){this[_0x27d6('0x5')]=_0x344080['voiceQueues'];this[_0x27d6('0x6')]=_0x344080[_0x27d6('0x6')];this[_0x27d6('0x7')]=_0x344080[_0x27d6('0x7')];this[_0x27d6('0x8')]={};ami['on'](_0x27d6('0x9'),this[_0x27d6('0xa')][_0x27d6('0xb')](this));ami['on']('hanguprequest',this[_0x27d6('0xc')]['bind'](this));ami['on'](_0x27d6('0xd'),this[_0x27d6('0xe')]['bind'](this));ami['on']('agentringnoanswer',this[_0x27d6('0xf')][_0x27d6('0xb')](this));ami['on'](_0x27d6('0x10'),this[_0x27d6('0x11')][_0x27d6('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x27d6('0xb')](this));ami['on'](_0x27d6('0x12'),this[_0x27d6('0x13')][_0x27d6('0xb')](this));}function getDiff(_0x52cf32){var _0x3261d7=moment()[_0x27d6('0x14')](0x0);var _0x18963c=moment(_0x52cf32)['milliseconds'](0x0);return _0x3261d7['diff'](_0x18963c,_0x27d6('0x15'));}Acw[_0x27d6('0x16')][_0x27d6('0x17')]=function(_0x24c938){try{var _0x300f8d=this;var _0x403f14=this[_0x27d6('0x8')][_0x24c938][_0x27d6('0x18')];var _0x4ed8dd=this['channels'][_0x24c938]['queue'];var _0x1e2529=this['voiceQueues'][_0x4ed8dd];var _0x2ff5fb=![];var _0x5cf997='ACW';if(_0x1e2529[_0x27d6('0x19')]){if(_0x1e2529[_0x27d6('0x1a')][_0x27d6('0x1b')]){_0x2ff5fb=!![];_0x5cf997=_0x1e2529[_0x27d6('0x1a')][_0x27d6('0x1b')];}}return ami[_0x27d6('0x1c')]({'action':_0x27d6('0x1d'),'interface':_0x403f14,'paused':!![],'reason':_0x5cf997})['then'](function(){if(_0x300f8d[_0x27d6('0x6')][_0x403f14]){return RpcUser[_0x27d6('0x1e')](_0x300f8d[_0x27d6('0x6')][_0x403f14]['id'])[_0x27d6('0x1f')](function(_0x285c18){if(_0x285c18&&!_0x285c18[_0x27d6('0x20')]){logger[_0x27d6('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x24c938,_0x403f14,_0x4ed8dd);var _0x7d2dd9=_0x300f8d[_0x27d6('0x8')][_0x24c938]['attended']&&_0x300f8d[_0x27d6('0x8')][_0x24c938][_0x27d6('0x22')]?_0x300f8d[_0x27d6('0x8')][_0x24c938][_0x27d6('0x22')]:_0x24c938;return RpcUser[_0x27d6('0x23')](_0x300f8d[_0x27d6('0x6')][_0x403f14],_0x5cf997,_0x7d2dd9)[_0x27d6('0x1f')](function(){if(!_0x2ff5fb){_0x300f8d['timers'][_0x403f14]={};logger[_0x27d6('0x21')](_0x27d6('0x24'),_0x24c938,_0x300f8d[_0x27d6('0x5')][_0x4ed8dd]['acwTimeout'],_0x403f14,_0x4ed8dd);_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x25')]=setTimeout(_0x300f8d[_0x27d6('0x26')][_0x27d6('0xb')](_0x300f8d,_0x403f14),_0x300f8d[_0x27d6('0x5')][_0x4ed8dd]['acwTimeout']*0x3e8);_0x300f8d[_0x27d6('0x7')][_0x403f14]['lastPauseAt']=moment()[_0x27d6('0x27')](_0x27d6('0x28'));_0x300f8d['timers'][_0x403f14][_0x27d6('0x29')]=_0x24c938;_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2a')]=_0x4ed8dd;_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2b')]=function(){var _0x3481a9=getDiff(_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2c')]);clearTimeout(_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x25')]);_0x300f8d[_0x27d6('0x7')][_0x403f14]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3481a9},_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x29')],_0x403f14)[_0x27d6('0x1f')](function(_0x2bd680){logger['info'](_0x27d6('0x2d'),_0x24c938,_0x3481a9,_0x2bd680);})[_0x27d6('0x2e')](function(_0xd14490){logger[_0x27d6('0x2f')](_0x27d6('0x30'),_0x24c938,_0xd14490);});delete _0x300f8d[_0x27d6('0x7')][_0x403f14];};}});}else{logger[_0x27d6('0x21')](_0x27d6('0x31'),_0x24c938,_0x403f14,_0x4ed8dd);}});}})[_0x27d6('0x2e')](function(){logger[_0x27d6('0x2f')](_0x27d6('0x24'),_0x24c938,_0x300f8d[_0x27d6('0x5')][_0x4ed8dd][_0x27d6('0x32')],_0x403f14,_0x4ed8dd);})[_0x27d6('0x33')](function(){delete _0x300f8d[_0x27d6('0x8')][_0x24c938];});}catch(_0x5697d5){logger[_0x27d6('0x2f')](_0x27d6('0x34'),_0x5697d5[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')]['stopAcw']=function(_0x2e2868){try{var _0x44117b=this;if(_0x44117b['timers'][_0x2e2868]){_0x44117b[_0x27d6('0x7')][_0x2e2868]['timer']=![];var _0x1c0cd6=_0x44117b[_0x27d6('0x7')][_0x2e2868]['uniqueid'];var _0x2ee37b=_0x44117b[_0x27d6('0x7')][_0x2e2868][_0x27d6('0x2a')];var _0x493ac2=_0x44117b['voiceQueues'][_0x2ee37b][_0x27d6('0x32')];logger['info'](_0x27d6('0x36'),_0x1c0cd6,_0x2e2868);RpcUser['saveUnpause'](this[_0x27d6('0x6')][_0x2e2868]);RpcVoiceAgentReport[_0x27d6('0x37')]({'acwtime':_0x493ac2,'agentacw':!![]},_0x1c0cd6,_0x2e2868)[_0x27d6('0x1f')](function(_0x399e35){logger[_0x27d6('0x21')](_0x27d6('0x2d'),_0x1c0cd6,_0x493ac2,_0x399e35);})[_0x27d6('0x2e')](function(_0x22a3b9){logger[_0x27d6('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x1c0cd6,_0x22a3b9);});}else{logger[_0x27d6('0x2f')](_0x27d6('0x38'),_0x2e2868);if(_0x44117b[_0x27d6('0x7')]){logger['info'](_0x27d6('0x39'),JSON[_0x27d6('0x3a')](_0x44117b[_0x27d6('0x7')]));}}}catch(_0x341496){logger['error'](_0x27d6('0x3b'),_0x341496[_0x27d6('0x35')]);}};Acw['prototype'][_0x27d6('0xa')]=function(_0x597f86){try{if(this[_0x27d6('0x5')][_0x597f86['queue']]&&(this[_0x27d6('0x5')][_0x597f86[_0x27d6('0x2a')]]['acw']||this[_0x27d6('0x5')][_0x597f86[_0x27d6('0x2a')]]['mandatoryDisposition'])){if(this[_0x27d6('0x6')][_0x597f86[_0x27d6('0x18')]]){this[_0x27d6('0x8')][_0x597f86['uniqueid']]={'queue':_0x597f86[_0x27d6('0x2a')],'interface':_0x597f86[_0x27d6('0x18')],'destlinkedid':_0x597f86[_0x27d6('0x22')]};}}}catch(_0x30eb87){logger['error'](_0x27d6('0x3c'),_0x30eb87[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0x13')]=function(_0x3fb598){try{if(this[_0x27d6('0x5')][_0x3fb598['queue']]&&(this['voiceQueues'][_0x3fb598[_0x27d6('0x2a')]][_0x27d6('0x2')]||this[_0x27d6('0x5')][_0x3fb598[_0x27d6('0x2a')]][_0x27d6('0x19')])){if(this[_0x27d6('0x6')][_0x3fb598[_0x27d6('0x18')]]){this[_0x27d6('0x8')][_0x3fb598[_0x27d6('0x29')]]={'queue':_0x3fb598[_0x27d6('0x2a')],'interface':_0x3fb598[_0x27d6('0x18')]};}}}catch(_0x5ca42d){logger[_0x27d6('0x2f')](_0x27d6('0x3d'),_0x5ca42d['message']);}};Acw[_0x27d6('0x16')][_0x27d6('0xc')]=function(_0x2f745d){try{if(this['channels'][_0x2f745d[_0x27d6('0x29')]]&&_[_0x27d6('0x3e')](this['channels'][_0x2f745d[_0x27d6('0x29')]][_0x27d6('0x3f')])){logger['info'](_0x27d6('0x40'),_0x2f745d[_0x27d6('0x29')]);this[_0x27d6('0x17')](_0x2f745d[_0x27d6('0x29')]);}else if(this[_0x27d6('0x8')][_0x2f745d['linkedid']]&&_[_0x27d6('0x3e')](this[_0x27d6('0x8')][_0x2f745d[_0x27d6('0x41')]]['attended'])){logger[_0x27d6('0x21')](_0x27d6('0x42'),_0x2f745d['linkedid']);this[_0x27d6('0x17')](_0x2f745d[_0x27d6('0x41')]);}}catch(_0x37d08e){logger[_0x27d6('0x2f')](_0x27d6('0x43'),_0x37d08e[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0xe')]=function(_0x3b2060){try{if(this['channels'][_0x3b2060[_0x27d6('0x29')]]&&this[_0x27d6('0x8')][_0x3b2060[_0x27d6('0x29')]][_0x27d6('0x3f')]){logger[_0x27d6('0x21')](_0x27d6('0x44'),_0x3b2060[_0x27d6('0x29')]);this[_0x27d6('0x17')](_0x3b2060[_0x27d6('0x29')]);}else if(this[_0x27d6('0x8')][_0x3b2060['linkedid']]&&this[_0x27d6('0x8')][_0x3b2060[_0x27d6('0x41')]]['attended']){logger['info'](_0x27d6('0x45'),_0x3b2060['linkedid']);this[_0x27d6('0x17')](_0x3b2060[_0x27d6('0x41')]);}}catch(_0x41e56e){logger['error']('[ACW][syncHangup]\x20%s',_0x41e56e[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0x11')]=function(_0x268229){try{if(!_[_0x27d6('0x46')](this[_0x27d6('0x8')][_0x268229['transfereeuniqueid']])){this[_0x27d6('0x17')](_0x268229[_0x27d6('0x47')]);if(this[_0x27d6('0x8')][_0x268229['secondtransfereruniqueid']]){this['channels'][_0x268229[_0x27d6('0x48')]][_0x27d6('0x3f')]=!![];this[_0x27d6('0x8')][_0x268229['transfertargetuniqueid']]=this[_0x27d6('0x8')][_0x268229[_0x27d6('0x48')]];delete this[_0x27d6('0x8')][_0x268229[_0x27d6('0x48')]];}}else if(!_[_0x27d6('0x46')](this[_0x27d6('0x8')][_0x268229[_0x27d6('0x49')]])){this[_0x27d6('0x17')](_0x268229[_0x27d6('0x49')]);if(this[_0x27d6('0x8')][_0x268229['origtransfereruniqueid']]){this[_0x27d6('0x8')][_0x268229[_0x27d6('0x4a')]][_0x27d6('0x3f')]=!![];this['channels'][_0x268229[_0x27d6('0x47')]]=this[_0x27d6('0x8')][_0x268229['origtransfereruniqueid']];delete this[_0x27d6('0x8')][_0x268229[_0x27d6('0x4a')]];}}}catch(_0x854bed){logger[_0x27d6('0x2f')](_0x27d6('0x4b'),_0x854bed[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')]['syncBlindTransfer']=function(_0x586cb3){try{if(this[_0x27d6('0x8')][_0x586cb3['transfereruniqueid']]){logger['info'](_0x27d6('0x4c'),JSON['stringify'](_0x586cb3[_0x27d6('0x4d')]));this[_0x27d6('0x17')](_0x586cb3[_0x27d6('0x4d')]);}else if(this[_0x27d6('0x8')][_0x586cb3[_0x27d6('0x4e')]]){logger[_0x27d6('0x21')](_0x27d6('0x4f'),JSON[_0x27d6('0x3a')](_0x586cb3[_0x27d6('0x4e')]));this[_0x27d6('0x17')](_0x586cb3['transfererlinkedid']);}}catch(_0x63dd52){logger[_0x27d6('0x2f')](_0x27d6('0x50'),_0x63dd52[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0xf')]=function(_0x2dd4d6){try{if(this['voiceQueues'][_0x2dd4d6[_0x27d6('0x2a')]]&&this[_0x27d6('0x5')][_0x2dd4d6[_0x27d6('0x2a')]][_0x27d6('0x51')]===_0x27d6('0x52')){if(this[_0x27d6('0x6')][_0x2dd4d6[_0x27d6('0x18')]]){logger[_0x27d6('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2dd4d6[_0x27d6('0x29')],_0x2dd4d6[_0x27d6('0x18')],_0x2dd4d6[_0x27d6('0x2a')]);return RpcUser[_0x27d6('0x23')](this[_0x27d6('0x6')][_0x2dd4d6[_0x27d6('0x18')]],_0x27d6('0x53'),_0x2dd4d6[_0x27d6('0x29')]);}}}catch(_0x26e191){logger['error'](_0x27d6('0x54'),_0x26e191[_0x27d6('0x35')]);}};module[_0x27d6('0x55')]=Acw; \ No newline at end of file +var _0x7692=['name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','saveUnpause','[ACW][TIMERS]','[ACW][syncAgentConnect]\x20%s','acw','message','[%s][HANGUP:UNIQUEID]','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7692,0x19a));var _0x2769=function(_0x2db315,_0x58d720){_0x2db315=_0x2db315-0x0;var _0x12f9a2=_0x7692[_0x2db315];return _0x12f9a2;};'use strict';var _=require(_0x2769('0x0'));var moment=require('moment');var ami=require(_0x2769('0x1'));var logger=require(_0x2769('0x2'))('acw');var RpcUser=require(_0x2769('0x3'));var RpcVoiceAgentReport=require(_0x2769('0x4'));function Acw(_0x293d04){this[_0x2769('0x5')]=_0x293d04[_0x2769('0x5')];this[_0x2769('0x6')]=_0x293d04['agents'];this[_0x2769('0x7')]=_0x293d04[_0x2769('0x7')];this[_0x2769('0x8')]={};ami['on'](_0x2769('0x9'),this[_0x2769('0xa')][_0x2769('0xb')](this));ami['on'](_0x2769('0xc'),this[_0x2769('0xd')][_0x2769('0xb')](this));ami['on'](_0x2769('0xe'),this['syncHangup'][_0x2769('0xb')](this));ami['on'](_0x2769('0xf'),this[_0x2769('0x10')][_0x2769('0xb')](this));ami['on'](_0x2769('0x11'),this['syncAttendedTransfer'][_0x2769('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x2769('0xb')](this));ami['on'](_0x2769('0x12'),this[_0x2769('0x13')]['bind'](this));}function getDiff(_0xd0e282){var _0x4c8943=moment()[_0x2769('0x14')](0x0);var _0x616419=moment(_0xd0e282)['milliseconds'](0x0);return _0x4c8943[_0x2769('0x15')](_0x616419,_0x2769('0x16'));}Acw[_0x2769('0x17')][_0x2769('0x18')]=function(_0x3ce6ae){try{var _0x506c0b=this;var _0x498fb1=this[_0x2769('0x8')][_0x3ce6ae][_0x2769('0x19')];var _0x7d9119=this['channels'][_0x3ce6ae][_0x2769('0x1a')];var _0x2af2a9=this[_0x2769('0x5')][_0x7d9119];var _0x27e778=![];var _0x2f6fb4=_0x2769('0x1b');if(_0x2af2a9[_0x2769('0x1c')]){if(_0x2af2a9[_0x2769('0x1d')][_0x2769('0x1e')]){_0x27e778=!![];_0x2f6fb4=_0x2af2a9[_0x2769('0x1d')][_0x2769('0x1e')];}}return ami[_0x2769('0x1f')]({'action':_0x2769('0x20'),'interface':_0x498fb1,'paused':!![],'reason':_0x2f6fb4})['then'](function(){if(_0x506c0b['agents'][_0x498fb1]){return RpcUser['getAgent'](_0x506c0b[_0x2769('0x6')][_0x498fb1]['id'])[_0x2769('0x21')](function(_0x35046d){if(_0x35046d&&!_0x35046d[_0x2769('0x22')]){logger[_0x2769('0x23')](_0x2769('0x24'),_0x3ce6ae,_0x498fb1,_0x7d9119);var _0x23ba80=_0x506c0b[_0x2769('0x8')][_0x3ce6ae][_0x2769('0x25')]&&_0x506c0b[_0x2769('0x8')][_0x3ce6ae]['destlinkedid']?_0x506c0b[_0x2769('0x8')][_0x3ce6ae][_0x2769('0x26')]:_0x3ce6ae;return RpcUser[_0x2769('0x27')](_0x506c0b[_0x2769('0x6')][_0x498fb1],_0x2f6fb4,_0x23ba80)['then'](function(){if(!_0x27e778){_0x506c0b[_0x2769('0x7')][_0x498fb1]={};logger[_0x2769('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x3ce6ae,_0x506c0b[_0x2769('0x5')][_0x7d9119][_0x2769('0x28')],_0x498fb1,_0x7d9119);_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x29')]=setTimeout(_0x506c0b[_0x2769('0x2a')][_0x2769('0xb')](_0x506c0b,_0x498fb1),_0x506c0b[_0x2769('0x5')][_0x7d9119][_0x2769('0x28')]*0x3e8);_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x2b')]=moment()[_0x2769('0x2c')](_0x2769('0x2d'));_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x2e')]=_0x3ce6ae;_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x1a')]=_0x7d9119;_0x506c0b['timers'][_0x498fb1][_0x2769('0x2f')]=function(){var _0x8a43b1=getDiff(_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x2b')]);clearTimeout(_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x29')]);_0x506c0b[_0x2769('0x7')][_0x498fb1][_0x2769('0x29')]=![];RpcVoiceAgentReport[_0x2769('0x30')]({'acwtime':_0x8a43b1},_0x506c0b['timers'][_0x498fb1]['uniqueid'],_0x498fb1)['then'](function(_0x3f3223){logger[_0x2769('0x23')](_0x2769('0x31'),_0x3ce6ae,_0x8a43b1,_0x3f3223);})[_0x2769('0x32')](function(_0x168a81){logger[_0x2769('0x33')](_0x2769('0x34'),_0x3ce6ae,_0x168a81);});delete _0x506c0b[_0x2769('0x7')][_0x498fb1];};}});}else{logger[_0x2769('0x23')](_0x2769('0x35'),_0x3ce6ae,_0x498fb1,_0x7d9119);}});}})['catch'](function(){logger[_0x2769('0x33')](_0x2769('0x36'),_0x3ce6ae,_0x506c0b['voiceQueues'][_0x7d9119][_0x2769('0x28')],_0x498fb1,_0x7d9119);})['finally'](function(){delete _0x506c0b[_0x2769('0x8')][_0x3ce6ae];});}catch(_0x48978a){logger[_0x2769('0x33')](_0x2769('0x37'),_0x48978a['message']);}};Acw[_0x2769('0x17')]['stopAcw']=function(_0x5d3155){try{var _0x559af9=this;if(_0x559af9[_0x2769('0x7')][_0x5d3155]){_0x559af9[_0x2769('0x7')][_0x5d3155][_0x2769('0x29')]=![];var _0x54a240=_0x559af9[_0x2769('0x7')][_0x5d3155]['uniqueid'];var _0x29433d=_0x559af9[_0x2769('0x7')][_0x5d3155][_0x2769('0x1a')];var _0x3a3788=_0x559af9[_0x2769('0x5')][_0x29433d][_0x2769('0x28')];logger[_0x2769('0x23')]('[%s][TIMER][STOP][AGENT:%s]',_0x54a240,_0x5d3155);RpcUser[_0x2769('0x38')](this[_0x2769('0x6')][_0x5d3155]);RpcVoiceAgentReport[_0x2769('0x30')]({'acwtime':_0x3a3788,'agentacw':!![]},_0x54a240,_0x5d3155)[_0x2769('0x21')](function(_0x1642c3){logger['info'](_0x2769('0x31'),_0x54a240,_0x3a3788,_0x1642c3);})[_0x2769('0x32')](function(_0x3d066b){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x54a240,_0x3d066b);});}else{logger[_0x2769('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x5d3155);if(_0x559af9['timers']){logger['info'](_0x2769('0x39'),JSON['stringify'](_0x559af9['timers']));}}}catch(_0x436eb9){logger[_0x2769('0x33')]('[ACW][STOP]\x20%s',_0x436eb9['message']);}};Acw[_0x2769('0x17')]['syncAgentConnect']=function(_0x3d85db){try{if(this[_0x2769('0x5')][_0x3d85db[_0x2769('0x1a')]]&&(this[_0x2769('0x5')][_0x3d85db[_0x2769('0x1a')]]['acw']||this[_0x2769('0x5')][_0x3d85db[_0x2769('0x1a')]][_0x2769('0x1c')])){if(this[_0x2769('0x6')][_0x3d85db[_0x2769('0x19')]]){this[_0x2769('0x8')][_0x3d85db[_0x2769('0x2e')]]={'queue':_0x3d85db[_0x2769('0x1a')],'interface':_0x3d85db[_0x2769('0x19')],'destlinkedid':_0x3d85db[_0x2769('0x26')]};}}}catch(_0x1770f6){logger[_0x2769('0x33')](_0x2769('0x3a'),_0x1770f6['message']);}};Acw[_0x2769('0x17')][_0x2769('0x13')]=function(_0x1fed69){try{if(this[_0x2769('0x5')][_0x1fed69[_0x2769('0x1a')]]&&(this[_0x2769('0x5')][_0x1fed69[_0x2769('0x1a')]][_0x2769('0x3b')]||this[_0x2769('0x5')][_0x1fed69[_0x2769('0x1a')]][_0x2769('0x1c')])){if(this[_0x2769('0x6')][_0x1fed69[_0x2769('0x19')]]){this[_0x2769('0x8')][_0x1fed69[_0x2769('0x2e')]]={'queue':_0x1fed69[_0x2769('0x1a')],'interface':_0x1fed69[_0x2769('0x19')]};}}}catch(_0x4a7530){logger[_0x2769('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4a7530[_0x2769('0x3c')]);}};Acw[_0x2769('0x17')][_0x2769('0xd')]=function(_0x39db9d){try{if(this[_0x2769('0x8')][_0x39db9d[_0x2769('0x2e')]]&&_['isUndefined'](this[_0x2769('0x8')][_0x39db9d[_0x2769('0x2e')]][_0x2769('0x25')])){logger['info'](_0x2769('0x3d'),_0x39db9d[_0x2769('0x2e')]);this[_0x2769('0x18')](_0x39db9d['uniqueid']);}else if(this['channels'][_0x39db9d['linkedid']]&&_[_0x2769('0x3e')](this[_0x2769('0x8')][_0x39db9d[_0x2769('0x3f')]][_0x2769('0x25')])){logger['info'](_0x2769('0x40'),_0x39db9d[_0x2769('0x3f')]);this[_0x2769('0x18')](_0x39db9d[_0x2769('0x3f')]);}}catch(_0x43e589){logger['error'](_0x2769('0x41'),_0x43e589[_0x2769('0x3c')]);}};Acw['prototype']['syncHangup']=function(_0x30a99f){try{if(this['channels'][_0x30a99f['uniqueid']]&&this[_0x2769('0x8')][_0x30a99f[_0x2769('0x2e')]][_0x2769('0x25')]){logger['info'](_0x2769('0x42'),_0x30a99f[_0x2769('0x2e')]);this['startAcw'](_0x30a99f[_0x2769('0x2e')]);}else if(this[_0x2769('0x8')][_0x30a99f['linkedid']]&&this[_0x2769('0x8')][_0x30a99f[_0x2769('0x3f')]]['attended']){logger[_0x2769('0x23')](_0x2769('0x43'),_0x30a99f['linkedid']);this[_0x2769('0x18')](_0x30a99f[_0x2769('0x3f')]);}}catch(_0x373d2f){logger['error'](_0x2769('0x44'),_0x373d2f[_0x2769('0x3c')]);}};Acw[_0x2769('0x17')][_0x2769('0x45')]=function(_0x2c1c90){try{if(!_['isNil'](this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x46')]])){this[_0x2769('0x18')](_0x2c1c90[_0x2769('0x46')]);if(this[_0x2769('0x8')][_0x2c1c90['secondtransfereruniqueid']]){this['channels'][_0x2c1c90[_0x2769('0x47')]]['attended']=!![];this[_0x2769('0x8')][_0x2c1c90['transfertargetuniqueid']]=this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x47')]];delete this['channels'][_0x2c1c90['secondtransfereruniqueid']];}}else if(!_[_0x2769('0x48')](this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x49')]])){this[_0x2769('0x18')](_0x2c1c90['transfertargetuniqueid']);if(this[_0x2769('0x8')][_0x2c1c90['origtransfereruniqueid']]){this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x4a')]]['attended']=!![];this[_0x2769('0x8')][_0x2c1c90['transfereeuniqueid']]=this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x4a')]];delete this[_0x2769('0x8')][_0x2c1c90[_0x2769('0x4a')]];}}}catch(_0x473aac){logger[_0x2769('0x33')](_0x2769('0x4b'),_0x473aac['message']);}};Acw[_0x2769('0x17')]['syncBlindTransfer']=function(_0x37f9c8){try{if(this[_0x2769('0x8')][_0x37f9c8[_0x2769('0x4c')]]){logger[_0x2769('0x23')](_0x2769('0x4d'),JSON['stringify'](_0x37f9c8[_0x2769('0x4c')]));this[_0x2769('0x18')](_0x37f9c8[_0x2769('0x4c')]);}else if(this[_0x2769('0x8')][_0x37f9c8['transfererlinkedid']]){logger['info'](_0x2769('0x4e'),JSON[_0x2769('0x4f')](_0x37f9c8[_0x2769('0x50')]));this[_0x2769('0x18')](_0x37f9c8[_0x2769('0x50')]);}}catch(_0x4439aa){logger[_0x2769('0x33')](_0x2769('0x51'),_0x4439aa[_0x2769('0x3c')]);}};Acw[_0x2769('0x17')]['syncAgentRingNoAnswer']=function(_0x514d94){try{if(this['voiceQueues'][_0x514d94[_0x2769('0x1a')]]&&this['voiceQueues'][_0x514d94[_0x2769('0x1a')]][_0x2769('0x52')]===_0x2769('0x53')){if(this['agents'][_0x514d94['interface']]){logger[_0x2769('0x23')](_0x2769('0x54'),_0x514d94[_0x2769('0x2e')],_0x514d94[_0x2769('0x19')],_0x514d94[_0x2769('0x1a')]);return RpcUser[_0x2769('0x27')](this[_0x2769('0x6')][_0x514d94[_0x2769('0x19')]],_0x2769('0x55'),_0x514d94['uniqueid']);}}}catch(_0x3cb952){logger['error'](_0x2769('0x56'),_0x3cb952[_0x2769('0x3c')]);}};module[_0x2769('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 6a8eec2..3d20748 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 _0x66ba=['format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionSipShowRegistry','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','../../config/logger','ami','asterisk','username','password','keepConnected','Action','promisify','action','error','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','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','info'];(function(_0x38be78,_0x457852){var _0x4ebbf3=function(_0x508f26){while(--_0x508f26){_0x38be78['push'](_0x38be78['shift']());}};_0x4ebbf3(++_0x457852);}(_0x66ba,0xe5));var _0xa66b=function(_0xc96ce9,_0x39dab2){_0xc96ce9=_0xc96ce9-0x0;var _0x4f8966=_0x66ba[_0xc96ce9];return _0x4f8966;};'use strict';var Manager=require(_0xa66b('0x0'));var BPromise=require(_0xa66b('0x1'));var util=require('util');var logger=require(_0xa66b('0x2'))(_0xa66b('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xa66b('0x4')]['port'],config['asterisk']['ip'],config['asterisk'][_0xa66b('0x5')],config['asterisk'][_0xa66b('0x6')],!![]);ami[_0xa66b('0x7')]();ami[_0xa66b('0x8')]=BPromise[_0xa66b('0x9')](ami[_0xa66b('0xa')]);function error(_0x283a8a){logger[_0xa66b('0xb')](util['format'](_0xa66b('0xc'),config['asterisk']['username'],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')],util[_0xa66b('0xe')](_0x283a8a,![],null)));}function close(){logger[_0xa66b('0xb')](util['format'](_0xa66b('0xf'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xa66b('0x10')});};};ami[_0xa66b('0x11')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':_0xa66b('0x12')});};};ami[_0xa66b('0x13')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':'sippeerstatus'});};};ami[_0xa66b('0x14')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':'queuesummary'});};};ami[_0xa66b('0x15')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(){logger[_0xa66b('0x16')](util[_0xa66b('0x17')](_0xa66b('0x18'),config['asterisk'][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')]['port']));ami[_0xa66b('0x19')]('error',error);ami['once'](_0xa66b('0x1a'),close);}ami['on'](_0xa66b('0x1b'),connect);ami['on'](_0xa66b('0x1c'),function(_0x50a05b){logger['info'](util['format'](_0xa66b('0x1d'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')],util[_0xa66b('0xe')](_0x50a05b,![],null)));});ami['on'](_0xa66b('0x1e'),function(){logger[_0xa66b('0x16')](util['format'](_0xa66b('0x1f'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')]));return Promise['resolve']()['then'](ami[_0xa66b('0x20')]())[_0xa66b('0x21')](ami[_0xa66b('0x11')]())[_0xa66b('0x21')](ami[_0xa66b('0x13')]())[_0xa66b('0x21')](ami[_0xa66b('0x14')]())[_0xa66b('0x21')](ami[_0xa66b('0x15')]())[_0xa66b('0x22')](function(_0x2d64e6){logger[_0xa66b('0xb')](_0xa66b('0x23'),util[_0xa66b('0xe')](_0x2d64e6,{'showHidden':![],'depth':null}));});});ami[_0xa66b('0x19')](_0xa66b('0xb'),error);ami[_0xa66b('0x19')](_0xa66b('0x1a'),close);module['exports']=ami; \ No newline at end of file +var _0xf88e=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','once','close','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','sipshowregistry'];(function(_0x513a79,_0xe1b650){var _0x255ae7=function(_0x44d0f0){while(--_0x44d0f0){_0x513a79['push'](_0x513a79['shift']());}};_0x255ae7(++_0xe1b650);}(_0xf88e,0xef));var _0xef88=function(_0x413f1f,_0x2fc742){_0x413f1f=_0x413f1f-0x0;var _0x29372a=_0xf88e[_0x413f1f];return _0x29372a;};'use strict';var Manager=require(_0xef88('0x0'));var BPromise=require(_0xef88('0x1'));var util=require('util');var logger=require(_0xef88('0x2'))(_0xef88('0x3'));var config=require(_0xef88('0x4'));var ami=new Manager(config[_0xef88('0x5')]['port'],config[_0xef88('0x5')]['ip'],config[_0xef88('0x5')][_0xef88('0x6')],config['asterisk'][_0xef88('0x7')],!![]);ami[_0xef88('0x8')]();ami[_0xef88('0x9')]=BPromise[_0xef88('0xa')](ami[_0xef88('0xb')]);function error(_0x1c2e59){logger[_0xef88('0xc')](util[_0xef88('0xd')](_0xef88('0xe'),config[_0xef88('0x5')][_0xef88('0x6')],config['asterisk']['ip'],config[_0xef88('0x5')]['port'],util[_0xef88('0xf')](_0x1c2e59,![],null)));}function close(){logger['error'](util[_0xef88('0xd')](_0xef88('0x10'),config[_0xef88('0x5')][_0xef88('0x6')],config[_0xef88('0x5')]['ip'],config[_0xef88('0x5')][_0xef88('0x11')]));}ami[_0xef88('0x12')]=function(){return function(){return ami[_0xef88('0x9')]({'action':_0xef88('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xef88('0x9')]({'action':_0xef88('0x14')});};};ami[_0xef88('0x15')]=function(){return function(){return ami['Action']({'action':_0xef88('0x16')});};};ami[_0xef88('0x17')]=function(){return function(){return ami[_0xef88('0x9')]({'action':_0xef88('0x18')});};};ami[_0xef88('0x19')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(){logger[_0xef88('0x1a')](util[_0xef88('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xef88('0x5')][_0xef88('0x6')],config[_0xef88('0x5')]['ip'],config[_0xef88('0x5')][_0xef88('0x11')]));ami['once']('error',error);ami['once']('close',close);}ami['on'](_0xef88('0x1b'),connect);ami['on'](_0xef88('0x1c'),function(_0x20a8ff){logger[_0xef88('0x1a')](util[_0xef88('0xd')](_0xef88('0x1d'),config[_0xef88('0x5')][_0xef88('0x6')],config['asterisk']['ip'],config[_0xef88('0x5')][_0xef88('0x11')],util[_0xef88('0xf')](_0x20a8ff,![],null)));});ami['on'](_0xef88('0x1e'),function(){logger[_0xef88('0x1a')](util[_0xef88('0xd')](_0xef88('0x1f'),config[_0xef88('0x5')][_0xef88('0x6')],config[_0xef88('0x5')]['ip'],config[_0xef88('0x5')][_0xef88('0x11')]));return Promise['resolve']()['then'](ami[_0xef88('0x12')]())[_0xef88('0x20')](ami[_0xef88('0x21')]())['then'](ami[_0xef88('0x15')]())[_0xef88('0x20')](ami[_0xef88('0x17')]())[_0xef88('0x20')](ami['actionCoreShowChannels']())['catch'](function(_0xe74cc){logger['error']('[ami.js][fullybooted]',util['inspect'](_0xe74cc,{'showHidden':![],'depth':null}));});});ami[_0xef88('0x22')](_0xef88('0xc'),error);ami[_0xef88('0x22')](_0xef88('0x23'),close);module[_0xef88('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index daa0238..e8a3cfc 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 404dcf3..4717fe2 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 _0x0fad=['format','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','is\x20not\x20active','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','ifTime','timezones','UNKNOWN_TIMEZONE','isArray','length','push','command','interval','then','content','indexOf','catch','iftime\x20%s,%s','true','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','getSeconds','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','countabandonedretry','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','idHopper','roundrobin','preview','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','HangupInAMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD]','Machine','membername','AMD','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAMDActive','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countcongestionretry','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','running','statusMessage','getQueueCampaignStatusMessage','startProgressive','available','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[actions]','enqueue','Action','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handlePreviewRecallNotifications','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','%s%s','XMD-','toUpper','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','callerid','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','busyFactor','[getDataPredictive]','getDataPredictiveOld','getVoiceQueueRtPauses','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','check\x20failure','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','emptyContact','[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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','./utils','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','varset','syncVarSet','syncQueueStatusComplete','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','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','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','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','NULL_INTERVAL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active'];(function(_0x4c7ffe,_0x51381d){var _0x3be00f=function(_0x191566){while(--_0x191566){_0x4c7ffe['push'](_0x4c7ffe['shift']());}};_0x3be00f(++_0x51381d);}(_0x0fad,0x1a2));var _0xd0fa=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x0fad[_0x45161c];return _0x186581;};'use strict';var util=require(_0xd0fa('0x0'));var _=require(_0xd0fa('0x1'));var uuid=require(_0xd0fa('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xd0fa('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0xd0fa('0x4'));var config=require('../../../config/environment/');var logger=require(_0xd0fa('0x5'))(_0xd0fa('0x6'));var loggerBooked=require('../../../config/logger')(_0xd0fa('0x7'));var loggerPredictive=require('../../../config/logger')(_0xd0fa('0x8'));var loggerPredictiveCalls=require(_0xd0fa('0x5'))(_0xd0fa('0x9'));var loggerSyncQueueSummary=require(_0xd0fa('0x5'))(_0xd0fa('0xa'));var ami=require('../ami');config['redis']=_[_0xd0fa('0xb')](config[_0xd0fa('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd0fa('0xc')]));var cmHopper=require(_0xd0fa('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xd0fa('0xe'));var Interval=require(_0xd0fa('0xf'));var Action=require(_0xd0fa('0x10'));var History=require(_0xd0fa('0x11'));var Final=require(_0xd0fa('0x12'));var AgentComplete=require(_0xd0fa('0x13'));var QueueCallerAbandon=require(_0xd0fa('0x14'));var Hangup=require(_0xd0fa('0x15'));var ipAgi=process['env'][_0xd0fa('0x16')]||_0xd0fa('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xd0fa('0x18')]['enqueue']=function(_0x5b0e1f){this[_0xd0fa('0x19')]=this[_0xd0fa('0x19')]?this[_0xd0fa('0x19')][_0xd0fa('0x1a')](_0x5b0e1f):_0x5b0e1f();};function Dialer(_0x226c7a,_0x5cd12c){this[_0xd0fa('0x1b')]=new Sequence();this['preview']=_0x5cd12c;this[_0xd0fa('0x1c')]=_0x226c7a[_0xd0fa('0x1c')];this[_0xd0fa('0x1d')]=_0x226c7a['campaigns'];this[_0xd0fa('0x1e')]=_0x226c7a[_0xd0fa('0x1e')];this[_0xd0fa('0x1f')]=_0x226c7a[_0xd0fa('0x1f')];this[_0xd0fa('0x20')]=config[_0xd0fa('0x20')]||0x2;this[_0xd0fa('0x21')]={};this[_0xd0fa('0x22')]={};this[_0xd0fa('0x23')]={};this[_0xd0fa('0x24')]={};this[_0xd0fa('0x25')]={};this[_0xd0fa('0x26')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xd0fa('0x27')]={};this[_0xd0fa('0x28')]={};this[_0xd0fa('0x29')]={};ami['on'](_0xd0fa('0x2a'),this[_0xd0fa('0x2b')][_0xd0fa('0x2c')](this));ami['on']('queuecallerabandon',this[_0xd0fa('0x2d')]['bind'](this));ami['on'](_0xd0fa('0x2e'),this[_0xd0fa('0x2f')][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x30'),this['syncAgentComplete'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x31'),this[_0xd0fa('0xa')][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x32'),this['syncQueueSummaryComplete'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x33'),this['syncHangup'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x34'),this['syncNewExten'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x35'),this[_0xd0fa('0x36')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0xd0fa('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xd0fa('0x37')]['bind'](this));this['loopCampaigns']();this[_0xd0fa('0x38')]();RpcSetting[_0xd0fa('0x39')]()['then'](function(_0x3c15d8){previewRecallmeReminderInterval=_0x3c15d8[_0xd0fa('0x3a')];});}function isNotNull(_0xfa28ec){return _0xfa28ec!==null&&!_['isUndefined'](_0xfa28ec);}function msgResponse(_0x1ea404,_0x1784db,_0x146040){return{'action':_0x1ea404,'response':_0x1784db,'message':_0x146040,'stack':_0x146040};}function emit(_0x11acfa,_0x54ffaf,_0x512db1){io['to'](_0x11acfa)[_0xd0fa('0x3b')](_0x54ffaf,_0x512db1);}function emitOutboundVoiceQueueSummary(_0x8edca){if(_0x8edca[_0xd0fa('0x3c')]===_0xd0fa('0x3d')){logger[_0xd0fa('0x3e')](_0xd0fa('0x3f'),util[_0xd0fa('0x40')](_0x8edca,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x8edca[_0xd0fa('0x41')]),_0xd0fa('0x42'),_0x8edca);}}function checkGetDataPredictive(_0x5b18f5){if(isNotNull(_0x5b18f5)&&!_[_0xd0fa('0x43')](_0x5b18f5)){loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x45'));loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x46'),_0x5b18f5[_0xd0fa('0x47')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x48'),_0x5b18f5[_0xd0fa('0x49')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4a'),_0x5b18f5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4b'),_0x5b18f5[_0xd0fa('0x4c')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4d'),_0x5b18f5['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b18f5[_0xd0fa('0x4e')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));if(_0x5b18f5[_0xd0fa('0x47')]>0x0){if(!_[_0xd0fa('0x50')](_0x5b18f5[_0xd0fa('0x4e')])&&_0x5b18f5[_0xd0fa('0x4e')]>0x0){return!![];}loggerPredictive['info'](_0xd0fa('0x51'));if(!_[_0xd0fa('0x50')](_0x5b18f5['predictiveIntervalAvgHoldtime'])&&_0x5b18f5['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x52'));}else{loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x53'));}}else{loggerPredictive[_0xd0fa('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x289dad){return function(_0x54e9f0){loggerPredictive['info'](_0xd0fa('0x54'));loggerPredictive['info'](_0xd0fa('0x55'),_0x54e9f0[_0xd0fa('0x56')]);loggerPredictive[_0xd0fa('0x44')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54e9f0['erlangCallToSecond']);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x57'),_0x54e9f0[_0xd0fa('0x58')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x59'),_0x54e9f0[_0xd0fa('0x5a')]);loggerPredictive['info'](_0xd0fa('0x57'),_0x54e9f0[_0xd0fa('0x58')]);loggerPredictive[_0xd0fa('0x44')]('---------------------------');_[_0xd0fa('0x5b')](_0x289dad,_0x54e9f0);};}function ifInterval(_0xa158d3,_0x37eb96){if(_['isUndefined'](_0x37eb96)){return![];}return utils['getSeconds'](undefined,_0x37eb96)<_0xa158d3*0x3c;}function clearPredictiveAttributes(_0x253d8f){if(_0x253d8f['startProgressive']){_0x253d8f['startProgressive']=undefined;loggerPredictive['debug'](_0x253d8f[_0xd0fa('0x41')],_0xd0fa('0x5c'));}if(_0x253d8f[_0xd0fa('0x26')]){_0x253d8f[_0xd0fa('0x26')]=undefined;loggerPredictive[_0xd0fa('0x3e')](_0x253d8f[_0xd0fa('0x41')],'startPredictive\x20value\x20cleared');}if(_0x253d8f[_0xd0fa('0x5d')]){clearInterval(_0x253d8f['handlePredictive']);_0x253d8f[_0xd0fa('0x5d')]=undefined;loggerPredictive[_0xd0fa('0x3e')](_0x253d8f['name'],_0xd0fa('0x5e'));}}function loggerCatchPredictive(_0x4374f2,_0x78da70){return function(_0x4eedb5){loggerPredictive[_0xd0fa('0x5f')](_0x78da70[_0xd0fa('0x41')],_0x4374f2);loggerPredictive['error'](_0x4eedb5[_0xd0fa('0x60')]);clearPredictiveAttributes(_0x78da70);};}function loggerCatch(_0x3305d4){return function(_0x3a0130){logger['error'](_0x3305d4,util[_0xd0fa('0x40')](_0x3a0130,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x315a34,_0xb83f4,_0x246a49){return function(_0xf88fcb){utils['checkContactLowerLimitOriginate'](_0xb83f4,_0x246a49,0x0);logger[_0xd0fa('0x5f')](_0x315a34,util['inspect'](_0xf88fcb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4d58f9){return function(_0x328ba9){if(isNotNull(_0x328ba9)&&isNotNull(_0x328ba9[0x0])){if(_0x328ba9[0x0][_0xd0fa('0x61')]>0x0){_0x4d58f9[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x64')];logger['info']('[getContactDialer2][ReScheduled]'+_0x4d58f9[_0xd0fa('0x41')],_0x328ba9[0x0][_0xd0fa('0x61')],_0xd0fa('0x65'));}else{_0x4d58f9[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x66')];logger[_0xd0fa('0x44')](_0xd0fa('0x67')+_0x4d58f9[_0xd0fa('0x41')]);}}};}function createObjHistory(_0x36a403,_0x462188,_0xaf864b,_0x5b4e0e,_0x229abc){_0x36a403[_0xd0fa('0x62')]=_0xaf864b;var _0x3fff0f=new Action(_0x36a403,_0x462188);var _0x2be98d=new History(_0x3fff0f);_0x2be98d[_0xd0fa('0x68')]=_0x5b4e0e;_0x2be98d['statedesc']=_0x229abc;_0x2be98d[_0xd0fa('0x69')]=_0x3fff0f[_0xd0fa('0x6a')];return _0x2be98d;}function unlockQueueStatus(_0x4be3df,_0xd82ec3){setTimeout(function(){if(_[_0xd0fa('0x50')](_0x4be3df[_0xd0fa('0x6b')])){loggerBooked[_0xd0fa('0x5f')](_0xd0fa('0x6c'),_0xd82ec3);}_0x4be3df[_0xd0fa('0x6b')]=!![];loggerBooked[_0xd0fa('0x44')](_0xd0fa('0x6d'),_0xd82ec3,JSON[_0xd0fa('0x6e')](_[_0xd0fa('0x6f')](_0x4be3df,[_0xd0fa('0x41'),_0xd0fa('0x6b')])));},0x1f3);}function checkInterval(_0x380615){return function(){if(!isNotNull(_0x380615[_0xd0fa('0x70')])){_0x380615['message']=utils[_0xd0fa('0x63')]['NULL_INTERVAL'];throw _0x380615[_0xd0fa('0x41')]+_0xd0fa('0x71');}if(!isNotNull(_0x380615[_0xd0fa('0x70')]['Intervals'])){_0x380615[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x72')];throw _0x380615[_0xd0fa('0x41')]+_0xd0fa('0x71');}if(!isNotNull(_[_0xd0fa('0x43')](_0x380615[_0xd0fa('0x70')][_0xd0fa('0x73')]))){_0x380615[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x72')];throw _0x380615['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x3b2707){return function(){if(!utils[_0xd0fa('0x74')](_0x3b2707)){_0x3b2707[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x75')];throw _0x3b2707[_0xd0fa('0x41')]+_0xd0fa('0x76');}};}function emitCampaignSummary(_0x53bc3c){if(utils['isIVRCampaign'](_0x53bc3c)){emit(util[_0xd0fa('0x77')](_0xd0fa('0x78'),_0x53bc3c[_0xd0fa('0x41')]),_0xd0fa('0x79'),_0x53bc3c);}}function loggerCatchQueueSummary(_0x4fe0de,_0x407077){return function(_0x29737f){clearPredictiveAttributes(_0x407077);emitCampaignSummary(_0x407077);loggerSyncQueueSummary['debug'](_0x4fe0de,util['inspect'](_0x29737f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3dc9e2){if(_0x3dc9e2['sendMessageOneNotActive']){if(_0x3dc9e2[_0xd0fa('0x7a')]===0x0){_0x3dc9e2[_0xd0fa('0x7b')]=![];_0x3dc9e2[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x75')];loggerSyncQueueSummary[_0xd0fa('0x3e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3dc9e2['name'],_0xd0fa('0x7c'));}else{_0x3dc9e2[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['DISACTIVED'];loggerSyncQueueSummary[_0xd0fa('0x3e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3dc9e2[_0xd0fa('0x41')],_0xd0fa('0x7d'));}emitCampaignSummary(_0x3dc9e2);}}function myreject(_0x3324e3){return function(_0x4a809f){return _0x3324e3(msgResponse('[ifTime][Action]',_0xd0fa('0x7e'),JSON[_0xd0fa('0x6e')](_0x4a809f)));};}Dialer[_0xd0fa('0x18')][_0xd0fa('0x7f')]=function(_0x4b4cbd){return!_[_0xd0fa('0x50')](_0x4b4cbd)&&_0x4b4cbd&&!_[_0xd0fa('0x50')](_0x4b4cbd['name'])&&!_['isUndefined'](_0x4b4cbd['active'])&&_0x4b4cbd[_0xd0fa('0x80')]&&(this['trunks'][util['format'](_0xd0fa('0x81'),_0x4b4cbd[_0xd0fa('0x41')])][_0xd0fa('0x82')]==='reachable'||this[_0xd0fa('0x1f')][util[_0xd0fa('0x77')](_0xd0fa('0x81'),_0x4b4cbd[_0xd0fa('0x41')])]['status']===_0xd0fa('0x83'));};Dialer['prototype'][_0xd0fa('0x84')]=function(_0x57f571){var _0x18ee99=this;return function(){if(!_0x18ee99[_0xd0fa('0x7f')](_0x57f571[_0xd0fa('0x85')])){if(!_0x18ee99['isTrunkReachable'](_0x57f571['TrunkBackup'])){_0x57f571['message']=utils['CAMPAIGN_STATUS'][_0xd0fa('0x86')];throw _0x57f571[_0xd0fa('0x41')]+_0xd0fa('0x87');}}};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x88')]=function(_0x356ab2,_0x437811,_0x2899b9,_0x5c29dc){var _0x5584d6=this;return function(){var _0x1b8297=!![];return _0x5584d6[_0xd0fa('0x89')](_0x356ab2,_0x437811,_0x2899b9,_0x5c29dc,_0x1b8297);};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x8a')]=function(_0x54cbb1,_0x5a6d0b,_0x3dacdb,_0xd36d0a){var _0xccc417=this;return function(){var _0xee4dc6=![];return _0xccc417[_0xd0fa('0x89')](_0x54cbb1['Intervals'],_0x5a6d0b,_0x3dacdb,_0xd36d0a,_0xee4dc6);};};Dialer['prototype'][_0xd0fa('0x89')]=function(_0xa646de,_0x3c2ba8,_0x34ea44,_0x5270a7,_0x3a5fb0){var _0x4c8912=[];return new Promise(function(_0x45fcb5,_0x1e79b0){if(!isNotNull(_0xa646de)){_0x5270a7[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x72')];return _0x1e79b0(msgResponse('ifTime',_0xd0fa('0x8b'),_0x34ea44+_0xd0fa('0x8c')));}if(_[_0xd0fa('0x43')](_0xa646de)){_0x5270a7[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['EMPTY_INTERVAL'];return _0x1e79b0(msgResponse(_0xd0fa('0x8d'),_0xd0fa('0x8b'),_0x34ea44+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3c2ba8&&_[_0xd0fa('0x50')](config[_0xd0fa('0x8e')][_0x3c2ba8])){_0x5270a7[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x8f')];return _0x1e79b0(msgResponse('ifTime',_0xd0fa('0x8b'),_0x34ea44+'\x20Timezone\x20unknow\x20'+_0x3c2ba8));}if(_[_0xd0fa('0x90')](_0xa646de)){for(var _0x4391f3=0x0;_0x4391f3<_0xa646de[_0xd0fa('0x91')];_0x4391f3+=0x1){_0x4c8912[_0xd0fa('0x92')](ami['Action']({'action':_0xd0fa('0x93'),'command':util[_0xd0fa('0x77')]('iftime\x20%s,%s',_0xa646de[_0x4391f3][_0xd0fa('0x94')],!_[_0xd0fa('0x50')](config[_0xd0fa('0x8e')][_0x3c2ba8])?_0x3c2ba8:'')})[_0xd0fa('0x95')](function(_0x256b8a){return _0x256b8a[_0xd0fa('0x96')][_0xd0fa('0x97')]('true')>=0x0;})[_0xd0fa('0x98')](myreject(_0x1e79b0)));}}else{_0x4c8912[_0xd0fa('0x92')](ami['Action']({'action':_0xd0fa('0x93'),'command':util[_0xd0fa('0x77')](_0xd0fa('0x99'),_0xa646de,!_[_0xd0fa('0x50')](config['timezones'][_0x3c2ba8])?_0x3c2ba8:'')})[_0xd0fa('0x95')](function(_0x2d56e6){return _0x2d56e6['content'][_0xd0fa('0x97')](_0xd0fa('0x9a'))>=0x0;})[_0xd0fa('0x98')](myreject(_0x1e79b0)));}Promise['all'](_0x4c8912)['then'](function(_0x44b8a1){var _0x5eb969=_[_0xd0fa('0x9b')](_0x44b8a1);if(_0x5eb969){return _0x45fcb5(_0x5eb969);}else{_0x5270a7[_0xd0fa('0x62')]=_0x3a5fb0?utils['CAMPAIGN_STATUS'][_0xd0fa('0x9c')]:utils[_0xd0fa('0x63')][_0xd0fa('0x9d')];return _0x1e79b0(msgResponse(_0xd0fa('0x9e'),_0xd0fa('0x8b'),_0xd0fa('0x9f')+_0x3a5fb0+'\x20'+_0x34ea44+_0xd0fa('0xa0')+util[_0xd0fa('0x40')](_0xa646de,{'showHidden':![],'depth':null})+_0xd0fa('0xa1')+_0x3c2ba8));}})['catch'](function(_0x5d5a1c){return _0x1e79b0(msgResponse(_0xd0fa('0x8d'),'Failure',JSON[_0xd0fa('0x6e')](_0x5d5a1c)));});});};Dialer['prototype'][_0xd0fa('0xa2')]=function(){var _0x338277=this;return cmHopper[_0xd0fa('0xa3')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x338277[_0xd0fa('0xa4')]();},0x3e8);});};Dialer[_0xd0fa('0x18')][_0xd0fa('0xa4')]=function(){var _0x35e790=this;var _0x144b80;for(var _0x413464 in this[_0xd0fa('0x1d')]){if(typeof this[_0xd0fa('0x1d')][_0x413464]!==_0xd0fa('0xa5')){_0x144b80=this[_0xd0fa('0x1d')][_0x413464];if(utils[_0xd0fa('0xa6')](_0x144b80)&&utils['isIVRCampaignActive'](_0x144b80)){_0x144b80[_0xd0fa('0x7b')]=!![];Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](checkIsIVRCampaignActive(_0x144b80))[_0xd0fa('0x95')](checkInterval(_0x144b80))[_0xd0fa('0x95')](_0x35e790['checkIsTrunkReachable'](_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0x88')](_0x144b80[_0xd0fa('0xa8')],_0x144b80[_0xd0fa('0xa9')],_0x144b80['name'],_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0x8a')](_0x144b80[_0xd0fa('0x70')],_0x144b80[_0xd0fa('0xa9')],_0x144b80['name'],_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0xaa')](_0x144b80))[_0xd0fa('0x98')](loggerCatchQueueSummary(_0xd0fa('0xab'),_0x144b80));}else{notSendMessagesCampaign(_0x144b80);}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xac')]=function(_0x1135a8){if(_0x1135a8['dialMethod']!==_0xd0fa('0x8')){clearPredictiveAttributes(_0x1135a8);}switch(_0x1135a8[_0xd0fa('0xad')]){case _0xd0fa('0xae'):this['handlePower'](_0x1135a8,0x1);break;case'power':this[_0xd0fa('0xaf')](_0x1135a8,_0x1135a8[_0xd0fa('0xb0')]);break;case _0xd0fa('0x8'):this[_0xd0fa('0x8')](_0x1135a8);break;case _0xd0fa('0x7'):this[_0xd0fa('0xaf')](_0x1135a8,0x1);break;default:logger[_0xd0fa('0x5f')]('Queue',_0x1135a8[_0xd0fa('0x41')],'method\x20not\x20recognized');}};Dialer[_0xd0fa('0x18')]['ifTime']=function(_0x1960a0,_0x3ae02c){var _0x33e8b6=_0x1960a0[_0xd0fa('0xa9')];var _0xeba258=_0x3ae02c?_0x1960a0[_0xd0fa('0xa8')]:_0x1960a0['Interval'][_0xd0fa('0x73')];logger[_0xd0fa('0xb1')](_0xd0fa('0xb2'),_0xeba258,_0x33e8b6,_0x1960a0['name'],util[_0xd0fa('0x77')](_0xd0fa('0xb3'),_0x1960a0[_0xd0fa('0x41')],_0x1960a0['id']));var _0x374041=null;return Interval[_0xd0fa('0xb4')](_0xeba258,_0x33e8b6)[_0xd0fa('0x95')](function(_0x2a3433){if(_0x2a3433===!![]){return _0x2a3433;}else{_0x1960a0[_0xd0fa('0x62')]=_0x3ae02c?utils[_0xd0fa('0x63')][_0xd0fa('0x9c')]:utils[_0xd0fa('0x63')][_0xd0fa('0x9d')];_0x374041=msgResponse(_0xd0fa('0x9e'),'Failure','Global:\x20'+_0x3ae02c+'\x20'+_0x1960a0[_0xd0fa('0x41')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xd0fa('0x40')](_0xeba258,{'showHidden':![],'depth':null})+_0xd0fa('0xa1')+_0x33e8b6);}if(_0x374041!==null){logger[_0xd0fa('0xb1')](_0xd0fa('0xb5'),_0x374041);_0x374041[_0xd0fa('0xb6')]=_0x3ae02c;throw _0x374041;}})[_0xd0fa('0x98')](function(_0x3eb92a){logger['error']('AMI\x20IfTime',_0x3eb92a);throw msgResponse('[ifTime][Action]',_0xd0fa('0x7e'),util[_0xd0fa('0x40')](_0x3eb92a,{'showHidden':![],'depth':null}));});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x2b')]=function(_0x46a46d){if(this[_0xd0fa('0x1c')][_0x46a46d[_0xd0fa('0xb7')]]){if(this[_0xd0fa('0x24')][_0x46a46d[_0xd0fa('0xb8')]]&&this[_0xd0fa('0x24')][_0x46a46d[_0xd0fa('0xb8')]]['type']!==_0xd0fa('0xb9')){this[_0xd0fa('0xba')](this[_0xd0fa('0x1c')][_0x46a46d[_0xd0fa('0xb7')]]);this['uniqueId'][_0x46a46d[_0xd0fa('0xb8')]][_0xd0fa('0xbb')]=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xbd')]=function(_0xa2ecd0){var _0xc92f4f=this[_0xd0fa('0x24')][_0xa2ecd0[_0xd0fa('0xb8')]];if(this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]]){if(_0xc92f4f&&_0xc92f4f[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')){delete this['uniqueId'][_0xa2ecd0['uniqueid']];this['voiceQueues'][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;var _0x57fe36=new AgentComplete(_0xc92f4f,_0xa2ecd0);if(_0xa2ecd0['reason']===_0xd0fa('0xbf')){_0x57fe36[_0xd0fa('0xc0')]=this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xc1')]&&this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xc2')]?moment()[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xd0fa('0xc3')](_0x57fe36)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc4')));hopperUtils[_0xd0fa('0xc5')](_0x57fe36)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc6')));}}};Dialer[_0xd0fa('0x18')]['syncQueueCallerAbandon']=function(_0x3ace11){var _0x3cf19a=this[_0xd0fa('0x24')][_0x3ace11['uniqueid']];var _0x3c89bd=this;var _0x4161f9=![];var _0x1b6ae1;var _0x42b377;if(this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]]){if(_0x3cf19a&&_0x3cf19a[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')){delete this['uniqueId'][_0x3ace11['uniqueid']];this[_0xd0fa('0xba')](this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]);_0x3cf19a['droptime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));var _0x3568e5=new QueueCallerAbandon(_0x3cf19a,_0x3ace11);if(utils[_0xd0fa('0xc7')](_0x3cf19a['droptime'],_0x3cf19a['responsetime'])>=_0x3cf19a[_0xd0fa('0xc8')]){this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xc9')]+=0x1;this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xca')]+=0x1;_0x3568e5[_0xd0fa('0x68')]=0xa;_0x3568e5[_0xd0fa('0xcb')]=_0xd0fa('0xcc');_0x3568e5[_0xd0fa('0xcd')]=_0xd0fa('0xce');_0x3568e5[_0xd0fa('0xc0')]=this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xc1')]?moment()[_0xd0fa('0x77')](_0xd0fa('0xbc')):undefined;_0x3568e5[_0xd0fa('0xcf')]+=0x1;_0x3568e5[_0xd0fa('0xd0')]+=0x1;_0x1b6ae1=this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd1')];_0x42b377=this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd2')];hopperUtils['verifyAdditionalPhones'](_0x3568e5,_0x3568e5[_0xd0fa('0x68')],_0x3cf19a[_0xd0fa('0xd3')])['then'](function(_0x1163f0){_0x4161f9=_0x1163f0[_0xd0fa('0xd4')]==0x1;if(_0x3568e5['countdropretry']>=_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd5')]){_0x3c89bd[_0xd0fa('0xd6')](_0x3568e5,_0x1163f0[_0xd0fa('0xd4')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3568e5[_0xd0fa('0xcf')],'scheduledat':moment()[_0xd0fa('0xd7')](_0x3c89bd[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['dialDropRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x3cf19a[_0xd0fa('0xd9')],'ListId':_0x3cf19a[_0xd0fa('0xda')],'VoiceQueueId':_0x3cf19a[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3cf19a[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xdd')));var _0x1d99a2=new History(_0x3568e5);_0x1d99a2[_0xd0fa('0x68')]=0xa;_0x1d99a2['statedesc']=_0xd0fa('0xcc');_0x1d99a2['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x1d99a2[_0xd0fa('0x69')]=_0x1d99a2[_0xd0fa('0x6a')];_0x1d99a2[_0xd0fa('0xde')]=_0x3568e5[_0xd0fa('0xde')];_0x1d99a2[_0xd0fa('0xdf')]=_0x3568e5[_0xd0fa('0xdf')];hopperUtils[_0xd0fa('0xc3')](_0x1d99a2)['catch'](loggerCatch(_0xd0fa('0xe0')));}})[_0xd0fa('0x95')](function(){if(_0x4161f9)hopperUtils[_0xd0fa('0xe1')](_0x3568e5,_0x1b6ae1,_0x42b377)[_0xd0fa('0x95')](function(){return 0x1;});});}else{this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xd0fa('0x1c')][_0x3ace11['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x3568e5['state']=0xb;_0x3568e5[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0x3568e5[_0xd0fa('0xcd')]='CALLEREXIT';_0x3568e5[_0xd0fa('0xe3')]+=0x1;_0x3568e5[_0xd0fa('0xd0')]+=0x1;_0x1b6ae1=this[_0xd0fa('0x1c')][_0x3ace11['queue']]['dialAbandonedRetryFrequency'];_0x42b377=this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xd0fa('0xe4')](_0x3568e5,_0x3568e5['state'],_0x3cf19a['voiceQueue'])['then'](function(_0x1bbd4f){if(_0x3568e5[_0xd0fa('0xe3')]>=_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xe5')]){_0x3c89bd['queueCallerAbandonCreateState'](_0x3568e5,_0x1bbd4f['additional']);}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countabandonedretry':_0x3568e5[_0xd0fa('0xe3')],'scheduledat':moment()['add'](_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xe7')],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3cf19a[_0xd0fa('0xd9')],'ListId':_0x3cf19a[_0xd0fa('0xda')],'VoiceQueueId':_0x3cf19a[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3cf19a['CampaignId']||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe8')));var _0x5bfe98=new History(_0x3568e5);_0x5bfe98[_0xd0fa('0x68')]=0xb;_0x5bfe98[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0x5bfe98['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x5bfe98[_0xd0fa('0x69')]=_0x5bfe98[_0xd0fa('0x6a')];_0x5bfe98[_0xd0fa('0xde')]=_0x3568e5[_0xd0fa('0xde')];_0x5bfe98[_0xd0fa('0xdf')]=_0x3568e5['calleridnum'];hopperUtils['createHistory'](_0x5bfe98)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe9')));}})['then'](function(){if(_0x4161f9)hopperUtils[_0xd0fa('0xe1')](_0x3568e5,_0x1b6ae1,_0x42b377)[_0xd0fa('0x95')](function(){return 0x1;});});}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xea')]=function(_0x53afc4){if(this[_0xd0fa('0x22')][_0x53afc4[_0xd0fa('0xb8')]]){this[_0xd0fa('0x22')][_0x53afc4[_0xd0fa('0xb8')]][_0xd0fa('0xeb')]=_0x53afc4[_0xd0fa('0xeb')];}if(this[_0xd0fa('0x24')][_0x53afc4['uniqueid']]){this[_0xd0fa('0x24')][_0x53afc4[_0xd0fa('0xb8')]]['channel']=_0x53afc4['channel'];}};Dialer[_0xd0fa('0x18')]['syncQueueMember']=function(_0xd96ca9){if(!this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]]){return;}var _0x19ef10=this[_0xd0fa('0x1c')][this['actions'][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xed')]||_0xd0fa('0xee');if(_0x19ef10==='roundrobin'){if(this['actions'][_0xd96ca9[_0xd0fa('0xec')]]&&_[_0xd0fa('0xef')](this[_0xd0fa('0x22')][_0xd96ca9['actionid']][_0xd0fa('0xf0')])&&_0xd96ca9[_0xd0fa('0x82')]==='1'&&_0xd96ca9[_0xd0fa('0xf1')]==='0'){if(this[_0xd0fa('0x1e')][_0xd96ca9['stateinterface']]){if(!this[_0xd0fa('0x1e')][_0xd96ca9[_0xd0fa('0xf2')]][_0xd0fa('0xf0')]){this[_0xd0fa('0x1e')][_0xd96ca9[_0xd0fa('0xf2')]][_0xd0fa('0xf0')]=!![];this['actions'][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xf0')]=!![];this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xf2')]=_0xd96ca9[_0xd0fa('0xf2')];}}}}else if(_0x19ef10===_0xd0fa('0xee')){if(this['actions'][_0xd96ca9['actionid']]){if(this['agents'][_0xd96ca9[_0xd0fa('0xf2')]]){this[_0xd0fa('0x22')][_0xd96ca9['actionid']]['stateinterface']=_0xd96ca9[_0xd0fa('0xf2')];if(_['isNil'](this[_0xd0fa('0x27')][this['actions'][_0xd96ca9['actionid']][_0xd0fa('0xb7')]])){this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]]['queue']]=[];}this[_0xd0fa('0x27')][this['actions'][_0xd96ca9['actionid']][_0xd0fa('0xb7')]][_0xd0fa('0x92')](_[_0xd0fa('0x5b')](_[_0xd0fa('0x6f')](this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]],[_0xd0fa('0xf3'),_0xd0fa('0xf2')]),{'status':_0xd96ca9[_0xd0fa('0x82')],'paused':_0xd96ca9[_0xd0fa('0xf1')]}));}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x37')]=function(_0x3c3da5){if(!this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]){return;}var _0x26bc04=this;var _0x20351b=this[_0xd0fa('0x1c')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]];var _0x2a2263=_0x20351b[_0xd0fa('0xed')]||_0xd0fa('0xee');if(_0x2a2263===_0xd0fa('0xf4')){if(this[_0xd0fa('0x22')][_0x3c3da5['actionid']]&&this['actions'][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf2')]){this[_0xd0fa('0xf5')][_0xd0fa('0xf6')](this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf3')],this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf2')])[_0xd0fa('0x98')](function(_0x442a5c){logger['error'](_0xd0fa('0xf7'),util['inspect'](_0x442a5c,{'showHidden':![],'depth':null}));})[_0xd0fa('0x1a')](function(){_0x26bc04['updateOriginated'](_0x26bc04[_0xd0fa('0x1c')][_0x26bc04['actions'][_0x3c3da5['actionid']][_0xd0fa('0xb7')]]);_0x26bc04[_0xd0fa('0x1e')][_0x26bc04['actions'][_0x3c3da5['actionid']][_0xd0fa('0xf2')]][_0xd0fa('0xf0')]=![];delete _0x26bc04[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]];unlockQueueStatus(_0x20351b);});}else{this['updateOriginated'](this[_0xd0fa('0x1c')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]);hopperUtils[_0xd0fa('0xe6')]({'active':![],'ContactId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]['ContactId'],'ListId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xda')],'VoiceQueueId':this['actions'][_0x3c3da5['actionid']][_0xd0fa('0xdb')]||undefined,'CampaignId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3c3da5[_0xd0fa('0xec')]];unlockQueueStatus(_0x20351b);}}else if(_0x2a2263===_0xd0fa('0xee')){var _0x4d2a82;if(this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]&&!_[_0xd0fa('0x43')](this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]['queue']])){if(this[_0xd0fa('0x28')][_0x26bc04[_0xd0fa('0x22')][_0x3c3da5['actionid']]['queue']]){this['queueBookedRR'][_0x26bc04['actions'][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]=this[_0xd0fa('0x28')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]?this['queueBookedRR'][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]:this['queueBooked'][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]?this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xf8')]||0x0:0x0;}this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xf8')]=this[_0xd0fa('0x28')][this[_0xd0fa('0x22')][_0x3c3da5['actionid']][_0xd0fa('0xb7')]];for(var _0x241cc3=0x0;_0x241cc3=_0xb94552[_0xd0fa('0x11b')]){_0x3f6ca1[_0xd0fa('0x11c')](_0x26125f,_0x12c22d,_0x47c606,_0xd0fa('0x11d'));}else{if(_0x26125f[_0xd0fa('0x11a')]>=_0xb94552[_0xd0fa('0x11e')]){_0x3f6ca1['createStateFinal'](_0x26125f,_0x12c22d,_0x47c606,_0xd0fa('0x11f'));}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countmachineretry':_0x26125f[_0xd0fa('0x11a')],'scheduledat':moment()[_0xd0fa('0xd7')](_0xb94552[_0xd0fa('0x120')],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x26125f[_0xd0fa('0xd9')],'ListId':_0x26125f['ListId'],'VoiceQueueId':_0x26125f[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x26125f[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));_0x12c22d({'reschedule':0x1});}}});}if(_0x3bd20a[_0xd0fa('0x3c')]===_0xd0fa('0xb9')&&this[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]][_0xd0fa('0x122')]&&_0x361d20[_0xd0fa('0x10c')]===_0xd0fa('0x123')){delete this[_0xd0fa('0x24')][_0x361d20[_0xd0fa('0xb8')]];this[_0xd0fa('0xba')](this[_0xd0fa('0x1d')][_0x3bd20a['queue']]);_0x1f19dc=new Hangup(_0x3bd20a,_0x361d20);_0x1f19dc[_0xd0fa('0x68')]=0x12;_0x1f19dc['statedesc']=_0xd0fa('0x10e');_0x1f19dc[_0xd0fa('0x114')]=_0xd0fa('0x115');ami['emit']('custom:amd',ut[_0xd0fa('0x110')](_0x1f19dc,_0xd0fa('0x116')));this['saveInDb'](_0x1f19dc,_0xd0fa('0x124'),'[syncHangupInAMDIvr]');}if(_0x3bd20a[_0xd0fa('0x3c')]===_0xd0fa('0xb9')&&this[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]]['dialAMDActive']&&_0x361d20['value']==='MACHINE'){return new Promise(function(_0x32e61c,_0x14fb0a){delete _0x3f6ca1[_0xd0fa('0x24')][_0x361d20[_0xd0fa('0xb8')]];_0x3f6ca1[_0xd0fa('0xba')](_0x3f6ca1['campaigns'][_0x3bd20a['queue']]);_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x48fff4=_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]];var _0x151c2b=new Hangup(_0x3bd20a,_0x361d20);_0x151c2b['state']=0x13;_0x151c2b['statedesc']=_0xd0fa('0x113');_0x151c2b[_0xd0fa('0x114')]=_0xd0fa('0x115');_0x151c2b[_0xd0fa('0x11a')]+=0x1;_0x151c2b['countglobal']+=0x1;_0x151c2b[_0xd0fa('0x116')]=!![];ami[_0xd0fa('0x3b')](_0xd0fa('0x10f'),ut[_0xd0fa('0x110')](_0x151c2b,_0xd0fa('0x116')));hopperUtils[_0xd0fa('0xc3')](_0x151c2b)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x125')));if(_0x151c2b[_0xd0fa('0x117')]+_0x151c2b[_0xd0fa('0x126')]+_0x151c2b[_0xd0fa('0x118')]+_0x151c2b[_0xd0fa('0x119')]+_0x151c2b[_0xd0fa('0xcf')]+_0x151c2b[_0xd0fa('0xe3')]+_0x151c2b['countmachineretry']+_0x151c2b[_0xd0fa('0x127')]>=_0x48fff4['dialGlobalMaxRetry']){_0x3f6ca1['stateGlobal'](_0x151c2b,_0x32e61c,_0x14fb0a,_0xd0fa('0x11d'));}else{if(_0x151c2b['countmachineretry']>=_0x48fff4['dialMachineMaxRetry']){_0x3f6ca1['createStateFinal'](_0x151c2b,_0x32e61c,_0x14fb0a,'reason\x2019\x20machine....');}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countmachineretry':_0x151c2b[_0xd0fa('0x11a')],'scheduledat':moment()[_0xd0fa('0xd7')](_0x48fff4['dialMachineRetryFrequency'],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x151c2b[_0xd0fa('0xd9')],'ListId':_0x151c2b['ListId'],'VoiceQueueId':_0x151c2b[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x151c2b[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));_0x32e61c({'reschedule':0x1});}}});}}};Dialer[_0xd0fa('0x18')]['syncHangup']=function(_0x3537b2){var _0x1d668f=this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];var _0xd2f880;if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]===_0xd0fa('0xb9')){delete this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];this['updateOriginated'](this[_0xd0fa('0x1d')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1d')][_0x1d668f['queue']][_0xd0fa('0x128')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x1d668f['queue']][_0xd0fa('0x12a')])){delete this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];this['updateOriginated'](this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;this['voiceQueues'][_0x1d668f[_0xd0fa('0xb7')]][_0xd0fa('0x10d')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);_0xd2f880['state']=0x10;_0xd2f880[_0xd0fa('0xcb')]=_0xd0fa('0x12b');_0xd2f880['membername']=_0xd0fa('0x12c');hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x12d')));}if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')&&!isNotNull(this[_0xd0fa('0x1c')][_0x1d668f['queue']][_0xd0fa('0x12a')])){delete this[_0xd0fa('0x24')][_0x3537b2['uniqueid']];this['updateOriginated'](this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1c')][_0x1d668f['queue']][_0xd0fa('0x12e')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);_0xd2f880['state']=0xc;_0xd2f880[_0xd0fa('0xcb')]=_0x3537b2[_0xd0fa('0x12f')];_0xd2f880[_0xd0fa('0x114')]='Unknow';hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x12d')));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xa')]=function(_0xf0ab98){var _0x12f3f2=this;if(!_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98['name']]){_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]]={'running':![]};}else if(_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]][_0xd0fa('0x130')]===!![]){return;}else if(_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98['name']][_0xd0fa('0x130')]===![]){_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]][_0xd0fa('0x130')]=!![];}var _0x238dcc=_0x12f3f2['voiceQueues'][_0xf0ab98[_0xd0fa('0x41')]];var _0x333d86=_0x238dcc[_0xd0fa('0x62')]!==utils[_0xd0fa('0x63')][_0xd0fa('0x75')];var _0x33d253=utils['isPreviewCampaign'](_0x238dcc);_0x238dcc[_0xd0fa('0x131')]=utils[_0xd0fa('0x132')](_0x238dcc,_0x12f3f2[_0xd0fa('0x1f')]);Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](function(){if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x75')]){if(_0x333d86){clearPredictiveAttributes(_0x238dcc);_0xf0ab98[_0xd0fa('0x26')]=undefined;_0xf0ab98[_0xd0fa('0x133')]=undefined;}if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x75')]){_0xf0ab98[_0xd0fa('0x134')]=0x0;_0xf0ab98[_0xd0fa('0xf1')]=0x0;_0xf0ab98['inUse']=0x0;_0xf0ab98['talking']=0x0;_0xf0ab98[_0xd0fa('0x135')]=0x0;}}else if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x136')]&&!_0x33d253){return _0x12f3f2[_0xd0fa('0x8d')](_0x238dcc,!![])[_0xd0fa('0x95')](function(){return _0x12f3f2[_0xd0fa('0x8d')](_0x238dcc,![]);})[_0xd0fa('0x95')](function(){return _0x12f3f2['checkDialMethod'](_0x238dcc);})['catch'](function(_0x49c4cf){loggerSyncQueueSummary['debug'](_0xd0fa('0x137'),util[_0xd0fa('0x40')](_0x49c4cf,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x238dcc);});}else{clearPredictiveAttributes(_0x238dcc);}})[_0xd0fa('0x95')](function(){var _0x45fc57=_0xf0ab98[_0xd0fa('0x138')](_0x238dcc);if(_0x45fc57||_0x238dcc['queueSummaryCountersUpdated']){_0x238dcc[_0xd0fa('0x139')]=![];_0xf0ab98[_0xd0fa('0x13a')](_0x238dcc);Object[_0xd0fa('0x13b')](_0x238dcc,_0xf0ab98);emitOutboundVoiceQueueSummary(_0xf0ab98);}_0x12f3f2[_0xd0fa('0x29')][_0x238dcc[_0xd0fa('0x41')]][_0xd0fa('0x130')]=![];})[_0xd0fa('0x98')](function(_0x2d9e10){logger[_0xd0fa('0x5f')](_0xd0fa('0x137'),util[_0xd0fa('0x40')](_0x2d9e10,{'showHidden':![],'depth':null}));_0x12f3f2[_0xd0fa('0x29')][_0x238dcc[_0xd0fa('0x41')]][_0xd0fa('0x130')]=![];});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x13c')]=_[_0xd0fa('0x13d')](function(){var _0x93a1c8=_['filter'](this[_0xd0fa('0x1c')],function(_0x202f9e){return _0x202f9e[_0xd0fa('0x13e')];});var _0x3c9e2b=_[_0xd0fa('0x13f')](this['agents'],function(_0x24641f){return _0x24641f[_0xd0fa('0x140')]&&_0x24641f['status']===_0xd0fa('0x141');});if(_0x93a1c8[_0xd0fa('0x91')]>0x0&&_0x3c9e2b[_0xd0fa('0x91')]>0x0){return Promise['resolve']()[_0xd0fa('0x95')](cmHopper['handlePreviewRecallNotifications'](_[_0xd0fa('0x142')](_0x93a1c8,'id'),previewRecallmeReminderInterval,_[_0xd0fa('0x142')](_0x3c9e2b,'id')))['then'](function(_0x367a1f){for(var _0x5ddc73=0x0;_0x5ddc73<_0x367a1f['length'];_0x5ddc73++){var _0x4d5bcf=_0x367a1f[_0x5ddc73][_0xd0fa('0x143')]['name'];if(_0x4d5bcf)io['to'](util[_0xd0fa('0x77')](_0xd0fa('0x144'),_0x4d5bcf))['emit'](_0xd0fa('0x145'),{'hopper':_0x367a1f[_0x5ddc73]});}})[_0xd0fa('0x98')](function(_0x434f55){logger[_0xd0fa('0x5f')]('checkPreviewRecallReminder',_0x434f55);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xd0fa('0x18')][_0xd0fa('0x38')]=function(){var _0x199d92=this;setInterval(function(){_0x199d92[_0xd0fa('0x146')](_0x199d92['uniqueId'],'[uniqueid]');_0x199d92[_0xd0fa('0x146')](_0x199d92[_0xd0fa('0x22')],_0xd0fa('0x147'));},0x32c8);};Dialer[_0xd0fa('0x18')][_0xd0fa('0x146')]=function(_0x595df8,_0x236170){var _0x2eb2dd=this;for(var _0x4973d0 in _0x595df8){if(typeof _0x595df8[_0x4973d0]!=='undefined'){this[_0xd0fa('0x1b')][_0xd0fa('0x148')](function(){if(!_[_0xd0fa('0xef')](_0x595df8[_0x4973d0])){return ami[_0xd0fa('0x149')]({'action':_0xd0fa('0x82'),'channel':_0x595df8[_0x4973d0][_0xd0fa('0xeb')]})[_0xd0fa('0x98')](function(_0x3e3a00){if(_0x3e3a00[_0xd0fa('0x62')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x595df8[_0x4973d0]&&_0x595df8[_0x4973d0]['type']!==_0xd0fa('0xb9')){_0x2eb2dd[_0xd0fa('0xba')](_0x2eb2dd['voiceQueues'][_0x595df8[_0x4973d0][_0xd0fa('0xb7')]]);logger[_0xd0fa('0x5f')](_0xd0fa('0x14a'),_0x236170,_0x4973d0,_0x595df8[_0x4973d0]['queue']);delete _0x595df8[_0x4973d0];}if(_0x595df8[_0x4973d0]&&_0x595df8[_0x4973d0][_0xd0fa('0x3c')]===_0xd0fa('0xb9')){_0x2eb2dd[_0xd0fa('0xba')](_0x2eb2dd[_0xd0fa('0x1d')][_0x595df8[_0x4973d0]['queue']]);logger[_0xd0fa('0x5f')](_0xd0fa('0x14b'),_0x236170,_0x4973d0,_0x595df8[_0x4973d0][_0xd0fa('0xb7')]);delete _0x595df8[_0x4973d0];}},0x2328);}});}});}}};Dialer[_0xd0fa('0x18')]['getVoiceQueueRtPauses']=function(_0x55d496){return Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](voiceQueueRt['getVoiceQueueRtPauses'](_0x55d496))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x14c')));};Dialer['prototype'][_0xd0fa('0xba')]=function(_0x36cf49){if(!_[_0xd0fa('0x50')](_0x36cf49)&&_0x36cf49!==null){if(typeof _0x36cf49[_0xd0fa('0x7a')]!==_0xd0fa('0xa5')){if(_0x36cf49[_0xd0fa('0x7a')]>0x0){_0x36cf49[_0xd0fa('0x7a')]-=0x1;}else{logger['error'](_0xd0fa('0x14d'));}}}else{logger[_0xd0fa('0x5f')](_0xd0fa('0x14e'));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x14f')]=function(_0x3b6c7c,_0x544f02){var _0x5d0f47=this;return function(_0x1f48b5){_0x5d0f47['updateOriginated'](_0x544f02);logger[_0xd0fa('0x5f')](_0x3b6c7c,util[_0xd0fa('0x40')](_0x1f48b5,{'showHidden':![],'depth':null}));};};Dialer[_0xd0fa('0x18')]['emptyContact']=function(_0x40b833,_0x36c3d2,_0x3e8f9e){var _0x14a784={'state':0x19,'statedesc':_0xd0fa('0x150')};this['updateOriginated'](_0x36c3d2);this['saveInDb'](_[_0xd0fa('0x5b')](_0x14a784,_[_0xd0fa('0x6f')](_0x3e8f9e,['ContactId',_0xd0fa('0xda'),_0xd0fa('0x151'),_0xd0fa('0xdb'),_0xd0fa('0xdc')])),_0xd0fa('0x152'),_0xd0fa('0x153'));logger[_0xd0fa('0x5f')](_0x40b833);};Dialer['prototype']['saveInDb']=function(_0x20b510,_0x3ba0fe,_0x23a448){hopperUtils[_0xd0fa('0xc3')](_0x20b510)[_0xd0fa('0x98')](loggerCatch(_0x3ba0fe));hopperUtils[_0xd0fa('0xc5')](_0x20b510)['catch'](loggerCatch(_0x23a448));};Dialer[_0xd0fa('0x18')][_0xd0fa('0xd6')]=function(_0x1af690,_0x5e1bbe){hopperUtils[_0xd0fa('0xc3')](_0x1af690)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc4')));if(_0x5e1bbe==0x0){hopperUtils[_0xd0fa('0xc5')](_0x1af690)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x154')));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x155')]=function(_0xa91ec7){return Promise['resolve']()[_0xd0fa('0x95')](cmHopper[_0xd0fa('0x156')](_0xa91ec7['id'],previewRecallmeReminderInterval))['then'](function(_0x27251f){for(var _0x3648c2=0x0;_0x3648c2<_0x27251f['length'];_0x3648c2++){var _0x209fe0=_0x27251f[_0x3648c2]['Agent'][_0xd0fa('0x41')];if(_0x209fe0)io['to'](util['format'](_0xd0fa('0x144'),_0x209fe0))[_0xd0fa('0x3b')](_0xd0fa('0x145'),{'hopper':_0x27251f[_0x3648c2]});}})[_0xd0fa('0x98')](function(){});};Dialer[_0xd0fa('0x18')][_0xd0fa('0xaa')]=function(_0x26f628){var _0x91013=this;return function(){_0x91013[_0xd0fa('0x157')](_0x26f628);};};Dialer[_0xd0fa('0x18')]['actionOriginate']=function(_0x85bdf0,_0x11c3e2){var _0x43c8e9=this;var _0x4820c5=uuid['v4']();this['actions'][_0x4820c5]=new Action(_0x85bdf0,_0x11c3e2,_0x4820c5);return new Promise(function(_0x174b87,_0x349efd){if(_[_0xd0fa('0x50')](_0x85bdf0)&&typeof _0x85bdf0!==_0xd0fa('0x158')){return _0x349efd(msgResponse(_0xd0fa('0x159'),_0xd0fa('0x8b'),_0xd0fa('0x15a')));}if(_['isUndefined'](_0x11c3e2[_0xd0fa('0x15b')])||_0x11c3e2[_0xd0fa('0x15b')]===null){return _0x349efd(msgResponse(_0xd0fa('0x159'),'Failure',_0xd0fa('0x15c')));}var _0x12a361={'XMD-CALLERID':_0x43c8e9[_0xd0fa('0x22')][_0x4820c5][_0xd0fa('0x15d')](),'XMD-AGI':_0x85bdf0[_0xd0fa('0x12a')]?util[_0xd0fa('0x77')](_0xd0fa('0x15e'),ipAgi,_0x85bdf0['dialQueueProject']):_0xd0fa('0x15f'),'XMD-AGIAFTER':_0x85bdf0[_0xd0fa('0xc1')]?util[_0xd0fa('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x85bdf0[_0xd0fa('0xc1')]):_0xd0fa('0x15f'),'XMD-QUEUE':utils[_0xd0fa('0x160')](_0x85bdf0)?util['format']('\x22%s,%s%s,,,%s\x22',_0x85bdf0[_0xd0fa('0x41')],_0x85bdf0['dialQueueOptions']||'',_0x85bdf0['dialAgiAfterHangupAgent']?'c':'',_0x85bdf0[_0xd0fa('0xc8')]||0x3):'NONE','XMD-CONTACTID':_0x11c3e2[_0xd0fa('0xd9')],'XMD-CDRTYPE':_0xd0fa('0x6'),'CALLERID(all)':_0x43c8e9[_0xd0fa('0x22')][_0x4820c5][_0xd0fa('0x15d')](),'XMD-AMD':_0x85bdf0[_0xd0fa('0x122')]?_0xd0fa('0x136'):_0xd0fa('0x15f'),'XMD-DESTINATION':_0xd0fa('0x10b')};if(_0x85bdf0['dialAMDActive']){_0x12a361[_0xd0fa('0x161')]=_0x85bdf0[_0xd0fa('0x162')]||0x9c4;_0x12a361['XMD-AMDGREETING']=_0x85bdf0[_0xd0fa('0x163')]||0x5dc;_0x12a361[_0xd0fa('0x164')]=_0x85bdf0['dialAMDAfterGreetingSilence']||0x320;_0x12a361[_0xd0fa('0x165')]=_0x85bdf0[_0xd0fa('0x166')]||0x1388;_0x12a361[_0xd0fa('0x167')]=_0x85bdf0[_0xd0fa('0x168')]||0x64;_0x12a361[_0xd0fa('0x169')]=_0x85bdf0['dialAMDBetweenWordsSilence']||0x32;_0x12a361['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x85bdf0[_0xd0fa('0x16a')]||0x3;_0x12a361[_0xd0fa('0x16b')]=_0x85bdf0[_0xd0fa('0x16c')]||0x100;_0x12a361[_0xd0fa('0x16d')]=_0x85bdf0[_0xd0fa('0x16e')]||0x1388;}if(utils[_0xd0fa('0x160')](_0x85bdf0)){_0x12a361['XMD-VOICEQUEUEID']=_0x11c3e2[_0xd0fa('0xdb')];}else{_0x12a361[_0xd0fa('0x16f')]=_0x11c3e2['CampaignId'];}for(var _0x250302 in _0x11c3e2[_0xd0fa('0x170')]){if(typeof _0x11c3e2[_0xd0fa('0x170')][_0x250302]!==_0xd0fa('0xa5')){if(isNotNull(_0x11c3e2[_0xd0fa('0x170')][_0x250302])&&_0x250302!=='id'&&_0x250302!==_0xd0fa('0x171')&&_0x250302!==_0xd0fa('0x172')&&_0x250302!=='updatedAt'){_0x12a361[util[_0xd0fa('0x77')](_0xd0fa('0x173'),_0xd0fa('0x174'),_[_0xd0fa('0x175')](_0x250302))]=_0x11c3e2['Contact'][_0x250302];}}}var _0x5a9e43=_0x43c8e9[_0xd0fa('0x7f')](_0x85bdf0[_0xd0fa('0x85')])?utils[_0xd0fa('0x176')](_0x85bdf0[_0xd0fa('0x85')]['callerid'],_0x85bdf0[_0xd0fa('0x177')],_0x85bdf0[_0xd0fa('0x178')]>0x0?utils[_0xd0fa('0x179')](_0x85bdf0['dialOriginateCallerIdNumber'],_0x85bdf0[_0xd0fa('0x178')]):_0x85bdf0[_0xd0fa('0x17a')]):utils['getCallerId'](_['isNil'](_0x85bdf0['TrunkBackup'])?_0x85bdf0['Trunk']['callerid']:_0x85bdf0[_0xd0fa('0x17b')][_0xd0fa('0x17c')],_0x85bdf0[_0xd0fa('0x177')],_0x85bdf0['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xd0fa('0x179')](_0x85bdf0[_0xd0fa('0x17a')],_0x85bdf0[_0xd0fa('0x178')]):_0x85bdf0[_0xd0fa('0x17a')]);if(_0x5a9e43){_0x12a361['XMD-ORIGINATECALLERIDNAME']=_0x43c8e9['actions'][_0x4820c5]['originatecalleridname']=utils[_0xd0fa('0x17d')](_0x5a9e43);_0x12a361[_0xd0fa('0x17e')]=_0x11c3e2[_0xd0fa('0x15b')];}_0x85bdf0[_0xd0fa('0x17f')]=_0x12a361;return ami['Action']({'actionid':_0x4820c5,'action':_0xd0fa('0x159'),'channel':_0x43c8e9[_0xd0fa('0x7f')](_0x85bdf0[_0xd0fa('0x85')])?util[_0xd0fa('0x77')]('SIP/%s/%s%s',_0x85bdf0[_0xd0fa('0x85')][_0xd0fa('0x41')],isNotNull(_0x85bdf0[_0xd0fa('0x180')])?_0x85bdf0[_0xd0fa('0x180')][_0xd0fa('0x181')]()||'':'',_0x85bdf0[_0xd0fa('0x182')]>0x0?_0x11c3e2[_0xd0fa('0x15b')]['substring'](_0x85bdf0[_0xd0fa('0x182')]):_0x11c3e2[_0xd0fa('0x15b')]):util['format'](_0xd0fa('0x183'),_[_0xd0fa('0xef')](_0x85bdf0['TrunkBackup'])?_0x85bdf0[_0xd0fa('0x85')][_0xd0fa('0x41')]:_0x85bdf0[_0xd0fa('0x17b')][_0xd0fa('0x41')],isNotNull(_0x85bdf0['dialPrefix'])?_0x85bdf0[_0xd0fa('0x180')][_0xd0fa('0x181')]()||'':'',_0x85bdf0[_0xd0fa('0x182')]>0x0?_0x11c3e2[_0xd0fa('0x15b')][_0xd0fa('0x184')](_0x85bdf0[_0xd0fa('0x182')]):_0x11c3e2[_0xd0fa('0x15b')]),'callerid':_0x5a9e43,'Exten':_0xd0fa('0x10b'),'Context':'from-sip','Priority':'1','variable':_0x12a361,'timeout':(_0x85bdf0[_0xd0fa('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4820c5})[_0xd0fa('0x95')](function(_0x5b92aa){return _0x174b87(_0x5b92aa);})['catch'](function(_0x518208){_0x85bdf0[_0xd0fa('0x186')]+=0x1;var _0x1acc87=new History(_0x43c8e9[_0xd0fa('0x22')][_0x4820c5]);logger[_0xd0fa('0x5f')](util[_0xd0fa('0x77')](_0xd0fa('0x187'),JSON[_0xd0fa('0x6e')](_0x518208)));_0x1acc87[_0xd0fa('0x68')]=0xe;_0x1acc87['statedesc']=_0xd0fa('0x188');_0x1acc87['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x1acc87['endtime']=_0x1acc87[_0xd0fa('0x6a')];hopperUtils[_0xd0fa('0xc3')](_0x1acc87)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x189')));_0x43c8e9[_0xd0fa('0xc5')](_0x1acc87)[_0xd0fa('0x98')](loggerCatch('[originate][error]'))[_0xd0fa('0x1a')](function(){delete _0x43c8e9[_0xd0fa('0x22')][_0x4820c5];return _0x349efd(msgResponse(_0xd0fa('0x159'),_0xd0fa('0x7e'),_0xd0fa('0x18a')));});});});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x18b')]=function(_0x3553fa,_0x490d9a,_0x5b8307){var _0x14d097=new History(_0x490d9a);if(_0x14d097[_0xd0fa('0x117')]+_0x14d097['countcongestionretry']+_0x14d097[_0xd0fa('0x118')]+_0x14d097[_0xd0fa('0x119')]+_0x14d097['countdropretry']+_0x14d097['countabandonedretry']+_0x14d097[_0xd0fa('0x11a')]+_0x14d097['countagentrejectretry']>=_0x5b8307[_0xd0fa('0x11b')]-0x1){return!![];}switch(_0x3553fa){case 0x3:if(_0x14d097[_0xd0fa('0x118')]>=_0x5b8307[_0xd0fa('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x14d097['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5b8307[_0xd0fa('0x18d')],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x14d097[_0xd0fa('0x117')]>=_0x5b8307[_0xd0fa('0x18e')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countbusyretry':_0x14d097[_0xd0fa('0x117')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x18f')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x190')));break;case 0x8:if(_0x14d097['countcongestionretry']>=_0x5b8307[_0xd0fa('0x191')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countcongestionretry':_0x14d097['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5b8307[_0xd0fa('0x192')],'minutes')[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x14d097[_0xd0fa('0x119')]>=_0x5b8307[_0xd0fa('0x193')]-0x1){return!![];}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countnosuchnumberretry':_0x14d097['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialNoSuchNumberRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x194')));}break;case 0xa:if(_0x14d097['countdropretry']>=_0x5b8307[_0xd0fa('0xd5')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countdropretry':_0x14d097[_0xd0fa('0xcf')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialDropRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097['ContactId'],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xdd')));break;case 0xb:if(_0x14d097[_0xd0fa('0xe3')]>=_0x5b8307['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x14d097[_0xd0fa('0xe3')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialAbandonedRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xe8')));break;case 0x13:if(_0x14d097[_0xd0fa('0x11a')]>=_0x5b8307['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x14d097['countmachineretry']+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x120')],_0xd0fa('0xd8'))[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));break;case 0x14:if(_0x14d097[_0xd0fa('0x127')]>=_0x5b8307['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countagentrejectretry':_0x14d097[_0xd0fa('0x127')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x195')],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xd0fa('0x196')]=function(_0x75338b,_0x1bb07e,_0x473360){var _0xda7ca3=this;var _0xe78420=new History(_0x75338b);var _0x140862=![];var _0x9134b;var _0x3693bd;return new Promise(function(_0xb78ae8,_0x29aa0d){if(_[_0xd0fa('0x50')](_0x1bb07e)&&typeof _0x1bb07e!==_0xd0fa('0x158')){return _0x29aa0d(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x473360)&&typeof _0x473360!==_0xd0fa('0x158')){return _0x29aa0d(msgResponse(_0xd0fa('0x197'),_0xd0fa('0x8b'),_0xd0fa('0x198')));}hopperUtils[_0xd0fa('0xe4')](_0xe78420,_0x473360[_0xd0fa('0x199')],_0x1bb07e)[_0xd0fa('0x95')](function(_0x4cee8c){if(_0x4cee8c[_0xd0fa('0xd4')]==0x1)_0x140862=!![];switch(_0x473360[_0xd0fa('0x199')]){case'0':_0x1bb07e[_0xd0fa('0x19a')]+=0x1;_0xe78420['state']=0x0;_0xe78420[_0xd0fa('0xcb')]='NoSuchNumber';_0xe78420['countnosuchnumberretry']+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x19b')));_0x9134b=_0x1bb07e[_0xd0fa('0x19c')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xda7ca3[_0xd0fa('0x18b')](0x0,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x119')]>=_0x1bb07e[_0xd0fa('0x193')]){_0xda7ca3['createStateFinal'](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x19d'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x19d'));}}break;case'3':_0x1bb07e['outboundNoAnswerCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x3;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x19e');_0xe78420[_0xd0fa('0x118')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;var _0x51ba5a=ut['buildNoAnswerEventPayload'](_0x75338b,_0x1bb07e);ami[_0xd0fa('0x3b')]('custom:agentnoanswer',_0x51ba5a);_0x9134b=_0x1bb07e['dialNoAnswerRetryFrequency'];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x19f')));if(_0xda7ca3[_0xd0fa('0x18b')](0x3,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x118')]>=_0x1bb07e[_0xd0fa('0x18c')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a1'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a1'));}}break;case'5':_0x1bb07e['outboundBusyCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x5;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x1a2');_0xe78420[_0xd0fa('0x117')]+=0x1;_0xe78420['countglobal']+=0x1;ami[_0xd0fa('0x3b')]('custom:agentbusy',ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x1a3')));_0x9134b=_0x1bb07e[_0xd0fa('0x18f')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)['catch'](loggerCatch(_0xd0fa('0x1a4')));if(_0xda7ca3[_0xd0fa('0x18b')](0x5,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x117')]>=_0x1bb07e['dialBusyMaxRetry']){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a5'));}else{_0xda7ca3['stateGlobal'](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x205\x20busy');}}break;case'8':_0x1bb07e['outboundCongestionCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x8;_0xe78420['statedesc']=_0xd0fa('0x1a6');_0xe78420[_0xd0fa('0x126')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0x192')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];ami[_0xd0fa('0x3b')](_0xd0fa('0x1a7'),ut['buildObj'](_0x75338b,_0xd0fa('0x1a8')));hopperUtils[_0xd0fa('0xc3')](_0xe78420)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xda7ca3['checkRetriveMax'](0x8,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x126')]>=_0x1bb07e[_0xd0fa('0x191')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a9'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a9'));}}break;case'11':_0x1bb07e[_0xd0fa('0x1aa')]+=0x1;_0xe78420['state']=0xb;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0xe78420['countabandonedretry']+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0xe7')];_0x3693bd=_0x1bb07e['callAdditionalPhoneAfterMin'];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe9')));if(_0xda7ca3['checkRetriveMax'](0xb,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0xe3')]>=_0x1bb07e[_0xd0fa('0xe5')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1ab'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2011\x20abandoned');}}break;case'20':_0x1bb07e['outboundRejectCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x14;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x1ac');_0xe78420[_0xd0fa('0x127')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0x195')];_0x3693bd=_0x1bb07e['callAdditionalPhoneAfterMin'];ami[_0xd0fa('0x3b')](_0xd0fa('0x1ad'),ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x1ae')));hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x1af')));if(_0xda7ca3[_0xd0fa('0x18b')](0x14,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x127')]>=_0x1bb07e[_0xd0fa('0x1b0')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2020\x20agentreject');}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2020\x20agentreject');}}break;default:_0x1bb07e[_0xd0fa('0x12e')]+=0x1;_0xe78420[_0xd0fa('0x68')]=0xc;_0xe78420[_0xd0fa('0xcb')]=_0x473360['reason'];_0x9134b=_0x1bb07e[_0xd0fa('0x195')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xda7ca3[_0xd0fa('0x18b')](_0x473360[_0xd0fa('0x199')],_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420['countbusyretry']+_0xe78420[_0xd0fa('0x126')]+_0xe78420[_0xd0fa('0x118')]+_0xe78420[_0xd0fa('0x119')]+_0xe78420[_0xd0fa('0xcf')]+_0xe78420['countabandonedretry']+_0xe78420[_0xd0fa('0x11a')]+_0xe78420[_0xd0fa('0x127')]>=_0x1bb07e['dialGlobalMaxRetry']){_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0x473360['reason']);}else{_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0x473360['reason']);}}}})['then'](function(){if(_0x140862){hopperUtils['swapAdditionalPhones'](_0xe78420,_0x9134b,_0x3693bd)['then'](function(){return _0xb78ae8(0x1);});}});});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x11c')]=function(_0x131651,_0x50df79,_0x46002d,_0x37167d){var _0x3f305a=new Final(_0x131651);_0x3f305a['state']=0xf;_0x3f305a['statedesc']=_0xd0fa('0x1b1');this[_0xd0fa('0x1a0')](_0x3f305a,_0x50df79,_0x46002d,_0x37167d);};Dialer[_0xd0fa('0x18')]['createStateFinal']=function(_0x4d7ac6,_0x45673b,_0x6956db,_0x30e57a){hopperUtils['moveContactManagedDialer'](_0x4d7ac6)[_0xd0fa('0x95')](function(){return _0x45673b(msgResponse('[callProgressDetecting]',_0xd0fa('0x106'),_0x30e57a));})[_0xd0fa('0x98')](function(){return _0x6956db(msgResponse(_0xd0fa('0x1b2'),_0xd0fa('0x8b'),_0xd0fa('0x1b3')));});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x8')]=function(_0x267976){var _0x3912da=_0x267976[_0xd0fa('0x1b4')]/0x64;var _0x4f688a=_0x267976[_0xd0fa('0xc9')]/(_0x267976[_0xd0fa('0xc9')]+_0x267976[_0xd0fa('0xbe')]);var _0x31dd56=Math[_0xd0fa('0x1b5')](_0x267976[_0xd0fa('0x1b6')]*(_0x267976[_0xd0fa('0x1b7')]/0x64));var _0x1f4096=Math[_0xd0fa('0x1b5')](_0x267976[_0xd0fa('0x1b6')]*(_0x267976[_0xd0fa('0x1b8')]/0x64));var _0x1bc911=_0x267976[_0xd0fa('0x134')]+_0x267976[_0xd0fa('0x1b9')];var _0x5b34b9=Math['floor'](_0x267976[_0xd0fa('0x56')]*_0x267976[_0xd0fa('0x58')]*_0x267976[_0xd0fa('0x1ba')]*_0x267976['predictiveIntervalMultiplicativeFactor']);if(_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x133')])){if(!_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x26')])){_0x267976['startPredictive']=undefined;loggerPredictive[_0xd0fa('0x5f')](_0xd0fa('0x1bb'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x5d')])){loggerPredictive['error'](_0xd0fa('0x1bb'),_0xd0fa('0x1bc'));clearInterval(_0x267976[_0xd0fa('0x5d')]);_0x267976['handlePredictive']=undefined;}_0x267976[_0xd0fa('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x267976[_0xd0fa('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x267976[_0xd0fa('0x133')]);this[_0xd0fa('0xaf')](_0x267976,0x1);}else if(ifInterval(_0x267976[_0xd0fa('0x1bd')],_0x267976[_0xd0fa('0x133')])){this['handlePower'](_0x267976,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x267976[_0xd0fa('0x133')],_0x267976[_0xd0fa('0x41')]);_0x267976[_0xd0fa('0x56')]=0x0;_0x267976[_0xd0fa('0xca')]=0x0;}else if(_0x3912da<_0x4f688a&&_0x267976[_0xd0fa('0x1be')]===_0xd0fa('0x1bf')){clearPredictiveAttributes(_0x267976);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xd0fa('0x1c0'),_0x4f688a,_0xd0fa('0x133'),_0x267976[_0xd0fa('0x41')]);}else if(_0x5b34b9<_0x267976[_0xd0fa('0xca')]&&_0x267976[_0xd0fa('0x1be')]==='dropRate'){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x1c1'),_0xd0fa('0x1c2'),_0x5b34b9,'Drop\x20in\x20this\x20interval',_0x267976[_0xd0fa('0xca')],_0xd0fa('0x133'),_0x267976[_0xd0fa('0x41')]);}else if(!ifInterval(_0x267976['dialPredictiveInterval'],_0x267976[_0xd0fa('0x133')])&&_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x26')])&&!_[_0xd0fa('0x50')](_0x267976['startProgressive'])){_0x267976[_0xd0fa('0x26')]=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));loggerPredictive['info'](_0x267976['name'],_0xd0fa('0x1c3'),_0x267976[_0xd0fa('0x26')]);hopperUtils[_0xd0fa('0x1c4')](_0x267976[_0xd0fa('0x1bd')])[_0xd0fa('0x95')](this[_0xd0fa('0x1c5')](_0x267976))[_0xd0fa('0x95')](mergeDataErlangB(_0x267976))[_0xd0fa('0x95')](this[_0xd0fa('0x1c6')](_0x267976))[_0xd0fa('0x98')](loggerCatchPredictive(_0xd0fa('0x1c7'),_0x267976));}else if(!ifInterval(_0x267976[_0xd0fa('0x1bd')],_0x267976[_0xd0fa('0x26')])){_0x267976[_0xd0fa('0xca')]=0x0;_0x267976['startPredictive']=moment()['format'](_0xd0fa('0xbc'));loggerPredictive[_0xd0fa('0x44')](_0x267976[_0xd0fa('0x41')],_0xd0fa('0x1c8'),_0x267976[_0xd0fa('0x26')]);clearInterval(_0x267976[_0xd0fa('0x5d')]);_0x267976[_0xd0fa('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x267976[_0xd0fa('0x1bd')])['then'](this[_0xd0fa('0x1c5')](_0x267976))['then'](mergeDataErlangB(_0x267976))[_0xd0fa('0x95')](this[_0xd0fa('0x1c6')](_0x267976))[_0xd0fa('0x98')](loggerCatchPredictive(_0xd0fa('0x1c9'),_0x267976));}else if(_0x267976[_0xd0fa('0x1b6')]&&_0x1bc911<_0x267976[_0xd0fa('0x1b6')]-_0x1f4096){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0x267976['name'],_0xd0fa('0x1ca'),_0x1bc911,_0xd0fa('0x1cb'),_0x267976[_0xd0fa('0x1b6')],'-',_0x1f4096,'=',_0x267976[_0xd0fa('0x1b6')]-_0x1f4096,')');}else if(_0x267976['predictiveIntervalAvailable']&&_0x1bc911>_0x267976['predictiveIntervalAvailable']+_0x31dd56){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0x267976[_0xd0fa('0x41')],_0xd0fa('0x1ca'),_0x1bc911,_0xd0fa('0x1cc'),_0x267976['predictiveIntervalAvailable'],'+',_0x31dd56,'=',_0x267976[_0xd0fa('0x1b6')]+_0x31dd56,')');}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1c5')]=function(_0x402b92){var _0x5b1266=this;return function(_0x3444a5){return new Promise(function(_0x4969a4,_0x23c0ff){_['merge'](_0x402b92,_0x3444a5[0x0]);if(checkGetDataPredictive(_0x3444a5[0x0])){var _0x6c0cec=_0x402b92[_0xd0fa('0x1b6')]=_0x402b92['talking']+_0x402b92[_0xd0fa('0x134')];var _0x4e38d5=_0x402b92['dialPredictiveInterval']*0x3c;var _0x1fd4df=_0x3444a5[0x0][_0xd0fa('0x4e')]+_0x3444a5[0x0][_0xd0fa('0x1cd')];var _0x41bd8a=(_0x3444a5[0x0][_0xd0fa('0x49')]+_0x3444a5[0x0][_0xd0fa('0x1ce')]+_0x3444a5[0x0][_0xd0fa('0x4c')])/_0x3444a5[0x0][_0xd0fa('0x47')];_0x402b92[_0xd0fa('0x1ba')]=_0x41bd8a>0x0?_0x41bd8a:0x1;switch(_0x402b92[_0xd0fa('0x1be')]){case'dropRate':var _0x557274=_0x402b92['dialPredictiveOptimizationPercentage']/0x64;return _0x5b1266['abandonmentRate'](_0x6c0cec,_0x4e38d5,_0x1fd4df,_0x41bd8a,_0x557274)[_0xd0fa('0x95')](function(_0x30bb2a){return _0x4969a4(_0x30bb2a);});case'agentBusyFactor':var _0x208e8c=_0x402b92[_0xd0fa('0x1b4')]/0x64;return _0x5b1266[_0xd0fa('0x1cf')](_0x6c0cec,_0x4e38d5,_0x1fd4df,_0x41bd8a,_0x208e8c)['then'](function(_0x42c2ff){return _0x4969a4(_0x42c2ff);});default:return _0x23c0ff(msgResponse(_0xd0fa('0x1d0'),'Failure','Unknown\x20Predictive'));}}else{return _0x23c0ff(msgResponse('[getDataPredictive]',_0xd0fa('0x8b'),'check\x20failure'));}});};};Dialer['prototype'][_0xd0fa('0x1d1')]=function(_0x55a962){var _0x465fbc=this;return function(_0xee00b8){return new Promise(function(_0x2b9655,_0x23a80d){_['merge'](_0x55a962,_0xee00b8[0x0]);if(checkGetDataPredictive(_0xee00b8[0x0])){loggerPredictive[_0xd0fa('0x44')](JSON[_0xd0fa('0x6e')](_0xee00b8[0x0]));if(_0x55a962[_0xd0fa('0x1be')]==='dropRate'){return _0x465fbc[_0xd0fa('0x1d2')](_0x55a962['id'])[_0xd0fa('0x95')](function(_0xdbee75){var _0x241e6d=_0x55a962[_0xd0fa('0x1d3')]-_0xdbee75[0x0]['outboundQueuePauses'];var _0x5dcbb1=_0x55a962['dialPredictiveInterval']*0x3c;var _0x3506c=_0xee00b8[0x0][_0xd0fa('0x4e')]+_0xee00b8[0x0][_0xd0fa('0x1cd')];var _0x49762c=(_0xee00b8[0x0][_0xd0fa('0x49')]+_0xee00b8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xee00b8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xee00b8[0x0][_0xd0fa('0x47')];var _0x209ddc=_0x55a962[_0xd0fa('0x1b4')]/0x64;_0x55a962[_0xd0fa('0x1d4')]=_0xdbee75[0x0][_0xd0fa('0x1d5')]||0x0;_0x55a962[_0xd0fa('0x1ba')]=_0x49762c>0x0?_0x49762c:0x1;return _0x465fbc[_0xd0fa('0x1d6')](_0x241e6d,_0x5dcbb1,_0x3506c,_0x49762c,_0x209ddc);})[_0xd0fa('0x95')](function(_0x11be4b){return _0x2b9655(_0x11be4b);})['catch'](function(_0xa8ea60){return _0x23a80d(msgResponse(_0xd0fa('0x1d7'),_0xd0fa('0x8b'),JSON['stringify'](_0xa8ea60)));});}if(_0x55a962['dialPredictiveOptimization']===_0xd0fa('0x1d8')){return _0x465fbc[_0xd0fa('0x1d2')](_0x55a962['id'])[_0xd0fa('0x95')](function(_0x92ca96){var _0x5e5b9f=_0x55a962[_0xd0fa('0x1d3')]-_0x92ca96[0x0][_0xd0fa('0x1d5')];var _0x1a3705=_0x55a962[_0xd0fa('0x1bd')]*0x3c;var _0xfb36f5=_0xee00b8[0x0][_0xd0fa('0x4e')]+_0xee00b8[0x0]['predictiveIntervalAvgHoldtime'];var _0x27f644=(_0xee00b8[0x0][_0xd0fa('0x49')]+_0xee00b8[0x0][_0xd0fa('0x1ce')]+_0xee00b8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xee00b8[0x0][_0xd0fa('0x47')];var _0x48e041=_0x55a962[_0xd0fa('0x1b4')]/0x64;_0x55a962[_0xd0fa('0x1d4')]=_0x92ca96[0x0][_0xd0fa('0x1d5')]||0x0;_0x55a962[_0xd0fa('0x1ba')]=_0x27f644>0x0?_0x27f644:0x1;return _0x465fbc[_0xd0fa('0x1cf')](_0x5e5b9f,_0x1a3705,_0xfb36f5,_0x27f644,_0x48e041);})[_0xd0fa('0x95')](function(_0x13ed98){return _0x2b9655(_0x13ed98);})[_0xd0fa('0x98')](function(_0x32c65d){return _0x23a80d(msgResponse(_0xd0fa('0x1d7'),_0xd0fa('0x8b'),JSON['stringify'](_0x32c65d)));});}}else{return _0x23a80d(msgResponse(_0xd0fa('0x1d0'),'Failure',_0xd0fa('0x1d9')));}});};};Dialer[_0xd0fa('0x18')]['startMethodPredictive']=function(_0x476d03){var _0x2b73bf=this;return function(){var _0x10eb0c=0x0;var _0x3705ce=Math['floor'](_0x476d03[_0xd0fa('0x1da')]*0x3e8);if(_0x3705ce>0x0){_0x3705ce=_0x3705ce<0x64?0x64:_0x3705ce;loggerPredictive[_0xd0fa('0x44')](_0x476d03[_0xd0fa('0x41')],_0xd0fa('0x1db'),_0x3705ce,_0xd0fa('0x1dc'));_0x476d03[_0xd0fa('0x5d')]=setInterval(function(){_0x2b73bf[_0xd0fa('0x5d')](_0x476d03);loggerPredictiveCalls[_0xd0fa('0x44')](_0xd0fa('0x1dd'),_0x10eb0c+=0x1);},_0x3705ce);}else{loggerPredictive[_0xd0fa('0x44')](_0x476d03[_0xd0fa('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1de')]=function(_0x1f243f,_0x4a4bd5){var _0x3e0243=this;return function(_0x506f54){if(_[_0xd0fa('0x43')](_0x506f54)){if(_['isNil'](_0x4a4bd5[_0xd0fa('0x151')])||!_0x4a4bd5[_0xd0fa('0x1df')]){if(_0x1f243f[_0xd0fa('0xad')]==='booked'){_0x1f243f[_0xd0fa('0x6b')]=_[_0xd0fa('0x50')](_0x1f243f[_0xd0fa('0x6b')])?!![]:_0x1f243f[_0xd0fa('0x6b')];var _0x15e696=uuid['v4']();_0x3e0243[_0xd0fa('0x22')][_0x15e696]=new Action(_0x1f243f,_0x4a4bd5,_0x15e696);loggerBooked['info'](_0xd0fa('0x1e0'),_0x15e696,_0xd0fa('0x1e1'),JSON[_0xd0fa('0x6e')](_0x1f243f[_0xd0fa('0x6b')]),_0xd0fa('0x1e2'),_0x1f243f[_0xd0fa('0x41')]);if(_0x1f243f['queueStatusComplete']){_0x1f243f[_0xd0fa('0x6b')]=![];_0x3e0243[_0xd0fa('0x27')][_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xb7')]]=[];ami[_0xd0fa('0x149')]({'actionid':_0x15e696,'action':_0xd0fa('0x1e3'),'queue':_0x1f243f[_0xd0fa('0x41')]})[_0xd0fa('0x98')](function(){_0x3e0243[_0xd0fa('0xba')](_0x1f243f);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xd9')],'ListId':_0x3e0243['actions'][_0x15e696]['ListId'],'VoiceQueueId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3e0243[_0xd0fa('0x22')][_0x15e696]['CampaignId']||undefined})['catch'](loggerCatch(_0xd0fa('0x1e4')));delete _0x3e0243[_0xd0fa('0x22')][_0x15e696];});}else{loggerBooked[_0xd0fa('0x44')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x1f243f[_0xd0fa('0x6b')]),_0xd0fa('0x1e2'),_0x1f243f[_0xd0fa('0x41')]);_0x3e0243[_0xd0fa('0xba')](_0x1f243f);hopperUtils[_0xd0fa('0xe6')]({'active':![],'ContactId':_0x3e0243['actions'][_0x15e696][_0xd0fa('0xd9')],'ListId':_0x3e0243['actions'][_0x15e696][_0xd0fa('0xda')],'VoiceQueueId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3e0243['actions'][_0x15e696];}}else{return _0x3e0243[_0xd0fa('0x1e5')](_0x1f243f,_0x4a4bd5);}}else{if(utils[_0xd0fa('0xc7')](undefined,_0x4a4bd5[_0xd0fa('0x1e6')])<_0x1f243f['dialRecallMeTimeout']*0x3c){if(_0x4a4bd5[_0xd0fa('0x143')]&&!_0x4a4bd5[_0xd0fa('0x143')][_0xd0fa('0x1e7')]){_0x3e0243[_0xd0fa('0xf5')]['run'](_0x4a4bd5['id'])['finally'](function(){_0x3e0243['updateOriginated'](_0x1f243f);});}else{hopperUtils[_0xd0fa('0x1e8')]({'active':![]},_0x4a4bd5['id'],0x1)[_0xd0fa('0x1a')](function(){_0x3e0243[_0xd0fa('0xba')](_0x1f243f);});}}else{_0x1f243f[_0xd0fa('0x1e9')]+=0x1;_0x3e0243[_0xd0fa('0xba')](_0x1f243f);if(_0x1f243f[_0xd0fa('0x1ea')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a4bd5[_0xd0fa('0xd9')],'ListId':_0x4a4bd5[_0xd0fa('0xda')],'VoiceQueueId':_0x4a4bd5['VoiceQueueId']||undefined,'CampaignId':_0x4a4bd5[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xd0fa('0xc3')](createObjHistory(_0x1f243f,_0x4a4bd5,utils[_0xd0fa('0x63')][_0xd0fa('0x1eb')],0x17,_0xd0fa('0x1ec')))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x1ed')));}else{_0x3e0243[_0xd0fa('0x111')](createObjHistory(_0x1f243f,_0x4a4bd5,utils[_0xd0fa('0x63')]['RECALL_TIMEOUT'],0x16,_0xd0fa('0x1ee')),_0xd0fa('0x1ef'),_0xd0fa('0x1f0'));}}}}else{_0x1f243f['outboundBlacklistCallsDay']+=0x1;_0x3e0243[_0xd0fa('0x111')](createObjHistory(_0x1f243f,_0x4a4bd5,utils['CAMPAIGN_STATUS'][_0xd0fa('0x1f1')],0xd,_0xd0fa('0x1f2')),_0xd0fa('0x1f3'),_0xd0fa('0x1f4'));throw _0xd0fa('0x1f5');}};};Dialer['prototype']['handleIvr']=function(_0x59654e){var _0x5b7e2b=this;var _0x19645f=_0x59654e['limitCalls']-_0x59654e[_0xd0fa('0x7a')]-_0x59654e[_0xd0fa('0x1f6')];emitCampaignSummary(_0x59654e);if(_0x19645f>0x0){if(_0x19645f>this[_0xd0fa('0x20')]){_0x19645f=this[_0xd0fa('0x20')];}_0x59654e['temp']+=_0x19645f;hopperUtils[_0xd0fa('0x1f7')](_0x59654e['id'],_0x19645f,_0x59654e[_0xd0fa('0x1f8')],_0x59654e)['then'](function(_0x29018c){_0x59654e[_0xd0fa('0x1f6')]-=_0x19645f;_0x59654e[_0xd0fa('0x1f6')]=_0x59654e[_0xd0fa('0x1f6')]>0x0?_0x59654e['temp']:0x0;if(!utils[_0xd0fa('0x1f9')](_0x29018c)){_0x59654e['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0xd0fa('0x44')]('[getContactCampaign2][Empty]'+_0x59654e[_0xd0fa('0x41')]);}else{_0x59654e['originated']+=_0x29018c[_0xd0fa('0x91')];_0x59654e[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['RUNNING'];for(var _0x1858f2=0x0;_0x1858f2<_0x29018c[_0xd0fa('0x91')];_0x1858f2+=0x1){_0x59654e[_0xd0fa('0x1fa')]+=0x1;if(_[_0xd0fa('0xef')](_0x29018c[_0x1858f2])||_['isNil'](_0x29018c[_0x1858f2]['Contact'])||_[_0xd0fa('0xef')](_0x29018c[_0x1858f2][_0xd0fa('0x15b')])){_0x5b7e2b['emptyContact'](_0xd0fa('0x1fb'),_0x59654e,_0x29018c[_0x1858f2]);}else{hopperUtils[_0xd0fa('0x1fc')](_['pick'](_0x29018c[_0x1858f2],[_0xd0fa('0xdc'),_0xd0fa('0x15b')]))[_0xd0fa('0x95')](_0x5b7e2b[_0xd0fa('0x1de')](_0x59654e,_0x29018c[_0x1858f2]))[_0xd0fa('0x98')](_0x5b7e2b[_0xd0fa('0x14f')](_0xd0fa('0x1fd'),_0x59654e));}}}})[_0xd0fa('0x98')](loggerGetContactDialer('[getContactCampaign2]',_0x59654e,_0x19645f));}};Dialer[_0xd0fa('0x18')]['handlePower']=function(_0x3d55ba,_0x4d248c){var _0x298105=this;var _0x3badcb=[];if(_0x4d248c<0x1||_0x3d55ba['dialMethod']===_0xd0fa('0x7')){_0x4d248c=0x1;}var _0x388144=Math[_0xd0fa('0x1fe')](_0x3d55ba['available']*_0x4d248c)-_0x3d55ba[_0xd0fa('0x7a')]-_0x3d55ba[_0xd0fa('0x1f6')];if(_0x3d55ba[_0xd0fa('0x1ff')]>0x0){var _0x386947=_0x3d55ba[_0xd0fa('0x1ff')]-_0x3d55ba[_0xd0fa('0x7a')]-_0x3d55ba[_0xd0fa('0x1b9')]-_0x3d55ba[_0xd0fa('0x1f6')]-_0x3d55ba['pTalking'];if(_0x388144>_0x386947){_0x388144=_0x386947;}}if(_0x388144>0x0){if(_0x3d55ba[_0xd0fa('0xad')]===_0xd0fa('0x7')){_0x388144=0x1;}if(_0x388144>this[_0xd0fa('0x20')]){_0x388144=this[_0xd0fa('0x20')];}_0x3d55ba[_0xd0fa('0x1f6')]+=_0x388144;for(var _0x2eb795 in this['agents']){if(typeof this[_0xd0fa('0x1e')][_0x2eb795]!=='undefined'){if(this[_0xd0fa('0x1e')][_0x2eb795]['state']===_0xd0fa('0x200')&&this[_0xd0fa('0x1e')][_0x2eb795][_0xd0fa('0x82')]==='reachable'){_0x3badcb[_0xd0fa('0x92')](this[_0xd0fa('0x1e')][_0x2eb795]['id']);}}}hopperUtils['getContactDialer'](_0x3d55ba,_0x3badcb,_0x388144)[_0xd0fa('0x95')](function(_0x3c4fdf){_0x3d55ba['temp']-=_0x388144;_0x3d55ba[_0xd0fa('0x1f6')]=_0x3d55ba[_0xd0fa('0x1f6')]>0x0?_0x3d55ba[_0xd0fa('0x1f6')]:0x0;if(!utils['checkContactEmpty'](_0x3c4fdf)){hopperUtils['countReScheduled'](_0x3d55ba)['then'](sendMessageReschedule(_0x3d55ba))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x201')));}else{_0x3d55ba[_0xd0fa('0x7a')]+=_0x3c4fdf[_0xd0fa('0x91')];_0x3d55ba[_0xd0fa('0x62')]=_0x3d55ba[_0xd0fa('0xad')]===_0xd0fa('0x7')?utils[_0xd0fa('0x63')][_0xd0fa('0x136')]:utils[_0xd0fa('0x63')][_0xd0fa('0x202')];for(var _0x283fa3=0x0;_0x283fa3<_0x3c4fdf['length'];_0x283fa3+=0x1){if(_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3])||_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3][_0xd0fa('0x170')])||_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3][_0xd0fa('0x15b')])){_0x298105['emptyContact'](_0xd0fa('0x1fb'),_0x3d55ba,_0x3c4fdf[_0x283fa3]);}else{hopperUtils[_0xd0fa('0x203')](_['pick'](_0x3c4fdf[_0x283fa3],[_0xd0fa('0xdb'),_0xd0fa('0x15b')]))[_0xd0fa('0x95')](_0x298105[_0xd0fa('0x1de')](_0x3d55ba,_0x3c4fdf[_0x283fa3]))[_0xd0fa('0x98')](_0x298105[_0xd0fa('0x14f')]('[actionOriginate]\x20',_0x3d55ba));}}}})[_0xd0fa('0x98')](loggerGetContactDialer(_0xd0fa('0x204'),_0x3d55ba,_0x388144));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x5d')]=function(_0x5ba40e){if(_0x5ba40e[_0xd0fa('0x1ff')]>0x0){var _0x4204c8=_0x5ba40e['dialLimitQueue']-_0x5ba40e[_0xd0fa('0x7a')]-_0x5ba40e[_0xd0fa('0x1b9')];if(_0x4204c8>0x0){this['tryOriginatePredictive'](_0x5ba40e);}else{loggerPredictiveCalls[_0xd0fa('0x44')](_0xd0fa('0x205'));}}else{this[_0xd0fa('0x206')](_0x5ba40e);}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x206')]=function(_0x2814ae){var _0xa71771=this;var _0x4a749e=[];_0x2814ae[_0xd0fa('0x7a')]+=0x1;for(var _0x22b81e in this['agents']){if(typeof this[_0xd0fa('0x1e')][_0x22b81e]!=='undefined'){if(this[_0xd0fa('0x1e')][_0x22b81e][_0xd0fa('0x68')]===_0xd0fa('0x200')&&this['agents'][_0x22b81e][_0xd0fa('0x82')]===_0xd0fa('0x141')){_0x4a749e[_0xd0fa('0x92')](this[_0xd0fa('0x1e')][_0x22b81e]['id']);}}}return this['getContactDialer'](_0x2814ae['id'],_0x4a749e,0x1,_0x2814ae[_0xd0fa('0x1f8')],_0x2814ae)[_0xd0fa('0x95')](function(_0x5da608){if(!utils['checkContactEmpty'](_0x5da608)){utils['checkContactLowerLimitOriginate'](_0x2814ae,0x1,0x0);return hopperUtils[_0xd0fa('0x207')](_0x2814ae)[_0xd0fa('0x95')](sendMessageReschedule(_0x2814ae))['catch'](loggerCatch(_0xd0fa('0x201')));}else{_0x2814ae[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['RUNNING'];if(_[_0xd0fa('0xef')](_0x5da608[0x0])||_[_0xd0fa('0xef')](_0x5da608[0x0]['Contact'])||_[_0xd0fa('0xef')](_0x5da608[0x0][_0xd0fa('0x15b')])){_0xa71771[_0xd0fa('0x208')](_0xd0fa('0x1fb'),_0x2814ae,_0x5da608[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xd0fa('0x6f')](_0x5da608[0x0],[_0xd0fa('0xdb'),'phone']))[_0xd0fa('0x95')](_0xa71771[_0xd0fa('0x1de')](_0x2814ae,_0x5da608[0x0]))[_0xd0fa('0x98')](_0xa71771[_0xd0fa('0x14f')](_0xd0fa('0x209'),_0x2814ae));}}})[_0xd0fa('0x98')](loggerGetContactDialer(_0xd0fa('0x20a'),_0x2814ae,0x1));};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1d6')]=function(_0x8ae22a,_0x413ed5,_0x40170f,_0x324aee,_0x2b798d,_0x4cb760){loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20b'));loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20c'),_0x8ae22a);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20d'),_0x413ed5);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20e'),_0x40170f);loggerPredictive['info']('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',_0x324aee);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20f'),_0x2b798d);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));return new Promise(function(_0x3af70c,_0x1999c6){if(_0x8ae22a<=0x0||isNaN(_0x8ae22a)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),_0xd0fa('0x7e'),'m\x20=\x20'+_0x8ae22a));}if(_0x40170f<=0x0||isNaN(_0x40170f)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),'Error',_0xd0fa('0x211')+_0x40170f));}if(_0x324aee<=0x0||isNaN(_0x324aee)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),'Error',_0xd0fa('0x212')+_0x324aee));}if(_0x413ed5<=0x0||isNaN(_0x413ed5)){return _0x1999c6(msgResponse('[abandonmentRate]',_0xd0fa('0x7e'),_0xd0fa('0x213')+_0x413ed5));}if(_0x2b798d<=0x0||isNaN(_0x2b798d)){return _0x1999c6(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x2b798d));}_0x4cb760=_0x4cb760||0x0;var _0x3df581=0x1/_0x40170f;var _0x151827=0x0;var _0x30c879=0x0;var _0x3d9cb7=0x0;var _0x1d74b2=0x0;for(var _0x6d2d6=0x0;_0x3d9cb7<_0x2b798d;_0x6d2d6+=0x1){_0x30c879=_0x6d2d6/_0x413ed5;_0x151827=(_0x324aee*_0x30c879+_0x4cb760)/_0x3df581;_0x3d9cb7=utils[_0xd0fa('0x214')](_0x151827,_0x8ae22a);_0x1d74b2=_0x151827/_0x8ae22a*(0x1-utils[_0xd0fa('0x214')](_0x151827,_0x8ae22a));}return _0x3af70c({'erlangCalls':_0x6d2d6,'erlangCallToSecond':_0x413ed5/_0x6d2d6,'erlangAbandonmentRate':_0x3d9cb7,'erlangBusyFactor':_0x1d74b2});});};Dialer['prototype'][_0xd0fa('0x1cf')]=function(_0x513cf8,_0x3da018,_0x52a9af,_0x181187,_0x3dd1a3,_0x5c7cd4){loggerPredictive[_0xd0fa('0x44')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20c'),_0x513cf8);loggerPredictive['info'](_0xd0fa('0x20d'),_0x3da018);loggerPredictive[_0xd0fa('0x44')]('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',_0x52a9af);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x215'),_0x181187);loggerPredictive[_0xd0fa('0x44')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3dd1a3);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));return new Promise(function(_0x161442,_0x1404a2){if(_0x513cf8<=0x0||isNaN(_0x513cf8)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),'m\x20=\x20'+_0x513cf8));}if(_0x52a9af<=0x0||isNaN(_0x52a9af)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),_0xd0fa('0x211')+_0x52a9af));}if(_0x181187<=0x0||isNaN(_0x181187)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),'Error',_0xd0fa('0x212')+_0x181187));}if(_0x3da018<=0x0||isNaN(_0x3da018)){return _0x1404a2(msgResponse('[busyFactor]',_0xd0fa('0x7e'),_0xd0fa('0x213')+_0x3da018));}if(_0x3dd1a3<=0x0||isNaN(_0x3dd1a3)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),_0xd0fa('0x217')+_0x3dd1a3));}_0x5c7cd4=_0x5c7cd4||0x0;var _0x2f2abf=0x1/_0x52a9af;var _0x26bd0b=0x0;var _0x386d76=0x0;var _0x298741=0x0;var _0xc6d21a=0x0;for(var _0x458711=0x0;_0xc6d21a<_0x3dd1a3;_0x458711+=0x1){_0x386d76=_0x458711/_0x3da018;_0x26bd0b=(_0x181187*_0x386d76+_0x5c7cd4)/_0x2f2abf;_0x298741=utils[_0xd0fa('0x214')](_0x26bd0b,_0x513cf8);_0xc6d21a=_0x26bd0b/_0x513cf8*(0x1-utils[_0xd0fa('0x214')](_0x26bd0b,_0x513cf8));}return _0x161442({'erlangCalls':_0x458711,'erlangCallToSecond':_0x3da018/_0x458711,'erlangAbandonmentRate':_0x298741,'erlangBusyFactor':_0xc6d21a});});};module[_0xd0fa('0x218')]=Dialer; \ No newline at end of file +var _0xb244=['voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncOriginateResponse','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','then','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','queueStatusComplete','CAMPAIGN_STATUS','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','isIVRCampaignActive','\x20NOT\x20Active','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','is\x20disactive','isTrunkReachable','active','reachable','status','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','interval','catch','indexOf','true','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','resolve','checkIfTime','dialGlobalInterval','launchHandleIvr','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','queue','uniqueid','ivr','updateOriginated','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','getSeconds','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','CALLEREXIT','verifyAdditionalPhones','voiceQueue','countabandonedretry','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','roundrobin','isNil','paused','stateinterface','locked','rrmemory','merge','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','callProgressDetecting','variable','dialAMDActive','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','value','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countnoanswerretry','reason19\x20machine....','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','[syncHangupIvr]','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','INACTIVE','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','Agent','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','phone','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedRetryFrequency','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','NO_AVAILABLE_CONTACTS','RUNNING','ivrTotalCallsDays','loggerHandler','[actionOriginateIvr]\x20','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','Amax\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb244,0x1f4));var _0x4b24=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb244[_0x2d7f0e];return _0x110b07;};'use strict';var util=require(_0x4b24('0x0'));var _=require('lodash');var uuid=require(_0x4b24('0x1'));var moment=require(_0x4b24('0x2'));var rr=require('rr');var Redis=require(_0x4b24('0x3'));var utils=require(_0x4b24('0x4'));var hopperUtils=require(_0x4b24('0x5'));var ut=require(_0x4b24('0x6'));var config=require(_0x4b24('0x7'));var logger=require(_0x4b24('0x8'))('dialer');var loggerBooked=require(_0x4b24('0x8'))('booked');var loggerPredictive=require(_0x4b24('0x8'))(_0x4b24('0x9'));var loggerPredictiveCalls=require(_0x4b24('0x8'))(_0x4b24('0xa'));var loggerSyncQueueSummary=require(_0x4b24('0x8'))(_0x4b24('0xb'));var ami=require(_0x4b24('0xc'));config[_0x4b24('0xd')]=_[_0x4b24('0xe')](config[_0x4b24('0xd')],{'host':_0x4b24('0xf'),'port':0x18eb});var io=require(_0x4b24('0x10'))(new Redis(config[_0x4b24('0xd')]));var cmHopper=require(_0x4b24('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0x4b24('0x12'));var Action=require(_0x4b24('0x13'));var History=require(_0x4b24('0x14'));var Final=require(_0x4b24('0x15'));var AgentComplete=require(_0x4b24('0x16'));var QueueCallerAbandon=require(_0x4b24('0x17'));var Hangup=require(_0x4b24('0x18'));var ipAgi=process['env'][_0x4b24('0x19')]||_0x4b24('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4b24('0x1b')][_0x4b24('0x1c')]=function(_0x295fd3){this['tail']=this[_0x4b24('0x1d')]?this[_0x4b24('0x1d')][_0x4b24('0x1e')](_0x295fd3):_0x295fd3();};function Dialer(_0x4481dc,_0x3f48fe){this[_0x4b24('0x1f')]=new Sequence();this[_0x4b24('0x20')]=_0x3f48fe;this[_0x4b24('0x21')]=_0x4481dc[_0x4b24('0x21')];this[_0x4b24('0x22')]=_0x4481dc['campaigns'];this[_0x4b24('0x23')]=_0x4481dc[_0x4b24('0x23')];this[_0x4b24('0x24')]=_0x4481dc[_0x4b24('0x24')];this[_0x4b24('0x25')]=config['maxNumberOriginate']||0x2;this[_0x4b24('0x26')]={};this[_0x4b24('0x27')]={};this[_0x4b24('0x28')]={};this[_0x4b24('0x29')]={};this[_0x4b24('0x2a')]={};this[_0x4b24('0x2b')]={};this[_0x4b24('0x2c')]={};this['ivrOriginated']={};this[_0x4b24('0x2d')]={};this[_0x4b24('0x2e')]={};this[_0x4b24('0x2f')]={};ami['on'](_0x4b24('0x30'),this[_0x4b24('0x31')][_0x4b24('0x32')](this));ami['on'](_0x4b24('0x33'),this['syncQueueCallerAbandon'][_0x4b24('0x32')](this));ami['on']('originateresponse',this[_0x4b24('0x34')][_0x4b24('0x32')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x4b24('0x32')](this));ami['on'](_0x4b24('0x35'),this[_0x4b24('0xb')]['bind'](this));ami['on'](_0x4b24('0x36'),this[_0x4b24('0x37')][_0x4b24('0x32')](this));ami['on'](_0x4b24('0x38'),this[_0x4b24('0x39')]['bind'](this));ami['on'](_0x4b24('0x3a'),this[_0x4b24('0x3b')][_0x4b24('0x32')](this));ami['on'](_0x4b24('0x3c'),this[_0x4b24('0x3d')][_0x4b24('0x32')](this));ami['on']('queuemember',this[_0x4b24('0x3e')][_0x4b24('0x32')](this));ami['on'](_0x4b24('0x3f'),this[_0x4b24('0x40')][_0x4b24('0x32')](this));this[_0x4b24('0x41')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x4b24('0x42')](function(_0x11f579){previewRecallmeReminderInterval=_0x11f579['previewRecallmeReminderInterval'];});}function isNotNull(_0x293760){return _0x293760!==null&&!_[_0x4b24('0x43')](_0x293760);}function msgResponse(_0x4df770,_0x3336fe,_0x139129){return{'action':_0x4df770,'response':_0x3336fe,'message':_0x139129,'stack':_0x139129};}function emit(_0xd34944,_0x3e168b,_0x5c299f){io['to'](_0xd34944)['emit'](_0x3e168b,_0x5c299f);}function emitOutboundVoiceQueueSummary(_0x360721){if(_0x360721[_0x4b24('0x44')]==='outbound'){logger[_0x4b24('0x45')](_0x4b24('0x46'),util[_0x4b24('0x47')](_0x360721,{'showHidden':![],'depth':null}));emit(util[_0x4b24('0x48')](_0x4b24('0x49'),_0x360721[_0x4b24('0x4a')]),'voice_queue:save',_0x360721);}}function checkGetDataPredictive(_0x232a5f){if(isNotNull(_0x232a5f)&&!_['isEmpty'](_0x232a5f)){loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x4c'));loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x4d'),_0x232a5f[_0x4b24('0x4e')]);loggerPredictive[_0x4b24('0x4b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x232a5f[_0x4b24('0x4f')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x232a5f[_0x4b24('0x50')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x51'),_0x232a5f[_0x4b24('0x52')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x53'),_0x232a5f[_0x4b24('0x54')]);loggerPredictive['info'](_0x4b24('0x55'),_0x232a5f[_0x4b24('0x56')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x57'));if(_0x232a5f[_0x4b24('0x4e')]>0x0){if(!_['isUndefined'](_0x232a5f[_0x4b24('0x56')])&&_0x232a5f[_0x4b24('0x56')]>0x0){return!![];}loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x58'));if(!_[_0x4b24('0x43')](_0x232a5f[_0x4b24('0x54')])&&_0x232a5f['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x59'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x5a'));}return![];}function mergeDataErlangB(_0x187554){return function(_0x53c7a1){loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x5b'));loggerPredictive['info'](_0x4b24('0x5c'),_0x53c7a1[_0x4b24('0x5d')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x5e'),_0x53c7a1[_0x4b24('0x5f')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53c7a1[_0x4b24('0x60')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x61'),_0x53c7a1[_0x4b24('0x62')]);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x63'),_0x53c7a1[_0x4b24('0x60')]);loggerPredictive['info'](_0x4b24('0x57'));_['merge'](_0x187554,_0x53c7a1);};}function ifInterval(_0x56a615,_0x4fb03a){if(_[_0x4b24('0x43')](_0x4fb03a)){return![];}return utils['getSeconds'](undefined,_0x4fb03a)<_0x56a615*0x3c;}function clearPredictiveAttributes(_0x11d0a2){if(_0x11d0a2['startProgressive']){_0x11d0a2[_0x4b24('0x2c')]=undefined;loggerPredictive[_0x4b24('0x45')](_0x11d0a2[_0x4b24('0x4a')],_0x4b24('0x64'));}if(_0x11d0a2[_0x4b24('0x2b')]){_0x11d0a2['startPredictive']=undefined;loggerPredictive[_0x4b24('0x45')](_0x11d0a2[_0x4b24('0x4a')],_0x4b24('0x65'));}if(_0x11d0a2[_0x4b24('0x66')]){clearInterval(_0x11d0a2[_0x4b24('0x66')]);_0x11d0a2[_0x4b24('0x66')]=undefined;loggerPredictive[_0x4b24('0x45')](_0x11d0a2[_0x4b24('0x4a')],_0x4b24('0x67'));}}function loggerCatchPredictive(_0x3c19f1,_0x5110f4){return function(_0x16c9c8){loggerPredictive[_0x4b24('0x68')](_0x5110f4[_0x4b24('0x4a')],_0x3c19f1);loggerPredictive[_0x4b24('0x68')](_0x16c9c8['stack']);clearPredictiveAttributes(_0x5110f4);};}function loggerCatch(_0x21f49a){return function(_0x11b4d7){logger[_0x4b24('0x68')](_0x21f49a,util[_0x4b24('0x47')](_0x11b4d7,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xa15ae0,_0x4d8a04,_0x1931c3){return function(_0x35e3c7){utils[_0x4b24('0x69')](_0x4d8a04,_0x1931c3,0x0);logger[_0x4b24('0x68')](_0xa15ae0,util['inspect'](_0x35e3c7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x438fc2){return function(_0x6348f2){if(isNotNull(_0x6348f2)&&isNotNull(_0x6348f2[0x0])){if(_0x6348f2[0x0][_0x4b24('0x6a')]>0x0){_0x438fc2[_0x4b24('0x6b')]=utils['CAMPAIGN_STATUS'][_0x4b24('0x6c')];logger[_0x4b24('0x4b')](_0x4b24('0x6d')+_0x438fc2[_0x4b24('0x4a')],_0x6348f2[0x0][_0x4b24('0x6a')],_0x4b24('0x6e'));}else{_0x438fc2[_0x4b24('0x6b')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x4b24('0x4b')](_0x4b24('0x6f')+_0x438fc2[_0x4b24('0x4a')]);}}};}function createObjHistory(_0x442196,_0x2e27c8,_0x2c2acd,_0x589f35,_0x23774a){_0x442196['message']=_0x2c2acd;var _0x24e177=new Action(_0x442196,_0x2e27c8);var _0x259eab=new History(_0x24e177);_0x259eab[_0x4b24('0x70')]=_0x589f35;_0x259eab[_0x4b24('0x71')]=_0x23774a;_0x259eab[_0x4b24('0x72')]=_0x24e177[_0x4b24('0x73')];return _0x259eab;}function unlockQueueStatus(_0xb5bc4d,_0x899899){setTimeout(function(){if(_[_0x4b24('0x43')](_0xb5bc4d['queueStatusComplete'])){loggerBooked[_0x4b24('0x68')](_0x4b24('0x74'),_0x899899);}_0xb5bc4d['queueStatusComplete']=!![];loggerBooked[_0x4b24('0x4b')](_0x4b24('0x75'),_0x899899,JSON[_0x4b24('0x76')](_[_0x4b24('0x77')](_0xb5bc4d,[_0x4b24('0x4a'),_0x4b24('0x78')])));},0x1f3);}function checkInterval(_0xd0b946){return function(){if(!isNotNull(_0xd0b946['Interval'])){_0xd0b946[_0x4b24('0x6b')]=utils[_0x4b24('0x79')][_0x4b24('0x7a')];throw _0xd0b946[_0x4b24('0x4a')]+_0x4b24('0x7b');}if(!isNotNull(_0xd0b946[_0x4b24('0x7c')][_0x4b24('0x7d')])){_0xd0b946[_0x4b24('0x6b')]=utils[_0x4b24('0x79')]['NULL_INTERVAL'];throw _0xd0b946[_0x4b24('0x4a')]+_0x4b24('0x7b');}if(!isNotNull(_[_0x4b24('0x7e')](_0xd0b946['Interval'][_0x4b24('0x7d')]))){_0xd0b946[_0x4b24('0x6b')]=utils[_0x4b24('0x79')][_0x4b24('0x7a')];throw _0xd0b946[_0x4b24('0x4a')]+_0x4b24('0x7b');}};}function checkIsIVRCampaignActive(_0x57914e){return function(){if(!utils[_0x4b24('0x7f')](_0x57914e)){_0x57914e[_0x4b24('0x6b')]=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x57914e[_0x4b24('0x4a')]+_0x4b24('0x80');}};}function emitCampaignSummary(_0x494551){if(utils['isIVRCampaign'](_0x494551)){emit(util[_0x4b24('0x48')]('campaign:ivr:%s',_0x494551[_0x4b24('0x4a')]),'campaign:save',_0x494551);}}function loggerCatchQueueSummary(_0x5b6a9d,_0x37ca33){return function(_0x301938){clearPredictiveAttributes(_0x37ca33);emitCampaignSummary(_0x37ca33);loggerSyncQueueSummary[_0x4b24('0x45')](_0x5b6a9d,util['inspect'](_0x301938,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xd3a947){if(_0xd3a947[_0x4b24('0x81')]){if(_0xd3a947[_0x4b24('0x82')]===0x0){_0xd3a947['sendMessageOneNotActive']=![];_0xd3a947[_0x4b24('0x6b')]=utils[_0x4b24('0x79')]['INACTIVE'];loggerSyncQueueSummary[_0x4b24('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xd3a947[_0x4b24('0x4a')],_0x4b24('0x83'));}else{_0xd3a947[_0x4b24('0x6b')]=utils[_0x4b24('0x79')][_0x4b24('0x84')];loggerSyncQueueSummary[_0x4b24('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xd3a947[_0x4b24('0x4a')],_0x4b24('0x85'));}emitCampaignSummary(_0xd3a947);}}function myreject(_0xf0d3ca){return function(_0x7a0d77){return _0xf0d3ca(msgResponse('[ifTime][Action]','Error',JSON[_0x4b24('0x76')](_0x7a0d77)));};}Dialer[_0x4b24('0x1b')][_0x4b24('0x86')]=function(_0x312817){return!_[_0x4b24('0x43')](_0x312817)&&_0x312817&&!_['isUndefined'](_0x312817[_0x4b24('0x4a')])&&!_[_0x4b24('0x43')](_0x312817[_0x4b24('0x87')])&&_0x312817[_0x4b24('0x87')]&&(this[_0x4b24('0x24')][util[_0x4b24('0x48')]('SIP/%s',_0x312817['name'])]['status']===_0x4b24('0x88')||this[_0x4b24('0x24')][util[_0x4b24('0x48')]('SIP/%s',_0x312817[_0x4b24('0x4a')])][_0x4b24('0x89')]==='unmonitored');};Dialer[_0x4b24('0x1b')][_0x4b24('0x8a')]=function(_0x33c8de){var _0x539961=this;return function(){if(!_0x539961[_0x4b24('0x86')](_0x33c8de[_0x4b24('0x8b')])){if(!_0x539961[_0x4b24('0x86')](_0x33c8de[_0x4b24('0x8c')])){_0x33c8de[_0x4b24('0x6b')]=utils[_0x4b24('0x79')]['TRUNK_NOT_REACHABLE'];throw _0x33c8de[_0x4b24('0x4a')]+_0x4b24('0x8d');}}};};Dialer[_0x4b24('0x1b')]['checkIfTime']=function(_0x15e4fe,_0x3bb67b,_0x4e1513,_0xd6a2ba){var _0x348a92=this;return function(){var _0x140622=!![];return _0x348a92['ifTimeIvr'](_0x15e4fe,_0x3bb67b,_0x4e1513,_0xd6a2ba,_0x140622);};};Dialer[_0x4b24('0x1b')][_0x4b24('0x8e')]=function(_0x7fb578,_0xa10f9b,_0x39d7cb,_0x4dc1a9){var _0x1fba7e=this;return function(){var _0xf4976a=![];return _0x1fba7e['ifTimeIvr'](_0x7fb578[_0x4b24('0x7d')],_0xa10f9b,_0x39d7cb,_0x4dc1a9,_0xf4976a);};};Dialer['prototype'][_0x4b24('0x8f')]=function(_0x8086e0,_0x50eeee,_0x54ae25,_0x903b07,_0xb59bee){var _0x10f855=[];return new Promise(function(_0x91f0d0,_0x3632bf){if(!isNotNull(_0x8086e0)){_0x903b07[_0x4b24('0x6b')]=utils[_0x4b24('0x79')]['NULL_INTERVAL'];return _0x3632bf(msgResponse(_0x4b24('0x90'),_0x4b24('0x91'),_0x54ae25+_0x4b24('0x92')));}if(_['isEmpty'](_0x8086e0)){_0x903b07[_0x4b24('0x6b')]=utils[_0x4b24('0x79')][_0x4b24('0x93')];return _0x3632bf(msgResponse(_0x4b24('0x90'),_0x4b24('0x91'),_0x54ae25+'\x20Intervals\x20is\x20empty\x20'));}if(_0x50eeee&&_[_0x4b24('0x43')](config[_0x4b24('0x94')][_0x50eeee])){_0x903b07['message']=utils[_0x4b24('0x79')][_0x4b24('0x95')];return _0x3632bf(msgResponse(_0x4b24('0x90'),_0x4b24('0x91'),_0x54ae25+_0x4b24('0x96')+_0x50eeee));}if(_['isArray'](_0x8086e0)){for(var _0x4e5dbc=0x0;_0x4e5dbc<_0x8086e0[_0x4b24('0x97')];_0x4e5dbc+=0x1){_0x10f855[_0x4b24('0x98')](ami[_0x4b24('0x99')]({'action':_0x4b24('0x9a'),'command':util[_0x4b24('0x48')](_0x4b24('0x9b'),_0x8086e0[_0x4e5dbc][_0x4b24('0x9c')],!_[_0x4b24('0x43')](config[_0x4b24('0x94')][_0x50eeee])?_0x50eeee:'')})['then'](function(_0x17157b){return _0x17157b['content']['indexOf']('true')>=0x0;})[_0x4b24('0x9d')](myreject(_0x3632bf)));}}else{_0x10f855[_0x4b24('0x98')](ami[_0x4b24('0x99')]({'action':_0x4b24('0x9a'),'command':util[_0x4b24('0x48')](_0x4b24('0x9b'),_0x8086e0,!_[_0x4b24('0x43')](config[_0x4b24('0x94')][_0x50eeee])?_0x50eeee:'')})[_0x4b24('0x42')](function(_0x5cc5f3){return _0x5cc5f3['content'][_0x4b24('0x9e')](_0x4b24('0x9f'))>=0x0;})[_0x4b24('0x9d')](myreject(_0x3632bf)));}Promise[_0x4b24('0xa0')](_0x10f855)[_0x4b24('0x42')](function(_0x29c574){var _0x355149=_[_0x4b24('0xa1')](_0x29c574);if(_0x355149){return _0x91f0d0(_0x355149);}else{_0x903b07['message']=_0xb59bee?utils['CAMPAIGN_STATUS'][_0x4b24('0xa2')]:utils[_0x4b24('0x79')][_0x4b24('0xa3')];return _0x3632bf(msgResponse(_0x4b24('0xa4'),'Failure',_0x4b24('0xa5')+_0xb59bee+'\x20'+_0x54ae25+_0x4b24('0xa6')+util[_0x4b24('0x47')](_0x8086e0,{'showHidden':![],'depth':null})+_0x4b24('0xa7')+_0x50eeee));}})[_0x4b24('0x9d')](function(_0x371a54){return _0x3632bf(msgResponse(_0x4b24('0x90'),_0x4b24('0x91'),JSON[_0x4b24('0x76')](_0x371a54)));});});};Dialer['prototype'][_0x4b24('0x41')]=function(){var _0x162e27=this;return cmHopper[_0x4b24('0xa8')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x162e27['syncCampaigns']();},0x3e8);});};Dialer[_0x4b24('0x1b')][_0x4b24('0xa9')]=function(){var _0x119b67=this;var _0x396e61;for(var _0x54217e in this['campaigns']){if(typeof this[_0x4b24('0x22')][_0x54217e]!==_0x4b24('0xaa')){_0x396e61=this[_0x4b24('0x22')][_0x54217e];if(utils[_0x4b24('0xab')](_0x396e61)&&utils[_0x4b24('0x7f')](_0x396e61)){_0x396e61[_0x4b24('0x81')]=!![];Promise[_0x4b24('0xac')]()[_0x4b24('0x42')](checkIsIVRCampaignActive(_0x396e61))[_0x4b24('0x42')](checkInterval(_0x396e61))[_0x4b24('0x42')](_0x119b67[_0x4b24('0x8a')](_0x396e61))[_0x4b24('0x42')](_0x119b67[_0x4b24('0xad')](_0x396e61[_0x4b24('0xae')],_0x396e61['dialTimezone'],_0x396e61['name'],_0x396e61))[_0x4b24('0x42')](_0x119b67[_0x4b24('0x8e')](_0x396e61[_0x4b24('0x7c')],_0x396e61['dialTimezone'],_0x396e61['name'],_0x396e61))['then'](_0x119b67[_0x4b24('0xaf')](_0x396e61))[_0x4b24('0x9d')](loggerCatchQueueSummary('[syncCampaigns]',_0x396e61));}else{notSendMessagesCampaign(_0x396e61);}}}};Dialer[_0x4b24('0x1b')][_0x4b24('0xb0')]=function(_0x216ccd){if(_0x216ccd['dialMethod']!==_0x4b24('0x9')){clearPredictiveAttributes(_0x216ccd);}switch(_0x216ccd[_0x4b24('0xb1')]){case _0x4b24('0xb2'):this['handlePower'](_0x216ccd,0x1);break;case _0x4b24('0xb3'):this[_0x4b24('0xb4')](_0x216ccd,_0x216ccd[_0x4b24('0xb5')]);break;case _0x4b24('0x9'):this[_0x4b24('0x9')](_0x216ccd);break;case _0x4b24('0xb6'):this[_0x4b24('0xb4')](_0x216ccd,0x1);break;default:logger['error'](_0x4b24('0xb7'),_0x216ccd[_0x4b24('0x4a')],_0x4b24('0xb8'));}};Dialer[_0x4b24('0x1b')]['ifTime']=function(_0x2073c4,_0xe6a195){var _0x35f190=_0x2073c4['dialTimezone'];var _0x565bf6=_0xe6a195?_0x2073c4['dialGlobalInterval']:_0x2073c4[_0x4b24('0x7c')][_0x4b24('0x7d')];logger[_0x4b24('0xb9')]('Dialer::ifTime()',_0x565bf6,_0x35f190,_0x2073c4['name'],util['format'](_0x4b24('0xba'),_0x2073c4['name'],_0x2073c4['id']));var _0x493b6d=null;return Interval['intervalIftime'](_0x565bf6,_0x35f190)[_0x4b24('0x42')](function(_0x3216c1){if(_0x3216c1===!![]){return _0x3216c1;}else{_0x2073c4[_0x4b24('0x6b')]=_0xe6a195?utils[_0x4b24('0x79')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x4b24('0x79')][_0x4b24('0xa3')];_0x493b6d=msgResponse(_0x4b24('0xa4'),_0x4b24('0x91'),_0x4b24('0xa5')+_0xe6a195+'\x20'+_0x2073c4[_0x4b24('0x4a')]+_0x4b24('0xa6')+util[_0x4b24('0x47')](_0x565bf6,{'showHidden':![],'depth':null})+_0x4b24('0xa7')+_0x35f190);}if(_0x493b6d!==null){logger[_0x4b24('0xb9')](_0x4b24('0xbb'),_0x493b6d);_0x493b6d[_0x4b24('0xbc')]=_0xe6a195;throw _0x493b6d;}})[_0x4b24('0x9d')](function(_0x40fd0a){logger['error'](_0x4b24('0xbd'),_0x40fd0a);throw msgResponse('[ifTime][Action]',_0x4b24('0xbe'),util[_0x4b24('0x47')](_0x40fd0a,{'showHidden':![],'depth':null}));});};Dialer[_0x4b24('0x1b')][_0x4b24('0x31')]=function(_0x2b4a8f){if(this[_0x4b24('0x21')][_0x2b4a8f[_0x4b24('0xbf')]]){if(this['uniqueId'][_0x2b4a8f[_0x4b24('0xc0')]]&&this[_0x4b24('0x29')][_0x2b4a8f[_0x4b24('0xc0')]]['type']!==_0x4b24('0xc1')){this[_0x4b24('0xc2')](this[_0x4b24('0x21')][_0x2b4a8f[_0x4b24('0xbf')]]);this[_0x4b24('0x29')][_0x2b4a8f['uniqueid']]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x4b24('0x1b')][_0x4b24('0xc3')]=function(_0x341d19){var _0x5adf0b=this[_0x4b24('0x29')][_0x341d19[_0x4b24('0xc0')]];if(this[_0x4b24('0x21')][_0x341d19[_0x4b24('0xbf')]]){if(_0x5adf0b&&_0x5adf0b['type']!==_0x4b24('0xc1')){delete this[_0x4b24('0x29')][_0x341d19[_0x4b24('0xc0')]];this[_0x4b24('0x21')][_0x341d19['queue']]['outboundAnswerCallsDay']+=0x1;var _0x3804c3=new AgentComplete(_0x5adf0b,_0x341d19);if(_0x341d19[_0x4b24('0xc4')]===_0x4b24('0xc5')){_0x3804c3[_0x4b24('0xc6')]=this[_0x4b24('0x21')][_0x341d19[_0x4b24('0xbf')]][_0x4b24('0xc7')]&&this[_0x4b24('0x21')][_0x341d19[_0x4b24('0xbf')]][_0x4b24('0xc8')]?moment()[_0x4b24('0x48')](_0x4b24('0xc9')):undefined;}hopperUtils[_0x4b24('0xca')](_0x3804c3)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xcb')));hopperUtils[_0x4b24('0xcc')](_0x3804c3)[_0x4b24('0x9d')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4b24('0x1b')]['syncQueueCallerAbandon']=function(_0x1f299c){var _0x730ad4=this[_0x4b24('0x29')][_0x1f299c[_0x4b24('0xc0')]];var _0x69d604=this;var _0x3eeee9=![];var _0x2904ae;var _0x363be6;if(this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]]){if(_0x730ad4&&_0x730ad4[_0x4b24('0x44')]!==_0x4b24('0xc1')){delete this[_0x4b24('0x29')][_0x1f299c[_0x4b24('0xc0')]];this[_0x4b24('0xc2')](this[_0x4b24('0x21')][_0x1f299c['queue']]);_0x730ad4[_0x4b24('0xcd')]=moment()[_0x4b24('0x48')](_0x4b24('0xc9'));var _0x118d04=new QueueCallerAbandon(_0x730ad4,_0x1f299c);if(utils[_0x4b24('0xce')](_0x730ad4[_0x4b24('0xcd')],_0x730ad4['responsetime'])>=_0x730ad4['dialQueueTimeout']){this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0xcf')]+=0x1;this['voiceQueues'][_0x1f299c['queue']][_0x4b24('0xd0')]+=0x1;_0x118d04[_0x4b24('0x70')]=0xa;_0x118d04[_0x4b24('0x71')]=_0x4b24('0xd1');_0x118d04[_0x4b24('0xd2')]=_0x4b24('0xd3');_0x118d04[_0x4b24('0xc6')]=this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]]['dialQueueProject2']?moment()[_0x4b24('0x48')](_0x4b24('0xc9')):undefined;_0x118d04[_0x4b24('0xd4')]+=0x1;_0x118d04[_0x4b24('0xd5')]+=0x1;_0x2904ae=this['voiceQueues'][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0xd6')];_0x363be6=this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x118d04,_0x118d04[_0x4b24('0x70')],_0x730ad4['voiceQueue'])['then'](function(_0x41d78e){_0x3eeee9=_0x41d78e[_0x4b24('0xd8')]==0x1;if(_0x118d04[_0x4b24('0xd4')]>=_0x69d604[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0xd9')]){_0x69d604[_0x4b24('0xda')](_0x118d04,_0x41d78e[_0x4b24('0xd8')]);}else{hopperUtils[_0x4b24('0xdb')]({'active':![],'countdropretry':_0x118d04[_0x4b24('0xd4')],'scheduledat':moment()['add'](_0x69d604['voiceQueues'][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0xd6')],_0x4b24('0xdc'))[_0x4b24('0x48')](_0x4b24('0xc9')),'ContactId':_0x730ad4[_0x4b24('0xdd')],'ListId':_0x730ad4[_0x4b24('0xde')],'VoiceQueueId':_0x730ad4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x730ad4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xe1')));var _0x2eafa4=new History(_0x118d04);_0x2eafa4[_0x4b24('0x70')]=0xa;_0x2eafa4['statedesc']=_0x4b24('0xd1');_0x2eafa4[_0x4b24('0x73')]=moment()[_0x4b24('0x48')](_0x4b24('0xc9'));_0x2eafa4[_0x4b24('0x72')]=_0x2eafa4[_0x4b24('0x73')];_0x2eafa4[_0x4b24('0xe2')]=_0x118d04[_0x4b24('0xe2')];_0x2eafa4[_0x4b24('0xe3')]=_0x118d04[_0x4b24('0xe3')];hopperUtils[_0x4b24('0xca')](_0x2eafa4)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xe4')));}})[_0x4b24('0x42')](function(){if(_0x3eeee9)hopperUtils[_0x4b24('0xe5')](_0x118d04,_0x2904ae,_0x363be6)[_0x4b24('0x42')](function(){return 0x1;});});}else{this[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]][_0x4b24('0x52')]+=0x1;this[_0x4b24('0x21')][_0x1f299c['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x118d04[_0x4b24('0x70')]=0xb;_0x118d04['statedesc']=_0x4b24('0xe6');_0x118d04[_0x4b24('0xd2')]=_0x4b24('0xe7');_0x118d04['countabandonedretry']+=0x1;_0x118d04[_0x4b24('0xd5')]+=0x1;_0x2904ae=this['voiceQueues'][_0x1f299c['queue']]['dialAbandonedRetryFrequency'];_0x363be6=this[_0x4b24('0x21')][_0x1f299c['queue']][_0x4b24('0xd7')];hopperUtils[_0x4b24('0xe8')](_0x118d04,_0x118d04['state'],_0x730ad4[_0x4b24('0xe9')])[_0x4b24('0x42')](function(_0x776aa0){if(_0x118d04[_0x4b24('0xea')]>=_0x69d604[_0x4b24('0x21')][_0x1f299c['queue']]['dialAbandonedMaxRetry']){_0x69d604[_0x4b24('0xda')](_0x118d04,_0x776aa0[_0x4b24('0xd8')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x118d04[_0x4b24('0xea')],'scheduledat':moment()[_0x4b24('0xeb')](_0x69d604[_0x4b24('0x21')][_0x1f299c[_0x4b24('0xbf')]]['dialAbandonedRetryFrequency'],_0x4b24('0xdc'))[_0x4b24('0x48')](_0x4b24('0xc9')),'ContactId':_0x730ad4['ContactId'],'ListId':_0x730ad4['ListId'],'VoiceQueueId':_0x730ad4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x730ad4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xec')));var _0x1bf59d=new History(_0x118d04);_0x1bf59d[_0x4b24('0x70')]=0xb;_0x1bf59d[_0x4b24('0x71')]=_0x4b24('0xe6');_0x1bf59d[_0x4b24('0x73')]=moment()['format'](_0x4b24('0xc9'));_0x1bf59d['endtime']=_0x1bf59d[_0x4b24('0x73')];_0x1bf59d[_0x4b24('0xe2')]=_0x118d04[_0x4b24('0xe2')];_0x1bf59d['calleridnum']=_0x118d04[_0x4b24('0xe3')];hopperUtils[_0x4b24('0xca')](_0x1bf59d)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xed')));}})[_0x4b24('0x42')](function(){if(_0x3eeee9)hopperUtils[_0x4b24('0xe5')](_0x118d04,_0x2904ae,_0x363be6)[_0x4b24('0x42')](function(){return 0x1;});});}}}};Dialer[_0x4b24('0x1b')][_0x4b24('0x3b')]=function(_0x1f29aa){if(this[_0x4b24('0x27')][_0x1f29aa[_0x4b24('0xc0')]]){this[_0x4b24('0x27')][_0x1f29aa[_0x4b24('0xc0')]][_0x4b24('0xee')]=_0x1f29aa['channel'];}if(this[_0x4b24('0x29')][_0x1f29aa['uniqueid']]){this['uniqueId'][_0x1f29aa[_0x4b24('0xc0')]][_0x4b24('0xee')]=_0x1f29aa[_0x4b24('0xee')];}};Dialer[_0x4b24('0x1b')]['syncQueueMember']=function(_0x5e24dc){if(!this[_0x4b24('0x27')][_0x5e24dc['actionid']]){return;}var _0x351b02=this[_0x4b24('0x21')][this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]]['queue']][_0x4b24('0xf0')]||'rrmemory';if(_0x351b02===_0x4b24('0xf1')){if(this[_0x4b24('0x27')][_0x5e24dc['actionid']]&&_[_0x4b24('0xf2')](this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]]['locked'])&&_0x5e24dc['status']==='1'&&_0x5e24dc[_0x4b24('0xf3')]==='0'){if(this[_0x4b24('0x23')][_0x5e24dc[_0x4b24('0xf4')]]){if(!this[_0x4b24('0x23')][_0x5e24dc[_0x4b24('0xf4')]]['locked']){this[_0x4b24('0x23')][_0x5e24dc[_0x4b24('0xf4')]][_0x4b24('0xf5')]=!![];this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]][_0x4b24('0xf5')]=!![];this[_0x4b24('0x27')][_0x5e24dc['actionid']][_0x4b24('0xf4')]=_0x5e24dc['stateinterface'];}}}}else if(_0x351b02===_0x4b24('0xf6')){if(this[_0x4b24('0x27')][_0x5e24dc['actionid']]){if(this[_0x4b24('0x23')][_0x5e24dc['stateinterface']]){this[_0x4b24('0x27')][_0x5e24dc['actionid']][_0x4b24('0xf4')]=_0x5e24dc['stateinterface'];if(_[_0x4b24('0xf2')](this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]][_0x4b24('0xbf')]])){this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]]['queue']]=[];}this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5e24dc[_0x4b24('0xef')]]['queue']][_0x4b24('0x98')](_[_0x4b24('0xf7')](_[_0x4b24('0x77')](this['actions'][_0x5e24dc['actionid']],[_0x4b24('0xf8'),'stateinterface']),{'status':_0x5e24dc['status'],'paused':_0x5e24dc[_0x4b24('0xf3')]}));}}}};Dialer[_0x4b24('0x1b')][_0x4b24('0x40')]=function(_0x5f1527){if(!this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]){return;}var _0x3ac25f=this;var _0x3a011d=this[_0x4b24('0x21')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xbf')]];var _0x169850=_0x3a011d[_0x4b24('0xf0')]||_0x4b24('0xf6');if(_0x169850===_0x4b24('0xf1')){if(this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]&&this[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xf4')]){this[_0x4b24('0x20')][_0x4b24('0xf9')](this[_0x4b24('0x27')][_0x5f1527['actionid']]['idHopper'],this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xf4')])['catch'](function(_0x3900db){logger[_0x4b24('0x68')](_0x4b24('0xfa'),util[_0x4b24('0x47')](_0x3900db,{'showHidden':![],'depth':null}));})[_0x4b24('0x1e')](function(){_0x3ac25f[_0x4b24('0xc2')](_0x3ac25f[_0x4b24('0x21')][_0x3ac25f[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xbf')]]);_0x3ac25f[_0x4b24('0x23')][_0x3ac25f['actions'][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xf4')]][_0x4b24('0xf5')]=![];delete _0x3ac25f['actions'][_0x5f1527[_0x4b24('0xef')]];unlockQueueStatus(_0x3a011d);});}else{this[_0x4b24('0xc2')](this['voiceQueues'][this[_0x4b24('0x27')][_0x5f1527['actionid']]['queue']]);hopperUtils[_0x4b24('0xdb')]({'active':![],'ContactId':this[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xdd')],'ListId':this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xde')],'VoiceQueueId':this[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xdf')]||undefined,'CampaignId':this['actions'][_0x5f1527[_0x4b24('0xef')]]['CampaignId']||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xfb')));delete this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]];unlockQueueStatus(_0x3a011d);}}else if(_0x169850===_0x4b24('0xf6')){var _0x920bc0;if(this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]&&!_[_0x4b24('0x7e')](this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]['queue']])){if(this[_0x4b24('0x2e')][_0x3ac25f[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]['queue']]){this['queueBookedRR'][_0x3ac25f[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xbf')]]=this[_0x4b24('0x2e')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xbf')]]?this[_0x4b24('0x2e')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]]['queue']]:this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xbf')]]?this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xbf')]][_0x4b24('0xfc')]||0x0:0x0;}this[_0x4b24('0x2d')][this[_0x4b24('0x27')][_0x5f1527['actionid']][_0x4b24('0xbf')]][_0x4b24('0xfc')]=this[_0x4b24('0x2e')][this[_0x4b24('0x27')][_0x5f1527[_0x4b24('0xef')]][_0x4b24('0xbf')]];for(var _0x12f1af=0x0;_0x12f1af=_0x5aa8a6[_0x4b24('0x122')]){_0x24b562[_0x4b24('0x123')](_0x1875d3,_0xfd76f5,_0x11c713,'reason19\x20machine....');}else{if(_0x1875d3[_0x4b24('0x120')]>=_0x5aa8a6[_0x4b24('0x124')]){_0x24b562['createStateFinal'](_0x1875d3,_0xfd76f5,_0x11c713,_0x4b24('0x125'));}else{hopperUtils[_0x4b24('0xdb')]({'active':![],'countmachineretry':_0x1875d3[_0x4b24('0x120')],'scheduledat':moment()[_0x4b24('0xeb')](_0x5aa8a6[_0x4b24('0x126')],_0x4b24('0xdc'))[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1875d3[_0x4b24('0xdd')],'ListId':_0x1875d3[_0x4b24('0xde')],'VoiceQueueId':_0x1875d3[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1875d3[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x127')));_0xfd76f5({'reschedule':0x1});}}});}if(_0x2b3264[_0x4b24('0x44')]===_0x4b24('0xc1')&&this[_0x4b24('0x22')][_0x2b3264[_0x4b24('0xbf')]][_0x4b24('0x10d')]&&_0x40d6f2[_0x4b24('0x11a')]===_0x4b24('0x10e')){delete this[_0x4b24('0x29')][_0x40d6f2[_0x4b24('0xc0')]];this[_0x4b24('0xc2')](this['campaigns'][_0x2b3264[_0x4b24('0xbf')]]);_0x336ad=new Hangup(_0x2b3264,_0x40d6f2);_0x336ad[_0x4b24('0x70')]=0x12;_0x336ad[_0x4b24('0x71')]='HangupInAMD';_0x336ad[_0x4b24('0x112')]=_0x4b24('0x113');ami[_0x4b24('0x114')](_0x4b24('0x115'),ut[_0x4b24('0x116')](_0x336ad,'amd'));this['saveInDb'](_0x336ad,_0x4b24('0x128'),_0x4b24('0x129'));}if(_0x2b3264['type']===_0x4b24('0xc1')&&this['campaigns'][_0x2b3264['queue']][_0x4b24('0x10d')]&&_0x40d6f2[_0x4b24('0x11a')]===_0x4b24('0x12a')){return new Promise(function(_0x5224ef,_0x179ce9){delete _0x24b562['uniqueId'][_0x40d6f2[_0x4b24('0xc0')]];_0x24b562[_0x4b24('0xc2')](_0x24b562[_0x4b24('0x22')][_0x2b3264[_0x4b24('0xbf')]]);_0x24b562[_0x4b24('0x22')][_0x2b3264[_0x4b24('0xbf')]][_0x4b24('0x10f')]+=0x1;_0x24b562[_0x4b24('0x22')][_0x2b3264[_0x4b24('0xbf')]][_0x4b24('0x110')]+=0x1;var _0x3e134f=_0x24b562[_0x4b24('0x22')][_0x2b3264[_0x4b24('0xbf')]];var _0x5ae98d=new Hangup(_0x2b3264,_0x40d6f2);_0x5ae98d[_0x4b24('0x70')]=0x13;_0x5ae98d[_0x4b24('0x71')]='Machine';_0x5ae98d[_0x4b24('0x112')]=_0x4b24('0x113');_0x5ae98d[_0x4b24('0x120')]+=0x1;_0x5ae98d['countglobal']+=0x1;_0x5ae98d[_0x4b24('0x117')]=!![];ami['emit'](_0x4b24('0x115'),ut[_0x4b24('0x116')](_0x5ae98d,_0x4b24('0x117')));hopperUtils['createHistory'](_0x5ae98d)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x11c')));if(_0x5ae98d['countbusyretry']+_0x5ae98d[_0x4b24('0x11e')]+_0x5ae98d[_0x4b24('0x12b')]+_0x5ae98d[_0x4b24('0x11f')]+_0x5ae98d['countdropretry']+_0x5ae98d[_0x4b24('0xea')]+_0x5ae98d['countmachineretry']+_0x5ae98d[_0x4b24('0x121')]>=_0x3e134f[_0x4b24('0x122')]){_0x24b562[_0x4b24('0x123')](_0x5ae98d,_0x5224ef,_0x179ce9,_0x4b24('0x12c'));}else{if(_0x5ae98d['countmachineretry']>=_0x3e134f[_0x4b24('0x124')]){_0x24b562[_0x4b24('0x12d')](_0x5ae98d,_0x5224ef,_0x179ce9,_0x4b24('0x125'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5ae98d[_0x4b24('0x120')],'scheduledat':moment()[_0x4b24('0xeb')](_0x3e134f['dialMachineRetryFrequency'],_0x4b24('0xdc'))[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5ae98d[_0x4b24('0xdd')],'ListId':_0x5ae98d[_0x4b24('0xde')],'VoiceQueueId':_0x5ae98d[_0x4b24('0xdf')]||undefined,'CampaignId':_0x5ae98d[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x127')));_0x5224ef({'reschedule':0x1});}}});}}};Dialer[_0x4b24('0x1b')][_0x4b24('0x39')]=function(_0x4c11c7){var _0x43d106=this[_0x4b24('0x29')][_0x4c11c7[_0x4b24('0xc0')]];var _0x5c2f73;if(_0x43d106&&_0x43d106[_0x4b24('0x44')]==='ivr'){delete this[_0x4b24('0x29')][_0x4c11c7[_0x4b24('0xc0')]];this[_0x4b24('0xc2')](this['campaigns'][_0x43d106[_0x4b24('0xbf')]]);this['campaigns'][_0x43d106[_0x4b24('0xbf')]][_0x4b24('0x12e')]+=0x1;_0x5c2f73=new Hangup(_0x43d106,_0x4c11c7);hopperUtils[_0x4b24('0xca')](_0x5c2f73)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x12f')));hopperUtils[_0x4b24('0xcc')](_0x5c2f73)[_0x4b24('0x9d')](loggerCatch('[syncHangupIvr]'));}if(_0x43d106&&_0x43d106[_0x4b24('0x44')]!=='ivr'&&isNotNull(this[_0x4b24('0x21')][_0x43d106['queue']]['dialQueueProject'])){delete this[_0x4b24('0x29')][_0x4c11c7['uniqueid']];this['updateOriginated'](this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]]);this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]]['outboundAnswerCallsDay']+=0x1;this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]][_0x4b24('0x110')]+=0x1;_0x5c2f73=new Hangup(_0x43d106,_0x4c11c7);_0x5c2f73[_0x4b24('0x70')]=0x10;_0x5c2f73['statedesc']=_0x4b24('0x130');_0x5c2f73[_0x4b24('0x112')]='AGI';hopperUtils[_0x4b24('0xca')](_0x5c2f73)['catch'](loggerCatch(_0x4b24('0x12f')));hopperUtils['moveContactManagedDialer'](_0x5c2f73)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x131')));}if(_0x43d106&&_0x43d106[_0x4b24('0x44')]!=='ivr'&&!isNotNull(this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]]['dialQueueProject'])){delete this[_0x4b24('0x29')][_0x4c11c7[_0x4b24('0xc0')]];this[_0x4b24('0xc2')](this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]]);this[_0x4b24('0x21')][_0x43d106[_0x4b24('0xbf')]][_0x4b24('0x132')]+=0x1;_0x5c2f73=new Hangup(_0x43d106,_0x4c11c7);_0x5c2f73[_0x4b24('0x70')]=0xc;_0x5c2f73[_0x4b24('0x71')]=_0x4c11c7['cause-txt'];_0x5c2f73[_0x4b24('0x112')]=_0x4b24('0x133');hopperUtils[_0x4b24('0xca')](_0x5c2f73)[_0x4b24('0x9d')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5c2f73)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x131')));}};Dialer['prototype'][_0x4b24('0xb')]=function(_0x4e02fe){var _0x84c4be=this;if(!_0x84c4be[_0x4b24('0x2f')][_0x4e02fe[_0x4b24('0x4a')]]){_0x84c4be[_0x4b24('0x2f')][_0x4e02fe['name']]={'running':![]};}else if(_0x84c4be[_0x4b24('0x2f')][_0x4e02fe['name']][_0x4b24('0x134')]===!![]){return;}else if(_0x84c4be[_0x4b24('0x2f')][_0x4e02fe[_0x4b24('0x4a')]][_0x4b24('0x134')]===![]){_0x84c4be[_0x4b24('0x2f')][_0x4e02fe[_0x4b24('0x4a')]][_0x4b24('0x134')]=!![];}var _0x2a8be5=_0x84c4be[_0x4b24('0x21')][_0x4e02fe[_0x4b24('0x4a')]];var _0x217a55=_0x2a8be5['message']!==utils[_0x4b24('0x79')]['INACTIVE'];var _0x1526a1=utils[_0x4b24('0x135')](_0x2a8be5);_0x2a8be5[_0x4b24('0x136')]=utils['getQueueCampaignStatusMessage'](_0x2a8be5,_0x84c4be[_0x4b24('0x24')]);Promise[_0x4b24('0xac')]()['then'](function(){if(_0x2a8be5[_0x4b24('0x136')]===utils[_0x4b24('0x79')][_0x4b24('0x137')]){if(_0x217a55){clearPredictiveAttributes(_0x2a8be5);_0x4e02fe[_0x4b24('0x2b')]=undefined;_0x4e02fe[_0x4b24('0x2c')]=undefined;}if(_0x2a8be5[_0x4b24('0x136')]===utils[_0x4b24('0x79')]['INACTIVE']){_0x4e02fe[_0x4b24('0x138')]=0x0;_0x4e02fe[_0x4b24('0xf3')]=0x0;_0x4e02fe[_0x4b24('0x139')]=0x0;_0x4e02fe[_0x4b24('0x13a')]=0x0;_0x4e02fe[_0x4b24('0x13b')]=0x0;}}else if(_0x2a8be5[_0x4b24('0x136')]===utils[_0x4b24('0x79')][_0x4b24('0x13c')]&&!_0x1526a1){return _0x84c4be[_0x4b24('0x90')](_0x2a8be5,!![])[_0x4b24('0x42')](function(){return _0x84c4be[_0x4b24('0x90')](_0x2a8be5,![]);})[_0x4b24('0x42')](function(){return _0x84c4be[_0x4b24('0xb0')](_0x2a8be5);})[_0x4b24('0x9d')](function(_0x542f85){loggerSyncQueueSummary['debug'](_0x4b24('0x13d'),util['inspect'](_0x542f85,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2a8be5);});}else{clearPredictiveAttributes(_0x2a8be5);}})[_0x4b24('0x42')](function(){var _0x36f1f6=_0x4e02fe['compareToOutboundQueue'](_0x2a8be5);if(_0x36f1f6||_0x2a8be5[_0x4b24('0x13e')]){_0x2a8be5['queueSummaryCountersUpdated']=![];_0x4e02fe[_0x4b24('0x13f')](_0x2a8be5);Object[_0x4b24('0x140')](_0x2a8be5,_0x4e02fe);emitOutboundVoiceQueueSummary(_0x4e02fe);}_0x84c4be['queuesSummary'][_0x2a8be5['name']]['running']=![];})['catch'](function(_0x5d9f4f){logger['error'](_0x4b24('0x13d'),util[_0x4b24('0x47')](_0x5d9f4f,{'showHidden':![],'depth':null}));_0x84c4be['queuesSummary'][_0x2a8be5[_0x4b24('0x4a')]]['running']=![];});};Dialer[_0x4b24('0x1b')][_0x4b24('0x37')]=_[_0x4b24('0x141')](function(){var _0x137858=_[_0x4b24('0x142')](this['voiceQueues'],function(_0x34542d){return _0x34542d['dialPreviewRecallmeReminder'];});var _0x5e3f5e=_[_0x4b24('0x142')](this[_0x4b24('0x23')],function(_0x50d004){return _0x50d004[_0x4b24('0x143')]&&_0x50d004[_0x4b24('0x89')]===_0x4b24('0x88');});if(_0x137858['length']>0x0&&_0x5e3f5e[_0x4b24('0x97')]>0x0){return Promise[_0x4b24('0xac')]()[_0x4b24('0x42')](cmHopper[_0x4b24('0x144')](_['map'](_0x137858,'id'),previewRecallmeReminderInterval,_[_0x4b24('0x145')](_0x5e3f5e,'id')))[_0x4b24('0x42')](function(_0x1c871b){for(var _0x2679b2=0x0;_0x2679b2<_0x1c871b[_0x4b24('0x97')];_0x2679b2++){var _0x1787fa=_0x1c871b[_0x2679b2]['Agent'][_0x4b24('0x4a')];if(_0x1787fa)io['to'](util['format'](_0x4b24('0x146'),_0x1787fa))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x1c871b[_0x2679b2]});}})[_0x4b24('0x9d')](function(_0xe1a164){logger[_0x4b24('0x68')](_0x4b24('0x147'),_0xe1a164);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x4b24('0x148')]=function(){var _0xb57a6b=this;setInterval(function(){_0xb57a6b[_0x4b24('0x149')](_0xb57a6b['uniqueId'],_0x4b24('0x14a'));_0xb57a6b[_0x4b24('0x149')](_0xb57a6b[_0x4b24('0x27')],'[actions]');},0x32c8);};Dialer[_0x4b24('0x1b')]['clearZombieChannels']=function(_0x42e549,_0x11b0da){var _0x12ecfa=this;for(var _0xa23f43 in _0x42e549){if(typeof _0x42e549[_0xa23f43]!==_0x4b24('0xaa')){this[_0x4b24('0x1f')][_0x4b24('0x1c')](function(){if(!_[_0x4b24('0xf2')](_0x42e549[_0xa23f43])){return ami['Action']({'action':'status','channel':_0x42e549[_0xa23f43]['channel']})[_0x4b24('0x9d')](function(_0x488b68){if(_0x488b68['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x42e549[_0xa23f43]&&_0x42e549[_0xa23f43][_0x4b24('0x44')]!==_0x4b24('0xc1')){_0x12ecfa[_0x4b24('0xc2')](_0x12ecfa[_0x4b24('0x21')][_0x42e549[_0xa23f43][_0x4b24('0xbf')]]);logger[_0x4b24('0x68')](_0x4b24('0x14b'),_0x11b0da,_0xa23f43,_0x42e549[_0xa23f43][_0x4b24('0xbf')]);delete _0x42e549[_0xa23f43];}if(_0x42e549[_0xa23f43]&&_0x42e549[_0xa23f43][_0x4b24('0x44')]===_0x4b24('0xc1')){_0x12ecfa[_0x4b24('0xc2')](_0x12ecfa['campaigns'][_0x42e549[_0xa23f43][_0x4b24('0xbf')]]);logger[_0x4b24('0x68')]('[Dialer][checkChannel][ivr]',_0x11b0da,_0xa23f43,_0x42e549[_0xa23f43]['queue']);delete _0x42e549[_0xa23f43];}},0x2328);}});}});}}};Dialer[_0x4b24('0x1b')][_0x4b24('0x14c')]=function(_0x486a5c){return Promise[_0x4b24('0xac')]()[_0x4b24('0x42')](voiceQueueRt[_0x4b24('0x14c')](_0x486a5c))['catch'](loggerCatch(_0x4b24('0x14d')));};Dialer[_0x4b24('0x1b')][_0x4b24('0xc2')]=function(_0x29e6fa){if(!_[_0x4b24('0x43')](_0x29e6fa)&&_0x29e6fa!==null){if(typeof _0x29e6fa[_0x4b24('0x82')]!==_0x4b24('0xaa')){if(_0x29e6fa['originated']>0x0){_0x29e6fa[_0x4b24('0x82')]-=0x1;}else{logger['error'](_0x4b24('0x14e'));}}}else{logger[_0x4b24('0x68')](_0x4b24('0x14f'));}};Dialer[_0x4b24('0x1b')]['loggerHandler']=function(_0x4f6589,_0x1d839b){var _0x5bafb9=this;return function(_0x37fd67){_0x5bafb9[_0x4b24('0xc2')](_0x1d839b);logger[_0x4b24('0x68')](_0x4f6589,util[_0x4b24('0x47')](_0x37fd67,{'showHidden':![],'depth':null}));};};Dialer[_0x4b24('0x1b')][_0x4b24('0x150')]=function(_0x1599cf,_0x39e08a,_0x5ddd12){var _0x3b273d={'state':0x19,'statedesc':_0x4b24('0x151')};this[_0x4b24('0xc2')](_0x39e08a);this[_0x4b24('0x118')](_[_0x4b24('0xf7')](_0x3b273d,_[_0x4b24('0x77')](_0x5ddd12,[_0x4b24('0xdd'),'ListId','UserId',_0x4b24('0xdf'),_0x4b24('0xe0')])),_0x4b24('0x152'),_0x4b24('0x153'));logger[_0x4b24('0x68')](_0x1599cf);};Dialer['prototype']['saveInDb']=function(_0x39c7db,_0x3e4183,_0x1c6cab){hopperUtils[_0x4b24('0xca')](_0x39c7db)[_0x4b24('0x9d')](loggerCatch(_0x3e4183));hopperUtils[_0x4b24('0xcc')](_0x39c7db)[_0x4b24('0x9d')](loggerCatch(_0x1c6cab));};Dialer[_0x4b24('0x1b')][_0x4b24('0xda')]=function(_0x40c611,_0x6e1c4){hopperUtils['createHistory'](_0x40c611)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xcb')));if(_0x6e1c4==0x0){hopperUtils[_0x4b24('0xcc')](_0x40c611)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0x4b24('0x147')]=function(_0x3174d8){return Promise[_0x4b24('0xac')]()[_0x4b24('0x42')](cmHopper[_0x4b24('0x144')](_0x3174d8['id'],previewRecallmeReminderInterval))[_0x4b24('0x42')](function(_0x3fdfa1){for(var _0x40ae5e=0x0;_0x40ae5e<_0x3fdfa1['length'];_0x40ae5e++){var _0x5c96b6=_0x3fdfa1[_0x40ae5e][_0x4b24('0x154')][_0x4b24('0x4a')];if(_0x5c96b6)io['to'](util[_0x4b24('0x48')](_0x4b24('0x146'),_0x5c96b6))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x3fdfa1[_0x40ae5e]});}})[_0x4b24('0x9d')](function(){});};Dialer[_0x4b24('0x1b')][_0x4b24('0xaf')]=function(_0x3f7437){var _0x25dfbb=this;return function(){_0x25dfbb[_0x4b24('0x155')](_0x3f7437);};};Dialer['prototype'][_0x4b24('0x156')]=function(_0x1ebb86,_0x1614bf){var _0x5cae8f=this;var _0xe47b51=uuid['v4']();this['actions'][_0xe47b51]=new Action(_0x1ebb86,_0x1614bf,_0xe47b51);return new Promise(function(_0x2c7382,_0x2ab1bb){if(_[_0x4b24('0x43')](_0x1ebb86)&&typeof _0x1ebb86!==_0x4b24('0x157')){return _0x2ab1bb(msgResponse('originate',_0x4b24('0x91'),_0x4b24('0x158')));}if(_[_0x4b24('0x43')](_0x1614bf['phone'])||_0x1614bf['phone']===null){return _0x2ab1bb(msgResponse(_0x4b24('0x159'),_0x4b24('0x91'),_0x4b24('0x15a')));}var _0x9c6e7a={'XMD-CALLERID':_0x5cae8f[_0x4b24('0x27')][_0xe47b51][_0x4b24('0x15b')](),'XMD-AGI':_0x1ebb86['dialQueueProject']?util[_0x4b24('0x48')](_0x4b24('0x15c'),ipAgi,_0x1ebb86[_0x4b24('0x15d')]):_0x4b24('0x15e'),'XMD-AGIAFTER':_0x1ebb86[_0x4b24('0xc7')]?util[_0x4b24('0x48')](_0x4b24('0x15c'),ipAgi,_0x1ebb86[_0x4b24('0xc7')]):_0x4b24('0x15e'),'XMD-QUEUE':utils[_0x4b24('0x15f')](_0x1ebb86)?util['format'](_0x4b24('0x160'),_0x1ebb86[_0x4b24('0x4a')],_0x1ebb86[_0x4b24('0x161')]||'',_0x1ebb86[_0x4b24('0xc8')]?'c':'',_0x1ebb86[_0x4b24('0x162')]||0x3):_0x4b24('0x15e'),'XMD-CONTACTID':_0x1614bf[_0x4b24('0xdd')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5cae8f[_0x4b24('0x27')][_0xe47b51][_0x4b24('0x15b')](),'XMD-AMD':_0x1ebb86[_0x4b24('0x10d')]?_0x4b24('0x13c'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1ebb86[_0x4b24('0x10d')]){_0x9c6e7a[_0x4b24('0x163')]=_0x1ebb86[_0x4b24('0x164')]||0x9c4;_0x9c6e7a['XMD-AMDGREETING']=_0x1ebb86['dialAMDGreeting']||0x5dc;_0x9c6e7a[_0x4b24('0x165')]=_0x1ebb86[_0x4b24('0x166')]||0x320;_0x9c6e7a['XMD-AMDTOTALANALYSISTIME']=_0x1ebb86[_0x4b24('0x167')]||0x1388;_0x9c6e7a[_0x4b24('0x168')]=_0x1ebb86[_0x4b24('0x169')]||0x64;_0x9c6e7a[_0x4b24('0x16a')]=_0x1ebb86[_0x4b24('0x16b')]||0x32;_0x9c6e7a[_0x4b24('0x16c')]=_0x1ebb86[_0x4b24('0x16d')]||0x3;_0x9c6e7a[_0x4b24('0x16e')]=_0x1ebb86[_0x4b24('0x16f')]||0x100;_0x9c6e7a['XMD-AMDMAXIMUMWORDLENGTH']=_0x1ebb86[_0x4b24('0x170')]||0x1388;}if(utils[_0x4b24('0x15f')](_0x1ebb86)){_0x9c6e7a['XMD-VOICEQUEUEID']=_0x1614bf[_0x4b24('0xdf')];}else{_0x9c6e7a[_0x4b24('0x171')]=_0x1614bf[_0x4b24('0xe0')];}for(var _0x21c7fb in _0x1614bf[_0x4b24('0x172')]){if(typeof _0x1614bf['Contact'][_0x21c7fb]!==_0x4b24('0xaa')){if(isNotNull(_0x1614bf[_0x4b24('0x172')][_0x21c7fb])&&_0x21c7fb!=='id'&&_0x21c7fb!==_0x4b24('0x173')&&_0x21c7fb!=='createdAt'&&_0x21c7fb!=='updatedAt'){_0x9c6e7a[util['format'](_0x4b24('0x174'),'XMD-',_[_0x4b24('0x175')](_0x21c7fb))]=_0x1614bf[_0x4b24('0x172')][_0x21c7fb];}}}var _0x58c03b=_0x5cae8f['isTrunkReachable'](_0x1ebb86['Trunk'])?utils['getCallerId'](_0x1ebb86[_0x4b24('0x8b')][_0x4b24('0x176')],_0x1ebb86['dialOriginateCallerIdName'],_0x1ebb86[_0x4b24('0x177')]>0x0?utils[_0x4b24('0x178')](_0x1ebb86[_0x4b24('0x179')],_0x1ebb86['dialRandomLastDigitCallerIdNumber']):_0x1ebb86[_0x4b24('0x179')]):utils['getCallerId'](_[_0x4b24('0xf2')](_0x1ebb86[_0x4b24('0x8c')])?_0x1ebb86['Trunk'][_0x4b24('0x176')]:_0x1ebb86['TrunkBackup'][_0x4b24('0x176')],_0x1ebb86['dialOriginateCallerIdName'],_0x1ebb86[_0x4b24('0x177')]>0x0?utils[_0x4b24('0x178')](_0x1ebb86[_0x4b24('0x179')],_0x1ebb86['dialRandomLastDigitCallerIdNumber']):_0x1ebb86['dialOriginateCallerIdNumber']);if(_0x58c03b){_0x9c6e7a[_0x4b24('0x17a')]=_0x5cae8f[_0x4b24('0x27')][_0xe47b51][_0x4b24('0x17b')]=utils[_0x4b24('0x17c')](_0x58c03b);_0x9c6e7a[_0x4b24('0x17d')]=_0x1614bf['phone'];}_0x1ebb86[_0x4b24('0x17e')]=_0x9c6e7a;return ami['Action']({'actionid':_0xe47b51,'action':_0x4b24('0x159'),'channel':_0x5cae8f['isTrunkReachable'](_0x1ebb86[_0x4b24('0x8b')])?util[_0x4b24('0x48')](_0x4b24('0x17f'),_0x1ebb86['Trunk'][_0x4b24('0x4a')],isNotNull(_0x1ebb86['dialPrefix'])?_0x1ebb86[_0x4b24('0x180')][_0x4b24('0x181')]()||'':'',_0x1ebb86[_0x4b24('0x182')]>0x0?_0x1614bf[_0x4b24('0x183')]['substring'](_0x1ebb86['dialCutDigit']):_0x1614bf[_0x4b24('0x183')]):util[_0x4b24('0x48')](_0x4b24('0x17f'),_[_0x4b24('0xf2')](_0x1ebb86[_0x4b24('0x8c')])?_0x1ebb86['Trunk']['name']:_0x1ebb86[_0x4b24('0x8c')]['name'],isNotNull(_0x1ebb86[_0x4b24('0x180')])?_0x1ebb86[_0x4b24('0x180')]['trim']()||'':'',_0x1ebb86['dialCutDigit']>0x0?_0x1614bf['phone'][_0x4b24('0x184')](_0x1ebb86[_0x4b24('0x182')]):_0x1614bf[_0x4b24('0x183')]),'callerid':_0x58c03b,'Exten':'xcally-motion-dialer','Context':_0x4b24('0x185'),'Priority':'1','variable':_0x9c6e7a,'timeout':(_0x1ebb86[_0x4b24('0x186')]||0x1e)*0x3e8,'async':!![],'channelid':_0xe47b51})['then'](function(_0xe7f014){return _0x2c7382(_0xe7f014);})[_0x4b24('0x9d')](function(_0x1e796c){_0x1ebb86[_0x4b24('0x187')]+=0x1;var _0x52133c=new History(_0x5cae8f[_0x4b24('0x27')][_0xe47b51]);logger[_0x4b24('0x68')](util['format'](_0x4b24('0x188'),JSON[_0x4b24('0x76')](_0x1e796c)));_0x52133c[_0x4b24('0x70')]=0xe;_0x52133c[_0x4b24('0x71')]=_0x4b24('0x189');_0x52133c[_0x4b24('0x73')]=moment()[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x52133c['endtime']=_0x52133c[_0x4b24('0x73')];hopperUtils[_0x4b24('0xca')](_0x52133c)[_0x4b24('0x9d')](loggerCatch('[originate][error]'));_0x5cae8f['moveContactManagedDialer'](_0x52133c)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x18a')))[_0x4b24('0x1e')](function(){delete _0x5cae8f[_0x4b24('0x27')][_0xe47b51];return _0x2ab1bb(msgResponse('originate',_0x4b24('0xbe'),_0x4b24('0x18b')));});});});};Dialer[_0x4b24('0x1b')][_0x4b24('0x18c')]=function(_0x3e4370,_0xfb6008,_0x433d92){var _0x1171f4=new History(_0xfb6008);if(_0x1171f4[_0x4b24('0x11d')]+_0x1171f4['countcongestionretry']+_0x1171f4[_0x4b24('0x12b')]+_0x1171f4[_0x4b24('0x11f')]+_0x1171f4[_0x4b24('0xd4')]+_0x1171f4[_0x4b24('0xea')]+_0x1171f4[_0x4b24('0x120')]+_0x1171f4[_0x4b24('0x121')]>=_0x433d92[_0x4b24('0x122')]-0x1){return!![];}switch(_0x3e4370){case 0x3:if(_0x1171f4[_0x4b24('0x12b')]>=_0x433d92['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x4b24('0xdb')]({'active':![],'countnoanswerretry':_0x1171f4[_0x4b24('0x12b')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92[_0x4b24('0x18d')],_0x4b24('0xdc'))[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4['VoiceQueueId']||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x18e')));break;case 0x5:if(_0x1171f4[_0x4b24('0x11d')]>=_0x433d92[_0x4b24('0x18f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x1171f4[_0x4b24('0x11d')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92[_0x4b24('0x190')],_0x4b24('0xdc'))[_0x4b24('0x48')](_0x4b24('0xc9')),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1171f4['CampaignId']||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x191')));break;case 0x8:if(_0x1171f4[_0x4b24('0x11e')]>=_0x433d92[_0x4b24('0x192')]-0x1){return!![];}hopperUtils[_0x4b24('0xdb')]({'active':![],'countcongestionretry':_0x1171f4[_0x4b24('0x11e')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92['dialCongestionRetryFrequency'],'minutes')[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4['ListId'],'VoiceQueueId':_0x1171f4['VoiceQueueId']||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})['catch'](loggerCatch(_0x4b24('0x193')));break;case 0x0:if(_0x1171f4['countnosuchnumberretry']>=_0x433d92[_0x4b24('0x194')]-0x1){return!![];}else{hopperUtils[_0x4b24('0xdb')]({'active':![],'countnosuchnumberretry':_0x1171f4['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92[_0x4b24('0x195')],_0x4b24('0xdc'))[_0x4b24('0x48')](_0x4b24('0xc9')),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x196')));}break;case 0xa:if(_0x1171f4['countdropretry']>=_0x433d92['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x4b24('0xdb')]({'active':![],'countdropretry':_0x1171f4[_0x4b24('0xd4')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92[_0x4b24('0xd6')],_0x4b24('0xdc'))[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1171f4['CampaignId']||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xe1')));break;case 0xb:if(_0x1171f4[_0x4b24('0xea')]>=_0x433d92[_0x4b24('0x197')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1171f4[_0x4b24('0xea')]+=0x1,'scheduledat':moment()['add'](_0x433d92['dialAbandonedRetryFrequency'],'minutes')[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})['catch'](loggerCatch(_0x4b24('0xec')));break;case 0x13:if(_0x1171f4['countmachineretry']>=_0x433d92[_0x4b24('0x124')]-0x1){return!![];}hopperUtils[_0x4b24('0xdb')]({'active':![],'countmachineretry':_0x1171f4[_0x4b24('0x120')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92['dialMachineRetryFrequency'],_0x4b24('0xdc'))[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4['ListId'],'VoiceQueueId':_0x1171f4['VoiceQueueId']||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x127')));break;case 0x14:if(_0x1171f4[_0x4b24('0x121')]>=_0x433d92['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x4b24('0xdb')]({'active':![],'countagentrejectretry':_0x1171f4[_0x4b24('0x121')]+=0x1,'scheduledat':moment()[_0x4b24('0xeb')](_0x433d92[_0x4b24('0x198')],_0x4b24('0xdc'))[_0x4b24('0x48')](_0x4b24('0xc9')),'ContactId':_0x1171f4[_0x4b24('0xdd')],'ListId':_0x1171f4[_0x4b24('0xde')],'VoiceQueueId':_0x1171f4[_0x4b24('0xdf')]||undefined,'CampaignId':_0x1171f4[_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x199')));break;default:return!![];}};Dialer['prototype'][_0x4b24('0x10b')]=function(_0x3cd8fa,_0x5d72ee,_0x212a81){var _0x3f1fc3=this;var _0x225487=new History(_0x3cd8fa);var _0x46322a=![];var _0x217d86;var _0x424e4a;return new Promise(function(_0x1de0a4,_0x14171a){if(_[_0x4b24('0x43')](_0x5d72ee)&&typeof _0x5d72ee!==_0x4b24('0x157')){return _0x14171a(msgResponse('[callProgressDetecting]',_0x4b24('0x91'),'entity\x20is\x20undefine'));}if(_[_0x4b24('0x43')](_0x212a81)&&typeof _0x212a81!==_0x4b24('0x157')){return _0x14171a(msgResponse(_0x4b24('0x19a'),_0x4b24('0x91'),'evt\x20is\x20undefine'));}hopperUtils[_0x4b24('0xe8')](_0x225487,_0x212a81['reason'],_0x5d72ee)['then'](function(_0x37ac05){if(_0x37ac05[_0x4b24('0xd8')]==0x1)_0x46322a=!![];switch(_0x212a81['reason']){case'0':_0x5d72ee[_0x4b24('0x19b')]+=0x1;_0x225487[_0x4b24('0x70')]=0x0;_0x225487['statedesc']='NoSuchNumber';_0x225487[_0x4b24('0x11f')]+=0x1;_0x225487[_0x4b24('0xd5')]+=0x1;ami[_0x4b24('0x114')](_0x4b24('0x19c'),ut[_0x4b24('0x116')](_0x3cd8fa,_0x4b24('0x19d')));_0x217d86=_0x5d72ee[_0x4b24('0x195')];_0x424e4a=_0x5d72ee[_0x4b24('0xd7')];hopperUtils[_0x4b24('0xca')](_0x225487)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x11c')));if(_0x3f1fc3[_0x4b24('0x18c')](0x0,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487[_0x4b24('0x11f')]>=_0x5d72ee[_0x4b24('0x194')]){_0x3f1fc3['createStateFinal'](_0x225487,_0x1de0a4,_0x14171a,'reason\x200\x20no\x20such\x20number....');}else{_0x3f1fc3['stateGlobal'](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x19e'));}}break;case'3':_0x5d72ee[_0x4b24('0x19f')]+=0x1;_0x225487[_0x4b24('0x70')]=0x3;_0x225487[_0x4b24('0x71')]=_0x4b24('0x1a0');_0x225487['countnoanswerretry']+=0x1;_0x225487[_0x4b24('0xd5')]+=0x1;var _0xdd5f30=ut['buildNoAnswerEventPayload'](_0x3cd8fa,_0x5d72ee);ami[_0x4b24('0x114')](_0x4b24('0x1a1'),_0xdd5f30);_0x217d86=_0x5d72ee[_0x4b24('0x18d')];_0x424e4a=_0x5d72ee[_0x4b24('0xd7')];hopperUtils[_0x4b24('0xca')](_0x225487)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x1a2')));if(_0x3f1fc3[_0x4b24('0x18c')](0x3,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487['countnoanswerretry']>=_0x5d72ee['dialNoAnswerMaxRetry']){_0x3f1fc3[_0x4b24('0x12d')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1a3'));}else{_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1a3'));}}break;case'5':_0x5d72ee[_0x4b24('0x1a4')]+=0x1;_0x225487['state']=0x5;_0x225487['statedesc']='Busy';_0x225487[_0x4b24('0x11d')]+=0x1;_0x225487['countglobal']+=0x1;ami[_0x4b24('0x114')](_0x4b24('0x1a5'),ut[_0x4b24('0x116')](_0x3cd8fa,_0x4b24('0x1a6')));_0x217d86=_0x5d72ee[_0x4b24('0x190')];_0x424e4a=_0x5d72ee[_0x4b24('0xd7')];hopperUtils[_0x4b24('0xca')](_0x225487)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3f1fc3['checkRetriveMax'](0x5,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487[_0x4b24('0x11d')]>=_0x5d72ee[_0x4b24('0x18f')]){_0x3f1fc3['createStateFinal'](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1a7'));}else{_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1a7'));}}break;case'8':_0x5d72ee['outboundCongestionCallsDay']+=0x1;_0x225487[_0x4b24('0x70')]=0x8;_0x225487[_0x4b24('0x71')]=_0x4b24('0x1a8');_0x225487[_0x4b24('0x11e')]+=0x1;_0x225487[_0x4b24('0xd5')]+=0x1;_0x217d86=_0x5d72ee[_0x4b24('0x1a9')];_0x424e4a=_0x5d72ee[_0x4b24('0xd7')];ami['emit'](_0x4b24('0x1aa'),ut[_0x4b24('0x116')](_0x3cd8fa,_0x4b24('0x1ab')));hopperUtils[_0x4b24('0xca')](_0x225487)['catch'](loggerCatch(_0x4b24('0x1ac')));if(_0x3f1fc3[_0x4b24('0x18c')](0x8,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487[_0x4b24('0x11e')]>=_0x5d72ee['dialCongestionMaxRetry']){_0x3f1fc3['createStateFinal'](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1ad'));}else{_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,'reason\x208\x20congestion');}}break;case'11':_0x5d72ee[_0x4b24('0x1ae')]+=0x1;_0x225487[_0x4b24('0x70')]=0xb;_0x225487[_0x4b24('0x71')]=_0x4b24('0xe6');_0x225487[_0x4b24('0xea')]+=0x1;_0x225487[_0x4b24('0xd5')]+=0x1;_0x217d86=_0x5d72ee[_0x4b24('0x1af')];_0x424e4a=_0x5d72ee['callAdditionalPhoneAfterMin'];hopperUtils[_0x4b24('0xca')](_0x225487)[_0x4b24('0x9d')](loggerCatch(_0x4b24('0xed')));if(_0x3f1fc3['checkRetriveMax'](0xb,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487['countabandonedretry']>=_0x5d72ee[_0x4b24('0x197')]){_0x3f1fc3[_0x4b24('0x12d')](_0x225487,_0x1de0a4,_0x14171a,'reason\x2011\x20abandoned');}else{_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1b0'));}}break;case'20':_0x5d72ee[_0x4b24('0x1b1')]+=0x1;_0x225487[_0x4b24('0x70')]=0x14;_0x225487[_0x4b24('0x71')]=_0x4b24('0x1b2');_0x225487[_0x4b24('0x121')]+=0x1;_0x225487[_0x4b24('0xd5')]+=0x1;_0x217d86=_0x5d72ee[_0x4b24('0x198')];_0x424e4a=_0x5d72ee['callAdditionalPhoneAfterMin'];ami[_0x4b24('0x114')]('custom:agentreject',ut[_0x4b24('0x116')](_0x3cd8fa,'agentreject'));hopperUtils['createHistory'](_0x225487)['catch'](loggerCatch(_0x4b24('0x1b3')));if(_0x3f1fc3[_0x4b24('0x18c')](0x14,_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487[_0x4b24('0x121')]>=_0x5d72ee['dialAgentRejectMaxRetry']){_0x3f1fc3[_0x4b24('0x12d')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1b4'));}else{_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,_0x4b24('0x1b4'));}}break;default:_0x5d72ee['outboundUnknownCallsDay']+=0x1;_0x225487[_0x4b24('0x70')]=0xc;_0x225487[_0x4b24('0x71')]=_0x212a81['reason'];_0x217d86=_0x5d72ee['dialAgentRejectRetryFrequency'];_0x424e4a=_0x5d72ee[_0x4b24('0xd7')];hopperUtils['createHistory'](_0x225487)['catch'](loggerCatch(_0x4b24('0x1b5')));if(_0x3f1fc3['checkRetriveMax'](_0x212a81['reason'],_0x3cd8fa,_0x5d72ee)&&!_0x46322a){if(_0x225487['countbusyretry']+_0x225487[_0x4b24('0x11e')]+_0x225487[_0x4b24('0x12b')]+_0x225487[_0x4b24('0x11f')]+_0x225487[_0x4b24('0xd4')]+_0x225487[_0x4b24('0xea')]+_0x225487[_0x4b24('0x120')]+_0x225487[_0x4b24('0x121')]>=_0x5d72ee[_0x4b24('0x122')]){_0x3f1fc3[_0x4b24('0x123')](_0x225487,_0x1de0a4,_0x14171a,_0x212a81[_0x4b24('0xc4')]);}else{_0x3f1fc3['createStateFinal'](_0x225487,_0x1de0a4,_0x14171a,_0x212a81['reason']);}}}})['then'](function(){if(_0x46322a){hopperUtils[_0x4b24('0xe5')](_0x225487,_0x217d86,_0x424e4a)['then'](function(){return _0x1de0a4(0x1);});}});});};Dialer[_0x4b24('0x1b')][_0x4b24('0x123')]=function(_0x368b69,_0x31a6db,_0x6ac760,_0x2e017a){var _0x1ac920=new Final(_0x368b69);_0x1ac920[_0x4b24('0x70')]=0xf;_0x1ac920[_0x4b24('0x71')]=_0x4b24('0x1b6');this[_0x4b24('0x12d')](_0x1ac920,_0x31a6db,_0x6ac760,_0x2e017a);};Dialer[_0x4b24('0x1b')][_0x4b24('0x12d')]=function(_0x2acbf3,_0x1eb790,_0x5accab,_0x1b7880){hopperUtils[_0x4b24('0xcc')](_0x2acbf3)[_0x4b24('0x42')](function(){return _0x1eb790(msgResponse(_0x4b24('0x19a'),_0x4b24('0x10a'),_0x1b7880));})[_0x4b24('0x9d')](function(){return _0x5accab(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x4b24('0x1b')][_0x4b24('0x9')]=function(_0x593a82){var _0x192bd3=_0x593a82[_0x4b24('0x1b7')]/0x64;var _0x176f13=_0x593a82['outboundDropCallsDayTimeout']/(_0x593a82[_0x4b24('0xcf')]+_0x593a82['outboundAnswerCallsDay']);var _0x1b1a31=Math[_0x4b24('0x1b8')](_0x593a82['predictiveIntervalAvailable']*(_0x593a82[_0x4b24('0x1b9')]/0x64));var _0x4a9c07=Math['round'](_0x593a82[_0x4b24('0x1ba')]*(_0x593a82[_0x4b24('0x1bb')]/0x64));var _0x23e51f=_0x593a82[_0x4b24('0x138')]+_0x593a82[_0x4b24('0x13a')];var _0x41e551=Math[_0x4b24('0x1bc')](_0x593a82[_0x4b24('0x5d')]*_0x593a82[_0x4b24('0x60')]*_0x593a82[_0x4b24('0x1bd')]*_0x593a82['predictiveIntervalMultiplicativeFactor']);if(_[_0x4b24('0x43')](_0x593a82[_0x4b24('0x2c')])){if(!_[_0x4b24('0x43')](_0x593a82[_0x4b24('0x2b')])){_0x593a82['startPredictive']=undefined;loggerPredictive[_0x4b24('0x68')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x4b24('0x43')](_0x593a82[_0x4b24('0x66')])){loggerPredictive[_0x4b24('0x68')](_0x4b24('0x1be'),_0x4b24('0x1bf'));clearInterval(_0x593a82[_0x4b24('0x66')]);_0x593a82[_0x4b24('0x66')]=undefined;}_0x593a82[_0x4b24('0x2c')]=moment()['format'](_0x4b24('0xc9'));loggerPredictive['info'](_0x593a82['name'],'collection\x20data\x20in\x20progressive\x20at',_0x593a82[_0x4b24('0x2c')]);this['handlePower'](_0x593a82,0x1);}else if(ifInterval(_0x593a82[_0x4b24('0x1c0')],_0x593a82[_0x4b24('0x2c')])){this[_0x4b24('0xb4')](_0x593a82,0x1);loggerPredictiveCalls[_0x4b24('0x4b')](_0x4b24('0x1c1'),_0x593a82[_0x4b24('0x2c')],_0x593a82[_0x4b24('0x4a')]);_0x593a82[_0x4b24('0x5d')]=0x0;_0x593a82[_0x4b24('0xd0')]=0x0;}else if(_0x192bd3<_0x176f13&&_0x593a82[_0x4b24('0x1c2')]===_0x4b24('0x1c3')){clearPredictiveAttributes(_0x593a82);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x4b24('0x1c4'),_0x176f13,'startProgressive',_0x593a82[_0x4b24('0x4a')]);}else if(_0x41e551<_0x593a82[_0x4b24('0xd0')]&&_0x593a82[_0x4b24('0x1c2')]===_0x4b24('0x1c3')){clearPredictiveAttributes(_0x593a82);loggerPredictive[_0x4b24('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x4b24('0x1c5'),_0x41e551,_0x4b24('0x1c6'),_0x593a82[_0x4b24('0xd0')],'startProgressive',_0x593a82[_0x4b24('0x4a')]);}else if(!ifInterval(_0x593a82['dialPredictiveInterval'],_0x593a82[_0x4b24('0x2c')])&&_[_0x4b24('0x43')](_0x593a82[_0x4b24('0x2b')])&&!_['isUndefined'](_0x593a82[_0x4b24('0x2c')])){_0x593a82['startPredictive']=moment()['format'](_0x4b24('0xc9'));loggerPredictive[_0x4b24('0x4b')](_0x593a82['name'],_0x4b24('0x1c7'),_0x593a82['startPredictive']);hopperUtils[_0x4b24('0x1c8')](_0x593a82['dialPredictiveInterval'])['then'](this[_0x4b24('0x1c9')](_0x593a82))[_0x4b24('0x42')](mergeDataErlangB(_0x593a82))[_0x4b24('0x42')](this[_0x4b24('0x1ca')](_0x593a82))[_0x4b24('0x9d')](loggerCatchPredictive(_0x4b24('0x1cb'),_0x593a82));}else if(!ifInterval(_0x593a82[_0x4b24('0x1c0')],_0x593a82[_0x4b24('0x2b')])){_0x593a82[_0x4b24('0xd0')]=0x0;_0x593a82['startPredictive']=moment()[_0x4b24('0x48')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4b24('0x4b')](_0x593a82[_0x4b24('0x4a')],_0x4b24('0x1cc'),_0x593a82['startPredictive']);clearInterval(_0x593a82[_0x4b24('0x66')]);_0x593a82[_0x4b24('0x66')]=undefined;hopperUtils[_0x4b24('0x1c8')](_0x593a82[_0x4b24('0x1c0')])[_0x4b24('0x42')](this[_0x4b24('0x1c9')](_0x593a82))[_0x4b24('0x42')](mergeDataErlangB(_0x593a82))[_0x4b24('0x42')](this[_0x4b24('0x1ca')](_0x593a82))[_0x4b24('0x9d')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x593a82));}else if(_0x593a82[_0x4b24('0x1ba')]&&_0x23e51f<_0x593a82['predictiveIntervalAvailable']-_0x4a9c07){clearPredictiveAttributes(_0x593a82);loggerPredictive[_0x4b24('0x4b')](_0x593a82[_0x4b24('0x4a')],_0x4b24('0x1cd'),_0x23e51f,_0x4b24('0x1ce'),_0x593a82[_0x4b24('0x1ba')],'-',_0x4a9c07,'=',_0x593a82['predictiveIntervalAvailable']-_0x4a9c07,')');}else if(_0x593a82[_0x4b24('0x1ba')]&&_0x23e51f>_0x593a82[_0x4b24('0x1ba')]+_0x1b1a31){clearPredictiveAttributes(_0x593a82);loggerPredictive[_0x4b24('0x4b')](_0x593a82['name'],_0x4b24('0x1cd'),_0x23e51f,')\x20are\x20more\x20than\x20threshold\x20(',_0x593a82[_0x4b24('0x1ba')],'+',_0x1b1a31,'=',_0x593a82[_0x4b24('0x1ba')]+_0x1b1a31,')');}};Dialer[_0x4b24('0x1b')][_0x4b24('0x1c9')]=function(_0x3b3ecb){var _0x1e4187=this;return function(_0x573409){return new Promise(function(_0xf7feb2,_0x32577b){_[_0x4b24('0xf7')](_0x3b3ecb,_0x573409[0x0]);if(checkGetDataPredictive(_0x573409[0x0])){var _0x518b07=_0x3b3ecb[_0x4b24('0x1ba')]=_0x3b3ecb[_0x4b24('0x13a')]+_0x3b3ecb['available'];var _0x5c66e2=_0x3b3ecb[_0x4b24('0x1c0')]*0x3c;var _0x2d7797=_0x573409[0x0][_0x4b24('0x56')]+_0x573409[0x0][_0x4b24('0x54')];var _0x29f1e2=(_0x573409[0x0][_0x4b24('0x4f')]+_0x573409[0x0][_0x4b24('0x50')]+_0x573409[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x573409[0x0][_0x4b24('0x4e')];_0x3b3ecb['predictiveIntervalHitRate']=_0x29f1e2>0x0?_0x29f1e2:0x1;switch(_0x3b3ecb[_0x4b24('0x1c2')]){case _0x4b24('0x1c3'):var _0x3a24bd=_0x3b3ecb[_0x4b24('0x1b7')]/0x64;return _0x1e4187[_0x4b24('0x1cf')](_0x518b07,_0x5c66e2,_0x2d7797,_0x29f1e2,_0x3a24bd)['then'](function(_0x39f71b){return _0xf7feb2(_0x39f71b);});case _0x4b24('0x1d0'):var _0x396733=_0x3b3ecb['dialPredictiveOptimizationPercentage']/0x64;return _0x1e4187[_0x4b24('0x1d1')](_0x518b07,_0x5c66e2,_0x2d7797,_0x29f1e2,_0x396733)[_0x4b24('0x42')](function(_0x53d045){return _0xf7feb2(_0x53d045);});default:return _0x32577b(msgResponse(_0x4b24('0x1d2'),_0x4b24('0x91'),_0x4b24('0x1d3')));}}else{return _0x32577b(msgResponse(_0x4b24('0x1d2'),'Failure',_0x4b24('0x1d4')));}});};};Dialer[_0x4b24('0x1b')][_0x4b24('0x1d5')]=function(_0x36e5f8){var _0x69e4be=this;return function(_0x2d32e7){return new Promise(function(_0x1595e6,_0x2e8834){_['merge'](_0x36e5f8,_0x2d32e7[0x0]);if(checkGetDataPredictive(_0x2d32e7[0x0])){loggerPredictive[_0x4b24('0x4b')](JSON['stringify'](_0x2d32e7[0x0]));if(_0x36e5f8['dialPredictiveOptimization']===_0x4b24('0x1c3')){return _0x69e4be[_0x4b24('0x14c')](_0x36e5f8['id'])[_0x4b24('0x42')](function(_0x2df853){var _0x1a55bd=_0x36e5f8['loggedIn']-_0x2df853[0x0]['outboundQueuePauses'];var _0x2b247e=_0x36e5f8[_0x4b24('0x1c0')]*0x3c;var _0x2a10b0=_0x2d32e7[0x0]['predictiveIntervalAvgTalktime']+_0x2d32e7[0x0][_0x4b24('0x54')];var _0x53d54e=(_0x2d32e7[0x0][_0x4b24('0x4f')]+_0x2d32e7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2d32e7[0x0][_0x4b24('0x52')])/_0x2d32e7[0x0][_0x4b24('0x4e')];var _0x37247e=_0x36e5f8['dialPredictiveOptimizationPercentage']/0x64;_0x36e5f8['predictiveIntervalPauses']=_0x2df853[0x0]['outboundQueuePauses']||0x0;_0x36e5f8[_0x4b24('0x1bd')]=_0x53d54e>0x0?_0x53d54e:0x1;return _0x69e4be['abandonmentRate'](_0x1a55bd,_0x2b247e,_0x2a10b0,_0x53d54e,_0x37247e);})[_0x4b24('0x42')](function(_0x4e4fef){return _0x1595e6(_0x4e4fef);})[_0x4b24('0x9d')](function(_0x79091d){return _0x2e8834(msgResponse('[CatchErlangB]','Failure',JSON[_0x4b24('0x76')](_0x79091d)));});}if(_0x36e5f8[_0x4b24('0x1c2')]===_0x4b24('0x1d0')){return _0x69e4be[_0x4b24('0x14c')](_0x36e5f8['id'])['then'](function(_0x30883c){var _0x677cb9=_0x36e5f8[_0x4b24('0x1d6')]-_0x30883c[0x0][_0x4b24('0x1d7')];var _0x47e802=_0x36e5f8[_0x4b24('0x1c0')]*0x3c;var _0x1625c0=_0x2d32e7[0x0][_0x4b24('0x56')]+_0x2d32e7[0x0]['predictiveIntervalAvgHoldtime'];var _0x19be9b=(_0x2d32e7[0x0][_0x4b24('0x4f')]+_0x2d32e7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2d32e7[0x0][_0x4b24('0x52')])/_0x2d32e7[0x0][_0x4b24('0x4e')];var _0x527746=_0x36e5f8[_0x4b24('0x1b7')]/0x64;_0x36e5f8[_0x4b24('0x1d8')]=_0x30883c[0x0][_0x4b24('0x1d7')]||0x0;_0x36e5f8[_0x4b24('0x1bd')]=_0x19be9b>0x0?_0x19be9b:0x1;return _0x69e4be['busyFactor'](_0x677cb9,_0x47e802,_0x1625c0,_0x19be9b,_0x527746);})[_0x4b24('0x42')](function(_0x11fabe){return _0x1595e6(_0x11fabe);})[_0x4b24('0x9d')](function(_0x50909f){return _0x2e8834(msgResponse(_0x4b24('0x1d9'),_0x4b24('0x91'),JSON[_0x4b24('0x76')](_0x50909f)));});}}else{return _0x2e8834(msgResponse(_0x4b24('0x1d2'),_0x4b24('0x91'),_0x4b24('0x1d4')));}});};};Dialer[_0x4b24('0x1b')][_0x4b24('0x1ca')]=function(_0x28c778){var _0x2603f9=this;return function(){var _0x1addbc=0x0;var _0x542a33=Math[_0x4b24('0x1bc')](_0x28c778[_0x4b24('0x5f')]*0x3e8);if(_0x542a33>0x0){_0x542a33=_0x542a33<0x64?0x64:_0x542a33;loggerPredictive[_0x4b24('0x4b')](_0x28c778[_0x4b24('0x4a')],_0x4b24('0x1da'),_0x542a33,'milliseconds');_0x28c778[_0x4b24('0x66')]=setInterval(function(){_0x2603f9[_0x4b24('0x66')](_0x28c778);loggerPredictiveCalls[_0x4b24('0x4b')](_0x4b24('0x1db'),_0x1addbc+=0x1);},_0x542a33);}else{loggerPredictive['info'](_0x28c778[_0x4b24('0x4a')],_0x4b24('0x1dc'));}};};Dialer[_0x4b24('0x1b')][_0x4b24('0x1dd')]=function(_0x4c79f7,_0xd1c157){var _0x440a26=this;return function(_0x205312){if(_[_0x4b24('0x7e')](_0x205312)){if(_['isNil'](_0xd1c157[_0x4b24('0x1de')])||!_0xd1c157[_0x4b24('0x1df')]){if(_0x4c79f7[_0x4b24('0xb1')]===_0x4b24('0xb6')){_0x4c79f7['queueStatusComplete']=_[_0x4b24('0x43')](_0x4c79f7[_0x4b24('0x78')])?!![]:_0x4c79f7[_0x4b24('0x78')];var _0x2f3115=uuid['v4']();_0x440a26['actions'][_0x2f3115]=new Action(_0x4c79f7,_0xd1c157,_0x2f3115);loggerBooked[_0x4b24('0x4b')](_0x4b24('0x1e0'),_0x2f3115,'queueStatusComplete:\x20',JSON['stringify'](_0x4c79f7[_0x4b24('0x78')]),_0x4b24('0x1e1'),_0x4c79f7[_0x4b24('0x4a')]);if(_0x4c79f7[_0x4b24('0x78')]){_0x4c79f7[_0x4b24('0x78')]=![];_0x440a26[_0x4b24('0x2d')][_0x440a26['actions'][_0x2f3115]['queue']]=[];ami[_0x4b24('0x99')]({'actionid':_0x2f3115,'action':_0x4b24('0x1e2'),'queue':_0x4c79f7[_0x4b24('0x4a')]})['catch'](function(){_0x440a26[_0x4b24('0xc2')](_0x4c79f7);hopperUtils[_0x4b24('0xdb')]({'active':![],'ContactId':_0x440a26['actions'][_0x2f3115]['ContactId'],'ListId':_0x440a26[_0x4b24('0x27')][_0x2f3115]['ListId'],'VoiceQueueId':_0x440a26[_0x4b24('0x27')][_0x2f3115][_0x4b24('0xdf')]||undefined,'CampaignId':_0x440a26[_0x4b24('0x27')][_0x2f3115]['CampaignId']||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x1e3')));delete _0x440a26[_0x4b24('0x27')][_0x2f3115];});}else{loggerBooked[_0x4b24('0x4b')](_0x4b24('0x1e4'),JSON['stringify'](_0x4c79f7[_0x4b24('0x78')]),_0x4b24('0x1e1'),_0x4c79f7[_0x4b24('0x4a')]);_0x440a26[_0x4b24('0xc2')](_0x4c79f7);hopperUtils[_0x4b24('0xdb')]({'active':![],'ContactId':_0x440a26[_0x4b24('0x27')][_0x2f3115][_0x4b24('0xdd')],'ListId':_0x440a26['actions'][_0x2f3115][_0x4b24('0xde')],'VoiceQueueId':_0x440a26['actions'][_0x2f3115][_0x4b24('0xdf')]||undefined,'CampaignId':_0x440a26[_0x4b24('0x27')][_0x2f3115][_0x4b24('0xe0')]||undefined})[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x1e3')));delete _0x440a26[_0x4b24('0x27')][_0x2f3115];}}else{return _0x440a26[_0x4b24('0x156')](_0x4c79f7,_0xd1c157);}}else{if(utils[_0x4b24('0xce')](undefined,_0xd1c157[_0x4b24('0x1e5')])<_0x4c79f7[_0x4b24('0x1e6')]*0x3c){if(_0xd1c157[_0x4b24('0x154')]&&!_0xd1c157[_0x4b24('0x154')][_0x4b24('0x1e7')]){_0x440a26[_0x4b24('0x20')]['run'](_0xd1c157['id'])[_0x4b24('0x1e')](function(){_0x440a26[_0x4b24('0xc2')](_0x4c79f7);});}else{hopperUtils[_0x4b24('0x1e8')]({'active':![]},_0xd1c157['id'],0x1)['finally'](function(){_0x440a26[_0x4b24('0xc2')](_0x4c79f7);});}}else{_0x4c79f7[_0x4b24('0x1e9')]+=0x1;_0x440a26[_0x4b24('0xc2')](_0x4c79f7);if(_0x4c79f7[_0x4b24('0x1ea')]){hopperUtils[_0x4b24('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xd1c157[_0x4b24('0xdd')],'ListId':_0xd1c157[_0x4b24('0xde')],'VoiceQueueId':_0xd1c157['VoiceQueueId']||undefined,'CampaignId':_0xd1c157[_0x4b24('0xe0')]||undefined})['catch'](loggerCatch(_0x4b24('0x1eb')));hopperUtils[_0x4b24('0xca')](createObjHistory(_0x4c79f7,_0xd1c157,utils[_0x4b24('0x79')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x1ec')));}else{_0x440a26[_0x4b24('0x118')](createObjHistory(_0x4c79f7,_0xd1c157,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x4b24('0x1ed')),_0x4b24('0x1ee'),_0x4b24('0x1ef'));}}}}else{_0x4c79f7['outboundBlacklistCallsDay']+=0x1;_0x440a26[_0x4b24('0x118')](createObjHistory(_0x4c79f7,_0xd1c157,utils[_0x4b24('0x79')][_0x4b24('0x1f0')],0xd,_0x4b24('0x1f1')),_0x4b24('0x1f2'),_0x4b24('0x1f3'));throw _0x4b24('0x1f4');}};};Dialer[_0x4b24('0x1b')][_0x4b24('0x155')]=function(_0x1ad8bc){var _0x3dba08=this;var _0x51973f=_0x1ad8bc[_0x4b24('0x1f5')]-_0x1ad8bc[_0x4b24('0x82')]-_0x1ad8bc[_0x4b24('0x1f6')];emitCampaignSummary(_0x1ad8bc);if(_0x51973f>0x0){if(_0x51973f>this[_0x4b24('0x25')]){_0x51973f=this['maxNumberOriginate'];}_0x1ad8bc['temp']+=_0x51973f;hopperUtils['getContactDialerIvr'](_0x1ad8bc['id'],_0x51973f,_0x1ad8bc['dialOrderByScheduledAt'],_0x1ad8bc)[_0x4b24('0x42')](function(_0x2e8002){_0x1ad8bc[_0x4b24('0x1f6')]-=_0x51973f;_0x1ad8bc['temp']=_0x1ad8bc[_0x4b24('0x1f6')]>0x0?_0x1ad8bc[_0x4b24('0x1f6')]:0x0;if(!utils[_0x4b24('0x1f7')](_0x2e8002)){_0x1ad8bc['message']=utils[_0x4b24('0x79')][_0x4b24('0x1f8')];logger[_0x4b24('0x4b')]('[getContactCampaign2][Empty]'+_0x1ad8bc['name']);}else{_0x1ad8bc[_0x4b24('0x82')]+=_0x2e8002[_0x4b24('0x97')];_0x1ad8bc[_0x4b24('0x6b')]=utils[_0x4b24('0x79')][_0x4b24('0x1f9')];for(var _0x548aff=0x0;_0x548aff<_0x2e8002[_0x4b24('0x97')];_0x548aff+=0x1){_0x1ad8bc[_0x4b24('0x1fa')]+=0x1;if(_[_0x4b24('0xf2')](_0x2e8002[_0x548aff])||_[_0x4b24('0xf2')](_0x2e8002[_0x548aff]['Contact'])||_[_0x4b24('0xf2')](_0x2e8002[_0x548aff][_0x4b24('0x183')])){_0x3dba08['emptyContact']('[actionOriginate]\x20',_0x1ad8bc,_0x2e8002[_0x548aff]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x4b24('0x77')](_0x2e8002[_0x548aff],[_0x4b24('0xe0'),_0x4b24('0x183')]))[_0x4b24('0x42')](_0x3dba08[_0x4b24('0x1dd')](_0x1ad8bc,_0x2e8002[_0x548aff]))[_0x4b24('0x9d')](_0x3dba08[_0x4b24('0x1fb')](_0x4b24('0x1fc'),_0x1ad8bc));}}}})[_0x4b24('0x9d')](loggerGetContactDialer('[getContactCampaign2]',_0x1ad8bc,_0x51973f));}};Dialer['prototype'][_0x4b24('0xb4')]=function(_0x44bed0,_0xf62b7d){var _0x5bb592=this;var _0x23b420=[];if(_0xf62b7d<0x1||_0x44bed0[_0x4b24('0xb1')]===_0x4b24('0xb6')){_0xf62b7d=0x1;}var _0x2fff7a=Math[_0x4b24('0x1bc')](_0x44bed0[_0x4b24('0x138')]*_0xf62b7d)-_0x44bed0[_0x4b24('0x82')]-_0x44bed0[_0x4b24('0x1f6')];if(_0x44bed0['dialLimitQueue']>0x0){var _0x27cc41=_0x44bed0['dialLimitQueue']-_0x44bed0['originated']-_0x44bed0[_0x4b24('0x13a')]-_0x44bed0[_0x4b24('0x1f6')]-_0x44bed0[_0x4b24('0x13b')];if(_0x2fff7a>_0x27cc41){_0x2fff7a=_0x27cc41;}}if(_0x2fff7a>0x0){if(_0x44bed0[_0x4b24('0xb1')]==='booked'){_0x2fff7a=0x1;}if(_0x2fff7a>this['maxNumberOriginate']){_0x2fff7a=this[_0x4b24('0x25')];}_0x44bed0[_0x4b24('0x1f6')]+=_0x2fff7a;for(var _0x3f9a0f in this['agents']){if(typeof this['agents'][_0x3f9a0f]!==_0x4b24('0xaa')){if(this[_0x4b24('0x23')][_0x3f9a0f][_0x4b24('0x70')]===_0x4b24('0x1fd')&&this[_0x4b24('0x23')][_0x3f9a0f][_0x4b24('0x89')]===_0x4b24('0x88')){_0x23b420[_0x4b24('0x98')](this[_0x4b24('0x23')][_0x3f9a0f]['id']);}}}hopperUtils[_0x4b24('0x1fe')](_0x44bed0,_0x23b420,_0x2fff7a)[_0x4b24('0x42')](function(_0x328a1c){_0x44bed0[_0x4b24('0x1f6')]-=_0x2fff7a;_0x44bed0['temp']=_0x44bed0[_0x4b24('0x1f6')]>0x0?_0x44bed0['temp']:0x0;if(!utils[_0x4b24('0x1f7')](_0x328a1c)){hopperUtils[_0x4b24('0x1ff')](_0x44bed0)[_0x4b24('0x42')](sendMessageReschedule(_0x44bed0))[_0x4b24('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x44bed0[_0x4b24('0x82')]+=_0x328a1c['length'];_0x44bed0[_0x4b24('0x6b')]=_0x44bed0[_0x4b24('0xb1')]===_0x4b24('0xb6')?utils[_0x4b24('0x79')][_0x4b24('0x13c')]:utils[_0x4b24('0x79')][_0x4b24('0x1f9')];for(var _0xa2bd49=0x0;_0xa2bd49<_0x328a1c['length'];_0xa2bd49+=0x1){if(_[_0x4b24('0xf2')](_0x328a1c[_0xa2bd49])||_[_0x4b24('0xf2')](_0x328a1c[_0xa2bd49][_0x4b24('0x172')])||_[_0x4b24('0xf2')](_0x328a1c[_0xa2bd49][_0x4b24('0x183')])){_0x5bb592[_0x4b24('0x150')](_0x4b24('0x200'),_0x44bed0,_0x328a1c[_0xa2bd49]);}else{hopperUtils[_0x4b24('0x201')](_[_0x4b24('0x77')](_0x328a1c[_0xa2bd49],['VoiceQueueId',_0x4b24('0x183')]))['then'](_0x5bb592[_0x4b24('0x1dd')](_0x44bed0,_0x328a1c[_0xa2bd49]))['catch'](_0x5bb592[_0x4b24('0x1fb')]('[actionOriginate]\x20',_0x44bed0));}}}})[_0x4b24('0x9d')](loggerGetContactDialer(_0x4b24('0x202'),_0x44bed0,_0x2fff7a));}};Dialer[_0x4b24('0x1b')][_0x4b24('0x66')]=function(_0x155115){if(_0x155115['dialLimitQueue']>0x0){var _0x555327=_0x155115['dialLimitQueue']-_0x155115['originated']-_0x155115[_0x4b24('0x13a')];if(_0x555327>0x0){this[_0x4b24('0x203')](_0x155115);}else{loggerPredictiveCalls[_0x4b24('0x4b')](_0x4b24('0x204'));}}else{this[_0x4b24('0x203')](_0x155115);}};Dialer[_0x4b24('0x1b')]['tryOriginatePredictive']=function(_0x3803e4){var _0x359919=this;var _0x35b9dc=[];_0x3803e4[_0x4b24('0x82')]+=0x1;for(var _0xc777aa in this['agents']){if(typeof this[_0x4b24('0x23')][_0xc777aa]!==_0x4b24('0xaa')){if(this['agents'][_0xc777aa][_0x4b24('0x70')]===_0x4b24('0x1fd')&&this[_0x4b24('0x23')][_0xc777aa]['status']==='reachable'){_0x35b9dc[_0x4b24('0x98')](this[_0x4b24('0x23')][_0xc777aa]['id']);}}}return this[_0x4b24('0x1fe')](_0x3803e4['id'],_0x35b9dc,0x1,_0x3803e4['dialOrderByScheduledAt'],_0x3803e4)[_0x4b24('0x42')](function(_0x59d1d3){if(!utils[_0x4b24('0x1f7')](_0x59d1d3)){utils[_0x4b24('0x69')](_0x3803e4,0x1,0x0);return hopperUtils[_0x4b24('0x1ff')](_0x3803e4)[_0x4b24('0x42')](sendMessageReschedule(_0x3803e4))[_0x4b24('0x9d')](loggerCatch(_0x4b24('0x205')));}else{_0x3803e4[_0x4b24('0x6b')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_['isNil'](_0x59d1d3[0x0])||_['isNil'](_0x59d1d3[0x0][_0x4b24('0x172')])||_[_0x4b24('0xf2')](_0x59d1d3[0x0]['phone'])){_0x359919['emptyContact'](_0x4b24('0x200'),_0x3803e4,_0x59d1d3[0x0]);}else{return hopperUtils[_0x4b24('0x201')](_[_0x4b24('0x77')](_0x59d1d3[0x0],[_0x4b24('0xdf'),'phone']))['then'](_0x359919[_0x4b24('0x1dd')](_0x3803e4,_0x59d1d3[0x0]))[_0x4b24('0x9d')](_0x359919['loggerHandler'](_0x4b24('0x206'),_0x3803e4));}}})[_0x4b24('0x9d')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3803e4,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x2f67f1,_0x4bee19,_0x3be3da,_0x2cd181,_0x2462a6,_0x3b6071){loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x207'));loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x208'),_0x2f67f1);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x209'),_0x4bee19);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x20a'),_0x3be3da);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x20b'),_0x2cd181);loggerPredictive[_0x4b24('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2462a6);loggerPredictive[_0x4b24('0x4b')]('---------------------------');return new Promise(function(_0x566a76,_0x5b8d1c){if(_0x2f67f1<=0x0||isNaN(_0x2f67f1)){return _0x5b8d1c(msgResponse('[abandonmentRate]',_0x4b24('0xbe'),_0x4b24('0x20c')+_0x2f67f1));}if(_0x3be3da<=0x0||isNaN(_0x3be3da)){return _0x5b8d1c(msgResponse(_0x4b24('0x20d'),'Error',_0x4b24('0x20e')+_0x3be3da));}if(_0x2cd181<=0x0||isNaN(_0x2cd181)){return _0x5b8d1c(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x2cd181));}if(_0x4bee19<=0x0||isNaN(_0x4bee19)){return _0x5b8d1c(msgResponse(_0x4b24('0x20d'),_0x4b24('0xbe'),'interval\x20=\x20'+_0x4bee19));}if(_0x2462a6<=0x0||isNaN(_0x2462a6)){return _0x5b8d1c(msgResponse('[abandonmentRate]',_0x4b24('0xbe'),_0x4b24('0x20f')+_0x2462a6));}_0x3b6071=_0x3b6071||0x0;var _0x292beb=0x1/_0x3be3da;var _0x12e48f=0x0;var _0xbaf9e4=0x0;var _0x3e1b84=0x0;var _0x3a2985=0x0;for(var _0x3e3855=0x0;_0x3e1b84<_0x2462a6;_0x3e3855+=0x1){_0xbaf9e4=_0x3e3855/_0x4bee19;_0x12e48f=(_0x2cd181*_0xbaf9e4+_0x3b6071)/_0x292beb;_0x3e1b84=utils[_0x4b24('0x210')](_0x12e48f,_0x2f67f1);_0x3a2985=_0x12e48f/_0x2f67f1*(0x1-utils['erlangb'](_0x12e48f,_0x2f67f1));}return _0x566a76({'erlangCalls':_0x3e3855,'erlangCallToSecond':_0x4bee19/_0x3e3855,'erlangAbandonmentRate':_0x3e1b84,'erlangBusyFactor':_0x3a2985});});};Dialer[_0x4b24('0x1b')][_0x4b24('0x1d1')]=function(_0x36c19a,_0x5afb06,_0x38456b,_0x21070b,_0x36a602,_0x19ef01){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x208'),_0x36c19a);loggerPredictive['info'](_0x4b24('0x209'),_0x5afb06);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x20a'),_0x38456b);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x20b'),_0x21070b);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x211'),_0x36a602);loggerPredictive[_0x4b24('0x4b')](_0x4b24('0x57'));return new Promise(function(_0x285349,_0x322505){if(_0x36c19a<=0x0||isNaN(_0x36c19a)){return _0x322505(msgResponse(_0x4b24('0x212'),'Error',_0x4b24('0x20c')+_0x36c19a));}if(_0x38456b<=0x0||isNaN(_0x38456b)){return _0x322505(msgResponse(_0x4b24('0x212'),_0x4b24('0xbe'),_0x4b24('0x20e')+_0x38456b));}if(_0x21070b<=0x0||isNaN(_0x21070b)){return _0x322505(msgResponse(_0x4b24('0x212'),_0x4b24('0xbe'),_0x4b24('0x213')+_0x21070b));}if(_0x5afb06<=0x0||isNaN(_0x5afb06)){return _0x322505(msgResponse(_0x4b24('0x212'),_0x4b24('0xbe'),'interval\x20=\x20'+_0x5afb06));}if(_0x36a602<=0x0||isNaN(_0x36a602)){return _0x322505(msgResponse(_0x4b24('0x212'),_0x4b24('0xbe'),'Umin\x20=\x20'+_0x36a602));}_0x19ef01=_0x19ef01||0x0;var _0x30733a=0x1/_0x38456b;var _0x5e1db0=0x0;var _0x3ea365=0x0;var _0x4addaa=0x0;var _0x51f2cc=0x0;for(var _0x461b84=0x0;_0x51f2cc<_0x36a602;_0x461b84+=0x1){_0x3ea365=_0x461b84/_0x5afb06;_0x5e1db0=(_0x21070b*_0x3ea365+_0x19ef01)/_0x30733a;_0x4addaa=utils[_0x4b24('0x210')](_0x5e1db0,_0x36c19a);_0x51f2cc=_0x5e1db0/_0x36c19a*(0x1-utils[_0x4b24('0x210')](_0x5e1db0,_0x36c19a));}return _0x285349({'erlangCalls':_0x461b84,'erlangCallToSecond':_0x5afb06/_0x461b84,'erlangAbandonmentRate':_0x4addaa,'erlangBusyFactor':_0x51f2cc});});};module[_0x4b24('0x214')]=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 2ea10b7..1937630 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 _0x90bd=['util','lodash','moment','isNil','string','name','Contact','phone','number','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','substring','getQueue','exports'];(function(_0x16da81,_0x6efc64){var _0xfe4774=function(_0x2e2c5d){while(--_0x2e2c5d){_0x16da81['push'](_0x16da81['shift']());}};_0xfe4774(++_0x6efc64);}(_0x90bd,0x1c2));var _0xd90b=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x90bd[_0x48999d];return _0x1ad0d1;};'use strict';var util=require(_0xd90b('0x0'));var _=require(_0xd90b('0x1'));var moment=require(_0xd90b('0x2'));function checkNameSurname(_0x1586e2,_0x3d80f3,_0x7839ce){var _0x4dc496='';if(!_[_0xd90b('0x3')](_0x3d80f3)&&'string'===typeof _0x3d80f3){_0x4dc496+=_0x3d80f3;}if(!_[_0xd90b('0x3')](_0x7839ce)&&_0xd90b('0x4')===typeof _0x7839ce){_0x4dc496+='\x20'+_0x7839ce;}if(_0x4dc496!==''){return _0x4dc496;}return _0x1586e2;}function Action(_0x17a694,_0x139647,_0x25455d){this['voiceQueue']=_0x17a694;this['uniqueid']=_0x25455d||undefined;this[_0xd90b('0x5')]=checkNameSurname(_0x139647[_0xd90b('0x6')][_0xd90b('0x7')],_0x139647[_0xd90b('0x6')]['firstName'],_0x139647[_0xd90b('0x6')]['lastName']);this[_0xd90b('0x8')]=_0x139647[_0xd90b('0x7')];this[_0xd90b('0x9')]=_0x17a694[_0xd90b('0x5')];this[_0xd90b('0xa')]=_0x139647[_0xd90b('0xa')]||![];this['type']=_0x17a694['type'];this[_0xd90b('0xb')]=_0x17a694['dialQueueTimeout']||0x3;this[_0xd90b('0xc')]=_0x139647[_0xd90b('0xc')];this[_0xd90b('0xd')]=_0x139647['countbusyretry'];this[_0xd90b('0xe')]=_0x139647[_0xd90b('0xe')];this[_0xd90b('0xf')]=_0x139647[_0xd90b('0xf')];this[_0xd90b('0x10')]=_0x139647[_0xd90b('0x10')];this[_0xd90b('0x11')]=_0x139647[_0xd90b('0x11')];this[_0xd90b('0x12')]=_0x139647['countabandonedretry'];this[_0xd90b('0x13')]=_0x139647['countmachineretry'];this[_0xd90b('0x14')]=_0x139647[_0xd90b('0x14')];this[_0xd90b('0x15')]=_0x139647[_0xd90b('0x15')];this[_0xd90b('0x16')]=_0x139647[_0xd90b('0x16')];this[_0xd90b('0x17')]=_0x139647[_0xd90b('0x17')];this[_0xd90b('0x18')]=_0x139647[_0xd90b('0x18')];this[_0xd90b('0x19')]=_0x139647[_0xd90b('0x19')];this[_0xd90b('0x1a')]=_0x139647['id'];this[_0xd90b('0x1b')]=_0x139647['Contact'][_0xd90b('0x1c')]||'';this[_0xd90b('0x1d')]=moment()[_0xd90b('0x1e')](_0xd90b('0x1f'));this[_0xd90b('0x20')]=_0x139647[_0xd90b('0x20')];this[_0xd90b('0x21')]=_0x139647['callbackuniqueid'];this['callbackat']=_0x139647[_0xd90b('0x22')];this['recallme']=_0x139647[_0xd90b('0x23')];this[_0xd90b('0x24')]='';this[_0xd90b('0x25')]='';}Action[_0xd90b('0x26')][_0xd90b('0x27')]=function(){return util[_0xd90b('0x1e')]('\x22%s\x22\x20<%s>',this[_0xd90b('0x5')],this[_0xd90b('0x28')][_0xd90b('0x29')]>0x0?this[_0xd90b('0x8')][_0xd90b('0x2a')](this['voiceQueue'][_0xd90b('0x29')]):this[_0xd90b('0x8')]);};Action[_0xd90b('0x26')][_0xd90b('0x2b')]=function(){return this[_0xd90b('0x9')];};module[_0xd90b('0x2c')]=Action; \ No newline at end of file +var _0x2e8e=['lodash','string','isNil','voiceQueue','uniqueid','Contact','phone','firstName','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','substring','getQueue','util'];(function(_0x2fcc11,_0xd71b4e){var _0x1d9ece=function(_0x2cc05b){while(--_0x2cc05b){_0x2fcc11['push'](_0x2fcc11['shift']());}};_0x1d9ece(++_0xd71b4e);}(_0x2e8e,0x1df));var _0xe2e8=function(_0x1e9d62,_0x25bb8e){_0x1e9d62=_0x1e9d62-0x0;var _0x56c490=_0x2e8e[_0x1e9d62];return _0x56c490;};'use strict';var util=require(_0xe2e8('0x0'));var _=require(_0xe2e8('0x1'));var moment=require('moment');function checkNameSurname(_0x2536ec,_0x407680,_0x2e7947){var _0x4512fb='';if(!_['isNil'](_0x407680)&&_0xe2e8('0x2')===typeof _0x407680){_0x4512fb+=_0x407680;}if(!_[_0xe2e8('0x3')](_0x2e7947)&&'string'===typeof _0x2e7947){_0x4512fb+='\x20'+_0x2e7947;}if(_0x4512fb!==''){return _0x4512fb;}return _0x2536ec;}function Action(_0x37ec89,_0x18e5b6,_0x29688f){this[_0xe2e8('0x4')]=_0x37ec89;this[_0xe2e8('0x5')]=_0x29688f||undefined;this['name']=checkNameSurname(_0x18e5b6[_0xe2e8('0x6')][_0xe2e8('0x7')],_0x18e5b6[_0xe2e8('0x6')][_0xe2e8('0x8')],_0x18e5b6['Contact'][_0xe2e8('0x9')]);this['number']=_0x18e5b6[_0xe2e8('0x7')];this[_0xe2e8('0xa')]=_0x37ec89[_0xe2e8('0xb')];this['active']=_0x18e5b6[_0xe2e8('0xc')]||![];this[_0xe2e8('0xd')]=_0x37ec89[_0xe2e8('0xd')];this['dialQueueTimeout']=_0x37ec89[_0xe2e8('0xe')]||0x3;this[_0xe2e8('0xf')]=_0x18e5b6[_0xe2e8('0xf')];this['countbusyretry']=_0x18e5b6['countbusyretry'];this[_0xe2e8('0x10')]=_0x18e5b6[_0xe2e8('0x10')];this['countnoanswerretry']=_0x18e5b6[_0xe2e8('0x11')];this[_0xe2e8('0x12')]=_0x18e5b6[_0xe2e8('0x12')];this['countdropretry']=_0x18e5b6[_0xe2e8('0x13')];this[_0xe2e8('0x14')]=_0x18e5b6[_0xe2e8('0x14')];this['countmachineretry']=_0x18e5b6[_0xe2e8('0x15')];this[_0xe2e8('0x16')]=_0x18e5b6['countagentrejectretry'];this[_0xe2e8('0x17')]=_0x18e5b6[_0xe2e8('0x17')];this[_0xe2e8('0x18')]=_0x18e5b6[_0xe2e8('0x18')];this[_0xe2e8('0x19')]=_0x18e5b6['UserId'];this[_0xe2e8('0x1a')]=_0x18e5b6['VoiceQueueId'];this[_0xe2e8('0x1b')]=_0x18e5b6[_0xe2e8('0x1b')];this[_0xe2e8('0x1c')]=_0x18e5b6['id'];this['ContactFirstName']=_0x18e5b6[_0xe2e8('0x6')]['firstName']||'';this['starttime']=moment()[_0xe2e8('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x18e5b6[_0xe2e8('0x1e')];this['callbackuniqueid']=_0x18e5b6['callbackuniqueid'];this[_0xe2e8('0x1f')]=_0x18e5b6[_0xe2e8('0x1f')];this[_0xe2e8('0x20')]=_0x18e5b6[_0xe2e8('0x20')];this[_0xe2e8('0x21')]='';this[_0xe2e8('0x22')]='';}Action[_0xe2e8('0x23')]['getCaller']=function(){return util[_0xe2e8('0x1d')](_0xe2e8('0x24'),this[_0xe2e8('0xb')],this[_0xe2e8('0x4')]['dialCutDigit']>0x0?this[_0xe2e8('0x25')][_0xe2e8('0x26')](this[_0xe2e8('0x4')]['dialCutDigit']):this[_0xe2e8('0x25')]);};Action[_0xe2e8('0x23')][_0xe2e8('0x27')]=function(){return this[_0xe2e8('0xa')];};module['exports']=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 23fed23..a09324d 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 _0x0cac=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x4cf654,_0x25aedc){var _0x2c69f2=function(_0x57a4f7){while(--_0x57a4f7){_0x4cf654['push'](_0x4cf654['shift']());}};_0x2c69f2(++_0x25aedc);}(_0x0cac,0x17a));var _0xc0ca=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x0cac[_0x42e25e];return _0x1ed3a6;};'use strict';var moment=require(_0xc0ca('0x0'));var utils=require('../utils');function AgentComplete(_0x43eb0a,_0x1fbcaa){this[_0xc0ca('0x1')]=0x4;this[_0xc0ca('0x2')]=_0xc0ca('0x3');this[_0xc0ca('0x4')]=_0x43eb0a[_0xc0ca('0x4')];this[_0xc0ca('0x5')]=_0x43eb0a[_0xc0ca('0x5')];this[_0xc0ca('0x6')]=_0x43eb0a['type']===_0xc0ca('0x7')?_0xc0ca('0x8'):_0x43eb0a[_0xc0ca('0x5')];this[_0xc0ca('0x9')]=_0x43eb0a[_0xc0ca('0x9')];this['countcongestionretry']=_0x43eb0a[_0xc0ca('0xa')];this[_0xc0ca('0xb')]=_0x43eb0a[_0xc0ca('0xb')];this[_0xc0ca('0xc')]=_0x43eb0a[_0xc0ca('0x9')]+_0x43eb0a[_0xc0ca('0xa')]+_0x43eb0a[_0xc0ca('0xb')]+_0x43eb0a[_0xc0ca('0xd')]+_0x43eb0a[_0xc0ca('0xe')]+_0x43eb0a[_0xc0ca('0xf')]+_0x43eb0a[_0xc0ca('0x10')]+_0x43eb0a[_0xc0ca('0x11')];this[_0xc0ca('0xd')]=_0x43eb0a['countnosuchnumberretry'];this[_0xc0ca('0xe')]=_0x43eb0a[_0xc0ca('0xe')];this['countabandonedretry']=_0x43eb0a['countabandonedretry'];this[_0xc0ca('0x10')]=_0x43eb0a[_0xc0ca('0x10')];this['countagentrejectretry']=_0x43eb0a[_0xc0ca('0x11')];this[_0xc0ca('0x12')]=_0x1fbcaa[_0xc0ca('0x12')];this[_0xc0ca('0x13')]=_0x43eb0a['name'];this[_0xc0ca('0x14')]=_0x43eb0a['number'];this['starttime']=_0x43eb0a[_0xc0ca('0x15')];this[_0xc0ca('0x16')]=_0x43eb0a[_0xc0ca('0x16')];this[_0xc0ca('0x17')]=_0x43eb0a[_0xc0ca('0x17')];this[_0xc0ca('0x18')]=moment()[_0xc0ca('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc0ca('0x1a')]=utils[_0xc0ca('0x1b')](_0x43eb0a[_0xc0ca('0x16')],_0x43eb0a['starttime']);this[_0xc0ca('0x1c')]=utils['getSeconds'](_0x43eb0a[_0xc0ca('0x17')],_0x43eb0a[_0xc0ca('0x16')]);this[_0xc0ca('0x1d')]=utils[_0xc0ca('0x1b')](this['endtime'],_0x43eb0a[_0xc0ca('0x17')]);this[_0xc0ca('0x8')]=_0x1fbcaa['queue'];this[_0xc0ca('0x1e')]=_0x1fbcaa[_0xc0ca('0x1e')];this['reason']=_0x1fbcaa['reason'];this[_0xc0ca('0x1f')]=_0x43eb0a[_0xc0ca('0x1f')];this[_0xc0ca('0x20')]=_0x43eb0a['callbackuniqueid'];this[_0xc0ca('0x21')]=_0x43eb0a[_0xc0ca('0x21')];this[_0xc0ca('0x22')]=_0x43eb0a[_0xc0ca('0x22')];this[_0xc0ca('0x23')]=_0x43eb0a[_0xc0ca('0x23')];this[_0xc0ca('0x24')]=_0x43eb0a[_0xc0ca('0x24')];this[_0xc0ca('0x25')]=_0x43eb0a['UserId'];this['VoiceQueueId']=_0x43eb0a[_0xc0ca('0x26')];this[_0xc0ca('0x27')]=_0x43eb0a[_0xc0ca('0x27')];this[_0xc0ca('0x28')]=_0x43eb0a[_0xc0ca('0x28')]||'';this[_0xc0ca('0x29')]=_0x43eb0a[_0xc0ca('0x29')]||'';this[_0xc0ca('0x2a')]=_0x43eb0a[_0xc0ca('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file +var _0x14ef=['answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','exports','moment','../utils','statedesc','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime'];(function(_0x4ca2b5,_0x228b0f){var _0x3ecd00=function(_0x517783){while(--_0x517783){_0x4ca2b5['push'](_0x4ca2b5['shift']());}};_0x3ecd00(++_0x228b0f);}(_0x14ef,0x68));var _0xf14e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x14ef[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0xf14e('0x0'));var utils=require(_0xf14e('0x1'));function AgentComplete(_0x505dcf,_0xf76099){this['state']=0x4;this[_0xf14e('0x2')]='Answer';this[_0xf14e('0x3')]=_0x505dcf[_0xf14e('0x3')];this[_0xf14e('0x4')]=_0x505dcf[_0xf14e('0x4')];this['campaigntype']=_0x505dcf['type']==='outbound'?'queue':_0x505dcf[_0xf14e('0x4')];this['countbusyretry']=_0x505dcf[_0xf14e('0x5')];this[_0xf14e('0x6')]=_0x505dcf[_0xf14e('0x6')];this[_0xf14e('0x7')]=_0x505dcf['countnoanswerretry'];this['countglobal']=_0x505dcf['countbusyretry']+_0x505dcf[_0xf14e('0x6')]+_0x505dcf[_0xf14e('0x7')]+_0x505dcf[_0xf14e('0x8')]+_0x505dcf[_0xf14e('0x9')]+_0x505dcf[_0xf14e('0xa')]+_0x505dcf[_0xf14e('0xb')]+_0x505dcf[_0xf14e('0xc')];this[_0xf14e('0x8')]=_0x505dcf['countnosuchnumberretry'];this[_0xf14e('0x9')]=_0x505dcf['countdropretry'];this[_0xf14e('0xa')]=_0x505dcf[_0xf14e('0xa')];this[_0xf14e('0xb')]=_0x505dcf[_0xf14e('0xb')];this[_0xf14e('0xc')]=_0x505dcf[_0xf14e('0xc')];this[_0xf14e('0xd')]=_0xf76099[_0xf14e('0xd')];this['calleridname']=_0x505dcf[_0xf14e('0xe')];this[_0xf14e('0xf')]=_0x505dcf[_0xf14e('0x10')];this['starttime']=_0x505dcf[_0xf14e('0x11')];this[_0xf14e('0x12')]=_0x505dcf[_0xf14e('0x12')];this['answertime']=_0x505dcf[_0xf14e('0x13')];this[_0xf14e('0x14')]=moment()[_0xf14e('0x15')](_0xf14e('0x16'));this[_0xf14e('0x17')]=utils[_0xf14e('0x18')](_0x505dcf[_0xf14e('0x12')],_0x505dcf[_0xf14e('0x11')]);this['holdtime']=utils['getSeconds'](_0x505dcf[_0xf14e('0x13')],_0x505dcf[_0xf14e('0x12')]);this[_0xf14e('0x19')]=utils['getSeconds'](this[_0xf14e('0x14')],_0x505dcf[_0xf14e('0x13')]);this[_0xf14e('0x1a')]=_0xf76099[_0xf14e('0x1a')];this[_0xf14e('0x1b')]=_0xf76099[_0xf14e('0x1b')];this[_0xf14e('0x1c')]=_0xf76099['reason'];this[_0xf14e('0x1d')]=_0x505dcf[_0xf14e('0x1d')];this[_0xf14e('0x1e')]=_0x505dcf['callbackuniqueid'];this[_0xf14e('0x1f')]=_0x505dcf['callbackat'];this[_0xf14e('0x20')]=_0x505dcf['recallme'];this[_0xf14e('0x21')]=_0x505dcf[_0xf14e('0x21')];this[_0xf14e('0x22')]=_0x505dcf['ListId'];this[_0xf14e('0x23')]=_0x505dcf['UserId'];this[_0xf14e('0x24')]=_0x505dcf['VoiceQueueId'];this['CampaignId']=_0x505dcf[_0xf14e('0x25')];this[_0xf14e('0x26')]=_0x505dcf[_0xf14e('0x26')]||'';this['originatecalleridname']=_0x505dcf['originatecalleridname']||'';this[_0xf14e('0x27')]=_0x505dcf['agiafterat'];}module[_0xf14e('0x28')]=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 f5fb23d..46b15cf 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 _0xb7d4=['ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x4343ab,_0x3404cd){var _0x23728d=function(_0x51fb39){while(--_0x51fb39){_0x4343ab['push'](_0x4343ab['shift']());}};_0x23728d(++_0x3404cd);}(_0xb7d4,0xe5));var _0x4b7d=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb7d4[_0x178e48];return _0x440d7e;};'use strict';function Final(_0x44c3c8){this[_0x4b7d('0x0')]=_0x44c3c8['uniqueid'];this[_0x4b7d('0x1')]=_0x44c3c8[_0x4b7d('0x1')];this[_0x4b7d('0x2')]=_0x44c3c8[_0x4b7d('0x2')];this[_0x4b7d('0x3')]=_0x44c3c8[_0x4b7d('0x2')]==='outbound'?_0x4b7d('0x4'):_0x44c3c8[_0x4b7d('0x2')];this[_0x4b7d('0x5')]=_0x44c3c8[_0x4b7d('0x5')];this['countcongestionretry']=_0x44c3c8[_0x4b7d('0x6')];this[_0x4b7d('0x7')]=_0x44c3c8[_0x4b7d('0x7')];this[_0x4b7d('0x8')]=_0x44c3c8['countbusyretry']+_0x44c3c8['countcongestionretry']+_0x44c3c8[_0x4b7d('0x7')]+_0x44c3c8['countnosuchnumberretry']+_0x44c3c8[_0x4b7d('0x9')]+_0x44c3c8[_0x4b7d('0xa')]+_0x44c3c8[_0x4b7d('0xb')]+_0x44c3c8[_0x4b7d('0xc')];this[_0x4b7d('0xd')]=_0x44c3c8[_0x4b7d('0xd')];this[_0x4b7d('0x9')]=_0x44c3c8['countdropretry'];this[_0x4b7d('0xa')]=_0x44c3c8['countabandonedretry'];this[_0x4b7d('0xb')]=_0x44c3c8['countmachineretry'];this['countagentrejectretry']=_0x44c3c8['countagentrejectretry'];this[_0x4b7d('0x4')]=_0x44c3c8[_0x4b7d('0x4')];this['calleridname']=_0x44c3c8[_0x4b7d('0xe')];this[_0x4b7d('0xf')]=_0x44c3c8[_0x4b7d('0xf')];this['starttime']=_0x44c3c8[_0x4b7d('0x10')];this[_0x4b7d('0x11')]=_0x44c3c8['responsetime'];this[_0x4b7d('0x12')]=_0x44c3c8[_0x4b7d('0x11')];this[_0x4b7d('0x13')]=_0x44c3c8[_0x4b7d('0x13')]||0x0;this['holdtime']=_0x44c3c8['holdtime']||0x0;this['talktime']=_0x44c3c8['talktime']||0x0;this[_0x4b7d('0x14')]=_0x44c3c8[_0x4b7d('0x14')];this[_0x4b7d('0x15')]=_0x44c3c8[_0x4b7d('0x15')];this[_0x4b7d('0x16')]=_0x44c3c8[_0x4b7d('0x16')];this[_0x4b7d('0x17')]=_0x44c3c8[_0x4b7d('0x17')];this[_0x4b7d('0x18')]=_0x44c3c8['ContactId'];this['ListId']=_0x44c3c8['ListId'];this[_0x4b7d('0x19')]=_0x44c3c8['UserId'];this[_0x4b7d('0x1a')]=_0x44c3c8[_0x4b7d('0x1a')];this[_0x4b7d('0x1b')]=_0x44c3c8['CampaignId'];this[_0x4b7d('0x1c')]=_0x44c3c8['originatecalleridnum']||'';this[_0x4b7d('0x1d')]=_0x44c3c8['originatecalleridname']||'';this['state']=_0x44c3c8['state'];this[_0x4b7d('0x1e')]=_0x44c3c8[_0x4b7d('0x1e')];}module['exports']=Final; \ No newline at end of file +var _0x7d49=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x302624,_0x57d945){var _0x395093=function(_0x40e94d){while(--_0x40e94d){_0x302624['push'](_0x302624['shift']());}};_0x395093(++_0x57d945);}(_0x7d49,0x128));var _0x97d4=function(_0x35907b,_0x202eed){_0x35907b=_0x35907b-0x0;var _0x1fa4f4=_0x7d49[_0x35907b];return _0x1fa4f4;};'use strict';function Final(_0x2347dc){this[_0x97d4('0x0')]=_0x2347dc[_0x97d4('0x0')];this[_0x97d4('0x1')]=_0x2347dc[_0x97d4('0x1')];this[_0x97d4('0x2')]=_0x2347dc[_0x97d4('0x2')];this[_0x97d4('0x3')]=_0x2347dc[_0x97d4('0x2')]===_0x97d4('0x4')?_0x97d4('0x5'):_0x2347dc[_0x97d4('0x2')];this['countbusyretry']=_0x2347dc[_0x97d4('0x6')];this[_0x97d4('0x7')]=_0x2347dc[_0x97d4('0x7')];this['countnoanswerretry']=_0x2347dc[_0x97d4('0x8')];this[_0x97d4('0x9')]=_0x2347dc[_0x97d4('0x6')]+_0x2347dc['countcongestionretry']+_0x2347dc[_0x97d4('0x8')]+_0x2347dc[_0x97d4('0xa')]+_0x2347dc['countdropretry']+_0x2347dc['countabandonedretry']+_0x2347dc[_0x97d4('0xb')]+_0x2347dc[_0x97d4('0xc')];this[_0x97d4('0xa')]=_0x2347dc[_0x97d4('0xa')];this[_0x97d4('0xd')]=_0x2347dc['countdropretry'];this[_0x97d4('0xe')]=_0x2347dc[_0x97d4('0xe')];this[_0x97d4('0xb')]=_0x2347dc[_0x97d4('0xb')];this[_0x97d4('0xc')]=_0x2347dc[_0x97d4('0xc')];this['queue']=_0x2347dc[_0x97d4('0x5')];this['calleridname']=_0x2347dc[_0x97d4('0xf')];this['calleridnum']=_0x2347dc[_0x97d4('0x10')];this[_0x97d4('0x11')]=_0x2347dc[_0x97d4('0x11')];this[_0x97d4('0x12')]=_0x2347dc[_0x97d4('0x12')];this[_0x97d4('0x13')]=_0x2347dc['responsetime'];this[_0x97d4('0x14')]=_0x2347dc[_0x97d4('0x14')]||0x0;this[_0x97d4('0x15')]=_0x2347dc[_0x97d4('0x15')]||0x0;this[_0x97d4('0x16')]=_0x2347dc[_0x97d4('0x16')]||0x0;this[_0x97d4('0x17')]=_0x2347dc['callback'];this['callbackuniqueid']=_0x2347dc[_0x97d4('0x18')];this[_0x97d4('0x19')]=_0x2347dc[_0x97d4('0x19')];this[_0x97d4('0x1a')]=_0x2347dc[_0x97d4('0x1a')];this[_0x97d4('0x1b')]=_0x2347dc[_0x97d4('0x1b')];this[_0x97d4('0x1c')]=_0x2347dc[_0x97d4('0x1c')];this[_0x97d4('0x1d')]=_0x2347dc[_0x97d4('0x1d')];this['VoiceQueueId']=_0x2347dc[_0x97d4('0x1e')];this['CampaignId']=_0x2347dc['CampaignId'];this[_0x97d4('0x1f')]=_0x2347dc[_0x97d4('0x1f')]||'';this[_0x97d4('0x20')]=_0x2347dc['originatecalleridname']||'';this[_0x97d4('0x21')]=_0x2347dc[_0x97d4('0x21')];this[_0x97d4('0x22')]=_0x2347dc[_0x97d4('0x22')];}module[_0x97d4('0x23')]=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 f6f2f36..baa2bae 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 _0x67b6=['calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','talktime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','amd','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x4fa6a3,_0x2e411a){var _0x422238=function(_0x3a7a88){while(--_0x3a7a88){_0x4fa6a3['push'](_0x4fa6a3['shift']());}};_0x422238(++_0x2e411a);}(_0x67b6,0xed));var _0x667b=function(_0x248306,_0x2ab559){_0x248306=_0x248306-0x0;var _0x478118=_0x67b6[_0x248306];return _0x478118;};'use strict';var moment=require(_0x667b('0x0'));var utils=require(_0x667b('0x1'));function Hangup(_0x3a9601,_0x1fffee){this[_0x667b('0x2')]=0x4;this['statedesc']=_0x667b('0x3');this[_0x667b('0x4')]=_0x3a9601[_0x667b('0x4')];this[_0x667b('0x5')]=_0x3a9601[_0x667b('0x5')];this[_0x667b('0x6')]=_0x3a9601[_0x667b('0x5')]===_0x667b('0x7')?'queue':_0x3a9601[_0x667b('0x5')];this[_0x667b('0x8')]=_0x3a9601[_0x667b('0x8')]||![];this['countbusyretry']=_0x3a9601['countbusyretry'];this['countcongestionretry']=_0x3a9601[_0x667b('0x9')];this['countnoanswerretry']=_0x3a9601[_0x667b('0xa')];this[_0x667b('0xb')]=_0x3a9601[_0x667b('0xc')]+_0x3a9601['countcongestionretry']+_0x3a9601[_0x667b('0xa')]+_0x3a9601[_0x667b('0xd')]+_0x3a9601[_0x667b('0xe')]+_0x3a9601[_0x667b('0xf')]+_0x3a9601[_0x667b('0x10')]+_0x3a9601['countagentrejectretry'];this[_0x667b('0xd')]=_0x3a9601[_0x667b('0xd')];this['countdropretry']=_0x3a9601[_0x667b('0xe')];this['countabandonedretry']=_0x3a9601['countabandonedretry'];this[_0x667b('0x10')]=_0x3a9601['countmachineretry'];this[_0x667b('0x11')]=_0x3a9601['countagentrejectretry'];this[_0x667b('0x12')]=_0x1fffee[_0x667b('0x12')];this[_0x667b('0x13')]=_0x3a9601[_0x667b('0x14')];this[_0x667b('0x15')]=_0x3a9601[_0x667b('0x16')];this[_0x667b('0x17')]=_0x3a9601[_0x667b('0x17')];this['responsetime']=_0x3a9601[_0x667b('0x18')];this[_0x667b('0x19')]=moment()[_0x667b('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x667b('0x1b')]=utils[_0x667b('0x1c')](_0x3a9601[_0x667b('0x18')],_0x3a9601['starttime']);this[_0x667b('0x1d')]=0x0;this[_0x667b('0x1e')]=utils['getSeconds'](this[_0x667b('0x19')],_0x3a9601[_0x667b('0x18')]);this['queue']=_0x3a9601[_0x667b('0x1f')];this['membername']=_0x667b('0x20');this['reason']=_0x1fffee[_0x667b('0x21')];this[_0x667b('0x22')]=_0x3a9601['callback'];this[_0x667b('0x23')]=_0x3a9601[_0x667b('0x23')];this['callbackat']=_0x3a9601[_0x667b('0x24')];this[_0x667b('0x25')]=_0x3a9601[_0x667b('0x25')];this['ContactId']=_0x3a9601['ContactId'];this[_0x667b('0x26')]=_0x3a9601['ListId'];this[_0x667b('0x27')]=_0x3a9601['UserId'];this[_0x667b('0x28')]=_0x3a9601['VoiceQueueId'];this['CampaignId']=_0x3a9601[_0x667b('0x29')];}module[_0x667b('0x2a')]=Hangup; \ No newline at end of file +var _0xd150=['countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','getSeconds','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry'];(function(_0x4b78ea,_0x30b3a1){var _0x40cf06=function(_0x53d77e){while(--_0x53d77e){_0x4b78ea['push'](_0x4b78ea['shift']());}};_0x40cf06(++_0x30b3a1);}(_0xd150,0x152));var _0x0d15=function(_0x26a527,_0xefb799){_0x26a527=_0x26a527-0x0;var _0x40ea9b=_0xd150[_0x26a527];return _0x40ea9b;};'use strict';var moment=require(_0x0d15('0x0'));var utils=require(_0x0d15('0x1'));function Hangup(_0x1c5003,_0x311810){this[_0x0d15('0x2')]=0x4;this['statedesc']='Answer';this[_0x0d15('0x3')]=_0x1c5003[_0x0d15('0x3')];this['type']=_0x1c5003[_0x0d15('0x4')];this[_0x0d15('0x5')]=_0x1c5003[_0x0d15('0x4')]===_0x0d15('0x6')?_0x0d15('0x7'):_0x1c5003[_0x0d15('0x4')];this[_0x0d15('0x8')]=_0x1c5003[_0x0d15('0x8')]||![];this[_0x0d15('0x9')]=_0x1c5003[_0x0d15('0x9')];this[_0x0d15('0xa')]=_0x1c5003[_0x0d15('0xa')];this['countnoanswerretry']=_0x1c5003['countnoanswerretry'];this[_0x0d15('0xb')]=_0x1c5003[_0x0d15('0x9')]+_0x1c5003[_0x0d15('0xa')]+_0x1c5003[_0x0d15('0xc')]+_0x1c5003[_0x0d15('0xd')]+_0x1c5003[_0x0d15('0xe')]+_0x1c5003[_0x0d15('0xf')]+_0x1c5003['countmachineretry']+_0x1c5003[_0x0d15('0x10')];this[_0x0d15('0xd')]=_0x1c5003['countnosuchnumberretry'];this[_0x0d15('0xe')]=_0x1c5003[_0x0d15('0xe')];this[_0x0d15('0xf')]=_0x1c5003[_0x0d15('0xf')];this['countmachineretry']=_0x1c5003[_0x0d15('0x11')];this['countagentrejectretry']=_0x1c5003[_0x0d15('0x10')];this[_0x0d15('0x12')]=_0x311810['uniqueid'];this[_0x0d15('0x13')]=_0x1c5003['name'];this[_0x0d15('0x14')]=_0x1c5003[_0x0d15('0x15')];this[_0x0d15('0x16')]=_0x1c5003[_0x0d15('0x16')];this[_0x0d15('0x17')]=_0x1c5003[_0x0d15('0x17')];this[_0x0d15('0x18')]=moment()[_0x0d15('0x19')](_0x0d15('0x1a'));this['ringtime']=utils['getSeconds'](_0x1c5003[_0x0d15('0x17')],_0x1c5003[_0x0d15('0x16')]);this[_0x0d15('0x1b')]=0x0;this[_0x0d15('0x1c')]=utils[_0x0d15('0x1d')](this[_0x0d15('0x18')],_0x1c5003['responsetime']);this['queue']=_0x1c5003[_0x0d15('0x7')];this[_0x0d15('0x1e')]=_0x0d15('0x1f');this[_0x0d15('0x20')]=_0x311810[_0x0d15('0x21')];this[_0x0d15('0x22')]=_0x1c5003[_0x0d15('0x22')];this['callbackuniqueid']=_0x1c5003[_0x0d15('0x23')];this['callbackat']=_0x1c5003[_0x0d15('0x24')];this[_0x0d15('0x25')]=_0x1c5003[_0x0d15('0x25')];this[_0x0d15('0x26')]=_0x1c5003['ContactId'];this[_0x0d15('0x27')]=_0x1c5003[_0x0d15('0x27')];this['UserId']=_0x1c5003[_0x0d15('0x28')];this[_0x0d15('0x29')]=_0x1c5003[_0x0d15('0x29')];this[_0x0d15('0x2a')]=_0x1c5003['CampaignId'];}module[_0x0d15('0x2b')]=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 54faeca..cfbfa8c 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 _0x46e2=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x46e2,0x114));var _0x246e=function(_0x549867,_0x33d66f){_0x549867=_0x549867-0x0;var _0x599d40=_0x46e2[_0x549867];return _0x599d40;};'use strict';var utils=require(_0x246e('0x0'));function History(_0x31e099){this[_0x246e('0x1')]=_0x31e099['uniqueid'];this[_0x246e('0x2')]=_0x31e099['scheduledat']||undefined;this[_0x246e('0x3')]=_0x31e099[_0x246e('0x3')];this[_0x246e('0x4')]=_0x31e099['type']===_0x246e('0x5')?_0x246e('0x6'):_0x31e099['type'];this['countbusyretry']=_0x31e099[_0x246e('0x7')];this[_0x246e('0x8')]=_0x31e099[_0x246e('0x8')];this[_0x246e('0x9')]=_0x31e099[_0x246e('0x9')];this[_0x246e('0xa')]=_0x31e099[_0x246e('0x7')]+_0x31e099[_0x246e('0x8')]+_0x31e099[_0x246e('0x9')]+_0x31e099[_0x246e('0xb')]+_0x31e099[_0x246e('0xc')]+_0x31e099[_0x246e('0xd')]+_0x31e099[_0x246e('0xe')]+_0x31e099[_0x246e('0xf')];this[_0x246e('0xb')]=_0x31e099[_0x246e('0xb')];this[_0x246e('0xc')]=_0x31e099[_0x246e('0xc')];this[_0x246e('0xd')]=_0x31e099['countabandonedretry'];this['countmachineretry']=_0x31e099[_0x246e('0xe')];this[_0x246e('0xf')]=_0x31e099[_0x246e('0xf')];this[_0x246e('0x6')]=_0x31e099[_0x246e('0x6')];this[_0x246e('0x10')]=_0x31e099[_0x246e('0x11')];this[_0x246e('0x12')]=_0x31e099['number'];this[_0x246e('0x13')]=_0x31e099['starttime'];this[_0x246e('0x14')]=_0x31e099['responsetime'];this['endtime']=_0x31e099[_0x246e('0x14')];this[_0x246e('0x15')]=utils['getSeconds'](_0x31e099['responsetime'],_0x31e099['starttime']);this[_0x246e('0x16')]=0x0;this['talktime']=0x0;this[_0x246e('0x17')]=_0x31e099[_0x246e('0x17')];this[_0x246e('0x18')]=_0x31e099[_0x246e('0x18')];this[_0x246e('0x19')]=_0x31e099[_0x246e('0x19')];this['recallme']=_0x31e099[_0x246e('0x1a')];this[_0x246e('0x1b')]=_0x31e099[_0x246e('0x1b')];this[_0x246e('0x1c')]=_0x31e099[_0x246e('0x1c')];this[_0x246e('0x1d')]=_0x31e099[_0x246e('0x1d')];this[_0x246e('0x1e')]=_0x31e099['VoiceQueueId'];this[_0x246e('0x1f')]=_0x31e099['CampaignId'];this['originatecalleridnum']=_0x31e099['originatecalleridnum']||'';this[_0x246e('0x20')]=_0x31e099['originatecalleridname']||'';this['state']=_0x31e099[_0x246e('0x21')];this['statedesc']=_0x31e099[_0x246e('0x22')];}module[_0x246e('0x23')]=History; \ No newline at end of file +var _0xa30d=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xa30d,0x115));var _0xda30=function(_0x35c897,_0x4d719e){_0x35c897=_0x35c897-0x0;var _0x1e6ac0=_0xa30d[_0x35c897];return _0x1e6ac0;};'use strict';var utils=require('../utils');function History(_0x46d7a9){this[_0xda30('0x0')]=_0x46d7a9[_0xda30('0x0')];this[_0xda30('0x1')]=_0x46d7a9[_0xda30('0x1')]||undefined;this['type']=_0x46d7a9[_0xda30('0x2')];this[_0xda30('0x3')]=_0x46d7a9[_0xda30('0x2')]===_0xda30('0x4')?'queue':_0x46d7a9['type'];this[_0xda30('0x5')]=_0x46d7a9[_0xda30('0x5')];this['countcongestionretry']=_0x46d7a9[_0xda30('0x6')];this['countnoanswerretry']=_0x46d7a9[_0xda30('0x7')];this[_0xda30('0x8')]=_0x46d7a9[_0xda30('0x5')]+_0x46d7a9['countcongestionretry']+_0x46d7a9['countnoanswerretry']+_0x46d7a9[_0xda30('0x9')]+_0x46d7a9['countdropretry']+_0x46d7a9[_0xda30('0xa')]+_0x46d7a9[_0xda30('0xb')]+_0x46d7a9[_0xda30('0xc')];this['countnosuchnumberretry']=_0x46d7a9[_0xda30('0x9')];this[_0xda30('0xd')]=_0x46d7a9[_0xda30('0xd')];this['countabandonedretry']=_0x46d7a9[_0xda30('0xa')];this[_0xda30('0xb')]=_0x46d7a9['countmachineretry'];this[_0xda30('0xc')]=_0x46d7a9['countagentrejectretry'];this['queue']=_0x46d7a9[_0xda30('0xe')];this['calleridname']=_0x46d7a9[_0xda30('0xf')];this[_0xda30('0x10')]=_0x46d7a9['number'];this[_0xda30('0x11')]=_0x46d7a9[_0xda30('0x11')];this['responsetime']=_0x46d7a9[_0xda30('0x12')];this[_0xda30('0x13')]=_0x46d7a9[_0xda30('0x12')];this[_0xda30('0x14')]=utils[_0xda30('0x15')](_0x46d7a9[_0xda30('0x12')],_0x46d7a9[_0xda30('0x11')]);this[_0xda30('0x16')]=0x0;this[_0xda30('0x17')]=0x0;this[_0xda30('0x18')]=_0x46d7a9['callback'];this[_0xda30('0x19')]=_0x46d7a9['callbackuniqueid'];this[_0xda30('0x1a')]=_0x46d7a9[_0xda30('0x1a')];this['recallme']=_0x46d7a9[_0xda30('0x1b')];this[_0xda30('0x1c')]=_0x46d7a9[_0xda30('0x1c')];this[_0xda30('0x1d')]=_0x46d7a9[_0xda30('0x1d')];this[_0xda30('0x1e')]=_0x46d7a9['UserId'];this[_0xda30('0x1f')]=_0x46d7a9['VoiceQueueId'];this[_0xda30('0x20')]=_0x46d7a9[_0xda30('0x20')];this[_0xda30('0x21')]=_0x46d7a9[_0xda30('0x21')]||'';this[_0xda30('0x22')]=_0x46d7a9[_0xda30('0x22')]||'';this[_0xda30('0x23')]=_0x46d7a9[_0xda30('0x23')];this[_0xda30('0x24')]=_0x46d7a9[_0xda30('0x24')];}module[_0xda30('0x25')]=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 a041a79..3c9d028 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 _0xeabd=['membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xeabd,0xb4));var _0xdeab=function(_0xd9fc62,_0x338164){_0xd9fc62=_0xd9fc62-0x0;var _0x5cb280=_0xeabd[_0xd9fc62];return _0x5cb280;};'use strict';var utils=require(_0xdeab('0x0'));function QueueCallerAbandon(_0x5d5609,_0x2dbf1e){this[_0xdeab('0x1')]=_0x5d5609[_0xdeab('0x1')];this[_0xdeab('0x2')]=_0x5d5609[_0xdeab('0x2')];this[_0xdeab('0x3')]=_0x5d5609['type']===_0xdeab('0x4')?_0xdeab('0x5'):_0x5d5609[_0xdeab('0x2')];this[_0xdeab('0x6')]=_0x5d5609[_0xdeab('0x6')];this[_0xdeab('0x7')]=_0x5d5609[_0xdeab('0x7')];this[_0xdeab('0x8')]=_0x5d5609[_0xdeab('0x8')];this[_0xdeab('0x9')]=_0x5d5609[_0xdeab('0x6')]+_0x5d5609[_0xdeab('0x7')]+_0x5d5609[_0xdeab('0x8')]+_0x5d5609[_0xdeab('0xa')]+_0x5d5609['countdropretry']+_0x5d5609[_0xdeab('0xb')]+_0x5d5609[_0xdeab('0xc')]+_0x5d5609[_0xdeab('0xd')];this[_0xdeab('0xa')]=_0x5d5609[_0xdeab('0xa')];this['countdropretry']=_0x5d5609[_0xdeab('0xe')];this[_0xdeab('0xb')]=_0x5d5609[_0xdeab('0xb')];this[_0xdeab('0xc')]=_0x5d5609['countmachineretry'];this[_0xdeab('0xd')]=_0x5d5609[_0xdeab('0xd')];this[_0xdeab('0xf')]=_0x2dbf1e['uniqueid'];this['calleridname']=_0x5d5609[_0xdeab('0x10')];this['calleridnum']=_0x5d5609[_0xdeab('0x11')];this[_0xdeab('0x12')]=_0x5d5609['starttime'];this[_0xdeab('0x13')]=_0x5d5609[_0xdeab('0x13')];this[_0xdeab('0x14')]=_0x5d5609['droptime'];this[_0xdeab('0x15')]=_0x5d5609[_0xdeab('0x15')];this['endtime']=this[_0xdeab('0x14')];this[_0xdeab('0x16')]=utils[_0xdeab('0x17')](_0x5d5609[_0xdeab('0x13')],_0x5d5609[_0xdeab('0x12')]);this[_0xdeab('0x18')]=utils[_0xdeab('0x17')](this[_0xdeab('0x14')],_0x5d5609[_0xdeab('0x13')]);this['talktime']=0x0;this[_0xdeab('0x5')]=_0x2dbf1e['queue'];this[_0xdeab('0x19')]=_0x2dbf1e[_0xdeab('0x1a')];this['reason']=_0x2dbf1e['reason'];this[_0xdeab('0x1b')]=_0x5d5609[_0xdeab('0x1b')];this[_0xdeab('0x1c')]=_0x5d5609[_0xdeab('0x1c')];this[_0xdeab('0x1d')]=_0x5d5609[_0xdeab('0x1d')];this[_0xdeab('0x1e')]=_0x5d5609[_0xdeab('0x1e')];this[_0xdeab('0x1f')]=_0x5d5609[_0xdeab('0x1f')];this[_0xdeab('0x20')]=_0x5d5609[_0xdeab('0x20')];this[_0xdeab('0x21')]=_0x5d5609['UserId'];this['VoiceQueueId']=_0x5d5609[_0xdeab('0x22')];this[_0xdeab('0x23')]=_0x5d5609['CampaignId'];this[_0xdeab('0x24')]=_0x5d5609[_0xdeab('0x24')]||'';this[_0xdeab('0x25')]=_0x5d5609[_0xdeab('0x25')]||'';this[_0xdeab('0x26')]=_0x5d5609[_0xdeab('0x26')];this[_0xdeab('0x27')]=_0x5d5609[_0xdeab('0x27')];this['statedesc']=_0x5d5609['statedesc'];}module[_0xdeab('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xc13a=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xc13a,0xb8));var _0xac13=function(_0x1cdbc5,_0x219ca6){_0x1cdbc5=_0x1cdbc5-0x0;var _0x213288=_0xc13a[_0x1cdbc5];return _0x213288;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x407206,_0xd9d6da){this[_0xac13('0x0')]=_0x407206['scheduledat'];this[_0xac13('0x1')]=_0x407206['type'];this['campaigntype']=_0x407206[_0xac13('0x1')]==='outbound'?_0xac13('0x2'):_0x407206[_0xac13('0x1')];this[_0xac13('0x3')]=_0x407206[_0xac13('0x3')];this['countcongestionretry']=_0x407206[_0xac13('0x4')];this['countnoanswerretry']=_0x407206[_0xac13('0x5')];this[_0xac13('0x6')]=_0x407206[_0xac13('0x3')]+_0x407206[_0xac13('0x4')]+_0x407206[_0xac13('0x5')]+_0x407206[_0xac13('0x7')]+_0x407206[_0xac13('0x8')]+_0x407206[_0xac13('0x9')]+_0x407206[_0xac13('0xa')]+_0x407206[_0xac13('0xb')];this['countnosuchnumberretry']=_0x407206['countnosuchnumberretry'];this[_0xac13('0x8')]=_0x407206[_0xac13('0x8')];this[_0xac13('0x9')]=_0x407206['countabandonedretry'];this[_0xac13('0xa')]=_0x407206[_0xac13('0xa')];this[_0xac13('0xb')]=_0x407206['countagentrejectretry'];this[_0xac13('0xc')]=_0xd9d6da[_0xac13('0xc')];this[_0xac13('0xd')]=_0x407206[_0xac13('0xe')];this[_0xac13('0xf')]=_0x407206[_0xac13('0x10')];this['starttime']=_0x407206[_0xac13('0x11')];this[_0xac13('0x12')]=_0x407206[_0xac13('0x12')];this['droptime']=_0x407206[_0xac13('0x13')];this[_0xac13('0x14')]=_0x407206[_0xac13('0x14')];this['endtime']=this['droptime'];this[_0xac13('0x15')]=utils[_0xac13('0x16')](_0x407206['responsetime'],_0x407206[_0xac13('0x11')]);this[_0xac13('0x17')]=utils['getSeconds'](this[_0xac13('0x13')],_0x407206[_0xac13('0x12')]);this['talktime']=0x0;this[_0xac13('0x2')]=_0xd9d6da[_0xac13('0x2')];this[_0xac13('0x18')]=_0xd9d6da[_0xac13('0x19')];this['reason']=_0xd9d6da['reason'];this[_0xac13('0x1a')]=_0x407206[_0xac13('0x1a')];this[_0xac13('0x1b')]=_0x407206['callbackuniqueid'];this[_0xac13('0x1c')]=_0x407206['callbackat'];this['recallme']=_0x407206[_0xac13('0x1d')];this['ContactId']=_0x407206['ContactId'];this['ListId']=_0x407206[_0xac13('0x1e')];this['UserId']=_0x407206[_0xac13('0x1f')];this['VoiceQueueId']=_0x407206[_0xac13('0x20')];this['CampaignId']=_0x407206[_0xac13('0x21')];this[_0xac13('0x22')]=_0x407206[_0xac13('0x22')]||'';this['originatecalleridname']=_0x407206[_0xac13('0x23')]||'';this['agiafterat']=_0x407206[_0xac13('0x24')];this[_0xac13('0x25')]=_0x407206[_0xac13('0x25')];this[_0xac13('0x26')]=_0x407206[_0xac13('0x26')];}module['exports']=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 cbd2c17..d6aa691 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 _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x112ea8,_0xf6b2e8){var _0x46ab52=function(_0x1c292f){while(--_0x1c292f){_0x112ea8['push'](_0x112ea8['shift']());}};_0x46ab52(++_0xf6b2e8);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xb10b[_0x34f545];return _0x1ff6b8;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x5b4987,_0x143366){var _0x27a93e=function(_0x193c89){while(--_0x193c89){_0x5b4987['push'](_0x5b4987['shift']());}};_0x27a93e(++_0x143366);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a544a,_0x73a217){_0x3a544a=_0x3a544a-0x0;var _0x342f1e=_0xb10b[_0x3a544a];return _0x342f1e;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=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 310cd8d..78fb425 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 _0xf00c=['DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','NOT_ACTIVE','AGENTS_NOT_LOGGED','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','outbound','isOutboundQueue','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','INACTIVE'];(function(_0x4e70fb,_0x27cbd2){var _0x423a4c=function(_0x106d85){while(--_0x106d85){_0x4e70fb['push'](_0x4e70fb['shift']());}};_0x423a4c(++_0x27cbd2);}(_0xf00c,0xba));var _0xcf00=function(_0x56c370,_0x163d40){_0x56c370=_0x56c370-0x0;var _0x2fb924=_0xf00c[_0x56c370];return _0x2fb924;};'use strict';var _=require(_0xcf00('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xcf00('0x1'))(_0xcf00('0x2'));var timezones=require(_0xcf00('0x3'))[_0xcf00('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xcf00('0x5'),'BLACKLIST':_0xcf00('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xcf00('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xcf00('0x8'),'NO_AGENTS_LOGGED':_0xcf00('0x9'),'NO_AVAILABLE_CONTACTS':_0xcf00('0xa'),'NULL_INTERVAL':_0xcf00('0xb'),'OVERTIME_INTERVAL':_0xcf00('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xcf00('0xd'),'QUEUE_RECALL':_0xcf00('0xe'),'RECALL_TIMEOUT':_0xcf00('0xf'),'RUNNING':_0xcf00('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xcf00('0x11')};exports[_0xcf00('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x299b6d){return _0x299b6d[_0xcf00('0x13')]==='preview';}exports[_0xcf00('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x49b7ad){return _0x49b7ad[_0xcf00('0x15')]===_0xcf00('0x16');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0xc08b36){return _0xc08b36[_0xcf00('0x15')]===_0xcf00('0x17');}exports[_0xcf00('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x66a668){return _0x66a668['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x57741c){return _0x57741c[_0xcf00('0x19')];}exports[_0xcf00('0x1a')]=isIVRCampaignActive;function getSeconds(_0x367e67,_0x24de10){var _0x2bc989=moment(_0x367e67)[_0xcf00('0x1b')](0x0);var _0x3a448a=moment(_0x24de10)[_0xcf00('0x1b')](0x0);return _0x2bc989[_0xcf00('0x1c')](_0x3a448a,_0xcf00('0x1d'));}exports[_0xcf00('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x363116,_0x40589c){var _0x5009b0=![];var _0x195dbb=_0x363116[_0xcf00('0x13')]!==_0x40589c[_0xcf00('0x13')]||_0x363116[_0xcf00('0x1f')]!==_0x40589c['dialActive']||_0x363116[_0xcf00('0x20')]!==_0x40589c[_0xcf00('0x20')];var _0x26ad92=_0x363116[_0xcf00('0x21')]!==_0x40589c[_0xcf00('0x21')]||_0x363116['loggedIn']!==_0x40589c[_0xcf00('0x22')]||_0x363116[_0xcf00('0x23')]!==_0x40589c[_0xcf00('0x23')]||_0x363116[_0xcf00('0x24')]!==_0x40589c[_0xcf00('0x24')]||_0x363116[_0xcf00('0x25')]!==_0x40589c[_0xcf00('0x25')]||_0x363116[_0xcf00('0x26')]!==_0x40589c['pTalking']||_0x363116[_0xcf00('0x27')]!==_0x40589c[_0xcf00('0x27')]||_0x363116[_0xcf00('0x28')]!==_0x40589c['inUse']||_0x363116[_0xcf00('0x29')]!==_0x40589c[_0xcf00('0x29')];if(_0x363116[_0xcf00('0x2a')]&&_0x40589c[_0xcf00('0x2a')]){_0x5009b0=_0x363116['Trunk']['name']!==_0x40589c['Trunk'][_0xcf00('0x2b')]||_0x363116[_0xcf00('0x2a')][_0xcf00('0x19')]!==_0x40589c[_0xcf00('0x2a')][_0xcf00('0x19')];}return _0x195dbb||_0x26ad92||_0x5009b0;}exports[_0xcf00('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x34af67){var _0x2f9f75=null;var _0x4ca82d=_0x34af67[_0xcf00('0x2d')];if(_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x2f')])||_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x30')])||_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x30')][_0xcf00('0x31')])){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x32')];}else if(_[_0xcf00('0x33')](_0x34af67[_0xcf00('0x2f')])||_['isEmpty'](_0x34af67[_0xcf00('0x30')]['Intervals'])){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x34')];}else if(_0x4ca82d&&!timezones[_0x4ca82d]){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x35')];}return _0x2f9f75;}function checkAnyValidTrunk(_0x43bda2,_0x2de9c7){var _0x47764d=null;var _0x1d44b4=_0xcf00('0x36');var _0x13a96e=[_0xcf00('0x37'),_0xcf00('0x38')];var _0x201dfa=!![];if(_0x43bda2[_0xcf00('0x2a')]&&_0x43bda2[_0xcf00('0x2a')][_0xcf00('0x19')]){_0x1d44b4+=_0x43bda2[_0xcf00('0x2a')][_0xcf00('0x2b')];_0x47764d=_0x2de9c7[_0x1d44b4];_0x201dfa=_0x13a96e[_0xcf00('0x39')](_0x47764d[_0xcf00('0x3a')]);}else if(_0x43bda2['TrunkBackup']&&_0x43bda2['TrunkBackup'][_0xcf00('0x19')]){_0x1d44b4+=_0x43bda2['TrunkBackup'][_0xcf00('0x2b')];_0x47764d=_0x2de9c7[_0x1d44b4];_0x201dfa=_0x13a96e[_0xcf00('0x39')](_0x47764d[_0xcf00('0x3a')]);}return _0x201dfa;}function getQueueCampaignStatusMessage(_0x578e56,_0x1694ce){var _0x598dc6=CAMPAIGN_STATUS['ACTIVE'];var _0x3250bc=isPreviewCampaign(_0x578e56);if(!isQueueCampaignActive(_0x578e56)){if(_0x3250bc){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3b')];}else{if(_0x578e56[_0xcf00('0x29')]===0x0&&_0x578e56['talking']===0x0&&_0x578e56[_0xcf00('0x27')]===0x0&&(_0x578e56[_0xcf00('0x26')]||0x0)===0x0){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3b')];}else{_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3c')];}}}else if(_0x578e56[_0xcf00('0x22')]===0x0){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3d')];}else if(!checkAnyValidTrunk(_0x578e56,_0x1694ce)){_0x598dc6=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x578e56)){var _0x1d91a6=checkAnyValidQueueCampaignInterval(_0x578e56);if(_0x1d91a6){_0x598dc6=_0x1d91a6;}}return _0x598dc6;}exports[_0xcf00('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2062a0){var _0x29dcfc=CAMPAIGN_STATUS[_0xcf00('0x3c')];if(_0x2062a0['originated']===0x0&&_0x2062a0[_0xcf00('0x25')]===0x0&&_0x2062a0['waiting']===0x0&&(_0x2062a0[_0xcf00('0x26')]||0x0)===0x0){_0x29dcfc=CAMPAIGN_STATUS[_0xcf00('0x3b')];}return _0x29dcfc;}exports[_0xcf00('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4ae2ef){var _0x487923=_0x4ae2ef[_0xcf00('0x40')](/"(.*?)"/);return _0x487923?_0x487923[0x1]:_0x4ae2ef;}exports[_0xcf00('0x41')]=extractCalleridName;function getCallerId(_0x63c64e,_0x26f308,_0x5349ec){if(!_[_0xcf00('0x42')](_0x5349ec)&&typeof _0x5349ec===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x5349ec)){if(!_[_0xcf00('0x42')](_0x26f308)&&typeof _0x26f308===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x26f308)){return util['format']('\x22%s\x22\x20<%s>',_0x26f308,_0x5349ec);}return util[_0xcf00('0x44')](_0xcf00('0x45'),_0x5349ec,_0x5349ec);}if(!_[_0xcf00('0x42')](_0x63c64e)&&typeof _0x63c64e===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x63c64e)){return _0x63c64e;}return'\x22\x22\x20<>';}exports[_0xcf00('0x46')]=getCallerId;function getCallerIdRandom(_0x5672f1,_0x4a5b51){var _0x107241;var _0x15aff2;var _0xf97ab7;if(_0x4a5b51<=0x0){_0x4a5b51=0x1;}_0x107241=new RegExp(_0xcf00('0x47')+_0x4a5b51+'}$');_0x15aff2=Math[_0xcf00('0x48')](0xa,_0x4a5b51-0x1);_0xf97ab7=Math['pow'](0xa,_0x4a5b51)-0x1;return util[_0xcf00('0x44')]('%s',_[_0xcf00('0x49')](_0x5672f1,_0x107241,_[_0xcf00('0x4a')](_0x15aff2,_0xf97ab7)[_0xcf00('0x4b')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x120b50){if(_0x120b50[_0xcf00('0x29')]&&_0x120b50[_0xcf00('0x29')]>0x0){_0x120b50['originated']-=0x1;}else{logger[_0xcf00('0x4c')](_0xcf00('0x4d'));}}exports[_0xcf00('0x4e')]=decrementOriginate;function checkContactEmpty(_0x4f40e7){return _0x4f40e7&&_0x4f40e7[_0xcf00('0x4f')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x247140,_0x48d785){if(_0x48d785===0x0){return 0x0;}var _0x372588=0x1;for(var _0x1044bc=0x1;_0x1044bc<=_0x48d785;_0x1044bc+=0x1){_0x372588=0x1+_0x372588*_0x1044bc/_0x247140;}return 0x1/_0x372588;}exports[_0xcf00('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x1508b3,_0x2bb258,_0x652b92){if(_0x2bb258>_0x652b92){for(var _0x44ca=0x0;_0x44ca<_0x2bb258-_0x652b92;_0x44ca+=0x1){decrementOriginate(_0x1508b3);}}}exports[_0xcf00('0x51')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x5d4e=['IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialMethod','dialActive','available','loggedIn','loggedInDb','talking','pTalking','waiting','originated','name','Trunk','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','error','decrementOriginate','length','checkContactEmpty','erlangb','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS'];(function(_0x4cd2a8,_0x120543){var _0x4894c4=function(_0x3bed37){while(--_0x3bed37){_0x4cd2a8['push'](_0x4cd2a8['shift']());}};_0x4894c4(++_0x120543);}(_0x5d4e,0xe8));var _0xe5d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d4e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var moment=require(_0xe5d4('0x0'));var util=require(_0xe5d4('0x1'));var logger=require(_0xe5d4('0x2'))(_0xe5d4('0x3'));var timezones=require(_0xe5d4('0x4'))[_0xe5d4('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xe5d4('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xe5d4('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xe5d4('0x8'),'EMPTY_INTERVAL':_0xe5d4('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xe5d4('0xa'),'NO_AVAILABLE_CONTACTS':_0xe5d4('0xb'),'NULL_INTERVAL':_0xe5d4('0xc'),'OVERTIME_INTERVAL':_0xe5d4('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xe5d4('0xe'),'QUEUE_RECALL':_0xe5d4('0xf'),'RECALL_TIMEOUT':_0xe5d4('0x10'),'RUNNING':_0xe5d4('0x11'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xe5d4('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x167733){return _0x167733['dialMethod']===_0xe5d4('0x13');}exports[_0xe5d4('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x2c9803){return _0x2c9803[_0xe5d4('0x15')]===_0xe5d4('0x16');}exports[_0xe5d4('0x17')]=isIVRCampaign;function isOutboundQueue(_0x1701af){return _0x1701af[_0xe5d4('0x15')]===_0xe5d4('0x18');}exports[_0xe5d4('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x235905){return _0x235905['dialActive'];}exports[_0xe5d4('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x460123){return _0x460123[_0xe5d4('0x1b')];}exports[_0xe5d4('0x1c')]=isIVRCampaignActive;function getSeconds(_0x11bd1b,_0x2f52d2){var _0x1b2968=moment(_0x11bd1b)['milliseconds'](0x0);var _0x2d5ebf=moment(_0x2f52d2)[_0xe5d4('0x1d')](0x0);return _0x1b2968['diff'](_0x2d5ebf,_0xe5d4('0x1e'));}exports[_0xe5d4('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x11b73d,_0x1d2ac3){var _0x225695=![];var _0x9e4211=_0x11b73d[_0xe5d4('0x20')]!==_0x1d2ac3[_0xe5d4('0x20')]||_0x11b73d[_0xe5d4('0x21')]!==_0x1d2ac3[_0xe5d4('0x21')]||_0x11b73d['message']!==_0x1d2ac3['message'];var _0x5853d9=_0x11b73d['available']!==_0x1d2ac3[_0xe5d4('0x22')]||_0x11b73d['loggedIn']!==_0x1d2ac3[_0xe5d4('0x23')]||_0x11b73d['loggedInDb']!==_0x1d2ac3[_0xe5d4('0x24')]||_0x11b73d['paused']!==_0x1d2ac3['paused']||_0x11b73d[_0xe5d4('0x25')]!==_0x1d2ac3[_0xe5d4('0x25')]||_0x11b73d[_0xe5d4('0x26')]!==_0x1d2ac3[_0xe5d4('0x26')]||_0x11b73d[_0xe5d4('0x27')]!==_0x1d2ac3[_0xe5d4('0x27')]||_0x11b73d['inUse']!==_0x1d2ac3['inUse']||_0x11b73d[_0xe5d4('0x28')]!==_0x1d2ac3[_0xe5d4('0x28')];if(_0x11b73d['Trunk']&&_0x1d2ac3['Trunk']){_0x225695=_0x11b73d['Trunk'][_0xe5d4('0x29')]!==_0x1d2ac3[_0xe5d4('0x2a')][_0xe5d4('0x29')]||_0x11b73d[_0xe5d4('0x2a')][_0xe5d4('0x1b')]!==_0x1d2ac3[_0xe5d4('0x2a')][_0xe5d4('0x1b')];}return _0x9e4211||_0x5853d9||_0x225695;}exports[_0xe5d4('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x311b52){var _0x5bf577=null;var _0x55b53f=_0x311b52[_0xe5d4('0x2c')];if(_['isNil'](_0x311b52[_0xe5d4('0x2d')])||_[_0xe5d4('0x2e')](_0x311b52[_0xe5d4('0x2f')])||_[_0xe5d4('0x2e')](_0x311b52[_0xe5d4('0x2f')][_0xe5d4('0x30')])){_0x5bf577=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xe5d4('0x31')](_0x311b52[_0xe5d4('0x2d')])||_['isEmpty'](_0x311b52['Interval']['Intervals'])){_0x5bf577=CAMPAIGN_STATUS[_0xe5d4('0x32')];}else if(_0x55b53f&&!timezones[_0x55b53f]){_0x5bf577=CAMPAIGN_STATUS[_0xe5d4('0x33')];}return _0x5bf577;}function checkAnyValidTrunk(_0x34e465,_0x146736){var _0x53fa17=null;var _0x4d3455='SIP/';var _0x1940c8=[_0xe5d4('0x34'),_0xe5d4('0x35')];var _0x1b9493=!![];if(_0x34e465[_0xe5d4('0x2a')]&&_0x34e465[_0xe5d4('0x2a')][_0xe5d4('0x1b')]){_0x4d3455+=_0x34e465[_0xe5d4('0x2a')][_0xe5d4('0x29')];_0x53fa17=_0x146736[_0x4d3455];_0x1b9493=_0x1940c8['includes'](_0x53fa17[_0xe5d4('0x36')]);}else if(_0x34e465['TrunkBackup']&&_0x34e465[_0xe5d4('0x37')][_0xe5d4('0x1b')]){_0x4d3455+=_0x34e465[_0xe5d4('0x37')][_0xe5d4('0x29')];_0x53fa17=_0x146736[_0x4d3455];_0x1b9493=_0x1940c8[_0xe5d4('0x38')](_0x53fa17[_0xe5d4('0x36')]);}return _0x1b9493;}function getQueueCampaignStatusMessage(_0x50f972,_0x2e32b8){var _0xd9d09a=CAMPAIGN_STATUS[_0xe5d4('0x6')];var _0x37cc3e=isPreviewCampaign(_0x50f972);if(!isQueueCampaignActive(_0x50f972)){if(_0x37cc3e){_0xd9d09a=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x50f972[_0xe5d4('0x28')]===0x0&&_0x50f972[_0xe5d4('0x25')]===0x0&&_0x50f972[_0xe5d4('0x27')]===0x0&&(_0x50f972[_0xe5d4('0x26')]||0x0)===0x0){_0xd9d09a=CAMPAIGN_STATUS[_0xe5d4('0x39')];}else{_0xd9d09a=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x50f972['loggedIn']===0x0){_0xd9d09a=CAMPAIGN_STATUS[_0xe5d4('0x3a')];}else if(!checkAnyValidTrunk(_0x50f972,_0x2e32b8)){_0xd9d09a=CAMPAIGN_STATUS[_0xe5d4('0x3b')];}else if(!isPreviewCampaign(_0x50f972)){var _0x3f11c1=checkAnyValidQueueCampaignInterval(_0x50f972);if(_0x3f11c1){_0xd9d09a=_0x3f11c1;}}return _0xd9d09a;}exports[_0xe5d4('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x16c65e){var _0x812937=CAMPAIGN_STATUS[_0xe5d4('0x3d')];if(_0x16c65e[_0xe5d4('0x28')]===0x0&&_0x16c65e[_0xe5d4('0x25')]===0x0&&_0x16c65e['waiting']===0x0&&(_0x16c65e[_0xe5d4('0x26')]||0x0)===0x0){_0x812937=CAMPAIGN_STATUS['INACTIVE'];}return _0x812937;}exports[_0xe5d4('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x53c89e){var _0x28a4c0=_0x53c89e[_0xe5d4('0x3f')](/"(.*?)"/);return _0x28a4c0?_0x28a4c0[0x1]:_0x53c89e;}exports[_0xe5d4('0x40')]=extractCalleridName;function getCallerId(_0x24ba32,_0x167bdb,_0x196e72){if(!_[_0xe5d4('0x41')](_0x196e72)&&typeof _0x196e72===_0xe5d4('0x42')&&!_['isEmpty'](_0x196e72)){if(!_[_0xe5d4('0x41')](_0x167bdb)&&typeof _0x167bdb===_0xe5d4('0x42')&&!_[_0xe5d4('0x31')](_0x167bdb)){return util[_0xe5d4('0x43')](_0xe5d4('0x44'),_0x167bdb,_0x196e72);}return util['format']('\x22%s\x22\x20<%s>',_0x196e72,_0x196e72);}if(!_['isUndefined'](_0x24ba32)&&typeof _0x24ba32===_0xe5d4('0x42')&&!_[_0xe5d4('0x31')](_0x24ba32)){return _0x24ba32;}return _0xe5d4('0x45');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0xfc89de,_0x467e16){var _0x56a29b;var _0x705620;var _0x251f50;if(_0x467e16<=0x0){_0x467e16=0x1;}_0x56a29b=new RegExp(_0xe5d4('0x46')+_0x467e16+'}$');_0x705620=Math[_0xe5d4('0x47')](0xa,_0x467e16-0x1);_0x251f50=Math['pow'](0xa,_0x467e16)-0x1;return util[_0xe5d4('0x43')]('%s',_[_0xe5d4('0x48')](_0xfc89de,_0x56a29b,_[_0xe5d4('0x49')](_0x705620,_0x251f50)[_0xe5d4('0x4a')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x1b4d07){if(_0x1b4d07['originated']&&_0x1b4d07[_0xe5d4('0x28')]>0x0){_0x1b4d07[_0xe5d4('0x28')]-=0x1;}else{logger[_0xe5d4('0x4b')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xe5d4('0x4c')]=decrementOriginate;function checkContactEmpty(_0x6332c8){return _0x6332c8&&_0x6332c8[_0xe5d4('0x4d')]>0x0;}exports[_0xe5d4('0x4e')]=checkContactEmpty;function erlangb(_0x25a8c1,_0x2b9a33){if(_0x2b9a33===0x0){return 0x0;}var _0x7ea3a7=0x1;for(var _0x41cfcf=0x1;_0x41cfcf<=_0x2b9a33;_0x41cfcf+=0x1){_0x7ea3a7=0x1+_0x7ea3a7*_0x41cfcf/_0x25a8c1;}return 0x1/_0x7ea3a7;}exports[_0xe5d4('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0xca572d,_0x2af85a,_0x224038){if(_0x2af85a>_0x224038){for(var _0x349c52=0x0;_0x349c52<_0x2af85a-_0x224038;_0x349c52+=0x1){decrementOriginate(_0xca572d);}}}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 36e155f..939ae86 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(_0x584dbc,_0x4b102c){var _0x554b9a=function(_0x17b669){while(--_0x17b669){_0x584dbc['push'](_0x584dbc['shift']());}};_0x554b9a(++_0x4b102c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x767c36,_0x489986){var _0x35d44e=function(_0x1c92a1){while(--_0x1c92a1){_0x767c36['push'](_0x767c36['shift']());}};_0x35d44e(++_0x489986);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 da5fa26..c431ea0 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 _0x9327=['.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','updateStatus','then','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','message','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','parse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9327,0xb0));var _0x7932=function(_0x46350a,_0xafe3ff){_0x46350a=_0x46350a-0x0;var _0x1b116a=_0x9327[_0x46350a];return _0x1b116a;};'use strict';var util=require(_0x7932('0x0'));var _=require(_0x7932('0x1'));var BPromise=require(_0x7932('0x2'));var uuid=require(_0x7932('0x3'));var moment=require(_0x7932('0x4'));var path=require(_0x7932('0x5'));var tiff2pdf=require(_0x7932('0x6'));var gs=require(_0x7932('0x7'));var logger=require(_0x7932('0x8'))(_0x7932('0x9'));var ami=require(_0x7932('0xa'));var rpcDb=require(_0x7932('0xb'));var Channel=require(_0x7932('0xc'));var ut=require(_0x7932('0xd'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x7932('0xe'));var faxMessage=require(_0x7932('0xf'));function Fax(_0x2df331){this[_0x7932('0x10')]={};this[_0x7932('0x11')]=_0x2df331['faxAccounts'];this[_0x7932('0x12')]=_0x2df331[_0x7932('0x12')];this[_0x7932('0x13')]={};ami['on'](_0x7932('0x14'),this[_0x7932('0x15')][_0x7932('0x16')](this));ami['on'](_0x7932('0x17'),this[_0x7932('0x18')][_0x7932('0x16')](this));ami['on']('newstate',this['syncNewState'][_0x7932('0x16')](this));ami['on'](_0x7932('0x19'),this[_0x7932('0x1a')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0x7932('0x1b'),this[_0x7932('0x1c')]['bind'](this));ami['on'](_0x7932('0x1d'),this['syncHangup'][_0x7932('0x16')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax['prototype'][_0x7932('0x15')]=function(_0x5bb4ab){if(_0x5bb4ab[_0x7932('0x1e')]===_0x7932('0x1f')){for(var _0x18fcaf in this['faxAccounts']){if(this[_0x7932('0x11')][_0x7932('0x20')](_0x18fcaf)){if(_0x5bb4ab['exten']===this['faxAccounts'][_0x18fcaf][_0x7932('0x21')]){this[_0x7932('0x10')][_0x5bb4ab[_0x7932('0x22')]]={};this['channels'][_0x5bb4ab[_0x7932('0x22')]][_0x7932('0x23')]=_0x5bb4ab[_0x7932('0x23')];this['channels'][_0x5bb4ab[_0x7932('0x22')]]['id']=this[_0x7932('0x11')][_0x18fcaf]['id'];this['channels'][_0x5bb4ab['uniqueid']][_0x7932('0x24')]=this['faxAccounts'][_0x18fcaf]['name'];logger['info'](_0x5bb4ab[_0x7932('0x22')],_0x7932('0x25'));}}}}if(this[_0x7932('0x13')][_0x5bb4ab[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x5bb4ab[_0x7932('0x22')]]={};this['channels'][_0x5bb4ab['uniqueid']]['channel']=_0x5bb4ab[_0x7932('0x23')];logger[_0x7932('0x26')](_0x5bb4ab[_0x7932('0x22')],_0x7932('0x25'));}};Fax[_0x7932('0x27')][_0x7932('0x18')]=function(_0x389f30){if(this['channels'][_0x389f30[_0x7932('0x22')]]){for(var _0x511237 in _0x389f30[_0x7932('0x28')]){if(_0x389f30[_0x7932('0x28')][_0x7932('0x20')](_0x511237)){this[_0x7932('0x10')][_0x389f30[_0x7932('0x22')]][_0x511237]=_0x389f30[_0x7932('0x29')];}}}};Fax[_0x7932('0x27')][_0x7932('0x2a')]=function(_0x1fd361){if(this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]][_0x7932('0x2b')]=_0x1fd361['channelstate'];this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]][_0x7932('0x2c')]=_0x1fd361['channelstatedesc'];}};Fax['prototype'][_0x7932('0x1a')]=function(_0x3a009f){if(this[_0x7932('0x10')][_0x3a009f['uniqueid']]){for(var _0x1fff11 in _0x3a009f[_0x7932('0x28')]){if(_0x3a009f['variable'][_0x7932('0x20')](_0x1fff11)){this[_0x7932('0x10')][_0x3a009f[_0x7932('0x22')]][_0x1fff11]=_0x3a009f[_0x7932('0x29')];}}}};Fax['prototype'][_0x7932('0x2d')]=function(_0x5ba982){if(this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x2e')]=_0x5ba982[_0x7932('0x2e')];this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x2f')]=_0x5ba982[_0x7932('0x2f')];this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x21')]=_0x5ba982[_0x7932('0x21')];this[_0x7932('0x10')][_0x5ba982['uniqueid']]['filename']=_0x5ba982[_0x7932('0x30')];logger['info'](_0x5ba982[_0x7932('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x7932('0x27')]['syncReceiveFax']=function(_0x577457){var _0x3ebdb5=this;if(this['channels'][_0x577457[_0x7932('0x22')]]){var _0x1253a5=this['channels'][_0x577457[_0x7932('0x22')]]['id'];this[_0x7932('0x10')][_0x577457['uniqueid']][_0x7932('0x31')]=_0x577457[_0x7932('0x31')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]][_0x7932('0x32')]=_0x577457['pagestransferred'];this[_0x7932('0x10')][_0x577457['uniqueid']]['localstationid']=_0x577457[_0x7932('0x21')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]][_0x7932('0x33')]=_0x577457['resolution'];this['channels'][_0x577457['uniqueid']]['transferrate']=_0x577457[_0x7932('0x34')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]]['filename']=_0x577457['filename'];this[_0x7932('0x10')][_0x577457['uniqueid']][_0x7932('0x35')]=_0x577457['calleridnum'];if(this['channels'][_0x577457['uniqueid']][_0x7932('0x32')]>0x0){tiff2pdf(_0x577457[_0x7932('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x291ddf){logger[_0x7932('0x26')](_0x577457[_0x7932('0x22')],_0x7932('0x36'),_0x291ddf['message']);attachment['create']({'name':path[_0x7932('0x37')](_0x577457[_0x7932('0x30')])[_0x7932('0x24')],'basename':path[_0x7932('0x37')](_0x577457[_0x7932('0x30')])[_0x7932('0x24')]+_0x7932('0x38'),'type':_0x7932('0x39')})['then'](function(_0x9074f){faxAccount[_0x7932('0x3a')](_0x1253a5,{'from':_0x577457[_0x7932('0x35')],'mapKey':'fax','body':path['parse'](_0x577457['filename'])[_0x7932('0x24')]+_0x7932('0x38'),'AttachmentId':_0x9074f['id']})[_0x7932('0x3b')](function(_0x37ca10){logger[_0x7932('0x3c')](_0x577457['uniqueid'],_0x7932('0x3d'),JSON[_0x7932('0x3e')](_0x37ca10));});})[_0x7932('0x3b')](function(_0x5400e9){logger[_0x7932('0x3c')](_0x577457[_0x7932('0x22')],_0x7932('0x3f'),JSON['stringify'](_0x5400e9));});});}logger[_0x7932('0x26')](_0x577457['uniqueid'],_0x7932('0x3f'));}};Fax['prototype'][_0x7932('0x40')]=function(_0x257687){if(this[_0x7932('0x13')][_0x257687['uniqueid']]){_[_0x7932('0x41')](this['channels'][_0x257687[_0x7932('0x22')]],_[_0x7932('0x42')](_0x257687,[_0x7932('0x43'),_0x7932('0x44')]));}};function updateStatus(_0x5b63b4){if(_0x5b63b4[_0x7932('0x45')]){faxMessage[_0x7932('0x46')](_0x5b63b4[_0x7932('0x45')],{'failMessage':_0x7932('0x47')})['then'](function(_0xe094c6){ut['logger']('[Fax][Message][Error][Updated]',_0xe094c6);})[_0x7932('0x3b')](function(_0x488dfa){ut[_0x7932('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x488dfa);});}else{ut[_0x7932('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7932('0x27')][_0x7932('0x49')]=function(_0x5c8fe4,_0x409733,_0x213a93){var _0x2108c5=this;var _0x4488e9={};if(_0x409733){_0x4488e9={'read':_0x409733};}else{_0x4488e9={'failMessage':_0x213a93};}if(this['actions'][_0x5c8fe4]['AttachmentId']){faxMessage['update'](this[_0x7932('0x13')][_0x5c8fe4][_0x7932('0x45')],_0x4488e9)[_0x7932('0x4a')](function(_0x3d509b){ut['logger']('[Fax][Message][Updated]',_0x3d509b);})[_0x7932('0x3b')](function(_0x2b024e){ut[_0x7932('0x48')](_0x7932('0x4b'),_0x2b024e);})[_0x7932('0x4c')](function(){delete _0x2108c5['channels'][_0x5c8fe4];delete _0x2108c5['actions'][_0x5c8fe4];});}else{ut['logger'](_0x7932('0x4d'));delete this[_0x7932('0x10')][_0x5c8fe4];delete this['actions'][_0x5c8fe4];}};Fax[_0x7932('0x27')][_0x7932('0x4e')]=function(_0x3ff4cc){var _0x67414=this;if(this['channels'][_0x3ff4cc[_0x7932('0x22')]]){if(this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]['id']=this[_0x7932('0x13')][_0x3ff4cc['uniqueid']]['id'];this['channels'][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x24')]=this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]['name'];}logger[_0x7932('0x26')](_0x3ff4cc[_0x7932('0x22')],this['actions'][_0x3ff4cc[_0x7932('0x22')]]?'\x20hangup\x20sendFile\x20':_0x7932('0x4f'),JSON[_0x7932('0x3e')](this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]));if(this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]){if(this[_0x7932('0x10')][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x50')]>0x0&&this[_0x7932('0x10')][_0x3ff4cc['uniqueid']][_0x7932('0x51')]===_0x7932('0x52')){this[_0x7932('0x49')](_0x3ff4cc[_0x7932('0x22')],!![]);}else{this[_0x7932('0x49')](_0x3ff4cc['uniqueid'],![],this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]['faxstatusstring']?_0x7932('0x53')+this[_0x7932('0x10')][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x54')]:_0x7932('0x55'));}}}};Fax[_0x7932('0x27')]['send']=function(_0x57cea4){var _0x2ea88a=this;return new BPromise(function(_0x11ba9a,_0x4c216b){_0x2ea88a[_0x7932('0x56')](_0x57cea4,_0x2ea88a['faxAccounts'][_0x57cea4['FaxAccountId']])[_0x7932('0x4a')](function(_0x55ef9c){ut[_0x7932('0x48')](_0x7932('0x57'),_0x55ef9c);_0x11ba9a(ut['message'](_0x7932('0x58')));})[_0x7932('0x3b')](function(_0x6b5c0e){ut[_0x7932('0x48')]('[Fax][execOriginate][failure]',_0x6b5c0e);updateStatus(_0x57cea4);_0x4c216b(ut['message'](_0x7932('0x59')));});});};Fax[_0x7932('0x27')][_0x7932('0x5a')]=function(_0x2e44a3){var _0x2bd6c2=this;return new BPromise(function(_0x378508,_0xc6b514){var _0x52efa5=_0x2bd6c2[_0x7932('0x5b')](_0x2bd6c2['faxAccounts'][_0x2e44a3[_0x7932('0x5c')]][_0x7932('0x5d')],_0x2e44a3);if(_0x52efa5[_0x7932('0x5e')]){_0x378508(ut[_0x7932('0x5f')]('Trunk\x20Reachable'));}else{_0xc6b514(ut[_0x7932('0x5f')](_0x52efa5[_0x7932('0x5f')]));}});};function originate(_0x42ed17,_0x31b049,_0x48815d){return new BPromise(function(_0x4bcf17,_0x1cc9a5){if(_0x48815d){var _0x56b5b7=util[_0x7932('0x60')](_0x7932('0x61'),path[_0x7932('0x37')](_0x42ed17[_0x7932('0x5')])[_0x7932('0x24')],_0x42ed17[_0x7932('0x5')]);gs['execute'](_0x56b5b7)[_0x7932('0x4a')](function(){_0x42ed17[_0x7932('0x5')]=util[_0x7932('0x60')](_0x7932('0x62'),path['parse'](_0x42ed17[_0x7932('0x5')])['dir'],path[_0x7932('0x37')](_0x42ed17[_0x7932('0x5')])[_0x7932('0x24')]);_0x31b049[_0x7932('0x63')]=_0x42ed17[_0x7932('0x5')];ut['logger'](_0x7932('0x64'),'');ami['Action'](ut['variablesAction'](_0x42ed17,_0x31b049))[_0x7932('0x4a')](function(_0x43e235){_0x4bcf17(_0x43e235);})['catch'](function(_0x8a32a2){_0x1cc9a5(_0x8a32a2);});})['catch'](function(_0x1dd881){_0x1cc9a5(_0x1dd881);});}else{ami[_0x7932('0x65')](ut['variablesAction'](_0x42ed17,_0x31b049))['then'](function(_0x43519e){_0x4bcf17(_0x43519e);})['catch'](function(_0x3ba03e){_0x1cc9a5(_0x3ba03e);});}});}Fax[_0x7932('0x27')][_0x7932('0x56')]=function(_0x5a70e8,_0x4432df){var _0x30dac2=this;return new BPromise(function(_0xfc5027,_0x7bbbc2){var _0x3e836d=uuid['v4']();var _0x287f27=ut[_0x7932('0x66')](_0x5a70e8,_0x4432df);_0x30dac2['actions'][_0x3e836d]=new Action(_0x3e836d,_0x4432df,_0x5a70e8);var _0x245832=_0x30dac2[_0x7932('0x13')][_0x3e836d];if(path['parse'](_0x5a70e8[_0x7932('0x5')])[_0x7932('0x67')]===_0x7932('0x38')){originate(_0x245832,_0x287f27,!![])[_0x7932('0x4a')](function(_0x411098){_0xfc5027(_0x411098);})[_0x7932('0x3b')](function(_0x25eab6){_0x7bbbc2(_0x25eab6);});}else{originate(_0x245832,_0x287f27,![])[_0x7932('0x4a')](function(_0x453746){_0xfc5027(_0x453746);})[_0x7932('0x3b')](function(_0x17d474){_0x7bbbc2(_0x17d474);});}});};Fax[_0x7932('0x27')][_0x7932('0x68')]=function(_0x61c668){return!_['isNil'](_0x61c668)&&!_[_0x7932('0x69')](_0x61c668[_0x7932('0x24')])&&!_[_0x7932('0x69')](_0x61c668[_0x7932('0x6a')])&&_0x61c668[_0x7932('0x6a')]&&!_[_0x7932('0x69')](this[_0x7932('0x12')][util['format'](_0x7932('0x6b'),_0x61c668[_0x7932('0x24')])])&&!_[_0x7932('0x69')](this[_0x7932('0x12')][util[_0x7932('0x60')]('SIP/%s',_0x61c668[_0x7932('0x24')])][_0x7932('0x2f')])&&(this['trunks'][util['format'](_0x7932('0x6b'),_0x61c668[_0x7932('0x24')])]['status']===_0x7932('0x6c')||this[_0x7932('0x12')][util['format'](_0x7932('0x6b'),_0x61c668['name'])][_0x7932('0x2f')]==='unmonitored');};Fax['prototype'][_0x7932('0x5b')]=function(_0x1d87a9,_0x18ccc5){if(!this[_0x7932('0x68')](_0x1d87a9)){ut[_0x7932('0x48')](_0x7932('0x6d'),_[_0x7932('0x69')](_0x1d87a9)?'':_0x1d87a9[_0x7932('0x24')]+_0x7932('0x6e'));return{'isValid':![],'message':_0x7932('0x6f')};}if(_[_0x7932('0x69')](_0x18ccc5[_0x7932('0x9')])){ut[_0x7932('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x18ccc5));return{'isValid':![],'message':_0x7932('0x70')};}if(_[_0x7932('0x69')](_0x18ccc5['path'])){ut['logger'](_0x7932('0x71'),JSON['stringify'](_0x18ccc5));return{'isValid':![],'message':_0x7932('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x7932('0x73')]=Fax; \ No newline at end of file +var _0xe17e=['name','info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','fax','catch','error','\x20notify\x20','\x20receiveFax\x20','merge','response','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','update','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel'];(function(_0x242363,_0x18befe){var _0x7c321d=function(_0x3c428d){while(--_0x3c428d){_0x242363['push'](_0x242363['shift']());}};_0x7c321d(++_0x18befe);}(_0xe17e,0xc9));var _0xee17=function(_0x45fc39,_0x5117c6){_0x45fc39=_0x45fc39-0x0;var _0x3fc39d=_0xe17e[_0x45fc39];return _0x3fc39d;};'use strict';var util=require(_0xee17('0x0'));var _=require(_0xee17('0x1'));var BPromise=require(_0xee17('0x2'));var uuid=require('uuid');var moment=require(_0xee17('0x3'));var path=require(_0xee17('0x4'));var tiff2pdf=require(_0xee17('0x5'));var gs=require(_0xee17('0x6'));var logger=require(_0xee17('0x7'))('fax');var ami=require(_0xee17('0x8'));var rpcDb=require(_0xee17('0x9'));var Channel=require(_0xee17('0xa'));var ut=require(_0xee17('0xb'));var Action=require(_0xee17('0xc'));var faxAccount=require(_0xee17('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x1aaefd){this[_0xee17('0xe')]={};this[_0xee17('0xf')]=_0x1aaefd[_0xee17('0xf')];this[_0xee17('0x10')]=_0x1aaefd[_0xee17('0x10')];this[_0xee17('0x11')]={};ami['on']('newchannel',this[_0xee17('0x12')]['bind'](this));ami['on'](_0xee17('0x13'),this[_0xee17('0x14')][_0xee17('0x15')](this));ami['on'](_0xee17('0x16'),this[_0xee17('0x17')]['bind'](this));ami['on']('newexten',this[_0xee17('0x18')][_0xee17('0x15')](this));ami['on']('faxstatus',this[_0xee17('0x19')]['bind'](this));ami['on'](_0xee17('0x1a'),this[_0xee17('0x1b')][_0xee17('0x15')](this));ami['on'](_0xee17('0x1c'),this[_0xee17('0x1d')][_0xee17('0x15')](this));ami['on'](_0xee17('0x1e'),this[_0xee17('0x1f')][_0xee17('0x15')](this));}Fax['prototype'][_0xee17('0x12')]=function(_0x53ee8d){if(_0x53ee8d[_0xee17('0x20')]===_0xee17('0x21')){for(var _0x2b78ea in this[_0xee17('0xf')]){if(this['faxAccounts'][_0xee17('0x22')](_0x2b78ea)){if(_0x53ee8d[_0xee17('0x23')]===this['faxAccounts'][_0x2b78ea][_0xee17('0x24')]){this[_0xee17('0xe')][_0x53ee8d[_0xee17('0x25')]]={};this[_0xee17('0xe')][_0x53ee8d['uniqueid']][_0xee17('0x26')]=_0x53ee8d[_0xee17('0x26')];this[_0xee17('0xe')][_0x53ee8d[_0xee17('0x25')]]['id']=this['faxAccounts'][_0x2b78ea]['id'];this[_0xee17('0xe')][_0x53ee8d['uniqueid']]['name']=this['faxAccounts'][_0x2b78ea][_0xee17('0x27')];logger[_0xee17('0x28')](_0x53ee8d[_0xee17('0x25')],_0xee17('0x29'));}}}}if(this[_0xee17('0x11')][_0x53ee8d[_0xee17('0x25')]]){this[_0xee17('0xe')][_0x53ee8d[_0xee17('0x25')]]={};this['channels'][_0x53ee8d['uniqueid']]['channel']=_0x53ee8d[_0xee17('0x26')];logger['info'](_0x53ee8d[_0xee17('0x25')],_0xee17('0x29'));}};Fax[_0xee17('0x2a')][_0xee17('0x14')]=function(_0x4ac538){if(this[_0xee17('0xe')][_0x4ac538[_0xee17('0x25')]]){for(var _0x2b9892 in _0x4ac538[_0xee17('0x2b')]){if(_0x4ac538[_0xee17('0x2b')]['hasOwnProperty'](_0x2b9892)){this[_0xee17('0xe')][_0x4ac538[_0xee17('0x25')]][_0x2b9892]=_0x4ac538['value'];}}}};Fax[_0xee17('0x2a')][_0xee17('0x17')]=function(_0x310975){if(this['channels'][_0x310975[_0xee17('0x25')]]){this['channels'][_0x310975[_0xee17('0x25')]]['channelstate']=_0x310975[_0xee17('0x2c')];this[_0xee17('0xe')][_0x310975[_0xee17('0x25')]][_0xee17('0x2d')]=_0x310975['channelstatedesc'];}};Fax[_0xee17('0x2a')][_0xee17('0x18')]=function(_0x5be0a0){if(this[_0xee17('0xe')][_0x5be0a0[_0xee17('0x25')]]){for(var _0x154ccc in _0x5be0a0[_0xee17('0x2b')]){if(_0x5be0a0['variable'][_0xee17('0x22')](_0x154ccc)){this['channels'][_0x5be0a0[_0xee17('0x25')]][_0x154ccc]=_0x5be0a0[_0xee17('0x2e')];}}}};Fax[_0xee17('0x2a')]['syncFaxStatus']=function(_0x1c5e35){if(this[_0xee17('0xe')][_0x1c5e35[_0xee17('0x25')]]){this[_0xee17('0xe')][_0x1c5e35[_0xee17('0x25')]][_0xee17('0x2f')]=_0x1c5e35[_0xee17('0x2f')];this['channels'][_0x1c5e35['uniqueid']][_0xee17('0x30')]=_0x1c5e35[_0xee17('0x30')];this[_0xee17('0xe')][_0x1c5e35[_0xee17('0x25')]][_0xee17('0x24')]=_0x1c5e35[_0xee17('0x24')];this[_0xee17('0xe')][_0x1c5e35['uniqueid']][_0xee17('0x31')]=_0x1c5e35[_0xee17('0x31')];logger[_0xee17('0x28')](_0x1c5e35[_0xee17('0x25')],_0xee17('0x32'));}};Fax['prototype'][_0xee17('0x1b')]=function(_0x453303){var _0x22a790=this;if(this[_0xee17('0xe')][_0x453303['uniqueid']]){var _0x4f60c8=this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]]['id'];this[_0xee17('0xe')][_0x453303['uniqueid']][_0xee17('0x33')]=_0x453303[_0xee17('0x33')];this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]][_0xee17('0x34')]=_0x453303[_0xee17('0x34')];this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]]['localstationid']=_0x453303[_0xee17('0x24')];this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]][_0xee17('0x35')]=_0x453303['resolution'];this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]][_0xee17('0x36')]=_0x453303[_0xee17('0x36')];this['channels'][_0x453303[_0xee17('0x25')]][_0xee17('0x31')]=_0x453303[_0xee17('0x31')];this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]]['calleridnum']=_0x453303[_0xee17('0x37')];if(this[_0xee17('0xe')][_0x453303[_0xee17('0x25')]][_0xee17('0x34')]>0x0){tiff2pdf(_0x453303[_0xee17('0x31')],_0xee17('0x38'),function(_0x4d4bd0){logger[_0xee17('0x28')](_0x453303[_0xee17('0x25')],_0xee17('0x39'),_0x4d4bd0[_0xee17('0x3a')]);attachment['create']({'name':path[_0xee17('0x3b')](_0x453303[_0xee17('0x31')])[_0xee17('0x27')],'basename':path['parse'](_0x453303['filename'])[_0xee17('0x27')]+_0xee17('0x3c'),'type':_0xee17('0x3d')})[_0xee17('0x3e')](function(_0x42a947){faxAccount['notify'](_0x4f60c8,{'from':_0x453303['calleridnum'],'mapKey':_0xee17('0x3f'),'body':path['parse'](_0x453303['filename'])[_0xee17('0x27')]+_0xee17('0x3c'),'AttachmentId':_0x42a947['id']})[_0xee17('0x40')](function(_0x442de8){logger[_0xee17('0x41')](_0x453303[_0xee17('0x25')],_0xee17('0x42'),JSON['stringify'](_0x442de8));});})[_0xee17('0x40')](function(_0x56e89c){logger[_0xee17('0x41')](_0x453303[_0xee17('0x25')],_0xee17('0x43'),JSON['stringify'](_0x56e89c));});});}logger[_0xee17('0x28')](_0x453303[_0xee17('0x25')],'\x20receiveFax\x20');}};Fax[_0xee17('0x2a')]['syncOriginateResponse']=function(_0x1a5158){if(this[_0xee17('0x11')][_0x1a5158[_0xee17('0x25')]]){_[_0xee17('0x44')](this[_0xee17('0xe')][_0x1a5158[_0xee17('0x25')]],_['pick'](_0x1a5158,[_0xee17('0x45'),_0xee17('0x46')]));}};function updateStatus(_0x5aad41){if(_0x5aad41['AttachmentId']){faxMessage['update'](_0x5aad41[_0xee17('0x47')],{'failMessage':_0xee17('0x48')})[_0xee17('0x3e')](function(_0x4406ce){ut['logger'](_0xee17('0x49'),_0x4406ce);})[_0xee17('0x40')](function(_0xbd1861){ut[_0xee17('0x4a')](_0xee17('0x4b'),_0xbd1861);});}else{ut[_0xee17('0x4a')](_0xee17('0x4c'));}}Fax[_0xee17('0x2a')]['updateStatus']=function(_0x34b150,_0x283f81,_0xb6661c){var _0x250b0b=this;var _0x525baa={};if(_0x283f81){_0x525baa={'read':_0x283f81};}else{_0x525baa={'failMessage':_0xb6661c};}if(this[_0xee17('0x11')][_0x34b150][_0xee17('0x47')]){faxMessage[_0xee17('0x4d')](this[_0xee17('0x11')][_0x34b150][_0xee17('0x47')],_0x525baa)[_0xee17('0x3e')](function(_0x141f34){ut[_0xee17('0x4a')]('[Fax][Message][Updated]',_0x141f34);})['catch'](function(_0x3a7ad2){ut[_0xee17('0x4a')]('[Fax][Message][NoUpdate1]',_0x3a7ad2);})[_0xee17('0x4e')](function(){delete _0x250b0b[_0xee17('0xe')][_0x34b150];delete _0x250b0b['actions'][_0x34b150];});}else{ut[_0xee17('0x4a')](_0xee17('0x4f'));delete this[_0xee17('0xe')][_0x34b150];delete this['actions'][_0x34b150];}};Fax['prototype'][_0xee17('0x1d')]=function(_0x584e22){var _0x211121=this;if(this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]]){if(this[_0xee17('0x11')][_0x584e22[_0xee17('0x25')]]){this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]]['id']=this[_0xee17('0x11')][_0x584e22['uniqueid']]['id'];this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]]['name']=this[_0xee17('0x11')][_0x584e22[_0xee17('0x25')]][_0xee17('0x27')];}logger[_0xee17('0x28')](_0x584e22[_0xee17('0x25')],this[_0xee17('0x11')][_0x584e22[_0xee17('0x25')]]?_0xee17('0x50'):_0xee17('0x51'),JSON[_0xee17('0x52')](this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]]));if(this[_0xee17('0x11')][_0x584e22[_0xee17('0x25')]]){if(this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]]['faxpages']>0x0&&this[_0xee17('0xe')][_0x584e22['uniqueid']][_0xee17('0x53')]===_0xee17('0x54')){this['updateStatus'](_0x584e22[_0xee17('0x25')],!![]);}else{this[_0xee17('0x55')](_0x584e22['uniqueid'],![],this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]][_0xee17('0x56')]?_0xee17('0x57')+this[_0xee17('0xe')][_0x584e22[_0xee17('0x25')]][_0xee17('0x56')]:_0xee17('0x58'));}}}};Fax['prototype'][_0xee17('0x59')]=function(_0x1687a5){var _0x32b2da=this;return new BPromise(function(_0x1ff126,_0x36d8a5){_0x32b2da['execOriginate'](_0x1687a5,_0x32b2da[_0xee17('0xf')][_0x1687a5[_0xee17('0x5a')]])[_0xee17('0x3e')](function(_0x4f2cd4){ut[_0xee17('0x4a')](_0xee17('0x5b'),_0x4f2cd4);_0x1ff126(ut[_0xee17('0x3a')](_0xee17('0x5c')));})[_0xee17('0x40')](function(_0x103a99){ut['logger'](_0xee17('0x5d'),_0x103a99);updateStatus(_0x1687a5);_0x36d8a5(ut['message'](_0xee17('0x5e')));});});};Fax[_0xee17('0x2a')]['checkAfterSend']=function(_0x437ca0){var _0x42d200=this;return new BPromise(function(_0x3fe211,_0x1a3f1f){var _0x2f8d37=_0x42d200[_0xee17('0x5f')](_0x42d200[_0xee17('0xf')][_0x437ca0[_0xee17('0x5a')]][_0xee17('0x60')],_0x437ca0);if(_0x2f8d37[_0xee17('0x61')]){_0x3fe211(ut[_0xee17('0x3a')](_0xee17('0x62')));}else{_0x1a3f1f(ut[_0xee17('0x3a')](_0x2f8d37[_0xee17('0x3a')]));}});};function originate(_0x5eef6f,_0x4b12a6,_0x38eac2){return new BPromise(function(_0x5d4f16,_0x5304e5){if(_0x38eac2){var _0x157b41=util[_0xee17('0x63')]('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[_0xee17('0x3b')](_0x5eef6f[_0xee17('0x4')])['name'],_0x5eef6f[_0xee17('0x4')]);gs['execute'](_0x157b41)[_0xee17('0x3e')](function(){_0x5eef6f['path']=util[_0xee17('0x63')](_0xee17('0x64'),path['parse'](_0x5eef6f[_0xee17('0x4')])[_0xee17('0x65')],path[_0xee17('0x3b')](_0x5eef6f[_0xee17('0x4')])[_0xee17('0x27')]);_0x4b12a6[_0xee17('0x66')]=_0x5eef6f[_0xee17('0x4')];ut['logger'](_0xee17('0x67'),'');ami[_0xee17('0x68')](ut[_0xee17('0x69')](_0x5eef6f,_0x4b12a6))[_0xee17('0x3e')](function(_0x58c363){_0x5d4f16(_0x58c363);})['catch'](function(_0x106eaf){_0x5304e5(_0x106eaf);});})[_0xee17('0x40')](function(_0x3b9311){_0x5304e5(_0x3b9311);});}else{ami['Action'](ut[_0xee17('0x69')](_0x5eef6f,_0x4b12a6))['then'](function(_0xcc78b){_0x5d4f16(_0xcc78b);})[_0xee17('0x40')](function(_0x20355e){_0x5304e5(_0x20355e);});}});}Fax[_0xee17('0x2a')][_0xee17('0x6a')]=function(_0x209168,_0x3c3fd6){var _0x2b6d9d=this;return new BPromise(function(_0x215759,_0x2720ec){var _0x4ba476=uuid['v4']();var _0x2dc4a2=ut[_0xee17('0x6b')](_0x209168,_0x3c3fd6);_0x2b6d9d[_0xee17('0x11')][_0x4ba476]=new Action(_0x4ba476,_0x3c3fd6,_0x209168);var _0x3092e8=_0x2b6d9d[_0xee17('0x11')][_0x4ba476];if(path['parse'](_0x209168[_0xee17('0x4')])['ext']==='.pdf'){originate(_0x3092e8,_0x2dc4a2,!![])['then'](function(_0x4ee607){_0x215759(_0x4ee607);})[_0xee17('0x40')](function(_0x13e9f3){_0x2720ec(_0x13e9f3);});}else{originate(_0x3092e8,_0x2dc4a2,![])[_0xee17('0x3e')](function(_0x4ef779){_0x215759(_0x4ef779);})[_0xee17('0x40')](function(_0x3e964a){_0x2720ec(_0x3e964a);});}});};Fax[_0xee17('0x2a')][_0xee17('0x6c')]=function(_0x2a5d76){return!_[_0xee17('0x6d')](_0x2a5d76)&&!_[_0xee17('0x6d')](_0x2a5d76['name'])&&!_[_0xee17('0x6d')](_0x2a5d76[_0xee17('0x6e')])&&_0x2a5d76['active']&&!_[_0xee17('0x6d')](this[_0xee17('0x10')][util[_0xee17('0x63')](_0xee17('0x6f'),_0x2a5d76[_0xee17('0x27')])])&&!_[_0xee17('0x6d')](this[_0xee17('0x10')][util[_0xee17('0x63')]('SIP/%s',_0x2a5d76[_0xee17('0x27')])][_0xee17('0x30')])&&(this['trunks'][util[_0xee17('0x63')](_0xee17('0x6f'),_0x2a5d76[_0xee17('0x27')])]['status']===_0xee17('0x70')||this[_0xee17('0x10')][util[_0xee17('0x63')](_0xee17('0x6f'),_0x2a5d76[_0xee17('0x27')])][_0xee17('0x30')]===_0xee17('0x71'));};Fax[_0xee17('0x2a')]['checkTrunk']=function(_0x5c5e6a,_0x2a5d02){if(!this['isTrunkReachable'](_0x5c5e6a)){ut[_0xee17('0x4a')](_0xee17('0x72'),_[_0xee17('0x6d')](_0x5c5e6a)?'':_0x5c5e6a[_0xee17('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xee17('0x73')};}if(_[_0xee17('0x6d')](_0x2a5d02[_0xee17('0x3f')])){ut[_0xee17('0x4a')](_0xee17('0x74'),JSON[_0xee17('0x52')](_0x2a5d02));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xee17('0x6d')](_0x2a5d02[_0xee17('0x4')])){ut[_0xee17('0x4a')](_0xee17('0x75'),JSON[_0xee17('0x52')](_0x2a5d02));return{'isValid':![],'message':_0xee17('0x76')};}return{'isValid':!![],'message':_0xee17('0x77')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index c6957dd..a6703f5 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 _0xaba4=['then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaba4,0x1b3));var _0x4aba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaba4[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var BPromise=require(_0x4aba('0x0'));var logger=require(_0x4aba('0x1'))(_0x4aba('0x2'));var _=require(_0x4aba('0x3'));var faxAccount=require(_0x4aba('0x4'));function loggerCatch(_0x85d0b6){return function(_0x5c1417){logger[_0x4aba('0x5')](_0x85d0b6,util[_0x4aba('0x6')](_0x5c1417,{'showHidden':![],'depth':null}));};}exports[_0x4aba('0x7')]=function(_0x1c1568,_0x1d3893){return BPromise[_0x4aba('0x8')]()[_0x4aba('0x9')](faxAccount[_0x4aba('0x7')](_0x1c1568,_0x1d3893))[_0x4aba('0xa')](loggerCatch(_0x4aba('0xb')));}; \ No newline at end of file +var _0x0840=['[Notify]\x20','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','resolve','catch'];(function(_0x18d5f3,_0x4cd1dd){var _0x17b803=function(_0x20f1f1){while(--_0x20f1f1){_0x18d5f3['push'](_0x18d5f3['shift']());}};_0x17b803(++_0x4cd1dd);}(_0x0840,0xb5));var _0x0084=function(_0x546f45,_0x3a0b48){_0x546f45=_0x546f45-0x0;var _0x3058cc=_0x0840[_0x546f45];return _0x3058cc;};'use strict';var util=require('util');var BPromise=require(_0x0084('0x0'));var logger=require(_0x0084('0x1'))(_0x0084('0x2'));var _=require('lodash');var faxAccount=require(_0x0084('0x3'));function loggerCatch(_0x151976){return function(_0x44e700){logger[_0x0084('0x4')](_0x151976,util[_0x0084('0x5')](_0x44e700,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2e9599,_0xf31071){return BPromise[_0x0084('0x6')]()['then'](faxAccount['notify'](_0x2e9599,_0xf31071))[_0x0084('0x7')](loggerCatch(_0x0084('0x8')));}; \ 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 62e7200..b62bedf 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 _0x58da=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0x58da,0x1b6));var _0xa58d=function(_0x11c3ca,_0x18c151){_0x11c3ca=_0x11c3ca-0x0;var _0x8133bc=_0x58da[_0x11c3ca];return _0x8133bc;};'use strict';var util=require(_0xa58d('0x0'));var logger=require(_0xa58d('0x1'))(_0xa58d('0x2'));var BPromise=require('bluebird');var exec=require(_0xa58d('0x3'))[_0xa58d('0x4')];exports[_0xa58d('0x5')]=function(_0x5184f1){return new BPromise(function(_0x3f1ee6,_0x16aa4e){exec(_0x5184f1,function(_0x31c624,_0x28df7b,_0x402678){logger[_0xa58d('0x6')](_0xa58d('0x7'),_0x28df7b);if(_0x31c624){logger['info'](_0xa58d('0x7'),_0xa58d('0x8'),util['inspect'](_0x31c624,{'showHidden':![],'depth':null}),_0x28df7b,_0x402678);_0x16aa4e(_0x31c624);}_0x3f1ee6(_0x28df7b);});});}; \ No newline at end of file +var _0x6a3a=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x43dc7a,_0xdaee2f){var _0x4f8eeb=function(_0x5a2c21){while(--_0x5a2c21){_0x43dc7a['push'](_0x43dc7a['shift']());}};_0x4f8eeb(++_0xdaee2f);}(_0x6a3a,0x77));var _0xa6a3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6a3a[_0x11005e];return _0x29338f;};'use strict';var util=require(_0xa6a3('0x0'));var logger=require(_0xa6a3('0x1'))(_0xa6a3('0x2'));var BPromise=require(_0xa6a3('0x3'));var exec=require(_0xa6a3('0x4'))[_0xa6a3('0x5')];exports[_0xa6a3('0x6')]=function(_0x55b8e7){return new BPromise(function(_0x1bee72,_0x2cb239){exec(_0x55b8e7,function(_0x47d35e,_0x3cbe8c,_0x1ddd1c){logger[_0xa6a3('0x7')](_0xa6a3('0x8'),_0x3cbe8c);if(_0x47d35e){logger['info']('Exec\x20gs',_0xa6a3('0x9'),util[_0xa6a3('0xa')](_0x47d35e,{'showHidden':![],'depth':null}),_0x3cbe8c,_0x1ddd1c);_0x2cb239(_0x47d35e);}_0x1bee72(_0x3cbe8c);});});}; \ 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 0059bb8..e949598 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 _0x3d40=['from-sip','uniqueid','lodash','moment','message','logger','info','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','channel'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x3d40,0x1b7));var _0x03d4=function(_0x1da969,_0xe95264){_0x1da969=_0x1da969-0x0;var _0x221055=_0x3d40[_0x1da969];return _0x221055;};'use strict';var util=require('util');var _=require(_0x03d4('0x0'));var moment=require(_0x03d4('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x03d4('0x2')]=function(_0x572617){return{'message':_0x572617};};exports[_0x03d4('0x3')]=function(_0x2c0738,_0x28c360){logger[_0x03d4('0x4')](_0x2c0738,util[_0x03d4('0x5')](_0x28c360,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2d8182,_0x2f36f8){var _0xc8ce5b={'XMF-ECM':_0x2f36f8['ecm'],'XMF-HEADERINFO':_0x2f36f8[_0x03d4('0x6')],'XMF-MINRATE':_0x2f36f8[_0x03d4('0x7')],'XMF-MAXRATE':_0x2f36f8[_0x03d4('0x8')],'XMF-MODEM':util[_0x03d4('0x9')](_0x03d4('0xa'),_0x2f36f8[_0x03d4('0xb')]),'XMF-GATEWAY':_0x2f36f8['gateway'],'XMF-FAXDETECT':_0x2f36f8[_0x03d4('0xc')],'XMF-T38TIMEOUT':_0x2f36f8[_0x03d4('0xd')],'XMF-LOCALSTATIONID':_0x2f36f8[_0x03d4('0xe')],'XMF-PATH':_0x2d8182['path']};return _0xc8ce5b;};exports[_0x03d4('0xf')]=function(_0x1f7ca5,_0x4b80a6){return{'actionid':_0x1f7ca5['uniqueid'],'action':'originate','channel':_0x1f7ca5[_0x03d4('0x10')],'Exten':'xcally-motion-fax','Context':_0x03d4('0x11'),'Priority':'1','callerid':util[_0x03d4('0x9')]('\x22%s\x22\x20<%s>',_0x1f7ca5[_0x03d4('0x6')]?_0x1f7ca5['headerinfo']:'',_0x1f7ca5[_0x03d4('0xe')]),'variable':_0x4b80a6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f7ca5[_0x03d4('0x12')]};}; \ No newline at end of file +var _0x118f=['variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','message','info','inspect','addVariables','headerinfo','format','\x22%s\x22','modem','gateway','t38timeout','path'];(function(_0x101f10,_0x577e96){var _0x19959f=function(_0x497276){while(--_0x497276){_0x101f10['push'](_0x101f10['shift']());}};_0x19959f(++_0x577e96);}(_0x118f,0x193));var _0xf118=function(_0x3ddff2,_0x1a62ea){_0x3ddff2=_0x3ddff2-0x0;var _0x31bfd7=_0x118f[_0x3ddff2];return _0x31bfd7;};'use strict';var util=require(_0xf118('0x0'));var _=require(_0xf118('0x1'));var moment=require(_0xf118('0x2'));var logger=require(_0xf118('0x3'))('fax');exports[_0xf118('0x4')]=function(_0x296d09){return{'message':_0x296d09};};exports['logger']=function(_0x301d38,_0x3b5c71){logger[_0xf118('0x5')](_0x301d38,util[_0xf118('0x6')](_0x3b5c71,{'showHidden':![],'depth':null}));};exports[_0xf118('0x7')]=function(_0x186412,_0x572e5a){var _0x4d19a1={'XMF-ECM':_0x572e5a['ecm'],'XMF-HEADERINFO':_0x572e5a[_0xf118('0x8')],'XMF-MINRATE':_0x572e5a['minrate'],'XMF-MAXRATE':_0x572e5a['maxrate'],'XMF-MODEM':util[_0xf118('0x9')](_0xf118('0xa'),_0x572e5a[_0xf118('0xb')]),'XMF-GATEWAY':_0x572e5a[_0xf118('0xc')],'XMF-FAXDETECT':_0x572e5a['faxdetect'],'XMF-T38TIMEOUT':_0x572e5a[_0xf118('0xd')],'XMF-LOCALSTATIONID':_0x572e5a['localstationid'],'XMF-PATH':_0x186412[_0xf118('0xe')]};return _0x4d19a1;};exports[_0xf118('0xf')]=function(_0x4aa50f,_0x1f8519){return{'actionid':_0x4aa50f[_0xf118('0x10')],'action':_0xf118('0x11'),'channel':_0x4aa50f[_0xf118('0x12')],'Exten':'xcally-motion-fax','Context':_0xf118('0x13'),'Priority':'1','callerid':util[_0xf118('0x9')](_0xf118('0x14'),_0x4aa50f[_0xf118('0x8')]?_0x4aa50f['headerinfo']:'',_0x4aa50f[_0xf118('0x15')]),'variable':_0x1f8519,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4aa50f[_0xf118('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index dbf4358..25f2549 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 _0x71fc=['initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','util','./server','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0xeaf2ab,_0x59c9b8){var _0x33422a=function(_0x2406b4){while(--_0x2406b4){_0xeaf2ab['push'](_0xeaf2ab['shift']());}};_0x33422a(++_0x59c9b8);}(_0x71fc,0x64));var _0xc71f=function(_0x4cfb94,_0x2aad6d){_0x4cfb94=_0x4cfb94-0x0;var _0xec69eb=_0x71fc[_0x4cfb94];return _0xec69eb;};'use strict';var util=require(_0xc71f('0x0'));var moment=require('moment');var server=require(_0xc71f('0x1'));var Realtime=require('./realtime');var Report=require(_0xc71f('0x2'));var Acw=require(_0xc71f('0x3'));var Trigger=require('./trigger');var Dialer=require(_0xc71f('0x4'));var Preview=require('./preview');var Fax=require(_0xc71f('0x5'));var user=require(_0xc71f('0x6'));var voiceQueue=require(_0xc71f('0x7'));var voiceQueueReport=require(_0xc71f('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xc71f('0x9'));var trigger=require(_0xc71f('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0xc71f('0xb'));var campaign=require(_0xc71f('0xc'));var voiceExtension=require(_0xc71f('0xd'));var faxAccount=require(_0xc71f('0xe'));var zendesk=require(_0xc71f('0xf'));var salesforce=require(_0xc71f('0x10'));var sugarcrm=require(_0xc71f('0x11'));var freshdesk=require(_0xc71f('0x12'));var desk=require(_0xc71f('0x13'));var zoho=require(_0xc71f('0x14'));var vtiger=require(_0xc71f('0x15'));var freshsales=require(_0xc71f('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xc71f('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xc71f('0x18'))(_0xc71f('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc71f('0x1a')](_0xc71f('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc71f('0x1a')](_0xc71f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc71f('0x1c')]()[_0xc71f('0x1d')](user['getAgents']())[_0xc71f('0x1d')](realtime[_0xc71f('0x1e')]())[_0xc71f('0x1d')](user[_0xc71f('0x1f')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x20')]())['then'](trunk[_0xc71f('0x21')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x22')]())[_0xc71f('0x1d')](voiceQueue[_0xc71f('0x23')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x24')]())[_0xc71f('0x1d')](trigger['getTriggers']())[_0xc71f('0x1d')](realtime[_0xc71f('0x25')]())[_0xc71f('0x1d')](template['getTemplates']())[_0xc71f('0x1d')](realtime[_0xc71f('0x26')]())[_0xc71f('0x1d')](zendesk[_0xc71f('0x27')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x28')]())[_0xc71f('0x1d')](salesforce[_0xc71f('0x29')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x2a')]())[_0xc71f('0x1d')](sugarcrm[_0xc71f('0x2b')]())['then'](realtime[_0xc71f('0x2c')]())['then'](freshdesk[_0xc71f('0x2d')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xc71f('0x2e')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x2f')]())[_0xc71f('0x1d')](zoho['getZohoAccounts']())[_0xc71f('0x1d')](realtime[_0xc71f('0x30')]())['then'](vtiger['getVtigerAccounts']())[_0xc71f('0x1d')](realtime[_0xc71f('0x31')]())[_0xc71f('0x1d')](freshsales[_0xc71f('0x32')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x33')]())['then'](servicenow[_0xc71f('0x34')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x35')]())[_0xc71f('0x1d')](dynamics365[_0xc71f('0x36')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x37')]())[_0xc71f('0x1d')](campaign[_0xc71f('0x38')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x39')]())[_0xc71f('0x1d')](voiceExtension['getVoiceExtensions']())[_0xc71f('0x1d')](realtime[_0xc71f('0x3a')]())[_0xc71f('0x1d')](faxAccount[_0xc71f('0x3b')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x3c')]())[_0xc71f('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0xc71f('0x1c')]()['then'](voiceQueueReport[_0xc71f('0x3d')]())[_0xc71f('0x1d')](realtime['initVoiceQueueReports']())[_0xc71f('0x1d')](cmHopperHistory[_0xc71f('0x3e')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x3f')]())[_0xc71f('0x1d')](cmHopperHistory[_0xc71f('0x40')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x41')]())[_0xc71f('0x1d')](voiceCallReport[_0xc71f('0x42')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x43')]())[_0xc71f('0x44')](function(_0x2d4e0c){logger[_0xc71f('0x45')](_0xc71f('0x46'),util[_0xc71f('0x47')](_0x2d4e0c,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xc71f('0x1d')](function(){return initRealtime();})['then'](function(){return initParams();})[_0xc71f('0x1d')](function(){report[_0xc71f('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x36ef6b){logger[_0xc71f('0x45')](_0xc71f('0x49'),util['inspect'](_0x36ef6b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xada1=['./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','listen','sync','catch','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user'];(function(_0x4202b3,_0x19b9c6){var _0x5c3f3b=function(_0x1374c8){while(--_0x1374c8){_0x4202b3['push'](_0x4202b3['shift']());}};_0x5c3f3b(++_0x19b9c6);}(_0xada1,0x1a0));var _0x1ada=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xada1[_0x344a3f];return _0x264712;};'use strict';var util=require(_0x1ada('0x0'));var moment=require(_0x1ada('0x1'));var server=require(_0x1ada('0x2'));var Realtime=require(_0x1ada('0x3'));var Report=require(_0x1ada('0x4'));var Acw=require(_0x1ada('0x5'));var Trigger=require(_0x1ada('0x6'));var Dialer=require('./dialer');var Preview=require(_0x1ada('0x7'));var Fax=require(_0x1ada('0x8'));var user=require(_0x1ada('0x9'));var voiceQueue=require(_0x1ada('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x1ada('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x1ada('0xc'));var cmHopperHistory=require(_0x1ada('0xd'));var campaign=require(_0x1ada('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x1ada('0xf'));var zendesk=require(_0x1ada('0x10'));var salesforce=require(_0x1ada('0x11'));var sugarcrm=require(_0x1ada('0x12'));var freshdesk=require(_0x1ada('0x13'));var desk=require(_0x1ada('0x14'));var zoho=require(_0x1ada('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x1ada('0x16'));var servicenow=require(_0x1ada('0x17'));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(_0x1ada('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1ada('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1ada('0x19')](_0x1ada('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x1ada('0x1b')](user[_0x1ada('0x1c')]())['then'](realtime[_0x1ada('0x1d')]())[_0x1ada('0x1b')](user[_0x1ada('0x1e')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x1f')]())[_0x1ada('0x1b')](trunk[_0x1ada('0x20')]())['then'](realtime[_0x1ada('0x21')]())[_0x1ada('0x1b')](voiceQueue['getVoiceQueues']())[_0x1ada('0x1b')](realtime[_0x1ada('0x22')]())[_0x1ada('0x1b')](trigger[_0x1ada('0x23')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x24')]())['then'](template[_0x1ada('0x25')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x26')]())[_0x1ada('0x1b')](zendesk[_0x1ada('0x27')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x28')]())[_0x1ada('0x1b')](salesforce[_0x1ada('0x29')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x2a')]())['then'](sugarcrm[_0x1ada('0x2b')]())['then'](realtime['initSugarcrmAccounts']())[_0x1ada('0x1b')](freshdesk[_0x1ada('0x2c')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x2d')]())[_0x1ada('0x1b')](desk[_0x1ada('0x2e')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x2f')]())[_0x1ada('0x1b')](zoho[_0x1ada('0x30')]())[_0x1ada('0x1b')](realtime['initZohoAccounts']())[_0x1ada('0x1b')](vtiger[_0x1ada('0x31')]())['then'](realtime[_0x1ada('0x32')]())[_0x1ada('0x1b')](freshsales[_0x1ada('0x33')]())[_0x1ada('0x1b')](realtime['initFreshsalesAccounts']())[_0x1ada('0x1b')](servicenow[_0x1ada('0x34')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x35')]())[_0x1ada('0x1b')](dynamics365['getDynamics365Accounts']())[_0x1ada('0x1b')](realtime[_0x1ada('0x36')]())[_0x1ada('0x1b')](campaign['getCampaigns']())[_0x1ada('0x1b')](realtime[_0x1ada('0x37')]())[_0x1ada('0x1b')](voiceExtension[_0x1ada('0x38')]())[_0x1ada('0x1b')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x1ada('0x39')]())['then'](realtime['initFaxAccounts']())[_0x1ada('0x1b')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x1ada('0x1b')](voiceQueueReport[_0x1ada('0x3a')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x3b')]())[_0x1ada('0x1b')](cmHopperHistory[_0x1ada('0x3c')]())['then'](realtime[_0x1ada('0x3d')]())[_0x1ada('0x1b')](cmHopperHistory[_0x1ada('0x3e')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x3f')]())['then'](voiceCallReport[_0x1ada('0x40')]())[_0x1ada('0x1b')](realtime[_0x1ada('0x41')]())['catch'](function(_0x261327){logger[_0x1ada('0x42')]('[index.js][initParams]',util[_0x1ada('0x43')](_0x261327,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1ada('0x44')](realtime,preview,fax)[_0x1ada('0x1b')](function(){return initRealtime();})[_0x1ada('0x1b')](function(){return initParams();})[_0x1ada('0x1b')](function(){report[_0x1ada('0x45')]();setInterval(initRealtime,0x1388);})[_0x1ada('0x46')](function(_0x476b39){logger[_0x1ada('0x42')]('[index.js][main]',util[_0x1ada('0x43')](_0x476b39,{'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 ce10471..6939172 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 _0x4b24=['mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','not_inuse','idle','inuse','statePause','voiceStatusTime','toNumber','format','voiceStatus','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone'];(function(_0x1b02a8,_0x36cfd3){var _0x5b460a=function(_0x5db4d6){while(--_0x5db4d6){_0x1b02a8['push'](_0x1b02a8['shift']());}};_0x5b460a(++_0x36cfd3);}(_0x4b24,0x8a));var _0x44b2=function(_0x4a2612,_0x4a8bb7){_0x4a2612=_0x4a2612-0x0;var _0x23de4b=_0x4b24[_0x4a2612];return _0x23de4b;};'use strict';var _=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var moment=require(_0x44b2('0x2'));var md5=require(_0x44b2('0x3'));var Redis=require(_0x44b2('0x4'));var config=require('../../../config/environment');config[_0x44b2('0x5')]=_[_0x44b2('0x6')](config['redis'],{'host':_0x44b2('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44b2('0x5')]));function Agent(_0x4df19b){this['id']=_0x4df19b['id']||0x0;this[_0x44b2('0x8')]=_0x4df19b[_0x44b2('0x8')]||'';this[_0x44b2('0x9')]=_0x4df19b[_0x44b2('0x9')]||'';this['accountcode']=_0x4df19b[_0x44b2('0xa')]||'';this[_0x44b2('0xb')]=_0x4df19b['fullname']||'';this[_0x44b2('0xc')]=_0x44b2('0xd');this[_0x44b2('0xe')]=0x0;this[_0x44b2('0xf')]=_0x44b2('0xd');this[_0x44b2('0x10')]='';this[_0x44b2('0x11')]='';this[_0x44b2('0x12')]='';this[_0x44b2('0x13')]='';this[_0x44b2('0x14')]=_0x4df19b['online']||![];this['voiceStatus']=_0x44b2('0xd');this['voiceStatusTime']=0x0;this[_0x44b2('0x15')]='';this[_0x44b2('0x16')]='';this[_0x44b2('0x17')]=![];this[_0x44b2('0x18')]=![];this[_0x44b2('0x3')]='';}Agent['prototype'][_0x44b2('0x19')]=function(_0x30da25){var _0x3c485f;if(_0x30da25&&_0x30da25['state']){_0x3c485f=_0x30da25[_0x44b2('0xc')]['toLowerCase']();switch(_0x3c485f){case _0x44b2('0x1a'):_0x3c485f=_0x44b2('0x1b');break;case _0x44b2('0x1c'):_0x3c485f='talking';break;}}if(_0x3c485f&&this['voiceStatus']!==_0x3c485f||_0x30da25[_0x44b2('0x1d')]){this[_0x44b2('0x1e')]=_[_0x44b2('0x1f')](moment()[_0x44b2('0x20')]('x'));}if(_0x3c485f){this[_0x44b2('0x21')]=_0x3c485f;}var _0x5243fc={'id':this['id'],'name':this[_0x44b2('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x44b2('0xb')],'state':this[_0x44b2('0xc')],'stateTime':this[_0x44b2('0xe')],'status':this[_0x44b2('0xf')],'address':this[_0x44b2('0x10')],'online':this[_0x44b2('0x14')],'voiceStatus':this[_0x44b2('0x21')],'voiceStatusTime':this[_0x44b2('0x1e')],'voiceStatusCallerIdNumber':this[_0x44b2('0x15')],'voiceStatusQueue':this[_0x44b2('0x16')],'interface':this[_0x44b2('0x13')],'onhold':this[_0x44b2('0x17')]};var _0x12e7c3=md5(JSON['stringify'](_0x5243fc));if(this[_0x44b2('0x3')]!==_0x12e7c3){this[_0x44b2('0x3')]=_0x12e7c3;io['to'](util[_0x44b2('0x20')](_0x44b2('0x22'),_0x5243fc[_0x44b2('0x8')]))[_0x44b2('0x23')](_0x44b2('0x24'),_0x5243fc);io[_0x44b2('0x23')](_0x44b2('0x25'),_0x5243fc);}};module[_0x44b2('0x26')]=Agent; \ No newline at end of file +var _0xa57e=['local','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','toNumber','format','stringify','user:%s','emit','user:save','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold'];(function(_0x4e8725,_0x3b4580){var _0x13b030=function(_0x4477a6){while(--_0x4477a6){_0x4e8725['push'](_0x4e8725['shift']());}};_0x13b030(++_0x3b4580);}(_0xa57e,0x67));var _0xea57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa57e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea57('0x0'));var util=require(_0xea57('0x1'));var moment=require(_0xea57('0x2'));var md5=require(_0xea57('0x3'));var Redis=require(_0xea57('0x4'));var config=require(_0xea57('0x5'));config[_0xea57('0x6')]=_[_0xea57('0x7')](config[_0xea57('0x6')],{'host':_0xea57('0x8'),'port':0x18eb});var io=require(_0xea57('0x9'))(new Redis(config[_0xea57('0x6')]));function Agent(_0x3352a0){this['id']=_0x3352a0['id']||0x0;this['name']=_0x3352a0[_0xea57('0xa')]||'';this[_0xea57('0xb')]=_0x3352a0[_0xea57('0xb')]||'';this['accountcode']=_0x3352a0[_0xea57('0xc')]||'';this[_0xea57('0xd')]=_0x3352a0[_0xea57('0xd')]||'';this['state']=_0xea57('0xe');this[_0xea57('0xf')]=0x0;this[_0xea57('0x10')]=_0xea57('0xe');this[_0xea57('0x11')]='';this[_0xea57('0x12')]='';this[_0xea57('0x13')]='';this[_0xea57('0x14')]='';this[_0xea57('0x15')]=_0x3352a0[_0xea57('0x15')]||![];this['voiceStatus']=_0xea57('0xe');this[_0xea57('0x16')]=0x0;this[_0xea57('0x17')]='';this[_0xea57('0x18')]='';this[_0xea57('0x19')]=![];this[_0xea57('0x1a')]=![];this[_0xea57('0x3')]='';}Agent['prototype'][_0xea57('0x1b')]=function(_0x5eeb7c){var _0x4a8731;if(_0x5eeb7c&&_0x5eeb7c[_0xea57('0x1c')]){_0x4a8731=_0x5eeb7c[_0xea57('0x1c')][_0xea57('0x1d')]();switch(_0x4a8731){case _0xea57('0x1e'):_0x4a8731=_0xea57('0x1f');break;case _0xea57('0x20'):_0x4a8731=_0xea57('0x21');break;}}if(_0x4a8731&&this[_0xea57('0x22')]!==_0x4a8731||_0x5eeb7c[_0xea57('0x23')]){this[_0xea57('0x16')]=_[_0xea57('0x24')](moment()[_0xea57('0x25')]('x'));}if(_0x4a8731){this[_0xea57('0x22')]=_0x4a8731;}var _0x5bd1c5={'id':this['id'],'name':this[_0xea57('0xa')],'email':this[_0xea57('0xb')],'accountcode':this[_0xea57('0xc')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0xea57('0xf')],'status':this[_0xea57('0x10')],'address':this[_0xea57('0x11')],'online':this[_0xea57('0x15')],'voiceStatus':this[_0xea57('0x22')],'voiceStatusTime':this[_0xea57('0x16')],'voiceStatusCallerIdNumber':this[_0xea57('0x17')],'voiceStatusQueue':this[_0xea57('0x18')],'interface':this['interface'],'onhold':this[_0xea57('0x19')]};var _0x1bcbf2=md5(JSON[_0xea57('0x26')](_0x5bd1c5));if(this[_0xea57('0x3')]!==_0x1bcbf2){this[_0xea57('0x3')]=_0x1bcbf2;io['to'](util['format'](_0xea57('0x27'),_0x5bd1c5['name']))[_0xea57('0x28')](_0xea57('0x29'),_0x5bd1c5);io[_0xea57('0x28')](_0xea57('0x2a'),_0x5bd1c5);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 8ef375a..2cdf0f7 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 _0x1c42=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x284336,_0x4305fd){var _0x441d5a=function(_0x155e46){while(--_0x155e46){_0x284336['push'](_0x284336['shift']());}};_0x441d5a(++_0x4305fd);}(_0x1c42,0x1e6));var _0x21c4=function(_0x4f9ee7,_0x492b5a){_0x4f9ee7=_0x4f9ee7-0x0;var _0x5462a2=_0x1c42[_0x4f9ee7];return _0x5462a2;};'use strict';function Campaign(_0x54867e){this['id']=_0x54867e['id']||0x0;this[_0x21c4('0x0')]=_0x54867e[_0x21c4('0x0')]||'';this[_0x21c4('0x1')]=_0x54867e['type']||'campaign';this['originated']=0x0;this[_0x21c4('0x2')]=0x0;this[_0x21c4('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x21c4('0x4')]=!![];this[_0x21c4('0x5')]=_0x54867e['active'];this[_0x21c4('0x6')]=_0x54867e[_0x21c4('0x6')];this[_0x21c4('0x7')]=_0x54867e['dialTimezone']||null;this['dialGlobalInterval']=_0x54867e['dialGlobalInterval']?_0x54867e[_0x21c4('0x8')]:null;this[_0x21c4('0x9')]=_0x54867e[_0x21c4('0x9')];this[_0x21c4('0xa')]=_0x54867e[_0x21c4('0xa')];this['dialOriginateTimeout']=_0x54867e[_0x21c4('0xb')]||0x1e;this[_0x21c4('0xc')]=_0x54867e[_0x21c4('0xc')];this[_0x21c4('0xd')]=_0x54867e[_0x21c4('0xd')];this[_0x21c4('0xe')]=_0x54867e[_0x21c4('0xe')];this['dialBusyRetryFrequency']=_0x54867e['dialBusyRetryFrequency'];this[_0x21c4('0xf')]=_0x54867e[_0x21c4('0xf')];this[_0x21c4('0x10')]=_0x54867e[_0x21c4('0x10')];this[_0x21c4('0x11')]=_0x54867e[_0x21c4('0x11')];this[_0x21c4('0x12')]=_0x54867e[_0x21c4('0x12')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x54867e[_0x21c4('0x13')]||0x96;this[_0x21c4('0x14')]=_0x54867e[_0x21c4('0x14')]||0x3;this[_0x21c4('0x15')]=_0x54867e[_0x21c4('0x15')]||0x96;this[_0x21c4('0x16')]=_0x54867e[_0x21c4('0x16')]||0x3;this[_0x21c4('0x17')]=_0x54867e[_0x21c4('0x17')]||0x96;this[_0x21c4('0x18')]=_0x54867e[_0x21c4('0x18')]||0x3;this[_0x21c4('0x19')]=_0x54867e[_0x21c4('0x19')]||0x96;this[_0x21c4('0x1a')]=_0x54867e[_0x21c4('0x1a')]||0x3;this[_0x21c4('0x1b')]=_0x54867e[_0x21c4('0x1b')]||0x96;this[_0x21c4('0x1c')]=_0x54867e[_0x21c4('0x1c')]||_0x21c4('0x1d');this['dialPrefix']=_0x54867e[_0x21c4('0x1e')]||undefined;this[_0x21c4('0x1f')]=_0x54867e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x21c4('0x20')]=_0x54867e[_0x21c4('0x20')]||undefined;this[_0x21c4('0x21')]=_0x54867e['TrunkBackup']?_0x54867e[_0x21c4('0x21')]:undefined;this[_0x21c4('0x22')]=_0x54867e[_0x21c4('0x22')]?_0x54867e[_0x21c4('0x22')]:undefined;this[_0x21c4('0x23')]=_0x54867e[_0x21c4('0x23')]?_0x54867e['Interval']:undefined;this[_0x21c4('0x24')]=_0x54867e['SquareProject']?_0x54867e['SquareProject']:undefined;this[_0x21c4('0x25')]=_0x54867e[_0x21c4('0x24')]?_0x54867e[_0x21c4('0x24')][_0x21c4('0x0')]:undefined;this[_0x21c4('0x26')]=_0x54867e['dialAMDActive']||![];this[_0x21c4('0x27')]=_0x54867e[_0x21c4('0x27')];this[_0x21c4('0x28')]=_0x54867e[_0x21c4('0x28')];this[_0x21c4('0x29')]=_0x54867e[_0x21c4('0x29')];this[_0x21c4('0x2a')]=_0x54867e[_0x21c4('0x2a')];this['dialAMDMinWordLength']=_0x54867e[_0x21c4('0x2b')];this['dialAMDBetweenWordsSilence']=_0x54867e['dialAMDBetweenWordsSilence'];this[_0x21c4('0x2c')]=_0x54867e[_0x21c4('0x2c')];this[_0x21c4('0x2d')]=_0x54867e[_0x21c4('0x2d')];this['dialAMDMaximumWordLength']=_0x54867e['dialAMDMaximumWordLength'];}module[_0x21c4('0x2e')]=Campaign; \ No newline at end of file +var _0x019f=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x019f,0x1ba));var _0xf019=function(_0x193a6e,_0x45dd00){_0x193a6e=_0x193a6e-0x0;var _0x599a9b=_0x019f[_0x193a6e];return _0x599a9b;};'use strict';function Campaign(_0x50e123){this['id']=_0x50e123['id']||0x0;this['name']=_0x50e123[_0xf019('0x0')]||'';this['type']=_0x50e123[_0xf019('0x1')]||_0xf019('0x2');this['originated']=0x0;this['temp']=0x0;this[_0xf019('0x3')]=0x0;this[_0xf019('0x4')]=0x0;this[_0xf019('0x5')]='';this[_0xf019('0x6')]=!![];this[_0xf019('0x7')]=_0x50e123['active'];this[_0xf019('0x8')]=_0x50e123[_0xf019('0x8')];this[_0xf019('0x9')]=_0x50e123[_0xf019('0x9')]||null;this[_0xf019('0xa')]=_0x50e123[_0xf019('0xa')]?_0x50e123['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x50e123[_0xf019('0xb')];this['dialOriginateCallerIdNumber']=_0x50e123['dialOriginateCallerIdNumber'];this[_0xf019('0xc')]=_0x50e123[_0xf019('0xc')]||0x1e;this[_0xf019('0xd')]=_0x50e123[_0xf019('0xd')];this['dialCongestionRetryFrequency']=_0x50e123[_0xf019('0xe')];this[_0xf019('0xf')]=_0x50e123[_0xf019('0xf')];this[_0xf019('0x10')]=_0x50e123[_0xf019('0x10')];this[_0xf019('0x11')]=_0x50e123[_0xf019('0x11')];this['dialNoAnswerRetryFrequency']=_0x50e123['dialNoAnswerRetryFrequency'];this[_0xf019('0x12')]=_0x50e123['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x50e123[_0xf019('0x13')]||0x3;this[_0xf019('0x14')]=_0x50e123[_0xf019('0x14')]||0x96;this[_0xf019('0x15')]=_0x50e123[_0xf019('0x15')]||0x3;this[_0xf019('0x16')]=_0x50e123[_0xf019('0x16')]||0x96;this[_0xf019('0x17')]=_0x50e123[_0xf019('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x50e123[_0xf019('0x18')]||0x96;this[_0xf019('0x19')]=_0x50e123[_0xf019('0x19')]||0x3;this[_0xf019('0x1a')]=_0x50e123[_0xf019('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x50e123[_0xf019('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x50e123['dialAgentRejectRetryFrequency']||0x96;this[_0xf019('0x1c')]=_0x50e123[_0xf019('0x1c')]||_0xf019('0x1d');this[_0xf019('0x1e')]=_0x50e123[_0xf019('0x1e')]||undefined;this[_0xf019('0x1f')]=_0x50e123[_0xf019('0x1f')]||undefined;this[_0xf019('0x20')]=_0x50e123['dialCutDigit']||undefined;this[_0xf019('0x21')]=_0x50e123[_0xf019('0x21')]?_0x50e123[_0xf019('0x21')]:undefined;this[_0xf019('0x22')]=_0x50e123[_0xf019('0x22')]?_0x50e123['Trunk']:undefined;this[_0xf019('0x23')]=_0x50e123['Interval']?_0x50e123[_0xf019('0x23')]:undefined;this['SquareProject']=_0x50e123[_0xf019('0x24')]?_0x50e123[_0xf019('0x24')]:undefined;this[_0xf019('0x25')]=_0x50e123[_0xf019('0x24')]?_0x50e123[_0xf019('0x24')]['name']:undefined;this[_0xf019('0x26')]=_0x50e123[_0xf019('0x26')]||![];this[_0xf019('0x27')]=_0x50e123['dialAMDInitialSilence'];this[_0xf019('0x28')]=_0x50e123[_0xf019('0x28')];this[_0xf019('0x29')]=_0x50e123[_0xf019('0x29')];this[_0xf019('0x2a')]=_0x50e123[_0xf019('0x2a')];this[_0xf019('0x2b')]=_0x50e123['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x50e123['dialAMDBetweenWordsSilence'];this[_0xf019('0x2c')]=_0x50e123[_0xf019('0x2c')];this[_0xf019('0x2d')]=_0x50e123['dialAMDSilenceThreshold'];this[_0xf019('0x2e')]=_0x50e123['dialAMDMaximumWordLength'];}module[_0xf019('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 65aa392..4df098f 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 _0x285b=['exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','holdtime','type','tag','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid'];(function(_0x32d369,_0x560b9c){var _0x59180b=function(_0x157fa2){while(--_0x157fa2){_0x32d369['push'](_0x32d369['shift']());}};_0x59180b(++_0x560b9c);}(_0x285b,0x171));var _0xb285=function(_0x53901e,_0x36adc1){_0x53901e=_0x53901e-0x0;var _0x27fdb1=_0x285b[_0x53901e];return _0x27fdb1;};'use strict';function Channel(){this[_0xb285('0x0')]=null;this['channel']='';this[_0xb285('0x1')]='';this[_0xb285('0x2')]=0x0;this['calleridname']='';this[_0xb285('0x3')]=undefined;this[_0xb285('0x4')]=undefined;this[_0xb285('0x5')]=0x0;this[_0xb285('0x6')]='';this[_0xb285('0x7')]=0x0;this[_0xb285('0x8')]=0x0;this[_0xb285('0x9')]=0x0;this[_0xb285('0xa')]=![];this[_0xb285('0xb')]=null;this[_0xb285('0xc')]=null;this['unmanaged']=![];this[_0xb285('0xd')]=![];this[_0xb285('0xe')]='';this[_0xb285('0xf')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xb285('0x10')]=0x0;this[_0xb285('0x11')]=null;this[_0xb285('0x12')]=null;this[_0xb285('0x13')]=null;this['monitor']=![];this[_0xb285('0x14')]=null;this['queue']=null;this[_0xb285('0x15')]=[];this[_0xb285('0x16')]=undefined;this[_0xb285('0x17')]=undefined;this[_0xb285('0x18')]=undefined;this[_0xb285('0x19')]=0x0;}module[_0xb285('0x1a')]=Channel; \ No newline at end of file +var _0x3f2e=['exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','answered','answertime','lastapplication','lastdata','duration','billableseconds','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0x8d7f4d,_0x3c6f1c){var _0x42b135=function(_0x1ebb7e){while(--_0x1ebb7e){_0x8d7f4d['push'](_0x8d7f4d['shift']());}};_0x42b135(++_0x3c6f1c);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0x3f2e[_0x26a10d];return _0xf90201;};'use strict';function Channel(){this[_0xe3f2('0x0')]=null;this['channel']='';this[_0xe3f2('0x1')]='';this[_0xe3f2('0x2')]=0x0;this[_0xe3f2('0x3')]='';this[_0xe3f2('0x4')]=undefined;this[_0xe3f2('0x5')]=undefined;this[_0xe3f2('0x6')]=0x0;this[_0xe3f2('0x7')]='';this['uniqueid']=0x0;this[_0xe3f2('0x8')]=0x0;this['exten']=0x0;this[_0xe3f2('0x9')]=![];this[_0xe3f2('0xa')]=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0xe3f2('0xb')]='';this[_0xe3f2('0xc')]='';this[_0xe3f2('0xd')]=0x0;this[_0xe3f2('0xe')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0xe3f2('0xf')]=null;this[_0xe3f2('0x10')]=null;this[_0xe3f2('0x11')]=![];this[_0xe3f2('0x12')]=null;this[_0xe3f2('0x13')]=null;this[_0xe3f2('0x14')]=[];this[_0xe3f2('0x15')]=undefined;this[_0xe3f2('0x16')]=undefined;this[_0xe3f2('0x17')]=undefined;this[_0xe3f2('0x18')]=0x0;}module[_0xe3f2('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a1b36d8..70822d6 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 _0xc608=['Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl'];(function(_0x2652dd,_0x103985){var _0x5ca280=function(_0x5514f4){while(--_0x5514f4){_0x2652dd['push'](_0x2652dd['shift']());}};_0x5ca280(++_0x103985);}(_0xc608,0x12a));var _0x8c60=function(_0x4bbeb7,_0x374606){_0x4bbeb7=_0x4bbeb7-0x0;var _0x9bad8f=_0xc608[_0x4bbeb7];return _0x9bad8f;};'use strict';function DeskAccount(_0x14e53a){this['id']=_0x14e53a['id']||0x0;this[_0x8c60('0x0')]=_0x14e53a['name']||'';this['username']=_0x14e53a[_0x8c60('0x1')]||'';this[_0x8c60('0x2')]=_0x14e53a[_0x8c60('0x2')]||'';this[_0x8c60('0x3')]=_0x14e53a[_0x8c60('0x3')]||'';this[_0x8c60('0x4')]=_0x14e53a['password']||'';this[_0x8c60('0x5')]=_0x14e53a[_0x8c60('0x5')]||'';this[_0x8c60('0x6')]=_0x14e53a[_0x8c60('0x6')]||'';this[_0x8c60('0x7')]=_0x14e53a[_0x8c60('0x7')]||'';this[_0x8c60('0x8')]=_0x14e53a[_0x8c60('0x8')]||'';this['type']=_0x14e53a['type']||'';this[_0x8c60('0x9')]=_0x14e53a[_0x8c60('0x9')]||'';this[_0x8c60('0xa')]=_0x14e53a[_0x8c60('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x14f2=['tokenSecret','type','serverUrl','Configurations','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x2fb24e,_0x85ab8b){var _0x5864cc=function(_0x2edb62){while(--_0x2edb62){_0x2fb24e['push'](_0x2fb24e['shift']());}};_0x5864cc(++_0x85ab8b);}(_0x14f2,0x1c7));var _0x214f=function(_0x14d7fa,_0x2e782c){_0x14d7fa=_0x14d7fa-0x0;var _0x50862e=_0x14f2[_0x14d7fa];return _0x50862e;};'use strict';function DeskAccount(_0x1558e3){this['id']=_0x1558e3['id']||0x0;this['name']=_0x1558e3['name']||'';this['username']=_0x1558e3[_0x214f('0x0')]||'';this[_0x214f('0x1')]=_0x1558e3[_0x214f('0x1')]||'';this[_0x214f('0x2')]=_0x1558e3['authType']||'';this[_0x214f('0x3')]=_0x1558e3['password']||'';this[_0x214f('0x4')]=_0x1558e3['consumerKey']||'';this[_0x214f('0x5')]=_0x1558e3[_0x214f('0x5')]||'';this[_0x214f('0x6')]=_0x1558e3[_0x214f('0x6')]||'';this[_0x214f('0x7')]=_0x1558e3[_0x214f('0x7')]||'';this['type']=_0x1558e3[_0x214f('0x8')]||'';this['serverUrl']=_0x1558e3[_0x214f('0x9')]||'';this[_0x214f('0xa')]=_0x1558e3[_0x214f('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 89357f3..6f025d9 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 _0x4bf0=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x9809ea,_0x40572d){var _0x269fa6=function(_0x411b74){while(--_0x411b74){_0x9809ea['push'](_0x9809ea['shift']());}};_0x269fa6(++_0x40572d);}(_0x4bf0,0x1d4));var _0x04bf=function(_0x4057f1,_0x5df9a4){_0x4057f1=_0x4057f1-0x0;var _0x294892=_0x4bf0[_0x4057f1];return _0x294892;};'use strict';function Dynamics365Account(_0x129e98){this['id']=_0x129e98['id']||0x0;this[_0x04bf('0x0')]=_0x129e98[_0x04bf('0x0')]||'';this[_0x04bf('0x1')]=_0x129e98[_0x04bf('0x1')]||'';this[_0x04bf('0x2')]=_0x129e98[_0x04bf('0x2')]||'';this[_0x04bf('0x3')]=_0x129e98[_0x04bf('0x3')]||'';this[_0x04bf('0x4')]=_0x129e98[_0x04bf('0x4')]||'';this[_0x04bf('0x5')]=_0x129e98[_0x04bf('0x5')]||'';this[_0x04bf('0x6')]=_0x129e98[_0x04bf('0x6')]||{};this[_0x04bf('0x7')]=_0x129e98[_0x04bf('0x7')]||'';this[_0x04bf('0x8')]=_0x129e98[_0x04bf('0x8')]||![];this['Configurations']=_0x129e98[_0x04bf('0x9')]||{};this[_0x04bf('0xa')]=_0x129e98[_0x04bf('0xa')]||{};}module[_0x04bf('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xdf19=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','username','password','remoteUri','tenantId','clientId'];(function(_0x2e36a6,_0x4eced2){var _0x8e6a87=function(_0x393876){while(--_0x393876){_0x2e36a6['push'](_0x2e36a6['shift']());}};_0x8e6a87(++_0x4eced2);}(_0xdf19,0xa0));var _0x9df1=function(_0x310043,_0x435e95){_0x310043=_0x310043-0x0;var _0x43283d=_0xdf19[_0x310043];return _0x43283d;};'use strict';function Dynamics365Account(_0x42d2b0){this['id']=_0x42d2b0['id']||0x0;this['name']=_0x42d2b0['name']||'';this[_0x9df1('0x0')]=_0x42d2b0['username']||'';this['password']=_0x42d2b0[_0x9df1('0x1')]||'';this[_0x9df1('0x2')]=_0x42d2b0[_0x9df1('0x2')]||'';this[_0x9df1('0x3')]=_0x42d2b0['tenantId']||'';this[_0x9df1('0x4')]=_0x42d2b0['clientId']||'';this[_0x9df1('0x5')]=_0x42d2b0[_0x9df1('0x5')]||{};this['serverUrl']=_0x42d2b0[_0x9df1('0x6')]||'';this['modernAuthentication']=_0x42d2b0[_0x9df1('0x7')]||![];this[_0x9df1('0x8')]=_0x42d2b0['Configurations']||{};this[_0x9df1('0x9')]=_0x42d2b0['CloudProvider']||{};}module[_0x9df1('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 8f629b5..d55b078 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 _0x6b43=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6b43,0x18d));var _0x36b4=function(_0xfc2644,_0x4a3b13){_0xfc2644=_0xfc2644-0x0;var _0x4873b7=_0x6b43[_0xfc2644];return _0x4873b7;};'use strict';function FaxAccount(_0x259e60){this['id']=_0x259e60['id']||0x0;this[_0x36b4('0x0')]=_0x259e60[_0x36b4('0x0')]||'';this[_0x36b4('0x1')]=_0x259e60[_0x36b4('0x1')];this[_0x36b4('0x2')]=_0x259e60[_0x36b4('0x2')];this[_0x36b4('0x3')]=_0x259e60[_0x36b4('0x3')];this[_0x36b4('0x4')]=_0x259e60[_0x36b4('0x4')];this['minrate']=_0x259e60[_0x36b4('0x5')]||0x960;this[_0x36b4('0x6')]=_0x259e60[_0x36b4('0x6')]||0x3840;this['modem']=_0x259e60[_0x36b4('0x7')]||_0x36b4('0x8');this[_0x36b4('0x9')]=_0x259e60['gateway']||'no';this[_0x36b4('0xa')]=_0x259e60['faxdetect']||'no';this[_0x36b4('0xb')]=_0x259e60['t38timeout']||0x1388;this[_0x36b4('0xc')]=_0x259e60[_0x36b4('0xc')]||_0x36b4('0xd');this[_0x36b4('0xe')]=_0x259e60['Trunk']?_0x259e60[_0x36b4('0xe')]:undefined;this[_0x36b4('0xf')]=_0x259e60[_0x36b4('0xf')];this['key']=_0x259e60[_0x36b4('0x10')];}module[_0x36b4('0x11')]=FaxAccount; \ No newline at end of file +var _0x33a3=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','SIP'];(function(_0x496a63,_0x2d6307){var _0x12581f=function(_0x362230){while(--_0x362230){_0x496a63['push'](_0x496a63['shift']());}};_0x12581f(++_0x2d6307);}(_0x33a3,0xbf));var _0x333a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33a3[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x1801c5){this['id']=_0x1801c5['id']||0x0;this['name']=_0x1801c5[_0x333a('0x0')]||'';this['description']=_0x1801c5[_0x333a('0x1')];this[_0x333a('0x2')]=_0x1801c5[_0x333a('0x2')];this[_0x333a('0x3')]=_0x1801c5[_0x333a('0x3')];this['localstationid']=_0x1801c5[_0x333a('0x4')];this[_0x333a('0x5')]=_0x1801c5[_0x333a('0x5')]||0x960;this[_0x333a('0x6')]=_0x1801c5[_0x333a('0x6')]||0x3840;this[_0x333a('0x7')]=_0x1801c5[_0x333a('0x7')]||_0x333a('0x8');this['gateway']=_0x1801c5['gateway']||'no';this['faxdetect']=_0x1801c5[_0x333a('0x9')]||'no';this['t38timeout']=_0x1801c5[_0x333a('0xa')]||0x1388;this[_0x333a('0xb')]=_0x1801c5[_0x333a('0xb')]||_0x333a('0xc');this[_0x333a('0xd')]=_0x1801c5[_0x333a('0xd')]?_0x1801c5['Trunk']:undefined;this[_0x333a('0xe')]=_0x1801c5[_0x333a('0xe')];this[_0x333a('0xf')]=_0x1801c5[_0x333a('0xf')];}module[_0x333a('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 27a47e4..80c884f 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 _0x0797=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x0797,0x124));var _0x7079=function(_0xcd586e,_0x599911){_0xcd586e=_0xcd586e-0x0;var _0x3d6e15=_0x0797[_0xcd586e];return _0x3d6e15;};'use strict';function FreshdeskAccount(_0x12daeb){this['id']=_0x12daeb['id']||0x0;this[_0x7079('0x0')]=_0x12daeb['name']||'';this[_0x7079('0x1')]=_0x12daeb[_0x7079('0x1')]||'';this[_0x7079('0x2')]=_0x12daeb[_0x7079('0x3')]||'';this[_0x7079('0x4')]=_0x12daeb[_0x7079('0x4')]||'';this['serverUrl']=_0x12daeb[_0x7079('0x5')]||'';this[_0x7079('0x6')]=_0x12daeb[_0x7079('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x89af=['serverUrl','Configurations','exports','name','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89af,0x1e9));var _0xf89a=function(_0x440e3b,_0x2cc516){_0x440e3b=_0x440e3b-0x0;var _0x4cc139=_0x89af[_0x440e3b];return _0x4cc139;};'use strict';function FreshdeskAccount(_0x2ee5d3){this['id']=_0x2ee5d3['id']||0x0;this['name']=_0x2ee5d3[_0xf89a('0x0')]||'';this['username']=_0x2ee5d3['username']||'';this['apiKey']=_0x2ee5d3[_0xf89a('0x1')]||'';this[_0xf89a('0x2')]=_0x2ee5d3['remoteUri']||'';this[_0xf89a('0x3')]=_0x2ee5d3['serverUrl']||'';this[_0xf89a('0x4')]=_0x2ee5d3['Configurations']||{};}module[_0xf89a('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 2fcb351..9b41ee8 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 _0xe5e0=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x123f2b,_0x46c143){var _0x3e1efd=function(_0x28fadc){while(--_0x28fadc){_0x123f2b['push'](_0x123f2b['shift']());}};_0x3e1efd(++_0x46c143);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x5d9e08,_0x2fa647){_0x5d9e08=_0x5d9e08-0x0;var _0x435e67=_0xe5e0[_0x5d9e08];return _0x435e67;};'use strict';function FreshsalesAccount(_0x94e88){this['id']=_0x94e88['id']||0x0;this[_0x0e5e('0x0')]=_0x94e88[_0x0e5e('0x0')]||'';this[_0x0e5e('0x1')]=_0x94e88[_0x0e5e('0x1')]||'';this[_0x0e5e('0x2')]=_0x94e88[_0x0e5e('0x3')]||'';this[_0x0e5e('0x4')]=_0x94e88[_0x0e5e('0x4')]||'';this['serverUrl']=_0x94e88[_0x0e5e('0x5')]||'';this[_0x0e5e('0x6')]=_0x94e88[_0x0e5e('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xcddb=['serverUrl','Configurations','name','apiKey','remoteUri'];(function(_0x50bd8e,_0x3a98c2){var _0x2d3058=function(_0x531e43){while(--_0x531e43){_0x50bd8e['push'](_0x50bd8e['shift']());}};_0x2d3058(++_0x3a98c2);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x5b745a,_0x3db07d){_0x5b745a=_0x5b745a-0x0;var _0x21e667=_0xcddb[_0x5b745a];return _0x21e667;};'use strict';function FreshsalesAccount(_0x82d2ab){this['id']=_0x82d2ab['id']||0x0;this[_0xbcdd('0x0')]=_0x82d2ab[_0xbcdd('0x0')]||'';this['username']=_0x82d2ab['username']||'';this[_0xbcdd('0x1')]=_0x82d2ab['token']||'';this[_0xbcdd('0x2')]=_0x82d2ab[_0xbcdd('0x2')]||'';this[_0xbcdd('0x3')]=_0x82d2ab[_0xbcdd('0x3')]||'';this['Configurations']=_0x82d2ab[_0xbcdd('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 69bc3d1..7113d46 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 _0x188e=['inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','assigned','motionChannel','routealias'];(function(_0x2a1374,_0x4d9327){var _0x45eead=function(_0x475b7a){while(--_0x475b7a){_0x2a1374['push'](_0x2a1374['shift']());}};_0x45eead(++_0x4d9327);}(_0x188e,0x140));var _0xe188=function(_0x37cc84,_0x1e2f2a){_0x37cc84=_0x37cc84-0x0;var _0x37ec6b=_0x188e[_0x37cc84];return _0x37ec6b;};'use strict';function QueueReport(){this['type']=_0xe188('0x0');this[_0xe188('0x1')]='';this[_0xe188('0x2')]='';this[_0xe188('0x3')]='';this[_0xe188('0x4')]='';this[_0xe188('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this[_0xe188('0x6')]=![];this[_0xe188('0x7')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xe188('0x8')]=![];this[_0xe188('0x9')]=null;this[_0xe188('0xa')]=0x1;this['channel']='';this[_0xe188('0xb')]='';this['connectedlinename']='';this[_0xe188('0xc')]='';this['context']='';this['exten']='';this['priority']='';this['holdtime']=0x0;this[_0xe188('0xd')]=![];this['lastAssignedTo']='';this[_0xe188('0xe')]='voice';this[_0xe188('0xf')]=null;this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x9261=['voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','exten','lastAssignedTo','motionChannel'];(function(_0x322ffa,_0x2488f4){var _0x4ffd51=function(_0x2737b4){while(--_0x2737b4){_0x322ffa['push'](_0x322ffa['shift']());}};_0x4ffd51(++_0x2488f4);}(_0x9261,0x12a));var _0x1926=function(_0x318dda,_0x1aa800){_0x318dda=_0x318dda-0x0;var _0x3f97ca=_0x9261[_0x318dda];return _0x3f97ca;};'use strict';function QueueReport(){this[_0x1926('0x0')]=_0x1926('0x1');this['uniqueid']='';this[_0x1926('0x2')]='';this[_0x1926('0x3')]='';this['queue']='';this[_0x1926('0x4')]=null;this[_0x1926('0x5')]=null;this[_0x1926('0x6')]=0x1;this['count']=0x1;this[_0x1926('0x7')]=![];this[_0x1926('0x8')]=null;this[_0x1926('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x1926('0xa')]=![];this[_0x1926('0xb')]=null;this[_0x1926('0xc')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0x1926('0xd')]='';this['accountcode']='';this['context']='';this[_0x1926('0xe')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this[_0x1926('0xf')]='';this[_0x1926('0x10')]=_0x1926('0x11');this['routealias']=null;this[_0x1926('0x12')]=0x0;this[_0x1926('0x13')]={};}module[_0x1926('0x14')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 7fe0fe4..7972a75 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 _0xdd4f=['serverUrl','Configurations','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x2628b0,_0xa51fc9){var _0x44c69a=function(_0xd38a96){while(--_0xd38a96){_0x2628b0['push'](_0x2628b0['shift']());}};_0x44c69a(++_0xa51fc9);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x334b4f,_0x1530f1){_0x334b4f=_0x334b4f-0x0;var _0x899957=_0xdd4f[_0x334b4f];return _0x899957;};'use strict';function SalesforceAccount(_0x447337){this['id']=_0x447337['id']||0x0;this['name']=_0x447337['name']||'';this['username']=_0x447337[_0xfdd4('0x0')]||'';this[_0xfdd4('0x1')]=_0x447337['remoteUri']||'';this[_0xfdd4('0x2')]=_0x447337[_0xfdd4('0x2')]||'';this[_0xfdd4('0x3')]=_0x447337['clientId']||'';this[_0xfdd4('0x4')]=_0x447337[_0xfdd4('0x4')]||'';this[_0xfdd4('0x5')]=_0x447337[_0xfdd4('0x5')]||'';this[_0xfdd4('0x6')]=_0x447337['type']||_0xfdd4('0x7');this['serverUrl']=_0x447337[_0xfdd4('0x8')]||'';this[_0xfdd4('0x9')]=_0x447337[_0xfdd4('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xac60=['Configurations','exports','name','username','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xac60,0x188));var _0x0ac6=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xac60[_0x3a6efd];return _0x487b9a;};'use strict';function SalesforceAccount(_0x2588e3){this['id']=_0x2588e3['id']||0x0;this[_0x0ac6('0x0')]=_0x2588e3['name']||'';this[_0x0ac6('0x1')]=_0x2588e3[_0x0ac6('0x1')]||'';this['remoteUri']=_0x2588e3['remoteUri']||'';this[_0x0ac6('0x2')]=_0x2588e3[_0x0ac6('0x2')]||'';this[_0x0ac6('0x3')]=_0x2588e3[_0x0ac6('0x3')]||'';this[_0x0ac6('0x4')]=_0x2588e3[_0x0ac6('0x4')]||'';this[_0x0ac6('0x5')]=_0x2588e3[_0x0ac6('0x5')]||'';this[_0x0ac6('0x6')]=_0x2588e3[_0x0ac6('0x6')]||'integrationTab';this[_0x0ac6('0x7')]=_0x2588e3[_0x0ac6('0x7')]||'';this[_0x0ac6('0x8')]=_0x2588e3[_0x0ac6('0x8')]||{};}module[_0x0ac6('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index ec45051..828de8e 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 _0x25e3=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3f2b1a,_0x5de6e8){var _0x377fd6=function(_0x5169fd){while(--_0x5169fd){_0x3f2b1a['push'](_0x3f2b1a['shift']());}};_0x377fd6(++_0x5de6e8);}(_0x25e3,0xce));var _0x325e=function(_0x29a75d,_0x3fb49b){_0x29a75d=_0x29a75d-0x0;var _0x33d125=_0x25e3[_0x29a75d];return _0x33d125;};'use strict';function ServicenowAccount(_0x10ca8e){this['id']=_0x10ca8e['id']||0x0;this['name']=_0x10ca8e[_0x325e('0x0')]||'';this[_0x325e('0x1')]=_0x10ca8e[_0x325e('0x1')]||'';this[_0x325e('0x2')]=_0x10ca8e[_0x325e('0x2')]||'';this['remoteUri']=_0x10ca8e[_0x325e('0x3')]||'';this['serverUrl']=_0x10ca8e[_0x325e('0x4')]||'';this['Configurations']=_0x10ca8e[_0x325e('0x5')]||{};}module[_0x325e('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x95c2=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x58807a,_0x294a3a){var _0x48fab6=function(_0x1b534c){while(--_0x1b534c){_0x58807a['push'](_0x58807a['shift']());}};_0x48fab6(++_0x294a3a);}(_0x95c2,0xd5));var _0x295c=function(_0x5ab786,_0xd96140){_0x5ab786=_0x5ab786-0x0;var _0x3a2001=_0x95c2[_0x5ab786];return _0x3a2001;};'use strict';function ServicenowAccount(_0xf9d163){this['id']=_0xf9d163['id']||0x0;this[_0x295c('0x0')]=_0xf9d163[_0x295c('0x0')]||'';this['username']=_0xf9d163[_0x295c('0x1')]||'';this[_0x295c('0x2')]=_0xf9d163['password']||'';this['remoteUri']=_0xf9d163[_0x295c('0x3')]||'';this[_0x295c('0x4')]=_0xf9d163[_0x295c('0x4')]||'';this[_0x295c('0x5')]=_0xf9d163[_0x295c('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 2874d6a..11820da 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 _0x535f=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x535f,0x160));var _0xf535=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0x535f[_0x4bf793];return _0x55a44b;};'use strict';function SugarcrmAccount(_0x213768){this['id']=_0x213768['id']||0x0;this['name']=_0x213768[_0xf535('0x0')]||'';this[_0xf535('0x1')]=_0x213768[_0xf535('0x1')]||'';this[_0xf535('0x2')]=_0x213768[_0xf535('0x2')]||'';this[_0xf535('0x3')]=_0x213768[_0xf535('0x3')]||'';this[_0xf535('0x4')]=_0x213768[_0xf535('0x4')]||'';this['Configurations']=_0x213768[_0xf535('0x5')]||{};}module[_0xf535('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xd0e0=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x1c4831,_0x3ff74a){var _0x1e6a6d=function(_0x434896){while(--_0x434896){_0x1c4831['push'](_0x1c4831['shift']());}};_0x1e6a6d(++_0x3ff74a);}(_0xd0e0,0xe9));var _0x0d0e=function(_0x5da5e1,_0x3aea4d){_0x5da5e1=_0x5da5e1-0x0;var _0x211c08=_0xd0e0[_0x5da5e1];return _0x211c08;};'use strict';function SugarcrmAccount(_0x1a45ee){this['id']=_0x1a45ee['id']||0x0;this[_0x0d0e('0x0')]=_0x1a45ee[_0x0d0e('0x0')]||'';this[_0x0d0e('0x1')]=_0x1a45ee[_0x0d0e('0x1')]||'';this[_0x0d0e('0x2')]=_0x1a45ee['password']||'';this[_0x0d0e('0x3')]=_0x1a45ee[_0x0d0e('0x3')]||'';this[_0x0d0e('0x4')]=_0x1a45ee[_0x0d0e('0x4')]||'';this['Configurations']=_0x1a45ee[_0x0d0e('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f728698..99d1dff 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 _0x205d=['name','state','unknown','stateTime','address','exports'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x205d,0xf6));var _0xd205=function(_0x5dcd95,_0x1e72d4){_0x5dcd95=_0x5dcd95-0x0;var _0x271b17=_0x205d[_0x5dcd95];return _0x271b17;};'use strict';function Telephone(_0x3e0609){this['id']=_0x3e0609['id']||0x0;this[_0xd205('0x0')]=_0x3e0609[_0xd205('0x0')]||'';this['accountcode']=_0x3e0609['accountcode']||'';this[_0xd205('0x1')]=_0xd205('0x2');this[_0xd205('0x3')]=0x0;this['status']=_0xd205('0x2');this[_0xd205('0x4')]='';}module[_0xd205('0x5')]=Telephone; \ No newline at end of file +var _0xefdd=['unknown','stateTime','exports','name','accountcode','state'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xefdd,0x75));var _0xdefd=function(_0x6b204f,_0x3376a8){_0x6b204f=_0x6b204f-0x0;var _0x3e07cc=_0xefdd[_0x6b204f];return _0x3e07cc;};'use strict';function Telephone(_0x2aeca1){this['id']=_0x2aeca1['id']||0x0;this[_0xdefd('0x0')]=_0x2aeca1['name']||'';this[_0xdefd('0x1')]=_0x2aeca1[_0xdefd('0x1')]||'';this[_0xdefd('0x2')]=_0xdefd('0x3');this[_0xdefd('0x4')]=0x0;this['status']='unknown';this['address']='';}module[_0xdefd('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index cb09f51..c72206b 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(_0x103ff7,_0x5a9dc1){var _0x5a3986=function(_0xebac0c){while(--_0xebac0c){_0x103ff7['push'](_0x103ff7['shift']());}};_0x5a3986(++_0x5a9dc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 _0xa9e0=['exports','name'];(function(_0x4488b2,_0x37105f){var _0x201a7d=function(_0xf2a02e){while(--_0xf2a02e){_0x4488b2['push'](_0x4488b2['shift']());}};_0x201a7d(++_0x37105f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 6f04c5d..da2b287 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x591217,_0x285c40){var _0x160832=function(_0x47a215){while(--_0x47a215){_0x591217['push'](_0x591217['shift']());}};_0x160832(++_0x285c40);}(_0x14a0,0x8e));var _0x014a=function(_0x36342d,_0x5d9c76){_0x36342d=_0x36342d-0x0;var _0x4d2176=_0x14a0[_0x36342d];return _0x4d2176;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}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 eafa184..756e366 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 _0x4035=['stateRegistry','registrationtime','address','defaultuser','exports','name','state','unknown','stateTime','status','registry','indexOf','host','port','domain','domainport','refresh'];(function(_0x5eed92,_0x97240c){var _0x31df38=function(_0x2eb336){while(--_0x2eb336){_0x5eed92['push'](_0x5eed92['shift']());}};_0x31df38(++_0x97240c);}(_0x4035,0x126));var _0x5403=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x4035[_0x37c22c];return _0x119d79;};'use strict';function Trunk(_0x1eb1a7){this['id']=_0x1eb1a7['id']||0x0;this['active']=_0x1eb1a7['active']||![];this[_0x5403('0x0')]=_0x1eb1a7[_0x5403('0x0')]||'';this[_0x5403('0x1')]=_0x5403('0x2');this[_0x5403('0x3')]=0x0;this[_0x5403('0x4')]='unknown';this[_0x5403('0x5')]=_0x1eb1a7[_0x5403('0x5')]&&_0x1eb1a7['registry'][_0x5403('0x6')](':')?_0x1eb1a7[_0x5403('0x5')]['split'](':')[0x0]:'';this[_0x5403('0x7')]='';this[_0x5403('0x8')]='';this[_0x5403('0x9')]='';this[_0x5403('0xa')]='';this[_0x5403('0xb')]='';this[_0x5403('0xc')]='unknown';this[_0x5403('0xd')]='';this[_0x5403('0xe')]='';this[_0x5403('0xf')]=_0x1eb1a7[_0x5403('0xf')]||'';}module[_0x5403('0x10')]=Trunk; \ No newline at end of file +var _0xcaaa=['indexOf','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','registry'];(function(_0x599547,_0x21e3b7){var _0x411e0b=function(_0x2caf31){while(--_0x2caf31){_0x599547['push'](_0x599547['shift']());}};_0x411e0b(++_0x21e3b7);}(_0xcaaa,0x8a));var _0xacaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaaa[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x3f8641){this['id']=_0x3f8641['id']||0x0;this[_0xacaa('0x0')]=_0x3f8641[_0xacaa('0x0')]||![];this[_0xacaa('0x1')]=_0x3f8641[_0xacaa('0x1')]||'';this[_0xacaa('0x2')]=_0xacaa('0x3');this[_0xacaa('0x4')]=0x0;this['status']=_0xacaa('0x3');this[_0xacaa('0x5')]=_0x3f8641[_0xacaa('0x5')]&&_0x3f8641[_0xacaa('0x5')][_0xacaa('0x6')](':')?_0x3f8641[_0xacaa('0x5')]['split'](':')[0x0]:'';this[_0xacaa('0x7')]='';this['port']='';this[_0xacaa('0x8')]='';this[_0xacaa('0x9')]='';this[_0xacaa('0xa')]='';this[_0xacaa('0xb')]=_0xacaa('0x3');this[_0xacaa('0xc')]='';this[_0xacaa('0xd')]='';this[_0xacaa('0xe')]=_0x3f8641[_0xacaa('0xe')]||'';}module[_0xacaa('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 041a39d..c9b291b 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 _0x0817=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x4a93a2,_0x2327de){var _0xc875b1=function(_0x7263c3){while(--_0x7263c3){_0x4a93a2['push'](_0x4a93a2['shift']());}};_0xc875b1(++_0x2327de);}(_0x0817,0xa8));var _0x7081=function(_0x1cd919,_0x408263){_0x1cd919=_0x1cd919-0x0;var _0x2ea8be=_0x0817[_0x1cd919];return _0x2ea8be;};'use strict';function voiceExtension(_0x2a62d2){this['id']=_0x2a62d2['id']||0x0;this['exten']=_0x2a62d2[_0x7081('0x0')]||'';this[_0x7081('0x1')]=_0x2a62d2[_0x7081('0x1')]||_0x7081('0x2');this['mandatoryDisposition']=_0x2a62d2[_0x7081('0x3')]||![];}module[_0x7081('0x4')]=voiceExtension; \ No newline at end of file +var _0x1bd9=['exports','recordingFormat','none','mandatoryDisposition'];(function(_0x7b00da,_0x42f27d){var _0x3745ed=function(_0x1f514a){while(--_0x1f514a){_0x7b00da['push'](_0x7b00da['shift']());}};_0x3745ed(++_0x42f27d);}(_0x1bd9,0x15d));var _0x91bd=function(_0x4f85e2,_0x53bc59){_0x4f85e2=_0x4f85e2-0x0;var _0x2c11c7=_0x1bd9[_0x4f85e2];return _0x2c11c7;};'use strict';function voiceExtension(_0x590f95){this['id']=_0x590f95['id']||0x0;this['exten']=_0x590f95['exten']||'';this[_0x91bd('0x0')]=_0x590f95['recordingFormat']||_0x91bd('0x1');this[_0x91bd('0x2')]=_0x590f95[_0x91bd('0x2')]||![];}module[_0x91bd('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 90a1e90..6156009 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 _0x8cc3=['roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','leastrecent','random','ringall'];(function(_0x4c7a16,_0x55d676){var _0x25d1d4=function(_0x5724ce){while(--_0x5724ce){_0x4c7a16['push'](_0x4c7a16['shift']());}};_0x25d1d4(++_0x55d676);}(_0x8cc3,0x7a));var _0x38cc=function(_0x2612be,_0xd5c8dc){_0x2612be=_0x2612be-0x0;var _0x28c2c5=_0x8cc3[_0x2612be];return _0x28c2c5;};'use strict';var monitorFormat={'wav':_0x38cc('0x0'),'wav49':_0x38cc('0x1'),'gsm':_0x38cc('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x38cc('0x3'),'linear':'linear','random':_0x38cc('0x4'),'ringall':_0x38cc('0x5'),'rr':_0x38cc('0x6'),'rrmemory':_0x38cc('0x7'),'rrordered':_0x38cc('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0xb4f29){this['id']=_0xb4f29['id']||0x0;this[_0x38cc('0x9')]=_0xb4f29[_0x38cc('0x9')]||'';this['monitor_format']=_0xb4f29[_0x38cc('0xa')]||'';this[_0x38cc('0xb')]=_0xb4f29[_0x38cc('0xb')]||_0x38cc('0xc');this[_0x38cc('0xd')]=0x0;this[_0x38cc('0xe')]=0x0;this[_0x38cc('0xf')]=0x0;this['sumDuration']=0x0;this[_0x38cc('0x10')]=0x0;this['sumBillable']=0x0;this[_0x38cc('0x11')]=0x0;this[_0x38cc('0x12')]=0x0;this[_0x38cc('0x13')]=0x0;this[_0x38cc('0x14')]=0x0;this[_0x38cc('0x15')]=0x0;this[_0x38cc('0x16')]=0x0;this[_0x38cc('0x17')]=0x0;this[_0x38cc('0x18')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x38cc('0x19')]=0x0;this[_0x38cc('0x1a')]=0x0;this[_0x38cc('0x1b')]=0x0;this[_0x38cc('0x1c')]=0x0;this[_0x38cc('0x1d')]=0x0;this[_0x38cc('0x1e')]=_0xb4f29[_0x38cc('0x1e')]||![];this[_0x38cc('0x1f')]=_0xb4f29['acwTimeout']||0xa;this[_0x38cc('0x20')]=_0xb4f29[_0x38cc('0x20')]||'no';this[_0x38cc('0x21')]=!![];this[_0x38cc('0x22')]='';this[_0x38cc('0x23')]='';this[_0x38cc('0x24')]=0x0;this['temp']=0x0;this[_0x38cc('0x25')]=_0xb4f29[_0x38cc('0x25')]||null;this[_0x38cc('0x26')]=_0xb4f29[_0x38cc('0x26')]?_0xb4f29[_0x38cc('0x26')]:null;this['dialActive']=_0xb4f29[_0x38cc('0x27')];this['dialMethod']=_0xb4f29[_0x38cc('0x28')]||_0x38cc('0x29');this['dialLimitChannel']=_0xb4f29[_0x38cc('0x2a')]||0x0;this[_0x38cc('0x2b')]=_0xb4f29[_0x38cc('0x2b')]||0x0;this[_0x38cc('0x2c')]=_0xb4f29[_0x38cc('0x2c')]||0x1;this[_0x38cc('0x2d')]=_0xb4f29[_0x38cc('0x2d')]||_0x38cc('0x2e');this['dialPredictiveOptimizationPercentage']=_0xb4f29[_0x38cc('0x2f')]||0.03;this[_0x38cc('0x30')]=_0xb4f29[_0x38cc('0x30')]||0x258;this[_0x38cc('0x31')]=_0xb4f29['dialOriginateCallerIdName']||_0x38cc('0x32');this[_0x38cc('0x33')]=_0xb4f29[_0x38cc('0x33')]||_0x38cc('0x32');this['dialOriginateTimeout']=_0xb4f29[_0x38cc('0x34')]||0x1e;this['dialQueueOptions']=_0xb4f29[_0x38cc('0x35')]||'tTxX';this[_0x38cc('0x36')]=_0xb4f29[_0x38cc('0x36')]||0x3;this[_0x38cc('0x37')]=_0xb4f29[_0x38cc('0x37')]||undefined;this['dialCongestionMaxRetry']=_0xb4f29['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0xb4f29[_0x38cc('0x38')]||0x96;this[_0x38cc('0x39')]=_0xb4f29[_0x38cc('0x39')]||0x3;this[_0x38cc('0x3a')]=_0xb4f29[_0x38cc('0x3a')]||0x96;this[_0x38cc('0x3b')]=_0xb4f29['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0xb4f29[_0x38cc('0x3c')]||0x96;this[_0x38cc('0x3d')]=_0xb4f29[_0x38cc('0x3d')]||0x3;this[_0x38cc('0x3e')]=_0xb4f29['dialNoSuchNumberRetryFrequency']||0x96;this[_0x38cc('0x3f')]=_0xb4f29[_0x38cc('0x3f')]||0x3;this['dialDropRetryFrequency']=_0xb4f29[_0x38cc('0x40')]||0x96;this[_0x38cc('0x41')]=_0xb4f29['dialAbandonedMaxRetry']||0x3;this[_0x38cc('0x42')]=_0xb4f29['dialAbandonedRetryFrequency']||0x96;this[_0x38cc('0x43')]=_0xb4f29[_0x38cc('0x43')]||0x3;this[_0x38cc('0x44')]=_0xb4f29[_0x38cc('0x44')]||0x96;this['dialAgentRejectMaxRetry']=_0xb4f29['dialAgentRejectMaxRetry']||0x3;this[_0x38cc('0x45')]=_0xb4f29[_0x38cc('0x45')]||0x96;this[_0x38cc('0x46')]=_0xb4f29[_0x38cc('0x46')]||0x3;this[_0x38cc('0x47')]=_0xb4f29[_0x38cc('0x47')]||0x4;this[_0x38cc('0x48')]=_0xb4f29[_0x38cc('0x48')]?_0xb4f29[_0x38cc('0x48')]:undefined;this[_0x38cc('0x49')]=_0xb4f29['TrunkBackup']?_0xb4f29[_0x38cc('0x49')]:undefined;this[_0x38cc('0x4a')]=_0xb4f29[_0x38cc('0x4a')]||undefined;this[_0x38cc('0x4b')]=_0xb4f29[_0x38cc('0x4b')]?_0xb4f29[_0x38cc('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0xb4f29[_0x38cc('0x4c')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0xb4f29['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x38cc('0x4d')]=_0xb4f29[_0x38cc('0x4d')]||undefined;this['strategy']=strategy[_0xb4f29['strategy']];this[_0x38cc('0x4e')]=!![];this[_0x38cc('0x4f')]=_0xb4f29[_0x38cc('0x4f')]||![];this[_0x38cc('0x50')]=_0xb4f29[_0x38cc('0x50')];this[_0x38cc('0x51')]=_0xb4f29[_0x38cc('0x51')];this[_0x38cc('0x52')]=_0xb4f29['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0xb4f29['dialAMDTotalAnalysisTime'];this[_0x38cc('0x53')]=_0xb4f29[_0x38cc('0x53')];this[_0x38cc('0x54')]=_0xb4f29[_0x38cc('0x54')];this[_0x38cc('0x55')]=_0xb4f29['dialAMDMaximumNumberOfWords'];this[_0x38cc('0x56')]=_0xb4f29[_0x38cc('0x56')];this['dialAMDMaximumWordLength']=_0xb4f29[_0x38cc('0x57')];this[_0x38cc('0x58')]=0x0;this[_0x38cc('0x59')]=0x0;this[_0x38cc('0x5a')]=_0xb4f29[_0x38cc('0x5a')];this[_0x38cc('0x5b')]=0x0;this[_0x38cc('0x5c')]=0x0;this[_0x38cc('0x5d')]=0x0;this[_0x38cc('0x5e')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x38cc('0x5f')]=0x0;this[_0x38cc('0x60')]=0x0;this[_0x38cc('0x61')]=0x0;this[_0x38cc('0x62')]=0x0;this[_0x38cc('0x63')]=0x0;this[_0x38cc('0x64')]=0x0;this['outboundReCallsDay']=0x0;this[_0x38cc('0x65')]=0x0;this[_0x38cc('0x66')]=undefined;this['startPredictive']=undefined;this[_0x38cc('0x67')]=undefined;this[_0x38cc('0x68')]=1.05;this[_0x38cc('0x69')]=0x0;this[_0x38cc('0x6a')]=0x0;this[_0x38cc('0x6b')]=0x0;this[_0x38cc('0x6c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x38cc('0x6d')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x38cc('0x6e')]=0x0;this[_0x38cc('0x6f')]=_0xb4f29[_0x38cc('0x70')]||0x14;this[_0x38cc('0x71')]=_0xb4f29[_0x38cc('0x70')]||0xa;this[_0x38cc('0x72')]=0x0;this[_0x38cc('0x73')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x38cc('0x74')]=0x0;this[_0x38cc('0x75')]=0x0;this[_0x38cc('0x76')]=_0xb4f29[_0x38cc('0x76')]||0x1e;this[_0x38cc('0x77')]=_0xb4f29[_0x38cc('0x77')]||![];this[_0x38cc('0x78')]=!!_0xb4f29['dialPreviewAutoRecallMe']||![];this[_0x38cc('0x79')]=!!_0xb4f29[_0x38cc('0x79')]||![];this['dialQueueProject2']=_0xb4f29[_0x38cc('0x7a')]||undefined;this[_0x38cc('0x7b')]=_0xb4f29[_0x38cc('0x7b')]||![];this[_0x38cc('0x7c')]=_0xb4f29[_0x38cc('0x7c')]||![];this[_0x38cc('0xa')]=monitorFormat[_0xb4f29[_0x38cc('0xa')]]?monitorFormat[_0xb4f29[_0x38cc('0xa')]]:undefined;this[_0x38cc('0x7d')]=_0xb4f29['mandatoryDisposition']||![];this[_0x38cc('0x7e')]=_0xb4f29[_0x38cc('0x7e')]?_0xb4f29[_0x38cc('0x7e')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x38cc('0x7f')]=VoiceQueue; \ No newline at end of file +var _0xa8a6=['predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','ringall','rrmemory','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','available','inUse','notInUse','unavailable','unknown','acw','acwTimeout','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses'];(function(_0x33a8fb,_0x5256b3){var _0x2b6875=function(_0x14e3c3){while(--_0x14e3c3){_0x33a8fb['push'](_0x33a8fb['shift']());}};_0x2b6875(++_0x5256b3);}(_0xa8a6,0x86));var _0x6a8a=function(_0x1a2871,_0x4ebc1d){_0x1a2871=_0x1a2871-0x0;var _0x5c4719=_0xa8a6[_0x1a2871];return _0x5c4719;};'use strict';var monitorFormat={'wav':_0x6a8a('0x0'),'wav49':_0x6a8a('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x6a8a('0x2'),'leastrecent':_0x6a8a('0x3'),'linear':_0x6a8a('0x4'),'random':'random','ringall':_0x6a8a('0x5'),'rr':'roundrobin','rrmemory':_0x6a8a('0x6'),'rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x37ac55){this['id']=_0x37ac55['id']||0x0;this[_0x6a8a('0x7')]=_0x37ac55[_0x6a8a('0x7')]||'';this[_0x6a8a('0x8')]=_0x37ac55[_0x6a8a('0x8')]||'';this[_0x6a8a('0x9')]=_0x37ac55[_0x6a8a('0x9')]||_0x6a8a('0xa');this['waiting']=0x0;this[_0x6a8a('0xb')]=0x0;this['answered']=0x0;this[_0x6a8a('0xc')]=0x0;this[_0x6a8a('0xd')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x6a8a('0xe')]=0x0;this['busy']=0x0;this[_0x6a8a('0xf')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0x6a8a('0x10')]=0x0;this['onHold']=0x0;this['paused']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0x6a8a('0x11')]=0x0;this[_0x6a8a('0x12')]=0x0;this[_0x6a8a('0x13')]=_0x37ac55[_0x6a8a('0x13')]||![];this[_0x6a8a('0x14')]=_0x37ac55[_0x6a8a('0x14')]||0xa;this['autopause']=_0x37ac55['autopause']||'no';this[_0x6a8a('0x15')]=!![];this[_0x6a8a('0x16')]='';this[_0x6a8a('0x17')]='';this[_0x6a8a('0x18')]=0x0;this[_0x6a8a('0x19')]=0x0;this[_0x6a8a('0x1a')]=_0x37ac55[_0x6a8a('0x1a')]||null;this[_0x6a8a('0x1b')]=_0x37ac55[_0x6a8a('0x1b')]?_0x37ac55['dialGlobalInterval']:null;this['dialActive']=_0x37ac55['dialActive'];this['dialMethod']=_0x37ac55[_0x6a8a('0x1c')]||_0x6a8a('0x1d');this[_0x6a8a('0x1e')]=_0x37ac55[_0x6a8a('0x1e')]||0x0;this['dialLimitQueue']=_0x37ac55[_0x6a8a('0x1f')]||0x0;this[_0x6a8a('0x20')]=_0x37ac55[_0x6a8a('0x20')]||0x1;this['dialPredictiveOptimization']=_0x37ac55['dialPredictiveOptimization']||_0x6a8a('0x21');this['dialPredictiveOptimizationPercentage']=_0x37ac55[_0x6a8a('0x22')]||0.03;this[_0x6a8a('0x23')]=_0x37ac55[_0x6a8a('0x23')]||0x258;this[_0x6a8a('0x24')]=_0x37ac55[_0x6a8a('0x24')]||_0x6a8a('0x25');this[_0x6a8a('0x26')]=_0x37ac55[_0x6a8a('0x26')]||_0x6a8a('0x25');this['dialOriginateTimeout']=_0x37ac55[_0x6a8a('0x27')]||0x1e;this[_0x6a8a('0x28')]=_0x37ac55['dialQueueOptions']||_0x6a8a('0x29');this[_0x6a8a('0x2a')]=_0x37ac55[_0x6a8a('0x2a')]||0x3;this[_0x6a8a('0x2b')]=_0x37ac55[_0x6a8a('0x2b')]||undefined;this[_0x6a8a('0x2c')]=_0x37ac55[_0x6a8a('0x2c')]||0x3;this[_0x6a8a('0x2d')]=_0x37ac55[_0x6a8a('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x37ac55[_0x6a8a('0x2e')]||0x3;this[_0x6a8a('0x2f')]=_0x37ac55[_0x6a8a('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x37ac55['dialNoAnswerMaxRetry']||0x3;this[_0x6a8a('0x30')]=_0x37ac55[_0x6a8a('0x30')]||0x96;this[_0x6a8a('0x31')]=_0x37ac55[_0x6a8a('0x31')]||0x3;this[_0x6a8a('0x32')]=_0x37ac55[_0x6a8a('0x32')]||0x96;this[_0x6a8a('0x33')]=_0x37ac55[_0x6a8a('0x33')]||0x3;this[_0x6a8a('0x34')]=_0x37ac55['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x37ac55[_0x6a8a('0x35')]||0x3;this[_0x6a8a('0x36')]=_0x37ac55[_0x6a8a('0x36')]||0x96;this['dialMachineMaxRetry']=_0x37ac55['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x37ac55[_0x6a8a('0x37')]||0x96;this[_0x6a8a('0x38')]=_0x37ac55['dialAgentRejectMaxRetry']||0x3;this[_0x6a8a('0x39')]=_0x37ac55['dialAgentRejectRetryFrequency']||0x96;this[_0x6a8a('0x3a')]=_0x37ac55[_0x6a8a('0x3a')]||0x3;this[_0x6a8a('0x3b')]=_0x37ac55['dialGlobalMaxRetry']||0x4;this[_0x6a8a('0x3c')]=_0x37ac55[_0x6a8a('0x3c')]?_0x37ac55[_0x6a8a('0x3c')]:undefined;this[_0x6a8a('0x3d')]=_0x37ac55[_0x6a8a('0x3d')]?_0x37ac55[_0x6a8a('0x3d')]:undefined;this[_0x6a8a('0x3e')]=_0x37ac55[_0x6a8a('0x3e')]||undefined;this['Interval']=_0x37ac55['Interval']?_0x37ac55[_0x6a8a('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x37ac55['dialOrderByScheduledAt']||_0x6a8a('0x40');this[_0x6a8a('0x41')]=_0x37ac55['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6a8a('0x42')]=_0x37ac55['dialCutDigit']||undefined;this[_0x6a8a('0x43')]=strategy[_0x37ac55['strategy']];this[_0x6a8a('0x44')]=!![];this[_0x6a8a('0x45')]=_0x37ac55[_0x6a8a('0x45')]||![];this[_0x6a8a('0x46')]=_0x37ac55[_0x6a8a('0x46')];this['dialAMDGreeting']=_0x37ac55[_0x6a8a('0x47')];this[_0x6a8a('0x48')]=_0x37ac55[_0x6a8a('0x48')];this['dialAMDTotalAnalysisTime']=_0x37ac55['dialAMDTotalAnalysisTime'];this[_0x6a8a('0x49')]=_0x37ac55[_0x6a8a('0x49')];this[_0x6a8a('0x4a')]=_0x37ac55['dialAMDBetweenWordsSilence'];this[_0x6a8a('0x4b')]=_0x37ac55[_0x6a8a('0x4b')];this['dialAMDSilenceThreshold']=_0x37ac55[_0x6a8a('0x4c')];this[_0x6a8a('0x4d')]=_0x37ac55[_0x6a8a('0x4d')];this[_0x6a8a('0x4e')]=0x0;this[_0x6a8a('0x4f')]=0x0;this[_0x6a8a('0x50')]=_0x37ac55[_0x6a8a('0x50')];this[_0x6a8a('0x51')]=0x0;this[_0x6a8a('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x6a8a('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x6a8a('0x54')]=0x0;this[_0x6a8a('0x55')]=0x0;this[_0x6a8a('0x56')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x6a8a('0x57')]=0x0;this[_0x6a8a('0x58')]=0x0;this[_0x6a8a('0x59')]=0x0;this[_0x6a8a('0x5a')]=0x0;this[_0x6a8a('0x5b')]=undefined;this['startPredictive']=undefined;this[_0x6a8a('0x5c')]=undefined;this[_0x6a8a('0x5d')]=1.05;this[_0x6a8a('0x5e')]=0x0;this[_0x6a8a('0x5f')]=0x0;this[_0x6a8a('0x60')]=0x0;this[_0x6a8a('0x61')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x6a8a('0x62')]=0x0;this[_0x6a8a('0x63')]=0x0;this[_0x6a8a('0x64')]=0x0;this[_0x6a8a('0x65')]=_0x37ac55['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x6a8a('0x66')]=_0x37ac55[_0x6a8a('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x6a8a('0x68')]=0x1;this[_0x6a8a('0x69')]=0x0;this[_0x6a8a('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x6a8a('0x6b')]=0x0;this[_0x6a8a('0x6c')]=_0x37ac55[_0x6a8a('0x6c')]||0x1e;this[_0x6a8a('0x6d')]=_0x37ac55['dialRecallInQueue']||![];this[_0x6a8a('0x6e')]=!!_0x37ac55[_0x6a8a('0x6e')]||![];this['dialPreviewRecallmeReminder']=!!_0x37ac55['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x37ac55[_0x6a8a('0x6f')]||undefined;this['dialAgiAfterHangupClient']=_0x37ac55['dialAgiAfterHangupClient']||![];this[_0x6a8a('0x70')]=_0x37ac55[_0x6a8a('0x70')]||![];this[_0x6a8a('0x8')]=monitorFormat[_0x37ac55[_0x6a8a('0x8')]]?monitorFormat[_0x37ac55[_0x6a8a('0x8')]]:undefined;this['mandatoryDisposition']=_0x37ac55[_0x6a8a('0x71')]||![];this[_0x6a8a('0x72')]=_0x37ac55[_0x6a8a('0x72')]?_0x37ac55['mandatoryDispositionPause']:undefined;this[_0x6a8a('0x73')]=![];}module[_0x6a8a('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index ecd3e1a..c9a5555 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 _0x8efc=['unavailable','unknown','unmanaged','outbound','pTalking','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','active','callerid','loggedin','callers','length','SIP/','online','includes','status','keys','queue','dialer','xcally-motion-preview','prototype','compareToInboundQueue','compareToOutboundQueue','dialActive','outboundNoSuchCallsDay','preview','exports','loggedInDb','ringing','waiting','available','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','sumDuration','total','name','strategy','abandoned','answered','busy','inUse','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','talking','type'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8efc,0x8f));var _0xc8ef=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x8efc[_0x2fe689];return _0x35ea44;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0xc8ef('0x0'),'paused',_0xc8ef('0x1'),'talking',_0xc8ef('0x2')];var OUTBOUND_COUNTERS=[_0xc8ef('0x3'),'answered','inUse',_0xc8ef('0x4'),'loggedInDb',_0xc8ef('0x5'),_0xc8ef('0x6'),_0xc8ef('0x7'),_0xc8ef('0x8'),_0xc8ef('0x9'),'outboundCongestionCallsDay',_0xc8ef('0xa'),'outboundNoSuchCallsDay',_0xc8ef('0xb'),_0xc8ef('0xc'),_0xc8ef('0xd'),_0xc8ef('0xe'),'pTalking','talking','sumBillable',_0xc8ef('0xf'),_0xc8ef('0x10'),_0xc8ef('0x2')];function VoiceQueueSummary(_0x3518cd){this['id']=_0x3518cd['id'];this['name']=_0x3518cd[_0xc8ef('0x11')];this[_0xc8ef('0x12')]=_0x3518cd[_0xc8ef('0x12')];this[_0xc8ef('0x13')]=_0x3518cd[_0xc8ef('0x13')]||0x0;this[_0xc8ef('0x14')]=_0x3518cd[_0xc8ef('0x14')]||0x0;this[_0xc8ef('0x3')]=_0x3518cd['available']||0x0;this['busy']=_0x3518cd[_0xc8ef('0x15')]||0x0;this[_0xc8ef('0x16')]=_0x3518cd[_0xc8ef('0x16')]||0x0;this[_0xc8ef('0x17')]=_0x3518cd[_0xc8ef('0x17')]||0x0;this[_0xc8ef('0x4')]=_0x3518cd[_0xc8ef('0x4')]||0x0;this[_0xc8ef('0x0')]=_0x3518cd['loggedInDb']||0x0;this['onHold']=_0x3518cd[_0xc8ef('0x18')]||0x0;this[_0xc8ef('0x19')]=_0x3518cd[_0xc8ef('0x19')]||0x0;this[_0xc8ef('0xe')]=_0x3518cd['paused']||0x0;this['ringing']=_0x3518cd['ringing']||0x0;this['ringInUse']=_0x3518cd[_0xc8ef('0x1a')];this['sumBillable']=_0x3518cd[_0xc8ef('0x1b')];this[_0xc8ef('0xf')]=_0x3518cd[_0xc8ef('0xf')];this['sumHoldTime']=_0x3518cd[_0xc8ef('0x1c')]||0x0;this[_0xc8ef('0x1d')]=_0x3518cd[_0xc8ef('0x1d')]||0x0;this[_0xc8ef('0x10')]=_0x3518cd[_0xc8ef('0x10')]||0x0;this[_0xc8ef('0x1e')]=_0x3518cd[_0xc8ef('0x1e')];this[_0xc8ef('0x1f')]=_0x3518cd[_0xc8ef('0x1f')]||0x0;this[_0xc8ef('0x20')]=_0x3518cd[_0xc8ef('0x20')]||0x0;this[_0xc8ef('0x21')]=_0x3518cd['unmanaged']||0x0;this['waiting']=_0x3518cd[_0xc8ef('0x2')]||0x0;if(_0x3518cd[_0xc8ef('0x1e')]===_0xc8ef('0x22')){this[_0xc8ef('0x23')]=_0x3518cd[_0xc8ef('0x23')]||0x0;this['dialActive']=_0x3518cd['dialActive'];this[_0xc8ef('0x24')]=_0x3518cd[_0xc8ef('0x24')];this[_0xc8ef('0x25')]=_0x3518cd['dialOriginateCallerIdName'];this[_0xc8ef('0x26')]=_0x3518cd[_0xc8ef('0x26')];this[_0xc8ef('0x27')]=_0x3518cd[_0xc8ef('0x27')];this['dialPrefix']=_0x3518cd['dialPrefix'];this[_0xc8ef('0x28')]=_0x3518cd[_0xc8ef('0x28')];this[_0xc8ef('0x29')]=_0x3518cd['outboundAnswerAgiCallsDay'];this[_0xc8ef('0x7')]=_0x3518cd[_0xc8ef('0x7')];this[_0xc8ef('0x8')]=_0x3518cd['outboundBlacklistCallsDay'];this[_0xc8ef('0x9')]=_0x3518cd[_0xc8ef('0x9')];this[_0xc8ef('0x2a')]=_0x3518cd[_0xc8ef('0x2a')];this[_0xc8ef('0x2b')]=_0x3518cd['outboundDropCallsDayACS'];this[_0xc8ef('0x2c')]=_0x3518cd['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x3518cd[_0xc8ef('0x2d')];this['outboundNoAnswerCallsDay']=_0x3518cd[_0xc8ef('0xa')];this['outboundNoSuchCallsDay']=_0x3518cd['outboundNoSuchCallsDay'];this[_0xc8ef('0x2e')]=_0x3518cd[_0xc8ef('0x2e')];this[_0xc8ef('0xb')]=_0x3518cd[_0xc8ef('0xb')];this[_0xc8ef('0xc')]=_0x3518cd[_0xc8ef('0xc')];this['outboundUnknownCallsDay']=_0x3518cd[_0xc8ef('0xd')];this[_0xc8ef('0x2f')]=_0x3518cd['predictiveIntervalAnsweredCalls'];this[_0xc8ef('0x30')]=_0x3518cd['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x3518cd[_0xc8ef('0x31')];this[_0xc8ef('0x32')]=_0x3518cd[_0xc8ef('0x32')];this[_0xc8ef('0x33')]=_0x3518cd['predictiveIntervalDroppedCallsTimeout'];this[_0xc8ef('0x34')]=_0x3518cd[_0xc8ef('0x34')];this[_0xc8ef('0x35')]=_0x3518cd[_0xc8ef('0x35')];this[_0xc8ef('0x36')]=_0x3518cd[_0xc8ef('0x36')];this[_0xc8ef('0x37')]=_0x3518cd['predictiveIntervalMultiplicativeFactor'];this[_0xc8ef('0x38')]=_0x3518cd['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x3518cd[_0xc8ef('0x39')];this[_0xc8ef('0x3a')]=_0x3518cd[_0xc8ef('0x3a')];this[_0xc8ef('0x5')]=_0x3518cd[_0xc8ef('0x5')];this[_0xc8ef('0x3b')]=_0x3518cd[_0xc8ef('0x3b')];this[_0xc8ef('0x3c')]=_0x3518cd[_0xc8ef('0x3c')];this[_0xc8ef('0x3d')]=_0x3518cd[_0xc8ef('0x3d')];this[_0xc8ef('0x3e')]=_0x3518cd[_0xc8ef('0x3e')];this['startPredictive']=_0x3518cd['startPredictive'];this[_0xc8ef('0x3f')]=_0x3518cd[_0xc8ef('0x3f')];this[_0xc8ef('0x40')]=_0x3518cd[_0xc8ef('0x40')];this[_0xc8ef('0x41')]=_0x3518cd['statusMessage'];}if(_0x3518cd[_0xc8ef('0x42')]){this[_0xc8ef('0x42')]={'id':_0x3518cd['Trunk']['id'],'name':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x11')],'active':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x43')],'callerid':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x44')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x23d924,_0x4698f6,_0x14fdc8,_0x1d59b1){this['loggedInDb']=0x0;this[_0xc8ef('0x1d')]=0x0;this[_0xc8ef('0xe')]=0x0;this['unknown']=0x0;this[_0xc8ef('0x19')]=0x0;this[_0xc8ef('0x16')]=0x0;this[_0xc8ef('0x15')]=0x0;this[_0xc8ef('0x17')]=0x0;this['unavailable']=0x0;this[_0xc8ef('0x1')]=0x0;this[_0xc8ef('0x1a')]=0x0;this[_0xc8ef('0x18')]=0x0;if(_0x14fdc8){if(_0x14fdc8[_0xc8ef('0x3')]){this[_0xc8ef('0x3')]=Number(_0x14fdc8[_0xc8ef('0x3')]);}if(_0x14fdc8[_0xc8ef('0x45')]){this[_0xc8ef('0x4')]=Number(_0x14fdc8[_0xc8ef('0x45')]);}if(_0x14fdc8[_0xc8ef('0x46')]){this[_0xc8ef('0x2')]=Number(_0x14fdc8[_0xc8ef('0x46')]);}}for(var _0x2667a4=0x0;_0x2667a4<_0x23d924[_0xc8ef('0x47')];_0x2667a4++){var _0x10aa0d=_0x4698f6[_0xc8ef('0x48')+_0x23d924[_0x2667a4]['name']];if(_0x10aa0d&&_0x10aa0d[_0xc8ef('0x49')]){this[_0xc8ef('0x0')]+=0x1;}if(_0x23d924[_0x2667a4]['incall']==='1'){this[_0xc8ef('0x1d')]+=0x1;}if(_0x23d924[_0x2667a4]['paused']==='1'&&!['2','7','8'][_0xc8ef('0x4a')](_0x23d924[_0x2667a4]['status'])){this[_0xc8ef('0xe')]+=0x1;}switch(_0x23d924[_0x2667a4][_0xc8ef('0x4b')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xc8ef('0x17')]+=0x1;break;case'5':this[_0xc8ef('0x1f')]+=0x1;break;case'6':this[_0xc8ef('0x1')]+=0x1;break;case'7':this[_0xc8ef('0x1a')]+=0x1;break;case'8':this[_0xc8ef('0x18')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x55063d=Object[_0xc8ef('0x4c')](_0x1d59b1);for(var _0x3517a8=0x0;_0x3517a8<_0x55063d[_0xc8ef('0x47')];_0x3517a8++){var _0x427e72=_0x55063d[_0x3517a8];var _0x331f3b=_0x1d59b1[_0x427e72];if(_0x331f3b[_0xc8ef('0x4d')]===this['name']&&_0x331f3b[_0xc8ef('0x1e')]===_0xc8ef('0x4e')&&_0x331f3b['exten']===_0xc8ef('0x4f')){this['talking']+=0x1;}}if(this[_0xc8ef('0x1d')]>this['inUse']){this['talking']=this[_0xc8ef('0x16')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xc8ef('0x50')][_0xc8ef('0x51')]=function(_0x71fa5){var _0x226713=![];if(_0x71fa5){_0x226713=INBOUND_COUNTERS['some'](function(_0x2a15fb){return this[_0x2a15fb]!==_0x71fa5[_0x2a15fb];},this);}return _0x226713;};VoiceQueueSummary[_0xc8ef('0x50')][_0xc8ef('0x52')]=function(_0x5ae3ae){var _0x987dc7=![];var _0x5bdef1=![];var _0x472f65=![];if(_0x5ae3ae){_0x987dc7=this[_0xc8ef('0x24')]!==_0x5ae3ae[_0xc8ef('0x24')]||this[_0xc8ef('0x53')]!==_0x5ae3ae[_0xc8ef('0x53')]||this[_0xc8ef('0x40')]!==_0x5ae3ae[_0xc8ef('0x40')]||this[_0xc8ef('0x41')]!==_0x5ae3ae[_0xc8ef('0x41')];_0x5bdef1=OUTBOUND_COUNTERS['some'](function(_0x599cf1){return this[_0x599cf1]!==_0x5ae3ae[_0x599cf1];},this);if(this[_0xc8ef('0x42')]&&_0x5ae3ae['Trunk']){_0x472f65=this[_0xc8ef('0x42')]['name']!==_0x5ae3ae['Trunk'][_0xc8ef('0x11')]||this['Trunk']['active']!==_0x5ae3ae[_0xc8ef('0x42')]['active'];}}return _0x987dc7||_0x5bdef1||_0x472f65;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x201b4c){this['answered']=_0x201b4c['answered'];this[_0xc8ef('0x40')]=_0x201b4c['message'];this['statusMessage']=_0x201b4c[_0xc8ef('0x41')];this[_0xc8ef('0x5')]=_0x201b4c[_0xc8ef('0x5')];this[_0xc8ef('0x6')]=_0x201b4c[_0xc8ef('0x6')];this['outboundAnswerCallsDay']=_0x201b4c['outboundAnswerCallsDay'];this[_0xc8ef('0x8')]=_0x201b4c[_0xc8ef('0x8')];this['outboundBusyCallsDay']=_0x201b4c[_0xc8ef('0x9')];this[_0xc8ef('0x2a')]=_0x201b4c['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x201b4c['outboundNoAnswerCallsDay'];this[_0xc8ef('0x54')]=_0x201b4c['outboundNoSuchCallsDay'];this[_0xc8ef('0xb')]=_0x201b4c[_0xc8ef('0xb')];this[_0xc8ef('0xc')]=_0x201b4c[_0xc8ef('0xc')];this['outboundUnknownCallsDay']=_0x201b4c[_0xc8ef('0xd')];this[_0xc8ef('0x1b')]=_0x201b4c['sumBillable'];this[_0xc8ef('0xf')]=_0x201b4c[_0xc8ef('0xf')];this[_0xc8ef('0x10')]=_0x201b4c[_0xc8ef('0x10')];if(this[_0xc8ef('0x24')]===_0xc8ef('0x55')){this['pTalking']=_0x201b4c['pTalking'];}};module[_0xc8ef('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0x9973=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','unavailable','unknown','unmanaged','type','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','incall','status','booked','keys','length','queue','dialer','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','loggedIn','loggedInDb','ringing','talking','waiting','available','answered','inUse','outboundAbandonedCallsDay'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x9973,0x157));var _0x3997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9973[_0x40a045];return _0x1a687c;};'use strict';var INBOUND_COUNTERS=['available',_0x3997('0x0'),_0x3997('0x1'),'paused',_0x3997('0x2'),_0x3997('0x3'),_0x3997('0x4')];var OUTBOUND_COUNTERS=[_0x3997('0x5'),_0x3997('0x6'),_0x3997('0x7'),_0x3997('0x0'),'loggedInDb','originated',_0x3997('0x8'),_0x3997('0x9'),_0x3997('0xa'),'outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0x3997('0xb'),_0x3997('0xc'),_0x3997('0xd'),_0x3997('0xe'),_0x3997('0xf'),_0x3997('0x10'),_0x3997('0x3'),_0x3997('0x11'),_0x3997('0x12'),_0x3997('0x13'),_0x3997('0x4')];function VoiceQueueSummary(_0xaed665){this['id']=_0xaed665['id'];this[_0x3997('0x14')]=_0xaed665[_0x3997('0x14')];this[_0x3997('0x15')]=_0xaed665[_0x3997('0x15')];this[_0x3997('0x16')]=_0xaed665[_0x3997('0x16')]||0x0;this[_0x3997('0x6')]=_0xaed665[_0x3997('0x6')]||0x0;this[_0x3997('0x5')]=_0xaed665[_0x3997('0x5')]||0x0;this[_0x3997('0x17')]=_0xaed665['busy']||0x0;this[_0x3997('0x7')]=_0xaed665[_0x3997('0x7')]||0x0;this[_0x3997('0x18')]=_0xaed665[_0x3997('0x18')]||0x0;this['loggedIn']=_0xaed665[_0x3997('0x0')]||0x0;this[_0x3997('0x1')]=_0xaed665['loggedInDb']||0x0;this['onHold']=_0xaed665[_0x3997('0x19')]||0x0;this[_0x3997('0x1a')]=_0xaed665['notInUse']||0x0;this[_0x3997('0xf')]=_0xaed665[_0x3997('0xf')]||0x0;this[_0x3997('0x2')]=_0xaed665[_0x3997('0x2')]||0x0;this[_0x3997('0x1b')]=_0xaed665['ringInUse'];this[_0x3997('0x11')]=_0xaed665[_0x3997('0x11')];this[_0x3997('0x12')]=_0xaed665['sumDuration'];this[_0x3997('0x1c')]=_0xaed665[_0x3997('0x1c')]||0x0;this['talking']=_0xaed665[_0x3997('0x3')]||0x0;this[_0x3997('0x13')]=_0xaed665[_0x3997('0x13')]||0x0;this['type']=_0xaed665['type'];this[_0x3997('0x1d')]=_0xaed665[_0x3997('0x1d')]||0x0;this[_0x3997('0x1e')]=_0xaed665[_0x3997('0x1e')]||0x0;this['unmanaged']=_0xaed665[_0x3997('0x1f')]||0x0;this['waiting']=_0xaed665['waiting']||0x0;if(_0xaed665[_0x3997('0x20')]===_0x3997('0x21')){this['pTalking']=_0xaed665['pTalking']||0x0;this[_0x3997('0x22')]=_0xaed665[_0x3997('0x22')];this[_0x3997('0x23')]=_0xaed665['dialMethod'];this['dialOriginateCallerIdName']=_0xaed665['dialOriginateCallerIdName'];this[_0x3997('0x24')]=_0xaed665[_0x3997('0x24')];this[_0x3997('0x25')]=_0xaed665[_0x3997('0x25')];this[_0x3997('0x26')]=_0xaed665[_0x3997('0x26')];this['temp']=_0xaed665['temp'];this[_0x3997('0x27')]=_0xaed665[_0x3997('0x27')];this['outboundAnswerCallsDay']=_0xaed665[_0x3997('0x9')];this[_0x3997('0xa')]=_0xaed665[_0x3997('0xa')];this[_0x3997('0x28')]=_0xaed665[_0x3997('0x28')];this[_0x3997('0x29')]=_0xaed665['outboundCongestionCallsDay'];this[_0x3997('0x2a')]=_0xaed665[_0x3997('0x2a')];this[_0x3997('0x2b')]=_0xaed665[_0x3997('0x2b')];this[_0x3997('0x2c')]=_0xaed665['outboundDropCallsDayTimeout'];this[_0x3997('0x2d')]=_0xaed665[_0x3997('0x2d')];this[_0x3997('0xb')]=_0xaed665[_0x3997('0xb')];this[_0x3997('0x2e')]=_0xaed665[_0x3997('0x2e')];this['outboundReCallsDay']=_0xaed665[_0x3997('0xc')];this[_0x3997('0xd')]=_0xaed665[_0x3997('0xd')];this[_0x3997('0xe')]=_0xaed665[_0x3997('0xe')];this[_0x3997('0x2f')]=_0xaed665[_0x3997('0x2f')];this[_0x3997('0x30')]=_0xaed665[_0x3997('0x30')];this[_0x3997('0x31')]=_0xaed665[_0x3997('0x31')];this[_0x3997('0x32')]=_0xaed665[_0x3997('0x32')];this[_0x3997('0x33')]=_0xaed665[_0x3997('0x33')];this['predictiveIntervalErlangCalls']=_0xaed665[_0x3997('0x34')];this[_0x3997('0x35')]=_0xaed665[_0x3997('0x35')];this[_0x3997('0x36')]=_0xaed665['predictiveIntervalHitRate'];this[_0x3997('0x37')]=_0xaed665[_0x3997('0x37')];this[_0x3997('0x38')]=_0xaed665['predictiveIntervalPauses'];this[_0x3997('0x39')]=_0xaed665[_0x3997('0x39')];this[_0x3997('0x3a')]=_0xaed665[_0x3997('0x3a')];this[_0x3997('0x3b')]=_0xaed665[_0x3997('0x3b')];this[_0x3997('0x3c')]=_0xaed665[_0x3997('0x3c')];this['erlangCallToSecond']=_0xaed665[_0x3997('0x3d')];this['erlangAbandonmentRate']=_0xaed665[_0x3997('0x3e')];this[_0x3997('0x3f')]=_0xaed665[_0x3997('0x3f')];this[_0x3997('0x40')]=_0xaed665['startPredictive'];this[_0x3997('0x41')]=_0xaed665[_0x3997('0x41')];this[_0x3997('0x42')]=_0xaed665[_0x3997('0x42')];this['statusMessage']=_0xaed665[_0x3997('0x43')];}if(_0xaed665['Trunk']){this[_0x3997('0x44')]={'id':_0xaed665[_0x3997('0x44')]['id'],'name':_0xaed665[_0x3997('0x44')][_0x3997('0x14')],'active':_0xaed665[_0x3997('0x44')][_0x3997('0x45')],'callerid':_0xaed665[_0x3997('0x44')]['callerid']};}}VoiceQueueSummary[_0x3997('0x46')][_0x3997('0x47')]=function(_0x92bcf1,_0x3fd51a,_0x536fd7,_0x5ebe60){this[_0x3997('0x1')]=0x0;this['talking']=0x0;this[_0x3997('0xf')]=0x0;this[_0x3997('0x1e')]=0x0;this[_0x3997('0x1a')]=0x0;this[_0x3997('0x7')]=0x0;this['busy']=0x0;this[_0x3997('0x18')]=0x0;this[_0x3997('0x1d')]=0x0;this['ringing']=0x0;this[_0x3997('0x1b')]=0x0;this[_0x3997('0x19')]=0x0;if(_0x536fd7){if(_0x536fd7[_0x3997('0x5')]){this[_0x3997('0x5')]=Number(_0x536fd7[_0x3997('0x5')]);}if(_0x536fd7[_0x3997('0x48')]){this['loggedIn']=Number(_0x536fd7['loggedin']);}if(_0x536fd7['callers']){this[_0x3997('0x4')]=Number(_0x536fd7[_0x3997('0x49')]);}}for(var _0x2a3bfb=0x0;_0x2a3bfb<_0x92bcf1['length'];_0x2a3bfb++){var _0x33a084=_0x3fd51a['SIP/'+_0x92bcf1[_0x2a3bfb]['name']];if(_0x33a084&&_0x33a084['online']){this[_0x3997('0x1')]+=0x1;}if(_0x92bcf1[_0x2a3bfb][_0x3997('0x4a')]==='1'){this[_0x3997('0x3')]+=0x1;}if(_0x92bcf1[_0x2a3bfb][_0x3997('0xf')]==='1'&&!['2','7','8']['includes'](_0x92bcf1[_0x2a3bfb][_0x3997('0x4b')])){this['paused']+=0x1;}switch(_0x92bcf1[_0x2a3bfb][_0x3997('0x4b')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x3997('0x1a')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x3997('0x17')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x3997('0x1d')]+=0x1;break;case'6':this[_0x3997('0x2')]+=0x1;break;case'7':this[_0x3997('0x1b')]+=0x1;break;case'8':this[_0x3997('0x19')]+=0x1;break;}}if(this[_0x3997('0x23')]===_0x3997('0x4c')){var _0x52e5c8=Object[_0x3997('0x4d')](_0x5ebe60);for(var _0x260170=0x0;_0x260170<_0x52e5c8[_0x3997('0x4e')];_0x260170++){var _0x271a41=_0x52e5c8[_0x260170];var _0x236b33=_0x5ebe60[_0x271a41];if(_0x236b33[_0x3997('0x4f')]===this['name']&&_0x236b33['type']===_0x3997('0x50')&&_0x236b33['exten']===_0x3997('0x51')){this['talking']+=0x1;}}if(this[_0x3997('0x3')]>this[_0x3997('0x7')]){this[_0x3997('0x3')]=this[_0x3997('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0x3997('0x52')]=function(_0x4da5a0){var _0x30234e=![];if(_0x4da5a0){_0x30234e=INBOUND_COUNTERS[_0x3997('0x53')](function(_0x14962a){return this[_0x14962a]!==_0x4da5a0[_0x14962a];},this);}return _0x30234e;};VoiceQueueSummary[_0x3997('0x46')][_0x3997('0x54')]=function(_0x1f6d39){var _0x2af697=![];var _0x5fad18=![];var _0x55dee3=![];if(_0x1f6d39){_0x2af697=this[_0x3997('0x23')]!==_0x1f6d39[_0x3997('0x23')]||this[_0x3997('0x22')]!==_0x1f6d39[_0x3997('0x22')]||this[_0x3997('0x42')]!==_0x1f6d39[_0x3997('0x42')]||this[_0x3997('0x43')]!==_0x1f6d39[_0x3997('0x43')];_0x5fad18=OUTBOUND_COUNTERS['some'](function(_0x6c0c35){return this[_0x6c0c35]!==_0x1f6d39[_0x6c0c35];},this);if(this[_0x3997('0x44')]&&_0x1f6d39[_0x3997('0x44')]){_0x55dee3=this['Trunk'][_0x3997('0x14')]!==_0x1f6d39[_0x3997('0x44')][_0x3997('0x14')]||this[_0x3997('0x44')][_0x3997('0x45')]!==_0x1f6d39[_0x3997('0x44')][_0x3997('0x45')];}}return _0x2af697||_0x5fad18||_0x55dee3;};VoiceQueueSummary[_0x3997('0x46')][_0x3997('0x55')]=function(_0x186463){this[_0x3997('0x6')]=_0x186463['answered'];this[_0x3997('0x42')]=_0x186463[_0x3997('0x42')];this[_0x3997('0x43')]=_0x186463[_0x3997('0x43')];this[_0x3997('0x3b')]=_0x186463[_0x3997('0x3b')];this[_0x3997('0x8')]=_0x186463['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x186463[_0x3997('0x9')];this[_0x3997('0xa')]=_0x186463[_0x3997('0xa')];this[_0x3997('0x28')]=_0x186463['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x186463[_0x3997('0x29')];this[_0x3997('0x2d')]=_0x186463[_0x3997('0x2d')];this[_0x3997('0xb')]=_0x186463[_0x3997('0xb')];this[_0x3997('0xc')]=_0x186463['outboundReCallsDay'];this[_0x3997('0xd')]=_0x186463[_0x3997('0xd')];this['outboundUnknownCallsDay']=_0x186463[_0x3997('0xe')];this[_0x3997('0x11')]=_0x186463[_0x3997('0x11')];this['sumDuration']=_0x186463[_0x3997('0x12')];this[_0x3997('0x13')]=_0x186463[_0x3997('0x13')];if(this['dialMethod']===_0x3997('0x56')){this[_0x3997('0x10')]=_0x186463[_0x3997('0x10')];}};module[_0x3997('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ca201d3..c04e420 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 _0x26e4=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x316da6,_0x14717f){var _0x24a235=function(_0x444f86){while(--_0x444f86){_0x316da6['push'](_0x316da6['shift']());}};_0x24a235(++_0x14717f);}(_0x26e4,0x1be));var _0x426e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x26e4[_0x501510];return _0x1e6ee5;};'use strict';function VtigerAccount(_0x5e8f2b){this['id']=_0x5e8f2b['id']||0x0;this[_0x426e('0x0')]=_0x5e8f2b['name']||'';this[_0x426e('0x1')]=_0x5e8f2b['username']||'';this[_0x426e('0x2')]=_0x5e8f2b['accessKey']||'';this['remoteUri']=_0x5e8f2b[_0x426e('0x3')]||'';this[_0x426e('0x4')]=_0x5e8f2b['serverUrl']||'';this[_0x426e('0x5')]=_0x5e8f2b[_0x426e('0x5')]||{};}module[_0x426e('0x6')]=VtigerAccount; \ No newline at end of file +var _0x7fa6=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x402070,_0x4f1dd5){var _0x4bfc14=function(_0x376a90){while(--_0x376a90){_0x402070['push'](_0x402070['shift']());}};_0x4bfc14(++_0x4f1dd5);}(_0x7fa6,0x10c));var _0x67fa=function(_0x49a3b7,_0x5d2586){_0x49a3b7=_0x49a3b7-0x0;var _0x569e43=_0x7fa6[_0x49a3b7];return _0x569e43;};'use strict';function VtigerAccount(_0x477adc){this['id']=_0x477adc['id']||0x0;this[_0x67fa('0x0')]=_0x477adc[_0x67fa('0x0')]||'';this[_0x67fa('0x1')]=_0x477adc['username']||'';this['accessKey']=_0x477adc[_0x67fa('0x2')]||'';this[_0x67fa('0x3')]=_0x477adc['remoteUri']||'';this[_0x67fa('0x4')]=_0x477adc['serverUrl']||'';this[_0x67fa('0x5')]=_0x477adc['Configurations']||{};}module[_0x67fa('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 a06b22c..c4bfb91 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 _0xadaf=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xadaf,0x14c));var _0xfada=function(_0x3d1769,_0x49d66e){_0x3d1769=_0x3d1769-0x0;var _0x44f99c=_0xadaf[_0x3d1769];return _0x44f99c;};'use strict';function ZendeskAccount(_0x115367){this['id']=_0x115367['id']||0x0;this[_0xfada('0x0')]=_0x115367[_0xfada('0x0')]||'';this['username']=_0x115367[_0xfada('0x1')]||'';this[_0xfada('0x2')]=_0x115367[_0xfada('0x2')]||'';this[_0xfada('0x3')]=_0x115367[_0xfada('0x3')]||'';this[_0xfada('0x4')]=_0x115367['remoteUri']||'';this[_0xfada('0x5')]=_0x115367['authType']||'';this[_0xfada('0x6')]=_0x115367['type']||_0xfada('0x7');this[_0xfada('0x8')]=_0x115367[_0xfada('0x8')]||'';this[_0xfada('0x9')]=_0x115367['Configurations']||{};}module[_0xfada('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xbde2=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbde2,0x159));var _0x2bde=function(_0x585ccf,_0x5ced1b){_0x585ccf=_0x585ccf-0x0;var _0x22ff0c=_0xbde2[_0x585ccf];return _0x22ff0c;};'use strict';function ZendeskAccount(_0x5b7379){this['id']=_0x5b7379['id']||0x0;this[_0x2bde('0x0')]=_0x5b7379[_0x2bde('0x0')]||'';this[_0x2bde('0x1')]=_0x5b7379['username']||'';this[_0x2bde('0x2')]=_0x5b7379['password']||'';this[_0x2bde('0x3')]=_0x5b7379[_0x2bde('0x3')]||'';this[_0x2bde('0x4')]=_0x5b7379[_0x2bde('0x4')]||'';this[_0x2bde('0x5')]=_0x5b7379['authType']||'';this[_0x2bde('0x6')]=_0x5b7379[_0x2bde('0x6')]||_0x2bde('0x7');this[_0x2bde('0x8')]=_0x5b7379[_0x2bde('0x8')]||'';this['Configurations']=_0x5b7379[_0x2bde('0x9')]||{};}module[_0x2bde('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 7acca9e..7840567 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 _0x681e=['code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x1507ec,_0x715c90){var _0x35b4db=function(_0x166226){while(--_0x166226){_0x1507ec['push'](_0x1507ec['shift']());}};_0x35b4db(++_0x715c90);}(_0x681e,0x161));var _0xe681=function(_0x3838ef,_0x48962d){_0x3838ef=_0x3838ef-0x0;var _0x13894=_0x681e[_0x3838ef];return _0x13894;};'use strict';function ZohoAccount(_0x2e8ddf){this['id']=_0x2e8ddf['id']||0x0;this[_0xe681('0x0')]=_0x2e8ddf[_0xe681('0x0')]||'';this[_0xe681('0x1')]=_0x2e8ddf[_0xe681('0x1')]||'';this[_0xe681('0x2')]=_0x2e8ddf[_0xe681('0x2')]||'';this[_0xe681('0x3')]=_0x2e8ddf[_0xe681('0x3')]||'';this[_0xe681('0x4')]=_0x2e8ddf[_0xe681('0x4')]||'';this[_0xe681('0x5')]=_0x2e8ddf[_0xe681('0x5')]||'';this[_0xe681('0x6')]=_0x2e8ddf[_0xe681('0x6')]||'';this[_0xe681('0x7')]=_0x2e8ddf[_0xe681('0x7')]||'';this['refreshToken']=_0x2e8ddf[_0xe681('0x8')]||'';this[_0xe681('0x9')]=_0x2e8ddf[_0xe681('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x1aca=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x3883a9,_0x50a35f){var _0x5c8cce=function(_0x4cdec3){while(--_0x4cdec3){_0x3883a9['push'](_0x3883a9['shift']());}};_0x5c8cce(++_0x50a35f);}(_0x1aca,0x1d8));var _0xa1ac=function(_0x2e3ebb,_0x5afc59){_0x2e3ebb=_0x2e3ebb-0x0;var _0x8f027f=_0x1aca[_0x2e3ebb];return _0x8f027f;};'use strict';function ZohoAccount(_0x2af686){this['id']=_0x2af686['id']||0x0;this[_0xa1ac('0x0')]=_0x2af686[_0xa1ac('0x0')]||'';this['description']=_0x2af686[_0xa1ac('0x1')]||'';this[_0xa1ac('0x2')]=_0x2af686[_0xa1ac('0x2')]||'';this[_0xa1ac('0x3')]=_0x2af686[_0xa1ac('0x3')]||'';this[_0xa1ac('0x4')]=_0x2af686[_0xa1ac('0x4')]||'';this[_0xa1ac('0x5')]=_0x2af686[_0xa1ac('0x5')]||'';this[_0xa1ac('0x6')]=_0x2af686['serverUrl']||'';this[_0xa1ac('0x7')]=_0x2af686[_0xa1ac('0x7')]||'';this['refreshToken']=_0x2af686['refreshToken']||'';this[_0xa1ac('0x8')]=_0x2af686['Configurations']||{};}module[_0xa1ac('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index d523231..4fed024 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 _0x8f4c=['lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util'];(function(_0x36212c,_0x546f6a){var _0x1c911c=function(_0x1e6ed4){while(--_0x1e6ed4){_0x36212c['push'](_0x36212c['shift']());}};_0x1c911c(++_0x546f6a);}(_0x8f4c,0x113));var _0xc8f4=function(_0xa74d52,_0x430427){_0xa74d52=_0xa74d52-0x0;var _0x1e1247=_0x8f4c[_0xa74d52];return _0x1e1247;};'use strict';var util=require(_0xc8f4('0x0'));var _=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));function checkNameSurname(_0x43926b,_0x19893b,_0x134d73){var _0x580083='';if(!_[_0xc8f4('0x3')](_0x19893b)&&_0xc8f4('0x4')===typeof _0x19893b){_0x580083+=_0x19893b;}if(!_[_0xc8f4('0x3')](_0x134d73)&&'string'===typeof _0x134d73){_0x580083+='\x20'+_0x134d73;}if(_0x580083!==''){return _0x580083;}return _0x43926b;}function Action(_0x32cd80,_0x5208da,_0x4c86f8,_0x520063,_0x373506){this['uniqueid']=_0x4c86f8||undefined;this[_0xc8f4('0x5')]=_0x32cd80['id'];this[_0xc8f4('0x6')]=_0x5208da[_0xc8f4('0x7')];this[_0xc8f4('0x8')]=_0x5208da[_0xc8f4('0x8')];this['campaigntype']=_0xc8f4('0x6');this[_0xc8f4('0x9')]=![];this[_0xc8f4('0xa')]=_[_0xc8f4('0x3')](_0x32cd80['Agent'])?undefined:_0x32cd80[_0xc8f4('0xb')]['name'];this[_0xc8f4('0xc')]=this[_0xc8f4('0xa')]?util[_0xc8f4('0xd')](_0xc8f4('0xe'),this[_0xc8f4('0xa')]):_0x520063||undefined;this['calleridname']=checkNameSurname(_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x10')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x11')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x12')]);this['active']=_0x32cd80[_0xc8f4('0x13')]||![];this[_0xc8f4('0x14')]=_0x32cd80[_0xc8f4('0x10')];this[_0xc8f4('0x15')]=_0x32cd80[_0xc8f4('0x15')];this['countbusyretry']=_0x32cd80[_0xc8f4('0x16')]||0x0;this['countcongestionretry']=_0x32cd80['countcongestionretry']||0x0;this[_0xc8f4('0x17')]=_0x32cd80[_0xc8f4('0x17')]||0x0;this[_0xc8f4('0x18')]=(_0x32cd80[_0xc8f4('0x16')]||0x0)+(_0x32cd80[_0xc8f4('0x19')]||0x0)+(_0x32cd80[_0xc8f4('0x17')]||0x0)+(_0x32cd80[_0xc8f4('0x1a')]||0x0)+(_0x32cd80[_0xc8f4('0x1b')]||0x0)+(_0x32cd80[_0xc8f4('0x1c')]||0x0)+(_0x32cd80[_0xc8f4('0x1d')]||0x0)+(_0x32cd80[_0xc8f4('0x1e')]||0x0);this[_0xc8f4('0x1a')]=_0x32cd80[_0xc8f4('0x1a')]||0x0;this['countdropretry']=_0x32cd80[_0xc8f4('0x1b')]||0x0;this[_0xc8f4('0x1c')]=_0x32cd80[_0xc8f4('0x1c')]||0x0;this[_0xc8f4('0x1d')]=_0x32cd80[_0xc8f4('0x1d')]||0x0;this[_0xc8f4('0x1e')]=_0x32cd80[_0xc8f4('0x1e')]||0x0;this[_0xc8f4('0x1f')]=_0x32cd80['callback'];this[_0xc8f4('0x20')]=_0x32cd80[_0xc8f4('0x20')];this[_0xc8f4('0x21')]=_0x32cd80[_0xc8f4('0x21')];this['recallme']=_0x32cd80[_0xc8f4('0x22')];this['ContactId']=_0x32cd80[_0xc8f4('0x23')];this['ListId']=_0x32cd80[_0xc8f4('0x24')];this[_0xc8f4('0x25')]=_['isNil'](_0x32cd80[_0xc8f4('0xb')])?_0x32cd80[_0xc8f4('0x25')]:_0x32cd80[_0xc8f4('0xb')]['id'];this[_0xc8f4('0x26')]=_0x32cd80['VoiceQueueId'];this[_0xc8f4('0x27')]='';this[_0xc8f4('0x28')]='';}Action['prototype'][_0xc8f4('0x29')]=function(){return util[_0xc8f4('0xd')](_0xc8f4('0x2a'),this[_0xc8f4('0x2b')],this[_0xc8f4('0x2c')]);};module[_0xc8f4('0x2d')]=Action; \ No newline at end of file +var _0x4b17=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback'];(function(_0x3c50cd,_0x157d12){var _0x3bec1c=function(_0xe3aee){while(--_0xe3aee){_0x3c50cd['push'](_0x3c50cd['shift']());}};_0x3bec1c(++_0x157d12);}(_0x4b17,0x10f));var _0x74b1=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x4b17[_0x3a07c1];return _0x2bbe15;};'use strict';var util=require(_0x74b1('0x0'));var _=require('lodash');var moment=require(_0x74b1('0x1'));function checkNameSurname(_0x5483a2,_0xd14270,_0x356a31){var _0x547636='';if(!_[_0x74b1('0x2')](_0xd14270)&&'string'===typeof _0xd14270){_0x547636+=_0xd14270;}if(!_['isNil'](_0x356a31)&&_0x74b1('0x3')===typeof _0x356a31){_0x547636+='\x20'+_0x356a31;}if(_0x547636!==''){return _0x547636;}return _0x5483a2;}function Action(_0x30d910,_0x379dcc,_0x3873a6,_0x371c3b,_0x191d2b){this[_0x74b1('0x4')]=_0x3873a6||undefined;this['idContact']=_0x30d910['id'];this[_0x74b1('0x5')]=_0x379dcc[_0x74b1('0x6')];this[_0x74b1('0x7')]=_0x379dcc[_0x74b1('0x7')];this[_0x74b1('0x8')]='queue';this[_0x74b1('0x9')]=![];this[_0x74b1('0xa')]=_['isNil'](_0x30d910[_0x74b1('0xb')])?undefined:_0x30d910[_0x74b1('0xb')][_0x74b1('0x6')];this[_0x74b1('0xc')]=this['membername']?util[_0x74b1('0xd')]('SIP/%s',this['membername']):_0x371c3b||undefined;this[_0x74b1('0xe')]=checkNameSurname(_0x30d910[_0x74b1('0xf')]['phone'],_0x30d910['Contact']['firstName'],_0x30d910[_0x74b1('0xf')]['lastName']);this['active']=_0x30d910[_0x74b1('0x10')]||![];this[_0x74b1('0x11')]=_0x30d910[_0x74b1('0x12')];this[_0x74b1('0x13')]=_0x30d910[_0x74b1('0x13')];this[_0x74b1('0x14')]=_0x30d910['countbusyretry']||0x0;this[_0x74b1('0x15')]=_0x30d910[_0x74b1('0x15')]||0x0;this[_0x74b1('0x16')]=_0x30d910[_0x74b1('0x16')]||0x0;this[_0x74b1('0x17')]=(_0x30d910[_0x74b1('0x14')]||0x0)+(_0x30d910[_0x74b1('0x15')]||0x0)+(_0x30d910['countnoanswerretry']||0x0)+(_0x30d910[_0x74b1('0x18')]||0x0)+(_0x30d910[_0x74b1('0x19')]||0x0)+(_0x30d910['countabandonedretry']||0x0)+(_0x30d910[_0x74b1('0x1a')]||0x0)+(_0x30d910[_0x74b1('0x1b')]||0x0);this[_0x74b1('0x18')]=_0x30d910[_0x74b1('0x18')]||0x0;this[_0x74b1('0x19')]=_0x30d910[_0x74b1('0x19')]||0x0;this[_0x74b1('0x1c')]=_0x30d910[_0x74b1('0x1c')]||0x0;this['countmachineretry']=_0x30d910[_0x74b1('0x1a')]||0x0;this['countagentrejectretry']=_0x30d910['countagentrejectretry']||0x0;this['callback']=_0x30d910[_0x74b1('0x1d')];this[_0x74b1('0x1e')]=_0x30d910[_0x74b1('0x1e')];this[_0x74b1('0x1f')]=_0x30d910[_0x74b1('0x1f')];this['recallme']=_0x30d910[_0x74b1('0x20')];this['ContactId']=_0x30d910[_0x74b1('0x21')];this[_0x74b1('0x22')]=_0x30d910[_0x74b1('0x22')];this[_0x74b1('0x23')]=_[_0x74b1('0x2')](_0x30d910[_0x74b1('0xb')])?_0x30d910[_0x74b1('0x23')]:_0x30d910[_0x74b1('0xb')]['id'];this['VoiceQueueId']=_0x30d910[_0x74b1('0x24')];this[_0x74b1('0x25')]='';this[_0x74b1('0x26')]='';}Action['prototype'][_0x74b1('0x27')]=function(){return util[_0x74b1('0xd')](_0x74b1('0x28'),this[_0x74b1('0xe')],this[_0x74b1('0x29')]);};module[_0x74b1('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ee437fc..dbc404f 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 _0xf3cd=['dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','CAMPAIGN_STATUS','NO_AGENTS_LOGGED','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','answered','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','additional','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countbusyretry','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','verifyAdditionalPhones','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','syncNewExten','actionid','clone','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','INACTIVE','logger','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','dialActive','setMessage'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xf3cd[_0x295314];return _0x584b0c;};'use strict';var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var uuid=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var Redis=require(_0xdf3c('0x4'));var config=require(_0xdf3c('0x5'));var logger=require('../../../config/logger')(_0xdf3c('0x6'));var loggerAction=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var ami=require('../ami');var rpcDb=require(_0xdf3c('0x9'));var cmHopperAdditionalPhone=require(_0xdf3c('0xa'));var Action=require(_0xdf3c('0xb'));var ut=require(_0xdf3c('0xc'));var utils=require(_0xdf3c('0xd'));config[_0xdf3c('0xe')]=_['defaults'](config[_0xdf3c('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdf3c('0xe')]));var Sequence=function(){};Sequence[_0xdf3c('0xf')]['enqueue']=function(_0x1dba4c){this[_0xdf3c('0x10')]=this[_0xdf3c('0x10')]?this[_0xdf3c('0x10')][_0xdf3c('0x11')](_0x1dba4c):_0x1dba4c();};function Preview(_0x1c456b){this[_0xdf3c('0x12')]=new Sequence();this[_0xdf3c('0x13')]=_0x1c456b['voiceQueues'];this[_0xdf3c('0x14')]=_0x1c456b[_0xdf3c('0x14')];this[_0xdf3c('0x15')]={};this[_0xdf3c('0x16')]=_0x1c456b['agents'];this[_0xdf3c('0x17')]=0x0;ami['on'](_0xdf3c('0x18'),this[_0xdf3c('0x19')]['bind'](this));ami['on'](_0xdf3c('0x1a'),this[_0xdf3c('0x1b')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1d'),this[_0xdf3c('0x1e')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1f'),this[_0xdf3c('0x20')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x21'),this['syncNewExten'][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x22'),this[_0xdf3c('0x23')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x24'),this[_0xdf3c('0x25')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x26'),this[_0xdf3c('0x27')][_0xdf3c('0x1c')](this));this[_0xdf3c('0x28')](this[_0xdf3c('0x13')]);}function emit(_0x25487c,_0x5d2390,_0x4d620f){io['to'](_0x25487c)[_0xdf3c('0x29')](_0x5d2390,_0x4d620f);}function emitVoiceQueueChannelRemove(_0x583ce4){logger[_0xdf3c('0x2a')](_0xdf3c('0x2b'),JSON[_0xdf3c('0x2c')](_0x583ce4));emit(util[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x583ce4[_0xdf3c('0x2f')]),'voice_queue_channel:remove',_0x583ce4);io[_0xdf3c('0x29')](_0xdf3c('0x30'),_0x583ce4);}function notSendMessagesQueue(_0x13e3ca){if(_0x13e3ca[_0xdf3c('0x31')]){if(_0x13e3ca[_0xdf3c('0x32')]===0x0&&_0x13e3ca[_0xdf3c('0x33')]===0x0){_0x13e3ca[_0xdf3c('0x31')]=![];_0x13e3ca[_0xdf3c('0x34')]=0x0;_0x13e3ca[_0xdf3c('0x35')]=0x0;_0x13e3ca[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x37')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca[_0xdf3c('0x2f')]+'\x20is\x20not\x20active');}else{_0x13e3ca['message']=utils['CAMPAIGN_STATUS'][_0xdf3c('0x39')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca['name']+_0xdf3c('0x3a'));}}}Preview[_0xdf3c('0xf')][_0xdf3c('0x28')]=function(){var _0x1ccdd4=this;setInterval(function(){_0x1ccdd4['syncCampaigns']();},0x7cf);};Preview[_0xdf3c('0xf')][_0xdf3c('0x3b')]=function(){var _0x5386bf=this['campaignsPreview'];this[_0xdf3c('0x17')]+=0x1;for(var _0x46f0e3 in _0x5386bf){if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&(_0x5386bf[_0x46f0e3]['dialMethod']===_0xdf3c('0x6')||_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x3e'))&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(this[_0xdf3c('0x17')]>0x7){this[_0xdf3c('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x6')&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(_0x5386bf[_0x46f0e3][_0xdf3c('0x40')]){this[_0xdf3c('0x41')](_0x5386bf[_0x46f0e3]);if(_0x5386bf[_0x46f0e3][_0xdf3c('0x42')])this[_0xdf3c('0x43')](_0x5386bf[_0x46f0e3]);}else{notSendMessagesQueue(_0x5386bf[_0x46f0e3]);}}}};Preview['prototype'][_0xdf3c('0x44')]=function(_0x3e7a4b){var _0x5ddd21=this;this['sequence'][_0xdf3c('0x45')](function(){if(!_['isNil'](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b])){loggerAction['info']('[clearZombieChannels][talking]',_0x3e7a4b,'Queue',_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')],_0xdf3c('0x47'),JSON[_0xdf3c('0x2c')](_0x5ddd21['campaignsPreview'][_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x46')]]['originated']),_0xdf3c('0x48'),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]][_0xdf3c('0x33')]),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x49')]),JSON['stringify'](_[_0xdf3c('0x4a')](_0x5ddd21['actions'][_0x3e7a4b],['contactId',_0xdf3c('0x4b'),'VoiceQueueId',_0xdf3c('0x4c')])));return ami['Action']({'action':_0xdf3c('0x4d'),'channel':_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x4e')]})[_0xdf3c('0x4f')](function(_0x3098cb){if(_0x3098cb[_0xdf3c('0x36')]===_0xdf3c('0x50')){setTimeout(function(){if(_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b]){ut[_0xdf3c('0x51')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],'[clearZombieChannel]');if(_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x49')]===!![]){ut['decrementTalkink'](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],_0xdf3c('0x52'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);}ut[_0xdf3c('0x53')]('[Dialer][checkChannel][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);delete _0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b];}},0x2328);}});}});};Preview[_0xdf3c('0xf')]['clearZombieChannels']=function(){var _0x127685=this;loggerAction[_0xdf3c('0x2a')](_0xdf3c('0x54'),_[_0xdf3c('0x55')](this[_0xdf3c('0x15')]));for(var _0x55849e in this[_0xdf3c('0x15')]){if(_0x127685[_0xdf3c('0x15')][_0xdf3c('0x3c')](_0x55849e)){_0x127685[_0xdf3c('0x44')](_0x55849e);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x43')]=function(_0x555389){var _0x4d6349=this;rpcDb[_0xdf3c('0x56')](_0x555389['id'],ut[_0xdf3c('0x57')](this['agents']))['then'](function(_0x269723){if(!_[_0xdf3c('0x58')](_0x269723)){for(var _0x46b2bd=0x0;_0x46b2bd<_0x269723[_0xdf3c('0x59')];_0x46b2bd+=0x1){if(ut[_0xdf3c('0x5a')](_0x269723[_0x46b2bd][_0xdf3c('0x5b')])<_0x555389[_0xdf3c('0x5c')]*0x3c){if(_0x269723[_0x46b2bd][_0xdf3c('0x5d')]&&!_0x269723[_0x46b2bd][_0xdf3c('0x5d')]['voicePause']){_0x4d6349[_0xdf3c('0x5e')](_0x269723[_0x46b2bd]['id'])[_0xdf3c('0x5f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')))[_0xdf3c('0x4f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')));}else{rpcDb['disableContact'](_0x269723[_0x46b2bd]['id']);}}else{var _0x1751a8=new Action(_0x269723[_0x46b2bd],_0x555389);_0x1751a8['starttime']=moment()[_0xdf3c('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x555389[_0xdf3c('0x62')]+=0x1;ut[_0xdf3c('0x63')](_0x1751a8,0x17,_0xdf3c('0x64'));if(_0x555389[_0xdf3c('0x65')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x269723[_0x46b2bd]));rpcDb['createCustomerHistory'](_0x1751a8,_0xdf3c('0x66'));}else{ut['logCustomer'](_0x1751a8,0x16,_0xdf3c('0x67'));rpcDb[_0xdf3c('0x68')](_0x1751a8,_0xdf3c('0x69'));rpcDb[_0xdf3c('0x6a')](_0x1751a8,_0xdf3c('0x69'));}}}}})['catch'](ut['logger2'](_0xdf3c('0x6b')));};Preview[_0xdf3c('0xf')]['setMessage']=function(_0x3b215d){_0x3b215d[_0xdf3c('0x31')]=!![];if(ut[_0xdf3c('0x6c')](_0x3b215d[_0xdf3c('0x6d')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x6f')];}else if(!ut['isActive'](_0x3b215d['dialActive'])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x37')];}else if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x71')])){if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x72')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x73')];}else{_0x3b215d[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x74')];}}else{_0x3b215d['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x1afc6c,_0x1c18a9,_0x5c53cd){var _0x4257c4=this;var _0x32427e=this['actions'][_0x1c18a9];var _0xa8dddb=this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]];var _0x1389e0;var _0x396461=![];var _0x28f387=0x2;var _0xb54629=0x3;if(_0xa8dddb){switch(_0x5c53cd){case'1':_0xa8dddb[_0xdf3c('0x75')]+=0x1;_0x32427e[_0xdf3c('0x76')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x0,_0xdf3c('0x79'));ami[_0xdf3c('0x29')](_0xdf3c('0x7a'),ut['buildObj'](_0x32427e,_0xdf3c('0x7b')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x7c'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'0',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x13bf69){_0x396461=_0x13bf69['additional']==0x1;_0x28f387=_0xa8dddb[_0xdf3c('0x7d')];_0xb54629=_0xa8dddb['callAdditionalPhoneAfterMin'];if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0x81'));}else{if(_0x32427e[_0xdf3c('0x76')]>=_0xa8dddb[_0xdf3c('0x82')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x81'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0x76'),_0xa8dddb[_0xdf3c('0x7d')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}delete this[_0xdf3c('0x15')][_0x1afc6c['linkedid']];}else{_0x32427e['countnosuchnumberretry']++;logger[_0xdf3c('0x2a')](_0xdf3c('0x87'),_0x32427e[_0xdf3c('0x76')]);logger['info']('id',_0x32427e[_0xdf3c('0x88')]);_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countnosuchnumberretry':_0x32427e[_0xdf3c('0x76')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0x8a'):var _0x9b7034=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x32427e[_0xdf3c('0x8c')]=_0x9b7034;_0x32427e[_0xdf3c('0x8d')]=_0x9b7034;_0x32427e[_0xdf3c('0x49')]=!![];_0xa8dddb[_0xdf3c('0x33')]+=0x1;logger[_0xdf3c('0x2a')]('[syncHangup][talking][increment]',_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);ami['emit'](_0xdf3c('0x90'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x92'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));if(_0xa8dddb[_0xdf3c('0x93')]){ami[_0xdf3c('0x29')](_0xdf3c('0x94'),ut[_0xdf3c('0x95')](_0x32427e));}break;case'16':ami[_0xdf3c('0x29')]('custom:agentcomplete',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));emitVoiceQueueChannelRemove(ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96')));_0xa8dddb[_0xdf3c('0x97')]+=0x1;_0xa8dddb['total']+=0x1;_0xa8dddb[_0xdf3c('0x98')]+=0x1;ut[_0xdf3c('0x99')](_0xa8dddb,'[16]');_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x9b'));rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x9c'));rpcDb[_0xdf3c('0x9d')](_0x32427e);_0xa8dddb['sumDuration']+=_0x32427e[_0xdf3c('0x9e')];_0xa8dddb[_0xdf3c('0x9f')]+=_0x32427e[_0xdf3c('0x9e')];logger['info'](_0xdf3c('0xa0'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb['name'],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;case _0xdf3c('0xa2'):_0xa8dddb[_0xdf3c('0xa3')]+=0x1;_0x32427e['countbusyretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x5,'Busy');_0x28f387=_0xa8dddb[_0xdf3c('0xa4')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')]('custom:agentbusy',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xa6')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logBusy]');_0x4257c4['verifyAdditionalPhones'](_0x32427e,'5',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x4e3517){_0x396461=_0x4e3517[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x32427e['countbusyretry']>=_0xa8dddb[_0xdf3c('0xa8')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xa9'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xaa'),_0xa8dddb['dialBusyRetryFrequency']),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xaa')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countbusyretry':_0x32427e[_0xdf3c('0xaa')]}})[_0xdf3c('0x5f')](function(){_0x4257c4['swapAdditionalPhones'](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xac'):_0xa8dddb[_0xdf3c('0xad')]+=0x1;_0x32427e['countnoanswerretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x3,_0xdf3c('0xae'));_0x28f387=_0xa8dddb[_0xdf3c('0xaf')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];var _0x391042=ut[_0xdf3c('0xb0')](_0x32427e,_0xa8dddb);ami[_0xdf3c('0x29')]('custom:agentnoanswer',_0x391042);rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logNoAnswer]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'3',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x2e5f82){_0x396461=_0x2e5f82[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xb2'));}else{if(_0x32427e[_0xdf3c('0xb3')]>=_0xa8dddb[_0xdf3c('0xb4')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xb5'));}else{rpcDb['rescheduleContact'](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xb3'),_0xa8dddb[_0xdf3c('0xaf')]),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e['idContact'],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xb6'):_0xa8dddb[_0xdf3c('0xb7')]+=0x1;_0x32427e['countcongestionretry']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x8,_0xdf3c('0xb8'));_0x28f387=_0xa8dddb[_0xdf3c('0xb9')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami['emit'](_0xdf3c('0xba'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xbb')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xbc'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'8',_0xa8dddb)['then'](function(_0x5c99f2){_0x396461=_0x5c99f2[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xbd'));}else{if(_0x32427e[_0xdf3c('0xbe')]>=_0xa8dddb['dialCongestionMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xbc'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xbe'),_0xa8dddb[_0xdf3c('0xa4')]),_0x32427e['unlockAgent'],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xbe')]++;_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countcongestionretry':_0x32427e[_0xdf3c('0xbe')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'CANCEL':_0xa8dddb[_0xdf3c('0xbf')]+=0x1;_0x32427e[_0xdf3c('0xc0')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x14,_0xdf3c('0xc1'));_0x28f387=_0xa8dddb['dialAgentRejectRetryFrequency'];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')](_0xdf3c('0xc2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xc3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xc4'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x1745fd){_0x396461=_0x1745fd[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb['dialGlobalMaxRetry']){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x1389e0,_0xdf3c('0xc5'));}else{if(_0x32427e[_0xdf3c('0xc0')]>=_0xa8dddb['dialAgentRejectMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xdf3c('0x83')](ut['scheduledAt'](_0x32427e,_0xdf3c('0xc0'),_0xa8dddb[_0xdf3c('0xc6')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xc7'):_0xa8dddb[_0xdf3c('0xc8')]+=0x1;_0x32427e[_0xdf3c('0xc9')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xb,_0xdf3c('0xca'));rpcDb['createCustomerHistory'](_0x32427e,_0xdf3c('0xcb'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'11',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x6e1899){_0x396461=_0x6e1899[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xcb'));}else{if(_0x32427e['countabandonedetry']>=_0xa8dddb[_0xdf3c('0xcc')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xcb'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xc9'),_0xa8dddb[_0xdf3c('0xcd')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'18':_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e[_0xdf3c('0xcf')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x12,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);ami[_0xdf3c('0x29')](_0xdf3c('0xd2'),ut['buildObj'](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)['then'](function(_0x418021){_0x396461=_0x418021[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x12,_0xdf3c('0x80'));rpcDb['createCustomerFinal'](_0x1389e0,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});delete this['actions'][_0x1afc6c[_0xdf3c('0xa1')]];break;case'19':_0xa8dddb['outboundUnknownCallsDay']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x13,_0x1afc6c['cause-txt']||_0x1afc6c[_0xdf3c('0xd1')]);ami['emit'](_0xdf3c('0xd2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd4'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x1d95d9){_0x396461=_0x1d95d9[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xd4'));}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});});}});delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;default:if(_0x32427e[_0xdf3c('0x49')]){ut[_0xdf3c('0x99')](_0xa8dddb,_0xdf3c('0xd5'));ut[_0xdf3c('0x53')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xa8dddb[_0xdf3c('0x2f')],_0x1afc6c);}_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xc,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);_0x28f387=_0xa8dddb[_0xdf3c('0xc6')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd6'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x44dc52){_0x396461=_0x44dc52[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,'Global');rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];}else{_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});}});}if(!(_0x32427e[_0xdf3c('0x49')]&&_0x5c53cd==='16')){ut[_0xdf3c('0x51')](_0xa8dddb,'[callProgressDetectingCustomer]');logger['info'](_0xdf3c('0xd7'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa8dddb[_0xdf3c('0x32')]);}if(_0x5c53cd!==_0xdf3c('0x8a')){delete this['actions'][_0x1afc6c['linkedid']];delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xd8')]];}_0xa8dddb[_0xdf3c('0xd9')]=!![];}};Preview[_0xdf3c('0xf')][_0xdf3c('0xda')]=function(_0x268aa9,_0xa10e73,_0x828c9c){if(_[_0xdf3c('0xdb')](_0xa10e73)&&_0xdf3c('0xdc')!==typeof _0xa10e73){return;}if(_[_0xdf3c('0xdb')](_0x828c9c)&&_0xdf3c('0xdc')!==typeof _0x828c9c){return;}switch(_0x828c9c[_0xdf3c('0xdd')]){case'0':ut[_0xdf3c('0xde')](_0x268aa9,0x0,_0xdf3c('0x79'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe0'));break;case'3':ut[_0xdf3c('0xde')](_0x268aa9,0x3,_0xdf3c('0xae'));rpcDb['createAgentHistory'](_0x268aa9,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xdf3c('0xde')](_0x268aa9,0x5,'Busy');rpcDb['createAgentHistory'](_0x268aa9,_0xdf3c('0xe1'));break;case'8':ut['logAgent'](_0x268aa9,0x8,_0xdf3c('0xb8'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x268aa9,0x16,'AnswerAGI');rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe2'));break;default:ut[_0xdf3c('0xde')](_0x268aa9,0xc,_0x828c9c['reason']);rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdf3c('0x51')](_0xa10e73,'[callProgressDetectingAgent]');logger['info'](_0xdf3c('0xe3'),_0x268aa9[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa10e73[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa10e73[_0xdf3c('0x32')]);delete this['actions'][_0x268aa9['uniqueid']];};Preview[_0xdf3c('0xf')]['verifyAdditionalPhones']=function(_0x1a5e31,_0x14244a,_0x18e639){return cmHopperAdditionalPhone[_0xdf3c('0xb1')](_0x1a5e31,_0x14244a,_0x18e639)[_0xdf3c('0x4f')](logger[_0xdf3c('0x2a')](_0xdf3c('0xe4')));};Preview['prototype']['swapAdditionalPhones']=function(_0x40fdd4,_0x1446af,_0x3fa455){return cmHopperAdditionalPhone[_0xdf3c('0x89')](_0x40fdd4,_0x1446af,_0x3fa455)['catch'](logger[_0xdf3c('0x2a')](_0xdf3c('0xe5')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xab')]=function(_0x33ef58){return Promise[_0xdf3c('0xe6')]()['then'](cmHopperAdditionalPhone[_0xdf3c('0xab')](_0x33ef58))[_0xdf3c('0x4f')](logger['info'](_0xdf3c('0xe7')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xe8')]=function(_0x511a40,_0x87ec92,_0x1ebfff,_0x3487cf,_0xb1c08d){var _0x3100fa=this;return new Promise(function(_0x147769,_0x3c91ba){if(_[_0xdf3c('0x58')](_0x87ec92)||_[_0xdf3c('0x58')](_0x87ec92['Contact'])||_[_0xdf3c('0x58')](_0x87ec92['phone'])||_[_0xdf3c('0x58')](_0x87ec92[_0xdf3c('0xe9')])){_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xea'),_0x3487cf,_0xb1c08d));return;}var _0x90c66=uuid['v4']();var _0x34344b=_0x3100fa[_0xdf3c('0x13')][_0x87ec92[_0xdf3c('0xeb')][_0xdf3c('0x2f')]];var _0x36a8c7=_0x1ebfff?_0x3100fa[_0xdf3c('0x16')][_0x1ebfff]['id']:undefined;_0x3100fa['actions'][_0x90c66]=new Action(_0x87ec92,_0x34344b,_0x90c66,_0x1ebfff,_0x36a8c7);var _0x379996=_0x3100fa[_0xdf3c('0x15')][_0x90c66];_0x379996['unlockAgent']=_0x3487cf;_0x379996[_0xdf3c('0x86')]=_0xb1c08d;_0x379996[_0xdf3c('0xec')]=_0x1ebfff;if(_[_0xdf3c('0xed')](_0x511a40)){_0x3100fa[_0xdf3c('0xee')](_0x379996,_0x34344b,_0x87ec92,_0x1ebfff)['then'](function(_0x2670ef){logger[_0xdf3c('0x2a')](_0xdf3c('0xef'),'Queue:\x20'+_0x379996['queue']+'\x20IdHopper:\x20'+_0x379996[_0xdf3c('0x88')],JSON[_0xdf3c('0x2c')](_0x2670ef));ami[_0xdf3c('0x29')](_0xdf3c('0xf0'),ut[_0xdf3c('0x91')](_0x379996,_0xdf3c('0xf1'),_0x3100fa[_0xdf3c('0x13')][_0x379996[_0xdf3c('0x46')]]));_0x147769(ut['message'](_0xdf3c('0xf2')));})['catch'](function(_0x359366){ut[_0xdf3c('0x38')](_0xdf3c('0xf3'),_0x359366);_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf4'),_0x3487cf,_0xb1c08d));});}else{_0x34344b[_0xdf3c('0xf5')]+=0x1;ut['logBlacklist'](_0x379996);rpcDb[_0xdf3c('0xf6')](_0x379996,_0xdf3c('0xf7'));delete _0x3100fa['actions'][_0x90c66];_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf8'),_0x3487cf,_0xb1c08d));}});};Preview[_0xdf3c('0xf')][_0xdf3c('0x70')]=function(_0x4e66a3){return!_[_0xdf3c('0x58')](_0x4e66a3)&&!_['isNil'](_0x4e66a3[_0xdf3c('0x2f')])&&!_[_0xdf3c('0x58')](_0x4e66a3[_0xdf3c('0xf9')])&&_0x4e66a3[_0xdf3c('0xf9')]&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3['name'])])&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3[_0xdf3c('0x2f')])]['status'])&&(this['trunks'][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]==='reachable'||this[_0xdf3c('0x14')][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]===_0xdf3c('0xfb'));};Preview[_0xdf3c('0xf')][_0xdf3c('0x5e')]=function(_0xd5aa90,_0x2eef6f){return this[_0xdf3c('0xfc')](_0xd5aa90,_0x2eef6f)['then'](function(_0x17add4){return _[_0xdf3c('0x4a')](_0x17add4,['message']);})[_0xdf3c('0x4f')](function(_0x1e8646){if(_0x1e8646['unlock']){rpcDb[_0xdf3c('0xfd')](_0xd5aa90);}if(_0x1e8646['active']){rpcDb[_0xdf3c('0xfe')](_0xd5aa90);}throw _[_0xdf3c('0x4a')](_0x1e8646,[_0xdf3c('0x36')]);});};Preview[_0xdf3c('0xf')][_0xdf3c('0xfc')]=function(_0x1086a3,_0x232b34){var _0x41b5f4=this;var _0x171231,_0x2b27de;return rpcDb[_0xdf3c('0xff')](_0x1086a3)[_0xdf3c('0x5f')](function(_0x2a4dbf){if(!_[_0xdf3c('0x58')](_0x2a4dbf[0x0])){_0x2b27de=_0x2a4dbf[0x0][_0xdf3c('0x100')]?![]:!![];_0x171231=_0x2a4dbf[0x0][_0xdf3c('0x100')]?!![]:![];_0x171231=_0x232b34?!![]:_0x171231;}var _0x542a02=_0x41b5f4[_0xdf3c('0x101')](_0x2a4dbf);if(_0x542a02[_0xdf3c('0x102')]){rpcDb['checkIsBlackList'](_[_0xdf3c('0x4a')](_0x2a4dbf[0x0],[_0xdf3c('0xe9'),_0xdf3c('0x103')]))[_0xdf3c('0x5f')](function(_0x518290){_0x41b5f4[_0xdf3c('0xe8')](_0x518290,_0x2a4dbf[0x0],_0x232b34,_0x2b27de,_0x171231)[_0xdf3c('0x5f')](function(_0x5b25d7){return _0x5b25d7;})[_0xdf3c('0x4f')](function(_0x37b1a6){throw _0x37b1a6;});})['catch'](function(_0x59c8f9){ut[_0xdf3c('0x38')](_0xdf3c('0x104'),_0x59c8f9);throw ut[_0xdf3c('0x36')]('Call\x20unsuccessful',_0x2b27de,_0x171231);});}else{throw ut[_0xdf3c('0x36')](_0x542a02['message'],_0x2b27de,_0x171231);}})[_0xdf3c('0x4f')](function(_0x246958){ut[_0xdf3c('0x38')](_0xdf3c('0x105'),_0x246958);throw ut[_0xdf3c('0x36')](_0xdf3c('0x106'),![],!![]);});};Preview['prototype'][_0xdf3c('0x101')]=function(_0x47f9d1){if(_[_0xdf3c('0x58')](_0x47f9d1)||_[_0xdf3c('0xed')](_0x47f9d1)||!_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'])&&_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'][_0xdf3c('0x2f')])){ut[_0xdf3c('0x38')]('[Preview][validateContact][Empty\x20Contact]',_0x47f9d1);return{'isValid':![],'message':_0xdf3c('0x107')};}var _0x4185f0=this[_0xdf3c('0x13')][_0x47f9d1[0x0][_0xdf3c('0xeb')]['name']];_0x4185f0[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x74')];if(_[_0xdf3c('0x58')](_0x4185f0)){ut[_0xdf3c('0x38')](_0xdf3c('0x108'),_0x4185f0);return{'isValid':![],'message':_0xdf3c('0x109')};}if(!this['isTrunkReachable'](_0x4185f0[_0xdf3c('0x71')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x10c'));if(!this[_0xdf3c('0x70')](_0x4185f0[_0xdf3c('0x72')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0x4185f0[_0xdf3c('0x2f')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdf3c('0x10d')};}}if(!ut[_0xdf3c('0x10e')](_0x4185f0[_0xdf3c('0x40')])){ut['logger'](_0xdf3c('0x10f'),_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x110'));return{'isValid':![],'message':_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xdf3c('0x111')};};Preview[_0xdf3c('0xf')]['execCall']=function(_0x2a0943,_0x3d4dc5,_0x38c6f3,_0xb39cc){var _0xcc2f18=this;return new Promise(function(_0x13ee9b,_0x8d7c0c){var _0x3d9041=_0x2a0943[_0xdf3c('0x8e')];var _0x4f8990=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5[_0xdf3c('0x71')])?util['format'](_0xdf3c('0x112'),_0x3d4dc5[_0xdf3c('0x71')]['name'],_['isNil'](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5[_0xdf3c('0x113')][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')][_0xdf3c('0x116')](_0x3d4dc5[_0xdf3c('0x115')]):_0x38c6f3[_0xdf3c('0x103')]):util['format'](_0xdf3c('0x112'),_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')]['name']:_0x3d4dc5[_0xdf3c('0x72')][_0xdf3c('0x2f')],_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5['dialPrefix'][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')]['substring'](_0x3d4dc5['dialCutDigit']):_0x38c6f3[_0xdf3c('0x103')]);var _0xcaea00=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5['Trunk'])?ut[_0xdf3c('0x117')](_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut['getCallerIdRandom'](_0x3d4dc5['dialOriginateCallerIdNumber'],_0x3d4dc5[_0xdf3c('0x11a')]):_0x3d4dc5['dialOriginateCallerIdNumber']):ut[_0xdf3c('0x117')](_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')]:_0x3d4dc5[_0xdf3c('0x72')]['callerid'],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut[_0xdf3c('0x11b')](_0x3d4dc5[_0xdf3c('0x11c')],_0x3d4dc5['dialRandomLastDigitCallerIdNumber']):_0x3d4dc5[_0xdf3c('0x11c')]);if(_0xcaea00){_0x2a0943[_0xdf3c('0x11d')]=ut[_0xdf3c('0x11e')](_0xcaea00);_0x2a0943['originatecalleridnum']=ut['extractCalleridNumber'](_0xcaea00);}var _0x1617d8=ut[_0xdf3c('0x11f')](_0x3d4dc5,_0x38c6f3,_0x4f8990,_0xcaea00,_0x3d9041,_0x2a0943);_['merge'](_0x2a0943,ut[_0xdf3c('0x120')](_0x1617d8));_0x2a0943['starttime']=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x3d4dc5[_0xdf3c('0x121')]=_0x1617d8;var _0x1961cd=ut[_0xdf3c('0x122')](_0x2a0943,_0x3d4dc5,_0x1617d8,_0x2a0943[_0xdf3c('0x86')],_0xb39cc);return ami['Action'](_0x1961cd)[_0xdf3c('0x5f')](function(_0x2c24b7){_0x3d4dc5[_0xdf3c('0x32')]+=0x1;logger[_0xdf3c('0x2a')](_0xdf3c('0x123'),_0x3d9041,_0xdf3c('0x8f'),_0x3d4dc5[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0x3d4dc5[_0xdf3c('0x32')]);_0x13ee9b(_0x2c24b7);})[_0xdf3c('0x4f')](function(_0x340107){ut['logAgent'](_0x2a0943,0xe,_0xdf3c('0x124'));rpcDb[_0xdf3c('0xdf')](_0x2a0943,'[originateFailure][logOriginateFailure]');_0x8d7c0c(_0x340107);});});};Preview[_0xdf3c('0xf')][_0xdf3c('0x125')]=function(_0x2accb4){if(this[_0xdf3c('0x15')][_0x2accb4[_0xdf3c('0xa1')]]){this['actions'][_0x2accb4[_0xdf3c('0xa1')]][_0xdf3c('0x4e')]=_0x2accb4[_0xdf3c('0x4e')];}};Preview[_0xdf3c('0xf')][_0xdf3c('0x19')]=function(_0x31391d){var _0x158c75=this;var _0x7554e2=this[_0xdf3c('0x15')][_0x31391d[_0xdf3c('0x126')]];if(_0x7554e2){if(_0x7554e2[_0xdf3c('0xec')]&&this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]){ut['logLookAgent'](_0x7554e2,this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['name'],this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['id']);}var _0x44388c=_[_0xdf3c('0x127')](_0x7554e2);_0x44388c[_0xdf3c('0x8c')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));var _0x15322a=_0x158c75[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]];if(ut['isFailure'](_0x31391d[_0xdf3c('0x128')])){if(_0x7554e2[_0xdf3c('0x85')]){rpcDb['unlockContact'](_0x7554e2[_0xdf3c('0x88')]);}if(_0x7554e2['activeContact']){rpcDb[_0xdf3c('0xfe')](_0x7554e2['idContact']);}ami[_0xdf3c('0x29')]('custom:agentringnoanswer',ut[_0xdf3c('0x91')](_0x7554e2,_0xdf3c('0x129'),this[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]]));this[_0xdf3c('0xda')](_0x44388c,_0x15322a,_0x31391d);}else{_0x7554e2[_0xdf3c('0x12a')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));ut['logAgent'](_0x44388c,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0xdf')](_0x44388c,_0xdf3c('0x12b'));}}};Preview['prototype'][_0xdf3c('0x1b')]=function(_0x30b5c8){var _0x30e5ab=this[_0xdf3c('0x15')][_0x30b5c8['linkedid']];var _0x55a4fa;if(_0x30e5ab){_0x55a4fa=this['campaignsPreview'][_0x30e5ab['queue']];logger[_0xdf3c('0x2a')](_0xdf3c('0x12c'),_0x30b5c8[_0xdf3c('0xa1')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);}if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]&&_0x30b5c8['linkedid']!==_0x30b5c8[_0xdf3c('0x8e')]){if(_0x30b5c8[_0xdf3c('0x12d')]==='16'&&this[_0xdf3c('0x15')][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],'\x20Queue',_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}}else if(_0x30e5ab&&_[_0xdf3c('0x58')](_0x30e5ab[_0xdf3c('0x130')])&&_0x55a4fa[_0xdf3c('0x131')]&&_0x30b5c8[_0xdf3c('0xa1')]===_0x30b5c8[_0xdf3c('0x8e')]&&_['isNil'](_0x30b5c8[_0xdf3c('0xdd')])&&_0x30b5c8[_0xdf3c('0x12d')]==='16'&&_0x30b5c8[_0xdf3c('0x132')]==='6'&&_[_0xdf3c('0xdb')](_0x30e5ab[_0xdf3c('0x133')])){if(_0x30e5ab[_0xdf3c('0x85')]){rpcDb[_0xdf3c('0xfd')](_0x30e5ab['idContact']);}if(_0x30e5ab[_0xdf3c('0x86')]){rpcDb['disableContact'](_0x30e5ab[_0xdf3c('0x88')]);}_0x30b5c8['reason']='22';this[_0xdf3c('0xda')](_0x30e5ab,_0x55a4fa,_0x30b5c8);}else if(_0x30e5ab&&_0x30e5ab[_0xdf3c('0x133')]){if(_0x30b5c8['cause']==='16'&&this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x134'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]['dialAnswer']){logger['info'](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],'pTalking:\x20',_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x20')]=function(_0x386a3b){if(this[_0xdf3c('0x15')][_0x386a3b['destlinkedid']]&&_0x386a3b[_0xdf3c('0xd8')]!==_0x386a3b[_0xdf3c('0x135')]){this[_0xdf3c('0x12e')](_0x386a3b,_0x386a3b[_0xdf3c('0xd8')],_0x386a3b[_0xdf3c('0xd1')]);}};Preview['prototype'][_0xdf3c('0x1e')]=function(_0x43fc55){if(this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]]&&_0x43fc55[_0xdf3c('0xa1')]!==_0x43fc55[_0xdf3c('0x8e')]&&!this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){if(_0x43fc55[_0xdf3c('0x12d')]==='1'){this[_0xdf3c('0x12e')](_0x43fc55,_0x43fc55[_0xdf3c('0xa1')],_0x43fc55[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x136')]=function(_0x2be6c7,_0x18bbe0,_0x174e96){if(this['actions'][_0x2be6c7]){if(_[_0xdf3c('0x58')](this[_0xdf3c('0x15')][_0x2be6c7][_0xdf3c('0x121')])){this['actions'][_0x2be6c7][_0xdf3c('0x121')]={};}this['actions'][_0x2be6c7][_0xdf3c('0x121')][_0x18bbe0]=_0x174e96;}};Preview['prototype'][_0xdf3c('0x23')]=function(_0xd721b1){try{if(!_[_0xdf3c('0x58')](_0xd721b1)){if(ut[_0xdf3c('0x137')](_[_0xdf3c('0x138')](_0xd721b1[_0xdf3c('0x139')])[0x0])){this[_0xdf3c('0x136')](_0xd721b1[_0xdf3c('0x8e')],_[_0xdf3c('0x138')](_0xd721b1['variable'])[0x0],_0xd721b1[_0xdf3c('0x13a')]);}}}catch(_0x3e3d63){logger[_0xdf3c('0x13b')](_0xdf3c('0x13c'),util['inspect'](_0x3e3d63,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdf3c('0x25')]=function(_0x2d412f){if(_0x2d412f){if(this[_0xdf3c('0x15')][_0x2d412f[_0xdf3c('0x13d')]]){this['actions'][_0x2d412f[_0xdf3c('0x13d')]]['transfer']=!![];}}};Preview['prototype'][_0xdf3c('0x27')]=function(_0x4255cd){if(_0x4255cd){if(this['actions'][_0x4255cd[_0xdf3c('0x13e')]]){this[_0xdf3c('0x15')][_0x4255cd['transfererlinkedid']][_0xdf3c('0x133')]=!![];}}};module[_0xdf3c('0x13f')]=Preview; \ No newline at end of file +var _0xa41a=['logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','checkInBlack','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logger','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','pick','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','dialActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','Action','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','lookAgent','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','CAMPAIGN_STATUS','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','message','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','VoiceQueueId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','INACTIVE','Trunk','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','countbusyretry','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','isUndefined','object','reason'];(function(_0x2739e1,_0x239397){var _0x368f81=function(_0x2fb59a){while(--_0x2fb59a){_0x2739e1['push'](_0x2739e1['shift']());}};_0x368f81(++_0x239397);}(_0xa41a,0x6b));var _0xaa41=function(_0x4859a8,_0x4950ec){_0x4859a8=_0x4859a8-0x0;var _0x539c1c=_0xa41a[_0x4859a8];return _0x539c1c;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var uuid=require('uuid');var moment=require(_0xaa41('0x2'));var Redis=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var logger=require(_0xaa41('0x5'))(_0xaa41('0x6'));var loggerAction=require(_0xaa41('0x5'))(_0xaa41('0x7'));var ami=require(_0xaa41('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xaa41('0x9'));var Action=require(_0xaa41('0xa'));var ut=require('./util/util');var utils=require('../dialer/utils');config[_0xaa41('0xb')]=_[_0xaa41('0xc')](config['redis'],{'host':_0xaa41('0xd'),'port':0x18eb});var io=require(_0xaa41('0xe'))(new Redis(config[_0xaa41('0xb')]));var Sequence=function(){};Sequence[_0xaa41('0xf')][_0xaa41('0x10')]=function(_0x38d930){this[_0xaa41('0x11')]=this[_0xaa41('0x11')]?this[_0xaa41('0x11')]['finally'](_0x38d930):_0x38d930();};function Preview(_0x1d3aac){this[_0xaa41('0x12')]=new Sequence();this['campaignsPreview']=_0x1d3aac['voiceQueues'];this[_0xaa41('0x13')]=_0x1d3aac['trunks'];this[_0xaa41('0x14')]={};this[_0xaa41('0x15')]=_0x1d3aac[_0xaa41('0x15')];this[_0xaa41('0x16')]=0x0;ami['on'](_0xaa41('0x17'),this['syncOriginateResponse'][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x19'),this[_0xaa41('0x1a')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1b'),this[_0xaa41('0x1c')][_0xaa41('0x18')](this));ami['on']('dialend',this[_0xaa41('0x1d')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1e'),this[_0xaa41('0x1f')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x20'),this[_0xaa41('0x21')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xaa41('0x23'),this[_0xaa41('0x24')][_0xaa41('0x18')](this));this['loopCampaigns'](this[_0xaa41('0x25')]);}function emit(_0x1f692b,_0x4e768e,_0x513c61){io['to'](_0x1f692b)[_0xaa41('0x26')](_0x4e768e,_0x513c61);}function emitVoiceQueueChannelRemove(_0x5d4374){logger[_0xaa41('0x27')](_0xaa41('0x28'),JSON[_0xaa41('0x29')](_0x5d4374));emit(util[_0xaa41('0x2a')](_0xaa41('0x2b'),_0x5d4374['name']),_0xaa41('0x2c'),_0x5d4374);io[_0xaa41('0x26')](_0xaa41('0x2d'),_0x5d4374);}function notSendMessagesQueue(_0x21f596){if(_0x21f596[_0xaa41('0x2e')]){if(_0x21f596[_0xaa41('0x2f')]===0x0&&_0x21f596['pTalking']===0x0){_0x21f596['sendMessageOneNotActive']=![];_0x21f596[_0xaa41('0x30')]=0x0;_0x21f596['paused']=0x0;_0x21f596['message']=utils[_0xaa41('0x31')]['INACTIVE'];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x34'));}else{_0x21f596[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x36')];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x37'));}}}Preview[_0xaa41('0xf')][_0xaa41('0x38')]=function(){var _0x4466a3=this;setInterval(function(){_0x4466a3[_0xaa41('0x39')]();},0x7cf);};Preview[_0xaa41('0xf')]['syncCampaigns']=function(){var _0x377add=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x714537 in _0x377add){if(_0x377add[_0xaa41('0x3a')](_0x714537)&&(_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')||_0x377add[_0x714537][_0xaa41('0x3b')]==='booked')&&_0x377add[_0x714537]['type']==='outbound'){if(this[_0xaa41('0x16')]>0x7){this[_0xaa41('0x16')]=0x0;this[_0xaa41('0x3c')]();}}if(_0x377add[_0xaa41('0x3a')](_0x714537)&&_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')&&_0x377add[_0x714537][_0xaa41('0x3d')]===_0xaa41('0x3e')){if(_0x377add[_0x714537]['dialActive']){this[_0xaa41('0x3f')](_0x377add[_0x714537]);if(_0x377add[_0x714537][_0xaa41('0x40')])this[_0xaa41('0x41')](_0x377add[_0x714537]);}else{notSendMessagesQueue(_0x377add[_0x714537]);}}}};Preview['prototype'][_0xaa41('0x42')]=function(_0x374117){var _0x57fe1d=this;this[_0xaa41('0x12')][_0xaa41('0x10')](function(){if(!_[_0xaa41('0x43')](_0x57fe1d['actions'][_0x374117])){loggerAction[_0xaa41('0x27')]('[clearZombieChannels][talking]',_0x374117,_0xaa41('0x44'),_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')],'originated:\x20',JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x2f')]),_0xaa41('0x46'),JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x47')]),JSON[_0xaa41('0x29')](_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x48')]),JSON[_0xaa41('0x29')](_['pick'](_0x57fe1d[_0xaa41('0x14')][_0x374117],[_0xaa41('0x49'),_0xaa41('0x4a'),_0xaa41('0x4b'),'ListId'])));return ami['Action']({'action':_0xaa41('0x4c'),'channel':_0x57fe1d[_0xaa41('0x14')][_0x374117]['channel']})[_0xaa41('0x4d')](function(_0x563687){if(_0x563687[_0xaa41('0x35')]===_0xaa41('0x4e')){setTimeout(function(){if(_0x57fe1d[_0xaa41('0x14')][_0x374117]){ut[_0xaa41('0x4f')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));if(_0x57fe1d['actions'][_0x374117][_0xaa41('0x48')]===!![]){ut[_0xaa41('0x51')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117]['queue']);}ut[_0xaa41('0x52')](_0xaa41('0x53')+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]);delete _0x57fe1d[_0xaa41('0x14')][_0x374117];}},0x2328);}});}});};Preview[_0xaa41('0xf')][_0xaa41('0x3c')]=function(){var _0x5ee74c=this;loggerAction[_0xaa41('0x27')]('[action]',_['size'](this[_0xaa41('0x14')]));for(var _0x5ee127 in this['actions']){if(_0x5ee74c['actions'][_0xaa41('0x3a')](_0x5ee127)){_0x5ee74c['clearZombieChannel'](_0x5ee127);}}};Preview[_0xaa41('0xf')][_0xaa41('0x41')]=function(_0x4a6882){var _0x576f81=this;rpcDb[_0xaa41('0x54')](_0x4a6882['id'],ut[_0xaa41('0x55')](this[_0xaa41('0x15')]))[_0xaa41('0x56')](function(_0x3fe1a9){if(!_[_0xaa41('0x43')](_0x3fe1a9)){for(var _0x258096=0x0;_0x258096<_0x3fe1a9[_0xaa41('0x57')];_0x258096+=0x1){if(ut[_0xaa41('0x58')](_0x3fe1a9[_0x258096]['scheduledat'])<_0x4a6882[_0xaa41('0x59')]*0x3c){if(_0x3fe1a9[_0x258096][_0xaa41('0x5a')]&&!_0x3fe1a9[_0x258096][_0xaa41('0x5a')][_0xaa41('0x5b')]){_0x576f81[_0xaa41('0x5c')](_0x3fe1a9[_0x258096]['id'])[_0xaa41('0x56')](ut['logger2'](_0xaa41('0x5d')))[_0xaa41('0x4d')](ut[_0xaa41('0x5e')](_0xaa41('0x5d')));}else{rpcDb['disableContact'](_0x3fe1a9[_0x258096]['id']);}}else{var _0x23bc61=new Action(_0x3fe1a9[_0x258096],_0x4a6882);_0x23bc61['starttime']=moment()['format'](_0xaa41('0x5f'));_0x4a6882[_0xaa41('0x60')]+=0x1;ut[_0xaa41('0x61')](_0x23bc61,0x17,'RecallInQueue');if(_0x4a6882[_0xaa41('0x62')]){rpcDb[_0xaa41('0x63')](ut[_0xaa41('0x64')](_0x3fe1a9[_0x258096]));rpcDb['createCustomerHistory'](_0x23bc61,_0xaa41('0x65'));}else{ut[_0xaa41('0x61')](_0x23bc61,0x16,_0xaa41('0x66'));rpcDb[_0xaa41('0x67')](_0x23bc61,_0xaa41('0x68'));rpcDb[_0xaa41('0x69')](_0x23bc61,_0xaa41('0x68'));}}}}})[_0xaa41('0x4d')](ut['logger2'](_0xaa41('0x6a')));};Preview['prototype']['setMessage']=function(_0x1bdcd6){_0x1bdcd6[_0xaa41('0x2e')]=!![];if(ut[_0xaa41('0x6b')](_0x1bdcd6[_0xaa41('0x6c')])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6d')];}else if(!ut[_0xaa41('0x6e')](_0x1bdcd6['dialActive'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6f')];}else if(!this['isTrunkReachable'](_0x1bdcd6[_0xaa41('0x70')])){if(!this[_0xaa41('0x71')](_0x1bdcd6['TrunkBackup'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x72')];}else{_0x1bdcd6['message']=utils[_0xaa41('0x31')][_0xaa41('0x73')];}}else{_0x1bdcd6['message']=utils['CAMPAIGN_STATUS'][_0xaa41('0x73')];}};Preview[_0xaa41('0xf')][_0xaa41('0x74')]=function(_0x4d20c6,_0x5a76b9,_0x137f3f){var _0x1746b4=this;var _0x32f2b4=this[_0xaa41('0x14')][_0x5a76b9];var _0x5ccdc5=this[_0xaa41('0x25')][_0x32f2b4['queue']];var _0x555186;var _0x3ba305=![];var _0x52ae7f=0x2;var _0x3621c0=0x3;if(_0x5ccdc5){switch(_0x137f3f){case'1':_0x5ccdc5[_0xaa41('0x75')]+=0x1;_0x32f2b4[_0xaa41('0x76')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x0,_0xaa41('0x78'));ami[_0xaa41('0x26')](_0xaa41('0x79'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0x7b')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0x7c'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'0',_0x5ccdc5)[_0xaa41('0x56')](function(_0x40cdfc){_0x3ba305=_0x40cdfc[_0xaa41('0x7d')]==0x1;_0x52ae7f=_0x5ccdc5['dialNoSuchNumberRetryFrequency'];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0x82'));}else{if(_0x32f2b4['countnosuchnumberretry']>=_0x5ccdc5['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x32f2b4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x32f2b4,_0xaa41('0x76'),_0x5ccdc5['dialNoSuchNumberRetryFrequency']),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x32f2b4[_0xaa41('0x76')]++;logger['info'](_0xaa41('0x85'),_0x32f2b4[_0xaa41('0x76')]);logger[_0xaa41('0x27')]('id',_0x32f2b4[_0xaa41('0x86')]);_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnosuchnumberretry':_0x32f2b4[_0xaa41('0x76')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});break;case _0xaa41('0x89'):var _0x2d2af8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32f2b4['responsetime']=_0x2d2af8;_0x32f2b4[_0xaa41('0x8a')]=_0x2d2af8;_0x32f2b4['dialAnswer']=!![];_0x5ccdc5[_0xaa41('0x47')]+=0x1;logger['info'](_0xaa41('0x8b'),_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);ami[_0xaa41('0x26')]('custom:agentconnect',ut['buildObj'](_0x32f2b4,_0xaa41('0x8d'),this[_0xaa41('0x25')][_0x32f2b4['queue']]));if(_0x5ccdc5['acw']){ami[_0xaa41('0x26')](_0xaa41('0x8e'),ut[_0xaa41('0x8f')](_0x32f2b4));}break;case'16':ami[_0xaa41('0x26')](_0xaa41('0x90'),ut['buildObj'](_0x32f2b4,_0xaa41('0x91'),this['campaignsPreview'][_0x32f2b4['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x32f2b4,_0xaa41('0x91')));_0x5ccdc5[_0xaa41('0x92')]+=0x1;_0x5ccdc5[_0xaa41('0x93')]+=0x1;_0x5ccdc5['answered']+=0x1;ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0x94'));_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x4,_0xaa41('0x96'));rpcDb[_0xaa41('0x67')](_0x32f2b4,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0x97'));rpcDb[_0xaa41('0x98')](_0x32f2b4);_0x5ccdc5[_0xaa41('0x99')]+=_0x32f2b4['talktime'];_0x5ccdc5[_0xaa41('0x9a')]+=_0x32f2b4['talktime'];logger[_0xaa41('0x27')](_0xaa41('0x9b'),_0x32f2b4[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x5ccdc5['name'],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];break;case'BUSY':_0x5ccdc5[_0xaa41('0x9d')]+=0x1;_0x32f2b4['countbusyretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x5,_0xaa41('0x9e'));_0x52ae7f=_0x5ccdc5[_0xaa41('0x9f')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xa0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xa1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xa2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'5',_0x5ccdc5)[_0xaa41('0x56')](function(_0x59a30b){_0x3ba305=_0x59a30b[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xa4'));}else{if(_0x32f2b4['countbusyretry']>=_0x5ccdc5[_0xaa41('0xa5')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xa8'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4[_0xaa41('0xa8')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countbusyretry':_0x32f2b4['countbusyretry']}})[_0xaa41('0x56')](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xaa'):_0x5ccdc5[_0xaa41('0xab')]+=0x1;_0x32f2b4['countnoanswerretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x3,'NoAnswer');_0x52ae7f=_0x5ccdc5[_0xaa41('0xac')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];var _0x5bd574=ut[_0xaa41('0xad')](_0x32f2b4,_0x5ccdc5);ami['emit']('custom:agentnoanswer',_0x5bd574);rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xae'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'3',_0x5ccdc5)['then'](function(_0x241e1a){_0x3ba305=_0x241e1a[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xaf'));}else{if(_0x32f2b4['countnoanswerretry']>=_0x5ccdc5[_0xaa41('0xb0')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xae'));}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xa7')](_0x32f2b4,'countnoanswerretry',_0x5ccdc5['dialNoAnswerRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})['then'](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xb2'):_0x5ccdc5[_0xaa41('0xb3')]+=0x1;_0x32f2b4[_0xaa41('0xb4')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x8,_0xaa41('0xb5'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xb6')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xb7'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xb8')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xb9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'8',_0x5ccdc5)[_0xaa41('0x56')](function(_0x58ad21){_0x3ba305=_0x58ad21[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xba'));}else{if(_0x32f2b4[_0xaa41('0xb4')]>=_0x5ccdc5[_0xaa41('0xbb')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xb9'));}else{rpcDb[_0xaa41('0xa6')](ut['scheduledAt'](_0x32f2b4,_0xaa41('0xb4'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countcongestionretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countcongestionretry':_0x32f2b4[_0xaa41('0xb4')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xbc'):_0x5ccdc5['outboundRejectCallsDay']+=0x1;_0x32f2b4[_0xaa41('0xbd')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x14,_0xaa41('0xbe'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xc0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xc1')));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x78265){_0x3ba305=_0x78265[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut['cloneAction'](_0x32f2b4,0x14,'AgentReject');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc3'));}else{if(_0x32f2b4['countagentrejectretry']>=_0x5ccdc5[_0xaa41('0xc4')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xbd'),_0x5ccdc5[_0xaa41('0xbf')]),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xc5'):_0x5ccdc5[_0xaa41('0xc6')]+=0x1;_0x32f2b4[_0xaa41('0xc7')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0xb,_0xaa41('0xc8'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'11',_0x5ccdc5)[_0xaa41('0x56')](function(_0x408d95){_0x3ba305=_0x408d95[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc9'));}else{if(_0x32f2b4['countabandonedetry']>=_0x5ccdc5[_0xaa41('0xca')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xc9'));}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,'countabandonedretry',_0x5ccdc5['dialAbandonedRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})['then'](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case'18':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0xcc')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x12,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,'amd'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xd0'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)['then'](function(_0x30e8cb){_0x3ba305=_0x30e8cb['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0x12,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd0'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd0'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4['incrementPreviewCounters']({'id':_0x32f2b4['idContact'],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;case'19':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4['countglobal']=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x13,_0x4d20c6['cause-txt']||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xd1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)[_0xaa41('0x56')](function(_0x573889){_0x3ba305=_0x573889['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd2'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd2'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;default:if(_0x32f2b4['dialAnswer']){ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0xd3'));ut[_0xaa41('0x52')](_0xaa41('0xd4')+_0x5ccdc5[_0xaa41('0x33')],_0x4d20c6);}_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0xc,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd5'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x1b5933){_0x3ba305=_0x1b5933[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut['totalGlobal'](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd6'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd6'));}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});}});}if(!(_0x32f2b4['dialAnswer']&&_0x137f3f==='16')){ut['updateOriginated'](_0x5ccdc5,_0xaa41('0xd7'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingCustomer]',_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0xd8'),_0x5ccdc5['originated']);}if(_0x137f3f!=='ANSWER'){delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];delete this[_0xaa41('0x14')][_0x4d20c6['destlinkedid']];}_0x5ccdc5['queueSummaryCountersUpdated']=!![];}};Preview[_0xaa41('0xf')]['callProgressDetectingAgent']=function(_0x94423a,_0x59d6cf,_0x37dc6f){if(_[_0xaa41('0xd9')](_0x59d6cf)&&_0xaa41('0xda')!==typeof _0x59d6cf){return;}if(_[_0xaa41('0xd9')](_0x37dc6f)&&_0xaa41('0xda')!==typeof _0x37dc6f){return;}switch(_0x37dc6f[_0xaa41('0xdb')]){case'0':ut[_0xaa41('0xdc')](_0x94423a,0x0,'NoSuchNumber');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xde'));break;case'3':ut['logAgent'](_0x94423a,0x3,_0xaa41('0xdf'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe0'));break;case'5':ut[_0xaa41('0xdc')](_0x94423a,0x5,'Busy');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe1'));break;case'8':ut[_0xaa41('0xdc')](_0x94423a,0x8,_0xaa41('0xb5'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));break;case'22':ut[_0xaa41('0xdc')](_0x94423a,0x16,_0xaa41('0xe3'));rpcDb[_0xaa41('0xdd')](_0x94423a,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x94423a,0xc,_0x37dc6f[_0xaa41('0xdb')]);rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));}ut[_0xaa41('0x4f')](_0x59d6cf,_0xaa41('0xe4'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x94423a[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x59d6cf[_0xaa41('0x33')],_0xaa41('0xd8'),_0x59d6cf[_0xaa41('0x2f')]);delete this[_0xaa41('0x14')][_0x94423a['uniqueid']];};Preview[_0xaa41('0xf')][_0xaa41('0xa3')]=function(_0x13ddbe,_0x4cf0c5,_0x1ddfe5){return cmHopperAdditionalPhone[_0xaa41('0xa3')](_0x13ddbe,_0x4cf0c5,_0x1ddfe5)[_0xaa41('0x4d')](logger[_0xaa41('0x27')](_0xaa41('0xe5')));};Preview[_0xaa41('0xf')][_0xaa41('0x88')]=function(_0x943973,_0xe17579,_0x1a6de8){return cmHopperAdditionalPhone[_0xaa41('0x88')](_0x943973,_0xe17579,_0x1a6de8)[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xaa41('0x87')]=function(_0xb9d685){return Promise[_0xaa41('0xe6')]()[_0xaa41('0x56')](cmHopperAdditionalPhone[_0xaa41('0x87')](_0xb9d685))[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[incrementPreviewCounters]\x20'));};Preview[_0xaa41('0xf')][_0xaa41('0xe7')]=function(_0xa3687e,_0x7e0e69,_0x361819,_0x377e17,_0x1e879d){var _0x1a7527=this;return new Promise(function(_0x1aac0c,_0x1a5a7a){if(_[_0xaa41('0x43')](_0x7e0e69)||_[_0xaa41('0x43')](_0x7e0e69['Contact'])||_[_0xaa41('0x43')](_0x7e0e69[_0xaa41('0xe8')])||_['isNil'](_0x7e0e69[_0xaa41('0x4b')])){_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xe9'),_0x377e17,_0x1e879d));return;}var _0x400fb7=uuid['v4']();var _0x5c0c5c=_0x1a7527[_0xaa41('0x25')][_0x7e0e69[_0xaa41('0x44')][_0xaa41('0x33')]];var _0x3a223c=_0x361819?_0x1a7527[_0xaa41('0x15')][_0x361819]['id']:undefined;_0x1a7527['actions'][_0x400fb7]=new Action(_0x7e0e69,_0x5c0c5c,_0x400fb7,_0x361819,_0x3a223c);var _0xc59a12=_0x1a7527['actions'][_0x400fb7];_0xc59a12['unlockAgent']=_0x377e17;_0xc59a12[_0xaa41('0x83')]=_0x1e879d;_0xc59a12['lookAgent']=_0x361819;if(_['isEmpty'](_0xa3687e)){_0x1a7527[_0xaa41('0xea')](_0xc59a12,_0x5c0c5c,_0x7e0e69,_0x361819)[_0xaa41('0x56')](function(_0x5b241e){logger['info'](_0xaa41('0xeb'),_0xaa41('0xec')+_0xc59a12[_0xaa41('0x45')]+_0xaa41('0xed')+_0xc59a12[_0xaa41('0x86')],JSON[_0xaa41('0x29')](_0x5b241e));ami[_0xaa41('0x26')](_0xaa41('0xee'),ut['buildObj'](_0xc59a12,_0xaa41('0xef'),_0x1a7527[_0xaa41('0x25')][_0xc59a12[_0xaa41('0x45')]]));_0x1aac0c(ut[_0xaa41('0x35')](_0xaa41('0xf0')));})['catch'](function(_0x519843){ut[_0xaa41('0xf1')](_0xaa41('0xf2'),_0x519843);_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xf3'),_0x377e17,_0x1e879d));});}else{_0x5c0c5c[_0xaa41('0xf4')]+=0x1;ut[_0xaa41('0xf5')](_0xc59a12);rpcDb['createHistory'](_0xc59a12,_0xaa41('0xf6'));delete _0x1a7527[_0xaa41('0x14')][_0x400fb7];_0x1a5a7a(ut['message'](_0xaa41('0xf7'),_0x377e17,_0x1e879d));}});};Preview[_0xaa41('0xf')][_0xaa41('0x71')]=function(_0x27149e){return!_[_0xaa41('0x43')](_0x27149e)&&!_[_0xaa41('0x43')](_0x27149e[_0xaa41('0x33')])&&!_['isNil'](_0x27149e[_0xaa41('0xf8')])&&_0x27149e[_0xaa41('0xf8')]&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])])&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')])&&(this['trunks'][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e['name'])]['status']===_0xaa41('0xfa')||this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')]==='unmonitored');};Preview['prototype'][_0xaa41('0x5c')]=function(_0x2ff3fb,_0x566832){return this['execRun'](_0x2ff3fb,_0x566832)[_0xaa41('0x56')](function(_0x44dea3){return _[_0xaa41('0xfb')](_0x44dea3,['message']);})['catch'](function(_0x1d609e){if(_0x1d609e[_0xaa41('0xfc')]){rpcDb[_0xaa41('0xfd')](_0x2ff3fb);}if(_0x1d609e['active']){rpcDb[_0xaa41('0xfe')](_0x2ff3fb);}throw _[_0xaa41('0xfb')](_0x1d609e,['message']);});};Preview['prototype'][_0xaa41('0xff')]=function(_0x561447,_0x4679e5){var _0x3fb6f0=this;var _0xdf9297,_0x10252a;return rpcDb[_0xaa41('0x100')](_0x561447)[_0xaa41('0x56')](function(_0x2b083a){if(!_['isNil'](_0x2b083a[0x0])){_0x10252a=_0x2b083a[0x0][_0xaa41('0x101')]?![]:!![];_0xdf9297=_0x2b083a[0x0][_0xaa41('0x101')]?!![]:![];_0xdf9297=_0x4679e5?!![]:_0xdf9297;}var _0x5534ef=_0x3fb6f0[_0xaa41('0x102')](_0x2b083a);if(_0x5534ef[_0xaa41('0x103')]){rpcDb[_0xaa41('0x104')](_[_0xaa41('0xfb')](_0x2b083a[0x0],[_0xaa41('0x4b'),_0xaa41('0xe8')]))['then'](function(_0xa2d55d){_0x3fb6f0[_0xaa41('0xe7')](_0xa2d55d,_0x2b083a[0x0],_0x4679e5,_0x10252a,_0xdf9297)[_0xaa41('0x56')](function(_0x2fa831){return _0x2fa831;})[_0xaa41('0x4d')](function(_0xf8f3e1){throw _0xf8f3e1;});})[_0xaa41('0x4d')](function(_0x5083ff){ut[_0xaa41('0xf1')](_0xaa41('0x105'),_0x5083ff);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',_0x10252a,_0xdf9297);});}else{throw ut['message'](_0x5534ef['message'],_0x10252a,_0xdf9297);}})[_0xaa41('0x4d')](function(_0x1331f8){ut[_0xaa41('0xf1')](_0xaa41('0x106'),_0x1331f8);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xaa41('0xf')][_0xaa41('0x102')]=function(_0x1fe1e3){if(_[_0xaa41('0x43')](_0x1fe1e3)||_[_0xaa41('0x107')](_0x1fe1e3)||!_[_0xaa41('0x43')](_0x1fe1e3[0x0][_0xaa41('0x5a')])&&_['isNil'](_0x1fe1e3[0x0][_0xaa41('0x5a')][_0xaa41('0x33')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Empty\x20Contact]',_0x1fe1e3);return{'isValid':![],'message':_0xaa41('0x108')};}var _0x53a519=this['campaignsPreview'][_0x1fe1e3[0x0][_0xaa41('0x44')]['name']];_0x53a519[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x73')];if(_[_0xaa41('0x43')](_0x53a519)){ut[_0xaa41('0xf1')](_0xaa41('0x109'),_0x53a519);return{'isValid':![],'message':_0xaa41('0x10a')};}if(!this['isTrunkReachable'](_0x53a519[_0xaa41('0x70')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0xaa41('0x10c')+_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10d'));if(!this[_0xaa41('0x71')](_0x53a519[_0xaa41('0x10e')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10f'));return{'isValid':![],'message':_0xaa41('0x110')};}}if(!ut[_0xaa41('0x6e')](_0x53a519[_0xaa41('0x111')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Campaign\x20Active]',_0x53a519[_0xaa41('0x33')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53a519['name']+_0xaa41('0x112')};}return{'isValid':!![],'message':_0xaa41('0x113')};};Preview['prototype'][_0xaa41('0xea')]=function(_0x356256,_0x1e86cc,_0x15bb60,_0x232732){var _0x34d857=this;return new Promise(function(_0x239f1b,_0x445925){var _0x1e8591=_0x356256[_0xaa41('0x8c')];var _0x347d0c=_0x34d857[_0xaa41('0x71')](_0x1e86cc[_0xaa41('0x70')])?util[_0xaa41('0x2a')](_0xaa41('0x114'),_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')],_['isNil'](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc[_0xaa41('0x115')][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60['phone'][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60['phone']):util[_0xaa41('0x2a')](_0xaa41('0x114'),_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x33')],_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc['dialPrefix'][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60[_0xaa41('0xe8')][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60[_0xaa41('0xe8')]);var _0x53dea3=_0x34d857[_0xaa41('0x71')](_0x1e86cc['Trunk'])?ut[_0xaa41('0x119')](_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut['getCallerIdRandom'](_0x1e86cc[_0xaa41('0x11d')],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc['dialOriginateCallerIdNumber']):ut[_0xaa41('0x119')](_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut[_0xaa41('0x11e')](_0x1e86cc['dialOriginateCallerIdNumber'],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc[_0xaa41('0x11d')]);if(_0x53dea3){_0x356256[_0xaa41('0x11f')]=ut['extractCalleridName'](_0x53dea3);_0x356256['originatecalleridnum']=ut[_0xaa41('0x120')](_0x53dea3);}var _0x5aee9b=ut['addVariables'](_0x1e86cc,_0x15bb60,_0x347d0c,_0x53dea3,_0x1e8591,_0x356256);_[_0xaa41('0x121')](_0x356256,ut[_0xaa41('0x122')](_0x5aee9b));_0x356256[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e86cc['variables']=_0x5aee9b;var _0xa63e60=ut[_0xaa41('0x124')](_0x356256,_0x1e86cc,_0x5aee9b,_0x356256[_0xaa41('0x83')],_0x232732);return ami[_0xaa41('0x125')](_0xa63e60)[_0xaa41('0x56')](function(_0x5e3bb2){_0x1e86cc[_0xaa41('0x2f')]+=0x1;logger[_0xaa41('0x27')]('[originated][increment]',_0x1e8591,_0xaa41('0x9c'),_0x1e86cc[_0xaa41('0x33')],'originated:\x20',_0x1e86cc[_0xaa41('0x2f')]);_0x239f1b(_0x5e3bb2);})[_0xaa41('0x4d')](function(_0x58a5e5){ut[_0xaa41('0xdc')](_0x356256,0xe,_0xaa41('0x126'));rpcDb['createAgentHistory'](_0x356256,_0xaa41('0x127'));_0x445925(_0x58a5e5);});});};Preview['prototype']['syncNewExten']=function(_0x1ffee2){if(this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]){this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]['channel']=_0x1ffee2[_0xaa41('0x128')];}};Preview['prototype']['syncOriginateResponse']=function(_0x25548d){var _0x28685a=this;var _0x2f62f6=this[_0xaa41('0x14')][_0x25548d[_0xaa41('0x129')]];if(_0x2f62f6){if(_0x2f62f6[_0xaa41('0x12a')]&&this[_0xaa41('0x15')][_0x2f62f6['lookAgent']]){ut[_0xaa41('0x12b')](_0x2f62f6,this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]][_0xaa41('0x33')],this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]]['id']);}var _0x3aafe6=_[_0xaa41('0x12c')](_0x2f62f6);_0x3aafe6[_0xaa41('0x12d')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));var _0x2e8c8f=_0x28685a['campaignsPreview'][_0x2f62f6['queue']];if(ut[_0xaa41('0x12e')](_0x25548d[_0xaa41('0x12f')])){if(_0x2f62f6[_0xaa41('0xa9')]){rpcDb['unlockContact'](_0x2f62f6[_0xaa41('0x86')]);}if(_0x2f62f6[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0x2f62f6[_0xaa41('0x86')]);}ami[_0xaa41('0x26')](_0xaa41('0x130'),ut[_0xaa41('0x7a')](_0x2f62f6,_0xaa41('0x131'),this[_0xaa41('0x25')][_0x2f62f6[_0xaa41('0x45')]]));this[_0xaa41('0x132')](_0x3aafe6,_0x2e8c8f,_0x25548d);}else{_0x2f62f6[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));ut[_0xaa41('0xdc')](_0x3aafe6,0x4,'Answer');rpcDb[_0xaa41('0xdd')](_0x3aafe6,_0xaa41('0x133'));}}};Preview[_0xaa41('0xf')]['syncHangup']=function(_0x125efb){var _0xfc1e24=this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]];var _0x21c0c6;if(_0xfc1e24){_0x21c0c6=this[_0xaa41('0x25')][_0xfc1e24[_0xaa41('0x45')]];logger[_0xaa41('0x27')]('[syncHangup][talking]',_0x125efb[_0xaa41('0x84')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);}if(this['actions'][_0x125efb[_0xaa41('0x84')]]&&_0x125efb['linkedid']!==_0x125efb[_0xaa41('0x8c')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')]);}}else if(_0xfc1e24&&_['isNil'](_0xfc1e24[_0xaa41('0x135')])&&_0x21c0c6[_0xaa41('0x136')]&&_0x125efb[_0xaa41('0x84')]===_0x125efb[_0xaa41('0x8c')]&&_[_0xaa41('0x43')](_0x125efb[_0xaa41('0xdb')])&&_0x125efb['cause']==='16'&&_0x125efb['channelstate']==='6'&&_[_0xaa41('0xd9')](_0xfc1e24['transfer'])){if(_0xfc1e24[_0xaa41('0xa9')]){rpcDb[_0xaa41('0xfd')](_0xfc1e24[_0xaa41('0x86')]);}if(_0xfc1e24[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0xfc1e24[_0xaa41('0x86')]);}_0x125efb[_0xaa41('0xdb')]='22';this[_0xaa41('0x132')](_0xfc1e24,_0x21c0c6,_0x125efb);}else if(_0xfc1e24&&_0xfc1e24[_0xaa41('0x137')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][transfer]',_0x125efb[_0xaa41('0x84')],_0x125efb['cause'],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]]['dialAnswer']){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this['callProgressDetectingCustomer'](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}}};Preview[_0xaa41('0xf')]['syncDialEnd']=function(_0x3ecde6){if(this['actions'][_0x3ecde6[_0xaa41('0x138')]]&&_0x3ecde6[_0xaa41('0x138')]!==_0x3ecde6[_0xaa41('0x139')]){this[_0xaa41('0x74')](_0x3ecde6,_0x3ecde6['destlinkedid'],_0x3ecde6[_0xaa41('0xce')]);}};Preview[_0xaa41('0xf')][_0xaa41('0x1c')]=function(_0x49e4a5){if(this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]]&&_0x49e4a5[_0xaa41('0x84')]!==_0x49e4a5[_0xaa41('0x8c')]&&!this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]][_0xaa41('0x48')]){if(_0x49e4a5[_0xaa41('0x134')]==='1'){this['callProgressDetectingCustomer'](_0x49e4a5,_0x49e4a5[_0xaa41('0x84')],_0x49e4a5['cause']);}}};Preview[_0xaa41('0xf')][_0xaa41('0x13a')]=function(_0x1fa855,_0x272f3f,_0x36cdd2){if(this[_0xaa41('0x14')][_0x1fa855]){if(_[_0xaa41('0x43')](this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')])){this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')]={};}this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')][_0x272f3f]=_0x36cdd2;}};Preview['prototype'][_0xaa41('0x21')]=function(_0x366b1c){try{if(!_[_0xaa41('0x43')](_0x366b1c)){if(ut[_0xaa41('0x13c')](_[_0xaa41('0x13d')](_0x366b1c[_0xaa41('0x13e')])[0x0])){this[_0xaa41('0x13a')](_0x366b1c[_0xaa41('0x8c')],_[_0xaa41('0x13d')](_0x366b1c['variable'])[0x0],_0x366b1c[_0xaa41('0x13f')]);}}}catch(_0x30a438){logger[_0xaa41('0x140')](_0xaa41('0x141'),util[_0xaa41('0x142')](_0x30a438,{'showHidden':![],'depth':null}));}};Preview[_0xaa41('0xf')][_0xaa41('0x143')]=function(_0x3f1b1a){if(_0x3f1b1a){if(this[_0xaa41('0x14')][_0x3f1b1a[_0xaa41('0x144')]]){this['actions'][_0x3f1b1a['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xaa41('0xf')][_0xaa41('0x24')]=function(_0x5ccba6){if(_0x5ccba6){if(this[_0xaa41('0x14')][_0x5ccba6[_0xaa41('0x145')]]){this['actions'][_0x5ccba6[_0xaa41('0x145')]]['transfer']=!![];}}};module[_0xaa41('0x146')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 0ff0a13..0b175c2 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 _0xb4e5=['../rpc/agentReportPreview','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack'];(function(_0x576b7f,_0x29a11c){var _0x55719b=function(_0x5509f4){while(--_0x5509f4){_0x576b7f['push'](_0x576b7f['shift']());}};_0x55719b(++_0x29a11c);}(_0xb4e5,0x1da));var _0x5b4e=function(_0x1565a8,_0x630c41){_0x1565a8=_0x1565a8-0x0;var _0x370252=_0xb4e5[_0x1565a8];return _0x370252;};'use strict';var util=require(_0x5b4e('0x0'));var BPromise=require(_0x5b4e('0x1'));var logger=require('../../../config/logger')(_0x5b4e('0x2'));var cmHopper=require(_0x5b4e('0x3'));var cmHopperHistory=require(_0x5b4e('0x4'));var cmHopperBlack=require(_0x5b4e('0x5'));var agentReportPreview=require(_0x5b4e('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x511a01){return function(_0x2e3146){logger[_0x5b4e('0x7')](_0x511a01,util[_0x5b4e('0x8')](_0x2e3146,{'showHidden':![],'depth':null}));};}function create(_0x5f5947){return cmHopperHistory['createHistory'](_0x5f5947)[_0x5b4e('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x571c91){return BPromise[_0x5b4e('0xa')]()[_0x5b4e('0xb')](agentReportPreview[_0x5b4e('0xc')](_0x571c91))['catch'](loggerCatch(_0x5b4e('0xd')));}function moveContact(_0x1f3135){return cmHopper[_0x5b4e('0xe')](_0x1f3135,!![])[_0x5b4e('0x9')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x5b4e('0xf')]=function(_0xf6954d){return cmHopperBlack[_0x5b4e('0xf')](_0xf6954d)[_0x5b4e('0x9')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x23b9f4){return BPromise[_0x5b4e('0xa')]()['then'](cmHopper[_0x5b4e('0x10')](_0x23b9f4))[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x11')));};exports[_0x5b4e('0xc')]=function(_0x23aea0,_0x23e6da){create(_0x23aea0)[_0x5b4e('0x9')](loggerCatch(_0x23e6da));moveContact(_0x23aea0)[_0x5b4e('0x9')](loggerCatch(_0x23e6da));};exports[_0x5b4e('0x12')]=function(_0x163a2b,_0x5915ad){createAgent(_0x163a2b)[_0x5b4e('0x9')](loggerCatch(_0x5915ad));};exports['createCustomerHistory']=function(_0x3cc399,_0x553c76){create(_0x3cc399)['catch'](loggerCatch(_0x553c76));};exports[_0x5b4e('0x13')]=function(_0x4d91fe,_0x2dcf4a){moveContact(_0x4d91fe)[_0x5b4e('0x9')](loggerCatch(_0x2dcf4a));};exports[_0x5b4e('0x14')]=function(_0x258939,_0x1d2eab,_0x14fd97){if(_0x1d2eab){_0x258939[_0x5b4e('0x15')]=null;}if(_0x14fd97){_0x258939[_0x5b4e('0x16')]=![];}return cmHopper[_0x5b4e('0x14')](_0x258939)['catch'](loggerCatch(_0x5b4e('0x17')));};exports[_0x5b4e('0x18')]=function(_0x53aa79){return cmHopper[_0x5b4e('0x18')](_0x53aa79)[_0x5b4e('0x9')](loggerCatch('[countReScheduled]\x20'));};exports[_0x5b4e('0x19')]=function(_0x301454){return cmHopper[_0x5b4e('0x19')]({'UserId':null},_0x301454,0x1)[_0x5b4e('0x9')](loggerCatch('[unlockContact]\x20'));};exports[_0x5b4e('0x1a')]=function(_0x179f28){return cmHopper['unlockContact']({'active':![]},_0x179f28,0x1)[_0x5b4e('0x9')](loggerCatch('[activeContact]\x20'));};exports[_0x5b4e('0x1b')]=function(_0x3bdde0){var _0xc20eb9={};_0xc20eb9[_0x5b4e('0x1c')]=_0x3bdde0[_0x5b4e('0x1c')];_0xc20eb9['uniqueid']=_0x3bdde0[_0x5b4e('0x1d')];_0xc20eb9['calleridnum']=_0x3bdde0['calleridnum'];_0xc20eb9['calleridname']=_0x3bdde0[_0x5b4e('0x1e')];_0xc20eb9['queue']=_0x3bdde0['queue'];_0xc20eb9[_0x5b4e('0x1f')]=_0x3bdde0[_0x5b4e('0x20')];_0xc20eb9[_0x5b4e('0x21')]=_0x3bdde0[_0x5b4e('0x20')];_0xc20eb9['queuecallercomplete']=0x1;_0xc20eb9['queuecallercompleteAt']=_0x3bdde0[_0x5b4e('0x22')];_0xc20eb9[_0x5b4e('0x23')]=_0x3bdde0[_0x5b4e('0x24')];_0xc20eb9['context']=_0x5b4e('0x25');_0xc20eb9[_0x5b4e('0x26')]=_0x5b4e('0x27');_0xc20eb9['holdtime']=0x0;_0xc20eb9[_0x5b4e('0x28')]=0x1;_0xc20eb9[_0x5b4e('0x29')]=_0x3bdde0[_0x5b4e('0x24')];_0xc20eb9['queuecallerexitreason']='COMPLETED';return BPromise[_0x5b4e('0xa')]()[_0x5b4e('0xb')](voiceQueueReport[_0x5b4e('0x2a')](_0xc20eb9))['catch'](loggerCatch(_0x5b4e('0x2b')));};exports['getContactRecallMe']=function(_0x4df537,_0xad4e52){return BPromise['resolve']()[_0x5b4e('0xb')](cmHopper[_0x5b4e('0x2c')](_0x4df537,_0xad4e52))[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x2d')));};exports[_0x5b4e('0x2e')]=function(_0x465a42){return cmHopper[_0x5b4e('0x14')](_0x465a42,!![],!![])[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x2f')));}; \ No newline at end of file +var _0xb791=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type'];(function(_0x691235,_0x72d709){var _0x5cbaf8=function(_0x43e9dd){while(--_0x43e9dd){_0x691235['push'](_0x691235['shift']());}};_0x5cbaf8(++_0x72d709);}(_0xb791,0x129));var _0x1b79=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb791[_0x1a36a5];return _0x746243;};'use strict';var util=require(_0x1b79('0x0'));var BPromise=require(_0x1b79('0x1'));var logger=require(_0x1b79('0x2'))(_0x1b79('0x3'));var cmHopper=require(_0x1b79('0x4'));var cmHopperHistory=require(_0x1b79('0x5'));var cmHopperBlack=require(_0x1b79('0x6'));var agentReportPreview=require(_0x1b79('0x7'));var voiceQueueReport=require(_0x1b79('0x8'));function loggerCatch(_0x2bebdb){return function(_0x137f9f){logger[_0x1b79('0x9')](_0x2bebdb,util['inspect'](_0x137f9f,{'showHidden':![],'depth':null}));};}function create(_0x59380d){return cmHopperHistory['createHistory'](_0x59380d)[_0x1b79('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x27163b){return BPromise[_0x1b79('0xb')]()[_0x1b79('0xc')](agentReportPreview[_0x1b79('0xd')](_0x27163b))[_0x1b79('0xa')](loggerCatch(_0x1b79('0xe')));}function moveContact(_0x3a8618){return cmHopper[_0x1b79('0xf')](_0x3a8618,!![])[_0x1b79('0xa')](loggerCatch(_0x1b79('0x10')));}exports[_0x1b79('0x11')]=function(_0x186acd){return cmHopperBlack[_0x1b79('0x11')](_0x186acd)[_0x1b79('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x1b79('0x12')]=function(_0x33e74a){return BPromise[_0x1b79('0xb')]()[_0x1b79('0xc')](cmHopper[_0x1b79('0x12')](_0x33e74a))[_0x1b79('0xa')](loggerCatch(_0x1b79('0x13')));};exports['createHistory']=function(_0x4621ec,_0x418c26){create(_0x4621ec)[_0x1b79('0xa')](loggerCatch(_0x418c26));moveContact(_0x4621ec)[_0x1b79('0xa')](loggerCatch(_0x418c26));};exports['createAgentHistory']=function(_0x5d139b,_0x3370ea){createAgent(_0x5d139b)[_0x1b79('0xa')](loggerCatch(_0x3370ea));};exports[_0x1b79('0x14')]=function(_0x30ec13,_0x25526b){create(_0x30ec13)[_0x1b79('0xa')](loggerCatch(_0x25526b));};exports[_0x1b79('0x15')]=function(_0x1303f9,_0x2d65d2){moveContact(_0x1303f9)[_0x1b79('0xa')](loggerCatch(_0x2d65d2));};exports['rescheduleContact']=function(_0x46607c,_0x1a31f3,_0xf2d849){if(_0x1a31f3){_0x46607c[_0x1b79('0x16')]=null;}if(_0xf2d849){_0x46607c[_0x1b79('0x17')]=![];}return cmHopper[_0x1b79('0x18')](_0x46607c)[_0x1b79('0xa')](loggerCatch(_0x1b79('0x19')));};exports[_0x1b79('0x1a')]=function(_0x568743){return cmHopper[_0x1b79('0x1a')](_0x568743)['catch'](loggerCatch(_0x1b79('0x1b')));};exports['unlockContact']=function(_0x2c133f){return cmHopper[_0x1b79('0x1c')]({'UserId':null},_0x2c133f,0x1)['catch'](loggerCatch(_0x1b79('0x1d')));};exports[_0x1b79('0x1e')]=function(_0x5782c9){return cmHopper[_0x1b79('0x1c')]({'active':![]},_0x5782c9,0x1)[_0x1b79('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0x1b79('0x1f')]=function(_0x3f01ee){var _0x4ff4fa={};_0x4ff4fa[_0x1b79('0x20')]=_0x3f01ee[_0x1b79('0x20')];_0x4ff4fa[_0x1b79('0x21')]=_0x3f01ee['uniqueid'];_0x4ff4fa[_0x1b79('0x22')]=_0x3f01ee[_0x1b79('0x22')];_0x4ff4fa[_0x1b79('0x23')]=_0x3f01ee[_0x1b79('0x23')];_0x4ff4fa[_0x1b79('0x24')]=_0x3f01ee[_0x1b79('0x24')];_0x4ff4fa[_0x1b79('0x25')]=_0x3f01ee['answertime'];_0x4ff4fa[_0x1b79('0x26')]=_0x3f01ee[_0x1b79('0x27')];_0x4ff4fa[_0x1b79('0x28')]=0x1;_0x4ff4fa[_0x1b79('0x29')]=_0x3f01ee[_0x1b79('0x2a')];_0x4ff4fa[_0x1b79('0x2b')]=_0x3f01ee[_0x1b79('0x2c')];_0x4ff4fa[_0x1b79('0x2d')]=_0x1b79('0x2e');_0x4ff4fa[_0x1b79('0x2f')]='xcally-motion-preview';_0x4ff4fa[_0x1b79('0x30')]=0x0;_0x4ff4fa[_0x1b79('0x31')]=0x1;_0x4ff4fa[_0x1b79('0x32')]=_0x3f01ee[_0x1b79('0x2c')];_0x4ff4fa['queuecallerexitreason']='COMPLETED';return BPromise['resolve']()[_0x1b79('0xc')](voiceQueueReport[_0x1b79('0x33')](_0x4ff4fa))[_0x1b79('0xa')](loggerCatch(_0x1b79('0x34')));};exports[_0x1b79('0x35')]=function(_0x41cccf,_0x41e377){return BPromise[_0x1b79('0xb')]()[_0x1b79('0xc')](cmHopper[_0x1b79('0x35')](_0x41cccf,_0x41e377))[_0x1b79('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x30ea5c){return cmHopper[_0x1b79('0x18')](_0x30ea5c,!![],!![])[_0x1b79('0xa')](loggerCatch(_0x1b79('0x36')));}; \ 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 f3b5650..92f6684 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 _0x1e1c=['reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','message','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','getSeconds','logLookAgent','membername','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','uniqueid','agentReadyId','not_inuse','status'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1e1c,0x154));var _0xc1e1=function(_0x2b71ec,_0x300588){_0x2b71ec=_0x2b71ec-0x0;var _0x568291=_0x1e1c[_0x2b71ec];return _0x568291;};'use strict';var util=require('util');var _=require(_0xc1e1('0x0'));var moment=require(_0xc1e1('0x1'));var logger=require(_0xc1e1('0x2'))(_0xc1e1('0x3'));var ipAgi=process['env'][_0xc1e1('0x4')]||_0xc1e1('0x5');var utils=require(_0xc1e1('0x6'));exports[_0xc1e1('0x7')]=function(_0x5e8230){return function(_0x55bec2){logger['error'](_0x5e8230,util[_0xc1e1('0x8')](_0x55bec2,{'showHidden':![],'depth':null}));};};exports[_0xc1e1('0x9')]=function(_0x5877a8,_0x32dfd7){logger[_0xc1e1('0xa')](_0x5877a8,util['inspect'](_0x32dfd7,{'showHidden':![],'depth':null}));};exports[_0xc1e1('0xb')]=function(_0x21b146,_0x56ffc8){logger['error'](_0x21b146,util[_0xc1e1('0x8')](_0x56ffc8,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x479c23){return function(_0x4dd72f){logger[_0xc1e1('0xa')](_0x479c23,util[_0xc1e1('0x8')](_0x4dd72f,{'showHidden':![],'depth':null}));};};exports[_0xc1e1('0xc')]=function(_0x1dce41,_0x12373f,_0x51dd89){return{'message':_0x1dce41,'unlock':_0x12373f,'active':_0x51dd89};};exports['getCallerId']=function(_0x428e77,_0x3db2aa,_0x544683){if(!_[_0xc1e1('0xd')](_0x544683)&&'string'===typeof _0x544683&&!_[_0xc1e1('0xe')](_0x544683)){if(!_[_0xc1e1('0xd')](_0x3db2aa)&&'string'===typeof _0x3db2aa&&!_[_0xc1e1('0xe')](_0x3db2aa)){return util[_0xc1e1('0xf')](_0xc1e1('0x10'),_0x3db2aa,_0x544683);}return util[_0xc1e1('0xf')]('\x22%s\x22\x20<%s>',_0x544683,_0x544683);}if(!_[_0xc1e1('0xd')](_0x428e77)&&'string'===typeof _0x428e77&&!_[_0xc1e1('0xe')](_0x428e77)){return _0x428e77;}return'\x22\x22\x20<>';};exports[_0xc1e1('0x11')]=function(_0xbf6bdb){if(_[_0xc1e1('0x12')](_0xbf6bdb)){return![];}return _0xbf6bdb;};exports['addVariables']=function(_0x4ff67d,_0x5f3c28,_0x1ce7a3,_0x2fb618,_0x5ec90c,_0x520e5d){var _0x5e78bc={'XMD-QUEUE':_0x5f3c28['Queue']?_0x5f3c28['Queue'][_0xc1e1('0x13')]:'','XMD-CALLERID':_0x2fb618,'XMD-CALLERID-PREVIEW':_0x520e5d?util['format'](_0xc1e1('0x10'),_0x520e5d[_0xc1e1('0x14')],_0x520e5d[_0xc1e1('0x15')]):_0x2fb618,'XMD-DIALID':_0x5ec90c,'XMD-CONTACTID':_0x5f3c28[_0xc1e1('0x16')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2fb618,'XMD-VOICEQUEUEID':_0x5f3c28[_0xc1e1('0x17')],'XMD-DIALCHANNEL':_0x1ce7a3,'XMD-DIALTIMEOUT':_0x4ff67d[_0xc1e1('0x18')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xc1e1('0x19'),_0x4ff67d[_0xc1e1('0x1a')]?'g':'',_[_0xc1e1('0xe')](_0x4ff67d[_0xc1e1('0x1b')])?'':_0xc1e1('0x1c')),'XMD-DIALURL':_0x4ff67d[_0xc1e1('0x1d')]||'','XMD-AGI':_0x4ff67d['dialQueueProject']?util[_0xc1e1('0xf')](_0xc1e1('0x1e'),ipAgi,_0x4ff67d[_0xc1e1('0x1f')]):_0xc1e1('0x20'),'XMD-AGIAFTER':_0x4ff67d[_0xc1e1('0x1a')]?util['format'](_0xc1e1('0x1e'),ipAgi,_0x4ff67d[_0xc1e1('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x520e5d?_0x520e5d[_0xc1e1('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x520e5d?_0x520e5d['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xc1e1('0x22')};if(!_['isEmpty'](_0x4ff67d[_0xc1e1('0x1b')])){_0x5e78bc[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4ff67d[_0xc1e1('0x1b')];_0x5e78bc[util['format']('%s',_0xc1e1('0x23'))]=_0x5ec90c;}if(_0x5f3c28&&_0x5f3c28[_0xc1e1('0x24')]){for(var _0x5e8ad9 in _0x5f3c28[_0xc1e1('0x24')]){if(_0x5f3c28[_0xc1e1('0x24')][_0xc1e1('0x25')](_0x5e8ad9)){if(!_[_0xc1e1('0x12')](_0x5f3c28['Contact'][_0x5e8ad9])&&_0x5e8ad9!=='id'&&_0x5e8ad9!==_0xc1e1('0x26')&&_0x5e8ad9!==_0xc1e1('0x27')&&_0x5e8ad9!==_0xc1e1('0x28')){_0x5e78bc[util['format'](_0xc1e1('0x29'),'XMD-',_[_0xc1e1('0x2a')](_0x5e8ad9))]=_0x5f3c28['Contact'][_0x5e8ad9];}}}}return _0x5e78bc;};exports[_0xc1e1('0x2b')]=function(_0x5301a7){var _0x13173c={};for(var _0x37262d in _0x5301a7){if(_0x5301a7[_0xc1e1('0x25')](_0x37262d)){_0x13173c[util[_0xc1e1('0xf')]('%s',_[_0xc1e1('0x2c')](_0x37262d))]=_0x5301a7[_0x37262d];}}return{'variables':_0x13173c};};exports[_0xc1e1('0x2d')]=function(_0x1c826,_0x1c4a07){if(!_[_0xc1e1('0x12')](_0x1c826)){if(_0x1c826['hasOwnProperty'](_0xc1e1('0x2e'))){if(_0x1c826[_0xc1e1('0x2e')]>0x0){_0x1c826[_0xc1e1('0x2e')]-=0x1;}else{logger[_0xc1e1('0x2f')](_0xc1e1('0x30'),_0x1c4a07);}}}else{logger[_0xc1e1('0x2f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1c4a07);}};exports[_0xc1e1('0x31')]=function(_0x24c459){var _0x2cfdd8=moment()[_0xc1e1('0xf')](_0xc1e1('0x32'));_0x24c459[_0xc1e1('0x33')]=0xd;_0x24c459[_0xc1e1('0x34')]='Blacklist';_0x24c459[_0xc1e1('0x35')]=_0x2cfdd8;_0x24c459[_0xc1e1('0x36')]=_0x2cfdd8;_0x24c459[_0xc1e1('0x37')]=_0x2cfdd8;};exports[_0xc1e1('0x38')]=function(_0x297b92,_0x5d7506,_0x3c2d86){var _0x2a7ef3=moment()['format'](_0xc1e1('0x32'));_0x297b92[_0xc1e1('0x33')]=_0x5d7506;_0x297b92[_0xc1e1('0x34')]=_0x3c2d86;_0x297b92[_0xc1e1('0x36')]=_0x2a7ef3;_0x297b92['ringtime']=utils[_0xc1e1('0x39')](_0x297b92[_0xc1e1('0x36')],_0x297b92[_0xc1e1('0x35')]);};exports[_0xc1e1('0x3a')]=function(_0x55f72,_0x3e8c7a,_0x2a2355){_0x55f72[_0xc1e1('0x3b')]=_0x3e8c7a;_0x55f72['UserId']=_0x2a2355;};exports[_0xc1e1('0x3c')]=function(_0x3a0ea2,_0x50ca0f,_0x57beac){var _0x2421f2=moment()['format'](_0xc1e1('0x32'));_0x3a0ea2['state']=_0x50ca0f;_0x3a0ea2[_0xc1e1('0x34')]=_0x57beac;_0x3a0ea2[_0xc1e1('0x36')]=_0x3a0ea2[_0xc1e1('0x36')]?_0x3a0ea2[_0xc1e1('0x36')]:_0x2421f2;_0x3a0ea2[_0xc1e1('0x37')]=_0x3a0ea2[_0xc1e1('0x37')]?_0x3a0ea2[_0xc1e1('0x37')]:_0x2421f2;_0x3a0ea2[_0xc1e1('0x3d')]=utils[_0xc1e1('0x39')](_0x3a0ea2['responsetime']||0x0,_0x3a0ea2[_0xc1e1('0x35')]||0x0);_0x3a0ea2[_0xc1e1('0x3e')]=_0x3a0ea2[_0xc1e1('0x3f')]?utils[_0xc1e1('0x39')](_0x3a0ea2['endtime'],_0x3a0ea2['answertime']):0x0;};exports['isFailure']=function(_0x31ceb6){return _0x31ceb6===_0xc1e1('0x40');};exports[_0xc1e1('0x41')]=function(_0x1103c8,_0x36ae6a,_0x56cfe5,_0xe5781,_0x4f3100){var _0x2331f0=_0xe5781?_0xc1e1('0x42'):_0x1103c8['calleridname'];_0x2331f0=_0x4f3100?_0xc1e1('0x43'):_0x2331f0;return{'actionid':_0x1103c8['uniqueid'],'action':_0xc1e1('0x44'),'channel':_0x1103c8['channelAgent'],'callerid':util[_0xc1e1('0xf')](_0xc1e1('0x10'),_0x2331f0,_0x1103c8[_0xc1e1('0x15')]),'Exten':_0xc1e1('0x45'),'Context':_0xc1e1('0x46'),'Priority':'1','variable':_0x56cfe5,'timeout':(_0x36ae6a[_0xc1e1('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1103c8['uniqueid']};};exports[_0xc1e1('0x48')]=function(_0x205f6e){return _0x205f6e[_0xc1e1('0x49')]+_0x205f6e[_0xc1e1('0x4a')]+_0x205f6e['countnoanswerretry']+_0x205f6e[_0xc1e1('0x4b')]+_0x205f6e[_0xc1e1('0x4c')];};exports[_0xc1e1('0x4d')]=function(_0x11e985){var _0x56ec4c=_[_0xc1e1('0x4e')](_0x11e985);_0x56ec4c['state']=0xf;_0x56ec4c[_0xc1e1('0x34')]=_0xc1e1('0x4f');return _0x56ec4c;};exports[_0xc1e1('0x50')]=function(_0x5bfb97,_0x343c48,_0x1c43a9){var _0x247fa7={};_0x247fa7[_0x343c48]=_0x5bfb97[_0x343c48];_0x247fa7[_0xc1e1('0x51')]=![];_0x247fa7[_0xc1e1('0x52')]=moment()[_0xc1e1('0x53')](_0x1c43a9,_0xc1e1('0x54'))[_0xc1e1('0xf')](_0xc1e1('0x32'));_0x247fa7[_0xc1e1('0x16')]=_0x5bfb97['ContactId'];_0x247fa7[_0xc1e1('0x55')]=_0x5bfb97[_0xc1e1('0x55')];_0x247fa7[_0xc1e1('0x17')]=_0x5bfb97[_0xc1e1('0x17')]||undefined;return _0x247fa7;};exports[_0xc1e1('0x56')]=function(_0x35a724,_0x316f76){if(!_[_0xc1e1('0x12')](_0x35a724)){if(_0x35a724[_0xc1e1('0x57')]>0x0){_0x35a724[_0xc1e1('0x57')]-=0x1;}else{logger[_0xc1e1('0x2f')](_0x316f76,_0xc1e1('0x58'));}}else{logger[_0xc1e1('0x2f')](_0x316f76,_0xc1e1('0x59'));}};exports['IsNotLoggedIn']=function(_0x504b7d){if(_0x504b7d<=0x0){return!![];}return![];};function buildObj(_0x2e4aa7,_0x36d2e6,_0x57f1f1){_0x2e4aa7[_0xc1e1('0x5a')]=_0x36d2e6;_0x2e4aa7[_0xc1e1('0x13')]=_0x2e4aa7[_0xc1e1('0x5b')];_0x2e4aa7['interface']=_0x2e4aa7[_0xc1e1('0x5c')];_0x2e4aa7[_0xc1e1('0x5d')]=_0xc1e1('0x5e');if(_0x57f1f1){_0x2e4aa7[_0xc1e1('0x5f')]=_0x57f1f1['mandatoryDisposition'];}return _0x2e4aa7;}exports[_0xc1e1('0x60')]=buildObj;exports['buildAcw']=function(_0xed2ad2){var _0x27d87c={};_0x27d87c[_0xc1e1('0x5b')]=_0xed2ad2[_0xc1e1('0x5b')];_0x27d87c['interface']=_0xed2ad2[_0xc1e1('0x5c')];_0x27d87c[_0xc1e1('0x61')]=_0xed2ad2[_0xc1e1('0x61')];return _0x27d87c;};exports[_0xc1e1('0x62')]=function(_0x445430){var _0x3344ec=[];for(var _0x15d4f2 in _0x445430){if(_0x445430[_0xc1e1('0x25')](_0x15d4f2)){if(!_['isNil'](_0x445430[_0x15d4f2])&&_0x445430[_0x15d4f2][_0xc1e1('0x33')]===_0xc1e1('0x63')&&_0x445430[_0x15d4f2][_0xc1e1('0x64')]===_0xc1e1('0x65')){_0x3344ec[_0xc1e1('0x66')](_0x445430[_0x15d4f2]['id']);}}}return _0x3344ec;};exports[_0xc1e1('0x67')]=function(_0x4937d0){var _0x28e3d9=moment()[_0xc1e1('0x68')](0x0);var _0x24e8d4=moment(_0x4937d0)[_0xc1e1('0x68')](0x0);return _0x28e3d9[_0xc1e1('0x69')](_0x24e8d4,'seconds');};exports[_0xc1e1('0x6a')]=function(_0x48b5d5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x48b5d5[_0xc1e1('0x16')],'ListId':_0x48b5d5[_0xc1e1('0x55')],'VoiceQueueId':_0x48b5d5[_0xc1e1('0x17')]||undefined,'CampaignId':_0x48b5d5['CampaignId']||undefined};};exports[_0xc1e1('0x6b')]=function(_0x2d8658){if(_0x2d8658===_0xc1e1('0x61')||_0x2d8658===_0xc1e1('0x6c')||_0x2d8658===_0xc1e1('0x5b')||_0x2d8658===_0xc1e1('0x6d')||_0x2d8658===_0xc1e1('0x6e')||_0x2d8658===_0xc1e1('0x6f')||_0x2d8658===_0xc1e1('0x3b')||_0x2d8658===_0xc1e1('0x5c')||_0x2d8658==='calleridname'||_0x2d8658===_0xc1e1('0x51')||_0x2d8658==='calleridnum'||_0x2d8658==='scheduledat'||_0x2d8658===_0xc1e1('0x49')||_0x2d8658===_0xc1e1('0x4a')||_0x2d8658===_0xc1e1('0x70')||_0x2d8658===_0xc1e1('0x71')||_0x2d8658==='callback'||_0x2d8658===_0xc1e1('0x72')||_0x2d8658===_0xc1e1('0x73')||_0x2d8658==='recallme'||_0x2d8658===_0xc1e1('0x16')||_0x2d8658==='ListId'||_0x2d8658===_0xc1e1('0x74')||_0x2d8658===_0xc1e1('0x17')||_0x2d8658===_0xc1e1('0x75')||_0x2d8658===_0xc1e1('0x76')||_0x2d8658==='xmd-queue'||_0x2d8658===_0xc1e1('0x77')||_0x2d8658===_0xc1e1('0x78')||_0x2d8658==='xmd-dialurl'||_0x2d8658==='xmd-dialtimeout'||_0x2d8658===_0xc1e1('0x79')||_0x2d8658===_0xc1e1('0x7a')||_0x2d8658==='xmd-dialchannel'||_0x2d8658===_0xc1e1('0x7b')||_0x2d8658===_0xc1e1('0x7c')||_0x2d8658==='xmd-callerid'||_0x2d8658==='xmd-agiafter'||_0x2d8658===_0xc1e1('0x7d')||_0x2d8658===_0xc1e1('0x7e')||_0x2d8658===_0xc1e1('0x7f')||_0x2d8658===_0xc1e1('0x80')||_0x2d8658==='rtpaudioqosjitterbridged'||_0x2d8658===_0xc1e1('0x81')||_0x2d8658===_0xc1e1('0x82')||_0x2d8658===_0xc1e1('0x83')||_0x2d8658==='rtpaudioqosrttbridged'||_0x2d8658===_0xc1e1('0x7e')||_0x2d8658===_0xc1e1('0x7f')||_0x2d8658===_0xc1e1('0x80')||_0x2d8658===_0xc1e1('0x84')||_0x2d8658===_0xc1e1('0x81')||_0x2d8658===_0xc1e1('0x82')||_0x2d8658===_0xc1e1('0x83')||_0x2d8658===_0xc1e1('0x85')||_0x2d8658===_0xc1e1('0x86')||_0x2d8658===_0xc1e1('0x87')||_0x2d8658===_0xc1e1('0x33')||_0x2d8658===_0xc1e1('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x15496a,_0x2a3916){var _0x3b5f04,_0x3e0492,_0x3b9c6f;if(_0x2a3916<=0x0){_0x2a3916=0x1;}_0x3b5f04=new RegExp(_0xc1e1('0x88')+_0x2a3916+'}$');_0x3e0492=Math[_0xc1e1('0x89')](0xa,_0x2a3916-0x1);_0x3b9c6f=Math['pow'](0xa,_0x2a3916)-0x1;return util[_0xc1e1('0xf')]('%s',_[_0xc1e1('0x8a')](_0x15496a,_0x3b5f04,_[_0xc1e1('0x8b')](_0x3e0492,_0x3b9c6f)));};exports[_0xc1e1('0x8c')]=function(_0x292803){var _0x355c63=_0x292803[_0xc1e1('0x8d')](/"(.*?)"/);return _0x355c63?_0x355c63[0x1]:_0x292803;};exports['extractCalleridNumber']=function(_0x1fe95e){var _0x238625=_0x1fe95e['match'](/<(.*?)>/);return _0x238625?_0x238625[0x1]:_0x1fe95e;};function buildNoAnswerEventPayload(_0x5d44e1,_0x445405){var _0x5377b3=buildObj(_0x5d44e1,_0xc1e1('0x8e'));if(!_[_0xc1e1('0xe')](_0x445405[_0xc1e1('0x8f')])){Object[_0xc1e1('0x90')](_0x445405[_0xc1e1('0x8f')])['forEach'](function(_0xf1cbd4){_0x5377b3[_0xf1cbd4[_0xc1e1('0x91')]()]=_0x445405[_0xc1e1('0x8f')][_0xf1cbd4];});}return _0x5377b3;}exports[_0xc1e1('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xc57a=['state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','getSeconds','logLookAgent','UserId','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','channelAgent','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','membername','active','calleridnum','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridNumber','match','keys','variables','forEach','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','error','inspect','logger','info','loggerError','message','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11ac99,_0x4141bb){var _0x101761=function(_0x61c474){while(--_0x61c474){_0x11ac99['push'](_0x11ac99['shift']());}};_0x101761(++_0x4141bb);}(_0xc57a,0xf6));var _0xac57=function(_0x563a7e,_0x4d543a){_0x563a7e=_0x563a7e-0x0;var _0x4f7bd4=_0xc57a[_0x563a7e];return _0x4f7bd4;};'use strict';var util=require(_0xac57('0x0'));var _=require(_0xac57('0x1'));var moment=require('moment');var logger=require(_0xac57('0x2'))('preview');var ipAgi=process[_0xac57('0x3')][_0xac57('0x4')]||'127.0.0.1';var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0xb0fb76){return function(_0x3c3a0e){logger[_0xac57('0x5')](_0xb0fb76,util[_0xac57('0x6')](_0x3c3a0e,{'showHidden':![],'depth':null}));};};exports[_0xac57('0x7')]=function(_0x3c9eec,_0x313f29){logger[_0xac57('0x8')](_0x3c9eec,util[_0xac57('0x6')](_0x313f29,{'showHidden':![],'depth':null}));};exports[_0xac57('0x9')]=function(_0x38e1a4,_0x418c20){logger[_0xac57('0x5')](_0x38e1a4,util[_0xac57('0x6')](_0x418c20,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5763dd){return function(_0x26b5f4){logger[_0xac57('0x8')](_0x5763dd,util[_0xac57('0x6')](_0x26b5f4,{'showHidden':![],'depth':null}));};};exports[_0xac57('0xa')]=function(_0x292cf6,_0x403c42,_0x151e16){return{'message':_0x292cf6,'unlock':_0x403c42,'active':_0x151e16};};exports['getCallerId']=function(_0x3994be,_0x3aac8d,_0x39b5b2){if(!_['isUndefined'](_0x39b5b2)&&_0xac57('0xb')===typeof _0x39b5b2&&!_['isEmpty'](_0x39b5b2)){if(!_[_0xac57('0xc')](_0x3aac8d)&&'string'===typeof _0x3aac8d&&!_[_0xac57('0xd')](_0x3aac8d)){return util[_0xac57('0xe')](_0xac57('0xf'),_0x3aac8d,_0x39b5b2);}return util[_0xac57('0xe')](_0xac57('0xf'),_0x39b5b2,_0x39b5b2);}if(!_['isUndefined'](_0x3994be)&&'string'===typeof _0x3994be&&!_['isEmpty'](_0x3994be)){return _0x3994be;}return _0xac57('0x10');};exports[_0xac57('0x11')]=function(_0x3830c0){if(_[_0xac57('0x12')](_0x3830c0)){return![];}return _0x3830c0;};exports[_0xac57('0x13')]=function(_0x1712a4,_0x1a8a8a,_0x26bcf8,_0x18988a,_0x3494a9,_0x47284a){var _0x471129={'XMD-QUEUE':_0x1a8a8a['Queue']?_0x1a8a8a[_0xac57('0x14')]['name']:'','XMD-CALLERID':_0x18988a,'XMD-CALLERID-PREVIEW':_0x47284a?util['format'](_0xac57('0xf'),_0x47284a[_0xac57('0x15')],_0x47284a['calleridnum']):_0x18988a,'XMD-DIALID':_0x3494a9,'XMD-CONTACTID':_0x1a8a8a[_0xac57('0x16')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x18988a,'XMD-VOICEQUEUEID':_0x1a8a8a[_0xac57('0x17')],'XMD-DIALCHANNEL':_0x26bcf8,'XMD-DIALTIMEOUT':_0x1712a4[_0xac57('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0xac57('0xe')]('\x22rtTxX%s%s\x22',_0x1712a4[_0xac57('0x19')]?'g':'',_['isEmpty'](_0x1712a4[_0xac57('0x1a')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1712a4[_0xac57('0x1b')]||'','XMD-AGI':_0x1712a4[_0xac57('0x1c')]?util['format'](_0xac57('0x1d'),ipAgi,_0x1712a4[_0xac57('0x1c')]):_0xac57('0x1e'),'XMD-AGIAFTER':_0x1712a4[_0xac57('0x19')]?util[_0xac57('0xe')](_0xac57('0x1d'),ipAgi,_0x1712a4[_0xac57('0x19')]):_0xac57('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x47284a?_0x47284a[_0xac57('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x47284a?_0x47284a['originatecalleridname']:'','XMD-DESTINATION':_0xac57('0x20'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xac57('0xd')](_0x1712a4[_0xac57('0x1a')])){_0x471129[util[_0xac57('0xe')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1712a4['monitor_format'];_0x471129[util['format']('%s',_0xac57('0x21'))]=_0x3494a9;}if(_0x1a8a8a&&_0x1a8a8a['Contact']){for(var _0x35f828 in _0x1a8a8a[_0xac57('0x22')]){if(_0x1a8a8a[_0xac57('0x22')][_0xac57('0x23')](_0x35f828)){if(!_[_0xac57('0x12')](_0x1a8a8a[_0xac57('0x22')][_0x35f828])&&_0x35f828!=='id'&&_0x35f828!=='tags'&&_0x35f828!=='createdAt'&&_0x35f828!==_0xac57('0x24')){_0x471129[util['format'](_0xac57('0x25'),_0xac57('0x26'),_[_0xac57('0x27')](_0x35f828))]=_0x1a8a8a[_0xac57('0x22')][_0x35f828];}}}}return _0x471129;};exports[_0xac57('0x28')]=function(_0x21da2a){var _0x13e806={};for(var _0x257ae1 in _0x21da2a){if(_0x21da2a[_0xac57('0x23')](_0x257ae1)){_0x13e806[util[_0xac57('0xe')]('%s',_[_0xac57('0x29')](_0x257ae1))]=_0x21da2a[_0x257ae1];}}return{'variables':_0x13e806};};exports[_0xac57('0x2a')]=function(_0x995d81,_0x48f9aa){if(!_['isNil'](_0x995d81)){if(_0x995d81[_0xac57('0x23')]('originated')){if(_0x995d81['originated']>0x0){_0x995d81[_0xac57('0x2b')]-=0x1;}else{logger[_0xac57('0x5')](_0xac57('0x2c'),_0x48f9aa);}}}else{logger[_0xac57('0x5')](_0xac57('0x2d'),_0x48f9aa);}};exports[_0xac57('0x2e')]=function(_0x5a6f50){var _0x31451b=moment()[_0xac57('0xe')](_0xac57('0x2f'));_0x5a6f50[_0xac57('0x30')]=0xd;_0x5a6f50['statedesc']=_0xac57('0x31');_0x5a6f50[_0xac57('0x32')]=_0x31451b;_0x5a6f50[_0xac57('0x33')]=_0x31451b;_0x5a6f50[_0xac57('0x34')]=_0x31451b;};exports[_0xac57('0x35')]=function(_0x1844d9,_0x41bbfe,_0x171067){var _0x115da2=moment()['format'](_0xac57('0x2f'));_0x1844d9[_0xac57('0x30')]=_0x41bbfe;_0x1844d9[_0xac57('0x36')]=_0x171067;_0x1844d9[_0xac57('0x33')]=_0x115da2;_0x1844d9['ringtime']=utils[_0xac57('0x37')](_0x1844d9[_0xac57('0x33')],_0x1844d9[_0xac57('0x32')]);};exports[_0xac57('0x38')]=function(_0x481ca0,_0x411527,_0x4288a5){_0x481ca0['membername']=_0x411527;_0x481ca0[_0xac57('0x39')]=_0x4288a5;};exports['logCustomer']=function(_0x42ab46,_0x19e307,_0x275df7){var _0x562853=moment()[_0xac57('0xe')](_0xac57('0x2f'));_0x42ab46['state']=_0x19e307;_0x42ab46[_0xac57('0x36')]=_0x275df7;_0x42ab46['responsetime']=_0x42ab46['responsetime']?_0x42ab46[_0xac57('0x33')]:_0x562853;_0x42ab46[_0xac57('0x34')]=_0x42ab46[_0xac57('0x34')]?_0x42ab46[_0xac57('0x34')]:_0x562853;_0x42ab46[_0xac57('0x3a')]=utils[_0xac57('0x37')](_0x42ab46[_0xac57('0x33')]||0x0,_0x42ab46[_0xac57('0x32')]||0x0);_0x42ab46['talktime']=_0x42ab46[_0xac57('0x3b')]?utils[_0xac57('0x37')](_0x42ab46[_0xac57('0x34')],_0x42ab46[_0xac57('0x3b')]):0x0;};exports[_0xac57('0x3c')]=function(_0x5e6638){return _0x5e6638===_0xac57('0x3d');};exports[_0xac57('0x3e')]=function(_0x37371a,_0x523cca,_0x365c24,_0x3e8abd,_0x3b9f1c){var _0x17c722=_0x3e8abd?_0xac57('0x3f'):_0x37371a[_0xac57('0x15')];_0x17c722=_0x3b9f1c?_0xac57('0x40'):_0x17c722;return{'actionid':_0x37371a[_0xac57('0x41')],'action':'originate','channel':_0x37371a['channelAgent'],'callerid':util[_0xac57('0xe')](_0xac57('0xf'),_0x17c722,_0x37371a['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xac57('0x42'),'Priority':'1','variable':_0x365c24,'timeout':(_0x523cca[_0xac57('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x37371a[_0xac57('0x41')]};};exports[_0xac57('0x44')]=function(_0x505cfe){return _0x505cfe['countbusyretry']+_0x505cfe[_0xac57('0x45')]+_0x505cfe[_0xac57('0x46')]+_0x505cfe[_0xac57('0x47')]+_0x505cfe[_0xac57('0x48')];};exports[_0xac57('0x49')]=function(_0x21846a){var _0x5a5de2=_[_0xac57('0x4a')](_0x21846a);_0x5a5de2['state']=0xf;_0x5a5de2[_0xac57('0x36')]=_0xac57('0x4b');return _0x5a5de2;};exports['scheduledAt']=function(_0x1b3a5b,_0x52d39c,_0x463042){var _0x16a4d9={};_0x16a4d9[_0x52d39c]=_0x1b3a5b[_0x52d39c];_0x16a4d9['active']=![];_0x16a4d9[_0xac57('0x4c')]=moment()[_0xac57('0x4d')](_0x463042,'minutes')[_0xac57('0xe')](_0xac57('0x2f'));_0x16a4d9[_0xac57('0x16')]=_0x1b3a5b[_0xac57('0x16')];_0x16a4d9['ListId']=_0x1b3a5b[_0xac57('0x4e')];_0x16a4d9[_0xac57('0x17')]=_0x1b3a5b[_0xac57('0x17')]||undefined;return _0x16a4d9;};exports[_0xac57('0x4f')]=function(_0x4c8bfe,_0x2b77a4){if(!_[_0xac57('0x12')](_0x4c8bfe)){if(_0x4c8bfe['pTalking']>0x0){_0x4c8bfe[_0xac57('0x50')]-=0x1;}else{logger[_0xac57('0x5')](_0x2b77a4,_0xac57('0x51'));}}else{logger['error'](_0x2b77a4,_0xac57('0x52'));}};exports[_0xac57('0x53')]=function(_0x947b7a){if(_0x947b7a<=0x0){return!![];}return![];};function buildObj(_0x4717e3,_0x143ce2,_0x71151e){_0x4717e3[_0xac57('0x54')]=_0x143ce2;_0x4717e3[_0xac57('0x55')]=_0x4717e3[_0xac57('0x56')];_0x4717e3[_0xac57('0x57')]=_0x4717e3[_0xac57('0x58')];_0x4717e3['motionChannel']=_0xac57('0x59');if(_0x71151e){_0x4717e3[_0xac57('0x5a')]=_0x71151e[_0xac57('0x5a')];}return _0x4717e3;}exports['buildObj']=buildObj;exports[_0xac57('0x5b')]=function(_0x52e559){var _0x2834e1={};_0x2834e1[_0xac57('0x56')]=_0x52e559[_0xac57('0x56')];_0x2834e1[_0xac57('0x57')]=_0x52e559['channelAgent'];_0x2834e1[_0xac57('0x41')]=_0x52e559[_0xac57('0x41')];return _0x2834e1;};exports[_0xac57('0x5c')]=function(_0xd2e249){var _0x3f2c11=[];for(var _0x395054 in _0xd2e249){if(_0xd2e249[_0xac57('0x23')](_0x395054)){if(!_[_0xac57('0x12')](_0xd2e249[_0x395054])&&_0xd2e249[_0x395054][_0xac57('0x30')]===_0xac57('0x5d')&&_0xd2e249[_0x395054][_0xac57('0x5e')]===_0xac57('0x5f')){_0x3f2c11[_0xac57('0x60')](_0xd2e249[_0x395054]['id']);}}}return _0x3f2c11;};exports[_0xac57('0x61')]=function(_0x1db6cb){var _0x1014ce=moment()[_0xac57('0x62')](0x0);var _0x26d6cb=moment(_0x1db6cb)[_0xac57('0x62')](0x0);return _0x1014ce[_0xac57('0x63')](_0x26d6cb,'seconds');};exports[_0xac57('0x64')]=function(_0x2c1e37){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2c1e37[_0xac57('0x16')],'ListId':_0x2c1e37['ListId'],'VoiceQueueId':_0x2c1e37['VoiceQueueId']||undefined,'CampaignId':_0x2c1e37['CampaignId']||undefined};};exports[_0xac57('0x65')]=function(_0x384e82){if(_0x384e82===_0xac57('0x41')||_0x384e82===_0xac57('0x66')||_0x384e82===_0xac57('0x56')||_0x384e82===_0xac57('0x67')||_0x384e82===_0xac57('0x68')||_0x384e82===_0xac57('0x69')||_0x384e82===_0xac57('0x6a')||_0x384e82==='channelAgent'||_0x384e82===_0xac57('0x15')||_0x384e82===_0xac57('0x6b')||_0x384e82===_0xac57('0x6c')||_0x384e82===_0xac57('0x4c')||_0x384e82===_0xac57('0x6d')||_0x384e82===_0xac57('0x45')||_0x384e82===_0xac57('0x46')||_0x384e82===_0xac57('0x6e')||_0x384e82===_0xac57('0x6f')||_0x384e82===_0xac57('0x70')||_0x384e82===_0xac57('0x71')||_0x384e82===_0xac57('0x72')||_0x384e82===_0xac57('0x16')||_0x384e82===_0xac57('0x4e')||_0x384e82==='UserId'||_0x384e82===_0xac57('0x17')||_0x384e82===_0xac57('0x73')||_0x384e82===_0xac57('0x74')||_0x384e82===_0xac57('0x75')||_0x384e82===_0xac57('0x76')||_0x384e82===_0xac57('0x77')||_0x384e82===_0xac57('0x78')||_0x384e82==='xmd-dialtimeout'||_0x384e82==='xmd-dialoptions'||_0x384e82===_0xac57('0x79')||_0x384e82===_0xac57('0x7a')||_0x384e82===_0xac57('0x7b')||_0x384e82===_0xac57('0x7c')||_0x384e82===_0xac57('0x7d')||_0x384e82==='xmd-agiafter'||_0x384e82===_0xac57('0x7e')||_0x384e82===_0xac57('0x7f')||_0x384e82===_0xac57('0x80')||_0x384e82==='rtpaudioqosjitter'||_0x384e82===_0xac57('0x81')||_0x384e82===_0xac57('0x82')||_0x384e82===_0xac57('0x83')||_0x384e82===_0xac57('0x84')||_0x384e82===_0xac57('0x85')||_0x384e82==='rtpaudioqos'||_0x384e82===_0xac57('0x80')||_0x384e82===_0xac57('0x86')||_0x384e82===_0xac57('0x81')||_0x384e82===_0xac57('0x82')||_0x384e82===_0xac57('0x83')||_0x384e82===_0xac57('0x84')||_0x384e82===_0xac57('0x85')||_0x384e82===_0xac57('0x87')||_0x384e82===_0xac57('0x88')||_0x384e82===_0xac57('0x30')||_0x384e82===_0xac57('0x36')){return![];}return!![];};exports[_0xac57('0x89')]=function(_0x4006fa,_0x1b8042){var _0x4e1e19,_0x48fd82,_0x1a1c06;if(_0x1b8042<=0x0){_0x1b8042=0x1;}_0x4e1e19=new RegExp(_0xac57('0x8a')+_0x1b8042+'}$');_0x48fd82=Math[_0xac57('0x8b')](0xa,_0x1b8042-0x1);_0x1a1c06=Math[_0xac57('0x8b')](0xa,_0x1b8042)-0x1;return util[_0xac57('0xe')]('%s',_['replace'](_0x4006fa,_0x4e1e19,_[_0xac57('0x8c')](_0x48fd82,_0x1a1c06)));};exports['extractCalleridName']=function(_0x9519f6){var _0x554fa6=_0x9519f6['match'](/"(.*?)"/);return _0x554fa6?_0x554fa6[0x1]:_0x9519f6;};exports[_0xac57('0x8d')]=function(_0xde45bd){var _0x3ffb91=_0xde45bd[_0xac57('0x8e')](/<(.*?)>/);return _0x3ffb91?_0x3ffb91[0x1]:_0xde45bd;};function buildNoAnswerEventPayload(_0x50e783,_0x106355){var _0x44c7b6=buildObj(_0x50e783,'noanswer');if(!_[_0xac57('0xd')](_0x106355['variables'])){Object[_0xac57('0x8f')](_0x106355[_0xac57('0x90')])[_0xac57('0x91')](function(_0x1de610){_0x44c7b6[_0x1de610['toLowerCase']()]=_0x106355[_0xac57('0x90')][_0x1de610];});}return _0x44c7b6;}exports[_0xac57('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index dd1d4a0..1e4b369 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 _0x9d3f=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x9d3f,0x91));var _0xf9d3=function(_0x8d7283,_0x47df42){_0x8d7283=_0x8d7283-0x0;var _0x34605d=_0x9d3f[_0x8d7283];return _0x34605d;};'use strict';exports[_0xf9d3('0x0')]={'queue':{'type':_0xf9d3('0x1'),'required':!![]},'interface':{'type':_0xf9d3('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf9d3('0x2'),'required':![]},'paused':{'type':_0xf9d3('0x3'),'required':![]}};exports[_0xf9d3('0x4')]={'queue':{'type':_0xf9d3('0x1'),'required':!![]},'interface':{'type':_0xf9d3('0x1'),'required':!![]}};exports[_0xf9d3('0x5')]={'interface':{'type':_0xf9d3('0x1'),'required':!![]},'paused':{'type':_0xf9d3('0x3')},'reason':{'type':_0xf9d3('0x1'),'required':![]}};exports[_0xf9d3('0x6')]={'module':{'type':'string','required':![]}};exports[_0xf9d3('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf9d3('0x8')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]},'filename':{'type':_0xf9d3('0x1')},'format':{'type':_0xf9d3('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xf9d3('0x9')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]}};exports[_0xf9d3('0xa')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xf9d3('0x1')}}; \ No newline at end of file +var _0xa4d0=['number','boolean','queueremove','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x305466,_0xe1ea9d){var _0x552150=function(_0x4638b1){while(--_0x4638b1){_0x305466['push'](_0x305466['shift']());}};_0x552150(++_0xe1ea9d);}(_0xa4d0,0xa6));var _0x0a4d=function(_0x5c1fbc,_0xb5d064){_0x5c1fbc=_0x5c1fbc-0x0;var _0x4c1b12=_0xa4d0[_0x5c1fbc];return _0x4c1b12;};'use strict';exports[_0x0a4d('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0a4d('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x0a4d('0x2'),'required':![]},'paused':{'type':_0x0a4d('0x3'),'required':![]}};exports[_0x0a4d('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0a4d('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x0a4d('0x1'),'required':!![]},'paused':{'type':_0x0a4d('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x0a4d('0x1'),'required':![]}};exports[_0x0a4d('0x5')]={'uniqueid':{'type':_0x0a4d('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x0a4d('0x1'),'required':!![]},'filename':{'type':_0x0a4d('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x0a4d('0x1')}};exports[_0x0a4d('0x6')]={'uniqueid':{'type':_0x0a4d('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x0a4d('0x1'),'required':!![]},'context':{'type':_0x0a4d('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4ce2126..497d6ba 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 _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x5c3520,_0x27c1ba){_0x5c3520=_0x5c3520-0x0;var _0x20da9c=_0x2032[_0x5c3520];return _0x20da9c;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x4ccd8d,_0xac4ea6){var _0x59f9ea=function(_0x4d050c){while(--_0x4d050c){_0x4ccd8d['push'](_0x4ccd8d['shift']());}};_0x59f9ea(++_0xac4ea6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f945db3..f9b444d 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 _0xc3ae=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xc3ae,0x163));var _0xec3a=function(_0xbe9771,_0x2b7a9d){_0xbe9771=_0xbe9771-0x0;var _0x52b66e=_0xc3ae[_0xbe9771];return _0x52b66e;};'use strict';function mergeDBDataToRealtime(_0x7b8797,_0x13a165){var _0x229b9e=Object[_0xec3a('0x0')]({},_0x7b8797);for(var _0x6f1de in _0x13a165){if(_0x229b9e[_0xec3a('0x1')](_0x6f1de)){_0x229b9e[_0x6f1de]=_0x13a165[_0x6f1de];}}return _0x229b9e;}exports[_0xec3a('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xfe89=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x577c88,_0x324e0d){var _0x4391fd=function(_0x4e2219){while(--_0x4e2219){_0x577c88['push'](_0x577c88['shift']());}};_0x4391fd(++_0x324e0d);}(_0xfe89,0x1db));var _0x9fe8=function(_0x42aa0f,_0x1917a1){_0x42aa0f=_0x42aa0f-0x0;var _0x3dcff2=_0xfe89[_0x42aa0f];return _0x3dcff2;};'use strict';function mergeDBDataToRealtime(_0x30ddc6,_0x112b13){var _0x20cc91=Object[_0x9fe8('0x0')]({},_0x30ddc6);for(var _0x35276a in _0x112b13){if(_0x20cc91[_0x9fe8('0x1')](_0x35276a)){_0x20cc91[_0x35276a]=_0x112b13[_0x35276a];}}return _0x20cc91;}exports[_0x9fe8('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 7b22ec8..d6cc488 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 _0xcf71=['agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','interface','format','SIP/%s','name','findAgent','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','length','getCallType','split','calleridnum','outbound','internal','destination','exten','type','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','linkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','util','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xcf71,0x161));var _0x1cf7=function(_0xc973f8,_0x1759ec){_0xc973f8=_0xc973f8-0x0;var _0x5cd9d5=_0xcf71[_0xc973f8];return _0x5cd9d5;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x1cf7('0x0'));var config=require('../../../config/environment');var ami=require(_0x1cf7('0x1'));var RpcVoiceAgentReport=require(_0x1cf7('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x1cf7('0x3'));var RpcMemberReport=require(_0x1cf7('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x1cf7('0x5'));var VoiceQueueReport=require(_0x1cf7('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x1cf7('0x7'));var VoiceDialReport=require(_0x1cf7('0x8'));var UserReport=require(_0x1cf7('0x9'));function Report(_0x38b6ed){this[_0x1cf7('0xa')]=_0x38b6ed;this[_0x1cf7('0xb')]=_0x38b6ed['agents'];this[_0x1cf7('0xc')]=_0x38b6ed['telephones'];}Report[_0x1cf7('0xd')][_0x1cf7('0xe')]=function(_0x3999f1){var _0x30e4f2=new VoiceQueueReport(this[_0x1cf7('0xa')]);var _0x4f35cc=new VoiceAgentReport(this['realtime']);var _0x28beab=new VoiceDialReport(this['realtime']);var _0x27abed=new VoiceCallReport(this[_0x1cf7('0xa')]);var _0x12d3ea=new UserReport(this[_0x1cf7('0xa')]);if(config[_0x1cf7('0xf')]&&config[_0x1cf7('0xf')][_0x1cf7('0x10')]){ami['on'](_0x1cf7('0x11'),this[_0x1cf7('0x12')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x1cf7('0x13')][_0x1cf7('0x14')](this));ami['on'](_0x1cf7('0x15'),this[_0x1cf7('0x16')][_0x1cf7('0x14')](this));ami['on']('custom:voiceDialReport',this[_0x1cf7('0x17')][_0x1cf7('0x14')](this));ami['on'](_0x1cf7('0x18'),this[_0x1cf7('0x19')]['bind'](this));ami['on'](_0x1cf7('0x1a'),this[_0x1cf7('0x1b')][_0x1cf7('0x14')](this));}};Report[_0x1cf7('0xd')]['findAgent']=function(_0x37d0cf){var _0x5ea0a9;_0x5ea0a9=_[_0x1cf7('0x1c')](this[_0x1cf7('0xb')],function(_0x4d6f44){return _0x4d6f44[_0x1cf7('0x1d')]==_0x37d0cf||_0x4d6f44['name']==_0x37d0cf;});if(_['isNil'](_0x5ea0a9)){var _0x2495a2=_['find'](this[_0x1cf7('0xc')],function(_0xf5ebee){return _0xf5ebee[_0x1cf7('0x1d')]==_0x37d0cf||_0xf5ebee['name']==_0x37d0cf;});if(_0x2495a2){_0x5ea0a9=_[_0x1cf7('0x1c')](this[_0x1cf7('0xb')],function(_0x241d32){return _0x241d32[_0x1cf7('0x1e')]==util[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x2495a2[_0x1cf7('0x21')]);});}}return _0x5ea0a9;};Report[_0x1cf7('0xd')]['voiceQueueReport']=function(_0x32d5c3){for(var _0x3b715c=0x0;_0x3b715c<_0x32d5c3['length'];_0x3b715c+=0x1){var _0x312d17=this[_0x1cf7('0x22')](_0x32d5c3[_0x3b715c]['connectedlinenum']);if(_0x312d17){_0x32d5c3[_0x3b715c][_0x1cf7('0x1d')]=_0x312d17[_0x1cf7('0x1d')];_0x32d5c3[_0x3b715c][_0x1cf7('0x23')]=!![];_0x32d5c3[_0x3b715c][_0x1cf7('0x24')]=_0x312d17[_0x1cf7('0x21')];_0x32d5c3[_0x3b715c]['interface']=_[_0x1cf7('0x25')](_0x312d17[_0x1cf7('0x1e')])?util[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x312d17[_0x1cf7('0x21')]):_0x312d17[_0x1cf7('0x1e')];if(_0x32d5c3[_0x3b715c][_0x1cf7('0x26')]){_0x32d5c3[_0x3b715c][_0x1cf7('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x32d5c3[_0x3b715c][_0x1cf7('0x28')]){_0x32d5c3[_0x3b715c][_0x1cf7('0x29')]=moment()[_0x1cf7('0x1f')](_0x1cf7('0x2a'));}RpcMemberReport[_0x1cf7('0x12')](_0x32d5c3[_0x3b715c]);}RpcVoiceQueueReport[_0x1cf7('0x2b')](_0x32d5c3[_0x3b715c]);}};function extractCalleridNumber(_0x420b90){var _0x561521=_0x420b90[_0x1cf7('0x2c')](/<(.*?)>/);return _0x561521?_0x561521[0x1]:_0x420b90;}Report['prototype'][_0x1cf7('0x2d')]=function(_0x56dcb2){for(var _0x22d63a=0x0;_0x22d63a','calleridname','linkedid','transfers','transfereelinkedid','getCallType','UserId','membername','monitors','monitorFilename','filename','createdAt','connectedlinename','isArray','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','lodash','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','accountcode','name'];(function(_0x1dd56c,_0x511e8a){var _0x211d4f=function(_0x1531a9){while(--_0x1531a9){_0x1dd56c['push'](_0x1dd56c['shift']());}};_0x211d4f(++_0x511e8a);}(_0x9d66,0x1cc));var _0x69d6=function(_0x46d6fb,_0x77c688){_0x46d6fb=_0x46d6fb-0x0;var _0xdc62d9=_0x9d66[_0x46d6fb];return _0xdc62d9;};'use strict';var _=require(_0x69d6('0x0'));var moment=require('moment');var util=require(_0x69d6('0x1'));var config=require('../../../config/environment');var ami=require(_0x69d6('0x2'));var RpcVoiceAgentReport=require(_0x69d6('0x3'));var RpcVoiceCallReport=require(_0x69d6('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x69d6('0x5'));var RpcVoiceQueueReport=require(_0x69d6('0x6'));var RpcVoiceRecording=require(_0x69d6('0x7'));var RpcVoiceTransferReport=require(_0x69d6('0x8'));var VoiceQueueReport=require(_0x69d6('0x9'));var VoiceCallReport=require(_0x69d6('0xa'));var VoiceAgentReport=require(_0x69d6('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x69d6('0xc'));function Report(_0xea9bf5){this['realtime']=_0xea9bf5;this[_0x69d6('0xd')]=_0xea9bf5[_0x69d6('0xd')];this[_0x69d6('0xe')]=_0xea9bf5[_0x69d6('0xe')];}Report[_0x69d6('0xf')]['sync']=function(_0x41d26a){var _0x211c3d=new VoiceQueueReport(this[_0x69d6('0x10')]);var _0x5d7dc8=new VoiceAgentReport(this[_0x69d6('0x10')]);var _0x42a87a=new VoiceDialReport(this[_0x69d6('0x10')]);var _0x2c5c6c=new VoiceCallReport(this[_0x69d6('0x10')]);var _0x26bf57=new UserReport(this[_0x69d6('0x10')]);if(config[_0x69d6('0x11')]&&config['xdr']['disabled']){ami['on'](_0x69d6('0x12'),this[_0x69d6('0x13')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x69d6('0x14')][_0x69d6('0x15')](this));ami['on'](_0x69d6('0x16'),this[_0x69d6('0x17')][_0x69d6('0x15')](this));ami['on'](_0x69d6('0x18'),this[_0x69d6('0x19')]['bind'](this));ami['on'](_0x69d6('0x1a'),this[_0x69d6('0x1b')][_0x69d6('0x15')](this));ami['on']('attendedtransfer',this[_0x69d6('0x1c')]['bind'](this));}};Report[_0x69d6('0xf')]['findAgent']=function(_0x397970){var _0x4821c5;_0x4821c5=_[_0x69d6('0x1d')](this[_0x69d6('0xd')],function(_0x2d0e80){return _0x2d0e80[_0x69d6('0x1e')]==_0x397970||_0x2d0e80[_0x69d6('0x1f')]==_0x397970;});if(_[_0x69d6('0x20')](_0x4821c5)){var _0x447de5=_['find'](this['telephones'],function(_0x844000){return _0x844000[_0x69d6('0x1e')]==_0x397970||_0x844000[_0x69d6('0x1f')]==_0x397970;});if(_0x447de5){_0x4821c5=_[_0x69d6('0x1d')](this[_0x69d6('0xd')],function(_0x30ea25){return _0x30ea25[_0x69d6('0x21')]==util[_0x69d6('0x22')]('SIP/%s',_0x447de5[_0x69d6('0x1f')]);});}}return _0x4821c5;};Report['prototype'][_0x69d6('0x13')]=function(_0x4d6acd){for(var _0x388f2f=0x0;_0x388f2f<_0x4d6acd[_0x69d6('0x23')];_0x388f2f+=0x1){var _0x14c38b=this[_0x69d6('0x24')](_0x4d6acd[_0x388f2f][_0x69d6('0x25')]);if(_0x14c38b){_0x4d6acd[_0x388f2f][_0x69d6('0x1e')]=_0x14c38b['accountcode'];_0x4d6acd[_0x388f2f][_0x69d6('0x26')]=!![];_0x4d6acd[_0x388f2f][_0x69d6('0x27')]=_0x14c38b[_0x69d6('0x1f')];_0x4d6acd[_0x388f2f]['interface']=_[_0x69d6('0x20')](_0x14c38b[_0x69d6('0x21')])?util[_0x69d6('0x22')](_0x69d6('0x28'),_0x14c38b[_0x69d6('0x1f')]):_0x14c38b[_0x69d6('0x21')];if(_0x4d6acd[_0x388f2f]['queuecallercomplete']){_0x4d6acd[_0x388f2f]['queuecallercompleteAt']=moment()['format'](_0x69d6('0x29'));}if(_0x4d6acd[_0x388f2f]['queuecallerexit']){_0x4d6acd[_0x388f2f][_0x69d6('0x2a')]=moment()[_0x69d6('0x22')](_0x69d6('0x29'));}RpcMemberReport[_0x69d6('0x13')](_0x4d6acd[_0x388f2f]);}RpcVoiceQueueReport[_0x69d6('0x2b')](_0x4d6acd[_0x388f2f]);}};function extractCalleridNumber(_0x484bfd){var _0x539a78=_0x484bfd[_0x69d6('0x2c')](/<(.*?)>/);return _0x539a78?_0x539a78[0x1]:_0x484bfd;}Report['prototype'][_0x69d6('0x2d')]=function(_0x3ccd3c){for(var _0x38ffae=0x0;_0x38ffae0x0?!![]:![];if(!_0x5bf7ed){return this[_0xebe1('0x18')](this[_0xebe1('0x13')]['completeEvent']);}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x6c')]=function(_0xe2b330){var _0x4861b1=this[_0xebe1('0x13')]['id'];if(this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1]&&this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1][_0xe2b330['actionid']]){this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1][_0xe2b330[_0xebe1('0x60')]]['agents']['push'](_0xe2b330);}};VoiceQueueReport['prototype'][_0xebe1('0x15')]=function(_0x2f68b2){var _0x4a0db5=this;try{if(this['isNotNull'](_0x2f68b2)&&this[_0xebe1('0x6d')](_0x2f68b2['queue'])){logger['debug'](_0xebe1('0x6e'),util[_0xebe1('0x3f')](_0x2f68b2,{'showHidden':![],'depth':null}));var _0x2af755=this[_0xebe1('0x12')][_0x2f68b2['queue']];if(_0x2af755){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x2af755[_0xebe1('0x57')]);this['summary']['queues'][_0x2af755[_0xebe1('0x57')]]={'summaryEvent':_0x2f68b2};this[_0xebe1('0x13')][_0xebe1('0x6b')]+=0x1;return ami[_0xebe1('0x5e')]({'action':_0xebe1('0x61'),'queue':_0x2af755[_0xebe1('0x57')]})[_0xebe1('0x5f')](function(_0x3f45c6){if(!_0x4a0db5[_0xebe1('0x13')][_0xebe1('0x61')][_0x2f68b2[_0xebe1('0x60')]]){_0x4a0db5[_0xebe1('0x13')]['queuestatus'][_0x2f68b2[_0xebe1('0x60')]]={};}_0x4a0db5[_0xebe1('0x13')][_0xebe1('0x61')][_0x2f68b2[_0xebe1('0x60')]][_0x3f45c6[_0xebe1('0x60')]]={'queue':_0x2af755['name'],'agents':[]};})['catch'](function(_0x9dc6b7){throw _0x9dc6b7;});}}}catch(_0x55a53d){logger['error'](_0xebe1('0x62'),util[_0xebe1('0x3f')](_0x55a53d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xebe1('0x18')]=function(_0x5aa0fd){if(this['summary'][_0xebe1('0x6b')]>0x0){this[_0xebe1('0x13')]['completeEvent']=_0x5aa0fd;return;}logger[_0xebe1('0x49')](_0xebe1('0x6f'),util['inspect'](_0x5aa0fd,{'showHidden':![],'depth':null}));this[_0xebe1('0x13')]=initializeSummary();ami[_0xebe1('0x47')](_0xebe1('0x70'),{});};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x1b')]=function(_0x260e28){try{if(this[_0xebe1('0x6d')](_0x260e28)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x260e28[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x260e28,{'showHidden':![],'depth':null}));if(_[_0xebe1('0x59')](this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]])){this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]]=[];}if(_[_0xebe1('0x59')](this['channels'][_0x260e28[_0xebe1('0x4b')]])){this['channels'][_0x260e28[_0xebe1('0x4b')]]={};}var _0xa30a4d=new QueueReport();_0xa30a4d['queue']=_0x260e28[_0xebe1('0x53')];_0xa30a4d[_0xebe1('0x68')]=this['voiceQueues'][_0xa30a4d[_0xebe1('0x53')]]&&this[_0xebe1('0x12')][_0xa30a4d['queue']][_0xebe1('0x68')]?this[_0xebe1('0x12')][_0xa30a4d[_0xebe1('0x53')]]['type']||_0xebe1('0x69'):_0xebe1('0x69');_0xa30a4d[_0xebe1('0x71')]=moment()[_0xebe1('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0xa30a4d[_0xebe1('0x72')]=_0x260e28[_0xebe1('0x72')];_0xa30a4d[_0xebe1('0x73')]=_0x260e28[_0xebe1('0x73')];_0xa30a4d['uniqueid']=_0x260e28[_0xebe1('0x4b')];_0xa30a4d[_0xebe1('0x74')]=this['channels'][_0x260e28[_0xebe1('0x4b')]][_0xebe1('0x74')];logger[_0xebe1('0x75')](_0xebe1('0x76'),_0xa30a4d['queue'],_0xa30a4d['type']);_[_0xebe1('0x77')](_0xa30a4d,_[_0xebe1('0x78')](_0x260e28,_[_0xebe1('0x79')](_0xa30a4d)));this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]]['push'](_0xa30a4d);this[_0xebe1('0x11')][_0x260e28[_0xebe1('0x4b')]]=_0xa30a4d;this['emitVoiceQueueChannelSave'](_0xa30a4d,_0xebe1('0x1a'));}}catch(_0x32f126){logger[_0xebe1('0x3d')](_0xebe1('0x7a'),_0x260e28['uniqueid'],util[_0xebe1('0x3f')](_0x32f126,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x7b')]=function(_0x58f9a5){try{if(this[_0xebe1('0x6d')](_0x58f9a5)){logger[_0xebe1('0x49')](_0xebe1('0x7c'),_0x58f9a5[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x58f9a5,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x58f9a5[_0xebe1('0x4b')]]){var _0x4d8dd1=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x58f9a5[_0xebe1('0x4b')]]);_0x4d8dd1[_0xebe1('0x7e')]=![];_0x4d8dd1[_0xebe1('0x7f')]=null;_0x4d8dd1['holdtime']=_0x58f9a5['holdtime'];_0x4d8dd1[_0xebe1('0x80')]=_0x58f9a5[_0xebe1('0x80')];_0x4d8dd1['queuecallerabandon']=!![];_0x4d8dd1[_0xebe1('0x81')]=moment()['format'](_0xebe1('0x82'));_0x4d8dd1[_0xebe1('0x52')]=_0xebe1('0x83');_0x4d8dd1['lastAssignedTo']=null;logger[_0xebe1('0x75')](_0xebe1('0x84'),_0x4d8dd1[_0xebe1('0x53')],_0x4d8dd1[_0xebe1('0x68')]);this[_0xebe1('0x11')][_0x58f9a5[_0xebe1('0x4b')]]=_0x4d8dd1;this[_0xebe1('0x45')](_0x4d8dd1,'queuecallerabandon');}}}catch(_0x5cf918){logger[_0xebe1('0x3d')](_0xebe1('0x7c'),_0x58f9a5[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x5cf918,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xebe1('0x1e')]=function(_0x2f6f5c){try{if(this['isNotNull'](_0x2f6f5c)){logger['debug'](_0xebe1('0x85'),_0x2f6f5c[_0xebe1('0x4b')],util['inspect'](_0x2f6f5c,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x2f6f5c['uniqueid']]){var _0x551123=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x2f6f5c[_0xebe1('0x4b')]]);_0x551123['queuecallerleaveAt']=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x551123['connectedlinenum']=_0x2f6f5c[_0xebe1('0x86')];_0x551123[_0xebe1('0x87')]=_0x2f6f5c[_0xebe1('0x87')];logger[_0xebe1('0x75')](_0xebe1('0x88'),_0x551123['queue'],_0x551123[_0xebe1('0x68')],_0x2f6f5c['connectedlinenum'],_0x2f6f5c[_0xebe1('0x87')]);this[_0xebe1('0x11')][_0x2f6f5c['uniqueid']]=_0x551123;this['emitVoiceQueueChannelSave'](_0x551123,'queuecallerleave');}}}catch(_0x17d7f1){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2f6f5c[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x17d7f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x22')]=function(_0x423734){try{if(this[_0xebe1('0x6d')](_0x423734)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x423734[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x423734,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x423734[_0xebe1('0x4b')]]){var _0x220a14=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x423734[_0xebe1('0x4b')]]);_0x220a14[_0xebe1('0x7e')]=!![];_0x220a14[_0xebe1('0x52')]=_0xebe1('0x89');logger[_0xebe1('0x75')](_0xebe1('0x8a'),_0x220a14[_0xebe1('0x53')],_0x220a14['type']);}}}catch(_0x7708ff){logger['error'](_0xebe1('0x8b'),_0x423734[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x7708ff,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x5ab9ed){try{if(this[_0xebe1('0x6d')](_0x5ab9ed)){logger[_0xebe1('0x49')](_0xebe1('0x8c'),_0x5ab9ed[_0xebe1('0x4b')],util['inspect'](_0x5ab9ed,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]]){var _0x25a726=_['last'](this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]]);_0x25a726[_0xebe1('0x1c')]=![];_0x25a726['queuecallerabandonAt']=null;_0x25a726[_0xebe1('0x8d')]=!![];_0x25a726[_0xebe1('0x8e')]=_0x5ab9ed[_0xebe1('0x8f')];_0x25a726[_0xebe1('0x90')]=_0x5ab9ed[_0xebe1('0x90')];_0x25a726['queuecallercomplete']=!![];_0x25a726['queuecallerexit']=![];_0x25a726[_0xebe1('0x91')]=null;if(!_0x25a726['transfer']){if(_0x5ab9ed[_0xebe1('0x92')]==_0xebe1('0x93')){_0x25a726[_0xebe1('0x52')]=_0xebe1('0x94');logger[_0xebe1('0x75')](_0xebe1('0x95'),_0x25a726['queue'],_0x25a726[_0xebe1('0x68')]);}else{if(_[_0xebe1('0x96')](_0x5ab9ed[_0xebe1('0x39')][_0xebe1('0x97')](),_0xebe1('0x98'))){if(this['queueReports'][_0x5ab9ed[_0xebe1('0x99')]]){var _0x208cb5=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]]);_0x208cb5[_0xebe1('0x7e')]=![];_0x208cb5[_0xebe1('0x9a')]=!![];_0x208cb5[_0xebe1('0x91')]=moment(_0x25a726[_0xebe1('0x71')])[_0xebe1('0x9b')](_0x5ab9ed[_0xebe1('0x90')],_0xebe1('0x9c'))[_0xebe1('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x208cb5['queuecallerexitreason']=_0xebe1('0x9d');_0x208cb5[_0xebe1('0x93')]=!![];_0x208cb5[_0xebe1('0x9e')]=_0xebe1('0x9f');_0x208cb5[_0xebe1('0xa0')]=_0x5ab9ed[_0xebe1('0xa1')];_0x208cb5[_0xebe1('0xa2')]=_0x5ab9ed['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x208cb5[_0xebe1('0x53')],_0x208cb5['type']);var _0x4b18dd=this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]];this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]]=this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]];this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x4b')]]=_0x4b18dd;}}else{_0x25a726['queuecallerexitreason']=_0xebe1('0xa3')+_0x5ab9ed[_0xebe1('0x92')][_0xebe1('0xa4')]();logger[_0xebe1('0x75')](_0xebe1('0xa5'),_0x25a726[_0xebe1('0x53')],_0x25a726[_0xebe1('0x68')],_0x25a726[_0xebe1('0x52')]);}}}this[_0xebe1('0x11')][_0x5ab9ed[_0xebe1('0x4b')]]=_0x25a726;this[_0xebe1('0x45')](_0x25a726,_0xebe1('0x1f'));}}}catch(_0x212846){logger[_0xebe1('0x3d')](_0xebe1('0x8c'),_0x5ab9ed[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x212846,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')]['syncVarSet']=function(_0x5f7aad){try{if(this[_0xebe1('0x6d')](_0x5f7aad)){logger[_0xebe1('0x49')]('[%s][voiceQueueReport][varset]',_0x5f7aad['uniqueid'],util[_0xebe1('0x3f')](_0x5f7aad,{'showHidden':![],'depth':null}));this[_0xebe1('0xa6')](_0x5f7aad[_0xebe1('0x4b')],_[_0xebe1('0x79')](_0x5f7aad['variable'])[0x0],_0x5f7aad['value']);if(this['queueReports'][_0x5f7aad[_0xebe1('0x4b')]]){var _0x5de300=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x5f7aad[_0xebe1('0x4b')]]);if(_0x5de300){if(this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')])&&this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')]['queuestatus'])){switch(_0x5f7aad[_0xebe1('0xa8')]){case'CONTINUE':_0x5de300['queuecallerexit']=![];_0x5de300[_0xebe1('0x91')]=null;break;case _0xebe1('0xa9'):_0x5de300[_0xebe1('0xaa')]='timeout';_0x5de300['queuecallerexit']=!![];_0x5de300[_0xebe1('0x91')]=moment()['format'](_0xebe1('0x82'));_0x5de300['queuecallerleaveAt']=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));logger[_0xebe1('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x5f7aad[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x5de300,{'showHidden':![],'depth':null}));ami[_0xebe1('0x47')](_0xebe1('0xab'),_0x5de300);break;default:_0x5de300[_0xebe1('0x9a')]=!![];_0x5de300[_0xebe1('0x91')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x5de300[_0xebe1('0xac')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5de300[_0xebe1('0x1c')]=![];_0x5de300[_0xebe1('0x81')]=null;_0x5de300[_0xebe1('0x52')]=_0x5f7aad[_0xebe1('0xa8')];this[_0xebe1('0x11')][_0x5f7aad['uniqueid']]=_0x5de300;this[_0xebe1('0x45')](_0x5de300,_0xebe1('0x23'));}else if(this['isNotNull'](_0x5f7aad[_0xebe1('0xa7')])&&this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')][_0xebe1('0xad')])){if(!_0x5de300['queuecallerabandon']){_0x5de300[_0xebe1('0x9a')]=!![];_0x5de300[_0xebe1('0x91')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x5de300['queuecallerexitreason']='EXITWITHKEY';_0x5de300[_0xebe1('0xac')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));this[_0xebe1('0x11')][_0x5f7aad[_0xebe1('0x4b')]]=_0x5de300;}}logger[_0xebe1('0x75')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5f7aad['uniqueid'],_0x5de300[_0xebe1('0x53')],_0x5de300[_0xebe1('0x68')],_[_0xebe1('0x79')](_0x5f7aad['variable'])[0x0],_0x5f7aad['value']);_0x5de300[_0xebe1('0x40')]=this[_0xebe1('0x40')][_0x5f7aad[_0xebe1('0x4b')]];}}}}catch(_0x38428f){logger[_0xebe1('0x3d')]('[%s][voiceQueueReport][varset]',_0x5f7aad['uniqueid'],util[_0xebe1('0x3f')](_0x38428f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')]['addVariable']=function(_0x11a696,_0x1620ef,_0x585cd2){var _0x495a3c=[_0xebe1('0xae'),_0xebe1('0xaf'),'rtpaudioqosjitter',_0xebe1('0xb0'),_0xebe1('0xb1'),_0xebe1('0xb2'),_0xebe1('0xb3'),'rtpaudioqosrttbridged',_0xebe1('0xb4'),_0xebe1('0xb5'),_0xebe1('0xb6'),'bridgepvtcallid',_0xebe1('0xb7'),_0xebe1('0xb8'),_0xebe1('0xb9'),_0xebe1('0xba'),'membername',_0xebe1('0xbb'),'memberrealtime'];if(!_['isNil'](_0x1620ef)&&!_[_0xebe1('0xbc')](_0x495a3c,_0x1620ef)){if(_[_0xebe1('0x59')](this[_0xebe1('0x40')][_0x11a696])){this[_0xebe1('0x40')][_0x11a696]={};}this[_0xebe1('0x40')][_0x11a696][_0x1620ef]=_0x585cd2;}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0xbd')]=function(_0x40389a,_0x37d1d2,_0x4e3a99){var _0x2ecb72={};for(var _0x4ea8a5=0x0;_0x4ea8a50x0?!![]:![];if(!_0xb9d3c7){return this[_0xe5d4('0x67')](this['summary'][_0xe5d4('0x68')]);}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x69')]=function(_0x2e3cc9){var _0x2a1b12=this[_0xe5d4('0x14')]['id'];if(this[_0xe5d4('0x14')]['queuestatus'][_0x2a1b12]&&this[_0xe5d4('0x14')][_0xe5d4('0x59')][_0x2a1b12][_0x2e3cc9[_0xe5d4('0x58')]]){this[_0xe5d4('0x14')]['queuestatus'][_0x2a1b12][_0x2e3cc9['actionid']][_0xe5d4('0xf')]['push'](_0x2e3cc9);}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x17')]=function(_0x5d8128){var _0x115670=this;try{if(this[_0xe5d4('0x51')](_0x5d8128)&&this[_0xe5d4('0x51')](_0x5d8128[_0xe5d4('0x63')])){logger[_0xe5d4('0x46')](_0xe5d4('0x6a'),util[_0xe5d4('0x39')](_0x5d8128,{'showHidden':![],'depth':null}));var _0x403231=this['voiceQueues'][_0x5d8128['queue']];if(_0x403231){logger['info'](_0xe5d4('0x6b'),_0x403231[_0xe5d4('0x61')]);this[_0xe5d4('0x14')]['queues'][_0x403231[_0xe5d4('0x61')]]={'summaryEvent':_0x5d8128};this['summary'][_0xe5d4('0x66')]+=0x1;return ami[_0xe5d4('0x32')]({'action':'queuestatus','queue':_0x403231[_0xe5d4('0x61')]})['then'](function(_0x28d78a){if(!_0x115670[_0xe5d4('0x14')][_0xe5d4('0x59')][_0x5d8128[_0xe5d4('0x58')]]){_0x115670['summary']['queuestatus'][_0x5d8128[_0xe5d4('0x58')]]={};}_0x115670[_0xe5d4('0x14')][_0xe5d4('0x59')][_0x5d8128[_0xe5d4('0x58')]][_0x28d78a[_0xe5d4('0x58')]]={'queue':_0x403231[_0xe5d4('0x61')],'agents':[]};})[_0xe5d4('0x33')](function(_0x2a2d86){throw _0x2a2d86;});}}}catch(_0x261557){logger[_0xe5d4('0x36')](_0xe5d4('0x6c'),util['inspect'](_0x261557,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x67')]=function(_0x424077){if(this[_0xe5d4('0x14')][_0xe5d4('0x66')]>0x0){this[_0xe5d4('0x14')][_0xe5d4('0x68')]=_0x424077;return;}logger[_0xe5d4('0x46')](_0xe5d4('0x6d'),util[_0xe5d4('0x39')](_0x424077,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0xe5d4('0x3f')](_0xe5d4('0x6e'),{});};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x1c')]=function(_0x2b6107){try{if(this['isNotNull'](_0x2b6107)){logger[_0xe5d4('0x46')](_0xe5d4('0x6f'),_0x2b6107[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x2b6107,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xe5d4('0xe')][_0x2b6107[_0xe5d4('0x48')]])){this['queueReports'][_0x2b6107['uniqueid']]=[];}if(_[_0xe5d4('0x70')](this[_0xe5d4('0x10')][_0x2b6107[_0xe5d4('0x48')]])){this[_0xe5d4('0x10')][_0x2b6107[_0xe5d4('0x48')]]={};}var _0x314749=new QueueReport();_0x314749[_0xe5d4('0x63')]=_0x2b6107[_0xe5d4('0x63')];_0x314749[_0xe5d4('0x4c')]=this['voiceQueues'][_0x314749['queue']]&&this[_0xe5d4('0x12')][_0x314749[_0xe5d4('0x63')]][_0xe5d4('0x4c')]?this[_0xe5d4('0x12')][_0x314749[_0xe5d4('0x63')]][_0xe5d4('0x4c')]||'inbound':'inbound';_0x314749[_0xe5d4('0x71')]=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));_0x314749[_0xe5d4('0x73')]=_0x2b6107[_0xe5d4('0x73')];_0x314749[_0xe5d4('0x74')]=_0x2b6107[_0xe5d4('0x74')];_0x314749[_0xe5d4('0x48')]=_0x2b6107['uniqueid'];_0x314749[_0xe5d4('0x75')]=this[_0xe5d4('0x10')][_0x2b6107[_0xe5d4('0x48')]][_0xe5d4('0x75')];logger[_0xe5d4('0x76')](_0xe5d4('0x77'),_0x314749[_0xe5d4('0x63')],_0x314749['type']);_[_0xe5d4('0x78')](_0x314749,_['pick'](_0x2b6107,_['keys'](_0x314749)));this[_0xe5d4('0xe')][_0x2b6107['uniqueid']][_0xe5d4('0x79')](_0x314749);this[_0xe5d4('0x10')][_0x2b6107[_0xe5d4('0x48')]]=_0x314749;this[_0xe5d4('0x40')](_0x314749,_0xe5d4('0x1b'));}}catch(_0x262019){logger[_0xe5d4('0x36')](_0xe5d4('0x6f'),_0x2b6107[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x262019,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x7a')]=function(_0xc0f186){try{if(this[_0xe5d4('0x51')](_0xc0f186)){logger[_0xe5d4('0x46')](_0xe5d4('0x7b'),_0xc0f186[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0xc0f186,{'showHidden':![],'depth':null}));if(this[_0xe5d4('0xe')][_0xc0f186[_0xe5d4('0x48')]]){var _0x13c254=_[_0xe5d4('0x7c')](this['queueReports'][_0xc0f186[_0xe5d4('0x48')]]);_0x13c254[_0xe5d4('0x7d')]=![];_0x13c254[_0xe5d4('0x7e')]=null;_0x13c254[_0xe5d4('0x7f')]=_0xc0f186['holdtime'];_0x13c254[_0xe5d4('0x80')]=_0xc0f186[_0xe5d4('0x80')];_0x13c254[_0xe5d4('0x1d')]=!![];_0x13c254[_0xe5d4('0x81')]=moment()[_0xe5d4('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x13c254['queuecallerexitreason']=_0xe5d4('0x82');_0x13c254[_0xe5d4('0x83')]=null;logger['info'](_0xe5d4('0x84'),_0x13c254[_0xe5d4('0x63')],_0x13c254['type']);this['channels'][_0xc0f186['uniqueid']]=_0x13c254;this['emitVoiceQueueChannelRemove'](_0x13c254,_0xe5d4('0x1d'));}}}catch(_0x4b5321){logger['error'](_0xe5d4('0x7b'),_0xc0f186['uniqueid'],util[_0xe5d4('0x39')](_0x4b5321,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x1e')]=function(_0x3696bc){try{if(this['isNotNull'](_0x3696bc)){logger[_0xe5d4('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x3696bc[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x3696bc,{'showHidden':![],'depth':null}));if(this[_0xe5d4('0xe')][_0x3696bc['uniqueid']]){var _0xd9e7b1=_[_0xe5d4('0x7c')](this['queueReports'][_0x3696bc['uniqueid']]);_0xd9e7b1['queuecallerleaveAt']=moment()[_0xe5d4('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xd9e7b1[_0xe5d4('0x85')]=_0x3696bc[_0xe5d4('0x85')];_0xd9e7b1['connectedlinename']=_0x3696bc[_0xe5d4('0x86')];logger[_0xe5d4('0x76')](_0xe5d4('0x87'),_0xd9e7b1[_0xe5d4('0x63')],_0xd9e7b1[_0xe5d4('0x4c')],_0x3696bc[_0xe5d4('0x85')],_0x3696bc[_0xe5d4('0x86')]);this['channels'][_0x3696bc[_0xe5d4('0x48')]]=_0xd9e7b1;this[_0xe5d4('0x40')](_0xd9e7b1,_0xe5d4('0x88'));}}}catch(_0x50ad04){logger[_0xe5d4('0x36')](_0xe5d4('0x89'),_0x3696bc[_0xe5d4('0x48')],util['inspect'](_0x50ad04,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe5d4('0x21')]=function(_0x294d62){try{if(this[_0xe5d4('0x51')](_0x294d62)){logger[_0xe5d4('0x46')](_0xe5d4('0x8a'),_0x294d62[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x294d62,{'showHidden':![],'depth':null}));if(this[_0xe5d4('0xe')][_0x294d62[_0xe5d4('0x48')]]){var _0xf39efe=_['last'](this[_0xe5d4('0xe')][_0x294d62[_0xe5d4('0x48')]]);_0xf39efe[_0xe5d4('0x7d')]=!![];_0xf39efe['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xe5d4('0x76')](_0xe5d4('0x8b'),_0xf39efe[_0xe5d4('0x63')],_0xf39efe[_0xe5d4('0x4c')]);}}}catch(_0x23739c){logger[_0xe5d4('0x36')](_0xe5d4('0x8a'),_0x294d62['uniqueid'],util[_0xe5d4('0x39')](_0x23739c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe5d4('0x20')]=function(_0x4c1403){try{if(this['isNotNull'](_0x4c1403)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x4c1403[_0xe5d4('0x48')],util['inspect'](_0x4c1403,{'showHidden':![],'depth':null}));if(this[_0xe5d4('0xe')][_0x4c1403[_0xe5d4('0x48')]]){var _0x3656b2=_[_0xe5d4('0x7c')](this[_0xe5d4('0xe')][_0x4c1403[_0xe5d4('0x48')]]);_0x3656b2['queuecallerabandon']=![];_0x3656b2['queuecallerabandonAt']=null;_0x3656b2[_0xe5d4('0x8c')]=!![];_0x3656b2[_0xe5d4('0x83')]=_0x4c1403[_0xe5d4('0x8d')];_0x3656b2[_0xe5d4('0x7f')]=_0x4c1403[_0xe5d4('0x7f')];_0x3656b2[_0xe5d4('0x7d')]=!![];_0x3656b2[_0xe5d4('0x8e')]=![];_0x3656b2['queuecallerexitAt']=null;if(!_0x3656b2[_0xe5d4('0x8f')]){if(_0x4c1403['reason']=='transfer'){_0x3656b2[_0xe5d4('0x49')]='COMPLETED';logger[_0xe5d4('0x76')](_0xe5d4('0x90'),_0x3656b2[_0xe5d4('0x63')],_0x3656b2[_0xe5d4('0x4c')]);}else{if(_['startsWith'](_0x4c1403['channel'][_0xe5d4('0x91')](),_0xe5d4('0x92'))){if(this[_0xe5d4('0xe')][_0x4c1403[_0xe5d4('0x93')]]){var _0x5110a1=_[_0xe5d4('0x7c')](this[_0xe5d4('0xe')][_0x4c1403['linkedid']]);_0x5110a1[_0xe5d4('0x7d')]=![];_0x5110a1[_0xe5d4('0x8e')]=!![];_0x5110a1[_0xe5d4('0x94')]=moment(_0x3656b2['queuecallerjoinAt'])[_0xe5d4('0x95')](_0x4c1403[_0xe5d4('0x7f')],_0xe5d4('0x96'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5110a1[_0xe5d4('0x49')]='FORWARDTRANSFER';_0x5110a1['transfer']=!![];_0x5110a1[_0xe5d4('0x97')]='FORWARD';_0x5110a1['transferexten']=_0x4c1403[_0xe5d4('0x98')];_0x5110a1[_0xe5d4('0x99')]=_0x4c1403[_0xe5d4('0x48')];logger['info'](_0xe5d4('0x9a'),_0x5110a1[_0xe5d4('0x63')],_0x5110a1['type']);var _0x33eab1=this['queueReports'][_0x4c1403['linkedid']];this['queueReports'][_0x4c1403['linkedid']]=this[_0xe5d4('0xe')][_0x4c1403[_0xe5d4('0x48')]];this[_0xe5d4('0xe')][_0x4c1403[_0xe5d4('0x48')]]=_0x33eab1;}}else{_0x3656b2[_0xe5d4('0x49')]=_0xe5d4('0x9b')+_0x4c1403['reason']['toUpperCase']();logger[_0xe5d4('0x76')](_0xe5d4('0x9c'),_0x3656b2[_0xe5d4('0x63')],_0x3656b2[_0xe5d4('0x4c')],_0x3656b2[_0xe5d4('0x49')]);}}}this[_0xe5d4('0x10')][_0x4c1403[_0xe5d4('0x48')]]=_0x3656b2;this[_0xe5d4('0x3d')](_0x3656b2,_0xe5d4('0x1f'));}}}catch(_0x418698){logger[_0xe5d4('0x36')]('[%s][voiceQueueReport][agentcomplete]',_0x4c1403[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x418698,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe5d4('0x23')]=function(_0x3fc035){try{if(this['isNotNull'](_0x3fc035)){logger[_0xe5d4('0x46')](_0xe5d4('0x9d'),_0x3fc035[_0xe5d4('0x48')],util[_0xe5d4('0x39')](_0x3fc035,{'showHidden':![],'depth':null}));this[_0xe5d4('0x9e')](_0x3fc035[_0xe5d4('0x48')],_[_0xe5d4('0x9f')](_0x3fc035[_0xe5d4('0xa0')])[0x0],_0x3fc035[_0xe5d4('0xa1')]);if(this[_0xe5d4('0xe')][_0x3fc035['uniqueid']]){var _0x3d2e1e=_['last'](this[_0xe5d4('0xe')][_0x3fc035[_0xe5d4('0x48')]]);if(_0x3d2e1e){if(this['isNotNull'](_0x3fc035[_0xe5d4('0xa0')])&&this[_0xe5d4('0x51')](_0x3fc035[_0xe5d4('0xa0')][_0xe5d4('0x59')])){switch(_0x3fc035[_0xe5d4('0xa1')]){case _0xe5d4('0xa2'):_0x3d2e1e[_0xe5d4('0x8e')]=![];_0x3d2e1e[_0xe5d4('0x94')]=null;break;case'TIMEOUT':_0x3d2e1e[_0xe5d4('0xa3')]=_0xe5d4('0xa4');_0x3d2e1e[_0xe5d4('0x8e')]=!![];_0x3d2e1e[_0xe5d4('0x94')]=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));_0x3d2e1e[_0xe5d4('0xa5')]=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));logger[_0xe5d4('0x46')](_0xe5d4('0xa6'),_0x3fc035[_0xe5d4('0x48')],util['inspect'](_0x3d2e1e,{'showHidden':![],'depth':null}));ami[_0xe5d4('0x3f')](_0xe5d4('0xa7'),_0x3d2e1e);break;default:_0x3d2e1e[_0xe5d4('0x8e')]=!![];_0x3d2e1e[_0xe5d4('0x94')]=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));_0x3d2e1e[_0xe5d4('0xa5')]=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));}_0x3d2e1e[_0xe5d4('0x1d')]=![];_0x3d2e1e['queuecallerabandonAt']=null;_0x3d2e1e[_0xe5d4('0x49')]=_0x3fc035[_0xe5d4('0xa1')];this[_0xe5d4('0x10')][_0x3fc035['uniqueid']]=_0x3d2e1e;this[_0xe5d4('0x3d')](_0x3d2e1e,_0xe5d4('0x22'));}else if(this[_0xe5d4('0x51')](_0x3fc035[_0xe5d4('0xa0')])&&this[_0xe5d4('0x51')](_0x3fc035[_0xe5d4('0xa0')]['queueposition'])){if(!_0x3d2e1e['queuecallerabandon']){_0x3d2e1e['queuecallerexit']=!![];_0x3d2e1e['queuecallerexitAt']=moment()[_0xe5d4('0x43')](_0xe5d4('0x72'));_0x3d2e1e['queuecallerexitreason']=_0xe5d4('0xa8');_0x3d2e1e[_0xe5d4('0xa5')]=moment()[_0xe5d4('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe5d4('0x10')][_0x3fc035[_0xe5d4('0x48')]]=_0x3d2e1e;}}logger[_0xe5d4('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3fc035[_0xe5d4('0x48')],_0x3d2e1e[_0xe5d4('0x63')],_0x3d2e1e[_0xe5d4('0x4c')],_[_0xe5d4('0x9f')](_0x3fc035[_0xe5d4('0xa0')])[0x0],_0x3fc035['value']);_0x3d2e1e['variables']=this[_0xe5d4('0x15')][_0x3fc035['uniqueid']];}}}}catch(_0x1875db){logger[_0xe5d4('0x36')](_0xe5d4('0x9d'),_0x3fc035['uniqueid'],util[_0xe5d4('0x39')](_0x1875db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe5d4('0xa')][_0xe5d4('0x9e')]=function(_0x237764,_0x2f6d8e,_0x18e1ed){var _0x499512=[_0xe5d4('0xa9'),'rtpaudioqosbridged',_0xe5d4('0xaa'),_0xe5d4('0xab'),'rtpaudioqosloss',_0xe5d4('0xac'),_0xe5d4('0xad'),_0xe5d4('0xae'),_0xe5d4('0xaf'),_0xe5d4('0xb0'),_0xe5d4('0xb1'),'bridgepvtcallid',_0xe5d4('0xb2'),'memberdynamic','memberinterface',_0xe5d4('0xb3'),'membername',_0xe5d4('0xb4'),_0xe5d4('0xb5')];if(!_[_0xe5d4('0x31')](_0x2f6d8e)&&!_[_0xe5d4('0xb6')](_0x499512,_0x2f6d8e)){if(_['isUndefined'](this['variables'][_0x237764])){this['variables'][_0x237764]={};}this[_0xe5d4('0x15')][_0x237764][_0x2f6d8e]=_0x18e1ed;}};VoiceQueueReport[_0xe5d4('0xa')]['handleHangup']=function(_0x21dc3f,_0x3a2a23,_0x3090b9){var _0x569357={};for(var _0x2ae1b5=0x0;_0x2ae1b5=0x0?moment(_0x29f3bf[_0x2fd8('0x18')])[_0x2fd8('0x19')](_0x29f3bf[_0x2fd8('0x17')],_0x2fd8('0xe')):null,'data1':_0x2fd8('0x1a'),'data2':_0x29f3bf[_0x2fd8('0x13')],'data3':_0x29f3bf[_0x2fd8('0x1b')],'data4':_0x29f3bf['dialstring']||null,'role':_0x2fd8('0x1c'),'internal':_0x29f3bf[_0x2fd8('0x13')]?_[_0x2fd8('0x12')](_0x29f3bf[_0x2fd8('0x13')]):undefined,'uniqueid':_0x29f3bf[_0x2fd8('0x1d')]},'log':_0x2fd8('0x6')});}; \ No newline at end of file +var _0x9e34=['CreateMemberReport','membername','starttime','endtime','diff','accountcode','dialstring','agent','moment','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','seconds','inbound','calleridnum','exten','queue','toNumber','uniqueid','voiceDialReport'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x9e34,0x152));var _0x49e3=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x9e34[_0x26462c];return _0x509a42;};'use strict';var moment=require(_0x49e3('0x0'));var _=require(_0x49e3('0x1'));var util=require(_0x49e3('0x2'));var client=require(_0x49e3('0x3'));exports[_0x49e3('0x4')]=function(_0x2cb84b){var _0x1a7831=_0x2cb84b['queuecallercompleteAt']||_0x2cb84b[_0x49e3('0x5')];return client[_0x49e3('0x6')]('CreateMemberReport',{'body':{'channel':_0x49e3('0x7'),'membername':_0x2cb84b[_0x49e3('0x8')],'interface':_[_0x49e3('0x9')](_0x2cb84b[_0x49e3('0xa')])?util[_0x49e3('0xb')](_0x49e3('0xc'),_0x2cb84b['lastAssignedTo']):_0x2cb84b['interface'],'type':_0x49e3('0xd'),'enterAt':_0x2cb84b['queuecallerleaveAt'],'exitAt':_0x1a7831,'duration':moment(_0x1a7831)['diff'](_0x2cb84b['queuecallerleaveAt'],_0x49e3('0xe')),'data1':_0x49e3('0xf'),'data2':_0x2cb84b[_0x49e3('0x10')],'data3':_0x2cb84b[_0x49e3('0x11')],'data4':null,'data5':_0x2cb84b[_0x49e3('0x12')],'role':'agent','internal':_0x2cb84b['accountcode']?_[_0x49e3('0x13')](_0x2cb84b['accountcode']):undefined,'uniqueid':_0x2cb84b[_0x49e3('0x14')]},'log':'CreateMemberReport'});};exports[_0x49e3('0x15')]=function(_0x4ec699){return client[_0x49e3('0x6')](_0x49e3('0x16'),{'body':{'channel':_0x49e3('0x7'),'membername':_0x4ec699[_0x49e3('0x17')],'interface':_0x4ec699[_0x49e3('0xa')],'type':_0x49e3('0xd'),'enterAt':_0x4ec699[_0x49e3('0x18')],'exitAt':_0x4ec699[_0x49e3('0x19')],'duration':moment(_0x4ec699[_0x49e3('0x19')])[_0x49e3('0x1a')](_0x4ec699[_0x49e3('0x18')],'seconds')>=0x0?moment(_0x4ec699['endtime'])[_0x49e3('0x1a')](_0x4ec699[_0x49e3('0x18')],_0x49e3('0xe')):null,'data1':'outbound','data2':_0x4ec699[_0x49e3('0x1b')],'data3':_0x4ec699['exten'],'data4':_0x4ec699[_0x49e3('0x1c')]||null,'role':_0x49e3('0x1d'),'internal':_0x4ec699[_0x49e3('0x1b')]?_[_0x49e3('0x13')](_0x4ec699[_0x49e3('0x1b')]):undefined,'uniqueid':_0x4ec699[_0x49e3('0x14')]},'log':_0x49e3('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index ee5957d..7ecf2c3 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 _0x3792=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x452bbe,_0x339a1b){var _0xd0622b=function(_0x1ebda3){while(--_0x1ebda3){_0x452bbe['push'](_0x452bbe['shift']());}};_0xd0622b(++_0x339a1b);}(_0x3792,0xbe));var _0x2379=function(_0x3d3951,_0x3cffe2){_0x3d3951=_0x3d3951-0x0;var _0x47f3a7=_0x3792[_0x3d3951];return _0x47f3a7;};'use strict';var client=require(_0x2379('0x0'));exports[_0x2379('0x1')]=function(){return client['Request'](_0x2379('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2379('0x3'),_0x2379('0x4')]},'log':_0x2379('0x5')});}; \ No newline at end of file +var _0x6a6e=['getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x6a6e,0xe3));var _0xe6a6=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x6a6e[_0x20e7e3];return _0x14b9de;};'use strict';var client=require(_0xe6a6('0x0'));exports[_0xe6a6('0x1')]=function(){return client['Request'](_0xe6a6('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe6a6('0x3'),_0xe6a6('0x4')]},'log':_0xe6a6('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 58db729..abdfe69 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 _0x0901=['../client','getTemplates','Request','GetTemplate'];(function(_0x46e1d2,_0x5a0d8a){var _0x5689d0=function(_0x657c08){while(--_0x657c08){_0x46e1d2['push'](_0x46e1d2['shift']());}};_0x5689d0(++_0x5a0d8a);}(_0x0901,0x134));var _0x1090=function(_0x25715d,_0x2ede9e){_0x25715d=_0x25715d-0x0;var _0x3aeb0c=_0x0901[_0x25715d];return _0x3aeb0c;};'use strict';var client=require(_0x1090('0x0'));exports[_0x1090('0x1')]=function(_0x42b657){return function(_0x39882a){return client[_0x1090('0x2')](_0x1090('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x1090('0x3')});};}; \ No newline at end of file +var _0xaa22=['html','Request','GetTemplate','name'];(function(_0x45e56c,_0x4235d0){var _0x4826ef=function(_0x18ae28){while(--_0x18ae28){_0x45e56c['push'](_0x45e56c['shift']());}};_0x4826ef(++_0x4235d0);}(_0xaa22,0x1dd));var _0x2aa2=function(_0xd9f14e,_0x17a647){_0xd9f14e=_0xd9f14e-0x0;var _0x252791=_0xaa22[_0xd9f14e];return _0x252791;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x4532ae){return function(_0x54c0bb){return client[_0x2aa2('0x0')](_0x2aa2('0x1'),{'options':{'raw':!![],'attributes':['id',_0x2aa2('0x2'),_0x2aa2('0x3')]},'log':_0x2aa2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index bf8bd57..103c88a 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 _0x558d=['data2','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x558d,0x16a));var _0xd558=function(_0x47041d,_0x42153f){_0x47041d=_0x47041d-0x0;var _0x5022bd=_0x558d[_0x47041d];return _0x5022bd;};'use strict';var client=require(_0xd558('0x0'));exports[_0xd558('0x1')]=function(_0x3da6c6){return function(_0x43a6cf){return client[_0xd558('0x2')](_0xd558('0x3'),{'options':{'raw':![],'attributes':['id',_0xd558('0x4'),_0xd558('0x5'),'status'],'include':[{'model':_0xd558('0x6'),'as':_0xd558('0x7'),'attributes':['id',_0xd558('0x8'),'operator',_0xd558('0x9')]},{'model':_0xd558('0x6'),'as':_0xd558('0xa'),'attributes':['id',_0xd558('0x8'),_0xd558('0xb'),_0xd558('0x9')]},{'model':_0xd558('0xc'),'as':_0xd558('0xd'),'attributes':['id',_0xd558('0xe'),_0xd558('0xf'),_0xd558('0x10'),_0xd558('0x11'),'data4',_0xd558('0x12'),_0xd558('0x13'),_0xd558('0x14')]}]},'log':_0xd558('0x3')});};}; \ No newline at end of file +var _0xac7d=['Actions','action','data1','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','Condition','AnyConditions','operator','value','Action'];(function(_0x411490,_0x52a6c2){var _0x4ea60a=function(_0x43fe8d){while(--_0x43fe8d){_0x411490['push'](_0x411490['shift']());}};_0x4ea60a(++_0x52a6c2);}(_0xac7d,0x158));var _0xdac7=function(_0x3359ce,_0x348b97){_0x3359ce=_0x3359ce-0x0;var _0x5ee2cc=_0xac7d[_0x3359ce];return _0x5ee2cc;};'use strict';var client=require(_0xdac7('0x0'));exports[_0xdac7('0x1')]=function(_0xde832){return function(_0x28b692){return client[_0xdac7('0x2')](_0xdac7('0x3'),{'options':{'raw':![],'attributes':['id',_0xdac7('0x4'),_0xdac7('0x5'),_0xdac7('0x6')],'include':[{'model':'Condition','as':_0xdac7('0x7'),'attributes':['id','field','operator','value']},{'model':_0xdac7('0x8'),'as':_0xdac7('0x9'),'attributes':['id','field',_0xdac7('0xa'),_0xdac7('0xb')]},{'model':_0xdac7('0xc'),'as':_0xdac7('0xd'),'attributes':['id',_0xdac7('0xe'),_0xdac7('0xf'),_0xdac7('0x10'),'data3',_0xdac7('0x11'),_0xdac7('0x12'),_0xdac7('0x13'),_0xdac7('0x14')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 6539ae0..95751df 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 _0x6510=['../client','getTrunks','Request','name','registry','defaultuser','GetTrunk'];(function(_0x265ec3,_0x1efa96){var _0x253820=function(_0x414e7c){while(--_0x414e7c){_0x265ec3['push'](_0x265ec3['shift']());}};_0x253820(++_0x1efa96);}(_0x6510,0x77));var _0x0651=function(_0x569338,_0x3230b5){_0x569338=_0x569338-0x0;var _0x106d4b=_0x6510[_0x569338];return _0x106d4b;};'use strict';var client=require(_0x0651('0x0'));exports[_0x0651('0x1')]=function(_0x1ce53b){return function(_0x1668b0){return client[_0x0651('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0651('0x3'),_0x0651('0x4'),_0x0651('0x5')]},'log':_0x0651('0x6')});};}; \ No newline at end of file +var _0x2544=['defaultuser','../client','Request','GetTrunk','name','registry'];(function(_0x2cbb64,_0xe2f568){var _0x3b812b=function(_0x4db0b9){while(--_0x4db0b9){_0x2cbb64['push'](_0x2cbb64['shift']());}};_0x3b812b(++_0xe2f568);}(_0x2544,0x8b));var _0x4254=function(_0x44fc7c,_0x54a2cf){_0x44fc7c=_0x44fc7c-0x0;var _0x152f52=_0x2544[_0x44fc7c];return _0x152f52;};'use strict';var client=require(_0x4254('0x0'));exports['getTrunks']=function(_0x4b1454){return function(_0xd93755){return client[_0x4254('0x1')](_0x4254('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4254('0x3'),_0x4254('0x4'),_0x4254('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 97db0dd..cdf3212 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x4ca0a7,_0x1b26ac){var _0x26282a=function(_0x3dcc83){while(--_0x3dcc83){_0x4ca0a7['push'](_0x4ca0a7['shift']());}};_0x26282a(++_0x1b26ac);}(_0x70e0,0x17b));var _0x070e=function(_0x155d50,_0x221c92){_0x155d50=_0x155d50-0x0;var _0x599183=_0x70e0[_0x155d50];return _0x599183;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe706,0xa3));var _0x6e70=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xe706[_0x5caf7e];return _0x5c3435;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 41fc023..0744503 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 _0x25e6=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x46c8fb,_0x253501){var _0x48f9eb=function(_0x5d5b03){while(--_0x5d5b03){_0x46c8fb['push'](_0x46c8fb['shift']());}};_0x48f9eb(++_0x253501);}(_0x25e6,0x10d));var _0x625e=function(_0x324bab,_0x326e67){_0x324bab=_0x324bab-0x0;var _0x103149=_0x25e6[_0x324bab];return _0x103149;};'use strict';var client=require(_0x625e('0x0'));exports[_0x625e('0x1')]=function(_0x1f01ae){return client[_0x625e('0x2')](_0x625e('0x3'),{'body':_0x1f01ae,'log':_0x625e('0x3')});};exports[_0x625e('0x4')]=function(_0x8c3ff7,_0x1a0d6c,_0x4130d4){return client[_0x625e('0x2')](_0x625e('0x5'),{'body':_0x8c3ff7,'options':{'where':{'uniqueid':_0x1a0d6c,'interface':_0x4130d4,'agentcomplete':!![]}},'log':_0x625e('0x5')});}; \ No newline at end of file +var _0x139d=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x4bce41,_0x2ca87c){var _0x56d241=function(_0x40a21f){while(--_0x40a21f){_0x4bce41['push'](_0x4bce41['shift']());}};_0x56d241(++_0x2ca87c);}(_0x139d,0x100));var _0xd139=function(_0x5204f9,_0x3f782c){_0x5204f9=_0x5204f9-0x0;var _0x4677c5=_0x139d[_0x5204f9];return _0x4677c5;};'use strict';var client=require(_0xd139('0x0'));exports[_0xd139('0x1')]=function(_0x2a3062){return client[_0xd139('0x2')](_0xd139('0x3'),{'body':_0x2a3062,'log':_0xd139('0x3')});};exports[_0xd139('0x4')]=function(_0x4fa92c,_0x443364,_0x2fc0fa){return client[_0xd139('0x2')](_0xd139('0x5'),{'body':_0x4fa92c,'options':{'where':{'uniqueid':_0x443364,'interface':_0x2fc0fa,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index cd1058d..6f148f4 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 _0xaade=['merge','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','lodash','create','Request','CreateVoiceCallReport'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0xaade,0x118));var _0xeaad=function(_0x25dfd1,_0x545943){_0x25dfd1=_0x25dfd1-0x0;var _0xc99de2=_0xaade[_0x25dfd1];return _0xc99de2;};'use strict';var moment=require(_0xeaad('0x0'));var util=require('util');var _=require(_0xeaad('0x1'));var client=require('../client');exports[_0xeaad('0x2')]=function(_0x26dbdd){return client[_0xeaad('0x3')](_0xeaad('0x4'),{'body':_[_0xeaad('0x5')](_0x26dbdd,{'source':_0x26dbdd['calleridnum'],'destinationcontext':_0x26dbdd[_0xeaad('0x6')],'callerid':_0x26dbdd[_0xeaad('0x7')],'amaflags':_0xeaad('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0xeaad('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xeaad('0xa')],'createdAt':{'$between':[moment()[_0xeaad('0xb')](_0xeaad('0xc'))[_0xeaad('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xeaad('0xc'))[_0xeaad('0xd')](_0xeaad('0xe'))]}},'attributes':[_0xeaad('0xf'),_0xeaad('0x10'),_0xeaad('0x11'),'billableseconds']},'log':_0xeaad('0x12')});};}; \ No newline at end of file +var _0x4957=['calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type','disposition','moment','lodash','../client','Request','CreateVoiceCallReport','merge'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x4957,0x14e));var _0x7495=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x4957[_0x500419];return _0x241c1a;};'use strict';var moment=require(_0x7495('0x0'));var util=require('util');var _=require(_0x7495('0x1'));var client=require(_0x7495('0x2'));exports['create']=function(_0x5b8033){return client[_0x7495('0x3')](_0x7495('0x4'),{'body':_[_0x7495('0x5')](_0x5b8033,{'source':_0x5b8033[_0x7495('0x6')],'destinationcontext':_0x5b8033['context'],'callerid':_0x5b8033['callerid'],'amaflags':_0x7495('0x7')}),'log':_0x7495('0x4')});};exports[_0x7495('0x8')]=function(){return function(){return client[_0x7495('0x3')](_0x7495('0x9'),{'options':{'where':{'type':[_0x7495('0xa')],'createdAt':{'$between':[moment()[_0x7495('0xb')]('day')[_0x7495('0xc')](_0x7495('0xd')),moment()['endOf'](_0x7495('0xe'))[_0x7495('0xc')](_0x7495('0xd'))]}},'attributes':[_0x7495('0xf'),_0x7495('0x10'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 451272e..7e27ce4 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 _0xa2c5=['Request','CreateVoiceDialReport','../client','create'];(function(_0x393a0b,_0x2447b3){var _0x22b5b2=function(_0x1d9121){while(--_0x1d9121){_0x393a0b['push'](_0x393a0b['shift']());}};_0x22b5b2(++_0x2447b3);}(_0xa2c5,0x96));var _0x5a2c=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa2c5[_0x2112d4];return _0x434972;};'use strict';var client=require(_0x5a2c('0x0'));exports[_0x5a2c('0x1')]=function(_0x7f481a){return client[_0x5a2c('0x2')](_0x5a2c('0x3'),{'body':_0x7f481a,'log':_0x5a2c('0x3')});}; \ No newline at end of file +var _0x47e0=['create','Request','CreateVoiceDialReport','../client'];(function(_0x4a9d73,_0x404b5f){var _0x2544c1=function(_0x45c894){while(--_0x45c894){_0x4a9d73['push'](_0x4a9d73['shift']());}};_0x2544c1(++_0x404b5f);}(_0x47e0,0x19b));var _0x047e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47e0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x047e('0x0'));exports[_0x047e('0x1')]=function(_0x7e9de6){return client[_0x047e('0x2')](_0x047e('0x3'),{'body':_0x7e9de6,'log':_0x047e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5b0920a..414b2ce 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 _0xb84e=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x50e3f5,_0x52ead4){var _0x3e5226=function(_0x42131c){while(--_0x42131c){_0x50e3f5['push'](_0x50e3f5['shift']());}};_0x3e5226(++_0x52ead4);}(_0xb84e,0xbf));var _0xeb84=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb84e[_0x125ff8];return _0x2d9ef;};'use strict';var client=require('../client');exports[_0xeb84('0x0')]=function(){return function(){return client[_0xeb84('0x1')](_0xeb84('0x2'),{'options':{'raw':!![],'attributes':['id',_0xeb84('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xaf4c=['recordingFormat','getVoiceExtensions','Request','exten'];(function(_0x37b0b7,_0x3f9649){var _0x14d884=function(_0x1e9e8e){while(--_0x1e9e8e){_0x37b0b7['push'](_0x37b0b7['shift']());}};_0x14d884(++_0x3f9649);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x343a7f,_0x3a535b){_0x343a7f=_0x343a7f-0x0;var _0x15d65d=_0xaf4c[_0x343a7f];return _0x15d65d;};'use strict';var client=require('../client');exports[_0xcaf4('0x0')]=function(){return function(){return client[_0xcaf4('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xcaf4('0x2'),_0xcaf4('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xcaf4('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6a85e67..c281da3 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 _0x3270=['Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active'];(function(_0x414ee7,_0x42b2af){var _0x3eb5e1=function(_0x2c8b70){while(--_0x2c8b70){_0x414ee7['push'](_0x414ee7['shift']());}};_0x3eb5e1(++_0x42b2af);}(_0x3270,0xcf));var _0x0327=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x3270[_0x219d87];return _0x22823d;};'use strict';var client=require(_0x0327('0x0'));exports[_0x0327('0x1')]=function(){return function(){return client[_0x0327('0x2')](_0x0327('0x3'),{'options':{'raw':![],'attributes':['id',_0x0327('0x4'),_0x0327('0x5'),'acwTimeout','autopause',_0x0327('0x6'),_0x0327('0x7'),_0x0327('0x8'),_0x0327('0x9'),_0x0327('0xa'),'dialLimitQueue',_0x0327('0xb'),_0x0327('0xc'),_0x0327('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x0327('0xe'),'dialOriginateTimeout',_0x0327('0xf'),_0x0327('0x10'),_0x0327('0x11'),_0x0327('0x12'),_0x0327('0x13'),'dialBusyMaxRetry',_0x0327('0x14'),_0x0327('0x15'),_0x0327('0x16'),_0x0327('0x17'),_0x0327('0x18'),_0x0327('0x19'),_0x0327('0x1a'),_0x0327('0x1b'),_0x0327('0x1c'),_0x0327('0x1d'),_0x0327('0x1e'),_0x0327('0x1f'),_0x0327('0x20'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x0327('0x21'),_0x0327('0x22'),_0x0327('0x23'),_0x0327('0x24'),_0x0327('0x25'),'dialRecallInQueue',_0x0327('0x26'),_0x0327('0x27'),_0x0327('0x28'),_0x0327('0x29'),_0x0327('0x6'),_0x0327('0x2a'),_0x0327('0x2b'),_0x0327('0x2c'),_0x0327('0x2d'),'dialNoSuchNumberRetryFrequency',_0x0327('0x2e'),_0x0327('0x2f'),_0x0327('0x30'),_0x0327('0x31'),_0x0327('0x32'),_0x0327('0x33'),'dialAgentRejectMaxRetry',_0x0327('0x34'),_0x0327('0x35'),_0x0327('0x36'),_0x0327('0x37'),_0x0327('0x38'),_0x0327('0x39')],'include':[{'model':_0x0327('0x3a'),'as':'Trunk','attributes':['id',_0x0327('0x4'),_0x0327('0x3b'),_0x0327('0x3c')]},{'model':_0x0327('0x3d'),'as':_0x0327('0x3e'),'attributes':['id',_0x0327('0x4')]},{'model':_0x0327('0x3a'),'as':_0x0327('0x3f'),'attributes':['id',_0x0327('0x4'),_0x0327('0x3b'),_0x0327('0x3c')]},{'model':_0x0327('0x40'),'as':_0x0327('0x40'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x0327('0x41'),'attributes':['id',_0x0327('0x4'),_0x0327('0x42')]}]}]},'log':_0x0327('0x1')});};}; \ No newline at end of file +var _0x08dc=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','../client','Request','GetVoiceQueue','name','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence'];(function(_0x506161,_0x4437fc){var _0x1ba970=function(_0x36b1f4){while(--_0x36b1f4){_0x506161['push'](_0x506161['shift']());}};_0x1ba970(++_0x4437fc);}(_0x08dc,0x1e8));var _0xc08d=function(_0x23cd03,_0x55adec){_0x23cd03=_0x23cd03-0x0;var _0xcb6763=_0x08dc[_0x23cd03];return _0xcb6763;};'use strict';var client=require(_0xc08d('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xc08d('0x1')](_0xc08d('0x2'),{'options':{'raw':![],'attributes':['id',_0xc08d('0x3'),'acw',_0xc08d('0x4'),'autopause',_0xc08d('0x5'),_0xc08d('0x6'),_0xc08d('0x7'),_0xc08d('0x8'),'dialLimitChannel',_0xc08d('0x9'),_0xc08d('0xa'),'dialPredictiveOptimization',_0xc08d('0xb'),'dialPredictiveInterval',_0xc08d('0xc'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0xc08d('0xd'),'dialQueueTimeout',_0xc08d('0xe'),_0xc08d('0xf'),_0xc08d('0x10'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xc08d('0x11'),_0xc08d('0x12'),_0xc08d('0x13'),'dialTimezone',_0xc08d('0x14'),_0xc08d('0x15'),_0xc08d('0x16'),_0xc08d('0x17'),_0xc08d('0x18'),_0xc08d('0x19'),_0xc08d('0x1a'),'dialAMDTotalAnalysisTime',_0xc08d('0x1b'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xc08d('0x1c'),'dialAMDMaximumWordLength',_0xc08d('0x1d'),_0xc08d('0x1e'),_0xc08d('0x1f'),_0xc08d('0x20'),_0xc08d('0x21'),'dialAgiAfterHangupClient',_0xc08d('0x22'),_0xc08d('0x5'),'strategy',_0xc08d('0x23'),_0xc08d('0x24'),_0xc08d('0x25'),_0xc08d('0x26'),_0xc08d('0x27'),_0xc08d('0x28'),_0xc08d('0x29'),_0xc08d('0x2a'),'dialMachineMaxRetry',_0xc08d('0x2b'),'dialAgentRejectMaxRetry',_0xc08d('0x2c'),_0xc08d('0x2d'),_0xc08d('0x2e'),_0xc08d('0x2f'),_0xc08d('0x30'),'dialPreviewRecallmeReminder'],'include':[{'model':_0xc08d('0x31'),'as':_0xc08d('0x31'),'attributes':['id',_0xc08d('0x3'),'callerid',_0xc08d('0x32')]},{'model':_0xc08d('0x33'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xc08d('0x31'),'as':_0xc08d('0x34'),'attributes':['id',_0xc08d('0x3'),_0xc08d('0x35'),_0xc08d('0x32')]},{'model':_0xc08d('0x36'),'as':'Interval','attributes':['id',_0xc08d('0x3')],'include':[{'model':'Interval','as':_0xc08d('0x37'),'attributes':['id',_0xc08d('0x3'),_0xc08d('0x38')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index af1c0b3..7d83ea2 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(_0x5d719f,_0x418029){var _0x3cd75a=function(_0xe745f7){while(--_0xe745f7){_0x5d719f['push'](_0x5d719f['shift']());}};_0x3cd75a(++_0x418029);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0xc7536,_0x607ae){var _0x483ede=function(_0x47941c){while(--_0x47941c){_0xc7536['push'](_0xc7536['shift']());}};_0x483ede(++_0x607ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 890a75a..bbf519a 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 _0xf357=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1ec78e,_0x1f3c41){var _0x406d3c=function(_0xb03223){while(--_0xb03223){_0x1ec78e['push'](_0x1ec78e['shift']());}};_0x406d3c(++_0x1f3c41);}(_0xf357,0x17e));var _0x7f35=function(_0x50a519,_0x2b35f5){_0x50a519=_0x50a519-0x0;var _0x43d243=_0xf357[_0x50a519];return _0x43d243;};'use strict';var client=require(_0x7f35('0x0'));exports[_0x7f35('0x1')]=function(_0x34cdb0){return function(){return client[_0x7f35('0x2')](_0x7f35('0x3'),{'options':{'where':{'VoiceQueueId':_0x34cdb0,'paused':!![]},'raw':!![]},'log':_0x7f35('0x1')});};}; \ No newline at end of file +var _0x40cd=['Request','../client','getVoiceQueueRtPauses'];(function(_0x279a84,_0x5941bc){var _0x430c76=function(_0xce1f24){while(--_0xce1f24){_0x279a84['push'](_0x279a84['shift']());}};_0x430c76(++_0x5941bc);}(_0x40cd,0x8e));var _0xd40c=function(_0x5ca480,_0x1ddf7b){_0x5ca480=_0x5ca480-0x0;var _0x168ef3=_0x40cd[_0x5ca480];return _0x168ef3;};'use strict';var client=require(_0xd40c('0x0'));exports[_0xd40c('0x1')]=function(_0x2a2a8f){return function(){return client[_0xd40c('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2a2a8f,'paused':!![]},'raw':!![]},'log':_0xd40c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index a743280..4f22de1 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(_0x260130,_0x4a8829){var _0x9fa6a=function(_0x4c56e1){while(--_0x4c56e1){_0x260130['push'](_0x260130['shift']());}};_0x9fa6a(++_0x4a8829);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5976,_0x5b9fb2){_0x4a5976=_0x4a5976-0x0;var _0x7059ac=_0x7a54[_0x4a5976];return _0x7059ac;};'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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xd70470,_0x591256){var _0x2c4bc3=function(_0x2b480e){while(--_0x2b480e){_0xd70470['push'](_0xd70470['shift']());}};_0x2c4bc3(++_0x591256);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index bf69419..245f4e4 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 _0xd4ed=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel'];(function(_0x13d583,_0x5fa9fe){var _0x200579=function(_0x358d65){while(--_0x358d65){_0x13d583['push'](_0x13d583['shift']());}};_0x200579(++_0x5fa9fe);}(_0xd4ed,0xa2));var _0xdd4e=function(_0x45fd84,_0x2145c2){_0x45fd84=_0x45fd84-0x0;var _0x1add79=_0xd4ed[_0x45fd84];return _0x1add79;};'use strict';var client=require(_0xdd4e('0x0'));exports[_0xdd4e('0x1')]={};exports['blindTransfer']=function(_0x85cbf1){return client[_0xdd4e('0x2')](_0xdd4e('0x3'),{'body':{'result':_0x85cbf1[_0xdd4e('0x4')],'transfererchannel':_0x85cbf1[_0xdd4e('0x5')],'transferercalleridnum':_0x85cbf1[_0xdd4e('0x6')],'transferercalleridname':_0x85cbf1['transferercalleridname'],'transfererconnectedlinenum':_0x85cbf1['transfererconnectedlinenum'],'transfererconnectedlinename':_0x85cbf1['transfererconnectedlinename'],'transfereraccountcode':_0x85cbf1[_0xdd4e('0x7')],'transferercontext':_0x85cbf1[_0xdd4e('0x8')],'transfererexten':_0x85cbf1['transfererexten'],'transfererlinkedid':_0x85cbf1[_0xdd4e('0x9')],'transfereechannel':_0x85cbf1[_0xdd4e('0xa')],'transfereecalleridnum':_0x85cbf1[_0xdd4e('0xb')],'transfereecalleridname':_0x85cbf1[_0xdd4e('0xc')],'transfereeconnectedlinenum':_0x85cbf1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x85cbf1[_0xdd4e('0xd')],'transfereeaccountcode':_0x85cbf1[_0xdd4e('0xe')],'transfereecontext':_0x85cbf1[_0xdd4e('0xf')],'transfereeexten':_0x85cbf1[_0xdd4e('0x10')],'transfereelinkedid':_0x85cbf1[_0xdd4e('0x11')],'isexternal':_0x85cbf1[_0xdd4e('0x12')],'context':_0x85cbf1[_0xdd4e('0x13')],'extension':_0x85cbf1[_0xdd4e('0x14')],'type':_0xdd4e('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4c7b3a){return client[_0xdd4e('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x4c7b3a[_0xdd4e('0x4')],'transfererchannel':_0x4c7b3a[_0xdd4e('0x16')],'transferercalleridnum':_0x4c7b3a[_0xdd4e('0x17')],'transferercalleridname':_0x4c7b3a[_0xdd4e('0x18')],'transfererconnectedlinenum':_0x4c7b3a[_0xdd4e('0x19')],'transfererconnectedlinename':_0x4c7b3a[_0xdd4e('0x1a')],'transfereraccountcode':_0x4c7b3a[_0xdd4e('0x1b')],'transferercontext':_0x4c7b3a['secondtransferercontext'],'transfererexten':_0x4c7b3a['secondtransfererexten'],'transfererlinkedid':_0x4c7b3a[_0xdd4e('0x1c')],'transfereechannel':_0x4c7b3a['transfertargetchannel'],'transfereecalleridnum':_0x4c7b3a[_0xdd4e('0x1d')],'transfereecalleridname':_0x4c7b3a[_0xdd4e('0x1e')],'transfereeconnectedlinenum':_0x4c7b3a[_0xdd4e('0x1f')],'transfereeconnectedlinename':_0x4c7b3a[_0xdd4e('0x20')],'transfereeaccountcode':_0x4c7b3a['transfertargetaccountcode'],'transfereecontext':_0x4c7b3a[_0xdd4e('0x21')],'transfereeexten':_0x4c7b3a[_0xdd4e('0x22')],'transfereelinkedid':_0x4c7b3a[_0xdd4e('0x23')],'isexternal':_0x4c7b3a[_0xdd4e('0x12')],'context':_0x4c7b3a['origtransferercontext'],'extension':_0x4c7b3a['origtransfererexten'],'type':_0xdd4e('0x24')},'log':_0xdd4e('0x3')});}; \ No newline at end of file +var _0x4274=['transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten'];(function(_0x595151,_0x1f1f72){var _0x5776df=function(_0x4930fa){while(--_0x4930fa){_0x595151['push'](_0x595151['shift']());}};_0x5776df(++_0x1f1f72);}(_0x4274,0xea));var _0x4427=function(_0xe20cbe,_0x1e55f1){_0xe20cbe=_0xe20cbe-0x0;var _0x35f01d=_0x4274[_0xe20cbe];return _0x35f01d;};'use strict';var client=require('../client');exports[_0x4427('0x0')]={};exports[_0x4427('0x1')]=function(_0x24ea9b){return client[_0x4427('0x2')](_0x4427('0x3'),{'body':{'result':_0x24ea9b[_0x4427('0x4')],'transfererchannel':_0x24ea9b['transfererchannel'],'transferercalleridnum':_0x24ea9b[_0x4427('0x5')],'transferercalleridname':_0x24ea9b[_0x4427('0x6')],'transfererconnectedlinenum':_0x24ea9b['transfererconnectedlinenum'],'transfererconnectedlinename':_0x24ea9b[_0x4427('0x7')],'transfereraccountcode':_0x24ea9b[_0x4427('0x8')],'transferercontext':_0x24ea9b[_0x4427('0x9')],'transfererexten':_0x24ea9b['transfererexten'],'transfererlinkedid':_0x24ea9b[_0x4427('0xa')],'transfereechannel':_0x24ea9b[_0x4427('0xb')],'transfereecalleridnum':_0x24ea9b['transfereecalleridnum'],'transfereecalleridname':_0x24ea9b['transfereecalleridname'],'transfereeconnectedlinenum':_0x24ea9b[_0x4427('0xc')],'transfereeconnectedlinename':_0x24ea9b['transfereeconnectedlinename'],'transfereeaccountcode':_0x24ea9b[_0x4427('0xd')],'transfereecontext':_0x24ea9b[_0x4427('0xe')],'transfereeexten':_0x24ea9b[_0x4427('0xf')],'transfereelinkedid':_0x24ea9b[_0x4427('0x10')],'isexternal':_0x24ea9b[_0x4427('0x11')],'context':_0x24ea9b['context'],'extension':_0x24ea9b[_0x4427('0x12')],'type':_0x4427('0x13')},'log':_0x4427('0x3')});};exports[_0x4427('0x14')]=function(_0xcd564d){return client[_0x4427('0x2')](_0x4427('0x3'),{'body':{'result':_0xcd564d[_0x4427('0x4')],'transfererchannel':_0xcd564d[_0x4427('0x15')],'transferercalleridnum':_0xcd564d[_0x4427('0x16')],'transferercalleridname':_0xcd564d[_0x4427('0x17')],'transfererconnectedlinenum':_0xcd564d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xcd564d[_0x4427('0x18')],'transfereraccountcode':_0xcd564d[_0x4427('0x19')],'transferercontext':_0xcd564d[_0x4427('0x1a')],'transfererexten':_0xcd564d[_0x4427('0x1b')],'transfererlinkedid':_0xcd564d[_0x4427('0x1c')],'transfereechannel':_0xcd564d[_0x4427('0x1d')],'transfereecalleridnum':_0xcd564d[_0x4427('0x1e')],'transfereecalleridname':_0xcd564d[_0x4427('0x1f')],'transfereeconnectedlinenum':_0xcd564d[_0x4427('0x20')],'transfereeconnectedlinename':_0xcd564d[_0x4427('0x21')],'transfereeaccountcode':_0xcd564d[_0x4427('0x22')],'transfereecontext':_0xcd564d[_0x4427('0x23')],'transfereeexten':_0xcd564d[_0x4427('0x24')],'transfereelinkedid':_0xcd564d[_0x4427('0x25')],'isexternal':_0xcd564d['isexternal'],'context':_0xcd564d['origtransferercontext'],'extension':_0xcd564d[_0x4427('0x26')],'type':'attended'},'log':_0x4427('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 29e65c8..86740ed 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 _0x0e85=['MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','type','inbound','outbound','includes','filter','count','voicequeuechannel','queueChannels','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../model/voiceQueueSummary','format','%s/%s','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','keys','reload','module','action','Reload','Action','message','catch','pick','command','Command','content','voiceQueues','push','length','omit','undefined','values','channels','join','map','find','uniqueid','filename','wav','MixMonitor','channel','ai(mixmonitorid)','then','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0e85[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var jayson=require('jayson/promise');var schema=require(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require('../ami');var VoiceQueueSummary=require(_0x50e8('0x4'));exports['listen']=function(_0x3048e3,_0x2401b2,_0xe3151e){return new Promise(function(_0xfde42,_0x5e8b01){var _0x3ce904={'QueuePause':function(_0x108edc){return new Promise(function(_0x42665e){var _0x988da0=util[_0x50e8('0x5')](_0x50e8('0x6'),'SIP',_0x108edc[_0x50e8('0x7')]);if(_0x3048e3[_0x50e8('0x8')]&&_0x3048e3[_0x50e8('0x8')][_0x988da0]&&_0x3048e3[_0x50e8('0x8')][_0x988da0][_0x50e8('0x9')]){_0x3048e3[_0x50e8('0x8')][_0x988da0][_0x50e8('0xa')]();}if(_0x3048e3[_0x50e8('0xb')][_0x988da0]){_0x3048e3['agents'][_0x988da0]['updateStatusRealtime']({'statePause':_0x108edc[_0x50e8('0xc')]?!![]:![]});}_0x42665e({'code':0xc8,'message':_0x50e8('0xd')});});},'Reload':function(_0x508377){var _0x49e02f=this;return new Promise(function(_0x3cb45c,_0x2abda1){if(ami[_0x50e8('0xe')]()==![]){return _0x2abda1(_0x49e02f[_0x50e8('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x50e8('0x10')][_0x50e8('0x11')],_0x50e8('0x12')]['join']('\x20')));}_0x508377=_['pick'](_0x508377,_[_0x50e8('0x13')](properties[_0x50e8('0x14')][_0x50e8('0x15')]));_0x508377[_0x50e8('0x16')]=_0x50e8('0x17');return ami[_0x50e8('0x18')](_0x508377)['then'](function(_0x5a5ef2){_0x3cb45c({'code':0xc8,'message':_0x5a5ef2[_0x50e8('0x19')]});})[_0x50e8('0x1a')](function(_0x40d060){_0x2abda1(_0x49e02f[_0x50e8('0xf')](0x1f5,_0x40d060[_0x50e8('0x19')]));});});},'Command':function(_0x90c54c){var _0x1a451d=this;return new Promise(function(_0x53e0a1,_0x415596){if(ami['isConnected']()==![]){return _0x415596(_0x1a451d[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')][_0x50e8('0x11')],_0x50e8('0x12')]['join']('\x20')));}_0x90c54c=_[_0x50e8('0x1b')](_0x90c54c,_0x50e8('0x1c'));_0x90c54c['action']=_0x50e8('0x1d');return ami[_0x50e8('0x18')](_0x90c54c)['then'](function(_0x1ce7fc){_0x53e0a1({'code':0xc8,'message':_0x1ce7fc[_0x50e8('0x1e')]});})['catch'](function(_0x47a3d8){_0x415596(_0x1a451d['error'](0x1f5,_0x47a3d8[_0x50e8('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x160372){var _0x124402=[];for(var _0x371a1f in _0x3048e3[_0x50e8('0x1f')]){if(_0x3048e3[_0x50e8('0x1f')]['hasOwnProperty'](_0x371a1f)){var _0x3a6442=_0x3048e3[_0x50e8('0x1f')][_0x371a1f];var _0x4b3a09=new VoiceQueueSummary(_0x3a6442);_0x124402[_0x50e8('0x20')](_0x4b3a09);}}_0x160372({'count':_0x124402[_0x50e8('0x21')],'rows':_0x124402});});},'UpdateVoiceQueue':function(_0x3a14ca){return new Promise(function(_0x2af330,_0x4fbf41){var _0x1f5a6c=_['find'](_0x3048e3[_0x50e8('0x1f')],{'id':parseInt(_0x3a14ca['id'])});var _0x39c0c6=_[_0x50e8('0x22')](_0x3a14ca,['id']);if(_0x1f5a6c){for(var _0x4f0b88 in _0x39c0c6){if(typeof _0x39c0c6[_0x4f0b88]!==_0x50e8('0x23')&&typeof _0x1f5a6c[_0x4f0b88]!==_0x50e8('0x23')){_0x1f5a6c[_0x4f0b88]=_0x39c0c6[_0x4f0b88];}}_0x2af330(_0x1f5a6c);}else{_0x4fbf41();}});},'VoiceChannels':function(){return new Promise(function(_0x1bed48){var _0x8d68c8=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x25')]);_0x1bed48({'count':_0x8d68c8[_0x50e8('0x21')],'rows':_0x8d68c8});});},'VoiceChannelMixMonitor':function(_0x54d81d){var _0x290fd2=this;return new Promise(function(_0x123be9,_0x535c24){if(ami['isConnected']()==![]){return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')]['username'],'ami\x20disconnected'][_0x50e8('0x26')]('\x20')));}var _0x19e3cc=schema(properties['voicechannel'])[_0x50e8('0x2')](_0x54d81d);if(_0x19e3cc[_0x50e8('0x21')]>0x0){return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x19e3cc,'message')[_0x50e8('0x26')](',\x20')));}var _0x4ec6ad=_[_0x50e8('0x28')](_0x3048e3[_0x50e8('0x25')],{'uniqueid':_0x54d81d[_0x50e8('0x29')]});if(_0x4ec6ad&&_0x4ec6ad['channel']){var _0x306816=util[_0x50e8('0x5')]('%s.%s',_0x54d81d[_0x50e8('0x2a')]||_0x54d81d[_0x50e8('0x29')],_0x54d81d[_0x50e8('0x5')]||_0x50e8('0x2b'));return ami['Action']({'action':_0x50e8('0x2c'),'channel':_0x4ec6ad[_0x50e8('0x2d')],'file':_0x306816,'options':_0x50e8('0x2e')})[_0x50e8('0x2f')](function(_0x5e556c){var _0x3c7778=_[_0x50e8('0x28')](_0x4ec6ad[_0x50e8('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x306816['toLowerCase']()});if(_['isNil'](_0x3c7778)){_0x4ec6ad[_0x50e8('0x30')][_0x50e8('0x20')]({'filename':_0x50e8('0x31')+_0x306816[_0x50e8('0x32')](),'createdAt':moment()[_0x50e8('0x5')](_0x50e8('0x33')),'mixmonitorid':_0x5e556c[_0x50e8('0x34')],'status':_0x50e8('0x35')});}else{_0x3c7778[_0x50e8('0x34')]=_0x5e556c[_0x50e8('0x34')];_0x3c7778['status']=_0x50e8('0x35');}_0x123be9({'code':0xc8,'message':[_0x54d81d[_0x50e8('0x29')],_0x50e8('0x36'),_0x5e556c[_0x50e8('0x34')]]['join']('\x20'),'mixmonitorid':_0x5e556c[_0x50e8('0x34')]});})[_0x50e8('0x1a')](function(_0x3fa815){_0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f5,[_0x54d81d[_0x50e8('0x29')],_0x3fa815['message']['toLowerCase']()][_0x50e8('0x26')]('\x20')));});}else{return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2ebd77){var _0xbf947f=this;return new Promise(function(_0x3db1ab,_0x3179a0){if(ami[_0x50e8('0xe')]()==![]){return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')]['username'],_0x50e8('0x12')][_0x50e8('0x26')]('\x20')));}var _0x3ea251=schema(properties[_0x50e8('0x37')])['validate'](_0x2ebd77);if(_0x3ea251[_0x50e8('0x21')]>0x0){return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x3ea251,_0x50e8('0x19'))['join'](',\x20')));}var _0x21dfbf=_['find'](_0x3048e3['channels'],{'uniqueid':_0x2ebd77['uniqueid']});if(_0x21dfbf){return Promise[_0x50e8('0x38')]()[_0x50e8('0x2f')](function(){if(_0x21dfbf['channel']){return ami[_0x50e8('0x18')]({'action':_0x50e8('0x39'),'channel':_0x21dfbf[_0x50e8('0x2d')],'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]})[_0x50e8('0x1a')](function(){});}})[_0x50e8('0x2f')](function(){if(_0x21dfbf['destinationchannel']){return ami[_0x50e8('0x18')]({'action':'StopMixMonitor','channel':_0x21dfbf[_0x50e8('0x3a')],'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]})['catch'](function(){});}})[_0x50e8('0x2f')](function(){var _0x56da97=_[_0x50e8('0x28')](_0x21dfbf[_0x50e8('0x30')],{'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]});if(_0x56da97){_0x56da97[_0x50e8('0x3b')]=_0x50e8('0x3c');}})[_0x50e8('0x2f')](function(){var _0x229d60=util[_0x50e8('0x5')](_0x50e8('0x3d'),_0x2ebd77[_0x50e8('0x2a')]||_0x2ebd77[_0x50e8('0x29')],_0x2ebd77['format']||_0x50e8('0x2b'));var _0x275a1b=_['find'](_0x21dfbf[_0x50e8('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x229d60[_0x50e8('0x32')]()});if(_0x275a1b){_0x275a1b['status']=_0x50e8('0x3c');}})[_0x50e8('0x2f')](function(){_0x3db1ab({'code':0xc8,'message':[_0x2ebd77[_0x50e8('0x29')],_0x50e8('0x3e')][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x2ee1a8){_0x3179a0(_0xbf947f['error'](0x1f5,[_0x2ebd77[_0x50e8('0x29')],_0x2ee1a8[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')));});}else{return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f5,_0x50e8('0x3f')));}});},'VoiceQueuesChannels':function(_0x51746b){var _0x5122a2=this;return new Promise(function(_0x250b28){var _0xff2e24=_[_0x50e8('0x24')](_0x3048e3['queueChannels']);var _0xaa1302={'count':_0xff2e24[_0x50e8('0x21')],'rows':_0xff2e24};if(_0x51746b&&_0x51746b[_0x50e8('0x40')]){if(![_0x50e8('0x41'),_0x50e8('0x42')][_0x50e8('0x43')](_0x51746b[_0x50e8('0x40')])){return _0x5e8b01(_0x5122a2['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x55083e=_[_0x50e8('0x44')](_0xff2e24,function(_0x1400e7){return _0x1400e7[_0x50e8('0x40')]===_0x51746b[_0x50e8('0x40')];});_0xaa1302[_0x50e8('0x45')]=_0x55083e[_0x50e8('0x21')];_0xaa1302['rows']=_0x55083e;}_0x250b28(_0xaa1302);});},'VoiceQueuesChannel':function(_0x2f2154){var _0x3706b6=this;return new Promise(function(_0x460c8e,_0x443b4c){var _0x4a3281=schema(properties[_0x50e8('0x46')])[_0x50e8('0x2')](_0x2f2154);if(_0x4a3281[_0x50e8('0x21')]>0x0){return _0x443b4c(_0x3706b6[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x4a3281,_0x50e8('0x19'))['join'](',\x20')));}var _0x234f94=_['find'](_0x3048e3['queueChannels'],{'uniqueid':_0x2f2154['uniqueid']});if(_0x234f94){_0x460c8e(_0x234f94);}else{return _0x443b4c(_0x3706b6[_0x50e8('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x7974b5){var _0x2d4759=this;return new Promise(function(_0x339f53,_0x2dd17e){if(ami[_0x50e8('0xe')]()==![]){return _0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config['asterisk'][_0x50e8('0x11')],_0x50e8('0x12')][_0x50e8('0x26')]('\x20')));}var _0x560ea7=schema(properties['voicequeuechannelhangup'])['validate'](_0x7974b5);if(_0x560ea7[_0x50e8('0x21')]>0x0){return _0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x560ea7,_0x50e8('0x19'))[_0x50e8('0x26')](',\x20')));}var _0x102181=_['find'](_0x3048e3[_0x50e8('0x47')],{'uniqueid':_0x7974b5['uniqueid']});if(_0x102181&&_0x102181[_0x50e8('0x2d')]){return ami[_0x50e8('0x18')]({'action':'Hangup','channel':_0x102181['channel']})['then'](function(_0x2eed72){_0x339f53({'code':0xc8,'message':[_0x7974b5[_0x50e8('0x29')],_0x2eed72['message'][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x3bbd6f){_0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f5,[_0x7974b5['uniqueid'],_0x3bbd6f[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')));});}else{return _0x2dd17e(_0x2d4759['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x238fdc){var _0x44e9a2=this;return new Promise(function(_0xd21879,_0x323c5a){if(ami[_0x50e8('0xe')]()==![]){return _0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x50e8('0x11')],'ami\x20disconnected'][_0x50e8('0x26')]('\x20')));}var _0x36a288=schema(properties['voicequeuechannelredirect'])[_0x50e8('0x2')](_0x238fdc);if(_0x36a288['length']>0x0){return _0x323c5a(_0x44e9a2['error'](0x1f4,_['map'](_0x36a288,_0x50e8('0x19'))[_0x50e8('0x26')](',\x20')));}var _0x12c037=_[_0x50e8('0x28')](_0x3048e3['queueChannels'],{'uniqueid':_0x238fdc['uniqueid']});if(_0x12c037&&_0x12c037[_0x50e8('0x2d')]){return ami[_0x50e8('0x18')]({'action':_0x50e8('0x48'),'channel':_0x12c037[_0x50e8('0x2d')],'exten':_0x238fdc[_0x50e8('0x49')],'context':_0x238fdc[_0x50e8('0x4a')]||_0x12c037[_0x50e8('0x4a')],'priority':0x1})[_0x50e8('0x2f')](function(_0x2635f0){_0xd21879({'code':0xc8,'message':[_0x238fdc[_0x50e8('0x29')],_0x2635f0[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x310091){_0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f5,[_0x238fdc[_0x50e8('0x29')],_0x310091[_0x50e8('0x19')]['toLowerCase']()][_0x50e8('0x26')]('\x20')));});}else{return _0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f5,_0x50e8('0x3f')));}});},'Agents':function(_0x2359c2){return new Promise(function(_0x5b7f4a){var _0x2e6992=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0xb')]);if(_0x2359c2&&_0x2359c2['id']){var _0x161a07=_[_0x50e8('0x28')](_0x2e6992,function(_0x9319f0){return _0x9319f0['id']===_0x2359c2['id'];});_0x5b7f4a(_0x161a07);}else{_0x5b7f4a({'count':_0x2e6992['length'],'rows':_0x2e6992});}});},'Telephones':function(){return new Promise(function(_0x2f5884){var _0x1b5987=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x4b')]);_0x2f5884({'count':_0x1b5987['length'],'rows':_0x1b5987});});},'Trunks':function(){return new Promise(function(_0x279e00){var _0x53b139=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x4c')]);_0x279e00({'count':_0x53b139[_0x50e8('0x21')],'rows':_0x53b139});});},'OutboundChannels':function(){return new Promise(function(_0x1637b2){var _0x3b1aea=_['values'](_0x3048e3[_0x50e8('0x4d')]);_0x1637b2({'count':_0x3b1aea[_0x50e8('0x21')],'rows':_0x3b1aea});});},'Outbound':function(){return new Promise(function(_0x1ac61b){_0x1ac61b(_0x3048e3[_0x50e8('0x42')]);});},'Campaigns':function(){return new Promise(function(_0x3a3820){var _0x1dc51d=_['values'](_0x3048e3[_0x50e8('0x4e')]);_0x3a3820({'count':_0x1dc51d[_0x50e8('0x21')],'rows':_0x1dc51d});});},'VoiceQueuesPreview':function(_0x4fc73d){var _0x2d35ab=this;return new Promise(function(_0x2fc1b6,_0x4f72e7){_0x2401b2[_0x50e8('0x4f')](_0x4fc73d['id'])['then'](function(_0x253b47){_0x2fc1b6({'code':0xc8,'message':_0x253b47[_0x50e8('0x19')]});})['catch'](function(_0x1cc4c3){_0x4f72e7(_0x2d35ab[_0x50e8('0xf')](0x1f4,_0x1cc4c3[_0x50e8('0x19')]));});});},'EventManager':function(_0x10bdad){var _0x5df5e8=this;return new Promise(function(_0xf21b2f,_0x47b14c){if(!_0x10bdad[_0x50e8('0x50')]){return _0x47b14c(_0x5df5e8[_0x50e8('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x50e8('0x51')](_0x50e8('0x52')+_0x10bdad[_0x50e8('0x50')],_0x10bdad[_0x50e8('0x19')]);_0xf21b2f({'code':0xc8,'message':_0x10bdad});});},'FaxAccounts':function(){return new Promise(function(_0x223355){var _0x3a4db0=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x53')]);_0x223355({'count':_0x3a4db0[_0x50e8('0x21')],'rows':_0x3a4db0});});},'SendFax':function(_0x48d16a){var _0x381fdf=this;return new Promise(function(_0x152649,_0x38c8ef){_0xe3151e['send'](_0x48d16a)[_0x50e8('0x2f')](function(_0x1bf6ae){_0x152649({'code':0xc8,'message':_0x1bf6ae[_0x50e8('0x19')]});})['catch'](function(_0x56d8f1){_0x38c8ef(_0x381fdf[_0x50e8('0xf')](0x1f4,_0x56d8f1[_0x50e8('0x19')]));});});},'CheckAfterSend':function(_0x5d922b){var _0xa27033=this;return new Promise(function(_0x4fa56e,_0x1005da){_0xe3151e[_0x50e8('0x54')](_0x5d922b)[_0x50e8('0x2f')](function(_0x157b27){_0x4fa56e({'code':0xc8,'message':_0x157b27['message']});})[_0x50e8('0x1a')](function(_0x4ac008){_0x1005da(_0xa27033[_0x50e8('0xf')](0x1f4,_0x4ac008['message']));});});}};var _0x55d39f=jayson[_0x50e8('0x55')](_0x3ce904)[_0x50e8('0x56')]();_0x55d39f['on']('error',function(_0x18c2af){return _0x5e8b01(_0x18c2af);});_0x55d39f['listen'](0x232a,_0x50e8('0x57'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xfde42(_0x50e8('0x58')+0x232a);});});}; \ No newline at end of file +var _0xcd59=['length','voicechannel','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','then','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','inbound','outbound','includes','type','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','QueuePause','isConnected','asterisk','username','keys','reload','action','Reload','Action','message','catch','error','ami\x20disconnected','join','pick','command','Command','content','voiceQueues','hasOwnProperty','push','find','undefined','values','channels'];(function(_0x56d383,_0x2f2b09){var _0x458ce0=function(_0x44a149){while(--_0x44a149){_0x56d383['push'](_0x56d383['shift']());}};_0x458ce0(++_0x2f2b09);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4bfa30,_0x5aa996){_0x4bfa30=_0x4bfa30-0x0;var _0x23e8d0=_0xcd59[_0x4bfa30];return _0x23e8d0;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var jayson=require(_0x9cd5('0x2'));var schema=require(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var config=require(_0x9cd5('0x5'));var properties=require('../properties');var ami=require(_0x9cd5('0x6'));var VoiceQueueSummary=require(_0x9cd5('0x7'));exports[_0x9cd5('0x8')]=function(_0x717731,_0x6acbef,_0x2db192){return new Promise(function(_0x46277c,_0x2cd19a){var _0x214256={'QueuePause':function(_0x3f888f){return new Promise(function(_0x545407){var _0x10162d=util[_0x9cd5('0x9')](_0x9cd5('0xa'),_0x9cd5('0xb'),_0x3f888f[_0x9cd5('0xc')]);if(_0x717731[_0x9cd5('0xd')]&&_0x717731[_0x9cd5('0xd')][_0x10162d]&&_0x717731[_0x9cd5('0xd')][_0x10162d]['timer']){_0x717731[_0x9cd5('0xd')][_0x10162d][_0x9cd5('0xe')]();}if(_0x717731[_0x9cd5('0xf')][_0x10162d]){_0x717731[_0x9cd5('0xf')][_0x10162d]['updateStatusRealtime']({'statePause':_0x3f888f['pause']?!![]:![]});}_0x545407({'code':0xc8,'message':_0x9cd5('0x10')});});},'Reload':function(_0x172e29){var _0x44518d=this;return new Promise(function(_0x407079,_0x2ccc05){if(ami[_0x9cd5('0x11')]()==![]){return _0x2ccc05(_0x44518d['error'](0x1f4,[config[_0x9cd5('0x12')]['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],'ami\x20disconnected']['join']('\x20')));}_0x172e29=_['pick'](_0x172e29,_[_0x9cd5('0x14')](properties[_0x9cd5('0x15')]['module']));_0x172e29[_0x9cd5('0x16')]=_0x9cd5('0x17');return ami[_0x9cd5('0x18')](_0x172e29)['then'](function(_0x1e921c){_0x407079({'code':0xc8,'message':_0x1e921c[_0x9cd5('0x19')]});})[_0x9cd5('0x1a')](function(_0x3a6f01){_0x2ccc05(_0x44518d[_0x9cd5('0x1b')](0x1f5,_0x3a6f01[_0x9cd5('0x19')]));});});},'Command':function(_0x5c1622){var _0x37ea13=this;return new Promise(function(_0x18346f,_0x3661b0){if(ami[_0x9cd5('0x11')]()==![]){return _0x3661b0(_0x37ea13[_0x9cd5('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],_0x9cd5('0x1c')][_0x9cd5('0x1d')]('\x20')));}_0x5c1622=_[_0x9cd5('0x1e')](_0x5c1622,_0x9cd5('0x1f'));_0x5c1622[_0x9cd5('0x16')]=_0x9cd5('0x20');return ami[_0x9cd5('0x18')](_0x5c1622)['then'](function(_0x297f0e){_0x18346f({'code':0xc8,'message':_0x297f0e[_0x9cd5('0x21')]});})[_0x9cd5('0x1a')](function(_0x43f47d){_0x3661b0(_0x37ea13['error'](0x1f5,_0x43f47d[_0x9cd5('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x990c25){var _0x211576=[];for(var _0xe36f86 in _0x717731[_0x9cd5('0x22')]){if(_0x717731[_0x9cd5('0x22')][_0x9cd5('0x23')](_0xe36f86)){var _0x4a245f=_0x717731[_0x9cd5('0x22')][_0xe36f86];var _0x64a1c4=new VoiceQueueSummary(_0x4a245f);_0x211576[_0x9cd5('0x24')](_0x64a1c4);}}_0x990c25({'count':_0x211576['length'],'rows':_0x211576});});},'UpdateVoiceQueue':function(_0x5c33e9){return new Promise(function(_0x2e45a3,_0x502257){var _0x52ef5d=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x22')],{'id':parseInt(_0x5c33e9['id'])});var _0x13e0d3=_['omit'](_0x5c33e9,['id']);if(_0x52ef5d){for(var _0x40461a in _0x13e0d3){if(typeof _0x13e0d3[_0x40461a]!==_0x9cd5('0x26')&&typeof _0x52ef5d[_0x40461a]!==_0x9cd5('0x26')){_0x52ef5d[_0x40461a]=_0x13e0d3[_0x40461a];}}_0x2e45a3(_0x52ef5d);}else{_0x502257();}});},'VoiceChannels':function(){return new Promise(function(_0x2689c7){var _0x8e3826=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x28')]);_0x2689c7({'count':_0x8e3826[_0x9cd5('0x29')],'rows':_0x8e3826});});},'VoiceChannelMixMonitor':function(_0x36b0ad){var _0x1c81fd=this;return new Promise(function(_0x3dc2c0,_0x4287bd){if(ami[_0x9cd5('0x11')]()==![]){return _0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x101d99=schema(properties[_0x9cd5('0x2a')])['validate'](_0x36b0ad);if(_0x101d99[_0x9cd5('0x29')]>0x0){return _0x4287bd(_0x1c81fd['error'](0x1f4,_['map'](_0x101d99,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x3a071d=_[_0x9cd5('0x25')](_0x717731['channels'],{'uniqueid':_0x36b0ad[_0x9cd5('0x2b')]});if(_0x3a071d&&_0x3a071d[_0x9cd5('0x2c')]){var _0x403779=util['format'](_0x9cd5('0x2d'),_0x36b0ad[_0x9cd5('0x2e')]||_0x36b0ad[_0x9cd5('0x2b')],_0x36b0ad[_0x9cd5('0x9')]||_0x9cd5('0x2f'));return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x30'),'channel':_0x3a071d[_0x9cd5('0x2c')],'file':_0x403779,'options':_0x9cd5('0x31')})[_0x9cd5('0x32')](function(_0x3cbdba){var _0x5cb5b3=_[_0x9cd5('0x25')](_0x3a071d['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x403779[_0x9cd5('0x33')]()});if(_[_0x9cd5('0x34')](_0x5cb5b3)){_0x3a071d[_0x9cd5('0x35')][_0x9cd5('0x24')]({'filename':'/var/spool/asterisk/monitor/'+_0x403779[_0x9cd5('0x33')](),'createdAt':moment()[_0x9cd5('0x9')](_0x9cd5('0x36')),'mixmonitorid':_0x3cbdba[_0x9cd5('0x37')],'status':'rec'});}else{_0x5cb5b3[_0x9cd5('0x37')]=_0x3cbdba[_0x9cd5('0x37')];_0x5cb5b3[_0x9cd5('0x38')]=_0x9cd5('0x39');}_0x3dc2c0({'code':0xc8,'message':[_0x36b0ad[_0x9cd5('0x2b')],_0x9cd5('0x3a'),_0x3cbdba['mixmonitorid']][_0x9cd5('0x1d')]('\x20'),'mixmonitorid':_0x3cbdba[_0x9cd5('0x37')]});})[_0x9cd5('0x1a')](function(_0x4153b2){_0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f5,[_0x36b0ad[_0x9cd5('0x2b')],_0x4153b2[_0x9cd5('0x19')][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x3ed405){var _0x7ad8ec=this;return new Promise(function(_0xa12319,_0x3b316b){if(ami[_0x9cd5('0x11')]()==![]){return _0x3b316b(_0x7ad8ec[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config['asterisk'][_0x9cd5('0x13')],'ami\x20disconnected'][_0x9cd5('0x1d')]('\x20')));}var _0x2af5a5=schema(properties[_0x9cd5('0x2a')])[_0x9cd5('0x3')](_0x3ed405);if(_0x2af5a5[_0x9cd5('0x29')]>0x0){return _0x3b316b(_0x7ad8ec['error'](0x1f4,_[_0x9cd5('0x3c')](_0x2af5a5,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x54ffdf=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x28')],{'uniqueid':_0x3ed405[_0x9cd5('0x2b')]});if(_0x54ffdf){return Promise[_0x9cd5('0x3d')]()['then'](function(){if(_0x54ffdf[_0x9cd5('0x2c')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x3e'),'channel':_0x54ffdf[_0x9cd5('0x2c')],'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]})[_0x9cd5('0x1a')](function(){});}})[_0x9cd5('0x32')](function(){if(_0x54ffdf[_0x9cd5('0x3f')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x3e'),'channel':_0x54ffdf[_0x9cd5('0x3f')],'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]})[_0x9cd5('0x1a')](function(){});}})[_0x9cd5('0x32')](function(){var _0x245f9e=_[_0x9cd5('0x25')](_0x54ffdf[_0x9cd5('0x35')],{'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]});if(_0x245f9e){_0x245f9e['status']=_0x9cd5('0x40');}})[_0x9cd5('0x32')](function(){var _0x3fead7=util[_0x9cd5('0x9')]('%s.%s',_0x3ed405[_0x9cd5('0x2e')]||_0x3ed405[_0x9cd5('0x2b')],_0x3ed405['format']||_0x9cd5('0x2f'));var _0x155652=_[_0x9cd5('0x25')](_0x54ffdf[_0x9cd5('0x35')],{'filename':_0x9cd5('0x41')+_0x3fead7[_0x9cd5('0x33')]()});if(_0x155652){_0x155652[_0x9cd5('0x38')]=_0x9cd5('0x40');}})['then'](function(){_0xa12319({'code':0xc8,'message':[_0x3ed405['uniqueid'],_0x9cd5('0x42')][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x22d74c){_0x3b316b(_0x7ad8ec['error'](0x1f5,[_0x3ed405[_0x9cd5('0x2b')],_0x22d74c['message']['toLowerCase']()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x3b316b(_0x7ad8ec[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannels':function(_0x5842cf){var _0x4453ab=this;return new Promise(function(_0x30c80f){var _0x310e4a=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x43')]);var _0x191099={'count':_0x310e4a['length'],'rows':_0x310e4a};if(_0x5842cf&&_0x5842cf['type']){if(![_0x9cd5('0x44'),_0x9cd5('0x45')][_0x9cd5('0x46')](_0x5842cf[_0x9cd5('0x47')])){return _0x2cd19a(_0x4453ab[_0x9cd5('0x1b')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x557076=_['filter'](_0x310e4a,function(_0x4cb835){return _0x4cb835[_0x9cd5('0x47')]===_0x5842cf[_0x9cd5('0x47')];});_0x191099[_0x9cd5('0x48')]=_0x557076[_0x9cd5('0x29')];_0x191099[_0x9cd5('0x49')]=_0x557076;}_0x30c80f(_0x191099);});},'VoiceQueuesChannel':function(_0x3d712f){var _0x27e27c=this;return new Promise(function(_0x32b294,_0x1249a7){var _0x426016=schema(properties[_0x9cd5('0x4a')])[_0x9cd5('0x3')](_0x3d712f);if(_0x426016[_0x9cd5('0x29')]>0x0){return _0x1249a7(_0x27e27c[_0x9cd5('0x1b')](0x1f4,_['map'](_0x426016,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x5cc62f=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x3d712f[_0x9cd5('0x2b')]});if(_0x5cc62f){_0x32b294(_0x5cc62f);}else{return _0x1249a7(_0x27e27c[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x2355e2){var _0x453edb=this;return new Promise(function(_0x54339d,_0x538ffa){if(ami[_0x9cd5('0x11')]()==![]){return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],_0x9cd5('0x1c')][_0x9cd5('0x1d')]('\x20')));}var _0x30ac80=schema(properties[_0x9cd5('0x4b')])[_0x9cd5('0x3')](_0x2355e2);if(_0x30ac80[_0x9cd5('0x29')]>0x0){return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f4,_[_0x9cd5('0x3c')](_0x30ac80,_0x9cd5('0x19'))['join'](',\x20')));}var _0x5de02d=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x2355e2[_0x9cd5('0x2b')]});if(_0x5de02d&&_0x5de02d['channel']){return ami[_0x9cd5('0x18')]({'action':'Hangup','channel':_0x5de02d[_0x9cd5('0x2c')]})[_0x9cd5('0x32')](function(_0x1c58be){_0x54339d({'code':0xc8,'message':[_0x2355e2['uniqueid'],_0x1c58be[_0x9cd5('0x19')][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x42cbc6){_0x538ffa(_0x453edb['error'](0x1f5,[_0x2355e2[_0x9cd5('0x2b')],_0x42cbc6['message'][_0x9cd5('0x33')]()]['join']('\x20')));});}else{return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannelRedirect':function(_0x263dbc){var _0x286ed4=this;return new Promise(function(_0x50c6fb,_0x19ea60){if(ami[_0x9cd5('0x11')]()==![]){return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config['asterisk'][_0x9cd5('0x13')],_0x9cd5('0x1c')]['join']('\x20')));}var _0x2feaf2=schema(properties[_0x9cd5('0x4c')])[_0x9cd5('0x3')](_0x263dbc);if(_0x2feaf2[_0x9cd5('0x29')]>0x0){return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f4,_['map'](_0x2feaf2,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x3c7580=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x263dbc[_0x9cd5('0x2b')]});if(_0x3c7580&&_0x3c7580[_0x9cd5('0x2c')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x4d'),'channel':_0x3c7580['channel'],'exten':_0x263dbc[_0x9cd5('0x4e')],'context':_0x263dbc[_0x9cd5('0x4f')]||_0x3c7580['context'],'priority':0x1})['then'](function(_0xfb7889){_0x50c6fb({'code':0xc8,'message':[_0x263dbc[_0x9cd5('0x2b')],_0xfb7889['message']['toLowerCase']()][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x71471c){_0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f5,[_0x263dbc['uniqueid'],_0x71471c['message'][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'Agents':function(_0x2a6f7f){return new Promise(function(_0xc67fc4){var _0x3a6ce6=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0xf')]);if(_0x2a6f7f&&_0x2a6f7f['id']){var _0x4deea5=_[_0x9cd5('0x25')](_0x3a6ce6,function(_0x4cff45){return _0x4cff45['id']===_0x2a6f7f['id'];});_0xc67fc4(_0x4deea5);}else{_0xc67fc4({'count':_0x3a6ce6[_0x9cd5('0x29')],'rows':_0x3a6ce6});}});},'Telephones':function(){return new Promise(function(_0x16c448){var _0x3dff12=_[_0x9cd5('0x27')](_0x717731['telephones']);_0x16c448({'count':_0x3dff12[_0x9cd5('0x29')],'rows':_0x3dff12});});},'Trunks':function(){return new Promise(function(_0x529cce){var _0x17b0ba=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x50')]);_0x529cce({'count':_0x17b0ba[_0x9cd5('0x29')],'rows':_0x17b0ba});});},'OutboundChannels':function(){return new Promise(function(_0x5ece56){var _0x3c7cc4=_[_0x9cd5('0x27')](_0x717731['outboundChannels']);_0x5ece56({'count':_0x3c7cc4[_0x9cd5('0x29')],'rows':_0x3c7cc4});});},'Outbound':function(){return new Promise(function(_0x59b3bd){_0x59b3bd(_0x717731[_0x9cd5('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x4ae570){var _0x4c4b07=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x51')]);_0x4ae570({'count':_0x4c4b07[_0x9cd5('0x29')],'rows':_0x4c4b07});});},'VoiceQueuesPreview':function(_0x1a9cf3){var _0x2c7758=this;return new Promise(function(_0x35299b,_0x48362b){_0x6acbef[_0x9cd5('0x52')](_0x1a9cf3['id'])[_0x9cd5('0x32')](function(_0x441ceb){_0x35299b({'code':0xc8,'message':_0x441ceb['message']});})['catch'](function(_0x30023c){_0x48362b(_0x2c7758[_0x9cd5('0x1b')](0x1f4,_0x30023c[_0x9cd5('0x19')]));});});},'EventManager':function(_0x323ff3){var _0x806e1c=this;return new Promise(function(_0x42b6d0,_0x179b0c){if(!_0x323ff3[_0x9cd5('0x53')]){return _0x179b0c(_0x806e1c[_0x9cd5('0x1b')](0x1f4,_0x9cd5('0x54')));}ami['emit'](_0x9cd5('0x55')+_0x323ff3['event'],_0x323ff3[_0x9cd5('0x19')]);_0x42b6d0({'code':0xc8,'message':_0x323ff3});});},'FaxAccounts':function(){return new Promise(function(_0x19e545){var _0x3999ce=_['values'](_0x717731[_0x9cd5('0x56')]);_0x19e545({'count':_0x3999ce['length'],'rows':_0x3999ce});});},'SendFax':function(_0x4cb8d4){var _0x23ca99=this;return new Promise(function(_0xad48b,_0x1b38fa){_0x2db192[_0x9cd5('0x57')](_0x4cb8d4)[_0x9cd5('0x32')](function(_0x1c8e81){_0xad48b({'code':0xc8,'message':_0x1c8e81['message']});})[_0x9cd5('0x1a')](function(_0x2bf104){_0x1b38fa(_0x23ca99[_0x9cd5('0x1b')](0x1f4,_0x2bf104[_0x9cd5('0x19')]));});});},'CheckAfterSend':function(_0x48bfca){var _0x439640=this;return new Promise(function(_0x1f5dc4,_0x26aa91){_0x2db192[_0x9cd5('0x58')](_0x48bfca)[_0x9cd5('0x32')](function(_0x5a370c){_0x1f5dc4({'code':0xc8,'message':_0x5a370c[_0x9cd5('0x19')]});})[_0x9cd5('0x1a')](function(_0x23c68b){_0x26aa91(_0x439640[_0x9cd5('0x1b')](0x1f4,_0x23c68b['message']));});});}};var _0x12fb5b=jayson[_0x9cd5('0x59')](_0x214256)[_0x9cd5('0x5a')]();_0x12fb5b['on'](_0x9cd5('0x1b'),function(_0x367c7c){return _0x2cd19a(_0x367c7c);});_0x12fb5b[_0x9cd5('0x8')](0x232a,'127.0.0.1',function(){console[_0x9cd5('0x5b')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x46277c(_0x9cd5('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 cfe709d..88c59dd 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 _0x7de8=['resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','action','toLowerCase','length','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','createdAt','updatedAt'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x7de8,0x8b));var _0x87de=function(_0x2777c2,_0x3318b6){_0x2777c2=_0x2777c2-0x0;var _0x109e48=_0x7de8[_0x2777c2];return _0x109e48;};'use strict';var _=require(_0x87de('0x0'));var BPromise=require(_0x87de('0x1'));var Redis=require(_0x87de('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x87de('0x3'))(_0x87de('0x4'));var cmContactRpc=require(_0x87de('0x5'));config[_0x87de('0x6')]=_[_0x87de('0x7')](config['redis'],{'host':_0x87de('0x8'),'port':0x18eb});var io=require(_0x87de('0x9'))(new Redis(config[_0x87de('0x6')]));function emit(_0x531cc8,_0x552135,_0x364c1e,_0x4bbf6a,_0x3eced5){logger[_0x87de('0xa')](_0x87de('0xb'),_0x531cc8,_0x552135['id'],_0x364c1e,_0x4bbf6a,JSON[_0x87de('0xc')](_0x3eced5));io['to'](_0x364c1e)['emit'](_0x4bbf6a,_0x3eced5);}exports[_0x87de('0xd')]=function(_0x39f124,_0x3115b7,_0x59be7a,_0x1cdb77){var _0x49df2d,_0x5b7b48;var _0x39ae4c={};var _0xc2f0f2;var _0x2b5910=Number(_0x59be7a[_0x87de('0xe')]);var _0x3d703f=_0x59be7a[_0x87de('0xf')]?Boolean(Number(_0x59be7a['data2'])):![];var _0x2bf6b;var _0x5e93ff=![];if(!_[_0x87de('0x10')](_0x59be7a[_0x87de('0x11')])){if(_0x59be7a['data5']=='1')_0x5e93ff=!![];}if(!_0x5e93ff){if(_0x1cdb77[_0x87de('0x12')]){_0x39ae4c['id']=_0x1cdb77['xmd-contactid'];}}if(!_0x39ae4c['id']){_0x39ae4c['ListId']=_0x2b5910;_0x2bf6b=_0x59be7a[_0x87de('0x13')]&&_0x59be7a[_0x87de('0x13')]!=='0'?_0x59be7a[_0x87de('0x13')][_0x87de('0x14')](','):[_0x87de('0x15')];_0x39ae4c[_0x87de('0x16')]=_[_0x87de('0x17')](_0x2bf6b,function(_0x1d1169){var _0x4f1041={};_0x4f1041[_0x1d1169]=_0x1cdb77[_0x87de('0x18')]?_0x1cdb77['destcalleridnum']:_0x1cdb77[_0x87de('0x19')];return _0x4f1041;});_0xc2f0f2=_0x1cdb77[_0x87de('0x18')]?_0x1cdb77[_0x87de('0x1a')]:_0x1cdb77[_0x87de('0x19')];}var _0x29e267=['id',_0x87de('0x1b'),'lastName','phone',_0x87de('0x1c'),_0x87de('0x1d'),'ListId',_0x87de('0x1e'),'scheduledAt',_0x87de('0x1f')];var _0x563161=_['union'](_0x29e267,_0x2bf6b);BPromise[_0x87de('0x20')]()[_0x87de('0x21')](cmContactRpc[_0x87de('0x22')]({'attributes':_0x563161,'where':_0x39ae4c,'phone':_0xc2f0f2}))[_0x87de('0x21')](function(_0x533d22){_0x5b7b48=_0x533d22;if(!_[_0x87de('0x23')](_0x5b7b48)){if(_0x5b7b48['length']===0x1){_0x49df2d=_0x5b7b48[0x0];logger[_0x87de('0xa')](_0x87de('0x24'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id'],_0x49df2d['id']);}else{logger[_0x87de('0xa')](_0x87de('0x26'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id'],_[_0x87de('0x17')](_0x5b7b48,'id')['join'](','));}return;}else{logger['info'](_0x87de('0x27'),_0x1cdb77['uniqueid'],_0x3115b7['id']);var _0x51194c={'ListId':_0x2b5910};var _0x5386e9=_0x59be7a[_0x87de('0x28')]&&_0x59be7a['data4']!=='0'?_0x59be7a['data4']:_0x87de('0x15');if(_0x3d703f){logger[_0x87de('0xa')](_0x87de('0x29'),_0x1cdb77['uniqueid'],_0x3115b7['id']);_0x51194c[_0x5386e9]=_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])?_0x1cdb77[_0x87de('0x19')]:_0x1cdb77[_0x87de('0x1a')];if(_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])){_0x51194c['firstName']=_0x1cdb77['calleridname']&&_0x1cdb77[_0x87de('0x2a')]!==_0x87de('0x2b')?_0x1cdb77[_0x87de('0x2a')]:_0x87de('0x2c');}else{_0x51194c['firstName']=_0x1cdb77[_0x87de('0x2d')]&&_0x1cdb77['destcalleridname']!==''?_0x1cdb77[_0x87de('0x2d')]:_0x87de('0x2c');}return BPromise[_0x87de('0x20')]()['then'](cmContactRpc[_0x87de('0x2e')](_0x51194c))[_0x87de('0x21')](function(_0x2564fc){_0x49df2d=_0x2564fc;_0x5b7b48[_0x87de('0x2f')](_0x2564fc);if(_0x49df2d){logger[_0x87de('0xa')](_0x87de('0x30'),_0x1cdb77['uniqueid'],_0x3115b7['id'],_0x49df2d['id']);}return;});}else{logger[_0x87de('0xa')](_0x87de('0x31'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id']);_0x51194c[_0x5386e9]=_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])?_0x1cdb77[_0x87de('0x19')]:_0x1cdb77[_0x87de('0x1a')];if(_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])){_0x51194c['firstName']=_0x1cdb77[_0x87de('0x2a')]&&_0x1cdb77[_0x87de('0x2a')]!==_0x87de('0x2b')?_0x1cdb77[_0x87de('0x2a')]:_0x87de('0x2c');}else{_0x51194c[_0x87de('0x1b')]=_0x1cdb77['destcalleridname']&&_0x1cdb77[_0x87de('0x2d')]!==_0x87de('0x2b')?_0x1cdb77['destcalleridname']:_0x87de('0x2c');}_0x49df2d=_0x51194c;_0x5b7b48[_0x87de('0x2f')](_0x51194c);return;}}})[_0x87de('0x21')](function(){if(_0x39f124){emit(_0x1cdb77[_0x87de('0x25')],_0x3115b7,util['format'](_0x87de('0x32'),_0x39f124[_0x87de('0x33')]),util[_0x87de('0x34')](_0x87de('0x35'),_0x59be7a[_0x87de('0x36')][_0x87de('0x37')]()),{'evt':_['merge'](_0x1cdb77,{'autoCreate':_0x3d703f}),'contact':_0x49df2d===undefined?{}:_0x49df2d,'contacts':_0x5b7b48[_0x87de('0x38')]===0x0?undefined:_0x5b7b48});}});}; \ No newline at end of file +var _0x85c5=['lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','info','[CM][%s][%s]','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','calleridnum','routeId','firstName','lastName','mobile','fax','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','destcalleridnum','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','merge'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x85c5,0xe0));var _0x585c=function(_0x46cae9,_0x3a726b){_0x46cae9=_0x46cae9-0x0;var _0x1a6d56=_0x85c5[_0x46cae9];return _0x1a6d56;};'use strict';var _=require(_0x585c('0x0'));var BPromise=require(_0x585c('0x1'));var Redis=require(_0x585c('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x585c('0x3'))(_0x585c('0x4'));var cmContactRpc=require(_0x585c('0x5'));config[_0x585c('0x6')]=_[_0x585c('0x7')](config[_0x585c('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x585c('0x6')]));function emit(_0x5d7beb,_0x12228d,_0x4596a4,_0x454152,_0x516bb6){logger[_0x585c('0x8')](_0x585c('0x9'),_0x5d7beb,_0x12228d['id'],_0x4596a4,_0x454152,JSON['stringify'](_0x516bb6));io['to'](_0x4596a4)['emit'](_0x454152,_0x516bb6);}exports[_0x585c('0xa')]=function(_0x607f52,_0x2ed98c,_0x115b32,_0x651f2c){var _0x1ccf35,_0x37b87;var _0x1d0dac={};var _0x215897;var _0x35de03=Number(_0x115b32[_0x585c('0xb')]);var _0x5dd714=_0x115b32[_0x585c('0xc')]?Boolean(Number(_0x115b32['data2'])):![];var _0x257d4f;var _0x3ec7f6=![];if(!_[_0x585c('0xd')](_0x115b32[_0x585c('0xe')])){if(_0x115b32[_0x585c('0xe')]=='1')_0x3ec7f6=!![];}if(!_0x3ec7f6){if(_0x651f2c['xmd-contactid']){_0x1d0dac['id']=_0x651f2c[_0x585c('0xf')];}}if(!_0x1d0dac['id']){_0x1d0dac[_0x585c('0x10')]=_0x35de03;_0x257d4f=_0x115b32['data3']&&_0x115b32[_0x585c('0x11')]!=='0'?_0x115b32[_0x585c('0x11')][_0x585c('0x12')](','):[_0x585c('0x13')];_0x1d0dac[_0x585c('0x14')]=_[_0x585c('0x15')](_0x257d4f,function(_0x4dd1e9){var _0x41c8fc={};_0x41c8fc[_0x4dd1e9]=_0x651f2c['routeId']?_0x651f2c['destcalleridnum']:_0x651f2c[_0x585c('0x16')];return _0x41c8fc;});_0x215897=_0x651f2c[_0x585c('0x17')]?_0x651f2c['destcalleridnum']:_0x651f2c[_0x585c('0x16')];}var _0x3112c2=['id',_0x585c('0x18'),_0x585c('0x19'),_0x585c('0x13'),_0x585c('0x1a'),_0x585c('0x1b'),_0x585c('0x10'),'createdAt',_0x585c('0x1c'),_0x585c('0x1d')];var _0x42b99b=_[_0x585c('0x1e')](_0x3112c2,_0x257d4f);BPromise['resolve']()[_0x585c('0x1f')](cmContactRpc[_0x585c('0x20')]({'attributes':_0x42b99b,'where':_0x1d0dac,'phone':_0x215897}))[_0x585c('0x1f')](function(_0x324eac){_0x37b87=_0x324eac;if(!_[_0x585c('0x21')](_0x37b87)){if(_0x37b87[_0x585c('0x22')]===0x1){_0x1ccf35=_0x37b87[0x0];logger[_0x585c('0x8')](_0x585c('0x23'),_0x651f2c['uniqueid'],_0x2ed98c['id'],_0x1ccf35['id']);}else{logger[_0x585c('0x8')](_0x585c('0x24'),_0x651f2c[_0x585c('0x25')],_0x2ed98c['id'],_[_0x585c('0x15')](_0x37b87,'id')[_0x585c('0x26')](','));}return;}else{logger['info'](_0x585c('0x27'),_0x651f2c[_0x585c('0x25')],_0x2ed98c['id']);var _0x2145ee={'ListId':_0x35de03};var _0x16c5b5=_0x115b32[_0x585c('0x28')]&&_0x115b32['data4']!=='0'?_0x115b32[_0x585c('0x28')]:_0x585c('0x13');if(_0x5dd714){logger[_0x585c('0x8')](_0x585c('0x29'),_0x651f2c[_0x585c('0x25')],_0x2ed98c['id']);_0x2145ee[_0x16c5b5]=_['isNil'](_0x651f2c[_0x585c('0x17')])?_0x651f2c[_0x585c('0x16')]:_0x651f2c[_0x585c('0x2a')];if(_[_0x585c('0xd')](_0x651f2c[_0x585c('0x17')])){_0x2145ee[_0x585c('0x18')]=_0x651f2c['calleridname']&&_0x651f2c[_0x585c('0x2b')]!==_0x585c('0x2c')?_0x651f2c[_0x585c('0x2b')]:_0x585c('0x2d');}else{_0x2145ee[_0x585c('0x18')]=_0x651f2c[_0x585c('0x2e')]&&_0x651f2c[_0x585c('0x2e')]!==_0x585c('0x2c')?_0x651f2c[_0x585c('0x2e')]:_0x585c('0x2d');}return BPromise[_0x585c('0x2f')]()['then'](cmContactRpc[_0x585c('0x30')](_0x2145ee))['then'](function(_0x4a4a37){_0x1ccf35=_0x4a4a37;_0x37b87[_0x585c('0x31')](_0x4a4a37);if(_0x1ccf35){logger[_0x585c('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x651f2c[_0x585c('0x25')],_0x2ed98c['id'],_0x1ccf35['id']);}return;});}else{logger[_0x585c('0x8')](_0x585c('0x32'),_0x651f2c[_0x585c('0x25')],_0x2ed98c['id']);_0x2145ee[_0x16c5b5]=_['isNil'](_0x651f2c['routeId'])?_0x651f2c['calleridnum']:_0x651f2c['destcalleridnum'];if(_[_0x585c('0xd')](_0x651f2c[_0x585c('0x17')])){_0x2145ee['firstName']=_0x651f2c[_0x585c('0x2b')]&&_0x651f2c['calleridname']!==''?_0x651f2c['calleridname']:'Unknown';}else{_0x2145ee[_0x585c('0x18')]=_0x651f2c[_0x585c('0x2e')]&&_0x651f2c[_0x585c('0x2e')]!==_0x585c('0x2c')?_0x651f2c[_0x585c('0x2e')]:_0x585c('0x2d');}_0x1ccf35=_0x2145ee;_0x37b87[_0x585c('0x31')](_0x2145ee);return;}}})['then'](function(){if(_0x607f52){emit(_0x651f2c[_0x585c('0x25')],_0x2ed98c,util[_0x585c('0x33')](_0x585c('0x34'),_0x607f52[_0x585c('0x35')]),util['format']('trigger:%s',_0x115b32[_0x585c('0x36')]['toLowerCase']()),{'evt':_[_0x585c('0x37')](_0x651f2c,{'autoCreate':_0x5dd714}),'contact':_0x1ccf35===undefined?{}:_0x1ccf35,'contacts':_0x37b87['length']===0x0?undefined:_0x37b87});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 07de4d8..5f3acd1 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 _0xb9e0=['null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','checkTrigger','variables','Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','html','template\x20not\x20found','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','render','data3','format','user:%s','name','trigger:%s','merge','exec','integration','queue','routeId','urlforward','script','query','search','replace','channel','AllConditions','length','every','checkConditions','AnyConditions','account','chat','ChatWebsiteId','value','operator','AccountId','interaction','message','event','agent','membername','lastevent'];(function(_0x546c68,_0x5c0116){var _0x4a2389=function(_0x5aa205){while(--_0x5aa205){_0x546c68['push'](_0x546c68['shift']());}};_0x4a2389(++_0x5c0116);}(_0xb9e0,0x18c));var _0x0b9e=function(_0x1def75,_0x28303){_0x1def75=_0x1def75-0x0;var _0xb37bf2=_0xb9e0[_0x1def75];return _0xb37bf2;};'use strict';var util=require(_0x0b9e('0x0'));var _=require(_0x0b9e('0x1'));var url=require(_0x0b9e('0x2'));var Mustache=require(_0x0b9e('0x3'));var Redis=require(_0x0b9e('0x4'));var urlforward=require(_0x0b9e('0x5'));var integration=require(_0x0b9e('0x6'));var cmContact=require(_0x0b9e('0x7'));var script=require(_0x0b9e('0x8'));var config=require(_0x0b9e('0x9'));var logger=require(_0x0b9e('0xa'))(_0x0b9e('0xb'));var ami=require(_0x0b9e('0xc'));config[_0x0b9e('0xd')]=_[_0x0b9e('0xe')](config[_0x0b9e('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x0b9e('0xf'))(new Redis(config[_0x0b9e('0xd')]));var operators={'equals':function(_0x320a80,_0x25eee5){return _0x320a80==_0x25eee5;},'not_equals':function(_0x2aeb35,_0x1c22f5){return _0x2aeb35!=_0x1c22f5;}};var barAndWebActions=['popup','url',_0x0b9e('0x10')];function Trigger(_0x2ff30a){this[_0x0b9e('0x11')]=_0x2ff30a[_0x0b9e('0x11')];this[_0x0b9e('0x12')]=_0x2ff30a[_0x0b9e('0x12')];this[_0x0b9e('0x13')]=_0x2ff30a[_0x0b9e('0x13')];this['templates']=_0x2ff30a[_0x0b9e('0x14')];this['voiceExtensions']=_0x2ff30a[_0x0b9e('0x15')];this[_0x0b9e('0x16')]=_0x2ff30a[_0x0b9e('0x16')];this[_0x0b9e('0x17')]=_0x2ff30a['freshdeskAccounts'];this[_0x0b9e('0x18')]=_0x2ff30a[_0x0b9e('0x18')];this[_0x0b9e('0x19')]=_0x2ff30a[_0x0b9e('0x19')];this[_0x0b9e('0x1a')]=_0x2ff30a[_0x0b9e('0x1a')];this[_0x0b9e('0x1b')]=_0x2ff30a[_0x0b9e('0x1b')];this[_0x0b9e('0x1c')]=_0x2ff30a[_0x0b9e('0x1c')];this[_0x0b9e('0x1d')]=_0x2ff30a['servicenowAccounts'];this['dynamics365Accounts']=_0x2ff30a[_0x0b9e('0x1e')];this[_0x0b9e('0x1f')]=_0x2ff30a[_0x0b9e('0x1f')];this[_0x0b9e('0x20')]={'zendesk':this[_0x0b9e('0x16')],'salesforce':this[_0x0b9e('0x18')],'freshdesk':this[_0x0b9e('0x17')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x0b9e('0x1a')],'desk':this[_0x0b9e('0x1b')],'vtiger':this[_0x0b9e('0x1c')],'dynamics365':this[_0x0b9e('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x0b9e('0x1d')]};ami['on']('custom:agentcalled',this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on']('custom:agentconnect',this[_0x0b9e('0x21')]['bind'](this));ami['on'](_0x0b9e('0x23'),this[_0x0b9e('0x21')]['bind'](this));ami['on'](_0x0b9e('0x24'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x25'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x26'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x27'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x28'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x29'),this['syncCustomEvent'][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x2a'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x2b'),this[_0x0b9e('0x21')]['bind'](this));ami['on'](_0x0b9e('0x2c'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x0b9e('0x22')](this));ami['on']('custom:dialconnect',this[_0x0b9e('0x2d')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x2e'),this['syncAgentDial']['bind'](this));ami['on'](_0x0b9e('0x2f'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x30'),this['syncCustomEvent'][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x31'),this[_0x0b9e('0x21')]['bind'](this));ami['on'](_0x0b9e('0x32'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x33'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x34'),this['syncCustomEvent'][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x35'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));ami['on'](_0x0b9e('0x36'),this[_0x0b9e('0x21')][_0x0b9e('0x22')](this));}Trigger[_0x0b9e('0x37')][_0x0b9e('0x38')]=function(_0x4518e5,_0x2893e5,_0x5aaa44){logger[_0x0b9e('0x39')](_0x4518e5,_0x2893e5,JSON[_0x0b9e('0x3a')](_0x5aaa44));io['to'](_0x4518e5)['emit'](_0x2893e5,_0x5aaa44);};Trigger[_0x0b9e('0x37')][_0x0b9e('0x21')]=function(_0x5ef49e){var _0xaaa321=_[_0x0b9e('0x3b')](_0x5ef49e);if(typeof _0xaaa321[_0x0b9e('0x3c')]===_0x0b9e('0x3d')){_0xaaa321[_0x0b9e('0x3c')]=_0x0b9e('0x3e');}this[_0x0b9e('0x3f')](_0xaaa321);};Trigger[_0x0b9e('0x37')][_0x0b9e('0x2d')]=function(_0x44e1a5){if(this[_0x0b9e('0x12')][_0x44e1a5['interface']]){this[_0x0b9e('0x21')](_0x44e1a5);}};Trigger[_0x0b9e('0x37')][_0x0b9e('0x3f')]=function(_0x4bc248){var _0x2f2e26;for(var _0x13bd82 in this[_0x0b9e('0x11')]){if(this[_0x0b9e('0x11')][_0x0b9e('0x40')](_0x13bd82)){if(this[_0x0b9e('0x11')][_0x13bd82]['status']){_0x2f2e26=this[_0x0b9e('0x41')](this[_0x0b9e('0x11')][_0x13bd82],_0x4bc248);if(_0x2f2e26){_['merge'](_0x4bc248,_0x4bc248[_0x0b9e('0x42')]);for(var _0x556e7f=0x0,_0x15513b,_0x2990b1,_0x5d70f2;_0x556e7f0x0){_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 +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x4dfa26,_0x560170){_0x4dfa26=_0x4dfa26-0x0;var _0x8419ee=_0xe14b[_0x4dfa26];return _0x8419ee;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ 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 c6f01a5..4421b65 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 _0x6c63=['/systemusers(','Bearer\x20','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','idField','indexOf','ticketType','incident','POST','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','outbound','modernAuthentication','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','dynamics365','../../../../config/environment','defaults','redis','localhost','remoteUri','CloudProvider','data7','tenantId','resolve','clientId','username','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','GET','4.0','userEmail','length','internalemailaddress','email','info','toUpperCase','systemuserid','userId','catch','message','destcalleridnum','calleridnum','contacts'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6c63,0x1d9));var _0x36c6=function(_0x4ed79a,_0xb08afc){_0x4ed79a=_0x4ed79a-0x0;var _0x58dbaf=_0x6c63[_0x4ed79a];return _0x58dbaf;};'use strict';var _=require(_0x36c6('0x0'));var rp=require(_0x36c6('0x1'));var util=require('util');var intUtil=require(_0x36c6('0x2'));var md5=require(_0x36c6('0x3'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x36c6('0x4'));var config=require(_0x36c6('0x5'));config['redis']=_[_0x36c6('0x6')](config[_0x36c6('0x7')],{'host':_0x36c6('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36c6('0x7')]));function getAuthToken(_0x3ca818,_0x40c813,_0x13fe22){if(_0x3ca818['modernAuthentication']){_0x3ca818[_0x36c6('0x9')]=_0x3ca818[_0x36c6('0xa')][_0x36c6('0xb')];_0x3ca818[_0x36c6('0xc')]=_0x3ca818[_0x36c6('0xa')]['data2'];return Promise[_0x36c6('0xd')](_0x3ca818[_0x36c6('0xa')]['data5']);}var _0x1bc110={'method':'POST','uri':_0x40c813,'form':{'client_id':_0x3ca818[_0x36c6('0xe')],'resource':_0x3ca818[_0x36c6('0x9')],'username':_0x3ca818[_0x36c6('0xf')],'password':_0x3ca818[_0x36c6('0x10')],'grant_type':_0x36c6('0x10'),'client_secret':_0x3ca818[_0x36c6('0x11')]},'json':!![]};return rp(_0x1bc110)[_0x36c6('0x12')](function(_0xe413d0){return _0xe413d0[_0x36c6('0x13')];})['catch'](function(_0x274ff2){logger[_0x36c6('0x14')]('['+[_0x13fe22['toUpperCase']()]+_0x36c6('0x15'));return _0x274ff2['message'];});}function getUser(_0x3436bd,_0x2881b0,_0x396a6b,_0x24b083,_0x488220,_0x4dc9d2){return new Promise(function(_0x48e818,_0x5b5477){return getAuthToken(_0x2881b0,_0x24b083,_0x4dc9d2)[_0x36c6('0x12')](function(_0x33b870){var _0x1c1e1c={'method':_0x36c6('0x16'),'uri':_0x488220+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x33b870,'OData-Version':_0x36c6('0x17')},'json':!![]};return rp(_0x1c1e1c);})[_0x36c6('0x12')](function(_0x3105eb){var _0x424cdf=_0x3105eb['value'];var _0x1ff7f5=![];var _0x1341c5=null;if(!_['isNil'](_0x396a6b)){if(intUtil['validateEmail'](_0x396a6b['email'])){_0x3436bd[_0x36c6('0x18')]=_0x396a6b['email'];for(_0x1341c5=0x0;_0x1341c5<_0x424cdf[_0x36c6('0x19')];_0x1341c5++){if(_0x424cdf[_0x1341c5][_0x36c6('0x1a')]===_0x396a6b[_0x36c6('0x1b')]&&!_0x424cdf[_0x1341c5]['isdisabled']){_0x1ff7f5=!![];logger[_0x36c6('0x1c')]('['+[_0x4dc9d2[_0x36c6('0x1d')]()]+']\x20Agent\x20found\x20'+_0x424cdf[_0x1341c5][_0x36c6('0x1e')]+'!');_0x3436bd[_0x36c6('0x1f')]=_0x424cdf[_0x1341c5][_0x36c6('0x1e')];}}}}if(!_0x1ff7f5){logger['info']('['+[_0x4dc9d2[_0x36c6('0x1d')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3436bd[_0x36c6('0x18')]=_0x2881b0[_0x36c6('0xf')];for(_0x1341c5=0x0;_0x1341c5<_0x424cdf[_0x36c6('0x19')];_0x1341c5++){if(_0x424cdf[_0x1341c5][_0x36c6('0x1a')]===_0x2881b0[_0x36c6('0xf')]){_0x3436bd[_0x36c6('0x1f')]=_0x424cdf[_0x1341c5][_0x36c6('0x1e')];}}}_0x48e818(_0x3436bd);})[_0x36c6('0x20')](function(_0x24e1d2){_0x5b5477(_0x24e1d2[_0x36c6('0x21')]);});});}function createEndUser(_0x3bc3b7,_0x54961a,_0x13231d,_0x96eea5,_0x53f6d4,_0x29a1b0,_0x30163f){return new Promise(function(_0xcdd971,_0x5aa081){return getAuthToken(_0x54961a,_0x13231d,_0x29a1b0)[_0x36c6('0x12')](function(_0x509974){var _0x392e89=_0x29a1b0['toLowerCase']()==='outbound'?_0x53f6d4[_0x36c6('0x22')]:_0x53f6d4[_0x36c6('0x23')];var _0x1e9d43={'method':'POST','uri':_0x96eea5+_0x36c6('0x24'),'body':{'fullname':_0x392e89,'firstname':_0x392e89,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x36c6('0x25')+_0x3bc3b7[_0x36c6('0x1f')]+')'},'headers':{'Authorization':_0x36c6('0x26')+_0x509974,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};_0x1e9d43[_0x36c6('0x27')][_0x30163f]=_0x392e89;return rp(_0x1e9d43);})[_0x36c6('0x12')](function(_0x1c5a10){var _0x343d69=_0x1c5a10[_0x36c6('0x28')][_0x36c6('0x29')];var _0x1a0464=_0x343d69[_0x36c6('0x2a')](_0x343d69[_0x36c6('0x2b')]('(')+0x1,_0x343d69[_0x36c6('0x2b')](')'));_0x3bc3b7[_0x36c6('0x2c')]=_0x1a0464;_0xcdd971(_0x3bc3b7);})[_0x36c6('0x20')](function(_0x3c7630){_0x5aa081(_0x3c7630[_0x36c6('0x21')]);});});}function getEndUser(_0x37281d,_0x833c58,_0x21d2a2,_0x1e623d,_0x47496c,_0x23ec76,_0x418527,_0x2ced5f){var _0x1c31dd=_0x23ec76['toLowerCase']()==='outbound'?_0x47496c[_0x36c6('0x22')]:_0x47496c[_0x36c6('0x23')];return getAuthToken(_0x833c58,_0x21d2a2,_0x23ec76)[_0x36c6('0x12')](function(_0x9bdc8d){_0x2ced5f=_0x2ced5f?_0x2ced5f:_0x36c6('0x2d');var _0x448af6={'method':_0x36c6('0x16'),'uri':_0x1e623d+_0x36c6('0x2e')+_0x2ced5f+_0x36c6('0x2f')+_0x2ced5f+'\x20eq\x20\x27'+_0x1c31dd[_0x36c6('0x30')]('+',_0x36c6('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x9bdc8d,'If-None-Match':null,'OData-Version':_0x36c6('0x17')},'json':!![]};return rp(_0x448af6);})[_0x36c6('0x12')](function(_0x323a85){var _0x279508=![];if(!_0x323a85)return _0x279508;var _0x16d015=_0x323a85[_0x36c6('0x32')];for(var _0x44327f=0x0;_0x44327f<_0x16d015[_0x36c6('0x19')];_0x44327f++){if(_0x16d015[_0x44327f][_0x2ced5f]===_0x1c31dd){_0x279508=!![];_0x37281d[_0x36c6('0x2c')]=_0x16d015[_0x44327f][_0x36c6('0x33')];}}return _0x279508;})[_0x36c6('0x12')](function(_0x3b2856){if(_0x3b2856)return _0x37281d;if(_0x418527===_0x36c6('0x34')){logger[_0x36c6('0x1c')]('['+[_0x23ec76[_0x36c6('0x1d')]()]+_0x36c6('0x35'));return _0x37281d;}return createEndUser(_0x37281d,_0x833c58,_0x21d2a2,_0x1e623d,_0x47496c,_0x23ec76,_0x2ced5f)[_0x36c6('0x12')](function(_0x35dcb7){logger[_0x36c6('0x1c')]('['+[_0x23ec76[_0x36c6('0x1d')]()]+']\x20Enduser\x20created!',_0x35dcb7[_0x36c6('0x2c')]);return _0x35dcb7;});});}function getCustomFields(_0x52549a,_0x4ef2d2,_0xb1fa4e){var _0x22cd77={};if(_0x52549a[_0x36c6('0x19')]>0x0){_[_0x36c6('0x36')](_0x52549a,function(_0x55b46e){if(_[_0x36c6('0x37')]([_0x36c6('0x38'),_0x36c6('0x39')],_0x55b46e[_0x36c6('0x3a')])&&_0x55b46e[_0x36c6('0x3b')]&&!_0x55b46e['customField']){var _0xfbf3ae=_0x55b46e[_0x36c6('0x3c')]['toLowerCase']();var _0x54e96d=_0xfbf3ae['substring'](0x0,_0xfbf3ae[_0x36c6('0x3d')]('_'));var _0x5628c5=_0xfbf3ae[_0x36c6('0x2a')](_0xfbf3ae[_0x36c6('0x3d')]('_')+0x1);if(_0x54e96d===_0xb1fa4e){_0x22cd77[_0x5628c5]=_0x55b46e['content'];}}});}return _0x22cd77;}function getTicket(_0x60d870,_0x258caa,_0x1e3174,_0x39fecd,_0x2e9f04,_0x2f337d,_0x17bd60){return new Promise(function(_0x46b663,_0x436e81){var _0x500d68;return getAuthToken(_0x258caa,_0x1e3174,_0x17bd60)[_0x36c6('0x12')](function(_0x208f75){if(_0x2f337d[_0x36c6('0x3e')]===_0x36c6('0x3f')){_0x500d68={'method':_0x36c6('0x40'),'uri':_0x39fecd+'incidents','body':Object['assign']({},{'title':intUtil['getString'](_0x2f337d[_0x36c6('0x41')],_0x2e9f04,'\x20'),'description':intUtil[_0x36c6('0x42')](_0x2f337d[_0x36c6('0x43')],_0x2e9f04,'\x0a'),'customerid_contact@odata.bind':_0x60d870[_0x36c6('0x2c')]?_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')':undefined,'ownerid@odata.bind':_0x36c6('0x25')+_0x60d870['userId']+')','caseorigincode':'1'},getCustomFields(_0x2f337d[_0x36c6('0x45')],_0x2e9f04,_0x2f337d[_0x36c6('0x3e')])),'headers':{'Authorization':_0x36c6('0x26')+_0x208f75,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2f337d[_0x36c6('0x3e')]===_0x36c6('0x46')){var _0x3a7ede=_0x60d870['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x60d870[_0x36c6('0x1f')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x36c6('0x25')+_0x60d870[_0x36c6('0x1f')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x2:0x1}];_0x500d68={'method':_0x36c6('0x40'),'uri':_0x39fecd+_0x36c6('0x49'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x2f337d['Subjects'],_0x2e9f04,'\x20'),'phonenumber':String(_0x2e9f04[_0x36c6('0x23')]),'description':intUtil[_0x36c6('0x42')](_0x2f337d[_0x36c6('0x43')],_0x2e9f04,'\x0a'),'regardingobjectid_contact@odata.bind':_0x60d870[_0x36c6('0x2c')]?_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')':undefined,'ownerid@odata.bind':_0x36c6('0x25')+_0x60d870[_0x36c6('0x1f')]+')','directioncode':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?![]:!![],'phonecall_activity_parties':_0x3a7ede},getCustomFields(_0x2f337d['Fields'],_0x2e9f04,_0x2f337d[_0x36c6('0x3e')])),'headers':{'Authorization':_0x36c6('0x26')+_0x208f75,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x500d68);})[_0x36c6('0x12')](function(_0x3d00af){var _0x10dda0=_0x3d00af['headers']['odata-entityid'];var _0xc1d51b=_0x10dda0[_0x36c6('0x2a')](_0x10dda0[_0x36c6('0x2b')]('(')+0x1,_0x10dda0[_0x36c6('0x2b')](')'));_0x60d870['ticketId']=_0xc1d51b;_0x46b663(_0x60d870);})['catch'](function(_0x4dda83){_0x436e81(_0x4dda83[_0x36c6('0x21')]);});});}function emit(_0x2391ee,_0x4b46fa,_0x2ecd7d,_0x4cb6fb){var _0x4a2e71={'uri':util['format'](_0x36c6('0x4a'),_0x2391ee,_0x2ecd7d,_0x4cb6fb)};io['to'](util['format'](_0x36c6('0x4b'),_0x4b46fa))[_0x36c6('0x4c')](_0x36c6('0x4d'),_0x4a2e71);}exports['cs']=function(_0x3a86b9,_0x22ab35,_0x9ed7c8,_0x1dd4b1,_0x412977,_0x525154,_0x3baea7,_0x3df243){var _0x4b591c={};_0x525154[_0x36c6('0x9')]=_0x525154['modernAuthentication']?intUtil[_0x36c6('0x4e')](_0x525154[_0x36c6('0xa')][_0x36c6('0xb')]):intUtil[_0x36c6('0x4e')](_0x525154[_0x36c6('0x9')]);_0x525154['serverUrl']=intUtil[_0x36c6('0x4e')](_0x525154['serverUrl']);_0x4b591c[_0x36c6('0x47')]=_0x3df243===_0x36c6('0x48')||_0x3df243===_0x36c6('0x4f')?_0x36c6('0x48'):_0x36c6('0x50');var _0x3a4165=_0x525154[_0x36c6('0x51')]?util[_0x36c6('0x52')](_0x36c6('0x53'),_0x525154[_0x36c6('0xa')]['data7']):util['format'](_0x36c6('0x53'),_0x525154[_0x36c6('0x9')]);var _0x160ce7=util[_0x36c6('0x52')](_0x36c6('0x54'),_0x525154[_0x36c6('0xc')]);var _0x4a02f8=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x525154['serverUrl'],_0x22ab35['uniqueid'],md5(_0x22ab35[_0x36c6('0x55')]));if(_0x412977&&_0x412977[_0x36c6('0x56')]){logger[_0x36c6('0x1c')](_0x36c6('0x57'),_0x36c6('0x58'));_0x22ab35[_0x36c6('0x59')]=_0x4a02f8;}else if(_0x3baea7&&_0x3baea7['recordingFormat']&&_0x3baea7['recordingFormat']!==_0x36c6('0x5a')){logger[_0x36c6('0x1c')](_0x36c6('0x5b'),_0x36c6('0x58'));_0x22ab35['recordingURL']=_0x4a02f8;}else{_0x22ab35[_0x36c6('0x59')]='';}return getUser(_0x4b591c,_0x525154,_0x1dd4b1,_0x160ce7,_0x3a4165,_0x3df243)[_0x36c6('0x12')](function(_0x2a31d3){logger['info']('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x5c'),_0x2a31d3[_0x36c6('0x1f')]);logger[_0x36c6('0x1c')]('['+_0x3df243['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x2a31d3[_0x36c6('0x18')]);return getEndUser(_0x2a31d3,_0x525154,_0x160ce7,_0x3a4165,_0x22ab35,_0x3df243,_0x9ed7c8[_0x36c6('0x5d')],_0x9ed7c8[_0x36c6('0x5e')]);})[_0x36c6('0x12')](function(_0x9c05b0){logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x5f'),_0x9c05b0[_0x36c6('0x2c')]);logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x22ab35[_0x36c6('0x23')]);return getTicket(_0x9c05b0,_0x525154,_0x160ce7,_0x3a4165,_0x22ab35,_0x9ed7c8,_0x3df243);})[_0x36c6('0x12')](function(_0x382492){logger[_0x36c6('0x1c')](util[_0x36c6('0x52')]('['+_0x3df243['toUpperCase']()+_0x36c6('0x60'),_0x9ed7c8[_0x36c6('0x3e')],_0x382492[_0x36c6('0x61')]));logger[_0x36c6('0x1c')](util['format']('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x62'),_0x3df243));if(_0x3df243!==_0x36c6('0x4f')&&_0x9ed7c8['openNewTab']){logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+']',_0x36c6('0x63'));emit(_0x525154[_0x36c6('0x9')],_0x1dd4b1['name'],_0x9ed7c8[_0x36c6('0x3e')],_0x382492[_0x36c6('0x61')]);}})[_0x36c6('0x20')](function(_0x3ecde3){logger[_0x36c6('0x14')]('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x64'),_0x3ecde3[_0x36c6('0x21')]);console[_0x36c6('0x14')](_0x36c6('0x65'),_0x3ecde3);});}; \ No newline at end of file +var _0x336d=[']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','calleridnum','POST','contacts','/systemusers(','userId','body','headers','odata-entityid','substring','lastIndexOf','enduserId','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','forEach','string','type','customField','indexOf','ticketType','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','monitor_format','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336d,0xd5));var _0xd336=function(_0x3a8c83,_0x6d30){_0x3a8c83=_0x3a8c83-0x0;var _0x3b0288=_0x336d[_0x3a8c83];return _0x3b0288;};'use strict';var _=require(_0xd336('0x0'));var rp=require(_0xd336('0x1'));var util=require(_0xd336('0x2'));var intUtil=require(_0xd336('0x3'));var md5=require(_0xd336('0x4'));var Redis=require(_0xd336('0x5'));var logger=require(_0xd336('0x6'))('dynamics365');var config=require(_0xd336('0x7'));config[_0xd336('0x8')]=_['defaults'](config[_0xd336('0x8')],{'host':_0xd336('0x9'),'port':0x18eb});var io=require(_0xd336('0xa'))(new Redis(config[_0xd336('0x8')]));function getAuthToken(_0x4dca12,_0x42f175,_0x5203e3){if(_0x4dca12['modernAuthentication']){_0x4dca12[_0xd336('0xb')]=_0x4dca12[_0xd336('0xc')][_0xd336('0xd')];_0x4dca12[_0xd336('0xe')]=_0x4dca12['CloudProvider'][_0xd336('0xf')];return Promise[_0xd336('0x10')](_0x4dca12[_0xd336('0xc')][_0xd336('0x11')]);}var _0x3a1cc3={'method':'POST','uri':_0x42f175,'form':{'client_id':_0x4dca12['clientId'],'resource':_0x4dca12[_0xd336('0xb')],'username':_0x4dca12[_0xd336('0x12')],'password':_0x4dca12[_0xd336('0x13')],'grant_type':_0xd336('0x13'),'client_secret':_0x4dca12[_0xd336('0x14')]},'json':!![]};return rp(_0x3a1cc3)[_0xd336('0x15')](function(_0x34b57d){return _0x34b57d[_0xd336('0x16')];})[_0xd336('0x17')](function(_0x314994){logger['error']('['+[_0x5203e3['toUpperCase']()]+_0xd336('0x18'));return _0x314994[_0xd336('0x19')];});}function getUser(_0x50f1f8,_0x4ed72b,_0x3ee726,_0x4b403d,_0x19af2a,_0xec2df8){return new Promise(function(_0xd7702a,_0x486eda){return getAuthToken(_0x4ed72b,_0x4b403d,_0xec2df8)[_0xd336('0x15')](function(_0x5161ff){var _0x421d90={'method':_0xd336('0x1a'),'uri':_0x19af2a+_0xd336('0x1b'),'headers':{'Authorization':_0xd336('0x1c')+_0x5161ff,'OData-Version':_0xd336('0x1d')},'json':!![]};return rp(_0x421d90);})['then'](function(_0x145209){var _0x2693fa=_0x145209[_0xd336('0x1e')];var _0x3e7eef=![];var _0x10e05a=null;if(!_['isNil'](_0x3ee726)){if(intUtil[_0xd336('0x1f')](_0x3ee726['email'])){_0x50f1f8[_0xd336('0x20')]=_0x3ee726[_0xd336('0x21')];for(_0x10e05a=0x0;_0x10e05a<_0x2693fa[_0xd336('0x22')];_0x10e05a++){if(_0x2693fa[_0x10e05a][_0xd336('0x23')]===_0x3ee726[_0xd336('0x21')]&&!_0x2693fa[_0x10e05a][_0xd336('0x24')]){_0x3e7eef=!![];logger[_0xd336('0x25')]('['+[_0xec2df8[_0xd336('0x26')]()]+']\x20Agent\x20found\x20'+_0x2693fa[_0x10e05a][_0xd336('0x27')]+'!');_0x50f1f8['userId']=_0x2693fa[_0x10e05a][_0xd336('0x27')];}}}}if(!_0x3e7eef){logger[_0xd336('0x25')]('['+[_0xec2df8[_0xd336('0x26')]()]+_0xd336('0x28'));_0x50f1f8[_0xd336('0x20')]=_0x4ed72b[_0xd336('0x12')];for(_0x10e05a=0x0;_0x10e05a<_0x2693fa[_0xd336('0x22')];_0x10e05a++){if(_0x2693fa[_0x10e05a][_0xd336('0x23')]===_0x4ed72b[_0xd336('0x12')]){_0x50f1f8['userId']=_0x2693fa[_0x10e05a][_0xd336('0x27')];}}}_0xd7702a(_0x50f1f8);})[_0xd336('0x17')](function(_0x1be863){_0x486eda(_0x1be863[_0xd336('0x19')]);});});}function createEndUser(_0x4638aa,_0x5af26a,_0x3b1fa9,_0x510fd2,_0x2354ec,_0x4ff150,_0x15bb01){return new Promise(function(_0x4960f8,_0x3737ff){return getAuthToken(_0x5af26a,_0x3b1fa9,_0x4ff150)[_0xd336('0x15')](function(_0x39e5d9){var _0x2466f5=_0x4ff150[_0xd336('0x29')]()==='outbound'?_0x2354ec[_0xd336('0x2a')]:_0x2354ec[_0xd336('0x2b')];var _0x26c55a={'method':_0xd336('0x2c'),'uri':_0x510fd2+_0xd336('0x2d'),'body':{'fullname':_0x2466f5,'firstname':_0x2466f5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd336('0x2e')+_0x4638aa[_0xd336('0x2f')]+')'},'headers':{'Authorization':_0xd336('0x1c')+_0x39e5d9,'OData-Version':_0xd336('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x26c55a[_0xd336('0x30')][_0x15bb01]=_0x2466f5;return rp(_0x26c55a);})[_0xd336('0x15')](function(_0x555d60){var _0x2088f4=_0x555d60[_0xd336('0x31')][_0xd336('0x32')];var _0x17690c=_0x2088f4[_0xd336('0x33')](_0x2088f4[_0xd336('0x34')]('(')+0x1,_0x2088f4['lastIndexOf'](')'));_0x4638aa[_0xd336('0x35')]=_0x17690c;_0x4960f8(_0x4638aa);})[_0xd336('0x17')](function(_0x387b2a){_0x3737ff(_0x387b2a['message']);});});}function getEndUser(_0x32f9d6,_0x59c62c,_0x485fa,_0x2d928a,_0x46bb9d,_0x4e2d63,_0x3c88a5,_0x53ce25){var _0x1d2bbd=_0x4e2d63[_0xd336('0x29')]()===_0xd336('0x36')?_0x46bb9d[_0xd336('0x2a')]:_0x46bb9d[_0xd336('0x2b')];return getAuthToken(_0x59c62c,_0x485fa,_0x4e2d63)['then'](function(_0x511b56){_0x53ce25=_0x53ce25?_0x53ce25:_0xd336('0x37');var _0x1c6518={'method':'GET','uri':_0x2d928a+_0xd336('0x38')+_0x53ce25+_0xd336('0x39')+_0x53ce25+_0xd336('0x3a')+_0x1d2bbd[_0xd336('0x3b')]('+',_0xd336('0x3c'))+'\x27','headers':{'Authorization':_0xd336('0x1c')+_0x511b56,'If-None-Match':null,'OData-Version':_0xd336('0x1d')},'json':!![]};return rp(_0x1c6518);})['then'](function(_0x34b117){var _0x512a6e=![];if(!_0x34b117)return _0x512a6e;var _0x5af08d=_0x34b117[_0xd336('0x1e')];for(var _0x37814e=0x0;_0x37814e<_0x5af08d[_0xd336('0x22')];_0x37814e++){if(_0x5af08d[_0x37814e][_0x53ce25]===_0x1d2bbd){_0x512a6e=!![];_0x32f9d6[_0xd336('0x35')]=_0x5af08d[_0x37814e]['contactid'];}}return _0x512a6e;})[_0xd336('0x15')](function(_0x49ca23){if(_0x49ca23)return _0x32f9d6;if(_0x3c88a5==='nothing'){logger['info']('['+[_0x4e2d63['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x32f9d6;}return createEndUser(_0x32f9d6,_0x59c62c,_0x485fa,_0x2d928a,_0x46bb9d,_0x4e2d63,_0x53ce25)[_0xd336('0x15')](function(_0x13df05){logger['info']('['+[_0x4e2d63[_0xd336('0x26')]()]+']\x20Enduser\x20created!',_0x13df05[_0xd336('0x35')]);return _0x13df05;});});}function getCustomFields(_0x11d3ce,_0x4f7b63,_0x29a199){var _0x337fac={};if(_0x11d3ce[_0xd336('0x22')]>0x0){_[_0xd336('0x3d')](_0x11d3ce,function(_0x5d60b9){if(_['includes']([_0xd336('0x3e'),'picklist'],_0x5d60b9[_0xd336('0x3f')])&&_0x5d60b9['nameField']&&!_0x5d60b9[_0xd336('0x40')]){var _0xc27449=_0x5d60b9['idField'][_0xd336('0x29')]();var _0x2711f3=_0xc27449[_0xd336('0x33')](0x0,_0xc27449[_0xd336('0x41')]('_'));var _0x16c155=_0xc27449['substring'](_0xc27449[_0xd336('0x41')]('_')+0x1);if(_0x2711f3===_0x29a199){_0x337fac[_0x16c155]=_0x5d60b9['content'];}}});}return _0x337fac;}function getTicket(_0x254449,_0x2efa04,_0x4cfa46,_0x8fda64,_0x11be85,_0x1bc4f0,_0x544248){return new Promise(function(_0x18cdc6,_0x51330e){var _0x2762df;return getAuthToken(_0x2efa04,_0x4cfa46,_0x544248)[_0xd336('0x15')](function(_0x5b015e){if(_0x1bc4f0[_0xd336('0x42')]==='incident'){_0x2762df={'method':_0xd336('0x2c'),'uri':_0x8fda64+_0xd336('0x43'),'body':Object[_0xd336('0x44')]({},{'title':intUtil[_0xd336('0x45')](_0x1bc4f0['Subjects'],_0x11be85,'\x20'),'description':intUtil[_0xd336('0x45')](_0x1bc4f0[_0xd336('0x46')],_0x11be85,'\x0a'),'customerid_contact@odata.bind':_0x254449['enduserId']?_0xd336('0x47')+_0x254449[_0xd336('0x35')]+')':undefined,'ownerid@odata.bind':_0xd336('0x2e')+_0x254449['userId']+')','caseorigincode':'1'},getCustomFields(_0x1bc4f0[_0xd336('0x48')],_0x11be85,_0x1bc4f0[_0xd336('0x42')])),'headers':{'Authorization':_0xd336('0x1c')+_0x5b015e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1bc4f0['ticketType']===_0xd336('0x49')){var _0x58fc33=_0x254449[_0xd336('0x35')]?[{'partyid_systemuser@odata.bind':_0xd336('0x2e')+_0x254449['userId']+')','participationtypemask':_0x254449[_0xd336('0x4a')]===_0xd336('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0xd336('0x47')+_0x254449['enduserId']+')','participationtypemask':_0x254449[_0xd336('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd336('0x2e')+_0x254449[_0xd336('0x2f')]+')','participationtypemask':_0x254449['callDirection']===_0xd336('0x4b')?0x2:0x1}];_0x2762df={'method':_0xd336('0x2c'),'uri':_0x8fda64+_0xd336('0x4c'),'body':Object[_0xd336('0x44')]({},{'subject':intUtil[_0xd336('0x45')](_0x1bc4f0[_0xd336('0x4d')],_0x11be85,'\x20'),'phonenumber':String(_0x11be85[_0xd336('0x2b')]),'description':intUtil['getString'](_0x1bc4f0[_0xd336('0x46')],_0x11be85,'\x0a'),'regardingobjectid_contact@odata.bind':_0x254449[_0xd336('0x35')]?_0xd336('0x47')+_0x254449['enduserId']+')':undefined,'ownerid@odata.bind':_0xd336('0x2e')+_0x254449['userId']+')','directioncode':_0x254449['callDirection']===_0xd336('0x4b')?![]:!![],'phonecall_activity_parties':_0x58fc33},getCustomFields(_0x1bc4f0['Fields'],_0x11be85,_0x1bc4f0[_0xd336('0x42')])),'headers':{'Authorization':_0xd336('0x1c')+_0x5b015e,'OData-Version':_0xd336('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2762df);})[_0xd336('0x15')](function(_0xea82db){var _0xb4fc92=_0xea82db[_0xd336('0x31')][_0xd336('0x32')];var _0x2e35f9=_0xb4fc92[_0xd336('0x33')](_0xb4fc92['lastIndexOf']('(')+0x1,_0xb4fc92[_0xd336('0x34')](')'));_0x254449['ticketId']=_0x2e35f9;_0x18cdc6(_0x254449);})[_0xd336('0x17')](function(_0xf7aa99){_0x51330e(_0xf7aa99[_0xd336('0x19')]);});});}function emit(_0x1fe6d3,_0x217da2,_0x25f792,_0x4947ca){var _0x1138f8={'uri':util[_0xd336('0x4e')](_0xd336('0x4f'),_0x1fe6d3,_0x25f792,_0x4947ca)};io['to'](util[_0xd336('0x4e')](_0xd336('0x50'),_0x217da2))['emit'](_0xd336('0x51'),_0x1138f8);}exports['cs']=function(_0x4b9a6a,_0x257cf3,_0x294a81,_0x53781,_0x5e9f2e,_0x2ababf,_0x28bb92,_0x35f9ea){var _0x34e278={};_0x2ababf['remoteUri']=_0x2ababf[_0xd336('0x52')]?intUtil[_0xd336('0x53')](_0x2ababf[_0xd336('0xc')][_0xd336('0xd')]):intUtil[_0xd336('0x53')](_0x2ababf[_0xd336('0xb')]);_0x2ababf[_0xd336('0x54')]=intUtil[_0xd336('0x53')](_0x2ababf['serverUrl']);_0x34e278[_0xd336('0x4a')]=_0x35f9ea==='queue'||_0x35f9ea===_0xd336('0x55')?_0xd336('0x4b'):_0xd336('0x36');var _0x3070c1=_0x2ababf[_0xd336('0x52')]?util['format'](_0xd336('0x56'),_0x2ababf[_0xd336('0xc')][_0xd336('0xd')]):util[_0xd336('0x4e')](_0xd336('0x56'),_0x2ababf['remoteUri']);var _0x3fab07=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x2ababf[_0xd336('0xe')]);var _0x1f666e=util[_0xd336('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ababf['serverUrl'],_0x257cf3['uniqueid'],md5(_0x257cf3['uniqueid']));if(_0x5e9f2e&&_0x5e9f2e[_0xd336('0x57')]){logger[_0xd336('0x25')]('[QUEUE]',_0xd336('0x58'));_0x257cf3['recordingURL']=_0x1f666e;}else if(_0x28bb92&&_0x28bb92['recordingFormat']&&_0x28bb92['recordingFormat']!==_0xd336('0x59')){logger[_0xd336('0x25')](_0xd336('0x5a'),'Recording\x20is\x20enabled!');_0x257cf3['recordingURL']=_0x1f666e;}else{_0x257cf3[_0xd336('0x5b')]='';}return getUser(_0x34e278,_0x2ababf,_0x53781,_0x3fab07,_0x3070c1,_0x35f9ea)[_0xd336('0x15')](function(_0xcef631){logger[_0xd336('0x25')]('['+_0x35f9ea[_0xd336('0x26')]()+_0xd336('0x5c'),_0xcef631[_0xd336('0x2f')]);logger[_0xd336('0x25')]('['+_0x35f9ea[_0xd336('0x26')]()+_0xd336('0x5d'),_0xcef631[_0xd336('0x20')]);return getEndUser(_0xcef631,_0x2ababf,_0x3fab07,_0x3070c1,_0x257cf3,_0x35f9ea,_0x294a81[_0xd336('0x5e')],_0x294a81[_0xd336('0x5f')]);})[_0xd336('0x15')](function(_0x49d112){logger['info']('['+_0x35f9ea[_0xd336('0x26')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x49d112[_0xd336('0x35')]);logger[_0xd336('0x25')]('['+_0x35f9ea[_0xd336('0x26')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x257cf3[_0xd336('0x2b')]);return getTicket(_0x49d112,_0x2ababf,_0x3fab07,_0x3070c1,_0x257cf3,_0x294a81,_0x35f9ea);})[_0xd336('0x15')](function(_0x1fe345){logger[_0xd336('0x25')](util[_0xd336('0x4e')]('['+_0x35f9ea[_0xd336('0x26')]()+_0xd336('0x60'),_0x294a81[_0xd336('0x42')],_0x1fe345['ticketId']));logger[_0xd336('0x25')](util[_0xd336('0x4e')]('['+_0x35f9ea['toUpperCase']()+_0xd336('0x61'),_0x35f9ea));if(_0x35f9ea!==_0xd336('0x55')&&_0x294a81[_0xd336('0x62')]){logger[_0xd336('0x25')]('['+_0x35f9ea[_0xd336('0x26')]()+']',_0xd336('0x63'));emit(_0x2ababf[_0xd336('0xb')],_0x53781['name'],_0x294a81[_0xd336('0x42')],_0x1fe345['ticketId']);}})[_0xd336('0x17')](function(_0x24f024){logger[_0xd336('0x64')]('['+_0x35f9ea[_0xd336('0x26')]()+_0xd336('0x65'),_0x24f024[_0xd336('0x19')]);console[_0xd336('0x64')]('Error\x20running\x20Dynamics365\x20integration',_0x24f024);});}; \ 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 483f175..4891e30 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 _0x31bc=['uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','idField','customField','push','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x31bc,0x187));var _0xc31b=function(_0x4aba69,_0x248f0b){_0x4aba69=_0x4aba69-0x0;var _0x57b23b=_0x31bc[_0x4aba69];return _0x57b23b;};'use strict';var _=require(_0xc31b('0x0'));var rp=require(_0xc31b('0x1'));var md5=require(_0xc31b('0x2'));var util=require(_0xc31b('0x3'));var Redis=require(_0xc31b('0x4'));var intUtil=require(_0xc31b('0x5'));var config=require(_0xc31b('0x6'));var logger=require('../../../../config/logger')(_0xc31b('0x7'));config[_0xc31b('0x8')]=_[_0xc31b('0x9')](config['redis'],{'host':_0xc31b('0xa'),'port':0x18eb});var io=require(_0xc31b('0xb'))(new Redis(config[_0xc31b('0x8')]));var headers={'Content-Type':_0xc31b('0xc'),'Accept':_0xc31b('0xc')};function emit(_0x3960b8,_0x29a2f4,_0x2ac311){io['to'](_0x3960b8)['emit'](_0x29a2f4,_0x2ac311);}function getTicket(_0x46b152,_0x10726e,_0xf8034c,_0x39db31,_0x1da45c){logger[_0xc31b('0xd')](_0xc31b('0xe'));var _0x3e21b6=_[_0xc31b('0xf')]({'responder_id':_0x10726e['id'],'requester_id':_0xf8034c['id'],'name':util['format'](_0xc31b('0x10'),_0x1da45c[_0xc31b('0x11')]),'phone':_0x1da45c[_0xc31b('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc31b('0x13')](_0x39db31['Subjects'],_0x1da45c,'\x20'),'description':intUtil['getString'](_0x39db31[_0xc31b('0x14')],_0x1da45c,_0xc31b('0x15')),'tags':getTags(_0x39db31[_0xc31b('0x16')],'name')},getCustomFields(_0x39db31[_0xc31b('0x17')],_0x1da45c));_0x3e21b6[_0xc31b('0x18')]=_[_0xc31b('0x19')](_[_0xc31b('0x1a')](_0x3e21b6['custom_fields'],'id'),'value');return request({'uri':util[_0xc31b('0x1b')](_0xc31b('0x1c'),_0x46b152[_0xc31b('0x1d')]),'method':_0xc31b('0x1e'),'body':_0x3e21b6})[_0xc31b('0x1f')](function(_0x4172b4){logger['info'](_0xc31b('0x20'));return _0x4172b4;});}function getUser(_0x14b775,_0x224289){if(intUtil[_0xc31b('0x21')](_0x224289)){return request({'uri':util[_0xc31b('0x1b')](_0xc31b('0x22'),_0x14b775[_0xc31b('0x1d')]),'qs':{'email':_0x224289}})[_0xc31b('0x1f')](function(_0x49b3a0){if(_0x49b3a0[_0xc31b('0x23')]){logger['info'](_0xc31b('0x24'));return _[_0xc31b('0x25')](_0x49b3a0,function(_0x3ace3d){return _0x3ace3d['contact']['email']===_0x224289;});}else{logger[_0xc31b('0xd')](_0xc31b('0x26'));return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/agents/me',_0x14b775['remoteUri'])})[_0xc31b('0x1f')](function(_0x3a0ea2){logger[_0xc31b('0xd')](_0xc31b('0x27'));return _0x3a0ea2;});}});}else{logger[_0xc31b('0xd')](_0xc31b('0x28'));return request({'uri':util['format'](_0xc31b('0x29'),_0x14b775[_0xc31b('0x1d')])})[_0xc31b('0x1f')](function(_0xb01120){logger[_0xc31b('0xd')](_0xc31b('0x27'));return _0xb01120;});}}function getEndUser(_0x4a0875,_0x13cff7,_0x6f3909){logger[_0xc31b('0xd')](_0xc31b('0x2a'),_0x6f3909);return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/contacts',_0x4a0875[_0xc31b('0x1d')]),'qs':{'phone':_0x6f3909}})['then'](function(_0x4949a0){if(_0x4949a0[_0xc31b('0x23')]){logger[_0xc31b('0xd')](_0xc31b('0x2b'));return _[_0xc31b('0x25')](_0x4949a0,{'phone':_0x6f3909});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/contacts',_0x4a0875['remoteUri']),'method':'POST','body':{'name':_0x13cff7,'phone':_0x6f3909}})[_0xc31b('0x1f')](function(_0xa6da32){logger[_0xc31b('0xd')]('Enduser\x20created.');return _0xa6da32;});}});}function getAuth(_0x544e17){return util['format'](_0xc31b('0x2c'),new Buffer(_0x544e17['apiKey']+':X')[_0xc31b('0x2d')](_0xc31b('0x2e')));}function request(_0x5118d8){logger[_0xc31b('0x2f')](_0xc31b('0x30'),JSON[_0xc31b('0x31')](_0x5118d8));return rp(_['defaults'](_0x5118d8,{'method':_0xc31b('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x1fe5c4,_0x5699ca){var _0x5d953a=[];if(_0x1fe5c4&&_0x1fe5c4[_0xc31b('0x23')]>0x0){_0x5d953a=_[_0xc31b('0x33')](_0x1fe5c4,_0x5699ca);}return _0x5d953a;}function getCustomFields(_0x18a6a3,_0x34fcb6){var _0x217fc1=[];var _0x25cc0c={'custom_fields':[]};if(_0x18a6a3[_0xc31b('0x23')]>0x0){_[_0xc31b('0x34')](_0x18a6a3,function(_0x2cd5bd){if(_[_0xc31b('0x35')]([_0xc31b('0x36'),_0xc31b('0x37')],_0x2cd5bd['type'])&&_0x2cd5bd['nameField']&&!_0x2cd5bd['customField']){_0x25cc0c[_0x2cd5bd[_0xc31b('0x38')][_0xc31b('0x39')]()]=_0x2cd5bd[_0xc31b('0x3a')]['toString']();}else if(_['includes']([_0xc31b('0x36'),_0xc31b('0x37')],_0x2cd5bd[_0xc31b('0x3b')])&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x25cc0c[_0xc31b('0x18')][_0xc31b('0x3e')]({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x2cd5bd['content']['toString']()});}else if(_0x2cd5bd['type']==='variable'&&_0x2cd5bd[_0xc31b('0x3f')]&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x34fcb6[_0x2cd5bd[_0xc31b('0x3f')]]&&_0x25cc0c[_0xc31b('0x18')][_0xc31b('0x3e')]({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x34fcb6[_0x2cd5bd[_0xc31b('0x3f')]][_0xc31b('0x2d')]()});}else if(_0x2cd5bd[_0xc31b('0x3b')]===_0xc31b('0x40')&&_0x2cd5bd[_0xc31b('0x41')]&&_0x2cd5bd[_0xc31b('0x41')][_0xc31b('0x42')]&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x34fcb6[_0x2cd5bd['Variable']['name'][_0xc31b('0x39')]()]&&_0x25cc0c['custom_fields']['push']({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x34fcb6[_0x2cd5bd[_0xc31b('0x41')][_0xc31b('0x42')]['toLowerCase']()][_0xc31b('0x2d')]()});}});}return _0x25cc0c;}exports['queue']=function(_0x9b7e9f,_0x55fcca,_0x39db20,_0x137732,_0x43a199,_0x39e935){var _0x56de85,_0x834af7;_0x39e935[_0xc31b('0x1d')]=intUtil[_0xc31b('0x43')](_0x39e935[_0xc31b('0x1d')]);_0x39e935[_0xc31b('0x44')]=intUtil[_0xc31b('0x43')](_0x39e935[_0xc31b('0x44')]);if(_0x43a199&&_0x43a199[_0xc31b('0x45')]){logger['info'](_0xc31b('0x46'),_0xc31b('0x47'));_0x55fcca[_0xc31b('0x48')]=util['format'](_0xc31b('0x49'),_0x39e935[_0xc31b('0x44')],_0x55fcca['uniqueid'],md5(_0x55fcca[_0xc31b('0x4a')]));}else{_0x55fcca['recordingURL']='';}headers['Authorization']=getAuth(_0x39e935);return getUser(_0x39e935,_0x137732[_0xc31b('0x4b')])[_0xc31b('0x1f')](function(_0x5ed79b){_0x56de85=_0x5ed79b;logger[_0xc31b('0xd')](_0xc31b('0x4c'),_0x56de85['id']);return getEndUser(_0x39e935,_0x55fcca[_0xc31b('0x11')],_0x55fcca[_0xc31b('0x12')]);})['then'](function(_0x484c55){_0x834af7=_0x484c55;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0x834af7['id']);return getTicket(_0x39e935,_0x56de85,_0x834af7,_0x39db20,_0x55fcca);})[_0xc31b('0x1f')](function(_0x43219e){if(_0x43219e&&_0x43219e['id']){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger['info'](_0xc31b('0x4e'),_0x43219e['id']);logger[_0xc31b('0xd')](_0xc31b('0x46'),_0xc31b('0x4f'));emit(util[_0xc31b('0x1b')](_0xc31b('0x50'),_0x137732[_0xc31b('0x42')]),'trigger:browser:url',{'uri':util[_0xc31b('0x1b')](_0xc31b('0x51'),_0x39e935['remoteUri'],_0x43219e['id'])});}})[_0xc31b('0x52')](function(_0x44001b){logger[_0xc31b('0x53')](_0xc31b('0x46'),JSON[_0xc31b('0x31')](_0x44001b));});};exports['outbound']=function(_0x57e815,_0x43d795,_0x3bd751,_0x493b45,_0x42ff03,_0x99f095,_0x502161){var _0x4f83e5,_0x2f1d5e;_0x99f095[_0xc31b('0x1d')]=intUtil['stripTrailingSlash'](_0x99f095[_0xc31b('0x1d')]);_0x99f095[_0xc31b('0x44')]=intUtil[_0xc31b('0x43')](_0x99f095[_0xc31b('0x44')]);if(_0x502161&&_0x502161[_0xc31b('0x54')]&&_0x502161[_0xc31b('0x54')]!=='none'){logger[_0xc31b('0xd')](_0xc31b('0x55'),_0xc31b('0x47'));_0x43d795[_0xc31b('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x99f095[_0xc31b('0x44')],_0x43d795[_0xc31b('0x4a')],md5(_0x43d795['uniqueid']));}headers[_0xc31b('0x56')]=getAuth(_0x99f095);return getUser(_0x99f095,_0x493b45[_0xc31b('0x4b')])[_0xc31b('0x1f')](function(_0x26ca04){_0x4f83e5=_0x26ca04;logger['info'](_0xc31b('0x4c'),_0x4f83e5['id']);return getEndUser(_0x99f095,_0x43d795[_0xc31b('0x57')],_0x43d795[_0xc31b('0x58')]);})[_0xc31b('0x1f')](function(_0x50dcef){_0x2f1d5e=_0x50dcef;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0x2f1d5e['id']);return getTicket(_0x99f095,_0x4f83e5,_0x2f1d5e,_0x3bd751,_0x43d795);})[_0xc31b('0x1f')](function(_0x2fc7d0){if(_0x2fc7d0&&_0x2fc7d0['id']){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger['info'](_0xc31b('0x4e'),_0x2fc7d0['id']);logger['info'](_0xc31b('0x55'),_0xc31b('0x4f'));emit(util[_0xc31b('0x1b')]('user:%s',_0x493b45['name']),_0xc31b('0x59'),{'uri':util[_0xc31b('0x1b')](_0xc31b('0x51'),_0x99f095['remoteUri'],_0x2fc7d0['id'])});}})[_0xc31b('0x52')](function(_0x483338){logger[_0xc31b('0x53')](_0xc31b('0x55'),JSON[_0xc31b('0x31')](_0x483338));});};exports[_0xc31b('0x5a')]=function(_0x6e72e1,_0x10953e,_0x2bbea1,_0x2b0a8d,_0x48aa03,_0x45f4f2){var _0x1a3631,_0xe29b3b;_0x45f4f2['remoteUri']=intUtil['stripTrailingSlash'](_0x45f4f2[_0xc31b('0x1d')]);_0x45f4f2['serverUrl']=intUtil[_0xc31b('0x43')](_0x45f4f2[_0xc31b('0x44')]);if(_0x48aa03&&_0x48aa03[_0xc31b('0x45')]){logger['info']('['+_0x10953e[_0xc31b('0x5b')][_0xc31b('0x5c')]()+']',_0xc31b('0x47'));_0x10953e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45f4f2['serverUrl'],_0x10953e[_0xc31b('0x4a')],md5(_0x10953e[_0xc31b('0x4a')]));}else{_0x10953e[_0xc31b('0x48')]='';}headers[_0xc31b('0x56')]=getAuth(_0x45f4f2);return getUser(_0x45f4f2,'')[_0xc31b('0x1f')](function(_0x379ad2){_0x1a3631=_0x379ad2;logger[_0xc31b('0xd')](_0xc31b('0x4c'),_0x1a3631['id']);return getEndUser(_0x45f4f2,_0x10953e[_0xc31b('0x11')],_0x10953e[_0xc31b('0x12')]);})[_0xc31b('0x1f')](function(_0x5a7590){_0xe29b3b=_0x5a7590;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0xe29b3b['id']);return getTicket(_0x45f4f2,_0x1a3631,_0xe29b3b,_0x2bbea1,_0x10953e);})[_0xc31b('0x1f')](function(_0x525352){if(_0x525352){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger[_0xc31b('0xd')]('The\x20Ticket\x20ID\x20is:',_0x525352['id']);}})['catch'](function(_0x1392b0){logger[_0xc31b('0x53')]('['+_0x10953e['lastevent'][_0xc31b('0x5c')]()+']',JSON['stringify'](_0x1392b0));});}; \ No newline at end of file +var _0xa7d6=['Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','info','validateEmail','%s/api/v2/agents','then','length','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','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','[HTTP]','stringify','GET','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0xa7d6,0xcc));var _0x6a7d=function(_0x2b6082,_0x5a8dde){_0x2b6082=_0x2b6082-0x0;var _0x2a746b=_0xa7d6[_0x2b6082];return _0x2a746b;};'use strict';var _=require(_0x6a7d('0x0'));var rp=require('request-promise');var md5=require(_0x6a7d('0x1'));var util=require(_0x6a7d('0x2'));var Redis=require(_0x6a7d('0x3'));var intUtil=require(_0x6a7d('0x4'));var config=require(_0x6a7d('0x5'));var logger=require(_0x6a7d('0x6'))(_0x6a7d('0x7'));config[_0x6a7d('0x8')]=_[_0x6a7d('0x9')](config[_0x6a7d('0x8')],{'host':_0x6a7d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6a7d('0x8')]));var headers={'Content-Type':_0x6a7d('0xb'),'Accept':_0x6a7d('0xb')};function emit(_0x22790d,_0x3a6735,_0x379640){io['to'](_0x22790d)[_0x6a7d('0xc')](_0x3a6735,_0x379640);}function getTicket(_0x1e31f4,_0x273869,_0x5ae24c,_0x237eb,_0x193b88){logger['info'](_0x6a7d('0xd'));var _0x5e8031=_[_0x6a7d('0xe')]({'responder_id':_0x273869['id'],'requester_id':_0x5ae24c['id'],'name':util[_0x6a7d('0xf')](_0x6a7d('0x10'),_0x193b88['calleridname']),'phone':_0x193b88[_0x6a7d('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x237eb['Subjects'],_0x193b88,'\x20'),'description':intUtil[_0x6a7d('0x12')](_0x237eb[_0x6a7d('0x13')],_0x193b88,'
'),'tags':getTags(_0x237eb['Tags'],_0x6a7d('0x14'))},getCustomFields(_0x237eb[_0x6a7d('0x15')],_0x193b88));_0x5e8031[_0x6a7d('0x16')]=_['mapValues'](_[_0x6a7d('0x17')](_0x5e8031['custom_fields'],'id'),'value');return request({'uri':util[_0x6a7d('0xf')](_0x6a7d('0x18'),_0x1e31f4[_0x6a7d('0x19')]),'method':_0x6a7d('0x1a'),'body':_0x5e8031})['then'](function(_0x373c6e){logger[_0x6a7d('0x1b')]('Ticket\x20created!');return _0x373c6e;});}function getUser(_0x2d94ca,_0x5d41f3){if(intUtil[_0x6a7d('0x1c')](_0x5d41f3)){return request({'uri':util['format'](_0x6a7d('0x1d'),_0x2d94ca['remoteUri']),'qs':{'email':_0x5d41f3}})[_0x6a7d('0x1e')](function(_0x547c26){if(_0x547c26[_0x6a7d('0x1f')]){logger[_0x6a7d('0x1b')](_0x6a7d('0x20'));return _['find'](_0x547c26,function(_0x4696bb){return _0x4696bb[_0x6a7d('0x21')][_0x6a7d('0x22')]===_0x5d41f3;});}else{logger[_0x6a7d('0x1b')](_0x6a7d('0x23'));return request({'uri':util[_0x6a7d('0xf')](_0x6a7d('0x24'),_0x2d94ca['remoteUri'])})[_0x6a7d('0x1e')](function(_0x4de30d){logger[_0x6a7d('0x1b')](_0x6a7d('0x25'));return _0x4de30d;});}});}else{logger[_0x6a7d('0x1b')](_0x6a7d('0x26'));return request({'uri':util[_0x6a7d('0xf')](_0x6a7d('0x24'),_0x2d94ca[_0x6a7d('0x19')])})[_0x6a7d('0x1e')](function(_0xacf0d6){logger[_0x6a7d('0x1b')](_0x6a7d('0x25'));return _0xacf0d6;});}}function getEndUser(_0x22d5fc,_0x2f0ae6,_0x3dc8aa){logger['info'](_0x6a7d('0x27'),_0x3dc8aa);return request({'uri':util[_0x6a7d('0xf')]('%s/api/v2/contacts',_0x22d5fc[_0x6a7d('0x19')]),'qs':{'phone':_0x3dc8aa}})[_0x6a7d('0x1e')](function(_0x394e59){if(_0x394e59['length']){logger[_0x6a7d('0x1b')](_0x6a7d('0x28'));return _['find'](_0x394e59,{'phone':_0x3dc8aa});}else{logger[_0x6a7d('0x1b')](_0x6a7d('0x29'));return request({'uri':util[_0x6a7d('0xf')](_0x6a7d('0x2a'),_0x22d5fc['remoteUri']),'method':'POST','body':{'name':_0x2f0ae6,'phone':_0x3dc8aa}})['then'](function(_0x51217d){logger['info'](_0x6a7d('0x2b'));return _0x51217d;});}});}function getAuth(_0x3794c1){return util['format']('Basic\x20%s',new Buffer(_0x3794c1[_0x6a7d('0x2c')]+':X')[_0x6a7d('0x2d')]('base64'));}function request(_0x5786db){logger['debug'](_0x6a7d('0x2e'),JSON[_0x6a7d('0x2f')](_0x5786db));return rp(_[_0x6a7d('0x9')](_0x5786db,{'method':_0x6a7d('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x59fec7,_0x21e2f3){var _0x1ab0e1=[];if(_0x59fec7&&_0x59fec7['length']>0x0){_0x1ab0e1=_['map'](_0x59fec7,_0x21e2f3);}return _0x1ab0e1;}function getCustomFields(_0x2fad8a,_0x1a9800){var _0x3f0abb=[];var _0x292b35={'custom_fields':[]};if(_0x2fad8a['length']>0x0){_[_0x6a7d('0x31')](_0x2fad8a,function(_0x190331){if(_[_0x6a7d('0x32')](['string',_0x6a7d('0x33')],_0x190331[_0x6a7d('0x34')])&&_0x190331[_0x6a7d('0x35')]&&!_0x190331['customField']){_0x292b35[_0x190331[_0x6a7d('0x35')][_0x6a7d('0x36')]()]=_0x190331[_0x6a7d('0x37')]['toString']();}else if(_['includes']([_0x6a7d('0x38'),_0x6a7d('0x33')],_0x190331[_0x6a7d('0x34')])&&_0x190331[_0x6a7d('0x39')]&&_0x190331[_0x6a7d('0x3a')]){_0x292b35[_0x6a7d('0x16')][_0x6a7d('0x3b')]({'id':_0x190331[_0x6a7d('0x39')],'value':_0x190331[_0x6a7d('0x37')]['toString']()});}else if(_0x190331[_0x6a7d('0x34')]===_0x6a7d('0x3c')&&_0x190331['variableName']&&_0x190331['idField']&&_0x190331['customField']){_0x1a9800[_0x190331[_0x6a7d('0x3d')]]&&_0x292b35[_0x6a7d('0x16')][_0x6a7d('0x3b')]({'id':_0x190331[_0x6a7d('0x39')],'value':_0x1a9800[_0x190331[_0x6a7d('0x3d')]][_0x6a7d('0x2d')]()});}else if(_0x190331['type']===_0x6a7d('0x3e')&&_0x190331[_0x6a7d('0x3f')]&&_0x190331['Variable'][_0x6a7d('0x14')]&&_0x190331[_0x6a7d('0x39')]&&_0x190331['customField']){_0x1a9800[_0x190331[_0x6a7d('0x3f')][_0x6a7d('0x14')]['toLowerCase']()]&&_0x292b35['custom_fields'][_0x6a7d('0x3b')]({'id':_0x190331['idField'],'value':_0x1a9800[_0x190331[_0x6a7d('0x3f')]['name'][_0x6a7d('0x36')]()][_0x6a7d('0x2d')]()});}});}return _0x292b35;}exports[_0x6a7d('0x40')]=function(_0x2ed614,_0x18f619,_0x1bb2c8,_0x553147,_0x3351ba,_0x3028bd){var _0x4dac20,_0x3879e0;_0x3028bd[_0x6a7d('0x19')]=intUtil[_0x6a7d('0x41')](_0x3028bd[_0x6a7d('0x19')]);_0x3028bd[_0x6a7d('0x42')]=intUtil[_0x6a7d('0x41')](_0x3028bd[_0x6a7d('0x42')]);if(_0x3351ba&&_0x3351ba[_0x6a7d('0x43')]){logger[_0x6a7d('0x1b')](_0x6a7d('0x44'),_0x6a7d('0x45'));_0x18f619[_0x6a7d('0x46')]=util[_0x6a7d('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3028bd[_0x6a7d('0x42')],_0x18f619[_0x6a7d('0x47')],md5(_0x18f619[_0x6a7d('0x47')]));}else{_0x18f619[_0x6a7d('0x46')]='';}headers[_0x6a7d('0x48')]=getAuth(_0x3028bd);return getUser(_0x3028bd,_0x553147[_0x6a7d('0x22')])['then'](function(_0x42ff23){_0x4dac20=_0x42ff23;logger[_0x6a7d('0x1b')](_0x6a7d('0x49'),_0x4dac20['id']);return getEndUser(_0x3028bd,_0x18f619[_0x6a7d('0x4a')],_0x18f619[_0x6a7d('0x11')]);})[_0x6a7d('0x1e')](function(_0x3dd3c4){_0x3879e0=_0x3dd3c4;logger[_0x6a7d('0x1b')](_0x6a7d('0x4b'),_0x3879e0['id']);return getTicket(_0x3028bd,_0x4dac20,_0x3879e0,_0x1bb2c8,_0x18f619);})[_0x6a7d('0x1e')](function(_0x466eb9){if(_0x466eb9&&_0x466eb9['id']){logger[_0x6a7d('0x1b')]('Ticket\x20created!');logger[_0x6a7d('0x1b')](_0x6a7d('0x4c'),_0x466eb9['id']);logger[_0x6a7d('0x1b')](_0x6a7d('0x44'),_0x6a7d('0x4d'));emit(util['format'](_0x6a7d('0x4e'),_0x553147['name']),_0x6a7d('0x4f'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x3028bd[_0x6a7d('0x19')],_0x466eb9['id'])});}})[_0x6a7d('0x50')](function(_0x39f013){logger[_0x6a7d('0x51')](_0x6a7d('0x44'),JSON[_0x6a7d('0x2f')](_0x39f013));});};exports[_0x6a7d('0x52')]=function(_0x2bc44e,_0x26e593,_0x5cba71,_0x13a216,_0x126323,_0x2b2e8a,_0x1eb488){var _0x9e80e9,_0x268b64;_0x2b2e8a['remoteUri']=intUtil[_0x6a7d('0x41')](_0x2b2e8a[_0x6a7d('0x19')]);_0x2b2e8a['serverUrl']=intUtil[_0x6a7d('0x41')](_0x2b2e8a[_0x6a7d('0x42')]);if(_0x1eb488&&_0x1eb488[_0x6a7d('0x53')]&&_0x1eb488[_0x6a7d('0x53')]!==_0x6a7d('0x54')){logger['info'](_0x6a7d('0x55'),_0x6a7d('0x45'));_0x26e593['recordingURL']=util[_0x6a7d('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b2e8a[_0x6a7d('0x42')],_0x26e593[_0x6a7d('0x47')],md5(_0x26e593[_0x6a7d('0x47')]));}headers[_0x6a7d('0x48')]=getAuth(_0x2b2e8a);return getUser(_0x2b2e8a,_0x13a216[_0x6a7d('0x22')])[_0x6a7d('0x1e')](function(_0x350946){_0x9e80e9=_0x350946;logger[_0x6a7d('0x1b')](_0x6a7d('0x49'),_0x9e80e9['id']);return getEndUser(_0x2b2e8a,_0x26e593[_0x6a7d('0x56')],_0x26e593[_0x6a7d('0x57')]);})[_0x6a7d('0x1e')](function(_0x5f546c){_0x268b64=_0x5f546c;logger[_0x6a7d('0x1b')](_0x6a7d('0x4b'),_0x268b64['id']);return getTicket(_0x2b2e8a,_0x9e80e9,_0x268b64,_0x5cba71,_0x26e593);})['then'](function(_0x2f3e5d){if(_0x2f3e5d&&_0x2f3e5d['id']){logger[_0x6a7d('0x1b')]('Ticket\x20created!');logger[_0x6a7d('0x1b')](_0x6a7d('0x4c'),_0x2f3e5d['id']);logger['info'](_0x6a7d('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6a7d('0xf')](_0x6a7d('0x4e'),_0x13a216[_0x6a7d('0x14')]),_0x6a7d('0x4f'),{'uri':util[_0x6a7d('0xf')](_0x6a7d('0x58'),_0x2b2e8a[_0x6a7d('0x19')],_0x2f3e5d['id'])});}})[_0x6a7d('0x50')](function(_0x40452e){logger[_0x6a7d('0x51')]('[OUTBOUND]',JSON[_0x6a7d('0x2f')](_0x40452e));});};exports['unmanaged']=function(_0x19a511,_0x5aa538,_0x19d81c,_0x419be6,_0x445ae8,_0x37652b){var _0x572549,_0x40360f;_0x37652b[_0x6a7d('0x19')]=intUtil[_0x6a7d('0x41')](_0x37652b['remoteUri']);_0x37652b[_0x6a7d('0x42')]=intUtil['stripTrailingSlash'](_0x37652b['serverUrl']);if(_0x445ae8&&_0x445ae8[_0x6a7d('0x43')]){logger['info']('['+_0x5aa538[_0x6a7d('0x59')][_0x6a7d('0x5a')]()+']',_0x6a7d('0x45'));_0x5aa538[_0x6a7d('0x46')]=util['format'](_0x6a7d('0x5b'),_0x37652b[_0x6a7d('0x42')],_0x5aa538[_0x6a7d('0x47')],md5(_0x5aa538['uniqueid']));}else{_0x5aa538[_0x6a7d('0x46')]='';}headers[_0x6a7d('0x48')]=getAuth(_0x37652b);return getUser(_0x37652b,'')[_0x6a7d('0x1e')](function(_0x55cf82){_0x572549=_0x55cf82;logger['info'](_0x6a7d('0x49'),_0x572549['id']);return getEndUser(_0x37652b,_0x5aa538[_0x6a7d('0x4a')],_0x5aa538['calleridnum']);})[_0x6a7d('0x1e')](function(_0x67897a){_0x40360f=_0x67897a;logger[_0x6a7d('0x1b')](_0x6a7d('0x4b'),_0x40360f['id']);return getTicket(_0x37652b,_0x572549,_0x40360f,_0x19d81c,_0x5aa538);})[_0x6a7d('0x1e')](function(_0x5f3d8a){if(_0x5f3d8a){logger[_0x6a7d('0x1b')]('Ticket\x20created!');logger[_0x6a7d('0x1b')](_0x6a7d('0x4c'),_0x5f3d8a['id']);}})[_0x6a7d('0x50')](function(_0x1d75ee){logger[_0x6a7d('0x51')]('['+_0x5aa538[_0x6a7d('0x59')][_0x6a7d('0x5a')]()+']',JSON['stringify'](_0x1d75ee));});}; \ 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 a6c0f76..1392264 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 _0x90d7=['error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','headers','info','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x90d7,0xe1));var _0x790d=function(_0xe2988d,_0x4ef963){_0xe2988d=_0xe2988d-0x0;var _0x47b583=_0x90d7[_0xe2988d];return _0x47b583;};'use strict';var _=require(_0x790d('0x0'));var rp=require(_0x790d('0x1'));var md5=require(_0x790d('0x2'));var util=require(_0x790d('0x3'));var moment=require(_0x790d('0x4'));var Promise=require(_0x790d('0x5'));var Redis=require(_0x790d('0x6'));var intUtil=require(_0x790d('0x7'));var config=require(_0x790d('0x8'));var logger=require(_0x790d('0x9'))(_0x790d('0xa'));config[_0x790d('0xb')]=_[_0x790d('0xc')](config[_0x790d('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x790d('0xd'))(new Redis(config[_0x790d('0xb')]));function getAdminId(_0x49f971,_0x30799c,_0x4b1473,_0x211df6){return new Promise(function(_0x1282fb,_0x2e9edd){var _0x3259e7=![];var _0x591bd3={'method':_0x790d('0xe'),'uri':_0x211df6+'/api/selector/owners','json':!![]};_0x591bd3[_0x790d('0xf')]=_0x4b1473;logger[_0x790d('0x10')]('Getting\x20admin\x20information');return rp(_0x591bd3)['then'](function(_0x4cf949){if(_0x4cf949){var _0x82c640=_0x4cf949[_0x790d('0x11')];var _0x140c99=null;for(_0x140c99=0x0;_0x140c99<_0x82c640[_0x790d('0x12')];_0x140c99++){if(_0x82c640[_0x140c99][_0x790d('0x13')]===_0x49f971[_0x790d('0x14')]){_0x49f971['adminId']=_0x82c640[_0x140c99]['id'];_0x3259e7=!![];}}if(_0x3259e7){logger['info'](_0x790d('0x15'),_0x49f971[_0x790d('0x16')]);_0x1282fb(_0x49f971);}else{_0x2e9edd({'statusCode':0x194,'message':_0x790d('0x17')});}}else{_0x2e9edd({'statusCode':0x194,'message':_0x790d('0x17')});}})[_0x790d('0x18')](function(_0x5f32fd){logger['error']('['+[_0x30799c[_0x790d('0x19')]()]+']',_0x5f32fd[_0x790d('0x1a')]);_0x2e9edd(_0x5f32fd);});});}function getUser(_0x412c22,_0x30c167,_0x7ea7be){return function(_0x2a88f2){return new Promise(function(_0x23aecc,_0x24da35){var _0x10f5d5={'method':_0x790d('0xe'),'uri':_0x7ea7be+_0x790d('0x1b'),'json':!![]};_0x10f5d5['headers']=_0x30c167;logger[_0x790d('0x10')](_0x790d('0x1c'));return rp(_0x10f5d5)[_0x790d('0x1d')](function(_0x524fa2){if(_0x524fa2){var _0x220ff6=_0x524fa2[_0x790d('0x11')];var _0x5257f8=![];var _0x28df28=null;if(_0x2a88f2[_0x790d('0x1e')]!==null){logger[_0x790d('0x10')](_0x790d('0x1f'),_0x2a88f2[_0x790d('0x1e')]);_0x2a88f2[_0x790d('0x20')]=_0x2a88f2[_0x790d('0x1e')];for(_0x28df28=0x0;_0x28df28<_0x220ff6[_0x790d('0x12')];_0x28df28++){if(_0x220ff6[_0x28df28]['email']===_0x2a88f2[_0x790d('0x1e')]){_0x5257f8=!![];_0x2a88f2['userId']=_0x220ff6[_0x28df28]['id'];logger[_0x790d('0x10')](_0x790d('0x21'),_0x2a88f2[_0x790d('0x22')]);}}}if(!_0x5257f8){logger['info'](_0x790d('0x23'));_0x2a88f2[_0x790d('0x20')]=_0x2a88f2[_0x790d('0x14')];_0x2a88f2[_0x790d('0x22')]=_0x2a88f2[_0x790d('0x16')];_0x5257f8=!![];}if(_0x5257f8){_0x23aecc(_0x2a88f2);}else{_0x24da35({'statusCode':0x194,'message':_0x790d('0x17')});}}else{_0x24da35({'statusCode':0x194,'message':_0x790d('0x17')});}})[_0x790d('0x18')](function(_0x2d9a58){logger[_0x790d('0x24')]('['+[_0x412c22['toUpperCase']()]+']',_0x2d9a58['message']);_0x24da35(_0x2d9a58);});});};}function searchContact(_0x3bffc0,_0x38f7f5,_0x536a80,_0xdc02f4){return new Promise(function(_0x5839d5,_0x7d28bf){var _0x124779={'method':_0x790d('0xe'),'headers':_0x38f7f5,'uri':_0x3bffc0+_0x790d('0x25')+_0xdc02f4+_0x790d('0x26')+_0x536a80+_0x790d('0x27'),'json':!![]};rp(_0x124779)[_0x790d('0x1d')](function(_0x3a5827){var _0x429a65=_[_0x790d('0x28')](_0x3a5827['contacts'][_0x790d('0x29')],[_0x536a80,_0xdc02f4]);_0x5839d5(_0x429a65);})[_0x790d('0x18')](function(_0x3cf06b){_0x7d28bf(_0x3cf06b);});});}function getEndUser(_0x34df24,_0x23ca99,_0xad6a9c){return function(_0x78ca09){return new Promise(function(_0x4c10af,_0x189d86){logger[_0x790d('0x10')](util[_0x790d('0x2a')](_0x790d('0x2b'),_0x78ca09[_0x790d('0x2c')]));searchContact(_0xad6a9c,_0x23ca99,'mobile_number',_0x78ca09[_0x790d('0x2c')])['then'](function(_0x87cbe0){if(_0x87cbe0){_0x78ca09['endUserId']=_0x87cbe0['id'];logger['info'](_0x790d('0x2d'),_0x78ca09[_0x790d('0x2e')]);return _0x4c10af(_0x78ca09);}searchContact(_0xad6a9c,_0x23ca99,'work_number',_0x78ca09[_0x790d('0x2c')])['then'](function(_0x4ee3e1){if(_0x4ee3e1){_0x78ca09[_0x790d('0x2e')]=_0x4ee3e1['id'];logger['info'](_0x790d('0x2f'),_0x78ca09[_0x790d('0x2e')]);return _0x4c10af(_0x78ca09);}createEndUser(_0x78ca09,_0x34df24,_0x23ca99,_0xad6a9c)['then'](function(_0x321d5c){logger[_0x790d('0x10')]('Contact\x20created:',_0x321d5c[_0x790d('0x2e')]);return _0x4c10af(_0x321d5c);});});})[_0x790d('0x18')](function(_0x32a0e5){_0x189d86(_0x32a0e5);});});};}function createEndUser(_0x12df22,_0x3183fc,_0x36976c,_0x3edca4){return new Promise(function(_0x351e19,_0x4a4550){var _0x2e0946=moment();var _0x938238={'method':'POST','uri':_0x3edca4+_0x790d('0x30'),'body':{'contact':{'last_name':_0x12df22[_0x790d('0x2c')],'work_number':_0x12df22[_0x790d('0x2c')],'mobile_number':_0x12df22[_0x790d('0x2c')],'owner_id':_0x12df22[_0x790d('0x22')],'created_at':_0x2e0946['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x938238[_0x790d('0xf')]=_0x36976c;logger[_0x790d('0x10')](_0x790d('0x31'));return rp(_0x938238)['then'](function(_0x20bf7b){_0x12df22[_0x790d('0x2e')]=_0x20bf7b['contact']['id'];_0x351e19(_0x12df22);})[_0x790d('0x18')](function(_0x239366){logger[_0x790d('0x24')]('['+[_0x3183fc[_0x790d('0x19')]()]+']',_0x239366[_0x790d('0x1a')]);_0x4a4550(_0x239366[_0x790d('0x1a')]);});});}function getTicket(_0x56232f,_0x520443,_0x311f88,_0x46071b,_0x1df842){return function(_0x971408){logger[_0x790d('0x10')](_0x790d('0x32'));return new Promise(function(_0x10f753,_0x340da0){var _0x374544=moment();var _0x491994={'method':_0x790d('0x33'),'uri':_0x311f88+_0x790d('0x34'),'body':{'title':intUtil[_0x790d('0x35')](_0x46071b[_0x790d('0x36')],_0x1df842,'\x20'),'description':intUtil[_0x790d('0x35')](_0x46071b[_0x790d('0x37')],_0x1df842,'\x0a'),'owner_id':_0x971408['userId'],'creater_id':_0x971408[_0x790d('0x16')],'targetable_id':_0x971408['endUserId'],'targetable_type':_0x790d('0x38'),'created_at':_0x374544['format'](_0x790d('0x39')),'due_date':_0x374544[_0x790d('0x3a')](0x1e,'m')[_0x790d('0x2a')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x491994[_0x790d('0xf')]=_0x520443;return rp(_0x491994)[_0x790d('0x1d')](function(_0x19767a){_0x971408[_0x790d('0x3b')]=_0x19767a[_0x790d('0x3c')]['id'];logger[_0x790d('0x10')](_0x790d('0x3d'),_0x971408['ticketId']);_0x10f753(_0x971408);})[_0x790d('0x18')](function(_0x1742b2){logger[_0x790d('0x24')]('['+[_0x56232f[_0x790d('0x19')]()]+']',_0x1742b2[_0x790d('0x1a')]);_0x340da0(_0x1742b2[_0x790d('0x1a')]);});});};}function emit(_0x5e000f,_0x59895b,_0x325c7a){var _0x4da748={'uri':_0x5e000f+_0x790d('0x3e')+_0x325c7a};io['to'](util[_0x790d('0x2a')](_0x790d('0x3f'),_0x59895b))[_0x790d('0x40')]('trigger:browser:url',_0x4da748);}exports['cs']=function(_0x4088d9,_0x3a6b1b,_0x49d6ba,_0x40cd81,_0x19f6d9,_0x1961fc,_0xf05cfe,_0x34daca){var _0x3b17f1={};var _0x94608={'Authorization':_0x790d('0x41')+_0x1961fc[_0x790d('0x42')]};_0x1961fc[_0x790d('0x43')]=intUtil[_0x790d('0x44')](_0x1961fc[_0x790d('0x43')]);_0x1961fc['serverUrl']=intUtil[_0x790d('0x44')](_0x1961fc[_0x790d('0x45')]);var _0x130e2e=_0x1961fc[_0x790d('0x43')];_0x3b17f1[_0x790d('0x14')]=_0x1961fc[_0x790d('0x46')];_0x3b17f1[_0x790d('0x2c')]=_0x34daca[_0x790d('0x47')]()===_0x790d('0x48')?_0x3a6b1b[_0x790d('0x49')]:_0x3a6b1b[_0x790d('0x4a')];_0x3b17f1[_0x790d('0x4b')]=_0x34daca===_0x790d('0x4c')||_0x34daca===_0x790d('0x4d')?_0x790d('0x4c'):_0x790d('0x48');if(_0x40cd81){_0x3b17f1[_0x790d('0x1e')]=_0x40cd81[_0x790d('0x13')];}var _0x51f8fe=util['format'](_0x790d('0x4e'),_0x1961fc[_0x790d('0x45')],_0x3a6b1b[_0x790d('0x4f')],md5(_0x3a6b1b['uniqueid']));if(_0x19f6d9&&_0x19f6d9['monitor_format']){logger[_0x790d('0x10')]('[QUEUE]',_0x790d('0x50'));_0x3a6b1b[_0x790d('0x51')]=_0x51f8fe;}else if(_0xf05cfe&&_0xf05cfe[_0x790d('0x52')]&&_0xf05cfe[_0x790d('0x52')]!=='none'){logger[_0x790d('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3a6b1b['recordingURL']=_0x51f8fe;}else{_0x3a6b1b[_0x790d('0x51')]='';}return getAdminId(_0x3b17f1,_0x34daca,_0x94608,_0x130e2e)[_0x790d('0x1d')](getUser(_0x34daca,_0x94608,_0x130e2e))[_0x790d('0x1d')](getEndUser(_0x34daca,_0x94608,_0x130e2e))[_0x790d('0x1d')](getTicket(_0x34daca,_0x94608,_0x130e2e,_0x49d6ba,_0x3a6b1b))[_0x790d('0x1d')](function(_0x33c55b){logger[_0x790d('0x10')](util[_0x790d('0x2a')](_0x790d('0x53'),_0x33c55b[_0x790d('0x3b')]));if(_0x34daca!==_0x790d('0x4d')){logger[_0x790d('0x10')]('['+[_0x34daca[_0x790d('0x19')]()]+']',_0x790d('0x54'));emit(_0x130e2e,_0x40cd81[_0x790d('0x55')],_0x33c55b[_0x790d('0x2e')]);}})[_0x790d('0x18')](function(_0x563209){logger[_0x790d('0x24')]('['+[_0x34daca[_0x790d('0x19')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x790d('0x56')](_0x563209,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5e56=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','length','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','message','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0xab7152,_0x528b66){var _0x2fdaff=function(_0x493479){while(--_0x493479){_0xab7152['push'](_0xab7152['shift']());}};_0x2fdaff(++_0x528b66);}(_0x5e56,0x65));var _0x65e5=function(_0x4c4f88,_0x713c4a){_0x4c4f88=_0x4c4f88-0x0;var _0x17dc56=_0x5e56[_0x4c4f88];return _0x17dc56;};'use strict';var _=require(_0x65e5('0x0'));var rp=require(_0x65e5('0x1'));var md5=require(_0x65e5('0x2'));var util=require(_0x65e5('0x3'));var moment=require(_0x65e5('0x4'));var Promise=require(_0x65e5('0x5'));var Redis=require(_0x65e5('0x6'));var intUtil=require('./util');var config=require(_0x65e5('0x7'));var logger=require(_0x65e5('0x8'))('freshsales');config[_0x65e5('0x9')]=_[_0x65e5('0xa')](config['redis'],{'host':_0x65e5('0xb'),'port':0x18eb});var io=require(_0x65e5('0xc'))(new Redis(config[_0x65e5('0x9')]));function getAdminId(_0x36d57d,_0x41ecbc,_0x29cff4,_0x260464){return new Promise(function(_0xe37e30,_0x115393){var _0x14995a=![];var _0x19ecb1={'method':_0x65e5('0xd'),'uri':_0x260464+_0x65e5('0xe'),'json':!![]};_0x19ecb1[_0x65e5('0xf')]=_0x29cff4;logger['info'](_0x65e5('0x10'));return rp(_0x19ecb1)[_0x65e5('0x11')](function(_0xa34bf){if(_0xa34bf){var _0x1e91c9=_0xa34bf['users'];var _0x32e2f0=null;for(_0x32e2f0=0x0;_0x32e2f0<_0x1e91c9[_0x65e5('0x12')];_0x32e2f0++){if(_0x1e91c9[_0x32e2f0][_0x65e5('0x13')]===_0x36d57d[_0x65e5('0x14')]){_0x36d57d['adminId']=_0x1e91c9[_0x32e2f0]['id'];_0x14995a=!![];}}if(_0x14995a){logger[_0x65e5('0x15')](_0x65e5('0x16'),_0x36d57d[_0x65e5('0x17')]);_0xe37e30(_0x36d57d);}else{_0x115393({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x115393({'statusCode':0x194,'message':_0x65e5('0x18')});}})[_0x65e5('0x19')](function(_0x390b4b){logger[_0x65e5('0x1a')]('['+[_0x41ecbc[_0x65e5('0x1b')]()]+']',_0x390b4b['message']);_0x115393(_0x390b4b);});});}function getUser(_0x57502e,_0x20912b,_0x3761a3){return function(_0x4b03f5){return new Promise(function(_0x5e786d,_0xc894ef){var _0x11e2ec={'method':_0x65e5('0xd'),'uri':_0x3761a3+_0x65e5('0xe'),'json':!![]};_0x11e2ec[_0x65e5('0xf')]=_0x20912b;logger['info']('Getting\x20user\x20list');return rp(_0x11e2ec)[_0x65e5('0x11')](function(_0x5a9645){if(_0x5a9645){var _0x1bb778=_0x5a9645[_0x65e5('0x1c')];var _0x28963d=![];var _0x1afd6c=null;if(_0x4b03f5['agentEmail']!==null){logger[_0x65e5('0x15')](_0x65e5('0x1d'),_0x4b03f5[_0x65e5('0x1e')]);_0x4b03f5[_0x65e5('0x1f')]=_0x4b03f5[_0x65e5('0x1e')];for(_0x1afd6c=0x0;_0x1afd6c<_0x1bb778['length'];_0x1afd6c++){if(_0x1bb778[_0x1afd6c]['email']===_0x4b03f5['agentEmail']){_0x28963d=!![];_0x4b03f5[_0x65e5('0x20')]=_0x1bb778[_0x1afd6c]['id'];logger[_0x65e5('0x15')](_0x65e5('0x21'),_0x4b03f5['userId']);}}}if(!_0x28963d){logger[_0x65e5('0x15')](_0x65e5('0x22'));_0x4b03f5[_0x65e5('0x1f')]=_0x4b03f5['adminEmail'];_0x4b03f5[_0x65e5('0x20')]=_0x4b03f5[_0x65e5('0x17')];_0x28963d=!![];}if(_0x28963d){_0x5e786d(_0x4b03f5);}else{_0xc894ef({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xc894ef({'statusCode':0x194,'message':_0x65e5('0x18')});}})[_0x65e5('0x19')](function(_0x303a89){logger[_0x65e5('0x1a')]('['+[_0x57502e[_0x65e5('0x1b')]()]+']',_0x303a89[_0x65e5('0x23')]);_0xc894ef(_0x303a89);});});};}function searchContact(_0x439965,_0x35a117,_0x4cd00e,_0x548407){return new Promise(function(_0x3866d2,_0xf5782a){var _0x4bff76={'method':'GET','headers':_0x35a117,'uri':_0x439965+'/api/lookup?q='+_0x548407+_0x65e5('0x24')+_0x4cd00e+'&entities=contact','json':!![]};rp(_0x4bff76)['then'](function(_0x398e62){var _0x4f37bd=_[_0x65e5('0x25')](_0x398e62[_0x65e5('0x26')][_0x65e5('0x26')],[_0x4cd00e,_0x548407]);_0x3866d2(_0x4f37bd);})[_0x65e5('0x19')](function(_0x5503aa){_0xf5782a(_0x5503aa);});});}function getEndUser(_0x26980c,_0x19a55d,_0x224e4d){return function(_0x3b1fb0){return new Promise(function(_0x1b467a,_0x3a0c17){logger['info'](util[_0x65e5('0x27')](_0x65e5('0x28'),_0x3b1fb0[_0x65e5('0x29')]));searchContact(_0x224e4d,_0x19a55d,_0x65e5('0x2a'),_0x3b1fb0[_0x65e5('0x29')])['then'](function(_0x3f062c){if(_0x3f062c){_0x3b1fb0[_0x65e5('0x2b')]=_0x3f062c['id'];logger[_0x65e5('0x15')](_0x65e5('0x2c'),_0x3b1fb0[_0x65e5('0x2b')]);return _0x1b467a(_0x3b1fb0);}searchContact(_0x224e4d,_0x19a55d,_0x65e5('0x2d'),_0x3b1fb0[_0x65e5('0x29')])['then'](function(_0x44a060){if(_0x44a060){_0x3b1fb0[_0x65e5('0x2b')]=_0x44a060['id'];logger[_0x65e5('0x15')](_0x65e5('0x2e'),_0x3b1fb0[_0x65e5('0x2b')]);return _0x1b467a(_0x3b1fb0);}createEndUser(_0x3b1fb0,_0x26980c,_0x19a55d,_0x224e4d)[_0x65e5('0x11')](function(_0x2a653d){logger['info'](_0x65e5('0x2f'),_0x2a653d['endUserId']);return _0x1b467a(_0x2a653d);});});})[_0x65e5('0x19')](function(_0x5a7884){_0x3a0c17(_0x5a7884);});});};}function createEndUser(_0x526b08,_0x3e2796,_0x206adc,_0x1fd12a){return new Promise(function(_0x3c8093,_0x3f683d){var _0x45bf03=moment();var _0x1328a6={'method':'POST','uri':_0x1fd12a+_0x65e5('0x30'),'body':{'contact':{'last_name':_0x526b08[_0x65e5('0x29')],'work_number':_0x526b08['contactNumber'],'mobile_number':_0x526b08[_0x65e5('0x29')],'owner_id':_0x526b08[_0x65e5('0x20')],'created_at':_0x45bf03[_0x65e5('0x27')](_0x65e5('0x31'))}},'json':!![]};_0x1328a6[_0x65e5('0xf')]=_0x206adc;logger['info'](_0x65e5('0x32'));return rp(_0x1328a6)['then'](function(_0x4b946b){_0x526b08[_0x65e5('0x2b')]=_0x4b946b['contact']['id'];_0x3c8093(_0x526b08);})[_0x65e5('0x19')](function(_0x53874c){logger[_0x65e5('0x1a')]('['+[_0x3e2796[_0x65e5('0x1b')]()]+']',_0x53874c[_0x65e5('0x23')]);_0x3f683d(_0x53874c[_0x65e5('0x23')]);});});}function getTicket(_0x592a5f,_0x40cf98,_0x33c2f1,_0x1d7b2e,_0x431a9e){return function(_0x846508){logger['info'](_0x65e5('0x33'));return new Promise(function(_0x58bf6c,_0x24bbdf){var _0x17c215=moment();var _0x1692f1={'method':_0x65e5('0x34'),'uri':_0x33c2f1+_0x65e5('0x35'),'body':{'title':intUtil[_0x65e5('0x36')](_0x1d7b2e[_0x65e5('0x37')],_0x431a9e,'\x20'),'description':intUtil[_0x65e5('0x36')](_0x1d7b2e[_0x65e5('0x38')],_0x431a9e,'\x0a'),'owner_id':_0x846508[_0x65e5('0x20')],'creater_id':_0x846508[_0x65e5('0x17')],'targetable_id':_0x846508['endUserId'],'targetable_type':_0x65e5('0x39'),'created_at':_0x17c215[_0x65e5('0x27')](_0x65e5('0x31')),'due_date':_0x17c215[_0x65e5('0x3a')](0x1e,'m')['format'](_0x65e5('0x31'))},'json':!![]};_0x1692f1[_0x65e5('0xf')]=_0x40cf98;return rp(_0x1692f1)['then'](function(_0x410cd2){_0x846508[_0x65e5('0x3b')]=_0x410cd2[_0x65e5('0x3c')]['id'];logger[_0x65e5('0x15')](_0x65e5('0x3d'),_0x846508['ticketId']);_0x58bf6c(_0x846508);})[_0x65e5('0x19')](function(_0x5e268a){logger[_0x65e5('0x1a')]('['+[_0x592a5f['toUpperCase']()]+']',_0x5e268a[_0x65e5('0x23')]);_0x24bbdf(_0x5e268a[_0x65e5('0x23')]);});});};}function emit(_0x478a3d,_0x292970,_0x1249f8){var _0x3586a5={'uri':_0x478a3d+_0x65e5('0x3e')+_0x1249f8};io['to'](util['format'](_0x65e5('0x3f'),_0x292970))[_0x65e5('0x40')](_0x65e5('0x41'),_0x3586a5);}exports['cs']=function(_0x3f71ec,_0x1eb44f,_0x237bd7,_0x2dd5f3,_0x4cd38a,_0x472517,_0x3cd117,_0x440b84){var _0x656fb1={};var _0x59bb65={'Authorization':_0x65e5('0x42')+_0x472517[_0x65e5('0x43')]};_0x472517[_0x65e5('0x44')]=intUtil['stripTrailingSlash'](_0x472517['remoteUri']);_0x472517[_0x65e5('0x45')]=intUtil[_0x65e5('0x46')](_0x472517[_0x65e5('0x45')]);var _0x4e7818=_0x472517[_0x65e5('0x44')];_0x656fb1[_0x65e5('0x14')]=_0x472517['username'];_0x656fb1[_0x65e5('0x29')]=_0x440b84[_0x65e5('0x47')]()===_0x65e5('0x48')?_0x1eb44f[_0x65e5('0x49')]:_0x1eb44f[_0x65e5('0x4a')];_0x656fb1[_0x65e5('0x4b')]=_0x440b84==='queue'||_0x440b84===_0x65e5('0x4c')?_0x65e5('0x4d'):_0x65e5('0x48');if(_0x2dd5f3){_0x656fb1['agentEmail']=_0x2dd5f3['email'];}var _0x74023c=util[_0x65e5('0x27')](_0x65e5('0x4e'),_0x472517[_0x65e5('0x45')],_0x1eb44f['uniqueid'],md5(_0x1eb44f[_0x65e5('0x4f')]));if(_0x4cd38a&&_0x4cd38a[_0x65e5('0x50')]){logger['info'](_0x65e5('0x51'),_0x65e5('0x52'));_0x1eb44f['recordingURL']=_0x74023c;}else if(_0x3cd117&&_0x3cd117[_0x65e5('0x53')]&&_0x3cd117['recordingFormat']!==_0x65e5('0x54')){logger[_0x65e5('0x15')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1eb44f[_0x65e5('0x55')]=_0x74023c;}else{_0x1eb44f[_0x65e5('0x55')]='';}return getAdminId(_0x656fb1,_0x440b84,_0x59bb65,_0x4e7818)[_0x65e5('0x11')](getUser(_0x440b84,_0x59bb65,_0x4e7818))[_0x65e5('0x11')](getEndUser(_0x440b84,_0x59bb65,_0x4e7818))['then'](getTicket(_0x440b84,_0x59bb65,_0x4e7818,_0x237bd7,_0x1eb44f))[_0x65e5('0x11')](function(_0x2a3852){logger[_0x65e5('0x15')](util[_0x65e5('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2a3852[_0x65e5('0x3b')]));if(_0x440b84!==_0x65e5('0x4c')){logger[_0x65e5('0x15')]('['+[_0x440b84[_0x65e5('0x1b')]()]+']',_0x65e5('0x56'));emit(_0x4e7818,_0x2dd5f3[_0x65e5('0x57')],_0x2a3852['endUserId']);}})[_0x65e5('0x19')](function(_0x20b098){logger[_0x65e5('0x1a')]('['+[_0x440b84[_0x65e5('0x1b')]()]+_0x65e5('0x58'),util[_0x65e5('0x59')](_0x20b098,{'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 a0fcb49..9d216a7 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 _0x87dd=['exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow'];(function(_0x1ffd08,_0x1a8839){var _0xd9e6ad=function(_0x29879a){while(--_0x29879a){_0x1ffd08['push'](_0x1ffd08['shift']());}};_0xd9e6ad(++_0x1a8839);}(_0x87dd,0x193));var _0xd87d=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x87dd[_0x528575];return _0x3063b7;};'use strict';var _=require('lodash');var util=require(_0xd87d('0x0'));var zendesk=require(_0xd87d('0x1'));var salesforce=require(_0xd87d('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xd87d('0x3'));var zoho=require(_0xd87d('0x4'));var desk=require(_0xd87d('0x5'));var vtiger=require(_0xd87d('0x6'));var servicenow=require(_0xd87d('0x7'));var dynamics365=require(_0xd87d('0x8'));var freshsales=require(_0xd87d('0x9'));var integrations=['zendesk','salesforce',_0xd87d('0xa'),_0xd87d('0xb'),_0xd87d('0xc'),_0xd87d('0xd'),_0xd87d('0xe'),'dynamics365',_0xd87d('0xf'),_0xd87d('0x10')];exports[_0xd87d('0x11')]=function(_0xf40bb2,_0x5065a5,_0x4295b5,_0x13ba44,_0x55db84,_0x4980d5){if(_0x4295b5){if(_['includes'](integrations,_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]())){try{var _0xaac45c=null;var _0x3f3f26='';var _0x4a5baa=_0x4295b5[_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]()];if(_0x4a5baa){var _0x5a563c=_0x4a5baa[_0xf40bb2[_0xd87d('0x14')]];if(_0x5a563c){var _0x204782=_[_0xd87d('0x15')](_0x5a563c[_0xd87d('0x16')],{'id':parseInt(_0xf40bb2[_0xd87d('0x17')],0xa)});if(_0x204782){if(_0x13ba44){if(_0x55db84&&_0x5065a5[_0xd87d('0x18')]){_0x3f3f26=_0xd87d('0x18');}else if(_0x5065a5[_0xd87d('0x19')]){_0x3f3f26=_0xd87d('0x1a');}else{console[_0xd87d('0x1b')](_0xd87d('0x1c'),_0x5065a5);}}else{_0x3f3f26='unmanaged';}switch(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]()){case _0xd87d('0x1d'):zendesk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case'salesforce':salesforce[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xa'):sugarcrm[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xb'):freshdesk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xc'):zoho[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case'desk':desk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xe'):vtiger[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xf'):freshsales['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;case _0xd87d('0x10'):servicenow['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;case'dynamics365':dynamics365['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;default:console['log']('unknown\x20integration');}}else{_0xaac45c=require(_0xd87d('0x1e'))(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]());_0xaac45c[_0xd87d('0x1f')](_0xd87d('0x20'),util[_0xd87d('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0xf40bb2['data1'][_0xd87d('0x13')](),_0xf40bb2[_0xd87d('0x17')]));}}else{_0xaac45c=require(_0xd87d('0x1e'))(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]());_0xaac45c[_0xd87d('0x1f')](_0xd87d('0x20'),util[_0xd87d('0x21')](_0xd87d('0x22'),_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')](),_0xf40bb2[_0xd87d('0x14')]));}}else{}}catch(_0x32c0c7){console['error'](_0x32c0c7);}}}}; \ No newline at end of file +var _0x63c0=['freshsales','servicenow','exec','includes','data1','toLowerCase','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x63c0,0x193));var _0x063c=function(_0x1977f1,_0x19ef5c){_0x1977f1=_0x1977f1-0x0;var _0x5185ce=_0x63c0[_0x1977f1];return _0x5185ce;};'use strict';var _=require('lodash');var util=require(_0x063c('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x063c('0x1'));var sugarcrm=require(_0x063c('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x063c('0x3'));var desk=require(_0x063c('0x4'));var vtiger=require(_0x063c('0x5'));var servicenow=require(_0x063c('0x6'));var dynamics365=require(_0x063c('0x7'));var freshsales=require(_0x063c('0x8'));var integrations=['zendesk',_0x063c('0x9'),_0x063c('0xa'),_0x063c('0xb'),_0x063c('0xc'),_0x063c('0xd'),_0x063c('0xe'),'dynamics365',_0x063c('0xf'),_0x063c('0x10')];exports[_0x063c('0x11')]=function(_0x14d541,_0x1dd479,_0x54175f,_0x3dc531,_0x1aa1e5,_0x32ae0a){if(_0x54175f){if(_[_0x063c('0x12')](integrations,_0x14d541[_0x063c('0x13')][_0x063c('0x14')]())){try{var _0x3e5d69=null;var _0x24eaa9='';var _0x281b20=_0x54175f[_0x14d541[_0x063c('0x13')][_0x063c('0x14')]()];if(_0x281b20){var _0x341f54=_0x281b20[_0x14d541['data2']];if(_0x341f54){var _0x475952=_['find'](_0x341f54[_0x063c('0x15')],{'id':parseInt(_0x14d541[_0x063c('0x16')],0xa)});if(_0x475952){if(_0x3dc531){if(_0x1aa1e5&&_0x1dd479['queue']){_0x24eaa9=_0x063c('0x17');}else if(_0x1dd479[_0x063c('0x18')]){_0x24eaa9=_0x063c('0x19');}else{console[_0x063c('0x1a')](_0x063c('0x1b'),_0x1dd479);}}else{_0x24eaa9=_0x063c('0x1c');}switch(_0x14d541[_0x063c('0x13')][_0x063c('0x14')]()){case _0x063c('0x1d'):zendesk[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0x9'):salesforce[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0xa'):sugarcrm[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0xb'):freshdesk[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0xc'):zoho[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0xd'):desk[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case'vtiger':vtiger[_0x24eaa9](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a);break;case _0x063c('0xf'):freshsales['cs'](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a,_0x24eaa9);break;case _0x063c('0x10'):servicenow['cs'](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a,_0x24eaa9);break;case _0x063c('0x1e'):dynamics365['cs'](_0x14d541,_0x1dd479,_0x475952,_0x3dc531,_0x1aa1e5,_0x341f54,_0x32ae0a,_0x24eaa9);break;default:console[_0x063c('0x1a')](_0x063c('0x1f'));}}else{_0x3e5d69=require(_0x063c('0x20'))(_0x14d541[_0x063c('0x13')][_0x063c('0x14')]());_0x3e5d69[_0x063c('0x21')](_0x063c('0x22'),util['format'](_0x063c('0x23'),_0x14d541[_0x063c('0x13')]['toLowerCase'](),_0x14d541[_0x063c('0x16')]));}}else{_0x3e5d69=require(_0x063c('0x20'))(_0x14d541[_0x063c('0x13')]['toLowerCase']());_0x3e5d69['error'](_0x063c('0x22'),util[_0x063c('0x24')](_0x063c('0x25'),_0x14d541['data1']['toLowerCase'](),_0x14d541['data2']));}}else{}}catch(_0x2f303c){console[_0x063c('0x21')](_0x2f303c);}}}}; \ 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 15e897c..79a290d 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 _0xe649=['[QUEUE]','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','catch','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','sobject','create','isNil','validateEmail','User','find','length','Email','info','Agent\x20%s\x20found.','resolve','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format'];(function(_0x58ded3,_0x3844d6){var _0x3ffeb1=function(_0x586bfa){while(--_0x586bfa){_0x58ded3['push'](_0x58ded3['shift']());}};_0x3ffeb1(++_0x3844d6);}(_0xe649,0x11d));var _0x9e64=function(_0x524180,_0xfaea9d){_0x524180=_0x524180-0x0;var _0x30e196=_0xe649[_0x524180];return _0x30e196;};'use strict';var _=require(_0x9e64('0x0'));var rp=require(_0x9e64('0x1'));var moment=require(_0x9e64('0x2'));var BPromise=require('bluebird');var md5=require(_0x9e64('0x3'));var jsforce=require(_0x9e64('0x4'));var util=require(_0x9e64('0x5'));var Redis=require(_0x9e64('0x6'));var intUtil=require(_0x9e64('0x7'));var config=require(_0x9e64('0x8'));var logger=require(_0x9e64('0x9'))('salesforce');config[_0x9e64('0xa')]=_[_0x9e64('0xb')](config[_0x9e64('0xa')],{'host':_0x9e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e64('0xa')]));function emit(_0x60953,_0x382d19,_0x638714){io['to'](_0x60953)['emit'](_0x382d19,_0x638714);}function getTicket(_0x4763ac,_0x40e415,_0xe8d858,_0x11c10c,_0x5f1c98,_0x7f4b98,_0x497830,_0x2e89b3){var _0x34177c=Object[_0x9e64('0xd')]({},{'OwnerId':_0x40e415['id'],'Subject':intUtil[_0x9e64('0xe')](_0x11c10c[_0x9e64('0xf')],_0x5f1c98,'\x20'),'Description':intUtil[_0x9e64('0xe')](_0x11c10c[_0x9e64('0x10')],_0x5f1c98,'\x0a')},getCustomFields(_0x7f4b98,_0x5f1c98));if(_0xe8d858){if(_0x11c10c[_0x9e64('0x11')]===_0x9e64('0x12')){_0x34177c[_0x9e64('0x13')]=moment['utc']();_0x34177c['IsReminderSet']=![];_0x34177c['IsRecurrence']=![];if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x15')||_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x16')){_0x34177c[_0x9e64('0x17')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x18')){_0x34177c['WhatId']=_0xe8d858['id'];}}else if(_0x11c10c[_0x9e64('0x11')]===_0x9e64('0x19')){if(_0xe8d858['endUserType']===_0x9e64('0x15')){_0x34177c[_0x9e64('0x1a')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x18')){_0x34177c[_0x9e64('0x1b')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x16')&&_0x11c10c['leadId']){_0x34177c[_0x11c10c[_0x9e64('0x1c')]]=_0xe8d858['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x497830[_0x9e64('0x1d')](_0x11c10c[_0x9e64('0x11')])[_0x9e64('0x1e')](_0x34177c);}function getUser(_0xaf480c,_0xd13d9d,_0x392e52){if(!_[_0x9e64('0x1f')](_0xd13d9d)&&intUtil[_0x9e64('0x20')](_0xd13d9d)){var _0x207de8={'Email':_0xd13d9d};var _0xa3ab04={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x392e52[_0x9e64('0x1d')](_0x9e64('0x21'))[_0x9e64('0x22')](_0x207de8,_0xa3ab04)['execute']()['then'](function(_0x1c456b){if(_0x1c456b[_0x9e64('0x23')]){var _0xe2bfc8=_[_0x9e64('0x22')](_0x1c456b,function(_0x44fd51){return _0x44fd51[_0x9e64('0x24')]===_0xd13d9d;});if(_0xe2bfc8){logger[_0x9e64('0x25')](_0x9e64('0x26'),_0xd13d9d);return BPromise[_0x9e64('0x27')]({'id':_0xe2bfc8['Id'],'name':_0xe2bfc8['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xd13d9d);return _0x392e52[_0x9e64('0x28')]()[_0x9e64('0x29')](function(_0x30c665){return BPromise['resolve']({'id':_0x30c665[_0x9e64('0x2a')],'name':_0x30c665[_0x9e64('0x2b')]});});}});}else{logger[_0x9e64('0x25')](_0x9e64('0x2c'),_0xd13d9d);return _0x392e52[_0x9e64('0x28')]()[_0x9e64('0x29')](function(_0x3b56d2){return BPromise['resolve']({'id':_0x3b56d2[_0x9e64('0x2a')],'name':_0x3b56d2[_0x9e64('0x2b')]});});}}function getEndUser(_0x1515ae,_0x378475,_0x5142af,_0x598574,_0x1c95f9){var _0x5c84a1={'$or':{'Phone':_0x598574}};var _0x35e605={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9e64('0x27')]()[_0x9e64('0x29')](function(){logger[_0x9e64('0x25')](_0x9e64('0x2d'),_0x598574,_0x378475[_0x9e64('0x2e')]);switch(_0x378475[_0x9e64('0x2e')]){case'contact_lead':var _0x4dd8bb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x4dd8bb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9['sobject']('Contact')[_0x9e64('0x22')](_0x4dd8bb,_0x35e605)[_0x9e64('0x33')]()['then'](function(_0x524d94){if(_0x524d94&&_0x524d94[_0x9e64('0x23')]){return _0x524d94;}else{var _0x1244e9=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0x2c8864={};_0x2c8864[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x1244e9[_0x9e64('0x32')],_0x2c8864);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x1244e9,_0x35e605);}});case _0x9e64('0x36'):var _0x5cbceb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x37')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x37')]]=_0x598574;_[_0x9e64('0x31')](_0x5cbceb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x38'))[_0x9e64('0x22')](_0x5cbceb,_0x35e605)['execute']()[_0x9e64('0x29')](function(_0x189ba7){if(_0x189ba7&&_0x189ba7[_0x9e64('0x23')]){return _0x189ba7;}else{var _0x251ea0=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0x50b41e={};_0x50b41e[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x251ea0[_0x9e64('0x32')],_0x50b41e);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x39'))[_0x9e64('0x22')](_0x251ea0,_0x35e605)[_0x9e64('0x29')](function(_0x499a79){if(_0x499a79&&_0x499a79[_0x9e64('0x23')]){return _0x499a79;}else{var _0x22c5a1=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0x45ed44={};_0x45ed44[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x22c5a1[_0x9e64('0x32')],_0x45ed44);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x22c5a1,_0x35e605);}});}});case _0x9e64('0x15'):var _0x4dd8bb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x4dd8bb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x39'))['find'](_0x4dd8bb,_0x35e605)['execute']();case _0x9e64('0x16'):var _0x198b52=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x198b52[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x198b52,_0x35e605);case _0x9e64('0x18'):var _0x5cbceb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x37')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x37')]]=_0x598574;_[_0x9e64('0x31')](_0x5cbceb['$or'],_0xa8ce);}return _0x1c95f9['sobject'](_0x9e64('0x38'))[_0x9e64('0x22')](_0x5cbceb,_0x35e605);default:return null;}})[_0x9e64('0x29')](function(_0x1e4642){if(_0x1e4642&&_0x1e4642[_0x9e64('0x23')]){var _0x48a01f=_['first'](_0x1e4642);if(_0x48a01f){return BPromise[_0x9e64('0x27')]({'id':_0x48a01f['Id'],'name':_0x48a01f[_0x9e64('0x3a')],'phone':_0x48a01f[_0x9e64('0x3b')],'endUserType':_0x48a01f[_0x9e64('0x3c')][_0x9e64('0x3d')][_0x9e64('0x3e')]()});}}})['then'](function(_0x219069){if(_0x219069){logger[_0x9e64('0x25')](_0x9e64('0x3f'),_0x219069[_0x9e64('0x14')],_0x598574);return BPromise[_0x9e64('0x27')](_0x219069);}else{logger[_0x9e64('0x25')](_0x9e64('0x40'),_0x598574);var _0x427bb2={'Phone':_0x598574};if(_0x378475[_0x9e64('0x41')]){if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x15')){logger[_0x9e64('0x25')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x598574,_0x378475['moduleCreate']);_0x427bb2[_0x9e64('0x42')]=_0x5142af!==_0x9e64('0x43')?_0x5142af:util[_0x9e64('0x44')](_0x9e64('0x45'),_0x598574);}else if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x16')){logger[_0x9e64('0x25')](_0x9e64('0x46'),_0x598574,_0x378475[_0x9e64('0x41')]);_0x427bb2['LastName']=_0x5142af!==_0x9e64('0x43')?_0x5142af:util[_0x9e64('0x44')](_0x9e64('0x45'),_0x598574);_0x427bb2[_0x9e64('0x47')]=_0x9e64('0x48');}else if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x18')){logger[_0x9e64('0x25')](_0x9e64('0x46'),_0x598574,_0x378475[_0x9e64('0x41')]);_0x427bb2['Name']=_0x5142af!==''?_0x5142af:util[_0x9e64('0x44')]('Caller\x20-\x20%s',_0x598574);}else{return null;}}return _0x1c95f9[_0x9e64('0x1d')](_[_0x9e64('0x49')](_0x378475['moduleCreate']))[_0x9e64('0x1e')](_0x427bb2)[_0x9e64('0x29')](function(_0x394c76){return BPromise[_0x9e64('0x27')]({'id':_0x394c76['id'],'endUserType':_0x378475['moduleCreate']});});}});}function getCustomFields(_0x25f5f4,_0x12f88e){var _0x280a5c={};if(_0x25f5f4['length']>0x0){_[_0x9e64('0x4a')](_0x25f5f4,function(_0x123bde){if(_['includes'](['string','picklist'],_0x123bde[_0x9e64('0x3d')])&&_0x123bde['idField']){_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x123bde[_0x9e64('0x4c')][_0x9e64('0x4d')]();}else if(_0x123bde[_0x9e64('0x3d')]===_0x9e64('0x4e')&&_0x123bde[_0x9e64('0x4f')]&&_0x123bde[_0x9e64('0x4b')]){_0x12f88e[_0x123bde['variableName']]&&(_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x12f88e[_0x123bde[_0x9e64('0x4f')]]['toString']());}else if(_0x123bde['type']==='customVariable'&&_0x123bde[_0x9e64('0x50')]&&_0x123bde[_0x9e64('0x50')][_0x9e64('0x51')]&&_0x123bde['idField']){_0x12f88e[_0x123bde[_0x9e64('0x50')]['name']['toLowerCase']()]&&(_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x12f88e[_0x123bde[_0x9e64('0x50')][_0x9e64('0x51')][_0x9e64('0x3e')]()][_0x9e64('0x4d')]());}});}return _0x280a5c;}function getConnection(_0x1fc474){var _0x36f40d=_0x1fc474[_0x9e64('0x52')][_0x9e64('0x53')](_0x1fc474[_0x9e64('0x54')]);var _0x5abff5=new jsforce[(_0x9e64('0x55'))]({'oauth2':{'loginUrl':_0x1fc474[_0x9e64('0x56')]||_0x9e64('0x57'),'clientId':_0x1fc474[_0x9e64('0x58')],'clientSecret':_0x1fc474[_0x9e64('0x59')]}});return _0x5abff5[_0x9e64('0x5a')](_0x1fc474[_0x9e64('0x5b')],_0x36f40d)[_0x9e64('0x29')](function(){logger[_0x9e64('0x25')]('Connection\x20established.');return _0x5abff5;});}exports[_0x9e64('0x5c')]=function(_0x13b954,_0x3298b3,_0x434f4c,_0x55e972,_0x476440,_0xa02b20){var _0x8dc7c9,_0xe0ccbb,_0x890431,_0x33b692;_0xa02b20[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0xa02b20[_0x9e64('0x5d')]);_0xa02b20['remoteUri']=intUtil[_0x9e64('0x5e')](_0xa02b20[_0x9e64('0x56')]);if(_0x476440&&_0x476440[_0x9e64('0x5f')]){logger[_0x9e64('0x25')](_0x9e64('0x60'),'Recording\x20is\x20enabled!');_0x3298b3[_0x9e64('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa02b20['serverUrl'],_0x3298b3['uniqueid'],md5(_0x3298b3[_0x9e64('0x62')]));}else{_0x3298b3[_0x9e64('0x61')]='';}return getConnection(_0xa02b20)[_0x9e64('0x29')](function(_0x3562f0){_0x33b692=_0x3562f0;return getUser(_0xa02b20,_0x55e972[_0x9e64('0x63')],_0x33b692);})['then'](function(_0x5151a1){_0x8dc7c9=_0x5151a1;return getEndUser(_0xa02b20,_0x434f4c,_0x3298b3[_0x9e64('0x64')],_0x3298b3[_0x9e64('0x65')],_0x33b692);})[_0x9e64('0x29')](function(_0xe85cf){_0xe0ccbb=_0xe85cf;return getTicket(_0xa02b20,_0x8dc7c9,_0xe0ccbb,_0x434f4c,_0x3298b3,_0x434f4c[_0x9e64('0x66')],_0x33b692,_0x9e64('0x5c'));})[_0x9e64('0x29')](function(_0x19a0d6){_0x890431=_0x19a0d6;logger[_0x9e64('0x25')](_0x9e64('0x67'),_0x890431['id']);logger['info'](_0x9e64('0x68'),_0x890431['id'],_0x55e972[_0x9e64('0x51')],_0xa02b20[_0x9e64('0x3d')]);switch(_0xa02b20[_0x9e64('0x3d')]){case _0x9e64('0x69'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x55e972[_0x9e64('0x51')]),_0x9e64('0x6b'),{'recordId':_0x890431['id']});break;case _0x9e64('0x6c'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x55e972[_0x9e64('0x51')]),_0x9e64('0x6d'),{'uri':util[_0x9e64('0x44')]('%s/%s/e',_0x33b692[_0x9e64('0x6e')],_0x890431['id'])});break;default:logger[_0x9e64('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x9e64('0x70')](function(_0x1af53d){logger[_0x9e64('0x6f')]('[QUEUE]',_0x1af53d);});};exports[_0x9e64('0x71')]=function(_0x57413c,_0x3f489d,_0x3beadf,_0x38c064,_0x11b4dc,_0x5550dd,_0x1672db){var _0x11b7e0,_0x35d0e2,_0x435638,_0x300881;_0x5550dd[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0x5550dd[_0x9e64('0x5d')]);_0x5550dd[_0x9e64('0x56')]=intUtil[_0x9e64('0x5e')](_0x5550dd[_0x9e64('0x56')]);if(_0x1672db&&_0x1672db['recordingFormat']&&_0x1672db['recordingFormat']!=='none'){logger[_0x9e64('0x25')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3f489d[_0x9e64('0x61')]=util[_0x9e64('0x44')](_0x9e64('0x72'),_0x5550dd['serverUrl'],_0x3f489d['uniqueid'],md5(_0x3f489d[_0x9e64('0x62')]));}return getConnection(_0x5550dd)[_0x9e64('0x29')](function(_0x40ef7a){_0x300881=_0x40ef7a;return getUser(_0x5550dd,_0x38c064['email'],_0x300881);})['then'](function(_0x4d1fa6){_0x11b7e0=_0x4d1fa6;return getEndUser(_0x5550dd,_0x3beadf,_0x3f489d[_0x9e64('0x73')],_0x3f489d[_0x9e64('0x74')],_0x300881);})[_0x9e64('0x29')](function(_0x2f1512){_0x35d0e2=_0x2f1512;return getTicket(_0x5550dd,_0x11b7e0,_0x35d0e2,_0x3beadf,_0x3f489d,_0x3beadf['Fields'],_0x300881,'outbound');})[_0x9e64('0x29')](function(_0x2604e9){_0x435638=_0x2604e9;logger[_0x9e64('0x25')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x435638['id']);logger[_0x9e64('0x25')](_0x9e64('0x75'),_0x435638['id'],_0x38c064['name'],_0x5550dd['type']);switch(_0x5550dd[_0x9e64('0x3d')]){case _0x9e64('0x69'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x38c064[_0x9e64('0x51')]),'trigger:salesforce:display',{'recordId':_0x435638['id']});break;case'newTab':emit(util['format'](_0x9e64('0x6a'),_0x38c064[_0x9e64('0x51')]),_0x9e64('0x6d'),{'uri':util['format'](_0x9e64('0x76'),_0x300881[_0x9e64('0x6e')],_0x435638['id'])});break;default:logger[_0x9e64('0x6f')](_0x9e64('0x77'),_0x9e64('0x78'));}})['catch'](function(_0x22b57f){logger[_0x9e64('0x6f')]('[OUTBOUND]',_0x22b57f);});};exports[_0x9e64('0x79')]=function(_0x6aebbf,_0x471f65,_0x318060,_0x10cd62,_0x271eb0,_0x3a28a3){var _0x129fca,_0x3ce51e,_0x1e5c18,_0x4c9b5d;_0x3a28a3[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0x3a28a3[_0x9e64('0x5d')]);_0x3a28a3[_0x9e64('0x56')]=intUtil[_0x9e64('0x5e')](_0x3a28a3['remoteUri']);if(_0x271eb0&&_0x271eb0[_0x9e64('0x5f')]){logger['info']('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+']',_0x9e64('0x7c'));_0x471f65[_0x9e64('0x61')]=util[_0x9e64('0x44')](_0x9e64('0x72'),_0x3a28a3['serverUrl'],_0x471f65[_0x9e64('0x62')],md5(_0x471f65['uniqueid']));}else{_0x471f65[_0x9e64('0x61')]='';}return getConnection(_0x3a28a3)['then'](function(_0x1f2e0e){_0x4c9b5d=_0x1f2e0e;if(!_[_0x9e64('0x1f')](_0x10cd62)){return getUser(_0x3a28a3,_0x10cd62[_0x9e64('0x51')],_0x4c9b5d);}else{return getUser(_0x3a28a3,null,_0x4c9b5d);}})[_0x9e64('0x29')](function(_0x51be4e){_0x129fca=_0x51be4e;return getEndUser(_0x3a28a3,_0x318060,_0x471f65[_0x9e64('0x64')],_0x471f65[_0x9e64('0x65')],_0x4c9b5d);})[_0x9e64('0x29')](function(_0x5eab57){_0x3ce51e=_0x5eab57;return getTicket(_0x3a28a3,_0x129fca,_0x3ce51e,_0x318060,_0x471f65,_0x318060[_0x9e64('0x66')],_0x4c9b5d);})[_0x9e64('0x29')](function(_0x5d2dd9){_0x1e5c18=_0x5d2dd9;logger[_0x9e64('0x25')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+_0x9e64('0x7d'),_0x1e5c18['id']);logger[_0x9e64('0x25')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+_0x9e64('0x7e'),_0x3a28a3[_0x9e64('0x3d')]);})[_0x9e64('0x70')](function(_0x50726d){logger[_0x9e64('0x6f')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+']',_0x50726d);});}; \ No newline at end of file +var _0x13f4=['calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','integrationTab','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','request-promise','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','utc','IsReminderSet','endUserType','contact','WhoId','account','ticketType','Case','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','then','length','Email','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','merge','$or','Contact','find','execute','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchLead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname'];(function(_0x21f0bc,_0x536f34){var _0x306467=function(_0x5ef285){while(--_0x5ef285){_0x21f0bc['push'](_0x21f0bc['shift']());}};_0x306467(++_0x536f34);}(_0x13f4,0x18d));var _0x413f=function(_0x471273,_0x1587f1){_0x471273=_0x471273-0x0;var _0x56c63e=_0x13f4[_0x471273];return _0x56c63e;};'use strict';var _=require('lodash');var rp=require(_0x413f('0x0'));var moment=require(_0x413f('0x1'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x413f('0x2'));var intUtil=require(_0x413f('0x3'));var config=require(_0x413f('0x4'));var logger=require(_0x413f('0x5'))(_0x413f('0x6'));config[_0x413f('0x7')]=_[_0x413f('0x8')](config[_0x413f('0x7')],{'host':_0x413f('0x9'),'port':0x18eb});var io=require(_0x413f('0xa'))(new Redis(config[_0x413f('0x7')]));function emit(_0x30a264,_0x5bc571,_0xeae1e8){io['to'](_0x30a264)[_0x413f('0xb')](_0x5bc571,_0xeae1e8);}function getTicket(_0x64ed37,_0x473f55,_0x5c5f87,_0xdb75db,_0x302b69,_0x41b970,_0x67da92,_0x5f3c87){var _0x488640=Object['assign']({},{'OwnerId':_0x473f55['id'],'Subject':intUtil['getString'](_0xdb75db[_0x413f('0xc')],_0x302b69,'\x20'),'Description':intUtil['getString'](_0xdb75db['Descriptions'],_0x302b69,'\x0a')},getCustomFields(_0x41b970,_0x302b69));if(_0x5c5f87){if(_0xdb75db['ticketType']==='Task'){_0x488640['ActivityDate']=moment[_0x413f('0xd')]();_0x488640[_0x413f('0xe')]=![];_0x488640['IsRecurrence']=![];if(_0x5c5f87[_0x413f('0xf')]===_0x413f('0x10')||_0x5c5f87[_0x413f('0xf')]==='lead'){_0x488640[_0x413f('0x11')]=_0x5c5f87['id'];}else if(_0x5c5f87[_0x413f('0xf')]===_0x413f('0x12')){_0x488640['WhatId']=_0x5c5f87['id'];}}else if(_0xdb75db[_0x413f('0x13')]===_0x413f('0x14')){if(_0x5c5f87['endUserType']===_0x413f('0x10')){_0x488640[_0x413f('0x15')]=_0x5c5f87['id'];}else if(_0x5c5f87[_0x413f('0xf')]===_0x413f('0x12')){_0x488640[_0x413f('0x16')]=_0x5c5f87['id'];}else if(_0x5c5f87[_0x413f('0xf')]===_0x413f('0x17')&&_0xdb75db['leadId']){_0x488640[_0xdb75db[_0x413f('0x18')]]=_0x5c5f87['id'];}else{logger[_0x413f('0x19')](_0x413f('0x1a'));}}}return _0x67da92[_0x413f('0x1b')](_0xdb75db[_0x413f('0x13')])[_0x413f('0x1c')](_0x488640);}function getUser(_0x3108e8,_0x3804d2,_0x2bcf56){if(!_[_0x413f('0x1d')](_0x3804d2)&&intUtil[_0x413f('0x1e')](_0x3804d2)){var _0xd96e86={'Email':_0x3804d2};var _0x26ce19={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2bcf56['sobject'](_0x413f('0x1f'))['find'](_0xd96e86,_0x26ce19)['execute']()[_0x413f('0x20')](function(_0x50cb48){if(_0x50cb48[_0x413f('0x21')]){var _0x4a016e=_['find'](_0x50cb48,function(_0x2b2695){return _0x2b2695[_0x413f('0x22')]===_0x3804d2;});if(_0x4a016e){logger['info']('Agent\x20%s\x20found.',_0x3804d2);return BPromise[_0x413f('0x23')]({'id':_0x4a016e['Id'],'name':_0x4a016e[_0x413f('0x24')]});}}else{logger[_0x413f('0x19')](_0x413f('0x25'),_0x3804d2);return _0x2bcf56[_0x413f('0x26')]()[_0x413f('0x20')](function(_0x4b323d){return BPromise[_0x413f('0x23')]({'id':_0x4b323d[_0x413f('0x27')],'name':_0x4b323d[_0x413f('0x28')]});});}});}else{logger[_0x413f('0x19')](_0x413f('0x25'),_0x3804d2);return _0x2bcf56[_0x413f('0x26')]()['then'](function(_0x1c49aa){return BPromise[_0x413f('0x23')]({'id':_0x1c49aa[_0x413f('0x27')],'name':_0x1c49aa[_0x413f('0x28')]});});}}function getEndUser(_0x25404f,_0x5575d1,_0x139bdb,_0x527914,_0x56c765){var _0x143d3a={'$or':{'Phone':_0x527914}};var _0x5031ae={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x413f('0x23')]()[_0x413f('0x20')](function(){logger[_0x413f('0x19')](_0x413f('0x29'),_0x527914,_0x5575d1[_0x413f('0x2a')]);switch(_0x5575d1['moduleSearch']){case _0x413f('0x2b'):var _0x51f0a0=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1[_0x413f('0x2d')]){var _0x53b81f={};_0x53b81f[_0x5575d1[_0x413f('0x2d')]]=_0x527914;_[_0x413f('0x2e')](_0x51f0a0[_0x413f('0x2f')],_0x53b81f);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x30'))[_0x413f('0x31')](_0x51f0a0,_0x5031ae)[_0x413f('0x32')]()[_0x413f('0x20')](function(_0x2a3506){if(_0x2a3506&&_0x2a3506['length']){return _0x2a3506;}else{var _0xa4c64a=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1['additionalSearchLead']){var _0x549c9e={};_0x549c9e[_0x5575d1['additionalSearchLead']]=_0x527914;_['merge'](_0xa4c64a[_0x413f('0x2f')],_0x549c9e);}return _0x56c765['sobject'](_0x413f('0x33'))[_0x413f('0x31')](_0xa4c64a,_0x5031ae);}});case _0x413f('0x34'):var _0x41e43d=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1['additionalSearchAccount']){var _0x53b81f={};_0x53b81f[_0x5575d1[_0x413f('0x35')]]=_0x527914;_[_0x413f('0x2e')](_0x41e43d[_0x413f('0x2f')],_0x53b81f);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x36'))[_0x413f('0x31')](_0x41e43d,_0x5031ae)[_0x413f('0x32')]()[_0x413f('0x20')](function(_0x4995c4){if(_0x4995c4&&_0x4995c4['length']){return _0x4995c4;}else{var _0x462201=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1[_0x413f('0x2d')]){var _0x3615f7={};_0x3615f7[_0x5575d1[_0x413f('0x2d')]]=_0x527914;_[_0x413f('0x2e')](_0x462201['$or'],_0x3615f7);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x30'))['find'](_0x462201,_0x5031ae)[_0x413f('0x20')](function(_0x220800){if(_0x220800&&_0x220800['length']){return _0x220800;}else{var _0x435b89=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1[_0x413f('0x37')]){var _0x488f2f={};_0x488f2f[_0x5575d1[_0x413f('0x37')]]=_0x527914;_[_0x413f('0x2e')](_0x435b89[_0x413f('0x2f')],_0x488f2f);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x33'))[_0x413f('0x31')](_0x435b89,_0x5031ae);}});}});case _0x413f('0x10'):var _0x51f0a0=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1['additionalSearchContact']){var _0x53b81f={};_0x53b81f[_0x5575d1[_0x413f('0x2d')]]=_0x527914;_[_0x413f('0x2e')](_0x51f0a0['$or'],_0x53b81f);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x30'))[_0x413f('0x31')](_0x51f0a0,_0x5031ae)[_0x413f('0x32')]();case _0x413f('0x17'):var _0x263269=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1[_0x413f('0x37')]){var _0x53b81f={};_0x53b81f[_0x5575d1[_0x413f('0x37')]]=_0x527914;_[_0x413f('0x2e')](_0x263269['$or'],_0x53b81f);}return _0x56c765[_0x413f('0x1b')](_0x413f('0x33'))['find'](_0x263269,_0x5031ae);case _0x413f('0x12'):var _0x41e43d=_[_0x413f('0x2c')](_0x143d3a);if(_0x5575d1[_0x413f('0x35')]){var _0x53b81f={};_0x53b81f[_0x5575d1[_0x413f('0x35')]]=_0x527914;_[_0x413f('0x2e')](_0x41e43d['$or'],_0x53b81f);}return _0x56c765['sobject'](_0x413f('0x36'))['find'](_0x41e43d,_0x5031ae);default:return null;}})[_0x413f('0x20')](function(_0x46251a){if(_0x46251a&&_0x46251a[_0x413f('0x21')]){var _0x3c5c74=_[_0x413f('0x38')](_0x46251a);if(_0x3c5c74){return BPromise[_0x413f('0x23')]({'id':_0x3c5c74['Id'],'name':_0x3c5c74[_0x413f('0x24')],'phone':_0x3c5c74[_0x413f('0x39')],'endUserType':_0x3c5c74[_0x413f('0x3a')][_0x413f('0x3b')][_0x413f('0x3c')]()});}}})['then'](function(_0x23f978){if(_0x23f978){logger['info'](_0x413f('0x3d'),_0x23f978[_0x413f('0xf')],_0x527914);return BPromise[_0x413f('0x23')](_0x23f978);}else{logger[_0x413f('0x19')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x527914);var _0x3c1ab8={'Phone':_0x527914};if(_0x5575d1[_0x413f('0x3e')]){if(_0x5575d1['moduleCreate']===_0x413f('0x10')){logger[_0x413f('0x19')](_0x413f('0x3f'),_0x527914,_0x5575d1[_0x413f('0x3e')]);_0x3c1ab8[_0x413f('0x40')]=_0x139bdb!==_0x413f('0x41')?_0x139bdb:util[_0x413f('0x42')](_0x413f('0x43'),_0x527914);}else if(_0x5575d1['moduleCreate']==='lead'){logger[_0x413f('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x527914,_0x5575d1[_0x413f('0x3e')]);_0x3c1ab8[_0x413f('0x40')]=_0x139bdb!==_0x413f('0x41')?_0x139bdb:util[_0x413f('0x42')](_0x413f('0x43'),_0x527914);_0x3c1ab8[_0x413f('0x44')]=_0x413f('0x45');}else if(_0x5575d1['moduleCreate']===_0x413f('0x12')){logger[_0x413f('0x19')](_0x413f('0x3f'),_0x527914,_0x5575d1['moduleCreate']);_0x3c1ab8[_0x413f('0x24')]=_0x139bdb!==''?_0x139bdb:util[_0x413f('0x42')](_0x413f('0x43'),_0x527914);}else{return null;}}return _0x56c765[_0x413f('0x1b')](_['upperFirst'](_0x5575d1[_0x413f('0x3e')]))[_0x413f('0x1c')](_0x3c1ab8)[_0x413f('0x20')](function(_0x1a6a3f){return BPromise['resolve']({'id':_0x1a6a3f['id'],'endUserType':_0x5575d1['moduleCreate']});});}});}function getCustomFields(_0x697e59,_0x43b2bc){var _0x4901fe={};if(_0x697e59[_0x413f('0x21')]>0x0){_[_0x413f('0x46')](_0x697e59,function(_0x375378){if(_['includes']([_0x413f('0x47'),_0x413f('0x48')],_0x375378[_0x413f('0x3b')])&&_0x375378[_0x413f('0x49')]){_0x4901fe[_0x375378[_0x413f('0x49')]]=_0x375378[_0x413f('0x4a')][_0x413f('0x4b')]();}else if(_0x375378[_0x413f('0x3b')]===_0x413f('0x4c')&&_0x375378[_0x413f('0x4d')]&&_0x375378[_0x413f('0x49')]){_0x43b2bc[_0x375378['variableName']]&&(_0x4901fe[_0x375378[_0x413f('0x49')]]=_0x43b2bc[_0x375378[_0x413f('0x4d')]][_0x413f('0x4b')]());}else if(_0x375378['type']===_0x413f('0x4e')&&_0x375378[_0x413f('0x4f')]&&_0x375378[_0x413f('0x4f')][_0x413f('0x50')]&&_0x375378['idField']){_0x43b2bc[_0x375378[_0x413f('0x4f')]['name'][_0x413f('0x3c')]()]&&(_0x4901fe[_0x375378[_0x413f('0x49')]]=_0x43b2bc[_0x375378['Variable'][_0x413f('0x50')]['toLowerCase']()][_0x413f('0x4b')]());}});}return _0x4901fe;}function getConnection(_0xd8eefa){var _0x30590a=_0xd8eefa[_0x413f('0x51')]['concat'](_0xd8eefa[_0x413f('0x52')]);var _0x5a29f9=new jsforce[(_0x413f('0x53'))]({'oauth2':{'loginUrl':_0xd8eefa[_0x413f('0x54')]||_0x413f('0x55'),'clientId':_0xd8eefa[_0x413f('0x56')],'clientSecret':_0xd8eefa[_0x413f('0x57')]}});return _0x5a29f9[_0x413f('0x58')](_0xd8eefa['username'],_0x30590a)[_0x413f('0x20')](function(){logger[_0x413f('0x19')](_0x413f('0x59'));return _0x5a29f9;});}exports[_0x413f('0x5a')]=function(_0x1c74fd,_0x416514,_0x2c0f79,_0x2051c7,_0x1d21c1,_0x27d9cb){var _0x3fd9a7,_0x1c4dcd,_0xaf7d3d,_0x28186d;_0x27d9cb[_0x413f('0x5b')]=intUtil[_0x413f('0x5c')](_0x27d9cb[_0x413f('0x5b')]);_0x27d9cb[_0x413f('0x54')]=intUtil[_0x413f('0x5c')](_0x27d9cb['remoteUri']);if(_0x1d21c1&&_0x1d21c1['monitor_format']){logger[_0x413f('0x19')]('[QUEUE]',_0x413f('0x5d'));_0x416514[_0x413f('0x5e')]=util['format'](_0x413f('0x5f'),_0x27d9cb[_0x413f('0x5b')],_0x416514[_0x413f('0x60')],md5(_0x416514[_0x413f('0x60')]));}else{_0x416514[_0x413f('0x5e')]='';}return getConnection(_0x27d9cb)[_0x413f('0x20')](function(_0x1bc73f){_0x28186d=_0x1bc73f;return getUser(_0x27d9cb,_0x2051c7[_0x413f('0x61')],_0x28186d);})[_0x413f('0x20')](function(_0x163ba9){_0x3fd9a7=_0x163ba9;return getEndUser(_0x27d9cb,_0x2c0f79,_0x416514[_0x413f('0x62')],_0x416514[_0x413f('0x63')],_0x28186d);})[_0x413f('0x20')](function(_0x31cf49){_0x1c4dcd=_0x31cf49;return getTicket(_0x27d9cb,_0x3fd9a7,_0x1c4dcd,_0x2c0f79,_0x416514,_0x2c0f79[_0x413f('0x64')],_0x28186d,'queue');})['then'](function(_0x165f4d){_0xaf7d3d=_0x165f4d;logger[_0x413f('0x19')](_0x413f('0x65'),_0xaf7d3d['id']);logger[_0x413f('0x19')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xaf7d3d['id'],_0x2051c7[_0x413f('0x50')],_0x27d9cb[_0x413f('0x3b')]);switch(_0x27d9cb[_0x413f('0x3b')]){case'integrationTab':emit(util[_0x413f('0x42')](_0x413f('0x66'),_0x2051c7[_0x413f('0x50')]),_0x413f('0x67'),{'recordId':_0xaf7d3d['id']});break;case _0x413f('0x68'):emit(util[_0x413f('0x42')](_0x413f('0x66'),_0x2051c7[_0x413f('0x50')]),_0x413f('0x69'),{'uri':util['format'](_0x413f('0x6a'),_0x28186d[_0x413f('0x6b')],_0xaf7d3d['id'])});break;default:logger['error'](_0x413f('0x6c'));}})['catch'](function(_0x14e8bd){logger[_0x413f('0x6d')](_0x413f('0x6e'),_0x14e8bd);});};exports[_0x413f('0x6f')]=function(_0x2d0778,_0x155430,_0x519878,_0x153b0c,_0xf7b076,_0x37cb3f,_0x2bb5dd){var _0x5b93ba,_0x9fbe60,_0x4fd164,_0x7c349a;_0x37cb3f[_0x413f('0x5b')]=intUtil['stripTrailingSlash'](_0x37cb3f['serverUrl']);_0x37cb3f['remoteUri']=intUtil['stripTrailingSlash'](_0x37cb3f[_0x413f('0x54')]);if(_0x2bb5dd&&_0x2bb5dd[_0x413f('0x70')]&&_0x2bb5dd[_0x413f('0x70')]!==_0x413f('0x71')){logger[_0x413f('0x19')](_0x413f('0x72'),_0x413f('0x5d'));_0x155430[_0x413f('0x5e')]=util[_0x413f('0x42')](_0x413f('0x5f'),_0x37cb3f[_0x413f('0x5b')],_0x155430[_0x413f('0x60')],md5(_0x155430[_0x413f('0x60')]));}return getConnection(_0x37cb3f)[_0x413f('0x20')](function(_0x42ee4f){_0x7c349a=_0x42ee4f;return getUser(_0x37cb3f,_0x153b0c[_0x413f('0x61')],_0x7c349a);})[_0x413f('0x20')](function(_0x5ed2c5){_0x5b93ba=_0x5ed2c5;return getEndUser(_0x37cb3f,_0x519878,_0x155430['destcalleridname'],_0x155430[_0x413f('0x73')],_0x7c349a);})[_0x413f('0x20')](function(_0x31b42c){_0x9fbe60=_0x31b42c;return getTicket(_0x37cb3f,_0x5b93ba,_0x9fbe60,_0x519878,_0x155430,_0x519878[_0x413f('0x64')],_0x7c349a,_0x413f('0x6f'));})['then'](function(_0x215177){_0x4fd164=_0x215177;logger[_0x413f('0x19')](_0x413f('0x74'),_0x4fd164['id']);logger[_0x413f('0x19')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4fd164['id'],_0x153b0c[_0x413f('0x50')],_0x37cb3f[_0x413f('0x3b')]);switch(_0x37cb3f[_0x413f('0x3b')]){case _0x413f('0x75'):emit(util[_0x413f('0x42')](_0x413f('0x66'),_0x153b0c[_0x413f('0x50')]),_0x413f('0x67'),{'recordId':_0x4fd164['id']});break;case _0x413f('0x68'):emit(util[_0x413f('0x42')]('user:%s',_0x153b0c['name']),'trigger:browser:url',{'uri':util[_0x413f('0x42')](_0x413f('0x6a'),_0x7c349a['instanceUrl'],_0x4fd164['id'])});break;default:logger[_0x413f('0x6d')](_0x413f('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x1869c3){logger[_0x413f('0x6d')](_0x413f('0x72'),_0x1869c3);});};exports[_0x413f('0x76')]=function(_0x2d11b1,_0x1f33fa,_0x465912,_0x2a81e9,_0x3a5417,_0x5d0ea4){var _0x3e0e52,_0x516242,_0xf8f17a,_0x36e999;_0x5d0ea4[_0x413f('0x5b')]=intUtil['stripTrailingSlash'](_0x5d0ea4['serverUrl']);_0x5d0ea4[_0x413f('0x54')]=intUtil[_0x413f('0x5c')](_0x5d0ea4[_0x413f('0x54')]);if(_0x3a5417&&_0x3a5417['monitor_format']){logger[_0x413f('0x19')]('['+_0x1f33fa[_0x413f('0x77')][_0x413f('0x78')]()+']',_0x413f('0x5d'));_0x1f33fa[_0x413f('0x5e')]=util[_0x413f('0x42')](_0x413f('0x5f'),_0x5d0ea4[_0x413f('0x5b')],_0x1f33fa[_0x413f('0x60')],md5(_0x1f33fa[_0x413f('0x60')]));}else{_0x1f33fa[_0x413f('0x5e')]='';}return getConnection(_0x5d0ea4)[_0x413f('0x20')](function(_0xe3c0e9){_0x36e999=_0xe3c0e9;if(!_[_0x413f('0x1d')](_0x2a81e9)){return getUser(_0x5d0ea4,_0x2a81e9[_0x413f('0x50')],_0x36e999);}else{return getUser(_0x5d0ea4,null,_0x36e999);}})[_0x413f('0x20')](function(_0x597ae7){_0x3e0e52=_0x597ae7;return getEndUser(_0x5d0ea4,_0x465912,_0x1f33fa['calleridname'],_0x1f33fa[_0x413f('0x63')],_0x36e999);})[_0x413f('0x20')](function(_0x4ed129){_0x516242=_0x4ed129;return getTicket(_0x5d0ea4,_0x3e0e52,_0x516242,_0x465912,_0x1f33fa,_0x465912[_0x413f('0x64')],_0x36e999);})[_0x413f('0x20')](function(_0x2fa536){_0xf8f17a=_0x2fa536;logger[_0x413f('0x19')]('['+_0x1f33fa['lastevent']['toUpperCase']()+_0x413f('0x79'),_0xf8f17a['id']);logger[_0x413f('0x19')]('['+_0x1f33fa[_0x413f('0x77')]['toUpperCase']()+_0x413f('0x7a'),_0x5d0ea4['type']);})[_0x413f('0x7b')](function(_0x4dedd1){logger[_0x413f('0x6d')]('['+_0x1f33fa[_0x413f('0x77')][_0x413f('0x78')]()+']',_0x4dedd1);});}; \ 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 b4a6b89..efee3a3 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 _0xc886=[']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%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','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userEmail','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','content','toString','type','idField','variable','variableName','Variable','name','toLowerCase',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','Descriptions'];(function(_0x5e2128,_0xe2107e){var _0x2bbc88=function(_0x23ce4d){while(--_0x23ce4d){_0x5e2128['push'](_0x5e2128['shift']());}};_0x2bbc88(++_0xe2107e);}(_0xc886,0x9d));var _0x6c88=function(_0x55056f,_0x4eb350){_0x55056f=_0x55056f-0x0;var _0x5ca300=_0xc886[_0x55056f];return _0x5ca300;};'use strict';var _=require(_0x6c88('0x0'));var Promise=require('bluebird');var rp=require(_0x6c88('0x1'));var util=require(_0x6c88('0x2'));var md5=require(_0x6c88('0x3'));var Redis=require(_0x6c88('0x4'));var intUtil=require(_0x6c88('0x5'));var config=require(_0x6c88('0x6'));var logger=require(_0x6c88('0x7'))(_0x6c88('0x8'));config['redis']=_[_0x6c88('0x9')](config[_0x6c88('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x6c88('0xb'))(new Redis(config[_0x6c88('0xa')]));function getAdminUser(_0x41faad,_0x309b1d,_0x116d00,_0x2ab475,_0x4d808a,_0x3ec17e){return new Promise(function(_0x5ae3c8,_0x1d61c2){var _0x1d28b0={'method':_0x6c88('0xc'),'uri':_0x2ab475+_0x6c88('0xd')+'&'+_0x4d808a+'&'+_0x3ec17e,'auth':_0x309b1d,'json':!![]};return rp(_0x1d28b0)[_0x6c88('0xe')](function(_0x289b13){if(_0x289b13[_0x6c88('0xf')][_0x6c88('0x10')]>0x0){_0x116d00[_0x6c88('0x11')]=_0x289b13[_0x6c88('0xf')][0x0][_0x6c88('0x12')];}logger[_0x6c88('0x13')]('['+[_0x41faad[_0x6c88('0x14')]()]+'],\x20getAdminUser\x20crm',_0x116d00);_0x5ae3c8(_0x116d00);})[_0x6c88('0x15')](function(_0x102855){logger[_0x6c88('0x16')]('['+[_0x41faad['toUpperCase']()]+']',_0x102855[_0x6c88('0x17')]);_0x1d61c2(_0x102855[_0x6c88('0x17')]);});});}function getUser(_0x542c26,_0x880f33,_0x46f054,_0x455761,_0x571419){return function(_0x3b579c){logger[_0x6c88('0x13')]('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x18'),_0x3b579c);return new Promise(function(_0xbdcb27,_0x28cfb4){if(intUtil[_0x6c88('0x19')](_0x3b579c['userEmail'])){var _0x263231={'method':_0x6c88('0xc'),'uri':_0x46f054+_0x6c88('0x1a')+_0x3b579c['userEmail']+'&'+_0x455761+'&'+_0x571419,'auth':_0x880f33,'json':!![]};logger['info']('['+[_0x542c26['toUpperCase']()]+_0x6c88('0x1b'),_0x263231);return rp(_0x263231)[_0x6c88('0xe')](function(_0x2ffeb1){logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+'],\x20getUser\x20entity',_0x2ffeb1);if(_0x2ffeb1[_0x6c88('0xf')][_0x6c88('0x10')]>0x0&&String(_0x2ffeb1[_0x6c88('0xf')][0x0][_0x6c88('0x1c')])===_0x6c88('0x1d')){_0x3b579c[_0x6c88('0x1e')]=_0x2ffeb1['result'][0x0][_0x6c88('0x12')];}else{_0x3b579c[_0x6c88('0x1e')]=_0x3b579c[_0x6c88('0x11')];_0x3b579c['userEmail']=_0x3b579c[_0x6c88('0x1f')];}logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x20'),_0x3b579c);_0xbdcb27(_0x3b579c);})[_0x6c88('0x15')](function(_0x51da04){logger['error']('['+[_0x542c26[_0x6c88('0x14')]()]+']',_0x51da04[_0x6c88('0x17')]);_0x28cfb4(_0x51da04['message']);});}else{logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x21'));_0x3b579c[_0x6c88('0x1e')]=_0x3b579c[_0x6c88('0x11')];_0x3b579c[_0x6c88('0x22')]=_0x3b579c['adminEmail'];_0xbdcb27(_0x3b579c);}});};}function createEndUser(_0x80b825,_0x8b845e,_0x3cfdf3,_0x3044d4,_0xc87af){logger[_0x6c88('0x13')]('['+[_0x80b825[_0x6c88('0x14')]()]+_0x6c88('0x23'),_0x3cfdf3);return new Promise(function(_0x533e1e,_0x21c2fe){var _0x30513a={'method':'POST','uri':_0x3044d4+'sys_user?'+_0xc87af,'body':{'user_name':_0x3cfdf3[_0x6c88('0x24')],'roles':_0x6c88('0x25'),'first_name':_0x3cfdf3['endUserNumber'],'active':'true','date_format':_0x6c88('0x26'),'phone':_0x3cfdf3[_0x6c88('0x24')]},'auth':_0x8b845e,'json':!![]};return rp(_0x30513a)[_0x6c88('0xe')](function(_0x3970d0){logger[_0x6c88('0x13')]('['+[_0x80b825['toUpperCase']()]+'],\x20EndUser\x20schema',_0x3970d0[_0x6c88('0xf')]);_0x3cfdf3[_0x6c88('0x27')]=_0x3970d0['result'][_0x6c88('0x12')];_0x533e1e(_0x3cfdf3);})['catch'](function(_0x49328e){logger['error']('['+[_0x80b825[_0x6c88('0x14')]()]+']',_0x49328e[_0x6c88('0x17')]);_0x21c2fe(_0x49328e[_0x6c88('0x17')]);});});}function getEndUser(_0x251293,_0x13de04,_0x5e24c5,_0x3c3c60,_0x2587e3){return function(_0xd58459){logger[_0x6c88('0x13')]('['+[_0x251293[_0x6c88('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0xd58459);return new Promise(function(_0x101fa6,_0x3a609a){var _0x2e173f={'method':_0x6c88('0xc'),'uri':_0x5e24c5+'sys_user?sysparm_query=phone%3D'+_0xd58459[_0x6c88('0x24')]+'&'+_0x3c3c60+'&'+_0x2587e3,'auth':_0x13de04,'json':!![]};return rp(_0x2e173f)['then'](function(_0x296fed){if(_0x296fed['result']['length']>0x0){_0xd58459['endUserId']=_0x296fed[_0x6c88('0xf')][0x0][_0x6c88('0x12')];logger['info']('['+[_0x251293[_0x6c88('0x14')]()]+'],\x20getEndUser\x20crm',_0xd58459);_0x101fa6(_0xd58459);}else{return createEndUser(_0x251293,_0x13de04,_0xd58459,_0x5e24c5,_0x3c3c60)[_0x6c88('0xe')](function(_0x657d0b){logger[_0x6c88('0x13')]('['+[_0x251293[_0x6c88('0x14')]()]+_0x6c88('0x28'),_0x657d0b);_0x101fa6(_0x657d0b);});}})['catch'](function(_0x5a3f0c){logger[_0x6c88('0x16')]('['+[_0x251293[_0x6c88('0x14')]()]+']',_0x5a3f0c[_0x6c88('0x17')]);_0x3a609a(_0x5a3f0c[_0x6c88('0x17')]);});});};}function getCustomFields(_0x4fcebf,_0x2797c0){var _0x4b32d6={};if(_0x4fcebf[_0x6c88('0x10')]>0x0){_[_0x6c88('0x29')](_0x4fcebf,function(_0x2c3429){if(_[_0x6c88('0x2a')]([_0x6c88('0x2b'),_0x6c88('0x2c')],_0x2c3429['type'])&&_0x2c3429[_0x6c88('0x2d')]&&!_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429[_0x6c88('0x2d')]['toLowerCase']()]=_0x2c3429[_0x6c88('0x2f')][_0x6c88('0x30')]();}else if(_[_0x6c88('0x2a')]([_0x6c88('0x2b'),_0x6c88('0x2c')],_0x2c3429[_0x6c88('0x31')])&&_0x2c3429['idField']&&_0x2c3429['customField']){_0x4b32d6[_0x2c3429[_0x6c88('0x32')]['toLowerCase']()]=_0x2c3429[_0x6c88('0x2f')]['toString']();}else if(_0x2c3429[_0x6c88('0x31')]===_0x6c88('0x33')&&_0x2c3429['variableName']&&_0x2c3429[_0x6c88('0x32')]&&_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429['idField']['toLowerCase']()]=_0x2797c0[_0x2c3429[_0x6c88('0x34')]]['toString']();}else if(_0x2c3429[_0x6c88('0x31')]==='customVariable'&&_0x2c3429[_0x6c88('0x35')]&&_0x2c3429[_0x6c88('0x35')][_0x6c88('0x36')]&&_0x2c3429[_0x6c88('0x32')]&&_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429[_0x6c88('0x32')][_0x6c88('0x37')]()]=_0x2797c0[_0x2c3429[_0x6c88('0x35')][_0x6c88('0x36')]['toLowerCase']()][_0x6c88('0x30')]();}});}return _0x4b32d6;}function getTicket(_0x41272f,_0x2b5efb,_0x1faa34,_0x5752af,_0x2c679c,_0x566697){return function(_0x3aed79){logger['info']('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x38'),_0x3aed79);return new Promise(function(_0x1996c4,_0x187963){var _0x47fb65=_0x41272f['toLowerCase']()===_0x6c88('0x39')?_0x3aed79[_0x6c88('0x1e')]:_0x3aed79[_0x6c88('0x27')];var _0x273048={'method':'POST','uri':_0x1faa34+_0x6c88('0x3a')+'?'+_0x566697,'body':Object['assign']({},{'active':_0x6c88('0x1d'),'caller_id':_0x47fb65,'assigned_to':_0x3aed79[_0x6c88('0x1e')],'short_description':intUtil['getString'](_0x5752af[_0x6c88('0x3b')],_0x2c679c,'\x20'),'description':intUtil['getString'](_0x5752af[_0x6c88('0x3c')],_0x2c679c,'\x0a')},getCustomFields(_0x5752af['Fields'],_0x2c679c)),'auth':_0x2b5efb,'json':!![]};return rp(_0x273048)['then'](function(_0x1597a2){logger[_0x6c88('0x13')]('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x3d'),_0x1597a2['result']);_0x3aed79[_0x6c88('0x3e')]=_0x1597a2[_0x6c88('0xf')][_0x6c88('0x12')];_0x3aed79[_0x6c88('0x3f')]=_0x1597a2[_0x6c88('0xf')][_0x6c88('0x40')];logger['info']('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x41'),_0x3aed79);_0x1996c4(_0x3aed79);})[_0x6c88('0x15')](function(_0x381ab0){logger[_0x6c88('0x16')]('['+[_0x41272f[_0x6c88('0x14')]()]+']',_0x381ab0[_0x6c88('0x17')]);_0x187963(_0x381ab0['message']);});});};}function createRemoteTag(_0x3eb9d1,_0x5582d0,_0x5bc9ed,_0x29aca2){return new Promise(function(_0x52b2a2,_0x32e9c2){var _0x3731d1={'method':_0x6c88('0x42'),'uri':_0x5bc9ed+'label'+'?'+_0x29aca2,'body':{'short_description':_0x3eb9d1,'global':!![],'active':!![],'name':_0x3eb9d1},'auth':_0x5582d0,'json':!![]};return rp(_0x3731d1)[_0x6c88('0xe')](function(_0x3e8df8){var _0x34b3c2=_0x3e8df8['result']['sys_id'];_0x52b2a2(_0x34b3c2);});});}function getRemoteTag(_0x2f5350,_0x442d4b,_0x21e117,_0x11168c,_0x157220){return new Promise(function(_0x507d58,_0x5bdc2e){var _0x8177fc={'method':_0x6c88('0xc'),'uri':_0x21e117+_0x6c88('0x43')+_0x6c88('0x44')+_0x2f5350+'&'+_0x11168c,'auth':_0x442d4b,'json':!![]};return rp(_0x8177fc)[_0x6c88('0xe')](function(_0x59bb53){if(_0x59bb53[_0x6c88('0xf')][_0x6c88('0x10')]>0x0){var _0x4a45f7=_0x59bb53[_0x6c88('0xf')][0x0]['sys_id'];_0x507d58(_0x4a45f7);}else{return createRemoteTag(_0x2f5350,_0x442d4b,_0x21e117,_0x11168c)[_0x6c88('0xe')](function(_0x5d5bfe){_0x507d58(_0x5d5bfe);});}});});}function assignTagToIncident(_0x343bbb,_0x164431,_0x455df7,_0x3de653,_0xa6005a){return new Promise(function(_0x1697c4,_0x1e26d5){var _0x593143={'method':'POST','uri':_0x455df7+_0x6c88('0x45')+'?'+_0xa6005a,'body':{'label':_0x343bbb,'table':'incident','id_type':_0x6c88('0x46'),'table_key':_0x3de653[_0x6c88('0x3e')],'title':'Incident\x20-\x20'+_0x3de653[_0x6c88('0x3f')],'id_display':_0x3de653['ticketNumber']},'auth':_0x164431,'json':!![]};return rp(_0x593143)[_0x6c88('0xe')](function(_0x4b2e4b){_0x1697c4();})[_0x6c88('0x15')](function(){_0x1697c4();});});}function manageTags(_0xec2a4,_0x49355f,_0x3c07db,_0x106e18,_0xc79782,_0x2e158,_0x5856d9){return new Promise(function(_0x3b92f1,_0x242183){var _0x3a33fa=[];_0x49355f[_0x6c88('0x29')](function(_0x5b0e6b){_0x3a33fa[_0x6c88('0x47')](getRemoteTag(_0x5b0e6b,_0x3c07db,_0x106e18,_0x2e158,_0x5856d9));});return Promise[_0x6c88('0x48')](_0x3a33fa)['then'](function(_0x3b3b77){if(_0x3b3b77['length']){logger['info']('['+[_0xec2a4[_0x6c88('0x14')]()]+_0x6c88('0x49'),_0x3b3b77);var _0x3bf195=[];_0x3b3b77[_0x6c88('0x29')](function(_0x9b9b25){_0x3bf195[_0x6c88('0x47')](assignTagToIncident(_0x9b9b25,_0x3c07db,_0x106e18,_0xc79782,_0x2e158));});return Promise['all'](_0x3bf195)['then'](function(){_0x3b92f1();})['catch'](function(){_0x3b92f1();});}else{_0x3b92f1();}});});}function getTags(_0x2d3c93,_0x2486d5,_0xa5fda6,_0x1501aa,_0x54754f,_0x147856){return function(_0x4ad771){return new Promise(function(_0x289db6,_0x1cf594){var _0x20f8d6=[];var _0x3e0926=_0x1501aa[_0x6c88('0x4a')];if(_0x3e0926&&_0x3e0926[_0x6c88('0x10')]>0x0){_0x20f8d6=_['map'](_0x3e0926,_0x6c88('0x36'));}if(_0x20f8d6[_0x6c88('0x10')]>0x0){return manageTags(_0x2d3c93,_0x20f8d6,_0x2486d5,_0xa5fda6,_0x4ad771,_0x54754f,_0x147856)[_0x6c88('0xe')](function(){_0x289db6(_0x4ad771);});}else{_0x289db6(_0x4ad771);}});};}function emit(_0x4d9e52,_0x477ae9,_0x43093e){var _0x53c4f4=_0x6c88('0x4b')+_0x6c88('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x6c88('0x4d');var _0x580717={'uri':_0x4d9e52+_0x6c88('0x4e')+_0x43093e+_0x53c4f4};io['to'](util[_0x6c88('0x4f')](_0x6c88('0x50'),_0x477ae9))[_0x6c88('0x51')]('trigger:browser:url',_0x580717);}exports['cs']=function(_0x48583d,_0x5a717b,_0x212989,_0x4792ae,_0xcec883,_0x463db9,_0x19dd55,_0x5b85dd){var _0x47b1df={};var _0x1108f2={'user':_0x463db9[_0x6c88('0x52')],'pass':_0x463db9[_0x6c88('0x53')]};var _0x1348b0=_0x6c88('0x54');var _0x8a2d4=_0x6c88('0x55');_0x463db9['remoteUri']=intUtil[_0x6c88('0x56')](_0x463db9[_0x6c88('0x57')]);_0x463db9['serverUrl']=intUtil[_0x6c88('0x56')](_0x463db9[_0x6c88('0x58')]);var _0x50432e=util[_0x6c88('0x4f')](_0x6c88('0x59'),_0x463db9[_0x6c88('0x57')]);_0x47b1df[_0x6c88('0x22')]=!_[_0x6c88('0x5a')](_0x4792ae)?_0x4792ae[_0x6c88('0x5b')]:null;_0x47b1df[_0x6c88('0x1f')]=_0x463db9['email'];_0x47b1df[_0x6c88('0x24')]=_0x5b85dd[_0x6c88('0x37')]()===_0x6c88('0x39')?_0x5a717b[_0x6c88('0x5c')]:_0x5a717b[_0x6c88('0x5d')];_0x47b1df['callDirection']=_0x5b85dd===_0x6c88('0x5e')||_0x5b85dd===_0x6c88('0x5f')?_0x6c88('0x5e'):_0x6c88('0x39');var _0x1516e3=util[_0x6c88('0x4f')](_0x6c88('0x60'),_0x463db9['serverUrl'],_0x5a717b['uniqueid'],md5(_0x5a717b[_0x6c88('0x61')]));if(_0xcec883&&_0xcec883[_0x6c88('0x62')]){logger[_0x6c88('0x13')](_0x6c88('0x63'),_0x6c88('0x64'));_0x5a717b[_0x6c88('0x65')]=_0x1516e3;}else if(_0x19dd55&&_0x19dd55[_0x6c88('0x66')]&&_0x19dd55['recordingFormat']!==_0x6c88('0x67')){logger[_0x6c88('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5a717b['recordingURL']=_0x1516e3;}else{_0x5a717b[_0x6c88('0x65')]='';}return getAdminUser(_0x5b85dd,_0x1108f2,_0x47b1df,_0x50432e,_0x8a2d4,_0x1348b0)['then'](getUser(_0x5b85dd,_0x1108f2,_0x50432e,_0x8a2d4,_0x1348b0))['then'](getEndUser(_0x5b85dd,_0x1108f2,_0x50432e,_0x8a2d4,_0x1348b0))[_0x6c88('0xe')](getTicket(_0x5b85dd,_0x1108f2,_0x50432e,_0x212989,_0x5a717b,_0x8a2d4))['then'](function(_0x9545c8){logger[_0x6c88('0x13')](util[_0x6c88('0x4f')](_0x6c88('0x68'),_0x9545c8[_0x6c88('0x3e')]));logger['info'](util[_0x6c88('0x4f')](_0x6c88('0x69'),_0x5b85dd));if(_0x5b85dd!==_0x6c88('0x5f')){logger['info']('['+[_0x5b85dd[_0x6c88('0x14')]()]+']',_0x6c88('0x6a'));emit(_0x463db9[_0x6c88('0x57')],_0x4792ae[_0x6c88('0x36')],_0x9545c8[_0x6c88('0x3e')]);}})[_0x6c88('0x15')](function(_0x6ad7eb){logger[_0x6c88('0x16')]('['+[_0x5b85dd[_0x6c88('0x14')]()]+_0x6c88('0x6b'),util[_0x6c88('0x6c')](_0x6ad7eb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x35cc=['includes','picklist','type','nameField','customField','content','string','idField','toLowerCase','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','Incident','ticketId','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','localhost','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','info','toUpperCase','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','catch','forEach'];(function(_0x4e387a,_0x241c2f){var _0x6df7e4=function(_0x3b7d4c){while(--_0x3b7d4c){_0x4e387a['push'](_0x4e387a['shift']());}};_0x6df7e4(++_0x241c2f);}(_0x35cc,0x1e6));var _0xc35c=function(_0x406e00,_0x13278f){_0x406e00=_0x406e00-0x0;var _0x263fc7=_0x35cc[_0x406e00];return _0x263fc7;};'use strict';var _=require(_0xc35c('0x0'));var Promise=require(_0xc35c('0x1'));var rp=require(_0xc35c('0x2'));var util=require(_0xc35c('0x3'));var md5=require('md5');var Redis=require(_0xc35c('0x4'));var intUtil=require(_0xc35c('0x5'));var config=require(_0xc35c('0x6'));var logger=require(_0xc35c('0x7'))(_0xc35c('0x8'));config['redis']=_[_0xc35c('0x9')](config['redis'],{'host':_0xc35c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc35c('0xb')]));function getAdminUser(_0x55ceaa,_0x3af666,_0x1bf169,_0x200dfb,_0xe82bcb,_0x20adc0){return new Promise(function(_0xea0404,_0x5653ba){var _0x50747b={'method':_0xc35c('0xc'),'uri':_0x200dfb+_0xc35c('0xd')+'&'+_0xe82bcb+'&'+_0x20adc0,'auth':_0x3af666,'json':!![]};return rp(_0x50747b)[_0xc35c('0xe')](function(_0x52fc40){if(_0x52fc40['result'][_0xc35c('0xf')]>0x0){_0x1bf169[_0xc35c('0x10')]=_0x52fc40['result'][0x0][_0xc35c('0x11')];}logger[_0xc35c('0x12')]('['+[_0x55ceaa[_0xc35c('0x13')]()]+'],\x20getAdminUser\x20crm',_0x1bf169);_0xea0404(_0x1bf169);})['catch'](function(_0x4df874){logger[_0xc35c('0x14')]('['+[_0x55ceaa['toUpperCase']()]+']',_0x4df874['message']);_0x5653ba(_0x4df874[_0xc35c('0x15')]);});});}function getUser(_0x16eed9,_0x5998ae,_0x211c57,_0xbc71fd,_0x441508){return function(_0x325fad){logger[_0xc35c('0x12')]('['+[_0x16eed9['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x325fad);return new Promise(function(_0x59201f,_0x29a80c){if(intUtil['validateEmail'](_0x325fad[_0xc35c('0x16')])){var _0x5ea045={'method':_0xc35c('0xc'),'uri':_0x211c57+_0xc35c('0x17')+_0x325fad[_0xc35c('0x16')]+'&'+_0xbc71fd+'&'+_0x441508,'auth':_0x5998ae,'json':!![]};logger[_0xc35c('0x12')]('['+[_0x16eed9[_0xc35c('0x13')]()]+_0xc35c('0x18'),_0x5ea045);return rp(_0x5ea045)[_0xc35c('0xe')](function(_0x47d77a){logger['info']('['+[_0x16eed9[_0xc35c('0x13')]()]+_0xc35c('0x19'),_0x47d77a);if(_0x47d77a[_0xc35c('0x1a')]['length']>0x0&&String(_0x47d77a[_0xc35c('0x1a')][0x0][_0xc35c('0x1b')])===_0xc35c('0x1c')){_0x325fad[_0xc35c('0x1d')]=_0x47d77a[_0xc35c('0x1a')][0x0][_0xc35c('0x11')];}else{_0x325fad[_0xc35c('0x1d')]=_0x325fad[_0xc35c('0x10')];_0x325fad[_0xc35c('0x16')]=_0x325fad[_0xc35c('0x1e')];}logger[_0xc35c('0x12')]('['+[_0x16eed9[_0xc35c('0x13')]()]+'],\x20getUser\x20crm',_0x325fad);_0x59201f(_0x325fad);})['catch'](function(_0x345cd1){logger[_0xc35c('0x14')]('['+[_0x16eed9[_0xc35c('0x13')]()]+']',_0x345cd1[_0xc35c('0x15')]);_0x29a80c(_0x345cd1[_0xc35c('0x15')]);});}else{logger[_0xc35c('0x12')]('['+[_0x16eed9['toUpperCase']()]+_0xc35c('0x1f'));_0x325fad['userId']=_0x325fad[_0xc35c('0x10')];_0x325fad['userEmail']=_0x325fad[_0xc35c('0x1e')];_0x59201f(_0x325fad);}});};}function createEndUser(_0xb2a439,_0xe32fe6,_0x49c3fb,_0x220390,_0x3a5164){logger[_0xc35c('0x12')]('['+[_0xb2a439[_0xc35c('0x13')]()]+_0xc35c('0x20'),_0x49c3fb);return new Promise(function(_0x51d5a2,_0x15cd95){var _0x125e1b={'method':_0xc35c('0x21'),'uri':_0x220390+_0xc35c('0x22')+_0x3a5164,'body':{'user_name':_0x49c3fb['endUserNumber'],'roles':_0xc35c('0x23'),'first_name':_0x49c3fb[_0xc35c('0x24')],'active':_0xc35c('0x1c'),'date_format':_0xc35c('0x25'),'phone':_0x49c3fb[_0xc35c('0x24')]},'auth':_0xe32fe6,'json':!![]};return rp(_0x125e1b)[_0xc35c('0xe')](function(_0x3e29a3){logger['info']('['+[_0xb2a439[_0xc35c('0x13')]()]+_0xc35c('0x26'),_0x3e29a3[_0xc35c('0x1a')]);_0x49c3fb[_0xc35c('0x27')]=_0x3e29a3[_0xc35c('0x1a')][_0xc35c('0x11')];_0x51d5a2(_0x49c3fb);})['catch'](function(_0x3895b0){logger[_0xc35c('0x14')]('['+[_0xb2a439[_0xc35c('0x13')]()]+']',_0x3895b0['message']);_0x15cd95(_0x3895b0[_0xc35c('0x15')]);});});}function getEndUser(_0x579fcb,_0x176511,_0x1a5539,_0x4acda6,_0x2c9ab8){return function(_0x635e7){logger[_0xc35c('0x12')]('['+[_0x579fcb[_0xc35c('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x635e7);return new Promise(function(_0x2e73db,_0xcb2201){var _0x5e205f={'method':_0xc35c('0xc'),'uri':_0x1a5539+_0xc35c('0x28')+_0x635e7[_0xc35c('0x24')]+'&'+_0x4acda6+'&'+_0x2c9ab8,'auth':_0x176511,'json':!![]};return rp(_0x5e205f)[_0xc35c('0xe')](function(_0x3fceb9){if(_0x3fceb9[_0xc35c('0x1a')]['length']>0x0){_0x635e7[_0xc35c('0x27')]=_0x3fceb9['result'][0x0][_0xc35c('0x11')];logger[_0xc35c('0x12')]('['+[_0x579fcb[_0xc35c('0x13')]()]+'],\x20getEndUser\x20crm',_0x635e7);_0x2e73db(_0x635e7);}else{return createEndUser(_0x579fcb,_0x176511,_0x635e7,_0x1a5539,_0x4acda6)[_0xc35c('0xe')](function(_0x46a2a9){logger[_0xc35c('0x12')]('['+[_0x579fcb[_0xc35c('0x13')]()]+_0xc35c('0x29'),_0x46a2a9);_0x2e73db(_0x46a2a9);});}})[_0xc35c('0x2a')](function(_0x115b0e){logger[_0xc35c('0x14')]('['+[_0x579fcb['toUpperCase']()]+']',_0x115b0e[_0xc35c('0x15')]);_0xcb2201(_0x115b0e['message']);});});};}function getCustomFields(_0x3abd63,_0x4f7cc1){var _0x73dd4f={};if(_0x3abd63['length']>0x0){_[_0xc35c('0x2b')](_0x3abd63,function(_0x43dcc7){if(_[_0xc35c('0x2c')](['string',_0xc35c('0x2d')],_0x43dcc7[_0xc35c('0x2e')])&&_0x43dcc7[_0xc35c('0x2f')]&&!_0x43dcc7[_0xc35c('0x30')]){_0x73dd4f[_0x43dcc7[_0xc35c('0x2f')]['toLowerCase']()]=_0x43dcc7[_0xc35c('0x31')]['toString']();}else if(_[_0xc35c('0x2c')]([_0xc35c('0x32'),_0xc35c('0x2d')],_0x43dcc7['type'])&&_0x43dcc7[_0xc35c('0x33')]&&_0x43dcc7['customField']){_0x73dd4f[_0x43dcc7[_0xc35c('0x33')][_0xc35c('0x34')]()]=_0x43dcc7[_0xc35c('0x31')][_0xc35c('0x35')]();}else if(_0x43dcc7[_0xc35c('0x2e')]==='variable'&&_0x43dcc7[_0xc35c('0x36')]&&_0x43dcc7[_0xc35c('0x33')]&&_0x43dcc7[_0xc35c('0x30')]){_0x73dd4f[_0x43dcc7[_0xc35c('0x33')][_0xc35c('0x34')]()]=_0x4f7cc1[_0x43dcc7[_0xc35c('0x36')]][_0xc35c('0x35')]();}else if(_0x43dcc7[_0xc35c('0x2e')]===_0xc35c('0x37')&&_0x43dcc7[_0xc35c('0x38')]&&_0x43dcc7[_0xc35c('0x38')]['name']&&_0x43dcc7[_0xc35c('0x33')]&&_0x43dcc7[_0xc35c('0x30')]){_0x73dd4f[_0x43dcc7[_0xc35c('0x33')][_0xc35c('0x34')]()]=_0x4f7cc1[_0x43dcc7['Variable'][_0xc35c('0x39')]['toLowerCase']()]['toString']();}});}return _0x73dd4f;}function getTicket(_0x342ae9,_0x3486dc,_0x1a7ebd,_0x1ea6a4,_0x202182,_0xec4473){return function(_0x4f3d3c){logger[_0xc35c('0x12')]('['+[_0x342ae9[_0xc35c('0x13')]()]+_0xc35c('0x3a'),_0x4f3d3c);return new Promise(function(_0x37cc93,_0x4eda95){var _0xad5ef3=_0x342ae9[_0xc35c('0x34')]()===_0xc35c('0x3b')?_0x4f3d3c[_0xc35c('0x1d')]:_0x4f3d3c[_0xc35c('0x27')];var _0x336b01={'method':_0xc35c('0x21'),'uri':_0x1a7ebd+_0xc35c('0x3c')+'?'+_0xec4473,'body':Object[_0xc35c('0x3d')]({},{'active':_0xc35c('0x1c'),'caller_id':_0xad5ef3,'assigned_to':_0x4f3d3c['userId'],'short_description':intUtil[_0xc35c('0x3e')](_0x1ea6a4[_0xc35c('0x3f')],_0x202182,'\x20'),'description':intUtil[_0xc35c('0x3e')](_0x1ea6a4[_0xc35c('0x40')],_0x202182,'\x0a')},getCustomFields(_0x1ea6a4[_0xc35c('0x41')],_0x202182)),'auth':_0x3486dc,'json':!![]};return rp(_0x336b01)[_0xc35c('0xe')](function(_0x5cfaea){logger[_0xc35c('0x12')]('['+[_0x342ae9[_0xc35c('0x13')]()]+_0xc35c('0x42'),_0x5cfaea['result']);_0x4f3d3c['ticketId']=_0x5cfaea[_0xc35c('0x1a')][_0xc35c('0x11')];_0x4f3d3c[_0xc35c('0x43')]=_0x5cfaea[_0xc35c('0x1a')][_0xc35c('0x44')];logger['info']('['+[_0x342ae9[_0xc35c('0x13')]()]+_0xc35c('0x45'),_0x4f3d3c);_0x37cc93(_0x4f3d3c);})[_0xc35c('0x2a')](function(_0x59e819){logger[_0xc35c('0x14')]('['+[_0x342ae9[_0xc35c('0x13')]()]+']',_0x59e819[_0xc35c('0x15')]);_0x4eda95(_0x59e819['message']);});});};}function createRemoteTag(_0x3bff59,_0x81fff8,_0x550fc7,_0x937b39){return new Promise(function(_0x44a6f2,_0x1b8605){var _0x516c53={'method':_0xc35c('0x21'),'uri':_0x550fc7+_0xc35c('0x46')+'?'+_0x937b39,'body':{'short_description':_0x3bff59,'global':!![],'active':!![],'name':_0x3bff59},'auth':_0x81fff8,'json':!![]};return rp(_0x516c53)[_0xc35c('0xe')](function(_0x18ad0d){var _0x20c7c3=_0x18ad0d[_0xc35c('0x1a')][_0xc35c('0x11')];_0x44a6f2(_0x20c7c3);});});}function getRemoteTag(_0x175089,_0x595674,_0x3fb703,_0x373af1,_0x2325fc){return new Promise(function(_0x4731f6,_0x4ebbbf){var _0x10f8d6={'method':_0xc35c('0xc'),'uri':_0x3fb703+'label'+'?sysparm_query=name%3D'+_0x175089+'&'+_0x373af1,'auth':_0x595674,'json':!![]};return rp(_0x10f8d6)[_0xc35c('0xe')](function(_0x334db2){if(_0x334db2[_0xc35c('0x1a')][_0xc35c('0xf')]>0x0){var _0x64d40b=_0x334db2['result'][0x0][_0xc35c('0x11')];_0x4731f6(_0x64d40b);}else{return createRemoteTag(_0x175089,_0x595674,_0x3fb703,_0x373af1)[_0xc35c('0xe')](function(_0x1163c1){_0x4731f6(_0x1163c1);});}});});}function assignTagToIncident(_0x1d1f80,_0x5b88f9,_0x138025,_0x33decf,_0x1109f5){return new Promise(function(_0x2de9f4,_0x3c728d){var _0x11e81a={'method':'POST','uri':_0x138025+'label_entry'+'?'+_0x1109f5,'body':{'label':_0x1d1f80,'table':'incident','id_type':_0xc35c('0x47'),'table_key':_0x33decf[_0xc35c('0x48')],'title':'Incident\x20-\x20'+_0x33decf[_0xc35c('0x43')],'id_display':_0x33decf[_0xc35c('0x43')]},'auth':_0x5b88f9,'json':!![]};return rp(_0x11e81a)['then'](function(_0xe88838){_0x2de9f4();})[_0xc35c('0x2a')](function(){_0x2de9f4();});});}function manageTags(_0x1e12b8,_0x542924,_0x5c39b4,_0x4a281e,_0x483856,_0x20b484,_0x105c66){return new Promise(function(_0x1cb661,_0x2ffb4d){var _0x8fd1a8=[];_0x542924[_0xc35c('0x2b')](function(_0x476f83){_0x8fd1a8[_0xc35c('0x49')](getRemoteTag(_0x476f83,_0x5c39b4,_0x4a281e,_0x20b484,_0x105c66));});return Promise[_0xc35c('0x4a')](_0x8fd1a8)['then'](function(_0x32c38a){if(_0x32c38a[_0xc35c('0xf')]){logger[_0xc35c('0x12')]('['+[_0x1e12b8[_0xc35c('0x13')]()]+_0xc35c('0x4b'),_0x32c38a);var _0xb7365e=[];_0x32c38a[_0xc35c('0x2b')](function(_0x7b14e7){_0xb7365e[_0xc35c('0x49')](assignTagToIncident(_0x7b14e7,_0x5c39b4,_0x4a281e,_0x483856,_0x20b484));});return Promise[_0xc35c('0x4a')](_0xb7365e)['then'](function(){_0x1cb661();})[_0xc35c('0x2a')](function(){_0x1cb661();});}else{_0x1cb661();}});});}function getTags(_0x44f973,_0x343b84,_0x501d7b,_0xbb8523,_0x10c36f,_0x4eb662){return function(_0x419a5b){return new Promise(function(_0x2ef1b5,_0x105509){var _0x281d97=[];var _0x27ce7b=_0xbb8523[_0xc35c('0x4c')];if(_0x27ce7b&&_0x27ce7b[_0xc35c('0xf')]>0x0){_0x281d97=_['map'](_0x27ce7b,_0xc35c('0x39'));}if(_0x281d97[_0xc35c('0xf')]>0x0){return manageTags(_0x44f973,_0x281d97,_0x343b84,_0x501d7b,_0x419a5b,_0x10c36f,_0x4eb662)[_0xc35c('0xe')](function(){_0x2ef1b5(_0x419a5b);});}else{_0x2ef1b5(_0x419a5b);}});};}function emit(_0x584a89,_0xc6eee6,_0x21b3b4){var _0x38d395=_0xc35c('0x4d')+_0xc35c('0x4e')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xc35c('0x4f');var _0x483e21={'uri':_0x584a89+_0xc35c('0x50')+_0x21b3b4+_0x38d395};io['to'](util[_0xc35c('0x51')](_0xc35c('0x52'),_0xc6eee6))['emit']('trigger:browser:url',_0x483e21);}exports['cs']=function(_0x3abc19,_0x3fc27e,_0x36cf4a,_0x1827c1,_0x1b6620,_0x3a1927,_0x1987f3,_0x1f86aa){var _0x454e80={};var _0x14bbb7={'user':_0x3a1927[_0xc35c('0x53')],'pass':_0x3a1927[_0xc35c('0x54')]};var _0x342de7='sysparm_limit=1';var _0x5e3d53=_0xc35c('0x55');_0x3a1927[_0xc35c('0x56')]=intUtil[_0xc35c('0x57')](_0x3a1927[_0xc35c('0x56')]);_0x3a1927[_0xc35c('0x58')]=intUtil[_0xc35c('0x57')](_0x3a1927[_0xc35c('0x58')]);var _0x49fb77=util[_0xc35c('0x51')](_0xc35c('0x59'),_0x3a1927[_0xc35c('0x56')]);_0x454e80['userEmail']=!_['isNil'](_0x1827c1)?_0x1827c1['email']:null;_0x454e80[_0xc35c('0x1e')]=_0x3a1927['email'];_0x454e80[_0xc35c('0x24')]=_0x1f86aa['toLowerCase']()===_0xc35c('0x3b')?_0x3fc27e[_0xc35c('0x5a')]:_0x3fc27e['calleridnum'];_0x454e80[_0xc35c('0x5b')]=_0x1f86aa===_0xc35c('0x5c')||_0x1f86aa===_0xc35c('0x5d')?_0xc35c('0x5c'):_0xc35c('0x3b');var _0x3608f0=util[_0xc35c('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a1927[_0xc35c('0x58')],_0x3fc27e[_0xc35c('0x5e')],md5(_0x3fc27e[_0xc35c('0x5e')]));if(_0x1b6620&&_0x1b6620[_0xc35c('0x5f')]){logger['info']('[QUEUE]',_0xc35c('0x60'));_0x3fc27e['recordingURL']=_0x3608f0;}else if(_0x1987f3&&_0x1987f3['recordingFormat']&&_0x1987f3[_0xc35c('0x61')]!==_0xc35c('0x62')){logger[_0xc35c('0x12')](_0xc35c('0x63'),_0xc35c('0x60'));_0x3fc27e['recordingURL']=_0x3608f0;}else{_0x3fc27e[_0xc35c('0x64')]='';}return getAdminUser(_0x1f86aa,_0x14bbb7,_0x454e80,_0x49fb77,_0x5e3d53,_0x342de7)[_0xc35c('0xe')](getUser(_0x1f86aa,_0x14bbb7,_0x49fb77,_0x5e3d53,_0x342de7))['then'](getEndUser(_0x1f86aa,_0x14bbb7,_0x49fb77,_0x5e3d53,_0x342de7))[_0xc35c('0xe')](getTicket(_0x1f86aa,_0x14bbb7,_0x49fb77,_0x36cf4a,_0x3fc27e,_0x5e3d53))[_0xc35c('0xe')](function(_0x2756ea){logger[_0xc35c('0x12')](util['format'](_0xc35c('0x65'),_0x2756ea[_0xc35c('0x48')]));logger[_0xc35c('0x12')](util[_0xc35c('0x51')](_0xc35c('0x66'),_0x1f86aa));if(_0x1f86aa!==_0xc35c('0x5d')){logger[_0xc35c('0x12')]('['+[_0x1f86aa[_0xc35c('0x13')]()]+']',_0xc35c('0x67'));emit(_0x3a1927[_0xc35c('0x56')],_0x1827c1[_0xc35c('0x39')],_0x2756ea['ticketId']);}})[_0xc35c('0x2a')](function(_0xc4db5f){logger[_0xc35c('0x14')]('['+[_0x1f86aa[_0xc35c('0x13')]()]+_0xc35c('0x68'),util[_0xc35c('0x69')](_0xc4db5f,{'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 49e4717..dd933a7 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 _0x27ce=['slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','customField','nameField','content','custom_fields','customVariable','Variable','toLowerCase','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','toUpperCase','isNil','catch','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','Descriptions','date_start','toISOString'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x27ce,0x1d5));var _0xe27c=function(_0x221c68,_0x4f6d49){_0x221c68=_0x221c68-0x0;var _0x3455b4=_0x27ce[_0x221c68];return _0x3455b4;};'use strict';var _=require(_0xe27c('0x0'));var rp=require(_0xe27c('0x1'));var BPromise=require(_0xe27c('0x2'));var md5=require(_0xe27c('0x3'));var util=require(_0xe27c('0x4'));var Redis=require(_0xe27c('0x5'));var intUtil=require(_0xe27c('0x6'));var config=require(_0xe27c('0x7'));var logger=require('../../../../config/logger')('sugarcrm');config[_0xe27c('0x8')]=_[_0xe27c('0x9')](config[_0xe27c('0x8')],{'host':_0xe27c('0xa'),'port':0x18eb});var io=require(_0xe27c('0xb'))(new Redis(config[_0xe27c('0x8')]));var def={'method':_0xe27c('0xc'),'json':!![]};function emit(_0x22eb75,_0x52fa05,_0xa1419e){io['to'](_0x22eb75)[_0xe27c('0xd')](_0x52fa05,_0xa1419e);}function getTicket(_0xeb72cf,_0x76f46e,_0x580df6,_0x433d02,_0x339248,_0x2f1951,_0x267d01,_0xfae31a){logger[_0xe27c('0xe')](_0xe27c('0xf'));var _0x173d36=new Date();var _0x3ac909=[{'name':_0xe27c('0x10'),'value':intUtil['getString'](_0x433d02[_0xe27c('0x11')],_0x339248,'\x20')},{'name':'assigned_user_id','value':_0x76f46e['id']},{'name':_0xe27c('0x12'),'value':_0x76f46e['id']},{'name':_0xe27c('0x13'),'value':intUtil['getString'](_0x433d02[_0xe27c('0x14')],_0x339248,'\x0a')},{'name':_0xe27c('0x15'),'value':_0x173d36[_0xe27c('0x16')]()[_0xe27c('0x17')](0x0,0x13)[_0xe27c('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe27c('0x19'),'value':'15'},{'name':_0xe27c('0x1a'),'value':_0x580df6['id']},{'name':_0xe27c('0x1b'),'value':_0xe27c('0x1c')},{'name':_0xe27c('0x1d'),'value':_0x580df6[_0xe27c('0x10')]},{'name':_0xe27c('0x1e'),'value':_0xfae31a}];if(_0x2f1951[_0xe27c('0x1f')]){_[_0xe27c('0x20')](_0x2f1951,function(_0x1ee004){if(_0x339248[_0x1ee004[_0xe27c('0x21')]]){_0x3ac909[_0xe27c('0x22')]({'name':_0x1ee004[_0xe27c('0x23')],'value':_0x339248[_0x1ee004[_0xe27c('0x21')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0x267d01['id'],'module_name':_0xe27c('0x26'),'name_value_list':_0x3ac909})}});}function getAuth(_0x2d5eac){return util[_0xe27c('0x27')](_0xe27c('0x28'),new Buffer(_0x2d5eac['apiKey']+':X')[_0xe27c('0x29')]('base64'));}function getServerInfo(_0xea9fe6){return request({'form':{'method':_0xe27c('0x2a'),'input_type':_0xe27c('0x24'),'response_type':'JSON','rest_data':JSON[_0xe27c('0x25')]({'session':_0xea9fe6['id']})}});}function getUser(_0x5dbde9,_0x2f22bd,_0x22b0db){if(!_['isNil'](_0x2f22bd)){logger[_0xe27c('0xe')](_0xe27c('0x2b'),_0x2f22bd);return request({'form':{'method':_0xe27c('0x2c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0x22b0db['id'],'module_name':'Employees','query':util['format'](_0xe27c('0x2d'),_0x2f22bd),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe27c('0x2e')](function(_0x21e72d){if(_0x21e72d[_0xe27c('0x2f')]['length']){var _0x3d8951=_[_0xe27c('0x30')](_0x21e72d[_0xe27c('0x2f')],function(_0x2be748){return _0x2be748[_0xe27c('0x31')][_0xe27c('0x32')][_0xe27c('0x33')]===_0x2f22bd;});if(_0x3d8951){logger[_0xe27c('0xe')]('Agent\x20found!');return BPromise[_0xe27c('0x34')]({'id':_0x3d8951['name_value_list']['id']['value'],'name':_0x3d8951['name_value_list'][_0xe27c('0x10')][_0xe27c('0x33')]});}}logger[_0xe27c('0xe')](_0xe27c('0x35'));return BPromise['resolve']({'id':_0x22b0db[_0xe27c('0x31')]['user_id']['value'],'name':_0x22b0db['name_value_list'][_0xe27c('0x32')]['value']});});}else{logger[_0xe27c('0xe')](_0xe27c('0x36'));return BPromise[_0xe27c('0x34')]({'id':_0x22b0db['name_value_list']['user_id'][_0xe27c('0x33')],'name':_0x22b0db['name_value_list'][_0xe27c('0x32')][_0xe27c('0x33')]});}}function getEndUser(_0x3c02f4,_0x3bb53a,_0x204071,_0xbbce6){logger[_0xe27c('0xe')]('Searching\x20enduser\x20with\x20phone',_0x204071);return request({'form':{'method':_0xe27c('0x2c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0xbbce6['id'],'module_name':_0xe27c('0x1c'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x204071),'order_by':'','offset':'0','select_fields':['id',_0xe27c('0x10'),_0xe27c('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x430acc){if(_0x430acc[_0xe27c('0x2f')][_0xe27c('0x1f')]){var _0x11e811=_[_0xe27c('0x30')](_0x430acc['entry_list'],function(_0x593015){return _0x593015[_0xe27c('0x31')][_0xe27c('0x37')]['value']===_0x204071;});if(_0x11e811){logger[_0xe27c('0xe')](_0xe27c('0x38'));return BPromise['resolve']({'id':_0x11e811[_0xe27c('0x31')]['id'][_0xe27c('0x33')],'name':_0x11e811['name_value_list'][_0xe27c('0x10')][_0xe27c('0x33')],'phone':_0x11e811[_0xe27c('0x31')]['phone_home'][_0xe27c('0x33')]});}}else{logger[_0xe27c('0xe')](_0xe27c('0x39'));return request({'form':{'method':_0xe27c('0x3a'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0xbbce6['id'],'module_name':_0xe27c('0x1c'),'name_value_list':[{'name':'first_name','value':_0x3bb53a!==_0xe27c('0x3b')?_0x3bb53a:util[_0xe27c('0x27')](_0xe27c('0x3c'),_0x204071)},{'name':_0xe27c('0x37'),'value':_0x204071}]})}})[_0xe27c('0x2e')](function(_0x283e87){logger[_0xe27c('0xe')](_0xe27c('0x3d'));return BPromise['resolve']({'id':_0x283e87['id'],'name':_0x283e87[_0xe27c('0x2f')][_0xe27c('0x3e')][_0xe27c('0x33')],'phone':_0x283e87[_0xe27c('0x2f')][_0xe27c('0x37')]['value']});});}});}function request(_0x15dd7d){logger[_0xe27c('0x3f')](_0xe27c('0x40'),JSON['stringify'](_0x15dd7d));return rp(_[_0xe27c('0x41')](def,_0x15dd7d));}function getTags(_0x421d67,_0x3a3871){var _0x35ec62=[];if(_0x421d67&&_0x421d67[_0xe27c('0x1f')]>0x0){_0x35ec62=_[_0xe27c('0x42')](_0x421d67,_0x3a3871);}return _0x35ec62;}function getCustomFields(_0x5d573d,_0x2f1378){var _0x3d1b19=[];var _0x5b86fa={'custom_fields':[]};if(_0x5d573d[_0xe27c('0x1f')]>0x0){_[_0xe27c('0x20')](_0x5d573d,function(_0x5a0d97){if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x44')&&_0x5a0d97['nameField']&&!_0x5a0d97[_0xe27c('0x45')]){_0x5b86fa[_0x5a0d97[_0xe27c('0x46')]['toLowerCase']()]=_0x5a0d97[_0xe27c('0x47')]['toString']();}else if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x44')&&_0x5a0d97[_0xe27c('0x23')]&&_0x5a0d97[_0xe27c('0x45')]){_0x5b86fa['custom_fields'][_0xe27c('0x22')]({'id':_0x5a0d97[_0xe27c('0x23')],'value':_0x5a0d97[_0xe27c('0x47')]['toString']()});}else if(_0x5a0d97[_0xe27c('0x43')]==='variable'&&_0x5a0d97[_0xe27c('0x21')]&&_0x5a0d97['idField']&&_0x5a0d97[_0xe27c('0x45')]){_0x2f1378[_0x5a0d97[_0xe27c('0x21')]]&&_0x5b86fa[_0xe27c('0x48')][_0xe27c('0x22')]({'id':_0x5a0d97['idField'],'value':_0x2f1378[_0x5a0d97[_0xe27c('0x21')]][_0xe27c('0x29')]()});}else if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x49')&&_0x5a0d97[_0xe27c('0x4a')]&&_0x5a0d97[_0xe27c('0x4a')][_0xe27c('0x10')]&&_0x5a0d97[_0xe27c('0x23')]&&_0x5a0d97[_0xe27c('0x45')]){_0x2f1378[_0x5a0d97['Variable'][_0xe27c('0x10')][_0xe27c('0x4b')]()]&&_0x5b86fa[_0xe27c('0x48')]['push']({'id':_0x5a0d97['idField'],'value':_0x2f1378[_0x5a0d97[_0xe27c('0x4a')]['name'][_0xe27c('0x4b')]()][_0xe27c('0x29')]()});}});}return _0x5b86fa;}function getConnection(_0x6b130b){return request({'method':_0xe27c('0xc'),'form':{'method':_0xe27c('0x4c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'user_auth':{'user_name':_0x6b130b[_0xe27c('0x4d')],'password':_0x6b130b[_0xe27c('0x4e')],'encryption':_0xe27c('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xe27c('0x2e')](function(_0x222d23){var _0x44fc0b=_0x222d23;if(_0x44fc0b['id']){def[_0xe27c('0x50')]=_0x44fc0b['id'];return BPromise[_0xe27c('0x34')](_0x44fc0b);}else{throw new Error(util[_0xe27c('0x27')](_0xe27c('0x51'),_0x6b130b['id']));}});}function setRelationship(_0x5df175,_0x190e33,_0x2f5bcb,_0x2f7006){return request({'form':{'method':_0xe27c('0x52'),'input_type':_0xe27c('0x24'),'response_type':'JSON','rest_data':JSON[_0xe27c('0x25')]({'session':_0x5df175['id'],'module_name':'Calls','module_id':_0x2f5bcb['id'],'link_field_name':_0x2f7006,'related_ids':[_0x190e33['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe27c('0x53')]=function(_0x2f5a8b,_0x3bf9f9,_0x20130e,_0x4e727b,_0x3b8292,_0x2fbd7b){var _0x4a3fd0,_0x5cd239,_0x1a9930,_0x352c9a;_0x2fbd7b[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x2fbd7b[_0xe27c('0x54')]);_0x2fbd7b[_0xe27c('0x56')]=intUtil['stripTrailingSlash'](_0x2fbd7b['serverUrl']);def[_0xe27c('0x57')]=util['format'](_0xe27c('0x58'),_0x2fbd7b[_0xe27c('0x54')]);if(_0x3b8292&&_0x3b8292['monitor_format']){logger[_0xe27c('0xe')](_0xe27c('0x59'),_0xe27c('0x5a'));_0x3bf9f9[_0xe27c('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2fbd7b['serverUrl'],_0x3bf9f9[_0xe27c('0x5c')],md5(_0x3bf9f9[_0xe27c('0x5c')]));}else{_0x3bf9f9[_0xe27c('0x5b')]='';}return getConnection(_0x2fbd7b)[_0xe27c('0x2e')](function(_0x108275){_0x352c9a=_0x108275;return getUser(_0x2fbd7b,_0x4e727b['name'],_0x352c9a);})[_0xe27c('0x2e')](function(_0x5878b9){_0x4a3fd0=_0x5878b9;logger[_0xe27c('0xe')]('The\x20User\x20ID\x20is:',_0x4a3fd0['id']);return getEndUser(_0x2fbd7b,_0x3bf9f9[_0xe27c('0x5d')],_0x3bf9f9[_0xe27c('0x5e')],_0x352c9a);})[_0xe27c('0x2e')](function(_0x3ad60c){_0x5cd239=_0x3ad60c;logger[_0xe27c('0xe')](_0xe27c('0x5f'),_0x5cd239['id']);return getTicket(_0x2fbd7b,_0x4a3fd0,_0x5cd239,_0x20130e,_0x3bf9f9,_0x20130e[_0xe27c('0x60')],_0x352c9a,_0xe27c('0x61'));})[_0xe27c('0x2e')](function(_0x228798){_0x1a9930=_0x228798;logger[_0xe27c('0xe')](_0xe27c('0x62'));logger[_0xe27c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x1a9930['id']);return setRelationship(_0x352c9a,_0x4a3fd0,_0x1a9930,_0xe27c('0x63'));})['then'](function(){return setRelationship(_0x352c9a,_0x5cd239,_0x1a9930,_0xe27c('0x64'));})['then'](function(){return getServerInfo(_0x352c9a);})[_0xe27c('0x2e')](function(_0x52eb3f){var _0x4fcbd8=parseInt(_0x52eb3f[_0xe27c('0x65')][_0xe27c('0x66')](0x0));var _0x13348d=util['format'](_0xe27c('0x67'),_0x2fbd7b[_0xe27c('0x54')],_0x1a9930['id']);if(_0x4fcbd8>0x6){_0x13348d=util['format'](_0xe27c('0x68'),_0x2fbd7b['remoteUri'],_0x1a9930['id']);}logger[_0xe27c('0xe')](_0xe27c('0x59'),_0xe27c('0x69'));emit(util[_0xe27c('0x27')](_0xe27c('0x6a'),_0x4e727b['name']),_0xe27c('0x6b'),{'uri':_0x13348d});})['catch'](function(_0x50806f){logger[_0xe27c('0x6c')]('[QUEUE]',JSON[_0xe27c('0x25')](_0x50806f));});};exports[_0xe27c('0x6d')]=function(_0x1b2eb0,_0x4b314,_0x317636,_0x174481,_0x57eb26,_0x93ff7c,_0x307210){var _0x2e9c2e,_0x3b5f12,_0x98011a,_0x480c21;_0x93ff7c[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x93ff7c[_0xe27c('0x54')]);_0x93ff7c['serverUrl']=intUtil[_0xe27c('0x55')](_0x93ff7c[_0xe27c('0x56')]);def[_0xe27c('0x57')]=util[_0xe27c('0x27')](_0xe27c('0x58'),_0x93ff7c[_0xe27c('0x54')]);if(_0x307210&&_0x307210[_0xe27c('0x6e')]&&_0x307210[_0xe27c('0x6e')]!==_0xe27c('0x6f')){logger[_0xe27c('0xe')](_0xe27c('0x70'),'Recording\x20is\x20enabled!');_0x4b314[_0xe27c('0x5b')]=util[_0xe27c('0x27')](_0xe27c('0x71'),_0x93ff7c[_0xe27c('0x56')],_0x4b314[_0xe27c('0x5c')],md5(_0x4b314['uniqueid']));}return getConnection(_0x93ff7c)[_0xe27c('0x2e')](function(_0x6d7df5){_0x480c21=_0x6d7df5;return getUser(_0x93ff7c,_0x174481['name'],_0x480c21);})[_0xe27c('0x2e')](function(_0x2211f8){_0x2e9c2e=_0x2211f8;logger[_0xe27c('0xe')](_0xe27c('0x72'),_0x2e9c2e['id']);return getEndUser(_0x93ff7c,_0x4b314[_0xe27c('0x73')],_0x4b314[_0xe27c('0x74')],_0x480c21);})[_0xe27c('0x2e')](function(_0x47971b){_0x3b5f12=_0x47971b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3b5f12['id']);return getTicket(_0x93ff7c,_0x2e9c2e,_0x3b5f12,_0x317636,_0x4b314,_0x317636['Fields'],_0x480c21,'Outbound');})[_0xe27c('0x2e')](function(_0x2dd7b4){_0x98011a=_0x2dd7b4;logger[_0xe27c('0xe')](_0xe27c('0x62'));logger[_0xe27c('0xe')](_0xe27c('0x75'),_0x98011a['id']);return setRelationship(_0x480c21,_0x2e9c2e,_0x98011a,_0xe27c('0x63'));})[_0xe27c('0x2e')](function(){return setRelationship(_0x480c21,_0x3b5f12,_0x98011a,_0xe27c('0x64'));})[_0xe27c('0x2e')](function(){return getServerInfo(_0x480c21);})['then'](function(_0x59a1e4){var _0x25e120=parseInt(_0x59a1e4['version'][_0xe27c('0x66')](0x0));var _0x167f4d=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x93ff7c['remoteUri'],_0x98011a['id']);if(_0x25e120>0x6){_0x167f4d=util[_0xe27c('0x27')](_0xe27c('0x68'),_0x93ff7c['remoteUri'],_0x98011a['id']);}logger[_0xe27c('0xe')](_0xe27c('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe27c('0x27')](_0xe27c('0x6a'),_0x174481[_0xe27c('0x10')]),_0xe27c('0x6b'),{'uri':_0x167f4d});})['catch'](function(_0x2f95f1){logger[_0xe27c('0x6c')]('[OUTBOUND]',JSON[_0xe27c('0x25')](_0x2f95f1));});};exports[_0xe27c('0x76')]=function(_0x416e1e,_0x1d39d1,_0x3f39e5,_0x277a54,_0x315393,_0x5a7415){var _0x52adff,_0x49a395,_0x324d9e,_0x54e1ac;_0x5a7415[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x5a7415[_0xe27c('0x54')]);_0x5a7415[_0xe27c('0x56')]=intUtil[_0xe27c('0x55')](_0x5a7415[_0xe27c('0x56')]);def['uri']=util[_0xe27c('0x27')]('%s/service/v4_1/rest.php',_0x5a7415[_0xe27c('0x54')]);if(_0x315393&&_0x315393['monitor_format']){logger['info']('['+_0x1d39d1['lastevent'][_0xe27c('0x77')]()+']',_0xe27c('0x5a'));_0x1d39d1['recordingURL']=util[_0xe27c('0x27')](_0xe27c('0x71'),_0x5a7415[_0xe27c('0x56')],_0x1d39d1[_0xe27c('0x5c')],md5(_0x1d39d1['uniqueid']));}else{_0x1d39d1[_0xe27c('0x5b')]='';}return getConnection(_0x5a7415)['then'](function(_0x3d1167){_0x54e1ac=_0x3d1167;if(!_[_0xe27c('0x78')](_0x277a54)){return getUser(_0x5a7415,_0x277a54['name'],_0x54e1ac);}else{return getUser(_0x5a7415,null,_0x54e1ac);}})['then'](function(_0x5e4f95){_0x52adff=_0x5e4f95;logger[_0xe27c('0xe')]('The\x20User\x20ID\x20is:',_0x52adff['id']);return getEndUser(_0x5a7415,_0x1d39d1[_0xe27c('0x5d')],_0x1d39d1[_0xe27c('0x5e')],_0x54e1ac);})[_0xe27c('0x2e')](function(_0x10757c){_0x49a395=_0x10757c;logger[_0xe27c('0xe')](_0xe27c('0x5f'),_0x49a395['id']);return getTicket(_0x5a7415,_0x52adff,_0x49a395,_0x3f39e5,_0x1d39d1,_0x3f39e5[_0xe27c('0x60')],_0x54e1ac,_0xe27c('0x61'));})[_0xe27c('0x2e')](function(_0x1c4a57){_0x324d9e=_0x1c4a57;logger['info'](_0xe27c('0x62'));logger['info'](_0xe27c('0x75'),_0x324d9e['id']);return setRelationship(_0x54e1ac,_0x52adff,_0x324d9e,_0xe27c('0x63'));})[_0xe27c('0x2e')](function(){return setRelationship(_0x54e1ac,_0x49a395,_0x324d9e,_0xe27c('0x64'));})[_0xe27c('0x2e')](function(){return getServerInfo(_0x54e1ac);})[_0xe27c('0x79')](function(_0xd517df){logger[_0xe27c('0x6c')]('['+_0x1d39d1[_0xe27c('0x7a')][_0xe27c('0x77')]()+']',JSON[_0xe27c('0x25')](_0xd517df));});}; \ No newline at end of file +var _0x24ad=['ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','Creating\x20new\x20ticket...','name','getString','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','toString','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','name_value_list','info','Agent\x20found!','resolve','value','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','entry_list','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','customField','toLowerCase','content','custom_fields','type','variable','customVariable','Variable','POST','username','password','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','Fields','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Inbound','request-promise','md5','util'];(function(_0x80764,_0x389472){var _0x461709=function(_0x1bbdc1){while(--_0x1bbdc1){_0x80764['push'](_0x80764['shift']());}};_0x461709(++_0x389472);}(_0x24ad,0xe3));var _0xd24a=function(_0x4babdd,_0x382cd3){_0x4babdd=_0x4babdd-0x0;var _0x4d2c00=_0x24ad[_0x4babdd];return _0x4d2c00;};'use strict';var _=require('lodash');var rp=require(_0xd24a('0x0'));var BPromise=require('bluebird');var md5=require(_0xd24a('0x1'));var util=require(_0xd24a('0x2'));var Redis=require(_0xd24a('0x3'));var intUtil=require('./util');var config=require(_0xd24a('0x4'));var logger=require(_0xd24a('0x5'))(_0xd24a('0x6'));config['redis']=_['defaults'](config[_0xd24a('0x7')],{'host':_0xd24a('0x8'),'port':0x18eb});var io=require(_0xd24a('0x9'))(new Redis(config[_0xd24a('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x27c1fd,_0x312453,_0x1b081f){io['to'](_0x27c1fd)['emit'](_0x312453,_0x1b081f);}function getTicket(_0x164b63,_0x17855d,_0x53b4ea,_0x6e85cb,_0x2c38cf,_0x1361b6,_0x3734a2,_0x2e84a6){logger['info'](_0xd24a('0xa'));var _0x41aaf1=new Date();var _0x33c87a=[{'name':_0xd24a('0xb'),'value':intUtil[_0xd24a('0xc')](_0x6e85cb['Subjects'],_0x2c38cf,'\x20')},{'name':'assigned_user_id','value':_0x17855d['id']},{'name':'created_by','value':_0x17855d['id']},{'name':_0xd24a('0xd'),'value':intUtil[_0xd24a('0xc')](_0x6e85cb[_0xd24a('0xe')],_0x2c38cf,'\x0a')},{'name':_0xd24a('0xf'),'value':_0x41aaf1[_0xd24a('0x10')]()[_0xd24a('0x11')](0x0,0x13)[_0xd24a('0x12')]('T','\x20')},{'name':_0xd24a('0x13'),'value':'0'},{'name':_0xd24a('0x14'),'value':'15'},{'name':'parent_id','value':_0x53b4ea['id']},{'name':'parent_type','value':_0xd24a('0x15')},{'name':_0xd24a('0x16'),'value':_0x53b4ea[_0xd24a('0xb')]},{'name':_0xd24a('0x17'),'value':_0x2e84a6}];if(_0x1361b6[_0xd24a('0x18')]){_[_0xd24a('0x19')](_0x1361b6,function(_0x1c7685){if(_0x2c38cf[_0x1c7685[_0xd24a('0x1a')]]){_0x33c87a[_0xd24a('0x1b')]({'name':_0x1c7685[_0xd24a('0x1c')],'value':_0x2c38cf[_0x1c7685['variableName']]});}});}return request({'form':{'method':_0xd24a('0x1d'),'input_type':_0xd24a('0x1e'),'response_type':_0xd24a('0x1e'),'rest_data':JSON['stringify']({'session':_0x3734a2['id'],'module_name':'Calls','name_value_list':_0x33c87a})}});}function getAuth(_0x3a5158){return util[_0xd24a('0x1f')]('Basic\x20%s',new Buffer(_0x3a5158['apiKey']+':X')[_0xd24a('0x20')]('base64'));}function getServerInfo(_0x4ff066){return request({'form':{'method':_0xd24a('0x21'),'input_type':_0xd24a('0x1e'),'response_type':'JSON','rest_data':JSON[_0xd24a('0x22')]({'session':_0x4ff066['id']})}});}function getUser(_0x2c9cf1,_0x3c1f13,_0x2d71c5){if(!_[_0xd24a('0x23')](_0x3c1f13)){logger['info'](_0xd24a('0x24'),_0x3c1f13);return request({'form':{'method':_0xd24a('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xd24a('0x22')]({'session':_0x2d71c5['id'],'module_name':'Employees','query':util['format'](_0xd24a('0x26'),_0x3c1f13),'order_by':'','offset':'0','select_fields':['id',_0xd24a('0xb'),_0xd24a('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd24a('0x28')](function(_0x3ee295){if(_0x3ee295['entry_list']['length']){var _0xa54e46=_[_0xd24a('0x29')](_0x3ee295['entry_list'],function(_0x23d129){return _0x23d129[_0xd24a('0x2a')][_0xd24a('0x27')]['value']===_0x3c1f13;});if(_0xa54e46){logger[_0xd24a('0x2b')](_0xd24a('0x2c'));return BPromise[_0xd24a('0x2d')]({'id':_0xa54e46['name_value_list']['id'][_0xd24a('0x2e')],'name':_0xa54e46['name_value_list'][_0xd24a('0xb')][_0xd24a('0x2e')]});}}logger[_0xd24a('0x2b')](_0xd24a('0x2f'));return BPromise[_0xd24a('0x2d')]({'id':_0x2d71c5[_0xd24a('0x2a')][_0xd24a('0x30')][_0xd24a('0x2e')],'name':_0x2d71c5[_0xd24a('0x2a')]['user_name'][_0xd24a('0x2e')]});});}else{logger[_0xd24a('0x2b')](_0xd24a('0x31'));return BPromise[_0xd24a('0x2d')]({'id':_0x2d71c5[_0xd24a('0x2a')][_0xd24a('0x30')][_0xd24a('0x2e')],'name':_0x2d71c5[_0xd24a('0x2a')][_0xd24a('0x27')][_0xd24a('0x2e')]});}}function getEndUser(_0x5be61b,_0x197105,_0x55d9dd,_0x22225e){logger['info'](_0xd24a('0x32'),_0x55d9dd);return request({'form':{'method':'get_entry_list','input_type':_0xd24a('0x1e'),'response_type':'JSON','rest_data':JSON[_0xd24a('0x22')]({'session':_0x22225e['id'],'module_name':_0xd24a('0x15'),'query':util['format'](_0xd24a('0x33'),_0x55d9dd),'order_by':'','offset':'0','select_fields':['id','name',_0xd24a('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd24a('0x28')](function(_0x4da48b){if(_0x4da48b[_0xd24a('0x35')][_0xd24a('0x18')]){var _0x57bf23=_[_0xd24a('0x29')](_0x4da48b[_0xd24a('0x35')],function(_0x3765d7){return _0x3765d7['name_value_list'][_0xd24a('0x34')][_0xd24a('0x2e')]===_0x55d9dd;});if(_0x57bf23){logger[_0xd24a('0x2b')](_0xd24a('0x36'));return BPromise[_0xd24a('0x2d')]({'id':_0x57bf23['name_value_list']['id'][_0xd24a('0x2e')],'name':_0x57bf23['name_value_list'][_0xd24a('0xb')][_0xd24a('0x2e')],'phone':_0x57bf23[_0xd24a('0x2a')][_0xd24a('0x34')][_0xd24a('0x2e')]});}}else{logger[_0xd24a('0x2b')](_0xd24a('0x37'));return request({'form':{'method':'set_entry','input_type':_0xd24a('0x1e'),'response_type':_0xd24a('0x1e'),'rest_data':JSON[_0xd24a('0x22')]({'session':_0x22225e['id'],'module_name':_0xd24a('0x15'),'name_value_list':[{'name':_0xd24a('0x38'),'value':_0x197105!==_0xd24a('0x39')?_0x197105:util[_0xd24a('0x1f')](_0xd24a('0x3a'),_0x55d9dd)},{'name':_0xd24a('0x34'),'value':_0x55d9dd}]})}})[_0xd24a('0x28')](function(_0x347e7d){logger[_0xd24a('0x2b')](_0xd24a('0x3b'));return BPromise[_0xd24a('0x2d')]({'id':_0x347e7d['id'],'name':_0x347e7d[_0xd24a('0x35')][_0xd24a('0x38')][_0xd24a('0x2e')],'phone':_0x347e7d[_0xd24a('0x35')][_0xd24a('0x34')]['value']});});}});}function request(_0x1ddcae){logger[_0xd24a('0x3c')]('[HTTP]',JSON[_0xd24a('0x22')](_0x1ddcae));return rp(_[_0xd24a('0x3d')](def,_0x1ddcae));}function getTags(_0xbd4c8,_0x47b93b){var _0x28e8a5=[];if(_0xbd4c8&&_0xbd4c8[_0xd24a('0x18')]>0x0){_0x28e8a5=_[_0xd24a('0x3e')](_0xbd4c8,_0x47b93b);}return _0x28e8a5;}function getCustomFields(_0x1b76cf,_0x1ec613){var _0x3c7ba2=[];var _0x5a4c9b={'custom_fields':[]};if(_0x1b76cf[_0xd24a('0x18')]>0x0){_[_0xd24a('0x19')](_0x1b76cf,function(_0x590459){if(_0x590459['type']===_0xd24a('0x3f')&&_0x590459[_0xd24a('0x40')]&&!_0x590459[_0xd24a('0x41')]){_0x5a4c9b[_0x590459[_0xd24a('0x40')][_0xd24a('0x42')]()]=_0x590459[_0xd24a('0x43')][_0xd24a('0x20')]();}else if(_0x590459['type']===_0xd24a('0x3f')&&_0x590459['idField']&&_0x590459[_0xd24a('0x41')]){_0x5a4c9b[_0xd24a('0x44')][_0xd24a('0x1b')]({'id':_0x590459['idField'],'value':_0x590459[_0xd24a('0x43')][_0xd24a('0x20')]()});}else if(_0x590459[_0xd24a('0x45')]===_0xd24a('0x46')&&_0x590459[_0xd24a('0x1a')]&&_0x590459[_0xd24a('0x1c')]&&_0x590459[_0xd24a('0x41')]){_0x1ec613[_0x590459[_0xd24a('0x1a')]]&&_0x5a4c9b['custom_fields'][_0xd24a('0x1b')]({'id':_0x590459[_0xd24a('0x1c')],'value':_0x1ec613[_0x590459[_0xd24a('0x1a')]][_0xd24a('0x20')]()});}else if(_0x590459[_0xd24a('0x45')]===_0xd24a('0x47')&&_0x590459['Variable']&&_0x590459['Variable'][_0xd24a('0xb')]&&_0x590459[_0xd24a('0x1c')]&&_0x590459['customField']){_0x1ec613[_0x590459['Variable'][_0xd24a('0xb')][_0xd24a('0x42')]()]&&_0x5a4c9b[_0xd24a('0x44')][_0xd24a('0x1b')]({'id':_0x590459[_0xd24a('0x1c')],'value':_0x1ec613[_0x590459[_0xd24a('0x48')][_0xd24a('0xb')][_0xd24a('0x42')]()][_0xd24a('0x20')]()});}});}return _0x5a4c9b;}function getConnection(_0x375911){return request({'method':_0xd24a('0x49'),'form':{'method':'login','input_type':_0xd24a('0x1e'),'response_type':_0xd24a('0x1e'),'rest_data':JSON[_0xd24a('0x22')]({'user_auth':{'user_name':_0x375911[_0xd24a('0x4a')],'password':_0x375911[_0xd24a('0x4b')],'encryption':'PLAIN'},'application':_0xd24a('0x4c')})}})[_0xd24a('0x28')](function(_0x54fa8e){var _0x30c58c=_0x54fa8e;if(_0x30c58c['id']){def[_0xd24a('0x4d')]=_0x30c58c['id'];return BPromise[_0xd24a('0x2d')](_0x30c58c);}else{throw new Error(util[_0xd24a('0x1f')]('Account\x20%d\x20is\x20not\x20valid',_0x375911['id']));}});}function setRelationship(_0x2bd147,_0xba6390,_0x3951d6,_0x3ab9fe){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xd24a('0x1e'),'rest_data':JSON[_0xd24a('0x22')]({'session':_0x2bd147['id'],'module_name':'Calls','module_id':_0x3951d6['id'],'link_field_name':_0x3ab9fe,'related_ids':[_0xba6390['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xd24a('0x4e')]=function(_0x76487e,_0x5ce78e,_0x30c3f4,_0x32fa8f,_0x3fff2e,_0x3b11ef){var _0x33fd9d,_0x566db6,_0x4222ff,_0x3d26cf;_0x3b11ef[_0xd24a('0x4f')]=intUtil[_0xd24a('0x50')](_0x3b11ef[_0xd24a('0x4f')]);_0x3b11ef['serverUrl']=intUtil[_0xd24a('0x50')](_0x3b11ef[_0xd24a('0x51')]);def[_0xd24a('0x52')]=util['format'](_0xd24a('0x53'),_0x3b11ef[_0xd24a('0x4f')]);if(_0x3fff2e&&_0x3fff2e[_0xd24a('0x54')]){logger[_0xd24a('0x2b')](_0xd24a('0x55'),_0xd24a('0x56'));_0x5ce78e['recordingURL']=util[_0xd24a('0x1f')](_0xd24a('0x57'),_0x3b11ef[_0xd24a('0x51')],_0x5ce78e[_0xd24a('0x58')],md5(_0x5ce78e[_0xd24a('0x58')]));}else{_0x5ce78e['recordingURL']='';}return getConnection(_0x3b11ef)[_0xd24a('0x28')](function(_0x54bebc){_0x3d26cf=_0x54bebc;return getUser(_0x3b11ef,_0x32fa8f['name'],_0x3d26cf);})[_0xd24a('0x28')](function(_0x5b753e){_0x33fd9d=_0x5b753e;logger[_0xd24a('0x2b')](_0xd24a('0x59'),_0x33fd9d['id']);return getEndUser(_0x3b11ef,_0x5ce78e[_0xd24a('0x5a')],_0x5ce78e[_0xd24a('0x5b')],_0x3d26cf);})[_0xd24a('0x28')](function(_0x376f6c){_0x566db6=_0x376f6c;logger[_0xd24a('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x566db6['id']);return getTicket(_0x3b11ef,_0x33fd9d,_0x566db6,_0x30c3f4,_0x5ce78e,_0x30c3f4['Fields'],_0x3d26cf,'Inbound');})[_0xd24a('0x28')](function(_0x440d4a){_0x4222ff=_0x440d4a;logger['info'](_0xd24a('0x5c'));logger[_0xd24a('0x2b')](_0xd24a('0x5d'),_0x4222ff['id']);return setRelationship(_0x3d26cf,_0x33fd9d,_0x4222ff,_0xd24a('0x5e'));})['then'](function(){return setRelationship(_0x3d26cf,_0x566db6,_0x4222ff,_0xd24a('0x5f'));})[_0xd24a('0x28')](function(){return getServerInfo(_0x3d26cf);})[_0xd24a('0x28')](function(_0x1eeda9){var _0x2bb68b=parseInt(_0x1eeda9[_0xd24a('0x60')]['charAt'](0x0));var _0x428cbd=util[_0xd24a('0x1f')](_0xd24a('0x61'),_0x3b11ef[_0xd24a('0x4f')],_0x4222ff['id']);if(_0x2bb68b>0x6){_0x428cbd=util[_0xd24a('0x1f')](_0xd24a('0x62'),_0x3b11ef[_0xd24a('0x4f')],_0x4222ff['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd24a('0x1f')](_0xd24a('0x63'),_0x32fa8f['name']),_0xd24a('0x64'),{'uri':_0x428cbd});})[_0xd24a('0x65')](function(_0x127874){logger[_0xd24a('0x66')](_0xd24a('0x55'),JSON[_0xd24a('0x22')](_0x127874));});};exports[_0xd24a('0x67')]=function(_0x134947,_0x227cc7,_0x3b9338,_0x28d43c,_0x103437,_0x33303c,_0xa035e7){var _0x3b0e30,_0xc1f6c1,_0x529128,_0x17a2e0;_0x33303c[_0xd24a('0x4f')]=intUtil[_0xd24a('0x50')](_0x33303c[_0xd24a('0x4f')]);_0x33303c['serverUrl']=intUtil[_0xd24a('0x50')](_0x33303c[_0xd24a('0x51')]);def[_0xd24a('0x52')]=util[_0xd24a('0x1f')](_0xd24a('0x53'),_0x33303c[_0xd24a('0x4f')]);if(_0xa035e7&&_0xa035e7['recordingFormat']&&_0xa035e7[_0xd24a('0x68')]!==_0xd24a('0x69')){logger['info'](_0xd24a('0x6a'),_0xd24a('0x56'));_0x227cc7[_0xd24a('0x6b')]=util[_0xd24a('0x1f')](_0xd24a('0x57'),_0x33303c[_0xd24a('0x51')],_0x227cc7[_0xd24a('0x58')],md5(_0x227cc7[_0xd24a('0x58')]));}return getConnection(_0x33303c)[_0xd24a('0x28')](function(_0x9d8d3b){_0x17a2e0=_0x9d8d3b;return getUser(_0x33303c,_0x28d43c[_0xd24a('0xb')],_0x17a2e0);})[_0xd24a('0x28')](function(_0x3a2813){_0x3b0e30=_0x3a2813;logger[_0xd24a('0x2b')](_0xd24a('0x59'),_0x3b0e30['id']);return getEndUser(_0x33303c,_0x227cc7['destcalleridname'],_0x227cc7[_0xd24a('0x6c')],_0x17a2e0);})['then'](function(_0x16b544){_0xc1f6c1=_0x16b544;logger[_0xd24a('0x2b')]('The\x20Enduser\x20ID\x20is:',_0xc1f6c1['id']);return getTicket(_0x33303c,_0x3b0e30,_0xc1f6c1,_0x3b9338,_0x227cc7,_0x3b9338[_0xd24a('0x6d')],_0x17a2e0,'Outbound');})[_0xd24a('0x28')](function(_0x2244d7){_0x529128=_0x2244d7;logger[_0xd24a('0x2b')](_0xd24a('0x5c'));logger[_0xd24a('0x2b')](_0xd24a('0x5d'),_0x529128['id']);return setRelationship(_0x17a2e0,_0x3b0e30,_0x529128,'users');})['then'](function(){return setRelationship(_0x17a2e0,_0xc1f6c1,_0x529128,'contacts');})[_0xd24a('0x28')](function(){return getServerInfo(_0x17a2e0);})['then'](function(_0x4b2cdc){var _0x5b9dda=parseInt(_0x4b2cdc[_0xd24a('0x60')]['charAt'](0x0));var _0x31df0a=util[_0xd24a('0x1f')](_0xd24a('0x61'),_0x33303c[_0xd24a('0x4f')],_0x529128['id']);if(_0x5b9dda>0x6){_0x31df0a=util[_0xd24a('0x1f')](_0xd24a('0x62'),_0x33303c[_0xd24a('0x4f')],_0x529128['id']);}logger[_0xd24a('0x2b')](_0xd24a('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd24a('0x1f')](_0xd24a('0x63'),_0x28d43c[_0xd24a('0xb')]),'trigger:browser:url',{'uri':_0x31df0a});})[_0xd24a('0x65')](function(_0x59b85b){logger[_0xd24a('0x66')](_0xd24a('0x6a'),JSON['stringify'](_0x59b85b));});};exports[_0xd24a('0x6e')]=function(_0xc11001,_0x49a985,_0x53e206,_0x2770ef,_0x16b4cf,_0xcdea0d){var _0x546a54,_0x349d9c,_0x5ca275,_0x318065;_0xcdea0d[_0xd24a('0x4f')]=intUtil[_0xd24a('0x50')](_0xcdea0d['remoteUri']);_0xcdea0d[_0xd24a('0x51')]=intUtil[_0xd24a('0x50')](_0xcdea0d['serverUrl']);def[_0xd24a('0x52')]=util[_0xd24a('0x1f')](_0xd24a('0x53'),_0xcdea0d[_0xd24a('0x4f')]);if(_0x16b4cf&&_0x16b4cf[_0xd24a('0x54')]){logger[_0xd24a('0x2b')]('['+_0x49a985[_0xd24a('0x6f')][_0xd24a('0x70')]()+']','Recording\x20is\x20enabled!');_0x49a985['recordingURL']=util['format'](_0xd24a('0x57'),_0xcdea0d[_0xd24a('0x51')],_0x49a985['uniqueid'],md5(_0x49a985['uniqueid']));}else{_0x49a985[_0xd24a('0x6b')]='';}return getConnection(_0xcdea0d)[_0xd24a('0x28')](function(_0x34a27a){_0x318065=_0x34a27a;if(!_[_0xd24a('0x23')](_0x2770ef)){return getUser(_0xcdea0d,_0x2770ef[_0xd24a('0xb')],_0x318065);}else{return getUser(_0xcdea0d,null,_0x318065);}})[_0xd24a('0x28')](function(_0x345ace){_0x546a54=_0x345ace;logger[_0xd24a('0x2b')](_0xd24a('0x59'),_0x546a54['id']);return getEndUser(_0xcdea0d,_0x49a985[_0xd24a('0x5a')],_0x49a985['calleridnum'],_0x318065);})[_0xd24a('0x28')](function(_0x3b9c9b){_0x349d9c=_0x3b9c9b;logger[_0xd24a('0x2b')](_0xd24a('0x71'),_0x349d9c['id']);return getTicket(_0xcdea0d,_0x546a54,_0x349d9c,_0x53e206,_0x49a985,_0x53e206['Fields'],_0x318065,_0xd24a('0x72'));})[_0xd24a('0x28')](function(_0x34d2dd){_0x5ca275=_0x34d2dd;logger['info']('Ticket\x20created!');logger[_0xd24a('0x2b')](_0xd24a('0x5d'),_0x5ca275['id']);return setRelationship(_0x318065,_0x546a54,_0x5ca275,'users');})[_0xd24a('0x28')](function(){return setRelationship(_0x318065,_0x349d9c,_0x5ca275,'contacts');})[_0xd24a('0x28')](function(){return getServerInfo(_0x318065);})['catch'](function(_0x3284bc){logger[_0xd24a('0x66')]('['+_0x49a985['lastevent'][_0xd24a('0x70')]()+']',JSON[_0xd24a('0x22')](_0x3284bc));});}; \ 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 ae3cf0c..f5582d6 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 _0xa6c6=['push','content','type','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','variable','format','customVariable','stripTrailingSlash','slice','substring','validateEmail','isNil','lodash','util','length','string'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xa6c6,0x128));var _0x6a6c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa6c6[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6a6c('0x0'));var util=require(_0x6a6c('0x1'));exports['getString']=function(_0x5523f5,_0x3b9e51,_0x31a1ad){var _0x767ed5=[];if(_0x5523f5[_0x6a6c('0x2')]>0x0){var _0x2f7ca4=_['sortBy'](_0x5523f5,['id']);for(var _0x8fc2f3=0x0;_0x8fc2f3<_0x2f7ca4[_0x6a6c('0x2')];_0x8fc2f3++){var _0x941254=_0x2f7ca4[_0x8fc2f3];if(_0x941254['type']===_0x6a6c('0x3')){_0x767ed5[_0x6a6c('0x4')](_0x941254[_0x6a6c('0x5')]);}else if(_0x941254[_0x6a6c('0x6')]==='variable'&&_0x941254[_0x6a6c('0x7')]){_0x3b9e51[_0x941254['variableName']]&&_0x767ed5['push'](_0x3b9e51[_0x941254[_0x6a6c('0x7')]][_0x6a6c('0x8')]());}else if(_0x941254['type']==='customVariable'&&_0x941254[_0x6a6c('0x9')]&&_0x941254[_0x6a6c('0x9')]['name']){_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')][_0x6a6c('0xb')]()]&&_0x767ed5[_0x6a6c('0x4')](_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')]['toLowerCase']()][_0x6a6c('0x8')]());}else if(_0x941254[_0x6a6c('0x6')]===_0x6a6c('0xc')){if(_0x941254[_0x6a6c('0xd')]==='string'&&_0x941254[_0x6a6c('0xe')]){_0x767ed5[_0x6a6c('0x4')](util['format'](_0x6a6c('0xf'),_0x941254[_0x6a6c('0xe')],_0x941254[_0x6a6c('0x10')]));}else if(_0x941254[_0x6a6c('0xd')]===_0x6a6c('0x11')&&_0x941254[_0x6a6c('0x7')]&&_0x941254[_0x6a6c('0xe')]){_0x3b9e51[_0x941254[_0x6a6c('0x7')]]&&_0x767ed5[_0x6a6c('0x4')](util[_0x6a6c('0x12')](_0x6a6c('0xf'),_0x941254['key'],_0x3b9e51[_0x941254['variableName']]));}else if(_0x941254[_0x6a6c('0xd')]===_0x6a6c('0x13')&&_0x941254[_0x6a6c('0x9')]&&_0x941254['Variable'][_0x6a6c('0xa')]&&_0x941254['key']){_0x3b9e51[_0x941254['Variable'][_0x6a6c('0xa')][_0x6a6c('0xb')]()]&&_0x767ed5[_0x6a6c('0x4')](util['format'](_0x6a6c('0xf'),_0x941254[_0x6a6c('0xe')],_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')]['toLowerCase']()]));}}}}return _0x767ed5['join'](_0x31a1ad);};exports[_0x6a6c('0x14')]=function(_0x5a1a91){var _0x320f6c=_0x5a1a91[_0x6a6c('0x15')](-0x1);if(_0x320f6c==='/'){_0x5a1a91=_0x5a1a91[_0x6a6c('0x16')](0x0,_0x5a1a91['lastIndexOf'](_0x320f6c));}return _0x5a1a91;};exports[_0x6a6c('0x17')]=function(_0x32d76d){if(!_[_0x6a6c('0x18')](_0x32d76d)&&_0x32d76d!==''){var _0x38db24=/^(([^<>()\[\]\\.,;:\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 _0x38db24['test'](String(_0x32d76d)[_0x6a6c('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xa6ca=['format','key','keyContent','keyType','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x4dcd3b,_0x2fa37b){var _0x37c0ca=function(_0x27d5dd){while(--_0x27d5dd){_0x4dcd3b['push'](_0x4dcd3b['shift']());}};_0x37c0ca(++_0x2fa37b);}(_0xa6ca,0x1aa));var _0xaa6c=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xa6ca[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xaa6c('0x0'));var util=require(_0xaa6c('0x1'));exports['getString']=function(_0x6ae325,_0xe62323,_0x3467c7){var _0x16e5a5=[];if(_0x6ae325[_0xaa6c('0x2')]>0x0){var _0x28b60f=_[_0xaa6c('0x3')](_0x6ae325,['id']);for(var _0x3f625a=0x0;_0x3f625a<_0x28b60f['length'];_0x3f625a++){var _0x5a77f5=_0x28b60f[_0x3f625a];if(_0x5a77f5[_0xaa6c('0x4')]===_0xaa6c('0x5')){_0x16e5a5[_0xaa6c('0x6')](_0x5a77f5[_0xaa6c('0x7')]);}else if(_0x5a77f5[_0xaa6c('0x4')]===_0xaa6c('0x8')&&_0x5a77f5[_0xaa6c('0x9')]){_0xe62323[_0x5a77f5['variableName']]&&_0x16e5a5[_0xaa6c('0x6')](_0xe62323[_0x5a77f5['variableName']][_0xaa6c('0xa')]());}else if(_0x5a77f5[_0xaa6c('0x4')]===_0xaa6c('0xb')&&_0x5a77f5[_0xaa6c('0xc')]&&_0x5a77f5[_0xaa6c('0xc')]['name']){_0xe62323[_0x5a77f5[_0xaa6c('0xc')][_0xaa6c('0xd')]['toLowerCase']()]&&_0x16e5a5[_0xaa6c('0x6')](_0xe62323[_0x5a77f5[_0xaa6c('0xc')][_0xaa6c('0xd')][_0xaa6c('0xe')]()][_0xaa6c('0xa')]());}else if(_0x5a77f5[_0xaa6c('0x4')]===_0xaa6c('0xf')){if(_0x5a77f5['keyType']===_0xaa6c('0x5')&&_0x5a77f5['key']){_0x16e5a5[_0xaa6c('0x6')](util[_0xaa6c('0x10')]('%s:\x20%s',_0x5a77f5[_0xaa6c('0x11')],_0x5a77f5[_0xaa6c('0x12')]));}else if(_0x5a77f5[_0xaa6c('0x13')]===_0xaa6c('0x8')&&_0x5a77f5[_0xaa6c('0x9')]&&_0x5a77f5['key']){_0xe62323[_0x5a77f5['variableName']]&&_0x16e5a5[_0xaa6c('0x6')](util[_0xaa6c('0x10')]('%s:\x20%s',_0x5a77f5[_0xaa6c('0x11')],_0xe62323[_0x5a77f5[_0xaa6c('0x9')]]));}else if(_0x5a77f5[_0xaa6c('0x13')]===_0xaa6c('0xb')&&_0x5a77f5['Variable']&&_0x5a77f5[_0xaa6c('0xc')]['name']&&_0x5a77f5[_0xaa6c('0x11')]){_0xe62323[_0x5a77f5[_0xaa6c('0xc')][_0xaa6c('0xd')][_0xaa6c('0xe')]()]&&_0x16e5a5['push'](util[_0xaa6c('0x10')]('%s:\x20%s',_0x5a77f5['key'],_0xe62323[_0x5a77f5[_0xaa6c('0xc')]['name'][_0xaa6c('0xe')]()]));}}}}return _0x16e5a5[_0xaa6c('0x14')](_0x3467c7);};exports[_0xaa6c('0x15')]=function(_0x2e3003){var _0x1cefc5=_0x2e3003['slice'](-0x1);if(_0x1cefc5==='/'){_0x2e3003=_0x2e3003[_0xaa6c('0x16')](0x0,_0x2e3003[_0xaa6c('0x17')](_0x1cefc5));}return _0x2e3003;};exports[_0xaa6c('0x18')]=function(_0x4f005f){if(!_['isNil'](_0x4f005f)&&_0x4f005f!==''){var _0x3bed78=/^(([^<>()\[\]\\.,;:\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 _0x3bed78[_0xaa6c('0x19')](String(_0x4f005f)[_0xaa6c('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 71359a6..ebb802e 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 _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(_0x350cfa,_0x597d9c){var _0xe33526=function(_0xb7b79a){while(--_0xb7b79a){_0x350cfa['push'](_0x350cfa['shift']());}};_0xe33526(++_0x597d9c);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 +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(_0x53859e,_0x2881ff){var _0x474194=function(_0x5080ea){while(--_0x5080ea){_0x53859e['push'](_0x53859e['shift']());}};_0x474194(++_0x2881ff);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 4e4a395..2b95a04 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 _0x9fdf=['ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','emit','application/json','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','debug','stringify','GET','forEach','includes','type','nameField','toLowerCase','string','picklist','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','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','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','The\x20Enduser\x20ID\x20is:','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','recordingURL','calleridname','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util'];(function(_0x516499,_0x1a7c98){var _0x2de0b0=function(_0x492977){while(--_0x492977){_0x516499['push'](_0x516499['shift']());}};_0x2de0b0(++_0x1a7c98);}(_0x9fdf,0x1ba));var _0xf9fd=function(_0x267c51,_0x4f98a0){_0x267c51=_0x267c51-0x0;var _0x47733a=_0x9fdf[_0x267c51];return _0x47733a;};'use strict';var _=require('lodash');var rp=require(_0xf9fd('0x0'));var md5=require('md5');var util=require(_0xf9fd('0x1'));var Redis=require(_0xf9fd('0x2'));var intUtil=require(_0xf9fd('0x3'));var config=require(_0xf9fd('0x4'));var logger=require('../../../../config/logger')(_0xf9fd('0x5'));config[_0xf9fd('0x6')]=_[_0xf9fd('0x7')](config[_0xf9fd('0x6')],{'host':_0xf9fd('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf9fd('0x6')]));function emit(_0x3ee01f,_0x4c1909,_0x441bbe){io['to'](_0x3ee01f)[_0xf9fd('0x9')](_0x4c1909,_0x441bbe);}var headers={'Content-Type':_0xf9fd('0xa'),'Accept':_0xf9fd('0xa')};function getTicket(_0x3222b3,_0x3f2976,_0x97bbd6,_0x119fb2,_0x5334b2){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0xc'),_0x3222b3['remoteUri']),'method':_0xf9fd('0xd'),'body':{'ticket':_[_0xf9fd('0xe')]({'requester_id':_0x97bbd6['id'],'submitter_id':_0x3f2976?_0x3f2976['id']:undefined,'assignee_id':_0x3f2976?_0x3f2976['id']:undefined,'tags':getTags(_0x119fb2[_0xf9fd('0xf')],_0xf9fd('0x10')),'subject':intUtil[_0xf9fd('0x11')](_0x119fb2[_0xf9fd('0x12')],_0x5334b2,'\x20'),'description':intUtil['getString'](_0x119fb2[_0xf9fd('0x13')],_0x5334b2,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf9fd('0x11')](_0x119fb2['Descriptions'],_0x5334b2,'\x0a')}},getCustomFields(_0x119fb2[_0xf9fd('0x14')],_0x5334b2))}})[_0xf9fd('0x15')](function(_0x4241dd){logger[_0xf9fd('0x16')](_0xf9fd('0x17'));return _0x4241dd[_0xf9fd('0x18')];});}function getUser(_0xf82815,_0x302581){if(intUtil[_0xf9fd('0x19')](_0x302581)){logger[_0xf9fd('0x16')]('Getting\x20agent\x20with\x20email',_0x302581);return request({'uri':util[_0xf9fd('0xb')]('%s/search.json',_0xf82815[_0xf9fd('0x1a')]),'qs':{'query':util['format'](_0xf9fd('0x1b'),_0x302581)}})[_0xf9fd('0x15')](function(_0x36eacf){if(_0x36eacf[_0xf9fd('0x1c')]){logger[_0xf9fd('0x16')](_0xf9fd('0x1d'));return _['find'](_0x36eacf[_0xf9fd('0x1e')],{'email':_0x302581,'role':_0xf9fd('0x1f')});}else{logger[_0xf9fd('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf9fd('0xb')]('%s/users/me.json',_0xf82815[_0xf9fd('0x1a')])})['then'](function(_0x42a625){logger[_0xf9fd('0x16')](_0xf9fd('0x20'));return _0x42a625[_0xf9fd('0x21')];});}});}else{logger[_0xf9fd('0x16')](_0xf9fd('0x22'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x23'),_0xf82815[_0xf9fd('0x1a')])})[_0xf9fd('0x15')](function(_0x429118){logger['info'](_0xf9fd('0x20'));return _0x429118[_0xf9fd('0x21')];});}}function getEndUser(_0x8c33ea,_0x4753d1,_0x20cf89){logger['info']('Searching\x20enduser\x20with\x20phone',_0x20cf89);return request({'uri':util[_0xf9fd('0xb')]('%s/search.json',_0x8c33ea[_0xf9fd('0x1a')]),'qs':{'query':util[_0xf9fd('0xb')](_0xf9fd('0x24'),_0x20cf89)}})[_0xf9fd('0x15')](function(_0x151ef6){var _0x53f156;if(_0x151ef6[_0xf9fd('0x1e')][_0xf9fd('0x25')]){_0x151ef6['results']=_[_0xf9fd('0x26')](_0x151ef6[_0xf9fd('0x1e')],{'suspended':![],'role':_0xf9fd('0x27')});if(_0x151ef6[_0xf9fd('0x1e')][_0xf9fd('0x25')]){_0x53f156=_[_0xf9fd('0x28')](_0x151ef6[_0xf9fd('0x1e')]);}}if(_0x53f156){logger[_0xf9fd('0x16')](_0xf9fd('0x29'));return _0x53f156;}else{logger['info'](_0xf9fd('0x2a'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x2b'),_0x8c33ea[_0xf9fd('0x1a')]),'method':_0xf9fd('0xd'),'body':{'user':{'role':_0xf9fd('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x4753d1||_0x20cf89),'phone':_0x20cf89}}})[_0xf9fd('0x15')](function(_0x304b2a){logger[_0xf9fd('0x16')](_0xf9fd('0x2c'));return _0x304b2a['user'];});}});}function getAuth(_0x5b26f9){var _0x31cc0a;if(_0x5b26f9[_0xf9fd('0x2d')]===_0xf9fd('0x2e')){_0x31cc0a=util['format'](_0xf9fd('0x2f'),_0x5b26f9['username'],_0x5b26f9[_0xf9fd('0x2e')]);}else if(_0x5b26f9[_0xf9fd('0x2d')]===_0xf9fd('0x30')){_0x31cc0a=util[_0xf9fd('0xb')](_0xf9fd('0x31'),_0x5b26f9[_0xf9fd('0x32')],_0x5b26f9[_0xf9fd('0x30')]);}return util['format'](_0xf9fd('0x33'),new Buffer(_0x31cc0a)[_0xf9fd('0x34')]('base64'));}function request(_0x5011d8){logger[_0xf9fd('0x35')]('[HTTP]',JSON[_0xf9fd('0x36')](_0x5011d8));return rp(_[_0xf9fd('0x7')](_0x5011d8,{'method':_0xf9fd('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5a40cc,_0x5ddd4b){var _0x1fe6fb=[];if(_0x5a40cc&&_0x5a40cc[_0xf9fd('0x25')]>0x0){_0x1fe6fb=_['map'](_0x5a40cc,_0x5ddd4b);}return _0x1fe6fb;}function getCustomFields(_0x5303e2,_0xe37499){var _0x8972d1=[];var _0x8da1b4={'custom_fields':[]};if(_0x5303e2[_0xf9fd('0x25')]>0x0){_[_0xf9fd('0x38')](_0x5303e2,function(_0x38ce37){if(_[_0xf9fd('0x39')](['string','picklist'],_0x38ce37[_0xf9fd('0x3a')])&&_0x38ce37[_0xf9fd('0x3b')]&&!_0x38ce37['customField']){_0x8da1b4[_0x38ce37['nameField'][_0xf9fd('0x3c')]()]=_0x38ce37['content'][_0xf9fd('0x34')]();}else if(_[_0xf9fd('0x39')]([_0xf9fd('0x3d'),_0xf9fd('0x3e')],_0x38ce37['type'])&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0x38ce37['content'][_0xf9fd('0x34')]()});}else if(_0x38ce37[_0xf9fd('0x3a')]===_0xf9fd('0x43')&&_0x38ce37[_0xf9fd('0x44')]&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0xe37499[_0x38ce37[_0xf9fd('0x44')]]&&_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0xe37499[_0x38ce37[_0xf9fd('0x44')]][_0xf9fd('0x34')]()});}else if(_0x38ce37[_0xf9fd('0x3a')]===_0xf9fd('0x45')&&_0x38ce37[_0xf9fd('0x46')]&&_0x38ce37[_0xf9fd('0x46')][_0xf9fd('0x10')]&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0xe37499[_0x38ce37['Variable']['name']['toLowerCase']()]&&_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0xe37499[_0x38ce37[_0xf9fd('0x46')][_0xf9fd('0x10')]['toLowerCase']()]['toString']()});}});}return _0x8da1b4;}exports[_0xf9fd('0x47')]=function(_0x566415,_0x490cf2,_0x397e64,_0x352d7f,_0x193fc6,_0x4765d6){var _0x46a121,_0x523393;_0x4765d6['remoteUri']=intUtil[_0xf9fd('0x48')](_0x4765d6[_0xf9fd('0x1a')]);_0x4765d6[_0xf9fd('0x49')]=intUtil[_0xf9fd('0x48')](_0x4765d6[_0xf9fd('0x49')]);if(_0x193fc6&&_0x193fc6[_0xf9fd('0x4a')]){logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),'Recording\x20is\x20enabled!');_0x490cf2['recordingURL']=util['format'](_0xf9fd('0x4c'),_0x4765d6['serverUrl'],_0x490cf2[_0xf9fd('0x4d')],md5(_0x490cf2[_0xf9fd('0x4d')]));}else{_0x490cf2['recordingURL']='';}headers['Authorization']=getAuth(_0x4765d6);return getUser(_0x4765d6,_0x352d7f['email'])[_0xf9fd('0x15')](function(_0x35638a){_0x46a121=_0x35638a;logger[_0xf9fd('0x16')](_0xf9fd('0x4e'),_0x46a121['id']);return getEndUser(_0x4765d6,_0x490cf2['calleridname'],_0x490cf2[_0xf9fd('0x4f')]);})[_0xf9fd('0x15')](function(_0x29a509){_0x523393=_0x29a509;logger[_0xf9fd('0x16')]('The\x20Enduser\x20ID\x20is:',_0x523393['id']);return getTicket(_0x4765d6,_0x46a121,_0x523393,_0x397e64,_0x490cf2);})[_0xf9fd('0x15')](function(_0x42e584){if(_0x42e584){logger['info'](_0xf9fd('0x50'),_0x42e584['id']);switch(_0x4765d6[_0xf9fd('0x3a')]){case _0xf9fd('0x51'):logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),_0xf9fd('0x52'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x53'),_0x4765d6[_0xf9fd('0x1a')],_0x46a121['id'],_0x42e584['id']),'method':_0xf9fd('0xd')});case _0xf9fd('0x54'):logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),_0xf9fd('0x55'));emit(util[_0xf9fd('0xb')](_0xf9fd('0x56'),_0x352d7f[_0xf9fd('0x10')]),_0xf9fd('0x57'),{'uri':util[_0xf9fd('0xb')](_0xf9fd('0x58'),_0x4765d6[_0xf9fd('0x1a')]['replace'](_0xf9fd('0x59'),''),_0x42e584['id'])});break;default:logger[_0xf9fd('0x5a')](_0xf9fd('0x4b'),_0xf9fd('0x5b'));}}})[_0xf9fd('0x5c')](function(_0x37a5aa){logger[_0xf9fd('0x5a')](_0xf9fd('0x5d'),util[_0xf9fd('0x5e')](_0x37a5aa,{'showHidden':!![],'depth':null}));});};exports[_0xf9fd('0x5f')]=function(_0x75e7db,_0x413429,_0x5ceb60,_0x21b48e,_0x2cc908,_0x4a0e17,_0x5814aa){var _0x27f08e,_0x1bf8f3;_0x4a0e17[_0xf9fd('0x1a')]=intUtil[_0xf9fd('0x48')](_0x4a0e17['remoteUri']);_0x4a0e17['serverUrl']=intUtil['stripTrailingSlash'](_0x4a0e17[_0xf9fd('0x49')]);if(_0x5814aa&&_0x5814aa[_0xf9fd('0x60')]&&_0x5814aa[_0xf9fd('0x60')]!==_0xf9fd('0x61')){logger[_0xf9fd('0x16')](_0xf9fd('0x62'),_0xf9fd('0x63'));_0x413429['recordingURL']=util[_0xf9fd('0xb')](_0xf9fd('0x4c'),_0x4a0e17[_0xf9fd('0x49')],_0x413429[_0xf9fd('0x4d')],md5(_0x413429[_0xf9fd('0x4d')]));}headers['Authorization']=getAuth(_0x4a0e17);return getUser(_0x4a0e17,_0x21b48e[_0xf9fd('0x64')])['then'](function(_0x6bfddb){_0x27f08e=_0x6bfddb;logger['info'](_0xf9fd('0x4e'),_0x27f08e['id']);return getEndUser(_0x4a0e17,_0x413429[_0xf9fd('0x65')],_0x413429['destcalleridnum']);})[_0xf9fd('0x15')](function(_0x4b374c){_0x1bf8f3=_0x4b374c;logger[_0xf9fd('0x16')](_0xf9fd('0x66'),_0x1bf8f3['id']);return getTicket(_0x4a0e17,_0x27f08e,_0x1bf8f3,_0x5ceb60,_0x413429);})[_0xf9fd('0x15')](function(_0x5dae2d){if(_0x5dae2d){logger[_0xf9fd('0x16')](_0xf9fd('0x50'),_0x5dae2d['id']);switch(_0x4a0e17[_0xf9fd('0x3a')]){case'integrationTab':logger[_0xf9fd('0x16')](_0xf9fd('0x62'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf9fd('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4a0e17[_0xf9fd('0x1a')],_0x27f08e['id'],_0x5dae2d['id']),'method':_0xf9fd('0xd')});case _0xf9fd('0x54'):logger[_0xf9fd('0x16')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf9fd('0xb')]('user:%s',_0x21b48e['name']),_0xf9fd('0x57'),{'uri':util[_0xf9fd('0xb')](_0xf9fd('0x58'),_0x4a0e17[_0xf9fd('0x1a')][_0xf9fd('0x67')](_0xf9fd('0x59'),''),_0x5dae2d['id'])});break;default:logger[_0xf9fd('0x5a')](_0xf9fd('0x62'),_0xf9fd('0x5b'));}}})[_0xf9fd('0x5c')](function(_0x3af95d){logger[_0xf9fd('0x5a')](_0xf9fd('0x68'),util[_0xf9fd('0x5e')](_0x3af95d,{'showHidden':!![],'depth':null}));});};exports[_0xf9fd('0x69')]=function(_0x3b5dfb,_0x153553,_0x18887c,_0x3aa0c7,_0x91c64e,_0x128193){var _0x2000c6,_0xfe4eb3;_0x128193[_0xf9fd('0x1a')]=intUtil['stripTrailingSlash'](_0x128193['remoteUri']);_0x128193[_0xf9fd('0x49')]=intUtil[_0xf9fd('0x48')](_0x128193[_0xf9fd('0x49')]);if(_0x91c64e&&_0x91c64e[_0xf9fd('0x4a')]){logger[_0xf9fd('0x16')]('['+_0x153553['lastevent']['toUpperCase']()+']',_0xf9fd('0x63'));_0x153553[_0xf9fd('0x6a')]=util['format'](_0xf9fd('0x4c'),_0x128193['serverUrl'],_0x153553['uniqueid'],md5(_0x153553[_0xf9fd('0x4d')]));}else{_0x153553[_0xf9fd('0x6a')]='';}headers['Authorization']=getAuth(_0x128193);return getUser(_0x128193)['then'](function(_0x2225cc){_0x2000c6=_0x2225cc;logger['info'](_0xf9fd('0x4e'),_0x2000c6['id']);return getEndUser(_0x128193,_0x153553[_0xf9fd('0x6b')],_0x153553['calleridnum']);})['then'](function(_0x26cc4f){_0xfe4eb3=_0x26cc4f;logger[_0xf9fd('0x16')](_0xf9fd('0x66'),_0xfe4eb3['id']);return getTicket(_0x128193,_0x2000c6,_0xfe4eb3,_0x18887c,_0x153553);})[_0xf9fd('0x15')](function(_0x763626){if(_0x763626){logger[_0xf9fd('0x16')](_0xf9fd('0x50'),_0x763626['id']);}})[_0xf9fd('0x5c')](function(_0x1e5363){logger[_0xf9fd('0x5a')]('['+_0x153553[_0xf9fd('0x6c')][_0xf9fd('0x6d')]()+']'+_0xf9fd('0x6e'),util['inspect'](_0x1e5363,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb484=['%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','type','nameField','customField','toLowerCase','content','string','picklist','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...'];(function(_0x5a27fe,_0x43993b){var _0x121c88=function(_0x2aff1f){while(--_0x2aff1f){_0x5a27fe['push'](_0x5a27fe['shift']());}};_0x121c88(++_0x43993b);}(_0xb484,0xfb));var _0x4b48=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xb484[_0x5ac1e5];return _0x1bccc6;};'use strict';var _=require(_0x4b48('0x0'));var rp=require('request-promise');var md5=require(_0x4b48('0x1'));var util=require('util');var Redis=require(_0x4b48('0x2'));var intUtil=require('./util');var config=require(_0x4b48('0x3'));var logger=require(_0x4b48('0x4'))(_0x4b48('0x5'));config['redis']=_[_0x4b48('0x6')](config[_0x4b48('0x7')],{'host':_0x4b48('0x8'),'port':0x18eb});var io=require(_0x4b48('0x9'))(new Redis(config['redis']));function emit(_0x180568,_0x22d308,_0x413994){io['to'](_0x180568)[_0x4b48('0xa')](_0x22d308,_0x413994);}var headers={'Content-Type':_0x4b48('0xb'),'Accept':_0x4b48('0xb')};function getTicket(_0x57ee55,_0x43a52f,_0x3f571b,_0x577817,_0x24843a){logger[_0x4b48('0xc')](_0x4b48('0xd'));return request({'uri':util[_0x4b48('0xe')](_0x4b48('0xf'),_0x57ee55[_0x4b48('0x10')]),'method':'POST','body':{'ticket':_[_0x4b48('0x11')]({'requester_id':_0x3f571b['id'],'submitter_id':_0x43a52f?_0x43a52f['id']:undefined,'assignee_id':_0x43a52f?_0x43a52f['id']:undefined,'tags':getTags(_0x577817['Tags'],_0x4b48('0x12')),'subject':intUtil[_0x4b48('0x13')](_0x577817['Subjects'],_0x24843a,'\x20'),'description':intUtil[_0x4b48('0x13')](_0x577817[_0x4b48('0x14')],_0x24843a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4b48('0x13')](_0x577817[_0x4b48('0x14')],_0x24843a,'\x0a')}},getCustomFields(_0x577817[_0x4b48('0x15')],_0x24843a))}})['then'](function(_0x263704){logger[_0x4b48('0xc')](_0x4b48('0x16'));return _0x263704[_0x4b48('0x17')];});}function getUser(_0x5aaa97,_0x13330e){if(intUtil['validateEmail'](_0x13330e)){logger['info'](_0x4b48('0x18'),_0x13330e);return request({'uri':util[_0x4b48('0xe')](_0x4b48('0x19'),_0x5aaa97[_0x4b48('0x10')]),'qs':{'query':util[_0x4b48('0xe')](_0x4b48('0x1a'),_0x13330e)}})[_0x4b48('0x1b')](function(_0xd6e807){if(_0xd6e807[_0x4b48('0x1c')]){logger[_0x4b48('0xc')]('Agent\x20found!');return _[_0x4b48('0x1d')](_0xd6e807[_0x4b48('0x1e')],{'email':_0x13330e,'role':_0x4b48('0x1f')});}else{logger[_0x4b48('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4b48('0xe')](_0x4b48('0x20'),_0x5aaa97[_0x4b48('0x10')])})[_0x4b48('0x1b')](function(_0x5ead25){logger[_0x4b48('0xc')](_0x4b48('0x21'));return _0x5ead25[_0x4b48('0x22')];});}});}else{logger[_0x4b48('0xc')](_0x4b48('0x23'));return request({'uri':util['format'](_0x4b48('0x20'),_0x5aaa97['remoteUri'])})[_0x4b48('0x1b')](function(_0x1540d6){logger[_0x4b48('0xc')](_0x4b48('0x21'));return _0x1540d6['user'];});}}function getEndUser(_0xf67730,_0x432dd1,_0x5db396){logger[_0x4b48('0xc')](_0x4b48('0x24'),_0x5db396);return request({'uri':util['format']('%s/search.json',_0xf67730[_0x4b48('0x10')]),'qs':{'query':util[_0x4b48('0xe')](_0x4b48('0x25'),_0x5db396)}})[_0x4b48('0x1b')](function(_0x31ba90){var _0x5d6fac;if(_0x31ba90[_0x4b48('0x1e')]['length']){_0x31ba90[_0x4b48('0x1e')]=_[_0x4b48('0x26')](_0x31ba90[_0x4b48('0x1e')],{'suspended':![],'role':'end-user'});if(_0x31ba90[_0x4b48('0x1e')][_0x4b48('0x27')]){_0x5d6fac=_['first'](_0x31ba90[_0x4b48('0x1e')]);}}if(_0x5d6fac){logger[_0x4b48('0xc')](_0x4b48('0x28'));return _0x5d6fac;}else{logger[_0x4b48('0xc')](_0x4b48('0x29'));return request({'uri':util[_0x4b48('0xe')]('%s/users.json',_0xf67730[_0x4b48('0x10')]),'method':_0x4b48('0x2a'),'body':{'user':{'role':'end-user','name':util[_0x4b48('0xe')](_0x4b48('0x2b'),_0x432dd1||_0x5db396),'phone':_0x5db396}}})['then'](function(_0xa2041){logger[_0x4b48('0xc')](_0x4b48('0x2c'));return _0xa2041[_0x4b48('0x22')];});}});}function getAuth(_0xddd9c){var _0x28d217;if(_0xddd9c[_0x4b48('0x2d')]===_0x4b48('0x2e')){_0x28d217=util['format'](_0x4b48('0x2f'),_0xddd9c['username'],_0xddd9c[_0x4b48('0x2e')]);}else if(_0xddd9c[_0x4b48('0x2d')]===_0x4b48('0x30')){_0x28d217=util['format']('%s/token:%s',_0xddd9c[_0x4b48('0x31')],_0xddd9c[_0x4b48('0x30')]);}return util[_0x4b48('0xe')](_0x4b48('0x32'),new Buffer(_0x28d217)[_0x4b48('0x33')](_0x4b48('0x34')));}function request(_0x4d919a){logger[_0x4b48('0x35')](_0x4b48('0x36'),JSON[_0x4b48('0x37')](_0x4d919a));return rp(_[_0x4b48('0x6')](_0x4d919a,{'method':_0x4b48('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x335174,_0x574522){var _0x103667=[];if(_0x335174&&_0x335174['length']>0x0){_0x103667=_['map'](_0x335174,_0x574522);}return _0x103667;}function getCustomFields(_0x514786,_0x2cdd83){var _0x415282=[];var _0xdf6f18={'custom_fields':[]};if(_0x514786[_0x4b48('0x27')]>0x0){_[_0x4b48('0x39')](_0x514786,function(_0x26f941){if(_[_0x4b48('0x3a')](['string','picklist'],_0x26f941[_0x4b48('0x3b')])&&_0x26f941[_0x4b48('0x3c')]&&!_0x26f941[_0x4b48('0x3d')]){_0xdf6f18[_0x26f941[_0x4b48('0x3c')][_0x4b48('0x3e')]()]=_0x26f941[_0x4b48('0x3f')]['toString']();}else if(_[_0x4b48('0x3a')]([_0x4b48('0x40'),_0x4b48('0x41')],_0x26f941[_0x4b48('0x3b')])&&_0x26f941[_0x4b48('0x42')]&&_0x26f941[_0x4b48('0x3d')]){_0xdf6f18[_0x4b48('0x43')]['push']({'id':_0x26f941[_0x4b48('0x42')],'value':_0x26f941[_0x4b48('0x3f')][_0x4b48('0x33')]()});}else if(_0x26f941['type']===_0x4b48('0x44')&&_0x26f941[_0x4b48('0x45')]&&_0x26f941['idField']&&_0x26f941[_0x4b48('0x3d')]){_0x2cdd83[_0x26f941['variableName']]&&_0xdf6f18[_0x4b48('0x43')][_0x4b48('0x46')]({'id':_0x26f941[_0x4b48('0x42')],'value':_0x2cdd83[_0x26f941['variableName']][_0x4b48('0x33')]()});}else if(_0x26f941[_0x4b48('0x3b')]===_0x4b48('0x47')&&_0x26f941[_0x4b48('0x48')]&&_0x26f941[_0x4b48('0x48')][_0x4b48('0x12')]&&_0x26f941[_0x4b48('0x42')]&&_0x26f941['customField']){_0x2cdd83[_0x26f941[_0x4b48('0x48')][_0x4b48('0x12')][_0x4b48('0x3e')]()]&&_0xdf6f18['custom_fields'][_0x4b48('0x46')]({'id':_0x26f941[_0x4b48('0x42')],'value':_0x2cdd83[_0x26f941[_0x4b48('0x48')][_0x4b48('0x12')]['toLowerCase']()][_0x4b48('0x33')]()});}});}return _0xdf6f18;}exports[_0x4b48('0x49')]=function(_0x34791b,_0x30e553,_0x242d95,_0x438e4d,_0x556f1a,_0x11ee9d){var _0x22f1e0,_0x2c4c33;_0x11ee9d[_0x4b48('0x10')]=intUtil[_0x4b48('0x4a')](_0x11ee9d['remoteUri']);_0x11ee9d[_0x4b48('0x4b')]=intUtil['stripTrailingSlash'](_0x11ee9d[_0x4b48('0x4b')]);if(_0x556f1a&&_0x556f1a['monitor_format']){logger[_0x4b48('0xc')](_0x4b48('0x4c'),_0x4b48('0x4d'));_0x30e553['recordingURL']=util[_0x4b48('0xe')](_0x4b48('0x4e'),_0x11ee9d[_0x4b48('0x4b')],_0x30e553[_0x4b48('0x4f')],md5(_0x30e553['uniqueid']));}else{_0x30e553[_0x4b48('0x50')]='';}headers[_0x4b48('0x51')]=getAuth(_0x11ee9d);return getUser(_0x11ee9d,_0x438e4d[_0x4b48('0x52')])[_0x4b48('0x1b')](function(_0x1fe801){_0x22f1e0=_0x1fe801;logger[_0x4b48('0xc')]('The\x20User\x20ID\x20is:',_0x22f1e0['id']);return getEndUser(_0x11ee9d,_0x30e553['calleridname'],_0x30e553[_0x4b48('0x53')]);})[_0x4b48('0x1b')](function(_0x1db549){_0x2c4c33=_0x1db549;logger[_0x4b48('0xc')](_0x4b48('0x54'),_0x2c4c33['id']);return getTicket(_0x11ee9d,_0x22f1e0,_0x2c4c33,_0x242d95,_0x30e553);})['then'](function(_0x4f8439){if(_0x4f8439){logger[_0x4b48('0xc')](_0x4b48('0x55'),_0x4f8439['id']);switch(_0x11ee9d[_0x4b48('0x3b')]){case _0x4b48('0x56'):logger['info'](_0x4b48('0x4c'),_0x4b48('0x57'));return request({'uri':util[_0x4b48('0xe')](_0x4b48('0x58'),_0x11ee9d[_0x4b48('0x10')],_0x22f1e0['id'],_0x4f8439['id']),'method':_0x4b48('0x2a')});case _0x4b48('0x59'):logger['info']('[QUEUE]',_0x4b48('0x5a'));emit(util[_0x4b48('0xe')](_0x4b48('0x5b'),_0x438e4d['name']),_0x4b48('0x5c'),{'uri':util[_0x4b48('0xe')]('%s/agent/tickets/%s',_0x11ee9d[_0x4b48('0x10')][_0x4b48('0x5d')](_0x4b48('0x5e'),''),_0x4f8439['id'])});break;default:logger[_0x4b48('0x5f')](_0x4b48('0x4c'),_0x4b48('0x60'));}}})['catch'](function(_0x10763a){logger[_0x4b48('0x5f')](_0x4b48('0x61'),util[_0x4b48('0x62')](_0x10763a,{'showHidden':!![],'depth':null}));});};exports[_0x4b48('0x63')]=function(_0x44e531,_0x46439b,_0x1f1f08,_0x53448c,_0x4d8ca9,_0x39260c,_0x1e30fe){var _0x2b6e21,_0x255bcd;_0x39260c[_0x4b48('0x10')]=intUtil[_0x4b48('0x4a')](_0x39260c[_0x4b48('0x10')]);_0x39260c[_0x4b48('0x4b')]=intUtil[_0x4b48('0x4a')](_0x39260c[_0x4b48('0x4b')]);if(_0x1e30fe&&_0x1e30fe[_0x4b48('0x64')]&&_0x1e30fe[_0x4b48('0x64')]!==_0x4b48('0x65')){logger[_0x4b48('0xc')](_0x4b48('0x66'),_0x4b48('0x4d'));_0x46439b[_0x4b48('0x50')]=util[_0x4b48('0xe')](_0x4b48('0x4e'),_0x39260c[_0x4b48('0x4b')],_0x46439b[_0x4b48('0x4f')],md5(_0x46439b['uniqueid']));}headers['Authorization']=getAuth(_0x39260c);return getUser(_0x39260c,_0x53448c[_0x4b48('0x52')])['then'](function(_0x2c39ca){_0x2b6e21=_0x2c39ca;logger[_0x4b48('0xc')](_0x4b48('0x67'),_0x2b6e21['id']);return getEndUser(_0x39260c,_0x46439b[_0x4b48('0x68')],_0x46439b[_0x4b48('0x69')]);})[_0x4b48('0x1b')](function(_0x1cd9b3){_0x255bcd=_0x1cd9b3;logger[_0x4b48('0xc')](_0x4b48('0x54'),_0x255bcd['id']);return getTicket(_0x39260c,_0x2b6e21,_0x255bcd,_0x1f1f08,_0x46439b);})[_0x4b48('0x1b')](function(_0x217121){if(_0x217121){logger['info'](_0x4b48('0x55'),_0x217121['id']);switch(_0x39260c[_0x4b48('0x3b')]){case _0x4b48('0x56'):logger[_0x4b48('0xc')](_0x4b48('0x66'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x4b48('0xe')](_0x4b48('0x58'),_0x39260c[_0x4b48('0x10')],_0x2b6e21['id'],_0x217121['id']),'method':_0x4b48('0x2a')});case _0x4b48('0x59'):logger[_0x4b48('0xc')](_0x4b48('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4b48('0xe')](_0x4b48('0x5b'),_0x53448c[_0x4b48('0x12')]),_0x4b48('0x5c'),{'uri':util[_0x4b48('0xe')](_0x4b48('0x6a'),_0x39260c[_0x4b48('0x10')][_0x4b48('0x5d')]('/api/v2',''),_0x217121['id'])});break;default:logger[_0x4b48('0x5f')](_0x4b48('0x66'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4b48('0x6b')](function(_0x3b2133){logger[_0x4b48('0x5f')](_0x4b48('0x6c'),util['inspect'](_0x3b2133,{'showHidden':!![],'depth':null}));});};exports[_0x4b48('0x6d')]=function(_0xf8c68a,_0x4adece,_0x2fc650,_0x520b56,_0x5c8fba,_0x31bc3d){var _0x2c2899,_0x5cf28c;_0x31bc3d[_0x4b48('0x10')]=intUtil[_0x4b48('0x4a')](_0x31bc3d[_0x4b48('0x10')]);_0x31bc3d[_0x4b48('0x4b')]=intUtil['stripTrailingSlash'](_0x31bc3d['serverUrl']);if(_0x5c8fba&&_0x5c8fba['monitor_format']){logger[_0x4b48('0xc')]('['+_0x4adece[_0x4b48('0x6e')]['toUpperCase']()+']',_0x4b48('0x4d'));_0x4adece[_0x4b48('0x50')]=util[_0x4b48('0xe')](_0x4b48('0x4e'),_0x31bc3d[_0x4b48('0x4b')],_0x4adece['uniqueid'],md5(_0x4adece[_0x4b48('0x4f')]));}else{_0x4adece[_0x4b48('0x50')]='';}headers[_0x4b48('0x51')]=getAuth(_0x31bc3d);return getUser(_0x31bc3d)[_0x4b48('0x1b')](function(_0x3c07c8){_0x2c2899=_0x3c07c8;logger['info'](_0x4b48('0x67'),_0x2c2899['id']);return getEndUser(_0x31bc3d,_0x4adece[_0x4b48('0x6f')],_0x4adece[_0x4b48('0x53')]);})[_0x4b48('0x1b')](function(_0x51647f){_0x5cf28c=_0x51647f;logger[_0x4b48('0xc')](_0x4b48('0x54'),_0x5cf28c['id']);return getTicket(_0x31bc3d,_0x2c2899,_0x5cf28c,_0x2fc650,_0x4adece);})[_0x4b48('0x1b')](function(_0x496982){if(_0x496982){logger[_0x4b48('0xc')](_0x4b48('0x55'),_0x496982['id']);}})[_0x4b48('0x6b')](function(_0x3e7669){logger[_0x4b48('0x5f')]('['+_0x4adece[_0x4b48('0x6e')]['toUpperCase']()+']'+_0x4b48('0x70'),util['inspect'](_0x3e7669,{'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 e92225c..718aac8 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 _0x43fd=['calleridname','calleridnum','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','recordingURL','com','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','lastevent','zoho.eu','Inbound','toUpperCase','lodash','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','picklist','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','talktime','Call_Duration','mm:ss','answertime','endtime','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Called','connect','Call_Result','rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','merge','Fields','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','email','The\x20User\x20ID\x20is:'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x43fd,0x150));var _0xd43f=function(_0x5d3920,_0xcf28e){_0x5d3920=_0x5d3920-0x0;var _0x3103ae=_0x43fd[_0x5d3920];return _0x3103ae;};'use strict';var _=require(_0xd43f('0x0'));var rp=require(_0xd43f('0x1'));var md5=require('md5');var util=require(_0xd43f('0x2'));var intUtil=require('./util');var moment=require(_0xd43f('0x3'));var Redis=require(_0xd43f('0x4'));var BPromise=require(_0xd43f('0x5'));var config=require(_0xd43f('0x6'));var logger=require(_0xd43f('0x7'))(_0xd43f('0x8'));config[_0xd43f('0x9')]=_[_0xd43f('0xa')](config[_0xd43f('0x9')],{'host':_0xd43f('0xb'),'port':0x18eb});var io=require(_0xd43f('0xc'))(new Redis(config[_0xd43f('0x9')]));function emit(_0x39a819,_0x44b1bf,_0x587add){io['to'](_0x39a819)[_0xd43f('0xd')](_0x44b1bf,_0x587add);}function request(_0x43b9db){logger[_0xd43f('0xe')]('[HTTP]',JSON[_0xd43f('0xf')](_0x43b9db));return rp(_0x43b9db);}function getCustomFields(_0x1815de,_0x4d675b){var _0x36e63c={};if(_0x1815de[_0xd43f('0x10')]>0x0){_[_0xd43f('0x11')](_0x1815de,function(_0x2550fa){if(_['includes'](['string',_0xd43f('0x12')],_0x2550fa[_0xd43f('0x13')])&&_0x2550fa['idField']){_0x36e63c[_0x2550fa[_0xd43f('0x14')]]=_0x2550fa['content']['toString']();}else if(_0x2550fa[_0xd43f('0x13')]===_0xd43f('0x15')&&_0x2550fa['variableName']&&_0x2550fa[_0xd43f('0x14')]&&_0x4d675b[_0x2550fa[_0xd43f('0x16')]]){_0x36e63c[_0x2550fa['idField']]=_0x4d675b[_0x2550fa[_0xd43f('0x16')]][_0xd43f('0x17')]();}else if(_0x2550fa[_0xd43f('0x13')]===_0xd43f('0x18')&&_0x2550fa[_0xd43f('0x19')]&&_0x2550fa['Variable']['name']&&_0x2550fa['idField']&&_0x4d675b[_0x2550fa[_0xd43f('0x19')][_0xd43f('0x1a')][_0xd43f('0x1b')]()]){_0x36e63c[_0x2550fa[_0xd43f('0x14')]]=_0x4d675b[_0x2550fa['Variable'][_0xd43f('0x1a')][_0xd43f('0x1b')]()][_0xd43f('0x17')]();}});}return _0x36e63c;}function getName(_0x2702cf){if(_0x2702cf[_0xd43f('0x1c')]('\x20')>0x0){var _0x4b5608=_0x2702cf[_0xd43f('0x1d')](/ (.+)/);if(_0x4b5608[0x1]){return _0x4b5608;}}return[_0x2702cf,_0x2702cf];}var accountsTokens={};function getAccessToken(_0x5bae9e){return new Promise(function(_0x1ad9d3,_0x5d93f4){if(!_[_0xd43f('0x1e')](accountsTokens[_0x5bae9e['id']])&&!_[_0xd43f('0x1e')](accountsTokens[_0x5bae9e['id']]['access_token'])){if(moment()[_0xd43f('0x1f')](accountsTokens[_0x5bae9e['id']][_0xd43f('0x20')])){_0x1ad9d3(accountsTokens[_0x5bae9e['id']][_0xd43f('0x21')]);}}var _0x58bd30;switch(_0x5bae9e[_0xd43f('0x22')]){case'US':_0x58bd30='https://accounts.zoho.com';break;case'AU':_0x58bd30=_0xd43f('0x23');break;case'EU':_0x58bd30=_0xd43f('0x24');break;case'IN':_0x58bd30=_0xd43f('0x25');break;case'CN':_0x58bd30=_0xd43f('0x26');break;default:_0x58bd30=_0xd43f('0x24');break;}var _0x364d67={'method':'POST','uri':_0x58bd30+_0xd43f('0x27'),'qs':{'refresh_token':_0x5bae9e[_0xd43f('0x28')],'client_id':_0x5bae9e[_0xd43f('0x29')],'client_secret':_0x5bae9e[_0xd43f('0x2a')],'grant_type':_0xd43f('0x2b')},'json':!![]};return rp(_0x364d67)[_0xd43f('0x2c')](function(_0x2df5b4){accountsTokens[_0x5bae9e['id']]={'access_token':_0x2df5b4[_0xd43f('0x21')],'expires_in':moment()[_0xd43f('0x2d')](_0x2df5b4[_0xd43f('0x20')],'seconds')};_0x1ad9d3(_0x2df5b4[_0xd43f('0x21')]);})[_0xd43f('0x2e')](function(_0xed6845){logger[_0xd43f('0x2f')](_0xd43f('0x30'),_0xed6845[_0xd43f('0x31')]);_0x5d93f4(_0xed6845);});});}function getUser(_0x4efdb5,_0x23293d,_0x2442ea,_0x1db45c){logger[_0xd43f('0x32')](_0xd43f('0x33'));return request({'method':_0xd43f('0x34'),'uri':util[_0xd43f('0x35')](_0xd43f('0x36'),_0x23293d),'qs':{'type':_0xd43f('0x37')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4efdb5},'json':!![]})[_0xd43f('0x2c')](function(_0x422680){if(_0x422680['users']){var _0x3de6ca=-0x1;if(_['isArrayLikeObject'](_0x422680[_0xd43f('0x38')])){if(!_['isNil'](_0x1db45c)){_0x3de6ca=_[_0xd43f('0x39')](_0x422680['users'],function(_0x288ae9){return _0x288ae9['email']===_0x1db45c;});}if(_0x3de6ca>=0x0){logger[_0xd43f('0x32')](_0xd43f('0x3a'));}else{logger['info'](_0xd43f('0x3b'));_0x3de6ca=_[_0xd43f('0x39')](_0x422680[_0xd43f('0x38')],function(_0x32171d){return _0x32171d[_0xd43f('0x3c')][_0xd43f('0x1a')]==='Administrator';});}return _0x422680[_0xd43f('0x38')][_0x3de6ca];}else{if(_0x422680[_0xd43f('0x3d')]['profile'][_0xd43f('0x1a')]===_0xd43f('0x3e')){logger[_0xd43f('0x32')](_0xd43f('0x3b'));user=_0x422680[_0xd43f('0x3d')];return user;}else{logger['error'](_0xd43f('0x3f'),JSON['stringify'](_0x422680));throw new Error(_0xd43f('0x40')+JSON[_0xd43f('0xf')](_0x422680));}}}else{logger[_0xd43f('0x2f')](_0xd43f('0x3f'),JSON[_0xd43f('0xf')](_0x422680));throw new Error(_0xd43f('0x40')+JSON['stringify'](_0x422680));}})[_0xd43f('0x2e')](function(_0x1ea54d){console['error'](_0x1ea54d);});}function getZohoUser(_0x95e3b9,_0x28b2fa){return new BPromise(function(_0x29edbc,_0x48982d){request(_0x95e3b9)[_0xd43f('0x2c')](function(_0x4f0a86){var _0x20b56d=null;if(_0x4f0a86){_0x20b56d=_0x4f0a86[_0xd43f('0x41')][0x0];_0x20b56d['enduserType']=_0x28b2fa;}_0x29edbc(_0x20b56d);})[_0xd43f('0x2e')](function(_0x579f4b){_0x48982d(_0x579f4b);});});}function createEndUser(_0x1ec9f3,_0x2c7609,_0x4b9404,_0x4c8f8e,_0x5e7a0a,_0x5940af){var _0x4b9404=getName(_0x4b9404);return request({'method':_0xd43f('0x42'),'uri':_0xd43f('0x43')+_0x2c7609+_0xd43f('0x44')+_[_0xd43f('0x45')](_0x5940af[_0xd43f('0x46')])+'s','body':{'data':[{'Last_Name':_0x4b9404[0x1],'First_Name':_0x4b9404[0x0],'Phone':_0x4c8f8e,'Owner':{'name':!_[_0xd43f('0x1e')](_0x5e7a0a[_0xd43f('0x47')]['name'])?_0x5e7a0a['role'][_0xd43f('0x1a')]:!_[_0xd43f('0x1e')](_0x5e7a0a[_0xd43f('0x48')])?_0x5e7a0a[_0xd43f('0x48')]+'\x20'+_0x5e7a0a[_0xd43f('0x49')]:_0x5e7a0a[_0xd43f('0x49')],'id':_0x5e7a0a['id']}}]},'headers':{'Authorization':_0xd43f('0x4a')+_0x1ec9f3},'json':!![]})[_0xd43f('0x2c')](function(_0x41bf12){if(_0x41bf12&&_0x41bf12['data'][0x0][_0xd43f('0x4b')]===_0xd43f('0x4c')){var _0x417a58=_0x41bf12[_0xd43f('0x41')][0x0][_0xd43f('0x4d')];_0x417a58[_0xd43f('0x4e')]=_[_0xd43f('0x45')](_0x5940af[_0xd43f('0x46')])+'s';return _0x417a58;}logger['error'](_0xd43f('0x3f'),JSON['stringify'](data));throw new Error(_0xd43f('0x4f')+JSON[_0xd43f('0xf')](data));})[_0xd43f('0x2e')](function(_0x5b19bb){console['log'](_0xd43f('0x50'),_0x5b19bb);});}function getEndUser(_0x517327,_0x8b96c1,_0x2d7e10,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9){var _0x18d6b6={'method':_0xd43f('0x34'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x517327},'json':!![]};switch(_0x12d5b9[_0xd43f('0x51')]){case _0xd43f('0x52'):_0x18d6b6[_0xd43f('0x53')]='https://www.zohoapis.'+_0x8b96c1+_0xd43f('0x54')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x55'))['then'](function(_0x1e64a2){if(_0x1e64a2)return _0x1e64a2;_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+_0xd43f('0x56')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x57'))['then'](function(_0x4ae991){if(_0x4ae991)return _0x4ae991;if(_0x12d5b9[_0xd43f('0x46')]!=_0xd43f('0x58')){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});});break;case'contact':_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+_0xd43f('0x54')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x55'))[_0xd43f('0x2c')](function(_0x39ad8f){if(_0x39ad8f)return _0x39ad8f;if(_0x12d5b9['moduleCreate']!='nothing'){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});break;case _0xd43f('0x59'):_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x57'))['then'](function(_0x24b830){if(_0x24b830)return _0x24b830;if(_0x12d5b9['moduleCreate']!=_0xd43f('0x58')){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});break;}}function getCall(_0x51833e,_0x89f548,_0x5041a6,_0x1ba071,_0x620665,_0x4c3036,_0x3ad9c4,_0x4972aa){logger[_0xd43f('0x32')](_0xd43f('0x5a'));var _0x41bfac={};_0x41bfac['Owner']={'name':!_[_0xd43f('0x1e')](_0x1ba071[_0xd43f('0x47')][_0xd43f('0x1a')])&&!_[_0xd43f('0x1e')](_0x1ba071[_0xd43f('0x3c')][_0xd43f('0x1a')])&&_0x1ba071[_0xd43f('0x3c')][_0xd43f('0x1a')]===_0xd43f('0x5b')?_0x1ba071[_0xd43f('0x47')]['name']:!_['isNil'](_0x1ba071[_0xd43f('0x48')])?_0x1ba071['first_name']+'\x20'+_0x1ba071[_0xd43f('0x49')]:_0x1ba071[_0xd43f('0x49')],'id':_0x1ba071['id']};_0x41bfac['Subject']=intUtil[_0xd43f('0x5c')](_0x4c3036[_0xd43f('0x5d')],_0x3ad9c4,'\x20');_0x41bfac[_0xd43f('0x5e')]=intUtil[_0xd43f('0x5c')](_0x4c3036[_0xd43f('0x5f')],_0x3ad9c4,'\x0a');if(_0x620665[_0xd43f('0x4e')]===_0xd43f('0x55')){_0x41bfac[_0xd43f('0x60')]={'name':!_[_0xd43f('0x1e')](_0x620665['Full_Name'])?_0x620665['Full_Name']:!_[_0xd43f('0x1e')](_0x620665[_0xd43f('0x61')])?_0x620665[_0xd43f('0x61')]+'\x20'+_0x620665[_0xd43f('0x62')]:_0x620665['Last_Name'],'id':_0x620665['id']};}if(_0x620665[_0xd43f('0x4e')]===_0xd43f('0x57')){_0x41bfac[_0xd43f('0x63')]={'name':!_['isNil'](_0x620665['Full_Name'])?_0x620665[_0xd43f('0x64')]:!_[_0xd43f('0x1e')](_0x620665['First_Name'])?_0x620665[_0xd43f('0x61')]+'\x20'+_0x620665[_0xd43f('0x62')]:_0x620665['Last_Name'],'id':_0x620665['id']};_0x41bfac['$se_module']=_['startCase'](_0x620665[_0xd43f('0x4e')]);}if(_0x3ad9c4[_0xd43f('0x65')]){_0x41bfac[_0xd43f('0x66')]=moment['utc'](parseInt(_0x3ad9c4[_0xd43f('0x65')])*0x3e8)[_0xd43f('0x35')](_0xd43f('0x67'));}else if(_0x3ad9c4[_0xd43f('0x68')]&&_0x3ad9c4[_0xd43f('0x69')]){_0x41bfac['Call_Duration']=moment[_0xd43f('0x6a')](moment(_0x3ad9c4[_0xd43f('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0xd43f('0x6b')](moment(_0x3ad9c4[_0xd43f('0x6c')],_0xd43f('0x6d'))))['format'](_0xd43f('0x67'));}switch(_0x3ad9c4['lastevent']){case _0xd43f('0x6e'):_0x41bfac['Call_Result']=_0xd43f('0x6f');break;case'complete':case _0xd43f('0x70'):_0x41bfac[_0xd43f('0x71')]='Answered';break;case _0xd43f('0x72'):_0x41bfac[_0xd43f('0x71')]='Rejected';break;case _0xd43f('0x73'):_0x41bfac[_0xd43f('0x71')]=_0xd43f('0x74');break;case _0xd43f('0x75'):_0x41bfac['Call_Result']='Timeout';default:}_0x41bfac[_0xd43f('0x76')]=(_0x4972aa===_0xd43f('0x77')?moment(_0x3ad9c4[_0xd43f('0x6c')])[_0xd43f('0x35')](_0xd43f('0x6d')):moment(_0x3ad9c4[_0xd43f('0x78')])[_0xd43f('0x35')](_0xd43f('0x6d')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x41bfac['Call_Type']=_0x4972aa||'Inbound';_0x41bfac=_[_0xd43f('0x79')](_0x41bfac,getCustomFields(_0x4c3036[_0xd43f('0x7a')],_0x3ad9c4));return request({'method':'POST','uri':_0xd43f('0x43')+_0x89f548+'/crm/v2/Calls','headers':{'Authorization':_0xd43f('0x4a')+_0x51833e},'body':{'data':[_0x41bfac]},'json':!![]})[_0xd43f('0x2c')](function(_0x4c6d2a){if(_0x4c6d2a&&_0x4c6d2a['data'][0x0][_0xd43f('0x4b')]===_0xd43f('0x4c')){logger[_0xd43f('0x32')](_0xd43f('0x7b'));return{'id':_0x4c6d2a[_0xd43f('0x41')][0x0][_0xd43f('0x4d')]['id']};}})[_0xd43f('0x2e')](function(_0x389c34){logger[_0xd43f('0x32')](_0xd43f('0x7c'),_0x389c34['stack']);console[_0xd43f('0x7d')](_0xd43f('0x7c'),_0x389c34);});}exports[_0xd43f('0x7e')]=function(_0x105344,_0x4ee2c5,_0x5f42e4,_0x1e65b4,_0x47f4de,_0x172a48){var _0x5c8dd6,_0x3123c5,_0x1ead63;_0x172a48[_0xd43f('0x7f')]=intUtil[_0xd43f('0x80')](_0x172a48['host']);_0x172a48[_0xd43f('0x81')]=intUtil[_0xd43f('0x80')](_0x172a48[_0xd43f('0x81')]);if(_0x47f4de&&_0x47f4de[_0xd43f('0x82')]){logger[_0xd43f('0x32')](_0xd43f('0x83'),_0xd43f('0x84'));_0x4ee2c5['recordingURL']=_0x172a48['serverUrl']+_0xd43f('0x85')+_0x4ee2c5[_0xd43f('0x86')]+_0xd43f('0x87')+md5(_0x4ee2c5[_0xd43f('0x86')]);}else{_0x4ee2c5['recordingURL']='';}var _0x574545=_0x172a48[_0xd43f('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x172a48)[_0xd43f('0x2c')](function(_0x2629ca){_0x1ead63=_0x2629ca;return getUser(_0x1ead63,_0x574545,_0x172a48,_0x1e65b4[_0xd43f('0x88')]);})[_0xd43f('0x2c')](function(_0x44ee2f){_0x5c8dd6=_0x44ee2f;logger['info'](_0xd43f('0x89'),_0x5c8dd6['id']);return getEndUser(_0x1ead63,_0x574545,_0x172a48,_0x4ee2c5[_0xd43f('0x8a')],_0x4ee2c5[_0xd43f('0x8b')],_0x5c8dd6,_0x5f42e4);})[_0xd43f('0x2c')](function(_0x113417){_0x3123c5=_0x113417;return getCall(_0x1ead63,_0x574545,_0x172a48,_0x5c8dd6,_0x3123c5,_0x5f42e4,_0x4ee2c5,'Inbound');})['then'](function(_0x207896){if(_0x207896){logger[_0xd43f('0x32')]('The\x20Call\x20ID\x20is:',_0x207896['id']);logger[_0xd43f('0x32')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd43f('0x8c'),_0x1e65b4[_0xd43f('0x1a')]),_0xd43f('0x8d'),{'uri':'https://crm.'+_0x172a48[_0xd43f('0x7f')]+_0xd43f('0x8e')+_0x207896['id']});}})['catch'](function(_0x409f28){logger[_0xd43f('0x2f')](_0xd43f('0x83'),JSON[_0xd43f('0xf')](_0x409f28));});};exports[_0xd43f('0x77')]=function(_0x8a0174,_0x5e8444,_0xea3f2f,_0x5c4c15,_0x50539a,_0x157446,_0x4d27cf){var _0x14a9ba,_0x4f8cb6,_0x2c3f0e;_0x157446[_0xd43f('0x7f')]=intUtil[_0xd43f('0x80')](_0x157446['host']);_0x157446['serverUrl']=intUtil['stripTrailingSlash'](_0x157446['serverUrl']);if(_0x4d27cf&&_0x4d27cf[_0xd43f('0x8f')]&&_0x4d27cf[_0xd43f('0x8f')]!==_0xd43f('0x90')){logger[_0xd43f('0x32')](_0xd43f('0x91'),_0xd43f('0x84'));_0x5e8444[_0xd43f('0x92')]=_0x157446[_0xd43f('0x81')]+'/api/voice/recordings/'+_0x5e8444['uniqueid']+_0xd43f('0x87')+md5(_0x5e8444[_0xd43f('0x86')]);}var _0x39c1e9=_0x157446[_0xd43f('0x7f')]==='zoho.eu'?'eu':_0xd43f('0x93');return getAccessToken(_0x157446)[_0xd43f('0x2c')](function(_0x4cc1de){_0x2c3f0e=_0x4cc1de;return getUser(_0x2c3f0e,_0x39c1e9,_0x157446,_0x5c4c15['email']);})['then'](function(_0x247c04){_0x14a9ba=_0x247c04;logger['info'](_0xd43f('0x89'),_0x14a9ba['id']);return getEndUser(_0x2c3f0e,_0x39c1e9,_0x157446,_0x5e8444[_0xd43f('0x94')],_0x5e8444['destcalleridnum'],_0x14a9ba,_0xea3f2f);})[_0xd43f('0x2c')](function(_0x4b126c){_0x4f8cb6=_0x4b126c;return getCall(_0x2c3f0e,_0x39c1e9,_0x157446,_0x14a9ba,_0x4f8cb6,_0xea3f2f,_0x5e8444,_0xd43f('0x95'));})['then'](function(_0x5282ac){if(_0x5282ac){logger[_0xd43f('0x32')](_0xd43f('0x96'),_0x5282ac['id']);logger['info'](_0xd43f('0x91'),_0xd43f('0x97'));emit(util[_0xd43f('0x35')](_0xd43f('0x8c'),_0x5c4c15[_0xd43f('0x1a')]),_0xd43f('0x8d'),{'uri':_0xd43f('0x98')+_0x157446[_0xd43f('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5282ac['id']});}})[_0xd43f('0x2e')](function(_0x497e6a){logger[_0xd43f('0x2f')]('[OUTBOUND]',JSON[_0xd43f('0xf')](_0x497e6a));});};exports[_0xd43f('0x99')]=function(_0x55fb55,_0x29d70c,_0x433ebe,_0x1120a8,_0x3b07ca,_0xaf2173){var _0x8172ca,_0x1ec37b,_0x3bb2e6;_0xaf2173[_0xd43f('0x7f')]=intUtil['stripTrailingSlash'](_0xaf2173[_0xd43f('0x7f')]);_0xaf2173[_0xd43f('0x81')]=intUtil['stripTrailingSlash'](_0xaf2173[_0xd43f('0x81')]);if(_0x3b07ca&&_0x3b07ca['monitor_format']){logger['info']('['+_0x29d70c[_0xd43f('0x9a')]['toUpperCase']()+']',_0xd43f('0x84'));_0x29d70c[_0xd43f('0x92')]=_0xaf2173[_0xd43f('0x81')]+_0xd43f('0x85')+_0x29d70c[_0xd43f('0x86')]+_0xd43f('0x87')+md5(_0x29d70c[_0xd43f('0x86')]);}else{_0x29d70c[_0xd43f('0x92')]='';}var _0x41796d=_0xaf2173['host']===_0xd43f('0x9b')?'eu':'com';return getAccessToken(_0xaf2173)['then'](function(_0x2f7597){_0x3bb2e6=_0x2f7597;return getUser(_0x3bb2e6,_0x41796d,_0xaf2173);})[_0xd43f('0x2c')](function(_0x462445){_0x8172ca=_0x462445;logger[_0xd43f('0x32')](_0xd43f('0x89'),_0x8172ca['id']);return getEndUser(_0x3bb2e6,_0x41796d,_0xaf2173,_0x29d70c[_0xd43f('0x8a')],_0x29d70c[_0xd43f('0x8b')],_0x8172ca,_0x433ebe);})['then'](function(_0x5f258b){_0x1ec37b=_0x5f258b;return getCall(_0x3bb2e6,_0x41796d,_0xaf2173,_0x8172ca,_0x1ec37b,_0x433ebe,_0x29d70c,_0xd43f('0x9c'));})[_0xd43f('0x2c')](function(_0x2a930a){if(_0x2a930a){logger[_0xd43f('0x32')]('The\x20Call\x20ID\x20is:',_0x2a930a['id']);}})['catch'](function(_0x2cf8b4){logger['error']('['+_0x29d70c[_0xd43f('0x9a')][_0xd43f('0x9d')]()+']',JSON['stringify'](_0x2cf8b4));});}; \ No newline at end of file +var _0x2b55=['user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','recordingURL','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','[OUTBOUND]','unmanaged','toUpperCase','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','info','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','/crm/v2/Calls','code','Call\x20created!','err','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','com','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x3859f5,_0x22db78){var _0x2025df=function(_0x410a6b){while(--_0x410a6b){_0x3859f5['push'](_0x3859f5['shift']());}};_0x2025df(++_0x22db78);}(_0x2b55,0x1f0));var _0x52b5=function(_0x33cc21,_0x502f93){_0x33cc21=_0x33cc21-0x0;var _0x8df5ee=_0x2b55[_0x33cc21];return _0x8df5ee;};'use strict';var _=require(_0x52b5('0x0'));var rp=require(_0x52b5('0x1'));var md5=require(_0x52b5('0x2'));var util=require('util');var intUtil=require(_0x52b5('0x3'));var moment=require(_0x52b5('0x4'));var Redis=require('ioredis');var BPromise=require(_0x52b5('0x5'));var config=require(_0x52b5('0x6'));var logger=require(_0x52b5('0x7'))(_0x52b5('0x8'));config[_0x52b5('0x9')]=_['defaults'](config[_0x52b5('0x9')],{'host':_0x52b5('0xa'),'port':0x18eb});var io=require(_0x52b5('0xb'))(new Redis(config[_0x52b5('0x9')]));function emit(_0x184152,_0x305344,_0x290523){io['to'](_0x184152)[_0x52b5('0xc')](_0x305344,_0x290523);}function request(_0x7bc05c){logger[_0x52b5('0xd')](_0x52b5('0xe'),JSON[_0x52b5('0xf')](_0x7bc05c));return rp(_0x7bc05c);}function getCustomFields(_0x31fc9c,_0x3b7101){var _0xd8a2f9={};if(_0x31fc9c['length']>0x0){_[_0x52b5('0x10')](_0x31fc9c,function(_0xd2ccdf){if(_['includes']([_0x52b5('0x11'),_0x52b5('0x12')],_0xd2ccdf[_0x52b5('0x13')])&&_0xd2ccdf[_0x52b5('0x14')]){_0xd8a2f9[_0xd2ccdf[_0x52b5('0x14')]]=_0xd2ccdf[_0x52b5('0x15')][_0x52b5('0x16')]();}else if(_0xd2ccdf['type']===_0x52b5('0x17')&&_0xd2ccdf[_0x52b5('0x18')]&&_0xd2ccdf[_0x52b5('0x14')]&&_0x3b7101[_0xd2ccdf[_0x52b5('0x18')]]){_0xd8a2f9[_0xd2ccdf['idField']]=_0x3b7101[_0xd2ccdf['variableName']][_0x52b5('0x16')]();}else if(_0xd2ccdf[_0x52b5('0x13')]===_0x52b5('0x19')&&_0xd2ccdf['Variable']&&_0xd2ccdf[_0x52b5('0x1a')][_0x52b5('0x1b')]&&_0xd2ccdf['idField']&&_0x3b7101[_0xd2ccdf[_0x52b5('0x1a')][_0x52b5('0x1b')][_0x52b5('0x1c')]()]){_0xd8a2f9[_0xd2ccdf[_0x52b5('0x14')]]=_0x3b7101[_0xd2ccdf[_0x52b5('0x1a')][_0x52b5('0x1b')]['toLowerCase']()][_0x52b5('0x16')]();}});}return _0xd8a2f9;}function getName(_0x1cb2b3){if(_0x1cb2b3[_0x52b5('0x1d')]('\x20')>0x0){var _0x6cfd32=_0x1cb2b3[_0x52b5('0x1e')](/ (.+)/);if(_0x6cfd32[0x1]){return _0x6cfd32;}}return[_0x1cb2b3,_0x1cb2b3];}var accountsTokens={};function getAccessToken(_0x1e4bad){return new Promise(function(_0x57a730,_0x588cfe){if(!_[_0x52b5('0x1f')](accountsTokens[_0x1e4bad['id']])&&!_[_0x52b5('0x1f')](accountsTokens[_0x1e4bad['id']][_0x52b5('0x20')])){if(moment()[_0x52b5('0x21')](accountsTokens[_0x1e4bad['id']][_0x52b5('0x22')])){_0x57a730(accountsTokens[_0x1e4bad['id']]['access_token']);}}var _0x26fb21;switch(_0x1e4bad[_0x52b5('0x23')]){case'US':_0x26fb21=_0x52b5('0x24');break;case'AU':_0x26fb21=_0x52b5('0x25');break;case'EU':_0x26fb21=_0x52b5('0x26');break;case'IN':_0x26fb21=_0x52b5('0x27');break;case'CN':_0x26fb21='https://accounts.zoho.com.cn';break;default:_0x26fb21=_0x52b5('0x26');break;}var _0x528539={'method':_0x52b5('0x28'),'uri':_0x26fb21+_0x52b5('0x29'),'qs':{'refresh_token':_0x1e4bad[_0x52b5('0x2a')],'client_id':_0x1e4bad[_0x52b5('0x2b')],'client_secret':_0x1e4bad[_0x52b5('0x2c')],'grant_type':_0x52b5('0x2d')},'json':!![]};return rp(_0x528539)[_0x52b5('0x2e')](function(_0xd10d63){accountsTokens[_0x1e4bad['id']]={'access_token':_0xd10d63[_0x52b5('0x20')],'expires_in':moment()['add'](_0xd10d63[_0x52b5('0x22')],_0x52b5('0x2f'))};_0x57a730(_0xd10d63['access_token']);})[_0x52b5('0x30')](function(_0x48602c){logger[_0x52b5('0x31')](_0x52b5('0x32'),_0x48602c[_0x52b5('0x33')]);_0x588cfe(_0x48602c);});});}function getUser(_0x37971e,_0x2f72a0,_0x39a850,_0x48aa69){logger['info'](_0x52b5('0x34'));return request({'method':'GET','uri':util[_0x52b5('0x35')](_0x52b5('0x36'),_0x2f72a0),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x52b5('0x37')+_0x37971e},'json':!![]})[_0x52b5('0x2e')](function(_0x1bd335){if(_0x1bd335[_0x52b5('0x38')]){var _0x23ab54=-0x1;if(_[_0x52b5('0x39')](_0x1bd335[_0x52b5('0x38')])){if(!_[_0x52b5('0x1f')](_0x48aa69)){_0x23ab54=_[_0x52b5('0x3a')](_0x1bd335[_0x52b5('0x38')],function(_0x2bb70b){return _0x2bb70b[_0x52b5('0x3b')]===_0x48aa69;});}if(_0x23ab54>=0x0){logger['info'](_0x52b5('0x3c'));}else{logger['info'](_0x52b5('0x3d'));_0x23ab54=_[_0x52b5('0x3a')](_0x1bd335['users'],function(_0x2417cb){return _0x2417cb[_0x52b5('0x3e')][_0x52b5('0x1b')]==='Administrator';});}return _0x1bd335['users'][_0x23ab54];}else{if(_0x1bd335['user'][_0x52b5('0x3e')][_0x52b5('0x1b')]==='Administrator'){logger[_0x52b5('0x3f')](_0x52b5('0x3d'));user=_0x1bd335['user'];return user;}else{logger[_0x52b5('0x31')](_0x52b5('0x40'),JSON[_0x52b5('0xf')](_0x1bd335));throw new Error(_0x52b5('0x41')+JSON[_0x52b5('0xf')](_0x1bd335));}}}else{logger[_0x52b5('0x31')](_0x52b5('0x40'),JSON[_0x52b5('0xf')](_0x1bd335));throw new Error(_0x52b5('0x41')+JSON['stringify'](_0x1bd335));}})[_0x52b5('0x30')](function(_0x532787){console[_0x52b5('0x31')](_0x532787);});}function getZohoUser(_0x438d44,_0xee3ee2){return new BPromise(function(_0x45b7f4,_0x206472){request(_0x438d44)[_0x52b5('0x2e')](function(_0x13fa5f){var _0x24e157=null;if(_0x13fa5f){_0x24e157=_0x13fa5f[_0x52b5('0x42')][0x0];_0x24e157['enduserType']=_0xee3ee2;}_0x45b7f4(_0x24e157);})['catch'](function(_0x39719a){_0x206472(_0x39719a);});});}function createEndUser(_0x5d4761,_0xc64363,_0x484359,_0x401bf4,_0x12ede7,_0x1db281){var _0x484359=getName(_0x484359);return request({'method':_0x52b5('0x28'),'uri':_0x52b5('0x43')+_0xc64363+'/crm/v2/'+_[_0x52b5('0x44')](_0x1db281[_0x52b5('0x45')])+'s','body':{'data':[{'Last_Name':_0x484359[0x1],'First_Name':_0x484359[0x0],'Phone':_0x401bf4,'Owner':{'name':!_[_0x52b5('0x1f')](_0x12ede7['role'][_0x52b5('0x1b')])?_0x12ede7[_0x52b5('0x46')][_0x52b5('0x1b')]:!_['isNil'](_0x12ede7[_0x52b5('0x47')])?_0x12ede7[_0x52b5('0x47')]+'\x20'+_0x12ede7[_0x52b5('0x48')]:_0x12ede7[_0x52b5('0x48')],'id':_0x12ede7['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d4761},'json':!![]})[_0x52b5('0x2e')](function(_0x5628be){if(_0x5628be&&_0x5628be[_0x52b5('0x42')][0x0]['code']===_0x52b5('0x49')){var _0x10522d=_0x5628be['data'][0x0][_0x52b5('0x4a')];_0x10522d[_0x52b5('0x4b')]=_[_0x52b5('0x44')](_0x1db281[_0x52b5('0x45')])+'s';return _0x10522d;}logger[_0x52b5('0x31')](_0x52b5('0x40'),JSON[_0x52b5('0xf')](data));throw new Error(_0x52b5('0x4c')+JSON[_0x52b5('0xf')](data));})['catch'](function(_0x5d6734){console[_0x52b5('0x4d')](_0x52b5('0x4e'),_0x5d6734);});}function getEndUser(_0x556349,_0x204ec5,_0x4f0e9c,_0x370bd5,_0x12c9cf,_0x27ef80,_0xea8dad){var _0x3fabf9={'method':_0x52b5('0x4f'),'uri':'','headers':{'Authorization':_0x52b5('0x37')+_0x556349},'json':!![]};switch(_0xea8dad[_0x52b5('0x50')]){case _0x52b5('0x51'):_0x3fabf9[_0x52b5('0x52')]=_0x52b5('0x43')+_0x204ec5+_0x52b5('0x53')+_0x12c9cf+'))';return getZohoUser(_0x3fabf9,_0x52b5('0x54'))[_0x52b5('0x2e')](function(_0x2eb478){if(_0x2eb478)return _0x2eb478;_0x3fabf9[_0x52b5('0x52')]=_0x52b5('0x43')+_0x204ec5+_0x52b5('0x55')+_0x12c9cf+'))';return getZohoUser(_0x3fabf9,_0x52b5('0x56'))['then'](function(_0x489292){if(_0x489292)return _0x489292;if(_0xea8dad[_0x52b5('0x45')]!=_0x52b5('0x57')){return createEndUser(_0x556349,_0x204ec5,_0x370bd5,_0x12c9cf,_0x27ef80,_0xea8dad);}else{return{};}});});break;case _0x52b5('0x58'):_0x3fabf9[_0x52b5('0x52')]=_0x52b5('0x43')+_0x204ec5+_0x52b5('0x53')+_0x12c9cf+'))';return getZohoUser(_0x3fabf9,_0x52b5('0x54'))[_0x52b5('0x2e')](function(_0x2b5cfc){if(_0x2b5cfc)return _0x2b5cfc;if(_0xea8dad['moduleCreate']!=_0x52b5('0x57')){return createEndUser(_0x556349,_0x204ec5,_0x370bd5,_0x12c9cf,_0x27ef80,_0xea8dad);}else{return{};}});break;case _0x52b5('0x59'):_0x3fabf9['uri']=_0x52b5('0x43')+_0x204ec5+_0x52b5('0x55')+_0x12c9cf+'))';return getZohoUser(_0x3fabf9,_0x52b5('0x56'))[_0x52b5('0x2e')](function(_0x76507){if(_0x76507)return _0x76507;if(_0xea8dad['moduleCreate']!='nothing'){return createEndUser(_0x556349,_0x204ec5,_0x370bd5,_0x12c9cf,_0x27ef80,_0xea8dad);}else{return{};}});break;}}function getCall(_0x4dc255,_0x4ef4d1,_0x3619bc,_0x47f069,_0x11994e,_0x3edb07,_0x44fc8c,_0x58eb33){logger[_0x52b5('0x3f')](_0x52b5('0x5a'));var _0x22b503={};_0x22b503[_0x52b5('0x5b')]={'name':!_[_0x52b5('0x1f')](_0x47f069['role'][_0x52b5('0x1b')])&&!_[_0x52b5('0x1f')](_0x47f069['profile'][_0x52b5('0x1b')])&&_0x47f069[_0x52b5('0x3e')][_0x52b5('0x1b')]===_0x52b5('0x5c')?_0x47f069[_0x52b5('0x46')][_0x52b5('0x1b')]:!_[_0x52b5('0x1f')](_0x47f069[_0x52b5('0x47')])?_0x47f069[_0x52b5('0x47')]+'\x20'+_0x47f069[_0x52b5('0x48')]:_0x47f069[_0x52b5('0x48')],'id':_0x47f069['id']};_0x22b503[_0x52b5('0x5d')]=intUtil[_0x52b5('0x5e')](_0x3edb07[_0x52b5('0x5f')],_0x44fc8c,'\x20');_0x22b503[_0x52b5('0x60')]=intUtil[_0x52b5('0x5e')](_0x3edb07[_0x52b5('0x61')],_0x44fc8c,'\x0a');if(_0x11994e[_0x52b5('0x4b')]===_0x52b5('0x54')){_0x22b503[_0x52b5('0x62')]={'name':!_[_0x52b5('0x1f')](_0x11994e['Full_Name'])?_0x11994e[_0x52b5('0x63')]:!_[_0x52b5('0x1f')](_0x11994e['First_Name'])?_0x11994e[_0x52b5('0x64')]+'\x20'+_0x11994e[_0x52b5('0x65')]:_0x11994e[_0x52b5('0x65')],'id':_0x11994e['id']};}if(_0x11994e[_0x52b5('0x4b')]==='Leads'){_0x22b503[_0x52b5('0x66')]={'name':!_[_0x52b5('0x1f')](_0x11994e[_0x52b5('0x63')])?_0x11994e['Full_Name']:!_[_0x52b5('0x1f')](_0x11994e[_0x52b5('0x64')])?_0x11994e['First_Name']+'\x20'+_0x11994e[_0x52b5('0x65')]:_0x11994e['Last_Name'],'id':_0x11994e['id']};_0x22b503[_0x52b5('0x67')]=_[_0x52b5('0x44')](_0x11994e[_0x52b5('0x4b')]);}if(_0x44fc8c[_0x52b5('0x68')]){_0x22b503[_0x52b5('0x69')]=moment[_0x52b5('0x6a')](parseInt(_0x44fc8c['talktime'])*0x3e8)[_0x52b5('0x35')](_0x52b5('0x6b'));}else if(_0x44fc8c[_0x52b5('0x6c')]&&_0x44fc8c[_0x52b5('0x6d')]){_0x22b503[_0x52b5('0x69')]=moment[_0x52b5('0x6a')](moment(_0x44fc8c[_0x52b5('0x6d')],'YYYY-MM-DDTHH:mm:ss')[_0x52b5('0x6e')](moment(_0x44fc8c[_0x52b5('0x6f')],_0x52b5('0x70'))))['format'](_0x52b5('0x6b'));}switch(_0x44fc8c[_0x52b5('0x71')]){case _0x52b5('0x72'):_0x22b503[_0x52b5('0x73')]=_0x52b5('0x74');break;case'complete':case _0x52b5('0x75'):_0x22b503[_0x52b5('0x73')]='Answered';break;case'rejected':_0x22b503[_0x52b5('0x73')]='Rejected';break;case _0x52b5('0x76'):_0x22b503[_0x52b5('0x73')]=_0x52b5('0x77');break;case _0x52b5('0x78'):_0x22b503[_0x52b5('0x73')]=_0x52b5('0x79');default:}_0x22b503[_0x52b5('0x7a')]=(_0x58eb33===_0x52b5('0x7b')?moment(_0x44fc8c[_0x52b5('0x6f')])[_0x52b5('0x35')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x44fc8c[_0x52b5('0x7c')])[_0x52b5('0x35')](_0x52b5('0x70')))||moment()[_0x52b5('0x35')](_0x52b5('0x70'));_0x22b503[_0x52b5('0x7d')]=_0x58eb33||_0x52b5('0x7e');_0x22b503=_['merge'](_0x22b503,getCustomFields(_0x3edb07['Fields'],_0x44fc8c));return request({'method':_0x52b5('0x28'),'uri':_0x52b5('0x43')+_0x4ef4d1+_0x52b5('0x7f'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4dc255},'body':{'data':[_0x22b503]},'json':!![]})['then'](function(_0x35c8e6){if(_0x35c8e6&&_0x35c8e6[_0x52b5('0x42')][0x0][_0x52b5('0x80')]==='SUCCESS'){logger[_0x52b5('0x3f')](_0x52b5('0x81'));return{'id':_0x35c8e6[_0x52b5('0x42')][0x0]['details']['id']};}})[_0x52b5('0x30')](function(_0x25cec9){logger[_0x52b5('0x3f')]('err',_0x25cec9['stack']);console['log'](_0x52b5('0x82'),_0x25cec9);});}exports['queue']=function(_0x55ed84,_0x557db4,_0x3b559b,_0x5e1698,_0x176d64,_0xd2fb1f){var _0x41bbe2,_0x3bf483,_0x267679;_0xd2fb1f['host']=intUtil['stripTrailingSlash'](_0xd2fb1f['host']);_0xd2fb1f['serverUrl']=intUtil[_0x52b5('0x83')](_0xd2fb1f[_0x52b5('0x84')]);if(_0x176d64&&_0x176d64[_0x52b5('0x85')]){logger['info'](_0x52b5('0x86'),_0x52b5('0x87'));_0x557db4['recordingURL']=_0xd2fb1f[_0x52b5('0x84')]+'/api/voice/recordings/'+_0x557db4[_0x52b5('0x88')]+_0x52b5('0x89')+md5(_0x557db4['uniqueid']);}else{_0x557db4['recordingURL']='';}var _0x5df362=_0xd2fb1f[_0x52b5('0x8a')]===_0x52b5('0x8b')?'eu':_0x52b5('0x8c');return getAccessToken(_0xd2fb1f)[_0x52b5('0x2e')](function(_0xd485dd){_0x267679=_0xd485dd;return getUser(_0x267679,_0x5df362,_0xd2fb1f,_0x5e1698['email']);})[_0x52b5('0x2e')](function(_0x3f3947){_0x41bbe2=_0x3f3947;logger[_0x52b5('0x3f')]('The\x20User\x20ID\x20is:',_0x41bbe2['id']);return getEndUser(_0x267679,_0x5df362,_0xd2fb1f,_0x557db4[_0x52b5('0x8d')],_0x557db4[_0x52b5('0x8e')],_0x41bbe2,_0x3b559b);})[_0x52b5('0x2e')](function(_0x175e87){_0x3bf483=_0x175e87;return getCall(_0x267679,_0x5df362,_0xd2fb1f,_0x41bbe2,_0x3bf483,_0x3b559b,_0x557db4,_0x52b5('0x7e'));})[_0x52b5('0x2e')](function(_0x4de43d){if(_0x4de43d){logger[_0x52b5('0x3f')]('The\x20Call\x20ID\x20is:',_0x4de43d['id']);logger[_0x52b5('0x3f')](_0x52b5('0x86'),_0x52b5('0x8f'));emit(util[_0x52b5('0x35')](_0x52b5('0x90'),_0x5e1698['name']),'trigger:browser:url',{'uri':_0x52b5('0x91')+_0xd2fb1f[_0x52b5('0x8a')]+_0x52b5('0x92')+_0x4de43d['id']});}})['catch'](function(_0x1dbe33){logger[_0x52b5('0x31')](_0x52b5('0x86'),JSON['stringify'](_0x1dbe33));});};exports[_0x52b5('0x7b')]=function(_0x1d9031,_0x4c8bcd,_0x1ee665,_0x247abd,_0x2cb073,_0x180d6f,_0x4552fe){var _0x48adbe,_0xa04f35,_0x1a5d5b;_0x180d6f[_0x52b5('0x8a')]=intUtil[_0x52b5('0x83')](_0x180d6f[_0x52b5('0x8a')]);_0x180d6f['serverUrl']=intUtil[_0x52b5('0x83')](_0x180d6f[_0x52b5('0x84')]);if(_0x4552fe&&_0x4552fe['recordingFormat']&&_0x4552fe[_0x52b5('0x93')]!==_0x52b5('0x94')){logger[_0x52b5('0x3f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4c8bcd[_0x52b5('0x95')]=_0x180d6f[_0x52b5('0x84')]+_0x52b5('0x96')+_0x4c8bcd[_0x52b5('0x88')]+_0x52b5('0x89')+md5(_0x4c8bcd[_0x52b5('0x88')]);}var _0x56fa68=_0x180d6f[_0x52b5('0x8a')]===_0x52b5('0x8b')?'eu':_0x52b5('0x8c');return getAccessToken(_0x180d6f)['then'](function(_0x35017c){_0x1a5d5b=_0x35017c;return getUser(_0x1a5d5b,_0x56fa68,_0x180d6f,_0x247abd[_0x52b5('0x3b')]);})['then'](function(_0x14a3d9){_0x48adbe=_0x14a3d9;logger['info'](_0x52b5('0x97'),_0x48adbe['id']);return getEndUser(_0x1a5d5b,_0x56fa68,_0x180d6f,_0x4c8bcd[_0x52b5('0x98')],_0x4c8bcd[_0x52b5('0x99')],_0x48adbe,_0x1ee665);})[_0x52b5('0x2e')](function(_0x486fb9){_0xa04f35=_0x486fb9;return getCall(_0x1a5d5b,_0x56fa68,_0x180d6f,_0x48adbe,_0xa04f35,_0x1ee665,_0x4c8bcd,_0x52b5('0x9a'));})[_0x52b5('0x2e')](function(_0x49f110){if(_0x49f110){logger['info']('The\x20Call\x20ID\x20is:',_0x49f110['id']);logger[_0x52b5('0x3f')]('[OUTBOUND]',_0x52b5('0x8f'));emit(util[_0x52b5('0x35')](_0x52b5('0x90'),_0x247abd[_0x52b5('0x1b')]),_0x52b5('0x9b'),{'uri':_0x52b5('0x91')+_0x180d6f['host']+_0x52b5('0x92')+_0x49f110['id']});}})['catch'](function(_0x23a381){logger[_0x52b5('0x31')](_0x52b5('0x9c'),JSON[_0x52b5('0xf')](_0x23a381));});};exports[_0x52b5('0x9d')]=function(_0x518c94,_0xafcd69,_0x2b00ea,_0x2358df,_0x30a26c,_0x1cb04a){var _0xee4ce6,_0x3bafab,_0x19d73f;_0x1cb04a[_0x52b5('0x8a')]=intUtil[_0x52b5('0x83')](_0x1cb04a[_0x52b5('0x8a')]);_0x1cb04a[_0x52b5('0x84')]=intUtil[_0x52b5('0x83')](_0x1cb04a[_0x52b5('0x84')]);if(_0x30a26c&&_0x30a26c[_0x52b5('0x85')]){logger[_0x52b5('0x3f')]('['+_0xafcd69[_0x52b5('0x71')][_0x52b5('0x9e')]()+']','Recording\x20is\x20enabled!');_0xafcd69[_0x52b5('0x95')]=_0x1cb04a[_0x52b5('0x84')]+'/api/voice/recordings/'+_0xafcd69[_0x52b5('0x88')]+_0x52b5('0x89')+md5(_0xafcd69[_0x52b5('0x88')]);}else{_0xafcd69[_0x52b5('0x95')]='';}var _0x15e5a6=_0x1cb04a[_0x52b5('0x8a')]==='zoho.eu'?'eu':_0x52b5('0x8c');return getAccessToken(_0x1cb04a)[_0x52b5('0x2e')](function(_0x13e59b){_0x19d73f=_0x13e59b;return getUser(_0x19d73f,_0x15e5a6,_0x1cb04a);})[_0x52b5('0x2e')](function(_0x2ba550){_0xee4ce6=_0x2ba550;logger[_0x52b5('0x3f')]('The\x20User\x20ID\x20is:',_0xee4ce6['id']);return getEndUser(_0x19d73f,_0x15e5a6,_0x1cb04a,_0xafcd69['calleridname'],_0xafcd69['calleridnum'],_0xee4ce6,_0x2b00ea);})[_0x52b5('0x2e')](function(_0x1e5d7f){_0x3bafab=_0x1e5d7f;return getCall(_0x19d73f,_0x15e5a6,_0x1cb04a,_0xee4ce6,_0x3bafab,_0x2b00ea,_0xafcd69,_0x52b5('0x7e'));})['then'](function(_0x5c079f){if(_0x5c079f){logger['info'](_0x52b5('0x9f'),_0x5c079f['id']);}})[_0x52b5('0x30')](function(_0xe1b80c){logger['error']('['+_0xafcd69[_0x52b5('0x71')][_0x52b5('0x9e')]()+']',JSON[_0x52b5('0xf')](_0xe1b80c));});}; \ 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 76ce5d3..8d00938 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 _0xdfa2=['data3','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','shelljs','mustache','../../../../config/logger','trigger','data2','Script'];(function(_0x3d8b26,_0x3640f6){var _0x2f8369=function(_0x255495){while(--_0x255495){_0x3d8b26['push'](_0x3d8b26['shift']());}};_0x2f8369(++_0x3640f6);}(_0xdfa2,0xf5));var _0x2dfa=function(_0x47a6db,_0x482938){_0x47a6db=_0x47a6db-0x0;var _0xe98416=_0xdfa2[_0x47a6db];return _0xe98416;};'use strict';var util=require(_0x2dfa('0x0'));var sh=require(_0x2dfa('0x1'));var Mustache=require(_0x2dfa('0x2'));var logger=require(_0x2dfa('0x3'))(_0x2dfa('0x4'));exports['exec']=function(_0x269fbe,_0x4b8266){var _0x4978ba=_0x269fbe[_0x2dfa('0x5')]?_0x269fbe['data2']:_0x2dfa('0x6');var _0x245309=_0x269fbe[_0x2dfa('0x7')]?Mustache[_0x2dfa('0x8')](_0x269fbe[_0x2dfa('0x7')],_0x4b8266):_0x4b8266;sh['exec'](_0x245309,function(_0x36f6ca,_0x47886f,_0x50b18d){if(_0x36f6ca!==0x0){logger[_0x2dfa('0x9')](util[_0x2dfa('0xa')](_0x2dfa('0xb'),_0x4978ba,_0x245309,_0x36f6ca,_0x50b18d));}else{logger[_0x2dfa('0xc')](util['format'](_0x2dfa('0xd'),_0x4978ba,_0x245309,_0x47886f));}});}; \ No newline at end of file +var _0xc501=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x85fbb2,_0x55d447){var _0x2c94e5=function(_0x3bd403){while(--_0x3bd403){_0x85fbb2['push'](_0x85fbb2['shift']());}};_0x2c94e5(++_0x55d447);}(_0xc501,0x92));var _0x1c50=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xc501[_0x2543d6];return _0x55213c;};'use strict';var util=require(_0x1c50('0x0'));var sh=require('shelljs');var Mustache=require(_0x1c50('0x1'));var logger=require(_0x1c50('0x2'))(_0x1c50('0x3'));exports[_0x1c50('0x4')]=function(_0x1b5809,_0x416b93){var _0x57c896=_0x1b5809[_0x1c50('0x5')]?_0x1b5809[_0x1c50('0x5')]:_0x1c50('0x6');var _0x5bad59=_0x1b5809[_0x1c50('0x7')]?Mustache['render'](_0x1b5809['data3'],_0x416b93):_0x416b93;sh[_0x1c50('0x4')](_0x5bad59,function(_0xa38922,_0x28a85a,_0x31f90e){if(_0xa38922!==0x0){logger['error'](util[_0x1c50('0x8')](_0x1c50('0x9'),_0x57c896,_0x5bad59,_0xa38922,_0x31f90e));}else{logger['info'](util[_0x1c50('0x8')](_0x1c50('0xa'),_0x57c896,_0x5bad59,_0x28a85a));}});}; \ 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 b46ae7f..d1dfd11 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 _0xb792=['render','data2','data5','number','headers','error','GET','DELETE','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','trigger','data1','toUpperCase'];(function(_0xe96711,_0x3c2895){var _0x311cc5=function(_0xf27035){while(--_0xf27035){_0xe96711['push'](_0xe96711['shift']());}};_0x311cc5(++_0x3c2895);}(_0xb792,0x19e));var _0x2b79=function(_0x50611d,_0x2a8e67){_0x50611d=_0x50611d-0x0;var _0x37ea81=_0xb792[_0x50611d];return _0x37ea81;};'use strict';var rp=require('request-promise');var util=require(_0x2b79('0x0'));var _=require(_0x2b79('0x1'));var Mustache=require('mustache');var logger=require(_0x2b79('0x2'))(_0x2b79('0x3'));exports['exec']=function(_0x1c453a,_0x58eb11){var _0x52a986,_0x2ca9d;var _0x407d5c={'method':_0x1c453a[_0x2b79('0x4')][_0x2b79('0x5')](),'uri':Mustache[_0x2b79('0x6')](_0x1c453a[_0x2b79('0x7')],_0x58eb11),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1c453a[_0x2b79('0x8')])===_0x2b79('0x9')&&parseInt(_0x1c453a[_0x2b79('0x8')])>=0x1&&parseInt(_0x1c453a[_0x2b79('0x8')])<=0xa?parseInt(_0x1c453a[_0x2b79('0x8')])*0x3e8:0x5*0x3e8};try{_0x407d5c[_0x2b79('0xa')]=_0x1c453a['data6']?JSON['parse'](Mustache[_0x2b79('0x6')](_0x1c453a['data6'],_0x58eb11)):{};}catch(_0x1c0e0b){logger[_0x2b79('0xb')](_0x1c0e0b['stack']);}switch(_0x1c453a[_0x2b79('0x4')][_0x2b79('0x5')]()){case _0x2b79('0xc'):case _0x2b79('0xd'):_0x52a986=null;_0x407d5c['qs']=_0x58eb11;break;case'POST':case _0x2b79('0xe'):if(_0x1c453a[_0x2b79('0xf')]){try{_0x52a986=JSON[_0x2b79('0x10')](Mustache[_0x2b79('0x6')](_0x1c453a[_0x2b79('0xf')],_0x58eb11));_0x407d5c[_0x2b79('0x11')]=_0x52a986;}catch(_0x1d5572){logger[_0x2b79('0xb')](_0x1d5572[_0x2b79('0x12')]);logger[_0x2b79('0xb')](_0x2b79('0x13'));}}else{_0x52a986=_0x58eb11;_0x407d5c[_0x2b79('0x11')]=_0x52a986;}break;}logger['info'](util[_0x2b79('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1c453a[_0x2b79('0x4')],_0x1c453a[_0x2b79('0x7')],JSON['stringify'](_0x407d5c)));rp(_0x407d5c)[_0x2b79('0x15')](function(_0x5ac432){_0x52a986=!_[_0x2b79('0x16')](_0x52a986)?_0x2b79('0x17')+_0x52a986:'';_0x2ca9d=typeof _0x5ac432['body']===_0x2b79('0x18')?JSON['stringify'](_0x5ac432[_0x2b79('0x11')]):_0x5ac432[_0x2b79('0x11')];logger['info'](util[_0x2b79('0x14')](_0x2b79('0x19'),_0x1c453a[_0x2b79('0x4')],_0x1c453a[_0x2b79('0x7')],_0x5ac432[_0x2b79('0x1a')],_0x2ca9d));})['catch'](function(_0x3f3ea4){logger['error'](util[_0x2b79('0x14')](_0x2b79('0x1b'),_0x1c453a[_0x2b79('0x4')],_0x1c453a['data2'],_0x3f3ea4[_0x2b79('0x1a')],_0x3f3ea4[_0x2b79('0x1c')],_0x3f3ea4[_0x2b79('0x1d')]));});}; \ No newline at end of file +var _0xbf5d=['message','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x3421ac,_0x3228b5){var _0x16c2d2=function(_0xad864f){while(--_0xad864f){_0x3421ac['push'](_0x3421ac['shift']());}};_0x16c2d2(++_0x3228b5);}(_0xbf5d,0xd3));var _0xdbf5=function(_0xf8baeb,_0x4c83e8){_0xf8baeb=_0xf8baeb-0x0;var _0x5997a4=_0xbf5d[_0xf8baeb];return _0x5997a4;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x5519a5,_0x1c5f5e){var _0xe8b1ca,_0x47042b;var _0x42ac5d={'method':_0x5519a5[_0xdbf5('0x0')][_0xdbf5('0x1')](),'uri':Mustache['render'](_0x5519a5[_0xdbf5('0x2')],_0x1c5f5e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5519a5[_0xdbf5('0x3')])===_0xdbf5('0x4')&&parseInt(_0x5519a5[_0xdbf5('0x3')])>=0x1&&parseInt(_0x5519a5[_0xdbf5('0x3')])<=0xa?parseInt(_0x5519a5[_0xdbf5('0x3')])*0x3e8:0x5*0x3e8};try{_0x42ac5d[_0xdbf5('0x5')]=_0x5519a5[_0xdbf5('0x6')]?JSON[_0xdbf5('0x7')](Mustache[_0xdbf5('0x8')](_0x5519a5[_0xdbf5('0x6')],_0x1c5f5e)):{};}catch(_0xf48f92){logger[_0xdbf5('0x9')](_0xf48f92[_0xdbf5('0xa')]);}switch(_0x5519a5[_0xdbf5('0x0')][_0xdbf5('0x1')]()){case _0xdbf5('0xb'):case _0xdbf5('0xc'):_0xe8b1ca=null;_0x42ac5d['qs']=_0x1c5f5e;break;case _0xdbf5('0xd'):case _0xdbf5('0xe'):if(_0x5519a5['data7']){try{_0xe8b1ca=JSON[_0xdbf5('0x7')](Mustache['render'](_0x5519a5[_0xdbf5('0xf')],_0x1c5f5e));_0x42ac5d[_0xdbf5('0x10')]=_0xe8b1ca;}catch(_0x503723){logger['error'](_0x503723[_0xdbf5('0xa')]);logger[_0xdbf5('0x9')](_0xdbf5('0x11'));}}else{_0xe8b1ca=_0x1c5f5e;_0x42ac5d[_0xdbf5('0x10')]=_0xe8b1ca;}break;}logger['info'](util[_0xdbf5('0x12')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5519a5['data1'],_0x5519a5[_0xdbf5('0x2')],JSON['stringify'](_0x42ac5d)));rp(_0x42ac5d)[_0xdbf5('0x13')](function(_0x57b794){_0xe8b1ca=!_[_0xdbf5('0x14')](_0xe8b1ca)?',\x20request\x20body:\x20'+_0xe8b1ca:'';_0x47042b=typeof _0x57b794['body']===_0xdbf5('0x15')?JSON[_0xdbf5('0x16')](_0x57b794[_0xdbf5('0x10')]):_0x57b794[_0xdbf5('0x10')];logger[_0xdbf5('0x17')](util[_0xdbf5('0x12')](_0xdbf5('0x18'),_0x5519a5[_0xdbf5('0x0')],_0x5519a5['data2'],_0x57b794[_0xdbf5('0x19')],_0x47042b));})[_0xdbf5('0x1a')](function(_0x3fb20c){logger[_0xdbf5('0x9')](util['format'](_0xdbf5('0x1b'),_0x5519a5[_0xdbf5('0x0')],_0x5519a5[_0xdbf5('0x2')],_0x3fb20c[_0xdbf5('0x19')],_0x3fb20c[_0xdbf5('0x1c')],_0x3fb20c[_0xdbf5('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4296ced..7c4fa62 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 _0x597c=['error','message','result','catch','jayson/promise','bluebird','routing','client','http','then','debug','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x597c,0x148));var _0xc597=function(_0x5d92a4,_0x518596){_0x5d92a4=_0x5d92a4-0x0;var _0x560cbb=_0x597c[_0x5d92a4];return _0x560cbb;};'use strict';var jayson=require(_0xc597('0x0'));var BPromise=require(_0xc597('0x1'));var logger=require('../../config/logger')(_0xc597('0x2'));var client=jayson[_0xc597('0x3')][_0xc597('0x4')]({'port':0x2329});client['Request']=function(_0x38b82a,_0x506602){return new BPromise(function(_0x1a931b,_0x153849){return client['request'](_0x38b82a,_0x506602)[_0xc597('0x5')](function(_0x2a4c84){logger[_0xc597('0x6')](_0xc597('0x7'),_0xc597('0x2'),_0x38b82a,_0x506602,_0x2a4c84);if(_0x2a4c84['error']){logger[_0xc597('0x8')](_0xc597('0x7'),_0xc597('0x2'),_0x38b82a,_0x2a4c84[_0xc597('0x8')][_0xc597('0x9')],_0x506602);return _0x153849(_0x2a4c84[_0xc597('0x8')][_0xc597('0x9')]);}else{return _0x1a931b(_0x2a4c84[_0xc597('0xa')]);}})[_0xc597('0xb')](function(_0x32ceef){logger[_0xc597('0x8')](_0xc597('0x7'),'routing',_0x38b82a,_0x32ceef,_0x506602);return _0x153849(_0x32ceef);});});};module['exports']=client; \ No newline at end of file +var _0x6053=['Request','request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x58d588,_0x1e948a){var _0x31c8b7=function(_0x1c7dba){while(--_0x1c7dba){_0x58d588['push'](_0x58d588['shift']());}};_0x31c8b7(++_0x1e948a);}(_0x6053,0x1a9));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x3605('0x0'));var BPromise=require(_0x3605('0x1'));var logger=require(_0x3605('0x2'))(_0x3605('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x3605('0x4')]=function(_0x54d6c0,_0x4e6050){return new BPromise(function(_0x2de262,_0x5ede6e){return client[_0x3605('0x5')](_0x54d6c0,_0x4e6050)[_0x3605('0x6')](function(_0x15304a){logger[_0x3605('0x7')](_0x3605('0x8'),_0x3605('0x3'),_0x54d6c0,_0x4e6050,_0x15304a);if(_0x15304a[_0x3605('0x9')]){logger[_0x3605('0x9')](_0x3605('0x8'),'routing',_0x54d6c0,_0x15304a[_0x3605('0x9')][_0x3605('0xa')],_0x4e6050);return _0x5ede6e(_0x15304a['error'][_0x3605('0xa')]);}else{return _0x2de262(_0x15304a['result']);}})[_0x3605('0xb')](function(_0x162120){logger[_0x3605('0x9')](_0x3605('0x8'),_0x3605('0x3'),_0x54d6c0,_0x162120,_0x4e6050);return _0x5ede6e(_0x162120);});});};module[_0x3605('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 12b9483..84b162d 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 _0x44dc=['./rpc/setting','../../config/logger','email','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime'];(function(_0x44ac87,_0x5df547){var _0x39c440=function(_0x2bd3e9){while(--_0x2bd3e9){_0x44ac87['push'](_0x44ac87['shift']());}};_0x39c440(++_0x5df547);}(_0x44dc,0x102));var _0xc44d=function(_0x4acc43,_0x5125a0){_0x4acc43=_0x4acc43-0x0;var _0x12ba15=_0x44dc[_0x4acc43];return _0x12ba15;};'use strict';var server=require(_0xc44d('0x0'));var Realtime=require(_0xc44d('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc44d('0x2'));var logger=require(_0xc44d('0x3'))(_0xc44d('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount['getMailAccounts']())[_0xc44d('0x5')](realtime[_0xc44d('0x6')]())[_0xc44d('0x5')](function(){email['refresh'](realtime[_0xc44d('0x7')]);return realtime;});}function main(){return server[_0xc44d('0x8')](realtime,email)[_0xc44d('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xc44d('0x9')]();})[_0xc44d('0x5')](function(_0x25ba32){return setInterval(initRealtime,_0x25ba32[_0xc44d('0xa')]*0x3e8);})[_0xc44d('0xb')](function(_0x4aebc2){logger['error'](_0xc44d('0xc'),_0x4aebc2);});}main(); \ No newline at end of file +var _0x9207=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','mailAccounts','listen','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server'];(function(_0x4df58e,_0x30d830){var _0x2754d8=function(_0x6a550e){while(--_0x6a550e){_0x4df58e['push'](_0x4df58e['shift']());}};_0x2754d8(++_0x30d830);}(_0x9207,0x17f));var _0x7920=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0x9207[_0x2e748c];return _0x37e219;};'use strict';var server=require(_0x7920('0x0'));var Realtime=require(_0x7920('0x1'));var EmailChannel=require(_0x7920('0x2'));var mailAccount=require(_0x7920('0x3'));var setting=require(_0x7920('0x4'));var logger=require(_0x7920('0x5'))(_0x7920('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x7920('0x7')]()[_0x7920('0x8')](mailAccount['getMailAccounts']())['then'](realtime[_0x7920('0x9')]())[_0x7920('0x8')](function(){email['refresh'](realtime[_0x7920('0xa')]);return realtime;});}function main(){return server[_0x7920('0xb')](realtime,email)[_0x7920('0x8')](function(){return initRealtime();})[_0x7920('0x8')](function(){return setting['getSettings']();})[_0x7920('0x8')](function(_0x173df2){return setInterval(initRealtime,_0x173df2[_0x7920('0xc')]*0x3e8);})[_0x7920('0xd')](function(_0x37335f){logger[_0x7920('0xe')](_0x7920('0xf'),_0x37335f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f77b0b5..1f2a718 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 _0x7ffc=['start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','box','bind','handleImapEnd','error','handleImapError','isNil','disabled','connected','name','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','bluebird','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x464228,_0x1baafa){var _0x3df906=function(_0x1bf99a){while(--_0x1bf99a){_0x464228['push'](_0x464228['shift']());}};_0x3df906(++_0x1baafa);}(_0x7ffc,0x1cb));var _0xc7ff=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0x7ffc[_0x63a69b];return _0x425fa1;};'use strict';var _=require(_0xc7ff('0x0'));var moment=require(_0xc7ff('0x1'));var BPromise=require(_0xc7ff('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xc7ff('0x3'));var logger=require(_0xc7ff('0x4'))('email');config[_0xc7ff('0x5')]=_[_0xc7ff('0x6')](config[_0xc7ff('0x5')],{'host':_0xc7ff('0x7'),'port':0x18eb});var io=require(_0xc7ff('0x8'))(new Redis(config[_0xc7ff('0x5')]));var EmailImap=require(_0xc7ff('0x9'));var EmailSmtp=require(_0xc7ff('0xa'));var mailAccount=require(_0xc7ff('0xb'));var md5Accounts={};function EmailChannel(_0x30206c){logger[_0xc7ff('0xc')](_0xc7ff('0xd'));this[_0xc7ff('0xe')]=_0x30206c[_0xc7ff('0xe')];this[_0xc7ff('0xf')]={};this[_0xc7ff('0x10')]=new EmailSmtp();}EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x12')]=function(_0x1c22b5){var _0x45f0f5=this[_0xc7ff('0xe')][_0x1c22b5];var _0x47cc17={'id':_0x45f0f5['id'],'name':_0x45f0f5['name'],'key':_0x45f0f5[_0xc7ff('0x13')],'active':_0x45f0f5[_0xc7ff('0x14')],'Imap':{'status':_0x45f0f5[_0xc7ff('0x15')][_0xc7ff('0x16')],'messageStatus':_0x45f0f5[_0xc7ff('0x15')][_0xc7ff('0x17')],'total':_0x45f0f5['Imap'][_0xc7ff('0x18')]}};if(_['isNil'](md5Accounts[_0x1c22b5])){md5Accounts[_0x1c22b5]={};}var _0x22a43b=md5(JSON[_0xc7ff('0x19')](_0x47cc17));if(md5Accounts[_0x1c22b5][_0xc7ff('0x1a')]!==_0x22a43b){md5Accounts[_0x1c22b5][_0xc7ff('0x1a')]=_0x22a43b;io['emit'](_0xc7ff('0x1b'),_0x47cc17);}};EmailChannel['prototype'][_0xc7ff('0x1c')]=function(_0x6ef77e){for(var _0x3bfd99 in _0x6ef77e){if(_0x6ef77e[_0xc7ff('0x1d')](_0x3bfd99)){if(_0x6ef77e[_0x3bfd99][_0xc7ff('0x15')]&&_0x6ef77e[_0x3bfd99][_0xc7ff('0x14')]){var _0x3ab83d=_0x6ef77e[_0x3bfd99][_0xc7ff('0x15')];if(!_0x3ab83d[_0xc7ff('0x1e')]&&_0x6ef77e[_0x3bfd99][_0xc7ff('0x1f')]!==_0xc7ff('0x20'))_0x3ab83d['service']=_0x6ef77e[_0x3bfd99][_0xc7ff('0x1f')];if(!this[_0xc7ff('0xf')][_0xc7ff('0x1d')](_0x3ab83d['id'])){this[_0xc7ff('0xf')][_0x3ab83d['id']]=new EmailImap(_0x3ab83d,_0x6ef77e[_0x3bfd99][_0xc7ff('0x21')]);this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x22'),this['handleImapBox'][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x21'),this['handleImapEmail'][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on']('end',this[_0xc7ff('0x24')][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x25'),this[_0xc7ff('0x26')][_0xc7ff('0x23')](this,_0x3bfd99));}}else{if(_[_0xc7ff('0x27')](this['mailAccounts'][_0x3bfd99][_0xc7ff('0x15')])){this[_0xc7ff('0xe')][_0x3bfd99][_0xc7ff('0x15')]={};}this[_0xc7ff('0xe')][_0x3bfd99][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x28');this['mailAccounts'][_0x3bfd99]['Imap'][_0xc7ff('0x17')]='';this[_0xc7ff('0x12')](_0x3bfd99);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x4eba58,_0x46991f){if(this['mailAccounts'][_0x4eba58]){this[_0xc7ff('0xe')][_0x4eba58][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x29');this['mailAccounts'][_0x4eba58][_0xc7ff('0x15')][_0xc7ff('0x17')]=_0x46991f[_0xc7ff('0x2a')];if(_0x46991f[_0xc7ff('0x2b')]){this[_0xc7ff('0xe')][_0x4eba58][_0xc7ff('0x15')]['total']=_0x46991f[_0xc7ff('0x2b')][_0xc7ff('0x18')];}return this['emit'](_0x4eba58);}};EmailChannel['prototype'][_0xc7ff('0x2c')]=function(_0x32c8a6,_0xc692){logger[_0xc7ff('0xc')](_0xc7ff('0x2d'),_0xc692[_0xc7ff('0x2e')],_0xc692['lastName'],_0xc692[_0xc7ff('0x2f')],_0x32c8a6);if(this[_0xc7ff('0xe')][_0x32c8a6]){return mailAccount['notify'](_0x32c8a6,_0xc692)[_0xc7ff('0x30')](function(_0x4b5299){if(_0x4b5299){logger[_0xc7ff('0xc')](_0xc7ff('0x31'));}})[_0xc7ff('0x32')](function(_0xe94484){logger['error'](_0xc7ff('0x33'),JSON[_0xc7ff('0x19')](_0xe94484));});}};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x24')]=function(_0x500382){if(this[_0xc7ff('0xe')][_0x500382]&&this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]){if(this[_0xc7ff('0xf')][this['mailAccounts'][_0x500382][_0xc7ff('0x15')]['id']]){delete this[_0xc7ff('0xf')][this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]['id']];}this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]['lastSync']=moment();this[_0xc7ff('0x12')](_0x500382);}};EmailChannel['prototype']['handleImapError']=function(_0x4d7941,_0x13a5d9){if(this[_0xc7ff('0xe')][_0x4d7941]){this[_0xc7ff('0xe')][_0x4d7941][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x25');this[_0xc7ff('0xe')][_0x4d7941][_0xc7ff('0x15')][_0xc7ff('0x17')]=_0x13a5d9;return this[_0xc7ff('0x12')](_0x4d7941);}};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x34')]=function(_0x59647e,_0x1596da){return this[_0xc7ff('0x10')][_0xc7ff('0x35')](_0x59647e,_0x1596da);};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x36')]=function(_0x24c047){var _0x1e1c7c=this;if(this[_0xc7ff('0xe')][_0x24c047['id']]){if(_[_0xc7ff('0x27')](this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')])){this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')]={};}this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x38')]=moment();return new BPromise(function(_0x1532c0,_0x4b51f8){return _0x1e1c7c[_0xc7ff('0x10')][_0xc7ff('0x39')](_0x24c047)[_0xc7ff('0x30')](function(_0x405f44){_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x16')]=_0xc7ff('0x3a');_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x17')]='';_0x1e1c7c[_0xc7ff('0x12')](_0x24c047['id']);_0x1532c0(_0x405f44);})[_0xc7ff('0x32')](function(_0x3c64a6){_0x1e1c7c['mailAccounts'][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x16')]=_0xc7ff('0x25');_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x17')]=_0x3c64a6;_0x1e1c7c[_0xc7ff('0x12')](_0x24c047['id']);_0x4b51f8(_0x3c64a6);});});}return this[_0xc7ff('0x10')][_0xc7ff('0x39')](_0x24c047);};module['exports']=EmailChannel; \ No newline at end of file +var _0x75aa=['total','stringify','refresh','service','provider','custom','imapAccounts','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','isNil','disabled','messageStatus','connected','name','messages','handleImapEmail','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','send','verifySmtp','Smtp','smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','prototype','emit','key','active','status','Imap'];(function(_0x20627e,_0x1a28cd){var _0x2abff2=function(_0x35a065){while(--_0x35a065){_0x20627e['push'](_0x20627e['shift']());}};_0x2abff2(++_0x1a28cd);}(_0x75aa,0x13d));var _0xa75a=function(_0x52e741,_0x1ff0f1){_0x52e741=_0x52e741-0x0;var _0x80acfd=_0x75aa[_0x52e741];return _0x80acfd;};'use strict';var _=require(_0xa75a('0x0'));var moment=require(_0xa75a('0x1'));var BPromise=require(_0xa75a('0x2'));var md5=require(_0xa75a('0x3'));var Redis=require(_0xa75a('0x4'));var config=require('../../../config/environment');var logger=require(_0xa75a('0x5'))(_0xa75a('0x6'));config['redis']=_['defaults'](config[_0xa75a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa75a('0x8'))(new Redis(config[_0xa75a('0x7')]));var EmailImap=require(_0xa75a('0x9'));var EmailSmtp=require(_0xa75a('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x32fba8){logger['info'](_0xa75a('0xb'));this[_0xa75a('0xc')]=_0x32fba8[_0xa75a('0xc')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xa75a('0xd')][_0xa75a('0xe')]=function(_0x5bfeea){var _0x2fcaca=this['mailAccounts'][_0x5bfeea];var _0x1e08b6={'id':_0x2fcaca['id'],'name':_0x2fcaca['name'],'key':_0x2fcaca[_0xa75a('0xf')],'active':_0x2fcaca[_0xa75a('0x10')],'Imap':{'status':_0x2fcaca['Imap'][_0xa75a('0x11')],'messageStatus':_0x2fcaca['Imap']['messageStatus'],'total':_0x2fcaca[_0xa75a('0x12')][_0xa75a('0x13')]}};if(_['isNil'](md5Accounts[_0x5bfeea])){md5Accounts[_0x5bfeea]={};}var _0x2bfc7f=md5(JSON[_0xa75a('0x14')](_0x1e08b6));if(md5Accounts[_0x5bfeea]['md5']!==_0x2bfc7f){md5Accounts[_0x5bfeea]['md5']=_0x2bfc7f;io[_0xa75a('0xe')]('mailAccount:update',_0x1e08b6);}};EmailChannel[_0xa75a('0xd')][_0xa75a('0x15')]=function(_0x4c7a8f){for(var _0x5f52e5 in _0x4c7a8f){if(_0x4c7a8f['hasOwnProperty'](_0x5f52e5)){if(_0x4c7a8f[_0x5f52e5][_0xa75a('0x12')]&&_0x4c7a8f[_0x5f52e5][_0xa75a('0x10')]){var _0x13508b=_0x4c7a8f[_0x5f52e5][_0xa75a('0x12')];if(!_0x13508b[_0xa75a('0x16')]&&_0x4c7a8f[_0x5f52e5][_0xa75a('0x17')]!==_0xa75a('0x18'))_0x13508b[_0xa75a('0x16')]=_0x4c7a8f[_0x5f52e5][_0xa75a('0x17')];if(!this[_0xa75a('0x19')][_0xa75a('0x1a')](_0x13508b['id'])){this[_0xa75a('0x19')][_0x13508b['id']]=new EmailImap(_0x13508b,_0x4c7a8f[_0x5f52e5][_0xa75a('0x6')]);this['imapAccounts'][_0x13508b['id']]['on'](_0xa75a('0x1b'),this[_0xa75a('0x1c')][_0xa75a('0x1d')](this,_0x5f52e5));this[_0xa75a('0x19')][_0x13508b['id']]['on'](_0xa75a('0x6'),this['handleImapEmail']['bind'](this,_0x5f52e5));this[_0xa75a('0x19')][_0x13508b['id']]['on'](_0xa75a('0x1e'),this[_0xa75a('0x1f')][_0xa75a('0x1d')](this,_0x5f52e5));this['imapAccounts'][_0x13508b['id']]['on'](_0xa75a('0x20'),this[_0xa75a('0x21')][_0xa75a('0x1d')](this,_0x5f52e5));}}else{if(_[_0xa75a('0x22')](this[_0xa75a('0xc')][_0x5f52e5][_0xa75a('0x12')])){this[_0xa75a('0xc')][_0x5f52e5]['Imap']={};}this[_0xa75a('0xc')][_0x5f52e5][_0xa75a('0x12')][_0xa75a('0x11')]=_0xa75a('0x23');this['mailAccounts'][_0x5f52e5]['Imap'][_0xa75a('0x24')]='';this['emit'](_0x5f52e5);}}}};EmailChannel[_0xa75a('0xd')][_0xa75a('0x1c')]=function(_0x1f5dc0,_0x1e60eb){if(this['mailAccounts'][_0x1f5dc0]){this[_0xa75a('0xc')][_0x1f5dc0][_0xa75a('0x12')][_0xa75a('0x11')]=_0xa75a('0x25');this[_0xa75a('0xc')][_0x1f5dc0][_0xa75a('0x12')][_0xa75a('0x24')]=_0x1e60eb[_0xa75a('0x26')];if(_0x1e60eb[_0xa75a('0x27')]){this[_0xa75a('0xc')][_0x1f5dc0][_0xa75a('0x12')][_0xa75a('0x13')]=_0x1e60eb['messages'][_0xa75a('0x13')];}return this[_0xa75a('0xe')](_0x1f5dc0);}};EmailChannel[_0xa75a('0xd')][_0xa75a('0x28')]=function(_0x451c78,_0x1f006b){logger[_0xa75a('0x29')](_0xa75a('0x2a'),_0x1f006b[_0xa75a('0x2b')],_0x1f006b[_0xa75a('0x2c')],_0x1f006b['from'],_0x451c78);if(this[_0xa75a('0xc')][_0x451c78]){return mailAccount[_0xa75a('0x2d')](_0x451c78,_0x1f006b)[_0xa75a('0x2e')](function(_0x11ee57){if(_0x11ee57){logger[_0xa75a('0x29')](_0xa75a('0x2f'));}})[_0xa75a('0x30')](function(_0x31946e){logger[_0xa75a('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xa75a('0x14')](_0x31946e));});}};EmailChannel['prototype'][_0xa75a('0x1f')]=function(_0x18d447){if(this['mailAccounts'][_0x18d447]&&this[_0xa75a('0xc')][_0x18d447][_0xa75a('0x12')]){if(this[_0xa75a('0x19')][this[_0xa75a('0xc')][_0x18d447]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x18d447][_0xa75a('0x12')]['id']];}this[_0xa75a('0xc')][_0x18d447]['Imap'][_0xa75a('0x31')]=moment();this['emit'](_0x18d447);}};EmailChannel['prototype'][_0xa75a('0x21')]=function(_0x36c8b6,_0x2cfa0e){if(this[_0xa75a('0xc')][_0x36c8b6]){this[_0xa75a('0xc')][_0x36c8b6][_0xa75a('0x12')][_0xa75a('0x11')]=_0xa75a('0x20');this[_0xa75a('0xc')][_0x36c8b6]['Imap'][_0xa75a('0x24')]=_0x2cfa0e;return this[_0xa75a('0xe')](_0x36c8b6);}};EmailChannel['prototype']['sendMail']=function(_0x315630,_0x2cc99c){return this['smtp'][_0xa75a('0x32')](_0x315630,_0x2cc99c);};EmailChannel['prototype'][_0xa75a('0x33')]=function(_0x460200){var _0x42fc7c=this;if(this['mailAccounts'][_0x460200['id']]){if(_[_0xa75a('0x22')](this[_0xa75a('0xc')][_0x460200['id']][_0xa75a('0x34')])){this['mailAccounts'][_0x460200['id']][_0xa75a('0x34')]={};}this[_0xa75a('0xc')][_0x460200['id']][_0xa75a('0x34')][_0xa75a('0x31')]=moment();return new BPromise(function(_0x22344a,_0x40efef){return _0x42fc7c[_0xa75a('0x35')][_0xa75a('0x36')](_0x460200)[_0xa75a('0x2e')](function(_0x333ed3){_0x42fc7c['mailAccounts'][_0x460200['id']][_0xa75a('0x34')][_0xa75a('0x11')]=_0xa75a('0x37');_0x42fc7c[_0xa75a('0xc')][_0x460200['id']][_0xa75a('0x34')]['messageStatus']='';_0x42fc7c[_0xa75a('0xe')](_0x460200['id']);_0x22344a(_0x333ed3);})[_0xa75a('0x30')](function(_0x1f587a){_0x42fc7c[_0xa75a('0xc')][_0x460200['id']]['Smtp'][_0xa75a('0x11')]=_0xa75a('0x20');_0x42fc7c[_0xa75a('0xc')][_0x460200['id']][_0xa75a('0x34')]['messageStatus']=_0x1f587a;_0x42fc7c['emit'](_0x460200['id']);_0x40efef(_0x1f587a);});});}return this[_0xa75a('0x35')]['verify'](_0x460200);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1e8eecb..51c96fa 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 _0x0da8=['handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','exports','lodash','mailparser','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','getAccount','account','imap','once','ready','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','data5','authentication','password','anonymous@xcally.com','host','port','tls','autotls','required','emit','readUnseen','handleCloseBox','end','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes'];(function(_0x29b9b1,_0x11549a){var _0xc55f20=function(_0x16f9f0){while(--_0x16f9f0){_0x29b9b1['push'](_0x29b9b1['shift']());}};_0xc55f20(++_0x11549a);}(_0x0da8,0x1b3));var _0x80da=function(_0x53d729,_0x1a2198){_0x53d729=_0x53d729-0x0;var _0x568f90=_0x0da8[_0x53d729];return _0x568f90;};'use strict';var _=require(_0x80da('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0x80da('0x1'))[_0x80da('0x2')];var Iconv=require('iconv')[_0x80da('0x3')];var EventEmitter=require(_0x80da('0x4'))['EventEmitter'];var utils=require(_0x80da('0x5'));var logger=require(_0x80da('0x6'))(_0x80da('0x7'));function EmailImap(_0x538138,_0x1d21fa){this[_0x80da('0x8')]=_0x538138['mailbox'];this['account']=this[_0x80da('0x9')](_0x538138,_0x1d21fa);this['imap']=new Imap(this[_0x80da('0xa')]);this[_0x80da('0xb')][_0x80da('0xc')](_0x80da('0xd'),this[_0x80da('0xe')][_0x80da('0xf')](this));this['imap'][_0x80da('0xc')]('end',this['handleEnd']['bind'](this));this[_0x80da('0xb')]['on'](_0x80da('0x10'),this[_0x80da('0x11')][_0x80da('0xf')](this));this[_0x80da('0xb')][_0x80da('0x12')]();}util[_0x80da('0x13')](EmailImap,EventEmitter);EmailImap[_0x80da('0x14')][_0x80da('0x9')]=function(_0x2fbc59,_0x15585d){var _0x2d612f={'connTimeout':_0x2fbc59['connTimeout']?_0x2fbc59[_0x80da('0x15')]*0x3e8:0x2710,'authTimeout':_0x2fbc59['authTimeout']?_0x2fbc59[_0x80da('0x16')]*0x3e8:0x1388};if(_0x2fbc59[_0x80da('0x17')]){_0x2d612f['user']=_0x2fbc59[_0x80da('0x18')];if(_0x2fbc59[_0x80da('0x19')]){_0x2d612f['xoauth2']=utils[_0x80da('0x1a')](_0x2fbc59['CloudProvider'][_0x80da('0x1b')],_0x2fbc59[_0x80da('0x18')]);}else{_0x2d612f['password']=_0x2fbc59['password'];}}else{if(_0x2fbc59[_0x80da('0x1c')]){_0x2d612f['user']=_0x2fbc59['user'];_0x2d612f[_0x80da('0x1d')]=_0x2fbc59[_0x80da('0x1d')];}}_0x2d612f['email']=_0x15585d||_0x2fbc59[_0x80da('0x18')]||_0x80da('0x1e');_0x2d612f[_0x80da('0x1f')]=_0x2fbc59[_0x80da('0x1f')];_0x2d612f[_0x80da('0x20')]=_0x2fbc59[_0x80da('0x20')]||0x3e1;if(_0x2fbc59[_0x80da('0x21')]){_0x2d612f[_0x80da('0x21')]=!![];}else{_0x2d612f[_0x80da('0x21')]=![];_0x2d612f[_0x80da('0x22')]=_0x80da('0x23');}return _0x2d612f;};EmailImap[_0x80da('0x14')][_0x80da('0xe')]=function(){this['imap']['openBox'](this[_0x80da('0x8')],![],this['handleOpenBox'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')]['handleOpenBox']=function(_0x16929b,_0x4e12ed){if(_0x16929b){this['handleError'](_0x16929b,!![]);}else{this[_0x80da('0x24')]('box',_0x4e12ed);this[_0x80da('0x25')]();}};EmailImap[_0x80da('0x14')][_0x80da('0x26')]=function(_0x2ff392){if(_0x2ff392){this[_0x80da('0x11')](_0x2ff392,!![]);}else{this[_0x80da('0xb')][_0x80da('0x27')]();}};EmailImap[_0x80da('0x14')][_0x80da('0x25')]=function(){this[_0x80da('0xb')][_0x80da('0x28')]([_0x80da('0x29')],this['handleReadUnseen'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')]['handleReadUnseen']=function(_0x203a5a,_0x43b878){if(_0x203a5a){this[_0x80da('0x11')](_0x203a5a,!![]);}else{if(_0x43b878[_0x80da('0x2a')]){try{var _0x1fcd7e=this['imap'][_0x80da('0x2b')](_0x43b878,{'bodies':'','markSeen':!![]});_0x1fcd7e['on'](_0x80da('0x2c'),this[_0x80da('0x2d')][_0x80da('0xf')](this));_0x1fcd7e[_0x80da('0xc')](_0x80da('0x10'),this[_0x80da('0x2e')][_0x80da('0xf')](this));_0x1fcd7e[_0x80da('0xc')](_0x80da('0x27'),this[_0x80da('0x2f')][_0x80da('0xf')](this));}catch(_0x2af249){logger[_0x80da('0x10')](_0x2af249);}}else{this[_0x80da('0xb')][_0x80da('0x30')](!![],this[_0x80da('0x26')][_0x80da('0xf')](this));}}};EmailImap[_0x80da('0x14')][_0x80da('0x2d')]=function(_0x34665c){_0x34665c['on'](_0x80da('0x31'),this[_0x80da('0x32')]['bind'](this));_0x34665c['once'](_0x80da('0x33'),this[_0x80da('0x34')]['bind'](this));_0x34665c[_0x80da('0xc')]('end',this[_0x80da('0x35')][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')][_0x80da('0x32')]=function(_0x1e6371){simpleParser(_0x1e6371,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x80da('0x14')][_0x80da('0x34')]=function(){};EmailImap['prototype'][_0x80da('0x35')]=function(){};EmailImap['prototype'][_0x80da('0x36')]=function(_0x4abf4f,_0x59354b){if(_0x4abf4f){logger[_0x80da('0x10')](_0x4abf4f);}else{var _0x212089=this;utils[_0x80da('0x37')](this[_0x80da('0xa')],_0x59354b,function(_0x44cf48){_0x212089['emit'](_0x80da('0x7'),_0x44cf48);});}};EmailImap[_0x80da('0x14')][_0x80da('0x2f')]=function(){this[_0x80da('0xb')][_0x80da('0x30')](!![],this['handleCloseBox'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')][_0x80da('0x2e')]=function(_0x45975a){this['handleError'](_0x45975a);this[_0x80da('0xb')][_0x80da('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x80da('0x14')][_0x80da('0x38')]=function(){this['emit'](_0x80da('0x27'));};EmailImap['prototype'][_0x80da('0x11')]=function(_0x303480,_0x2d2cab){logger['error']('handleError',this[_0x80da('0xa')][_0x80da('0x7')],JSON[_0x80da('0x39')](_0x303480));var _0x14e733='';if(_0x303480){if(_0x303480[_0x80da('0x3a')]){_0x14e733=_0x303480['textCode'];}else{for(var _0x7e883 in _0x303480){if(_0x303480[_0x80da('0x3b')](_0x7e883)){_0x14e733+=_['upperFirst'](_0x7e883)+':\x20'+_0x303480[_0x7e883]+'\x0a';}}}}if(_0x2d2cab){this['imap']['end']();}else{this[_0x80da('0x24')](_0x80da('0x10'),_0x14e733);this[_0x80da('0x24')](_0x80da('0x27'));}};module[_0x80da('0x3c')]=EmailImap; \ No newline at end of file +var _0x6c52=['account','handleCloseBox','stringify','textCode','hasOwnProperty','exports','lodash','imap','mailparser','iconv','Iconv','events','../../../config/logger','email','mailbox','getAccount','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','anonymous@xcally.com','host','port','tls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x6c52,0x7e));var _0x26c5=function(_0x598072,_0x39758e){_0x598072=_0x598072-0x0;var _0xe8e115=_0x6c52[_0x598072];return _0xe8e115;};'use strict';var _=require(_0x26c5('0x0'));var util=require('util');var Imap=require(_0x26c5('0x1'));var simpleParser=require(_0x26c5('0x2'))['simpleParser'];var Iconv=require(_0x26c5('0x3'))[_0x26c5('0x4')];var EventEmitter=require(_0x26c5('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x26c5('0x6'))(_0x26c5('0x7'));function EmailImap(_0x52427d,_0x8ab09f){this['mailbox']=_0x52427d[_0x26c5('0x8')];this['account']=this[_0x26c5('0x9')](_0x52427d,_0x8ab09f);this[_0x26c5('0x1')]=new Imap(this['account']);this[_0x26c5('0x1')]['once']('ready',this[_0x26c5('0xa')][_0x26c5('0xb')](this));this[_0x26c5('0x1')]['once'](_0x26c5('0xc'),this[_0x26c5('0xd')]['bind'](this));this[_0x26c5('0x1')]['on'](_0x26c5('0xe'),this[_0x26c5('0xf')][_0x26c5('0xb')](this));this[_0x26c5('0x1')][_0x26c5('0x10')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x26c5('0x9')]=function(_0xb813e4,_0x29cf93){var _0x5300d7={'connTimeout':_0xb813e4[_0x26c5('0x11')]?_0xb813e4[_0x26c5('0x11')]*0x3e8:0x2710,'authTimeout':_0xb813e4['authTimeout']?_0xb813e4[_0x26c5('0x12')]*0x3e8:0x1388};if(_0xb813e4[_0x26c5('0x13')]){_0x5300d7[_0x26c5('0x14')]=_0xb813e4[_0x26c5('0x14')];if(_0xb813e4[_0x26c5('0x15')]){_0x5300d7[_0x26c5('0x16')]=utils[_0x26c5('0x17')](_0xb813e4['CloudProvider'][_0x26c5('0x18')],_0xb813e4[_0x26c5('0x14')]);}else{_0x5300d7['password']=_0xb813e4[_0x26c5('0x19')];}}else{if(_0xb813e4[_0x26c5('0x1a')]){_0x5300d7[_0x26c5('0x14')]=_0xb813e4[_0x26c5('0x14')];_0x5300d7[_0x26c5('0x19')]=_0xb813e4['password'];}}_0x5300d7[_0x26c5('0x7')]=_0x29cf93||_0xb813e4[_0x26c5('0x14')]||_0x26c5('0x1b');_0x5300d7[_0x26c5('0x1c')]=_0xb813e4[_0x26c5('0x1c')];_0x5300d7[_0x26c5('0x1d')]=_0xb813e4['port']||0x3e1;if(_0xb813e4[_0x26c5('0x1e')]){_0x5300d7[_0x26c5('0x1e')]=!![];}else{_0x5300d7['tls']=![];_0x5300d7['autotls']=_0x26c5('0x1f');}return _0x5300d7;};EmailImap[_0x26c5('0x20')]['handleReady']=function(){this[_0x26c5('0x1')][_0x26c5('0x21')](this[_0x26c5('0x8')],![],this[_0x26c5('0x22')]['bind'](this));};EmailImap[_0x26c5('0x20')][_0x26c5('0x22')]=function(_0x5aab00,_0x54070c){if(_0x5aab00){this[_0x26c5('0xf')](_0x5aab00,!![]);}else{this[_0x26c5('0x23')](_0x26c5('0x24'),_0x54070c);this[_0x26c5('0x25')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x5ef031){if(_0x5ef031){this[_0x26c5('0xf')](_0x5ef031,!![]);}else{this['imap'][_0x26c5('0xc')]();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x26c5('0x26')]([_0x26c5('0x27')],this[_0x26c5('0x28')][_0x26c5('0xb')](this));};EmailImap[_0x26c5('0x20')][_0x26c5('0x28')]=function(_0x362287,_0x32a6f0){if(_0x362287){this['handleError'](_0x362287,!![]);}else{if(_0x32a6f0[_0x26c5('0x29')]){try{var _0x3d6f56=this[_0x26c5('0x1')][_0x26c5('0x2a')](_0x32a6f0,{'bodies':'','markSeen':!![]});_0x3d6f56['on']('message',this[_0x26c5('0x2b')][_0x26c5('0xb')](this));_0x3d6f56[_0x26c5('0x2c')](_0x26c5('0xe'),this[_0x26c5('0x2d')][_0x26c5('0xb')](this));_0x3d6f56[_0x26c5('0x2c')]('end',this[_0x26c5('0x2e')][_0x26c5('0xb')](this));}catch(_0x5bce44){logger[_0x26c5('0xe')](_0x5bce44);}}else{this[_0x26c5('0x1')][_0x26c5('0x2f')](!![],this['handleCloseBox'][_0x26c5('0xb')](this));}}};EmailImap['prototype'][_0x26c5('0x2b')]=function(_0xf89e79){_0xf89e79['on'](_0x26c5('0x30'),this['handleMessageBody']['bind'](this));_0xf89e79['once'](_0x26c5('0x31'),this[_0x26c5('0x32')]['bind'](this));_0xf89e79[_0x26c5('0x2c')](_0x26c5('0xc'),this[_0x26c5('0x33')][_0x26c5('0xb')](this));};EmailImap[_0x26c5('0x20')]['handleMessageBody']=function(_0x2e84df){simpleParser(_0x2e84df,{'Iconv':Iconv},this[_0x26c5('0x34')][_0x26c5('0xb')](this));};EmailImap['prototype'][_0x26c5('0x32')]=function(){};EmailImap['prototype'][_0x26c5('0x33')]=function(){};EmailImap[_0x26c5('0x20')]['handleSimpleParser']=function(_0xce4823,_0x2e16a1){if(_0xce4823){logger['error'](_0xce4823);}else{var _0x43e05d=this;utils[_0x26c5('0x35')](this[_0x26c5('0x36')],_0x2e16a1,function(_0x4c4d11){_0x43e05d[_0x26c5('0x23')](_0x26c5('0x7'),_0x4c4d11);});}};EmailImap[_0x26c5('0x20')][_0x26c5('0x2e')]=function(){this[_0x26c5('0x1')][_0x26c5('0x2f')](!![],this[_0x26c5('0x37')][_0x26c5('0xb')](this));};EmailImap['prototype']['handleFetchError']=function(_0xd8adc8){this['handleError'](_0xd8adc8);this[_0x26c5('0x1')][_0x26c5('0x2f')](!![],this['handleCloseBox'][_0x26c5('0xb')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit']('end');};EmailImap[_0x26c5('0x20')]['handleError']=function(_0x586d03,_0x4c7a2b){logger['error'](_0x26c5('0xf'),this[_0x26c5('0x36')][_0x26c5('0x7')],JSON[_0x26c5('0x38')](_0x586d03));var _0x146987='';if(_0x586d03){if(_0x586d03[_0x26c5('0x39')]){_0x146987=_0x586d03['textCode'];}else{for(var _0x3ccd7b in _0x586d03){if(_0x586d03[_0x26c5('0x3a')](_0x3ccd7b)){_0x146987+=_['upperFirst'](_0x3ccd7b)+':\x20'+_0x586d03[_0x3ccd7b]+'\x0a';}}}}if(_0x4c7a2b){this[_0x26c5('0x1')]['end']();}else{this[_0x26c5('0x23')](_0x26c5('0xe'),_0x146987);this['emit'](_0x26c5('0xc'));}};module[_0x26c5('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 71294c5..5fb9d2f 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 _0x6c5d=['toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','compile','sendMail'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6c5d,0xc4));var _0xd6c5=function(_0x530bfd,_0x463ca2){_0x530bfd=_0x530bfd-0x0;var _0x2334f5=_0x6c5d[_0x530bfd];return _0x2334f5;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xd6c5('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0xd6c5('0x1')]=function(_0x2d6431,_0x59f3b5){return new Promise(function(_0x32822e,_0x20e21f){var _0x53781d=nodemailer['createTransport'](_0x2d6431);_0x53781d['use'](_0xd6c5('0x2'),inlineBase64());_0x53781d[_0xd6c5('0x3')](_0x59f3b5,function(_0x229661,_0x5bbafa){if(_0x229661){_0x20e21f(_0x229661[_0xd6c5('0x4')]());}else{_0x32822e(_0x5bbafa);}});});};EmailSmtp['prototype'][_0xd6c5('0x5')]=function(_0x5ca4fb){return new Promise(function(_0x12619a,_0x3ec6dd){var _0xe51e20=nodemailer['createTransport'](_0x5ca4fb);_0xe51e20['verify'](function(_0x1b1ae9,_0x306476){if(_0x1b1ae9){_0x3ec6dd(_0x1b1ae9['toString']());}else{if(_0x306476){_0x12619a(_0x306476);}else{_0x3ec6dd(_0xd6c5('0x6'));}}});});};module[_0xd6c5('0x7')]=EmailSmtp; \ No newline at end of file +var _0x5503=['toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5503,0x14e));var _0x3550=function(_0x47b565,_0x5d3b6f){_0x47b565=_0x47b565-0x0;var _0x3a887a=_0x5503[_0x47b565];return _0x3a887a;};'use strict';var nodemailer=require(_0x3550('0x0'));var inlineBase64=require(_0x3550('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x3550('0x2')]=function(_0x104821,_0x21e4e1){return new Promise(function(_0x31c1d2,_0x532307){var _0x3ca5d2=nodemailer[_0x3550('0x3')](_0x104821);_0x3ca5d2[_0x3550('0x4')](_0x3550('0x5'),inlineBase64());_0x3ca5d2[_0x3550('0x6')](_0x21e4e1,function(_0x10f15c,_0x58cff2){if(_0x10f15c){_0x532307(_0x10f15c[_0x3550('0x7')]());}else{_0x31c1d2(_0x58cff2);}});});};EmailSmtp['prototype'][_0x3550('0x8')]=function(_0x20b34b){return new Promise(function(_0x3faa9b,_0x581cd0){var _0x2c5244=nodemailer[_0x3550('0x3')](_0x20b34b);_0x2c5244[_0x3550('0x8')](function(_0x5eced6,_0x38b6a9){if(_0x5eced6){_0x581cd0(_0x5eced6[_0x3550('0x7')]());}else{if(_0x38b6a9){_0x3faa9b(_0x38b6a9);}else{_0x581cd0(_0x3550('0x9'));}}});});};module[_0x3550('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 0317767..3b4e858 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 _0x2262=['utf-8','toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','value','address','anonymous','head','name','substring','indexOf','split','slice','join','length','pop','generate','@xcally.com','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20]','body','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20'];(function(_0x3a3e9b,_0x20a7a7){var _0x62fc59=function(_0x323f0a){while(--_0x323f0a){_0x3a3e9b['push'](_0x3a3e9b['shift']());}};_0x62fc59(++_0x20a7a7);}(_0x2262,0x99));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2226('0x0'));var moment=require(_0x2226('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2226('0x2'));var util=require(_0x2226('0x3'));var tnef=require(_0x2226('0x4'));var logger=require(_0x2226('0x5'))(_0x2226('0x6'));var config=require('../../../config/environment');function getAddress(_0xd0c2d4){var _0x31d97f=_['head'](_0xd0c2d4[_0x2226('0x7')]);return _0x31d97f&&_0x31d97f[_0x2226('0x8')]?_0x31d97f[_0x2226('0x8')]:_0x2226('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x2be665){var _0x13814a=_[_0x2226('0xa')](_0x2be665[_0x2226('0x7')]);if(_0x13814a&&_0x13814a[_0x2226('0xb')]){if(_0x13814a[_0x2226('0xb')]==_0x13814a[_0x2226('0x8')]){return _0x13814a[_0x2226('0xb')][_0x2226('0xc')](0x0,_0x13814a[_0x2226('0xb')][_0x2226('0xd')]('@'));}var _0x510f4c=_0x13814a['name'][_0x2226('0xe')](/\s+/);return _0x510f4c['length']>0x1?_0x510f4c[_0x2226('0xf')](0x0,-0x1)[_0x2226('0x10')]('\x20'):_0x13814a[_0x2226('0xb')];}return'Anonymous';}function getLastName(_0x5928d2){var _0x44cda0=_[_0x2226('0xa')](_0x5928d2[_0x2226('0x7')]);if(_0x44cda0&&_0x44cda0[_0x2226('0xb')]){var _0x3d79c9=_0x44cda0[_0x2226('0xb')][_0x2226('0xe')](/\s+/);return _0x3d79c9[_0x2226('0x11')]>0x1?_0x3d79c9[_0x2226('0x12')]():'';}return'';}function getMails(_0x3419ed,_0x128401){var _0x1f013f='';for(var _0x4e0b6d=0x0;_0x4e0b6d<_0x128401['value']['length'];_0x4e0b6d+=0x1){if(_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]!==_0x3419ed){if(!_['isEmpty'](_0x1f013f)){_0x1f013f+=',';}_0x1f013f+=_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0xb')]||_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]||'';_0x1f013f+='\x20<';_0x1f013f+=_0x128401['value'][_0x4e0b6d][_0x2226('0x8')]?_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]:_0x2226('0x9')+random[_0x2226('0x13')](0x6)+_0x2226('0x14');_0x1f013f+='>';}}return _0x1f013f;}function parseEmail(_0x2c3839,_0x1ce6d1,_0x19368b){if(_0x1ce6d1[_0x2226('0x15')]){var _0x5e01ba=/)<[^<]*)*<\/script>/gi;while(_0x5e01ba[_0x2226('0x16')](_0x1ce6d1['html'])){_0x1ce6d1[_0x2226('0x15')]=_0x1ce6d1[_0x2226('0x15')][_0x2226('0x17')](_0x5e01ba,'');}if(_0x1ce6d1['html'][_0x2226('0x18')]('{_0x321215[_0x2226('0x1b')](_0x1edf11[_0x2226('0x1c')]);});var _0x39546d=/]+>/g;var _0xfe62ce=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a1ada=_0x1ce6d1['html'][_0x2226('0x17')](_0xfe62ce,_0x2226('0x1d'));var _0x294e7e=_0x5a1ada[_0x2226('0x17')](_0x39546d,_0x2226('0x1e'));for(let _0x4e1ba9=0x0;_0x4e1ba9<_0x321215[_0x2226('0x11')];_0x4e1ba9++){var _0x246e78=_0x294e7e['replace']('_IMG','\x20[Attachment:\x20'+_0x321215[_0x4e1ba9]+_0x2226('0x1f'));_0x294e7e=_0x246e78;}_0x1ce6d1[_0x2226('0x15')]=_0x294e7e;}_0x19368b['body']=_0x1ce6d1[_0x2226('0x15')];}else{_0x19368b['body']=_0x1ce6d1['textAsHtml'];}if(_0x19368b[_0x2226('0x20')]){_0x19368b[_0x2226('0x20')]=_0x19368b[_0x2226('0x20')][_0x2226('0x17')](/0x0){var _0x22ab94=[_0x2226('0x32'),_0x2226('0x33'),_0x2226('0x34')];for(var _0x494fe2=0x0;_0x494fe2<_0x1ce6d1[_0x2226('0x31')]['length'];_0x494fe2++){var _0x1b0103=_[_0x2226('0xd')](_0x22ab94,_0x1ce6d1['headerLines'][_0x494fe2][_0x2226('0x35')]);if(_0x1b0103>=0x0){_0x19368b[_0x2226('0x36')]=!![];}}}return _0x19368b;}exports[_0x2226('0x37')]=function(_0x144de6,_0x3cab36,_0x150605){var _0x522d51={'from':getAddress(_0x3cab36[_0x2226('0x38')]),'firstName':getFirstName(_0x3cab36[_0x2226('0x38')]),'lastName':getLastName(_0x3cab36[_0x2226('0x38')]),'mapKey':_0x2226('0x6'),'message':{'from':getMails(_0x144de6[_0x2226('0x6')],_0x3cab36['from']),'to':_0x144de6['email'],'cc':'','subject':_0x3cab36['subject']||'','messageId':_0x3cab36[_0x2226('0x39')],'inReplyTo':_0x3cab36[_0x2226('0x3a')],'sentAt':moment(_0x3cab36['date'])[_0x2226('0x3b')](_0x2226('0x3c')),'attach':![],'attachments':[]}};if(!_0x3cab36[_0x2226('0x15')]&&!_0x3cab36[_0x2226('0x3d')]){var _0x136db2=_[_0x2226('0x3e')](_0x3cab36[_0x2226('0x19')],{'contentType':_0x2226('0x3f')});if(_0x136db2['length']){logger['info'](util['format'](_0x2226('0x40'),_0x3cab36[_0x2226('0x39')]));tnef[_0x2226('0x41')](_['first'](_0x136db2)[_0x2226('0x2f')],function(_0x1af8dc,_0x2094b0){if(_0x2094b0){_0x3cab36['html']=_0x2094b0['BodyHTML']||_0x2226('0x42');if(_0x2094b0[_0x2226('0x43')]){for(var _0x6db8af=0x0;_0x6db8af<_0x2094b0[_0x2226('0x43')][_0x2226('0x11')];_0x6db8af++){var _0x1b6445=_0x2094b0[_0x2226('0x43')][_0x6db8af];_0x522d51[_0x2226('0x22')][_0x2226('0x19')][_0x2226('0x1b')]({'filename':_0x1b6445[_0x2226('0x44')],'content':Buffer['from'](_0x1b6445['Data'])});}}}_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));});}else{_0x3cab36[_0x2226('0x15')]=_0x2226('0x42');_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));}}else{_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));}};exports[_0x2226('0x45')]=function(_0xb5599b,_0x5138e5){var _0x560429=[_0x2226('0x46')+(_0x5138e5||''),_0x2226('0x47')+_0xb5599b,'',''];return Buffer[_0x2226('0x38')](_0x560429[_0x2226('0x10')](''),_0x2226('0x48'))[_0x2226('0x49')](_0x2226('0x4a'));}; \ No newline at end of file +var _0x1fbb=['node-tnef','../../../config/logger','head','address','@xcally.com','value','name','substring','indexOf','length','slice','join','Anonymous','split','pop','isEmpty','anonymous','generate','html','test','replace','includes','\x20[Attachment:\x20','\x20]','textAsHtml','body','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','base64','lodash','moment','util'];(function(_0x39bdda,_0x384906){var _0x1f6bc8=function(_0x2090b3){while(--_0x2090b3){_0x39bdda['push'](_0x39bdda['shift']());}};_0x1f6bc8(++_0x384906);}(_0x1fbb,0x179));var _0xb1fb=function(_0xafb07b,_0x30cdab){_0xafb07b=_0xafb07b-0x0;var _0x4c55a8=_0x1fbb[_0xafb07b];return _0x4c55a8;};'use strict';var _=require(_0xb1fb('0x0'));var moment=require(_0xb1fb('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0xb1fb('0x2'));var tnef=require(_0xb1fb('0x3'));var logger=require(_0xb1fb('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0x6eab80){var _0xd19c22=_[_0xb1fb('0x5')](_0x6eab80['value']);return _0xd19c22&&_0xd19c22[_0xb1fb('0x6')]?_0xd19c22[_0xb1fb('0x6')]:'anonymous'+random['generate'](0x6)+_0xb1fb('0x7');}function getFirstName(_0x1fbdbc){var _0xe82ab4=_[_0xb1fb('0x5')](_0x1fbdbc[_0xb1fb('0x8')]);if(_0xe82ab4&&_0xe82ab4['name']){if(_0xe82ab4[_0xb1fb('0x9')]==_0xe82ab4[_0xb1fb('0x6')]){return _0xe82ab4[_0xb1fb('0x9')][_0xb1fb('0xa')](0x0,_0xe82ab4['name'][_0xb1fb('0xb')]('@'));}var _0x5594e4=_0xe82ab4[_0xb1fb('0x9')]['split'](/\s+/);return _0x5594e4[_0xb1fb('0xc')]>0x1?_0x5594e4[_0xb1fb('0xd')](0x0,-0x1)[_0xb1fb('0xe')]('\x20'):_0xe82ab4[_0xb1fb('0x9')];}return _0xb1fb('0xf');}function getLastName(_0x4e809b){var _0x2bfc08=_[_0xb1fb('0x5')](_0x4e809b[_0xb1fb('0x8')]);if(_0x2bfc08&&_0x2bfc08[_0xb1fb('0x9')]){var _0x11ba9f=_0x2bfc08['name'][_0xb1fb('0x10')](/\s+/);return _0x11ba9f[_0xb1fb('0xc')]>0x1?_0x11ba9f[_0xb1fb('0x11')]():'';}return'';}function getMails(_0x18b9de,_0x1661c2){var _0x123bff='';for(var _0x3ce6e8=0x0;_0x3ce6e8<_0x1661c2['value']['length'];_0x3ce6e8+=0x1){if(_0x1661c2[_0xb1fb('0x8')][_0x3ce6e8][_0xb1fb('0x6')]!==_0x18b9de){if(!_[_0xb1fb('0x12')](_0x123bff)){_0x123bff+=',';}_0x123bff+=_0x1661c2[_0xb1fb('0x8')][_0x3ce6e8][_0xb1fb('0x9')]||_0x1661c2[_0xb1fb('0x8')][_0x3ce6e8][_0xb1fb('0x6')]||'';_0x123bff+='\x20<';_0x123bff+=_0x1661c2['value'][_0x3ce6e8]['address']?_0x1661c2[_0xb1fb('0x8')][_0x3ce6e8][_0xb1fb('0x6')]:_0xb1fb('0x13')+random[_0xb1fb('0x14')](0x6)+'@xcally.com';_0x123bff+='>';}}return _0x123bff;}function parseEmail(_0x529c09,_0x348f37,_0x2e7953){if(_0x348f37[_0xb1fb('0x15')]){var _0x21dd18=/)<[^<]*)*<\/script>/gi;while(_0x21dd18[_0xb1fb('0x16')](_0x348f37['html'])){_0x348f37[_0xb1fb('0x15')]=_0x348f37['html'][_0xb1fb('0x17')](_0x21dd18,'');}if(_0x348f37[_0xb1fb('0x15')][_0xb1fb('0x18')](_0xb1fb('0x19'))){var _0x5e1f57=[];_0x348f37[_0xb1fb('0x1a')][_0xb1fb('0x1b')](_0x449127=>{_0x5e1f57[_0xb1fb('0x1c')](_0x449127[_0xb1fb('0x1d')]);});var _0x43f4e3=/]+>/g;var _0x143f6d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x500914=_0x348f37['html'][_0xb1fb('0x17')](_0x143f6d,_0xb1fb('0x1e'));var _0x3cb990=_0x500914[_0xb1fb('0x17')](_0x43f4e3,'_IMG');for(let _0x5108f6=0x0;_0x5108f6<_0x5e1f57['length'];_0x5108f6++){var _0x477e5f=_0x3cb990[_0xb1fb('0x17')](_0xb1fb('0x1f'),_0xb1fb('0x20')+_0x5e1f57[_0x5108f6]+_0xb1fb('0x21'));_0x3cb990=_0x477e5f;}_0x348f37[_0xb1fb('0x15')]=_0x3cb990;}_0x2e7953['body']=_0x348f37[_0xb1fb('0x15')];}else{_0x2e7953['body']=_0x348f37[_0xb1fb('0x22')];}if(_0x2e7953[_0xb1fb('0x23')]){_0x2e7953['body']=_0x2e7953[_0xb1fb('0x23')][_0xb1fb('0x17')](/0x0){var _0x49175a=[_0xb1fb('0x34'),_0xb1fb('0x35'),_0xb1fb('0x36')];for(var _0x74e2a7=0x0;_0x74e2a7<_0x348f37['headerLines'][_0xb1fb('0xc')];_0x74e2a7++){var _0x1f3d10=_['indexOf'](_0x49175a,_0x348f37[_0xb1fb('0x33')][_0x74e2a7]['line']);if(_0x1f3d10>=0x0){_0x2e7953['isAutoreply']=!![];}}}return _0x2e7953;}exports[_0xb1fb('0x37')]=function(_0x305a35,_0x4a0971,_0x49851d){var _0x135f95={'from':getAddress(_0x4a0971[_0xb1fb('0x38')]),'firstName':getFirstName(_0x4a0971[_0xb1fb('0x38')]),'lastName':getLastName(_0x4a0971[_0xb1fb('0x38')]),'mapKey':_0xb1fb('0x28'),'message':{'from':getMails(_0x305a35['email'],_0x4a0971['from']),'to':_0x305a35['email'],'cc':'','subject':_0x4a0971[_0xb1fb('0x39')]||'','messageId':_0x4a0971[_0xb1fb('0x3a')],'inReplyTo':_0x4a0971[_0xb1fb('0x3b')],'sentAt':moment(_0x4a0971[_0xb1fb('0x3c')])['format'](_0xb1fb('0x3d')),'attach':![],'attachments':[]}};if(!_0x4a0971[_0xb1fb('0x15')]&&!_0x4a0971[_0xb1fb('0x22')]){var _0x5c1307=_[_0xb1fb('0x3e')](_0x4a0971['attachments'],{'contentType':'application/ms-tnef'});if(_0x5c1307[_0xb1fb('0xc')]){logger[_0xb1fb('0x3f')](util[_0xb1fb('0x2d')](_0xb1fb('0x40'),_0x4a0971[_0xb1fb('0x3a')]));tnef[_0xb1fb('0x41')](_[_0xb1fb('0x42')](_0x5c1307)['content'],function(_0x17a077,_0x5a4abc){if(_0x5a4abc){_0x4a0971[_0xb1fb('0x15')]=_0x5a4abc[_0xb1fb('0x43')]||_0xb1fb('0x44');if(_0x5a4abc[_0xb1fb('0x45')]){for(var _0x2ee5e3=0x0;_0x2ee5e3<_0x5a4abc[_0xb1fb('0x45')][_0xb1fb('0xc')];_0x2ee5e3++){var _0x18588d=_0x5a4abc[_0xb1fb('0x45')][_0x2ee5e3];_0x135f95[_0xb1fb('0x26')][_0xb1fb('0x1a')]['push']({'filename':_0x18588d[_0xb1fb('0x46')],'content':Buffer[_0xb1fb('0x38')](_0x18588d[_0xb1fb('0x47')])});}}}_0x49851d(parseEmail(_0x305a35,_0x4a0971,_0x135f95));});}else{_0x4a0971[_0xb1fb('0x15')]='

Empty\x20message

';_0x49851d(parseEmail(_0x305a35,_0x4a0971,_0x135f95));}}else{_0x49851d(parseEmail(_0x305a35,_0x4a0971,_0x135f95));}};exports[_0xb1fb('0x48')]=function(_0x3a5b69,_0x5890f8){var _0x29d3d9=[_0xb1fb('0x49')+(_0x5890f8||''),'auth=Bearer\x20'+_0x3a5b69,'',''];return Buffer[_0xb1fb('0x38')](_0x29d3d9[_0xb1fb('0xe')](''),_0xb1fb('0x4a'))['toString'](_0xb1fb('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 5fc6e7e..1bd865f 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 _0x1557=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x2b8842,_0x2f66d0){var _0x3136a2=function(_0x75b8ba){while(--_0x75b8ba){_0x2b8842['push'](_0x2b8842['shift']());}};_0x3136a2(++_0x2f66d0);}(_0x1557,0x1c3));var _0x7155=function(_0x3b9fd3,_0x5d536c){_0x3b9fd3=_0x3b9fd3-0x0;var _0x43ac33=_0x1557[_0x3b9fd3];return _0x43ac33;};'use strict';var _=require(_0x7155('0x0'));function MailAccount(_0x37724b){this['id']=_0x37724b['id']||0x0;this[_0x7155('0x1')]=_0x37724b[_0x7155('0x1')]||_0x7155('0x2');this[_0x7155('0x3')]=_0x37724b[_0x7155('0x3')]||_0x7155('0x4');this[_0x7155('0x5')]=_0x37724b['active']||![];this[_0x7155('0x6')]=_0x37724b['Imap']||[];this[_0x7155('0x7')]=_0x37724b['Smtp']||[];}module[_0x7155('0x8')]=MailAccount; \ No newline at end of file +var _0x8eff=['lodash','name','key','SERV','active','Imap','Smtp','exports'];(function(_0x124722,_0x2a4971){var _0xec2ec4=function(_0x52cb70){while(--_0x52cb70){_0x124722['push'](_0x124722['shift']());}};_0xec2ec4(++_0x2a4971);}(_0x8eff,0x1a8));var _0xf8ef=function(_0x1598b0,_0x3e5461){_0x1598b0=_0x1598b0-0x0;var _0x4bdc11=_0x8eff[_0x1598b0];return _0x4bdc11;};'use strict';var _=require(_0xf8ef('0x0'));function MailAccount(_0x274f84){this['id']=_0x274f84['id']||0x0;this[_0xf8ef('0x1')]=_0x274f84[_0xf8ef('0x1')]||'Service';this[_0xf8ef('0x2')]=_0x274f84[_0xf8ef('0x2')]||_0xf8ef('0x3');this[_0xf8ef('0x4')]=_0x274f84[_0xf8ef('0x4')]||![];this[_0xf8ef('0x5')]=_0x274f84[_0xf8ef('0x5')]||[];this[_0xf8ef('0x6')]=_0x274f84[_0xf8ef('0x6')]||[];}module[_0xf8ef('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f23af35..c24ee72 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 _0x3295=['mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x3295,0x167));var _0x5329=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x3295[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x5329('0x0'));var MailAccount=require(_0x5329('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1dc502,_0x32b484,_0x53bb86){var _0x32416c=_[_0x5329('0x2')](_0x1dc502,function(_0x51433e,_0x45049b){return _0x51433e[_0x53bb86];});for(var _0x2b045b in _0x32b484){if(_0x32b484[_0x5329('0x3')](_0x2b045b)){if(!_0x32416c[_0x2b045b]){delete _0x32b484[_0x2b045b];}}}}Realtime['prototype'][_0x5329('0x4')]=function(_0x1a5976,_0x3a6d8e){for(var _0x538ce6 in _0x3a6d8e){if(_0x1a5976[_0x5329('0x3')](_0x538ce6)){_0x1a5976[_0x538ce6]=_0x3a6d8e[_0x538ce6];}}};Realtime['prototype'][_0x5329('0x5')]=function(){var _0x37c71e=this;return function(_0x47005e){if(_0x47005e){freeIsNotKey(_0x47005e,_0x37c71e[_0x5329('0x6')],'id');for(var _0x2b38d2=0x0,_0x4cf4e9={},_0x517152={};_0x2b38d2<_0x47005e[_0x5329('0x7')];_0x2b38d2+=0x1){_0x4cf4e9=_0x47005e[_0x2b38d2];if(_[_0x5329('0x8')](_0x37c71e[_0x5329('0x6')][_0x4cf4e9['id']])){_0x37c71e['mailAccounts'][_0x4cf4e9['id']]=new MailAccount(_0x4cf4e9);}else{_[_0x5329('0x9')](_0x37c71e[_0x5329('0x6')][_0x4cf4e9['id']],_0x4cf4e9);}}}return _0x37c71e[_0x5329('0x6')];};};module[_0x5329('0xa')]=Realtime; \ No newline at end of file +var _0x69ec=['initMailAccounts','mailAccounts','length','../model/mailAccount','mapKeys','hasOwnProperty','mergeFromDatabase'];(function(_0x4a96b8,_0x2c9f68){var _0x24439f=function(_0x88f9ad){while(--_0x88f9ad){_0x4a96b8['push'](_0x4a96b8['shift']());}};_0x24439f(++_0x2c9f68);}(_0x69ec,0xb9));var _0xc69e=function(_0x5ea34f,_0xb3d1db){_0x5ea34f=_0x5ea34f-0x0;var _0x4b9e25=_0x69ec[_0x5ea34f];return _0x4b9e25;};'use strict';var _=require('lodash');var MailAccount=require(_0xc69e('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x57f54e,_0x4662cd,_0x28a9c4){var _0x3a8fa6=_[_0xc69e('0x1')](_0x57f54e,function(_0x604845,_0xc974cf){return _0x604845[_0x28a9c4];});for(var _0xd0d39c in _0x4662cd){if(_0x4662cd[_0xc69e('0x2')](_0xd0d39c)){if(!_0x3a8fa6[_0xd0d39c]){delete _0x4662cd[_0xd0d39c];}}}}Realtime['prototype'][_0xc69e('0x3')]=function(_0xd2ab05,_0x58b0ff){for(var _0xe536e7 in _0x58b0ff){if(_0xd2ab05[_0xc69e('0x2')](_0xe536e7)){_0xd2ab05[_0xe536e7]=_0x58b0ff[_0xe536e7];}}};Realtime['prototype'][_0xc69e('0x4')]=function(){var _0x39d148=this;return function(_0x340f51){if(_0x340f51){freeIsNotKey(_0x340f51,_0x39d148[_0xc69e('0x5')],'id');for(var _0x5405e8=0x0,_0x3e6142={},_0x5cd695={};_0x5405e8<_0x340f51[_0xc69e('0x6')];_0x5405e8+=0x1){_0x3e6142=_0x340f51[_0x5405e8];if(_['isUndefined'](_0x39d148[_0xc69e('0x5')][_0x3e6142['id']])){_0x39d148['mailAccounts'][_0x3e6142['id']]=new MailAccount(_0x3e6142);}else{_['merge'](_0x39d148[_0xc69e('0x5')][_0x3e6142['id']],_0x3e6142);}}}return _0x39d148[_0xc69e('0x5')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 4511cba..82a4800 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 _0xf3fe=['MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','email','active','key','ListId','TemplateId','CloudProvider','service','type','data5'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x545006,_0xd38399){_0x545006=_0x545006-0x0;var _0x48cc6d=_0xf3fe[_0x545006];return _0x48cc6d;};'use strict';var client=require('../client');exports[_0xef3f('0x0')]=function(){return function(){return client[_0xef3f('0x1')](_0xef3f('0x2'),{'options':{'attributes':['id',_0xef3f('0x3'),_0xef3f('0x4'),'service',_0xef3f('0x5'),_0xef3f('0x6'),_0xef3f('0x7'),_0xef3f('0x8'),_0xef3f('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xef3f('0xa'),'attributes':['id',_0xef3f('0x3'),_0xef3f('0xb'),_0xef3f('0xc'),_0xef3f('0xd')],'as':_0xef3f('0xa')}]},{'model':_0xef3f('0xe'),'as':_0xef3f('0xf'),'include':[{'model':_0xef3f('0xa'),'attributes':['id','name',_0xef3f('0xb'),'type',_0xef3f('0xd')],'as':_0xef3f('0xa')}]}]},'log':_0xef3f('0x10')});};};exports[_0xef3f('0x11')]=function(_0x4f0367,_0x1667e8){return client[_0xef3f('0x1')]('NotifyMailAccount',{'account':{'id':_0x4f0367},'body':_0x1667e8,'log':_0xef3f('0x12')});}; \ No newline at end of file +var _0x8861=['email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','data5','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','Request','GetMailAccount','name','provider','service'];(function(_0x55086c,_0x373acb){var _0x415bda=function(_0x4b3d38){while(--_0x4b3d38){_0x55086c['push'](_0x55086c['shift']());}};_0x415bda(++_0x373acb);}(_0x8861,0x6d));var _0x1886=function(_0x258d2e,_0x28f8d8){_0x258d2e=_0x258d2e-0x0;var _0x2f70e0=_0x8861[_0x258d2e];return _0x2f70e0;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x1886('0x0')](_0x1886('0x1'),{'options':{'attributes':['id',_0x1886('0x2'),_0x1886('0x3'),_0x1886('0x4'),_0x1886('0x5'),_0x1886('0x6'),_0x1886('0x7'),_0x1886('0x8'),_0x1886('0x9')],'raw':![],'include':[{'model':_0x1886('0xa'),'as':_0x1886('0xb'),'include':[{'model':_0x1886('0xc'),'attributes':['id',_0x1886('0x2'),_0x1886('0x4'),'type',_0x1886('0xd')],'as':'CloudProvider'}]},{'model':_0x1886('0xe'),'as':'Smtp','include':[{'model':_0x1886('0xc'),'attributes':['id','name',_0x1886('0x4'),_0x1886('0xf'),_0x1886('0xd')],'as':_0x1886('0xc')}]}]},'log':_0x1886('0x10')});};};exports[_0x1886('0x11')]=function(_0x5a456a,_0x2a56c2){return client[_0x1886('0x0')](_0x1886('0x12'),{'account':{'id':_0x5a456a},'body':_0x2a56c2,'log':_0x1886('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 171c06b..0cb1a3d 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 _0x4eb1=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x4836a6,_0x32a746){var _0x5bfaf3=function(_0x247e5c){while(--_0x247e5c){_0x4836a6['push'](_0x4836a6['shift']());}};_0x5bfaf3(++_0x32a746);}(_0x4eb1,0x94));var _0x14eb=function(_0x52bae3,_0xee057f){_0x52bae3=_0x52bae3-0x0;var _0x4d6b88=_0x4eb1[_0x52bae3];return _0x4d6b88;};'use strict';var client=require(_0x14eb('0x0'));exports['getSettings']=function(){return client[_0x14eb('0x1')](_0x14eb('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x14eb('0x3')]},'log':_0x14eb('0x4')});}; \ No newline at end of file +var _0x0ff0=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x45e875,_0x4f2ee6){var _0x127d46=function(_0x4666e7){while(--_0x4666e7){_0x45e875['push'](_0x45e875['shift']());}};_0x127d46(++_0x4f2ee6);}(_0x0ff0,0x1bb));var _0x00ff=function(_0x7bd8a2,_0x16d903){_0x7bd8a2=_0x7bd8a2-0x0;var _0x280d6c=_0x0ff0[_0x7bd8a2];return _0x280d6c;};'use strict';var client=require(_0x00ff('0x0'));exports[_0x00ff('0x1')]=function(){return client[_0x00ff('0x2')](_0x00ff('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x00ff('0x4')]},'log':_0x00ff('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 7d42ea3..f3999f5 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 9fafab8..2756a30 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 _0xc429=['log','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','listening'];(function(_0x23b212,_0x44f72b){var _0x49db1a=function(_0x9e5ba2){while(--_0x9e5ba2){_0x23b212['push'](_0x23b212['shift']());}};_0x49db1a(++_0x44f72b);}(_0xc429,0x1b1));var _0x9c42=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xc429[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x9c42('0x0'));var http=require(_0x9c42('0x1'));var express=require(_0x9c42('0x2'));var sticky=require(_0x9c42('0x3'));var Redis=require(_0x9c42('0x4'));var config=require(_0x9c42('0x5'));var app=express();var server=http[_0x9c42('0x6')](app);server[_0x9c42('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0x9c42('0x8')])){var socketio=require(_0x9c42('0x9'))(server,{'transports':[_0x9c42('0xa'),_0x9c42('0xb')]});config[_0x9c42('0xc')]=_[_0x9c42('0xd')](config[_0x9c42('0xc')],{'host':_0x9c42('0xe'),'port':0x18eb});socketio[_0x9c42('0xf')](require(_0x9c42('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x9c42('0xc')])}));require(_0x9c42('0x11'))['default']();require(_0x9c42('0x12'))[_0x9c42('0x13')](socketio);require(_0x9c42('0x14'))[_0x9c42('0x13')](app);require(_0x9c42('0x15'))[_0x9c42('0x13')](app);}else{server['once'](_0x9c42('0x16'),function(){console[_0x9c42('0x17')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9c42('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x427b=['../../config/express','../../routes','once','listening','log','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x427b,0x131));var _0xb427=function(_0x3bd127,_0x5052cd){_0x3bd127=_0x3bd127-0x0;var _0x478b12=_0x427b[_0x3bd127];return _0x478b12;};'use strict';var _=require('lodash');var http=require(_0xb427('0x0'));var express=require(_0xb427('0x1'));var sticky=require(_0xb427('0x2'));var Redis=require(_0xb427('0x3'));var config=require(_0xb427('0x4'));var app=express();var server=http[_0xb427('0x5')](app);server[_0xb427('0x6')]=0xdbba0;if(sticky[_0xb427('0x7')](server,config[_0xb427('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0xb427('0x9'),_0xb427('0xa')]});config['redis']=_['defaults'](config[_0xb427('0xb')],{'host':_0xb427('0xc'),'port':0x18eb});socketio[_0xb427('0xd')](require(_0xb427('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xb427('0xb')])}));require(_0xb427('0xf'))[_0xb427('0x10')]();require('../../config/socketio')[_0xb427('0x10')](socketio);require(_0xb427('0x11'))[_0xb427('0x10')](app);require(_0xb427('0x12'))[_0xb427('0x10')](app);}else{server[_0xb427('0x13')](_0xb427('0x14'),function(){console[_0xb427('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb427('0x8')]);});}exports=module[_0xb427('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3f35a47..bcbbfaf 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 _0x8966=['message','result','catch','rpc','exports','bluebird','client','http','Request','then','debug','error','routing'];(function(_0x24b08e,_0x1bc54b){var _0xc0cade=function(_0x4a1db3){while(--_0x4a1db3){_0x24b08e['push'](_0x24b08e['shift']());}};_0xc0cade(++_0x1bc54b);}(_0x8966,0xa1));var _0x6896=function(_0x1a525b,_0x3c77e1){_0x1a525b=_0x1a525b-0x0;var _0x28ca11=_0x8966[_0x1a525b];return _0x28ca11;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6896('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x6896('0x1')][_0x6896('0x2')]({'port':0x2329});client[_0x6896('0x3')]=function(_0x443d44,_0x589cbc){return new BPromise(function(_0x2e7f18,_0x33daf8){return client['request'](_0x443d44,_0x589cbc)[_0x6896('0x4')](function(_0x34b161){logger[_0x6896('0x5')]('rpc','routing',_0x443d44,_0x589cbc,_0x34b161);if(_0x34b161[_0x6896('0x6')]){logger[_0x6896('0x6')]('rpc',_0x6896('0x7'),_0x443d44,_0x34b161[_0x6896('0x6')]['message'],_0x589cbc);return _0x33daf8(_0x34b161[_0x6896('0x6')][_0x6896('0x8')]);}else{return _0x2e7f18(_0x34b161[_0x6896('0x9')]);}})[_0x6896('0xa')](function(_0x4e792f){logger[_0x6896('0x6')](_0x6896('0xb'),_0x6896('0x7'),_0x443d44,_0x4e792f,_0x589cbc);return _0x33daf8(_0x4e792f);});});};module[_0x6896('0xc')]=client; \ No newline at end of file +var _0xce1d=['http','Request','request','then','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x13773e,_0x1f3faf){var _0x103ec4=function(_0x2384ef){while(--_0x2384ef){_0x13773e['push'](_0x13773e['shift']());}};_0x103ec4(++_0x1f3faf);}(_0xce1d,0x1be));var _0xdce1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xce1d[_0x14add3];return _0x4a174f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xdce1('0x0'));var logger=require(_0xdce1('0x1'))(_0xdce1('0x2'));var client=jayson[_0xdce1('0x3')][_0xdce1('0x4')]({'port':0x2329});client[_0xdce1('0x5')]=function(_0x23a405,_0x4669ab){return new BPromise(function(_0x24db87,_0x5607ea){return client[_0xdce1('0x6')](_0x23a405,_0x4669ab)[_0xdce1('0x7')](function(_0x3f737d){logger[_0xdce1('0x8')](_0xdce1('0x9'),_0xdce1('0x2'),_0x23a405,_0x4669ab,_0x3f737d);if(_0x3f737d[_0xdce1('0xa')]){logger[_0xdce1('0xa')](_0xdce1('0x9'),_0xdce1('0x2'),_0x23a405,_0x3f737d['error'][_0xdce1('0xb')],_0x4669ab);return _0x5607ea(_0x3f737d[_0xdce1('0xa')]['message']);}else{return _0x24db87(_0x3f737d[_0xdce1('0xc')]);}})[_0xdce1('0xd')](function(_0x45920b){logger[_0xdce1('0xa')](_0xdce1('0x9'),'routing',_0x23a405,_0x45920b,_0x4669ab);return _0x5607ea(_0x45920b);});});};module[_0xdce1('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index f00356b..206a455 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 _0xc897=['getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues'];(function(_0x18cf09,_0x451975){var _0x4104eb=function(_0x478317){while(--_0x478317){_0x18cf09['push'](_0x18cf09['shift']());}};_0x4104eb(++_0x451975);}(_0xc897,0xa7));var _0x7c89=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xc897[_0x339129];return _0x1570df;};'use strict';var BPromise=require(_0x7c89('0x0'));var server=require(_0x7c89('0x1'));var Realtime=require(_0x7c89('0x2'));var user=require(_0x7c89('0x3'));var interval=require(_0x7c89('0x4'));var openchannelQueue=require(_0x7c89('0x5'));var chatQueue=require(_0x7c89('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x7c89('0x7'));var faxQueue=require(_0x7c89('0x8'));var whatsappQueue=require(_0x7c89('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7c89('0xa')]()[_0x7c89('0xb')](user[_0x7c89('0xc')]())[_0x7c89('0xb')](realtime[_0x7c89('0xd')]())[_0x7c89('0xb')](interval[_0x7c89('0xe')]())[_0x7c89('0xb')](realtime['initIntervals']())[_0x7c89('0xb')](openchannelQueue[_0x7c89('0xf')]())['then'](realtime[_0x7c89('0x10')]())[_0x7c89('0xb')](chatQueue[_0x7c89('0x11')]())[_0x7c89('0xb')](realtime[_0x7c89('0x12')]())[_0x7c89('0xb')](smsQueue[_0x7c89('0x13')]())[_0x7c89('0xb')](realtime['initSmsQueues']())[_0x7c89('0xb')](mailQueue[_0x7c89('0x14')]())['then'](realtime[_0x7c89('0x15')]())['then'](faxQueue[_0x7c89('0x16')]())[_0x7c89('0xb')](realtime[_0x7c89('0x17')]())[_0x7c89('0xb')](whatsappQueue[_0x7c89('0x18')]())['then'](realtime[_0x7c89('0x19')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7c89('0xb')](function(_0x204e59){return initRealtime();})[_0x7c89('0xb')](function(_0x438f24){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2906e1){console[_0x7c89('0x1a')](_0x2906e1);});}main(); \ No newline at end of file +var _0x4e20=['getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x4e20,0x113));var _0x04e2=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x4e20[_0x2d89ce];return _0x3fad10;};'use strict';var BPromise=require('bluebird');var server=require(_0x04e2('0x0'));var Realtime=require(_0x04e2('0x1'));var user=require(_0x04e2('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x04e2('0x3'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x04e2('0x4'));var faxQueue=require(_0x04e2('0x5'));var whatsappQueue=require(_0x04e2('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x04e2('0x7')]()[_0x04e2('0x8')](user[_0x04e2('0x9')]())['then'](realtime[_0x04e2('0xa')]())[_0x04e2('0x8')](interval[_0x04e2('0xb')]())[_0x04e2('0x8')](realtime[_0x04e2('0xc')]())['then'](openchannelQueue[_0x04e2('0xd')]())[_0x04e2('0x8')](realtime[_0x04e2('0xe')]())['then'](chatQueue[_0x04e2('0xf')]())['then'](realtime['initChatQueues']())[_0x04e2('0x8')](smsQueue['getSmsQueues']())[_0x04e2('0x8')](realtime['initSmsQueues']())[_0x04e2('0x8')](mailQueue[_0x04e2('0x10')]())[_0x04e2('0x8')](realtime[_0x04e2('0x11')]())[_0x04e2('0x8')](faxQueue[_0x04e2('0x12')]())[_0x04e2('0x8')](realtime[_0x04e2('0x13')]())['then'](whatsappQueue[_0x04e2('0x14')]())['then'](realtime[_0x04e2('0x15')]())[_0x04e2('0x8')](function(){return realtime;});}function main(){return server[_0x04e2('0x16')](realtime)[_0x04e2('0x8')](function(_0x55ccde){return initRealtime();})[_0x04e2('0x8')](function(_0x2b83ad){return setInterval(initRealtime,0x1388);})[_0x04e2('0x17')](function(_0x454d6b){console['log'](_0x454d6b);});}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 70c86e8..fd1b874 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x3b320e,_0x232e26){var _0x25108c=function(_0x28c6ec){while(--_0x28c6ec){_0x3b320e['push'](_0x3b320e['shift']());}};_0x25108c(++_0x232e26);}(_0x814b,0x1a2));var _0xb814=function(_0x2183ca,_0x3778a9){_0x2183ca=_0x2183ca-0x0;var _0x21d00e=_0x814b[_0x2183ca];return _0x21d00e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x4405d7,_0x15c4b3){var _0x2072a0=function(_0x3fbf68){while(--_0x3fbf68){_0x4405d7['push'](_0x4405d7['shift']());}};_0x2072a0(++_0x15c4b3);}(_0x2ef3,0xba));var _0x32ef=function(_0x20fa3a,_0x4f4924){_0x20fa3a=_0x20fa3a-0x0;var _0x24eba3=_0x2ef3[_0x20fa3a];return _0x24eba3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 650c1d1..7c7b683 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 _0x5704=['client','request','error','message','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x5d3f5c,_0x3cb3d3){var _0x11e0e7=function(_0x576e9e){while(--_0x576e9e){_0x5d3f5c['push'](_0x5d3f5c['shift']());}};_0x11e0e7(++_0x3cb3d3);}(_0x5704,0x11e));var _0x4570=function(_0x5c037a,_0x345a53){_0x5c037a=_0x5c037a-0x0;var _0xd51614=_0x5704[_0x5c037a];return _0xd51614;};'use strict';var BPromise=require(_0x4570('0x0'));var jayson=require(_0x4570('0x1'));var client=jayson[_0x4570('0x2')]['http']({'port':0x232b});function request(_0xb23105,_0x470e08){return new BPromise(function(_0x16934a,_0x15bc1b){return client[_0x4570('0x3')](_0xb23105,_0x470e08)['then'](function(_0x5f3ea4){if(_0x5f3ea4[_0x4570('0x4')]){return _0x15bc1b(_0x5f3ea4[_0x4570('0x4')][_0x4570('0x5')]);}else{return _0x16934a(_0x5f3ea4[_0x4570('0x6')]);}})[_0x4570('0x7')](function(_0x464957){return _0x15bc1b(_0x464957);});});}exports[_0x4570('0x8')]=function(_0x2fe5f7,_0x2cab96){return request('SendMail',{'account':_0x2fe5f7,'message':_0x2cab96});}; \ No newline at end of file +var _0x15a2=['jayson/promise','client','http','request','then','error','catch','sendMailMessage','SendMail','bluebird'];(function(_0x3dd69a,_0x5d70df){var _0x23b4a7=function(_0x3518d8){while(--_0x3518d8){_0x3dd69a['push'](_0x3dd69a['shift']());}};_0x23b4a7(++_0x5d70df);}(_0x15a2,0x12b));var _0x215a=function(_0x41caac,_0x50c421){_0x41caac=_0x41caac-0x0;var _0x28d2ba=_0x15a2[_0x41caac];return _0x28d2ba;};'use strict';var BPromise=require(_0x215a('0x0'));var jayson=require(_0x215a('0x1'));var client=jayson[_0x215a('0x2')][_0x215a('0x3')]({'port':0x232b});function request(_0x5874e4,_0x2e5463){return new BPromise(function(_0x35c486,_0x28895a){return client[_0x215a('0x4')](_0x5874e4,_0x2e5463)[_0x215a('0x5')](function(_0x243a00){if(_0x243a00[_0x215a('0x6')]){return _0x28895a(_0x243a00[_0x215a('0x6')]['message']);}else{return _0x35c486(_0x243a00['result']);}})[_0x215a('0x7')](function(_0x18e93f){return _0x28895a(_0x18e93f);});});}exports[_0x215a('0x8')]=function(_0x41c2bf,_0x1fc103){return request(_0x215a('0x9'),{'account':_0x41c2bf,'message':_0x1fc103});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 993bd10..64c159e 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 _0xdea8=['faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','idle','chat','fax','getChannelStatus','Status','StatusTime','toNumber','mailWaitingInteractions','whatsappWaitingInteractions','emit','user:save','moment','md5','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause'];(function(_0x3552ce,_0x471447){var _0x136334=function(_0x36232e){while(--_0x36232e){_0x3552ce['push'](_0x3552ce['shift']());}};_0x136334(++_0x471447);}(_0xdea8,0xe5));var _0x8dea=function(_0x2f70fb,_0x54fc6b){_0x2f70fb=_0x2f70fb-0x0;var _0x273d29=_0xdea8[_0x2f70fb];return _0x273d29;};'use strict';var _=require('lodash');var moment=require(_0x8dea('0x0'));var md5=require(_0x8dea('0x1'));var Redis=require(_0x8dea('0x2'));var config=require('../../../config/environment');config[_0x8dea('0x3')]=_[_0x8dea('0x4')](config[_0x8dea('0x3')],{'host':_0x8dea('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8dea('0x3')]));function Agent(_0x1291c3){this['id']=_0x1291c3['id']||0x0;this[_0x8dea('0x6')]=_0x1291c3[_0x8dea('0x6')]||'';this[_0x8dea('0x7')]=_0x1291c3[_0x8dea('0x7')]||!![];this[_0x8dea('0x8')]=_0x1291c3['voicePause']||![];this[_0x8dea('0x9')]=_0x1291c3[_0x8dea('0x9')]||![];this[_0x8dea('0xa')]=_0x1291c3[_0x8dea('0xa')]||![];this['faxPause']=_0x1291c3[_0x8dea('0xb')]||![];this['smsPause']=_0x1291c3[_0x8dea('0xc')]||![];this[_0x8dea('0xd')]=_0x1291c3['openchannelPause']||![];this[_0x8dea('0xe')]=_0x8dea('0xf');this[_0x8dea('0x10')]=0x0;this[_0x8dea('0x11')]=_0x1291c3[_0x8dea('0x11')]||0x0;this[_0x8dea('0x12')]=0x0;this[_0x8dea('0x13')]=_0x8dea('0xf');this[_0x8dea('0x14')]=0x0;this[_0x8dea('0x15')]=_0x1291c3['mailCapacity']||0x0;this[_0x8dea('0x16')]=0x0;this[_0x8dea('0x17')]=_0x8dea('0xf');this[_0x8dea('0x18')]=0x0;this['faxCapacity']=_0x1291c3[_0x8dea('0x19')]||0x0;this[_0x8dea('0x1a')]=0x0;this[_0x8dea('0x1b')]=_0x8dea('0xf');this[_0x8dea('0x1c')]=0x0;this[_0x8dea('0x1d')]=_0x1291c3['smsCapacity']||0x0;this[_0x8dea('0x1e')]=0x0;this[_0x8dea('0x1f')]=_0x8dea('0xf');this[_0x8dea('0x20')]=0x0;this[_0x8dea('0x21')]=_0x1291c3[_0x8dea('0x21')]||0x0;this[_0x8dea('0x22')]=0x0;this[_0x8dea('0x23')]=_0x8dea('0xf');this[_0x8dea('0x24')]=0x0;this[_0x8dea('0x25')]=_0x1291c3[_0x8dea('0x25')]||0x0;this[_0x8dea('0x26')]=0x0;this[_0x8dea('0x27')]=![];this[_0x8dea('0x28')]=undefined;this[_0x8dea('0x1')]='';this[_0x8dea('0x29')]={};this[_0x8dea('0x2a')]={};this['mailWaitingInteractions']={};this[_0x8dea('0x2b')]={};this[_0x8dea('0x2c')]={};this['whatsappWaitingInteractions']={};this[_0x8dea('0x2d')]();}Agent[_0x8dea('0x2e')]['getChannelStatus']=function(_0x1a57ea){if(this[_0x1a57ea+_0x8dea('0x2f')]>0x0){if(this[_0x1a57ea+_0x8dea('0x30')]>0x0&&this[_0x1a57ea+_0x8dea('0x2f')]>=this[_0x1a57ea+_0x8dea('0x30')]){return'maxcapacity';}else{return'working';}}else{return _0x8dea('0x31');}};Agent['prototype']['updateRealtime']=function(){var _0x25e2be=['mail',_0x8dea('0x32'),'openchannel',_0x8dea('0x33'),'sms','whatsapp'];for(var _0x5e6521=0x0;_0x5e6521<_0x25e2be['length'];_0x5e6521+=0x1){var _0x2283c0=this[_0x8dea('0x34')](_0x25e2be[_0x5e6521]);if(this[_0x25e2be[_0x5e6521]+_0x8dea('0x35')]!==_0x2283c0){this[_0x25e2be[_0x5e6521]+_0x8dea('0x36')]=_[_0x8dea('0x37')](moment()['format']('x'));}this[_0x25e2be[_0x5e6521]+_0x8dea('0x35')]=_0x2283c0;}var _0x1793fb={'id':this['id'],'name':this['name'],'online':this[_0x8dea('0x7')],'voicePause':this[_0x8dea('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x8dea('0xa')],'smsPause':this[_0x8dea('0xc')],'faxPause':this[_0x8dea('0xb')],'openchannelPause':this[_0x8dea('0xd')],'chatStatus':this[_0x8dea('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x8dea('0x11')],'chatCurrentCapacity':this[_0x8dea('0x12')],'mailStatus':this[_0x8dea('0x13')],'mailStatusTime':this[_0x8dea('0x14')],'mailCapacity':this[_0x8dea('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x8dea('0x17')],'faxStatusTime':this[_0x8dea('0x18')],'faxCapacity':this[_0x8dea('0x19')],'faxCurrentCapacity':this[_0x8dea('0x1a')],'smsStatus':this[_0x8dea('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x8dea('0x1d')],'smsCurrentCapacity':this[_0x8dea('0x1e')],'whatsappStatus':this[_0x8dea('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x8dea('0x21')],'whatsappCurrentCapacity':this[_0x8dea('0x22')],'openchannelStatus':this[_0x8dea('0x23')],'openchannelStatusTime':this[_0x8dea('0x24')],'openchannelCapacity':this[_0x8dea('0x25')],'openchannelCurrentCapacity':this[_0x8dea('0x26')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x8dea('0x29')],'faxWaitingInteractions':this[_0x8dea('0x2a')],'mailWaitingInteractions':this[_0x8dea('0x38')],'openchannelWaitingInteractions':this[_0x8dea('0x2b')],'smsWaitingInteractions':this[_0x8dea('0x2c')],'whatsappWaitingInteractions':this[_0x8dea('0x39')]};var _0x58264b=md5(JSON['stringify'](_0x1793fb));if(this[_0x8dea('0x1')]!==_0x58264b){this['md5']=_0x58264b;io[_0x8dea('0x3a')](_0x8dea('0x3b'),_0x1793fb);}};module['exports']=Agent; \ No newline at end of file +var _0xb5a1=['mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','unknown','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','busy','chatWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','whatsapp','length','StatusTime','toNumber','faxStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity'];(function(_0x148d48,_0x3de661){var _0x495688=function(_0xfae78e){while(--_0xfae78e){_0x148d48['push'](_0x148d48['shift']());}};_0x495688(++_0x3de661);}(_0xb5a1,0x1ba));var _0x1b5a=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0xb5a1[_0x2ad008];return _0x4538cf;};'use strict';var _=require(_0x1b5a('0x0'));var moment=require(_0x1b5a('0x1'));var md5=require(_0x1b5a('0x2'));var Redis=require(_0x1b5a('0x3'));var config=require('../../../config/environment');config[_0x1b5a('0x4')]=_[_0x1b5a('0x5')](config[_0x1b5a('0x4')],{'host':_0x1b5a('0x6'),'port':0x18eb});var io=require(_0x1b5a('0x7'))(new Redis(config[_0x1b5a('0x4')]));function Agent(_0x4d0819){this['id']=_0x4d0819['id']||0x0;this[_0x1b5a('0x8')]=_0x4d0819['name']||'';this['online']=_0x4d0819[_0x1b5a('0x9')]||!![];this['voicePause']=_0x4d0819[_0x1b5a('0xa')]||![];this['chatPause']=_0x4d0819[_0x1b5a('0xb')]||![];this[_0x1b5a('0xc')]=_0x4d0819['mailPause']||![];this[_0x1b5a('0xd')]=_0x4d0819[_0x1b5a('0xd')]||![];this[_0x1b5a('0xe')]=_0x4d0819[_0x1b5a('0xe')]||![];this[_0x1b5a('0xf')]=_0x4d0819[_0x1b5a('0xf')]||![];this[_0x1b5a('0x10')]='unknown';this[_0x1b5a('0x11')]=0x0;this[_0x1b5a('0x12')]=_0x4d0819[_0x1b5a('0x12')]||0x0;this[_0x1b5a('0x13')]=0x0;this[_0x1b5a('0x14')]='unknown';this[_0x1b5a('0x15')]=0x0;this['mailCapacity']=_0x4d0819[_0x1b5a('0x16')]||0x0;this[_0x1b5a('0x17')]=0x0;this['faxStatus']=_0x1b5a('0x18');this[_0x1b5a('0x19')]=0x0;this[_0x1b5a('0x1a')]=_0x4d0819[_0x1b5a('0x1a')]||0x0;this[_0x1b5a('0x1b')]=0x0;this[_0x1b5a('0x1c')]=_0x1b5a('0x18');this[_0x1b5a('0x1d')]=0x0;this[_0x1b5a('0x1e')]=_0x4d0819[_0x1b5a('0x1e')]||0x0;this[_0x1b5a('0x1f')]=0x0;this[_0x1b5a('0x20')]=_0x1b5a('0x18');this[_0x1b5a('0x21')]=0x0;this[_0x1b5a('0x22')]=_0x4d0819[_0x1b5a('0x22')]||0x0;this[_0x1b5a('0x23')]=0x0;this[_0x1b5a('0x24')]='unknown';this[_0x1b5a('0x25')]=0x0;this['openchannelCapacity']=_0x4d0819['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x1b5a('0x26')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x1b5a('0x27')]={};this['faxWaitingInteractions']={};this['mailWaitingInteractions']={};this[_0x1b5a('0x28')]={};this[_0x1b5a('0x29')]={};this['whatsappWaitingInteractions']={};this['updateRealtime']();}Agent[_0x1b5a('0x2a')][_0x1b5a('0x2b')]=function(_0x219635){if(this[_0x219635+'CurrentCapacity']>0x0){if(this[_0x219635+_0x1b5a('0x2c')]>0x0&&this[_0x219635+_0x1b5a('0x2d')]>=this[_0x219635+_0x1b5a('0x2c')]){return _0x1b5a('0x2e');}else{return _0x1b5a('0x2f');}}else{return _0x1b5a('0x30');}};Agent[_0x1b5a('0x2a')][_0x1b5a('0x31')]=function(){var _0x550524=['mail',_0x1b5a('0x32'),_0x1b5a('0x33'),'fax','sms',_0x1b5a('0x34')];for(var _0x3adda7=0x0;_0x3adda7<_0x550524[_0x1b5a('0x35')];_0x3adda7+=0x1){var _0x471c9e=this[_0x1b5a('0x2b')](_0x550524[_0x3adda7]);if(this[_0x550524[_0x3adda7]+'Status']!==_0x471c9e){this[_0x550524[_0x3adda7]+_0x1b5a('0x36')]=_[_0x1b5a('0x37')](moment()['format']('x'));}this[_0x550524[_0x3adda7]+'Status']=_0x471c9e;}var _0x3d4590={'id':this['id'],'name':this[_0x1b5a('0x8')],'online':this['online'],'voicePause':this[_0x1b5a('0xa')],'chatPause':this[_0x1b5a('0xb')],'mailPause':this[_0x1b5a('0xc')],'smsPause':this[_0x1b5a('0xe')],'faxPause':this[_0x1b5a('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x1b5a('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x1b5a('0x12')],'chatCurrentCapacity':this[_0x1b5a('0x13')],'mailStatus':this[_0x1b5a('0x14')],'mailStatusTime':this[_0x1b5a('0x15')],'mailCapacity':this[_0x1b5a('0x16')],'mailCurrentCapacity':this[_0x1b5a('0x17')],'faxStatus':this[_0x1b5a('0x38')],'faxStatusTime':this[_0x1b5a('0x19')],'faxCapacity':this[_0x1b5a('0x1a')],'faxCurrentCapacity':this[_0x1b5a('0x1b')],'smsStatus':this[_0x1b5a('0x1c')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x1b5a('0x1e')],'smsCurrentCapacity':this[_0x1b5a('0x1f')],'whatsappStatus':this[_0x1b5a('0x20')],'whatsappStatusTime':this[_0x1b5a('0x21')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x1b5a('0x23')],'openchannelStatus':this[_0x1b5a('0x24')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x1b5a('0x39')],'openchannelCurrentCapacity':this[_0x1b5a('0x3a')],'busy':this['busy'],'busyQueue':this[_0x1b5a('0x3b')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x1b5a('0x3c')],'mailWaitingInteractions':this[_0x1b5a('0x3d')],'openchannelWaitingInteractions':this[_0x1b5a('0x28')],'smsWaitingInteractions':this[_0x1b5a('0x29')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x583f46=md5(JSON[_0x1b5a('0x3e')](_0x3d4590));if(this[_0x1b5a('0x2')]!==_0x583f46){this[_0x1b5a('0x2')]=_0x583f46;io[_0x1b5a('0x3f')](_0x1b5a('0x40'),_0x3d4590);}};module[_0x1b5a('0x41')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 36fda93..d6a6da5 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 _0x3a46=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','chatPause','available','chat:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis'];(function(_0x49684e,_0x9a24fb){var _0x54062f=function(_0x4e410a){while(--_0x4e410a){_0x49684e['push'](_0x49684e['shift']());}};_0x54062f(++_0x9a24fb);}(_0x3a46,0xc6));var _0x63a4=function(_0x3f50fb,_0x178a66){_0x3f50fb=_0x3f50fb-0x0;var _0xfb3678=_0x3a46[_0x3f50fb];return _0xfb3678;};'use strict';var _=require(_0x63a4('0x0'));var md5=require('md5');var util=require(_0x63a4('0x1'));var Redis=require(_0x63a4('0x2'));var config=require(_0x63a4('0x3'));config[_0x63a4('0x4')]=_[_0x63a4('0x5')](config['redis'],{'host':_0x63a4('0x6'),'port':0x18eb});var io=require(_0x63a4('0x7'))(new Redis(config[_0x63a4('0x4')]));function ChatQueue(_0xb68d79){this['id']=_0xb68d79['id']||0x0;this[_0x63a4('0x8')]=_0xb68d79[_0x63a4('0x8')]||'';this[_0x63a4('0x9')]=_0xb68d79[_0x63a4('0x9')]||0xa;this[_0x63a4('0xa')]=_0xb68d79[_0x63a4('0xa')]||_0x63a4('0xb');this[_0x63a4('0xc')]=_0xb68d79['Agents'];this[_0x63a4('0xd')]={};this[_0x63a4('0xe')]=0x0;this[_0x63a4('0xf')]='';this[_0x63a4('0x10')]();this[_0x63a4('0x11')]();}ChatQueue[_0x63a4('0x12')][_0x63a4('0x10')]=function(){var _0x199f33=this[_0x63a4('0xd')][_0x63a4('0x13')];this[_0x63a4('0xd')]=_[_0x63a4('0x14')](this[_0x63a4('0xc')],'id');this[_0x63a4('0xd')][_0x63a4('0x13')]=_0x199f33;};ChatQueue[_0x63a4('0x12')][_0x63a4('0x11')]=function(){this[_0x63a4('0x15')]=0x0;this[_0x63a4('0x16')]=0x0;for(var _0x3ee769=0x0;_0x3ee769=0x0?this['available']:0x0;var _0x4dbab0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x63a4('0x15')],'name':this[_0x63a4('0x8')],'paused':this[_0x63a4('0x16')],'waiting':this[_0x63a4('0xe')]};var _0x5d186d=md5(JSON['stringify'](_0x4dbab0));if(this[_0x63a4('0xf')]!==_0x5d186d){this['md5']=_0x5d186d;io['to'](util['format'](_0x63a4('0x1a'),_0x4dbab0['name']))[_0x63a4('0x1b')]('chat_queue:save',_0x4dbab0);}};module[_0x63a4('0x1c')]=ChatQueue; \ No newline at end of file +var _0xac30=['lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','available','stringify','md5','format','chat:queue:%s','emit'];(function(_0x8036e9,_0xb2a199){var _0x34a8eb=function(_0xa35740){while(--_0xa35740){_0x8036e9['push'](_0x8036e9['shift']());}};_0x34a8eb(++_0xb2a199);}(_0xac30,0x91));var _0x0ac3=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0xac30[_0x462999];return _0x4b1366;};'use strict';var _=require(_0x0ac3('0x0'));var md5=require('md5');var util=require(_0x0ac3('0x1'));var Redis=require(_0x0ac3('0x2'));var config=require(_0x0ac3('0x3'));config[_0x0ac3('0x4')]=_[_0x0ac3('0x5')](config[_0x0ac3('0x4')],{'host':_0x0ac3('0x6'),'port':0x18eb});var io=require(_0x0ac3('0x7'))(new Redis(config['redis']));function ChatQueue(_0x1c723c){this['id']=_0x1c723c['id']||0x0;this[_0x0ac3('0x8')]=_0x1c723c[_0x0ac3('0x8')]||'';this[_0x0ac3('0x9')]=_0x1c723c[_0x0ac3('0x9')]||0xa;this[_0x0ac3('0xa')]=_0x1c723c['strategy']||_0x0ac3('0xb');this['Agents']=_0x1c723c[_0x0ac3('0xc')];this[_0x0ac3('0xd')]={};this[_0x0ac3('0xe')]=0x0;this['md5']='';this[_0x0ac3('0xf')]();this[_0x0ac3('0x10')]();}ChatQueue[_0x0ac3('0x11')][_0x0ac3('0xf')]=function(){var _0x4df177=this['mapAgentsId'][_0x0ac3('0x12')];this[_0x0ac3('0xd')]=_[_0x0ac3('0x13')](this['Agents'],'id');this[_0x0ac3('0xd')]['_rr']=_0x4df177;};ChatQueue['prototype'][_0x0ac3('0x10')]=function(){this[_0x0ac3('0x14')]=0x0;this[_0x0ac3('0x15')]=0x0;for(var _0x69a7c1=0x0;_0x69a7c1=0x0?this[_0x0ac3('0x17')]:0x0;var _0x1637c2={'id':this['id'],'available':this[_0x0ac3('0x17')],'loggedIn':this[_0x0ac3('0x14')],'name':this[_0x0ac3('0x8')],'paused':this[_0x0ac3('0x15')],'waiting':this[_0x0ac3('0xe')]};var _0x17d485=md5(JSON[_0x0ac3('0x18')](_0x1637c2));if(this[_0x0ac3('0x19')]!==_0x17d485){this[_0x0ac3('0x19')]=_0x17d485;io['to'](util[_0x0ac3('0x1a')](_0x0ac3('0x1b'),_0x1637c2[_0x0ac3('0x8')]))[_0x0ac3('0x1c')]('chat_queue:save',_0x1637c2);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1664f0c..3446cb8 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 _0x1863=['exports','lodash','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','md5','updateRouting','updateRealtime','_rr','mapAgentsId','prototype','loggedIn','paused','length','faxPause','available','waiting','stringify','format','emit','fax_queue:save'];(function(_0x549966,_0x1bb990){var _0x4e1609=function(_0x2fd25c){while(--_0x2fd25c){_0x549966['push'](_0x549966['shift']());}};_0x4e1609(++_0x1bb990);}(_0x1863,0x71));var _0x3186=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x1863[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x3186('0x0'));var md5=require('md5');var util=require(_0x3186('0x1'));var Redis=require(_0x3186('0x2'));var config=require('../../../config/environment');config[_0x3186('0x3')]=_[_0x3186('0x4')](config[_0x3186('0x3')],{'host':_0x3186('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3186('0x3')]));function FaxQueue(_0x256ea7){this['id']=_0x256ea7['id']||0x0;this['name']=_0x256ea7[_0x3186('0x6')]||'';this[_0x3186('0x7')]=_0x256ea7[_0x3186('0x7')]||0xa;this[_0x3186('0x8')]=_0x256ea7['strategy']||_0x3186('0x9');this['Agents']=_0x256ea7[_0x3186('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x3186('0xb')]='';this[_0x3186('0xc')]();this[_0x3186('0xd')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x566050=this['mapAgentsId'][_0x3186('0xe')];this[_0x3186('0xf')]=_['map'](this[_0x3186('0xa')],'id');this[_0x3186('0xf')][_0x3186('0xe')]=_0x566050;};FaxQueue[_0x3186('0x10')]['updateRealtime']=function(){this[_0x3186('0x11')]=0x0;this[_0x3186('0x12')]=0x0;for(var _0x4d3614=0x0;_0x4d3614=0x0?this['available']:0x0;var _0x12eb74={'id':this['id'],'available':this[_0x3186('0x15')],'loggedIn':this[_0x3186('0x11')],'name':this[_0x3186('0x6')],'paused':this[_0x3186('0x12')],'waiting':this[_0x3186('0x16')]};var _0xc171fc=md5(JSON[_0x3186('0x17')](_0x12eb74));if(this[_0x3186('0xb')]!==_0xc171fc){this[_0x3186('0xb')]=_0xc171fc;io['to'](util[_0x3186('0x18')]('fax:queue:%s',_0x12eb74[_0x3186('0x6')]))[_0x3186('0x19')](_0x3186('0x1a'),_0x12eb74);}};module[_0x3186('0x1b')]=FaxQueue; \ No newline at end of file +var _0xed3c=['strategy','beepall','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x362519,_0x5d067b){var _0x134ba4=function(_0xc12a5e){while(--_0xc12a5e){_0x362519['push'](_0x362519['shift']());}};_0x134ba4(++_0x5d067b);}(_0xed3c,0x18d));var _0xced3=function(_0x3f5dd3,_0x171037){_0x3f5dd3=_0x3f5dd3-0x0;var _0x3cb003=_0xed3c[_0x3f5dd3];return _0x3cb003;};'use strict';var _=require(_0xced3('0x0'));var md5=require(_0xced3('0x1'));var util=require(_0xced3('0x2'));var Redis=require('ioredis');var config=require(_0xced3('0x3'));config[_0xced3('0x4')]=_[_0xced3('0x5')](config['redis'],{'host':_0xced3('0x6'),'port':0x18eb});var io=require(_0xced3('0x7'))(new Redis(config[_0xced3('0x4')]));function FaxQueue(_0x2ba2fd){this['id']=_0x2ba2fd['id']||0x0;this[_0xced3('0x8')]=_0x2ba2fd[_0xced3('0x8')]||'';this['timeout']=_0x2ba2fd['timeout']||0xa;this[_0xced3('0x9')]=_0x2ba2fd[_0xced3('0x9')]||_0xced3('0xa');this[_0xced3('0xb')]=_0x2ba2fd['Agents'];this['mapAgentsId']={};this[_0xced3('0xc')]=0x0;this[_0xced3('0x1')]='';this['updateRouting']();this[_0xced3('0xd')]();}FaxQueue['prototype'][_0xced3('0xe')]=function(){var _0x324388=this[_0xced3('0xf')][_0xced3('0x10')];this[_0xced3('0xf')]=_[_0xced3('0x11')](this['Agents'],'id');this[_0xced3('0xf')][_0xced3('0x10')]=_0x324388;};FaxQueue[_0xced3('0x12')][_0xced3('0xd')]=function(){this[_0xced3('0x13')]=0x0;this[_0xced3('0x14')]=0x0;for(var _0x197eaa=0x0;_0x197eaa=0x0?this[_0xced3('0x17')]:0x0;var _0x183c65={'id':this['id'],'available':this[_0xced3('0x17')],'loggedIn':this[_0xced3('0x13')],'name':this[_0xced3('0x8')],'paused':this[_0xced3('0x14')],'waiting':this[_0xced3('0xc')]};var _0x18be75=md5(JSON['stringify'](_0x183c65));if(this[_0xced3('0x1')]!==_0x18be75){this['md5']=_0x18be75;io['to'](util[_0xced3('0x18')](_0xced3('0x19'),_0x183c65['name']))[_0xced3('0x1a')](_0xced3('0x1b'),_0x183c65);}};module[_0xced3('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index bbd1bb5..da82023 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 _0xc66c=['name','Intervals'];(function(_0x5f12c1,_0x17c8ae){var _0x424644=function(_0x5cbc96){while(--_0x5cbc96){_0x5f12c1['push'](_0x5f12c1['shift']());}};_0x424644(++_0x17c8ae);}(_0xc66c,0x6e));var _0xcc66=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc66c[_0x4cf98e];return _0x1623ac;};'use strict';function Interval(_0x28652b){this['id']=_0x28652b['id']||0x0;this[_0xcc66('0x0')]=_0x28652b[_0xcc66('0x0')]||'';this['Intervals']=_0x28652b[_0xcc66('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x4527=['Intervals','exports','name'];(function(_0xa66d8c,_0xe5aade){var _0x4caf28=function(_0x466662){while(--_0x466662){_0xa66d8c['push'](_0xa66d8c['shift']());}};_0x4caf28(++_0xe5aade);}(_0x4527,0x1eb));var _0x7452=function(_0x444d84,_0x5d5b48){_0x444d84=_0x444d84-0x0;var _0x501494=_0x4527[_0x444d84];return _0x501494;};'use strict';function Interval(_0x1aa7dc){this['id']=_0x1aa7dc['id']||0x0;this['name']=_0x1aa7dc[_0x7452('0x0')]||'';this[_0x7452('0x1')]=_0x1aa7dc['Intervals']||{};}module[_0x7452('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 f19c631..0baaaa4 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 _0xe12a=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','paused','length','loggedIn','available','stringify','format','mail:queue:%s','exports','md5','util','../../../config/environment','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe12a,0x97));var _0xae12=function(_0x1c3b79,_0x3cbf32){_0x1c3b79=_0x1c3b79-0x0;var _0xb8bff0=_0xe12a[_0x1c3b79];return _0xb8bff0;};'use strict';var _=require('lodash');var md5=require(_0xae12('0x0'));var util=require(_0xae12('0x1'));var Redis=require('ioredis');var config=require(_0xae12('0x2'));config[_0xae12('0x3')]=_[_0xae12('0x4')](config['redis'],{'host':_0xae12('0x5'),'port':0x18eb});var io=require(_0xae12('0x6'))(new Redis(config[_0xae12('0x3')]));function MailQueue(_0xb651c4){this['id']=_0xb651c4['id']||0x0;this['name']=_0xb651c4[_0xae12('0x7')]||'';this[_0xae12('0x8')]=_0xb651c4['timeout']||0xa;this[_0xae12('0x9')]=_0xb651c4[_0xae12('0x9')]||_0xae12('0xa');this['Agents']=_0xb651c4[_0xae12('0xb')];this[_0xae12('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xae12('0xd')]();this[_0xae12('0xe')]();}MailQueue[_0xae12('0xf')][_0xae12('0xd')]=function(){var _0x2c2278=this[_0xae12('0xc')]['_rr'];this[_0xae12('0xc')]=_[_0xae12('0x10')](this[_0xae12('0xb')],'id');this[_0xae12('0xc')][_0xae12('0x11')]=_0x2c2278;};MailQueue[_0xae12('0xf')][_0xae12('0xe')]=function(){this['loggedIn']=0x0;this[_0xae12('0x12')]=0x0;for(var _0xac01a7=0x0;_0xac01a7=0x0?this[_0xae12('0x15')]:0x0;var _0x274222={'id':this['id'],'available':this['available'],'loggedIn':this[_0xae12('0x14')],'name':this['name'],'paused':this[_0xae12('0x12')],'waiting':this['waiting']};var _0x504301=md5(JSON[_0xae12('0x16')](_0x274222));if(this[_0xae12('0x0')]!==_0x504301){this[_0xae12('0x0')]=_0x504301;io['to'](util[_0xae12('0x17')](_0xae12('0x18'),_0x274222[_0xae12('0x7')]))['emit']('mail_queue:save',_0x274222);}};module[_0xae12('0x19')]=MailQueue; \ No newline at end of file +var _0xaa2b=['mailPause','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','md5','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online'];(function(_0x3b9ee4,_0x49de9b){var _0x2a2001=function(_0x55748e){while(--_0x55748e){_0x3b9ee4['push'](_0x3b9ee4['shift']());}};_0x2a2001(++_0x49de9b);}(_0xaa2b,0x1b8));var _0xbaa2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaa2b[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var md5=require(_0xbaa2('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xbaa2('0x1'));config['redis']=_[_0xbaa2('0x2')](config[_0xbaa2('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xbaa2('0x4'))(new Redis(config[_0xbaa2('0x3')]));function MailQueue(_0x1c52ca){this['id']=_0x1c52ca['id']||0x0;this['name']=_0x1c52ca[_0xbaa2('0x5')]||'';this[_0xbaa2('0x6')]=_0x1c52ca[_0xbaa2('0x6')]||0xa;this[_0xbaa2('0x7')]=_0x1c52ca['strategy']||_0xbaa2('0x8');this[_0xbaa2('0x9')]=_0x1c52ca[_0xbaa2('0x9')];this[_0xbaa2('0xa')]={};this[_0xbaa2('0xb')]=0x0;this[_0xbaa2('0x0')]='';this[_0xbaa2('0xc')]();this[_0xbaa2('0xd')]();}MailQueue[_0xbaa2('0xe')]['updateRouting']=function(){var _0x33c8c8=this[_0xbaa2('0xa')][_0xbaa2('0xf')];this[_0xbaa2('0xa')]=_[_0xbaa2('0x10')](this[_0xbaa2('0x9')],'id');this[_0xbaa2('0xa')][_0xbaa2('0xf')]=_0x33c8c8;};MailQueue[_0xbaa2('0xe')][_0xbaa2('0xd')]=function(){this[_0xbaa2('0x11')]=0x0;this['paused']=0x0;for(var _0x5753a4=0x0;_0x5753a4=0x0?this[_0xbaa2('0x15')]:0x0;var _0x472f61={'id':this['id'],'available':this[_0xbaa2('0x15')],'loggedIn':this[_0xbaa2('0x11')],'name':this['name'],'paused':this[_0xbaa2('0x14')],'waiting':this[_0xbaa2('0xb')]};var _0x44ffce=md5(JSON['stringify'](_0x472f61));if(this[_0xbaa2('0x0')]!==_0x44ffce){this[_0xbaa2('0x0')]=_0x44ffce;io['to'](util[_0xbaa2('0x16')](_0xbaa2('0x17'),_0x472f61[_0xbaa2('0x5')]))[_0xbaa2('0x18')](_0xbaa2('0x19'),_0x472f61);}};module[_0xbaa2('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 9056411..2707458 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xc88e0e,_0x130618){var _0xd89aa8=function(_0x2b6948){while(--_0x2b6948){_0xc88e0e['push'](_0xc88e0e['shift']());}};_0xd89aa8(++_0x130618);}(_0x5fc3,0xa8));var _0x35fc=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x5fc3[_0x51beba];return _0x167ee0;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x29174f,_0x2e4f59){var _0x11cc15=function(_0x5b75cc){while(--_0x5b75cc){_0x29174f['push'](_0x29174f['shift']());}};_0x11cc15(++_0x2e4f59);}(_0x814b,0x1a2));var _0xb814=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x814b[_0x282f9a];return _0x52528c;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c9b8807..ab09831 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 _0xf257=['Agents','waiting','md5','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','smsPause','available','loggedIn','format','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3e1b11,_0x2882ad){var _0x1c9623=function(_0x42626e){while(--_0x42626e){_0x3e1b11['push'](_0x3e1b11['shift']());}};_0x1c9623(++_0x2882ad);}(_0xf257,0x82));var _0x7f25=function(_0x3a6930,_0x1d329e){_0x3a6930=_0x3a6930-0x0;var _0x9ebbe8=_0xf257[_0x3a6930];return _0x9ebbe8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7f25('0x0'));var Redis=require(_0x7f25('0x1'));var config=require(_0x7f25('0x2'));config[_0x7f25('0x3')]=_['defaults'](config[_0x7f25('0x3')],{'host':_0x7f25('0x4'),'port':0x18eb});var io=require(_0x7f25('0x5'))(new Redis(config[_0x7f25('0x3')]));function SmsQueue(_0x2829d7){this['id']=_0x2829d7['id']||0x0;this[_0x7f25('0x6')]=_0x2829d7[_0x7f25('0x6')]||'';this[_0x7f25('0x7')]=_0x2829d7[_0x7f25('0x7')]||0xa;this[_0x7f25('0x8')]=_0x2829d7[_0x7f25('0x8')]||_0x7f25('0x9');this[_0x7f25('0xa')]=_0x2829d7[_0x7f25('0xa')];this['mapAgentsId']={};this[_0x7f25('0xb')]=0x0;this[_0x7f25('0xc')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x7f25('0xd')]['updateRouting']=function(){var _0x1d9f33=this[_0x7f25('0xe')][_0x7f25('0xf')];this[_0x7f25('0xe')]=_[_0x7f25('0x10')](this[_0x7f25('0xa')],'id');this[_0x7f25('0xe')]['_rr']=_0x1d9f33;};SmsQueue['prototype'][_0x7f25('0x11')]=function(){this['loggedIn']=0x0;this[_0x7f25('0x12')]=0x0;for(var _0x19b76b=0x0;_0x19b76b=0x0?this[_0x7f25('0x15')]:0x0;var _0x5e0067={'id':this['id'],'available':this[_0x7f25('0x15')],'loggedIn':this[_0x7f25('0x16')],'name':this[_0x7f25('0x6')],'paused':this[_0x7f25('0x12')],'waiting':this[_0x7f25('0xb')]};var _0x16f9e3=md5(JSON['stringify'](_0x5e0067));if(this['md5']!==_0x16f9e3){this[_0x7f25('0xc')]=_0x16f9e3;io['to'](util[_0x7f25('0x17')](_0x7f25('0x18'),_0x5e0067[_0x7f25('0x6')]))[_0x7f25('0x19')](_0x7f25('0x1a'),_0x5e0067);}};module[_0x7f25('0x1b')]=SmsQueue; \ No newline at end of file +var _0x2fed=['_rr','map','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x2fed,0x7c));var _0xd2fe=function(_0x384839,_0x51fcab){_0x384839=_0x384839-0x0;var _0xee37fc=_0x2fed[_0x384839];return _0xee37fc;};'use strict';var _=require(_0xd2fe('0x0'));var md5=require(_0xd2fe('0x1'));var util=require(_0xd2fe('0x2'));var Redis=require(_0xd2fe('0x3'));var config=require(_0xd2fe('0x4'));config['redis']=_[_0xd2fe('0x5')](config[_0xd2fe('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd2fe('0x6')]));function SmsQueue(_0x24ba90){this['id']=_0x24ba90['id']||0x0;this[_0xd2fe('0x7')]=_0x24ba90['name']||'';this[_0xd2fe('0x8')]=_0x24ba90[_0xd2fe('0x8')]||0xa;this[_0xd2fe('0x9')]=_0x24ba90[_0xd2fe('0x9')]||'beepall';this[_0xd2fe('0xa')]=_0x24ba90[_0xd2fe('0xa')];this[_0xd2fe('0xb')]={};this[_0xd2fe('0xc')]=0x0;this[_0xd2fe('0x1')]='';this[_0xd2fe('0xd')]();this[_0xd2fe('0xe')]();}SmsQueue[_0xd2fe('0xf')][_0xd2fe('0xd')]=function(){var _0x13c68f=this[_0xd2fe('0xb')][_0xd2fe('0x10')];this[_0xd2fe('0xb')]=_[_0xd2fe('0x11')](this[_0xd2fe('0xa')],'id');this[_0xd2fe('0xb')][_0xd2fe('0x10')]=_0x13c68f;};SmsQueue[_0xd2fe('0xf')]['updateRealtime']=function(){this[_0xd2fe('0x12')]=0x0;this[_0xd2fe('0x13')]=0x0;for(var _0x2a9355=0x0;_0x2a9355=0x0?this[_0xd2fe('0x16')]:0x0;var _0x40162f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd2fe('0x12')],'name':this[_0xd2fe('0x7')],'paused':this[_0xd2fe('0x13')],'waiting':this[_0xd2fe('0xc')]};var _0x34c324=md5(JSON[_0xd2fe('0x17')](_0x40162f));if(this[_0xd2fe('0x1')]!==_0x34c324){this[_0xd2fe('0x1')]=_0x34c324;io['to'](util[_0xd2fe('0x18')](_0xd2fe('0x19'),_0x40162f['name']))[_0xd2fe('0x1a')]('sms_queue:save',_0x40162f);}};module[_0xd2fe('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 0c0c2c1..3b900ac 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 _0x22fd=['updateRouting','updateRealtime','prototype','_rr','paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x22fd,0x10b));var _0xd22f=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x22fd[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xd22f('0x0'));var md5=require(_0xd22f('0x1'));var util=require(_0xd22f('0x2'));var Redis=require(_0xd22f('0x3'));var config=require(_0xd22f('0x4'));config[_0xd22f('0x5')]=_['defaults'](config[_0xd22f('0x5')],{'host':_0xd22f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd22f('0x5')]));function WhatsappQueue(_0x3482ae){this['id']=_0x3482ae['id']||0x0;this[_0xd22f('0x7')]=_0x3482ae['name']||'';this['timeout']=_0x3482ae[_0xd22f('0x8')]||0xa;this['strategy']=_0x3482ae['strategy']||_0xd22f('0x9');this[_0xd22f('0xa')]=_0x3482ae['Agents'];this[_0xd22f('0xb')]={};this[_0xd22f('0xc')]=0x0;this[_0xd22f('0x1')]='';this[_0xd22f('0xd')]();this[_0xd22f('0xe')]();}WhatsappQueue[_0xd22f('0xf')][_0xd22f('0xd')]=function(){var _0x53b9c2=this[_0xd22f('0xb')][_0xd22f('0x10')];this[_0xd22f('0xb')]=_['map'](this[_0xd22f('0xa')],'id');this['mapAgentsId'][_0xd22f('0x10')]=_0x53b9c2;};WhatsappQueue[_0xd22f('0xf')][_0xd22f('0xe')]=function(){this['loggedIn']=0x0;this[_0xd22f('0x11')]=0x0;for(var _0x13e377=0x0;_0x13e377=0x0?this['available']:0x0;var _0x530ad9={'id':this['id'],'available':this[_0xd22f('0x15')],'loggedIn':this[_0xd22f('0x13')],'name':this['name'],'paused':this[_0xd22f('0x11')],'waiting':this[_0xd22f('0xc')]};var _0x1a5dd1=md5(JSON[_0xd22f('0x16')](_0x530ad9));if(this[_0xd22f('0x1')]!==_0x1a5dd1){this[_0xd22f('0x1')]=_0x1a5dd1;io['to'](util[_0xd22f('0x17')](_0xd22f('0x18'),_0x530ad9['name']))[_0xd22f('0x19')](_0xd22f('0x1a'),_0x530ad9);}};module[_0xd22f('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x53b0=['defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','paused','length','online','available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x53b0,0x6b));var _0x053b=function(_0x5520da,_0x38c8ba){_0x5520da=_0x5520da-0x0;var _0x138d1a=_0x53b0[_0x5520da];return _0x138d1a;};'use strict';var _=require(_0x053b('0x0'));var md5=require(_0x053b('0x1'));var util=require('util');var Redis=require(_0x053b('0x2'));var config=require(_0x053b('0x3'));config[_0x053b('0x4')]=_[_0x053b('0x5')](config[_0x053b('0x4')],{'host':_0x053b('0x6'),'port':0x18eb});var io=require(_0x053b('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x403215){this['id']=_0x403215['id']||0x0;this[_0x053b('0x8')]=_0x403215['name']||'';this[_0x053b('0x9')]=_0x403215[_0x053b('0x9')]||0xa;this[_0x053b('0xa')]=_0x403215[_0x053b('0xa')]||'beepall';this[_0x053b('0xb')]=_0x403215[_0x053b('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x053b('0x1')]='';this['updateRouting']();this[_0x053b('0xc')]();}WhatsappQueue[_0x053b('0xd')][_0x053b('0xe')]=function(){var _0x547f28=this[_0x053b('0xf')][_0x053b('0x10')];this['mapAgentsId']=_['map'](this[_0x053b('0xb')],'id');this[_0x053b('0xf')][_0x053b('0x10')]=_0x547f28;};WhatsappQueue['prototype'][_0x053b('0xc')]=function(){this[_0x053b('0x11')]=0x0;this[_0x053b('0x12')]=0x0;for(var _0x8ccf81=0x0;_0x8ccf81=0x0?this[_0x053b('0x15')]:0x0;var _0x17e210={'id':this['id'],'available':this[_0x053b('0x15')],'loggedIn':this[_0x053b('0x11')],'name':this[_0x053b('0x8')],'paused':this['paused'],'waiting':this[_0x053b('0x16')]};var _0x1223c4=md5(JSON[_0x053b('0x17')](_0x17e210));if(this[_0x053b('0x1')]!==_0x1223c4){this[_0x053b('0x1')]=_0x1223c4;io['to'](util['format'](_0x053b('0x18'),_0x17e210['name']))[_0x053b('0x19')](_0x053b('0x1a'),_0x17e210);}};module[_0x053b('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 3523a39..651f27a 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 _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(_0x51a9e8,_0x5a490d){var _0x50f18d=function(_0xc1acfd){while(--_0xc1acfd){_0x51a9e8['push'](_0x51a9e8['shift']());}};_0x50f18d(++_0x5a490d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb10b[_0x1df7b8];return _0x29d911;};'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 +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(_0x31c74a,_0x5bd1a9){var _0x1ba845=function(_0x3cf5c9){while(--_0x3cf5c9){_0x31c74a['push'](_0x31c74a['shift']());}};_0x1ba845(++_0x5bd1a9);}(_0xb10b,0x12a));var _0xbb10=function(_0x2532a6,_0x25e8e9){_0x2532a6=_0x2532a6-0x0;var _0x1d6b92=_0xb10b[_0x2532a6];return _0x1d6b92;};'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 79dd139..f206d3d 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 _0x3a9b=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a9b,0x1f3));var _0xb3a9=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3a9b[_0x36884e];return _0x1cc367;};'use strict';var client=require(_0xb3a9('0x0'));exports[_0xb3a9('0x1')]=function(_0x539634,_0x410660){return client[_0xb3a9('0x2')](_0xb3a9('0x3'),{'body':_0x410660,'options':{'where':{'id':_0x539634}},'log':_0xb3a9('0x4')});};exports['addTags']=function(_0x5a3799,_0x3c5dc4){return client[_0xb3a9('0x2')]('AddTagsToChatInteraction',{'body':_0x3c5dc4,'options':{'where':{'id':_0x5a3799}},'log':_0xb3a9('0x5')});}; \ No newline at end of file +var _0x0f22=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x662775,_0xf52a88){var _0x512980=function(_0x8837bf){while(--_0x8837bf){_0x662775['push'](_0x662775['shift']());}};_0x512980(++_0xf52a88);}(_0x0f22,0xf5));var _0x20f2=function(_0x269615,_0x37eae4){_0x269615=_0x269615-0x0;var _0x2dbb6e=_0x0f22[_0x269615];return _0x2dbb6e;};'use strict';var client=require(_0x20f2('0x0'));exports[_0x20f2('0x1')]=function(_0x521b54,_0x5e4cbc){return client[_0x20f2('0x2')](_0x20f2('0x3'),{'body':_0x5e4cbc,'options':{'where':{'id':_0x521b54}},'log':'updateChatInteraction'});};exports[_0x20f2('0x4')]=function(_0x9f6f25,_0x1892dc){return client[_0x20f2('0x2')](_0x20f2('0x5'),{'body':_0x1892dc,'options':{'where':{'id':_0x9f6f25}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 41e11e1..b71d884 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 _0x7aab=['Request'];(function(_0x507eea,_0x47f2de){var _0x4d6e1b=function(_0x30af34){while(--_0x30af34){_0x507eea['push'](_0x507eea['shift']());}};_0x4d6e1b(++_0x47f2de);}(_0x7aab,0x96));var _0xb7aa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7aab[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['create']=function(_0x5c1c69){return client[_0xb7aa('0x0')]('CreateChatMessage',{'body':_0x5c1c69,'log':'createChatMessage'});}; \ No newline at end of file +var _0xe2f9=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2f9,0x194));var _0x9e2f=function(_0x9a998b,_0x2fb091){_0x9a998b=_0x9a998b-0x0;var _0x35c369=_0xe2f9[_0x9a998b];return _0x35c369;};'use strict';var client=require(_0x9e2f('0x0'));exports[_0x9e2f('0x1')]=function(_0x56e00d){return client[_0x9e2f('0x2')](_0x9e2f('0x3'),{'body':_0x56e00d,'log':_0x9e2f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0968624..2bbf624 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 _0x7b83=['getChatQueues','Request','timeout','strategy','User','name','online','chatPause','../client'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x7b83,0xa1));var _0x37b8=function(_0x22e7ee,_0xd43e98){_0x22e7ee=_0x22e7ee-0x0;var _0xbf4677=_0x7b83[_0x22e7ee];return _0xbf4677;};'use strict';var client=require(_0x37b8('0x0'));exports[_0x37b8('0x1')]=function(){return function(){return client[_0x37b8('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x37b8('0x3'),_0x37b8('0x4')],'include':[{'model':_0x37b8('0x5'),'as':'Agents','attributes':['id',_0x37b8('0x6'),_0x37b8('0x7'),_0x37b8('0x8')]}]},'log':_0x37b8('0x1')});};}; \ No newline at end of file +var _0xac21=['Request','name','strategy','User','chatPause','getChatQueues'];(function(_0x16adf1,_0x1273a5){var _0xc13362=function(_0x35e767){while(--_0x35e767){_0x16adf1['push'](_0x16adf1['shift']());}};_0xc13362(++_0x1273a5);}(_0xac21,0x1af));var _0x1ac2=function(_0x4143cd,_0x3c4f54){_0x4143cd=_0x4143cd-0x0;var _0x5d4396=_0xac21[_0x4143cd];return _0x5d4396;};'use strict';var client=require('../client');exports[_0x1ac2('0x0')]=function(){return function(){return client[_0x1ac2('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x1ac2('0x2'),'timeout',_0x1ac2('0x3')],'include':[{'model':_0x1ac2('0x4'),'as':'Agents','attributes':['id',_0x1ac2('0x2'),'online',_0x1ac2('0x5')]}]},'log':_0x1ac2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index daca51b..6ed29bc 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 _0xb04a=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x4d7892,_0x4984ec){var _0x2616a9=function(_0x4983e7){while(--_0x4983e7){_0x4d7892['push'](_0x4d7892['shift']());}};_0x2616a9(++_0x4984ec);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xab04('0x0'));exports[_0xab04('0x1')]=function(_0x44557d){return client[_0xab04('0x2')]('CreateChatQueueReport',{'body':_0x44557d,'log':_0xab04('0x3')});};exports[_0xab04('0x4')]=function(_0x20639d,_0x4b8c0f){return client[_0xab04('0x2')](_0xab04('0x5'),{'body':_0x4b8c0f,'options':{'where':{'uniqueid':_0x20639d},'order':[['id',_0xab04('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xbc17=['CreateChatQueueReport','UpdateChatQueueReport','../client','create','Request'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x5651ef,_0x4fd99a){_0x5651ef=_0x5651ef-0x0;var _0x392fba=_0xbc17[_0x5651ef];return _0x392fba;};'use strict';var client=require(_0x7bc1('0x0'));exports[_0x7bc1('0x1')]=function(_0x5e8e5a){return client[_0x7bc1('0x2')](_0x7bc1('0x3'),{'body':_0x5e8e5a,'log':'CreateChatQueueReport'});};exports['update']=function(_0x3ff36d,_0x7aa41e){return client['Request'](_0x7bc1('0x4'),{'body':_0x7aa41e,'options':{'where':{'uniqueid':_0x3ff36d},'order':[['id','DESC']],'limit':0x1},'log':_0x7bc1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ccfc823..38ac07d 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(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x7a54,0x106));var _0x47a5=function(_0x2e4776,_0x598a93){_0x2e4776=_0x2e4776-0x0;var _0x17479c=_0x7a54[_0x2e4776];return _0x17479c;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7a54,0x106));var _0x47a5=function(_0x1bde38,_0x985653){_0x1bde38=_0x1bde38-0x0;var _0x9a624a=_0x7a54[_0x1bde38];return _0x9a624a;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 71ac698..6d4e66d 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 _0x0fb4=['Request','../client','create'];(function(_0x4a08bc,_0x107ef3){var _0x576c83=function(_0x243cc6){while(--_0x243cc6){_0x4a08bc['push'](_0x4a08bc['shift']());}};_0x576c83(++_0x107ef3);}(_0x0fb4,0x169));var _0x40fb=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x0fb4[_0x2675da];return _0x5e6153;};'use strict';var client=require(_0x40fb('0x0'));exports[_0x40fb('0x1')]=function(_0x297fb6){return client[_0x40fb('0x2')]('CreateFaxMessage',{'body':_0x297fb6,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x6885=['Request','CreateFaxMessage','../client','create'];(function(_0x1aa4f0,_0x5907b8){var _0x5aba37=function(_0x99c95c){while(--_0x99c95c){_0x1aa4f0['push'](_0x1aa4f0['shift']());}};_0x5aba37(++_0x5907b8);}(_0x6885,0x13a));var _0x5688=function(_0x145c4f,_0x4c2eb9){_0x145c4f=_0x145c4f-0x0;var _0x14c56d=_0x6885[_0x145c4f];return _0x14c56d;};'use strict';var client=require(_0x5688('0x0'));exports[_0x5688('0x1')]=function(_0x2ad839){return client[_0x5688('0x2')](_0x5688('0x3'),{'body':_0x2ad839,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index e1aad01..44882f2 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 _0x19bb=['Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x2e2051,_0x26b49e){var _0x199c53=function(_0xdd97cc){while(--_0xdd97cc){_0x2e2051['push'](_0x2e2051['shift']());}};_0x199c53(++_0x26b49e);}(_0x19bb,0xfe));var _0xb19b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x19bb[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xb19b('0x0'));exports[_0xb19b('0x1')]=function(){return function(){return client[_0xb19b('0x2')](_0xb19b('0x3'),{'options':{'raw':![],'attributes':['id',_0xb19b('0x4'),'timeout','strategy'],'include':[{'model':'User','as':_0xb19b('0x5'),'attributes':['id',_0xb19b('0x4'),_0xb19b('0x6'),'faxPause']}]},'log':_0xb19b('0x1')});};}; \ No newline at end of file +var _0xb4fa=['GetFaxQueue','timeout','strategy','User','Agents','name','online','getFaxQueues','../client'];(function(_0x43f406,_0x59700c){var _0x41988c=function(_0x5c2ef0){while(--_0x5c2ef0){_0x43f406['push'](_0x43f406['shift']());}};_0x41988c(++_0x59700c);}(_0xb4fa,0xf2));var _0xab4f=function(_0xa75b90,_0x331a26){_0xa75b90=_0xa75b90-0x0;var _0x27b392=_0xb4fa[_0xa75b90];return _0x27b392;};'use strict';var client=require(_0xab4f('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0xab4f('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xab4f('0x2'),_0xab4f('0x3')],'include':[{'model':_0xab4f('0x4'),'as':_0xab4f('0x5'),'attributes':['id',_0xab4f('0x6'),_0xab4f('0x7'),'faxPause']}]},'log':_0xab4f('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6b08ea3..1a253cb 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 _0x5d96=['DESC','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5d96,0xdf));var _0x65d9=function(_0x2c4710,_0x22dc0f){_0x2c4710=_0x2c4710-0x0;var _0x826b3c=_0x5d96[_0x2c4710];return _0x826b3c;};'use strict';var client=require('../client');exports[_0x65d9('0x0')]=function(_0x2de423){return client[_0x65d9('0x1')](_0x65d9('0x2'),{'body':_0x2de423,'log':'CreateFaxQueueReport'});};exports[_0x65d9('0x3')]=function(_0x53c18f,_0x30e0ca){return client['Request'](_0x65d9('0x4'),{'body':_0x30e0ca,'options':{'where':{'uniqueid':_0x53c18f},'order':[['id',_0x65d9('0x5')]],'limit':0x1},'log':_0x65d9('0x4')});}; \ No newline at end of file +var _0xcb2b=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xcb2b,0x156));var _0xbcb2=function(_0x5504fc,_0x2e161c){_0x5504fc=_0x5504fc-0x0;var _0xbad34c=_0xcb2b[_0x5504fc];return _0xbad34c;};'use strict';var client=require(_0xbcb2('0x0'));exports[_0xbcb2('0x1')]=function(_0x46f2d3){return client[_0xbcb2('0x2')](_0xbcb2('0x3'),{'body':_0x46f2d3,'log':_0xbcb2('0x3')});};exports[_0xbcb2('0x4')]=function(_0x14c572,_0x5f49b3){return client['Request'](_0xbcb2('0x5'),{'body':_0x5f49b3,'options':{'where':{'uniqueid':_0x14c572},'order':[['id','DESC']],'limit':0x1},'log':_0xbcb2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2cbc788..ecb279a 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 _0xb79e=['Request','GetInterval','name','interval','../client','getIntervals'];(function(_0x15ed68,_0x533f68){var _0x1076d2=function(_0x23aed3){while(--_0x23aed3){_0x15ed68['push'](_0x15ed68['shift']());}};_0x1076d2(++_0x533f68);}(_0xb79e,0x11e));var _0xeb79=function(_0x2d41df,_0x1e7955){_0x2d41df=_0x2d41df-0x0;var _0x406138=_0xb79e[_0x2d41df];return _0x406138;};'use strict';var client=require(_0xeb79('0x0'));exports[_0xeb79('0x1')]=function(){return function(){return client[_0xeb79('0x2')](_0xeb79('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xeb79('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xeb79('0x4'),_0xeb79('0x5')]}]},'log':_0xeb79('0x1')});};}; \ No newline at end of file +var _0x081f=['Intervals','name','interval','../client','getIntervals','GetInterval','Interval'];(function(_0x1ccc22,_0x254056){var _0x3b676f=function(_0x58f6c7){while(--_0x58f6c7){_0x1ccc22['push'](_0x1ccc22['shift']());}};_0x3b676f(++_0x254056);}(_0x081f,0x1ae));var _0xf081=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x081f[_0x3e531a];return _0x3c2574;};'use strict';var client=require(_0xf081('0x0'));exports[_0xf081('0x1')]=function(){return function(){return client['Request'](_0xf081('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xf081('0x3'),'as':_0xf081('0x4'),'attributes':['id',_0xf081('0x5'),_0xf081('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index fc7273e..f3e14cd 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 _0x1c9a=['updateMailInteraction','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x1c9a,0x98));var _0xa1c9=function(_0x388c50,_0x42ee06){_0x388c50=_0x388c50-0x0;var _0x58bcdc=_0x1c9a[_0x388c50];return _0x58bcdc;};'use strict';var client=require(_0xa1c9('0x0'));exports['update']=function(_0x470dcd,_0x5c45c5){return client[_0xa1c9('0x1')](_0xa1c9('0x2'),{'body':_0x5c45c5,'options':{'where':{'id':_0x470dcd}},'log':_0xa1c9('0x3')});};exports['addTags']=function(_0x21c0fc,_0x45d1f7){return client[_0xa1c9('0x1')](_0xa1c9('0x4'),{'body':_0x45d1f7,'options':{'where':{'id':_0x21c0fc}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x4991=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x4d255c,_0x11cb61){var _0xdac008=function(_0x3d2bb3){while(--_0x3d2bb3){_0x4d255c['push'](_0x4d255c['shift']());}};_0xdac008(++_0x11cb61);}(_0x4991,0xf7));var _0x1499=function(_0x3b757a,_0x521eec){_0x3b757a=_0x3b757a-0x0;var _0x5ebd86=_0x4991[_0x3b757a];return _0x5ebd86;};'use strict';var client=require(_0x1499('0x0'));exports['update']=function(_0x326758,_0x5bd577){return client[_0x1499('0x1')](_0x1499('0x2'),{'body':_0x5bd577,'options':{'where':{'id':_0x326758}},'log':_0x1499('0x3')});};exports[_0x1499('0x4')]=function(_0x1b291f,_0x158134){return client[_0x1499('0x1')](_0x1499('0x5'),{'body':_0x158134,'options':{'where':{'id':_0x1b291f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 4862814..2045552 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 _0xbc9c=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xbc9c,0x152));var _0xcbc9=function(_0x269916,_0x4c6a70){_0x269916=_0x269916-0x0;var _0x5c0019=_0xbc9c[_0x269916];return _0x5c0019;};'use strict';var client=require(_0xcbc9('0x0'));exports[_0xcbc9('0x1')]=function(_0x271579){return client[_0xcbc9('0x2')](_0xcbc9('0x3'),{'body':_0x271579,'log':_0xcbc9('0x4')});}; \ No newline at end of file +var _0xf360=['../client','create','Request','CreateMailMessage'];(function(_0x3d976d,_0x3e449f){var _0x398551=function(_0x1be6dd){while(--_0x1be6dd){_0x3d976d['push'](_0x3d976d['shift']());}};_0x398551(++_0x3e449f);}(_0xf360,0x164));var _0x0f36=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf360[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x0f36('0x0'));exports[_0x0f36('0x1')]=function(_0x3531b9){return client[_0x0f36('0x2')](_0x0f36('0x3'),{'body':_0x3531b9,'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 109ce39..a001a07 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 _0x287e=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x1c6227,_0x542c26){var _0x22a2ab=function(_0x274e77){while(--_0x274e77){_0x1c6227['push'](_0x1c6227['shift']());}};_0x22a2ab(++_0x542c26);}(_0x287e,0x1e3));var _0xe287=function(_0x53d294,_0x532130){_0x53d294=_0x53d294-0x0;var _0x3f6511=_0x287e[_0x53d294];return _0x3f6511;};'use strict';var client=require(_0xe287('0x0'));exports[_0xe287('0x1')]=function(){return function(){return client[_0xe287('0x2')](_0xe287('0x3'),{'options':{'raw':![],'attributes':['id',_0xe287('0x4'),_0xe287('0x5'),_0xe287('0x6')],'include':[{'model':_0xe287('0x7'),'as':_0xe287('0x8'),'attributes':['id','name',_0xe287('0x9'),_0xe287('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xe8d5=['online','../client','getMailQueues','Request','GetMailQueue','timeout','Agents','name'];(function(_0xe480f0,_0x4c0dc1){var _0x57b198=function(_0x4d8304){while(--_0x4d8304){_0xe480f0['push'](_0xe480f0['shift']());}};_0x57b198(++_0x4c0dc1);}(_0xe8d5,0xa9));var _0x5e8d=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xe8d5[_0x3740fe];return _0x55492b;};'use strict';var client=require(_0x5e8d('0x0'));exports[_0x5e8d('0x1')]=function(){return function(){return client[_0x5e8d('0x2')](_0x5e8d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5e8d('0x4'),'strategy'],'include':[{'model':'User','as':_0x5e8d('0x5'),'attributes':['id',_0x5e8d('0x6'),_0x5e8d('0x7'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e30cfb0..5d323e9 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 _0xe787=['create','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x3357cc,_0x361702){var _0x4734d9=function(_0x20f39b){while(--_0x20f39b){_0x3357cc['push'](_0x3357cc['shift']());}};_0x4734d9(++_0x361702);}(_0xe787,0x1c7));var _0x7e78=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xe787[_0x5cb1af];return _0x8d7940;};'use strict';var client=require(_0x7e78('0x0'));exports[_0x7e78('0x1')]=function(_0x4698b5){return client['Request'](_0x7e78('0x2'),{'body':_0x4698b5,'log':'CreateMailQueueReport'});};exports[_0x7e78('0x3')]=function(_0x3db98e,_0x24e694){return client['Request'](_0x7e78('0x4'),{'body':_0x24e694,'options':{'where':{'uniqueid':_0x3db98e},'order':[['id',_0x7e78('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xf757=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x30aa83,_0x447255){var _0x306bc0=function(_0x525623){while(--_0x525623){_0x30aa83['push'](_0x30aa83['shift']());}};_0x306bc0(++_0x447255);}(_0xf757,0x1d8));var _0x7f75=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xf757[_0x5a6de2];return _0x2c0525;};'use strict';var client=require(_0x7f75('0x0'));exports[_0x7f75('0x1')]=function(_0x3cd2a2){return client[_0x7f75('0x2')](_0x7f75('0x3'),{'body':_0x3cd2a2,'log':_0x7f75('0x3')});};exports[_0x7f75('0x4')]=function(_0x2f63a8,_0xe21990){return client[_0x7f75('0x2')](_0x7f75('0x5'),{'body':_0xe21990,'options':{'where':{'uniqueid':_0x2f63a8},'order':[['id',_0x7f75('0x6')]],'limit':0x1},'log':_0x7f75('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4f43c01..69c2d03 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 _0xe781=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x5b80fe,_0x23bd36){var _0x365865=function(_0x4fbdec){while(--_0x4fbdec){_0x5b80fe['push'](_0x5b80fe['shift']());}};_0x365865(++_0x23bd36);}(_0xe781,0x16c));var _0x1e78=function(_0x1cdcab,_0x17a516){_0x1cdcab=_0x1cdcab-0x0;var _0x4393d0=_0xe781[_0x1cdcab];return _0x4393d0;};'use strict';var client=require(_0x1e78('0x0'));exports[_0x1e78('0x1')]=function(_0x20e4a0,_0x4af0af){return client[_0x1e78('0x2')](_0x1e78('0x3'),{'body':_0x4af0af,'options':{'where':{'id':_0x20e4a0}},'log':_0x1e78('0x4')});};exports[_0x1e78('0x5')]=function(_0x5c1f93,_0x15e66b){return client[_0x1e78('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x15e66b,'options':{'where':{'id':_0x5c1f93}},'log':_0x1e78('0x6')});}; \ No newline at end of file +var _0xf56a=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','Request','addTagsToChatInteraction','../client'];(function(_0x557399,_0x1c922a){var _0x363ded=function(_0x10e6d2){while(--_0x10e6d2){_0x557399['push'](_0x557399['shift']());}};_0x363ded(++_0x1c922a);}(_0xf56a,0x71));var _0xaf56=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xf56a[_0x2b45b5];return _0x1d9c06;};'use strict';var client=require(_0xaf56('0x0'));exports[_0xaf56('0x1')]=function(_0x4850f0,_0x392d5d){return client['Request'](_0xaf56('0x2'),{'body':_0x392d5d,'options':{'where':{'id':_0x4850f0}},'log':_0xaf56('0x3')});};exports['addTags']=function(_0x3c4965,_0x5d2d68){return client[_0xaf56('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x5d2d68,'options':{'where':{'id':_0x3c4965}},'log':_0xaf56('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c8637b8..a5fa537 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 _0xa698=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa698,0x6a));var _0x8a69=function(_0x31e485,_0x2f451c){_0x31e485=_0x31e485-0x0;var _0x1d3d2c=_0xa698[_0x31e485];return _0x1d3d2c;};'use strict';var client=require(_0x8a69('0x0'));exports[_0x8a69('0x1')]=function(_0x3476dd){return client[_0x8a69('0x2')](_0x8a69('0x3'),{'body':_0x3476dd,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x4db5=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4db5,0xe4));var _0x54db=function(_0x5ba6d4,_0x33c28a){_0x5ba6d4=_0x5ba6d4-0x0;var _0x5245c0=_0x4db5[_0x5ba6d4];return _0x5245c0;};'use strict';var client=require(_0x54db('0x0'));exports[_0x54db('0x1')]=function(_0x260aa0){return client[_0x54db('0x2')](_0x54db('0x3'),{'body':_0x260aa0,'log':_0x54db('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 517f32c..81eb947 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 _0x05e2=['User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x383545,_0x4790bd){var _0x5ba15=function(_0x2d8ed2){while(--_0x2d8ed2){_0x383545['push'](_0x383545['shift']());}};_0x5ba15(++_0x4790bd);}(_0x05e2,0xe0));var _0x205e=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0x05e2[_0x25a0b9];return _0x30b9ab;};'use strict';var client=require(_0x205e('0x0'));exports[_0x205e('0x1')]=function(){return function(){return client[_0x205e('0x2')](_0x205e('0x3'),{'options':{'raw':![],'attributes':['id',_0x205e('0x4'),_0x205e('0x5'),_0x205e('0x6')],'include':[{'model':_0x205e('0x7'),'as':_0x205e('0x8'),'attributes':['id',_0x205e('0x4'),_0x205e('0x9'),_0x205e('0xa')]}]},'log':_0x205e('0x1')});};}; \ No newline at end of file +var _0x12ae=['name','online','getOpenchannelQueues','Request','strategy','User','Agents'];(function(_0xa99ab2,_0x32fca0){var _0x2595a8=function(_0xb748eb){while(--_0xb748eb){_0xa99ab2['push'](_0xa99ab2['shift']());}};_0x2595a8(++_0x32fca0);}(_0x12ae,0x175));var _0xe12a=function(_0x23a03d,_0x9f11e8){_0x23a03d=_0x23a03d-0x0;var _0x46b0d2=_0x12ae[_0x23a03d];return _0x46b0d2;};'use strict';var client=require('../client');exports[_0xe12a('0x0')]=function(){return function(){return client[_0xe12a('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xe12a('0x2')],'include':[{'model':_0xe12a('0x3'),'as':_0xe12a('0x4'),'attributes':['id',_0xe12a('0x5'),_0xe12a('0x6'),'openchannelPause']}]},'log':_0xe12a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7d0c43c..073e2dd 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 _0xd8c8=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport'];(function(_0x5a3afd,_0x20a4ab){var _0x401ae4=function(_0xff9cf1){while(--_0xff9cf1){_0x5a3afd['push'](_0x5a3afd['shift']());}};_0x401ae4(++_0x20a4ab);}(_0xd8c8,0xba));var _0x8d8c=function(_0x2776c1,_0x36c713){_0x2776c1=_0x2776c1-0x0;var _0x5c80e7=_0xd8c8[_0x2776c1];return _0x5c80e7;};'use strict';var client=require('../client');exports['create']=function(_0x3a3ac2){return client[_0x8d8c('0x0')](_0x8d8c('0x1'),{'body':_0x3a3ac2,'log':_0x8d8c('0x1')});};exports['update']=function(_0x50a4c6,_0x3d3b55){return client[_0x8d8c('0x0')](_0x8d8c('0x2'),{'body':_0x3d3b55,'options':{'where':{'uniqueid':_0x50a4c6},'order':[['id',_0x8d8c('0x3')]],'limit':0x1},'log':_0x8d8c('0x2')});}; \ No newline at end of file +var _0x2a39=['DESC','../client','Request','CreateOpenchannelQueueReport','update'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x2a39,0x1af));var _0x92a3=function(_0x58fc2b,_0x368286){_0x58fc2b=_0x58fc2b-0x0;var _0x3937ce=_0x2a39[_0x58fc2b];return _0x3937ce;};'use strict';var client=require(_0x92a3('0x0'));exports['create']=function(_0x4c17a3){return client[_0x92a3('0x1')](_0x92a3('0x2'),{'body':_0x4c17a3,'log':'CreateOpenchannelQueueReport'});};exports[_0x92a3('0x3')]=function(_0x4dd8b7,_0x3a53ab){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x3a53ab,'options':{'where':{'uniqueid':_0x4dd8b7},'order':[['id',_0x92a3('0x4')]],'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 53b3281..5d88027 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 _0xeb5d=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x120212,_0x103e00){var _0x4041c5=function(_0x14d36e){while(--_0x14d36e){_0x120212['push'](_0x120212['shift']());}};_0x4041c5(++_0x103e00);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xeb5d[_0x1cc8fe];return _0x230054;};'use strict';var client=require('../client');exports[_0xdeb5('0x0')]=function(_0x1ede03,_0x42c87c){return client[_0xdeb5('0x1')]('UpdateSmsInteraction',{'body':_0x42c87c,'options':{'where':{'id':_0x1ede03}},'log':'updateSmsInteraction'});};exports[_0xdeb5('0x2')]=function(_0x16c31b,_0x546313){return client[_0xdeb5('0x1')](_0xdeb5('0x3'),{'body':_0x546313,'options':{'where':{'id':_0x16c31b}},'log':_0xdeb5('0x4')});}; \ No newline at end of file +var _0x536e=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x50e032,_0x8bb78f){var _0x36cd25=function(_0x559cb3){while(--_0x559cb3){_0x50e032['push'](_0x50e032['shift']());}};_0x36cd25(++_0x8bb78f);}(_0x536e,0x155));var _0xe536=function(_0x48c841,_0x27374a){_0x48c841=_0x48c841-0x0;var _0x22c86f=_0x536e[_0x48c841];return _0x22c86f;};'use strict';var client=require(_0xe536('0x0'));exports[_0xe536('0x1')]=function(_0x3fbffb,_0x416d98){return client[_0xe536('0x2')](_0xe536('0x3'),{'body':_0x416d98,'options':{'where':{'id':_0x3fbffb}},'log':_0xe536('0x4')});};exports[_0xe536('0x5')]=function(_0x26d7cb,_0x409e01){return client[_0xe536('0x2')](_0xe536('0x6'),{'body':_0x409e01,'options':{'where':{'id':_0x26d7cb}},'log':_0xe536('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 21778c2..afafd6a 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 _0x03be=['CreateSmsMessage','Request'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x03be,0xcf));var _0xe03b=function(_0x2499ab,_0x28057f){_0x2499ab=_0x2499ab-0x0;var _0x4f9931=_0x03be[_0x2499ab];return _0x4f9931;};'use strict';var client=require('../client');exports['create']=function(_0xbd33cb){return client[_0xe03b('0x0')](_0xe03b('0x1'),{'body':_0xbd33cb,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x3ddc=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x3c2d87,_0x623ad){var _0x142d3c=function(_0x3fa5a5){while(--_0x3fa5a5){_0x3c2d87['push'](_0x3c2d87['shift']());}};_0x142d3c(++_0x623ad);}(_0x3ddc,0x113));var _0xc3dd=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3ddc[_0x2be8c2];return _0x97f531;};'use strict';var client=require('../client');exports[_0xc3dd('0x0')]=function(_0x2a131d){return client[_0xc3dd('0x1')](_0xc3dd('0x2'),{'body':_0x2a131d,'log':_0xc3dd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4c042c3..d7dfced 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4c1a2d,_0x1515fb){var _0x490c38=function(_0x5ef4bb){while(--_0x5ef4bb){_0x4c1a2d['push'](_0x4c1a2d['shift']());}};_0x490c38(++_0x1515fb);}(_0x70e0,0x17b));var _0x070e=function(_0x27e9d7,_0x2c5509){_0x27e9d7=_0x27e9d7-0x0;var _0x576f03=_0x70e0[_0x27e9d7];return _0x576f03;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x1ae236,_0x33504a){var _0x57f020=function(_0x51c7cf){while(--_0x51c7cf){_0x1ae236['push'](_0x1ae236['shift']());}};_0x57f020(++_0x33504a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 7c37329..904f624 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x465c38,_0x7c29d8){var _0x130a9a=function(_0x31c676){while(--_0x31c676){_0x465c38['push'](_0x465c38['shift']());}};_0x130a9a(++_0x7c29d8);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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 +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x2f065b,_0x378864){var _0x9456f7=function(_0x361524){while(--_0x361524){_0x2f065b['push'](_0x2f065b['shift']());}};_0x9456f7(++_0x378864);}(_0x34e8,0x12c));var _0x834e=function(_0x5e0a13,_0x2bd6d4){_0x5e0a13=_0x5e0a13-0x0;var _0x1a2028=_0x34e8[_0x5e0a13];return _0x1a2028;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 9696488..2e58186 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(_0x4fb3ce,_0x50e20c){var _0x281cea=function(_0x10c2f9){while(--_0x10c2f9){_0x4fb3ce['push'](_0x4fb3ce['shift']());}};_0x281cea(++_0x50e20c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x5af304,_0x357554){var _0x4b03b5=function(_0x316439){while(--_0x316439){_0x5af304['push'](_0x5af304['shift']());}};_0x4b03b5(++_0x357554);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 cc8d536..e06c6cd 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 _0xa0a1=['Request','addTags','AddTagsToWhatsappInteraction','../client'];(function(_0x2ef2fd,_0x1fd065){var _0x3d5a77=function(_0xef0304){while(--_0xef0304){_0x2ef2fd['push'](_0x2ef2fd['shift']());}};_0x3d5a77(++_0x1fd065);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x32f539,_0x51efdb){_0x32f539=_0x32f539-0x0;var _0x1867ab=_0xa0a1[_0x32f539];return _0x1867ab;};'use strict';var client=require(_0x1a0a('0x0'));exports['update']=function(_0x1495e1,_0x2ea09e){return client[_0x1a0a('0x1')]('UpdateWhatsappInteraction',{'body':_0x2ea09e,'options':{'where':{'id':_0x1495e1}},'log':'updateWhatsappInteraction'});};exports[_0x1a0a('0x2')]=function(_0x22f069,_0x5114de){return client[_0x1a0a('0x1')](_0x1a0a('0x3'),{'body':_0x5114de,'options':{'where':{'id':_0x22f069}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x6eec=['updateWhatsappInteraction','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc6ee('0x0'));exports[_0xc6ee('0x1')]=function(_0xfde252,_0x28512e){return client['Request'](_0xc6ee('0x2'),{'body':_0x28512e,'options':{'where':{'id':_0xfde252}},'log':_0xc6ee('0x3')});};exports['addTags']=function(_0x63587e,_0x26ee43){return client[_0xc6ee('0x4')](_0xc6ee('0x5'),{'body':_0x26ee43,'options':{'where':{'id':_0x63587e}},'log':_0xc6ee('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 1ec9779..89fd1b0 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 _0x2ad0=['Request','../client','create'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x2ad0,0xdc));var _0x02ad=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x2ad0[_0x37c22c];return _0x119d79;};'use strict';var client=require(_0x02ad('0x0'));exports[_0x02ad('0x1')]=function(_0x37c8c8){return client[_0x02ad('0x2')]('CreateWhatsappMessage',{'body':_0x37c8c8,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x7a2b=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x7a2b,0xa1));var _0xb7a2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7a2b[_0x18ab2a];return _0x16dcee;};'use strict';var client=require(_0xb7a2('0x0'));exports[_0xb7a2('0x1')]=function(_0x523f0f){return client['Request'](_0xb7a2('0x2'),{'body':_0x523f0f,'log':_0xb7a2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 31681a0..8a3cfcf 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 _0x1902=['whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x1902,0x97));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2190('0x0'));exports[_0x2190('0x1')]=function(){return function(){return client[_0x2190('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x2190('0x3'),_0x2190('0x4')],'include':[{'model':_0x2190('0x5'),'as':_0x2190('0x6'),'attributes':['id',_0x2190('0x7'),_0x2190('0x8'),_0x2190('0x9')]}]},'log':_0x2190('0x1')});};}; \ No newline at end of file +var _0xe466=['Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','../client'];(function(_0x506d68,_0x33c064){var _0x10e1c2=function(_0x16c55c){while(--_0x16c55c){_0x506d68['push'](_0x506d68['shift']());}};_0x10e1c2(++_0x33c064);}(_0xe466,0xe9));var _0x6e46=function(_0x4a3bd9,_0x4c6ea8){_0x4a3bd9=_0x4a3bd9-0x0;var _0x45b132=_0xe466[_0x4a3bd9];return _0x45b132;};'use strict';var client=require(_0x6e46('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x6e46('0x1')](_0x6e46('0x2'),{'options':{'raw':![],'attributes':['id',_0x6e46('0x3'),'timeout',_0x6e46('0x4')],'include':[{'model':_0x6e46('0x5'),'as':_0x6e46('0x6'),'attributes':['id',_0x6e46('0x3'),_0x6e46('0x7'),_0x6e46('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5669297..291ff78 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 _0xc193=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1c26d8,_0x199a1e){var _0x3aa879=function(_0x18d9eb){while(--_0x18d9eb){_0x1c26d8['push'](_0x1c26d8['shift']());}};_0x3aa879(++_0x199a1e);}(_0xc193,0x1aa));var _0x3c19=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc193[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x3c19('0x0'));exports[_0x3c19('0x1')]=function(_0x7d76f){return client[_0x3c19('0x2')](_0x3c19('0x3'),{'body':_0x7d76f,'log':_0x3c19('0x3')});};exports[_0x3c19('0x4')]=function(_0x5e9928,_0x1afa74){return client[_0x3c19('0x2')](_0x3c19('0x5'),{'body':_0x1afa74,'options':{'where':{'uniqueid':_0x5e9928},'order':[['id',_0x3c19('0x6')]],'limit':0x1},'log':_0x3c19('0x5')});}; \ No newline at end of file +var _0xa6b1=['UpdateWhatsappQueueReport','DESC','create','Request','CreateWhatsappQueueReport'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0xa6b1,0x10b));var _0x1a6b=function(_0x55448f,_0xa2cd4f){_0x55448f=_0x55448f-0x0;var _0x353910=_0xa6b1[_0x55448f];return _0x353910;};'use strict';var client=require('../client');exports[_0x1a6b('0x0')]=function(_0x2ccc2f){return client[_0x1a6b('0x1')]('CreateWhatsappQueueReport',{'body':_0x2ccc2f,'log':_0x1a6b('0x2')});};exports['update']=function(_0x459593,_0xb2d8b1){return client[_0x1a6b('0x1')](_0x1a6b('0x3'),{'body':_0xb2d8b1,'options':{'where':{'uniqueid':_0x459593},'order':[['id',_0x1a6b('0x4')]],'limit':0x1},'log':_0x1a6b('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 07933a7..56671d1 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 _0xa418=['util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x10a273,_0x2f4263){var _0x7e3ade=function(_0x5d2a37){while(--_0x5d2a37){_0x10a273['push'](_0x10a273['shift']());}};_0x7e3ade(++_0x2f4263);}(_0xa418,0xb9));var _0x8a41=function(_0x2622a0,_0x5f2d71){_0x2622a0=_0x2622a0-0x0;var _0x1259f3=_0xa418[_0x2622a0];return _0x1259f3;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8a41('0x0'));var seqqueue=require(_0x8a41('0x1'));var logger=require(_0x8a41('0x2'))('routing');var strategy=require(_0x8a41('0x3'));var queue=schema({'name':{'type':_0x8a41('0x4'),'required':!![],'message':_0x8a41('0x5')},'timeout':{'type':_0x8a41('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1aac8e,_0x197a73,_0x30221b){return logger[_0x8a41('0x7')](util[_0x8a41('0x8')](_0x8a41('0x9'),_0x1aac8e,_0x197a73[_0x8a41('0xa')],_0x30221b));}function handleFindAgent(_0x79351e){return function(_0x37238b){return _0x37238b['name'][_0x8a41('0xb')]()===_0x79351e[_0x8a41('0xb')]();};}exports[_0x8a41('0xc')]=function(_0x2e0434,_0x2519da,_0x10c983,_0x1c94b7){return function(_0x5af548){try{var _0x45c376={'name':_0x2519da[0x0],'timeout':_0x2519da[0x1]};var _0x143cf4=queue[_0x8a41('0xd')](_0x45c376,{'typecast':!![]});if(_0x143cf4[_0x8a41('0xe')]){logger[_0x8a41('0xf')]('[%s][AGENT]\x20%s',_0x2e0434,_['map'](_0x143cf4,_0x8a41('0x10'))[_0x8a41('0x11')](',\x20'));_0x5af548[_0x8a41('0x12')]();}else{var _0x3a0e42=_[_0x8a41('0x13')](_0x10c983[_0x8a41('0x14')],handleFindAgent(_0x45c376[_0x8a41('0xa')]));if(_0x3a0e42){var _0x67294c=(_0x45c376[_0x8a41('0x15')]||0xa)*0x3e8;var _0x38e385,_0x3f4d71;var _0x525a1a=seqqueue[_0x8a41('0x16')](_0x67294c);_0x525a1a['id']=_0x2e0434;_0x525a1a['atimeout']=_0x67294c;_0x525a1a[_0x8a41('0x17')]=_0x1c94b7[_0x8a41('0x17')];writeLog(_0x2e0434,_0x3a0e42,util['format'](_0x8a41('0x18'),_0x67294c));_0x10c983[_0x8a41('0x19')][_0x2e0434]['on'](_0x8a41('0x1a'),function(){logger[_0x8a41('0x7')](_0x8a41('0x1b'),_0x2e0434);clearTimeout(_0x3f4d71);_0x3f4d71=undefined;_0x525a1a[_0x8a41('0x1c')]();if(_0x10c983[_0x8a41('0x19')][_0x2e0434]){delete _0x10c983['rules'][_0x2e0434];}_0x5af548[_0x8a41('0x12')]();});_0x10c983[_0x8a41('0x19')][_0x2e0434]['on'](_0x8a41('0x1d'),function(){if(_0x10c983[_0x8a41('0x19')][_0x2e0434]){delete _0x10c983[_0x8a41('0x19')][_0x2e0434];}});_0x3f4d71=setTimeout(function(){logger[_0x8a41('0x7')](_0x8a41('0x1e'),_0x2e0434);clearTimeout(_0x3f4d71);_0x525a1a[_0x8a41('0x1c')]();_0x5af548[_0x8a41('0x1f')]();},_0x67294c);strategy[_0x8a41('0x20')](_0x525a1a,_0x3a0e42,_0x10c983,_0x1c94b7);}else{logger[_0x8a41('0xf')](_0x8a41('0x21'),_0x2e0434,_0x45c376['name']);_0x5af548[_0x8a41('0x12')]();}}}catch(_0x3c7046){console[_0x8a41('0x22')](_0x3c7046);logger[_0x8a41('0xf')](_0x8a41('0x23'),_0x2e0434,_0x3c7046[_0x8a41('0x24')]);_0x5af548[_0x8a41('0x12')]();}};}; \ No newline at end of file +var _0x0ab7=['length','error','map','message','join','find','agents','createQueue','atimeout','channel','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence'];(function(_0x2d91b5,_0x57e992){var _0x955dfc=function(_0x15f920){while(--_0x15f920){_0x2d91b5['push'](_0x2d91b5['shift']());}};_0x955dfc(++_0x57e992);}(_0x0ab7,0x10e));var _0x70ab=function(_0x55cf11,_0x294992){_0x55cf11=_0x55cf11-0x0;var _0x149e48=_0x0ab7[_0x55cf11];return _0x149e48;};'use strict';var schema=require(_0x70ab('0x0'));var _=require('lodash');var util=require(_0x70ab('0x1'));var seqqueue=require(_0x70ab('0x2'));var logger=require('../../../../config/logger')(_0x70ab('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x70ab('0x4')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xe3630e,_0x409f66,_0x4caf0){return logger['info'](util['format'](_0x70ab('0x5'),_0xe3630e,_0x409f66[_0x70ab('0x6')],_0x4caf0));}function handleFindAgent(_0x222ac5){return function(_0x4b0a28){return _0x4b0a28[_0x70ab('0x6')][_0x70ab('0x7')]()===_0x222ac5[_0x70ab('0x7')]();};}exports[_0x70ab('0x8')]=function(_0x595cb4,_0x1e711d,_0x7cdf2d,_0x59873c){return function(_0x513c48){try{var _0x52fda5={'name':_0x1e711d[0x0],'timeout':_0x1e711d[0x1]};var _0xc2740e=queue['validate'](_0x52fda5,{'typecast':!![]});if(_0xc2740e[_0x70ab('0x9')]){logger[_0x70ab('0xa')]('[%s][AGENT]\x20%s',_0x595cb4,_[_0x70ab('0xb')](_0xc2740e,_0x70ab('0xc'))[_0x70ab('0xd')](',\x20'));_0x513c48['stop']();}else{var _0x58df90=_[_0x70ab('0xe')](_0x7cdf2d[_0x70ab('0xf')],handleFindAgent(_0x52fda5[_0x70ab('0x6')]));if(_0x58df90){var _0x3271ff=(_0x52fda5['timeout']||0xa)*0x3e8;var _0x51bb2c,_0x5c6de3;var _0x21daac=seqqueue[_0x70ab('0x10')](_0x3271ff);_0x21daac['id']=_0x595cb4;_0x21daac[_0x70ab('0x11')]=_0x3271ff;_0x21daac[_0x70ab('0x12')]=_0x59873c['channel'];writeLog(_0x595cb4,_0x58df90,util['format'](_0x70ab('0x13'),_0x3271ff));_0x7cdf2d['rules'][_0x595cb4]['on'](_0x70ab('0x14'),function(){logger[_0x70ab('0x15')](_0x70ab('0x16'),_0x595cb4);clearTimeout(_0x5c6de3);_0x5c6de3=undefined;_0x21daac[_0x70ab('0x17')]();if(_0x7cdf2d[_0x70ab('0x18')][_0x595cb4]){delete _0x7cdf2d[_0x70ab('0x18')][_0x595cb4];}_0x513c48[_0x70ab('0x19')]();});_0x7cdf2d['rules'][_0x595cb4]['on']('complete',function(){if(_0x7cdf2d['rules'][_0x595cb4]){delete _0x7cdf2d['rules'][_0x595cb4];}});_0x5c6de3=setTimeout(function(){logger[_0x70ab('0x15')](_0x70ab('0x1a'),_0x595cb4);clearTimeout(_0x5c6de3);_0x21daac[_0x70ab('0x17')]();_0x513c48[_0x70ab('0x1b')]();},_0x3271ff);strategy[_0x70ab('0x1c')](_0x21daac,_0x58df90,_0x7cdf2d,_0x59873c);}else{logger[_0x70ab('0xa')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x595cb4,_0x52fda5[_0x70ab('0x6')]);_0x513c48[_0x70ab('0x19')]();}}}catch(_0x4215fe){console['log'](_0x4215fe);logger[_0x70ab('0xa')](_0x70ab('0x1d'),_0x595cb4,_0x4215fe[_0x70ab('0x1e')]);_0x513c48['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 108e9d6..13cab2a 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 _0x1102=['dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','next','providerName','amazonlex'];(function(_0x148785,_0x195ee5){var _0x17a172=function(_0x478b94){while(--_0x478b94){_0x148785['push'](_0x148785['shift']());}};_0x17a172(++_0x195ee5);}(_0x1102,0x192));var _0x2110=function(_0x126645,_0x16ede2){_0x126645=_0x126645-0x0;var _0x46968b=_0x1102[_0x126645];return _0x46968b;};'use strict';var _=require(_0x2110('0x0'));var moment=require(_0x2110('0x1'));var AWS=require(_0x2110('0x2'));var utils=require(_0x2110('0x3'));var logger=require(_0x2110('0x4'))(_0x2110('0x5'));var rpc={'chatMessage':require(_0x2110('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2110('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2110('0x8')),'whatsappMessage':require(_0x2110('0x9'))};exports[_0x2110('0xa')]=function(_0x320d7d,_0x5e5f68){return function(_0x369892){try{if(!_['isNil'](this['interaction'][_0x2110('0xb')])){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x2110('0xe'));return _0x369892['next']();}var _0x1c188d={'ContactId':this[_0x2110('0xf')]['id'],'sentAt':moment()[_0x2110('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2110('0x11')};if(this[_0x2110('0x12')]===_0x2110('0x13')||this[_0x2110('0x12')]==='whatsapp'){_0x1c188d[_0x2110('0x14')]=this[_0x2110('0x15')]['phone'];}var _0xbd71b2=this[_0x2110('0x12')];if(_0xbd71b2===_0x2110('0x16')){_0x1c188d[_0x2110('0x17')]=this[_0x2110('0x18')]['id'];}else{_0x1c188d[_[_0x2110('0x19')](_0xbd71b2)+_0x2110('0x1a')]=this['account']['id'];}_0x1c188d[_[_0x2110('0x19')](_0xbd71b2)+_0x2110('0x1b')]=this['interaction']['id'];if(this[_0x2110('0x15')][_0x2110('0x1c')]){var _0x172433=_0x5e5f68[0x4];if(!_[_0x2110('0x1d')](_0x172433)){_0x1c188d['body']=utils[_0x2110('0x1e')](_0x172433,this);return rpc[_0xbd71b2+_0x2110('0x1f')][_0x2110('0x20')](_0x1c188d)[_0x2110('0x21')](function(_0x98e8ff){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x1c188d[_0x2110('0x22')]);})[_0x2110('0x23')](function(_0x5baa54){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON[_0x2110('0x25')](_0x5baa54));})[_0x2110('0x26')](function(){logger[_0x2110('0xc')](_0x2110('0x27'),_0x320d7d);_0x369892[_0x2110('0x28')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x320d7d);_0x369892['stop']();}}else{var _0x276688=this;var _0x111a08=new AWS[(_0x2110('0x29'))]({'accessKeyId':_0x5e5f68[0x0],'secretAccessKey':_0x5e5f68[0x1],'region':_0x5e5f68[0x2]});var _0x3155ff={'botAlias':'$LATEST','botName':_0x5e5f68[0x3],'inputText':this[_0x2110('0x2a')][_0x2110('0x22')],'userId':this[_0x2110('0x12')]+':'+this['interaction']['id'][_0x2110('0x2b')]()};_0x111a08[_0x2110('0x2c')](_0x3155ff,function(_0x8893c8,_0x288b38){if(_0x8893c8){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,_0x8893c8[_0x2110('0x2a')]);_0x369892[_0x2110('0x2d')]();}else if(_0x288b38&&_0x288b38['message']){_0x276688[_0x2110('0x22')]['amazonlex']=_0x288b38;_0x1c188d[_0x2110('0x22')]=_0x288b38[_0x2110('0x2a')];_0x1c188d[_0x2110('0x2e')]=_0x2110('0x2f');_0x1c188d['providerResponse']=JSON['stringify'](_0x288b38);return rpc[_0xbd71b2+'Message'][_0x2110('0x20')](_0x1c188d)[_0x2110('0x21')](function(_0x58d91b){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x1c188d['body']);if(_0x288b38[_0x2110('0x30')]==_0x2110('0x31')){_0x369892[_0x2110('0x2d')]();}else{_0x369892['stop']();}})['catch'](function(_0x547abe){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON['stringify'](_0x547abe));_0x369892[_0x2110('0x2d')]();});}else{_0x369892[_0x2110('0x2d')]();}});}}catch(_0x894ab7){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON[_0x2110('0x25')](_0x894ab7));_0x369892[_0x2110('0x28')]();}};}; \ No newline at end of file +var _0xab16=['Message','create','then','info','stringify','finally','stop','$LATEST','message','toString','postText','error','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender'];(function(_0x2d138a,_0x38524c){var _0x1c13e9=function(_0x342d00){while(--_0x342d00){_0x2d138a['push'](_0x2d138a['shift']());}};_0x1c13e9(++_0x38524c);}(_0xab16,0xb9));var _0x6ab1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xab16[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x6ab1('0x0'));var moment=require(_0x6ab1('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x6ab1('0x2'))(_0x6ab1('0x3'));var rpc={'chatMessage':require(_0x6ab1('0x4')),'openchannelMessage':require(_0x6ab1('0x5')),'mailMessage':require(_0x6ab1('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x2d1cc7,_0xc53e6d){return function(_0x25cbdf){try{if(!_['isNil'](this[_0x6ab1('0x7')][_0x6ab1('0x8')])){logger['info'](_0x6ab1('0x9'),_0x2d1cc7,_0x6ab1('0xa'));return _0x25cbdf[_0x6ab1('0xb')]();}var _0x459c22={'ContactId':this[_0x6ab1('0xc')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x6ab1('0xd')]===_0x6ab1('0xe')||this[_0x6ab1('0xd')]==='whatsapp'){_0x459c22[_0x6ab1('0xf')]=this['interaction'][_0x6ab1('0xf')];}var _0x7d0d15=this[_0x6ab1('0xd')];if(_0x7d0d15===_0x6ab1('0x10')){_0x459c22[_0x6ab1('0x11')]=this[_0x6ab1('0x12')]['id'];}else{_0x459c22[_[_0x6ab1('0x13')](_0x7d0d15)+_0x6ab1('0x14')]=this['account']['id'];}_0x459c22[_[_0x6ab1('0x13')](_0x7d0d15)+'InteractionId']=this[_0x6ab1('0x7')]['id'];if(this['interaction'][_0x6ab1('0x15')]){var _0x1d773e=_0xc53e6d[0x4];if(!_[_0x6ab1('0x16')](_0x1d773e)){_0x459c22[_0x6ab1('0x17')]=utils[_0x6ab1('0x18')](_0x1d773e,this);return rpc[_0x7d0d15+_0x6ab1('0x19')][_0x6ab1('0x1a')](_0x459c22)[_0x6ab1('0x1b')](function(_0x6f4601){logger[_0x6ab1('0x1c')](_0x6ab1('0x9'),_0x2d1cc7,_0x459c22[_0x6ab1('0x17')]);})['catch'](function(_0x5381bc){logger['error'](_0x6ab1('0x9'),_0x2d1cc7,JSON[_0x6ab1('0x1d')](_0x5381bc));})[_0x6ab1('0x1e')](function(){logger[_0x6ab1('0x1c')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2d1cc7);_0x25cbdf[_0x6ab1('0x1f')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2d1cc7);_0x25cbdf['stop']();}}else{var _0x1d4048=this;var _0x249237=new AWS['LexRuntime']({'accessKeyId':_0xc53e6d[0x0],'secretAccessKey':_0xc53e6d[0x1],'region':_0xc53e6d[0x2]});var _0x2f46ae={'botAlias':_0x6ab1('0x20'),'botName':_0xc53e6d[0x3],'inputText':this[_0x6ab1('0x21')][_0x6ab1('0x17')],'userId':this['channel']+':'+this[_0x6ab1('0x7')]['id'][_0x6ab1('0x22')]()};_0x249237[_0x6ab1('0x23')](_0x2f46ae,function(_0x3ba700,_0x11ce0f){if(_0x3ba700){logger[_0x6ab1('0x24')](_0x6ab1('0x9'),_0x2d1cc7,_0x3ba700[_0x6ab1('0x21')]);_0x25cbdf['next']();}else if(_0x11ce0f&&_0x11ce0f['message']){_0x1d4048[_0x6ab1('0x17')][_0x6ab1('0x25')]=_0x11ce0f;_0x459c22[_0x6ab1('0x17')]=_0x11ce0f[_0x6ab1('0x21')];_0x459c22[_0x6ab1('0x26')]=_0x6ab1('0x25');_0x459c22[_0x6ab1('0x27')]=JSON['stringify'](_0x11ce0f);return rpc[_0x7d0d15+_0x6ab1('0x19')]['create'](_0x459c22)[_0x6ab1('0x1b')](function(_0x44e0c0){logger[_0x6ab1('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x2d1cc7,_0x459c22[_0x6ab1('0x17')]);if(_0x11ce0f[_0x6ab1('0x28')]==_0x6ab1('0x29')){_0x25cbdf[_0x6ab1('0xb')]();}else{_0x25cbdf[_0x6ab1('0x1f')]();}})['catch'](function(_0x4e31dd){logger[_0x6ab1('0x24')]('[%s][AMAZONLEX]\x20%s',_0x2d1cc7,JSON[_0x6ab1('0x1d')](_0x4e31dd));_0x25cbdf[_0x6ab1('0xb')]();});}else{_0x25cbdf['next']();}});}}catch(_0x48633b){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2d1cc7,JSON[_0x6ab1('0x1d')](_0x48633b));_0x25cbdf[_0x6ab1('0x1f')]();}};}; \ 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 727bf51..1434357 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 _0x2617=['account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','';_0x1a836b[_0x7261('0x38')]={'Auto-Submitted':_0x7261('0x39'),'X-Auto-Response-Suppress':_0x7261('0x3a'),'Precedence':'auto_reply'};return mailRpc[_0x7261('0x3b')](this[_0x7261('0x2c')]['smtpOptions'],_0x1a836b)['then'](function(_0x29d709){logger[_0x7261('0x1b')](_0x7261('0x3c'),_0x361377);_0x1a836b[_0x7261('0x32')]=_0x29d709[_0x7261('0x24')]['messageId'];return rpc[_0x1eb435+'Message'][_0x7261('0x3d')](_0x1a836b);})[_0x7261('0x3e')](function(_0x29f03a){logger[_0x7261('0x1b')](_0x7261('0x16'),_0x361377,JSON[_0x7261('0x3f')](_0x29f03a));})['catch'](function(_0x14c469){logger[_0x7261('0x40')](_0x7261('0x41'),_0x361377,JSON['stringify'](_0x14c469));})['finally'](function(){Promise[_0x7261('0x42')]()[_0x7261('0x3e')](function(){if(_0x494f48[0x0]!=='2'||_0x21e5a2[_0x7261('0x1d')])return;return rpc[_0x1eb435+'Interaction'][_0x7261('0x43')](_0x21e5a2['id'],{'autoreplyExecuted':!![]})[_0x7261('0x3e')](function(_0x43e4ff){logger['info'](_0x7261('0x1e'),_0x361377,JSON[_0x7261('0x3f')](_0x43e4ff));})[_0x7261('0x44')](function(_0x10e29b){logger[_0x7261('0x40')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x361377,JSON['stringify'](_0x10e29b));});})['then'](function(){_0xb21c51[_0x7261('0x17')]();});});}else{return rpc[this[_0x7261('0x12')]+'Message'][_0x7261('0x3d')](_0x1a836b)[_0x7261('0x3e')](function(){logger[_0x7261('0x1b')](_0x7261('0x16'),_0x361377,_0x1a836b['body']);})['catch'](function(_0x4fff79){logger[_0x7261('0x40')](_0x7261('0x16'),_0x361377,JSON[_0x7261('0x3f')](_0x4fff79));})[_0x7261('0x45')](function(){Promise[_0x7261('0x42')]()[_0x7261('0x3e')](function(){if(_0x494f48[0x0]!=='2'||_0x21e5a2['autoreplyExecuted'])return;return rpc[_0x1eb435+'Interaction'][_0x7261('0x43')](_0x21e5a2['id'],{'autoreplyExecuted':!![]})[_0x7261('0x3e')](function(_0x56b326){logger[_0x7261('0x1b')](_0x7261('0x1e'),_0x361377,JSON[_0x7261('0x3f')](_0x56b326));})[_0x7261('0x44')](function(_0x14329b){logger[_0x7261('0x40')](_0x7261('0x46'),_0x361377,JSON['stringify'](_0x14329b));});})[_0x7261('0x3e')](function(){_0xb21c51[_0x7261('0x17')]();});});}}}catch(_0x216c12){logger[_0x7261('0x40')](_0x7261('0x16'),_0x361377,JSON['stringify'](_0x216c12));_0xb21c51[_0x7261('0x47')]();}};}; \ No newline at end of file +var _0x149f=['autoreplyExecuted','info','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','inReplyTo','messageId','html','replace','','auto-replied','All','auto_reply','sendMailMessage','account','smtpOptions','then','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','channel','mail','body','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent'];(function(_0x5c1d0e,_0x19fcac){var _0x339984=function(_0xcda02){while(--_0xcda02){_0x5c1d0e['push'](_0x5c1d0e['shift']());}};_0x339984(++_0x19fcac);}(_0x149f,0x73));var _0xf149=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x149f[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var moment=require(_0xf149('0x0'));var utils=require('./utils');var logger=require(_0xf149('0x1'))(_0xf149('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf149('0x3')),'mailMessage':require(_0xf149('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf149('0x5')),'whatsappMessage':require(_0xf149('0x6')),'chatInteraction':require(_0xf149('0x7')),'openchannelInteraction':require(_0xf149('0x8')),'mailInteraction':require(_0xf149('0x9')),'smsInteraction':require(_0xf149('0xa')),'faxInteraction':require(_0xf149('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x432c47,_0x366dc2,_0x4d0508,_0x4dc88d){return function(_0x34e7b9){try{var _0x2730a8=this[_0xf149('0xc')];if(_0x2730a8===_0xf149('0xd')&&_0x4dc88d[_0xf149('0xe')]['isAutoreply']){logger['info'](_0xf149('0xf'),_0x432c47,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x34e7b9[_0xf149('0x10')]();}if(_0x366dc2[0x0]==='1'&&(_[_0xf149('0x11')](this[_0xf149('0x12')][_0xf149('0x13')])||!this[_0xf149('0x12')][_0xf149('0x13')])){logger['info'](_0xf149('0xf'),_0x432c47,_0xf149('0x14'));return _0x34e7b9['next']();}if(_0x366dc2[0x0]==='2'&&this[_0xf149('0x12')][_0xf149('0x15')]){logger[_0xf149('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x432c47,_0xf149('0x17'));return _0x34e7b9['next']();}var _0x2590bf={'ContactId':this[_0xf149('0x18')]['id'],'sentAt':moment()[_0xf149('0x19')](_0xf149('0x1a')),'direction':_0xf149('0x1b')};if(this[_0xf149('0xc')]===_0xf149('0xd')){_0x2590bf[_0xf149('0xe')]=utils[_0xf149('0x1c')](_0x366dc2[0x2],this);}else{_0x2590bf[_0xf149('0xe')]=utils[_0xf149('0x1c')](_0x366dc2[0x1],this);}if(this[_0xf149('0x1d')]){_0x2590bf['to']=this[_0xf149('0x1d')][_0xf149('0x1e')]||'';if(this[_0xf149('0xc')]===_0xf149('0xd')&&_0x366dc2[0x1]==='1'){_0x2590bf['cc']=this[_0xf149('0x1d')]['cc']||'';}_0x2590bf[_0xf149('0x1e')]=this[_0xf149('0x1d')]['to']||'';_0x2590bf['phone']=this[_0xf149('0x1d')][_0xf149('0x1f')]||'';_0x2590bf[_0xf149('0x20')]=!![];if(this[_0xf149('0x1d')][_0xf149('0x21')]){_0x2590bf[_0xf149('0x21')]='';_0x2590bf[_0xf149('0x21')]+=_[_0xf149('0x22')](this[_0xf149('0x1d')][_0xf149('0x21')],'Re:')?'':_0xf149('0x23');_0x2590bf['subject']+=this['message']['subject'];}}if(this[_0xf149('0xc')]===_0xf149('0x24')){_0x2590bf[_0xf149('0x25')]=this['account']['id'];}else{_0x2590bf[_[_0xf149('0x26')](this['channel'])+_0xf149('0x27')]=this['account']['id'];}_0x2590bf[_[_0xf149('0x26')](this['channel'])+_0xf149('0x28')]=this[_0xf149('0x12')]['id'];var _0x2f4a82=this[_0xf149('0x12')];if(rpc[this[_0xf149('0xc')]+'Message']){if(this[_0xf149('0xc')]===_0xf149('0xd')){_0x2590bf[_0xf149('0x29')]=this[_0xf149('0x1d')][_0xf149('0x2a')];_0x2590bf[_0xf149('0x2b')]=''+_[_0xf149('0x2c')](_0x2590bf[_0xf149('0xe')],_0xf149('0x2d'),_0xf149('0x2e'))+_0xf149('0x2f');_0x2590bf['headers']={'Auto-Submitted':_0xf149('0x30'),'X-Auto-Response-Suppress':_0xf149('0x31'),'Precedence':_0xf149('0x32')};return mailRpc[_0xf149('0x33')](this[_0xf149('0x34')][_0xf149('0x35')],_0x2590bf)[_0xf149('0x36')](function(_0x5d19ff){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x432c47);_0x2590bf[_0xf149('0x2a')]=_0x5d19ff[_0xf149('0x1d')][_0xf149('0x2a')];return rpc[_0x2730a8+_0xf149('0x37')][_0xf149('0x38')](_0x2590bf);})[_0xf149('0x36')](function(_0x265e94){logger[_0xf149('0x16')](_0xf149('0xf'),_0x432c47,JSON[_0xf149('0x39')](_0x265e94));})[_0xf149('0x3a')](function(_0x309068){logger[_0xf149('0x3b')](_0xf149('0x3c'),_0x432c47,JSON['stringify'](_0x309068));})[_0xf149('0x3d')](function(){Promise[_0xf149('0x3e')]()[_0xf149('0x36')](function(){if(_0x366dc2[0x0]!=='2'||_0x2f4a82[_0xf149('0x15')])return;return rpc[_0x2730a8+_0xf149('0x3f')][_0xf149('0x40')](_0x2f4a82['id'],{'autoreplyExecuted':!![]})[_0xf149('0x36')](function(_0xfbe0f8){logger['info'](_0xf149('0x41'),_0x432c47,JSON['stringify'](_0xfbe0f8));})['catch'](function(_0x2ccf10){logger['error'](_0xf149('0x42'),_0x432c47,JSON['stringify'](_0x2ccf10));});})['then'](function(){_0x34e7b9[_0xf149('0x10')]();});});}else{return rpc[this[_0xf149('0xc')]+'Message'][_0xf149('0x38')](_0x2590bf)[_0xf149('0x36')](function(){logger[_0xf149('0x16')]('[%s][AUTOREPLY]\x20%s',_0x432c47,_0x2590bf[_0xf149('0xe')]);})[_0xf149('0x3a')](function(_0x13f055){logger[_0xf149('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x432c47,JSON[_0xf149('0x39')](_0x13f055));})[_0xf149('0x3d')](function(){Promise['resolve']()['then'](function(){if(_0x366dc2[0x0]!=='2'||_0x2f4a82[_0xf149('0x15')])return;return rpc[_0x2730a8+_0xf149('0x3f')]['update'](_0x2f4a82['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5e9ce8){logger[_0xf149('0x16')](_0xf149('0x41'),_0x432c47,JSON[_0xf149('0x39')](_0x5e9ce8));})[_0xf149('0x3a')](function(_0x4e1ae9){logger[_0xf149('0x3b')](_0xf149('0x42'),_0x432c47,JSON[_0xf149('0x39')](_0x4e1ae9));});})[_0xf149('0x36')](function(){_0x34e7b9[_0xf149('0x10')]();});});}}}catch(_0x5c358f){logger[_0xf149('0x3b')](_0xf149('0xf'),_0x432c47,JSON['stringify'](_0x5c358f));_0x34e7b9[_0xf149('0x43')]();}};}; \ 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 b55ee5f..d4cda05 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 _0xe1d2=['stop','moment','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x453e2f,_0x2cf512){var _0x557b67=function(_0x5a7da4){while(--_0x5a7da4){_0x453e2f['push'](_0x453e2f['shift']());}};_0x557b67(++_0x2cf512);}(_0xe1d2,0x105));var _0x2e1d=function(_0x2b2e14,_0x9d7db0){_0x2b2e14=_0x2b2e14-0x0;var _0x13b47e=_0xe1d2[_0x2b2e14];return _0x13b47e;};'use strict';var moment=require(_0x2e1d('0x0'));var logger=require('../../../../config/logger')(_0x2e1d('0x1'));var rpc={'chatInteraction':require(_0x2e1d('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2e1d('0x3')),'faxInteraction':require(_0x2e1d('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x2e1d('0x5')]=function(_0x247698,_0x284d2c,_0x50bde0,_0x2d933d){return function(_0x1a15ab){try{logger[_0x2e1d('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x247698,_0x284d2c[0x0]);var _0x51484c={'closed':0x1,'closedAt':moment()[_0x2e1d('0x7')](_0x2e1d('0x8')),'closeReason':_0x2e1d('0x9'),'disposition':_0x284d2c[0x0]};if(rpc[_0x2d933d[_0x2e1d('0xa')]+_0x2e1d('0xb')]){rpc[_0x2d933d[_0x2e1d('0xa')]+_0x2e1d('0xb')][_0x2e1d('0xc')](_0x2d933d[_0x2e1d('0xd')]['id'],_0x51484c)['then'](function(_0x2d1b91){logger[_0x2e1d('0x6')](_0x2e1d('0xe'),_0x247698,_0x2d933d[_0x2e1d('0xd')]['id']);})['catch'](function(_0x35a02e){logger[_0x2e1d('0xf')](_0x2e1d('0x10'),_0x247698,JSON[_0x2e1d('0x11')](_0x35a02e));})[_0x2e1d('0x12')](function(){_0x1a15ab[_0x2e1d('0x13')]();});}}catch(_0x51b1d1){logger[_0x2e1d('0xf')](_0x2e1d('0x10'),_0x247698,JSON['stringify'](_0x51b1d1));_0x1a15ab[_0x2e1d('0x13')]();}};}; \ No newline at end of file +var _0xa4db=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x7d1dce,_0x1e6764){var _0x5638e8=function(_0x3566e2){while(--_0x3566e2){_0x7d1dce['push'](_0x7d1dce['shift']());}};_0x5638e8(++_0x1e6764);}(_0xa4db,0xd4));var _0xba4d=function(_0x3b1763,_0x1e3af6){_0x3b1763=_0x3b1763-0x0;var _0x25f39d=_0xa4db[_0x3b1763];return _0x25f39d;};'use strict';var moment=require(_0xba4d('0x0'));var logger=require(_0xba4d('0x1'))(_0xba4d('0x2'));var rpc={'chatInteraction':require(_0xba4d('0x3')),'openchannelInteraction':require(_0xba4d('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xba4d('0x5')),'faxInteraction':require(_0xba4d('0x6')),'whatsappInteraction':require(_0xba4d('0x7'))};exports[_0xba4d('0x8')]=function(_0x5a69c5,_0x1378c2,_0x3b8cc9,_0x394091){return function(_0x3e7612){try{logger[_0xba4d('0x9')](_0xba4d('0xa'),_0x5a69c5,_0x1378c2[0x0]);var _0x562760={'closed':0x1,'closedAt':moment()['format'](_0xba4d('0xb')),'closeReason':_0xba4d('0xc'),'disposition':_0x1378c2[0x0]};if(rpc[_0x394091[_0xba4d('0xd')]+_0xba4d('0xe')]){rpc[_0x394091['channel']+_0xba4d('0xe')][_0xba4d('0xf')](_0x394091[_0xba4d('0x10')]['id'],_0x562760)[_0xba4d('0x11')](function(_0x3e5576){logger[_0xba4d('0x9')](_0xba4d('0x12'),_0x5a69c5,_0x394091[_0xba4d('0x10')]['id']);})[_0xba4d('0x13')](function(_0x14caa4){logger['error']('[%s][CLOSE]\x20%s',_0x5a69c5,JSON[_0xba4d('0x14')](_0x14caa4));})[_0xba4d('0x15')](function(){_0x3e7612[_0xba4d('0x16')]();});}}catch(_0x5abde0){logger[_0xba4d('0x17')]('[%s][CLOSE]\x20%s',_0x5a69c5,JSON[_0xba4d('0x14')](_0x5abde0));_0x3e7612[_0xba4d('0x16')]();}};}; \ 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 24da2f8..400d4ef 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 _0x7e4b=['out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','providerResponse','metadata','endConversation','lodash','moment','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x15e8ac,_0x24a790){var _0x2831f5=function(_0x243639){while(--_0x243639){_0x15e8ac['push'](_0x15e8ac['shift']());}};_0x2831f5(++_0x24a790);}(_0x7e4b,0x84));var _0xb7e4=function(_0x43f04a,_0x2f92ea){_0x43f04a=_0x43f04a-0x0;var _0x55a3b5=_0x7e4b[_0x43f04a];return _0x55a3b5;};'use strict';var _=require(_0xb7e4('0x0'));var moment=require(_0xb7e4('0x1'));var apiai=require('apiai-promise');var md5=require(_0xb7e4('0x2'));var utils=require(_0xb7e4('0x3'));var logger=require('../../../../config/logger')(_0xb7e4('0x4'));var rpc={'chatMessage':require(_0xb7e4('0x5')),'openchannelMessage':require(_0xb7e4('0x6')),'mailMessage':require(_0xb7e4('0x7')),'smsMessage':require(_0xb7e4('0x8')),'faxMessage':require(_0xb7e4('0x9')),'whatsappMessage':require(_0xb7e4('0xa'))};exports[_0xb7e4('0xb')]=function(_0x1d49a7,_0x4ba34c){return function(_0x334af2){try{if(!_['isNil'](this[_0xb7e4('0xc')][_0xb7e4('0xd')])){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0xb7e4('0x10'));return _0x334af2[_0xb7e4('0x11')]();}var _0x1c5eb8={'ContactId':this[_0xb7e4('0x12')]['id'],'sentAt':moment()[_0xb7e4('0x13')](_0xb7e4('0x14')),'direction':_0xb7e4('0x15')};if(this[_0xb7e4('0x16')]===_0xb7e4('0x17')||this['channel']==='whatsapp'){_0x1c5eb8[_0xb7e4('0x18')]=this[_0xb7e4('0xc')]['phone'];}var _0x2e6d47=this[_0xb7e4('0x16')];if(_0x2e6d47===_0xb7e4('0x19')){_0x1c5eb8[_0xb7e4('0x1a')]=this[_0xb7e4('0x1b')]['id'];}else{_0x1c5eb8[_[_0xb7e4('0x1c')](_0x2e6d47)+_0xb7e4('0x1d')]=this[_0xb7e4('0x1b')]['id'];}_0x1c5eb8[_[_0xb7e4('0x1c')](_0x2e6d47)+_0xb7e4('0x1e')]=this[_0xb7e4('0xc')]['id'];if(this[_0xb7e4('0xc')][_0xb7e4('0x1f')]){var _0x3a08f1=_0x4ba34c[0x2];if(!_['isEmpty'](_0x3a08f1)){_0x1c5eb8[_0xb7e4('0x20')]=utils[_0xb7e4('0x21')](_0x3a08f1,this);return rpc[_0x2e6d47+_0xb7e4('0x22')][_0xb7e4('0x23')](_0x1c5eb8)[_0xb7e4('0x24')](function(_0x88906e){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0x1c5eb8[_0xb7e4('0x20')]);})[_0xb7e4('0x25')](function(_0x4ee2f0){logger[_0xb7e4('0x26')](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x4ee2f0));})[_0xb7e4('0x28')](function(){logger[_0xb7e4('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1d49a7);_0x334af2[_0xb7e4('0x29')]();});}else{logger[_0xb7e4('0xe')](_0xb7e4('0x2a'),_0x1d49a7);_0x334af2[_0xb7e4('0x29')]();}}else{var _0x18e4fb=this;var _0xba07f=apiai(_0x4ba34c[0x0],{'language':_0x4ba34c[0x1]||'en'});return _0xba07f['textRequest'](this[_0xb7e4('0x2b')][_0xb7e4('0x20')],{'sessionId':md5(this[_0xb7e4('0xc')]['id'])})[_0xb7e4('0x24')](function(_0x56e2e6){_0x18e4fb[_0xb7e4('0x20')][_0xb7e4('0x2c')]=_0x56e2e6;_0x1c5eb8['body']=_0x56e2e6[_0xb7e4('0x2d')][_0xb7e4('0x2e')][_0xb7e4('0x2f')];_0x1c5eb8['providerName']=_0xb7e4('0x2c');_0x1c5eb8[_0xb7e4('0x30')]=JSON['stringify'](_0x56e2e6);return rpc[_0x2e6d47+_0xb7e4('0x22')][_0xb7e4('0x23')](_0x1c5eb8)['then'](function(_0x1a9d1c){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0x1c5eb8['body']);if(_0x56e2e6[_0xb7e4('0x2d')][_0xb7e4('0x31')][_0xb7e4('0x32')]){_0x334af2[_0xb7e4('0x11')]();}else{_0x334af2[_0xb7e4('0x29')]();}})[_0xb7e4('0x25')](function(_0x2cd691){logger[_0xb7e4('0x26')](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x2cd691));_0x334af2[_0xb7e4('0x11')]();});})[_0xb7e4('0x25')](function(_0x16524e){logger['error'](_0xb7e4('0xf'),_0x1d49a7,_0x16524e[_0xb7e4('0x2b')]);_0x334af2[_0xb7e4('0x11')]();});}}catch(_0x222529){logger['error'](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x222529));_0x334af2[_0xb7e4('0x29')]();}};}; \ No newline at end of file +var _0x0eb2=['metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','result','fulfillment','speech','providerName','providerResponse'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0eb2,0x11c));var _0x20eb=function(_0x313bb5,_0x4e3dd2){_0x313bb5=_0x313bb5-0x0;var _0x24f886=_0x0eb2[_0x313bb5];return _0x24f886;};'use strict';var _=require(_0x20eb('0x0'));var moment=require('moment');var apiai=require(_0x20eb('0x1'));var md5=require(_0x20eb('0x2'));var utils=require(_0x20eb('0x3'));var logger=require(_0x20eb('0x4'))(_0x20eb('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x20eb('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x20eb('0x7'))};exports[_0x20eb('0x8')]=function(_0x19940,_0x4a7e1a){return function(_0x3dfc09){try{if(!_[_0x20eb('0x9')](this[_0x20eb('0xa')][_0x20eb('0xb')])){logger[_0x20eb('0xc')](_0x20eb('0xd'),_0x19940,_0x20eb('0xe'));return _0x3dfc09[_0x20eb('0xf')]();}var _0x354645={'ContactId':this[_0x20eb('0x10')]['id'],'sentAt':moment()[_0x20eb('0x11')](_0x20eb('0x12')),'direction':_0x20eb('0x13')};if(this[_0x20eb('0x14')]==='sms'||this[_0x20eb('0x14')]==='whatsapp'){_0x354645[_0x20eb('0x15')]=this['interaction'][_0x20eb('0x15')];}var _0x438c90=this[_0x20eb('0x14')];if(_0x438c90===_0x20eb('0x16')){_0x354645[_0x20eb('0x17')]=this[_0x20eb('0x18')]['id'];}else{_0x354645[_[_0x20eb('0x19')](_0x438c90)+_0x20eb('0x1a')]=this[_0x20eb('0x18')]['id'];}_0x354645[_[_0x20eb('0x19')](_0x438c90)+_0x20eb('0x1b')]=this[_0x20eb('0xa')]['id'];if(this[_0x20eb('0xa')][_0x20eb('0x1c')]){var _0xc2c994=_0x4a7e1a[0x2];if(!_['isEmpty'](_0xc2c994)){_0x354645[_0x20eb('0x1d')]=utils['getMustacheRender'](_0xc2c994,this);return rpc[_0x438c90+_0x20eb('0x1e')][_0x20eb('0x1f')](_0x354645)[_0x20eb('0x20')](function(_0x3c083a){logger[_0x20eb('0xc')](_0x20eb('0xd'),_0x19940,_0x354645[_0x20eb('0x1d')]);})['catch'](function(_0x1a3089){logger[_0x20eb('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x19940,JSON[_0x20eb('0x22')](_0x1a3089));})[_0x20eb('0x23')](function(){logger['info'](_0x20eb('0x24'),_0x19940);_0x3dfc09[_0x20eb('0x25')]();});}else{logger[_0x20eb('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x19940);_0x3dfc09[_0x20eb('0x25')]();}}else{var _0x258a64=this;var _0x431f82=apiai(_0x4a7e1a[0x0],{'language':_0x4a7e1a[0x1]||'en'});return _0x431f82['textRequest'](this[_0x20eb('0x26')][_0x20eb('0x1d')],{'sessionId':md5(this[_0x20eb('0xa')]['id'])})['then'](function(_0x2a1b56){_0x258a64['body'][_0x20eb('0x27')]=_0x2a1b56;_0x354645[_0x20eb('0x1d')]=_0x2a1b56[_0x20eb('0x28')][_0x20eb('0x29')][_0x20eb('0x2a')];_0x354645[_0x20eb('0x2b')]=_0x20eb('0x27');_0x354645[_0x20eb('0x2c')]=JSON[_0x20eb('0x22')](_0x2a1b56);return rpc[_0x438c90+'Message'][_0x20eb('0x1f')](_0x354645)[_0x20eb('0x20')](function(_0x25a523){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x19940,_0x354645['body']);if(_0x2a1b56['result'][_0x20eb('0x2d')][_0x20eb('0x2e')]){_0x3dfc09['next']();}else{_0x3dfc09[_0x20eb('0x25')]();}})['catch'](function(_0x4547d6){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x19940,JSON[_0x20eb('0x22')](_0x4547d6));_0x3dfc09[_0x20eb('0xf')]();});})['catch'](function(_0x5abe40){logger[_0x20eb('0x21')](_0x20eb('0xd'),_0x19940,_0x5abe40['message']);_0x3dfc09[_0x20eb('0xf')]();});}}catch(_0x25a81e){logger['error'](_0x20eb('0xd'),_0x19940,JSON[_0x20eb('0x22')](_0x25a81e));_0x3dfc09['stop']();}};}; \ 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 8bd0e16..163dc58 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 _0x32ff=['ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','create','then','[%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','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','message','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat'];(function(_0x520062,_0xb840f2){var _0x31e31e=function(_0x203afb){while(--_0x203afb){_0x520062['push'](_0x520062['shift']());}};_0x31e31e(++_0xb840f2);}(_0x32ff,0xc7));var _0xf32f=function(_0x5b3272,_0x590e02){_0x5b3272=_0x5b3272-0x0;var _0x370472=_0x32ff[_0x5b3272];return _0x370472;};'use strict';var _=require(_0xf32f('0x0'));var dialogflow=require(_0xf32f('0x1'));var md5=require(_0xf32f('0x2'));var moment=require(_0xf32f('0x3'));var Promise=require(_0xf32f('0x4'));var logger=require(_0xf32f('0x5'))(_0xf32f('0x6'));var utils=require(_0xf32f('0x7'));var rpc={'chatMessage':require(_0xf32f('0x8')),'openchannelMessage':require(_0xf32f('0x9')),'mailMessage':require(_0xf32f('0xa')),'smsMessage':require(_0xf32f('0xb')),'faxMessage':require(_0xf32f('0xc')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1b688d,_0x4e4d6e,_0x40f495,_0x2756a3){return new Promise(function(_0x23618f,_0x3ebe43){var _0x2e360b=_[_0xf32f('0xd')](_0x40f495);_0x2e360b[_0xf32f('0xe')]=_0x2756a3;return rpc[_0x4e4d6e+_0xf32f('0xf')]['create'](_0x2e360b)['then'](function(){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1b688d,_0x2e360b['body']);_0x23618f();})[_0xf32f('0x11')](function(_0xaa135f){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x1b688d,JSON[_0xf32f('0x14')](_0xaa135f));_0x3ebe43(_0xaa135f);});});}exports[_0xf32f('0x15')]=function(_0x257380,_0x364948){return function(_0x5520fe){try{if(!_['isNil'](this[_0xf32f('0x16')][_0xf32f('0x17')])){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,_0xf32f('0x18'));return _0x5520fe[_0xf32f('0x19')]();}var _0xeec5c={'ContactId':this[_0xf32f('0x1a')]['id'],'sentAt':moment()[_0xf32f('0x1b')](_0xf32f('0x1c')),'direction':'out'};if(this[_0xf32f('0x1d')]==='sms'||this[_0xf32f('0x1d')]==='whatsapp'){_0xeec5c[_0xf32f('0x1e')]=this[_0xf32f('0x16')][_0xf32f('0x1e')];}var _0x369812=this['channel'];if(_0x369812===_0xf32f('0x1f')){_0xeec5c[_0xf32f('0x20')]=this['account']['id'];}else{_0xeec5c[_[_0xf32f('0x21')](_0x369812)+_0xf32f('0x22')]=this['account']['id'];}_0xeec5c[_[_0xf32f('0x21')](_0x369812)+_0xf32f('0x23')]=this[_0xf32f('0x16')]['id'];if(this[_0xf32f('0x16')][_0xf32f('0x24')]){var _0x4699b4=_0x364948[0x4];if(!_[_0xf32f('0x25')](_0x4699b4)){_0xeec5c[_0xf32f('0xe')]=utils['getMustacheRender'](_0x4699b4,this);return rpc[_0x369812+_0xf32f('0xf')][_0xf32f('0x26')](_0xeec5c)[_0xf32f('0x27')](function(_0x27007d){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,_0xeec5c[_0xf32f('0xe')]);})['catch'](function(_0x2dd1e4){logger[_0xf32f('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,JSON['stringify'](_0x2dd1e4));})['finally'](function(){logger[_0xf32f('0x10')](_0xf32f('0x28'),_0x257380);_0x5520fe[_0xf32f('0x29')]();});}else{logger[_0xf32f('0x10')](_0xf32f('0x2a'),_0x257380);_0x5520fe[_0xf32f('0x29')]();}}else{var _0x1e504f=this;var _0x26bcee=_0x364948[0x2][_0xf32f('0x2b')](/\\n/g,'\x0a');var _0xf409ed={'credentials':{'private_key':_0x26bcee,'client_email':_0x364948[0x1]}};var _0x328c15=new dialogflow[(_0xf32f('0x2c'))](_0xf409ed);var _0x4f9feb=_0x328c15[_0xf32f('0x2d')](_0x364948[0x0],md5(_0x1e504f[_0xf32f('0x16')]['id']));var _0x375e57={'session':_0x4f9feb,'queryInput':{'text':{'text':_0x1e504f['message'][_0xf32f('0xe')],'languageCode':_0x364948[0x3]||'en'}}};return _0x328c15[_0xf32f('0x2e')](_0x375e57)[_0xf32f('0x27')](function(_0x165ea1){if(_0x165ea1&&_0x165ea1[_0xf32f('0x2f')]){_0x1e504f[_0xf32f('0xe')][_0xf32f('0x30')]=_0x165ea1;var _0x51c0da=_0x165ea1[0x0];var _0x83d503=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]&&_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]['fields']?_0x51c0da[_0xf32f('0x31')]['diagnosticInfo']['fields'][_0xf32f('0x33')][_0xf32f('0x34')]:![];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x35')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x36')];_0x1e504f['body'][_0xf32f('0x37')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x38')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x39')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]&&_0x51c0da[_0xf32f('0x31')]['diagnosticInfo'][_0xf32f('0x3a')]?_0x51c0da[_0xf32f('0x31')]['diagnosticInfo'][_0xf32f('0x3a')][_0xf32f('0x33')][_0xf32f('0x34')]:![];_0x1e504f['body'][_0xf32f('0x3b')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x3d')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x3e')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x3f')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x40')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x41')];_0x1e504f[_0xf32f('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x42')];_0x1e504f['body'][_0xf32f('0x43')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x44')];_0x1e504f['body'][_0xf32f('0x45')]=_0x51c0da['queryResult'][_0xf32f('0x46')];_0xeec5c[_0xf32f('0x47')]='dialogflowV2';_0xeec5c[_0xf32f('0x48')]=JSON[_0xf32f('0x14')](_0x165ea1);var _0x550730=[];for(var _0x563f1a=0x0;_0x563f1a<_0x165ea1[_0xf32f('0x2f')];_0x563f1a++){var _0x388b34=_0x165ea1[_0x563f1a];if(_0x388b34&&_0x388b34[_0xf32f('0x31')]&&_0x388b34[_0xf32f('0x31')][_0xf32f('0x49')]){_0x550730[_0xf32f('0x4a')](createMessage(_0x257380,_0x369812,_0xeec5c,_0x388b34[_0xf32f('0x31')]['fulfillmentText']));}}return Promise[_0xf32f('0x4b')](_0x550730)['then'](function(){if(_0x83d503){_0x5520fe[_0xf32f('0x19')]();}else{_0x5520fe[_0xf32f('0x29')]();}})[_0xf32f('0x11')](function(_0x2c2f9f){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x257380,JSON[_0xf32f('0x14')](_0x2c2f9f));_0x5520fe[_0xf32f('0x19')]();});}})[_0xf32f('0x11')](function(_0x2f435d){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x257380,_0x2f435d[_0xf32f('0x4c')]);_0x5520fe[_0xf32f('0x19')]();});}}catch(_0x40faaa){logger['error'](_0xf32f('0x13'),_0x257380,JSON[_0xf32f('0x14')](_0x40faaa));_0x5520fe[_0xf32f('0x29')]();}};}; \ No newline at end of file +var _0xa181=['stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerResponse','fulfillmentText','push','all','next','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error'];(function(_0x434ddc,_0x1f9e59){var _0x283bf5=function(_0x5df633){while(--_0x5df633){_0x434ddc['push'](_0x434ddc['shift']());}};_0x283bf5(++_0x1f9e59);}(_0xa181,0x10a));var _0x1a18=function(_0x2a370e,_0x4c23ae){_0x2a370e=_0x2a370e-0x0;var _0x56f03d=_0xa181[_0x2a370e];return _0x56f03d;};'use strict';var _=require(_0x1a18('0x0'));var dialogflow=require(_0x1a18('0x1'));var md5=require(_0x1a18('0x2'));var moment=require('moment');var Promise=require(_0x1a18('0x3'));var logger=require(_0x1a18('0x4'))(_0x1a18('0x5'));var utils=require(_0x1a18('0x6'));var rpc={'chatMessage':require(_0x1a18('0x7')),'openchannelMessage':require(_0x1a18('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1a18('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1a18('0xa'))};function createMessage(_0x33ac27,_0x34f730,_0x436a14,_0x49e0ab){return new Promise(function(_0x394289,_0x1acc97){var _0x25d440=_['clone'](_0x436a14);_0x25d440[_0x1a18('0xb')]=_0x49e0ab;return rpc[_0x34f730+_0x1a18('0xc')]['create'](_0x25d440)[_0x1a18('0xd')](function(){logger[_0x1a18('0xe')](_0x1a18('0xf'),_0x33ac27,_0x25d440[_0x1a18('0xb')]);_0x394289();})[_0x1a18('0x10')](function(_0x53c22c){logger[_0x1a18('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x33ac27,JSON[_0x1a18('0x12')](_0x53c22c));_0x1acc97(_0x53c22c);});});}exports[_0x1a18('0x13')]=function(_0x4ef94e,_0x12c34d){return function(_0x4ea0eb){try{if(!_[_0x1a18('0x14')](this[_0x1a18('0x15')]['UserId'])){logger[_0x1a18('0xe')](_0x1a18('0xf'),_0x4ef94e,_0x1a18('0x16'));return _0x4ea0eb['next']();}var _0x2785f6={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1a18('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1a18('0x18')};if(this['channel']===_0x1a18('0x19')||this['channel']===_0x1a18('0x1a')){_0x2785f6[_0x1a18('0x1b')]=this[_0x1a18('0x15')][_0x1a18('0x1b')];}var _0x47dd3e=this['channel'];if(_0x47dd3e==='chat'){_0x2785f6[_0x1a18('0x1c')]=this[_0x1a18('0x1d')]['id'];}else{_0x2785f6[_[_0x1a18('0x1e')](_0x47dd3e)+_0x1a18('0x1f')]=this[_0x1a18('0x1d')]['id'];}_0x2785f6[_[_0x1a18('0x1e')](_0x47dd3e)+'InteractionId']=this[_0x1a18('0x15')]['id'];if(this[_0x1a18('0x15')][_0x1a18('0x20')]){var _0x312669=_0x12c34d[0x4];if(!_[_0x1a18('0x21')](_0x312669)){_0x2785f6[_0x1a18('0xb')]=utils[_0x1a18('0x22')](_0x312669,this);return rpc[_0x47dd3e+_0x1a18('0xc')][_0x1a18('0x23')](_0x2785f6)[_0x1a18('0xd')](function(_0xb4a0b8){logger[_0x1a18('0xe')](_0x1a18('0xf'),_0x4ef94e,_0x2785f6[_0x1a18('0xb')]);})[_0x1a18('0x10')](function(_0x27932b){logger[_0x1a18('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x4ef94e,JSON[_0x1a18('0x12')](_0x27932b));})[_0x1a18('0x24')](function(){logger[_0x1a18('0xe')](_0x1a18('0x25'),_0x4ef94e);_0x4ea0eb[_0x1a18('0x26')]();});}else{logger[_0x1a18('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4ef94e);_0x4ea0eb[_0x1a18('0x26')]();}}else{var _0x36e016=this;var _0x11d1e3=_0x12c34d[0x2][_0x1a18('0x27')](/\\n/g,'\x0a');var _0x54f60e={'credentials':{'private_key':_0x11d1e3,'client_email':_0x12c34d[0x1]}};var _0x3ea0b7=new dialogflow[(_0x1a18('0x28'))](_0x54f60e);var _0x299277=_0x3ea0b7[_0x1a18('0x29')](_0x12c34d[0x0],md5(_0x36e016[_0x1a18('0x15')]['id']));var _0x855cca={'session':_0x299277,'queryInput':{'text':{'text':_0x36e016[_0x1a18('0x2a')][_0x1a18('0xb')],'languageCode':_0x12c34d[0x3]||'en'}}};return _0x3ea0b7[_0x1a18('0x2b')](_0x855cca)[_0x1a18('0xd')](function(_0x3b566e){if(_0x3b566e&&_0x3b566e[_0x1a18('0x2c')]){_0x36e016[_0x1a18('0xb')][_0x1a18('0x2d')]=_0x3b566e;var _0x337130=_0x3b566e[0x0];var _0x54b624=_0x337130[_0x1a18('0x2e')]['diagnosticInfo']&&_0x337130[_0x1a18('0x2e')][_0x1a18('0x2f')]['fields']?_0x337130['queryResult']['diagnosticInfo'][_0x1a18('0x30')][_0x1a18('0x31')][_0x1a18('0x32')]:![];_0x36e016[_0x1a18('0xb')][_0x1a18('0x33')]=_0x337130[_0x1a18('0x2e')][_0x1a18('0x34')];_0x36e016[_0x1a18('0xb')][_0x1a18('0x35')]=_0x337130[_0x1a18('0x2e')]['allRequiredParamsPresent'];_0x36e016['body'][_0x1a18('0x36')]=_0x337130[_0x1a18('0x2e')][_0x1a18('0x2f')]&&_0x337130[_0x1a18('0x2e')][_0x1a18('0x2f')]['fields']?_0x337130['queryResult'][_0x1a18('0x2f')][_0x1a18('0x30')][_0x1a18('0x31')][_0x1a18('0x32')]:![];_0x36e016['body'][_0x1a18('0x37')]=_0x337130[_0x1a18('0x2e')]['intent'][_0x1a18('0x38')];_0x36e016['body'][_0x1a18('0x39')]=_0x337130[_0x1a18('0x2e')][_0x1a18('0x3a')][_0x1a18('0x3b')];_0x36e016[_0x1a18('0xb')][_0x1a18('0x3c')]=_0x337130[_0x1a18('0x2e')][_0x1a18('0x3a')][_0x1a18('0x3d')];_0x36e016[_0x1a18('0xb')][_0x1a18('0x3e')]=_0x337130[_0x1a18('0x2e')][_0x1a18('0x3f')];_0x36e016[_0x1a18('0xb')][_0x1a18('0x40')]=_0x337130['queryResult']['queryText'];_0x36e016['body'][_0x1a18('0x41')]=_0x337130[_0x1a18('0x2e')]['intentDetectionConfidence'];_0x2785f6['providerName']=_0x1a18('0x2d');_0x2785f6[_0x1a18('0x42')]=JSON[_0x1a18('0x12')](_0x3b566e);var _0x5232f9=[];for(var _0x6a6f51=0x0;_0x6a6f51<_0x3b566e[_0x1a18('0x2c')];_0x6a6f51++){var _0x5300ca=_0x3b566e[_0x6a6f51];if(_0x5300ca&&_0x5300ca[_0x1a18('0x2e')]&&_0x5300ca['queryResult'][_0x1a18('0x43')]){_0x5232f9[_0x1a18('0x44')](createMessage(_0x4ef94e,_0x47dd3e,_0x2785f6,_0x5300ca[_0x1a18('0x2e')][_0x1a18('0x43')]));}}return Promise[_0x1a18('0x45')](_0x5232f9)[_0x1a18('0xd')](function(){if(_0x54b624){_0x4ea0eb[_0x1a18('0x46')]();}else{_0x4ea0eb['stop']();}})[_0x1a18('0x10')](function(_0x33d6e7){logger[_0x1a18('0x11')](_0x1a18('0xf'),_0x4ef94e,JSON[_0x1a18('0x12')](_0x33d6e7));_0x4ea0eb[_0x1a18('0x46')]();});}})['catch'](function(_0x124498){logger['error'](_0x1a18('0xf'),_0x4ef94e,_0x124498['message']);_0x4ea0eb[_0x1a18('0x46')]();});}}catch(_0x42a8c2){logger[_0x1a18('0x11')](_0x1a18('0xf'),_0x4ef94e,JSON[_0x1a18('0x12')](_0x42a8c2));_0x4ea0eb['stop']();}};}; \ 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 ec626b3..1647476 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 _0xb041=['getMustacheRender','replace','validate','length','error','map','message','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString'];(function(_0x56ee34,_0x3cf604){var _0x1a27c2=function(_0x45626d){while(--_0x45626d){_0x56ee34['push'](_0x56ee34['shift']());}};_0x1a27c2(++_0x3cf604);}(_0xb041,0x12a));var _0x1b04=function(_0x3d1dc8,_0x10c198){_0x3d1dc8=_0x3d1dc8-0x0;var _0x4f0d1e=_0xb041[_0x3d1dc8];return _0x4f0d1e;};'use strict';var schema=require('validate');var _=require(_0x1b04('0x0'));var htmlToText=require(_0x1b04('0x1'));var utils=require('./utils');var logger=require(_0x1b04('0x2'))(_0x1b04('0x3'));var gotoif=schema({'condition':{'type':_0x1b04('0x4'),'required':!![],'message':_0x1b04('0x5')},'priorityTrue':{'type':_0x1b04('0x6'),'message':_0x1b04('0x7')},'priorityFalse':{'type':_0x1b04('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x1b04('0x8')]=function(_0x32e8ec,_0x3d015c){return function(_0x3c4b0f){try{var _0x550d4a={'condition':htmlToText[_0x1b04('0x9')](utils[_0x1b04('0xa')](_0x3d015c[0x0],this),{'wordwrap':![]})[_0x1b04('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3d015c[0x1],'priorityFalse':_0x3d015c[0x2]};var _0x20f9dd=gotoif[_0x1b04('0xc')](_0x550d4a,{'typecast':!![]});if(_0x20f9dd[_0x1b04('0xd')]){logger[_0x1b04('0xe')]('[%s][GOTOIF]\x20%s',_0x32e8ec,_[_0x1b04('0xf')](_0x20f9dd,_0x1b04('0x10'))['join'](',\x20'));_0x3c4b0f[_0x1b04('0x11')]();}else{try{var _0x2df6ce=eval('('+_0x550d4a[_0x1b04('0x12')]+')');var _0x4ade56=_0x2df6ce?_0x550d4a['priorityTrue']:_0x550d4a[_0x1b04('0x13')];logger[_0x1b04('0x14')](_0x1b04('0x15'),_0x32e8ec,_0x550d4a[_0x1b04('0x12')],_0x2df6ce,_0x4ade56||_0x1b04('0x16'));if(_0x4ade56){var _0x51eaa8=_[_0x1b04('0x17')](_0x3c4b0f[_0x1b04('0x18')](),{'p':_0x4ade56});if(_0x51eaa8>=0x0){logger[_0x1b04('0x14')](_0x1b04('0x19'),_0x32e8ec,_0x4ade56||'next',_0x51eaa8);_0x3c4b0f[_0x1b04('0x16')](_0x51eaa8);}else{logger[_0x1b04('0x14')](_0x1b04('0x1a'),_0x32e8ec,_0x4ade56||_0x1b04('0x16'));_0x3c4b0f[_0x1b04('0x11')]();}}else{_0x3c4b0f[_0x1b04('0x16')]();}}catch(_0x1581b6){logger[_0x1b04('0xe')](_0x1b04('0x1b'),_0x32e8ec,_0x1581b6[_0x1b04('0x10')]);_0x3c4b0f[_0x1b04('0x11')]();}}}catch(_0x1565f){logger[_0x1b04('0xe')]('[%s][GOTOIF]\x20%s',_0x32e8ec,JSON['stringify'](_0x1565f));_0x3c4b0f[_0x1b04('0x11')]();}};}; \ No newline at end of file +var _0x2ee9=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify'];(function(_0x4040cf,_0x5f0a83){var _0x19c295=function(_0x5c70f0){while(--_0x5c70f0){_0x4040cf['push'](_0x4040cf['shift']());}};_0x19c295(++_0x5f0a83);}(_0x2ee9,0x160));var _0x92ee=function(_0x3065de,_0x57fedd){_0x3065de=_0x3065de-0x0;var _0x31a573=_0x2ee9[_0x3065de];return _0x31a573;};'use strict';var schema=require('validate');var _=require(_0x92ee('0x0'));var htmlToText=require(_0x92ee('0x1'));var utils=require(_0x92ee('0x2'));var logger=require(_0x92ee('0x3'))(_0x92ee('0x4'));var gotoif=schema({'condition':{'type':_0x92ee('0x5'),'required':!![],'message':_0x92ee('0x6')},'priorityTrue':{'type':_0x92ee('0x7'),'message':_0x92ee('0x8')},'priorityFalse':{'type':_0x92ee('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x92ee('0x9')]=function(_0x1e3b0d,_0x5a226d){return function(_0x3a0851){try{var _0x1a8d35={'condition':htmlToText[_0x92ee('0xa')](utils['getMustacheRender'](_0x5a226d[0x0],this),{'wordwrap':![]})[_0x92ee('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5a226d[0x1],'priorityFalse':_0x5a226d[0x2]};var _0x37878e=gotoif[_0x92ee('0xc')](_0x1a8d35,{'typecast':!![]});if(_0x37878e[_0x92ee('0xd')]){logger[_0x92ee('0xe')](_0x92ee('0xf'),_0x1e3b0d,_[_0x92ee('0x10')](_0x37878e,_0x92ee('0x11'))[_0x92ee('0x12')](',\x20'));_0x3a0851['stop']();}else{try{var _0x44e5b2=eval('('+_0x1a8d35['condition']+')');var _0x31f7e2=_0x44e5b2?_0x1a8d35[_0x92ee('0x13')]:_0x1a8d35[_0x92ee('0x14')];logger[_0x92ee('0x15')](_0x92ee('0x16'),_0x1e3b0d,_0x1a8d35[_0x92ee('0x17')],_0x44e5b2,_0x31f7e2||_0x92ee('0x18'));if(_0x31f7e2){var _0x2bac43=_[_0x92ee('0x19')](_0x3a0851[_0x92ee('0x1a')](),{'p':_0x31f7e2});if(_0x2bac43>=0x0){logger[_0x92ee('0x15')](_0x92ee('0x1b'),_0x1e3b0d,_0x31f7e2||_0x92ee('0x18'),_0x2bac43);_0x3a0851[_0x92ee('0x18')](_0x2bac43);}else{logger[_0x92ee('0x15')](_0x92ee('0x1c'),_0x1e3b0d,_0x31f7e2||'next');_0x3a0851[_0x92ee('0x1d')]();}}else{_0x3a0851[_0x92ee('0x18')]();}}catch(_0x370dca){logger[_0x92ee('0xe')](_0x92ee('0x1e'),_0x1e3b0d,_0x370dca[_0x92ee('0x11')]);_0x3a0851[_0x92ee('0x1d')]();}}}catch(_0x2c7849){logger[_0x92ee('0xe')]('[%s][GOTOIF]\x20%s',_0x1e3b0d,JSON[_0x92ee('0x1f')](_0x2c7849));_0x3a0851[_0x92ee('0x1d')]();}};}; \ 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 a8a5756..96a8c75 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 _0x9025=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x9025,0x1ce));var _0x5902=function(_0x30d19e,_0x46b59e){_0x30d19e=_0x30d19e-0x0;var _0xfbfa63=_0x9025[_0x30d19e];return _0xfbfa63;};'use strict';var schema=require(_0x5902('0x0'));var _=require('lodash');var logger=require(_0x5902('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5902('0x2')}});exports[_0x5902('0x3')]=function(_0x2f1fd4,_0x149fa9){return function(_0x1af4b5){try{var _0x3382d8={'priority':_0x149fa9[0x0]};var _0x492ecb=gotop[_0x5902('0x0')](_0x3382d8,{'typecast':!![]});if(_0x492ecb[_0x5902('0x4')]){logger[_0x5902('0x5')](_0x5902('0x6'),_0x2f1fd4,_['map'](_0x492ecb,_0x5902('0x7'))[_0x5902('0x8')](',\x20'));_0x1af4b5[_0x5902('0x9')]();}else{logger[_0x5902('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x2f1fd4,_0x3382d8[_0x5902('0xb')]);if(_0x3382d8['priority']){var _0x48c719=_[_0x5902('0xc')](_0x1af4b5[_0x5902('0xd')](),{'p':_0x3382d8['priority']});if(_0x48c719>=0x0){logger[_0x5902('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2f1fd4,_0x3382d8[_0x5902('0xb')]||_0x5902('0xe'),_0x48c719);_0x1af4b5[_0x5902('0xe')](_0x48c719);}else{logger[_0x5902('0xa')](_0x5902('0xf'),_0x2f1fd4,_0x3382d8[_0x5902('0xb')]||_0x5902('0xe'));_0x1af4b5['stop']();}}else{_0x1af4b5[_0x5902('0xe')]();}}}catch(_0x57adba){logger['error'](_0x5902('0x6'),_0x2f1fd4,JSON['stringify'](_0x57adba));_0x1af4b5['stop']();}};}; \ No newline at end of file +var _0xb57e=['consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x1c3e42,_0x1a4fe9){var _0x348fdc=function(_0x597394){while(--_0x597394){_0x1c3e42['push'](_0x1c3e42['shift']());}};_0x348fdc(++_0x1a4fe9);}(_0xb57e,0xd8));var _0xeb57=function(_0xa23e1a,_0x21327c){_0xa23e1a=_0xa23e1a-0x0;var _0x16bbc9=_0xb57e[_0xa23e1a];return _0x16bbc9;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xeb57('0x0'))(_0xeb57('0x1'));var gotop=schema({'priority':{'type':_0xeb57('0x2'),'required':!![],'message':_0xeb57('0x3')}});exports[_0xeb57('0x4')]=function(_0x5aee5b,_0x1bb7a3){return function(_0x305357){try{var _0x40ccc7={'priority':_0x1bb7a3[0x0]};var _0x54c98a=gotop[_0xeb57('0x5')](_0x40ccc7,{'typecast':!![]});if(_0x54c98a[_0xeb57('0x6')]){logger[_0xeb57('0x7')](_0xeb57('0x8'),_0x5aee5b,_[_0xeb57('0x9')](_0x54c98a,_0xeb57('0xa'))[_0xeb57('0xb')](',\x20'));_0x305357[_0xeb57('0xc')]();}else{logger[_0xeb57('0xd')](_0xeb57('0xe'),_0x5aee5b,_0x40ccc7[_0xeb57('0xf')]);if(_0x40ccc7[_0xeb57('0xf')]){var _0x3029aa=_['findIndex'](_0x305357[_0xeb57('0x10')](),{'p':_0x40ccc7[_0xeb57('0xf')]});if(_0x3029aa>=0x0){logger[_0xeb57('0xd')](_0xeb57('0x11'),_0x5aee5b,_0x40ccc7[_0xeb57('0xf')]||_0xeb57('0x12'),_0x3029aa);_0x305357[_0xeb57('0x12')](_0x3029aa);}else{logger[_0xeb57('0xd')](_0xeb57('0x13'),_0x5aee5b,_0x40ccc7[_0xeb57('0xf')]||'next');_0x305357[_0xeb57('0xc')]();}}else{_0x305357[_0xeb57('0x12')]();}}}catch(_0x494777){logger['error']('[%s][GOTOP]\x20%s',_0x5aee5b,JSON['stringify'](_0x494777));_0x305357[_0xeb57('0xc')]();}};}; \ 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 abacbb2..3dfe110 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 _0x29b1=['[%s][MESSAGE]\x20%s','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','AccountId','InteractionId','Message','info','body','next','catch','error','stringify','stop'];(function(_0x289583,_0x484d16){var _0x5b0c07=function(_0x1cc0d1){while(--_0x1cc0d1){_0x289583['push'](_0x289583['shift']());}};_0x5b0c07(++_0x484d16);}(_0x29b1,0x16d));var _0x129b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x29b1[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x129b('0x0'));var utils=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var rpc={'chatMessage':require(_0x129b('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x129b('0x5')),'smsMessage':require(_0x129b('0x6')),'faxMessage':require(_0x129b('0x7')),'whatsappMessage':require(_0x129b('0x8'))};exports[_0x129b('0x9')]=function(_0x3bf771,_0x31e428){return function(_0xe27ed4){try{var _0x5ce8f9={'body':utils[_0x129b('0xa')](_0x31e428[0x0],this),'ContactId':this['contact']['id']};if(this[_0x129b('0xb')]===_0x129b('0xc')){_0x5ce8f9['ChatWebsiteId']=this[_0x129b('0xd')]['id'];}else{_0x5ce8f9[_[_0x129b('0xe')](this['channel'])+_0x129b('0xf')]=this['account']['id'];}_0x5ce8f9[_[_0x129b('0xe')](this[_0x129b('0xb')])+_0x129b('0x10')]=this['interaction']['id'];if(rpc[this[_0x129b('0xb')]+_0x129b('0x11')]){return rpc[this[_0x129b('0xb')]+_0x129b('0x11')]['create'](_0x5ce8f9)['then'](function(_0x4cc6ee){logger[_0x129b('0x12')]('[%s][MESSAGE]\x20%s',_0x3bf771,_0x5ce8f9[_0x129b('0x13')]);_0xe27ed4[_0x129b('0x14')]();})[_0x129b('0x15')](function(_0x52137c){logger[_0x129b('0x16')]('[%s][MESSAGE]\x20%s',_0x3bf771,JSON[_0x129b('0x17')](_0x52137c));_0xe27ed4[_0x129b('0x18')]();});}}catch(_0x17fff2){logger['error'](_0x129b('0x19'),_0x3bf771,JSON[_0x129b('0x17')](_0x17fff2));_0xe27ed4[_0x129b('0x18')]();}};}; \ No newline at end of file +var _0x4899=['chat','account','upperFirst','AccountId','channel','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','stop','error','stringify','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0x4899,0x74));var _0x9489=function(_0xe719da,_0x4fe71b){_0xe719da=_0xe719da-0x0;var _0x494282=_0x4899[_0xe719da];return _0x494282;};'use strict';var _=require(_0x9489('0x0'));var utils=require('./utils');var logger=require(_0x9489('0x1'))('routing');var rpc={'chatMessage':require(_0x9489('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9489('0x3')),'smsMessage':require(_0x9489('0x4')),'faxMessage':require(_0x9489('0x5')),'whatsappMessage':require(_0x9489('0x6'))};exports[_0x9489('0x7')]=function(_0x49173a,_0x99c731){return function(_0x3d7499){try{var _0x411ebe={'body':utils[_0x9489('0x8')](_0x99c731[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x9489('0x9')){_0x411ebe['ChatWebsiteId']=this[_0x9489('0xa')]['id'];}else{_0x411ebe[_[_0x9489('0xb')](this['channel'])+_0x9489('0xc')]=this[_0x9489('0xa')]['id'];}_0x411ebe[_[_0x9489('0xb')](this[_0x9489('0xd')])+_0x9489('0xe')]=this[_0x9489('0xf')]['id'];if(rpc[this[_0x9489('0xd')]+_0x9489('0x10')]){return rpc[this['channel']+_0x9489('0x10')][_0x9489('0x11')](_0x411ebe)[_0x9489('0x12')](function(_0x5de484){logger['info'](_0x9489('0x13'),_0x49173a,_0x411ebe[_0x9489('0x14')]);_0x3d7499[_0x9489('0x15')]();})['catch'](function(_0x402022){logger['error'](_0x9489('0x13'),_0x49173a,JSON['stringify'](_0x402022));_0x3d7499[_0x9489('0x16')]();});}}catch(_0x18a0aa){logger[_0x9489('0x17')](_0x9489('0x13'),_0x49173a,JSON[_0x9489('0x18')](_0x18a0aa));_0x3d7499['stop']();}};}; \ 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 02cba79..415660d 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 _0xd5b7=['consequence','info','[%s][NOOP]\x20%s','next','error','stop','./utils','../../../../config/logger'];(function(_0x99378a,_0x35ca3a){var _0x55a2db=function(_0x4f4868){while(--_0x4f4868){_0x99378a['push'](_0x99378a['shift']());}};_0x55a2db(++_0x35ca3a);}(_0xd5b7,0x1de));var _0x7d5b=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xd5b7[_0x589aee];return _0x2f5ed4;};'use strict';var utils=require(_0x7d5b('0x0'));var logger=require(_0x7d5b('0x1'))('routing');exports[_0x7d5b('0x2')]=function(_0x342321,_0x2204a7){return function(_0x582b55){try{logger[_0x7d5b('0x3')](_0x7d5b('0x4'),_0x342321,utils['getMustacheRender'](_0x2204a7[0x0],this));_0x582b55[_0x7d5b('0x5')]();}catch(_0x1f786b){logger[_0x7d5b('0x6')]('[%s][NOOP]\x20%s',_0x342321,JSON['stringify'](_0x1f786b));_0x582b55[_0x7d5b('0x7')]();}};}; \ No newline at end of file +var _0x10ea=['[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','consequence','getMustacheRender','next','error'];(function(_0x366901,_0x18ccb2){var _0x4e3979=function(_0x105622){while(--_0x105622){_0x366901['push'](_0x366901['shift']());}};_0x4e3979(++_0x18ccb2);}(_0x10ea,0xae));var _0xa10e=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x10ea[_0x30bd4d];return _0x306915;};'use strict';var utils=require(_0xa10e('0x0'));var logger=require(_0xa10e('0x1'))('routing');exports[_0xa10e('0x2')]=function(_0x2b45fd,_0x4e3559){return function(_0x595431){try{logger['info']('[%s][NOOP]\x20%s',_0x2b45fd,utils[_0xa10e('0x3')](_0x4e3559[0x0],this));_0x595431[_0xa10e('0x4')]();}catch(_0x563d66){logger[_0xa10e('0x5')](_0xa10e('0x6'),_0x2b45fd,JSON[_0xa10e('0x7')](_0x563d66));_0x595431[_0xa10e('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 29cb0c4..a6d3085 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 _0x7f10=['clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','error','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit'];(function(_0x4b775b,_0x2b7978){var _0xabbc70=function(_0x5831be){while(--_0x5831be){_0x4b775b['push'](_0x4b775b['shift']());}};_0xabbc70(++_0x2b7978);}(_0x7f10,0x136));var _0x07f1=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x7f10[_0xe24fc0];return _0x185c6b;};'use strict';var schema=require(_0x07f1('0x0'));var _=require(_0x07f1('0x1'));var util=require('util');var seqqueue=require(_0x07f1('0x2'));var moment=require(_0x07f1('0x3'));var Redis=require(_0x07f1('0x4'));var config=require(_0x07f1('0x5'));var logger=require(_0x07f1('0x6'))(_0x07f1('0x7'));var strategy=require(_0x07f1('0x8'));config[_0x07f1('0x9')]=_[_0x07f1('0xa')](config['redis'],{'host':_0x07f1('0xb'),'port':0x18eb});var io=require(_0x07f1('0xc'))(new Redis(config[_0x07f1('0x9')]));var attributes=['id',_0x07f1('0xd'),_0x07f1('0xe'),'queue',_0x07f1('0xf'),_0x07f1('0x10')];function emit(_0x44b33a,_0x54dc77,_0x4ef160){io['to'](_0x44b33a)[_0x07f1('0x11')](_0x54dc77,_0x4ef160);}function emitChannelQueueInteraction(_0x3196bf,_0x19a4a0,_0x2c17de,_0x4f5f40,_0x38ced2,_0x59c45a,_0x48f058,_0x22fc34){var _0x56aec7=_[_0x07f1('0x12')](_0x2c17de);_0x56aec7[_0x07f1('0xd')]=_0x22fc34;_0x56aec7['queue']=_0x19a4a0;_0x56aec7[_0x07f1('0xe')]=_0x4f5f40;_0x56aec7['id']=_0x38ced2;if(_0x59c45a){attributes[_0x07f1('0x13')](_['capitalize'](_0x3196bf)+_0x07f1('0x14'));_0x48f058[util[_0x07f1('0x15')](_0x07f1('0x16'),_0x3196bf)][_0x38ced2]=_[_0x07f1('0x17')](_0x56aec7,attributes);}else{delete _0x48f058[util[_0x07f1('0x15')](_0x07f1('0x16'),_0x3196bf)][_0x38ced2];}emit(util[_0x07f1('0x15')]('%s:queue:%s',_0x3196bf,_0x19a4a0),util['format'](_0x07f1('0x18'),_0x3196bf,_0x59c45a?_0x07f1('0x19'):_0x07f1('0x1a')),_[_0x07f1('0x17')](_0x56aec7,attributes));}var rpc={'openchannelQueueReport':require(_0x07f1('0x1b')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x07f1('0x1c')),'smsQueueReport':require(_0x07f1('0x1d')),'faxQueueReport':require(_0x07f1('0x1e')),'whatsappQueueReport':require(_0x07f1('0x1f'))};var queue=schema({'name':{'type':_0x07f1('0x20'),'required':!![],'message':_0x07f1('0x21')},'timeout':{'type':_0x07f1('0x22'),'message':_0x07f1('0x23')}});function startRouting(_0x148681,_0x584c45,_0x340c06,_0x22fd32){if(_0x148681&&_0x584c45&&_0x340c06){_0x584c45['waiting']+=0x1;var _0x4d9e7b={'uniqueid':_0x148681,'from':_0x340c06[_0x07f1('0x24')]?_0x340c06[_0x07f1('0x24')][_0x07f1('0xf')]:'','joinAt':moment()['format'](_0x07f1('0x25')),'ContactId':_0x340c06[_0x07f1('0x26')]?_0x340c06['contact']['id']:null,'ListId':_0x340c06['list']?_0x340c06['list']['id']:null};_0x4d9e7b[_[_0x07f1('0x27')](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x29')]=_0x584c45['id']||null;_0x4d9e7b[_[_0x07f1('0x27')](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x14')]=_0x340c06[_0x07f1('0x2a')]?_0x340c06[_0x07f1('0x2a')]['id']:null;_0x4d9e7b[_['upperFirst'](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x2b')]=_0x340c06[_0x07f1('0x2c')]?_0x340c06['message']['id']:null;_0x4d9e7b[_['upperFirst'](_0x340c06[_0x07f1('0x28')])+(_0x340c06[_0x07f1('0x28')]!==_0x07f1('0x2d')?_0x07f1('0x2e'):'WebsiteId')]=_0x340c06[_0x07f1('0xe')]?_0x340c06[_0x07f1('0xe')]['id']:null;logger[_0x07f1('0x2f')](util[_0x07f1('0x15')](_0x07f1('0x30'),_0x148681,_0x584c45[_0x07f1('0x31')]));emitChannelQueueInteraction(_0x340c06[_0x07f1('0x28')],_0x584c45[_0x07f1('0x31')],_0x4d9e7b,_0x340c06[_0x07f1('0xe')]['name'],_0x340c06[_0x07f1('0x2c')]['id'],!![],_0x22fd32,_0x584c45['id']);if(rpc[_0x340c06[_0x07f1('0x28')]+_0x07f1('0x32')]){return rpc[_0x340c06[_0x07f1('0x28')]+_0x07f1('0x32')]['create'](_0x4d9e7b)['catch'](function(_0x34bff8){logger['error'](_0x07f1('0x33'));});}}}function stopRouting(_0x5ed743,_0x2dc694,_0x55df02,_0x263783){if(_0x5ed743&&_0x2dc694){_0x2dc694[_0x07f1('0x34')]-=0x1;var _0x4b4d8c={'leaveAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'acceptAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'reason':'accepted'};logger[_0x07f1('0x2f')](util[_0x07f1('0x15')](_0x07f1('0x35'),_0x5ed743,_0x2dc694[_0x07f1('0x31')]));emitChannelQueueInteraction(_0x55df02[_0x07f1('0x28')],_0x2dc694[_0x07f1('0x31')],_0x55df02['body'],_0x55df02[_0x07f1('0xe')][_0x07f1('0x31')],_0x55df02[_0x07f1('0x2c')]['id'],![],_0x263783,_0x2dc694['id']);if(rpc[_0x55df02[_0x07f1('0x28')]+_0x07f1('0x32')]){return rpc[_0x55df02[_0x07f1('0x28')]+_0x07f1('0x32')][_0x07f1('0x36')](_0x5ed743,_0x4b4d8c)[_0x07f1('0x37')](function(_0x4ae5b8){logger['error'](_0x07f1('0x38'));});}}}function endRouting(_0xbba8a0,_0xd65e9f,_0x74d380,_0xf44b46){if(_0xbba8a0&&_0xd65e9f){_0xd65e9f[_0x07f1('0x34')]-=0x1;var _0x413b23={'leaveAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'exitAt':moment()[_0x07f1('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x07f1('0x2f')](util['format'](_0x07f1('0x39'),_0xbba8a0,_0xd65e9f['name']));emitChannelQueueInteraction(_0x74d380[_0x07f1('0x28')],_0xd65e9f[_0x07f1('0x31')],_0x74d380[_0x07f1('0x24')],_0x74d380[_0x07f1('0xe')]['name'],_0x74d380['message']['id'],![],_0xf44b46);if(rpc[_0x74d380['channel']+_0x07f1('0x32')]){return rpc[_0x74d380[_0x07f1('0x28')]+_0x07f1('0x32')][_0x07f1('0x36')](_0xbba8a0,_0x413b23)[_0x07f1('0x37')](function(_0x56310f){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x46b4ea){return function(_0x217d3b){return _0x217d3b[_0x07f1('0x31')][_0x07f1('0x3a')]()===_0x46b4ea[_0x07f1('0x3a')]();};}exports[_0x07f1('0x3b')]=function(_0x4950ff,_0x305015,_0x5cd1ad,_0x1d70eb){return function(_0x34a07d){try{var _0x2f5976={'name':_0x305015[0x0],'timeout':_0x305015[0x1]};var _0x2df4b7=queue['validate'](_0x2f5976,{'typecast':!![]});if(_0x2df4b7[_0x07f1('0x3c')]){logger[_0x07f1('0x3d')](_0x07f1('0x3e'),_0x4950ff,_['map'](_0x2df4b7,_0x07f1('0x2c'))[_0x07f1('0x3f')](',\x20'));_0x34a07d[_0x07f1('0x40')]();}else{var _0x3f28b8=_[_0x07f1('0x41')](_0x5cd1ad[_0x1d70eb['channel']+_0x07f1('0x42')],handleFindQueue(_0x2f5976['name']));if(_0x3f28b8){startRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);var _0x4aea85=(_0x3f28b8[_0x07f1('0x43')]||0xa)*0x3e8;var _0x420bd3=(_0x2f5976[_0x07f1('0x43')]||0x14)*0x3e8;var _0x2db9a9;if(_0x4aea85>_0x420bd3){_0x420bd3=_0x4aea85;}var _0x2c285a=seqqueue[_0x07f1('0x44')](_0x4aea85);_0x2c285a['id']=_0x4950ff;_0x2c285a[_0x07f1('0x45')]=_0x4aea85;_0x2c285a[_0x07f1('0x46')]=_0x420bd3;_0x2c285a['channel']=_0x1d70eb[_0x07f1('0x28')];_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]['on']('end',function(){logger[_0x07f1('0x2f')](_0x07f1('0x48'),_0x4950ff);stopRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);clearTimeout(_0x2db9a9);_0x2db9a9=undefined;_0x2c285a[_0x07f1('0x49')](!![]);if(_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]){delete _0x5cd1ad[_0x07f1('0x47')][_0x4950ff];}_0x34a07d['stop']();});_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]['on'](_0x07f1('0x4a'),function(){if(_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]){delete _0x5cd1ad[_0x07f1('0x47')][_0x4950ff];}});_0x2db9a9=setTimeout(function(){logger[_0x07f1('0x2f')](_0x07f1('0x4b'),_0x4950ff);endRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);clearTimeout(_0x2db9a9);_0x2c285a[_0x07f1('0x49')](!![]);_0x34a07d[_0x07f1('0x4c')]();},_0x420bd3);switch(_0x3f28b8[_0x07f1('0x4d')]){case _0x07f1('0x4e'):strategy[_0x07f1('0x4e')](_0x2c285a,_0x3f28b8,_0x5cd1ad,_0x1d70eb);break;default:strategy[_0x07f1('0x4f')](_0x2c285a,_0x3f28b8,_0x5cd1ad,_0x1d70eb);}}else{logger[_0x07f1('0x3d')](_0x07f1('0x50'),_0x4950ff,_0x2f5976[_0x07f1('0x31')]);_0x34a07d[_0x07f1('0x40')]();}}}catch(_0x3a614f){console['log'](_0x3a614f);logger[_0x07f1('0x3d')](_0x07f1('0x3e'),_0x4950ff,_0x3a614f[_0x07f1('0x51')]);_0x34a07d[_0x07f1('0x40')]();}};}; \ No newline at end of file +var _0x5a22=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','moment','redis','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport'];(function(_0x326e5e,_0x491c33){var _0x4d0fde=function(_0xcbcedc){while(--_0xcbcedc){_0x326e5e['push'](_0x326e5e['shift']());}};_0x4d0fde(++_0x491c33);}(_0x5a22,0x1a0));var _0x25a2=function(_0x3d7e29,_0x45278b){_0x3d7e29=_0x3d7e29-0x0;var _0x341000=_0x5a22[_0x3d7e29];return _0x341000;};'use strict';var schema=require(_0x25a2('0x0'));var _=require(_0x25a2('0x1'));var util=require(_0x25a2('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x25a2('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');config[_0x25a2('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x25a2('0x5'))(new Redis(config[_0x25a2('0x4')]));var attributes=['id',_0x25a2('0x6'),_0x25a2('0x7'),'queue',_0x25a2('0x8'),_0x25a2('0x9')];function emit(_0x10282e,_0x1e33c4,_0x251170){io['to'](_0x10282e)[_0x25a2('0xa')](_0x1e33c4,_0x251170);}function emitChannelQueueInteraction(_0x4434ec,_0x4d201c,_0x17808f,_0x193ea3,_0x21d40a,_0x33cb35,_0x5cd589,_0x4d5e17){var _0x5ec856=_[_0x25a2('0xb')](_0x17808f);_0x5ec856['queue_id']=_0x4d5e17;_0x5ec856[_0x25a2('0xc')]=_0x4d201c;_0x5ec856[_0x25a2('0x7')]=_0x193ea3;_0x5ec856['id']=_0x21d40a;if(_0x33cb35){attributes[_0x25a2('0xd')](_[_0x25a2('0xe')](_0x4434ec)+_0x25a2('0xf'));_0x5cd589[util[_0x25a2('0x10')](_0x25a2('0x11'),_0x4434ec)][_0x21d40a]=_[_0x25a2('0x12')](_0x5ec856,attributes);}else{delete _0x5cd589[util['format'](_0x25a2('0x11'),_0x4434ec)][_0x21d40a];}emit(util['format']('%s:queue:%s',_0x4434ec,_0x4d201c),util[_0x25a2('0x10')](_0x25a2('0x13'),_0x4434ec,_0x33cb35?'save':_0x25a2('0x14')),_['pick'](_0x5ec856,attributes));}var rpc={'openchannelQueueReport':require(_0x25a2('0x15')),'mailQueueReport':require(_0x25a2('0x16')),'chatQueueReport':require(_0x25a2('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x25a2('0x18')),'whatsappQueueReport':require(_0x25a2('0x19'))};var queue=schema({'name':{'type':_0x25a2('0x1a'),'required':!![],'message':_0x25a2('0x1b')},'timeout':{'type':_0x25a2('0x1c'),'message':_0x25a2('0x1d')}});function startRouting(_0x17917d,_0x38a084,_0x298155,_0x23cdb2){if(_0x17917d&&_0x38a084&&_0x298155){_0x38a084['waiting']+=0x1;var _0x46bfa2={'uniqueid':_0x17917d,'from':_0x298155[_0x25a2('0x1e')]?_0x298155['body']['from']:'','joinAt':moment()[_0x25a2('0x10')](_0x25a2('0x1f')),'ContactId':_0x298155[_0x25a2('0x20')]?_0x298155[_0x25a2('0x20')]['id']:null,'ListId':_0x298155[_0x25a2('0x21')]?_0x298155['list']['id']:null};_0x46bfa2[_['upperFirst'](_0x298155['channel'])+'QueueId']=_0x38a084['id']||null;_0x46bfa2[_[_0x25a2('0x22')](_0x298155[_0x25a2('0x23')])+_0x25a2('0xf')]=_0x298155[_0x25a2('0x24')]?_0x298155[_0x25a2('0x24')]['id']:null;_0x46bfa2[_[_0x25a2('0x22')](_0x298155[_0x25a2('0x23')])+_0x25a2('0x25')]=_0x298155[_0x25a2('0x26')]?_0x298155[_0x25a2('0x26')]['id']:null;_0x46bfa2[_[_0x25a2('0x22')](_0x298155[_0x25a2('0x23')])+(_0x298155[_0x25a2('0x23')]!==_0x25a2('0x27')?_0x25a2('0x28'):_0x25a2('0x29'))]=_0x298155[_0x25a2('0x7')]?_0x298155[_0x25a2('0x7')]['id']:null;logger[_0x25a2('0x2a')](util['format'](_0x25a2('0x2b'),_0x17917d,_0x38a084[_0x25a2('0x2c')]));emitChannelQueueInteraction(_0x298155[_0x25a2('0x23')],_0x38a084[_0x25a2('0x2c')],_0x46bfa2,_0x298155['account'][_0x25a2('0x2c')],_0x298155[_0x25a2('0x26')]['id'],!![],_0x23cdb2,_0x38a084['id']);if(rpc[_0x298155[_0x25a2('0x23')]+_0x25a2('0x2d')]){return rpc[_0x298155[_0x25a2('0x23')]+_0x25a2('0x2d')]['create'](_0x46bfa2)[_0x25a2('0x2e')](function(_0x5142dd){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0xd0deb8,_0x49fe27,_0x51e573,_0x547807){if(_0xd0deb8&&_0x49fe27){_0x49fe27[_0x25a2('0x2f')]-=0x1;var _0x18b53c={'leaveAt':moment()[_0x25a2('0x10')](_0x25a2('0x1f')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x25a2('0x30')};logger['info'](util['format'](_0x25a2('0x31'),_0xd0deb8,_0x49fe27['name']));emitChannelQueueInteraction(_0x51e573['channel'],_0x49fe27[_0x25a2('0x2c')],_0x51e573[_0x25a2('0x1e')],_0x51e573[_0x25a2('0x7')][_0x25a2('0x2c')],_0x51e573['message']['id'],![],_0x547807,_0x49fe27['id']);if(rpc[_0x51e573[_0x25a2('0x23')]+_0x25a2('0x2d')]){return rpc[_0x51e573[_0x25a2('0x23')]+_0x25a2('0x2d')][_0x25a2('0x32')](_0xd0deb8,_0x18b53c)[_0x25a2('0x2e')](function(_0x62df2e){logger[_0x25a2('0x33')](_0x25a2('0x34'));});}}}function endRouting(_0x27b7ab,_0x48a4a5,_0x4798bc,_0x5a7f74){if(_0x27b7ab&&_0x48a4a5){_0x48a4a5[_0x25a2('0x2f')]-=0x1;var _0x1ee9f8={'leaveAt':moment()[_0x25a2('0x10')](_0x25a2('0x1f')),'exitAt':moment()[_0x25a2('0x10')](_0x25a2('0x1f')),'reason':'timeout'};logger[_0x25a2('0x2a')](util[_0x25a2('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x27b7ab,_0x48a4a5[_0x25a2('0x2c')]));emitChannelQueueInteraction(_0x4798bc['channel'],_0x48a4a5[_0x25a2('0x2c')],_0x4798bc[_0x25a2('0x1e')],_0x4798bc[_0x25a2('0x7')][_0x25a2('0x2c')],_0x4798bc[_0x25a2('0x26')]['id'],![],_0x5a7f74);if(rpc[_0x4798bc[_0x25a2('0x23')]+'QueueReport']){return rpc[_0x4798bc[_0x25a2('0x23')]+_0x25a2('0x2d')][_0x25a2('0x32')](_0x27b7ab,_0x1ee9f8)['catch'](function(_0x10b024){logger[_0x25a2('0x33')](_0x25a2('0x34'));});}}}function handleFindQueue(_0x3df9f5){return function(_0xddb8b5){return _0xddb8b5[_0x25a2('0x2c')][_0x25a2('0x35')]()===_0x3df9f5['toLowerCase']();};}exports[_0x25a2('0x36')]=function(_0x411d65,_0x8bbcb4,_0x18969c,_0x280939){return function(_0x32f593){try{var _0x196434={'name':_0x8bbcb4[0x0],'timeout':_0x8bbcb4[0x1]};var _0x1ee5a0=queue[_0x25a2('0x0')](_0x196434,{'typecast':!![]});if(_0x1ee5a0[_0x25a2('0x37')]){logger[_0x25a2('0x33')](_0x25a2('0x38'),_0x411d65,_[_0x25a2('0x39')](_0x1ee5a0,'message')[_0x25a2('0x3a')](',\x20'));_0x32f593[_0x25a2('0x3b')]();}else{var _0x2761fd=_[_0x25a2('0x3c')](_0x18969c[_0x280939[_0x25a2('0x23')]+_0x25a2('0x3d')],handleFindQueue(_0x196434[_0x25a2('0x2c')]));if(_0x2761fd){startRouting(_0x411d65,_0x2761fd,_0x280939,_0x18969c);var _0x2c871c=(_0x2761fd[_0x25a2('0x3e')]||0xa)*0x3e8;var _0x182e58=(_0x196434[_0x25a2('0x3e')]||0x14)*0x3e8;var _0x35d990;if(_0x2c871c>_0x182e58){_0x182e58=_0x2c871c;}var _0x1b4126=seqqueue['createQueue'](_0x2c871c);_0x1b4126['id']=_0x411d65;_0x1b4126[_0x25a2('0x3f')]=_0x2c871c;_0x1b4126[_0x25a2('0x40')]=_0x182e58;_0x1b4126[_0x25a2('0x23')]=_0x280939[_0x25a2('0x23')];_0x18969c['rules'][_0x411d65]['on'](_0x25a2('0x41'),function(){logger[_0x25a2('0x2a')](_0x25a2('0x42'),_0x411d65);stopRouting(_0x411d65,_0x2761fd,_0x280939,_0x18969c);clearTimeout(_0x35d990);_0x35d990=undefined;_0x1b4126[_0x25a2('0x43')](!![]);if(_0x18969c[_0x25a2('0x44')][_0x411d65]){delete _0x18969c['rules'][_0x411d65];}_0x32f593['stop']();});_0x18969c[_0x25a2('0x44')][_0x411d65]['on']('complete',function(){if(_0x18969c['rules'][_0x411d65]){delete _0x18969c[_0x25a2('0x44')][_0x411d65];}});_0x35d990=setTimeout(function(){logger['info'](_0x25a2('0x45'),_0x411d65);endRouting(_0x411d65,_0x2761fd,_0x280939,_0x18969c);clearTimeout(_0x35d990);_0x1b4126[_0x25a2('0x43')](!![]);_0x32f593[_0x25a2('0x46')]();},_0x182e58);switch(_0x2761fd['strategy']){case'rrmemory':strategy['rrmemory'](_0x1b4126,_0x2761fd,_0x18969c,_0x280939);break;default:strategy['beepall'](_0x1b4126,_0x2761fd,_0x18969c,_0x280939);}}else{logger[_0x25a2('0x33')](_0x25a2('0x47'),_0x411d65,_0x196434['name']);_0x32f593[_0x25a2('0x3b')]();}}}catch(_0x2dfa2a){console['log'](_0x2dfa2a);logger[_0x25a2('0x33')](_0x25a2('0x38'),_0x411d65,_0x2dfa2a[_0x25a2('0x48')]);_0x32f593[_0x25a2('0x3b')]();}};}; \ 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 125d246..ff2e617 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 _0x17ba=['TIMEOUT','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','forcedOwnership','debug','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP'];(function(_0x1970c3,_0x401e21){var _0x3c7399=function(_0x3731ef){while(--_0x3731ef){_0x1970c3['push'](_0x1970c3['shift']());}};_0x3c7399(++_0x401e21);}(_0x17ba,0xab));var _0xa17b=function(_0x208356,_0x3cbf2f){_0x208356=_0x208356-0x0;var _0x40dac1=_0x17ba[_0x208356];return _0x40dac1;};'use strict';var _=require(_0xa17b('0x0'));var uuid=require(_0xa17b('0x1'));var util=require('./util');var logger=require(_0xa17b('0x2'))(_0xa17b('0x3'));var Agent=function(_0x2806ac,_0x3c60e5,_0x106b5b,_0x38c13c){this[_0xa17b('0x4')]=uuid['v4']();this[_0xa17b('0x5')]=_0x2806ac;this[_0xa17b('0x6')]=_0x3c60e5;this[_0xa17b('0x7')]=_0x106b5b;this[_0xa17b('0x3')]=_0x38c13c;this[_0xa17b('0x5')][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this[_0xa17b('0xb')][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xc'),this['handleTimeout'][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xd'),this[_0xa17b('0xe')][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0x8')]=function(){this['squeue'][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this['handleTimeout'][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0xe')]=function(){this[_0xa17b('0xb')](!![]);};Agent['prototype'][_0xa17b('0x9')]=function(){logger['debug'](_0xa17b('0x10'),this[_0xa17b('0x5')]['id'],this['agent']['id']);if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){logger['debug'](_0xa17b('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}else{if(this[_0xa17b('0x3')]['forcedOwnership']||util[_0xa17b('0x14')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],this[_0xa17b('0x5')][_0xa17b('0x15')],![])){this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=!![];this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x18')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x19')](this[_0xa17b('0x4')],this['squeue']['id'],this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],null,this[_0xa17b('0x3')]);util[_0xa17b('0x1a')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')]['agents'][this['agent']['id']],'RINGING'+(this['routing'][_0xa17b('0x1b')]?':FORCED':''));}else{logger[_0xa17b('0x1c')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);setTimeout(this[_0xa17b('0x8')][_0xa17b('0xa')](this),0x3e8);}}};Agent[_0xa17b('0xf')][_0xa17b('0xb')]=function(_0x2fbbe8){if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xa17b('0x6')]['id']);}else{logger[_0xa17b('0x1c')](_0xa17b('0x1d'),this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);util[_0xa17b('0x1e')](this[_0xa17b('0x4')],this[_0xa17b('0x5')]['id'],this['realtime'][_0xa17b('0x12')][this['agent']['id']],null,this[_0xa17b('0x3')]);this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=![];this[_0xa17b('0x7')]['agents'][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x1f')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x1a')](this['squeue']['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this['agent']['id']],_0x2fbbe8?_0xa17b('0x20'):_0xa17b('0x21'));}if(!_0x2fbbe8){setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}};function agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd){return new Agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd);}module['exports']=agent; \ No newline at end of file +var _0x34e8=['busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x34e8,0x12c));var _0x834e=function(_0x114b11,_0x2816cb){_0x114b11=_0x114b11-0x0;var _0x5244bc=_0x34e8[_0x114b11];return _0x5244bc;};'use strict';var _=require(_0x834e('0x0'));var uuid=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var logger=require(_0x834e('0x3'))('routing');var Agent=function(_0x832422,_0x21e2e0,_0x472111,_0x31bf20){this[_0x834e('0x4')]=uuid['v4']();this[_0x834e('0x5')]=_0x832422;this[_0x834e('0x6')]=_0x21e2e0;this['realtime']=_0x472111;this[_0x834e('0x7')]=_0x31bf20;this['squeue'][_0x834e('0x8')](this[_0x834e('0x9')][_0x834e('0xa')](this),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xc'),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xd'),this[_0x834e('0xe')][_0x834e('0xa')](this));};Agent[_0x834e('0xf')][_0x834e('0x8')]=function(){this[_0x834e('0x5')][_0x834e('0x8')](this['handleRun'][_0x834e('0xa')](this),this[_0x834e('0xb')]['bind'](this));};Agent[_0x834e('0xf')][_0x834e('0xe')]=function(){this[_0x834e('0xb')](!![]);};Agent[_0x834e('0xf')]['handleRun']=function(){logger[_0x834e('0x10')](_0x834e('0x11'),this['squeue']['id'],this[_0x834e('0x6')]['id']);if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']])){logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x834e('0x8')][_0x834e('0xa')](this),0x3e8);}else{if(this[_0x834e('0x7')][_0x834e('0x15')]||util[_0x834e('0x16')](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']],this[_0x834e('0x5')][_0x834e('0x17')],![])){this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=!![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util['saveWaitingNotification'](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue'][_0x834e('0x17')]);util[_0x834e('0x1a')](this['notificationId'],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']],null,this[_0x834e('0x7')]);util[_0x834e('0x1b')](this['squeue']['id'],this['realtime'][_0x834e('0x13')][this['agent']['id']],_0x834e('0x1c')+(this[_0x834e('0x7')][_0x834e('0x15')]?_0x834e('0x1d'):''));}else{logger[_0x834e('0x10')](_0x834e('0x1e'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x834e('0xf')][_0x834e('0xb')]=function(_0x106d6a){if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']])){return logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this[_0x834e('0x6')]['id']);}else{logger[_0x834e('0x10')](_0x834e('0x1f'),this['squeue']['id'],this[_0x834e('0x6')]['id']);util['hideNotification'](this[_0x834e('0x4')],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],null,this[_0x834e('0x7')]);this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util[_0x834e('0x20')](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue']['channel']);util['writeLog'](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],_0x106d6a?_0x834e('0x21'):_0x834e('0x22'));}if(!_0x106d6a){setTimeout(this['push'][_0x834e('0xa')](this),0x3e8);}};function agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed){return new Agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed);}module[_0x834e('0x23')]=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 ae5b048..7526f73 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 _0xe5dc=['queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busyQueue','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xe5dc,0x9f));var _0xce5d=function(_0x2c520f,_0x594c6b){_0x2c520f=_0x2c520f-0x0;var _0x11722f=_0xe5dc[_0x2c520f];return _0x11722f;};'use strict';var _=require('lodash');var uuid=require(_0xce5d('0x0'));var util=require(_0xce5d('0x1'));var logger=require(_0xce5d('0x2'))(_0xce5d('0x3'));var Beepall=function(_0x4b5649,_0x7d1fd9,_0x3d9542,_0x13900b){this[_0xce5d('0x4')]=uuid['v4']();this[_0xce5d('0x5')]=_0x4b5649;this[_0xce5d('0x6')]=_0x7d1fd9;this[_0xce5d('0x7')]=_0x3d9542;this[_0xce5d('0x3')]=_0x13900b;this['squeue'][_0xce5d('0x8')](this[_0xce5d('0x9')][_0xce5d('0xa')](this),this[_0xce5d('0xb')]['bind'](this));this[_0xce5d('0x5')]['on'](_0xce5d('0xc'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0xce5d('0xd'),this[_0xce5d('0xe')][_0xce5d('0xa')](this));};Beepall[_0xce5d('0xf')][_0xce5d('0x8')]=function(){this[_0xce5d('0x5')]['push'](this[_0xce5d('0x9')][_0xce5d('0xa')](this),this['handleTimeout'][_0xce5d('0xa')](this));};Beepall[_0xce5d('0xf')][_0xce5d('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0xce5d('0xf')][_0xce5d('0x9')]=function(){var _0x1d6296=!![];if(!_[_0xce5d('0x10')](this[_0xce5d('0x6')])&&!_[_0xce5d('0x10')](this['queue']['Agents'])&&this[_0xce5d('0x6')][_0xce5d('0x11')][_0xce5d('0x12')]>0x0){for(var _0x3fadf9=0x0,_0x5d9f75;_0x3fadf90x0){for(var _0x4bd694=0x0,_0x587d40;_0x4bd6940x0&&_0x2adf16[_0x3f6ca6+_0xda3b('0x25')]>=_0x2adf16[_0x3f6ca6+'Capacity']){writeLog(_0x3110db,_0x2adf16,_0x3f6ca6['toUpperCase']()+_0xda3b('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x2529cf,_0xea3050,_0x1c9b4c,_0x3f476f,_0x277f27){return sendNotification(!![],_0x2529cf,_0xea3050,_0x1c9b4c,_0x3f476f,_0x277f27);};exports[_0xda3b('0x27')]=function(_0x536c76,_0x29899a,_0x3a9649,_0x4c3481,_0x13f110){return sendNotification(![],_0x536c76,_0x29899a,_0x3a9649,_0x4c3481,_0x13f110);};exports[_0xda3b('0x28')]=function(_0x3680c2,_0x2372ac,_0x2816ed){var _0x4bf35f=_0x2372ac['interaction'][_0xda3b('0x29')];if(!_0x4bf35f&&_0x2816ed){_0x4bf35f=_0x2816ed['id'];}var _0x3b18a1=_[_0xda3b('0x2a')](_0x3680c2[_0x2372ac[_0xda3b('0x2b')]+_0xda3b('0x2c')],function(_0xc58f98){var _0x380ce1=_['capitalize'](_0x2372ac[_0xda3b('0x2b')])+_0xda3b('0x2d');return _0xc58f98[_0x380ce1]===_0x2372ac['interaction']['id'];});if(!_0x3b18a1&&_0x4bf35f){_0x3b18a1=_[_0xda3b('0x2a')](_0x3680c2['agents'][_0x4bf35f][_0x2372ac[_0xda3b('0x2b')]+'WaitingInteractions'],function(_0x1d91c9){return _0x1d91c9['id']===_0x2372ac[_0xda3b('0x2e')]['id'];});}return _0x3b18a1;};exports[_0xda3b('0x2f')]=function(_0x2a108c,_0x5b1eac,_0x196e52,_0x430787){_0x2a108c[_0xda3b('0x30')][_0x196e52['id']][_0x430787+_0xda3b('0x31')][_0x5b1eac[_0xda3b('0x19')]['id']]={'id':_0x5b1eac[_0xda3b('0x2e')]['id']};};exports[_0xda3b('0x32')]=function(_0x4f3273,_0x53d4bc,_0x3061f9,_0x55d3c7){delete _0x4f3273['agents'][_0x3061f9['id']][_0x55d3c7+'WaitingInteractions'][_0x53d4bc['message']['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0xa484=['util','ioredis','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','user:%s','name','user:save','split','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','save','isAgentAvailable','busy','BUSY','online','Pause','hasOwnProperty','Capacity','toUpperCase','\x20MAXCAPACITY','hideNotification','interaction','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','WaitingInteractions','saveWaitingNotification','agents','removeWaitingNotification','message','writeLog'];(function(_0x1d37fc,_0x4db492){var _0x652aa6=function(_0x34f767){while(--_0x34f767){_0x1d37fc['push'](_0x1d37fc['shift']());}};_0x652aa6(++_0x4db492);}(_0xa484,0x1c2));var _0x4a48=function(_0x560914,_0x4ee5de){_0x560914=_0x560914-0x0;var _0x58fe58=_0xa484[_0x560914];return _0x58fe58;};'use strict';var _=require('lodash');var util=require(_0x4a48('0x0'));var utils=require('../utils');var Redis=require(_0x4a48('0x1'));var config=require('../../../../../config/environment');var logger=require(_0x4a48('0x2'))(_0x4a48('0x3'));config[_0x4a48('0x4')]=_['defaults'](config[_0x4a48('0x4')],{'host':_0x4a48('0x5'),'port':0x18eb});var io=require(_0x4a48('0x6'))(new Redis(config[_0x4a48('0x4')]));function sendNotification(_0xbef183,_0x5f229b,_0xa5cbf,_0x4991d3,_0x16c270,_0x9ade9f){io['to'](util['format'](_0x4a48('0x7'),_0x4991d3[_0x4a48('0x8')]))['emit'](_0x4a48('0x9'),_0x4991d3);var _0x122f45=_0x9ade9f||{};var _0x3c7868=_0xa5cbf[_0x4a48('0xa')]('.');var _0x4f6d1={'uniqueid':_0x5f229b,'channel':_0x3c7868[0x0],'id':_0x3c7868[0x1],'title':_0x3c7868[0x0]+'\x20interaction','interactionId':_0x3c7868[0x2],'queue':_0x16c270?_0x16c270[_0x4a48('0x8')]:null,'sound':_0x122f45[_0x4a48('0xb')][_0x4a48('0xc')],'shake':_0x122f45[_0x4a48('0xb')][_0x4a48('0xd')]};try{if(!_0x122f45['body']){_0x122f45[_0x4a48('0xe')]={};}if(_0x16c270){_0x122f45[_0x4a48('0xe')][_0x4a48('0xf')]=_0x16c270;}else if(_0x122f45[_0x4a48('0xe')][_0x4a48('0xf')]){delete _0x122f45[_0x4a48('0xe')][_0x4a48('0xf')];}_0x4f6d1['msg']=utils[_0x4a48('0x10')](_0x122f45['account'][_0x4a48('0x11')],_0x122f45);}catch(_0x254455){_0x4f6d1['msg']=_0x4a48('0x12');logger[_0x4a48('0x13')](util[_0x4a48('0x14')](_0x4a48('0x15'),_0x5f229b,_0x254455['message']));}io['to'](util[_0x4a48('0x14')]('user:%s',_0x4991d3[_0x4a48('0x8')]))['emit'](util[_0x4a48('0x14')]('notification:%s',_0xbef183?_0x4a48('0x16'):'remove'),_0x4f6d1);}function writeLog(_0xf3b6eb,_0x5cfab1,_0x283cc4){return logger['debug'](util[_0x4a48('0x14')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xf3b6eb,_0x5cfab1[_0x4a48('0x8')],_0x283cc4));}exports[_0x4a48('0x17')]=function(_0x147982,_0x41f6e6,_0xe535b1,_0x31cec7){if(_0x41f6e6[_0x4a48('0x18')]){writeLog(_0x147982,_0x41f6e6,_0x4a48('0x19'));return![];}if(!_0x41f6e6[_0x4a48('0x1a')]){writeLog(_0x147982,_0x41f6e6,'OFFLINE');return![];}if(_0x41f6e6[_0xe535b1+_0x4a48('0x1b')]){writeLog(_0x147982,_0x41f6e6,'PAUSE');return![];}if(_0x31cec7&&_0x41f6e6[_0x4a48('0x1c')](_0xe535b1+_0x4a48('0x1d'))&&_0x41f6e6[_0x4a48('0x1c')](_0xe535b1+'CurrentCapacity')){if(_0x41f6e6[_0xe535b1+_0x4a48('0x1d')]>0x0&&_0x41f6e6[_0xe535b1+'CurrentCapacity']>=_0x41f6e6[_0xe535b1+_0x4a48('0x1d')]){writeLog(_0x147982,_0x41f6e6,_0xe535b1[_0x4a48('0x1e')]()+_0x4a48('0x1f'));return![];}}return!![];};exports['showNotification']=function(_0x338ae0,_0x4dc8a7,_0x3bc1fc,_0x14f0c4,_0x50d9fc){return sendNotification(!![],_0x338ae0,_0x4dc8a7,_0x3bc1fc,_0x14f0c4,_0x50d9fc);};exports[_0x4a48('0x20')]=function(_0x329ccf,_0x3d5746,_0x17f5a0,_0x305ece,_0x28f1ce){return sendNotification(![],_0x329ccf,_0x3d5746,_0x17f5a0,_0x305ece,_0x28f1ce);};exports['checkWaitingNotifications']=function(_0x12352a,_0x4e6954,_0x89d3c6){var _0x5a7349=_0x4e6954[_0x4a48('0x21')]['UserId'];if(!_0x5a7349&&_0x89d3c6){_0x5a7349=_0x89d3c6['id'];}var _0x48d4af=_[_0x4a48('0x22')](_0x12352a[_0x4e6954[_0x4a48('0x23')]+_0x4a48('0x24')],function(_0x156635){var _0x451ff9=_[_0x4a48('0x25')](_0x4e6954['channel'])+_0x4a48('0x26');return _0x156635[_0x451ff9]===_0x4e6954[_0x4a48('0x21')]['id'];});if(!_0x48d4af&&_0x5a7349){_0x48d4af=_[_0x4a48('0x22')](_0x12352a['agents'][_0x5a7349][_0x4e6954['channel']+_0x4a48('0x27')],function(_0x2e5b0d){return _0x2e5b0d['id']===_0x4e6954['interaction']['id'];});}return _0x48d4af;};exports[_0x4a48('0x28')]=function(_0x281e36,_0x3df0b3,_0x578110,_0x38be52){_0x281e36[_0x4a48('0x29')][_0x578110['id']][_0x38be52+_0x4a48('0x27')][_0x3df0b3['message']['id']]={'id':_0x3df0b3[_0x4a48('0x21')]['id']};};exports[_0x4a48('0x2a')]=function(_0x215d6f,_0xe866fe,_0x1b745c,_0xe137d4){delete _0x215d6f['agents'][_0x1b745c['id']][_0xe137d4+_0x4a48('0x27')][_0xe866fe[_0x4a48('0x2b')]['id']];};exports[_0x4a48('0x2c')]=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 f8563e0..4ff40a5 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 _0x3b75=['string','consequence','error','[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x212aa0,_0xdba42b){var _0x4a19d0=function(_0x138874){while(--_0x138874){_0x212aa0['push'](_0x212aa0['shift']());}};_0x4a19d0(++_0xdba42b);}(_0x3b75,0xdc));var _0x53b7=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x3b75[_0x3d2e4b];return _0x509e78;};'use strict';var schema=require(_0x53b7('0x0'));var sh=require(_0x53b7('0x1'));var _=require(_0x53b7('0x2'));var utils=require(_0x53b7('0x3'));var logger=require(_0x53b7('0x4'))('routing');var system=schema({'command':{'type':_0x53b7('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x53b7('0x6')]=function(_0x4c9b8f,_0x357ece){return function(_0xb78251){try{var _0x331d88={'command':_0x357ece[0x0]};var _0x287704=system[_0x53b7('0x0')](_0x331d88,{'typecast':!![]});if(_0x287704['length']){logger[_0x53b7('0x7')](_0x53b7('0x8'),_0x4c9b8f,_[_0x53b7('0x9')](_0x287704,'message')[_0x53b7('0xa')](',\x20'));logger['info'](_0x53b7('0xb'),_0x4c9b8f);_0xb78251[_0x53b7('0xc')]();}else{var _0x2fa631=this;var _0x3dae32=utils[_0x53b7('0xd')](_0x357ece[0x0],this);logger['info'](_0x53b7('0xe'),_0x4c9b8f,_0x3dae32);sh[_0x53b7('0xf')](_[_0x53b7('0x10')](_0x3dae32),function(_0x3c7d94,_0x2c55b6){logger[_0x53b7('0x11')](_0x53b7('0x12'),_0x4c9b8f,_0x3c7d94);if(_0x3c7d94==0x0){var _0x2171b7=_0x2c55b6[_0x53b7('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x357ece[0x1])||_[_0x53b7('0x14')](_0x357ece[0x1])){logger[_0x53b7('0x11')]('[%s][SYSTEM]\x20no\x20variable',_0x4c9b8f);_0x2fa631['body'][_0x357ece[0x1]]=_0x2171b7;}else{logger['info'](_0x53b7('0x15'),_0x4c9b8f,_0x357ece[0x1],_0x2171b7);_0x2fa631[_0x53b7('0x16')][_0x357ece[0x1]]=_0x2171b7;}}_0xb78251[_0x53b7('0xc')]();});}}catch(_0x47981a){logger[_0x53b7('0x7')](_0x53b7('0x8'),_0x4c9b8f,_[_0x53b7('0x17')](_0x47981a)?JSON[_0x53b7('0x18')](_0x47981a):_0x47981a);logger[_0x53b7('0x11')](_0x53b7('0xb'),_0x4c9b8f);_0xb78251['next']();}};}; \ No newline at end of file +var _0xfc9c=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','join','info'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xfc9c,0xb4));var _0xcfc9=function(_0x1ce648,_0x2baf66){_0x1ce648=_0x1ce648-0x0;var _0x108a79=_0xfc9c[_0x1ce648];return _0x108a79;};'use strict';var schema=require(_0xcfc9('0x0'));var sh=require(_0xcfc9('0x1'));var _=require('lodash');var utils=require(_0xcfc9('0x2'));var logger=require('../../../../config/logger')(_0xcfc9('0x3'));var system=schema({'command':{'type':_0xcfc9('0x4'),'required':!![],'message':_0xcfc9('0x5')}});exports[_0xcfc9('0x6')]=function(_0x5afcf8,_0x1004d0){return function(_0x191e8e){try{var _0x44288d={'command':_0x1004d0[0x0]};var _0x30c6c0=system['validate'](_0x44288d,{'typecast':!![]});if(_0x30c6c0['length']){logger[_0xcfc9('0x7')](_0xcfc9('0x8'),_0x5afcf8,_[_0xcfc9('0x9')](_0x30c6c0,'message')[_0xcfc9('0xa')](',\x20'));logger[_0xcfc9('0xb')](_0xcfc9('0xc'),_0x5afcf8);_0x191e8e[_0xcfc9('0xd')]();}else{var _0x3b43cb=this;var _0x32d4cf=utils['getMustacheRender'](_0x1004d0[0x0],this);logger[_0xcfc9('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5afcf8,_0x32d4cf);sh['exec'](_[_0xcfc9('0xe')](_0x32d4cf),function(_0x4338fc,_0x538c31){logger[_0xcfc9('0xb')](_0xcfc9('0xf'),_0x5afcf8,_0x4338fc);if(_0x4338fc==0x0){var _0x59d76a=_0x538c31[_0xcfc9('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xcfc9('0x11')](_0x1004d0[0x1])||_[_0xcfc9('0x12')](_0x1004d0[0x1])){logger[_0xcfc9('0xb')](_0xcfc9('0x13'),_0x5afcf8);_0x3b43cb[_0xcfc9('0x14')][_0x1004d0[0x1]]=_0x59d76a;}else{logger[_0xcfc9('0xb')](_0xcfc9('0x15'),_0x5afcf8,_0x1004d0[0x1],_0x59d76a);_0x3b43cb['body'][_0x1004d0[0x1]]=_0x59d76a;}}_0x191e8e[_0xcfc9('0xd')]();});}}catch(_0x553159){logger[_0xcfc9('0x7')]('[%s][SYSTEM]\x20%s',_0x5afcf8,_[_0xcfc9('0x16')](_0x553159)?JSON[_0xcfc9('0x17')](_0x553159):_0x553159);logger[_0xcfc9('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5afcf8);_0x191e8e[_0xcfc9('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 b4008a7..b34a4f4 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 _0x9322=['consequence','validate','length','error','[%s][TAG]\x20%s','map','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x587d76,_0x54a331){var _0x1deb7e=function(_0x3268f6){while(--_0x3268f6){_0x587d76['push'](_0x587d76['shift']());}};_0x1deb7e(++_0x54a331);}(_0x9322,0x1b2));var _0x2932=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9322[_0x167cc1];return _0x10bc4b;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x2932('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2932('0x1')),'mailInteraction':require(_0x2932('0x2')),'faxInteraction':require(_0x2932('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x2932('0x4'))(_0x2932('0x5'));var tag=schema({'tag':{'type':_0x2932('0x6'),'required':!![],'message':_0x2932('0x7')}});exports[_0x2932('0x8')]=function(_0x350978,_0x300fc9,_0x1cc7df,_0x37f3d0){return function(_0x3f6e6e){try{var _0x378991={'tag':_0x300fc9[0x0]};var _0x46051b=tag[_0x2932('0x9')](_0x378991,{'typecast':!![]});if(_0x46051b[_0x2932('0xa')]){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,_[_0x2932('0xd')](_0x46051b,'message')[_0x2932('0xe')](',\x20'));logger[_0x2932('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x350978);_0x3f6e6e[_0x2932('0x10')]();}else{var _0x35842d={'ids':[_0x300fc9[0x0]]};if(rpc[_0x37f3d0[_0x2932('0x11')]+_0x2932('0x12')]){rpc[_0x37f3d0[_0x2932('0x11')]+'Interaction']['addTags'](_0x37f3d0[_0x2932('0x13')]['id'],_0x35842d)[_0x2932('0x14')](function(_0xa6b647){logger[_0x2932('0xf')](_0x2932('0x15'),_0x350978,_0x300fc9[0x1],_0x37f3d0['channel'],_0x37f3d0[_0x2932('0x13')]['id']);})[_0x2932('0x16')](function(_0x99f583){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,JSON[_0x2932('0x17')](_0x99f583));logger[_0x2932('0xf')](_0x2932('0x18'),_0x350978);})[_0x2932('0x19')](function(){_0x3f6e6e[_0x2932('0x10')]();});}}}catch(_0x4d969e){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,_['isObject'](_0x4d969e)?JSON[_0x2932('0x17')](_0x4d969e):_0x4d969e);logger[_0x2932('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x350978);_0x3f6e6e[_0x2932('0x10')]();}};}; \ No newline at end of file +var _0x2b3c=['info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify','finally','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x2e96ee,_0x3ecaf5){var _0x499d0f=function(_0x241813){while(--_0x241813){_0x2e96ee['push'](_0x2e96ee['shift']());}};_0x499d0f(++_0x3ecaf5);}(_0x2b3c,0xa7));var _0xc2b3=function(_0x53d3cb,_0x2148b8){_0x53d3cb=_0x53d3cb-0x0;var _0x47b552=_0x2b3c[_0x53d3cb];return _0x47b552;};'use strict';var schema=require(_0xc2b3('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xc2b3('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xc2b3('0x2')),'mailInteraction':require(_0xc2b3('0x3')),'faxInteraction':require(_0xc2b3('0x4')),'whatsappInteraction':require(_0xc2b3('0x5'))};var logger=require(_0xc2b3('0x6'))(_0xc2b3('0x7'));var tag=schema({'tag':{'type':_0xc2b3('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xc2b3('0x9')]=function(_0x2aa6e7,_0x1d0466,_0x5ce32d,_0x2c4b35){return function(_0xc078fa){try{var _0x16ca0e={'tag':_0x1d0466[0x0]};var _0xd8b09a=tag['validate'](_0x16ca0e,{'typecast':!![]});if(_0xd8b09a[_0xc2b3('0xa')]){logger[_0xc2b3('0xb')](_0xc2b3('0xc'),_0x2aa6e7,_[_0xc2b3('0xd')](_0xd8b09a,_0xc2b3('0xe'))['join'](',\x20'));logger[_0xc2b3('0xf')](_0xc2b3('0x10'),_0x2aa6e7);_0xc078fa[_0xc2b3('0x11')]();}else{var _0x52cdb8={'ids':[_0x1d0466[0x0]]};if(rpc[_0x2c4b35[_0xc2b3('0x12')]+_0xc2b3('0x13')]){rpc[_0x2c4b35['channel']+_0xc2b3('0x13')][_0xc2b3('0x14')](_0x2c4b35[_0xc2b3('0x15')]['id'],_0x52cdb8)[_0xc2b3('0x16')](function(_0x135725){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x2aa6e7,_0x1d0466[0x1],_0x2c4b35[_0xc2b3('0x12')],_0x2c4b35[_0xc2b3('0x15')]['id']);})[_0xc2b3('0x17')](function(_0x430389){logger[_0xc2b3('0xb')](_0xc2b3('0xc'),_0x2aa6e7,JSON[_0xc2b3('0x18')](_0x430389));logger[_0xc2b3('0xf')](_0xc2b3('0x10'),_0x2aa6e7);})[_0xc2b3('0x19')](function(){_0xc078fa['next']();});}}}catch(_0x273e6f){logger[_0xc2b3('0xb')](_0xc2b3('0xc'),_0x2aa6e7,_['isObject'](_0x273e6f)?JSON[_0xc2b3('0x18')](_0x273e6f):_0x273e6f);logger[_0xc2b3('0xf')](_0xc2b3('0x10'),_0x2aa6e7);_0xc078fa[_0xc2b3('0x11')]();}};}; \ 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 8f4cf0f..872aef9 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 _0xc21d=['push','params','stringify','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','isObject','next','request-promise','../../../../config/logger','routing','consequence','replace','includes','urlOnAnswer','?params=','urlOnRing','2.0','method'];(function(_0x7ca065,_0x2a221c){var _0x50cc06=function(_0x3329aa){while(--_0x3329aa){_0x7ca065['push'](_0x7ca065['shift']());}};_0x50cc06(++_0x2a221c);}(_0xc21d,0x1a8));var _0xdc21=function(_0xd02c81,_0x3cb4ea){_0xd02c81=_0xd02c81-0x0;var _0x214cde=_0xc21d[_0xd02c81];return _0x214cde;};'use strict';var rp=require(_0xdc21('0x0'));var logger=require(_0xdc21('0x1'))(_0xdc21('0x2'));var _=require('lodash');var arr=[];exports[_0xdc21('0x3')]=function(_0x2cc585,_0x53510d){return function(_0x54583f){var _0x57c3fb=_0x53510d[0xa];var _0x4e7f4f=_0x53510d[0xb];var _0x18f815=_0x53510d[0xc];var _0x3df87b=_0x53510d[0xd];var _0x41a0e5=_0x53510d[0xe];var _0x1cfc2e=_0x53510d[0xf][_0xdc21('0x4')](/\n/g,'\x20-\x20');var _0x39b91c=_0x53510d[0x10][_0xdc21('0x4')](/\n/g,'\x20');if(!arr[_0xdc21('0x5')](_0x4e7f4f)){arr['push'](_0x4e7f4f);var _0xe8163b=_0x53510d[0x3];var _0x1fa061=_0x53510d[0x4];var _0x5a838a=_0x53510d[0x1];var _0x50a465=_0x53510d[0x0];var _0x41d0c9={};_0x41d0c9[_0xdc21('0x6')]=_0x53510d[0x8]+_0xdc21('0x7')+_0x18f815+'|'+_0x57c3fb+'|'+_0x3df87b+'|'+_0x4e7f4f+'|'+_0x41a0e5;_0x41d0c9[_0xdc21('0x8')]=_0x53510d[0x7]+_0xdc21('0x7')+_0x18f815+'|'+_0x57c3fb+'|'+_0x3df87b+'|'+_0x4e7f4f+'|'+_0x41a0e5+'|'+_0x1cfc2e+'|'+_0x39b91c;_0x41d0c9['title']=_0x53510d[0x9];var _0xb0e70b={};_0xb0e70b['jsonrpc']=_0xdc21('0x9');_0xb0e70b[_0xdc21('0xa')]='login';var _0x5da74b=[];_0x5da74b['push'](_0x53510d[0x2]);_0x5da74b[_0xdc21('0xb')](_0x53510d[0x5]);_0x5da74b[_0xdc21('0xb')](_0x53510d[0x6]);_0xb0e70b[_0xdc21('0xc')]=_0x5da74b;_0xb0e70b['id']=0x1;var _0x3c977b=JSON[_0xdc21('0xd')](_0xb0e70b);var _0x7d8287={'encoding':'utf8','method':_0xdc21('0xe'),'timeout':0x2710,'url':_0xe8163b,'headers':{'Content-Type':_0xdc21('0xf')},'body':_0x3c977b};return rp(_0x7d8287)[_0xdc21('0x10')](function(_0x12ee9d){const _0x2ec2d5=JSON[_0xdc21('0x11')](_0x12ee9d);if(!_0x2ec2d5[_0xdc21('0x12')][_0xdc21('0x13')]){throw new Error(_0xdc21('0x14'));}var _0x48643c=_0x4e7f4f;var _0x14c95e='channelId='+_0x5a838a+_0xdc21('0x15')+_0x50a465+_0xdc21('0x16')+_0x48643c+'&data='+JSON[_0xdc21('0xd')](_0x41d0c9);var _0x197457=_0x1fa061+'?'+_0x14c95e;return rp(_0x197457);})[_0xdc21('0x10')](function(_0x475d2d){logger[_0xdc21('0x17')](_0xdc21('0x18'),_0x2cc585,_0x475d2d);_0x54583f['stop']();})[_0xdc21('0x19')](function(_0x9b69e1){logger[_0xdc21('0x1a')]('[%s][TVOX]\x20%s',_0x2cc585,_[_0xdc21('0x1b')](_0x9b69e1)?JSON[_0xdc21('0xd')](_0x9b69e1):_0x9b69e1);_0x54583f['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2cc585);_0x54583f[_0xdc21('0x1c')]();}};}; \ No newline at end of file +var _0xbe64=['params','stringify','utf8','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','request-promise','routing','lodash','consequence','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method'];(function(_0x4e6512,_0x22579b){var _0x53566f=function(_0x4cc6b2){while(--_0x4cc6b2){_0x4e6512['push'](_0x4e6512['shift']());}};_0x53566f(++_0x22579b);}(_0xbe64,0x64));var _0x4be6=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xbe64[_0x4849f6];return _0x1a3dcd;};'use strict';var rp=require(_0x4be6('0x0'));var logger=require('../../../../config/logger')(_0x4be6('0x1'));var _=require(_0x4be6('0x2'));var arr=[];exports[_0x4be6('0x3')]=function(_0x2fca97,_0x3d4437){return function(_0x54b808){var _0x199e0c=_0x3d4437[0xa];var _0x63a2=_0x3d4437[0xb];var _0x48e67d=_0x3d4437[0xc];var _0x262a0e=_0x3d4437[0xd];var _0x27fe58=_0x3d4437[0xe];var _0x49d7d3=_0x3d4437[0xf]['replace'](/\n/g,_0x4be6('0x4'));var _0x448f76=_0x3d4437[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x63a2)){arr[_0x4be6('0x5')](_0x63a2);var _0x2242c3=_0x3d4437[0x3];var _0x20b491=_0x3d4437[0x4];var _0x28765b=_0x3d4437[0x1];var _0x4a1d79=_0x3d4437[0x0];var _0xd12887={};_0xd12887[_0x4be6('0x6')]=_0x3d4437[0x8]+_0x4be6('0x7')+_0x48e67d+'|'+_0x199e0c+'|'+_0x262a0e+'|'+_0x63a2+'|'+_0x27fe58;_0xd12887[_0x4be6('0x8')]=_0x3d4437[0x7]+'?params='+_0x48e67d+'|'+_0x199e0c+'|'+_0x262a0e+'|'+_0x63a2+'|'+_0x27fe58+'|'+_0x49d7d3+'|'+_0x448f76;_0xd12887['title']=_0x3d4437[0x9];var _0x339945={};_0x339945[_0x4be6('0x9')]=_0x4be6('0xa');_0x339945[_0x4be6('0xb')]='login';var _0x59ab56=[];_0x59ab56['push'](_0x3d4437[0x2]);_0x59ab56['push'](_0x3d4437[0x5]);_0x59ab56[_0x4be6('0x5')](_0x3d4437[0x6]);_0x339945[_0x4be6('0xc')]=_0x59ab56;_0x339945['id']=0x1;var _0x3a533f=JSON[_0x4be6('0xd')](_0x339945);var _0xd90e70={'encoding':_0x4be6('0xe'),'method':'POST','timeout':0x2710,'url':_0x2242c3,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3a533f};return rp(_0xd90e70)[_0x4be6('0xf')](function(_0x92a71c){const _0x25eb56=JSON[_0x4be6('0x10')](_0x92a71c);if(!_0x25eb56[_0x4be6('0x11')][_0x4be6('0x12')]){throw new Error(_0x4be6('0x13'));}var _0x3cbdc0=_0x63a2;var _0x18315b='channelId='+_0x28765b+_0x4be6('0x14')+_0x4a1d79+'&sessionId='+_0x3cbdc0+_0x4be6('0x15')+JSON['stringify'](_0xd12887);var _0xe7b079=_0x20b491+'?'+_0x18315b;return rp(_0xe7b079);})[_0x4be6('0xf')](function(_0x339bb8){logger[_0x4be6('0x16')](_0x4be6('0x17'),_0x2fca97,_0x339bb8);_0x54b808[_0x4be6('0x18')]();})['catch'](function(_0x479d59){logger[_0x4be6('0x19')](_0x4be6('0x1a'),_0x2fca97,_[_0x4be6('0x1b')](_0x479d59)?JSON[_0x4be6('0xd')](_0x479d59):_0x479d59);_0x54b808[_0x4be6('0x18')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2fca97);_0x54b808['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 3f390fb..ff111c8 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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x481a2b,_0x83a422){var _0x12c706=function(_0x480954){while(--_0x480954){_0x481a2b['push'](_0x481a2b['shift']());}};_0x12c706(++_0x83a422);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x470a5e,_0x5aab22){var _0xa29187=function(_0x2f44a8){while(--_0x2f44a8){_0x470a5e['push'](_0x470a5e['shift']());}};_0xa29187(++_0x5aab22);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 8bf1ca6..2835f78 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 _0xe9f5=['appdata','dialogflowv2','tag','TagId','getMustacheRender','account','notificationTemplate','body','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','UserId','catch','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','join','app','toLowerCase','autoreply','split','mail','push','slice','dialogflow'];(function(_0x37b5ca,_0x126698){var _0x5bc849=function(_0xbc3402){while(--_0xbc3402){_0x37b5ca['push'](_0x37b5ca['shift']());}};_0x5bc849(++_0x126698);}(_0xe9f5,0x1c0));var _0x5e9f=function(_0x54edab,_0x49b7ad){_0x54edab=_0x54edab-0x0;var _0x35c7c9=_0xe9f5[_0x54edab];return _0x35c7c9;};'use strict';var _=require(_0x5e9f('0x0'));var util=require(_0x5e9f('0x1'));var path=require(_0x5e9f('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x5e9f('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x5e9f('0x4'));var logger=require('../../../config/logger')(_0x5e9f('0x5'));var rpc={'openchannelQueueReport':require(_0x5e9f('0x6')),'mailQueueReport':require(_0x5e9f('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5e9f('0x8')),'faxQueueReport':require(_0x5e9f('0x9')),'whatsappQueueReport':require(_0x5e9f('0xa'))};var RuleEngine=require(_0x5e9f('0xb'));function getId(_0x59794e,_0x42d573,_0x54fb68){return util[_0x5e9f('0xc')](_0x5e9f('0xd'),_0x59794e,_0x42d573||0x0,_0x54fb68||0x0);}function getIntervals(_0x4bf7bb,_0x319e85){var _0x1c9b96=[];if(!_[_0x5e9f('0xe')](_0x319e85[_0x5e9f('0xf')])&&!_[_0x5e9f('0xe')](_0x4bf7bb[_0x319e85['IntervalId']])&&!_[_0x5e9f('0xe')](_0x4bf7bb[_0x319e85[_0x5e9f('0xf')]][_0x5e9f('0x10')])){_0x1c9b96=_[_0x5e9f('0x11')](_0x4bf7bb[_0x319e85[_0x5e9f('0xf')]][_0x5e9f('0x10')],_0x5e9f('0x12'));}else if(!_[_0x5e9f('0xe')](_0x319e85['interval'])){_0x1c9b96=[_0x319e85[_0x5e9f('0x12')]];}return _0x1c9b96;}exports[_0x5e9f('0x13')]=function(_0x149188){_0x149188[_0x5e9f('0x14')]={};return new BPromise(function(_0x7dea41,_0x36634f){var _0x4fe95a={'Start':function(_0x39b8f1){var _0x340042=this;return new Promise(function(_0x3a8339,_0xf4f97e){if(_0x39b8f1){try{var _0xc4ceb8=[];var _0x2f3872=getId(_0x39b8f1[_0x5e9f('0x15')],_0x39b8f1['message']?_0x39b8f1[_0x5e9f('0x16')]['id']:0x0,_0x39b8f1[_0x5e9f('0x17')]?_0x39b8f1[_0x5e9f('0x17')]['id']:0x0);var _0x3566ae=sUtils[_0x5e9f('0x18')](_0x149188,_0x39b8f1);if(!_0x3566ae&&_0x39b8f1['applications']&&_[_0x5e9f('0x19')](_0x39b8f1[_0x5e9f('0x1a')])&&_0x39b8f1['applications'][_0x5e9f('0x1b')]){for(var _0x27f92b=0x0;_0x27f92b<_0x39b8f1['applications'][_0x5e9f('0x1b')];_0x27f92b+=0x1){var _0x548ea9=_0x39b8f1[_0x5e9f('0x1a')][_0x27f92b];if(fs['existsSync'](path[_0x5e9f('0x1c')](__dirname,_0x5e9f('0x1a'),_0x548ea9[_0x5e9f('0x1d')]+'.js'))){var _0xdca7f1=[];switch(_0x548ea9[_0x5e9f('0x1d')][_0x5e9f('0x1e')]()){case _0x5e9f('0x1f'):var _0x1dc564=_0x548ea9['appdata'][_0x5e9f('0x20')](',');if(_0x39b8f1[_0x5e9f('0x15')]===_0x5e9f('0x21')){_0xdca7f1['push'](_0x1dc564[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x1dc564[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x1dc564['slice'](0x2,_0x1dc564['length'])[_0x5e9f('0x1c')](','));}else{_0xdca7f1[_0x5e9f('0x22')](_0x1dc564[0x0]);_0xdca7f1['push'](_0x1dc564[_0x5e9f('0x23')](0x1,_0x1dc564['length'])['join'](','));}break;case _0x5e9f('0x24'):var _0x7b0498=_0x548ea9[_0x5e9f('0x25')][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x7b0498[0x0]);_0xdca7f1['push'](_0x7b0498[0x1]);_0xdca7f1['push'](_0x7b0498[_0x5e9f('0x23')](0x2,_0x7b0498['length'])[_0x5e9f('0x1c')](','));break;case _0x5e9f('0x26'):var _0x42e99a=_0x548ea9[_0x5e9f('0x25')]['split'](',');_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x0]);_0xdca7f1['push'](_0x42e99a[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x3]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a['slice'](0x4,_0x42e99a[_0x5e9f('0x1b')])[_0x5e9f('0x1c')](','));break;case'amazonlex':var _0x112a8c=_0x548ea9[_0x5e9f('0x25')][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x3]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c['slice'](0x4,_0x112a8c[_0x5e9f('0x1b')])[_0x5e9f('0x1c')](','));break;case _0x5e9f('0x16'):_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x25')]);break;case _0x5e9f('0x27'):_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x28')]);_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x25')]);break;case'tvox':var _0x4b6954=utils[_0x5e9f('0x29')](_0x39b8f1[_0x5e9f('0x2a')][_0x5e9f('0x2b')],_0x39b8f1);var _0x54d88f=_0x548ea9['appdata'][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x3]);_0xdca7f1['push'](_0x54d88f[0x4]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x5]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x6]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x7]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x8]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x9]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0xa]);_0xdca7f1['push'](_0x39b8f1['interaction']['id']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1['message']['id']);_0xdca7f1['push'](_0x548ea9['ChatWebsiteId']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1[_0x5e9f('0x17')]['ContactId']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1['body'][_0x5e9f('0x2c')]);_0xdca7f1[_0x5e9f('0x22')](_0x4b6954);break;default:_0xdca7f1=_[_0x5e9f('0xe')](_0x548ea9['appdata'])?[]:_0x548ea9['appdata'][_0x5e9f('0x20')](',');}var _0x2553c5={'id':util[_0x5e9f('0xc')]('%s:%s:%s',_0x2f3872,_0x548ea9['id'],_0x548ea9['app']),'condition':require('./interval')['condition'](_0x2f3872,getIntervals(_0x149188[_0x5e9f('0x2d')],_0x548ea9),_0x149188),'consequence':require(_0x5e9f('0x2e')+_0x548ea9[_0x5e9f('0x1d')])['consequence'](_0x2f3872,_0xdca7f1,_0x149188,_0x39b8f1),'p':_0x548ea9['priority']||0x0};logger[_0x5e9f('0x2f')](_0x5e9f('0x30'),_0x2553c5['id'],_0x5e9f('0x31'),getIntervals(_0x149188[_0x5e9f('0x2d')],_0x548ea9)['join'](_0x5e9f('0x32')));_0xc4ceb8[_0x5e9f('0x22')](_0x2553c5);}else{logger[_0x5e9f('0x33')](_0x5e9f('0x34'),path['join'](__dirname,'applications',_0x548ea9['app']+_0x5e9f('0x35')));}}_0x149188[_0x5e9f('0x14')][_0x2f3872]=new RuleEngine(_0xc4ceb8);_0x149188[_0x5e9f('0x14')][_0x2f3872][_0x5e9f('0x36')](_0x39b8f1,function(_0x590045){logger[_0x5e9f('0x2f')](_0x5e9f('0x37'),JSON['stringify'](_0x590045['matchPath']));if(_0x149188[_0x5e9f('0x14')][_0x2f3872]){_0x149188[_0x5e9f('0x14')][_0x2f3872]['emit'](_0x5e9f('0x38'));}});return _0x3a8339({'code':0xc8,'message':_0x39b8f1});}else{if(_0x3566ae){logger[_0x5e9f('0x2f')](util['format'](_0x5e9f('0x39'),_0x2f3872));}else{logger['info'](_0x5e9f('0x3a'));}return _0x3a8339({'code':0xc8,'message':_0x39b8f1});}}catch(_0x377494){logger[_0x5e9f('0x33')](_0x377494[_0x5e9f('0x3b')]);return _0xf4f97e(_0x340042[_0x5e9f('0x33')](0x1f4,_0x377494));}}return _0xf4f97e('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4fc663){var _0x33670d=this;return new Promise(function(_0x494daa,_0x8f725d){if(_0x4fc663[_0x5e9f('0x3c')]&&_0x4fc663[_0x5e9f('0x3c')]['id']){if(_0x149188[_0x5e9f('0x3d')][_0x4fc663[_0x5e9f('0x3c')]['id']]){_0x149188['agents'][_0x4fc663['agent']['id']][_0x5e9f('0x3e')]=![];_0x149188[_0x5e9f('0x3d')][_0x4fc663[_0x5e9f('0x3c')]['id']][_0x5e9f('0x3f')]=undefined;}}if(_0x4fc663[_0x5e9f('0x16')]&&_0x4fc663[_0x5e9f('0x16')]['id']){try{var _0x5d6fee=getId(_0x4fc663[_0x5e9f('0x15')],_0x4fc663[_0x5e9f('0x16')]?_0x4fc663[_0x5e9f('0x16')]['id']:0x0,_0x4fc663[_0x5e9f('0x17')]?_0x4fc663['interaction']['id']:0x0);if(_0x149188['rules'][_0x5d6fee]){_0x149188[_0x5e9f('0x14')][_0x5d6fee]['emit'](_0x5e9f('0x40'));if(rpc[_0x4fc663[_0x5e9f('0x15')]+'QueueReport']){rpc[_0x4fc663[_0x5e9f('0x15')]+'QueueReport']['update'](_0x5d6fee,{'UserId':_0x4fc663[_0x5e9f('0x16')][_0x5e9f('0x41')]})[_0x5e9f('0x42')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x494daa({'code':0xc8,'message':_0x4fc663});}catch(_0x8f86df){logger['error'](_0x8f86df[_0x5e9f('0x3b')]);return _0x8f725d(_0x33670d[_0x5e9f('0x33')](0x1f4,_0x8f86df));}}logger['error'](_0x5e9f('0x43'));return _0x8f725d(_0x33670d[_0x5e9f('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2e8c79){var _0x3cdee9=this;return new Promise(function(_0x190ceb,_0x5e6ee7){if(_0x2e8c79[_0x5e9f('0x3c')]&&_0x2e8c79[_0x5e9f('0x3c')]['id']){try{if(_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']]){_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']]['busy']=![];_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']][_0x5e9f('0x3f')]=undefined;}return _0x190ceb({'code':0xc8,'message':_0x2e8c79});}catch(_0x4b23f3){logger[_0x5e9f('0x33')](_0x4b23f3['stack']);return _0x5e6ee7(_0x3cdee9['error'](0x1f4,_0x4b23f3));}}logger['error'](_0x5e9f('0x43'));return _0x5e6ee7(_0x3cdee9[_0x5e9f('0x33')](0x1f4,_0x5e9f('0x43')));});},'AbandonInteraction':function(_0x575597){var _0x4ff42e=this;return new Promise(function(_0x40527a,_0x937d24){if(_0x575597['channel']&&_0x575597['interaction']&&_0x575597[_0x5e9f('0x17')]['id']){try{var _0x36e148=getId(_0x575597[_0x5e9f('0x15')],_0x575597['message']?_0x575597['message']['id']:0x0,_0x575597[_0x5e9f('0x17')]?_0x575597[_0x5e9f('0x17')]['id']:0x0);if(_0x149188['rules'][_0x36e148]){_0x149188[_0x5e9f('0x14')][_0x36e148][_0x5e9f('0x44')](_0x5e9f('0x40'));}return _0x40527a({'code':0xc8,'message':_0x575597});}catch(_0x4e8716){logger[_0x5e9f('0x33')](_0x4e8716[_0x5e9f('0x3b')]);return _0x937d24(_0x4ff42e[_0x5e9f('0x33')](0x1f4,_0x4e8716));}}logger[_0x5e9f('0x33')](_0x5e9f('0x43'));return _0x937d24(_0x4ff42e[_0x5e9f('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x7b0ed3){var _0x5595df=this;return new Promise(function(_0x4a2491,_0x27191c){if(_0x149188[_0x5e9f('0x3d')][_0x5e9f('0x45')](_0x7b0ed3['id'])){for(var _0x417e04 in _0x7b0ed3[_0x5e9f('0x46')]){if(_0x7b0ed3[_0x5e9f('0x46')][_0x5e9f('0x45')](_0x417e04)){if(_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x5e9f('0x45')](_0x417e04+_0x5e9f('0x47'))){_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x417e04+_0x5e9f('0x47')]=parseInt(_0x7b0ed3[_0x5e9f('0x46')][_0x417e04],0xa);}}}_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x5e9f('0x48')]();return _0x4a2491({'code':0xc8,'message':_0x149188['agents'][_0x7b0ed3['id']]});}else{return _0x27191c(_0x5595df[_0x5e9f('0x33')](0x1f4,_0x5e9f('0x49')));}});},'Agents':function(_0x4a1ed7){return new Promise(function(_0x245859){var _0x2ce450=_[_0x5e9f('0x4a')](_0x149188['agents']);if(_0x4a1ed7&&_0x4a1ed7['id']){var _0x51618c=_['find'](_0x2ce450,function(_0x43bb4){return _0x43bb4['id']===_0x4a1ed7['id'];});_0x245859(_0x51618c);}else{_0x245859({'count':_0x2ce450[_0x5e9f('0x1b')],'rows':_0x2ce450});}});},'ChatQueues':function(){return new Promise(function(_0x36ca59){var _0x35ee57=[];for(var _0x1cc9ea in _0x149188[_0x5e9f('0x4b')]){if(_0x149188[_0x5e9f('0x4b')][_0x5e9f('0x45')](_0x1cc9ea)){var _0x2d28fe=_0x149188['chatQueues'][_0x1cc9ea];var _0x4c1e96={'id':_0x2d28fe['id'],'available':_0x2d28fe[_0x5e9f('0x4c')],'loggedIn':_0x2d28fe[_0x5e9f('0x4d')],'name':_0x2d28fe[_0x5e9f('0x4e')],'paused':_0x2d28fe[_0x5e9f('0x4f')],'waiting':_0x2d28fe[_0x5e9f('0x50')]};_0x35ee57['push'](_0x4c1e96);}}_0x36ca59({'count':_0x35ee57['length'],'rows':_0x35ee57});});},'MailQueues':function(){return new Promise(function(_0x47cb46){var _0x1dd607=[];for(var _0x2ef3d8 in _0x149188[_0x5e9f('0x51')]){if(_0x149188[_0x5e9f('0x51')][_0x5e9f('0x45')](_0x2ef3d8)){var _0x20b460=_0x149188['mailQueues'][_0x2ef3d8];var _0x3ce3be={'id':_0x20b460['id'],'available':_0x20b460[_0x5e9f('0x4c')],'loggedIn':_0x20b460[_0x5e9f('0x4d')],'name':_0x20b460[_0x5e9f('0x4e')],'paused':_0x20b460[_0x5e9f('0x4f')],'waiting':_0x20b460[_0x5e9f('0x50')]};_0x1dd607['push'](_0x3ce3be);}}_0x47cb46({'count':_0x1dd607[_0x5e9f('0x1b')],'rows':_0x1dd607});});},'OpenchannelQueues':function(){return new Promise(function(_0x1d55a7){var _0x14c394=[];for(var _0x100e90 in _0x149188[_0x5e9f('0x52')]){if(_0x149188[_0x5e9f('0x52')][_0x5e9f('0x45')](_0x100e90)){var _0xa02a69=_0x149188[_0x5e9f('0x52')][_0x100e90];var _0x462a33={'id':_0xa02a69['id'],'available':_0xa02a69['available'],'loggedIn':_0xa02a69['loggedIn'],'name':_0xa02a69[_0x5e9f('0x4e')],'paused':_0xa02a69['paused'],'waiting':_0xa02a69[_0x5e9f('0x50')]};_0x14c394['push'](_0x462a33);}}_0x1d55a7({'count':_0x14c394['length'],'rows':_0x14c394});});},'SmsQueues':function(){return new Promise(function(_0x3918bc){var _0x30834a=[];for(var _0x503f03 in _0x149188[_0x5e9f('0x53')]){if(_0x149188[_0x5e9f('0x53')]['hasOwnProperty'](_0x503f03)){var _0x2488a8=_0x149188[_0x5e9f('0x53')][_0x503f03];var _0x563d94={'id':_0x2488a8['id'],'available':_0x2488a8[_0x5e9f('0x4c')],'loggedIn':_0x2488a8[_0x5e9f('0x4d')],'name':_0x2488a8[_0x5e9f('0x4e')],'paused':_0x2488a8['paused'],'waiting':_0x2488a8['waiting']};_0x30834a[_0x5e9f('0x22')](_0x563d94);}}_0x3918bc({'count':_0x30834a[_0x5e9f('0x1b')],'rows':_0x30834a});});},'FaxQueues':function(){return new Promise(function(_0x51871f){var _0x44e515=[];for(var _0x2f6d24 in _0x149188[_0x5e9f('0x54')]){if(_0x149188[_0x5e9f('0x54')][_0x5e9f('0x45')](_0x2f6d24)){var _0xa55186=_0x149188[_0x5e9f('0x54')][_0x2f6d24];var _0x258463={'id':_0xa55186['id'],'available':_0xa55186[_0x5e9f('0x4c')],'loggedIn':_0xa55186[_0x5e9f('0x4d')],'name':_0xa55186[_0x5e9f('0x4e')],'paused':_0xa55186['paused'],'waiting':_0xa55186['waiting']};_0x44e515['push'](_0x258463);}}_0x51871f({'count':_0x44e515[_0x5e9f('0x1b')],'rows':_0x44e515});});},'WhatsappQueues':function(){return new Promise(function(_0x193713){var _0x230cda=[];for(var _0x544c27 in _0x149188['whatsappQueues']){if(_0x149188[_0x5e9f('0x55')]['hasOwnProperty'](_0x544c27)){var _0x4c164c=_0x149188[_0x5e9f('0x55')][_0x544c27];var _0x4c7520={'id':_0x4c164c['id'],'available':_0x4c164c[_0x5e9f('0x4c')],'loggedIn':_0x4c164c[_0x5e9f('0x4d')],'name':_0x4c164c[_0x5e9f('0x4e')],'paused':_0x4c164c[_0x5e9f('0x4f')],'waiting':_0x4c164c[_0x5e9f('0x50')]};_0x230cda[_0x5e9f('0x22')](_0x4c7520);}}_0x193713({'count':_0x230cda[_0x5e9f('0x1b')],'rows':_0x230cda});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xfa4aaf){var _0x880743=_['values'](_0x149188[_0x5e9f('0x56')]);_0xfa4aaf({'count':_0x880743['length'],'rows':_0x880743});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x514e61){var _0x538e07=_[_0x5e9f('0x4a')](_0x149188[_0x5e9f('0x57')]);_0x514e61({'count':_0x538e07[_0x5e9f('0x1b')],'rows':_0x538e07});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x375ca6){var _0x545c3f=_[_0x5e9f('0x4a')](_0x149188['openchannelQueuesWaitingInteractions']);_0x375ca6({'count':_0x545c3f[_0x5e9f('0x1b')],'rows':_0x545c3f});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3162f1){var _0x49aca9=_['values'](_0x149188[_0x5e9f('0x58')]);_0x3162f1({'count':_0x49aca9[_0x5e9f('0x1b')],'rows':_0x49aca9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xfe63a2){var _0x1f0499=_[_0x5e9f('0x4a')](_0x149188[_0x5e9f('0x59')]);_0xfe63a2({'count':_0x1f0499[_0x5e9f('0x1b')],'rows':_0x1f0499});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x13ddc1){var _0x4e3df8=_['values'](_0x149188[_0x5e9f('0x5a')]);_0x13ddc1({'count':_0x4e3df8['length'],'rows':_0x4e3df8});});}};var _0x1e6120=jayson[_0x5e9f('0x5b')](_0x4fe95a)[_0x5e9f('0x5c')]();_0x1e6120['on']('error',function(_0x5091de){logger[_0x5e9f('0x33')](JSON['stringify'](_0x5091de));return _0x36634f(_0x5091de);});_0x1e6120['listen'](0x232c,_0x5e9f('0x5d'),function(){console[_0x5e9f('0x5e')](_0x5e9f('0x5f'),0x232c);return _0x7dea41(_0x5e9f('0x60')+0x232c);});});}; \ No newline at end of file +var _0xe555=['app','.js','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','priority','info','Push\x20new\x20rule','error','execute','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','name','paused','mailQueues','available','loggedIn','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join'];(function(_0x4a5531,_0xe35c69){var _0xd8670f=function(_0xa4493d){while(--_0xa4493d){_0x4a5531['push'](_0x4a5531['shift']());}};_0xd8670f(++_0xe35c69);}(_0xe555,0x1d8));var _0x5e55=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xe555[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x5e55('0x0'));var util=require(_0x5e55('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x5e55('0x2'));var utils=require(_0x5e55('0x3'));var sUtils=require(_0x5e55('0x4'));var logger=require('../../../config/logger')(_0x5e55('0x5'));var rpc={'openchannelQueueReport':require(_0x5e55('0x6')),'mailQueueReport':require(_0x5e55('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5e55('0x8')),'faxQueueReport':require(_0x5e55('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x5e55('0xa'));function getId(_0x2570d7,_0x10a306,_0x13bea8){return util[_0x5e55('0xb')](_0x5e55('0xc'),_0x2570d7,_0x10a306||0x0,_0x13bea8||0x0);}function getIntervals(_0x3b71c1,_0xd76cb8){var _0x1063ac=[];if(!_[_0x5e55('0xd')](_0xd76cb8[_0x5e55('0xe')])&&!_[_0x5e55('0xd')](_0x3b71c1[_0xd76cb8['IntervalId']])&&!_[_0x5e55('0xd')](_0x3b71c1[_0xd76cb8[_0x5e55('0xe')]][_0x5e55('0xf')])){_0x1063ac=_[_0x5e55('0x10')](_0x3b71c1[_0xd76cb8[_0x5e55('0xe')]][_0x5e55('0xf')],_0x5e55('0x11'));}else if(!_[_0x5e55('0xd')](_0xd76cb8['interval'])){_0x1063ac=[_0xd76cb8[_0x5e55('0x11')]];}return _0x1063ac;}exports['listen']=function(_0x5701ac){_0x5701ac[_0x5e55('0x12')]={};return new BPromise(function(_0x445db1,_0x15a513){var _0x43bd9a={'Start':function(_0x2941a1){var _0xde2154=this;return new Promise(function(_0x4e0aa2,_0x59ff56){if(_0x2941a1){try{var _0x4b2213=[];var _0x5f1acf=getId(_0x2941a1[_0x5e55('0x13')],_0x2941a1['message']?_0x2941a1[_0x5e55('0x14')]['id']:0x0,_0x2941a1[_0x5e55('0x15')]?_0x2941a1['interaction']['id']:0x0);var _0x4646b6=sUtils[_0x5e55('0x16')](_0x5701ac,_0x2941a1);if(!_0x4646b6&&_0x2941a1[_0x5e55('0x17')]&&_[_0x5e55('0x18')](_0x2941a1[_0x5e55('0x17')])&&_0x2941a1[_0x5e55('0x17')][_0x5e55('0x19')]){for(var _0x58ea0d=0x0;_0x58ea0d<_0x2941a1[_0x5e55('0x17')][_0x5e55('0x19')];_0x58ea0d+=0x1){var _0x4ae9f0=_0x2941a1[_0x5e55('0x17')][_0x58ea0d];if(fs[_0x5e55('0x1a')](path[_0x5e55('0x1b')](__dirname,'applications',_0x4ae9f0[_0x5e55('0x1c')]+_0x5e55('0x1d')))){var _0x5dbeb9=[];switch(_0x4ae9f0['app']['toLowerCase']()){case _0x5e55('0x1e'):var _0x5e78f4=_0x4ae9f0[_0x5e55('0x1f')][_0x5e55('0x20')](',');if(_0x2941a1[_0x5e55('0x13')]===_0x5e55('0x21')){_0x5dbeb9[_0x5e55('0x22')](_0x5e78f4[0x0]);_0x5dbeb9[_0x5e55('0x22')](_0x5e78f4[0x1]);_0x5dbeb9[_0x5e55('0x22')](_0x5e78f4[_0x5e55('0x23')](0x2,_0x5e78f4[_0x5e55('0x19')])[_0x5e55('0x1b')](','));}else{_0x5dbeb9[_0x5e55('0x22')](_0x5e78f4[0x0]);_0x5dbeb9['push'](_0x5e78f4[_0x5e55('0x23')](0x1,_0x5e78f4['length'])[_0x5e55('0x1b')](','));}break;case'dialogflow':var _0x2e6fdc=_0x4ae9f0[_0x5e55('0x1f')][_0x5e55('0x20')](',');_0x5dbeb9[_0x5e55('0x22')](_0x2e6fdc[0x0]);_0x5dbeb9[_0x5e55('0x22')](_0x2e6fdc[0x1]);_0x5dbeb9[_0x5e55('0x22')](_0x2e6fdc[_0x5e55('0x23')](0x2,_0x2e6fdc[_0x5e55('0x19')])[_0x5e55('0x1b')](','));break;case _0x5e55('0x24'):var _0x100646=_0x4ae9f0['appdata']['split'](',');_0x5dbeb9[_0x5e55('0x22')](_0x100646[0x0]);_0x5dbeb9[_0x5e55('0x22')](_0x100646[0x1]);_0x5dbeb9[_0x5e55('0x22')](_0x100646[0x2]);_0x5dbeb9[_0x5e55('0x22')](_0x100646[0x3]);_0x5dbeb9[_0x5e55('0x22')](_0x100646[_0x5e55('0x23')](0x4,_0x100646['length'])['join'](','));break;case _0x5e55('0x25'):var _0x5abcfb=_0x4ae9f0[_0x5e55('0x1f')][_0x5e55('0x20')](',');_0x5dbeb9[_0x5e55('0x22')](_0x5abcfb[0x0]);_0x5dbeb9[_0x5e55('0x22')](_0x5abcfb[0x1]);_0x5dbeb9[_0x5e55('0x22')](_0x5abcfb[0x2]);_0x5dbeb9[_0x5e55('0x22')](_0x5abcfb[0x3]);_0x5dbeb9[_0x5e55('0x22')](_0x5abcfb['slice'](0x4,_0x5abcfb[_0x5e55('0x19')])[_0x5e55('0x1b')](','));break;case _0x5e55('0x14'):_0x5dbeb9[_0x5e55('0x22')](_0x4ae9f0[_0x5e55('0x1f')]);break;case _0x5e55('0x26'):_0x5dbeb9[_0x5e55('0x22')](_0x4ae9f0[_0x5e55('0x27')]);_0x5dbeb9['push'](_0x4ae9f0[_0x5e55('0x1f')]);break;case _0x5e55('0x28'):var _0xf66a87=utils['getMustacheRender'](_0x2941a1[_0x5e55('0x29')][_0x5e55('0x2a')],_0x2941a1);var _0x38e0ef=_0x4ae9f0['appdata']['split'](',');_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x0]);_0x5dbeb9['push'](_0x38e0ef[0x1]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x2]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x3]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x4]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x5]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x6]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x7]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x8]);_0x5dbeb9[_0x5e55('0x22')](_0x38e0ef[0x9]);_0x5dbeb9['push'](_0x38e0ef[0xa]);_0x5dbeb9['push'](_0x2941a1[_0x5e55('0x15')]['id']);_0x5dbeb9['push'](_0x2941a1[_0x5e55('0x14')]['id']);_0x5dbeb9[_0x5e55('0x22')](_0x4ae9f0[_0x5e55('0x2b')]);_0x5dbeb9[_0x5e55('0x22')](_0x2941a1[_0x5e55('0x15')][_0x5e55('0x2c')]);_0x5dbeb9[_0x5e55('0x22')](_0x2941a1[_0x5e55('0x2d')][_0x5e55('0x2d')]);_0x5dbeb9[_0x5e55('0x22')](_0xf66a87);break;default:_0x5dbeb9=_[_0x5e55('0xd')](_0x4ae9f0[_0x5e55('0x1f')])?[]:_0x4ae9f0[_0x5e55('0x1f')][_0x5e55('0x20')](',');}var _0x3c9f95={'id':util[_0x5e55('0xb')](_0x5e55('0x2e'),_0x5f1acf,_0x4ae9f0['id'],_0x4ae9f0['app']),'condition':require(_0x5e55('0x2f'))['condition'](_0x5f1acf,getIntervals(_0x5701ac[_0x5e55('0x30')],_0x4ae9f0),_0x5701ac),'consequence':require(_0x5e55('0x31')+_0x4ae9f0[_0x5e55('0x1c')])['consequence'](_0x5f1acf,_0x5dbeb9,_0x5701ac,_0x2941a1),'p':_0x4ae9f0[_0x5e55('0x32')]||0x0};logger[_0x5e55('0x33')](_0x5e55('0x34'),_0x3c9f95['id'],'on\x20interval',getIntervals(_0x5701ac[_0x5e55('0x30')],_0x4ae9f0)['join']('\x20|\x20'));_0x4b2213[_0x5e55('0x22')](_0x3c9f95);}else{logger[_0x5e55('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x5e55('0x1b')](__dirname,_0x5e55('0x17'),_0x4ae9f0['app']+_0x5e55('0x1d')));}}_0x5701ac[_0x5e55('0x12')][_0x5f1acf]=new RuleEngine(_0x4b2213);_0x5701ac[_0x5e55('0x12')][_0x5f1acf][_0x5e55('0x36')](_0x2941a1,function(_0x465ab1){logger[_0x5e55('0x33')](_0x5e55('0x37'),JSON['stringify'](_0x465ab1[_0x5e55('0x38')]));if(_0x5701ac[_0x5e55('0x12')][_0x5f1acf]){_0x5701ac[_0x5e55('0x12')][_0x5f1acf][_0x5e55('0x39')](_0x5e55('0x3a'));}});return _0x4e0aa2({'code':0xc8,'message':_0x2941a1});}else{if(_0x4646b6){logger[_0x5e55('0x33')](util[_0x5e55('0xb')](_0x5e55('0x3b'),_0x5f1acf));}else{logger[_0x5e55('0x33')]('No\x20applications\x20to\x20execute');}return _0x4e0aa2({'code':0xc8,'message':_0x2941a1});}}catch(_0x2bbbaf){logger[_0x5e55('0x35')](_0x2bbbaf[_0x5e55('0x3c')]);return _0x59ff56(_0xde2154[_0x5e55('0x35')](0x1f4,_0x2bbbaf));}}return _0x59ff56(_0x5e55('0x3d'));});},'AcceptMessage':function(_0x284148){var _0x1e9945=this;return new Promise(function(_0x381780,_0x49ca64){if(_0x284148[_0x5e55('0x3e')]&&_0x284148['agent']['id']){if(_0x5701ac['agents'][_0x284148[_0x5e55('0x3e')]['id']]){_0x5701ac['agents'][_0x284148[_0x5e55('0x3e')]['id']][_0x5e55('0x3f')]=![];_0x5701ac[_0x5e55('0x40')][_0x284148[_0x5e55('0x3e')]['id']][_0x5e55('0x41')]=undefined;}}if(_0x284148[_0x5e55('0x14')]&&_0x284148[_0x5e55('0x14')]['id']){try{var _0x5c298d=getId(_0x284148[_0x5e55('0x13')],_0x284148[_0x5e55('0x14')]?_0x284148['message']['id']:0x0,_0x284148['interaction']?_0x284148[_0x5e55('0x15')]['id']:0x0);if(_0x5701ac[_0x5e55('0x12')][_0x5c298d]){_0x5701ac[_0x5e55('0x12')][_0x5c298d][_0x5e55('0x39')](_0x5e55('0x42'));if(rpc[_0x284148[_0x5e55('0x13')]+_0x5e55('0x43')]){rpc[_0x284148['channel']+'QueueReport']['update'](_0x5c298d,{'UserId':_0x284148[_0x5e55('0x14')][_0x5e55('0x44')]})['catch'](function(){logger[_0x5e55('0x35')](_0x5e55('0x45'));});}}return _0x381780({'code':0xc8,'message':_0x284148});}catch(_0x48c7aa){logger[_0x5e55('0x35')](_0x48c7aa['stack']);return _0x49ca64(_0x1e9945[_0x5e55('0x35')](0x1f4,_0x48c7aa));}}logger[_0x5e55('0x35')](_0x5e55('0x46'));return _0x49ca64(_0x1e9945[_0x5e55('0x35')](0x1f4,_0x5e55('0x46')));});},'RejectMessage':function(_0xb73fa1){var _0x2985df=this;return new Promise(function(_0x4b12cb,_0x50d48f){if(_0xb73fa1[_0x5e55('0x3e')]&&_0xb73fa1['agent']['id']){try{if(_0x5701ac['agents'][_0xb73fa1['agent']['id']]){_0x5701ac['agents'][_0xb73fa1['agent']['id']][_0x5e55('0x3f')]=![];_0x5701ac[_0x5e55('0x40')][_0xb73fa1[_0x5e55('0x3e')]['id']]['busyQueue']=undefined;}return _0x4b12cb({'code':0xc8,'message':_0xb73fa1});}catch(_0x2c3e0c){logger[_0x5e55('0x35')](_0x2c3e0c[_0x5e55('0x3c')]);return _0x50d48f(_0x2985df['error'](0x1f4,_0x2c3e0c));}}logger['error'](_0x5e55('0x46'));return _0x50d48f(_0x2985df['error'](0x1f4,_0x5e55('0x46')));});},'AbandonInteraction':function(_0x2bc3fe){var _0x187ab1=this;return new Promise(function(_0x4fedca,_0x1f6861){if(_0x2bc3fe[_0x5e55('0x13')]&&_0x2bc3fe[_0x5e55('0x15')]&&_0x2bc3fe[_0x5e55('0x15')]['id']){try{var _0x10236b=getId(_0x2bc3fe[_0x5e55('0x13')],_0x2bc3fe['message']?_0x2bc3fe[_0x5e55('0x14')]['id']:0x0,_0x2bc3fe[_0x5e55('0x15')]?_0x2bc3fe[_0x5e55('0x15')]['id']:0x0);if(_0x5701ac[_0x5e55('0x12')][_0x10236b]){_0x5701ac['rules'][_0x10236b][_0x5e55('0x39')](_0x5e55('0x42'));}return _0x4fedca({'code':0xc8,'message':_0x2bc3fe});}catch(_0xd60e42){logger[_0x5e55('0x35')](_0xd60e42[_0x5e55('0x3c')]);return _0x1f6861(_0x187ab1[_0x5e55('0x35')](0x1f4,_0xd60e42));}}logger[_0x5e55('0x35')](_0x5e55('0x46'));return _0x1f6861(_0x187ab1[_0x5e55('0x35')](0x1f4,_0x5e55('0x46')));});},'AgentCapacity':function(_0x5cb60c){var _0x51b341=this;return new Promise(function(_0x5b15ef,_0x5ed0d8){if(_0x5701ac[_0x5e55('0x40')][_0x5e55('0x47')](_0x5cb60c['id'])){for(var _0xc483b4 in _0x5cb60c[_0x5e55('0x48')]){if(_0x5cb60c[_0x5e55('0x48')]['hasOwnProperty'](_0xc483b4)){if(_0x5701ac['agents'][_0x5cb60c['id']][_0x5e55('0x47')](_0xc483b4+_0x5e55('0x49'))){_0x5701ac[_0x5e55('0x40')][_0x5cb60c['id']][_0xc483b4+_0x5e55('0x49')]=parseInt(_0x5cb60c['capacity'][_0xc483b4],0xa);}}}_0x5701ac[_0x5e55('0x40')][_0x5cb60c['id']][_0x5e55('0x4a')]();return _0x5b15ef({'code':0xc8,'message':_0x5701ac[_0x5e55('0x40')][_0x5cb60c['id']]});}else{return _0x5ed0d8(_0x51b341['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x17c761){return new Promise(function(_0x4641e9){var _0x4b2f94=_[_0x5e55('0x4b')](_0x5701ac[_0x5e55('0x40')]);if(_0x17c761&&_0x17c761['id']){var _0x2700b3=_[_0x5e55('0x4c')](_0x4b2f94,function(_0xb80f78){return _0xb80f78['id']===_0x17c761['id'];});_0x4641e9(_0x2700b3);}else{_0x4641e9({'count':_0x4b2f94[_0x5e55('0x19')],'rows':_0x4b2f94});}});},'ChatQueues':function(){return new Promise(function(_0x502160){var _0x344b04=[];for(var _0x383f1a in _0x5701ac[_0x5e55('0x4d')]){if(_0x5701ac[_0x5e55('0x4d')][_0x5e55('0x47')](_0x383f1a)){var _0x483b5a=_0x5701ac['chatQueues'][_0x383f1a];var _0x3c3fc5={'id':_0x483b5a['id'],'available':_0x483b5a['available'],'loggedIn':_0x483b5a['loggedIn'],'name':_0x483b5a[_0x5e55('0x4e')],'paused':_0x483b5a[_0x5e55('0x4f')],'waiting':_0x483b5a['waiting']};_0x344b04[_0x5e55('0x22')](_0x3c3fc5);}}_0x502160({'count':_0x344b04[_0x5e55('0x19')],'rows':_0x344b04});});},'MailQueues':function(){return new Promise(function(_0x18700e){var _0x1a004f=[];for(var _0xa28ff6 in _0x5701ac['mailQueues']){if(_0x5701ac[_0x5e55('0x50')][_0x5e55('0x47')](_0xa28ff6)){var _0x464488=_0x5701ac[_0x5e55('0x50')][_0xa28ff6];var _0x1088f9={'id':_0x464488['id'],'available':_0x464488[_0x5e55('0x51')],'loggedIn':_0x464488[_0x5e55('0x52')],'name':_0x464488['name'],'paused':_0x464488[_0x5e55('0x4f')],'waiting':_0x464488[_0x5e55('0x53')]};_0x1a004f[_0x5e55('0x22')](_0x1088f9);}}_0x18700e({'count':_0x1a004f['length'],'rows':_0x1a004f});});},'OpenchannelQueues':function(){return new Promise(function(_0xc8ae68){var _0x4a34a7=[];for(var _0x2445e8 in _0x5701ac[_0x5e55('0x54')]){if(_0x5701ac[_0x5e55('0x54')][_0x5e55('0x47')](_0x2445e8)){var _0x162b63=_0x5701ac['openchannelQueues'][_0x2445e8];var _0x3211ad={'id':_0x162b63['id'],'available':_0x162b63['available'],'loggedIn':_0x162b63[_0x5e55('0x52')],'name':_0x162b63[_0x5e55('0x4e')],'paused':_0x162b63[_0x5e55('0x4f')],'waiting':_0x162b63[_0x5e55('0x53')]};_0x4a34a7[_0x5e55('0x22')](_0x3211ad);}}_0xc8ae68({'count':_0x4a34a7[_0x5e55('0x19')],'rows':_0x4a34a7});});},'SmsQueues':function(){return new Promise(function(_0x208927){var _0x1fdf00=[];for(var _0x213125 in _0x5701ac[_0x5e55('0x55')]){if(_0x5701ac[_0x5e55('0x55')][_0x5e55('0x47')](_0x213125)){var _0x32e80c=_0x5701ac[_0x5e55('0x55')][_0x213125];var _0x372ff1={'id':_0x32e80c['id'],'available':_0x32e80c[_0x5e55('0x51')],'loggedIn':_0x32e80c[_0x5e55('0x52')],'name':_0x32e80c[_0x5e55('0x4e')],'paused':_0x32e80c[_0x5e55('0x4f')],'waiting':_0x32e80c[_0x5e55('0x53')]};_0x1fdf00[_0x5e55('0x22')](_0x372ff1);}}_0x208927({'count':_0x1fdf00[_0x5e55('0x19')],'rows':_0x1fdf00});});},'FaxQueues':function(){return new Promise(function(_0x59b842){var _0x11a4fe=[];for(var _0x3509f2 in _0x5701ac[_0x5e55('0x56')]){if(_0x5701ac[_0x5e55('0x56')][_0x5e55('0x47')](_0x3509f2)){var _0x3c44d0=_0x5701ac[_0x5e55('0x56')][_0x3509f2];var _0x569667={'id':_0x3c44d0['id'],'available':_0x3c44d0['available'],'loggedIn':_0x3c44d0[_0x5e55('0x52')],'name':_0x3c44d0[_0x5e55('0x4e')],'paused':_0x3c44d0['paused'],'waiting':_0x3c44d0['waiting']};_0x11a4fe[_0x5e55('0x22')](_0x569667);}}_0x59b842({'count':_0x11a4fe[_0x5e55('0x19')],'rows':_0x11a4fe});});},'WhatsappQueues':function(){return new Promise(function(_0x41b6b1){var _0x4aa352=[];for(var _0xf317ad in _0x5701ac[_0x5e55('0x57')]){if(_0x5701ac[_0x5e55('0x57')][_0x5e55('0x47')](_0xf317ad)){var _0x1c9a48=_0x5701ac[_0x5e55('0x57')][_0xf317ad];var _0xcb47a2={'id':_0x1c9a48['id'],'available':_0x1c9a48[_0x5e55('0x51')],'loggedIn':_0x1c9a48['loggedIn'],'name':_0x1c9a48[_0x5e55('0x4e')],'paused':_0x1c9a48[_0x5e55('0x4f')],'waiting':_0x1c9a48[_0x5e55('0x53')]};_0x4aa352[_0x5e55('0x22')](_0xcb47a2);}}_0x41b6b1({'count':_0x4aa352[_0x5e55('0x19')],'rows':_0x4aa352});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x13063c){var _0xaffeba=_[_0x5e55('0x4b')](_0x5701ac[_0x5e55('0x58')]);_0x13063c({'count':_0xaffeba[_0x5e55('0x19')],'rows':_0xaffeba});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x579898){var _0x406e8b=_['values'](_0x5701ac[_0x5e55('0x59')]);_0x579898({'count':_0x406e8b[_0x5e55('0x19')],'rows':_0x406e8b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x22ec60){var _0x4fbeff=_['values'](_0x5701ac[_0x5e55('0x5a')]);_0x22ec60({'count':_0x4fbeff[_0x5e55('0x19')],'rows':_0x4fbeff});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x17f002){var _0x8fd2fb=_[_0x5e55('0x4b')](_0x5701ac[_0x5e55('0x5b')]);_0x17f002({'count':_0x8fd2fb[_0x5e55('0x19')],'rows':_0x8fd2fb});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x33110a){var _0x4af7fe=_['values'](_0x5701ac[_0x5e55('0x5c')]);_0x33110a({'count':_0x4af7fe[_0x5e55('0x19')],'rows':_0x4af7fe});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xf625a0){var _0x4feb42=_[_0x5e55('0x4b')](_0x5701ac[_0x5e55('0x5d')]);_0xf625a0({'count':_0x4feb42['length'],'rows':_0x4feb42});});}};var _0x1bd172=jayson[_0x5e55('0x5e')](_0x43bd9a)[_0x5e55('0x5f')]();_0x1bd172['on'](_0x5e55('0x35'),function(_0x5d6ae5){logger[_0x5e55('0x35')](JSON[_0x5e55('0x60')](_0x5d6ae5));return _0x15a513(_0x5d6ae5);});_0x1bd172['listen'](0x232c,_0x5e55('0x61'),function(){console[_0x5e55('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x445db1(_0x5e55('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index eb78aa0..b07698c 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 _0xb492=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','lodash','../../../config/logger','routing','request','then','error','message','result','rules','info'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0xb492,0x185));var _0x2b49=function(_0x51492a,_0x187318){_0x51492a=_0x51492a-0x0;var _0x32f391=_0xb492[_0x51492a];return _0x32f391;};'use strict';var util=require('util');var BPromise=require(_0x2b49('0x0'));var jayson=require('jayson/promise');var _=require(_0x2b49('0x1'));var logger=require(_0x2b49('0x2'))(_0x2b49('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x4f8774,_0x1d6c9f){return new BPromise(function(_0x4b367b,_0x43cb73){return client[_0x2b49('0x4')](_0x4f8774,_0x1d6c9f)[_0x2b49('0x5')](function(_0x2cd46b){if(_0x2cd46b[_0x2b49('0x6')]){return _0x43cb73(_0x2cd46b[_0x2b49('0x6')][_0x2b49('0x7')]);}else{return _0x4b367b(_0x2cd46b[_0x2b49('0x8')]);}})['catch'](function(_0x1a93e7){return _0x43cb73(_0x1a93e7);});});}exports['condition']=function(_0x50b985,_0x557e7d,_0x3aa61a){return function(_0x2b6abf){if(_0x3aa61a[_0x2b49('0x9')]&&!_0x3aa61a[_0x2b49('0x9')][_0x50b985]){logger[_0x2b49('0xa')](_0x2b49('0xb'),_0x50b985);return _0x2b6abf[_0x2b49('0xc')]();}var _0x3e837f=[];for(var _0x4ecf2a=0x0;_0x4ecf2a<_0x557e7d[_0x2b49('0xd')];_0x4ecf2a+=0x1){_0x3e837f['push'](request(_0x2b49('0xe'),{'command':util['format']('iftime\x20%s',_0x557e7d[_0x4ecf2a])})[_0x2b49('0x5')](function(_0x59bc5a){return _0x59bc5a&&_0x59bc5a[_0x2b49('0x7')]&&_0x59bc5a['message']['indexOf']('true')>=0x0?!![]:![];})[_0x2b49('0xf')](function(_0x92478){logger[_0x2b49('0x6')](_0x2b49('0x10'),_0x50b985,_0x557e7d[_0x4ecf2a]);}));}BPromise[_0x2b49('0x11')](_0x3e837f)[_0x2b49('0x5')](function(_0x4f7b37){var _0x1c0934=_[_0x2b49('0x12')](_0x4f7b37);logger[_0x2b49('0xa')](_0x2b49('0x13'),_0x50b985,_0x557e7d[_0x2b49('0x14')](_0x2b49('0x15')),_0x1c0934);_0x2b6abf[_0x2b49('0x16')](_0x1c0934);})['catch'](function(_0x4bf639){console[_0x2b49('0x17')](_0x4bf639);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x50b985,_0x557e7d['join'](_0x2b49('0x15')),_0x4bf639[_0x2b49('0x18')]);_0x2b6abf['stop']();});};}; \ No newline at end of file +var _0x0a73=['message','result','catch','condition','rules','info','push','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','error'];(function(_0x512e72,_0x49ffe1){var _0x143086=function(_0x1d3921){while(--_0x1d3921){_0x512e72['push'](_0x512e72['shift']());}};_0x143086(++_0x49ffe1);}(_0x0a73,0x1e4));var _0x30a7=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x0a73[_0x118733];return _0x4777af;};'use strict';var util=require(_0x30a7('0x0'));var BPromise=require(_0x30a7('0x1'));var jayson=require(_0x30a7('0x2'));var _=require(_0x30a7('0x3'));var logger=require(_0x30a7('0x4'))(_0x30a7('0x5'));var client=jayson[_0x30a7('0x6')][_0x30a7('0x7')]({'port':0x232a});function request(_0x2709c8,_0x313c70){return new BPromise(function(_0x2b9486,_0x17941a){return client['request'](_0x2709c8,_0x313c70)['then'](function(_0x2e1a85){if(_0x2e1a85[_0x30a7('0x8')]){return _0x17941a(_0x2e1a85['error'][_0x30a7('0x9')]);}else{return _0x2b9486(_0x2e1a85[_0x30a7('0xa')]);}})[_0x30a7('0xb')](function(_0xc80a51){return _0x17941a(_0xc80a51);});});}exports[_0x30a7('0xc')]=function(_0x4ad239,_0x5c82bf,_0x5c76d9){return function(_0x38f9f7){if(_0x5c76d9[_0x30a7('0xd')]&&!_0x5c76d9[_0x30a7('0xd')][_0x4ad239]){logger[_0x30a7('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4ad239);return _0x38f9f7['stop']();}var _0xe2cb0a=[];for(var _0x1c8a11=0x0;_0x1c8a11<_0x5c82bf['length'];_0x1c8a11+=0x1){_0xe2cb0a[_0x30a7('0xf')](request('Command',{'command':util[_0x30a7('0x10')](_0x30a7('0x11'),_0x5c82bf[_0x1c8a11])})[_0x30a7('0x12')](function(_0x766b84){return _0x766b84&&_0x766b84[_0x30a7('0x9')]&&_0x766b84['message'][_0x30a7('0x13')](_0x30a7('0x14'))>=0x0?!![]:![];})[_0x30a7('0xb')](function(_0x32a755){logger[_0x30a7('0x8')](_0x30a7('0x15'),_0x4ad239,_0x5c82bf[_0x1c8a11]);}));}BPromise[_0x30a7('0x16')](_0xe2cb0a)['then'](function(_0x29fde4){var _0x1dc74b=_[_0x30a7('0x17')](_0x29fde4);logger['info'](_0x30a7('0x18'),_0x4ad239,_0x5c82bf[_0x30a7('0x19')](_0x30a7('0x1a')),_0x1dc74b);_0x38f9f7['when'](_0x1dc74b);})[_0x30a7('0xb')](function(_0x351b4a){console['log'](_0x351b4a);logger[_0x30a7('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x4ad239,_0x5c82bf['join']('\x20|\x20'),_0x351b4a[_0x30a7('0x1b')]);_0x38f9f7[_0x30a7('0x1c')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index c5e72c9..01280b9 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 _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x54082e,_0x3aeae2){var _0x3aa409=function(_0x20ed70){while(--_0x20ed70){_0x54082e['push'](_0x54082e['shift']());}};_0x3aa409(++_0x3aeae2);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file +var _0xa74f=['calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answered_elsewhere','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','indexOf','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue'];(function(_0x1565d4,_0x388f01){var _0x1f8ef9=function(_0x31f8b7){while(--_0x31f8b7){_0x1565d4['push'](_0x1565d4['shift']());}};_0x1f8ef9(++_0x388f01);}(_0xa74f,0x9a));var _0xfa74=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0xa74f[_0x544099];return _0x20ab09;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfa74('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4c4c00,_0x4b5765){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3'),_0x4c4c00[_0xfa74('0x4')],_0x4c4c00['channel'],_0x4c4c00[_0xfa74('0x5')],_0x4c4c00['membername'],_0x4c4c00['interface'],_0x4c4c00[_0xfa74('0x6')],_0x4c4c00[_0xfa74('0x7')],_0x4c4c00[_0xfa74('0x8')]));if(_0x4c4c00[_0xfa74('0x5')]){utils[_0xfa74('0x9')](_0x4c4c00[_0xfa74('0x5')])['then'](function(_0x32f55c){if(_0x32f55c){_0x4c4c00[_0xfa74('0xa')]=_0x32f55c[_0xfa74('0xa')];_0x4c4c00[_0xfa74('0xb')]=_0x4c4c00['agentcomplete']?_0x32f55c[_0xfa74('0xc')]:![];_0x4c4c00[_0xfa74('0xd')]=_0x4c4c00['agentacw']?_0x32f55c[_0xfa74('0xe')]:0x0;}utils[_0xfa74('0xf')](_0xfa74('0x10'),_0x4c4c00);});}else{utils[_0xfa74('0xf')]('CreateVoiceAgentReport',_0x4c4c00);}if(_0x4b5765){delete transfers[_0x4c4c00[_0xfa74('0x4')]];}else{delete agents[_0x4c4c00[_0xfa74('0x11')]];}}exports[_0xfa74('0x12')]=function(_0x278e8b){try{utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b[_0xfa74('0x4')]),_0x278e8b);agents[_0x278e8b[_0xfa74('0x11')]]=_0x278e8b;agents[_0x278e8b[_0xfa74('0x11')]]['agentcalledAt']=utils[_0xfa74('0x14')]();agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x8')]=_0xfa74('0x15');agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x7')]=null;agents[_0x278e8b[_0xfa74('0x11')]]['connectedlinename']=null;utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x278e8b['uniqueid'],agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x16')],_0x278e8b[_0xfa74('0x11')]));}catch(_0x5a863f){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b['uniqueid']),_0x5a863f);}};exports[_0xfa74('0x18')]=function(_0x302eb4){try{if(!_[_0xfa74('0x19')](agents[_0x302eb4['destuniqueid']])){utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x1a'),_0x302eb4[_0xfa74('0x4')]),_0x302eb4);utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x302eb4['uniqueid'],agents[_0x302eb4[_0xfa74('0x11')]]['membername'],_0x302eb4['destuniqueid']));agents[_0x302eb4['destuniqueid']][_0xfa74('0x18')]=!![];agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1b')]=utils['now']();agents[_0x302eb4['destuniqueid']][_0xfa74('0x8')]=_0xfa74('0x1c');agents[_0x302eb4['destuniqueid']][_0xfa74('0x1d')]='timeout';agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1e')]=_0x302eb4['ringtime']?parseInt(_0x302eb4[_0xfa74('0x1f')])/0x3e8:0x0;agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x20')]=0x0;unanswered[_0xfa74('0x21')](_0x302eb4['destuniqueid']);}}catch(_0xd9c55d){utils[_0xfa74('0x17')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]',_0x302eb4['uniqueid']),_0xd9c55d);}};exports[_0xfa74('0x22')]=function(_0x8b706e){try{_['forIn'](agents,function(_0x4b38fc,_0x343466){if(_0x4b38fc['uniqueid']==_0x8b706e[_0xfa74('0x4')]&&!_['includes'](unanswered,_0x4b38fc[_0xfa74('0x11')])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x8b706e);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x25'),_0x8b706e[_0xfa74('0x4')],_0x4b38fc[_0xfa74('0x16')],_0x4b38fc[_0xfa74('0x11')]));_0x4b38fc[_0xfa74('0x18')]=!![];_0x4b38fc['agentringnoanswerAt']=utils[_0xfa74('0x14')]();_0x4b38fc['lastevent']=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1d')]=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1e')]=_0x8b706e['holdtime'];_0x4b38fc['talktime']=0x0;writeDB(_0x4b38fc);}});}catch(_0x390ed4){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x390ed4);}};exports[_0xfa74('0x27')]=function(_0x231698){try{if(agents[_0x231698['destuniqueid']]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x231698['uniqueid']),_0x231698);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x28'),_0x231698[_0xfa74('0x4')],agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x16')],_0x231698[_0xfa74('0x11')]));agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x29')]=utils['now']();agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x7')]=_0x231698[_0xfa74('0x7')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x2a')]=_0x231698[_0xfa74('0x2a')];agents[_0x231698['destuniqueid']][_0xfa74('0x1e')]=_0x231698[_0xfa74('0x1f')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x8')]='connect';_[_0xfa74('0x2b')](agents,function(_0x13d9a5,_0xe8491b){if(_0x13d9a5[_0xfa74('0x11')]!=_0x231698['destuniqueid']&&_0x13d9a5[_0xfa74('0x4')]==_0x231698[_0xfa74('0x4')]){_0x13d9a5[_0xfa74('0x20')]=0x0;_0x13d9a5['holdtime']=_0x231698['ringtime'];_0x13d9a5[_0xfa74('0x18')]=!![];_0x13d9a5[_0xfa74('0x1b')]=utils[_0xfa74('0x14')]();_0x13d9a5[_0xfa74('0x8')]='answered_elsewhere';_0x13d9a5[_0xfa74('0x1d')]=_0xfa74('0x2c');_0x13d9a5['answeredelsewheredestinationuniqueid']=_0x231698['destuniqueid'];_0x13d9a5['answeredelsewheremembername']=_0x231698['membername'];writeDB(_0x13d9a5);}});}}catch(_0x95c891){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2d'),_0x231698[_0xfa74('0x4')]),_0x95c891);}};exports[_0xfa74('0x2e')]=function(_0x7735c5){try{if(!_['isNil'](agents[_0x7735c5[_0xfa74('0x11')]])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5[_0xfa74('0x4')]),_0x7735c5);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x30'),_0x7735c5[_0xfa74('0x4')],agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x16')],_0x7735c5[_0xfa74('0x11')]));agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x2e')]=!![];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')]=utils['now']();agents[_0x7735c5[_0xfa74('0x11')]]['talktime']=utils[_0xfa74('0x32')](agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')],agents[_0x7735c5[_0xfa74('0x11')]]['agentconnectAt']);agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x1d')]=_0x7735c5['reason'];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x8')]='complete';writeDB(agents[_0x7735c5[_0xfa74('0x11')]]);}}catch(_0x134d95){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5['uniqueid']),_0x134d95);}};exports['blindtransfer']=function(_0x36f6ca){try{if(!_[_0xfa74('0x19')](agents[_0x36f6ca['transfereruniqueid']])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca['uniqueid']),_0x36f6ca);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x34'),_0x36f6ca[_0xfa74('0x4')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x16')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')]));agents[_0x36f6ca[_0xfa74('0x35')]]['transfer']=!![];agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x36')]=_0xfa74('0x37');agents[_0x36f6ca[_0xfa74('0x35')]]['transferexten']=_0x36f6ca['extension'];agents[_0x36f6ca[_0xfa74('0x35')]]['transferuniqueid']=agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')];}}catch(_0x427469){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca[_0xfa74('0x4')]),_0x427469);}};exports['attendedtransfer']=function(_0x118cfc){try{utils['debug'](util[_0xfa74('0x2')]('[%s][agents][attendedtransfer]',_0x118cfc['origtransfereruniqueid']),_0x118cfc);if(_0x118cfc[_0xfa74('0x38')]==_0x118cfc[_0xfa74('0x39')]){if(!_['isNil'](agents[_0x118cfc['secondtransfereruniqueid']])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x36')]='ATTENDED';agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3d')]=_0x118cfc['origtransfererexten'];agents[_0x118cfc['secondtransfereruniqueid']][_0xfa74('0x3e')]=_0x118cfc[_0xfa74('0x38')];}if(_0x118cfc[_0xfa74('0x3f')]&&agents[_0x118cfc[_0xfa74('0x3f')]]){agents[_0x118cfc[_0xfa74('0x3f')]]['agententerreason']=0x1;transfers[_0x118cfc[_0xfa74('0x3f')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x3f')]]);transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x6')]=agents[_0x118cfc['secondtransfereruniqueid']]['calleridnum'];transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x40')];transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x29')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x1e')]=0x0;transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x42')]=0x2;}}else if(_0x118cfc['secondtransfereruniqueid']==_0x118cfc[_0xfa74('0x43')]){if(!_[_0xfa74('0x19')](agents[_0x118cfc[_0xfa74('0x38')]])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x36')]=_0xfa74('0x44');agents[_0x118cfc[_0xfa74('0x38')]]['transferexten']=_0x118cfc[_0xfa74('0x45')];agents[_0x118cfc[_0xfa74('0x38')]]['transferuniqueid']=_0x118cfc['secondtransfereruniqueid'];}if(_0x118cfc[_0xfa74('0x46')]&&agents[_0x118cfc['transfertargetuniqueid']]){agents[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x1;transfers[_0x118cfc[_0xfa74('0x46')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x46')]]);transfers[_0x118cfc['transfertargetuniqueid']]['calleridnum']=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x6')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x40')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x29')]=utils['now']();transfers[_0x118cfc[_0xfa74('0x46')]]['holdtime']=0x0;transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x2;}}}catch(_0x15b586){utils['error'](util[_0xfa74('0x2')](_0xfa74('0x47'),_0x118cfc[_0xfa74('0x38')]),_0x15b586);}};exports['hangup']=function(_0x1b8c06){try{utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x1b8c06);if(agents[_0x1b8c06['uniqueid']]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]===_0xfa74('0x1c')){if(_0x1b8c06[_0xfa74('0x49')]==='21'){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]=_0xfa74('0x4a');agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4a');}utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);var _0x491529=unanswered[_0xfa74('0x4b')](_0x1b8c06[_0xfa74('0x4')]);if(_0x491529>-0x1){unanswered[_0xfa74('0x4c')](_0x491529,0x1);}}if(transfers[_0x1b8c06[_0xfa74('0x4')]]){transfers[_0x1b8c06['uniqueid']][_0xfa74('0x2e')]=!![];transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();transfers[_0x1b8c06['uniqueid']][_0xfa74('0x20')]=utils['diffTime'](transfers[_0x1b8c06['uniqueid']][_0xfa74('0x31')],transfers[_0x1b8c06['uniqueid']][_0xfa74('0x29')]);transfers[_0x1b8c06[_0xfa74('0x4')]]['reason']='agent';transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06['uniqueid'],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],transfers[_0x1b8c06[_0xfa74('0x4')]]['lastevent']));writeDB(transfers[_0x1b8c06[_0xfa74('0x4')]],!![]);}if(agents[_0x1b8c06[_0xfa74('0x4')]]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x2e')]=!![];agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();agents[_0x1b8c06['uniqueid']]['talktime']=utils['diffTime'](agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]);agents[_0x1b8c06[_0xfa74('0x4')]]['reason']=agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x3c')]?'transfer':_0xfa74('0x4e');agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x4f'),_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06['uniqueid']]['reason'],agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);}}catch(_0x4d46e1){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x4d46e1);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 1941933..1245434 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 _0xf8fa=['noop','gotoif','[%s][calls][newexten]','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','debug','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','calleridname','callerid','cause-txt','endtime','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','variable','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','appdata','toLowerCase','set','cdr','lastIndexOf','includes','hangup'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x297be0,_0x941d2b){_0x297be0=_0x297be0-0x0;var _0x19276e=_0xf8fa[_0x297be0];return _0x19276e;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var utils=require(_0xaf8f('0x1'));var transfers=require(_0xaf8f('0x2'));var dispositions=[_0xaf8f('0x3'),'FAILED',_0xaf8f('0x4'),'NO\x20ANSWER',_0xaf8f('0x3'),_0xaf8f('0x3'),_0xaf8f('0x5'),'BUSY',_0xaf8f('0x4'),_0xaf8f('0x4'),_0xaf8f('0x4')];var channels={};function writeDB(_0x3b3f23){var _0x65d0eb;if(transfers['blinds'][_0x3b3f23['uniqueid']]){_0x65d0eb=_0x3b3f23['uniqueid'];_0x3b3f23[_0xaf8f('0x6')]=transfers[_0xaf8f('0x7')][_0x3b3f23[_0xaf8f('0x6')]][_0xaf8f('0x8')];}utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0xb'),_0x3b3f23[_0xaf8f('0x6')],_0x3b3f23['channel'],_0x3b3f23[_0xaf8f('0xc')],_0x3b3f23[_0xaf8f('0xd')],_0x3b3f23[_0xaf8f('0xe')],_0x3b3f23[_0xaf8f('0xf')],_0x3b3f23[_0xaf8f('0x10')],_0x3b3f23[_0xaf8f('0x11')]));if(_0x3b3f23[_0xaf8f('0x12')]){utils[_0xaf8f('0x13')](_0x3b3f23['accountcode'])['then'](function(_0x3fde7b){if(_0x3fde7b){_0x3b3f23[_0xaf8f('0x14')]=_0x3fde7b['id'];}utils[_0xaf8f('0x15')](_0xaf8f('0x16'),_0x3b3f23);});}else{utils[_0xaf8f('0x15')](_0xaf8f('0x16'),_0x3b3f23);}if(channels[_0x3b3f23[_0xaf8f('0x6')]]){delete channels[_0x3b3f23[_0xaf8f('0x6')]];}else if(_0x65d0eb&&channels[_0x65d0eb]){if(!transfers[_0xaf8f('0x7')][_0x65d0eb][_0xaf8f('0x17')])delete transfers[_0xaf8f('0x7')][_0x65d0eb];delete channels[_0x65d0eb];}}exports['newchannel']=function(_0x1fefe9){try{utils['debug'](util[_0xaf8f('0xa')](_0xaf8f('0x18'),_0x1fefe9['uniqueid']),_0x1fefe9);if(_0x1fefe9[_0xaf8f('0x6')]==_0x1fefe9[_0xaf8f('0x19')]&&_0x1fefe9[_0xaf8f('0x1a')]!=_0xaf8f('0x1b')){utils[_0xaf8f('0x9')](util['format'](_0xaf8f('0x1c'),_0x1fefe9[_0xaf8f('0x6')],_0x1fefe9[_0xaf8f('0x1d')],_0x1fefe9['exten']));channels[_0x1fefe9[_0xaf8f('0x6')]]={'uniqueid':_0x1fefe9[_0xaf8f('0x6')],'accountcode':_0x1fefe9[_0xaf8f('0x12')],'source':_0x1fefe9[_0xaf8f('0xf')],'destination':_0x1fefe9[_0xaf8f('0x1e')],'destinationcontext':_0x1fefe9[_0xaf8f('0x1d')],'channel':_0x1fefe9[_0xaf8f('0x1a')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaf8f('0x3'),'amaflags':_0xaf8f('0x1f')};}}catch(_0x37a91c){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][newchannel]',_0x1fefe9[_0xaf8f('0x6')]),_0x37a91c);}};exports[_0xaf8f('0x21')]=function(_0x4e75df){try{utils[_0xaf8f('0x22')](util['format']('[%s][calls][newstate]',_0x4e75df[_0xaf8f('0x6')]),_0x4e75df);if(!_['isNil'](channels[_0x4e75df[_0xaf8f('0x6')]])&&_0x4e75df[_0xaf8f('0x23')]==0x6){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x24'),_0x4e75df['uniqueid'],_0x4e75df[_0xaf8f('0x1d')],_0x4e75df[_0xaf8f('0x1a')]));if(_['isNil'](channels[_0x4e75df[_0xaf8f('0x6')]][_0xaf8f('0x25')])){channels[_0x4e75df[_0xaf8f('0x6')]][_0xaf8f('0x25')]=utils['now']();}}else if(!_[_0xaf8f('0x26')](channels[_0x4e75df[_0xaf8f('0x19')]])&&_0x4e75df[_0xaf8f('0x23')]==0x6&&_0x4e75df['context']!='transfer'){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x27'),_0x4e75df[_0xaf8f('0x6')],_0x4e75df['linkedid'],_0x4e75df[_0xaf8f('0x1d')],_0x4e75df[_0xaf8f('0x1a')]));channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x12')]=_0x4e75df[_0xaf8f('0x12')];channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x28')]=_0x4e75df[_0xaf8f('0x1a')];if(_[_0xaf8f('0x26')](channels[_0x4e75df[_0xaf8f('0x19')]]['answertime'])){channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x29')]=utils[_0xaf8f('0x2a')]();}channels[_0x4e75df['linkedid']][_0xaf8f('0x2b')]=dispositions[_[_0xaf8f('0x2c')](_0x4e75df['channelstate'])]||_0xaf8f('0x5');}}catch(_0xd8fb7c){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][newstate]',_0x4e75df[_0xaf8f('0x6')]),_0xd8fb7c);}};exports['hangup']=function(_0x1321f6){try{if(!_['isNil'](channels[_0x1321f6['uniqueid']])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][hangup]',_0x1321f6['uniqueid']),_0x1321f6);if(_[_0xaf8f('0x26')](channels[_0x1321f6['uniqueid']]['callerid'])){channels[_0x1321f6[_0xaf8f('0x6')]]['callerid']=_0x1321f6[_0xaf8f('0x2d')]+'\x20<'+_0x1321f6[_0xaf8f('0xf')]+'>';}utils['info'](util[_0xaf8f('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1321f6['uniqueid'],channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x2e')],_0x1321f6[_0xaf8f('0x2f')]));channels[_0x1321f6['uniqueid']][_0xaf8f('0x30')]=utils['now']();channels[_0x1321f6[_0xaf8f('0x6')]]['duration']=utils['diffTime'](channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x30')],channels[_0x1321f6['uniqueid']][_0xaf8f('0x31')]);channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x32')]=channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x29')]?utils[_0xaf8f('0x33')](channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x30')],channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x29')]):0x0;writeDB(channels[_0x1321f6[_0xaf8f('0x6')]]);}}catch(_0x822e96){utils[_0xaf8f('0x20')](util['format'](_0xaf8f('0x34'),_0x1321f6['uniqueid']),_0x822e96);}};exports[_0xaf8f('0x35')]=function(_0x280cc9){try{if(!_[_0xaf8f('0x26')](channels[_0x280cc9[_0xaf8f('0x36')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')](_0xaf8f('0x37'),_0x280cc9[_0xaf8f('0x38')]),_0x280cc9);if(channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x1a')]==_0x280cc9[_0xaf8f('0x39')]){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x3a'),_0x280cc9[_0xaf8f('0x38')],_0x280cc9['localtwolinkedid'],_0x280cc9['secondtransfererchannel']));channels[_0x280cc9['localtwolinkedid']]['destinationchannel']=_0x280cc9['secondtransfererchannel'];channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x3b')]='_attended';}else if(channels[_0x280cc9[_0xaf8f('0x36')]]['channel']=_0x280cc9[_0xaf8f('0x3c')]){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x280cc9[_0xaf8f('0x38')],_0x280cc9[_0xaf8f('0x36')],_0x280cc9['origtransfererchannel']));channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x28')]=_0x280cc9[_0xaf8f('0x3d')];channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x3b')]=_0xaf8f('0x3e');}}}catch(_0x2384d9){utils[_0xaf8f('0x20')](util['format'](_0xaf8f('0x37'),_0x280cc9[_0xaf8f('0x38')]),_0x2384d9);}};exports[_0xaf8f('0x3f')]=function(_0x1be1bd){try{if(!_['isNil'](channels[_0x1be1bd[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstart]',_0x1be1bd[_0xaf8f('0x6')]),_0x1be1bd);channels[_0x1be1bd[_0xaf8f('0x6')]]['musiconholdstartAt']=utils[_0xaf8f('0x2a')]();utils['info'](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1be1bd[_0xaf8f('0x6')],channels[_0x1be1bd[_0xaf8f('0x6')]][_0xaf8f('0x40')]));}}catch(_0x1b1dd3){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstart]',_0x1be1bd[_0xaf8f('0x6')]),_0x1b1dd3);}};exports[_0xaf8f('0x41')]=function(_0x1ed7ae){try{if(!_[_0xaf8f('0x26')](channels[_0x1ed7ae['uniqueid']])){utils['debug'](util[_0xaf8f('0xa')](_0xaf8f('0x42'),_0x1ed7ae['uniqueid']),_0x1ed7ae);if(!_[_0xaf8f('0x26')](channels[_0x1ed7ae['uniqueid']][_0xaf8f('0x40')])){channels[_0x1ed7ae[_0xaf8f('0x6')]][_0xaf8f('0x43')]+=utils[_0xaf8f('0x33')](utils[_0xaf8f('0x2a')](),channels[_0x1ed7ae['uniqueid']][_0xaf8f('0x40')]);utils['info'](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x1ed7ae[_0xaf8f('0x6')],channels[_0x1ed7ae[_0xaf8f('0x6')]][_0xaf8f('0x43')]));delete channels[_0x1ed7ae[_0xaf8f('0x6')]]['musiconholdstartAt'];}}}catch(_0x1515aa){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')](_0xaf8f('0x42'),_0x1ed7ae[_0xaf8f('0x6')]),_0x1515aa);}};exports[_0xaf8f('0x44')]=function(_0x2636eb){try{if(!_['isNil'](channels[_0x2636eb[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util['format'](_0xaf8f('0x45'),_0x2636eb[_0xaf8f('0x6')]),_0x2636eb);if(!_[_0xaf8f('0x26')](_0x2636eb['variable']['xmd-originatecalleridnum'])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x46'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']]['source']=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x48')])){utils['info'](util['format'](_0xaf8f('0x49'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']][_0xaf8f('0x4a')]=_0x2636eb[_0xaf8f('0x47')];channels[_0x2636eb[_0xaf8f('0x6')]]['callerid']='\x22'+_0x2636eb['value']+_0xaf8f('0x4b')+_0x2636eb[_0xaf8f('0x47')]+'>';}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x4c')])||!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-callerid'])){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x4e'),_0x2636eb['uniqueid'],!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x4c')])?_0xaf8f('0x4c'):'xmd-callerid',_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x2e')]=_0x2636eb['value'];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x4f')])||!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x50')])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2636eb[_0xaf8f('0x6')],!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-queue'])?'xmd-queue':'xmcs-queue',_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x51')]=_0xaf8f('0x52');channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x53')]=_0x2636eb[_0xaf8f('0x47')];channels[_0x2636eb['uniqueid']][_0xaf8f('0xc')]=!![];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-contactid'])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x54'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x55')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x56')])){utils['info'](util['format'](_0xaf8f('0x57'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x58')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x59')])){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x5a'),_0x2636eb['uniqueid'],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']][_0xaf8f('0x5b')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x5c')])){utils['info'](util['format'](_0xaf8f('0x5d'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x5c')]=_0x2636eb['value'];}}}catch(_0x32f993){utils['error'](util[_0xaf8f('0xa')](_0xaf8f('0x45'),_0x2636eb[_0xaf8f('0x6')]),_0x32f993);}};exports[_0xaf8f('0x5e')]=function(_0x2a0157){try{if(!_[_0xaf8f('0x26')](channels[_0x2a0157[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][newexten]',_0x2a0157['uniqueid']),_0x2a0157);utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2a0157[_0xaf8f('0x6')],_0x2a0157['application'],_0x2a0157[_0xaf8f('0x5f')]));if(_0x2a0157['application'][_0xaf8f('0x60')]()==_0xaf8f('0x61')&&_['startsWith'](_0x2a0157[_0xaf8f('0x5f')][_0xaf8f('0x60')](),_0xaf8f('0x62'))){var _0x401115=_0x2a0157[_0xaf8f('0x5f')]['split']('=');var _0x215982=_0x401115[0x0]['substring'](_0x401115[0x0][_0xaf8f('0x63')]('(')+0x1,_0x401115[0x0][_0xaf8f('0x63')](')'));var _0xced943=_0x401115[0x1];channels[_0x2a0157[_0xaf8f('0x6')]][_0x215982]=_0xced943;}if(!_[_0xaf8f('0x64')]([_0xaf8f('0x65'),_0xaf8f('0x66'),'execif','set',_0xaf8f('0x67')],_0x2a0157['application'][_0xaf8f('0x60')]())){channels[_0x2a0157[_0xaf8f('0x6')]][_0xaf8f('0x51')]=_0x2a0157['application'];channels[_0x2a0157['uniqueid']]['lastdata']=_0x2a0157[_0xaf8f('0x5f')];}}}catch(_0x9a6b7a){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')](_0xaf8f('0x68'),_0x2a0157[_0xaf8f('0x6')]),_0x9a6b7a);}}; \ No newline at end of file +var _0xdb7e=['duration','diffTime','endtime','starttime','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt'];(function(_0xadcdc0,_0x4d0185){var _0x47a752=function(_0xc22ae7){while(--_0xc22ae7){_0xadcdc0['push'](_0xadcdc0['shift']());}};_0x47a752(++_0x4d0185);}(_0xdb7e,0x11a));var _0xedb7=function(_0x1288b3,_0x46485d){_0x1288b3=_0x1288b3-0x0;var _0x5040f6=_0xdb7e[_0x1288b3];return _0x5040f6;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var utils=require(_0xedb7('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xedb7('0x3'),_0xedb7('0x4'),_0xedb7('0x4'),'NO\x20ANSWER',_0xedb7('0x3'),_0xedb7('0x3'),_0xedb7('0x5'),_0xedb7('0x6'),_0xedb7('0x4'),_0xedb7('0x4'),_0xedb7('0x4')];var channels={};function writeDB(_0x20a7c7){var _0x26774f;if(transfers[_0xedb7('0x7')][_0x20a7c7['uniqueid']]){_0x26774f=_0x20a7c7[_0xedb7('0x8')];_0x20a7c7[_0xedb7('0x8')]=transfers[_0xedb7('0x7')][_0x20a7c7[_0xedb7('0x8')]][_0xedb7('0x9')];}utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0xc'),_0x20a7c7[_0xedb7('0x8')],_0x20a7c7[_0xedb7('0xd')],_0x20a7c7[_0xedb7('0xe')],_0x20a7c7[_0xedb7('0xf')],_0x20a7c7[_0xedb7('0x10')],_0x20a7c7['calleridnum'],_0x20a7c7['connectedlinenum'],_0x20a7c7[_0xedb7('0x11')]));if(_0x20a7c7[_0xedb7('0x12')]){utils[_0xedb7('0x13')](_0x20a7c7[_0xedb7('0x12')])[_0xedb7('0x14')](function(_0x2923c2){if(_0x2923c2){_0x20a7c7[_0xedb7('0x15')]=_0x2923c2['id'];}utils[_0xedb7('0x16')](_0xedb7('0x17'),_0x20a7c7);});}else{utils['request']('CreateVoiceCallReport',_0x20a7c7);}if(channels[_0x20a7c7[_0xedb7('0x8')]]){delete channels[_0x20a7c7[_0xedb7('0x8')]];}else if(_0x26774f&&channels[_0x26774f]){if(!transfers[_0xedb7('0x7')][_0x26774f]['recording'])delete transfers[_0xedb7('0x7')][_0x26774f];delete channels[_0x26774f];}}exports[_0xedb7('0x18')]=function(_0x33554d){try{utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][newchannel]',_0x33554d['uniqueid']),_0x33554d);if(_0x33554d[_0xedb7('0x8')]==_0x33554d[_0xedb7('0x1a')]&&_0x33554d[_0xedb7('0xd')]!=_0xedb7('0x1b')){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x1c'),_0x33554d[_0xedb7('0x8')],_0x33554d['context'],_0x33554d[_0xedb7('0x1d')]));channels[_0x33554d['uniqueid']]={'uniqueid':_0x33554d[_0xedb7('0x8')],'accountcode':_0x33554d[_0xedb7('0x12')],'source':_0x33554d[_0xedb7('0x1e')],'destination':_0x33554d['exten'],'destinationcontext':_0x33554d['context'],'channel':_0x33554d[_0xedb7('0xd')],'starttime':utils[_0xedb7('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xedb7('0x20')};}}catch(_0xff6827){utils['error'](util[_0xedb7('0xb')]('[%s][calls][newchannel]',_0x33554d['uniqueid']),_0xff6827);}};exports[_0xedb7('0x21')]=function(_0x45b331){try{utils['debug'](util[_0xedb7('0xb')](_0xedb7('0x22'),_0x45b331[_0xedb7('0x8')]),_0x45b331);if(!_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x8')]])&&_0x45b331[_0xedb7('0x24')]==0x6){utils[_0xedb7('0xa')](util[_0xedb7('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x45b331[_0xedb7('0x8')],_0x45b331['context'],_0x45b331['channel']));if(_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x8')]]['systemanswertime'])){channels[_0x45b331['uniqueid']][_0xedb7('0x25')]=utils['now']();}}else if(!_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x1a')]])&&_0x45b331[_0xedb7('0x24')]==0x6&&_0x45b331['context']!=_0xedb7('0x26')){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x27'),_0x45b331[_0xedb7('0x8')],_0x45b331[_0xedb7('0x1a')],_0x45b331['context'],_0x45b331[_0xedb7('0xd')]));channels[_0x45b331['linkedid']][_0xedb7('0x12')]=_0x45b331['accountcode'];channels[_0x45b331[_0xedb7('0x1a')]]['destinationchannel']=_0x45b331[_0xedb7('0xd')];if(_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x1a')]]['answertime'])){channels[_0x45b331['linkedid']][_0xedb7('0x28')]=utils[_0xedb7('0x1f')]();}channels[_0x45b331[_0xedb7('0x1a')]]['disposition']=dispositions[_[_0xedb7('0x29')](_0x45b331['channelstate'])]||_0xedb7('0x5');}}catch(_0x182fcc){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')](_0xedb7('0x22'),_0x45b331[_0xedb7('0x8')]),_0x182fcc);}};exports['hangup']=function(_0x401c28){try{if(!_[_0xedb7('0x23')](channels[_0x401c28['uniqueid']])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x2b'),_0x401c28[_0xedb7('0x8')]),_0x401c28);if(_[_0xedb7('0x23')](channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')])){channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')]=_0x401c28[_0xedb7('0x2d')]+'\x20<'+_0x401c28[_0xedb7('0x1e')]+'>';}utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x2e'),_0x401c28['uniqueid'],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')],_0x401c28[_0xedb7('0x2f')]));channels[_0x401c28[_0xedb7('0x8')]]['endtime']=utils[_0xedb7('0x1f')]();channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x30')]=utils[_0xedb7('0x31')](channels[_0x401c28['uniqueid']][_0xedb7('0x32')],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x33')]);channels[_0x401c28[_0xedb7('0x8')]]['billableseconds']=channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x28')]?utils[_0xedb7('0x31')](channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x32')],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x28')]):0x0;writeDB(channels[_0x401c28['uniqueid']]);}}catch(_0x14ebb7){utils['error'](util[_0xedb7('0xb')](_0xedb7('0x2b'),_0x401c28[_0xedb7('0x8')]),_0x14ebb7);}};exports['attendedtransfer']=function(_0x41fef4){try{if(!_[_0xedb7('0x23')](channels[_0x41fef4[_0xedb7('0x34')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][attendedtransfer]',_0x41fef4['origtransfereruniqueid']),_0x41fef4);if(channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0xd')]==_0x41fef4[_0xedb7('0x35')]){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x36'),_0x41fef4[_0xedb7('0x37')],_0x41fef4[_0xedb7('0x34')],_0x41fef4[_0xedb7('0x38')]));channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x39')]=_0x41fef4[_0xedb7('0x38')];channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x3a')]='_attended';}else if(channels[_0x41fef4[_0xedb7('0x34')]]['channel']=_0x41fef4[_0xedb7('0x3b')]){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x36'),_0x41fef4[_0xedb7('0x37')],_0x41fef4[_0xedb7('0x34')],_0x41fef4[_0xedb7('0x3c')]));channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x39')]=_0x41fef4[_0xedb7('0x3c')];channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x3a')]=_0xedb7('0x3d');}}}catch(_0x3082fa){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')]('[%s][calls][attendedtransfer]',_0x41fef4[_0xedb7('0x37')]),_0x3082fa);}};exports[_0xedb7('0x3e')]=function(_0x2e55ee){try{if(!_[_0xedb7('0x23')](channels[_0x2e55ee[_0xedb7('0x8')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x3f'),_0x2e55ee[_0xedb7('0x8')]),_0x2e55ee);channels[_0x2e55ee[_0xedb7('0x8')]][_0xedb7('0x40')]=utils[_0xedb7('0x1f')]();utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x41'),_0x2e55ee[_0xedb7('0x8')],channels[_0x2e55ee[_0xedb7('0x8')]][_0xedb7('0x40')]));}}catch(_0x578751){utils['error'](util[_0xedb7('0xb')](_0xedb7('0x3f'),_0x2e55ee[_0xedb7('0x8')]),_0x578751);}};exports[_0xedb7('0x42')]=function(_0x41a834){try{if(!_[_0xedb7('0x23')](channels[_0x41a834['uniqueid']])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][musiconholdstop]',_0x41a834[_0xedb7('0x8')]),_0x41a834);if(!_[_0xedb7('0x23')](channels[_0x41a834['uniqueid']]['musiconholdstartAt'])){channels[_0x41a834[_0xedb7('0x8')]]['mohtime']+=utils[_0xedb7('0x31')](utils[_0xedb7('0x1f')](),channels[_0x41a834['uniqueid']]['musiconholdstartAt']);utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x43'),_0x41a834['uniqueid'],channels[_0x41a834[_0xedb7('0x8')]][_0xedb7('0x44')]));delete channels[_0x41a834['uniqueid']][_0xedb7('0x40')];}}}catch(_0x2defae){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')](_0xedb7('0x45'),_0x41a834[_0xedb7('0x8')]),_0x2defae);}};exports['varset']=function(_0x523175){try{if(!_[_0xedb7('0x23')](channels[_0x523175[_0xedb7('0x8')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x46'),_0x523175[_0xedb7('0x8')]),_0x523175);if(!_['isNil'](_0x523175[_0xedb7('0x47')]['xmd-originatecalleridnum'])){utils[_0xedb7('0xa')](util['format'](_0xedb7('0x48'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175['uniqueid']][_0xedb7('0x4a')]=_0x523175[_0xedb7('0x49')];}if(!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x4b')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x4c'),_0x523175[_0xedb7('0x8')],_0x523175['value']));channels[_0x523175[_0xedb7('0x8')]]['destination']=_0x523175[_0xedb7('0x49')];channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x2c')]='\x22'+_0x523175[_0xedb7('0x49')]+_0xedb7('0x4d')+_0x523175[_0xedb7('0x49')]+'>';}if(!_[_0xedb7('0x23')](_0x523175['variable']['xmd-callerid-preview'])||!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x4e')])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x4f'),_0x523175['uniqueid'],!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x50')])?_0xedb7('0x50'):'xmd-callerid',_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x2c')]=_0x523175[_0xedb7('0x49')];}if(!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x51')])||!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x52')])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x4f'),_0x523175[_0xedb7('0x8')],!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x51')])?'xmd-queue':_0xedb7('0x52'),_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x53')]=_0xedb7('0x54');channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x55')]=_0x523175[_0xedb7('0x49')];channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0xe')]=!![];}if(!_[_0xedb7('0x23')](_0x523175['variable']['xmd-contactid'])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x56'),_0x523175[_0xedb7('0x8')],_0x523175['value']));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x57')]=_0x523175['value'];}if(!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x58')])){utils[_0xedb7('0xa')](util['format'](_0xedb7('0x59'),_0x523175['uniqueid'],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]]['type']=_0x523175['value'];}if(!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x5a')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x5b'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]]['routeid']=_0x523175[_0xedb7('0x49')];}if(!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x5c')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x5d'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x5c')]=_0x523175[_0xedb7('0x49')];}}}catch(_0x20cb3f){utils[_0xedb7('0x2a')](util['format'](_0xedb7('0x46'),_0x523175['uniqueid']),_0x20cb3f);}};exports[_0xedb7('0x5e')]=function(_0x46695b){try{if(!_['isNil'](channels[_0x46695b[_0xedb7('0x8')]])){utils['debug'](util[_0xedb7('0xb')](_0xedb7('0x5f'),_0x46695b[_0xedb7('0x8')]),_0x46695b);utils[_0xedb7('0xa')](util[_0xedb7('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x46695b[_0xedb7('0x8')],_0x46695b['application'],_0x46695b[_0xedb7('0x60')]));if(_0x46695b[_0xedb7('0x61')][_0xedb7('0x62')]()==_0xedb7('0x63')&&_[_0xedb7('0x64')](_0x46695b[_0xedb7('0x60')][_0xedb7('0x62')](),_0xedb7('0x65'))){var _0x99ce77=_0x46695b[_0xedb7('0x60')][_0xedb7('0x66')]('=');var _0x2ff4bd=_0x99ce77[0x0][_0xedb7('0x67')](_0x99ce77[0x0][_0xedb7('0x68')]('(')+0x1,_0x99ce77[0x0][_0xedb7('0x68')](')'));var _0x27555c=_0x99ce77[0x1];channels[_0x46695b['uniqueid']][_0x2ff4bd]=_0x27555c;}if(!_[_0xedb7('0x69')]([_0xedb7('0x6a'),_0xedb7('0x6b'),_0xedb7('0x6c'),'set',_0xedb7('0x6d')],_0x46695b['application'][_0xedb7('0x62')]())){channels[_0x46695b['uniqueid']][_0xedb7('0x53')]=_0x46695b['application'];channels[_0x46695b[_0xedb7('0x8')]][_0xedb7('0x55')]=_0x46695b[_0xedb7('0x60')];}}}catch(_0x5f4532){utils['error'](util['format'](_0xedb7('0x5f'),_0x46695b['uniqueid']),_0x5f4532);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 23f28b1..4e9a7f1 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 _0x99be=['info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','./utils','connect','shutdown'];(function(_0x12d985,_0xf9a9a9){var _0x580fc9=function(_0x46878a){while(--_0x46878a){_0x12d985['push'](_0x12d985['shift']());}};_0x580fc9(++_0xf9a9a9);}(_0x99be,0x1c8));var _0xe99b=function(_0x4c163a,_0x4efff5){_0x4c163a=_0x4c163a-0x0;var _0x580942=_0x99be[_0x4c163a];return _0x580942;};'use strict';var utils=require(_0xe99b('0x0'));exports[_0xe99b('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0xe99b('0x2')]=function(){utils[_0xe99b('0x3')](_0xe99b('0x4'));};exports['fullybooted']=function(){utils[_0xe99b('0x3')](_0xe99b('0x5'));};exports[_0xe99b('0x6')]=function(_0x1c10ca){utils['error'](_0xe99b('0x7'),_0x1c10ca);};exports['close']=function(){utils['info'](_0xe99b('0x8'));};exports['managerevent']=function(_0x56a218){}; \ No newline at end of file +var _0xcfde=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','./utils','connect'];(function(_0x9d3488,_0x37907f){var _0x16792e=function(_0x319043){while(--_0x319043){_0x9d3488['push'](_0x9d3488['shift']());}};_0x16792e(++_0x37907f);}(_0xcfde,0x111));var _0xecfd=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xcfde[_0x33032e];return _0x13316b;};'use strict';var utils=require(_0xecfd('0x0'));exports[_0xecfd('0x1')]=function(){utils[_0xecfd('0x2')](_0xecfd('0x3'));};exports[_0xecfd('0x4')]=function(){utils[_0xecfd('0x2')](_0xecfd('0x5'));};exports[_0xecfd('0x6')]=function(){utils[_0xecfd('0x2')](_0xecfd('0x7'));};exports[_0xecfd('0x8')]=function(_0x1aa003){utils[_0xecfd('0x8')]('[core]\x20error',_0x1aa003);};exports[_0xecfd('0x9')]=function(){utils['info'](_0xecfd('0xa'));};exports['managerevent']=function(_0x3e04ae){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b6d19ab..cf14975 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 _0xb8e0=['assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','complete','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]'];(function(_0x2d07bf,_0x4dc777){var _0x4f7dfa=function(_0x51b9b4){while(--_0x51b9b4){_0x2d07bf['push'](_0x2d07bf['shift']());}};_0x4f7dfa(++_0x4dc777);}(_0xb8e0,0x146));var _0x0b8e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xb8e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0b8e('0x0'));var util=require('util');var utils=require(_0x0b8e('0x1'));var dials={};function writeDB(_0x45ac0d){utils[_0x0b8e('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x45ac0d['uniqueid'],_0x45ac0d['channel'],_0x45ac0d[_0x0b8e('0x3')],_0x45ac0d[_0x0b8e('0x4')],_0x45ac0d[_0x0b8e('0x5')],_0x45ac0d[_0x0b8e('0x6')]));utils[_0x0b8e('0x7')](_0x0b8e('0x8'),_0x45ac0d);delete dials[_0x45ac0d[_0x0b8e('0x9')]];}exports[_0x0b8e('0xa')]=function(_0x581b24){try{utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0xd'),_0x581b24['uniqueid']),_0x581b24);utils['info'](util[_0x0b8e('0xc')](_0x0b8e('0xe'),_0x581b24[_0x0b8e('0x9')],_0x581b24['application'],_0x581b24[_0x0b8e('0xf')]));if(_0x581b24[_0x0b8e('0x10')][_0x0b8e('0x11')]()==_0x0b8e('0x12')&&_[_0x0b8e('0x13')](_0x581b24['appdata'][_0x0b8e('0x11')](),_0x0b8e('0x14'))){var _0x1f4233=_0x581b24[_0x0b8e('0xf')]['split']('=');dials[_0x581b24[_0x0b8e('0x9')]]={'routeId':_0x1f4233[0x1]};}}catch(_0x529d6e){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][newexten]',_0x581b24[_0x0b8e('0x9')]),_0x529d6e);}};exports[_0x0b8e('0x16')]=function(_0x2d37c2){try{utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x17'),_0x2d37c2[_0x0b8e('0x9')]),_0x2d37c2);if(!_[_0x0b8e('0x18')](_0x2d37c2[_0x0b8e('0x19')][_0x0b8e('0x1a')])){utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x1b'),_0x2d37c2[_0x0b8e('0x9')],_0x2d37c2[_0x0b8e('0x1c')]));dials[_0x2d37c2['uniqueid']]={'routeId':_0x2d37c2[_0x0b8e('0x1c')]};}}catch(_0x16b82e){utils[_0x0b8e('0x15')](util['format'](_0x0b8e('0x17'),_0x2d37c2[_0x0b8e('0x9')]),_0x16b82e);}};exports[_0x0b8e('0x1d')]=function(_0x297f32){try{if(!_['isNil'](dials[_0x297f32['uniqueid']])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x1e'),_0x297f32[_0x0b8e('0x9')]),_0x297f32);dials[_0x297f32[_0x0b8e('0x9')]]=_[_0x0b8e('0x1f')](dials[_0x297f32[_0x0b8e('0x9')]],_0x297f32);dials[_0x297f32[_0x0b8e('0x9')]][_0x0b8e('0x20')]=utils[_0x0b8e('0x21')]();dials[_0x297f32[_0x0b8e('0x9')]][_0x0b8e('0x22')]=_0x0b8e('0x23');utils[_0x0b8e('0x2')](util['format'](_0x0b8e('0x24'),_0x297f32['uniqueid'],dials[_0x297f32[_0x0b8e('0x9')]]['starttime']));}}catch(_0x5599da){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][dialbegin]',_0x297f32['uniqueid']),_0x5599da);}};exports[_0x0b8e('0x25')]=function(_0x1cd49d){try{if(!_['isNil'](dials[_0x1cd49d[_0x0b8e('0x9')]])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x26'),_0x1cd49d[_0x0b8e('0x9')]),_0x1cd49d);dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x6')]=_0x1cd49d[_0x0b8e('0x6')];if(_0x1cd49d[_0x0b8e('0x6')]==_0x0b8e('0x27')){dials[_0x1cd49d['uniqueid']]=_[_0x0b8e('0x1f')](dials[_0x1cd49d['uniqueid']],_0x1cd49d);dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x28')]=utils[_0x0b8e('0x21')]();dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x22')]=_0x0b8e('0x29');utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x2a'),_0x1cd49d[_0x0b8e('0x9')],_0x1cd49d[_0x0b8e('0x6')],dials[_0x1cd49d[_0x0b8e('0x9')]]['answertime']));}else{utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x2b'),_0x1cd49d[_0x0b8e('0x9')],_0x1cd49d[_0x0b8e('0x6')]));}}}catch(_0x39127e){utils[_0x0b8e('0x15')](util['format'](_0x0b8e('0x26'),_0x1cd49d[_0x0b8e('0x9')]),_0x39127e);}};exports[_0x0b8e('0x2c')]=function(_0x15e15){try{if(!_[_0x0b8e('0x18')](dials[_0x15e15[_0x0b8e('0x9')]])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x2d'),_0x15e15[_0x0b8e('0x9')]),_0x15e15);utils['info'](util[_0x0b8e('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x15e15['uniqueid'],_0x15e15[_0x0b8e('0x4')],_0x15e15['calleridname'],_0x15e15['cause-txt']));dials[_0x15e15[_0x0b8e('0x9')]]=_[_0x0b8e('0x1f')](dials[_0x15e15['uniqueid']],{'endtime':utils[_0x0b8e('0x21')](),'lastevent':_0x0b8e('0x2e')});dials[_0x15e15[_0x0b8e('0x9')]]['duration']=utils[_0x0b8e('0x2f')](dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x30')],dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x20')]);dials[_0x15e15['uniqueid']][_0x0b8e('0x31')]=utils[_0x0b8e('0x2f')](dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x28')]||dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x30')],dials[_0x15e15['uniqueid']][_0x0b8e('0x20')]);dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x32')]=dials[_0x15e15[_0x0b8e('0x9')]]['answertime']?utils[_0x0b8e('0x2f')](dials[_0x15e15['uniqueid']]['endtime'],dials[_0x15e15[_0x0b8e('0x9')]]['answertime']):0x0;writeDB(dials[_0x15e15[_0x0b8e('0x9')]]);}}catch(_0x308f17){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][hangup]',_0x15e15['uniqueid']),_0x308f17);}}; \ No newline at end of file +var _0xbecd=['error','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','endtime','holdtime','diffTime','answertime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','application','appdata','toLowerCase','set','startsWith','split','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbecd,0x174));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdbec('0x0'));var util=require(_0xdbec('0x1'));var utils=require('./utils');var dials={};function writeDB(_0xeaa0fd){utils[_0xdbec('0x2')](util[_0xdbec('0x3')](_0xdbec('0x4'),_0xeaa0fd['uniqueid'],_0xeaa0fd[_0xdbec('0x5')],_0xeaa0fd[_0xdbec('0x6')],_0xeaa0fd[_0xdbec('0x7')],_0xeaa0fd[_0xdbec('0x8')],_0xeaa0fd[_0xdbec('0x9')]));utils[_0xdbec('0xa')](_0xdbec('0xb'),_0xeaa0fd);delete dials[_0xeaa0fd['uniqueid']];}exports[_0xdbec('0xc')]=function(_0x103a39){try{utils[_0xdbec('0xd')](util[_0xdbec('0x3')](_0xdbec('0xe'),_0x103a39[_0xdbec('0xf')]),_0x103a39);utils['info'](util[_0xdbec('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x103a39[_0xdbec('0xf')],_0x103a39[_0xdbec('0x10')],_0x103a39[_0xdbec('0x11')]));if(_0x103a39[_0xdbec('0x10')][_0xdbec('0x12')]()==_0xdbec('0x13')&&_[_0xdbec('0x14')](_0x103a39[_0xdbec('0x11')][_0xdbec('0x12')](),'cdr(routeid)')){var _0x15cdf1=_0x103a39[_0xdbec('0x11')][_0xdbec('0x15')]('=');dials[_0x103a39[_0xdbec('0xf')]]={'routeId':_0x15cdf1[0x1]};}}catch(_0x3547a8){utils['error'](util[_0xdbec('0x3')](_0xdbec('0xe'),_0x103a39[_0xdbec('0xf')]),_0x3547a8);}};exports[_0xdbec('0x16')]=function(_0x84eed0){try{utils[_0xdbec('0xd')](util[_0xdbec('0x3')](_0xdbec('0x17'),_0x84eed0[_0xdbec('0xf')]),_0x84eed0);if(!_[_0xdbec('0x18')](_0x84eed0[_0xdbec('0x19')]['outboundrouteid'])){utils['info'](util[_0xdbec('0x3')](_0xdbec('0x1a'),_0x84eed0[_0xdbec('0xf')],_0x84eed0[_0xdbec('0x1b')]));dials[_0x84eed0['uniqueid']]={'routeId':_0x84eed0[_0xdbec('0x1b')]};}}catch(_0x13470c){utils[_0xdbec('0x1c')](util[_0xdbec('0x3')](_0xdbec('0x17'),_0x84eed0['uniqueid']),_0x13470c);}};exports['dialbegin']=function(_0x535114){try{if(!_[_0xdbec('0x18')](dials[_0x535114[_0xdbec('0xf')]])){utils[_0xdbec('0xd')](util[_0xdbec('0x3')]('[%s][dials][dialbegin]',_0x535114['uniqueid']),_0x535114);dials[_0x535114[_0xdbec('0xf')]]=_[_0xdbec('0x1d')](dials[_0x535114['uniqueid']],_0x535114);dials[_0x535114[_0xdbec('0xf')]][_0xdbec('0x1e')]=utils[_0xdbec('0x1f')]();dials[_0x535114[_0xdbec('0xf')]][_0xdbec('0x20')]=_0xdbec('0x21');utils['info'](util[_0xdbec('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x535114['uniqueid'],dials[_0x535114[_0xdbec('0xf')]][_0xdbec('0x1e')]));}}catch(_0x59d909){utils['error'](util[_0xdbec('0x3')](_0xdbec('0x22'),_0x535114[_0xdbec('0xf')]),_0x59d909);}};exports[_0xdbec('0x23')]=function(_0x201584){try{if(!_[_0xdbec('0x18')](dials[_0x201584[_0xdbec('0xf')]])){utils[_0xdbec('0xd')](util['format'](_0xdbec('0x24'),_0x201584[_0xdbec('0xf')]),_0x201584);dials[_0x201584[_0xdbec('0xf')]][_0xdbec('0x9')]=_0x201584['dialstatus'];if(_0x201584[_0xdbec('0x9')]=='ANSWER'){dials[_0x201584['uniqueid']]=_[_0xdbec('0x1d')](dials[_0x201584[_0xdbec('0xf')]],_0x201584);dials[_0x201584['uniqueid']]['answertime']=utils[_0xdbec('0x1f')]();dials[_0x201584[_0xdbec('0xf')]][_0xdbec('0x20')]=_0xdbec('0x25');utils[_0xdbec('0x2')](util[_0xdbec('0x3')](_0xdbec('0x26'),_0x201584[_0xdbec('0xf')],_0x201584['dialstatus'],dials[_0x201584[_0xdbec('0xf')]]['answertime']));}else{utils['info'](util[_0xdbec('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x201584[_0xdbec('0xf')],_0x201584['dialstatus']));}}}catch(_0x4d55dc){utils[_0xdbec('0x1c')](util[_0xdbec('0x3')](_0xdbec('0x24'),_0x201584['uniqueid']),_0x4d55dc);}};exports[_0xdbec('0x27')]=function(_0x569ad7){try{if(!_[_0xdbec('0x18')](dials[_0x569ad7[_0xdbec('0xf')]])){utils[_0xdbec('0xd')](util[_0xdbec('0x3')](_0xdbec('0x28'),_0x569ad7[_0xdbec('0xf')]),_0x569ad7);utils[_0xdbec('0x2')](util[_0xdbec('0x3')](_0xdbec('0x29'),_0x569ad7[_0xdbec('0xf')],_0x569ad7[_0xdbec('0x7')],_0x569ad7['calleridname'],_0x569ad7[_0xdbec('0x2a')]));dials[_0x569ad7['uniqueid']]=_[_0xdbec('0x1d')](dials[_0x569ad7[_0xdbec('0xf')]],{'endtime':utils[_0xdbec('0x1f')](),'lastevent':_0xdbec('0x2b')});dials[_0x569ad7['uniqueid']][_0xdbec('0x2c')]=utils['diffTime'](dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x2d')],dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x1e')]);dials[_0x569ad7['uniqueid']][_0xdbec('0x2e')]=utils[_0xdbec('0x2f')](dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x30')]||dials[_0x569ad7['uniqueid']]['endtime'],dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x1e')]);dials[_0x569ad7['uniqueid']][_0xdbec('0x31')]=dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x30')]?utils[_0xdbec('0x2f')](dials[_0x569ad7[_0xdbec('0xf')]][_0xdbec('0x2d')],dials[_0x569ad7[_0xdbec('0xf')]]['answertime']):0x0;writeDB(dials[_0x569ad7[_0xdbec('0xf')]]);}}catch(_0x2ce114){utils[_0xdbec('0x1c')](util['format'](_0xdbec('0x28'),_0x569ad7[_0xdbec('0xf')]),_0x2ce114);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f3a1f08..b860e57 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 _0x1a2e=['util','xdr','disabled','env','production','local','port','asterisk','username','password','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils'];(function(_0x49bdc4,_0x1e2507){var _0x1f7437=function(_0x25a9f9){while(--_0x25a9f9){_0x49bdc4['push'](_0x49bdc4['shift']());}};_0x1f7437(++_0x1e2507);}(_0x1a2e,0x19c));var _0xe1a2=function(_0x4fa614,_0x4296e5){_0x4fa614=_0x4fa614-0x0;var _0x42ef6e=_0x1a2e[_0x4fa614];return _0x42ef6e;};var AsteriskManager=require(_0xe1a2('0x0'));var config=require('../../config/environment');var utils=require(_0xe1a2('0x1'));var util=require(_0xe1a2('0x2'));var isXDREnabled=config[_0xe1a2('0x3')]&&config['xdr'][_0xe1a2('0x4')]?!config['xdr'][_0xe1a2('0x4')]:!![];var isProduction=config[_0xe1a2('0x5')]===_0xe1a2('0x6')||![];var isLocalAsterisk=config[_0xe1a2('0x3')]&&config[_0xe1a2('0x3')][_0xe1a2('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xe1a2('0x8')],config[_0xe1a2('0x9')]['ip'],config[_0xe1a2('0x9')][_0xe1a2('0xa')],config[_0xe1a2('0x9')][_0xe1a2('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xe1a2('0xc')](_0xe1a2('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe1a2('0xe'));var calls=require(_0xe1a2('0xf'));var queues=require('./queues.controller');var recordings=require(_0xe1a2('0x10'));var members=require(_0xe1a2('0x11'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xe1a2('0x12'));ami['on'](_0xe1a2('0x13'),core[_0xe1a2('0x13')]);ami['on']('shutdown',core[_0xe1a2('0x14')]);ami['on'](_0xe1a2('0x15'),core[_0xe1a2('0x15')]);ami['on'](_0xe1a2('0x16'),core[_0xe1a2('0x16')]);ami['on'](_0xe1a2('0x17'),core[_0xe1a2('0x17')]);ami['on'](_0xe1a2('0x18'),core[_0xe1a2('0x18')]);ami['on'](_0xe1a2('0x19'),function(_0xb3ae86){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x1b'),_0xb3ae86[_0xe1a2('0x1c')]),_0xb3ae86);members['devicestatechange'](_0xb3ae86);}catch(_0x19ed63){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x1b'),_0xb3ae86[_0xe1a2('0x1c')]),_0x19ed63);}});ami['on'](_0xe1a2('0x1e'),function(_0x8532c7){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x1f'),_0x8532c7[_0xe1a2('0x20')]),_0x8532c7);agents[_0xe1a2('0x1e')](_0x8532c7);}catch(_0x2e2982){utils[_0xe1a2('0x16')](util['format']('[%s][index][agentcalled]',_0x8532c7[_0xe1a2('0x20')]),_0x2e2982);}});ami['on']('agentringnoanswer',function(_0x471d76){try{utils['debug'](util[_0xe1a2('0x1d')](_0xe1a2('0x21'),_0x471d76[_0xe1a2('0x20')]),_0x471d76);agents[_0xe1a2('0x22')](_0x471d76);}catch(_0x59b958){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x21'),_0x471d76[_0xe1a2('0x20')]),_0x59b958);}});ami['on'](_0xe1a2('0x23'),function(_0x13bb2b){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x24'),_0x13bb2b[_0xe1a2('0x20')]),_0x13bb2b);agents['agentconnect'](_0x13bb2b);queues[_0xe1a2('0x23')](_0x13bb2b);}catch(_0x2cd4c7){utils['error'](util['format']('[%s][index][agentconnect]',_0x13bb2b['uniqueid']),_0x2cd4c7);}});ami['on'](_0xe1a2('0x25'),function(_0x4b9782){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][agentcomplete]',_0x4b9782['uniqueid']),_0x4b9782);agents[_0xe1a2('0x25')](_0x4b9782);queues['agentcomplete'](_0x4b9782);members[_0xe1a2('0x25')](_0x4b9782);}catch(_0x1ba16b){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][agentcomplete]',_0x4b9782[_0xe1a2('0x20')]),_0x1ba16b);}});ami['on'](_0xe1a2('0x26'),function(_0x28c183){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x27'),_0x28c183['uniqueid']),_0x28c183);agents[_0xe1a2('0x26')](_0x28c183);queues[_0xe1a2('0x26')](_0x28c183);}catch(_0x4e91db){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][queuecallerabandon]',_0x28c183[_0xe1a2('0x20')]),_0x4e91db);}});ami['on'](_0xe1a2('0x28'),function(_0x4a3b40){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x29'),_0x4a3b40[_0xe1a2('0x20')]),_0x4a3b40);queues[_0xe1a2('0x28')](_0x4a3b40);recordings[_0xe1a2('0x28')](_0x4a3b40);}catch(_0x378081){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x29'),_0x4a3b40[_0xe1a2('0x20')]),_0x378081);}});ami['on'](_0xe1a2('0x2a'),function(_0x13cc2c){try{utils['debug'](util[_0xe1a2('0x1d')](_0xe1a2('0x2b'),_0x13cc2c[_0xe1a2('0x20')]),_0x13cc2c);queues[_0xe1a2('0x2a')](_0x13cc2c);}catch(_0xbf594e){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][queuecallerleave]',_0x13cc2c[_0xe1a2('0x20')]),_0xbf594e);}});ami['on']('musiconholdstart',function(_0x531678){try{utils['debug'](util['format'](_0xe1a2('0x2c'),_0x531678[_0xe1a2('0x20')]),_0x531678);queues[_0xe1a2('0x2d')](_0x531678);calls[_0xe1a2('0x2d')](_0x531678);}catch(_0x5e9a59){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x2c'),_0x531678[_0xe1a2('0x20')]),_0x5e9a59);}});ami['on']('musiconholdstop',function(_0x15ce0e){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][musiconholdstop]',_0x15ce0e[_0xe1a2('0x20')]),_0x15ce0e);queues[_0xe1a2('0x2e')](_0x15ce0e);calls[_0xe1a2('0x2e')](_0x15ce0e);}catch(_0x2fa01a){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][musiconholdstop]',_0x15ce0e[_0xe1a2('0x20')]),_0x2fa01a);}});ami['on'](_0xe1a2('0x2f'),function(_0x9ae94){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x30'),_0x9ae94[_0xe1a2('0x20')]),_0x9ae94);calls[_0xe1a2('0x2f')](_0x9ae94);recordings['newstate'](_0x9ae94);}catch(_0x1a4366){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x30'),_0x9ae94[_0xe1a2('0x20')]),_0x1a4366);}});ami['on'](_0xe1a2('0x31'),function(_0x270625){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][hangup]',_0x270625[_0xe1a2('0x20')]),_0x270625);calls[_0xe1a2('0x31')](_0x270625);recordings[_0xe1a2('0x31')](_0x270625);dials[_0xe1a2('0x31')](_0x270625);agents[_0xe1a2('0x31')](_0x270625);queues[_0xe1a2('0x31')](_0x270625);}catch(_0x4eb8bf){utils[_0xe1a2('0x16')](util['format'](_0xe1a2('0x32'),_0x270625['uniqueid']),_0x4eb8bf);}});ami['on']('cdr',function(_0x39cb35){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x33'),_0x39cb35[_0xe1a2('0x20')]),_0x39cb35);members[_0xe1a2('0x34')](_0x39cb35);}catch(_0x44b107){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x33'),_0x39cb35['uniqueid']),_0x44b107);}});ami['on'](_0xe1a2('0x35'),function(_0x533029){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][blindtransfer]',_0x533029[_0xe1a2('0x20')]),_0x533029);queues[_0xe1a2('0x35')](_0x533029);agents[_0xe1a2('0x35')](_0x533029);transfers[_0xe1a2('0x35')](_0x533029);recordings['blindtransfer'](_0x533029);}catch(_0x5c12f5){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x36'),_0x533029[_0xe1a2('0x20')]),_0x5c12f5);}});ami['on']('attendedtransfer',function(_0xe51dfc){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][attendedtransfer]',_0xe51dfc[_0xe1a2('0x37')]),_0xe51dfc);queues['attendedtransfer'](_0xe51dfc);transfers['attendedtransfer'](_0xe51dfc);agents['attendedtransfer'](_0xe51dfc);calls[_0xe1a2('0x38')](_0xe51dfc);}catch(_0x374256){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x39'),_0xe51dfc[_0xe1a2('0x37')]),_0x374256);}});ami['on'](_0xe1a2('0x3a'),function(_0x553308){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x3b'),_0x553308[_0xe1a2('0x20')]),_0x553308);queues['varset'](_0x553308);recordings['varset'](_0x553308);calls[_0xe1a2('0x3a')](_0x553308);dials[_0xe1a2('0x3a')](_0x553308);}catch(_0xdd6d8a){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3b'),_0x553308[_0xe1a2('0x20')]),_0xdd6d8a);}});ami['on'](_0xe1a2('0x3c'),function(_0x3a754c){try{utils['debug'](util['format']('[%s][index][newexten]',_0x3a754c[_0xe1a2('0x20')]),_0x3a754c);calls[_0xe1a2('0x3c')](_0x3a754c);recordings['newexten'](_0x3a754c);dials[_0xe1a2('0x3c')](_0x3a754c);}catch(_0x4a3cc6){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3d'),_0x3a754c[_0xe1a2('0x20')]),_0x4a3cc6);}});ami['on'](_0xe1a2('0x3e'),function(_0x545f65){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x3f'),_0x545f65[_0xe1a2('0x20')]),_0x545f65);calls['newchannel'](_0x545f65);recordings['newchannel'](_0x545f65);}catch(_0x2d72a4){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3f'),_0x545f65[_0xe1a2('0x20')]),_0x2d72a4);}});ami['on'](_0xe1a2('0x40'),function(_0x3dd8c8){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x41'),_0x3dd8c8['uniqueid']),_0x3dd8c8);dials[_0xe1a2('0x40')](_0x3dd8c8);}catch(_0x224b59){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x42'),_0x3dd8c8[_0xe1a2('0x20')]),_0x224b59);}});ami['on'](_0xe1a2('0x43'),function(_0x3695e7){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x44'),_0x3695e7['uniqueid']),_0x3695e7);dials[_0xe1a2('0x43')](_0x3695e7);}catch(_0x2cb000){utils[_0xe1a2('0x16')](util['format'](_0xe1a2('0x44'),_0x3695e7[_0xe1a2('0x20')]),_0x2cb000);}});} \ No newline at end of file +var _0xa204=['[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][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]dialbegin','[%s][index][dialend]','dialend','util','xdr','disabled','env','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa204,0x16f));var _0x4a20=function(_0x3d9ea9,_0x59d418){_0x3d9ea9=_0x3d9ea9-0x0;var _0x244234=_0xa204[_0x3d9ea9];return _0x244234;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x4a20('0x0'));var isXDREnabled=config[_0x4a20('0x1')]&&config[_0x4a20('0x1')][_0x4a20('0x2')]?!config['xdr'][_0x4a20('0x2')]:!![];var isProduction=config[_0x4a20('0x3')]==='production'||![];var isLocalAsterisk=config[_0x4a20('0x1')]&&config['xdr'][_0x4a20('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x4a20('0x5')][_0x4a20('0x6')],config[_0x4a20('0x5')]['ip'],config[_0x4a20('0x5')][_0x4a20('0x7')],config[_0x4a20('0x5')][_0x4a20('0x8')],!![]);ami[_0x4a20('0x9')]();if(!isXDREnabled){utils[_0x4a20('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x4a20('0xa')](_0x4a20('0xb'));}else{var agents=require(_0x4a20('0xc'));var calls=require('./calls.controller');var queues=require(_0x4a20('0xd'));var recordings=require(_0x4a20('0xe'));var members=require(_0x4a20('0xf'));var dials=require('./dials.controller');var transfers=require(_0x4a20('0x10'));var core=require(_0x4a20('0x11'));ami['on'](_0x4a20('0x12'),core[_0x4a20('0x12')]);ami['on'](_0x4a20('0x13'),core[_0x4a20('0x13')]);ami['on'](_0x4a20('0x14'),core[_0x4a20('0x14')]);ami['on'](_0x4a20('0x15'),core[_0x4a20('0x15')]);ami['on'](_0x4a20('0x16'),core[_0x4a20('0x16')]);ami['on'](_0x4a20('0x17'),core[_0x4a20('0x17')]);ami['on'](_0x4a20('0x18'),function(_0x441bdb){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')]('[%s][index][devicestatechange]',_0x441bdb[_0x4a20('0x1b')]),_0x441bdb);members[_0x4a20('0x18')](_0x441bdb);}catch(_0x1da29e){utils[_0x4a20('0x15')](util['format'](_0x4a20('0x1c'),_0x441bdb[_0x4a20('0x1b')]),_0x1da29e);}});ami['on'](_0x4a20('0x1d'),function(_0x1c9842){try{utils['debug'](util[_0x4a20('0x1a')](_0x4a20('0x1e'),_0x1c9842[_0x4a20('0x1f')]),_0x1c9842);agents[_0x4a20('0x1d')](_0x1c9842);}catch(_0x19e3ad){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x1e'),_0x1c9842['uniqueid']),_0x19e3ad);}});ami['on'](_0x4a20('0x20'),function(_0x32ba33){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x21'),_0x32ba33['uniqueid']),_0x32ba33);agents['agentringnoanswer'](_0x32ba33);}catch(_0x2d8e41){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x21'),_0x32ba33[_0x4a20('0x1f')]),_0x2d8e41);}});ami['on'](_0x4a20('0x22'),function(_0x53137b){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x23'),_0x53137b[_0x4a20('0x1f')]),_0x53137b);agents[_0x4a20('0x22')](_0x53137b);queues[_0x4a20('0x22')](_0x53137b);}catch(_0x1ebc79){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x23'),_0x53137b[_0x4a20('0x1f')]),_0x1ebc79);}});ami['on'](_0x4a20('0x24'),function(_0x25ed3b){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x25'),_0x25ed3b[_0x4a20('0x1f')]),_0x25ed3b);agents[_0x4a20('0x24')](_0x25ed3b);queues[_0x4a20('0x24')](_0x25ed3b);members[_0x4a20('0x24')](_0x25ed3b);}catch(_0x4403f3){utils[_0x4a20('0x15')](util['format'](_0x4a20('0x25'),_0x25ed3b[_0x4a20('0x1f')]),_0x4403f3);}});ami['on'](_0x4a20('0x26'),function(_0x31ed28){try{utils['debug'](util['format'](_0x4a20('0x27'),_0x31ed28['uniqueid']),_0x31ed28);agents['queuecallerabandon'](_0x31ed28);queues[_0x4a20('0x26')](_0x31ed28);}catch(_0x1ceb21){utils[_0x4a20('0x15')](util['format']('[%s][index][queuecallerabandon]',_0x31ed28[_0x4a20('0x1f')]),_0x1ceb21);}});ami['on'](_0x4a20('0x28'),function(_0x3abf72){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x29'),_0x3abf72[_0x4a20('0x1f')]),_0x3abf72);queues[_0x4a20('0x28')](_0x3abf72);recordings['queuecallerjoin'](_0x3abf72);}catch(_0x28042e){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x29'),_0x3abf72['uniqueid']),_0x28042e);}});ami['on'](_0x4a20('0x2a'),function(_0x168703){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x2b'),_0x168703['uniqueid']),_0x168703);queues[_0x4a20('0x2a')](_0x168703);}catch(_0x16e588){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')]('[%s][index][queuecallerleave]',_0x168703[_0x4a20('0x1f')]),_0x16e588);}});ami['on'](_0x4a20('0x2c'),function(_0x5b8630){try{utils[_0x4a20('0x19')](util['format']('[%s][index][musiconholdstart]',_0x5b8630[_0x4a20('0x1f')]),_0x5b8630);queues[_0x4a20('0x2c')](_0x5b8630);calls['musiconholdstart'](_0x5b8630);}catch(_0x3054ad){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x2d'),_0x5b8630[_0x4a20('0x1f')]),_0x3054ad);}});ami['on'](_0x4a20('0x2e'),function(_0x189ace){try{utils['debug'](util[_0x4a20('0x1a')](_0x4a20('0x2f'),_0x189ace[_0x4a20('0x1f')]),_0x189ace);queues[_0x4a20('0x2e')](_0x189ace);calls[_0x4a20('0x2e')](_0x189ace);}catch(_0x24e29f){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x2f'),_0x189ace[_0x4a20('0x1f')]),_0x24e29f);}});ami['on'](_0x4a20('0x30'),function(_0x16c81a){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x31'),_0x16c81a[_0x4a20('0x1f')]),_0x16c81a);calls['newstate'](_0x16c81a);recordings[_0x4a20('0x30')](_0x16c81a);}catch(_0x17b8c8){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x31'),_0x16c81a[_0x4a20('0x1f')]),_0x17b8c8);}});ami['on'](_0x4a20('0x32'),function(_0x5ea6ab){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x33'),_0x5ea6ab[_0x4a20('0x1f')]),_0x5ea6ab);calls[_0x4a20('0x32')](_0x5ea6ab);recordings[_0x4a20('0x32')](_0x5ea6ab);dials[_0x4a20('0x32')](_0x5ea6ab);agents['hangup'](_0x5ea6ab);queues[_0x4a20('0x32')](_0x5ea6ab);}catch(_0x2bc464){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')]('[%s][index][hangup]',_0x5ea6ab[_0x4a20('0x1f')]),_0x2bc464);}});ami['on'](_0x4a20('0x34'),function(_0x500dcf){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x35'),_0x500dcf[_0x4a20('0x1f')]),_0x500dcf);members[_0x4a20('0x34')](_0x500dcf);}catch(_0x57f980){utils[_0x4a20('0x15')](util['format'](_0x4a20('0x35'),_0x500dcf[_0x4a20('0x1f')]),_0x57f980);}});ami['on'](_0x4a20('0x36'),function(_0x4244d1){try{utils[_0x4a20('0x19')](util['format'](_0x4a20('0x37'),_0x4244d1[_0x4a20('0x1f')]),_0x4244d1);queues['blindtransfer'](_0x4244d1);agents[_0x4a20('0x36')](_0x4244d1);transfers[_0x4a20('0x36')](_0x4244d1);recordings[_0x4a20('0x36')](_0x4244d1);}catch(_0x31df9a){utils['error'](util[_0x4a20('0x1a')]('[%s][index][blindtransfer]',_0x4244d1[_0x4a20('0x1f')]),_0x31df9a);}});ami['on'](_0x4a20('0x38'),function(_0x3f1811){try{utils[_0x4a20('0x19')](util['format'](_0x4a20('0x39'),_0x3f1811[_0x4a20('0x3a')]),_0x3f1811);queues[_0x4a20('0x38')](_0x3f1811);transfers[_0x4a20('0x38')](_0x3f1811);agents[_0x4a20('0x38')](_0x3f1811);calls['attendedtransfer'](_0x3f1811);}catch(_0x4c4c42){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x39'),_0x3f1811[_0x4a20('0x3a')]),_0x4c4c42);}});ami['on'](_0x4a20('0x3b'),function(_0x239f83){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x3c'),_0x239f83[_0x4a20('0x1f')]),_0x239f83);queues[_0x4a20('0x3b')](_0x239f83);recordings[_0x4a20('0x3b')](_0x239f83);calls[_0x4a20('0x3b')](_0x239f83);dials[_0x4a20('0x3b')](_0x239f83);}catch(_0x401c7d){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x3c'),_0x239f83[_0x4a20('0x1f')]),_0x401c7d);}});ami['on'](_0x4a20('0x3d'),function(_0x28900a){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x3e'),_0x28900a[_0x4a20('0x1f')]),_0x28900a);calls[_0x4a20('0x3d')](_0x28900a);recordings[_0x4a20('0x3d')](_0x28900a);dials[_0x4a20('0x3d')](_0x28900a);}catch(_0x447e3f){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x3e'),_0x28900a['uniqueid']),_0x447e3f);}});ami['on']('newchannel',function(_0x1edf0d){try{utils['debug'](util['format'](_0x4a20('0x3f'),_0x1edf0d[_0x4a20('0x1f')]),_0x1edf0d);calls[_0x4a20('0x40')](_0x1edf0d);recordings['newchannel'](_0x1edf0d);}catch(_0x2d1424){utils[_0x4a20('0x15')](util['format']('[%s][index][newchannel]',_0x1edf0d[_0x4a20('0x1f')]),_0x2d1424);}});ami['on'](_0x4a20('0x41'),function(_0x2f0931){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')]('[%s][index][dialbegin]',_0x2f0931[_0x4a20('0x1f')]),_0x2f0931);dials[_0x4a20('0x41')](_0x2f0931);}catch(_0x520ead){utils[_0x4a20('0x15')](util[_0x4a20('0x1a')](_0x4a20('0x42'),_0x2f0931[_0x4a20('0x1f')]),_0x520ead);}});ami['on']('dialend',function(_0x2ed0ef){try{utils[_0x4a20('0x19')](util[_0x4a20('0x1a')](_0x4a20('0x43'),_0x2ed0ef[_0x4a20('0x1f')]),_0x2ed0ef);dials[_0x4a20('0x44')](_0x2ed0ef);}catch(_0x216f93){utils[_0x4a20('0x15')](util['format']('[%s][index][dialend]',_0x2ed0ef[_0x4a20('0x1f')]),_0x216f93);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 76553c4..bdc2738 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 _0x861c=['util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data2','lodash'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x861c,0xdb));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var utils=require(_0xc861('0x2'));var members={};var exclude=[_0xc861('0x3'),_0xc861('0x4')];function writeDB(_0x200550){utils[_0xc861('0x5')](util[_0xc861('0x6')](_0xc861('0x7'),_0x200550[_0xc861('0x8')],_0x200550[_0xc861('0x9')],_0x200550[_0xc861('0xa')],_0x200550['data2'],_0x200550[_0xc861('0xb')],_0x200550[_0xc861('0xc')]));if(_0x200550[_0xc861('0x9')]){utils[_0xc861('0xd')](_0x200550[_0xc861('0x9')])[_0xc861('0xe')](function(_0x3c9cd6){if(_0x3c9cd6){_0x200550[_0xc861('0xb')]=_0x3c9cd6[_0xc861('0xf')];_0x200550[_0xc861('0x10')]=_0x3c9cd6[_0xc861('0x10')];utils[_0xc861('0x11')](_0xc861('0x12'),_0x200550);}else{utils['getUserByName'](_0x200550[_0xc861('0x9')][_0xc861('0x13')]('/')[0x1])[_0xc861('0xe')](function(_0x43e524){if(_0x43e524){_0x200550['membername']=_0x43e524[_0xc861('0xf')];_0x200550[_0xc861('0x10')]=_0x43e524[_0xc861('0x10')];utils[_0xc861('0x11')]('CreateMemberReport',_0x200550);}});}})['catch'](function(_0x210ceb){utils[_0xc861('0x14')](util['format'](_0xc861('0x15'),_0x200550[_0xc861('0x8')]),_0x210ceb);});}delete members[_0x200550['interface']];}function startsWith(_0x21941e,_0x3ca46d){return _[_0xc861('0x16')](_0x21941e,function(_0xd8e34a){return _[_0xc861('0x17')](_0x3ca46d,_0xd8e34a);});}exports[_0xc861('0x18')]=function(_0x5d6040){try{utils['debug'](util[_0xc861('0x6')]('[%s][members][devicestatechange]',members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040['device']),_0x5d6040);utils[_0xc861('0x5')](util['format'](_0xc861('0x1a'),members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040[_0xc861('0x19')],_0x5d6040[_0xc861('0x1b')],_0x5d6040[_0xc861('0x19')]));switch(_0x5d6040[_0xc861('0x1b')]){case _0xc861('0x1c'):case _0xc861('0x1d'):if(!startsWith(exclude,_0x5d6040[_0xc861('0x19')])){members[_0x5d6040[_0xc861('0x19')]]={'channel':_0xc861('0x1e'),'interface':_0x5d6040[_0xc861('0x19')],'type':_0xc861('0x1f'),'enterAt':utils[_0xc861('0x20')](),'role':'agent'};}break;case _0xc861('0x21'):if(!_[_0xc861('0x22')](members[_0x5d6040[_0xc861('0x19')]])){members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x23')]=utils[_0xc861('0x20')]();members[_0x5d6040['device']][_0xc861('0x24')]=utils[_0xc861('0x25')](members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x23')],members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x26')]);if(members[_0x5d6040['device']][_0xc861('0x8')]){writeDB(members[_0x5d6040['device']]);}}break;default:break;}}catch(_0x5af598){utils['error'](util[_0xc861('0x6')](_0xc861('0x27'),members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040[_0xc861('0x19')]),_0x5af598);}};exports[_0xc861('0x28')]=function(_0x5c205a){try{if(!_['isNil'](members[_0x5c205a[_0xc861('0x9')]])){utils[_0xc861('0x29')](util[_0xc861('0x6')]('[%s][members][agentcomplete]',_0x5c205a[_0xc861('0x8')]),_0x5c205a);utils['info'](util[_0xc861('0x6')](_0xc861('0x2a'),_0x5c205a[_0xc861('0x8')],_0x5c205a[_0xc861('0x9')],_0x5c205a['queue']));members[_0x5c205a[_0xc861('0x9')]]=_[_0xc861('0x2b')](members[_0x5c205a[_0xc861('0x9')]],{'data4':_0x5c205a[_0xc861('0x2c')],'uniqueid':_0x5c205a[_0xc861('0x8')]});}}catch(_0x2b9ee9){utils[_0xc861('0x14')](util[_0xc861('0x6')](_0xc861('0x2d'),_0x5c205a['uniqueid']),_0x2b9ee9);}};exports[_0xc861('0x2e')]=function(_0x514f54){try{utils[_0xc861('0x29')](util[_0xc861('0x6')](_0xc861('0x2f'),_0x514f54[_0xc861('0x8')]),_0x514f54);if(_0x514f54[_0xc861('0xa')]){var _0x2dbef7=_0x514f54[_0xc861('0xa')][_0xc861('0x13')]('-')[0x0];if(!_[_0xc861('0x22')](members[_0x2dbef7])){members[_0x2dbef7]=_[_0xc861('0x2b')](members[_0x2dbef7],{'data1':members[_0x2dbef7][_0xc861('0x30')]||_0x514f54[_0xc861('0xc')],'data2':members[_0x2dbef7]['data2']||_0x514f54[_0xc861('0x31')],'data3':members[_0x2dbef7][_0xc861('0x32')]||_0x514f54[_0xc861('0x33')],'uniqueid':members[_0x2dbef7][_0xc861('0x8')]||_0x514f54[_0xc861('0x8')]});utils[_0xc861('0x5')](util[_0xc861('0x6')](_0xc861('0x34'),_0x514f54[_0xc861('0x8')],members[_0x2dbef7][_0xc861('0x30')],members[_0x2dbef7]['data2'],members[_0x2dbef7][_0xc861('0x32')]));if(members[_0x2dbef7]['exitAt']){writeDB(members[_0x2dbef7]);}}}if(_0x514f54[_0xc861('0x35')]){var _0x3afab2=_0x514f54[_0xc861('0x35')][_0xc861('0x13')]('-')[0x0];if(!_['isNil'](members[_0x3afab2])){members[_0x3afab2]=_['assign'](members[_0x3afab2],{'data1':members[_0x3afab2][_0xc861('0x30')]||_0x514f54['type'],'data2':members[_0x3afab2][_0xc861('0x36')]||_0x514f54[_0xc861('0x31')],'data3':members[_0x3afab2][_0xc861('0x32')]||_0x514f54['destination'],'uniqueid':members[_0x3afab2]['uniqueid']||_0x514f54[_0xc861('0x8')]});utils['info'](util[_0xc861('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x514f54[_0xc861('0x8')],members[_0x3afab2][_0xc861('0x30')],members[_0x3afab2][_0xc861('0x36')],members[_0x3afab2][_0xc861('0x32')]));if(members[_0x3afab2][_0xc861('0x23')]){writeDB(members[_0x3afab2]);}}}}catch(_0x24ce01){utils[_0xc861('0x14')](util[_0xc861('0x6')](_0xc861('0x2f'),_0x514f54[_0xc861('0x8')]),_0x24ce01);}}; \ No newline at end of file +var _0xc9f5=['[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','data2','destination','data1','data3','destinationchannel','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Queue:','info','uniqueid','channel','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','some','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','now','exitAt','duration','diffTime','[%s][members][devicestatechange]','agentcomplete','isNil','debug'];(function(_0x5d0012,_0x2835b5){var _0x1463b9=function(_0x451994){while(--_0x451994){_0x5d0012['push'](_0x5d0012['shift']());}};_0x1463b9(++_0x2835b5);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xc9f5[_0x4bc65f];return _0x44f85f;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var utils=require(_0x5c9f('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x5c9f('0x2')];function writeDB(_0x2fb7c4){utils[_0x5c9f('0x3')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2fb7c4[_0x5c9f('0x4')],_0x2fb7c4['interface'],_0x2fb7c4[_0x5c9f('0x5')],_0x2fb7c4['data2'],_0x2fb7c4[_0x5c9f('0x6')],_0x2fb7c4[_0x5c9f('0x7')]));if(_0x2fb7c4[_0x5c9f('0x8')]){utils[_0x5c9f('0x9')](_0x2fb7c4[_0x5c9f('0x8')])[_0x5c9f('0xa')](function(_0x216f5a){if(_0x216f5a){_0x2fb7c4[_0x5c9f('0x6')]=_0x216f5a[_0x5c9f('0xb')];_0x2fb7c4[_0x5c9f('0xc')]=_0x216f5a[_0x5c9f('0xc')];utils[_0x5c9f('0xd')](_0x5c9f('0xe'),_0x2fb7c4);}else{utils[_0x5c9f('0xf')](_0x2fb7c4[_0x5c9f('0x8')][_0x5c9f('0x10')]('/')[0x1])[_0x5c9f('0xa')](function(_0x589e03){if(_0x589e03){_0x2fb7c4[_0x5c9f('0x6')]=_0x589e03[_0x5c9f('0xb')];_0x2fb7c4[_0x5c9f('0xc')]=_0x589e03[_0x5c9f('0xc')];utils[_0x5c9f('0xd')](_0x5c9f('0xe'),_0x2fb7c4);}});}})['catch'](function(_0x29e02b){utils[_0x5c9f('0x11')](util[_0x5c9f('0x12')](_0x5c9f('0x13'),_0x2fb7c4[_0x5c9f('0x4')]),_0x29e02b);});}delete members[_0x2fb7c4[_0x5c9f('0x8')]];}function startsWith(_0x25d813,_0x281b49){return _[_0x5c9f('0x14')](_0x25d813,function(_0x5c4730){return _['startsWith'](_0x281b49,_0x5c4730);});}exports['devicestatechange']=function(_0x48feaf){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x48feaf[_0x5c9f('0x15')]]?members[_0x48feaf[_0x5c9f('0x15')]]['uniqueid']:_0x48feaf['device']),_0x48feaf);utils[_0x5c9f('0x3')](util[_0x5c9f('0x12')](_0x5c9f('0x16'),members[_0x48feaf[_0x5c9f('0x15')]]?members[_0x48feaf[_0x5c9f('0x15')]][_0x5c9f('0x4')]:_0x48feaf[_0x5c9f('0x15')],_0x48feaf[_0x5c9f('0x17')],_0x48feaf[_0x5c9f('0x15')]));switch(_0x48feaf[_0x5c9f('0x17')]){case'INUSE':case _0x5c9f('0x18'):if(!startsWith(exclude,_0x48feaf[_0x5c9f('0x15')])){members[_0x48feaf[_0x5c9f('0x15')]]={'channel':_0x5c9f('0x19'),'interface':_0x48feaf[_0x5c9f('0x15')],'type':'TALKING','enterAt':utils[_0x5c9f('0x1a')](),'role':'agent'};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x48feaf['device']])){members[_0x48feaf[_0x5c9f('0x15')]][_0x5c9f('0x1b')]=utils['now']();members[_0x48feaf[_0x5c9f('0x15')]][_0x5c9f('0x1c')]=utils[_0x5c9f('0x1d')](members[_0x48feaf['device']][_0x5c9f('0x1b')],members[_0x48feaf[_0x5c9f('0x15')]]['enterAt']);if(members[_0x48feaf[_0x5c9f('0x15')]]['uniqueid']){writeDB(members[_0x48feaf[_0x5c9f('0x15')]]);}}break;default:break;}}catch(_0x99b611){utils[_0x5c9f('0x11')](util['format'](_0x5c9f('0x1e'),members[_0x48feaf[_0x5c9f('0x15')]]?members[_0x48feaf[_0x5c9f('0x15')]][_0x5c9f('0x4')]:_0x48feaf['device']),_0x99b611);}};exports[_0x5c9f('0x1f')]=function(_0x1a360a){try{if(!_[_0x5c9f('0x20')](members[_0x1a360a[_0x5c9f('0x8')]])){utils[_0x5c9f('0x21')](util['format'](_0x5c9f('0x22'),_0x1a360a['uniqueid']),_0x1a360a);utils[_0x5c9f('0x3')](util[_0x5c9f('0x12')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x1a360a[_0x5c9f('0x4')],_0x1a360a[_0x5c9f('0x8')],_0x1a360a[_0x5c9f('0x23')]));members[_0x1a360a['interface']]=_[_0x5c9f('0x24')](members[_0x1a360a[_0x5c9f('0x8')]],{'data4':_0x1a360a[_0x5c9f('0x23')],'uniqueid':_0x1a360a[_0x5c9f('0x4')]});}}catch(_0x495cd7){utils['error'](util[_0x5c9f('0x12')]('[%s][members][agentcomplete]',_0x1a360a['uniqueid']),_0x495cd7);}};exports[_0x5c9f('0x25')]=function(_0x50824a){try{utils[_0x5c9f('0x21')](util[_0x5c9f('0x12')](_0x5c9f('0x26'),_0x50824a['uniqueid']),_0x50824a);if(_0x50824a[_0x5c9f('0x5')]){var _0x46f5f0=_0x50824a['channel'][_0x5c9f('0x10')]('-')[0x0];if(!_[_0x5c9f('0x20')](members[_0x46f5f0])){members[_0x46f5f0]=_[_0x5c9f('0x24')](members[_0x46f5f0],{'data1':members[_0x46f5f0]['data1']||_0x50824a[_0x5c9f('0x7')],'data2':members[_0x46f5f0][_0x5c9f('0x27')]||_0x50824a['source'],'data3':members[_0x46f5f0]['data3']||_0x50824a[_0x5c9f('0x28')],'uniqueid':members[_0x46f5f0][_0x5c9f('0x4')]||_0x50824a[_0x5c9f('0x4')]});utils[_0x5c9f('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x50824a[_0x5c9f('0x4')],members[_0x46f5f0][_0x5c9f('0x29')],members[_0x46f5f0][_0x5c9f('0x27')],members[_0x46f5f0][_0x5c9f('0x2a')]));if(members[_0x46f5f0][_0x5c9f('0x1b')]){writeDB(members[_0x46f5f0]);}}}if(_0x50824a['destinationchannel']){var _0xc9c627=_0x50824a[_0x5c9f('0x2b')][_0x5c9f('0x10')]('-')[0x0];if(!_[_0x5c9f('0x20')](members[_0xc9c627])){members[_0xc9c627]=_[_0x5c9f('0x24')](members[_0xc9c627],{'data1':members[_0xc9c627][_0x5c9f('0x29')]||_0x50824a[_0x5c9f('0x7')],'data2':members[_0xc9c627][_0x5c9f('0x27')]||_0x50824a[_0x5c9f('0x2c')],'data3':members[_0xc9c627][_0x5c9f('0x2a')]||_0x50824a[_0x5c9f('0x28')],'uniqueid':members[_0xc9c627]['uniqueid']||_0x50824a[_0x5c9f('0x4')]});utils[_0x5c9f('0x3')](util[_0x5c9f('0x12')](_0x5c9f('0x2d'),_0x50824a[_0x5c9f('0x4')],members[_0xc9c627]['data1'],members[_0xc9c627][_0x5c9f('0x27')],members[_0xc9c627]['data3']));if(members[_0xc9c627][_0x5c9f('0x1b')]){writeDB(members[_0xc9c627]);}}}}catch(_0x1d04a5){utils['error'](util[_0x5c9f('0x12')](_0x5c9f('0x26'),_0x50824a[_0x5c9f('0x4')]),_0x1d04a5);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a75bf57..328ccf1 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 _0xae6d=['EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','count','[%s][queues][agentconnect]','destaccountcode','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','channel','lastAssignedTo','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt'];(function(_0x18313b,_0x5c914f){var _0x2ba97d=function(_0x41143d){while(--_0x41143d){_0x18313b['push'](_0x18313b['shift']());}};_0x2ba97d(++_0x5c914f);}(_0xae6d,0x1d6));var _0xdae6=function(_0x148f22,_0x5a5572){_0x148f22=_0x148f22-0x0;var _0x50ccfa=_0xae6d[_0x148f22];return _0x50ccfa;};'use strict';var _=require(_0xdae6('0x0'));var util=require(_0xdae6('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5f3b5c){utils[_0xdae6('0x2')](util[_0xdae6('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5f3b5c['uniqueid'],_0x5f3b5c[_0xdae6('0x4')],_0x5f3b5c['queue'],_0x5f3b5c[_0xdae6('0x5')],_0x5f3b5c['calleridnum'],_0x5f3b5c['accountcode'],_0x5f3b5c[_0xdae6('0x6')]));if(_0x5f3b5c[_0xdae6('0x7')]){utils[_0xdae6('0x8')](_0x5f3b5c[_0xdae6('0x7')])['then'](function(_0x2aa322){if(_0x2aa322){_0x5f3b5c['type']=_0x2aa322[_0xdae6('0x9')];}utils[_0xdae6('0xa')](_0xdae6('0xb'),_0x5f3b5c);});}else{utils['request']('CreateVoiceQueueReport',_0x5f3b5c);}if(_0x5f3b5c[_0xdae6('0xc')]){delete queues[_0x5f3b5c[_0xdae6('0xc')]];}else{delete queues[_0x5f3b5c['uniqueid']];}}exports['queuecallerjoin']=function(_0x3dc597){try{utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0xe'),_0x3dc597[_0xdae6('0xf')]),_0x3dc597);utils[_0xdae6('0x2')](util['format'](_0xdae6('0x10'),_0x3dc597[_0xdae6('0xf')],_0x3dc597[_0xdae6('0x7')],_0x3dc597[_0xdae6('0x11')]));queues[_0x3dc597['uniqueid']]=_[_0xdae6('0x12')](_0x3dc597,{'originalposition':_0x3dc597[_0xdae6('0x11')],'queuecallerjoinAt':utils[_0xdae6('0x13')](),'mohtime':0x0});}catch(_0x35c176){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0xe'),_0x3dc597[_0xdae6('0xf')]),_0x35c176);}};exports['hangup']=function(_0x140617){try{if(!_['isNil'](queues[_0x140617[_0xdae6('0xf')]])){utils['debug'](util[_0xdae6('0x3')]('[%s][queues][hangup]',_0x140617['uniqueid']),_0x140617);if(queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x15')]){if(!queues[_0x140617['uniqueid']][_0xdae6('0x16')]&&!queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x17')]){queues[_0x140617['uniqueid']][_0xdae6('0x18')]=!![];queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x19')]=utils[_0xdae6('0x13')]();queues[_0x140617['uniqueid']][_0xdae6('0x6')]=_0xdae6('0x1a');}utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x1b'),_0x140617[_0xdae6('0xf')],queues[_0x140617[_0xdae6('0xf')]]['name'],queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x6')]));writeDB(queues[_0x140617['uniqueid']]);}else if(queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0xc')]){utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x1c'),_0x140617[_0xdae6('0xf')],queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0x140617[_0xdae6('0xf')]]['transfereduniqueid']));queues[queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0xc')]]=queues[_0x140617['uniqueid']];queues[queues[_0x140617['uniqueid']]['transfereduniqueid']][_0xdae6('0x1e')]=0x2;delete queues[_0x140617[_0xdae6('0xf')]];}}}catch(_0x28138a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')]('[%s][queues][hangup]',_0x140617[_0xdae6('0xf')]),_0x28138a);}};exports[_0xdae6('0x1f')]=function(_0x36c0f6){try{utils['debug'](util['format'](_0xdae6('0x20'),_0x36c0f6['uniqueid']),_0x36c0f6);if(!_[_0xdae6('0x21')](_0x36c0f6[_0xdae6('0x22')][_0xdae6('0x23')])&&_0x36c0f6[_0xdae6('0x24')][_0xdae6('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x36c0f6['uniqueid']])){queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x16')]=![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexit']=!![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x27')]=utils['now']();queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexitreason']=_0x36c0f6['value'][_0xdae6('0x25')]();utils[_0xdae6('0x2')](util[_0xdae6('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x36c0f6[_0xdae6('0xf')],queues[_0x36c0f6['uniqueid']][_0xdae6('0x1d')],_0x36c0f6['value'],queues[_0x36c0f6['uniqueid']][_0xdae6('0x6')]));writeDB(queues[_0x36c0f6[_0xdae6('0xf')]]);}}else if(!_[_0xdae6('0x21')](_0x36c0f6[_0xdae6('0x22')]['queueposition'])){if(!_[_0xdae6('0x21')](queues[_0x36c0f6['uniqueid']])&&!queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x16')]){queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexit']=!![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x27')]=utils[_0xdae6('0x13')]();queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x6')]=_0xdae6('0x28');utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x29'),_0x36c0f6[_0xdae6('0xf')],queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x1d')],_0x36c0f6[_0xdae6('0x24')],queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x6')]));}}}catch(_0x22f81d){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x20'),_0x36c0f6[_0xdae6('0xf')]),_0x22f81d);}};exports[_0xdae6('0x16')]=function(_0x3f130c){try{if(!_[_0xdae6('0x21')](queues[_0x3f130c['uniqueid']])){utils[_0xdae6('0xd')](util['format'](_0xdae6('0x2a'),_0x3f130c['uniqueid']),_0x3f130c);queues[_0x3f130c['uniqueid']][_0xdae6('0x17')]=![];queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x27')]=null;queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x16')]=!![];queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x26')]=utils[_0xdae6('0x13')]();queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x6')]=_0xdae6('0x2b');utils['info'](util[_0xdae6('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3f130c['uniqueid'],queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0x3f130c[_0xdae6('0xf')]]['queuecallerexitreason']));}}catch(_0x32e02a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x2a'),_0x3f130c['uniqueid']),_0x32e02a);}};exports[_0xdae6('0x2c')]=function(_0x378477){try{if(!_[_0xdae6('0x21')](queues[_0x378477['uniqueid']])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x2d'),_0x378477[_0xdae6('0xf')]),_0x378477);utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x2e'),_0x378477[_0xdae6('0xf')],queues[_0x378477['uniqueid']][_0xdae6('0x1d')],_0x378477[_0xdae6('0x2f')],_0x378477[_0xdae6('0x30')]));queues[_0x378477['uniqueid']][_0xdae6('0x2c')]=!![];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x15')]=utils[_0xdae6('0x13')]();queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x31')]=utils['diffTime'](queues[_0x378477[_0xdae6('0xf')]]['queuecallerleaveAt'],queues[_0x378477[_0xdae6('0xf')]]['queuecallerjoinAt']);queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x11')]=_0x378477[_0xdae6('0x11')];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x32')]=_0x378477[_0xdae6('0x32')];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x2f')]=_0x378477['connectedlinenum'];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x30')]=_0x378477[_0xdae6('0x30')];}}catch(_0x4b4110){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x2d'),_0x378477[_0xdae6('0xf')]),_0x4b4110);}};exports['agentconnect']=function(_0x2836b5){try{if(!_[_0xdae6('0x21')](queues[_0x2836b5[_0xdae6('0xf')]])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x33'),_0x2836b5['uniqueid']),_0x2836b5);utils[_0xdae6('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2836b5[_0xdae6('0xf')],queues[_0x2836b5['uniqueid']]['name'],_0x2836b5['membername'],_0x2836b5[_0xdae6('0x34')]));queues[_0x2836b5[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x16')]=![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x2836b5[_0xdae6('0xf')]]['queuecallerexit']=![];queues[_0x2836b5['uniqueid']][_0xdae6('0x6')]=null;queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x27')]=null;queues[_0x2836b5['uniqueid']][_0xdae6('0x35')]=!![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x36')]=_0x2836b5['destaccountcode'];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x5')]=_0x2836b5[_0xdae6('0x37')];}}catch(_0x3d39b4){utils['error'](util[_0xdae6('0x3')]('[%s][queues][agentconnect]',_0x2836b5[_0xdae6('0xf')]),_0x3d39b4);}};exports[_0xdae6('0x38')]=function(_0x2eac84){try{if(!_[_0xdae6('0x21')](queues[_0x2eac84[_0xdae6('0xf')]])){if(queues[_0x2eac84['uniqueid']][_0xdae6('0x15')]){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x39'),_0x2eac84[_0xdae6('0xf')]),_0x2eac84);queues[_0x2eac84[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x2eac84['uniqueid']]['queuecallerabandon']=![];queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x2eac84['uniqueid']][_0xdae6('0x17')]=![];queues[_0x2eac84['uniqueid']][_0xdae6('0x27')]=null;queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x35')]=!![];queues[_0x2eac84[_0xdae6('0xf')]]['lastAssignedTo']=_0x2eac84[_0xdae6('0x37')];queues[_0x2eac84[_0xdae6('0xf')]]['queuecallercomplete']=!![];queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x19')]=utils[_0xdae6('0x13')]();if(_0x2eac84[_0xdae6('0x3a')]==_0xdae6('0x3b')){if(!queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x3b')]){queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x6')]='TRANSFER';}}else{queues[_0x2eac84[_0xdae6('0xf')]]['queuecallerexitreason']=_0xdae6('0x3c')+_0x2eac84['reason'][_0xdae6('0x25')]();}utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x3d'),_0x2eac84[_0xdae6('0xf')],queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x1d')],_0x2eac84[_0xdae6('0x37')],queues[_0x2eac84['uniqueid']][_0xdae6('0x6')]));writeDB(queues[_0x2eac84[_0xdae6('0xf')]]);}}}catch(_0x3b2e0b){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x39'),_0x2eac84['uniqueid']),_0x3b2e0b);}};exports[_0xdae6('0x3e')]=function(_0x13e17a){try{if(!_[_0xdae6('0x21')](queues[_0x13e17a[_0xdae6('0x3f')]])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x40'),_0x13e17a[_0xdae6('0xf')]),_0x13e17a);queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x3b')]=!![];queues[_0x13e17a['transfereeuniqueid']][_0xdae6('0x41')]=_0xdae6('0x42');queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x43')]=_0x13e17a['extension'];queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x44')]=_0x13e17a[_0xdae6('0x3f')];queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x6')]=_0xdae6('0x45');utils['info'](util['format'](_0xdae6('0x46'),_0x13e17a[_0xdae6('0xf')],queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x1d')],_0x13e17a[_0xdae6('0x3f')],_0x13e17a['extension']));}}catch(_0x1ab84d){utils[_0xdae6('0x14')](util['format'](_0xdae6('0x40'),_0x13e17a[_0xdae6('0xf')]),_0x1ab84d);}};exports[_0xdae6('0x47')]=function(_0x180e91){try{utils['debug'](util[_0xdae6('0x3')](_0xdae6('0x48'),_0x180e91[_0xdae6('0x49')]),_0x180e91);if(_0x180e91[_0xdae6('0x49')]==_0x180e91[_0xdae6('0x4a')]){if(!_['isNil'](queues[_0x180e91[_0xdae6('0x4b')]])){utils['info'](util['format'](_0xdae6('0x4c'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x1d')],_0x180e91['origtransfererexten']));queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x3b')]=!![];queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x41')]='ATTENDED';queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x43')]=_0x180e91[_0xdae6('0x4d')];queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x44')]=_0x180e91[_0xdae6('0x49')];queues[_0x180e91['secondtransfererlinkedid']][_0xdae6('0x6')]=_0xdae6('0x4e');}if(!_['isNil'](queues[_0x180e91['origtransfererlinkedid']])){if(_0x180e91['transfereelinkedid']&&queues[_0x180e91['transfereelinkedid']]){queues[_0x180e91[_0xdae6('0x4f')]][_0xdae6('0x1e')]=0x1;queues[_0x180e91['transfereeuniqueid']]=_[_0xdae6('0x50')](queues[_0x180e91['transfereelinkedid']]);queues[_0x180e91['transfereeuniqueid']]['transfereduniqueid']=_0x180e91[_0xdae6('0x51')];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x1e')]=0x2;queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x52')]=queues[_0x180e91[_0xdae6('0x4b')]]['calleridnum'];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x53')]=queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x53')];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x54')]=utils[_0xdae6('0x13')]();queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x15')]=utils['now']();queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x31')]=0x0;queues[_0x180e91['transfereeuniqueid']]['mohtime']=0x0;utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x55'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x1d')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x52')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x53')]));}else{utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x56'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91['origtransfererlinkedid']]['name'],_0x180e91[_0xdae6('0x4b')]));queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0xc')]=_0x180e91['secondtransfererlinkedid'];}}}else if(_0x180e91['secondtransfereruniqueid']==_0x180e91[_0xdae6('0x4b')]){if(!_[_0xdae6('0x21')](queues[_0x180e91[_0xdae6('0x4a')]])){utils['info'](util[_0xdae6('0x3')](_0xdae6('0x57'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x1d')],_0x180e91['secondtransfereruniqueid'],_0x180e91['secondtransfererexten']));queues[_0x180e91[_0xdae6('0x4a')]]['transfer']=!![];queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x41')]=_0xdae6('0x58');queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x43')]=_0x180e91[_0xdae6('0x59')];queues[_0x180e91[_0xdae6('0x4a')]]['transferuniqueid']=_0x180e91[_0xdae6('0x5a')];queues[_0x180e91[_0xdae6('0x4a')]]['queuecallerexitreason']=_0xdae6('0x4e');}if(!_['isNil'](queues[_0x180e91['secondtransfererlinkedid']])){if(_0x180e91[_0xdae6('0x5b')]&&queues[_0x180e91[_0xdae6('0x5b')]]){queues[_0x180e91[_0xdae6('0x5b')]][_0xdae6('0x1e')]=0x1;queues[_0x180e91[_0xdae6('0x51')]]=_[_0xdae6('0x50')](queues[_0x180e91[_0xdae6('0x5b')]]);queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0xc')]=_0x180e91[_0xdae6('0x51')];queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x1e')]=0x2;queues[_0x180e91['transfertargetuniqueid']][_0xdae6('0x52')]=queues[_0x180e91['origtransfererlinkedid']][_0xdae6('0x52')];queues[_0x180e91['transfertargetuniqueid']]['calleridname']=queues[_0x180e91['origtransfererlinkedid']][_0xdae6('0x53')];queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x54')]=utils[_0xdae6('0x13')]();queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x15')]=utils['now']();queues[_0x180e91[_0xdae6('0x51')]]['holdtime']=0x0;queues[_0x180e91['transfertargetuniqueid']][_0xdae6('0x5c')]=0x0;utils['info'](util[_0xdae6('0x3')](_0xdae6('0x5d'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x1d')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0xc')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x52')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x53')]));}else{utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x56'),_0x180e91['origtransfereruniqueid'],queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x1d')],_0x180e91[_0xdae6('0x4a')]));queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0xc')]=_0x180e91[_0xdae6('0x4a')];}}}}catch(_0x8ec06a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x48'),_0x180e91[_0xdae6('0x49')]),_0x8ec06a);}};exports[_0xdae6('0x5e')]=function(_0x114118){try{if(!_[_0xdae6('0x21')](queues[_0x114118['uniqueid']])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x5f'),_0x114118[_0xdae6('0xf')]),_0x114118);queues[_0x114118[_0xdae6('0xf')]]['musiconholdstartAt']=utils[_0xdae6('0x13')]();utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x60'),_0x114118[_0xdae6('0xf')],queues[_0x114118['uniqueid']][_0xdae6('0x1d')],queues[_0x114118[_0xdae6('0xf')]][_0xdae6('0x61')]));}}catch(_0x292385){utils[_0xdae6('0x14')](util['format'](_0xdae6('0x5f'),_0x114118[_0xdae6('0xf')]),_0x292385);}};exports[_0xdae6('0x62')]=function(_0xdd922e){try{if(!_['isNil'](queues[_0xdd922e[_0xdae6('0xf')]])){if(!_[_0xdae6('0x21')](queues[_0xdd922e['uniqueid']][_0xdae6('0x61')])){utils['debug'](util[_0xdae6('0x3')](_0xdae6('0x63'),_0xdd922e[_0xdae6('0xf')]),_0xdd922e);queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x5c')]+=utils[_0xdae6('0x64')](utils[_0xdae6('0x13')](),queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x61')]);utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x65'),_0xdd922e[_0xdae6('0xf')],queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x5c')]));delete queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x61')];}}}catch(_0x49c4a4){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x63'),_0xdd922e[_0xdae6('0xf')]),_0x49c4a4);}}; \ No newline at end of file +var _0x539f=['EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','[%s][queues][agentcomplete]','membername','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfererexten','ATTENDED','transferexten','secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%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','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queueposition','queuecallerabandonAt','queuecallerexitAt'];(function(_0x3acb1f,_0x3952ab){var _0x24a289=function(_0x34512c){while(--_0x34512c){_0x3acb1f['push'](_0x3acb1f['shift']());}};_0x24a289(++_0x3952ab);}(_0x539f,0xa3));var _0xf539=function(_0x2374ed,_0x37016c){_0x2374ed=_0x2374ed-0x0;var _0x19b126=_0x539f[_0x2374ed];return _0x19b126;};'use strict';var _=require(_0xf539('0x0'));var util=require('util');var utils=require(_0xf539('0x1'));var queues={};function writeDB(_0x256f90){utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x4'),_0x256f90[_0xf539('0x5')],_0x256f90['channel'],_0x256f90[_0xf539('0x6')],_0x256f90[_0xf539('0x7')],_0x256f90['calleridnum'],_0x256f90[_0xf539('0x8')],_0x256f90[_0xf539('0x9')]));if(_0x256f90[_0xf539('0x6')]){utils[_0xf539('0xa')](_0x256f90[_0xf539('0x6')])[_0xf539('0xb')](function(_0x278f56){if(_0x278f56){_0x256f90[_0xf539('0xc')]=_0x278f56[_0xf539('0xc')];}utils['request']('CreateVoiceQueueReport',_0x256f90);});}else{utils[_0xf539('0xd')](_0xf539('0xe'),_0x256f90);}if(_0x256f90[_0xf539('0xf')]){delete queues[_0x256f90['transfereduniqueid']];}else{delete queues[_0x256f90[_0xf539('0x5')]];}}exports['queuecallerjoin']=function(_0x433784){try{utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x11'),_0x433784[_0xf539('0x5')]),_0x433784);utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x12'),_0x433784[_0xf539('0x5')],_0x433784['queue'],_0x433784[_0xf539('0x13')]));queues[_0x433784['uniqueid']]=_[_0xf539('0x14')](_0x433784,{'originalposition':_0x433784[_0xf539('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x81734d){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x11'),_0x433784[_0xf539('0x5')]),_0x81734d);}};exports[_0xf539('0x16')]=function(_0x3deb9b){try{if(!_[_0xf539('0x17')](queues[_0x3deb9b['uniqueid']])){utils[_0xf539('0x10')](util['format'](_0xf539('0x18'),_0x3deb9b[_0xf539('0x5')]),_0x3deb9b);if(queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x19')]){if(!queues[_0x3deb9b['uniqueid']][_0xf539('0x1a')]&&!queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x1b')]){queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x1c')]=!![];queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x1d')]=utils[_0xf539('0x1e')]();queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x9')]='COMPLETEDBYAGENT';}utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x1f'),_0x3deb9b[_0xf539('0x5')],queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x20')],queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x9')]));writeDB(queues[_0x3deb9b[_0xf539('0x5')]]);}else if(queues[_0x3deb9b[_0xf539('0x5')]]['transfereduniqueid']){utils[_0xf539('0x2')](util['format'](_0xf539('0x21'),_0x3deb9b[_0xf539('0x5')],queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0x20')],queues[_0x3deb9b[_0xf539('0x5')]][_0xf539('0xf')]));queues[queues[_0x3deb9b[_0xf539('0x5')]]['transfereduniqueid']]=queues[_0x3deb9b[_0xf539('0x5')]];queues[queues[_0x3deb9b[_0xf539('0x5')]]['transfereduniqueid']][_0xf539('0x22')]=0x2;delete queues[_0x3deb9b['uniqueid']];}}}catch(_0x1709fb){utils[_0xf539('0x15')](util[_0xf539('0x3')]('[%s][queues][hangup]',_0x3deb9b[_0xf539('0x5')]),_0x1709fb);}};exports[_0xf539('0x23')]=function(_0x49bf97){try{utils['debug'](util['format'](_0xf539('0x24'),_0x49bf97[_0xf539('0x5')]),_0x49bf97);if(!_['isNil'](_0x49bf97[_0xf539('0x25')][_0xf539('0x26')])&&_0x49bf97[_0xf539('0x27')][_0xf539('0x28')]()!==_0xf539('0x29')){if(!_['isNil'](queues[_0x49bf97[_0xf539('0x5')]])){queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x1a')]=![];queues[_0x49bf97[_0xf539('0x5')]]['queuecallerabandonAt']=null;queues[_0x49bf97['uniqueid']][_0xf539('0x1b')]=!![];queues[_0x49bf97[_0xf539('0x5')]]['queuecallerexitAt']=utils[_0xf539('0x1e')]();queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x9')]=_0x49bf97[_0xf539('0x27')][_0xf539('0x28')]();utils[_0xf539('0x2')](util[_0xf539('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x49bf97[_0xf539('0x5')],queues[_0x49bf97['uniqueid']][_0xf539('0x20')],_0x49bf97[_0xf539('0x27')],queues[_0x49bf97['uniqueid']][_0xf539('0x9')]));writeDB(queues[_0x49bf97['uniqueid']]);}}else if(!_[_0xf539('0x17')](_0x49bf97[_0xf539('0x25')][_0xf539('0x2a')])){if(!_[_0xf539('0x17')](queues[_0x49bf97[_0xf539('0x5')]])&&!queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x1a')]){queues[_0x49bf97['uniqueid']][_0xf539('0x1a')]=![];queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x2b')]=null;queues[_0x49bf97['uniqueid']][_0xf539('0x1b')]=!![];queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x2c')]=utils['now']();queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x9')]=_0xf539('0x2d');utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x2e'),_0x49bf97['uniqueid'],queues[_0x49bf97[_0xf539('0x5')]][_0xf539('0x20')],_0x49bf97[_0xf539('0x27')],queues[_0x49bf97['uniqueid']][_0xf539('0x9')]));}}}catch(_0x545fde){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x24'),_0x49bf97[_0xf539('0x5')]),_0x545fde);}};exports['queuecallerabandon']=function(_0x9cb13b){try{if(!_['isNil'](queues[_0x9cb13b['uniqueid']])){utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x2f'),_0x9cb13b[_0xf539('0x5')]),_0x9cb13b);queues[_0x9cb13b[_0xf539('0x5')]]['queuecallerexit']=![];queues[_0x9cb13b[_0xf539('0x5')]]['queuecallerexitAt']=null;queues[_0x9cb13b[_0xf539('0x5')]][_0xf539('0x1a')]=!![];queues[_0x9cb13b['uniqueid']]['queuecallerabandonAt']=utils[_0xf539('0x1e')]();queues[_0x9cb13b['uniqueid']][_0xf539('0x9')]=_0xf539('0x30');utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x31'),_0x9cb13b[_0xf539('0x5')],queues[_0x9cb13b[_0xf539('0x5')]]['name'],queues[_0x9cb13b[_0xf539('0x5')]]['queuecallerexitreason']));}}catch(_0x58c429){utils['error'](util[_0xf539('0x3')](_0xf539('0x2f'),_0x9cb13b[_0xf539('0x5')]),_0x58c429);}};exports[_0xf539('0x32')]=function(_0xaf02aa){try{if(!_[_0xf539('0x17')](queues[_0xaf02aa[_0xf539('0x5')]])){utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x33'),_0xaf02aa[_0xf539('0x5')]),_0xaf02aa);utils['info'](util[_0xf539('0x3')](_0xf539('0x34'),_0xaf02aa[_0xf539('0x5')],queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x20')],_0xaf02aa[_0xf539('0x35')],_0xaf02aa[_0xf539('0x36')]));queues[_0xaf02aa['uniqueid']]['queuecallerleave']=!![];queues[_0xaf02aa['uniqueid']][_0xf539('0x19')]=utils[_0xf539('0x1e')]();queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x37')]=utils[_0xf539('0x38')](queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x19')],queues[_0xaf02aa['uniqueid']][_0xf539('0x39')]);queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x13')]=_0xaf02aa[_0xf539('0x13')];queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x3a')]=_0xaf02aa[_0xf539('0x3a')];queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x35')]=_0xaf02aa[_0xf539('0x35')];queues[_0xaf02aa[_0xf539('0x5')]][_0xf539('0x36')]=_0xaf02aa[_0xf539('0x36')];}}catch(_0xcde7ea){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x33'),_0xaf02aa[_0xf539('0x5')]),_0xcde7ea);}};exports[_0xf539('0x3b')]=function(_0x1a3266){try{if(!_[_0xf539('0x17')](queues[_0x1a3266[_0xf539('0x5')]])){utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x3c'),_0x1a3266[_0xf539('0x5')]),_0x1a3266);utils[_0xf539('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1a3266[_0xf539('0x5')],queues[_0x1a3266[_0xf539('0x5')]]['name'],_0x1a3266['membername'],_0x1a3266[_0xf539('0x3d')]));queues[_0x1a3266[_0xf539('0x5')]][_0xf539('0x1a')]=![];queues[_0x1a3266['uniqueid']][_0xf539('0x1a')]=![];queues[_0x1a3266[_0xf539('0x5')]][_0xf539('0x2b')]=null;queues[_0x1a3266['uniqueid']][_0xf539('0x1b')]=![];queues[_0x1a3266['uniqueid']][_0xf539('0x9')]=null;queues[_0x1a3266['uniqueid']]['queuecallerexitAt']=null;queues[_0x1a3266[_0xf539('0x5')]][_0xf539('0x3e')]=!![];queues[_0x1a3266[_0xf539('0x5')]][_0xf539('0x8')]=_0x1a3266[_0xf539('0x3d')];queues[_0x1a3266[_0xf539('0x5')]][_0xf539('0x7')]=_0x1a3266['membername'];}}catch(_0x13002e){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x3c'),_0x1a3266['uniqueid']),_0x13002e);}};exports['agentcomplete']=function(_0x9e7c02){try{if(!_[_0xf539('0x17')](queues[_0x9e7c02['uniqueid']])){if(queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x19')]){utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x3f'),_0x9e7c02['uniqueid']),_0x9e7c02);queues[_0x9e7c02[_0xf539('0x5')]]['queuecallerabandon']=![];queues[_0x9e7c02[_0xf539('0x5')]]['queuecallerabandon']=![];queues[_0x9e7c02[_0xf539('0x5')]]['queuecallerabandonAt']=null;queues[_0x9e7c02[_0xf539('0x5')]]['queuecallerexit']=![];queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x2c')]=null;queues[_0x9e7c02[_0xf539('0x5')]]['assigned']=!![];queues[_0x9e7c02['uniqueid']][_0xf539('0x7')]=_0x9e7c02[_0xf539('0x40')];queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x1c')]=!![];queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x1d')]=utils[_0xf539('0x1e')]();if(_0x9e7c02[_0xf539('0x41')]==_0xf539('0x42')){if(!queues[_0x9e7c02['uniqueid']][_0xf539('0x42')]){queues[_0x9e7c02['uniqueid']][_0xf539('0x9')]=_0xf539('0x43');}}else{queues[_0x9e7c02['uniqueid']][_0xf539('0x9')]=_0xf539('0x44')+_0x9e7c02[_0xf539('0x41')][_0xf539('0x28')]();}utils[_0xf539('0x2')](util['format'](_0xf539('0x45'),_0x9e7c02[_0xf539('0x5')],queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x20')],_0x9e7c02['membername'],queues[_0x9e7c02[_0xf539('0x5')]][_0xf539('0x9')]));writeDB(queues[_0x9e7c02[_0xf539('0x5')]]);}}}catch(_0x473784){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x3f'),_0x9e7c02[_0xf539('0x5')]),_0x473784);}};exports[_0xf539('0x46')]=function(_0x5063ae){try{if(!_['isNil'](queues[_0x5063ae[_0xf539('0x47')]])){utils[_0xf539('0x10')](util['format'](_0xf539('0x48'),_0x5063ae['uniqueid']),_0x5063ae);queues[_0x5063ae['transfereeuniqueid']]['transfer']=!![];queues[_0x5063ae[_0xf539('0x47')]][_0xf539('0x49')]=_0xf539('0x4a');queues[_0x5063ae[_0xf539('0x47')]]['transferexten']=_0x5063ae['extension'];queues[_0x5063ae[_0xf539('0x47')]][_0xf539('0x4b')]=_0x5063ae['transfereeuniqueid'];queues[_0x5063ae[_0xf539('0x47')]][_0xf539('0x9')]='BLINDTRANSFER';utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x4c'),_0x5063ae[_0xf539('0x5')],queues[_0x5063ae['transfereeuniqueid']]['name'],_0x5063ae[_0xf539('0x47')],_0x5063ae[_0xf539('0x4d')]));}}catch(_0x9753a1){utils[_0xf539('0x15')](util[_0xf539('0x3')]('[%s][queues][blindtransfer]',_0x5063ae[_0xf539('0x5')]),_0x9753a1);}};exports[_0xf539('0x4e')]=function(_0x25b4e5){try{utils['debug'](util['format'](_0xf539('0x4f'),_0x25b4e5[_0xf539('0x50')]),_0x25b4e5);if(_0x25b4e5['origtransfereruniqueid']==_0x25b4e5[_0xf539('0x51')]){if(!_[_0xf539('0x17')](queues[_0x25b4e5['secondtransfererlinkedid']])){utils[_0xf539('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x25b4e5[_0xf539('0x50')],queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x20')],_0x25b4e5['origtransfererexten']));queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x42')]=!![];queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x49')]='ATTENDED';queues[_0x25b4e5[_0xf539('0x52')]]['transferexten']=_0x25b4e5[_0xf539('0x53')];queues[_0x25b4e5['secondtransfererlinkedid']][_0xf539('0x4b')]=_0x25b4e5['origtransfereruniqueid'];queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x9')]=_0xf539('0x54');}if(!_['isNil'](queues[_0x25b4e5[_0xf539('0x51')]])){if(_0x25b4e5[_0xf539('0x55')]&&queues[_0x25b4e5[_0xf539('0x55')]]){queues[_0x25b4e5[_0xf539('0x55')]][_0xf539('0x22')]=0x1;queues[_0x25b4e5[_0xf539('0x47')]]=_[_0xf539('0x56')](queues[_0x25b4e5['transfereelinkedid']]);queues[_0x25b4e5[_0xf539('0x47')]][_0xf539('0xf')]=_0x25b4e5[_0xf539('0x57')];queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x22')]=0x2;queues[_0x25b4e5[_0xf539('0x47')]][_0xf539('0x58')]=queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x58')];queues[_0x25b4e5[_0xf539('0x47')]][_0xf539('0x59')]=queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0x59')];queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x39')]=utils['now']();queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x19')]=utils[_0xf539('0x1e')]();queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x37')]=0x0;queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x5a')]=0x0;utils['info'](util[_0xf539('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x25b4e5['origtransfereruniqueid'],queues[_0x25b4e5[_0xf539('0x47')]][_0xf539('0x20')],queues[_0x25b4e5[_0xf539('0x47')]][_0xf539('0x58')],queues[_0x25b4e5['transfereeuniqueid']][_0xf539('0x59')]));}else{utils[_0xf539('0x2')](util[_0xf539('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x25b4e5[_0xf539('0x50')],queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x20')],_0x25b4e5[_0xf539('0x52')]));queues[_0x25b4e5[_0xf539('0x51')]]['transfereduniqueid']=_0x25b4e5['secondtransfererlinkedid'];}}}else if(_0x25b4e5['secondtransfereruniqueid']==_0x25b4e5[_0xf539('0x52')]){if(!_[_0xf539('0x17')](queues[_0x25b4e5['origtransfererlinkedid']])){utils[_0xf539('0x2')](util[_0xf539('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x25b4e5['origtransfereruniqueid'],queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x20')],_0x25b4e5['secondtransfereruniqueid'],_0x25b4e5[_0xf539('0x5b')]));queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x42')]=!![];queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x49')]=_0xf539('0x5c');queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x5d')]=_0x25b4e5['secondtransfererexten'];queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x4b')]=_0x25b4e5[_0xf539('0x5e')];queues[_0x25b4e5[_0xf539('0x51')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xf539('0x17')](queues[_0x25b4e5['secondtransfererlinkedid']])){if(_0x25b4e5['transfertargetlinkedid']&&queues[_0x25b4e5[_0xf539('0x5f')]]){queues[_0x25b4e5[_0xf539('0x5f')]][_0xf539('0x22')]=0x1;queues[_0x25b4e5[_0xf539('0x57')]]=_[_0xf539('0x56')](queues[_0x25b4e5['transfertargetlinkedid']]);queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0xf')]=_0x25b4e5[_0xf539('0x57')];queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x22')]=0x2;queues[_0x25b4e5['transfertargetuniqueid']][_0xf539('0x58')]=queues[_0x25b4e5['origtransfererlinkedid']][_0xf539('0x58')];queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x59')]=queues[_0x25b4e5[_0xf539('0x51')]][_0xf539('0x59')];queues[_0x25b4e5[_0xf539('0x57')]]['queuecallerjoinAt']=utils[_0xf539('0x1e')]();queues[_0x25b4e5['transfertargetuniqueid']][_0xf539('0x19')]=utils[_0xf539('0x1e')]();queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x37')]=0x0;queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x5a')]=0x0;utils['info'](util[_0xf539('0x3')](_0xf539('0x60'),_0x25b4e5['origtransfereruniqueid'],queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x20')],queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0xf')],queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x58')],queues[_0x25b4e5[_0xf539('0x57')]][_0xf539('0x59')]));}else{utils[_0xf539('0x2')](util['format'](_0xf539('0x61'),_0x25b4e5[_0xf539('0x50')],queues[_0x25b4e5['secondtransfererlinkedid']][_0xf539('0x20')],_0x25b4e5[_0xf539('0x51')]));queues[_0x25b4e5[_0xf539('0x52')]][_0xf539('0xf')]=_0x25b4e5[_0xf539('0x51')];}}}}catch(_0x52ff1f){utils[_0xf539('0x15')](util[_0xf539('0x3')](_0xf539('0x4f'),_0x25b4e5[_0xf539('0x50')]),_0x52ff1f);}};exports['musiconholdstart']=function(_0x59b320){try{if(!_['isNil'](queues[_0x59b320[_0xf539('0x5')]])){utils[_0xf539('0x10')](util['format'](_0xf539('0x62'),_0x59b320[_0xf539('0x5')]),_0x59b320);queues[_0x59b320[_0xf539('0x5')]][_0xf539('0x63')]=utils[_0xf539('0x1e')]();utils[_0xf539('0x2')](util[_0xf539('0x3')](_0xf539('0x64'),_0x59b320[_0xf539('0x5')],queues[_0x59b320[_0xf539('0x5')]][_0xf539('0x20')],queues[_0x59b320[_0xf539('0x5')]][_0xf539('0x63')]));}}catch(_0x258630){utils[_0xf539('0x15')](util['format']('[%s][queues][musiconholdstart]',_0x59b320[_0xf539('0x5')]),_0x258630);}};exports[_0xf539('0x65')]=function(_0x29e7a0){try{if(!_[_0xf539('0x17')](queues[_0x29e7a0['uniqueid']])){if(!_['isNil'](queues[_0x29e7a0[_0xf539('0x5')]][_0xf539('0x63')])){utils[_0xf539('0x10')](util[_0xf539('0x3')](_0xf539('0x66'),_0x29e7a0['uniqueid']),_0x29e7a0);queues[_0x29e7a0[_0xf539('0x5')]][_0xf539('0x5a')]+=utils[_0xf539('0x38')](utils[_0xf539('0x1e')](),queues[_0x29e7a0['uniqueid']][_0xf539('0x63')]);utils['info'](util[_0xf539('0x3')](_0xf539('0x67'),_0x29e7a0[_0xf539('0x5')],queues[_0x29e7a0[_0xf539('0x5')]][_0xf539('0x20')],queues[_0x29e7a0['uniqueid']][_0xf539('0x5a')]));delete queues[_0x29e7a0[_0xf539('0x5')]][_0xf539('0x63')];}}}catch(_0x1c92fa){utils['error'](util[_0xf539('0x3')](_0xf539('0x66'),_0x29e7a0[_0xf539('0x5')]),_0x1c92fa);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 23ea5db..c3f95b4 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 _0x105a=['endsWith','value','.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','info','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x105a,0xaf));var _0xa105=function(_0xf52af6,_0x5b1f48){_0xf52af6=_0xf52af6-0x0;var _0x10ab94=_0x105a[_0xf52af6];return _0x10ab94;};'use strict';var _=require(_0xa105('0x0'));var util=require(_0xa105('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x3c4fee){var _0x238d9f;utils[_0xa105('0x2')](util['format'](_0xa105('0x3'),_0x3c4fee[_0xa105('0x4')]));if(transfers[_0xa105('0x5')][_0x3c4fee[_0xa105('0x4')]]){_0x238d9f=_0x3c4fee[_0xa105('0x4')];_0x3c4fee[_0xa105('0x4')]=transfers[_0xa105('0x5')][_0x3c4fee[_0xa105('0x4')]]['transfereeuniqueid'];}if(_0x3c4fee[_0xa105('0x6')]){utils[_0xa105('0x7')](_0x3c4fee[_0xa105('0x6')])[_0xa105('0x8')](function(_0x13c396){if(_0x13c396){_0x3c4fee[_0xa105('0x9')]=_0x13c396[_0xa105('0xa')];_0x3c4fee[_0xa105('0xb')]=_0x13c396['id'];}utils[_0xa105('0xc')]('CreateVoiceRecording',_0x3c4fee);});}else{utils['request'](_0xa105('0xd'),_0x3c4fee);}if(_0x238d9f)delete transfers[_0xa105('0x5')][_0x238d9f];}exports[_0xa105('0xe')]=function(_0x3d6be6){try{utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x11'),_0x3d6be6['uniqueid']),_0x3d6be6);if(_0x3d6be6[_0xa105('0x4')]==_0x3d6be6[_0xa105('0x12')]){utils[_0xa105('0x2')](util['format'](_0xa105('0x13'),_0x3d6be6[_0xa105('0x4')],_0x3d6be6[_0xa105('0x14')],_0x3d6be6['exten']));recordings[_0x3d6be6['uniqueid']]={'uniqueid':_0x3d6be6[_0xa105('0x4')],'accountcode':_0x3d6be6['accountcode'],'exten':_0x3d6be6[_0xa105('0x15')],'context':_0x3d6be6[_0xa105('0x14')],'channel':_0x3d6be6[_0xa105('0x16')],'monitors':[]};}}catch(_0x53698e){utils[_0xa105('0x17')](util['format']('[%s][recordings][newchannel]',_0x3d6be6[_0xa105('0x4')]),_0x53698e);}};exports[_0xa105('0x18')]=function(_0x124198){try{utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x19'),_0x124198[_0xa105('0x4')]),_0x124198);if(!_[_0xa105('0x1a')](recordings[_0x124198[_0xa105('0x4')]])&&_0x124198[_0xa105('0x1b')]==0x6){utils[_0xa105('0x2')](util[_0xa105('0x10')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x124198['uniqueid'],_0x124198[_0xa105('0x14')],_0x124198['channel']));}else if(!_[_0xa105('0x1a')](recordings[_0x124198['linkedid']])&&_0x124198['channelstate']==0x6&&_0x124198['context']!=_0xa105('0x1c')){utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x1d'),_0x124198['uniqueid'],_0x124198[_0xa105('0x12')],_0x124198[_0xa105('0x14')],_0x124198[_0xa105('0x16')]));recordings[_0x124198[_0xa105('0x12')]][_0xa105('0x6')]=_0x124198['accountcode'];}}catch(_0x4a5b79){utils['error'](util[_0xa105('0x10')](_0xa105('0x19'),_0x124198[_0xa105('0x4')]),_0x4a5b79);}};exports[_0xa105('0x1e')]=function(_0x16b558){try{if(!_[_0xa105('0x1a')](_0x16b558[_0xa105('0x1f')])&&!_['isNil'](_0x16b558['variable'][_0xa105('0x20')])){utils[_0xa105('0xf')](util['format'](_0xa105('0x21'),_0x16b558['uniqueid']),_0x16b558);utils['info'](util[_0xa105('0x10')](_0xa105('0x22'),_0x16b558[_0xa105('0x4')],_0x16b558[_0xa105('0x1f')],_0x16b558['value']));if(_[_0xa105('0x23')](_0x16b558[_0xa105('0x24')],'.wav49')){_0x16b558[_0xa105('0x24')]=_0x16b558[_0xa105('0x24')]['replace'](_0xa105('0x25'),_0xa105('0x26'));}if(recordings[_0x16b558[_0xa105('0x12')]]){var _0x23393a=_[_0xa105('0x27')](recordings[_0x16b558['linkedid']][_0xa105('0x28')],{'value':_0x16b558[_0xa105('0x24')]});if(_['isNil'](_0x23393a)){recordings[_0x16b558[_0xa105('0x12')]][_0xa105('0x28')][_0xa105('0x29')]({'value':_0x16b558['value']});}}}}catch(_0x40ffe8){utils['error'](util[_0xa105('0x10')]('[%s][recordings][varset]',_0x16b558['uniqueid']),_0x40ffe8);}};exports['hangup']=function(_0x3df2c1){try{if(!_[_0xa105('0x1a')](recordings[_0x3df2c1[_0xa105('0x4')]])){utils['debug'](util[_0xa105('0x10')](_0xa105('0x2a'),_0x3df2c1['uniqueid']),_0x3df2c1);utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x2b'),_0x3df2c1[_0xa105('0x4')],_0x3df2c1[_0xa105('0x2c')],_0x3df2c1['calleridname'],_0x3df2c1[_0xa105('0x2d')]));recordings[_0x3df2c1[_0xa105('0x4')]]['calleridnum']=_0x3df2c1[_0xa105('0x2c')];recordings[_0x3df2c1[_0xa105('0x4')]]['calleridname']=_0x3df2c1[_0xa105('0x2e')];recordings[_0x3df2c1[_0xa105('0x4')]]['connectedlinenum']=_0x3df2c1[_0xa105('0x2f')];recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x30')]=_0x3df2c1['connectedlinename'];if(recordings[_0x3df2c1['uniqueid']]['type']==_0xa105('0x31')&&recordings[_0x3df2c1[_0xa105('0x4')]]['accountcode']){recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x2f')]=recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x6')];recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x30')]='';}recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x28')][_0xa105('0x32')](function(_0x37489f){var _0x1ee102=_[_0xa105('0x33')](recordings[_0x3df2c1[_0xa105('0x4')]]);_0x1ee102[_0xa105('0x24')]=_0x37489f[_0xa105('0x24')];writeDB(_0x1ee102);});delete recordings[_0x3df2c1[_0xa105('0x4')]];}}catch(_0xc7fc2f){utils[_0xa105('0x17')](util['format'](_0xa105('0x2a'),_0x3df2c1[_0xa105('0x4')]),_0xc7fc2f);}};exports[_0xa105('0x34')]=function(_0x2bb3d0){try{if(!_[_0xa105('0x1a')](recordings[_0x2bb3d0['uniqueid']])){utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x35'),_0x2bb3d0[_0xa105('0x4')]),_0x2bb3d0);utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x36'),_0x2bb3d0[_0xa105('0x4')],_0x2bb3d0[_0xa105('0x37')],_0x2bb3d0['appdata']));if(_0x2bb3d0[_0xa105('0x37')][_0xa105('0x38')]()=='set'&&_[_0xa105('0x39')](_0x2bb3d0[_0xa105('0x3a')][_0xa105('0x38')](),_0xa105('0x3b'))){var _0x3aacb5=_0x2bb3d0['appdata']['split']('=');var _0x26c2f7=_0x3aacb5[0x0]['substring'](_0x3aacb5[0x0][_0xa105('0x3c')]('(')+0x1,_0x3aacb5[0x0][_0xa105('0x3c')](')'));var _0x3b2caf=_0x3aacb5[0x1];recordings[_0x2bb3d0[_0xa105('0x4')]][_0x26c2f7]=_0x3b2caf;}}}catch(_0x3c22e4){utils[_0xa105('0x17')](util[_0xa105('0x10')](_0xa105('0x35'),_0x2bb3d0[_0xa105('0x4')]),_0x3c22e4);}};exports[_0xa105('0x3d')]=function(_0x2d171b){try{if(!_[_0xa105('0x1a')](recordings[_0x2d171b[_0xa105('0x4')]])){utils['debug'](util[_0xa105('0x10')](_0xa105('0x3e'),_0x2d171b[_0xa105('0x4')]),_0x2d171b);utils[_0xa105('0x2')](util['format'](_0xa105('0x3f'),_0x2d171b[_0xa105('0x4')],_0x2d171b[_0xa105('0x40')]));recordings[_0x2d171b[_0xa105('0x4')]][_0xa105('0x40')]=_0x2d171b[_0xa105('0x40')];}}catch(_0x3ce3c){utils['error'](util['format'](_0xa105('0x3e'),_0x2d171b['uniqueid']),_0x3ce3c);}};exports['blindtransfer']=function(_0x120aed){try{utils['debug'](util['format']('[%s][recordings][blindtransfer]',_0x120aed[_0xa105('0x4')]),_0x120aed);utils[_0xa105('0x2')](util[_0xa105('0x10')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x120aed[_0xa105('0x4')],_0x120aed['transferercalleridnum'],_0x120aed[_0xa105('0x41')],_0x120aed[_0xa105('0x42')],_0x120aed[_0xa105('0x43')]));if(recordings[_0x120aed[_0xa105('0x44')]]&&transfers[_0xa105('0x5')][_0x120aed[_0xa105('0x44')]]){transfers[_0xa105('0x5')][_0x120aed[_0xa105('0x44')]]['recording']=!![];}}catch(_0x58a5f5){utils[_0xa105('0x17')](util[_0xa105('0x10')](_0xa105('0x45'),_0x120aed[_0xa105('0x4')]),_0x58a5f5);}}; \ No newline at end of file +var _0xcee2=['variable','[%s][recordings][varset]','value','endsWith','.wav49','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcee2,0x18b));var _0x2cee=function(_0x1f4e0e,_0x1f0300){_0x1f4e0e=_0x1f4e0e-0x0;var _0x13b2f0=_0xcee2[_0x1f4e0e];return _0x13b2f0;};'use strict';var _=require(_0x2cee('0x0'));var util=require(_0x2cee('0x1'));var utils=require(_0x2cee('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x5ab6c3){var _0x495553;utils[_0x2cee('0x3')](util[_0x2cee('0x4')](_0x2cee('0x5'),_0x5ab6c3[_0x2cee('0x6')]));if(transfers[_0x2cee('0x7')][_0x5ab6c3[_0x2cee('0x6')]]){_0x495553=_0x5ab6c3[_0x2cee('0x6')];_0x5ab6c3[_0x2cee('0x6')]=transfers[_0x2cee('0x7')][_0x5ab6c3[_0x2cee('0x6')]][_0x2cee('0x8')];}if(_0x5ab6c3[_0x2cee('0x9')]){utils['getUserByInternal'](_0x5ab6c3[_0x2cee('0x9')])[_0x2cee('0xa')](function(_0x448d1c){if(_0x448d1c){_0x5ab6c3[_0x2cee('0xb')]=_0x448d1c[_0x2cee('0xc')];_0x5ab6c3[_0x2cee('0xd')]=_0x448d1c['id'];}utils[_0x2cee('0xe')](_0x2cee('0xf'),_0x5ab6c3);});}else{utils[_0x2cee('0xe')](_0x2cee('0xf'),_0x5ab6c3);}if(_0x495553)delete transfers[_0x2cee('0x7')][_0x495553];}exports['newchannel']=function(_0x12a30c){try{utils[_0x2cee('0x10')](util['format'](_0x2cee('0x11'),_0x12a30c[_0x2cee('0x6')]),_0x12a30c);if(_0x12a30c[_0x2cee('0x6')]==_0x12a30c[_0x2cee('0x12')]){utils[_0x2cee('0x3')](util[_0x2cee('0x4')](_0x2cee('0x13'),_0x12a30c['uniqueid'],_0x12a30c['context'],_0x12a30c[_0x2cee('0x14')]));recordings[_0x12a30c['uniqueid']]={'uniqueid':_0x12a30c['uniqueid'],'accountcode':_0x12a30c[_0x2cee('0x9')],'exten':_0x12a30c[_0x2cee('0x14')],'context':_0x12a30c[_0x2cee('0x15')],'channel':_0x12a30c['channel'],'monitors':[]};}}catch(_0x45a2d9){utils[_0x2cee('0x16')](util['format']('[%s][recordings][newchannel]',_0x12a30c['uniqueid']),_0x45a2d9);}};exports['newstate']=function(_0x56f6d3){try{utils[_0x2cee('0x10')](util[_0x2cee('0x4')](_0x2cee('0x17'),_0x56f6d3['uniqueid']),_0x56f6d3);if(!_[_0x2cee('0x18')](recordings[_0x56f6d3[_0x2cee('0x6')]])&&_0x56f6d3[_0x2cee('0x19')]==0x6){utils[_0x2cee('0x3')](util[_0x2cee('0x4')](_0x2cee('0x1a'),_0x56f6d3['uniqueid'],_0x56f6d3[_0x2cee('0x15')],_0x56f6d3[_0x2cee('0x1b')]));}else if(!_[_0x2cee('0x18')](recordings[_0x56f6d3[_0x2cee('0x12')]])&&_0x56f6d3[_0x2cee('0x19')]==0x6&&_0x56f6d3[_0x2cee('0x15')]!=_0x2cee('0x1c')){utils[_0x2cee('0x3')](util[_0x2cee('0x4')](_0x2cee('0x1d'),_0x56f6d3[_0x2cee('0x6')],_0x56f6d3['linkedid'],_0x56f6d3[_0x2cee('0x15')],_0x56f6d3[_0x2cee('0x1b')]));recordings[_0x56f6d3[_0x2cee('0x12')]][_0x2cee('0x9')]=_0x56f6d3['accountcode'];}}catch(_0x1dbb90){utils['error'](util['format']('[%s][recordings][newstate]',_0x56f6d3[_0x2cee('0x6')]),_0x1dbb90);}};exports[_0x2cee('0x1e')]=function(_0x2a5b9c){try{if(!_[_0x2cee('0x18')](_0x2a5b9c[_0x2cee('0x1f')])&&!_['isNil'](_0x2a5b9c[_0x2cee('0x1f')]['mixmonitor_filename'])){utils[_0x2cee('0x10')](util['format'](_0x2cee('0x20'),_0x2a5b9c['uniqueid']),_0x2a5b9c);utils[_0x2cee('0x3')](util[_0x2cee('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2a5b9c[_0x2cee('0x6')],_0x2a5b9c[_0x2cee('0x1f')],_0x2a5b9c[_0x2cee('0x21')]));if(_[_0x2cee('0x22')](_0x2a5b9c[_0x2cee('0x21')],_0x2cee('0x23'))){_0x2a5b9c['value']=_0x2a5b9c[_0x2cee('0x21')]['replace'](_0x2cee('0x23'),'.WAV');}if(recordings[_0x2a5b9c['linkedid']]){var _0x226034=_[_0x2cee('0x24')](recordings[_0x2a5b9c[_0x2cee('0x12')]]['monitors'],{'value':_0x2a5b9c['value']});if(_[_0x2cee('0x18')](_0x226034)){recordings[_0x2a5b9c[_0x2cee('0x12')]][_0x2cee('0x25')][_0x2cee('0x26')]({'value':_0x2a5b9c['value']});}}}}catch(_0x4da8d4){utils['error'](util[_0x2cee('0x4')](_0x2cee('0x20'),_0x2a5b9c[_0x2cee('0x6')]),_0x4da8d4);}};exports[_0x2cee('0x27')]=function(_0x252e55){try{if(!_[_0x2cee('0x18')](recordings[_0x252e55['uniqueid']])){utils[_0x2cee('0x10')](util[_0x2cee('0x4')](_0x2cee('0x28'),_0x252e55[_0x2cee('0x6')]),_0x252e55);utils['info'](util[_0x2cee('0x4')](_0x2cee('0x29'),_0x252e55['uniqueid'],_0x252e55['calleridnum'],_0x252e55[_0x2cee('0x2a')],_0x252e55['cause-txt']));recordings[_0x252e55[_0x2cee('0x6')]][_0x2cee('0x2b')]=_0x252e55[_0x2cee('0x2b')];recordings[_0x252e55['uniqueid']][_0x2cee('0x2a')]=_0x252e55[_0x2cee('0x2a')];recordings[_0x252e55['uniqueid']][_0x2cee('0x2c')]=_0x252e55['connectedlinenum'];recordings[_0x252e55[_0x2cee('0x6')]]['connectedlinename']=_0x252e55[_0x2cee('0x2d')];if(recordings[_0x252e55[_0x2cee('0x6')]][_0x2cee('0x2e')]==_0x2cee('0x2f')&&recordings[_0x252e55['uniqueid']][_0x2cee('0x9')]){recordings[_0x252e55[_0x2cee('0x6')]][_0x2cee('0x2c')]=recordings[_0x252e55[_0x2cee('0x6')]][_0x2cee('0x9')];recordings[_0x252e55[_0x2cee('0x6')]]['connectedlinename']='';}recordings[_0x252e55[_0x2cee('0x6')]][_0x2cee('0x25')][_0x2cee('0x30')](function(_0x3a0b38){var _0x336787=_[_0x2cee('0x31')](recordings[_0x252e55[_0x2cee('0x6')]]);_0x336787[_0x2cee('0x21')]=_0x3a0b38[_0x2cee('0x21')];writeDB(_0x336787);});delete recordings[_0x252e55[_0x2cee('0x6')]];}}catch(_0x1a160e){utils[_0x2cee('0x16')](util[_0x2cee('0x4')](_0x2cee('0x28'),_0x252e55[_0x2cee('0x6')]),_0x1a160e);}};exports[_0x2cee('0x32')]=function(_0x57ed47){try{if(!_[_0x2cee('0x18')](recordings[_0x57ed47[_0x2cee('0x6')]])){utils[_0x2cee('0x10')](util[_0x2cee('0x4')](_0x2cee('0x33'),_0x57ed47[_0x2cee('0x6')]),_0x57ed47);utils['info'](util[_0x2cee('0x4')](_0x2cee('0x34'),_0x57ed47[_0x2cee('0x6')],_0x57ed47[_0x2cee('0x35')],_0x57ed47[_0x2cee('0x36')]));if(_0x57ed47['application']['toLowerCase']()==_0x2cee('0x37')&&_['startsWith'](_0x57ed47[_0x2cee('0x36')][_0x2cee('0x38')](),'cdr')){var _0x386093=_0x57ed47['appdata'][_0x2cee('0x39')]('=');var _0x572659=_0x386093[0x0][_0x2cee('0x3a')](_0x386093[0x0][_0x2cee('0x3b')]('(')+0x1,_0x386093[0x0][_0x2cee('0x3b')](')'));var _0x3d82e2=_0x386093[0x1];recordings[_0x57ed47['uniqueid']][_0x572659]=_0x3d82e2;}}}catch(_0x207930){utils[_0x2cee('0x16')](util[_0x2cee('0x4')](_0x2cee('0x33'),_0x57ed47[_0x2cee('0x6')]),_0x207930);}};exports[_0x2cee('0x3c')]=function(_0x3797f7){try{if(!_[_0x2cee('0x18')](recordings[_0x3797f7[_0x2cee('0x6')]])){utils['debug'](util[_0x2cee('0x4')](_0x2cee('0x3d'),_0x3797f7[_0x2cee('0x6')]),_0x3797f7);utils[_0x2cee('0x3')](util[_0x2cee('0x4')](_0x2cee('0x3e'),_0x3797f7[_0x2cee('0x6')],_0x3797f7[_0x2cee('0x3f')]));recordings[_0x3797f7[_0x2cee('0x6')]][_0x2cee('0x3f')]=_0x3797f7[_0x2cee('0x3f')];}}catch(_0x9cccae){utils[_0x2cee('0x16')](util['format']('[%s][recordings][queuecallerjoin]',_0x3797f7[_0x2cee('0x6')]),_0x9cccae);}};exports['blindtransfer']=function(_0x405939){try{utils['debug'](util[_0x2cee('0x4')](_0x2cee('0x40'),_0x405939[_0x2cee('0x6')]),_0x405939);utils[_0x2cee('0x3')](util[_0x2cee('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x405939[_0x2cee('0x6')],_0x405939[_0x2cee('0x41')],_0x405939[_0x2cee('0x42')],_0x405939[_0x2cee('0x43')],_0x405939[_0x2cee('0x44')]));if(recordings[_0x405939['transfereruniqueid']]&&transfers['blinds'][_0x405939[_0x2cee('0x45')]]){transfers[_0x2cee('0x7')][_0x405939[_0x2cee('0x45')]][_0x2cee('0x46')]=!![];}}catch(_0x5046bc){utils[_0x2cee('0x16')](util[_0x2cee('0x4')](_0x2cee('0x40'),_0x405939[_0x2cee('0x6')]),_0x5046bc);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 263f9a5..a3232a1 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 _0xb67e=['blinds','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport'];(function(_0x4b4f29,_0x4ed4e2){var _0x12c5f1=function(_0x27ed63){while(--_0x27ed63){_0x4b4f29['push'](_0x4b4f29['shift']());}};_0x12c5f1(++_0x4ed4e2);}(_0xb67e,0x6f));var _0xeb67=function(_0xcf8ea6,_0x56e11f){_0xcf8ea6=_0xcf8ea6-0x0;var _0x51cdc7=_0xb67e[_0xcf8ea6];return _0x51cdc7;};'use strict';var _=require(_0xeb67('0x0'));var util=require(_0xeb67('0x1'));var utils=require(_0xeb67('0x2'));function writeDB(_0x2e3d15){utils[_0xeb67('0x3')](util[_0xeb67('0x4')](_0xeb67('0x5'),_0x2e3d15[_0xeb67('0x6')]===_0xeb67('0x7')?_0x2e3d15[_0xeb67('0x8')]:_0x2e3d15[_0xeb67('0x9')],_0x2e3d15[_0xeb67('0x6')]));utils[_0xeb67('0xa')](_0xeb67('0xb'),_0x2e3d15);}exports[_0xeb67('0xc')]={};exports['blindtransfer']=function(_0x2e29bb){try{utils[_0xeb67('0xd')](util[_0xeb67('0x4')]('[%s][transfers][blindtransfer]',_0x2e29bb[_0xeb67('0x9')]),_0x2e29bb);utils[_0xeb67('0x3')](util[_0xeb67('0x4')](_0xeb67('0xe'),_0x2e29bb[_0xeb67('0x9')],_0x2e29bb[_0xeb67('0xf')],_0x2e29bb[_0xeb67('0x10')],_0x2e29bb[_0xeb67('0x11')],_0x2e29bb[_0xeb67('0x12')]));_0x2e29bb[_0xeb67('0x6')]=_0xeb67('0x13');exports['blinds'][_0x2e29bb[_0xeb67('0x14')]]=_0x2e29bb;writeDB(_0x2e29bb);}catch(_0x17371f){utils['error'](util[_0xeb67('0x4')](_0xeb67('0x15'),_0x2e29bb[_0xeb67('0x9')]),_0x17371f);}};exports[_0xeb67('0x16')]=function(_0x19440b){try{utils[_0xeb67('0xd')](util[_0xeb67('0x4')]('[%s][transfers][attendedtransfer]',_0x19440b['origtransfereruniqueid']),_0x19440b);utils[_0xeb67('0x3')](util[_0xeb67('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x19440b['origtransfereruniqueid'],_0x19440b[_0xeb67('0x17')],_0x19440b[_0xeb67('0x18')],_0x19440b[_0xeb67('0x19')],_0x19440b['transfertargetcalleridname']));_0x19440b=_[_0xeb67('0x1a')](_0x19440b,{'transfererchannel':_0x19440b['origtransfererchannel'],'transferercalleridnum':_0x19440b[_0xeb67('0x17')],'transferercalleridname':_0x19440b[_0xeb67('0x18')],'transfererconnectedlinenum':_0x19440b[_0xeb67('0x1b')],'transfererconnectedlinename':_0x19440b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x19440b[_0xeb67('0x1c')],'transferercontext':_0x19440b[_0xeb67('0x1d')],'transfererexten':_0x19440b[_0xeb67('0x1e')],'transfererlinkedid':_0x19440b['origtransfererlinkedid'],'context':_0x19440b[_0xeb67('0x1f')],'extension':_0x19440b['origtransfererexten'],'type':'attended'});if(_[_0xeb67('0x20')](_0x19440b[_0xeb67('0x21')])){_0x19440b=_[_0xeb67('0x1a')](_0x19440b,{'transfereechannel':_0x19440b[_0xeb67('0x22')],'transfereecalleridnum':_0x19440b['transfertargetcalleridnum'],'transfereecalleridname':_0x19440b[_0xeb67('0x23')],'transfereeconnectedlinenum':_0x19440b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x19440b[_0xeb67('0x24')],'transfereeaccountcode':_0x19440b[_0xeb67('0x25')],'transfereecontext':_0x19440b['transfertargetcontext'],'transfereeexten':_0x19440b[_0xeb67('0x26')],'transfereelinkedid':_0x19440b[_0xeb67('0x27')]});}writeDB(_0x19440b);}catch(_0x1ebc45){utils[_0xeb67('0x28')](util['format']('[%s][transfers][attendedtransfer]',_0x19440b[_0xeb67('0x8')]),_0x1ebc45);}}; \ No newline at end of file +var _0x8981=['transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0x8981,0x7f));var _0x1898=function(_0x4d138e,_0x58211b){_0x4d138e=_0x4d138e-0x0;var _0x4a8935=_0x8981[_0x4d138e];return _0x4a8935;};'use strict';var _=require('lodash');var util=require(_0x1898('0x0'));var utils=require(_0x1898('0x1'));function writeDB(_0x40bca4){utils[_0x1898('0x2')](util['format'](_0x1898('0x3'),_0x40bca4[_0x1898('0x4')]===_0x1898('0x5')?_0x40bca4[_0x1898('0x6')]:_0x40bca4[_0x1898('0x7')],_0x40bca4[_0x1898('0x4')]));utils[_0x1898('0x8')](_0x1898('0x9'),_0x40bca4);}exports[_0x1898('0xa')]={};exports[_0x1898('0xb')]=function(_0x344965){try{utils[_0x1898('0xc')](util[_0x1898('0xd')]('[%s][transfers][blindtransfer]',_0x344965[_0x1898('0x7')]),_0x344965);utils[_0x1898('0x2')](util[_0x1898('0xd')](_0x1898('0xe'),_0x344965[_0x1898('0x7')],_0x344965[_0x1898('0xf')],_0x344965[_0x1898('0x10')],_0x344965[_0x1898('0x11')],_0x344965[_0x1898('0x12')]));_0x344965[_0x1898('0x4')]=_0x1898('0x13');exports[_0x1898('0xa')][_0x344965[_0x1898('0x14')]]=_0x344965;writeDB(_0x344965);}catch(_0x366f9f){utils[_0x1898('0x15')](util['format'](_0x1898('0x16'),_0x344965[_0x1898('0x7')]),_0x366f9f);}};exports['attendedtransfer']=function(_0x10723b){try{utils[_0x1898('0xc')](util['format'](_0x1898('0x17'),_0x10723b[_0x1898('0x6')]),_0x10723b);utils['info'](util[_0x1898('0xd')](_0x1898('0x18'),_0x10723b[_0x1898('0x6')],_0x10723b[_0x1898('0x19')],_0x10723b[_0x1898('0x1a')],_0x10723b[_0x1898('0x1b')],_0x10723b['transfertargetcalleridname']));_0x10723b=_[_0x1898('0x1c')](_0x10723b,{'transfererchannel':_0x10723b[_0x1898('0x1d')],'transferercalleridnum':_0x10723b[_0x1898('0x19')],'transferercalleridname':_0x10723b['origtransferercalleridname'],'transfererconnectedlinenum':_0x10723b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x10723b[_0x1898('0x1e')],'transfereraccountcode':_0x10723b[_0x1898('0x1f')],'transferercontext':_0x10723b['secondtransferercontext'],'transfererexten':_0x10723b[_0x1898('0x20')],'transfererlinkedid':_0x10723b['origtransfererlinkedid'],'context':_0x10723b['origtransferercontext'],'extension':_0x10723b[_0x1898('0x21')],'type':'attended'});if(_[_0x1898('0x22')](_0x10723b['transfereechannel'])){_0x10723b=_['assign'](_0x10723b,{'transfereechannel':_0x10723b[_0x1898('0x23')],'transfereecalleridnum':_0x10723b['transfertargetcalleridnum'],'transfereecalleridname':_0x10723b[_0x1898('0x24')],'transfereeconnectedlinenum':_0x10723b[_0x1898('0x25')],'transfereeconnectedlinename':_0x10723b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x10723b['transfertargetaccountcode'],'transfereecontext':_0x10723b[_0x1898('0x26')],'transfereeexten':_0x10723b[_0x1898('0x27')],'transfereelinkedid':_0x10723b[_0x1898('0x28')]});}writeDB(_0x10723b);}catch(_0x5d5c62){utils[_0x1898('0x15')](util[_0x1898('0xd')]('[%s][transfers][attendedtransfer]',_0x10723b['origtransfereruniqueid']),_0x5d5c62);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2468254..7a923bd 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 _0x04db=['length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x11af42,_0x88c201){var _0x24a5d8=function(_0x18fa0d){while(--_0x18fa0d){_0x11af42['push'](_0x11af42['shift']());}};_0x24a5d8(++_0x88c201);}(_0x04db,0x6a));var _0xb04d=function(_0x5305ab,_0x5ad712){_0x5305ab=_0x5305ab-0x0;var _0x222544=_0x04db[_0x5305ab];return _0x222544;};'use strict';var BPromise=require(_0xb04d('0x0'));var jayson=require(_0xb04d('0x1'));var moment=require(_0xb04d('0x2'));var util=require(_0xb04d('0x3'));var client=jayson[_0xb04d('0x4')][_0xb04d('0x5')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x3d52a1,_0x309337){logger[_0xb04d('0x6')](_0x3d52a1,_0x309337?util[_0xb04d('0x7')](_0x309337,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4d07b1,_0x55b6e5){logger['debug'](_0x4d07b1,_0x55b6e5?util[_0xb04d('0x7')](_0x55b6e5,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x8')]=function(_0x51cf81,_0x4af65b){logger[_0xb04d('0x8')](_0x51cf81,_0x4af65b?util[_0xb04d('0x7')](_0x4af65b,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x9')]=function(_0x4396b8,_0x5cee8b){return client[_0xb04d('0x9')](_0x4396b8,{'body':_0x5cee8b})[_0xb04d('0xa')](function(_0x2ba38c){logger[_0xb04d('0xb')](_0xb04d('0xc'),_0x4396b8,_0x2ba38c?util['inspect'](_0x2ba38c,{'showHidden':![],'depth':null}):'');})[_0xb04d('0xd')](function(_0x35c371){logger[_0xb04d('0x8')]('[utils][request]\x20name:%s',_0x4396b8,_0x35c371?util[_0xb04d('0x7')](_0x35c371,{'showHidden':![],'depth':null}):'');});};function getUser(_0x503a04){return client[_0xb04d('0x9')](_0xb04d('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xb04d('0xf'),_0xb04d('0x10')],'where':_0x503a04,'limit':0x1}})['then'](function(_0x2efdf8){logger['debug'](_0xb04d('0x11'),JSON[_0xb04d('0x12')](_0x503a04),_0x2efdf8?util[_0xb04d('0x7')](_0x2efdf8,{'showHidden':![],'depth':null}):'');return _0x2efdf8[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2efdf8['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x3dd072){return new BPromise(function(_0x4a5253,_0x1146ad){if(_0x3dd072){return getUser({'internal':_0x3dd072})['then'](function(_0x10e5c2){logger['info'](_0xb04d('0x15'),_0x3dd072,_0x10e5c2?'found':_0xb04d('0x16'));return _0x4a5253(_0x10e5c2);})['catch'](function(_0x44fc8f){logger[_0xb04d('0x8')](_0xb04d('0x17'),_0x44fc8f?util['inspect'](_0x44fc8f,{'showHidden':![],'depth':null}):'');return _0x4a5253(null);});}return _0x4a5253(null);});};exports['getUserByInterface']=function(_0x3b8a10){return new BPromise(function(_0x531ec0,_0xb4c63e){if(_0x3b8a10){return getUser({'interface':_0x3b8a10})[_0xb04d('0xa')](function(_0x2f1bfb){logger[_0xb04d('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3b8a10,_0x2f1bfb?_0xb04d('0x18'):'notfound');return _0x531ec0(_0x2f1bfb);})['catch'](function(_0x31062e){logger[_0xb04d('0x8')](_0xb04d('0x19'),_0x31062e?util[_0xb04d('0x7')](_0x31062e,{'showHidden':![],'depth':null}):'');return _0x531ec0(null);});}return _0x531ec0(null);});};exports['getUserByName']=function(_0x17c13c){return new BPromise(function(_0x1fc130,_0x1eea69){if(_0x17c13c){return getUser({'name':_0x17c13c})[_0xb04d('0xa')](function(_0x1d7b98){logger['info'](_0xb04d('0x1a'),_0x17c13c,_0x1d7b98?_0xb04d('0x18'):_0xb04d('0x16'));return _0x1fc130(_0x1d7b98);})[_0xb04d('0xd')](function(_0x3571c5){logger[_0xb04d('0x8')](_0xb04d('0x1b'),_0x3571c5?util[_0xb04d('0x7')](_0x3571c5,{'showHidden':![],'depth':null}):'');return _0x1fc130(null);});}return _0x1fc130(null);});};exports['getVoiceQueueByName']=function(_0x14e59d){return new BPromise(function(_0x1671ae,_0x57f442){if(_0x14e59d){return client[_0xb04d('0x9')](_0xb04d('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xb04d('0xf'),_0xb04d('0x1d'),'acw','acwTimeout'],'where':{'name':_0x14e59d},'limit':0x1}})[_0xb04d('0xa')](function(_0x2e959c){logger[_0xb04d('0xb')]('[utils][getVoiceQueueByName]\x20name:%s',_0x14e59d,_0x2e959c?util[_0xb04d('0x7')](_0x2e959c,{'showHidden':![],'depth':null}):'');logger['info'](_0xb04d('0x1e'),_0x14e59d,_0x2e959c?_0xb04d('0x18'):'notfound');return _0x1671ae(_0x2e959c[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2e959c[_0xb04d('0x13')][0x0]:null);})['catch'](function(_0x1c5842){logger[_0xb04d('0x8')](_0xb04d('0x1f'),_0x1c5842?util[_0xb04d('0x7')](_0x1c5842,{'showHidden':![],'depth':null}):'');return _0x1671ae(null);});}return _0x1671ae(null);});};exports[_0xb04d('0x20')]=function(_0x3a8a2b,_0x7abef7){return moment(_0x3a8a2b)['add'](_0x7abef7,'seconds')['format'](_0xb04d('0x21'));};exports[_0xb04d('0x22')]=function(_0x2e0861,_0x1ee89d){return moment(_0x2e0861)[_0xb04d('0x23')](_0x1ee89d,_0xb04d('0x24'))[_0xb04d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x26')]=function(_0x4d0665,_0x262c29){return moment(_0x4d0665)['diff'](moment(_0x262c29),_0xb04d('0x24'));};exports['sumTime']=function(_0x41b63c,_0x200634){return parseInt(_0x41b63c,0xa)+parseInt(_0x200634,0xa);};exports[_0xb04d('0x27')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x28')]=function(_0x2da4e5,_0x1af5be){if(_0x1af5be){return moment(_0x2da4e5)['isAfter'](_0x1af5be);}return!![];};exports[_0xb04d('0x29')]=function(_0x49a75d,_0x4f3847){if(_0x4f3847){return moment(_0x49a75d)['isBefore'](_0x4f3847);}else if(_0x49a75d){return!![];}return![];}; \ No newline at end of file +var _0x56b1=['now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','then','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime'];(function(_0x452d3b,_0x18ba27){var _0x520d2e=function(_0x4f36e9){while(--_0x4f36e9){_0x452d3b['push'](_0x452d3b['shift']());}};_0x520d2e(++_0x18ba27);}(_0x56b1,0x168));var _0x156b=function(_0x34f2a8,_0x1e0053){_0x34f2a8=_0x34f2a8-0x0;var _0x4059a6=_0x56b1[_0x34f2a8];return _0x4059a6;};'use strict';var BPromise=require(_0x156b('0x0'));var jayson=require(_0x156b('0x1'));var moment=require('moment');var util=require(_0x156b('0x2'));var client=jayson[_0x156b('0x3')][_0x156b('0x4')]({'port':0x2329});var logger=require(_0x156b('0x5'))('xdr');exports[_0x156b('0x6')]=function(_0x169f5e,_0x52c342){logger[_0x156b('0x6')](_0x169f5e,_0x52c342?util[_0x156b('0x7')](_0x52c342,{'showHidden':![],'depth':null}):'');};exports[_0x156b('0x8')]=function(_0xc3cacf,_0xd1828a){logger['debug'](_0xc3cacf,_0xd1828a?util[_0x156b('0x7')](_0xd1828a,{'showHidden':![],'depth':null}):'');};exports[_0x156b('0x9')]=function(_0x4bf717,_0x40a2a7){logger[_0x156b('0x9')](_0x4bf717,_0x40a2a7?util['inspect'](_0x40a2a7,{'showHidden':![],'depth':null}):'');};exports[_0x156b('0xa')]=function(_0x31d190,_0x15bb5a){return client[_0x156b('0xa')](_0x31d190,{'body':_0x15bb5a})['then'](function(_0x424af6){logger[_0x156b('0x8')](_0x156b('0xb'),_0x31d190,_0x424af6?util[_0x156b('0x7')](_0x424af6,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x30b8ec){logger[_0x156b('0x9')](_0x156b('0xb'),_0x31d190,_0x30b8ec?util[_0x156b('0x7')](_0x30b8ec,{'showHidden':![],'depth':null}):'');});};function getUser(_0xa1a499){return client['request'](_0x156b('0xc'),{'options':{'raw':!![],'attributes':['id',_0x156b('0xd'),_0x156b('0xe'),_0x156b('0xf')],'where':_0xa1a499,'limit':0x1}})['then'](function(_0xc6e4b2){logger[_0x156b('0x8')]('[utils][getUser]\x20where:%s',JSON[_0x156b('0x10')](_0xa1a499),_0xc6e4b2?util[_0x156b('0x7')](_0xc6e4b2,{'showHidden':![],'depth':null}):'');return _0xc6e4b2[_0x156b('0x11')][_0x156b('0x12')]?_0xc6e4b2[_0x156b('0x11')][0x0]:null;});}exports[_0x156b('0x13')]=function(_0x25b448){return new BPromise(function(_0x1d2b91,_0x5a3388){if(_0x25b448){return getUser({'internal':_0x25b448})['then'](function(_0x558075){logger[_0x156b('0x6')](_0x156b('0x14'),_0x25b448,_0x558075?_0x156b('0x15'):_0x156b('0x16'));return _0x1d2b91(_0x558075);})[_0x156b('0x17')](function(_0x25b510){logger['error'](_0x156b('0x18'),_0x25b510?util[_0x156b('0x7')](_0x25b510,{'showHidden':![],'depth':null}):'');return _0x1d2b91(null);});}return _0x1d2b91(null);});};exports[_0x156b('0x19')]=function(_0xc7f056){return new BPromise(function(_0x4814e7,_0x481be6){if(_0xc7f056){return getUser({'interface':_0xc7f056})[_0x156b('0x1a')](function(_0x3fd20b){logger['info'](_0x156b('0x1b'),_0xc7f056,_0x3fd20b?'found':_0x156b('0x16'));return _0x4814e7(_0x3fd20b);})['catch'](function(_0x1d05b4){logger[_0x156b('0x9')](_0x156b('0x1c'),_0x1d05b4?util[_0x156b('0x7')](_0x1d05b4,{'showHidden':![],'depth':null}):'');return _0x4814e7(null);});}return _0x4814e7(null);});};exports['getUserByName']=function(_0x2ef261){return new BPromise(function(_0x38a5d4,_0x38d4e7){if(_0x2ef261){return getUser({'name':_0x2ef261})[_0x156b('0x1a')](function(_0x100f3){logger[_0x156b('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2ef261,_0x100f3?_0x156b('0x15'):_0x156b('0x16'));return _0x38a5d4(_0x100f3);})[_0x156b('0x17')](function(_0x2ca15f){logger[_0x156b('0x9')](_0x156b('0x1d'),_0x2ca15f?util[_0x156b('0x7')](_0x2ca15f,{'showHidden':![],'depth':null}):'');return _0x38a5d4(null);});}return _0x38a5d4(null);});};exports[_0x156b('0x1e')]=function(_0x13e3cb){return new BPromise(function(_0xf3f553,_0x176695){if(_0x13e3cb){return client[_0x156b('0xa')](_0x156b('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x156b('0xe'),_0x156b('0x20'),_0x156b('0x21'),_0x156b('0x22')],'where':{'name':_0x13e3cb},'limit':0x1}})[_0x156b('0x1a')](function(_0x2c32d8){logger[_0x156b('0x8')](_0x156b('0x23'),_0x13e3cb,_0x2c32d8?util[_0x156b('0x7')](_0x2c32d8,{'showHidden':![],'depth':null}):'');logger[_0x156b('0x6')](_0x156b('0x24'),_0x13e3cb,_0x2c32d8?'found':_0x156b('0x16'));return _0xf3f553(_0x2c32d8['result']['length']?_0x2c32d8[_0x156b('0x11')][0x0]:null);})['catch'](function(_0x42d3a9){logger[_0x156b('0x9')](_0x156b('0x25'),_0x42d3a9?util[_0x156b('0x7')](_0x42d3a9,{'showHidden':![],'depth':null}):'');return _0xf3f553(null);});}return _0xf3f553(null);});};exports[_0x156b('0x26')]=function(_0x17fb55,_0x1590ea){return moment(_0x17fb55)[_0x156b('0x27')](_0x1590ea,_0x156b('0x28'))[_0x156b('0x29')](_0x156b('0x2a'));};exports[_0x156b('0x2b')]=function(_0x3d1e3a,_0x295fa3){return moment(_0x3d1e3a)[_0x156b('0x2c')](_0x295fa3,_0x156b('0x28'))[_0x156b('0x29')](_0x156b('0x2a'));};exports[_0x156b('0x2d')]=function(_0x134d99,_0x5873db){return moment(_0x134d99)[_0x156b('0x2e')](moment(_0x5873db),_0x156b('0x28'));};exports[_0x156b('0x2f')]=function(_0x3118c3,_0x1486f2){return parseInt(_0x3118c3,0xa)+parseInt(_0x1486f2,0xa);};exports[_0x156b('0x30')]=function(){return moment()['format'](_0x156b('0x2a'));};exports[_0x156b('0x31')]=function(_0x4b5736,_0x8e7f41){if(_0x8e7f41){return moment(_0x4b5736)[_0x156b('0x31')](_0x8e7f41);}return!![];};exports[_0x156b('0x32')]=function(_0x4bbbaf,_0x49999c){if(_0x49999c){return moment(_0x4bbbaf)[_0x156b('0x32')](_0x49999c);}else if(_0x4bbbaf){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 ad7e77f..dc39c20 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 _0xe53b=['timestamp','error','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','x-forwarded-for','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','remoteAddress','statusCode','other','agent_name','test','url','setupLoggers','lodash','express-winston','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','role','name','ensureDir','then','client','catch','user','no-user','data'];(function(_0x307583,_0x28983a){var _0x4b7055=function(_0x2276a6){while(--_0x2276a6){_0x307583['push'](_0x307583['shift']());}};_0x4b7055(++_0x28983a);}(_0xe53b,0x15d));var _0xbe53=function(_0x2a8150,_0x38262b){_0x2a8150=_0x2a8150-0x0;var _0x4472a3=_0xe53b[_0x2a8150];return _0x4472a3;};var fs=require('fs-extra');var _=require(_0xbe53('0x0'));var ewinston=require(_0xbe53('0x1'));var path=require('path');var util=require(_0xbe53('0x2'));var fileLogger=require('./loggers')[_0xbe53('0x3')];var safeTemplate=require(_0xbe53('0x4'))[_0xbe53('0x5')];var maskSensitiveData=require(_0xbe53('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x368e5f(_0x364ce4){var _0x2e5e58=path[_0xbe53('0x7')](_0xbe53('0x8'),_0xbe53('0x9'),'xcally');var _0x34222a=path[_0xbe53('0x7')]('client',_0x364ce4[_0xbe53('0xa')]+'-'+_0x364ce4[_0xbe53('0xb')]);return fs[_0xbe53('0xc')](path[_0xbe53('0x7')](_0x2e5e58,_0x34222a))[_0xbe53('0xd')](function(){var _0xcbbf27=fileLogger(_0xbe53('0xe'),path[_0xbe53('0x7')](_0x2e5e58,_0x34222a));return _0xcbbf27;})[_0xbe53('0xf')](function(_0x43123f){throw _0x43123f;});}this[_0xbe53('0x9')]=function(_0x213075,_0x45385e,_0xe34562,_0x226660){return _0x368e5f(_0x213075[_0xbe53('0x10')])[_0xbe53('0xd')](function(_0x388382){var _0x4bdc07=_0x388382[_0x45385e];return _0x4bdc07;})[_0xbe53('0xd')](function(_0x152fab){var _0x28a719=_0x213075[_0xbe53('0x10')]?_0x213075[_0xbe53('0x10')]['id']:_0xbe53('0x11');var _0x19cbbb=_0x226660[_0xbe53('0x12')];var _0x335f13=_0x226660[_0xbe53('0x13')];var _0x41344b=new Date(Number(_0x335f13));return _0x152fab(_0x28a719,_0x41344b,_0xe34562,_0x19cbbb);})['catch'](function(_0x1798b3){fileLogger('client')[_0xbe53('0x14')](_0x1798b3);});};}function setupLoggers(_0x36a656){return new Promise(function(_0x33d955){var _0x234149=new ClientSideLogger();var _0x3a76b8=fileLogger('api');var _0x4dfe08=fileLogger(_0xbe53('0x15'));_0x36a656[_0xbe53('0x16')](_0xbe53('0x17'),_0x234149);_0x36a656[_0xbe53('0x18')](ewinston[_0xbe53('0x19')]({'winstonInstance':_0x3a76b8,'meta':![],'statusLevels':!![],'msg':function(_0x144376,_0x22a069){var _0x403b13=_0xbe53('0x1a');if(!_['isEmpty'](_0x144376[_0xbe53('0x1b')])){_0x403b13+=_0xbe53('0x1c');var _0x4345f8=_0x144376[_0xbe53('0x1b')];maskSensitiveData(_0x4345f8);}return safeTemplate(util[_0xbe53('0x1d')](_0x403b13,_0x144376[_0xbe53('0x1e')],_0x144376['headers']['x-forwarded-for']?_0x144376['headers'][_0xbe53('0x1f')]:_0x144376['connection']['remoteAddress']||_0x144376['ip'],_0x144376['url'],_0x22a069['statusCode'],_0x22a069[_0xbe53('0x20')],_0x144376[_0xbe53('0x10')]?_0x144376[_0xbe53('0x10')]['id']:null,_0x144376['user']?_0x144376[_0xbe53('0x10')][_0xbe53('0xb')]:null,_0x144376[_0xbe53('0x10')]?_0x144376['user'][_0xbe53('0xa')]:null,_0x4345f8?util[_0xbe53('0x21')](_0x4345f8,![],null):''));}}));_0x36a656[_0xbe53('0x18')](ewinston[_0xbe53('0x19')]({'winstonInstance':_0x4dfe08,'meta':![],'statusLevels':!![],'msg':function(_0x1c846b,_0x3bba07){var _0x2a2128=_0xbe53('0x22');if(_0x1c846b['body']&&_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x23')]&&_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x24')]){_0x2a2128=_0xbe53('0x25');}return util['format'](_0x2a2128,_0x1c846b[_0xbe53('0x1e')],_0x1c846b[_0xbe53('0x26')]['x-forwarded-for']?_0x1c846b['headers'][_0xbe53('0x1f')]:_0x1c846b['connection'][_0xbe53('0x27')]||_0x1c846b['ip'],_0x1c846b['url'],_0x3bba07[_0xbe53('0x28')],_0x3bba07['responseTime'],_0x1c846b[_0xbe53('0x10')]?_0x1c846b['user']['id']:null,_0x1c846b[_0xbe53('0x10')]?_0x1c846b['user'][_0xbe53('0xb')]:null,_0x1c846b[_0xbe53('0x10')]?_0x1c846b[_0xbe53('0x10')][_0xbe53('0xa')]:null,_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body']['device']?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x23')]:_0xbe53('0x29'),_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body'][_0xbe53('0x24')]?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x24')]:'',_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body']['agent_name']?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x2a')]:'');},'ignoreRoute':function(_0x34f44d){var _0x17480d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x17480d[_0xbe53('0x2b')](_0x34f44d[_0xbe53('0x2c')]);}}));return _0x33d955();});}exports[_0xbe53('0x2d')]=setupLoggers; \ No newline at end of file +var _0x78bb=['other','agent_id','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','log','join','name','ensureDir','then','client','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','format','method','headers','x-forwarded-for','remoteAddress','url','role','inspect','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','statusCode','responseTime'];(function(_0x43a4c2,_0x4e400f){var _0x3cd4fb=function(_0x28ec58){while(--_0x28ec58){_0x43a4c2['push'](_0x43a4c2['shift']());}};_0x3cd4fb(++_0x4e400f);}(_0x78bb,0x1da));var _0xb78b=function(_0x651909,_0x15c6b4){_0x651909=_0x651909-0x0;var _0x572299=_0x78bb[_0x651909];return _0x572299;};var fs=require(_0xb78b('0x0'));var _=require(_0xb78b('0x1'));var ewinston=require(_0xb78b('0x2'));var path=require(_0xb78b('0x3'));var util=require(_0xb78b('0x4'));var fileLogger=require(_0xb78b('0x5'))[_0xb78b('0x6')];var safeTemplate=require(_0xb78b('0x7'))['safeTemplate'];var maskSensitiveData=require(_0xb78b('0x8'))[_0xb78b('0x9')];function ClientSideLogger(){function _0xd810b6(_0x368488){var _0x4e8e61=path['join']('/var',_0xb78b('0xa'),'xcally');var _0xd3a20f=path[_0xb78b('0xb')]('client',_0x368488['role']+'-'+_0x368488[_0xb78b('0xc')]);return fs[_0xb78b('0xd')](path['join'](_0x4e8e61,_0xd3a20f))[_0xb78b('0xe')](function(){var _0x3d78c0=fileLogger(_0xb78b('0xf'),path[_0xb78b('0xb')](_0x4e8e61,_0xd3a20f));return _0x3d78c0;})[_0xb78b('0x10')](function(_0x5f2163){throw _0x5f2163;});}this[_0xb78b('0xa')]=function(_0x455e41,_0x412a0d,_0xf41583,_0x4a5053){return _0xd810b6(_0x455e41[_0xb78b('0x11')])[_0xb78b('0xe')](function(_0x7c862){var _0x50f26f=_0x7c862[_0x412a0d];return _0x50f26f;})[_0xb78b('0xe')](function(_0x573482){var _0x2e08bc=_0x455e41[_0xb78b('0x11')]?_0x455e41[_0xb78b('0x11')]['id']:_0xb78b('0x12');var _0x2bd542=_0x4a5053[_0xb78b('0x13')];var _0xd670a4=_0x4a5053['timestamp'];var _0x2eba5f=new Date(Number(_0xd670a4));return _0x573482(_0x2e08bc,_0x2eba5f,_0xf41583,_0x2bd542);})[_0xb78b('0x10')](function(_0x5b507a){fileLogger(_0xb78b('0xf'))[_0xb78b('0x14')](_0x5b507a);});};}function setupLoggers(_0x44290e){return new Promise(function(_0x1ec56b){var _0x10e97f=new ClientSideLogger();var _0x48c1e6=fileLogger(_0xb78b('0x15'));var _0xeb6b6d=fileLogger(_0xb78b('0x16'));_0x44290e[_0xb78b('0x17')](_0xb78b('0x18'),_0x10e97f);_0x44290e[_0xb78b('0x19')](ewinston[_0xb78b('0x1a')]({'winstonInstance':_0x48c1e6,'meta':![],'statusLevels':!![],'msg':function(_0x996962,_0xc4652a){var _0x1abbc1=_0xb78b('0x1b');if(!_[_0xb78b('0x1c')](_0x996962[_0xb78b('0x1d')])){_0x1abbc1+='\x20body=%s';var _0x19ffc5=_0x996962[_0xb78b('0x1d')];maskSensitiveData(_0x19ffc5);}return safeTemplate(util[_0xb78b('0x1e')](_0x1abbc1,_0x996962[_0xb78b('0x1f')],_0x996962[_0xb78b('0x20')][_0xb78b('0x21')]?_0x996962[_0xb78b('0x20')]['x-forwarded-for']:_0x996962['connection'][_0xb78b('0x22')]||_0x996962['ip'],_0x996962[_0xb78b('0x23')],_0xc4652a['statusCode'],_0xc4652a['responseTime'],_0x996962['user']?_0x996962[_0xb78b('0x11')]['id']:null,_0x996962[_0xb78b('0x11')]?_0x996962['user'][_0xb78b('0xc')]:null,_0x996962[_0xb78b('0x11')]?_0x996962[_0xb78b('0x11')][_0xb78b('0x24')]:null,_0x19ffc5?util[_0xb78b('0x25')](_0x19ffc5,![],null):''));}}));_0x44290e[_0xb78b('0x19')](ewinston['logger']({'winstonInstance':_0xeb6b6d,'meta':![],'statusLevels':!![],'msg':function(_0x2bc0ca,_0x760785){var _0x1fdfde='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2bc0ca[_0xb78b('0x1d')]&&_0x2bc0ca[_0xb78b('0x1d')][_0xb78b('0x26')]&&_0x2bc0ca[_0xb78b('0x1d')]['agent_id']){_0x1fdfde=_0xb78b('0x27');}return util[_0xb78b('0x1e')](_0x1fdfde,_0x2bc0ca[_0xb78b('0x1f')],_0x2bc0ca[_0xb78b('0x20')][_0xb78b('0x21')]?_0x2bc0ca[_0xb78b('0x20')]['x-forwarded-for']:_0x2bc0ca[_0xb78b('0x28')][_0xb78b('0x22')]||_0x2bc0ca['ip'],_0x2bc0ca[_0xb78b('0x23')],_0x760785[_0xb78b('0x29')],_0x760785[_0xb78b('0x2a')],_0x2bc0ca[_0xb78b('0x11')]?_0x2bc0ca[_0xb78b('0x11')]['id']:null,_0x2bc0ca[_0xb78b('0x11')]?_0x2bc0ca['user'][_0xb78b('0xc')]:null,_0x2bc0ca['user']?_0x2bc0ca['user'][_0xb78b('0x24')]:null,_0x2bc0ca[_0xb78b('0x1d')]&&_0x2bc0ca['body'][_0xb78b('0x26')]?_0x2bc0ca[_0xb78b('0x1d')][_0xb78b('0x26')]:_0xb78b('0x2b'),_0x2bc0ca[_0xb78b('0x1d')]&&_0x2bc0ca[_0xb78b('0x1d')][_0xb78b('0x2c')]?_0x2bc0ca[_0xb78b('0x1d')]['agent_id']:'',_0x2bc0ca['body']&&_0x2bc0ca[_0xb78b('0x1d')][_0xb78b('0x2d')]?_0x2bc0ca[_0xb78b('0x1d')][_0xb78b('0x2d')]:'');},'ignoreRoute':function(_0x477da6){var _0x343fc7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x343fc7['test'](_0x477da6[_0xb78b('0x23')]);}}));return _0x1ec56b();});}exports[_0xb78b('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index daf5837..ea137c4 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f08=['join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','clone','hours','minutes','startOf','day','endOf','isBetween','includes','dowCompare','date','min','domCompare','format','MMM','monthCompare','guess','isMoment','padStart','length','iftime','lodash','moment-timezone','source'];(function(_0x5f2aea,_0xf7936f){var _0x18f50b=function(_0x366fac){while(--_0x366fac){_0x5f2aea['push'](_0x5f2aea['shift']());}};_0x18f50b(++_0xf7936f);}(_0x8f08,0x1b9));var _0x88f0=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x8f08[_0x29e35f];return _0x266b74;};var _=require(_0x88f0('0x0'));var moment=require(_0x88f0('0x1'));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(_0x3f09cf){return _0x3f09cf[_0x88f0('0x2')];})[_0x88f0('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x88f0('0x4');var EINVALID_DATE=_0x88f0('0x5');function throwIfDateNotValid(_0x926840){if(!_0x926840['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x25f250){var _0x42fe9b=_0x25f250[_0x88f0('0x6')](':')[_0x88f0('0x7')](function(_0x3b816e){return parseInt(_0x3b816e,0xa);});var _0x59168a=_0x42fe9b[0x0];var _0x26727e=_0x42fe9b[0x1];if(_0x59168a<0x0||_0x59168a>0x17||_0x26727e<0x0||_0x26727e>0x3b){throw new Error(EINVALID_DATE);}return[_0x59168a,_0x26727e];}function circularDoWInterval(_0x39fa07,_0x5abfca){if(_0x39fa07===_0x5abfca){return[_0x39fa07];}else{var _0x51175c=moment[_0x88f0('0x8')]();moment[_0x88f0('0x8')]('en');var _0x245328=moment[_0x88f0('0x9')]()[_0x88f0('0x7')](function(_0x4f8af2){return _0x4f8af2[_0x88f0('0xa')]();});moment['locale'](_0x51175c);var _0x82bf08=_0x245328[_0x88f0('0xb')](_0x39fa07);var _0x9743f6=_0x245328['indexOf'](_0x5abfca);if(_0x9743f6>_0x82bf08){return _0x245328['slice'](_0x82bf08,_0x9743f6+0x1);}else{var _0x1e9137=_0x245328['slice'](0x0,_0x9743f6+0x1);var _0x1d3039=_0x245328[_0x88f0('0xc')](_0x82bf08);return _0x1d3039[_0x88f0('0xd')](_0x1e9137);}}}module[_0x88f0('0xe')][_0x88f0('0xf')]=circularDoWInterval;function circularMonthInterval(_0x25395c,_0x37ae58){if(_0x25395c===_0x37ae58){return[_0x25395c];}else{var _0x38d8c9=moment[_0x88f0('0x8')]();moment[_0x88f0('0x8')]('en');var _0xe23c3e=moment[_0x88f0('0x10')]()[_0x88f0('0x7')](function(_0x54db52){return _0x54db52[_0x88f0('0xa')]();});moment[_0x88f0('0x8')](_0x38d8c9);var _0x5491b2=_0xe23c3e[_0x88f0('0xb')](_0x25395c);var _0x555244=_0xe23c3e['indexOf'](_0x37ae58);if(_0x555244>_0x5491b2){return _0xe23c3e[_0x88f0('0xc')](_0x5491b2,_0x555244+0x1);}else{var _0x404127=_0xe23c3e[_0x88f0('0xc')](0x0,_0x555244+0x1);var _0x4d7e82=_0xe23c3e['slice'](_0x5491b2);return _0x4d7e82[_0x88f0('0xd')](_0x404127);}}}module[_0x88f0('0xe')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x4c9b9c){var _0x34fd11=parseInt(_0x4c9b9c,0xa);if(_0x34fd11<0x1||_0x34fd11>0x1f){throw new Error(EINVALID_DATE);}return _0x34fd11;}function timeCompare(_0x5642d7,_0x57e54c,_0x582216){var _0x389f50=_0x5642d7[_0x88f0('0x11')]();var _0x1b038c=extractTime(_0x57e54c);var _0x573c4d=_0x1b038c[0x0];var _0x1523fc=_0x1b038c[0x1];var _0x1445d2=_0x5642d7[_0x88f0('0x11')]()[_0x88f0('0x12')](_0x573c4d)[_0x88f0('0x13')](_0x1523fc);throwIfDateNotValid(_0x1445d2);var _0x923d7c=extractTime(_0x582216);var _0x3a42b5=_0x923d7c[0x0];var _0x912608=_0x923d7c[0x1];var _0x4e4eb6=_0x5642d7[_0x88f0('0x11')]()[_0x88f0('0x12')](_0x3a42b5)[_0x88f0('0x13')](_0x912608);throwIfDateNotValid(_0x4e4eb6);if(_0x4e4eb6['isBefore'](_0x1445d2)){var _0x3c0b2c=_0x389f50[_0x88f0('0x11')]()[_0x88f0('0x14')](_0x88f0('0x15'));var _0x431bf7=_0x389f50['clone']()[_0x88f0('0x16')](_0x88f0('0x15'));return _0x389f50[_0x88f0('0x17')](_0x1445d2,_0x431bf7,undefined,'[]')||_0x389f50[_0x88f0('0x17')](_0x3c0b2c,_0x4e4eb6,undefined,'[]');}else{return _0x389f50[_0x88f0('0x17')](_0x1445d2,_0x4e4eb6,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x14ccbc,_0x340e8b,_0x41f903){var _0x464f7b=_0x14ccbc[_0x88f0('0x8')]('en')['format']('ddd')['toLowerCase']();return circularDoWInterval(_0x340e8b,_0x41f903)[_0x88f0('0x18')](_0x464f7b);}module[_0x88f0('0xe')][_0x88f0('0x19')]=dowCompare;function domCompare(_0x19f11f,_0x51f4cb,_0xeee36e){var _0x2f7619=_0x19f11f[_0x88f0('0x1a')]();if(_0x51f4cb===_0xeee36e){return _0x2f7619===_0x51f4cb;}else{var _0x1bc3f4=_0x19f11f['daysInMonth']();var _0xb5b48c=_0x51f4cb<_0xeee36e;let _0x3223b7=![];var _0x477f0b=0x0;var _0x31f34c=0x0;if(_0xb5b48c){_0x477f0b=Math['max'](0x1,_0x51f4cb);_0x31f34c=Math[_0x88f0('0x1b')](_0xeee36e,_0x1bc3f4);_0x3223b7=_0x2f7619>=_0x477f0b&&_0x2f7619<=_0x31f34c;}else{_0x477f0b=Math[_0x88f0('0x1b')](_0x51f4cb,_0x1bc3f4);_0x31f34c=Math['max'](0x1,_0xeee36e);_0x3223b7=_0x2f7619>=_0x477f0b||_0x2f7619<=_0x31f34c;}return _0x3223b7;}}module[_0x88f0('0xe')][_0x88f0('0x1c')]=domCompare;function monthCompare(_0x301d78,_0x23bc7d,_0x3a830e){var _0x249271=_0x301d78['locale']('en')[_0x88f0('0x1d')](_0x88f0('0x1e'))[_0x88f0('0xa')]();return circularMonthInterval(_0x23bc7d,_0x3a830e)[_0x88f0('0x18')](_0x249271);}module['exports'][_0x88f0('0x1f')]=monthCompare;function iftime(_0x2efa88,_0x2a6c3f=moment['tz'][_0x88f0('0x20')](),_0x50e714=moment()){if(!validateRx['test'](_0x2efa88)){throw new Error(EINVALID_STRING);}else{var _0x14a206=(moment[_0x88f0('0x21')](_0x50e714)?_0x50e714[_0x88f0('0x11')]():moment(_0x50e714))['tz'](_0x2a6c3f)[_0x88f0('0x8')]('en');throwIfDateNotValid(_0x14a206);var _0x4eb9e8=_0x2efa88[_0x88f0('0x6')](',');var _0x1a0057=_0x4eb9e8[0x0];var _0xf6f435=_0x4eb9e8[0x1];var _0x9e198=_0x4eb9e8[0x2];var _0xb87f64=_0x4eb9e8[0x3];let _0x2da6d7=!![];if(_0x1a0057!=='*'){var _0x58b325=_0x1a0057[_0x88f0('0x6')]('-');var _0xb12e42=_[_0x88f0('0x22')](_0x58b325[0x0],0x5,'0');var _0x5bee9f=_0x58b325[_0x88f0('0x23')]===0x2?_['padStart'](_0x58b325[0x1],0x5,'0'):_0xb12e42;_0x2da6d7=timeCompare(_0x14a206,_0xb12e42,_0x5bee9f);}let _0x4ddcf1=!![];if(_0xf6f435!=='*'){var _0x26c9a7=_0xf6f435[_0x88f0('0x6')]('-');var _0x329cb6=_0x26c9a7[0x0];var _0x34728e=_0x26c9a7['length']===0x2?_0x26c9a7[0x1]:_0x329cb6;_0x4ddcf1=dowCompare(_0x14a206,_0x329cb6,_0x34728e);}let _0x291c32=!![];if(_0x9e198!=='*'){var _0x13fca7=_0x9e198[_0x88f0('0x6')]('-');var _0x26e6cb=parseDom(_0x13fca7[0x0]);var _0xf7d3e5=_0x13fca7[_0x88f0('0x23')]===0x2?parseDom(_0x13fca7[0x1]):_0x26e6cb;_0x291c32=domCompare(_0x14a206,_0x26e6cb,_0xf7d3e5);}let _0x226bc5=!![];if(_0xb87f64!=='*'){var _0x43b5cd=_0xb87f64[_0x88f0('0x6')]('-');var _0xc18ab9=_0x43b5cd[0x0];var _0x5d60ac=_0x43b5cd['length']===0x2?_0x43b5cd[0x1]:_0x43b5cd[0x0];_0x226bc5=monthCompare(_0x14a206,_0xc18ab9,_0x5d60ac);}return _0x2da6d7&&_0x4ddcf1&&_0x291c32&&_0x226bc5;}}module[_0x88f0('0xe')][_0x88f0('0x24')]=iftime; \ No newline at end of file +var _0x6ee3=['circularMonthInterval','clone','hours','minutes','isBefore','day','isBetween','timeCompare','format','dowCompare','date','daysInMonth','min','MMM','includes','monthCompare','guess','isMoment','split','length','padStart','iftime','lodash','moment-timezone','source','join','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0x6ee3,0xca));var _0x36ee=function(_0x693350,_0x50f927){_0x693350=_0x693350-0x0;var _0x35f7e9=_0x6ee3[_0x693350];return _0x35f7e9;};var _=require(_0x36ee('0x0'));var moment=require(_0x36ee('0x1'));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(_0x37a36c){return _0x37a36c[_0x36ee('0x2')];})[_0x36ee('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x54cf75){if(!_0x54cf75['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4fb2d3){var _0x2038e4=_0x4fb2d3['split'](':')[_0x36ee('0x4')](function(_0x3c5ea4){return parseInt(_0x3c5ea4,0xa);});var _0x1ba630=_0x2038e4[0x0];var _0x43692d=_0x2038e4[0x1];if(_0x1ba630<0x0||_0x1ba630>0x17||_0x43692d<0x0||_0x43692d>0x3b){throw new Error(EINVALID_DATE);}return[_0x1ba630,_0x43692d];}function circularDoWInterval(_0x45837c,_0x2a234d){if(_0x45837c===_0x2a234d){return[_0x45837c];}else{var _0x3acca7=moment[_0x36ee('0x5')]();moment[_0x36ee('0x5')]('en');var _0x1ba65d=moment[_0x36ee('0x6')]()[_0x36ee('0x4')](function(_0x3a5075){return _0x3a5075[_0x36ee('0x7')]();});moment['locale'](_0x3acca7);var _0x2faa02=_0x1ba65d[_0x36ee('0x8')](_0x45837c);var _0x3077a3=_0x1ba65d[_0x36ee('0x8')](_0x2a234d);if(_0x3077a3>_0x2faa02){return _0x1ba65d[_0x36ee('0x9')](_0x2faa02,_0x3077a3+0x1);}else{var _0x50331c=_0x1ba65d[_0x36ee('0x9')](0x0,_0x3077a3+0x1);var _0xe8abdc=_0x1ba65d[_0x36ee('0x9')](_0x2faa02);return _0xe8abdc[_0x36ee('0xa')](_0x50331c);}}}module[_0x36ee('0xb')][_0x36ee('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5b71e5,_0xf41c92){if(_0x5b71e5===_0xf41c92){return[_0x5b71e5];}else{var _0x11f51a=moment[_0x36ee('0x5')]();moment['locale']('en');var _0x32f0ab=moment[_0x36ee('0xd')]()[_0x36ee('0x4')](function(_0x2b7bf5){return _0x2b7bf5[_0x36ee('0x7')]();});moment['locale'](_0x11f51a);var _0x374860=_0x32f0ab[_0x36ee('0x8')](_0x5b71e5);var _0x1e4acd=_0x32f0ab[_0x36ee('0x8')](_0xf41c92);if(_0x1e4acd>_0x374860){return _0x32f0ab[_0x36ee('0x9')](_0x374860,_0x1e4acd+0x1);}else{var _0x372bc8=_0x32f0ab[_0x36ee('0x9')](0x0,_0x1e4acd+0x1);var _0x438814=_0x32f0ab[_0x36ee('0x9')](_0x374860);return _0x438814['concat'](_0x372bc8);}}}module[_0x36ee('0xb')][_0x36ee('0xe')]=circularMonthInterval;function parseDom(_0xd34fee){var _0xf58ebb=parseInt(_0xd34fee,0xa);if(_0xf58ebb<0x1||_0xf58ebb>0x1f){throw new Error(EINVALID_DATE);}return _0xf58ebb;}function timeCompare(_0x3db418,_0x4b59bb,_0x32c36f){var _0x237a24=_0x3db418[_0x36ee('0xf')]();var _0x5e3f04=extractTime(_0x4b59bb);var _0x102534=_0x5e3f04[0x0];var _0x5ef576=_0x5e3f04[0x1];var _0x43ee56=_0x3db418[_0x36ee('0xf')]()['hours'](_0x102534)['minutes'](_0x5ef576);throwIfDateNotValid(_0x43ee56);var _0x3ffcc7=extractTime(_0x32c36f);var _0x502993=_0x3ffcc7[0x0];var _0x24cc3f=_0x3ffcc7[0x1];var _0x37b9b5=_0x3db418[_0x36ee('0xf')]()[_0x36ee('0x10')](_0x502993)[_0x36ee('0x11')](_0x24cc3f);throwIfDateNotValid(_0x37b9b5);if(_0x37b9b5[_0x36ee('0x12')](_0x43ee56)){var _0x185b98=_0x237a24[_0x36ee('0xf')]()['startOf'](_0x36ee('0x13'));var _0x4a0aff=_0x237a24[_0x36ee('0xf')]()['endOf']('day');return _0x237a24[_0x36ee('0x14')](_0x43ee56,_0x4a0aff,undefined,'[]')||_0x237a24[_0x36ee('0x14')](_0x185b98,_0x37b9b5,undefined,'[]');}else{return _0x237a24['isBetween'](_0x43ee56,_0x37b9b5,undefined,'[]');}}module['exports'][_0x36ee('0x15')]=timeCompare;function dowCompare(_0x6b95ba,_0x1e6bf1,_0x2daa8a){var _0x3fcc4c=_0x6b95ba[_0x36ee('0x5')]('en')[_0x36ee('0x16')]('ddd')['toLowerCase']();return circularDoWInterval(_0x1e6bf1,_0x2daa8a)['includes'](_0x3fcc4c);}module['exports'][_0x36ee('0x17')]=dowCompare;function domCompare(_0x565801,_0x104a28,_0x1baa7d){var _0xfba692=_0x565801[_0x36ee('0x18')]();if(_0x104a28===_0x1baa7d){return _0xfba692===_0x104a28;}else{var _0x3de82e=_0x565801[_0x36ee('0x19')]();var _0x27f4d8=_0x104a28<_0x1baa7d;let _0x1982c2=![];var _0x980b7c=0x0;var _0x11854f=0x0;if(_0x27f4d8){_0x980b7c=Math['max'](0x1,_0x104a28);_0x11854f=Math[_0x36ee('0x1a')](_0x1baa7d,_0x3de82e);_0x1982c2=_0xfba692>=_0x980b7c&&_0xfba692<=_0x11854f;}else{_0x980b7c=Math[_0x36ee('0x1a')](_0x104a28,_0x3de82e);_0x11854f=Math['max'](0x1,_0x1baa7d);_0x1982c2=_0xfba692>=_0x980b7c||_0xfba692<=_0x11854f;}return _0x1982c2;}}module[_0x36ee('0xb')]['domCompare']=domCompare;function monthCompare(_0x457a42,_0x674a3f,_0x124c6e){var _0x2878c6=_0x457a42[_0x36ee('0x5')]('en')[_0x36ee('0x16')](_0x36ee('0x1b'))[_0x36ee('0x7')]();return circularMonthInterval(_0x674a3f,_0x124c6e)[_0x36ee('0x1c')](_0x2878c6);}module[_0x36ee('0xb')][_0x36ee('0x1d')]=monthCompare;function iftime(_0x16b29a,_0x5d30b5=moment['tz'][_0x36ee('0x1e')](),_0x4d8d27=moment()){if(!validateRx['test'](_0x16b29a)){throw new Error(EINVALID_STRING);}else{var _0x594946=(moment[_0x36ee('0x1f')](_0x4d8d27)?_0x4d8d27[_0x36ee('0xf')]():moment(_0x4d8d27))['tz'](_0x5d30b5)[_0x36ee('0x5')]('en');throwIfDateNotValid(_0x594946);var _0x270861=_0x16b29a[_0x36ee('0x20')](',');var _0x520db8=_0x270861[0x0];var _0x18e5f5=_0x270861[0x1];var _0x131961=_0x270861[0x2];var _0x40afe2=_0x270861[0x3];let _0x460ef5=!![];if(_0x520db8!=='*'){var _0x4d5e00=_0x520db8[_0x36ee('0x20')]('-');var _0x54b09b=_['padStart'](_0x4d5e00[0x0],0x5,'0');var _0x435fe9=_0x4d5e00[_0x36ee('0x21')]===0x2?_[_0x36ee('0x22')](_0x4d5e00[0x1],0x5,'0'):_0x54b09b;_0x460ef5=timeCompare(_0x594946,_0x54b09b,_0x435fe9);}let _0x846748=!![];if(_0x18e5f5!=='*'){var _0x413079=_0x18e5f5[_0x36ee('0x20')]('-');var _0x4e1aeb=_0x413079[0x0];var _0x389218=_0x413079[_0x36ee('0x21')]===0x2?_0x413079[0x1]:_0x4e1aeb;_0x846748=dowCompare(_0x594946,_0x4e1aeb,_0x389218);}let _0xf8f4bd=!![];if(_0x131961!=='*'){var _0x5192e1=_0x131961[_0x36ee('0x20')]('-');var _0x4d2d2c=parseDom(_0x5192e1[0x0]);var _0x5e7f4e=_0x5192e1[_0x36ee('0x21')]===0x2?parseDom(_0x5192e1[0x1]):_0x4d2d2c;_0xf8f4bd=domCompare(_0x594946,_0x4d2d2c,_0x5e7f4e);}let _0xa3d709=!![];if(_0x40afe2!=='*'){var _0x13ad2f=_0x40afe2[_0x36ee('0x20')]('-');var _0x1d6cf8=_0x13ad2f[0x0];var _0x4a7567=_0x13ad2f[_0x36ee('0x21')]===0x2?_0x13ad2f[0x1]:_0x13ad2f[0x0];_0xa3d709=monthCompare(_0x594946,_0x1d6cf8,_0x4a7567);}return _0x460ef5&&_0x846748&&_0xf8f4bd&&_0xa3d709;}}module[_0x36ee('0xb')][_0x36ee('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 975b06e..5d681ec 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf322=['white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','%s-%s','error','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow'];(function(_0x34aa94,_0x202a0a){var _0x43ca4a=function(_0x250f5a){while(--_0x250f5a){_0x34aa94['push'](_0x34aa94['shift']());}};_0x43ca4a(++_0x202a0a);}(_0xf322,0x12e));var _0x2f32=function(_0x32423b,_0x36a5a3){_0x32423b=_0x32423b-0x0;var _0x37c63f=_0xf322[_0x32423b];return _0x37c63f;};'use strict';var path=require(_0x2f32('0x0'));var util=require(_0x2f32('0x1'));var moment=require(_0x2f32('0x2'));var winston=require(_0x2f32('0x3'));var config=require(_0x2f32('0x4'));var debugLevel=config[_0x2f32('0x5')]?config['debugLevel'][_0x2f32('0x6')]():_0x2f32('0x7');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':'redBG\x20white','error':_0x2f32('0x8'),'warn':_0x2f32('0x9'),'info':_0x2f32('0xa'),'print':_0x2f32('0xb'),'success':_0x2f32('0xc'),'http':_0x2f32('0xd'),'verbose':_0x2f32('0xe'),'debug':_0x2f32('0xf'),'silly':_0x2f32('0x10')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x5d02e3,_0x11f4d5,_0x27c71f){var _0x15d91d=_0x5d02e3||_0x2f32('0x11');return path[_0x2f32('0x12')](_0x15d91d,util[_0x2f32('0x13')](_0x2f32('0x14'),_0x11f4d5,_0x27c71f));}function formatter(_0xe4987,_0x4ffbf2){_0x4ffbf2[_0x2f32('0x15')]=_0x4ffbf2[_0x2f32('0x15')][_0x2f32('0x16')](/@@{/g,'{{{')[_0x2f32('0x16')](/}@@/g,_0x2f32('0x17'))[_0x2f32('0x16')](/@{/g,'{{')[_0x2f32('0x16')](/}@/g,'}}');return util['format'](_0x2f32('0x18'),moment()[_0x2f32('0x13')](_0x2f32('0x19')),_0x4ffbf2[_0x2f32('0x1a')][_0x2f32('0x1b')](),_0xe4987,_0x4ffbf2[_0x2f32('0x15')]);}function fileFormat(_0x2df906,_0x1ea3ae){_0x1ea3ae[_0x2f32('0x15')]=_0x1ea3ae['message']['replace'](/@@{/g,_0x2f32('0x1c'))[_0x2f32('0x16')](/}@@/g,_0x2f32('0x17'))[_0x2f32('0x16')](/@{/g,'{{')[_0x2f32('0x16')](/}@/g,'}}');var _0x4bd598=_0x1ea3ae[_0x2f32('0x1d')]&&Object['keys'](_0x1ea3ae[_0x2f32('0x1d')])['length']?'\x0a\x09'+JSON[_0x2f32('0x1e')](_0x1ea3ae['meta']):'';return util[_0x2f32('0x13')](_0x2f32('0x1f'),moment()[_0x2f32('0x13')](_0x2f32('0x19')),_0x1ea3ae[_0x2f32('0x1a')][_0x2f32('0x1b')](),_0x2df906,_0x1ea3ae[_0x2f32('0x15')],_0x4bd598);}function consoleLogger(){var _0x370d22=new winston[(_0x2f32('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2f32('0x21'))][(_0x2f32('0x22'))]({'level':_0x2f32('0x23'),'json':![],'formatter':function(_0x3e2f05){return formatter('',_0x3e2f05);}})]});return _0x370d22;}function fileLogger(_0x1b3a01,_0x3adaea){var _0x1753ac=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2f32('0x21'))]['File']({'name':util[_0x2f32('0x13')](_0x2f32('0x24'),_0x1b3a01,_0x2f32('0x25')),'filename':getLogFileName(_0x3adaea,_0x1b3a01,_0x2f32('0x25')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15b7df){return fileFormat(_0x1b3a01,_0x15b7df);}}),new winston[(_0x2f32('0x21'))]['File']({'name':util[_0x2f32('0x13')](_0x2f32('0x24'),_0x1b3a01,debugLevel),'filename':getLogFileName(_0x3adaea,_0x1b3a01,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x105991){return fileFormat(_0x1b3a01,_0x105991);}}),new winston[(_0x2f32('0x21'))]['Console']({'level':'warn','json':![],'formatter':function(_0xa2bd2f){return fileFormat(_0x1b3a01,_0xa2bd2f);}})]});return _0x1753ac;}exports[_0x2f32('0x26')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0xc8d2=['replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','transports','%s-%s','error','warn','consoleLogger','fileLogger','path','util','winston','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','bold\x20white','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc8d2,0x157));var _0x2c8d=function(_0x371ebb,_0xd72c82){_0x371ebb=_0x371ebb-0x0;var _0x5ed285=_0xc8d2[_0x371ebb];return _0x5ed285;};'use strict';var path=require(_0x2c8d('0x0'));var util=require(_0x2c8d('0x1'));var moment=require('moment');var winston=require(_0x2c8d('0x2'));var config=require('../config/environment');var debugLevel=config[_0x2c8d('0x3')]?config[_0x2c8d('0x3')][_0x2c8d('0x4')]():'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':_0x2c8d('0x5'),'error':_0x2c8d('0x6'),'warn':_0x2c8d('0x7'),'info':'white','print':_0x2c8d('0x8'),'success':'bold\x20green','http':_0x2c8d('0x9'),'verbose':_0x2c8d('0xa'),'debug':_0x2c8d('0xb'),'silly':'bold\x20cyan'};winston[_0x2c8d('0xc')](XC_LOG_COLORS);function getLogFileName(_0x315ea0,_0x5bc501,_0x5916d5){var _0x44d96b=_0x315ea0||_0x2c8d('0xd');return path[_0x2c8d('0xe')](_0x44d96b,util[_0x2c8d('0xf')]('%s-%s.log',_0x5bc501,_0x5916d5));}function formatter(_0x5ee0f9,_0x53103e){_0x53103e['message']=_0x53103e[_0x2c8d('0x10')][_0x2c8d('0x11')](/@@{/g,_0x2c8d('0x12'))[_0x2c8d('0x11')](/}@@/g,_0x2c8d('0x13'))[_0x2c8d('0x11')](/@{/g,'{{')[_0x2c8d('0x11')](/}@/g,'}}');return util[_0x2c8d('0xf')](_0x2c8d('0x14'),moment()[_0x2c8d('0xf')](_0x2c8d('0x15')),_0x53103e[_0x2c8d('0x16')]['toUpperCase'](),_0x5ee0f9,_0x53103e[_0x2c8d('0x10')]);}function fileFormat(_0xe96f23,_0x530991){_0x530991[_0x2c8d('0x10')]=_0x530991[_0x2c8d('0x10')][_0x2c8d('0x11')](/@@{/g,_0x2c8d('0x12'))[_0x2c8d('0x11')](/}@@/g,_0x2c8d('0x13'))[_0x2c8d('0x11')](/@{/g,'{{')[_0x2c8d('0x11')](/}@/g,'}}');var _0x3a7325=_0x530991['meta']&&Object[_0x2c8d('0x17')](_0x530991[_0x2c8d('0x18')])[_0x2c8d('0x19')]?'\x0a\x09'+JSON[_0x2c8d('0x1a')](_0x530991[_0x2c8d('0x18')]):'';return util[_0x2c8d('0xf')](_0x2c8d('0x1b'),moment()[_0x2c8d('0xf')](_0x2c8d('0x15')),_0x530991[_0x2c8d('0x16')]['toUpperCase'](),_0xe96f23,_0x530991[_0x2c8d('0x10')],_0x3a7325);}function consoleLogger(){var _0x243d7b=new winston[(_0x2c8d('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x2c8d('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x487846){return formatter('',_0x487846);}})]});return _0x243d7b;}function fileLogger(_0xed2528,_0x689094){var _0x2d4309=new winston[(_0x2c8d('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2c8d('0x1e'))]['File']({'name':util['format'](_0x2c8d('0x1f'),_0xed2528,_0x2c8d('0x20')),'filename':getLogFileName(_0x689094,_0xed2528,_0x2c8d('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1d6f3a){return fileFormat(_0xed2528,_0x1d6f3a);}}),new winston[(_0x2c8d('0x1e'))]['File']({'name':util[_0x2c8d('0xf')](_0x2c8d('0x1f'),_0xed2528,debugLevel),'filename':getLogFileName(_0x689094,_0xed2528,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1df885){return fileFormat(_0xed2528,_0x1df885);}}),new winston['transports'][(_0x2c8d('0x1d'))]({'level':_0x2c8d('0x21'),'json':![],'formatter':function(_0x3b157a){return fileFormat(_0xed2528,_0x3b157a);}})]});return _0x2d4309;}exports[_0x2c8d('0x22')]=consoleLogger;exports[_0x2c8d('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 2c7309b..c1dd3ca 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 _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x582995,_0x55a862){var _0x322b86=function(_0x5e7130){while(--_0x5e7130){_0x582995['push'](_0x582995['shift']());}};_0x322b86(++_0x55a862);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x5f2f[_0x4d613c];return _0x301fe3;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +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(_0x56b987,_0x31f0a5){var _0xe0ffb2=function(_0x27d80c){while(--_0x27d80c){_0x56b987['push'](_0x56b987['shift']());}};_0xe0ffb2(++_0x31f0a5);}(_0x14a0,0x8e));var _0x014a=function(_0x50530f,_0x4f5e81){_0x50530f=_0x50530f-0x0;var _0xa6eded=_0x14a0[_0x50530f];return _0xa6eded;};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 diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 95a1315..64d7d5d 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 _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xda2d,0x102));var _0xdda2=function(_0x28ebdd,_0x5161f5){_0x28ebdd=_0x28ebdd-0x0;var _0x13687c=_0xda2d[_0x28ebdd];return _0x13687c;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate; \ No newline at end of file +var _0x80ed=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x2bb82d,_0x42c7f8){var _0x5e0b92=function(_0x19f44b){while(--_0x19f44b){_0x2bb82d['push'](_0x2bb82d['shift']());}};_0x5e0b92(++_0x42c7f8);}(_0x80ed,0x11c));var _0xd80e=function(_0x4914f5,_0x437b05){_0x4914f5=_0x4914f5-0x0;var _0x6caf03=_0x80ed[_0x4914f5];return _0x6caf03;};var _=require(_0xd80e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5a14b2){return _0x5a14b2==='{{'?_0xd80e('0x1'):_0xd80e('0x2');}function safeTemplate(_0x4329e5){var _0x5052d7=_0x4329e5;if(typeof _0x4329e5===_0xd80e('0x3')){_0x5052d7=_0x4329e5[_0xd80e('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xd80e('0x5')](_0x4329e5)){_0x5052d7=_0x4329e5[_0xd80e('0x6')](function(_0x5ae6c6){return safeTemplate(_0x5ae6c6);});}else if(_[_0xd80e('0x7')](_0x4329e5)){_0x5052d7=Object[_0xd80e('0x8')](_0x4329e5)[_0xd80e('0x9')](function(_0x51c361,_0x411b3a){_0x51c361[_0x411b3a]=safeTemplate(_0x4329e5[_0x411b3a]);return _0x51c361;},{});}return _0x5052d7;}module[_0xd80e('0xa')][_0xd80e('0xb')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index cdfeeb2..b41daca 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb3e=['root','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','string','then','updated','info','Updating\x20app.json','writeJSON','exports','path'];(function(_0x1caeea,_0x1f1470){var _0x110725=function(_0x4c96e6){while(--_0x4c96e6){_0x1caeea['push'](_0x1caeea['shift']());}};_0x110725(++_0x1f1470);}(_0xcb3e,0x1c1));var _0xecb3=function(_0x2632b7,_0x41bffc){_0x2632b7=_0x2632b7-0x0;var _0x553ed9=_0xcb3e[_0x2632b7];return _0x553ed9;};var fs=require('fs-extra');var path=require(_0xecb3('0x0'));var config=require('../config/environment');var root=config[_0xecb3('0x1')];var APP_JSON_PATH=path['resolve'](root,_0xecb3('0x2'));var NODEPATH=path[_0xecb3('0x3')](root,_0xecb3('0x4'));function setLegacyLibsNodeEnvPath(_0x55d778){let _0x5b17e7=![];if(Array[_0xecb3('0x5')](_0x55d778[_0xecb3('0x6')])){var _0x55e870=_0x55d778[_0xecb3('0x6')][_0xecb3('0x7')](function(_0x5a98d9){return _0x5a98d9[_0xecb3('0x8')]===_0xecb3('0x9');});if(_0x55e870>-0x1){var _0x526908=_0x55d778[_0xecb3('0x6')][_0x55e870];if(typeof _0x526908[_0xecb3('0xa')]['NODE_PATH']!==_0xecb3('0xb')){_0x526908[_0xecb3('0xa')]['NODE_PATH']=NODEPATH;_0x5b17e7=!![];}}return{'appConfig':_0x55d778,'updated':_0x5b17e7};}}function updateAppConfig(_0x2928e5){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x412cd0){if(_0x412cd0){return fs['readJSON'](APP_JSON_PATH)[_0xecb3('0xc')](function(_0x213998){var _0x3574af=setLegacyLibsNodeEnvPath(_0x213998);if(_0x3574af[_0xecb3('0xd')]){_0x2928e5[_0xecb3('0xe')](_0xecb3('0xf'));return fs[_0xecb3('0x10')](APP_JSON_PATH,_0x213998,{'spaces':0x2});}else{return Promise[_0xecb3('0x3')]();}});}else{return Promise[_0xecb3('0x3')]();}});}module[_0xecb3('0x11')]=updateAppConfig; \ No newline at end of file +var _0xfcd8=['writeJSON','exports','path','../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','Updating\x20app.json'];(function(_0x1e3a48,_0x27d885){var _0x5b54a5=function(_0x59a894){while(--_0x59a894){_0x1e3a48['push'](_0x1e3a48['shift']());}};_0x5b54a5(++_0x27d885);}(_0xfcd8,0xca));var _0x8fcd=function(_0x674ddb,_0x3a2b0f){_0x674ddb=_0x674ddb-0x0;var _0x133047=_0xfcd8[_0x674ddb];return _0x133047;};var fs=require('fs-extra');var path=require(_0x8fcd('0x0'));var config=require(_0x8fcd('0x1'));var root=config[_0x8fcd('0x2')];var APP_JSON_PATH=path[_0x8fcd('0x3')](root,_0x8fcd('0x4'));var NODEPATH=path['resolve'](root,_0x8fcd('0x5'));function setLegacyLibsNodeEnvPath(_0x42403d){let _0xa4dca7=![];if(Array['isArray'](_0x42403d[_0x8fcd('0x6')])){var _0x171525=_0x42403d['apps'][_0x8fcd('0x7')](function(_0x31df94){return _0x31df94[_0x8fcd('0x8')]===_0x8fcd('0x9');});if(_0x171525>-0x1){var _0x229101=_0x42403d[_0x8fcd('0x6')][_0x171525];if(typeof _0x229101[_0x8fcd('0xa')][_0x8fcd('0xb')]!==_0x8fcd('0xc')){_0x229101[_0x8fcd('0xa')][_0x8fcd('0xb')]=NODEPATH;_0xa4dca7=!![];}}return{'appConfig':_0x42403d,'updated':_0xa4dca7};}}function updateAppConfig(_0x31e3d8){return fs[_0x8fcd('0xd')](APP_JSON_PATH)[_0x8fcd('0xe')](function(_0x4d3b5e){if(_0x4d3b5e){return fs[_0x8fcd('0xf')](APP_JSON_PATH)[_0x8fcd('0xe')](function(_0x974ba6){var _0x58d6e3=setLegacyLibsNodeEnvPath(_0x974ba6);if(_0x58d6e3[_0x8fcd('0x10')]){_0x31e3d8['info'](_0x8fcd('0x11'));return fs[_0x8fcd('0x12')](APP_JSON_PATH,_0x974ba6,{'spaces':0x2});}else{return Promise[_0x8fcd('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x8fcd('0x13')]=updateAppConfig; \ No newline at end of file